diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index 0c8b092c431..00000000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,5 +0,0 @@ -# Code of Conduct - -HashiCorp Community Guidelines apply to you when interacting with the community here on GitHub and contributing code. - -Please read the full text at https://www.hashicorp.com/community-guidelines diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index e0f65a9e954..b618ba29a75 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -25,6 +25,8 @@ ability to merge PRs and respond to issues. - [Documentation Update](#documentation-update) - [Enhancement/Bugfix to a Resource](#enhancementbugfix-to-a-resource) - [Adding Resource Import Support](#adding-resource-import-support) + - [Adding Resource Name Generation Support](#adding-resource-name-generation-support) + - [Adding Resource Tagging Support](#adding-resource-tagging-support) - [New Resource](#new-resource) - [New Service](#new-service) - [New Region](#new-region) @@ -213,6 +215,350 @@ In addition to the below checklist and the items noted in the Extending Terrafor - [ ] _Resource Acceptance Testing Implementation_: In the resource acceptance testing (e.g. `aws/resource_aws_service_thing_test.go`), implementation of `TestStep`s with `ImportState: true` - [ ] _Resource Documentation Implementation_: In the resource documentation (e.g. `website/docs/r/service_thing.html.markdown`), addition of `Import` documentation section at the bottom of the page +#### Adding Resource Name Generation Support + +Terraform AWS Provider resources can use shared logic to support and test name generation, where the operator can choose between an expected naming value, a generated naming value with a prefix, or a fully generated name. + +Implementing name generation support for Terraform AWS Provider resources requires the following, each with its own section below: + +- [ ] _Resource Name Generation Code Implementation_: In the resource code (e.g. `aws/resource_aws_service_thing.go`), implementation of `name_prefix` attribute, along with handling in `Create` function. +- [ ] _Resource Name Generation Testing Implementation_: In the resource acceptance testing (e.g. `aws/resource_aws_service_thing_test.go`), implementation of new acceptance test functions and configurations to exercise new naming logic. +- [ ] _Resource Name Generation Documentation Implementation_: In the resource documentation (e.g. `website/docs/r/service_thing.html.markdown`), addition of `name_prefix` argument and update of `name` argument description. + +##### Resource Name Generation Code Implementation + +- In the resource Go file (e.g. `aws/resource_aws_service_thing.go`), add the following Go import: `"github.com/terraform-providers/terraform-provider-aws/aws/internal/naming"` +- In the resource schema, add the new `name_prefix` attribute and adjust the `name` attribute to be `Optional`, `Computed`, and `ConflictsWith` the `name_prefix` attribute. Ensure to keep any existing schema fields on `name` such as `ValidateFunc`. e.g. + +```go +"name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ConflictsWith: []string{"name_prefix"}, +}, +"name_prefix": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ConflictsWith: []string{"name"}, +}, +``` + +- In the resource `Create` function, switch any calls from `d.Get("name").(string)` to instead use the `naming.Generate()` function, e.g. + +```go +name := naming.Generate(d.Get("name").(string), d.Get("name_prefix").(string)) + +// ... in AWS Go SDK Input types, etc. use aws.String(name) +``` + +##### Resource Name Generation Testing Implementation + +- In the resource testing (e.g. `aws/resource_aws_service_thing_test.go`), add the following Go import: `"github.com/terraform-providers/terraform-provider-aws/aws/internal/naming"` +- In the resource testing, implement two new tests named `_Name_Generated` and `_NamePrefix` with associated configurations, that verifies creating the resource without `name` and `name_prefix` arguments (for the former) and with only the `name_prefix` argument (for the latter). e.g. + +```go +func TestAccAWSServiceThing_Name_Generated(t *testing.T) { + var thing service.ServiceThing + resourceName := "aws_service_thing.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSServiceThingDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSServiceThingConfigNameGenerated(), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSServiceThingExists(resourceName, &thing), + naming.TestCheckResourceAttrNameGenerated(resourceName, "name"), + ), + }, + // If the resource supports import: + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSServiceThing_NamePrefix(t *testing.T) { + var thing service.ServiceThing + resourceName := "aws_service_thing.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSServiceThingDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSServiceThingConfigNamePrefix("tf-acc-test-prefix-"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSServiceThingExists(resourceName, &thing), + naming.TestCheckResourceAttrNameFromPrefix(resourceName, "name", "tf-acc-test-prefix-"), + ), + }, + // If the resource supports import: + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccAWSServiceThingConfigNameGenerated() string { + return fmt.Sprintf(` +resource "aws_service_thing" "test" { + # ... other configuration ... +} +`) +} + +func testAccAWSServiceThingConfigNamePrefix(namePrefix string) string { + return fmt.Sprintf(` +resource "aws_service_thing" "test" { + # ... other configuration ... + + name_prefix = %[1]q +} +`, namePrefix) +} +``` + +##### Resource Code Generation Documentation Implementation + +- In the resource documentation (e.g. `website/docs/r/service_thing.html.markdown`), add the following to the arguments reference: + +```markdown +* `name_prefix` - (Optional) Creates a unique name beginning with the specified prefix. Conflicts with `name`. +``` + +- Adjust the existing `name` argument reference to ensure its denoted as `Optional`, includes a mention that it can be generated, and that it conflicts with `name_prefix`: + +```markdown +* `name` - (Optional) Name of the thing. If omitted, Terraform will assign a random, unique name. Conflicts with `name_prefix`. +``` + +#### Adding Resource Tagging Support + +AWS provides key-value metadata across many services and resources, which can be used for a variety of use cases including billing, ownership, and more. See the [AWS Tagging Strategy page](https://aws.amazon.com/answers/account-management/aws-tagging-strategies/) for more information about tagging at a high level. + +Implementing tagging support for Terraform AWS Provider resources requires the following, each with its own section below: + +- [ ] _Generated Service Tagging Code_: In the internal code generators (e.g. `aws/internal/keyvaluetags`), implementation and customization of how a service handles tagging, which is standardized for the resources. +- [ ] _Resource Tagging Code Implementation_: In the resource code (e.g. `aws/resource_aws_service_thing.go`), implementation of `tags` schema attribute, along with handling in `Create`, `Read`, and `Update` functions. +- [ ] _Resource Tagging Acceptance Testing Implementation_: In the resource acceptance testing (e.g. `aws/resource_aws_service_thing_test.go`), implementation of new acceptance test function and configurations to exercise new tagging logic. +- [ ] _Resource Tagging Documentation Implementation_: In the resource documentation (e.g. `website/docs/r/service_thing.html.markdown`), addition of `tags` argument + +See also a [full example pull request for implementing EKS tagging](https://github.com/terraform-providers/terraform-provider-aws/pull/10307). + +##### Adding Service to Tag Generating Code + +This step is only necessary for the first implementation and may have been previously completed. If so, move on to the next section. + +More details about this code generation, including fixes for potential error messages in this process, can be found in the [keyvaluetags documentation](../aws/internal/keyvaluetags/README.md). + +- Open the AWS Go SDK documentation for the service, e.g. for [`service/eks`](https://docs.aws.amazon.com/sdk-for-go/api/service/eks/). Note: there can be a delay between the AWS announcement and the updated AWS Go SDK documentation. +- Determine the "type" of tagging implementation. Some services will use a simple map style (`map[string]*string` in Go) while others will have a separate structure shape (`[]service.Tag` struct with `Key` and `Value` fields). + + - If the type is a map, add the AWS Go SDK service name (e.g. `eks`) to `mapServiceNames` in `aws/internal/keyvaluetags/generators/servicetags/main.go` + - Otherwise, if the type is a struct, add the AWS Go SDK service name (e.g. `eks`) to `sliceServiceNames` in `aws/internal/keyvaluetags/generators/servicetags/main.go`. If the struct name is not exactly `Tag`, it can be customized via the `ServiceTagType` function. If the struct key field is not exactly `Key`, it can be customized via the `ServiceTagTypeKeyField` function. If the struct value field is not exactly `Value`, it can be customized via the `ServiceTagTypeValueField` function. + +- Determine if the service API includes functionality for listing tags (usually a `ListTags` or `ListTagsForResource` API call) or updating tags (usually `TagResource` and `UntagResource` API calls). If so, add the AWS Go SDK service client information to `ServiceClientType` (along with the new required import) in `aws/internal/keyvaluetags/service_generation_customizations.go`, e.g. for EKS: + + ```go + case "eks": + funcType = reflect.TypeOf(eks.New) + ``` + + - If the service API includes functionality for listing tags, add the AWS Go SDK service name (e.g. `eks`) to `serviceNames` in `aws/internal/keyvaluetags/generators/listtags/main.go`. + - If the service API includes functionality for updating tags, add the AWS Go SDK service name (e.g. `eks`) to `serviceNames` in `aws/internal/keyvaluetags/generators/updatetags/main.go`. + +- Run `make gen` (`go generate ./...`) and ensure there are no errors via `make test` (`go test ./...`) + +##### Resource Tagging Code Implementation + +- In the resource Go file (e.g. `aws/resource_aws_eks_cluster.go`), add the following Go import: `"github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags"` +- In the resource schema, add `"tags": tagsSchema(),` +- If the API supports tagging on creation (the `Input` struct accepts a `Tags` field), in the resource `Create` function, implement the logic to convert the configuration tags into the service tags, e.g. with EKS Clusters: + + ```go + input := &eks.CreateClusterInput{ + /* ... other configuration ... */ + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().EksTags(), + } + ``` + + If the service API does not allow passing an empty list, the logic can be adjusted similar to: + + ```go + input := &eks.CreateClusterInput{ + /* ... other configuration ... */ + } + + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + input.Tags = keyvaluetags.New(v).IgnoreAws().EksTags() + } + ``` + +- Otherwise if the API does not support tagging on creation (the `Input` struct does not accept a `Tags` field), in the resource `Create` function, implement the logic to convert the configuration tags into the service API call to tag a resource, e.g. with CloudHSM v2 Clusters: + + ```go + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + if err := keyvaluetags.Cloudhsmv2UpdateTags(conn, d.Id(), nil, v); err != nil { + return fmt.Errorf("error adding CloudHSM v2 Cluster (%s) tags: %s", d.Id(), err) + } + } + ``` + +- Some EC2 resources (for example [`aws_ec2_fleet`](https://www.terraform.io/docs/providers/aws/r/ec2_fleet.html)) have a `TagsSpecification` field in the `InputStruct` instead of a `Tags` field. In these cases the `ec2TagSpecificationsFromMap()` helper function should be used, e.g.: + + ```go + input := &ec2.CreateFleetInput{ + /* ... other configuration ... */ + TagSpecifications: ec2TagSpecificationsFromMap(d.Get("tags").(map[string]interface{}), ec2.ResourceTypeFleet), + } + ``` + +- In the resource `Read` function, implement the logic to convert the service tags to save them into the Terraform state for drift detection, e.g. with EKS Clusters (which had the tags available in the DescribeCluster API call): + + ```go + if err := d.Set("tags", keyvaluetags.EksKeyValueTags(cluster.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + ``` + + If the service API does not return the tags directly from reading the resource and requires a separate API call, its possible to use the `keyvaluetags` functionality like the following, e.g. with Athena Workgroups: + + ```go + tags, err := keyvaluetags.AthenaListTags(conn, arn.String()) + + if err != nil { + return fmt.Errorf("error listing tags for resource (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + ``` + +- In the resource `Update` function (this may be the first functionality requiring the creation of the `Update` function), implement the logic to handle tagging updates, e.g. with EKS Clusters: + + ```go + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.EksUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + ``` + +##### Resource Tagging Acceptance Testing Implementation + +- In the resource testing (e.g. `aws/resource_aws_eks_cluster_test.go`), verify that existing resources without tagging are unaffected and do not have tags saved into their Terraform state. This should be done in the `_basic` acceptance test by adding a line similar to `resource.TestCheckResourceAttr(resourceName, "tags.%s", "0"),` +- In the resource testing, implement a new test named `_Tags` with associated configurations, that verifies creating the resource with tags and updating tags. e.g. EKS Clusters: + + ```go + func TestAccAWSEksCluster_Tags(t *testing.T) { + var cluster1, cluster2, cluster3 eks.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksClusterConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksClusterExists(resourceName, &cluster1), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSEksClusterConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksClusterExists(resourceName, &cluster2), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSEksClusterConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksClusterExists(resourceName, &cluster3), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) + } + + func testAccAWSEksClusterConfigTags1(rName, tagKey1, tagValue1 string) string { + return testAccAWSEksClusterConfig_Base(rName) + fmt.Sprintf(` + resource "aws_eks_cluster" "test" { + name = %[1]q + role_arn = "${aws_iam_role.test.arn}" + + tags = { + %[2]q = %[3]q + } + + vpc_config { + subnet_ids = ["${aws_subnet.test.*.id[0]}", "${aws_subnet.test.*.id[1]}"] + } + + depends_on = ["aws_iam_role_policy_attachment.test-AmazonEKSClusterPolicy", "aws_iam_role_policy_attachment.test-AmazonEKSServicePolicy"] + } + `, rName, tagKey1, tagValue1) + } + + func testAccAWSEksClusterConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccAWSEksClusterConfig_Base(rName) + fmt.Sprintf(` + resource "aws_eks_cluster" "test" { + name = %[1]q + role_arn = "${aws_iam_role.test.arn}" + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } + + vpc_config { + subnet_ids = ["${aws_subnet.test.*.id[0]}", "${aws_subnet.test.*.id[1]}"] + } + + depends_on = ["aws_iam_role_policy_attachment.test-AmazonEKSClusterPolicy", "aws_iam_role_policy_attachment.test-AmazonEKSServicePolicy"] + } + `, rName, tagKey1, tagValue1, tagKey2, tagValue2) + } + ``` + +- Verify all acceptance testing passes for the resource (e.g. `make testacc TESTARGS='-run=TestAccAWSEksCluster_'`) + +#### Resource Tagging Documentation Implementation + +- In the resource documentation (e.g. `website/docs/r/eks_cluster.html.markdown`), add the following to the arguments reference: + + ```markdown + * `tags` - (Optional) Key-value mapping of resource tags + ``` + #### New Resource Implementing a new resource is a good way to learn more about how Terraform @@ -289,8 +635,38 @@ into Terraform. - In `aws/config.go`: Create the new service client in the `{SERVICE}conn` field in the `AWSClient` instantiation within `Client()`. e.g. `quicksightconn: quicksight.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["quicksight"])})),` + - In `website/allowed-subcategories.txt`: Add a name acceptable for the documentation navigation. - In `website/docs/guides/custom-service-endpoints.html.md`: Add the service name in the list of customizable endpoints. + - In `.hashibot.hcl`: Add the new service to automated issue and pull request labeling. e.g. with the `quicksight` service + + ```hcl + behavior "regexp_issue_labeler_v2" "service_labels" { + # ... other configuration ... + + label_map = { + # ... other services ... + "service/quicksight" = [ + "aws_quicksight_", + ], + # ... other services ... + } + } + + behavior "pull_request_path_labeler" "service_labels" + # ... other configuration ... + + label_map = { + # ... other services ... + "service/quicksight" = [ + "**/*_quicksight_*", + "**/quicksight_*", + ], + # ... other services ... + } + } + ``` + - Run the following then submit the pull request: ```sh @@ -449,7 +825,7 @@ The below are location-based items that _may_ be noted during review and are rec ``` - [ ] __Uses aws_availability_zones Data Source__: Any hardcoded AWS Availability Zone configuration, e.g. `us-west-2a`, should be replaced with the [`aws_availability_zones` data source](https://www.terraform.io/docs/providers/aws/d/availability_zones.html). A common pattern is declaring `data "aws_availability_zones" "current" {}` and referencing it via `data.aws_availability_zones.current.names[0]` or `data.aws_availability_zones.current.names[count.index]` in resources utilizing `count`. -- [ ] __Uses aws_region Data Source__: Any hardcoded AWS Region configuration, e.g. `us-west-2`, should be replaced with the [`aws_region` data source](https://www.terraform.io/docs/providers/aws/d/region.html). A common pattern is declaring `data "aws_region" "cname}` and referencing it via `data.aws_region.current.name` +- [ ] __Uses aws_region Data Source__: Any hardcoded AWS Region configuration, e.g. `us-west-2`, should be replaced with the [`aws_region` data source](https://www.terraform.io/docs/providers/aws/d/region.html). A common pattern is declaring `data "aws_region" "current" {}` and referencing it via `data.aws_region.current.name` - [ ] __Uses aws_partition Data Source__: Any hardcoded AWS Partition configuration, e.g. the `aws` in a `arn:aws:SERVICE:REGION:ACCOUNT:RESOURCE` ARN, should be replaced with the [`aws_partition` data source](https://www.terraform.io/docs/providers/aws/d/partition.html). A common pattern is declaring `data "aws_partition" "current" {}` and referencing it via `data.aws_partition.current.partition` - [ ] __Uses Builtin ARN Check Functions__: Tests should utilize available ARN check functions, e.g. `testAccMatchResourceAttrRegionalARN()`, to validate ARN attribute values in the Terraform state over `resource.TestCheckResourceAttrSet()` and `resource.TestMatchResourceAttr()` - [ ] __Uses testAccCheckResourceAttrAccountID()__: Tests should utilize the available AWS Account ID check function, `testAccCheckResourceAttrAccountID()` to validate account ID attribute values in the Terraform state over `resource.TestCheckResourceAttrSet()` and `resource.TestMatchResourceAttr()` diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md deleted file mode 100644 index b376ed08b0c..00000000000 --- a/.github/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,6 +0,0 @@ - \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/Bug_Report.md b/.github/ISSUE_TEMPLATE/Bug_Report.md index e320d8a9ac0..42627cb63ab 100644 --- a/.github/ISSUE_TEMPLATE/Bug_Report.md +++ b/.github/ISSUE_TEMPLATE/Bug_Report.md @@ -21,7 +21,7 @@ If you are running into one of these scenarios, we recommend opening an issue in ### Community Note * Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request -* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request +* Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request * If you are interested in working on this issue or have submitted a pull request, please leave a comment diff --git a/.github/ISSUE_TEMPLATE/Feature_Request.md b/.github/ISSUE_TEMPLATE/Feature_Request.md index 7849fa2cbae..f2fac266357 100644 --- a/.github/ISSUE_TEMPLATE/Feature_Request.md +++ b/.github/ISSUE_TEMPLATE/Feature_Request.md @@ -9,7 +9,7 @@ labels: enhancement ### Community Note * Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request -* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request +* Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request * If you are interested in working on this issue or have submitted a pull request, please leave a comment diff --git a/.github/ISSUE_TEMPLATE/Question.md b/.github/ISSUE_TEMPLATE/Question.md deleted file mode 100644 index 8add026d249..00000000000 --- a/.github/ISSUE_TEMPLATE/Question.md +++ /dev/null @@ -1,15 +0,0 @@ ---- -name: 💬 Question -about: If you have a question, please check out our other community resources! -labels: question ---- - -Issues on GitHub are intended to be related to bugs or feature requests with provider codebase, -so we recommend using our other community resources instead of asking here 👍. - ---- - -If you have a support request or question please submit them to one of these resources: - -* [HashiCorp Community Forum](https://discuss.hashicorp.com/c/terraform-providers) -* [HashiCorp support](https://support.hashicorp.com) (Terraform Enterprise customers) diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000000..36230fdbc0b --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,14 @@ +blank_issues_enabled: false +contact_links: + - name: Terraform AWS Provider Questions + url: https://discuss.hashicorp.com/c/terraform-providers/tf-aws + about: GitHub issues in this repository are only intended for bug reports and feature requests. Other issues will be closed. Please ask and answer questions through the Terraform AWS Provider Community Forum. + - name: Terraform Core Bug Reports and Feature Requests + url: https://github.com/hashicorp/terraform/issues/new/choose + about: Terraform Core, which handles the Terraform configuration language, CLI commands, and resource dependency graph, has its own codebase. Bug reports and feature requests for those pieces of functionality should be directed to that repository. + - name: Terraform Language or Workflow Questions + url: https://discuss.hashicorp.com/c/terraform-core + about: Please ask and answer language or workflow related questions through the Terraform Core Community Forum. + - name: Security Vulnerability + url: https://www.hashicorp.com/security.html + about: Please report security vulnerabilities responsibly. diff --git a/.github/MAINTAINING.md b/.github/MAINTAINING.md index 6a47a9c741a..be32dee870d 100644 --- a/.github/MAINTAINING.md +++ b/.github/MAINTAINING.md @@ -6,7 +6,11 @@ - [Pull Request Review Process](#pull-request-review-process) - [Dependency Updates](#dependency-updates) - [AWS Go SDK Updates](#aws-go-sdk-updates) - - [Terraform Updates](#terraform-updates) + - [golangci-lint Updates](#golangci-lint-updates) + - [Terraform Plugin SDK Updates](#terraform-plugin-sdk-updates) + - [tfproviderdocs Updates](#tfproviderdocs-updates) + - [tfproviderlint Updates](#tfproviderlint-updates) + - [yaml.v2 Updates](#yaml-v2-updates) - [Pull Request Merge Process](#pull-request-merge-process) - [Pull Request Types to CHANGELOG](#pull-request-types-to-changelog) - [Release Process](#release-process) @@ -241,9 +245,25 @@ ENHANCEMENTS: * backend/s3: Support automatic region validation for `XX-XXXXX-#` [GH-####] ``` -##### Terraform Updates +##### golangci-lint Updates -Run the full acceptance testing suite against the pull request and verify there are no new or unexpected failures. +Merge if CI passes. + +##### Terraform Plugin SDK Updates + +Except for trivial changes, run the full acceptance testing suite against the pull request and verify there are no new or unexpected failures. + +##### tfproviderdocs Updates + +Merge if CI passes. + +##### tfproviderlint Updates + +Merge if CI passes. + +##### yaml.v2 Updates + +Run the acceptance testing pattern, `TestAccAWSCloudFormationStack(_dataSource)?_yaml`, and merge if passing. ### Pull Request Merge Process @@ -285,6 +305,6 @@ Changes that should _not_ have a CHANGELOG entry: - Create a milestone for the next release after this release (generally, the next milestone will be a minor version increase unless previously decided for a major or patch version) - Check the existing release milestone for open items and either work through them or move them to the next milestone - Run the HashiCorp (non-OSS) TeamCity release job with the `DEPLOYMENT_TARGET_VERSION` matching the expected release milestone and `DEPLOYMENT_NEXT_VERSION` matching the next release milestone -- Wait for the TeamCity release job and TeamCity website deployment jobs to complete either by watching the build logs or Slack notifications +- Wait for the TeamCity release job and CircleCI website deployment jobs to complete either by watching the build logs or Slack notifications - Close the release milestone -- Create a new GitHub release with the release title exactly matching the tag and milestone (e.g. `v2.22.0`). This will trigger [HashiBot](https://github.com/apps/hashibot) release comments. +- Create a new GitHub release with the release title exactly matching the tag and milestone (e.g. `v2.22.0`) and copy the notes from the CHANGELOG to the release notes. This will trigger [HashiBot](https://github.com/apps/hashibot) release comments. diff --git a/.github/PULL_REQUEST_LABELS.yml b/.github/PULL_REQUEST_LABELS.yml deleted file mode 100644 index 7b7665dbd80..00000000000 --- a/.github/PULL_REQUEST_LABELS.yml +++ /dev/null @@ -1,51 +0,0 @@ -# Experimental automatic PR label configuration -# Documentation: https://github.com/actions/labeler -# -# The majority of PR labels are still handled by hashibot -# -# This file should be considered for automatic generation in the future - -service/appmesh: - - aws/{data_source,resource}_aws_appmesh_* - - website/docs/{d,r}/appmesh_* - -service/backup: - - aws/{data_source,resource}_aws_backup_* - - website/docs/{d,r}/backup_* - -service/comprehend: - - aws/{data_source,resource}_aws_comprehend_* - - website/docs/{d,r}/comprehend_* - -service/docdb: - - aws/{data_source,resource}_aws_docdb_* - - aws/tagsDocDB* - - website/docs/{d,r}/docdb_* - -service/licensemanager: - - aws/{data_source,resource}_aws_licensemanager_* - - aws/tagsLicenseManager* - - website/docs/{d,r}/licensemanager_* - -service/quicksight: - - aws/{data_source,resource}_aws_quicksight_* - - website/docs/{d,r}/quicksight_* - -service/ram: - - aws/{data_source,resource}_aws_ram_* - - aws/tagsRAM* - - website/docs/{d,r}/ram_* - -service/route53resolver: - - aws/{data_source,resource}_aws_route53resolver_* - - aws/tagsRoute53Resolver* - - website/docs/{d,r}/route53resolver_* - -service/transfer: - - aws/{data_source,resource}_aws_transfer_* - - aws/tagsTransfer* - - website/docs/{d,r}/transfer_* - -service/worklink: - - aws/{data_source,resource}_aws_worklink_* - - website/docs/{d,r}/worklink_* diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 2420f454ca3..2ad1f40c11c 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -5,7 +5,7 @@ ### Community Note * Please vote on this pull request by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original pull request comment to help the community and maintainers prioritize this request -* Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request +* Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request @@ -23,6 +23,11 @@ If change is not user facing, just write "NONE" in the release-note block below. Output from acceptance testing: + ``` $ make testacc TESTARGS='-run=TestAccXXX' diff --git a/.github/workflows/changelog_checks.yml b/.github/workflows/changelog_checks.yml new file mode 100644 index 00000000000..d8dcdac3a82 --- /dev/null +++ b/.github/workflows/changelog_checks.yml @@ -0,0 +1,24 @@ +name: CHANGELOG Checks +on: + pull_request: + paths: + - CHANGELOG.md + +jobs: + PRCheck: + name: PR Check + runs-on: ubuntu-latest + steps: + - name: PR Comment + uses: unsplash/comment-on-pr@v1.2.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + msg: |- + Thank you for your contribution! :rocket: + + Please note that the `CHANGELOG.md` file contents are handled by the maintainers during merge. This is to prevent pull request merge conflicts, especially for contributions which may not be merged immediately. Please see the [Contributing Guide](https://github.com/terraform-providers/terraform-provider-aws/blob/master/.github/CONTRIBUTING.md) for additional pull request review items. + + Remove any changes to the `CHANGELOG.md` file and commit them in this pull request to prevent delays with reviewing and potentially merging this pull request. + - name: Fail the check + run: exit 1 diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index e2be5abb8ae..1e09218e851 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -1,14 +1,22 @@ on: issues name: Issue triage jobs: - applyTriageLabel: - name: Apply Triage Label + markIssuesForTriage: runs-on: ubuntu-latest steps: - uses: actions/checkout@v1.0.0 - - uses: actions/github@v1.0.0 + - name: Apply Issue Triage Label + uses: actions/github@v1.0.0 if: github.event.action == 'opened' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: args: label needs-triage + + - name: Add new issue into Triage Board + uses: alex-page/github-project-automation-plus@v0.1.1 + if: github.event.action == 'opened' + with: + project: AWS Provider Triage + column: Needs Triage + repo-token: ${{ secrets.GITHUB_ACTIONS_TOKEN }} diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml deleted file mode 100644 index 7cea24af8aa..00000000000 --- a/.github/workflows/pull_request.yml +++ /dev/null @@ -1,12 +0,0 @@ -on: pull_request -name: Pull Request Updates -jobs: - pr-label: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1.0.0 - - uses: actions/labeler@v2.0.0 - if: github.event.action == 'opened' || github.event.action == 'synchronize' - with: - configuration-path: .github/PULL_REQUEST_LABELS.yml - repo-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.go-version b/.go-version new file mode 100644 index 00000000000..b0f139ead18 --- /dev/null +++ b/.go-version @@ -0,0 +1 @@ +1.13.7 diff --git a/.golangci.yml b/.golangci.yml index 347b2e20214..cb031979943 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,9 @@ issues: + exclude-rules: + # Exclude issues bypassing staticcheck.conf + - linters: + - staticcheck + text: "SA1019:" max-per-linter: 0 max-same-issues: 0 @@ -11,8 +16,7 @@ linters: - gosimple - ineffassign - misspell - # Run separately for TravisCI memory issues - # - staticcheck + - staticcheck - structcheck - unconvert - unused @@ -24,5 +28,5 @@ linters-settings: ignore: github.com/hashicorp/terraform-plugin-sdk/helper/schema:ForceNew|Set,fmt:.*,io:Close run: - deadline: 5m modules-download-mode: vendor + timeout: 10m diff --git a/.hashibot.hcl b/.hashibot.hcl index 2519a744f05..77db833f947 100644 --- a/.hashibot.hcl +++ b/.hashibot.hcl @@ -1,13 +1,31 @@ -queued_behavior "release_commenter" "releases" { - repo_prefix = "terraform-provider-" +poll "closed_issue_locker" "locker" { + schedule = "0 50 14 * * *" + closed_for = "720h" # 30 days + max_issues = 500 + sleep_between_issues = "5s" message = <<-EOF - This has been released in [version ${var.release_version} of the Terraform AWS provider](${var.changelog_link}). Please see the [Terraform documentation on provider versioning](https://www.terraform.io/docs/configuration/providers.html#provider-versions) or reach out if you need any assistance upgrading. + I'm going to lock this issue because it has been closed for _30 days_ ⏳. This helps our maintainers find and focus on the active issues. - For further feature requests or bug reports with this functionality, please create a [new GitHub issue](https://github.com/terraform-providers/terraform-provider-aws/issues/new/choose) following the template for triage. Thanks! + If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! EOF } +poll "stale_issue_closer" "closer" { + schedule = "0 22 23 * * *" + no_reply_in_last = "2160h" # 90 days + max_issues = 500 + sleep_between_issues = "5s" + created_after = "2019-06-01" + exclude_labels = ["needs-triage", "technical-debt"] + extra_search_params = "reactions:<20 no:milestone no:assignee" + message = <<-EOF + I'm going to close this issue due to inactivity (_90 days_ without response ⏳ ). This helps our maintainers find and focus on the active issues. + + If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! + EOF +} + behavior "deprecated_import_commenter" "hashicorp_terraform" { import_regexp = "github.com/hashicorp/terraform/" marker_label = "terraform-plugin-sdk-migration" @@ -32,6 +50,20 @@ behavior "deprecated_import_commenter" "hashicorp_terraform" { EOF } +behavior "opened_pull_request_labeler" "triage" { + labels = ["needs-triage"] +} + +queued_behavior "release_commenter" "releases" { + repo_prefix = "terraform-provider-" + + message = <<-EOF + This has been released in [version ${var.release_version} of the Terraform AWS provider](${var.changelog_link}). Please see the [Terraform documentation on provider versioning](https://www.terraform.io/docs/configuration/providers.html#provider-versions) or reach out if you need any assistance upgrading. + + For further feature requests or bug reports with this functionality, please create a [new GitHub issue](https://github.com/terraform-providers/terraform-provider-aws/issues/new/choose) following the template for triage. Thanks! + EOF +} + # Catch the following in issues: # *aws_XXX # * aws_XXX @@ -46,6 +78,9 @@ behavior "regexp_issue_labeler_v2" "service_labels" { regexp = "(\\* ?`?|- ?`?|data \"|resource \")aws_(\\w+)" label_map = { + "service/accessanalyzer" = [ + "aws_accessanalyzer_", + ], "service/acm" = [ "aws_acm_", ], @@ -93,6 +128,9 @@ behavior "regexp_issue_labeler_v2" "service_labels" { "service/autoscalingplans" = [ "aws_autoscalingplans_", ], + "service/backup" = [ + "aws_backup_", + ], "service/batch" = [ "aws_batch_", ], @@ -118,7 +156,7 @@ behavior "regexp_issue_labeler_v2" "service_labels" { "aws_cloudsearch_", ], "service/cloudtrail" = [ - "aws_cloudtrail_", + "aws_cloudtrail", ], "service/cloudwatch" = [ "aws_cloudwatch_([^e]|e[^v]|ev[^e]|eve[^n]|even[^t]|event[^_]|[^l]|l[^o]|lo[^g]|log[^_])", @@ -144,6 +182,9 @@ behavior "regexp_issue_labeler_v2" "service_labels" { "service/codestar" = [ "aws_codestar_", ], + "service/codestarnotifications" = [ + "aws_codestarnotifications_", + ], "service/cognito" = [ "aws_cognito_", ], @@ -153,6 +194,9 @@ behavior "regexp_issue_labeler_v2" "service_labels" { "service/databasemigrationservice" = [ "aws_dms_", ], + "service/dataexchange" = [ + "aws_dataexchange_", + ], "service/datapipeline" = [ "aws_datapipeline_", ], @@ -174,6 +218,9 @@ behavior "regexp_issue_labeler_v2" "service_labels" { "service/dlm" = [ "aws_dlm_", ], + "service/docdb" = [ + "aws_docdb_", + ], "service/dynamodb" = [ "aws_dynamodb_", ], @@ -196,6 +243,7 @@ behavior "regexp_issue_labeler_v2" "service_labels" { "aws_placement_group", "aws_spot", "aws_route(\"|`|$)", + "aws_vpn_", ], "service/ecr" = [ "aws_ecr_", @@ -243,6 +291,9 @@ behavior "regexp_issue_labeler_v2" "service_labels" { "service/fms" = [ "aws_fms_", ], + "service/forecast" = [ + "aws_forecast_", + ], "service/fsx" = [ "aws_fsx_", ], @@ -267,12 +318,21 @@ behavior "regexp_issue_labeler_v2" "service_labels" { "service/iam" = [ "aws_iam_", ], + "service/imagebuilder" = [ + "aws_imagebuilder_", + ], "service/inspector" = [ "aws_inspector_", ], "service/iot" = [ "aws_iot_", ], + "service/iotanalytics" = [ + "aws_iotanalytics_", + ], + "service/iotevents" = [ + "aws_iotevents_", + ], "service/kafka" = [ "aws_msk_", ], @@ -281,7 +341,7 @@ behavior "regexp_issue_labeler_v2" "service_labels" { "aws_kinesis_([^f]|f[^i]|fi[^r]|fir[^e]|fire[^h]|fireh[^o]|fireho[^s]|firehos[^e]|firehose[^_])", ], "service/kinesisanalytics" = [ - "aws_kinesisanalytics_", + "aws_kinesis_analytics_", ], "service/kms" = [ "aws_kms_", @@ -304,6 +364,9 @@ behavior "regexp_issue_labeler_v2" "service_labels" { "service/macie" = [ "aws_macie_", ], + "service/marketplacecatalog" = [ + "aws_marketplace_catalog_", + ], "service/mediaconnect" = [ "aws_media_connect_", ], @@ -337,6 +400,9 @@ behavior "regexp_issue_labeler_v2" "service_labels" { "service/organizations" = [ "aws_organizations_", ], + "service/personalize" = [ + "aws_personalize_", + ], "service/pinpoint" = [ "aws_pinpoint_", ], @@ -346,6 +412,12 @@ behavior "regexp_issue_labeler_v2" "service_labels" { "service/pricing" = [ "aws_pricing_", ], + "service/qldb" = [ + "aws_qldb_", + ], + "service/quicksight" = [ + "aws_quicksight_", + ], "service/ram" = [ "aws_ram_", ], @@ -437,9 +509,15 @@ behavior "regexp_issue_labeler_v2" "service_labels" { "aws_waf_", "aws_wafregional_", ], + "service/wafv2" = [ + "aws_wafv2_", + ], "service/workdocs" = [ "aws_workdocs_", ], + "service/worklink" = [ + "aws_worklink_", + ], "service/workmail" = [ "aws_workmail_", ], @@ -478,6 +556,10 @@ behavior "pull_request_path_labeler" "service_labels" { ".travis.yml" ] # label services + "service/accessanalyzer" = [ + "**/*_accessanalyzer_*", + "**/accessanalyzer_*" + ] "service/acm" = [ "**/*_acm_*", "**/acm_*" @@ -496,7 +578,9 @@ behavior "pull_request_path_labeler" "service_labels" { ] "service/apigateway" = [ "**/*_api_gateway_[^v][^2][^_]*", - "**/api_gateway_[^v][^2][^_]*" + "**/*_api_gateway_vpc_link*", + "**/api_gateway_[^v][^2][^_]*", + "**/api_gateway_vpc_link*" ] "service/apigatewayv2" = [ "**/*_api_gateway_v2_*", @@ -527,7 +611,7 @@ behavior "pull_request_path_labeler" "service_labels" { "**/appsync_*" ] "service/athena" = [ - "service/athena", + "**/*_athena_*", "**/athena_*" ] "service/autoscaling" = [ @@ -540,6 +624,10 @@ behavior "pull_request_path_labeler" "service_labels" { "**/*_autoscalingplans_*", "**/autoscalingplans_*" ] + "service/backup" = [ + "**/*backup_*", + "**/backup_*" + ] "service/batch" = [ "**/*_batch_*", "**/batch_*" @@ -573,8 +661,8 @@ behavior "pull_request_path_labeler" "service_labels" { "**/cloudsearch_*" ] "service/cloudtrail" = [ - "**/*_cloudtrail_*", - "**/cloudtrail_*" + "**/*_cloudtrail*", + "**/cloudtrail*" ] "service/cloudwatch" = [ "**/*_cloudwatch_dashboard*", @@ -610,9 +698,17 @@ behavior "pull_request_path_labeler" "service_labels" { "**/*_codestar_*", "**/codestar_*" ] + "service/codestarnotifications" = [ + "**/*_codestarnotifications_*", + "**/codestarnotifications_*" + ] "service/cognito" = [ "**/*_cognito_*", - "**/_cognito_*" + "**/cognito_*" + ] + "service/comprehend" = [ + "**/*_comprehend_*", + "**/comprehend_*" ] "service/configservice" = [ "aws/*_aws_config_*", @@ -622,6 +718,10 @@ behavior "pull_request_path_labeler" "service_labels" { "**/*_dms_*", "**/dms_*" ] + "service/dataexchange" = [ + "**/*_dataexchange_*", + "**/dataexchange_*", + ] "service/datapipeline" = [ "**/*_datapipeline_*", "**/datapipeline_*", @@ -650,6 +750,10 @@ behavior "pull_request_path_labeler" "service_labels" { "**/*_dlm_*", "**/dlm_*" ] + "service/docdb" = [ + "**/*_docdb_*", + "**/docdb_*" + ] "service/dynamodb" = [ "**/*_dynamodb_*", "**/dynamodb_*" @@ -731,6 +835,8 @@ behavior "pull_request_path_labeler" "service_labels" { "**/eks_*" ] "service/elastic-transcoder" = [ + "**/*_elastictranscoder_*", + "**/elastictranscoder_*", "**/*_elastic_transcoder_*", "**/elastic_transcoder_*" ] @@ -813,6 +919,10 @@ behavior "pull_request_path_labeler" "service_labels" { "**/*_iam_*", "**/iam_*" ] + "service/imagebuilder" = [ + "**/*_imagebuilder_*", + "**/imagebuilder_*" + ] "service/inspector" = [ "**/*_inspector_*", "**/inspector_*" @@ -821,6 +931,14 @@ behavior "pull_request_path_labeler" "service_labels" { "**/*_iot_*", "**/iot_*" ] + "service/iotanalytics" = [ + "**/*_iotanalytics_*", + "**/iotanalytics_*" + ] + "service/iotevents" = [ + "**/*_iotevents_*", + "**/iotevents_*" + ] "service/kafka" = [ "**/*_msk_*", "**/msk_*", @@ -830,8 +948,8 @@ behavior "pull_request_path_labeler" "service_labels" { "website/kinesis_stream*" ] "service/kinesisanalytics" = [ - "**/*_kinesisanalytics_*", - "**/kinesisanalytics_*" + "**/*_kinesis_analytics_*", + "**/kinesis_analytics_*" ] "service/kms" = [ "**/*_kms_*", @@ -861,6 +979,10 @@ behavior "pull_request_path_labeler" "service_labels" { "**/*_macie_*", "**/macie_*" ] + "service/marketplacecatalog" = [ + "**/*_marketplace_catalog_*", + "**/marketplace_catalog_*" + ] "service/mediaconnect" = [ "**/*_media_connect_*", "**/media_connect_*" @@ -917,6 +1039,14 @@ behavior "pull_request_path_labeler" "service_labels" { "**/*_pricing_*", "**/pricing_*" ] + "service/qldb" = [ + "**/*_qldb_*", + "**/qldb_*" + ] + "service/quicksight" = [ + "**/*_quicksight_*", + "**/quicksight_*" + ] "service/ram" = [ "**/*_ram_*", "**/ram_*" @@ -935,6 +1065,10 @@ behavior "pull_request_path_labeler" "service_labels" { "**/*_resourcegroups_*", "**/resourcegroups_*" ] + "service/robomaker" = [ + "**/*_robomaker_*", + "**/robomaker_*", + ] "service/route53" = [ "**/*_route53_delegation_set*", "**/*_route53_health_check*", @@ -947,14 +1081,14 @@ behavior "pull_request_path_labeler" "service_labels" { "**/route53_record*", "**/route53_zone*" ] - "service/robomaker" = [ - "**/*_robomaker_*", - "**/robomaker_*", - ] "service/route53domains" = [ "**/*_route53_domains_*", "**/route53_domains_*" ] + "service/route53resolver" = [ + "**/*_route53_resolver_*", + "**/route53_resolver_*" + ] "service/s3" = [ "**/*_s3_bucket*", "**/s3_bucket*", @@ -1043,10 +1177,18 @@ behavior "pull_request_path_labeler" "service_labels" { "**/*_wafregional_*", "**/wafregional_*" ] + "service/wafv2" = [ + "**/*_wafv2_*", + "**/wafv2_*", + ] "service/workdocs" = [ "**/*_workdocs_*", "**/workdocs_*" ] + "service/worklink" = [ + "**/*_worklink_*", + "**/worklink_*" + ] "service/workmail" = [ "**/*_workmail_*", "**/workmail_*" diff --git a/.markdownlint.yml b/.markdownlint.yml new file mode 100644 index 00000000000..f9782ba5a20 --- /dev/null +++ b/.markdownlint.yml @@ -0,0 +1,23 @@ +# Configuration for markdownlint +# https://github.com/DavidAnson/markdownlint#configuration + +default: true + +# Disabled Rules +# https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md + +MD001: false +MD004: false +MD006: false +MD007: false +MD009: false +MD010: false +MD012: false +MD013: false +MD014: false +MD022: false +MD024: false +MD034: false +MD038: false +MD040: false +MD047: false diff --git a/.travis.yml b/.travis.yml index 15b2d4d6469..e0eed8c0941 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,10 +17,16 @@ matrix: script: make lint - go: "1.13.x" name: "Code UnitTest" - script: make test + script: + - make test + - make gencheck + - go: "1.13.x" + name: "Dependencies" + script: make depscheck - go: "1.13.x" name: "Website" script: + - make docscheck - make website-test - make website-lint diff --git a/CHANGELOG.md b/CHANGELOG.md index 1526ab3351f..dca1a8a8c80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,579 @@ -## 2.32.0 (Unreleased) +## 2.52.0 (Unreleased) + +FEATURES: + +* **New Data Source:** `aws_ec2_instance_type_offering` [GH-12139] +* **New Data Source:** `aws_ec2_instance_type_offerings` [GH-12139] + +ENHANCEMENTS: + +* resource/aws_globalaccelerator_accelerator: Add `dns_name` and `hosted_zone_id` attributes [GH-11670] +* resource/aws_lb_target_group: Add `load_balancing_algorithm_type` argument (support Least Outstanding Requests algorithm for Application Load Balancers) [GH-11141] + +BUG FIXES: + +* resource/aws_iam_service_linked_role: Allow `aws_service_name` argument validation to accept values in AWS partitions outside AWS Commercial and AWS GovCloud (US) [GH-11919] +* resource/aws_lambda_function_event_invoke_config: Retry on additional IAM eventual consistency error with SNS Topic destinations [GH-12171] +* resource/aws_media_store_container: Prevent `ValidationException` error on creation when no tags are configured [GH-12170] + +## 2.51.0 (February 28, 2020) + +FEATURES: + +* **New Data Source:** `aws_sfn_activity` ([#11080](https://github.com/terraform-providers/terraform-provider-aws/issues/11080)) +* **New Data Source:** `aws_sfn_state_machine` ([#10932](https://github.com/terraform-providers/terraform-provider-aws/issues/10932)) +* **New Resource:** `aws_ec2_traffic_mirror_filter` ([#9372](https://github.com/terraform-providers/terraform-provider-aws/issues/9372)) +* **New Resource:** `aws_ec2_traffic_mirror_filter_rule` ([#9372](https://github.com/terraform-providers/terraform-provider-aws/issues/9372)) +* **New Resource:** `aws_ec2_traffic_mirror_session` ([#9372](https://github.com/terraform-providers/terraform-provider-aws/issues/9372)) +* **New Resource:** `aws_ec2_traffic_mirror_target` ([#9372](https://github.com/terraform-providers/terraform-provider-aws/issues/9372)) +* **New Resource:** `aws_s3_access_point` ([#11276](https://github.com/terraform-providers/terraform-provider-aws/issues/11276)) + +ENHANCEMENTS: + +* data-source/aws_lambda_layer_version: Support plan-time validation for `compatible_runtime` argument `ruby2.7` value ([#12116](https://github.com/terraform-providers/terraform-provider-aws/issues/12116)) +* resource/aws_dx_hosted_private_virtual_interface: Add `amazon_side_asn` attribute ([#11415](https://github.com/terraform-providers/terraform-provider-aws/issues/11415)) +* resource/aws_dx_hosted_public_virtual_interface: Add `amazon_side_asn` attribute ([#11415](https://github.com/terraform-providers/terraform-provider-aws/issues/11415)) +* resource/aws_dx_hosted_transit_virtual_interface: Add `amazon_side_asn` attribute ([#11415](https://github.com/terraform-providers/terraform-provider-aws/issues/11415)) +* resource/aws_dx_private_virtual_interface: Add `amazon_side_asn` attribute ([#11415](https://github.com/terraform-providers/terraform-provider-aws/issues/11415)) +* resource/aws_dx_public_virtual_interface: Add `amazon_side_asn` attribute ([#11415](https://github.com/terraform-providers/terraform-provider-aws/issues/11415)) +* resource/aws_dx_transit_virtual_interface: Add `amazon_side_asn` attribute ([#11415](https://github.com/terraform-providers/terraform-provider-aws/issues/11415)) +* resource/aws_glue_job: Add `notification_property` configuration block ([#12115](https://github.com/terraform-providers/terraform-provider-aws/issues/12115)) +* resource/aws_lambda_event_source_mapping: Add `bisect_batch_on_function_error`, `maximum_record_age_in_seconds`, `maximum_retry_attempts`, and `parallelization_factor` arguments ([#11100](https://github.com/terraform-providers/terraform-provider-aws/issues/11100)) +* resource/aws_lambda_event_source_mapping: Add `destination_config` configuration block ([#11100](https://github.com/terraform-providers/terraform-provider-aws/issues/11100)) +* resource/aws_lambda_function: Support plan-time validation for `runtime` argument `ruby2.7` value ([#12116](https://github.com/terraform-providers/terraform-provider-aws/issues/12116)) +* resource/aws_lambda_layer_version: Support plan-time validation for `compatible_runtimes` argument `ruby2.7` value ([#12116](https://github.com/terraform-providers/terraform-provider-aws/issues/12116)) +* resource/aws_msk_cluster: Support in-place updates to `enhanced_monitoring` and `number_of_broker_nodes` arguments ([#11451](https://github.com/terraform-providers/terraform-provider-aws/issues/11451)) +* resource/aws_msk_cluster: Add `open_monitoring` configuration block (support Prometheus monitoring configuration) ([#11451](https://github.com/terraform-providers/terraform-provider-aws/issues/11451)) + +BUG FIXES: + +* resource/aws_workspaces_directory: Prevent panic and remove resource from Terraform state if removed outside Terraform ([#11837](https://github.com/terraform-providers/terraform-provider-aws/issues/11837)) + +## 2.50.0 (February 20, 2020) + +NOTES: + +* resource/aws_lambda_function: The `publish` argument now will also publish versions for configuration updates. This is accomplished via a separate `PublishVersion` API call, where before the publishing only occured via the `Publish` parameter of the `UpdateFunctionCode` API call. Restrictive IAM permissions for Terraform may require updates. ([#11211](https://github.com/terraform-providers/terraform-provider-aws/issues/11211)) +* resource/aws_ram_resource_share_accepter: The `status` attribute now reflects the status of the RAM Resource Share and not the RAM Resource Share Invitation (which expires after 7 days). ([#11562](https://github.com/terraform-providers/terraform-provider-aws/issues/11562)) + +FEATURES: + +* **New Data Source:** `aws_lambda_alias` ([#9490](https://github.com/terraform-providers/terraform-provider-aws/issues/9490)) + +ENHANCEMENTS: + +* resource/aws_appmesh_route: Add `priority` and `header` attributes to support route priorities and HTTP header-based routing ([#10402](https://github.com/terraform-providers/terraform-provider-aws/issues/10402)) +* resource/aws_iam_access_key: Add `ses_smtp_password_v4` attribute (add per-region SigV4 support) ([#11144](https://github.com/terraform-providers/terraform-provider-aws/issues/11144)) +* resource/aws_security_group: Support import of `name_prefix` argument ([#12052](https://github.com/terraform-providers/terraform-provider-aws/issues/12052)) +* resource/aws_transfer_server: Add `host_key` argument and `host_key_fingerprint` attribute ([#8913](https://github.com/terraform-providers/terraform-provider-aws/issues/8913)) + +BUG FIXES: + +* resource/aws_lambda_function: If `publish` argument is enabled, also publish new versions on function configuration-only updates in addition to function code updates ([#11211](https://github.com/terraform-providers/terraform-provider-aws/issues/11211)) +* resource/aws_lambda_permission: Fix error when Lambda permission is deleted out-of-band ([#11924](https://github.com/terraform-providers/terraform-provider-aws/issues/11924)) +* resource/aws_ram_resource_share_accepter: Fix read operations after the RAM Resource Share Invitation is no longer present after 7 days ([#11562](https://github.com/terraform-providers/terraform-provider-aws/issues/11562)) + +## 2.49.0 (February 14, 2020) + +FEATURES: + +* **New Resource:** `aws_codestarnotifications_notification_rule` ([#10991](https://github.com/terraform-providers/terraform-provider-aws/issues/10991)) +* **New Resource:** `aws_s3_bucket_analytics_configuration` ([#11874](https://github.com/terraform-providers/terraform-provider-aws/issues/11874)) + +ENHANCEMENTS: + +* data-source/aws_api_gateway_rest_api: Add `api_key_source`, `arn`, `binary_media_types`, `description`, `endpoint_configuration`, `execution_arn`, `minimum_compression_size`, `policy`, and `tags` attributes ([#10971](https://github.com/terraform-providers/terraform-provider-aws/issues/10971)) +* resource/aws_db_instance: Support `agent` value in `enable_cloudwatch_logs_exports` argument plan-time validation (Support MSSQL agent log) ([#11472](https://github.com/terraform-providers/terraform-provider-aws/issues/11472)) +* resource/aws_db_instance: Add `delete_automated_backups` argument ([#8461](https://github.com/terraform-providers/terraform-provider-aws/issues/8461)) +* resource/aws_gamelift_fleet: Add `tags` argument ([#11559](https://github.com/terraform-providers/terraform-provider-aws/issues/11559)) +* resource/aws_instance: Add `hibernation` argument ([#6961](https://github.com/terraform-providers/terraform-provider-aws/issues/6961)) +* resource/aws_launch_template: Add `cpu_options` configuration block (support disabling multithreading) ([#6552](https://github.com/terraform-providers/terraform-provider-aws/issues/6552)) +* resource/aws_neptune_cluster: Add `enable_cloudwatch_logs_exports` argument (support audit logging) ([#11949](https://github.com/terraform-providers/terraform-provider-aws/issues/11949)) +* resource/aws_neptune_cluster: Add `deletion_protection` argument ([#11731](https://github.com/terraform-providers/terraform-provider-aws/issues/11731)) +* resource/aws_rds_global_database: Support `aurora-mysql` value in `engine` argument plan-time validation (Support Aurora MySQL 5.7) ([#11790](https://github.com/terraform-providers/terraform-provider-aws/issues/11790)) + +BUG FIXES: + +* data-source/aws_route53_zone: Fixes regression from version 2.48.0 when filtering using `tags` ([#11953](https://github.com/terraform-providers/terraform-provider-aws/issues/11953)) +* resource/aws_batch_job_definition: Prevent extraneous differences with `container_properties` argument missing `environment`, `mountPoints`, `ulimits`, and `volumes` configuration ([#12000](https://github.com/terraform-providers/terraform-provider-aws/issues/12000)) +* resource/aws_cognito_user_pool: Allow `admin_create_user_config` configuration block `unused_account_validity_days` argument to be omitted ([#12001](https://github.com/terraform-providers/terraform-provider-aws/issues/12001)) +* resource/aws_launch_configuration: Fixes regression from version 2.23.0 with instance store AMIs returning an unexpected error ([#9810](https://github.com/terraform-providers/terraform-provider-aws/issues/9810)) +* resource/aws_launch_configuration: Fixes regression from version 2.23.0 to allow missing EC2 Image during root block device lookup ([#12009](https://github.com/terraform-providers/terraform-provider-aws/issues/12009)) +* resource/aws_route53_record: The artificial, hardcoded five minute timeouts for creation and deletions have been removed in preference of the default AWS Go SDK retrying logic ([#11895](https://github.com/terraform-providers/terraform-provider-aws/issues/11895)) + +## 2.48.0 (February 07, 2020) NOTES: -* provider: The underlying Terraform codebase dependency for the provider SDK and acceptance testing framework has been migrated from `github.com/hashicorp/terraform` to `github.com/hashicorp/terraform-plugin-sdk`. They are functionality equivalent and this should only impact codebase development to switch imports. For more information see the [Terraform Plugin SDK page in the Extending Terraform documentation](https://www.terraform.io/docs/extend/plugin-sdk.html). [GH-10367] +* resource/aws_organizations_policy_attachment: The underlying API calls have switched from `ListPoliciesForTarget` to `ListTargetsForPolicy`. Restrictive IAM Policies for Terraform execution may require updates. ([#11612](https://github.com/terraform-providers/terraform-provider-aws/issues/11612)) + +FEATURES: + +* **New Data Source:** `aws_ssm_patch_baseline` ([#9486](https://github.com/terraform-providers/terraform-provider-aws/issues/9486)) +* **New Resource:** `aws_datasync_location_smb` ([#10381](https://github.com/terraform-providers/terraform-provider-aws/issues/10381)) + +ENHANCEMENTS: + +* resource/aws_batch_job_definition: Support resource import ([#11407](https://github.com/terraform-providers/terraform-provider-aws/issues/11407)) +* resource/aws_codebuild_project: Add `source` and `secondary_source` configuration block `git_submodules_config` configuration block ([#10952](https://github.com/terraform-providers/terraform-provider-aws/issues/10952)) +* resource/aws_codebuild_project: Add `source_version` argument ([#9877](https://github.com/terraform-providers/terraform-provider-aws/issues/9877)) +* resource/aws_elasticache_cluster: Add `computed` flag for `port` property and set to true ([#10017](https://github.com/terraform-providers/terraform-provider-aws/issues/10017)) +* resource/aws_fsx_lustre_file_system: Lower minimum `storage_capacity` argument validation to 1200 to match API updates ([#11847](https://github.com/terraform-providers/terraform-provider-aws/issues/11847)) +* resource/aws_organizations_policy: Support `type` argument `TAG_POLICY` value in plan-time validation ([#11612](https://github.com/terraform-providers/terraform-provider-aws/issues/11612)) +* resource/aws_organizations_policy_attachment: Support tag policies ([#11612](https://github.com/terraform-providers/terraform-provider-aws/issues/11612)) + +BUG FIXES: + +* resource/aws_appautoscaling_target: Prevent state removal of resource immediately after creation due to eventual consistency ([#11819](https://github.com/terraform-providers/terraform-provider-aws/issues/11819)) +* resource/aws_appautoscaling_target: Automatically retry creation on `ValidationException: ECS service doesn't exist` for ECS eventual consistency ([#11693](https://github.com/terraform-providers/terraform-provider-aws/issues/11693)) +* resource/aws_batch_job_definition: Properly set `container_properties` and `name` into Terraform state and perform drift detection ([#11488](https://github.com/terraform-providers/terraform-provider-aws/issues/11488)) +* resource/aws_cloudformation_stack_set: Wait for update operation completion (default timeout of 30 minutes) and report any errors ([#11726](https://github.com/terraform-providers/terraform-provider-aws/issues/11726)) +* resource/aws_cloudwatch_log_stream: Prevent state removal of resource immediately after creation due to eventual consistency ([#11617](https://github.com/terraform-providers/terraform-provider-aws/issues/11617)) +* resource/aws_codedeploy_deployment_group: Fixes unexpected behaviour when removing block attributes ([#11648](https://github.com/terraform-providers/terraform-provider-aws/issues/11648)) +* resource/aws_default_security_group: Ensure `description` attribute is written into Terraform state ([#11650](https://github.com/terraform-providers/terraform-provider-aws/issues/11650)) +* resource/aws_dynamodb_table: Skip `ResourceNotFoundException` error during deletion ([#11692](https://github.com/terraform-providers/terraform-provider-aws/issues/11692)) +* resource/aws_ec2_client_vpn_endpoint: Ensure `dns_servers` attribute is refreshed in Terraform state ([#11889](https://github.com/terraform-providers/terraform-provider-aws/issues/11889)) +* resource/aws_ecs_cluster: Delay check of ECS Cluster status during creation for ECS eventual consistency ([#11701](https://github.com/terraform-providers/terraform-provider-aws/issues/11701)) +* resource/aws_kinesis_firehose_delivery_stream: Allow processors to be cleared from extended S3 configuration ([#11649](https://github.com/terraform-providers/terraform-provider-aws/issues/11649)) +* resource/aws_network_acl_rule: Trigger resource recreation instead of error when same number rule (but opposite ingress/egress) is removed ([#11544](https://github.com/terraform-providers/terraform-provider-aws/issues/11544)) +* resource/aws_placement_group: Additional handling for creation and deletion eventual consistency ([#11671](https://github.com/terraform-providers/terraform-provider-aws/issues/11671)) +* resource/aws_s3_bucket: Retry read after creation for 404 status code and prevent 2 minute delay for triggering recreation on existing resources deleted outside Terraform ([#11894](https://github.com/terraform-providers/terraform-provider-aws/issues/11894)) + +## 2.47.0 (January 30, 2020) + +NOTES: + +* resource/aws_efs_file_system: Tagging API calls have been refactored to the AWS standardized `TagResource` and `UntagResource` API calls (from `CreateTags` and `DeleteTags` respectively). Restrictive IAM Policies for Terraform execution may require updates. ([#11654](https://github.com/terraform-providers/terraform-provider-aws/issues/11654)) + +ENHANCEMENTS: + +* data-source/aws_api_gateway_vpc_link: Add `description`, `status`, `status_message`, `tags`, and `target_arns` attributes ([#10822](https://github.com/terraform-providers/terraform-provider-aws/issues/10822)) +* data-source/aws_dynamodb_table: Add `server_side_encryption` `kms_key_arn` attribute ([#11081](https://github.com/terraform-providers/terraform-provider-aws/issues/11081)) +* data-source/aws_efs_file_system: Add `lifecycle_policy`, `provisioned_throughput_in_mibps`, and `throughput_mode` attributes ([#11647](https://github.com/terraform-providers/terraform-provider-aws/issues/11647)) +* data-source/aws_kms_key: Add `customer_master_key_spec` attribute ([#11062](https://github.com/terraform-providers/terraform-provider-aws/issues/11062)) +* resource/aws_dynamodb_table: Add `server_side_encryption` configuration block `kms_key_arn` argument (support customer managed CMKs for server-side encryption) ([#11081](https://github.com/terraform-providers/terraform-provider-aws/issues/11081)) +* resource/aws_dynamodb_table: Support in-place updates for `server_side_encryption` configurations ([#11081](https://github.com/terraform-providers/terraform-provider-aws/issues/11081)) +* resource/aws_elasticsearch_domain: Add `domain_endpoint_options` configuration block (support enforcing HTTPS) ([#10430](https://github.com/terraform-providers/terraform-provider-aws/issues/10430)) +* resource/aws_gamelift_fleet: Add `fleet_type` argument (support Spot Fleets) ([#8234](https://github.com/terraform-providers/terraform-provider-aws/issues/8234)) +* resource/aws_kms_key: Add `customer_master_key_spec` argument and plan-time validation support for `key_usage` value `SIGN_VERIFY` (support asymmetric keys) ([#11062](https://github.com/terraform-providers/terraform-provider-aws/issues/11062)) +* resource/aws_sagemaker_notebook_instance: Add `direct_internet_access` argument ([#8618](https://github.com/terraform-providers/terraform-provider-aws/issues/8618)) +* resource/aws_ssm_activation: Add `automation_target_parameter_name` argument ([#11755](https://github.com/terraform-providers/terraform-provider-aws/issues/11755)) +* resource/aws_ssm_document: Add `target_type` argument ([#11479](https://github.com/terraform-providers/terraform-provider-aws/issues/11479)) +* resource/aws_ssm_maintenance_window: Add `description` argument ([#11478](https://github.com/terraform-providers/terraform-provider-aws/issues/11478)) +* resource/aws_storagegateway_gateway: Add `cloudwatch_log_group_arn` argument ([#10939](https://github.com/terraform-providers/terraform-provider-aws/issues/10939)) + +BUG FIXES: + +* data-source/aws_api_gateway_rest_api: Fixes `root_resource_id` not being set on correctly when REST API contains more than 25 resources ([#11705](https://github.com/terraform-providers/terraform-provider-aws/issues/11705)) +* resource/aws_cloudwatch_log_subscription_filter: Perform eventual consistency retries on update ([#11739](https://github.com/terraform-providers/terraform-provider-aws/issues/11739)) +* resource/aws_cognito_user_pool: Deprecate `unused_account_validity_days` argument and add support for `temporary_password_validity_days` argument ([#10890](https://github.com/terraform-providers/terraform-provider-aws/issues/10890)) +* resource/aws_elasticsearch_domain: Automatically retry resource creation on additional error messages relating to eventual consistency ([#11663](https://github.com/terraform-providers/terraform-provider-aws/issues/11663)) +* resource/aws_elasticsearch_domain: Ensure in-place version upgrade is fully successful before returning ([#11793](https://github.com/terraform-providers/terraform-provider-aws/issues/11793)) +* resource/aws_emr_instance_group: Wait for `RUNNING` status on creation ([#11688](https://github.com/terraform-providers/terraform-provider-aws/issues/11688)) +* resource/aws_ssm_activation: Properly trigger resource recreation when deleted outside Terraform ([#11658](https://github.com/terraform-providers/terraform-provider-aws/issues/11658)) +* resource/aws_ssm_parameter: Prevent `KeyId` error when switching `type` value from `SecureString` to `String` ([#10819](https://github.com/terraform-providers/terraform-provider-aws/issues/10819)) +* service/efs: Generate proper `dns_name` attribute hostname suffix in AWS China, AWS C2S, and AWS SC2S partitions ([#11746](https://github.com/terraform-providers/terraform-provider-aws/issues/11746)) + +## 2.46.0 (January 23, 2020) + +NOTES: + +* provider: Terraform AWS Provider version 2.45.0 included AWS Go SDK version 1.28.0, which contained a regression in error handling behavior across many services that either prevented or incorrectly modified error messages from being surfaced by the API. Other than confusing errors in certain cases, this also affected automatic retry logic in a few resources. This release contains an AWS Go SDK update which should resolve these issues. + +ENHANCEMENTS: + +* data-source/aws_api_gateway_api_key: Add `created_date`, `description`, `enabled`, `last_updated_date`, and `tags` attributes ([#10821](https://github.com/terraform-providers/terraform-provider-aws/issues/10821)) +* data-source/aws_cloudwatch_log_group: Add `kms_key_id`, `retention_in_days`, and `tags` attributes ([#10755](https://github.com/terraform-providers/terraform-provider-aws/issues/10755)) +* data-source/aws_db_instance: Add `multi_az` attribute ([#10795](https://github.com/terraform-providers/terraform-provider-aws/issues/10795)) +* data-source/aws_sqs_queue: Add `tags` attribute ([#10820](https://github.com/terraform-providers/terraform-provider-aws/issues/10820)) +* resource/aws_acm_certificate: Support tag-on-create ([#11073](https://github.com/terraform-providers/terraform-provider-aws/issues/11073)) +* resource/aws_api_gateway_rest_api: Add `endpoint_configuration` configuration block `vpc_endpoint_ids` argument ([#10627](https://github.com/terraform-providers/terraform-provider-aws/issues/10627)) +* resource/aws_cloudfront_distribution: Validate `origin_group` configuration block `member` argument contains max 2 items ([#10357](https://github.com/terraform-providers/terraform-provider-aws/issues/10357)) +* resource/aws_cognito_user_pool_client: Support plan-time validation values of `ALLOW_*` variations for `explicit_auth_flows` argument ([#10976](https://github.com/terraform-providers/terraform-provider-aws/issues/10976)) +* resource/aws_ecs_task_definition: Add `volume` configuration block `efs_volume_configuration` configuration block (support preview EFS volume configuration) ([#11707](https://github.com/terraform-providers/terraform-provider-aws/issues/11707)) +* resource/aws_ecs_task_definition: Add plan-time validation for `execution_role_arn` argument, `placement_constraints` configuration block `type` argument, and `task_role_arn` argument ([#11707](https://github.com/terraform-providers/terraform-provider-aws/issues/11707)) +* resource/aws_egress_only_internet_gateway: Support resource import ([#11071](https://github.com/terraform-providers/terraform-provider-aws/issues/11071)) +* resource/aws_key_pair: Add `tags` argument and `key_pair_id` attribute ([#11481](https://github.com/terraform-providers/terraform-provider-aws/issues/11481)) +* resource/aws_network_interface: Add `mac_address` attribute ([#10633](https://github.com/terraform-providers/terraform-provider-aws/issues/10633)) +* resource/aws_organization_organization: Support plan-time validation value of `TAG_POLICY` in `enabled_policy_types` argument ([#11535](https://github.com/terraform-providers/terraform-provider-aws/issues/11535)) +* resource/aws_placement_group: Add `tags` argument and `placement_group_id` attribute ([#11482](https://github.com/terraform-providers/terraform-provider-aws/issues/11482)) +* resource/aws_rds_cluster_endpoint: Add `tags` argument ([#11074](https://github.com/terraform-providers/terraform-provider-aws/issues/11074)) + +BUG FIXES: + +* data-source/aws_acmpca_certificate_authority: Properly set `not_after` and `not_before` values into the Terraform state ([#11491](https://github.com/terraform-providers/terraform-provider-aws/issues/11491)) +* provider: Upgrade AWS Go SDK dependency to fix missing/incorrect API error messages and missing retries regression introduced in Terraform AWS Provider version 2.45.0 ([#11727](https://github.com/terraform-providers/terraform-provider-aws/issues/11727)) +* resource/aws_acmpca_certificate_authority: Properly set `not_after` and `not_before` values into the Terraform state ([#11491](https://github.com/terraform-providers/terraform-provider-aws/issues/11491)) +* resource/aws_api_gateway_account: Update retryable error message handling for recent API update ([#11735](https://github.com/terraform-providers/terraform-provider-aws/issues/11735)) +* resource_aws_cognito_resource_server: Increase `scope` max limit to match API ([#10505](https://github.com/terraform-providers/terraform-provider-aws/issues/10505)) +* resource_aws_cognito_user_pool_client: Increase `allowed_oauth_scopes` max limit to match API ([#10505](https://github.com/terraform-providers/terraform-provider-aws/issues/10505)) +* resource/aws_dms_certificate: Properly set `certificate_wallet` value into Terraform state ([#11496](https://github.com/terraform-providers/terraform-provider-aws/issues/11496)) +* resource/aws_ec2_client_vpn_endpoint: Properly set `status` value into Terraform state ([#11497](https://github.com/terraform-providers/terraform-provider-aws/issues/11497)) +* resource/aws_ecs_task_definition: Properly refresh `ipc_mode` and `pid_mode` attributes in Terraform state for drift detection ([#11707](https://github.com/terraform-providers/terraform-provider-aws/issues/11707)) +* resource/aws_emr_security_configuration: Properly set `creation_date` value into the Terraform state ([#11491](https://github.com/terraform-providers/terraform-provider-aws/issues/11491)) +* resource/aws_iam_service_linked_role: Properly set `create_date` value into the Terraform state ([#11491](https://github.com/terraform-providers/terraform-provider-aws/issues/11491)) +* resource/aws_iot_topic_rule: Trigger resource recreation on `name` argument updates ([#10366](https://github.com/terraform-providers/terraform-provider-aws/issues/10366)) +* resource/aws_lambda_event_source_mapping: Properly set `last_modified` value into the Terraform state ([#11491](https://github.com/terraform-providers/terraform-provider-aws/issues/11491)) +* resource/aws_organizations_account: Properly set `joined_timestamp` value into the Terraform state ([#11491](https://github.com/terraform-providers/terraform-provider-aws/issues/11491)) +* resource/aws_redshift_cluster: Handle `available, prep-for-resize` pending status during creation and update ([#10530](https://github.com/terraform-providers/terraform-provider-aws/issues/10530)) +* resource/aws_ssm_activation: Properly set `expiration_date` value into the Terraform state and perform drift detection when configured ([#11491](https://github.com/terraform-providers/terraform-provider-aws/issues/11491)) +* resource/aws_ssm_document: Properly set `created_date` value into the Terraform state ([#11491](https://github.com/terraform-providers/terraform-provider-aws/issues/11491)) +* resource/aws_waf_sql_injection_match_set: Properly set `sql_injection_match_tuples` value into Terraform state ([#11498](https://github.com/terraform-providers/terraform-provider-aws/issues/11498)) + +## 2.45.0 (January 17, 2020) + +ENHANCEMENTS: + +* resource/aws_codepipeline_webhook: Support in-place `tags` updates ([#11387](https://github.com/terraform-providers/terraform-provider-aws/issues/11387)) +* resource/aws_db_parameter_group: Support resetting parameter group values ([#11540](https://github.com/terraform-providers/terraform-provider-aws/issues/11540)) +* resource/aws_docdb_cluster: Support `profiler` CloudWatch export type ([#11051](https://github.com/terraform-providers/terraform-provider-aws/issues/11051)) +* resource/aws_gamelift_alias: Add `tags` argument ([#11486](https://github.com/terraform-providers/terraform-provider-aws/issues/11486)) +* resource/aws_gamelift_build: Add `tags` argument and `arn` attribute ([#11486](https://github.com/terraform-providers/terraform-provider-aws/issues/11486)) +* resource/aws_gamelift_fleet - Add support for instance_role_arn ([#11553](https://github.com/terraform-providers/terraform-provider-aws/issues/11553)) +* resource/aws_gamelift_game_session_queue: Add `tags` argument ([#11486](https://github.com/terraform-providers/terraform-provider-aws/issues/11486)) +* resource/aws_neptune_parameter_group: Support tag-on-create ([#11245](https://github.com/terraform-providers/terraform-provider-aws/issues/11245)) +* resource/aws_pinpoint_app: Add plan-time validation for `limit` configuration block `daily`, `maximum_duration`, `messages_per_second` and `total` arguments ([#11368](https://github.com/terraform-providers/terraform-provider-aws/issues/11368)) +* resource/aws_rds_cluster: Allow enabling Aurora Serverless HTTP endpoint (Data API) with `enable_http_endpoint` ([#11048](https://github.com/terraform-providers/terraform-provider-aws/issues/11048)) +* resource/aws_rds_cluster_parameter_group: Support resetting parameter group values ([#11540](https://github.com/terraform-providers/terraform-provider-aws/issues/11540)) +* resource/aws_ssm_document: Add support for "Package" document type ([#11492](https://github.com/terraform-providers/terraform-provider-aws/issues/11492)) +* resource/aws_vpc_peering_connection_accepter: Support resource import ([#4486](https://github.com/terraform-providers/terraform-provider-aws/issues/4486)) + +BUG FIXES: + +* resource/aws_autoscaling_group: Prevent indefinite wait for desired capacity to be available when instance_weight specified and >=1 ([#11357](https://github.com/terraform-providers/terraform-provider-aws/issues/11357)) +* resource/aws_cloudwatch_event_rule: Retry deletion on CloudWatch Events Target deletion eventual consistency ([#11475](https://github.com/terraform-providers/terraform-provider-aws/issues/11475)) +* resource/aws_cloudwatch_event_target: Return failed entry error code and message if provided in `RemoveTargets` response ([#11475](https://github.com/terraform-providers/terraform-provider-aws/issues/11475)) +* resource/aws_codepipeline_webhook: Properly trigger resource recreation when `authentication_configuration` configuration block `allowed_ip_range` and `secret_token` arguments change ([#11387](https://github.com/terraform-providers/terraform-provider-aws/issues/11387)) +* resource/aws_emr_cluster: Prevent perpetual difference with `ec2_attributes` configuration block `emr_managed_master_security_group`, `emr_managed_slave_security_group`, and `service_access_security_groups` arguments when omitted (support EMR Managed Security Groups) ([#5493](https://github.com/terraform-providers/terraform-provider-aws/issues/5493)) +* resource/aws_opsworks_permission: Prevent `Unable to change own permission level` error during self updates ([#11379](https://github.com/terraform-providers/terraform-provider-aws/issues/11379)) + +## 2.44.0 (January 09, 2020) + +FEATURES: + +* **New Data Source:** `aws_directory_service_directory` ([#11282](https://github.com/terraform-providers/terraform-provider-aws/issues/11282)) +* **New Resource:** `aws_workspaces_directory` ([#11023](https://github.com/terraform-providers/terraform-provider-aws/issues/11023)) + +ENHANCEMENTS: + +* data-source/aws_launch_configuration: Add `arn` attribute ([#11416](https://github.com/terraform-providers/terraform-provider-aws/issues/11416)) +* data-source/aws_eks_cluster: Add `vpc_config` list `public_access_cidrs` attribute ([#11442](https://github.com/terraform-providers/terraform-provider-aws/issues/11442)) +* resource/aws_ami_launch_permission: Support resource import ([#11437](https://github.com/terraform-providers/terraform-provider-aws/issues/11437)) +* resource/aws_api_gateway_authorizer: Support resource import ([#11436](https://github.com/terraform-providers/terraform-provider-aws/issues/11436)) +* resource/aws_api_gateway_authorizer: Add plan time validation for `provider_arns` argument ([#11436](https://github.com/terraform-providers/terraform-provider-aws/issues/11436)) +* resource/aws_api_gateway_usage_plan_key: Support resource import ([#11439](https://github.com/terraform-providers/terraform-provider-aws/issues/11439)) +* resource/aws_batch_compute_environment: Add `compute_environment_name_prefix` argument and make `compute_enviroment_name` argument optional (support full name generation) ([#10682](https://github.com/terraform-providers/terraform-provider-aws/issues/10682)) +* resource/aws_batch_compute_environment: Add `compute_resources` configuration block `allocation_strategy` argument ([#10894](https://github.com/terraform-providers/terraform-provider-aws/issues/10894)) +* resource/aws_batch_job_queue: Support resource import ([#11406](https://github.com/terraform-providers/terraform-provider-aws/issues/11406)) +* resource/aws_cloudformation_stack: Prevent difference with `Transform` templates showing processed template (support SAM templates) ([#9006](https://github.com/terraform-providers/terraform-provider-aws/issues/9006)) +* resource/aws_cloudwatch_event_rule: Support tag-on-create ([#11346](https://github.com/terraform-providers/terraform-provider-aws/issues/11346)) +* resource/aws_db_instance: Remove `identifier_prefix` 16 character truncation for `sqlserver` engine ([#9040](https://github.com/terraform-providers/terraform-provider-aws/issues/9040)) +* resource/aws_ecs_service: Add plan time validation for `launch_type`, `load_balancer` configuration block `target_group_arn` and `container_port`, and `placement_constraints` configuration block `type` arguments ([#11423](https://github.com/terraform-providers/terraform-provider-aws/issues/11423)) +* resource/aws_eks_cluster: Add `vpc_config` configuration block `public_access_cidrs` argument ([#11442](https://github.com/terraform-providers/terraform-provider-aws/issues/11442)) +* resource/aws_elasticache_cluster: Add `arn` attribute ([#11243](https://github.com/terraform-providers/terraform-provider-aws/issues/11243)) +* resource/aws_launch_configuration: Add `arn` attribute ([#11416](https://github.com/terraform-providers/terraform-provider-aws/issues/11416)) +* resource/aws_lb: Add plan-time validation for `ip_address_type` and `load_balancer_type` arguments ([#11419](https://github.com/terraform-providers/terraform-provider-aws/issues/11419)) +* resource/aws_rds_cluster_instance: Allow updating `ca_cert_identifier` for `aws_rds_cluster_instance` ([#10954](https://github.com/terraform-providers/terraform-provider-aws/issues/10954)) +* resource/aws_wafregional_xss_match_set: Support resource import ([#11432](https://github.com/terraform-providers/terraform-provider-aws/issues/11432)) + +BUG FIXES: + +* provider: Allow `aws` account ID in ARN validation (support ARNs such as AWS Managed IAM Policies) ([#11450](https://github.com/terraform-providers/terraform-provider-aws/issues/11450)) +* provider: Support AWS C2S/SC2S Regional ARNs in ARN validation ([#11471](https://github.com/terraform-providers/terraform-provider-aws/issues/11471)) +* resource/aws_api_gateway_usage_plan_key: Ensure Terraform performs drift detection of `key_type` argument ([#11439](https://github.com/terraform-providers/terraform-provider-aws/issues/11439)) +* resource/aws_appautoscaling_policy: Prevent potential state removal of resource immediately after creation due to eventual consistency ([#11222](https://github.com/terraform-providers/terraform-provider-aws/issues/11222)) +* resource/aws_cloudwatch_dashboard: Trigger resource recreation on `dashboard_name` updates (prevent dangling resource) ([#9784](https://github.com/terraform-providers/terraform-provider-aws/issues/9784)) +* resource/aws_cloudwatch_event_rule: Improved handling of `is_enabled` argument ([#11346](https://github.com/terraform-providers/terraform-provider-aws/issues/11346)) +* resource/aws_ecs_service: Automatically retry IAM Service Linked Role assume role error on creation due to asynchronous creation of role on first usage and IAM eventual consistency ([#11423](https://github.com/terraform-providers/terraform-provider-aws/issues/11423)) +* resource/aws_iam_instance: Allows for instance profiles to be changed when instances are in stopped state ([#11104](https://github.com/terraform-providers/terraform-provider-aws/issues/11104)) +* resource/aws_opsworks_stack: Ensure `tags` are refreshed in Terraform state during read for drift detection ([#11373](https://github.com/terraform-providers/terraform-provider-aws/issues/11373)) +* resource/aws_rds_cluster_instance: Prevent `is already being deleted` error on deletion and wait for deletion completion ([#11468](https://github.com/terraform-providers/terraform-provider-aws/issues/11468)) + +## 2.43.0 (December 19, 2019) + +NOTES: + +* This will be the last planned release until early January. Enjoy the rest of your year! + +FEATURES: + +* **New Data Source:** `aws_organizations_organizational_units` ([#10395](https://github.com/terraform-providers/terraform-provider-aws/issues/10395)) +* **New Resource:** `aws_accessanalyzer_analyzer` ([#11169](https://github.com/terraform-providers/terraform-provider-aws/issues/11169)) +* **New Resource:** `aws_lambda_function_event_invoke_config` ([#11165](https://github.com/terraform-providers/terraform-provider-aws/issues/11165)) + +ENHANCEMENTS: + +* data-source/aws_elb: Add `arn` attribute ([#11345](https://github.com/terraform-providers/terraform-provider-aws/issues/11345)) +* resource/aws_batch_compute_environment: Support resource import ([#11299](https://github.com/terraform-providers/terraform-provider-aws/issues/11299)) +* resource/aws_codebuild_project: Add `queued_timeout` argument ([#11261](https://github.com/terraform-providers/terraform-provider-aws/issues/11261)) +* resource/aws_fsx_windows_file_system: Support `storage_capacity` minimum value of `32` in validation to match recent updates to the API ([#11272](https://github.com/terraform-providers/terraform-provider-aws/issues/11272)) +* resource/aws_opsworks_custom_layer: Add `encrypted` `ebs_volume` configuration ([#7110](https://github.com/terraform-providers/terraform-provider-aws/issues/7110)) + +BUG FIXES: + +* resource/aws_datasync_agent: Trigger resource recreation on updated `InvalidRequestException` error for agents deleted outside Terraform ([#11005](https://github.com/terraform-providers/terraform-provider-aws/issues/11005)) +* resource/aws_ecs_cluster: Fixes intermittent failures on update when cluster dependencies are updating ([#11310](https://github.com/terraform-providers/terraform-provider-aws/issues/11310)) +* resource/aws_ecs_cluster: Fixes bug where ECS cluster capacity providers are updated but default provider strategy is not changed ([#11316](https://github.com/terraform-providers/terraform-provider-aws/issues/11316)) +* resource/aws_globalaccelerator_endpoint_group: Allow `traffic_dial_percentage` to be set to `0` ([#11253](https://github.com/terraform-providers/terraform-provider-aws/issues/11253)) +* resource/aws_lb_listener_rule: Fixes regression from version 2.42.0 when updating a rule without modifying condition ([#11364](https://github.com/terraform-providers/terraform-provider-aws/issues/11364)) +* resource/aws_ssm_activation: Ensure `tags` are refreshed into Terraform state during read for drift detection ([#11290](https://github.com/terraform-providers/terraform-provider-aws/issues/11290)) + +## 2.42.0 (December 13, 2019) + +FEATURES: + +* **New Resource:** `aws_ecs_capacity_provider` ([#11151](https://github.com/terraform-providers/terraform-provider-aws/issues/11151)) +* **New Resource:** `aws_media_convert_queue` ([#10041](https://github.com/terraform-providers/terraform-provider-aws/issues/10041)) +* **New Resource:** `aws_workspaces_ip_group` ([#10904](https://github.com/terraform-providers/terraform-provider-aws/issues/10904)) + +ENHANCEMENTS: + +* resource/aws_apigateway_usage_plan: Add `tags` argument and `arn` attribute ([#10566](https://github.com/terraform-providers/terraform-provider-aws/issues/10566)) +* resource/aws_codebuild_project: Add `ARM_CONTAINER` as valid `environment` configuration block `compute_type` argument value ([#11206](https://github.com/terraform-providers/terraform-provider-aws/issues/11206)) +* resource/aws_ecs_cluster: Add `capacity_providers` argument and `default_capacity_provider_strategy` configuration block (support ECS Capacity Providers) ([#11151](https://github.com/terraform-providers/terraform-provider-aws/issues/11151)) +* resource/aws_ecs_service: Add `capacity_provider_strategy` configuration block (support ECS Capacity Providers) ([#11151](https://github.com/terraform-providers/terraform-provider-aws/issues/11151)) +* resource/aws_emr_cluster: Add `step_concurrency_level` argument ([#11196](https://github.com/terraform-providers/terraform-provider-aws/issues/11196)) +* resource/aws_lb_listener_rule: Support ALB advanced routing rules ([#8268](https://github.com/terraform-providers/terraform-provider-aws/issues/8268)) + +BUG FIXES: + +* provider: Prevent crash in planning IAM Policy equivalency checking with invalid `Resource` declarations (e.g. a list of list of strings) ([#11107](https://github.com/terraform-providers/terraform-provider-aws/issues/11107)) +* resource/aws_eks_cluster: Handle additional `InvalidParameterException: Error in role params` error during creation for IAM eventual consistency ([#11127](https://github.com/terraform-providers/terraform-provider-aws/issues/11127)) +* resource/aws_iam_role: Ignore additional `NoSuchEntity` errors on deletion ([#11125](https://github.com/terraform-providers/terraform-provider-aws/issues/11125)) +* resource/aws_network_interface: Prevent extraneous `ModifyNetworkInterfaceAttribute` API call during update ([#11277](https://github.com/terraform-providers/terraform-provider-aws/issues/11277)) +* resource/aws_security_group: Support ampersand (`&`) in `ingress` and `egress` configuration block `description` argument value validation ([#9528](https://github.com/terraform-providers/terraform-provider-aws/issues/9528)) +* resource/aws_security_group_rule: Support ampersand (`&`) in `description` argument value validation ([#9528](https://github.com/terraform-providers/terraform-provider-aws/issues/9528)) + +## 2.41.0 (December 04, 2019) + +FEATURES: + +* **New Resource:** `aws_eks_fargate_profile` ([#11111](https://github.com/terraform-providers/terraform-provider-aws/issues/11111)) +* **New Resource:** `aws_lambda_provisioned_concurrency_config` ([#11129](https://github.com/terraform-providers/terraform-provider-aws/issues/11129)) + +ENHANCEMENTS: + +* data-source/aws_route_table: adds attributes `gateway_id` and `associations.gateway_id` ([#11122](https://github.com/terraform-providers/terraform-provider-aws/issues/11122)) +* resource/aws_autoscaling_group: Add `max_instance_lifetime` argument ([#10951](https://github.com/terraform-providers/terraform-provider-aws/issues/10951)) +* resource/aws_autoscaling_group: Add `mixed_instances_policy` `launch_template` `override` configuration block `weighted_capacity` argument ([#11004](https://github.com/terraform-providers/terraform-provider-aws/issues/11004)) +* resource/aws_codebuild_project: Add Linux GPU worker ([#11035](https://github.com/terraform-providers/terraform-provider-aws/issues/11035)) +* resource/aws_docdb_cluster_instance: Add support for `ca_cert_identifier` parameter ([#11041](https://github.com/terraform-providers/terraform-provider-aws/issues/11041)) +* resource/aws_emr_cluster: Outputs EMR cluster ARN ([#11078](https://github.com/terraform-providers/terraform-provider-aws/issues/11078)) +* resource/aws_iam_access_key: Remove deprecation from `secret` and mark `secret` and `ses_smtp_password` to sensitive ([#10908](https://github.com/terraform-providers/terraform-provider-aws/issues/10908)) +* resource/aws_iam_user: Delete a user's virtual MFA devices when `force_destroy` is enabled ([#11040](https://github.com/terraform-providers/terraform-provider-aws/issues/11040)) +* resource/aws_route_table_association: adds attribute `gateway_id` ([#11122](https://github.com/terraform-providers/terraform-provider-aws/issues/11122)) + +BUG FIXES: + +* resource/aws_batch_compute_environment: Forces new resource when `launch_template` contents are changed ([#11057](https://github.com/terraform-providers/terraform-provider-aws/issues/11057)) +* resource/aws_datasync_location_s3: Automatically retry creation for IAM errors due to eventual consistency ([#10984](https://github.com/terraform-providers/terraform-provider-aws/issues/10984)) +* resource/aws_launch_template: Only set associate_public_ip_address on network interfaces if it's explicitly set to avoid problems with multiple network interfaces ([#10157](https://github.com/terraform-providers/terraform-provider-aws/issues/10157)) + +## 2.40.0 (November 26, 2019) + +NOTES: + +* resource/aws_datasync_task: The DataSync API and SDK have removed `BEST_EFFORT` as a valid value for the `options` configuration block `posix_permissions` argument. The value has been removed from the validation in this resource to match those changes. ([#10985](https://github.com/terraform-providers/terraform-provider-aws/issues/10985)) + +FEATURES: + +* **New Resource:** `aws_dx_hosted_transit_virtual_interface` ([#8523](https://github.com/terraform-providers/terraform-provider-aws/issues/8523)) +* **New Resource:** `aws_dx_hosted_transit_virtual_interface_accepter` ([#8523](https://github.com/terraform-providers/terraform-provider-aws/issues/8523)) + +ENHANCEMENTS: + +* data-source/aws_eks_cluster: Add `vpc_config` nested block `cluster_security_group_id` attribute ([#11002](https://github.com/terraform-providers/terraform-provider-aws/issues/11002)) +* resource/aws_cloudwatch_metric_alarm: Add `threshold_metric_id` argument (support Anomaly Detection metrics) ([#9828](https://github.com/terraform-providers/terraform-provider-aws/issues/9828)) +* resource/aws_codebuild_project: Add support for BUILD_GENERAL1_2XLARGE CodeBuild compute type [GH11015] +* resource/aws_dx_private_virtual_interface: Support tagging-on-create ([#9572](https://github.com/terraform-providers/terraform-provider-aws/issues/9572)) +* resource/aws_dx_private_virtual_interface: Validate Virtual Interface type on import ([#9572](https://github.com/terraform-providers/terraform-provider-aws/issues/9572)) +* resource/aws_dx_public_virtual_interface: Validate Virtual Interface type on import ([#9572](https://github.com/terraform-providers/terraform-provider-aws/issues/9572)) +* resource/aws_ebs_snapshot: Support tagging-on-create and in-place `tags` updates ([#10935](https://github.com/terraform-providers/terraform-provider-aws/issues/10935)) +* resource/aws_ebs_snapshot_copy: Support tagging-on-create and in-place `tags` updates ([#10936](https://github.com/terraform-providers/terraform-provider-aws/issues/10936)) +* resource/aws_eks_cluster: Add `vpc_config` configuration block `cluster_security_group_id` attribute ([#11002](https://github.com/terraform-providers/terraform-provider-aws/issues/11002)) +* resource/aws_lambda_function: Support waiting for function creation and configuration updates ([#11016](https://github.com/terraform-providers/terraform-provider-aws/issues/11016)) + +BUG FIXES: + +* data-source/aws_iam_group: Ensure `users` attribute populates fully when group contains more than 100 users ([#10993](https://github.com/terraform-providers/terraform-provider-aws/issues/10993)) +* resource/aws_default_route_table: Return helpful not found error on resource creation instead of generic `Provider produced inconsistent result after apply` error when given invalid `default_route_table_id` argument value ([#10981](https://github.com/terraform-providers/terraform-provider-aws/issues/10981)) +* resource/aws_default_route_table: Propose resource recreation for missing Default Route Table on refresh instead of returning an error ([#10981](https://github.com/terraform-providers/terraform-provider-aws/issues/10981)) + +## 2.39.0 (November 21, 2019) + +FEATURES: + +* **New Data Source:** `aws_guardduty_detector` ([#10463](https://github.com/terraform-providers/terraform-provider-aws/issues/10463)) +* **New Resource:** `aws_glue_workflow` ([#10891](https://github.com/terraform-providers/terraform-provider-aws/issues/10891)) + +ENHANCEMENTS: + +* provider: Support for EC2 Metadata secure tokens ([#10940](https://github.com/terraform-providers/terraform-provider-aws/issues/10940)) +* resource/aws_glue_job: Add `number_of_workers` and `worker_type` arguments ([#9115](https://github.com/terraform-providers/terraform-provider-aws/issues/9115)) +* resource/aws_glue_job: Add `tags` argument and `arn` attribute ([#10968](https://github.com/terraform-providers/terraform-provider-aws/issues/10968)) +* resource/aws_glue_trigger: Add `workflow_name` argument ([#9762](https://github.com/terraform-providers/terraform-provider-aws/issues/9762)) +* resource/aws_glue_trigger: Add `actions` configuration block `crawler_name` argument ([#10190](https://github.com/terraform-providers/terraform-provider-aws/issues/10190)) +* resource/aws_glue_trigger: Add `predicate` `conditions` configuration block `crawler_name` and `crawl_state` arguments ([#10190](https://github.com/terraform-providers/terraform-provider-aws/issues/10190)) +* resource/aws_glue_trigger: Add `tags` argument and `arn` attribute ([#10967](https://github.com/terraform-providers/terraform-provider-aws/issues/10967)) +* resource/aws_iam_group_policy: Add IAM Policy JSON difference suppression and validation to `policy` argument ([#9660](https://github.com/terraform-providers/terraform-provider-aws/issues/9660)) +* resource/aws_lambda_event_source_mapping: Add `maximum_batching_window_in_seconds` argument ([#10051](https://github.com/terraform-providers/terraform-provider-aws/issues/10051)) +* resource/aws_lambda_function: Support `java11`, `nodejs12.x`, and `python3.8` as valid `runtime` argument values in validation ([#10938](https://github.com/terraform-providers/terraform-provider-aws/issues/10938)) +* resource/aws_lambda_layer_version: Support `java11`, `nodejs12.x`, and `python3.8` as valid `compatible_runtimes` argument values in validation ([#10938](https://github.com/terraform-providers/terraform-provider-aws/issues/10938)) +* resource/aws_resourcegroups_group: Add `tags` argument ([#10640](https://github.com/terraform-providers/terraform-provider-aws/issues/10640)) + +BUG FIXES: + +* data_source/aws_instance: Fixes a bug where multiple EBS volumes would get collapsed and only one would return ([#10045](https://github.com/terraform-providers/terraform-provider-aws/issues/10045)) +* resource/aws_appmesh_virtual_node: Allow FQDN values in `service_discovery` `aws_cloud_map` configuration block `namespace_name` and `service_name` argument validations ([#9788](https://github.com/terraform-providers/terraform-provider-aws/issues/9788)) +* resource/aws_batch_compute_environment: Propose resource recreation when updating `compute_resources` configuration block `tags` argument ([#10937](https://github.com/terraform-providers/terraform-provider-aws/issues/10937)) +* resource/aws_iam_instance_profile: Remove requirement to specify a role, as it is not required by the API ([#10525](https://github.com/terraform-providers/terraform-provider-aws/issues/10525)) +* resource/aws_opsworks_application: Fixes issue where `terraform apply` continuously suggests applying changes to `ssh_key` or `password` in `app_source` property ([#10175](https://github.com/terraform-providers/terraform-provider-aws/issues/10175)) +* resource/aws_opsworks_stack: Fixes issue where `terraform apply` continuously suggests applying changes to `ssh_key` or `password` in `custom_cookbooks_source` property ([#10175](https://github.com/terraform-providers/terraform-provider-aws/issues/10175)) + +## 2.38.0 (November 18, 2019) + +FEATURES: + +* **New Resource:** `aws_eks_node_group` ([#10916](https://github.com/terraform-providers/terraform-provider-aws/issues/10916)) + +## 2.37.0 (November 18, 2019) + +ENHANCEMENTS: + +* resource/aws_api_gateway_rest_api: Add `tags` argument and `arn` attribute ([#10581](https://github.com/terraform-providers/terraform-provider-aws/issues/10581)) +* resource/aws_db_instance: Add `ca_cert_identifier` argument ([#10490](https://github.com/terraform-providers/terraform-provider-aws/issues/10490)) +* resource/aws_dlm_lifecycle_policy: Add `tags` argument and `arn` attribute ([#10864](https://github.com/terraform-providers/terraform-provider-aws/issues/10864)) +* resource/aws_efs_file_system: Add `AFTER_7_DAYS` as a valid `lifecycle_policy` configuratio block `transition_to_ia` argument value ([#10825](https://github.com/terraform-providers/terraform-provider-aws/issues/10825)) +* resource/aws_glue_crawler: Add `tags` argument ([#10805](https://github.com/terraform-providers/terraform-provider-aws/issues/10805)) +* resource/aws_s3_bucket_inventory: Add `IntelligentTieringAccessTier` as valid value for `optional_fields` argument ([#10746](https://github.com/terraform-providers/terraform-provider-aws/issues/10746)) +* resource/aws_waf_geo_match_set: Support resource import and add `arn` attribute ([#10480](https://github.com/terraform-providers/terraform-provider-aws/issues/10480)) +* resource/aws_waf_regex_match_set: Support resource import and add `arn` attribute ([#10481](https://github.com/terraform-providers/terraform-provider-aws/issues/10481)) +* resource/aws_waf_regex_pattern_set: Support resource import and add `arn` attribute ([#10482](https://github.com/terraform-providers/terraform-provider-aws/issues/10482)) +* resource/aws_waf_size_constraint_set: Support resource import and add `arn` attribute ([#10484](https://github.com/terraform-providers/terraform-provider-aws/issues/10484)) +* resource/aws_waf_xss_match_set: Support resource import and add `arn` attribute ([#10485](https://github.com/terraform-providers/terraform-provider-aws/issues/10485)) +* resource/aws_wafregional_rate_based_rule: Add `tags` argument and `arn` attribute ([#10897](https://github.com/terraform-providers/terraform-provider-aws/issues/10897)) +* resource/aws_wafregional_rule_group: Add `tags` argument and `arn` attribute ([#10896](https://github.com/terraform-providers/terraform-provider-aws/issues/10896)) +* resource/aws_wafregional_rule: Add `tags` argument and `arn` attribute ([#10895](https://github.com/terraform-providers/terraform-provider-aws/issues/10895)) +* resource/aws_wafregional_web_acl: Add `tags` argument ([#10889](https://github.com/terraform-providers/terraform-provider-aws/issues/10889)) +* resource/aws_wafregional_web_acl_association: Support resource import ([#10538](https://github.com/terraform-providers/terraform-provider-aws/issues/10538)) +* resource/aws_cloudtrail: support Tag on create ([#10818](https://github.com/terraform-providers/terraform-provider-aws/issues/10818)) + +BUG FIXES: + +* data-source/aws_iam_policy_document: Prevent panic when combining single principal identifier with multiple principal identifiers ([#10780](https://github.com/terraform-providers/terraform-provider-aws/issues/10780)) +* data-source/aws_iam_policy_document: Prevent losing identifier elements when combining single and multiple principals identifiers ([#10844](https://github.com/terraform-providers/terraform-provider-aws/issues/10844)) +* resource/aws_servicequotas_service_quota: Remove resource from Terraform state on `NoSuchResourceException` error ([#10735](https://github.com/terraform-providers/terraform-provider-aws/issues/10735)) + +## 2.36.0 (November 14, 2019) + +ENHANCEMENTS: + +* data-source/aws_iam_group: Add `users` attribute ([#7132](https://github.com/terraform-providers/terraform-provider-aws/issues/7132)) +* resource/aws_apigateway_stage: Add `arn` attribute ([#10570](https://github.com/terraform-providers/terraform-provider-aws/issues/10570)) +* resource/aws_s3_bucket: Retry reading tags on `NoSuchBucket` errors due to eventual inconsistency ([#10863](https://github.com/terraform-providers/terraform-provider-aws/issues/10863)) +* resource/aws_waf_rule: Add `arn` attribute ([#10798](https://github.com/terraform-providers/terraform-provider-aws/issues/10798)) +* resource/aws_waf_rule_group: Add `arn` attribute ([#10799](https://github.com/terraform-providers/terraform-provider-aws/issues/10799)) + +## 2.35.0 (November 07, 2019) + +NOTES: + +* provider: New `ignore_tag_prefixes` and `ignore_tags` arguments are being tested as a public preview for ignoring tags across all resources under a provider. Support for the functionality must be added to individual resources in the codebase and is only implemented for the `aws_subnet` and `aws_vpc` resources at this time. Until a general availability announcement, no compatibility promises are made with these provider arguments and their functionality. ([#10418](https://github.com/terraform-providers/terraform-provider-aws/issues/10418)) + +FEATURES: + +* **New Data Source:** `aws_qldb_ledger` ([#10394](https://github.com/terraform-providers/terraform-provider-aws/issues/10394)) +* **New Resource:** `aws_qldb_ledger` ([#10394](https://github.com/terraform-providers/terraform-provider-aws/issues/10394)) + +ENHANCEMENTS: + +* data-source/aws_db_cluster_snapshot: Add `tags` attribute ([#10488](https://github.com/terraform-providers/terraform-provider-aws/issues/10488)) +* data-source/aws_db_instance: Add `tags` attribute ([#10550](https://github.com/terraform-providers/terraform-provider-aws/issues/10550)) +* data-source/aws_vpc_endpoint: Add `filter` and `tags` arguments ([#10503](https://github.com/terraform-providers/terraform-provider-aws/issues/10503)) +* provider: Add `ignore_tag_prefixes` and `ignore_tags` arguments (in public preview, see note above) ([#10418](https://github.com/terraform-providers/terraform-provider-aws/issues/10418)) +* resource/aws_acmpca_certificate_authority: Support tagging on creation ([#10736](https://github.com/terraform-providers/terraform-provider-aws/issues/10736)) +* resource/aws_api_gateway_api_key: Add `tags` argument and `arn` attribute ([#10568](https://github.com/terraform-providers/terraform-provider-aws/issues/10568)) +* resource/aws_api_gateway_client_certificate: Add `tags` argument and `arn` attribute ([#10569](https://github.com/terraform-providers/terraform-provider-aws/issues/10569)) +* resource/aws_api_gateway_domain_name: Add `tags` argument and `arn` attribute ([#10567](https://github.com/terraform-providers/terraform-provider-aws/issues/10567)) +* resource/aws_api_gateway_vpc_link: Add `tags` argument and `arn` attribute ([#10561](https://github.com/terraform-providers/terraform-provider-aws/issues/10561)) +* resource/aws_cloudwatch_log_group: Support tagging on creation ([#10753](https://github.com/terraform-providers/terraform-provider-aws/issues/10753)) +* resource/aws_db_cluster_snapshot: Add `tags` argument ([#10488](https://github.com/terraform-providers/terraform-provider-aws/issues/10488)) +* resource/aws_ec2_fleet: Support in-place `tags` updates ([#10761](https://github.com/terraform-providers/terraform-provider-aws/issues/10761)) +* resource/aws_launch_template: Support tagging on creation ([#10759](https://github.com/terraform-providers/terraform-provider-aws/issues/10759)) +* resource/aws_mq_broker: Support in-place `security_groups` updates ([#10442](https://github.com/terraform-providers/terraform-provider-aws/issues/10442)) +* resource/aws_storagegateway_cached_iscsi_volume: Add `tags` argument ([#10613](https://github.com/terraform-providers/terraform-provider-aws/issues/10613)) +* resource/aws_storagegateway_gateway: Add `tags` argument ([#10588](https://github.com/terraform-providers/terraform-provider-aws/issues/10588)) +* resource/aws_storagegateway_nfs_file_share: Add `tags` argument ([#10722](https://github.com/terraform-providers/terraform-provider-aws/issues/10722)) +* resource/aws_subnet: Support provider-wide ignore tags (in public preview, see note above) ([#10418](https://github.com/terraform-providers/terraform-provider-aws/issues/10418)) +* resource/aws_swf_domain: Add `tags` argument and `arn` attribute ([#10763](https://github.com/terraform-providers/terraform-provider-aws/issues/10763)) +* resource/aws_vpc: Support provider-wide ignore tags (in public preview, see note above) ([#10418](https://github.com/terraform-providers/terraform-provider-aws/issues/10418)) +* resource/aws_waf_rate_based_rule: Add `tags` argument and `arn` attribute ([#10479](https://github.com/terraform-providers/terraform-provider-aws/issues/10479)) + +BUG FIXES: + +* data-source/aws_route53_resolver_rule: Do not retrieve tags for rules shared with the AWS account that owns the data source ([#10348](https://github.com/terraform-providers/terraform-provider-aws/issues/10348)) +* resource/aws_api_gateway_authorizer: Set `authorizer_result_ttl_in_seconds` argument default to 300 to match API default which properly allows setting to 0 for disabling caching ([#9605](https://github.com/terraform-providers/terraform-provider-aws/issues/9605)) +* resource/aws_autoscaling_group: Batch ELB attachments and detachments by 10 to prevent API and rate limiting errors ([#10445](https://github.com/terraform-providers/terraform-provider-aws/issues/10445)) +* resource/aws_s3_bucket_public_access_block: Remove from Terraform state when S3 Bucket is already destroyed ([#10534](https://github.com/terraform-providers/terraform-provider-aws/issues/10534)) +* resource/aws_ssm_maintenance_window_task: Prevent crashes with empty configuration blocks ([#10713](https://github.com/terraform-providers/terraform-provider-aws/issues/10713)) + +## 2.34.0 (October 31, 2019) + +ENHANCEMENTS: + +* resource/aws_ecr_repository: Add `image_scanning_configuration` configuration block (support image scanning on push) ([#10671](https://github.com/terraform-providers/terraform-provider-aws/issues/10671)) +* resource/aws_elasticache_replication_group: Add `kms_key_id` argument (support KMS encryption) ([#10380](https://github.com/terraform-providers/terraform-provider-aws/issues/10380)) +* resource/aws_flow_log: Add `log_format` argument ([#10374](https://github.com/terraform-providers/terraform-provider-aws/issues/10374)) +* resource/aws_glue_job: Add `glue_version` argument ([#10237](https://github.com/terraform-providers/terraform-provider-aws/issues/10237)) +* resource/aws_storagegateway_smb_file_share: Add `tags` argument ([#10620](https://github.com/terraform-providers/terraform-provider-aws/issues/10620)) + +BUG FIXES: + +* resource/aws_backup_plan: Correctly handle changes to `recovery_point_tags` arguments ([#10641](https://github.com/terraform-providers/terraform-provider-aws/issues/10641)) +* resource/aws_backup_plan: Prevent `diffs didn't match` errors with `rule` configuration blocks ([#10641](https://github.com/terraform-providers/terraform-provider-aws/issues/10641)) +* resource/aws_cloudhsm_v2_cluster: Ensure multiple tag configurations are applied correctly ([#10309](https://github.com/terraform-providers/terraform-provider-aws/issues/10309)) +* resource/aws_cloudhsm_v2_cluster: Perform drift detection with tags ([#10309](https://github.com/terraform-providers/terraform-provider-aws/issues/10309)) +* resource/aws_dx_gateway_association: Fix backwards compatibility issue with missing `dx_gateway_association_id` attribute ([#8776](https://github.com/terraform-providers/terraform-provider-aws/issues/8776)) +* resource/aws_s3_bucket: Bypass `MethodNotAllowed` errors for Object Lock Configuration on read (support AWS C2S) ([#10657](https://github.com/terraform-providers/terraform-provider-aws/issues/10657)) + +## 2.33.0 (October 17, 2019) + +FEATURES: + +* **New Data Source:** `aws_waf_rate_based_rule` ([#10124](https://github.com/terraform-providers/terraform-provider-aws/issues/10124)) +* **New Data Source:** `aws_wafregional_rate_based_rule` ([#10125](https://github.com/terraform-providers/terraform-provider-aws/issues/10125)) +* **New Resource:** `aws_quicksight_user` ([#10401](https://github.com/terraform-providers/terraform-provider-aws/issues/10401)) + +ENHANCEMENTS: + +* resource/aws_glue_classifier: Add `csv_classifier` configuration block (support CSV classifiers) ([#9824](https://github.com/terraform-providers/terraform-provider-aws/issues/9824)) +* resource/aws_waf_byte_match_set: Support resource import ([#10477](https://github.com/terraform-providers/terraform-provider-aws/issues/10477)) +* resource/aws_waf_rate_based_rule: Support resource import ([#10475](https://github.com/terraform-providers/terraform-provider-aws/issues/10475)) +* resource/aws_waf_rule: Add `tags` argument ([#10408](https://github.com/terraform-providers/terraform-provider-aws/issues/10408)) +* resource/aws_waf_rule_group: Add `tags` argument ([#10408](https://github.com/terraform-providers/terraform-provider-aws/issues/10408)) +* resource/aws_waf_web_acl: Add `tags` argument ([#10408](https://github.com/terraform-providers/terraform-provider-aws/issues/10408)) + +BUG FIXES: + +* resource/aws_gamelift_fleet: Increase default deletion timeout to 20 minutes to match service timing ([#10443](https://github.com/terraform-providers/terraform-provider-aws/issues/10443)) + +## 2.32.0 (October 10, 2019) + +NOTES: + +* provider: The underlying Terraform codebase dependency for the provider SDK and acceptance testing framework has been migrated from `github.com/hashicorp/terraform` to `github.com/hashicorp/terraform-plugin-sdk`. They are functionality equivalent and this should only impact codebase development to switch imports. For more information see the [Terraform Plugin SDK page in the Extending Terraform documentation](https://www.terraform.io/docs/extend/plugin-sdk.html). ([#10367](https://github.com/terraform-providers/terraform-provider-aws/issues/10367)) + +ENHANCEMENTS: + +* resource/aws_emr_instance_group: Add `configurations_json` argument ([#10426](https://github.com/terraform-providers/terraform-provider-aws/issues/10426)) BUG FIXES: -* resource/aws_s3_bucket: Prevent infinite deletion recursion with `force_destroy` argument and object keys with empty "directory" prefixes present since version 2.29.0 [GH-10388] +* provider: Fix session handling to correctly validate and use assume_role credentials ([#10379](https://github.com/terraform-providers/terraform-provider-aws/issues/10379)) +* resource/aws_autoscaling_group: Batch ALB/NLB attachments and detachments by 10 to prevent API and rate limiting errors ([#10435](https://github.com/terraform-providers/terraform-provider-aws/issues/10435)) +* resource/aws_emr_instance_group: Remove terminated instance groups from the Terraform state ([#10425](https://github.com/terraform-providers/terraform-provider-aws/issues/10425)) +* resource/aws_s3_bucket: Prevent infinite deletion recursion with `force_destroy` argument and object keys with empty "directory" prefixes present since version 2.29.0 ([#10388](https://github.com/terraform-providers/terraform-provider-aws/issues/10388)) +* resource/aws_vpc_endpoint_route_table_association: Fix resource import support ([#10454](https://github.com/terraform-providers/terraform-provider-aws/issues/10454)) ## 2.31.0 (October 03, 2019) @@ -138,7 +705,7 @@ BUG FIXES: * resource/aws_ec2_capacity_reservation: Fixes error handling when an EC2 Capacity Reservation is deleted manually but is still in state ([#9862](https://github.com/terraform-providers/terraform-provider-aws/issues/9862)) * resource/aws_s3_bucket: Final retries after timeouts creating, updating and updating replication configuration for s3 buckets ([#9861](https://github.com/terraform-providers/terraform-provider-aws/issues/9861)) -* resource/aws_s3_bucket_inventory: Final retries after timeous reading and putting bucket inventories ([#9861](https://github.com/terraform-providers/terraform-provider-aws/issues/9861)) +* resource/aws_s3_bucket_inventory: Final retries after timeout reading and putting bucket inventories ([#9861](https://github.com/terraform-providers/terraform-provider-aws/issues/9861)) * resource/aws_s3_bucket_metric: Final retry after timeout putting bucket metric ([#9861](https://github.com/terraform-providers/terraform-provider-aws/issues/9861)) * resource/aws_s3_bucket_notification: Final retry after timeout putting notification ([#9861](https://github.com/terraform-providers/terraform-provider-aws/issues/9861)) * resource/aws_s3_bucket_policy: Final retry after timeout putting policy ([#9861](https://github.com/terraform-providers/terraform-provider-aws/issues/9861)) diff --git a/GNUmakefile b/GNUmakefile index f9cd4ec7aff..aed8baad14b 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,8 +1,10 @@ SWEEP?=us-east-1,us-west-2 TEST?=./... +SWEEP_DIR?=./aws GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor) PKG_NAME=aws WEBSITE_REPO=github.com/hashicorp/terraform-website +TEST_COUNT?=1 default: build @@ -15,13 +17,13 @@ gen: sweep: @echo "WARNING: This will destroy infrastructure. Use only in development accounts." - go test $(TEST) -v -sweep=$(SWEEP) $(SWEEPARGS) + go test $(SWEEP_DIR) -v -sweep=$(SWEEP) $(SWEEPARGS) -timeout 60m test: fmtcheck - go test $(TEST) -timeout=30s -parallel=4 + go test $(TEST) $(TESTARGS) -timeout=120s -parallel=4 testacc: fmtcheck - TF_ACC=1 go test $(TEST) -v -count 1 -parallel 20 $(TESTARGS) -timeout 120m + TF_ACC=1 go test $(TEST) -v -count $(TEST_COUNT) -parallel 20 $(TESTARGS) -timeout 120m fmt: @echo "==> Fixing source code with gofmt..." @@ -31,16 +33,42 @@ fmt: fmtcheck: @sh -c "'$(CURDIR)/scripts/gofmtcheck.sh'" +gencheck: + @echo "==> Checking generated source code..." + @$(MAKE) gen + @git diff --compact-summary --exit-code || \ + (echo; echo "Unexpected difference in directories after code generation. Run 'make gen' command and commit."; exit 1) + websitefmtcheck: @sh -c "'$(CURDIR)/scripts/websitefmtcheck.sh'" +depscheck: + @echo "==> Checking source code with go mod tidy..." + @go mod tidy + @git diff --exit-code -- go.mod go.sum || \ + (echo; echo "Unexpected difference in go.mod/go.sum files. Run 'go mod tidy' command or revert any go.mod/go.sum changes and commit."; exit 1) + @echo "==> Checking source code with go mod vendor..." + @go mod vendor + @git diff --compact-summary --exit-code -- vendor || \ + (echo; echo "Unexpected difference in vendor/ directory. Run 'go mod vendor' command or revert any go.mod/go.sum/vendor changes and commit."; exit 1) + +docscheck: + @tfproviderdocs check \ + -allowed-resource-subcategories-file website/allowed-subcategories.txt \ + -ignore-side-navigation-data-sources aws_alb,aws_alb_listener,aws_alb_target_group,aws_kms_secret \ + -require-resource-subcategory + lint: @echo "==> Checking source code against linters..." - @golangci-lint run --no-config --deadline 5m --disable-all --enable staticcheck --exclude SA1019 --max-issues-per-linter 0 --max-same-issues 0 ./$(PKG_NAME)/... @golangci-lint run ./$(PKG_NAME)/... - @tfproviderlint \ + @awsproviderlint \ -c 1 \ -AT001 \ + -AT002 \ + -AT006 \ + -AT007 \ + -R004 \ + -R006 \ -S001 \ -S002 \ -S003 \ @@ -58,10 +86,20 @@ lint: -S016 \ -S017 \ -S019 \ + -S021 \ + -S025 \ + -S026 \ + -S027 \ + -S028 \ + -S029 \ + -S030 \ + -V003 \ + -V006 \ ./$(PKG_NAME) tools: - GO111MODULE=on go install github.com/bflad/tfproviderlint/cmd/tfproviderlint + GO111MODULE=on go install ./awsproviderlint + GO111MODULE=on go install github.com/bflad/tfproviderdocs GO111MODULE=on go install github.com/client9/misspell/cmd/misspell GO111MODULE=on go install github.com/golangci/golangci-lint/cmd/golangci-lint @@ -83,6 +121,7 @@ endif website-lint: @echo "==> Checking website against linters..." @misspell -error -source=text website/ + @docker run -v $(PWD):/markdown 06kellyjac/markdownlint-cli website/docs/ website-test: ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) @@ -91,5 +130,5 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO))) endif @$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME) -.PHONY: build gen sweep test testacc fmt fmtcheck lint tools test-compile website website-lint website-test +.PHONY: build gen sweep test testacc fmt fmtcheck lint tools test-compile website website-lint website-test depscheck docscheck diff --git a/README.md b/README.md index cf6cdf74daa..fb6fcab76e3 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -Terraform Provider +Terraform Provider for AWS ================== - Website: https://www.terraform.io @@ -48,7 +48,7 @@ Using the Provider To use a released provider in your Terraform environment, run [`terraform init`](https://www.terraform.io/docs/commands/init.html) and Terraform will automatically install the provider. To specify a particular provider version when installing released providers, see the [Terraform documentation on provider versioning](https://www.terraform.io/docs/configuration/providers.html#version-provider-versions). -To instead use a custom-built provider in your Terraform environment (e.g. the provider binary from the build instructions above), follow the instructions to [install it as a plugin.](https://www.terraform.io/docs/plugins/basics.html#installing-a-plugin) After placing it into your plugins directory, run `terraform init` to initialize it. +To instead use a custom-built provider in your Terraform environment (e.g. the provider binary from the build instructions above), follow the instructions to [install it as a plugin.](https://www.terraform.io/docs/plugins/basics.html#installing-plugins) After placing the custom-built provider into your plugins directory, run `terraform init` to initialize it. For either installation method, documentation about the provider specific configuration options can be found on the [provider's website](https://www.terraform.io/docs/providers/aws/index.html). diff --git a/aws/awserr.go b/aws/awserr.go index 292642604d8..8c2be2c7502 100644 --- a/aws/awserr.go +++ b/aws/awserr.go @@ -1,6 +1,7 @@ package aws import ( + "errors" "strings" "time" @@ -13,8 +14,22 @@ import ( // * Error.Code() matches code // * Error.Message() contains message 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) + var awsErr awserr.Error + if errors.As(err, &awsErr) { + return awsErr.Code() == code && strings.Contains(awsErr.Message(), message) + } + return false +} + +// Returns true if the error matches all these conditions: +// * err is of type awserr.RequestFailure +// * RequestFailure.StatusCode() matches status code +// It is always preferable to use isAWSErr() except in older APIs (e.g. S3) +// that sometimes only respond with status codes. +func isAWSErrRequestFailureStatusCode(err error, statusCode int) bool { + var awsErr awserr.RequestFailure + if errors.As(err, &awsErr) { + return awsErr.StatusCode() == statusCode } return false } diff --git a/aws/awserr_test.go b/aws/awserr_test.go new file mode 100644 index 00000000000..4d0d6dfb076 --- /dev/null +++ b/aws/awserr_test.go @@ -0,0 +1,180 @@ +package aws + +import ( + "errors" + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/aws/awserr" +) + +func TestIsAwsErr(t *testing.T) { + testCases := []struct { + Name string + Err error + Code string + Message string + Expected bool + }{ + { + Name: "nil error", + Err: nil, + }, + { + Name: "nil error code", + Err: nil, + Code: "test", + }, + { + Name: "nil error message", + Err: nil, + Message: "test", + }, + { + Name: "nil error code and message", + Err: nil, + Code: "test", + Message: "test", + }, + { + Name: "other error", + Err: errors.New("test"), + }, + { + Name: "other error code", + Err: errors.New("test"), + Code: "test", + }, + { + Name: "other error message", + Err: errors.New("test"), + Message: "test", + }, + { + Name: "other error code and message", + Err: errors.New("test"), + Code: "test", + Message: "test", + }, + { + Name: "awserr error matching code and no message", + Err: awserr.New("TestCode", "TestMessage", nil), + Code: "TestCode", + Expected: true, + }, + { + Name: "awserr error matching code and matching message exact", + Err: awserr.New("TestCode", "TestMessage", nil), + Code: "TestCode", + Message: "TestMessage", + Expected: true, + }, + { + Name: "awserr error matching code and matching message contains", + Err: awserr.New("TestCode", "TestMessage", nil), + Code: "TestCode", + Message: "Message", + Expected: true, + }, + { + Name: "awserr error matching code and non-matching message", + Err: awserr.New("TestCode", "TestMessage", nil), + Code: "TestCode", + Message: "NotMatching", + }, + { + Name: "awserr error no code", + Err: awserr.New("TestCode", "TestMessage", nil), + }, + { + Name: "awserr error no code and matching message exact", + Err: awserr.New("TestCode", "TestMessage", nil), + Message: "TestMessage", + }, + { + Name: "awserr error non-matching code", + Err: awserr.New("TestCode", "TestMessage", nil), + Code: "NotMatching", + }, + { + Name: "awserr error non-matching code and message exact", + Err: awserr.New("TestCode", "TestMessage", nil), + Message: "TestMessage", + }, + { + Name: "wrapped other error", + Err: fmt.Errorf("test: %w", errors.New("test")), + }, + { + Name: "wrapped other error code", + Err: fmt.Errorf("test: %w", errors.New("test")), + Code: "test", + }, + { + Name: "wrapped other error message", + Err: fmt.Errorf("test: %w", errors.New("test")), + Message: "test", + }, + { + Name: "wrapped other error code and message", + Err: fmt.Errorf("test: %w", errors.New("test")), + Code: "test", + Message: "test", + }, + { + Name: "wrapped awserr error matching code and no message", + Err: fmt.Errorf("test: %w", awserr.New("TestCode", "TestMessage", nil)), + Code: "TestCode", + Expected: true, + }, + { + Name: "wrapped awserr error matching code and matching message exact", + Err: fmt.Errorf("test: %w", awserr.New("TestCode", "TestMessage", nil)), + Code: "TestCode", + Message: "TestMessage", + Expected: true, + }, + { + Name: "wrapped awserr error matching code and matching message contains", + Err: fmt.Errorf("test: %w", awserr.New("TestCode", "TestMessage", nil)), + Code: "TestCode", + Message: "Message", + Expected: true, + }, + { + Name: "wrapped awserr error matching code and non-matching message", + Err: fmt.Errorf("test: %w", awserr.New("TestCode", "TestMessage", nil)), + Code: "TestCode", + Message: "NotMatching", + }, + { + Name: "wrapped awserr error no code", + Err: fmt.Errorf("test: %w", awserr.New("TestCode", "TestMessage", nil)), + }, + { + Name: "wrapped awserr error no code and matching message exact", + Err: fmt.Errorf("test: %w", awserr.New("TestCode", "TestMessage", nil)), + Message: "TestMessage", + }, + { + Name: "wrapped awserr error non-matching code", + Err: fmt.Errorf("test: %w", awserr.New("TestCode", "TestMessage", nil)), + Code: "NotMatching", + }, + { + Name: "wrapped awserr error non-matching code and message exact", + Err: fmt.Errorf("test: %w", awserr.New("TestCode", "TestMessage", nil)), + Message: "TestMessage", + }, + } + + for _, testCase := range testCases { + t.Run(testCase.Name, func(t *testing.T) { + got := isAWSErr(testCase.Err, testCase.Code, testCase.Message) + + if got != testCase.Expected { + t.Errorf("got %t, expected %t", got, testCase.Expected) + } + }) + } +} diff --git a/aws/config.go b/aws/config.go index d3a18847b53..962a7658d4e 100644 --- a/aws/config.go +++ b/aws/config.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/accessanalyzer" "github.com/aws/aws-sdk-go/service/acm" "github.com/aws/aws-sdk-go/service/acmpca" "github.com/aws/aws-sdk-go/service/amplify" @@ -38,11 +39,13 @@ import ( "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/codestarnotifications" "github.com/aws/aws-sdk-go/service/cognitoidentity" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/aws/aws-sdk-go/service/configservice" "github.com/aws/aws-sdk-go/service/costandusagereportservice" "github.com/aws/aws-sdk-go/service/databasemigrationservice" + "github.com/aws/aws-sdk-go/service/dataexchange" "github.com/aws/aws-sdk-go/service/datapipeline" "github.com/aws/aws-sdk-go/service/datasync" "github.com/aws/aws-sdk-go/service/dax" @@ -72,8 +75,10 @@ import ( "github.com/aws/aws-sdk-go/service/glacier" "github.com/aws/aws-sdk-go/service/globalaccelerator" "github.com/aws/aws-sdk-go/service/glue" + "github.com/aws/aws-sdk-go/service/greengrass" "github.com/aws/aws-sdk-go/service/guardduty" "github.com/aws/aws-sdk-go/service/iam" + "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/aws/aws-sdk-go/service/inspector" "github.com/aws/aws-sdk-go/service/iot" "github.com/aws/aws-sdk-go/service/iotanalytics" @@ -91,6 +96,7 @@ import ( "github.com/aws/aws-sdk-go/service/lightsail" "github.com/aws/aws-sdk-go/service/macie" "github.com/aws/aws-sdk-go/service/managedblockchain" + "github.com/aws/aws-sdk-go/service/marketplacecatalog" "github.com/aws/aws-sdk-go/service/mediaconnect" "github.com/aws/aws-sdk-go/service/mediaconvert" "github.com/aws/aws-sdk-go/service/medialive" @@ -134,11 +140,14 @@ import ( "github.com/aws/aws-sdk-go/service/transfer" "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" + "github.com/aws/aws-sdk-go/service/wafv2" "github.com/aws/aws-sdk-go/service/worklink" + "github.com/aws/aws-sdk-go/service/workmail" "github.com/aws/aws-sdk-go/service/workspaces" "github.com/aws/aws-sdk-go/service/xray" awsbase "github.com/hashicorp/aws-sdk-go-base" "github.com/hashicorp/terraform-plugin-sdk/helper/logging" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) type Config struct { @@ -158,8 +167,10 @@ type Config struct { AllowedAccountIds []string ForbiddenAccountIds []string - Endpoints map[string]string - Insecure bool + Endpoints map[string]string + IgnoreTagPrefixes []string + IgnoreTags []string + Insecure bool SkipCredsValidation bool SkipGetEC2Platforms bool @@ -172,6 +183,7 @@ type Config struct { } type AWSClient struct { + accessanalyzerconn *accessanalyzer.AccessAnalyzer accountid string acmconn *acm.ACM acmpcaconn *acmpca.ACMPCA @@ -202,10 +214,12 @@ type AWSClient struct { codecommitconn *codecommit.CodeCommit codedeployconn *codedeploy.CodeDeploy codepipelineconn *codepipeline.CodePipeline + codestarnotificationsconn *codestarnotifications.CodeStarNotifications cognitoconn *cognitoidentity.CognitoIdentity cognitoidpconn *cognitoidentityprovider.CognitoIdentityProvider configconn *configservice.ConfigService costandusagereportconn *costandusagereportservice.CostandUsageReportService + dataexchangeconn *dataexchange.DataExchange datapipelineconn *datapipeline.DataPipeline datasyncconn *datasync.DataSync daxconn *dax.DAX @@ -238,7 +252,11 @@ type AWSClient struct { globalacceleratorconn *globalaccelerator.GlobalAccelerator glueconn *glue.Glue guarddutyconn *guardduty.GuardDuty + greengrassconn *greengrass.Greengrass iamconn *iam.IAM + ignoreTagPrefixes keyvaluetags.KeyValueTags + ignoreTags keyvaluetags.KeyValueTags + imagebuilderconn *imagebuilder.Imagebuilder inspectorconn *inspector.Inspector iotconn *iot.IoT iotanalyticsconn *iotanalytics.IoTAnalytics @@ -256,8 +274,10 @@ type AWSClient struct { lightsailconn *lightsail.Lightsail macieconn *macie.Macie managedblockchainconn *managedblockchain.ManagedBlockchain + marketplacecatalogconn *marketplacecatalog.MarketplaceCatalog mediaconnectconn *mediaconnect.MediaConnect mediaconvertconn *mediaconvert.MediaConvert + mediaconvertaccountconn *mediaconvert.MediaConvert medialiveconn *medialive.MediaLive mediapackageconn *mediapackage.MediaPackage mediastoreconn *mediastore.MediaStore @@ -304,7 +324,9 @@ type AWSClient struct { transferconn *transfer.Transfer wafconn *waf.WAF wafregionalconn *wafregional.WAFRegional + wafv2conn *wafv2.WAFV2 worklinkconn *worklink.WorkLink + workmailconn *workmail.WorkMail workspacesconn *workspaces.WorkSpaces xrayconn *xray.XRay } @@ -366,6 +388,7 @@ func (c *Config) Client() (interface{}, error) { } client := &AWSClient{ + accessanalyzerconn: accessanalyzer.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["accessanalyzer"])})), accountid: accountID, acmconn: acm.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["acm"])})), acmpcaconn: acmpca.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["acmpca"])})), @@ -396,10 +419,12 @@ func (c *Config) Client() (interface{}, error) { codecommitconn: codecommit.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["codecommit"])})), codedeployconn: codedeploy.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["codedeploy"])})), codepipelineconn: codepipeline.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["codepipeline"])})), + codestarnotificationsconn: codestarnotifications.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["codestarnotifications"])})), cognitoconn: cognitoidentity.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["cognitoidentity"])})), cognitoidpconn: cognitoidentityprovider.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["cognitoidp"])})), configconn: configservice.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["configservice"])})), costandusagereportconn: costandusagereportservice.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["cur"])})), + dataexchangeconn: dataexchange.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["dataexchange"])})), datapipelineconn: datapipeline.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["datapipeline"])})), datasyncconn: datasync.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["datasync"])})), daxconn: dax.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["dax"])})), @@ -431,7 +456,11 @@ func (c *Config) Client() (interface{}, error) { glacierconn: glacier.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["glacier"])})), glueconn: glue.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["glue"])})), guarddutyconn: guardduty.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["guardduty"])})), + greengrassconn: greengrass.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["greengrass"])})), iamconn: iam.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["iam"])})), + ignoreTagPrefixes: keyvaluetags.New(c.IgnoreTagPrefixes), + ignoreTags: keyvaluetags.New(c.IgnoreTags), + imagebuilderconn: imagebuilder.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["imagebuilder"])})), inspectorconn: inspector.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["inspector"])})), iotconn: iot.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["iot"])})), iotanalyticsconn: iotanalytics.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["iotanalytics"])})), @@ -449,6 +478,7 @@ func (c *Config) Client() (interface{}, error) { lightsailconn: lightsail.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["lightsail"])})), macieconn: macie.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["macie"])})), managedblockchainconn: managedblockchain.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["managedblockchain"])})), + marketplacecatalogconn: marketplacecatalog.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["marketplacecatalog"])})), mediaconnectconn: mediaconnect.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["mediaconnect"])})), mediaconvertconn: mediaconvert.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["mediaconvert"])})), medialiveconn: medialive.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["medialive"])})), @@ -492,7 +522,9 @@ func (c *Config) Client() (interface{}, error) { transferconn: transfer.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["transfer"])})), wafconn: waf.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["waf"])})), wafregionalconn: wafregional.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["wafregional"])})), + wafv2conn: wafv2.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["wafv2"])})), worklinkconn: worklink.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["worklink"])})), + workmailconn: workmail.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["workmail"])})), workspacesconn: workspaces.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["workspaces"])})), xrayconn: xray.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.Endpoints["xray"])})), } diff --git a/aws/data_source_aws_acmpca_certificate_authority.go b/aws/data_source_aws_acmpca_certificate_authority.go index 5747f5cb5c9..f9cf1659f81 100644 --- a/aws/data_source_aws_acmpca_certificate_authority.go +++ b/aws/data_source_aws_acmpca_certificate_authority.go @@ -3,10 +3,12 @@ package aws import ( "fmt" "log" + "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/acmpca" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsAcmpcaCertificateAuthority() *schema.Resource { @@ -112,8 +114,8 @@ func dataSourceAwsAcmpcaCertificateAuthorityRead(d *schema.ResourceData, meta in certificateAuthority := describeCertificateAuthorityOutput.CertificateAuthority d.Set("arn", certificateAuthority.Arn) - d.Set("not_after", certificateAuthority.NotAfter) - d.Set("not_before", certificateAuthority.NotBefore) + d.Set("not_after", aws.TimeValue(certificateAuthority.NotAfter).Format(time.RFC3339)) + d.Set("not_before", aws.TimeValue(certificateAuthority.NotBefore).Format(time.RFC3339)) if err := d.Set("revocation_configuration", flattenAcmpcaRevocationConfiguration(certificateAuthority.RevocationConfiguration)); err != nil { return fmt.Errorf("error setting tags: %s", err) @@ -161,12 +163,13 @@ func dataSourceAwsAcmpcaCertificateAuthorityRead(d *schema.ResourceData, meta in d.Set("certificate_signing_request", getCertificateAuthorityCsrOutput.Csr) } - tags, err := listAcmpcaTags(conn, certificateAuthorityArn) + tags, err := keyvaluetags.AcmpcaListTags(conn, certificateAuthorityArn) + if err != nil { - return fmt.Errorf("error reading ACMPCA Certificate Authority %q tags: %s", certificateAuthorityArn, err) + return fmt.Errorf("error listing tags for ACMPCA Certificate Authority (%s): %s", certificateAuthorityArn, err) } - if err := d.Set("tags", tagsToMapACMPCA(tags)); err != nil { + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } diff --git a/aws/data_source_aws_ami.go b/aws/data_source_aws_ami.go index 716ea6e4a00..5cfd3c464e6 100644 --- a/aws/data_source_aws_ami.go +++ b/aws/data_source_aws_ami.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsAmi() *schema.Resource { @@ -290,8 +291,8 @@ func amiDescriptionAttributes(d *schema.ResourceData, image *ec2.Image) error { if err := d.Set("state_reason", amiStateReason(image.StateReason)); err != nil { return err } - if err := d.Set("tags", tagsToMap(image.Tags)); err != nil { - return err + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(image.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil } diff --git a/aws/data_source_aws_ami_test.go b/aws/data_source_aws_ami_test.go index bfc0c7a0113..a5d06a3b78b 100644 --- a/aws/data_source_aws_ami_test.go +++ b/aws/data_source_aws_ami_test.go @@ -10,6 +10,7 @@ import ( ) func TestAccAWSAmiDataSource_natInstance(t *testing.T) { + resourceName := "data.aws_ami.nat_ami" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -17,7 +18,7 @@ func TestAccAWSAmiDataSource_natInstance(t *testing.T) { { Config: testAccCheckAwsAmiDataSourceConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAwsAmiDataSourceID("data.aws_ami.nat_ami"), + testAccCheckAwsAmiDataSourceID(resourceName), // Check attributes. Some attributes are tough to test - any not contained here should not be considered // stable and should not be used in interpolation. Exception to block_device_mappings which should both // show up consistently and break if certain references are not available. However modification of the @@ -25,35 +26,36 @@ func TestAccAWSAmiDataSource_natInstance(t *testing.T) { // deep inspection is not included, simply the count is checked. // Tags and product codes may need more testing, but I'm having a hard time finding images with // these attributes set. - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "architecture", "x86_64"), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "block_device_mappings.#", "1"), - resource.TestMatchResourceAttr("data.aws_ami.nat_ami", "creation_date", regexp.MustCompile("^20[0-9]{2}-")), - resource.TestMatchResourceAttr("data.aws_ami.nat_ami", "description", regexp.MustCompile("^Amazon Linux AMI")), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "hypervisor", "xen"), - resource.TestMatchResourceAttr("data.aws_ami.nat_ami", "image_id", regexp.MustCompile("^ami-")), - resource.TestMatchResourceAttr("data.aws_ami.nat_ami", "image_location", regexp.MustCompile("^amazon/")), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "image_owner_alias", "amazon"), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "image_type", "machine"), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "most_recent", "true"), - resource.TestMatchResourceAttr("data.aws_ami.nat_ami", "name", regexp.MustCompile("^amzn-ami-vpc-nat")), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "owner_id", "137112412989"), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "public", "true"), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "product_codes.#", "0"), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "root_device_name", "/dev/xvda"), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "root_device_type", "ebs"), - resource.TestMatchResourceAttr("data.aws_ami.nat_ami", "root_snapshot_id", regexp.MustCompile("^snap-")), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "sriov_net_support", "simple"), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "state", "available"), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "state_reason.code", "UNSET"), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "state_reason.message", "UNSET"), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "tags.%", "0"), - resource.TestCheckResourceAttr("data.aws_ami.nat_ami", "virtualization_type", "hvm"), + resource.TestCheckResourceAttr(resourceName, "architecture", "x86_64"), + resource.TestCheckResourceAttr(resourceName, "block_device_mappings.#", "1"), + resource.TestMatchResourceAttr(resourceName, "creation_date", regexp.MustCompile("^20[0-9]{2}-")), + resource.TestMatchResourceAttr(resourceName, "description", regexp.MustCompile("^Amazon Linux AMI")), + resource.TestCheckResourceAttr(resourceName, "hypervisor", "xen"), + resource.TestMatchResourceAttr(resourceName, "image_id", regexp.MustCompile("^ami-")), + resource.TestMatchResourceAttr(resourceName, "image_location", regexp.MustCompile("^amazon/")), + resource.TestCheckResourceAttr(resourceName, "image_owner_alias", "amazon"), + resource.TestCheckResourceAttr(resourceName, "image_type", "machine"), + resource.TestCheckResourceAttr(resourceName, "most_recent", "true"), + resource.TestMatchResourceAttr(resourceName, "name", regexp.MustCompile("^amzn-ami-vpc-nat")), + resource.TestCheckResourceAttr(resourceName, "owner_id", "137112412989"), + resource.TestCheckResourceAttr(resourceName, "public", "true"), + resource.TestCheckResourceAttr(resourceName, "product_codes.#", "0"), + resource.TestCheckResourceAttr(resourceName, "root_device_name", "/dev/xvda"), + resource.TestCheckResourceAttr(resourceName, "root_device_type", "ebs"), + resource.TestMatchResourceAttr(resourceName, "root_snapshot_id", regexp.MustCompile("^snap-")), + resource.TestCheckResourceAttr(resourceName, "sriov_net_support", "simple"), + resource.TestCheckResourceAttr(resourceName, "state", "available"), + resource.TestCheckResourceAttr(resourceName, "state_reason.code", "UNSET"), + resource.TestCheckResourceAttr(resourceName, "state_reason.message", "UNSET"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "virtualization_type", "hvm"), ), }, }, }) } func TestAccAWSAmiDataSource_windowsInstance(t *testing.T) { + resourceName := "data.aws_ami.windows_ami" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -61,31 +63,31 @@ func TestAccAWSAmiDataSource_windowsInstance(t *testing.T) { { Config: testAccCheckAwsAmiDataSourceWindowsConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAwsAmiDataSourceID("data.aws_ami.windows_ami"), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "architecture", "x86_64"), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "block_device_mappings.#", "27"), - resource.TestMatchResourceAttr("data.aws_ami.windows_ami", "creation_date", regexp.MustCompile("^20[0-9]{2}-")), - resource.TestMatchResourceAttr("data.aws_ami.windows_ami", "description", regexp.MustCompile("^Microsoft Windows Server")), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "hypervisor", "xen"), - resource.TestMatchResourceAttr("data.aws_ami.windows_ami", "image_id", regexp.MustCompile("^ami-")), - resource.TestMatchResourceAttr("data.aws_ami.windows_ami", "image_location", regexp.MustCompile("^amazon/")), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "image_owner_alias", "amazon"), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "image_type", "machine"), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "most_recent", "true"), - resource.TestMatchResourceAttr("data.aws_ami.windows_ami", "name", regexp.MustCompile("^Windows_Server-2012-R2")), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "owner_id", "801119661308"), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "platform", "windows"), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "public", "true"), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "product_codes.#", "0"), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "root_device_name", "/dev/sda1"), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "root_device_type", "ebs"), - resource.TestMatchResourceAttr("data.aws_ami.windows_ami", "root_snapshot_id", regexp.MustCompile("^snap-")), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "sriov_net_support", "simple"), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "state", "available"), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "state_reason.code", "UNSET"), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "state_reason.message", "UNSET"), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "tags.%", "0"), - resource.TestCheckResourceAttr("data.aws_ami.windows_ami", "virtualization_type", "hvm"), + testAccCheckAwsAmiDataSourceID(resourceName), + resource.TestCheckResourceAttr(resourceName, "architecture", "x86_64"), + resource.TestCheckResourceAttr(resourceName, "block_device_mappings.#", "27"), + resource.TestMatchResourceAttr(resourceName, "creation_date", regexp.MustCompile("^20[0-9]{2}-")), + resource.TestMatchResourceAttr(resourceName, "description", regexp.MustCompile("^Microsoft Windows Server")), + resource.TestCheckResourceAttr(resourceName, "hypervisor", "xen"), + resource.TestMatchResourceAttr(resourceName, "image_id", regexp.MustCompile("^ami-")), + resource.TestMatchResourceAttr(resourceName, "image_location", regexp.MustCompile("^amazon/")), + resource.TestCheckResourceAttr(resourceName, "image_owner_alias", "amazon"), + resource.TestCheckResourceAttr(resourceName, "image_type", "machine"), + resource.TestCheckResourceAttr(resourceName, "most_recent", "true"), + resource.TestMatchResourceAttr(resourceName, "name", regexp.MustCompile("^Windows_Server-2012-R2")), + resource.TestCheckResourceAttr(resourceName, "owner_id", "801119661308"), + resource.TestCheckResourceAttr(resourceName, "platform", "windows"), + resource.TestCheckResourceAttr(resourceName, "public", "true"), + resource.TestCheckResourceAttr(resourceName, "product_codes.#", "0"), + resource.TestCheckResourceAttr(resourceName, "root_device_name", "/dev/sda1"), + resource.TestCheckResourceAttr(resourceName, "root_device_type", "ebs"), + resource.TestMatchResourceAttr(resourceName, "root_snapshot_id", regexp.MustCompile("^snap-")), + resource.TestCheckResourceAttr(resourceName, "sriov_net_support", "simple"), + resource.TestCheckResourceAttr(resourceName, "state", "available"), + resource.TestCheckResourceAttr(resourceName, "state_reason.code", "UNSET"), + resource.TestCheckResourceAttr(resourceName, "state_reason.message", "UNSET"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "virtualization_type", "hvm"), ), }, }, @@ -93,6 +95,7 @@ func TestAccAWSAmiDataSource_windowsInstance(t *testing.T) { } func TestAccAWSAmiDataSource_instanceStore(t *testing.T) { + resourceName := "data.aws_ami.instance_store_ami" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -100,27 +103,27 @@ func TestAccAWSAmiDataSource_instanceStore(t *testing.T) { { Config: testAccCheckAwsAmiDataSourceInstanceStoreConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAwsAmiDataSourceID("data.aws_ami.instance_store_ami"), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "architecture", "x86_64"), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "block_device_mappings.#", "0"), - resource.TestMatchResourceAttr("data.aws_ami.instance_store_ami", "creation_date", regexp.MustCompile("^20[0-9]{2}-")), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "hypervisor", "xen"), - resource.TestMatchResourceAttr("data.aws_ami.instance_store_ami", "image_id", regexp.MustCompile("^ami-")), - resource.TestMatchResourceAttr("data.aws_ami.instance_store_ami", "image_location", regexp.MustCompile("ubuntu-trusty-14.04-amd64-server")), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "image_type", "machine"), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "most_recent", "true"), - resource.TestMatchResourceAttr("data.aws_ami.instance_store_ami", "name", regexp.MustCompile("^ubuntu/images/hvm-instance/ubuntu-trusty-14.04-amd64-server")), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "owner_id", "099720109477"), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "public", "true"), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "product_codes.#", "0"), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "root_device_type", "instance-store"), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "root_snapshot_id", ""), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "sriov_net_support", "simple"), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "state", "available"), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "state_reason.code", "UNSET"), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "state_reason.message", "UNSET"), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "tags.%", "0"), - resource.TestCheckResourceAttr("data.aws_ami.instance_store_ami", "virtualization_type", "hvm"), + testAccCheckAwsAmiDataSourceID(resourceName), + resource.TestCheckResourceAttr(resourceName, "architecture", "x86_64"), + resource.TestCheckResourceAttr(resourceName, "block_device_mappings.#", "0"), + resource.TestMatchResourceAttr(resourceName, "creation_date", regexp.MustCompile("^20[0-9]{2}-")), + resource.TestCheckResourceAttr(resourceName, "hypervisor", "xen"), + resource.TestMatchResourceAttr(resourceName, "image_id", regexp.MustCompile("^ami-")), + resource.TestMatchResourceAttr(resourceName, "image_location", regexp.MustCompile("ubuntu-trusty-14.04-amd64-server")), + resource.TestCheckResourceAttr(resourceName, "image_type", "machine"), + resource.TestCheckResourceAttr(resourceName, "most_recent", "true"), + resource.TestMatchResourceAttr(resourceName, "name", regexp.MustCompile("^ubuntu/images/hvm-instance/ubuntu-trusty-14.04-amd64-server")), + resource.TestCheckResourceAttr(resourceName, "owner_id", "099720109477"), + resource.TestCheckResourceAttr(resourceName, "public", "true"), + resource.TestCheckResourceAttr(resourceName, "product_codes.#", "0"), + resource.TestCheckResourceAttr(resourceName, "root_device_type", "instance-store"), + resource.TestCheckResourceAttr(resourceName, "root_snapshot_id", ""), + resource.TestCheckResourceAttr(resourceName, "sriov_net_support", "simple"), + resource.TestCheckResourceAttr(resourceName, "state", "available"), + resource.TestCheckResourceAttr(resourceName, "state_reason.code", "UNSET"), + resource.TestCheckResourceAttr(resourceName, "state_reason.message", "UNSET"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "virtualization_type", "hvm"), ), }, }, diff --git a/aws/data_source_aws_api_gateway_api_key.go b/aws/data_source_aws_api_gateway_api_key.go index 050a4c9d785..3349a680485 100644 --- a/aws/data_source_aws_api_gateway_api_key.go +++ b/aws/data_source_aws_api_gateway_api_key.go @@ -1,9 +1,13 @@ package aws import ( + "fmt" + "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsApiGatewayApiKey() *schema.Resource { @@ -18,11 +22,28 @@ func dataSourceAwsApiGatewayApiKey() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "description": { + Type: schema.TypeString, + Computed: true, + }, + "created_date": { + Type: schema.TypeString, + Computed: true, + }, + "last_updated_date": { + Type: schema.TypeString, + Computed: true, + }, + "enabled": { + Type: schema.TypeBool, + Computed: true, + }, "value": { Type: schema.TypeString, Computed: true, Sensitive: true, }, + "tags": tagsSchemaComputed(), }, } } @@ -41,5 +62,13 @@ func dataSourceAwsApiGatewayApiKeyRead(d *schema.ResourceData, meta interface{}) d.SetId(aws.StringValue(apiKey.Id)) d.Set("name", apiKey.Name) d.Set("value", apiKey.Value) + d.Set("created_date", aws.TimeValue(apiKey.CreatedDate).Format(time.RFC3339)) + d.Set("description", apiKey.Description) + d.Set("enabled", apiKey.Enabled) + d.Set("last_updated_date", aws.TimeValue(apiKey.LastUpdatedDate).Format(time.RFC3339)) + + if err := d.Set("tags", keyvaluetags.ApigatewayKeyValueTags(apiKey.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } diff --git a/aws/data_source_aws_api_gateway_api_key_test.go b/aws/data_source_aws_api_gateway_api_key_test.go index 881d8cc5dd0..4f10d332f48 100644 --- a/aws/data_source_aws_api_gateway_api_key_test.go +++ b/aws/data_source_aws_api_gateway_api_key_test.go @@ -23,6 +23,11 @@ func TestAccDataSourceAwsApiGatewayApiKey(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName1, "id", dataSourceName1, "id"), resource.TestCheckResourceAttrPair(resourceName1, "name", dataSourceName1, "name"), resource.TestCheckResourceAttrPair(resourceName1, "value", dataSourceName1, "value"), + resource.TestCheckResourceAttrPair(resourceName1, "enabled", dataSourceName1, "enabled"), + resource.TestCheckResourceAttrPair(resourceName1, "description", dataSourceName1, "description"), + resource.TestCheckResourceAttrSet(dataSourceName1, "last_updated_date"), + resource.TestCheckResourceAttrSet(dataSourceName1, "created_date"), + resource.TestCheckResourceAttr(dataSourceName1, "tags.%", "0"), ), }, }, diff --git a/aws/data_source_aws_api_gateway_rest_api.go b/aws/data_source_aws_api_gateway_rest_api.go index 62651e5e4b1..6b67fed7587 100644 --- a/aws/data_source_aws_api_gateway_rest_api.go +++ b/aws/data_source_aws_api_gateway_rest_api.go @@ -5,8 +5,10 @@ import ( "log" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsApiGatewayRestApi() *schema.Resource { @@ -21,6 +23,54 @@ func dataSourceAwsApiGatewayRestApi() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "description": { + Type: schema.TypeString, + Computed: true, + }, + "policy": { + Type: schema.TypeString, + Computed: true, + }, + "api_key_source": { + Type: schema.TypeString, + Computed: true, + }, + "minimum_compression_size": { + Type: schema.TypeInt, + Computed: true, + }, + "binary_media_types": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "endpoint_configuration": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "types": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "vpc_endpoint_ids": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + }, + }, + "execution_arn": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tagsSchemaComputed(), }, } } @@ -55,19 +105,54 @@ func dataSourceAwsApiGatewayRestApiRead(d *schema.ResourceData, meta interface{} d.SetId(*match.Id) - resp, err := conn.GetResources(&apigateway.GetResourcesInput{ + restApiArn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "apigateway", + Region: meta.(*AWSClient).region, + Resource: fmt.Sprintf("/restapis/%s", d.Id()), + }.String() + d.Set("arn", restApiArn) + d.Set("description", match.Description) + d.Set("policy", match.Policy) + d.Set("api_key_source", match.ApiKeySource) + d.Set("binary_media_types", match.BinaryMediaTypes) + + if match.MinimumCompressionSize == nil { + d.Set("minimum_compression_size", -1) + } else { + d.Set("minimum_compression_size", match.MinimumCompressionSize) + } + + if err := d.Set("endpoint_configuration", flattenApiGatewayEndpointConfiguration(match.EndpointConfiguration)); err != nil { + return fmt.Errorf("error setting endpoint_configuration: %s", err) + } + + if err := d.Set("tags", keyvaluetags.ApigatewayKeyValueTags(match.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + executionArn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "execute-api", + Region: meta.(*AWSClient).region, + AccountID: meta.(*AWSClient).accountid, + Resource: d.Id(), + }.String() + d.Set("execution_arn", executionArn) + + resourceParams := &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 + err = conn.GetResourcesPages(resourceParams, func(page *apigateway.GetResourcesOutput, lastPage bool) bool { + for _, item := range page.Items { + if *item.Path == "/" { + d.Set("root_resource_id", item.Id) + return false + } } - } + return !lastPage + }) - return nil + return err } diff --git a/aws/data_source_aws_api_gateway_rest_api_test.go b/aws/data_source_aws_api_gateway_rest_api_test.go index 84c91084de7..a35ba5f2951 100644 --- a/aws/data_source_aws_api_gateway_rest_api_test.go +++ b/aws/data_source_aws_api_gateway_rest_api_test.go @@ -6,11 +6,12 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" ) func TestAccDataSourceAwsApiGatewayRestApi(t *testing.T) { rName := acctest.RandString(8) + dataSourceName := "data.aws_api_gateway_rest_api.test" + resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -18,63 +19,31 @@ func TestAccDataSourceAwsApiGatewayRestApi(t *testing.T) { { Config: testAccDataSourceAwsApiGatewayRestApiConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccDataSourceAwsApiGatewayRestApiCheck("data.aws_api_gateway_rest_api.by_name"), + resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"), + resource.TestCheckResourceAttrPair(dataSourceName, "arn", resourceName, "arn"), + resource.TestCheckResourceAttrPair(dataSourceName, "root_resource_id", resourceName, "root_resource_id"), + resource.TestCheckResourceAttrPair(dataSourceName, "tags", resourceName, "tags"), + resource.TestCheckResourceAttrPair(dataSourceName, "description", resourceName, "description"), + resource.TestCheckResourceAttrPair(dataSourceName, "policy", resourceName, "policy"), + resource.TestCheckResourceAttrPair(dataSourceName, "api_key_source", resourceName, "api_key_source"), + resource.TestCheckResourceAttrPair(dataSourceName, "minimum_compression_size", resourceName, "minimum_compression_size"), + resource.TestCheckResourceAttrPair(dataSourceName, "binary_media_types", resourceName, "binary_media_types"), + resource.TestCheckResourceAttrPair(dataSourceName, "endpoint_configuration", resourceName, "endpoint_configuration"), + resource.TestCheckResourceAttrPair(dataSourceName, "execution_arn", resourceName, "execution_arn"), ), }, }, }) } -func testAccDataSourceAwsApiGatewayRestApiCheck(name string) resource.TestCheckFunc { - return func(s *terraform.State) error { - resources, ok := s.RootModule().Resources[name] - if !ok { - return fmt.Errorf("root module has no resource called %s", name) - } - - apiGatewayRestApiResources, ok := s.RootModule().Resources["aws_api_gateway_rest_api.tf_test"] - if !ok { - return fmt.Errorf("can't find aws_api_gateway_rest_api.tf_test in state") - } - - attr := resources.Primary.Attributes - - if attr["name"] != apiGatewayRestApiResources.Primary.Attributes["name"] { - return fmt.Errorf( - "name is %s; want %s", - attr["name"], - apiGatewayRestApiResources.Primary.Attributes["name"], - ) - } - - if attr["root_resource_id"] != apiGatewayRestApiResources.Primary.Attributes["root_resource_id"] { - return fmt.Errorf( - "root_resource_id is %s; want %s", - attr["root_resource_id"], - apiGatewayRestApiResources.Primary.Attributes["root_resource_id"], - ) - } - - return nil - } -} - func testAccDataSourceAwsApiGatewayRestApiConfig(r string) string { return fmt.Sprintf(` -resource "aws_api_gateway_rest_api" "tf_wrong1" { - name = "%s_wrong1" -} - -resource "aws_api_gateway_rest_api" "tf_test" { - name = "%s_correct" -} - -resource "aws_api_gateway_rest_api" "tf_wrong2" { - name = "%s_wrong1" +resource "aws_api_gateway_rest_api" "test" { + name = "%[1]s" } -data "aws_api_gateway_rest_api" "by_name" { - name = "${aws_api_gateway_rest_api.tf_test.name}" +data "aws_api_gateway_rest_api" "test" { + name = "${aws_api_gateway_rest_api.test.name}" } -`, r, r, r) +`, r) } diff --git a/aws/data_source_aws_api_gateway_vpc_link.go b/aws/data_source_aws_api_gateway_vpc_link.go index c24aebe32d1..34b248341c8 100644 --- a/aws/data_source_aws_api_gateway_vpc_link.go +++ b/aws/data_source_aws_api_gateway_vpc_link.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsApiGatewayVpcLink() *schema.Resource { @@ -23,6 +24,24 @@ func dataSourceAwsApiGatewayVpcLink() *schema.Resource { Type: schema.TypeString, Required: true, }, + "description": { + Type: schema.TypeString, + Computed: true, + }, + "status": { + Type: schema.TypeString, + Computed: true, + }, + "status_message": { + Type: schema.TypeString, + Computed: true, + }, + "target_arns": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "tags": tagsSchemaComputed(), }, } } @@ -57,6 +76,14 @@ func dataSourceAwsApiGatewayVpcLinkRead(d *schema.ResourceData, meta interface{} d.SetId(*match.Id) d.Set("name", match.Name) + d.Set("status", match.Status) + d.Set("status_message", match.StatusMessage) + d.Set("description", match.Description) + d.Set("target_arns", flattenStringList(match.TargetArns)) + + if err := d.Set("tags", keyvaluetags.ApigatewayKeyValueTags(match.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } diff --git a/aws/data_source_aws_api_gateway_vpc_link_test.go b/aws/data_source_aws_api_gateway_vpc_link_test.go index a84cc42375e..c0f7e4f1b5d 100644 --- a/aws/data_source_aws_api_gateway_vpc_link_test.go +++ b/aws/data_source_aws_api_gateway_vpc_link_test.go @@ -10,6 +10,8 @@ import ( func TestAccDataSourceAwsApiGatewayVpcLink(t *testing.T) { rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(8)) + resourceName := "aws_api_gateway_vpc_link.vpc_link" + dataSourceName := "data.aws_api_gateway_vpc_link.vpc_link" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -17,8 +19,13 @@ func TestAccDataSourceAwsApiGatewayVpcLink(t *testing.T) { { Config: testAccDataSourceAwsApiGatewayVpcLinkConfig(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrPair("data.aws_api_gateway_vpc_link.vpc_link", "name", "aws_api_gateway_vpc_link.vpc_link", "name"), - resource.TestCheckResourceAttrPair("data.aws_api_gateway_vpc_link.vpc_link", "id", "aws_api_gateway_vpc_link.vpc_link", "id"), + resource.TestCheckResourceAttrPair(dataSourceName, "name", resourceName, "name"), + resource.TestCheckResourceAttrPair(dataSourceName, "id", resourceName, "id"), + resource.TestCheckResourceAttrPair(dataSourceName, "description", resourceName, "description"), + resource.TestCheckResourceAttrSet(dataSourceName, "status_message"), + resource.TestCheckResourceAttrSet(dataSourceName, "status"), + resource.TestCheckResourceAttr(dataSourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(dataSourceName, "target_arns.#", "1"), ), }, }, diff --git a/aws/data_source_aws_cloudformation_export_test.go b/aws/data_source_aws_cloudformation_export_test.go index 9f3ae83b57c..a3b93eb8c8c 100644 --- a/aws/data_source_aws_cloudformation_export_test.go +++ b/aws/data_source_aws_cloudformation_export_test.go @@ -2,7 +2,6 @@ package aws import ( "fmt" - "regexp" "testing" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" @@ -11,31 +10,48 @@ import ( func TestAccAWSCloudformationExportDataSource_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") + dataSourceName := "data.aws_cloudformation_export.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckAwsCloudformationExportConfig(rName), + Config: testAccCheckAwsCloudformationExportConfigStaticValue(rName), PreventPostDestroyRefresh: true, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_cloudformation_export.waiter", "value", "waiter"), - resource.TestMatchResourceAttr("data.aws_cloudformation_export.vpc", "value", - regexp.MustCompile("^vpc-[a-z0-9]{8,}$")), - resource.TestMatchResourceAttr("data.aws_cloudformation_export.vpc", "exporting_stack_id", - regexp.MustCompile("^arn:aws:cloudformation")), + resource.TestCheckResourceAttr(dataSourceName, "value", "waiter"), ), }, }, }) } -func testAccCheckAwsCloudformationExportConfig(rName string) string { +func TestAccAWSCloudformationExportDataSource_ResourceReference(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + dataSourceName := "data.aws_cloudformation_export.test" + resourceName := "aws_cloudformation_stack.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCheckAwsCloudformationExportConfigResourceReference(rName), + PreventPostDestroyRefresh: true, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(dataSourceName, "exporting_stack_id", resourceName, "id"), + resource.TestCheckResourceAttrPair(dataSourceName, "value", resourceName, "outputs.MyVpcId"), + ), + }, + }, + }) +} + +func testAccCheckAwsCloudformationExportConfigStaticValue(rName string) string { return fmt.Sprintf(` -resource "aws_cloudformation_stack" "cfs" { - name = "%s1" - timeout_in_minutes = 6 +resource "aws_cloudformation_stack" "test" { + name = %[1]q template_body = < 0 { diff --git a/aws/data_source_aws_cloudformation_stack_test.go b/aws/data_source_aws_cloudformation_stack_test.go index 9f7c24c3d2d..5a038d5a338 100644 --- a/aws/data_source_aws_cloudformation_stack_test.go +++ b/aws/data_source_aws_cloudformation_stack_test.go @@ -10,8 +10,8 @@ import ( ) func TestAccAWSCloudFormationStack_dataSource_basic(t *testing.T) { - rString := acctest.RandString(8) - stackName := fmt.Sprintf("tf-acc-ds-basic-%s", rString) + stackName := acctest.RandomWithPrefix("tf-acc-ds-basic") + resourceName := "data.aws_cloudformation_stack.network" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -20,18 +20,17 @@ func TestAccAWSCloudFormationStack_dataSource_basic(t *testing.T) { { Config: testAccCheckAwsCloudFormationStackDataSourceConfig_basic(stackName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "outputs.%", "1"), - resource.TestMatchResourceAttr("data.aws_cloudformation_stack.network", "outputs.VPCId", - regexp.MustCompile("^vpc-[a-z0-9]+")), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "capabilities.#", "0"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "disable_rollback", "false"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "notification_arns.#", "0"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "parameters.%", "1"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "parameters.CIDR", "10.10.10.0/24"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "timeout_in_minutes", "6"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "tags.%", "2"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "tags.Name", "Form the Cloud"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.network", "tags.Second", "meh"), + resource.TestCheckResourceAttr(resourceName, "outputs.%", "1"), + resource.TestMatchResourceAttr(resourceName, "outputs.VPCId", regexp.MustCompile("^vpc-[a-z0-9]+")), + resource.TestCheckResourceAttr(resourceName, "capabilities.#", "0"), + resource.TestCheckResourceAttr(resourceName, "disable_rollback", "false"), + resource.TestCheckResourceAttr(resourceName, "notification_arns.#", "0"), + resource.TestCheckResourceAttr(resourceName, "parameters.%", "1"), + resource.TestCheckResourceAttr(resourceName, "parameters.CIDR", "10.10.10.0/24"), + resource.TestCheckResourceAttr(resourceName, "timeout_in_minutes", "6"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", "Form the Cloud"), + resource.TestCheckResourceAttr(resourceName, "tags.Second", "meh"), ), }, }, @@ -89,8 +88,8 @@ data "aws_cloudformation_stack" "network" { } func TestAccAWSCloudFormationStack_dataSource_yaml(t *testing.T) { - rString := acctest.RandString(8) - stackName := fmt.Sprintf("tf-acc-ds-yaml-%s", rString) + stackName := acctest.RandomWithPrefix("tf-acc-ds-yaml") + resourceName := "data.aws_cloudformation_stack.yaml" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -99,18 +98,17 @@ func TestAccAWSCloudFormationStack_dataSource_yaml(t *testing.T) { { Config: testAccCheckAwsCloudFormationStackDataSourceConfig_yaml(stackName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "outputs.%", "1"), - resource.TestMatchResourceAttr("data.aws_cloudformation_stack.yaml", "outputs.VPCId", - regexp.MustCompile("^vpc-[a-z0-9]+")), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "capabilities.#", "0"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "disable_rollback", "false"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "notification_arns.#", "0"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "parameters.%", "1"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "parameters.CIDR", "10.10.10.0/24"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "timeout_in_minutes", "6"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "tags.%", "2"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "tags.Name", "Form the Cloud"), - resource.TestCheckResourceAttr("data.aws_cloudformation_stack.yaml", "tags.Second", "meh"), + resource.TestCheckResourceAttr(resourceName, "outputs.%", "1"), + resource.TestMatchResourceAttr(resourceName, "outputs.VPCId", regexp.MustCompile("^vpc-[a-z0-9]+")), + resource.TestCheckResourceAttr(resourceName, "capabilities.#", "0"), + resource.TestCheckResourceAttr(resourceName, "disable_rollback", "false"), + resource.TestCheckResourceAttr(resourceName, "notification_arns.#", "0"), + resource.TestCheckResourceAttr(resourceName, "parameters.%", "1"), + resource.TestCheckResourceAttr(resourceName, "parameters.CIDR", "10.10.10.0/24"), + resource.TestCheckResourceAttr(resourceName, "timeout_in_minutes", "6"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", "Form the Cloud"), + resource.TestCheckResourceAttr(resourceName, "tags.Second", "meh"), ), }, }, diff --git a/aws/data_source_aws_cloudwatch_log_group.go b/aws/data_source_aws_cloudwatch_log_group.go index 7482c4dfd46..0a317ea5ef5 100644 --- a/aws/data_source_aws_cloudwatch_log_group.go +++ b/aws/data_source_aws_cloudwatch_log_group.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsCloudwatchLogGroup() *schema.Resource { @@ -23,6 +24,15 @@ func dataSourceAwsCloudwatchLogGroup() *schema.Resource { Type: schema.TypeInt, Computed: true, }, + "retention_in_days": { + Type: schema.TypeInt, + Computed: true, + }, + "kms_key_id": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tagsSchemaComputed(), }, } } @@ -42,6 +52,18 @@ func dataSourceAwsCloudwatchLogGroupRead(d *schema.ResourceData, meta interface{ d.SetId(name) d.Set("arn", logGroup.Arn) d.Set("creation_time", logGroup.CreationTime) + d.Set("retention_in_days", logGroup.RetentionInDays) + d.Set("kms_key_id", logGroup.KmsKeyId) + + tags, err := keyvaluetags.CloudwatchlogsListTags(conn, name) + + if err != nil { + return fmt.Errorf("error listing tags for CloudWatch Logs Group (%s): %s", name, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } diff --git a/aws/data_source_aws_cloudwatch_log_group_test.go b/aws/data_source_aws_cloudwatch_log_group_test.go index e3793da0145..272024f158b 100644 --- a/aws/data_source_aws_cloudwatch_log_group_test.go +++ b/aws/data_source_aws_cloudwatch_log_group_test.go @@ -8,8 +8,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccAWSCloudwatchLogGroupDataSource(t *testing.T) { +func TestAccAWSCloudwatchLogGroupDataSource_basic(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "data.aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -18,9 +19,78 @@ func TestAccAWSCloudwatchLogGroupDataSource(t *testing.T) { { Config: testAccCheckAWSCloudwatchLogGroupDataSourceConfig(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_cloudwatch_log_group.test", "name", rName), - resource.TestCheckResourceAttrSet("data.aws_cloudwatch_log_group.test", "arn"), - resource.TestCheckResourceAttrSet("data.aws_cloudwatch_log_group.test", "creation_time"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "arn"), + resource.TestCheckResourceAttrSet(resourceName, "creation_time"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + }, + }) +} + +func TestAccAWSCloudwatchLogGroupDataSource_tags(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "data.aws_cloudwatch_log_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCheckAWSCloudwatchLogGroupDataSourceConfigTags(rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "arn"), + resource.TestCheckResourceAttrSet(resourceName, "creation_time"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.Environment", "Production"), + resource.TestCheckResourceAttr(resourceName, "tags.Foo", "Bar"), + resource.TestCheckResourceAttr(resourceName, "tags.Empty", ""), + ), + }, + }, + }) +} + +func TestAccAWSCloudwatchLogGroupDataSource_kms(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "data.aws_cloudwatch_log_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCheckAWSCloudwatchLogGroupDataSourceConfigKMS(rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "arn"), + resource.TestCheckResourceAttrSet(resourceName, "creation_time"), + resource.TestCheckResourceAttrSet(resourceName, "kms_key_id"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + }, + }) +} + +func TestAccAWSCloudwatchLogGroupDataSource_retention(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "data.aws_cloudwatch_log_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCheckAWSCloudwatchLogGroupDataSourceConfigRetention(rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "arn"), + resource.TestCheckResourceAttrSet(resourceName, "creation_time"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "retention_in_days", "365"), ), }, }, @@ -38,3 +108,70 @@ data aws_cloudwatch_log_group "test" { } `, rName) } + +func testAccCheckAWSCloudwatchLogGroupDataSourceConfigTags(rName string) string { + return fmt.Sprintf(` +resource aws_cloudwatch_log_group "test" { + name = "%s" + + tags = { + Environment = "Production" + Foo = "Bar" + Empty = "" + } +} + +data aws_cloudwatch_log_group "test" { + name = "${aws_cloudwatch_log_group.test.name}" +} +`, rName) +} + +func testAccCheckAWSCloudwatchLogGroupDataSourceConfigKMS(rName string) string { + return fmt.Sprintf(` +resource "aws_kms_key" "foo" { + description = "Terraform acc test %s" + deletion_window_in_days = 7 + + policy = < 0 { + for _, elem := range l { + preferredInstanceType, ok := elem.(string) + + if !ok { + continue + } + + for _, foundInstanceType := range foundInstanceTypes { + if foundInstanceType == preferredInstanceType { + resultInstanceType = preferredInstanceType + break + } + } + + if resultInstanceType != "" { + break + } + } + } + + if resultInstanceType == "" && len(foundInstanceTypes) > 1 { + return fmt.Errorf("multiple EC2 Instance Offerings found matching criteria; try different search") + } + + if resultInstanceType == "" && len(foundInstanceTypes) == 1 { + resultInstanceType = foundInstanceTypes[0] + } + + if resultInstanceType == "" { + return fmt.Errorf("no EC2 Instance Type Offerings found matching criteria; try different search") + } + + d.Set("instance_type", resultInstanceType) + + d.SetId(resource.UniqueId()) + + return nil +} diff --git a/aws/data_source_aws_ec2_instance_type_offering_test.go b/aws/data_source_aws_ec2_instance_type_offering_test.go new file mode 100644 index 00000000000..5da0f721ed4 --- /dev/null +++ b/aws/data_source_aws_ec2_instance_type_offering_test.go @@ -0,0 +1,143 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func TestAccAWSEc2InstanceTypeOfferingDataSource_Filter(t *testing.T) { + dataSourceName := "data.aws_ec2_instance_type_offering.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2InstanceTypeOffering(t) }, + Providers: testAccProviders, + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSEc2InstanceTypeOfferingDataSourceConfigFilter(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(dataSourceName, "instance_type"), + ), + }, + }, + }) +} + +func TestAccAWSEc2InstanceTypeOfferingDataSource_LocationType(t *testing.T) { + dataSourceName := "data.aws_ec2_instance_type_offering.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2InstanceTypeOffering(t) }, + Providers: testAccProviders, + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSEc2InstanceTypeOfferingDataSourceConfigLocationType(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet(dataSourceName, "instance_type"), + ), + }, + }, + }) +} + +func TestAccAWSEc2InstanceTypeOfferingDataSource_PreferredInstanceTypes(t *testing.T) { + dataSourceName := "data.aws_ec2_instance_type_offering.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2InstanceTypeOffering(t) }, + Providers: testAccProviders, + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSEc2InstanceTypeOfferingDataSourceConfigPreferredInstanceTypes(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "instance_type", "t3.micro"), + ), + }, + }, + }) +} + +func testAccPreCheckAWSEc2InstanceTypeOffering(t *testing.T) { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + input := &ec2.DescribeInstanceTypeOfferingsInput{ + MaxResults: aws.Int64(5), + } + + _, err := conn.DescribeInstanceTypeOfferings(input) + + if testAccPreCheckSkipError(err) { + t.Skipf("skipping acceptance testing: %s", err) + } + + if err != nil { + t.Fatalf("unexpected PreCheck error: %s", err) + } +} + +func testAccAWSEc2InstanceTypeOfferingDataSourceConfigFilter() string { + return fmt.Sprintf(` +# Rather than hardcode an instance type in the testing, +# use the first result from all available offerings. +data "aws_ec2_instance_type_offerings" "test" {} + +data "aws_ec2_instance_type_offering" "test" { + filter { + name = "instance-type" + values = [tolist(data.aws_ec2_instance_type_offerings.test.instance_types)[0]] + } +} +`) +} + +func testAccAWSEc2InstanceTypeOfferingDataSourceConfigLocationType() string { + return fmt.Sprintf(` +data "aws_availability_zones" "available" { + state = "available" +} + +# Rather than hardcode an instance type in the testing, +# use the first result from all available offerings. +data "aws_ec2_instance_type_offerings" "test" { + filter { + name = "location" + values = [data.aws_availability_zones.available.names[0]] + } + + location_type = "availability-zone" +} + +data "aws_ec2_instance_type_offering" "test" { + filter { + name = "instance-type" + values = [tolist(data.aws_ec2_instance_type_offerings.test.instance_types)[0]] + } + + filter { + name = "location" + values = [data.aws_availability_zones.available.names[0]] + } + + location_type = "availability-zone" +} +`) +} + +func testAccAWSEc2InstanceTypeOfferingDataSourceConfigPreferredInstanceTypes() string { + return fmt.Sprintf(` +data "aws_ec2_instance_type_offering" "test" { + filter { + name = "instance-type" + values = ["t1.micro", "t2.micro", "t3.micro"] + } + + preferred_instance_types = ["t3.micro", "t2.micro", "t1.micro"] +} +`) +} diff --git a/aws/data_source_aws_ec2_instance_type_offerings.go b/aws/data_source_aws_ec2_instance_type_offerings.go new file mode 100644 index 00000000000..84fac611f41 --- /dev/null +++ b/aws/data_source_aws_ec2_instance_type_offerings.go @@ -0,0 +1,85 @@ +package aws + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" +) + +func dataSourceAwsEc2InstanceTypeOfferings() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAwsEc2InstanceTypeOfferingsRead, + + Schema: map[string]*schema.Schema{ + "filter": dataSourceFiltersSchema(), + "instance_types": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "location_type": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringInSlice([]string{ + ec2.LocationTypeAvailabilityZone, + ec2.LocationTypeAvailabilityZoneId, + ec2.LocationTypeRegion, + }, false), + }, + }, + } +} + +func dataSourceAwsEc2InstanceTypeOfferingsRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + input := &ec2.DescribeInstanceTypeOfferingsInput{} + + if v, ok := d.GetOk("filter"); ok { + input.Filters = buildAwsDataSourceFilters(v.(*schema.Set)) + } + + if v, ok := d.GetOk("location_type"); ok { + input.LocationType = aws.String(v.(string)) + } + + var instanceTypes []string + + for { + output, err := conn.DescribeInstanceTypeOfferings(input) + + if err != nil { + return fmt.Errorf("error reading EC2 Instance Type Offerings: %w", err) + } + + if output == nil { + break + } + + for _, instanceTypeOffering := range output.InstanceTypeOfferings { + if instanceTypeOffering == nil { + continue + } + + instanceTypes = append(instanceTypes, aws.StringValue(instanceTypeOffering.InstanceType)) + } + + if aws.StringValue(output.NextToken) == "" { + break + } + + input.NextToken = output.NextToken + } + + if err := d.Set("instance_types", instanceTypes); err != nil { + return fmt.Errorf("error setting instance_types: %s", err) + } + + d.SetId(resource.UniqueId()) + + return nil +} diff --git a/aws/data_source_aws_ec2_instance_type_offerings_test.go b/aws/data_source_aws_ec2_instance_type_offerings_test.go new file mode 100644 index 00000000000..f81bcd5872f --- /dev/null +++ b/aws/data_source_aws_ec2_instance_type_offerings_test.go @@ -0,0 +1,108 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func TestAccAWSEc2InstanceTypeOfferingsDataSource_Filter(t *testing.T) { + dataSourceName := "data.aws_ec2_instance_type_offerings.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2InstanceTypeOfferings(t) }, + Providers: testAccProviders, + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSEc2InstanceTypeOfferingsDataSourceConfigFilter(), + Check: resource.ComposeTestCheckFunc( + testAccCheckEc2InstanceTypeOfferingsInstanceTypes(dataSourceName), + ), + }, + }, + }) +} + +func TestAccAWSEc2InstanceTypeOfferingsDataSource_LocationType(t *testing.T) { + dataSourceName := "data.aws_ec2_instance_type_offerings.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2InstanceTypeOfferings(t) }, + Providers: testAccProviders, + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSEc2InstanceTypeOfferingsDataSourceConfigLocationType(), + Check: resource.ComposeTestCheckFunc( + testAccCheckEc2InstanceTypeOfferingsInstanceTypes(dataSourceName), + ), + }, + }, + }) +} + +func testAccCheckEc2InstanceTypeOfferingsInstanceTypes(dataSourceName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[dataSourceName] + if !ok { + return fmt.Errorf("Not found: %s", dataSourceName) + } + + if v := rs.Primary.Attributes["instance_types.#"]; v == "0" { + return fmt.Errorf("expected at least one instance_types result, got none") + } + + return nil + } +} + +func testAccPreCheckAWSEc2InstanceTypeOfferings(t *testing.T) { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + input := &ec2.DescribeInstanceTypeOfferingsInput{ + MaxResults: aws.Int64(5), + } + + _, err := conn.DescribeInstanceTypeOfferings(input) + + if testAccPreCheckSkipError(err) { + t.Skipf("skipping acceptance testing: %s", err) + } + + if err != nil { + t.Fatalf("unexpected PreCheck error: %s", err) + } +} + +func testAccAWSEc2InstanceTypeOfferingsDataSourceConfigFilter() string { + return fmt.Sprintf(` +data "aws_ec2_instance_type_offerings" "test" { + filter { + name = "instance-type" + values = ["t2.micro", "t3.micro"] + } +} +`) +} + +func testAccAWSEc2InstanceTypeOfferingsDataSourceConfigLocationType() string { + return fmt.Sprintf(` +data "aws_availability_zones" "available" { + state = "available" +} + +data "aws_ec2_instance_type_offerings" "test" { + filter { + name = "location" + values = ["${data.aws_availability_zones.available.names[0]}"] + } + + location_type = "availability-zone" +} +`) +} diff --git a/aws/data_source_aws_ec2_transit_gateway.go b/aws/data_source_aws_ec2_transit_gateway.go index 5528648f18d..a11a6f44b20 100644 --- a/aws/data_source_aws_ec2_transit_gateway.go +++ b/aws/data_source_aws_ec2_transit_gateway.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsEc2TransitGateway() *schema.Resource { @@ -118,7 +119,7 @@ func dataSourceAwsEc2TransitGatewayRead(d *schema.ResourceData, meta interface{} d.Set("owner_id", transitGateway.OwnerId) d.Set("propagation_default_route_table_id", transitGateway.Options.PropagationDefaultRouteTableId) - if err := d.Set("tags", tagsToMap(transitGateway.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(transitGateway.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } diff --git a/aws/data_source_aws_ec2_transit_gateway_dx_gateway_attachment.go b/aws/data_source_aws_ec2_transit_gateway_dx_gateway_attachment.go index cfff5ff2dc4..37f83b28a9a 100644 --- a/aws/data_source_aws_ec2_transit_gateway_dx_gateway_attachment.go +++ b/aws/data_source_aws_ec2_transit_gateway_dx_gateway_attachment.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsEc2TransitGatewayDxGatewayAttachment() *schema.Resource { @@ -65,7 +66,7 @@ func dataSourceAwsEc2TransitGatewayDxGatewayAttachmentRead(d *schema.ResourceDat transitGatewayAttachment := output.TransitGatewayAttachments[0] - if err := d.Set("tags", tagsToMap(transitGatewayAttachment.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(transitGatewayAttachment.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } diff --git a/aws/data_source_aws_ec2_transit_gateway_route_table.go b/aws/data_source_aws_ec2_transit_gateway_route_table.go index 21e3a02a508..4d9f7c5657d 100644 --- a/aws/data_source_aws_ec2_transit_gateway_route_table.go +++ b/aws/data_source_aws_ec2_transit_gateway_route_table.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsEc2TransitGatewayRouteTable() *schema.Resource { @@ -74,7 +75,7 @@ func dataSourceAwsEc2TransitGatewayRouteTableRead(d *schema.ResourceData, meta i d.Set("default_association_route_table", aws.BoolValue(transitGatewayRouteTable.DefaultAssociationRouteTable)) d.Set("default_propagation_route_table", aws.BoolValue(transitGatewayRouteTable.DefaultPropagationRouteTable)) - if err := d.Set("tags", tagsToMap(transitGatewayRouteTable.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(transitGatewayRouteTable.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } diff --git a/aws/data_source_aws_ec2_transit_gateway_vpc_attachment.go b/aws/data_source_aws_ec2_transit_gateway_vpc_attachment.go index 5467f5d5ff3..0c720a8eb31 100644 --- a/aws/data_source_aws_ec2_transit_gateway_vpc_attachment.go +++ b/aws/data_source_aws_ec2_transit_gateway_vpc_attachment.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsEc2TransitGatewayVpcAttachment() *schema.Resource { @@ -95,7 +96,7 @@ func dataSourceAwsEc2TransitGatewayVpcAttachmentRead(d *schema.ResourceData, met return fmt.Errorf("error setting subnet_ids: %s", err) } - if err := d.Set("tags", tagsToMap(transitGatewayVpcAttachment.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(transitGatewayVpcAttachment.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } diff --git a/aws/data_source_aws_ec2_transit_gateway_vpn_attachment.go b/aws/data_source_aws_ec2_transit_gateway_vpn_attachment.go index 8904414e278..02bc3da6459 100644 --- a/aws/data_source_aws_ec2_transit_gateway_vpn_attachment.go +++ b/aws/data_source_aws_ec2_transit_gateway_vpn_attachment.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsEc2TransitGatewayVpnAttachment() *schema.Resource { @@ -65,7 +66,7 @@ func dataSourceAwsEc2TransitGatewayVpnAttachmentRead(d *schema.ResourceData, met transitGatewayAttachment := output.TransitGatewayAttachments[0] - if err := d.Set("tags", tagsToMap(transitGatewayAttachment.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(transitGatewayAttachment.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } diff --git a/aws/data_source_aws_ecr_repository.go b/aws/data_source_aws_ecr_repository.go index b2f25e6f569..9bc8e4df698 100644 --- a/aws/data_source_aws_ecr_repository.go +++ b/aws/data_source_aws_ecr_repository.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ecr" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsEcrRepository() *schema.Resource { @@ -54,17 +55,22 @@ func dataSourceAwsEcrRepositoryRead(d *schema.ResourceData, meta interface{}) er } repository := out.Repositories[0] - - log.Printf("[DEBUG] Received ECR repository %s", out) + arn := aws.StringValue(repository.RepositoryArn) d.SetId(aws.StringValue(repository.RepositoryName)) - d.Set("arn", repository.RepositoryArn) + d.Set("arn", arn) d.Set("registry_id", repository.RegistryId) d.Set("name", repository.RepositoryName) d.Set("repository_url", repository.RepositoryUri) - if err := getTagsECR(conn, d); err != nil { - return fmt.Errorf("error getting ECR repository tags: %s", err) + tags, err := keyvaluetags.EcrListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for ECR Repository (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil diff --git a/aws/data_source_aws_efs_file_system.go b/aws/data_source_aws_efs_file_system.go index 1a6e07e5ae9..008e88edc9b 100644 --- a/aws/data_source_aws_efs_file_system.go +++ b/aws/data_source_aws_efs_file_system.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/efs" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsEfsFileSystem() *schema.Resource { @@ -50,6 +51,27 @@ func dataSourceAwsEfsFileSystem() *schema.Resource { Computed: true, }, "tags": tagsSchemaComputed(), + "throughput_mode": { + Type: schema.TypeString, + Computed: true, + }, + "provisioned_throughput_in_mibps": { + Type: schema.TypeFloat, + Computed: true, + }, + "lifecycle_policy": { + Type: schema.TypeList, + Computed: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "transition_to_ia": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, }, } } @@ -78,39 +100,6 @@ func dataSourceAwsEfsFileSystemRead(d *schema.ResourceData, meta interface{}) er d.SetId(*describeResp.FileSystems[0].FileSystemId) - 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 := efsconn.DescribeTags(params) - if err != nil { - return fmt.Errorf("Error retrieving EC2 tags for EFS file system (%q): %s", - d.Id(), err.Error()) - } - - tags = append(tags, tagsResp.Tags...) - //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 describeResp.FileSystems { if d.Id() == *f.FileSystemId { @@ -139,8 +128,26 @@ func dataSourceAwsEfsFileSystemRead(d *schema.ResourceData, meta interface{}) er d.Set("file_system_id", fs.FileSystemId) d.Set("encrypted", fs.Encrypted) d.Set("kms_key_id", fs.KmsKeyId) + d.Set("provisioned_throughput_in_mibps", fs.ProvisionedThroughputInMibps) + d.Set("throughput_mode", fs.ThroughputMode) + + if err := d.Set("tags", keyvaluetags.EfsKeyValueTags(fs.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + res, err := efsconn.DescribeLifecycleConfiguration(&efs.DescribeLifecycleConfigurationInput{ + FileSystemId: fs.FileSystemId, + }) + if err != nil { + return fmt.Errorf("Error describing lifecycle configuration for EFS file system (%s): %s", + aws.StringValue(fs.FileSystemId), err) + } + if err := resourceAwsEfsFileSystemSetLifecyclePolicy(d, res.LifecyclePolicies); err != nil { + return err + } region := meta.(*AWSClient).region - err = d.Set("dns_name", resourceAwsEfsDnsName(*fs.FileSystemId, region)) + dnsSuffix := meta.(*AWSClient).dnsSuffix + err = d.Set("dns_name", resourceAwsEfsDnsName(*fs.FileSystemId, region, dnsSuffix)) return err } diff --git a/aws/data_source_aws_efs_file_system_test.go b/aws/data_source_aws_efs_file_system_test.go index 684e5d308c5..70fb655bac4 100644 --- a/aws/data_source_aws_efs_file_system_test.go +++ b/aws/data_source_aws_efs_file_system_test.go @@ -2,40 +2,76 @@ package aws import ( "fmt" - "regexp" "testing" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccDataSourceAwsEfsFileSystem(t *testing.T) { +func TestAccDataSourceAwsEfsFileSystem_id(t *testing.T) { + dataSourceName := "data.aws_efs_file_system.test" + resourceName := "aws_efs_file_system.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceAwsEfsFileSystemConfig, + Config: testAccDataSourceAwsEfsFileSystemIDConfig, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrPair("data.aws_efs_file_system.by_id", "arn", "aws_efs_file_system.test", "arn"), - testAccDataSourceAwsEfsFileSystemCheck("data.aws_efs_file_system.by_creation_token"), - testAccDataSourceAwsEfsFileSystemCheck("data.aws_efs_file_system.by_id"), - resource.TestMatchResourceAttr("data.aws_efs_file_system.by_creation_token", "dns_name", regexp.MustCompile(`^[^.]+.efs.([a-z]{2}-(gov-)?[a-z]+-\d{1})?.amazonaws.com$`)), - resource.TestMatchResourceAttr("data.aws_efs_file_system.by_id", "dns_name", regexp.MustCompile(`^[^.]+.efs.([a-z]{2}-(gov-)?[a-z]+-\d{1})?.amazonaws.com$`)), + testAccDataSourceAwsEfsFileSystemCheck(dataSourceName, resourceName), + resource.TestCheckResourceAttrPair(dataSourceName, "arn", resourceName, "arn"), + resource.TestCheckResourceAttrPair(dataSourceName, "performance_mode", resourceName, "performance_mode"), + resource.TestCheckResourceAttrPair(dataSourceName, "creation_token", resourceName, "creation_token"), + resource.TestCheckResourceAttrPair(dataSourceName, "encrypted", resourceName, "encrypted"), + resource.TestCheckResourceAttrPair(dataSourceName, "kms_key_id", resourceName, "kms_key_id"), + resource.TestCheckResourceAttrPair(dataSourceName, "tags", resourceName, "tags"), + resource.TestCheckResourceAttrPair(dataSourceName, "dns_name", resourceName, "dns_name"), + resource.TestCheckResourceAttrPair(dataSourceName, "provisioned_throughput_in_mibps", resourceName, "provisioned_throughput_in_mibps"), + resource.TestCheckResourceAttrPair(dataSourceName, "throughput_mode", resourceName, "throughput_mode"), + resource.TestCheckResourceAttrPair(dataSourceName, "lifecycle_policy", resourceName, "lifecycle_policy"), ), }, }, }) } -func testAccDataSourceAwsEfsFileSystemCheck(name string) resource.TestCheckFunc { +func TestAccDataSourceAwsEfsFileSystem_name(t *testing.T) { + dataSourceName := "data.aws_efs_file_system.test" + resourceName := "aws_efs_file_system.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAwsEfsFileSystemNameConfig, + Check: resource.ComposeTestCheckFunc( + testAccDataSourceAwsEfsFileSystemCheck(dataSourceName, resourceName), + resource.TestCheckResourceAttrPair(dataSourceName, "arn", resourceName, "arn"), + resource.TestCheckResourceAttrPair(dataSourceName, "performance_mode", resourceName, "performance_mode"), + resource.TestCheckResourceAttrPair(dataSourceName, "creation_token", resourceName, "creation_token"), + resource.TestCheckResourceAttrPair(dataSourceName, "encrypted", resourceName, "encrypted"), + resource.TestCheckResourceAttrPair(dataSourceName, "kms_key_id", resourceName, "kms_key_id"), + resource.TestCheckResourceAttrPair(dataSourceName, "tags", resourceName, "tags"), + resource.TestCheckResourceAttrPair(dataSourceName, "dns_name", resourceName, "dns_name"), + resource.TestCheckResourceAttrPair(dataSourceName, "provisioned_throughput_in_mibps", resourceName, "provisioned_throughput_in_mibps"), + resource.TestCheckResourceAttrPair(dataSourceName, "throughput_mode", resourceName, "throughput_mode"), + resource.TestCheckResourceAttrPair(dataSourceName, "lifecycle_policy", resourceName, "lifecycle_policy"), + ), + }, + }, + }) +} + +func testAccDataSourceAwsEfsFileSystemCheck(dName, rName string) resource.TestCheckFunc { return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[name] + rs, ok := s.RootModule().Resources[dName] if !ok { - return fmt.Errorf("root module has no resource called %s", name) + return fmt.Errorf("root module has no resource called %s", dName) } - efsRs, ok := s.RootModule().Resources["aws_efs_file_system.test"] + efsRs, ok := s.RootModule().Resources[rName] if !ok { return fmt.Errorf("can't find aws_efs_file_system.test in state") } @@ -62,14 +98,18 @@ func testAccDataSourceAwsEfsFileSystemCheck(name string) resource.TestCheckFunc } } -const testAccDataSourceAwsEfsFileSystemConfig = ` +const testAccDataSourceAwsEfsFileSystemNameConfig = ` resource "aws_efs_file_system" "test" {} -data "aws_efs_file_system" "by_creation_token" { - creation_token = "${aws_efs_file_system.test.creation_token}" +data "aws_efs_file_system" "test" { +creation_token = "${aws_efs_file_system.test.creation_token}" } +` + +const testAccDataSourceAwsEfsFileSystemIDConfig = ` +resource "aws_efs_file_system" "test" {} -data "aws_efs_file_system" "by_id" { +data "aws_efs_file_system" "test" { file_system_id = "${aws_efs_file_system.test.id}" } ` diff --git a/aws/data_source_aws_efs_mount_target.go b/aws/data_source_aws_efs_mount_target.go index d69332f5e29..bc350bc0b02 100644 --- a/aws/data_source_aws_efs_mount_target.go +++ b/aws/data_source_aws_efs_mount_target.go @@ -101,7 +101,7 @@ func dataSourceAwsEfsMountTargetRead(d *schema.ResourceData, meta interface{}) e return err } - if err := d.Set("dns_name", resourceAwsEfsMountTargetDnsName(*mt.FileSystemId, meta.(*AWSClient).region)); err != nil { + if err := d.Set("dns_name", resourceAwsEfsMountTargetDnsName(*mt.FileSystemId, meta.(*AWSClient).region, meta.(*AWSClient).dnsSuffix)); err != nil { return fmt.Errorf("Error setting dns_name error: %#v", err) } diff --git a/aws/data_source_aws_eip.go b/aws/data_source_aws_eip.go index cca755bbcfa..fedf7e19d14 100644 --- a/aws/data_source_aws_eip.go +++ b/aws/data_source_aws_eip.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsEip() *schema.Resource { @@ -145,7 +146,10 @@ func dataSourceAwsEipRead(d *schema.ResourceData, meta interface{}) error { } } d.Set("public_ipv4_pool", eip.PublicIpv4Pool) - d.Set("tags", tagsToMap(eip.Tags)) + + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(eip.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } diff --git a/aws/data_source_aws_eip_test.go b/aws/data_source_aws_eip_test.go index e45f1e8853c..78c61c4d2de 100644 --- a/aws/data_source_aws_eip_test.go +++ b/aws/data_source_aws_eip_test.go @@ -256,11 +256,18 @@ data "aws_eip" "test" { ` const testAccDataSourceAwsEipConfigInstance = ` +data "aws_availability_zones" "available" { + # Error launching source instance: Unsupported: Your requested instance type (t2.micro) is not supported in your requested Availability Zone (us-west-2d). + blacklisted_zone_ids = ["usw2-az4"] + state = "available" +} + resource "aws_vpc" "test" { cidr_block = "10.2.0.0/16" } resource "aws_subnet" "test" { + availability_zone = "${data.aws_availability_zones.available.names[0]}" vpc_id = "${aws_vpc.test.id}" cidr_block = "10.2.0.0/24" } diff --git a/aws/data_source_aws_eks_cluster.go b/aws/data_source_aws_eks_cluster.go index 075b4caf3c9..b289ee01f63 100644 --- a/aws/data_source_aws_eks_cluster.go +++ b/aws/data_source_aws_eks_cluster.go @@ -92,6 +92,10 @@ func dataSourceAwsEksCluster() *schema.Resource { Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + "cluster_security_group_id": { + Type: schema.TypeString, + Computed: true, + }, "endpoint_private_access": { Type: schema.TypeBool, Computed: true, @@ -110,6 +114,11 @@ func dataSourceAwsEksCluster() *schema.Resource { Computed: true, Elem: &schema.Schema{Type: schema.TypeString}, }, + "public_access_cidrs": { + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, "vpc_id": { Type: schema.TypeString, Computed: true, diff --git a/aws/data_source_aws_eks_cluster_auth.go b/aws/data_source_aws_eks_cluster_auth.go index 49a6838ec8d..d9c2c39a6ae 100644 --- a/aws/data_source_aws_eks_cluster_auth.go +++ b/aws/data_source_aws_eks_cluster_auth.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/kubernetes-sigs/aws-iam-authenticator/pkg/token" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/eks/token" ) func dataSourceAwsEksClusterAuth() *schema.Resource { @@ -32,7 +32,7 @@ func dataSourceAwsEksClusterAuth() *schema.Resource { func dataSourceAwsEksClusterAuthRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).stsconn name := d.Get("name").(string) - generator, err := token.NewGenerator(false) + generator, err := token.NewGenerator(false, false) if err != nil { return fmt.Errorf("error getting token generator: %v", err) } diff --git a/aws/data_source_aws_eks_cluster_auth_test.go b/aws/data_source_aws_eks_cluster_auth_test.go index 44bdd0b4f7e..97ac0e7f4da 100644 --- a/aws/data_source_aws_eks_cluster_auth_test.go +++ b/aws/data_source_aws_eks_cluster_auth_test.go @@ -6,7 +6,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" - "github.com/kubernetes-sigs/aws-iam-authenticator/pkg/token" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/eks/token" ) func TestAccAWSEksClusterAuthDataSource_basic(t *testing.T) { diff --git a/aws/data_source_aws_eks_cluster_test.go b/aws/data_source_aws_eks_cluster_test.go index a1dfa435fad..6e7c8176518 100644 --- a/aws/data_source_aws_eks_cluster_test.go +++ b/aws/data_source_aws_eks_cluster_test.go @@ -39,10 +39,12 @@ func TestAccAWSEksClusterDataSource_basic(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, "tags.%", dataSourceResourceName, "tags.%"), resource.TestCheckResourceAttrPair(resourceName, "version", dataSourceResourceName, "version"), resource.TestCheckResourceAttr(dataSourceResourceName, "vpc_config.#", "1"), + resource.TestCheckResourceAttrPair(resourceName, "vpc_config.0.cluster_security_group_id", dataSourceResourceName, "vpc_config.0.cluster_security_group_id"), resource.TestCheckResourceAttrPair(resourceName, "vpc_config.0.endpoint_private_access", dataSourceResourceName, "vpc_config.0.endpoint_private_access"), resource.TestCheckResourceAttrPair(resourceName, "vpc_config.0.endpoint_public_access", dataSourceResourceName, "vpc_config.0.endpoint_public_access"), resource.TestCheckResourceAttrPair(resourceName, "vpc_config.0.security_group_ids.#", dataSourceResourceName, "vpc_config.0.security_group_ids.#"), resource.TestCheckResourceAttrPair(resourceName, "vpc_config.0.subnet_ids.#", dataSourceResourceName, "vpc_config.0.subnet_ids.#"), + resource.TestCheckResourceAttrPair(resourceName, "vpc_config.0.public_access_cidrs.#", dataSourceResourceName, "vpc_config.0.public_access_cidrs.#"), resource.TestCheckResourceAttrPair(resourceName, "vpc_config.0.vpc_id", dataSourceResourceName, "vpc_config.0.vpc_id"), ), }, diff --git a/aws/data_source_aws_elasticache_cluster.go b/aws/data_source_aws_elasticache_cluster.go index 090a0bfcf3c..9b07c8b83c2 100644 --- a/aws/data_source_aws_elasticache_cluster.go +++ b/aws/data_source_aws_elasticache_cluster.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/elasticache" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsElastiCacheCluster() *schema.Resource { @@ -222,19 +223,15 @@ func dataSourceAwsElastiCacheClusterRead(d *schema.ResourceData, meta interface{ }.String() d.Set("arn", arn) - tagResp, err := conn.ListTagsForResource(&elasticache.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) + tags, err := keyvaluetags.ElasticacheListTags(conn, arn) if err != nil { - log.Printf("[DEBUG] Error retrieving tags for ARN: %s", arn) + return fmt.Errorf("error listing tags for Elasticache Cluster (%s): %s", arn, err) } - var et []*elasticache.Tag - if len(tagResp.TagList) > 0 { - et = tagResp.TagList + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - d.Set("tags", tagsToMapEC(et)) return nil diff --git a/aws/data_source_aws_elasticache_cluster_test.go b/aws/data_source_aws_elasticache_cluster_test.go index d21c0f7e43a..9f9dabbf46c 100644 --- a/aws/data_source_aws_elasticache_cluster_test.go +++ b/aws/data_source_aws_elasticache_cluster_test.go @@ -9,63 +9,42 @@ import ( ) func TestAccAWSDataElasticacheCluster_basic(t *testing.T) { - rInt := acctest.RandInt() - rString := acctest.RandString(10) + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_elasticache_cluster.test" + dataSourceName := "data.aws_elasticache_cluster.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccAWSElastiCacheClusterConfigWithDataSource(rString, rInt), + Config: testAccAWSElastiCacheClusterConfigWithDataSource(rName), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_elasticache_cluster.bar", "engine", "memcached"), - resource.TestCheckResourceAttr("data.aws_elasticache_cluster.bar", "node_type", "cache.m1.small"), - resource.TestCheckResourceAttr("data.aws_elasticache_cluster.bar", "port", "11211"), - resource.TestCheckResourceAttr("data.aws_elasticache_cluster.bar", "num_cache_nodes", "1"), - resource.TestCheckResourceAttrSet("data.aws_elasticache_cluster.bar", "configuration_endpoint"), - resource.TestCheckResourceAttrSet("data.aws_elasticache_cluster.bar", "cluster_address"), - resource.TestCheckResourceAttrSet("data.aws_elasticache_cluster.bar", "availability_zone"), + resource.TestCheckResourceAttrPair(dataSourceName, "availability_zone", resourceName, "availability_zone"), + resource.TestCheckResourceAttrPair(dataSourceName, "cluster_address", resourceName, "cluster_address"), + resource.TestCheckResourceAttrPair(dataSourceName, "configuration_endpoint", resourceName, "configuration_endpoint"), + resource.TestCheckResourceAttrPair(dataSourceName, "engine", resourceName, "engine"), + resource.TestCheckResourceAttrPair(dataSourceName, "node_type", resourceName, "node_type"), + resource.TestCheckResourceAttrPair(dataSourceName, "num_cache_nodes", resourceName, "num_cache_nodes"), + resource.TestCheckResourceAttrPair(dataSourceName, "port", resourceName, "port"), ), }, }, }) } -func testAccAWSElastiCacheClusterConfigWithDataSource(rString string, rInt int) string { +func testAccAWSElastiCacheClusterConfigWithDataSource(rName string) string { return fmt.Sprintf(` -provider "aws" { - region = "us-east-1" -} - -resource "aws_security_group" "bar" { - name = "tf-test-security-group-%d" - description = "tf-test-security-group-descr" - - ingress { - from_port = -1 - to_port = -1 - protocol = "icmp" - self = true - } -} - -resource "aws_elasticache_security_group" "bar" { - name = "tf-test-security-group-%d" - description = "tf-test-security-group-descr" - security_group_names = ["${aws_security_group.bar.name}"] -} - -resource "aws_elasticache_cluster" "bar" { - cluster_id = "tf-%s" +resource "aws_elasticache_cluster" "test" { + cluster_id = %[1]q engine = "memcached" - node_type = "cache.m1.small" + node_type = "cache.t3.small" num_cache_nodes = 1 port = 11211 - security_group_names = ["${aws_elasticache_security_group.bar.name}"] } -data "aws_elasticache_cluster" "bar" { - cluster_id = "${aws_elasticache_cluster.bar.cluster_id}" +data "aws_elasticache_cluster" "test" { + cluster_id = aws_elasticache_cluster.test.cluster_id } -`, rInt, rInt, rString) +`, rName) } diff --git a/aws/data_source_aws_elasticache_replication_group_test.go b/aws/data_source_aws_elasticache_replication_group_test.go index 234f3362a47..c95fa027fa1 100644 --- a/aws/data_source_aws_elasticache_replication_group_test.go +++ b/aws/data_source_aws_elasticache_replication_group_test.go @@ -9,7 +9,10 @@ import ( ) func TestAccDataSourceAwsElasticacheReplicationGroup_basic(t *testing.T) { - rName := acctest.RandString(10) + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_elasticache_replication_group.test" + dataSourceName := "data.aws_elasticache_replication_group.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -17,16 +20,16 @@ func TestAccDataSourceAwsElasticacheReplicationGroup_basic(t *testing.T) { { Config: testAccDataSourceAwsElasticacheReplicationGroupConfig_basic(rName), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_elasticache_replication_group.bar", "replication_group_id", fmt.Sprintf("tf-%s", rName)), - resource.TestCheckResourceAttr("data.aws_elasticache_replication_group.bar", "replication_group_description", "test description"), - resource.TestCheckResourceAttr("data.aws_elasticache_replication_group.bar", "auth_token_enabled", "false"), - resource.TestCheckResourceAttr("data.aws_elasticache_replication_group.bar", "automatic_failover_enabled", "true"), - resource.TestCheckResourceAttr("data.aws_elasticache_replication_group.bar", "port", "6379"), - resource.TestCheckResourceAttrSet("data.aws_elasticache_replication_group.bar", "primary_endpoint_address"), - resource.TestCheckResourceAttr("data.aws_elasticache_replication_group.bar", "number_cache_clusters", "2"), - resource.TestCheckResourceAttr("data.aws_elasticache_replication_group.bar", "member_clusters.#", "2"), - resource.TestCheckResourceAttr("data.aws_elasticache_replication_group.bar", "node_type", "cache.m1.small"), - resource.TestCheckResourceAttr("data.aws_elasticache_replication_group.bar", "snapshot_window", "01:00-02:00"), + resource.TestCheckResourceAttr(dataSourceName, "auth_token_enabled", "false"), + resource.TestCheckResourceAttrPair(dataSourceName, "automatic_failover_enabled", resourceName, "automatic_failover_enabled"), + resource.TestCheckResourceAttrPair(dataSourceName, "member_clusters.#", resourceName, "member_clusters.#"), + resource.TestCheckResourceAttrPair(dataSourceName, "node_type", resourceName, "node_type"), + resource.TestCheckResourceAttrPair(dataSourceName, "number_cache_clusters", resourceName, "number_cache_clusters"), + resource.TestCheckResourceAttrPair(dataSourceName, "port", resourceName, "port"), + resource.TestCheckResourceAttrPair(dataSourceName, "primary_endpoint_address", resourceName, "primary_endpoint_address"), + resource.TestCheckResourceAttrPair(dataSourceName, "replication_group_description", resourceName, "replication_group_description"), + resource.TestCheckResourceAttrPair(dataSourceName, "replication_group_id", resourceName, "replication_group_id"), + resource.TestCheckResourceAttrPair(dataSourceName, "snapshot_window", resourceName, "snapshot_window"), ), }, }, @@ -34,7 +37,10 @@ func TestAccDataSourceAwsElasticacheReplicationGroup_basic(t *testing.T) { } func TestAccDataSourceAwsElasticacheReplicationGroup_ClusterMode(t *testing.T) { - rName := acctest.RandString(10) + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_elasticache_replication_group.test" + dataSourceName := "data.aws_elasticache_replication_group.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -42,13 +48,13 @@ func TestAccDataSourceAwsElasticacheReplicationGroup_ClusterMode(t *testing.T) { { Config: testAccDataSourceAwsElasticacheReplicationGroupConfig_ClusterMode(rName), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_elasticache_replication_group.cluster", "replication_group_id", fmt.Sprintf("tf-%s", rName)), - resource.TestCheckResourceAttr("data.aws_elasticache_replication_group.cluster", "replication_group_description", "test description"), - resource.TestCheckResourceAttr("data.aws_elasticache_replication_group.cluster", "auth_token_enabled", "false"), - resource.TestCheckResourceAttr("data.aws_elasticache_replication_group.cluster", "automatic_failover_enabled", "true"), - resource.TestCheckResourceAttr("data.aws_elasticache_replication_group.cluster", "port", "6379"), - resource.TestCheckResourceAttrSet("data.aws_elasticache_replication_group.cluster", "configuration_endpoint_address"), - resource.TestCheckResourceAttr("data.aws_elasticache_replication_group.cluster", "node_type", "cache.m1.small"), + resource.TestCheckResourceAttr(dataSourceName, "auth_token_enabled", "false"), + resource.TestCheckResourceAttrPair(dataSourceName, "automatic_failover_enabled", resourceName, "automatic_failover_enabled"), + resource.TestCheckResourceAttrPair(dataSourceName, "configuration_endpoint_address", resourceName, "configuration_endpoint_address"), + resource.TestCheckResourceAttrPair(dataSourceName, "node_type", resourceName, "node_type"), + resource.TestCheckResourceAttrPair(dataSourceName, "port", resourceName, "port"), + resource.TestCheckResourceAttrPair(dataSourceName, "replication_group_description", resourceName, "replication_group_description"), + resource.TestCheckResourceAttrPair(dataSourceName, "replication_group_id", resourceName, "replication_group_id"), ), }, }, @@ -59,29 +65,29 @@ func testAccDataSourceAwsElasticacheReplicationGroupConfig_basic(rName string) s return fmt.Sprintf(` data "aws_availability_zones" "available" {} -resource "aws_elasticache_replication_group" "bar" { - replication_group_id = "tf-%s" +resource "aws_elasticache_replication_group" "test" { + replication_group_id = %[1]q replication_group_description = "test description" - node_type = "cache.m1.small" + node_type = "cache.t3.small" number_cache_clusters = 2 port = 6379 - availability_zones = ["${data.aws_availability_zones.available.names[0]}", "${data.aws_availability_zones.available.names[1]}"] + availability_zones = [data.aws_availability_zones.available.names[0], data.aws_availability_zones.available.names[1]] automatic_failover_enabled = true snapshot_window = "01:00-02:00" } -data "aws_elasticache_replication_group" "bar" { - replication_group_id = "${aws_elasticache_replication_group.bar.replication_group_id}" +data "aws_elasticache_replication_group" "test" { + replication_group_id = aws_elasticache_replication_group.test.replication_group_id } `, rName) } func testAccDataSourceAwsElasticacheReplicationGroupConfig_ClusterMode(rName string) string { return fmt.Sprintf(` -resource "aws_elasticache_replication_group" "cluster" { - replication_group_id = "tf-%s" +resource "aws_elasticache_replication_group" "test" { + replication_group_id = %[1]q replication_group_description = "test description" - node_type = "cache.m1.small" + node_type = "cache.t3.small" port = 6379 automatic_failover_enabled = true @@ -91,8 +97,8 @@ resource "aws_elasticache_replication_group" "cluster" { } } -data "aws_elasticache_replication_group" "cluster" { - replication_group_id = "${aws_elasticache_replication_group.cluster.replication_group_id}" +data "aws_elasticache_replication_group" "test" { + replication_group_id = aws_elasticache_replication_group.test.replication_group_id } `, rName) } diff --git a/aws/data_source_aws_elasticsearch_domain.go b/aws/data_source_aws_elasticsearch_domain.go index 80816b1c245..c8fee7689f5 100644 --- a/aws/data_source_aws_elasticsearch_domain.go +++ b/aws/data_source_aws_elasticsearch_domain.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/service/elasticsearchservice" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/structure" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsElasticSearchDomain() *schema.Resource { @@ -350,15 +351,13 @@ func dataSourceAwsElasticSearchDomainRead(d *schema.ResourceData, meta interface d.Set("processing", ds.Processing) - tagResp, err := esconn.ListTags(&elasticsearchservice.ListTagsInput{ - ARN: ds.ARN, - }) + tags, err := keyvaluetags.ElasticsearchserviceListTags(esconn, d.Id()) if err != nil { - return fmt.Errorf("error retrieving tags for elasticsearch_domain: %s", err) + return fmt.Errorf("error listing tags for Elasticsearch Cluster (%s): %s", d.Id(), err) } - if err := d.Set("tags", tagsToMapElasticsearchService(tagResp.TagList)); err != nil { + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } diff --git a/aws/data_source_aws_elasticsearch_domain_test.go b/aws/data_source_aws_elasticsearch_domain_test.go index d79fa4850a6..32b76b7c3fe 100644 --- a/aws/data_source_aws_elasticsearch_domain_test.go +++ b/aws/data_source_aws_elasticsearch_domain_test.go @@ -14,7 +14,7 @@ func TestAccAWSDataElasticsearchDomain_basic(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { @@ -44,7 +44,7 @@ func TestAccAWSDataElasticsearchDomain_advanced(t *testing.T) { resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { @@ -72,10 +72,6 @@ func TestAccAWSDataElasticsearchDomain_advanced(t *testing.T) { func testAccAWSElasticsearchDomainConfigWithDataSource(rInt int) string { return fmt.Sprintf(` -provider "aws" { - region = "us-east-1" -} - locals { random_name = "test-es-%d" } @@ -106,7 +102,7 @@ resource "aws_elasticsearch_domain" "test" { POLICY cluster_config { - instance_type = "t2.micro.elasticsearch" + instance_type = "t2.small.elasticsearch" instance_count = 2 dedicated_master_enabled = false zone_awareness_config { @@ -132,10 +128,12 @@ data "aws_elasticsearch_domain" "test" { func testAccAWSElasticsearchDomainConfigAdvancedWithDataSource(rInt int) string { return fmt.Sprintf(` -provider "aws" { - region = "us-east-1" +data "aws_availability_zones" "available" { + state = "available" } +data "aws_partition" "current" {} + data "aws_region" "current" {} data "aws_caller_identity" "current" {} @@ -157,14 +155,14 @@ resource "aws_cloudwatch_log_resource_policy" "test" { { "Effect": "Allow", "Principal": { - "Service": "es.amazonaws.com" + "Service": "es.${data.aws_partition.current.dns_suffix}" }, "Action": [ "logs:PutLogEvents", "logs:PutLogEventsBatch", "logs:CreateLogStream" ], - "Resource": "arn:aws:logs:*" + "Resource": "arn:${data.aws_partition.current.partition}:logs:*" } ] } @@ -176,13 +174,15 @@ resource "aws_vpc" "test" { } resource "aws_subnet" "test" { - vpc_id = "${aws_vpc.test.id}" - cidr_block = "10.0.0.0/24" + availability_zone = "${data.aws_availability_zones.available.names[0]}" + cidr_block = "10.0.0.0/24" + vpc_id = "${aws_vpc.test.id}" } resource "aws_subnet" "test2" { - vpc_id = "${aws_vpc.test.id}" - cidr_block = "10.0.1.0/24" + availability_zone = "${data.aws_availability_zones.available.names[1]}" + cidr_block = "10.0.1.0/24" + vpc_id = "${aws_vpc.test.id}" } resource "aws_security_group" "test" { @@ -212,14 +212,14 @@ resource "aws_elasticsearch_domain" "test" { "Action": "es:*", "Principal": "*", "Effect": "Allow", - "Resource": "arn:aws:es:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:domain/${local.random_name}/*" + "Resource": "arn:${data.aws_partition.current.partition}:es:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:domain/${local.random_name}/*" } ] } POLICY cluster_config { - instance_type = "t2.micro.elasticsearch" + instance_type = "t2.small.elasticsearch" instance_count = 2 dedicated_master_enabled = false zone_awareness_config { diff --git a/aws/data_source_aws_elb.go b/aws/data_source_aws_elb.go index 1d159bbfbc7..b81d48f902b 100644 --- a/aws/data_source_aws_elb.go +++ b/aws/data_source_aws_elb.go @@ -5,6 +5,7 @@ import ( "log" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/elb" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -18,6 +19,11 @@ func dataSourceAwsElb() *schema.Resource { Required: true, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "access_logs": { Type: schema.TypeList, Computed: true, @@ -208,5 +214,14 @@ func dataSourceAwsElbRead(d *schema.ResourceData, meta interface{}) error { } d.SetId(*resp.LoadBalancerDescriptions[0].LoadBalancerName) + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Region: meta.(*AWSClient).region, + Service: "elasticloadbalancing", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("loadbalancer/%s", *resp.LoadBalancerDescriptions[0].LoadBalancerName), + } + d.Set("arn", arn.String()) + return flattenAwsELbResource(d, meta.(*AWSClient).ec2conn, elbconn, resp.LoadBalancerDescriptions[0]) } diff --git a/aws/data_source_aws_elb_test.go b/aws/data_source_aws_elb_test.go index 3dda875c551..5adcf47bec7 100644 --- a/aws/data_source_aws_elb_test.go +++ b/aws/data_source_aws_elb_test.go @@ -29,6 +29,7 @@ func TestAccDataSourceAWSELB_basic(t *testing.T) { resource.TestCheckResourceAttr("data.aws_elb.elb_test", "tags.TestName", t.Name()), resource.TestCheckResourceAttrSet("data.aws_elb.elb_test", "dns_name"), resource.TestCheckResourceAttrSet("data.aws_elb.elb_test", "zone_id"), + resource.TestCheckResourceAttrPair("data.aws_elb.elb_test", "arn", "aws_elb.elb_test", "arn"), ), }, }, diff --git a/aws/data_source_aws_guardduty_detector.go b/aws/data_source_aws_guardduty_detector.go new file mode 100644 index 00000000000..92d81303d8f --- /dev/null +++ b/aws/data_source_aws_guardduty_detector.go @@ -0,0 +1,78 @@ +package aws + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/guardduty" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func dataSourceAwsGuarddutyDetector() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAwsGuarddutyDetectorRead, + + Schema: map[string]*schema.Schema{ + "id": { + Type: schema.TypeString, + Optional: true, + }, + "status": { + Type: schema.TypeString, + Computed: true, + }, + "service_role_arn": { + Type: schema.TypeString, + Computed: true, + }, + "finding_publishing_frequency": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataSourceAwsGuarddutyDetectorRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).guarddutyconn + + detectorId := d.Get("id").(string) + + if detectorId == "" { + input := &guardduty.ListDetectorsInput{} + + resp, err := conn.ListDetectors(input) + if err != nil { + return fmt.Errorf("error listing GuardDuty Detectors: %s ,", err) + } + + if resp == nil || len(resp.DetectorIds) == 0 { + return fmt.Errorf("no GuardDuty Detectors found") + } + if len(resp.DetectorIds) > 1 { + return fmt.Errorf("multiple GuardDuty Detectors found; please use the `id` argument to look up a single detector") + } + + detectorId = aws.StringValue(resp.DetectorIds[0]) + } + + getInput := &guardduty.GetDetectorInput{ + DetectorId: aws.String(detectorId), + } + + getResp, err := conn.GetDetector(getInput) + if err != nil { + return err + } + + if getResp == nil { + return fmt.Errorf("cannot receive GuardDuty Detector details") + } + + d.SetId(detectorId) + d.Set("status", getResp.Status) + d.Set("service_role_arn", getResp.ServiceRole) + d.Set("finding_publishing_frequency", getResp.FindingPublishingFrequency) + + return nil +} diff --git a/aws/data_source_aws_guardduty_detector_test.go b/aws/data_source_aws_guardduty_detector_test.go new file mode 100644 index 00000000000..f118a3c5585 --- /dev/null +++ b/aws/data_source_aws_guardduty_detector_test.go @@ -0,0 +1,73 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func TestAccAWSGuarddutyDetectorDataSource_basic(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + PreventPostDestroyRefresh: true, + Steps: []resource.TestStep{ + { + Config: testAccAwsGuarddutyDetectorBasicResourceConfig(), + Check: resource.ComposeTestCheckFunc(), + }, + { + Config: testAccAwsGuarddutyDetectorBasicResourceDataConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair("data.aws_guardduty_detector.test", "id", "aws_guardduty_detector.test", "id"), + resource.TestCheckResourceAttr("data.aws_guardduty_detector.test", "status", "ENABLED"), + testAccCheckResourceAttrGlobalARN("data.aws_guardduty_detector.test", "service_role_arn", "iam", "role/aws-service-role/guardduty.amazonaws.com/AWSServiceRoleForAmazonGuardDuty"), + resource.TestCheckResourceAttrPair("data.aws_guardduty_detector.test", "finding_publishing_frequency", "aws_guardduty_detector.test", "finding_publishing_frequency"), + ), + }, + }, + }) +} + +func TestAccAWSGuarddutyDetectorDataSource_explicit(t *testing.T) { + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccAwsGuarddutyDetectorExplicitConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair("data.aws_guardduty_detector.test", "id", "aws_guardduty_detector.test", "id"), + resource.TestCheckResourceAttr("data.aws_guardduty_detector.test", "status", "ENABLED"), + testAccCheckResourceAttrGlobalARN("data.aws_guardduty_detector.test", "service_role_arn", "iam", "role/aws-service-role/guardduty.amazonaws.com/AWSServiceRoleForAmazonGuardDuty"), + resource.TestCheckResourceAttrPair("data.aws_guardduty_detector.test", "finding_publishing_frequency", "aws_guardduty_detector.test", "finding_publishing_frequency"), + ), + }, + }, + }) +} + +func testAccAwsGuarddutyDetectorBasicResourceConfig() string { + return fmt.Sprintf(` +resource "aws_guardduty_detector" "test" {} +`) +} + +func testAccAwsGuarddutyDetectorBasicResourceDataConfig() string { + return fmt.Sprintf(` +resource "aws_guardduty_detector" "test" {} + +data "aws_guardduty_detector" "test" {} +`) +} + +func testAccAwsGuarddutyDetectorExplicitConfig() string { + return fmt.Sprintf(` +resource "aws_guardduty_detector" "test" {} + +data "aws_guardduty_detector" "test" { + id = "${aws_guardduty_detector.test.id}" +} +`) +} diff --git a/aws/data_source_aws_iam_group.go b/aws/data_source_aws_iam_group.go index 8749a995c9c..6f12185619c 100644 --- a/aws/data_source_aws_iam_group.go +++ b/aws/data_source_aws_iam_group.go @@ -30,6 +30,30 @@ func dataSourceAwsIAMGroup() *schema.Resource { Type: schema.TypeString, Required: true, }, + "users": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "user_id": { + Type: schema.TypeString, + Computed: true, + }, + "user_name": { + Type: schema.TypeString, + Computed: true, + }, + "path": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, }, } } @@ -43,21 +67,44 @@ func dataSourceAwsIAMGroupRead(d *schema.ResourceData, meta interface{}) error { GroupName: aws.String(groupName), } + var users []*iam.User + var group *iam.Group + log.Printf("[DEBUG] Reading IAM Group: %s", req) - resp, err := iamconn.GetGroup(req) + err := iamconn.GetGroupPages(req, func(page *iam.GetGroupOutput, lastPage bool) bool { + if group == nil { + group = page.Group + } + users = append(users, page.Users...) + return !lastPage + }) if err != nil { return fmt.Errorf("Error getting group: %s", err) } - if resp == nil { + if group == nil { return fmt.Errorf("no IAM group found") } - group := resp.Group - d.SetId(*group.GroupId) d.Set("arn", group.Arn) d.Set("path", group.Path) d.Set("group_id", group.GroupId) + if err := d.Set("users", dataSourceUsersRead(users)); err != nil { + return fmt.Errorf("error setting users: %s", err) + } return nil } + +func dataSourceUsersRead(iamUsers []*iam.User) []map[string]interface{} { + users := make([]map[string]interface{}, 0, len(iamUsers)) + for _, i := range iamUsers { + u := make(map[string]interface{}) + u["arn"] = aws.StringValue(i.Arn) + u["user_id"] = aws.StringValue(i.UserId) + u["user_name"] = aws.StringValue(i.UserName) + u["path"] = aws.StringValue(i.Path) + users = append(users, u) + } + return users +} diff --git a/aws/data_source_aws_iam_group_test.go b/aws/data_source_aws_iam_group_test.go index 143ab84ee83..47786b2d963 100644 --- a/aws/data_source_aws_iam_group_test.go +++ b/aws/data_source_aws_iam_group_test.go @@ -2,7 +2,6 @@ package aws import ( "fmt" - "regexp" "testing" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" @@ -22,7 +21,35 @@ func TestAccAWSDataSourceIAMGroup_basic(t *testing.T) { resource.TestCheckResourceAttrSet("data.aws_iam_group.test", "group_id"), resource.TestCheckResourceAttr("data.aws_iam_group.test", "path", "/"), resource.TestCheckResourceAttr("data.aws_iam_group.test", "group_name", groupName), - resource.TestMatchResourceAttr("data.aws_iam_group.test", "arn", regexp.MustCompile("^arn:aws:iam::[0-9]{12}:group/"+groupName)), + testAccCheckResourceAttrGlobalARN("data.aws_iam_group.test", "arn", "iam", fmt.Sprintf("group/%s", groupName)), + ), + }, + }, + }) +} + +func TestAccAWSDataSourceIAMGroup_users(t *testing.T) { + groupName := fmt.Sprintf("test-datasource-group-%d", acctest.RandInt()) + userName := fmt.Sprintf("test-datasource-user-%d", acctest.RandInt()) + groupMemberShipName := fmt.Sprintf("test-datasource-group-membership-%d", acctest.RandInt()) + userCount := 101 + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccAwsIAMGroupConfigWithUser(groupName, userName, groupMemberShipName, userCount), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("data.aws_iam_group.test", "group_id"), + resource.TestCheckResourceAttr("data.aws_iam_group.test", "path", "/"), + resource.TestCheckResourceAttr("data.aws_iam_group.test", "group_name", groupName), + testAccCheckResourceAttrGlobalARN("data.aws_iam_group.test", "arn", "iam", fmt.Sprintf("group/%s", groupName)), + resource.TestCheckResourceAttr("data.aws_iam_group.test", "users.#", fmt.Sprint(userCount)), + resource.TestCheckResourceAttrSet("data.aws_iam_group.test", "users.0.arn"), + resource.TestCheckResourceAttrSet("data.aws_iam_group.test", "users.0.user_id"), + resource.TestCheckResourceAttrSet("data.aws_iam_group.test", "users.0.user_name"), + resource.TestCheckResourceAttrSet("data.aws_iam_group.test", "users.0.path"), ), }, }, @@ -41,3 +68,27 @@ data "aws_iam_group" "test" { } `, name) } + +func testAccAwsIAMGroupConfigWithUser(groupName, userName, membershipName string, userCount int) string { + return fmt.Sprintf(` +resource "aws_iam_group" "group" { + name = "%s" + path = "/" +} + +resource "aws_iam_user" "user" { + name = "%s-${count.index}" + count = %d +} + +resource "aws_iam_group_membership" "team" { + name = "%s" + users = "${aws_iam_user.user.*.name}" + group = "${aws_iam_group.group.name}" +} + +data "aws_iam_group" "test" { + group_name = "${aws_iam_group_membership.team.group}" +} +`, groupName, userName, userCount, membershipName) +} diff --git a/aws/data_source_aws_iam_policy_document_test.go b/aws/data_source_aws_iam_policy_document_test.go index c3b664948c2..d6dbab08edd 100644 --- a/aws/data_source_aws_iam_policy_document_test.go +++ b/aws/data_source_aws_iam_policy_document_test.go @@ -144,6 +144,42 @@ func TestAccAWSDataSourceIAMPolicyDocument_duplicateSid(t *testing.T) { }) } +// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/10777 +func TestAccAWSDataSourceIAMPolicyDocument_Statement_Principal_Identifiers_StringAndSlice(t *testing.T) { + dataSourceName := "data.aws_iam_policy_document.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccAWSIAMPolicyDocumentConfigStatementPrincipalIdentifiersStringAndSlice, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "json", testAccAWSIAMPolicyDocumentExpectedJSONStatementPrincipalIdentifiersStringAndSlice), + ), + }, + }, + }) +} + +// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/10777 +func TestAccAWSDataSourceIAMPolicyDocument_Statement_Principal_Identifiers_MultiplePrincipals(t *testing.T) { + dataSourceName := "data.aws_iam_policy_document.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccAWSIAMPolicyDocumentConfigStatementPrincipalIdentifiersMultiplePrincipals, + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(dataSourceName, "json", testAccAWSIAMPolicyDocumentExpectedJSONStatementPrincipalIdentifiersMultiplePrincipals), + ), + }, + }, + }) +} + func TestAccAWSDataSourceIAMPolicyDocument_Version_20081017(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -806,3 +842,93 @@ data "aws_iam_policy_document" "test" { } } ` + +var testAccAWSIAMPolicyDocumentConfigStatementPrincipalIdentifiersStringAndSlice = ` +data "aws_iam_policy_document" "test" { + statement { + actions = ["*"] + resources = ["*"] + sid = "StatementPrincipalIdentifiersStringAndSlice" + + principals { + identifiers = ["arn:aws:iam::111111111111:root"] + type = "AWS" + } + + principals { + identifiers = ["arn:aws:iam::222222222222:root", "arn:aws:iam::333333333333:root"] + type = "AWS" + } + } +} +` + +var testAccAWSIAMPolicyDocumentExpectedJSONStatementPrincipalIdentifiersStringAndSlice = `{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "StatementPrincipalIdentifiersStringAndSlice", + "Effect": "Allow", + "Action": "*", + "Resource": "*", + "Principal": { + "AWS": [ + "arn:aws:iam::111111111111:root", + "arn:aws:iam::333333333333:root", + "arn:aws:iam::222222222222:root" + ] + } + } + ] +}` + +var testAccAWSIAMPolicyDocumentConfigStatementPrincipalIdentifiersMultiplePrincipals = ` +data "aws_iam_policy_document" "test" { + statement { + actions = ["*"] + resources = ["*"] + sid = "StatementPrincipalIdentifiersStringAndSlice" + + principals { + identifiers = [ + "arn:aws:iam::111111111111:root", + "arn:aws:iam::222222222222:root", + ] + type = "AWS" + } + principals { + identifiers = [ + "arn:aws:iam::333333333333:root", + ] + type = "AWS" + } + principals { + identifiers = [ + "arn:aws:iam::444444444444:root", + ] + type = "AWS" + } + + } +} +` + +var testAccAWSIAMPolicyDocumentExpectedJSONStatementPrincipalIdentifiersMultiplePrincipals = `{ + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "StatementPrincipalIdentifiersStringAndSlice", + "Effect": "Allow", + "Action": "*", + "Resource": "*", + "Principal": { + "AWS": [ + "arn:aws:iam::333333333333:root", + "arn:aws:iam::444444444444:root", + "arn:aws:iam::222222222222:root", + "arn:aws:iam::111111111111:root" + ] + } + } + ] +}` diff --git a/aws/data_source_aws_iam_server_certificate.go b/aws/data_source_aws_iam_server_certificate.go index fdbfefdd020..e04879c31e7 100644 --- a/aws/data_source_aws_iam_server_certificate.go +++ b/aws/data_source_aws_iam_server_certificate.go @@ -139,9 +139,9 @@ func dataSourceAwsIAMServerCertificateRead(d *schema.ResourceData, meta interfac metadata := metadatas[0] d.SetId(*metadata.ServerCertificateId) - d.Set("arn", *metadata.Arn) - d.Set("path", *metadata.Path) - d.Set("name", *metadata.ServerCertificateName) + d.Set("arn", metadata.Arn) + d.Set("path", metadata.Path) + d.Set("name", metadata.ServerCertificateName) if metadata.Expiration != nil { d.Set("expiration_date", metadata.Expiration.Format(time.RFC3339)) } diff --git a/aws/data_source_aws_iam_server_certificate_test.go b/aws/data_source_aws_iam_server_certificate_test.go index 5e0a4975d0d..9ad9e15f3c9 100644 --- a/aws/data_source_aws_iam_server_certificate_test.go +++ b/aws/data_source_aws_iam_server_certificate_test.go @@ -13,23 +13,19 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func timePtr(t time.Time) *time.Time { - return &t -} - func TestResourceSortByExpirationDate(t *testing.T) { certs := []*iam.ServerCertificateMetadata{ { ServerCertificateName: aws.String("oldest"), - Expiration: timePtr(time.Now()), + Expiration: aws.Time(time.Now()), }, { ServerCertificateName: aws.String("latest"), - Expiration: timePtr(time.Now().Add(3 * time.Hour)), + Expiration: aws.Time(time.Now().Add(3 * time.Hour)), }, { ServerCertificateName: aws.String("in between"), - Expiration: timePtr(time.Now().Add(2 * time.Hour)), + Expiration: aws.Time(time.Now().Add(2 * time.Hour)), }, } sort.Sort(certificateByExpiration(certs)) @@ -39,15 +35,18 @@ func TestResourceSortByExpirationDate(t *testing.T) { } func TestAccAWSDataSourceIAMServerCertificate_basic(t *testing.T) { - rInt := acctest.RandInt() + rName := acctest.RandomWithPrefix("tf-acc-test") + + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509SelfSignedCertificatePem(key, "example.com") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckIAMServerCertificateDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsDataIAMServerCertConfig(rInt), + Config: testAccAwsDataIAMServerCertConfig(rName, key, certificate), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet("aws_iam_server_certificate.test_cert", "arn"), resource.TestCheckResourceAttrSet("data.aws_iam_server_certificate.test", "arn"), @@ -78,17 +77,20 @@ func TestAccAWSDataSourceIAMServerCertificate_matchNamePrefix(t *testing.T) { } func TestAccAWSDataSourceIAMServerCertificate_path(t *testing.T) { - rInt := acctest.RandInt() + rName := acctest.RandomWithPrefix("tf-acc-test") path := "/test-path/" pathPrefix := "/test-path/" + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509SelfSignedCertificatePem(key, "example.com") + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckIAMServerCertificateDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsDataIAMServerCertConfigPath(rInt, path, pathPrefix), + Config: testAccAwsDataIAMServerCertConfigPath(rName, path, pathPrefix, key, certificate), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr("data.aws_iam_server_certificate.test", "path", path), ), @@ -97,27 +99,36 @@ func TestAccAWSDataSourceIAMServerCertificate_path(t *testing.T) { }) } -func testAccAwsDataIAMServerCertConfig(rInt int) string { +func testAccAwsDataIAMServerCertConfig(rName, key, certificate string) string { return fmt.Sprintf(` -%s +resource "aws_iam_server_certificate" "test_cert" { + name = "%[1]s" + certificate_body = "%[2]s" + private_key = "%[3]s" +} data "aws_iam_server_certificate" "test" { name = "${aws_iam_server_certificate.test_cert.name}" latest = true } -`, testAccIAMServerCertConfig(rInt)) +`, rName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key)) } -func testAccAwsDataIAMServerCertConfigPath(rInt int, path, pathPrefix string) string { +func testAccAwsDataIAMServerCertConfigPath(rName, path, pathPrefix, key, certificate string) string { return fmt.Sprintf(` -%s +resource "aws_iam_server_certificate" "test_cert" { + name = "%[1]s" + path = "%[2]s" + certificate_body = "%[3]s" + private_key = "%[4]s" +} data "aws_iam_server_certificate" "test" { name = "${aws_iam_server_certificate.test_cert.name}" - path_prefix = "%s" + path_prefix = "%[5]s" latest = true } -`, testAccIAMServerCertConfig_path(rInt, path), pathPrefix) +`, rName, path, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key), pathPrefix) } var testAccAwsDataIAMServerCertConfigMatchNamePrefix = ` diff --git a/aws/data_source_aws_instance.go b/aws/data_source_aws_instance.go index d3dd4a96226..8f02a7316bd 100644 --- a/aws/data_source_aws_instance.go +++ b/aws/data_source_aws_instance.go @@ -1,6 +1,7 @@ package aws import ( + "bytes" "fmt" "log" "strings" @@ -8,7 +9,9 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsInstance() *schema.Resource { @@ -141,7 +144,7 @@ func dataSourceAwsInstance() *schema.Resource { }, }, "ephemeral_block_device": { - Type: schema.TypeSet, + Type: schema.TypeList, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -213,6 +216,14 @@ func dataSourceAwsInstance() *schema.Resource { }, }, }, + // This should not be necessary, but currently is (see #7198) + 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()) + }, }, "root_block_device": { Type: schema.TypeSet, @@ -297,9 +308,7 @@ func dataSourceAwsInstanceRead(d *schema.ResourceData, meta interface{}) error { params.InstanceIds = []*string{aws.String(instanceID.(string))} } if tagsOk { - params.Filters = append(params.Filters, buildEC2TagFilterList( - tagsFromMap(tags.(map[string]interface{})), - )...) + params.Filters = append(params.Filters, ec2TagFiltersFromMap(tags.(map[string]interface{}))...) } log.Printf("[DEBUG] Reading IAM Instance: %s", params) @@ -414,7 +423,9 @@ func instanceDescriptionAttributes(d *schema.ResourceData, instance *ec2.Instanc d.Set("monitoring", monitoringState == "enabled" || monitoringState == "pending") } - d.Set("tags", tagsToMap(instance.Tags)) + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(instance.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } // Security Groups if err := readSecurityGroups(d, instance, conn); err != nil { diff --git a/aws/data_source_aws_instance_test.go b/aws/data_source_aws_instance_test.go index 07960e43b75..45353709683 100644 --- a/aws/data_source_aws_instance_test.go +++ b/aws/data_source_aws_instance_test.go @@ -10,6 +10,9 @@ import ( ) func TestAccAWSInstanceDataSource_basic(t *testing.T) { + resourceName := "aws_instance.test" + datasourceName := "data.aws_instance.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -17,11 +20,11 @@ func TestAccAWSInstanceDataSource_basic(t *testing.T) { { Config: testAccInstanceDataSourceConfig, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.web-instance", "ami", "ami-4fccb37f"), - resource.TestCheckResourceAttr("data.aws_instance.web-instance", "tags.%", "1"), - resource.TestCheckResourceAttr("data.aws_instance.web-instance", "instance_type", "m1.small"), - resource.TestMatchResourceAttr("data.aws_instance.web-instance", "arn", regexp.MustCompile(`^arn:[^:]+:ec2:[^:]+:\d{12}:instance/i-.+`)), - resource.TestCheckNoResourceAttr("data.aws_instance.web-instance", "user_data_base64"), + resource.TestCheckResourceAttrPair(datasourceName, "ami", resourceName, "ami"), + resource.TestCheckResourceAttrPair(datasourceName, "tags.%", resourceName, "tags.%"), + resource.TestCheckResourceAttrPair(datasourceName, "instance_type", resourceName, "instance_type"), + resource.TestMatchResourceAttr(datasourceName, "arn", regexp.MustCompile(`^arn:[^:]+:ec2:[^:]+:\d{12}:instance/i-.+`)), + resource.TestCheckNoResourceAttr(datasourceName, "user_data_base64"), ), }, }, @@ -30,6 +33,9 @@ func TestAccAWSInstanceDataSource_basic(t *testing.T) { func TestAccAWSInstanceDataSource_tags(t *testing.T) { rInt := acctest.RandInt() + resourceName := "aws_instance.test" + datasourceName := "data.aws_instance.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -37,9 +43,9 @@ func TestAccAWSInstanceDataSource_tags(t *testing.T) { { Config: testAccInstanceDataSourceConfig_Tags(rInt), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.web-instance", "ami", "ami-4fccb37f"), - resource.TestCheckResourceAttr("data.aws_instance.web-instance", "tags.%", "2"), - resource.TestCheckResourceAttr("data.aws_instance.web-instance", "instance_type", "m1.small"), + resource.TestCheckResourceAttrPair(datasourceName, "ami", resourceName, "ami"), + resource.TestCheckResourceAttrPair(datasourceName, "tags.%", resourceName, "tags.%"), + resource.TestCheckResourceAttrPair(datasourceName, "instance_type", resourceName, "instance_type"), ), }, }, @@ -47,6 +53,9 @@ func TestAccAWSInstanceDataSource_tags(t *testing.T) { } func TestAccAWSInstanceDataSource_AzUserData(t *testing.T) { + resourceName := "aws_instance.test" + datasourceName := "data.aws_instance.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -54,11 +63,11 @@ func TestAccAWSInstanceDataSource_AzUserData(t *testing.T) { { Config: testAccInstanceDataSourceConfig_AzUserData, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.foo", "ami", "ami-4fccb37f"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "tags.%", "1"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "instance_type", "m1.small"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "availability_zone", "us-west-2a"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "user_data", "3dc39dda39be1205215e776bad998da361a5955d"), + resource.TestCheckResourceAttrPair(datasourceName, "ami", resourceName, "ami"), + resource.TestCheckResourceAttrPair(datasourceName, "tags.%", resourceName, "tags.%"), + resource.TestCheckResourceAttrPair(datasourceName, "instance_type", resourceName, "instance_type"), + resource.TestCheckResourceAttrPair(datasourceName, "availability_zone", resourceName, "availability_zone"), + resource.TestCheckResourceAttrPair(datasourceName, "user_data", resourceName, "user_data"), ), }, }, @@ -66,6 +75,9 @@ func TestAccAWSInstanceDataSource_AzUserData(t *testing.T) { } func TestAccAWSInstanceDataSource_gp2IopsDevice(t *testing.T) { + resourceName := "aws_instance.test" + datasourceName := "data.aws_instance.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -73,12 +85,12 @@ func TestAccAWSInstanceDataSource_gp2IopsDevice(t *testing.T) { { Config: testAccInstanceDataSourceConfig_gp2IopsDevice, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.foo", "ami", "ami-55a7ea65"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "instance_type", "m3.medium"), - resource.TestCheckResourceAttr("aws_instance.foo", "root_block_device.#", "1"), - resource.TestCheckResourceAttr("aws_instance.foo", "root_block_device.0.volume_size", "11"), - resource.TestCheckResourceAttr("aws_instance.foo", "root_block_device.0.volume_type", "gp2"), - resource.TestCheckResourceAttr("aws_instance.foo", "root_block_device.0.iops", "100"), + resource.TestCheckResourceAttrPair(datasourceName, "ami", resourceName, "ami"), + resource.TestCheckResourceAttrPair(datasourceName, "instance_type", resourceName, "instance_type"), + resource.TestCheckResourceAttrPair(datasourceName, "root_block_device.#", resourceName, "root_block_device.#"), + resource.TestCheckResourceAttrPair(datasourceName, "root_block_device.0.volume_size", resourceName, "root_block_device.0.volume_size"), + resource.TestCheckResourceAttrPair(datasourceName, "root_block_device.0.volume_type", resourceName, "root_block_device.0.volume_type"), + resource.TestCheckResourceAttrPair(datasourceName, "root_block_device.0.iops", resourceName, "root_block_device.0.iops"), ), }, }, @@ -86,6 +98,9 @@ func TestAccAWSInstanceDataSource_gp2IopsDevice(t *testing.T) { } func TestAccAWSInstanceDataSource_blockDevices(t *testing.T) { + resourceName := "aws_instance.test" + datasourceName := "data.aws_instance.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -93,13 +108,14 @@ func TestAccAWSInstanceDataSource_blockDevices(t *testing.T) { { Config: testAccInstanceDataSourceConfig_blockDevices, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.foo", "ami", "ami-55a7ea65"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "instance_type", "m3.medium"), - resource.TestCheckResourceAttr("aws_instance.foo", "root_block_device.#", "1"), - resource.TestCheckResourceAttr("aws_instance.foo", "root_block_device.0.volume_size", "11"), - resource.TestCheckResourceAttr("aws_instance.foo", "root_block_device.0.volume_type", "gp2"), - resource.TestCheckResourceAttr("aws_instance.foo", "ebs_block_device.#", "3"), - resource.TestCheckResourceAttr("aws_instance.foo", "ephemeral_block_device.#", "1"), + resource.TestCheckResourceAttrPair(datasourceName, "ami", resourceName, "ami"), + resource.TestCheckResourceAttrPair(datasourceName, "instance_type", resourceName, "instance_type"), + resource.TestCheckResourceAttrPair(datasourceName, "root_block_device.#", resourceName, "root_block_device.#"), + resource.TestCheckResourceAttrPair(datasourceName, "root_block_device.0.volume_size", resourceName, "root_block_device.0.volume_size"), + resource.TestCheckResourceAttrPair(datasourceName, "root_block_device.0.volume_type", resourceName, "root_block_device.0.volume_type"), + resource.TestCheckResourceAttrPair(datasourceName, "ebs_block_device.#", resourceName, "ebs_block_device.#"), + //resource.TestCheckResourceAttrPair(datasourceName, "ephemeral_block_device.#", resourceName, "ephemeral_block_device.#"), + // ephemeral block devices don't get saved properly due to API limitations, so this can't actually be tested right now ), }, }, @@ -133,6 +149,9 @@ func TestAccAWSInstanceDataSource_RootBlockDevice_KmsKeyId(t *testing.T) { } func TestAccAWSInstanceDataSource_rootInstanceStore(t *testing.T) { + resourceName := "aws_instance.test" + datasourceName := "data.aws_instance.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -140,11 +159,11 @@ func TestAccAWSInstanceDataSource_rootInstanceStore(t *testing.T) { { Config: testAccInstanceDataSourceConfig_rootInstanceStore, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.foo", "ami", "ami-44c36524"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "instance_type", "m3.medium"), - resource.TestCheckResourceAttr("aws_instance.foo", "ebs_block_device.#", "0"), - resource.TestCheckResourceAttr("aws_instance.foo", "ebs_optimized", "false"), - resource.TestCheckResourceAttr("aws_instance.foo", "root_block_device.#", "0"), + resource.TestCheckResourceAttrPair(datasourceName, "ami", resourceName, "ami"), + resource.TestCheckResourceAttrPair(datasourceName, "instance_type", resourceName, "instance_type"), + resource.TestCheckResourceAttrPair(datasourceName, "ebs_block_device.#", resourceName, "ebs_block_device.#"), + resource.TestCheckResourceAttrPair(datasourceName, "ebs_optimized", resourceName, "ebs_optimized"), + resource.TestCheckResourceAttrPair(datasourceName, "root_block_device.#", resourceName, "root_block_device.#"), ), }, }, @@ -152,16 +171,20 @@ func TestAccAWSInstanceDataSource_rootInstanceStore(t *testing.T) { } func TestAccAWSInstanceDataSource_privateIP(t *testing.T) { + resourceName := "aws_instance.test" + datasourceName := "data.aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccInstanceDataSourceConfig_privateIP, + Config: testAccInstanceDataSourceConfig_privateIP(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.foo", "ami", "ami-c5eabbf5"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "instance_type", "t2.micro"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "private_ip", "10.1.1.42"), + resource.TestCheckResourceAttrPair(datasourceName, "ami", resourceName, "ami"), + resource.TestCheckResourceAttrPair(datasourceName, "instance_type", resourceName, "instance_type"), + resource.TestCheckResourceAttrPair(datasourceName, "private_ip", resourceName, "private_ip"), ), }, }, @@ -169,7 +192,10 @@ func TestAccAWSInstanceDataSource_privateIP(t *testing.T) { } func TestAccAWSInstanceDataSource_keyPair(t *testing.T) { + resourceName := "aws_instance.test" + datasourceName := "data.aws_instance.test" rName := fmt.Sprintf("tf-test-key-%d", acctest.RandInt()) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -177,10 +203,10 @@ func TestAccAWSInstanceDataSource_keyPair(t *testing.T) { { Config: testAccInstanceDataSourceConfig_keyPair(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.foo", "ami", "ami-408c7f28"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "instance_type", "t1.micro"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "tags.%", "1"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "key_name", rName), + resource.TestCheckResourceAttrPair(datasourceName, "ami", resourceName, "ami"), + resource.TestCheckResourceAttrPair(datasourceName, "tags.%", resourceName, "tags.%"), + resource.TestCheckResourceAttrPair(datasourceName, "instance_type", resourceName, "instance_type"), + resource.TestCheckResourceAttrPair(datasourceName, "key_name", resourceName, "key_name"), ), }, }, @@ -188,18 +214,22 @@ func TestAccAWSInstanceDataSource_keyPair(t *testing.T) { } func TestAccAWSInstanceDataSource_VPC(t *testing.T) { + resourceName := "aws_instance.test" + datasourceName := "data.aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccInstanceDataSourceConfig_VPC, + Config: testAccInstanceDataSourceConfig_VPC(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.foo", "ami", "ami-4fccb37f"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "instance_type", "m1.small"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "user_data", "562a3e32810edf6ff09994f050f12e799452379d"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "associate_public_ip_address", "true"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "tenancy", "dedicated"), + resource.TestCheckResourceAttrPair(datasourceName, "ami", resourceName, "ami"), + resource.TestCheckResourceAttrPair(datasourceName, "instance_type", resourceName, "instance_type"), + resource.TestCheckResourceAttrPair(datasourceName, "user_data", resourceName, "user_data"), + resource.TestCheckResourceAttrPair(datasourceName, "associate_public_ip_address", resourceName, "associate_public_ip_address"), + resource.TestCheckResourceAttrPair(datasourceName, "tenancy", resourceName, "tenancy"), ), }, }, @@ -207,16 +237,18 @@ func TestAccAWSInstanceDataSource_VPC(t *testing.T) { } func TestAccAWSInstanceDataSource_PlacementGroup(t *testing.T) { - rStr := acctest.RandString(5) + resourceName := "aws_instance.test" + datasourceName := "data.aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccInstanceDataSourceConfig_PlacementGroup(rStr), + Config: testAccInstanceDataSourceConfig_PlacementGroup(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.foo", "placement_group", fmt.Sprintf("testAccInstanceDataSourceConfig_PlacementGroup_%s", rStr)), + resource.TestCheckResourceAttrPair(datasourceName, "placement_group", resourceName, "placement_group"), ), }, }, @@ -225,6 +257,9 @@ func TestAccAWSInstanceDataSource_PlacementGroup(t *testing.T) { func TestAccAWSInstanceDataSource_SecurityGroups(t *testing.T) { rInt := acctest.RandInt() + resourceName := "aws_instance.test" + datasourceName := "data.aws_instance.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -232,11 +267,11 @@ func TestAccAWSInstanceDataSource_SecurityGroups(t *testing.T) { { Config: testAccInstanceDataSourceConfig_SecurityGroups(rInt), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.foo", "ami", "ami-408c7f28"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "instance_type", "m1.small"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "vpc_security_group_ids.#", "0"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "security_groups.#", "1"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "user_data", "3dc39dda39be1205215e776bad998da361a5955d"), + resource.TestCheckResourceAttrPair(datasourceName, "ami", resourceName, "ami"), + resource.TestCheckResourceAttrPair(datasourceName, "instance_type", resourceName, "instance_type"), + resource.TestCheckResourceAttrPair(datasourceName, "user_data", resourceName, "user_data"), + resource.TestCheckResourceAttrPair(datasourceName, "vpc_security_group_ids.#", resourceName, "vpc_security_group_ids.#"), + resource.TestCheckResourceAttrPair(datasourceName, "security_groups.#", resourceName, "security_groups.#"), ), }, }, @@ -244,17 +279,21 @@ func TestAccAWSInstanceDataSource_SecurityGroups(t *testing.T) { } func TestAccAWSInstanceDataSource_VPCSecurityGroups(t *testing.T) { + resourceName := "aws_instance.test" + datasourceName := "data.aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccInstanceDataSourceConfig_VPCSecurityGroups, + Config: testAccInstanceDataSourceConfig_VPCSecurityGroups(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.foo", "ami", "ami-21f78e11"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "instance_type", "t1.micro"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "security_groups.#", "0"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "vpc_security_group_ids.#", "1"), + resource.TestCheckResourceAttrPair(datasourceName, "ami", resourceName, "ami"), + resource.TestCheckResourceAttrPair(datasourceName, "instance_type", resourceName, "instance_type"), + resource.TestCheckResourceAttrPair(datasourceName, "vpc_security_group_ids.#", resourceName, "vpc_security_group_ids.#"), + resource.TestCheckResourceAttrPair(datasourceName, "security_groups.#", resourceName, "security_groups.#"), ), }, }, @@ -262,24 +301,25 @@ func TestAccAWSInstanceDataSource_VPCSecurityGroups(t *testing.T) { } func TestAccAWSInstanceDataSource_getPasswordData_trueToFalse(t *testing.T) { - rInt := acctest.RandInt() + datasourceName := "data.aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccInstanceDataSourceConfig_getPasswordData(true, rInt), + Config: testAccInstanceDataSourceConfig_getPasswordData(rName, true), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.foo", "get_password_data", "true"), - resource.TestCheckResourceAttrSet("data.aws_instance.foo", "password_data"), + resource.TestCheckResourceAttr(datasourceName, "get_password_data", "true"), + resource.TestCheckResourceAttrSet(datasourceName, "password_data"), ), }, { - Config: testAccInstanceDataSourceConfig_getPasswordData(false, rInt), + Config: testAccInstanceDataSourceConfig_getPasswordData(rName, false), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.foo", "get_password_data", "false"), - resource.TestCheckNoResourceAttr("data.aws_instance.foo", "password_data"), + resource.TestCheckResourceAttr(datasourceName, "get_password_data", "false"), + resource.TestCheckNoResourceAttr(datasourceName, "password_data"), ), }, }, @@ -287,24 +327,25 @@ func TestAccAWSInstanceDataSource_getPasswordData_trueToFalse(t *testing.T) { } func TestAccAWSInstanceDataSource_getPasswordData_falseToTrue(t *testing.T) { - rInt := acctest.RandInt() + datasourceName := "data.aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccInstanceDataSourceConfig_getPasswordData(false, rInt), + Config: testAccInstanceDataSourceConfig_getPasswordData(rName, false), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.foo", "get_password_data", "false"), - resource.TestCheckNoResourceAttr("data.aws_instance.foo", "password_data"), + resource.TestCheckResourceAttr(datasourceName, "get_password_data", "false"), + resource.TestCheckNoResourceAttr(datasourceName, "password_data"), ), }, { - Config: testAccInstanceDataSourceConfig_getPasswordData(true, rInt), + Config: testAccInstanceDataSourceConfig_getPasswordData(rName, true), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.foo", "get_password_data", "true"), - resource.TestCheckResourceAttrSet("data.aws_instance.foo", "password_data"), + resource.TestCheckResourceAttr(datasourceName, "get_password_data", "true"), + resource.TestCheckResourceAttrSet(datasourceName, "password_data"), ), }, }, @@ -312,31 +353,32 @@ func TestAccAWSInstanceDataSource_getPasswordData_falseToTrue(t *testing.T) { } func TestAccAWSInstanceDataSource_GetUserData(t *testing.T) { - dataSourceName := "data.aws_instance.test" + datasourceName := "data.aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccInstanceDataSourceConfigGetUserData(true), + Config: testAccInstanceDataSourceConfigGetUserData(rName, true), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(dataSourceName, "get_user_data", "true"), - resource.TestCheckResourceAttr(dataSourceName, "user_data_base64", "IyEvYmluL2Jhc2gKCmVjaG8gImhlbGxvIHdvcmxkIgo="), + resource.TestCheckResourceAttr(datasourceName, "get_user_data", "true"), + resource.TestCheckResourceAttr(datasourceName, "user_data_base64", "IyEvYmluL2Jhc2gKCmVjaG8gImhlbGxvIHdvcmxkIgo="), ), }, { - Config: testAccInstanceDataSourceConfigGetUserData(false), + Config: testAccInstanceDataSourceConfigGetUserData(rName, false), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(dataSourceName, "get_user_data", "false"), - resource.TestCheckNoResourceAttr(dataSourceName, "user_data_base64"), + resource.TestCheckResourceAttr(datasourceName, "get_user_data", "false"), + resource.TestCheckNoResourceAttr(datasourceName, "user_data_base64"), ), }, { - Config: testAccInstanceDataSourceConfigGetUserData(true), + Config: testAccInstanceDataSourceConfigGetUserData(rName, true), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(dataSourceName, "get_user_data", "true"), - resource.TestCheckResourceAttr(dataSourceName, "user_data_base64", "IyEvYmluL2Jhc2gKCmVjaG8gImhlbGxvIHdvcmxkIgo="), + resource.TestCheckResourceAttr(datasourceName, "get_user_data", "true"), + resource.TestCheckResourceAttr(datasourceName, "user_data_base64", "IyEvYmluL2Jhc2gKCmVjaG8gImhlbGxvIHdvcmxkIgo="), ), }, }, @@ -344,31 +386,36 @@ func TestAccAWSInstanceDataSource_GetUserData(t *testing.T) { } func TestAccAWSInstanceDataSource_GetUserData_NoUserData(t *testing.T) { - dataSourceName := "data.aws_instance.test" + resourceName := "aws_instance.test" + datasourceName := "data.aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccInstanceDataSourceConfigGetUserDataNoUserData(true), + Config: testAccInstanceDataSourceConfigGetUserDataNoUserData(rName, true), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(dataSourceName, "get_user_data", "true"), - resource.TestCheckNoResourceAttr(dataSourceName, "user_data_base64"), + resource.TestCheckResourceAttr(datasourceName, "get_user_data", "true"), + resource.TestCheckNoResourceAttr(datasourceName, "user_data_base64"), + resource.TestCheckResourceAttrPair(datasourceName, "user_data_base64", resourceName, "user_data_base64"), ), }, { - Config: testAccInstanceDataSourceConfigGetUserDataNoUserData(false), + Config: testAccInstanceDataSourceConfigGetUserDataNoUserData(rName, false), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(dataSourceName, "get_user_data", "false"), - resource.TestCheckNoResourceAttr(dataSourceName, "user_data_base64"), + resource.TestCheckResourceAttr(datasourceName, "get_user_data", "false"), + resource.TestCheckNoResourceAttr(datasourceName, "user_data_base64"), + resource.TestCheckResourceAttrPair(datasourceName, "user_data_base64", resourceName, "user_data_base64"), ), }, { - Config: testAccInstanceDataSourceConfigGetUserDataNoUserData(true), + Config: testAccInstanceDataSourceConfigGetUserDataNoUserData(rName, true), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(dataSourceName, "get_user_data", "true"), - resource.TestCheckNoResourceAttr(dataSourceName, "user_data_base64"), + resource.TestCheckResourceAttr(datasourceName, "get_user_data", "true"), + resource.TestCheckNoResourceAttr(datasourceName, "user_data_base64"), + resource.TestCheckResourceAttrPair(datasourceName, "user_data_base64", resourceName, "user_data_base64"), ), }, }, @@ -376,17 +423,21 @@ func TestAccAWSInstanceDataSource_GetUserData_NoUserData(t *testing.T) { } func TestAccAWSInstanceDataSource_creditSpecification(t *testing.T) { + resourceName := "aws_instance.test" + datasourceName := "data.aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccInstanceDataSourceConfig_creditSpecification, + Config: testAccInstanceDataSourceConfig_creditSpecification(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("data.aws_instance.foo", "instance_type", "t2.micro"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "credit_specification.#", "1"), - resource.TestCheckResourceAttr("data.aws_instance.foo", "credit_specification.0.cpu_credits", "unlimited"), + resource.TestCheckResourceAttrPair(datasourceName, "instance_type", resourceName, "instance_type"), + resource.TestCheckResourceAttrPair(datasourceName, "credit_specification.#", resourceName, "credit_specification.#"), + resource.TestCheckResourceAttrPair(datasourceName, "credit_specification.0.cpu_credits", resourceName, "credit_specification.0.cpu_credits"), ), }, }, @@ -395,7 +446,7 @@ func TestAccAWSInstanceDataSource_creditSpecification(t *testing.T) { // Lookup based on InstanceID const testAccInstanceDataSourceConfig = ` -resource "aws_instance" "web" { +resource "aws_instance" "test" { # us-west-2 ami = "ami-4fccb37f" instance_type = "m1.small" @@ -404,10 +455,10 @@ resource "aws_instance" "web" { } } -data "aws_instance" "web-instance" { +data "aws_instance" "test" { filter { name = "instance-id" - values = ["${aws_instance.web.id}"] + values = ["${aws_instance.test.id}"] } } ` @@ -415,7 +466,7 @@ data "aws_instance" "web-instance" { // Use the tags attribute to filter func testAccInstanceDataSourceConfig_Tags(rInt int) string { return fmt.Sprintf(` -resource "aws_instance" "web" { +resource "aws_instance" "test" { # us-west-2 ami = "ami-4fccb37f" instance_type = "m1.small" @@ -426,9 +477,9 @@ resource "aws_instance" "web" { } } -data "aws_instance" "web-instance" { +data "aws_instance" "test" { instance_tags = { - Name = "${aws_instance.web.tags["Name"]}" + Name = "${aws_instance.test.tags["Name"]}" TestSeed = "%d" } } @@ -437,26 +488,26 @@ data "aws_instance" "web-instance" { // filter on tag, populate more attributes const testAccInstanceDataSourceConfig_AzUserData = ` -resource "aws_instance" "foo" { +resource "aws_instance" "test" { # us-west-2 ami = "ami-4fccb37f" availability_zone = "us-west-2a" instance_type = "m1.small" - user_data = "foo:-with-character's" + user_data = "test:-with-character's" tags = { TFAccTest = "YesThisIsATest" } } -data "aws_instance" "foo" { - instance_id = "${aws_instance.foo.id}" +data "aws_instance" "test" { + instance_id = "${aws_instance.test.id}" } ` // GP2IopsDevice const testAccInstanceDataSourceConfig_gp2IopsDevice = ` -resource "aws_instance" "foo" { +resource "aws_instance" "test" { # us-west-2 ami = "ami-55a7ea65" instance_type = "m3.medium" @@ -466,14 +517,14 @@ resource "aws_instance" "foo" { } } -data "aws_instance" "foo" { - instance_id = "${aws_instance.foo.id}" +data "aws_instance" "test" { + instance_id = "${aws_instance.test.id}" } ` // Block Device const testAccInstanceDataSourceConfig_blockDevices = ` -resource "aws_instance" "foo" { +resource "aws_instance" "test" { # us-west-2 ami = "ami-55a7ea65" instance_type = "m3.medium" @@ -506,17 +557,17 @@ resource "aws_instance" "foo" { } } -data "aws_instance" "foo" { - instance_id = "${aws_instance.foo.id}" +data "aws_instance" "test" { + instance_id = "${aws_instance.test.id}" } ` const testAccInstanceDataSourceConfig_EbsBlockDevice_KmsKeyId = ` -resource "aws_kms_key" "foo" { +resource "aws_kms_key" "test" { deletion_window_in_days = 7 } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { # us-west-2 ami = "ami-55a7ea65" instance_type = "m3.medium" @@ -528,185 +579,136 @@ resource "aws_instance" "foo" { ebs_block_device { device_name = "/dev/sdb" encrypted = true - kms_key_id = "${aws_kms_key.foo.arn}" + kms_key_id = "${aws_kms_key.test.arn}" volume_size = 9 } } -data "aws_instance" "foo" { - instance_id = "${aws_instance.foo.id}" +data "aws_instance" "test" { + instance_id = "${aws_instance.test.id}" } ` const testAccInstanceDataSourceConfig_RootBlockDevice_KmsKeyId = ` -resource "aws_kms_key" "foo" { +resource "aws_kms_key" "test" { deletion_window_in_days = 7 } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { # us-west-2 ami = "ami-55a7ea65" instance_type = "m3.medium" root_block_device { encrypted = true - kms_key_id = "${aws_kms_key.foo.arn}" + kms_key_id = "${aws_kms_key.test.arn}" volume_type = "gp2" volume_size = 11 } } -data "aws_instance" "foo" { - instance_id = "${aws_instance.foo.id}" +data "aws_instance" "test" { + instance_id = "${aws_instance.test.id}" } ` const testAccInstanceDataSourceConfig_rootInstanceStore = ` -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "ami-44c36524" instance_type = "m3.medium" } -data "aws_instance" "foo" { - instance_id = "${aws_instance.foo.id}" +data "aws_instance" "test" { + instance_id = "${aws_instance.test.id}" } ` -const testAccInstanceDataSourceConfig_privateIP = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - tags = { - Name = "terraform-testacc-instance-ds-private-ip" - } -} - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - tags = { - Name = "tf-acc-instance-ds-private-ip" - } -} - -resource "aws_instance" "foo" { - ami = "ami-c5eabbf5" +func testAccInstanceDataSourceConfig_privateIP(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" instance_type = "t2.micro" - subnet_id = "${aws_subnet.foo.id}" - private_ip = "10.1.1.42" + subnet_id = "${aws_subnet.test.id}" + private_ip = "10.1.1.42" } -data "aws_instance" "foo" { - instance_id = "${aws_instance.foo.id}" +data "aws_instance" "test" { + instance_id = "${aws_instance.test.id}" } -` - -func testAccInstanceDataSourceConfig_keyPair(rName string) string { - return fmt.Sprintf(` -provider "aws" { - region = "us-east-1" +`) } -resource "aws_key_pair" "debugging" { - key_name = "%s" +func testAccInstanceDataSourceConfig_keyPair(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + fmt.Sprintf(` +resource "aws_key_pair" "test" { + key_name = %[1]q public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com" } -resource "aws_instance" "foo" { - ami = "ami-408c7f28" +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" instance_type = "t1.micro" - key_name = "${aws_key_pair.debugging.key_name}" + key_name = "${aws_key_pair.test.key_name}" tags = { - Name = "testAccInstanceDataSourceConfigKeyPair_TestAMI" + Name = %[1]q } } -data "aws_instance" "foo" { +data "aws_instance" "test" { filter { name = "tag:Name" - values = ["testAccInstanceDataSourceConfigKeyPair_TestAMI"] + values = [%[1]q] } filter { name = "key-name" - values = ["${aws_instance.foo.key_name}"] + values = ["${aws_instance.test.key_name}"] } } `, rName) } -const testAccInstanceDataSourceConfig_VPC = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - tags = { - Name = "terraform-testacc-instance-data-source-vpc" - } -} - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - tags = { - Name = "tf-acc-instance-data-source-vpc" - } -} - -resource "aws_instance" "foo" { - # us-west-2 - ami = "ami-4fccb37f" - instance_type = "m1.small" - subnet_id = "${aws_subnet.foo.id}" +func testAccInstanceDataSourceConfig_VPC(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "m1.small" + subnet_id = "${aws_subnet.test.id}" associate_public_ip_address = true - tenancy = "dedicated" + tenancy = "dedicated" # pre-encoded base64 data - user_data = "3dc39dda39be1205215e776bad998da361a5955d" -} - -data "aws_instance" "foo" { - instance_id = "${aws_instance.foo.id}" + user_data = "3dc39dda39be1205215e776bad998da361a5955d" } -` - -func testAccInstanceDataSourceConfig_PlacementGroup(rStr string) string { - return fmt.Sprintf(` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - tags = { - Name = "terraform-testacc-instance-data-source-placement-group" - } +data "aws_instance" "test" { + instance_id = "${aws_instance.test.id}" } - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - - tags = { - Name = "tf-acc-instance-data-source-placement-group" - } +`) } -resource "aws_placement_group" "foo" { - name = "testAccInstanceDataSourceConfig_PlacementGroup_%s" +func testAccInstanceDataSourceConfig_PlacementGroup(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_placement_group" "test" { + name = %[1]q strategy = "cluster" } # Limitations: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#concepts-placement-groups -resource "aws_instance" "foo" { - # us-west-2 - ami = "ami-55a7ea65" +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" instance_type = "c3.large" - subnet_id = "${aws_subnet.foo.id}" + subnet_id = "${aws_subnet.test.id}" associate_public_ip_address = true - placement_group = "${aws_placement_group.foo.name}" + placement_group = "${aws_placement_group.test.name}" # pre-encoded base64 data user_data = "3dc39dda39be1205215e776bad998da361a5955d" } -data "aws_instance" "foo" { - instance_id = "${aws_instance.foo.id}" +data "aws_instance" "test" { + instance_id = "${aws_instance.test.id}" } -`, rStr) +`, rName) } func testAccInstanceDataSourceConfig_SecurityGroups(rInt int) string { @@ -727,135 +729,61 @@ resource "aws_security_group" "tf_test_foo" { } } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "ami-408c7f28" instance_type = "m1.small" security_groups = ["${aws_security_group.tf_test_foo.name}"] user_data = "foo:-with-character's" } -data "aws_instance" "foo" { - instance_id = "${aws_instance.foo.id}" +data "aws_instance" "test" { + instance_id = "${aws_instance.test.id}" } `, rInt) } -const testAccInstanceDataSourceConfig_VPCSecurityGroups = ` -resource "aws_internet_gateway" "gw" { - vpc_id = "${aws_vpc.foo.id}" - - tags = { - Name = "terraform-testacc-instance-data-source-vpc-sgs" - } -} - -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - tags = { - Name = "terraform-testacc-instance-data-source-vpc-sgs" - } -} - -resource "aws_security_group" "tf_test_foo" { - name = "tf_test_foo" - description = "foo" - vpc_id="${aws_vpc.foo.id}" - - ingress { - protocol = "icmp" - from_port = -1 - to_port = -1 - self = true - } -} - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - tags = { - Name = "tf-acc-instance-data-source-vpc-sgs" - } -} - -resource "aws_instance" "foo_instance" { - ami = "ami-21f78e11" - instance_type = "t1.micro" - vpc_security_group_ids = ["${aws_security_group.tf_test_foo.id}"] - subnet_id = "${aws_subnet.foo.id}" - depends_on = ["aws_internet_gateway.gw"] +func testAccInstanceDataSourceConfig_VPCSecurityGroups(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + + testAccAwsInstanceVpcConfig(rName, false) + + testAccAwsInstanceVpcSecurityGroupConfig(rName) + + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t1.micro" + vpc_security_group_ids = ["${aws_security_group.test.id}"] + subnet_id = "${aws_subnet.test.id}" + depends_on = ["aws_internet_gateway.test"] } -data "aws_instance" "foo" { - instance_id = "${aws_instance.foo_instance.id}" +data "aws_instance" "test" { + instance_id = "${aws_instance.test.id}" } -` - -func testAccInstanceDataSourceConfig_getPasswordData(val bool, rInt int) string { - return fmt.Sprintf(` -# Find latest Microsoft Windows Server 2016 Core image (Amazon deletes old ones) -data "aws_ami" "win2016core" { - most_recent = true - owners = ["amazon"] - - filter { - name = "name" - values = ["Windows_Server-2016-English-Core-Base-*"] - } +`) } -resource "aws_key_pair" "foo" { - key_name = "tf-acctest-%d" +func testAccInstanceDataSourceConfig_getPasswordData(rName string, val bool) string { + return testAccLatestWindowsServer2016CoreAmiConfig() + fmt.Sprintf(` +resource "aws_key_pair" "test" { + key_name = %[1]q public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAq6U3HQYC4g8WzU147gZZ7CKQH8TgYn3chZGRPxaGmHW1RUwsyEs0nmombmIhwxudhJ4ehjqXsDLoQpd6+c7BuLgTMvbv8LgE9LX53vnljFe1dsObsr/fYLvpU9LTlo8HgHAqO5ibNdrAUvV31ronzCZhms/Gyfdaue88Fd0/YnsZVGeOZPayRkdOHSpqme2CBrpa8myBeL1CWl0LkDG4+YCURjbaelfyZlIApLYKy3FcCan9XQFKaL32MJZwCgzfOvWIMtYcU8QtXMgnA3/I3gXk8YDUJv5P4lj0s/PJXuTM8DygVAUtebNwPuinS7wwonm5FXcWMuVGsVpG5K7FGQ== tf-acc-winpasswordtest" } -resource "aws_instance" "foo" { - ami = "${data.aws_ami.win2016core.id}" +resource "aws_instance" "test" { + ami = "${data.aws_ami.win2016core-ami.id}" instance_type = "t2.medium" - key_name = "${aws_key_pair.foo.key_name}" -} - -data "aws_instance" "foo" { - instance_id = "${aws_instance.foo.id}" - - get_password_data = %t -} -`, rInt, val) -} - -func testAccInstanceDataSourceConfigGetUserData(getUserData bool) string { - return fmt.Sprintf(` -data "aws_ami" "amzn-ami-minimal-hvm-ebs" { - most_recent = true - owners = ["amazon"] - - filter { - name = "name" - values = ["amzn-ami-minimal-hvm-*"] - } - - filter { - name = "root-device-type" - values = ["ebs"] - } + key_name = "${aws_key_pair.test.key_name}" } -resource "aws_vpc" "test" { - cidr_block = "172.16.0.0/16" +data "aws_instance" "test" { + instance_id = "${aws_instance.test.id}" - tags = { - Name = "tf-acc-test-instance-datasource-get-user-data" - } + get_password_data = %[2]t } - -resource "aws_subnet" "test" { - cidr_block = "172.16.0.0/24" - vpc_id = "${aws_vpc.test.id}" - - tags = { - Name = "tf-acc-test-instance-datasource-get-user-data" - } +`, rName, val) } +func testAccInstanceDataSourceConfigGetUserData(rName string, getUserData bool) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` resource "aws_instance" "test" { ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" instance_type = "t2.micro" @@ -869,46 +797,14 @@ EUD } data "aws_instance" "test" { - get_user_data = %t + get_user_data = %[2]t instance_id = "${aws_instance.test.id}" } -`, getUserData) -} - -func testAccInstanceDataSourceConfigGetUserDataNoUserData(getUserData bool) string { - return fmt.Sprintf(` -data "aws_ami" "amzn-ami-minimal-hvm-ebs" { - most_recent = true - owners = ["amazon"] - - filter { - name = "name" - values = ["amzn-ami-minimal-hvm-*"] - } - - filter { - name = "root-device-type" - values = ["ebs"] - } -} - -resource "aws_vpc" "test" { - cidr_block = "172.16.0.0/16" - - tags = { - Name = "tf-acc-test-instance-datasource-get-user-data" - } -} - -resource "aws_subnet" "test" { - cidr_block = "172.16.0.0/24" - vpc_id = "${aws_vpc.test.id}" - - tags = { - Name = "tf-acc-test-instance-datasource-get-user-data" - } +`, rName, getUserData) } +func testAccInstanceDataSourceConfigGetUserDataNoUserData(rName string, getUserData bool) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` resource "aws_instance" "test" { ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" instance_type = "t2.micro" @@ -916,32 +812,26 @@ resource "aws_instance" "test" { } data "aws_instance" "test" { - get_user_data = %t + get_user_data = %[2]t instance_id = "${aws_instance.test.id}" } -`, getUserData) -} - -const testAccInstanceDataSourceConfig_creditSpecification = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" -} - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" +`, rName, getUserData) } -resource "aws_instance" "foo" { - ami = "ami-bf4193c7" +func testAccInstanceDataSourceConfig_creditSpecification(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" instance_type = "t2.micro" - subnet_id = "${aws_subnet.foo.id}" + subnet_id = "${aws_subnet.test.id}" + credit_specification { cpu_credits = "unlimited" } } -data "aws_instance" "foo" { - instance_id = "${aws_instance.foo.id}" +data "aws_instance" "test" { + instance_id = "${aws_instance.test.id}" +} +`) } -` diff --git a/aws/data_source_aws_kinesis_stream.go b/aws/data_source_aws_kinesis_stream.go index b311e2072bb..5a8d5706130 100644 --- a/aws/data_source_aws_kinesis_stream.go +++ b/aws/data_source_aws_kinesis_stream.go @@ -1,9 +1,10 @@ package aws import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/kinesis" + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsKinesisStream() *schema.Resource { @@ -57,10 +58,7 @@ func dataSourceAwsKinesisStream() *schema.Resource { Set: schema.HashString, }, - "tags": { - Type: schema.TypeMap, - Computed: true, - }, + "tags": tagsSchemaComputed(), }, } } @@ -83,13 +81,15 @@ func dataSourceAwsKinesisStreamRead(d *schema.ResourceData, meta interface{}) er d.Set("retention_period", state.retentionPeriod) d.Set("shard_level_metrics", state.shardLevelMetrics) - tags, err := conn.ListTagsForStream(&kinesis.ListTagsForStreamInput{ - StreamName: aws.String(sn), - }) + tags, err := keyvaluetags.KinesisListTags(conn, sn) + if err != nil { - return err + return fmt.Errorf("error listing tags for Kinesis Stream (%s): %s", sn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - d.Set("tags", tagsToMapKinesis(tags.Tags)) return nil } diff --git a/aws/data_source_aws_kms_key.go b/aws/data_source_aws_kms_key.go index 75dd23f119c..4bd913f914f 100644 --- a/aws/data_source_aws_kms_key.go +++ b/aws/data_source_aws_kms_key.go @@ -63,6 +63,10 @@ func dataSourceAwsKmsKey() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "customer_master_key_spec": { + Type: schema.TypeString, + Computed: true, + }, "origin": { Type: schema.TypeString, Computed: true, @@ -103,6 +107,7 @@ func dataSourceAwsKmsKeyRead(d *schema.ResourceData, meta interface{}) error { d.Set("key_manager", output.KeyMetadata.KeyManager) d.Set("key_state", output.KeyMetadata.KeyState) d.Set("key_usage", output.KeyMetadata.KeyUsage) + d.Set("customer_master_key_spec", output.KeyMetadata.CustomerMasterKeySpec) d.Set("origin", output.KeyMetadata.Origin) if output.KeyMetadata.ValidTo != nil { d.Set("valid_to", aws.TimeValue(output.KeyMetadata.ValidTo).Format(time.RFC3339)) diff --git a/aws/data_source_aws_kms_key_test.go b/aws/data_source_aws_kms_key_test.go index b736d8b8b1c..193174c0cea 100644 --- a/aws/data_source_aws_kms_key_test.go +++ b/aws/data_source_aws_kms_key_test.go @@ -2,31 +2,36 @@ package aws import ( "fmt" - "regexp" "testing" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) func TestAccDataSourceAwsKmsKey_basic(t *testing.T) { + resourceName := "aws_kms_key.test" + datasourceName := "data.aws_kms_key.test" + rName := fmt.Sprintf("tf-testacc-kms-key-%s", acctest.RandStringFromCharSet(13, acctest.CharSetAlphaNum)) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccDataSourceAwsKmsKeyConfig, + Config: testAccDataSourceAwsKmsKeyConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccDataSourceAwsKmsKeyCheck("data.aws_kms_key.arbitrary"), - resource.TestMatchResourceAttr("data.aws_kms_key.arbitrary", "arn", regexp.MustCompile("^arn:[^:]+:kms:[^:]+:[^:]+:key/.+")), - resource.TestCheckResourceAttrSet("data.aws_kms_key.arbitrary", "aws_account_id"), - resource.TestCheckResourceAttrSet("data.aws_kms_key.arbitrary", "creation_date"), - resource.TestCheckResourceAttr("data.aws_kms_key.arbitrary", "description", "Terraform acc test"), - resource.TestCheckResourceAttr("data.aws_kms_key.arbitrary", "enabled", "true"), - resource.TestCheckResourceAttrSet("data.aws_kms_key.arbitrary", "key_manager"), - resource.TestCheckResourceAttrSet("data.aws_kms_key.arbitrary", "key_state"), - resource.TestCheckResourceAttr("data.aws_kms_key.arbitrary", "key_usage", "ENCRYPT_DECRYPT"), - resource.TestCheckResourceAttrSet("data.aws_kms_key.arbitrary", "origin"), + testAccDataSourceAwsKmsKeyCheck(datasourceName), + resource.TestCheckResourceAttrPair(datasourceName, "arn", resourceName, "arn"), + resource.TestCheckResourceAttrPair(datasourceName, "customer_master_key_spec", resourceName, "customer_master_key_spec"), + resource.TestCheckResourceAttrPair(datasourceName, "description", resourceName, "description"), + resource.TestCheckResourceAttrPair(datasourceName, "enabled", resourceName, "is_enabled"), + resource.TestCheckResourceAttrPair(datasourceName, "key_usage", resourceName, "key_usage"), + resource.TestCheckResourceAttrSet(datasourceName, "aws_account_id"), + resource.TestCheckResourceAttrSet(datasourceName, "creation_date"), + resource.TestCheckResourceAttrSet(datasourceName, "key_manager"), + resource.TestCheckResourceAttrSet(datasourceName, "key_state"), + resource.TestCheckResourceAttrSet(datasourceName, "origin"), ), }, }, @@ -35,41 +40,23 @@ func TestAccDataSourceAwsKmsKey_basic(t *testing.T) { func testAccDataSourceAwsKmsKeyCheck(name string) resource.TestCheckFunc { return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[name] + _, ok := s.RootModule().Resources[name] if !ok { return fmt.Errorf("root module has no resource called %s", name) } - kmsKeyRs, ok := s.RootModule().Resources["aws_kms_key.arbitrary"] - if !ok { - return fmt.Errorf("can't find aws_kms_key.arbitrary in state") - } - - attr := rs.Primary.Attributes - - checkProperties := []string{"arn", "key_usage", "description"} - - for _, p := range checkProperties { - if attr[p] != kmsKeyRs.Primary.Attributes[p] { - return fmt.Errorf( - "%s is %s; want %s", - p, - attr[p], - kmsKeyRs.Primary.Attributes[p], - ) - } - } - return nil } } -const testAccDataSourceAwsKmsKeyConfig = ` -resource "aws_kms_key" "arbitrary" { - description = "Terraform acc test" - deletion_window_in_days = 7 +func testAccDataSourceAwsKmsKeyConfig(rName string) string { + return fmt.Sprintf(` +resource "aws_kms_key" "test" { + description = %[1]q + deletion_window_in_days = 7 } -data "aws_kms_key" "arbitrary" { - key_id = "${aws_kms_key.arbitrary.key_id}" -}` +data "aws_kms_key" "test" { + key_id = "${aws_kms_key.test.key_id}" +}`, rName) +} diff --git a/aws/data_source_aws_lambda_alias.go b/aws/data_source_aws_lambda_alias.go new file mode 100644 index 00000000000..40bf48d2542 --- /dev/null +++ b/aws/data_source_aws_lambda_alias.go @@ -0,0 +1,75 @@ +package aws + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/lambda" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func dataSourceAwsLambdaAlias() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAwsLambdaAliasRead, + + Schema: map[string]*schema.Schema{ + "function_name": { + Type: schema.TypeString, + Required: true, + }, + + "name": { + Type: schema.TypeString, + Required: true, + }, + + "arn": { + Type: schema.TypeString, + Computed: true, + }, + + "invoke_arn": { + Type: schema.TypeString, + Computed: true, + }, + + "description": { + Type: schema.TypeString, + Computed: true, + }, + + "function_version": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataSourceAwsLambdaAliasRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).lambdaconn + + functionName := d.Get("function_name").(string) + name := d.Get("name").(string) + + params := &lambda.GetAliasInput{ + FunctionName: aws.String(functionName), + Name: aws.String(name), + } + + aliasConfiguration, err := conn.GetAlias(params) + if err != nil { + return fmt.Errorf("Error getting Lambda alias: %s", err) + } + + d.SetId(*aliasConfiguration.AliasArn) + + d.Set("arn", aliasConfiguration.AliasArn) + d.Set("description", aliasConfiguration.Description) + d.Set("function_version", aliasConfiguration.FunctionVersion) + + invokeArn := lambdaFunctionInvokeArn(*aliasConfiguration.AliasArn, meta) + d.Set("invoke_arn", invokeArn) + + return nil +} diff --git a/aws/data_source_aws_lambda_alias_test.go b/aws/data_source_aws_lambda_alias_test.go new file mode 100644 index 00000000000..55ea309f6ca --- /dev/null +++ b/aws/data_source_aws_lambda_alias_test.go @@ -0,0 +1,115 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func TestAccDataSourceAWSLambdaAlias_basic(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + + dataSourceName := "data.aws_lambda_alias.test" + resourceName := "aws_lambda_alias.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAWSLambdaAliasConfigBasic(rName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrPair(dataSourceName, "arn", resourceName, "arn"), + resource.TestCheckResourceAttrPair(dataSourceName, "description", resourceName, "description"), + resource.TestCheckResourceAttrPair(dataSourceName, "function_version", resourceName, "function_version"), + resource.TestCheckResourceAttrPair(dataSourceName, "invoke_arn", resourceName, "invoke_arn"), + ), + }, + }, + }) +} + +func testAccDataSourceAWSLambdaAliasConfigBase(rName string) string { + return fmt.Sprintf(` +data "aws_partition" "current" {} + +resource "aws_iam_role" "lambda" { + name = %[1]q + + assume_role_policy = < 0 { - reqListTags := &route53.ListTagsForResourceInput{} - reqListTags.ResourceId = aws.String(hostedZoneId) - reqListTags.ResourceType = aws.String("hostedzone") - respListTags, errListTags := conn.ListTagsForResource(reqListTags) + listTags, err := keyvaluetags.Route53ListTags(conn, hostedZoneId, route53.TagResourceTypeHostedzone) - 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 err != nil { + return fmt.Errorf("Error finding Route 53 Hosted Zone: %v", err) } + matchingTags = listTags.ContainsAll(tags) } if matchingTags && matchingVPC { @@ -186,6 +173,16 @@ func dataSourceAwsRoute53ZoneRead(d *schema.ResourceData, meta interface{}) erro } d.Set("name_servers", nameServers) + tags, err = keyvaluetags.Route53ListTags(conn, idHostedZone, route53.TagResourceTypeHostedzone) + + if err != nil { + return fmt.Errorf("Error finding Route 53 Hosted Zone: %v", err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + return nil } diff --git a/aws/data_source_aws_route53_zone_test.go b/aws/data_source_aws_route53_zone_test.go index a9c5063e4ff..4c626cb9257 100644 --- a/aws/data_source_aws_route53_zone_test.go +++ b/aws/data_source_aws_route53_zone_test.go @@ -9,11 +9,10 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" ) -func TestAccDataSourceAwsRoute53Zone(t *testing.T) { +func TestAccDataSourceAwsRoute53Zone_id(t *testing.T) { rInt := acctest.RandInt() - publicResourceName := "aws_route53_zone.test" - privateResourceName := "aws_route53_zone.test_private" - serviceDiscoveryResourceName := "aws_service_discovery_private_dns_namespace.test_service_discovery" + resourceName := "aws_route53_zone.test" + dataSourceName := "data.aws_route53_zone.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -21,87 +20,214 @@ func TestAccDataSourceAwsRoute53Zone(t *testing.T) { CheckDestroy: testAccCheckRoute53ZoneDestroy, Steps: []resource.TestStep{ { - Config: testAccDataSourceAwsRoute53ZoneConfig(rInt), + Config: testAccDataSourceAwsRoute53ZoneConfigId(rInt), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttrPair(publicResourceName, "id", "data.aws_route53_zone.by_zone_id", "id"), - resource.TestCheckResourceAttrPair(publicResourceName, "name", "data.aws_route53_zone.by_zone_id", "name"), - resource.TestCheckResourceAttrPair(publicResourceName, "name_servers", "data.aws_route53_zone.by_zone_id", "name_servers"), - resource.TestCheckResourceAttrPair(publicResourceName, "id", "data.aws_route53_zone.by_name", "id"), - resource.TestCheckResourceAttrPair(publicResourceName, "name", "data.aws_route53_zone.by_name", "name"), - resource.TestCheckResourceAttrPair(publicResourceName, "name_servers", "data.aws_route53_zone.by_name", "name_servers"), - resource.TestCheckResourceAttrPair(privateResourceName, "id", "data.aws_route53_zone.by_vpc", "id"), - resource.TestCheckResourceAttrPair(privateResourceName, "name", "data.aws_route53_zone.by_vpc", "name"), - resource.TestCheckResourceAttrPair(privateResourceName, "id", "data.aws_route53_zone.by_tag", "id"), - resource.TestCheckResourceAttrPair(privateResourceName, "name", "data.aws_route53_zone.by_tag", "name"), - resource.TestCheckResourceAttrPair(serviceDiscoveryResourceName, "hosted_zone", "data.aws_route53_zone.service_discovery_by_vpc", "id"), - resource.TestCheckResourceAttrPair(serviceDiscoveryResourceName, "name", "data.aws_route53_zone.service_discovery_by_vpc", "name"), - resource.TestCheckResourceAttr("data.aws_route53_zone.service_discovery_by_vpc", "linked_service_principal", "servicediscovery.amazonaws.com"), - resource.TestMatchResourceAttr("data.aws_route53_zone.service_discovery_by_vpc", "linked_service_description", regexp.MustCompile(`^arn:[^:]+:servicediscovery:[^:]+:[^:]+:namespace/ns-\w+$`)), + resource.TestCheckResourceAttrPair(resourceName, "id", dataSourceName, "id"), + resource.TestCheckResourceAttrPair(resourceName, "name", dataSourceName, "name"), + resource.TestCheckResourceAttrPair(resourceName, "name_servers", dataSourceName, "name_servers"), + resource.TestCheckResourceAttrPair(resourceName, "tags", dataSourceName, "tags"), ), }, }, }) } -func testAccDataSourceAwsRoute53ZoneConfig(rInt int) string { +func TestAccDataSourceAwsRoute53Zone_name(t *testing.T) { + rInt := acctest.RandInt() + resourceName := "aws_route53_zone.test" + dataSourceName := "data.aws_route53_zone.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckRoute53ZoneDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAwsRoute53ZoneConfigName(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(resourceName, "id", dataSourceName, "id"), + resource.TestCheckResourceAttrPair(resourceName, "name", dataSourceName, "name"), + resource.TestCheckResourceAttrPair(resourceName, "name_servers", dataSourceName, "name_servers"), + resource.TestCheckResourceAttrPair(resourceName, "tags", dataSourceName, "tags"), + ), + }, + }, + }) +} + +func TestAccDataSourceAwsRoute53Zone_tags(t *testing.T) { + rInt := acctest.RandInt() + resourceName := "aws_route53_zone.test" + dataSourceName := "data.aws_route53_zone.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckRoute53ZoneDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAwsRoute53ZoneConfigTagsPrivate(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(resourceName, "id", dataSourceName, "id"), + resource.TestCheckResourceAttrPair(resourceName, "name", dataSourceName, "name"), + resource.TestCheckResourceAttrPair(resourceName, "name_servers", dataSourceName, "name_servers"), + resource.TestCheckResourceAttrPair(resourceName, "tags", dataSourceName, "tags"), + ), + }, + }, + }) +} + +func TestAccDataSourceAwsRoute53Zone_vpc(t *testing.T) { + rInt := acctest.RandInt() + resourceName := "aws_route53_zone.test" + dataSourceName := "data.aws_route53_zone.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckRoute53ZoneDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAwsRoute53ZoneConfigVpc(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(resourceName, "id", dataSourceName, "id"), + resource.TestCheckResourceAttrPair(resourceName, "name", dataSourceName, "name"), + resource.TestCheckResourceAttrPair(resourceName, "name_servers", dataSourceName, "name_servers"), + resource.TestCheckResourceAttrPair(resourceName, "tags", dataSourceName, "tags"), + ), + }, + }, + }) +} + +func TestAccDataSourceAwsRoute53Zone_serviceDiscovery(t *testing.T) { + rInt := acctest.RandInt() + resourceName := "aws_service_discovery_private_dns_namespace.test" + dataSourceName := "data.aws_route53_zone.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckRoute53ZoneDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAwsRoute53ZoneConfigServiceDiscovery(rInt), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(resourceName, "name", dataSourceName, "name"), + resource.TestCheckResourceAttr(dataSourceName, "linked_service_principal", "servicediscovery.amazonaws.com"), + resource.TestMatchResourceAttr(dataSourceName, "linked_service_description", regexp.MustCompile(`^arn:[^:]+:servicediscovery:[^:]+:[^:]+:namespace/ns-\w+$`)), + ), + }, + }, + }) +} + +func testAccDataSourceAwsRoute53ZoneConfigId(rInt int) string { + return fmt.Sprintf(` +resource "aws_route53_zone" "test" { + name = "terraformtestacchz-%[1]d.com." +} + +data "aws_route53_zone" "test" { + zone_id = "${aws_route53_zone.test.zone_id}" +} +`, rInt) +} + +func testAccDataSourceAwsRoute53ZoneConfigName(rInt int) string { return fmt.Sprintf(` -provider "aws" { - region = "us-east-1" +resource "aws_route53_zone" "test" { + name = "terraformtestacchz-%[1]d.com." } +data "aws_route53_zone" "test" { + name = "${aws_route53_zone.test.name}" +} +`, rInt) +} + +func testAccDataSourceAwsRoute53ZoneConfigTagsPrivate(rInt int) string { + return fmt.Sprintf(` resource "aws_vpc" "test" { - cidr_block = "172.16.0.0/16" + cidr_block = "10.0.0.0/16" tags = { - Name = "terraform-testacc-r53-zone-data-source" + Name = "terraform-testacc-r53-zone-data-source-%[1]d" } } -resource "aws_route53_zone" "test_private" { - name = "test.acc-%[1]d." - +resource "aws_route53_zone" "test" { + name = "terraformtestacchz-%[1]d.com." vpc { vpc_id = "${aws_vpc.test.id}" } tags = { - Environment = "dev-%[1]d" + Environment = "tf-acc-test-%[1]d" + Name = "tf-acc-test-%[1]d" } } -data "aws_route53_zone" "by_vpc" { - name = "${aws_route53_zone.test_private.name}" +data "aws_route53_zone" "test" { + name = "${aws_route53_zone.test.name}" + private_zone = true vpc_id = "${aws_vpc.test.id}" + + tags = { + Environment = "tf-acc-test-%[1]d" + } +} +`, rInt) } -data "aws_route53_zone" "by_tag" { - name = "${aws_route53_zone.test_private.name}" - private_zone = true +func testAccDataSourceAwsRoute53ZoneConfigVpc(rInt int) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" tags = { - Environment = "dev-%[1]d" + Name = "terraform-testacc-r53-zone-data-source-%[1]d" } } resource "aws_route53_zone" "test" { - name = "terraformtestacchz-%[1]d.com." + name = "test.acc-%[1]d." + + vpc { + vpc_id = "${aws_vpc.test.id}" + } + + tags = { + Environment = "dev-%[1]d" + } } -data "aws_route53_zone" "by_zone_id" { - zone_id = "${aws_route53_zone.test.zone_id}" +data "aws_route53_zone" "test" { + name = "${aws_route53_zone.test.name}" + private_zone = true + vpc_id = "${aws_vpc.test.id}" +} +`, rInt) } -data "aws_route53_zone" "by_name" { - name = "${data.aws_route53_zone.by_zone_id.name}" +func testAccDataSourceAwsRoute53ZoneConfigServiceDiscovery(rInt int) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + + tags = { + Name = "terraform-testacc-r53-zone-data-source-%[1]d" + } } -resource "aws_service_discovery_private_dns_namespace" "test_service_discovery" { +resource "aws_service_discovery_private_dns_namespace" "test" { name = "test.acc-sd-%[1]d." vpc = "${aws_vpc.test.id}" } -data "aws_route53_zone" "service_discovery_by_vpc" { - name = "${aws_service_discovery_private_dns_namespace.test_service_discovery.name}" +data "aws_route53_zone" "test" { + name = "${aws_service_discovery_private_dns_namespace.test.name}" vpc_id = "${aws_vpc.test.id}" } `, rInt) diff --git a/aws/data_source_aws_route_table.go b/aws/data_source_aws_route_table.go index 690317dd2a2..acb4739e5bc 100644 --- a/aws/data_source_aws_route_table.go +++ b/aws/data_source_aws_route_table.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsRouteTable() *schema.Resource { @@ -19,6 +20,11 @@ func dataSourceAwsRouteTable() *schema.Resource { Optional: true, Computed: true, }, + "gateway_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "route_table_id": { Type: schema.TypeString, Optional: true, @@ -103,6 +109,11 @@ func dataSourceAwsRouteTable() *schema.Resource { Computed: true, }, + "gateway_id": { + Type: schema.TypeString, + Computed: true, + }, + "main": { Type: schema.TypeBool, Computed: true, @@ -123,22 +134,24 @@ func dataSourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error req := &ec2.DescribeRouteTablesInput{} vpcId, vpcIdOk := d.GetOk("vpc_id") subnetId, subnetIdOk := d.GetOk("subnet_id") + gatewayId, gatewayIdOk := d.GetOk("gateway_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") + if !rtbOk && !vpcIdOk && !subnetIdOk && !gatewayIdOk && !filterOk && !tagsOk { + return fmt.Errorf("One of route_table_id, vpc_id, subnet_id, gateway_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), + "route-table-id": rtbId.(string), + "vpc-id": vpcId.(string), + "association.subnet-id": subnetId.(string), + "association.gateway-id": gatewayId.(string), }, ) req.Filters = append(req.Filters, buildEC2TagFilterList( - tagsFromMap(tags.(map[string]interface{})), + keyvaluetags.New(tags.(map[string]interface{})).Ec2Tags(), )...) req.Filters = append(req.Filters, buildEC2CustomFilterList( filter.(*schema.Set), @@ -150,7 +163,7 @@ func dataSourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error 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.") + 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") @@ -161,7 +174,11 @@ func dataSourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error 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("tags", keyvaluetags.Ec2KeyValueTags(rt.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + d.Set("owner_id", rt.OwnerId) if err := d.Set("routes", dataSourceRoutesRead(rt.Routes)); err != nil { return err @@ -239,6 +256,9 @@ func dataSourceAssociationsRead(ec2Assocations []*ec2.RouteTableAssociation) []m if a.SubnetId != nil { m["subnet_id"] = *a.SubnetId } + if a.GatewayId != nil { + m["gateway_id"] = *a.GatewayId + } m["main"] = *a.Main associations = append(associations, m) } diff --git a/aws/data_source_aws_route_table_test.go b/aws/data_source_aws_route_table_test.go index 3a6780b5cb0..a25b2f3a5c5 100644 --- a/aws/data_source_aws_route_table_test.go +++ b/aws/data_source_aws_route_table_test.go @@ -10,10 +10,12 @@ func TestAccDataSourceAwsRouteTable_basic(t *testing.T) { rtResourceName := "aws_route_table.test" snResourceName := "aws_subnet.test" vpcResourceName := "aws_vpc.test" + gwResourceName := "aws_internet_gateway.test" ds1ResourceName := "data.aws_route_table.by_tag" ds2ResourceName := "data.aws_route_table.by_filter" ds3ResourceName := "data.aws_route_table.by_subnet" ds4ResourceName := "data.aws_route_table.by_id" + ds5ResourceName := "data.aws_route_table.by_gateway" tagValue := "terraform-testacc-routetable-data-source" resource.ParallelTest(t, resource.TestCase{ @@ -31,8 +33,16 @@ func TestAccDataSourceAwsRouteTable_basic(t *testing.T) { ds1ResourceName, "owner_id", rtResourceName, "owner_id"), resource.TestCheckResourceAttrPair( ds1ResourceName, "vpc_id", vpcResourceName, "id"), - resource.TestCheckResourceAttrPair( - ds1ResourceName, "associations.0.subnet_id", snResourceName, "id"), + resource.TestCheckNoResourceAttr( + ds1ResourceName, "subnet_id"), + resource.TestCheckNoResourceAttr( + ds1ResourceName, "gateway_id"), + resource.TestCheckResourceAttr( + ds1ResourceName, "associations.#", "2"), + testAccCheckListHasSomeElementAttrPair( + ds1ResourceName, "associations", "subnet_id", snResourceName, "id"), + testAccCheckListHasSomeElementAttrPair( + ds1ResourceName, "associations", "gateway_id", gwResourceName, "id"), resource.TestCheckResourceAttr( ds1ResourceName, "tags.Name", tagValue), @@ -44,8 +54,16 @@ func TestAccDataSourceAwsRouteTable_basic(t *testing.T) { ds2ResourceName, "owner_id", rtResourceName, "owner_id"), resource.TestCheckResourceAttrPair( ds2ResourceName, "vpc_id", vpcResourceName, "id"), - resource.TestCheckResourceAttrPair( - ds2ResourceName, "associations.0.subnet_id", snResourceName, "id"), + resource.TestCheckNoResourceAttr( + ds2ResourceName, "subnet_id"), + resource.TestCheckNoResourceAttr( + ds2ResourceName, "gateway_id"), + resource.TestCheckResourceAttr( + ds2ResourceName, "associations.#", "2"), + testAccCheckListHasSomeElementAttrPair( + ds2ResourceName, "associations", "subnet_id", snResourceName, "id"), + testAccCheckListHasSomeElementAttrPair( + ds2ResourceName, "associations", "gateway_id", gwResourceName, "id"), resource.TestCheckResourceAttr( ds2ResourceName, "tags.Name", tagValue), @@ -58,7 +76,15 @@ func TestAccDataSourceAwsRouteTable_basic(t *testing.T) { resource.TestCheckResourceAttrPair( ds3ResourceName, "vpc_id", vpcResourceName, "id"), resource.TestCheckResourceAttrPair( - ds3ResourceName, "associations.0.subnet_id", snResourceName, "id"), + ds3ResourceName, "subnet_id", snResourceName, "id"), + resource.TestCheckNoResourceAttr( + ds3ResourceName, "gateway_id"), + resource.TestCheckResourceAttr( + ds3ResourceName, "associations.#", "2"), + testAccCheckListHasSomeElementAttrPair( + ds3ResourceName, "associations", "subnet_id", snResourceName, "id"), + testAccCheckListHasSomeElementAttrPair( + ds3ResourceName, "associations", "gateway_id", gwResourceName, "id"), resource.TestCheckResourceAttr( ds3ResourceName, "tags.Name", tagValue), @@ -70,10 +96,39 @@ func TestAccDataSourceAwsRouteTable_basic(t *testing.T) { ds4ResourceName, "owner_id", rtResourceName, "owner_id"), resource.TestCheckResourceAttrPair( ds4ResourceName, "vpc_id", vpcResourceName, "id"), - resource.TestCheckResourceAttrPair( - ds4ResourceName, "associations.0.subnet_id", snResourceName, "id"), + resource.TestCheckNoResourceAttr( + ds4ResourceName, "subnet_id"), + resource.TestCheckNoResourceAttr( + ds4ResourceName, "gateway_id"), + resource.TestCheckResourceAttr( + ds4ResourceName, "associations.#", "2"), + testAccCheckListHasSomeElementAttrPair( + ds4ResourceName, "associations", "subnet_id", snResourceName, "id"), + testAccCheckListHasSomeElementAttrPair( + ds4ResourceName, "associations", "gateway_id", gwResourceName, "id"), resource.TestCheckResourceAttr( ds4ResourceName, "tags.Name", tagValue), + + resource.TestCheckResourceAttrPair( + ds5ResourceName, "id", rtResourceName, "id"), + resource.TestCheckResourceAttrPair( + ds5ResourceName, "route_table_id", rtResourceName, "id"), + resource.TestCheckResourceAttrPair( + ds5ResourceName, "owner_id", rtResourceName, "owner_id"), + resource.TestCheckResourceAttrPair( + ds5ResourceName, "vpc_id", vpcResourceName, "id"), + resource.TestCheckNoResourceAttr( + ds5ResourceName, "subnet_id"), + resource.TestCheckResourceAttrPair( + ds5ResourceName, "gateway_id", gwResourceName, "id"), + resource.TestCheckResourceAttr( + ds5ResourceName, "associations.#", "2"), + testAccCheckListHasSomeElementAttrPair( + ds5ResourceName, "associations", "subnet_id", snResourceName, "id"), + testAccCheckListHasSomeElementAttrPair( + ds5ResourceName, "associations", "gateway_id", gwResourceName, "id"), + resource.TestCheckResourceAttr( + ds5ResourceName, "tags.Name", tagValue), ), ExpectNonEmptyPlan: true, }, @@ -104,9 +159,6 @@ func TestAccDataSourceAwsRouteTable_main(t *testing.T) { } const testAccDataSourceAwsRouteTableGroupConfig = ` -provider "aws" { - region = "eu-central-1" -} resource "aws_vpc" "test" { cidr_block = "172.16.0.0/16" @@ -131,8 +183,20 @@ resource "aws_route_table" "test" { } resource "aws_route_table_association" "a" { - subnet_id = "${aws_subnet.test.id}" - route_table_id = "${aws_route_table.test.id}" + subnet_id = "${aws_subnet.test.id}" + route_table_id = "${aws_route_table.test.id}" +} + +resource "aws_internet_gateway" "test" { + vpc_id = "${aws_vpc.test.id}" + tags = { + Name = "terraform-testacc-routetable-data-source" + } +} + +resource "aws_route_table_association" "b" { + route_table_id = aws_route_table.test.id + gateway_id = aws_internet_gateway.test.id } data "aws_route_table" "by_filter" { @@ -140,33 +204,48 @@ data "aws_route_table" "by_filter" { name = "association.route-table-association-id" values = ["${aws_route_table_association.a.id}"] } - depends_on = ["aws_route_table_association.a"] + depends_on = [ + "aws_route_table_association.a", + "aws_route_table_association.b" + ] } data "aws_route_table" "by_tag" { tags = { Name = "${aws_route_table.test.tags["Name"]}" } - depends_on = ["aws_route_table_association.a"] + depends_on = [ + "aws_route_table_association.a", + "aws_route_table_association.b" + ] } data "aws_route_table" "by_subnet" { subnet_id = "${aws_subnet.test.id}" - depends_on = ["aws_route_table_association.a"] + depends_on = [ + "aws_route_table_association.a", + "aws_route_table_association.b" + ] } +data "aws_route_table" "by_gateway" { + gateway_id = "${aws_internet_gateway.test.id}" + depends_on = [ + "aws_route_table_association.a", + "aws_route_table_association.b" + ] +} + data "aws_route_table" "by_id" { route_table_id = "${aws_route_table.test.id}" - depends_on = ["aws_route_table_association.a"] + depends_on = [ + "aws_route_table_association.a", + "aws_route_table_association.b" + ] } ` -// Uses us-east-2, as region only has a single main route table const testAccDataSourceAwsRouteTableMainRoute = ` -provider "aws" { - region = "us-east-2" -} - resource "aws_vpc" "test" { cidr_block = "172.16.0.0/16" diff --git a/aws/data_source_aws_route_tables.go b/aws/data_source_aws_route_tables.go index 77d6eb96328..33001de5a1b 100644 --- a/aws/data_source_aws_route_tables.go +++ b/aws/data_source_aws_route_tables.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsRouteTables() *schema.Resource { @@ -48,7 +49,7 @@ func dataSourceAwsRouteTablesRead(d *schema.ResourceData, meta interface{}) erro } req.Filters = append(req.Filters, buildEC2TagFilterList( - tagsFromMap(d.Get("tags").(map[string]interface{})), + keyvaluetags.New(d.Get("tags").(map[string]interface{})).Ec2Tags(), )...) req.Filters = append(req.Filters, buildEC2CustomFilterList( diff --git a/aws/data_source_aws_s3_bucket_object.go b/aws/data_source_aws_s3_bucket_object.go index bcb1814387d..cad280b2f44 100644 --- a/aws/data_source_aws_s3_bucket_object.go +++ b/aws/data_source_aws_s3_bucket_object.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsS3BucketObject() *schema.Resource { @@ -218,15 +219,15 @@ func dataSourceAwsS3BucketObjectRead(d *schema.ResourceData, meta interface{}) e uniqueId, contentType) } - tagResp, err := conn.GetObjectTagging( - &s3.GetObjectTaggingInput{ - Bucket: aws.String(bucket), - Key: aws.String(key), - }) + tags, err := keyvaluetags.S3ObjectListTags(conn, bucket, key) + if err != nil { - return err + return fmt.Errorf("error listing tags for S3 Bucket (%s) Object (%s): %s", bucket, key, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - d.Set("tags", tagsToMapS3(tagResp.TagSet)) return nil } diff --git a/aws/data_source_aws_s3_bucket_object_test.go b/aws/data_source_aws_s3_bucket_object_test.go index 882ba63ad3a..9b942d41784 100644 --- a/aws/data_source_aws_s3_bucket_object_test.go +++ b/aws/data_source_aws_s3_bucket_object_test.go @@ -50,6 +50,30 @@ func TestAccDataSourceAWSS3BucketObject_basic(t *testing.T) { }) } +func TestAccDataSourceAWSS3BucketObject_basicViaAccessPoint(t *testing.T) { + var dsObj, rObj s3.GetObjectOutput + rName := acctest.RandomWithPrefix("tf-acc-test") + datasourceName := "data.aws_s3_bucket_object.test" + resourceName := "aws_s3_bucket_object.test" + accessPointResourceName := "aws_s3_access_point.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccAWSDataSourceS3ObjectConfig_basicViaAccessPoint(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsS3ObjectDataSourceExists(datasourceName, &dsObj), + testAccCheckAWSS3BucketObjectExists(resourceName, &rObj), + resource.TestCheckResourceAttrPair(datasourceName, "bucket", accessPointResourceName, "arn"), + resource.TestCheckResourceAttrPair(datasourceName, "key", resourceName, "key"), + ), + }, + }, + }) +} + func TestAccDataSourceAWSS3BucketObject_readableBody(t *testing.T) { rInt := acctest.RandInt() resourceOnlyConf, conf := testAccAWSDataSourceS3ObjectConfig_readableBody(rInt) @@ -255,6 +279,101 @@ func TestAccDataSourceAWSS3BucketObject_ObjectLockLegalHoldOn(t *testing.T) { }) } +func TestAccDataSourceAWSS3BucketObject_LeadingSlash(t *testing.T) { + var rObj s3.GetObjectOutput + var dsObj1, dsObj2, dsObj3 s3.GetObjectOutput + resourceName := "aws_s3_bucket_object.object" + dataSourceName1 := "data.aws_s3_bucket_object.obj1" + dataSourceName2 := "data.aws_s3_bucket_object.obj2" + dataSourceName3 := "data.aws_s3_bucket_object.obj3" + rInt := acctest.RandInt() + resourceOnlyConf, conf := testAccAWSDataSourceS3ObjectConfig_leadingSlash(rInt) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + PreventPostDestroyRefresh: true, + Steps: []resource.TestStep{ + { + Config: resourceOnlyConf, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketObjectExists(resourceName, &rObj), + ), + }, + { + Config: conf, + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsS3ObjectDataSourceExists(dataSourceName1, &dsObj1), + resource.TestCheckResourceAttr(dataSourceName1, "content_length", "3"), + resource.TestCheckResourceAttr(dataSourceName1, "content_type", "text/plain"), + resource.TestCheckResourceAttr(dataSourceName1, "etag", "a6105c0a611b41b08f1209506350279e"), + resource.TestMatchResourceAttr(dataSourceName1, "last_modified", + regexp.MustCompile("^[a-zA-Z]{3}, [0-9]+ [a-zA-Z]+ [0-9]{4} [0-9:]+ [A-Z]+$")), + resource.TestCheckResourceAttr(dataSourceName1, "body", "yes"), + testAccCheckAwsS3ObjectDataSourceExists(dataSourceName2, &dsObj2), + resource.TestCheckResourceAttr(dataSourceName2, "content_length", "3"), + resource.TestCheckResourceAttr(dataSourceName2, "content_type", "text/plain"), + resource.TestCheckResourceAttr(dataSourceName2, "etag", "a6105c0a611b41b08f1209506350279e"), + resource.TestMatchResourceAttr(dataSourceName2, "last_modified", + regexp.MustCompile("^[a-zA-Z]{3}, [0-9]+ [a-zA-Z]+ [0-9]{4} [0-9:]+ [A-Z]+$")), + resource.TestCheckResourceAttr(dataSourceName2, "body", "yes"), + testAccCheckAwsS3ObjectDataSourceExists(dataSourceName3, &dsObj3), + resource.TestCheckResourceAttr(dataSourceName3, "content_length", "3"), + resource.TestCheckResourceAttr(dataSourceName3, "content_type", "text/plain"), + resource.TestCheckResourceAttr(dataSourceName3, "etag", "a6105c0a611b41b08f1209506350279e"), + resource.TestMatchResourceAttr(dataSourceName3, "last_modified", + regexp.MustCompile("^[a-zA-Z]{3}, [0-9]+ [a-zA-Z]+ [0-9]{4} [0-9:]+ [A-Z]+$")), + resource.TestCheckResourceAttr(dataSourceName3, "body", "yes"), + ), + }, + }, + }) +} + +func TestAccDataSourceAWSS3BucketObject_MultipleSlashes(t *testing.T) { + var rObj1, rObj2 s3.GetObjectOutput + var dsObj1, dsObj2, dsObj3 s3.GetObjectOutput + resourceName1 := "aws_s3_bucket_object.object1" + resourceName2 := "aws_s3_bucket_object.object2" + dataSourceName1 := "data.aws_s3_bucket_object.obj1" + dataSourceName2 := "data.aws_s3_bucket_object.obj2" + dataSourceName3 := "data.aws_s3_bucket_object.obj3" + rInt := acctest.RandInt() + resourceOnlyConf, conf := testAccAWSDataSourceS3ObjectConfig_multipleSlashes(rInt) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + PreventPostDestroyRefresh: true, + Steps: []resource.TestStep{ + { + Config: resourceOnlyConf, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketObjectExists(resourceName1, &rObj1), + testAccCheckAWSS3BucketObjectExists(resourceName2, &rObj2), + ), + }, + { + Config: conf, + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsS3ObjectDataSourceExists(dataSourceName1, &dsObj1), + resource.TestCheckResourceAttr(dataSourceName1, "content_length", "3"), + resource.TestCheckResourceAttr(dataSourceName1, "content_type", "text/plain"), + resource.TestCheckResourceAttr(dataSourceName1, "body", "yes"), + testAccCheckAwsS3ObjectDataSourceExists(dataSourceName2, &dsObj2), + resource.TestCheckResourceAttr(dataSourceName2, "content_length", "3"), + resource.TestCheckResourceAttr(dataSourceName2, "content_type", "text/plain"), + resource.TestCheckResourceAttr(dataSourceName2, "body", "yes"), + testAccCheckAwsS3ObjectDataSourceExists(dataSourceName3, &dsObj3), + resource.TestCheckResourceAttr(dataSourceName3, "content_length", "2"), + resource.TestCheckResourceAttr(dataSourceName3, "content_type", "text/plain"), + resource.TestCheckResourceAttr(dataSourceName3, "body", "no"), + ), + }, + }, + }) +} + func testAccCheckAwsS3ObjectDataSourceExists(n string, obj *s3.GetObjectOutput) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -305,6 +424,30 @@ data "aws_s3_bucket_object" "obj" { return resources, both } +func testAccAWSDataSourceS3ObjectConfig_basicViaAccessPoint(rName string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket" "test" { + bucket = %[1]q +} + +resource "aws_s3_access_point" "test" { + bucket = "${aws_s3_bucket.test.bucket}" + name = %[1]q +} + +resource "aws_s3_bucket_object" "test" { + bucket = "${aws_s3_bucket.test.bucket}" + key = %[1]q + content = "Hello World" +} + +data "aws_s3_bucket_object" "test" { + bucket = "${aws_s3_access_point.test.arn}" + key = "${aws_s3_bucket_object.test.key}" +} +`, rName) +} + func testAccAWSDataSourceS3ObjectConfig_readableBody(randInt int) (string, string) { resources := fmt.Sprintf(` resource "aws_s3_bucket" "object_bucket" { @@ -456,3 +599,72 @@ data "aws_s3_bucket_object" "obj" { return resources, both } + +func testAccAWSDataSourceS3ObjectConfig_leadingSlash(randInt int) (string, string) { + resources := fmt.Sprintf(` +resource "aws_s3_bucket" "object_bucket" { + bucket = "tf-object-test-bucket-%d" +} +resource "aws_s3_bucket_object" "object" { + bucket = "${aws_s3_bucket.object_bucket.bucket}" + key = "//tf-testing-obj-%d-readable" + content = "yes" + content_type = "text/plain" +} +`, randInt, randInt) + + both := fmt.Sprintf(`%s +data "aws_s3_bucket_object" "obj1" { + bucket = "tf-object-test-bucket-%d" + key = "tf-testing-obj-%d-readable" +} +data "aws_s3_bucket_object" "obj2" { + bucket = "tf-object-test-bucket-%d" + key = "/tf-testing-obj-%d-readable" +} +data "aws_s3_bucket_object" "obj3" { + bucket = "tf-object-test-bucket-%d" + key = "//tf-testing-obj-%d-readable" +} +`, resources, randInt, randInt, randInt, randInt, randInt, randInt) + + return resources, both +} + +func testAccAWSDataSourceS3ObjectConfig_multipleSlashes(randInt int) (string, string) { + resources := fmt.Sprintf(` +resource "aws_s3_bucket" "object_bucket" { + bucket = "tf-object-test-bucket-%d" +} +resource "aws_s3_bucket_object" "object1" { + bucket = "${aws_s3_bucket.object_bucket.bucket}" + key = "first//second///third//" + content = "yes" + content_type = "text/plain" +} +# Without a trailing slash. +resource "aws_s3_bucket_object" "object2" { + bucket = "${aws_s3_bucket.object_bucket.bucket}" + key = "/first////second/third" + content = "no" + content_type = "text/plain" +} +`, randInt) + + both := fmt.Sprintf(`%s +data "aws_s3_bucket_object" "obj1" { + bucket = "tf-object-test-bucket-%d" + key = "first/second/third/" +} +data "aws_s3_bucket_object" "obj2" { + bucket = "tf-object-test-bucket-%d" + key = "first//second///third//" +} +data "aws_s3_bucket_object" "obj3" { + bucket = "tf-object-test-bucket-%d" + key = "first/second/third" +} +`, resources, randInt, randInt, randInt) + + return resources, both +} diff --git a/aws/data_source_aws_s3_bucket_objects_test.go b/aws/data_source_aws_s3_bucket_objects_test.go index 264c3ff79bd..221c9d57314 100644 --- a/aws/data_source_aws_s3_bucket_objects_test.go +++ b/aws/data_source_aws_s3_bucket_objects_test.go @@ -34,6 +34,31 @@ func TestAccDataSourceAWSS3BucketObjects_basic(t *testing.T) { }) } +func TestAccDataSourceAWSS3BucketObjects_basicViaAccessPoint(t *testing.T) { + rInt := acctest.RandInt() + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + PreventPostDestroyRefresh: true, + Steps: []resource.TestStep{ + { + Config: testAccAWSDataSourceS3ObjectsConfigResourcesPlusAccessPoint(rInt), // NOTE: contains no data source + // Does not need Check + }, + { + Config: testAccAWSDataSourceS3ObjectsConfigBasicViaAccessPoint(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsS3ObjectsDataSourceExists("data.aws_s3_bucket_objects.yesh"), + resource.TestCheckResourceAttr("data.aws_s3_bucket_objects.yesh", "keys.#", "2"), + resource.TestCheckResourceAttr("data.aws_s3_bucket_objects.yesh", "keys.0", "arch/navajo/north_window"), + resource.TestCheckResourceAttr("data.aws_s3_bucket_objects.yesh", "keys.1", "arch/navajo/sand_dune"), + ), + }, + }, + }) +} + func TestAccDataSourceAWSS3BucketObjects_all(t *testing.T) { rInt := acctest.RandInt() @@ -209,7 +234,7 @@ func testAccCheckAwsS3ObjectsDataSourceExists(addr string) resource.TestCheckFun func testAccAWSDataSourceS3ObjectsConfigResources(randInt int) string { return fmt.Sprintf(` resource "aws_s3_bucket" "objects_bucket" { - bucket = "tf-objects-test-bucket-%d" + bucket = "tf-acc-objects-test-bucket-%d" } resource "aws_s3_bucket_object" "object1" { @@ -256,6 +281,15 @@ resource "aws_s3_bucket_object" "object7" { `, randInt) } +func testAccAWSDataSourceS3ObjectsConfigResourcesPlusAccessPoint(randInt int) string { + return testAccAWSDataSourceS3ObjectsConfigResources(randInt) + fmt.Sprintf(` +resource "aws_s3_access_point" "test" { + bucket = "${aws_s3_bucket.objects_bucket.bucket}" + name = "tf-objects-test-access-point-%[1]d" +} +`, randInt) +} + func testAccAWSDataSourceS3ObjectsConfigBasic(randInt int) string { return fmt.Sprintf(` %s @@ -268,6 +302,16 @@ data "aws_s3_bucket_objects" "yesh" { `, testAccAWSDataSourceS3ObjectsConfigResources(randInt)) } +func testAccAWSDataSourceS3ObjectsConfigBasicViaAccessPoint(randInt int) string { + return testAccAWSDataSourceS3ObjectsConfigResourcesPlusAccessPoint(randInt) + fmt.Sprintf(` +data "aws_s3_bucket_objects" "yesh" { + bucket = "${aws_s3_access_point.test.arn}" + prefix = "arch/navajo/" + delimiter = "/" +} +`) +} + func testAccAWSDataSourceS3ObjectsConfigAll(randInt int) string { return fmt.Sprintf(` %s diff --git a/aws/data_source_aws_secretsmanager_secret.go b/aws/data_source_aws_secretsmanager_secret.go index 2aa573be3a7..898191a9d8b 100644 --- a/aws/data_source_aws_secretsmanager_secret.go +++ b/aws/data_source_aws_secretsmanager_secret.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/structure" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsSecretsManagerSecret() *schema.Resource { @@ -131,7 +132,7 @@ func dataSourceAwsSecretsManagerSecretRead(d *schema.ResourceData, meta interfac return fmt.Errorf("error setting rotation_rules: %s", err) } - if err := d.Set("tags", tagsToMapSecretsManager(output.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.SecretsmanagerKeyValueTags(output.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } diff --git a/aws/data_source_aws_sfn_activity.go b/aws/data_source_aws_sfn_activity.go new file mode 100644 index 00000000000..e7c47928f43 --- /dev/null +++ b/aws/data_source_aws_sfn_activity.go @@ -0,0 +1,108 @@ +package aws + +import ( + "fmt" + "log" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/sfn" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func dataSourceAwsSfnActivity() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAwsSfnActivityRead, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + Optional: true, + ExactlyOneOf: []string{ + "arn", + "name", + }, + }, + "arn": { + Type: schema.TypeString, + Computed: true, + Optional: true, + ExactlyOneOf: []string{ + "arn", + "name", + }, + }, + "creation_date": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataSourceAwsSfnActivityRead(d *schema.ResourceData, meta interface{}) error { + client := meta.(*AWSClient) + conn := client.sfnconn + log.Print("[DEBUG] Reading Step Function Activity") + + if nm, ok := d.GetOk("name"); ok { + name := nm.(string) + var acts []*sfn.ActivityListItem + + err := conn.ListActivitiesPages(&sfn.ListActivitiesInput{}, func(page *sfn.ListActivitiesOutput, b bool) bool { + for _, a := range page.Activities { + if name == aws.StringValue(a.Name) { + acts = append(acts, a) + } + } + return true + }) + + if err != nil { + return fmt.Errorf("Error listing activities: %s", err) + } + + if len(acts) == 0 { + return fmt.Errorf("No activity found with name %s in this region", name) + } + + if len(acts) > 1 { + return fmt.Errorf("Found more than 1 activity with name %s in this region", name) + } + + act := acts[0] + + d.SetId(*act.ActivityArn) + d.Set("name", act.Name) + d.Set("arn", act.ActivityArn) + if err := d.Set("creation_date", act.CreationDate.Format(time.RFC3339)); err != nil { + log.Printf("[DEBUG] Error setting creation_date: %s", err) + } + } + + if rnm, ok := d.GetOk("arn"); ok { + arn := rnm.(string) + params := &sfn.DescribeActivityInput{ + ActivityArn: aws.String(arn), + } + + act, err := conn.DescribeActivity(params) + if err != nil { + return fmt.Errorf("Error describing activities: %s", err) + } + + if act == nil { + return fmt.Errorf("No activity found with arn %s in this region", arn) + } + + d.SetId(*act.ActivityArn) + d.Set("name", act.Name) + d.Set("arn", act.ActivityArn) + if err := d.Set("creation_date", act.CreationDate.Format(time.RFC3339)); err != nil { + log.Printf("[DEBUG] Error setting creation_date: %s", err) + } + } + + return nil +} diff --git a/aws/data_source_aws_sfn_activity_test.go b/aws/data_source_aws_sfn_activity_test.go new file mode 100644 index 00000000000..5c7bf2174b2 --- /dev/null +++ b/aws/data_source_aws_sfn_activity_test.go @@ -0,0 +1,60 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func TestAccAWSStepFunctionsActivityDataSource(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_sfn_activity.test" + dataName := "data.aws_sfn_activity.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCheckAWSStepFunctionsActivityDataSourceConfig_ActivityArn(rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(resourceName, "id", dataName, "id"), + resource.TestCheckResourceAttrPair(resourceName, "creation_date", dataName, "creation_date"), + resource.TestCheckResourceAttrPair(resourceName, "name", dataName, "name"), + ), + }, + { + Config: testAccCheckAWSStepFunctionsActivityDataSourceConfig_ActivityName(rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(resourceName, "id", dataName, "id"), + resource.TestCheckResourceAttrPair(resourceName, "creation_date", dataName, "creation_date"), + resource.TestCheckResourceAttrPair(resourceName, "name", dataName, "name"), + ), + }, + }, + }) +} + +func testAccCheckAWSStepFunctionsActivityDataSourceConfig_ActivityArn(rName string) string { + return fmt.Sprintf(` +resource aws_sfn_activity "test" { + name = "%s" +} +data aws_sfn_activity "test" { + arn = "${aws_sfn_activity.test.id}" +} +`, rName) +} + +func testAccCheckAWSStepFunctionsActivityDataSourceConfig_ActivityName(rName string) string { + return fmt.Sprintf(` +resource aws_sfn_activity "test" { + name = "%s" +} +data aws_sfn_activity "test" { + name = "${aws_sfn_activity.test.name}" +} +`, rName) +} diff --git a/aws/data_source_aws_sfn_state_machine.go b/aws/data_source_aws_sfn_state_machine.go new file mode 100644 index 00000000000..485eee2940b --- /dev/null +++ b/aws/data_source_aws_sfn_state_machine.go @@ -0,0 +1,92 @@ +package aws + +import ( + "fmt" + "log" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/sfn" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func dataSourceAwsSfnStateMachine() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAwsSfnStateMachineRead, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "role_arn": { + Type: schema.TypeString, + Computed: true, + }, + "definition": { + Type: schema.TypeString, + Computed: true, + }, + "status": { + Type: schema.TypeString, + Computed: true, + }, + "creation_date": { + Type: schema.TypeString, + Computed: true, + }, + }, + } +} + +func dataSourceAwsSfnStateMachineRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).sfnconn + params := &sfn.ListStateMachinesInput{} + log.Printf("[DEBUG] Reading Step Function State Machine: %s", d.Id()) + + target := d.Get("name") + var arns []string + + err := conn.ListStateMachinesPages(params, func(page *sfn.ListStateMachinesOutput, lastPage bool) bool { + for _, sm := range page.StateMachines { + if *sm.Name == target { + arns = append(arns, *sm.StateMachineArn) + } + } + return true + }) + + if err != nil { + return fmt.Errorf("Error listing state machines: %s", err) + } + + if len(arns) == 0 { + return fmt.Errorf("No state machine with name %q found in this region.", target) + } + if len(arns) > 1 { + return fmt.Errorf("Multiple state machines with name %q found in this region.", target) + } + + sm, err := conn.DescribeStateMachine(&sfn.DescribeStateMachineInput{ + StateMachineArn: aws.String(arns[0]), + }) + if err != nil { + return fmt.Errorf("error describing SFN State Machine (%s): %w", arns[0], err) + } + + d.Set("definition", sm.Definition) + d.Set("name", sm.Name) + d.Set("arn", sm.StateMachineArn) + 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) + } + + d.SetId(arns[0]) + + return nil +} diff --git a/aws/data_source_aws_sfn_state_machine_test.go b/aws/data_source_aws_sfn_state_machine_test.go new file mode 100644 index 00000000000..1a423030b37 --- /dev/null +++ b/aws/data_source_aws_sfn_state_machine_test.go @@ -0,0 +1,78 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func TestAccDataSourceAwsSfnStateMachine(t *testing.T) { + rName := acctest.RandString(5) + dataSourceName := "data.aws_sfn_state_machine.test" + resourceName := "aws_sfn_state_machine.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAwsSfnStateMachineConfig(rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(resourceName, "id", dataSourceName, "arn"), + resource.TestCheckResourceAttrPair(resourceName, "creation_date", dataSourceName, "creation_date"), + resource.TestCheckResourceAttrPair(resourceName, "definition", dataSourceName, "definition"), + resource.TestCheckResourceAttrPair(resourceName, "name", dataSourceName, "name"), + resource.TestCheckResourceAttrPair(resourceName, "role_arn", dataSourceName, "role_arn"), + resource.TestCheckResourceAttrPair(resourceName, "status", dataSourceName, "status"), + ), + }, + }, + }) +} + +func testAccDataSourceAwsSfnStateMachineConfig(rName string) string { + return fmt.Sprintf(` +data "aws_region" "current" {} + +resource "aws_iam_role" "iam_for_sfn" { + name = "iam_for_sfn_%s" + + assume_role_policy = < 1 { + return fmt.Errorf("Your query returned more than one result. Please try a more specific search criteria") + } + + baseline := *filteredBaselines[0] + + d.SetId(*baseline.BaselineId) + d.Set("name", baseline.BaselineName) + d.Set("description", baseline.BaselineDescription) + d.Set("default_baseline", baseline.DefaultBaseline) + d.Set("operating_system", baseline.OperatingSystem) + + return nil +} diff --git a/aws/data_source_aws_ssm_patch_baseline_test.go b/aws/data_source_aws_ssm_patch_baseline_test.go new file mode 100644 index 00000000000..83ce5c47247 --- /dev/null +++ b/aws/data_source_aws_ssm_patch_baseline_test.go @@ -0,0 +1,84 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func TestAccAWSSsmPatchBaselineDataSource_existingBaseline(t *testing.T) { + resourceName := "data.aws_ssm_patch_baseline.test_existing" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccCheckAwsSsmPatchBaselineDataSourceConfig_existingBaseline(), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "name", "AWS-CentOSDefaultPatchBaseline"), + resource.TestCheckResourceAttr(resourceName, "description", "Default Patch Baseline for CentOS Provided by AWS."), + ), + }, + }, + }) +} + +func TestAccAWSSsmPatchBaselineDataSource_newBaseline(t *testing.T) { + resourceName := "data.aws_ssm_patch_baseline.test_new" + rName := acctest.RandomWithPrefix("tf-bl-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSSMPatchBaselineDestroy, + Steps: []resource.TestStep{ + { + Config: testAccCheckAwsSsmPatchBaselineDataSourceConfig_newBaseline(rName), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttrPair(resourceName, "name", "aws_ssm_patch_baseline.test_new", "name"), + resource.TestCheckResourceAttrPair(resourceName, "description", "aws_ssm_patch_baseline.test_new", "description"), + resource.TestCheckResourceAttrPair(resourceName, "operating_system", "aws_ssm_patch_baseline.test_new", "operating_system"), + ), + }, + }, + }) +} + +// Test against one of the default baselines created by AWS +func testAccCheckAwsSsmPatchBaselineDataSourceConfig_existingBaseline() string { + return fmt.Sprintf(` +data "aws_ssm_patch_baseline" "test_existing" { + owner = "AWS" + name_prefix = "AWS-" + operating_system = "CENTOS" +} +`) +} + +// Create a new baseline and pull it back +func testAccCheckAwsSsmPatchBaselineDataSourceConfig_newBaseline(name string) string { + return fmt.Sprintf(` +resource "aws_ssm_patch_baseline" "test_new" { + name = "%s" + operating_system = "AMAZON_LINUX_2" + description = "Test" + + approval_rule { + approve_after_days = 5 + patch_filter { + key = "CLASSIFICATION" + values = ["*"] + } + } +} + +data "aws_ssm_patch_baseline" "test_new" { + owner = "Self" + name_prefix = "${aws_ssm_patch_baseline.test_new.name}" + operating_system = "AMAZON_LINUX_2" +} +`, name) +} diff --git a/aws/data_source_aws_subnet.go b/aws/data_source_aws_subnet.go index 04a8cdeb7ea..064d3c25d3b 100644 --- a/aws/data_source_aws_subnet.go +++ b/aws/data_source_aws_subnet.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsSubnet() *schema.Resource { @@ -162,7 +163,11 @@ func dataSourceAwsSubnetRead(d *schema.ResourceData, meta interface{}) error { d.Set("cidr_block", subnet.CidrBlock) d.Set("default_for_az", subnet.DefaultForAz) d.Set("state", subnet.State) - d.Set("tags", tagsToMap(subnet.Tags)) + + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(subnet.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + d.Set("assign_ipv6_address_on_creation", subnet.AssignIpv6AddressOnCreation) d.Set("map_public_ip_on_launch", subnet.MapPublicIpOnLaunch) diff --git a/aws/data_source_aws_vpc.go b/aws/data_source_aws_vpc.go index 32c3dc58385..edd13c10c8b 100644 --- a/aws/data_source_aws_vpc.go +++ b/aws/data_source_aws_vpc.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsVpc() *schema.Resource { @@ -176,7 +177,11 @@ func dataSourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error { d.Set("instance_tenancy", vpc.InstanceTenancy) d.Set("default", vpc.IsDefault) d.Set("state", vpc.State) - d.Set("tags", tagsToMap(vpc.Tags)) + + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(vpc.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + d.Set("owner_id", vpc.OwnerId) arn := arn.ARN{ diff --git a/aws/data_source_aws_vpc_dhcp_options.go b/aws/data_source_aws_vpc_dhcp_options.go index 3680a82710c..dd53ed161d6 100644 --- a/aws/data_source_aws_vpc_dhcp_options.go +++ b/aws/data_source_aws_vpc_dhcp_options.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsVpcDhcpOptions() *schema.Resource { @@ -122,7 +123,7 @@ func dataSourceAwsVpcDhcpOptionsRead(d *schema.ResourceData, meta interface{}) e } } - if err := d.Set("tags", d.Set("tags", tagsToMap(output.DhcpOptions[0].Tags))); err != nil { + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(output.DhcpOptions[0].Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } d.Set("owner_id", output.DhcpOptions[0].OwnerId) diff --git a/aws/data_source_aws_vpc_endpoint.go b/aws/data_source_aws_vpc_endpoint.go index a77c7cf576e..8e2139e81e8 100644 --- a/aws/data_source_aws_vpc_endpoint.go +++ b/aws/data_source_aws_vpc_endpoint.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/structure" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsVpcEndpoint() *schema.Resource { @@ -36,6 +37,7 @@ func dataSourceAwsVpcEndpoint() *schema.Resource { }, }, }, + "filter": ec2CustomFiltersSchema(), "id": { Type: schema.TypeString, Optional: true, @@ -125,6 +127,12 @@ func dataSourceAwsVpcEndpointRead(d *schema.ResourceData, meta interface{}) erro "service-name": d.Get("service_name").(string), }, ) + req.Filters = append(req.Filters, buildEC2TagFilterList( + keyvaluetags.New(d.Get("tags").(map[string]interface{})).Ec2Tags(), + )...) + 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 @@ -200,7 +208,7 @@ func dataSourceAwsVpcEndpointRead(d *schema.ResourceData, meta interface{}) erro if err != nil { return fmt.Errorf("error setting subnet_ids: %s", err) } - err = d.Set("tags", tagsToMap(vpce.Tags)) + err = d.Set("tags", keyvaluetags.Ec2KeyValueTags(vpce.Tags).IgnoreAws().Map()) if err != nil { return fmt.Errorf("error setting tags: %s", err) } diff --git a/aws/data_source_aws_vpc_endpoint_service.go b/aws/data_source_aws_vpc_endpoint_service.go index 63a28a0673c..53af9811123 100644 --- a/aws/data_source_aws_vpc_endpoint_service.go +++ b/aws/data_source_aws_vpc_endpoint_service.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsVpcEndpointService() *schema.Resource { @@ -137,7 +138,7 @@ func dataSourceAwsVpcEndpointServiceRead(d *schema.ResourceData, meta interface{ d.Set("private_dns_name", sd.PrivateDnsName) d.Set("service_id", sd.ServiceId) d.Set("service_type", sd.ServiceType[0].ServiceType) - err = d.Set("tags", tagsToMap(sd.Tags)) + err = d.Set("tags", keyvaluetags.Ec2KeyValueTags(sd.Tags).IgnoreAws().Map()) if err != nil { return fmt.Errorf("error setting tags: %s", err) } diff --git a/aws/data_source_aws_vpc_endpoint_test.go b/aws/data_source_aws_vpc_endpoint_test.go index 350ecc808a7..0f19a277545 100644 --- a/aws/data_source_aws_vpc_endpoint_test.go +++ b/aws/data_source_aws_vpc_endpoint_test.go @@ -64,6 +64,62 @@ func TestAccDataSourceAwsVpcEndpoint_byId(t *testing.T) { }) } +func TestAccDataSourceAwsVpcEndpoint_byFilter(t *testing.T) { + datasourceName := "data.aws_vpc_endpoint.test" + rName := fmt.Sprintf("tf-testacc-vpce-%s", acctest.RandStringFromCharSet(16, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAwsVpcEndpointConfig_byFilter(rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(datasourceName, "vpc_endpoint_type", "Gateway"), + resource.TestCheckResourceAttrSet(datasourceName, "prefix_list_id"), + resource.TestCheckResourceAttrSet(datasourceName, "cidr_blocks.#"), + resource.TestCheckResourceAttr(datasourceName, "route_table_ids.#", "0"), + resource.TestCheckResourceAttr(datasourceName, "subnet_ids.#", "0"), + resource.TestCheckResourceAttr(datasourceName, "network_interface_ids.#", "0"), + resource.TestCheckResourceAttr(datasourceName, "security_group_ids.#", "0"), + resource.TestCheckResourceAttr(datasourceName, "private_dns_enabled", "false"), + resource.TestCheckResourceAttr(datasourceName, "requester_managed", "false"), + resource.TestCheckResourceAttr(datasourceName, "tags.%", "0"), + testAccCheckResourceAttrAccountID(datasourceName, "owner_id"), + ), + }, + }, + }) +} + +func TestAccDataSourceAwsVpcEndpoint_byTags(t *testing.T) { + datasourceName := "data.aws_vpc_endpoint.test" + rName := fmt.Sprintf("tf-testacc-vpce-%s", acctest.RandStringFromCharSet(16, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAwsVpcEndpointConfig_byTags(rName), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttr(datasourceName, "vpc_endpoint_type", "Gateway"), + resource.TestCheckResourceAttrSet(datasourceName, "prefix_list_id"), + resource.TestCheckResourceAttrSet(datasourceName, "cidr_blocks.#"), + resource.TestCheckResourceAttr(datasourceName, "route_table_ids.#", "0"), + resource.TestCheckResourceAttr(datasourceName, "subnet_ids.#", "0"), + resource.TestCheckResourceAttr(datasourceName, "network_interface_ids.#", "0"), + resource.TestCheckResourceAttr(datasourceName, "security_group_ids.#", "0"), + resource.TestCheckResourceAttr(datasourceName, "private_dns_enabled", "false"), + resource.TestCheckResourceAttr(datasourceName, "requester_managed", "false"), + resource.TestCheckResourceAttr(datasourceName, "tags.%", "3"), + testAccCheckResourceAttrAccountID(datasourceName, "owner_id"), + ), + }, + }, + }) +} + func TestAccDataSourceAwsVpcEndpoint_gatewayWithRouteTableAndTags(t *testing.T) { datasourceName := "data.aws_vpc_endpoint.test" rName := fmt.Sprintf("tf-testacc-vpce-%s", acctest.RandStringFromCharSet(16, acctest.CharSetAlphaNum)) @@ -170,6 +226,67 @@ data "aws_vpc_endpoint" "test" { `, rName) } +func testAccDataSourceAwsVpcEndpointConfig_byFilter(rName string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + tags = { + Name = %[1]q + } +} + +data "aws_region" "current" {} + +resource "aws_vpc_endpoint" "test" { + vpc_id = "${aws_vpc.test.id}" + service_name = "com.amazonaws.${data.aws_region.current.name}.s3" +} + +data "aws_vpc_endpoint" "test" { + filter { + name = "vpc-endpoint-id" + values = ["${aws_vpc_endpoint.test.id}"] + } +} +`, rName) +} + +func testAccDataSourceAwsVpcEndpointConfig_byTags(rName string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + tags = { + Name = %[1]q + } +} + +data "aws_region" "current" {} + +resource "aws_vpc_endpoint" "test" { + vpc_id = "${aws_vpc.test.id}" + service_name = "com.amazonaws.${data.aws_region.current.name}.s3" + + tags = { + Key1 = "Value1" + Key2 = "Value2" + Key3 = "Value3" + } +} + +data "aws_vpc_endpoint" "test" { + vpc_id = "${aws_vpc_endpoint.test.vpc_id}" + + tags = { + Key1 = "Value1" + Key2 = "Value2" + Key3 = "Value3" + } +} +`, rName) +} + func testAccDataSourceAwsVpcEndpointConfig_gatewayWithRouteTableAndTags(rName string) string { return fmt.Sprintf(` resource "aws_vpc" "test" { diff --git a/aws/data_source_aws_vpn_gateway.go b/aws/data_source_aws_vpn_gateway.go index b1d21a0dd86..22d5c40294e 100644 --- a/aws/data_source_aws_vpn_gateway.go +++ b/aws/data_source_aws_vpn_gateway.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dataSourceAwsVpnGateway() *schema.Resource { @@ -77,7 +78,7 @@ func dataSourceAwsVpnGatewayRead(d *schema.ResourceData, meta interface{}) error )...) } req.Filters = append(req.Filters, buildEC2TagFilterList( - tagsFromMap(d.Get("tags").(map[string]interface{})), + keyvaluetags.New(d.Get("tags").(map[string]interface{})).Ec2Tags(), )...) req.Filters = append(req.Filters, buildEC2CustomFilterList( d.Get("filter").(*schema.Set), @@ -105,7 +106,10 @@ func dataSourceAwsVpnGatewayRead(d *schema.ResourceData, meta interface{}) error d.Set("state", vgw.State) d.Set("availability_zone", vgw.AvailabilityZone) d.Set("amazon_side_asn", strconv.FormatInt(aws.Int64Value(vgw.AmazonSideAsn), 10)) - d.Set("tags", tagsToMap(vgw.Tags)) + + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(vgw.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } for _, attachment := range vgw.VpcAttachments { if *attachment.State == "attached" { diff --git a/aws/data_source_aws_waf_rate_based_rule.go b/aws/data_source_aws_waf_rate_based_rule.go new file mode 100644 index 00000000000..502d82886c1 --- /dev/null +++ b/aws/data_source_aws_waf_rate_based_rule.go @@ -0,0 +1,60 @@ +package aws + +import ( + "fmt" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/waf" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func dataSourceAwsWafRateBasedRule() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAwsWafRateBasedRuleRead, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + }, + }, + } +} + +func dataSourceAwsWafRateBasedRuleRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).wafconn + name := d.Get("name").(string) + + rules := make([]*waf.RuleSummary, 0) + // ListRulesInput does not have a name parameter for filtering + input := &waf.ListRateBasedRulesInput{} + for { + output, err := conn.ListRateBasedRules(input) + if err != nil { + return fmt.Errorf("error reading WAF Rate Based Rules: %s", err) + } + for _, rule := range output.Rules { + if aws.StringValue(rule.Name) == name { + rules = append(rules, rule) + } + } + + if output.NextMarker == nil { + break + } + input.NextMarker = output.NextMarker + } + + if len(rules) == 0 { + return fmt.Errorf("WAF Rate Based Rules not found for name: %s", name) + } + + if len(rules) > 1 { + return fmt.Errorf("multiple WAF Rate Based Rules found for name: %s", name) + } + + rule := rules[0] + + d.SetId(aws.StringValue(rule.RuleId)) + + return nil +} diff --git a/aws/data_source_aws_waf_rate_based_rule_test.go b/aws/data_source_aws_waf_rate_based_rule_test.go new file mode 100644 index 00000000000..f6642488f53 --- /dev/null +++ b/aws/data_source_aws_waf_rate_based_rule_test.go @@ -0,0 +1,55 @@ +package aws + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "regexp" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func TestAccDataSourceAwsWafRateBasedRule_Basic(t *testing.T) { + name := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_waf_rate_based_rule.wafrule" + datasourceName := "data.aws_waf_rate_based_rule.wafrule" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAwsWafRateBasedRuleConfig_NonExistent, + ExpectError: regexp.MustCompile(`WAF Rate Based Rules not found`), + }, + { + Config: testAccDataSourceAwsWafRateBasedRuleConfig_Name(name), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(datasourceName, "id", resourceName, "id"), + resource.TestCheckResourceAttrPair(datasourceName, "name", resourceName, "name"), + ), + }, + }, + }) +} + +func testAccDataSourceAwsWafRateBasedRuleConfig_Name(name string) string { + return fmt.Sprintf(` +resource "aws_waf_rate_based_rule" "wafrule" { + name = %[1]q + metric_name = "WafruleTest" + rate_key = "IP" + rate_limit = 2000 +} + +data "aws_waf_rate_based_rule" "wafrule" { + name = "${aws_waf_rate_based_rule.wafrule.name}" +} +`, name) +} + +const testAccDataSourceAwsWafRateBasedRuleConfig_NonExistent = ` +data "aws_waf_rate_based_rule" "wafrule" { + name = "tf-acc-test-does-not-exist" +} +` diff --git a/aws/data_source_aws_wafregional_rate_based_rule.go b/aws/data_source_aws_wafregional_rate_based_rule.go new file mode 100644 index 00000000000..8cf1187a915 --- /dev/null +++ b/aws/data_source_aws_wafregional_rate_based_rule.go @@ -0,0 +1,60 @@ +package aws + +import ( + "fmt" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/waf" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func dataSourceAwsWafRegionalRateBasedRule() *schema.Resource { + return &schema.Resource{ + Read: dataSourceAwsWafRegionalRateBasedRuleRead, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + }, + }, + } +} + +func dataSourceAwsWafRegionalRateBasedRuleRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).wafregionalconn + name := d.Get("name").(string) + + rules := make([]*waf.RuleSummary, 0) + // ListRulesInput does not have a name parameter for filtering + input := &waf.ListRateBasedRulesInput{} + for { + output, err := conn.ListRateBasedRules(input) + if err != nil { + return fmt.Errorf("error reading WAF Rate Based Rules: %s", err) + } + for _, rule := range output.Rules { + if aws.StringValue(rule.Name) == name { + rules = append(rules, rule) + } + } + + if output.NextMarker == nil { + break + } + input.NextMarker = output.NextMarker + } + + if len(rules) == 0 { + return fmt.Errorf("WAF Rate Based Rules not found for name: %s", name) + } + + if len(rules) > 1 { + return fmt.Errorf("multiple WAF Rate Based Rules found for name: %s", name) + } + + rule := rules[0] + + d.SetId(aws.StringValue(rule.RuleId)) + + return nil +} diff --git a/aws/data_source_aws_wafregional_rate_based_rule_test.go b/aws/data_source_aws_wafregional_rate_based_rule_test.go new file mode 100644 index 00000000000..5002b60ff7f --- /dev/null +++ b/aws/data_source_aws_wafregional_rate_based_rule_test.go @@ -0,0 +1,55 @@ +package aws + +import ( + "fmt" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "regexp" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +func TestAccDataSourceAwsWafRegionalRateBasedRule_Basic(t *testing.T) { + name := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_wafregional_rate_based_rule.wafrule" + datasourceName := "data.aws_wafregional_rate_based_rule.wafrule" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccDataSourceAwsWafRegionalRateBasedRuleConfig_NonExistent, + ExpectError: regexp.MustCompile(`WAF Rate Based Rules not found`), + }, + { + Config: testAccDataSourceAwsWafRegionalRateBasedRuleConfig_Name(name), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrPair(datasourceName, "id", resourceName, "id"), + resource.TestCheckResourceAttrPair(datasourceName, "name", resourceName, "name"), + ), + }, + }, + }) +} + +func testAccDataSourceAwsWafRegionalRateBasedRuleConfig_Name(name string) string { + return fmt.Sprintf(` +resource "aws_wafregional_rate_based_rule" "wafrule" { + name = %[1]q + metric_name = "WafruleTest" + rate_key = "IP" + rate_limit = 2000 +} + +data "aws_wafregional_rate_based_rule" "wafrule" { + name = "${aws_wafregional_rate_based_rule.wafrule.name}" +} +`, name) +} + +const testAccDataSourceAwsWafRegionalRateBasedRuleConfig_NonExistent = ` +data "aws_wafregional_rate_based_rule" "wafrule" { + name = "tf-acc-test-does-not-exist" +} +` diff --git a/aws/data_source_aws_workspaces_bundle_test.go b/aws/data_source_aws_workspaces_bundle_test.go index bb954b72d5f..34701b2b87b 100644 --- a/aws/data_source_aws_workspaces_bundle_test.go +++ b/aws/data_source_aws_workspaces_bundle_test.go @@ -20,7 +20,7 @@ func TestAccDataSourceAwsWorkspaceBundle_basic(t *testing.T) { resource.TestCheckResourceAttr(dataSourceName, "bundle_id", "wsb-b0s22j3d7"), resource.TestCheckResourceAttr(dataSourceName, "compute_type.#", "1"), resource.TestCheckResourceAttr(dataSourceName, "compute_type.0.name", "PERFORMANCE"), - resource.TestCheckResourceAttr(dataSourceName, "description", "Windows 7 Experience provided by Windows Server 2008 R2, 2 vCPU, 7.5GiB Memory, 100GB Storage"), + resource.TestCheckResourceAttrSet(dataSourceName, "description"), resource.TestCheckResourceAttr(dataSourceName, "name", "Performance with Windows 7"), resource.TestCheckResourceAttr(dataSourceName, "owner", "Amazon"), resource.TestCheckResourceAttr(dataSourceName, "root_storage.#", "1"), diff --git a/aws/datasync.go b/aws/datasync.go index 046765d60f8..f81403cc9e9 100644 --- a/aws/datasync.go +++ b/aws/datasync.go @@ -33,6 +33,20 @@ func expandDataSyncEc2Config(l []interface{}) *datasync.Ec2Config { return ec2Config } +func expandDataSyncSmbMountOptions(l []interface{}) *datasync.SmbMountOptions { + if len(l) == 0 || l[0] == nil { + return nil + } + + m := l[0].(map[string]interface{}) + + smbMountOptions := &datasync.SmbMountOptions{ + Version: aws.String(m["version"].(string)), + } + + return smbMountOptions +} + func expandDataSyncOnPremConfig(l []interface{}) *datasync.OnPremConfig { if len(l) == 0 || l[0] == nil { return nil @@ -99,6 +113,18 @@ func flattenDataSyncEc2Config(ec2Config *datasync.Ec2Config) []interface{} { return []interface{}{m} } +func flattenDataSyncSmbMountOptions(mountOptions *datasync.SmbMountOptions) []interface{} { + if mountOptions == nil { + return []interface{}{} + } + + m := map[string]interface{}{ + "version": aws.StringValue(mountOptions.Version), + } + + return []interface{}{m} +} + func flattenDataSyncOnPremConfig(onPremConfig *datasync.OnPremConfig) []interface{} { if onPremConfig == nil { return []interface{}{} diff --git a/aws/datasync_tags.go b/aws/datasync_tags.go deleted file mode 100644 index 037d29d6dcc..00000000000 --- a/aws/datasync_tags.go +++ /dev/null @@ -1,63 +0,0 @@ -package aws - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/datasync" -) - -// dataSyncTagsDiff 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 dataSyncTagsDiff(oldTags, newTags []*datasync.TagListEntry) ([]*datasync.TagListEntry, []*datasync.TagListEntry) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*datasync.TagListEntry - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } - } - - return expandDataSyncTagListEntry(create), remove -} - -func dataSyncTagsKeys(tags []*datasync.TagListEntry) []*string { - keys := make([]*string, 0) - - for _, tag := range tags { - if tag == nil { - continue - } - keys = append(keys, tag.Key) - } - - return keys -} - -func expandDataSyncTagListEntry(m map[string]interface{}) []*datasync.TagListEntry { - result := []*datasync.TagListEntry{} - for k, v := range m { - result = append(result, &datasync.TagListEntry{ - Key: aws.String(k), - Value: aws.String(v.(string)), - }) - } - - return result -} - -func flattenDataSyncTagListEntry(ts []*datasync.TagListEntry) map[string]string { - result := map[string]string{} - for _, t := range ts { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - return result -} diff --git a/aws/datasync_tags_test.go b/aws/datasync_tags_test.go deleted file mode 100644 index c5a6e9d2886..00000000000 --- a/aws/datasync_tags_test.go +++ /dev/null @@ -1,57 +0,0 @@ -package aws - -import ( - "reflect" - "testing" -) - -func TestDataSyncTagsDiff(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - create, remove := dataSyncTagsDiff(expandDataSyncTagListEntry(tc.Old), expandDataSyncTagListEntry(tc.New)) - createMap := flattenDataSyncTagListEntry(create) - removeMap := flattenDataSyncTagListEntry(remove) - if !reflect.DeepEqual(createMap, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, createMap) - } - if !reflect.DeepEqual(removeMap, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, removeMap) - } - } -} diff --git a/aws/dx_vif.go b/aws/dx_vif.go index e475a533b63..ce2394ccdcb 100644 --- a/aws/dx_vif.go +++ b/aws/dx_vif.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/directconnect" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func dxVirtualInterfaceRead(id string, conn *directconnect.DirectConnect) (*directconnect.VirtualInterface, error) { @@ -35,12 +36,17 @@ func dxVirtualInterfaceUpdate(d *schema.ResourceData, meta interface{}) error { log.Printf("[DEBUG] Modifying Direct Connect virtual interface attributes: %s", req) _, err := conn.UpdateVirtualInterfaceAttributes(req) if err != nil { - return fmt.Errorf("error modifying Direct Connect virtual interface (%s) attributes, error: %s", d.Id(), err) + return fmt.Errorf("error modifying Direct Connect virtual interface (%s) attributes: %s", d.Id(), err) } } - if err := setTagsDX(conn, d, d.Get("arn").(string)); err != nil { - return fmt.Errorf("error setting Direct Connect virtual interface (%s) tags: %s", d.Id(), err) + arn := d.Get("arn").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.DirectconnectUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating Direct Connect virtual interface (%s) tags: %s", arn, err) + } } return nil diff --git a/aws/ec2_filters.go b/aws/ec2_filters.go index a5d8a994c4b..4d231dc003d 100644 --- a/aws/ec2_filters.go +++ b/aws/ec2_filters.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) // buildEC2AttributeFilterList takes a flat map of scalar attributes (most @@ -90,6 +91,49 @@ func buildEC2TagFilterList(tags []*ec2.Tag) []*ec2.Filter { return filters } +// ec2AttributeFiltersFromMultimap returns an array of EC2 Filter objects to be used when listing resources. +// +// The keys of the specified map are the resource attributes names used in the filter - see the documentation +// for the relevant "Describe" action for a list of the valid names. The resource must match all the filters +// to be included in the result. +// The values of the specified map are lists of resource attribute values used in the filter. The resource can +// match any of the filter values to be included in the result. +// See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Filtering.html#Filtering_Resources_CLI for more details. +func ec2AttributeFiltersFromMultimap(m map[string][]string) []*ec2.Filter { + if len(m) == 0 { + return nil + } + + filters := []*ec2.Filter{} + for k, v := range m { + filters = append(filters, &ec2.Filter{ + Name: aws.String(k), + Values: aws.StringSlice(v), + }) + } + + return filters +} + +// ec2TagFiltersFromMap returns an array of EC2 Filter objects to be used when listing resources. +// +// The filters represent exact matches for all the resource tags in the given key/value map. +func ec2TagFiltersFromMap(m map[string]interface{}) []*ec2.Filter { + if len(m) == 0 { + return nil + } + + filters := []*ec2.Filter{} + for _, tag := range keyvaluetags.New(m).IgnoreAws().Ec2Tags() { + filters = append(filters, &ec2.Filter{ + Name: aws.String(fmt.Sprintf("tag:%s", aws.StringValue(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 diff --git a/aws/ec2_transit_gateway.go b/aws/ec2_transit_gateway.go index 740eccf1f8d..236ea3e2830 100644 --- a/aws/ec2_transit_gateway.go +++ b/aws/ec2_transit_gateway.go @@ -394,45 +394,6 @@ func ec2TransitGatewayVpcAttachmentRefreshFunc(conn *ec2.EC2, transitGatewayAtta } } -func expandEc2TransitGatewayTagSpecifications(m map[string]interface{}) []*ec2.TagSpecification { - if len(m) == 0 { - return nil - } - - return []*ec2.TagSpecification{ - { - ResourceType: aws.String("transit-gateway"), - Tags: tagsFromMap(m), - }, - } -} - -func expandEc2TransitGatewayAttachmentTagSpecifications(m map[string]interface{}) []*ec2.TagSpecification { - if len(m) == 0 { - return nil - } - - return []*ec2.TagSpecification{ - { - ResourceType: aws.String("transit-gateway-attachment"), - Tags: tagsFromMap(m), - }, - } -} - -func expandEc2TransitGatewayRouteTableTagSpecifications(m map[string]interface{}) []*ec2.TagSpecification { - if len(m) == 0 { - return nil - } - - return []*ec2.TagSpecification{ - { - ResourceType: aws.String("transit-gateway-route-table"), - Tags: tagsFromMap(m), - }, - } -} - func waitForEc2TransitGatewayCreation(conn *ec2.EC2, transitGatewayID string) error { stateConf := &resource.StateChangeConf{ Pending: []string{ec2.TransitGatewayStatePending}, diff --git a/aws/iam_policy_model.go b/aws/iam_policy_model.go index 8726c082663..79e38e21f75 100644 --- a/aws/iam_policy_model.go +++ b/aws/iam_policy_model.go @@ -94,13 +94,28 @@ func (ps IAMPolicyStatementPrincipalSet) MarshalJSON() ([]byte, error) { for _, p := range ps { switch i := p.Identifiers.(type) { case []string: - if _, ok := raw[p.Type]; !ok { + switch v := raw[p.Type].(type) { + case nil: raw[p.Type] = make([]string, 0, len(i)) + case string: + // Convert to []string to prevent panic + raw[p.Type] = make([]string, 0, len(i)+1) + raw[p.Type] = append(raw[p.Type].([]string), v) } sort.Sort(sort.Reverse(sort.StringSlice(i))) raw[p.Type] = append(raw[p.Type].([]string), i...) case string: - raw[p.Type] = i + switch v := raw[p.Type].(type) { + case nil: + raw[p.Type] = i + case string: + // Convert to []string to stop drop of principals + raw[p.Type] = make([]string, 0, 2) + raw[p.Type] = append(raw[p.Type].([]string), v) + raw[p.Type] = append(raw[p.Type].([]string), i) + case []string: + raw[p.Type] = append(raw[p.Type].([]string), i) + } default: return []byte{}, fmt.Errorf("Unsupported data type %T for IAMPolicyStatementPrincipalSet", i) } diff --git a/aws/import_aws_s3_bucket.go b/aws/import_aws_s3_bucket.go index b1702011218..987bb180d14 100644 --- a/aws/import_aws_s3_bucket.go +++ b/aws/import_aws_s3_bucket.go @@ -33,7 +33,7 @@ func resourceAwsS3BucketImportState( pData.SetId(d.Id()) pData.SetType("aws_s3_bucket_policy") pData.Set("bucket", d.Id()) - pData.Set("policy", pol) + pData.Set("policy", pol.Policy) results = append(results, pData) return results, nil diff --git a/aws/import_aws_security_group.go b/aws/import_aws_security_group.go index 8226566da8f..de7ceebab8a 100644 --- a/aws/import_aws_security_group.go +++ b/aws/import_aws_security_group.go @@ -3,8 +3,10 @@ package aws import ( "fmt" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/naming" ) // Security group import fans out to multiple resources due to the @@ -25,6 +27,11 @@ func resourceAwsSecurityGroupImportState( } sg := sgRaw.(*ec2.SecurityGroup) + // Perform nil check to avoid ImportStateVerify difference when unconfigured + if namePrefix := naming.NamePrefixFromName(aws.StringValue(sg.GroupName)); namePrefix != nil { + d.Set("name_prefix", namePrefix) + } + // Start building our results results := make([]*schema.ResourceData, 1, 1+len(sg.IpPermissions)+len(sg.IpPermissionsEgress)) diff --git a/aws/internal/keyvaluetags/README.md b/aws/internal/keyvaluetags/README.md index 127195a4369..681ddad9e73 100644 --- a/aws/internal/keyvaluetags/README.md +++ b/aws/internal/keyvaluetags/README.md @@ -12,6 +12,8 @@ Some AWS Go SDK services that have common tag listing functionality (such as `Li Some AWS Go SDK services that have common tagging update functionality (such as `TagResource` and `UntagResource` API calls), also have auto-generated update functions. For more information about this code generation, see the [`generators/updatetags` README](generators/updatetags/README.md). +Any tagging functions that cannot be generated should be hand implemented in a service-specific source file (e.g. `iam_tags.go`) and follow the format of similar generated code wherever possible. The first line of the source file should be `// +build !generate`. This prevents the file's inclusion during the code generation phase. + ## Code Structure ```text @@ -20,9 +22,11 @@ aws/internal/keyvaluetags │ ├── listtags (generates list_tags_gen.go) │ ├── servicetags (generates service_tags_gen.go) │ └── updatetags (generates update_tags_gen.go) +├── key_value_tags_test.go (unit tests for core logic) ├── key_value_tags.go (core logic) ├── list_tags_gen.go (generated AWS Go SDK service list tag functions) ├── service_generation_customizations.go (shared AWS Go SDK service customizations for generators) ├── service_tags_gen.go (generated AWS Go SDK service conversion functions) -└── update_tags_gen.go (generated AWS Go SDK service tagging update functions) +├── update_tags_gen.go (generated AWS Go SDK service tagging update functions) +└── _tags.go (any service-specific functions that cannot be generated) ``` diff --git a/aws/internal/keyvaluetags/generators/listtags/main.go b/aws/internal/keyvaluetags/generators/listtags/main.go index 813fbc19194..dca74d9e67f 100644 --- a/aws/internal/keyvaluetags/generators/listtags/main.go +++ b/aws/internal/keyvaluetags/generators/listtags/main.go @@ -17,6 +17,8 @@ import ( const filename = `list_tags_gen.go` var serviceNames = []string{ + "accessanalyzer", + "acm", "acmpca", "amplify", "appmesh", @@ -24,20 +26,27 @@ var serviceNames = []string{ "appsync", "athena", "backup", + "cloudfront", "cloudhsmv2", + "cloudtrail", "cloudwatch", "cloudwatchevents", + "cloudwatchlogs", "codecommit", "codedeploy", "codepipeline", + "codestarnotifications", "cognitoidentity", "cognitoidentityprovider", "configservice", "databasemigrationservice", + "dataexchange", "datasync", "dax", "devicefarm", + "directconnect", "directoryservice", + "dlm", "docdb", "dynamodb", "ecr", @@ -47,21 +56,29 @@ var serviceNames = []string{ "elasticache", "elasticbeanstalk", "elasticsearchservice", + "elb", + "elbv2", "firehose", "fsx", + "gamelift", + "glacier", "glue", "guardduty", + "greengrass", + "imagebuilder", "inspector", "iot", "iotanalytics", "iotevents", "kafka", + "kinesis", "kinesisanalytics", "kinesisanalyticsv2", "kms", "lambda", "licensemanager", "mediaconnect", + "mediaconvert", "medialive", "mediapackage", "mediastore", @@ -69,16 +86,25 @@ var serviceNames = []string{ "neptune", "opsworks", "organizations", + "pinpoint", + "qldb", + "quicksight", "rds", + "resourcegroups", + "route53", "route53resolver", "sagemaker", "securityhub", "sfn", "sns", + "sqs", "ssm", "storagegateway", "swf", "transfer", + "waf", + "wafregional", + "wafv2", "workspaces", } @@ -94,12 +120,14 @@ func main() { ServiceNames: serviceNames, } templateFuncMap := template.FuncMap{ - "ClientType": keyvaluetags.ServiceClientType, - "ListTagsFunction": ServiceListTagsFunction, - "ListTagsInputIdentifierField": ServiceListTagsInputIdentifierField, - "ListTagsInputResourceTypeField": ServiceListTagsInputResourceTypeField, - "ListTagsOutputTagsField": ServiceListTagsOutputTagsField, - "Title": strings.Title, + "ClientType": keyvaluetags.ServiceClientType, + "ListTagsFunction": ServiceListTagsFunction, + "ListTagsInputIdentifierField": ServiceListTagsInputIdentifierField, + "ListTagsInputIdentifierRequiresSlice": ServiceListTagsInputIdentifierRequiresSlice, + "ListTagsInputResourceTypeField": ServiceListTagsInputResourceTypeField, + "ListTagsOutputTagsField": ServiceListTagsOutputTagsField, + "TagPackage": keyvaluetags.ServiceTagPackage, + "Title": strings.Title, } tmpl, err := template.New("listtags").Funcs(templateFuncMap).Parse(templateBody) @@ -153,8 +181,12 @@ import ( // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. func {{ . | Title }}ListTags(conn {{ . | ClientType }}, identifier string{{ if . | ListTagsInputResourceTypeField }}, resourceType string{{ end }}) (KeyValueTags, error) { - input := &{{ . }}.{{ . | ListTagsFunction }}Input{ + input := &{{ . | TagPackage }}.{{ . | ListTagsFunction }}Input{ + {{- if . | ListTagsInputIdentifierRequiresSlice }} + {{ . | ListTagsInputIdentifierField }}: aws.StringSlice([]string{identifier}), + {{- else }} {{ . | ListTagsInputIdentifierField }}: aws.String(identifier), + {{- end }} {{- if . | ListTagsInputResourceTypeField }} {{ . | ListTagsInputResourceTypeField }}: aws.String(resourceType), {{- end }} @@ -174,24 +206,40 @@ func {{ . | Title }}ListTags(conn {{ . | ClientType }}, identifier string{{ if . // ServiceListTagsFunction determines the service tagging function. func ServiceListTagsFunction(serviceName string) string { switch serviceName { + case "acm": + return "ListTagsForCertificate" case "acmpca": return "ListTags" case "backup": return "ListTags" case "cloudhsmv2": return "ListTags" + case "cloudtrail": + return "ListTags" + case "cloudwatchlogs": + return "ListTagsLogGroup" case "dax": return "ListTags" + case "directconnect": + return "DescribeTags" case "dynamodb": return "ListTagsOfResource" case "efs": return "DescribeTags" case "elasticsearchservice": return "ListTags" + case "elb": + return "DescribeTags" + case "elbv2": + return "DescribeTags" case "firehose": return "ListTagsForDeliveryStream" + case "glacier": + return "ListTagsForVault" case "glue": return "GetTags" + case "kinesis": + return "ListTagsForStream" case "kms": return "ListResourceTags" case "lambda": @@ -202,8 +250,12 @@ func ServiceListTagsFunction(serviceName string) string { return "ListTags" case "redshift": return "DescribeTags" + case "resourcegroups": + return "GetTags" case "sagemaker": return "ListTags" + case "sqs": + return "ListQueueTags" case "workspaces": return "DescribeTags" default: @@ -214,20 +266,32 @@ func ServiceListTagsFunction(serviceName string) string { // ServiceListTagsInputIdentifierField determines the service tag identifier field. func ServiceListTagsInputIdentifierField(serviceName string) string { switch serviceName { + case "acm": + return "CertificateArn" case "acmpca": return "CertificateAuthorityArn" case "athena": return "ResourceARN" + case "cloudfront": + return "Resource" case "cloudhsmv2": return "ResourceId" + case "cloudtrail": + return "ResourceIdList" case "cloudwatch": return "ResourceARN" case "cloudwatchevents": return "ResourceARN" + case "cloudwatchlogs": + return "LogGroupName" + case "codestarnotifications": + return "Arn" case "dax": return "ResourceName" case "devicefarm": return "ResourceARN" + case "directconnect": + return "ResourceArns" case "directoryservice": return "ResourceId" case "docdb": @@ -238,10 +302,20 @@ func ServiceListTagsInputIdentifierField(serviceName string) string { return "ResourceName" case "elasticsearchservice": return "ARN" + case "elb": + return "LoadBalancerNames" + case "elbv2": + return "ResourceArns" case "firehose": return "DeliveryStreamName" case "fsx": return "ResourceARN" + case "gamelift": + return "ResourceARN" + case "glacier": + return "VaultName" + case "kinesis": + return "StreamName" case "kinesisanalytics": return "ResourceARN" case "kinesisanalyticsv2": @@ -250,6 +324,8 @@ func ServiceListTagsInputIdentifierField(serviceName string) string { return "KeyId" case "lambda": return "Resource" + case "mediaconvert": + return "Arn" case "mediastore": return "Resource" case "neptune": @@ -260,6 +336,12 @@ func ServiceListTagsInputIdentifierField(serviceName string) string { return "ResourceName" case "redshift": return "ResourceName" + case "resourcegroups": + return "Arn" + case "route53": + return "ResourceId" + case "sqs": + return "QueueUrl" case "ssm": return "ResourceId" case "storagegateway": @@ -268,14 +350,38 @@ func ServiceListTagsInputIdentifierField(serviceName string) string { return "Arn" case "workspaces": return "ResourceId" + case "waf": + return "ResourceARN" + case "wafregional": + return "ResourceARN" + case "wafv2": + return "ResourceARN" default: return "ResourceArn" } } +// ServiceTagInputIdentifierRequiresSlice determines if the service tagging resource field requires a slice. +func ServiceListTagsInputIdentifierRequiresSlice(serviceName string) string { + switch serviceName { + case "cloudtrail": + return "yes" + case "directconnect": + return "yes" + case "elb": + return "yes" + case "elbv2": + return "yes" + default: + return "" + } +} + // ServiceListTagsInputResourceTypeField determines the service tagging resource type field. func ServiceListTagsInputResourceTypeField(serviceName string) string { switch serviceName { + case "route53": + return "ResourceType" case "ssm": return "ResourceType" default: @@ -286,10 +392,16 @@ func ServiceListTagsInputResourceTypeField(serviceName string) string { // ServiceListTagsOutputTagsField determines the service tag field. func ServiceListTagsOutputTagsField(serviceName string) string { switch serviceName { + case "cloudfront": + return "Tags.Items" case "cloudhsmv2": return "TagList" + case "cloudtrail": + return "ResourceTagList[0].TagsList" case "databasemigrationservice": return "TagList" + case "directconnect": + return "ResourceTags[0].Tags" case "docdb": return "TagList" case "elasticache": @@ -298,12 +410,28 @@ func ServiceListTagsOutputTagsField(serviceName string) string { return "ResourceTags" case "elasticsearchservice": return "TagList" + case "elb": + return "TagDescriptions[0].Tags" + case "elbv2": + return "TagDescriptions[0].Tags" + case "mediaconvert": + return "ResourceTags.Tags" case "neptune": return "TagList" + case "pinpoint": + return "TagsModel.Tags" case "rds": return "TagList" + case "route53": + return "ResourceTagSet.Tags" case "ssm": return "TagList" + case "waf": + return "TagInfoForResource.TagList" + case "wafregional": + return "TagInfoForResource.TagList" + case "wafv2": + return "TagInfoForResource.TagList" case "workspaces": return "TagList" default: diff --git a/aws/internal/keyvaluetags/generators/servicetags/main.go b/aws/internal/keyvaluetags/generators/servicetags/main.go index 327e567bbc9..17c84fa498d 100644 --- a/aws/internal/keyvaluetags/generators/servicetags/main.go +++ b/aws/internal/keyvaluetags/generators/servicetags/main.go @@ -10,6 +10,8 @@ import ( "sort" "strings" "text/template" + + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) const filename = `service_tags_gen.go` @@ -38,7 +40,6 @@ var sliceServiceNames = []string{ "devicefarm", "directconnect", "directoryservice", - "dlm", "docdb", "dynamodb", "ec2", @@ -54,6 +55,7 @@ var sliceServiceNames = []string{ "firehose", "fms", "fsx", + "gamelift", "iam", "inspector", "iot", @@ -68,6 +70,7 @@ var sliceServiceNames = []string{ "mediastore", "neptune", "organizations", + "quicksight", "ram", "rds", "redshift", @@ -85,10 +88,13 @@ var sliceServiceNames = []string{ "swf", "transfer", "waf", + "wafregional", + "wafv2", "workspaces", } var mapServiceNames = []string{ + "accessanalyzer", "amplify", "apigateway", "apigatewayv2", @@ -98,13 +104,18 @@ var mapServiceNames = []string{ "batch", "cloudwatchlogs", "codecommit", + "codestarnotifications", "cognitoidentity", "cognitoidentityprovider", + "dataexchange", + "dlm", "eks", "glacier", "glue", "guardduty", + "greengrass", "kafka", + "imagebuilder", "lambda", "mediaconnect", "mediaconvert", @@ -112,6 +123,7 @@ var mapServiceNames = []string{ "mediapackage", "mq", "opsworks", + "qldb", "pinpoint", "resourcegroups", "securityhub", @@ -133,6 +145,8 @@ func main() { SliceServiceNames: sliceServiceNames, } templateFuncMap := template.FuncMap{ + "TagKeyType": ServiceTagKeyType, + "TagPackage": keyvaluetags.ServiceTagPackage, "TagType": ServiceTagType, "TagTypeKeyField": ServiceTagTypeKeyField, "TagTypeValueField": ServiceTagTypeValueField, @@ -181,8 +195,10 @@ package keyvaluetags import ( "github.com/aws/aws-sdk-go/aws" {{- range .SliceServiceNames }} +{{- if eq . (. | TagPackage) }} "github.com/aws/aws-sdk-go/service/{{ . }}" {{- end }} +{{- end }} ) // map[string]*string handling @@ -202,12 +218,29 @@ func {{ . | Title }}KeyValueTags(tags map[string]*string) KeyValueTags { // []*SERVICE.Tag handling {{- range .SliceServiceNames }} +{{- if . | TagKeyType }} +// {{ . | Title }}TagKeys returns {{ . }} service tag keys. +func (tags KeyValueTags) {{ . | Title }}TagKeys() []*{{ . | TagPackage }}.{{ . | TagKeyType }} { + result := make([]*{{ . | TagPackage }}.{{ . | TagKeyType }}, 0, len(tags)) + + for k := range tags.Map() { + tagKey := &{{ . | TagPackage }}.{{ . | TagKeyType }}{ + {{ . | TagTypeKeyField }}: aws.String(k), + } + + result = append(result, tagKey) + } + + return result +} +{{- end }} + // {{ . | Title }}Tags returns {{ . }} service tags. -func (tags KeyValueTags) {{ . | Title }}Tags() []*{{ . }}.{{ . | TagType }} { - result := make([]*{{ . }}.{{ . | TagType }}, 0, len(tags)) +func (tags KeyValueTags) {{ . | Title }}Tags() []*{{ . | TagPackage }}.{{ . | TagType }} { + result := make([]*{{ . | TagPackage }}.{{ . | TagType }}, 0, len(tags)) for k, v := range tags.Map() { - tag := &{{ . }}.{{ . | TagType }}{ + tag := &{{ . | TagPackage }}.{{ . | TagType }}{ {{ . | TagTypeKeyField }}: aws.String(k), {{ . | TagTypeValueField }}: aws.String(v), } @@ -219,7 +252,7 @@ func (tags KeyValueTags) {{ . | Title }}Tags() []*{{ . }}.{{ . | TagType }} { } // {{ . | Title }}KeyValueTags creates KeyValueTags from {{ . }} service tags. -func {{ . | Title }}KeyValueTags(tags []*{{ . }}.{{ . | TagType }}) KeyValueTags { +func {{ . | Title }}KeyValueTags(tags []*{{ . | TagPackage }}.{{ . | TagType }}) KeyValueTags { m := make(map[string]*string, len(tags)) for _, tag := range tags { @@ -231,6 +264,16 @@ func {{ . | Title }}KeyValueTags(tags []*{{ . }}.{{ . | TagType }}) KeyValueTags {{- end }} ` +// ServiceTagKeyType determines the service tagging tag key type. +func ServiceTagKeyType(serviceName string) string { + switch serviceName { + case "elb": + return "TagKeyOnly" + default: + return "" + } +} + // ServiceTagType determines the service tagging tag type. func ServiceTagType(serviceName string) string { switch serviceName { diff --git a/aws/internal/keyvaluetags/generators/updatetags/README.md b/aws/internal/keyvaluetags/generators/updatetags/README.md index c18da86c3ce..90d23491e23 100644 --- a/aws/internal/keyvaluetags/generators/updatetags/README.md +++ b/aws/internal/keyvaluetags/generators/updatetags/README.md @@ -102,6 +102,27 @@ case "datapipeline": return "AddTags" ``` +#### ServiceTagInputCustomValue + +Given the following compilation errors: + +```text +aws/internal/keyvaluetags/update_tags_gen.go:1994:4: cannot use updatedTags.IgnoreAws().KinesisTags() (type []*kinesis.Tag) as type map[string]*string in field value +``` + +or + +```text +aws/internal/keyvaluetags/update_tags_gen.go:2534:4: cannot use updatedTags.IgnoreAws().PinpointTags() (type map[string]*string) as type *pinpoint.TagsModel in field value +``` + +The value of the tags for tagging must be transformed. Add an entry within the `ServiceTagInputCustomValue()` function of the generator to return the custom value. In the above case: + +```go +case "kinesis": + return "aws.StringMap(chunk.IgnoreAws().Map())" +``` + #### ServiceTagInputIdentifierField Given the following compilation error: @@ -118,6 +139,21 @@ case "athena": return "ResourceARN" ``` +#### ServiceTagInputIdentifierRequiresSlice + +Given the following compilation error: + +```text +aws/internal/keyvaluetags/update_tags_gen.go:1296:4: cannot use aws.String(identifier) (type *string) as type []*string in field value +``` + +The value to identify the resource for tagging must be passed in a string slice. Add an entry within the `ServiceTagInputIdentifierRequiresSlice()` function of the generator to ensure that the value is passed as expected. In the above case + +```go +case "ec2": + return "yes" +``` + #### ServiceTagInputTagsField Given the following compilation error: @@ -163,3 +199,18 @@ The field name with the tag keys for untagging must be updated. Add an entry wit case "cloudhsmv2": return "TagKeyList" ``` + +#### ServiceUntagInputCustomValue + +Given the following compilation error: + +```text +aws/internal/keyvaluetags/update_tags_gen.go:523:4: cannot use updatedTags.IgnoreAws().CloudfrontTags() (type []*cloudfront.Tag) as type *cloudfront.Tags in field value +``` + +The value of the tags for untagging must be transformed. Add an entry within the `ServiceUntagInputCustomValue()` function of the generator to return the custom value. In the above case: + +```go +case "cloudfront": + return "&cloudfront.TagKeys{Items: aws.StringSlice(removedTags.IgnoreAws().Keys())}" +``` diff --git a/aws/internal/keyvaluetags/generators/updatetags/main.go b/aws/internal/keyvaluetags/generators/updatetags/main.go index 11fc44a7877..b09b71a9c74 100644 --- a/aws/internal/keyvaluetags/generators/updatetags/main.go +++ b/aws/internal/keyvaluetags/generators/updatetags/main.go @@ -17,6 +17,9 @@ import ( const filename = `update_tags_gen.go` var serviceNames = []string{ + "accessanalyzer", + "acm", + "acmpca", "amplify", "apigateway", "apigatewayv2", @@ -25,39 +28,54 @@ var serviceNames = []string{ "appsync", "athena", "backup", + "cloudfront", "cloudhsmv2", + "cloudtrail", "cloudwatch", "cloudwatchevents", + "cloudwatchlogs", "codecommit", "codedeploy", "codepipeline", + "codestarnotifications", "cognitoidentity", "cognitoidentityprovider", "configservice", "databasemigrationservice", + "dataexchange", "datapipeline", "datasync", "dax", "devicefarm", "directconnect", "directoryservice", + "dlm", "docdb", "dynamodb", + "ec2", "ecr", "ecs", "efs", "eks", "elasticache", + "elasticbeanstalk", "elasticsearchservice", + "elb", + "elbv2", "emr", "firehose", "fsx", + "gamelift", + "glacier", "glue", "guardduty", + "greengrass", + "imagebuilder", "iot", "iotanalytics", "iotevents", "kafka", + "kinesis", "kinesisanalytics", "kinesisanalyticsv2", "kms", @@ -73,19 +91,28 @@ var serviceNames = []string{ "neptune", "opsworks", "organizations", + "pinpoint", + "qldb", + "quicksight", "ram", "rds", "redshift", + "resourcegroups", + "route53", "route53resolver", + "sagemaker", "secretsmanager", "securityhub", "sfn", "sns", + "sqs", "ssm", "storagegateway", "swf", "transfer", "waf", + "wafregional", + "wafv2", "workspaces", } @@ -101,14 +128,21 @@ func main() { ServiceNames: serviceNames, } templateFuncMap := template.FuncMap{ - "ClientType": keyvaluetags.ServiceClientType, - "TagFunction": ServiceTagFunction, - "TagInputIdentifierField": ServiceTagInputIdentifierField, - "TagInputResourceTypeField": ServiceTagInputResourceTypeField, - "TagInputTagsField": ServiceTagInputTagsField, - "Title": strings.Title, - "UntagFunction": ServiceUntagFunction, - "UntagInputTagsField": ServiceUntagInputTagsField, + "ClientType": keyvaluetags.ServiceClientType, + "TagFunction": ServiceTagFunction, + "TagFunctionBatchSize": ServiceTagFunctionBatchSize, + "TagInputCustomValue": ServiceTagInputCustomValue, + "TagInputIdentifierField": ServiceTagInputIdentifierField, + "TagInputIdentifierRequiresSlice": ServiceTagInputIdentifierRequiresSlice, + "TagInputResourceTypeField": ServiceTagInputResourceTypeField, + "TagInputTagsField": ServiceTagInputTagsField, + "TagPackage": keyvaluetags.ServiceTagPackage, + "Title": strings.Title, + "UntagFunction": ServiceUntagFunction, + "UntagInputCustomValue": ServiceUntagInputCustomValue, + "UntagInputRequiresTagKeyType": ServiceUntagInputRequiresTagKeyType, + "UntagInputRequiresTagType": ServiceUntagInputRequiresTagType, + "UntagInputTagsField": ServiceUntagInputTagsField, } tmpl, err := template.New("updatetags").Funcs(templateFuncMap).Parse(templateBody) @@ -166,39 +200,116 @@ import ( func {{ . | Title }}UpdateTags(conn {{ . | ClientType }}, identifier string{{ if . | TagInputResourceTypeField }}, resourceType string{{ end }}, oldTagsMap interface{}, newTagsMap interface{}) error { oldTags := New(oldTagsMap) newTags := New(newTagsMap) + {{- if eq (. | TagFunction) (. | UntagFunction) }} + removedTags := oldTags.Removed(newTags) + updatedTags := oldTags.Updated(newTags) + + // Ensure we do not send empty requests + if len(removedTags) == 0 && len(updatedTags) == 0 { + return nil + } + + input := &{{ . | TagPackage }}.{{ . | TagFunction }}Input{ + {{- if . | TagInputIdentifierRequiresSlice }} + {{ . | TagInputIdentifierField }}: aws.StringSlice([]string{identifier}), + {{- else }} + {{ . | TagInputIdentifierField }}: aws.String(identifier), + {{- end }} + {{- if . | TagInputResourceTypeField }} + {{ . | TagInputResourceTypeField }}: aws.String(resourceType), + {{- end }} + } + + if len(updatedTags) > 0 { + input.{{ . | TagInputTagsField }} = updatedTags.IgnoreAws().{{ . | Title }}Tags() + } + + if len(removedTags) > 0 { + {{- if . | UntagInputRequiresTagType }} + input.{{ . | UntagInputTagsField }} = removedTags.IgnoreAws().{{ . | Title }}Tags() + {{- else if . | UntagInputRequiresTagKeyType }} + input.{{ . | UntagInputTagsField }} = removedTags.IgnoreAws().{{ . | Title }}TagKeys() + {{- else if . | UntagInputCustomValue }} + input.{{ . | UntagInputTagsField }} = {{ . | UntagInputCustomValue }} + {{- else }} + input.{{ . | UntagInputTagsField }} = aws.StringSlice(removedTags.Keys()) + {{- end }} + } + + _, err := conn.{{ . | TagFunction }}(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + + {{- else }} if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { - input := &{{ . }}.{{ . | UntagFunction }}Input{ + {{- if . | TagFunctionBatchSize }} + for _, removedTags := range removedTags.Chunks({{ . | TagFunctionBatchSize }}) { + {{- end }} + input := &{{ . | TagPackage }}.{{ . | UntagFunction }}Input{ + {{- if . | TagInputIdentifierRequiresSlice }} + {{ . | TagInputIdentifierField }}: aws.StringSlice([]string{identifier}), + {{- else }} {{ . | TagInputIdentifierField }}: aws.String(identifier), + {{- end }} {{- if . | TagInputResourceTypeField }} {{ . | TagInputResourceTypeField }}: aws.String(resourceType), {{- end }} - {{ . | UntagInputTagsField }}: aws.StringSlice(removedTags.Keys()), + {{- if . | UntagInputRequiresTagType }} + {{ . | UntagInputTagsField }}: removedTags.IgnoreAws().{{ . | Title }}Tags(), + {{- else if . | UntagInputRequiresTagKeyType }} + {{ . | UntagInputTagsField }}: removedTags.IgnoreAws().{{ . | Title }}TagKeys(), + {{- else if . | UntagInputCustomValue }} + {{ . | UntagInputTagsField }}: {{ . | UntagInputCustomValue }}, + {{- else }} + {{ . | UntagInputTagsField }}: aws.StringSlice(removedTags.IgnoreAws().Keys()), + {{- end }} } _, err := conn.{{ . | UntagFunction }}(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + {{- if . | TagFunctionBatchSize }} } + {{- end }} } if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { - input := &{{ . }}.{{ . | TagFunction }}Input{ + {{- if . | TagFunctionBatchSize }} + for _, updatedTags := range updatedTags.Chunks({{ . | TagFunctionBatchSize }}) { + {{- end }} + input := &{{ . | TagPackage }}.{{ . | TagFunction }}Input{ + {{- if . | TagInputIdentifierRequiresSlice }} + {{ . | TagInputIdentifierField }}: aws.StringSlice([]string{identifier}), + {{- else }} {{ . | TagInputIdentifierField }}: aws.String(identifier), + {{- end }} {{- if . | TagInputResourceTypeField }} {{ . | TagInputResourceTypeField }}: aws.String(resourceType), {{- end }} + {{- if . | TagInputCustomValue }} + {{ . | TagInputTagsField }}: {{ . | TagInputCustomValue }}, + {{- else }} {{ . | TagInputTagsField }}: updatedTags.IgnoreAws().{{ . | Title }}Tags(), + {{- end }} } _, err := conn.{{ . | TagFunction }}(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + {{- if . | TagFunctionBatchSize }} } + {{- end }} } + {{- end }} + return nil } {{- end }} @@ -207,6 +318,14 @@ func {{ . | Title }}UpdateTags(conn {{ . | ClientType }}, identifier string{{ if // ServiceTagFunction determines the service tagging function. func ServiceTagFunction(serviceName string) string { switch serviceName { + case "acm": + return "AddTagsToCertificate" + case "acmpca": + return "TagCertificateAuthority" + case "cloudtrail": + return "AddTags" + case "cloudwatchlogs": + return "TagLogGroup" case "databasemigrationservice": return "AddTagsToResource" case "datapipeline": @@ -215,16 +334,26 @@ func ServiceTagFunction(serviceName string) string { return "AddTagsToResource" case "docdb": return "AddTagsToResource" - case "efs": + case "ec2": return "CreateTags" case "elasticache": return "AddTagsToResource" + case "elasticbeanstalk": + return "UpdateTagsForResource" case "elasticsearchservice": return "AddTags" + case "elb": + return "AddTags" + case "elbv2": + return "AddTags" case "emr": return "AddTags" case "firehose": return "TagDeliveryStream" + case "glacier": + return "AddTagsToVault" + case "kinesis": + return "AddTagsToStream" case "medialive": return "CreateTags" case "mq": @@ -235,8 +364,14 @@ func ServiceTagFunction(serviceName string) string { return "AddTagsToResource" case "redshift": return "CreateTags" + case "resourcegroups": + return "Tag" + case "route53": + return "ChangeTagsForResource" case "sagemaker": return "AddTags" + case "sqs": + return "TagQueue" case "ssm": return "AddTagsToResource" case "storagegateway": @@ -248,17 +383,39 @@ func ServiceTagFunction(serviceName string) string { } } +// ServiceTagFunctionBatchSize determines the batch size (if any) for tagging and untagging. +func ServiceTagFunctionBatchSize(serviceName string) string { + switch serviceName { + case "kinesis": + return "10" + default: + return "" + } +} + // ServiceTagInputIdentifierField determines the service tag identifier field. func ServiceTagInputIdentifierField(serviceName string) string { switch serviceName { + case "acm": + return "CertificateArn" + case "acmpca": + return "CertificateAuthorityArn" case "athena": return "ResourceARN" + case "cloudfront": + return "Resource" case "cloudhsmv2": return "ResourceId" + case "cloudtrail": + return "ResourceId" case "cloudwatch": return "ResourceARN" case "cloudwatchevents": return "ResourceARN" + case "cloudwatchlogs": + return "LogGroupName" + case "codestarnotifications": + return "Arn" case "datapipeline": return "PipelineId" case "dax": @@ -269,18 +426,30 @@ func ServiceTagInputIdentifierField(serviceName string) string { return "ResourceId" case "docdb": return "ResourceName" + case "ec2": + return "Resources" case "efs": - return "FileSystemId" + return "ResourceId" case "elasticache": return "ResourceName" case "elasticsearchservice": return "ARN" + case "elb": + return "LoadBalancerNames" + case "elbv2": + return "ResourceArns" case "emr": return "ResourceId" case "firehose": return "DeliveryStreamName" case "fsx": return "ResourceARN" + case "gamelift": + return "ResourceARN" + case "glacier": + return "VaultName" + case "kinesis": + return "StreamName" case "kinesisanalytics": return "ResourceARN" case "kinesisanalyticsv2": @@ -305,8 +474,14 @@ func ServiceTagInputIdentifierField(serviceName string) string { return "ResourceName" case "redshift": return "ResourceName" + case "resourcegroups": + return "Arn" + case "route53": + return "ResourceId" case "secretsmanager": return "SecretId" + case "sqs": + return "QueueUrl" case "ssm": return "ResourceId" case "storagegateway": @@ -315,6 +490,10 @@ func ServiceTagInputIdentifierField(serviceName string) string { return "Arn" case "waf": return "ResourceARN" + case "wafregional": + return "ResourceARN" + case "wafv2": + return "ResourceARN" case "workspaces": return "ResourceId" default: @@ -322,23 +501,61 @@ func ServiceTagInputIdentifierField(serviceName string) string { } } +// ServiceTagInputIdentifierRequiresSlice determines if the service tagging resource field requires a slice. +func ServiceTagInputIdentifierRequiresSlice(serviceName string) string { + switch serviceName { + case "ec2": + return "yes" + case "elb": + return "yes" + case "elbv2": + return "yes" + default: + return "" + } +} + // ServiceTagInputTagsField determines the service tagging tags field. func ServiceTagInputTagsField(serviceName string) string { switch serviceName { case "cloudhsmv2": return "TagList" + case "cloudtrail": + return "TagsList" + case "elasticbeanstalk": + return "TagsToAdd" case "elasticsearchservice": return "TagList" case "glue": return "TagsToAdd" + case "pinpoint": + return "TagsModel" + case "route53": + return "AddTags" default: return "Tags" } } +// ServiceTagInputCustomValue determines any custom value for the service tagging tags field. +func ServiceTagInputCustomValue(serviceName string) string { + switch serviceName { + case "cloudfront": + return "&cloudfront.Tags{Items: updatedTags.IgnoreAws().CloudfrontTags()}" + case "kinesis": + return "aws.StringMap(updatedTags.IgnoreAws().Map())" + case "pinpoint": + return "&pinpoint.TagsModel{Tags: updatedTags.IgnoreAws().PinpointTags()}" + default: + return "" + } +} + // ServiceTagInputResourceTypeField determines the service tagging resource type field. func ServiceTagInputResourceTypeField(serviceName string) string { switch serviceName { + case "route53": + return "ResourceType" case "ssm": return "ResourceType" default: @@ -349,6 +566,14 @@ func ServiceTagInputResourceTypeField(serviceName string) string { // ServiceUntagFunction determines the service untagging function. func ServiceUntagFunction(serviceName string) string { switch serviceName { + case "acm": + return "RemoveTagsFromCertificate" + case "acmpca": + return "UntagCertificateAuthority" + case "cloudtrail": + return "RemoveTags" + case "cloudwatchlogs": + return "UntagLogGroup" case "databasemigrationservice": return "RemoveTagsFromResource" case "datapipeline": @@ -357,16 +582,26 @@ func ServiceUntagFunction(serviceName string) string { return "RemoveTagsFromResource" case "docdb": return "RemoveTagsFromResource" - case "efs": + case "ec2": return "DeleteTags" case "elasticache": return "RemoveTagsFromResource" + case "elasticbeanstalk": + return "UpdateTagsForResource" case "elasticsearchservice": return "RemoveTags" + case "elb": + return "RemoveTags" + case "elbv2": + return "RemoveTags" case "emr": return "RemoveTags" case "firehose": return "UntagDeliveryStream" + case "glacier": + return "RemoveTagsFromVault" + case "kinesis": + return "RemoveTagsFromStream" case "medialive": return "DeleteTags" case "mq": @@ -377,8 +612,14 @@ func ServiceUntagFunction(serviceName string) string { return "RemoveTagsFromResource" case "redshift": return "DeleteTags" + case "resourcegroups": + return "Untag" + case "route53": + return "ChangeTagsForResource" case "sagemaker": return "DeleteTags" + case "sqs": + return "UntagQueue" case "ssm": return "RemoveTagsFromResource" case "storagegateway": @@ -390,18 +631,72 @@ func ServiceUntagFunction(serviceName string) string { } } +// ServiceUntagInputRequiresTagType determines if the service untagging requires full Tag type. +func ServiceUntagInputRequiresTagType(serviceName string) string { + switch serviceName { + case "acm": + return "yes" + case "acmpca": + return "yes" + case "cloudtrail": + return "yes" + case "ec2": + return "yes" + default: + return "" + } +} + +// ServiceUntagInputRequiresTagKeyType determines if a special type for the untagging function tag key field is needed. +func ServiceUntagInputRequiresTagKeyType(serviceName string) string { + switch serviceName { + case "elb": + return "yes" + default: + return "" + } +} + // ServiceUntagInputTagsField determines the service untagging tags field. func ServiceUntagInputTagsField(serviceName string) string { switch serviceName { + case "acm": + return "Tags" + case "acmpca": + return "Tags" case "backup": return "TagKeyList" case "cloudhsmv2": return "TagKeyList" + case "cloudtrail": + return "TagsList" + case "cloudwatchlogs": + return "Tags" case "datasync": return "Keys" + case "ec2": + return "Tags" + case "elasticbeanstalk": + return "TagsToRemove" + case "elb": + return "Tags" case "glue": return "TagsToRemove" + case "resourcegroups": + return "Keys" + case "route53": + return "RemoveTagKeys" default: return "TagKeys" } } + +// ServiceUntagInputCustomValue determines any custom value for the service untagging tags field. +func ServiceUntagInputCustomValue(serviceName string) string { + switch serviceName { + case "cloudfront": + return "&cloudfront.TagKeys{Items: aws.StringSlice(removedTags.IgnoreAws().Keys())}" + default: + return "" + } +} diff --git a/aws/internal/keyvaluetags/iam_tags.go b/aws/internal/keyvaluetags/iam_tags.go new file mode 100644 index 00000000000..1059708d280 --- /dev/null +++ b/aws/internal/keyvaluetags/iam_tags.go @@ -0,0 +1,82 @@ +// +build !generate + +package keyvaluetags + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/iam" +) + +// Custom IAM tag service update functions using the same format as generated code. + +// IamRoleUpdateTags updates IAM role tags. +// The identifier is the role name. +func IamRoleUpdateTags(conn *iam.IAM, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &iam.UntagRoleInput{ + RoleName: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.Keys()), + } + + _, err := conn.UntagRole(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &iam.TagRoleInput{ + RoleName: aws.String(identifier), + Tags: updatedTags.IgnoreAws().IamTags(), + } + + _, err := conn.TagRole(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// IamUserUpdateTags updates IAM user tags. +// The identifier is the user name. +func IamUserUpdateTags(conn *iam.IAM, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &iam.UntagUserInput{ + UserName: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.Keys()), + } + + _, err := conn.UntagUser(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &iam.TagUserInput{ + UserName: aws.String(identifier), + Tags: updatedTags.IgnoreAws().IamTags(), + } + + _, err := conn.TagUser(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} diff --git a/aws/internal/keyvaluetags/key_value_tags.go b/aws/internal/keyvaluetags/key_value_tags.go index 6ac2e380b3a..76d31980852 100644 --- a/aws/internal/keyvaluetags/key_value_tags.go +++ b/aws/internal/keyvaluetags/key_value_tags.go @@ -1,11 +1,15 @@ -//go:generate go run generators/listtags/main.go -//go:generate go run generators/servicetags/main.go -//go:generate go run generators/updatetags/main.go +//go:generate go run -tags generate generators/servicetags/main.go +//go:generate go run -tags generate generators/listtags/main.go +//go:generate go run -tags generate generators/updatetags/main.go package keyvaluetags import ( + "fmt" + "net/url" "strings" + + "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" ) const ( @@ -57,6 +61,30 @@ func (tags KeyValueTags) IgnoreElasticbeanstalk() KeyValueTags { return result } +// IgnorePrefixes returns non-matching tag key prefixes. +func (tags KeyValueTags) IgnorePrefixes(ignoreTagPrefixes KeyValueTags) KeyValueTags { + result := make(KeyValueTags) + + for k, v := range tags { + var ignore bool + + for ignoreTagPrefix := range ignoreTagPrefixes { + if strings.HasPrefix(k, ignoreTagPrefix) { + ignore = true + break + } + } + + if ignore { + continue + } + + result[k] = v + } + + return result +} + // IgnoreRDS returns non-AWS and non-RDS tag keys. func (tags KeyValueTags) IgnoreRds() KeyValueTags { result := make(KeyValueTags) @@ -154,6 +182,60 @@ func (tags KeyValueTags) Updated(newTags KeyValueTags) KeyValueTags { return result } +// Chunks returns a slice of KeyValueTags, each of the specified size. +func (tags KeyValueTags) Chunks(size int) []KeyValueTags { + result := []KeyValueTags{} + + i := 0 + var chunk KeyValueTags + for k, v := range tags { + if i%size == 0 { + chunk = make(KeyValueTags) + result = append(result, chunk) + } + + chunk[k] = v + + i++ + } + + return result +} + +// ContainsAll returns whether or not all the target tags are contained. +func (tags KeyValueTags) ContainsAll(target KeyValueTags) bool { + for key, value := range target { + if v, ok := tags[key]; !ok || *v != *value { + return false + } + } + + return true +} + +// Hash returns a stable hash value. +// The returned value may be negative (i.e. not suitable for a 'Set' function). +func (tags KeyValueTags) Hash() int { + hash := 0 + + for k, v := range tags { + hash = hash ^ hashcode.String(fmt.Sprintf("%s-%s", k, *v)) + } + + return hash +} + +// UrlEncode returns the KeyValueTags encoded as URL Query parameters. +func (tags KeyValueTags) UrlEncode() string { + values := url.Values{} + + for k, v := range tags { + values.Add(k, *v) + } + + return values.Encode() +} + // New creates KeyValueTags from common Terraform Provider SDK types. // Supports map[string]string, map[string]*string, map[string]interface{}, and []interface{}. // When passed []interface{}, all elements are treated as keys and assigned nil values. @@ -178,6 +260,14 @@ func New(i interface{}) KeyValueTags { kvtm[k] = &str } + return kvtm + case []string: + kvtm := make(KeyValueTags, len(value)) + + for _, v := range value { + kvtm[v] = nil + } + return kvtm case []interface{}: kvtm := make(KeyValueTags, len(value)) diff --git a/aws/internal/keyvaluetags/key_value_tags_test.go b/aws/internal/keyvaluetags/key_value_tags_test.go index 9a7f80365ad..00010ab1d97 100644 --- a/aws/internal/keyvaluetags/key_value_tags_test.go +++ b/aws/internal/keyvaluetags/key_value_tags_test.go @@ -118,6 +118,93 @@ func TestKeyValueTagsIgnoreElasticbeanstalk(t *testing.T) { } } +func TestKeyValueTagsIgnorePrefixes(t *testing.T) { + testCases := []struct { + name string + tags KeyValueTags + ignoreTagPrefixes KeyValueTags + want map[string]string + }{ + { + name: "empty", + tags: New(map[string]string{}), + ignoreTagPrefixes: New([]string{ + "key1", + "key2", + "key3", + }), + want: map[string]string{}, + }, + { + name: "all_exact", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + ignoreTagPrefixes: New([]string{ + "key1", + "key2", + "key3", + }), + want: map[string]string{}, + }, + { + name: "all_prefix", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + ignoreTagPrefixes: New([]string{ + "key", + }), + want: map[string]string{}, + }, + { + name: "mixed", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + ignoreTagPrefixes: New([]string{ + "key1", + }), + want: map[string]string{ + "key2": "value2", + "key3": "value3", + }, + }, + { + name: "none", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + ignoreTagPrefixes: New([]string{ + "key4", + "key5", + "key6", + }), + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + got := testCase.tags.IgnorePrefixes(testCase.ignoreTagPrefixes) + + testKeyValueTagsVerifyMap(t, got.Map(), testCase.want) + }) + } +} + func TestKeyValueTagsIgnoreRds(t *testing.T) { testCases := []struct { name string @@ -256,12 +343,45 @@ func TestKeyValueTagsKeys(t *testing.T) { want []string }{ { - name: "empty", + name: "empty_map_string_interface", + tags: New(map[string]interface{}{}), + want: []string{}, + }, + { + name: "empty_map_string_stringPointer", + tags: New(map[string]*string{}), + want: []string{}, + }, + { + name: "empty_map_string_string", + tags: New(map[string]string{}), + want: []string{}, + }, + { + name: "empty_slice_interface", + tags: New(map[string]interface{}{}), + want: []string{}, + }, + { + name: "empty_slice_string", tags: New(map[string]string{}), want: []string{}, }, { - name: "non_empty", + name: "non_empty_map_string_interface", + tags: New(map[string]interface{}{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + want: []string{ + "key1", + "key2", + "key3", + }, + }, + { + name: "non_empty_map_string_string", tags: New(map[string]string{ "key1": "value1", "key2": "value2", @@ -273,6 +393,45 @@ func TestKeyValueTagsKeys(t *testing.T) { "key3", }, }, + { + name: "non_empty_map_string_stringPointer", + tags: New(map[string]*string{ + "key1": testStringPtr("value1"), + "key2": testStringPtr("value2"), + "key3": testStringPtr("value3"), + }), + want: []string{ + "key1", + "key2", + "key3", + }, + }, + { + name: "non_empty_slice_interface", + tags: New([]interface{}{ + "key1", + "key2", + "key3", + }), + want: []string{ + "key1", + "key2", + "key3", + }, + }, + { + name: "non_empty_slice_string", + tags: New([]string{ + "key1", + "key2", + "key3", + }), + want: []string{ + "key1", + "key2", + "key3", + }, + }, } for _, testCase := range testCases { @@ -579,6 +738,256 @@ func TestKeyValueTagsUpdated(t *testing.T) { } } +func TestKeyValueTagsChunks(t *testing.T) { + testCases := []struct { + name string + tags KeyValueTags + size int + want []int + }{ + { + name: "empty", + tags: New(map[string]string{}), + size: 10, + want: []int{}, + }, + { + name: "chunk_1", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + "key4": "value4", + }), + size: 1, + want: []int{1, 1, 1, 1}, + }, + { + name: "chunk_2", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + "key4": "value4", + }), + size: 2, + want: []int{2, 2}, + }, + { + name: "chunk_3", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + "key4": "value4", + }), + size: 3, + want: []int{3, 1}, + }, + { + name: "chunk_4", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + "key4": "value4", + }), + size: 4, + want: []int{4}, + }, + { + name: "chunk_5", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + "key4": "value4", + }), + size: 5, + want: []int{4}, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + got := testCase.tags.Chunks(testCase.size) + + if len(got) != len(testCase.want) { + t.Errorf("unexpected number of chunks: %d", len(got)) + } + + for i, n := range testCase.want { + if len(got[i]) != n { + t.Errorf("chunk (%d) length %d; want length %d", i, len(got[i]), n) + } + } + }) + } +} + +func TestKeyValueTagsContainsAll(t *testing.T) { + testCases := []struct { + name string + source KeyValueTags + target KeyValueTags + want bool + }{ + { + name: "empty", + source: New(map[string]string{}), + target: New(map[string]string{}), + want: true, + }, + { + name: "source_empty", + source: New(map[string]string{}), + target: New(map[string]string{ + "key1": "value1", + }), + want: false, + }, + { + name: "target_empty", + source: New(map[string]string{ + "key1": "value1", + }), + target: New(map[string]string{}), + want: true, + }, + { + name: "exact_match", + source: New(map[string]string{ + "key1": "value1", + "key2": "value2", + }), + target: New(map[string]string{ + "key1": "value1", + "key2": "value2", + }), + want: true, + }, + { + name: "source_contains_all", + source: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + target: New(map[string]string{ + "key1": "value1", + "key3": "value3", + }), + want: true, + }, + { + name: "source_does_not_contain_all", + source: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + target: New(map[string]string{ + "key1": "value1", + "key4": "value4", + }), + want: false, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + got := testCase.source.ContainsAll(testCase.target) + + if got != testCase.want { + t.Errorf("unexpected ContainsAll: %t", got) + } + }) + } +} + +func TestKeyValueTagsHash(t *testing.T) { + testCases := []struct { + name string + tags KeyValueTags + zero bool + }{ + { + name: "empty", + tags: New(map[string]string{}), + zero: true, + }, + { + name: "not_empty", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + "key4": "value4", + }), + zero: false, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + got := testCase.tags.Hash() + + if (got == 0 && !testCase.zero) || (got != 0 && testCase.zero) { + t.Errorf("unexpected hash code: %d", got) + } + }) + } +} + +func TestKeyValueTagsUrlEncode(t *testing.T) { + testCases := []struct { + name string + tags KeyValueTags + want string + }{ + { + name: "empty", + tags: New(map[string]string{}), + want: "", + }, + { + name: "single", + tags: New(map[string]string{ + "key1": "value1", + }), + want: "key1=value1", + }, + { + name: "multiple", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + want: "key1=value1&key2=value2&key3=value3", + }, + { + name: "multiple_with_encoded", + tags: New(map[string]string{ + "key1": "value 1", + "key@2": "value+:2", + "key3": "value3", + }), + want: "key1=value+1&key3=value3&key%402=value%2B%3A2", + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + got := testCase.tags.UrlEncode() + + if got != testCase.want { + t.Errorf("unexpected URL encoded value: %q", got) + } + }) + } +} + func testKeyValueTagsVerifyKeys(t *testing.T, got []string, want []string) { for _, g := range got { found := false diff --git a/aws/internal/keyvaluetags/list_tags_gen.go b/aws/internal/keyvaluetags/list_tags_gen.go index 426e545275b..04501994215 100644 --- a/aws/internal/keyvaluetags/list_tags_gen.go +++ b/aws/internal/keyvaluetags/list_tags_gen.go @@ -4,6 +4,8 @@ package keyvaluetags import ( "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/accessanalyzer" + "github.com/aws/aws-sdk-go/service/acm" "github.com/aws/aws-sdk-go/service/acmpca" "github.com/aws/aws-sdk-go/service/amplify" "github.com/aws/aws-sdk-go/service/appmesh" @@ -11,20 +13,27 @@ import ( "github.com/aws/aws-sdk-go/service/appsync" "github.com/aws/aws-sdk-go/service/athena" "github.com/aws/aws-sdk-go/service/backup" + "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/aws/aws-sdk-go/service/cloudhsmv2" + "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/codecommit" "github.com/aws/aws-sdk-go/service/codedeploy" "github.com/aws/aws-sdk-go/service/codepipeline" + "github.com/aws/aws-sdk-go/service/codestarnotifications" "github.com/aws/aws-sdk-go/service/cognitoidentity" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/aws/aws-sdk-go/service/configservice" "github.com/aws/aws-sdk-go/service/databasemigrationservice" + "github.com/aws/aws-sdk-go/service/dataexchange" "github.com/aws/aws-sdk-go/service/datasync" "github.com/aws/aws-sdk-go/service/dax" "github.com/aws/aws-sdk-go/service/devicefarm" + "github.com/aws/aws-sdk-go/service/directconnect" "github.com/aws/aws-sdk-go/service/directoryservice" + "github.com/aws/aws-sdk-go/service/dlm" "github.com/aws/aws-sdk-go/service/docdb" "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/aws/aws-sdk-go/service/ecr" @@ -34,21 +43,29 @@ import ( "github.com/aws/aws-sdk-go/service/elasticache" "github.com/aws/aws-sdk-go/service/elasticbeanstalk" "github.com/aws/aws-sdk-go/service/elasticsearchservice" + "github.com/aws/aws-sdk-go/service/elb" + "github.com/aws/aws-sdk-go/service/elbv2" "github.com/aws/aws-sdk-go/service/firehose" "github.com/aws/aws-sdk-go/service/fsx" + "github.com/aws/aws-sdk-go/service/gamelift" + "github.com/aws/aws-sdk-go/service/glacier" "github.com/aws/aws-sdk-go/service/glue" + "github.com/aws/aws-sdk-go/service/greengrass" "github.com/aws/aws-sdk-go/service/guardduty" + "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/aws/aws-sdk-go/service/inspector" "github.com/aws/aws-sdk-go/service/iot" "github.com/aws/aws-sdk-go/service/iotanalytics" "github.com/aws/aws-sdk-go/service/iotevents" "github.com/aws/aws-sdk-go/service/kafka" + "github.com/aws/aws-sdk-go/service/kinesis" "github.com/aws/aws-sdk-go/service/kinesisanalytics" "github.com/aws/aws-sdk-go/service/kinesisanalyticsv2" "github.com/aws/aws-sdk-go/service/kms" "github.com/aws/aws-sdk-go/service/lambda" "github.com/aws/aws-sdk-go/service/licensemanager" "github.com/aws/aws-sdk-go/service/mediaconnect" + "github.com/aws/aws-sdk-go/service/mediaconvert" "github.com/aws/aws-sdk-go/service/medialive" "github.com/aws/aws-sdk-go/service/mediapackage" "github.com/aws/aws-sdk-go/service/mediastore" @@ -56,19 +73,62 @@ import ( "github.com/aws/aws-sdk-go/service/neptune" "github.com/aws/aws-sdk-go/service/opsworks" "github.com/aws/aws-sdk-go/service/organizations" + "github.com/aws/aws-sdk-go/service/pinpoint" + "github.com/aws/aws-sdk-go/service/qldb" + "github.com/aws/aws-sdk-go/service/quicksight" "github.com/aws/aws-sdk-go/service/rds" + "github.com/aws/aws-sdk-go/service/resourcegroups" + "github.com/aws/aws-sdk-go/service/route53" "github.com/aws/aws-sdk-go/service/route53resolver" "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/aws/aws-sdk-go/service/securityhub" "github.com/aws/aws-sdk-go/service/sfn" "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/storagegateway" "github.com/aws/aws-sdk-go/service/swf" "github.com/aws/aws-sdk-go/service/transfer" + "github.com/aws/aws-sdk-go/service/waf" + "github.com/aws/aws-sdk-go/service/wafregional" + "github.com/aws/aws-sdk-go/service/wafv2" "github.com/aws/aws-sdk-go/service/workspaces" ) +// AccessanalyzerListTags lists accessanalyzer service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func AccessanalyzerListTags(conn *accessanalyzer.AccessAnalyzer, identifier string) (KeyValueTags, error) { + input := &accessanalyzer.ListTagsForResourceInput{ + ResourceArn: aws.String(identifier), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return AccessanalyzerKeyValueTags(output.Tags), nil +} + +// AcmListTags lists acm service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func AcmListTags(conn *acm.ACM, identifier string) (KeyValueTags, error) { + input := &acm.ListTagsForCertificateInput{ + CertificateArn: aws.String(identifier), + } + + output, err := conn.ListTagsForCertificate(input) + + if err != nil { + return New(nil), err + } + + return AcmKeyValueTags(output.Tags), nil +} + // AcmpcaListTags lists acmpca service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -188,6 +248,23 @@ func BackupListTags(conn *backup.Backup, identifier string) (KeyValueTags, error return BackupKeyValueTags(output.Tags), nil } +// CloudfrontListTags lists cloudfront service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func CloudfrontListTags(conn *cloudfront.CloudFront, identifier string) (KeyValueTags, error) { + input := &cloudfront.ListTagsForResourceInput{ + Resource: aws.String(identifier), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return CloudfrontKeyValueTags(output.Tags.Items), nil +} + // Cloudhsmv2ListTags lists cloudhsmv2 service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -205,6 +282,23 @@ func Cloudhsmv2ListTags(conn *cloudhsmv2.CloudHSMV2, identifier string) (KeyValu return Cloudhsmv2KeyValueTags(output.TagList), nil } +// CloudtrailListTags lists cloudtrail service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func CloudtrailListTags(conn *cloudtrail.CloudTrail, identifier string) (KeyValueTags, error) { + input := &cloudtrail.ListTagsInput{ + ResourceIdList: aws.StringSlice([]string{identifier}), + } + + output, err := conn.ListTags(input) + + if err != nil { + return New(nil), err + } + + return CloudtrailKeyValueTags(output.ResourceTagList[0].TagsList), nil +} + // CloudwatchListTags lists cloudwatch service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -239,6 +333,23 @@ func CloudwatcheventsListTags(conn *cloudwatchevents.CloudWatchEvents, identifie return CloudwatcheventsKeyValueTags(output.Tags), nil } +// CloudwatchlogsListTags lists cloudwatchlogs service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func CloudwatchlogsListTags(conn *cloudwatchlogs.CloudWatchLogs, identifier string) (KeyValueTags, error) { + input := &cloudwatchlogs.ListTagsLogGroupInput{ + LogGroupName: aws.String(identifier), + } + + output, err := conn.ListTagsLogGroup(input) + + if err != nil { + return New(nil), err + } + + return CloudwatchlogsKeyValueTags(output.Tags), nil +} + // CodecommitListTags lists codecommit service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -290,6 +401,23 @@ func CodepipelineListTags(conn *codepipeline.CodePipeline, identifier string) (K return CodepipelineKeyValueTags(output.Tags), nil } +// CodestarnotificationsListTags lists codestarnotifications service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func CodestarnotificationsListTags(conn *codestarnotifications.CodeStarNotifications, identifier string) (KeyValueTags, error) { + input := &codestarnotifications.ListTagsForResourceInput{ + Arn: aws.String(identifier), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return CodestarnotificationsKeyValueTags(output.Tags), nil +} + // CognitoidentityListTags lists cognitoidentity service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -358,6 +486,23 @@ func DatabasemigrationserviceListTags(conn *databasemigrationservice.DatabaseMig return DatabasemigrationserviceKeyValueTags(output.TagList), nil } +// DataexchangeListTags lists dataexchange service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func DataexchangeListTags(conn *dataexchange.DataExchange, identifier string) (KeyValueTags, error) { + input := &dataexchange.ListTagsForResourceInput{ + ResourceArn: aws.String(identifier), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return DataexchangeKeyValueTags(output.Tags), nil +} + // DatasyncListTags lists datasync service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -409,6 +554,23 @@ func DevicefarmListTags(conn *devicefarm.DeviceFarm, identifier string) (KeyValu return DevicefarmKeyValueTags(output.Tags), nil } +// DirectconnectListTags lists directconnect service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func DirectconnectListTags(conn *directconnect.DirectConnect, identifier string) (KeyValueTags, error) { + input := &directconnect.DescribeTagsInput{ + ResourceArns: aws.StringSlice([]string{identifier}), + } + + output, err := conn.DescribeTags(input) + + if err != nil { + return New(nil), err + } + + return DirectconnectKeyValueTags(output.ResourceTags[0].Tags), nil +} + // DirectoryserviceListTags lists directoryservice service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -426,6 +588,23 @@ func DirectoryserviceListTags(conn *directoryservice.DirectoryService, identifie return DirectoryserviceKeyValueTags(output.Tags), nil } +// DlmListTags lists dlm service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func DlmListTags(conn *dlm.DLM, identifier string) (KeyValueTags, error) { + input := &dlm.ListTagsForResourceInput{ + ResourceArn: aws.String(identifier), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return DlmKeyValueTags(output.Tags), nil +} + // DocdbListTags lists docdb service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -579,6 +758,40 @@ func ElasticsearchserviceListTags(conn *elasticsearchservice.ElasticsearchServic return ElasticsearchserviceKeyValueTags(output.TagList), nil } +// ElbListTags lists elb service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func ElbListTags(conn *elb.ELB, identifier string) (KeyValueTags, error) { + input := &elb.DescribeTagsInput{ + LoadBalancerNames: aws.StringSlice([]string{identifier}), + } + + output, err := conn.DescribeTags(input) + + if err != nil { + return New(nil), err + } + + return ElbKeyValueTags(output.TagDescriptions[0].Tags), nil +} + +// Elbv2ListTags lists elbv2 service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func Elbv2ListTags(conn *elbv2.ELBV2, identifier string) (KeyValueTags, error) { + input := &elbv2.DescribeTagsInput{ + ResourceArns: aws.StringSlice([]string{identifier}), + } + + output, err := conn.DescribeTags(input) + + if err != nil { + return New(nil), err + } + + return Elbv2KeyValueTags(output.TagDescriptions[0].Tags), nil +} + // FirehoseListTags lists firehose service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -613,6 +826,40 @@ func FsxListTags(conn *fsx.FSx, identifier string) (KeyValueTags, error) { return FsxKeyValueTags(output.Tags), nil } +// GameliftListTags lists gamelift service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func GameliftListTags(conn *gamelift.GameLift, identifier string) (KeyValueTags, error) { + input := &gamelift.ListTagsForResourceInput{ + ResourceARN: aws.String(identifier), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return GameliftKeyValueTags(output.Tags), nil +} + +// GlacierListTags lists glacier service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func GlacierListTags(conn *glacier.Glacier, identifier string) (KeyValueTags, error) { + input := &glacier.ListTagsForVaultInput{ + VaultName: aws.String(identifier), + } + + output, err := conn.ListTagsForVault(input) + + if err != nil { + return New(nil), err + } + + return GlacierKeyValueTags(output.Tags), nil +} + // GlueListTags lists glue service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -630,6 +877,23 @@ func GlueListTags(conn *glue.Glue, identifier string) (KeyValueTags, error) { return GlueKeyValueTags(output.Tags), nil } +// GreengrassListTags lists greengrass service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func GreengrassListTags(conn *greengrass.Greengrass, identifier string) (KeyValueTags, error) { + input := &greengrass.ListTagsForResourceInput{ + ResourceArn: aws.String(identifier), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return GreengrassKeyValueTags(output.Tags), nil +} + // GuarddutyListTags lists guardduty service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -647,6 +911,23 @@ func GuarddutyListTags(conn *guardduty.GuardDuty, identifier string) (KeyValueTa return GuarddutyKeyValueTags(output.Tags), nil } +// ImagebuilderListTags lists imagebuilder service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func ImagebuilderListTags(conn *imagebuilder.Imagebuilder, identifier string) (KeyValueTags, error) { + input := &imagebuilder.ListTagsForResourceInput{ + ResourceArn: aws.String(identifier), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return ImagebuilderKeyValueTags(output.Tags), nil +} + // InspectorListTags lists inspector service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -732,6 +1013,23 @@ func KafkaListTags(conn *kafka.Kafka, identifier string) (KeyValueTags, error) { return KafkaKeyValueTags(output.Tags), nil } +// KinesisListTags lists kinesis service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func KinesisListTags(conn *kinesis.Kinesis, identifier string) (KeyValueTags, error) { + input := &kinesis.ListTagsForStreamInput{ + StreamName: aws.String(identifier), + } + + output, err := conn.ListTagsForStream(input) + + if err != nil { + return New(nil), err + } + + return KinesisKeyValueTags(output.Tags), nil +} + // KinesisanalyticsListTags lists kinesisanalytics service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -834,6 +1132,23 @@ func MediaconnectListTags(conn *mediaconnect.MediaConnect, identifier string) (K return MediaconnectKeyValueTags(output.Tags), nil } +// MediaconvertListTags lists mediaconvert service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func MediaconvertListTags(conn *mediaconvert.MediaConvert, identifier string) (KeyValueTags, error) { + input := &mediaconvert.ListTagsForResourceInput{ + Arn: aws.String(identifier), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return MediaconvertKeyValueTags(output.ResourceTags.Tags), nil +} + // MedialiveListTags lists medialive service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -953,6 +1268,57 @@ func OrganizationsListTags(conn *organizations.Organizations, identifier string) return OrganizationsKeyValueTags(output.Tags), nil } +// PinpointListTags lists pinpoint service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func PinpointListTags(conn *pinpoint.Pinpoint, identifier string) (KeyValueTags, error) { + input := &pinpoint.ListTagsForResourceInput{ + ResourceArn: aws.String(identifier), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return PinpointKeyValueTags(output.TagsModel.Tags), nil +} + +// QldbListTags lists qldb service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func QldbListTags(conn *qldb.QLDB, identifier string) (KeyValueTags, error) { + input := &qldb.ListTagsForResourceInput{ + ResourceArn: aws.String(identifier), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return QldbKeyValueTags(output.Tags), nil +} + +// QuicksightListTags lists quicksight service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func QuicksightListTags(conn *quicksight.QuickSight, identifier string) (KeyValueTags, error) { + input := &quicksight.ListTagsForResourceInput{ + ResourceArn: aws.String(identifier), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return QuicksightKeyValueTags(output.Tags), nil +} + // RdsListTags lists rds service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -970,6 +1336,41 @@ func RdsListTags(conn *rds.RDS, identifier string) (KeyValueTags, error) { return RdsKeyValueTags(output.TagList), nil } +// ResourcegroupsListTags lists resourcegroups service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func ResourcegroupsListTags(conn *resourcegroups.ResourceGroups, identifier string) (KeyValueTags, error) { + input := &resourcegroups.GetTagsInput{ + Arn: aws.String(identifier), + } + + output, err := conn.GetTags(input) + + if err != nil { + return New(nil), err + } + + return ResourcegroupsKeyValueTags(output.Tags), nil +} + +// Route53ListTags lists route53 service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func Route53ListTags(conn *route53.Route53, identifier string, resourceType string) (KeyValueTags, error) { + input := &route53.ListTagsForResourceInput{ + ResourceId: aws.String(identifier), + ResourceType: aws.String(resourceType), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return Route53KeyValueTags(output.ResourceTagSet.Tags), nil +} + // Route53resolverListTags lists route53resolver service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -1055,6 +1456,23 @@ func SnsListTags(conn *sns.SNS, identifier string) (KeyValueTags, error) { return SnsKeyValueTags(output.Tags), nil } +// SqsListTags lists sqs service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func SqsListTags(conn *sqs.SQS, identifier string) (KeyValueTags, error) { + input := &sqs.ListQueueTagsInput{ + QueueUrl: aws.String(identifier), + } + + output, err := conn.ListQueueTags(input) + + if err != nil { + return New(nil), err + } + + return SqsKeyValueTags(output.Tags), nil +} + // SsmListTags lists ssm service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -1124,6 +1542,57 @@ func TransferListTags(conn *transfer.Transfer, identifier string) (KeyValueTags, return TransferKeyValueTags(output.Tags), nil } +// WafListTags lists waf service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func WafListTags(conn *waf.WAF, identifier string) (KeyValueTags, error) { + input := &waf.ListTagsForResourceInput{ + ResourceARN: aws.String(identifier), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return WafKeyValueTags(output.TagInfoForResource.TagList), nil +} + +// WafregionalListTags lists wafregional service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func WafregionalListTags(conn *wafregional.WAFRegional, identifier string) (KeyValueTags, error) { + input := &waf.ListTagsForResourceInput{ + ResourceARN: aws.String(identifier), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return WafregionalKeyValueTags(output.TagInfoForResource.TagList), nil +} + +// Wafv2ListTags lists wafv2 service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func Wafv2ListTags(conn *wafv2.WAFV2, identifier string) (KeyValueTags, error) { + input := &wafv2.ListTagsForResourceInput{ + ResourceARN: aws.String(identifier), + } + + output, err := conn.ListTagsForResource(input) + + if err != nil { + return New(nil), err + } + + return Wafv2KeyValueTags(output.TagInfoForResource.TagList), nil +} + // WorkspacesListTags lists workspaces service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. diff --git a/aws/internal/keyvaluetags/s3_tags.go b/aws/internal/keyvaluetags/s3_tags.go new file mode 100644 index 00000000000..0766c9034b4 --- /dev/null +++ b/aws/internal/keyvaluetags/s3_tags.go @@ -0,0 +1,130 @@ +// +build !generate + +package keyvaluetags + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/s3" + awsbase "github.com/hashicorp/aws-sdk-go-base" +) + +// Custom S3 tag service update functions using the same format as generated code. + +// S3BucketListTags lists S3 bucket tags. +// The identifier is the bucket name. +func S3BucketListTags(conn *s3.S3, identifier string) (KeyValueTags, error) { + input := &s3.GetBucketTaggingInput{ + Bucket: aws.String(identifier), + } + + output, err := conn.GetBucketTagging(input) + + // S3 API Reference (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html) + // lists the special error as NoSuchTagSetError, however the existing logic used NoSuchTagSet + // and the AWS Go SDK has neither as a constant. + if awsbase.IsAWSErr(err, "NoSuchTagSet", "") { + return New(nil), nil + } + + if err != nil { + return New(nil), err + } + + return S3KeyValueTags(output.TagSet), nil +} + +// S3BucketUpdateTags updates S3 bucket tags. +// The identifier is the bucket name. +func S3BucketUpdateTags(conn *s3.S3, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + // We need to also consider any existing system tags. + allTags, err := S3BucketListTags(conn, identifier) + + if err != nil { + return fmt.Errorf("error listing resource tags (%s): %w", identifier, err) + } + + sysTags := allTags.Removed(allTags.IgnoreAws()) + + if len(newTags)+len(sysTags) > 0 { + input := &s3.PutBucketTaggingInput{ + Bucket: aws.String(identifier), + Tagging: &s3.Tagging{ + TagSet: newTags.Merge(sysTags).S3Tags(), + }, + } + + _, err := conn.PutBucketTagging(input) + + if err != nil { + return fmt.Errorf("error setting resource tags (%s): %w", identifier, err) + } + } else if len(oldTags) > 0 && len(sysTags) == 0 { + input := &s3.DeleteBucketTaggingInput{ + Bucket: aws.String(identifier), + } + + _, err := conn.DeleteBucketTagging(input) + + if err != nil { + return fmt.Errorf("error deleting resource tags (%s): %w", identifier, err) + } + } + + return nil +} + +// S3ObjectListTags lists S3 object tags. +func S3ObjectListTags(conn *s3.S3, bucket, key string) (KeyValueTags, error) { + input := &s3.GetObjectTaggingInput{ + Bucket: aws.String(bucket), + Key: aws.String(key), + } + + output, err := conn.GetObjectTagging(input) + + if err != nil { + return New(nil), err + } + + return S3KeyValueTags(output.TagSet), nil +} + +// S3ObjectUpdateTags updates S3 object tags. +func S3ObjectUpdateTags(conn *s3.S3, bucket, key string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if len(newTags) > 0 { + input := &s3.PutObjectTaggingInput{ + Bucket: aws.String(bucket), + Key: aws.String(key), + Tagging: &s3.Tagging{ + TagSet: newTags.IgnoreAws().S3Tags(), + }, + } + + _, err := conn.PutObjectTagging(input) + + if err != nil { + return fmt.Errorf("error setting resource tags (%s/%s): %w", bucket, key, err) + } + } else if len(oldTags) > 0 { + input := &s3.DeleteObjectTaggingInput{ + Bucket: aws.String(bucket), + Key: aws.String(key), + } + + _, err := conn.DeleteObjectTagging(input) + + if err != nil { + return fmt.Errorf("error deleting resource tags (%s/%s): %w", bucket, key, err) + } + } + + return nil +} diff --git a/aws/internal/keyvaluetags/service_generation_customizations.go b/aws/internal/keyvaluetags/service_generation_customizations.go index 663cec63448..283328c7d00 100644 --- a/aws/internal/keyvaluetags/service_generation_customizations.go +++ b/aws/internal/keyvaluetags/service_generation_customizations.go @@ -4,8 +4,11 @@ package keyvaluetags import ( "fmt" + "github.com/aws/aws-sdk-go/service/quicksight" "reflect" + "github.com/aws/aws-sdk-go/service/accessanalyzer" + "github.com/aws/aws-sdk-go/service/acm" "github.com/aws/aws-sdk-go/service/acmpca" "github.com/aws/aws-sdk-go/service/amplify" "github.com/aws/aws-sdk-go/service/apigateway" @@ -17,23 +20,29 @@ import ( "github.com/aws/aws-sdk-go/service/backup" "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/aws/aws-sdk-go/service/cloudhsmv2" + "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/codecommit" "github.com/aws/aws-sdk-go/service/codedeploy" "github.com/aws/aws-sdk-go/service/codepipeline" + "github.com/aws/aws-sdk-go/service/codestarnotifications" "github.com/aws/aws-sdk-go/service/cognitoidentity" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/aws/aws-sdk-go/service/configservice" "github.com/aws/aws-sdk-go/service/databasemigrationservice" + "github.com/aws/aws-sdk-go/service/dataexchange" "github.com/aws/aws-sdk-go/service/datapipeline" "github.com/aws/aws-sdk-go/service/datasync" "github.com/aws/aws-sdk-go/service/dax" "github.com/aws/aws-sdk-go/service/devicefarm" "github.com/aws/aws-sdk-go/service/directconnect" "github.com/aws/aws-sdk-go/service/directoryservice" + "github.com/aws/aws-sdk-go/service/dlm" "github.com/aws/aws-sdk-go/service/docdb" "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" @@ -41,16 +50,23 @@ import ( "github.com/aws/aws-sdk-go/service/elasticache" "github.com/aws/aws-sdk-go/service/elasticbeanstalk" "github.com/aws/aws-sdk-go/service/elasticsearchservice" + "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/fsx" + "github.com/aws/aws-sdk-go/service/gamelift" + "github.com/aws/aws-sdk-go/service/glacier" "github.com/aws/aws-sdk-go/service/glue" + "github.com/aws/aws-sdk-go/service/greengrass" "github.com/aws/aws-sdk-go/service/guardduty" + "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/aws/aws-sdk-go/service/inspector" "github.com/aws/aws-sdk-go/service/iot" "github.com/aws/aws-sdk-go/service/iotanalytics" "github.com/aws/aws-sdk-go/service/iotevents" "github.com/aws/aws-sdk-go/service/kafka" + "github.com/aws/aws-sdk-go/service/kinesis" "github.com/aws/aws-sdk-go/service/kinesisanalytics" "github.com/aws/aws-sdk-go/service/kinesisanalyticsv2" "github.com/aws/aws-sdk-go/service/kms" @@ -67,20 +83,26 @@ import ( "github.com/aws/aws-sdk-go/service/opsworks" "github.com/aws/aws-sdk-go/service/organizations" "github.com/aws/aws-sdk-go/service/pinpoint" + "github.com/aws/aws-sdk-go/service/qldb" "github.com/aws/aws-sdk-go/service/ram" "github.com/aws/aws-sdk-go/service/rds" "github.com/aws/aws-sdk-go/service/redshift" + "github.com/aws/aws-sdk-go/service/resourcegroups" + "github.com/aws/aws-sdk-go/service/route53" "github.com/aws/aws-sdk-go/service/route53resolver" "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/aws/aws-sdk-go/service/securityhub" "github.com/aws/aws-sdk-go/service/sfn" "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/storagegateway" "github.com/aws/aws-sdk-go/service/swf" "github.com/aws/aws-sdk-go/service/transfer" "github.com/aws/aws-sdk-go/service/waf" + "github.com/aws/aws-sdk-go/service/wafregional" + "github.com/aws/aws-sdk-go/service/wafv2" "github.com/aws/aws-sdk-go/service/workspaces" ) @@ -91,6 +113,10 @@ func ServiceClientType(serviceName string) string { var funcType reflect.Type switch serviceName { + case "accessanalyzer": + funcType = reflect.TypeOf(accessanalyzer.New) + case "acm": + funcType = reflect.TypeOf(acm.New) case "acmpca": funcType = reflect.TypeOf(acmpca.New) case "amplify": @@ -113,16 +139,22 @@ func ServiceClientType(serviceName string) string { funcType = reflect.TypeOf(cloudfront.New) case "cloudhsmv2": funcType = reflect.TypeOf(cloudhsmv2.New) + case "cloudtrail": + funcType = reflect.TypeOf(cloudtrail.New) case "cloudwatch": funcType = reflect.TypeOf(cloudwatch.New) case "cloudwatchevents": funcType = reflect.TypeOf(cloudwatchevents.New) + case "cloudwatchlogs": + funcType = reflect.TypeOf(cloudwatchlogs.New) case "codecommit": funcType = reflect.TypeOf(codecommit.New) case "codedeploy": funcType = reflect.TypeOf(codedeploy.New) case "codepipeline": funcType = reflect.TypeOf(codepipeline.New) + case "codestarnotifications": + funcType = reflect.TypeOf(codestarnotifications.New) case "cognitoidentity": funcType = reflect.TypeOf(cognitoidentity.New) case "cognitoidentityprovider": @@ -131,6 +163,8 @@ func ServiceClientType(serviceName string) string { funcType = reflect.TypeOf(configservice.New) case "databasemigrationservice": funcType = reflect.TypeOf(databasemigrationservice.New) + case "dataexchange": + funcType = reflect.TypeOf(dataexchange.New) case "datapipeline": funcType = reflect.TypeOf(datapipeline.New) case "datasync": @@ -143,10 +177,14 @@ func ServiceClientType(serviceName string) string { funcType = reflect.TypeOf(directconnect.New) case "directoryservice": funcType = reflect.TypeOf(directoryservice.New) + case "dlm": + funcType = reflect.TypeOf(dlm.New) case "docdb": funcType = reflect.TypeOf(docdb.New) case "dynamodb": funcType = reflect.TypeOf(dynamodb.New) + case "ec2": + funcType = reflect.TypeOf(ec2.New) case "ecr": funcType = reflect.TypeOf(ecr.New) case "ecs": @@ -161,16 +199,28 @@ func ServiceClientType(serviceName string) string { funcType = reflect.TypeOf(elasticbeanstalk.New) case "elasticsearchservice": funcType = reflect.TypeOf(elasticsearchservice.New) + case "elb": + funcType = reflect.TypeOf(elb.New) + case "elbv2": + funcType = reflect.TypeOf(elbv2.New) case "emr": funcType = reflect.TypeOf(emr.New) case "firehose": funcType = reflect.TypeOf(firehose.New) case "fsx": funcType = reflect.TypeOf(fsx.New) + case "gamelift": + funcType = reflect.TypeOf(gamelift.New) + case "glacier": + funcType = reflect.TypeOf(glacier.New) case "glue": funcType = reflect.TypeOf(glue.New) case "guardduty": funcType = reflect.TypeOf(guardduty.New) + case "greengrass": + funcType = reflect.TypeOf(greengrass.New) + case "imagebuilder": + funcType = reflect.TypeOf(imagebuilder.New) case "inspector": funcType = reflect.TypeOf(inspector.New) case "iot": @@ -181,6 +231,8 @@ func ServiceClientType(serviceName string) string { funcType = reflect.TypeOf(iotevents.New) case "kafka": funcType = reflect.TypeOf(kafka.New) + case "kinesis": + funcType = reflect.TypeOf(kinesis.New) case "kinesisanalytics": funcType = reflect.TypeOf(kinesisanalytics.New) case "kinesisanalyticsv2": @@ -213,12 +265,20 @@ func ServiceClientType(serviceName string) string { funcType = reflect.TypeOf(organizations.New) case "pinpoint": funcType = reflect.TypeOf(pinpoint.New) + case "qldb": + funcType = reflect.TypeOf(qldb.New) + case "quicksight": + funcType = reflect.TypeOf(quicksight.New) case "ram": funcType = reflect.TypeOf(ram.New) case "rds": funcType = reflect.TypeOf(rds.New) case "redshift": funcType = reflect.TypeOf(redshift.New) + case "resourcegroups": + funcType = reflect.TypeOf(resourcegroups.New) + case "route53": + funcType = reflect.TypeOf(route53.New) case "route53resolver": funcType = reflect.TypeOf(route53resolver.New) case "sagemaker": @@ -231,6 +291,8 @@ func ServiceClientType(serviceName string) string { funcType = reflect.TypeOf(sfn.New) case "sns": funcType = reflect.TypeOf(sns.New) + case "sqs": + funcType = reflect.TypeOf(sqs.New) case "ssm": funcType = reflect.TypeOf(ssm.New) case "storagegateway": @@ -241,6 +303,10 @@ func ServiceClientType(serviceName string) string { funcType = reflect.TypeOf(transfer.New) case "waf": funcType = reflect.TypeOf(waf.New) + case "wafregional": + funcType = reflect.TypeOf(wafregional.New) + case "wafv2": + funcType = reflect.TypeOf(wafv2.New) case "workspaces": funcType = reflect.TypeOf(workspaces.New) default: @@ -249,3 +315,12 @@ func ServiceClientType(serviceName string) string { return funcType.Out(0).String() } + +func ServiceTagPackage(serviceName string) string { + switch serviceName { + case "wafregional": + return "waf" + default: + return serviceName + } +} diff --git a/aws/internal/keyvaluetags/service_tags_gen.go b/aws/internal/keyvaluetags/service_tags_gen.go index 180e5394aae..02a150641f4 100644 --- a/aws/internal/keyvaluetags/service_tags_gen.go +++ b/aws/internal/keyvaluetags/service_tags_gen.go @@ -25,7 +25,6 @@ import ( "github.com/aws/aws-sdk-go/service/devicefarm" "github.com/aws/aws-sdk-go/service/directconnect" "github.com/aws/aws-sdk-go/service/directoryservice" - "github.com/aws/aws-sdk-go/service/dlm" "github.com/aws/aws-sdk-go/service/docdb" "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/aws/aws-sdk-go/service/ec2" @@ -41,6 +40,7 @@ import ( "github.com/aws/aws-sdk-go/service/firehose" "github.com/aws/aws-sdk-go/service/fms" "github.com/aws/aws-sdk-go/service/fsx" + "github.com/aws/aws-sdk-go/service/gamelift" "github.com/aws/aws-sdk-go/service/iam" "github.com/aws/aws-sdk-go/service/inspector" "github.com/aws/aws-sdk-go/service/iot" @@ -55,6 +55,7 @@ import ( "github.com/aws/aws-sdk-go/service/mediastore" "github.com/aws/aws-sdk-go/service/neptune" "github.com/aws/aws-sdk-go/service/organizations" + "github.com/aws/aws-sdk-go/service/quicksight" "github.com/aws/aws-sdk-go/service/ram" "github.com/aws/aws-sdk-go/service/rds" "github.com/aws/aws-sdk-go/service/redshift" @@ -72,11 +73,22 @@ import ( "github.com/aws/aws-sdk-go/service/swf" "github.com/aws/aws-sdk-go/service/transfer" "github.com/aws/aws-sdk-go/service/waf" + "github.com/aws/aws-sdk-go/service/wafv2" "github.com/aws/aws-sdk-go/service/workspaces" ) // map[string]*string handling +// AccessanalyzerTags returns accessanalyzer service tags. +func (tags KeyValueTags) AccessanalyzerTags() map[string]*string { + return aws.StringMap(tags.Map()) +} + +// AccessanalyzerKeyValueTags creates KeyValueTags from accessanalyzer service tags. +func AccessanalyzerKeyValueTags(tags map[string]*string) KeyValueTags { + return New(tags) +} + // AmplifyTags returns amplify service tags. func (tags KeyValueTags) AmplifyTags() map[string]*string { return aws.StringMap(tags.Map()) @@ -167,6 +179,16 @@ func CodecommitKeyValueTags(tags map[string]*string) KeyValueTags { return New(tags) } +// CodestarnotificationsTags returns codestarnotifications service tags. +func (tags KeyValueTags) CodestarnotificationsTags() map[string]*string { + return aws.StringMap(tags.Map()) +} + +// CodestarnotificationsKeyValueTags creates KeyValueTags from codestarnotifications service tags. +func CodestarnotificationsKeyValueTags(tags map[string]*string) KeyValueTags { + return New(tags) +} + // CognitoidentityTags returns cognitoidentity service tags. func (tags KeyValueTags) CognitoidentityTags() map[string]*string { return aws.StringMap(tags.Map()) @@ -187,6 +209,26 @@ func CognitoidentityproviderKeyValueTags(tags map[string]*string) KeyValueTags { return New(tags) } +// DataexchangeTags returns dataexchange service tags. +func (tags KeyValueTags) DataexchangeTags() map[string]*string { + return aws.StringMap(tags.Map()) +} + +// DataexchangeKeyValueTags creates KeyValueTags from dataexchange service tags. +func DataexchangeKeyValueTags(tags map[string]*string) KeyValueTags { + return New(tags) +} + +// DlmTags returns dlm service tags. +func (tags KeyValueTags) DlmTags() map[string]*string { + return aws.StringMap(tags.Map()) +} + +// DlmKeyValueTags creates KeyValueTags from dlm service tags. +func DlmKeyValueTags(tags map[string]*string) KeyValueTags { + return New(tags) +} + // EksTags returns eks service tags. func (tags KeyValueTags) EksTags() map[string]*string { return aws.StringMap(tags.Map()) @@ -217,6 +259,16 @@ func GlueKeyValueTags(tags map[string]*string) KeyValueTags { return New(tags) } +// GreengrassTags returns greengrass service tags. +func (tags KeyValueTags) GreengrassTags() map[string]*string { + return aws.StringMap(tags.Map()) +} + +// GreengrassKeyValueTags creates KeyValueTags from greengrass service tags. +func GreengrassKeyValueTags(tags map[string]*string) KeyValueTags { + return New(tags) +} + // GuarddutyTags returns guardduty service tags. func (tags KeyValueTags) GuarddutyTags() map[string]*string { return aws.StringMap(tags.Map()) @@ -227,6 +279,16 @@ func GuarddutyKeyValueTags(tags map[string]*string) KeyValueTags { return New(tags) } +// ImagebuilderTags returns imagebuilder service tags. +func (tags KeyValueTags) ImagebuilderTags() map[string]*string { + return aws.StringMap(tags.Map()) +} + +// ImagebuilderKeyValueTags creates KeyValueTags from imagebuilder service tags. +func ImagebuilderKeyValueTags(tags map[string]*string) KeyValueTags { + return New(tags) +} + // KafkaTags returns kafka service tags. func (tags KeyValueTags) KafkaTags() map[string]*string { return aws.StringMap(tags.Map()) @@ -317,6 +379,16 @@ func PinpointKeyValueTags(tags map[string]*string) KeyValueTags { return New(tags) } +// QldbTags returns qldb service tags. +func (tags KeyValueTags) QldbTags() map[string]*string { + return aws.StringMap(tags.Map()) +} + +// QldbKeyValueTags creates KeyValueTags from qldb service tags. +func QldbKeyValueTags(tags map[string]*string) KeyValueTags { + return New(tags) +} + // ResourcegroupsTags returns resourcegroups service tags. func (tags KeyValueTags) ResourcegroupsTags() map[string]*string { return aws.StringMap(tags.Map()) @@ -916,33 +988,6 @@ func DirectoryserviceKeyValueTags(tags []*directoryservice.Tag) KeyValueTags { return New(m) } -// DlmTags returns dlm service tags. -func (tags KeyValueTags) DlmTags() []*dlm.Tag { - result := make([]*dlm.Tag, 0, len(tags)) - - for k, v := range tags.Map() { - tag := &dlm.Tag{ - Key: aws.String(k), - Value: aws.String(v), - } - - result = append(result, tag) - } - - return result -} - -// DlmKeyValueTags creates KeyValueTags from dlm service tags. -func DlmKeyValueTags(tags []*dlm.Tag) KeyValueTags { - m := make(map[string]*string, len(tags)) - - for _, tag := range tags { - m[aws.StringValue(tag.Key)] = tag.Value - } - - return New(m) -} - // DocdbTags returns docdb service tags. func (tags KeyValueTags) DocdbTags() []*docdb.Tag { result := make([]*docdb.Tag, 0, len(tags)) @@ -1186,6 +1231,21 @@ func ElasticsearchserviceKeyValueTags(tags []*elasticsearchservice.Tag) KeyValue return New(m) } +// ElbTagKeys returns elb service tag keys. +func (tags KeyValueTags) ElbTagKeys() []*elb.TagKeyOnly { + result := make([]*elb.TagKeyOnly, 0, len(tags)) + + for k := range tags.Map() { + tagKey := &elb.TagKeyOnly{ + Key: aws.String(k), + } + + result = append(result, tagKey) + } + + return result +} + // ElbTags returns elb service tags. func (tags KeyValueTags) ElbTags() []*elb.Tag { result := make([]*elb.Tag, 0, len(tags)) @@ -1348,6 +1408,33 @@ func FsxKeyValueTags(tags []*fsx.Tag) KeyValueTags { return New(m) } +// GameliftTags returns gamelift service tags. +func (tags KeyValueTags) GameliftTags() []*gamelift.Tag { + result := make([]*gamelift.Tag, 0, len(tags)) + + for k, v := range tags.Map() { + tag := &gamelift.Tag{ + Key: aws.String(k), + Value: aws.String(v), + } + + result = append(result, tag) + } + + return result +} + +// GameliftKeyValueTags creates KeyValueTags from gamelift service tags. +func GameliftKeyValueTags(tags []*gamelift.Tag) KeyValueTags { + m := make(map[string]*string, len(tags)) + + for _, tag := range tags { + m[aws.StringValue(tag.Key)] = tag.Value + } + + return New(m) +} + // IamTags returns iam service tags. func (tags KeyValueTags) IamTags() []*iam.Tag { result := make([]*iam.Tag, 0, len(tags)) @@ -1726,6 +1813,33 @@ func OrganizationsKeyValueTags(tags []*organizations.Tag) KeyValueTags { return New(m) } +// QuicksightTags returns quicksight service tags. +func (tags KeyValueTags) QuicksightTags() []*quicksight.Tag { + result := make([]*quicksight.Tag, 0, len(tags)) + + for k, v := range tags.Map() { + tag := &quicksight.Tag{ + Key: aws.String(k), + Value: aws.String(v), + } + + result = append(result, tag) + } + + return result +} + +// QuicksightKeyValueTags creates KeyValueTags from quicksight service tags. +func QuicksightKeyValueTags(tags []*quicksight.Tag) KeyValueTags { + m := make(map[string]*string, len(tags)) + + for _, tag := range tags { + m[aws.StringValue(tag.Key)] = tag.Value + } + + return New(m) +} + // RamTags returns ram service tags. func (tags KeyValueTags) RamTags() []*ram.Tag { result := make([]*ram.Tag, 0, len(tags)) @@ -2185,6 +2299,60 @@ func WafKeyValueTags(tags []*waf.Tag) KeyValueTags { return New(m) } +// WafregionalTags returns wafregional service tags. +func (tags KeyValueTags) WafregionalTags() []*waf.Tag { + result := make([]*waf.Tag, 0, len(tags)) + + for k, v := range tags.Map() { + tag := &waf.Tag{ + Key: aws.String(k), + Value: aws.String(v), + } + + result = append(result, tag) + } + + return result +} + +// WafregionalKeyValueTags creates KeyValueTags from wafregional service tags. +func WafregionalKeyValueTags(tags []*waf.Tag) KeyValueTags { + m := make(map[string]*string, len(tags)) + + for _, tag := range tags { + m[aws.StringValue(tag.Key)] = tag.Value + } + + return New(m) +} + +// Wafv2Tags returns wafv2 service tags. +func (tags KeyValueTags) Wafv2Tags() []*wafv2.Tag { + result := make([]*wafv2.Tag, 0, len(tags)) + + for k, v := range tags.Map() { + tag := &wafv2.Tag{ + Key: aws.String(k), + Value: aws.String(v), + } + + result = append(result, tag) + } + + return result +} + +// Wafv2KeyValueTags creates KeyValueTags from wafv2 service tags. +func Wafv2KeyValueTags(tags []*wafv2.Tag) KeyValueTags { + m := make(map[string]*string, len(tags)) + + for _, tag := range tags { + m[aws.StringValue(tag.Key)] = tag.Value + } + + return New(m) +} + // WorkspacesTags returns workspaces service tags. func (tags KeyValueTags) WorkspacesTags() []*workspaces.Tag { result := make([]*workspaces.Tag, 0, len(tags)) diff --git a/aws/internal/keyvaluetags/service_tags_gen_test.go b/aws/internal/keyvaluetags/service_tags_gen_test.go index 525f90a4214..720c63b6e66 100644 --- a/aws/internal/keyvaluetags/service_tags_gen_test.go +++ b/aws/internal/keyvaluetags/service_tags_gen_test.go @@ -1,6 +1,7 @@ package keyvaluetags import ( + "github.com/aws/aws-sdk-go/service/quicksight" "testing" "github.com/aws/aws-sdk-go/aws" @@ -481,3 +482,101 @@ func TestKeyValueTagsAppmeshTags(t *testing.T) { }) } } + +func TestQuicksightKeyValueTags(t *testing.T) { + testCases := []struct { + name string + tags []*quicksight.Tag + want map[string]string + }{ + { + name: "empty", + tags: []*quicksight.Tag{}, + want: map[string]string{}, + }, + { + name: "non_empty", + tags: []*quicksight.Tag{ + { + Key: aws.String("key1"), + Value: aws.String("value1"), + }, + { + Key: aws.String("key2"), + Value: aws.String("value2"), + }, + { + Key: aws.String("key3"), + Value: aws.String("value3"), + }, + }, + want: map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + got := QuicksightKeyValueTags(testCase.tags) + + testKeyValueTagsVerifyMap(t, got.Map(), testCase.want) + }) + } +} + +func TestKeyValueTagsQuicksightTags(t *testing.T) { + testCases := []struct { + name string + tags KeyValueTags + want []*quicksight.Tag + }{ + { + name: "empty", + tags: New(map[string]string{}), + want: []*quicksight.Tag{}, + }, + { + name: "non_empty", + tags: New(map[string]string{ + "key1": "value1", + "key2": "value2", + "key3": "value3", + }), + want: []*quicksight.Tag{ + { + Key: aws.String("key1"), + Value: aws.String("value1"), + }, + { + Key: aws.String("key2"), + Value: aws.String("value2"), + }, + { + Key: aws.String("key3"), + Value: aws.String("value3"), + }, + }, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.name, func(t *testing.T) { + got := testCase.tags.QuicksightTags() + + gotMap := make(map[string]string, len(got)) + for _, tag := range got { + gotMap[aws.StringValue(tag.Key)] = aws.StringValue(tag.Value) + } + + wantMap := make(map[string]string, len(testCase.want)) + for _, tag := range testCase.want { + wantMap[aws.StringValue(tag.Key)] = aws.StringValue(tag.Value) + } + + testKeyValueTagsVerifyMap(t, gotMap, wantMap) + }) + } +} diff --git a/aws/internal/keyvaluetags/update_tags_gen.go b/aws/internal/keyvaluetags/update_tags_gen.go index 983534cd5ff..ae270c6a986 100644 --- a/aws/internal/keyvaluetags/update_tags_gen.go +++ b/aws/internal/keyvaluetags/update_tags_gen.go @@ -6,6 +6,9 @@ import ( "fmt" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/accessanalyzer" + "github.com/aws/aws-sdk-go/service/acm" + "github.com/aws/aws-sdk-go/service/acmpca" "github.com/aws/aws-sdk-go/service/amplify" "github.com/aws/aws-sdk-go/service/apigateway" "github.com/aws/aws-sdk-go/service/apigatewayv2" @@ -14,39 +17,54 @@ import ( "github.com/aws/aws-sdk-go/service/appsync" "github.com/aws/aws-sdk-go/service/athena" "github.com/aws/aws-sdk-go/service/backup" + "github.com/aws/aws-sdk-go/service/cloudfront" "github.com/aws/aws-sdk-go/service/cloudhsmv2" + "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/codecommit" "github.com/aws/aws-sdk-go/service/codedeploy" "github.com/aws/aws-sdk-go/service/codepipeline" + "github.com/aws/aws-sdk-go/service/codestarnotifications" "github.com/aws/aws-sdk-go/service/cognitoidentity" "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" "github.com/aws/aws-sdk-go/service/configservice" "github.com/aws/aws-sdk-go/service/databasemigrationservice" + "github.com/aws/aws-sdk-go/service/dataexchange" "github.com/aws/aws-sdk-go/service/datapipeline" "github.com/aws/aws-sdk-go/service/datasync" "github.com/aws/aws-sdk-go/service/dax" "github.com/aws/aws-sdk-go/service/devicefarm" "github.com/aws/aws-sdk-go/service/directconnect" "github.com/aws/aws-sdk-go/service/directoryservice" + "github.com/aws/aws-sdk-go/service/dlm" "github.com/aws/aws-sdk-go/service/docdb" "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/eks" "github.com/aws/aws-sdk-go/service/elasticache" + "github.com/aws/aws-sdk-go/service/elasticbeanstalk" "github.com/aws/aws-sdk-go/service/elasticsearchservice" + "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/fsx" + "github.com/aws/aws-sdk-go/service/gamelift" + "github.com/aws/aws-sdk-go/service/glacier" "github.com/aws/aws-sdk-go/service/glue" + "github.com/aws/aws-sdk-go/service/greengrass" "github.com/aws/aws-sdk-go/service/guardduty" + "github.com/aws/aws-sdk-go/service/imagebuilder" "github.com/aws/aws-sdk-go/service/iot" "github.com/aws/aws-sdk-go/service/iotanalytics" "github.com/aws/aws-sdk-go/service/iotevents" "github.com/aws/aws-sdk-go/service/kafka" + "github.com/aws/aws-sdk-go/service/kinesis" "github.com/aws/aws-sdk-go/service/kinesisanalytics" "github.com/aws/aws-sdk-go/service/kinesisanalyticsv2" "github.com/aws/aws-sdk-go/service/kms" @@ -62,22 +80,139 @@ import ( "github.com/aws/aws-sdk-go/service/neptune" "github.com/aws/aws-sdk-go/service/opsworks" "github.com/aws/aws-sdk-go/service/organizations" + "github.com/aws/aws-sdk-go/service/pinpoint" + "github.com/aws/aws-sdk-go/service/qldb" + "github.com/aws/aws-sdk-go/service/quicksight" "github.com/aws/aws-sdk-go/service/ram" "github.com/aws/aws-sdk-go/service/rds" "github.com/aws/aws-sdk-go/service/redshift" + "github.com/aws/aws-sdk-go/service/resourcegroups" + "github.com/aws/aws-sdk-go/service/route53" "github.com/aws/aws-sdk-go/service/route53resolver" + "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/aws/aws-sdk-go/service/securityhub" "github.com/aws/aws-sdk-go/service/sfn" "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/storagegateway" "github.com/aws/aws-sdk-go/service/swf" "github.com/aws/aws-sdk-go/service/transfer" "github.com/aws/aws-sdk-go/service/waf" + "github.com/aws/aws-sdk-go/service/wafregional" + "github.com/aws/aws-sdk-go/service/wafv2" "github.com/aws/aws-sdk-go/service/workspaces" ) +// AccessanalyzerUpdateTags updates accessanalyzer service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func AccessanalyzerUpdateTags(conn *accessanalyzer.AccessAnalyzer, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &accessanalyzer.UntagResourceInput{ + ResourceArn: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.UntagResource(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &accessanalyzer.TagResourceInput{ + ResourceArn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().AccessanalyzerTags(), + } + + _, err := conn.TagResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// AcmUpdateTags updates acm service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func AcmUpdateTags(conn *acm.ACM, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &acm.RemoveTagsFromCertificateInput{ + CertificateArn: aws.String(identifier), + Tags: removedTags.IgnoreAws().AcmTags(), + } + + _, err := conn.RemoveTagsFromCertificate(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &acm.AddTagsToCertificateInput{ + CertificateArn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().AcmTags(), + } + + _, err := conn.AddTagsToCertificate(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// AcmpcaUpdateTags updates acmpca service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func AcmpcaUpdateTags(conn *acmpca.ACMPCA, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &acmpca.UntagCertificateAuthorityInput{ + CertificateAuthorityArn: aws.String(identifier), + Tags: removedTags.IgnoreAws().AcmpcaTags(), + } + + _, err := conn.UntagCertificateAuthority(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &acmpca.TagCertificateAuthorityInput{ + CertificateAuthorityArn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().AcmpcaTags(), + } + + _, err := conn.TagCertificateAuthority(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + // AmplifyUpdateTags updates amplify service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -88,13 +223,13 @@ func AmplifyUpdateTags(conn *amplify.Amplify, identifier string, oldTagsMap inte if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &lify.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -107,7 +242,7 @@ func AmplifyUpdateTags(conn *amplify.Amplify, identifier string, oldTagsMap inte _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -124,13 +259,13 @@ func ApigatewayUpdateTags(conn *apigateway.APIGateway, identifier string, oldTag if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &apigateway.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -143,7 +278,7 @@ func ApigatewayUpdateTags(conn *apigateway.APIGateway, identifier string, oldTag _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -160,13 +295,13 @@ func Apigatewayv2UpdateTags(conn *apigatewayv2.ApiGatewayV2, identifier string, if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &apigatewayv2.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -179,7 +314,7 @@ func Apigatewayv2UpdateTags(conn *apigatewayv2.ApiGatewayV2, identifier string, _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -196,13 +331,13 @@ func AppmeshUpdateTags(conn *appmesh.AppMesh, identifier string, oldTagsMap inte if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &appmesh.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -215,7 +350,7 @@ func AppmeshUpdateTags(conn *appmesh.AppMesh, identifier string, oldTagsMap inte _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -232,13 +367,13 @@ func AppstreamUpdateTags(conn *appstream.AppStream, identifier string, oldTagsMa if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &appstream.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -251,7 +386,7 @@ func AppstreamUpdateTags(conn *appstream.AppStream, identifier string, oldTagsMa _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -268,13 +403,13 @@ func AppsyncUpdateTags(conn *appsync.AppSync, identifier string, oldTagsMap inte if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &appsync.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -287,7 +422,7 @@ func AppsyncUpdateTags(conn *appsync.AppSync, identifier string, oldTagsMap inte _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -304,13 +439,13 @@ func AthenaUpdateTags(conn *athena.Athena, identifier string, oldTagsMap interfa if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &athena.UntagResourceInput{ ResourceARN: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -323,7 +458,7 @@ func AthenaUpdateTags(conn *athena.Athena, identifier string, oldTagsMap interfa _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -340,13 +475,13 @@ func BackupUpdateTags(conn *backup.Backup, identifier string, oldTagsMap interfa if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &backup.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeyList: aws.StringSlice(removedTags.Keys()), + TagKeyList: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -359,7 +494,43 @@ func BackupUpdateTags(conn *backup.Backup, identifier string, oldTagsMap interfa _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// CloudfrontUpdateTags updates cloudfront service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func CloudfrontUpdateTags(conn *cloudfront.CloudFront, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &cloudfront.UntagResourceInput{ + Resource: aws.String(identifier), + TagKeys: &cloudfront.TagKeys{Items: aws.StringSlice(removedTags.IgnoreAws().Keys())}, + } + + _, err := conn.UntagResource(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &cloudfront.TagResourceInput{ + Resource: aws.String(identifier), + Tags: &cloudfront.Tags{Items: updatedTags.IgnoreAws().CloudfrontTags()}, + } + + _, err := conn.TagResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -376,13 +547,13 @@ func Cloudhsmv2UpdateTags(conn *cloudhsmv2.CloudHSMV2, identifier string, oldTag if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &cloudhsmv2.UntagResourceInput{ ResourceId: aws.String(identifier), - TagKeyList: aws.StringSlice(removedTags.Keys()), + TagKeyList: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -395,7 +566,43 @@ func Cloudhsmv2UpdateTags(conn *cloudhsmv2.CloudHSMV2, identifier string, oldTag _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// CloudtrailUpdateTags updates cloudtrail service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func CloudtrailUpdateTags(conn *cloudtrail.CloudTrail, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &cloudtrail.RemoveTagsInput{ + ResourceId: aws.String(identifier), + TagsList: removedTags.IgnoreAws().CloudtrailTags(), + } + + _, err := conn.RemoveTags(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &cloudtrail.AddTagsInput{ + ResourceId: aws.String(identifier), + TagsList: updatedTags.IgnoreAws().CloudtrailTags(), + } + + _, err := conn.AddTags(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -412,13 +619,13 @@ func CloudwatchUpdateTags(conn *cloudwatch.CloudWatch, identifier string, oldTag if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &cloudwatch.UntagResourceInput{ ResourceARN: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -431,7 +638,7 @@ func CloudwatchUpdateTags(conn *cloudwatch.CloudWatch, identifier string, oldTag _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -448,13 +655,13 @@ func CloudwatcheventsUpdateTags(conn *cloudwatchevents.CloudWatchEvents, identif if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &cloudwatchevents.UntagResourceInput{ ResourceARN: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -467,7 +674,43 @@ func CloudwatcheventsUpdateTags(conn *cloudwatchevents.CloudWatchEvents, identif _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// CloudwatchlogsUpdateTags updates cloudwatchlogs service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func CloudwatchlogsUpdateTags(conn *cloudwatchlogs.CloudWatchLogs, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &cloudwatchlogs.UntagLogGroupInput{ + LogGroupName: aws.String(identifier), + Tags: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.UntagLogGroup(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &cloudwatchlogs.TagLogGroupInput{ + LogGroupName: aws.String(identifier), + Tags: updatedTags.IgnoreAws().CloudwatchlogsTags(), + } + + _, err := conn.TagLogGroup(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -484,13 +727,13 @@ func CodecommitUpdateTags(conn *codecommit.CodeCommit, identifier string, oldTag if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &codecommit.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -503,7 +746,7 @@ func CodecommitUpdateTags(conn *codecommit.CodeCommit, identifier string, oldTag _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -520,13 +763,13 @@ func CodedeployUpdateTags(conn *codedeploy.CodeDeploy, identifier string, oldTag if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &codedeploy.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -539,7 +782,7 @@ func CodedeployUpdateTags(conn *codedeploy.CodeDeploy, identifier string, oldTag _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -556,13 +799,13 @@ func CodepipelineUpdateTags(conn *codepipeline.CodePipeline, identifier string, if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &codepipeline.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -575,7 +818,43 @@ func CodepipelineUpdateTags(conn *codepipeline.CodePipeline, identifier string, _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// CodestarnotificationsUpdateTags updates codestarnotifications service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func CodestarnotificationsUpdateTags(conn *codestarnotifications.CodeStarNotifications, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &codestarnotifications.UntagResourceInput{ + Arn: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.UntagResource(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &codestarnotifications.TagResourceInput{ + Arn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().CodestarnotificationsTags(), + } + + _, err := conn.TagResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -592,13 +871,13 @@ func CognitoidentityUpdateTags(conn *cognitoidentity.CognitoIdentity, identifier if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &cognitoidentity.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -611,7 +890,7 @@ func CognitoidentityUpdateTags(conn *cognitoidentity.CognitoIdentity, identifier _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -628,13 +907,13 @@ func CognitoidentityproviderUpdateTags(conn *cognitoidentityprovider.CognitoIden if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &cognitoidentityprovider.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -647,7 +926,7 @@ func CognitoidentityproviderUpdateTags(conn *cognitoidentityprovider.CognitoIden _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -664,13 +943,13 @@ func ConfigserviceUpdateTags(conn *configservice.ConfigService, identifier strin if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &configservice.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -683,7 +962,7 @@ func ConfigserviceUpdateTags(conn *configservice.ConfigService, identifier strin _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -700,13 +979,13 @@ func DatabasemigrationserviceUpdateTags(conn *databasemigrationservice.DatabaseM if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &databasemigrationservice.RemoveTagsFromResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.RemoveTagsFromResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -719,7 +998,43 @@ func DatabasemigrationserviceUpdateTags(conn *databasemigrationservice.DatabaseM _, err := conn.AddTagsToResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// DataexchangeUpdateTags updates dataexchange service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func DataexchangeUpdateTags(conn *dataexchange.DataExchange, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &dataexchange.UntagResourceInput{ + ResourceArn: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.UntagResource(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &dataexchange.TagResourceInput{ + ResourceArn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().DataexchangeTags(), + } + + _, err := conn.TagResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -736,13 +1051,13 @@ func DatapipelineUpdateTags(conn *datapipeline.DataPipeline, identifier string, if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &datapipeline.RemoveTagsInput{ PipelineId: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.RemoveTags(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -755,7 +1070,7 @@ func DatapipelineUpdateTags(conn *datapipeline.DataPipeline, identifier string, _, err := conn.AddTags(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -772,13 +1087,13 @@ func DatasyncUpdateTags(conn *datasync.DataSync, identifier string, oldTagsMap i if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &datasync.UntagResourceInput{ ResourceArn: aws.String(identifier), - Keys: aws.StringSlice(removedTags.Keys()), + Keys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -791,7 +1106,7 @@ func DatasyncUpdateTags(conn *datasync.DataSync, identifier string, oldTagsMap i _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -808,13 +1123,13 @@ func DaxUpdateTags(conn *dax.DAX, identifier string, oldTagsMap interface{}, new if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &dax.UntagResourceInput{ ResourceName: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -827,7 +1142,7 @@ func DaxUpdateTags(conn *dax.DAX, identifier string, oldTagsMap interface{}, new _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -844,13 +1159,13 @@ func DevicefarmUpdateTags(conn *devicefarm.DeviceFarm, identifier string, oldTag if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &devicefarm.UntagResourceInput{ ResourceARN: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -863,7 +1178,7 @@ func DevicefarmUpdateTags(conn *devicefarm.DeviceFarm, identifier string, oldTag _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -880,13 +1195,13 @@ func DirectconnectUpdateTags(conn *directconnect.DirectConnect, identifier strin if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &directconnect.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -899,7 +1214,7 @@ func DirectconnectUpdateTags(conn *directconnect.DirectConnect, identifier strin _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -916,13 +1231,13 @@ func DirectoryserviceUpdateTags(conn *directoryservice.DirectoryService, identif if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &directoryservice.RemoveTagsFromResourceInput{ ResourceId: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.RemoveTagsFromResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -935,7 +1250,43 @@ func DirectoryserviceUpdateTags(conn *directoryservice.DirectoryService, identif _, err := conn.AddTagsToResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// DlmUpdateTags updates dlm service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func DlmUpdateTags(conn *dlm.DLM, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &dlm.UntagResourceInput{ + ResourceArn: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.UntagResource(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &dlm.TagResourceInput{ + ResourceArn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().DlmTags(), + } + + _, err := conn.TagResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -952,13 +1303,13 @@ func DocdbUpdateTags(conn *docdb.DocDB, identifier string, oldTagsMap interface{ if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &docdb.RemoveTagsFromResourceInput{ ResourceName: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.RemoveTagsFromResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -971,7 +1322,7 @@ func DocdbUpdateTags(conn *docdb.DocDB, identifier string, oldTagsMap interface{ _, err := conn.AddTagsToResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -988,13 +1339,13 @@ func DynamodbUpdateTags(conn *dynamodb.DynamoDB, identifier string, oldTagsMap i if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &dynamodb.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1007,7 +1358,43 @@ func DynamodbUpdateTags(conn *dynamodb.DynamoDB, identifier string, oldTagsMap i _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// Ec2UpdateTags updates ec2 service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func Ec2UpdateTags(conn *ec2.EC2, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &ec2.DeleteTagsInput{ + Resources: aws.StringSlice([]string{identifier}), + Tags: removedTags.IgnoreAws().Ec2Tags(), + } + + _, err := conn.DeleteTags(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &ec2.CreateTagsInput{ + Resources: aws.StringSlice([]string{identifier}), + Tags: updatedTags.IgnoreAws().Ec2Tags(), + } + + _, err := conn.CreateTags(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1024,13 +1411,13 @@ func EcrUpdateTags(conn *ecr.ECR, identifier string, oldTagsMap interface{}, new if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &ecr.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1043,7 +1430,7 @@ func EcrUpdateTags(conn *ecr.ECR, identifier string, oldTagsMap interface{}, new _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1060,13 +1447,13 @@ func EcsUpdateTags(conn *ecs.ECS, identifier string, oldTagsMap interface{}, new if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &ecs.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1079,7 +1466,7 @@ func EcsUpdateTags(conn *ecs.ECS, identifier string, oldTagsMap interface{}, new _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1094,28 +1481,28 @@ func EfsUpdateTags(conn *efs.EFS, identifier string, oldTagsMap interface{}, new newTags := New(newTagsMap) if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { - input := &efs.DeleteTagsInput{ - FileSystemId: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + input := &efs.UntagResourceInput{ + ResourceId: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } - _, err := conn.DeleteTags(input) + _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { - input := &efs.CreateTagsInput{ - FileSystemId: aws.String(identifier), - Tags: updatedTags.IgnoreAws().EfsTags(), + input := &efs.TagResourceInput{ + ResourceId: aws.String(identifier), + Tags: updatedTags.IgnoreAws().EfsTags(), } - _, err := conn.CreateTags(input) + _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1132,13 +1519,13 @@ func EksUpdateTags(conn *eks.EKS, identifier string, oldTagsMap interface{}, new if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &eks.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1151,7 +1538,7 @@ func EksUpdateTags(conn *eks.EKS, identifier string, oldTagsMap interface{}, new _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1168,13 +1555,13 @@ func ElasticacheUpdateTags(conn *elasticache.ElastiCache, identifier string, old if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &elasticache.RemoveTagsFromResourceInput{ ResourceName: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.RemoveTagsFromResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1187,13 +1574,48 @@ func ElasticacheUpdateTags(conn *elasticache.ElastiCache, identifier string, old _, err := conn.AddTagsToResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } return nil } +// ElasticbeanstalkUpdateTags updates elasticbeanstalk service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func ElasticbeanstalkUpdateTags(conn *elasticbeanstalk.ElasticBeanstalk, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + removedTags := oldTags.Removed(newTags) + updatedTags := oldTags.Updated(newTags) + + // Ensure we do not send empty requests + if len(removedTags) == 0 && len(updatedTags) == 0 { + return nil + } + + input := &elasticbeanstalk.UpdateTagsForResourceInput{ + ResourceArn: aws.String(identifier), + } + + if len(updatedTags) > 0 { + input.TagsToAdd = updatedTags.IgnoreAws().ElasticbeanstalkTags() + } + + if len(removedTags) > 0 { + input.TagsToRemove = aws.StringSlice(removedTags.Keys()) + } + + _, err := conn.UpdateTagsForResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + + return nil +} + // ElasticsearchserviceUpdateTags updates elasticsearchservice service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -1204,13 +1626,13 @@ func ElasticsearchserviceUpdateTags(conn *elasticsearchservice.ElasticsearchServ if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &elasticsearchservice.RemoveTagsInput{ ARN: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.RemoveTags(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1223,7 +1645,79 @@ func ElasticsearchserviceUpdateTags(conn *elasticsearchservice.ElasticsearchServ _, err := conn.AddTags(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// ElbUpdateTags updates elb service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func ElbUpdateTags(conn *elb.ELB, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &elb.RemoveTagsInput{ + LoadBalancerNames: aws.StringSlice([]string{identifier}), + Tags: removedTags.IgnoreAws().ElbTagKeys(), + } + + _, err := conn.RemoveTags(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &elb.AddTagsInput{ + LoadBalancerNames: aws.StringSlice([]string{identifier}), + Tags: updatedTags.IgnoreAws().ElbTags(), + } + + _, err := conn.AddTags(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// Elbv2UpdateTags updates elbv2 service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func Elbv2UpdateTags(conn *elbv2.ELBV2, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &elbv2.RemoveTagsInput{ + ResourceArns: aws.StringSlice([]string{identifier}), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.RemoveTags(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &elbv2.AddTagsInput{ + ResourceArns: aws.StringSlice([]string{identifier}), + Tags: updatedTags.IgnoreAws().Elbv2Tags(), + } + + _, err := conn.AddTags(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1240,13 +1734,13 @@ func EmrUpdateTags(conn *emr.EMR, identifier string, oldTagsMap interface{}, new if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &emr.RemoveTagsInput{ ResourceId: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.RemoveTags(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1259,7 +1753,7 @@ func EmrUpdateTags(conn *emr.EMR, identifier string, oldTagsMap interface{}, new _, err := conn.AddTags(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1276,13 +1770,13 @@ func FirehoseUpdateTags(conn *firehose.Firehose, identifier string, oldTagsMap i if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &firehose.UntagDeliveryStreamInput{ DeliveryStreamName: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagDeliveryStream(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1295,7 +1789,7 @@ func FirehoseUpdateTags(conn *firehose.Firehose, identifier string, oldTagsMap i _, err := conn.TagDeliveryStream(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1312,13 +1806,13 @@ func FsxUpdateTags(conn *fsx.FSx, identifier string, oldTagsMap interface{}, new if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &fsx.UntagResourceInput{ ResourceARN: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1331,7 +1825,79 @@ func FsxUpdateTags(conn *fsx.FSx, identifier string, oldTagsMap interface{}, new _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// GameliftUpdateTags updates gamelift service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func GameliftUpdateTags(conn *gamelift.GameLift, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &gamelift.UntagResourceInput{ + ResourceARN: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.UntagResource(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &gamelift.TagResourceInput{ + ResourceARN: aws.String(identifier), + Tags: updatedTags.IgnoreAws().GameliftTags(), + } + + _, err := conn.TagResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// GlacierUpdateTags updates glacier service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func GlacierUpdateTags(conn *glacier.Glacier, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &glacier.RemoveTagsFromVaultInput{ + VaultName: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.RemoveTagsFromVault(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &glacier.AddTagsToVaultInput{ + VaultName: aws.String(identifier), + Tags: updatedTags.IgnoreAws().GlacierTags(), + } + + _, err := conn.AddTagsToVault(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1348,13 +1914,13 @@ func GlueUpdateTags(conn *glue.Glue, identifier string, oldTagsMap interface{}, if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &glue.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagsToRemove: aws.StringSlice(removedTags.Keys()), + TagsToRemove: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1367,7 +1933,43 @@ func GlueUpdateTags(conn *glue.Glue, identifier string, oldTagsMap interface{}, _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// GreengrassUpdateTags updates greengrass service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func GreengrassUpdateTags(conn *greengrass.Greengrass, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &greengrass.UntagResourceInput{ + ResourceArn: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.UntagResource(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &greengrass.TagResourceInput{ + ResourceArn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().GreengrassTags(), + } + + _, err := conn.TagResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1384,13 +1986,13 @@ func GuarddutyUpdateTags(conn *guardduty.GuardDuty, identifier string, oldTagsMa if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &guardduty.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1403,7 +2005,43 @@ func GuarddutyUpdateTags(conn *guardduty.GuardDuty, identifier string, oldTagsMa _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// ImagebuilderUpdateTags updates imagebuilder service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func ImagebuilderUpdateTags(conn *imagebuilder.Imagebuilder, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &imagebuilder.UntagResourceInput{ + ResourceArn: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.UntagResource(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &imagebuilder.TagResourceInput{ + ResourceArn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().ImagebuilderTags(), + } + + _, err := conn.TagResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1420,13 +2058,13 @@ func IotUpdateTags(conn *iot.IoT, identifier string, oldTagsMap interface{}, new if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &iot.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1439,7 +2077,7 @@ func IotUpdateTags(conn *iot.IoT, identifier string, oldTagsMap interface{}, new _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1456,13 +2094,13 @@ func IotanalyticsUpdateTags(conn *iotanalytics.IoTAnalytics, identifier string, if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &iotanalytics.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1475,7 +2113,7 @@ func IotanalyticsUpdateTags(conn *iotanalytics.IoTAnalytics, identifier string, _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1492,62 +2130,102 @@ func IoteventsUpdateTags(conn *iotevents.IoTEvents, identifier string, oldTagsMa if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &iotevents.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.UntagResource(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &iotevents.TagResourceInput{ + ResourceArn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().IoteventsTags(), + } + + _, err := conn.TagResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// KafkaUpdateTags updates kafka service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func KafkaUpdateTags(conn *kafka.Kafka, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &kafka.UntagResourceInput{ + ResourceArn: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { - input := &iotevents.TagResourceInput{ + input := &kafka.TagResourceInput{ ResourceArn: aws.String(identifier), - Tags: updatedTags.IgnoreAws().IoteventsTags(), + Tags: updatedTags.IgnoreAws().KafkaTags(), } _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } return nil } -// KafkaUpdateTags updates kafka service tags. +// KinesisUpdateTags updates kinesis service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. -func KafkaUpdateTags(conn *kafka.Kafka, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { +func KinesisUpdateTags(conn *kinesis.Kinesis, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { oldTags := New(oldTagsMap) newTags := New(newTagsMap) if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { - input := &kafka.UntagResourceInput{ - ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), - } + for _, removedTags := range removedTags.Chunks(10) { + input := &kinesis.RemoveTagsFromStreamInput{ + StreamName: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } - _, err := conn.UntagResource(input) + _, err := conn.RemoveTagsFromStream(input) - if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } } } if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { - input := &kafka.TagResourceInput{ - ResourceArn: aws.String(identifier), - Tags: updatedTags.IgnoreAws().KafkaTags(), - } + for _, updatedTags := range updatedTags.Chunks(10) { + input := &kinesis.AddTagsToStreamInput{ + StreamName: aws.String(identifier), + Tags: aws.StringMap(updatedTags.IgnoreAws().Map()), + } - _, err := conn.TagResource(input) + _, err := conn.AddTagsToStream(input) - if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } } } @@ -1564,13 +2242,13 @@ func KinesisanalyticsUpdateTags(conn *kinesisanalytics.KinesisAnalytics, identif if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &kinesisanalytics.UntagResourceInput{ ResourceARN: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1583,7 +2261,7 @@ func KinesisanalyticsUpdateTags(conn *kinesisanalytics.KinesisAnalytics, identif _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1600,13 +2278,13 @@ func Kinesisanalyticsv2UpdateTags(conn *kinesisanalyticsv2.KinesisAnalyticsV2, i if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &kinesisanalyticsv2.UntagResourceInput{ ResourceARN: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1619,7 +2297,7 @@ func Kinesisanalyticsv2UpdateTags(conn *kinesisanalyticsv2.KinesisAnalyticsV2, i _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1636,13 +2314,13 @@ func KmsUpdateTags(conn *kms.KMS, identifier string, oldTagsMap interface{}, new if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &kms.UntagResourceInput{ KeyId: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1655,7 +2333,7 @@ func KmsUpdateTags(conn *kms.KMS, identifier string, oldTagsMap interface{}, new _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1672,13 +2350,13 @@ func LambdaUpdateTags(conn *lambda.Lambda, identifier string, oldTagsMap interfa if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &lambda.UntagResourceInput{ Resource: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1691,7 +2369,7 @@ func LambdaUpdateTags(conn *lambda.Lambda, identifier string, oldTagsMap interfa _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1708,13 +2386,13 @@ func LicensemanagerUpdateTags(conn *licensemanager.LicenseManager, identifier st if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &licensemanager.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1727,7 +2405,7 @@ func LicensemanagerUpdateTags(conn *licensemanager.LicenseManager, identifier st _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1744,13 +2422,13 @@ func LightsailUpdateTags(conn *lightsail.Lightsail, identifier string, oldTagsMa if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &lightsail.UntagResourceInput{ ResourceName: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1763,7 +2441,7 @@ func LightsailUpdateTags(conn *lightsail.Lightsail, identifier string, oldTagsMa _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1780,13 +2458,13 @@ func MediaconnectUpdateTags(conn *mediaconnect.MediaConnect, identifier string, if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &mediaconnect.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1799,7 +2477,7 @@ func MediaconnectUpdateTags(conn *mediaconnect.MediaConnect, identifier string, _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1816,13 +2494,13 @@ func MediaconvertUpdateTags(conn *mediaconvert.MediaConvert, identifier string, if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &mediaconvert.UntagResourceInput{ Arn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1835,7 +2513,7 @@ func MediaconvertUpdateTags(conn *mediaconvert.MediaConvert, identifier string, _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1852,13 +2530,13 @@ func MedialiveUpdateTags(conn *medialive.MediaLive, identifier string, oldTagsMa if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &medialive.DeleteTagsInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.DeleteTags(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1871,7 +2549,7 @@ func MedialiveUpdateTags(conn *medialive.MediaLive, identifier string, oldTagsMa _, err := conn.CreateTags(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1888,13 +2566,13 @@ func MediapackageUpdateTags(conn *mediapackage.MediaPackage, identifier string, if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &mediapackage.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1907,7 +2585,7 @@ func MediapackageUpdateTags(conn *mediapackage.MediaPackage, identifier string, _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1924,13 +2602,13 @@ func MediastoreUpdateTags(conn *mediastore.MediaStore, identifier string, oldTag if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &mediastore.UntagResourceInput{ Resource: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1943,7 +2621,7 @@ func MediastoreUpdateTags(conn *mediastore.MediaStore, identifier string, oldTag _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1960,13 +2638,13 @@ func MqUpdateTags(conn *mq.MQ, identifier string, oldTagsMap interface{}, newTag if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &mq.DeleteTagsInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.DeleteTags(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -1979,7 +2657,7 @@ func MqUpdateTags(conn *mq.MQ, identifier string, oldTagsMap interface{}, newTag _, err := conn.CreateTags(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -1996,13 +2674,13 @@ func NeptuneUpdateTags(conn *neptune.Neptune, identifier string, oldTagsMap inte if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &neptune.RemoveTagsFromResourceInput{ ResourceName: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.RemoveTagsFromResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2015,7 +2693,7 @@ func NeptuneUpdateTags(conn *neptune.Neptune, identifier string, oldTagsMap inte _, err := conn.AddTagsToResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -2032,13 +2710,13 @@ func OpsworksUpdateTags(conn *opsworks.OpsWorks, identifier string, oldTagsMap i if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &opsworks.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2051,7 +2729,7 @@ func OpsworksUpdateTags(conn *opsworks.OpsWorks, identifier string, oldTagsMap i _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -2068,13 +2746,13 @@ func OrganizationsUpdateTags(conn *organizations.Organizations, identifier strin if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &organizations.UntagResourceInput{ ResourceId: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2087,7 +2765,115 @@ func OrganizationsUpdateTags(conn *organizations.Organizations, identifier strin _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// PinpointUpdateTags updates pinpoint service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func PinpointUpdateTags(conn *pinpoint.Pinpoint, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &pinpoint.UntagResourceInput{ + ResourceArn: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.UntagResource(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &pinpoint.TagResourceInput{ + ResourceArn: aws.String(identifier), + TagsModel: &pinpoint.TagsModel{Tags: updatedTags.IgnoreAws().PinpointTags()}, + } + + _, err := conn.TagResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// QldbUpdateTags updates qldb service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func QldbUpdateTags(conn *qldb.QLDB, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &qldb.UntagResourceInput{ + ResourceArn: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.UntagResource(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &qldb.TagResourceInput{ + ResourceArn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().QldbTags(), + } + + _, err := conn.TagResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// QuicksightUpdateTags updates quicksight service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func QuicksightUpdateTags(conn *quicksight.QuickSight, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &quicksight.UntagResourceInput{ + ResourceArn: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.UntagResource(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &quicksight.TagResourceInput{ + ResourceArn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().QuicksightTags(), + } + + _, err := conn.TagResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -2104,13 +2890,13 @@ func RamUpdateTags(conn *ram.RAM, identifier string, oldTagsMap interface{}, new if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &ram.UntagResourceInput{ ResourceShareArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2123,7 +2909,7 @@ func RamUpdateTags(conn *ram.RAM, identifier string, oldTagsMap interface{}, new _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -2140,13 +2926,13 @@ func RdsUpdateTags(conn *rds.RDS, identifier string, oldTagsMap interface{}, new if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &rds.RemoveTagsFromResourceInput{ ResourceName: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.RemoveTagsFromResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2159,7 +2945,7 @@ func RdsUpdateTags(conn *rds.RDS, identifier string, oldTagsMap interface{}, new _, err := conn.AddTagsToResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -2176,13 +2962,13 @@ func RedshiftUpdateTags(conn *redshift.Redshift, identifier string, oldTagsMap i if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &redshift.DeleteTagsInput{ ResourceName: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.DeleteTags(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2195,13 +2981,85 @@ func RedshiftUpdateTags(conn *redshift.Redshift, identifier string, oldTagsMap i _, err := conn.CreateTags(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// ResourcegroupsUpdateTags updates resourcegroups service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func ResourcegroupsUpdateTags(conn *resourcegroups.ResourceGroups, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &resourcegroups.UntagInput{ + Arn: aws.String(identifier), + Keys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.Untag(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &resourcegroups.TagInput{ + Arn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().ResourcegroupsTags(), + } + + _, err := conn.Tag(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } return nil } +// Route53UpdateTags updates route53 service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func Route53UpdateTags(conn *route53.Route53, identifier string, resourceType string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + removedTags := oldTags.Removed(newTags) + updatedTags := oldTags.Updated(newTags) + + // Ensure we do not send empty requests + if len(removedTags) == 0 && len(updatedTags) == 0 { + return nil + } + + input := &route53.ChangeTagsForResourceInput{ + ResourceId: aws.String(identifier), + ResourceType: aws.String(resourceType), + } + + if len(updatedTags) > 0 { + input.AddTags = updatedTags.IgnoreAws().Route53Tags() + } + + if len(removedTags) > 0 { + input.RemoveTagKeys = aws.StringSlice(removedTags.Keys()) + } + + _, err := conn.ChangeTagsForResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + + return nil +} + // Route53resolverUpdateTags updates route53resolver service tags. // The identifier is typically the Amazon Resource Name (ARN), although // it may also be a different identifier depending on the service. @@ -2212,13 +3070,13 @@ func Route53resolverUpdateTags(conn *route53resolver.Route53Resolver, identifier if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &route53resolver.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2231,7 +3089,43 @@ func Route53resolverUpdateTags(conn *route53resolver.Route53Resolver, identifier _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// SagemakerUpdateTags updates sagemaker service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func SagemakerUpdateTags(conn *sagemaker.SageMaker, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &sagemaker.DeleteTagsInput{ + ResourceArn: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.DeleteTags(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &sagemaker.AddTagsInput{ + ResourceArn: aws.String(identifier), + Tags: updatedTags.IgnoreAws().SagemakerTags(), + } + + _, err := conn.AddTags(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -2248,13 +3142,13 @@ func SecretsmanagerUpdateTags(conn *secretsmanager.SecretsManager, identifier st if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &secretsmanager.UntagResourceInput{ SecretId: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2267,7 +3161,7 @@ func SecretsmanagerUpdateTags(conn *secretsmanager.SecretsManager, identifier st _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -2284,13 +3178,13 @@ func SecurityhubUpdateTags(conn *securityhub.SecurityHub, identifier string, old if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &securityhub.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2303,7 +3197,7 @@ func SecurityhubUpdateTags(conn *securityhub.SecurityHub, identifier string, old _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -2320,13 +3214,13 @@ func SfnUpdateTags(conn *sfn.SFN, identifier string, oldTagsMap interface{}, new if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &sfn.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2339,7 +3233,7 @@ func SfnUpdateTags(conn *sfn.SFN, identifier string, oldTagsMap interface{}, new _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -2356,13 +3250,13 @@ func SnsUpdateTags(conn *sns.SNS, identifier string, oldTagsMap interface{}, new if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &sns.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2375,7 +3269,43 @@ func SnsUpdateTags(conn *sns.SNS, identifier string, oldTagsMap interface{}, new _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// SqsUpdateTags updates sqs service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func SqsUpdateTags(conn *sqs.SQS, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &sqs.UntagQueueInput{ + QueueUrl: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.UntagQueue(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &sqs.TagQueueInput{ + QueueUrl: aws.String(identifier), + Tags: updatedTags.IgnoreAws().SqsTags(), + } + + _, err := conn.TagQueue(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -2393,13 +3323,13 @@ func SsmUpdateTags(conn *ssm.SSM, identifier string, resourceType string, oldTag input := &ssm.RemoveTagsFromResourceInput{ ResourceId: aws.String(identifier), ResourceType: aws.String(resourceType), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.RemoveTagsFromResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2413,7 +3343,7 @@ func SsmUpdateTags(conn *ssm.SSM, identifier string, resourceType string, oldTag _, err := conn.AddTagsToResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -2430,13 +3360,13 @@ func StoragegatewayUpdateTags(conn *storagegateway.StorageGateway, identifier st if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &storagegateway.RemoveTagsFromResourceInput{ ResourceARN: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.RemoveTagsFromResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2449,7 +3379,7 @@ func StoragegatewayUpdateTags(conn *storagegateway.StorageGateway, identifier st _, err := conn.AddTagsToResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -2466,13 +3396,13 @@ func SwfUpdateTags(conn *swf.SWF, identifier string, oldTagsMap interface{}, new if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &swf.UntagResourceInput{ ResourceArn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2485,7 +3415,7 @@ func SwfUpdateTags(conn *swf.SWF, identifier string, oldTagsMap interface{}, new _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -2502,13 +3432,13 @@ func TransferUpdateTags(conn *transfer.Transfer, identifier string, oldTagsMap i if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &transfer.UntagResourceInput{ Arn: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2521,7 +3451,7 @@ func TransferUpdateTags(conn *transfer.Transfer, identifier string, oldTagsMap i _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -2538,13 +3468,13 @@ func WafUpdateTags(conn *waf.WAF, identifier string, oldTagsMap interface{}, new if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &waf.UntagResourceInput{ ResourceARN: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.UntagResource(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2557,7 +3487,79 @@ func WafUpdateTags(conn *waf.WAF, identifier string, oldTagsMap interface{}, new _, err := conn.TagResource(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// WafregionalUpdateTags updates wafregional service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func WafregionalUpdateTags(conn *wafregional.WAFRegional, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &waf.UntagResourceInput{ + ResourceARN: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.UntagResource(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &waf.TagResourceInput{ + ResourceARN: aws.String(identifier), + Tags: updatedTags.IgnoreAws().WafregionalTags(), + } + + _, err := conn.TagResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} + +// Wafv2UpdateTags updates wafv2 service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func Wafv2UpdateTags(conn *wafv2.WAFV2, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := New(oldTagsMap) + newTags := New(newTagsMap) + + if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { + input := &wafv2.UntagResourceInput{ + ResourceARN: aws.String(identifier), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), + } + + _, err := conn.UntagResource(input) + + if err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } + + if updatedTags := oldTags.Updated(newTags); len(updatedTags) > 0 { + input := &wafv2.TagResourceInput{ + ResourceARN: aws.String(identifier), + Tags: updatedTags.IgnoreAws().Wafv2Tags(), + } + + _, err := conn.TagResource(input) + + if err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } @@ -2574,13 +3576,13 @@ func WorkspacesUpdateTags(conn *workspaces.WorkSpaces, identifier string, oldTag if removedTags := oldTags.Removed(newTags); len(removedTags) > 0 { input := &workspaces.DeleteTagsInput{ ResourceId: aws.String(identifier), - TagKeys: aws.StringSlice(removedTags.Keys()), + TagKeys: aws.StringSlice(removedTags.IgnoreAws().Keys()), } _, err := conn.DeleteTags(input) if err != nil { - return fmt.Errorf("error untagging resource (%s): %s", identifier, err) + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) } } @@ -2593,7 +3595,7 @@ func WorkspacesUpdateTags(conn *workspaces.WorkSpaces, identifier string, oldTag _, err := conn.CreateTags(input) if err != nil { - return fmt.Errorf("error tagging resource (%s): %s", identifier, err) + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) } } diff --git a/aws/internal/naming/naming.go b/aws/internal/naming/naming.go new file mode 100644 index 00000000000..d1313be3ffa --- /dev/null +++ b/aws/internal/naming/naming.go @@ -0,0 +1,96 @@ +package naming + +import ( + "fmt" + "regexp" + "strings" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +var resourceUniqueIDSuffixRegexpPattern = fmt.Sprintf("\\d{%d}$", resource.UniqueIDSuffixLength) +var resourceUniqueIDSuffixRegexp = regexp.MustCompile(resourceUniqueIDSuffixRegexpPattern) + +var resourceUniqueIDRegexpPattern = resourcePrefixedUniqueIDRegexpPattern(resource.UniqueIdPrefix) +var resourceUniqueIDRegexp = regexp.MustCompile(resourceUniqueIDRegexpPattern) + +// Generate returns in order the name if non-empty, a prefix generated name if non-empty, or fully generated name prefixed with terraform- +func Generate(name string, namePrefix string) string { + if name != "" { + return name + } + + if namePrefix != "" { + return resource.PrefixedUniqueId(namePrefix) + } + + return resource.UniqueId() +} + +// HasResourceUniqueIdPrefix returns true if the string has the built-in unique ID prefix +func HasResourceUniqueIdPrefix(s string) bool { + return strings.HasPrefix(s, resource.UniqueIdPrefix) +} + +// HasResourceUniqueIdSuffix returns true if the string has the built-in unique ID suffix +func HasResourceUniqueIdSuffix(s string) bool { + return resourceUniqueIDSuffixRegexp.MatchString(s) +} + +// NamePrefixFromName returns a name prefix if the string matches prefix criteria +// +// The input to this function must be strictly the "name" and not any +// additional information such as a full Amazon Resource Name (ARN). The output +// is suitable for custom resource Importer State functions after nil checking +// to ensure differences are not reported with ImportStateVerify testing, e.g. +// +// if namePrefix := naming.NamePrefixFromName(d.Id()); namePrefix != nil { +// d.Set("name_prefix", namePrefix) +// } +func NamePrefixFromName(name string) *string { + if !HasResourceUniqueIdSuffix(name) { + return nil + } + + // If the name begins with terraform-, then the name may have been fully + // generated (e.g. omitting both name and name_prefix arguments) + if HasResourceUniqueIdPrefix(name) { + return nil + } + + namePrefixIndex := len(name) - resource.UniqueIDSuffixLength + + if namePrefixIndex <= 0 { + return nil + } + + namePrefix := name[:namePrefixIndex] + + return &namePrefix +} + +// TestCheckResourceAttrNameFromPrefix verifies that the state attribute value matches name generated from given prefix +func TestCheckResourceAttrNameFromPrefix(resourceName string, attributeName string, prefix string) resource.TestCheckFunc { + return func(s *terraform.State) error { + nameRegexpPattern := resourcePrefixedUniqueIDRegexpPattern(prefix) + attributeMatch, err := regexp.Compile(nameRegexpPattern) + + if err != nil { + return fmt.Errorf("Unable to compile name regexp (%s): %s", nameRegexpPattern, err) + } + + return resource.TestMatchResourceAttr(resourceName, attributeName, attributeMatch)(s) + } +} + +// TestCheckResourceAttrNameGenerated verifies that the state attribute value matches name automatically generated without prefix +func TestCheckResourceAttrNameGenerated(resourceName string, attributeName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + return resource.TestMatchResourceAttr(resourceName, attributeName, resourceUniqueIDRegexp)(s) + } +} + +func resourcePrefixedUniqueIDRegexpPattern(prefix string) string { + return fmt.Sprintf("^%s%s", prefix, resourceUniqueIDSuffixRegexpPattern) +} diff --git a/aws/internal/naming/naming_test.go b/aws/internal/naming/naming_test.go new file mode 100644 index 00000000000..d08b3b75d00 --- /dev/null +++ b/aws/internal/naming/naming_test.go @@ -0,0 +1,180 @@ +package naming + +import ( + "regexp" + "testing" +) + +func strPtr(str string) *string { + return &str +} + +func TestGenerate(t *testing.T) { + testCases := []struct { + TestName string + Name string + NamePrefix string + ExpectedRegexpPattern string + }{ + { + TestName: "name", + Name: "test", + NamePrefix: "", + ExpectedRegexpPattern: "^test$", + }, + { + TestName: "name prefix", + Name: "", + NamePrefix: "test", + ExpectedRegexpPattern: resourcePrefixedUniqueIDRegexpPattern("test"), + }, + { + TestName: "fully generated", + Name: "", + NamePrefix: "", + ExpectedRegexpPattern: resourceUniqueIDRegexpPattern, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.TestName, func(t *testing.T) { + got := Generate(testCase.Name, testCase.NamePrefix) + + expectedRegexp, err := regexp.Compile(testCase.ExpectedRegexpPattern) + + if err != nil { + t.Errorf("unable to compile regular expression pattern %s: %s", testCase.ExpectedRegexpPattern, err) + } + + if !expectedRegexp.MatchString(got) { + t.Errorf("got %s, expected to match regular expression pattern %s", got, testCase.ExpectedRegexpPattern) + } + }) + } +} + +func TestHasResourceUniqueIdPrefix(t *testing.T) { + testCases := []struct { + TestName string + Input string + Expected bool + }{ + { + TestName: "empty", + Input: "", + Expected: false, + }, + { + TestName: "incorrect prefix", + Input: "test-20060102150405000000000001", + Expected: false, + }, + { + TestName: "correct prefix", + Input: "terraform-20060102150405000000000001", + Expected: true, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.TestName, func(t *testing.T) { + got := HasResourceUniqueIdPrefix(testCase.Input) + + if got != testCase.Expected { + t.Errorf("got %t, expected %t", got, testCase.Expected) + } + }) + } +} + +func TestHasResourceUniqueIdSuffix(t *testing.T) { + testCases := []struct { + TestName string + Input string + Expected bool + }{ + { + TestName: "empty", + Input: "", + Expected: false, + }, + { + TestName: "incorrect suffix", + Input: "test-123", + Expected: false, + }, + { + TestName: "correct suffix, incorrect prefix", + Input: "test-20060102150405000000000001", + Expected: true, + }, + { + TestName: "correct suffix, correct prefix", + Input: "terraform-20060102150405000000000001", + Expected: true, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.TestName, func(t *testing.T) { + got := HasResourceUniqueIdSuffix(testCase.Input) + + if got != testCase.Expected { + t.Errorf("got %t, expected %t", got, testCase.Expected) + } + }) + } +} + +func TestNamePrefixFromName(t *testing.T) { + testCases := []struct { + TestName string + Input string + Expected *string + }{ + { + TestName: "empty", + Input: "", + Expected: nil, + }, + { + TestName: "correct prefix, incorrect suffix", + Input: "test-123", + Expected: nil, + }, + { + TestName: "correct prefix without hyphen, correct suffix", + Input: "test20060102150405000000000001", + Expected: strPtr("test"), + }, + { + TestName: "correct prefix with hyphen, correct suffix", + Input: "test-20060102150405000000000001", + Expected: strPtr("test-"), + }, + { + TestName: "incorrect prefix, correct suffix", + Input: "terraform-20060102150405000000000001", + Expected: nil, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.TestName, func(t *testing.T) { + expected := testCase.Expected + got := NamePrefixFromName(testCase.Input) + + if expected == nil && got != nil { + t.Errorf("got %s, expected nil", *got) + } + + if expected != nil && got == nil { + t.Errorf("got nil, expected %s", *expected) + } + + if expected != nil && got != nil && *expected != *got { + t.Errorf("got %s, expected %s", *got, *expected) + } + }) + } +} diff --git a/aws/internal/service/batch/equivalency/container_properties.go b/aws/internal/service/batch/equivalency/container_properties.go new file mode 100644 index 00000000000..9df82b85748 --- /dev/null +++ b/aws/internal/service/batch/equivalency/container_properties.go @@ -0,0 +1,97 @@ +package equivalency + +import ( + "bytes" + "encoding/json" + "log" + "sort" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" + "github.com/aws/aws-sdk-go/service/batch" +) + +type containerProperties batch.ContainerProperties + +func (cp *containerProperties) Reduce() error { + // Deal with Environment objects which may be re-ordered in the API + sort.Slice(cp.Environment, func(i, j int) bool { + return aws.StringValue(cp.Environment[i].Name) < aws.StringValue(cp.Environment[j].Name) + }) + + // Prevent difference of API response that adds an empty array when not configured during the request + if len(cp.Environment) == 0 { + cp.Environment = nil + } + + // Prevent difference of API response that adds an empty array when not configured during the request + if len(cp.MountPoints) == 0 { + cp.MountPoints = nil + } + + // Prevent difference of API response that adds an empty array when not configured during the request + if len(cp.ResourceRequirements) == 0 { + cp.ResourceRequirements = nil + } + + // Prevent difference of API response that adds an empty array when not configured during the request + if len(cp.Ulimits) == 0 { + cp.Ulimits = nil + } + + // Prevent difference of API response that adds an empty array when not configured during the request + if len(cp.Volumes) == 0 { + cp.Volumes = nil + } + + return nil +} + +// EquivalentBatchContainerPropertiesJSON determines equality between two Batch ContainerProperties JSON strings +func EquivalentBatchContainerPropertiesJSON(str1, str2 string) (bool, error) { + if str1 == "" { + str1 = "{}" + } + + if str2 == "" { + str2 = "{}" + } + + var cp1, cp2 containerProperties + + if err := json.Unmarshal([]byte(str1), &cp1); err != nil { + return false, err + } + + if err := cp1.Reduce(); err != nil { + return false, err + } + + canonicalJson1, err := jsonutil.BuildJSON(cp1) + + if err != nil { + return false, err + } + + if err := json.Unmarshal([]byte(str2), &cp2); err != nil { + return false, err + } + + if err := cp2.Reduce(); err != nil { + return false, err + } + + canonicalJson2, err := jsonutil.BuildJSON(cp2) + + if err != nil { + return false, err + } + + equal := bytes.Equal(canonicalJson1, canonicalJson2) + + if !equal { + log.Printf("[DEBUG] Canonical Batch Container Properties JSON are not equal.\nFirst: %s\nSecond: %s\n", canonicalJson1, canonicalJson2) + } + + return equal, nil +} diff --git a/aws/internal/service/batch/equivalency/container_properties_test.go b/aws/internal/service/batch/equivalency/container_properties_test.go new file mode 100644 index 00000000000..0255944352b --- /dev/null +++ b/aws/internal/service/batch/equivalency/container_properties_test.go @@ -0,0 +1,230 @@ +package equivalency + +import ( + "testing" +) + +func TestEquivalentBatchContainerPropertiesJSON(t *testing.T) { + testCases := []struct { + Name string + ApiJson string + ConfigurationJson string + ExpectEquivalent bool + ExpectError bool + }{ + { + Name: "empty", + ApiJson: ``, + ConfigurationJson: ``, + ExpectEquivalent: true, + }, + { + Name: "empty ResourceRequirements", + ApiJson: ` +{ + "command": ["ls", "-la"], + "environment": [ + { + "name": "VARNAME", + "value": "VARVAL" + } + ], + "image": "busybox", + "memory":512, + "mountPoints": [ + { + "containerPath": "/tmp", + "readOnly": false, + "sourceVolume": "tmp" + } + ], + "resourceRequirements": [], + "ulimits": [ + { + "hardLimit": 1024, + "name": "nofile", + "softLimit": 1024 + } + ], + "vcpus": 1, + "volumes": [ + { + "host": { + "sourcePath": "/tmp" + }, + "name": "tmp" + } + ] +} +`, + ConfigurationJson: ` +{ + "command": ["ls", "-la"], + "environment": [ + { + "name": "VARNAME", + "value": "VARVAL" + } + ], + "image": "busybox", + "memory":512, + "mountPoints": [ + { + "containerPath": "/tmp", + "readOnly": false, + "sourceVolume": "tmp" + } + ], + "ulimits": [ + { + "hardLimit": 1024, + "name": "nofile", + "softLimit": 1024 + } + ], + "vcpus": 1, + "volumes": [ + { + "host": { + "sourcePath": "/tmp" + }, + "name": "tmp" + } + ] +} +`, + ExpectEquivalent: true, + }, + { + Name: "reordered Environment", + ApiJson: ` +{ + "command": ["ls", "-la"], + "environment": [ + { + "name": "VARNAME1", + "value": "VARVAL1" + }, + { + "name": "VARNAME2", + "value": "VARVAL2" + } + ], + "image": "busybox", + "memory":512, + "mountPoints": [ + { + "containerPath": "/tmp", + "readOnly": false, + "sourceVolume": "tmp" + } + ], + "resourceRequirements": [], + "ulimits": [ + { + "hardLimit": 1024, + "name": "nofile", + "softLimit": 1024 + } + ], + "vcpus": 1, + "volumes": [ + { + "host": { + "sourcePath": "/tmp" + }, + "name": "tmp" + } + ] +} +`, + ConfigurationJson: ` +{ + "command": ["ls", "-la"], + "environment": [ + { + "name": "VARNAME2", + "value": "VARVAL2" + }, + { + "name": "VARNAME1", + "value": "VARVAL1" + } + ], + "image": "busybox", + "memory":512, + "mountPoints": [ + { + "containerPath": "/tmp", + "readOnly": false, + "sourceVolume": "tmp" + } + ], + "resourceRequirements": [], + "ulimits": [ + { + "hardLimit": 1024, + "name": "nofile", + "softLimit": 1024 + } + ], + "vcpus": 1, + "volumes": [ + { + "host": { + "sourcePath": "/tmp" + }, + "name": "tmp" + } + ] +} +`, + ExpectEquivalent: true, + }, + { + Name: "empty environment, mountPoints, ulimits, and volumes", + ApiJson: ` +{ + "image": "example:image", + "vcpus": 8, + "memory": 2048, + "command": ["start.py", "Ref::S3bucket", "Ref::S3key"], + "jobRoleArn": "arn:aws:iam::123456789012:role/example", + "volumes": [], + "environment": [], + "mountPoints": [], + "ulimits": [], + "resourceRequirements": [] +} +`, + ConfigurationJson: ` +{ + "command": ["start.py", "Ref::S3bucket", "Ref::S3key"], + "image": "example:image", + "memory": 2048, + "vcpus": 8, + "jobRoleArn": "arn:aws:iam::123456789012:role/example" +} +`, + ExpectEquivalent: true, + }, + } + + for _, testCase := range testCases { + t.Run(testCase.Name, func(t *testing.T) { + got, err := EquivalentBatchContainerPropertiesJSON(testCase.ConfigurationJson, testCase.ApiJson) + + if err != nil && !testCase.ExpectError { + t.Errorf("got unexpected error: %s", err) + } + + if err == nil && testCase.ExpectError { + t.Errorf("expected error, but received none") + } + + if got != testCase.ExpectEquivalent { + t.Errorf("got %t, expected %t", got, testCase.ExpectEquivalent) + } + }) + } +} diff --git a/aws/internal/service/eks/token/arn.go b/aws/internal/service/eks/token/arn.go new file mode 100644 index 00000000000..1ba2f2787b7 --- /dev/null +++ b/aws/internal/service/eks/token/arn.go @@ -0,0 +1,77 @@ +/* +This file is a hard copy of: +https://github.com/kubernetes-sigs/aws-iam-authenticator/blob/7547c74e660f8d34d9980f2c69aa008eed1f48d0/pkg/arn/arn.go + +With the following modifications: + - Rename package from arn to token for simplication +*/ + +package token + +import ( + "fmt" + "strings" + + awsarn "github.com/aws/aws-sdk-go/aws/arn" + "github.com/aws/aws-sdk-go/aws/endpoints" +) + +// Canonicalize validates IAM resources are appropriate for the authenticator +// and converts STS assumed roles into the IAM role resource. +// +// Supported IAM resources are: +// * AWS account: arn:aws:iam::123456789012:root +// * IAM user: arn:aws:iam::123456789012:user/Bob +// * IAM role: arn:aws:iam::123456789012:role/S3Access +// * IAM Assumed role: arn:aws:sts::123456789012:assumed-role/Accounting-Role/Mary (converted to IAM role) +// * Federated user: arn:aws:sts::123456789012:federated-user/Bob +func Canonicalize(arn string) (string, error) { + parsed, err := awsarn.Parse(arn) + if err != nil { + return "", fmt.Errorf("arn '%s' is invalid: '%v'", arn, err) + } + + if err := checkPartition(parsed.Partition); err != nil { + return "", fmt.Errorf("arn '%s' does not have a recognized partition", arn) + } + + parts := strings.Split(parsed.Resource, "/") + resource := parts[0] + + switch parsed.Service { + case "sts": + switch resource { + case "federated-user": + return arn, nil + case "assumed-role": + if len(parts) < 3 { + return "", fmt.Errorf("assumed-role arn '%s' does not have a role", arn) + } + // IAM ARNs can contain paths, part[0] is resource, parts[len(parts)] is the SessionName. + role := strings.Join(parts[1:len(parts)-1], "/") + return fmt.Sprintf("arn:%s:iam::%s:role/%s", parsed.Partition, parsed.AccountID, role), nil + default: + return "", fmt.Errorf("unrecognized resource %s for service sts", parsed.Resource) + } + case "iam": + switch resource { + case "role", "user", "root": + return arn, nil + default: + return "", fmt.Errorf("unrecognized resource %s for service iam", parsed.Resource) + } + } + + return "", fmt.Errorf("service %s in arn %s is not a valid service for identities", parsed.Service, arn) +} + +func checkPartition(partition string) error { + switch partition { + case endpoints.AwsPartitionID: + case endpoints.AwsCnPartitionID: + case endpoints.AwsUsGovPartitionID: + default: + return fmt.Errorf("partion %s is not recognized", partition) + } + return nil +} diff --git a/aws/internal/service/eks/token/arn_test.go b/aws/internal/service/eks/token/arn_test.go new file mode 100644 index 00000000000..ad549b6547d --- /dev/null +++ b/aws/internal/service/eks/token/arn_test.go @@ -0,0 +1,41 @@ +/* +This file is a hard copy of: +https://github.com/kubernetes-sigs/aws-iam-authenticator/blob/7547c74e660f8d34d9980f2c69aa008eed1f48d0/pkg/arn/arn_test.go + +With the following modifications: + - Rename package from arn to token for simplication +*/ + +package token + +import ( + "fmt" + "testing" +) + +var arnTests = []struct { + arn string // input arn + expected string // canonacalized arn + err error // expected error value +}{ + {"NOT AN ARN", "", fmt.Errorf("Not an arn")}, + {"arn:aws:iam::123456789012:user/Alice", "arn:aws:iam::123456789012:user/Alice", nil}, + {"arn:aws:iam::123456789012:role/Users", "arn:aws:iam::123456789012:role/Users", nil}, + {"arn:aws:sts::123456789012:assumed-role/Admin/Session", "arn:aws:iam::123456789012:role/Admin", nil}, + {"arn:aws:sts::123456789012:federated-user/Bob", "arn:aws:sts::123456789012:federated-user/Bob", nil}, + {"arn:aws:iam::123456789012:root", "arn:aws:iam::123456789012:root", nil}, + {"arn:aws:sts::123456789012:assumed-role/Org/Team/Admin/Session", "arn:aws:iam::123456789012:role/Org/Team/Admin", nil}, +} + +func TestUserARN(t *testing.T) { + for _, tc := range arnTests { + actual, err := Canonicalize(tc.arn) + if err != nil && tc.err == nil || err == nil && tc.err != nil { + t.Errorf("Canoncialize(%s) expected err: %v, actual err: %v", tc.arn, tc.err, err) + continue + } + if actual != tc.expected { + t.Errorf("Canonicalize(%s) expected: %s, actual: %s", tc.arn, tc.expected, actual) + } + } +} diff --git a/aws/internal/service/eks/token/token.go b/aws/internal/service/eks/token/token.go new file mode 100644 index 00000000000..ab37d14c00e --- /dev/null +++ b/aws/internal/service/eks/token/token.go @@ -0,0 +1,369 @@ +/* +This file is a hard copy of: +https://github.com/kubernetes-sigs/aws-iam-authenticator/blob/7547c74e660f8d34d9980f2c69aa008eed1f48d0/pkg/token/token.go + +With the following modifications: + + - Removal of all Generator interface methods and implementations except GetWithSTS + - Removal of other unused code + - Use *sts.STS instead of stsiface.STSAPI in Generator interface and GetWithSTS implementation + - Hard copy and use local Canonicalize implementation instead of "sigs.k8s.io/aws-iam-authenticator/pkg/arn" + - Fix staticcheck reports +*/ + +/* +Copyright 2017-2020 by the contributors. + +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 token + +import ( + "encoding/base64" + "encoding/json" + "fmt" + "io/ioutil" + "net/http" + "net/url" + "regexp" + "strconv" + "strings" + "time" + + "github.com/aws/aws-sdk-go/service/sts" +) + +// Identity is returned on successful Verify() results. It contains a parsed +// version of the AWS identity used to create the token. +type Identity struct { + // ARN is the raw Amazon Resource Name returned by sts:GetCallerIdentity + ARN string + + // CanonicalARN is the Amazon Resource Name converted to a more canonical + // representation. In particular, STS assumed role ARNs like + // "arn:aws:sts::ACCOUNTID:assumed-role/ROLENAME/SESSIONNAME" are converted + // to their IAM ARN equivalent "arn:aws:iam::ACCOUNTID:role/NAME" + CanonicalARN string + + // AccountID is the 12 digit AWS account number. + AccountID string + + // UserID is the unique user/role ID (e.g., "AROAAAAAAAAAAAAAAAAAA"). + UserID string + + // SessionName is the STS session name (or "" if this is not a + // session-based identity). For EC2 instance roles, this will be the EC2 + // instance ID (e.g., "i-0123456789abcdef0"). You should only rely on it + // if you trust that _only_ EC2 is allowed to assume the IAM Role. If IAM + // users or other roles are allowed to assume the role, they can provide + // (nearly) arbitrary strings here. + SessionName string + + // The AWS Access Key ID used to authenticate the request. This can be used + // in conjunction with CloudTrail to determine the identity of the individual + // if the individual assumed an IAM role before making the request. + AccessKeyID string +} + +const ( + // The sts GetCallerIdentity request is valid for 15 minutes regardless of this parameters value after it has been + // signed, but we set this unused parameter to 60 for legacy reasons (we check for a value between 0 and 60 on the + // server side in 0.3.0 or earlier). IT IS IGNORED. If we can get STS to support x-amz-expires, then we should + // set this parameter to the actual expiration, and make it configurable. + requestPresignParam = 60 + // The actual token expiration (presigned STS urls are valid for 15 minutes after timestamp in x-amz-date). + presignedURLExpiration = 15 * time.Minute + v1Prefix = "k8s-aws-v1." + maxTokenLenBytes = 1024 * 4 + clusterIDHeader = "x-k8s-aws-id" + // Format of the X-Amz-Date header used for expiration + // https://golang.org/pkg/time/#pkg-constants + dateHeaderFormat = "20060102T150405Z" + hostRegexp = `^sts(\.[a-z1-9\-]+)?\.amazonaws\.com(\.cn)?$` +) + +// Token is generated and used by Kubernetes client-go to authenticate with a Kubernetes cluster. +type Token struct { + Token string + Expiration time.Time +} + +// FormatError is returned when there is a problem with token that is +// an encoded sts request. This can include the url, data, action or anything +// else that prevents the sts call from being made. +type FormatError struct { + message string +} + +func (e FormatError) Error() string { + return "input token was not properly formatted: " + e.message +} + +// STSError is returned when there was either an error calling STS or a problem +// processing the data returned from STS. +type STSError struct { + message string +} + +func (e STSError) Error() string { + return "sts getCallerIdentity failed: " + e.message +} + +// NewSTSError creates a error of type STS. +func NewSTSError(m string) STSError { + return STSError{message: m} +} + +var parameterWhitelist = map[string]bool{ + "action": true, + "version": true, + "x-amz-algorithm": true, + "x-amz-credential": true, + "x-amz-date": true, + "x-amz-expires": true, + "x-amz-security-token": true, + "x-amz-signature": true, + "x-amz-signedheaders": true, +} + +// this is the result type from the GetCallerIdentity endpoint +type getCallerIdentityWrapper struct { + GetCallerIdentityResponse struct { + GetCallerIdentityResult struct { + Account string `json:"Account"` + Arn string `json:"Arn"` + UserID string `json:"UserId"` + } `json:"GetCallerIdentityResult"` + ResponseMetadata struct { + RequestID string `json:"RequestId"` + } `json:"ResponseMetadata"` + } `json:"GetCallerIdentityResponse"` +} + +// Generator provides new tokens for the AWS IAM Authenticator. +type Generator interface { + // GetWithSTS returns a token valid for clusterID using the given STS client. + GetWithSTS(clusterID string, stsAPI *sts.STS) (Token, error) +} + +type generator struct { + forwardSessionName bool + cache bool +} + +// NewGenerator creates a Generator and returns it. +func NewGenerator(forwardSessionName bool, cache bool) (Generator, error) { + return generator{ + forwardSessionName: forwardSessionName, + cache: cache, + }, nil +} + +// GetWithSTS returns a token valid for clusterID using the given STS client. +func (g generator) GetWithSTS(clusterID string, stsAPI *sts.STS) (Token, error) { + // generate an sts:GetCallerIdentity request and add our custom cluster ID header + request, _ := stsAPI.GetCallerIdentityRequest(&sts.GetCallerIdentityInput{}) + request.HTTPRequest.Header.Add(clusterIDHeader, clusterID) + + // Sign the request. The expires parameter (sets the x-amz-expires header) is + // currently ignored by STS, and the token expires 15 minutes after the x-amz-date + // timestamp regardless. We set it to 60 seconds for backwards compatibility (the + // parameter is a required argument to Presign(), and authenticators 0.3.0 and older are expecting a value between + // 0 and 60 on the server side). + // https://github.com/aws/aws-sdk-go/issues/2167 + presignedURLString, err := request.Presign(requestPresignParam) + if err != nil { + return Token{}, err + } + + // Set token expiration to 1 minute before the presigned URL expires for some cushion + tokenExpiration := time.Now().Local().Add(presignedURLExpiration - 1*time.Minute) + // TODO: this may need to be a constant-time base64 encoding + return Token{v1Prefix + base64.RawURLEncoding.EncodeToString([]byte(presignedURLString)), tokenExpiration}, nil +} + +// Verifier validates tokens by calling STS and returning the associated identity. +type Verifier interface { + Verify(token string) (*Identity, error) +} + +type tokenVerifier struct { + client *http.Client + clusterID string +} + +// NewVerifier creates a Verifier that is bound to the clusterID and uses the default http client. +func NewVerifier(clusterID string) Verifier { + return tokenVerifier{ + client: http.DefaultClient, + clusterID: clusterID, + } +} + +// verify a sts host, doc: http://docs.amazonaws.cn/en_us/general/latest/gr/rande.html#sts_region +func (v tokenVerifier) verifyHost(host string) error { + if match, _ := regexp.MatchString(hostRegexp, host); !match { + return FormatError{fmt.Sprintf("unexpected hostname %q in pre-signed URL", host)} + } + + return nil +} + +// Verify a token is valid for the specified clusterID. On success, returns an +// Identity that contains information about the AWS principal that created the +// token. On failure, returns nil and a non-nil error. +func (v tokenVerifier) Verify(token string) (*Identity, error) { + if len(token) > maxTokenLenBytes { + return nil, FormatError{"token is too large"} + } + + if !strings.HasPrefix(token, v1Prefix) { + return nil, FormatError{fmt.Sprintf("token is missing expected %q prefix", v1Prefix)} + } + + // TODO: this may need to be a constant-time base64 decoding + tokenBytes, err := base64.RawURLEncoding.DecodeString(strings.TrimPrefix(token, v1Prefix)) + if err != nil { + return nil, FormatError{err.Error()} + } + + parsedURL, err := url.Parse(string(tokenBytes)) + if err != nil { + return nil, FormatError{err.Error()} + } + + if parsedURL.Scheme != "https" { + return nil, FormatError{fmt.Sprintf("unexpected scheme %q in pre-signed URL", parsedURL.Scheme)} + } + + if err = v.verifyHost(parsedURL.Host); err != nil { + return nil, err + } + + if parsedURL.Path != "/" { + return nil, FormatError{"unexpected path in pre-signed URL"} + } + + queryParamsLower := make(url.Values) + queryParams := parsedURL.Query() + for key, values := range queryParams { + if !parameterWhitelist[strings.ToLower(key)] { + return nil, FormatError{fmt.Sprintf("non-whitelisted query parameter %q", key)} + } + if len(values) != 1 { + return nil, FormatError{"query parameter with multiple values not supported"} + } + queryParamsLower.Set(strings.ToLower(key), values[0]) + } + + if queryParamsLower.Get("action") != "GetCallerIdentity" { + return nil, FormatError{"unexpected action parameter in pre-signed URL"} + } + + if !hasSignedClusterIDHeader(&queryParamsLower) { + return nil, FormatError{fmt.Sprintf("client did not sign the %s header in the pre-signed URL", clusterIDHeader)} + } + + // We validate x-amz-expires is between 0 and 15 minutes (900 seconds) although currently pre-signed STS URLs, and + // therefore tokens, expire exactly 15 minutes after the x-amz-date header, regardless of x-amz-expires. + expires, err := strconv.Atoi(queryParamsLower.Get("x-amz-expires")) + if err != nil || expires < 0 || expires > 900 { + return nil, FormatError{fmt.Sprintf("invalid X-Amz-Expires parameter in pre-signed URL: %d", expires)} + } + + date := queryParamsLower.Get("x-amz-date") + if date == "" { + return nil, FormatError{"X-Amz-Date parameter must be present in pre-signed URL"} + } + + // Obtain AWS Access Key ID from supplied credentials + accessKeyID := strings.Split(queryParamsLower.Get("x-amz-credential"), "/")[0] + + dateParam, err := time.Parse(dateHeaderFormat, date) + if err != nil { + return nil, FormatError{fmt.Sprintf("error parsing X-Amz-Date parameter %s into format %s: %s", date, dateHeaderFormat, err.Error())} + } + + now := time.Now() + expiration := dateParam.Add(presignedURLExpiration) + if now.After(expiration) { + return nil, FormatError{fmt.Sprintf("X-Amz-Date parameter is expired (%.f minute expiration) %s", presignedURLExpiration.Minutes(), dateParam)} + } + + req, _ := http.NewRequest("GET", parsedURL.String(), nil) + req.Header.Set(clusterIDHeader, v.clusterID) + req.Header.Set("accept", "application/json") + + response, err := v.client.Do(req) + if err != nil { + // special case to avoid printing the full URL if possible + if urlErr, ok := err.(*url.Error); ok { + return nil, NewSTSError(fmt.Sprintf("error during GET: %v", urlErr.Err)) + } + return nil, NewSTSError(fmt.Sprintf("error during GET: %v", err)) + } + defer response.Body.Close() + + responseBody, err := ioutil.ReadAll(response.Body) + if err != nil { + return nil, NewSTSError(fmt.Sprintf("error reading HTTP result: %v", err)) + } + + if response.StatusCode != 200 { + return nil, NewSTSError(fmt.Sprintf("error from AWS (expected 200, got %d). Body: %s", response.StatusCode, string(responseBody[:]))) + } + + var callerIdentity getCallerIdentityWrapper + err = json.Unmarshal(responseBody, &callerIdentity) + if err != nil { + return nil, NewSTSError(err.Error()) + } + + // parse the response into an Identity + id := &Identity{ + ARN: callerIdentity.GetCallerIdentityResponse.GetCallerIdentityResult.Arn, + AccountID: callerIdentity.GetCallerIdentityResponse.GetCallerIdentityResult.Account, + AccessKeyID: accessKeyID, + } + id.CanonicalARN, err = Canonicalize(id.ARN) + if err != nil { + return nil, NewSTSError(err.Error()) + } + + // The user ID is either UserID:SessionName (for assumed roles) or just + // UserID (for IAM User principals). + userIDParts := strings.Split(callerIdentity.GetCallerIdentityResponse.GetCallerIdentityResult.UserID, ":") + if len(userIDParts) == 2 { + id.UserID = userIDParts[0] + id.SessionName = userIDParts[1] + } else if len(userIDParts) == 1 { + id.UserID = userIDParts[0] + } else { + return nil, STSError{fmt.Sprintf( + "malformed UserID %q", + callerIdentity.GetCallerIdentityResponse.GetCallerIdentityResult.UserID)} + } + + return id, nil +} + +func hasSignedClusterIDHeader(paramsLower *url.Values) bool { + signedHeaders := strings.Split(paramsLower.Get("x-amz-signedheaders"), ";") + for _, hdr := range signedHeaders { + if strings.EqualFold(hdr, clusterIDHeader) { + return true + } + } + return false +} diff --git a/aws/internal/service/eks/token/token_test.go b/aws/internal/service/eks/token/token_test.go new file mode 100644 index 00000000000..0595611423e --- /dev/null +++ b/aws/internal/service/eks/token/token_test.go @@ -0,0 +1,273 @@ +/* +This file is a hard copy of: +https://github.com/kubernetes-sigs/aws-iam-authenticator/blob/7547c74e660f8d34d9980f2c69aa008eed1f48d0/pkg/token/token_test.go + +With the following modifications: + + - Fix staticcheck reports +*/ + +package token + +import ( + "bytes" + "encoding/base64" + "encoding/json" + "errors" + "fmt" + "io" + "io/ioutil" + "net/http" + "strings" + "testing" + "time" +) + +func validationErrorTest(t *testing.T, token string, expectedErr string) { + t.Helper() + _, err := tokenVerifier{}.Verify(token) + errorContains(t, err, expectedErr) +} + +func validationSuccessTest(t *testing.T, token string) { + t.Helper() + arn := "arn:aws:iam::123456789012:user/Alice" + account := "123456789012" + userID := "Alice" + _, err := newVerifier(200, jsonResponse(arn, account, userID), nil).Verify(token) + if err != nil { + t.Errorf("received unexpected error: %s", err) + } +} + +func errorContains(t *testing.T, err error, expectedErr string) { + t.Helper() + if err == nil || !strings.Contains(err.Error(), expectedErr) { + t.Errorf("err should have contained '%s' was '%s'", expectedErr, err) + } +} + +func assertSTSError(t *testing.T, err error) { + t.Helper() + if _, ok := err.(STSError); !ok { + t.Errorf("Expected err %v to be an STSError but was not", err) + } +} + +var ( + now = time.Now() + timeStr = now.UTC().Format("20060102T150405Z") + validURL = fmt.Sprintf("https://sts.amazonaws.com/?action=GetCallerIdentity&X-Amz-Credential=ASIABCDEFGHIJKLMNOPQ%%2F20191216%%2Fus-west-2%%2Fs3%%2Faws4_request&x-amz-signedheaders=x-k8s-aws-id&x-amz-expires=60&x-amz-date=%s", timeStr) + validToken = toToken(validURL) +) + +func toToken(url string) string { + return v1Prefix + base64.RawURLEncoding.EncodeToString([]byte(url)) +} + +func newVerifier(statusCode int, body string, err error) Verifier { + var rc io.ReadCloser + if body != "" { + rc = ioutil.NopCloser(bytes.NewReader([]byte(body))) + } + return tokenVerifier{ + client: &http.Client{ + Transport: &roundTripper{ + err: err, + resp: &http.Response{ + StatusCode: statusCode, + Body: rc, + }, + }, + }, + } +} + +type roundTripper struct { + err error + resp *http.Response +} + +type errorReadCloser struct { +} + +func (r errorReadCloser) Read(b []byte) (int, error) { + return 0, errors.New("An Error") +} + +func (r errorReadCloser) Close() error { + return nil +} + +func (rt *roundTripper) RoundTrip(req *http.Request) (*http.Response, error) { + return rt.resp, rt.err +} + +func jsonResponse(arn, account, userid string) string { + response := getCallerIdentityWrapper{} + response.GetCallerIdentityResponse.GetCallerIdentityResult.Account = account + response.GetCallerIdentityResponse.GetCallerIdentityResult.Arn = arn + response.GetCallerIdentityResponse.GetCallerIdentityResult.UserID = userid + data, _ := json.Marshal(response) + return string(data) +} + +func TestSTSEndpoints(t *testing.T) { + verifier := tokenVerifier{} + chinaR := "sts.amazonaws.com.cn" + globalR := "sts.amazonaws.com" + usEast1R := "sts.us-east-1.amazonaws.com" + usEast2R := "sts.us-east-2.amazonaws.com" + usWest1R := "sts.us-west-1.amazonaws.com" + usWest2R := "sts.us-west-2.amazonaws.com" + apSouth1R := "sts.ap-south-1.amazonaws.com" + apNorthEast1R := "sts.ap-northeast-1.amazonaws.com" + apNorthEast2R := "sts.ap-northeast-2.amazonaws.com" + apSouthEast1R := "sts.ap-southeast-1.amazonaws.com" + apSouthEast2R := "sts.ap-southeast-2.amazonaws.com" + caCentral1R := "sts.ca-central-1.amazonaws.com" + euCenteral1R := "sts.eu-central-1.amazonaws.com" + euWest1R := "sts.eu-west-1.amazonaws.com" + euWest2R := "sts.eu-west-2.amazonaws.com" + euWest3R := "sts.eu-west-3.amazonaws.com" + euNorth1R := "sts.eu-north-1.amazonaws.com" + saEast1R := "sts.sa-east-1.amazonaws.com" + + hosts := []string{chinaR, globalR, usEast1R, usEast2R, usWest1R, usWest2R, apSouth1R, apNorthEast1R, apNorthEast2R, apSouthEast1R, apSouthEast2R, caCentral1R, euCenteral1R, euWest1R, euWest2R, euWest3R, euNorth1R, saEast1R} + + for _, host := range hosts { + if err := verifier.verifyHost(host); err != nil { + t.Errorf("%s is not valid endpoints host", host) + } + } +} + +func TestVerifyTokenPreSTSValidations(t *testing.T) { + b := make([]byte, maxTokenLenBytes+1) + s := string(b) + validationErrorTest(t, s, "token is too large") + validationErrorTest(t, "k8s-aws-v2.asdfasdfa", "token is missing expected \"k8s-aws-v1.\" prefix") + validationErrorTest(t, "k8s-aws-v1.decodingerror", "illegal base64 data") + validationErrorTest(t, toToken(":ab:cd.af:/asda"), "missing protocol scheme") + validationErrorTest(t, toToken("http://"), "unexpected scheme") + validationErrorTest(t, toToken("https://google.com"), fmt.Sprintf("unexpected hostname %q in pre-signed URL", "google.com")) + validationErrorTest(t, toToken("https://sts.cn-north-1.amazonaws.com.cn/abc"), "unexpected path in pre-signed URL") + validationErrorTest(t, toToken("https://sts.amazonaws.com/abc"), "unexpected path in pre-signed URL") + validationErrorTest(t, toToken("https://sts.amazonaws.com/?NoInWhiteList=abc"), "non-whitelisted query parameter") + validationErrorTest(t, toToken("https://sts.amazonaws.com/?action=get&action=post"), "query parameter with multiple values not supported") + validationErrorTest(t, toToken("https://sts.amazonaws.com/?action=NotGetCallerIdenity"), "unexpected action parameter in pre-signed URL") + validationErrorTest(t, toToken("https://sts.amazonaws.com/?action=GetCallerIdentity&x-amz-signedheaders=abc%3bx-k8s-aws-i%3bdef"), "client did not sign the x-k8s-aws-id header in the pre-signed URL") + validationErrorTest(t, toToken(fmt.Sprintf("https://sts.amazonaws.com/?action=GetCallerIdentity&x-amz-signedheaders=x-k8s-aws-id&x-amz-date=%s&x-amz-expires=9999999", timeStr)), "invalid X-Amz-Expires parameter in pre-signed URL") + validationErrorTest(t, toToken("https://sts.amazonaws.com/?action=GetCallerIdentity&x-amz-signedheaders=x-k8s-aws-id&x-amz-date=xxxxxxx&x-amz-expires=60"), "error parsing X-Amz-Date parameter") + validationErrorTest(t, toToken("https://sts.amazonaws.com/?action=GetCallerIdentity&x-amz-signedheaders=x-k8s-aws-id&x-amz-date=19900422T010203Z&x-amz-expires=60"), "X-Amz-Date parameter is expired") + validationSuccessTest(t, toToken(fmt.Sprintf("https://sts.us-east-2.amazonaws.com/?action=GetCallerIdentity&x-amz-signedheaders=x-k8s-aws-id&x-amz-date=%s&x-amz-expires=60", timeStr))) + validationSuccessTest(t, toToken(fmt.Sprintf("https://sts.ap-northeast-2.amazonaws.com/?action=GetCallerIdentity&x-amz-signedheaders=x-k8s-aws-id&x-amz-date=%s&x-amz-expires=60", timeStr))) + validationSuccessTest(t, toToken(fmt.Sprintf("https://sts.ca-central-1.amazonaws.com/?action=GetCallerIdentity&x-amz-signedheaders=x-k8s-aws-id&x-amz-date=%s&x-amz-expires=60", timeStr))) + validationSuccessTest(t, toToken(fmt.Sprintf("https://sts.eu-west-1.amazonaws.com/?action=GetCallerIdentity&x-amz-signedheaders=x-k8s-aws-id&x-amz-date=%s&x-amz-expires=60", timeStr))) + validationSuccessTest(t, toToken(fmt.Sprintf("https://sts.sa-east-1.amazonaws.com/?action=GetCallerIdentity&x-amz-signedheaders=x-k8s-aws-id&x-amz-date=%s&x-amz-expires=60", timeStr))) +} + +func TestVerifyHTTPError(t *testing.T) { + _, err := newVerifier(0, "", errors.New("an error")).Verify(validToken) + errorContains(t, err, "error during GET: an error") + assertSTSError(t, err) +} + +func TestVerifyHTTP403(t *testing.T) { + _, err := newVerifier(403, " ", nil).Verify(validToken) + errorContains(t, err, "error from AWS (expected 200, got") + assertSTSError(t, err) +} + +func TestVerifyBodyReadError(t *testing.T) { + verifier := tokenVerifier{ + client: &http.Client{ + Transport: &roundTripper{ + err: nil, + resp: &http.Response{ + StatusCode: 200, + Body: errorReadCloser{}, + }, + }, + }, + } + _, err := verifier.Verify(validToken) + errorContains(t, err, "error reading HTTP result") + assertSTSError(t, err) +} + +func TestVerifyUnmarshalJSONError(t *testing.T) { + _, err := newVerifier(200, "xxxx", nil).Verify(validToken) + errorContains(t, err, "invalid character") + assertSTSError(t, err) +} + +func TestVerifyInvalidCanonicalARNError(t *testing.T) { + _, err := newVerifier(200, jsonResponse("arn", "1000", "userid"), nil).Verify(validToken) + errorContains(t, err, "arn 'arn' is invalid:") + assertSTSError(t, err) +} + +func TestVerifyInvalidUserIDError(t *testing.T) { + _, err := newVerifier(200, jsonResponse("arn:aws:iam::123456789012:user/Alice", "123456789012", "not:vailid:userid"), nil).Verify(validToken) + errorContains(t, err, "malformed UserID") + assertSTSError(t, err) +} + +func TestVerifyNoSession(t *testing.T) { + arn := "arn:aws:iam::123456789012:user/Alice" + account := "123456789012" + userID := "Alice" + accessKeyID := "ASIABCDEFGHIJKLMNOPQ" + identity, err := newVerifier(200, jsonResponse(arn, account, userID), nil).Verify(validToken) + if err != nil { + t.Errorf("expected error to be nil was %q", err) + } + if identity.AccessKeyID != accessKeyID { + t.Errorf("expected AccessKeyID to be %q but was %q", accessKeyID, identity.AccessKeyID) + } + if identity.ARN != arn { + t.Errorf("expected ARN to be %q but was %q", arn, identity.ARN) + } + if identity.CanonicalARN != arn { + t.Errorf("expected CanonicalARN to be %q but was %q", arn, identity.CanonicalARN) + } + if identity.UserID != userID { + t.Errorf("expected Username to be %q but was %q", userID, identity.UserID) + } +} + +func TestVerifySessionName(t *testing.T) { + arn := "arn:aws:iam::123456789012:user/Alice" + account := "123456789012" + userID := "Alice" + session := "session-name" + identity, err := newVerifier(200, jsonResponse(arn, account, userID+":"+session), nil).Verify(validToken) + if err != nil { + t.Errorf("expected error to be nil was %q", err) + } + if identity.UserID != userID { + t.Errorf("expected Username to be %q but was %q", userID, identity.UserID) + } + if identity.SessionName != session { + t.Errorf("expected Session to be %q but was %q", session, identity.SessionName) + } +} + +func TestVerifyCanonicalARN(t *testing.T) { + arn := "arn:aws:sts::123456789012:assumed-role/Alice/extra" + canonicalARN := "arn:aws:iam::123456789012:role/Alice" + account := "123456789012" + userID := "Alice" + session := "session-name" + identity, err := newVerifier(200, jsonResponse(arn, account, userID+":"+session), nil).Verify(validToken) + if err != nil { + t.Errorf("expected error to be nil was %q", err) + } + if identity.ARN != arn { + t.Errorf("expected ARN to be %q but was %q", arn, identity.ARN) + } + if identity.CanonicalARN != canonicalARN { + t.Errorf("expected CannonicalARN to be %q but was %q", canonicalARN, identity.CanonicalARN) + } +} diff --git a/aws/media_convert_structure.go b/aws/media_convert_structure.go new file mode 100644 index 00000000000..f7e4e207190 --- /dev/null +++ b/aws/media_convert_structure.go @@ -0,0 +1,38 @@ +package aws + +import ( + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/mediaconvert" +) + +func expandMediaConvertReservationPlanSettings(config map[string]interface{}) *mediaconvert.ReservationPlanSettings { + reservationPlanSettings := &mediaconvert.ReservationPlanSettings{} + + if v, ok := config["commitment"]; ok { + reservationPlanSettings.Commitment = aws.String(v.(string)) + } + + if v, ok := config["renewal_type"]; ok { + reservationPlanSettings.RenewalType = aws.String(v.(string)) + } + + if v, ok := config["reserved_slots"]; ok { + reservationPlanSettings.ReservedSlots = aws.Int64(int64(v.(int))) + } + + return reservationPlanSettings +} + +func flattenMediaConvertReservationPlan(reservationPlan *mediaconvert.ReservationPlan) []interface{} { + if reservationPlan == nil { + return []interface{}{} + } + + m := map[string]interface{}{ + "commitment": aws.StringValue(reservationPlan.Commitment), + "renewal_type": aws.StringValue(reservationPlan.RenewalType), + "reserved_slots": aws.Int64Value(reservationPlan.ReservedSlots), + } + + return []interface{}{m} +} diff --git a/aws/opsworks_layers.go b/aws/opsworks_layers.go index 6a95857b89e..8a447343483 100644 --- a/aws/opsworks_layers.go +++ b/aws/opsworks_layers.go @@ -195,6 +195,12 @@ func (lt *opsworksLayerType) SchemaResource() *schema.Resource { Optional: true, Default: "standard", }, + + "encrypted": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, }, }, Set: func(v interface{}) int { @@ -593,7 +599,9 @@ func (lt *opsworksLayerType) VolumeConfigurations(d *schema.ResourceData) []*ops NumberOfDisks: aws.Int64(int64(volumeData["number_of_disks"].(int))), Size: aws.Int64(int64(volumeData["size"].(int))), VolumeType: aws.String(volumeData["type"].(string)), + Encrypted: aws.Bool(volumeData["encrypted"].(bool)), } + iops := int64(volumeData["iops"].(int)) if iops != 0 { result[i].Iops = aws.Int64(iops) @@ -639,6 +647,9 @@ func (lt *opsworksLayerType) SetVolumeConfigurations(d *schema.ResourceData, v [ if config.VolumeType != nil { data["type"] = *config.VolumeType } + if config.Encrypted != nil { + data["encrypted"] = *config.Encrypted + } } d.Set("ebs_volume", newValue) diff --git a/aws/provider.go b/aws/provider.go index 0655be2d4c6..8bc2aa714bf 100644 --- a/aws/provider.go +++ b/aws/provider.go @@ -90,6 +90,22 @@ func Provider() terraform.ResourceProvider { "endpoints": endpointsSchema(), + "ignore_tag_prefixes": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Description: "Resource tag key prefixes to ignore across all resources.", + }, + + "ignore_tags": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + Description: "Resource tag keys to ignore across all resources.", + }, + "insecure": { Type: schema.TypeBool, Optional: true, @@ -171,6 +187,7 @@ func Provider() terraform.ResourceProvider { "aws_db_event_categories": dataSourceAwsDbEventCategories(), "aws_db_instance": dataSourceAwsDbInstance(), "aws_db_snapshot": dataSourceAwsDbSnapshot(), + "aws_directory_service_directory": dataSourceAwsDirectoryServiceDirectory(), "aws_dx_gateway": dataSourceAwsDxGateway(), "aws_dynamodb_table": dataSourceAwsDynamoDbTable(), "aws_ebs_default_kms_key": dataSourceAwsEbsDefaultKmsKey(), @@ -178,6 +195,8 @@ func Provider() terraform.ResourceProvider { "aws_ebs_snapshot": dataSourceAwsEbsSnapshot(), "aws_ebs_snapshot_ids": dataSourceAwsEbsSnapshotIds(), "aws_ebs_volume": dataSourceAwsEbsVolume(), + "aws_ec2_instance_type_offering": dataSourceAwsEc2InstanceTypeOffering(), + "aws_ec2_instance_type_offerings": dataSourceAwsEc2InstanceTypeOfferings(), "aws_ec2_transit_gateway": dataSourceAwsEc2TransitGateway(), "aws_ec2_transit_gateway_dx_gateway_attachment": dataSourceAwsEc2TransitGatewayDxGatewayAttachment(), "aws_ec2_transit_gateway_route_table": dataSourceAwsEc2TransitGatewayRouteTable(), @@ -205,6 +224,7 @@ func Provider() terraform.ResourceProvider { "aws_elb_hosted_zone_id": dataSourceAwsElbHostedZoneId(), "aws_elb_service_account": dataSourceAwsElbServiceAccount(), "aws_glue_script": dataSourceAwsGlueScript(), + "aws_guardduty_detector": dataSourceAwsGuarddutyDetector(), "aws_iam_account_alias": dataSourceAwsIamAccountAlias(), "aws_iam_group": dataSourceAwsIAMGroup(), "aws_iam_instance_profile": dataSourceAwsIAMInstanceProfile(), @@ -225,6 +245,7 @@ func Provider() terraform.ResourceProvider { "aws_kms_key": dataSourceAwsKmsKey(), "aws_kms_secret": dataSourceAwsKmsSecret(), "aws_kms_secrets": dataSourceAwsKmsSecrets(), + "aws_lambda_alias": dataSourceAwsLambdaAlias(), "aws_lambda_function": dataSourceAwsLambdaFunction(), "aws_lambda_invocation": dataSourceAwsLambdaInvocation(), "aws_lambda_layer_version": dataSourceAwsLambdaLayerVersion(), @@ -238,9 +259,11 @@ func Provider() terraform.ResourceProvider { "aws_network_interface": dataSourceAwsNetworkInterface(), "aws_network_interfaces": dataSourceAwsNetworkInterfaces(), "aws_organizations_organization": dataSourceAwsOrganizationsOrganization(), + "aws_organizations_organizational_units": dataSourceAwsOrganizationsOrganizationalUnits(), "aws_partition": dataSourceAwsPartition(), "aws_prefix_list": dataSourceAwsPrefixList(), "aws_pricing_product": dataSourceAwsPricingProduct(), + "aws_qldb_ledger": dataSourceAwsQLDBLedger(), "aws_ram_resource_share": dataSourceAwsRamResourceShare(), "aws_rds_cluster": dataSourceAwsRdsCluster(), "aws_redshift_cluster": dataSourceAwsRedshiftCluster(), @@ -260,10 +283,13 @@ func Provider() terraform.ResourceProvider { "aws_secretsmanager_secret_version": dataSourceAwsSecretsManagerSecretVersion(), "aws_servicequotas_service": dataSourceAwsServiceQuotasService(), "aws_servicequotas_service_quota": dataSourceAwsServiceQuotasServiceQuota(), + "aws_sfn_activity": dataSourceAwsSfnActivity(), + "aws_sfn_state_machine": dataSourceAwsSfnStateMachine(), "aws_sns_topic": dataSourceAwsSnsTopic(), "aws_sqs_queue": dataSourceAwsSqsQueue(), "aws_ssm_document": dataSourceAwsSsmDocument(), "aws_ssm_parameter": dataSourceAwsSsmParameter(), + "aws_ssm_patch_baseline": dataSourceAwsSsmPatchBaseline(), "aws_storagegateway_local_disk": dataSourceAwsStorageGatewayLocalDisk(), "aws_subnet": dataSourceAwsSubnet(), "aws_subnet_ids": dataSourceAwsSubnetIDs(), @@ -279,9 +305,11 @@ func Provider() terraform.ResourceProvider { "aws_vpn_gateway": dataSourceAwsVpnGateway(), "aws_waf_ipset": dataSourceAwsWafIpSet(), "aws_waf_rule": dataSourceAwsWafRule(), + "aws_waf_rate_based_rule": dataSourceAwsWafRateBasedRule(), "aws_waf_web_acl": dataSourceAwsWafWebAcl(), "aws_wafregional_ipset": dataSourceAwsWafRegionalIpSet(), "aws_wafregional_rule": dataSourceAwsWafRegionalRule(), + "aws_wafregional_rate_based_rule": dataSourceAwsWafRegionalRateBasedRule(), "aws_wafregional_web_acl": dataSourceAwsWafRegionalWebAcl(), "aws_workspaces_bundle": dataSourceAwsWorkspaceBundle(), @@ -295,6 +323,7 @@ func Provider() terraform.ResourceProvider { }, ResourcesMap: map[string]*schema.Resource{ + "aws_accessanalyzer_analyzer": resourceAwsAccessAnalyzerAnalyzer(), "aws_acm_certificate": resourceAwsAcmCertificate(), "aws_acm_certificate_validation": resourceAwsAcmCertificateValidation(), "aws_acmpca_certificate_authority": resourceAwsAcmpcaCertificateAuthority(), @@ -400,6 +429,7 @@ func Provider() terraform.ResourceProvider { "aws_codebuild_webhook": resourceAwsCodeBuildWebhook(), "aws_codepipeline": resourceAwsCodePipeline(), "aws_codepipeline_webhook": resourceAwsCodePipelineWebhook(), + "aws_codestarnotifications_notification_rule": resourceAwsCodeStarNotificationsNotificationRule(), "aws_cur_report_definition": resourceAwsCurReportDefinition(), "aws_customer_gateway": resourceAwsCustomerGateway(), "aws_datapipeline_pipeline": resourceAwsDataPipelinePipeline(), @@ -407,6 +437,7 @@ func Provider() terraform.ResourceProvider { "aws_datasync_location_efs": resourceAwsDataSyncLocationEfs(), "aws_datasync_location_nfs": resourceAwsDataSyncLocationNfs(), "aws_datasync_location_s3": resourceAwsDataSyncLocationS3(), + "aws_datasync_location_smb": resourceAwsDataSyncLocationSmb(), "aws_datasync_task": resourceAwsDataSyncTask(), "aws_dax_cluster": resourceAwsDaxCluster(), "aws_dax_parameter_group": resourceAwsDaxParameterGroup(), @@ -445,6 +476,8 @@ func Provider() terraform.ResourceProvider { "aws_dx_hosted_private_virtual_interface_accepter": resourceAwsDxHostedPrivateVirtualInterfaceAccepter(), "aws_dx_hosted_public_virtual_interface": resourceAwsDxHostedPublicVirtualInterface(), "aws_dx_hosted_public_virtual_interface_accepter": resourceAwsDxHostedPublicVirtualInterfaceAccepter(), + "aws_dx_hosted_transit_virtual_interface": resourceAwsDxHostedTransitVirtualInterface(), + "aws_dx_hosted_transit_virtual_interface_accepter": resourceAwsDxHostedTransitVirtualInterfaceAccepter(), "aws_dx_lag": resourceAwsDxLag(), "aws_dx_private_virtual_interface": resourceAwsDxPrivateVirtualInterface(), "aws_dx_public_virtual_interface": resourceAwsDxPublicVirtualInterface(), @@ -461,6 +494,10 @@ func Provider() terraform.ResourceProvider { "aws_ec2_client_vpn_endpoint": resourceAwsEc2ClientVpnEndpoint(), "aws_ec2_client_vpn_network_association": resourceAwsEc2ClientVpnNetworkAssociation(), "aws_ec2_fleet": resourceAwsEc2Fleet(), + "aws_ec2_traffic_mirror_filter": resourceAwsEc2TrafficMirrorFilter(), + "aws_ec2_traffic_mirror_filter_rule": resourceAwsEc2TrafficMirrorFilterRule(), + "aws_ec2_traffic_mirror_target": resourceAwsEc2TrafficMirrorTarget(), + "aws_ec2_traffic_mirror_session": resourceAwsEc2TrafficMirrorSession(), "aws_ec2_transit_gateway": resourceAwsEc2TransitGateway(), "aws_ec2_transit_gateway_route": resourceAwsEc2TransitGatewayRoute(), "aws_ec2_transit_gateway_route_table": resourceAwsEc2TransitGatewayRouteTable(), @@ -471,6 +508,7 @@ func Provider() terraform.ResourceProvider { "aws_ecr_lifecycle_policy": resourceAwsEcrLifecyclePolicy(), "aws_ecr_repository": resourceAwsEcrRepository(), "aws_ecr_repository_policy": resourceAwsEcrRepositoryPolicy(), + "aws_ecs_capacity_provider": resourceAwsEcsCapacityProvider(), "aws_ecs_cluster": resourceAwsEcsCluster(), "aws_ecs_service": resourceAwsEcsService(), "aws_ecs_task_definition": resourceAwsEcsTaskDefinition(), @@ -480,6 +518,8 @@ func Provider() terraform.ResourceProvider { "aws_eip": resourceAwsEip(), "aws_eip_association": resourceAwsEipAssociation(), "aws_eks_cluster": resourceAwsEksCluster(), + "aws_eks_fargate_profile": resourceAwsEksFargateProfile(), + "aws_eks_node_group": resourceAwsEksNodeGroup(), "aws_elasticache_cluster": resourceAwsElasticacheCluster(), "aws_elasticache_parameter_group": resourceAwsElasticacheParameterGroup(), "aws_elasticache_replication_group": resourceAwsElasticacheReplicationGroup(), @@ -519,6 +559,7 @@ func Provider() terraform.ResourceProvider { "aws_glue_job": resourceAwsGlueJob(), "aws_glue_security_configuration": resourceAwsGlueSecurityConfiguration(), "aws_glue_trigger": resourceAwsGlueTrigger(), + "aws_glue_workflow": resourceAwsGlueWorkflow(), "aws_guardduty_detector": resourceAwsGuardDutyDetector(), "aws_guardduty_invite_accepter": resourceAwsGuardDutyInviteAccepter(), "aws_guardduty_ipset": resourceAwsGuardDutyIpset(), @@ -569,11 +610,13 @@ func Provider() terraform.ResourceProvider { "aws_kms_grant": resourceAwsKmsGrant(), "aws_kms_key": resourceAwsKmsKey(), "aws_kms_ciphertext": resourceAwsKmsCiphertext(), - "aws_lambda_function": resourceAwsLambdaFunction(), - "aws_lambda_event_source_mapping": resourceAwsLambdaEventSourceMapping(), "aws_lambda_alias": resourceAwsLambdaAlias(), - "aws_lambda_permission": resourceAwsLambdaPermission(), + "aws_lambda_event_source_mapping": resourceAwsLambdaEventSourceMapping(), + "aws_lambda_function_event_invoke_config": resourceAwsLambdaFunctionEventInvokeConfig(), + "aws_lambda_function": resourceAwsLambdaFunction(), "aws_lambda_layer_version": resourceAwsLambdaLayerVersion(), + "aws_lambda_permission": resourceAwsLambdaPermission(), + "aws_lambda_provisioned_concurrency_config": resourceAwsLambdaProvisionedConcurrencyConfig(), "aws_launch_configuration": resourceAwsLaunchConfiguration(), "aws_launch_template": resourceAwsLaunchTemplate(), "aws_licensemanager_association": resourceAwsLicenseManagerAssociation(), @@ -593,6 +636,7 @@ func Provider() terraform.ResourceProvider { "aws_main_route_table_association": resourceAwsMainRouteTableAssociation(), "aws_mq_broker": resourceAwsMqBroker(), "aws_mq_configuration": resourceAwsMqConfiguration(), + "aws_media_convert_queue": resourceAwsMediaConvertQueue(), "aws_media_package_channel": resourceAwsMediaPackageChannel(), "aws_media_store_container": resourceAwsMediaStoreContainer(), "aws_media_store_container_policy": resourceAwsMediaStoreContainerPolicy(), @@ -634,7 +678,10 @@ func Provider() terraform.ResourceProvider { "aws_organizations_organizational_unit": resourceAwsOrganizationsOrganizationalUnit(), "aws_placement_group": resourceAwsPlacementGroup(), "aws_proxy_protocol_policy": resourceAwsProxyProtocolPolicy(), + "aws_qldb_ledger": resourceAwsQLDBLedger(), "aws_quicksight_group": resourceAwsQuickSightGroup(), + "aws_quicksight_user": resourceAwsQuickSightUser(), + "aws_quicksight_data_source": resourceAwsQuickSightDataSource(), "aws_ram_principal_association": resourceAwsRamPrincipalAssociation(), "aws_ram_resource_association": resourceAwsRamResourceAssociation(), "aws_ram_resource_share": resourceAwsRamResourceShare(), @@ -687,8 +734,10 @@ func Provider() terraform.ResourceProvider { "aws_ses_event_destination": resourceAwsSesEventDestination(), "aws_ses_identity_notification_topic": resourceAwsSesNotificationTopic(), "aws_ses_template": resourceAwsSesTemplate(), + "aws_s3_access_point": resourceAwsS3AccessPoint(), "aws_s3_account_public_access_block": resourceAwsS3AccountPublicAccessBlock(), "aws_s3_bucket": resourceAwsS3Bucket(), + "aws_s3_bucket_analytics_configuration": resourceAwsS3BucketAnalyticsConfiguration(), "aws_s3_bucket_policy": resourceAwsS3BucketPolicy(), "aws_s3_bucket_public_access_block": resourceAwsS3BucketPublicAccessBlock(), "aws_s3_bucket_object": resourceAwsS3BucketObject(), @@ -794,6 +843,7 @@ func Provider() terraform.ResourceProvider { "aws_wafregional_web_acl_association": resourceAwsWafRegionalWebAclAssociation(), "aws_worklink_fleet": resourceAwsWorkLinkFleet(), "aws_worklink_website_certificate_authority_association": resourceAwsWorkLinkWebsiteCertificateAuthorityAssociation(), + "aws_workspaces_directory": resourceAwsWorkspacesDirectory(), "aws_batch_compute_environment": resourceAwsBatchComputeEnvironment(), "aws_batch_job_definition": resourceAwsBatchJobDefinition(), "aws_batch_job_queue": resourceAwsBatchJobQueue(), @@ -809,6 +859,7 @@ func Provider() terraform.ResourceProvider { "aws_pinpoint_gcm_channel": resourceAwsPinpointGCMChannel(), "aws_pinpoint_sms_channel": resourceAwsPinpointSMSChannel(), "aws_xray_sampling_rule": resourceAwsXraySamplingRule(), + "aws_workspaces_ip_group": resourceAwsWorkspacesIpGroup(), // ALBs are actually LBs because they can be type `network` or `application` // To avoid regressions, we will add a new resource for each and they both point @@ -908,6 +959,7 @@ func init() { } endpointServiceNames = []string{ + "accessanalyzer", "acm", "acmpca", "amplify", @@ -940,6 +992,7 @@ func init() { "cognitoidp", "configservice", "cur", + "dataexchange", "datapipeline", "datasync", "dax", @@ -969,8 +1022,10 @@ func init() { "glacier", "globalaccelerator", "glue", + "greengrass", "guardduty", "iam", + "imagebuilder", "inspector", "iot", "iotanalytics", @@ -988,6 +1043,7 @@ func init() { "lightsail", "macie", "managedblockchain", + "marketplacecatalog", "mediaconnect", "mediaconvert", "medialive", @@ -1032,7 +1088,9 @@ func init() { "transfer", "waf", "wafregional", + "wafv2", "worklink", + "workmail", "workspaces", "xray", } @@ -1090,6 +1148,18 @@ func providerConfigure(d *schema.ResourceData, terraformVersion string) (interfa } } + if v, ok := d.GetOk("ignore_tag_prefixes"); ok { + for _, ignoreTagPrefixRaw := range v.(*schema.Set).List() { + config.IgnoreTagPrefixes = append(config.IgnoreTagPrefixes, ignoreTagPrefixRaw.(string)) + } + } + + if v, ok := d.GetOk("ignore_tags"); ok { + for _, ignoreTagRaw := range v.(*schema.Set).List() { + config.IgnoreTags = append(config.IgnoreTags, ignoreTagRaw.(string)) + } + } + if v, ok := d.GetOk("allowed_account_ids"); ok { for _, accountIDRaw := range v.(*schema.Set).List() { config.AllowedAccountIds = append(config.AllowedAccountIds, accountIDRaw.(string)) diff --git a/aws/provider_test.go b/aws/provider_test.go index 2f9aec9a198..40d07ec69bd 100644 --- a/aws/provider_test.go +++ b/aws/provider_test.go @@ -15,11 +15,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/terraform" - "github.com/terraform-providers/terraform-provider-tls/tls" ) +const rfc3339RegexPattern = `^[0-9]{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])[Tt]([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9](\.[0-9]+)?([Zz]|([+-]([01][0-9]|2[0-3]):[0-5][0-9]))$` + var testAccProviders map[string]terraform.ResourceProvider -var testAccProvidersWithTLS map[string]terraform.ResourceProvider var testAccProviderFactories func(providers *[]*schema.Provider) map[string]terraform.ResourceProviderFactory var testAccProvider *schema.Provider var testAccProviderFunc func() *schema.Provider @@ -38,14 +38,6 @@ func init() { }, } } - testAccProvidersWithTLS = map[string]terraform.ResourceProvider{ - "tls": tls.Provider(), - } - - for k, v := range testAccProviders { - testAccProvidersWithTLS[k] = v - } - testAccProviderFunc = func() *schema.Provider { return testAccProvider } } @@ -117,6 +109,19 @@ func testAccCheckResourceAttrRegionalARN(resourceName, attributeName, arnService } } +// testAccCheckResourceAttrRegionalARNNoAccount ensures the Terraform state exactly matches a formatted ARN with region but without account ID +func testAccCheckResourceAttrRegionalARNNoAccount(resourceName, attributeName, arnService, arnResource string) resource.TestCheckFunc { + return func(s *terraform.State) error { + attributeValue := arn.ARN{ + Partition: testAccGetPartition(), + Region: testAccGetRegion(), + Resource: arnResource, + Service: arnService, + }.String() + return resource.TestCheckResourceAttr(resourceName, attributeName, attributeValue)(s) + } +} + // testAccMatchResourceAttrRegionalARN ensures the Terraform state regexp matches a formatted ARN with region func testAccMatchResourceAttrRegionalARN(resourceName, attributeName, arnService string, arnResourceRegexp *regexp.Regexp) resource.TestCheckFunc { return func(s *terraform.State) error { @@ -138,6 +143,41 @@ func testAccMatchResourceAttrRegionalARN(resourceName, attributeName, arnService } } +// testAccMatchResourceAttrRegionalARNNoAccount ensures the Terraform state regexp matches a formatted ARN with region but without account ID +func testAccMatchResourceAttrRegionalARNNoAccount(resourceName, attributeName, arnService string, arnResourceRegexp *regexp.Regexp) resource.TestCheckFunc { + return func(s *terraform.State) error { + arnRegexp := arn.ARN{ + Partition: testAccGetPartition(), + Region: testAccGetRegion(), + Resource: arnResourceRegexp.String(), + Service: arnService, + }.String() + + attributeMatch, err := regexp.Compile(arnRegexp) + + if err != nil { + return fmt.Errorf("Unable to compile ARN regexp (%s): %s", arnRegexp, err) + } + + return resource.TestMatchResourceAttr(resourceName, attributeName, attributeMatch)(s) + } +} + +// testAccMatchResourceAttrRegionalHostname ensures the Terraform state regexp matches a formatted DNS hostname with region and partition DNS suffix +func testAccMatchResourceAttrRegionalHostname(resourceName, attributeName, serviceName string, hostnamePrefixRegexp *regexp.Regexp) resource.TestCheckFunc { + return func(s *terraform.State) error { + hostnameRegexpPattern := fmt.Sprintf("%s\\.%s\\.%s\\.%s$", hostnamePrefixRegexp.String(), serviceName, testAccGetRegion(), testAccGetPartitionDNSSuffix()) + + hostnameRegexp, err := regexp.Compile(hostnameRegexpPattern) + + if err != nil { + return fmt.Errorf("Unable to compile hostname regexp (%s): %s", hostnameRegexp, err) + } + + return resource.TestMatchResourceAttr(resourceName, attributeName, hostnameRegexp)(s) + } +} + // testAccCheckResourceAttrGlobalARN ensures the Terraform state exactly matches a formatted ARN without region func testAccCheckResourceAttrGlobalARN(resourceName, attributeName, arnService, arnResource string) resource.TestCheckFunc { return func(s *terraform.State) error { @@ -151,6 +191,18 @@ func testAccCheckResourceAttrGlobalARN(resourceName, attributeName, arnService, } } +// testAccCheckResourceAttrGlobalARNNoAccount ensures the Terraform state exactly matches a formatted ARN without region or account ID +func testAccCheckResourceAttrGlobalARNNoAccount(resourceName, attributeName, arnService, arnResource string) resource.TestCheckFunc { + return func(s *terraform.State) error { + attributeValue := arn.ARN{ + Partition: testAccGetPartition(), + Resource: arnResource, + Service: arnService, + }.String() + return resource.TestCheckResourceAttr(resourceName, attributeName, attributeValue)(s) + } +} + // testAccMatchResourceAttrGlobalARN ensures the Terraform state regexp matches a formatted ARN without region func testAccMatchResourceAttrGlobalARN(resourceName, attributeName, arnService string, arnResourceRegexp *regexp.Regexp) resource.TestCheckFunc { return func(s *terraform.State) error { @@ -171,6 +223,73 @@ func testAccMatchResourceAttrGlobalARN(resourceName, attributeName, arnService s } } +// testAccCheckResourceAttrRfc3339 ensures the Terraform state matches a RFC3339 value +// This TestCheckFunc will likely be moved to the Terraform Plugin SDK in the future. +func testAccCheckResourceAttrRfc3339(resourceName, attributeName string) resource.TestCheckFunc { + return resource.TestMatchResourceAttr(resourceName, attributeName, regexp.MustCompile(rfc3339RegexPattern)) +} + +// testAccCheckListHasSomeElementAttrPair is a TestCheckFunc which validates that the collection on the left has an element with an attribute value +// matching the value on the left +// Based on TestCheckResourceAttrPair from the Terraform SDK testing framework +func testAccCheckListHasSomeElementAttrPair(nameFirst string, resourceAttr string, elementAttr string, nameSecond string, keySecond string) resource.TestCheckFunc { + return func(s *terraform.State) error { + isFirst, err := primaryInstanceState(s, nameFirst) + if err != nil { + return err + } + + isSecond, err := primaryInstanceState(s, nameSecond) + if err != nil { + return err + } + + vSecond, ok := isSecond.Attributes[keySecond] + if !ok { + return fmt.Errorf("%s: No attribute %q found", nameSecond, keySecond) + } else if vSecond == "" { + return fmt.Errorf("%s: No value was set on attribute %q", nameSecond, keySecond) + } + + attrsFirst := make([]string, 0, len(isFirst.Attributes)) + attrMatcher := regexp.MustCompile(fmt.Sprintf("%s\\.\\d+\\.%s", resourceAttr, elementAttr)) + for k := range isFirst.Attributes { + if attrMatcher.MatchString(k) { + attrsFirst = append(attrsFirst, k) + } + } + + found := false + for _, attrName := range attrsFirst { + vFirst := isFirst.Attributes[attrName] + if vFirst == vSecond { + found = true + break + } + } + if !found { + return fmt.Errorf("%s: No element of %q found with attribute %q matching value %q set on %q of %s", nameFirst, resourceAttr, elementAttr, vSecond, keySecond, nameSecond) + } + + return nil + } +} + +// Copied and inlined from the SDK testing code +func primaryInstanceState(s *terraform.State, name string) (*terraform.InstanceState, error) { + rs, ok := s.RootModule().Resources[name] + if !ok { + return nil, fmt.Errorf("Not found: %s", name) + } + + is := rs.Primary + if is == nil { + return nil, fmt.Errorf("No primary instance: %s", name) + } + + return is, nil +} + // testAccGetAccountID returns the account ID of testAccProvider // Must be used returned within a resource.TestCheckFunc func testAccGetAccountID() string { @@ -200,6 +319,20 @@ func testAccGetPartition() string { return "aws" } +func testAccGetPartitionDNSSuffix() string { + if partition, ok := endpoints.PartitionForRegion(endpoints.DefaultPartitions(), testAccGetRegion()); ok { + return partition.DNSSuffix() + } + return "amazonaws.com" +} + +func testAccGetAlternateRegionPartition() string { + if partition, ok := endpoints.PartitionForRegion(endpoints.DefaultPartitions(), testAccGetAlternateRegion()); ok { + return partition.ID() + } + return "aws" +} + func testAccAlternateAccountPreCheck(t *testing.T) { if os.Getenv("AWS_ALTERNATE_PROFILE") == "" && os.Getenv("AWS_ALTERNATE_ACCESS_KEY_ID") == "" { t.Fatal("AWS_ALTERNATE_ACCESS_KEY_ID or AWS_ALTERNATE_PROFILE must be set for acceptance tests") @@ -214,6 +347,10 @@ func testAccAlternateRegionPreCheck(t *testing.T) { if testAccGetRegion() == testAccGetAlternateRegion() { t.Fatal("AWS_DEFAULT_REGION and AWS_ALTERNATE_REGION must be set to different values for acceptance tests") } + + if testAccGetPartition() != testAccGetAlternateRegionPartition() { + t.Fatalf("AWS_ALTERNATE_REGION partition (%s) does not match AWS_DEFAULT_REGION partition (%s)", testAccGetAlternateRegionPartition(), testAccGetPartition()) + } } func testAccEC2ClassicPreCheck(t *testing.T) { @@ -226,10 +363,39 @@ func testAccEC2ClassicPreCheck(t *testing.T) { } } -func testAccHasServicePreCheck(service string, t *testing.T) { +func testAccEC2VPCOnlyPreCheck(t *testing.T) { + client := testAccProvider.Meta().(*AWSClient) + platforms := client.supportedplatforms + region := client.region + if hasEc2Classic(platforms) { + t.Skipf("This test can only in regions without EC2 Classic, platforms available in %s: %q", + region, platforms) + } +} + +func testAccPartitionHasServicePreCheck(serviceId string, t *testing.T) { if partition, ok := endpoints.PartitionForRegion(endpoints.DefaultPartitions(), testAccGetRegion()); ok { - if _, ok := partition.Services()[service]; !ok { - t.Skip(fmt.Sprintf("skipping tests; partition does not support %s service", service)) + if _, ok := partition.Services()[serviceId]; !ok { + t.Skip(fmt.Sprintf("skipping tests; partition %s does not support %s service", partition.ID(), serviceId)) + } + } +} + +// testAccRegionHasServicePreCheck skips a test if the AWS Go SDK endpoint value in a region is missing +// NOTE: Most acceptance testing should prefer behavioral checks against an API (e.g. making an API call and +// using response errors) to determine if a test should be skipped since AWS Go SDK endpoint information +// can be incorrect, especially for newer endpoints or for private feature testing. This functionality +// is provided for cases where the API behavior may be completely unacceptable, such as permanent +// retries by the AWS Go SDK. +func testAccRegionHasServicePreCheck(serviceId string, t *testing.T) { + regionId := testAccGetRegion() + if partition, ok := endpoints.PartitionForRegion(endpoints.DefaultPartitions(), regionId); ok { + service, ok := partition.Services()[serviceId] + if !ok { + t.Skip(fmt.Sprintf("skipping tests; partition %s does not support %s service", partition.ID(), serviceId)) + } + if _, ok := service.Regions()[regionId]; !ok { + t.Skip(fmt.Sprintf("skipping tests; region %s does not support %s service", regionId, serviceId)) } } } @@ -287,6 +453,22 @@ provider "aws" { `, testAccGetAlternateRegion()) } +func testAccProviderConfigIgnoreTagPrefixes1(keyPrefix1 string) string { + return fmt.Sprintf(` +provider "aws" { + ignore_tag_prefixes = [%[1]q] +} +`, keyPrefix1) +} + +func testAccProviderConfigIgnoreTags1(key1 string) string { + return fmt.Sprintf(` +provider "aws" { + ignore_tags = [%[1]q] +} +`, key1) +} + // Provider configuration hardcoded for us-east-1. // This should only be necessary for testing ACM Certificates with CloudFront // related infrastucture such as API Gateway Domain Names for EDGE endpoints, @@ -476,6 +658,114 @@ func TestAccAWSProvider_Endpoints_Deprecated(t *testing.T) { }) } +func TestAccAWSProvider_IgnoreTagPrefixes_None(t *testing.T) { + var providers []*schema.Provider + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories(&providers), + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSProviderConfigIgnoreTagPrefixes0(), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSProviderIgnoreTagPrefixes(&providers, []string{}), + ), + }, + }, + }) +} + +func TestAccAWSProvider_IgnoreTagPrefixes_One(t *testing.T) { + var providers []*schema.Provider + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories(&providers), + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSProviderConfigIgnoreTagPrefixes1("test"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSProviderIgnoreTagPrefixes(&providers, []string{"test"}), + ), + }, + }, + }) +} + +func TestAccAWSProvider_IgnoreTagPrefixes_Multiple(t *testing.T) { + var providers []*schema.Provider + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories(&providers), + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSProviderConfigIgnoreTagPrefixes2("test1", "test2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSProviderIgnoreTagPrefixes(&providers, []string{"test1", "test2"}), + ), + }, + }, + }) +} + +func TestAccAWSProvider_IgnoreTags_None(t *testing.T) { + var providers []*schema.Provider + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories(&providers), + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSProviderConfigIgnoreTags0(), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSProviderIgnoreTags(&providers, []string{}), + ), + }, + }, + }) +} + +func TestAccAWSProvider_IgnoreTags_One(t *testing.T) { + var providers []*schema.Provider + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories(&providers), + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSProviderConfigIgnoreTags1("test"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSProviderIgnoreTags(&providers, []string{"test"}), + ), + }, + }, + }) +} + +func TestAccAWSProvider_IgnoreTags_Multiple(t *testing.T) { + var providers []*schema.Provider + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories(&providers), + CheckDestroy: nil, + Steps: []resource.TestStep{ + { + Config: testAccAWSProviderConfigIgnoreTags2("test1", "test2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSProviderIgnoreTags(&providers, []string{"test1", "test2"}), + ), + }, + }, + }) +} + func TestAccAWSProvider_Region_AwsChina(t *testing.T) { var providers []*schema.Provider @@ -691,6 +981,114 @@ func testAccCheckAWSProviderEndpointsDeprecated(providers *[]*schema.Provider) r } } +func testAccCheckAWSProviderIgnoreTagPrefixes(providers *[]*schema.Provider, expectedIgnoreTagPrefixes []string) resource.TestCheckFunc { + return func(s *terraform.State) error { + if providers == nil { + return fmt.Errorf("no providers initialized") + } + + for _, provider := range *providers { + if provider == nil || provider.Meta() == nil || provider.Meta().(*AWSClient) == nil { + continue + } + + providerClient := provider.Meta().(*AWSClient) + + actualIgnoreTagPrefixes := providerClient.ignoreTagPrefixes.Keys() + + if len(actualIgnoreTagPrefixes) != len(expectedIgnoreTagPrefixes) { + return fmt.Errorf("expected ignore_tag_prefixes (%d) length, got: %d", len(expectedIgnoreTagPrefixes), len(actualIgnoreTagPrefixes)) + } + + for _, expectedElement := range expectedIgnoreTagPrefixes { + var found bool + + for _, actualElement := range actualIgnoreTagPrefixes { + if actualElement == expectedElement { + found = true + break + } + } + + if !found { + return fmt.Errorf("expected ignore_tag_prefixes element, but was missing: %s", expectedElement) + } + } + + for _, actualElement := range actualIgnoreTagPrefixes { + var found bool + + for _, expectedElement := range expectedIgnoreTagPrefixes { + if actualElement == expectedElement { + found = true + break + } + } + + if !found { + return fmt.Errorf("unexpected ignore_tag_prefixes element: %s", actualElement) + } + } + } + + return nil + } +} + +func testAccCheckAWSProviderIgnoreTags(providers *[]*schema.Provider, expectedIgnoreTags []string) resource.TestCheckFunc { + return func(s *terraform.State) error { + if providers == nil { + return fmt.Errorf("no providers initialized") + } + + for _, provider := range *providers { + if provider == nil || provider.Meta() == nil || provider.Meta().(*AWSClient) == nil { + continue + } + + providerClient := provider.Meta().(*AWSClient) + + actualIgnoreTags := providerClient.ignoreTags.Keys() + + if len(actualIgnoreTags) != len(expectedIgnoreTags) { + return fmt.Errorf("expected ignore_tags (%d) length, got: %d", len(expectedIgnoreTags), len(actualIgnoreTags)) + } + + for _, expectedElement := range expectedIgnoreTags { + var found bool + + for _, actualElement := range actualIgnoreTags { + if actualElement == expectedElement { + found = true + break + } + } + + if !found { + return fmt.Errorf("expected ignore_tags element, but was missing: %s", expectedElement) + } + } + + for _, actualElement := range actualIgnoreTags { + var found bool + + for _, expectedElement := range expectedIgnoreTags { + if actualElement == expectedElement { + found = true + break + } + } + + if !found { + return fmt.Errorf("unexpected ignore_tags element: %s", actualElement) + } + } + } + + return nil + } +} + func testAccCheckAWSProviderPartition(providers *[]*schema.Provider, expectedPartition string) resource.TestCheckFunc { return func(s *terraform.State) error { if providers == nil { @@ -733,6 +1131,106 @@ data "aws_arn" "test" { `, endpoints) } +func testAccAWSProviderConfigIgnoreTagPrefixes0() string { + return fmt.Sprintf(` +provider "aws" { + skip_credentials_validation = true + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_requesting_account_id = true +} + +# Required to initialize the provider +data "aws_arn" "test" { + arn = "arn:aws:s3:::test" +} +`) +} + +func testAccAWSProviderConfigIgnoreTagPrefixes1(tagPrefix1 string) string { + return fmt.Sprintf(` +provider "aws" { + ignore_tag_prefixes = [%[1]q] + skip_credentials_validation = true + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_requesting_account_id = true +} + +# Required to initialize the provider +data "aws_arn" "test" { + arn = "arn:aws:s3:::test" +} +`, tagPrefix1) +} + +func testAccAWSProviderConfigIgnoreTagPrefixes2(tagPrefix1, tagPrefix2 string) string { + return fmt.Sprintf(` +provider "aws" { + ignore_tag_prefixes = [%[1]q, %[2]q] + skip_credentials_validation = true + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_requesting_account_id = true +} + +# Required to initialize the provider +data "aws_arn" "test" { + arn = "arn:aws:s3:::test" +} +`, tagPrefix1, tagPrefix2) +} + +func testAccAWSProviderConfigIgnoreTags0() string { + return fmt.Sprintf(` +provider "aws" { + skip_credentials_validation = true + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_requesting_account_id = true +} + +# Required to initialize the provider +data "aws_arn" "test" { + arn = "arn:aws:s3:::test" +} +`) +} + +func testAccAWSProviderConfigIgnoreTags1(tag1 string) string { + return fmt.Sprintf(` +provider "aws" { + ignore_tags = [%[1]q] + skip_credentials_validation = true + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_requesting_account_id = true +} + +# Required to initialize the provider +data "aws_arn" "test" { + arn = "arn:aws:s3:::test" +} +`, tag1) +} + +func testAccAWSProviderConfigIgnoreTags2(tag1, tag2 string) string { + return fmt.Sprintf(` +provider "aws" { + ignore_tags = [%[1]q, %[2]q] + skip_credentials_validation = true + skip_get_ec2_platforms = true + skip_metadata_api_check = true + skip_requesting_account_id = true +} + +# Required to initialize the provider +data "aws_arn" "test" { + arn = "arn:aws:s3:::test" +} +`, tag1, tag2) +} + func testAccAWSProviderConfigRegion(region string) string { return fmt.Sprintf(` provider "aws" { diff --git a/aws/resource_aws_accessanalyzer_analyzer.go b/aws/resource_aws_accessanalyzer_analyzer.go new file mode 100644 index 00000000000..8e656bebcd5 --- /dev/null +++ b/aws/resource_aws_accessanalyzer_analyzer.go @@ -0,0 +1,138 @@ +package aws + +import ( + "fmt" + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/accessanalyzer" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +func resourceAwsAccessAnalyzerAnalyzer() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsAccessAnalyzerAnalyzerCreate, + Read: resourceAwsAccessAnalyzerAnalyzerRead, + Update: resourceAwsAccessAnalyzerAnalyzerUpdate, + Delete: resourceAwsAccessAnalyzerAnalyzerDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + + Schema: map[string]*schema.Schema{ + "analyzer_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.NoZeroValues, + }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tagsSchema(), + "type": { + Type: schema.TypeString, + Optional: true, + Default: accessanalyzer.TypeAccount, + ValidateFunc: validation.StringInSlice([]string{ + accessanalyzer.TypeAccount, + }, false), + }, + }, + } +} + +func resourceAwsAccessAnalyzerAnalyzerCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).accessanalyzerconn + analyzerName := d.Get("analyzer_name").(string) + + input := &accessanalyzer.CreateAnalyzerInput{ + AnalyzerName: aws.String(analyzerName), + ClientToken: aws.String(resource.UniqueId()), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().AccessanalyzerTags(), + Type: aws.String(d.Get("type").(string)), + } + + _, err := conn.CreateAnalyzer(input) + + if err != nil { + return fmt.Errorf("error creating Access Analyzer Analyzer (%s): %s", analyzerName, err) + } + + d.SetId(analyzerName) + + return resourceAwsAccessAnalyzerAnalyzerRead(d, meta) +} + +func resourceAwsAccessAnalyzerAnalyzerRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).accessanalyzerconn + + input := &accessanalyzer.GetAnalyzerInput{ + AnalyzerName: aws.String(d.Id()), + } + + output, err := conn.GetAnalyzer(input) + + if isAWSErr(err, accessanalyzer.ErrCodeResourceNotFoundException, "") { + log.Printf("[WARN] Access Analyzer Analyzer (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + if err != nil { + return fmt.Errorf("error getting Access Analyzer Analyzer (%s): %s", d.Id(), err) + } + + if output == nil || output.Analyzer == nil { + return fmt.Errorf("error getting Access Analyzer Analyzer (%s): empty response", d.Id()) + } + + d.Set("analyzer_name", output.Analyzer.Name) + d.Set("arn", output.Analyzer.Arn) + + if err := d.Set("tags", keyvaluetags.AccessanalyzerKeyValueTags(output.Analyzer.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + d.Set("type", output.Analyzer.Type) + + return nil +} + +func resourceAwsAccessAnalyzerAnalyzerUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).accessanalyzerconn + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.AccessanalyzerUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating Access Analyzer Analyzer (%s) tags: %s", d.Id(), err) + } + } + + return resourceAwsAccessAnalyzerAnalyzerRead(d, meta) +} + +func resourceAwsAccessAnalyzerAnalyzerDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).accessanalyzerconn + + input := &accessanalyzer.DeleteAnalyzerInput{ + AnalyzerName: aws.String(d.Id()), + ClientToken: aws.String(resource.UniqueId()), + } + + _, err := conn.DeleteAnalyzer(input) + + if isAWSErr(err, accessanalyzer.ErrCodeResourceNotFoundException, "") { + return nil + } + + if err != nil { + return fmt.Errorf("error deleting Access Analyzer Analyzer (%s): %s", d.Id(), err) + } + + return nil +} diff --git a/aws/resource_aws_accessanalyzer_analyzer_test.go b/aws/resource_aws_accessanalyzer_analyzer_test.go new file mode 100644 index 00000000000..fa80b36a081 --- /dev/null +++ b/aws/resource_aws_accessanalyzer_analyzer_test.go @@ -0,0 +1,220 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/accessanalyzer" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +// This test can be run via the pattern: TestAccAWSAccessAnalyzer +func testAccAWSAccessAnalyzerAnalyzer_basic(t *testing.T) { + var analyzer accessanalyzer.AnalyzerSummary + + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_accessanalyzer_analyzer.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSAccessAnalyzer(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAccessAnalyzerAnalyzerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAccessAnalyzerAnalyzerConfigAnalyzerName(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsAccessAnalyzerAnalyzerExists(resourceName, &analyzer), + resource.TestCheckResourceAttr(resourceName, "analyzer_name", rName), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "access-analyzer", fmt.Sprintf("analyzer/%s", rName)), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "type", accessanalyzer.TypeAccount), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +// This test can be run via the pattern: TestAccAWSAccessAnalyzer +func testAccAWSAccessAnalyzerAnalyzer_disappears(t *testing.T) { + var analyzer accessanalyzer.AnalyzerSummary + + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_accessanalyzer_analyzer.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSAccessAnalyzer(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAccessAnalyzerAnalyzerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAccessAnalyzerAnalyzerConfigAnalyzerName(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsAccessAnalyzerAnalyzerExists(resourceName, &analyzer), + testAccCheckAwsAccessAnalyzerAnalyzerDisappears(&analyzer), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +// This test can be run via the pattern: TestAccAWSAccessAnalyzer +func testAccAWSAccessAnalyzerAnalyzer_Tags(t *testing.T) { + var analyzer accessanalyzer.AnalyzerSummary + + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_accessanalyzer_analyzer.test" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSAccessAnalyzer(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAccessAnalyzerAnalyzerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAccessAnalyzerAnalyzerConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsAccessAnalyzerAnalyzerExists(resourceName, &analyzer), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSAccessAnalyzerAnalyzerConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsAccessAnalyzerAnalyzerExists(resourceName, &analyzer), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSAccessAnalyzerAnalyzerConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsAccessAnalyzerAnalyzerExists(resourceName, &analyzer), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + +func testAccCheckAccessAnalyzerAnalyzerDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).accessanalyzerconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_accessanalyzer_analyzer" { + continue + } + + input := &accessanalyzer.GetAnalyzerInput{ + AnalyzerName: aws.String(rs.Primary.ID), + } + + output, err := conn.GetAnalyzer(input) + + if isAWSErr(err, accessanalyzer.ErrCodeResourceNotFoundException, "") { + continue + } + + if err != nil { + return err + } + + if output != nil { + return fmt.Errorf("Access Analyzer Analyzer (%s) still exists", rs.Primary.ID) + } + } + + return nil + +} + +func testAccCheckAwsAccessAnalyzerAnalyzerDisappears(analyzer *accessanalyzer.AnalyzerSummary) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).accessanalyzerconn + + input := &accessanalyzer.DeleteAnalyzerInput{ + AnalyzerName: analyzer.Name, + } + + _, err := conn.DeleteAnalyzer(input) + + return err + } +} + +func testAccCheckAwsAccessAnalyzerAnalyzerExists(resourceName string, analyzer *accessanalyzer.AnalyzerSummary) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Resource not found: %s", resourceName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("Resource (%s) ID not set", resourceName) + } + + conn := testAccProvider.Meta().(*AWSClient).accessanalyzerconn + + input := &accessanalyzer.GetAnalyzerInput{ + AnalyzerName: aws.String(rs.Primary.ID), + } + + output, err := conn.GetAnalyzer(input) + + if err != nil { + return err + } + + *analyzer = *output.Analyzer + + return nil + } +} + +func testAccAWSAccessAnalyzerAnalyzerConfigAnalyzerName(rName string) string { + return fmt.Sprintf(` +resource "aws_accessanalyzer_analyzer" "test" { + analyzer_name = %[1]q +} +`, rName) +} + +func testAccAWSAccessAnalyzerAnalyzerConfigTags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_accessanalyzer_analyzer" "test" { + analyzer_name = %[1]q + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccAWSAccessAnalyzerAnalyzerConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_accessanalyzer_analyzer" "test" { + analyzer_name = %[1]q + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} diff --git a/aws/resource_aws_accessanalyzer_test.go b/aws/resource_aws_accessanalyzer_test.go new file mode 100644 index 00000000000..8599262fc09 --- /dev/null +++ b/aws/resource_aws_accessanalyzer_test.go @@ -0,0 +1,47 @@ +package aws + +import ( + "testing" + + "github.com/aws/aws-sdk-go/service/accessanalyzer" +) + +// AccessAnalyzer is limited to one per region, so run serially +// locally and in TeamCity. +func TestAccAWSAccessAnalyzer(t *testing.T) { + testCases := map[string]map[string]func(t *testing.T){ + "Analyzer": { + "basic": testAccAWSAccessAnalyzerAnalyzer_basic, + "disappears": testAccAWSAccessAnalyzerAnalyzer_disappears, + "Tags": testAccAWSAccessAnalyzerAnalyzer_Tags, + }, + } + + for group, m := range testCases { + m := m + t.Run(group, func(t *testing.T) { + for name, tc := range m { + tc := tc + t.Run(name, func(t *testing.T) { + tc(t) + }) + } + }) + } +} + +func testAccPreCheckAWSAccessAnalyzer(t *testing.T) { + conn := testAccProvider.Meta().(*AWSClient).accessanalyzerconn + + input := &accessanalyzer.ListAnalyzersInput{} + + _, err := conn.ListAnalyzers(input) + + if testAccPreCheckSkipError(err) { + t.Skipf("skipping acceptance testing: %s", err) + } + + if err != nil { + t.Fatalf("unexpected PreCheck error: %s", err) + } +} diff --git a/aws/resource_aws_acm_certificate.go b/aws/resource_aws_acm_certificate.go index c20764e4ae7..7aa96427671 100644 --- a/aws/resource_aws_acm_certificate.go +++ b/aws/resource_aws_acm_certificate.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsAcmCertificate() *schema.Resource { @@ -174,17 +175,6 @@ func resourceAwsAcmCertificateCreateImported(d *schema.ResourceData, meta interf } d.SetId(*resp.CertificateArn) - if v, ok := d.GetOk("tags"); ok { - params := &acm.AddTagsToCertificateInput{ - CertificateArn: resp.CertificateArn, - Tags: tagsFromMapACM(v.(map[string]interface{})), - } - _, err := acmconn.AddTagsToCertificate(params) - - if err != nil { - return fmt.Errorf("Error requesting certificate: %s", err) - } - } return resourceAwsAcmCertificateRead(d, meta) } @@ -197,6 +187,10 @@ func resourceAwsAcmCertificateCreateRequested(d *schema.ResourceData, meta inter Options: expandAcmCertificateOptions(d.Get("options").([]interface{})), } + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + params.Tags = keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().AcmTags() + } + if caARN, ok := d.GetOk("certificate_authority_arn"); ok { params.CertificateAuthorityArn = aws.String(caARN.(string)) } @@ -221,17 +215,6 @@ func resourceAwsAcmCertificateCreateRequested(d *schema.ResourceData, meta inter } d.SetId(*resp.CertificateArn) - if v, ok := d.GetOk("tags"); ok { - params := &acm.AddTagsToCertificateInput{ - CertificateArn: resp.CertificateArn, - Tags: tagsFromMapACM(v.(map[string]interface{})), - } - _, err := acmconn.AddTagsToCertificate(params) - - if err != nil { - return fmt.Errorf("Error requesting certificate: %s", err) - } - } return resourceAwsAcmCertificateRead(d, meta) } @@ -281,16 +264,14 @@ func resourceAwsAcmCertificateRead(d *schema.ResourceData, meta interface{}) err return resource.NonRetryableError(fmt.Errorf("error setting certificate options: %s", err)) } - params := &acm.ListTagsForCertificateInput{ - CertificateArn: aws.String(d.Id()), - } + tags, err := keyvaluetags.AcmListTags(acmconn, d.Id()) - tagResp, err := acmconn.ListTagsForCertificate(params) if err != nil { - return resource.NonRetryableError(fmt.Errorf("error listing tags for certificate (%s): %s", d.Id(), err)) + return resource.NonRetryableError(fmt.Errorf("error listing tags for ACM Certificate (%s): %s", d.Id(), err)) } - if err := d.Set("tags", tagsToMapACM(tagResp.Tags)); err != nil { - return resource.NonRetryableError(err) + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return resource.NonRetryableError(fmt.Errorf("error setting tags: %s", err)) } return nil @@ -319,9 +300,9 @@ func resourceAwsAcmCertificateUpdate(d *schema.ResourceData, meta interface{}) e } if d.HasChange("tags") { - err := setTagsACM(acmconn, d) - if err != nil { - return err + o, n := d.GetChange("tags") + if err := keyvaluetags.AcmUpdateTags(acmconn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) } } return resourceAwsAcmCertificateRead(d, meta) @@ -411,6 +392,9 @@ func resourceAwsAcmCertificateImport(conn *acm.ACM, d *schema.ResourceData, upda PrivateKey: []byte(d.Get("private_key").(string)), Certificate: []byte(d.Get("certificate_body").(string)), } + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + params.Tags = keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().AcmTags() + } if chain, ok := d.GetOk("certificate_chain"); ok { params.CertificateChain = []byte(chain.(string)) } diff --git a/aws/resource_aws_acm_certificate_test.go b/aws/resource_aws_acm_certificate_test.go index b5c11f4225a..0705c37800e 100644 --- a/aws/resource_aws_acm_certificate_test.go +++ b/aws/resource_aws_acm_certificate_test.go @@ -52,6 +52,7 @@ func testAccAwsAcmCertificateRandomSubDomain(rootDomain string) string { } func TestAccAWSAcmCertificate_emailValidation(t *testing.T) { + resourceName := "aws_acm_certificate.cert" rootDomain := testAccAwsAcmCertificateDomainFromEnv(t) domain := testAccAwsAcmCertificateRandomSubDomain(rootDomain) @@ -63,16 +64,16 @@ func TestAccAWSAcmCertificate_emailValidation(t *testing.T) { { Config: testAccAcmCertificateConfig(domain, acm.ValidationMethodEmail), Check: resource.ComposeTestCheckFunc( - resource.TestMatchResourceAttr("aws_acm_certificate.cert", "arn", certificateArnRegex), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_name", domain), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.#", "0"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "subject_alternative_names.#", "0"), - resource.TestMatchResourceAttr("aws_acm_certificate.cert", "validation_emails.0", regexp.MustCompile(`^[^@]+@.+$`)), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_method", acm.ValidationMethodEmail), + resource.TestMatchResourceAttr(resourceName, "arn", certificateArnRegex), + resource.TestCheckResourceAttr(resourceName, "domain_name", domain), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.#", "0"), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.#", "0"), + resource.TestMatchResourceAttr(resourceName, "validation_emails.0", regexp.MustCompile(`^[^@]+@.+$`)), + resource.TestCheckResourceAttr(resourceName, "validation_method", acm.ValidationMethodEmail), ), }, { - ResourceName: "aws_acm_certificate.cert", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -82,6 +83,7 @@ func TestAccAWSAcmCertificate_emailValidation(t *testing.T) { } func TestAccAWSAcmCertificate_dnsValidation(t *testing.T) { + resourceName := "aws_acm_certificate.cert" rootDomain := testAccAwsAcmCertificateDomainFromEnv(t) domain := testAccAwsAcmCertificateRandomSubDomain(rootDomain) @@ -93,20 +95,20 @@ func TestAccAWSAcmCertificate_dnsValidation(t *testing.T) { { Config: testAccAcmCertificateConfig(domain, acm.ValidationMethodDns), Check: resource.ComposeTestCheckFunc( - resource.TestMatchResourceAttr("aws_acm_certificate.cert", "arn", certificateArnRegex), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_name", domain), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.#", "1"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.domain_name", domain), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_name"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_type", "CNAME"), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_value"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "subject_alternative_names.#", "0"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_emails.#", "0"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_method", acm.ValidationMethodDns), + resource.TestMatchResourceAttr(resourceName, "arn", certificateArnRegex), + resource.TestCheckResourceAttr(resourceName, "domain_name", domain), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.domain_name", domain), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_name"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.resource_record_type", "CNAME"), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_value"), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.#", "0"), + resource.TestCheckResourceAttr(resourceName, "validation_emails.#", "0"), + resource.TestCheckResourceAttr(resourceName, "validation_method", acm.ValidationMethodDns), ), }, { - ResourceName: "aws_acm_certificate.cert", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -115,6 +117,7 @@ func TestAccAWSAcmCertificate_dnsValidation(t *testing.T) { } func TestAccAWSAcmCertificate_root(t *testing.T) { + resourceName := "aws_acm_certificate.cert" rootDomain := testAccAwsAcmCertificateDomainFromEnv(t) resource.ParallelTest(t, resource.TestCase{ @@ -125,20 +128,20 @@ func TestAccAWSAcmCertificate_root(t *testing.T) { { Config: testAccAcmCertificateConfig(rootDomain, acm.ValidationMethodDns), Check: resource.ComposeTestCheckFunc( - resource.TestMatchResourceAttr("aws_acm_certificate.cert", "arn", certificateArnRegex), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_name", rootDomain), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.#", "1"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.domain_name", rootDomain), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_name"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_type", "CNAME"), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_value"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "subject_alternative_names.#", "0"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_emails.#", "0"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_method", acm.ValidationMethodDns), + resource.TestMatchResourceAttr(resourceName, "arn", certificateArnRegex), + resource.TestCheckResourceAttr(resourceName, "domain_name", rootDomain), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.domain_name", rootDomain), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_name"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.resource_record_type", "CNAME"), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_value"), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.#", "0"), + resource.TestCheckResourceAttr(resourceName, "validation_emails.#", "0"), + resource.TestCheckResourceAttr(resourceName, "validation_method", acm.ValidationMethodDns), ), }, { - ResourceName: "aws_acm_certificate.cert", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -212,6 +215,7 @@ func TestAccAWSAcmCertificate_root_TrailingPeriod(t *testing.T) { } func TestAccAWSAcmCertificate_rootAndWildcardSan(t *testing.T) { + resourceName := "aws_acm_certificate.cert" rootDomain := testAccAwsAcmCertificateDomainFromEnv(t) wildcardDomain := fmt.Sprintf("*.%s", rootDomain) @@ -223,25 +227,25 @@ func TestAccAWSAcmCertificate_rootAndWildcardSan(t *testing.T) { { Config: testAccAcmCertificateConfig_subjectAlternativeNames(rootDomain, strconv.Quote(wildcardDomain), acm.ValidationMethodDns), Check: resource.ComposeTestCheckFunc( - resource.TestMatchResourceAttr("aws_acm_certificate.cert", "arn", certificateArnRegex), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_name", rootDomain), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.#", "2"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.domain_name", rootDomain), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_name"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_type", "CNAME"), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_value"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.1.domain_name", wildcardDomain), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.1.resource_record_name"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.1.resource_record_type", "CNAME"), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.1.resource_record_value"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "subject_alternative_names.#", "1"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "subject_alternative_names.0", wildcardDomain), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_emails.#", "0"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_method", acm.ValidationMethodDns), + resource.TestMatchResourceAttr(resourceName, "arn", certificateArnRegex), + resource.TestCheckResourceAttr(resourceName, "domain_name", rootDomain), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.#", "2"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.domain_name", rootDomain), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_name"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.resource_record_type", "CNAME"), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_value"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.1.domain_name", wildcardDomain), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.1.resource_record_name"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.1.resource_record_type", "CNAME"), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.1.resource_record_value"), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.#", "1"), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.0", wildcardDomain), + resource.TestCheckResourceAttr(resourceName, "validation_emails.#", "0"), + resource.TestCheckResourceAttr(resourceName, "validation_method", acm.ValidationMethodDns), ), }, { - ResourceName: "aws_acm_certificate.cert", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -250,6 +254,7 @@ func TestAccAWSAcmCertificate_rootAndWildcardSan(t *testing.T) { } func TestAccAWSAcmCertificate_san_single(t *testing.T) { + resourceName := "aws_acm_certificate.cert" rootDomain := testAccAwsAcmCertificateDomainFromEnv(t) domain := testAccAwsAcmCertificateRandomSubDomain(rootDomain) sanDomain := testAccAwsAcmCertificateRandomSubDomain(rootDomain) @@ -262,25 +267,25 @@ func TestAccAWSAcmCertificate_san_single(t *testing.T) { { Config: testAccAcmCertificateConfig_subjectAlternativeNames(domain, strconv.Quote(sanDomain), acm.ValidationMethodDns), Check: resource.ComposeTestCheckFunc( - resource.TestMatchResourceAttr("aws_acm_certificate.cert", "arn", certificateArnRegex), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_name", domain), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.#", "2"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.domain_name", domain), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_name"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_type", "CNAME"), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_value"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.1.domain_name", sanDomain), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.1.resource_record_name"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.1.resource_record_type", "CNAME"), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.1.resource_record_value"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "subject_alternative_names.#", "1"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "subject_alternative_names.0", sanDomain), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_emails.#", "0"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_method", acm.ValidationMethodDns), + resource.TestMatchResourceAttr(resourceName, "arn", certificateArnRegex), + resource.TestCheckResourceAttr(resourceName, "domain_name", domain), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.#", "2"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.domain_name", domain), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_name"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.resource_record_type", "CNAME"), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_value"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.1.domain_name", sanDomain), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.1.resource_record_name"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.1.resource_record_type", "CNAME"), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.1.resource_record_value"), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.#", "1"), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.0", sanDomain), + resource.TestCheckResourceAttr(resourceName, "validation_emails.#", "0"), + resource.TestCheckResourceAttr(resourceName, "validation_method", acm.ValidationMethodDns), ), }, { - ResourceName: "aws_acm_certificate.cert", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -289,6 +294,7 @@ func TestAccAWSAcmCertificate_san_single(t *testing.T) { } func TestAccAWSAcmCertificate_san_multiple(t *testing.T) { + resourceName := "aws_acm_certificate.cert" rootDomain := testAccAwsAcmCertificateDomainFromEnv(t) domain := testAccAwsAcmCertificateRandomSubDomain(rootDomain) sanDomain1 := testAccAwsAcmCertificateRandomSubDomain(rootDomain) @@ -302,30 +308,30 @@ func TestAccAWSAcmCertificate_san_multiple(t *testing.T) { { Config: testAccAcmCertificateConfig_subjectAlternativeNames(domain, fmt.Sprintf("%q, %q", sanDomain1, sanDomain2), acm.ValidationMethodDns), Check: resource.ComposeTestCheckFunc( - resource.TestMatchResourceAttr("aws_acm_certificate.cert", "arn", certificateArnRegex), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_name", domain), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.#", "3"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.domain_name", domain), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_name"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_type", "CNAME"), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_value"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.1.domain_name", sanDomain1), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.1.resource_record_name"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.1.resource_record_type", "CNAME"), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.1.resource_record_value"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.2.domain_name", sanDomain2), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.2.resource_record_name"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.2.resource_record_type", "CNAME"), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.2.resource_record_value"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "subject_alternative_names.#", "2"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "subject_alternative_names.0", sanDomain1), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "subject_alternative_names.1", sanDomain2), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_emails.#", "0"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_method", acm.ValidationMethodDns), + resource.TestMatchResourceAttr(resourceName, "arn", certificateArnRegex), + resource.TestCheckResourceAttr(resourceName, "domain_name", domain), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.#", "3"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.domain_name", domain), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_name"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.resource_record_type", "CNAME"), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_value"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.1.domain_name", sanDomain1), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.1.resource_record_name"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.1.resource_record_type", "CNAME"), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.1.resource_record_value"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.2.domain_name", sanDomain2), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.2.resource_record_name"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.2.resource_record_type", "CNAME"), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.2.resource_record_value"), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.#", "2"), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.0", sanDomain1), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.1", sanDomain2), + resource.TestCheckResourceAttr(resourceName, "validation_emails.#", "0"), + resource.TestCheckResourceAttr(resourceName, "validation_method", acm.ValidationMethodDns), ), }, { - ResourceName: "aws_acm_certificate.cert", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -374,6 +380,7 @@ func TestAccAWSAcmCertificate_san_TrailingPeriod(t *testing.T) { } func TestAccAWSAcmCertificate_wildcard(t *testing.T) { + resourceName := "aws_acm_certificate.cert" rootDomain := testAccAwsAcmCertificateDomainFromEnv(t) wildcardDomain := fmt.Sprintf("*.%s", rootDomain) @@ -385,20 +392,20 @@ func TestAccAWSAcmCertificate_wildcard(t *testing.T) { { Config: testAccAcmCertificateConfig(wildcardDomain, acm.ValidationMethodDns), Check: resource.ComposeTestCheckFunc( - resource.TestMatchResourceAttr("aws_acm_certificate.cert", "arn", certificateArnRegex), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_name", wildcardDomain), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.#", "1"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.domain_name", wildcardDomain), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_name"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_type", "CNAME"), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_value"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "subject_alternative_names.#", "0"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_emails.#", "0"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_method", acm.ValidationMethodDns), + resource.TestMatchResourceAttr(resourceName, "arn", certificateArnRegex), + resource.TestCheckResourceAttr(resourceName, "domain_name", wildcardDomain), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.domain_name", wildcardDomain), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_name"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.resource_record_type", "CNAME"), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_value"), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.#", "0"), + resource.TestCheckResourceAttr(resourceName, "validation_emails.#", "0"), + resource.TestCheckResourceAttr(resourceName, "validation_method", acm.ValidationMethodDns), ), }, { - ResourceName: "aws_acm_certificate.cert", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -407,6 +414,7 @@ func TestAccAWSAcmCertificate_wildcard(t *testing.T) { } func TestAccAWSAcmCertificate_wildcardAndRootSan(t *testing.T) { + resourceName := "aws_acm_certificate.cert" rootDomain := testAccAwsAcmCertificateDomainFromEnv(t) wildcardDomain := fmt.Sprintf("*.%s", rootDomain) @@ -418,25 +426,25 @@ func TestAccAWSAcmCertificate_wildcardAndRootSan(t *testing.T) { { Config: testAccAcmCertificateConfig_subjectAlternativeNames(wildcardDomain, strconv.Quote(rootDomain), acm.ValidationMethodDns), Check: resource.ComposeTestCheckFunc( - resource.TestMatchResourceAttr("aws_acm_certificate.cert", "arn", certificateArnRegex), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_name", wildcardDomain), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.#", "2"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.domain_name", wildcardDomain), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_name"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_type", "CNAME"), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_value"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.1.domain_name", rootDomain), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.1.resource_record_name"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.1.resource_record_type", "CNAME"), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.1.resource_record_value"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "subject_alternative_names.#", "1"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "subject_alternative_names.0", rootDomain), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_emails.#", "0"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_method", acm.ValidationMethodDns), + resource.TestMatchResourceAttr(resourceName, "arn", certificateArnRegex), + resource.TestCheckResourceAttr(resourceName, "domain_name", wildcardDomain), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.#", "2"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.domain_name", wildcardDomain), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_name"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.resource_record_type", "CNAME"), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_value"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.1.domain_name", rootDomain), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.1.resource_record_name"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.1.resource_record_type", "CNAME"), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.1.resource_record_value"), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.#", "1"), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.0", rootDomain), + resource.TestCheckResourceAttr(resourceName, "validation_emails.#", "0"), + resource.TestCheckResourceAttr(resourceName, "validation_method", acm.ValidationMethodDns), ), }, { - ResourceName: "aws_acm_certificate.cert", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -445,6 +453,7 @@ func TestAccAWSAcmCertificate_wildcardAndRootSan(t *testing.T) { } func TestAccAWSAcmCertificate_disableCTLogging(t *testing.T) { + resourceName := "aws_acm_certificate.cert" rootDomain := testAccAwsAcmCertificateDomainFromEnv(t) resource.ParallelTest(t, resource.TestCase{ @@ -455,22 +464,22 @@ func TestAccAWSAcmCertificate_disableCTLogging(t *testing.T) { { Config: testAccAcmCertificateConfig_disableCTLogging(rootDomain, acm.ValidationMethodDns), Check: resource.ComposeTestCheckFunc( - resource.TestMatchResourceAttr("aws_acm_certificate.cert", "arn", certificateArnRegex), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_name", rootDomain), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.#", "1"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.domain_name", rootDomain), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_name"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_type", "CNAME"), - resource.TestCheckResourceAttrSet("aws_acm_certificate.cert", "domain_validation_options.0.resource_record_value"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "subject_alternative_names.#", "0"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_emails.#", "0"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "validation_method", acm.ValidationMethodDns), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "options.#", "1"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "options.0.certificate_transparency_logging_preference", acm.CertificateTransparencyLoggingPreferenceDisabled), + resource.TestMatchResourceAttr(resourceName, "arn", certificateArnRegex), + resource.TestCheckResourceAttr(resourceName, "domain_name", rootDomain), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.domain_name", rootDomain), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_name"), + resource.TestCheckResourceAttr(resourceName, "domain_validation_options.0.resource_record_type", "CNAME"), + resource.TestCheckResourceAttrSet(resourceName, "domain_validation_options.0.resource_record_value"), + resource.TestCheckResourceAttr(resourceName, "subject_alternative_names.#", "0"), + resource.TestCheckResourceAttr(resourceName, "validation_emails.#", "0"), + resource.TestCheckResourceAttr(resourceName, "validation_method", acm.ValidationMethodDns), + resource.TestCheckResourceAttr(resourceName, "options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "options.0.certificate_transparency_logging_preference", acm.CertificateTransparencyLoggingPreferenceDisabled), ), }, { - ResourceName: "aws_acm_certificate.cert", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -479,6 +488,7 @@ func TestAccAWSAcmCertificate_disableCTLogging(t *testing.T) { } func TestAccAWSAcmCertificate_tags(t *testing.T) { + resourceName := "aws_acm_certificate.cert" rootDomain := testAccAwsAcmCertificateDomainFromEnv(t) domain := testAccAwsAcmCertificateRandomSubDomain(rootDomain) @@ -490,34 +500,34 @@ func TestAccAWSAcmCertificate_tags(t *testing.T) { { Config: testAccAcmCertificateConfig(domain, acm.ValidationMethodDns), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { Config: testAccAcmCertificateConfig_twoTags(domain, acm.ValidationMethodDns, "Hello", "World", "Foo", "Bar"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "tags.%", "2"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "tags.Hello", "World"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "tags.Foo", "Bar"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.Hello", "World"), + resource.TestCheckResourceAttr(resourceName, "tags.Foo", "Bar"), ), }, { Config: testAccAcmCertificateConfig_twoTags(domain, acm.ValidationMethodDns, "Hello", "World", "Foo", "Baz"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "tags.%", "2"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "tags.Hello", "World"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "tags.Foo", "Baz"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.Hello", "World"), + resource.TestCheckResourceAttr(resourceName, "tags.Foo", "Baz"), ), }, { Config: testAccAcmCertificateConfig_oneTag(domain, acm.ValidationMethodDns, "Environment", "Test"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_acm_certificate.cert", "tags.Environment", "Test"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.Environment", "Test"), ), }, { - ResourceName: "aws_acm_certificate.cert", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -525,12 +535,13 @@ func TestAccAWSAcmCertificate_tags(t *testing.T) { }) } +//lintignore:AT002 func TestAccAWSAcmCertificate_imported_DomainName(t *testing.T) { resourceName := "aws_acm_certificate.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ { @@ -558,13 +569,13 @@ func TestAccAWSAcmCertificate_imported_DomainName(t *testing.T) { }) } -// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/7103 -func TestAccAWSAcmCertificate_imported_IpAddress(t *testing.T) { +//lintignore:AT002 +func TestAccAWSAcmCertificate_imported_IpAddress(t *testing.T) { // Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/7103 resourceName := "aws_acm_certificate.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckAcmCertificateDestroy, Steps: []resource.TestStep{ { diff --git a/aws/resource_aws_acmpca_certificate_authority.go b/aws/resource_aws_acmpca_certificate_authority.go index c140b2c0193..29e02768d91 100644 --- a/aws/resource_aws_acmpca_certificate_authority.go +++ b/aws/resource_aws_acmpca_certificate_authority.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsAcmpcaCertificateAuthority() *schema.Resource { @@ -268,6 +269,7 @@ func resourceAwsAcmpcaCertificateAuthority() *schema.Resource { func resourceAwsAcmpcaCertificateAuthorityCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).acmpcaconn + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().AcmpcaTags() input := &acmpca.CreateCertificateAuthorityInput{ CertificateAuthorityConfiguration: expandAcmpcaCertificateAuthorityConfiguration(d.Get("certificate_authority_configuration").([]interface{})), @@ -276,6 +278,10 @@ func resourceAwsAcmpcaCertificateAuthorityCreate(d *schema.ResourceData, meta in RevocationConfiguration: expandAcmpcaRevocationConfiguration(d.Get("revocation_configuration").([]interface{})), } + if len(tags) > 0 { + input.Tags = tags + } + log.Printf("[DEBUG] Creating ACMPCA Certificate Authority: %s", input) var output *acmpca.CreateCertificateAuthorityOutput err := resource.Retry(1*time.Minute, func() *resource.RetryError { @@ -299,19 +305,6 @@ func resourceAwsAcmpcaCertificateAuthorityCreate(d *schema.ResourceData, meta in d.SetId(aws.StringValue(output.CertificateAuthorityArn)) - if v, ok := d.GetOk("tags"); ok { - input := &acmpca.TagCertificateAuthorityInput{ - CertificateAuthorityArn: aws.String(d.Id()), - Tags: tagsFromMapACMPCA(v.(map[string]interface{})), - } - - log.Printf("[DEBUG] Tagging ACMPCA Certificate Authority: %s", input) - _, err := conn.TagCertificateAuthority(input) - if err != nil { - return fmt.Errorf("error tagging ACMPCA Certificate Authority %q: %s", d.Id(), input) - } - } - stateConf := &resource.StateChangeConf{ Pending: []string{ "", @@ -366,8 +359,8 @@ func resourceAwsAcmpcaCertificateAuthorityRead(d *schema.ResourceData, meta inte } d.Set("enabled", (aws.StringValue(certificateAuthority.Status) != acmpca.CertificateAuthorityStatusDisabled)) - d.Set("not_after", certificateAuthority.NotAfter) - d.Set("not_before", certificateAuthority.NotBefore) + d.Set("not_after", aws.TimeValue(certificateAuthority.NotAfter).Format(time.RFC3339)) + d.Set("not_before", aws.TimeValue(certificateAuthority.NotBefore).Format(time.RFC3339)) if err := d.Set("revocation_configuration", flattenAcmpcaRevocationConfiguration(certificateAuthority.RevocationConfiguration)); err != nil { return fmt.Errorf("error setting tags: %s", err) @@ -427,12 +420,13 @@ func resourceAwsAcmpcaCertificateAuthorityRead(d *schema.ResourceData, meta inte d.Set("certificate_signing_request", getCertificateAuthorityCsrOutput.Csr) } - tags, err := listAcmpcaTags(conn, d.Id()) + tags, err := keyvaluetags.AcmpcaListTags(conn, d.Id()) + if err != nil { - return fmt.Errorf("error reading ACMPCA Certificate Authority %q tags: %s", d.Id(), err) + return fmt.Errorf("error listing tags for ACMPCA Certificate Authority (%s): %s", d.Id(), err) } - if err := d.Set("tags", tagsToMapACMPCA(tags)); err != nil { + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -469,30 +463,10 @@ func resourceAwsAcmpcaCertificateAuthorityUpdate(d *schema.ResourceData, meta in } if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsACMPCA(tagsFromMapACMPCA(o), tagsFromMapACMPCA(n)) - - if len(remove) > 0 { - log.Printf("[DEBUG] Removing ACMPCA Certificate Authority %q tags: %#v", d.Id(), remove) - _, err := conn.UntagCertificateAuthority(&acmpca.UntagCertificateAuthorityInput{ - CertificateAuthorityArn: aws.String(d.Id()), - Tags: remove, - }) - if err != nil { - return fmt.Errorf("error updating ACMPCA Certificate Authority %q tags: %s", d.Id(), err) - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating ACMPCA Certificate Authority %q tags: %#v", d.Id(), create) - _, err := conn.TagCertificateAuthority(&acmpca.TagCertificateAuthorityInput{ - CertificateAuthorityArn: aws.String(d.Id()), - Tags: create, - }) - if err != nil { - return fmt.Errorf("error updating ACMPCA Certificate Authority %q tags: %s", d.Id(), err) - } + o, n := d.GetChange("tags") + + if err := keyvaluetags.AcmpcaUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating ACMPCA Certificate Authority (%s) tags: %s", d.Id(), err) } } @@ -714,24 +688,3 @@ func flattenAcmpcaRevocationConfiguration(config *acmpca.RevocationConfiguration return []interface{}{m} } - -func listAcmpcaTags(conn *acmpca.ACMPCA, certificateAuthorityArn string) ([]*acmpca.Tag, error) { - tags := []*acmpca.Tag{} - input := &acmpca.ListTagsInput{ - CertificateAuthorityArn: aws.String(certificateAuthorityArn), - } - - for { - output, err := conn.ListTags(input) - if err != nil { - return tags, err - } - tags = append(tags, output.Tags...) - if output.NextToken == nil { - break - } - input.NextToken = output.NextToken - } - - return tags, nil -} diff --git a/aws/resource_aws_acmpca_certificate_authority_test.go b/aws/resource_aws_acmpca_certificate_authority_test.go index 4aa153c14d3..91659c37ed5 100644 --- a/aws/resource_aws_acmpca_certificate_authority_test.go +++ b/aws/resource_aws_acmpca_certificate_authority_test.go @@ -73,7 +73,7 @@ func TestAccAwsAcmpcaCertificateAuthority_Basic(t *testing.T) { Config: testAccAwsAcmpcaCertificateAuthorityConfig_Required, Check: resource.ComposeTestCheckFunc( testAccCheckAwsAcmpcaCertificateAuthorityExists(resourceName, &certificateAuthority), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(`^arn:[^:]+:acm-pca:[^:]+:[^:]+:certificate-authority/.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "acm-pca", regexp.MustCompile(`certificate-authority/.+`)), resource.TestCheckResourceAttr(resourceName, "certificate_authority_configuration.#", "1"), resource.TestCheckResourceAttr(resourceName, "certificate_authority_configuration.0.key_algorithm", "RSA_4096"), resource.TestCheckResourceAttr(resourceName, "certificate_authority_configuration.0.signing_algorithm", "SHA512WITHRSA"), @@ -83,8 +83,8 @@ func TestAccAwsAcmpcaCertificateAuthority_Basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "certificate_chain", ""), resource.TestCheckResourceAttrSet(resourceName, "certificate_signing_request"), resource.TestCheckResourceAttr(resourceName, "enabled", "true"), - resource.TestCheckResourceAttr(resourceName, "not_after", ""), - resource.TestCheckResourceAttr(resourceName, "not_before", ""), + testAccCheckResourceAttrRfc3339(resourceName, "not_after"), + testAccCheckResourceAttrRfc3339(resourceName, "not_before"), resource.TestCheckResourceAttr(resourceName, "permanent_deletion_time_in_days", "30"), resource.TestCheckResourceAttr(resourceName, "revocation_configuration.#", "1"), resource.TestCheckResourceAttr(resourceName, "revocation_configuration.0.crl_configuration.#", "1"), diff --git a/aws/resource_aws_alb_target_group_test.go b/aws/resource_aws_alb_target_group_test.go index 6048737d0de..f832679d93d 100644 --- a/aws/resource_aws_alb_target_group_test.go +++ b/aws/resource_aws_alb_target_group_test.go @@ -443,6 +443,47 @@ func TestAccAWSALBTargetGroup_setAndUpdateSlowStart(t *testing.T) { }) } +func TestAccAWSALBTargetGroup_updateLoadBalancingAlgorithmType(t *testing.T) { + var conf elbv2.TargetGroup + targetGroupName := fmt.Sprintf("test-target-group-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: "aws_alb_target_group.test", + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSALBTargetGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSALBTargetGroupConfig_loadBalancingAlgorithm(targetGroupName, false, ""), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSALBTargetGroupExists("aws_alb_target_group.test", &conf), + resource.TestCheckResourceAttrSet("aws_alb_target_group.test", "arn"), + resource.TestCheckResourceAttr("aws_alb_target_group.test", "name", targetGroupName), + resource.TestCheckResourceAttr("aws_alb_target_group.test", "load_balancing_algorithm_type", "round_robin"), + ), + }, + { + Config: testAccAWSALBTargetGroupConfig_loadBalancingAlgorithm(targetGroupName, true, "round_robin"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSALBTargetGroupExists("aws_alb_target_group.test", &conf), + resource.TestCheckResourceAttrSet("aws_alb_target_group.test", "arn"), + resource.TestCheckResourceAttr("aws_alb_target_group.test", "name", targetGroupName), + resource.TestCheckResourceAttr("aws_alb_target_group.test", "load_balancing_algorithm_type", "round_robin"), + ), + }, + { + Config: testAccAWSALBTargetGroupConfig_loadBalancingAlgorithm(targetGroupName, true, "least_outstanding_requests"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSALBTargetGroupExists("aws_alb_target_group.test", &conf), + resource.TestCheckResourceAttrSet("aws_alb_target_group.test", "arn"), + resource.TestCheckResourceAttr("aws_alb_target_group.test", "name", targetGroupName), + resource.TestCheckResourceAttr("aws_alb_target_group.test", "load_balancing_algorithm_type", "least_outstanding_requests"), + ), + }, + }, + }) +} + func testAccCheckAWSALBTargetGroupExists(n string, res *elbv2.TargetGroup) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -530,6 +571,7 @@ func TestAccAWSALBTargetGroup_lambda(t *testing.T) { "deregistration_delay", "proxy_protocol_v2", "slow_start", + "load_balancing_algorithm_type", }, }, }, @@ -562,6 +604,7 @@ func TestAccAWSALBTargetGroup_lambdaMultiValueHeadersEnabled(t *testing.T) { "deregistration_delay", "proxy_protocol_v2", "slow_start", + "load_balancing_algorithm_type", }, }, { @@ -889,6 +932,32 @@ resource "aws_vpc" "test" { }`, targetGroupName, stickinessBlock) } +func testAccAWSALBTargetGroupConfig_loadBalancingAlgorithm(targetGroupName string, nonDefault bool, algoType string) string { + var algoTypeParam string + + if nonDefault { + algoTypeParam = fmt.Sprintf(`load_balancing_algorithm_type = "%s"`, algoType) + } + + return fmt.Sprintf(`resource "aws_alb_target_group" "test" { + name = "%s" + port = 443 + protocol = "HTTPS" + vpc_id = "${aws_vpc.test.id}" + + %s + +} + +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + + tags = { + Name = "terraform-testacc-alb-target-group-load-balancing-algo" + } +}`, targetGroupName, algoTypeParam) +} + func testAccAWSALBTargetGroupConfig_updateSlowStart(targetGroupName string, slowStartDuration int) string { return fmt.Sprintf(`resource "aws_alb_target_group" "test" { name = "%s" @@ -950,7 +1019,7 @@ resource "aws_alb_target_group" "test" { port = 80 protocol = "HTTP" vpc_id = "${aws_vpc.test.id}" - + health_check { path = "/health" interval = 60 diff --git a/aws/resource_aws_ami.go b/aws/resource_aws_ami.go index 037be30a5e1..2709df80495 100644 --- a/aws/resource_aws_ami.go +++ b/aws/resource_aws_ami.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) const ( @@ -278,12 +279,18 @@ func resourceAwsAmiCreate(d *schema.ResourceData, meta interface{}) error { id := *res.ImageId d.SetId(id) + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + if err := keyvaluetags.Ec2UpdateTags(client, id, nil, v); err != nil { + return fmt.Errorf("error adding tags: %s", err) + } + } + _, err = resourceAwsAmiWaitForAvailable(d.Timeout(schema.TimeoutCreate), id, client) if err != nil { return err } - return resourceAwsAmiUpdate(d, meta) + return resourceAwsAmiRead(d, meta) } func resourceAwsAmiRead(d *schema.ResourceData, meta interface{}) error { @@ -404,10 +411,12 @@ func resourceAwsAmiUpdate(d *schema.ResourceData, meta interface{}) error { d.Partial(true) - if err := setTags(client, d); err != nil { - return err - } else { - d.SetPartial("tags") + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(client, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating AMI (%s) tags: %s", d.Id(), err) + } } if d.Get("description").(string) != "" { diff --git a/aws/resource_aws_ami_copy.go b/aws/resource_aws_ami_copy.go index 5e0f4c2ec44..238bbfe1d91 100644 --- a/aws/resource_aws_ami_copy.go +++ b/aws/resource_aws_ami_copy.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsAmiCopy() *schema.Resource { @@ -219,10 +220,16 @@ func resourceAwsAmiCopyCreate(d *schema.ResourceData, meta interface{}) error { d.SetPartial("manage_ebs_snapshots") d.Partial(false) + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + if err := keyvaluetags.Ec2UpdateTags(client, id, nil, v); err != nil { + return fmt.Errorf("error adding tags: %s", err) + } + } + _, err = resourceAwsAmiWaitForAvailable(d.Timeout(schema.TimeoutCreate), id, client) if err != nil { return err } - return resourceAwsAmiUpdate(d, meta) + return resourceAwsAmiRead(d, meta) } diff --git a/aws/resource_aws_ami_copy_test.go b/aws/resource_aws_ami_copy_test.go index 12d5ace48ee..e15a31f9449 100644 --- a/aws/resource_aws_ami_copy_test.go +++ b/aws/resource_aws_ami_copy_test.go @@ -81,6 +81,48 @@ func TestAccAWSAMICopy_EnaSupport(t *testing.T) { }) } +func TestAccAWSAMICopy_tags(t *testing.T) { + var ami ec2.Image + resourceName := "aws_ami_copy.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAMICopyDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAMICopyConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAMICopyExists(resourceName, &ami), + testAccCheckAWSAMICopyAttributes(&ami, rName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + Config: testAccAWSAMICopyConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAMICopyExists(resourceName, &ami), + testAccCheckAWSAMICopyAttributes(&ami, rName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSAMICopyConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAMICopyExists(resourceName, &ami), + testAccCheckAWSAMICopyAttributes(&ami, rName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func testAccCheckAWSAMICopyExists(resourceName string, image *ec2.Image) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[resourceName] @@ -191,6 +233,57 @@ resource "aws_ebs_snapshot" "test" { `) } +func testAccAWSAMICopyConfigTags1(rName, tagKey1, tagValue1 string) string { + return testAccAWSAMICopyConfigBase() + fmt.Sprintf(` +resource "aws_ami" "test" { + name = %[1]q + virtualization_type = "hvm" + root_device_name = "/dev/sda1" + + ebs_block_device { + device_name = "/dev/sda1" + snapshot_id = "${aws_ebs_snapshot.test.id}" + } +} + +resource "aws_ami_copy" "test" { + name = %[1]q + source_ami_id = "${aws_ami.test.id}" + source_ami_region = "${data.aws_region.current.name}" + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccAWSAMICopyConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccAWSAMICopyConfigBase() + fmt.Sprintf(` +resource "aws_ami" "test" { + name = %[1]q + virtualization_type = "hvm" + root_device_name = "/dev/sda1" + + ebs_block_device { + device_name = "/dev/sda1" + snapshot_id = "${aws_ebs_snapshot.test.id}" + } +} + +resource "aws_ami_copy" "test" { + name = %[1]q + source_ami_id = "${aws_ami.test.id}" + source_ami_region = "${data.aws_region.current.name}" + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + func testAccAWSAMICopyConfig(rName string) string { return testAccAWSAMICopyConfigBase() + fmt.Sprintf(` resource "aws_ami" "test" { diff --git a/aws/resource_aws_ami_from_instance.go b/aws/resource_aws_ami_from_instance.go index e1f814558d9..fd9d4013426 100644 --- a/aws/resource_aws_ami_from_instance.go +++ b/aws/resource_aws_ami_from_instance.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsAmiFromInstance() *schema.Resource { @@ -201,10 +202,16 @@ func resourceAwsAmiFromInstanceCreate(d *schema.ResourceData, meta interface{}) d.SetPartial("manage_ebs_snapshots") d.Partial(false) + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + if err := keyvaluetags.Ec2UpdateTags(client, id, nil, v); err != nil { + return fmt.Errorf("error adding tags: %s", err) + } + } + _, err = resourceAwsAmiWaitForAvailable(d.Timeout(schema.TimeoutCreate), id, client) if err != nil { return err } - return resourceAwsAmiUpdate(d, meta) + return resourceAwsAmiRead(d, meta) } diff --git a/aws/resource_aws_ami_from_instance_test.go b/aws/resource_aws_ami_from_instance_test.go index 15cf250916c..81354d794c3 100644 --- a/aws/resource_aws_ami_from_instance_test.go +++ b/aws/resource_aws_ami_from_instance_test.go @@ -1,145 +1,133 @@ package aws import ( - "errors" "fmt" - "strings" "testing" "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-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSAMIFromInstance(t *testing.T) { - var amiId string - snapshots := []string{} - rInt := acctest.RandInt() +func TestAccAWSAMIFromInstance_basic(t *testing.T) { + var image ec2.Image + rName := acctest.RandomWithPrefix("tf-acc") + resourceName := "aws_ami_from_instance.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAMIFromInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAMIFromInstanceConfig(rInt), - Check: func(state *terraform.State) error { - rs, ok := state.RootModule().Resources["aws_ami_from_instance.test"] - if !ok { - return fmt.Errorf("AMI resource not found") - } - - amiId = rs.Primary.ID - - if amiId == "" { - return fmt.Errorf("AMI id is not set") - } - - conn := testAccProvider.Meta().(*AWSClient).ec2conn - req := &ec2.DescribeImagesInput{ - ImageIds: []*string{aws.String(amiId)}, - } - describe, err := conn.DescribeImages(req) - if err != nil { - return err - } - - if len(describe.Images) != 1 || - *describe.Images[0].ImageId != rs.Primary.ID { - return fmt.Errorf("AMI not found") - } - - image := describe.Images[0] - if expected := "available"; *image.State != expected { - return fmt.Errorf("invalid image state; expected %v, got %v", expected, *image.State) - } - if expected := "machine"; *image.ImageType != expected { - return fmt.Errorf("wrong image type; expected %v, got %v", expected, *image.ImageType) - } - if expected := fmt.Sprintf("terraform-acc-ami-from-instance-%d", rInt); *image.Name != expected { - return fmt.Errorf("wrong name; expected %v, got %v", expected, *image.Name) - } - - for _, bdm := range image.BlockDeviceMappings { - if bdm.Ebs != nil && bdm.Ebs.SnapshotId != nil { - snapshots = append(snapshots, *bdm.Ebs.SnapshotId) - } - } - - if expected := 1; len(snapshots) != expected { - return fmt.Errorf("wrong number of snapshots; expected %v, got %v", expected, len(snapshots)) - } - - return nil - }, + Config: testAccAWSAMIFromInstanceConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAMIFromInstanceExists(resourceName, &image), + resource.TestCheckResourceAttr(resourceName, "description", "Testing Terraform aws_ami_from_instance resource"), + ), }, }, - CheckDestroy: func(state *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).ec2conn - diReq := &ec2.DescribeImagesInput{ - ImageIds: []*string{aws.String(amiId)}, - } - diRes, err := conn.DescribeImages(diReq) - if err != nil { - return err - } - - if len(diRes.Images) > 0 { - state := diRes.Images[0].State - return fmt.Errorf("AMI %v remains in state %v", amiId, state) - } - - stillExist := make([]string, 0, len(snapshots)) - checkErrors := make(map[string]error) - for _, snapshotId := range snapshots { - dsReq := &ec2.DescribeSnapshotsInput{ - SnapshotIds: []*string{aws.String(snapshotId)}, - } - _, err := conn.DescribeSnapshots(dsReq) - if err == nil { - stillExist = append(stillExist, snapshotId) - continue - } - - awsErr, ok := err.(awserr.Error) - if !ok { - checkErrors[snapshotId] = err - continue - } - - if awsErr.Code() != "InvalidSnapshot.NotFound" { - checkErrors[snapshotId] = err - continue - } - } - - if len(stillExist) > 0 || len(checkErrors) > 0 { - errParts := []string{ - "Expected all snapshots to be gone, but:", - } - for _, snapshotId := range stillExist { - errParts = append( - errParts, - fmt.Sprintf("- %v still exists", snapshotId), - ) - } - for snapshotId, err := range checkErrors { - errParts = append( - errParts, - fmt.Sprintf("- checking %v gave error: %v", snapshotId, err), - ) - } - return errors.New(strings.Join(errParts, "\n")) - } - - return nil + }) +} + +func TestAccAWSAMIFromInstance_tags(t *testing.T) { + var image ec2.Image + rName := acctest.RandomWithPrefix("tf-acc") + resourceName := "aws_ami_from_instance.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAMIFromInstanceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAMIFromInstanceConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAMIFromInstanceExists(resourceName, &image), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + Config: testAccAWSAMIFromInstanceConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAMIFromInstanceExists(resourceName, &image), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSAMIFromInstanceConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAMIFromInstanceExists(resourceName, &image), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, }, }) } -func testAccAWSAMIFromInstanceConfig(rInt int) string { +func testAccCheckAWSAMIFromInstanceExists(resourceName string, image *ec2.Image) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No ID set for %s", resourceName) + } + + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + input := &ec2.DescribeImagesInput{ + ImageIds: []*string{aws.String(rs.Primary.ID)}, + } + output, err := conn.DescribeImages(input) + if err != nil { + return err + } + + if len(output.Images) == 0 || aws.StringValue(output.Images[0].ImageId) != rs.Primary.ID { + return fmt.Errorf("AMI %q not found", rs.Primary.ID) + } + + *image = *output.Images[0] + + return nil + } +} + +func testAccCheckAWSAMIFromInstanceDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_ami_from_instance" { + continue + } + + input := &ec2.DescribeImagesInput{ + ImageIds: []*string{aws.String(rs.Primary.ID)}, + } + output, err := conn.DescribeImages(input) + if err != nil { + return err + } + + if output != nil && len(output.Images) > 0 && aws.StringValue(output.Images[0].ImageId) == rs.Primary.ID { + return fmt.Errorf("AMI %q still exists in state: %s", rs.Primary.ID, aws.StringValue(output.Images[0].State)) + } + } + + // Check for managed EBS snapshots + return testAccCheckAWSEbsSnapshotDestroy(s) +} + +func testAccAWSAMIFromInstanceConfigBase() string { return fmt.Sprintf(` provider "aws" { region = "us-east-1" @@ -156,11 +144,44 @@ resource "aws_instance" "test" { Name = "testAccAWSAMIFromInstanceConfig_TestAMI" } } +`) +} + +func testAccAWSAMIFromInstanceConfig(rName string) string { + return testAccAWSAMIFromInstanceConfigBase() + fmt.Sprintf(` +resource "aws_ami_from_instance" "test" { + name = %[1]q + description = "Testing Terraform aws_ami_from_instance resource" + source_instance_id = "${aws_instance.test.id}" +} +`, rName) +} + +func testAccAWSAMIFromInstanceConfigTags1(rName, tagKey1, tagValue1 string) string { + return testAccAWSAMIFromInstanceConfigBase() + fmt.Sprintf(` +resource "aws_ami_from_instance" "test" { + name = %[1]q + description = "Testing Terraform aws_ami_from_instance resource" + source_instance_id = "${aws_instance.test.id}" + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} +func testAccAWSAMIFromInstanceConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccAWSAMIFromInstanceConfigBase() + fmt.Sprintf(` resource "aws_ami_from_instance" "test" { - name = "terraform-acc-ami-from-instance-%d" + name = %[1]q description = "Testing Terraform aws_ami_from_instance resource" source_instance_id = "${aws_instance.test.id}" + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } } -`, rInt) +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) } diff --git a/aws/resource_aws_ami_launch_permission.go b/aws/resource_aws_ami_launch_permission.go index 2cb88f49dde..aa5fa564e10 100644 --- a/aws/resource_aws_ami_launch_permission.go +++ b/aws/resource_aws_ami_launch_permission.go @@ -17,6 +17,20 @@ func resourceAwsAmiLaunchPermission() *schema.Resource { Create: resourceAwsAmiLaunchPermissionCreate, Read: resourceAwsAmiLaunchPermissionRead, Delete: resourceAwsAmiLaunchPermissionDelete, + Importer: &schema.ResourceImporter{ + State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + idParts := strings.Split(d.Id(), "/") + if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { + return nil, fmt.Errorf("Unexpected format of ID (%q), expected ACCOUNT-ID/IMAGE-ID", d.Id()) + } + accountId := idParts[0] + imageId := idParts[1] + d.Set("account_id", accountId) + d.Set("image_id", imageId) + d.SetId(fmt.Sprintf("%s-%s", imageId, accountId)) + return []*schema.ResourceData{d}, nil + }, + }, Schema: map[string]*schema.Schema{ "image_id": { @@ -49,7 +63,7 @@ func resourceAwsAmiLaunchPermissionCreate(d *schema.ResourceData, meta interface _, err := conn.ModifyImageAttribute(&ec2.ModifyImageAttributeInput{ ImageId: aws.String(image_id), - Attribute: aws.String("launchPermission"), + Attribute: aws.String(ec2.ImageAttributeNameLaunchPermission), LaunchPermission: &ec2.LaunchPermissionModifications{ Add: []*ec2.LaunchPermission{ {UserId: aws.String(account_id)}, @@ -76,7 +90,7 @@ func resourceAwsAmiLaunchPermissionDelete(d *schema.ResourceData, meta interface _, err := conn.ModifyImageAttribute(&ec2.ModifyImageAttributeInput{ ImageId: aws.String(image_id), - Attribute: aws.String("launchPermission"), + Attribute: aws.String(ec2.ImageAttributeNameLaunchPermission), LaunchPermission: &ec2.LaunchPermissionModifications{ Remove: []*ec2.LaunchPermission{ {UserId: aws.String(account_id)}, @@ -93,7 +107,7 @@ func resourceAwsAmiLaunchPermissionDelete(d *schema.ResourceData, meta interface 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"), + Attribute: aws.String(ec2.ImageAttributeNameLaunchPermission), }) if err != nil { // When an AMI disappears out from under a launch permission resource, we will diff --git a/aws/resource_aws_ami_launch_permission_test.go b/aws/resource_aws_ami_launch_permission_test.go index 2530472260a..4f5da34024d 100644 --- a/aws/resource_aws_ami_launch_permission_test.go +++ b/aws/resource_aws_ami_launch_permission_test.go @@ -26,6 +26,12 @@ func TestAccAWSAMILaunchPermission_Basic(t *testing.T) { testAccCheckAWSAMILaunchPermissionExists(resourceName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSAMILaunchPermissionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, }, }) } @@ -183,10 +189,10 @@ func testAccCheckAWSAMILaunchPermissionAddPublic(resourceName string) resource.T input := &ec2.ModifyImageAttributeInput{ ImageId: aws.String(imageID), - Attribute: aws.String("launchPermission"), + Attribute: aws.String(ec2.ImageAttributeNameLaunchPermission), LaunchPermission: &ec2.LaunchPermissionModifications{ Add: []*ec2.LaunchPermission{ - {Group: aws.String("all")}, + {Group: aws.String(ec2.PermissionGroupAll)}, }, }, } @@ -214,7 +220,7 @@ func testAccCheckAWSAMILaunchPermissionDisappears(resourceName string) resource. input := &ec2.ModifyImageAttributeInput{ ImageId: aws.String(imageID), - Attribute: aws.String("launchPermission"), + Attribute: aws.String(ec2.ImageAttributeNameLaunchPermission), LaunchPermission: &ec2.LaunchPermissionModifications{ Remove: []*ec2.LaunchPermission{ {UserId: aws.String(accountID)}, @@ -284,3 +290,14 @@ resource "aws_ami_launch_permission" "test" { } `, rName, rName) } + +func testAccAWSAMILaunchPermissionImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return "", fmt.Errorf("Not found: %s", resourceName) + } + + return fmt.Sprintf("%s/%s", rs.Primary.Attributes["account_id"], rs.Primary.Attributes["image_id"]), nil + } +} diff --git a/aws/resource_aws_ami_test.go b/aws/resource_aws_ami_test.go index 098a55e5802..3427dd4db3f 100644 --- a/aws/resource_aws_ami_test.go +++ b/aws/resource_aws_ami_test.go @@ -26,7 +26,7 @@ func TestAccAWSAMI_basic(t *testing.T) { CheckDestroy: testAccCheckAmiDestroy, Steps: []resource.TestStep{ { - Config: testAccAmiConfig_basic(rName), + Config: testAccAmiConfig_basic(rName, 8), Check: resource.ComposeTestCheckFunc( testAccCheckAmiExists(resourceName, &ami), resource.TestCheckResourceAttr(resourceName, "ena_support", "true"), @@ -46,6 +46,75 @@ func TestAccAWSAMI_basic(t *testing.T) { }) } +func TestAccAWSAMI_disappears(t *testing.T) { + var ami ec2.Image + resourceName := "aws_ami.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAmiDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAmiConfig_basic(rName, 8), + Check: resource.ComposeTestCheckFunc( + testAccCheckAmiExists(resourceName, &ami), + testAccCheckAmiDisappears(&ami), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAWSAMI_tags(t *testing.T) { + var ami ec2.Image + resourceName := "aws_ami.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAmiDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAmiConfigTags1(rName, "key1", "value1", 8), + Check: resource.ComposeTestCheckFunc( + testAccCheckAmiExists(resourceName, &ami), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "manage_ebs_snapshots", + }, + }, + { + Config: testAccAmiConfigTags2(rName, "key1", "value1updated", "key2", "value2", 8), + Check: resource.ComposeTestCheckFunc( + testAccCheckAmiExists(resourceName, &ami), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAmiConfigTags1(rName, "key2", "value2", 8), + Check: resource.ComposeTestCheckFunc( + testAccCheckAmiExists(resourceName, &ami), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSAMI_snapshotSize(t *testing.T) { var ami ec2.Image var bd ec2.BlockDeviceMapping @@ -66,7 +135,7 @@ func TestAccAWSAMI_snapshotSize(t *testing.T) { CheckDestroy: testAccCheckAmiDestroy, Steps: []resource.TestStep{ { - Config: testAccAmiConfig_snapshotSize(rName), + Config: testAccAmiConfig_basic(rName, 20), Check: resource.ComposeTestCheckFunc( testAccCheckAmiExists(resourceName, &ami), testAccCheckAmiBlockDevice(&ami, &bd, "/dev/sda1"), @@ -117,6 +186,20 @@ func testAccCheckAmiDestroy(s *terraform.State) error { return nil } +func testAccCheckAmiDisappears(image *ec2.Image) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + input := &ec2.DeregisterImageInput{ + ImageId: image.ImageId, + } + + _, err := conn.DeregisterImage(input) + + return err + } +} + func testAccCheckAmiExists(n string, ami *ec2.Image) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -218,16 +301,16 @@ func testAccCheckAmiEbsBlockDevice(bd *ec2.BlockDeviceMapping, ed *ec2.EbsBlockD } } -func testAccAmiConfig_basic(rName string) string { +func testAccAmiConfig_base(rName string, size int) string { return fmt.Sprintf(` data "aws_availability_zones" "available" {} resource "aws_ebs_volume" "foo" { availability_zone = "${data.aws_availability_zones.available.names[0]}" - size = 8 + size = %d tags = { - Name = "testAccAmiConfig_basic" + Name = "%[2]s" } } @@ -235,13 +318,18 @@ resource "aws_ebs_snapshot" "foo" { volume_id = "${aws_ebs_volume.foo.id}" tags = { - Name = "testAccAmiConfig_basic" + Name = "%[2]s" } } +`, size, rName) +} + +func testAccAmiConfig_basic(rName string, size int) string { + return testAccAmiConfig_base(rName, size) + fmt.Sprintf(` resource "aws_ami" "test" { ena_support = true - name = %q + name = %[1]q root_device_name = "/dev/sda1" virtualization_type = "hvm" @@ -253,29 +341,31 @@ resource "aws_ami" "test" { `, rName) } -func testAccAmiConfig_snapshotSize(rName string) string { - return fmt.Sprintf(` -data "aws_availability_zones" "available" {} - -resource "aws_ebs_volume" "foo" { - availability_zone = "${data.aws_availability_zones.available.names[0]}" - size = 20 +func testAccAmiConfigTags1(rName, tagKey1, tagValue1 string, size int) string { + return testAccAmiConfig_base(rName, size) + fmt.Sprintf(` +resource "aws_ami" "test" { + ena_support = true + name = %[1]q + root_device_name = "/dev/sda1" + virtualization_type = "hvm" - tags = { - Name = "testAccAmiConfig_snapshotSize" + ebs_block_device { + device_name = "/dev/sda1" + snapshot_id = "${aws_ebs_snapshot.foo.id}" } -} - -resource "aws_ebs_snapshot" "foo" { - volume_id = "${aws_ebs_volume.foo.id}" tags = { - Name = "TestAccAWSAMI_snapshotSize" + %[2]q = %[3]q } } +`, rName, tagKey1, tagValue1) +} +func testAccAmiConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string, size int) string { + return testAccAmiConfig_base(rName, size) + fmt.Sprintf(` resource "aws_ami" "test" { - name = %q + ena_support = true + name = %[1]q root_device_name = "/dev/sda1" virtualization_type = "hvm" @@ -283,6 +373,11 @@ resource "aws_ami" "test" { device_name = "/dev/sda1" snapshot_id = "${aws_ebs_snapshot.foo.id}" } + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } } -`, rName) +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) } diff --git a/aws/resource_aws_api_gateway_account.go b/aws/resource_aws_api_gateway_account.go index df302741d3f..a7587d710c8 100644 --- a/aws/resource_aws_api_gateway_account.go +++ b/aws/resource_aws_api_gateway_account.go @@ -93,7 +93,7 @@ func resourceAwsApiGatewayAccountUpdate(d *schema.ResourceData, meta interface{} 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" + expectedErrMsg := "The role ARN does not have required permissions" otherErrMsg := "API Gateway could not successfully write to CloudWatch Logs using the ARN specified" var out *apigateway.Account var err error diff --git a/aws/resource_aws_api_gateway_account_test.go b/aws/resource_aws_api_gateway_account_test.go index 8fd6d1edbae..6f10529d25b 100644 --- a/aws/resource_aws_api_gateway_account_test.go +++ b/aws/resource_aws_api_gateway_account_test.go @@ -11,34 +11,13 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSAPIGatewayAccount_importBasic(t *testing.T) { - resourceName := "aws_api_gateway_account.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSAPIGatewayAccountDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSAPIGatewayAccountConfig_empty, - }, - - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func TestAccAWSAPIGatewayAccount_basic(t *testing.T) { var conf apigateway.Account rInt := acctest.RandInt() firstName := fmt.Sprintf("tf_acc_api_gateway_cloudwatch_%d", rInt) secondName := fmt.Sprintf("tf_acc_api_gateway_cloudwatch_modified_%d", rInt) - + resourceName := "aws_api_gateway_account.test" expectedRoleArn_first := regexp.MustCompile(":role/" + firstName + "$") expectedRoleArn_second := regexp.MustCompile(":role/" + secondName + "$") @@ -50,23 +29,29 @@ func TestAccAWSAPIGatewayAccount_basic(t *testing.T) { { Config: testAccAWSAPIGatewayAccountConfig_updated(firstName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayAccountExists("aws_api_gateway_account.test", &conf), + testAccCheckAWSAPIGatewayAccountExists(resourceName, &conf), testAccCheckAWSAPIGatewayAccountCloudwatchRoleArn(&conf, expectedRoleArn_first), - resource.TestMatchResourceAttr("aws_api_gateway_account.test", "cloudwatch_role_arn", expectedRoleArn_first), + resource.TestMatchResourceAttr(resourceName, "cloudwatch_role_arn", expectedRoleArn_first), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"cloudwatch_role_arn"}, + }, { Config: testAccAWSAPIGatewayAccountConfig_updated2(secondName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayAccountExists("aws_api_gateway_account.test", &conf), + testAccCheckAWSAPIGatewayAccountExists(resourceName, &conf), testAccCheckAWSAPIGatewayAccountCloudwatchRoleArn(&conf, expectedRoleArn_second), - resource.TestMatchResourceAttr("aws_api_gateway_account.test", "cloudwatch_role_arn", expectedRoleArn_second), + resource.TestMatchResourceAttr(resourceName, "cloudwatch_role_arn", expectedRoleArn_second), ), }, { Config: testAccAWSAPIGatewayAccountConfig_empty, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayAccountExists("aws_api_gateway_account.test", &conf), + testAccCheckAWSAPIGatewayAccountExists(resourceName, &conf), testAccCheckAWSAPIGatewayAccountCloudwatchRoleArn(&conf, expectedRoleArn_second), ), }, diff --git a/aws/resource_aws_api_gateway_api_key.go b/aws/resource_aws_api_gateway_api_key.go index 8655efe4e69..574576b867f 100644 --- a/aws/resource_aws_api_gateway_api_key.go +++ b/aws/resource_aws_api_gateway_api_key.go @@ -6,9 +6,11 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsApiGatewayApiKey() *schema.Resource { @@ -77,6 +79,11 @@ func resourceAwsApiGatewayApiKey() *schema.Resource { Sensitive: true, ValidateFunc: validation.StringLenBetween(30, 128), }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tagsSchema(), }, } } @@ -90,9 +97,10 @@ func resourceAwsApiGatewayApiKeyCreate(d *schema.ResourceData, meta interface{}) Description: aws.String(d.Get("description").(string)), Enabled: aws.Bool(d.Get("enabled").(bool)), Value: aws.String(d.Get("value").(string)), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().ApigatewayTags(), }) if err != nil { - return fmt.Errorf("Error creating API Gateway: %s", err) + return fmt.Errorf("Error creating API Gateway API Key: %s", err) } d.SetId(aws.StringValue(apiKey.Id)) @@ -118,6 +126,18 @@ func resourceAwsApiGatewayApiKeyRead(d *schema.ResourceData, meta interface{}) e return err } + if err := d.Set("tags", keyvaluetags.ApigatewayKeyValueTags(apiKey.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "apigateway", + Region: meta.(*AWSClient).region, + Resource: fmt.Sprintf("/apikeys/%s", d.Id()), + }.String() + d.Set("arn", arn) + d.Set("name", apiKey.Name) d.Set("description", apiKey.Description) d.Set("enabled", apiKey.Enabled) @@ -164,6 +184,13 @@ func resourceAwsApiGatewayApiKeyUpdate(d *schema.ResourceData, meta interface{}) log.Printf("[DEBUG] Updating API Gateway API Key: %s", d.Id()) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.ApigatewayUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + _, err := conn.UpdateApiKey(&apigateway.UpdateApiKeyInput{ ApiKey: aws.String(d.Id()), PatchOperations: resourceAwsApiGatewayApiKeyUpdateOperations(d), diff --git a/aws/resource_aws_api_gateway_api_key_test.go b/aws/resource_aws_api_gateway_api_key_test.go index bf0d886d542..1b32bf46da7 100644 --- a/aws/resource_aws_api_gateway_api_key_test.go +++ b/aws/resource_aws_api_gateway_api_key_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -26,6 +27,7 @@ func TestAccAWSAPIGatewayApiKey_basic(t *testing.T) { Config: testAccAWSAPIGatewayApiKeyConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayApiKeyExists(resourceName, &apiKey1), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/apikeys/+.`)), resource.TestCheckResourceAttrSet(resourceName, "created_date"), resource.TestCheckResourceAttr(resourceName, "description", "Managed by Terraform"), resource.TestCheckResourceAttr(resourceName, "enabled", "true"), @@ -43,6 +45,50 @@ func TestAccAWSAPIGatewayApiKey_basic(t *testing.T) { }) } +func TestAccAWSAPIGatewayApiKey_Tags(t *testing.T) { + var apiKey1 apigateway.ApiKey + resourceName := "aws_api_gateway_api_key.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAPIGatewayApiKeyDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAPIGatewayApiKeyConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayApiKeyExists(resourceName, &apiKey1), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + Config: testAccAWSAPIGatewayApiKeyConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayApiKeyExists(resourceName, &apiKey1), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSAPIGatewayApiKeyConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayApiKeyExists(resourceName, &apiKey1), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccAWSAPIGatewayApiKey_Description(t *testing.T) { var apiKey1, apiKey2 apigateway.ApiKey resourceName := "aws_api_gateway_api_key.test" @@ -217,6 +263,31 @@ resource "aws_api_gateway_api_key" "test" { `, rName) } +func testAccAWSAPIGatewayApiKeyConfigTags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_api_gateway_api_key" "test" { + name = %[1]q + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccAWSAPIGatewayApiKeyConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_api_gateway_api_key" "test" { + name = %[1]q + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + func testAccAWSAPIGatewayApiKeyConfigDescription(rName, description string) string { return fmt.Sprintf(` resource "aws_api_gateway_api_key" "test" { diff --git a/aws/resource_aws_api_gateway_authorizer.go b/aws/resource_aws_api_gateway_authorizer.go index d9535661b67..381739234e0 100644 --- a/aws/resource_aws_api_gateway_authorizer.go +++ b/aws/resource_aws_api_gateway_authorizer.go @@ -12,6 +12,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) +const defaultAuthorizerTTL = 300 + func resourceAwsApiGatewayAuthorizer() *schema.Resource { return &schema.Resource{ Create: resourceAwsApiGatewayAuthorizerCreate, @@ -19,6 +21,19 @@ func resourceAwsApiGatewayAuthorizer() *schema.Resource { Update: resourceAwsApiGatewayAuthorizerUpdate, Delete: resourceAwsApiGatewayAuthorizerDelete, CustomizeDiff: resourceAwsApiGatewayAuthorizerCustomizeDiff, + Importer: &schema.ResourceImporter{ + State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + idParts := strings.Split(d.Id(), "/") + if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { + return nil, fmt.Errorf("Unexpected format of ID (%q), expected REST-API-ID/AUTHORIZER-ID", d.Id()) + } + restAPIId := idParts[0] + authorizerId := idParts[1] + d.Set("rest_api_id", restAPIId) + d.SetId(authorizerId) + return []*schema.ResourceData{d}, nil + }, + }, Schema: map[string]*schema.Schema{ "authorizer_uri": { @@ -42,7 +57,7 @@ func resourceAwsApiGatewayAuthorizer() *schema.Resource { "type": { Type: schema.TypeString, Optional: true, - Default: "TOKEN", + Default: apigateway.AuthorizerTypeToken, ValidateFunc: validation.StringInSlice([]string{ apigateway.AuthorizerTypeCognitoUserPools, apigateway.AuthorizerTypeRequest, @@ -57,6 +72,7 @@ func resourceAwsApiGatewayAuthorizer() *schema.Resource { Type: schema.TypeInt, Optional: true, ValidateFunc: validation.IntBetween(0, 3600), + Default: defaultAuthorizerTTL, }, "identity_validation_expression": { Type: schema.TypeString, @@ -65,7 +81,10 @@ func resourceAwsApiGatewayAuthorizer() *schema.Resource { "provider_arns": { Type: schema.TypeSet, Optional: true, // provider_arns is required for authorizer COGNITO_USER_POOLS. - Elem: &schema.Schema{Type: schema.TypeString}, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validateArn, + }, }, }, } @@ -122,7 +141,7 @@ func resourceAwsApiGatewayAuthorizerRead(d *schema.ResourceData, meta interface{ authorizer, err := conn.GetAuthorizer(&input) if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == apigateway.ErrCodeNotFoundException { log.Printf("[WARN] No API Gateway Authorizer found: %s", input) d.SetId("") return nil @@ -132,7 +151,13 @@ func resourceAwsApiGatewayAuthorizerRead(d *schema.ResourceData, meta interface{ log.Printf("[DEBUG] Received API Gateway Authorizer: %s", authorizer) d.Set("authorizer_credentials", authorizer.AuthorizerCredentials) - d.Set("authorizer_result_ttl_in_seconds", authorizer.AuthorizerResultTtlInSeconds) + + if authorizer.AuthorizerResultTtlInSeconds != nil { + d.Set("authorizer_result_ttl_in_seconds", authorizer.AuthorizerResultTtlInSeconds) + } else { + d.Set("authorizer_result_ttl_in_seconds", defaultAuthorizerTTL) + } + d.Set("authorizer_uri", authorizer.AuthorizerUri) d.Set("identity_source", authorizer.IdentitySource) d.Set("identity_validation_expression", authorizer.IdentityValidationExpression) @@ -155,49 +180,49 @@ func resourceAwsApiGatewayAuthorizerUpdate(d *schema.ResourceData, meta interfac if d.HasChange("authorizer_uri") { operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), + Op: aws.String(apigateway.OpReplace), 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"), + Op: aws.String(apigateway.OpReplace), 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"), + Op: aws.String(apigateway.OpReplace), Path: aws.String("/name"), Value: aws.String(d.Get("name").(string)), }) } if d.HasChange("type") { operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("replace"), + Op: aws.String(apigateway.OpReplace), 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"), + Op: aws.String(apigateway.OpReplace), 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"), + Op: aws.String(apigateway.OpReplace), 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"), + Op: aws.String(apigateway.OpReplace), Path: aws.String("/identityValidationExpression"), Value: aws.String(d.Get("identity_validation_expression").(string)), }) @@ -210,7 +235,7 @@ func resourceAwsApiGatewayAuthorizerUpdate(d *schema.ResourceData, meta interfac additionList := ns.Difference(os) for _, v := range additionList.List() { operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("add"), + Op: aws.String(apigateway.OpAdd), Path: aws.String("/providerARNs"), Value: aws.String(v.(string)), }) @@ -218,7 +243,7 @@ func resourceAwsApiGatewayAuthorizerUpdate(d *schema.ResourceData, meta interfac removalList := os.Difference(ns) for _, v := range removalList.List() { operations = append(operations, &apigateway.PatchOperation{ - Op: aws.String("remove"), + Op: aws.String(apigateway.OpRemove), Path: aws.String("/providerARNs"), Value: aws.String(v.(string)), }) @@ -247,7 +272,7 @@ func resourceAwsApiGatewayAuthorizerDelete(d *schema.ResourceData, meta interfac 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") { + if !strings.Contains(err.Error(), apigateway.ErrCodeConflictException) { return fmt.Errorf("Deleting API Gateway Authorizer failed: %s", err) } } diff --git a/aws/resource_aws_api_gateway_authorizer_test.go b/aws/resource_aws_api_gateway_authorizer_test.go index 697a9c9d43c..e5f86732bda 100644 --- a/aws/resource_aws_api_gateway_authorizer_test.go +++ b/aws/resource_aws_api_gateway_authorizer_test.go @@ -15,10 +15,10 @@ import ( func TestAccAWSAPIGatewayAuthorizer_basic(t *testing.T) { var conf apigateway.Authorizer - rString := acctest.RandString(7) - apiGatewayName := "tf-acctest-apigw-" + rString - authorizerName := "tf-acctest-igw-authorizer-" + rString - lambdaName := "tf-acctest-igw-auth-lambda-" + rString + apiGatewayName := acctest.RandomWithPrefix("tf-acctest-apigw") + authorizerName := acctest.RandomWithPrefix("tf-acctest-igw-authorizer") + lambdaName := acctest.RandomWithPrefix("tf-acctest-igw-auth-lambda") + resourceName := "aws_api_gateway_authorizer.acctest" expectedAuthUri := regexp.MustCompile("arn:aws:apigateway:[a-z0-9-]+:lambda:path/2015-03-31/functions/" + "arn:aws:lambda:[a-z0-9-]+:[0-9]{12}:function:" + lambdaName + "/invocations") @@ -32,41 +32,47 @@ func TestAccAWSAPIGatewayAuthorizer_basic(t *testing.T) { { Config: testAccAWSAPIGatewayAuthorizerConfig_lambda(apiGatewayName, authorizerName, lambdaName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayAuthorizerExists("aws_api_gateway_authorizer.acctest", &conf), + testAccCheckAWSAPIGatewayAuthorizerExists(resourceName, &conf), testAccCheckAWSAPIGatewayAuthorizerAuthorizerUri(&conf, expectedAuthUri), - resource.TestMatchResourceAttr("aws_api_gateway_authorizer.acctest", "authorizer_uri", expectedAuthUri), + resource.TestMatchResourceAttr(resourceName, "authorizer_uri", expectedAuthUri), testAccCheckAWSAPIGatewayAuthorizerIdentitySource(&conf, "method.request.header.Authorization"), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "identity_source", "method.request.header.Authorization"), + resource.TestCheckResourceAttr(resourceName, "identity_source", "method.request.header.Authorization"), testAccCheckAWSAPIGatewayAuthorizerName(&conf, authorizerName), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "name", authorizerName), + resource.TestCheckResourceAttr(resourceName, "name", authorizerName), testAccCheckAWSAPIGatewayAuthorizerType(&conf, "TOKEN"), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "type", "TOKEN"), + resource.TestCheckResourceAttr(resourceName, "type", "TOKEN"), testAccCheckAWSAPIGatewayAuthorizerAuthorizerCredentials(&conf, expectedCreds), - resource.TestMatchResourceAttr("aws_api_gateway_authorizer.acctest", "authorizer_credentials", expectedCreds), - testAccCheckAWSAPIGatewayAuthorizerAuthorizerResultTtlInSeconds(&conf, nil), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "authorizer_result_ttl_in_seconds", "0"), + resource.TestMatchResourceAttr(resourceName, "authorizer_credentials", expectedCreds), + testAccCheckAWSAPIGatewayAuthorizerAuthorizerResultTtlInSeconds(&conf, aws.Int64(defaultAuthorizerTTL)), + resource.TestCheckResourceAttr(resourceName, "authorizer_result_ttl_in_seconds", "300"), testAccCheckAWSAPIGatewayAuthorizerIdentityValidationExpression(&conf, nil), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "identity_validation_expression", ""), + resource.TestCheckResourceAttr(resourceName, "identity_validation_expression", ""), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSAPIGatewayAuthorizerImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, { Config: testAccAWSAPIGatewayAuthorizerConfig_lambdaUpdate(apiGatewayName, authorizerName, lambdaName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayAuthorizerExists("aws_api_gateway_authorizer.acctest", &conf), + testAccCheckAWSAPIGatewayAuthorizerExists(resourceName, &conf), testAccCheckAWSAPIGatewayAuthorizerAuthorizerUri(&conf, expectedAuthUri), - resource.TestMatchResourceAttr("aws_api_gateway_authorizer.acctest", "authorizer_uri", expectedAuthUri), + resource.TestMatchResourceAttr(resourceName, "authorizer_uri", expectedAuthUri), testAccCheckAWSAPIGatewayAuthorizerIdentitySource(&conf, "method.request.header.Authorization"), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "identity_source", "method.request.header.Authorization"), + resource.TestCheckResourceAttr(resourceName, "identity_source", "method.request.header.Authorization"), testAccCheckAWSAPIGatewayAuthorizerName(&conf, authorizerName+"_modified"), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "name", authorizerName+"_modified"), + resource.TestCheckResourceAttr(resourceName, "name", authorizerName+"_modified"), testAccCheckAWSAPIGatewayAuthorizerType(&conf, "TOKEN"), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "type", "TOKEN"), + resource.TestCheckResourceAttr(resourceName, "type", "TOKEN"), testAccCheckAWSAPIGatewayAuthorizerAuthorizerCredentials(&conf, expectedCreds), - resource.TestMatchResourceAttr("aws_api_gateway_authorizer.acctest", "authorizer_credentials", expectedCreds), + resource.TestMatchResourceAttr(resourceName, "authorizer_credentials", expectedCreds), testAccCheckAWSAPIGatewayAuthorizerAuthorizerResultTtlInSeconds(&conf, aws.Int64(360)), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "authorizer_result_ttl_in_seconds", "360"), + resource.TestCheckResourceAttr(resourceName, "authorizer_result_ttl_in_seconds", "360"), testAccCheckAWSAPIGatewayAuthorizerIdentityValidationExpression(&conf, aws.String(".*")), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "identity_validation_expression", ".*"), + resource.TestCheckResourceAttr(resourceName, "identity_validation_expression", ".*"), ), }, }, @@ -74,10 +80,10 @@ func TestAccAWSAPIGatewayAuthorizer_basic(t *testing.T) { } func TestAccAWSAPIGatewayAuthorizer_cognito(t *testing.T) { - rString := acctest.RandString(7) - apiGatewayName := "tf-acctest-apigw-" + rString - authorizerName := "tf-acctest-igw-authorizer-" + rString - cognitoName := "tf-acctest-cognito-user-pool-" + rString + apiGatewayName := acctest.RandomWithPrefix("tf-acctest-apigw") + authorizerName := acctest.RandomWithPrefix("tf-acctest-igw-authorizer") + cognitoName := acctest.RandomWithPrefix("tf-acctest-cognito-user-pool") + resourceName := "aws_api_gateway_authorizer.acctest" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -87,15 +93,21 @@ func TestAccAWSAPIGatewayAuthorizer_cognito(t *testing.T) { { Config: testAccAWSAPIGatewayAuthorizerConfig_cognito(apiGatewayName, authorizerName, cognitoName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "name", authorizerName+"-cognito"), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "provider_arns.#", "2"), + resource.TestCheckResourceAttr(resourceName, "name", authorizerName+"-cognito"), + resource.TestCheckResourceAttr(resourceName, "provider_arns.#", "2"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSAPIGatewayAuthorizerImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, { Config: testAccAWSAPIGatewayAuthorizerConfig_cognitoUpdate(apiGatewayName, authorizerName, cognitoName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "name", authorizerName+"-cognito-update"), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "provider_arns.#", "3"), + resource.TestCheckResourceAttr(resourceName, "name", authorizerName+"-cognito-update"), + resource.TestCheckResourceAttr(resourceName, "provider_arns.#", "3"), ), }, }, @@ -103,11 +115,11 @@ func TestAccAWSAPIGatewayAuthorizer_cognito(t *testing.T) { } func TestAccAWSAPIGatewayAuthorizer_switchAuthType(t *testing.T) { - rString := acctest.RandString(7) - apiGatewayName := "tf-acctest-apigw-" + rString - authorizerName := "tf-acctest-igw-authorizer-" + rString - cognitoName := "tf-acctest-cognito-user-pool-" + rString - lambdaName := "tf-acctest-igw-auth-lambda-" + rString + apiGatewayName := acctest.RandomWithPrefix("tf-acctest-apigw") + authorizerName := acctest.RandomWithPrefix("tf-acctest-igw-authorizer") + lambdaName := acctest.RandomWithPrefix("tf-acctest-igw-auth-lambda") + cognitoName := acctest.RandomWithPrefix("tf-acctest-cognito-user-pool") + resourceName := "aws_api_gateway_authorizer.acctest" expectedAuthUri := regexp.MustCompile("arn:aws:apigateway:[a-z0-9-]+:lambda:path/2015-03-31/functions/" + "arn:aws:lambda:[a-z0-9-]+:[0-9]{12}:function:" + lambdaName + "/invocations") @@ -121,27 +133,87 @@ func TestAccAWSAPIGatewayAuthorizer_switchAuthType(t *testing.T) { { Config: testAccAWSAPIGatewayAuthorizerConfig_lambda(apiGatewayName, authorizerName, lambdaName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "name", authorizerName), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "type", "TOKEN"), - resource.TestMatchResourceAttr("aws_api_gateway_authorizer.acctest", "authorizer_uri", expectedAuthUri), - resource.TestMatchResourceAttr("aws_api_gateway_authorizer.acctest", "authorizer_credentials", expectedCreds), + resource.TestCheckResourceAttr(resourceName, "name", authorizerName), + resource.TestCheckResourceAttr(resourceName, "type", "TOKEN"), + resource.TestMatchResourceAttr(resourceName, "authorizer_uri", expectedAuthUri), + resource.TestMatchResourceAttr(resourceName, "authorizer_credentials", expectedCreds), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSAPIGatewayAuthorizerImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, { Config: testAccAWSAPIGatewayAuthorizerConfig_cognito(apiGatewayName, authorizerName, cognitoName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "name", authorizerName+"-cognito"), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "type", "COGNITO_USER_POOLS"), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "provider_arns.#", "2"), + resource.TestCheckResourceAttr(resourceName, "name", authorizerName+"-cognito"), + resource.TestCheckResourceAttr(resourceName, "type", "COGNITO_USER_POOLS"), + resource.TestCheckResourceAttr(resourceName, "provider_arns.#", "2"), ), }, { Config: testAccAWSAPIGatewayAuthorizerConfig_lambdaUpdate(apiGatewayName, authorizerName, lambdaName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "name", authorizerName+"_modified"), - resource.TestCheckResourceAttr("aws_api_gateway_authorizer.acctest", "type", "TOKEN"), - resource.TestMatchResourceAttr("aws_api_gateway_authorizer.acctest", "authorizer_uri", expectedAuthUri), - resource.TestMatchResourceAttr("aws_api_gateway_authorizer.acctest", "authorizer_credentials", expectedCreds), + resource.TestCheckResourceAttr(resourceName, "name", authorizerName+"_modified"), + resource.TestCheckResourceAttr(resourceName, "type", "TOKEN"), + resource.TestMatchResourceAttr(resourceName, "authorizer_uri", expectedAuthUri), + resource.TestMatchResourceAttr(resourceName, "authorizer_credentials", expectedCreds), + ), + }, + }, + }) +} + +func TestAccAWSAPIGatewayAuthorizer_switchAuthorizerTTL(t *testing.T) { + var conf apigateway.Authorizer + apiGatewayName := acctest.RandomWithPrefix("tf-acctest-apigw") + authorizerName := acctest.RandomWithPrefix("tf-acctest-igw-authorizer") + lambdaName := acctest.RandomWithPrefix("tf-acctest-igw-auth-lambda") + resourceName := "aws_api_gateway_authorizer.acctest" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAPIGatewayAuthorizerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAPIGatewayAuthorizerConfig_lambda(apiGatewayName, authorizerName, lambdaName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayAuthorizerExists(resourceName, &conf), + testAccCheckAWSAPIGatewayAuthorizerAuthorizerResultTtlInSeconds(&conf, aws.Int64(defaultAuthorizerTTL)), + resource.TestCheckResourceAttr(resourceName, "authorizer_result_ttl_in_seconds", "300"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSAPIGatewayAuthorizerImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + { + Config: testAccAWSAPIGatewayAuthorizerConfig_lambdaUpdate(apiGatewayName, authorizerName, lambdaName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayAuthorizerExists(resourceName, &conf), + testAccCheckAWSAPIGatewayAuthorizerAuthorizerResultTtlInSeconds(&conf, aws.Int64(360)), + resource.TestCheckResourceAttr(resourceName, "authorizer_result_ttl_in_seconds", "360"), + ), + }, + { + Config: testAccAWSAPIGatewayAuthorizerConfig_lambdaNoCache(apiGatewayName, authorizerName, lambdaName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayAuthorizerExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "authorizer_result_ttl_in_seconds", "0"), + testAccCheckAWSAPIGatewayAuthorizerAuthorizerResultTtlInSeconds(&conf, aws.Int64(0)), + ), + }, + { + Config: testAccAWSAPIGatewayAuthorizerConfig_lambda(apiGatewayName, authorizerName, lambdaName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayAuthorizerExists(resourceName, &conf), + testAccCheckAWSAPIGatewayAuthorizerAuthorizerResultTtlInSeconds(&conf, aws.Int64(defaultAuthorizerTTL)), + resource.TestCheckResourceAttr(resourceName, "authorizer_result_ttl_in_seconds", "300"), ), }, }, @@ -149,11 +221,10 @@ func TestAccAWSAPIGatewayAuthorizer_switchAuthType(t *testing.T) { } func TestAccAWSAPIGatewayAuthorizer_authTypeValidation(t *testing.T) { - rString := acctest.RandString(7) - apiGatewayName := "tf-acctest-apigw-" + rString - authorizerName := "tf-acctest-igw-authorizer-" + rString - cognitoName := "tf-acctest-cognito-user-pool-" + rString - lambdaName := "tf-acctest-igw-auth-lambda-" + rString + apiGatewayName := acctest.RandomWithPrefix("tf-acctest-apigw") + authorizerName := acctest.RandomWithPrefix("tf-acctest-igw-authorizer") + lambdaName := acctest.RandomWithPrefix("tf-acctest-igw-auth-lambda") + cognitoName := acctest.RandomWithPrefix("tf-acctest-cognito-user-pool") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -176,6 +247,54 @@ func TestAccAWSAPIGatewayAuthorizer_authTypeValidation(t *testing.T) { }) } +func TestAccAWSAPIGatewayAuthorizer_disappears(t *testing.T) { + var conf apigateway.Authorizer + apiGatewayName := acctest.RandomWithPrefix("tf-acctest-apigw") + authorizerName := acctest.RandomWithPrefix("tf-acctest-igw-authorizer") + lambdaName := acctest.RandomWithPrefix("tf-acctest-igw-auth-lambda") + resourceName := "aws_api_gateway_authorizer.acctest" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAPIGatewayAuthorizerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAPIGatewayAuthorizerConfig_lambda(apiGatewayName, authorizerName, lambdaName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayAuthorizerExists(resourceName, &conf), + testAccCheckAWSAPIGatewayAuthorizerDisappears(resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func testAccCheckAWSAPIGatewayAuthorizerDisappears(resourceName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No resource ID is set") + } + conn := testAccProvider.Meta().(*AWSClient).apigateway + authorizerId := rs.Primary.ID + restApiId := rs.Primary.Attributes["rest_api_id"] + + input := &apigateway.DeleteAuthorizerInput{ + AuthorizerId: aws.String(authorizerId), + RestApiId: aws.String(restApiId), + } + _, err := conn.DeleteAuthorizer(input) + + return err + } +} + func testAccCheckAWSAPIGatewayAuthorizerAuthorizerUri(conf *apigateway.Authorizer, expectedUri *regexp.Regexp) resource.TestCheckFunc { return func(s *terraform.State) error { if conf.AuthorizerUri == nil { @@ -326,7 +445,7 @@ func testAccCheckAWSAPIGatewayAuthorizerDestroy(s *terraform.State) error { if !ok { return err } - if aws2err.Code() != "NotFoundException" { + if aws2err.Code() != apigateway.ErrCodeNotFoundException { return err } @@ -336,6 +455,17 @@ func testAccCheckAWSAPIGatewayAuthorizerDestroy(s *terraform.State) error { return nil } +func testAccAWSAPIGatewayAuthorizerImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return "", fmt.Errorf("Not found: %s", resourceName) + } + + return fmt.Sprintf("%s/%s", rs.Primary.Attributes["rest_api_id"], rs.Primary.ID), nil + } +} + func testAccAWSAPIGatewayAuthorizerConfig_baseLambda(apiGatewayName, lambdaName string) string { return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "acctest" { @@ -407,7 +537,7 @@ resource "aws_lambda_function" "authorizer" { function_name = "%s" role = "${aws_iam_role.iam_for_lambda.arn}" handler = "exports.example" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } `, apiGatewayName, apiGatewayName, apiGatewayName, lambdaName) } @@ -436,6 +566,19 @@ resource "aws_api_gateway_authorizer" "acctest" { `, authorizerName) } +func testAccAWSAPIGatewayAuthorizerConfig_lambdaNoCache(apiGatewayName, authorizerName, lambdaName string) string { + return testAccAWSAPIGatewayAuthorizerConfig_baseLambda(apiGatewayName, lambdaName) + fmt.Sprintf(` +resource "aws_api_gateway_authorizer" "acctest" { + name = "%s_modified" + rest_api_id = "${aws_api_gateway_rest_api.acctest.id}" + authorizer_uri = "${aws_lambda_function.authorizer.invoke_arn}" + authorizer_credentials = "${aws_iam_role.invocation_role.arn}" + authorizer_result_ttl_in_seconds = 0 + identity_validation_expression = ".*" +} +`, authorizerName) +} + func testAccAWSAPIGatewayAuthorizerConfig_cognito(apiGatewayName, authorizerName, cognitoName string) string { return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "acctest" { diff --git a/aws/resource_aws_api_gateway_base_path_mapping_test.go b/aws/resource_aws_api_gateway_base_path_mapping_test.go index a20c754c042..d181fd533ee 100644 --- a/aws/resource_aws_api_gateway_base_path_mapping_test.go +++ b/aws/resource_aws_api_gateway_base_path_mapping_test.go @@ -67,16 +67,18 @@ func TestDecodeApiGatewayBasePathMappingId(t *testing.T) { func TestAccAWSAPIGatewayBasePathMapping_basic(t *testing.T) { var conf apigateway.BasePathMapping - // Our test cert is for a wildcard on this domain name := fmt.Sprintf("tf-acc-%s.terraformtest.com", acctest.RandString(8)) + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509SelfSignedCertificatePem(key, name) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayBasePathDestroy(name), Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayBasePathConfig(name), + Config: testAccAWSAPIGatewayBasePathConfigBasePath(name, key, certificate, "tf-acc-test"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayBasePathExists("aws_api_gateway_base_path_mapping.test", name, &conf), ), @@ -94,16 +96,18 @@ func TestAccAWSAPIGatewayBasePathMapping_basic(t *testing.T) { func TestAccAWSAPIGatewayBasePathMapping_BasePath_Empty(t *testing.T) { var conf apigateway.BasePathMapping - // Our test cert is for a wildcard on this domain name := fmt.Sprintf("tf-acc-%s.terraformtest.com", acctest.RandString(8)) + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509SelfSignedCertificatePem(key, name) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayBasePathDestroy(name), Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayEmptyBasePathConfig(name), + Config: testAccAWSAPIGatewayBasePathConfigBasePath(name, key, certificate, ""), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayBasePathExists("aws_api_gateway_base_path_mapping.test", name, &conf), ), @@ -184,11 +188,29 @@ func testAccCheckAWSAPIGatewayBasePathDestroy(name string) resource.TestCheckFun } } -func testAccAWSAPIGatewayBasePathConfig(domainName string) string { +func testAccAWSAPIGatewayBasePathConfigBase(domainName, key, certificate string) string { return fmt.Sprintf(` +resource "aws_acm_certificate" "test" { + certificate_body = "%[2]s" + private_key = "%[3]s" +} + +resource "aws_api_gateway_domain_name" "test" { + domain_name = %[1]q + regional_certificate_arn = "${aws_acm_certificate.test.arn}" + + endpoint_configuration { + types = ["REGIONAL"] + } +} + resource "aws_api_gateway_rest_api" "test" { name = "tf-acc-apigateway-base-path-mapping" description = "Terraform Acceptance Tests" + + endpoint_configuration { + types = ["REGIONAL"] + } } # API gateway won't let us deploy an empty API @@ -217,70 +239,16 @@ resource "aws_api_gateway_deployment" "test" { stage_name = "test" depends_on = ["aws_api_gateway_integration.test"] } - -resource "aws_api_gateway_base_path_mapping" "test" { - api_id = "${aws_api_gateway_rest_api.test.id}" - base_path = "tf-acc" - stage_name = "${aws_api_gateway_deployment.test.stage_name}" - domain_name = "${aws_api_gateway_domain_name.test.domain_name}" -} - -resource "aws_api_gateway_domain_name" "test" { - domain_name = "%s" - certificate_name = "tf-apigateway-base-path-mapping-test" - certificate_body = "${tls_locally_signed_cert.leaf.cert_pem}" - certificate_chain = "${tls_self_signed_cert.ca.cert_pem}" - certificate_private_key = "${tls_private_key.test.private_key_pem}" -} - -%s - -`, domainName, testAccAWSAPIGatewayCerts(domainName)) -} - -func testAccAWSAPIGatewayEmptyBasePathConfig(domainName string) string { - return fmt.Sprintf(` -resource "aws_api_gateway_rest_api" "test" { - name = "tf-acc-apigateway-base-path-mapping" - description = "Terraform Acceptance Tests" -} - -resource "aws_api_gateway_method" "test" { - rest_api_id = "${aws_api_gateway_rest_api.test.id}" - resource_id = "${aws_api_gateway_rest_api.test.root_resource_id}" - http_method = "GET" - authorization = "NONE" -} - -resource "aws_api_gateway_integration" "test" { - rest_api_id = "${aws_api_gateway_rest_api.test.id}" - resource_id = "${aws_api_gateway_rest_api.test.root_resource_id}" - http_method = "${aws_api_gateway_method.test.http_method}" - type = "MOCK" -} - -resource "aws_api_gateway_deployment" "test" { - rest_api_id = "${aws_api_gateway_rest_api.test.id}" - stage_name = "test" - depends_on = ["aws_api_gateway_integration.test"] +`, domainName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key)) } +func testAccAWSAPIGatewayBasePathConfigBasePath(domainName, key, certificate, basePath string) string { + return testAccAWSAPIGatewayBasePathConfigBase(domainName, key, certificate) + fmt.Sprintf(` resource "aws_api_gateway_base_path_mapping" "test" { api_id = "${aws_api_gateway_rest_api.test.id}" - base_path = "" + base_path = %[1]q stage_name = "${aws_api_gateway_deployment.test.stage_name}" domain_name = "${aws_api_gateway_domain_name.test.domain_name}" } - -resource "aws_api_gateway_domain_name" "test" { - domain_name = "%s" - certificate_name = "tf-apigateway-base-path-mapping-test" - certificate_body = "${tls_locally_signed_cert.leaf.cert_pem}" - certificate_chain = "${tls_self_signed_cert.ca.cert_pem}" - certificate_private_key = "${tls_private_key.test.private_key_pem}" -} - -%s - -`, domainName, testAccAWSAPIGatewayCerts(domainName)) +`, basePath) } diff --git a/aws/resource_aws_api_gateway_client_certificate.go b/aws/resource_aws_api_gateway_client_certificate.go index 851aa831b6f..3bc0666168b 100644 --- a/aws/resource_aws_api_gateway_client_certificate.go +++ b/aws/resource_aws_api_gateway_client_certificate.go @@ -5,9 +5,11 @@ import ( "log" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsApiGatewayClientCertificate() *schema.Resource { @@ -37,6 +39,11 @@ func resourceAwsApiGatewayClientCertificate() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tagsSchema(), }, } } @@ -48,6 +55,9 @@ func resourceAwsApiGatewayClientCertificateCreate(d *schema.ResourceData, meta i if v, ok := d.GetOk("description"); ok { input.Description = aws.String(v.(string)) } + if v, ok := d.GetOk("tags"); ok { + input.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().ApigatewayTags() + } log.Printf("[DEBUG] Generating API Gateway Client Certificate: %s", input) out, err := conn.GenerateClientCertificate(&input) if err != nil { @@ -67,7 +77,7 @@ func resourceAwsApiGatewayClientCertificateRead(d *schema.ResourceData, meta int } out, err := conn.GetClientCertificate(&input) if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == apigateway.ErrCodeNotFoundException { log.Printf("[WARN] API Gateway Client Certificate %s not found, removing", d.Id()) d.SetId("") return nil @@ -76,6 +86,18 @@ func resourceAwsApiGatewayClientCertificateRead(d *schema.ResourceData, meta int } log.Printf("[DEBUG] Received API Gateway Client Certificate: %s", out) + if err := d.Set("tags", keyvaluetags.ApigatewayKeyValueTags(out.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "apigateway", + Region: meta.(*AWSClient).region, + Resource: fmt.Sprintf("/clientcertificates/%s", d.Id()), + }.String() + d.Set("arn", arn) + d.Set("description", out.Description) d.Set("created_date", out.CreatedDate.String()) d.Set("expiration_date", out.ExpirationDate.String()) @@ -107,6 +129,13 @@ func resourceAwsApiGatewayClientCertificateUpdate(d *schema.ResourceData, meta i return fmt.Errorf("Updating API Gateway Client Certificate failed: %s", err) } + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.ApigatewayUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + return resourceAwsApiGatewayClientCertificateRead(d, meta) } diff --git a/aws/resource_aws_api_gateway_client_certificate_test.go b/aws/resource_aws_api_gateway_client_certificate_test.go index 111dd4ccfaa..57e764e386a 100644 --- a/aws/resource_aws_api_gateway_client_certificate_test.go +++ b/aws/resource_aws_api_gateway_client_certificate_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -13,6 +14,7 @@ import ( func TestAccAWSAPIGatewayClientCertificate_basic(t *testing.T) { var conf apigateway.ClientCertificate + resourceName := "aws_api_gateway_client_certificate.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -22,23 +24,31 @@ func TestAccAWSAPIGatewayClientCertificate_basic(t *testing.T) { { Config: testAccAWSAPIGatewayClientCertificateConfig_basic, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayClientCertificateExists("aws_api_gateway_client_certificate.cow", &conf), - resource.TestCheckResourceAttr("aws_api_gateway_client_certificate.cow", "description", "Hello from TF acceptance test"), + testAccCheckAWSAPIGatewayClientCertificateExists(resourceName, &conf), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/clientcertificates/+.`)), + resource.TestCheckResourceAttr(resourceName, "description", "Hello from TF acceptance test"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSAPIGatewayClientCertificateConfig_basic_updated, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayClientCertificateExists("aws_api_gateway_client_certificate.cow", &conf), - resource.TestCheckResourceAttr("aws_api_gateway_client_certificate.cow", "description", "Hello from TF acceptance test - updated"), + testAccCheckAWSAPIGatewayClientCertificateExists(resourceName, &conf), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/clientcertificates/+.`)), + resource.TestCheckResourceAttr(resourceName, "description", "Hello from TF acceptance test - updated"), ), }, }, }) } -func TestAccAWSAPIGatewayClientCertificate_importBasic(t *testing.T) { - resourceName := "aws_api_gateway_client_certificate.cow" +func TestAccAWSAPIGatewayClientCertificate_tags(t *testing.T) { + var conf apigateway.ClientCertificate + resourceName := "aws_api_gateway_client_certificate.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -46,14 +56,35 @@ func TestAccAWSAPIGatewayClientCertificate_importBasic(t *testing.T) { CheckDestroy: testAccCheckAWSAPIGatewayClientCertificateDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayClientCertificateConfig_basic, + Config: testAccAWSAPIGatewayClientCertificateConfigTags1("key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayClientCertificateExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), }, - { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, + { + Config: testAccAWSAPIGatewayClientCertificateConfigTags2("key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayClientCertificateExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSAPIGatewayClientCertificateConfigTags1("key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayClientCertificateExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, }, }) } @@ -105,7 +136,7 @@ func testAccCheckAWSAPIGatewayClientCertificateDestroy(s *terraform.State) error if !ok { return err } - if awsErr.Code() != "NotFoundException" { + if awsErr.Code() != apigateway.ErrCodeNotFoundException { return err } @@ -116,13 +147,38 @@ func testAccCheckAWSAPIGatewayClientCertificateDestroy(s *terraform.State) error } const testAccAWSAPIGatewayClientCertificateConfig_basic = ` -resource "aws_api_gateway_client_certificate" "cow" { +resource "aws_api_gateway_client_certificate" "test" { description = "Hello from TF acceptance test" } ` const testAccAWSAPIGatewayClientCertificateConfig_basic_updated = ` -resource "aws_api_gateway_client_certificate" "cow" { +resource "aws_api_gateway_client_certificate" "test" { description = "Hello from TF acceptance test - updated" } ` + +func testAccAWSAPIGatewayClientCertificateConfigTags1(tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_api_gateway_client_certificate" "test" { + description = "Hello from TF acceptance test" + + tags = { + %q = %q + } +} +`, tagKey1, tagValue1) +} + +func testAccAWSAPIGatewayClientCertificateConfigTags2(tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_api_gateway_client_certificate" "test" { + description = "Hello from TF acceptance test" + + tags = { + %q = %q + %q = %q + } +} +`, tagKey1, tagValue1, tagKey2, tagValue2) +} diff --git a/aws/resource_aws_api_gateway_deployment_test.go b/aws/resource_aws_api_gateway_deployment_test.go index 058997c2964..4b7ba199d34 100644 --- a/aws/resource_aws_api_gateway_deployment_test.go +++ b/aws/resource_aws_api_gateway_deployment_test.go @@ -41,6 +41,31 @@ func TestAccAWSAPIGatewayDeployment_basic(t *testing.T) { }) } +func TestAccAWSAPIGatewayDeployment_disappears_RestApi(t *testing.T) { + var deployment apigateway.Deployment + var restApi apigateway.RestApi + resourceName := "aws_api_gateway_deployment.test" + restApiResourceName := "aws_api_gateway_rest_api.test" + rName := acctest.RandomWithPrefix("tf-acc-test-deployment") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAPIGatewayDeploymentDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAPIGatewayDeploymentConfigStageName(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayDeploymentExists(resourceName, &deployment), + testAccCheckAWSAPIGatewayRestAPIExists(restApiResourceName, &restApi), + testAccCheckAWSAPIGatewayRestAPIDisappears(&restApi), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func TestAccAWSAPIGatewayDeployment_createBeforeDestoryUpdate(t *testing.T) { var deployment apigateway.Deployment var stage apigateway.Stage @@ -163,7 +188,7 @@ func TestAccAWSAPIGatewayDeployment_StageName_EmptyString(t *testing.T) { Config: testAccAWSAPIGatewayDeploymentConfigStageName(""), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayDeploymentExists(resourceName, &deployment), - resource.TestCheckNoResourceAttr(resourceName, "stage_name"), + resource.TestCheckResourceAttr(resourceName, "stage_name", ""), ), }, }, diff --git a/aws/resource_aws_api_gateway_documentation_part_test.go b/aws/resource_aws_api_gateway_documentation_part_test.go index b0df32e5cd1..b8959f1fa8d 100644 --- a/aws/resource_aws_api_gateway_documentation_part_test.go +++ b/aws/resource_aws_api_gateway_documentation_part_test.go @@ -16,7 +16,7 @@ func TestAccAWSAPIGatewayDocumentationPart_basic(t *testing.T) { var conf apigateway.DocumentationPart rString := acctest.RandString(8) - apiName := fmt.Sprintf("tf_acc_api_doc_part_basic_%s", rString) + apiName := fmt.Sprintf("tf-acc-test_api_doc_part_basic_%s", rString) properties := `{"description":"Terraform Acceptance Test"}` uProperties := `{"description":"Terraform Acceptance Test Updated"}` @@ -37,6 +37,11 @@ func TestAccAWSAPIGatewayDocumentationPart_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "rest_api_id"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSAPIGatewayDocumentationPartConfig(apiName, strconv.Quote(uProperties)), Check: resource.ComposeTestCheckFunc( @@ -55,7 +60,7 @@ func TestAccAWSAPIGatewayDocumentationPart_method(t *testing.T) { var conf apigateway.DocumentationPart rString := acctest.RandString(8) - apiName := fmt.Sprintf("tf_acc_api_doc_part_method_%s", rString) + apiName := fmt.Sprintf("tf-acc-test_api_doc_part_method_%s", rString) properties := `{"description":"Terraform Acceptance Test"}` uProperties := `{"description":"Terraform Acceptance Test Updated"}` @@ -78,6 +83,11 @@ func TestAccAWSAPIGatewayDocumentationPart_method(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "rest_api_id"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSAPIGatewayDocumentationPartMethodConfig(apiName, strconv.Quote(uProperties)), Check: resource.ComposeTestCheckFunc( @@ -98,7 +108,7 @@ func TestAccAWSAPIGatewayDocumentationPart_responseHeader(t *testing.T) { var conf apigateway.DocumentationPart rString := acctest.RandString(8) - apiName := fmt.Sprintf("tf_acc_api_doc_part_resp_header_%s", rString) + apiName := fmt.Sprintf("tf-acc-test_api_doc_part_resp_header_%s", rString) properties := `{"description":"Terraform Acceptance Test"}` uProperties := `{"description":"Terraform Acceptance Test Updated"}` @@ -123,6 +133,11 @@ func TestAccAWSAPIGatewayDocumentationPart_responseHeader(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "rest_api_id"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSAPIGatewayDocumentationPartResponseHeaderConfig(apiName, strconv.Quote(uProperties)), Check: resource.ComposeTestCheckFunc( @@ -141,39 +156,6 @@ func TestAccAWSAPIGatewayDocumentationPart_responseHeader(t *testing.T) { }) } -func TestAccAWSAPIGatewayDocumentationPart_importBasic(t *testing.T) { - var conf apigateway.DocumentationPart - - rString := acctest.RandString(8) - apiName := fmt.Sprintf("tf_acc_api_doc_part_import_%s", rString) - properties := `{"description":"Terraform Acceptance Test"}` - - resourceName := "aws_api_gateway_documentation_part.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSAPIGatewayDocumentationPartDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSAPIGatewayDocumentationPartConfig(apiName, strconv.Quote(properties)), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayDocumentationPartExists(resourceName, &conf), - resource.TestCheckResourceAttr(resourceName, "location.#", "1"), - resource.TestCheckResourceAttr(resourceName, "location.0.type", "API"), - resource.TestCheckResourceAttr(resourceName, "properties", properties), - resource.TestCheckResourceAttrSet(resourceName, "rest_api_id"), - ), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func testAccCheckAWSAPIGatewayDocumentationPartExists(n string, res *apigateway.DocumentationPart) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] diff --git a/aws/resource_aws_api_gateway_documentation_version_test.go b/aws/resource_aws_api_gateway_documentation_version_test.go index c5f1c44e84f..93158f0a10a 100644 --- a/aws/resource_aws_api_gateway_documentation_version_test.go +++ b/aws/resource_aws_api_gateway_documentation_version_test.go @@ -15,8 +15,8 @@ func TestAccAWSAPIGatewayDocumentationVersion_basic(t *testing.T) { var conf apigateway.DocumentationVersion rString := acctest.RandString(8) - version := fmt.Sprintf("tf_acc_version_%s", rString) - apiName := fmt.Sprintf("tf_acc_api_doc_version_basic_%s", rString) + version := fmt.Sprintf("tf-acc-test_version_%s", rString) + apiName := fmt.Sprintf("tf-acc-test_api_doc_version_basic_%s", rString) resourceName := "aws_api_gateway_documentation_version.test" @@ -33,6 +33,11 @@ func TestAccAWSAPIGatewayDocumentationVersion_basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "rest_api_id"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -41,9 +46,9 @@ func TestAccAWSAPIGatewayDocumentationVersion_allFields(t *testing.T) { var conf apigateway.DocumentationVersion rString := acctest.RandString(8) - version := fmt.Sprintf("tf_acc_version_%s", rString) - apiName := fmt.Sprintf("tf_acc_api_doc_version_method_%s", rString) - stageName := fmt.Sprintf("tf_acc_stage_%s", rString) + version := fmt.Sprintf("tf-acc-test_version_%s", rString) + apiName := fmt.Sprintf("tf-acc-test_api_doc_version_method_%s", rString) + stageName := fmt.Sprintf("tf-acc-test_stage_%s", rString) description := fmt.Sprintf("Tf Acc Test description %s", rString) uDescription := fmt.Sprintf("Tf Acc Test description updated %s", rString) @@ -63,6 +68,11 @@ func TestAccAWSAPIGatewayDocumentationVersion_allFields(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "rest_api_id"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSAPIGatewayDocumentationVersionAllFieldsConfig(version, apiName, stageName, uDescription), Check: resource.ComposeTestCheckFunc( @@ -76,56 +86,6 @@ func TestAccAWSAPIGatewayDocumentationVersion_allFields(t *testing.T) { }) } -func TestAccAWSAPIGatewayDocumentationVersion_importBasic(t *testing.T) { - rString := acctest.RandString(8) - version := fmt.Sprintf("tf_acc_version_import_%s", rString) - apiName := fmt.Sprintf("tf_acc_api_doc_version_import_%s", rString) - - resourceName := "aws_api_gateway_documentation_version.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSAPIGatewayDocumentationVersionDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSAPIGatewayDocumentationVersionBasicConfig(version, apiName), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - -func TestAccAWSAPIGatewayDocumentationVersion_importAllFields(t *testing.T) { - rString := acctest.RandString(8) - version := fmt.Sprintf("tf_acc_version_import_af_%s", rString) - apiName := fmt.Sprintf("tf_acc_api_doc_version_import_af_%s", rString) - stageName := fmt.Sprintf("tf_acc_stage_%s", rString) - description := fmt.Sprintf("Tf Acc Test description %s", rString) - - resourceName := "aws_api_gateway_documentation_version.test" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSAPIGatewayDocumentationVersionDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSAPIGatewayDocumentationVersionAllFieldsConfig(version, apiName, stageName, description), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func testAccCheckAWSAPIGatewayDocumentationVersionExists(n string, res *apigateway.DocumentationVersion) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] diff --git a/aws/resource_aws_api_gateway_domain_name.go b/aws/resource_aws_api_gateway_domain_name.go index 0cdd4ca7f17..7d81914b651 100644 --- a/aws/resource_aws_api_gateway_domain_name.go +++ b/aws/resource_aws_api_gateway_domain_name.go @@ -6,10 +6,12 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/apigateway" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsApiGatewayDomainName() *schema.Resource { @@ -139,6 +141,11 @@ func resourceAwsApiGatewayDomainName() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tagsSchema(), }, } } @@ -187,6 +194,10 @@ func resourceAwsApiGatewayDomainNameCreate(d *schema.ResourceData, meta interfac params.SecurityPolicy = aws.String(v.(string)) } + if v, ok := d.GetOk("tags"); ok { + params.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().ApigatewayTags() + } + domainName, err := conn.CreateDomainName(params) if err != nil { return fmt.Errorf("Error creating API Gateway Domain Name: %s", err) @@ -205,7 +216,7 @@ func resourceAwsApiGatewayDomainNameRead(d *schema.ResourceData, meta interface{ DomainName: aws.String(d.Id()), }) if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NotFoundException" { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == apigateway.ErrCodeNotFoundException { log.Printf("[WARN] API Gateway Domain Name (%s) not found, removing from state", d.Id()) d.SetId("") return nil @@ -214,6 +225,17 @@ func resourceAwsApiGatewayDomainNameRead(d *schema.ResourceData, meta interface{ return err } + if err := d.Set("tags", keyvaluetags.ApigatewayKeyValueTags(domainName.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "apigateway", + Region: meta.(*AWSClient).region, + Resource: fmt.Sprintf("/domainnames/%s", d.Id()), + }.String() + d.Set("arn", arn) d.Set("certificate_arn", domainName.CertificateArn) d.Set("certificate_name", domainName.CertificateName) if err := d.Set("certificate_upload_date", domainName.CertificateUploadDate.Format(time.RFC3339)); err != nil { @@ -300,6 +322,13 @@ func resourceAwsApiGatewayDomainNameUpdate(d *schema.ResourceData, meta interfac conn := meta.(*AWSClient).apigateway log.Printf("[DEBUG] Updating API Gateway Domain Name %s", d.Id()) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.ApigatewayUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + _, err := conn.UpdateDomainName(&apigateway.UpdateDomainNameInput{ DomainName: aws.String(d.Id()), PatchOperations: resourceAwsApiGatewayDomainNameUpdateOperations(d), diff --git a/aws/resource_aws_api_gateway_domain_name_test.go b/aws/resource_aws_api_gateway_domain_name_test.go index c7c3e9c521a..2d20456f7ad 100644 --- a/aws/resource_aws_api_gateway_domain_name_test.go +++ b/aws/resource_aws_api_gateway_domain_name_test.go @@ -14,13 +14,6 @@ import ( ) func TestAccAWSAPIGatewayDomainName_CertificateArn(t *testing.T) { - // This test must always run in us-east-1 - // BadRequestException: Invalid certificate ARN: arn:aws:acm:us-west-2:123456789012:certificate/xxxxx. Certificate must be in 'us-east-1'. - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - - // For now, use an environment variable to limit running this test certificateArn := os.Getenv("AWS_API_GATEWAY_DOMAIN_NAME_CERTIFICATE_ARN") if certificateArn == "" { t.Skip( @@ -29,19 +22,26 @@ func TestAccAWSAPIGatewayDomainName_CertificateArn(t *testing.T) { "an ISSUED ACM certificate in us-east-1 to enable this test.") } + // This test must always run in us-east-1 + // BadRequestException: Invalid certificate ARN: arn:aws:acm:us-west-2:123456789012:certificate/xxxxx. Certificate must be in 'us-east-1'. + oldvar := os.Getenv("AWS_DEFAULT_REGION") + os.Setenv("AWS_DEFAULT_REGION", "us-east-1") + defer os.Setenv("AWS_DEFAULT_REGION", oldvar) + var domainName apigateway.DomainName resourceName := "aws_api_gateway_domain_name.test" rName := fmt.Sprintf("tf-acc-%s.terraformtest.com", acctest.RandString(8)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDomainNameDestroy, Steps: []resource.TestStep{ { Config: testAccAWSAPIGatewayDomainNameConfig_CertificateArn(rName, certificateArn), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayDomainNameExists(resourceName, &domainName), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/domainnames/+.`)), resource.TestCheckResourceAttrSet(resourceName, "cloudfront_domain_name"), resource.TestCheckResourceAttr(resourceName, "cloudfront_zone_id", "Z2FDTNDATAQYW2"), resource.TestCheckResourceAttr(resourceName, "domain_name", rName), @@ -52,50 +52,60 @@ func TestAccAWSAPIGatewayDomainName_CertificateArn(t *testing.T) { } func TestAccAWSAPIGatewayDomainName_CertificateName(t *testing.T) { - var conf apigateway.DomainName + certificateBody := os.Getenv("AWS_API_GATEWAY_DOMAIN_NAME_CERTIFICATE_BODY") + if certificateBody == "" { + t.Skip( + "Environment variable AWS_API_GATEWAY_DOMAIN_NAME_CERTIFICATE_BODY is not set. " + + "This environment variable must be set to any non-empty value " + + "with a publicly trusted certificate body to enable the test.") + } + + certificateChain := os.Getenv("AWS_API_GATEWAY_DOMAIN_NAME_CERTIFICATE_CHAIN") + if certificateChain == "" { + t.Skip( + "Environment variable AWS_API_GATEWAY_DOMAIN_NAME_CERTIFICATE_CHAIN is not set. " + + "This environment variable must be set to any non-empty value " + + "with a chain certificate acceptable for the certificate to enable the test.") + } + + certificatePrivateKey := os.Getenv("AWS_API_GATEWAY_DOMAIN_NAME_CERTIFICATE_PRIVATE_KEY") + if certificatePrivateKey == "" { + t.Skip( + "Environment variable AWS_API_GATEWAY_DOMAIN_NAME_CERTIFICATE_PRIVATE_KEY is not set. " + + "This environment variable must be set to any non-empty value " + + "with a private key of a publicly trusted certificate to enable the test.") + } + + domainName := os.Getenv("AWS_API_GATEWAY_DOMAIN_NAME_DOMAIN_NAME") + if domainName == "" { + t.Skip( + "Environment variable AWS_API_GATEWAY_DOMAIN_NAME_DOMAIN_NAME is not set. " + + "This environment variable must be set to any non-empty value " + + "with a domain name acceptable for the certificate to enable the test.") + } - rString := acctest.RandString(8) - name := fmt.Sprintf("tf-acc-%s.terraformtest.com", rString) - nameModified := fmt.Sprintf("tf-acc-%s-modified.terraformtest.com", rString) - commonName := "*.terraformtest.com" - certRe := regexp.MustCompile("^-----BEGIN CERTIFICATE-----\n") - keyRe := regexp.MustCompile("^-----BEGIN RSA PRIVATE KEY-----\n") + var conf apigateway.DomainName + resourceName := "aws_api_gateway_domain_name.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDomainNameDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayDomainNameConfig_CertificateName(name, commonName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayDomainNameExists("aws_api_gateway_domain_name.test", &conf), - resource.TestMatchResourceAttr("aws_api_gateway_domain_name.test", "certificate_body", certRe), - resource.TestMatchResourceAttr("aws_api_gateway_domain_name.test", "certificate_chain", certRe), - resource.TestCheckResourceAttr("aws_api_gateway_domain_name.test", "certificate_name", "tf-acc-apigateway-domain-name"), - resource.TestMatchResourceAttr("aws_api_gateway_domain_name.test", "certificate_private_key", keyRe), - resource.TestCheckResourceAttrSet("aws_api_gateway_domain_name.test", "cloudfront_domain_name"), - resource.TestCheckResourceAttr("aws_api_gateway_domain_name.test", "cloudfront_zone_id", "Z2FDTNDATAQYW2"), - resource.TestCheckResourceAttr("aws_api_gateway_domain_name.test", "domain_name", name), - resource.TestCheckResourceAttrSet("aws_api_gateway_domain_name.test", "certificate_upload_date"), - ), - }, - { - Config: testAccAWSAPIGatewayDomainNameConfig_CertificateName(nameModified, commonName), + Config: testAccAWSAPIGatewayDomainNameConfig_CertificateName(domainName, certificatePrivateKey, certificateBody, certificateChain), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayDomainNameExists("aws_api_gateway_domain_name.test", &conf), - resource.TestMatchResourceAttr("aws_api_gateway_domain_name.test", "certificate_body", certRe), - resource.TestMatchResourceAttr("aws_api_gateway_domain_name.test", "certificate_chain", certRe), - resource.TestCheckResourceAttr("aws_api_gateway_domain_name.test", "certificate_name", "tf-acc-apigateway-domain-name"), - resource.TestMatchResourceAttr("aws_api_gateway_domain_name.test", "certificate_private_key", keyRe), - resource.TestCheckResourceAttrSet("aws_api_gateway_domain_name.test", "cloudfront_domain_name"), - resource.TestCheckResourceAttr("aws_api_gateway_domain_name.test", "cloudfront_zone_id", "Z2FDTNDATAQYW2"), - resource.TestCheckResourceAttr("aws_api_gateway_domain_name.test", "domain_name", nameModified), - resource.TestCheckResourceAttrSet("aws_api_gateway_domain_name.test", "certificate_upload_date"), + testAccCheckAWSAPIGatewayDomainNameExists(resourceName, &conf), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/domainnames/+.`)), + resource.TestCheckResourceAttr(resourceName, "certificate_name", "tf-acc-apigateway-domain-name"), + resource.TestCheckResourceAttrSet(resourceName, "cloudfront_domain_name"), + resource.TestCheckResourceAttr(resourceName, "cloudfront_zone_id", "Z2FDTNDATAQYW2"), + resource.TestCheckResourceAttr(resourceName, "domain_name", domainName), + resource.TestCheckResourceAttrSet(resourceName, "certificate_upload_date"), ), }, { - ResourceName: "aws_api_gateway_domain_name.test", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{"certificate_body", "certificate_chain", "certificate_private_key"}, @@ -109,15 +119,19 @@ func TestAccAWSAPIGatewayDomainName_RegionalCertificateArn(t *testing.T) { resourceName := "aws_api_gateway_domain_name.test" rName := fmt.Sprintf("tf-acc-%s.terraformtest.com", acctest.RandString(8)) + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509SelfSignedCertificatePem(key, rName) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDomainNameDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayDomainNameConfig_RegionalCertificateArn(rName), + Config: testAccAWSAPIGatewayDomainNameConfig_RegionalCertificateArn(rName, key, certificate), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayDomainNameExists(resourceName, &domainName), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/domainnames/+.`)), resource.TestCheckResourceAttr(resourceName, "domain_name", rName), resource.TestMatchResourceAttr(resourceName, "regional_domain_name", regexp.MustCompile(`.*\.execute-api\..*`)), resource.TestMatchResourceAttr(resourceName, "regional_zone_id", regexp.MustCompile(`^Z`)), @@ -145,23 +159,26 @@ func TestAccAWSAPIGatewayDomainName_RegionalCertificateName(t *testing.T) { resourceName := "aws_api_gateway_domain_name.test" rName := fmt.Sprintf("tf-acc-%s.terraformtest.com", acctest.RandString(8)) - commonName := "*.terraformtest.com" - certRe := regexp.MustCompile("^-----BEGIN CERTIFICATE-----\n") - keyRe := regexp.MustCompile("^-----BEGIN RSA PRIVATE KEY-----\n") + + caKey := tlsRsaPrivateKeyPem(2048) + caCertificate := tlsRsaX509SelfSignedCaCertificatePem(caKey) + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509LocallySignedCertificatePem(caKey, caCertificate, key, "*.terraformtest.com") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDomainNameDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayDomainNameConfig_RegionalCertificateName(rName, commonName), + Config: testAccAWSAPIGatewayDomainNameConfig_RegionalCertificateName(rName, key, certificate, caCertificate), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayDomainNameExists(resourceName, &domainName), - resource.TestMatchResourceAttr(resourceName, "certificate_body", certRe), - resource.TestMatchResourceAttr(resourceName, "certificate_chain", certRe), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/domainnames/+.`)), + resource.TestCheckResourceAttr(resourceName, "certificate_body", certificate), + resource.TestCheckResourceAttr(resourceName, "certificate_chain", caCertificate), resource.TestCheckResourceAttr(resourceName, "certificate_name", "tf-acc-apigateway-domain-name"), - resource.TestMatchResourceAttr(resourceName, "certificate_private_key", keyRe), + resource.TestCheckResourceAttr(resourceName, "certificate_private_key", key), resource.TestCheckResourceAttrSet(resourceName, "certificate_upload_date"), resource.TestCheckResourceAttr(resourceName, "domain_name", rName), resource.TestMatchResourceAttr(resourceName, "regional_domain_name", regexp.MustCompile(`.*\.execute-api\..*`)), @@ -177,15 +194,19 @@ func TestAccAWSAPIGatewayDomainName_SecurityPolicy(t *testing.T) { resourceName := "aws_api_gateway_domain_name.test" rName := fmt.Sprintf("tf-acc-%s.terraformtest.com", acctest.RandString(8)) + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509SelfSignedCertificatePem(key, rName) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayDomainNameDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayDomainNameConfig_SecurityPolicy(rName, apigateway.SecurityPolicyTls12), + Config: testAccAWSAPIGatewayDomainNameConfig_SecurityPolicy(rName, key, certificate, apigateway.SecurityPolicyTls12), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayDomainNameExists(resourceName, &domainName), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/domainnames/+.`)), resource.TestCheckResourceAttr(resourceName, "security_policy", apigateway.SecurityPolicyTls12), ), }, @@ -198,6 +219,54 @@ func TestAccAWSAPIGatewayDomainName_SecurityPolicy(t *testing.T) { }) } +func TestAccAWSAPIGatewayDomainName_Tags(t *testing.T) { + var domainName apigateway.DomainName + resourceName := "aws_api_gateway_domain_name.test" + rName := fmt.Sprintf("tf-acc-%s.terraformtest.com", acctest.RandString(8)) + + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509SelfSignedCertificatePem(key, rName) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAPIGatewayDomainNameDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAPIGatewayDomainNameConfigTags1(rName, key, certificate, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayDomainNameExists(resourceName, &domainName), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/domainnames/+.`)), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + Config: testAccAWSAPIGatewayDomainNameConfigTags2(rName, key, certificate, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayDomainNameExists(resourceName, &domainName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSAPIGatewayDomainNameConfigTags1(rName, key, certificate, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayDomainNameExists(resourceName, &domainName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func testAccCheckAWSAPIGatewayDomainNameExists(n string, res *apigateway.DomainName) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -254,158 +323,125 @@ func testAccCheckAWSAPIGatewayDomainNameDestroy(s *terraform.State) error { return nil } -func testAccAWSAPIGatewayCerts(commonName string) string { +func testAccAWSAPIGatewayDomainNameConfig_CertificateArn(domainName, certificateArn string) string { return fmt.Sprintf(` -resource "tls_private_key" "test" { - algorithm = "RSA" -} - -resource "tls_self_signed_cert" "ca" { - key_algorithm = "RSA" - private_key_pem = "${tls_private_key.test.private_key_pem}" - is_ca_certificate = true - validity_period_hours = 12 +resource "aws_api_gateway_domain_name" "test" { + domain_name = "%s" + certificate_arn = "%s" - subject { - common_name = "ACME Root CA" - organization = "ACME Example Holdings" + endpoint_configuration { + types = ["EDGE"] } - - allowed_uses = [ - "key_encipherment", - "digital_signature", - "server_auth", - ] } - -resource "tls_cert_request" "test" { - dns_names = [%[1]q] - key_algorithm = "RSA" - private_key_pem = "${tls_private_key.test.private_key_pem}" - - subject { - common_name = %[1]q - organization = "ACME Example Holdings, Inc" - } +`, domainName, certificateArn) } -resource "tls_locally_signed_cert" "leaf" { - cert_request_pem = "${tls_cert_request.test.cert_request_pem}" - ca_key_algorithm = "RSA" - ca_private_key_pem = "${tls_private_key.test.private_key_pem}" - ca_cert_pem = "${tls_self_signed_cert.ca.cert_pem}" - validity_period_hours = 12 - - allowed_uses = [ - "key_encipherment", - "digital_signature", - "server_auth", - ] +func testAccAWSAPIGatewayDomainNameConfig_CertificateName(domainName, key, certificate, chainCertificate string) string { + return fmt.Sprintf(` +resource "aws_api_gateway_domain_name" "test" { + domain_name = "%[1]s" + certificate_body = "%[2]s" + certificate_chain = "%[3]s" + certificate_name = "tf-acc-apigateway-domain-name" + certificate_private_key = "%[4]s" } -`, commonName) +`, domainName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(chainCertificate), tlsPemEscapeNewlines(key)) } -func testAccAWSAPIGatewayDomainNameConfigAcmCertificateBase(commonName string) string { +func testAccAWSAPIGatewayDomainNameConfig_RegionalCertificateArn(domainName, key, certificate string) string { return fmt.Sprintf(` -resource "tls_private_key" "test" { - algorithm = "RSA" +resource "aws_acm_certificate" "test" { + certificate_body = "%[2]s" + private_key = "%[3]s" } -resource "tls_self_signed_cert" "test" { - allowed_uses = [ - "key_encipherment", - "digital_signature", - "server_auth", - ] - - dns_names = [%[1]q] - key_algorithm = "RSA" - private_key_pem = "${tls_private_key.test.private_key_pem}" - validity_period_hours = 12 - - subject { - common_name = %[1]q - organization = "ACME Examples, Inc" - } -} +resource "aws_api_gateway_domain_name" "test" { + domain_name = %[1]q + regional_certificate_arn = "${aws_acm_certificate.test.arn}" -resource "aws_acm_certificate" "test" { - certificate_body = "${tls_self_signed_cert.test.cert_pem}" - private_key = "${tls_private_key.test.private_key_pem}" + endpoint_configuration { + types = ["REGIONAL"] + } } -`, commonName) +`, domainName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key)) } -func testAccAWSAPIGatewayDomainNameConfig_CertificateArn(domainName, certificateArn string) string { +func testAccAWSAPIGatewayDomainNameConfig_RegionalCertificateName(domainName, key, certificate, chainCertificate string) string { return fmt.Sprintf(` resource "aws_api_gateway_domain_name" "test" { - domain_name = "%s" - certificate_arn = "%s" + certificate_body = "%[2]s" + certificate_chain = "%[3]s" + certificate_private_key = "%[4]s" + domain_name = "%[1]s" + regional_certificate_name = "tf-acc-apigateway-domain-name" endpoint_configuration { - types = ["EDGE"] + types = ["REGIONAL"] } } -`, domainName, certificateArn) +`, domainName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(chainCertificate), tlsPemEscapeNewlines(key)) } -func testAccAWSAPIGatewayDomainNameConfig_CertificateName(domainName, commonName string) string { +func testAccAWSAPIGatewayDomainNameConfig_SecurityPolicy(domainName, key, certificate, securityPolicy string) string { return fmt.Sprintf(` -resource "aws_api_gateway_domain_name" "test" { - domain_name = "%s" - certificate_body = "${tls_locally_signed_cert.leaf.cert_pem}" - certificate_chain = "${tls_self_signed_cert.ca.cert_pem}" - certificate_name = "tf-acc-apigateway-domain-name" - certificate_private_key = "${tls_private_key.test.private_key_pem}" -} - -%s - -`, domainName, testAccAWSAPIGatewayCerts(commonName)) +resource "aws_acm_certificate" "test" { + certificate_body = "%[2]s" + private_key = "%[3]s" } -func testAccAWSAPIGatewayDomainNameConfig_RegionalCertificateArn(domainName string) string { - return testAccAWSAPIGatewayDomainNameConfigAcmCertificateBase(domainName) + fmt.Sprintf(` resource "aws_api_gateway_domain_name" "test" { domain_name = %[1]q regional_certificate_arn = "${aws_acm_certificate.test.arn}" + security_policy = %[4]q endpoint_configuration { types = ["REGIONAL"] } } -`, domainName) +`, domainName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key), securityPolicy) } -func testAccAWSAPIGatewayDomainNameConfig_RegionalCertificateName(domainName, commonName string) string { +func testAccAWSAPIGatewayDomainNameConfigTags1(domainName, key, certificate, tagKey1, tagValue1 string) string { return fmt.Sprintf(` +resource "aws_acm_certificate" "test" { + certificate_body = "%[2]s" + private_key = "%[3]s" +} + resource "aws_api_gateway_domain_name" "test" { - certificate_body = "${tls_locally_signed_cert.leaf.cert_pem}" - certificate_chain = "${tls_self_signed_cert.ca.cert_pem}" - certificate_private_key = "${tls_private_key.test.private_key_pem}" - domain_name = "%s" - regional_certificate_name = "tf-acc-apigateway-domain-name" + domain_name = %[1]q + regional_certificate_arn = "${aws_acm_certificate.test.arn}" endpoint_configuration { types = ["REGIONAL"] } -} -%s + tags = { + %[4]q = %[5]q + } +} +`, domainName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key), tagKey1, tagValue1) +} -`, domainName, testAccAWSAPIGatewayCerts(commonName)) +func testAccAWSAPIGatewayDomainNameConfigTags2(domainName, key, certificate, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_acm_certificate" "test" { + certificate_body = "%[2]s" + private_key = "%[3]s" } -func testAccAWSAPIGatewayDomainNameConfig_SecurityPolicy(domainName, securityPolicy string) string { - return testAccAWSAPIGatewayDomainNameConfigAcmCertificateBase(domainName) + fmt.Sprintf(` resource "aws_api_gateway_domain_name" "test" { domain_name = %[1]q regional_certificate_arn = "${aws_acm_certificate.test.arn}" - security_policy = %[2]q endpoint_configuration { types = ["REGIONAL"] } + + tags = { + %[4]q = %[5]q + %[6]q = %[7]q + } } -`, domainName, securityPolicy) +`, domainName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key), tagKey1, tagValue1, tagKey2, tagValue2) } diff --git a/aws/resource_aws_api_gateway_integration_response_test.go b/aws/resource_aws_api_gateway_integration_response_test.go index f8acd3e80f4..025c9c6b70e 100644 --- a/aws/resource_aws_api_gateway_integration_response_test.go +++ b/aws/resource_aws_api_gateway_integration_response_test.go @@ -7,12 +7,15 @@ import ( "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-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) func TestAccAWSAPIGatewayIntegrationResponse_basic(t *testing.T) { var conf apigateway.IntegrationResponse + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(10)) + resourceName := "aws_api_gateway_integration_response.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -20,36 +23,36 @@ func TestAccAWSAPIGatewayIntegrationResponse_basic(t *testing.T) { CheckDestroy: testAccCheckAWSAPIGatewayIntegrationResponseDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayIntegrationResponseConfig, + Config: testAccAWSAPIGatewayIntegrationResponseConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayIntegrationResponseExists("aws_api_gateway_integration_response.test", &conf), + testAccCheckAWSAPIGatewayIntegrationResponseExists(resourceName, &conf), testAccCheckAWSAPIGatewayIntegrationResponseAttributes(&conf), resource.TestCheckResourceAttr( - "aws_api_gateway_integration_response.test", "response_templates.application/json", ""), + resourceName, "response_templates.application/json", ""), resource.TestCheckResourceAttr( - "aws_api_gateway_integration_response.test", "response_templates.application/xml", "#set($inputRoot = $input.path('$'))\n{ }"), + resourceName, "response_templates.application/xml", "#set($inputRoot = $input.path('$'))\n{ }"), resource.TestCheckResourceAttr( - "aws_api_gateway_integration_response.test", "content_handling", ""), + resourceName, "content_handling", ""), ), }, { - Config: testAccAWSAPIGatewayIntegrationResponseConfigUpdate, + Config: testAccAWSAPIGatewayIntegrationResponseConfigUpdate(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayIntegrationResponseExists("aws_api_gateway_integration_response.test", &conf), + testAccCheckAWSAPIGatewayIntegrationResponseExists(resourceName, &conf), testAccCheckAWSAPIGatewayIntegrationResponseAttributesUpdate(&conf), resource.TestCheckResourceAttr( - "aws_api_gateway_integration_response.test", "response_templates.application/json", "$input.path('$')"), + resourceName, "response_templates.application/json", "$input.path('$')"), resource.TestCheckResourceAttr( - "aws_api_gateway_integration_response.test", "response_templates.application/xml", ""), + resourceName, "response_templates.application/xml", ""), resource.TestCheckResourceAttr( - "aws_api_gateway_integration_response.test", "content_handling", "CONVERT_TO_BINARY"), + resourceName, "content_handling", "CONVERT_TO_BINARY"), ), }, { - ResourceName: "aws_api_gateway_integration_response.test", + ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccAWSAPIGatewayIntegrationResponseImportStateIdFunc("aws_api_gateway_integration_response.test"), + ImportStateIdFunc: testAccAWSAPIGatewayIntegrationResponseImportStateIdFunc(resourceName), ImportStateVerify: true, }, }, @@ -174,9 +177,10 @@ func testAccAWSAPIGatewayIntegrationResponseImportStateIdFunc(resourceName strin } } -const testAccAWSAPIGatewayIntegrationResponseConfig = ` +func testAccAWSAPIGatewayIntegrationResponseConfig(rName string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "test" + name = "%s" } resource "aws_api_gateway_resource" "test" { @@ -240,11 +244,13 @@ resource "aws_api_gateway_integration_response" "test" { "method.response.header.Content-Type" = "integration.response.body.type" } } -` +`, rName) +} -const testAccAWSAPIGatewayIntegrationResponseConfigUpdate = ` +func testAccAWSAPIGatewayIntegrationResponseConfigUpdate(rName string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "test" + name = "%s" } resource "aws_api_gateway_resource" "test" { @@ -306,4 +312,5 @@ resource "aws_api_gateway_integration_response" "test" { content_handling = "CONVERT_TO_BINARY" } -` +`, rName) +} diff --git a/aws/resource_aws_api_gateway_integration_test.go b/aws/resource_aws_api_gateway_integration_test.go index ff70b9dd8fc..af760126e0b 100644 --- a/aws/resource_aws_api_gateway_integration_test.go +++ b/aws/resource_aws_api_gateway_integration_test.go @@ -15,6 +15,7 @@ import ( func TestAccAWSAPIGatewayIntegration_basic(t *testing.T) { var conf apigateway.Integration + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(7)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -22,7 +23,7 @@ func TestAccAWSAPIGatewayIntegration_basic(t *testing.T) { CheckDestroy: testAccCheckAWSAPIGatewayIntegrationDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayIntegrationConfig, + Config: testAccAWSAPIGatewayIntegrationConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayIntegrationExists("aws_api_gateway_integration.test", &conf), resource.TestCheckResourceAttr("aws_api_gateway_integration.test", "type", "HTTP"), @@ -42,7 +43,7 @@ func TestAccAWSAPIGatewayIntegration_basic(t *testing.T) { }, { - Config: testAccAWSAPIGatewayIntegrationConfigUpdate, + Config: testAccAWSAPIGatewayIntegrationConfigUpdate(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayIntegrationExists("aws_api_gateway_integration.test", &conf), resource.TestCheckResourceAttr("aws_api_gateway_integration.test", "type", "HTTP"), @@ -62,7 +63,7 @@ func TestAccAWSAPIGatewayIntegration_basic(t *testing.T) { }, { - Config: testAccAWSAPIGatewayIntegrationConfigUpdateURI, + Config: testAccAWSAPIGatewayIntegrationConfigUpdateURI(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayIntegrationExists("aws_api_gateway_integration.test", &conf), resource.TestCheckResourceAttr("aws_api_gateway_integration.test", "type", "HTTP"), @@ -82,7 +83,7 @@ func TestAccAWSAPIGatewayIntegration_basic(t *testing.T) { }, { - Config: testAccAWSAPIGatewayIntegrationConfigUpdateNoTemplates, + Config: testAccAWSAPIGatewayIntegrationConfigUpdateNoTemplates(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayIntegrationExists("aws_api_gateway_integration.test", &conf), resource.TestCheckResourceAttr("aws_api_gateway_integration.test", "type", "HTTP"), @@ -98,7 +99,7 @@ func TestAccAWSAPIGatewayIntegration_basic(t *testing.T) { }, { - Config: testAccAWSAPIGatewayIntegrationConfig, + Config: testAccAWSAPIGatewayIntegrationConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayIntegrationExists("aws_api_gateway_integration.test", &conf), resource.TestCheckResourceAttr("aws_api_gateway_integration.test", "type", "HTTP"), @@ -127,6 +128,7 @@ func TestAccAWSAPIGatewayIntegration_basic(t *testing.T) { func TestAccAWSAPIGatewayIntegration_contentHandling(t *testing.T) { var conf apigateway.Integration + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(7)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -134,7 +136,7 @@ func TestAccAWSAPIGatewayIntegration_contentHandling(t *testing.T) { CheckDestroy: testAccCheckAWSAPIGatewayIntegrationDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayIntegrationConfig, + Config: testAccAWSAPIGatewayIntegrationConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayIntegrationExists("aws_api_gateway_integration.test", &conf), resource.TestCheckResourceAttr("aws_api_gateway_integration.test", "type", "HTTP"), @@ -153,7 +155,7 @@ func TestAccAWSAPIGatewayIntegration_contentHandling(t *testing.T) { }, { - Config: testAccAWSAPIGatewayIntegrationConfigUpdateContentHandling, + Config: testAccAWSAPIGatewayIntegrationConfigUpdateContentHandling(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayIntegrationExists("aws_api_gateway_integration.test", &conf), resource.TestCheckResourceAttr("aws_api_gateway_integration.test", "type", "HTTP"), @@ -170,9 +172,8 @@ func TestAccAWSAPIGatewayIntegration_contentHandling(t *testing.T) { resource.TestCheckResourceAttr("aws_api_gateway_integration.test", "request_templates.application/xml", "#set($inputRoot = $input.path('$'))\n{ }"), ), }, - { - Config: testAccAWSAPIGatewayIntegrationConfigRemoveContentHandling, + Config: testAccAWSAPIGatewayIntegrationConfigRemoveContentHandling(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayIntegrationExists("aws_api_gateway_integration.test", &conf), resource.TestCheckResourceAttr("aws_api_gateway_integration.test", "type", "HTTP"), @@ -201,6 +202,7 @@ func TestAccAWSAPIGatewayIntegration_contentHandling(t *testing.T) { func TestAccAWSAPIGatewayIntegration_cache_key_parameters(t *testing.T) { var conf apigateway.Integration + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(7)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -208,7 +210,7 @@ func TestAccAWSAPIGatewayIntegration_cache_key_parameters(t *testing.T) { CheckDestroy: testAccCheckAWSAPIGatewayIntegrationDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayIntegrationConfigCacheKeyParameters, + Config: testAccAWSAPIGatewayIntegrationConfigCacheKeyParameters(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSAPIGatewayIntegrationExists("aws_api_gateway_integration.test", &conf), resource.TestCheckResourceAttr("aws_api_gateway_integration.test", "type", "HTTP"), @@ -241,8 +243,7 @@ func TestAccAWSAPIGatewayIntegration_cache_key_parameters(t *testing.T) { func TestAccAWSAPIGatewayIntegration_integrationType(t *testing.T) { var conf apigateway.Integration - - rName := fmt.Sprintf("tf-acctest-apigw-int-%s", acctest.RandString(7)) + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(7)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -356,9 +357,10 @@ func testAccAWSAPIGatewayIntegrationImportStateIdFunc(resourceName string) resou } } -const testAccAWSAPIGatewayIntegrationConfig = ` +func testAccAWSAPIGatewayIntegrationConfig(rName string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "test" + name = "%s" } resource "aws_api_gateway_resource" "test" { @@ -399,11 +401,13 @@ resource "aws_api_gateway_integration" "test" { passthrough_behavior = "WHEN_NO_MATCH" content_handling = "CONVERT_TO_TEXT" } -` +`, rName) +} -const testAccAWSAPIGatewayIntegrationConfigUpdate = ` +func testAccAWSAPIGatewayIntegrationConfigUpdate(rName string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "test" + name = "%s" } resource "aws_api_gateway_resource" "test" { @@ -445,11 +449,13 @@ resource "aws_api_gateway_integration" "test" { content_handling = "CONVERT_TO_TEXT" timeout_milliseconds = 2000 } -` +`, rName) +} -const testAccAWSAPIGatewayIntegrationConfigUpdateURI = ` +func testAccAWSAPIGatewayIntegrationConfigUpdateURI(rName string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "test" + name = "%s" } resource "aws_api_gateway_resource" "test" { @@ -491,11 +497,13 @@ resource "aws_api_gateway_integration" "test" { content_handling = "CONVERT_TO_TEXT" timeout_milliseconds = 2000 } -` +`, rName) +} -const testAccAWSAPIGatewayIntegrationConfigUpdateContentHandling = ` +func testAccAWSAPIGatewayIntegrationConfigUpdateContentHandling(rName string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "test" + name = "%s" } resource "aws_api_gateway_resource" "test" { @@ -537,11 +545,13 @@ resource "aws_api_gateway_integration" "test" { content_handling = "CONVERT_TO_BINARY" timeout_milliseconds = 2000 } -` +`, rName) +} -const testAccAWSAPIGatewayIntegrationConfigRemoveContentHandling = ` +func testAccAWSAPIGatewayIntegrationConfigRemoveContentHandling(rName string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "test" + name = "%s" } resource "aws_api_gateway_resource" "test" { @@ -582,11 +592,13 @@ resource "aws_api_gateway_integration" "test" { passthrough_behavior = "WHEN_NO_MATCH" timeout_milliseconds = 2000 } -` +`, rName) +} -const testAccAWSAPIGatewayIntegrationConfigUpdateNoTemplates = ` +func testAccAWSAPIGatewayIntegrationConfigUpdateNoTemplates(rName string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "test" + name = "%s" } resource "aws_api_gateway_resource" "test" { @@ -618,11 +630,13 @@ resource "aws_api_gateway_integration" "test" { content_handling = "CONVERT_TO_TEXT" timeout_milliseconds = 2000 } -` +`, rName) +} -const testAccAWSAPIGatewayIntegrationConfigCacheKeyParameters = ` +func testAccAWSAPIGatewayIntegrationConfigCacheKeyParameters(rName string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "test" + name = "%s" } resource "aws_api_gateway_resource" "test" { @@ -672,7 +686,8 @@ resource "aws_api_gateway_integration" "test" { content_handling = "CONVERT_TO_TEXT" timeout_milliseconds = 2000 } -` +`, rName) +} func testAccAWSAPIGatewayIntegrationConfig_IntegrationTypeBase(rName string) string { return fmt.Sprintf(` diff --git a/aws/resource_aws_api_gateway_method_response_test.go b/aws/resource_aws_api_gateway_method_response_test.go index 056e7142485..f26cef51518 100644 --- a/aws/resource_aws_api_gateway_method_response_test.go +++ b/aws/resource_aws_api_gateway_method_response_test.go @@ -7,12 +7,15 @@ import ( "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-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) func TestAccAWSAPIGatewayMethodResponse_basic(t *testing.T) { var conf apigateway.MethodResponse + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(10)) + resourceName := "aws_api_gateway_method_response.error" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -20,32 +23,32 @@ func TestAccAWSAPIGatewayMethodResponse_basic(t *testing.T) { CheckDestroy: testAccCheckAWSAPIGatewayMethodResponseDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayMethodResponseConfig, + Config: testAccAWSAPIGatewayMethodResponseConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayMethodResponseExists("aws_api_gateway_method_response.error", &conf), + testAccCheckAWSAPIGatewayMethodResponseExists(resourceName, &conf), testAccCheckAWSAPIGatewayMethodResponseAttributes(&conf), resource.TestCheckResourceAttr( - "aws_api_gateway_method_response.error", "status_code", "400"), + resourceName, "status_code", "400"), resource.TestCheckResourceAttr( - "aws_api_gateway_method_response.error", "response_models.application/json", "Error"), + resourceName, "response_models.application/json", "Error"), ), }, { - Config: testAccAWSAPIGatewayMethodResponseConfigUpdate, + Config: testAccAWSAPIGatewayMethodResponseConfigUpdate(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayMethodResponseExists("aws_api_gateway_method_response.error", &conf), + testAccCheckAWSAPIGatewayMethodResponseExists(resourceName, &conf), testAccCheckAWSAPIGatewayMethodResponseAttributesUpdate(&conf), resource.TestCheckResourceAttr( - "aws_api_gateway_method_response.error", "status_code", "400"), + resourceName, "status_code", "400"), resource.TestCheckResourceAttr( - "aws_api_gateway_method_response.error", "response_models.application/json", "Empty"), + resourceName, "response_models.application/json", "Empty"), ), }, { - ResourceName: "aws_api_gateway_method_response.error", + ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccAWSAPIGatewayMethodResponseImportStateIdFunc("aws_api_gateway_method_response.error"), + ImportStateIdFunc: testAccAWSAPIGatewayMethodResponseImportStateIdFunc(resourceName), ImportStateVerify: true, }, }, @@ -169,9 +172,10 @@ func testAccAWSAPIGatewayMethodResponseImportStateIdFunc(resourceName string) re } } -const testAccAWSAPIGatewayMethodResponseConfig = ` +func testAccAWSAPIGatewayMethodResponseConfig(rName string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "test" + name = "%s" } resource "aws_api_gateway_resource" "test" { @@ -205,11 +209,13 @@ resource "aws_api_gateway_method_response" "error" { "method.response.header.Content-Type" = true } } -` +`, rName) +} -const testAccAWSAPIGatewayMethodResponseConfigUpdate = ` +func testAccAWSAPIGatewayMethodResponseConfigUpdate(rName string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "test" + name = "%s" } resource "aws_api_gateway_resource" "test" { @@ -243,4 +249,5 @@ resource "aws_api_gateway_method_response" "error" { "method.response.header.Host" = true } } -` +`, rName) +} diff --git a/aws/resource_aws_api_gateway_method_test.go b/aws/resource_aws_api_gateway_method_test.go index d57c82ff478..0d24127592a 100644 --- a/aws/resource_aws_api_gateway_method_test.go +++ b/aws/resource_aws_api_gateway_method_test.go @@ -387,7 +387,7 @@ resource "aws_lambda_function" "authorizer" { function_name = "tf_acc_api_gateway_authorizer_%d" role = "${aws_iam_role.iam_for_lambda.arn}" handler = "exports.example" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } resource "aws_api_gateway_authorizer" "test" { diff --git a/aws/resource_aws_api_gateway_model_test.go b/aws/resource_aws_api_gateway_model_test.go index 494b81bac79..97edd0a95b4 100644 --- a/aws/resource_aws_api_gateway_model_test.go +++ b/aws/resource_aws_api_gateway_model_test.go @@ -7,12 +7,17 @@ import ( "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-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) func TestAccAWSAPIGatewayModel_basic(t *testing.T) { var conf apigateway.Model + rInt := acctest.RandString(10) + rName := fmt.Sprintf("tf-acc-test-%s", rInt) + modelName := fmt.Sprintf("tfacctest%s", rInt) + resourceName := "aws_api_gateway_model.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -20,31 +25,31 @@ func TestAccAWSAPIGatewayModel_basic(t *testing.T) { CheckDestroy: testAccCheckAWSAPIGatewayModelDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayModelConfig, + Config: testAccAWSAPIGatewayModelConfig(rName, modelName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayModelExists("aws_api_gateway_model.test", &conf), - testAccCheckAWSAPIGatewayModelAttributes(&conf), + testAccCheckAWSAPIGatewayModelExists(resourceName, modelName, &conf), + testAccCheckAWSAPIGatewayModelAttributes(&conf, modelName), resource.TestCheckResourceAttr( - "aws_api_gateway_model.test", "name", "test"), + resourceName, "name", modelName), resource.TestCheckResourceAttr( - "aws_api_gateway_model.test", "description", "a test schema"), + resourceName, "description", "a test schema"), resource.TestCheckResourceAttr( - "aws_api_gateway_model.test", "content_type", "application/json"), + resourceName, "content_type", "application/json"), ), }, { - ResourceName: "aws_api_gateway_model.test", + ResourceName: resourceName, ImportState: true, - ImportStateIdFunc: testAccAWSAPIGatewayModelImportStateIdFunc("aws_api_gateway_model.test"), + ImportStateIdFunc: testAccAWSAPIGatewayModelImportStateIdFunc(resourceName), ImportStateVerify: true, }, }, }) } -func testAccCheckAWSAPIGatewayModelAttributes(conf *apigateway.Model) resource.TestCheckFunc { +func testAccCheckAWSAPIGatewayModelAttributes(conf *apigateway.Model, name string) resource.TestCheckFunc { return func(s *terraform.State) error { - if *conf.Name != "test" { + if *conf.Name != name { return fmt.Errorf("Wrong Name: %q", *conf.Name) } if *conf.Description != "a test schema" { @@ -58,7 +63,7 @@ func testAccCheckAWSAPIGatewayModelAttributes(conf *apigateway.Model) resource.T } } -func testAccCheckAWSAPIGatewayModelExists(n string, res *apigateway.Model) resource.TestCheckFunc { +func testAccCheckAWSAPIGatewayModelExists(n, rName string, res *apigateway.Model) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -72,7 +77,7 @@ func testAccCheckAWSAPIGatewayModelExists(n string, res *apigateway.Model) resou conn := testAccProvider.Meta().(*AWSClient).apigateway req := &apigateway.GetModelInput{ - ModelName: aws.String("test"), + ModelName: aws.String(rName), RestApiId: aws.String(s.RootModule().Resources["aws_api_gateway_rest_api.test"].Primary.ID), } describe, err := conn.GetModel(req) @@ -134,14 +139,15 @@ func testAccAWSAPIGatewayModelImportStateIdFunc(resourceName string) resource.Im } } -const testAccAWSAPIGatewayModelConfig = ` +func testAccAWSAPIGatewayModelConfig(rName, modelName string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "test" + name = "%s" } resource "aws_api_gateway_model" "test" { rest_api_id = "${aws_api_gateway_rest_api.test.id}" - name = "test" + name = "%s" description = "a test schema" content_type = "application/json" schema = < 0 { + m["vpc_endpoint_ids"] = flattenStringList(endpointConfiguration.VpcEndpointIds) + } + return []interface{}{m} } diff --git a/aws/resource_aws_api_gateway_rest_api_test.go b/aws/resource_aws_api_gateway_rest_api_test.go index 649f04d84cc..f9c991d3ab3 100644 --- a/aws/resource_aws_api_gateway_rest_api_test.go +++ b/aws/resource_aws_api_gateway_rest_api_test.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "regexp" "testing" "time" @@ -64,6 +65,8 @@ func testSweepAPIGatewayRestApis(region string) error { func TestAccAWSAPIGatewayRestApi_basic(t *testing.T) { var conf apigateway.RestApi + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -71,51 +74,123 @@ func TestAccAWSAPIGatewayRestApi_basic(t *testing.T) { CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayRestAPIConfig, + Config: testAccAWSAPIGatewayRestAPIConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayRestAPIExists("aws_api_gateway_rest_api.test", &conf), - testAccCheckAWSAPIGatewayRestAPINameAttribute(&conf, "bar"), + testAccCheckAWSAPIGatewayRestAPIExists(resourceName, &conf), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/restapis/+.`)), + testAccCheckAWSAPIGatewayRestAPINameAttribute(&conf, rName), testAccCheckAWSAPIGatewayRestAPIMinimumCompressionSizeAttribute(&conf, 0), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "name", "bar"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "description", ""), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "api_key_source", "HEADER"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "minimum_compression_size", "0"), - resource.TestCheckResourceAttrSet("aws_api_gateway_rest_api.test", "created_date"), - resource.TestCheckResourceAttrSet("aws_api_gateway_rest_api.test", "execution_arn"), - resource.TestCheckNoResourceAttr("aws_api_gateway_rest_api.test", "binary_media_types"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "endpoint_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "description", ""), + resource.TestCheckResourceAttr(resourceName, "api_key_source", "HEADER"), + resource.TestCheckResourceAttr(resourceName, "minimum_compression_size", "0"), + resource.TestCheckResourceAttrSet(resourceName, "created_date"), + resource.TestCheckResourceAttrSet(resourceName, "execution_arn"), + resource.TestCheckNoResourceAttr(resourceName, "binary_media_types"), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.#", "1"), ), }, { - ResourceName: "aws_api_gateway_rest_api.test", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccAWSAPIGatewayRestAPIUpdateConfig, + Config: testAccAWSAPIGatewayRestAPIUpdateConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayRestAPIExists("aws_api_gateway_rest_api.test", &conf), - testAccCheckAWSAPIGatewayRestAPINameAttribute(&conf, "test"), + testAccCheckAWSAPIGatewayRestAPIExists(resourceName, &conf), + testAccCheckAWSAPIGatewayRestAPINameAttribute(&conf, rName), testAccCheckAWSAPIGatewayRestAPIDescriptionAttribute(&conf, "test"), testAccCheckAWSAPIGatewayRestAPIMinimumCompressionSizeAttribute(&conf, 10485760), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "name", "test"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "description", "test"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "minimum_compression_size", "10485760"), - resource.TestCheckResourceAttrSet("aws_api_gateway_rest_api.test", "created_date"), - resource.TestCheckResourceAttrSet("aws_api_gateway_rest_api.test", "execution_arn"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "binary_media_types.#", "1"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "binary_media_types.0", "application/octet-stream"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "description", "test"), + resource.TestCheckResourceAttr(resourceName, "minimum_compression_size", "10485760"), + resource.TestCheckResourceAttrSet(resourceName, "created_date"), + resource.TestCheckResourceAttrSet(resourceName, "execution_arn"), + resource.TestCheckResourceAttr(resourceName, "binary_media_types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "binary_media_types.0", "application/octet-stream"), ), }, { - Config: testAccAWSAPIGatewayRestAPIDisableCompressionConfig, + Config: testAccAWSAPIGatewayRestAPIDisableCompressionConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayRestAPIExists("aws_api_gateway_rest_api.test", &conf), + testAccCheckAWSAPIGatewayRestAPIExists(resourceName, &conf), testAccCheckAWSAPIGatewayRestAPIMinimumCompressionSizeAttributeIsNil(&conf), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "minimum_compression_size", "-1"), + resource.TestCheckResourceAttr(resourceName, "minimum_compression_size", "-1"), + ), + }, + }, + }) +} + +func TestAccAWSAPIGatewayRestApi_tags(t *testing.T) { + var conf apigateway.RestApi + resourceName := "aws_api_gateway_rest_api.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAPIGatewayRestAPIConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayRestAPIExists(resourceName, &conf), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/restapis/+.`)), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + + { + Config: testAccAWSAPIGatewayRestAPIConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayRestAPIExists(resourceName, &conf), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/restapis/+.`)), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + + { + Config: testAccAWSAPIGatewayRestAPIConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayRestAPIExists(resourceName, &conf), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/restapis/+.`)), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + +func TestAccAWSAPIGatewayRestApi_disappears(t *testing.T) { + var restApi apigateway.RestApi + resourceName := "aws_api_gateway_rest_api.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAPIGatewayRestAPIConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayRestAPIExists(resourceName, &restApi), + testAccCheckAWSAPIGatewayRestAPIDisappears(&restApi), ), + ExpectNonEmptyPlan: true, }, }, }) @@ -124,6 +199,7 @@ func TestAccAWSAPIGatewayRestApi_basic(t *testing.T) { func TestAccAWSAPIGatewayRestApi_EndpointConfiguration(t *testing.T) { var restApi apigateway.RestApi rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -133,14 +209,14 @@ func TestAccAWSAPIGatewayRestApi_EndpointConfiguration(t *testing.T) { { Config: testAccAWSAPIGatewayRestAPIConfig_EndpointConfiguration(rName, "REGIONAL"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayRestAPIExists("aws_api_gateway_rest_api.test", &restApi), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "endpoint_configuration.#", "1"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "endpoint_configuration.0.types.#", "1"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "endpoint_configuration.0.types.0", "REGIONAL"), + testAccCheckAWSAPIGatewayRestAPIExists(resourceName, &restApi), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.0.types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.0.types.0", "REGIONAL"), ), }, { - ResourceName: "aws_api_gateway_rest_api.test", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -148,10 +224,10 @@ func TestAccAWSAPIGatewayRestApi_EndpointConfiguration(t *testing.T) { { Config: testAccAWSAPIGatewayRestAPIConfig_Name(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayRestAPIExists("aws_api_gateway_rest_api.test", &restApi), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "endpoint_configuration.#", "1"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "endpoint_configuration.0.types.#", "1"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "endpoint_configuration.0.types.0", "REGIONAL"), + testAccCheckAWSAPIGatewayRestAPIExists(resourceName, &restApi), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.0.types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.0.types.0", "REGIONAL"), ), }, // Test updating endpoint type @@ -185,10 +261,10 @@ func TestAccAWSAPIGatewayRestApi_EndpointConfiguration(t *testing.T) { }, Config: testAccAWSAPIGatewayRestAPIConfig_EndpointConfiguration(rName, "EDGE"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayRestAPIExists("aws_api_gateway_rest_api.test", &restApi), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "endpoint_configuration.#", "1"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "endpoint_configuration.0.types.#", "1"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "endpoint_configuration.0.types.0", "EDGE"), + testAccCheckAWSAPIGatewayRestAPIExists(resourceName, &restApi), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.0.types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.0.types.0", "EDGE"), ), }, }, @@ -198,6 +274,7 @@ func TestAccAWSAPIGatewayRestApi_EndpointConfiguration(t *testing.T) { func TestAccAWSAPIGatewayRestApi_EndpointConfiguration_Private(t *testing.T) { var restApi apigateway.RestApi rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -232,14 +309,68 @@ func TestAccAWSAPIGatewayRestApi_EndpointConfiguration_Private(t *testing.T) { }, Config: testAccAWSAPIGatewayRestAPIConfig_EndpointConfiguration(rName, "PRIVATE"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayRestAPIExists("aws_api_gateway_rest_api.test", &restApi), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "endpoint_configuration.#", "1"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "endpoint_configuration.0.types.#", "1"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "endpoint_configuration.0.types.0", "PRIVATE"), + testAccCheckAWSAPIGatewayRestAPIExists(resourceName, &restApi), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.0.types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.0.types.0", "PRIVATE"), ), }, { - ResourceName: "aws_api_gateway_rest_api.test", + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSAPIGatewayRestApi_EndpointConfiguration_VPCEndpoint(t *testing.T) { + var restApi apigateway.RestApi + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_api_gateway_rest_api.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, + Steps: []resource.TestStep{ + { + PreConfig: func() { + // Ensure region supports PRIVATE endpoint + // This can eventually be moved to a PreCheck function + conn := testAccProvider.Meta().(*AWSClient).apigateway + output, err := conn.CreateRestApi(&apigateway.CreateRestApiInput{ + Name: aws.String(acctest.RandomWithPrefix("tf-acc-test-private-endpoint-precheck")), + EndpointConfiguration: &apigateway.EndpointConfiguration{ + Types: []*string{aws.String("PRIVATE")}, + }, + }) + if err != nil { + if isAWSErr(err, apigateway.ErrCodeBadRequestException, "Endpoint Configuration type PRIVATE is not supported in this region") { + t.Skip("Region does not support PRIVATE endpoint type") + } + t.Fatal(err) + } + + // Be kind and rewind. :) + _, err = conn.DeleteRestApi(&apigateway.DeleteRestApiInput{ + RestApiId: output.Id, + }) + if err != nil { + t.Fatal(err) + } + }, + Config: testAccAWSAPIGatewayRestAPIConfig_VPCEndpointConfiguration(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayRestAPIExists(resourceName, &restApi), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.0.types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.0.types.0", "PRIVATE"), + resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.0.vpc_endpoint_ids.#", "1"), + ), + }, + { + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -250,32 +381,35 @@ func TestAccAWSAPIGatewayRestApi_EndpointConfiguration_Private(t *testing.T) { func TestAccAWSAPIGatewayRestApi_api_key_source(t *testing.T) { expectedAPIKeySource := "HEADER" expectedUpdateAPIKeySource := "AUTHORIZER" + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_api_gateway_rest_api.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayRestAPIConfigWithAPIKeySource, + Config: testAccAWSAPIGatewayRestAPIConfigWithAPIKeySource(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "api_key_source", expectedAPIKeySource), + resource.TestCheckResourceAttr(resourceName, "api_key_source", expectedAPIKeySource), ), }, { - ResourceName: "aws_api_gateway_rest_api.test", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccAWSAPIGatewayRestAPIConfigWithUpdateAPIKeySource, + Config: testAccAWSAPIGatewayRestAPIConfigWithUpdateAPIKeySource(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "api_key_source", expectedUpdateAPIKeySource), + resource.TestCheckResourceAttr(resourceName, "api_key_source", expectedUpdateAPIKeySource), ), }, { - Config: testAccAWSAPIGatewayRestAPIConfig, + Config: testAccAWSAPIGatewayRestAPIConfig(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "api_key_source", expectedAPIKeySource), + resource.TestCheckResourceAttr(resourceName, "api_key_source", expectedAPIKeySource), ), }, }, @@ -283,34 +417,37 @@ func TestAccAWSAPIGatewayRestApi_api_key_source(t *testing.T) { } func TestAccAWSAPIGatewayRestApi_policy(t *testing.T) { + resourceName := "aws_api_gateway_rest_api.test" expectedPolicyText := `{"Version":"2012-10-17","Statement":[{"Effect":"Allow","Principal":{"AWS":"*"},"Action":"execute-api:Invoke","Resource":"*","Condition":{"IpAddress":{"aws:SourceIp":"123.123.123.123/32"}}}]}` expectedUpdatePolicyText := `{"Version":"2012-10-17","Statement":[{"Effect":"Deny","Principal":{"AWS":"*"},"Action":"execute-api:Invoke","Resource":"*"}]}` + rName := acctest.RandomWithPrefix("tf-acc-test") + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayRestAPIConfigWithPolicy, + Config: testAccAWSAPIGatewayRestAPIConfigWithPolicy(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "policy", expectedPolicyText), + resource.TestCheckResourceAttr(resourceName, "policy", expectedPolicyText), ), }, { - ResourceName: "aws_api_gateway_rest_api.test", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { - Config: testAccAWSAPIGatewayRestAPIConfigUpdatePolicy, + Config: testAccAWSAPIGatewayRestAPIConfigUpdatePolicy(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "policy", expectedUpdatePolicyText), + resource.TestCheckResourceAttr(resourceName, "policy", expectedUpdatePolicyText), ), }, { - Config: testAccAWSAPIGatewayRestAPIConfig, + Config: testAccAWSAPIGatewayRestAPIConfig(rName), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "policy", ""), + resource.TestCheckResourceAttr(resourceName, "policy", ""), ), }, }, @@ -319,6 +456,8 @@ func TestAccAWSAPIGatewayRestApi_policy(t *testing.T) { func TestAccAWSAPIGatewayRestApi_openapi(t *testing.T) { var conf apigateway.RestApi + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_api_gateway_rest_api.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -326,33 +465,33 @@ func TestAccAWSAPIGatewayRestApi_openapi(t *testing.T) { CheckDestroy: testAccCheckAWSAPIGatewayRestAPIDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSAPIGatewayRestAPIConfigOpenAPI, + Config: testAccAWSAPIGatewayRestAPIConfigOpenAPI(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayRestAPIExists("aws_api_gateway_rest_api.test", &conf), - testAccCheckAWSAPIGatewayRestAPINameAttribute(&conf, "test"), + testAccCheckAWSAPIGatewayRestAPIExists(resourceName, &conf), + testAccCheckAWSAPIGatewayRestAPINameAttribute(&conf, rName), testAccCheckAWSAPIGatewayRestAPIRoutes(&conf, []string{"/", "/test"}), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "name", "test"), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "description", ""), - resource.TestCheckResourceAttrSet("aws_api_gateway_rest_api.test", "created_date"), - resource.TestCheckResourceAttrSet("aws_api_gateway_rest_api.test", "execution_arn"), - resource.TestCheckNoResourceAttr("aws_api_gateway_rest_api.test", "binary_media_types"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "description", ""), + resource.TestCheckResourceAttrSet(resourceName, "created_date"), + resource.TestCheckResourceAttrSet(resourceName, "execution_arn"), + resource.TestCheckNoResourceAttr(resourceName, "binary_media_types"), ), }, { - ResourceName: "aws_api_gateway_rest_api.test", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{"body"}, }, { - Config: testAccAWSAPIGatewayRestAPIUpdateConfigOpenAPI, + Config: testAccAWSAPIGatewayRestAPIUpdateConfigOpenAPI(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAPIGatewayRestAPIExists("aws_api_gateway_rest_api.test", &conf), - testAccCheckAWSAPIGatewayRestAPINameAttribute(&conf, "test"), + testAccCheckAWSAPIGatewayRestAPIExists(resourceName, &conf), + testAccCheckAWSAPIGatewayRestAPINameAttribute(&conf, rName), testAccCheckAWSAPIGatewayRestAPIRoutes(&conf, []string{"/", "/update"}), - resource.TestCheckResourceAttr("aws_api_gateway_rest_api.test", "name", "test"), - resource.TestCheckResourceAttrSet("aws_api_gateway_rest_api.test", "created_date"), - resource.TestCheckResourceAttrSet("aws_api_gateway_rest_api.test", "execution_arn"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "created_date"), + resource.TestCheckResourceAttrSet(resourceName, "execution_arn"), ), }, }, @@ -362,7 +501,7 @@ func TestAccAWSAPIGatewayRestApi_openapi(t *testing.T) { func testAccCheckAWSAPIGatewayRestAPINameAttribute(conf *apigateway.RestApi, name string) resource.TestCheckFunc { return func(s *terraform.State) error { if *conf.Name != name { - return fmt.Errorf("Wrong Name: %q", *conf.Name) + return fmt.Errorf("Wrong Name: %q instead of %s", *conf.Name, name) } return nil @@ -488,12 +627,28 @@ func testAccCheckAWSAPIGatewayRestAPIDestroy(s *terraform.State) error { return nil } -const testAccAWSAPIGatewayRestAPIConfig = ` +func testAccCheckAWSAPIGatewayRestAPIDisappears(restApi *apigateway.RestApi) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).apigateway + + input := &apigateway.DeleteRestApiInput{ + RestApiId: restApi.Id, + } + + _, err := conn.DeleteRestApi(input) + + return err + } +} + +func testAccAWSAPIGatewayRestAPIConfig(rName string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "bar" + name = "%s" minimum_compression_size = 0 } -` +`, rName) +} func testAccAWSAPIGatewayRestAPIConfig_EndpointConfiguration(rName, endpointType string) string { return fmt.Sprintf(` @@ -515,22 +670,110 @@ resource "aws_api_gateway_rest_api" "test" { `, rName) } -const testAccAWSAPIGatewayRestAPIConfigWithAPIKeySource = ` +func testAccAWSAPIGatewayRestAPIConfig_VPCEndpointConfiguration(rName string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "11.0.0.0/16" + enable_dns_support = true + enable_dns_hostnames = true + + tags = { + Name = %[1]q + } +} + +data "aws_security_group" "test" { + vpc_id = "${aws_vpc.test.id}" + name = "default" +} + +data "aws_availability_zones" "available" {} + +resource "aws_subnet" "test" { + vpc_id = "${aws_vpc.test.id}" + cidr_block = "${aws_vpc.test.cidr_block}" + availability_zone = "${data.aws_availability_zones.available.names[0]}" + + tags = { + Name = %[1]q + } +} + +data "aws_region" "current" {} + +resource "aws_vpc_endpoint" "test" { + vpc_id = "${aws_vpc.test.id}" + service_name = "com.amazonaws.${data.aws_region.current.name}.execute-api" + vpc_endpoint_type = "Interface" + private_dns_enabled = false + + subnet_ids = [ + "${aws_subnet.test.id}", + ] + + security_group_ids = [ + "${data.aws_security_group.test.id}", + ] +} + +resource "aws_api_gateway_rest_api" "test" { + name = %[1]q + + endpoint_configuration { + types = ["PRIVATE"] + vpc_endpoint_ids = ["${aws_vpc_endpoint.test.id}"] + } +} +`, rName) +} + +func testAccAWSAPIGatewayRestAPIConfigTags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_api_gateway_rest_api" "test" { + name = "%s" + + tags = { + %q = %q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccAWSAPIGatewayRestAPIConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "bar" + name = "%s" + + tags = { + %q = %q + %q = %q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + +func testAccAWSAPIGatewayRestAPIConfigWithAPIKeySource(rName string) string { + return fmt.Sprintf(` +resource "aws_api_gateway_rest_api" "test" { + name = "%s" api_key_source = "HEADER" } -` -const testAccAWSAPIGatewayRestAPIConfigWithUpdateAPIKeySource = ` +`, rName) +} + +func testAccAWSAPIGatewayRestAPIConfigWithUpdateAPIKeySource(rName string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "bar" + name = "%s" api_key_source = "AUTHORIZER" } -` +`, rName) +} -const testAccAWSAPIGatewayRestAPIConfigWithPolicy = ` +func testAccAWSAPIGatewayRestAPIConfigWithPolicy(rName string) string { + return fmt.Sprintf(` resource "aws_api_gateway_rest_api" "test" { - name = "bar" + name = "%s" minimum_compression_size = 0 policy = < $context.identity.sourceIp $context.identity.caller $context.identity.user $context.requestTime $context.httpMethod $context.resourcePath $context.status $context.protocol $context.responseLength ` + csv := `$context.identity.sourceIp,$context.identity.caller,$context.identity.user,$context.requestTime,$context.httpMethod,$context.resourcePath,$context.protocol,$context.status,$context.responseLength,$context.requestId` + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAPIGatewayStageDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAPIGatewayStageConfig_accessLogSettingsKinesis(rName, clf), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayStageExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "access_log_settings.#", "1"), + testAccMatchResourceAttrRegionalARN(resourceName, "access_log_settings.0.destination_arn", "firehose", regexp.MustCompile(`deliverystream/amazon-apigateway-.+`)), + resource.TestCheckResourceAttr(resourceName, "access_log_settings.0.format", clf), + ), + }, + + { + Config: testAccAWSAPIGatewayStageConfig_accessLogSettingsKinesis(rName, json), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayStageExists(resourceName, &conf), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/restapis/.+/stages/prod`)), + resource.TestCheckResourceAttr(resourceName, "access_log_settings.#", "1"), + testAccMatchResourceAttrRegionalARN(resourceName, "access_log_settings.0.destination_arn", "firehose", regexp.MustCompile(`deliverystream/amazon-apigateway-.+`)), + resource.TestCheckResourceAttr(resourceName, "access_log_settings.0.format", json), + ), + }, + { + Config: testAccAWSAPIGatewayStageConfig_accessLogSettingsKinesis(rName, xml), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayStageExists(resourceName, &conf), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/restapis/.+/stages/prod`)), + resource.TestCheckResourceAttr(resourceName, "access_log_settings.#", "1"), + testAccMatchResourceAttrRegionalARN(resourceName, "access_log_settings.0.destination_arn", "firehose", regexp.MustCompile(`deliverystream/amazon-apigateway-.+`)), + resource.TestCheckResourceAttr(resourceName, "access_log_settings.0.format", xml), + ), + }, + { + Config: testAccAWSAPIGatewayStageConfig_accessLogSettingsKinesis(rName, csv), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayStageExists(resourceName, &conf), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/restapis/.+/stages/prod`)), + resource.TestCheckResourceAttr(resourceName, "access_log_settings.#", "1"), + testAccMatchResourceAttrRegionalARN(resourceName, "access_log_settings.0.destination_arn", "firehose", regexp.MustCompile(`deliverystream/amazon-apigateway-.+`)), + resource.TestCheckResourceAttr(resourceName, "access_log_settings.0.format", csv), + ), + }, + { + Config: testAccAWSAPIGatewayStageConfig_basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAPIGatewayStageExists(resourceName, &conf), + testAccMatchResourceAttrRegionalARNNoAccount(resourceName, "arn", "apigateway", regexp.MustCompile(`/restapis/.+/stages/prod`)), + resource.TestCheckResourceAttr(resourceName, "access_log_settings.#", "0"), ), }, }, @@ -179,7 +260,7 @@ func testAccCheckAWSAPIGatewayStageDestroy(s *terraform.State) error { if !ok { return err } - if awsErr.Code() != "NotFoundException" { + if awsErr.Code() != apigateway.ErrCodeNotFoundException { return err } @@ -324,3 +405,63 @@ resource "aws_api_gateway_stage" "test" { } `, rName, format) } + +func testAccAWSAPIGatewayStageConfig_accessLogSettingsKinesis(rName string, format string) string { + return testAccAWSAPIGatewayStageConfig_base(rName) + fmt.Sprintf(` +resource "aws_s3_bucket" "test" { + bucket = "%[1]s" + acl = "private" +} + +resource "aws_iam_role" "test" { + name = "%[1]s" + + assume_role_policy = < 0 && vMatch[0] != nil { + mMatch := vMatch[0].(map[string]interface{}) + if v, ok := mMatch["exact"].(string); ok { + buf.WriteString(fmt.Sprintf("%s-", v)) + } + if v, ok := mMatch["prefix"].(string); ok { + buf.WriteString(fmt.Sprintf("%s-", v)) + } + if vRange, ok := mMatch["range"].([]interface{}); ok && len(vRange) > 0 && vRange[0] != nil { + mRange := vRange[0].(map[string]interface{}) + if v, ok := mRange["end"].(int); ok { + buf.WriteString(fmt.Sprintf("%d-", v)) + } + if v, ok := mRange["start"].(int); ok { + buf.WriteString(fmt.Sprintf("%d-", v)) + } + } + if v, ok := mMatch["regex"].(string); ok { + buf.WriteString(fmt.Sprintf("%s-", v)) + } + if v, ok := mMatch["suffix"].(string); ok { + buf.WriteString(fmt.Sprintf("%s-", v)) + } + } + if v, ok := mHttpRouteHeader["name"].(string); ok { + buf.WriteString(fmt.Sprintf("%s-", v)) + } + return hashcode.String(buf.String()) +} + +func appmeshWeightedTargetHash(v interface{}) int { var buf bytes.Buffer m := v.(map[string]interface{}) if v, ok := m["virtual_node"].(string); ok { diff --git a/aws/resource_aws_appmesh_route_test.go b/aws/resource_aws_appmesh_route_test.go index 89d5e8c54f3..443b30bd0d0 100644 --- a/aws/resource_aws_appmesh_route_test.go +++ b/aws/resource_aws_appmesh_route_test.go @@ -3,7 +3,6 @@ package aws import ( "fmt" "log" - "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -102,12 +101,12 @@ func testSweepAppmeshRoutes(region string) error { func testAccAwsAppmeshRoute_httpRoute(t *testing.T) { var r appmesh.RouteData - resourceName := "aws_appmesh_route.foo" - meshName := fmt.Sprintf("tf-test-mesh-%d", acctest.RandInt()) - vrName := fmt.Sprintf("tf-test-router-%d", acctest.RandInt()) - vn1Name := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) - vn2Name := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) - rName := fmt.Sprintf("tf-test-route-%d", acctest.RandInt()) + resourceName := "aws_appmesh_route.test" + meshName := acctest.RandomWithPrefix("tf-acc-test") + vrName := acctest.RandomWithPrefix("tf-acc-test") + vn1Name := acctest.RandomWithPrefix("tf-acc-test") + vn2Name := acctest.RandomWithPrefix("tf-acc-test") + rName := acctest.RandomWithPrefix("tf-acc-test") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -126,10 +125,15 @@ func testAccAwsAppmeshRoute_httpRoute(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.action.#", "1"), resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.action.0.weighted_target.#", "1"), resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.#", "0"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.method", ""), resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.prefix", "/"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.scheme", ""), + resource.TestCheckResourceAttr(resourceName, "spec.0.priority", "0"), + resource.TestCheckResourceAttr(resourceName, "spec.0.tcp_route.#", "0"), resource.TestCheckResourceAttrSet(resourceName, "created_date"), resource.TestCheckResourceAttrSet(resourceName, "last_updated_date"), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:appmesh:[^:]+:\\d{12}:mesh/%s/virtualRouter/%s/route/%s", meshName, vrName, rName))), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "appmesh", fmt.Sprintf("mesh/%s/virtualRouter/%s/route/%s", meshName, vrName, rName)), ), }, { @@ -144,15 +148,20 @@ func testAccAwsAppmeshRoute_httpRoute(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.action.#", "1"), resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.action.0.weighted_target.#", "2"), resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.#", "0"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.method", ""), resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.prefix", "/path"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.scheme", ""), + resource.TestCheckResourceAttr(resourceName, "spec.0.priority", "0"), + resource.TestCheckResourceAttr(resourceName, "spec.0.tcp_route.#", "0"), resource.TestCheckResourceAttrSet(resourceName, "created_date"), resource.TestCheckResourceAttrSet(resourceName, "last_updated_date"), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:appmesh:[^:]+:\\d{12}:mesh/%s/virtualRouter/%s/route/%s", meshName, vrName, rName))), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "appmesh", fmt.Sprintf("mesh/%s/virtualRouter/%s/route/%s", meshName, vrName, rName)), ), }, { ResourceName: resourceName, - ImportStateId: fmt.Sprintf("%s/%s/%s", meshName, vrName, rName), + ImportStateIdFunc: testAccAwsAppmeshRouteImportStateIdFunc(resourceName), ImportState: true, ImportStateVerify: true, }, @@ -162,12 +171,12 @@ func testAccAwsAppmeshRoute_httpRoute(t *testing.T) { func testAccAwsAppmeshRoute_tcpRoute(t *testing.T) { var r appmesh.RouteData - resourceName := "aws_appmesh_route.foo" - meshName := fmt.Sprintf("tf-test-mesh-%d", acctest.RandInt()) - vrName := fmt.Sprintf("tf-test-router-%d", acctest.RandInt()) - vn1Name := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) - vn2Name := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) - rName := fmt.Sprintf("tf-test-route-%d", acctest.RandInt()) + resourceName := "aws_appmesh_route.test" + meshName := acctest.RandomWithPrefix("tf-acc-test") + vrName := acctest.RandomWithPrefix("tf-acc-test") + vn1Name := acctest.RandomWithPrefix("tf-acc-test") + vn2Name := acctest.RandomWithPrefix("tf-acc-test") + rName := acctest.RandomWithPrefix("tf-acc-test") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -182,12 +191,14 @@ func testAccAwsAppmeshRoute_tcpRoute(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "mesh_name", meshName), resource.TestCheckResourceAttr(resourceName, "virtual_router_name", vrName), resource.TestCheckResourceAttr(resourceName, "spec.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.#", "0"), + resource.TestCheckResourceAttr(resourceName, "spec.0.priority", "0"), resource.TestCheckResourceAttr(resourceName, "spec.0.tcp_route.#", "1"), resource.TestCheckResourceAttr(resourceName, "spec.0.tcp_route.0.action.#", "1"), resource.TestCheckResourceAttr(resourceName, "spec.0.tcp_route.0.action.0.weighted_target.#", "1"), resource.TestCheckResourceAttrSet(resourceName, "created_date"), resource.TestCheckResourceAttrSet(resourceName, "last_updated_date"), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:appmesh:[^:]+:\\d{12}:mesh/%s/virtualRouter/%s/route/%s", meshName, vrName, rName))), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "appmesh", fmt.Sprintf("mesh/%s/virtualRouter/%s/route/%s", meshName, vrName, rName)), ), }, { @@ -198,17 +209,19 @@ func testAccAwsAppmeshRoute_tcpRoute(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "mesh_name", meshName), resource.TestCheckResourceAttr(resourceName, "virtual_router_name", vrName), resource.TestCheckResourceAttr(resourceName, "spec.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.#", "0"), + resource.TestCheckResourceAttr(resourceName, "spec.0.priority", "0"), resource.TestCheckResourceAttr(resourceName, "spec.0.tcp_route.#", "1"), resource.TestCheckResourceAttr(resourceName, "spec.0.tcp_route.0.action.#", "1"), resource.TestCheckResourceAttr(resourceName, "spec.0.tcp_route.0.action.0.weighted_target.#", "2"), resource.TestCheckResourceAttrSet(resourceName, "created_date"), resource.TestCheckResourceAttrSet(resourceName, "last_updated_date"), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:appmesh:[^:]+:\\d{12}:mesh/%s/virtualRouter/%s/route/%s", meshName, vrName, rName))), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "appmesh", fmt.Sprintf("mesh/%s/virtualRouter/%s/route/%s", meshName, vrName, rName)), ), }, { ResourceName: resourceName, - ImportStateId: fmt.Sprintf("%s/%s/%s", meshName, vrName, rName), + ImportStateIdFunc: testAccAwsAppmeshRouteImportStateIdFunc(resourceName), ImportState: true, ImportStateVerify: true, }, @@ -218,12 +231,12 @@ func testAccAwsAppmeshRoute_tcpRoute(t *testing.T) { func testAccAwsAppmeshRoute_tags(t *testing.T) { var r appmesh.RouteData - resourceName := "aws_appmesh_route.foo" - meshName := fmt.Sprintf("tf-test-mesh-%d", acctest.RandInt()) - vrName := fmt.Sprintf("tf-test-router-%d", acctest.RandInt()) - vn1Name := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) - vn2Name := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) - rName := fmt.Sprintf("tf-test-route-%d", acctest.RandInt()) + resourceName := "aws_appmesh_route.test" + meshName := acctest.RandomWithPrefix("tf-acc-test") + vrName := acctest.RandomWithPrefix("tf-acc-test") + vn1Name := acctest.RandomWithPrefix("tf-acc-test") + vn2Name := acctest.RandomWithPrefix("tf-acc-test") + rName := acctest.RandomWithPrefix("tf-acc-test") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -264,7 +277,7 @@ func testAccAwsAppmeshRoute_tags(t *testing.T) { }, { ResourceName: resourceName, - ImportStateId: fmt.Sprintf("%s/%s/%s", meshName, vrName, rName), + ImportStateIdFunc: testAccAwsAppmeshRouteImportStateIdFunc(resourceName), ImportState: true, ImportStateVerify: true, }, @@ -272,6 +285,173 @@ func testAccAwsAppmeshRoute_tags(t *testing.T) { }) } +func testAccAwsAppmeshRoute_httpHeader(t *testing.T) { + var r appmesh.RouteData + resourceName := "aws_appmesh_route.test" + meshName := acctest.RandomWithPrefix("tf-acc-test") + vrName := acctest.RandomWithPrefix("tf-acc-test") + vn1Name := acctest.RandomWithPrefix("tf-acc-test") + vn2Name := acctest.RandomWithPrefix("tf-acc-test") + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAppmeshRouteDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsAppmeshRouteConfig_httpHeader(meshName, vrName, vn1Name, vn2Name, rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAppmeshRouteExists(resourceName, &r), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "mesh_name", meshName), + resource.TestCheckResourceAttr(resourceName, "virtual_router_name", vrName), + resource.TestCheckResourceAttr(resourceName, "spec.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.action.0.weighted_target.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.2366200004.invert", "false"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.2366200004.match.#", "0"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.2366200004.name", "X-Testing1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.method", "POST"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.prefix", "/"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.scheme", "http"), + resource.TestCheckResourceAttr(resourceName, "spec.0.priority", "0"), + resource.TestCheckResourceAttr(resourceName, "spec.0.tcp_route.#", "0"), + resource.TestCheckResourceAttrSet(resourceName, "created_date"), + resource.TestCheckResourceAttrSet(resourceName, "last_updated_date"), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "appmesh", fmt.Sprintf("mesh/%s/virtualRouter/%s/route/%s", meshName, vrName, rName)), + ), + }, + { + Config: testAccAwsAppmeshRouteConfig_httpHeaderUpdated(meshName, vrName, vn1Name, vn2Name, rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAppmeshRouteExists(resourceName, &r), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "mesh_name", meshName), + resource.TestCheckResourceAttr(resourceName, "virtual_router_name", vrName), + resource.TestCheckResourceAttr(resourceName, "spec.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.action.0.weighted_target.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.#", "2"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.2971741486.invert", "true"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.2971741486.match.#", "0"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.2971741486.name", "X-Testing1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.3147536248.invert", "false"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.3147536248.match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.3147536248.match.0.exact", ""), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.3147536248.match.0.prefix", ""), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.3147536248.match.0.range.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.3147536248.match.0.range.0.end", "7"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.3147536248.match.0.range.0.start", "2"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.3147536248.match.0.regex", ""), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.3147536248.match.0.suffix", ""), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.3147536248.name", "X-Testing2"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.method", "PUT"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.prefix", "/path"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.scheme", "https"), + resource.TestCheckResourceAttr(resourceName, "spec.0.priority", "0"), + resource.TestCheckResourceAttr(resourceName, "spec.0.tcp_route.#", "0"), + resource.TestCheckResourceAttrSet(resourceName, "created_date"), + resource.TestCheckResourceAttrSet(resourceName, "last_updated_date"), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "appmesh", fmt.Sprintf("mesh/%s/virtualRouter/%s/route/%s", meshName, vrName, rName)), + ), + }, + { + ResourceName: resourceName, + ImportStateIdFunc: testAccAwsAppmeshRouteImportStateIdFunc(resourceName), + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccAwsAppmeshRoute_routePriority(t *testing.T) { + var r appmesh.RouteData + resourceName := "aws_appmesh_route.test" + meshName := acctest.RandomWithPrefix("tf-acc-test") + vrName := acctest.RandomWithPrefix("tf-acc-test") + vn1Name := acctest.RandomWithPrefix("tf-acc-test") + vn2Name := acctest.RandomWithPrefix("tf-acc-test") + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAppmeshRouteDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsAppmeshRouteConfig_routePriority(meshName, vrName, vn1Name, vn2Name, rName, 42), + Check: resource.ComposeTestCheckFunc( + testAccCheckAppmeshRouteExists(resourceName, &r), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "mesh_name", meshName), + resource.TestCheckResourceAttr(resourceName, "virtual_router_name", vrName), + resource.TestCheckResourceAttr(resourceName, "spec.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.action.0.weighted_target.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.#", "0"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.method", ""), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.prefix", "/"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.scheme", ""), + resource.TestCheckResourceAttr(resourceName, "spec.0.priority", "42"), + resource.TestCheckResourceAttr(resourceName, "spec.0.tcp_route.#", "0"), + resource.TestCheckResourceAttrSet(resourceName, "created_date"), + resource.TestCheckResourceAttrSet(resourceName, "last_updated_date"), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "appmesh", fmt.Sprintf("mesh/%s/virtualRouter/%s/route/%s", meshName, vrName, rName)), + ), + }, + { + Config: testAccAwsAppmeshRouteConfig_routePriority(meshName, vrName, vn1Name, vn2Name, rName, 1000), + Check: resource.ComposeTestCheckFunc( + testAccCheckAppmeshRouteExists(resourceName, &r), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "mesh_name", meshName), + resource.TestCheckResourceAttr(resourceName, "virtual_router_name", vrName), + resource.TestCheckResourceAttr(resourceName, "spec.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.action.0.weighted_target.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.header.#", "0"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.method", ""), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.prefix", "/"), + resource.TestCheckResourceAttr(resourceName, "spec.0.http_route.0.match.0.scheme", ""), + resource.TestCheckResourceAttr(resourceName, "spec.0.priority", "1000"), + resource.TestCheckResourceAttr(resourceName, "spec.0.tcp_route.#", "0"), + resource.TestCheckResourceAttrSet(resourceName, "created_date"), + resource.TestCheckResourceAttrSet(resourceName, "last_updated_date"), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "appmesh", fmt.Sprintf("mesh/%s/virtualRouter/%s/route/%s", meshName, vrName, rName)), + ), + }, + { + ResourceName: resourceName, + ImportStateIdFunc: testAccAwsAppmeshRouteImportStateIdFunc(resourceName), + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccAwsAppmeshRouteImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return "", fmt.Errorf("Not Found: %s", resourceName) + } + + return fmt.Sprintf("%s/%s/%s", rs.Primary.Attributes["mesh_name"], rs.Primary.Attributes["virtual_router_name"], rs.Primary.Attributes["name"]), nil + } +} + func testAccCheckAppmeshRouteDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).appmeshconn @@ -326,47 +506,46 @@ func testAccCheckAppmeshRouteExists(name string, v *appmesh.RouteData) resource. func testAccAppmeshRouteConfigBase(meshName, vrName, vn1Name, vn2Name string) string { return fmt.Sprintf(` -resource "aws_appmesh_mesh" "foo" { - name = %[1]q +resource "aws_appmesh_mesh" "test" { + name = %[1]q } -resource "aws_appmesh_virtual_router" "foo" { - name = %[2]q - mesh_name = "${aws_appmesh_mesh.foo.id}" +resource "aws_appmesh_virtual_router" "test" { + name = %[2]q + mesh_name = "${aws_appmesh_mesh.test.id}" - spec { - listener { - port_mapping { - port = 8080 - protocol = "http" - } - } - } + spec { + listener { + port_mapping { + port = 8080 + protocol = "http" + } + } + } } resource "aws_appmesh_virtual_node" "foo" { - name = %[3]q - mesh_name = "${aws_appmesh_mesh.foo.id}" + name = %[3]q + mesh_name = "${aws_appmesh_mesh.test.id}" - spec {} + spec {} } resource "aws_appmesh_virtual_node" "bar" { - name = %[4]q - mesh_name = "${aws_appmesh_mesh.foo.id}" + name = %[4]q + mesh_name = "${aws_appmesh_mesh.test.id}" - spec {} + spec {} } `, meshName, vrName, vn1Name, vn2Name) } func testAccAppmeshRouteConfig_httpRoute(meshName, vrName, vn1Name, vn2Name, rName string) string { return testAccAppmeshRouteConfigBase(meshName, vrName, vn1Name, vn2Name) + fmt.Sprintf(` - -resource "aws_appmesh_route" "foo" { +resource "aws_appmesh_route" "test" { name = %[1]q - mesh_name = "${aws_appmesh_mesh.foo.id}" - virtual_router_name = "${aws_appmesh_virtual_router.foo.name}" + mesh_name = "${aws_appmesh_mesh.test.id}" + virtual_router_name = "${aws_appmesh_virtual_router.test.name}" spec { http_route { @@ -388,11 +567,10 @@ resource "aws_appmesh_route" "foo" { func testAccAppmeshRouteConfig_httpRouteUpdated(meshName, vrName, vn1Name, vn2Name, rName string) string { return testAccAppmeshRouteConfigBase(meshName, vrName, vn1Name, vn2Name) + fmt.Sprintf(` - -resource "aws_appmesh_route" "foo" { +resource "aws_appmesh_route" "test" { name = %[1]q - mesh_name = "${aws_appmesh_mesh.foo.id}" - virtual_router_name = "${aws_appmesh_virtual_router.foo.name}" + mesh_name = "${aws_appmesh_mesh.test.id}" + virtual_router_name = "${aws_appmesh_virtual_router.test.name}" spec { http_route { @@ -419,11 +597,10 @@ resource "aws_appmesh_route" "foo" { func testAccAppmeshRouteConfig_tcpRoute(meshName, vrName, vn1Name, vn2Name, rName string) string { return testAccAppmeshRouteConfigBase(meshName, vrName, vn1Name, vn2Name) + fmt.Sprintf(` - -resource "aws_appmesh_route" "foo" { +resource "aws_appmesh_route" "test" { name = %[1]q - mesh_name = "${aws_appmesh_mesh.foo.id}" - virtual_router_name = "${aws_appmesh_virtual_router.foo.name}" + mesh_name = "${aws_appmesh_mesh.test.id}" + virtual_router_name = "${aws_appmesh_virtual_router.test.name}" spec { tcp_route { @@ -441,11 +618,10 @@ resource "aws_appmesh_route" "foo" { func testAccAppmeshRouteConfig_tcpRouteUpdated(meshName, vrName, vn1Name, vn2Name, rName string) string { return testAccAppmeshRouteConfigBase(meshName, vrName, vn1Name, vn2Name) + fmt.Sprintf(` - -resource "aws_appmesh_route" "foo" { +resource "aws_appmesh_route" "test" { name = %[1]q - mesh_name = "${aws_appmesh_mesh.foo.id}" - virtual_router_name = "${aws_appmesh_virtual_router.foo.name}" + mesh_name = "${aws_appmesh_mesh.test.id}" + virtual_router_name = "${aws_appmesh_virtual_router.test.name}" spec { tcp_route { @@ -468,11 +644,10 @@ resource "aws_appmesh_route" "foo" { func testAccAppmeshRouteConfigWithTags(meshName, vrName, vn1Name, vn2Name, rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { return testAccAppmeshRouteConfigBase(meshName, vrName, vn1Name, vn2Name) + fmt.Sprintf(` - -resource "aws_appmesh_route" "foo" { +resource "aws_appmesh_route" "test" { name = %[1]q - mesh_name = "${aws_appmesh_mesh.foo.id}" - virtual_router_name = "${aws_appmesh_virtual_router.foo.name}" + mesh_name = "${aws_appmesh_mesh.test.id}" + virtual_router_name = "${aws_appmesh_virtual_router.test.name}" spec { http_route { @@ -490,9 +665,111 @@ resource "aws_appmesh_route" "foo" { } tags = { - %[2]s = %[3]q - %[4]s = %[5]q + %[2]s = %[3]q + %[4]s = %[5]q } } `, rName, tagKey1, tagValue1, tagKey2, tagValue2) } + +func testAccAwsAppmeshRouteConfig_httpHeader(meshName, vrName, vn1Name, vn2Name, rName string) string { + return testAccAppmeshRouteConfigBase(meshName, vrName, vn1Name, vn2Name) + fmt.Sprintf(` +resource "aws_appmesh_route" "test" { + name = %[1]q + mesh_name = "${aws_appmesh_mesh.test.id}" + virtual_router_name = "${aws_appmesh_virtual_router.test.name}" + + spec { + http_route { + match { + prefix = "/" + method = "POST" + scheme = "http" + + header { + name = "X-Testing1" + } + } + + action { + weighted_target { + virtual_node = "${aws_appmesh_virtual_node.foo.name}" + weight = 100 + } + } + } + } +} +`, rName) +} + +func testAccAwsAppmeshRouteConfig_httpHeaderUpdated(meshName, vrName, vn1Name, vn2Name, rName string) string { + return testAccAppmeshRouteConfigBase(meshName, vrName, vn1Name, vn2Name) + fmt.Sprintf(` +resource "aws_appmesh_route" "test" { + name = %[1]q + mesh_name = "${aws_appmesh_mesh.test.id}" + virtual_router_name = "${aws_appmesh_virtual_router.test.name}" + + spec { + http_route { + match { + prefix = "/path" + method = "PUT" + scheme = "https" + + header { + name = "X-Testing1" + invert = true + } + + header { + name = "X-Testing2" + invert = false + + match { + range { + start = 2 + end = 7 + } + } + } + } + + action { + weighted_target { + virtual_node = "${aws_appmesh_virtual_node.foo.name}" + weight = 100 + } + } + } + } +} +`, rName) +} + +func testAccAwsAppmeshRouteConfig_routePriority(meshName, vrName, vn1Name, vn2Name, rName string, priority int) string { + return testAccAppmeshRouteConfigBase(meshName, vrName, vn1Name, vn2Name) + fmt.Sprintf(` +resource "aws_appmesh_route" "test" { + name = %[1]q + mesh_name = "${aws_appmesh_mesh.test.id}" + virtual_router_name = "${aws_appmesh_virtual_router.test.name}" + + spec { + http_route { + match { + prefix = "/" + } + + action { + weighted_target { + virtual_node = "${aws_appmesh_virtual_node.foo.name}" + weight = 100 + } + } + } + + priority = %[2]d + } +} +`, rName, priority) +} diff --git a/aws/resource_aws_appmesh_test.go b/aws/resource_aws_appmesh_test.go index bc26eadbc17..86bb8a44f76 100644 --- a/aws/resource_aws_appmesh_test.go +++ b/aws/resource_aws_appmesh_test.go @@ -12,9 +12,11 @@ func TestAccAWSAppmesh(t *testing.T) { "tags": testAccAwsAppmeshMesh_tags, }, "Route": { - "httpRoute": testAccAwsAppmeshRoute_httpRoute, - "tcpRoute": testAccAwsAppmeshRoute_tcpRoute, - "tags": testAccAwsAppmeshRoute_tags, + "httpHeader": testAccAwsAppmeshRoute_httpHeader, + "httpRoute": testAccAwsAppmeshRoute_httpRoute, + "tcpRoute": testAccAwsAppmeshRoute_tcpRoute, + "routePriority": testAccAwsAppmeshRoute_routePriority, + "tags": testAccAwsAppmeshRoute_tags, }, "VirtualNode": { "basic": testAccAwsAppmeshVirtualNode_basic, diff --git a/aws/resource_aws_appmesh_virtual_node.go b/aws/resource_aws_appmesh_virtual_node.go index fdabb951904..69fdc3e881c 100644 --- a/aws/resource_aws_appmesh_virtual_node.go +++ b/aws/resource_aws_appmesh_virtual_node.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsAppmeshVirtualNode() *schema.Resource { @@ -235,12 +236,13 @@ func resourceAwsAppmeshVirtualNode() *schema.Resource { "namespace_name": { Type: schema.TypeString, Required: true, - ValidateFunc: validateServiceDiscoveryHttpNamespaceName, + ValidateFunc: validation.StringLenBetween(1, 1024), }, "service_name": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringLenBetween(1, 1024), }, }, }, @@ -303,7 +305,7 @@ func resourceAwsAppmeshVirtualNodeCreate(d *schema.ResourceData, meta interface{ MeshName: aws.String(d.Get("mesh_name").(string)), VirtualNodeName: aws.String(d.Get("name").(string)), Spec: expandAppmeshVirtualNodeSpec(d.Get("spec").([]interface{})), - Tags: tagsFromMapAppmesh(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().AppmeshTags(), } log.Printf("[DEBUG] Creating App Mesh virtual node: %#v", req) @@ -338,9 +340,10 @@ func resourceAwsAppmeshVirtualNodeRead(d *schema.ResourceData, meta interface{}) return nil } + arn := aws.StringValue(resp.VirtualNode.Metadata.Arn) d.Set("name", resp.VirtualNode.VirtualNodeName) d.Set("mesh_name", resp.VirtualNode.MeshName) - d.Set("arn", resp.VirtualNode.Metadata.Arn) + d.Set("arn", arn) d.Set("created_date", resp.VirtualNode.Metadata.CreatedAt.Format(time.RFC3339)) d.Set("last_updated_date", resp.VirtualNode.Metadata.LastUpdatedAt.Format(time.RFC3339)) err = d.Set("spec", flattenAppmeshVirtualNodeSpec(resp.VirtualNode.Spec)) @@ -348,14 +351,14 @@ func resourceAwsAppmeshVirtualNodeRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("error setting spec: %s", err) } - err = saveTagsAppmesh(conn, d, aws.StringValue(resp.VirtualNode.Metadata.Arn)) - if isAWSErr(err, appmesh.ErrCodeNotFoundException, "") { - log.Printf("[WARN] App Mesh virtual node (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } + tags, err := keyvaluetags.AppmeshListTags(conn, arn) + if err != nil { - return fmt.Errorf("error saving tags: %s", err) + return fmt.Errorf("error listing tags for App Mesh virtual node (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -379,14 +382,13 @@ func resourceAwsAppmeshVirtualNodeUpdate(d *schema.ResourceData, meta interface{ } } - err := setTagsAppmesh(conn, d, d.Get("arn").(string)) - if isAWSErr(err, appmesh.ErrCodeNotFoundException, "") { - log.Printf("[WARN] App Mesh virtual node (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - if err != nil { - return fmt.Errorf("error setting tags: %s", err) + arn := d.Get("arn").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.AppmeshUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating App Mesh virtual node (%s) tags: %s", arn, err) + } } return resourceAwsAppmeshVirtualNodeRead(d, meta) diff --git a/aws/resource_aws_appmesh_virtual_node_test.go b/aws/resource_aws_appmesh_virtual_node_test.go index c0fb70fe93a..f6ea0eac6f5 100644 --- a/aws/resource_aws_appmesh_virtual_node_test.go +++ b/aws/resource_aws_appmesh_virtual_node_test.go @@ -2,7 +2,7 @@ package aws import ( "fmt" - "regexp" + "log" "testing" "github.com/aws/aws-sdk-go/aws" @@ -12,11 +12,77 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) +func init() { + resource.AddTestSweepers("aws_appmesh_virtual_node", &resource.Sweeper{ + Name: "aws_appmesh_virtual_node", + F: testSweepAppmeshVirtualNodes, + }) +} + +func testSweepAppmeshVirtualNodes(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + conn := client.(*AWSClient).appmeshconn + + err = conn.ListMeshesPages(&appmesh.ListMeshesInput{}, func(page *appmesh.ListMeshesOutput, isLast bool) bool { + if page == nil { + return !isLast + } + + for _, mesh := range page.Meshes { + listVirtualNodesInput := &appmesh.ListVirtualNodesInput{ + MeshName: mesh.MeshName, + } + meshName := aws.StringValue(mesh.MeshName) + + err := conn.ListVirtualNodesPages(listVirtualNodesInput, func(page *appmesh.ListVirtualNodesOutput, isLast bool) bool { + if page == nil { + return !isLast + } + + for _, virtualNode := range page.VirtualNodes { + input := &appmesh.DeleteVirtualNodeInput{ + MeshName: mesh.MeshName, + VirtualNodeName: virtualNode.VirtualNodeName, + } + virtualNodeName := aws.StringValue(virtualNode.VirtualNodeName) + + log.Printf("[INFO] Deleting Appmesh Mesh (%s) Virtual Node: %s", meshName, virtualNodeName) + _, err := conn.DeleteVirtualNode(input) + + if err != nil { + log.Printf("[ERROR] Error deleting Appmesh Mesh (%s) Virtual Node (%s): %s", meshName, virtualNodeName, err) + } + } + + return !isLast + }) + + if err != nil { + log.Printf("[ERROR] Error retrieving Appmesh Mesh (%s) Virtual Nodes: %s", meshName, err) + } + } + + return !isLast + }) + if err != nil { + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping Appmesh Virtual Node sweep for %s: %s", region, err) + return nil + } + return fmt.Errorf("error retrieving Appmesh Virtual Nodes: %s", err) + } + + return nil +} + func testAccAwsAppmeshVirtualNode_basic(t *testing.T) { var vn appmesh.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" - meshName := fmt.Sprintf("tf-test-mesh-%d", acctest.RandInt()) - vnName := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) + meshName := acctest.RandomWithPrefix("tf-acc-test") + vnName := acctest.RandomWithPrefix("tf-acc-test") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -36,7 +102,7 @@ func testAccAwsAppmeshVirtualNode_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "spec.0.service_discovery.#", "0"), resource.TestCheckResourceAttrSet(resourceName, "created_date"), resource.TestCheckResourceAttrSet(resourceName, "last_updated_date"), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:appmesh:[^:]+:\\d{12}:mesh/%s/virtualNode/%s", meshName, vnName))), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "appmesh", fmt.Sprintf("mesh/%s/virtualNode/%s", meshName, vnName)), ), }, { @@ -53,9 +119,10 @@ func testAccAwsAppmeshVirtualNode_cloudMapServiceDiscovery(t *testing.T) { var vn appmesh.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" nsResourceName := "aws_service_discovery_http_namespace.test" - meshName := fmt.Sprintf("tf-test-mesh-%d", acctest.RandInt()) - vnName := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) - rName := fmt.Sprintf("tf-testacc-appmeshvn-%s", acctest.RandStringFromCharSet(11, acctest.CharSetAlphaNum)) + meshName := acctest.RandomWithPrefix("tf-acc-test") + vnName := acctest.RandomWithPrefix("tf-acc-test") + // Avoid 'config is invalid: last character of "name" must be a letter' for aws_service_discovery_http_namespace. + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(20, acctest.CharSetAlpha)) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -105,8 +172,8 @@ func testAccAwsAppmeshVirtualNode_cloudMapServiceDiscovery(t *testing.T) { func testAccAwsAppmeshVirtualNode_listenerHealthChecks(t *testing.T) { var vn appmesh.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" - meshName := fmt.Sprintf("tf-test-mesh-%d", acctest.RandInt()) - vnName := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) + meshName := acctest.RandomWithPrefix("tf-acc-test") + vnName := acctest.RandomWithPrefix("tf-acc-test") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -141,7 +208,7 @@ func testAccAwsAppmeshVirtualNode_listenerHealthChecks(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "spec.0.service_discovery.0.dns.0.hostname", "serviceb.simpleapp.local"), resource.TestCheckResourceAttrSet(resourceName, "created_date"), resource.TestCheckResourceAttrSet(resourceName, "last_updated_date"), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:appmesh:[^:]+:\\d{12}:mesh/%s/virtualNode/%s", meshName, vnName))), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "appmesh", fmt.Sprintf("mesh/%s/virtualNode/%s", meshName, vnName)), ), }, { @@ -173,7 +240,7 @@ func testAccAwsAppmeshVirtualNode_listenerHealthChecks(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "spec.0.service_discovery.0.dns.0.hostname", "serviceb1.simpleapp.local"), resource.TestCheckResourceAttrSet(resourceName, "created_date"), resource.TestCheckResourceAttrSet(resourceName, "last_updated_date"), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:appmesh:[^:]+:\\d{12}:mesh/%s/virtualNode/%s", meshName, vnName))), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "appmesh", fmt.Sprintf("mesh/%s/virtualNode/%s", meshName, vnName)), ), }, { @@ -189,8 +256,8 @@ func testAccAwsAppmeshVirtualNode_listenerHealthChecks(t *testing.T) { func testAccAwsAppmeshVirtualNode_logging(t *testing.T) { var vn appmesh.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" - meshName := fmt.Sprintf("tf-test-mesh-%d", acctest.RandInt()) - vnName := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) + meshName := acctest.RandomWithPrefix("tf-acc-test") + vnName := acctest.RandomWithPrefix("tf-acc-test") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -235,8 +302,8 @@ func testAccAwsAppmeshVirtualNode_logging(t *testing.T) { func testAccAwsAppmeshVirtualNode_tags(t *testing.T) { var vn appmesh.VirtualNodeData resourceName := "aws_appmesh_virtual_node.test" - meshName := fmt.Sprintf("tf-test-mesh-%d", acctest.RandInt()) - vnName := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) + meshName := acctest.RandomWithPrefix("tf-acc-test") + vnName := acctest.RandomWithPrefix("tf-acc-test") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, diff --git a/aws/resource_aws_appmesh_virtual_router.go b/aws/resource_aws_appmesh_virtual_router.go index 05c75b451f9..9081e50667b 100644 --- a/aws/resource_aws_appmesh_virtual_router.go +++ b/aws/resource_aws_appmesh_virtual_router.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsAppmeshVirtualRouter() *schema.Resource { @@ -123,7 +124,7 @@ func resourceAwsAppmeshVirtualRouterCreate(d *schema.ResourceData, meta interfac MeshName: aws.String(d.Get("mesh_name").(string)), VirtualRouterName: aws.String(d.Get("name").(string)), Spec: expandAppmeshVirtualRouterSpec(d.Get("spec").([]interface{})), - Tags: tagsFromMapAppmesh(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().AppmeshTags(), } log.Printf("[DEBUG] Creating App Mesh virtual router: %#v", req) @@ -158,9 +159,10 @@ func resourceAwsAppmeshVirtualRouterRead(d *schema.ResourceData, meta interface{ return nil } + arn := aws.StringValue(resp.VirtualRouter.Metadata.Arn) d.Set("name", resp.VirtualRouter.VirtualRouterName) d.Set("mesh_name", resp.VirtualRouter.MeshName) - d.Set("arn", resp.VirtualRouter.Metadata.Arn) + d.Set("arn", arn) d.Set("created_date", resp.VirtualRouter.Metadata.CreatedAt.Format(time.RFC3339)) d.Set("last_updated_date", resp.VirtualRouter.Metadata.LastUpdatedAt.Format(time.RFC3339)) err = d.Set("spec", flattenAppmeshVirtualRouterSpec(resp.VirtualRouter.Spec)) @@ -168,14 +170,14 @@ func resourceAwsAppmeshVirtualRouterRead(d *schema.ResourceData, meta interface{ return fmt.Errorf("error setting spec: %s", err) } - err = saveTagsAppmesh(conn, d, aws.StringValue(resp.VirtualRouter.Metadata.Arn)) - if isAWSErr(err, appmesh.ErrCodeNotFoundException, "") { - log.Printf("[WARN] App Mesh virtual router (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } + tags, err := keyvaluetags.AppmeshListTags(conn, arn) + if err != nil { - return fmt.Errorf("error saving tags: %s", err) + return fmt.Errorf("error listing tags for App Mesh virtual router (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -199,14 +201,13 @@ func resourceAwsAppmeshVirtualRouterUpdate(d *schema.ResourceData, meta interfac } } - err := setTagsAppmesh(conn, d, d.Get("arn").(string)) - if isAWSErr(err, appmesh.ErrCodeNotFoundException, "") { - log.Printf("[WARN] App Mesh virtual router (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - if err != nil { - return fmt.Errorf("error setting tags: %s", err) + arn := d.Get("arn").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.AppmeshUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating App Mesh virtual router (%s) tags: %s", arn, err) + } } return resourceAwsAppmeshVirtualRouterRead(d, meta) diff --git a/aws/resource_aws_appmesh_virtual_router_test.go b/aws/resource_aws_appmesh_virtual_router_test.go index 7bbdc694403..46d1d2d922c 100644 --- a/aws/resource_aws_appmesh_virtual_router_test.go +++ b/aws/resource_aws_appmesh_virtual_router_test.go @@ -3,7 +3,6 @@ package aws import ( "fmt" "log" - "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -84,9 +83,9 @@ func testSweepAppmeshVirtualRouters(region string) error { func testAccAwsAppmeshVirtualRouter_basic(t *testing.T) { var vr appmesh.VirtualRouterData - resourceName := "aws_appmesh_virtual_router.foo" - meshName := fmt.Sprintf("tf-test-mesh-%d", acctest.RandInt()) - vrName := fmt.Sprintf("tf-test-router-%d", acctest.RandInt()) + resourceName := "aws_appmesh_virtual_router.test" + meshName := acctest.RandomWithPrefix("tf-acc-test") + vrName := acctest.RandomWithPrefix("tf-acc-test") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -116,8 +115,8 @@ func testAccAwsAppmeshVirtualRouter_basic(t *testing.T) { resourceName, "created_date"), resource.TestCheckResourceAttrSet( resourceName, "last_updated_date"), - resource.TestMatchResourceAttr( - resourceName, "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:appmesh:[^:]+:\\d{12}:mesh/%s/virtualRouter/%s", meshName, vrName))), + testAccCheckResourceAttrRegionalARN( + resourceName, "arn", "appmesh", fmt.Sprintf("mesh/%s/virtualRouter/%s", meshName, vrName)), ), }, { @@ -153,9 +152,9 @@ func testAccAwsAppmeshVirtualRouter_basic(t *testing.T) { func testAccAwsAppmeshVirtualRouter_tags(t *testing.T) { var vr appmesh.VirtualRouterData - resourceName := "aws_appmesh_virtual_router.foo" - meshName := fmt.Sprintf("tf-test-mesh-%d", acctest.RandInt()) - vrName := fmt.Sprintf("tf-test-router-%d", acctest.RandInt()) + resourceName := "aws_appmesh_virtual_router.test" + meshName := acctest.RandomWithPrefix("tf-acc-test") + vrName := acctest.RandomWithPrefix("tf-acc-test") resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -259,13 +258,13 @@ func testAccCheckAppmeshVirtualRouterExists(name string, v *appmesh.VirtualRoute func testAccAppmeshVirtualRouterConfig_basic(meshName, vrName string) string { return fmt.Sprintf(` -resource "aws_appmesh_mesh" "foo" { - name = "%s" +resource "aws_appmesh_mesh" "test" { + name = %[1]q } -resource "aws_appmesh_virtual_router" "foo" { - name = "%s" - mesh_name = "${aws_appmesh_mesh.foo.id}" +resource "aws_appmesh_virtual_router" "test" { + name = %[2]q + mesh_name = "${aws_appmesh_mesh.test.id}" spec { listener { @@ -281,13 +280,13 @@ resource "aws_appmesh_virtual_router" "foo" { func testAccAppmeshVirtualRouterConfig_updated(meshName, vrName string) string { return fmt.Sprintf(` -resource "aws_appmesh_mesh" "foo" { - name = "%s" +resource "aws_appmesh_mesh" "test" { + name = %[1]q } -resource "aws_appmesh_virtual_router" "foo" { - name = "%s" - mesh_name = "${aws_appmesh_mesh.foo.id}" +resource "aws_appmesh_virtual_router" "test" { + name = %[2]q + mesh_name = "${aws_appmesh_mesh.test.id}" spec { listener { @@ -303,13 +302,13 @@ resource "aws_appmesh_virtual_router" "foo" { func testAccAppmeshVirtualRouterConfig_tags(meshName, vrName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { return fmt.Sprintf(` -resource "aws_appmesh_mesh" "foo" { - name = "%[1]s" +resource "aws_appmesh_mesh" "test" { + name = %[1]q } -resource "aws_appmesh_virtual_router" "foo" { - name = "%[2]s" - mesh_name = "${aws_appmesh_mesh.foo.id}" +resource "aws_appmesh_virtual_router" "test" { + name = %[2]q + mesh_name = "${aws_appmesh_mesh.test.id}" spec { listener { diff --git a/aws/resource_aws_appmesh_virtual_service.go b/aws/resource_aws_appmesh_virtual_service.go index a4c0ae95d99..367e5dcb88d 100644 --- a/aws/resource_aws_appmesh_virtual_service.go +++ b/aws/resource_aws_appmesh_virtual_service.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/service/appmesh" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsAppmeshVirtualService() *schema.Resource { @@ -118,7 +119,7 @@ func resourceAwsAppmeshVirtualServiceCreate(d *schema.ResourceData, meta interfa MeshName: aws.String(d.Get("mesh_name").(string)), VirtualServiceName: aws.String(d.Get("name").(string)), Spec: expandAppmeshVirtualServiceSpec(d.Get("spec").([]interface{})), - Tags: tagsFromMapAppmesh(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().AppmeshTags(), } log.Printf("[DEBUG] Creating App Mesh virtual service: %#v", req) @@ -153,9 +154,10 @@ func resourceAwsAppmeshVirtualServiceRead(d *schema.ResourceData, meta interface return nil } + arn := aws.StringValue(resp.VirtualService.Metadata.Arn) d.Set("name", resp.VirtualService.VirtualServiceName) d.Set("mesh_name", resp.VirtualService.MeshName) - d.Set("arn", resp.VirtualService.Metadata.Arn) + d.Set("arn", arn) d.Set("created_date", resp.VirtualService.Metadata.CreatedAt.Format(time.RFC3339)) d.Set("last_updated_date", resp.VirtualService.Metadata.LastUpdatedAt.Format(time.RFC3339)) err = d.Set("spec", flattenAppmeshVirtualServiceSpec(resp.VirtualService.Spec)) @@ -163,14 +165,14 @@ func resourceAwsAppmeshVirtualServiceRead(d *schema.ResourceData, meta interface return fmt.Errorf("error setting spec: %s", err) } - err = saveTagsAppmesh(conn, d, aws.StringValue(resp.VirtualService.Metadata.Arn)) - if isAWSErr(err, appmesh.ErrCodeNotFoundException, "") { - log.Printf("[WARN] App Mesh virtual service (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } + tags, err := keyvaluetags.AppmeshListTags(conn, arn) + if err != nil { - return fmt.Errorf("error saving tags: %s", err) + return fmt.Errorf("error listing tags for App Mesh virtual service (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -194,14 +196,13 @@ func resourceAwsAppmeshVirtualServiceUpdate(d *schema.ResourceData, meta interfa } } - err := setTagsAppmesh(conn, d, d.Get("arn").(string)) - if isAWSErr(err, appmesh.ErrCodeNotFoundException, "") { - log.Printf("[WARN] App Mesh virtual service (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } - if err != nil { - return fmt.Errorf("error setting tags: %s", err) + arn := d.Get("arn").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.AppmeshUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating App Mesh virtual service (%s) tags: %s", arn, err) + } } return resourceAwsAppmeshVirtualServiceRead(d, meta) diff --git a/aws/resource_aws_appmesh_virtual_service_test.go b/aws/resource_aws_appmesh_virtual_service_test.go index ca5cf691c6d..e520b6aa2c2 100644 --- a/aws/resource_aws_appmesh_virtual_service_test.go +++ b/aws/resource_aws_appmesh_virtual_service_test.go @@ -2,7 +2,7 @@ package aws import ( "fmt" - "regexp" + "log" "testing" "github.com/aws/aws-sdk-go/aws" @@ -12,13 +12,79 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) +func init() { + resource.AddTestSweepers("aws_appmesh_virtual_service", &resource.Sweeper{ + Name: "aws_appmesh_virtual_service", + F: testSweepAppmeshVirtualServices, + }) +} + +func testSweepAppmeshVirtualServices(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + conn := client.(*AWSClient).appmeshconn + + err = conn.ListMeshesPages(&appmesh.ListMeshesInput{}, func(page *appmesh.ListMeshesOutput, isLast bool) bool { + if page == nil { + return !isLast + } + + for _, mesh := range page.Meshes { + listVirtualServicesInput := &appmesh.ListVirtualServicesInput{ + MeshName: mesh.MeshName, + } + meshName := aws.StringValue(mesh.MeshName) + + err := conn.ListVirtualServicesPages(listVirtualServicesInput, func(page *appmesh.ListVirtualServicesOutput, isLast bool) bool { + if page == nil { + return !isLast + } + + for _, virtualService := range page.VirtualServices { + input := &appmesh.DeleteVirtualServiceInput{ + MeshName: mesh.MeshName, + VirtualServiceName: virtualService.VirtualServiceName, + } + virtualServiceName := aws.StringValue(virtualService.VirtualServiceName) + + log.Printf("[INFO] Deleting Appmesh Mesh (%s) Virtual Service: %s", meshName, virtualServiceName) + _, err := conn.DeleteVirtualService(input) + + if err != nil { + log.Printf("[ERROR] Error deleting Appmesh Mesh (%s) Virtual Service (%s): %s", meshName, virtualServiceName, err) + } + } + + return !isLast + }) + + if err != nil { + log.Printf("[ERROR] Error retrieving Appmesh Mesh (%s) Virtual Services: %s", meshName, err) + } + } + + return !isLast + }) + if err != nil { + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping Appmesh Virtual Service sweep for %s: %s", region, err) + return nil + } + return fmt.Errorf("error retrieving Appmesh Virtual Services: %s", err) + } + + return nil +} + func testAccAwsAppmeshVirtualService_virtualNode(t *testing.T) { var vs appmesh.VirtualServiceData - resourceName := "aws_appmesh_virtual_service.foo" - meshName := fmt.Sprintf("tf-test-mesh-%d", acctest.RandInt()) - vnName1 := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) - vnName2 := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) - vsName := fmt.Sprintf("tf-test-%d.mesh.local", acctest.RandInt()) + resourceName := "aws_appmesh_virtual_service.test" + meshName := acctest.RandomWithPrefix("tf-acc-test") + vnName1 := acctest.RandomWithPrefix("tf-acc-test") + vnName2 := acctest.RandomWithPrefix("tf-acc-test") + vsName := fmt.Sprintf("tf-acc-test-%d.mesh.local", acctest.RandInt()) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -37,8 +103,7 @@ func testAccAwsAppmeshVirtualService_virtualNode(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "spec.0.provider.0.virtual_node.0.virtual_node_name", vnName1), resource.TestCheckResourceAttrSet(resourceName, "created_date"), resource.TestCheckResourceAttrSet(resourceName, "last_updated_date"), - resource.TestMatchResourceAttr( - resourceName, "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:appmesh:[^:]+:\\d{12}:mesh/%s/virtualService/%s", meshName, vsName))), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "appmesh", fmt.Sprintf("mesh/%s/virtualService/%s", meshName, vsName)), ), }, { @@ -65,11 +130,11 @@ func testAccAwsAppmeshVirtualService_virtualNode(t *testing.T) { func testAccAwsAppmeshVirtualService_virtualRouter(t *testing.T) { var vs appmesh.VirtualServiceData - resourceName := "aws_appmesh_virtual_service.foo" - meshName := fmt.Sprintf("tf-test-mesh-%d", acctest.RandInt()) - vrName1 := fmt.Sprintf("tf-test-router-%d", acctest.RandInt()) - vrName2 := fmt.Sprintf("tf-test-router-%d", acctest.RandInt()) - vsName := fmt.Sprintf("tf-test-%d.mesh.local", acctest.RandInt()) + resourceName := "aws_appmesh_virtual_service.test" + meshName := acctest.RandomWithPrefix("tf-acc-test") + vrName1 := acctest.RandomWithPrefix("tf-acc-test") + vrName2 := acctest.RandomWithPrefix("tf-acc-test") + vsName := fmt.Sprintf("tf-acc-test-%d.mesh.local", acctest.RandInt()) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -88,9 +153,7 @@ func testAccAwsAppmeshVirtualService_virtualRouter(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "spec.0.provider.0.virtual_router.0.virtual_router_name", vrName1), resource.TestCheckResourceAttrSet(resourceName, "created_date"), resource.TestCheckResourceAttrSet(resourceName, "last_updated_date"), - resource.TestMatchResourceAttr( - resourceName, "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:appmesh:[^:]+:\\d{12}:mesh/%s/virtualService/%s", meshName, vsName))), - ), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "appmesh", fmt.Sprintf("mesh/%s/virtualService/%s", meshName, vsName))), }, { Config: testAccAppmeshVirtualServiceConfig_virtualRouter(meshName, vrName1, vrName2, vsName, "aws_appmesh_virtual_router.bar"), @@ -110,11 +173,11 @@ func testAccAwsAppmeshVirtualService_virtualRouter(t *testing.T) { func testAccAwsAppmeshVirtualService_tags(t *testing.T) { var vs appmesh.VirtualServiceData - resourceName := "aws_appmesh_virtual_service.foo" - meshName := fmt.Sprintf("tf-test-mesh-%d", acctest.RandInt()) - vnName1 := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) - vnName2 := fmt.Sprintf("tf-test-node-%d", acctest.RandInt()) - vsName := fmt.Sprintf("tf-test-%d.mesh.local", acctest.RandInt()) + resourceName := "aws_appmesh_virtual_service.test" + meshName := acctest.RandomWithPrefix("tf-acc-test") + vnName1 := acctest.RandomWithPrefix("tf-acc-test") + vnName2 := acctest.RandomWithPrefix("tf-acc-test") + vsName := fmt.Sprintf("tf-acc-test-%d.mesh.local", acctest.RandInt()) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -215,32 +278,32 @@ func testAccCheckAppmeshVirtualServiceExists(name string, v *appmesh.VirtualServ func testAccAppmeshVirtualServiceConfig_virtualNode(meshName, vnName1, vnName2, vsName, rName string) string { return fmt.Sprintf(` -resource "aws_appmesh_mesh" "foo" { - name = "%s" +resource "aws_appmesh_mesh" "test" { + name = %[1]q } resource "aws_appmesh_virtual_node" "foo" { - name = "%s" - mesh_name = "${aws_appmesh_mesh.foo.id}" + name = %[2]q + mesh_name = "${aws_appmesh_mesh.test.id}" spec {} } resource "aws_appmesh_virtual_node" "bar" { - name = "%s" - mesh_name = "${aws_appmesh_mesh.foo.id}" + name = %[3]q + mesh_name = "${aws_appmesh_mesh.test.id}" spec {} } -resource "aws_appmesh_virtual_service" "foo" { - name = "%s" - mesh_name = "${aws_appmesh_mesh.foo.id}" +resource "aws_appmesh_virtual_service" "test" { + name = %[4]q + mesh_name = "${aws_appmesh_mesh.test.id}" spec { provider { virtual_node { - virtual_node_name = "${%s.name}" + virtual_node_name = "${%[5]s.name}" } } } @@ -250,13 +313,13 @@ resource "aws_appmesh_virtual_service" "foo" { func testAccAppmeshVirtualServiceConfig_virtualRouter(meshName, vrName1, vrName2, vsName, rName string) string { return fmt.Sprintf(` -resource "aws_appmesh_mesh" "foo" { - name = "%s" +resource "aws_appmesh_mesh" "test" { + name = %[1]q } resource "aws_appmesh_virtual_router" "foo" { - name = "%s" - mesh_name = "${aws_appmesh_mesh.foo.id}" + name = %[2]q + mesh_name = "${aws_appmesh_mesh.test.id}" spec { listener { @@ -269,8 +332,8 @@ resource "aws_appmesh_virtual_router" "foo" { } resource "aws_appmesh_virtual_router" "bar" { - name = "%s" - mesh_name = "${aws_appmesh_mesh.foo.id}" + name = %[3]q + mesh_name = "${aws_appmesh_mesh.test.id}" spec { listener { @@ -282,14 +345,14 @@ resource "aws_appmesh_virtual_router" "bar" { } } -resource "aws_appmesh_virtual_service" "foo" { - name = "%s" - mesh_name = "${aws_appmesh_mesh.foo.id}" +resource "aws_appmesh_virtual_service" "test" { + name = %[4]q + mesh_name = "${aws_appmesh_mesh.test.id}" spec { provider { virtual_router { - virtual_router_name = "${%s.name}" + virtual_router_name = "${%[5]s.name}" } } } @@ -299,32 +362,32 @@ resource "aws_appmesh_virtual_service" "foo" { func testAccAppmeshVirtualServiceConfig_tags(meshName, vnName1, vnName2, vsName, rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { return fmt.Sprintf(` -resource "aws_appmesh_mesh" "foo" { - name = "%[1]s" +resource "aws_appmesh_mesh" "test" { + name = %[1]q } resource "aws_appmesh_virtual_node" "foo" { - name = "%[2]s" - mesh_name = "${aws_appmesh_mesh.foo.id}" + name = %[2]q + mesh_name = "${aws_appmesh_mesh.test.id}" spec {} } resource "aws_appmesh_virtual_node" "bar" { - name = "%[3]s" - mesh_name = "${aws_appmesh_mesh.foo.id}" + name = %[3]q + mesh_name = "${aws_appmesh_mesh.test.id}" spec {} } -resource "aws_appmesh_virtual_service" "foo" { - name = "%[4]s" - mesh_name = "${aws_appmesh_mesh.foo.id}" +resource "aws_appmesh_virtual_service" "test" { + name = %[4]q + mesh_name = "${aws_appmesh_mesh.test.id}" spec { provider { virtual_node { - virtual_node_name = "${%s.name}" + virtual_node_name = "${%[5]s.name}" } } } diff --git a/aws/resource_aws_appsync_datasource_test.go b/aws/resource_aws_appsync_datasource_test.go index d6891fc46c4..dc56d9e3bc3 100644 --- a/aws/resource_aws_appsync_datasource_test.go +++ b/aws/resource_aws_appsync_datasource_test.go @@ -577,7 +577,7 @@ resource "aws_lambda_function" "test" { function_name = %q handler = "exports.test" role = "${aws_iam_role.lambda.arn}" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } resource "aws_iam_role" "test" { diff --git a/aws/resource_aws_appsync_graphql_api.go b/aws/resource_aws_appsync_graphql_api.go index 1542152b95e..acc87e0b3eb 100644 --- a/aws/resource_aws_appsync_graphql_api.go +++ b/aws/resource_aws_appsync_graphql_api.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) var validAppsyncAuthTypes = []string{ @@ -227,7 +228,7 @@ func resourceAwsAppsyncGraphqlApiCreate(d *schema.ResourceData, meta interface{} } if v, ok := d.GetOk("tags"); ok { - input.Tags = tagsFromMapGeneric(v.(map[string]interface{})) + input.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().AppsyncTags() } resp, err := conn.CreateGraphqlApi(input) @@ -287,7 +288,7 @@ func resourceAwsAppsyncGraphqlApiRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("error setting uris: %s", err) } - if err := d.Set("tags", tagsToMapGeneric(resp.GraphqlApi.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.AppsyncKeyValueTags(resp.GraphqlApi.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -297,9 +298,12 @@ func resourceAwsAppsyncGraphqlApiRead(d *schema.ResourceData, meta interface{}) func resourceAwsAppsyncGraphqlApiUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).appsyncconn - arn := d.Get("arn").(string) - if tagErr := setTagsAppsync(conn, d, arn); tagErr != nil { - return tagErr + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.AppsyncUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating AppSync GraphQL API (%s) tags: %s", d.Get("arn").(string), err) + } } input := &appsync.UpdateGraphqlApiInput{ diff --git a/aws/resource_aws_athena_database_test.go b/aws/resource_aws_athena_database_test.go index fcf9cf16f2e..f0894aef273 100644 --- a/aws/resource_aws_athena_database_test.go +++ b/aws/resource_aws_athena_database_test.go @@ -136,7 +136,7 @@ func testAccCheckAWSAthenaDatabaseDestroy(s *terraform.State) error { } rInt := acctest.RandInt() - bucketName := fmt.Sprintf("tf-athena-db-%d", rInt) + bucketName := fmt.Sprintf("tf-test-athena-db-%d", rInt) _, err := s3conn.CreateBucket(&s3.CreateBucketInput{ Bucket: aws.String(bucketName), }) @@ -333,7 +333,7 @@ func testAccAthenaDatabaseFindBucketName(s *terraform.State, dbName string) (buc func testAccAthenaDatabaseConfig(randInt int, dbName string, forceDestroy bool) string { return fmt.Sprintf(` resource "aws_s3_bucket" "hoge" { - bucket = "tf-athena-db-%[1]d" + bucket = "tf-test-athena-db-%[1]d" force_destroy = true } @@ -352,7 +352,7 @@ resource "aws_kms_key" "hoge" { } resource "aws_s3_bucket" "hoge" { - bucket = "tf-athena-db-%[1]d" + bucket = "tf-test-athena-db-%[1]d" force_destroy = true server_side_encryption_configuration { diff --git a/aws/resource_aws_athena_named_query_test.go b/aws/resource_aws_athena_named_query_test.go index 49708022ca1..e85aba4c83b 100644 --- a/aws/resource_aws_athena_named_query_test.go +++ b/aws/resource_aws_athena_named_query_test.go @@ -12,6 +12,8 @@ import ( ) func TestAccAWSAthenaNamedQuery_basic(t *testing.T) { + resourceName := "aws_athena_named_query.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -20,14 +22,21 @@ func TestAccAWSAthenaNamedQuery_basic(t *testing.T) { { Config: testAccAthenaNamedQueryConfig(acctest.RandInt(), acctest.RandString(5)), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAthenaNamedQueryExists("aws_athena_named_query.foo"), + testAccCheckAWSAthenaNamedQueryExists(resourceName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSAthenaNamedQuery_withWorkGroup(t *testing.T) { + resourceName := "aws_athena_named_query.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -36,25 +45,9 @@ func TestAccAWSAthenaNamedQuery_withWorkGroup(t *testing.T) { { Config: testAccAthenaNamedWorkGroupQueryConfig(acctest.RandInt(), acctest.RandString(5)), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSAthenaNamedQueryExists("aws_athena_named_query.bar"), + testAccCheckAWSAthenaNamedQueryExists(resourceName), ), }, - }, - }) -} - -func TestAccAWSAthenaNamedQuery_import(t *testing.T) { - resourceName := "aws_athena_named_query.foo" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSAthenaNamedQueryDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAthenaNamedQueryConfig(acctest.RandInt(), acctest.RandString(5)), - }, - { ResourceName: resourceName, ImportState: true, @@ -109,20 +102,20 @@ func testAccCheckAWSAthenaNamedQueryExists(name string) resource.TestCheckFunc { func testAccAthenaNamedQueryConfig(rInt int, rName string) string { return fmt.Sprintf(` -resource "aws_s3_bucket" "hoge" { - bucket = "tf-athena-db-%s-%d" +resource "aws_s3_bucket" "test" { + bucket = "tf-test-athena-db-%s-%d" force_destroy = true } -resource "aws_athena_database" "hoge" { +resource "aws_athena_database" "test" { name = "%s" - bucket = "${aws_s3_bucket.hoge.bucket}" + bucket = "${aws_s3_bucket.test.bucket}" } -resource "aws_athena_named_query" "foo" { +resource "aws_athena_named_query" "test" { name = "tf-athena-named-query-%s" - database = "${aws_athena_database.hoge.name}" - query = "SELECT * FROM ${aws_athena_database.hoge.name} limit 10;" + database = "${aws_athena_database.test.name}" + query = "SELECT * FROM ${aws_athena_database.test.name} limit 10;" description = "tf test" } `, rName, rInt, rName, rName) @@ -130,8 +123,8 @@ resource "aws_athena_named_query" "foo" { func testAccAthenaNamedWorkGroupQueryConfig(rInt int, rName string) string { return fmt.Sprintf(` -resource "aws_s3_bucket" "hoge" { - bucket = "tf-athena-db-%s-%d" +resource "aws_s3_bucket" "test" { + bucket = "tf-test-athena-db-%s-%d" force_destroy = true } @@ -139,16 +132,16 @@ resource "aws_athena_workgroup" "test" { name = "tf-athena-workgroup-%s-%d" } -resource "aws_athena_database" "hoge" { +resource "aws_athena_database" "test" { name = "%s" - bucket = "${aws_s3_bucket.hoge.bucket}" + bucket = "${aws_s3_bucket.test.bucket}" } -resource "aws_athena_named_query" "bar" { +resource "aws_athena_named_query" "test" { name = "tf-athena-named-query-%s" workgroup = "${aws_athena_workgroup.test.id}" - database = "${aws_athena_database.hoge.name}" - query = "SELECT * FROM ${aws_athena_database.hoge.name} limit 10;" + database = "${aws_athena_database.test.name}" + query = "SELECT * FROM ${aws_athena_database.test.name} limit 10;" description = "tf test" } `, rName, rInt, rName, rInt, rName, rName) diff --git a/aws/resource_aws_autoscaling_group.go b/aws/resource_aws_autoscaling_group.go index 27078c6fc5c..f7a1f82cffd 100644 --- a/aws/resource_aws_autoscaling_group.go +++ b/aws/resource_aws_autoscaling_group.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "regexp" "strings" "time" @@ -186,6 +187,11 @@ func resourceAwsAutoscalingGroup() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "weighted_capacity": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[1-9][0-9]{0,2}$`), "see https://docs.aws.amazon.com/autoscaling/ec2/APIReference/API_LaunchTemplateOverrides.html"), + }, }, }, }, @@ -217,6 +223,11 @@ func resourceAwsAutoscalingGroup() *schema.Resource { Required: true, }, + "max_instance_lifetime": { + Type: schema.TypeInt, + Optional: true, + }, + "default_cooldown": { Type: schema.TypeInt, Optional: true, @@ -579,6 +590,10 @@ func resourceAwsAutoscalingGroupCreate(d *schema.ResourceData, meta interface{}) createOpts.ServiceLinkedRoleARN = aws.String(v.(string)) } + if v, ok := d.GetOk("max_instance_lifetime"); ok { + createOpts.MaxInstanceLifetime = aws.Int64(int64(v.(int))) + } + log.Printf("[DEBUG] AutoScaling Group create configuration: %#v", createOpts) // Retry for IAM eventual consistency @@ -694,6 +709,7 @@ func resourceAwsAutoscalingGroupRead(d *schema.ResourceData, meta interface{}) e d.Set("placement_group", g.PlacementGroup) d.Set("protect_from_scale_in", g.NewInstancesProtectedFromScaleIn) d.Set("service_linked_role_arn", g.ServiceLinkedRoleARN) + d.Set("max_instance_lifetime", g.MaxInstanceLifetime) if err := d.Set("suspended_processes", flattenAsgSuspendedProcesses(g.SuspendedProcesses)); err != nil { return fmt.Errorf("error setting suspended_processes: %s", err) @@ -767,6 +783,78 @@ func resourceAwsAutoscalingGroupRead(d *schema.ResourceData, meta interface{}) e return nil } +func waitUntilAutoscalingGroupLoadBalancerTargetGroupsRemoved(conn *autoscaling.AutoScaling, asgName string) error { + input := &autoscaling.DescribeLoadBalancerTargetGroupsInput{ + AutoScalingGroupName: aws.String(asgName), + } + var tgRemoving bool + + for { + output, err := conn.DescribeLoadBalancerTargetGroups(input) + + if err != nil { + return err + } + + for _, tg := range output.LoadBalancerTargetGroups { + if aws.StringValue(tg.State) == "Removing" { + tgRemoving = true + break + } + } + + if tgRemoving { + tgRemoving = false + input.NextToken = nil + continue + } + + if aws.StringValue(output.NextToken) == "" { + break + } + + input.NextToken = output.NextToken + } + + return nil +} + +func waitUntilAutoscalingGroupLoadBalancerTargetGroupsAdded(conn *autoscaling.AutoScaling, asgName string) error { + input := &autoscaling.DescribeLoadBalancerTargetGroupsInput{ + AutoScalingGroupName: aws.String(asgName), + } + var tgAdding bool + + for { + output, err := conn.DescribeLoadBalancerTargetGroups(input) + + if err != nil { + return err + } + + for _, tg := range output.LoadBalancerTargetGroups { + if aws.StringValue(tg.State) == "Adding" { + tgAdding = true + break + } + } + + if tgAdding { + tgAdding = false + input.NextToken = nil + continue + } + + if aws.StringValue(output.NextToken) == "" { + break + } + + input.NextToken = output.NextToken + } + + return nil +} + func resourceAwsAutoscalingGroupUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).autoscalingconn shouldWaitForCapacity := false @@ -811,6 +899,10 @@ func resourceAwsAutoscalingGroupUpdate(d *schema.ResourceData, meta interface{}) opts.MaxSize = aws.Int64(int64(d.Get("max_size").(int))) } + if d.HasChange("max_instance_lifetime") { + opts.MaxInstanceLifetime = aws.Int64(int64(d.Get("max_instance_lifetime").(int))) + } + if d.HasChange("health_check_grace_period") { opts.HealthCheckGracePeriod = aws.Int64(int64(d.Get("health_check_grace_period").(int))) } @@ -884,22 +976,56 @@ func resourceAwsAutoscalingGroupUpdate(d *schema.ResourceData, meta interface{}) 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("Error updating Load Balancers for AutoScaling Group (%s), error: %s", d.Id(), err) + // API only supports removing 10 at a time + var batches [][]*string + + batchSize := 10 + + for batchSize < len(remove) { + remove, batches = remove[batchSize:], append(batches, remove[0:batchSize:batchSize]) + } + batches = append(batches, remove) + + for _, batch := range batches { + _, err := conn.DetachLoadBalancers(&autoscaling.DetachLoadBalancersInput{ + AutoScalingGroupName: aws.String(d.Id()), + LoadBalancerNames: batch, + }) + + if err != nil { + return fmt.Errorf("error detaching AutoScaling Group (%s) Load Balancers: %s", d.Id(), err) + } + + if err := waitUntilAutoscalingGroupLoadBalancersRemoved(conn, d.Id()); err != nil { + return fmt.Errorf("error describing AutoScaling Group (%s) Load Balancers being removed: %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("Error updating Load Balancers for AutoScaling Group (%s), error: %s", d.Id(), err) + // API only supports adding 10 at a time + batchSize := 10 + + var batches [][]*string + + for batchSize < len(add) { + add, batches = add[batchSize:], append(batches, add[0:batchSize:batchSize]) + } + batches = append(batches, add) + + for _, batch := range batches { + _, err := conn.AttachLoadBalancers(&autoscaling.AttachLoadBalancersInput{ + AutoScalingGroupName: aws.String(d.Id()), + LoadBalancerNames: batch, + }) + + if err != nil { + return fmt.Errorf("error attaching AutoScaling Group (%s) Load Balancers: %s", d.Id(), err) + } + + if err := waitUntilAutoscalingGroupLoadBalancersAdded(conn, d.Id()); err != nil { + return fmt.Errorf("error describing AutoScaling Group (%s) Load Balancers being added: %s", d.Id(), err) + } } } } @@ -920,22 +1046,55 @@ func resourceAwsAutoscalingGroupUpdate(d *schema.ResourceData, meta interface{}) 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("Error updating Load Balancers Target Groups for AutoScaling Group (%s), error: %s", d.Id(), err) + // AWS API only supports adding/removing 10 at a time + var batches [][]*string + + batchSize := 10 + + for batchSize < len(remove) { + remove, batches = remove[batchSize:], append(batches, remove[0:batchSize:batchSize]) + } + batches = append(batches, remove) + + for _, batch := range batches { + _, err := conn.DetachLoadBalancerTargetGroups(&autoscaling.DetachLoadBalancerTargetGroupsInput{ + AutoScalingGroupName: aws.String(d.Id()), + TargetGroupARNs: batch, + }) + if err != nil { + return fmt.Errorf("Error updating Load Balancers Target Groups for AutoScaling Group (%s), error: %s", d.Id(), err) + } + + if err := waitUntilAutoscalingGroupLoadBalancerTargetGroupsRemoved(conn, d.Id()); err != nil { + return fmt.Errorf("error describing AutoScaling Group (%s) Load Balancer Target Groups being removed: %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("Error updating Load Balancers Target Groups for AutoScaling Group (%s), error: %s", d.Id(), err) + batchSize := 10 + + var batches [][]*string + + for batchSize < len(add) { + add, batches = add[batchSize:], append(batches, add[0:batchSize:batchSize]) + } + batches = append(batches, add) + + for _, batch := range batches { + _, err := conn.AttachLoadBalancerTargetGroups(&autoscaling.AttachLoadBalancerTargetGroupsInput{ + AutoScalingGroupName: aws.String(d.Id()), + TargetGroupARNs: batch, + }) + + if err != nil { + return fmt.Errorf("Error updating Load Balancers Target Groups for AutoScaling Group (%s), error: %s", d.Id(), err) + } + + if err := waitUntilAutoscalingGroupLoadBalancerTargetGroupsAdded(conn, d.Id()); err != nil { + return fmt.Errorf("error describing AutoScaling Group (%s) Load Balancer Target Groups being added: %s", d.Id(), err) + } } } } @@ -1372,6 +1531,10 @@ func expandAutoScalingLaunchTemplateOverride(m map[string]interface{}) *autoscal launchTemplateOverrides.InstanceType = aws.String(v.(string)) } + if v, ok := m["weighted_capacity"]; ok && v.(string) != "" { + launchTemplateOverrides.WeightedCapacity = aws.String(v.(string)) + } + return launchTemplateOverrides } @@ -1459,7 +1622,8 @@ func flattenAutoScalingLaunchTemplateOverrides(launchTemplateOverrides []*autosc continue } m := map[string]interface{}{ - "instance_type": aws.StringValue(launchTemplateOverride.InstanceType), + "instance_type": aws.StringValue(launchTemplateOverride.InstanceType), + "weighted_capacity": aws.StringValue(launchTemplateOverride.WeightedCapacity), } l[i] = m } @@ -1493,3 +1657,75 @@ func flattenAutoScalingMixedInstancesPolicy(mixedInstancesPolicy *autoscaling.Mi return []interface{}{m} } + +func waitUntilAutoscalingGroupLoadBalancersAdded(conn *autoscaling.AutoScaling, asgName string) error { + input := &autoscaling.DescribeLoadBalancersInput{ + AutoScalingGroupName: aws.String(asgName), + } + var lbAdding bool + + for { + output, err := conn.DescribeLoadBalancers(input) + + if err != nil { + return err + } + + for _, tg := range output.LoadBalancers { + if aws.StringValue(tg.State) == "Adding" { + lbAdding = true + break + } + } + + if lbAdding { + lbAdding = false + input.NextToken = nil + continue + } + + if aws.StringValue(output.NextToken) == "" { + break + } + + input.NextToken = output.NextToken + } + + return nil +} + +func waitUntilAutoscalingGroupLoadBalancersRemoved(conn *autoscaling.AutoScaling, asgName string) error { + input := &autoscaling.DescribeLoadBalancersInput{ + AutoScalingGroupName: aws.String(asgName), + } + var lbRemoving bool + + for { + output, err := conn.DescribeLoadBalancers(input) + + if err != nil { + return err + } + + for _, tg := range output.LoadBalancers { + if aws.StringValue(tg.State) == "Removing" { + lbRemoving = true + break + } + } + + if lbRemoving { + lbRemoving = false + input.NextToken = nil + continue + } + + if aws.StringValue(output.NextToken) == "" { + break + } + + input.NextToken = output.NextToken + } + + return nil +} diff --git a/aws/resource_aws_autoscaling_group_test.go b/aws/resource_aws_autoscaling_group_test.go index 5de01fe341b..1b94795abb4 100644 --- a/aws/resource_aws_autoscaling_group_test.go +++ b/aws/resource_aws_autoscaling_group_test.go @@ -124,6 +124,7 @@ func TestAccAWSAutoScalingGroup_basic(t *testing.T) { resource.TestCheckResourceAttr("aws_autoscaling_group.bar", "termination_policies.0", "OldestInstance"), resource.TestCheckResourceAttr("aws_autoscaling_group.bar", "termination_policies.1", "ClosestToNextInstanceHour"), resource.TestCheckResourceAttr("aws_autoscaling_group.bar", "vpc_zone_identifier.#", "0"), + resource.TestCheckResourceAttr("aws_autoscaling_group.bar", "max_instance_lifetime", "0"), ), }, { @@ -681,7 +682,7 @@ func TestAccAWSAutoScalingGroup_withMetrics(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAWSAutoScalingGroupExists("aws_autoscaling_group.bar", &group), resource.TestCheckResourceAttr( - "aws_autoscaling_group.bar", "enabled_metrics.#", "7"), + "aws_autoscaling_group.bar", "enabled_metrics.#", "13"), ), }, { @@ -744,6 +745,48 @@ func TestAccAWSAutoScalingGroup_serviceLinkedRoleARN(t *testing.T) { }) } +func TestAccAWSAutoScalingGroup_MaxInstanceLifetime(t *testing.T) { + var group autoscaling.Group + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAutoScalingGroupConfig_withMaxInstanceLifetime, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAutoScalingGroupExists("aws_autoscaling_group.bar", &group), + resource.TestCheckResourceAttr( + "aws_autoscaling_group.bar", "max_instance_lifetime", "864000"), + ), + }, + { + ResourceName: "aws_autoscaling_group.bar", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "force_delete", + "initial_lifecycle_hook", + "name_prefix", + "tag", + "tags", + "wait_for_capacity_timeout", + "wait_for_elb_capacity", + }, + }, + { + Config: testAccAWSAutoScalingGroupConfig_withMaxInstanceLifetime_update, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAutoScalingGroupExists("aws_autoscaling_group.bar", &group), + resource.TestCheckResourceAttr( + "aws_autoscaling_group.bar", "max_instance_lifetime", "604800"), + ), + }, + }, + }) +} + func TestAccAWSAutoScalingGroup_ALB_TargetGroups(t *testing.T) { var group autoscaling.Group var tg elbv2.TargetGroup @@ -825,6 +868,120 @@ func TestAccAWSAutoScalingGroup_ALB_TargetGroups(t *testing.T) { }) } +// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/256 +func TestAccAWSAutoScalingGroup_TargetGroupArns(t *testing.T) { + var group autoscaling.Group + resourceName := "aws_autoscaling_group.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAutoScalingGroupConfig_TargetGroupArns(rName, 11), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAutoScalingGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "target_group_arns.#", "11"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "force_delete", + "initial_lifecycle_hook", + "name_prefix", + "tag", + "tags", + "wait_for_capacity_timeout", + "wait_for_elb_capacity", + }, + }, + { + Config: testAccAWSAutoScalingGroupConfig_TargetGroupArns(rName, 0), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAutoScalingGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "target_group_arns.#", "0"), + ), + }, + { + Config: testAccAWSAutoScalingGroupConfig_TargetGroupArns(rName, 11), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAutoScalingGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "target_group_arns.#", "11"), + ), + }, + }, + }) +} + +func testAccAWSAutoScalingGroupConfig_TargetGroupArns(rName string, tgCount int) string { + return fmt.Sprintf(` +data "aws_ami" "test" { + most_recent = true + owners = ["amazon"] + + filter { + name = "name" + values = ["amzn-ami-hvm-*-x86_64-gp2"] + } +} + +data "aws_availability_zones" "available" { + # t2.micro is not supported in us-west-2d + blacklisted_zone_ids = ["usw2-az4"] + state = "available" +} + +resource "aws_launch_template" "test" { + image_id = data.aws_ami.test.id + instance_type = "t3.micro" + name = %[1]q +} + +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_subnet" "test" { + availability_zone = data.aws_availability_zones.available.names[0] + cidr_block = "10.0.0.0/24" + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_lb_target_group" "test" { + count = %[2]d + + port = 80 + protocol = "HTTP" + vpc_id = "${aws_vpc.test.id}" +} + +resource "aws_autoscaling_group" "test" { + force_delete = true + max_size = 0 + min_size = 0 + target_group_arns = length(aws_lb_target_group.test) > 0 ? aws_lb_target_group.test[*].arn : [] + vpc_zone_identifier = [aws_subnet.test.id] + + launch_template { + id = aws_launch_template.test.id + } +} +`, rName, tgCount) +} + func TestAccAWSAutoScalingGroup_initialLifecycleHook(t *testing.T) { var group autoscaling.Group @@ -1358,6 +1515,56 @@ func TestAccAWSAutoScalingGroup_LaunchTemplate_IAMInstanceProfile(t *testing.T) }) } +// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/256 +func TestAccAWSAutoScalingGroup_LoadBalancers(t *testing.T) { + var group autoscaling.Group + resourceName := "aws_autoscaling_group.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAutoScalingGroupConfig_LoadBalancers(rName, 11), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAutoScalingGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "load_balancers.#", "11"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "force_delete", + "initial_lifecycle_hook", + "name_prefix", + "tag", + "tags", + "wait_for_capacity_timeout", + "wait_for_elb_capacity", + }, + }, + { + Config: testAccAWSAutoScalingGroupConfig_LoadBalancers(rName, 0), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAutoScalingGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "load_balancers.#", "0"), + ), + }, + { + Config: testAccAWSAutoScalingGroupConfig_LoadBalancers(rName, 11), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAutoScalingGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "load_balancers.#", "11"), + ), + }, + }, + }) +} + func TestAccAWSAutoScalingGroup_MixedInstancesPolicy(t *testing.T) { var group autoscaling.Group resourceName := "aws_autoscaling_group.test" @@ -1378,7 +1585,9 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "mixed_instances_policy.0.launch_template.0.launch_template_specification.0.version", "$Default"), resource.TestCheckResourceAttr(resourceName, "mixed_instances_policy.0.launch_template.0.override.#", "2"), resource.TestCheckResourceAttr(resourceName, "mixed_instances_policy.0.launch_template.0.override.0.instance_type", "t2.micro"), + resource.TestCheckResourceAttr(resourceName, "mixed_instances_policy.0.launch_template.0.override.0.weighted_capacity", "1"), resource.TestCheckResourceAttr(resourceName, "mixed_instances_policy.0.launch_template.0.override.1.instance_type", "t3.small"), + resource.TestCheckResourceAttr(resourceName, "mixed_instances_policy.0.launch_template.0.override.1.weighted_capacity", "2"), ), }, { @@ -1811,6 +2020,47 @@ func TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_Ins }) } +func TestAccAWSAutoScalingGroup_MixedInstancesPolicy_LaunchTemplate_Override_WeightedCapacity(t *testing.T) { + var group autoscaling.Group + resourceName := "aws_autoscaling_group.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSAutoScalingGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSAutoScalingGroupConfig_MixedInstancesPolicy_LaunchTemplate_Override_WeightedCapacity(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSAutoScalingGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "mixed_instances_policy.#", "1"), + resource.TestCheckResourceAttr(resourceName, "mixed_instances_policy.0.launch_template.#", "1"), + resource.TestCheckResourceAttr(resourceName, "mixed_instances_policy.0.launch_template.0.override.#", "2"), + resource.TestCheckResourceAttr(resourceName, "mixed_instances_policy.0.launch_template.0.override.0.instance_type", "t2.micro"), + resource.TestCheckResourceAttr(resourceName, "mixed_instances_policy.0.launch_template.0.override.0.weighted_capacity", "2"), + resource.TestCheckResourceAttr(resourceName, "mixed_instances_policy.0.launch_template.0.override.1.instance_type", "t3.small"), + resource.TestCheckResourceAttr(resourceName, "mixed_instances_policy.0.launch_template.0.override.1.weighted_capacity", "4"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "force_delete", + "initial_lifecycle_hook", + "name_prefix", + "tag", + "tags", + "wait_for_capacity_timeout", + "wait_for_elb_capacity", + }, + }, + }, + }) +} + const testAccAWSAutoScalingGroupConfig_autoGeneratedName = ` data "aws_ami" "test_ami" { most_recent = true @@ -2066,7 +2316,15 @@ resource "aws_internet_gateway" "gw" { vpc_id = "${aws_vpc.foo.id}" } +data "aws_availability_zones" "available" { + # t2.micro is not supported in us-west-2d + blacklisted_zone_ids = ["usw2-az4"] + state = "available" +} + + resource "aws_subnet" "foo" { + availability_zone = "${data.aws_availability_zones.available.names[0]}" cidr_block = "10.1.1.0/24" vpc_id = "${aws_vpc.foo.id}" tags = { @@ -2133,7 +2391,6 @@ resource "aws_launch_configuration" "foobar" { } resource "aws_autoscaling_group" "bar" { - availability_zones = ["${aws_subnet.foo.availability_zone}"] vpc_zone_identifier = ["${aws_subnet.foo.id}"] max_size = 2 min_size = 2 @@ -2159,11 +2416,18 @@ resource "aws_internet_gateway" "gw" { vpc_id = "${aws_vpc.foo.id}" } +data "aws_availability_zones" "available" { + # t2.micro is not supported in us-west-2d + blacklisted_zone_ids = ["usw2-az4"] + state = "available" +} + resource "aws_subnet" "foo" { + availability_zone = "${data.aws_availability_zones.available.names[0]}" cidr_block = "10.1.1.0/24" vpc_id = "${aws_vpc.foo.id}" tags = { - Name = "tf-acc-autoscaling-group-with-load-balancer" + Name = "tf-acc-autoscaling-group-with-target-group" } } @@ -2407,6 +2671,58 @@ resource "aws_autoscaling_group" "bar" { } ` +const testAccAWSAutoScalingGroupConfig_withMaxInstanceLifetime = ` +data "aws_ami" "test_ami" { + most_recent = true + owners = ["amazon"] + + filter { + name = "name" + values = ["amzn-ami-hvm-*-x86_64-gp2"] + } +} + +resource "aws_launch_configuration" "foobar" { + image_id = "${data.aws_ami.test_ami.id}" + instance_type = "t2.micro" +} + +resource "aws_autoscaling_group" "bar" { + availability_zones = ["us-west-2a"] + desired_capacity = 0 + max_size = 0 + min_size = 0 + launch_configuration = "${aws_launch_configuration.foobar.name}" + max_instance_lifetime = "864000" +} +` + +const testAccAWSAutoScalingGroupConfig_withMaxInstanceLifetime_update = ` +data "aws_ami" "test_ami" { + most_recent = true + owners = ["amazon"] + + filter { + name = "name" + values = ["amzn-ami-hvm-*-x86_64-gp2"] + } +} + +resource "aws_launch_configuration" "foobar" { + image_id = "${data.aws_ami.test_ami.id}" + instance_type = "t2.micro" +} + +resource "aws_autoscaling_group" "bar" { + availability_zones = ["us-west-2a"] + desired_capacity = 0 + max_size = 0 + min_size = 0 + launch_configuration = "${aws_launch_configuration.foobar.name}" + max_instance_lifetime = "604800" +} +` + const testAccAWSAutoscalingMetricsCollectionConfig_allMetricsCollected = ` data "aws_ami" "test_ami" { most_recent = true @@ -2439,7 +2755,13 @@ resource "aws_autoscaling_group" "bar" { "GroupDesiredCapacity", "GroupInServiceInstances", "GroupMinSize", - "GroupMaxSize" + "GroupMaxSize", + "GroupPendingCapacity", + "GroupInServiceCapacity", + "GroupStandbyCapacity", + "GroupTotalCapacity", + "GroupTerminatingCapacity", + "GroupStandbyInstances" ] metrics_granularity = "1Minute" } @@ -3057,7 +3379,14 @@ resource "aws_vpc" "test" { } } +data "aws_availability_zones" "available" { + # t2.micro is not supported in us-west-2d + blacklisted_zone_ids = ["usw2-az4"] + state = "available" +} + resource "aws_subnet" "test" { + availability_zone = "${data.aws_availability_zones.available.names[0]}" vpc_id = "${aws_vpc.test.id}" cidr_block = "10.0.0.0/16" tags = { @@ -3285,6 +3614,80 @@ resource "aws_autoscaling_group" "test" { `, rName, rName, rName, rName) } +func testAccAWSAutoScalingGroupConfig_LoadBalancers(rName string, elbCount int) string { + return fmt.Sprintf(` +data "aws_ami" "test" { + most_recent = true + owners = ["amazon"] + + filter { + name = "name" + values = ["amzn-ami-hvm-*-x86_64-gp2"] + } +} + +data "aws_availability_zones" "available" { + # t2.micro is not supported in us-west-2d + blacklisted_zone_ids = ["usw2-az4"] + state = "available" +} + +resource "aws_launch_template" "test" { + image_id = data.aws_ami.test.id + instance_type = "t3.micro" + name = %[1]q +} + +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_subnet" "test" { + availability_zone = data.aws_availability_zones.available.names[0] + cidr_block = "10.0.0.0/24" + vpc_id = aws_vpc.test.id + + tags = { + Name = %[1]q + } +} + +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id +} + +resource "aws_elb" "test" { + count = %[2]d + depends_on = ["aws_internet_gateway.test"] + + subnets = [aws_subnet.test.id] + + listener { + instance_port = 80 + instance_protocol = "http" + lb_port = 80 + lb_protocol = "http" + } +} + +resource "aws_autoscaling_group" "test" { + force_delete = true + max_size = 0 + min_size = 0 + load_balancers = length(aws_elb.test) > 0 ? aws_elb.test[*].name : [] + vpc_zone_identifier = [aws_subnet.test.id] + + launch_template { + id = aws_launch_template.test.id + } +} +`, rName, elbCount) +} + func testAccAWSAutoScalingGroupConfig_MixedInstancesPolicy_Base(rName string) string { return fmt.Sprintf(` data "aws_ami" "test" { @@ -3323,10 +3726,12 @@ resource "aws_autoscaling_group" "test" { } override { - instance_type = "t2.micro" + instance_type = "t2.micro" + weighted_capacity = "1" } override { - instance_type = "t3.small" + instance_type = "t3.small" + weighted_capacity = "2" } } } @@ -3601,3 +4006,32 @@ resource "aws_autoscaling_group" "test" { } `, rName, instanceType) } + +func testAccAWSAutoScalingGroupConfig_MixedInstancesPolicy_LaunchTemplate_Override_WeightedCapacity(rName string) string { + return testAccAWSAutoScalingGroupConfig_MixedInstancesPolicy_Base(rName) + fmt.Sprintf(` +resource "aws_autoscaling_group" "test" { + availability_zones = ["${data.aws_availability_zones.available.names[0]}"] + desired_capacity = 4 + max_size = 6 + min_size = 2 + name = %q + + mixed_instances_policy { + launch_template { + launch_template_specification { + launch_template_id = "${aws_launch_template.test.id}" + } + + override { + instance_type = "t2.micro" + weighted_capacity = "2" + } + override { + instance_type = "t3.small" + weighted_capacity = "4" + } + } + } +} +`, rName) +} diff --git a/aws/resource_aws_autoscaling_group_waiting.go b/aws/resource_aws_autoscaling_group_waiting.go index d2178adfaa2..247bd1f0fc0 100644 --- a/aws/resource_aws_autoscaling_group_waiting.go +++ b/aws/resource_aws_autoscaling_group_waiting.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "strconv" "strings" "time" @@ -121,7 +122,15 @@ func isELBCapacitySatisfied(d *schema.ResourceData, meta interface{}, g *autosca continue } - haveASG++ + capacity := 1 + if i.WeightedCapacity != nil { + capacity, err = strconv.Atoi(*i.WeightedCapacity) + if err != nil { + capacity = 1 + } + } + + haveASG += capacity inAllLbs := true for _, states := range elbis { diff --git a/aws/resource_aws_backup_plan.go b/aws/resource_aws_backup_plan.go index bf6d542457e..564f770c8f2 100644 --- a/aws/resource_aws_backup_plan.go +++ b/aws/resource_aws_backup_plan.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/backup" "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsBackupPlan() *schema.Resource { @@ -68,14 +69,10 @@ func resourceAwsBackupPlan() *schema.Resource { }, }, }, - "recovery_point_tags": { - Type: schema.TypeMap, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, + "recovery_point_tags": tagsSchema(), }, }, - Set: resourceAwsPlanRuleHash, + Set: backupBackupPlanHash, }, "arn": { Type: schema.TypeString, @@ -93,28 +90,21 @@ func resourceAwsBackupPlan() *schema.Resource { func resourceAwsBackupPlanCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).backupconn - plan := &backup.PlanInput{ - BackupPlanName: aws.String(d.Get("name").(string)), - } - - rules := expandBackupPlanRules(d.Get("rule").(*schema.Set).List()) - - plan.Rules = rules - input := &backup.CreateBackupPlanInput{ - BackupPlan: plan, - } - - if v, ok := d.GetOk("tags"); ok { - input.BackupPlanTags = tagsFromMapGeneric(v.(map[string]interface{})) + BackupPlan: &backup.PlanInput{ + BackupPlanName: aws.String(d.Get("name").(string)), + Rules: expandBackupPlanRules(d.Get("rule").(*schema.Set)), + }, + BackupPlanTags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().BackupTags(), } + log.Printf("[DEBUG] Creating Backup Plan: %#v", input) resp, err := conn.CreateBackupPlan(input) if err != nil { return fmt.Errorf("error creating Backup Plan: %s", err) } - d.SetId(*resp.BackupPlanId) + d.SetId(aws.StringValue(resp.BackupPlanId)) return resourceAwsBackupPlanRead(d, meta) } @@ -122,123 +112,60 @@ func resourceAwsBackupPlanCreate(d *schema.ResourceData, meta interface{}) error func resourceAwsBackupPlanRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).backupconn - input := &backup.GetBackupPlanInput{ + resp, err := conn.GetBackupPlan(&backup.GetBackupPlanInput{ BackupPlanId: aws.String(d.Id()), - } - - resp, err := conn.GetBackupPlan(input) + }) if isAWSErr(err, backup.ErrCodeResourceNotFoundException, "") { log.Printf("[WARN] Backup Plan (%s) not found, removing from state", d.Id()) d.SetId("") return nil } - if err != nil { - return fmt.Errorf("error reading Backup Plan: %s", err) + return fmt.Errorf("error reading Backup Plan (%s): %s", d.Id(), err) } - rule := &schema.Set{F: resourceAwsPlanRuleHash} - - for _, r := range resp.BackupPlan.Rules { - m := make(map[string]interface{}) - - m["completion_window"] = aws.Int64Value(r.CompletionWindowMinutes) - m["recovery_point_tags"] = aws.StringValueMap(r.RecoveryPointTags) - m["rule_name"] = aws.StringValue(r.RuleName) - m["schedule"] = aws.StringValue(r.ScheduleExpression) - m["start_window"] = aws.Int64Value(r.StartWindowMinutes) - m["target_vault_name"] = aws.StringValue(r.TargetBackupVaultName) - - if r.Lifecycle != nil { - l := make(map[string]interface{}) - l["delete_after"] = aws.Int64Value(r.Lifecycle.DeleteAfterDays) - l["cold_storage_after"] = aws.Int64Value(r.Lifecycle.MoveToColdStorageAfterDays) - m["lifecycle"] = []interface{}{l} - } + d.Set("arn", resp.BackupPlanArn) + d.Set("name", resp.BackupPlan.BackupPlanName) + d.Set("version", resp.VersionId) - rule.Add(m) - } - if err := d.Set("rule", rule); err != nil { + if err := d.Set("rule", flattenBackupPlanRules(resp.BackupPlan.Rules)); err != nil { return fmt.Errorf("error setting rule: %s", err) } - tagsOutput, err := conn.ListTags(&backup.ListTagsInput{ - ResourceArn: resp.BackupPlanArn, - }) + tags, err := keyvaluetags.BackupListTags(conn, d.Get("arn").(string)) if err != nil { - return fmt.Errorf("error listing tags AWS Backup plan %s: %s", d.Id(), err) + return fmt.Errorf("error listing tags for Backup Plan (%s): %s", d.Id(), err) } - - if err := d.Set("tags", tagsToMapGeneric(tagsOutput.Tags)); err != nil { - return fmt.Errorf("error setting tags on AWS Backup plan %s: %s", d.Id(), err) + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - d.Set("arn", resp.BackupPlanArn) - d.Set("version", resp.VersionId) - return nil } func resourceAwsBackupPlanUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).backupconn - plan := &backup.PlanInput{ - BackupPlanName: aws.String(d.Get("name").(string)), - } - - rules := expandBackupPlanRules(d.Get("rule").(*schema.Set).List()) - - plan.Rules = rules - - input := &backup.UpdateBackupPlanInput{ - BackupPlanId: aws.String(d.Id()), - BackupPlan: plan, - } + if d.HasChange("rule") { + input := &backup.UpdateBackupPlanInput{ + BackupPlanId: aws.String(d.Id()), + BackupPlan: &backup.PlanInput{ + BackupPlanName: aws.String(d.Get("name").(string)), + Rules: expandBackupPlanRules(d.Get("rule").(*schema.Set)), + }, + } - _, err := conn.UpdateBackupPlan(input) - if err != nil { - return fmt.Errorf("error updating Backup Plan: %s", err) + log.Printf("[DEBUG] Updating Backup Plan: %#v", input) + _, err := conn.UpdateBackupPlan(input) + if err != nil { + return fmt.Errorf("error updating Backup Plan (%s): %s", d.Id(), err) + } } if d.HasChange("tags") { - resourceArn := d.Get("arn").(string) - oraw, nraw := d.GetChange("tags") - create, remove := diffTagsGeneric(oraw.(map[string]interface{}), nraw.(map[string]interface{})) - - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - keys := make([]*string, 0, len(remove)) - for k := range remove { - keys = append(keys, aws.String(k)) - } - - _, err := conn.UntagResource(&backup.UntagResourceInput{ - ResourceArn: aws.String(resourceArn), - TagKeyList: keys, - }) - if isAWSErr(err, backup.ErrCodeResourceNotFoundException, "") { - log.Printf("[WARN] Backup Plan %s not found, removing from state", d.Id()) - d.SetId("") - return nil - } - if err != nil { - return fmt.Errorf("Error removing tags for (%s): %s", d.Id(), err) - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&backup.TagResourceInput{ - ResourceArn: aws.String(resourceArn), - Tags: create, - }) - if isAWSErr(err, backup.ErrCodeResourceNotFoundException, "") { - log.Printf("[WARN] Backup Plan %s not found, removing from state", d.Id()) - d.SetId("") - return nil - } - if err != nil { - return fmt.Errorf("Error setting tags for (%s): %s", d.Id(), err) - } + o, n := d.GetChange("tags") + if err := keyvaluetags.BackupUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags for Backup Plan (%s): %s", d.Id(), err) } } @@ -248,66 +175,64 @@ func resourceAwsBackupPlanUpdate(d *schema.ResourceData, meta interface{}) error func resourceAwsBackupPlanDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).backupconn - input := &backup.DeleteBackupPlanInput{ + log.Printf("[DEBUG] Deleting Backup Plan: %s", d.Id()) + _, err := conn.DeleteBackupPlan(&backup.DeleteBackupPlanInput{ BackupPlanId: aws.String(d.Id()), - } - - _, err := conn.DeleteBackupPlan(input) + }) if isAWSErr(err, backup.ErrCodeResourceNotFoundException, "") { return nil } if err != nil { - return fmt.Errorf("error deleting Backup Plan: %s", err) + return fmt.Errorf("error deleting Backup Plan (%s): %s", d.Id(), err) } return nil } -func expandBackupPlanRules(l []interface{}) []*backup.RuleInput { +func expandBackupPlanRules(vRules *schema.Set) []*backup.RuleInput { rules := []*backup.RuleInput{} - for _, i := range l { - item := i.(map[string]interface{}) + for _, vRule := range vRules.List() { rule := &backup.RuleInput{} - if item["rule_name"] != "" { - rule.RuleName = aws.String(item["rule_name"].(string)) + mRule := vRule.(map[string]interface{}) + + if vRuleName, ok := mRule["rule_name"].(string); ok && vRuleName != "" { + rule.RuleName = aws.String(vRuleName) + } else { + continue } - if item["target_vault_name"] != "" { - rule.TargetBackupVaultName = aws.String(item["target_vault_name"].(string)) + if vTargetVaultName, ok := mRule["target_vault_name"].(string); ok && vTargetVaultName != "" { + rule.TargetBackupVaultName = aws.String(vTargetVaultName) } - if item["schedule"] != "" { - rule.ScheduleExpression = aws.String(item["schedule"].(string)) + if vSchedule, ok := mRule["schedule"].(string); ok && vSchedule != "" { + rule.ScheduleExpression = aws.String(vSchedule) } - if item["start_window"] != nil { - rule.StartWindowMinutes = aws.Int64(int64(item["start_window"].(int))) + if vStartWindow, ok := mRule["start_window"].(int); ok { + rule.StartWindowMinutes = aws.Int64(int64(vStartWindow)) } - if item["completion_window"] != nil { - rule.CompletionWindowMinutes = aws.Int64(int64(item["completion_window"].(int))) + if vCompletionWindow, ok := mRule["completion_window"].(int); ok { + rule.CompletionWindowMinutes = aws.Int64(int64(vCompletionWindow)) } - if item["recovery_point_tags"] != nil { - rule.RecoveryPointTags = tagsFromMapGeneric(item["recovery_point_tags"].(map[string]interface{})) + if vRecoveryPointTags, ok := mRule["recovery_point_tags"].(map[string]interface{}); ok && len(vRecoveryPointTags) > 0 { + rule.RecoveryPointTags = keyvaluetags.New(vRecoveryPointTags).IgnoreAws().BackupTags() } - var lifecycle map[string]interface{} - if i.(map[string]interface{})["lifecycle"] != nil { - lifecycleRaw := i.(map[string]interface{})["lifecycle"].([]interface{}) - if len(lifecycleRaw) == 1 { - lifecycle = lifecycleRaw[0].(map[string]interface{}) - lcValues := &backup.Lifecycle{} - - if v, ok := lifecycle["delete_after"]; ok && v.(int) > 0 { - lcValues.DeleteAfterDays = aws.Int64(int64(v.(int))) - } - - if v, ok := lifecycle["cold_storage_after"]; ok && v.(int) > 0 { - lcValues.MoveToColdStorageAfterDays = aws.Int64(int64(v.(int))) - } - rule.Lifecycle = lcValues + if vLifecycle, ok := mRule["lifecycle"].([]interface{}); ok && len(vLifecycle) > 0 && vLifecycle[0] != nil { + lifecycle := &backup.Lifecycle{} + + mLifecycle := vLifecycle[0].(map[string]interface{}) + + if vDeleteAfter, ok := mLifecycle["delete_after"].(int); ok && vDeleteAfter > 0 { + lifecycle.DeleteAfterDays = aws.Int64(int64(vDeleteAfter)) + } + if vColdStorageAfter, ok := mLifecycle["cold_storage_after"].(int); ok && vColdStorageAfter > 0 { + lifecycle.MoveToColdStorageAfterDays = aws.Int64(int64(vColdStorageAfter)) } + rule.Lifecycle = lifecycle } rules = append(rules, rule) @@ -316,46 +241,68 @@ func expandBackupPlanRules(l []interface{}) []*backup.RuleInput { return rules } -func resourceAwsPlanRuleHash(v interface{}) int { - var buf bytes.Buffer - m := v.(map[string]interface{}) - - if v.(map[string]interface{})["lifecycle"] != nil { - lcRaw := v.(map[string]interface{})["lifecycle"].([]interface{}) - if len(lcRaw) == 1 { - l := lcRaw[0].(map[string]interface{}) - if w, ok := l["delete_after"]; ok { - buf.WriteString(fmt.Sprintf("%v-", w)) - } +func flattenBackupPlanRules(rules []*backup.Rule) *schema.Set { + vRules := []interface{}{} + + for _, rule := range rules { + mRule := map[string]interface{}{ + "rule_name": aws.StringValue(rule.RuleName), + "target_vault_name": aws.StringValue(rule.TargetBackupVaultName), + "schedule": aws.StringValue(rule.ScheduleExpression), + "start_window": int(aws.Int64Value(rule.StartWindowMinutes)), + "completion_window": int(aws.Int64Value(rule.CompletionWindowMinutes)), + "recovery_point_tags": keyvaluetags.BackupKeyValueTags(rule.RecoveryPointTags).IgnoreAws().Map(), + } - if w, ok := l["cold_storage_after"]; ok { - buf.WriteString(fmt.Sprintf("%v-", w)) + if lifecycle := rule.Lifecycle; lifecycle != nil { + mRule["lifecycle"] = []interface{}{ + map[string]interface{}{ + "delete_after": int(aws.Int64Value(lifecycle.DeleteAfterDays)), + "cold_storage_after": int(aws.Int64Value(lifecycle.MoveToColdStorageAfterDays)), + }, } } - } - if v, ok := m["completion_window"]; ok { - buf.WriteString(fmt.Sprintf("%d-", v.(interface{}))) + vRules = append(vRules, mRule) } - if v, ok := m["recovery_point_tags"]; ok { - buf.WriteString(fmt.Sprintf("%v-", v)) - } + return schema.NewSet(backupBackupPlanHash, vRules) +} - if v, ok := m["rule_name"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) - } +func backupBackupPlanHash(vRule interface{}) int { + var buf bytes.Buffer - if v, ok := m["schedule"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) + mRule := vRule.(map[string]interface{}) + + if v, ok := mRule["rule_name"].(string); ok { + buf.WriteString(fmt.Sprintf("%s-", v)) + } + if v, ok := mRule["target_vault_name"].(string); ok { + buf.WriteString(fmt.Sprintf("%s-", v)) + } + if v, ok := mRule["schedule"].(string); ok { + buf.WriteString(fmt.Sprintf("%s-", v)) + } + if v, ok := mRule["start_window"].(int); ok { + buf.WriteString(fmt.Sprintf("%d-", v)) + } + if v, ok := mRule["completion_window"].(int); ok { + buf.WriteString(fmt.Sprintf("%d-", v)) } - if v, ok := m["start_window"]; ok { - buf.WriteString(fmt.Sprintf("%d-", v.(interface{}))) + if vRecoveryPointTags, ok := mRule["recovery_point_tags"].(map[string]interface{}); ok && len(vRecoveryPointTags) > 0 { + buf.WriteString(fmt.Sprintf("%d-", keyvaluetags.New(vRecoveryPointTags).Hash())) } - if v, ok := m["target_vault_name"]; ok { - buf.WriteString(fmt.Sprintf("%s-", v.(string))) + if vLifecycle, ok := mRule["lifecycle"].([]interface{}); ok && len(vLifecycle) > 0 && vLifecycle[0] != nil { + mLifecycle := vLifecycle[0].(map[string]interface{}) + + if v, ok := mLifecycle["delete_after"].(int); ok { + buf.WriteString(fmt.Sprintf("%d-", v)) + } + if v, ok := mLifecycle["cold_storage_after"].(int); ok { + buf.WriteString(fmt.Sprintf("%d-", v)) + } } return hashcode.String(buf.String()) diff --git a/aws/resource_aws_backup_plan_test.go b/aws/resource_aws_backup_plan_test.go index 9fd797bd852..7ce2dab20c5 100644 --- a/aws/resource_aws_backup_plan_test.go +++ b/aws/resource_aws_backup_plan_test.go @@ -14,7 +14,9 @@ import ( func TestAccAwsBackupPlan_basic(t *testing.T) { var plan backup.GetBackupPlanOutput - rInt := acctest.RandInt() + ruleNameMap := map[string]string{} + resourceName := "aws_backup_plan.test" + rName := fmt.Sprintf("tf-testacc-backup-%s", acctest.RandStringFromCharSet(14, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, @@ -22,13 +24,19 @@ func TestAccAwsBackupPlan_basic(t *testing.T) { CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ { - Config: testAccBackupPlanConfig(rInt), + Config: testAccAwsBackupPlanConfig_basic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsBackupPlanExists("aws_backup_plan.test", &plan), - testAccMatchResourceAttrRegionalARN("aws_backup_plan.test", "arn", "backup", regexp.MustCompile(`backup-plan:.+`)), - resource.TestCheckResourceAttrSet("aws_backup_plan.test", "version"), - resource.TestCheckResourceAttr("aws_backup_plan.test", "rule.#", "1"), - resource.TestCheckNoResourceAttr("aws_backup_plan.test", "rule.712706565.lifecycle.#"), + testAccCheckAwsBackupPlanExists(resourceName, &plan, &ruleNameMap), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "backup", regexp.MustCompile(`backup-plan:.+`)), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "rule_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "target_vault_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "schedule", "cron(0 12 * * ? *)"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "lifecycle.#", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "recovery_point_tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttrSet(resourceName, "version"), ), }, }, @@ -37,7 +45,9 @@ func TestAccAwsBackupPlan_basic(t *testing.T) { func TestAccAwsBackupPlan_withTags(t *testing.T) { var plan backup.GetBackupPlanOutput - rInt := acctest.RandInt() + ruleNameMap := map[string]string{} + resourceName := "aws_backup_plan.test" + rName := fmt.Sprintf("tf-testacc-backup-%s", acctest.RandStringFromCharSet(14, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, @@ -45,28 +55,36 @@ func TestAccAwsBackupPlan_withTags(t *testing.T) { CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ { - Config: testAccBackupPlanWithTag(rInt), + Config: testAccAwsBackupPlanConfig_tags(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsBackupPlanExists("aws_backup_plan.test", &plan), - resource.TestCheckResourceAttr("aws_backup_plan.test", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_backup_plan.test", "tags.env", "test"), + testAccCheckAwsBackupPlanExists(resourceName, &plan, &ruleNameMap), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), + resource.TestCheckResourceAttr(resourceName, "tags.Key1", "Value1"), + resource.TestCheckResourceAttr(resourceName, "tags.Key2", "Value2a"), ), }, { - Config: testAccBackupPlanWithTags(rInt), + Config: testAccAwsBackupPlanConfig_tagsUpdated(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsBackupPlanExists("aws_backup_plan.test", &plan), - resource.TestCheckResourceAttr("aws_backup_plan.test", "tags.%", "2"), - resource.TestCheckResourceAttr("aws_backup_plan.test", "tags.env", "test"), - resource.TestCheckResourceAttr("aws_backup_plan.test", "tags.app", "widget"), + testAccCheckAwsBackupPlanExists(resourceName, &plan, &ruleNameMap), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), + resource.TestCheckResourceAttr(resourceName, "tags.Key2", "Value2b"), + resource.TestCheckResourceAttr(resourceName, "tags.Key3", "Value3"), ), }, { - Config: testAccBackupPlanWithTag(rInt), + Config: testAccAwsBackupPlanConfig_basic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsBackupPlanExists("aws_backup_plan.test", &plan), - resource.TestCheckResourceAttr("aws_backup_plan.test", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_backup_plan.test", "tags.env", "test"), + testAccCheckAwsBackupPlanExists(resourceName, &plan, &ruleNameMap), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, }, @@ -75,7 +93,12 @@ func TestAccAwsBackupPlan_withTags(t *testing.T) { func TestAccAwsBackupPlan_withRules(t *testing.T) { var plan backup.GetBackupPlanOutput - rInt := acctest.RandInt() + ruleNameMap := map[string]string{} + resourceName := "aws_backup_plan.test" + rName := fmt.Sprintf("tf-testacc-backup-%s", acctest.RandStringFromCharSet(14, acctest.CharSetAlphaNum)) + rule1Name := fmt.Sprintf("%s_1", rName) + rule2Name := fmt.Sprintf("%s_2", rName) + rule3Name := fmt.Sprintf("%s_3", rName) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, @@ -83,46 +106,71 @@ func TestAccAwsBackupPlan_withRules(t *testing.T) { CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ { - Config: testAccBackupPlanWithRules(rInt), + Config: testAccAwsBackupPlanConfig_twoRules(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsBackupPlanExists("aws_backup_plan.test", &plan), - resource.TestCheckResourceAttr("aws_backup_plan.test", "rule.#", "2"), + testAccCheckAwsBackupPlanExists(resourceName, &plan, &ruleNameMap), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "2"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule1Name, "rule_name", rule1Name), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule1Name, "target_vault_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule1Name, "schedule", "cron(0 12 * * ? *)"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule1Name, "lifecycle.#", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule1Name, "recovery_point_tags.%", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule2Name, "rule_name", rule2Name), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule2Name, "target_vault_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule2Name, "schedule", "cron(0 6 * * ? *)"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule2Name, "lifecycle.#", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule2Name, "recovery_point_tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, - }, - }) -} - -func TestAccAwsBackupPlan_withRuleRemove(t *testing.T) { - var plan backup.GetBackupPlanOutput - rInt := acctest.RandInt() - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAwsBackupPlanDestroy, - Steps: []resource.TestStep{ { - Config: testAccBackupPlanWithRules(rInt), + Config: testAccAwsBackupPlanConfig_threeRules(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsBackupPlanExists("aws_backup_plan.test", &plan), - resource.TestCheckResourceAttr("aws_backup_plan.test", "rule.#", "2"), + testAccCheckAwsBackupPlanExists(resourceName, &plan, &ruleNameMap), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "3"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule1Name, "rule_name", rule1Name), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule1Name, "target_vault_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule1Name, "schedule", "cron(0 6 * * ? *)"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule1Name, "lifecycle.#", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule1Name, "recovery_point_tags.%", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule2Name, "rule_name", rule2Name), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule2Name, "target_vault_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule2Name, "schedule", "cron(0 12 * * ? *)"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule2Name, "lifecycle.#", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule2Name, "recovery_point_tags.%", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule3Name, "rule_name", rule3Name), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule3Name, "target_vault_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule3Name, "schedule", "cron(0 18 * * ? *)"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule3Name, "lifecycle.#", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rule3Name, "recovery_point_tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - Config: testAccBackupPlanConfig(rInt), + Config: testAccAwsBackupPlanConfig_basic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsBackupPlanExists("aws_backup_plan.test", &plan), - resource.TestCheckResourceAttr("aws_backup_plan.test", "rule.#", "1"), + testAccCheckAwsBackupPlanExists(resourceName, &plan, &ruleNameMap), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "rule_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "target_vault_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "schedule", "cron(0 12 * * ? *)"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "lifecycle.#", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "recovery_point_tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, }, }) } -func TestAccAwsBackupPlan_withRuleAdd(t *testing.T) { +func TestAccAwsBackupPlan_withLifecycle(t *testing.T) { var plan backup.GetBackupPlanOutput - rInt := acctest.RandInt() + ruleNameMap := map[string]string{} + resourceName := "aws_backup_plan.test" + rName := fmt.Sprintf("tf-testacc-backup-%s", acctest.RandStringFromCharSet(14, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, @@ -130,68 +178,64 @@ func TestAccAwsBackupPlan_withRuleAdd(t *testing.T) { CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ { - Config: testAccBackupPlanConfig(rInt), + Config: testAccAwsBackupPlanConfig_lifecycleColdStorageAfterOnly(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsBackupPlanExists("aws_backup_plan.test", &plan), - resource.TestCheckResourceAttr("aws_backup_plan.test", "rule.#", "1"), + testAccCheckAwsBackupPlanExists(resourceName, &plan, &ruleNameMap), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "rule_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "lifecycle.#", "1"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "lifecycle.0.cold_storage_after", "7"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "lifecycle.0.delete_after", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "recovery_point_tags.%", "0"), ), }, { - Config: testAccBackupPlanWithRules(rInt), + Config: testAccAwsBackupPlanConfig_lifecycleDeleteAfterOnly(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsBackupPlanExists("aws_backup_plan.test", &plan), - resource.TestCheckResourceAttr("aws_backup_plan.test", "rule.#", "2"), + testAccCheckAwsBackupPlanExists(resourceName, &plan, &ruleNameMap), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "rule_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "lifecycle.#", "1"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "lifecycle.0.cold_storage_after", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "lifecycle.0.delete_after", "120"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "recovery_point_tags.%", "0"), ), }, - }, - }) -} - -func TestAccAwsBackupPlan_withLifecycle(t *testing.T) { - var plan backup.GetBackupPlanOutput - rStr := "lifecycle_policy" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAwsBackupPlanDestroy, - Steps: []resource.TestStep{ { - Config: testAccBackupPlanWithLifecycle(rStr), + Config: testAccAwsBackupPlanConfig_lifecycleColdStorageAfterAndDeleteAfter(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsBackupPlanExists("aws_backup_plan.test", &plan), - resource.TestCheckResourceAttr("aws_backup_plan.test", "rule.1028372010.lifecycle.#", "1"), + testAccCheckAwsBackupPlanExists(resourceName, &plan, &ruleNameMap), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "rule_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "lifecycle.#", "1"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "lifecycle.0.cold_storage_after", "30"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "lifecycle.0.delete_after", "180"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "recovery_point_tags.%", "0"), ), }, - }, - }) -} - -func TestAccAwsBackupPlan_withLifecycleDeleteAfterOnly(t *testing.T) { - var plan backup.GetBackupPlanOutput - rStr := "lifecycle_policy_two" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAwsBackupPlanDestroy, - Steps: []resource.TestStep{ { - Config: testAccBackupPlanWithLifecycleDeleteAfterOnly(rStr), + Config: testAccAwsBackupPlanConfig_basic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsBackupPlanExists("aws_backup_plan.test", &plan), - resource.TestCheckResourceAttr("aws_backup_plan.test", "rule.2156287050.lifecycle.#", "1"), - resource.TestCheckResourceAttr("aws_backup_plan.test", "rule.2156287050.lifecycle.0.delete_after", "7"), - resource.TestCheckResourceAttr("aws_backup_plan.test", "rule.2156287050.lifecycle.0.cold_storage_after", "0"), + testAccCheckAwsBackupPlanExists(resourceName, &plan, &ruleNameMap), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "rule_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "lifecycle.#", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "recovery_point_tags.%", "0"), ), }, }, }) } -func TestAccAwsBackupPlan_withLifecycleColdStorageAfterOnly(t *testing.T) { +func TestAccAwsBackupPlan_withRecoveryPointTags(t *testing.T) { var plan backup.GetBackupPlanOutput - rStr := "lifecycle_policy_three" + ruleNameMap := map[string]string{} + resourceName := "aws_backup_plan.test" + rName := fmt.Sprintf("tf-testacc-backup-%s", acctest.RandStringFromCharSet(14, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, @@ -199,12 +243,51 @@ func TestAccAwsBackupPlan_withLifecycleColdStorageAfterOnly(t *testing.T) { CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ { - Config: testAccBackupPlanWithLifecycleColdStorageAfterOnly(rStr), + Config: testAccAwsBackupPlanConfig_recoveryPointTags(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsBackupPlanExists(resourceName, &plan, &ruleNameMap), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "rule_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "target_vault_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "schedule", "cron(0 12 * * ? *)"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "lifecycle.#", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "recovery_point_tags.%", "3"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "recovery_point_tags.Name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "recovery_point_tags.Key1", "Value1"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "recovery_point_tags.Key2", "Value2a"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + { + Config: testAccAwsBackupPlanConfig_recoveryPointTagsUpdated(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsBackupPlanExists(resourceName, &plan, &ruleNameMap), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "rule_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "target_vault_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "schedule", "cron(0 12 * * ? *)"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "lifecycle.#", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "recovery_point_tags.%", "3"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "recovery_point_tags.Name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "recovery_point_tags.Key2", "Value2b"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "recovery_point_tags.Key3", "Value3"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + { + Config: testAccAwsBackupPlanConfig_basic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsBackupPlanExists("aws_backup_plan.test", &plan), - resource.TestCheckResourceAttr("aws_backup_plan.test", "rule.1300859512.lifecycle.#", "1"), - resource.TestCheckResourceAttr("aws_backup_plan.test", "rule.1300859512.lifecycle.0.delete_after", "0"), - resource.TestCheckResourceAttr("aws_backup_plan.test", "rule.1300859512.lifecycle.0.cold_storage_after", "7"), + testAccCheckAwsBackupPlanExists(resourceName, &plan, &ruleNameMap), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "rule_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "target_vault_name", rName), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "schedule", "cron(0 12 * * ? *)"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "lifecycle.#", "0"), + testAccCheckAwsBackupPlanRuleAttr(resourceName, &ruleNameMap, rName, "recovery_point_tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, }, @@ -213,7 +296,9 @@ func TestAccAwsBackupPlan_withLifecycleColdStorageAfterOnly(t *testing.T) { func TestAccAwsBackupPlan_disappears(t *testing.T) { var plan backup.GetBackupPlanOutput - rInt := acctest.RandInt() + ruleNameMap := map[string]string{} + resourceName := "aws_backup_plan.test" + rName := fmt.Sprintf("tf-testacc-backup-%s", acctest.RandStringFromCharSet(14, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBackup(t) }, @@ -221,9 +306,9 @@ func TestAccAwsBackupPlan_disappears(t *testing.T) { CheckDestroy: testAccCheckAwsBackupPlanDestroy, Steps: []resource.TestStep{ { - Config: testAccBackupPlanConfig(rInt), + Config: testAccAwsBackupPlanConfig_basic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsBackupPlanExists("aws_backup_plan.test", &plan), + testAccCheckAwsBackupPlanExists(resourceName, &plan, &ruleNameMap), testAccCheckAwsBackupPlanDisappears(&plan), ), ExpectNonEmptyPlan: true, @@ -269,186 +354,274 @@ func testAccCheckAwsBackupPlanDisappears(backupPlan *backup.GetBackupPlanOutput) } } -func testAccCheckAwsBackupPlanExists(name string, plan *backup.GetBackupPlanOutput) resource.TestCheckFunc { +func testAccCheckAwsBackupPlanExists(name string, plan *backup.GetBackupPlanOutput, ruleNameMap *map[string]string) resource.TestCheckFunc { return func(s *terraform.State) error { - rs, ok := s.RootModule().Resources[name] + conn := testAccProvider.Meta().(*AWSClient).backupconn + rs, ok := s.RootModule().Resources[name] if !ok { return fmt.Errorf("Not found: %s", name) } - if rs.Primary.ID == "" { - return fmt.Errorf("Resource ID is not set") + return fmt.Errorf("No ID is set") } - conn := testAccProvider.Meta().(*AWSClient).backupconn - - input := &backup.GetBackupPlanInput{ + output, err := conn.GetBackupPlan(&backup.GetBackupPlanInput{ BackupPlanId: aws.String(rs.Primary.ID), - } - - output, err := conn.GetBackupPlan(input) - + }) if err != nil { return err } *plan = *output + // Build map of rule name to hash value. + re := regexp.MustCompile(`^rule\.(\d+)\.rule_name$`) + for k, v := range rs.Primary.Attributes { + matches := re.FindStringSubmatch(k) + if matches != nil { + (*ruleNameMap)[v] = matches[1] + } + } + return nil } } -func testAccBackupPlanConfig(randInt int) string { +func testAccCheckAwsBackupPlanRuleAttr(name string, ruleNameMap *map[string]string, ruleName, key, value string) resource.TestCheckFunc { + return func(s *terraform.State) error { + return resource.TestCheckResourceAttr(name, fmt.Sprintf("rule.%s.%s", (*ruleNameMap)[ruleName], key), value)(s) + } +} + +func testAccAwsBackupPlanConfig_basic(rName string) string { return fmt.Sprintf(` resource "aws_backup_vault" "test" { - name = "tf_acc_test_backup_vault_%[1]d" + name = %[1]q } resource "aws_backup_plan" "test" { - name = "tf_acc_test_backup_plan_%[1]d" + name = %[1]q rule { - rule_name = "tf_acc_test_backup_rule_%[1]d" + rule_name = %[1]q target_vault_name = "${aws_backup_vault.test.name}" schedule = "cron(0 12 * * ? *)" } } -`, randInt) +`, rName) } -func testAccBackupPlanWithTag(randInt int) string { +func testAccAwsBackupPlanConfig_tags(rName string) string { return fmt.Sprintf(` resource "aws_backup_vault" "test" { - name = "tf_acc_test_backup_vault_%[1]d" + name = %[1]q } resource "aws_backup_plan" "test" { - name = "tf_acc_test_backup_plan_%[1]d" + name = %[1]q rule { - rule_name = "tf_acc_test_backup_rule_%[1]d" + rule_name = %[1]q target_vault_name = "${aws_backup_vault.test.name}" schedule = "cron(0 12 * * ? *)" } tags = { - env = "test" + Name = %[1]q + Key1 = "Value1" + Key2 = "Value2a" } } -`, randInt) +`, rName) } -func testAccBackupPlanWithTags(randInt int) string { +func testAccAwsBackupPlanConfig_tagsUpdated(rName string) string { return fmt.Sprintf(` resource "aws_backup_vault" "test" { - name = "tf_acc_test_backup_vault_%[1]d" + name = %[1]q } resource "aws_backup_plan" "test" { - name = "tf_acc_test_backup_plan_%[1]d" + name = %[1]q rule { - rule_name = "tf_acc_test_backup_rule_%[1]d" + rule_name = %[1]q target_vault_name = "${aws_backup_vault.test.name}" schedule = "cron(0 12 * * ? *)" } tags = { - env = "test" - app = "widget" + Name = %[1]q + Key2 = "Value2b" + Key3 = "Value3" + } +} +`, rName) +} + +func testAccAwsBackupPlanConfig_twoRules(rName string) string { + return fmt.Sprintf(` +resource "aws_backup_vault" "test" { + name = %[1]q +} + +resource "aws_backup_plan" "test" { + name = %[1]q + + rule { + rule_name = "%[1]s_1" + target_vault_name = "${aws_backup_vault.test.name}" + schedule = "cron(0 12 * * ? *)" + } + rule { + rule_name = "%[1]s_2" + target_vault_name = "${aws_backup_vault.test.name}" + schedule = "cron(0 6 * * ? *)" + } +} +`, rName) +} + +func testAccAwsBackupPlanConfig_threeRules(rName string) string { + return fmt.Sprintf(` +resource "aws_backup_vault" "test" { + name = %[1]q +} + +resource "aws_backup_plan" "test" { + name = %[1]q + + rule { + rule_name = "%[1]s_1" + target_vault_name = "${aws_backup_vault.test.name}" + schedule = "cron(0 6 * * ? *)" + } + rule { + rule_name = "%[1]s_2" + target_vault_name = "${aws_backup_vault.test.name}" + schedule = "cron(0 12 * * ? *)" + } + rule { + rule_name = "%[1]s_3" + target_vault_name = "${aws_backup_vault.test.name}" + schedule = "cron(0 18 * * ? *)" } } -`, randInt) +`, rName) } -func testAccBackupPlanWithLifecycle(stringID string) string { +func testAccAwsBackupPlanConfig_lifecycleColdStorageAfterOnly(rName string) string { return fmt.Sprintf(` resource "aws_backup_vault" "test" { - name = "tf_acc_test_backup_vault_%[1]s" + name = %[1]q } resource "aws_backup_plan" "test" { - name = "tf_acc_test_backup_plan_%[1]s" + name = %[1]q rule { - rule_name = "tf_acc_test_backup_rule_%[1]s" + rule_name = %[1]q target_vault_name = "${aws_backup_vault.test.name}" schedule = "cron(0 12 * * ? *)" lifecycle { - cold_storage_after = 30 - delete_after = 160 + cold_storage_after = 7 } } } -`, stringID) +`, rName) } -func testAccBackupPlanWithLifecycleDeleteAfterOnly(stringID string) string { +func testAccAwsBackupPlanConfig_lifecycleDeleteAfterOnly(rName string) string { return fmt.Sprintf(` resource "aws_backup_vault" "test" { - name = "tf_acc_test_backup_vault_%[1]s" + name = %[1]q } resource "aws_backup_plan" "test" { - name = "tf_acc_test_backup_plan_%[1]s" + name = %[1]q rule { - rule_name = "tf_acc_test_backup_rule_%[1]s" + rule_name = %[1]q target_vault_name = "${aws_backup_vault.test.name}" schedule = "cron(0 12 * * ? *)" lifecycle { - delete_after = "7" + delete_after = 120 } } } -`, stringID) +`, rName) } -func testAccBackupPlanWithLifecycleColdStorageAfterOnly(stringID string) string { +func testAccAwsBackupPlanConfig_lifecycleColdStorageAfterAndDeleteAfter(rName string) string { return fmt.Sprintf(` resource "aws_backup_vault" "test" { - name = "tf_acc_test_backup_vault_%[1]s" + name = %[1]q } resource "aws_backup_plan" "test" { - name = "tf_acc_test_backup_plan_%[1]s" + name = %[1]q rule { - rule_name = "tf_acc_test_backup_rule_%[1]s" + rule_name = %[1]q target_vault_name = "${aws_backup_vault.test.name}" schedule = "cron(0 12 * * ? *)" lifecycle { - cold_storage_after = "7" + cold_storage_after = 30 + delete_after = 180 } } } -`, stringID) +`, rName) } -func testAccBackupPlanWithRules(randInt int) string { +func testAccAwsBackupPlanConfig_recoveryPointTags(rName string) string { return fmt.Sprintf(` resource "aws_backup_vault" "test" { - name = "tf_acc_test_backup_vault_%[1]d" + name = %[1]q } resource "aws_backup_plan" "test" { - name = "tf_acc_test_backup_plan_%[1]d" + name = %[1]q rule { - rule_name = "tf_acc_test_backup_rule_%[1]d" + rule_name = %[1]q target_vault_name = "${aws_backup_vault.test.name}" schedule = "cron(0 12 * * ? *)" + + recovery_point_tags = { + Name = %[1]q + Key1 = "Value1" + Key2 = "Value2a" + } } +} +`, rName) +} + +func testAccAwsBackupPlanConfig_recoveryPointTagsUpdated(rName string) string { + return fmt.Sprintf(` +resource "aws_backup_vault" "test" { + name = %[1]q +} + +resource "aws_backup_plan" "test" { + name = %[1]q rule { - rule_name = "tf_acc_test_backup_rule_%[1]d_2" + rule_name = %[1]q target_vault_name = "${aws_backup_vault.test.name}" - schedule = "cron(0 6 * * ? *)" + schedule = "cron(0 12 * * ? *)" + + recovery_point_tags = { + Name = %[1]q + Key2 = "Value2b" + Key3 = "Value3" + } } } -`, randInt) +`, rName) } diff --git a/aws/resource_aws_backup_vault.go b/aws/resource_aws_backup_vault.go index bb7f3ccf0b8..75b2c3d9b25 100644 --- a/aws/resource_aws_backup_vault.go +++ b/aws/resource_aws_backup_vault.go @@ -5,11 +5,11 @@ import ( "log" "regexp" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/backup" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsBackupVault() *schema.Resource { @@ -29,11 +29,7 @@ func resourceAwsBackupVault() *schema.Resource { ForceNew: true, ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[a-zA-Z0-9\-\_\.]{1,50}$`), "must consist of lowercase letters, numbers, and hyphens."), }, - "tags": { - Type: schema.TypeMap, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, + "tags": tagsSchema(), "kms_key_arn": { Type: schema.TypeString, Optional: true, @@ -58,10 +54,7 @@ func resourceAwsBackupVaultCreate(d *schema.ResourceData, meta interface{}) erro input := &backup.CreateBackupVaultInput{ BackupVaultName: aws.String(d.Get("name").(string)), - } - - if v, ok := d.GetOk("tags"); ok { - input.BackupVaultTags = tagsFromMapGeneric(v.(map[string]interface{})) + BackupVaultTags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().BackupTags(), } if v, ok := d.GetOk("kms_key_arn"); ok { @@ -99,15 +92,11 @@ func resourceAwsBackupVaultRead(d *schema.ResourceData, meta interface{}) error d.Set("arn", resp.BackupVaultArn) d.Set("recovery_points", resp.NumberOfRecoveryPoints) - tresp, err := conn.ListTags(&backup.ListTagsInput{ - ResourceArn: aws.String(*resp.BackupVaultArn), - }) - + tags, err := keyvaluetags.BackupListTags(conn, d.Get("arn").(string)) if err != nil { - return fmt.Errorf("error retrieving Backup Vault (%s) tags: %s", aws.StringValue(resp.BackupVaultArn), err) + return fmt.Errorf("error listing tags for Backup Vault (%s): %s", d.Id(), err) } - - if err := d.Set("tags", tagsToMapGeneric(tresp.Tags)); err != nil { + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -118,44 +107,9 @@ func resourceAwsBackupVaultUpdate(d *schema.ResourceData, meta interface{}) erro conn := meta.(*AWSClient).backupconn if d.HasChange("tags") { - resourceArn := d.Get("arn").(string) - oraw, nraw := d.GetChange("tags") - create, remove := diffTagsGeneric(oraw.(map[string]interface{}), nraw.(map[string]interface{})) - - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - keys := make([]*string, 0, len(remove)) - for k := range remove { - keys = append(keys, aws.String(k)) - } - - _, err := conn.UntagResource(&backup.UntagResourceInput{ - ResourceArn: aws.String(resourceArn), - TagKeyList: keys, - }) - if isAWSErr(err, backup.ErrCodeResourceNotFoundException, "") { - log.Printf("[WARN] Backup Vault %s not found, removing from state", d.Id()) - d.SetId("") - return nil - } - if err != nil { - return fmt.Errorf("Error removing tags for (%s): %s", d.Id(), err) - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&backup.TagResourceInput{ - ResourceArn: aws.String(resourceArn), - Tags: create, - }) - if isAWSErr(err, backup.ErrCodeResourceNotFoundException, "") { - log.Printf("[WARN] Backup Vault %s not found, removing from state", d.Id()) - d.SetId("") - return nil - } - if err != nil { - return fmt.Errorf("Error setting tags for (%s): %s", d.Id(), err) - } + o, n := d.GetChange("tags") + if err := keyvaluetags.BackupUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags for Backup Vault (%s): %s", d.Id(), err) } } diff --git a/aws/resource_aws_batch_compute_environment.go b/aws/resource_aws_batch_compute_environment.go index a382d48ed6e..b605d3dc014 100644 --- a/aws/resource_aws_batch_compute_environment.go +++ b/aws/resource_aws_batch_compute_environment.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsBatchComputeEnvironment() *schema.Resource { @@ -19,12 +20,27 @@ func resourceAwsBatchComputeEnvironment() *schema.Resource { Update: resourceAwsBatchComputeEnvironmentUpdate, Delete: resourceAwsBatchComputeEnvironmentDelete, + Importer: &schema.ResourceImporter{ + State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + d.Set("compute_environment_name", d.Id()) + return []*schema.ResourceData{d}, nil + }, + }, Schema: map[string]*schema.Schema{ "compute_environment_name": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validateBatchName, + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ConflictsWith: []string{"compute_environment_name_prefix"}, + ValidateFunc: validateBatchName, + }, + "compute_environment_name_prefix": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ConflictsWith: []string{"compute_environment_name"}, + ValidateFunc: validateBatchPrefix, }, "compute_resources": { Type: schema.TypeList, @@ -33,6 +49,15 @@ func resourceAwsBatchComputeEnvironment() *schema.Resource { MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + "allocation_strategy": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + batch.CRAllocationStrategyBestFit, + batch.CRAllocationStrategyBestFitProgressive, + batch.CRAllocationStrategySpotCapacityOptimized}, true), + }, "bid_percentage": { Type: schema.TypeInt, Optional: true, @@ -75,15 +100,18 @@ func resourceAwsBatchComputeEnvironment() *schema.Resource { Type: schema.TypeString, Optional: true, ConflictsWith: []string{"compute_resources.0.launch_template.0.launch_template_name"}, + ForceNew: true, }, "launch_template_name": { Type: schema.TypeString, Optional: true, ConflictsWith: []string{"compute_resources.0.launch_template.0.launch_template_id"}, + ForceNew: true, }, "version": { Type: schema.TypeString, Optional: true, + ForceNew: true, }, }, }, @@ -114,7 +142,7 @@ func resourceAwsBatchComputeEnvironment() *schema.Resource { ForceNew: true, Elem: &schema.Schema{Type: schema.TypeString}, }, - "tags": tagsSchema(), + "tags": tagsSchemaForceNew(), "type": { Type: schema.TypeString, Required: true, @@ -169,7 +197,16 @@ func resourceAwsBatchComputeEnvironment() *schema.Resource { func resourceAwsBatchComputeEnvironmentCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).batchconn - computeEnvironmentName := d.Get("compute_environment_name").(string) + // Build the compute environment name. + var computeEnvironmentName string + if v, ok := d.GetOk("compute_environment_name"); ok { + computeEnvironmentName = v.(string) + } else if v, ok := d.GetOk("compute_environment_name_prefix"); ok { + computeEnvironmentName = resource.PrefixedUniqueId(v.(string)) + } else { + computeEnvironmentName = resource.UniqueId() + } + d.Set("compute_environment_name", computeEnvironmentName) serviceRole := d.Get("service_role").(string) computeEnvironmentType := d.Get("type").(string) @@ -221,6 +258,9 @@ func resourceAwsBatchComputeEnvironmentCreate(d *schema.ResourceData, meta inter Type: aws.String(computeResourceType), } + if v, ok := computeResource["allocation_strategy"]; ok { + input.ComputeResources.AllocationStrategy = aws.String(v.(string)) + } if v, ok := computeResource["bid_percentage"]; ok { input.ComputeResources.BidPercentage = aws.Int64(int64(v.(int))) } @@ -237,7 +277,7 @@ func resourceAwsBatchComputeEnvironmentCreate(d *schema.ResourceData, meta inter input.ComputeResources.SpotIamFleetRole = aws.String(v.(string)) } if v, ok := computeResource["tags"]; ok { - input.ComputeResources.Tags = tagsFromMapGeneric(v.(map[string]interface{})) + input.ComputeResources.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().BatchTags() } if raw, ok := computeResource["launch_template"]; ok && len(raw.([]interface{})) > 0 { @@ -322,6 +362,7 @@ func flattenBatchComputeResources(computeResource *batch.ComputeResource) []map[ result := make([]map[string]interface{}, 0) m := make(map[string]interface{}) + m["allocation_strategy"] = aws.StringValue(computeResource.AllocationStrategy) m["bid_percentage"] = int(aws.Int64Value(computeResource.BidPercentage)) m["desired_vcpus"] = int(aws.Int64Value(computeResource.DesiredvCpus)) m["ec2_key_pair"] = aws.StringValue(computeResource.Ec2KeyPair) @@ -333,7 +374,7 @@ func flattenBatchComputeResources(computeResource *batch.ComputeResource) []map[ m["security_group_ids"] = schema.NewSet(schema.HashString, flattenStringList(computeResource.SecurityGroupIds)) m["spot_iam_fleet_role"] = aws.StringValue(computeResource.SpotIamFleetRole) m["subnets"] = schema.NewSet(schema.HashString, flattenStringList(computeResource.Subnets)) - m["tags"] = tagsToMapGeneric(computeResource.Tags) + m["tags"] = keyvaluetags.BatchKeyValueTags(computeResource.Tags).IgnoreAws().Map() m["type"] = aws.StringValue(computeResource.Type) if launchTemplate := computeResource.LaunchTemplate; launchTemplate != nil { diff --git a/aws/resource_aws_batch_compute_environment_test.go b/aws/resource_aws_batch_compute_environment_test.go index 727c25409d4..913c0da0cce 100644 --- a/aws/resource_aws_batch_compute_environment_test.go +++ b/aws/resource_aws_batch_compute_environment_test.go @@ -81,9 +81,30 @@ func TestAccAWSBatchComputeEnvironment_createEc2(t *testing.T) { }) } -func TestAccAWSBatchComputeEnvironment_createEc2WithTags(t *testing.T) { +func TestAccAWSBatchComputeEnvironment_createWithNamePrefix(t *testing.T) { rInt := acctest.RandInt() + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSBatchComputeEnvironmentConfigNamePrefix(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsBatchComputeEnvironmentExists(), + resource.TestMatchResourceAttr( + "aws_batch_compute_environment.ec2", "compute_environment_name", regexp.MustCompile("^tf_acc_test"), + ), + ), + }, + }, + }) +} + +func TestAccAWSBatchComputeEnvironment_createEc2WithTags(t *testing.T) { + rInt := acctest.RandInt() + resourceName := "aws_batch_compute_environment.ec2" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, Providers: testAccProviders, @@ -93,10 +114,15 @@ func TestAccAWSBatchComputeEnvironment_createEc2WithTags(t *testing.T) { Config: testAccAWSBatchComputeEnvironmentConfigEC2WithTags(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckAwsBatchComputeEnvironmentExists(), - resource.TestCheckResourceAttr("aws_batch_compute_environment.ec2", "compute_resources.0.tags.%", "1"), - resource.TestCheckResourceAttr("aws_batch_compute_environment.ec2", "compute_resources.0.tags.Key1", "Value1"), + resource.TestCheckResourceAttr(resourceName, "compute_resources.0.tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "compute_resources.0.tags.Key1", "Value1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -139,6 +165,7 @@ func TestAccAWSBatchComputeEnvironment_createUnmanaged(t *testing.T) { func TestAccAWSBatchComputeEnvironment_updateMaxvCpus(t *testing.T) { rInt := acctest.RandInt() + resourceName := "aws_batch_compute_environment.ec2" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, @@ -149,22 +176,28 @@ func TestAccAWSBatchComputeEnvironment_updateMaxvCpus(t *testing.T) { Config: testAccAWSBatchComputeEnvironmentConfigEC2(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckAwsBatchComputeEnvironmentExists(), - resource.TestCheckResourceAttr("aws_batch_compute_environment.ec2", "compute_resources.0.max_vcpus", "16"), + resource.TestCheckResourceAttr(resourceName, "compute_resources.0.max_vcpus", "16"), ), }, { Config: testAccAWSBatchComputeEnvironmentConfigEC2UpdateMaxvCpus(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckAwsBatchComputeEnvironmentExists(), - resource.TestCheckResourceAttr("aws_batch_compute_environment.ec2", "compute_resources.0.max_vcpus", "32"), + resource.TestCheckResourceAttr(resourceName, "compute_resources.0.max_vcpus", "32"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSBatchComputeEnvironment_updateInstanceType(t *testing.T) { rInt := acctest.RandInt() + resourceName := "aws_batch_compute_environment.ec2" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, @@ -175,16 +208,21 @@ func TestAccAWSBatchComputeEnvironment_updateInstanceType(t *testing.T) { Config: testAccAWSBatchComputeEnvironmentConfigEC2(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckAwsBatchComputeEnvironmentExists(), - resource.TestCheckResourceAttr("aws_batch_compute_environment.ec2", "compute_resources.0.instance_type.#", "1"), + resource.TestCheckResourceAttr(resourceName, "compute_resources.0.instance_type.#", "1"), ), }, { Config: testAccAWSBatchComputeEnvironmentConfigEC2UpdateInstanceType(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckAwsBatchComputeEnvironmentExists(), - resource.TestCheckResourceAttr("aws_batch_compute_environment.ec2", "compute_resources.0.instance_type.#", "2"), + resource.TestCheckResourceAttr(resourceName, "compute_resources.0.instance_type.#", "2"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -193,6 +231,7 @@ func TestAccAWSBatchComputeEnvironment_updateComputeEnvironmentName(t *testing.T rInt := acctest.RandInt() expectedName := fmt.Sprintf("tf_acc_test_%d", rInt) expectedUpdatedName := fmt.Sprintf("tf_acc_test_updated_%d", rInt) + resourceName := "aws_batch_compute_environment.ec2" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, @@ -203,16 +242,21 @@ func TestAccAWSBatchComputeEnvironment_updateComputeEnvironmentName(t *testing.T Config: testAccAWSBatchComputeEnvironmentConfigEC2(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckAwsBatchComputeEnvironmentExists(), - resource.TestCheckResourceAttr("aws_batch_compute_environment.ec2", "compute_environment_name", expectedName), + resource.TestCheckResourceAttr(resourceName, "compute_environment_name", expectedName), ), }, { Config: testAccAWSBatchComputeEnvironmentConfigEC2UpdateComputeEnvironmentName(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckAwsBatchComputeEnvironmentExists(), - resource.TestCheckResourceAttr("aws_batch_compute_environment.ec2", "compute_environment_name", expectedUpdatedName), + resource.TestCheckResourceAttr(resourceName, "compute_environment_name", expectedUpdatedName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -254,6 +298,7 @@ func TestAccAWSBatchComputeEnvironment_createUnmanagedWithComputeResources(t *te func TestAccAWSBatchComputeEnvironment_launchTemplate(t *testing.T) { rInt := acctest.RandInt() + resourceName := "aws_batch_compute_environment.ec2" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, @@ -264,14 +309,70 @@ func TestAccAWSBatchComputeEnvironment_launchTemplate(t *testing.T) { Config: testAccAWSBatchComputeEnvironmentConfigLaunchTemplate(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckAwsBatchComputeEnvironmentExists(), - resource.TestCheckResourceAttr("aws_batch_compute_environment.ec2", + resource.TestCheckResourceAttr(resourceName, "compute_resources.0.launch_template.#", "1"), - resource.TestCheckResourceAttr("aws_batch_compute_environment.ec2", + resource.TestCheckResourceAttr(resourceName, "compute_resources.0.launch_template.0.launch_template_name", fmt.Sprintf("tf_acc_test_%d", rInt)), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSBatchComputeEnvironment_UpdateLaunchTemplate(t *testing.T) { + rInt := acctest.RandInt() + resourceName := "aws_batch_compute_environment.ec2" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSBatchComputeEnvironmentUpdateLaunchTemplateInExistingComputeEnvironment(rInt, "$Default"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsBatchComputeEnvironmentExists(), + resource.TestCheckResourceAttr(resourceName, "compute_resources.0.launch_template.0.version", "$Default"), + ), + }, + { + Config: testAccAWSBatchComputeEnvironmentUpdateLaunchTemplateInExistingComputeEnvironment(rInt, "$Latest"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsBatchComputeEnvironmentExists(), + resource.TestCheckResourceAttr(resourceName, "compute_resources.0.launch_template.0.version", "$Latest"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSBatchComputeEnvironment_createSpotWithAllocationStrategy(t *testing.T) { + rInt := acctest.RandInt() + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckBatchComputeEnvironmentDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSBatchComputeEnvironmentConfigSpotWithAllocationStrategy(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsBatchComputeEnvironmentExists(), + resource.TestCheckResourceAttr("aws_batch_compute_environment.ec2", "compute_resources.0.allocation_strategy", "BEST_FIT"), + ), + }, }, }) } @@ -294,6 +395,7 @@ func TestAccAWSBatchComputeEnvironment_createSpotWithoutBidPercentage(t *testing func TestAccAWSBatchComputeEnvironment_updateState(t *testing.T) { rInt := acctest.RandInt() + resourceName := "aws_batch_compute_environment.ec2" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, @@ -304,16 +406,21 @@ func TestAccAWSBatchComputeEnvironment_updateState(t *testing.T) { Config: testAccAWSBatchComputeEnvironmentConfigEC2UpdateState(rInt, batch.CEStateEnabled), Check: resource.ComposeTestCheckFunc( testAccCheckAwsBatchComputeEnvironmentExists(), - resource.TestCheckResourceAttr("aws_batch_compute_environment.ec2", "state", batch.CEStateEnabled), + resource.TestCheckResourceAttr(resourceName, "state", batch.CEStateEnabled), ), }, { Config: testAccAWSBatchComputeEnvironmentConfigEC2UpdateState(rInt, batch.CEStateDisabled), Check: resource.ComposeTestCheckFunc( testAccCheckAwsBatchComputeEnvironmentExists(), - resource.TestCheckResourceAttr("aws_batch_compute_environment.ec2", "state", batch.CEStateDisabled), + resource.TestCheckResourceAttr(resourceName, "state", batch.CEStateDisabled), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -391,6 +498,8 @@ func testAccPreCheckAWSBatch(t *testing.T) { func testAccAWSBatchComputeEnvironmentConfigBase(rInt int) string { return fmt.Sprintf(` +data "aws_partition" "current" {} + ########## ecs_instance_role ########## resource "aws_iam_role" "ecs_instance_role" { @@ -404,7 +513,7 @@ resource "aws_iam_role" "ecs_instance_role" { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { - "Service": "ec2.amazonaws.com" + "Service": "ec2.${data.aws_partition.current.dns_suffix}" } } ] @@ -414,7 +523,7 @@ EOF resource "aws_iam_role_policy_attachment" "ecs_instance_role" { role = "${aws_iam_role.ecs_instance_role.name}" - policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role" + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/service-role/AmazonEC2ContainerServiceforEC2Role" } resource "aws_iam_instance_profile" "ecs_instance_role" { @@ -435,7 +544,7 @@ resource "aws_iam_role" "aws_batch_service_role" { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { - "Service": "batch.amazonaws.com" + "Service": "batch.${data.aws_partition.current.dns_suffix}" } } ] @@ -445,7 +554,7 @@ EOF resource "aws_iam_role_policy_attachment" "aws_batch_service_role" { role = "${aws_iam_role.aws_batch_service_role.name}" - policy_arn = "arn:aws:iam::aws:policy/service-role/AWSBatchServiceRole" + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/service-role/AWSBatchServiceRole" } ########## aws_ec2_spot_fleet_role ########## @@ -461,7 +570,7 @@ resource "aws_iam_role" "aws_ec2_spot_fleet_role" { "Action": "sts:AssumeRole", "Effect": "Allow", "Principal": { - "Service": "spotfleet.amazonaws.com" + "Service": "spotfleet.${data.aws_partition.current.dns_suffix}" } } ] @@ -471,7 +580,7 @@ EOF resource "aws_iam_role_policy_attachment" "aws_ec2_spot_fleet_role" { role = "${aws_iam_role.aws_ec2_spot_fleet_role.name}" - policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2SpotFleetRole" + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/service-role/AmazonEC2SpotFleetTaggingRole" } ########## security group ########## @@ -527,6 +636,32 @@ resource "aws_batch_compute_environment" "ec2" { `, rInt) } +func testAccAWSBatchComputeEnvironmentConfigNamePrefix(rInt int) string { + return testAccAWSBatchComputeEnvironmentConfigBase(rInt) + ` +resource "aws_batch_compute_environment" "ec2" { + compute_environment_name_prefix = "tf_acc_test" + compute_resources { + instance_role = "${aws_iam_instance_profile.ecs_instance_role.arn}" + instance_type = [ + "c4.large", + ] + max_vcpus = 16 + min_vcpus = 0 + security_group_ids = [ + "${aws_security_group.test_acc.id}" + ] + subnets = [ + "${aws_subnet.test_acc.id}" + ] + type = "EC2" + } + service_role = "${aws_iam_role.aws_batch_service_role.arn}" + type = "MANAGED" + depends_on = ["aws_iam_role_policy_attachment.aws_batch_service_role"] +} +` +} + func testAccAWSBatchComputeEnvironmentConfigEC2WithTags(rInt int) string { return testAccAWSBatchComputeEnvironmentConfigBase(rInt) + fmt.Sprintf(` resource "aws_batch_compute_environment" "ec2" { @@ -738,6 +873,34 @@ resource "aws_batch_compute_environment" "unmanaged" { `, rInt) } +func testAccAWSBatchComputeEnvironmentConfigSpotWithAllocationStrategy(rInt int) string { + return testAccAWSBatchComputeEnvironmentConfigBase(rInt) + fmt.Sprintf(` +resource "aws_batch_compute_environment" "ec2" { + compute_environment_name = "tf_acc_test_%d" + compute_resources { + allocation_strategy = "BEST_FIT" + instance_role = "${aws_iam_instance_profile.ecs_instance_role.arn}" + instance_type = [ + "c4.large", + ] + max_vcpus = 16 + min_vcpus = 0 + security_group_ids = [ + "${aws_security_group.test_acc.id}" + ] + spot_iam_fleet_role = "${aws_iam_role.aws_ec2_spot_fleet_role.arn}" + subnets = [ + "${aws_subnet.test_acc.id}" + ] + type = "SPOT" + } + service_role = "${aws_iam_role.aws_batch_service_role.arn}" + type = "MANAGED" + depends_on = ["aws_iam_role_policy_attachment.aws_batch_service_role"] +} +`, rInt) +} + func testAccAWSBatchComputeEnvironmentConfigSpotWithoutBidPercentage(rInt int) string { return testAccAWSBatchComputeEnvironmentConfigBase(rInt) + fmt.Sprintf(` resource "aws_batch_compute_environment" "ec2" { @@ -797,3 +960,38 @@ resource "aws_batch_compute_environment" "ec2" { } `, rInt, rInt) } + +func testAccAWSBatchComputeEnvironmentUpdateLaunchTemplateInExistingComputeEnvironment(rInt int, version string) string { + return testAccAWSBatchComputeEnvironmentConfigBase(rInt) + fmt.Sprintf(` +resource "aws_launch_template" "foo" { + name = "tf_acc_test_%d" +} + +resource "aws_batch_compute_environment" "ec2" { + compute_environment_name = "tf_acc_test_%d" + compute_resources { + instance_role = "${aws_iam_instance_profile.ecs_instance_role.arn}" + instance_type = [ + "c4.large", + ] + launch_template { + launch_template_name = "${aws_launch_template.foo.name}" + version = "%s" + } + max_vcpus = 16 + min_vcpus = 0 + security_group_ids = [ + "${aws_security_group.test_acc.id}" + ] + spot_iam_fleet_role = "${aws_iam_role.aws_ec2_spot_fleet_role.arn}" + subnets = [ + "${aws_subnet.test_acc.id}" + ] + type = "SPOT" + } + service_role = "${aws_iam_role.aws_batch_service_role.arn}" + type = "MANAGED" + depends_on = ["aws_iam_role_policy_attachment.aws_batch_service_role"] +} +`, rInt, rInt, version) +} diff --git a/aws/resource_aws_batch_job_definition.go b/aws/resource_aws_batch_job_definition.go index f2b5d049fbc..715c7d2bbdc 100644 --- a/aws/resource_aws_batch_job_definition.go +++ b/aws/resource_aws_batch_job_definition.go @@ -6,10 +6,12 @@ import ( "encoding/json" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" "github.com/aws/aws-sdk-go/service/batch" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/structure" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/service/batch/equivalency" ) func resourceAwsBatchJobDefinition() *schema.Resource { @@ -18,6 +20,13 @@ func resourceAwsBatchJobDefinition() *schema.Resource { Read: resourceAwsBatchJobDefinitionRead, Delete: resourceAwsBatchJobDefinitionDelete, + Importer: &schema.ResourceImporter{ + State: func(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + d.Set("arn", d.Id()) + return []*schema.ResourceData{d}, nil + }, + }, + Schema: map[string]*schema.Schema{ "name": { Type: schema.TypeString, @@ -33,8 +42,12 @@ func resourceAwsBatchJobDefinition() *schema.Resource { json, _ := structure.NormalizeJsonString(v) return json }, - DiffSuppressFunc: suppressEquivalentJsonDiffs, - ValidateFunc: validateAwsBatchJobContainerProperties, + DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { + equal, _ := equivalency.EquivalentBatchContainerPropertiesJSON(old, new) + + return equal + }, + ValidateFunc: validateAwsBatchJobContainerProperties, }, "parameters": { Type: schema.TypeMap, @@ -142,7 +155,19 @@ func resourceAwsBatchJobDefinitionRead(d *schema.ResourceData, meta interface{}) return nil } d.Set("arn", job.JobDefinitionArn) - d.Set("container_properties", job.ContainerProperties) + + containerProperties, err := flattenBatchContainerProperties(job.ContainerProperties) + + if err != nil { + return fmt.Errorf("error converting Batch Container Properties to JSON: %s", err) + } + + if err := d.Set("container_properties", containerProperties); err != nil { + return fmt.Errorf("error setting container_properties: %s", err) + } + + d.Set("name", job.JobDefinitionName) + d.Set("parameters", aws.StringValueMap(job.Parameters)) if err := d.Set("retry_strategy", flattenBatchRetryStrategy(job.RetryStrategy)); err != nil { @@ -215,6 +240,17 @@ func expandBatchJobContainerProperties(rawProps string) (*batch.ContainerPropert return props, nil } +// Convert batch.ContainerProperties object into its JSON representation +func flattenBatchContainerProperties(containerProperties *batch.ContainerProperties) (string, error) { + b, err := jsonutil.BuildJSON(containerProperties) + + if err != nil { + return "", err + } + + return string(b), nil +} + func expandJobDefinitionParameters(params map[string]interface{}) map[string]*string { var jobParams = make(map[string]*string) for k, v := range params { diff --git a/aws/resource_aws_batch_job_definition_test.go b/aws/resource_aws_batch_job_definition_test.go index 928f7a53b9e..c63f1ee04e5 100644 --- a/aws/resource_aws_batch_job_definition_test.go +++ b/aws/resource_aws_batch_job_definition_test.go @@ -2,10 +2,8 @@ package aws import ( "fmt" - "strings" - "testing" - "reflect" + "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/batch" @@ -15,6 +13,31 @@ import ( ) func TestAccAWSBatchJobDefinition_basic(t *testing.T) { + var jd batch.JobDefinition + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_batch_job_definition.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckBatchJobDefinitionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccBatchJobDefinitionConfigName(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckBatchJobDefinitionExists(resourceName, &jd), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSBatchJobDefinition_ContainerProperties_Advanced(t *testing.T) { var jd batch.JobDefinition compare := batch.JobDefinition{ Parameters: map[string]*string{ @@ -37,61 +60,72 @@ func TestAccAWSBatchJobDefinition_basic(t *testing.T) { MountPoints: []*batch.MountPoint{ {ContainerPath: aws.String("/tmp"), ReadOnly: aws.Bool(false), SourceVolume: aws.String("tmp")}, }, + ResourceRequirements: []*batch.ResourceRequirement{}, Ulimits: []*batch.Ulimit{ {HardLimit: aws.Int64(int64(1024)), Name: aws.String("nofile"), SoftLimit: aws.Int64(int64(1024))}, }, + Vcpus: aws.Int64(int64(1)), Volumes: []*batch.Volume{ { Host: &batch.Host{SourcePath: aws.String("/tmp")}, Name: aws.String("tmp"), }, }, - Vcpus: aws.Int64(int64(1)), }, } - ri := acctest.RandInt() - config := fmt.Sprintf(testAccBatchJobDefinitionBaseConfig, ri) + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_batch_job_definition.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckBatchJobDefinitionDestroy, Steps: []resource.TestStep{ { - Config: config, + Config: testAccBatchJobDefinitionConfigContainerPropertiesAdvanced(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBatchJobDefinitionExists("aws_batch_job_definition.test", &jd), + testAccCheckBatchJobDefinitionExists(resourceName, &jd), testAccCheckBatchJobDefinitionAttributes(&jd, &compare), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSBatchJobDefinition_updateForcesNewResource(t *testing.T) { - var before batch.JobDefinition - var after batch.JobDefinition - ri := acctest.RandInt() - config := fmt.Sprintf(testAccBatchJobDefinitionBaseConfig, ri) - updateConfig := fmt.Sprintf(testAccBatchJobDefinitionUpdateConfig, ri) + var before, after batch.JobDefinition + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_batch_job_definition.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSBatch(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckBatchJobDefinitionDestroy, Steps: []resource.TestStep{ { - Config: config, + Config: testAccBatchJobDefinitionConfigContainerPropertiesAdvanced(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBatchJobDefinitionExists("aws_batch_job_definition.test", &before), + testAccCheckBatchJobDefinitionExists(resourceName, &before), testAccCheckBatchJobDefinitionAttributes(&before, nil), ), }, { - Config: updateConfig, + Config: testAccBatchJobDefinitionConfigContainerPropertiesAdvancedUpdate(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBatchJobDefinitionExists("aws_batch_job_definition.test", &after), + testAccCheckBatchJobDefinitionExists(resourceName, &after), testAccCheckJobDefinitionRecreated(t, &before, &after), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -124,9 +158,6 @@ func testAccCheckBatchJobDefinitionExists(n string, jd *batch.JobDefinition) res func testAccCheckBatchJobDefinitionAttributes(jd *batch.JobDefinition, compare *batch.JobDefinition) resource.TestCheckFunc { return func(s *terraform.State) error { - if !strings.HasPrefix(*jd.JobDefinitionName, "tf_acctest_batch_job_definition") { - return fmt.Errorf("Bad Job Definition name: %s", *jd.JobDefinitionName) - } for _, rs := range s.RootModule().Resources { if rs.Type != "aws_batch_job_definition" { continue @@ -177,9 +208,10 @@ func testAccCheckBatchJobDefinitionDestroy(s *terraform.State) error { return nil } -const testAccBatchJobDefinitionBaseConfig = ` +func testAccBatchJobDefinitionConfigContainerPropertiesAdvanced(rName string) string { + return fmt.Sprintf(` resource "aws_batch_job_definition" "test" { - name = "tf_acctest_batch_job_definition_%[1]d" + name = %[1]q type = "container" parameters = { param1 = "val1" @@ -225,11 +257,13 @@ resource "aws_batch_job_definition" "test" { } CONTAINER_PROPERTIES } -` +`, rName) +} -const testAccBatchJobDefinitionUpdateConfig = ` +func testAccBatchJobDefinitionConfigContainerPropertiesAdvancedUpdate(rName string) string { + return fmt.Sprintf(` resource "aws_batch_job_definition" "test" { - name = "tf_acctest_batch_job_definition_%[1]d" + name = %[1]q type = "container" container_properties = < 0 { + if err := keyvaluetags.Cloudhsmv2UpdateTags(cloudhsm2, d.Id(), nil, v); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } } return resourceAwsCloudHsm2ClusterRead(d, meta) } func resourceAwsCloudHsm2ClusterRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).cloudhsmv2conn - cluster, err := describeCloudHsm2Cluster(meta.(*AWSClient).cloudhsmv2conn, d.Id()) + cluster, err := describeCloudHsm2Cluster(conn, d.Id()) if cluster == nil { log.Printf("[WARN] CloudHSMv2 Cluster (%s) not found", d.Id()) @@ -249,14 +252,27 @@ func resourceAwsCloudHsm2ClusterRead(d *schema.ResourceData, meta interface{}) e return fmt.Errorf("Error saving Subnet IDs to state for CloudHSMv2 Cluster (%s): %s", d.Id(), err) } + tags, err := keyvaluetags.Cloudhsmv2ListTags(conn, d.Id()) + + if err != nil { + return fmt.Errorf("error listing tags for resource (%s): %s", d.Id(), err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + return nil } func resourceAwsCloudHsm2ClusterUpdate(d *schema.ResourceData, meta interface{}) error { - cloudhsm2 := meta.(*AWSClient).cloudhsmv2conn + conn := meta.(*AWSClient).cloudhsmv2conn - if err := setTagsAwsCloudHsm2Cluster(cloudhsm2, d); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.Cloudhsmv2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } } return resourceAwsCloudHsm2ClusterRead(d, meta) @@ -296,48 +312,6 @@ func resourceAwsCloudHsm2ClusterDelete(d *schema.ResourceData, meta interface{}) return nil } -func setTagsAwsCloudHsm2Cluster(conn *cloudhsmv2.CloudHSMV2, d *schema.ResourceData) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - create, remove := diffTagsGeneric(oraw.(map[string]interface{}), nraw.(map[string]interface{})) - - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - keys := make([]*string, 0, len(remove)) - for k := range remove { - keys = append(keys, aws.String(k)) - } - - _, err := conn.UntagResource(&cloudhsmv2.UntagResourceInput{ - ResourceId: aws.String(d.Id()), - TagKeyList: keys, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - tagList := make([]*cloudhsmv2.Tag, 0, len(create)) - for k, v := range create { - tagList = append(tagList, &cloudhsmv2.Tag{ - Key: &k, - Value: v, - }) - } - _, err := conn.TagResource(&cloudhsmv2.TagResourceInput{ - ResourceId: aws.String(d.Id()), - TagList: tagList, - }) - if err != nil { - return err - } - } - } - - return nil -} - func readCloudHsm2ClusterCertificates(cluster *cloudhsmv2.Cluster) []map[string]interface{} { certs := map[string]interface{}{} if cluster.Certificates != nil { diff --git a/aws/resource_aws_cloudhsm2_cluster_test.go b/aws/resource_aws_cloudhsm2_cluster_test.go index 2d9c3a4c7e7..6ec1d8f8b13 100644 --- a/aws/resource_aws_cloudhsm2_cluster_test.go +++ b/aws/resource_aws_cloudhsm2_cluster_test.go @@ -8,7 +8,6 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudhsmv2" - "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) @@ -85,32 +84,77 @@ func testSweepCloudhsmv2Clusters(region string) error { } func TestAccAWSCloudHsm2Cluster_basic(t *testing.T) { - resource.Test(t, resource.TestCase{ + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudHsm2ClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCloudHsm2Cluster(), + Config: testAccAWSCloudHsm2ClusterConfig(), Check: resource.ComposeTestCheckFunc( testAccCheckAWSCloudHsm2ClusterExists("aws_cloudhsm_v2_cluster.cluster"), resource.TestCheckResourceAttrSet("aws_cloudhsm_v2_cluster.cluster", "cluster_id"), resource.TestCheckResourceAttrSet("aws_cloudhsm_v2_cluster.cluster", "vpc_id"), resource.TestCheckResourceAttrSet("aws_cloudhsm_v2_cluster.cluster", "security_group_id"), resource.TestCheckResourceAttrSet("aws_cloudhsm_v2_cluster.cluster", "cluster_state"), + resource.TestCheckResourceAttr("aws_cloudhsm_v2_cluster.cluster", "tags.%", "0"), ), }, { ResourceName: "aws_cloudhsm_v2_cluster.cluster", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"cluster_certificates", "tags"}, + ImportStateVerifyIgnore: []string{"cluster_certificates"}, }, }, }) } -func testAccAWSCloudHsm2Cluster() string { +func TestAccAWSCloudHsm2Cluster_Tags(t *testing.T) { + resourceName := "aws_cloudhsm_v2_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSCloudHsm2ClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSCloudHsm2ClusterConfigTags2("key1", "value1", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSCloudHsm2ClusterExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"cluster_certificates"}, + }, + { + Config: testAccAWSCloudHsm2ClusterConfigTags1("key1", "value1updated"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSCloudHsm2ClusterExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + ), + }, + { + Config: testAccAWSCloudHsm2ClusterConfigTags2("key1", "value1updated", "key3", "value3"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSCloudHsm2ClusterExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key3", "value3"), + ), + }, + }, + }) +} + +func testAccAWSCloudHsm2ClusterConfigBase() string { return fmt.Sprintf(` variable "subnets" { default = ["10.0.1.0/24", "10.0.2.0/24"] @@ -138,16 +182,43 @@ resource "aws_subnet" "cloudhsm2_test_subnets" { Name = "tf-acc-aws_cloudhsm_v2_cluster-resource-basic" } } +`) +} +func testAccAWSCloudHsm2ClusterConfig() string { + return testAccAWSCloudHsm2ClusterConfigBase() + fmt.Sprintf(` resource "aws_cloudhsm_v2_cluster" "cluster" { hsm_type = "hsm1.medium" subnet_ids = ["${aws_subnet.cloudhsm2_test_subnets.*.id[0]}", "${aws_subnet.cloudhsm2_test_subnets.*.id[1]}"] +} +`) +} + +func testAccAWSCloudHsm2ClusterConfigTags1(tagKey1, tagValue1 string) string { + return testAccAWSCloudHsm2ClusterConfigBase() + fmt.Sprintf(` +resource "aws_cloudhsm_v2_cluster" "test" { + hsm_type = "hsm1.medium" + subnet_ids = ["${aws_subnet.cloudhsm2_test_subnets.*.id[0]}", "${aws_subnet.cloudhsm2_test_subnets.*.id[1]}"] + + tags = { + %[1]q = %[2]q + } +} +`, tagKey1, tagValue1) +} + +func testAccAWSCloudHsm2ClusterConfigTags2(tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccAWSCloudHsm2ClusterConfigBase() + fmt.Sprintf(` +resource "aws_cloudhsm_v2_cluster" "test" { + hsm_type = "hsm1.medium" + subnet_ids = ["${aws_subnet.cloudhsm2_test_subnets.*.id[0]}", "${aws_subnet.cloudhsm2_test_subnets.*.id[1]}"] tags = { - Name = "tf-acc-aws_cloudhsm_v2_cluster-resource-basic-%d" + %[1]q = %[2]q + %[3]q = %[4]q } } -`, acctest.RandInt()) +`, tagKey1, tagValue1, tagKey2, tagValue2) } func testAccCheckAWSCloudHsm2ClusterDestroy(s *terraform.State) error { diff --git a/aws/resource_aws_cloudtrail.go b/aws/resource_aws_cloudtrail.go index 2678cffe231..ea77b28319f 100644 --- a/aws/resource_aws_cloudtrail.go +++ b/aws/resource_aws_cloudtrail.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsCloudTrail() *schema.Resource { @@ -138,12 +139,17 @@ func resourceAwsCloudTrail() *schema.Resource { func resourceAwsCloudTrailCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).cloudtrailconn + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().CloudtrailTags() input := cloudtrail.CreateTrailInput{ Name: aws.String(d.Get("name").(string)), S3BucketName: aws.String(d.Get("s3_bucket_name").(string)), } + if len(tags) > 0 { + input.TagsList = tags + } + if v, ok := d.GetOk("cloud_watch_logs_group_arn"); ok { input.CloudWatchLogsLogGroupArn = aws.String(v.(string)) } @@ -196,7 +202,6 @@ func resourceAwsCloudTrailCreate(d *schema.ResourceData, meta interface{}) error log.Printf("[DEBUG] CloudTrail created: %s", t) - d.Set("arn", t.TrailARN) d.SetId(*t.Name) // AWS CloudTrail sets newly-created trails to false. @@ -214,7 +219,7 @@ func resourceAwsCloudTrailCreate(d *schema.ResourceData, meta interface{}) error } } - return resourceAwsCloudTrailUpdate(d, meta) + return resourceAwsCloudTrailRead(d, meta) } func resourceAwsCloudTrailRead(d *schema.ResourceData, meta interface{}) error { @@ -266,24 +271,14 @@ func resourceAwsCloudTrailRead(d *schema.ResourceData, meta interface{}) error { d.Set("arn", trail.TrailARN) d.Set("home_region", trail.HomeRegion) - // Get tags - req := &cloudtrail.ListTagsInput{ - ResourceIdList: []*string{trail.TrailARN}, - } + tags, err := keyvaluetags.CloudtrailListTags(conn, *trail.TrailARN) - tagsOut, err := conn.ListTags(req) if err != nil { - return err + return fmt.Errorf("error listing tags for Cloudtrail (%s): %s", *trail.TrailARN, 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 + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } logstatus, err := cloudTrailGetLoggingStatus(conn, trail.Name) @@ -369,9 +364,10 @@ func resourceAwsCloudTrailUpdate(d *schema.ResourceData, meta interface{}) error } if d.HasChange("tags") { - err := setTagsCloudtrail(conn, d) - if err != nil { - return err + o, n := d.GetChange("tags") + + if err := keyvaluetags.CloudtrailUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating ECR Repository (%s) tags: %s", d.Get("arn").(string), err) } } diff --git a/aws/resource_aws_cloudtrail_test.go b/aws/resource_aws_cloudtrail_test.go index a894f91555d..72b518357b2 100644 --- a/aws/resource_aws_cloudtrail_test.go +++ b/aws/resource_aws_cloudtrail_test.go @@ -46,6 +46,7 @@ func TestAccAWSCloudTrail(t *testing.T) { func testAccAWSCloudTrail_basic(t *testing.T) { var trail cloudtrail.Trail cloudTrailRandInt := acctest.RandInt() + resourceName := "aws_cloudtrail.foobar" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -55,26 +56,26 @@ func testAccAWSCloudTrail_basic(t *testing.T) { { Config: testAccAWSCloudTrailConfig(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "include_global_service_events", "true"), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "is_organization_trail", "false"), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", false, &trail), - testAccCheckCloudTrailKmsKeyIdEquals("aws_cloudtrail.foobar", "", &trail), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttr(resourceName, "include_global_service_events", "true"), + resource.TestCheckResourceAttr(resourceName, "is_organization_trail", "false"), + testAccCheckCloudTrailLogValidationEnabled(resourceName, false, &trail), + testAccCheckCloudTrailKmsKeyIdEquals(resourceName, "", &trail), ), }, { - ResourceName: "aws_cloudtrail.foobar", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { Config: testAccAWSCloudTrailConfigModified(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "s3_key_prefix", "prefix"), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "include_global_service_events", "false"), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", false, &trail), - testAccCheckCloudTrailKmsKeyIdEquals("aws_cloudtrail.foobar", "", &trail), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttr(resourceName, "s3_key_prefix", "prefix"), + resource.TestCheckResourceAttr(resourceName, "include_global_service_events", "false"), + testAccCheckCloudTrailLogValidationEnabled(resourceName, false, &trail), + testAccCheckCloudTrailKmsKeyIdEquals(resourceName, "", &trail), ), }, }, @@ -84,6 +85,7 @@ func testAccAWSCloudTrail_basic(t *testing.T) { func testAccAWSCloudTrail_cloudwatch(t *testing.T) { var trail cloudtrail.Trail randInt := acctest.RandInt() + resourceName := "aws_cloudtrail.test" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -93,22 +95,22 @@ func testAccAWSCloudTrail_cloudwatch(t *testing.T) { { Config: testAccAWSCloudTrailConfigCloudWatch(randInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.test", &trail), - resource.TestCheckResourceAttrSet("aws_cloudtrail.test", "cloud_watch_logs_group_arn"), - resource.TestCheckResourceAttrSet("aws_cloudtrail.test", "cloud_watch_logs_role_arn"), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttrSet(resourceName, "cloud_watch_logs_group_arn"), + resource.TestCheckResourceAttrSet(resourceName, "cloud_watch_logs_role_arn"), ), }, { - ResourceName: "aws_cloudtrail.test", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { Config: testAccAWSCloudTrailConfigCloudWatchModified(randInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.test", &trail), - resource.TestCheckResourceAttrSet("aws_cloudtrail.test", "cloud_watch_logs_group_arn"), - resource.TestCheckResourceAttrSet("aws_cloudtrail.test", "cloud_watch_logs_role_arn"), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttrSet(resourceName, "cloud_watch_logs_group_arn"), + resource.TestCheckResourceAttrSet(resourceName, "cloud_watch_logs_role_arn"), ), }, }, @@ -118,6 +120,7 @@ func testAccAWSCloudTrail_cloudwatch(t *testing.T) { func testAccAWSCloudTrail_enable_logging(t *testing.T) { var trail cloudtrail.Trail cloudTrailRandInt := acctest.RandInt() + resourceName := "aws_cloudtrail.foobar" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -127,35 +130,35 @@ func testAccAWSCloudTrail_enable_logging(t *testing.T) { { Config: testAccAWSCloudTrailConfig(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), + testAccCheckCloudTrailExists(resourceName, &trail), // AWS will create the trail with logging turned off. // Test that "enable_logging" default works. - testAccCheckCloudTrailLoggingEnabled("aws_cloudtrail.foobar", true, &trail), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", false, &trail), - testAccCheckCloudTrailKmsKeyIdEquals("aws_cloudtrail.foobar", "", &trail), + testAccCheckCloudTrailLoggingEnabled(resourceName, true, &trail), + testAccCheckCloudTrailLogValidationEnabled(resourceName, false, &trail), + testAccCheckCloudTrailKmsKeyIdEquals(resourceName, "", &trail), ), }, { - ResourceName: "aws_cloudtrail.foobar", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { Config: testAccAWSCloudTrailConfigModified(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - testAccCheckCloudTrailLoggingEnabled("aws_cloudtrail.foobar", false, &trail), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", false, &trail), - testAccCheckCloudTrailKmsKeyIdEquals("aws_cloudtrail.foobar", "", &trail), + testAccCheckCloudTrailExists(resourceName, &trail), + testAccCheckCloudTrailLoggingEnabled(resourceName, false, &trail), + testAccCheckCloudTrailLogValidationEnabled(resourceName, false, &trail), + testAccCheckCloudTrailKmsKeyIdEquals(resourceName, "", &trail), ), }, { Config: testAccAWSCloudTrailConfig(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - testAccCheckCloudTrailLoggingEnabled("aws_cloudtrail.foobar", true, &trail), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", false, &trail), - testAccCheckCloudTrailKmsKeyIdEquals("aws_cloudtrail.foobar", "", &trail), + testAccCheckCloudTrailExists(resourceName, &trail), + testAccCheckCloudTrailLoggingEnabled(resourceName, true, &trail), + testAccCheckCloudTrailLogValidationEnabled(resourceName, false, &trail), + testAccCheckCloudTrailKmsKeyIdEquals(resourceName, "", &trail), ), }, }, @@ -165,6 +168,7 @@ func testAccAWSCloudTrail_enable_logging(t *testing.T) { func testAccAWSCloudTrail_is_multi_region(t *testing.T) { var trail cloudtrail.Trail cloudTrailRandInt := acctest.RandInt() + resourceName := "aws_cloudtrail.foobar" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -174,33 +178,33 @@ func testAccAWSCloudTrail_is_multi_region(t *testing.T) { { Config: testAccAWSCloudTrailConfig(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "is_multi_region_trail", "false"), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", false, &trail), - testAccCheckCloudTrailKmsKeyIdEquals("aws_cloudtrail.foobar", "", &trail), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttr(resourceName, "is_multi_region_trail", "false"), + testAccCheckCloudTrailLogValidationEnabled(resourceName, false, &trail), + testAccCheckCloudTrailKmsKeyIdEquals(resourceName, "", &trail), ), }, { Config: testAccAWSCloudTrailConfigMultiRegion(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "is_multi_region_trail", "true"), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", false, &trail), - testAccCheckCloudTrailKmsKeyIdEquals("aws_cloudtrail.foobar", "", &trail), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttr(resourceName, "is_multi_region_trail", "true"), + testAccCheckCloudTrailLogValidationEnabled(resourceName, false, &trail), + testAccCheckCloudTrailKmsKeyIdEquals(resourceName, "", &trail), ), }, { - ResourceName: "aws_cloudtrail.foobar", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { Config: testAccAWSCloudTrailConfig(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "is_multi_region_trail", "false"), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", false, &trail), - testAccCheckCloudTrailKmsKeyIdEquals("aws_cloudtrail.foobar", "", &trail), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttr(resourceName, "is_multi_region_trail", "false"), + testAccCheckCloudTrailLogValidationEnabled(resourceName, false, &trail), + testAccCheckCloudTrailKmsKeyIdEquals(resourceName, "", &trail), ), }, }, @@ -210,6 +214,7 @@ func testAccAWSCloudTrail_is_multi_region(t *testing.T) { func testAccAWSCloudTrail_is_organization(t *testing.T) { var trail cloudtrail.Trail cloudTrailRandInt := acctest.RandInt() + resourceName := "aws_cloudtrail.foobar" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, @@ -219,24 +224,24 @@ func testAccAWSCloudTrail_is_organization(t *testing.T) { { Config: testAccAWSCloudTrailConfigOrganization(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "is_organization_trail", "true"), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", false, &trail), - testAccCheckCloudTrailKmsKeyIdEquals("aws_cloudtrail.foobar", "", &trail), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttr(resourceName, "is_organization_trail", "true"), + testAccCheckCloudTrailLogValidationEnabled(resourceName, false, &trail), + testAccCheckCloudTrailKmsKeyIdEquals(resourceName, "", &trail), ), }, { - ResourceName: "aws_cloudtrail.foobar", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { Config: testAccAWSCloudTrailConfig(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "is_organization_trail", "false"), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", false, &trail), - testAccCheckCloudTrailKmsKeyIdEquals("aws_cloudtrail.foobar", "", &trail), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttr(resourceName, "is_organization_trail", "false"), + testAccCheckCloudTrailLogValidationEnabled(resourceName, false, &trail), + testAccCheckCloudTrailKmsKeyIdEquals(resourceName, "", &trail), ), }, }, @@ -246,6 +251,7 @@ func testAccAWSCloudTrail_is_organization(t *testing.T) { func testAccAWSCloudTrail_logValidation(t *testing.T) { var trail cloudtrail.Trail cloudTrailRandInt := acctest.RandInt() + resourceName := "aws_cloudtrail.foobar" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -255,26 +261,26 @@ func testAccAWSCloudTrail_logValidation(t *testing.T) { { Config: testAccAWSCloudTrailConfig_logValidation(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "s3_key_prefix", ""), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "include_global_service_events", "true"), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", true, &trail), - testAccCheckCloudTrailKmsKeyIdEquals("aws_cloudtrail.foobar", "", &trail), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttr(resourceName, "s3_key_prefix", ""), + resource.TestCheckResourceAttr(resourceName, "include_global_service_events", "true"), + testAccCheckCloudTrailLogValidationEnabled(resourceName, true, &trail), + testAccCheckCloudTrailKmsKeyIdEquals(resourceName, "", &trail), ), }, { - ResourceName: "aws_cloudtrail.foobar", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { Config: testAccAWSCloudTrailConfig_logValidationModified(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "s3_key_prefix", ""), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "include_global_service_events", "true"), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", false, &trail), - testAccCheckCloudTrailKmsKeyIdEquals("aws_cloudtrail.foobar", "", &trail), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttr(resourceName, "s3_key_prefix", ""), + resource.TestCheckResourceAttr(resourceName, "include_global_service_events", "true"), + testAccCheckCloudTrailLogValidationEnabled(resourceName, false, &trail), + testAccCheckCloudTrailKmsKeyIdEquals(resourceName, "", &trail), ), }, }, @@ -285,6 +291,7 @@ func testAccAWSCloudTrail_kmsKey(t *testing.T) { var trail cloudtrail.Trail cloudTrailRandInt := acctest.RandInt() keyRegex := regexp.MustCompile(`^arn:aws:([a-zA-Z0-9\-])+:([a-z]{2}-[a-z]+-\d{1})?:(\d{12})?:(.*)$`) + resourceName := "aws_cloudtrail.foobar" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -294,15 +301,15 @@ func testAccAWSCloudTrail_kmsKey(t *testing.T) { { Config: testAccAWSCloudTrailConfig_kmsKey(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "s3_key_prefix", ""), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "include_global_service_events", "true"), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", false, &trail), - resource.TestMatchResourceAttr("aws_cloudtrail.foobar", "kms_key_id", keyRegex), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttr(resourceName, "s3_key_prefix", ""), + resource.TestCheckResourceAttr(resourceName, "include_global_service_events", "true"), + testAccCheckCloudTrailLogValidationEnabled(resourceName, false, &trail), + resource.TestMatchResourceAttr(resourceName, "kms_key_id", keyRegex), ), }, { - ResourceName: "aws_cloudtrail.foobar", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -315,6 +322,7 @@ func testAccAWSCloudTrail_tags(t *testing.T) { var trailTags []*cloudtrail.Tag var trailTagsModified []*cloudtrail.Tag cloudTrailRandInt := acctest.RandInt() + resourceName := "aws_cloudtrail.foobar" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -324,39 +332,41 @@ func testAccAWSCloudTrail_tags(t *testing.T) { { Config: testAccAWSCloudTrailConfig_tags(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "tags.%", "2"), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), testAccCheckCloudTrailLoadTags(&trail, &trailTags), - testAccCheckCloudTrailCheckTags(&trailTags, map[string]string{"Foo": "moo", "Pooh": "hi"}), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", false, &trail), - testAccCheckCloudTrailKmsKeyIdEquals("aws_cloudtrail.foobar", "", &trail), + resource.TestCheckResourceAttr(resourceName, "tags.Foo", "moo"), + resource.TestCheckResourceAttr(resourceName, "tags.Pooh", "hi"), + testAccCheckCloudTrailLogValidationEnabled(resourceName, false, &trail), + testAccCheckCloudTrailKmsKeyIdEquals(resourceName, "", &trail), ), }, { - ResourceName: "aws_cloudtrail.foobar", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { Config: testAccAWSCloudTrailConfig_tagsModified(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "tags.%", "3"), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), testAccCheckCloudTrailLoadTags(&trail, &trailTagsModified), - testAccCheckCloudTrailCheckTags(&trailTagsModified, map[string]string{"Foo": "moo", "Moo": "boom", "Pooh": "hi"}), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", false, &trail), - testAccCheckCloudTrailKmsKeyIdEquals("aws_cloudtrail.foobar", "", &trail), + resource.TestCheckResourceAttr(resourceName, "tags.Foo", "moo"), + resource.TestCheckResourceAttr(resourceName, "tags.Moo", "boom"), + resource.TestCheckResourceAttr(resourceName, "tags.Pooh", "hi"), + testAccCheckCloudTrailLogValidationEnabled(resourceName, false, &trail), + testAccCheckCloudTrailKmsKeyIdEquals(resourceName, "", &trail), ), }, { Config: testAccAWSCloudTrailConfig_tagsModifiedAgain(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "tags.%", "0"), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), testAccCheckCloudTrailLoadTags(&trail, &trailTagsModified), - testAccCheckCloudTrailCheckTags(&trailTagsModified, map[string]string{}), - testAccCheckCloudTrailLogValidationEnabled("aws_cloudtrail.foobar", false, &trail), - testAccCheckCloudTrailKmsKeyIdEquals("aws_cloudtrail.foobar", "", &trail), + testAccCheckCloudTrailLogValidationEnabled(resourceName, false, &trail), + testAccCheckCloudTrailKmsKeyIdEquals(resourceName, "", &trail), ), }, }, @@ -366,6 +376,7 @@ func testAccAWSCloudTrail_tags(t *testing.T) { func testAccAWSCloudTrail_include_global_service_events(t *testing.T) { var trail cloudtrail.Trail cloudTrailRandInt := acctest.RandInt() + resourceName := "aws_cloudtrail.foobar" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -375,12 +386,12 @@ func testAccAWSCloudTrail_include_global_service_events(t *testing.T) { { Config: testAccAWSCloudTrailConfig_include_global_service_events(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudTrailExists("aws_cloudtrail.foobar", &trail), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "include_global_service_events", "false"), + testAccCheckCloudTrailExists(resourceName, &trail), + resource.TestCheckResourceAttr(resourceName, "include_global_service_events", "false"), ), }, { - ResourceName: "aws_cloudtrail.foobar", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -390,6 +401,7 @@ func testAccAWSCloudTrail_include_global_service_events(t *testing.T) { func testAccAWSCloudTrail_event_selector(t *testing.T) { cloudTrailRandInt := acctest.RandInt() + resourceName := "aws_cloudtrail.foobar" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -399,42 +411,42 @@ func testAccAWSCloudTrail_event_selector(t *testing.T) { { Config: testAccAWSCloudTrailConfig_eventSelector(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.#", "1"), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.0.data_resource.#", "1"), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.0.data_resource.0.type", "AWS::S3::Object"), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.0.data_resource.0.values.#", "2"), - resource.TestMatchResourceAttr("aws_cloudtrail.foobar", "event_selector.0.data_resource.0.values.0", regexp.MustCompile(`^arn:[^:]+:s3:::.+/foobar$`)), - resource.TestMatchResourceAttr("aws_cloudtrail.foobar", "event_selector.0.data_resource.0.values.1", regexp.MustCompile(`^arn:[^:]+:s3:::.+/baz$`)), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.0.include_management_events", "false"), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.0.read_write_type", "ReadOnly"), + resource.TestCheckResourceAttr(resourceName, "event_selector.#", "1"), + resource.TestCheckResourceAttr(resourceName, "event_selector.0.data_resource.#", "1"), + resource.TestCheckResourceAttr(resourceName, "event_selector.0.data_resource.0.type", "AWS::S3::Object"), + resource.TestCheckResourceAttr(resourceName, "event_selector.0.data_resource.0.values.#", "2"), + resource.TestMatchResourceAttr(resourceName, "event_selector.0.data_resource.0.values.0", regexp.MustCompile(`^arn:[^:]+:s3:::.+/foobar$`)), + resource.TestMatchResourceAttr(resourceName, "event_selector.0.data_resource.0.values.1", regexp.MustCompile(`^arn:[^:]+:s3:::.+/baz$`)), + resource.TestCheckResourceAttr(resourceName, "event_selector.0.include_management_events", "false"), + resource.TestCheckResourceAttr(resourceName, "event_selector.0.read_write_type", "ReadOnly"), ), }, { - ResourceName: "aws_cloudtrail.foobar", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { Config: testAccAWSCloudTrailConfig_eventSelectorModified(cloudTrailRandInt), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.#", "2"), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.0.data_resource.#", "1"), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.0.data_resource.0.type", "AWS::S3::Object"), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.0.data_resource.0.values.#", "2"), - resource.TestMatchResourceAttr("aws_cloudtrail.foobar", "event_selector.0.data_resource.0.values.0", regexp.MustCompile(`^arn:[^:]+:s3:::.+/foobar$`)), - resource.TestMatchResourceAttr("aws_cloudtrail.foobar", "event_selector.0.data_resource.0.values.1", regexp.MustCompile(`^arn:[^:]+:s3:::.+/baz$`)), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.0.include_management_events", "true"), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.0.read_write_type", "ReadOnly"), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.1.data_resource.#", "2"), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.1.data_resource.0.type", "AWS::S3::Object"), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.1.data_resource.0.values.#", "2"), - resource.TestMatchResourceAttr("aws_cloudtrail.foobar", "event_selector.1.data_resource.0.values.0", regexp.MustCompile(`^arn:[^:]+:s3:::.+/tf1$`)), - resource.TestMatchResourceAttr("aws_cloudtrail.foobar", "event_selector.1.data_resource.0.values.1", regexp.MustCompile(`^arn:[^:]+:s3:::.+/tf2$`)), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.1.data_resource.1.type", "AWS::Lambda::Function"), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.1.data_resource.1.values.#", "1"), - resource.TestMatchResourceAttr("aws_cloudtrail.foobar", "event_selector.1.data_resource.1.values.0", regexp.MustCompile(`^arn:[^:]+:lambda:.+:tf-test-trail-event-select-\d+$`)), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.1.include_management_events", "false"), - resource.TestCheckResourceAttr("aws_cloudtrail.foobar", "event_selector.1.read_write_type", "All"), + resource.TestCheckResourceAttr(resourceName, "event_selector.#", "2"), + resource.TestCheckResourceAttr(resourceName, "event_selector.0.data_resource.#", "1"), + resource.TestCheckResourceAttr(resourceName, "event_selector.0.data_resource.0.type", "AWS::S3::Object"), + resource.TestCheckResourceAttr(resourceName, "event_selector.0.data_resource.0.values.#", "2"), + resource.TestMatchResourceAttr(resourceName, "event_selector.0.data_resource.0.values.0", regexp.MustCompile(`^arn:[^:]+:s3:::.+/foobar$`)), + resource.TestMatchResourceAttr(resourceName, "event_selector.0.data_resource.0.values.1", regexp.MustCompile(`^arn:[^:]+:s3:::.+/baz$`)), + resource.TestCheckResourceAttr(resourceName, "event_selector.0.include_management_events", "true"), + resource.TestCheckResourceAttr(resourceName, "event_selector.0.read_write_type", "ReadOnly"), + resource.TestCheckResourceAttr(resourceName, "event_selector.1.data_resource.#", "2"), + resource.TestCheckResourceAttr(resourceName, "event_selector.1.data_resource.0.type", "AWS::S3::Object"), + resource.TestCheckResourceAttr(resourceName, "event_selector.1.data_resource.0.values.#", "2"), + resource.TestMatchResourceAttr(resourceName, "event_selector.1.data_resource.0.values.0", regexp.MustCompile(`^arn:[^:]+:s3:::.+/tf1$`)), + resource.TestMatchResourceAttr(resourceName, "event_selector.1.data_resource.0.values.1", regexp.MustCompile(`^arn:[^:]+:s3:::.+/tf2$`)), + resource.TestCheckResourceAttr(resourceName, "event_selector.1.data_resource.1.type", "AWS::Lambda::Function"), + resource.TestCheckResourceAttr(resourceName, "event_selector.1.data_resource.1.values.#", "1"), + resource.TestMatchResourceAttr(resourceName, "event_selector.1.data_resource.1.values.0", regexp.MustCompile(`^arn:[^:]+:lambda:.+:tf-test-trail-event-select-\d+$`)), + resource.TestCheckResourceAttr(resourceName, "event_selector.1.include_management_events", "false"), + resource.TestCheckResourceAttr(resourceName, "event_selector.1.read_write_type", "All"), ), }, }, @@ -1387,7 +1399,7 @@ resource "aws_lambda_function" "lambda_function_test" { function_name = "tf-test-trail-event-select-%d" role = "${aws_iam_role.iam_for_lambda.arn}" handler = "exports.example" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } `, cloudTrailRandInt, cloudTrailRandInt, cloudTrailRandInt, cloudTrailRandInt, cloudTrailRandInt, cloudTrailRandInt, cloudTrailRandInt) } diff --git a/aws/resource_aws_cloudwatch_dashboard.go b/aws/resource_aws_cloudwatch_dashboard.go index 03b7c95df03..a7ff5aac312 100644 --- a/aws/resource_aws_cloudwatch_dashboard.go +++ b/aws/resource_aws_cloudwatch_dashboard.go @@ -44,6 +44,7 @@ func resourceAwsCloudWatchDashboard() *schema.Resource { "dashboard_name": { Type: schema.TypeString, Required: true, + ForceNew: true, ValidateFunc: validateCloudWatchDashboardName, }, }, diff --git a/aws/resource_aws_cloudwatch_dashboard_test.go b/aws/resource_aws_cloudwatch_dashboard_test.go index c5908d260d5..db018e38fd7 100644 --- a/aws/resource_aws_cloudwatch_dashboard_test.go +++ b/aws/resource_aws_cloudwatch_dashboard_test.go @@ -14,8 +14,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSCloudWatchDashboard_importBasic(t *testing.T) { - resourceName := "aws_cloudwatch_dashboard.foobar" +func TestAccAWSCloudWatchDashboard_basic(t *testing.T) { + var dashboard cloudwatch.GetDashboardOutput + resourceName := "aws_cloudwatch_dashboard.test" rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -25,6 +26,10 @@ func TestAccAWSCloudWatchDashboard_importBasic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccAWSCloudWatchDashboardConfig(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudWatchDashboardExists(resourceName, &dashboard), + resource.TestCheckResourceAttr(resourceName, "dashboard_name", testAccAWSCloudWatchDashboardName(rInt)), + ), }, { ResourceName: resourceName, @@ -35,9 +40,11 @@ func TestAccAWSCloudWatchDashboard_importBasic(t *testing.T) { }) } -func TestAccAWSCloudWatchDashboard_basic(t *testing.T) { +func TestAccAWSCloudWatchDashboard_update(t *testing.T) { var dashboard cloudwatch.GetDashboardOutput + resourceName := "aws_cloudwatch_dashboard.test" rInt := acctest.RandInt() + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -46,17 +53,33 @@ func TestAccAWSCloudWatchDashboard_basic(t *testing.T) { { Config: testAccAWSCloudWatchDashboardConfig(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchDashboardExists("aws_cloudwatch_dashboard.foobar", &dashboard), - resource.TestCheckResourceAttr("aws_cloudwatch_dashboard.foobar", "dashboard_name", testAccAWSCloudWatchDashboardName(rInt)), + testAccCheckCloudWatchDashboardExists(resourceName, &dashboard), + testAccCloudWatchCheckDashboardBodyIsExpected(resourceName, basicWidget), + resource.TestCheckResourceAttr(resourceName, "dashboard_name", testAccAWSCloudWatchDashboardName(rInt)), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSCloudWatchDashboardConfig_updateBody(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudWatchDashboardExists(resourceName, &dashboard), + testAccCloudWatchCheckDashboardBodyIsExpected(resourceName, updatedWidget), + resource.TestCheckResourceAttr(resourceName, "dashboard_name", testAccAWSCloudWatchDashboardName(rInt)), ), }, }, }) } -func TestAccAWSCloudWatchDashboard_update(t *testing.T) { +func TestAccAWSCloudWatchDashboard_updateName(t *testing.T) { var dashboard cloudwatch.GetDashboardOutput + resourceName := "aws_cloudwatch_dashboard.test" rInt := acctest.RandInt() + rInt2 := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -65,17 +88,18 @@ func TestAccAWSCloudWatchDashboard_update(t *testing.T) { { Config: testAccAWSCloudWatchDashboardConfig(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchDashboardExists("aws_cloudwatch_dashboard.foobar", &dashboard), - testAccCloudWatchCheckDashboardBodyIsExpected("aws_cloudwatch_dashboard.foobar", basicWidget), - resource.TestCheckResourceAttr("aws_cloudwatch_dashboard.foobar", "dashboard_name", testAccAWSCloudWatchDashboardName(rInt)), + testAccCheckCloudWatchDashboardExists(resourceName, &dashboard), + testAccCloudWatchCheckDashboardBodyIsExpected(resourceName, basicWidget), + resource.TestCheckResourceAttr(resourceName, "dashboard_name", testAccAWSCloudWatchDashboardName(rInt)), ), }, { - Config: testAccAWSCloudWatchDashboardConfig_updateBody(rInt), + Config: testAccAWSCloudWatchDashboardConfig(rInt2), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchDashboardExists("aws_cloudwatch_dashboard.foobar", &dashboard), - testAccCloudWatchCheckDashboardBodyIsExpected("aws_cloudwatch_dashboard.foobar", updatedWidget), - resource.TestCheckResourceAttr("aws_cloudwatch_dashboard.foobar", "dashboard_name", testAccAWSCloudWatchDashboardName(rInt)), + testAccCheckCloudWatchDashboardExists(resourceName, &dashboard), + testAccCloudWatchCheckDashboardBodyIsExpected(resourceName, basicWidget), + resource.TestCheckResourceAttr(resourceName, "dashboard_name", testAccAWSCloudWatchDashboardName(rInt2)), + testAccCheckAWSCloudWatchDashboardDestroyPrevious(testAccAWSCloudWatchDashboardName(rInt)), ), }, }, @@ -129,6 +153,28 @@ func testAccCheckAWSCloudWatchDashboardDestroy(s *terraform.State) error { return nil } +func testAccCheckAWSCloudWatchDashboardDestroyPrevious(dashboardName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).cloudwatchconn + + params := cloudwatch.GetDashboardInput{ + DashboardName: aws.String(dashboardName), + } + + _, err := conn.GetDashboard(¶ms) + + if err == nil { + return fmt.Errorf("Dashboard still exists: %s", dashboardName) + } + + if !isCloudWatchDashboardNotFoundErr(err) { + return err + } + + return nil + } +} + const ( basicWidget = `{ "widgets": [{ @@ -163,7 +209,7 @@ func testAccAWSCloudWatchDashboardName(rInt int) string { func testAccAWSCloudWatchDashboardConfig(rInt int) string { return fmt.Sprintf(` -resource "aws_cloudwatch_dashboard" "foobar" { +resource "aws_cloudwatch_dashboard" "test" { dashboard_name = "terraform-test-dashboard-%d" dashboard_body = < 0 && output.FailedEntries[0] != nil { + failedEntry := output.FailedEntries[0] + return fmt.Errorf("error deleting CloudWatch Event Target (%s): failure entry: %s: %s", d.Id(), aws.StringValue(failedEntry.ErrorCode), aws.StringValue(failedEntry.ErrorMessage)) } - log.Println("[INFO] CloudWatch Event Target deleted") return nil } diff --git a/aws/resource_aws_cloudwatch_event_target_test.go b/aws/resource_aws_cloudwatch_event_target_test.go index 06ce265d574..9fcef6210bb 100644 --- a/aws/resource_aws_cloudwatch_event_target_test.go +++ b/aws/resource_aws_cloudwatch_event_target_test.go @@ -57,8 +57,9 @@ func testSweepCloudWatchEventTargets(region string) error { for _, target := range listTargetsByRuleOutput.Targets { removeTargetsInput := &events.RemoveTargetsInput{ - Ids: []*string{target.Id}, - Rule: rule.Name, + Ids: []*string{target.Id}, + Rule: rule.Name, + Force: aws.Bool(true), } targetID := aws.StringValue(target.Id) @@ -1087,7 +1088,7 @@ resource "aws_lambda_function" "lambda" { source_code_hash = "${filebase64sha256("test-fixtures/lambdatest.zip")}" role = "${aws_iam_role.iam_for_lambda.arn}" handler = "exports.example" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } resource "aws_cloudwatch_event_rule" "schedule" { diff --git a/aws/resource_aws_cloudwatch_log_destination_policy.go b/aws/resource_aws_cloudwatch_log_destination_policy.go index 742030ba13c..baf6128a998 100644 --- a/aws/resource_aws_cloudwatch_log_destination_policy.go +++ b/aws/resource_aws_cloudwatch_log_destination_policy.go @@ -2,11 +2,11 @@ package aws import ( "fmt" - - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "log" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) func resourceAwsCloudWatchLogDestinationPolicy() *schema.Resource { @@ -67,17 +67,13 @@ func resourceAwsCloudWatchLogDestinationPolicyRead(d *schema.ResourceData, meta return err } - if !exists { + if !exists || destination.AccessPolicy == nil { + log.Printf("[WARN] CloudWatch Log Destination Policy (%s) not found, removing from state", d.Id()) d.SetId("") return nil } - if destination.AccessPolicy != nil { - d.SetId(destination_name) - d.Set("access_policy", *destination.AccessPolicy) - } else { - d.SetId("") - } + d.Set("access_policy", destination.AccessPolicy) return nil } diff --git a/aws/resource_aws_cloudwatch_log_destination_policy_test.go b/aws/resource_aws_cloudwatch_log_destination_policy_test.go index 0b9c006a049..1dedc4878b5 100644 --- a/aws/resource_aws_cloudwatch_log_destination_policy_test.go +++ b/aws/resource_aws_cloudwatch_log_destination_policy_test.go @@ -10,9 +10,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSCloudwatchLogDestinationPolicy_importBasic(t *testing.T) { +func TestAccAWSCloudwatchLogDestinationPolicy_basic(t *testing.T) { + var destination cloudwatchlogs.Destination resourceName := "aws_cloudwatch_log_destination_policy.test" - rstring := acctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ @@ -22,8 +22,10 @@ func TestAccAWSCloudwatchLogDestinationPolicy_importBasic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccAWSCloudwatchLogDestinationPolicyConfig(rstring), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSCloudwatchLogDestinationPolicyExists(resourceName, &destination), + ), }, - { ResourceName: resourceName, ImportState: true, @@ -33,26 +35,6 @@ func TestAccAWSCloudwatchLogDestinationPolicy_importBasic(t *testing.T) { }) } -func TestAccAWSCloudwatchLogDestinationPolicy_basic(t *testing.T) { - var destination cloudwatchlogs.Destination - - rstring := acctest.RandString(5) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSCloudwatchLogDestinationPolicyDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSCloudwatchLogDestinationPolicyConfig(rstring), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCloudwatchLogDestinationPolicyExists("aws_cloudwatch_log_destination_policy.test", &destination), - ), - }, - }, - }) -} - func testAccCheckAWSCloudwatchLogDestinationPolicyDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).cloudwatchlogsconn diff --git a/aws/resource_aws_cloudwatch_log_destination_test.go b/aws/resource_aws_cloudwatch_log_destination_test.go index 73dc4ef6e01..3921b520975 100644 --- a/aws/resource_aws_cloudwatch_log_destination_test.go +++ b/aws/resource_aws_cloudwatch_log_destination_test.go @@ -10,9 +10,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSCloudwatchLogDestination_importBasic(t *testing.T) { +func TestAccAWSCloudwatchLogDestination_basic(t *testing.T) { + var destination cloudwatchlogs.Destination resourceName := "aws_cloudwatch_log_destination.test" - rstring := acctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ @@ -22,8 +22,10 @@ func TestAccAWSCloudwatchLogDestination_importBasic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccAWSCloudwatchLogDestinationConfig(rstring), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSCloudwatchLogDestinationExists(resourceName, &destination), + ), }, - { ResourceName: resourceName, ImportState: true, @@ -33,26 +35,6 @@ func TestAccAWSCloudwatchLogDestination_importBasic(t *testing.T) { }) } -func TestAccAWSCloudwatchLogDestination_basic(t *testing.T) { - var destination cloudwatchlogs.Destination - - rstring := acctest.RandString(5) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSCloudwatchLogDestinationDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSCloudwatchLogDestinationConfig(rstring), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCloudwatchLogDestinationExists("aws_cloudwatch_log_destination.test", &destination), - ), - }, - }, - }) -} - func testAccCheckAWSCloudwatchLogDestinationDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).cloudwatchlogsconn diff --git a/aws/resource_aws_cloudwatch_log_group.go b/aws/resource_aws_cloudwatch_log_group.go index cd16832fed0..cf1808ab09a 100644 --- a/aws/resource_aws_cloudwatch_log_group.go +++ b/aws/resource_aws_cloudwatch_log_group.go @@ -10,6 +10,7 @@ import ( "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/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsCloudWatchLogGroup() *schema.Resource { @@ -61,6 +62,7 @@ func resourceAwsCloudWatchLogGroup() *schema.Resource { func resourceAwsCloudWatchLogGroupCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).cloudwatchlogsconn + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().CloudwatchlogsTags() var logGroupName string if v, ok := d.GetOk("name"); ok { @@ -81,9 +83,13 @@ func resourceAwsCloudWatchLogGroupCreate(d *schema.ResourceData, meta interface{ params.KmsKeyId = aws.String(v.(string)) } + if len(tags) > 0 { + params.Tags = tags + } + _, err := conn.CreateLogGroup(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceAlreadyExistsException" { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == cloudwatchlogs.ErrCodeResourceAlreadyExistsException { 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")) @@ -93,7 +99,20 @@ func resourceAwsCloudWatchLogGroupCreate(d *schema.ResourceData, meta interface{ log.Println("[INFO] CloudWatch Log Group created") - return resourceAwsCloudWatchLogGroupUpdate(d, meta) + if v, ok := d.GetOk("retention_in_days"); ok { + input := cloudwatchlogs.PutRetentionPolicyInput{ + LogGroupName: aws.String(logGroupName), + RetentionInDays: aws.Int64(int64(v.(int))), + } + log.Printf("[DEBUG] Setting retention for CloudWatch Log Group: %q: %s", logGroupName, input) + _, err = conn.PutRetentionPolicy(&input) + + if err != nil { + return err + } + } + + return resourceAwsCloudWatchLogGroupRead(d, meta) } func resourceAwsCloudWatchLogGroupRead(d *schema.ResourceData, meta interface{}) error { @@ -117,17 +136,15 @@ func resourceAwsCloudWatchLogGroupRead(d *schema.ResourceData, meta interface{}) d.Set("kms_key_id", lg.KmsKeyId) d.Set("retention_in_days", lg.RetentionInDays) - tags := make(map[string]string) - tagsOutput, err := conn.ListTagsLogGroup(&cloudwatchlogs.ListTagsLogGroupInput{ - LogGroupName: aws.String(d.Id()), - }) + tags, err := keyvaluetags.CloudwatchlogsListTags(conn, d.Id()) + if err != nil { - return fmt.Errorf("error listing CloudWatch Logs Group %q tags: %s", d.Id(), err) + return fmt.Errorf("error listing tags for CloudWatch Logs Group (%s): %s", d.Id(), err) } - if tagsOutput != nil { - tags = aws.StringValueMap(tagsOutput.Tags) + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - d.Set("tags", tags) return nil } @@ -182,31 +199,10 @@ func resourceAwsCloudWatchLogGroupUpdate(d *schema.ResourceData, meta interface{ } 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 - } - } + o, n := d.GetChange("tags") - 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 - } + if err := keyvaluetags.CloudwatchlogsUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating CloudWatch Log Group (%s) tags: %s", d.Id(), err) } } @@ -234,23 +230,6 @@ func resourceAwsCloudWatchLogGroupUpdate(d *schema.ResourceData, meta interface{ 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 { - _, ok := create[t] - if !ok { - remove = append(remove, aws.String(t)) - } - } - - 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()) diff --git a/aws/resource_aws_cloudwatch_log_group_test.go b/aws/resource_aws_cloudwatch_log_group_test.go index 21752ea386f..a711672d29d 100644 --- a/aws/resource_aws_cloudwatch_log_group_test.go +++ b/aws/resource_aws_cloudwatch_log_group_test.go @@ -11,9 +11,10 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSCloudWatchLogGroup_importBasic(t *testing.T) { - resourceName := "aws_cloudwatch_log_group.foobar" +func TestAccAWSCloudWatchLogGroup_basic(t *testing.T) { + var lg cloudwatchlogs.LogGroup rInt := acctest.RandInt() + resourceName := "aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -22,8 +23,11 @@ func TestAccAWSCloudWatchLogGroup_importBasic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccAWSCloudWatchLogGroupConfig(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudWatchLogGroupExists(resourceName, &lg), + resource.TestCheckResourceAttr(resourceName, "retention_in_days", "0"), + ), }, - { ResourceName: resourceName, ImportState: true, @@ -34,28 +38,9 @@ func TestAccAWSCloudWatchLogGroup_importBasic(t *testing.T) { }) } -func TestAccAWSCloudWatchLogGroup_basic(t *testing.T) { - var lg cloudwatchlogs.LogGroup - rInt := acctest.RandInt() - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSCloudWatchLogGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSCloudWatchLogGroupConfig(rInt), - Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogGroupExists("aws_cloudwatch_log_group.foobar", &lg), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "retention_in_days", "0"), - ), - }, - }, - }) -} - func TestAccAWSCloudWatchLogGroup_namePrefix(t *testing.T) { var lg cloudwatchlogs.LogGroup + resourceName := "aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -65,10 +50,16 @@ func TestAccAWSCloudWatchLogGroup_namePrefix(t *testing.T) { { Config: testAccAWSCloudWatchLogGroup_namePrefix, Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogGroupExists("aws_cloudwatch_log_group.test", &lg), - resource.TestMatchResourceAttr("aws_cloudwatch_log_group.test", "name", regexp.MustCompile("^tf-test-")), + testAccCheckCloudWatchLogGroupExists(resourceName, &lg), + resource.TestMatchResourceAttr(resourceName, "name", regexp.MustCompile("^tf-test-")), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"retention_in_days", "name_prefix"}, + }, }, }) } @@ -76,6 +67,7 @@ func TestAccAWSCloudWatchLogGroup_namePrefix(t *testing.T) { func TestAccAWSCloudWatchLogGroup_namePrefix_retention(t *testing.T) { var lg cloudwatchlogs.LogGroup rName := acctest.RandString(5) + resourceName := "aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -85,17 +77,23 @@ func TestAccAWSCloudWatchLogGroup_namePrefix_retention(t *testing.T) { { Config: testAccAWSCloudWatchLogGroup_namePrefix_retention(rName, 365), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogGroupExists("aws_cloudwatch_log_group.test", &lg), - resource.TestMatchResourceAttr("aws_cloudwatch_log_group.test", "name", regexp.MustCompile("^tf-test-")), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.test", "retention_in_days", "365"), + testAccCheckCloudWatchLogGroupExists(resourceName, &lg), + resource.TestMatchResourceAttr(resourceName, "name", regexp.MustCompile("^tf-test-")), + resource.TestCheckResourceAttr(resourceName, "retention_in_days", "365"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"retention_in_days", "name_prefix"}, + }, { Config: testAccAWSCloudWatchLogGroup_namePrefix_retention(rName, 7), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogGroupExists("aws_cloudwatch_log_group.test", &lg), - resource.TestMatchResourceAttr("aws_cloudwatch_log_group.test", "name", regexp.MustCompile("^tf-test-")), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.test", "retention_in_days", "7"), + testAccCheckCloudWatchLogGroupExists(resourceName, &lg), + resource.TestMatchResourceAttr(resourceName, "name", regexp.MustCompile("^tf-test-")), + resource.TestCheckResourceAttr(resourceName, "retention_in_days", "7"), ), }, }, @@ -104,6 +102,7 @@ func TestAccAWSCloudWatchLogGroup_namePrefix_retention(t *testing.T) { func TestAccAWSCloudWatchLogGroup_generatedName(t *testing.T) { var lg cloudwatchlogs.LogGroup + resourceName := "aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -113,9 +112,15 @@ func TestAccAWSCloudWatchLogGroup_generatedName(t *testing.T) { { Config: testAccAWSCloudWatchLogGroup_generatedName, Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogGroupExists("aws_cloudwatch_log_group.test", &lg), + testAccCheckCloudWatchLogGroupExists(resourceName, &lg), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"retention_in_days"}, + }, }, }) } @@ -123,6 +128,7 @@ func TestAccAWSCloudWatchLogGroup_generatedName(t *testing.T) { func TestAccAWSCloudWatchLogGroup_retentionPolicy(t *testing.T) { var lg cloudwatchlogs.LogGroup rInt := acctest.RandInt() + resourceName := "aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -132,15 +138,21 @@ func TestAccAWSCloudWatchLogGroup_retentionPolicy(t *testing.T) { { Config: testAccAWSCloudWatchLogGroupConfig_withRetention(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogGroupExists("aws_cloudwatch_log_group.foobar", &lg), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "retention_in_days", "365"), + testAccCheckCloudWatchLogGroupExists(resourceName, &lg), + resource.TestCheckResourceAttr(resourceName, "retention_in_days", "365"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"retention_in_days"}, + }, { Config: testAccAWSCloudWatchLogGroupConfigModified_withRetention(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogGroupExists("aws_cloudwatch_log_group.foobar", &lg), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "retention_in_days", "0"), + testAccCheckCloudWatchLogGroupExists(resourceName, &lg), + resource.TestCheckResourceAttr(resourceName, "retention_in_days", "0"), ), }, }, @@ -150,6 +162,7 @@ func TestAccAWSCloudWatchLogGroup_retentionPolicy(t *testing.T) { func TestAccAWSCloudWatchLogGroup_multiple(t *testing.T) { var lg cloudwatchlogs.LogGroup rInt := acctest.RandInt() + resourceName := "aws_cloudwatch_log_group.alpha" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -167,6 +180,12 @@ func TestAccAWSCloudWatchLogGroup_multiple(t *testing.T) { resource.TestCheckResourceAttr("aws_cloudwatch_log_group.charlie", "retention_in_days", "3653"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"retention_in_days"}, + }, }, }) } @@ -174,6 +193,7 @@ func TestAccAWSCloudWatchLogGroup_multiple(t *testing.T) { func TestAccAWSCloudWatchLogGroup_disappears(t *testing.T) { var lg cloudwatchlogs.LogGroup rInt := acctest.RandInt() + resourceName := "aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -183,7 +203,7 @@ func TestAccAWSCloudWatchLogGroup_disappears(t *testing.T) { { Config: testAccAWSCloudWatchLogGroupConfig(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogGroupExists("aws_cloudwatch_log_group.foobar", &lg), + testAccCheckCloudWatchLogGroupExists(resourceName, &lg), testAccCheckCloudWatchLogGroupDisappears(&lg), ), ExpectNonEmptyPlan: true, @@ -195,6 +215,7 @@ func TestAccAWSCloudWatchLogGroup_disappears(t *testing.T) { func TestAccAWSCloudWatchLogGroup_tagging(t *testing.T) { var lg cloudwatchlogs.LogGroup rInt := acctest.RandInt() + resourceName := "aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -204,43 +225,49 @@ func TestAccAWSCloudWatchLogGroup_tagging(t *testing.T) { { Config: testAccAWSCloudWatchLogGroupConfigWithTags(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogGroupExists("aws_cloudwatch_log_group.foobar", &lg), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.%", "3"), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.Environment", "Production"), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.Foo", "Bar"), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.Empty", ""), + testAccCheckCloudWatchLogGroupExists(resourceName, &lg), + resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.Environment", "Production"), + resource.TestCheckResourceAttr(resourceName, "tags.Foo", "Bar"), + resource.TestCheckResourceAttr(resourceName, "tags.Empty", ""), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"retention_in_days"}, + }, { Config: testAccAWSCloudWatchLogGroupConfigWithTagsAdded(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogGroupExists("aws_cloudwatch_log_group.foobar", &lg), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.%", "4"), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.Environment", "Development"), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.Foo", "Bar"), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.Empty", ""), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.Bar", "baz"), + testAccCheckCloudWatchLogGroupExists(resourceName, &lg), + resource.TestCheckResourceAttr(resourceName, "tags.%", "4"), + resource.TestCheckResourceAttr(resourceName, "tags.Environment", "Development"), + resource.TestCheckResourceAttr(resourceName, "tags.Foo", "Bar"), + resource.TestCheckResourceAttr(resourceName, "tags.Empty", ""), + resource.TestCheckResourceAttr(resourceName, "tags.Bar", "baz"), ), }, { Config: testAccAWSCloudWatchLogGroupConfigWithTagsUpdated(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogGroupExists("aws_cloudwatch_log_group.foobar", &lg), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.%", "4"), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.Environment", "Development"), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.Empty", "NotEmpty"), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.Foo", "UpdatedBar"), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.Bar", "baz"), + testAccCheckCloudWatchLogGroupExists(resourceName, &lg), + resource.TestCheckResourceAttr(resourceName, "tags.%", "4"), + resource.TestCheckResourceAttr(resourceName, "tags.Environment", "Development"), + resource.TestCheckResourceAttr(resourceName, "tags.Empty", "NotEmpty"), + resource.TestCheckResourceAttr(resourceName, "tags.Foo", "UpdatedBar"), + resource.TestCheckResourceAttr(resourceName, "tags.Bar", "baz"), ), }, { Config: testAccAWSCloudWatchLogGroupConfigWithTags(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogGroupExists("aws_cloudwatch_log_group.foobar", &lg), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.%", "3"), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.Environment", "Production"), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.Foo", "Bar"), - resource.TestCheckResourceAttr("aws_cloudwatch_log_group.foobar", "tags.Empty", ""), + testAccCheckCloudWatchLogGroupExists(resourceName, &lg), + resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.Environment", "Production"), + resource.TestCheckResourceAttr(resourceName, "tags.Foo", "Bar"), + resource.TestCheckResourceAttr(resourceName, "tags.Empty", ""), ), }, }, @@ -250,6 +277,7 @@ func TestAccAWSCloudWatchLogGroup_tagging(t *testing.T) { func TestAccAWSCloudWatchLogGroup_kmsKey(t *testing.T) { var lg cloudwatchlogs.LogGroup rInt := acctest.RandInt() + resourceName := "aws_cloudwatch_log_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -259,14 +287,20 @@ func TestAccAWSCloudWatchLogGroup_kmsKey(t *testing.T) { { Config: testAccAWSCloudWatchLogGroupConfig(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogGroupExists("aws_cloudwatch_log_group.foobar", &lg), + testAccCheckCloudWatchLogGroupExists(resourceName, &lg), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"retention_in_days"}, + }, { Config: testAccAWSCloudWatchLogGroupConfigWithKmsKeyId(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogGroupExists("aws_cloudwatch_log_group.foobar", &lg), - resource.TestCheckResourceAttrSet("aws_cloudwatch_log_group.foobar", "kms_key_id"), + testAccCheckCloudWatchLogGroupExists(resourceName, &lg), + resource.TestCheckResourceAttrSet(resourceName, "kms_key_id"), ), }, }, @@ -329,7 +363,7 @@ func testAccCheckAWSCloudWatchLogGroupDestroy(s *terraform.State) error { func testAccAWSCloudWatchLogGroupConfig(rInt int) string { return fmt.Sprintf(` -resource "aws_cloudwatch_log_group" "foobar" { +resource "aws_cloudwatch_log_group" "test" { name = "foo-bar-%d" } `, rInt) @@ -337,7 +371,7 @@ resource "aws_cloudwatch_log_group" "foobar" { func testAccAWSCloudWatchLogGroupConfigWithTags(rInt int) string { return fmt.Sprintf(` -resource "aws_cloudwatch_log_group" "foobar" { +resource "aws_cloudwatch_log_group" "test" { name = "foo-bar-%d" tags = { @@ -351,7 +385,7 @@ resource "aws_cloudwatch_log_group" "foobar" { func testAccAWSCloudWatchLogGroupConfigWithTagsAdded(rInt int) string { return fmt.Sprintf(` -resource "aws_cloudwatch_log_group" "foobar" { +resource "aws_cloudwatch_log_group" "test" { name = "foo-bar-%d" tags = { @@ -366,7 +400,7 @@ resource "aws_cloudwatch_log_group" "foobar" { func testAccAWSCloudWatchLogGroupConfigWithTagsUpdated(rInt int) string { return fmt.Sprintf(` -resource "aws_cloudwatch_log_group" "foobar" { +resource "aws_cloudwatch_log_group" "test" { name = "foo-bar-%d" tags = { @@ -381,7 +415,7 @@ resource "aws_cloudwatch_log_group" "foobar" { func testAccAWSCloudWatchLogGroupConfig_withRetention(rInt int) string { return fmt.Sprintf(` -resource "aws_cloudwatch_log_group" "foobar" { +resource "aws_cloudwatch_log_group" "test" { name = "foo-bar-%d" retention_in_days = 365 } @@ -390,7 +424,7 @@ resource "aws_cloudwatch_log_group" "foobar" { func testAccAWSCloudWatchLogGroupConfigModified_withRetention(rInt int) string { return fmt.Sprintf(` -resource "aws_cloudwatch_log_group" "foobar" { +resource "aws_cloudwatch_log_group" "test" { name = "foo-bar-%d" } `, rInt) @@ -439,7 +473,7 @@ resource "aws_kms_key" "foo" { POLICY } -resource "aws_cloudwatch_log_group" "foobar" { +resource "aws_cloudwatch_log_group" "test" { name = "foo-bar-%d" kms_key_id = "${aws_kms_key.foo.arn}" } diff --git a/aws/resource_aws_cloudwatch_log_resource_policy.go b/aws/resource_aws_cloudwatch_log_resource_policy.go index 0df52fb328d..b39fc4dde1b 100644 --- a/aws/resource_aws_cloudwatch_log_resource_policy.go +++ b/aws/resource_aws_cloudwatch_log_resource_policy.go @@ -73,8 +73,7 @@ func resourceAwsCloudWatchLogResourcePolicyRead(d *schema.ResourceData, meta int return nil } - d.SetId(policyName) - d.Set("policy_document", *resourcePolicy.PolicyDocument) + d.Set("policy_document", resourcePolicy.PolicyDocument) return nil } diff --git a/aws/resource_aws_cloudwatch_log_resource_policy_test.go b/aws/resource_aws_cloudwatch_log_resource_policy_test.go index 9c51bd762ad..e0d84b3e75f 100644 --- a/aws/resource_aws_cloudwatch_log_resource_policy_test.go +++ b/aws/resource_aws_cloudwatch_log_resource_policy_test.go @@ -63,9 +63,11 @@ func testSweepCloudWatchLogResourcePolicies(region string) error { return nil } -func TestAccAWSCloudWatchLogResourcePolicy_Basic(t *testing.T) { +func TestAccAWSCloudWatchLogResourcePolicy_basic(t *testing.T) { name := acctest.RandString(5) + resourceName := "aws_cloudwatch_log_resource_policy.test" var resourcePolicy cloudwatchlogs.ResourcePolicy + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -74,42 +76,24 @@ func TestAccAWSCloudWatchLogResourcePolicy_Basic(t *testing.T) { { Config: testAccCheckAWSCloudWatchLogResourcePolicyResourceConfigBasic1(name), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogResourcePolicy("aws_cloudwatch_log_resource_policy.test", &resourcePolicy), - resource.TestCheckResourceAttr("aws_cloudwatch_log_resource_policy.test", "policy_name", name), - resource.TestCheckResourceAttr("aws_cloudwatch_log_resource_policy.test", "policy_document", "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"route53.amazonaws.com\"},\"Action\":[\"logs:PutLogEvents\",\"logs:CreateLogStream\"],\"Resource\":\"arn:aws:logs:*:*:log-group:/aws/route53/*\"}]}"), + testAccCheckCloudWatchLogResourcePolicy(resourceName, &resourcePolicy), + resource.TestCheckResourceAttr(resourceName, "policy_name", name), + resource.TestCheckResourceAttr(resourceName, "policy_document", "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"route53.amazonaws.com\"},\"Action\":[\"logs:PutLogEvents\",\"logs:CreateLogStream\"],\"Resource\":\"arn:aws:logs:*:*:log-group:/aws/route53/*\"}]}"), ), }, - { - Config: testAccCheckAWSCloudWatchLogResourcePolicyResourceConfigBasic2(name), - Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchLogResourcePolicy("aws_cloudwatch_log_resource_policy.test", &resourcePolicy), - resource.TestCheckResourceAttr("aws_cloudwatch_log_resource_policy.test", "policy_name", name), - resource.TestCheckResourceAttr("aws_cloudwatch_log_resource_policy.test", "policy_document", "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"route53.amazonaws.com\"},\"Action\":[\"logs:PutLogEvents\",\"logs:CreateLogStream\"],\"Resource\":\"arn:aws:logs:*:*:log-group:/aws/route53/example.com\"}]}"), - ), - }, - }, - }) -} - -func TestAccAWSCloudWatchLogResourcePolicy_Import(t *testing.T) { - resourceName := "aws_cloudwatch_log_resource_policy.test" - - name := acctest.RandString(5) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckCloudWatchLogResourcePolicyDestroy, - Steps: []resource.TestStep{ - { - Config: testAccCheckAWSCloudWatchLogResourcePolicyResourceConfigBasic1(name), - }, - { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, + { + Config: testAccCheckAWSCloudWatchLogResourcePolicyResourceConfigBasic2(name), + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudWatchLogResourcePolicy(resourceName, &resourcePolicy), + resource.TestCheckResourceAttr(resourceName, "policy_name", name), + resource.TestCheckResourceAttr(resourceName, "policy_document", "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"\",\"Effect\":\"Allow\",\"Principal\":{\"Service\":\"route53.amazonaws.com\"},\"Action\":[\"logs:PutLogEvents\",\"logs:CreateLogStream\"],\"Resource\":\"arn:aws:logs:*:*:log-group:/aws/route53/example.com\"}]}"), + ), + }, }, }) } diff --git a/aws/resource_aws_cloudwatch_log_stream.go b/aws/resource_aws_cloudwatch_log_stream.go index eff6ab89f37..72b16cffff3 100644 --- a/aws/resource_aws_cloudwatch_log_stream.go +++ b/aws/resource_aws_cloudwatch_log_stream.go @@ -4,9 +4,11 @@ import ( "fmt" "log" "regexp" + "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudwatchlogs" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -60,7 +62,24 @@ func resourceAwsCloudWatchLogStreamRead(d *schema.ResourceData, meta interface{} group := d.Get("log_group_name").(string) - ls, exists, err := lookupCloudWatchLogStream(conn, d.Id(), group, nil) + var ls *cloudwatchlogs.LogStream + var exists bool + + err := resource.Retry(2*time.Minute, func() *resource.RetryError { + var err error + ls, exists, err = lookupCloudWatchLogStream(conn, d.Id(), group, nil) + if err != nil { + return resource.NonRetryableError(err) + } + if d.IsNewResource() && !exists { + return resource.RetryableError(&resource.NotFoundError{}) + } + return nil + }) + if isResourceTimeoutError(err) { + ls, exists, err = lookupCloudWatchLogStream(conn, d.Id(), group, nil) + } + if err != nil { if !isAWSErr(err, cloudwatchlogs.ErrCodeResourceNotFoundException, "") { return err diff --git a/aws/resource_aws_cloudwatch_log_subscription_filter.go b/aws/resource_aws_cloudwatch_log_subscription_filter.go index 3b7db5f73f2..da4cc8b1783 100644 --- a/aws/resource_aws_cloudwatch_log_subscription_filter.go +++ b/aws/resource_aws_cloudwatch_log_subscription_filter.go @@ -99,13 +99,28 @@ func resourceAwsCloudwatchLogSubscriptionFilterUpdate(d *schema.ResourceData, me 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("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()) + + err := resource.Retry(5*time.Minute, func() *resource.RetryError { + _, err := conn.PutSubscriptionFilter(¶ms) + + if isAWSErr(err, cloudwatchlogs.ErrCodeInvalidParameterException, "Could not deliver test message to specified") { + return resource.RetryableError(err) } - return err + if isAWSErr(err, cloudwatchlogs.ErrCodeInvalidParameterException, "Could not execute the lambda function") { + return resource.RetryableError(err) + } + if err != nil { + return resource.NonRetryableError(err) + } + return nil + }) + + if isResourceTimeoutError(err) { + _, err = conn.PutSubscriptionFilter(¶ms) + } + + if err != nil { + return fmt.Errorf("error updating CloudWatch Log Subscription Filter (%s): %w", d.Get("log_group_name").(string), err) } d.SetId(cloudwatchLogsSubscriptionFilterId(d.Get("log_group_name").(string))) diff --git a/aws/resource_aws_cloudwatch_log_subscription_filter_test.go b/aws/resource_aws_cloudwatch_log_subscription_filter_test.go index 3422724d301..80c105eac7e 100644 --- a/aws/resource_aws_cloudwatch_log_subscription_filter_test.go +++ b/aws/resource_aws_cloudwatch_log_subscription_filter_test.go @@ -544,7 +544,7 @@ resource "aws_lambda_function" "test" { filename = "test-fixtures/lambdatest.zip" function_name = %[1]q role = "${aws_iam_role.test.arn}" - runtime = "nodejs8.10" + runtime = "nodejs12.x" handler = "exports.handler" } diff --git a/aws/resource_aws_cloudwatch_metric_alarm.go b/aws/resource_aws_cloudwatch_metric_alarm.go index 72b5d2ded7a..e1025068d5f 100644 --- a/aws/resource_aws_cloudwatch_metric_alarm.go +++ b/aws/resource_aws_cloudwatch_metric_alarm.go @@ -4,11 +4,11 @@ import ( "fmt" "log" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudwatch" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsCloudWatchMetricAlarm() *schema.Resource { @@ -123,8 +123,15 @@ func resourceAwsCloudWatchMetricAlarm() *schema.Resource { ConflictsWith: []string{"extended_statistic", "metric_query"}, }, "threshold": { - Type: schema.TypeFloat, - Required: true, + Type: schema.TypeFloat, + Optional: true, + ConflictsWith: []string{"threshold_metric_id"}, + }, + "threshold_metric_id": { + Type: schema.TypeString, + Optional: true, + ConflictsWith: []string{"threshold"}, + ValidateFunc: validation.StringLenBetween(1, 255), }, "actions_enabled": { Type: schema.TypeBool, @@ -242,41 +249,44 @@ func resourceAwsCloudWatchMetricAlarmCreate(d *schema.ResourceData, meta interfa } func resourceAwsCloudWatchMetricAlarmRead(d *schema.ResourceData, meta interface{}) error { - a, err := getAwsCloudWatchMetricAlarm(d, meta) + conn := meta.(*AWSClient).cloudwatchconn + + resp, err := getAwsCloudWatchMetricAlarm(d, meta) if err != nil { return err } - if a == nil { + if resp == nil { d.SetId("") return nil } log.Printf("[DEBUG] Reading CloudWatch Metric Alarm: %s", d.Get("alarm_name")) - d.Set("actions_enabled", a.ActionsEnabled) + d.Set("actions_enabled", resp.ActionsEnabled) - if err := d.Set("alarm_actions", _strArrPtrToList(a.AlarmActions)); err != nil { + if err := d.Set("alarm_actions", _strArrPtrToList(resp.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("arn", a.AlarmArn) - d.Set("comparison_operator", a.ComparisonOperator) - d.Set("datapoints_to_alarm", a.DatapointsToAlarm) - if err := d.Set("dimensions", flattenDimensions(a.Dimensions)); err != nil { + arn := *resp.AlarmArn + d.Set("alarm_description", resp.AlarmDescription) + d.Set("alarm_name", resp.AlarmName) + d.Set("arn", arn) + d.Set("comparison_operator", resp.ComparisonOperator) + d.Set("datapoints_to_alarm", resp.DatapointsToAlarm) + if err := d.Set("dimensions", flattenDimensions(resp.Dimensions)); err != nil { return err } - d.Set("evaluation_periods", a.EvaluationPeriods) + d.Set("evaluation_periods", resp.EvaluationPeriods) - if err := d.Set("insufficient_data_actions", _strArrPtrToList(a.InsufficientDataActions)); err != nil { + if err := d.Set("insufficient_data_actions", _strArrPtrToList(resp.InsufficientDataActions)); err != nil { log.Printf("[WARN] Error setting Insufficient Data Actions: %s", err) } - d.Set("metric_name", a.MetricName) - d.Set("namespace", a.Namespace) + d.Set("metric_name", resp.MetricName) + d.Set("namespace", resp.Namespace) - if a.Metrics != nil && len(a.Metrics) > 0 { - metricQueries := make([]interface{}, len(a.Metrics)) - for i, mq := range a.Metrics { + if resp.Metrics != nil && len(resp.Metrics) > 0 { + metricQueries := make([]interface{}, len(resp.Metrics)) + for i, mq := range resp.Metrics { metricQuery := map[string]interface{}{ "expression": aws.StringValue(mq.Expression), "id": aws.StringValue(mq.Id), @@ -301,18 +311,25 @@ func resourceAwsCloudWatchMetricAlarmRead(d *schema.ResourceData, meta interface } } - if err := d.Set("ok_actions", _strArrPtrToList(a.OKActions)); err != nil { + if err := d.Set("ok_actions", _strArrPtrToList(resp.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) - d.Set("treat_missing_data", a.TreatMissingData) - d.Set("evaluate_low_sample_count_percentiles", a.EvaluateLowSampleCountPercentile) + d.Set("period", resp.Period) + d.Set("statistic", resp.Statistic) + d.Set("threshold", resp.Threshold) + d.Set("threshold_metric_id", resp.ThresholdMetricId) + d.Set("unit", resp.Unit) + d.Set("extended_statistic", resp.ExtendedStatistic) + d.Set("treat_missing_data", resp.TreatMissingData) + d.Set("evaluate_low_sample_count_percentiles", resp.EvaluateLowSampleCountPercentile) + + tags, err := keyvaluetags.CloudwatchListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for CloudWatch Metric Alarm (%s): %s", arn, err) + } - if err := saveTagsCloudWatch(meta.(*AWSClient).cloudwatchconn, d, aws.StringValue(a.AlarmArn)); err != nil { + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -330,20 +347,24 @@ func resourceAwsCloudWatchMetricAlarmUpdate(d *schema.ResourceData, meta interfa } log.Println("[INFO] CloudWatch Metric Alarm updated") - // Tags are cannot update by PutMetricAlarm. - if err := setTagsCloudWatch(conn, d, d.Get("arn").(string)); err != nil { - return fmt.Errorf("error updating tags for %s: %s", d.Id(), err) + arn := d.Get("arn").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.CloudwatchUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating CloudWatch Metric Alarm (%s) tags: %s", arn, err) + } } return resourceAwsCloudWatchMetricAlarmRead(d, meta) } func resourceAwsCloudWatchMetricAlarmDelete(d *schema.ResourceData, meta interface{}) error { - p, err := getAwsCloudWatchMetricAlarm(d, meta) + resp, err := getAwsCloudWatchMetricAlarm(d, meta) if err != nil { return err } - if p == nil { + if resp == nil { log.Printf("[DEBUG] CloudWatch Metric Alarm %s is already gone", d.Id()) return nil } @@ -368,9 +389,8 @@ func getAwsCloudWatchPutMetricAlarmInput(d *schema.ResourceData) cloudwatch.PutM 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))), - Threshold: aws.Float64(d.Get("threshold").(float64)), TreatMissingData: aws.String(d.Get("treat_missing_data").(string)), - Tags: tagsFromMapCloudWatch(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().CloudwatchTags(), } if v := d.Get("actions_enabled"); v != nil { @@ -412,6 +432,12 @@ func getAwsCloudWatchPutMetricAlarmInput(d *schema.ResourceData) cloudwatch.PutM params.EvaluateLowSampleCountPercentile = aws.String(v.(string)) } + if v, ok := d.GetOk("threshold_metric_id"); ok { + params.ThresholdMetricId = aws.String(v.(string)) + } else { + params.Threshold = aws.Float64(d.Get("threshold").(float64)) + } + var alarmActions []*string if v := d.Get("alarm_actions"); v != nil { for _, v := range v.(*schema.Set).List() { diff --git a/aws/resource_aws_cloudwatch_metric_alarm_test.go b/aws/resource_aws_cloudwatch_metric_alarm_test.go index d97ce6f726e..af71b63c617 100644 --- a/aws/resource_aws_cloudwatch_metric_alarm_test.go +++ b/aws/resource_aws_cloudwatch_metric_alarm_test.go @@ -14,8 +14,8 @@ import ( func TestAccAWSCloudWatchMetricAlarm_basic(t *testing.T) { var alarm cloudwatch.MetricAlarm - resourceName := "aws_cloudwatch_metric_alarm.foobar" - rInt := acctest.RandInt() + resourceName := "aws_cloudwatch_metric_alarm.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -23,15 +23,14 @@ func TestAccAWSCloudWatchMetricAlarm_basic(t *testing.T) { CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCloudWatchMetricAlarmConfig(rInt), + Config: testAccAWSCloudWatchMetricAlarmConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), resource.TestCheckResourceAttr(resourceName, "metric_name", "CPUUtilization"), resource.TestCheckResourceAttr(resourceName, "statistic", "Average"), - resource.TestMatchResourceAttr(resourceName, "arn", - regexp.MustCompile(`^arn:[\w-]+:cloudwatch:[^:]+:\d{12}:alarm:.+$`)), - testAccCheckCloudWatchMetricAlarmDimension( - resourceName, "InstanceId", "i-abc123"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "cloudwatch", regexp.MustCompile(`alarm:.+`)), + testAccCheckCloudWatchMetricAlarmDimension(resourceName, "InstanceId", "i-abc123"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -144,7 +143,8 @@ func TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction(t *testing.T) { func TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm(t *testing.T) { var alarm cloudwatch.MetricAlarm - rInt := acctest.RandInt() + resourceName := "aws_cloudwatch_metric_alarm.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -152,10 +152,10 @@ func TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm(t *testing.T) { CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCloudWatchMetricAlarmConfigDatapointsToAlarm(rInt), + Config: testAccAWSCloudWatchMetricAlarmConfigDatapointsToAlarm(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), - resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "datapoints_to_alarm", "2"), + testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), + resource.TestCheckResourceAttr(resourceName, "datapoints_to_alarm", "2"), ), }, }, @@ -164,7 +164,8 @@ func TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm(t *testing.T) { func TestAccAWSCloudWatchMetricAlarm_treatMissingData(t *testing.T) { var alarm cloudwatch.MetricAlarm - rInt := acctest.RandInt() + resourceName := "aws_cloudwatch_metric_alarm.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -172,17 +173,17 @@ func TestAccAWSCloudWatchMetricAlarm_treatMissingData(t *testing.T) { CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCloudWatchMetricAlarmConfigTreatMissingData(rInt), + Config: testAccAWSCloudWatchMetricAlarmConfigTreatMissingData(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), - resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "treat_missing_data", "missing"), + testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), + resource.TestCheckResourceAttr(resourceName, "treat_missing_data", "missing"), ), }, { - Config: testAccAWSCloudWatchMetricAlarmConfigTreatMissingDataUpdate(rInt), + Config: testAccAWSCloudWatchMetricAlarmConfigTreatMissingDataUpdate(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), - resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "treat_missing_data", "breaching"), + testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), + resource.TestCheckResourceAttr(resourceName, "treat_missing_data", "breaching"), ), }, }, @@ -191,7 +192,8 @@ func TestAccAWSCloudWatchMetricAlarm_treatMissingData(t *testing.T) { func TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles(t *testing.T) { var alarm cloudwatch.MetricAlarm - rInt := acctest.RandInt() + resourceName := "aws_cloudwatch_metric_alarm.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -199,17 +201,17 @@ func TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles(t *testin CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCloudWatchMetricAlarmConfigTreatEvaluateLowSampleCountPercentiles(rInt), + Config: testAccAWSCloudWatchMetricAlarmConfigTreatEvaluateLowSampleCountPercentiles(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), - resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "evaluate_low_sample_count_percentiles", "evaluate"), + testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), + resource.TestCheckResourceAttr(resourceName, "evaluate_low_sample_count_percentiles", "evaluate"), ), }, { - Config: testAccAWSCloudWatchMetricAlarmConfigTreatEvaluateLowSampleCountPercentilesUpdated(rInt), + Config: testAccAWSCloudWatchMetricAlarmConfigTreatEvaluateLowSampleCountPercentilesUpdated(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), - resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "evaluate_low_sample_count_percentiles", "ignore"), + testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), + resource.TestCheckResourceAttr(resourceName, "evaluate_low_sample_count_percentiles", "ignore"), ), }, }, @@ -218,7 +220,8 @@ func TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles(t *testin func TestAccAWSCloudWatchMetricAlarm_extendedStatistic(t *testing.T) { var alarm cloudwatch.MetricAlarm - rInt := acctest.RandInt() + resourceName := "aws_cloudwatch_metric_alarm.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -226,10 +229,10 @@ func TestAccAWSCloudWatchMetricAlarm_extendedStatistic(t *testing.T) { CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCloudWatchMetricAlarmConfigExtendedStatistic(rInt), + Config: testAccAWSCloudWatchMetricAlarmConfigExtendedStatistic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), - resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "extended_statistic", "p88.0"), + testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), + resource.TestCheckResourceAttr(resourceName, "extended_statistic", "p88.0"), ), }, }, @@ -238,7 +241,8 @@ func TestAccAWSCloudWatchMetricAlarm_extendedStatistic(t *testing.T) { func TestAccAWSCloudWatchMetricAlarm_expression(t *testing.T) { var alarm cloudwatch.MetricAlarm - rInt := acctest.RandInt() + resourceName := "aws_cloudwatch_metric_alarm.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -246,39 +250,46 @@ func TestAccAWSCloudWatchMetricAlarm_expression(t *testing.T) { CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCloudWatchMetricAlarmConfigWithBadExpression(rInt), + Config: testAccAWSCloudWatchMetricAlarmConfigWithBadExpression(rName), ExpectError: regexp.MustCompile("No metric_query may have both `expression` and a `metric` specified"), }, { - Config: testAccAWSCloudWatchMetricAlarmConfigWithExpression(rInt), + Config: testAccAWSCloudWatchMetricAlarmConfigWithExpression(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), - resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "metric_query.#", "2"), + testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), + resource.TestCheckResourceAttr(resourceName, "metric_query.#", "2"), ), }, { - Config: testAccAWSCloudWatchMetricAlarmConfigWithExpressionUpdated(rInt), + Config: testAccAWSCloudWatchMetricAlarmConfigWithExpressionUpdated(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), - resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "metric_query.#", "3"), + testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), + resource.TestCheckResourceAttr(resourceName, "metric_query.#", "3"), ), }, { - Config: testAccAWSCloudWatchMetricAlarmConfigWithExpression(rInt), + Config: testAccAWSCloudWatchMetricAlarmConfigWithExpression(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), - resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "metric_query.#", "2"), + testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), + resource.TestCheckResourceAttr(resourceName, "metric_query.#", "2"), ), }, { - Config: testAccAWSCloudWatchMetricAlarmConfigWithExpressionWithQueryUpdated(rInt), + Config: testAccAWSCloudWatchMetricAlarmConfigWithAnomalyDetectionExpression(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchMetricAlarmExists("aws_cloudwatch_metric_alarm.foobar", &alarm), - resource.TestCheckResourceAttr("aws_cloudwatch_metric_alarm.foobar", "metric_query.#", "2"), + testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), + resource.TestCheckResourceAttr(resourceName, "metric_query.#", "2"), ), }, { - ResourceName: "aws_cloudwatch_metric_alarm.foobar", + Config: testAccAWSCloudWatchMetricAlarmConfigWithExpressionWithQueryUpdated(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), + resource.TestCheckResourceAttr(resourceName, "metric_query.#", "2"), + ), + }, + { + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -287,14 +298,14 @@ func TestAccAWSCloudWatchMetricAlarm_expression(t *testing.T) { } func TestAccAWSCloudWatchMetricAlarm_missingStatistic(t *testing.T) { - rInt := acctest.RandInt() + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCloudWatchMetricAlarmConfigMissingStatistic(rInt), + Config: testAccAWSCloudWatchMetricAlarmConfigMissingStatistic(rName), ExpectError: regexp.MustCompile("One of `statistic` or `extended_statistic` must be set for a cloudwatch metric alarm"), }, }, @@ -303,8 +314,8 @@ func TestAccAWSCloudWatchMetricAlarm_missingStatistic(t *testing.T) { func TestAccAWSCloudWatchMetricAlarm_tags(t *testing.T) { var alarm cloudwatch.MetricAlarm - resourceName := "aws_cloudwatch_metric_alarm.foobar" - rInt := acctest.RandInt() + resourceName := "aws_cloudwatch_metric_alarm.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -312,39 +323,34 @@ func TestAccAWSCloudWatchMetricAlarm_tags(t *testing.T) { CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCloudWatchMetricAlarmConfigTags(rInt), + Config: testAccAWSCloudWatchMetricAlarmConfigTags1(rName, "key1", "value1"), Check: resource.ComposeTestCheckFunc( testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), - resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), - resource.TestCheckResourceAttr(resourceName, "tags.Name", fmt.Sprintf("terraform-test-foobar%d", rInt)), - resource.TestCheckResourceAttr(resourceName, "tags.fizz", "buzz"), - resource.TestCheckResourceAttr(resourceName, "tags.foo", "bar"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), }, { - Config: testAccAWSCloudWatchMetricAlarmConfigUpdateTags(rInt), - Check: resource.ComposeTestCheckFunc( - testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), - resource.TestCheckResourceAttr(resourceName, "tags.%", "4"), - resource.TestCheckResourceAttr(resourceName, "tags.Name", fmt.Sprintf("terraform-test-foobar%d", rInt)), - resource.TestCheckResourceAttr(resourceName, "tags.fizz", "buzz"), - resource.TestCheckResourceAttr(resourceName, "tags.foo", "bar2"), - resource.TestCheckResourceAttr(resourceName, "tags.good", "bad"), - ), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, }, { - Config: testAccAWSCloudWatchMetricAlarmConfigRemoveTags(rInt), + Config: testAccAWSCloudWatchMetricAlarmConfigTags2(rName, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeTestCheckFunc( testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags.Name", fmt.Sprintf("terraform-test-foobar%d", rInt)), - resource.TestCheckResourceAttr(resourceName, "tags.fizz", "buzz"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, + Config: testAccAWSCloudWatchMetricAlarmConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudWatchMetricAlarmExists(resourceName, &alarm), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), }, }, }) @@ -417,10 +423,10 @@ func testAccCheckAWSCloudWatchMetricAlarmDestroy(s *terraform.State) error { return nil } -func testAccAWSCloudWatchMetricAlarmConfig(rInt int) string { +func testAccAWSCloudWatchMetricAlarmConfig(rName string) string { return fmt.Sprintf(` -resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar%d" +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = "%s" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" metric_name = "CPUUtilization" @@ -435,13 +441,13 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { InstanceId = "i-abc123" } } -`, rInt) +`, rName) } -func testAccAWSCloudWatchMetricAlarmConfigDatapointsToAlarm(rInt int) string { +func testAccAWSCloudWatchMetricAlarmConfigDatapointsToAlarm(rName string) string { return fmt.Sprintf(` -resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar%d" +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = "%s" comparison_operator = "GreaterThanOrEqualToThreshold" datapoints_to_alarm = "2" evaluation_periods = "2" @@ -457,13 +463,13 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { InstanceId = "i-abc123" } } -`, rInt) +`, rName) } -func testAccAWSCloudWatchMetricAlarmConfigTreatMissingData(rInt int) string { +func testAccAWSCloudWatchMetricAlarmConfigTreatMissingData(rName string) string { return fmt.Sprintf(` -resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar%d" +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = "%s" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" metric_name = "CPUUtilization" @@ -479,13 +485,13 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { InstanceId = "i-abc123" } } -`, rInt) +`, rName) } -func testAccAWSCloudWatchMetricAlarmConfigTreatMissingDataUpdate(rInt int) string { +func testAccAWSCloudWatchMetricAlarmConfigTreatMissingDataUpdate(rName string) string { return fmt.Sprintf(` -resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar%d" +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = "%s" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" metric_name = "CPUUtilization" @@ -501,13 +507,13 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { InstanceId = "i-abc123" } } -`, rInt) +`, rName) } -func testAccAWSCloudWatchMetricAlarmConfigTreatEvaluateLowSampleCountPercentiles(rInt int) string { +func testAccAWSCloudWatchMetricAlarmConfigTreatEvaluateLowSampleCountPercentiles(rName string) string { return fmt.Sprintf(` -resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar%d" +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = "%s" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" metric_name = "CPUUtilization" @@ -523,13 +529,13 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { InstanceId = "i-abc123" } } -`, rInt) +`, rName) } -func testAccAWSCloudWatchMetricAlarmConfigTreatEvaluateLowSampleCountPercentilesUpdated(rInt int) string { +func testAccAWSCloudWatchMetricAlarmConfigTreatEvaluateLowSampleCountPercentilesUpdated(rName string) string { return fmt.Sprintf(` -resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar%d" +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = "%s" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" metric_name = "CPUUtilization" @@ -545,13 +551,13 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { InstanceId = "i-abc123" } } -`, rInt) +`, rName) } -func testAccAWSCloudWatchMetricAlarmConfigExtendedStatistic(rInt int) string { +func testAccAWSCloudWatchMetricAlarmConfigExtendedStatistic(rName string) string { return fmt.Sprintf(` -resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar%d" +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = "%s" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" metric_name = "CPUUtilization" @@ -566,13 +572,13 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { InstanceId = "i-abc123" } } -`, rInt) +`, rName) } -func testAccAWSCloudWatchMetricAlarmConfigMissingStatistic(rInt int) string { +func testAccAWSCloudWatchMetricAlarmConfigMissingStatistic(rName string) string { return fmt.Sprintf(` -resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar%d" +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = "%s" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" metric_name = "CPUUtilization" @@ -586,13 +592,13 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { InstanceId = "i-abc123" } } -`, rInt) +`, rName) } -func testAccAWSCloudWatchMetricAlarmConfigWithExpression(rInt int) string { +func testAccAWSCloudWatchMetricAlarmConfigWithExpression(rName string) string { return fmt.Sprintf(` -resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar%d" +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = "%s" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" threshold = "80" @@ -622,13 +628,49 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { } } } -`, rInt) +`, rName) } -func testAccAWSCloudWatchMetricAlarmConfigWithExpressionUpdated(rInt int) string { +func testAccAWSCloudWatchMetricAlarmConfigWithAnomalyDetectionExpression(rName string) string { return fmt.Sprintf(` -resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar%d" +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = "%s" + comparison_operator = "GreaterThanUpperThreshold" + evaluation_periods = "2" + threshold_metric_id = "e1" + alarm_description = "This metric monitors ec2 cpu utilization" + insufficient_data_actions = [] + + metric_query { + id = "e1" + expression = "ANOMALY_DETECTION_BAND(m1)" + label = "CPUUtilization (Expected)" + return_data = "true" + } + + metric_query { + id = "m1" + return_data = "true" + metric { + metric_name = "CPUUtilization" + namespace = "AWS/EC2" + period = "120" + stat = "Average" + unit = "Count" + + dimensions = { + InstanceId = "i-abc123" + } + } + } +} +`, rName) +} + +func testAccAWSCloudWatchMetricAlarmConfigWithExpressionUpdated(rName string) string { + return fmt.Sprintf(` +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = "%s" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" threshold = "80" @@ -664,13 +706,13 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { } } } -`, rInt) +`, rName) } -func testAccAWSCloudWatchMetricAlarmConfigWithExpressionWithQueryUpdated(rInt int) string { +func testAccAWSCloudWatchMetricAlarmConfigWithExpressionWithQueryUpdated(rName string) string { return fmt.Sprintf(` -resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar%d" +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = "%s" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" threshold = "80" @@ -700,13 +742,13 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { } } } -`, rInt) +`, rName) } -func testAccAWSCloudWatchMetricAlarmConfigWithBadExpression(rInt int) string { +func testAccAWSCloudWatchMetricAlarmConfigWithBadExpression(rName string) string { return fmt.Sprintf(` -resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar%d" +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = "%s" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" threshold = "80" @@ -731,7 +773,7 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { } } } -`, rInt) +`, rName) } // EC2 Automate requires a valid EC2 instance @@ -858,37 +900,10 @@ resource "aws_cloudwatch_metric_alarm" "test" { `, rName) } -func testAccAWSCloudWatchMetricAlarmConfigTags(rInt int) string { +func testAccAWSCloudWatchMetricAlarmConfigTags1(rName, tagKey1, tagValue1 string) string { return fmt.Sprintf(` -resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar%[1]d" - comparison_operator = "GreaterThanOrEqualToThreshold" - evaluation_periods = "2" - metric_name = "CPUUtilization" - namespace = "AWS/EC2" - period = "120" - statistic = "Average" - threshold = "80" - alarm_description = "This metric monitors ec2 cpu utilization" - insufficient_data_actions = [] - - dimensions = { - InstanceId = "i-abc123" - } - - tags = { - Name = "terraform-test-foobar%[1]d" - fizz = "buzz" - foo = "bar" - } -} -`, rInt) -} - -func testAccAWSCloudWatchMetricAlarmConfigUpdateTags(rInt int) string { - return fmt.Sprintf(` -resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar%[1]d" +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = %[1]q comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" metric_name = "CPUUtilization" @@ -904,19 +919,16 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { } tags = { - Name = "terraform-test-foobar%[1]d" - fizz = "buzz" - foo = "bar2" - good = "bad" + %[2]q = %[3]q } } -`, rInt) +`, rName, tagKey1, tagValue1) } -func testAccAWSCloudWatchMetricAlarmConfigRemoveTags(rInt int) string { +func testAccAWSCloudWatchMetricAlarmConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { return fmt.Sprintf(` -resource "aws_cloudwatch_metric_alarm" "foobar" { - alarm_name = "terraform-test-foobar%[1]d" +resource "aws_cloudwatch_metric_alarm" "test" { + alarm_name = %[1]q comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "2" metric_name = "CPUUtilization" @@ -932,9 +944,9 @@ resource "aws_cloudwatch_metric_alarm" "foobar" { } tags = { - Name = "terraform-test-foobar%[1]d" - fizz = "buzz" + %[2]q = %[3]q + %[4]q = %[5]q } } -`, rInt) +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) } diff --git a/aws/resource_aws_codebuild_project.go b/aws/resource_aws_codebuild_project.go index 58f071b0e1d..45b4093e0e7 100644 --- a/aws/resource_aws_codebuild_project.go +++ b/aws/resource_aws_codebuild_project.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsCodeBuildProject() *schema.Resource { @@ -171,6 +172,7 @@ func resourceAwsCodeBuildProject() *schema.Resource { codebuild.ComputeTypeBuildGeneral1Small, codebuild.ComputeTypeBuildGeneral1Medium, codebuild.ComputeTypeBuildGeneral1Large, + codebuild.ComputeTypeBuildGeneral12xlarge, }, false), }, "environment_variable": { @@ -208,7 +210,9 @@ func resourceAwsCodeBuildProject() *schema.Resource { Required: true, ValidateFunc: validation.StringInSlice([]string{ codebuild.EnvironmentTypeLinuxContainer, + codebuild.EnvironmentTypeLinuxGpuContainer, codebuild.EnvironmentTypeWindowsContainer, + codebuild.EnvironmentTypeArmContainer, }, false), }, "image_pull_credentials_type": { @@ -437,6 +441,19 @@ func resourceAwsCodeBuildProject() *schema.Resource { Optional: true, ValidateFunc: validation.IntAtLeast(0), }, + "git_submodules_config": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "fetch_submodules": { + Type: schema.TypeBool, + Required: true, + }, + }, + }, + }, "insecure_ssl": { Type: schema.TypeBool, Optional: true, @@ -507,6 +524,19 @@ func resourceAwsCodeBuildProject() *schema.Resource { Optional: true, ValidateFunc: validation.IntAtLeast(0), }, + "git_submodules_config": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "fetch_submodules": { + Type: schema.TypeBool, + Required: true, + }, + }, + }, + }, "insecure_ssl": { Type: schema.TypeBool, Optional: true, @@ -521,12 +551,22 @@ func resourceAwsCodeBuildProject() *schema.Resource { MaxItems: 1, Set: resourceAwsCodeBuildProjectSourceHash, }, + "source_version": { + Type: schema.TypeString, + Optional: true, + }, "build_timeout": { Type: schema.TypeInt, Optional: true, Default: "60", ValidateFunc: validation.IntBetween(5, 480), }, + "queued_timeout": { + Type: schema.TypeInt, + Optional: true, + Default: "480", + ValidateFunc: validation.IntBetween(5, 480), + }, "badge_enabled": { Type: schema.TypeBool, Optional: true, @@ -610,6 +650,7 @@ func resourceAwsCodeBuildProjectCreate(d *schema.ResourceData, meta interface{}) SecondaryArtifacts: projectSecondaryArtifacts, SecondarySources: projectSecondarySources, LogsConfig: projectLogsConfig, + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().CodebuildTags(), } if v, ok := d.GetOk("cache"); ok { @@ -628,10 +669,18 @@ func resourceAwsCodeBuildProjectCreate(d *schema.ResourceData, meta interface{}) params.ServiceRole = aws.String(v.(string)) } + if v, ok := d.GetOk("source_version"); ok { + params.SourceVersion = aws.String(v.(string)) + } + if v, ok := d.GetOk("build_timeout"); ok { params.TimeoutInMinutes = aws.Int64(int64(v.(int))) } + if v, ok := d.GetOk("queued_timeout"); ok { + params.QueuedTimeoutInMinutes = aws.Int64(int64(v.(int))) + } + if v, ok := d.GetOk("vpc_config"); ok { params.VpcConfig = expandCodeBuildVpcConfig(v.([]interface{})) } @@ -640,10 +689,6 @@ func resourceAwsCodeBuildProjectCreate(d *schema.ResourceData, meta interface{}) params.BadgeEnabled = aws.Bool(v.(bool)) } - if v, ok := d.GetOk("tags"); ok { - params.Tags = tagsFromMapCodeBuild(v.(map[string]interface{})) - } - var resp *codebuild.CreateProjectOutput // Handle IAM eventual consistency err := resource.Retry(5*time.Minute, func() *resource.RetryError { @@ -653,7 +698,7 @@ func resourceAwsCodeBuildProjectCreate(d *schema.ResourceData, meta interface{}) if err != nil { // InvalidInputException: CodeBuild is not authorized to perform // InvalidInputException: Not authorized to perform DescribeSecurityGroups - if isAWSErr(err, "InvalidInputException", "ot authorized to perform") { + if isAWSErr(err, codebuild.ErrCodeInvalidInputException, "ot authorized to perform") { return resource.RetryableError(err) } @@ -1002,6 +1047,21 @@ func expandProjectSourceData(data map[string]interface{}) codebuild.ProjectSourc } } + // Only valid for CODECOMMIT source types. + if sourceType == codebuild.SourceTypeCodecommit { + if v, ok := data["git_submodules_config"]; ok && len(v.([]interface{})) > 0 { + config := v.([]interface{})[0].(map[string]interface{}) + + gitSubmodulesConfig := &codebuild.GitSubmodulesConfig{} + + if v, ok := config["fetch_submodules"]; ok { + gitSubmodulesConfig.FetchSubmodules = aws.Bool(v.(bool)) + } + + projectSource.GitSubmodulesConfig = gitSubmodulesConfig + } + } + return projectSource } @@ -1064,7 +1124,9 @@ func resourceAwsCodeBuildProjectRead(d *schema.ResourceData, meta interface{}) e d.Set("encryption_key", project.EncryptionKey) d.Set("name", project.Name) d.Set("service_role", project.ServiceRole) + d.Set("source_version", project.SourceVersion) d.Set("build_timeout", project.TimeoutInMinutes) + d.Set("queued_timeout", project.QueuedTimeoutInMinutes) if project.Badge != nil { d.Set("badge_enabled", project.Badge.BadgeEnabled) d.Set("badge_url", project.Badge.BadgeRequestUrl) @@ -1073,7 +1135,7 @@ func resourceAwsCodeBuildProjectRead(d *schema.ResourceData, meta interface{}) e d.Set("badge_url", "") } - if err := d.Set("tags", tagsToMapCodeBuild(project.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.CodebuildKeyValueTags(project.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -1143,17 +1205,25 @@ func resourceAwsCodeBuildProjectUpdate(d *schema.ResourceData, meta interface{}) params.ServiceRole = aws.String(d.Get("service_role").(string)) } + if d.HasChange("source_version") { + params.SourceVersion = aws.String(d.Get("source_version").(string)) + } + if d.HasChange("build_timeout") { params.TimeoutInMinutes = aws.Int64(int64(d.Get("build_timeout").(int))) } + if d.HasChange("queued_timeout") { + params.QueuedTimeoutInMinutes = aws.Int64(int64(d.Get("queued_timeout").(int))) + } + if d.HasChange("badge_enabled") { params.BadgeEnabled = aws.Bool(d.Get("badge_enabled").(bool)) } // 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{})) + params.Tags = keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().CodebuildTags() // Handle IAM eventual consistency err := resource.Retry(1*time.Minute, func() *resource.RetryError { @@ -1163,7 +1233,7 @@ func resourceAwsCodeBuildProjectUpdate(d *schema.ResourceData, meta interface{}) if err != nil { // InvalidInputException: CodeBuild is not authorized to perform // InvalidInputException: Not authorized to perform DescribeSecurityGroups - if isAWSErr(err, "InvalidInputException", "ot authorized to perform") { + if isAWSErr(err, codebuild.ErrCodeInvalidInputException, "ot authorized to perform") { return resource.RetryableError(err) } @@ -1368,10 +1438,11 @@ func flattenAwsCodeBuildProjectSourceData(source *codebuild.ProjectSource) inter "type": aws.StringValue(source.Type), } + m["git_submodules_config"] = flattenAwsCodebuildProjectGitSubmodulesConfig(source.GitSubmodulesConfig) + if source.Auth != nil { m["auth"] = schema.NewSet(resourceAwsCodeBuildProjectSourceAuthHash, []interface{}{sourceAuthToMap(source.Auth)}) } - if source.SourceIdentifier != nil { m["source_identifier"] = aws.StringValue(source.SourceIdentifier) } @@ -1379,6 +1450,18 @@ func flattenAwsCodeBuildProjectSourceData(source *codebuild.ProjectSource) inter return m } +func flattenAwsCodebuildProjectGitSubmodulesConfig(config *codebuild.GitSubmodulesConfig) []interface{} { + if config == nil { + return []interface{}{} + } + + values := map[string]interface{}{ + "fetch_submodules": aws.BoolValue(config.FetchSubmodules), + } + + return []interface{}{values} +} + func flattenAwsCodeBuildVpcConfig(vpcConfig *codebuild.VpcConfig) []interface{} { if vpcConfig != nil { values := map[string]interface{}{} @@ -1492,6 +1575,13 @@ func resourceAwsCodeBuildProjectSourceHash(v interface{}) int { if v, ok := m["git_clone_depth"]; ok { buf.WriteString(fmt.Sprintf("%s-", strconv.Itoa(v.(int)))) } + if v, ok := m["git_submodules_config"]; ok && len(v.([]interface{})) > 0 && v.([]interface{})[0] != nil { + m := v.([]interface{})[0].(map[string]interface{}) + + if v, ok := m["fetch_submodules"]; ok { + buf.WriteString(fmt.Sprintf("%s-", strconv.FormatBool(v.(bool)))) + } + } if v, ok := m["insecure_ssl"]; ok { buf.WriteString(fmt.Sprintf("%s-", strconv.FormatBool(v.(bool)))) } diff --git a/aws/resource_aws_codebuild_project_test.go b/aws/resource_aws_codebuild_project_test.go index da19d2c9270..7e9b5a95713 100644 --- a/aws/resource_aws_codebuild_project_test.go +++ b/aws/resource_aws_codebuild_project_test.go @@ -39,27 +39,6 @@ func testAccAWSCodeBuildGitHubSourceLocationFromEnv() string { return sourceLocation } -func TestAccAWSCodeBuildProject_importBasic(t *testing.T) { - resourceName := "aws_codebuild_project.test" - rName := acctest.RandomWithPrefix("tf-acc-test") - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSCodeBuildProjectConfig_basic(rName), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func TestAccAWSCodeBuildProject_basic(t *testing.T) { var project codebuild.Project rName := acctest.RandomWithPrefix("tf-acc-test") @@ -78,6 +57,7 @@ func TestAccAWSCodeBuildProject_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "artifacts.#", "1"), resource.TestCheckResourceAttr(resourceName, "badge_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "build_timeout", "60"), + resource.TestCheckResourceAttr(resourceName, "queued_timeout", "480"), resource.TestCheckResourceAttr(resourceName, "cache.#", "1"), resource.TestCheckResourceAttr(resourceName, "cache.0.type", "NO_CACHE"), resource.TestCheckResourceAttr(resourceName, "description", ""), @@ -130,6 +110,11 @@ func TestAccAWSCodeBuildProject_BadgeEnabled(t *testing.T) { resource.TestMatchResourceAttr(resourceName, "badge_url", regexp.MustCompile(`\b(https?).*\b`)), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -151,6 +136,11 @@ func TestAccAWSCodeBuildProject_BuildTimeout(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "build_timeout", "120"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCodeBuildProjectConfig_BuildTimeout(rName, 240), Check: resource.ComposeTestCheckFunc( @@ -162,6 +152,39 @@ func TestAccAWSCodeBuildProject_BuildTimeout(t *testing.T) { }) } +func TestAccAWSCodeBuildProject_QueuedTimeout(t *testing.T) { + var project codebuild.Project + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_codebuild_project.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSCodeBuildProjectConfig_QueuedTimeout(rName, 120), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSCodeBuildProjectExists(resourceName, &project), + resource.TestCheckResourceAttr(resourceName, "queued_timeout", "120"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSCodeBuildProjectConfig_QueuedTimeout(rName, 240), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSCodeBuildProjectExists(resourceName, &project), + resource.TestCheckResourceAttr(resourceName, "queued_timeout", "240"), + ), + }, + }, + }) +} + func TestAccAWSCodeBuildProject_Cache(t *testing.T) { var project codebuild.Project rName := acctest.RandomWithPrefix("tf-acc-test") @@ -184,6 +207,11 @@ func TestAccAWSCodeBuildProject_Cache(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "cache.0.type", "NO_CACHE"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCodeBuildProjectConfig_basic(rName), Check: resource.ComposeTestCheckFunc( @@ -248,6 +276,11 @@ func TestAccAWSCodeBuildProject_Description(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "description", "description1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCodeBuildProjectConfig_Description(rName, "description2"), Check: resource.ComposeTestCheckFunc( @@ -259,6 +292,27 @@ func TestAccAWSCodeBuildProject_Description(t *testing.T) { }) } +func TestAccAWSCodeBuildProject_SourceVersion(t *testing.T) { + var project codebuild.Project + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_codebuild_project.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSCodeBuildProjectConfig_SourceVersion(rName, "master"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSCodeBuildProjectExists(resourceName, &project), + resource.TestCheckResourceAttr(resourceName, "source_version", "master"), + ), + }, + }, + }) +} + func TestAccAWSCodeBuildProject_EncryptionKey(t *testing.T) { var project codebuild.Project rName := acctest.RandomWithPrefix("tf-acc-test") @@ -276,6 +330,11 @@ func TestAccAWSCodeBuildProject_EncryptionKey(t *testing.T) { resource.TestMatchResourceAttr(resourceName, "encryption_key", regexp.MustCompile(`.+`)), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -348,6 +407,11 @@ func TestAccAWSCodeBuildProject_Environment_EnvironmentVariable_Type(t *testing. resource.TestCheckResourceAttr(resourceName, "environment.4178155002.environment_variable.1.type", "PLAINTEXT"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCodeBuildProjectConfig_Environment_EnvironmentVariable_Type(rName, "PARAMETER_STORE"), Check: resource.ComposeTestCheckFunc( @@ -379,6 +443,11 @@ func TestAccAWSCodeBuildProject_Environment_Certificate(t *testing.T) { testAccCheckAWSCodeBuildProjectCertificate(&project, fmt.Sprintf("%s/%s", bName, oName)), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -495,6 +564,11 @@ func TestAccAWSCodeBuildProject_Source_Auth(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "source.3680505372.auth.2706882902.type", "OAUTH"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -516,6 +590,11 @@ func TestAccAWSCodeBuildProject_Source_GitCloneDepth(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "source.1181740906.git_clone_depth", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCodeBuildProjectConfig_Source_GitCloneDepth(rName, 2), Check: resource.ComposeTestCheckFunc( @@ -527,6 +606,80 @@ func TestAccAWSCodeBuildProject_Source_GitCloneDepth(t *testing.T) { }) } +func TestAccAWSCodeBuildProject_Source_GitSubmodulesConfig(t *testing.T) { + var project codebuild.Project + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_codebuild_project.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSCodeBuildProjectConfig_Source_GitSubmodulesConfig(rName, true), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSCodeBuildProjectExists(resourceName, &project), + resource.TestCheckResourceAttr(resourceName, "source.3389748318.git_submodules_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "source.3389748318.git_submodules_config.0.fetch_submodules", "true"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSCodeBuildProjectConfig_Source_GitSubmodulesConfig(rName, false), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSCodeBuildProjectExists(resourceName, &project), + resource.TestCheckResourceAttr(resourceName, "source.3338377709.git_submodules_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "source.3338377709.git_submodules_config.0.fetch_submodules", "false"), + ), + }, + }, + }) +} + +func TestAccAWSCodeBuildProject_SecondarySources_GitSubmodulesConfig(t *testing.T) { + var project codebuild.Project + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_codebuild_project.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSCodeBuildProjectConfig_SecondarySources_GitSubmodulesConfig(rName, true), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSCodeBuildProjectExists(resourceName, &project), + resource.TestCheckResourceAttr(resourceName, "secondary_sources.2336845252.git_submodules_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "secondary_sources.2336845252.git_submodules_config.0.fetch_submodules", "true"), + resource.TestCheckResourceAttr(resourceName, "secondary_sources.2080741754.git_submodules_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "secondary_sources.2080741754.git_submodules_config.0.fetch_submodules", "true"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSCodeBuildProjectConfig_SecondarySources_GitSubmodulesConfig(rName, false), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSCodeBuildProjectExists(resourceName, &project), + resource.TestCheckResourceAttr(resourceName, "secondary_sources.3511868825.git_submodules_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "secondary_sources.3511868825.git_submodules_config.0.fetch_submodules", "false"), + resource.TestCheckResourceAttr(resourceName, "secondary_sources.1651171204.git_submodules_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "secondary_sources.1651171204.git_submodules_config.0.fetch_submodules", "false"), + ), + }, + }, + }) +} + func TestAccAWSCodeBuildProject_Source_InsecureSSL(t *testing.T) { var project codebuild.Project rName := acctest.RandomWithPrefix("tf-acc-test") @@ -544,6 +697,11 @@ func TestAccAWSCodeBuildProject_Source_InsecureSSL(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "source.1976396802.insecure_ssl", "true"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCodeBuildProjectConfig_Source_InsecureSSL(rName, false), Check: resource.ComposeTestCheckFunc( @@ -572,6 +730,11 @@ func TestAccAWSCodeBuildProject_Source_ReportBuildStatus_Bitbucket(t *testing.T) resource.TestCheckResourceAttr(resourceName, "source.2876219937.report_build_status", "true"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCodeBuildProjectConfig_Source_ReportBuildStatus_Bitbucket(rName, false), Check: resource.ComposeTestCheckFunc( @@ -600,6 +763,11 @@ func TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHub(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "source.4215890488.report_build_status", "true"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCodeBuildProjectConfig_Source_ReportBuildStatus_GitHub(rName, false), Check: resource.ComposeTestCheckFunc( @@ -628,6 +796,11 @@ func TestAccAWSCodeBuildProject_Source_ReportBuildStatus_GitHubEnterprise(t *tes resource.TestCheckResourceAttr(resourceName, "source.2964899175.report_build_status", "true"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCodeBuildProjectConfig_Source_ReportBuildStatus_GitHubEnterprise(rName, false), Check: resource.ComposeTestCheckFunc( @@ -656,6 +829,11 @@ func TestAccAWSCodeBuildProject_Source_Type_Bitbucket(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "source.3210444828.type", "BITBUCKET"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -677,6 +855,11 @@ func TestAccAWSCodeBuildProject_Source_Type_CodeCommit(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "source.3715340088.type", "CODECOMMIT"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -698,6 +881,11 @@ func TestAccAWSCodeBuildProject_Source_Type_CodePipeline(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "source.2280907000.type", "CODEPIPELINE"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -719,6 +907,11 @@ func TestAccAWSCodeBuildProject_Source_Type_GitHubEnterprise(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "source.553628638.type", "GITHUB_ENTERPRISE"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -739,6 +932,11 @@ func TestAccAWSCodeBuildProject_Source_Type_S3(t *testing.T) { testAccCheckAWSCodeBuildProjectExists(resourceName, &project), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -766,6 +964,11 @@ phases: resource.TestCheckResourceAttr(resourceName, "source.2726343112.type", "NO_SOURCE"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -815,6 +1018,11 @@ func TestAccAWSCodeBuildProject_Tags(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "tags.tag2", "tag2value"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCodeBuildProjectConfig_Tags(rName, "tag2", "tag2value-updated"), Check: resource.ComposeTestCheckFunc( @@ -848,6 +1056,11 @@ func TestAccAWSCodeBuildProject_VpcConfig(t *testing.T) { resource.TestMatchResourceAttr(resourceName, "vpc_config.0.vpc_id", regexp.MustCompile(`^vpc-`)), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCodeBuildProjectConfig_VpcConfig1(rName), Check: resource.ComposeTestCheckFunc( @@ -892,6 +1105,36 @@ func TestAccAWSCodeBuildProject_WindowsContainer(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "environment.2306861956.type", "WINDOWS_CONTAINER"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSCodeBuildProject_ARMContainer(t *testing.T) { + var project codebuild.Project + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_codebuild_project.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCodeBuild(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSCodeBuildProjectDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSCodeBuildProjectConfig_ARMContainer(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSCodeBuildProjectExists(resourceName, &project), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -1622,10 +1865,15 @@ func TestAccAWSCodeBuildProject_SecondarySources_CodeCommit(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAWSCodeBuildProjectExists(resourceName, &project), resource.TestCheckResourceAttr(resourceName, "source.3715340088.type", "CODECOMMIT"), - resource.TestCheckResourceAttr(resourceName, "secondary_sources.3525046785.source_identifier", "secondarySource1"), - resource.TestCheckResourceAttr(resourceName, "secondary_sources.2644986630.source_identifier", "secondarySource2"), + resource.TestCheckResourceAttr(resourceName, "secondary_sources.493771744.source_identifier", "secondarySource1"), + resource.TestCheckResourceAttr(resourceName, "secondary_sources.1385902896.source_identifier", "secondarySource2"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -1848,8 +2096,8 @@ POLICY func testAccAWSCodeBuildProjectConfig_basic(rName string) string { return testAccAWSCodeBuildProjectConfig_Base_ServiceRole(rName) + fmt.Sprintf(` resource "aws_codebuild_project" "test" { - name = "%s" - service_role = "${aws_iam_role.test.arn}" + name = "%s" + service_role = "${aws_iam_role.test.arn}" artifacts { type = "NO_ARTIFACTS" @@ -1919,6 +2167,31 @@ resource "aws_codebuild_project" "test" { `, buildTimeout, rName) } +func testAccAWSCodeBuildProjectConfig_QueuedTimeout(rName string, queuedTimeout int) string { + return testAccAWSCodeBuildProjectConfig_Base_ServiceRole(rName) + fmt.Sprintf(` +resource "aws_codebuild_project" "test" { + queued_timeout = %d + name = "%s" + service_role = "${aws_iam_role.test.arn}" + + artifacts { + type = "NO_ARTIFACTS" + } + + environment { + compute_type = "BUILD_GENERAL1_SMALL" + image = "2" + type = "LINUX_CONTAINER" + } + + source { + type = "GITHUB" + location = "https://github.com/hashicorp/packer.git" + } +} +`, queuedTimeout, rName) +} + func testAccAWSCodeBuildProjectConfig_Cache(rName, cacheLocation, cacheType string) string { return testAccAWSCodeBuildProjectConfig_Base_ServiceRole(rName) + fmt.Sprintf(` resource "aws_codebuild_project" "test" { @@ -2002,6 +2275,31 @@ resource "aws_codebuild_project" "test" { `, description, rName) } +func testAccAWSCodeBuildProjectConfig_SourceVersion(rName, sourceVersion string) string { + return testAccAWSCodeBuildProjectConfig_Base_ServiceRole(rName) + fmt.Sprintf(` +resource "aws_codebuild_project" "test" { + name = "%s" + service_role = "${aws_iam_role.test.arn}" + + artifacts { + type = "NO_ARTIFACTS" + } + + environment { + compute_type = "BUILD_GENERAL1_SMALL" + image = "2" + type = "LINUX_CONTAINER" + } + + source_version = "%s" + source { + type = "GITHUB" + location = "https://github.com/hashicorp/packer.git" + } +} +`, rName, sourceVersion) +} + func testAccAWSCodeBuildProjectConfig_EncryptionKey(rName string) string { return testAccAWSCodeBuildProjectConfig_Base_ServiceRole(rName) + fmt.Sprintf(` resource "aws_kms_key" "test" { @@ -2285,7 +2583,7 @@ resource "aws_codebuild_project" "test" { location = "https://github.com/hashicorp/packer.git" type = "GITHUB" } - + logs_config { cloudwatch_logs { status = %q @@ -2317,7 +2615,7 @@ resource "aws_codebuild_project" "test" { location = "https://github.com/hashicorp/packer.git" type = "GITHUB" } - + logs_config { s3_logs { status = %q @@ -2383,6 +2681,82 @@ resource "aws_codebuild_project" "test" { `, rName, gitCloneDepth) } +func testAccAWSCodeBuildProjectConfig_Source_GitSubmodulesConfig(rName string, fetchSubmodules bool) string { + return testAccAWSCodeBuildProjectConfig_Base_ServiceRole(rName) + fmt.Sprintf(` +resource "aws_codebuild_project" "test" { + name = "%s" + service_role = "${aws_iam_role.test.arn}" + + artifacts { + type = "NO_ARTIFACTS" + } + + environment { + compute_type = "BUILD_GENERAL1_SMALL" + image = "2" + type = "LINUX_CONTAINER" + } + + source { + location = "https://git-codecommit.region-id.amazonaws.com/v1/repos/repo-name" + type = "CODECOMMIT" + + git_submodules_config { + fetch_submodules = %t + } + } +} +`, rName, fetchSubmodules) +} + +func testAccAWSCodeBuildProjectConfig_SecondarySources_GitSubmodulesConfig(rName string, fetchSubmodules bool) string { + return testAccAWSCodeBuildProjectConfig_Base_ServiceRole(rName) + fmt.Sprintf(` +resource "aws_codebuild_project" "test" { + name = "%[1]s" + service_role = "${aws_iam_role.test.arn}" + + artifacts { + type = "NO_ARTIFACTS" + } + + environment { + compute_type = "BUILD_GENERAL1_SMALL" + image = "2" + type = "LINUX_CONTAINER" + } + + source { + location = "https://git-codecommit.region-id.amazonaws.com/v1/repos/repo-name" + type = "CODECOMMIT" + + git_submodules_config { + fetch_submodules = %[2]t + } + } + + secondary_sources { + location = "https://git-codecommit.region-id.amazonaws.com/v1/repos/second-repo-name" + type = "CODECOMMIT" + source_identifier = "secondarySource1" + + git_submodules_config { + fetch_submodules = %[2]t + } + } + + secondary_sources { + location = "https://git-codecommit.region-id.amazonaws.com/v1/repos/third-repo-name" + type = "CODECOMMIT" + source_identifier = "secondarySource2" + + git_submodules_config { + fetch_submodules = %[2]t + } + } +} +`, rName, fetchSubmodules) +} + func testAccAWSCodeBuildProjectConfig_Source_InsecureSSL(rName string, insecureSSL bool) string { return testAccAWSCodeBuildProjectConfig_Base_ServiceRole(rName) + fmt.Sprintf(` resource "aws_codebuild_project" "test" { @@ -2802,6 +3176,30 @@ resource "aws_codebuild_project" "test" { `, rName, testAccAWSCodeBuildGitHubSourceLocationFromEnv()) } +func testAccAWSCodeBuildProjectConfig_ARMContainer(rName string) string { + return testAccAWSCodeBuildProjectConfig_Base_ServiceRole(rName) + fmt.Sprintf(` +resource "aws_codebuild_project" "test" { + name = "%s" + service_role = "${aws_iam_role.test.arn}" + + artifacts { + type = "NO_ARTIFACTS" + } + + environment { + compute_type = "BUILD_GENERAL1_LARGE" + image = "2" + type = "ARM_CONTAINER" + } + + source { + location = "%s" + type = "GITHUB" + } +} +`, rName, testAccAWSCodeBuildGitHubSourceLocationFromEnv()) +} + func testAccAWSCodebuildProjectConfig_Artifacts_ArtifactIdentifier(rName string, bName string, artifactIdentifier string) string { return testAccAWSCodeBuildProjectConfig_Base_ServiceRole(rName) + testAccAWSCodeBuildProjectConfig_Base_Bucket(bName) + fmt.Sprintf(` resource "aws_codebuild_project" "test" { diff --git a/aws/resource_aws_codecommit_repository.go b/aws/resource_aws_codecommit_repository.go index f3be55328bc..00f9379eac6 100644 --- a/aws/resource_aws_codecommit_repository.go +++ b/aws/resource_aws_codecommit_repository.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/service/codecommit" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsCodeCommitRepository() *schema.Resource { @@ -69,7 +70,7 @@ func resourceAwsCodeCommitRepositoryCreate(d *schema.ResourceData, meta interfac input := &codecommit.CreateRepositoryInput{ RepositoryName: aws.String(d.Get("repository_name").(string)), RepositoryDescription: aws.String(d.Get("description").(string)), - Tags: tagsFromMapCodeCommit(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().CodecommitTags(), } out, err := conn.CreateRepository(input) @@ -83,31 +84,38 @@ func resourceAwsCodeCommitRepositoryCreate(d *schema.ResourceData, meta interfac d.Set("clone_url_http", out.RepositoryMetadata.CloneUrlHttp) d.Set("clone_url_ssh", out.RepositoryMetadata.CloneUrlSsh) - return resourceAwsCodeCommitRepositoryUpdate(d, meta) + if _, ok := d.GetOk("default_branch"); ok { + if err := resourceAwsCodeCommitUpdateDefaultBranch(conn, d); err != nil { + return fmt.Errorf("error updating CodeCommit Repository (%s) default branch: %s", d.Id(), err) + } + } + + return resourceAwsCodeCommitRepositoryRead(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("default_branch") { + if err := resourceAwsCodeCommitUpdateDefaultBranch(conn, d); err != nil { + return fmt.Errorf("error updating CodeCommit Repository (%s) default branch: %s", d.Id(), err) } } if d.HasChange("description") { if err := resourceAwsCodeCommitUpdateDescription(conn, d); err != nil { - return err + return fmt.Errorf("error updating CodeCommit Repository (%s) description: %s", d.Id(), err) } } - if !d.IsNewResource() { - if err := setTagsCodeCommit(conn, d); err != nil { - return fmt.Errorf("error updating CodeCommit Repository tags for %s: %s", d.Id(), err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.CodecommitUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating CodeCommit Repository (%s) tags: %s", d.Get("arn").(string), err) } } + return resourceAwsCodeCommitRepositoryRead(d, meta) } @@ -142,14 +150,13 @@ func resourceAwsCodeCommitRepositoryRead(d *schema.ResourceData, meta interface{ } } - // List tags - tagList, err := conn.ListTagsForResource(&codecommit.ListTagsForResourceInput{ - ResourceArn: out.RepositoryMetadata.Arn, - }) + tags, err := keyvaluetags.CodecommitListTags(conn, d.Get("arn").(string)) + if err != nil { - return fmt.Errorf("error listing CodeCommit Repository tags for %s: %s", d.Id(), err) + return fmt.Errorf("error listing tags for CodeCommit Repository (%s): %s", d.Get("arn").(string), err) } - if err := d.Set("tags", tagsToMapCodeCommit(tagList.Tags)); err != nil { + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } diff --git a/aws/resource_aws_codecommit_repository_test.go b/aws/resource_aws_codecommit_repository_test.go index 6a8791d1bf5..074eb90fd1c 100644 --- a/aws/resource_aws_codecommit_repository_test.go +++ b/aws/resource_aws_codecommit_repository_test.go @@ -12,9 +12,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSCodeCommitRepository_importBasic(t *testing.T) { - resName := "aws_codecommit_repository.test" +func TestAccAWSCodeCommitRepository_basic(t *testing.T) { rInt := acctest.RandInt() + resourceName := "aws_codecommit_repository.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -23,9 +23,12 @@ func TestAccAWSCodeCommitRepository_importBasic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccCodeCommitRepository_basic(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckCodeCommitRepositoryExists("aws_codecommit_repository.test"), + ), }, { - ResourceName: resName, + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -33,25 +36,10 @@ func TestAccAWSCodeCommitRepository_importBasic(t *testing.T) { }) } -func TestAccAWSCodeCommitRepository_basic(t *testing.T) { - rInt := acctest.RandInt() - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckCodeCommitRepositoryDestroy, - Steps: []resource.TestStep{ - { - Config: testAccCodeCommitRepository_basic(rInt), - Check: resource.ComposeTestCheckFunc( - testAccCheckCodeCommitRepositoryExists("aws_codecommit_repository.test"), - ), - }, - }, - }) -} - func TestAccAWSCodeCommitRepository_withChanges(t *testing.T) { rInt := acctest.RandInt() + resourceName := "aws_codecommit_repository.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -65,6 +53,11 @@ func TestAccAWSCodeCommitRepository_withChanges(t *testing.T) { "aws_codecommit_repository.test", "description", "This is a test description"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccCodeCommitRepository_withChanges(rInt), Check: resource.ComposeTestCheckFunc( @@ -79,6 +72,8 @@ func TestAccAWSCodeCommitRepository_withChanges(t *testing.T) { func TestAccAWSCodeCommitRepository_create_default_branch(t *testing.T) { rInt := acctest.RandInt() + resourceName := "aws_codecommit_repository.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -92,12 +87,20 @@ func TestAccAWSCodeCommitRepository_create_default_branch(t *testing.T) { "aws_codecommit_repository.test", "default_branch", "master"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"default_branch"}, + }, }, }) } func TestAccAWSCodeCommitRepository_create_and_update_default_branch(t *testing.T) { rInt := acctest.RandInt() + resourceName := "aws_codecommit_repository.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -111,6 +114,11 @@ func TestAccAWSCodeCommitRepository_create_and_update_default_branch(t *testing. "aws_codecommit_repository.test", "default_branch"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccCodeCommitRepository_with_default_branch(rInt), Check: resource.ComposeTestCheckFunc( @@ -124,38 +132,43 @@ func TestAccAWSCodeCommitRepository_create_and_update_default_branch(t *testing. } func TestAccAWSCodeCommitRepository_tags(t *testing.T) { - rName := acctest.RandString(10) + resourceName := "aws_codecommit_repository.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_codecommit_repository.test_repository", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckCodeCommitRepositoryDestroy, Steps: []resource.TestStep{ { Config: testAccAWSCodeCommitRepositoryConfigTags1(rName, "key1", "value1"), Check: resource.ComposeTestCheckFunc( - testAccCheckCodeCommitRepositoryExists("aws_codecommit_repository.test_repository"), - resource.TestCheckResourceAttr("aws_codecommit_repository.test_repository", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_codecommit_repository.test_repository", "tags.key1", "value1"), + testAccCheckCodeCommitRepositoryExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCodeCommitRepositoryConfigTags2(rName, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeTestCheckFunc( - testAccCheckCodeCommitRepositoryExists("aws_codecommit_repository.test_repository"), - resource.TestCheckResourceAttr("aws_codecommit_repository.test_repository", "tags.%", "2"), - resource.TestCheckResourceAttr("aws_codecommit_repository.test_repository", "tags.key1", "value1updated"), - resource.TestCheckResourceAttr("aws_codecommit_repository.test_repository", "tags.key2", "value2"), + testAccCheckCodeCommitRepositoryExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, { Config: testAccAWSCodeCommitRepositoryConfigTags1(rName, "key2", "value2"), Check: resource.ComposeTestCheckFunc( - testAccCheckCodeCommitRepositoryExists("aws_codecommit_repository.test_repository"), - resource.TestCheckResourceAttr("aws_codecommit_repository.test_repository", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_codecommit_repository.test_repository", "tags.key2", "value2"), + testAccCheckCodeCommitRepositoryExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, }, @@ -249,7 +262,7 @@ resource "aws_codecommit_repository" "test" { func testAccAWSCodeCommitRepositoryConfigTags1(r, tag1Key, tag1Value string) string { return fmt.Sprintf(` -resource "aws_codecommit_repository" "test_repository" { +resource "aws_codecommit_repository" "test" { repository_name = "terraform-test-%s" tags = { %q = %q @@ -259,7 +272,7 @@ resource "aws_codecommit_repository" "test_repository" { func testAccAWSCodeCommitRepositoryConfigTags2(r, tag1Key, tag1Value, tag2Key, tag2Value string) string { return fmt.Sprintf(` -resource "aws_codecommit_repository" "test_repository" { +resource "aws_codecommit_repository" "test" { repository_name = "terraform-test-%s" tags = { %q = %q diff --git a/aws/resource_aws_codedeploy_deployment_group.go b/aws/resource_aws_codedeploy_deployment_group.go index 7e12fc6113d..82a2c0f270b 100644 --- a/aws/resource_aws_codedeploy_deployment_group.go +++ b/aws/resource_aws_codedeploy_deployment_group.go @@ -4,7 +4,6 @@ import ( "bytes" "fmt" "log" - "regexp" "sort" "strings" "time" @@ -76,15 +75,16 @@ func resourceAwsCodeDeployDeploymentGroup() *schema.Resource { }, "deployment_style": { - Type: schema.TypeList, - Optional: true, - Computed: true, - MaxItems: 1, + Type: schema.TypeList, + Optional: true, + DiffSuppressFunc: suppressMissingOptionalConfigurationBlock, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "deployment_option": { Type: schema.TypeString, Optional: true, + Default: codedeploy.DeploymentOptionWithoutTrafficControl, ValidateFunc: validation.StringInSlice([]string{ codedeploy.DeploymentOptionWithTrafficControl, codedeploy.DeploymentOptionWithoutTrafficControl, @@ -93,6 +93,7 @@ func resourceAwsCodeDeployDeploymentGroup() *schema.Resource { "deployment_type": { Type: schema.TypeString, Optional: true, + Default: codedeploy.DeploymentTypeInPlace, ValidateFunc: validation.StringInSlice([]string{ codedeploy.DeploymentTypeInPlace, codedeploy.DeploymentTypeBlueGreen, @@ -211,7 +212,6 @@ func resourceAwsCodeDeployDeploymentGroup() *schema.Resource { "load_balancer_info": { Type: schema.TypeList, Optional: true, - Computed: true, MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -552,7 +552,20 @@ func resourceAwsCodeDeployDeploymentGroupCreate(d *schema.ResourceData, meta int var err error err = resource.Retry(5*time.Minute, func() *resource.RetryError { resp, err = conn.CreateDeploymentGroup(&input) - return handleCreateError(err) + + if isAWSErr(err, codedeploy.ErrCodeInvalidRoleException, "") { + return resource.RetryableError(err) + } + + if isAWSErr(err, codedeploy.ErrCodeInvalidTriggerConfigException, "Topic ARN") { + return resource.RetryableError(err) + } + + if err != nil { + return resource.NonRetryableError(err) + } + + return nil }) if isResourceTimeoutError(err) { @@ -732,7 +745,20 @@ func resourceAwsCodeDeployDeploymentGroupUpdate(d *schema.ResourceData, meta int var err error err = resource.Retry(5*time.Minute, func() *resource.RetryError { _, err = conn.UpdateDeploymentGroup(&input) - return handleUpdateError(err) + + if isAWSErr(err, codedeploy.ErrCodeInvalidRoleException, "") { + return resource.RetryableError(err) + } + + if isAWSErr(err, codedeploy.ErrCodeInvalidTriggerConfigException, "Topic ARN") { + return resource.RetryableError(err) + } + + if err != nil { + return resource.NonRetryableError(err) + } + + return nil }) if isResourceTimeoutError(err) { @@ -757,44 +783,6 @@ func resourceAwsCodeDeployDeploymentGroupDelete(d *schema.ResourceData, meta int return err } -func handleCreateError(err error) *resource.RetryError { - return handleCodeDeployApiError(err, "create") -} - -func handleUpdateError(err error) *resource.RetryError { - return handleCodeDeployApiError(err, "update") -} - -func handleCodeDeployApiError(err error, operation string) *resource.RetryError { - if err == nil { - return 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 %s DeploymentGroup again: %q", operation, codedeployErr.Message()) - return resource.RetryableError(err) - } - - return resource.NonRetryableError(err) -} - // buildOnPremTagFilters converts raw schema lists into a list of // codedeploy.TagFilters. func buildOnPremTagFilters(configured []interface{}) []*codedeploy.TagFilter { @@ -1030,14 +1018,14 @@ func expandDeploymentStyle(list []interface{}) *codedeploy.DeploymentStyle { } // expandLoadBalancerInfo converts a raw schema list containing a map[string]interface{} -// into a single codedeploy.LoadBalancerInfo object +// into a single codedeploy.LoadBalancerInfo object. Returns an empty object if list is nil. func expandLoadBalancerInfo(list []interface{}) *codedeploy.LoadBalancerInfo { + loadBalancerInfo := &codedeploy.LoadBalancerInfo{} if len(list) == 0 || list[0] == nil { - return nil + return loadBalancerInfo } lbInfo := list[0].(map[string]interface{}) - loadBalancerInfo := &codedeploy.LoadBalancerInfo{} if attr, ok := lbInfo["elb_info"]; ok && attr.(*schema.Set).Len() > 0 { loadBalancerInfo.ElbInfoList = expandCodeDeployElbInfo(attr.(*schema.Set).List()) diff --git a/aws/resource_aws_codedeploy_deployment_group_test.go b/aws/resource_aws_codedeploy_deployment_group_test.go index 53b07ebb1c0..251b1cf1b53 100644 --- a/aws/resource_aws_codedeploy_deployment_group_test.go +++ b/aws/resource_aws_codedeploy_deployment_group_test.go @@ -1,7 +1,6 @@ package aws import ( - "errors" "fmt" "reflect" "regexp" @@ -31,73 +30,76 @@ func TestAccAWSCodeDeployDeploymentGroup_basic(t *testing.T) { { Config: testAccAWSCodeDeployDeploymentGroup(rName, false), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "app_name", "foo_app_"+rName), + "aws_codedeploy_deployment_group.test", "app_name", "tf-acc-test-"+rName), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "deployment_group_name", "foo_"+rName), + "aws_codedeploy_deployment_group.test", "deployment_group_name", "tf-acc-test-"+rName), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "deployment_config_name", "CodeDeployDefault.OneAtATime"), + "aws_codedeploy_deployment_group.test", "deployment_config_name", "CodeDeployDefault.OneAtATime"), resource.TestMatchResourceAttr( - "aws_codedeploy_deployment_group.foo", "service_role_arn", - regexp.MustCompile("arn:aws:iam::[0-9]{12}:role/foo_role_.*")), + "aws_codedeploy_deployment_group.test", "service_role_arn", + regexp.MustCompile("arn:aws:iam::[0-9]{12}:role/tf-acc-test-.*")), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_set.#", "0"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.#", "0"), + + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "ec2_tag_set.#", "0"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_filter.#", "1"), + "aws_codedeploy_deployment_group.test", "ec2_tag_filter.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_filter.2916377465.key", "filterkey"), + "aws_codedeploy_deployment_group.test", "ec2_tag_filter.2916377465.key", "filterkey"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_filter.2916377465.type", "KEY_AND_VALUE"), + "aws_codedeploy_deployment_group.test", "ec2_tag_filter.2916377465.type", "KEY_AND_VALUE"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_filter.2916377465.value", "filtervalue"), + "aws_codedeploy_deployment_group.test", "ec2_tag_filter.2916377465.value", "filtervalue"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "alarm_configuration.#", "0"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.#", "0"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "auto_rollback_configuration.#", "0"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.#", "0"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "trigger_configuration.#", "0"), + "aws_codedeploy_deployment_group.test", "trigger_configuration.#", "0"), ), }, { Config: testAccAWSCodeDeployDeploymentGroupModified(rName, false), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "app_name", "foo_app_"+rName), + "aws_codedeploy_deployment_group.test", "app_name", "tf-acc-test-"+rName), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "deployment_group_name", "bar_"+rName), + "aws_codedeploy_deployment_group.test", "deployment_group_name", "tf-acc-test-updated-"+rName), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "deployment_config_name", "CodeDeployDefault.OneAtATime"), + "aws_codedeploy_deployment_group.test", "deployment_config_name", "CodeDeployDefault.OneAtATime"), resource.TestMatchResourceAttr( - "aws_codedeploy_deployment_group.foo", "service_role_arn", - regexp.MustCompile("arn:aws:iam::[0-9]{12}:role/bar_role_.*")), + "aws_codedeploy_deployment_group.test", "service_role_arn", + regexp.MustCompile("arn:aws:iam::[0-9]{12}:role/tf-acc-test-updated-.*")), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_set.#", "0"), + "aws_codedeploy_deployment_group.test", "ec2_tag_set.#", "0"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_filter.#", "1"), + "aws_codedeploy_deployment_group.test", "ec2_tag_filter.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_filter.2369538975.key", "filterkey"), + "aws_codedeploy_deployment_group.test", "ec2_tag_filter.2369538975.key", "filterkey"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_filter.2369538975.type", "KEY_AND_VALUE"), + "aws_codedeploy_deployment_group.test", "ec2_tag_filter.2369538975.type", "KEY_AND_VALUE"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_filter.2369538975.value", "anotherfiltervalue"), + "aws_codedeploy_deployment_group.test", "ec2_tag_filter.2369538975.value", "anotherfiltervalue"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "alarm_configuration.#", "0"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.#", "0"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "auto_rollback_configuration.#", "0"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.#", "0"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "trigger_configuration.#", "0"), + "aws_codedeploy_deployment_group.test", "trigger_configuration.#", "0"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -117,77 +119,77 @@ func TestAccAWSCodeDeployDeploymentGroup_basic_tagSet(t *testing.T) { { Config: testAccAWSCodeDeployDeploymentGroup(rName, true), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "app_name", "foo_app_"+rName), + "aws_codedeploy_deployment_group.test", "app_name", "tf-acc-test-"+rName), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "deployment_group_name", "foo_"+rName), + "aws_codedeploy_deployment_group.test", "deployment_group_name", "tf-acc-test-"+rName), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "deployment_config_name", "CodeDeployDefault.OneAtATime"), + "aws_codedeploy_deployment_group.test", "deployment_config_name", "CodeDeployDefault.OneAtATime"), resource.TestMatchResourceAttr( - "aws_codedeploy_deployment_group.foo", "service_role_arn", - regexp.MustCompile("arn:aws:iam::[0-9]{12}:role/foo_role_.*")), + "aws_codedeploy_deployment_group.test", "service_role_arn", + regexp.MustCompile("arn:aws:iam::[0-9]{12}:role/tf-acc-test-.*")), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_set.#", "1"), + "aws_codedeploy_deployment_group.test", "ec2_tag_set.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_set.2916377593.ec2_tag_filter.#", "1"), + "aws_codedeploy_deployment_group.test", "ec2_tag_set.2916377593.ec2_tag_filter.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_set.2916377593.ec2_tag_filter.2916377465.key", "filterkey"), + "aws_codedeploy_deployment_group.test", "ec2_tag_set.2916377593.ec2_tag_filter.2916377465.key", "filterkey"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_set.2916377593.ec2_tag_filter.2916377465.type", "KEY_AND_VALUE"), + "aws_codedeploy_deployment_group.test", "ec2_tag_set.2916377593.ec2_tag_filter.2916377465.type", "KEY_AND_VALUE"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_set.2916377593.ec2_tag_filter.2916377465.value", "filtervalue"), + "aws_codedeploy_deployment_group.test", "ec2_tag_set.2916377593.ec2_tag_filter.2916377465.value", "filtervalue"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_filter.#", "0"), + "aws_codedeploy_deployment_group.test", "ec2_tag_filter.#", "0"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "alarm_configuration.#", "0"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.#", "0"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "auto_rollback_configuration.#", "0"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.#", "0"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "trigger_configuration.#", "0"), + "aws_codedeploy_deployment_group.test", "trigger_configuration.#", "0"), ), }, { Config: testAccAWSCodeDeployDeploymentGroupModified(rName, true), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "app_name", "foo_app_"+rName), + "aws_codedeploy_deployment_group.test", "app_name", "tf-acc-test-"+rName), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "deployment_group_name", "bar_"+rName), + "aws_codedeploy_deployment_group.test", "deployment_group_name", "tf-acc-test-updated-"+rName), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "deployment_config_name", "CodeDeployDefault.OneAtATime"), + "aws_codedeploy_deployment_group.test", "deployment_config_name", "CodeDeployDefault.OneAtATime"), resource.TestMatchResourceAttr( - "aws_codedeploy_deployment_group.foo", "service_role_arn", - regexp.MustCompile("arn:aws:iam::[0-9]{12}:role/bar_role_.*")), + "aws_codedeploy_deployment_group.test", "service_role_arn", + regexp.MustCompile("arn:aws:iam::[0-9]{12}:role/tf-acc-test-updated-.*")), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_set.#", "1"), + "aws_codedeploy_deployment_group.test", "ec2_tag_set.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_set.2369538847.ec2_tag_filter.#", "1"), + "aws_codedeploy_deployment_group.test", "ec2_tag_set.2369538847.ec2_tag_filter.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_set.2369538847.ec2_tag_filter.2369538975.key", "filterkey"), + "aws_codedeploy_deployment_group.test", "ec2_tag_set.2369538847.ec2_tag_filter.2369538975.key", "filterkey"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_set.2369538847.ec2_tag_filter.2369538975.type", "KEY_AND_VALUE"), + "aws_codedeploy_deployment_group.test", "ec2_tag_set.2369538847.ec2_tag_filter.2369538975.type", "KEY_AND_VALUE"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_set.2369538847.ec2_tag_filter.2369538975.value", "anotherfiltervalue"), + "aws_codedeploy_deployment_group.test", "ec2_tag_set.2369538847.ec2_tag_filter.2369538975.value", "anotherfiltervalue"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "ec2_tag_filter.#", "0"), + "aws_codedeploy_deployment_group.test", "ec2_tag_filter.#", "0"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "alarm_configuration.#", "0"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.#", "0"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "auto_rollback_configuration.#", "0"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.#", "0"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "trigger_configuration.#", "0"), + "aws_codedeploy_deployment_group.test", "trigger_configuration.#", "0"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -207,28 +209,28 @@ func TestAccAWSCodeDeployDeploymentGroup_onPremiseTag(t *testing.T) { { Config: testAccAWSCodeDeployDeploymentGroupOnPremiseTags(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "app_name", "foo_app_"+rName), + "aws_codedeploy_deployment_group.test", "app_name", "tf-acc-test-"+rName), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "deployment_group_name", "foo_"+rName), + "aws_codedeploy_deployment_group.test", "deployment_group_name", "tf-acc-test-"+rName), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "deployment_config_name", "CodeDeployDefault.OneAtATime"), + "aws_codedeploy_deployment_group.test", "deployment_config_name", "CodeDeployDefault.OneAtATime"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "on_premises_instance_tag_filter.#", "1"), + "aws_codedeploy_deployment_group.test", "on_premises_instance_tag_filter.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "on_premises_instance_tag_filter.2916377465.key", "filterkey"), + "aws_codedeploy_deployment_group.test", "on_premises_instance_tag_filter.2916377465.key", "filterkey"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "on_premises_instance_tag_filter.2916377465.type", "KEY_AND_VALUE"), + "aws_codedeploy_deployment_group.test", "on_premises_instance_tag_filter.2916377465.type", "KEY_AND_VALUE"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo", "on_premises_instance_tag_filter.2916377465.value", "filtervalue"), + "aws_codedeploy_deployment_group.test", "on_premises_instance_tag_filter.2916377465.value", "filtervalue"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -247,7 +249,7 @@ func TestAccAWSCodeDeployDeploymentGroup_disappears(t *testing.T) { { Config: testAccAWSCodeDeployDeploymentGroup(rName, false), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), testAccAWSCodeDeployDeploymentGroupDisappears(&group), ), ExpectNonEmptyPlan: true, @@ -269,12 +271,12 @@ func TestAccAWSCodeDeployDeploymentGroup_triggerConfiguration_basic(t *testing.T { Config: testAccAWSCodeDeployDeploymentGroup_triggerConfiguration_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "app_name", "foo-app-"+rName), + "aws_codedeploy_deployment_group.test", "app_name", "tf-acc-test-"+rName), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_group_name", "foo-group-"+rName), - testAccCheckTriggerEvents(&group, "foo-trigger", []string{ + "aws_codedeploy_deployment_group.test", "deployment_group_name", "tf-acc-test-"+rName), + testAccCheckCodeDeployDeploymentGroupTriggerEvents(&group, "test-trigger", []string{ "DeploymentFailure", }), ), @@ -282,21 +284,21 @@ func TestAccAWSCodeDeployDeploymentGroup_triggerConfiguration_basic(t *testing.T { Config: testAccAWSCodeDeployDeploymentGroup_triggerConfiguration_update(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "app_name", "foo-app-"+rName), + "aws_codedeploy_deployment_group.test", "app_name", "tf-acc-test-"+rName), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_group_name", "foo-group-"+rName), - testAccCheckTriggerEvents(&group, "foo-trigger", []string{ + "aws_codedeploy_deployment_group.test", "deployment_group_name", "tf-acc-test-"+rName), + testAccCheckCodeDeployDeploymentGroupTriggerEvents(&group, "test-trigger", []string{ "DeploymentFailure", "DeploymentSuccess", }), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -316,46 +318,46 @@ func TestAccAWSCodeDeployDeploymentGroup_triggerConfiguration_multiple(t *testin { Config: testAccAWSCodeDeployDeploymentGroup_triggerConfiguration_createMultiple(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "app_name", "foo-app-"+rName), + "aws_codedeploy_deployment_group.test", "app_name", "tf-acc-test-"+rName), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_group_name", "foo-group-"+rName), - testAccCheckTriggerEvents(&group, "foo-trigger", []string{ + "aws_codedeploy_deployment_group.test", "deployment_group_name", "tf-acc-test-"+rName), + testAccCheckCodeDeployDeploymentGroupTriggerEvents(&group, "test-trigger-1", []string{ "DeploymentFailure", }), - testAccCheckTriggerEvents(&group, "bar-trigger", []string{ + testAccCheckCodeDeployDeploymentGroupTriggerEvents(&group, "test-trigger-2", []string{ "InstanceFailure", }), - testAccCheckTriggerTargetArn(&group, "bar-trigger", - regexp.MustCompile("^arn:aws:sns:[^:]+:[0-9]{12}:bar-topic-"+rName+"$")), + testAccCheckCodeDeployDeploymentGroupTriggerTargetArn(&group, "test-trigger-2", + regexp.MustCompile("^arn:aws:sns:[^:]+:[0-9]{12}:tf-acc-test-2-"+rName+"$")), ), }, { Config: testAccAWSCodeDeployDeploymentGroup_triggerConfiguration_updateMultiple(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "app_name", "foo-app-"+rName), + "aws_codedeploy_deployment_group.test", "app_name", "tf-acc-test-"+rName), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_group_name", "foo-group-"+rName), - testAccCheckTriggerEvents(&group, "foo-trigger", []string{ + "aws_codedeploy_deployment_group.test", "deployment_group_name", "tf-acc-test-"+rName), + testAccCheckCodeDeployDeploymentGroupTriggerEvents(&group, "test-trigger-1", []string{ "DeploymentFailure", "DeploymentStart", "DeploymentStop", "DeploymentSuccess", }), - testAccCheckTriggerEvents(&group, "bar-trigger", []string{ + testAccCheckCodeDeployDeploymentGroupTriggerEvents(&group, "test-trigger-2", []string{ "InstanceFailure", }), - testAccCheckTriggerTargetArn(&group, "bar-trigger", - regexp.MustCompile("^arn:aws:sns:[^:]+:[0-9]{12}:baz-topic-"+rName+"$")), + testAccCheckCodeDeployDeploymentGroupTriggerTargetArn(&group, "test-trigger-2", + regexp.MustCompile("^arn:aws:sns:[^:]+:[0-9]{12}:tf-acc-test-3-"+rName+"$")), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -372,32 +374,24 @@ func TestAccAWSCodeDeployDeploymentGroup_autoRollbackConfiguration_create(t *tes Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ - { - Config: test_config_auto_rollback_configuration_delete(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), - resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.#", "0"), - ), - }, { Config: test_config_auto_rollback_configuration_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.#", "1"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.enabled", "true"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.enabled", "true"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.events.#", "1"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.events.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.events.135881253", "DEPLOYMENT_FAILURE"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.events.135881253", "DEPLOYMENT_FAILURE"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -417,37 +411,37 @@ func TestAccAWSCodeDeployDeploymentGroup_autoRollbackConfiguration_update(t *tes { Config: test_config_auto_rollback_configuration_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.#", "1"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.enabled", "true"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.enabled", "true"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.events.#", "1"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.events.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.events.135881253", "DEPLOYMENT_FAILURE"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.events.135881253", "DEPLOYMENT_FAILURE"), ), }, { Config: test_config_auto_rollback_configuration_update(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.#", "1"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.enabled", "true"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.enabled", "true"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.events.#", "2"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.events.#", "2"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.events.104943466", "DEPLOYMENT_STOP_ON_ALARM"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.events.104943466", "DEPLOYMENT_STOP_ON_ALARM"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.events.135881253", "DEPLOYMENT_FAILURE"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.events.135881253", "DEPLOYMENT_FAILURE"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -467,29 +461,29 @@ func TestAccAWSCodeDeployDeploymentGroup_autoRollbackConfiguration_delete(t *tes { Config: test_config_auto_rollback_configuration_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.#", "1"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.enabled", "true"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.enabled", "true"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.events.#", "1"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.events.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.events.135881253", "DEPLOYMENT_FAILURE"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.events.135881253", "DEPLOYMENT_FAILURE"), ), }, { - Config: test_config_auto_rollback_configuration_delete(rName), + Config: test_config_auto_rollback_configuration_none(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.#", "0"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.#", "0"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -509,35 +503,35 @@ func TestAccAWSCodeDeployDeploymentGroup_autoRollbackConfiguration_disable(t *te { Config: test_config_auto_rollback_configuration_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.#", "1"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.enabled", "true"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.enabled", "true"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.events.#", "1"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.events.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.events.135881253", "DEPLOYMENT_FAILURE"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.events.135881253", "DEPLOYMENT_FAILURE"), ), }, { Config: test_config_auto_rollback_configuration_disable(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.#", "1"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.enabled", "false"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.enabled", "false"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.events.#", "1"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.events.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "auto_rollback_configuration.0.events.135881253", "DEPLOYMENT_FAILURE"), + "aws_codedeploy_deployment_group.test", "auto_rollback_configuration.0.events.135881253", "DEPLOYMENT_FAILURE"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -554,34 +548,26 @@ func TestAccAWSCodeDeployDeploymentGroup_alarmConfiguration_create(t *testing.T) Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ - { - Config: test_config_alarm_configuration_delete(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), - resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.#", "0"), - ), - }, { Config: test_config_alarm_configuration_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.#", "1"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.enabled", "true"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.enabled", "true"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.alarms.#", "1"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.alarms.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.alarms.2356372769", "foo"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.alarms.967527452", "test-alarm"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.ignore_poll_alarm_failure", "false"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.ignore_poll_alarm_failure", "false"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -601,41 +587,41 @@ func TestAccAWSCodeDeployDeploymentGroup_alarmConfiguration_update(t *testing.T) { Config: test_config_alarm_configuration_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.#", "1"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.enabled", "true"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.enabled", "true"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.alarms.#", "1"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.alarms.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.alarms.2356372769", "foo"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.alarms.967527452", "test-alarm"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.ignore_poll_alarm_failure", "false"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.ignore_poll_alarm_failure", "false"), ), }, { Config: test_config_alarm_configuration_update(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.#", "1"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.enabled", "true"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.enabled", "true"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.alarms.#", "2"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.alarms.#", "2"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.alarms.1996459178", "bar"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.alarms.967527452", "test-alarm"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.alarms.2356372769", "foo"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.alarms.809070813", "test-alarm-2"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.ignore_poll_alarm_failure", "true"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.ignore_poll_alarm_failure", "true"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -655,31 +641,31 @@ func TestAccAWSCodeDeployDeploymentGroup_alarmConfiguration_delete(t *testing.T) { Config: test_config_alarm_configuration_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.#", "1"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.enabled", "true"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.enabled", "true"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.alarms.#", "1"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.alarms.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.alarms.2356372769", "foo"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.alarms.967527452", "test-alarm"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.ignore_poll_alarm_failure", "false"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.ignore_poll_alarm_failure", "false"), ), }, { - Config: test_config_alarm_configuration_delete(rName), + Config: test_config_alarm_configuration_none(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.#", "0"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.#", "0"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -699,39 +685,39 @@ func TestAccAWSCodeDeployDeploymentGroup_alarmConfiguration_disable(t *testing.T { Config: test_config_alarm_configuration_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.#", "1"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.enabled", "true"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.enabled", "true"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.alarms.#", "1"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.alarms.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.alarms.2356372769", "foo"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.alarms.967527452", "test-alarm"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.ignore_poll_alarm_failure", "false"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.ignore_poll_alarm_failure", "false"), ), }, { Config: test_config_alarm_configuration_disable(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.#", "1"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.enabled", "false"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.enabled", "false"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.alarms.#", "1"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.alarms.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.alarms.2356372769", "foo"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.alarms.967527452", "test-alarm"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "alarm_configuration.0.ignore_poll_alarm_failure", "false"), + "aws_codedeploy_deployment_group.test", "alarm_configuration.0.ignore_poll_alarm_failure", "false"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -752,19 +738,19 @@ func TestAccAWSCodeDeployDeploymentGroup_deploymentStyle_default(t *testing.T) { { Config: test_config_deployment_style_default(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.#", "1"), + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), resource.TestCheckResourceAttrSet( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_option"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_option"), resource.TestCheckResourceAttrSet( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_type"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -781,41 +767,29 @@ func TestAccAWSCodeDeployDeploymentGroup_deploymentStyle_create(t *testing.T) { Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ - { - Config: test_config_deployment_style_default(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), - resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.#", "1"), - resource.TestCheckResourceAttrSet( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_option"), - resource.TestCheckResourceAttrSet( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_type"), - ), - }, { Config: test_config_deployment_style_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.#", "1"), + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_type", "BLUE_GREEN"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type", "BLUE_GREEN"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.2441772102.name", "foo-elb"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.6632477.name", "acc-test-codedeploy-dep-group"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -835,39 +809,38 @@ func TestAccAWSCodeDeployDeploymentGroup_deploymentStyle_update(t *testing.T) { { Config: test_config_deployment_style_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.#", "1"), + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_type", "BLUE_GREEN"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type", "BLUE_GREEN"), ), }, { Config: test_config_deployment_style_update(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.#", "1"), + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_option", "WITHOUT_TRAFFIC_CONTROL"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_option", "WITHOUT_TRAFFIC_CONTROL"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_type", "IN_PLACE"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type", "IN_PLACE"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, }) } -// Removing deployment_style from configuration does not trigger an update -// to the default state, but the previous state is instead retained... +// Delete reverts to default configuration. It does not remove the deployment_style block func TestAccAWSCodeDeployDeploymentGroup_deploymentStyle_delete(t *testing.T) { var group codedeploy.DeploymentGroupInfo @@ -881,31 +854,31 @@ func TestAccAWSCodeDeployDeploymentGroup_deploymentStyle_delete(t *testing.T) { { Config: test_config_deployment_style_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.#", "1"), + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_type", "BLUE_GREEN"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type", "BLUE_GREEN"), ), }, { Config: test_config_deployment_style_default(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.#", "1"), - resource.TestCheckResourceAttrSet( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_option"), - resource.TestCheckResourceAttrSet( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_type"), + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_option", "WITHOUT_TRAFFIC_CONTROL"), + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type", "IN_PLACE"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -922,30 +895,22 @@ func TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_create(t *testing.T) { Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ - { - Config: test_config_load_balancer_info_default(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), - resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "0"), - ), - }, { Config: test_config_load_balancer_info_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.2441772102.name", "foo-elb"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.6632477.name", "acc-test-codedeploy-dep-group"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -965,39 +930,37 @@ func TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_update(t *testing.T) { { Config: test_config_load_balancer_info_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.2441772102.name", "foo-elb"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.6632477.name", "acc-test-codedeploy-dep-group"), ), }, { Config: test_config_load_balancer_info_update(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.4206303396.name", "bar-elb"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.934183479.name", "acc-test-codedeploy-dep-group-2"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, }) } -// Without "Computed: true" on load_balancer_info, removing the resource -// from configuration causes an error, because the remote resource still exists. func TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_delete(t *testing.T) { var group codedeploy.DeploymentGroupInfo @@ -1011,27 +974,27 @@ func TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_delete(t *testing.T) { { Config: test_config_load_balancer_info_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.2441772102.name", "foo-elb"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.6632477.name", "acc-test-codedeploy-dep-group"), ), }, { - Config: test_config_load_balancer_info_delete(rName), + Config: test_config_load_balancer_info_none(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "0"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -1048,31 +1011,23 @@ func TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_targetGroupInfo_create Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ - { - Config: test_config_load_balancer_info_default(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), - resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "0"), - ), - }, { Config: test_config_load_balancer_info_target_group_info_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.target_group_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.target_group_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.target_group_info.4178177480.name", "foo-tg"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.target_group_info.6632477.name", "acc-test-codedeploy-dep-group"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -1092,31 +1047,31 @@ func TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_targetGroupInfo_update { Config: test_config_load_balancer_info_target_group_info_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.target_group_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.target_group_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.target_group_info.4178177480.name", "foo-tg"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.target_group_info.6632477.name", "acc-test-codedeploy-dep-group"), ), }, { Config: test_config_load_balancer_info_target_group_info_update(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.target_group_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.target_group_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.target_group_info.2940009368.name", "bar-tg"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.target_group_info.934183479.name", "acc-test-codedeploy-dep-group-2"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -1136,34 +1091,34 @@ func TestAccAWSCodeDeployDeploymentGroup_loadBalancerInfo_targetGroupInfo_delete { Config: test_config_load_balancer_info_target_group_info_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.target_group_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.target_group_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.target_group_info.4178177480.name", "foo-tg"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.target_group_info.6632477.name", "acc-test-codedeploy-dep-group"), ), }, { Config: test_config_load_balancer_info_target_group_info_delete(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "0"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, }) } -func TestAccAWSCodeDeployDeploymentGroup_in_place_deployment_with_traffic_control_create(t *testing.T) { +func TestAccAWSCodeDeployDeploymentGroup_inPlaceDeploymentWithTrafficControl_create(t *testing.T) { var group codedeploy.DeploymentGroupInfo rName := acctest.RandString(5) @@ -1173,50 +1128,36 @@ func TestAccAWSCodeDeployDeploymentGroup_in_place_deployment_with_traffic_contro Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ - { - Config: test_config_deployment_style_default(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), - resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.#", "1"), - resource.TestCheckResourceAttrSet( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_option"), - resource.TestCheckResourceAttrSet( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_type"), - resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "0"), - ), - }, { Config: test_config_in_place_deployment_with_traffic_control_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.#", "1"), + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_type", "IN_PLACE"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type", "IN_PLACE"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.2441772102.name", "foo-elb"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.6632477.name", "acc-test-codedeploy-dep-group"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, }) } -func TestAccAWSCodeDeployDeploymentGroup_in_place_deployment_with_traffic_control_update(t *testing.T) { +func TestAccAWSCodeDeployDeploymentGroup_inPlaceDeploymentWithTrafficControl_update(t *testing.T) { var group codedeploy.DeploymentGroupInfo rName := acctest.RandString(5) @@ -1229,60 +1170,60 @@ func TestAccAWSCodeDeployDeploymentGroup_in_place_deployment_with_traffic_contro { Config: test_config_in_place_deployment_with_traffic_control_create(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.#", "1"), + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_type", "IN_PLACE"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type", "IN_PLACE"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.2441772102.name", "foo-elb"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.6632477.name", "acc-test-codedeploy-dep-group"), ), }, { Config: test_config_in_place_deployment_with_traffic_control_update(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.#", "1"), + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_type", "BLUE_GREEN"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type", "BLUE_GREEN"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.2441772102.name", "foo-elb"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.6632477.name", "acc-test-codedeploy-dep-group"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "CONTINUE_DEPLOYMENT"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "CONTINUE_DEPLOYMENT"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "DISCOVER_EXISTING"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "DISCOVER_EXISTING"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "KEEP_ALIVE"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "KEEP_ALIVE"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -1299,45 +1240,44 @@ func TestAccAWSCodeDeployDeploymentGroup_blueGreenDeploymentConfiguration_create Providers: testAccProviders, CheckDestroy: testAccCheckAWSCodeDeployDeploymentGroupDestroy, Steps: []resource.TestStep{ - { - Config: test_config_blue_green_deployment_config_default(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), - resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.#", "0"), - ), - }, { Config: test_config_blue_green_deployment_config_create_with_asg(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.#", "1"), + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type", "BLUE_GREEN"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.#", "1"), + resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "STOP_DEPLOYMENT"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.0.wait_time_in_minutes", "60"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "STOP_DEPLOYMENT"), + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.0.wait_time_in_minutes", "60"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "COPY_AUTO_SCALING_GROUP"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "COPY_AUTO_SCALING_GROUP"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "TERMINATE"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "TERMINATE"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.termination_wait_time_in_minutes", "120"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.termination_wait_time_in_minutes", "120"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -1357,53 +1297,53 @@ func TestAccAWSCodeDeployDeploymentGroup_blueGreenDeploymentConfiguration_update { Config: test_config_blue_green_deployment_config_create_with_asg(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "STOP_DEPLOYMENT"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "STOP_DEPLOYMENT"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.0.wait_time_in_minutes", "60"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.0.wait_time_in_minutes", "60"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "COPY_AUTO_SCALING_GROUP"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "COPY_AUTO_SCALING_GROUP"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "TERMINATE"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "TERMINATE"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.termination_wait_time_in_minutes", "120"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.termination_wait_time_in_minutes", "120"), ), }, { Config: test_config_blue_green_deployment_config_update_with_asg(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "STOP_DEPLOYMENT"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "STOP_DEPLOYMENT"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.0.wait_time_in_minutes", "60"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.0.wait_time_in_minutes", "60"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "COPY_AUTO_SCALING_GROUP"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "COPY_AUTO_SCALING_GROUP"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "KEEP_ALIVE"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "KEEP_ALIVE"), ), }, }, @@ -1423,51 +1363,65 @@ func TestAccAWSCodeDeployDeploymentGroup_blueGreenDeploymentConfiguration_update { Config: test_config_blue_green_deployment_config_create_no_asg(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.#", "1"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type", "BLUE_GREEN"), + + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "STOP_DEPLOYMENT"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "STOP_DEPLOYMENT"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.0.wait_time_in_minutes", "60"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.0.wait_time_in_minutes", "60"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "DISCOVER_EXISTING"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "DISCOVER_EXISTING"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "TERMINATE"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "TERMINATE"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.termination_wait_time_in_minutes", "120"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.termination_wait_time_in_minutes", "120"), ), }, { Config: test_config_blue_green_deployment_config_update_no_asg(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.#", "1"), + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type", "BLUE_GREEN"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.#", "1"), + resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "CONTINUE_DEPLOYMENT"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "CONTINUE_DEPLOYMENT"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "DISCOVER_EXISTING"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "DISCOVER_EXISTING"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "KEEP_ALIVE"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "KEEP_ALIVE"), ), }, }, @@ -1489,42 +1443,53 @@ func TestAccAWSCodeDeployDeploymentGroup_blueGreenDeploymentConfiguration_delete { Config: test_config_blue_green_deployment_config_create_no_asg(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.#", "1"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type", "BLUE_GREEN"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.#", "1"), + resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "STOP_DEPLOYMENT"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.0.wait_time_in_minutes", "60"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "STOP_DEPLOYMENT"), + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.0.wait_time_in_minutes", "60"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "DISCOVER_EXISTING"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "DISCOVER_EXISTING"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "TERMINATE"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "TERMINATE"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.termination_wait_time_in_minutes", "120"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.termination_wait_time_in_minutes", "120"), ), }, { - Config: test_config_blue_green_deployment_config_default(rName), + Config: test_config_blue_green_deployment_config_delete(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.#", "1"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type", "IN_PLACE"), + + // The state is preserved, but AWS ignores it + resource.TestCheckResourceAttr( + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.#", "1"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -1544,89 +1509,89 @@ func TestAccAWSCodeDeployDeploymentGroup_blueGreenDeployment_complete(t *testing { Config: test_config_blue_green_deployment_complete(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.#", "1"), + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_type", "BLUE_GREEN"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type", "BLUE_GREEN"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.2441772102.name", "foo-elb"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.6632477.name", "acc-test-codedeploy-dep-group"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "STOP_DEPLOYMENT"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "STOP_DEPLOYMENT"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.0.wait_time_in_minutes", "60"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.0.wait_time_in_minutes", "60"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "DISCOVER_EXISTING"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "DISCOVER_EXISTING"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "KEEP_ALIVE"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "KEEP_ALIVE"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.termination_wait_time_in_minutes", "0"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.termination_wait_time_in_minutes", "0"), ), }, { Config: test_config_blue_green_deployment_complete_updated(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.foo_group", &group), + testAccCheckAWSCodeDeployDeploymentGroupExists("aws_codedeploy_deployment_group.test", &group), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.#", "1"), + "aws_codedeploy_deployment_group.test", "deployment_style.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_option", "WITH_TRAFFIC_CONTROL"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "deployment_style.0.deployment_type", "BLUE_GREEN"), + "aws_codedeploy_deployment_group.test", "deployment_style.0.deployment_type", "BLUE_GREEN"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.#", "1"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "load_balancer_info.0.elb_info.2441772102.name", "foo-elb"), + "aws_codedeploy_deployment_group.test", "load_balancer_info.0.elb_info.6632477.name", "acc-test-codedeploy-dep-group"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "CONTINUE_DEPLOYMENT"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.deployment_ready_option.0.action_on_timeout", "CONTINUE_DEPLOYMENT"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "DISCOVER_EXISTING"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.green_fleet_provisioning_option.0.action", "DISCOVER_EXISTING"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.#", "1"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "KEEP_ALIVE"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.action", "KEEP_ALIVE"), resource.TestCheckResourceAttr( - "aws_codedeploy_deployment_group.foo_group", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.termination_wait_time_in_minutes", "0"), + "aws_codedeploy_deployment_group.test", "blue_green_deployment_config.0.terminate_blue_instances_on_deployment_success.0.termination_wait_time_in_minutes", "0"), ), }, { - ResourceName: "aws_codedeploy_deployment_group.foo_group", + ResourceName: "aws_codedeploy_deployment_group.test", ImportState: true, - ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.foo_group"), + ImportStateIdFunc: testAccAWSCodeDeployDeploymentGroupImportStateIdFunc("aws_codedeploy_deployment_group.test"), ImportStateVerify: true, }, }, @@ -1680,8 +1645,8 @@ func TestAWSCodeDeployDeploymentGroup_buildTriggerConfigs(t *testing.T) { "trigger_events": schema.NewSet(schema.HashString, []interface{}{ "DeploymentFailure", }), - "trigger_name": "foo-trigger", - "trigger_target_arn": "arn:aws:sns:us-west-2:123456789012:foo-topic", + "trigger_name": "test-trigger", + "trigger_target_arn": "arn:aws:sns:us-west-2:123456789012:test-topic", }, } @@ -1690,8 +1655,8 @@ func TestAWSCodeDeployDeploymentGroup_buildTriggerConfigs(t *testing.T) { TriggerEvents: []*string{ aws.String("DeploymentFailure"), }, - TriggerName: aws.String("foo-trigger"), - TriggerTargetArn: aws.String("arn:aws:sns:us-west-2:123456789012:foo-topic"), + TriggerName: aws.String("test-trigger"), + TriggerTargetArn: aws.String("arn:aws:sns:us-west-2:123456789012:test-topic"), }, } @@ -1710,8 +1675,8 @@ func TestAWSCodeDeployDeploymentGroup_triggerConfigsToMap(t *testing.T) { aws.String("DeploymentFailure"), aws.String("InstanceFailure"), }, - TriggerName: aws.String("bar-trigger"), - TriggerTargetArn: aws.String("arn:aws:sns:us-west-2:123456789012:bar-topic"), + TriggerName: aws.String("test-trigger-2"), + TriggerTargetArn: aws.String("arn:aws:sns:us-west-2:123456789012:test-topic-2"), }, } @@ -1720,8 +1685,8 @@ func TestAWSCodeDeployDeploymentGroup_triggerConfigsToMap(t *testing.T) { "DeploymentFailure", "InstanceFailure", }), - "trigger_name": "bar-trigger", - "trigger_target_arn": "arn:aws:sns:us-west-2:123456789012:bar-topic", + "trigger_name": "test-trigger-2", + "trigger_target_arn": "arn:aws:sns:us-west-2:123456789012:test-topic-2", } actual := triggerConfigsToMap(input)[0] @@ -1861,35 +1826,46 @@ func TestAWSCodeDeployDeploymentGroup_flattenDeploymentStyle(t *testing.T) { } func TestAWSCodeDeployDeploymentGroup_expandLoadBalancerInfo(t *testing.T) { - input := []interface{}{ - map[string]interface{}{ - "elb_info": schema.NewSet(loadBalancerInfoHash, []interface{}{ - map[string]interface{}{ - "name": "foo-elb", - }, + testCases := []struct { + Input []interface{} + Expected *codedeploy.LoadBalancerInfo + }{ + { + Input: nil, + Expected: &codedeploy.LoadBalancerInfo{}, + }, + { + Input: []interface{}{ map[string]interface{}{ - "name": "bar-elb", + "elb_info": schema.NewSet(loadBalancerInfoHash, []interface{}{ + map[string]interface{}{ + "name": "acc-test-codedeploy-dep-group", + }, + map[string]interface{}{ + "name": "acc-test-codedeploy-dep-group-2", + }, + }), }, - }), - }, - } - - expected := &codedeploy.LoadBalancerInfo{ - ElbInfoList: []*codedeploy.ELBInfo{ - { - Name: aws.String("foo-elb"), }, - { - Name: aws.String("bar-elb"), + Expected: &codedeploy.LoadBalancerInfo{ + ElbInfoList: []*codedeploy.ELBInfo{ + { + Name: aws.String("acc-test-codedeploy-dep-group"), + }, + { + Name: aws.String("acc-test-codedeploy-dep-group-2"), + }, + }, }, }, } - actual := expandLoadBalancerInfo(input) - - if !reflect.DeepEqual(actual, expected) { - t.Fatalf("expandLoadBalancerInfo output is not correct.\nGot:\n%#v\nExpected:\n%#v\n", - actual, expected) + for _, tc := range testCases { + actual := expandLoadBalancerInfo(tc.Input) + if !reflect.DeepEqual(actual, tc.Expected) { + t.Fatalf("expandLoadBalancerInfo output is not correct.\nGot:\n%#v\nExpected:\n%#v\n", + actual, tc.Expected) + } } } @@ -2057,7 +2033,7 @@ func TestAWSCodeDeployDeploymentGroup_buildAlarmConfig(t *testing.T) { input := []interface{}{ map[string]interface{}{ "alarms": schema.NewSet(schema.HashString, []interface{}{ - "foo-alarm", + "test-alarm", }), "enabled": true, "ignore_poll_alarm_failure": false, @@ -2067,7 +2043,7 @@ func TestAWSCodeDeployDeploymentGroup_buildAlarmConfig(t *testing.T) { expected := &codedeploy.AlarmConfiguration{ Alarms: []*codedeploy.Alarm{ { - Name: aws.String("foo-alarm"), + Name: aws.String("test-alarm"), }, }, Enabled: aws.Bool(true), @@ -2086,10 +2062,10 @@ func TestAWSCodeDeployDeploymentGroup_alarmConfigToMap(t *testing.T) { input := &codedeploy.AlarmConfiguration{ Alarms: []*codedeploy.Alarm{ { - Name: aws.String("bar-alarm"), + Name: aws.String("test-alarm-2"), }, { - Name: aws.String("foo-alarm"), + Name: aws.String("test-alarm"), }, }, Enabled: aws.Bool(false), @@ -2098,8 +2074,8 @@ func TestAWSCodeDeployDeploymentGroup_alarmConfigToMap(t *testing.T) { expected := map[string]interface{}{ "alarms": schema.NewSet(schema.HashString, []interface{}{ - "bar-alarm", - "foo-alarm", + "test-alarm-2", + "test-alarm", }), "enabled": false, "ignore_poll_alarm_failure": true, @@ -2129,11 +2105,13 @@ func TestAWSCodeDeployDeploymentGroup_alarmConfigToMap(t *testing.T) { } } -func testAccCheckTriggerEvents(group *codedeploy.DeploymentGroupInfo, triggerName string, expectedEvents []string) resource.TestCheckFunc { +func testAccCheckCodeDeployDeploymentGroupTriggerEvents(group *codedeploy.DeploymentGroupInfo, triggerName string, expectedEvents []string) resource.TestCheckFunc { return func(s *terraform.State) error { + found := false for _, actual := range group.TriggerConfigurations { if *actual.TriggerName == triggerName { + found = true numberOfEvents := len(actual.TriggerEvents) if numberOfEvents != len(expectedEvents) { @@ -2154,14 +2132,20 @@ func testAccCheckTriggerEvents(group *codedeploy.DeploymentGroupInfo, triggerNam break } } - return nil + if found { + return nil + } else { + return fmt.Errorf("trigger configuration %q not found", triggerName) + } } } -func testAccCheckTriggerTargetArn(group *codedeploy.DeploymentGroupInfo, triggerName string, r *regexp.Regexp) resource.TestCheckFunc { +func testAccCheckCodeDeployDeploymentGroupTriggerTargetArn(group *codedeploy.DeploymentGroupInfo, triggerName string, r *regexp.Regexp) resource.TestCheckFunc { return func(s *terraform.State) error { + found := false for _, actual := range group.TriggerConfigurations { if *actual.TriggerName == triggerName { + found = true if !r.MatchString(*actual.TriggerTargetArn) { return fmt.Errorf("Trigger target arn does not match regular expression.\nRegex: %v\nTriggerTargetArn: %v\n", r, *actual.TriggerTargetArn) @@ -2169,7 +2153,11 @@ func testAccCheckTriggerTargetArn(group *codedeploy.DeploymentGroupInfo, trigger break } } - return nil + if found { + return nil + } else { + return fmt.Errorf("trigger configuration %q not found", triggerName) + } } } @@ -2256,52 +2244,6 @@ func testAccCheckAWSCodeDeployDeploymentGroupExists(name string, group *codedepl } } -func TestAWSCodeDeployDeploymentGroup_handleCodeDeployApiError(t *testing.T) { - notAnAwsError := errors.New("Not an awserr") - invalidRoleException := awserr.New("InvalidRoleException", "Invalid role exception", nil) - invalidTriggerConfigExceptionNoMatch := awserr.New("InvalidTriggerConfigException", "Some other error message", nil) - invalidTriggerConfigExceptionMatch := awserr.New("InvalidTriggerConfigException", "Topic ARN foo is not valid", nil) - fakeAwsError := awserr.New("FakeAwsException", "Not a real AWS error", nil) - - testCases := []struct { - Input error - Expected *resource.RetryError - }{ - { - Input: nil, - Expected: nil, - }, - { - Input: notAnAwsError, - Expected: resource.NonRetryableError(notAnAwsError), - }, - { - Input: invalidRoleException, - Expected: resource.RetryableError(invalidRoleException), - }, - { - Input: invalidTriggerConfigExceptionNoMatch, - Expected: resource.NonRetryableError(invalidTriggerConfigExceptionNoMatch), - }, - { - Input: invalidTriggerConfigExceptionMatch, - Expected: resource.RetryableError(invalidTriggerConfigExceptionMatch), - }, - { - Input: fakeAwsError, - Expected: resource.NonRetryableError(fakeAwsError), - }, - } - - for _, tc := range testCases { - actual := handleCodeDeployApiError(tc.Input, "test") - if !reflect.DeepEqual(actual, tc.Expected) { - t.Fatalf(`handleCodeDeployApiError output is not correct. Expected: %v, Actual: %v.`, - tc.Expected, actual) - } - } -} - func testAccAWSCodeDeployDeploymentGroupImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { rs, ok := s.RootModule().Resources[resourceName] @@ -2318,29 +2260,36 @@ func testAccAWSCodeDeployDeploymentGroup(rName string, tagGroup bool) string { if tagGroup { tagGroupOrFilter = `ec2_tag_set { ec2_tag_filter { - key = "filterkey" - type = "KEY_AND_VALUE" + key = "filterkey" + type = "KEY_AND_VALUE" value = "filtervalue" } } ` } else { tagGroupOrFilter = `ec2_tag_filter { - key = "filterkey" - type = "KEY_AND_VALUE" + key = "filterkey" + type = "KEY_AND_VALUE" value = "filtervalue" } ` } return fmt.Sprintf(` -resource "aws_codedeploy_app" "foo_app" { - name = "foo_app_%s" +resource "aws_codedeploy_deployment_group" "test" { + app_name = aws_codedeploy_app.test.name + deployment_group_name = "tf-acc-test-%[1]s" + service_role_arn = aws_iam_role.test.arn + %[2]s } -resource "aws_iam_role_policy" "foo_policy" { - name = "foo_policy_%s" - role = "${aws_iam_role.foo_role.id}" +resource "aws_codedeploy_app" "test" { + name = "tf-acc-test-%[1]s" +} + +resource "aws_iam_role_policy" "test" { + name = "tf-acc-test-%[1]s" + role = aws_iam_role.test.id policy = < 0 { + return fmt.Errorf("codestar notification target (%s) is not removed", rs.Primary.ID) + } + } + } + + return nil +} + +func testAccAWSCodeStarNotificationsNotificationRuleConfigBase(rName string) string { + return fmt.Sprintf(` +resource "aws_codecommit_repository" "test" { + repository_name = %[1]q +} + +resource "aws_sns_topic" "test" { + name = %[1]q +} +`, rName) +} + +func testAccAWSCodeStarNotificationsNotificationRuleConfigBasic(rName string) string { + return testAccAWSCodeStarNotificationsNotificationRuleConfigBase(rName) + fmt.Sprintf(` +resource "aws_codestarnotifications_notification_rule" "test" { + detail_type = "BASIC" + event_type_ids = ["codecommit-repository-comments-on-commits"] + name = %[1]q + resource = aws_codecommit_repository.test.arn + status = "ENABLED" + + tags = { + TestTag = "123456" + } + + target { + address = aws_sns_topic.test.arn + } +} +`, rName) +} + +func testAccAWSCodeStarNotificationsNotificationRuleConfigStatus(rName, status string) string { + return testAccAWSCodeStarNotificationsNotificationRuleConfigBase(rName) + fmt.Sprintf(` +resource "aws_codestarnotifications_notification_rule" "test" { + detail_type = "BASIC" + event_type_ids = ["codecommit-repository-comments-on-commits"] + name = %[1]q + resource = aws_codecommit_repository.test.arn + status = %[2]q + + target { + address = aws_sns_topic.test.arn + } +} +`, rName, status) +} + +func testAccAWSCodeStarNotificationsNotificationRuleConfigTargets1(rName string) string { + return testAccAWSCodeStarNotificationsNotificationRuleConfigBase(rName) + fmt.Sprintf(` +resource "aws_codestarnotifications_notification_rule" "test" { + detail_type = "BASIC" + event_type_ids = ["codecommit-repository-comments-on-commits"] + name = %[1]q + resource = aws_codecommit_repository.test.arn + + target { + address = aws_sns_topic.test.arn + } +} +`, rName) +} + +func testAccAWSCodeStarNotificationsNotificationRuleConfigTargets2(rName string) string { + return testAccAWSCodeStarNotificationsNotificationRuleConfigBase(rName) + fmt.Sprintf(` +resource "aws_sns_topic" "test2" { + name = "%[1]s2" +} + +resource "aws_codestarnotifications_notification_rule" "test" { + detail_type = "BASIC" + event_type_ids = ["codecommit-repository-comments-on-commits"] + name = %[1]q + resource = aws_codecommit_repository.test.arn + + target { + address = aws_sns_topic.test.arn + } + + target { + address = aws_sns_topic.test2.arn + } +} +`, rName) +} + +func testAccAWSCodeStarNotificationsNotificationRuleConfigTags1(rName string) string { + return testAccAWSCodeStarNotificationsNotificationRuleConfigBase(rName) + fmt.Sprintf(` +resource "aws_codestarnotifications_notification_rule" "test" { + detail_type = "BASIC" + event_type_ids = ["codecommit-repository-comments-on-commits"] + name = %[1]q + resource = aws_codecommit_repository.test.arn + status = "ENABLED" + + tags = { + TestTag1 = "123456" + TestTag2 = "654321" + } + + target { + address = aws_sns_topic.test.arn + } +} +`, rName) +} + +func testAccAWSCodeStarNotificationsNotificationRuleConfigTags2(rName string) string { + return testAccAWSCodeStarNotificationsNotificationRuleConfigBase(rName) + fmt.Sprintf(` +resource "aws_codestarnotifications_notification_rule" "test" { + detail_type = "BASIC" + event_type_ids = ["codecommit-repository-comments-on-commits"] + name = %[1]q + resource = aws_codecommit_repository.test.arn + status = "ENABLED" + + tags = { + TestTag2 = "654321" + TestTag3 = "asdfgh" + } + + target { + address = aws_sns_topic.test.arn + } +} +`, rName) +} + +func testAccAWSCodeStarNotificationsNotificationRuleConfigEventTypeIds1(rName string) string { + return testAccAWSCodeStarNotificationsNotificationRuleConfigBase(rName) + fmt.Sprintf(` +resource "aws_codestarnotifications_notification_rule" "test" { + detail_type = "BASIC" + event_type_ids = [ + "codecommit-repository-comments-on-commits", + ] + name = %[1]q + resource = aws_codecommit_repository.test.arn + status = "ENABLED" + + target { + address = aws_sns_topic.test.arn + } +} +`, rName) +} + +func testAccAWSCodeStarNotificationsNotificationRuleConfigEventTypeIds2(rName string) string { + return testAccAWSCodeStarNotificationsNotificationRuleConfigBase(rName) + fmt.Sprintf(` +resource "aws_codestarnotifications_notification_rule" "test" { + detail_type = "BASIC" + event_type_ids = [ + "codecommit-repository-comments-on-commits", + "codecommit-repository-pull-request-created", + ] + name = %[1]q + resource = aws_codecommit_repository.test.arn + status = "ENABLED" + + target { + address = aws_sns_topic.test.arn + } +} +`, rName) +} + +func testAccAWSCodeStarNotificationsNotificationRuleConfigEventTypeIds3(rName string) string { + return testAccAWSCodeStarNotificationsNotificationRuleConfigBase(rName) + fmt.Sprintf(` +resource "aws_codestarnotifications_notification_rule" "test" { + detail_type = "BASIC" + event_type_ids = [ + "codecommit-repository-pull-request-created", + ] + name = %[1]q + resource = aws_codecommit_repository.test.arn + status = "ENABLED" + + target { + address = aws_sns_topic.test.arn + } +} +`, rName) +} diff --git a/aws/resource_aws_cognito_identity_pool.go b/aws/resource_aws_cognito_identity_pool.go index 728785fe439..d3ba64534c5 100644 --- a/aws/resource_aws_cognito_identity_pool.go +++ b/aws/resource_aws_cognito_identity_pool.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/cognitoidentity" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsCognitoIdentityPool() *schema.Resource { @@ -133,7 +134,7 @@ func resourceAwsCognitoIdentityPoolCreate(d *schema.ResourceData, meta interface } if v, ok := d.GetOk("tags"); ok { - params.IdentityPoolTags = tagsFromMapGeneric(v.(map[string]interface{})) + params.IdentityPoolTags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().CognitoidentityTags() } entity, err := conn.CreateIdentityPool(params) @@ -154,7 +155,7 @@ func resourceAwsCognitoIdentityPoolRead(d *schema.ResourceData, meta interface{} IdentityPoolId: aws.String(d.Id()), }) if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceNotFoundException" { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == cognitoidentity.ErrCodeResourceNotFoundException { d.SetId("") return nil } @@ -172,8 +173,8 @@ func resourceAwsCognitoIdentityPoolRead(d *schema.ResourceData, meta interface{} d.Set("identity_pool_name", ip.IdentityPoolName) d.Set("allow_unauthenticated_identities", ip.AllowUnauthenticatedIdentities) d.Set("developer_provider_name", ip.DeveloperProviderName) - if err := d.Set("tags", tagsToMapGeneric(ip.IdentityPoolTags)); err != nil { - return fmt.Errorf("Error setting tags: %s", err) + if err := d.Set("tags", keyvaluetags.CognitoidentityKeyValueTags(ip.IdentityPoolTags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } if err := d.Set("cognito_identity_providers", flattenCognitoIdentityProviders(ip.CognitoIdentityProviders)); err != nil { @@ -232,8 +233,13 @@ func resourceAwsCognitoIdentityPoolUpdate(d *schema.ResourceData, meta interface return fmt.Errorf("Error updating Cognito Identity Pool: %s", err) } - if err := setTagsCognito(conn, d); err != nil { - return err + arn := d.Get("arn").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.CognitoidentityUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating Cognito Identity Pool (%s) tags: %s", arn, err) + } } return resourceAwsCognitoIdentityPoolRead(d, meta) diff --git a/aws/resource_aws_cognito_identity_pool_test.go b/aws/resource_aws_cognito_identity_pool_test.go index ca598b2e99b..d06a4a8442f 100644 --- a/aws/resource_aws_cognito_identity_pool_test.go +++ b/aws/resource_aws_cognito_identity_pool_test.go @@ -14,31 +14,10 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSCognitoIdentityPool_importBasic(t *testing.T) { - resourceName := "aws_cognito_identity_pool.main" - rName := acctest.RandString(10) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSAPIGatewayAccountDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSCognitoIdentityPoolConfig_basic(rName), - }, - - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func TestAccAWSCognitoIdentityPool_basic(t *testing.T) { name := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) updatedName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + resourceName := "aws_cognito_identity_pool.main" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, @@ -48,18 +27,22 @@ func TestAccAWSCognitoIdentityPool_basic(t *testing.T) { { Config: testAccAWSCognitoIdentityPoolConfig_basic(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), - resource.TestMatchResourceAttr("aws_cognito_identity_pool.main", "arn", - regexp.MustCompile("^arn:aws:cognito-identity:[^:]+:[0-9]{12}:identitypool/[^:]+:([0-9a-f]){8}-([0-9a-f]){4}-([0-9a-f]){4}-([0-9a-f]){4}-([0-9a-f]){12}$")), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "allow_unauthenticated_identities", "false"), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "cognito-identity", regexp.MustCompile(`identitypool/.+`)), + resource.TestCheckResourceAttr(resourceName, "allow_unauthenticated_identities", "false"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoIdentityPoolConfig_basic(updatedName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", updatedName)), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", updatedName)), ), }, }, @@ -68,6 +51,7 @@ func TestAccAWSCognitoIdentityPool_basic(t *testing.T) { func TestAccAWSCognitoIdentityPool_supportedLoginProviders(t *testing.T) { name := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + resourceName := "aws_cognito_identity_pool.main" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, @@ -77,25 +61,30 @@ func TestAccAWSCognitoIdentityPool_supportedLoginProviders(t *testing.T) { { Config: testAccAWSCognitoIdentityPoolConfig_supportedLoginProviders(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "supported_login_providers.graph.facebook.com", "7346241598935555"), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + resource.TestCheckResourceAttr(resourceName, "supported_login_providers.graph.facebook.com", "7346241598935555"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoIdentityPoolConfig_supportedLoginProvidersModified(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "supported_login_providers.graph.facebook.com", "7346241598935552"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "supported_login_providers.accounts.google.com", "123456789012.apps.googleusercontent.com"), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + resource.TestCheckResourceAttr(resourceName, "supported_login_providers.graph.facebook.com", "7346241598935552"), + resource.TestCheckResourceAttr(resourceName, "supported_login_providers.accounts.google.com", "123456789012.apps.googleusercontent.com"), ), }, { Config: testAccAWSCognitoIdentityPoolConfig_basic(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), ), }, }, @@ -104,6 +93,7 @@ func TestAccAWSCognitoIdentityPool_supportedLoginProviders(t *testing.T) { func TestAccAWSCognitoIdentityPool_openidConnectProviderArns(t *testing.T) { name := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + resourceName := "aws_cognito_identity_pool.main" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, @@ -113,24 +103,29 @@ func TestAccAWSCognitoIdentityPool_openidConnectProviderArns(t *testing.T) { { Config: testAccAWSCognitoIdentityPoolConfig_openidConnectProviderArns(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "openid_connect_provider_arns.#", "1"), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + resource.TestCheckResourceAttr(resourceName, "openid_connect_provider_arns.#", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoIdentityPoolConfig_openidConnectProviderArnsModified(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "openid_connect_provider_arns.#", "2"), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + resource.TestCheckResourceAttr(resourceName, "openid_connect_provider_arns.#", "2"), ), }, { Config: testAccAWSCognitoIdentityPoolConfig_basic(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), ), }, }, @@ -139,6 +134,7 @@ func TestAccAWSCognitoIdentityPool_openidConnectProviderArns(t *testing.T) { func TestAccAWSCognitoIdentityPool_samlProviderArns(t *testing.T) { name := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + resourceName := "aws_cognito_identity_pool.main" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, @@ -148,25 +144,30 @@ func TestAccAWSCognitoIdentityPool_samlProviderArns(t *testing.T) { { Config: testAccAWSCognitoIdentityPoolConfig_samlProviderArns(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "saml_provider_arns.#", "1"), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + resource.TestCheckResourceAttr(resourceName, "saml_provider_arns.#", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoIdentityPoolConfig_samlProviderArnsModified(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "saml_provider_arns.#", "1"), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + resource.TestCheckResourceAttr(resourceName, "saml_provider_arns.#", "1"), ), }, { Config: testAccAWSCognitoIdentityPoolConfig_basic(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "saml_provider_arns.#", "0"), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + resource.TestCheckResourceAttr(resourceName, "saml_provider_arns.#", "0"), ), }, }, @@ -175,6 +176,7 @@ func TestAccAWSCognitoIdentityPool_samlProviderArns(t *testing.T) { func TestAccAWSCognitoIdentityPool_cognitoIdentityProviders(t *testing.T) { name := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + resourceName := "aws_cognito_identity_pool.main" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, @@ -184,31 +186,36 @@ func TestAccAWSCognitoIdentityPool_cognitoIdentityProviders(t *testing.T) { { Config: testAccAWSCognitoIdentityPoolConfig_cognitoIdentityProviders(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "cognito_identity_providers.66456389.client_id", "7lhlkkfbfb4q5kpp90urffao"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "cognito_identity_providers.66456389.provider_name", "cognito-idp.us-east-1.amazonaws.com/us-east-1_Zr231apJu"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "cognito_identity_providers.66456389.server_side_token_check", "false"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "cognito_identity_providers.3571192419.client_id", "7lhlkkfbfb4q5kpp90urffao"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "cognito_identity_providers.3571192419.provider_name", "cognito-idp.us-east-1.amazonaws.com/us-east-1_Ab129faBb"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "cognito_identity_providers.3571192419.server_side_token_check", "false"), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + resource.TestCheckResourceAttr(resourceName, "cognito_identity_providers.66456389.client_id", "7lhlkkfbfb4q5kpp90urffao"), + resource.TestCheckResourceAttr(resourceName, "cognito_identity_providers.66456389.provider_name", "cognito-idp.us-east-1.amazonaws.com/us-east-1_Zr231apJu"), + resource.TestCheckResourceAttr(resourceName, "cognito_identity_providers.66456389.server_side_token_check", "false"), + resource.TestCheckResourceAttr(resourceName, "cognito_identity_providers.3571192419.client_id", "7lhlkkfbfb4q5kpp90urffao"), + resource.TestCheckResourceAttr(resourceName, "cognito_identity_providers.3571192419.provider_name", "cognito-idp.us-east-1.amazonaws.com/us-east-1_Ab129faBb"), + resource.TestCheckResourceAttr(resourceName, "cognito_identity_providers.3571192419.server_side_token_check", "false"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoIdentityPoolConfig_cognitoIdentityProvidersModified(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "cognito_identity_providers.3661724441.client_id", "6lhlkkfbfb4q5kpp90urffae"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "cognito_identity_providers.3661724441.provider_name", "cognito-idp.us-east-1.amazonaws.com/us-east-1_Zr231apJu"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "cognito_identity_providers.3661724441.server_side_token_check", "false"), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + resource.TestCheckResourceAttr(resourceName, "cognito_identity_providers.3661724441.client_id", "6lhlkkfbfb4q5kpp90urffae"), + resource.TestCheckResourceAttr(resourceName, "cognito_identity_providers.3661724441.provider_name", "cognito-idp.us-east-1.amazonaws.com/us-east-1_Zr231apJu"), + resource.TestCheckResourceAttr(resourceName, "cognito_identity_providers.3661724441.server_side_token_check", "false"), ), }, { Config: testAccAWSCognitoIdentityPoolConfig_basic(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), ), }, }, @@ -217,6 +224,7 @@ func TestAccAWSCognitoIdentityPool_cognitoIdentityProviders(t *testing.T) { func TestAccAWSCognitoIdentityPool_addingNewProviderKeepsOldProvider(t *testing.T) { name := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + resourceName := "aws_cognito_identity_pool.main" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, @@ -226,35 +234,41 @@ func TestAccAWSCognitoIdentityPool_addingNewProviderKeepsOldProvider(t *testing. { Config: testAccAWSCognitoIdentityPoolConfig_cognitoIdentityProviders(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "cognito_identity_providers.#", "2"), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + resource.TestCheckResourceAttr(resourceName, "cognito_identity_providers.#", "2"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoIdentityPoolConfig_cognitoIdentityProvidersAndOpenidConnectProviderArns(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "cognito_identity_providers.#", "2"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "openid_connect_provider_arns.#", "1"), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + resource.TestCheckResourceAttr(resourceName, "cognito_identity_providers.#", "2"), + resource.TestCheckResourceAttr(resourceName, "openid_connect_provider_arns.#", "1"), ), }, { Config: testAccAWSCognitoIdentityPoolConfig_basic(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "identity_pool_name", fmt.Sprintf("identity pool %s", name)), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "cognito_identity_providers.#", "0"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "openid_connect_provider_arns.#", "0"), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "identity_pool_name", fmt.Sprintf("identity pool %s", name)), + resource.TestCheckResourceAttr(resourceName, "cognito_identity_providers.#", "0"), + resource.TestCheckResourceAttr(resourceName, "openid_connect_provider_arns.#", "0"), ), }, }, }) } -func TestAccAWSCognitoIdentityPoolWithTags(t *testing.T) { +func TestAccAWSCognitoIdentityPool_tags(t *testing.T) { name := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + resourceName := "aws_cognito_identity_pool.main" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentity(t) }, @@ -262,18 +276,33 @@ func TestAccAWSCognitoIdentityPoolWithTags(t *testing.T) { CheckDestroy: testAccCheckAWSCognitoIdentityPoolDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCognitoIdentityPoolConfigWithTags(name), + Config: testAccAWSCognitoIdentityPoolConfig_Tags1(name, "key1", "value1"), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "tags.environment", "dev"), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), }, { - Config: testAccAWSCognitoIdentityPoolConfigWithTagsUpdated(name), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSCognitoIdentityPoolConfig_Tags2(name, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoIdentityPoolExists("aws_cognito_identity_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "tags.environment", "dev"), - resource.TestCheckResourceAttr("aws_cognito_identity_pool.main", "tags.project", "Terraform"), + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSCognitoIdentityPoolConfig_Tags1(name, "key2", "value2"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSCognitoIdentityPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, }, @@ -314,7 +343,7 @@ func testAccCheckAWSCognitoIdentityPoolDestroy(s *terraform.State) error { }) if err != nil { - if wserr, ok := err.(awserr.Error); ok && wserr.Code() == "ResourceNotFoundException" { + if wserr, ok := err.(awserr.Error); ok && wserr.Code() == cognitoidentity.ErrCodeResourceNotFoundException { return nil } return err @@ -497,29 +526,29 @@ resource "aws_cognito_identity_pool" "main" { `, name) } -func testAccAWSCognitoIdentityPoolConfigWithTags(name string) string { +func testAccAWSCognitoIdentityPoolConfig_Tags1(name, tagKey1, tagValue1 string) string { return fmt.Sprintf(` resource "aws_cognito_identity_pool" "main" { - identity_pool_name = "identity pool %s" + identity_pool_name = %[1]q allow_unauthenticated_identities = false tags = { - "environment" = "dev" + %[2]q = %[3]q } } -`, name) +`, name, tagKey1, tagValue1) } -func testAccAWSCognitoIdentityPoolConfigWithTagsUpdated(name string) string { +func testAccAWSCognitoIdentityPoolConfig_Tags2(name, tagKey1, tagValue1, tagKey2, tagValue2 string) string { return fmt.Sprintf(` resource "aws_cognito_identity_pool" "main" { - identity_pool_name = "identity pool %s" + identity_pool_name = %[1]q allow_unauthenticated_identities = false tags = { - "environment" = "dev" - "project" = "Terraform" + %[2]q = %[3]q + %[4]q = %[5]q } } -`, name) +`, name, tagKey1, tagValue1, tagKey2, tagValue2) } diff --git a/aws/resource_aws_cognito_resource_server.go b/aws/resource_aws_cognito_resource_server.go index 861f7da9b63..7c5affedb2e 100644 --- a/aws/resource_aws_cognito_resource_server.go +++ b/aws/resource_aws_cognito_resource_server.go @@ -37,7 +37,7 @@ func resourceAwsCognitoResourceServer() *schema.Resource { "scope": { Type: schema.TypeSet, Optional: true, - MaxItems: 25, + MaxItems: 100, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "scope_description": { diff --git a/aws/resource_aws_cognito_user_group_test.go b/aws/resource_aws_cognito_user_group_test.go index 7b5df1e410f..41ebf62abcb 100644 --- a/aws/resource_aws_cognito_user_group_test.go +++ b/aws/resource_aws_cognito_user_group_test.go @@ -17,6 +17,7 @@ func TestAccAWSCognitoUserGroup_basic(t *testing.T) { poolName := fmt.Sprintf("tf-acc-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) groupName := fmt.Sprintf("tf-acc-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) updatedGroupName := fmt.Sprintf("tf-acc-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + resourceName := "aws_cognito_user_group.main" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -26,15 +27,20 @@ func TestAccAWSCognitoUserGroup_basic(t *testing.T) { { Config: testAccAWSCognitoUserGroupConfig_basic(poolName, groupName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserGroupExists("aws_cognito_user_group.main"), - resource.TestCheckResourceAttr("aws_cognito_user_group.main", "name", groupName), + testAccCheckAWSCognitoUserGroupExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", groupName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserGroupConfig_basic(poolName, updatedGroupName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserGroupExists("aws_cognito_user_group.main"), - resource.TestCheckResourceAttr("aws_cognito_user_group.main", "name", updatedGroupName), + testAccCheckAWSCognitoUserGroupExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", updatedGroupName), ), }, }, @@ -45,6 +51,7 @@ func TestAccAWSCognitoUserGroup_complex(t *testing.T) { poolName := fmt.Sprintf("tf-acc-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) groupName := fmt.Sprintf("tf-acc-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) updatedGroupName := fmt.Sprintf("tf-acc-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + resourceName := "aws_cognito_user_group.main" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -54,21 +61,26 @@ func TestAccAWSCognitoUserGroup_complex(t *testing.T) { { Config: testAccAWSCognitoUserGroupConfig_complex(poolName, groupName, "This is the user group description", 1), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserGroupExists("aws_cognito_user_group.main"), - resource.TestCheckResourceAttr("aws_cognito_user_group.main", "name", groupName), - resource.TestCheckResourceAttr("aws_cognito_user_group.main", "description", "This is the user group description"), - resource.TestCheckResourceAttr("aws_cognito_user_group.main", "precedence", "1"), - resource.TestCheckResourceAttrSet("aws_cognito_user_group.main", "role_arn"), + testAccCheckAWSCognitoUserGroupExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", groupName), + resource.TestCheckResourceAttr(resourceName, "description", "This is the user group description"), + resource.TestCheckResourceAttr(resourceName, "precedence", "1"), + resource.TestCheckResourceAttrSet(resourceName, "role_arn"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserGroupConfig_complex(poolName, updatedGroupName, "This is the updated user group description", 42), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserGroupExists("aws_cognito_user_group.main"), - resource.TestCheckResourceAttr("aws_cognito_user_group.main", "name", updatedGroupName), - resource.TestCheckResourceAttr("aws_cognito_user_group.main", "description", "This is the updated user group description"), - resource.TestCheckResourceAttr("aws_cognito_user_group.main", "precedence", "42"), - resource.TestCheckResourceAttrSet("aws_cognito_user_group.main", "role_arn"), + testAccCheckAWSCognitoUserGroupExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", updatedGroupName), + resource.TestCheckResourceAttr(resourceName, "description", "This is the updated user group description"), + resource.TestCheckResourceAttr(resourceName, "precedence", "42"), + resource.TestCheckResourceAttrSet(resourceName, "role_arn"), ), }, }, @@ -91,6 +103,11 @@ func TestAccAWSCognitoUserGroup_RoleArn(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "role_arn"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserGroupConfig_RoleArn_Updated(rName), Check: resource.ComposeAggregateTestCheckFunc( @@ -102,28 +119,6 @@ func TestAccAWSCognitoUserGroup_RoleArn(t *testing.T) { }) } -func TestAccAWSCognitoUserGroup_importBasic(t *testing.T) { - resourceName := "aws_cognito_user_group.main" - poolName := fmt.Sprintf("tf-acc-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) - groupName := fmt.Sprintf("tf-acc-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSCognitoUserGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSCognitoUserGroupConfig_basic(poolName, groupName), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func testAccCheckAWSCognitoUserGroupExists(name string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[name] diff --git a/aws/resource_aws_cognito_user_pool.go b/aws/resource_aws_cognito_user_pool.go index fca6ea1a4ba..474739f0803 100644 --- a/aws/resource_aws_cognito_user_pool.go +++ b/aws/resource_aws_cognito_user_pool.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsCognitoUserPool() *schema.Resource { @@ -64,10 +65,12 @@ func resourceAwsCognitoUserPool() *schema.Resource { }, }, "unused_account_validity_days": { - Type: schema.TypeInt, - Optional: true, - Default: 7, - ValidateFunc: validation.IntBetween(0, 90), + Type: schema.TypeInt, + Optional: true, + Computed: true, + Deprecated: "Use password_policy.temporary_password_validity_days instead", + ValidateFunc: validation.IntBetween(0, 90), + ConflictsWith: []string{"password_policy.0.temporary_password_validity_days"}, }, }, }, @@ -294,6 +297,12 @@ func resourceAwsCognitoUserPool() *schema.Resource { Type: schema.TypeBool, Optional: true, }, + "temporary_password_validity_days": { + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntBetween(0, 365), + ConflictsWith: []string{"admin_create_user_config.0.unused_account_validity_days"}, + }, }, }, }, @@ -653,7 +662,7 @@ func resourceAwsCognitoUserPoolCreate(d *schema.ResourceData, meta interface{}) } if v, ok := d.GetOk("tags"); ok { - params.UserPoolTags = tagsFromMapGeneric(v.(map[string]interface{})) + params.UserPoolTags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().CognitoidentityproviderTags() } log.Printf("[DEBUG] Creating Cognito User Pool: %s", params) @@ -663,11 +672,11 @@ func resourceAwsCognitoUserPoolCreate(d *schema.ResourceData, meta interface{}) err := resource.Retry(2*time.Minute, func() *resource.RetryError { var err error resp, err = conn.CreateUserPool(params) - if isAWSErr(err, "InvalidSmsRoleTrustRelationshipException", "Role does not have a trust relationship allowing Cognito to assume the role") { + if isAWSErr(err, cognitoidentityprovider.ErrCodeInvalidSmsRoleTrustRelationshipException, "Role does not have a trust relationship allowing Cognito to assume the role") { log.Printf("[DEBUG] Received %s, retrying CreateUserPool", err) return resource.RetryableError(err) } - if isAWSErr(err, "InvalidSmsRoleAccessPolicyException", "Role does not have permission to publish with SNS") { + if isAWSErr(err, cognitoidentityprovider.ErrCodeInvalidSmsRoleAccessPolicyException, "Role does not have permission to publish with SNS") { log.Printf("[DEBUG] Received %s, retrying CreateUserPool", err) return resource.RetryableError(err) } @@ -698,7 +707,7 @@ func resourceAwsCognitoUserPoolRead(d *schema.ResourceData, meta interface{}) er resp, err := conn.DescribeUserPool(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceNotFoundException" { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == cognitoidentityprovider.ErrCodeResourceNotFoundException { log.Printf("[WARN] Cognito User Pool %s is already gone", d.Id()) d.SetId("") return nil @@ -724,22 +733,22 @@ func resourceAwsCognitoUserPoolRead(d *schema.ResourceData, meta interface{}) er d.Set("auto_verified_attributes", flattenStringList(resp.UserPool.AutoVerifiedAttributes)) if resp.UserPool.EmailVerificationSubject != nil { - d.Set("email_verification_subject", *resp.UserPool.EmailVerificationSubject) + d.Set("email_verification_subject", resp.UserPool.EmailVerificationSubject) } if resp.UserPool.EmailVerificationMessage != nil { - d.Set("email_verification_message", *resp.UserPool.EmailVerificationMessage) + d.Set("email_verification_message", resp.UserPool.EmailVerificationMessage) } if err := d.Set("lambda_config", flattenCognitoUserPoolLambdaConfig(resp.UserPool.LambdaConfig)); err != nil { return fmt.Errorf("Failed setting lambda_config: %s", err) } if resp.UserPool.MfaConfiguration != nil { - d.Set("mfa_configuration", *resp.UserPool.MfaConfiguration) + d.Set("mfa_configuration", resp.UserPool.MfaConfiguration) } if resp.UserPool.SmsVerificationMessage != nil { - d.Set("sms_verification_message", *resp.UserPool.SmsVerificationMessage) + d.Set("sms_verification_message", resp.UserPool.SmsVerificationMessage) } if resp.UserPool.SmsAuthenticationMessage != nil { - d.Set("sms_authentication_message", *resp.UserPool.SmsAuthenticationMessage) + d.Set("sms_authentication_message", resp.UserPool.SmsAuthenticationMessage) } if err := d.Set("device_configuration", flattenCognitoUserPoolDeviceConfiguration(resp.UserPool.DeviceConfiguration)); err != nil { @@ -785,7 +794,9 @@ func resourceAwsCognitoUserPoolRead(d *schema.ResourceData, meta interface{}) er d.Set("creation_date", resp.UserPool.CreationDate.Format(time.RFC3339)) d.Set("last_modified_date", resp.UserPool.LastModifiedDate.Format(time.RFC3339)) d.Set("name", resp.UserPool.Name) - d.Set("tags", tagsToMapGeneric(resp.UserPool.UserPoolTags)) + if err := d.Set("tags", keyvaluetags.CognitoidentityKeyValueTags(resp.UserPool.UserPoolTags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } @@ -927,7 +938,7 @@ func resourceAwsCognitoUserPoolUpdate(d *schema.ResourceData, meta interface{}) } if v, ok := d.GetOk("tags"); ok { - params.UserPoolTags = tagsFromMapGeneric(v.(map[string]interface{})) + params.UserPoolTags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().CognitoidentityproviderTags() } log.Printf("[DEBUG] Updating Cognito User Pool: %s", params) @@ -937,14 +948,19 @@ func resourceAwsCognitoUserPoolUpdate(d *schema.ResourceData, meta interface{}) err := resource.Retry(2*time.Minute, func() *resource.RetryError { var err error _, err = conn.UpdateUserPool(params) - if isAWSErr(err, "InvalidSmsRoleTrustRelationshipException", "Role does not have a trust relationship allowing Cognito to assume the role") { + if isAWSErr(err, cognitoidentityprovider.ErrCodeInvalidSmsRoleTrustRelationshipException, "Role does not have a trust relationship allowing Cognito to assume the role") { log.Printf("[DEBUG] Received %s, retrying UpdateUserPool", err) return resource.RetryableError(err) } - if isAWSErr(err, "InvalidSmsRoleAccessPolicyException", "Role does not have permission to publish with SNS") { + if isAWSErr(err, cognitoidentityprovider.ErrCodeInvalidSmsRoleAccessPolicyException, "Role does not have permission to publish with SNS") { log.Printf("[DEBUG] Received %s, retrying UpdateUserPool", err) return resource.RetryableError(err) } + if isAWSErr(err, cognitoidentityprovider.ErrCodeInvalidParameterException, "Please use TemporaryPasswordValidityDays in PasswordPolicy instead of UnusedAccountValidityDays") { + log.Printf("[DEBUG] Received %s, retrying UpdateUserPool without UnusedAccountValidityDays", err) + params.AdminCreateUserConfig.UnusedAccountValidityDays = nil + return resource.RetryableError(err) + } return resource.NonRetryableError(err) }) diff --git a/aws/resource_aws_cognito_user_pool_client.go b/aws/resource_aws_cognito_user_pool_client.go index f6c298017aa..6aefd3db3ae 100644 --- a/aws/resource_aws_cognito_user_pool_client.go +++ b/aws/resource_aws_cognito_user_pool_client.go @@ -55,6 +55,11 @@ func resourceAwsCognitoUserPoolClient() *schema.Resource { cognitoidentityprovider.ExplicitAuthFlowsTypeAdminNoSrpAuth, cognitoidentityprovider.ExplicitAuthFlowsTypeCustomAuthFlowOnly, cognitoidentityprovider.ExplicitAuthFlowsTypeUserPasswordAuth, + cognitoidentityprovider.ExplicitAuthFlowsTypeAllowAdminUserPasswordAuth, + cognitoidentityprovider.ExplicitAuthFlowsTypeAllowCustomAuth, + cognitoidentityprovider.ExplicitAuthFlowsTypeAllowUserPasswordAuth, + cognitoidentityprovider.ExplicitAuthFlowsTypeAllowUserSrpAuth, + cognitoidentityprovider.ExplicitAuthFlowsTypeAllowRefreshTokenAuth, }, false), }, }, @@ -104,7 +109,7 @@ func resourceAwsCognitoUserPoolClient() *schema.Resource { "allowed_oauth_scopes": { Type: schema.TypeSet, Optional: true, - MaxItems: 25, + MaxItems: 50, Elem: &schema.Schema{ Type: schema.TypeString, // https://docs.aws.amazon.com/cognito/latest/developerguide/authorization-endpoint.html @@ -243,8 +248,8 @@ func resourceAwsCognitoUserPoolClientRead(d *schema.ResourceData, meta interface } d.SetId(*resp.UserPoolClient.ClientId) - d.Set("user_pool_id", *resp.UserPoolClient.UserPoolId) - d.Set("name", *resp.UserPoolClient.ClientName) + d.Set("user_pool_id", resp.UserPoolClient.UserPoolId) + d.Set("name", resp.UserPoolClient.ClientName) d.Set("explicit_auth_flows", flattenStringList(resp.UserPoolClient.ExplicitAuthFlows)) d.Set("read_attributes", flattenStringList(resp.UserPoolClient.ReadAttributes)) d.Set("write_attributes", flattenStringList(resp.UserPoolClient.WriteAttributes)) diff --git a/aws/resource_aws_cognito_user_pool_client_test.go b/aws/resource_aws_cognito_user_pool_client_test.go index 140a2828044..f8aa2c96ea6 100644 --- a/aws/resource_aws_cognito_user_pool_client_test.go +++ b/aws/resource_aws_cognito_user_pool_client_test.go @@ -16,6 +16,7 @@ import ( func TestAccAWSCognitoUserPoolClient_basic(t *testing.T) { userPoolName := fmt.Sprintf("tf-acc-cognito-user-pool-%s", acctest.RandString(7)) clientName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + resourceName := "aws_cognito_user_pool_client.client" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -25,62 +26,15 @@ func TestAccAWSCognitoUserPoolClient_basic(t *testing.T) { { Config: testAccAWSCognitoUserPoolClientConfig_basic(userPoolName, clientName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolClientExists("aws_cognito_user_pool_client.client"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "name", clientName), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "explicit_auth_flows.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "explicit_auth_flows.245201344", "ADMIN_NO_SRP_AUTH"), + testAccCheckAWSCognitoUserPoolClientExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", clientName), + resource.TestCheckResourceAttr(resourceName, "explicit_auth_flows.#", "1"), + resource.TestCheckResourceAttr(resourceName, "explicit_auth_flows.245201344", "ADMIN_NO_SRP_AUTH"), ), }, - }, - }) -} - -func TestAccAWSCognitoUserPoolClient_importBasic(t *testing.T) { - userPoolName := fmt.Sprintf("tf-acc-cognito-user-pool-%s", acctest.RandString(7)) - clientName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) - - resourceName := "aws_cognito_user_pool_client.client" - - getStateId := func(s *terraform.State) (string, error) { - - rs, ok := s.RootModule().Resources[resourceName] - if !ok { - return "", fmt.Errorf("Not found: %s", resourceName) - } - - if rs.Primary.ID == "" { - return "", errors.New("No Cognito User Pool Client ID set") - } - - conn := testAccProvider.Meta().(*AWSClient).cognitoidpconn - userPoolId := rs.Primary.Attributes["user_pool_id"] - clientId := rs.Primary.ID - - params := &cognitoidentityprovider.DescribeUserPoolClientInput{ - UserPoolId: aws.String(userPoolId), - ClientId: aws.String(clientId), - } - - _, err := conn.DescribeUserPoolClient(params) - - if err != nil { - return "", err - } - - return fmt.Sprintf("%s/%s", userPoolId, clientId), nil - } - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEcsServiceDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSCognitoUserPoolClientConfig_basic(userPoolName, clientName), - }, { ResourceName: resourceName, - ImportStateIdFunc: getStateId, + ImportStateIdFunc: testAccAWSCognitoUserPoolClientImportStateIDFunc(resourceName), ImportState: true, ImportStateVerify: true, }, @@ -90,6 +44,7 @@ func TestAccAWSCognitoUserPoolClient_importBasic(t *testing.T) { func TestAccAWSCognitoUserPoolClient_RefreshTokenValidity(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cognito_user_pool_client.client" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -99,15 +54,21 @@ func TestAccAWSCognitoUserPoolClient_RefreshTokenValidity(t *testing.T) { { Config: testAccAWSCognitoUserPoolClientConfig_RefreshTokenValidity(rName, 60), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolClientExists("aws_cognito_user_pool_client.client"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "refresh_token_validity", "60"), + testAccCheckAWSCognitoUserPoolClientExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "refresh_token_validity", "60"), ), }, + { + ResourceName: resourceName, + ImportStateIdFunc: testAccAWSCognitoUserPoolClientImportStateIDFunc(resourceName), + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserPoolClientConfig_RefreshTokenValidity(rName, 120), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolClientExists("aws_cognito_user_pool_client.client"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "refresh_token_validity", "120"), + testAccCheckAWSCognitoUserPoolClientExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "refresh_token_validity", "120"), ), }, }, @@ -130,6 +91,12 @@ func TestAccAWSCognitoUserPoolClient_Name(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "name", "name1"), ), }, + { + ResourceName: resourceName, + ImportStateIdFunc: testAccAWSCognitoUserPoolClientImportStateIDFunc(resourceName), + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserPoolClientConfig_Name(rName, "name2"), Check: resource.ComposeAggregateTestCheckFunc( @@ -144,6 +111,7 @@ func TestAccAWSCognitoUserPoolClient_Name(t *testing.T) { func TestAccAWSCognitoUserPoolClient_allFields(t *testing.T) { userPoolName := fmt.Sprintf("tf-acc-cognito-user-pool-%s", acctest.RandString(7)) clientName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + resourceName := "aws_cognito_user_pool_client.client" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -153,36 +121,43 @@ func TestAccAWSCognitoUserPoolClient_allFields(t *testing.T) { { Config: testAccAWSCognitoUserPoolClientConfig_allFields(userPoolName, clientName, 300), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolClientExists("aws_cognito_user_pool_client.client"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "name", clientName), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "explicit_auth_flows.#", "3"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "explicit_auth_flows.1728632605", "CUSTOM_AUTH_FLOW_ONLY"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "explicit_auth_flows.1860959087", "USER_PASSWORD_AUTH"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "explicit_auth_flows.245201344", "ADMIN_NO_SRP_AUTH"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "generate_secret", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "read_attributes.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "read_attributes.881205744", "email"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "write_attributes.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "write_attributes.881205744", "email"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "refresh_token_validity", "300"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_flows.#", "2"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_flows.2645166319", "code"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_flows.3465961881", "implicit"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_flows_user_pool_client", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_scopes.#", "5"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_scopes.2517049750", "openid"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_scopes.881205744", "email"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_scopes.2603607895", "phone"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_scopes.380129571", "aws.cognito.signin.user.admin"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_scopes.4080487570", "profile"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "callback_urls.#", "2"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "callback_urls.0", "https://www.example.com/callback"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "callback_urls.1", "https://www.example.com/redirect"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "default_redirect_uri", "https://www.example.com/redirect"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "logout_urls.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "logout_urls.0", "https://www.example.com/login"), + testAccCheckAWSCognitoUserPoolClientExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", clientName), + resource.TestCheckResourceAttr(resourceName, "explicit_auth_flows.#", "3"), + resource.TestCheckResourceAttr(resourceName, "explicit_auth_flows.1728632605", "CUSTOM_AUTH_FLOW_ONLY"), + resource.TestCheckResourceAttr(resourceName, "explicit_auth_flows.1860959087", "USER_PASSWORD_AUTH"), + resource.TestCheckResourceAttr(resourceName, "explicit_auth_flows.245201344", "ADMIN_NO_SRP_AUTH"), + resource.TestCheckResourceAttr(resourceName, "generate_secret", "true"), + resource.TestCheckResourceAttr(resourceName, "read_attributes.#", "1"), + resource.TestCheckResourceAttr(resourceName, "read_attributes.881205744", "email"), + resource.TestCheckResourceAttr(resourceName, "write_attributes.#", "1"), + resource.TestCheckResourceAttr(resourceName, "write_attributes.881205744", "email"), + resource.TestCheckResourceAttr(resourceName, "refresh_token_validity", "300"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_flows.#", "2"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_flows.2645166319", "code"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_flows.3465961881", "implicit"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_flows_user_pool_client", "true"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_scopes.#", "5"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_scopes.2517049750", "openid"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_scopes.881205744", "email"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_scopes.2603607895", "phone"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_scopes.380129571", "aws.cognito.signin.user.admin"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_scopes.4080487570", "profile"), + resource.TestCheckResourceAttr(resourceName, "callback_urls.#", "2"), + resource.TestCheckResourceAttr(resourceName, "callback_urls.0", "https://www.example.com/callback"), + resource.TestCheckResourceAttr(resourceName, "callback_urls.1", "https://www.example.com/redirect"), + resource.TestCheckResourceAttr(resourceName, "default_redirect_uri", "https://www.example.com/redirect"), + resource.TestCheckResourceAttr(resourceName, "logout_urls.#", "1"), + resource.TestCheckResourceAttr(resourceName, "logout_urls.0", "https://www.example.com/login"), ), }, + { + ResourceName: resourceName, + ImportStateIdFunc: testAccAWSCognitoUserPoolClientImportStateIDFunc(resourceName), + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"generate_secret"}, + }, }, }) } @@ -190,6 +165,7 @@ func TestAccAWSCognitoUserPoolClient_allFields(t *testing.T) { func TestAccAWSCognitoUserPoolClient_allFieldsUpdatingOneField(t *testing.T) { userPoolName := fmt.Sprintf("tf-acc-cognito-user-pool-%s", acctest.RandString(7)) clientName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + resourceName := "aws_cognito_user_pool_client.client" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -202,40 +178,78 @@ func TestAccAWSCognitoUserPoolClient_allFieldsUpdatingOneField(t *testing.T) { { Config: testAccAWSCognitoUserPoolClientConfig_allFields(userPoolName, clientName, 299), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolClientExists("aws_cognito_user_pool_client.client"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "name", clientName), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "explicit_auth_flows.#", "3"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "explicit_auth_flows.1728632605", "CUSTOM_AUTH_FLOW_ONLY"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "explicit_auth_flows.1860959087", "USER_PASSWORD_AUTH"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "explicit_auth_flows.245201344", "ADMIN_NO_SRP_AUTH"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "generate_secret", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "read_attributes.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "read_attributes.881205744", "email"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "write_attributes.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "write_attributes.881205744", "email"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "refresh_token_validity", "299"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_flows.#", "2"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_flows.2645166319", "code"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_flows.3465961881", "implicit"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_flows_user_pool_client", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_scopes.#", "5"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_scopes.2517049750", "openid"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_scopes.881205744", "email"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_scopes.2603607895", "phone"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_scopes.380129571", "aws.cognito.signin.user.admin"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "allowed_oauth_scopes.4080487570", "profile"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "callback_urls.#", "2"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "callback_urls.0", "https://www.example.com/callback"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "callback_urls.1", "https://www.example.com/redirect"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "default_redirect_uri", "https://www.example.com/redirect"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "logout_urls.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool_client.client", "logout_urls.0", "https://www.example.com/login"), + testAccCheckAWSCognitoUserPoolClientExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", clientName), + resource.TestCheckResourceAttr(resourceName, "explicit_auth_flows.#", "3"), + resource.TestCheckResourceAttr(resourceName, "explicit_auth_flows.1728632605", "CUSTOM_AUTH_FLOW_ONLY"), + resource.TestCheckResourceAttr(resourceName, "explicit_auth_flows.1860959087", "USER_PASSWORD_AUTH"), + resource.TestCheckResourceAttr(resourceName, "explicit_auth_flows.245201344", "ADMIN_NO_SRP_AUTH"), + resource.TestCheckResourceAttr(resourceName, "generate_secret", "true"), + resource.TestCheckResourceAttr(resourceName, "read_attributes.#", "1"), + resource.TestCheckResourceAttr(resourceName, "read_attributes.881205744", "email"), + resource.TestCheckResourceAttr(resourceName, "write_attributes.#", "1"), + resource.TestCheckResourceAttr(resourceName, "write_attributes.881205744", "email"), + resource.TestCheckResourceAttr(resourceName, "refresh_token_validity", "299"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_flows.#", "2"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_flows.2645166319", "code"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_flows.3465961881", "implicit"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_flows_user_pool_client", "true"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_scopes.#", "5"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_scopes.2517049750", "openid"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_scopes.881205744", "email"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_scopes.2603607895", "phone"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_scopes.380129571", "aws.cognito.signin.user.admin"), + resource.TestCheckResourceAttr(resourceName, "allowed_oauth_scopes.4080487570", "profile"), + resource.TestCheckResourceAttr(resourceName, "callback_urls.#", "2"), + resource.TestCheckResourceAttr(resourceName, "callback_urls.0", "https://www.example.com/callback"), + resource.TestCheckResourceAttr(resourceName, "callback_urls.1", "https://www.example.com/redirect"), + resource.TestCheckResourceAttr(resourceName, "default_redirect_uri", "https://www.example.com/redirect"), + resource.TestCheckResourceAttr(resourceName, "logout_urls.#", "1"), + resource.TestCheckResourceAttr(resourceName, "logout_urls.0", "https://www.example.com/login"), ), }, + { + ResourceName: resourceName, + ImportStateIdFunc: testAccAWSCognitoUserPoolClientImportStateIDFunc(resourceName), + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"generate_secret"}, + }, }, }) } +func testAccAWSCognitoUserPoolClientImportStateIDFunc(resourceName string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return "", fmt.Errorf("Not found: %s", resourceName) + } + + if rs.Primary.ID == "" { + return "", errors.New("No Cognito User Pool Client ID set") + } + + conn := testAccProvider.Meta().(*AWSClient).cognitoidpconn + userPoolId := rs.Primary.Attributes["user_pool_id"] + clientId := rs.Primary.ID + + params := &cognitoidentityprovider.DescribeUserPoolClientInput{ + UserPoolId: aws.String(userPoolId), + ClientId: aws.String(clientId), + } + + _, err := conn.DescribeUserPoolClient(params) + + if err != nil { + return "", err + } + + return fmt.Sprintf("%s/%s", userPoolId, clientId), nil + } +} + func testAccCheckAWSCognitoUserPoolClientDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).cognitoidpconn diff --git a/aws/resource_aws_cognito_user_pool_test.go b/aws/resource_aws_cognito_user_pool_test.go index 0e2d3dba7b0..77a121025ce 100644 --- a/aws/resource_aws_cognito_user_pool_test.go +++ b/aws/resource_aws_cognito_user_pool_test.go @@ -70,17 +70,26 @@ func testSweepCognitoUserPools(region string) error { return nil } -func TestAccAWSCognitoUserPool_importBasic(t *testing.T) { - resourceName := "aws_cognito_user_pool.pool" +func TestAccAWSCognitoUserPool_basic(t *testing.T) { name := acctest.RandString(5) + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckAWSCloudWatchDashboardDestroy, + CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ { Config: testAccAWSCognitoUserPoolConfig_basic(name), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSCognitoUserPoolExists(resourceName), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "cognito-idp", regexp.MustCompile(`userpool/.+`)), + resource.TestMatchResourceAttr(resourceName, "endpoint", + regexp.MustCompile(`^cognito-idp\.[^.]+\.amazonaws.com/[\w-]+_[0-9a-zA-Z]+$`)), + resource.TestCheckResourceAttr(resourceName, "name", "terraform-test-pool-"+name), + resource.TestCheckResourceAttrSet(resourceName, "creation_date"), + resource.TestCheckResourceAttrSet(resourceName, "last_modified_date"), + ), }, { ResourceName: resourceName, @@ -91,8 +100,9 @@ func TestAccAWSCognitoUserPool_importBasic(t *testing.T) { }) } -func TestAccAWSCognitoUserPool_basic(t *testing.T) { +func TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration(t *testing.T) { name := acctest.RandString(5) + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -100,24 +110,50 @@ func TestAccAWSCognitoUserPool_basic(t *testing.T) { CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCognitoUserPoolConfig_basic(name), + Config: testAccAWSCognitoUserPoolConfig_withAdminCreateUserConfiguration(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.pool"), - resource.TestMatchResourceAttr("aws_cognito_user_pool.pool", "arn", - regexp.MustCompile(`^arn:aws:cognito-idp:[^:]+:[0-9]{12}:userpool/[\w-]+_[0-9a-zA-Z]+$`)), - resource.TestMatchResourceAttr("aws_cognito_user_pool.pool", "endpoint", - regexp.MustCompile(`^cognito-idp\.[^.]+\.amazonaws.com/[\w-]+_[0-9a-zA-Z]+$`)), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "name", "terraform-test-pool-"+name), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.pool", "creation_date"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.pool", "last_modified_date"), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.unused_account_validity_days", "6"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.allow_admin_create_user_only", "true"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.email_message", "Your username is {username} and temporary password is {####}. "), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.email_subject", "FooBar {####}"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.sms_message", "Your username is {username} and temporary password is {####}."), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSCognitoUserPoolConfig_withAdminCreateUserConfigurationUpdatedError(name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.unused_account_validity_days", "6"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.allow_admin_create_user_only", "false"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.email_message", "Your username is {username} and constant password is {####}. "), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.email_subject", "Foo{####}BaBaz"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.sms_message", "Your username is {username} and constant password is {####}."), + ), + ExpectNonEmptyPlan: true, + }, + { + Config: testAccAWSCognitoUserPoolConfig_withAdminCreateUserConfigurationUpdated(name), + Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.unused_account_validity_days", "6"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.allow_admin_create_user_only", "false"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.email_message", "Your username is {username} and constant password is {####}. "), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.email_subject", "Foo{####}BaBaz"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.sms_message", "Your username is {username} and constant password is {####}."), ), }, }, }) } -func TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration(t *testing.T) { - name := acctest.RandString(5) +// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/11858 +func TestAccAWSCognitoUserPool_withAdminCreateUserConfigurationAndPasswordPolicy(t *testing.T) { + name := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -125,25 +161,17 @@ func TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration(t *testing.T) { CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCognitoUserPoolConfig_withAdminCreateUserConfiguration(name), + Config: testAccAWSCognitoUserPoolConfig_withAdminCreateUserConfigAndPasswordPolicy(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.pool"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.unused_account_validity_days", "6"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.allow_admin_create_user_only", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.invite_message_template.0.email_message", "Your username is {username} and temporary password is {####}. "), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.invite_message_template.0.email_subject", "FooBar {####}"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.invite_message_template.0.sms_message", "Your username is {username} and temporary password is {####}."), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.allow_admin_create_user_only", "true"), + resource.TestCheckResourceAttr(resourceName, "password_policy.0.temporary_password_validity_days", "7"), ), }, { - Config: testAccAWSCognitoUserPoolConfig_withAdminCreateUserConfigurationUpdated(name), - Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.unused_account_validity_days", "7"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.allow_admin_create_user_only", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.invite_message_template.0.email_message", "Your username is {username} and constant password is {####}. "), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.invite_message_template.0.email_subject", "Foo{####}BaBaz"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.invite_message_template.0.sms_message", "Your username is {username} and constant password is {####}."), - ), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, }, }, }) @@ -151,6 +179,7 @@ func TestAccAWSCognitoUserPool_withAdminCreateUserConfiguration(t *testing.T) { func TestAccAWSCognitoUserPool_withAdvancedSecurityMode(t *testing.T) { name := acctest.RandString(5) + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -160,20 +189,25 @@ func TestAccAWSCognitoUserPool_withAdvancedSecurityMode(t *testing.T) { { Config: testAccAWSCognitoUserPoolConfig_withAdvancedSecurityMode(name, "OFF"), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.pool"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "user_pool_add_ons.0.advanced_security_mode", "OFF"), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "user_pool_add_ons.0.advanced_security_mode", "OFF"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserPoolConfig_withAdvancedSecurityMode(name, "ENFORCED"), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "user_pool_add_ons.0.advanced_security_mode", "ENFORCED"), + resource.TestCheckResourceAttr(resourceName, "user_pool_add_ons.0.advanced_security_mode", "ENFORCED"), ), }, { Config: testAccAWSCognitoUserPoolConfig_basic(name), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "user_pool_add_ons.#", "0"), + resource.TestCheckResourceAttr(resourceName, "user_pool_add_ons.#", "0"), ), }, }, @@ -182,6 +216,7 @@ func TestAccAWSCognitoUserPool_withAdvancedSecurityMode(t *testing.T) { func TestAccAWSCognitoUserPool_withDeviceConfiguration(t *testing.T) { name := acctest.RandString(5) + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -191,16 +226,21 @@ func TestAccAWSCognitoUserPool_withDeviceConfiguration(t *testing.T) { { Config: testAccAWSCognitoUserPoolConfig_withDeviceConfiguration(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.pool"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "device_configuration.0.challenge_required_on_new_device", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "device_configuration.0.device_only_remembered_on_user_prompt", "false"), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "device_configuration.0.challenge_required_on_new_device", "true"), + resource.TestCheckResourceAttr(resourceName, "device_configuration.0.device_only_remembered_on_user_prompt", "false"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserPoolConfig_withDeviceConfigurationUpdated(name), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "device_configuration.0.challenge_required_on_new_device", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "device_configuration.0.device_only_remembered_on_user_prompt", "true"), + resource.TestCheckResourceAttr(resourceName, "device_configuration.0.challenge_required_on_new_device", "false"), + resource.TestCheckResourceAttr(resourceName, "device_configuration.0.device_only_remembered_on_user_prompt", "true"), ), }, }, @@ -213,6 +253,7 @@ func TestAccAWSCognitoUserPool_withEmailVerificationMessage(t *testing.T) { updatedSubject := acctest.RandString(10) message := fmt.Sprintf("%s {####}", acctest.RandString(10)) upatedMessage := fmt.Sprintf("%s {####}", acctest.RandString(10)) + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -222,16 +263,21 @@ func TestAccAWSCognitoUserPool_withEmailVerificationMessage(t *testing.T) { { Config: testAccAWSCognitoUserPoolConfig_withEmailVerificationMessage(name, subject, message), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.pool"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_verification_subject", subject), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_verification_message", message), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "email_verification_subject", subject), + resource.TestCheckResourceAttr(resourceName, "email_verification_message", message), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserPoolConfig_withEmailVerificationMessage(name, updatedSubject, upatedMessage), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_verification_subject", updatedSubject), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_verification_message", upatedMessage), + resource.TestCheckResourceAttr(resourceName, "email_verification_subject", updatedSubject), + resource.TestCheckResourceAttr(resourceName, "email_verification_message", upatedMessage), ), }, }, @@ -244,6 +290,7 @@ func TestAccAWSCognitoUserPool_withSmsVerificationMessage(t *testing.T) { updatedAuthenticationMessage := fmt.Sprintf("%s {####}", acctest.RandString(10)) verificationMessage := fmt.Sprintf("%s {####}", acctest.RandString(10)) upatedVerificationMessage := fmt.Sprintf("%s {####}", acctest.RandString(10)) + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -253,16 +300,21 @@ func TestAccAWSCognitoUserPool_withSmsVerificationMessage(t *testing.T) { { Config: testAccAWSCognitoUserPoolConfig_withSmsVerificationMessage(name, authenticationMessage, verificationMessage), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.pool"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_authentication_message", authenticationMessage), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_verification_message", verificationMessage), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "sms_authentication_message", authenticationMessage), + resource.TestCheckResourceAttr(resourceName, "sms_verification_message", verificationMessage), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserPoolConfig_withSmsVerificationMessage(name, updatedAuthenticationMessage, upatedVerificationMessage), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_authentication_message", updatedAuthenticationMessage), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_verification_message", upatedVerificationMessage), + resource.TestCheckResourceAttr(resourceName, "sms_authentication_message", updatedAuthenticationMessage), + resource.TestCheckResourceAttr(resourceName, "sms_verification_message", upatedVerificationMessage), ), }, }, @@ -272,6 +324,7 @@ func TestAccAWSCognitoUserPool_withSmsVerificationMessage(t *testing.T) { func TestAccAWSCognitoUserPool_withEmailConfiguration(t *testing.T) { name := acctest.RandString(5) replyTo := fmt.Sprintf("tf-acc-reply-%s@terraformtesting.com", name) + resourceName := "aws_cognito_user_pool.test" sourceARN, ok := os.LookupEnv("TEST_AWS_SES_VERIFIED_EMAIL_ARN") if !ok { @@ -286,18 +339,23 @@ func TestAccAWSCognitoUserPool_withEmailConfiguration(t *testing.T) { { Config: testAccAWSCognitoUserPoolConfig_withEmailConfiguration(name, "", "", "COGNITO_DEFAULT"), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_configuration.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_configuration.0.reply_to_email_address", ""), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_configuration.0.email_sending_account", "COGNITO_DEFAULT"), + resource.TestCheckResourceAttr(resourceName, "email_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "email_configuration.0.reply_to_email_address", ""), + resource.TestCheckResourceAttr(resourceName, "email_configuration.0.email_sending_account", "COGNITO_DEFAULT"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserPoolConfig_withEmailConfiguration(name, replyTo, sourceARN, "DEVELOPER"), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_configuration.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_configuration.0.reply_to_email_address", replyTo), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_configuration.0.email_sending_account", "DEVELOPER"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_configuration.0.source_arn", sourceARN), + resource.TestCheckResourceAttr(resourceName, "email_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "email_configuration.0.reply_to_email_address", replyTo), + resource.TestCheckResourceAttr(resourceName, "email_configuration.0.email_sending_account", "DEVELOPER"), + resource.TestCheckResourceAttr(resourceName, "email_configuration.0.source_arn", sourceARN), ), }, }, @@ -308,6 +366,7 @@ func TestAccAWSCognitoUserPool_withEmailConfiguration(t *testing.T) { // taking some time. func TestAccAWSCognitoUserPool_withSmsConfiguration(t *testing.T) { name := acctest.RandString(5) + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -317,11 +376,16 @@ func TestAccAWSCognitoUserPool_withSmsConfiguration(t *testing.T) { { Config: testAccAWSCognitoUserPoolConfig_withSmsConfiguration(name), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_configuration.#", "1"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.pool", "sms_configuration.0.external_id"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.pool", "sms_configuration.0.sns_caller_arn"), + resource.TestCheckResourceAttr(resourceName, "sms_configuration.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "sms_configuration.0.external_id"), + resource.TestCheckResourceAttrSet(resourceName, "sms_configuration.0.sns_caller_arn"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -329,6 +393,7 @@ func TestAccAWSCognitoUserPool_withSmsConfiguration(t *testing.T) { // Ensure we can update a User Pool, handling IAM role propagation. func TestAccAWSCognitoUserPool_withSmsConfigurationUpdated(t *testing.T) { name := acctest.RandString(5) + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -338,16 +403,21 @@ func TestAccAWSCognitoUserPool_withSmsConfigurationUpdated(t *testing.T) { { Config: testAccAWSCognitoUserPoolConfig_basic(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.pool"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_configuration.#", "0"), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "sms_configuration.#", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserPoolConfig_withSmsConfiguration(name), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_configuration.#", "1"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.pool", "sms_configuration.0.external_id"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.pool", "sms_configuration.0.sns_caller_arn"), + resource.TestCheckResourceAttr(resourceName, "sms_configuration.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "sms_configuration.0.external_id"), + resource.TestCheckResourceAttrSet(resourceName, "sms_configuration.0.sns_caller_arn"), ), }, }, @@ -356,6 +426,7 @@ func TestAccAWSCognitoUserPool_withSmsConfigurationUpdated(t *testing.T) { func TestAccAWSCognitoUserPool_withTags(t *testing.T) { name := acctest.RandString(5) + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -363,17 +434,32 @@ func TestAccAWSCognitoUserPool_withTags(t *testing.T) { CheckDestroy: testAccCheckAWSCognitoUserPoolDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSCognitoUserPoolConfig_withTags(name), + Config: testAccAWSCognitoUserPoolConfig_Tags1(name, "key1", "value1"), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.pool"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "tags.Name", "Foo"), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), }, { - Config: testAccAWSCognitoUserPoolConfig_withTagsUpdated(name), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSCognitoUserPoolConfig_Tags2(name, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "tags.Name", "FooBar"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "tags.Project", "Terraform"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSCognitoUserPoolConfig_Tags1(name, "key2", "value2"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, }, @@ -382,6 +468,7 @@ func TestAccAWSCognitoUserPool_withTags(t *testing.T) { func TestAccAWSCognitoUserPool_withAliasAttributes(t *testing.T) { name := acctest.RandString(5) + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -391,20 +478,25 @@ func TestAccAWSCognitoUserPool_withAliasAttributes(t *testing.T) { { Config: testAccAWSCognitoUserPoolConfig_withAliasAttributes(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.pool"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "alias_attributes.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "alias_attributes.1888159429", "preferred_username"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "auto_verified_attributes.#", "0"), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "alias_attributes.#", "1"), + resource.TestCheckResourceAttr(resourceName, "alias_attributes.1888159429", "preferred_username"), + resource.TestCheckResourceAttr(resourceName, "auto_verified_attributes.#", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserPoolConfig_withAliasAttributesUpdated(name), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "alias_attributes.#", "2"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "alias_attributes.881205744", "email"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "alias_attributes.1888159429", "preferred_username"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "auto_verified_attributes.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "auto_verified_attributes.881205744", "email"), + resource.TestCheckResourceAttr(resourceName, "alias_attributes.#", "2"), + resource.TestCheckResourceAttr(resourceName, "alias_attributes.881205744", "email"), + resource.TestCheckResourceAttr(resourceName, "alias_attributes.1888159429", "preferred_username"), + resource.TestCheckResourceAttr(resourceName, "auto_verified_attributes.#", "1"), + resource.TestCheckResourceAttr(resourceName, "auto_verified_attributes.881205744", "email"), ), }, }, @@ -413,6 +505,7 @@ func TestAccAWSCognitoUserPool_withAliasAttributes(t *testing.T) { func TestAccAWSCognitoUserPool_withPasswordPolicy(t *testing.T) { name := acctest.RandString(5) + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -422,24 +515,31 @@ func TestAccAWSCognitoUserPool_withPasswordPolicy(t *testing.T) { { Config: testAccAWSCognitoUserPoolConfig_withPasswordPolicy(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.pool"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "password_policy.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "password_policy.0.minimum_length", "7"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "password_policy.0.require_lowercase", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "password_policy.0.require_numbers", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "password_policy.0.require_symbols", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "password_policy.0.require_uppercase", "false"), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "password_policy.#", "1"), + resource.TestCheckResourceAttr(resourceName, "password_policy.0.minimum_length", "7"), + resource.TestCheckResourceAttr(resourceName, "password_policy.0.require_lowercase", "true"), + resource.TestCheckResourceAttr(resourceName, "password_policy.0.require_numbers", "false"), + resource.TestCheckResourceAttr(resourceName, "password_policy.0.require_symbols", "true"), + resource.TestCheckResourceAttr(resourceName, "password_policy.0.require_uppercase", "false"), + resource.TestCheckResourceAttr(resourceName, "password_policy.0.temporary_password_validity_days", "7"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserPoolConfig_withPasswordPolicyUpdated(name), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "password_policy.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "password_policy.0.minimum_length", "9"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "password_policy.0.require_lowercase", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "password_policy.0.require_numbers", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "password_policy.0.require_symbols", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "password_policy.0.require_uppercase", "true"), + resource.TestCheckResourceAttr(resourceName, "password_policy.#", "1"), + resource.TestCheckResourceAttr(resourceName, "password_policy.0.minimum_length", "9"), + resource.TestCheckResourceAttr(resourceName, "password_policy.0.require_lowercase", "false"), + resource.TestCheckResourceAttr(resourceName, "password_policy.0.require_numbers", "true"), + resource.TestCheckResourceAttr(resourceName, "password_policy.0.require_symbols", "false"), + resource.TestCheckResourceAttr(resourceName, "password_policy.0.require_uppercase", "true"), + resource.TestCheckResourceAttr(resourceName, "password_policy.0.temporary_password_validity_days", "14"), ), }, }, @@ -448,6 +548,7 @@ func TestAccAWSCognitoUserPool_withPasswordPolicy(t *testing.T) { func TestAccAWSCognitoUserPool_withLambdaConfig(t *testing.T) { name := acctest.RandString(5) + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -457,34 +558,39 @@ func TestAccAWSCognitoUserPool_withLambdaConfig(t *testing.T) { { Config: testAccAWSCognitoUserPoolConfig_withLambdaConfig(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "lambda_config.#", "1"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.create_auth_challenge"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.custom_message"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.define_auth_challenge"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.post_authentication"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.post_confirmation"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.pre_authentication"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.pre_sign_up"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.pre_token_generation"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.user_migration"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.verify_auth_challenge_response"), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "lambda_config.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.create_auth_challenge"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.custom_message"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.define_auth_challenge"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.post_authentication"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.post_confirmation"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.pre_authentication"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.pre_sign_up"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.pre_token_generation"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.user_migration"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.verify_auth_challenge_response"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserPoolConfig_withLambdaConfigUpdated(name), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "lambda_config.#", "1"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.create_auth_challenge"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.custom_message"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.define_auth_challenge"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.post_authentication"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.post_confirmation"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.pre_authentication"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.pre_sign_up"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.pre_token_generation"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.user_migration"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.main", "lambda_config.0.verify_auth_challenge_response"), + resource.TestCheckResourceAttr(resourceName, "lambda_config.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.create_auth_challenge"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.custom_message"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.define_auth_challenge"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.post_authentication"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.post_confirmation"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.pre_authentication"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.pre_sign_up"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.pre_token_generation"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.user_migration"), + resource.TestCheckResourceAttrSet(resourceName, "lambda_config.0.verify_auth_challenge_response"), ), }, }, @@ -493,6 +599,7 @@ func TestAccAWSCognitoUserPool_withLambdaConfig(t *testing.T) { func TestAccAWSCognitoUserPool_withSchemaAttributes(t *testing.T) { name := acctest.RandString(5) + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -502,61 +609,66 @@ func TestAccAWSCognitoUserPool_withSchemaAttributes(t *testing.T) { { Config: testAccAWSCognitoUserPoolConfig_withSchemaAttributes(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.main"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.#", "2"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.145451252.attribute_data_type", "String"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.145451252.developer_only_attribute", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.145451252.mutable", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.145451252.name", "email"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.145451252.number_attribute_constraints.#", "0"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.145451252.required", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.145451252.string_attribute_constraints.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.145451252.string_attribute_constraints.0.min_length", "5"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.145451252.string_attribute_constraints.0.max_length", "10"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.770828826.attribute_data_type", "Boolean"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.770828826.developer_only_attribute", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.770828826.mutable", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.770828826.name", "mybool"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.770828826.number_attribute_constraints.#", "0"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.770828826.required", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.770828826.string_attribute_constraints.#", "0"), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "schema.#", "2"), + resource.TestCheckResourceAttr(resourceName, "schema.145451252.attribute_data_type", "String"), + resource.TestCheckResourceAttr(resourceName, "schema.145451252.developer_only_attribute", "false"), + resource.TestCheckResourceAttr(resourceName, "schema.145451252.mutable", "false"), + resource.TestCheckResourceAttr(resourceName, "schema.145451252.name", "email"), + resource.TestCheckResourceAttr(resourceName, "schema.145451252.number_attribute_constraints.#", "0"), + resource.TestCheckResourceAttr(resourceName, "schema.145451252.required", "true"), + resource.TestCheckResourceAttr(resourceName, "schema.145451252.string_attribute_constraints.#", "1"), + resource.TestCheckResourceAttr(resourceName, "schema.145451252.string_attribute_constraints.0.min_length", "5"), + resource.TestCheckResourceAttr(resourceName, "schema.145451252.string_attribute_constraints.0.max_length", "10"), + resource.TestCheckResourceAttr(resourceName, "schema.770828826.attribute_data_type", "Boolean"), + resource.TestCheckResourceAttr(resourceName, "schema.770828826.developer_only_attribute", "true"), + resource.TestCheckResourceAttr(resourceName, "schema.770828826.mutable", "false"), + resource.TestCheckResourceAttr(resourceName, "schema.770828826.name", "mybool"), + resource.TestCheckResourceAttr(resourceName, "schema.770828826.number_attribute_constraints.#", "0"), + resource.TestCheckResourceAttr(resourceName, "schema.770828826.required", "false"), + resource.TestCheckResourceAttr(resourceName, "schema.770828826.string_attribute_constraints.#", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserPoolConfig_withSchemaAttributesUpdated(name), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.#", "3"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2078884933.attribute_data_type", "String"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2078884933.developer_only_attribute", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2078884933.mutable", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2078884933.name", "email"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2078884933.number_attribute_constraints.#", "0"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2078884933.required", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2078884933.string_attribute_constraints.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2078884933.string_attribute_constraints.0.min_length", "7"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2078884933.string_attribute_constraints.0.max_length", "15"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2718111653.attribute_data_type", "Number"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2718111653.developer_only_attribute", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2718111653.mutable", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2718111653.name", "mynumber"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2718111653.number_attribute_constraints.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2718111653.number_attribute_constraints.0.min_value", "2"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2718111653.number_attribute_constraints.0.max_value", "6"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2718111653.required", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2718111653.string_attribute_constraints.#", "0"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2753746449.attribute_data_type", "Number"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2753746449.developer_only_attribute", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2753746449.mutable", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2753746449.name", "mynondevnumber"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2753746449.number_attribute_constraints.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2753746449.number_attribute_constraints.0.min_value", "2"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2753746449.number_attribute_constraints.0.max_value", "6"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2753746449.required", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.main", "schema.2753746449.string_attribute_constraints.#", "0"), + resource.TestCheckResourceAttr(resourceName, "schema.#", "3"), + resource.TestCheckResourceAttr(resourceName, "schema.2078884933.attribute_data_type", "String"), + resource.TestCheckResourceAttr(resourceName, "schema.2078884933.developer_only_attribute", "false"), + resource.TestCheckResourceAttr(resourceName, "schema.2078884933.mutable", "false"), + resource.TestCheckResourceAttr(resourceName, "schema.2078884933.name", "email"), + resource.TestCheckResourceAttr(resourceName, "schema.2078884933.number_attribute_constraints.#", "0"), + resource.TestCheckResourceAttr(resourceName, "schema.2078884933.required", "true"), + resource.TestCheckResourceAttr(resourceName, "schema.2078884933.string_attribute_constraints.#", "1"), + resource.TestCheckResourceAttr(resourceName, "schema.2078884933.string_attribute_constraints.0.min_length", "7"), + resource.TestCheckResourceAttr(resourceName, "schema.2078884933.string_attribute_constraints.0.max_length", "15"), + resource.TestCheckResourceAttr(resourceName, "schema.2718111653.attribute_data_type", "Number"), + resource.TestCheckResourceAttr(resourceName, "schema.2718111653.developer_only_attribute", "true"), + resource.TestCheckResourceAttr(resourceName, "schema.2718111653.mutable", "true"), + resource.TestCheckResourceAttr(resourceName, "schema.2718111653.name", "mynumber"), + resource.TestCheckResourceAttr(resourceName, "schema.2718111653.number_attribute_constraints.#", "1"), + resource.TestCheckResourceAttr(resourceName, "schema.2718111653.number_attribute_constraints.0.min_value", "2"), + resource.TestCheckResourceAttr(resourceName, "schema.2718111653.number_attribute_constraints.0.max_value", "6"), + resource.TestCheckResourceAttr(resourceName, "schema.2718111653.required", "false"), + resource.TestCheckResourceAttr(resourceName, "schema.2718111653.string_attribute_constraints.#", "0"), + resource.TestCheckResourceAttr(resourceName, "schema.2753746449.attribute_data_type", "Number"), + resource.TestCheckResourceAttr(resourceName, "schema.2753746449.developer_only_attribute", "false"), + resource.TestCheckResourceAttr(resourceName, "schema.2753746449.mutable", "true"), + resource.TestCheckResourceAttr(resourceName, "schema.2753746449.name", "mynondevnumber"), + resource.TestCheckResourceAttr(resourceName, "schema.2753746449.number_attribute_constraints.#", "1"), + resource.TestCheckResourceAttr(resourceName, "schema.2753746449.number_attribute_constraints.0.min_value", "2"), + resource.TestCheckResourceAttr(resourceName, "schema.2753746449.number_attribute_constraints.0.max_value", "6"), + resource.TestCheckResourceAttr(resourceName, "schema.2753746449.required", "false"), + resource.TestCheckResourceAttr(resourceName, "schema.2753746449.string_attribute_constraints.#", "0"), ), }, { - ResourceName: "aws_cognito_user_pool.main", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -566,6 +678,7 @@ func TestAccAWSCognitoUserPool_withSchemaAttributes(t *testing.T) { func TestAccAWSCognitoUserPool_withVerificationMessageTemplate(t *testing.T) { name := acctest.RandString(5) + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -575,36 +688,41 @@ func TestAccAWSCognitoUserPool_withVerificationMessageTemplate(t *testing.T) { { Config: testAccAWSCognitoUserPoolConfig_withVerificationMessageTemplate(name), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.pool"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "verification_message_template.0.default_email_option", "CONFIRM_WITH_LINK"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "verification_message_template.0.email_message", "foo {####} bar"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "verification_message_template.0.email_message_by_link", "{##foobar##}"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "verification_message_template.0.email_subject", "foobar {####}"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "verification_message_template.0.email_subject_by_link", "foobar"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "verification_message_template.0.sms_message", "{####} baz"), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "verification_message_template.0.default_email_option", "CONFIRM_WITH_LINK"), + resource.TestCheckResourceAttr(resourceName, "verification_message_template.0.email_message", "foo {####} bar"), + resource.TestCheckResourceAttr(resourceName, "verification_message_template.0.email_message_by_link", "{##foobar##}"), + resource.TestCheckResourceAttr(resourceName, "verification_message_template.0.email_subject", "foobar {####}"), + resource.TestCheckResourceAttr(resourceName, "verification_message_template.0.email_subject_by_link", "foobar"), + resource.TestCheckResourceAttr(resourceName, "verification_message_template.0.sms_message", "{####} baz"), /* Setting Verification template attributes like EmailMessage, EmailSubject or SmsMessage will implicitly set EmailVerificationMessage, EmailVerificationSubject and SmsVerificationMessage attributes. */ - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_verification_message", "foo {####} bar"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_verification_subject", "foobar {####}"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_verification_message", "{####} baz"), + resource.TestCheckResourceAttr(resourceName, "email_verification_message", "foo {####} bar"), + resource.TestCheckResourceAttr(resourceName, "email_verification_subject", "foobar {####}"), + resource.TestCheckResourceAttr(resourceName, "sms_verification_message", "{####} baz"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserPoolConfig_withVerificationMessageTemplate_DefaultEmailOption(name), Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "verification_message_template.0.default_email_option", "CONFIRM_WITH_CODE"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_verification_message", "{####} Baz"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_verification_subject", "BazBaz {####}"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_verification_message", "{####} BazBazBar?"), + resource.TestCheckResourceAttr(resourceName, "verification_message_template.0.default_email_option", "CONFIRM_WITH_CODE"), + resource.TestCheckResourceAttr(resourceName, "email_verification_message", "{####} Baz"), + resource.TestCheckResourceAttr(resourceName, "email_verification_subject", "BazBaz {####}"), + resource.TestCheckResourceAttr(resourceName, "sms_verification_message", "{####} BazBazBar?"), /* Setting EmailVerificationMessage, EmailVerificationSubject and SmsVerificationMessage attributes will implicitly set verification template attributes like EmailMessage, EmailSubject or SmsMessage. */ - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "verification_message_template.0.email_message", "{####} Baz"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "verification_message_template.0.email_subject", "BazBaz {####}"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "verification_message_template.0.sms_message", "{####} BazBazBar?"), + resource.TestCheckResourceAttr(resourceName, "verification_message_template.0.email_message", "{####} Baz"), + resource.TestCheckResourceAttr(resourceName, "verification_message_template.0.email_subject", "BazBaz {####}"), + resource.TestCheckResourceAttr(resourceName, "verification_message_template.0.sms_message", "{####} BazBazBar?"), ), }, }, @@ -617,6 +735,7 @@ func TestAccAWSCognitoUserPool_update(t *testing.T) { offMfa := "OFF" authenticationMessage := fmt.Sprintf("%s {####}", acctest.RandString(10)) updatedAuthenticationMessage := fmt.Sprintf("%s {####}", acctest.RandString(10)) + resourceName := "aws_cognito_user_pool.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSCognitoIdentityProvider(t) }, @@ -626,73 +745,78 @@ func TestAccAWSCognitoUserPool_update(t *testing.T) { { Config: testAccAWSCognitoUserPoolConfig_update(name, optionalMfa, authenticationMessage), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.pool"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "auto_verified_attributes.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "mfa_configuration", optionalMfa), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_verification_message", "Foo {####} Bar"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_verification_subject", "FooBar {####}"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_verification_message", "{####} Baz"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_authentication_message", authenticationMessage), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.unused_account_validity_days", "6"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.allow_admin_create_user_only", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.invite_message_template.0.email_message", "Your username is {username} and temporary password is {####}. "), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.invite_message_template.0.email_subject", "FooBar {####}"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.invite_message_template.0.sms_message", "Your username is {username} and temporary password is {####}."), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "device_configuration.0.challenge_required_on_new_device", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "device_configuration.0.device_only_remembered_on_user_prompt", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "verification_message_template.0.default_email_option", "CONFIRM_WITH_CODE"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_configuration.#", "1"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.pool", "sms_configuration.0.external_id"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.pool", "sms_configuration.0.sns_caller_arn"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "tags.Name", "Foo"), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "auto_verified_attributes.#", "1"), + resource.TestCheckResourceAttr(resourceName, "mfa_configuration", optionalMfa), + resource.TestCheckResourceAttr(resourceName, "email_verification_message", "Foo {####} Bar"), + resource.TestCheckResourceAttr(resourceName, "email_verification_subject", "FooBar {####}"), + resource.TestCheckResourceAttr(resourceName, "sms_verification_message", "{####} Baz"), + resource.TestCheckResourceAttr(resourceName, "sms_authentication_message", authenticationMessage), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.unused_account_validity_days", "6"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.allow_admin_create_user_only", "true"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.email_message", "Your username is {username} and temporary password is {####}. "), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.email_subject", "FooBar {####}"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.sms_message", "Your username is {username} and temporary password is {####}."), + resource.TestCheckResourceAttr(resourceName, "device_configuration.0.challenge_required_on_new_device", "true"), + resource.TestCheckResourceAttr(resourceName, "device_configuration.0.device_only_remembered_on_user_prompt", "false"), + resource.TestCheckResourceAttr(resourceName, "verification_message_template.0.default_email_option", "CONFIRM_WITH_CODE"), + resource.TestCheckResourceAttr(resourceName, "sms_configuration.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "sms_configuration.0.external_id"), + resource.TestCheckResourceAttrSet(resourceName, "sms_configuration.0.sns_caller_arn"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", "Foo"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSCognitoUserPoolConfig_update(name, optionalMfa, updatedAuthenticationMessage), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.pool"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "auto_verified_attributes.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "mfa_configuration", optionalMfa), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_verification_message", "Foo {####} Bar"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_verification_subject", "FooBar {####}"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_verification_message", "{####} Baz"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_authentication_message", updatedAuthenticationMessage), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.unused_account_validity_days", "6"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.allow_admin_create_user_only", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.invite_message_template.0.email_message", "Your username is {username} and temporary password is {####}. "), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.invite_message_template.0.email_subject", "FooBar {####}"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.invite_message_template.0.sms_message", "Your username is {username} and temporary password is {####}."), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "device_configuration.0.challenge_required_on_new_device", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "device_configuration.0.device_only_remembered_on_user_prompt", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "verification_message_template.0.default_email_option", "CONFIRM_WITH_CODE"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_configuration.#", "1"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.pool", "sms_configuration.0.external_id"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.pool", "sms_configuration.0.sns_caller_arn"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "tags.Name", "Foo"), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "auto_verified_attributes.#", "1"), + resource.TestCheckResourceAttr(resourceName, "mfa_configuration", optionalMfa), + resource.TestCheckResourceAttr(resourceName, "email_verification_message", "Foo {####} Bar"), + resource.TestCheckResourceAttr(resourceName, "email_verification_subject", "FooBar {####}"), + resource.TestCheckResourceAttr(resourceName, "sms_verification_message", "{####} Baz"), + resource.TestCheckResourceAttr(resourceName, "sms_authentication_message", updatedAuthenticationMessage), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.unused_account_validity_days", "6"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.allow_admin_create_user_only", "true"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.email_message", "Your username is {username} and temporary password is {####}. "), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.email_subject", "FooBar {####}"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.sms_message", "Your username is {username} and temporary password is {####}."), + resource.TestCheckResourceAttr(resourceName, "device_configuration.0.challenge_required_on_new_device", "true"), + resource.TestCheckResourceAttr(resourceName, "device_configuration.0.device_only_remembered_on_user_prompt", "false"), + resource.TestCheckResourceAttr(resourceName, "verification_message_template.0.default_email_option", "CONFIRM_WITH_CODE"), + resource.TestCheckResourceAttr(resourceName, "sms_configuration.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "sms_configuration.0.external_id"), + resource.TestCheckResourceAttrSet(resourceName, "sms_configuration.0.sns_caller_arn"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", "Foo"), ), }, { Config: testAccAWSCognitoUserPoolConfig_update(name, offMfa, updatedAuthenticationMessage), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSCognitoUserPoolExists("aws_cognito_user_pool.pool"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "auto_verified_attributes.#", "1"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "mfa_configuration", offMfa), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_verification_message", "Foo {####} Bar"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "email_verification_subject", "FooBar {####}"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_verification_message", "{####} Baz"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_authentication_message", updatedAuthenticationMessage), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.unused_account_validity_days", "6"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.allow_admin_create_user_only", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.invite_message_template.0.email_message", "Your username is {username} and temporary password is {####}. "), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.invite_message_template.0.email_subject", "FooBar {####}"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "admin_create_user_config.0.invite_message_template.0.sms_message", "Your username is {username} and temporary password is {####}."), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "device_configuration.0.challenge_required_on_new_device", "true"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "device_configuration.0.device_only_remembered_on_user_prompt", "false"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "verification_message_template.0.default_email_option", "CONFIRM_WITH_CODE"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "sms_configuration.#", "1"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.pool", "sms_configuration.0.external_id"), - resource.TestCheckResourceAttrSet("aws_cognito_user_pool.pool", "sms_configuration.0.sns_caller_arn"), - resource.TestCheckResourceAttr("aws_cognito_user_pool.pool", "tags.Name", "Foo"), + testAccCheckAWSCognitoUserPoolExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "auto_verified_attributes.#", "1"), + resource.TestCheckResourceAttr(resourceName, "mfa_configuration", offMfa), + resource.TestCheckResourceAttr(resourceName, "email_verification_message", "Foo {####} Bar"), + resource.TestCheckResourceAttr(resourceName, "email_verification_subject", "FooBar {####}"), + resource.TestCheckResourceAttr(resourceName, "sms_verification_message", "{####} Baz"), + resource.TestCheckResourceAttr(resourceName, "sms_authentication_message", updatedAuthenticationMessage), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.unused_account_validity_days", "6"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.allow_admin_create_user_only", "true"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.email_message", "Your username is {username} and temporary password is {####}. "), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.email_subject", "FooBar {####}"), + resource.TestCheckResourceAttr(resourceName, "admin_create_user_config.0.invite_message_template.0.sms_message", "Your username is {username} and temporary password is {####}."), + resource.TestCheckResourceAttr(resourceName, "device_configuration.0.challenge_required_on_new_device", "true"), + resource.TestCheckResourceAttr(resourceName, "device_configuration.0.device_only_remembered_on_user_prompt", "false"), + resource.TestCheckResourceAttr(resourceName, "verification_message_template.0.default_email_option", "CONFIRM_WITH_CODE"), + resource.TestCheckResourceAttr(resourceName, "sms_configuration.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "sms_configuration.0.external_id"), + resource.TestCheckResourceAttrSet(resourceName, "sms_configuration.0.sns_caller_arn"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", "Foo"), ), }, }, @@ -714,7 +838,7 @@ func testAccCheckAWSCognitoUserPoolDestroy(s *terraform.State) error { _, err := conn.DescribeUserPool(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceNotFoundException" { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == cognitoidentityprovider.ErrCodeResourceNotFoundException { return nil } return err @@ -767,7 +891,7 @@ func testAccPreCheckAWSCognitoIdentityProvider(t *testing.T) { func testAccAWSCognitoUserPoolConfig_basic(name string) string { return fmt.Sprintf(` -resource "aws_cognito_user_pool" "pool" { +resource "aws_cognito_user_pool" "test" { name = "terraform-test-pool-%s" } `, name) @@ -775,7 +899,7 @@ resource "aws_cognito_user_pool" "pool" { func testAccAWSCognitoUserPoolConfig_withAdminCreateUserConfiguration(name string) string { return fmt.Sprintf(` -resource "aws_cognito_user_pool" "pool" { +resource "aws_cognito_user_pool" "test" { name = "terraform-test-pool-%s" admin_create_user_config { @@ -792,9 +916,9 @@ resource "aws_cognito_user_pool" "pool" { `, name) } -func testAccAWSCognitoUserPoolConfig_withAdminCreateUserConfigurationUpdated(name string) string { +func testAccAWSCognitoUserPoolConfig_withAdminCreateUserConfigurationUpdatedError(name string) string { return fmt.Sprintf(` -resource "aws_cognito_user_pool" "pool" { +resource "aws_cognito_user_pool" "test" { name = "terraform-test-pool-%s" admin_create_user_config { @@ -811,9 +935,28 @@ resource "aws_cognito_user_pool" "pool" { `, name) } +func testAccAWSCognitoUserPoolConfig_withAdminCreateUserConfigurationUpdated(name string) string { + return fmt.Sprintf(` +resource "aws_cognito_user_pool" "test" { + name = "terraform-test-pool-%s" + + admin_create_user_config { + allow_admin_create_user_only = false + unused_account_validity_days = 6 + + invite_message_template { + email_message = "Your username is {username} and constant password is {####}. " + email_subject = "Foo{####}BaBaz" + sms_message = "Your username is {username} and constant password is {####}." + } + } +} +`, name) +} + func testAccAWSCognitoUserPoolConfig_withAdvancedSecurityMode(name string, mode string) string { return fmt.Sprintf(` -resource "aws_cognito_user_pool" "pool" { +resource "aws_cognito_user_pool" "test" { name = "terraform-test-pool-%s" user_pool_add_ons { @@ -825,7 +968,7 @@ resource "aws_cognito_user_pool" "pool" { func testAccAWSCognitoUserPoolConfig_withDeviceConfiguration(name string) string { return fmt.Sprintf(` -resource "aws_cognito_user_pool" "pool" { +resource "aws_cognito_user_pool" "test" { name = "terraform-test-pool-%s" device_configuration { @@ -838,7 +981,7 @@ resource "aws_cognito_user_pool" "pool" { func testAccAWSCognitoUserPoolConfig_withDeviceConfigurationUpdated(name string) string { return fmt.Sprintf(` -resource "aws_cognito_user_pool" "pool" { +resource "aws_cognito_user_pool" "test" { name = "terraform-test-pool-%s" device_configuration { @@ -851,7 +994,7 @@ resource "aws_cognito_user_pool" "pool" { func testAccAWSCognitoUserPoolConfig_withEmailVerificationMessage(name, subject, message string) string { return fmt.Sprintf(` -resource "aws_cognito_user_pool" "pool" { +resource "aws_cognito_user_pool" "test" { name = "terraform-test-pool-%s" email_verification_subject = "%s" email_verification_message = "%s" @@ -865,7 +1008,7 @@ resource "aws_cognito_user_pool" "pool" { func testAccAWSCognitoUserPoolConfig_withSmsVerificationMessage(name, authenticationMessage, verificationMessage string) string { return fmt.Sprintf(` -resource "aws_cognito_user_pool" "pool" { +resource "aws_cognito_user_pool" "test" { name = "terraform-test-pool-%s" sms_authentication_message = "%s" sms_verification_message = "%s" @@ -873,21 +1016,34 @@ resource "aws_cognito_user_pool" "pool" { `, name, authenticationMessage, verificationMessage) } -func testAccAWSCognitoUserPoolConfig_withTags(name string) string { +func testAccAWSCognitoUserPoolConfig_Tags1(name, tagKey1, tagValue1 string) string { return fmt.Sprintf(` -resource "aws_cognito_user_pool" "pool" { - name = "terraform-test-pool-%s" +resource "aws_cognito_user_pool" "test" { + name = %[1]q tags = { - "Name" = "Foo" + %[2]q = %[3]q } } -`, name) +`, name, tagKey1, tagValue1) +} + +func testAccAWSCognitoUserPoolConfig_Tags2(name, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_cognito_user_pool" "test" { + name = %[1]q + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, name, tagKey1, tagValue1, tagKey2, tagValue2) } func testAccAWSCognitoUserPoolConfig_withEmailConfiguration(name, email, arn, account string) string { return fmt.Sprintf(` -resource "aws_cognito_user_pool" "pool" { +resource "aws_cognito_user_pool" "test" { name = "terraform-test-pool-%[1]s" @@ -903,7 +1059,7 @@ func testAccAWSCognitoUserPoolConfig_withSmsConfiguration(name string) string { return fmt.Sprintf(` data "aws_caller_identity" "current" {} -resource "aws_iam_role" "main" { +resource "aws_iam_role" "test" { name = "test-role-%[1]s" path = "/service-role/" @@ -929,9 +1085,9 @@ resource "aws_iam_role" "main" { POLICY } -resource "aws_iam_role_policy" "main" { +resource "aws_iam_role_policy" "test" { name = "test-role-policy-%[1]s" - role = "${aws_iam_role.main.id}" + role = "${aws_iam_role.test.id}" policy = < 0 { + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), nil, v); err != nil { + return fmt.Errorf("error adding EC2 Customer Gateway (%s) tags: %s", d.Id(), err) + } } return nil @@ -201,7 +202,10 @@ func resourceAwsCustomerGatewayRead(d *schema.ResourceData, meta interface{}) er customerGateway := resp.CustomerGateways[0] d.Set("ip_address", customerGateway.IpAddress) d.Set("type", customerGateway.Type) - d.Set("tags", tagsToMap(customerGateway.Tags)) + + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(customerGateway.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } if *customerGateway.BgpAsn != "" { val, err := strconv.ParseInt(*customerGateway.BgpAsn, 0, 0) @@ -218,12 +222,13 @@ func resourceAwsCustomerGatewayRead(d *schema.ResourceData, meta interface{}) er 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 - } + if d.HasChange("tags") { + o, n := d.GetChange("tags") - d.SetPartial("tags") + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating EC2 Customer Gateway (%s) tags: %s", d.Id(), err) + } + } return resourceAwsCustomerGatewayRead(d, meta) } diff --git a/aws/resource_aws_customer_gateway_test.go b/aws/resource_aws_customer_gateway_test.go index 6f7a47790d4..5956f57dfef 100644 --- a/aws/resource_aws_customer_gateway_test.go +++ b/aws/resource_aws_customer_gateway_test.go @@ -15,55 +15,39 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSCustomerGateway_importBasic(t *testing.T) { - resourceName := "aws_customer_gateway.foo" - rInt := acctest.RandInt() - rBgpAsn := acctest.RandIntRange(64512, 65534) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckCustomerGatewayDestroy, - Steps: []resource.TestStep{ - { - Config: testAccCustomerGatewayConfig(rInt, rBgpAsn), - }, - - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func TestAccAWSCustomerGateway_basic(t *testing.T) { var gateway ec2.CustomerGateway rBgpAsn := acctest.RandIntRange(64512, 65534) rInt := acctest.RandInt() + resourceName := "aws_customer_gateway.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_customer_gateway.foo", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckCustomerGatewayDestroy, Steps: []resource.TestStep{ { Config: testAccCustomerGatewayConfig(rInt, rBgpAsn), Check: resource.ComposeTestCheckFunc( - testAccCheckCustomerGateway("aws_customer_gateway.foo", &gateway), + testAccCheckCustomerGateway(resourceName, &gateway), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccCustomerGatewayConfigUpdateTags(rInt, rBgpAsn), Check: resource.ComposeTestCheckFunc( - testAccCheckCustomerGateway("aws_customer_gateway.foo", &gateway), + testAccCheckCustomerGateway(resourceName, &gateway), ), }, { Config: testAccCustomerGatewayConfigForceReplace(rInt, rBgpAsn), Check: resource.ComposeTestCheckFunc( - testAccCheckCustomerGateway("aws_customer_gateway.foo", &gateway), + testAccCheckCustomerGateway(resourceName, &gateway), ), }, }, @@ -74,18 +58,25 @@ func TestAccAWSCustomerGateway_similarAlreadyExists(t *testing.T) { var gateway ec2.CustomerGateway rInt := acctest.RandInt() rBgpAsn := acctest.RandIntRange(64512, 65534) + resourceName := "aws_customer_gateway.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_customer_gateway.foo", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckCustomerGatewayDestroy, Steps: []resource.TestStep{ { Config: testAccCustomerGatewayConfig(rInt, rBgpAsn), Check: resource.ComposeTestCheckFunc( - testAccCheckCustomerGateway("aws_customer_gateway.foo", &gateway), + testAccCheckCustomerGateway(resourceName, &gateway), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccCustomerGatewayConfigIdentical(rInt, rBgpAsn), ExpectError: regexp.MustCompile("An existing customer gateway"), @@ -98,6 +89,8 @@ func TestAccAWSCustomerGateway_disappears(t *testing.T) { rInt := acctest.RandInt() rBgpAsn := acctest.RandIntRange(64512, 65534) var gateway ec2.CustomerGateway + resourceName := "aws_customer_gateway.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -106,7 +99,7 @@ func TestAccAWSCustomerGateway_disappears(t *testing.T) { { Config: testAccCustomerGatewayConfig(rInt, rBgpAsn), Check: resource.ComposeTestCheckFunc( - testAccCheckCustomerGateway("aws_customer_gateway.foo", &gateway), + testAccCheckCustomerGateway(resourceName, &gateway), testAccAWSCustomerGatewayDisappears(&gateway), ), ExpectNonEmptyPlan: true, @@ -222,13 +215,13 @@ func testAccCheckCustomerGateway(gatewayResource string, cgw *ec2.CustomerGatewa func testAccCustomerGatewayConfig(rInt, rBgpAsn int) string { return fmt.Sprintf(` -resource "aws_customer_gateway" "foo" { +resource "aws_customer_gateway" "test" { bgp_asn = %d ip_address = "172.0.0.1" type = "ipsec.1" tags = { - Name = "foo-gateway-%d" + Name = "test-gateway-%d" } } `, rBgpAsn, rInt) @@ -236,13 +229,13 @@ resource "aws_customer_gateway" "foo" { func testAccCustomerGatewayConfigIdentical(randInt, rBgpAsn int) string { return fmt.Sprintf(` -resource "aws_customer_gateway" "foo" { +resource "aws_customer_gateway" "test" { bgp_asn = %d ip_address = "172.0.0.1" type = "ipsec.1" tags = { - Name = "foo-gateway-%d" + Name = "test-gateway-%d" } } @@ -252,7 +245,7 @@ resource "aws_customer_gateway" "identical" { type = "ipsec.1" tags = { - Name = "foo-gateway-identical-%d" + Name = "test-gateway-identical-%d" } } `, rBgpAsn, randInt, rBgpAsn, randInt) @@ -261,13 +254,13 @@ resource "aws_customer_gateway" "identical" { // Add the Another: "tag" tag. func testAccCustomerGatewayConfigUpdateTags(rInt, rBgpAsn int) string { return fmt.Sprintf(` -resource "aws_customer_gateway" "foo" { +resource "aws_customer_gateway" "test" { bgp_asn = %d ip_address = "172.0.0.1" type = "ipsec.1" tags = { - Name = "foo-gateway-%d" + Name = "test-gateway-%d" Another = "tag" } } @@ -277,13 +270,13 @@ resource "aws_customer_gateway" "foo" { // Change the ip_address. func testAccCustomerGatewayConfigForceReplace(rInt, rBgpAsn int) string { return fmt.Sprintf(` -resource "aws_customer_gateway" "foo" { +resource "aws_customer_gateway" "test" { bgp_asn = %d ip_address = "172.10.10.1" type = "ipsec.1" tags = { - Name = "foo-gateway-%d" + Name = "test-gateway-%d" Another = "tag" } } diff --git a/aws/resource_aws_datapipeline_pipeline.go b/aws/resource_aws_datapipeline_pipeline.go index d0c28bbb5fc..193c92d8d62 100644 --- a/aws/resource_aws_datapipeline_pipeline.go +++ b/aws/resource_aws_datapipeline_pipeline.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/datapipeline" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDataPipelinePipeline() *schema.Resource { @@ -47,7 +48,7 @@ func resourceAwsDataPipelinePipelineCreate(d *schema.ResourceData, meta interfac input := datapipeline.CreatePipelineInput{ Name: aws.String(d.Get("name").(string)), UniqueId: aws.String(uniqueID), - Tags: tagsFromMapDataPipeline(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().DatapipelineTags(), } if v, ok := d.GetOk("description"); ok { @@ -80,23 +81,22 @@ func resourceAwsDataPipelinePipelineRead(d *schema.ResourceData, meta interface{ d.Set("name", v.Name) d.Set("description", v.Description) - if err := d.Set("tags", tagsToMapDataPipeline(v.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.DatapipelineKeyValueTags(v.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } + return nil } func resourceAwsDataPipelinePipelineUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).datapipelineconn - if err := setTagsDataPipeline(conn, d); err != nil { - if isAWSErr(err, datapipeline.ErrCodePipelineNotFoundException, "") || isAWSErr(err, datapipeline.ErrCodePipelineDeletedException, "") { - log.Printf("[WARN] DataPipeline (%s) not found, removing from state", d.Id()) - d.SetId("") - return nil - } + if d.HasChange("tags") { + o, n := d.GetChange("tags") - return fmt.Errorf("Error updating tags: %s", err) + if err := keyvaluetags.DatapipelineUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating Datapipeline Pipeline (%s) tags: %s", d.Id(), err) + } } return resourceAwsDataPipelinePipelineRead(d, meta) diff --git a/aws/resource_aws_datasync_agent.go b/aws/resource_aws_datasync_agent.go index 9ff87e78c36..00d20efd745 100644 --- a/aws/resource_aws_datasync_agent.go +++ b/aws/resource_aws_datasync_agent.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/datasync" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDataSyncAgent() *schema.Resource { @@ -49,11 +50,7 @@ func resourceAwsDataSyncAgent() *schema.Resource { Type: schema.TypeString, Optional: true, }, - "tags": { - Type: schema.TypeMap, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, + "tags": tagsSchema(), }, } } @@ -128,7 +125,7 @@ func resourceAwsDataSyncAgentCreate(d *schema.ResourceData, meta interface{}) er input := &datasync.CreateAgentInput{ ActivationKey: aws.String(activationKey), - Tags: expandDataSyncTagListEntry(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().DatasyncTags(), } if v, ok := d.GetOk("name"); ok { @@ -150,7 +147,7 @@ func resourceAwsDataSyncAgentCreate(d *schema.ResourceData, meta interface{}) er err = resource.Retry(d.Timeout(schema.TimeoutCreate), func() *resource.RetryError { _, err := conn.DescribeAgent(descAgentInput) - if isAWSErr(err, "InvalidRequestException", "not found") { + if isAWSErr(err, "InvalidRequestException", "does not exist") { return resource.RetryableError(err) } @@ -180,7 +177,7 @@ func resourceAwsDataSyncAgentRead(d *schema.ResourceData, meta interface{}) erro log.Printf("[DEBUG] Reading DataSync Agent: %s", input) output, err := conn.DescribeAgent(input) - if isAWSErr(err, "InvalidRequestException", "not found") { + if isAWSErr(err, "InvalidRequestException", "does not exist") { log.Printf("[WARN] DataSync Agent %q not found - removing from state", d.Id()) d.SetId("") return nil @@ -190,21 +187,16 @@ func resourceAwsDataSyncAgentRead(d *schema.ResourceData, meta interface{}) erro return fmt.Errorf("error reading DataSync Agent (%s): %s", d.Id(), err) } - tagsInput := &datasync.ListTagsForResourceInput{ - ResourceArn: output.AgentArn, - } + d.Set("arn", output.AgentArn) + d.Set("name", output.Name) - log.Printf("[DEBUG] Reading DataSync Agent tags: %s", tagsInput) - tagsOutput, err := conn.ListTagsForResource(tagsInput) + tags, err := keyvaluetags.DatasyncListTags(conn, d.Id()) if err != nil { - return fmt.Errorf("error reading DataSync Agent (%s) tags: %s", d.Id(), err) + return fmt.Errorf("error listing tags for DataSync Agent (%s): %s", d.Id(), err) } - d.Set("arn", output.AgentArn) - d.Set("name", output.Name) - - if err := d.Set("tags", flattenDataSyncTagListEntry(tagsOutput.Tags)); err != nil { + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -228,31 +220,10 @@ func resourceAwsDataSyncAgentUpdate(d *schema.ResourceData, meta interface{}) er } if d.HasChange("tags") { - oldRaw, newRaw := d.GetChange("tags") - createTags, removeTags := dataSyncTagsDiff(expandDataSyncTagListEntry(oldRaw.(map[string]interface{})), expandDataSyncTagListEntry(newRaw.(map[string]interface{}))) + o, n := d.GetChange("tags") - if len(removeTags) > 0 { - input := &datasync.UntagResourceInput{ - Keys: dataSyncTagsKeys(removeTags), - ResourceArn: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Untagging DataSync Agent: %s", input) - if _, err := conn.UntagResource(input); err != nil { - return fmt.Errorf("error untagging DataSync Agent (%s): %s", d.Id(), err) - } - } - - if len(createTags) > 0 { - input := &datasync.TagResourceInput{ - ResourceArn: aws.String(d.Id()), - Tags: createTags, - } - - log.Printf("[DEBUG] Tagging DataSync Agent: %s", input) - if _, err := conn.TagResource(input); err != nil { - return fmt.Errorf("error tagging DataSync Agent (%s): %s", d.Id(), err) - } + if err := keyvaluetags.DatasyncUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating DataSync Agent (%s) tags: %s", d.Id(), err) } } @@ -269,7 +240,7 @@ func resourceAwsDataSyncAgentDelete(d *schema.ResourceData, meta interface{}) er log.Printf("[DEBUG] Deleting DataSync Agent: %s", input) _, err := conn.DeleteAgent(input) - if isAWSErr(err, "InvalidRequestException", "not found") { + if isAWSErr(err, "InvalidRequestException", "does not exist") { return nil } diff --git a/aws/resource_aws_datasync_agent_test.go b/aws/resource_aws_datasync_agent_test.go index 9d89e0cc454..b71a5b75c21 100644 --- a/aws/resource_aws_datasync_agent_test.go +++ b/aws/resource_aws_datasync_agent_test.go @@ -56,7 +56,7 @@ func testSweepDataSyncAgents(region string) error { _, err := conn.DeleteAgent(input) - if isAWSErr(err, "InvalidRequestException", "not found") { + if isAWSErr(err, "InvalidRequestException", "does not exist") { continue } @@ -219,7 +219,7 @@ func testAccCheckAWSDataSyncAgentDestroy(s *terraform.State) error { _, err := conn.DescribeAgent(input) - if isAWSErr(err, "InvalidRequestException", "not found") { + if isAWSErr(err, "InvalidRequestException", "does not exist") { return nil } diff --git a/aws/resource_aws_datasync_location_efs.go b/aws/resource_aws_datasync_location_efs.go index 1409dd4f2bf..63997c02fed 100644 --- a/aws/resource_aws_datasync_location_efs.go +++ b/aws/resource_aws_datasync_location_efs.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/datasync" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDataSyncLocationEfs() *schema.Resource { @@ -70,11 +71,7 @@ func resourceAwsDataSyncLocationEfs() *schema.Resource { return false }, }, - "tags": { - Type: schema.TypeMap, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, + "tags": tagsSchema(), "uri": { Type: schema.TypeString, Computed: true, @@ -90,7 +87,7 @@ func resourceAwsDataSyncLocationEfsCreate(d *schema.ResourceData, meta interface Ec2Config: expandDataSyncEc2Config(d.Get("ec2_config").([]interface{})), EfsFilesystemArn: aws.String(d.Get("efs_file_system_arn").(string)), Subdirectory: aws.String(d.Get("subdirectory").(string)), - Tags: expandDataSyncTagListEntry(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().DatasyncTags(), } log.Printf("[DEBUG] Creating DataSync Location EFS: %s", input) @@ -124,17 +121,6 @@ func resourceAwsDataSyncLocationEfsRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("error reading DataSync Location EFS (%s): %s", d.Id(), err) } - tagsInput := &datasync.ListTagsForResourceInput{ - ResourceArn: output.LocationArn, - } - - log.Printf("[DEBUG] Reading DataSync Location EFS tags: %s", tagsInput) - tagsOutput, err := conn.ListTagsForResource(tagsInput) - - if err != nil { - return fmt.Errorf("error reading DataSync Location EFS (%s) tags: %s", d.Id(), err) - } - subdirectory, err := dataSyncParseLocationURI(aws.StringValue(output.LocationUri)) if err != nil { @@ -148,12 +134,17 @@ func resourceAwsDataSyncLocationEfsRead(d *schema.ResourceData, meta interface{} } d.Set("subdirectory", subdirectory) + d.Set("uri", output.LocationUri) - if err := d.Set("tags", flattenDataSyncTagListEntry(tagsOutput.Tags)); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags, err := keyvaluetags.DatasyncListTags(conn, d.Id()) + + if err != nil { + return fmt.Errorf("error listing tags for DataSync Location EFS (%s): %s", d.Id(), err) } - d.Set("uri", output.LocationUri) + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } @@ -162,31 +153,10 @@ func resourceAwsDataSyncLocationEfsUpdate(d *schema.ResourceData, meta interface conn := meta.(*AWSClient).datasyncconn if d.HasChange("tags") { - oldRaw, newRaw := d.GetChange("tags") - createTags, removeTags := dataSyncTagsDiff(expandDataSyncTagListEntry(oldRaw.(map[string]interface{})), expandDataSyncTagListEntry(newRaw.(map[string]interface{}))) - - if len(removeTags) > 0 { - input := &datasync.UntagResourceInput{ - Keys: dataSyncTagsKeys(removeTags), - ResourceArn: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Untagging DataSync Location EFS: %s", input) - if _, err := conn.UntagResource(input); err != nil { - return fmt.Errorf("error untagging DataSync Location EFS (%s): %s", d.Id(), err) - } - } - - if len(createTags) > 0 { - input := &datasync.TagResourceInput{ - ResourceArn: aws.String(d.Id()), - Tags: createTags, - } + o, n := d.GetChange("tags") - log.Printf("[DEBUG] Tagging DataSync Location EFS: %s", input) - if _, err := conn.TagResource(input); err != nil { - return fmt.Errorf("error tagging DataSync Location EFS (%s): %s", d.Id(), err) - } + if err := keyvaluetags.DatasyncUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating DataSync Location EFS (%s) tags: %s", d.Id(), err) } } diff --git a/aws/resource_aws_datasync_location_nfs.go b/aws/resource_aws_datasync_location_nfs.go index c1fe6561c67..a8a782867b2 100644 --- a/aws/resource_aws_datasync_location_nfs.go +++ b/aws/resource_aws_datasync_location_nfs.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/datasync" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDataSyncLocationNfs() *schema.Resource { @@ -63,11 +64,7 @@ func resourceAwsDataSyncLocationNfs() *schema.Resource { return false }, }, - "tags": { - Type: schema.TypeMap, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, + "tags": tagsSchema(), "uri": { Type: schema.TypeString, Computed: true, @@ -83,7 +80,7 @@ func resourceAwsDataSyncLocationNfsCreate(d *schema.ResourceData, meta interface OnPremConfig: expandDataSyncOnPremConfig(d.Get("on_prem_config").([]interface{})), ServerHostname: aws.String(d.Get("server_hostname").(string)), Subdirectory: aws.String(d.Get("subdirectory").(string)), - Tags: expandDataSyncTagListEntry(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().DatasyncTags(), } log.Printf("[DEBUG] Creating DataSync Location NFS: %s", input) @@ -117,17 +114,6 @@ func resourceAwsDataSyncLocationNfsRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("error reading DataSync Location NFS (%s): %s", d.Id(), err) } - tagsInput := &datasync.ListTagsForResourceInput{ - ResourceArn: output.LocationArn, - } - - log.Printf("[DEBUG] Reading DataSync Location NFS tags: %s", tagsInput) - tagsOutput, err := conn.ListTagsForResource(tagsInput) - - if err != nil { - return fmt.Errorf("error reading DataSync Location NFS (%s) tags: %s", d.Id(), err) - } - subdirectory, err := dataSyncParseLocationURI(aws.StringValue(output.LocationUri)) if err != nil { @@ -141,12 +127,17 @@ func resourceAwsDataSyncLocationNfsRead(d *schema.ResourceData, meta interface{} } d.Set("subdirectory", subdirectory) + d.Set("uri", output.LocationUri) - if err := d.Set("tags", flattenDataSyncTagListEntry(tagsOutput.Tags)); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags, err := keyvaluetags.DatasyncListTags(conn, d.Id()) + + if err != nil { + return fmt.Errorf("error listing tags for DataSync Location NFS (%s): %s", d.Id(), err) } - d.Set("uri", output.LocationUri) + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } @@ -155,31 +146,10 @@ func resourceAwsDataSyncLocationNfsUpdate(d *schema.ResourceData, meta interface conn := meta.(*AWSClient).datasyncconn if d.HasChange("tags") { - oldRaw, newRaw := d.GetChange("tags") - createTags, removeTags := dataSyncTagsDiff(expandDataSyncTagListEntry(oldRaw.(map[string]interface{})), expandDataSyncTagListEntry(newRaw.(map[string]interface{}))) - - if len(removeTags) > 0 { - input := &datasync.UntagResourceInput{ - Keys: dataSyncTagsKeys(removeTags), - ResourceArn: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Untagging DataSync Location NFS: %s", input) - if _, err := conn.UntagResource(input); err != nil { - return fmt.Errorf("error untagging DataSync Location NFS (%s): %s", d.Id(), err) - } - } - - if len(createTags) > 0 { - input := &datasync.TagResourceInput{ - ResourceArn: aws.String(d.Id()), - Tags: createTags, - } + o, n := d.GetChange("tags") - log.Printf("[DEBUG] Tagging DataSync Location NFS: %s", input) - if _, err := conn.TagResource(input); err != nil { - return fmt.Errorf("error tagging DataSync Location NFS (%s): %s", d.Id(), err) - } + if err := keyvaluetags.DatasyncUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating DataSync Location NFS (%s) tags: %s", d.Id(), err) } } diff --git a/aws/resource_aws_datasync_location_s3.go b/aws/resource_aws_datasync_location_s3.go index e75475687be..72203bad8f3 100644 --- a/aws/resource_aws_datasync_location_s3.go +++ b/aws/resource_aws_datasync_location_s3.go @@ -4,11 +4,14 @@ import ( "fmt" "log" "strings" + "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/datasync" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDataSyncLocationS3() *schema.Resource { @@ -63,11 +66,7 @@ func resourceAwsDataSyncLocationS3() *schema.Resource { return false }, }, - "tags": { - Type: schema.TypeMap, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, + "tags": tagsSchema(), "uri": { Type: schema.TypeString, Computed: true, @@ -83,11 +82,39 @@ func resourceAwsDataSyncLocationS3Create(d *schema.ResourceData, meta interface{ S3BucketArn: aws.String(d.Get("s3_bucket_arn").(string)), S3Config: expandDataSyncS3Config(d.Get("s3_config").([]interface{})), Subdirectory: aws.String(d.Get("subdirectory").(string)), - Tags: expandDataSyncTagListEntry(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().DatasyncTags(), } log.Printf("[DEBUG] Creating DataSync Location S3: %s", input) - output, err := conn.CreateLocationS3(input) + + var output *datasync.CreateLocationS3Output + err := resource.Retry(2*time.Minute, func() *resource.RetryError { + var err error + output, err = conn.CreateLocationS3(input) + + // Retry for IAM eventual consistency on error: + // InvalidRequestException: Unable to assume role. Reason: Access denied when calling sts:AssumeRole + if isAWSErr(err, datasync.ErrCodeInvalidRequestException, "Unable to assume role") { + return resource.RetryableError(err) + } + + // Retry for IAM eventual consistency on error: + // InvalidRequestException: DataSync location access test failed: could not perform s3:ListObjectsV2 on bucket + if isAWSErr(err, datasync.ErrCodeInvalidRequestException, "access test failed") { + return resource.RetryableError(err) + } + + if err != nil { + return resource.NonRetryableError(err) + } + + return nil + }) + + if isResourceTimeoutError(err) { + output, err = conn.CreateLocationS3(input) + } + if err != nil { return fmt.Errorf("error creating DataSync Location S3: %s", err) } @@ -117,17 +144,6 @@ func resourceAwsDataSyncLocationS3Read(d *schema.ResourceData, meta interface{}) return fmt.Errorf("error reading DataSync Location S3 (%s): %s", d.Id(), err) } - tagsInput := &datasync.ListTagsForResourceInput{ - ResourceArn: output.LocationArn, - } - - log.Printf("[DEBUG] Reading DataSync Location S3 tags: %s", tagsInput) - tagsOutput, err := conn.ListTagsForResource(tagsInput) - - if err != nil { - return fmt.Errorf("error reading DataSync Location S3 (%s) tags: %s", d.Id(), err) - } - subdirectory, err := dataSyncParseLocationURI(aws.StringValue(output.LocationUri)) if err != nil { @@ -141,12 +157,17 @@ func resourceAwsDataSyncLocationS3Read(d *schema.ResourceData, meta interface{}) } d.Set("subdirectory", subdirectory) + d.Set("uri", output.LocationUri) - if err := d.Set("tags", flattenDataSyncTagListEntry(tagsOutput.Tags)); err != nil { - return fmt.Errorf("error setting tags: %s", err) + tags, err := keyvaluetags.DatasyncListTags(conn, d.Id()) + + if err != nil { + return fmt.Errorf("error listing tags for DataSync Location S3 (%s): %s", d.Id(), err) } - d.Set("uri", output.LocationUri) + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } @@ -155,31 +176,10 @@ func resourceAwsDataSyncLocationS3Update(d *schema.ResourceData, meta interface{ conn := meta.(*AWSClient).datasyncconn if d.HasChange("tags") { - oldRaw, newRaw := d.GetChange("tags") - createTags, removeTags := dataSyncTagsDiff(expandDataSyncTagListEntry(oldRaw.(map[string]interface{})), expandDataSyncTagListEntry(newRaw.(map[string]interface{}))) - - if len(removeTags) > 0 { - input := &datasync.UntagResourceInput{ - Keys: dataSyncTagsKeys(removeTags), - ResourceArn: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Untagging DataSync Location S3: %s", input) - if _, err := conn.UntagResource(input); err != nil { - return fmt.Errorf("error untagging DataSync Location S3 (%s): %s", d.Id(), err) - } - } - - if len(createTags) > 0 { - input := &datasync.TagResourceInput{ - ResourceArn: aws.String(d.Id()), - Tags: createTags, - } + o, n := d.GetChange("tags") - log.Printf("[DEBUG] Tagging DataSync Location S3: %s", input) - if _, err := conn.TagResource(input); err != nil { - return fmt.Errorf("error tagging DataSync Location S3 (%s): %s", d.Id(), err) - } + if err := keyvaluetags.DatasyncUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating DataSync Location S3 (%s) tags: %s", d.Id(), err) } } diff --git a/aws/resource_aws_datasync_location_s3_test.go b/aws/resource_aws_datasync_location_s3_test.go index 242096962f6..62d7c0fa03e 100644 --- a/aws/resource_aws_datasync_location_s3_test.go +++ b/aws/resource_aws_datasync_location_s3_test.go @@ -282,6 +282,25 @@ resource "aws_iam_role" "test" { POLICY } +resource "aws_iam_role_policy" "test" { + role = aws_iam_role.test.id + policy = < "/dev/xvdc" (forces new resource) + # We expect this data source value to change due to how Storage Gateway works. + lifecycle { + ignore_changes = ["disk_id"] + } + + disk_id = "${data.aws_storagegateway_local_disk.test.id}" + gateway_arn = "${aws_storagegateway_gateway.test.arn}" +} + +resource "aws_storagegateway_smb_file_share" "test" { + # Use GuestAccess to simplify testing + authentication = "GuestAccess" + gateway_arn = "${aws_storagegateway_gateway.test.arn}" + location_arn = "${aws_s3_bucket.test.arn}" + role_arn = "${aws_iam_role.test.arn}" + + # I'm not super sure why this depends_on sadness is required in + # the test framework but not the binary so... yolo! + depends_on = ["aws_storagegateway_cache.test"] +} + +resource "aws_instance" "test_datasync" { + depends_on = ["aws_internet_gateway.test"] + + ami = "${data.aws_ami.aws_datasync.id}" + associate_public_ip_address = true + + instance_type = "c5.large" + vpc_security_group_ids = ["${aws_security_group.test.id}"] + subnet_id = "${aws_subnet.test.id}" + + tags = { + Name = "tf-acc-test-datasync-smb" + } +} + +resource "aws_datasync_agent" "test" { + ip_address = "${aws_instance.test_datasync.public_ip}" + name = "datasyncsmb-%s" +} +`, gatewayUid, gatewayUid) +} + +func testAccAWSDataSyncLocationSmbConfig() string { + return testAccAWSDataSyncLocationSmbConfigBase() + fmt.Sprintf(` +resource "aws_datasync_location_smb" "test" { + user = "Guest" + password = "ZaphodBeeblebroxPW" + subdirectory = "/${aws_s3_bucket.test.id}/" + + server_hostname = "${aws_instance.test_datasync.public_ip}" + agent_arns = ["${aws_datasync_agent.test.arn}"] +} +`) +} + +func testAccAWSDataSyncLocationSmbConfigTags1(key1, value1 string) string { + return testAccAWSDataSyncLocationSmbConfigBase() + fmt.Sprintf(` +resource "aws_datasync_location_smb" "test" { + user = "Guest" + password = "ZaphodBeeblebroxPW" + subdirectory = "/${aws_s3_bucket.test.id}/" + + server_hostname = "${aws_instance.test_datasync.public_ip}" + agent_arns = ["${aws_datasync_agent.test.arn}"] + + tags = { + %q = %q + } +} +`, key1, value1) +} + +func testAccAWSDataSyncLocationSmbConfigTags2(key1, value1, key2, value2 string) string { + return testAccAWSDataSyncLocationSmbConfigBase() + fmt.Sprintf(` +resource "aws_datasync_location_smb" "test" { + user = "Guest" + password = "ZaphodBeeblebroxPW" + subdirectory = "/${aws_s3_bucket.test.id}/" + + server_hostname = "${aws_instance.test_datasync.public_ip}" + agent_arns = ["${aws_datasync_agent.test.arn}"] + + tags = { + %q = %q + %q = %q + } +} +`, key1, value1, key2, value2) +} diff --git a/aws/resource_aws_datasync_task.go b/aws/resource_aws_datasync_task.go index 8ec9e5f3387..a36d73385c1 100644 --- a/aws/resource_aws_datasync_task.go +++ b/aws/resource_aws_datasync_task.go @@ -5,12 +5,12 @@ import ( "log" "time" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/datasync" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDataSyncTask() *schema.Resource { @@ -99,7 +99,6 @@ func resourceAwsDataSyncTask() *schema.Resource { Optional: true, Default: datasync.PosixPermissionsPreserve, ValidateFunc: validation.StringInSlice([]string{ - datasync.PosixPermissionsBestEffort, datasync.PosixPermissionsNone, datasync.PosixPermissionsPreserve, }, false), @@ -151,11 +150,7 @@ func resourceAwsDataSyncTask() *schema.Resource { ForceNew: true, ValidateFunc: validation.NoZeroValues, }, - "tags": { - Type: schema.TypeMap, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, + "tags": tagsSchema(), }, } } @@ -167,7 +162,7 @@ func resourceAwsDataSyncTaskCreate(d *schema.ResourceData, meta interface{}) err DestinationLocationArn: aws.String(d.Get("destination_location_arn").(string)), Options: expandDataSyncOptions(d.Get("options").([]interface{})), SourceLocationArn: aws.String(d.Get("source_location_arn").(string)), - Tags: expandDataSyncTagListEntry(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().DatasyncTags(), } if v, ok := d.GetOk("cloudwatch_log_group_arn"); ok { @@ -254,17 +249,6 @@ func resourceAwsDataSyncTaskRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("error reading DataSync Task (%s): %s", d.Id(), err) } - tagsInput := &datasync.ListTagsForResourceInput{ - ResourceArn: output.TaskArn, - } - - log.Printf("[DEBUG] Reading DataSync Task tags: %s", tagsInput) - tagsOutput, err := conn.ListTagsForResource(tagsInput) - - if err != nil { - return fmt.Errorf("error reading DataSync Task (%s) tags: %s", d.Id(), err) - } - d.Set("arn", output.TaskArn) d.Set("cloudwatch_log_group_arn", output.CloudWatchLogGroupArn) d.Set("destination_location_arn", output.DestinationLocationArn) @@ -276,7 +260,13 @@ func resourceAwsDataSyncTaskRead(d *schema.ResourceData, meta interface{}) error d.Set("source_location_arn", output.SourceLocationArn) - if err := d.Set("tags", flattenDataSyncTagListEntry(tagsOutput.Tags)); err != nil { + tags, err := keyvaluetags.DatasyncListTags(conn, d.Id()) + + if err != nil { + return fmt.Errorf("error listing tags for DataSync Task (%s): %s", d.Id(), err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -300,31 +290,10 @@ func resourceAwsDataSyncTaskUpdate(d *schema.ResourceData, meta interface{}) err } if d.HasChange("tags") { - oldRaw, newRaw := d.GetChange("tags") - createTags, removeTags := dataSyncTagsDiff(expandDataSyncTagListEntry(oldRaw.(map[string]interface{})), expandDataSyncTagListEntry(newRaw.(map[string]interface{}))) - - if len(removeTags) > 0 { - input := &datasync.UntagResourceInput{ - Keys: dataSyncTagsKeys(removeTags), - ResourceArn: aws.String(d.Id()), - } - - log.Printf("[DEBUG] Untagging DataSync Task: %s", input) - if _, err := conn.UntagResource(input); err != nil { - return fmt.Errorf("error untagging DataSync Task (%s): %s", d.Id(), err) - } - } - - if len(createTags) > 0 { - input := &datasync.TagResourceInput{ - ResourceArn: aws.String(d.Id()), - Tags: createTags, - } + o, n := d.GetChange("tags") - log.Printf("[DEBUG] Tagging DataSync Task: %s", input) - if _, err := conn.TagResource(input); err != nil { - return fmt.Errorf("error tagging DataSync Task (%s): %s", d.Id(), err) - } + if err := keyvaluetags.DatasyncUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating DataSync Task (%s) tags: %s", d.Id(), err) } } diff --git a/aws/resource_aws_datasync_task_test.go b/aws/resource_aws_datasync_task_test.go index c626641531d..d1471807c44 100644 --- a/aws/resource_aws_datasync_task_test.go +++ b/aws/resource_aws_datasync_task_test.go @@ -630,6 +630,25 @@ resource "aws_s3_bucket" "destination" { force_destroy = true } +resource "aws_iam_role_policy" "destination" { + role = aws_iam_role.destination.id + policy = < 0 { - dt = resp.Tags + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - d.Set("tags", tagsToMapDax(dt)) return nil } @@ -349,8 +345,12 @@ func resourceAwsDaxClusterRead(d *schema.ResourceData, meta interface{}) error { func resourceAwsDaxClusterUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).daxconn - if err := setTagsDax(conn, d, d.Get("arn").(string)); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.DaxUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating DAX Cluster (%s) tags: %s", d.Get("arn").(string), err) + } } req := &dax.UpdateClusterInput{ diff --git a/aws/resource_aws_dax_cluster_test.go b/aws/resource_aws_dax_cluster_test.go index 0b26b7aff47..eb86c61d625 100644 --- a/aws/resource_aws_dax_cluster_test.go +++ b/aws/resource_aws_dax_cluster_test.go @@ -58,32 +58,11 @@ func testSweepDAXClusters(region string) error { return nil } -func TestAccAWSDAXCluster_importBasic(t *testing.T) { - resourceName := "aws_dax_cluster.test" - rString := acctest.RandString(10) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDax(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSDAXClusterDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSDAXClusterConfig(rString), - }, - - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func TestAccAWSDAXCluster_basic(t *testing.T) { var dc dax.Cluster rString := acctest.RandString(10) iamRoleResourceName := "aws_iam_role.test" + resourceName := "aws_dax_cluster.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDax(t) }, @@ -93,37 +72,42 @@ func TestAccAWSDAXCluster_basic(t *testing.T) { { Config: testAccAWSDAXClusterConfig(rString), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDAXClusterExists("aws_dax_cluster.test", &dc), - testAccMatchResourceAttrRegionalARN("aws_dax_cluster.test", "arn", "dax", regexp.MustCompile("cache/.+")), + testAccCheckAWSDAXClusterExists(resourceName, &dc), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "dax", regexp.MustCompile("cache/.+")), resource.TestMatchResourceAttr( - "aws_dax_cluster.test", "cluster_name", regexp.MustCompile(`^tf-\w+$`)), - resource.TestCheckResourceAttrPair("aws_dax_cluster.test", "iam_role_arn", iamRoleResourceName, "arn"), + resourceName, "cluster_name", regexp.MustCompile(`^tf-\w+$`)), + resource.TestCheckResourceAttrPair(resourceName, "iam_role_arn", iamRoleResourceName, "arn"), resource.TestCheckResourceAttr( - "aws_dax_cluster.test", "node_type", "dax.t2.small"), + resourceName, "node_type", "dax.t2.small"), resource.TestCheckResourceAttr( - "aws_dax_cluster.test", "replication_factor", "1"), + resourceName, "replication_factor", "1"), resource.TestCheckResourceAttr( - "aws_dax_cluster.test", "description", "test cluster"), + resourceName, "description", "test cluster"), resource.TestMatchResourceAttr( - "aws_dax_cluster.test", "parameter_group_name", regexp.MustCompile(`^default.dax`)), + resourceName, "parameter_group_name", regexp.MustCompile(`^default.dax`)), resource.TestMatchResourceAttr( - "aws_dax_cluster.test", "maintenance_window", regexp.MustCompile(`^\w{3}:\d{2}:\d{2}-\w{3}:\d{2}:\d{2}$`)), + resourceName, "maintenance_window", regexp.MustCompile(`^\w{3}:\d{2}:\d{2}-\w{3}:\d{2}:\d{2}$`)), resource.TestCheckResourceAttr( - "aws_dax_cluster.test", "subnet_group_name", "default"), + resourceName, "subnet_group_name", "default"), resource.TestMatchResourceAttr( - "aws_dax_cluster.test", "nodes.0.id", regexp.MustCompile(`^tf-[\w-]+$`)), + resourceName, "nodes.0.id", regexp.MustCompile(`^tf-[\w-]+$`)), resource.TestMatchResourceAttr( - "aws_dax_cluster.test", "configuration_endpoint", regexp.MustCompile(`:\d+$`)), + resourceName, "configuration_endpoint", regexp.MustCompile(`:\d+$`)), resource.TestCheckResourceAttrSet( - "aws_dax_cluster.test", "cluster_address"), + resourceName, "cluster_address"), resource.TestMatchResourceAttr( - "aws_dax_cluster.test", "port", regexp.MustCompile(`^\d+$`)), + resourceName, "port", regexp.MustCompile(`^\d+$`)), resource.TestCheckResourceAttr( - "aws_dax_cluster.test", "server_side_encryption.#", "1"), + resourceName, "server_side_encryption.#", "1"), resource.TestCheckResourceAttr( - "aws_dax_cluster.test", "server_side_encryption.0.enabled", "false"), + resourceName, "server_side_encryption.0.enabled", "false"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -131,6 +115,8 @@ func TestAccAWSDAXCluster_basic(t *testing.T) { func TestAccAWSDAXCluster_resize(t *testing.T) { var dc dax.Cluster rString := acctest.RandString(10) + resourceName := "aws_dax_cluster.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDax(t) }, Providers: testAccProviders, @@ -139,25 +125,30 @@ func TestAccAWSDAXCluster_resize(t *testing.T) { { Config: testAccAWSDAXClusterConfigResize_singleNode(rString), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDAXClusterExists("aws_dax_cluster.test", &dc), + testAccCheckAWSDAXClusterExists(resourceName, &dc), resource.TestCheckResourceAttr( - "aws_dax_cluster.test", "replication_factor", "1"), + resourceName, "replication_factor", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSDAXClusterConfigResize_multiNode(rString), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDAXClusterExists("aws_dax_cluster.test", &dc), + testAccCheckAWSDAXClusterExists(resourceName, &dc), resource.TestCheckResourceAttr( - "aws_dax_cluster.test", "replication_factor", "2"), + resourceName, "replication_factor", "2"), ), }, { Config: testAccAWSDAXClusterConfigResize_singleNode(rString), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDAXClusterExists("aws_dax_cluster.test", &dc), + testAccCheckAWSDAXClusterExists(resourceName, &dc), resource.TestCheckResourceAttr( - "aws_dax_cluster.test", "replication_factor", "1"), + resourceName, "replication_factor", "1"), ), }, }, @@ -167,6 +158,8 @@ func TestAccAWSDAXCluster_resize(t *testing.T) { func TestAccAWSDAXCluster_encryption_disabled(t *testing.T) { var dc dax.Cluster rString := acctest.RandString(10) + resourceName := "aws_dax_cluster.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDax(t) }, Providers: testAccProviders, @@ -175,11 +168,16 @@ func TestAccAWSDAXCluster_encryption_disabled(t *testing.T) { { Config: testAccAWSDAXClusterConfigWithEncryption(rString, false), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDAXClusterExists("aws_dax_cluster.test", &dc), - resource.TestCheckResourceAttr("aws_dax_cluster.test", "server_side_encryption.#", "1"), - resource.TestCheckResourceAttr("aws_dax_cluster.test", "server_side_encryption.0.enabled", "false"), + testAccCheckAWSDAXClusterExists(resourceName, &dc), + resource.TestCheckResourceAttr(resourceName, "server_side_encryption.#", "1"), + resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.enabled", "false"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, // Ensure it shows no difference when removing server_side_encryption configuration { Config: testAccAWSDAXClusterConfig(rString), @@ -193,6 +191,8 @@ func TestAccAWSDAXCluster_encryption_disabled(t *testing.T) { func TestAccAWSDAXCluster_encryption_enabled(t *testing.T) { var dc dax.Cluster rString := acctest.RandString(10) + resourceName := "aws_dax_cluster.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDax(t) }, Providers: testAccProviders, @@ -201,11 +201,16 @@ func TestAccAWSDAXCluster_encryption_enabled(t *testing.T) { { Config: testAccAWSDAXClusterConfigWithEncryption(rString, true), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDAXClusterExists("aws_dax_cluster.test", &dc), - resource.TestCheckResourceAttr("aws_dax_cluster.test", "server_side_encryption.#", "1"), - resource.TestCheckResourceAttr("aws_dax_cluster.test", "server_side_encryption.0.enabled", "true"), + testAccCheckAWSDAXClusterExists(resourceName, &dc), + resource.TestCheckResourceAttr(resourceName, "server_side_encryption.#", "1"), + resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.enabled", "true"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, // Ensure it shows a difference when removing server_side_encryption configuration { Config: testAccAWSDAXClusterConfig(rString), diff --git a/aws/resource_aws_dax_parameter_group_test.go b/aws/resource_aws_dax_parameter_group_test.go index a65aa5f75cb..5d6619bc573 100644 --- a/aws/resource_aws_dax_parameter_group_test.go +++ b/aws/resource_aws_dax_parameter_group_test.go @@ -12,31 +12,6 @@ import ( ) func TestAccAwsDaxParameterGroup_basic(t *testing.T) { - rName := acctest.RandomWithPrefix("tf-acc-test") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDax(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAwsDaxParameterGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccDaxParameterGroupConfig(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDaxParameterGroupExists("aws_dax_parameter_group.test"), - resource.TestCheckResourceAttr("aws_dax_parameter_group.test", "parameters.#", "2"), - ), - }, - { - Config: testAccDaxParameterGroupConfig_parameters(rName), - Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDaxParameterGroupExists("aws_dax_parameter_group.test"), - resource.TestCheckResourceAttr("aws_dax_parameter_group.test", "parameters.#", "2"), - ), - }, - }, - }) -} - -func TestAccAwsDaxParameterGroup_import(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_dax_parameter_group.test" @@ -47,13 +22,23 @@ func TestAccAwsDaxParameterGroup_import(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccDaxParameterGroupConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsDaxParameterGroupExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "parameters.#", "2"), + ), }, - { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, + { + Config: testAccDaxParameterGroupConfig_parameters(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsDaxParameterGroupExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "parameters.#", "2"), + ), + }, }, }) } diff --git a/aws/resource_aws_db_cluster_snapshot.go b/aws/resource_aws_db_cluster_snapshot.go index ef6eed9a098..8a0d1d82deb 100644 --- a/aws/resource_aws_db_cluster_snapshot.go +++ b/aws/resource_aws_db_cluster_snapshot.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDbClusterSnapshot() *schema.Resource { @@ -16,6 +17,7 @@ func resourceAwsDbClusterSnapshot() *schema.Resource { Create: resourceAwsDbClusterSnapshotCreate, Read: resourceAwsDbClusterSnapshotRead, Delete: resourceAwsDbClusterSnapshotDelete, + Update: resourceAwsdbClusterSnapshotUpdate, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, }, @@ -89,6 +91,7 @@ func resourceAwsDbClusterSnapshot() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "tags": tagsSchema(), }, } } @@ -99,6 +102,7 @@ func resourceAwsDbClusterSnapshotCreate(d *schema.ResourceData, meta interface{} params := &rds.CreateDBClusterSnapshotInput{ DBClusterIdentifier: aws.String(d.Get("db_cluster_identifier").(string)), DBClusterSnapshotIdentifier: aws.String(d.Get("db_cluster_snapshot_identifier").(string)), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags(), } _, err := conn.CreateDBClusterSnapshot(params) @@ -167,6 +171,32 @@ func resourceAwsDbClusterSnapshotRead(d *schema.ResourceData, meta interface{}) d.Set("storage_encrypted", snapshot.StorageEncrypted) d.Set("vpc_id", snapshot.VpcId) + tags, err := keyvaluetags.RdsListTags(conn, d.Get("db_cluster_snapshot_arn").(string)) + + if err != nil { + return fmt.Errorf("error listing tags for RDS DB Cluster Snapshot (%s): %s", d.Get("db_cluster_snapshot_arn").(string), err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + return nil +} + +func resourceAwsdbClusterSnapshotUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).rdsconn + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.RdsUpdateTags(conn, d.Get("db_cluster_snapshot_arn").(string), o, n); err != nil { + return fmt.Errorf("error updating RDS DB Cluster Snapshot (%s) tags: %s", d.Get("db_cluster_snapshot_arn").(string), err) + } + + d.SetPartial("tags") + } + return nil } diff --git a/aws/resource_aws_db_cluster_snapshot_test.go b/aws/resource_aws_db_cluster_snapshot_test.go index b101cd9a08a..fbb6f4cefda 100644 --- a/aws/resource_aws_db_cluster_snapshot_test.go +++ b/aws/resource_aws_db_cluster_snapshot_test.go @@ -39,6 +39,7 @@ func TestAccAWSDBClusterSnapshot_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "status", "available"), resource.TestCheckResourceAttr(resourceName, "storage_encrypted", "false"), resource.TestMatchResourceAttr(resourceName, "vpc_id", regexp.MustCompile(`^vpc-.+`)), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -50,6 +51,57 @@ func TestAccAWSDBClusterSnapshot_basic(t *testing.T) { }) } +func TestAccAWSDBClusterSnapshot_Tags(t *testing.T) { + var dbClusterSnapshot rds.DBClusterSnapshot + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_db_cluster_snapshot.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckDbClusterSnapshotDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsDbClusterSnapshotConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckDbClusterSnapshotExists(resourceName, &dbClusterSnapshot), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "apply_immediately", + "cluster_identifier_prefix", + "master_password", + "skip_final_snapshot", + "snapshot_identifier", + }, + }, + { + Config: testAccAwsDbClusterSnapshotConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckDbClusterSnapshotExists(resourceName, &dbClusterSnapshot), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAwsDbClusterSnapshotConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckDbClusterSnapshotExists(resourceName, &dbClusterSnapshot), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func testAccCheckDbClusterSnapshotDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).rdsconn @@ -153,3 +205,98 @@ resource "aws_db_cluster_snapshot" "test" { } `, rName, rName, rName, rName, rName) } + +func testAccAwsDbClusterSnapshotConfigTags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "available" {} + +resource "aws_vpc" "test" { + cidr_block = "192.168.0.0/16" + + tags = { + Name = %q + } +} + +resource "aws_subnet" "test" { + count = 2 + + availability_zone = "${data.aws_availability_zones.available.names[count.index]}" + cidr_block = "192.168.${count.index}.0/24" + vpc_id = "${aws_vpc.test.id}" + + tags = { + Name = %q + } +} + +resource "aws_db_subnet_group" "test" { + name = %q + subnet_ids = ["${aws_subnet.test.*.id[0]}", "${aws_subnet.test.*.id[1]}"] +} + +resource "aws_rds_cluster" "test" { + cluster_identifier = %q + db_subnet_group_name = "${aws_db_subnet_group.test.name}" + master_password = "barbarbarbar" + master_username = "foo" + skip_final_snapshot = true +} + +resource "aws_db_cluster_snapshot" "test" { + db_cluster_identifier = "${aws_rds_cluster.test.id}" + db_cluster_snapshot_identifier = %q + tags = { + %q = %q + } +} +`, rName, rName, rName, rName, rName, tagKey1, tagValue1) +} + +func testAccAwsDbClusterSnapshotConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "available" {} + +resource "aws_vpc" "test" { + cidr_block = "192.168.0.0/16" + + tags = { + Name = %q + } +} + +resource "aws_subnet" "test" { + count = 2 + + availability_zone = "${data.aws_availability_zones.available.names[count.index]}" + cidr_block = "192.168.${count.index}.0/24" + vpc_id = "${aws_vpc.test.id}" + + tags = { + Name = %q + } +} + +resource "aws_db_subnet_group" "test" { + name = %q + subnet_ids = ["${aws_subnet.test.*.id[0]}", "${aws_subnet.test.*.id[1]}"] +} + +resource "aws_rds_cluster" "test" { + cluster_identifier = %q + db_subnet_group_name = "${aws_db_subnet_group.test.name}" + master_password = "barbarbarbar" + master_username = "foo" + skip_final_snapshot = true +} + +resource "aws_db_cluster_snapshot" "test" { + db_cluster_identifier = "${aws_rds_cluster.test.id}" + db_cluster_snapshot_identifier = %q + tags = { + %q = %q + %q = %q + } +} +`, rName, rName, rName, rName, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} diff --git a/aws/resource_aws_db_event_subscription.go b/aws/resource_aws_db_event_subscription.go index e8f30a824a8..bcb8b1840cc 100644 --- a/aws/resource_aws_db_event_subscription.go +++ b/aws/resource_aws_db_event_subscription.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDbEventSubscription() *schema.Resource { @@ -92,7 +93,7 @@ func resourceAwsDbEventSubscriptionCreate(d *schema.ResourceData, meta interface name = resource.UniqueId() } - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags() sourceIdsSet := d.Get("source_ids").(*schema.Set) sourceIds := make([]*string, sourceIdsSet.Len()) @@ -125,10 +126,6 @@ func resourceAwsDbEventSubscriptionCreate(d *schema.ResourceData, meta interface d.SetId(aws.StringValue(output.EventSubscription.CustSubscriptionId)) - if err := setTagsRDS(conn, d, aws.StringValue(output.EventSubscription.EventSubscriptionArn)); err != nil { - return fmt.Errorf("Error creating RDS Event Subscription (%s) tags: %s", d.Id(), err) - } - log.Println( "[INFO] Waiting for RDS Event Subscription to be ready") @@ -194,20 +191,13 @@ func resourceAwsDbEventSubscriptionRead(d *schema.ResourceData, meta interface{} return err } - // list tags for resource - resp, err := conn.ListTagsForResource(&rds.ListTagsForResourceInput{ - ResourceName: sub.EventSubscriptionArn, - }) + tags, err := keyvaluetags.RdsListTags(conn, d.Get("arn").(string)) if err != nil { - log.Printf("[DEBUG] Error retrieving tags for ARN: %s", aws.StringValue(sub.EventSubscriptionArn)) + return fmt.Errorf("error listing tags for RDS Event Subscription (%s): %s", d.Get("arn").(string), err) } - var dt []*rds.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList - } - if err := d.Set("tags", tagsToMapRDS(dt)); err != nil { + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -309,9 +299,13 @@ func resourceAwsDbEventSubscriptionUpdate(d *schema.ResourceData, meta interface d.SetPartial("source_type") } - if err := setTagsRDS(conn, d, d.Get("arn").(string)); err != nil { - return err - } else { + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.RdsUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating RDS Event Subscription (%s) tags: %s", d.Get("arn").(string), err) + } + d.SetPartial("tags") } diff --git a/aws/resource_aws_db_event_subscription_test.go b/aws/resource_aws_db_event_subscription_test.go index a8643a3c4f5..102b68c7d47 100644 --- a/aws/resource_aws_db_event_subscription_test.go +++ b/aws/resource_aws_db_event_subscription_test.go @@ -13,9 +13,10 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSDBEventSubscription_importBasic(t *testing.T) { - resourceName := "aws_db_event_subscription.bar" +func TestAccAWSDBEventSubscription_basicUpdate(t *testing.T) { + var v rds.EventSubscription rInt := acctest.RandInt() + resourceName := "aws_db_event_subscription.test" subscriptionName := fmt.Sprintf("tf-acc-test-rds-event-subs-%d", rInt) resource.ParallelTest(t, resource.TestCase{ @@ -25,48 +26,30 @@ func TestAccAWSDBEventSubscription_importBasic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccAWSDBEventSubscriptionConfig(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSDBEventSubscriptionExists(resourceName, &v), + resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:rds:[^:]+:[^:]+:es:%s$", subscriptionName))), + resource.TestCheckResourceAttr(resourceName, "enabled", "true"), + resource.TestCheckResourceAttr(resourceName, "source_type", "db-instance"), + resource.TestCheckResourceAttr(resourceName, "name", subscriptionName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", "name"), + ), }, - { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateId: subscriptionName, }, - }, - }) -} - -func TestAccAWSDBEventSubscription_basicUpdate(t *testing.T) { - var v rds.EventSubscription - rInt := acctest.RandInt() - rName := fmt.Sprintf("tf-acc-test-rds-event-subs-%d", rInt) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSDBEventSubscriptionDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSDBEventSubscriptionConfig(rInt), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBEventSubscriptionExists("aws_db_event_subscription.bar", &v), - resource.TestMatchResourceAttr("aws_db_event_subscription.bar", "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:rds:[^:]+:[^:]+:es:%s$", rName))), - resource.TestCheckResourceAttr("aws_db_event_subscription.bar", "enabled", "true"), - resource.TestCheckResourceAttr("aws_db_event_subscription.bar", "source_type", "db-instance"), - resource.TestCheckResourceAttr("aws_db_event_subscription.bar", "name", rName), - resource.TestCheckResourceAttr("aws_db_event_subscription.bar", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_db_event_subscription.bar", "tags.Name", "name"), - ), - }, { Config: testAccAWSDBEventSubscriptionConfigUpdate(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBEventSubscriptionExists("aws_db_event_subscription.bar", &v), - resource.TestCheckResourceAttr("aws_db_event_subscription.bar", "enabled", "false"), - resource.TestCheckResourceAttr("aws_db_event_subscription.bar", "source_type", "db-parameter-group"), - resource.TestCheckResourceAttr("aws_db_event_subscription.bar", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_db_event_subscription.bar", "tags.Name", "new-name"), + testAccCheckAWSDBEventSubscriptionExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "source_type", "db-parameter-group"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", "new-name"), ), }, }, @@ -76,7 +59,7 @@ func TestAccAWSDBEventSubscription_basicUpdate(t *testing.T) { func TestAccAWSDBEventSubscription_disappears(t *testing.T) { var eventSubscription rds.EventSubscription rInt := acctest.RandInt() - resourceName := "aws_db_event_subscription.bar" + resourceName := "aws_db_event_subscription.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -99,6 +82,7 @@ func TestAccAWSDBEventSubscription_withPrefix(t *testing.T) { var v rds.EventSubscription rInt := acctest.RandInt() startsWithPrefix := regexp.MustCompile("^tf-acc-test-rds-event-subs-") + resourceName := "aws_db_event_subscription.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -108,15 +92,15 @@ func TestAccAWSDBEventSubscription_withPrefix(t *testing.T) { { Config: testAccAWSDBEventSubscriptionConfigWithPrefix(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBEventSubscriptionExists("aws_db_event_subscription.bar", &v), + testAccCheckAWSDBEventSubscriptionExists(resourceName, &v), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "enabled", "true"), + resourceName, "enabled", "true"), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "source_type", "db-instance"), + resourceName, "source_type", "db-instance"), resource.TestMatchResourceAttr( - "aws_db_event_subscription.bar", "name", startsWithPrefix), + resourceName, "name", startsWithPrefix), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "tags.Name", "name"), + resourceName, "tags.Name", "name"), ), }, }, @@ -126,6 +110,8 @@ func TestAccAWSDBEventSubscription_withPrefix(t *testing.T) { func TestAccAWSDBEventSubscription_withSourceIds(t *testing.T) { var v rds.EventSubscription rInt := acctest.RandInt() + resourceName := "aws_db_event_subscription.test" + subscriptionName := fmt.Sprintf("tf-acc-test-rds-event-subs-with-ids-%d", rInt) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -135,29 +121,35 @@ func TestAccAWSDBEventSubscription_withSourceIds(t *testing.T) { { Config: testAccAWSDBEventSubscriptionConfigWithSourceIds(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBEventSubscriptionExists("aws_db_event_subscription.bar", &v), + testAccCheckAWSDBEventSubscriptionExists(resourceName, &v), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "enabled", "true"), + resourceName, "enabled", "true"), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "source_type", "db-parameter-group"), + resourceName, "source_type", "db-parameter-group"), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "name", fmt.Sprintf("tf-acc-test-rds-event-subs-with-ids-%d", rInt)), + resourceName, "name", fmt.Sprintf("tf-acc-test-rds-event-subs-with-ids-%d", rInt)), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "source_ids.#", "1"), + resourceName, "source_ids.#", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateId: subscriptionName, + }, { Config: testAccAWSDBEventSubscriptionConfigUpdateSourceIds(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBEventSubscriptionExists("aws_db_event_subscription.bar", &v), + testAccCheckAWSDBEventSubscriptionExists(resourceName, &v), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "enabled", "true"), + resourceName, "enabled", "true"), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "source_type", "db-parameter-group"), + resourceName, "source_type", "db-parameter-group"), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "name", fmt.Sprintf("tf-acc-test-rds-event-subs-with-ids-%d", rInt)), + resourceName, "name", fmt.Sprintf("tf-acc-test-rds-event-subs-with-ids-%d", rInt)), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "source_ids.#", "2"), + resourceName, "source_ids.#", "2"), ), }, }, @@ -167,6 +159,8 @@ func TestAccAWSDBEventSubscription_withSourceIds(t *testing.T) { func TestAccAWSDBEventSubscription_categoryUpdate(t *testing.T) { var v rds.EventSubscription rInt := acctest.RandInt() + resourceName := "aws_db_event_subscription.test" + subscriptionName := fmt.Sprintf("tf-acc-test-rds-event-subs-%d", rInt) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -176,23 +170,29 @@ func TestAccAWSDBEventSubscription_categoryUpdate(t *testing.T) { { Config: testAccAWSDBEventSubscriptionConfig(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBEventSubscriptionExists("aws_db_event_subscription.bar", &v), + testAccCheckAWSDBEventSubscriptionExists(resourceName, &v), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "enabled", "true"), + resourceName, "enabled", "true"), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "source_type", "db-instance"), + resourceName, "source_type", "db-instance"), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "name", fmt.Sprintf("tf-acc-test-rds-event-subs-%d", rInt)), + resourceName, "name", fmt.Sprintf("tf-acc-test-rds-event-subs-%d", rInt)), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateId: subscriptionName, + }, { Config: testAccAWSDBEventSubscriptionConfigUpdateCategories(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBEventSubscriptionExists("aws_db_event_subscription.bar", &v), + testAccCheckAWSDBEventSubscriptionExists(resourceName, &v), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "enabled", "true"), + resourceName, "enabled", "true"), resource.TestCheckResourceAttr( - "aws_db_event_subscription.bar", "source_type", "db-instance"), + resourceName, "source_type", "db-instance"), ), }, }, @@ -278,7 +278,7 @@ resource "aws_sns_topic" "aws_sns_topic" { name = "tf-acc-test-rds-event-subs-sns-topic-%d" } -resource "aws_db_event_subscription" "bar" { +resource "aws_db_event_subscription" "test" { name = "tf-acc-test-rds-event-subs-%d" sns_topic = "${aws_sns_topic.aws_sns_topic.arn}" source_type = "db-instance" @@ -304,7 +304,7 @@ resource "aws_sns_topic" "aws_sns_topic" { name = "tf-acc-test-rds-event-subs-sns-topic-%d" } -resource "aws_db_event_subscription" "bar" { +resource "aws_db_event_subscription" "test" { name_prefix = "tf-acc-test-rds-event-subs-" sns_topic = "${aws_sns_topic.aws_sns_topic.arn}" source_type = "db-instance" @@ -330,7 +330,7 @@ resource "aws_sns_topic" "aws_sns_topic" { name = "tf-acc-test-rds-event-subs-sns-topic-%d" } -resource "aws_db_event_subscription" "bar" { +resource "aws_db_event_subscription" "test" { name = "tf-acc-test-rds-event-subs-%d" sns_topic = "${aws_sns_topic.aws_sns_topic.arn}" enabled = false @@ -353,17 +353,17 @@ resource "aws_sns_topic" "aws_sns_topic" { name = "tf-acc-test-rds-event-subs-sns-topic-%d" } -resource "aws_db_parameter_group" "bar" { +resource "aws_db_parameter_group" "test" { name = "db-parameter-group-event-%d" family = "mysql5.6" description = "Test parameter group for terraform" } -resource "aws_db_event_subscription" "bar" { +resource "aws_db_event_subscription" "test" { name = "tf-acc-test-rds-event-subs-with-ids-%d" sns_topic = "${aws_sns_topic.aws_sns_topic.arn}" source_type = "db-parameter-group" - source_ids = ["${aws_db_parameter_group.bar.id}"] + source_ids = ["${aws_db_parameter_group.test.id}"] event_categories = [ "configuration change", @@ -382,23 +382,23 @@ resource "aws_sns_topic" "aws_sns_topic" { name = "tf-acc-test-rds-event-subs-sns-topic-%d" } -resource "aws_db_parameter_group" "bar" { +resource "aws_db_parameter_group" "test" { name = "db-parameter-group-event-%d" family = "mysql5.6" description = "Test parameter group for terraform" } -resource "aws_db_parameter_group" "foo" { +resource "aws_db_parameter_group" "test2" { name = "db-parameter-group-event-2-%d" family = "mysql5.6" description = "Test parameter group for terraform" } -resource "aws_db_event_subscription" "bar" { +resource "aws_db_event_subscription" "test" { name = "tf-acc-test-rds-event-subs-with-ids-%d" sns_topic = "${aws_sns_topic.aws_sns_topic.arn}" source_type = "db-parameter-group" - source_ids = ["${aws_db_parameter_group.bar.id}", "${aws_db_parameter_group.foo.id}"] + source_ids = ["${aws_db_parameter_group.test.id}", "${aws_db_parameter_group.test2.id}"] event_categories = [ "configuration change", @@ -417,7 +417,7 @@ resource "aws_sns_topic" "aws_sns_topic" { name = "tf-acc-test-rds-event-subs-sns-topic-%d" } -resource "aws_db_event_subscription" "bar" { +resource "aws_db_event_subscription" "test" { name = "tf-acc-test-rds-event-subs-%d" sns_topic = "${aws_sns_topic.aws_sns_topic.arn}" source_type = "db-instance" diff --git a/aws/resource_aws_db_instance.go b/aws/resource_aws_db_instance.go index 921f2a48374..8cdfef1f3e2 100644 --- a/aws/resource_aws_db_instance.go +++ b/aws/resource_aws_db_instance.go @@ -10,10 +10,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDbInstance() *schema.Resource { @@ -26,6 +26,15 @@ func resourceAwsDbInstance() *schema.Resource { State: resourceAwsDbInstanceImport, }, + SchemaVersion: 1, + StateUpgraders: []schema.StateUpgrader{ + { + Type: resourceAwsDbInstanceResourceV0().CoreConfigSchema().ImpliedType(), + Upgrade: resourceAwsDbInstanceStateUpgradeV0, + Version: 0, + }, + }, + Timeouts: &schema.ResourceTimeout{ Create: schema.DefaultTimeout(40 * time.Minute), Update: schema.DefaultTimeout(80 * time.Minute), @@ -81,6 +90,12 @@ func resourceAwsDbInstance() *schema.Resource { DiffSuppressFunc: suppressAwsDbEngineVersionDiffs, }, + "ca_cert_identifier": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "character_set_name": { Type: schema.TypeString, Optional: true, @@ -422,17 +437,13 @@ func resourceAwsDbInstance() *schema.Resource { Computed: true, }, - "ca_cert_identifier": { - Type: schema.TypeString, - Computed: true, - }, - "enabled_cloudwatch_logs_exports": { Type: schema.TypeList, Optional: true, Elem: &schema.Schema{ Type: schema.TypeString, ValidateFunc: validation.StringInSlice([]string{ + "agent", "alert", "audit", "error", @@ -475,6 +486,12 @@ func resourceAwsDbInstance() *schema.Resource { Computed: true, }, + "delete_automated_backups": { + Type: schema.TypeBool, + Optional: true, + Default: true, + }, + "tags": tagsSchema(), }, } @@ -499,7 +516,7 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error // we expect everything to be in sync before returning completion. var requiresRebootDbInstance bool - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags() var identifier string if v, ok := d.GetOk("identifier"); ok { @@ -511,12 +528,6 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error identifier = resource.UniqueId() } - // 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) } @@ -647,6 +658,11 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error opts.PerformanceInsightsRetentionPeriod = aws.Int64(int64(attr.(int))) } + if attr, ok := d.GetOk("ca_cert_identifier"); ok { + modifyDbInstanceInput.CACertificateIdentifier = aws.String(attr.(string)) + requiresModifyDbInstance = true + } + log.Printf("[DEBUG] DB Instance Replica create configuration: %#v", opts) _, err := conn.CreateDBInstanceReadReplica(&opts) if err != nil { @@ -1043,6 +1059,7 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error 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)), @@ -1176,8 +1193,9 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error log.Printf("[DEBUG] DB Instance create configuration: %#v", opts) var err error + var createdDBInstanceOutput *rds.CreateDBInstanceOutput err = resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err = conn.CreateDBInstance(&opts) + createdDBInstanceOutput, err = conn.CreateDBInstance(&opts) if err != nil { if isAWSErr(err, "InvalidParameterValue", "ENHANCED_MONITORING") { return resource.RetryableError(err) @@ -1196,6 +1214,11 @@ func resourceAwsDbInstanceCreate(d *schema.ResourceData, meta interface{}) error } return fmt.Errorf("Error creating DB Instance: %s", err) } + // This is added here to avoid unnecessary modification when ca_cert_identifier is the default one + if attr, ok := d.GetOk("ca_cert_identifier"); ok && attr.(string) != aws.StringValue(createdDBInstanceOutput.DBInstance.CACertificateIdentifier) { + modifyDbInstanceInput.CACertificateIdentifier = aws.String(attr.(string)) + requiresModifyDbInstance = true + } } d.SetId(d.Get("identifier").(string)) @@ -1340,19 +1363,16 @@ func resourceAwsDbInstanceRead(d *schema.ResourceData, meta interface{}) error { arn := aws.StringValue(v.DBInstanceArn) d.Set("arn", arn) - resp, err := conn.ListTagsForResource(&rds.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) + + tags, err := keyvaluetags.RdsListTags(conn, d.Get("arn").(string)) if err != nil { - return fmt.Errorf("Error retrieving tags for ARN (%s): %s", arn, err) + return fmt.Errorf("error listing tags for RDS DB Instance (%s): %s", d.Get("arn").(string), err) } - var dt []*rds.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - d.Set("tags", tagsToMapRDS(dt)) // Create an empty schema.Set to hold all vpc security group ids ids := &schema.Set{ @@ -1406,6 +1426,9 @@ func resourceAwsDbInstanceDelete(d *schema.ResourceData, meta interface{}) error } } + deleteAutomatedBackups := d.Get("delete_automated_backups").(bool) + opts.DeleteAutomatedBackups = aws.Bool(deleteAutomatedBackups) + log.Printf("[DEBUG] DB Instance destroy configuration: %v", opts) _, err := conn.DeleteDBInstance(&opts) @@ -1484,6 +1507,11 @@ func resourceAwsDbInstanceUpdate(d *schema.ResourceData, meta interface{}) error req.CopyTagsToSnapshot = aws.Bool(d.Get("copy_tags_to_snapshot").(bool)) requestUpdate = true } + if d.HasChange("ca_cert_identifier") { + d.SetPartial("ca_cert_identifier") + req.CACertificateIdentifier = aws.String(d.Get("ca_cert_identifier").(string)) + requestUpdate = true + } if d.HasChange("deletion_protection") { d.SetPartial("deletion_protection") req.DeletionProtection = aws.Bool(d.Get("deletion_protection").(bool)) @@ -1695,11 +1723,13 @@ func resourceAwsDbInstanceUpdate(d *schema.ResourceData, meta interface{}) error } if d.HasChange("tags") { - if err := setTagsRDS(conn, d, d.Get("arn").(string)); err != nil { - return err - } else { - d.SetPartial("tags") + o, n := d.GetChange("tags") + + if err := keyvaluetags.RdsUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating RDS DB Instance (%s) tags: %s", d.Get("arn").(string), err) } + + d.SetPartial("tags") } d.Partial(false) @@ -1739,6 +1769,7 @@ func resourceAwsDbInstanceImport( // 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) + d.Set("delete_automated_backups", true) return []*schema.ResourceData{d}, nil } diff --git a/aws/resource_aws_db_instance_migrate.go b/aws/resource_aws_db_instance_migrate.go new file mode 100644 index 00000000000..52e5ddd28de --- /dev/null +++ b/aws/resource_aws_db_instance_migrate.go @@ -0,0 +1,384 @@ +package aws + +import ( + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func resourceAwsDbInstanceResourceV0() *schema.Resource { + return &schema.Resource{ + 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, + }, + + "deletion_protection": { + Type: schema.TypeBool, + Optional: true, + }, + + "engine": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + "engine_version": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + "ca_cert_identifier": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + "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, + ConflictsWith: []string{"identifier_prefix"}, + }, + "identifier_prefix": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + "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, + }, + + "iops": { + Type: schema.TypeInt, + Optional: true, + }, + + "license_model": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + "maintenance_window": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + "max_allocated_storage": { + Type: schema.TypeInt, + Optional: true, + }, + + "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, + }, + + "s3_import": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + ConflictsWith: []string{ + "snapshot_identifier", + "replicate_source_db", + }, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "bucket_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "bucket_prefix": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "ingestion_role": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "source_engine": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "source_engine_version": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + }, + }, + }, + + "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": { + 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, + 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, + 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, + }, + + "timezone": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + "iam_database_authentication_enabled": { + Type: schema.TypeBool, + Optional: true, + }, + + "resource_id": { + Type: schema.TypeString, + Computed: true, + }, + + "enabled_cloudwatch_logs_exports": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + + "domain": { + Type: schema.TypeString, + Optional: true, + }, + + "domain_iam_role_name": { + Type: schema.TypeString, + Optional: true, + }, + + "performance_insights_enabled": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + + "performance_insights_kms_key_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + + "performance_insights_retention_period": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + }, + + "tags": tagsSchema(), + }, + } +} + +func resourceAwsDbInstanceStateUpgradeV0(rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { + rawState["delete_automated_backups"] = true + return rawState, nil +} diff --git a/aws/resource_aws_db_instance_migrate_test.go b/aws/resource_aws_db_instance_migrate_test.go new file mode 100644 index 00000000000..2ca15fef104 --- /dev/null +++ b/aws/resource_aws_db_instance_migrate_test.go @@ -0,0 +1,44 @@ +package aws + +import ( + "reflect" + "testing" +) + +func testResourceAwsDbInstanceStateDataV0() map[string]interface{} { + return map[string]interface{}{ + "allocated_storage": 10, + "engine": "mariadb", + "identifier": "my-test-instance", + "instance_class": "db.t2.micro", + "password": "avoid-plaintext-passwords", + "username": "tfacctest", + "tags": map[string]interface{}{"key1": "value1"}, + } +} + +func testResourceAwsDbInstanceStateDataV1() map[string]interface{} { + v0 := testResourceAwsDbInstanceStateDataV0() + return map[string]interface{}{ + "allocated_storage": v0["allocated_storage"], + "delete_automated_backups": true, + "engine": v0["engine"], + "identifier": v0["identifier"], + "instance_class": v0["instance_class"], + "password": v0["password"], + "username": v0["username"], + "tags": v0["tags"], + } +} + +func TestResourceAwsDbInstanceStateUpgradeV0(t *testing.T) { + expected := testResourceAwsDbInstanceStateDataV1() + actual, err := resourceAwsDbInstanceStateUpgradeV0(testResourceAwsDbInstanceStateDataV0(), nil) + if err != nil { + t.Fatalf("error migrating state: %s", err) + } + + if !reflect.DeepEqual(expected, actual) { + t.Fatalf("\n\nexpected:\n\n%#v\n\ngot:\n\n%#v\n\n", expected, actual) + } +} diff --git a/aws/resource_aws_db_instance_role_association_test.go b/aws/resource_aws_db_instance_role_association_test.go index 731c263754e..87bd20165d1 100644 --- a/aws/resource_aws_db_instance_role_association_test.go +++ b/aws/resource_aws_db_instance_role_association_test.go @@ -179,7 +179,7 @@ resource "aws_db_instance" "test" { allocated_storage = 10 engine = "oracle-se" identifier = %[1]q - instance_class = "db.t2.micro" + instance_class = "db.t3.micro" password = "avoid-plaintext-passwords" username = "tfacctest" skip_final_snapshot = true diff --git a/aws/resource_aws_db_instance_test.go b/aws/resource_aws_db_instance_test.go index 0a1a6153c51..22819b8be8e 100644 --- a/aws/resource_aws_db_instance_test.go +++ b/aws/resource_aws_db_instance_test.go @@ -119,6 +119,7 @@ func TestAccAWSDBInstance_basic(t *testing.T) { "final_snapshot_identifier", "password", "skip_final_snapshot", + "delete_automated_backups", }, }, }, @@ -331,6 +332,7 @@ func TestAccAWSDBInstance_DeletionProtection(t *testing.T) { "final_snapshot_identifier", "password", "skip_final_snapshot", + "delete_automated_backups", }, }, { @@ -922,6 +924,33 @@ func TestAccAWSDBInstance_ReplicateSourceDb_VpcSecurityGroupIds(t *testing.T) { }) } +func TestAccAWSDBInstance_ReplicateSourceDb_CACertificateIdentifier(t *testing.T) { + var dbInstance, sourceDbInstance rds.DBInstance + + rName := acctest.RandomWithPrefix("tf-acc-test") + caName := "rds-ca-2019" + sourceResourceName := "aws_db_instance.source" + resourceName := "aws_db_instance.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSDBInstanceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSDBInstanceConfig_ReplicateSourceDb_CACertificateIdentifier(rName, caName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSDBInstanceExists(sourceResourceName, &sourceDbInstance), + testAccCheckAWSDBInstanceExists(resourceName, &dbInstance), + testAccCheckAWSDBInstanceReplicaAttributes(&sourceDbInstance, &dbInstance), + resource.TestCheckResourceAttr(sourceResourceName, "ca_cert_identifier", caName), + resource.TestCheckResourceAttr(resourceName, "ca_cert_identifier", caName), + ), + }, + }, + }) +} + func TestAccAWSDBInstance_S3Import(t *testing.T) { var snap rds.DBInstance bucket := acctest.RandomWithPrefix("tf-acc-test") @@ -1976,6 +2005,7 @@ func TestAccAWSDBInstance_cloudwatchLogsExportConfiguration(t *testing.T) { "final_snapshot_identifier", "password", "skip_final_snapshot", + "delete_automated_backups", }, }, }, @@ -2038,6 +2068,39 @@ func TestAccAWSDBInstance_cloudwatchLogsExportConfigurationUpdate(t *testing.T) }) } +func TestAccAWSDBInstance_EnabledCloudwatchLogsExports_MSSQL(t *testing.T) { + var dbInstance rds.DBInstance + + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_db_instance.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSDBInstanceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSDBInstanceConfig_EnabledCloudwatchLogsExports_MSSQL(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSDBInstanceExists(resourceName, &dbInstance), + resource.TestCheckResourceAttr(resourceName, "enabled_cloudwatch_logs_exports.#", "2"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "apply_immediately", + "final_snapshot_identifier", + "password", + "skip_final_snapshot", + }, + }, + }, + }) +} + func TestAccAWSDBInstance_EnabledCloudwatchLogsExports_Oracle(t *testing.T) { var dbInstance rds.DBInstance @@ -2065,6 +2128,7 @@ func TestAccAWSDBInstance_EnabledCloudwatchLogsExports_Oracle(t *testing.T) { "final_snapshot_identifier", "password", "skip_final_snapshot", + "delete_automated_backups", }, }, }, @@ -2098,12 +2162,68 @@ func TestAccAWSDBInstance_EnabledCloudwatchLogsExports_Postgresql(t *testing.T) "final_snapshot_identifier", "password", "skip_final_snapshot", + "delete_automated_backups", }, }, }, }) } +func TestAccAWSDBInstance_NoDeleteAutomatedBackups(t *testing.T) { + var dbInstance rds.DBInstance + + rName := acctest.RandomWithPrefix("tf-testacc-nodelautobak") + resourceName := "aws_db_instance.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSDBInstanceAutomatedBackups, + Steps: []resource.TestStep{ + { + Config: testAccAWSDBInstanceConfig_NoDeleteAutomatedBackups(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSDBInstanceExists(resourceName, &dbInstance), + ), + }, + }, + }) +} + +func testAccCheckAWSDBInstanceAutomatedBackups(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).rdsconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_db_instance" { + continue + } + + log.Printf("[INFO] Trying to locate the DBInstance Automated Backup") + describeOutput, err := conn.DescribeDBInstanceAutomatedBackups( + &rds.DescribeDBInstanceAutomatedBackupsInput{ + DBInstanceIdentifier: aws.String(rs.Primary.ID), + }) + if err != nil { + return err + } + + if describeOutput == nil || len(describeOutput.DBInstanceAutomatedBackups) == 0 { + return fmt.Errorf("Automated backup for %s not found", rs.Primary.ID) + } + + log.Printf("[INFO] Deleting automated backup for %s", rs.Primary.ID) + _, err = conn.DeleteDBInstanceAutomatedBackup( + &rds.DeleteDBInstanceAutomatedBackupInput{ + DbiResourceId: describeOutput.DBInstanceAutomatedBackups[0].DbiResourceId, + }) + if err != nil { + return err + } + } + + return testAccCheckAWSDBInstanceDestroy(s) +} + func testAccCheckAWSDBInstanceDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).rdsconn @@ -2583,6 +2703,35 @@ func TestAccAWSDBInstance_SnapshotIdentifier_PerformanceInsightsEnabled(t *testi }) } +func TestAccAWSDBInstance_CACertificateIdentifier(t *testing.T) { + var dbInstance rds.DBInstance + + resourceName := "aws_db_instance.bar" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSDBInstanceDestroy, + Steps: []resource.TestStep{ + { + Config: fmt.Sprintf(testAccAWSDBInstanceConfigWithCACertificateIdentifier, "rds-ca-2015"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSDBInstanceExists(resourceName, &dbInstance), + resource.TestCheckResourceAttr(resourceName, "ca_cert_identifier", "rds-ca-2015"), + ), + }, + // Ensure we are able to modify the CACertIdentifier + { + Config: fmt.Sprintf(testAccAWSDBInstanceConfigWithCACertificateIdentifier, "rds-ca-2019"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSDBInstanceExists(resourceName, &dbInstance), + resource.TestCheckResourceAttr(resourceName, "ca_cert_identifier", "rds-ca-2019"), + ), + }, + }, + }) +} + // Database names cannot collide, and deletion takes so long, that making the // name a bit random helps so able we can kill a test that's just waiting for a // delete and not be blocked on kicking off another one. @@ -2690,32 +2839,44 @@ resource "aws_db_instance" "bar" { } ` +const testAccAWSDBInstanceConfigWithCACertificateIdentifier = ` +resource "aws_db_instance" "bar" { + allocated_storage = 10 + engine = "MySQL" + instance_class = "db.t2.micro" + name = "baz" + password = "barbarbarbar" + username = "foo" + ca_cert_identifier = "%s" + apply_immediately = true + skip_final_snapshot = true + timeouts { + create = "30m" + } +}` + func testAccAWSDBInstanceConfigWithOptionGroup(rName string) string { return fmt.Sprintf(` -resource "aws_db_option_group" "bar" { - name = "%s" - option_group_description = "Test option group for terraform" +resource "aws_db_option_group" "test" { engine_name = "mysql" major_engine_version = "5.6" + name = %[1]q + option_group_description = "Test option group for terraform" } resource "aws_db_instance" "bar" { - identifier = "foobarbaz-test-terraform-%d" - - allocated_storage = 10 - engine = "MySQL" - instance_class = "db.t2.micro" - name = "baz" - password = "barbarbarbar" - username = "foo" - - backup_retention_period = 0 - skip_final_snapshot = true - - parameter_group_name = "default.mysql5.6" - option_group_name = "${aws_db_option_group.bar.name}" + allocated_storage = 10 + engine = aws_db_option_group.test.engine_name + engine_version = aws_db_option_group.test.major_engine_version + identifier = %[1]q + instance_class = "db.t2.micro" + name = "baz" + option_group_name = aws_db_option_group.test.name + password = "barbarbarbar" + skip_final_snapshot = true + username = "foo" } -`, rName, acctest.RandInt()) +`, rName) } func testAccCheckAWSDBIAMAuth(n int) string { @@ -4199,7 +4360,23 @@ resource "aws_db_instance" "test" { enabled_cloudwatch_logs_exports = ["alert", "listener", "trace"] engine = "oracle-se" identifier = %q - instance_class = "db.t2.micro" + instance_class = "db.t3.micro" + password = "avoid-plaintext-passwords" + username = "tfacctest" + skip_final_snapshot = true +} +`, rName) +} + +func testAccAWSDBInstanceConfig_EnabledCloudwatchLogsExports_MSSQL(rName string) string { + return fmt.Sprintf(` +resource "aws_db_instance" "test" { + allocated_storage = 20 + enabled_cloudwatch_logs_exports = ["agent", "error"] + engine = "sqlserver-se" + identifier = %q + instance_class = "db.m4.large" + license_model = "license-included" password = "avoid-plaintext-passwords" username = "tfacctest" skip_final_snapshot = true @@ -4675,6 +4852,30 @@ resource "aws_db_instance" "test" { `, rName, rName, rName) } +func testAccAWSDBInstanceConfig_ReplicateSourceDb_CACertificateIdentifier(rName string, caName string) string { + return fmt.Sprintf(` +resource "aws_db_instance" "source" { + allocated_storage = 5 + backup_retention_period = 1 + engine = "mysql" + identifier = "%s-source" + instance_class = "db.t2.micro" + password = "avoid-plaintext-passwords" + username = "tfacctest" + ca_cert_identifier = %q + skip_final_snapshot = true +} + +resource "aws_db_instance" "test" { + identifier = %q + instance_class = "${aws_db_instance.source.instance_class}" + replicate_source_db = "${aws_db_instance.source.id}" + ca_cert_identifier = %q + skip_final_snapshot = true +} +`, rName, caName, rName, caName) +} + func testAccAWSDBInstanceConfig_SnapshotIdentifier(rName string) string { return fmt.Sprintf(` resource "aws_db_instance" "source" { @@ -5553,3 +5754,20 @@ resource "aws_db_instance" "test" { } `, rName, rName, rName) } + +func testAccAWSDBInstanceConfig_NoDeleteAutomatedBackups(rName string) string { + return fmt.Sprintf(` +resource "aws_db_instance" "test" { + allocated_storage = 10 + engine = "mariadb" + identifier = "%s" + instance_class = "db.t2.micro" + password = "avoid-plaintext-passwords" + username = "tfacctest" + skip_final_snapshot = true + + backup_retention_period = 1 + delete_automated_backups = false +} +`, rName) +} diff --git a/aws/resource_aws_db_option_group.go b/aws/resource_aws_db_option_group.go index 8e394954788..53d8376f5a0 100644 --- a/aws/resource_aws_db_option_group.go +++ b/aws/resource_aws_db_option_group.go @@ -9,10 +9,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDbOptionGroup() *schema.Resource { @@ -124,7 +124,7 @@ func resourceAwsDbOptionGroup() *schema.Resource { func resourceAwsDbOptionGroupCreate(d *schema.ResourceData, meta interface{}) error { rdsconn := meta.(*AWSClient).rdsconn - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags() var groupName string if v, ok := d.GetOk("name"); ok { @@ -201,15 +201,13 @@ func resourceAwsDbOptionGroupRead(d *schema.ResourceData, meta interface{}) erro return fmt.Errorf("error setting option: %s", err) } - resp, err := rdsconn.ListTagsForResource(&rds.ListTagsForResourceInput{ - ResourceName: option.OptionGroupArn, - }) + tags, err := keyvaluetags.RdsListTags(rdsconn, d.Get("arn").(string)) if err != nil { - return fmt.Errorf("error listing tags for RDS Option Group (%s): %s", d.Id(), err) + return fmt.Errorf("error listing tags for RDS Option Group (%s): %s", d.Get("arn").(string), err) } - if err := d.Set("tags", tagsToMapRDS(resp.TagList)); err != nil { + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -291,9 +289,13 @@ func resourceAwsDbOptionGroupUpdate(d *schema.ResourceData, meta interface{}) er } } - if err := setTagsRDS(rdsconn, d, d.Get("arn").(string)); err != nil { - return err - } else { + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.RdsUpdateTags(rdsconn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating RDS Option Group (%s) tags: %s", d.Get("arn").(string), err) + } + d.SetPartial("tags") } @@ -312,7 +314,7 @@ func resourceAwsDbOptionGroupDelete(d *schema.ResourceData, meta interface{}) er _, err := rdsconn.DeleteOptionGroup(deleteOpts) if err != nil { if isAWSErr(err, rds.ErrCodeInvalidOptionGroupStateFault, "") { - log.Printf("[DEBUG] AWS believes the RDS Option Group is still in use, retrying") + log.Printf(`[DEBUG] AWS believes the RDS Option Group is still in use, this could be because of a internal snapshot create by AWS, see github issue #4597 for more info. retrying...`) return resource.RetryableError(err) } return resource.NonRetryableError(err) diff --git a/aws/resource_aws_db_parameter_group.go b/aws/resource_aws_db_parameter_group.go index abbf58ebe2a..d553efd4c78 100644 --- a/aws/resource_aws_db_parameter_group.go +++ b/aws/resource_aws_db_parameter_group.go @@ -7,12 +7,12 @@ import ( "strings" "time" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/rds" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDbParameterGroup() *schema.Resource { @@ -88,7 +88,7 @@ func resourceAwsDbParameterGroup() *schema.Resource { func resourceAwsDbParameterGroupCreate(d *schema.ResourceData, meta interface{}) error { rdsconn := meta.(*AWSClient).rdsconn - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags() var groupName string if v, ok := d.GetOk("name"); ok { @@ -230,19 +230,15 @@ func resourceAwsDbParameterGroupRead(d *schema.ResourceData, meta interface{}) e arn := aws.StringValue(describeResp.DBParameterGroups[0].DBParameterGroupArn) d.Set("arn", arn) - resp, err := rdsconn.ListTagsForResource(&rds.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) + tags, err := keyvaluetags.RdsListTags(rdsconn, d.Get("arn").(string)) if err != nil { - log.Printf("[DEBUG] Error retrieving tags for ARN: %s", arn) + return fmt.Errorf("error listing tags for RDS DB Parameter Group (%s): %s", d.Get("arn").(string), err) } - var dt []*rds.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - d.Set("tags", tagsToMapRDS(dt)) return nil } @@ -292,13 +288,46 @@ func resourceAwsDbParameterGroupUpdate(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error modifying DB Parameter Group: %s", err) } } - d.SetPartial("parameter") + } + + // Reset parameters that have been removed + resetParameters, err := expandParameters(os.Difference(ns).List()) + if err != nil { + return err + } + if len(resetParameters) > 0 { + maxParams := 20 + for resetParameters != nil { + var paramsToReset []*rds.Parameter + if len(resetParameters) <= maxParams { + paramsToReset, resetParameters = resetParameters[:], nil + } else { + paramsToReset, resetParameters = resetParameters[:maxParams], resetParameters[maxParams:] + } + + parameterGroupName := d.Get("name").(string) + resetOpts := rds.ResetDBParameterGroupInput{ + DBParameterGroupName: aws.String(parameterGroupName), + Parameters: paramsToReset, + ResetAllParameters: aws.Bool(false), + } + + log.Printf("[DEBUG] Reset DB Parameter Group: %s", resetOpts) + _, err = rdsconn.ResetDBParameterGroup(&resetOpts) + if err != nil { + return fmt.Errorf("Error resetting DB Parameter Group: %s", err) + } + } } } - if err := setTagsRDS(rdsconn, d, d.Get("arn").(string)); err != nil { - return err - } else { + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.RdsUpdateTags(rdsconn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating RDS DB Parameter Group (%s) tags: %s", d.Get("arn").(string), err) + } + d.SetPartial("tags") } diff --git a/aws/resource_aws_db_parameter_group_test.go b/aws/resource_aws_db_parameter_group_test.go index 10946a80651..d93b11c353c 100644 --- a/aws/resource_aws_db_parameter_group_test.go +++ b/aws/resource_aws_db_parameter_group_test.go @@ -3,11 +3,9 @@ package aws import ( "fmt" "log" - "math/rand" "regexp" "strings" "testing" - "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" @@ -75,8 +73,9 @@ func testSweepRdsDbParameterGroups(region string) error { return nil } -func TestAccAWSDBParameterGroup_importBasic(t *testing.T) { - resourceName := "aws_db_parameter_group.bar" +func TestAccAWSDBParameterGroup_basic(t *testing.T) { + var v rds.DBParameterGroup + resourceName := "aws_db_parameter_group.test" groupName := fmt.Sprintf("parameter-group-test-terraform-%d", acctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ @@ -86,220 +85,85 @@ func TestAccAWSDBParameterGroup_importBasic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccAWSDBParameterGroupConfig(groupName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSDBParameterGroupExists(resourceName, &v), + testAccCheckAWSDBParameterGroupAttributes(&v, groupName), + resource.TestCheckResourceAttr( + resourceName, "name", groupName), + resource.TestCheckResourceAttr( + resourceName, "family", "mysql5.6"), + resource.TestCheckResourceAttr( + resourceName, "parameter.1708034931.name", "character_set_results"), + resource.TestCheckResourceAttr( + resourceName, "parameter.1708034931.value", "utf8"), + resource.TestCheckResourceAttr( + resourceName, "parameter.2421266705.name", "character_set_server"), + resource.TestCheckResourceAttr( + resourceName, "parameter.2421266705.value", "utf8"), + resource.TestCheckResourceAttr( + resourceName, "parameter.2478663599.name", "character_set_client"), + resource.TestCheckResourceAttr( + resourceName, "parameter.2478663599.value", "utf8"), + resource.TestMatchResourceAttr( + resourceName, "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:rds:[^:]+:\\d{12}:pg:%s", groupName))), + ), }, - { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, - }, - }) -} - -func TestAccAWSDBParameterGroup_limit(t *testing.T) { - var v rds.DBParameterGroup - - groupName := fmt.Sprintf("parameter-group-test-terraform-%d", acctest.RandInt()) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSDBParameterGroupDestroy, - Steps: []resource.TestStep{ { - Config: createAwsDbParameterGroupsExceedDefaultAwsLimit(groupName), + Config: testAccAWSDBParameterGroupAddParametersConfig(groupName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBParameterGroupExists("aws_db_parameter_group.large", &v), + testAccCheckAWSDBParameterGroupExists(resourceName, &v), testAccCheckAWSDBParameterGroupAttributes(&v, groupName), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "name", groupName), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "family", "mysql5.6"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "description", "RDS default parameter group: Exceed default AWS parameter group limit of twenty"), - - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2421266705.name", "character_set_server"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2421266705.value", "utf8"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2478663599.name", "character_set_client"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2478663599.value", "utf8"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1680942586.name", "collation_server"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1680942586.value", "utf8_general_ci"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2450940716.name", "collation_connection"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2450940716.value", "utf8_general_ci"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.242489837.name", "join_buffer_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.242489837.value", "16777216"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2026669454.name", "key_buffer_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2026669454.value", "67108864"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2705275319.name", "max_connections"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2705275319.value", "3200"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3512697936.name", "max_heap_table_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3512697936.value", "67108864"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.780730667.name", "performance_schema"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.780730667.value", "1"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2020346918.name", "performance_schema_users_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2020346918.value", "1048576"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1460834103.name", "query_cache_limit"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1460834103.value", "2097152"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.484865451.name", "query_cache_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.484865451.value", "67108864"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.255276438.name", "sort_buffer_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.255276438.value", "16777216"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2981725119.name", "table_open_cache"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2981725119.value", "4096"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2703661820.name", "tmp_table_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2703661820.value", "67108864"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2386583229.name", "binlog_cache_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2386583229.value", "131072"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.4012389720.name", "innodb_flush_log_at_trx_commit"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.4012389720.value", "0"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2688783017.name", "innodb_open_files"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2688783017.value", "4000"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.782983977.name", "innodb_read_io_threads"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.782983977.value", "64"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2809980413.name", "innodb_thread_concurrency"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2809980413.value", "0"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3599115250.name", "innodb_write_io_threads"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3599115250.value", "64"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2557156277.name", "character_set_connection"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2557156277.value", "utf8"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2475346812.name", "character_set_database"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2475346812.value", "utf8"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1986528518.name", "character_set_filesystem"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1986528518.value", "utf8"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1708034931.name", "character_set_results"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1708034931.value", "utf8"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1937131004.name", "event_scheduler"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1937131004.value", "ON"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3437079877.name", "innodb_buffer_pool_dump_at_shutdown"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3437079877.value", "1"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1092112861.name", "innodb_file_format"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1092112861.value", "Barracuda"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.615571931.name", "innodb_io_capacity"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.615571931.value", "2000"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1065962799.name", "innodb_io_capacity_max"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1065962799.value", "3000"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1411161182.name", "innodb_lock_wait_timeout"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1411161182.value", "120"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3133315879.name", "innodb_max_dirty_pages_pct"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3133315879.value", "90"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.950177639.name", "log_bin_trust_function_creators"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.950177639.value", "1"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.591700516.name", "log_warnings"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.591700516.value", "2"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1918306725.name", "log_output"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1918306725.value", "FILE"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.386204433.name", "max_allowed_packet"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.386204433.value", "1073741824"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1700901269.name", "max_connect_errors"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1700901269.value", "100"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2839701698.name", "query_cache_min_res_unit"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2839701698.value", "512"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.427634017.name", "slow_query_log"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.427634017.value", "1"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.881816039.name", "sync_binlog"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.881816039.value", "0"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.748684209.name", "tx_isolation"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.748684209.value", "REPEATABLE-READ"), + resource.TestCheckResourceAttr( + resourceName, "name", groupName), + resource.TestCheckResourceAttr( + resourceName, "family", "mysql5.6"), + resource.TestCheckResourceAttr( + resourceName, "parameter.1706463059.name", "collation_connection"), + resource.TestCheckResourceAttr( + resourceName, "parameter.1706463059.value", "utf8_unicode_ci"), + resource.TestCheckResourceAttr( + resourceName, "parameter.1708034931.name", "character_set_results"), + resource.TestCheckResourceAttr( + resourceName, "parameter.1708034931.value", "utf8"), + resource.TestCheckResourceAttr( + resourceName, "parameter.2421266705.name", "character_set_server"), + resource.TestCheckResourceAttr( + resourceName, "parameter.2421266705.value", "utf8"), + resource.TestCheckResourceAttr( + resourceName, "parameter.2475805061.name", "collation_server"), + resource.TestCheckResourceAttr( + resourceName, "parameter.2475805061.value", "utf8_unicode_ci"), + resource.TestCheckResourceAttr( + resourceName, "parameter.2478663599.name", "character_set_client"), + resource.TestCheckResourceAttr( + resourceName, "parameter.2478663599.value", "utf8"), + resource.TestMatchResourceAttr( + resourceName, "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:rds:[^:]+:\\d{12}:pg:%s", groupName))), ), }, { - Config: updateAwsDbParameterGroupsExceedDefaultAwsLimit(groupName), + Config: testAccAWSDBParameterGroupConfig(groupName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBParameterGroupExists("aws_db_parameter_group.large", &v), + testAccCheckAWSDBParameterGroupExists(resourceName, &v), testAccCheckAWSDBParameterGroupAttributes(&v, groupName), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "name", groupName), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "family", "mysql5.6"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "description", "Updated RDS default parameter group: Exceed default AWS parameter group limit of twenty"), - - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2421266705.name", "character_set_server"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2421266705.value", "utf8"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2478663599.name", "character_set_client"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2478663599.value", "utf8"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1680942586.name", "collation_server"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1680942586.value", "utf8_general_ci"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2450940716.name", "collation_connection"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2450940716.value", "utf8_general_ci"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.242489837.name", "join_buffer_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.242489837.value", "16777216"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2026669454.name", "key_buffer_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2026669454.value", "67108864"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2705275319.name", "max_connections"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2705275319.value", "3200"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3512697936.name", "max_heap_table_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3512697936.value", "67108864"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.780730667.name", "performance_schema"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.780730667.value", "1"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2020346918.name", "performance_schema_users_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2020346918.value", "1048576"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1460834103.name", "query_cache_limit"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1460834103.value", "2097152"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.484865451.name", "query_cache_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.484865451.value", "67108864"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.255276438.name", "sort_buffer_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.255276438.value", "16777216"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2981725119.name", "table_open_cache"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2981725119.value", "4096"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2703661820.name", "tmp_table_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2703661820.value", "67108864"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2386583229.name", "binlog_cache_size"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2386583229.value", "131072"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.4012389720.name", "innodb_flush_log_at_trx_commit"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.4012389720.value", "0"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2688783017.name", "innodb_open_files"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2688783017.value", "4000"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.782983977.name", "innodb_read_io_threads"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.782983977.value", "64"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2809980413.name", "innodb_thread_concurrency"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2809980413.value", "0"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3599115250.name", "innodb_write_io_threads"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3599115250.value", "64"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2557156277.name", "character_set_connection"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2557156277.value", "utf8"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2475346812.name", "character_set_database"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2475346812.value", "utf8"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1986528518.name", "character_set_filesystem"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1986528518.value", "utf8"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1708034931.name", "character_set_results"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1708034931.value", "utf8"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1937131004.name", "event_scheduler"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1937131004.value", "ON"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3437079877.name", "innodb_buffer_pool_dump_at_shutdown"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3437079877.value", "1"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1092112861.name", "innodb_file_format"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1092112861.value", "Barracuda"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.615571931.name", "innodb_io_capacity"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.615571931.value", "2000"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1065962799.name", "innodb_io_capacity_max"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1065962799.value", "3000"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1411161182.name", "innodb_lock_wait_timeout"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1411161182.value", "120"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3133315879.name", "innodb_max_dirty_pages_pct"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.3133315879.value", "90"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.950177639.name", "log_bin_trust_function_creators"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.950177639.value", "1"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.591700516.name", "log_warnings"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.591700516.value", "2"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1918306725.name", "log_output"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1918306725.value", "FILE"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.386204433.name", "max_allowed_packet"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.386204433.value", "1073741824"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1700901269.name", "max_connect_errors"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.1700901269.value", "100"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2839701698.name", "query_cache_min_res_unit"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.2839701698.value", "512"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.427634017.name", "slow_query_log"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.427634017.value", "1"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.881816039.name", "sync_binlog"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.881816039.value", "0"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.748684209.name", "tx_isolation"), - resource.TestCheckResourceAttr("aws_db_parameter_group.large", "parameter.748684209.value", "REPEATABLE-READ"), + testAccCheckAWSDBParameterNotUserDefined(resourceName, "collation_connection"), + testAccCheckAWSDBParameterNotUserDefined(resourceName, "collation_server"), + resource.TestCheckNoResourceAttr(resourceName, "parameter.2475805061.value"), + resource.TestCheckNoResourceAttr(resourceName, "parameter.1706463059.value"), ), }, }, }) } -func TestAccAWSDBParameterGroup_basic(t *testing.T) { +func TestAccAWSDBParameterGroup_limit(t *testing.T) { var v rds.DBParameterGroup - + resourceName := "aws_db_parameter_group.test" groupName := fmt.Sprintf("parameter-group-test-terraform-%d", acctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ @@ -308,69 +172,192 @@ func TestAccAWSDBParameterGroup_basic(t *testing.T) { CheckDestroy: testAccCheckAWSDBParameterGroupDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSDBParameterGroupConfig(groupName), + Config: createAwsDbParameterGroupsExceedDefaultAwsLimit(groupName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBParameterGroupExists("aws_db_parameter_group.bar", &v), + testAccCheckAWSDBParameterGroupExists(resourceName, &v), testAccCheckAWSDBParameterGroupAttributes(&v, groupName), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "name", groupName), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "family", "mysql5.6"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "description", "Managed by Terraform"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.1708034931.name", "character_set_results"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.1708034931.value", "utf8"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2421266705.name", "character_set_server"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2421266705.value", "utf8"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2478663599.name", "character_set_client"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2478663599.value", "utf8"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "tags.%", "1"), - resource.TestMatchResourceAttr( - "aws_db_parameter_group.bar", "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:rds:[^:]+:\\d{12}:pg:%s", groupName))), + resource.TestCheckResourceAttr(resourceName, "name", groupName), + resource.TestCheckResourceAttr(resourceName, "family", "mysql5.6"), + resource.TestCheckResourceAttr(resourceName, "description", "RDS default parameter group: Exceed default AWS parameter group limit of twenty"), + resource.TestCheckResourceAttr(resourceName, "parameter.2421266705.name", "character_set_server"), + resource.TestCheckResourceAttr(resourceName, "parameter.2421266705.value", "utf8"), + resource.TestCheckResourceAttr(resourceName, "parameter.2478663599.name", "character_set_client"), + resource.TestCheckResourceAttr(resourceName, "parameter.2478663599.value", "utf8"), + resource.TestCheckResourceAttr(resourceName, "parameter.1680942586.name", "collation_server"), + resource.TestCheckResourceAttr(resourceName, "parameter.1680942586.value", "utf8_general_ci"), + resource.TestCheckResourceAttr(resourceName, "parameter.2450940716.name", "collation_connection"), + resource.TestCheckResourceAttr(resourceName, "parameter.2450940716.value", "utf8_general_ci"), + resource.TestCheckResourceAttr(resourceName, "parameter.242489837.name", "join_buffer_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.242489837.value", "16777216"), + resource.TestCheckResourceAttr(resourceName, "parameter.2026669454.name", "key_buffer_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.2026669454.value", "67108864"), + resource.TestCheckResourceAttr(resourceName, "parameter.2705275319.name", "max_connections"), + resource.TestCheckResourceAttr(resourceName, "parameter.2705275319.value", "3200"), + resource.TestCheckResourceAttr(resourceName, "parameter.3512697936.name", "max_heap_table_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.3512697936.value", "67108864"), + resource.TestCheckResourceAttr(resourceName, "parameter.780730667.name", "performance_schema"), + resource.TestCheckResourceAttr(resourceName, "parameter.780730667.value", "1"), + resource.TestCheckResourceAttr(resourceName, "parameter.2020346918.name", "performance_schema_users_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.2020346918.value", "1048576"), + resource.TestCheckResourceAttr(resourceName, "parameter.1460834103.name", "query_cache_limit"), + resource.TestCheckResourceAttr(resourceName, "parameter.1460834103.value", "2097152"), + resource.TestCheckResourceAttr(resourceName, "parameter.484865451.name", "query_cache_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.484865451.value", "67108864"), + resource.TestCheckResourceAttr(resourceName, "parameter.255276438.name", "sort_buffer_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.255276438.value", "16777216"), + resource.TestCheckResourceAttr(resourceName, "parameter.2981725119.name", "table_open_cache"), + resource.TestCheckResourceAttr(resourceName, "parameter.2981725119.value", "4096"), + resource.TestCheckResourceAttr(resourceName, "parameter.2703661820.name", "tmp_table_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.2703661820.value", "67108864"), + resource.TestCheckResourceAttr(resourceName, "parameter.2386583229.name", "binlog_cache_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.2386583229.value", "131072"), + resource.TestCheckResourceAttr(resourceName, "parameter.4012389720.name", "innodb_flush_log_at_trx_commit"), + resource.TestCheckResourceAttr(resourceName, "parameter.4012389720.value", "0"), + resource.TestCheckResourceAttr(resourceName, "parameter.2688783017.name", "innodb_open_files"), + resource.TestCheckResourceAttr(resourceName, "parameter.2688783017.value", "4000"), + resource.TestCheckResourceAttr(resourceName, "parameter.782983977.name", "innodb_read_io_threads"), + resource.TestCheckResourceAttr(resourceName, "parameter.782983977.value", "64"), + resource.TestCheckResourceAttr(resourceName, "parameter.2809980413.name", "innodb_thread_concurrency"), + resource.TestCheckResourceAttr(resourceName, "parameter.2809980413.value", "0"), + resource.TestCheckResourceAttr(resourceName, "parameter.3599115250.name", "innodb_write_io_threads"), + resource.TestCheckResourceAttr(resourceName, "parameter.3599115250.value", "64"), + resource.TestCheckResourceAttr(resourceName, "parameter.2557156277.name", "character_set_connection"), + resource.TestCheckResourceAttr(resourceName, "parameter.2557156277.value", "utf8"), + resource.TestCheckResourceAttr(resourceName, "parameter.2475346812.name", "character_set_database"), + resource.TestCheckResourceAttr(resourceName, "parameter.2475346812.value", "utf8"), + resource.TestCheckResourceAttr(resourceName, "parameter.1986528518.name", "character_set_filesystem"), + resource.TestCheckResourceAttr(resourceName, "parameter.1986528518.value", "utf8"), + resource.TestCheckResourceAttr(resourceName, "parameter.1708034931.name", "character_set_results"), + resource.TestCheckResourceAttr(resourceName, "parameter.1708034931.value", "utf8"), + resource.TestCheckResourceAttr(resourceName, "parameter.1937131004.name", "event_scheduler"), + resource.TestCheckResourceAttr(resourceName, "parameter.1937131004.value", "ON"), + resource.TestCheckResourceAttr(resourceName, "parameter.3437079877.name", "innodb_buffer_pool_dump_at_shutdown"), + resource.TestCheckResourceAttr(resourceName, "parameter.3437079877.value", "1"), + resource.TestCheckResourceAttr(resourceName, "parameter.1092112861.name", "innodb_file_format"), + resource.TestCheckResourceAttr(resourceName, "parameter.1092112861.value", "barracuda"), + resource.TestCheckResourceAttr(resourceName, "parameter.615571931.name", "innodb_io_capacity"), + resource.TestCheckResourceAttr(resourceName, "parameter.615571931.value", "2000"), + resource.TestCheckResourceAttr(resourceName, "parameter.1065962799.name", "innodb_io_capacity_max"), + resource.TestCheckResourceAttr(resourceName, "parameter.1065962799.value", "3000"), + resource.TestCheckResourceAttr(resourceName, "parameter.1411161182.name", "innodb_lock_wait_timeout"), + resource.TestCheckResourceAttr(resourceName, "parameter.1411161182.value", "120"), + resource.TestCheckResourceAttr(resourceName, "parameter.3133315879.name", "innodb_max_dirty_pages_pct"), + resource.TestCheckResourceAttr(resourceName, "parameter.3133315879.value", "90"), + resource.TestCheckResourceAttr(resourceName, "parameter.950177639.name", "log_bin_trust_function_creators"), + resource.TestCheckResourceAttr(resourceName, "parameter.950177639.value", "1"), + resource.TestCheckResourceAttr(resourceName, "parameter.591700516.name", "log_warnings"), + resource.TestCheckResourceAttr(resourceName, "parameter.591700516.value", "2"), + resource.TestCheckResourceAttr(resourceName, "parameter.1918306725.name", "log_output"), + resource.TestCheckResourceAttr(resourceName, "parameter.1918306725.value", "FILE"), + resource.TestCheckResourceAttr(resourceName, "parameter.386204433.name", "max_allowed_packet"), + resource.TestCheckResourceAttr(resourceName, "parameter.386204433.value", "1073741824"), + resource.TestCheckResourceAttr(resourceName, "parameter.1700901269.name", "max_connect_errors"), + resource.TestCheckResourceAttr(resourceName, "parameter.1700901269.value", "100"), + resource.TestCheckResourceAttr(resourceName, "parameter.2839701698.name", "query_cache_min_res_unit"), + resource.TestCheckResourceAttr(resourceName, "parameter.2839701698.value", "512"), + resource.TestCheckResourceAttr(resourceName, "parameter.427634017.name", "slow_query_log"), + resource.TestCheckResourceAttr(resourceName, "parameter.427634017.value", "1"), + resource.TestCheckResourceAttr(resourceName, "parameter.881816039.name", "sync_binlog"), + resource.TestCheckResourceAttr(resourceName, "parameter.881816039.value", "0"), + resource.TestCheckResourceAttr(resourceName, "parameter.748684209.name", "tx_isolation"), + resource.TestCheckResourceAttr(resourceName, "parameter.748684209.value", "REPEATABLE-READ"), ), }, { - Config: testAccAWSDBParameterGroupAddParametersConfig(groupName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: updateAwsDbParameterGroupsExceedDefaultAwsLimit(groupName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBParameterGroupExists("aws_db_parameter_group.bar", &v), + testAccCheckAWSDBParameterGroupExists(resourceName, &v), testAccCheckAWSDBParameterGroupAttributes(&v, groupName), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "name", groupName), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "family", "mysql5.6"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "description", "Test parameter group for terraform"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.1706463059.name", "collation_connection"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.1706463059.value", "utf8_unicode_ci"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.1708034931.name", "character_set_results"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.1708034931.value", "utf8"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2421266705.name", "character_set_server"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2421266705.value", "utf8"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2475805061.name", "collation_server"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2475805061.value", "utf8_unicode_ci"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2478663599.name", "character_set_client"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2478663599.value", "utf8"), - resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "tags.%", "2"), - resource.TestMatchResourceAttr( - "aws_db_parameter_group.bar", "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:rds:[^:]+:\\d{12}:pg:%s", groupName))), + resource.TestCheckResourceAttr(resourceName, "name", groupName), + resource.TestCheckResourceAttr(resourceName, "family", "mysql5.6"), + resource.TestCheckResourceAttr(resourceName, "description", "Updated RDS default parameter group: Exceed default AWS parameter group limit of twenty"), + resource.TestCheckResourceAttr(resourceName, "parameter.2421266705.name", "character_set_server"), + resource.TestCheckResourceAttr(resourceName, "parameter.2421266705.value", "utf8"), + resource.TestCheckResourceAttr(resourceName, "parameter.2478663599.name", "character_set_client"), + resource.TestCheckResourceAttr(resourceName, "parameter.2478663599.value", "utf8"), + resource.TestCheckResourceAttr(resourceName, "parameter.1680942586.name", "collation_server"), + resource.TestCheckResourceAttr(resourceName, "parameter.1680942586.value", "utf8_general_ci"), + resource.TestCheckResourceAttr(resourceName, "parameter.2450940716.name", "collation_connection"), + resource.TestCheckResourceAttr(resourceName, "parameter.2450940716.value", "utf8_general_ci"), + resource.TestCheckResourceAttr(resourceName, "parameter.242489837.name", "join_buffer_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.242489837.value", "16777216"), + resource.TestCheckResourceAttr(resourceName, "parameter.2026669454.name", "key_buffer_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.2026669454.value", "67108864"), + resource.TestCheckResourceAttr(resourceName, "parameter.2705275319.name", "max_connections"), + resource.TestCheckResourceAttr(resourceName, "parameter.2705275319.value", "3200"), + resource.TestCheckResourceAttr(resourceName, "parameter.3512697936.name", "max_heap_table_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.3512697936.value", "67108864"), + resource.TestCheckResourceAttr(resourceName, "parameter.780730667.name", "performance_schema"), + resource.TestCheckResourceAttr(resourceName, "parameter.780730667.value", "1"), + resource.TestCheckResourceAttr(resourceName, "parameter.2020346918.name", "performance_schema_users_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.2020346918.value", "1048576"), + resource.TestCheckResourceAttr(resourceName, "parameter.1460834103.name", "query_cache_limit"), + resource.TestCheckResourceAttr(resourceName, "parameter.1460834103.value", "2097152"), + resource.TestCheckResourceAttr(resourceName, "parameter.484865451.name", "query_cache_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.484865451.value", "67108864"), + resource.TestCheckResourceAttr(resourceName, "parameter.255276438.name", "sort_buffer_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.255276438.value", "16777216"), + resource.TestCheckResourceAttr(resourceName, "parameter.2981725119.name", "table_open_cache"), + resource.TestCheckResourceAttr(resourceName, "parameter.2981725119.value", "4096"), + resource.TestCheckResourceAttr(resourceName, "parameter.2703661820.name", "tmp_table_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.2703661820.value", "67108864"), + resource.TestCheckResourceAttr(resourceName, "parameter.2386583229.name", "binlog_cache_size"), + resource.TestCheckResourceAttr(resourceName, "parameter.2386583229.value", "131072"), + resource.TestCheckResourceAttr(resourceName, "parameter.4012389720.name", "innodb_flush_log_at_trx_commit"), + resource.TestCheckResourceAttr(resourceName, "parameter.4012389720.value", "0"), + resource.TestCheckResourceAttr(resourceName, "parameter.2688783017.name", "innodb_open_files"), + resource.TestCheckResourceAttr(resourceName, "parameter.2688783017.value", "4000"), + resource.TestCheckResourceAttr(resourceName, "parameter.782983977.name", "innodb_read_io_threads"), + resource.TestCheckResourceAttr(resourceName, "parameter.782983977.value", "64"), + resource.TestCheckResourceAttr(resourceName, "parameter.2809980413.name", "innodb_thread_concurrency"), + resource.TestCheckResourceAttr(resourceName, "parameter.2809980413.value", "0"), + resource.TestCheckResourceAttr(resourceName, "parameter.3599115250.name", "innodb_write_io_threads"), + resource.TestCheckResourceAttr(resourceName, "parameter.3599115250.value", "64"), + resource.TestCheckResourceAttr(resourceName, "parameter.2557156277.name", "character_set_connection"), + resource.TestCheckResourceAttr(resourceName, "parameter.2557156277.value", "utf8"), + resource.TestCheckResourceAttr(resourceName, "parameter.2475346812.name", "character_set_database"), + resource.TestCheckResourceAttr(resourceName, "parameter.2475346812.value", "utf8"), + resource.TestCheckResourceAttr(resourceName, "parameter.1986528518.name", "character_set_filesystem"), + resource.TestCheckResourceAttr(resourceName, "parameter.1986528518.value", "utf8"), + resource.TestCheckResourceAttr(resourceName, "parameter.1708034931.name", "character_set_results"), + resource.TestCheckResourceAttr(resourceName, "parameter.1708034931.value", "utf8"), + resource.TestCheckResourceAttr(resourceName, "parameter.1937131004.name", "event_scheduler"), + resource.TestCheckResourceAttr(resourceName, "parameter.1937131004.value", "ON"), + resource.TestCheckResourceAttr(resourceName, "parameter.3437079877.name", "innodb_buffer_pool_dump_at_shutdown"), + resource.TestCheckResourceAttr(resourceName, "parameter.3437079877.value", "1"), + resource.TestCheckResourceAttr(resourceName, "parameter.1092112861.name", "innodb_file_format"), + resource.TestCheckResourceAttr(resourceName, "parameter.1092112861.value", "barracuda"), + resource.TestCheckResourceAttr(resourceName, "parameter.615571931.name", "innodb_io_capacity"), + resource.TestCheckResourceAttr(resourceName, "parameter.615571931.value", "2000"), + resource.TestCheckResourceAttr(resourceName, "parameter.1065962799.name", "innodb_io_capacity_max"), + resource.TestCheckResourceAttr(resourceName, "parameter.1065962799.value", "3000"), + resource.TestCheckResourceAttr(resourceName, "parameter.1411161182.name", "innodb_lock_wait_timeout"), + resource.TestCheckResourceAttr(resourceName, "parameter.1411161182.value", "120"), + resource.TestCheckResourceAttr(resourceName, "parameter.3133315879.name", "innodb_max_dirty_pages_pct"), + resource.TestCheckResourceAttr(resourceName, "parameter.3133315879.value", "90"), + resource.TestCheckResourceAttr(resourceName, "parameter.950177639.name", "log_bin_trust_function_creators"), + resource.TestCheckResourceAttr(resourceName, "parameter.950177639.value", "1"), + resource.TestCheckResourceAttr(resourceName, "parameter.591700516.name", "log_warnings"), + resource.TestCheckResourceAttr(resourceName, "parameter.591700516.value", "2"), + resource.TestCheckResourceAttr(resourceName, "parameter.1918306725.name", "log_output"), + resource.TestCheckResourceAttr(resourceName, "parameter.1918306725.value", "FILE"), + resource.TestCheckResourceAttr(resourceName, "parameter.386204433.name", "max_allowed_packet"), + resource.TestCheckResourceAttr(resourceName, "parameter.386204433.value", "1073741824"), + resource.TestCheckResourceAttr(resourceName, "parameter.1700901269.name", "max_connect_errors"), + resource.TestCheckResourceAttr(resourceName, "parameter.1700901269.value", "100"), + resource.TestCheckResourceAttr(resourceName, "parameter.2839701698.name", "query_cache_min_res_unit"), + resource.TestCheckResourceAttr(resourceName, "parameter.2839701698.value", "512"), + resource.TestCheckResourceAttr(resourceName, "parameter.427634017.name", "slow_query_log"), + resource.TestCheckResourceAttr(resourceName, "parameter.427634017.value", "1"), + resource.TestCheckResourceAttr(resourceName, "parameter.881816039.name", "sync_binlog"), + resource.TestCheckResourceAttr(resourceName, "parameter.881816039.value", "0"), + resource.TestCheckResourceAttr(resourceName, "parameter.748684209.name", "tx_isolation"), + resource.TestCheckResourceAttr(resourceName, "parameter.748684209.value", "REPEATABLE-READ"), ), }, }, @@ -379,7 +366,9 @@ func TestAccAWSDBParameterGroup_basic(t *testing.T) { func TestAccAWSDBParameterGroup_Disappears(t *testing.T) { var v rds.DBParameterGroup + resourceName := "aws_db_parameter_group.test" groupName := fmt.Sprintf("parameter-group-test-terraform-%d", acctest.RandInt()) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -388,7 +377,7 @@ func TestAccAWSDBParameterGroup_Disappears(t *testing.T) { { Config: testAccAWSDBParameterGroupConfig(groupName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBParameterGroupExists("aws_db_parameter_group.bar", &v), + testAccCheckAWSDBParameterGroupExists(resourceName, &v), testAccCheckAWSDbParamaterGroupDisappears(&v), ), ExpectNonEmptyPlan: true, @@ -437,7 +426,7 @@ func TestAccAWSDBParameterGroup_generatedName(t *testing.T) { func TestAccAWSDBParameterGroup_withApplyMethod(t *testing.T) { var v rds.DBParameterGroup - + resourceName := "aws_db_parameter_group.test" groupName := fmt.Sprintf("parameter-group-test-terraform-%d", acctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ @@ -448,36 +437,42 @@ func TestAccAWSDBParameterGroup_withApplyMethod(t *testing.T) { { Config: testAccAWSDBParameterGroupConfigWithApplyMethod(groupName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBParameterGroupExists("aws_db_parameter_group.bar", &v), + testAccCheckAWSDBParameterGroupExists(resourceName, &v), testAccCheckAWSDBParameterGroupAttributes(&v, groupName), resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "name", groupName), + resourceName, "name", groupName), resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "family", "mysql5.6"), + resourceName, "family", "mysql5.6"), resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "description", "Managed by Terraform"), + resourceName, "description", "Managed by Terraform"), resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2421266705.name", "character_set_server"), + resourceName, "parameter.2421266705.name", "character_set_server"), resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2421266705.value", "utf8"), + resourceName, "parameter.2421266705.value", "utf8"), resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2421266705.apply_method", "immediate"), + resourceName, "parameter.2421266705.apply_method", "immediate"), resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2478663599.name", "character_set_client"), + resourceName, "parameter.2478663599.name", "character_set_client"), resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2478663599.value", "utf8"), + resourceName, "parameter.2478663599.value", "utf8"), resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "parameter.2478663599.apply_method", "pending-reboot"), + resourceName, "parameter.2478663599.apply_method", "pending-reboot"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSDBParameterGroup_Only(t *testing.T) { var v rds.DBParameterGroup - + resourceName := "aws_db_parameter_group.test" groupName := fmt.Sprintf("parameter-group-test-terraform-%d", acctest.RandInt()) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -486,22 +481,28 @@ func TestAccAWSDBParameterGroup_Only(t *testing.T) { { Config: testAccAWSDBParameterGroupOnlyConfig(groupName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBParameterGroupExists("aws_db_parameter_group.bar", &v), + testAccCheckAWSDBParameterGroupExists(resourceName, &v), testAccCheckAWSDBParameterGroupAttributes(&v, groupName), resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "name", groupName), + resourceName, "name", groupName), resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "family", "mysql5.6"), + resourceName, "family", "mysql5.6"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSDBParameterGroup_MatchDefault(t *testing.T) { var v rds.DBParameterGroup - + resourceName := "aws_db_parameter_group.test" groupName := fmt.Sprintf("parameter-group-test-terraform-%d", acctest.RandInt()) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -510,13 +511,19 @@ func TestAccAWSDBParameterGroup_MatchDefault(t *testing.T) { { Config: testAccAWSDBParameterGroupIncludeDefaultConfig(groupName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBParameterGroupExists("aws_db_parameter_group.bar", &v), + testAccCheckAWSDBParameterGroupExists(resourceName, &v), resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "name", groupName), + resourceName, "name", groupName), resource.TestCheckResourceAttr( - "aws_db_parameter_group.bar", "family", "postgres9.4"), + resourceName, "family", "postgres9.4"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"parameter"}, + }, }, }) } @@ -621,19 +628,46 @@ func testAccCheckAWSDBParameterGroupExists(n string, v *rds.DBParameterGroup) re } } -func randomString(strlen int) string { - rand.Seed(time.Now().UTC().UnixNano()) - const chars = "abcdefghijklmnopqrstuvwxyz" - result := make([]byte, strlen) - for i := 0; i < strlen; i++ { - result[i] = chars[rand.Intn(len(chars))] +func testAccCheckAWSDBParameterNotUserDefined(n, paramName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No DB Parameter Group ID is set") + } + + conn := testAccProvider.Meta().(*AWSClient).rdsconn + + opts := rds.DescribeDBParametersInput{ + DBParameterGroupName: aws.String(rs.Primary.ID), + Source: aws.String("user"), + } + + userDefined := false + err := conn.DescribeDBParametersPages(&opts, func(page *rds.DescribeDBParametersOutput, lastPage bool) bool { + for _, param := range page.Parameters { + if *param.ParameterName == paramName { + userDefined = true + return false + } + } + return true + }) + + if userDefined { + return fmt.Errorf("DB Parameter is user defined") + } + + return err } - return string(result) } func testAccAWSDBParameterGroupConfig(n string) string { return fmt.Sprintf(` -resource "aws_db_parameter_group" "bar" { +resource "aws_db_parameter_group" "test" { name = "%s" family = "mysql5.6" @@ -651,17 +685,13 @@ resource "aws_db_parameter_group" "bar" { name = "character_set_results" value = "utf8" } - - tags = { - foo = "bar" - } } `, n) } func testAccAWSDBParameterGroupConfigWithApplyMethod(n string) string { return fmt.Sprintf(` -resource "aws_db_parameter_group" "bar" { +resource "aws_db_parameter_group" "test" { name = "%s" family = "mysql5.6" @@ -677,7 +707,7 @@ resource "aws_db_parameter_group" "bar" { } tags = { - foo = "bar" + foo = "test" } } `, n) @@ -685,10 +715,9 @@ resource "aws_db_parameter_group" "bar" { func testAccAWSDBParameterGroupAddParametersConfig(n string) string { return fmt.Sprintf(` -resource "aws_db_parameter_group" "bar" { +resource "aws_db_parameter_group" "test" { name = "%s" family = "mysql5.6" - description = "Test parameter group for terraform" parameter { name = "character_set_server" @@ -714,18 +743,13 @@ resource "aws_db_parameter_group" "bar" { name = "collation_connection" value = "utf8_unicode_ci" } - - tags = { - foo = "bar" - baz = "foo" - } } `, n) } func testAccAWSDBParameterGroupOnlyConfig(n string) string { return fmt.Sprintf(` -resource "aws_db_parameter_group" "bar" { +resource "aws_db_parameter_group" "test" { name = "%s" family = "mysql5.6" description = "Test parameter group for terraform" @@ -735,7 +759,7 @@ resource "aws_db_parameter_group" "bar" { func createAwsDbParameterGroupsExceedDefaultAwsLimit(n string) string { return fmt.Sprintf(` -resource "aws_db_parameter_group" "large" { +resource "aws_db_parameter_group" "test" { name = "%s" family = "mysql5.6" description = "RDS default parameter group: Exceed default AWS parameter group limit of twenty" @@ -797,7 +821,7 @@ resource "aws_db_parameter_group" "large" { parameter { name = "innodb_file_format" - value = "Barracuda" + value = "barracuda" } parameter { @@ -955,7 +979,7 @@ resource "aws_db_parameter_group" "large" { func updateAwsDbParameterGroupsExceedDefaultAwsLimit(n string) string { return fmt.Sprintf(` -resource "aws_db_parameter_group" "large" { +resource "aws_db_parameter_group" "test" { name = "%s" family = "mysql5.6" description = "Updated RDS default parameter group: Exceed default AWS parameter group limit of twenty" @@ -1017,7 +1041,7 @@ resource "aws_db_parameter_group" "large" { parameter { name = "innodb_file_format" - value = "Barracuda" + value = "barracuda" } parameter { @@ -1175,7 +1199,7 @@ resource "aws_db_parameter_group" "large" { func testAccAWSDBParameterGroupIncludeDefaultConfig(n string) string { return fmt.Sprintf(` -resource "aws_db_parameter_group" "bar" { +resource "aws_db_parameter_group" "test" { name = "%s" family = "postgres9.4" diff --git a/aws/resource_aws_db_security_group.go b/aws/resource_aws_db_security_group.go index 8d3e51183ae..9164ec903a9 100644 --- a/aws/resource_aws_db_security_group.go +++ b/aws/resource_aws_db_security_group.go @@ -8,11 +8,11 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/rds" - "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDbSecurityGroup() *schema.Resource { @@ -83,7 +83,7 @@ func resourceAwsDbSecurityGroup() *schema.Resource { func resourceAwsDbSecurityGroupCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).rdsconn - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags() var err error var errs []error @@ -179,19 +179,16 @@ func resourceAwsDbSecurityGroupRead(d *schema.ResourceData, meta interface{}) er arn := aws.StringValue(sg.DBSecurityGroupArn) d.Set("arn", arn) - resp, err := conn.ListTagsForResource(&rds.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) + + tags, err := keyvaluetags.RdsListTags(conn, d.Get("arn").(string)) if err != nil { - log.Printf("[DEBUG] Error retrieving tags for ARN: %s", arn) + return fmt.Errorf("error listing tags for RDS DB Security Group (%s): %s", d.Get("arn").(string), err) } - var dt []*rds.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - d.Set("tags", tagsToMapRDS(dt)) return nil } @@ -201,9 +198,13 @@ func resourceAwsDbSecurityGroupUpdate(d *schema.ResourceData, meta interface{}) d.Partial(true) - if err := setTagsRDS(conn, d, d.Get("arn").(string)); err != nil { - return err - } else { + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.RdsUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating RDS DB Security Group (%s) tags: %s", d.Get("arn").(string), err) + } + d.SetPartial("tags") } diff --git a/aws/resource_aws_db_security_group_test.go b/aws/resource_aws_db_security_group_test.go index 8e21211668a..8010ed9b707 100644 --- a/aws/resource_aws_db_security_group_test.go +++ b/aws/resource_aws_db_security_group_test.go @@ -14,39 +14,13 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSDBSecurityGroup_importBasic(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - - rName := fmt.Sprintf("tf-acc-%s", acctest.RandString(5)) - resourceName := "aws_db_security_group.bar" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSDBSecurityGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSDBSecurityGroupConfig(rName), - }, - - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func TestAccAWSDBSecurityGroup_basic(t *testing.T) { var v rds.DBSecurityGroup oldvar := os.Getenv("AWS_DEFAULT_REGION") os.Setenv("AWS_DEFAULT_REGION", "us-east-1") defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - + resourceName := "aws_db_security_group.test" rName := fmt.Sprintf("tf-acc-%s", acctest.RandString(5)) resource.ParallelTest(t, resource.TestCase{ @@ -57,21 +31,26 @@ func TestAccAWSDBSecurityGroup_basic(t *testing.T) { { Config: testAccAWSDBSecurityGroupConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSDBSecurityGroupExists("aws_db_security_group.bar", &v), + testAccCheckAWSDBSecurityGroupExists(resourceName, &v), testAccCheckAWSDBSecurityGroupAttributes(&v), - resource.TestMatchResourceAttr("aws_db_security_group.bar", "arn", regexp.MustCompile(`^arn:[^:]+:rds:[^:]+:\d{12}:secgrp:.+`)), + resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(`^arn:[^:]+:rds:[^:]+:\d{12}:secgrp:.+`)), resource.TestCheckResourceAttr( - "aws_db_security_group.bar", "name", rName), + resourceName, "name", rName), resource.TestCheckResourceAttr( - "aws_db_security_group.bar", "description", "Managed by Terraform"), + resourceName, "description", "Managed by Terraform"), resource.TestCheckResourceAttr( - "aws_db_security_group.bar", "ingress.3363517775.cidr", "10.0.0.1/24"), + resourceName, "ingress.3363517775.cidr", "10.0.0.1/24"), resource.TestCheckResourceAttr( - "aws_db_security_group.bar", "ingress.#", "1"), + resourceName, "ingress.#", "1"), resource.TestCheckResourceAttr( - "aws_db_security_group.bar", "tags.%", "1"), + resourceName, "tags.%", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -169,7 +148,7 @@ func testAccCheckAWSDBSecurityGroupExists(n string, v *rds.DBSecurityGroup) reso func testAccAWSDBSecurityGroupConfig(name string) string { return fmt.Sprintf(` -resource "aws_db_security_group" "bar" { +resource "aws_db_security_group" "test" { name = "%s" ingress { @@ -177,7 +156,7 @@ resource "aws_db_security_group" "bar" { } tags = { - foo = "bar" + foo = "test" } } `, name) diff --git a/aws/resource_aws_db_snapshot.go b/aws/resource_aws_db_snapshot.go index 3fc9746e1f9..62ec2beca68 100644 --- a/aws/resource_aws_db_snapshot.go +++ b/aws/resource_aws_db_snapshot.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/rds" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDbSnapshot() *schema.Resource { @@ -109,7 +110,7 @@ func resourceAwsDbSnapshot() *schema.Resource { func resourceAwsDbSnapshotCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).rdsconn - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags() dBInstanceIdentifier := d.Get("db_instance_identifier").(string) params := &rds.CreateDBSnapshotInput{ @@ -178,8 +179,15 @@ func resourceAwsDbSnapshotRead(d *schema.ResourceData, meta interface{}) error { d.Set("snapshot_type", snapshot.SnapshotType) d.Set("status", snapshot.Status) d.Set("vpc_id", snapshot.VpcId) - if err := saveTagsRDS(conn, d, aws.StringValue(snapshot.DBSnapshotArn)); err != nil { - log.Printf("[WARN] Failed to save tags for RDS Snapshot (%s): %s", d.Id(), err) + + tags, err := keyvaluetags.RdsListTags(conn, d.Get("db_snapshot_arn").(string)) + + if err != nil { + return fmt.Errorf("error listing tags for RDS DB Snapshot (%s): %s", d.Get("db_snapshot_arn").(string), err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -205,41 +213,15 @@ func resourceAwsDbSnapshotDelete(d *schema.ResourceData, meta interface{}) error func resourceAwsDbSnapshotUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).rdsconn - arn := d.Get("db_snapshot_arn").(string) - if d.HasChange("tags") { - oldTagsRaw, newTagsRaw := d.GetChange("tags") - oldTagsMap := oldTagsRaw.(map[string]interface{}) - newTagsMap := newTagsRaw.(map[string]interface{}) - createTags, removeTags := diffTagsRDS(tagsFromMapRDS(oldTagsMap), tagsFromMapRDS(newTagsMap)) - - if len(removeTags) > 0 { - removeTagKeys := make([]*string, len(removeTags)) - for i, removeTag := range removeTags { - removeTagKeys[i] = removeTag.Key - } - - input := &rds.RemoveTagsFromResourceInput{ - ResourceName: aws.String(arn), - TagKeys: removeTagKeys, - } - - log.Printf("[DEBUG] Untagging DB Snapshot: %s", input) - if _, err := conn.RemoveTagsFromResource(input); err != nil { - return fmt.Errorf("error untagging DB Snapshot (%s): %s", d.Id(), err) - } - } - if len(createTags) > 0 { - input := &rds.AddTagsToResourceInput{ - ResourceName: aws.String(arn), - Tags: createTags, - } + if d.HasChange("tags") { + o, n := d.GetChange("tags") - log.Printf("[DEBUG] Tagging DB Snapshot: %s", input) - if _, err := conn.AddTagsToResource(input); err != nil { - return fmt.Errorf("error tagging DB Snapshot (%s): %s", d.Id(), err) - } + if err := keyvaluetags.RdsUpdateTags(conn, d.Get("db_snapshot_arn").(string), o, n); err != nil { + return fmt.Errorf("error updating RDS DB Snapshot (%s) tags: %s", d.Get("db_snapshot_arn").(string), err) } + + d.SetPartial("tags") } return nil diff --git a/aws/resource_aws_db_subnet_group.go b/aws/resource_aws_db_subnet_group.go index 3e42cc9d349..80a29a1d320 100644 --- a/aws/resource_aws_db_subnet_group.go +++ b/aws/resource_aws_db_subnet_group.go @@ -9,9 +9,9 @@ import ( "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-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDbSubnetGroup() *schema.Resource { @@ -67,7 +67,7 @@ func resourceAwsDbSubnetGroup() *schema.Resource { func resourceAwsDbSubnetGroupCreate(d *schema.ResourceData, meta interface{}) error { rdsconn := meta.(*AWSClient).rdsconn - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags() subnetIdsSet := d.Get("subnet_ids").(*schema.Set) subnetIds := make([]*string, subnetIdsSet.Len()) @@ -146,25 +146,20 @@ func resourceAwsDbSubnetGroupRead(d *schema.ResourceData, meta interface{}) erro } d.Set("subnet_ids", subnets) - // list tags for resource - // set tags conn := meta.(*AWSClient).rdsconn arn := aws.StringValue(subnetGroup.DBSubnetGroupArn) d.Set("arn", arn) - resp, err := conn.ListTagsForResource(&rds.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) + + tags, err := keyvaluetags.RdsListTags(conn, d.Get("arn").(string)) if err != nil { - log.Printf("[DEBUG] Error retreiving tags for ARN: %s", arn) + return fmt.Errorf("error listing tags for RDS DB Subnet Group (%s): %s", d.Get("arn").(string), err) } - var dt []*rds.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - d.Set("tags", tagsToMapRDS(dt)) return nil } @@ -194,10 +189,13 @@ func resourceAwsDbSubnetGroupUpdate(d *schema.ResourceData, meta interface{}) er } } - arn := d.Get("arn").(string) - if err := setTagsRDS(conn, d, arn); err != nil { - return err - } else { + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.RdsUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating RDS DB Subnet Group (%s) tags: %s", d.Get("arn").(string), err) + } + d.SetPartial("tags") } diff --git a/aws/resource_aws_db_subnet_group_test.go b/aws/resource_aws_db_subnet_group_test.go index 94d709f7c44..df10aa76dc6 100644 --- a/aws/resource_aws_db_subnet_group_test.go +++ b/aws/resource_aws_db_subnet_group_test.go @@ -65,37 +65,13 @@ func testSweepRdsDbSubnetGroups(region string) error { return nil } -func TestAccAWSDBSubnetGroup_importBasic(t *testing.T) { - resourceName := "aws_db_subnet_group.foo" - - rName := fmt.Sprintf("tf-test-%d", acctest.RandInt()) - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckDBSubnetGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccDBSubnetGroupConfig(rName), - }, - - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{ - "description"}, - }, - }, - }) -} - func TestAccAWSDBSubnetGroup_basic(t *testing.T) { var v rds.DBSubnetGroup testCheck := func(*terraform.State) error { return nil } - + resourceName := "aws_db_subnet_group.test" rName := fmt.Sprintf("tf-test-%d", acctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ @@ -107,22 +83,30 @@ func TestAccAWSDBSubnetGroup_basic(t *testing.T) { Config: testAccDBSubnetGroupConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckDBSubnetGroupExists( - "aws_db_subnet_group.foo", &v), + resourceName, &v), resource.TestCheckResourceAttr( - "aws_db_subnet_group.foo", "name", rName), + resourceName, "name", rName), resource.TestCheckResourceAttr( - "aws_db_subnet_group.foo", "description", "Managed by Terraform"), + resourceName, "description", "Managed by Terraform"), resource.TestMatchResourceAttr( - "aws_db_subnet_group.foo", "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:rds:[^:]+:\\d{12}:subgrp:%s", rName))), + resourceName, "arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:rds:[^:]+:\\d{12}:subgrp:%s", rName))), testCheck, ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "description"}, + }, }, }) } func TestAccAWSDBSubnetGroup_namePrefix(t *testing.T) { var v rds.DBSubnetGroup + resourceName := "aws_db_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -133,9 +117,9 @@ func TestAccAWSDBSubnetGroup_namePrefix(t *testing.T) { Config: testAccDBSubnetGroupConfig_namePrefix, Check: resource.ComposeTestCheckFunc( testAccCheckDBSubnetGroupExists( - "aws_db_subnet_group.test", &v), + resourceName, &v), resource.TestMatchResourceAttr( - "aws_db_subnet_group.test", "name", regexp.MustCompile("^tf_test-")), + resourceName, "name", regexp.MustCompile("^tf_test-")), ), }, }, @@ -144,6 +128,7 @@ func TestAccAWSDBSubnetGroup_namePrefix(t *testing.T) { func TestAccAWSDBSubnetGroup_generatedName(t *testing.T) { var v rds.DBSubnetGroup + resourceName := "aws_db_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -154,7 +139,7 @@ func TestAccAWSDBSubnetGroup_generatedName(t *testing.T) { Config: testAccDBSubnetGroupConfig_generatedName, Check: resource.ComposeTestCheckFunc( testAccCheckDBSubnetGroupExists( - "aws_db_subnet_group.test", &v), + resourceName, &v), ), }, }, @@ -169,6 +154,7 @@ func TestAccAWSDBSubnetGroup_withUndocumentedCharacters(t *testing.T) { testCheck := func(*terraform.State) error { return nil } + resourceName := "aws_db_subnet_group.underscores" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -187,14 +173,22 @@ func TestAccAWSDBSubnetGroup_withUndocumentedCharacters(t *testing.T) { testCheck, ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "description"}, + }, }, }) } func TestAccAWSDBSubnetGroup_updateDescription(t *testing.T) { var v rds.DBSubnetGroup - + resourceName := "aws_db_subnet_group.test" rName := fmt.Sprintf("tf-test-%d", acctest.RandInt()) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -204,19 +198,25 @@ func TestAccAWSDBSubnetGroup_updateDescription(t *testing.T) { Config: testAccDBSubnetGroupConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckDBSubnetGroupExists( - "aws_db_subnet_group.foo", &v), + resourceName, &v), resource.TestCheckResourceAttr( - "aws_db_subnet_group.foo", "description", "Managed by Terraform"), + resourceName, "description", "Managed by Terraform"), ), }, - + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "description"}, + }, { Config: testAccDBSubnetGroupConfig_updatedDescription(rName), Check: resource.ComposeTestCheckFunc( testAccCheckDBSubnetGroupExists( - "aws_db_subnet_group.foo", &v), + resourceName, &v), resource.TestCheckResourceAttr( - "aws_db_subnet_group.foo", "description", "foo description updated"), + resourceName, "description", "test description updated"), ), }, }, @@ -288,7 +288,7 @@ data "aws_availability_zones" "available" { state = "available" } -resource "aws_vpc" "foo" { +resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" tags = { @@ -296,10 +296,10 @@ resource "aws_vpc" "foo" { } } -resource "aws_subnet" "foo" { +resource "aws_subnet" "test" { cidr_block = "10.1.1.0/24" availability_zone = "${data.aws_availability_zones.available.names[0]}" - vpc_id = "${aws_vpc.foo.id}" + vpc_id = "${aws_vpc.test.id}" tags = { Name = "tf-acc-db-subnet-group-1" @@ -309,16 +309,16 @@ resource "aws_subnet" "foo" { resource "aws_subnet" "bar" { cidr_block = "10.1.2.0/24" availability_zone = "${data.aws_availability_zones.available.names[1]}" - vpc_id = "${aws_vpc.foo.id}" + vpc_id = "${aws_vpc.test.id}" tags = { Name = "tf-acc-db-subnet-group-2" } } -resource "aws_db_subnet_group" "foo" { +resource "aws_db_subnet_group" "test" { name = "%s" - subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.bar.id}"] + subnet_ids = ["${aws_subnet.test.id}", "${aws_subnet.bar.id}"] tags = { Name = "tf-dbsubnet-group-test" @@ -333,7 +333,7 @@ data "aws_availability_zones" "available" { state = "available" } -resource "aws_vpc" "foo" { +resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" tags = { @@ -341,10 +341,10 @@ resource "aws_vpc" "foo" { } } -resource "aws_subnet" "foo" { +resource "aws_subnet" "test" { cidr_block = "10.1.1.0/24" availability_zone = "${data.aws_availability_zones.available.names[0]}" - vpc_id = "${aws_vpc.foo.id}" + vpc_id = "${aws_vpc.test.id}" tags = { Name = "tf-acc-db-subnet-group-1" @@ -354,17 +354,17 @@ resource "aws_subnet" "foo" { resource "aws_subnet" "bar" { cidr_block = "10.1.2.0/24" availability_zone = "${data.aws_availability_zones.available.names[1]}" - vpc_id = "${aws_vpc.foo.id}" + vpc_id = "${aws_vpc.test.id}" tags = { Name = "tf-acc-db-subnet-group-2" } } -resource "aws_db_subnet_group" "foo" { +resource "aws_db_subnet_group" "test" { name = "%s" - description = "foo description updated" - subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.bar.id}"] + description = "test description updated" + subnet_ids = ["${aws_subnet.test.id}", "${aws_subnet.bar.id}"] tags = { Name = "tf-dbsubnet-group-test" diff --git a/aws/resource_aws_default_network_acl.go b/aws/resource_aws_default_network_acl.go index e96ea6f58ed..80b5c86b41b 100644 --- a/aws/resource_aws_default_network_acl.go +++ b/aws/resource_aws_default_network_acl.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) // ACL Network ACLs all contain explicit deny-all rules that cannot be @@ -232,10 +233,12 @@ func resourceAwsDefaultNetworkAclUpdate(d *schema.ResourceData, meta interface{} } } - if err := setTags(conn, d); err != nil { - return err - } else { - d.SetPartial("tags") + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating EC2 Default Network ACL (%s) tags: %s", d.Id(), err) + } } d.Partial(false) diff --git a/aws/resource_aws_default_network_acl_test.go b/aws/resource_aws_default_network_acl_test.go index fa79b6e253f..bb01f4471f7 100644 --- a/aws/resource_aws_default_network_acl_test.go +++ b/aws/resource_aws_default_network_acl_test.go @@ -440,10 +440,6 @@ resource "aws_default_network_acl" "default" { ` const testAccAWSDefaultNetworkConfig_basicIpv6Vpc = ` -provider "aws" { - region = "us-east-2" -} - resource "aws_vpc" "tftestvpc" { cidr_block = "10.1.0.0/16" assign_generated_ipv6_cidr_block = true diff --git a/aws/resource_aws_default_route_table.go b/aws/resource_aws_default_route_table.go index 088ca40fa4c..964182a739c 100644 --- a/aws/resource_aws_default_route_table.go +++ b/aws/resource_aws_default_route_table.go @@ -107,12 +107,10 @@ func resourceAwsDefaultRouteTableCreate(d *schema.ResourceData, meta interface{} conn := meta.(*AWSClient).ec2conn rtRaw, _, err := resourceAwsRouteTableStateRefreshFunc(conn, d.Id())() if err != nil { - return err + return fmt.Errorf("error reading EC2 Default Route Table (%s): %s", d.Id(), err) } if rtRaw == nil { - log.Printf("[WARN] Default Route Table not found") - d.SetId("") - return nil + return fmt.Errorf("error reading EC2 Default Route Table (%s): not found", d.Id()) } rt := rtRaw.(*ec2.RouteTable) @@ -151,7 +149,9 @@ func resourceAwsDefaultRouteTableRead(d *schema.ResourceData, meta interface{}) } if len(resp.RouteTables) < 1 || resp.RouteTables[0] == nil { - return fmt.Errorf("Default Route table not found") + log.Printf("[WARN] EC2 Default Route Table (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil } rt := resp.RouteTables[0] diff --git a/aws/resource_aws_default_route_table_test.go b/aws/resource_aws_default_route_table_test.go index 0130135b3b0..dc6d2490697 100644 --- a/aws/resource_aws_default_route_table_test.go +++ b/aws/resource_aws_default_route_table_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -12,6 +13,65 @@ import ( ) func TestAccAWSDefaultRouteTable_basic(t *testing.T) { + var routeTable1 ec2.RouteTable + resourceName := "aws_default_route_table.test" + vpcResourceName := "aws_vpc.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckRouteTableDestroy, + Steps: []resource.TestStep{ + // Verify non-existent Route Table ID behavior + { + Config: testAccDefaultRouteTableConfigDefaultRouteTableId("rtb-00000000"), + ExpectError: regexp.MustCompile(`EC2 Default Route Table \(rtb-00000000\): not found`), + }, + // Verify invalid Route Table ID behavior + { + Config: testAccDefaultRouteTableConfigDefaultRouteTableId("vpc-00000000"), + ExpectError: regexp.MustCompile(`EC2 Default Route Table \(vpc-00000000\): not found`), + }, + { + Config: testAccDefaultRouteTableConfigRequired(), + Check: resource.ComposeTestCheckFunc( + testAccCheckRouteTableExists(resourceName, &routeTable1), + testAccCheckResourceAttrAccountID(resourceName, "owner_id"), + resource.TestCheckResourceAttr(resourceName, "propagating_vgws.#", "0"), + resource.TestCheckResourceAttr(resourceName, "route.#", "0"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttrPair(resourceName, "vpc_id", vpcResourceName, "id"), + ), + }, + }, + }) +} + +func TestAccAWSDefaultRouteTable_disappears_Vpc(t *testing.T) { + var routeTable1 ec2.RouteTable + var vpc1 ec2.Vpc + resourceName := "aws_default_route_table.test" + vpcResourceName := "aws_vpc.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckRouteTableDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDefaultRouteTableConfigRequired(), + Check: resource.ComposeTestCheckFunc( + testAccCheckRouteTableExists(resourceName, &routeTable1), + testAccCheckVpcExists(vpcResourceName, &vpc1), + testAccCheckVpcDisappears(&vpc1), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAWSDefaultRouteTable_Route(t *testing.T) { var v ec2.RouteTable resource.ParallelTest(t, resource.TestCase{ @@ -153,6 +213,26 @@ func testAccCheckDefaultRouteTableDestroy(s *terraform.State) error { return nil } +func testAccDefaultRouteTableConfigDefaultRouteTableId(defaultRouteTableId string) string { + return fmt.Sprintf(` +resource "aws_default_route_table" "test" { + default_route_table_id = %[1]q +} +`, defaultRouteTableId) +} + +func testAccDefaultRouteTableConfigRequired() string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" +} + +resource "aws_default_route_table" "test" { + default_route_table_id = aws_vpc.test.default_route_table_id +} +`) +} + const testAccDefaultRouteTableConfig = ` resource "aws_vpc" "foo" { cidr_block = "10.1.0.0/16" diff --git a/aws/resource_aws_default_security_group.go b/aws/resource_aws_default_security_group.go index 3da1cf4f19b..b9e07b97920 100644 --- a/aws/resource_aws_default_security_group.go +++ b/aws/resource_aws_default_security_group.go @@ -15,8 +15,11 @@ func resourceAwsDefaultSecurityGroup() *schema.Resource { dsg.Create = resourceAwsDefaultSecurityGroupCreate dsg.Delete = resourceAwsDefaultSecurityGroupDelete - // Descriptions cannot be updated - delete(dsg.Schema, "description") + // description is a computed value for Default Security Groups and cannot be changed + dsg.Schema["description"] = &schema.Schema{ + Type: schema.TypeString, + Computed: true, + } // name is a computed value for Default Security Groups and cannot be changed delete(dsg.Schema, "name_prefix") diff --git a/aws/resource_aws_default_security_group_test.go b/aws/resource_aws_default_security_group_test.go index 0809a1bcef8..4cf3e0392f0 100644 --- a/aws/resource_aws_default_security_group_test.go +++ b/aws/resource_aws_default_security_group_test.go @@ -27,6 +27,8 @@ func TestAccAWSDefaultSecurityGroup_basic(t *testing.T) { testAccCheckAWSDefaultSecurityGroupAttributes(&group), resource.TestCheckResourceAttr( "aws_default_security_group.web", "name", "default"), + resource.TestCheckResourceAttr( + "aws_default_security_group.web", "description", "default VPC security group"), resource.TestCheckResourceAttr( "aws_default_security_group.web", "ingress.3629188364.protocol", "tcp"), resource.TestCheckResourceAttr( diff --git a/aws/resource_aws_directory_service_directory.go b/aws/resource_aws_directory_service_directory.go index f0cc682dac0..75e5933c8a0 100644 --- a/aws/resource_aws_directory_service_directory.go +++ b/aws/resource_aws_directory_service_directory.go @@ -5,12 +5,12 @@ import ( "log" "time" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/directoryservice" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDirectoryServiceDirectory() *schema.Resource { @@ -215,7 +215,7 @@ func createDirectoryConnector(dsconn *directoryservice.DirectoryService, d *sche input := directoryservice.ConnectDirectoryInput{ Name: aws.String(d.Get("name").(string)), Password: aws.String(d.Get("password").(string)), - Tags: tagsFromMapDS(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().DirectoryserviceTags(), } if v, ok := d.GetOk("description"); ok { @@ -250,7 +250,7 @@ func createSimpleDirectoryService(dsconn *directoryservice.DirectoryService, d * input := directoryservice.CreateDirectoryInput{ Name: aws.String(d.Get("name").(string)), Password: aws.String(d.Get("password").(string)), - Tags: tagsFromMapDS(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().DirectoryserviceTags(), } if v, ok := d.GetOk("description"); ok { @@ -285,7 +285,7 @@ func createActiveDirectoryService(dsconn *directoryservice.DirectoryService, d * input := directoryservice.CreateMicrosoftADInput{ Name: aws.String(d.Get("name").(string)), Password: aws.String(d.Get("password").(string)), - Tags: tagsFromMapDS(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().DirectoryserviceTags(), } if v, ok := d.GetOk("description"); ok { @@ -423,8 +423,12 @@ func resourceAwsDirectoryServiceDirectoryUpdate(d *schema.ResourceData, meta int } } - if err := setTagsDS(dsconn, d, d.Id()); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.DirectoryserviceUpdateTags(dsconn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating Directory Service Directory (%s) tags: %s", d.Id(), err) + } } return resourceAwsDirectoryServiceDirectoryRead(d, meta) @@ -475,13 +479,15 @@ func resourceAwsDirectoryServiceDirectoryRead(d *schema.ResourceData, meta inter d.Set("security_group_id", aws.StringValue(dir.VpcSettings.SecurityGroupId)) } - tagList, err := dsconn.ListTagsForResource(&directoryservice.ListTagsForResourceInput{ - ResourceId: aws.String(d.Id()), - }) + tags, err := keyvaluetags.DirectoryserviceListTags(dsconn, d.Id()) + if err != nil { - return fmt.Errorf("Failed to get Directory service tags (id: %s): %s", d.Id(), err) + return fmt.Errorf("error listing tags for Directory Service Directory (%s): %s", d.Id(), err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - d.Set("tags", tagsToMapDS(tagList.Tags)) return nil } diff --git a/aws/resource_aws_directory_service_directory_test.go b/aws/resource_aws_directory_service_directory_test.go index 6399577fe03..c1796200c19 100644 --- a/aws/resource_aws_directory_service_directory_test.go +++ b/aws/resource_aws_directory_service_directory_test.go @@ -3,7 +3,6 @@ package aws import ( "fmt" "log" - "reflect" "testing" "github.com/aws/aws-sdk-go/aws" @@ -18,7 +17,7 @@ func init() { resource.AddTestSweepers("aws_directory_service_directory", &resource.Sweeper{ Name: "aws_directory_service_directory", F: testSweepDirectoryServiceDirectories, - Dependencies: []string{"aws_fsx_windows_file_system"}, + Dependencies: []string{"aws_fsx_windows_file_system", "aws_workspaces_directory"}, }) } @@ -72,59 +71,8 @@ func testSweepDirectoryServiceDirectories(region string) error { return nil } -func TestDiffTagsDirectoryService(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsDS(tagsFromMapDS(tc.Old), tagsFromMapDS(tc.New)) - cm := tagsToMapDS(c) - rm := tagsToMapDS(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestAccAWSDirectoryServiceDirectory_importBasic(t *testing.T) { - resourceName := "aws_directory_service_directory.bar" +func TestAccAWSDirectoryServiceDirectory_basic(t *testing.T) { + resourceName := "aws_directory_service_directory.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -137,6 +85,10 @@ func TestAccAWSDirectoryServiceDirectory_importBasic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccDirectoryServiceDirectoryConfig, + Check: resource.ComposeTestCheckFunc( + testAccCheckServiceDirectoryExists("aws_directory_service_directory.test"), + resource.TestCheckResourceAttrSet("aws_directory_service_directory.test", "security_group_id"), + ), }, { ResourceName: resourceName, @@ -150,28 +102,9 @@ func TestAccAWSDirectoryServiceDirectory_importBasic(t *testing.T) { }) } -func TestAccAWSDirectoryServiceDirectory_basic(t *testing.T) { - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - testAccPreCheckAWSDirectoryService(t) - testAccPreCheckAWSDirectoryServiceSimpleDirectory(t) - }, - Providers: testAccProviders, - CheckDestroy: testAccCheckDirectoryServiceDirectoryDestroy, - Steps: []resource.TestStep{ - { - Config: testAccDirectoryServiceDirectoryConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckServiceDirectoryExists("aws_directory_service_directory.bar"), - resource.TestCheckResourceAttrSet("aws_directory_service_directory.bar", "security_group_id"), - ), - }, - }, - }) -} - func TestAccAWSDirectoryServiceDirectory_tags(t *testing.T) { + resourceName := "aws_directory_service_directory.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) @@ -184,28 +117,36 @@ func TestAccAWSDirectoryServiceDirectory_tags(t *testing.T) { { Config: testAccDirectoryServiceDirectoryTagsConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckServiceDirectoryExists("aws_directory_service_directory.bar"), - resource.TestCheckResourceAttr("aws_directory_service_directory.bar", "tags.%", "2"), - resource.TestCheckResourceAttr("aws_directory_service_directory.bar", "tags.foo", "bar"), - resource.TestCheckResourceAttr("aws_directory_service_directory.bar", "tags.project", "test"), + testAccCheckServiceDirectoryExists("aws_directory_service_directory.test"), + resource.TestCheckResourceAttr("aws_directory_service_directory.test", "tags.%", "2"), + resource.TestCheckResourceAttr("aws_directory_service_directory.test", "tags.foo", "test"), + resource.TestCheckResourceAttr("aws_directory_service_directory.test", "tags.project", "test"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "password", + }, + }, { Config: testAccDirectoryServiceDirectoryUpdateTagsConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckServiceDirectoryExists("aws_directory_service_directory.bar"), - resource.TestCheckResourceAttr("aws_directory_service_directory.bar", "tags.%", "3"), - resource.TestCheckResourceAttr("aws_directory_service_directory.bar", "tags.foo", "bar"), - resource.TestCheckResourceAttr("aws_directory_service_directory.bar", "tags.project", "test2"), - resource.TestCheckResourceAttr("aws_directory_service_directory.bar", "tags.fizz", "buzz"), + testAccCheckServiceDirectoryExists("aws_directory_service_directory.test"), + resource.TestCheckResourceAttr("aws_directory_service_directory.test", "tags.%", "3"), + resource.TestCheckResourceAttr("aws_directory_service_directory.test", "tags.foo", "test"), + resource.TestCheckResourceAttr("aws_directory_service_directory.test", "tags.project", "test2"), + resource.TestCheckResourceAttr("aws_directory_service_directory.test", "tags.fizz", "buzz"), ), }, { Config: testAccDirectoryServiceDirectoryRemoveTagsConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckServiceDirectoryExists("aws_directory_service_directory.bar"), - resource.TestCheckResourceAttr("aws_directory_service_directory.bar", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_directory_service_directory.bar", "tags.foo", "bar"), + testAccCheckServiceDirectoryExists("aws_directory_service_directory.test"), + resource.TestCheckResourceAttr("aws_directory_service_directory.test", "tags.%", "1"), + resource.TestCheckResourceAttr("aws_directory_service_directory.test", "tags.foo", "test"), ), }, }, @@ -213,6 +154,8 @@ func TestAccAWSDirectoryServiceDirectory_tags(t *testing.T) { } func TestAccAWSDirectoryServiceDirectory_microsoft(t *testing.T) { + resourceName := "aws_directory_service_directory.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDirectoryService(t) }, Providers: testAccProviders, @@ -221,15 +164,25 @@ func TestAccAWSDirectoryServiceDirectory_microsoft(t *testing.T) { { Config: testAccDirectoryServiceDirectoryConfig_microsoft, Check: resource.ComposeTestCheckFunc( - testAccCheckServiceDirectoryExists("aws_directory_service_directory.bar"), - resource.TestCheckResourceAttr("aws_directory_service_directory.bar", "edition", directoryservice.DirectoryEditionEnterprise), + testAccCheckServiceDirectoryExists("aws_directory_service_directory.test"), + resource.TestCheckResourceAttr("aws_directory_service_directory.test", "edition", directoryservice.DirectoryEditionEnterprise), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "password", + }, + }, }, }) } func TestAccAWSDirectoryServiceDirectory_microsoftStandard(t *testing.T) { + resourceName := "aws_directory_service_directory.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDirectoryService(t) }, Providers: testAccProviders, @@ -238,15 +191,25 @@ func TestAccAWSDirectoryServiceDirectory_microsoftStandard(t *testing.T) { { Config: testAccDirectoryServiceDirectoryConfig_microsoftStandard, Check: resource.ComposeTestCheckFunc( - testAccCheckServiceDirectoryExists("aws_directory_service_directory.bar"), - resource.TestCheckResourceAttr("aws_directory_service_directory.bar", "edition", directoryservice.DirectoryEditionStandard), + testAccCheckServiceDirectoryExists("aws_directory_service_directory.test"), + resource.TestCheckResourceAttr("aws_directory_service_directory.test", "edition", directoryservice.DirectoryEditionStandard), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "password", + }, + }, }, }) } func TestAccAWSDirectoryServiceDirectory_connector(t *testing.T) { + resourceName := "aws_directory_service_directory.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) @@ -263,12 +226,21 @@ func TestAccAWSDirectoryServiceDirectory_connector(t *testing.T) { resource.TestCheckResourceAttrSet("aws_directory_service_directory.connector", "security_group_id"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "password", + }, + }, }, }) } func TestAccAWSDirectoryServiceDirectory_withAliasAndSso(t *testing.T) { alias := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_directory_service_directory.test2" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -282,25 +254,33 @@ func TestAccAWSDirectoryServiceDirectory_withAliasAndSso(t *testing.T) { { Config: testAccDirectoryServiceDirectoryConfig_withAlias(alias), Check: resource.ComposeTestCheckFunc( - testAccCheckServiceDirectoryExists("aws_directory_service_directory.bar_a"), - testAccCheckServiceDirectoryAlias("aws_directory_service_directory.bar_a", alias), - testAccCheckServiceDirectorySso("aws_directory_service_directory.bar_a", false), + testAccCheckServiceDirectoryExists("aws_directory_service_directory.test2"), + testAccCheckServiceDirectoryAlias("aws_directory_service_directory.test2", alias), + testAccCheckServiceDirectorySso("aws_directory_service_directory.test2", false), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "password", + }, + }, { Config: testAccDirectoryServiceDirectoryConfig_withSso(alias), Check: resource.ComposeTestCheckFunc( - testAccCheckServiceDirectoryExists("aws_directory_service_directory.bar_a"), - testAccCheckServiceDirectoryAlias("aws_directory_service_directory.bar_a", alias), - testAccCheckServiceDirectorySso("aws_directory_service_directory.bar_a", true), + testAccCheckServiceDirectoryExists("aws_directory_service_directory.test2"), + testAccCheckServiceDirectoryAlias("aws_directory_service_directory.test2", alias), + testAccCheckServiceDirectorySso("aws_directory_service_directory.test2", true), ), }, { Config: testAccDirectoryServiceDirectoryConfig_withSso_modified(alias), Check: resource.ComposeTestCheckFunc( - testAccCheckServiceDirectoryExists("aws_directory_service_directory.bar_a"), - testAccCheckServiceDirectoryAlias("aws_directory_service_directory.bar_a", alias), - testAccCheckServiceDirectorySso("aws_directory_service_directory.bar_a", false), + testAccCheckServiceDirectoryExists("aws_directory_service_directory.test2"), + testAccCheckServiceDirectoryAlias("aws_directory_service_directory.test2", alias), + testAccCheckServiceDirectorySso("aws_directory_service_directory.test2", false), ), }, }, @@ -471,14 +451,14 @@ data "aws_availability_zones" "available" { state = "available" } -resource "aws_directory_service_directory" "bar" { +resource "aws_directory_service_directory" "test" { name = "corp.notexample.com" password = "SuperSecretPassw0rd" size = "Small" vpc_settings { vpc_id = "${aws_vpc.main.id}" - subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.bar.id}"] + subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.test.id}"] } } @@ -497,12 +477,12 @@ resource "aws_subnet" "foo" { Name = "tf-acc-directory-service-directory-foo" } } -resource "aws_subnet" "bar" { +resource "aws_subnet" "test" { vpc_id = "${aws_vpc.main.id}" availability_zone = "${data.aws_availability_zones.available.names[1]}" cidr_block = "10.0.2.0/24" tags = { - Name = "tf-acc-directory-service-directory-bar" + Name = "tf-acc-directory-service-directory-test" } } ` @@ -512,18 +492,18 @@ data "aws_availability_zones" "available" { state = "available" } -resource "aws_directory_service_directory" "bar" { +resource "aws_directory_service_directory" "test" { name = "corp.notexample.com" password = "SuperSecretPassw0rd" size = "Small" vpc_settings { vpc_id = "${aws_vpc.main.id}" - subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.bar.id}"] + subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.test.id}"] } tags = { - foo = "bar" + foo = "test" project = "test" } } @@ -543,12 +523,12 @@ resource "aws_subnet" "foo" { Name = "tf-acc-directory-service-directory-tags-foo" } } -resource "aws_subnet" "bar" { +resource "aws_subnet" "test" { vpc_id = "${aws_vpc.main.id}" availability_zone = "${data.aws_availability_zones.available.names[1]}" cidr_block = "10.0.2.0/24" tags = { - Name = "tf-acc-directory-service-directory-tags-bar" + Name = "tf-acc-directory-service-directory-tags-test" } } ` @@ -558,18 +538,18 @@ data "aws_availability_zones" "available" { state = "available" } -resource "aws_directory_service_directory" "bar" { +resource "aws_directory_service_directory" "test" { name = "corp.notexample.com" password = "SuperSecretPassw0rd" size = "Small" vpc_settings { vpc_id = "${aws_vpc.main.id}" - subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.bar.id}"] + subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.test.id}"] } tags = { - foo = "bar" + foo = "test" project = "test2" fizz = "buzz" } @@ -590,12 +570,12 @@ resource "aws_subnet" "foo" { Name = "tf-acc-directory-service-directory-tags-foo" } } -resource "aws_subnet" "bar" { +resource "aws_subnet" "test" { vpc_id = "${aws_vpc.main.id}" availability_zone = "${data.aws_availability_zones.available.names[1]}" cidr_block = "10.0.2.0/24" tags = { - Name = "tf-acc-directory-service-directory-tags-bar" + Name = "tf-acc-directory-service-directory-tags-test" } } ` @@ -605,18 +585,18 @@ data "aws_availability_zones" "available" { state = "available" } -resource "aws_directory_service_directory" "bar" { +resource "aws_directory_service_directory" "test" { name = "corp.notexample.com" password = "SuperSecretPassw0rd" size = "Small" vpc_settings { vpc_id = "${aws_vpc.main.id}" - subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.bar.id}"] + subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.test.id}"] } tags = { - foo = "bar" + foo = "test" } } @@ -635,12 +615,12 @@ resource "aws_subnet" "foo" { Name = "tf-acc-directory-service-directory-tags-foo" } } -resource "aws_subnet" "bar" { +resource "aws_subnet" "test" { vpc_id = "${aws_vpc.main.id}" availability_zone = "${data.aws_availability_zones.available.names[1]}" cidr_block = "10.0.2.0/24" tags = { - Name = "tf-acc-directory-service-directory-tags-bar" + Name = "tf-acc-directory-service-directory-tags-test" } } ` @@ -650,14 +630,14 @@ data "aws_availability_zones" "available" { state = "available" } -resource "aws_directory_service_directory" "bar" { +resource "aws_directory_service_directory" "test" { name = "corp.notexample.com" password = "SuperSecretPassw0rd" size = "Small" vpc_settings { vpc_id = "${aws_vpc.main.id}" - subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.bar.id}"] + subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.test.id}"] } } @@ -668,10 +648,10 @@ resource "aws_directory_service_directory" "connector" { type = "ADConnector" connect_settings { - customer_dns_ips = aws_directory_service_directory.bar.dns_ip_addresses + customer_dns_ips = aws_directory_service_directory.test.dns_ip_addresses customer_username = "Administrator" vpc_id = "${aws_vpc.main.id}" - subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.bar.id}"] + subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.test.id}"] } } @@ -690,12 +670,12 @@ resource "aws_subnet" "foo" { Name = "tf-acc-directory-service-directory-connector-foo" } } -resource "aws_subnet" "bar" { +resource "aws_subnet" "test" { vpc_id = "${aws_vpc.main.id}" availability_zone = "${data.aws_availability_zones.available.names[1]}" cidr_block = "10.0.2.0/24" tags = { - Name = "tf-acc-directory-service-directory-connector-bar" + Name = "tf-acc-directory-service-directory-connector-test" } } ` @@ -705,14 +685,14 @@ data "aws_availability_zones" "available" { state = "available" } -resource "aws_directory_service_directory" "bar" { +resource "aws_directory_service_directory" "test" { name = "corp.notexample.com" password = "SuperSecretPassw0rd" type = "MicrosoftAD" vpc_settings { vpc_id = "${aws_vpc.main.id}" - subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.bar.id}"] + subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.test.id}"] } } @@ -731,12 +711,12 @@ resource "aws_subnet" "foo" { Name = "tf-acc-directory-service-directory-microsoft-foo" } } -resource "aws_subnet" "bar" { +resource "aws_subnet" "test" { vpc_id = "${aws_vpc.main.id}" availability_zone = "${data.aws_availability_zones.available.names[1]}" cidr_block = "10.0.2.0/24" tags = { - Name = "tf-acc-directory-service-directory-microsoft-bar" + Name = "tf-acc-directory-service-directory-microsoft-test" } } ` @@ -746,7 +726,7 @@ data "aws_availability_zones" "available" { state = "available" } -resource "aws_directory_service_directory" "bar" { +resource "aws_directory_service_directory" "test" { name = "corp.notexample.com" password = "SuperSecretPassw0rd" type = "MicrosoftAD" @@ -754,7 +734,7 @@ resource "aws_directory_service_directory" "bar" { vpc_settings { vpc_id = "${aws_vpc.main.id}" - subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.bar.id}"] + subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.test.id}"] } } @@ -773,12 +753,12 @@ resource "aws_subnet" "foo" { Name = "tf-acc-directory-service-directory-microsoft-foo" } } -resource "aws_subnet" "bar" { +resource "aws_subnet" "test" { vpc_id = "${aws_vpc.main.id}" availability_zone = "${data.aws_availability_zones.available.names[1]}" cidr_block = "10.0.2.0/24" tags = { - Name = "tf-acc-directory-service-directory-microsoft-bar" + Name = "tf-acc-directory-service-directory-microsoft-test" } } ` @@ -789,7 +769,7 @@ data "aws_availability_zones" "available" { state = "available" } -resource "aws_directory_service_directory" "bar_a" { +resource "aws_directory_service_directory" "test2" { name = "corp.notexample.com" password = "SuperSecretPassw0rd" size = "Small" @@ -797,7 +777,7 @@ resource "aws_directory_service_directory" "bar_a" { vpc_settings { vpc_id = "${aws_vpc.main.id}" - subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.bar.id}"] + subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.test.id}"] } } @@ -816,12 +796,12 @@ resource "aws_subnet" "foo" { Name = "tf-acc-directory-service-directory-with-alias-foo" } } -resource "aws_subnet" "bar" { +resource "aws_subnet" "test" { vpc_id = "${aws_vpc.main.id}" availability_zone = "${data.aws_availability_zones.available.names[1]}" cidr_block = "10.0.2.0/24" tags = { - Name = "tf-acc-directory-service-directory-with-alias-bar" + Name = "tf-acc-directory-service-directory-with-alias-test" } } `, alias) @@ -833,7 +813,7 @@ data "aws_availability_zones" "available" { state = "available" } -resource "aws_directory_service_directory" "bar_a" { +resource "aws_directory_service_directory" "test2" { name = "corp.notexample.com" password = "SuperSecretPassw0rd" size = "Small" @@ -842,7 +822,7 @@ resource "aws_directory_service_directory" "bar_a" { vpc_settings { vpc_id = "${aws_vpc.main.id}" - subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.bar.id}"] + subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.test.id}"] } } @@ -861,12 +841,12 @@ resource "aws_subnet" "foo" { Name = "tf-acc-directory-service-directory-with-sso-foo" } } -resource "aws_subnet" "bar" { +resource "aws_subnet" "test" { vpc_id = "${aws_vpc.main.id}" availability_zone = "${data.aws_availability_zones.available.names[1]}" cidr_block = "10.0.2.0/24" tags = { - Name = "tf-acc-directory-service-directory-with-sso-bar" + Name = "tf-acc-directory-service-directory-with-sso-test" } } `, alias) @@ -878,7 +858,7 @@ data "aws_availability_zones" "available" { state = "available" } -resource "aws_directory_service_directory" "bar_a" { +resource "aws_directory_service_directory" "test2" { name = "corp.notexample.com" password = "SuperSecretPassw0rd" size = "Small" @@ -887,7 +867,7 @@ resource "aws_directory_service_directory" "bar_a" { vpc_settings { vpc_id = "${aws_vpc.main.id}" - subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.bar.id}"] + subnet_ids = ["${aws_subnet.foo.id}", "${aws_subnet.test.id}"] } } @@ -906,12 +886,12 @@ resource "aws_subnet" "foo" { Name = "tf-acc-directory-service-directory-with-sso-foo" } } -resource "aws_subnet" "bar" { +resource "aws_subnet" "test" { vpc_id = "${aws_vpc.main.id}" availability_zone = "${data.aws_availability_zones.available.names[1]}" cidr_block = "10.0.2.0/24" tags = { - Name = "tf-acc-directory-service-directory-with-sso-bar" + Name = "tf-acc-directory-service-directory-with-sso-test" } } `, alias) diff --git a/aws/resource_aws_dlm_lifecycle_policy.go b/aws/resource_aws_dlm_lifecycle_policy.go index 0dbfd6cf052..8b4f1e305bd 100644 --- a/aws/resource_aws_dlm_lifecycle_policy.go +++ b/aws/resource_aws_dlm_lifecycle_policy.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/dlm" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDlmLifecyclePolicy() *schema.Resource { @@ -22,6 +23,10 @@ func resourceAwsDlmLifecyclePolicy() *schema.Resource { }, Schema: map[string]*schema.Schema{ + "arn": { + Type: schema.TypeString, + Computed: true, + }, "description": { Type: schema.TypeString, Required: true, @@ -130,6 +135,7 @@ func resourceAwsDlmLifecyclePolicy() *schema.Resource { dlm.SettablePolicyStateValuesEnabled, }, false), }, + "tags": tagsSchema(), }, } } @@ -144,6 +150,10 @@ func resourceAwsDlmLifecyclePolicyCreate(d *schema.ResourceData, meta interface{ State: aws.String(d.Get("state").(string)), } + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + input.Tags = keyvaluetags.New(v).IgnoreAws().DlmTags() + } + log.Printf("[INFO] Creating DLM lifecycle policy: %s", input) out, err := conn.CreateLifecyclePolicy(&input) if err != nil { @@ -173,6 +183,7 @@ func resourceAwsDlmLifecyclePolicyRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("error reading DLM Lifecycle Policy (%s): %s", d.Id(), err) } + d.Set("arn", out.Policy.PolicyArn) d.Set("description", out.Policy.Description) d.Set("execution_role_arn", out.Policy.ExecutionRoleArn) d.Set("state", out.Policy.State) @@ -180,6 +191,10 @@ func resourceAwsDlmLifecyclePolicyRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("error setting policy details %s", err) } + if err := d.Set("tags", keyvaluetags.DlmKeyValueTags(out.Policy.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + return nil } @@ -189,24 +204,38 @@ func resourceAwsDlmLifecyclePolicyUpdate(d *schema.ResourceData, meta interface{ input := dlm.UpdateLifecyclePolicyInput{ PolicyId: aws.String(d.Id()), } + updateLifecyclePolicy := false if d.HasChange("description") { input.Description = aws.String(d.Get("description").(string)) + updateLifecyclePolicy = true } if d.HasChange("execution_role_arn") { input.ExecutionRoleArn = aws.String(d.Get("execution_role_arn").(string)) + updateLifecyclePolicy = true } if d.HasChange("state") { input.State = aws.String(d.Get("state").(string)) + updateLifecyclePolicy = true } if d.HasChange("policy_details") { input.PolicyDetails = expandDlmPolicyDetails(d.Get("policy_details").([]interface{})) + updateLifecyclePolicy = true } - log.Printf("[INFO] Updating lifecycle policy %s", d.Id()) - _, err := conn.UpdateLifecyclePolicy(&input) - if err != nil { - return fmt.Errorf("error updating DLM Lifecycle Policy (%s): %s", d.Id(), err) + if updateLifecyclePolicy { + log.Printf("[INFO] Updating lifecycle policy %s", d.Id()) + _, err := conn.UpdateLifecyclePolicy(&input) + if err != nil { + return fmt.Errorf("error updating DLM Lifecycle Policy (%s): %s", d.Id(), err) + } + } + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.DlmUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } } return resourceAwsDlmLifecyclePolicyRead(d, meta) diff --git a/aws/resource_aws_dlm_lifecycle_policy_test.go b/aws/resource_aws_dlm_lifecycle_policy_test.go index a859a14a454..10b84f5be56 100644 --- a/aws/resource_aws_dlm_lifecycle_policy_test.go +++ b/aws/resource_aws_dlm_lifecycle_policy_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -24,6 +25,7 @@ func TestAccAWSDlmLifecyclePolicy_Basic(t *testing.T) { Config: dlmLifecyclePolicyBasicConfig(rName), Check: resource.ComposeTestCheckFunc( checkDlmLifecyclePolicyExists(resourceName), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "dlm", regexp.MustCompile(`policy/.+`)), resource.TestCheckResourceAttr(resourceName, "description", "tf-acc-basic"), resource.TestCheckResourceAttrSet(resourceName, "execution_role_arn"), resource.TestCheckResourceAttr(resourceName, "state", "ENABLED"), @@ -34,6 +36,7 @@ func TestAccAWSDlmLifecyclePolicy_Basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "policy_details.0.schedule.0.create_rule.0.times.0"), resource.TestCheckResourceAttr(resourceName, "policy_details.0.schedule.0.retain_rule.0.count", "10"), resource.TestCheckResourceAttr(resourceName, "policy_details.0.target_tags.tf-acc-test", "basic"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -94,6 +97,49 @@ func TestAccAWSDlmLifecyclePolicy_Full(t *testing.T) { }) } +func TestAccAWSDlmLifecyclePolicy_Tags(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_dlm_lifecycle_policy.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDlm(t) }, + Providers: testAccProviders, + CheckDestroy: dlmLifecyclePolicyDestroy, + Steps: []resource.TestStep{ + { + Config: dlmLifecyclePolicyConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + checkDlmLifecyclePolicyExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: dlmLifecyclePolicyConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + checkDlmLifecyclePolicyExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: dlmLifecyclePolicyConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + checkDlmLifecyclePolicyExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func dlmLifecyclePolicyDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).dlmconn @@ -327,3 +373,110 @@ resource "aws_dlm_lifecycle_policy" "full" { } `, rName) } + +func dlmLifecyclePolicyConfigTags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_iam_role" "test" { + name = %[1]q + + assume_role_policy = < 0 { + req.Tags = keyvaluetags.New(v).IgnoreAws().DirectconnectTags() + } + log.Printf("[DEBUG] Creating Direct Connect connection: %#v", req) resp, err := conn.CreateConnection(req) if err != nil { @@ -76,7 +81,8 @@ func resourceAwsDxConnectionCreate(d *schema.ResourceData, meta interface{}) err } d.SetId(aws.StringValue(resp.ConnectionId)) - return resourceAwsDxConnectionUpdate(d, meta) + + return resourceAwsDxConnectionRead(d, meta) } func resourceAwsDxConnectionRead(d *schema.ResourceData, meta interface{}) error { @@ -127,22 +133,29 @@ func resourceAwsDxConnectionRead(d *schema.ResourceData, meta interface{}) error d.Set("has_logical_redundancy", connection.HasLogicalRedundancy) d.Set("aws_device", connection.AwsDeviceV2) - err1 := getTagsDX(conn, d, arn) - return err1 + tags, err := keyvaluetags.DirectconnectListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for Direct Connect connection (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + return nil } func resourceAwsDxConnectionUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).dxconn - arn := arn.ARN{ - Partition: meta.(*AWSClient).partition, - Region: meta.(*AWSClient).region, - Service: "directconnect", - AccountID: meta.(*AWSClient).accountid, - Resource: fmt.Sprintf("dxcon/%s", d.Id()), - }.String() - if err := setTagsDX(conn, d, arn); err != nil { - return err + arn := d.Get("arn").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.DirectconnectUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating Direct Connect connection (%s) tags: %s", arn, err) + } } return resourceAwsDxConnectionRead(d, meta) diff --git a/aws/resource_aws_dx_connection_test.go b/aws/resource_aws_dx_connection_test.go index f5613c16dd7..eba52fe2590 100644 --- a/aws/resource_aws_dx_connection_test.go +++ b/aws/resource_aws_dx_connection_test.go @@ -11,29 +11,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSDxConnection_importBasic(t *testing.T) { - resourceName := "aws_dx_connection.hoge" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAwsDxConnectionDestroy, - Steps: []resource.TestStep{ - { - Config: testAccDxConnectionConfig(acctest.RandString(5)), - }, - - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func TestAccAWSDxConnection_basic(t *testing.T) { connectionName := fmt.Sprintf("tf-dx-%s", acctest.RandString(5)) + resourceName := "aws_dx_connection.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -43,19 +23,25 @@ func TestAccAWSDxConnection_basic(t *testing.T) { { Config: testAccDxConnectionConfig(connectionName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxConnectionExists("aws_dx_connection.hoge"), - resource.TestCheckResourceAttr("aws_dx_connection.hoge", "name", connectionName), - resource.TestCheckResourceAttr("aws_dx_connection.hoge", "bandwidth", "1Gbps"), - resource.TestCheckResourceAttr("aws_dx_connection.hoge", "location", "EqSe2"), - resource.TestCheckResourceAttr("aws_dx_connection.hoge", "tags.%", "0"), + testAccCheckAwsDxConnectionExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", connectionName), + resource.TestCheckResourceAttr(resourceName, "bandwidth", "1Gbps"), + resource.TestCheckResourceAttr(resourceName, "location", "EqSe2"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSDxConnection_tags(t *testing.T) { connectionName := fmt.Sprintf("tf-dx-%s", acctest.RandString(5)) + resourceName := "aws_dx_connection.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -65,19 +51,24 @@ func TestAccAWSDxConnection_tags(t *testing.T) { { Config: testAccDxConnectionConfig_tags(connectionName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxConnectionExists("aws_dx_connection.hoge"), - resource.TestCheckResourceAttr("aws_dx_connection.hoge", "name", connectionName), - resource.TestCheckResourceAttr("aws_dx_connection.hoge", "tags.%", "2"), - resource.TestCheckResourceAttr("aws_dx_connection.hoge", "tags.Usage", "original"), + testAccCheckAwsDxConnectionExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", connectionName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.Usage", "original"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccDxConnectionConfig_tagsChanged(connectionName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxConnectionExists("aws_dx_connection.hoge"), - resource.TestCheckResourceAttr("aws_dx_connection.hoge", "name", connectionName), - resource.TestCheckResourceAttr("aws_dx_connection.hoge", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_dx_connection.hoge", "tags.Usage", "changed"), + testAccCheckAwsDxConnectionExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", connectionName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.Usage", "changed"), ), }, }, @@ -122,7 +113,7 @@ func testAccCheckAwsDxConnectionExists(name string) resource.TestCheckFunc { func testAccDxConnectionConfig(n string) string { return fmt.Sprintf(` -resource "aws_dx_connection" "hoge" { +resource "aws_dx_connection" "test" { name = "%s" bandwidth = "1Gbps" location = "EqSe2" @@ -132,7 +123,7 @@ resource "aws_dx_connection" "hoge" { func testAccDxConnectionConfig_tags(n string) string { return fmt.Sprintf(` -resource "aws_dx_connection" "hoge" { +resource "aws_dx_connection" "test" { name = "%s" bandwidth = "1Gbps" location = "EqSe2" @@ -147,7 +138,7 @@ resource "aws_dx_connection" "hoge" { func testAccDxConnectionConfig_tagsChanged(n string) string { return fmt.Sprintf(` -resource "aws_dx_connection" "hoge" { +resource "aws_dx_connection" "test" { name = "%s" bandwidth = "1Gbps" location = "EqSe2" diff --git a/aws/resource_aws_dx_gateway_association.go b/aws/resource_aws_dx_gateway_association.go index 4034c72a68c..3c724d4d9b1 100644 --- a/aws/resource_aws_dx_gateway_association.go +++ b/aws/resource_aws_dx_gateway_association.go @@ -27,6 +27,15 @@ func resourceAwsDxGatewayAssociation() *schema.Resource { State: resourceAwsDxGatewayAssociationImport, }, + SchemaVersion: 1, + StateUpgraders: []schema.StateUpgrader{ + { + Type: resourceAwsDxGatewayAssociationResourceV0().CoreConfigSchema().ImpliedType(), + Upgrade: resourceAwsDxGatewayAssociationStateUpgradeV0, + Version: 0, + }, + }, + Schema: map[string]*schema.Schema{ "allowed_prefixes": { Type: schema.TypeSet, diff --git a/aws/resource_aws_dx_gateway_association_migrate.go b/aws/resource_aws_dx_gateway_association_migrate.go new file mode 100644 index 00000000000..8986f1d80ac --- /dev/null +++ b/aws/resource_aws_dx_gateway_association_migrate.go @@ -0,0 +1,101 @@ +package aws + +import ( + "fmt" + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/directconnect" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func resourceAwsDxGatewayAssociationResourceV0() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allowed_prefixes": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + + "associated_gateway_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ConflictsWith: []string{"associated_gateway_owner_account_id", "proposal_id", "vpn_gateway_id"}, + }, + + "associated_gateway_owner_account_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validateAwsAccountId, + ConflictsWith: []string{"associated_gateway_id", "vpn_gateway_id"}, + }, + + "associated_gateway_type": { + Type: schema.TypeString, + Computed: true, + }, + + "dx_gateway_association_id": { + Type: schema.TypeString, + Computed: true, + }, + + "dx_gateway_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "dx_gateway_owner_account_id": { + Type: schema.TypeString, + Computed: true, + }, + + "proposal_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ConflictsWith: []string{"associated_gateway_id", "vpn_gateway_id"}, + }, + + "vpn_gateway_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ConflictsWith: []string{"associated_gateway_id", "associated_gateway_owner_account_id", "proposal_id"}, + Deprecated: "use 'associated_gateway_id' argument instead", + }, + }, + } +} + +func resourceAwsDxGatewayAssociationStateUpgradeV0(rawState map[string]interface{}, meta interface{}) (map[string]interface{}, error) { + conn := meta.(*AWSClient).dxconn + + log.Println("[INFO] Found Direct Connect gateway association state v0; migrating to v1") + + // dx_gateway_association_id was introduced in v2.8.0. Handle the case where it's not yet present. + if v, ok := rawState["dx_gateway_association_id"]; !ok || v == nil { + resp, err := conn.DescribeDirectConnectGatewayAssociations(&directconnect.DescribeDirectConnectGatewayAssociationsInput{ + DirectConnectGatewayId: aws.String(rawState["dx_gateway_id"].(string)), + VirtualGatewayId: aws.String(rawState["vpn_gateway_id"].(string)), + }) + if err != nil { + return nil, err + } + + if len(resp.DirectConnectGatewayAssociations) == 0 { + return nil, fmt.Errorf("Direct Connect gateway association not found, remove from state using 'terraform state rm'") + } + + rawState["dx_gateway_association_id"] = aws.StringValue(resp.DirectConnectGatewayAssociations[0].AssociationId) + } + + return rawState, nil +} diff --git a/aws/resource_aws_dx_gateway_association_test.go b/aws/resource_aws_dx_gateway_association_test.go index c6c3af408fd..897eb9e400a 100644 --- a/aws/resource_aws_dx_gateway_association_test.go +++ b/aws/resource_aws_dx_gateway_association_test.go @@ -206,6 +206,7 @@ func TestAccAwsDxGatewayAssociation_deprecatedSingleAccount(t *testing.T) { testAccCheckResourceAttrAccountID(resourceName, "dx_gateway_owner_account_id"), resource.TestCheckResourceAttr(resourceName, "allowed_prefixes.#", "1"), resource.TestCheckResourceAttr(resourceName, "allowed_prefixes.1216997074", "10.255.255.0/28"), + testAccCheckAwsDxGatewayAssociationStateUpgradeV0(resourceName), ), }, }, @@ -522,6 +523,35 @@ func testAccCheckAwsDxGatewayAssociationExists(name string) resource.TestCheckFu } } +// Perform check in acceptance testing as this StateUpgrader requires an API call +func testAccCheckAwsDxGatewayAssociationStateUpgradeV0(name string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[name] + if !ok { + return fmt.Errorf("Not found: %s", name) + } + if rs.Primary.ID == "" { + return fmt.Errorf("No ID is set") + } + + rawState := map[string]interface{}{ + "dx_gateway_id": rs.Primary.Attributes["dx_gateway_id"], + "vpn_gateway_id": rs.Primary.Attributes["vpn_gateway_id"], + } + + updatedRawState, err := resourceAwsDxGatewayAssociationStateUpgradeV0(rawState, testAccProvider.Meta()) + if err != nil { + return err + } + + if got, want := updatedRawState["dx_gateway_association_id"], rs.Primary.Attributes["dx_gateway_association_id"]; got != want { + return fmt.Errorf("Invalid dx_gateway_association_id attribute in migrated state. Expected %s, got %s", want, got) + } + + return nil + } +} + func testAccDxGatewayAssociationConfigBase_vpnGatewaySingleAccount(rName string, rBgpAsn int) string { return fmt.Sprintf(` resource "aws_dx_gateway" "test" { diff --git a/aws/resource_aws_dx_gateway_test.go b/aws/resource_aws_dx_gateway_test.go index 6072379e037..4ad53bb19f8 100644 --- a/aws/resource_aws_dx_gateway_test.go +++ b/aws/resource_aws_dx_gateway_test.go @@ -115,7 +115,7 @@ func testSweepDirectConnectGateways(region string) error { return nil } -func TestAccAwsDxGateway_importBasic(t *testing.T) { +func TestAccAwsDxGateway_basic(t *testing.T) { resourceName := "aws_dx_gateway.test" resource.ParallelTest(t, resource.TestCase{ @@ -125,8 +125,11 @@ func TestAccAwsDxGateway_importBasic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccDxGatewayConfig(acctest.RandString(5), randIntRange(64512, 65534)), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsDxGatewayExists(resourceName), + testAccCheckResourceAttrAccountID(resourceName, "owner_account_id"), + ), }, - { ResourceName: resourceName, ImportState: true, @@ -136,7 +139,7 @@ func TestAccAwsDxGateway_importBasic(t *testing.T) { }) } -func TestAccAwsDxGateway_importComplex(t *testing.T) { +func TestAccAwsDxGateway_complex(t *testing.T) { checkFn := func(s []*terraform.InstanceState) error { if len(s) != 3 { return fmt.Errorf("Got %d resources, expected 3. State: %#v", len(s), s) @@ -147,6 +150,7 @@ func TestAccAwsDxGateway_importComplex(t *testing.T) { rName1 := fmt.Sprintf("terraform-testacc-dxgwassoc-%d", acctest.RandInt()) rName2 := fmt.Sprintf("terraform-testacc-dxgwassoc-%d", acctest.RandInt()) rBgpAsn := randIntRange(64512, 65534) + resourceName := "aws_dx_gateway.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -155,10 +159,13 @@ func TestAccAwsDxGateway_importComplex(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccDxGatewayAssociationConfig_multiVpnGatewaysSingleAccount(rName1, rName2, rBgpAsn), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsDxGatewayExists(resourceName), + testAccCheckResourceAttrAccountID(resourceName, "owner_account_id"), + ), }, - { - ResourceName: "aws_dx_gateway.test", + ResourceName: resourceName, ImportState: true, ImportStateCheck: checkFn, ImportStateVerify: true, @@ -167,23 +174,6 @@ func TestAccAwsDxGateway_importComplex(t *testing.T) { }) } -func TestAccAwsDxGateway_basic(t *testing.T) { - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAwsDxGatewayDestroy, - Steps: []resource.TestStep{ - { - Config: testAccDxGatewayConfig(acctest.RandString(5), randIntRange(64512, 65534)), - Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxGatewayExists("aws_dx_gateway.test"), - testAccCheckResourceAttrAccountID("aws_dx_gateway.test", "owner_account_id"), - ), - }, - }, - }) -} - func testAccCheckAwsDxGatewayDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).dxconn diff --git a/aws/resource_aws_dx_hosted_private_virtual_interface.go b/aws/resource_aws_dx_hosted_private_virtual_interface.go index dad93784e46..0917ba20b7e 100644 --- a/aws/resource_aws_dx_hosted_private_virtual_interface.go +++ b/aws/resource_aws_dx_hosted_private_virtual_interface.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "strconv" "time" "github.com/aws/aws-sdk-go/aws" @@ -22,25 +23,32 @@ func resourceAwsDxHostedPrivateVirtualInterface() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "connection_id": { + "address_family": { Type: schema.TypeString, Required: true, ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + directconnect.AddressFamilyIpv4, + directconnect.AddressFamilyIpv6, + }, false), }, - "name": { + "amazon_address": { Type: schema.TypeString, - Required: true, + Optional: true, + Computed: true, ForceNew: true, }, - "vlan": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, - ValidateFunc: validation.IntBetween(1, 4094), + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "amazon_side_asn": { + Type: schema.TypeString, + Computed: true, + }, + "aws_device": { + Type: schema.TypeString, + Computed: true, }, "bgp_asn": { Type: schema.TypeInt, @@ -53,11 +61,10 @@ func resourceAwsDxHostedPrivateVirtualInterface() *schema.Resource { Computed: true, ForceNew: true, }, - "address_family": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{directconnect.AddressFamilyIpv4, directconnect.AddressFamilyIpv6}, false), + "connection_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "customer_address": { Type: schema.TypeString, @@ -65,10 +72,20 @@ func resourceAwsDxHostedPrivateVirtualInterface() *schema.Resource { Computed: true, ForceNew: true, }, - "amazon_address": { - Type: schema.TypeString, - Optional: true, + "jumbo_frame_capable": { + Type: schema.TypeBool, Computed: true, + }, + "mtu": { + Type: schema.TypeInt, + Default: 1500, + Optional: true, + ForceNew: true, + ValidateFunc: validation.IntInSlice([]int{1500, 9001}), + }, + "name": { + Type: schema.TypeString, + Required: true, ForceNew: true, }, "owner_account_id": { @@ -77,20 +94,11 @@ func resourceAwsDxHostedPrivateVirtualInterface() *schema.Resource { ForceNew: true, ValidateFunc: validateAwsAccountId, }, - "mtu": { + "vlan": { Type: schema.TypeInt, - Default: 1500, - Optional: true, + Required: true, ForceNew: true, - ValidateFunc: validation.IntInSlice([]int{1500, 9001}), - }, - "jumbo_frame_capable": { - Type: schema.TypeBool, - Computed: true, - }, - "aws_device": { - Type: schema.TypeString, - Computed: true, + ValidateFunc: validation.IntBetween(1, 4094), }, }, @@ -107,14 +115,17 @@ func resourceAwsDxHostedPrivateVirtualInterfaceCreate(d *schema.ResourceData, me req := &directconnect.AllocatePrivateVirtualInterfaceInput{ ConnectionId: aws.String(d.Get("connection_id").(string)), - OwnerAccount: aws.String(d.Get("owner_account_id").(string)), NewPrivateVirtualInterfaceAllocation: &directconnect.NewPrivateVirtualInterfaceAllocation{ - VirtualInterfaceName: aws.String(d.Get("name").(string)), - Vlan: aws.Int64(int64(d.Get("vlan").(int))), - Asn: aws.Int64(int64(d.Get("bgp_asn").(int))), AddressFamily: aws.String(d.Get("address_family").(string)), + Asn: aws.Int64(int64(d.Get("bgp_asn").(int))), Mtu: aws.Int64(int64(d.Get("mtu").(int))), + VirtualInterfaceName: aws.String(d.Get("name").(string)), + Vlan: aws.Int64(int64(d.Get("vlan").(int))), }, + OwnerAccount: aws.String(d.Get("owner_account_id").(string)), + } + if v, ok := d.GetOk("amazon_address"); ok && v.(string) != "" { + req.NewPrivateVirtualInterfaceAllocation.AmazonAddress = aws.String(v.(string)) } if v, ok := d.GetOk("bgp_auth_key"); ok && v.(string) != "" { req.NewPrivateVirtualInterfaceAllocation.AuthKey = aws.String(v.(string)) @@ -122,28 +133,17 @@ func resourceAwsDxHostedPrivateVirtualInterfaceCreate(d *schema.ResourceData, me if v, ok := d.GetOk("customer_address"); ok && v.(string) != "" { req.NewPrivateVirtualInterfaceAllocation.CustomerAddress = aws.String(v.(string)) } - if v, ok := d.GetOk("amazon_address"); ok && v.(string) != "" { - req.NewPrivateVirtualInterfaceAllocation.AmazonAddress = aws.String(v.(string)) - } if v, ok := d.GetOk("mtu"); ok && v.(int) != 0 { req.NewPrivateVirtualInterfaceAllocation.Mtu = aws.Int64(int64(v.(int))) } - log.Printf("[DEBUG] Creating Direct Connect hosted private virtual interface: %#v", req) + log.Printf("[DEBUG] Creating Direct Connect hosted private virtual interface: %s", req) resp, err := conn.AllocatePrivateVirtualInterface(req) if err != nil { - return fmt.Errorf("Error creating Direct Connect hosted private virtual interface: %s", err.Error()) + return fmt.Errorf("error creating Direct Connect hosted private virtual interface: %s", err) } d.SetId(aws.StringValue(resp.VirtualInterfaceId)) - arn := arn.ARN{ - Partition: meta.(*AWSClient).partition, - Region: meta.(*AWSClient).region, - Service: "directconnect", - AccountID: meta.(*AWSClient).accountid, - Resource: fmt.Sprintf("dxvif/%s", d.Id()), - }.String() - d.Set("arn", arn) if err := dxHostedPrivateVirtualInterfaceWaitUntilAvailable(conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { return err @@ -160,23 +160,32 @@ func resourceAwsDxHostedPrivateVirtualInterfaceRead(d *schema.ResourceData, meta return err } if vif == nil { - log.Printf("[WARN] Direct Connect virtual interface (%s) not found, removing from state", d.Id()) + log.Printf("[WARN] Direct Connect hosted private virtual interface (%s) not found, removing from state", d.Id()) d.SetId("") return nil } - d.Set("connection_id", vif.ConnectionId) - d.Set("name", vif.VirtualInterfaceName) - d.Set("vlan", vif.Vlan) + d.Set("address_family", vif.AddressFamily) + d.Set("amazon_address", vif.AmazonAddress) + d.Set("amazon_side_asn", strconv.FormatInt(aws.Int64Value(vif.AmazonSideAsn), 10)) + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Region: meta.(*AWSClient).region, + Service: "directconnect", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("dxvif/%s", d.Id()), + }.String() + d.Set("arn", arn) + d.Set("aws_device", vif.AwsDeviceV2) d.Set("bgp_asn", vif.Asn) d.Set("bgp_auth_key", vif.AuthKey) - d.Set("address_family", vif.AddressFamily) + d.Set("connection_id", vif.ConnectionId) d.Set("customer_address", vif.CustomerAddress) - d.Set("amazon_address", vif.AmazonAddress) - d.Set("owner_account_id", vif.OwnerAccount) - d.Set("mtu", vif.Mtu) d.Set("jumbo_frame_capable", vif.JumboFrameCapable) - d.Set("aws_device", vif.AwsDeviceV2) + d.Set("mtu", vif.Mtu) + d.Set("name", vif.VirtualInterfaceName) + d.Set("owner_account_id", vif.OwnerAccount) + d.Set("vlan", vif.Vlan) return nil } @@ -186,14 +195,19 @@ func resourceAwsDxHostedPrivateVirtualInterfaceDelete(d *schema.ResourceData, me } func resourceAwsDxHostedPrivateVirtualInterfaceImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - arn := arn.ARN{ - Partition: meta.(*AWSClient).partition, - Region: meta.(*AWSClient).region, - Service: "directconnect", - AccountID: meta.(*AWSClient).accountid, - Resource: fmt.Sprintf("dxvif/%s", d.Id()), - }.String() - d.Set("arn", arn) + conn := meta.(*AWSClient).dxconn + + vif, err := dxVirtualInterfaceRead(d.Id(), conn) + if err != nil { + return nil, err + } + if vif == nil { + return nil, fmt.Errorf("virtual interface (%s) not found", d.Id()) + } + + if vifType := aws.StringValue(vif.VirtualInterfaceType); vifType != "private" { + return nil, fmt.Errorf("virtual interface (%s) has incorrect type: %s", d.Id(), vifType) + } return []*schema.ResourceData{d}, nil } diff --git a/aws/resource_aws_dx_hosted_private_virtual_interface_accepter.go b/aws/resource_aws_dx_hosted_private_virtual_interface_accepter.go index f7dbca21adf..42531d1d30c 100644 --- a/aws/resource_aws_dx_hosted_private_virtual_interface_accepter.go +++ b/aws/resource_aws_dx_hosted_private_virtual_interface_accepter.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/directconnect" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDxHostedPrivateVirtualInterfaceAccepter() *schema.Resource { @@ -26,6 +27,13 @@ func resourceAwsDxHostedPrivateVirtualInterfaceAccepter() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "dx_gateway_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ConflictsWith: []string{"vpn_gateway_id"}, + }, + "tags": tagsSchema(), "virtual_interface_id": { Type: schema.TypeString, Required: true, @@ -37,13 +45,6 @@ func resourceAwsDxHostedPrivateVirtualInterfaceAccepter() *schema.Resource { ForceNew: true, ConflictsWith: []string{"dx_gateway_id"}, }, - "dx_gateway_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ConflictsWith: []string{"vpn_gateway_id"}, - }, - "tags": tagsSchema(), }, Timeouts: &schema.ResourceTimeout{ @@ -67,17 +68,17 @@ func resourceAwsDxHostedPrivateVirtualInterfaceAccepterCreate(d *schema.Resource req := &directconnect.ConfirmPrivateVirtualInterfaceInput{ VirtualInterfaceId: aws.String(vifId), } - if vgwOk && vgwIdRaw.(string) != "" { - req.VirtualGatewayId = aws.String(vgwIdRaw.(string)) - } if dxgwOk && dxgwIdRaw.(string) != "" { req.DirectConnectGatewayId = aws.String(dxgwIdRaw.(string)) } + if vgwOk && vgwIdRaw.(string) != "" { + req.VirtualGatewayId = aws.String(vgwIdRaw.(string)) + } - log.Printf("[DEBUG] Accepting Direct Connect hosted private virtual interface: %#v", req) + log.Printf("[DEBUG] Accepting Direct Connect hosted private virtual interface: %s", req) _, err := conn.ConfirmPrivateVirtualInterface(req) if err != nil { - return fmt.Errorf("Error accepting Direct Connect hosted private virtual interface: %s", err.Error()) + return fmt.Errorf("error accepting Direct Connect hosted private virtual interface: %s", err) } d.SetId(vifId) @@ -105,23 +106,34 @@ func resourceAwsDxHostedPrivateVirtualInterfaceAccepterRead(d *schema.ResourceDa return err } if vif == nil { - log.Printf("[WARN] Direct Connect virtual interface (%s) not found, removing from state", d.Id()) + log.Printf("[WARN] Direct Connect hosted private virtual interface (%s) not found, removing from state", d.Id()) d.SetId("") return nil } vifState := aws.StringValue(vif.VirtualInterfaceState) if vifState != directconnect.VirtualInterfaceStateAvailable && vifState != directconnect.VirtualInterfaceStateDown { - log.Printf("[WARN] Direct Connect virtual interface (%s) is '%s', removing from state", vifState, d.Id()) + log.Printf("[WARN] Direct Connect hosted private virtual interface (%s) is '%s', removing from state", vifState, d.Id()) d.SetId("") return nil } + d.Set("dx_gateway_id", vif.DirectConnectGatewayId) d.Set("virtual_interface_id", vif.VirtualInterfaceId) d.Set("vpn_gateway_id", vif.VirtualGatewayId) - d.Set("dx_gateway_id", vif.DirectConnectGatewayId) - err1 := getTagsDX(conn, d, d.Get("arn").(string)) - return err1 + + arn := d.Get("arn").(string) + tags, err := keyvaluetags.DirectconnectListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for Direct Connect hosted private virtual interface (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + return nil } func resourceAwsDxHostedPrivateVirtualInterfaceAccepterUpdate(d *schema.ResourceData, meta interface{}) error { @@ -138,6 +150,20 @@ func resourceAwsDxHostedPrivateVirtualInterfaceAccepterDelete(d *schema.Resource } func resourceAwsDxHostedPrivateVirtualInterfaceAccepterImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + conn := meta.(*AWSClient).dxconn + + vif, err := dxVirtualInterfaceRead(d.Id(), conn) + if err != nil { + return nil, err + } + if vif == nil { + return nil, fmt.Errorf("virtual interface (%s) not found", d.Id()) + } + + if vifType := aws.StringValue(vif.VirtualInterfaceType); vifType != "private" { + return nil, fmt.Errorf("virtual interface (%s) has incorrect type: %s", d.Id(), vifType) + } + arn := arn.ARN{ Partition: meta.(*AWSClient).partition, Region: meta.(*AWSClient).region, diff --git a/aws/resource_aws_dx_hosted_private_virtual_interface_test.go b/aws/resource_aws_dx_hosted_private_virtual_interface_test.go index 4f40d621edd..74e0dfb52fc 100644 --- a/aws/resource_aws_dx_hosted_private_virtual_interface_test.go +++ b/aws/resource_aws_dx_hosted_private_virtual_interface_test.go @@ -3,6 +3,8 @@ package aws import ( "fmt" "os" + "regexp" + "strconv" "testing" "github.com/aws/aws-sdk-go/aws" @@ -21,8 +23,10 @@ func TestAccAwsDxHostedPrivateVirtualInterface_basic(t *testing.T) { } var providers []*schema.Provider - resourceNameHostedVif := "aws_dx_hosted_private_virtual_interface.test" - resourceNameHostedVifAccepter := "aws_dx_hosted_private_virtual_interface_accepter.test" + var vif directconnect.VirtualInterface + resourceName := "aws_dx_hosted_private_virtual_interface.test" + accepterResourceName := "aws_dx_hosted_private_virtual_interface_accepter.test" + vpnGatewayResourceName := "aws_vpn_gateway.test" rName := fmt.Sprintf("tf-testacc-private-vif-%s", acctest.RandString(9)) bgpAsn := randIntRange(64512, 65534) vlan := randIntRange(2049, 4094) @@ -38,28 +42,30 @@ func TestAccAwsDxHostedPrivateVirtualInterface_basic(t *testing.T) { { Config: testAccDxHostedPrivateVirtualInterfaceConfig_basic(connectionId, rName, bgpAsn, vlan), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxHostedPrivateVirtualInterfaceExists(resourceNameHostedVif), - testAccCheckAwsDxHostedPrivateVirtualInterfaceAccepterExists(resourceNameHostedVifAccepter), - resource.TestCheckResourceAttr(resourceNameHostedVif, "name", rName), - resource.TestCheckResourceAttr(resourceNameHostedVif, "mtu", "1500"), - resource.TestCheckResourceAttr(resourceNameHostedVif, "jumbo_frame_capable", "true"), - resource.TestCheckResourceAttr(resourceNameHostedVifAccepter, "tags.%", "0"), - ), - }, - { - Config: testAccDxHostedPrivateVirtualInterfaceConfig_updated(connectionId, rName, bgpAsn, vlan), - Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxHostedPrivateVirtualInterfaceExists(resourceNameHostedVif), - testAccCheckAwsDxHostedPrivateVirtualInterfaceAccepterExists(resourceNameHostedVifAccepter), - resource.TestCheckResourceAttr(resourceNameHostedVif, "name", rName), - resource.TestCheckResourceAttr(resourceNameHostedVifAccepter, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceNameHostedVifAccepter, "tags.Environment", "test"), + testAccCheckAwsDxHostedPrivateVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttr(resourceName, "jumbo_frame_capable", "true"), + resource.TestCheckResourceAttr(resourceName, "mtu", "1500"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "owner_account_id"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), + // Accepter's attributes: + resource.TestCheckResourceAttrSet(accepterResourceName, "arn"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.%", "0"), + resource.TestCheckResourceAttrPair(accepterResourceName, "virtual_interface_id", resourceName, "id"), + resource.TestCheckResourceAttrPair(accepterResourceName, "vpn_gateway_id", vpnGatewayResourceName, "id"), ), }, // Test import. { - Config: testAccDxHostedPrivateVirtualInterfaceConfig_updated(connectionId, rName, bgpAsn, vlan), - ResourceName: resourceNameHostedVif, + Config: testAccDxHostedPrivateVirtualInterfaceConfig_basic(connectionId, rName, bgpAsn, vlan), + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -67,64 +73,104 @@ func TestAccAwsDxHostedPrivateVirtualInterface_basic(t *testing.T) { }) } -func testAccCheckAwsDxHostedPrivateVirtualInterfaceDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).dxconn - - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_dx_hosted_private_virtual_interface" { - continue - } - - input := &directconnect.DescribeVirtualInterfacesInput{ - VirtualInterfaceId: aws.String(rs.Primary.ID), - } - - resp, err := conn.DescribeVirtualInterfaces(input) - if err != nil { - return err - } - for _, v := range resp.VirtualInterfaces { - if *v.VirtualInterfaceId == rs.Primary.ID && !(*v.VirtualInterfaceState == directconnect.VirtualInterfaceStateDeleted) { - return fmt.Errorf("[DESTROY ERROR] Dx Private VIF (%s) not deleted", rs.Primary.ID) - } - } +func TestAccAwsDxHostedPrivateVirtualInterface_AccepterTags(t *testing.T) { + key := "DX_CONNECTION_ID" + connectionId := os.Getenv(key) + if connectionId == "" { + t.Skipf("Environment variable %s is not set", key) } - return nil -} -func testAccCheckAwsDxHostedPrivateVirtualInterfaceExists(name string) resource.TestCheckFunc { - return func(s *terraform.State) error { - _, ok := s.RootModule().Resources[name] - if !ok { - return fmt.Errorf("Not found: %s", name) - } + var providers []*schema.Provider + var vif directconnect.VirtualInterface + resourceName := "aws_dx_hosted_private_virtual_interface.test" + accepterResourceName := "aws_dx_hosted_private_virtual_interface_accepter.test" + vpnGatewayResourceName := "aws_vpn_gateway.test" + rName := fmt.Sprintf("tf-testacc-private-vif-%s", acctest.RandString(9)) + bgpAsn := randIntRange(64512, 65534) + vlan := randIntRange(2049, 4094) - return nil - } + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccAlternateAccountPreCheck(t) + }, + ProviderFactories: testAccProviderFactories(&providers), + CheckDestroy: testAccCheckAwsDxHostedPrivateVirtualInterfaceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDxHostedPrivateVirtualInterfaceConfig_accepterTags(connectionId, rName, bgpAsn, vlan), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsDxHostedPrivateVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttr(resourceName, "jumbo_frame_capable", "true"), + resource.TestCheckResourceAttr(resourceName, "mtu", "1500"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "owner_account_id"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), + // Accepter's attributes: + resource.TestCheckResourceAttrSet(accepterResourceName, "arn"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Name", rName), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Key1", "Value1"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Key2", "Value2a"), + resource.TestCheckResourceAttrPair(accepterResourceName, "virtual_interface_id", resourceName, "id"), + resource.TestCheckResourceAttrPair(accepterResourceName, "vpn_gateway_id", vpnGatewayResourceName, "id"), + ), + }, + { + Config: testAccDxHostedPrivateVirtualInterfaceConfig_accepterTagsUpdated(connectionId, rName, bgpAsn, vlan), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsDxHostedPrivateVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttr(resourceName, "jumbo_frame_capable", "true"), + resource.TestCheckResourceAttr(resourceName, "mtu", "1500"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "owner_account_id"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), + // Accepter's attributes: + resource.TestCheckResourceAttrSet(accepterResourceName, "arn"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Name", rName), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Key2", "Value2b"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Key3", "Value3"), + resource.TestCheckResourceAttrPair(accepterResourceName, "virtual_interface_id", resourceName, "id"), + resource.TestCheckResourceAttrPair(accepterResourceName, "vpn_gateway_id", vpnGatewayResourceName, "id"), + ), + }, + }, + }) } -func testAccCheckAwsDxHostedPrivateVirtualInterfaceAccepterExists(name string) resource.TestCheckFunc { - return func(s *terraform.State) error { - _, ok := s.RootModule().Resources[name] - if !ok { - return fmt.Errorf("Not found: %s", name) - } +func testAccCheckAwsDxHostedPrivateVirtualInterfaceDestroy(s *terraform.State) error { + return testAccCheckDxVirtualInterfaceDestroy(s, "aws_dx_hosted_private_virtual_interface") +} - return nil - } +func testAccCheckAwsDxHostedPrivateVirtualInterfaceExists(name string, vif *directconnect.VirtualInterface) resource.TestCheckFunc { + return testAccCheckDxVirtualInterfaceExists(name, vif) } func testAccDxHostedPrivateVirtualInterfaceConfig_base(cid, rName string, bgpAsn, vlan int) string { return testAccAlternateAccountProviderConfig() + fmt.Sprintf(` # Creator resource "aws_dx_hosted_private_virtual_interface" "test" { + address_family = "ipv4" + bgp_asn = %[3]d connection_id = %[1]q + name = %[2]q owner_account_id = "${data.aws_caller_identity.accepter.account_id}" - - name = %[2]q - vlan = %[4]d - address_family = "ipv4" - bgp_asn = %[3]d + vlan = %[4]d # The aws_dx_hosted_private_virtual_interface # must be destroyed before the aws_vpn_gateway. @@ -149,7 +195,7 @@ resource "aws_vpn_gateway" "test" { func testAccDxHostedPrivateVirtualInterfaceConfig_basic(cid, rName string, bgpAsn, vlan int) string { return testAccDxHostedPrivateVirtualInterfaceConfig_base(cid, rName, bgpAsn, vlan) + fmt.Sprintf(` resource "aws_dx_hosted_private_virtual_interface_accepter" "test" { - provider = "aws.alternate" + provider = "aws.alternate" virtual_interface_id = "${aws_dx_hosted_private_virtual_interface.test.id}" vpn_gateway_id = "${aws_vpn_gateway.test.id}" @@ -157,17 +203,36 @@ resource "aws_dx_hosted_private_virtual_interface_accepter" "test" { `) } -func testAccDxHostedPrivateVirtualInterfaceConfig_updated(cid, rName string, bgpAsn, vlan int) string { +func testAccDxHostedPrivateVirtualInterfaceConfig_accepterTags(cid, rName string, bgpAsn, vlan int) string { + return testAccDxHostedPrivateVirtualInterfaceConfig_base(cid, rName, bgpAsn, vlan) + fmt.Sprintf(` +resource "aws_dx_hosted_private_virtual_interface_accepter" "test" { + provider = "aws.alternate" + + virtual_interface_id = "${aws_dx_hosted_private_virtual_interface.test.id}" + vpn_gateway_id = "${aws_vpn_gateway.test.id}" + + tags = { + Name = %[1]q + Key1 = "Value1" + Key2 = "Value2a" + } +} +`, rName) +} + +func testAccDxHostedPrivateVirtualInterfaceConfig_accepterTagsUpdated(cid, rName string, bgpAsn, vlan int) string { return testAccDxHostedPrivateVirtualInterfaceConfig_base(cid, rName, bgpAsn, vlan) + fmt.Sprintf(` resource "aws_dx_hosted_private_virtual_interface_accepter" "test" { - provider = "aws.alternate" + provider = "aws.alternate" virtual_interface_id = "${aws_dx_hosted_private_virtual_interface.test.id}" vpn_gateway_id = "${aws_vpn_gateway.test.id}" tags = { - Environment = "test" + Name = %[1]q + Key2 = "Value2b" + Key3 = "Value3" } } -`) +`, rName) } diff --git a/aws/resource_aws_dx_hosted_public_virtual_interface.go b/aws/resource_aws_dx_hosted_public_virtual_interface.go index 5d123f6c841..b9cc6388713 100644 --- a/aws/resource_aws_dx_hosted_public_virtual_interface.go +++ b/aws/resource_aws_dx_hosted_public_virtual_interface.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "strconv" "time" "github.com/aws/aws-sdk-go/aws" @@ -20,27 +21,35 @@ func resourceAwsDxHostedPublicVirtualInterface() *schema.Resource { Importer: &schema.ResourceImporter{ State: resourceAwsDxHostedPublicVirtualInterfaceImport, }, + CustomizeDiff: resourceAwsDxHostedPublicVirtualInterfaceCustomizeDiff, Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "connection_id": { + "address_family": { Type: schema.TypeString, Required: true, ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + directconnect.AddressFamilyIpv4, + directconnect.AddressFamilyIpv6, + }, false), }, - "name": { + "amazon_address": { Type: schema.TypeString, - Required: true, + Optional: true, + Computed: true, ForceNew: true, }, - "vlan": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, - ValidateFunc: validation.IntBetween(1, 4094), + "amazon_side_asn": { + Type: schema.TypeString, + Computed: true, + }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "aws_device": { + Type: schema.TypeString, + Computed: true, }, "bgp_asn": { Type: schema.TypeInt, @@ -53,11 +62,10 @@ func resourceAwsDxHostedPublicVirtualInterface() *schema.Resource { Computed: true, ForceNew: true, }, - "address_family": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{directconnect.AddressFamilyIpv4, directconnect.AddressFamilyIpv6}, false), + "connection_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "customer_address": { Type: schema.TypeString, @@ -65,10 +73,9 @@ func resourceAwsDxHostedPublicVirtualInterface() *schema.Resource { Computed: true, ForceNew: true, }, - "amazon_address": { + "name": { Type: schema.TypeString, - Optional: true, - Computed: true, + Required: true, ForceNew: true, }, "owner_account_id": { @@ -84,9 +91,11 @@ func resourceAwsDxHostedPublicVirtualInterface() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, MinItems: 1, }, - "aws_device": { - Type: schema.TypeString, - Computed: true, + "vlan": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + ValidateFunc: validation.IntBetween(1, 4094), }, }, @@ -100,56 +109,36 @@ func resourceAwsDxHostedPublicVirtualInterface() *schema.Resource { func resourceAwsDxHostedPublicVirtualInterfaceCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).dxconn - addressFamily := d.Get("address_family").(string) - caRaw, caOk := d.GetOk("customer_address") - aaRaw, aaOk := d.GetOk("amazon_address") - if addressFamily == directconnect.AddressFamilyIpv4 { - if !caOk { - return fmt.Errorf("'customer_address' must be set when 'address_family' is '%s'", addressFamily) - } - if !aaOk { - return fmt.Errorf("'amazon_address' must be set when 'address_family' is '%s'", addressFamily) - } - } - req := &directconnect.AllocatePublicVirtualInterfaceInput{ ConnectionId: aws.String(d.Get("connection_id").(string)), - OwnerAccount: aws.String(d.Get("owner_account_id").(string)), NewPublicVirtualInterfaceAllocation: &directconnect.NewPublicVirtualInterfaceAllocation{ + AddressFamily: aws.String(d.Get("address_family").(string)), + Asn: aws.Int64(int64(d.Get("bgp_asn").(int))), VirtualInterfaceName: aws.String(d.Get("name").(string)), Vlan: aws.Int64(int64(d.Get("vlan").(int))), - Asn: aws.Int64(int64(d.Get("bgp_asn").(int))), - AddressFamily: aws.String(addressFamily), }, + OwnerAccount: aws.String(d.Get("owner_account_id").(string)), + } + if v, ok := d.GetOk("amazon_address"); ok && v.(string) != "" { + req.NewPublicVirtualInterfaceAllocation.AmazonAddress = aws.String(v.(string)) } if v, ok := d.GetOk("bgp_auth_key"); ok && v.(string) != "" { req.NewPublicVirtualInterfaceAllocation.AuthKey = aws.String(v.(string)) } - if caOk && caRaw.(string) != "" { - req.NewPublicVirtualInterfaceAllocation.CustomerAddress = aws.String(caRaw.(string)) - } - if aaOk && aaRaw.(string) != "" { - req.NewPublicVirtualInterfaceAllocation.AmazonAddress = aws.String(aaRaw.(string)) + if v, ok := d.GetOk("customer_address"); ok && v.(string) != "" { + req.NewPublicVirtualInterfaceAllocation.CustomerAddress = aws.String(v.(string)) } if v, ok := d.GetOk("route_filter_prefixes"); ok { req.NewPublicVirtualInterfaceAllocation.RouteFilterPrefixes = expandDxRouteFilterPrefixes(v.(*schema.Set)) } - log.Printf("[DEBUG] Allocating Direct Connect hosted public virtual interface: %#v", req) + log.Printf("[DEBUG] Allocating Direct Connect hosted public virtual interface: %s", req) resp, err := conn.AllocatePublicVirtualInterface(req) if err != nil { - return fmt.Errorf("Error allocating Direct Connect hosted public virtual interface: %s", err.Error()) + return fmt.Errorf("error allocating Direct Connect hosted public virtual interface: %s", err) } d.SetId(aws.StringValue(resp.VirtualInterfaceId)) - arn := arn.ARN{ - Partition: meta.(*AWSClient).partition, - Region: meta.(*AWSClient).region, - Service: "directconnect", - AccountID: meta.(*AWSClient).accountid, - Resource: fmt.Sprintf("dxvif/%s", d.Id()), - }.String() - d.Set("arn", arn) if err := dxHostedPublicVirtualInterfaceWaitUntilAvailable(conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { return err @@ -171,17 +160,28 @@ func resourceAwsDxHostedPublicVirtualInterfaceRead(d *schema.ResourceData, meta return nil } - d.Set("connection_id", vif.ConnectionId) - d.Set("name", vif.VirtualInterfaceName) - d.Set("vlan", vif.Vlan) + d.Set("address_family", vif.AddressFamily) + d.Set("amazon_address", vif.AmazonAddress) + d.Set("amazon_side_asn", strconv.FormatInt(aws.Int64Value(vif.AmazonSideAsn), 10)) + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Region: meta.(*AWSClient).region, + Service: "directconnect", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("dxvif/%s", d.Id()), + }.String() + d.Set("arn", arn) + d.Set("aws_device", vif.AwsDeviceV2) d.Set("bgp_asn", vif.Asn) d.Set("bgp_auth_key", vif.AuthKey) - d.Set("address_family", vif.AddressFamily) + d.Set("connection_id", vif.ConnectionId) d.Set("customer_address", vif.CustomerAddress) - d.Set("amazon_address", vif.AmazonAddress) - d.Set("route_filter_prefixes", flattenDxRouteFilterPrefixes(vif.RouteFilterPrefixes)) + d.Set("name", vif.VirtualInterfaceName) d.Set("owner_account_id", vif.OwnerAccount) - d.Set("aws_device", vif.AwsDeviceV2) + if err := d.Set("route_filter_prefixes", flattenDxRouteFilterPrefixes(vif.RouteFilterPrefixes)); err != nil { + return fmt.Errorf("error setting route_filter_prefixes: %s", err) + } + d.Set("vlan", vif.Vlan) return nil } @@ -191,18 +191,39 @@ func resourceAwsDxHostedPublicVirtualInterfaceDelete(d *schema.ResourceData, met } func resourceAwsDxHostedPublicVirtualInterfaceImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - arn := arn.ARN{ - Partition: meta.(*AWSClient).partition, - Region: meta.(*AWSClient).region, - Service: "directconnect", - AccountID: meta.(*AWSClient).accountid, - Resource: fmt.Sprintf("dxvif/%s", d.Id()), - }.String() - d.Set("arn", arn) + conn := meta.(*AWSClient).dxconn + + vif, err := dxVirtualInterfaceRead(d.Id(), conn) + if err != nil { + return nil, err + } + if vif == nil { + return nil, fmt.Errorf("virtual interface (%s) not found", d.Id()) + } + + if vifType := aws.StringValue(vif.VirtualInterfaceType); vifType != "public" { + return nil, fmt.Errorf("virtual interface (%s) has incorrect type: %s", d.Id(), vifType) + } return []*schema.ResourceData{d}, nil } +func resourceAwsDxHostedPublicVirtualInterfaceCustomizeDiff(diff *schema.ResourceDiff, meta interface{}) error { + if diff.Id() == "" { + // New resource. + if addressFamily := diff.Get("address_family").(string); addressFamily == directconnect.AddressFamilyIpv4 { + if _, ok := diff.GetOk("customer_address"); !ok { + return fmt.Errorf("'customer_address' must be set when 'address_family' is '%s'", addressFamily) + } + if _, ok := diff.GetOk("amazon_address"); !ok { + return fmt.Errorf("'amazon_address' must be set when 'address_family' is '%s'", addressFamily) + } + } + } + + return nil +} + func dxHostedPublicVirtualInterfaceWaitUntilAvailable(conn *directconnect.DirectConnect, vifId string, timeout time.Duration) error { return dxVirtualInterfaceWaitUntilAvailable( conn, diff --git a/aws/resource_aws_dx_hosted_public_virtual_interface_accepter.go b/aws/resource_aws_dx_hosted_public_virtual_interface_accepter.go index 1038229bc38..bc106c0bb96 100644 --- a/aws/resource_aws_dx_hosted_public_virtual_interface_accepter.go +++ b/aws/resource_aws_dx_hosted_public_virtual_interface_accepter.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/directconnect" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDxHostedPublicVirtualInterfaceAccepter() *schema.Resource { @@ -26,12 +27,12 @@ func resourceAwsDxHostedPublicVirtualInterfaceAccepter() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "tags": tagsSchema(), "virtual_interface_id": { Type: schema.TypeString, Required: true, ForceNew: true, }, - "tags": tagsSchema(), }, Timeouts: &schema.ResourceTimeout{ @@ -49,10 +50,10 @@ func resourceAwsDxHostedPublicVirtualInterfaceAccepterCreate(d *schema.ResourceD VirtualInterfaceId: aws.String(vifId), } - log.Printf("[DEBUG] Accepting Direct Connect hosted public virtual interface: %#v", req) + log.Printf("[DEBUG] Accepting Direct Connect hosted public virtual interface: %s", req) _, err := conn.ConfirmPublicVirtualInterface(req) if err != nil { - return fmt.Errorf("Error accepting Direct Connect hosted public virtual interface: %s", err.Error()) + return fmt.Errorf("error accepting Direct Connect hosted public virtual interface: %s", err) } d.SetId(vifId) @@ -80,7 +81,7 @@ func resourceAwsDxHostedPublicVirtualInterfaceAccepterRead(d *schema.ResourceDat return err } if vif == nil { - log.Printf("[WARN] Direct Connect virtual interface (%s) not found, removing from state", d.Id()) + log.Printf("[WARN] Direct Connect hosted public virtual interface (%s) not found, removing from state", d.Id()) d.SetId("") return nil } @@ -88,14 +89,25 @@ func resourceAwsDxHostedPublicVirtualInterfaceAccepterRead(d *schema.ResourceDat if vifState != directconnect.VirtualInterfaceStateAvailable && vifState != directconnect.VirtualInterfaceStateDown && vifState != directconnect.VirtualInterfaceStateVerifying { - log.Printf("[WARN] Direct Connect virtual interface (%s) is '%s', removing from state", vifState, d.Id()) + log.Printf("[WARN] Direct Connect hosted public virtual interface (%s) is '%s', removing from state", vifState, d.Id()) d.SetId("") return nil } d.Set("virtual_interface_id", vif.VirtualInterfaceId) - err1 := getTagsDX(conn, d, d.Get("arn").(string)) - return err1 + + arn := d.Get("arn").(string) + tags, err := keyvaluetags.DirectconnectListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for Direct Connect hosted public virtual interface (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + return nil } func resourceAwsDxHostedPublicVirtualInterfaceAccepterUpdate(d *schema.ResourceData, meta interface{}) error { @@ -112,6 +124,20 @@ func resourceAwsDxHostedPublicVirtualInterfaceAccepterDelete(d *schema.ResourceD } func resourceAwsDxHostedPublicVirtualInterfaceAccepterImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + conn := meta.(*AWSClient).dxconn + + vif, err := dxVirtualInterfaceRead(d.Id(), conn) + if err != nil { + return nil, err + } + if vif == nil { + return nil, fmt.Errorf("virtual interface (%s) not found", d.Id()) + } + + if vifType := aws.StringValue(vif.VirtualInterfaceType); vifType != "public" { + return nil, fmt.Errorf("virtual interface (%s) has incorrect type: %s", d.Id(), vifType) + } + arn := arn.ARN{ Partition: meta.(*AWSClient).partition, Region: meta.(*AWSClient).region, diff --git a/aws/resource_aws_dx_hosted_public_virtual_interface_test.go b/aws/resource_aws_dx_hosted_public_virtual_interface_test.go index 9ba863f3c1a..846b337bfa4 100644 --- a/aws/resource_aws_dx_hosted_public_virtual_interface_test.go +++ b/aws/resource_aws_dx_hosted_public_virtual_interface_test.go @@ -3,6 +3,8 @@ package aws import ( "fmt" "os" + "regexp" + "strconv" "testing" "github.com/aws/aws-sdk-go/aws" @@ -21,9 +23,12 @@ func TestAccAwsDxHostedPublicVirtualInterface_basic(t *testing.T) { } var providers []*schema.Provider - resourceNameHostedVif := "aws_dx_hosted_public_virtual_interface.test" - resourceNameHostedVifAccepter := "aws_dx_hosted_public_virtual_interface_accepter.test" + var vif directconnect.VirtualInterface + resourceName := "aws_dx_hosted_public_virtual_interface.test" + accepterResourceName := "aws_dx_hosted_public_virtual_interface_accepter.test" rName := fmt.Sprintf("tf-testacc-public-vif-%s", acctest.RandString(10)) + amazonAddress := "175.45.176.5/28" + customerAddress := "175.45.176.6/28" bgpAsn := randIntRange(64512, 65534) vlan := randIntRange(2049, 4094) @@ -36,28 +41,33 @@ func TestAccAwsDxHostedPublicVirtualInterface_basic(t *testing.T) { CheckDestroy: testAccCheckAwsDxHostedPublicVirtualInterfaceDestroy, Steps: []resource.TestStep{ { - Config: testAccDxHostedPublicVirtualInterfaceConfig_basic(connectionId, rName, bgpAsn, vlan), + Config: testAccDxHostedPublicVirtualInterfaceConfig_basic(connectionId, rName, amazonAddress, customerAddress, bgpAsn, vlan), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxHostedPublicVirtualInterfaceExists(resourceNameHostedVif), - testAccCheckAwsDxHostedPublicVirtualInterfaceAccepterExists(resourceNameHostedVifAccepter), - resource.TestCheckResourceAttr(resourceNameHostedVif, "name", rName), - resource.TestCheckResourceAttr(resourceNameHostedVifAccepter, "tags.%", "0"), - ), - }, - { - Config: testAccDxHostedPublicVirtualInterfaceConfig_updated(connectionId, rName, bgpAsn, vlan), - Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxHostedPublicVirtualInterfaceExists(resourceNameHostedVif), - testAccCheckAwsDxHostedPublicVirtualInterfaceAccepterExists(resourceNameHostedVifAccepter), - resource.TestCheckResourceAttr(resourceNameHostedVif, "name", rName), - resource.TestCheckResourceAttr(resourceNameHostedVifAccepter, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceNameHostedVifAccepter, "tags.Environment", "test"), + testAccCheckAwsDxHostedPublicVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_address"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttr(resourceName, "customer_address", customerAddress), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.#", "2"), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.1752038751", "210.52.109.0/24"), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.4290081960", "175.45.176.0/22"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), + // Accepter's attributes: + resource.TestCheckResourceAttrSet(accepterResourceName, "arn"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.%", "0"), + resource.TestCheckResourceAttrPair(accepterResourceName, "virtual_interface_id", resourceName, "id"), ), }, // Test import. { - Config: testAccDxHostedPublicVirtualInterfaceConfig_updated(connectionId, rName, bgpAsn, vlan), - ResourceName: resourceNameHostedVif, + Config: testAccDxHostedPublicVirtualInterfaceConfig_basic(connectionId, rName, amazonAddress, customerAddress, bgpAsn, vlan), + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -65,71 +75,113 @@ func TestAccAwsDxHostedPublicVirtualInterface_basic(t *testing.T) { }) } -func testAccCheckAwsDxHostedPublicVirtualInterfaceDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).dxconn - - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_dx_hosted_public_virtual_interface" { - continue - } - - input := &directconnect.DescribeVirtualInterfacesInput{ - VirtualInterfaceId: aws.String(rs.Primary.ID), - } - - resp, err := conn.DescribeVirtualInterfaces(input) - if err != nil { - return err - } - for _, v := range resp.VirtualInterfaces { - if *v.VirtualInterfaceId == rs.Primary.ID && !(*v.VirtualInterfaceState == directconnect.VirtualInterfaceStateDeleted) { - return fmt.Errorf("[DESTROY ERROR] Dx Public VIF (%s) not deleted", rs.Primary.ID) - } - } +func TestAccAwsDxHostedPublicVirtualInterface_AccepterTags(t *testing.T) { + key := "DX_CONNECTION_ID" + connectionId := os.Getenv(key) + if connectionId == "" { + t.Skipf("Environment variable %s is not set", key) } - return nil -} -func testAccCheckAwsDxHostedPublicVirtualInterfaceExists(name string) resource.TestCheckFunc { - return func(s *terraform.State) error { - _, ok := s.RootModule().Resources[name] - if !ok { - return fmt.Errorf("Not found: %s", name) - } + var providers []*schema.Provider + var vif directconnect.VirtualInterface + resourceName := "aws_dx_hosted_public_virtual_interface.test" + accepterResourceName := "aws_dx_hosted_public_virtual_interface_accepter.test" + rName := fmt.Sprintf("tf-testacc-public-vif-%s", acctest.RandString(10)) + amazonAddress := "175.45.176.7/28" + customerAddress := "175.45.176.8/28" + bgpAsn := randIntRange(64512, 65534) + vlan := randIntRange(2049, 4094) - return nil - } + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccAlternateAccountPreCheck(t) + }, + ProviderFactories: testAccProviderFactories(&providers), + CheckDestroy: testAccCheckAwsDxHostedPublicVirtualInterfaceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDxHostedPublicVirtualInterfaceConfig_accepterTags(connectionId, rName, amazonAddress, customerAddress, bgpAsn, vlan), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsDxHostedPublicVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttr(resourceName, "amazon_address", amazonAddress), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttr(resourceName, "customer_address", customerAddress), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.#", "2"), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.1752038751", "210.52.109.0/24"), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.4290081960", "175.45.176.0/22"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), + // Accepter's attributes: + resource.TestCheckResourceAttrSet(accepterResourceName, "arn"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Name", rName), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Key1", "Value1"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Key2", "Value2a"), + resource.TestCheckResourceAttrPair(accepterResourceName, "virtual_interface_id", resourceName, "id"), + ), + }, + { + Config: testAccDxHostedPublicVirtualInterfaceConfig_accepterTagsUpdated(connectionId, rName, amazonAddress, customerAddress, bgpAsn, vlan), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsDxHostedPublicVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttr(resourceName, "amazon_address", amazonAddress), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttr(resourceName, "customer_address", customerAddress), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.#", "2"), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.1752038751", "210.52.109.0/24"), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.4290081960", "175.45.176.0/22"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), + // Accepter's attributes: + resource.TestCheckResourceAttrSet(accepterResourceName, "arn"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Name", rName), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Key2", "Value2b"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Key3", "Value3"), + resource.TestCheckResourceAttrPair(accepterResourceName, "virtual_interface_id", resourceName, "id"), + ), + }, + }, + }) } -func testAccCheckAwsDxHostedPublicVirtualInterfaceAccepterExists(name string) resource.TestCheckFunc { - return func(s *terraform.State) error { - _, ok := s.RootModule().Resources[name] - if !ok { - return fmt.Errorf("Not found: %s", name) - } +func testAccCheckAwsDxHostedPublicVirtualInterfaceDestroy(s *terraform.State) error { + return testAccCheckDxVirtualInterfaceDestroy(s, "aws_dx_hosted_public_virtual_interface") +} - return nil - } +func testAccCheckAwsDxHostedPublicVirtualInterfaceExists(name string, vif *directconnect.VirtualInterface) resource.TestCheckFunc { + return testAccCheckDxVirtualInterfaceExists(name, vif) } -func testAccDxHostedPublicVirtualInterfaceConfig_base(cid, rName string, bgpAsn, vlan int) string { +func testAccDxHostedPublicVirtualInterfaceConfig_base(cid, rName, amzAddr, custAddr string, bgpAsn, vlan int) string { return testAccAlternateAccountProviderConfig() + fmt.Sprintf(` # Creator resource "aws_dx_hosted_public_virtual_interface" "test" { + address_family = "ipv4" + amazon_address = %[3]q + bgp_asn = %[5]d connection_id = %[1]q + customer_address = %[4]q + name = %[2]q owner_account_id = "${data.aws_caller_identity.accepter.account_id}" - - name = %[2]q - vlan = %[4]d - address_family = "ipv4" - bgp_asn = %[3]d - - customer_address = "175.45.176.1/30" - amazon_address = "175.45.176.2/30" + vlan = %[6]d route_filter_prefixes = [ - "210.52.109.0/24", "175.45.176.0/22", + "210.52.109.0/24", ] } @@ -137,29 +189,47 @@ resource "aws_dx_hosted_public_virtual_interface" "test" { data "aws_caller_identity" "accepter" { provider = "aws.alternate" } -`, cid, rName, bgpAsn, vlan) +`, cid, rName, amzAddr, custAddr, bgpAsn, vlan) } -func testAccDxHostedPublicVirtualInterfaceConfig_basic(cid, rName string, bgpAsn, vlan int) string { - return testAccDxHostedPublicVirtualInterfaceConfig_base(cid, rName, bgpAsn, vlan) + fmt.Sprintf(` +func testAccDxHostedPublicVirtualInterfaceConfig_basic(cid, rName, amzAddr, custAddr string, bgpAsn, vlan int) string { + return testAccDxHostedPublicVirtualInterfaceConfig_base(cid, rName, amzAddr, custAddr, bgpAsn, vlan) + fmt.Sprintf(` resource "aws_dx_hosted_public_virtual_interface_accepter" "test" { - provider = "aws.alternate" + provider = "aws.alternate" virtual_interface_id = "${aws_dx_hosted_public_virtual_interface.test.id}" } `) } -func testAccDxHostedPublicVirtualInterfaceConfig_updated(cid, rName string, bgpAsn, vlan int) string { - return testAccDxHostedPublicVirtualInterfaceConfig_base(cid, rName, bgpAsn, vlan) + fmt.Sprintf(` +func testAccDxHostedPublicVirtualInterfaceConfig_accepterTags(cid, rName, amzAddr, custAddr string, bgpAsn, vlan int) string { + return testAccDxHostedPublicVirtualInterfaceConfig_base(cid, rName, amzAddr, custAddr, bgpAsn, vlan) + fmt.Sprintf(` resource "aws_dx_hosted_public_virtual_interface_accepter" "test" { - provider = "aws.alternate" + provider = "aws.alternate" virtual_interface_id = "${aws_dx_hosted_public_virtual_interface.test.id}" tags = { - Environment = "test" + Name = %[1]q + Key1 = "Value1" + Key2 = "Value2a" } } -`) +`, rName) +} + +func testAccDxHostedPublicVirtualInterfaceConfig_accepterTagsUpdated(cid, rName, amzAddr, custAddr string, bgpAsn, vlan int) string { + return testAccDxHostedPublicVirtualInterfaceConfig_base(cid, rName, amzAddr, custAddr, bgpAsn, vlan) + fmt.Sprintf(` +resource "aws_dx_hosted_public_virtual_interface_accepter" "test" { + provider = "aws.alternate" + + virtual_interface_id = "${aws_dx_hosted_public_virtual_interface.test.id}" + + tags = { + Name = %[1]q + Key2 = "Value2b" + Key3 = "Value3" + } +} +`, rName) } diff --git a/aws/resource_aws_dx_hosted_transit_virtual_interface.go b/aws/resource_aws_dx_hosted_transit_virtual_interface.go new file mode 100644 index 00000000000..071fb14e45c --- /dev/null +++ b/aws/resource_aws_dx_hosted_transit_virtual_interface.go @@ -0,0 +1,225 @@ +package aws + +import ( + "fmt" + "log" + "strconv" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" + "github.com/aws/aws-sdk-go/service/directconnect" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" +) + +func resourceAwsDxHostedTransitVirtualInterface() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsDxHostedTransitVirtualInterfaceCreate, + Read: resourceAwsDxHostedTransitVirtualInterfaceRead, + Delete: resourceAwsDxHostedTransitVirtualInterfaceDelete, + Importer: &schema.ResourceImporter{ + State: resourceAwsDxHostedTransitVirtualInterfaceImport, + }, + + Schema: map[string]*schema.Schema{ + "address_family": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + directconnect.AddressFamilyIpv4, + directconnect.AddressFamilyIpv6, + }, false), + }, + "amazon_address": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "amazon_side_asn": { + Type: schema.TypeString, + Computed: true, + }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "aws_device": { + Type: schema.TypeString, + Computed: true, + }, + "bgp_asn": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + }, + "bgp_auth_key": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "connection_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "customer_address": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "jumbo_frame_capable": { + Type: schema.TypeBool, + Computed: true, + }, + "mtu": { + Type: schema.TypeInt, + Default: 1500, + Optional: true, + ForceNew: true, + ValidateFunc: validation.IntInSlice([]int{1500, 8500}), + }, + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "owner_account_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validateAwsAccountId, + }, + "vlan": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + ValidateFunc: validation.IntBetween(1, 4094), + }, + }, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Update: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), + }, + } +} + +func resourceAwsDxHostedTransitVirtualInterfaceCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).dxconn + + req := &directconnect.AllocateTransitVirtualInterfaceInput{ + ConnectionId: aws.String(d.Get("connection_id").(string)), + OwnerAccount: aws.String(d.Get("owner_account_id").(string)), + NewTransitVirtualInterfaceAllocation: &directconnect.NewTransitVirtualInterfaceAllocation{ + AddressFamily: aws.String(d.Get("address_family").(string)), + Asn: aws.Int64(int64(d.Get("bgp_asn").(int))), + Mtu: aws.Int64(int64(d.Get("mtu").(int))), + VirtualInterfaceName: aws.String(d.Get("name").(string)), + Vlan: aws.Int64(int64(d.Get("vlan").(int))), + }, + } + if v, ok := d.GetOk("amazon_address"); ok && v.(string) != "" { + req.NewTransitVirtualInterfaceAllocation.AmazonAddress = aws.String(v.(string)) + } + if v, ok := d.GetOk("bgp_auth_key"); ok && v.(string) != "" { + req.NewTransitVirtualInterfaceAllocation.AuthKey = aws.String(v.(string)) + } + if v, ok := d.GetOk("customer_address"); ok && v.(string) != "" { + req.NewTransitVirtualInterfaceAllocation.CustomerAddress = aws.String(v.(string)) + } + + log.Printf("[DEBUG] Creating Direct Connect hosted transit virtual interface: %s", req) + resp, err := conn.AllocateTransitVirtualInterface(req) + if err != nil { + return fmt.Errorf("error creating Direct Connect hosted transit virtual interface: %s", err) + } + + d.SetId(aws.StringValue(resp.VirtualInterface.VirtualInterfaceId)) + + if err := dxHostedTransitVirtualInterfaceWaitUntilAvailable(conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { + return err + } + + return resourceAwsDxHostedTransitVirtualInterfaceRead(d, meta) +} + +func resourceAwsDxHostedTransitVirtualInterfaceRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).dxconn + + vif, err := dxVirtualInterfaceRead(d.Id(), conn) + if err != nil { + return err + } + if vif == nil { + log.Printf("[WARN] Direct Connect hosted transit virtual interface (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + d.Set("address_family", vif.AddressFamily) + d.Set("amazon_address", vif.AmazonAddress) + d.Set("amazon_side_asn", strconv.FormatInt(aws.Int64Value(vif.AmazonSideAsn), 10)) + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Region: meta.(*AWSClient).region, + Service: "directconnect", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("dxvif/%s", d.Id()), + }.String() + d.Set("arn", arn) + d.Set("aws_device", vif.AwsDeviceV2) + d.Set("bgp_asn", vif.Asn) + d.Set("bgp_auth_key", vif.AuthKey) + d.Set("connection_id", vif.ConnectionId) + d.Set("customer_address", vif.CustomerAddress) + d.Set("jumbo_frame_capable", vif.JumboFrameCapable) + d.Set("mtu", vif.Mtu) + d.Set("name", vif.VirtualInterfaceName) + d.Set("owner_account_id", vif.OwnerAccount) + d.Set("vlan", vif.Vlan) + + return nil +} + +func resourceAwsDxHostedTransitVirtualInterfaceDelete(d *schema.ResourceData, meta interface{}) error { + return dxVirtualInterfaceDelete(d, meta) +} + +func resourceAwsDxHostedTransitVirtualInterfaceImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + conn := meta.(*AWSClient).dxconn + + vif, err := dxVirtualInterfaceRead(d.Id(), conn) + if err != nil { + return nil, err + } + if vif == nil { + return nil, fmt.Errorf("virtual interface (%s) not found", d.Id()) + } + + if vifType := aws.StringValue(vif.VirtualInterfaceType); vifType != "transit" { + return nil, fmt.Errorf("virtual interface (%s) has incorrect type: %s", d.Id(), vifType) + } + + return []*schema.ResourceData{d}, nil +} + +func dxHostedTransitVirtualInterfaceWaitUntilAvailable(conn *directconnect.DirectConnect, vifId string, timeout time.Duration) error { + return dxVirtualInterfaceWaitUntilAvailable( + conn, + vifId, + timeout, + []string{ + directconnect.VirtualInterfaceStatePending, + }, + []string{ + directconnect.VirtualInterfaceStateAvailable, + directconnect.VirtualInterfaceStateConfirming, + directconnect.VirtualInterfaceStateDown, + }) +} diff --git a/aws/resource_aws_dx_hosted_transit_virtual_interface_accepter.go b/aws/resource_aws_dx_hosted_transit_virtual_interface_accepter.go new file mode 100644 index 00000000000..cd118fb9451 --- /dev/null +++ b/aws/resource_aws_dx_hosted_transit_virtual_interface_accepter.go @@ -0,0 +1,171 @@ +package aws + +import ( + "fmt" + "log" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" + "github.com/aws/aws-sdk-go/service/directconnect" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +func resourceAwsDxHostedTransitVirtualInterfaceAccepter() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsDxHostedTransitVirtualInterfaceAccepterCreate, + Read: resourceAwsDxHostedTransitVirtualInterfaceAccepterRead, + Update: resourceAwsDxHostedTransitVirtualInterfaceAccepterUpdate, + Delete: resourceAwsDxHostedTransitVirtualInterfaceAccepterDelete, + Importer: &schema.ResourceImporter{ + State: resourceAwsDxHostedTransitVirtualInterfaceAccepterImport, + }, + + Schema: map[string]*schema.Schema{ + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "dx_gateway_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "tags": tagsSchema(), + "virtual_interface_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + }, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), + }, + } +} + +func resourceAwsDxHostedTransitVirtualInterfaceAccepterCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).dxconn + + vifId := d.Get("virtual_interface_id").(string) + req := &directconnect.ConfirmTransitVirtualInterfaceInput{ + DirectConnectGatewayId: aws.String(d.Get("dx_gateway_id").(string)), + VirtualInterfaceId: aws.String(vifId), + } + + log.Printf("[DEBUG] Accepting Direct Connect hosted transit virtual interface: %s", req) + _, err := conn.ConfirmTransitVirtualInterface(req) + if err != nil { + return fmt.Errorf("error accepting Direct Connect hosted transit virtual interface (%s): %s", vifId, err) + } + + d.SetId(vifId) + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Region: meta.(*AWSClient).region, + Service: "directconnect", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("dxvif/%s", d.Id()), + }.String() + d.Set("arn", arn) + + if err := dxHostedTransitVirtualInterfaceAccepterWaitUntilAvailable(conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { + return err + } + + return resourceAwsDxHostedTransitVirtualInterfaceAccepterUpdate(d, meta) +} + +func resourceAwsDxHostedTransitVirtualInterfaceAccepterRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).dxconn + + vif, err := dxVirtualInterfaceRead(d.Id(), conn) + if err != nil { + return err + } + if vif == nil { + log.Printf("[WARN] Direct Connect transit virtual interface (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + vifState := aws.StringValue(vif.VirtualInterfaceState) + if vifState != directconnect.VirtualInterfaceStateAvailable && vifState != directconnect.VirtualInterfaceStateDown { + log.Printf("[WARN] Direct Connect virtual interface (%s) is '%s', removing from state", vifState, d.Id()) + d.SetId("") + return nil + } + + d.Set("dx_gateway_id", vif.DirectConnectGatewayId) + d.Set("virtual_interface_id", vif.VirtualInterfaceId) + + arn := d.Get("arn").(string) + tags, err := keyvaluetags.DirectconnectListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for Direct Connect hosted transit virtual interface (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + return nil +} + +func resourceAwsDxHostedTransitVirtualInterfaceAccepterUpdate(d *schema.ResourceData, meta interface{}) error { + if err := dxVirtualInterfaceUpdate(d, meta); err != nil { + return err + } + + return resourceAwsDxHostedTransitVirtualInterfaceAccepterRead(d, meta) +} + +func resourceAwsDxHostedTransitVirtualInterfaceAccepterDelete(d *schema.ResourceData, meta interface{}) error { + log.Printf("[WARN] Will not delete Direct Connect virtual interface. Terraform will remove this resource from the state file, however resources may remain.") + return nil +} + +func resourceAwsDxHostedTransitVirtualInterfaceAccepterImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + conn := meta.(*AWSClient).dxconn + + vif, err := dxVirtualInterfaceRead(d.Id(), conn) + if err != nil { + return nil, err + } + if vif == nil { + return nil, fmt.Errorf("virtual interface (%s) not found", d.Id()) + } + + if vifType := aws.StringValue(vif.VirtualInterfaceType); vifType != "transit" { + return nil, fmt.Errorf("virtual interface (%s) has incorrect type: %s", d.Id(), vifType) + } + + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Region: meta.(*AWSClient).region, + Service: "directconnect", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("dxvif/%s", d.Id()), + }.String() + d.Set("arn", arn) + + return []*schema.ResourceData{d}, nil +} + +func dxHostedTransitVirtualInterfaceAccepterWaitUntilAvailable(conn *directconnect.DirectConnect, vifId string, timeout time.Duration) error { + return dxVirtualInterfaceWaitUntilAvailable( + conn, + vifId, + timeout, + []string{ + directconnect.VirtualInterfaceStateConfirming, + directconnect.VirtualInterfaceStatePending, + }, + []string{ + directconnect.VirtualInterfaceStateAvailable, + directconnect.VirtualInterfaceStateDown, + }) +} diff --git a/aws/resource_aws_dx_hosted_transit_virtual_interface_test.go b/aws/resource_aws_dx_hosted_transit_virtual_interface_test.go new file mode 100644 index 00000000000..dc5ae878b94 --- /dev/null +++ b/aws/resource_aws_dx_hosted_transit_virtual_interface_test.go @@ -0,0 +1,253 @@ +package aws + +import ( + "fmt" + "os" + "regexp" + "strconv" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/directconnect" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func TestAccAwsDxHostedTransitVirtualInterface(t *testing.T) { + testCases := map[string]func(t *testing.T){ + "basic": testAccAwsDxHostedTransitVirtualInterface_basic, + "accepterTags": testAccAwsDxHostedTransitVirtualInterface_accepterTags, + } + + for name, tc := range testCases { + tc := tc + t.Run(name, func(t *testing.T) { + tc(t) + }) + } +} + +func testAccAwsDxHostedTransitVirtualInterface_basic(t *testing.T) { + key := "DX_CONNECTION_ID" + connectionId := os.Getenv(key) + if connectionId == "" { + t.Skipf("Environment variable %s is not set", key) + } + + var providers []*schema.Provider + var vif directconnect.VirtualInterface + resourceName := "aws_dx_hosted_transit_virtual_interface.test" + accepterResourceName := "aws_dx_hosted_transit_virtual_interface_accepter.test" + dxGatewayResourceName := "aws_dx_gateway.test" + rName := fmt.Sprintf("tf-testacc-transit-vif-%s", acctest.RandString(9)) + amzAsn := randIntRange(64512, 65534) + bgpAsn := randIntRange(64512, 65534) + vlan := randIntRange(2049, 4094) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccAlternateAccountPreCheck(t) + }, + ProviderFactories: testAccProviderFactories(&providers), + CheckDestroy: testAccCheckAwsDxHostedTransitVirtualInterfaceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDxHostedTransitVirtualInterfaceConfig_basic(connectionId, rName, amzAsn, bgpAsn, vlan), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsDxHostedTransitVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttr(resourceName, "jumbo_frame_capable", "true"), + resource.TestCheckResourceAttr(resourceName, "mtu", "1500"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "owner_account_id"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), + // Accepter's attributes: + resource.TestCheckResourceAttrSet(accepterResourceName, "arn"), + resource.TestCheckResourceAttrPair(accepterResourceName, "dx_gateway_id", dxGatewayResourceName, "id"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.%", "0"), + resource.TestCheckResourceAttrPair(accepterResourceName, "virtual_interface_id", resourceName, "id"), + ), + }, + // Test import. + { + Config: testAccDxHostedTransitVirtualInterfaceConfig_basic(connectionId, rName, amzAsn, bgpAsn, vlan), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccAwsDxHostedTransitVirtualInterface_accepterTags(t *testing.T) { + key := "DX_CONNECTION_ID" + connectionId := os.Getenv(key) + if connectionId == "" { + t.Skipf("Environment variable %s is not set", key) + } + + var providers []*schema.Provider + var vif directconnect.VirtualInterface + resourceName := "aws_dx_hosted_transit_virtual_interface.test" + accepterResourceName := "aws_dx_hosted_transit_virtual_interface_accepter.test" + dxGatewayResourceName := "aws_dx_gateway.test" + rName := fmt.Sprintf("tf-testacc-transit-vif-%s", acctest.RandString(9)) + amzAsn := randIntRange(64512, 65534) + bgpAsn := randIntRange(64512, 65534) + vlan := randIntRange(2049, 4094) + + resource.Test(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccAlternateAccountPreCheck(t) + }, + ProviderFactories: testAccProviderFactories(&providers), + CheckDestroy: testAccCheckAwsDxHostedTransitVirtualInterfaceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDxHostedTransitVirtualInterfaceConfig_accepterTags(connectionId, rName, amzAsn, bgpAsn, vlan), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsDxHostedTransitVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttr(resourceName, "jumbo_frame_capable", "true"), + resource.TestCheckResourceAttr(resourceName, "mtu", "1500"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "owner_account_id"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), + // Accepter's attributes: + resource.TestCheckResourceAttrSet(accepterResourceName, "arn"), + resource.TestCheckResourceAttrPair(accepterResourceName, "dx_gateway_id", dxGatewayResourceName, "id"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Name", rName), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Key1", "Value1"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Key2", "Value2a"), + resource.TestCheckResourceAttrPair(accepterResourceName, "virtual_interface_id", resourceName, "id"), + ), + }, + { + Config: testAccDxHostedTransitVirtualInterfaceConfig_accepterTagsUpdated(connectionId, rName, amzAsn, bgpAsn, vlan), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsDxHostedTransitVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttr(resourceName, "jumbo_frame_capable", "true"), + resource.TestCheckResourceAttr(resourceName, "mtu", "1500"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrSet(resourceName, "owner_account_id"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), + // Accepter's attributes: + resource.TestCheckResourceAttrSet(accepterResourceName, "arn"), + resource.TestCheckResourceAttrPair(accepterResourceName, "dx_gateway_id", dxGatewayResourceName, "id"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Name", rName), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Key2", "Value2b"), + resource.TestCheckResourceAttr(accepterResourceName, "tags.Key3", "Value3"), + resource.TestCheckResourceAttrPair(accepterResourceName, "virtual_interface_id", resourceName, "id"), + ), + }, + }, + }) +} + +func testAccCheckAwsDxHostedTransitVirtualInterfaceExists(name string, vif *directconnect.VirtualInterface) resource.TestCheckFunc { + return testAccCheckDxVirtualInterfaceExists(name, vif) +} + +func testAccCheckAwsDxHostedTransitVirtualInterfaceDestroy(s *terraform.State) error { + return testAccCheckDxVirtualInterfaceDestroy(s, "aws_dx_hosted_transit_virtual_interface") +} + +func testAccDxHostedTransitVirtualInterfaceConfig_base(cid, rName string, amzAsn, bgpAsn, vlan int) string { + return testAccAlternateAccountProviderConfig() + fmt.Sprintf(` +# Creator +resource "aws_dx_hosted_transit_virtual_interface" "test" { + address_family = "ipv4" + bgp_asn = %[4]d + connection_id = %[1]q + name = %[2]q + owner_account_id = "${data.aws_caller_identity.accepter.account_id}" + vlan = %[5]d + + # The aws_dx_hosted_transit_virtual_interface + # must be destroyed before the aws_dx_gateway. + depends_on = ["aws_dx_gateway.test"] +} + +# Accepter +data "aws_caller_identity" "accepter" { + provider = "aws.alternate" +} + +resource "aws_dx_gateway" "test" { + provider = "aws.alternate" + + amazon_side_asn = %[3]d + name = %[2]q +} +`, cid, rName, amzAsn, bgpAsn, vlan) +} + +func testAccDxHostedTransitVirtualInterfaceConfig_basic(cid, rName string, amzAsn, bgpAsn, vlan int) string { + return testAccDxHostedTransitVirtualInterfaceConfig_base(cid, rName, amzAsn, bgpAsn, vlan) + fmt.Sprintf(` +resource "aws_dx_hosted_transit_virtual_interface_accepter" "test" { + provider = "aws.alternate" + + dx_gateway_id = "${aws_dx_gateway.test.id}" + virtual_interface_id = "${aws_dx_hosted_transit_virtual_interface.test.id}" +} +`) +} + +func testAccDxHostedTransitVirtualInterfaceConfig_accepterTags(cid, rName string, amzAsn, bgpAsn, vlan int) string { + return testAccDxHostedTransitVirtualInterfaceConfig_base(cid, rName, amzAsn, bgpAsn, vlan) + fmt.Sprintf(` +resource "aws_dx_hosted_transit_virtual_interface_accepter" "test" { + provider = "aws.alternate" + + dx_gateway_id = "${aws_dx_gateway.test.id}" + virtual_interface_id = "${aws_dx_hosted_transit_virtual_interface.test.id}" + + tags = { + Name = %[1]q + Key1 = "Value1" + Key2 = "Value2a" + } +} +`, rName) +} + +func testAccDxHostedTransitVirtualInterfaceConfig_accepterTagsUpdated(cid, rName string, amzAsn, bgpAsn, vlan int) string { + return testAccDxHostedTransitVirtualInterfaceConfig_base(cid, rName, amzAsn, bgpAsn, vlan) + fmt.Sprintf(` +resource "aws_dx_hosted_transit_virtual_interface_accepter" "test" { + provider = "aws.alternate" + + dx_gateway_id = "${aws_dx_gateway.test.id}" + virtual_interface_id = "${aws_dx_hosted_transit_virtual_interface.test.id}" + + tags = { + Name = %[1]q + Key2 = "Value2b" + Key3 = "Value3" + } +} +`, rName) +} diff --git a/aws/resource_aws_dx_lag.go b/aws/resource_aws_dx_lag.go index 4284959a591..44acba3bd7f 100644 --- a/aws/resource_aws_dx_lag.go +++ b/aws/resource_aws_dx_lag.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/service/directconnect" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDxLag() *schema.Resource { @@ -77,6 +78,10 @@ func resourceAwsDxLagCreate(d *schema.ResourceData, meta interface{}) error { NumberOfConnections: aws.Int64(int64(1)), } + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + req.Tags = keyvaluetags.New(v).IgnoreAws().DirectconnectTags() + } + log.Printf("[DEBUG] Creating Direct Connect LAG: %#v", req) resp, err := conn.CreateLag(req) if err != nil { @@ -96,7 +101,7 @@ func resourceAwsDxLagCreate(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error deleting newly created and unmanaged Direct Connect LAG (%s) Connection (%s): %s", d.Id(), connectionID, err) } - return resourceAwsDxLagUpdate(d, meta) + return resourceAwsDxLagRead(d, meta) } func resourceAwsDxLagRead(d *schema.ResourceData, meta interface{}) error { @@ -147,15 +152,22 @@ func resourceAwsDxLagRead(d *schema.ResourceData, meta interface{}) error { d.Set("jumbo_frame_capable", lag.JumboFrameCapable) d.Set("has_logical_redundancy", lag.HasLogicalRedundancy) - err1 := getTagsDX(conn, d, arn) - return err1 + tags, err := keyvaluetags.DirectconnectListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for Direct Connect LAG (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + return nil } func resourceAwsDxLagUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).dxconn - d.Partial(true) - if d.HasChange("name") { req := &directconnect.UpdateLagInput{ LagId: aws.String(d.Id()), @@ -165,26 +177,18 @@ func resourceAwsDxLagUpdate(d *schema.ResourceData, meta interface{}) error { log.Printf("[DEBUG] Updating Direct Connect LAG: %#v", req) _, err := conn.UpdateLag(req) if err != nil { - return err - } else { - d.SetPartial("name") + return fmt.Errorf("error updating Direct Connect LAG (%s): %s", d.Id(), err) } } - arn := arn.ARN{ - Partition: meta.(*AWSClient).partition, - Region: meta.(*AWSClient).region, - Service: "directconnect", - AccountID: meta.(*AWSClient).accountid, - Resource: fmt.Sprintf("dxlag/%s", d.Id()), - }.String() - if err := setTagsDX(conn, d, arn); err != nil { - return err - } else { - d.SetPartial("tags") - } + arn := d.Get("arn").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") - d.Partial(false) + if err := keyvaluetags.DirectconnectUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating Direct Connect LAG (%s) tags: %s", arn, err) + } + } return resourceAwsDxLagRead(d, meta) } diff --git a/aws/resource_aws_dx_lag_test.go b/aws/resource_aws_dx_lag_test.go index 7b8fecf9100..a03c9a0d47f 100644 --- a/aws/resource_aws_dx_lag_test.go +++ b/aws/resource_aws_dx_lag_test.go @@ -11,31 +11,10 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSDxLag_importBasic(t *testing.T) { - resourceName := "aws_dx_lag.hoge" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAwsDxLagDestroy, - Steps: []resource.TestStep{ - { - Config: testAccDxLagConfig(acctest.RandString(5)), - }, - - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"force_destroy"}, - }, - }, - }) -} - func TestAccAWSDxLag_basic(t *testing.T) { lagName1 := fmt.Sprintf("tf-dx-lag-%s", acctest.RandString(5)) lagName2 := fmt.Sprintf("tf-dx-lag-%s", acctest.RandString(5)) + resourceName := "aws_dx_lag.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -45,21 +24,27 @@ func TestAccAWSDxLag_basic(t *testing.T) { { Config: testAccDxLagConfig(lagName1), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxLagExists("aws_dx_lag.hoge"), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "name", lagName1), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "connections_bandwidth", "1Gbps"), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "location", "EqSe2"), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "tags.%", "0"), + testAccCheckAwsDxLagExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", lagName1), + resource.TestCheckResourceAttr(resourceName, "connections_bandwidth", "1Gbps"), + resource.TestCheckResourceAttr(resourceName, "location", "EqSe2"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"force_destroy"}, + }, { Config: testAccDxLagConfig(lagName2), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxLagExists("aws_dx_lag.hoge"), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "name", lagName2), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "connections_bandwidth", "1Gbps"), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "location", "EqSe2"), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "tags.%", "0"), + testAccCheckAwsDxLagExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", lagName2), + resource.TestCheckResourceAttr(resourceName, "connections_bandwidth", "1Gbps"), + resource.TestCheckResourceAttr(resourceName, "location", "EqSe2"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, }, @@ -68,6 +53,7 @@ func TestAccAWSDxLag_basic(t *testing.T) { func TestAccAWSDxLag_tags(t *testing.T) { lagName := fmt.Sprintf("tf-dx-lag-%s", acctest.RandString(5)) + resourceName := "aws_dx_lag.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -77,27 +63,33 @@ func TestAccAWSDxLag_tags(t *testing.T) { { Config: testAccDxLagConfig_tags(lagName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxLagExists("aws_dx_lag.hoge"), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "name", lagName), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "tags.%", "2"), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "tags.Usage", "original"), + testAccCheckAwsDxLagExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", lagName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.Usage", "original"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"force_destroy"}, + }, { Config: testAccDxLagConfig_tagsChanged(lagName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxLagExists("aws_dx_lag.hoge"), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "name", lagName), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "tags.Usage", "changed"), + testAccCheckAwsDxLagExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", lagName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.Usage", "changed"), ), }, { Config: testAccDxLagConfig(lagName), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxLagExists("aws_dx_lag.hoge"), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "name", lagName), - resource.TestCheckResourceAttr("aws_dx_lag.hoge", "tags.%", "0"), + testAccCheckAwsDxLagExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", lagName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, }, @@ -143,7 +135,7 @@ func testAccCheckAwsDxLagExists(name string) resource.TestCheckFunc { func testAccDxLagConfig(n string) string { return fmt.Sprintf(` -resource "aws_dx_lag" "hoge" { +resource "aws_dx_lag" "test" { name = "%s" connections_bandwidth = "1Gbps" location = "EqSe2" @@ -154,7 +146,7 @@ resource "aws_dx_lag" "hoge" { func testAccDxLagConfig_tags(n string) string { return fmt.Sprintf(` -resource "aws_dx_lag" "hoge" { +resource "aws_dx_lag" "test" { name = "%s" connections_bandwidth = "1Gbps" location = "EqSe2" @@ -170,7 +162,7 @@ resource "aws_dx_lag" "hoge" { func testAccDxLagConfig_tagsChanged(n string) string { return fmt.Sprintf(` -resource "aws_dx_lag" "hoge" { +resource "aws_dx_lag" "test" { name = "%s" connections_bandwidth = "1Gbps" location = "EqSe2" diff --git a/aws/resource_aws_dx_private_virtual_interface.go b/aws/resource_aws_dx_private_virtual_interface.go index daf1dcf6522..6dbc9bb2575 100644 --- a/aws/resource_aws_dx_private_virtual_interface.go +++ b/aws/resource_aws_dx_private_virtual_interface.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "strconv" "time" "github.com/aws/aws-sdk-go/aws" @@ -10,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/directconnect" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDxPrivateVirtualInterface() *schema.Resource { @@ -23,37 +25,32 @@ func resourceAwsDxPrivateVirtualInterface() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "connection_id": { + "address_family": { Type: schema.TypeString, Required: true, ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + directconnect.AddressFamilyIpv4, + directconnect.AddressFamilyIpv6, + }, false), }, - "name": { + "amazon_address": { Type: schema.TypeString, - Required: true, + Optional: true, + Computed: true, ForceNew: true, }, - "vpn_gateway_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ConflictsWith: []string{"dx_gateway_id"}, + "amazon_side_asn": { + Type: schema.TypeString, + Computed: true, }, - "dx_gateway_id": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - ConflictsWith: []string{"vpn_gateway_id"}, + "arn": { + Type: schema.TypeString, + Computed: true, }, - "vlan": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, - ValidateFunc: validation.IntBetween(1, 4094), + "aws_device": { + Type: schema.TypeString, + Computed: true, }, "bgp_asn": { Type: schema.TypeInt, @@ -66,11 +63,10 @@ func resourceAwsDxPrivateVirtualInterface() *schema.Resource { Computed: true, ForceNew: true, }, - "address_family": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{directconnect.AddressFamilyIpv4, directconnect.AddressFamilyIpv6}, false), + "connection_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "customer_address": { Type: schema.TypeString, @@ -78,11 +74,15 @@ func resourceAwsDxPrivateVirtualInterface() *schema.Resource { Computed: true, ForceNew: true, }, - "amazon_address": { - Type: schema.TypeString, - Optional: true, + "dx_gateway_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ConflictsWith: []string{"vpn_gateway_id"}, + }, + "jumbo_frame_capable": { + Type: schema.TypeBool, Computed: true, - ForceNew: true, }, "mtu": { Type: schema.TypeInt, @@ -90,14 +90,23 @@ func resourceAwsDxPrivateVirtualInterface() *schema.Resource { Optional: true, ValidateFunc: validation.IntInSlice([]int{1500, 9001}), }, - "jumbo_frame_capable": { - Type: schema.TypeBool, - Computed: true, + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "tags": tagsSchema(), - "aws_device": { - Type: schema.TypeString, - Computed: true, + "vlan": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + ValidateFunc: validation.IntBetween(1, 4094), + }, + "vpn_gateway_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ConflictsWith: []string{"dx_gateway_id"}, }, }, @@ -122,11 +131,11 @@ func resourceAwsDxPrivateVirtualInterfaceCreate(d *schema.ResourceData, meta int req := &directconnect.CreatePrivateVirtualInterfaceInput{ ConnectionId: aws.String(d.Get("connection_id").(string)), NewPrivateVirtualInterface: &directconnect.NewPrivateVirtualInterface{ - VirtualInterfaceName: aws.String(d.Get("name").(string)), - Vlan: aws.Int64(int64(d.Get("vlan").(int))), - Asn: aws.Int64(int64(d.Get("bgp_asn").(int))), AddressFamily: aws.String(d.Get("address_family").(string)), + Asn: aws.Int64(int64(d.Get("bgp_asn").(int))), Mtu: aws.Int64(int64(d.Get("mtu").(int))), + VirtualInterfaceName: aws.String(d.Get("name").(string)), + Vlan: aws.Int64(int64(d.Get("vlan").(int))), }, } if vgwOk && vgwIdRaw.(string) != "" { @@ -135,37 +144,32 @@ func resourceAwsDxPrivateVirtualInterfaceCreate(d *schema.ResourceData, meta int if dxgwOk && dxgwIdRaw.(string) != "" { req.NewPrivateVirtualInterface.DirectConnectGatewayId = aws.String(dxgwIdRaw.(string)) } + if v, ok := d.GetOk("amazon_address"); ok && v.(string) != "" { + req.NewPrivateVirtualInterface.AmazonAddress = aws.String(v.(string)) + } if v, ok := d.GetOk("bgp_auth_key"); ok { req.NewPrivateVirtualInterface.AuthKey = aws.String(v.(string)) } if v, ok := d.GetOk("customer_address"); ok && v.(string) != "" { req.NewPrivateVirtualInterface.CustomerAddress = aws.String(v.(string)) } - if v, ok := d.GetOk("amazon_address"); ok && v.(string) != "" { - req.NewPrivateVirtualInterface.AmazonAddress = aws.String(v.(string)) + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + req.NewPrivateVirtualInterface.Tags = keyvaluetags.New(v).IgnoreAws().DirectconnectTags() } - log.Printf("[DEBUG] Creating Direct Connect private virtual interface: %#v", req) + log.Printf("[DEBUG] Creating Direct Connect private virtual interface: %s", req) resp, err := conn.CreatePrivateVirtualInterface(req) if err != nil { - return fmt.Errorf("Error creating Direct Connect private virtual interface: %s", err.Error()) + return fmt.Errorf("error creating Direct Connect private virtual interface: %s", err) } d.SetId(aws.StringValue(resp.VirtualInterfaceId)) - arn := arn.ARN{ - Partition: meta.(*AWSClient).partition, - Region: meta.(*AWSClient).region, - Service: "directconnect", - AccountID: meta.(*AWSClient).accountid, - Resource: fmt.Sprintf("dxvif/%s", d.Id()), - }.String() - d.Set("arn", arn) if err := dxPrivateVirtualInterfaceWaitUntilAvailable(conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { return err } - return resourceAwsDxPrivateVirtualInterfaceUpdate(d, meta) + return resourceAwsDxPrivateVirtualInterfaceRead(d, meta) } func resourceAwsDxPrivateVirtualInterfaceRead(d *schema.ResourceData, meta interface{}) error { @@ -176,26 +180,45 @@ func resourceAwsDxPrivateVirtualInterfaceRead(d *schema.ResourceData, meta inter return err } if vif == nil { - log.Printf("[WARN] Direct Connect virtual interface (%s) not found, removing from state", d.Id()) + log.Printf("[WARN] Direct Connect private virtual interface (%s) not found, removing from state", d.Id()) d.SetId("") return nil } - d.Set("connection_id", vif.ConnectionId) - d.Set("name", vif.VirtualInterfaceName) - d.Set("vlan", vif.Vlan) + d.Set("address_family", vif.AddressFamily) + d.Set("amazon_address", vif.AmazonAddress) + d.Set("amazon_side_asn", strconv.FormatInt(aws.Int64Value(vif.AmazonSideAsn), 10)) + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Region: meta.(*AWSClient).region, + Service: "directconnect", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("dxvif/%s", d.Id()), + }.String() + d.Set("arn", arn) + d.Set("aws_device", vif.AwsDeviceV2) d.Set("bgp_asn", vif.Asn) d.Set("bgp_auth_key", vif.AuthKey) - d.Set("address_family", vif.AddressFamily) + d.Set("connection_id", vif.ConnectionId) d.Set("customer_address", vif.CustomerAddress) - d.Set("amazon_address", vif.AmazonAddress) - d.Set("vpn_gateway_id", vif.VirtualGatewayId) d.Set("dx_gateway_id", vif.DirectConnectGatewayId) - d.Set("mtu", vif.Mtu) d.Set("jumbo_frame_capable", vif.JumboFrameCapable) - d.Set("aws_device", vif.AwsDeviceV2) - err1 := getTagsDX(conn, d, d.Get("arn").(string)) - return err1 + d.Set("mtu", vif.Mtu) + d.Set("name", vif.VirtualInterfaceName) + d.Set("vlan", vif.Vlan) + d.Set("vpn_gateway_id", vif.VirtualGatewayId) + + tags, err := keyvaluetags.DirectconnectListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for Direct Connect private virtual interface (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + return nil } func resourceAwsDxPrivateVirtualInterfaceUpdate(d *schema.ResourceData, meta interface{}) error { @@ -215,14 +238,19 @@ func resourceAwsDxPrivateVirtualInterfaceDelete(d *schema.ResourceData, meta int } func resourceAwsDxPrivateVirtualInterfaceImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - arn := arn.ARN{ - Partition: meta.(*AWSClient).partition, - Region: meta.(*AWSClient).region, - Service: "directconnect", - AccountID: meta.(*AWSClient).accountid, - Resource: fmt.Sprintf("dxvif/%s", d.Id()), - }.String() - d.Set("arn", arn) + conn := meta.(*AWSClient).dxconn + + vif, err := dxVirtualInterfaceRead(d.Id(), conn) + if err != nil { + return nil, err + } + if vif == nil { + return nil, fmt.Errorf("virtual interface (%s) not found", d.Id()) + } + + if vifType := aws.StringValue(vif.VirtualInterfaceType); vifType != "private" { + return nil, fmt.Errorf("virtual interface (%s) has incorrect type: %s", d.Id(), vifType) + } return []*schema.ResourceData{d}, nil } diff --git a/aws/resource_aws_dx_private_virtual_interface_test.go b/aws/resource_aws_dx_private_virtual_interface_test.go index 8298da927ab..32c903ede30 100644 --- a/aws/resource_aws_dx_private_virtual_interface_test.go +++ b/aws/resource_aws_dx_private_virtual_interface_test.go @@ -3,6 +3,8 @@ package aws import ( "fmt" "os" + "regexp" + "strconv" "testing" "github.com/aws/aws-sdk-go/aws" @@ -18,7 +20,11 @@ func TestAccAwsDxPrivateVirtualInterface_basic(t *testing.T) { if connectionId == "" { t.Skipf("Environment variable %s is not set", key) } - vifName := fmt.Sprintf("terraform-testacc-dxvif-%s", acctest.RandString(5)) + + var vif directconnect.VirtualInterface + resourceName := "aws_dx_private_virtual_interface.test" + vpnGatewayResourceName := "aws_vpn_gateway.test" + rName := fmt.Sprintf("tf-testacc-private-vif-%s", acctest.RandString(9)) bgpAsn := randIntRange(64512, 65534) vlan := randIntRange(2049, 4094) @@ -28,25 +34,50 @@ func TestAccAwsDxPrivateVirtualInterface_basic(t *testing.T) { CheckDestroy: testAccCheckAwsDxPrivateVirtualInterfaceDestroy, Steps: []resource.TestStep{ { - Config: testAccDxPrivateVirtualInterfaceConfig_noTags(connectionId, vifName, bgpAsn, vlan), + Config: testAccDxPrivateVirtualInterfaceConfig_basic(connectionId, rName, bgpAsn, vlan), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxPrivateVirtualInterfaceExists("aws_dx_private_virtual_interface.foo"), - resource.TestCheckResourceAttr("aws_dx_private_virtual_interface.foo", "name", vifName), - resource.TestCheckResourceAttr("aws_dx_private_virtual_interface.foo", "tags.%", "0"), + testAccCheckAwsDxPrivateVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_address"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttrSet(resourceName, "customer_address"), + resource.TestCheckResourceAttr(resourceName, "jumbo_frame_capable", "true"), + resource.TestCheckResourceAttr(resourceName, "mtu", "1500"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), + resource.TestCheckResourceAttrPair(resourceName, "vpn_gateway_id", vpnGatewayResourceName, "id"), ), }, { - Config: testAccDxPrivateVirtualInterfaceConfig_tags(connectionId, vifName, bgpAsn, vlan), + Config: testAccDxPrivateVirtualInterfaceConfig_updated(connectionId, rName, bgpAsn, vlan), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxPrivateVirtualInterfaceExists("aws_dx_private_virtual_interface.foo"), - resource.TestCheckResourceAttr("aws_dx_private_virtual_interface.foo", "name", vifName), - resource.TestCheckResourceAttr("aws_dx_private_virtual_interface.foo", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_dx_private_virtual_interface.foo", "tags.Environment", "test"), + testAccCheckAwsDxPrivateVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_address"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttrSet(resourceName, "customer_address"), + resource.TestCheckResourceAttr(resourceName, "jumbo_frame_capable", "true"), + resource.TestCheckResourceAttr(resourceName, "mtu", "9001"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), + resource.TestCheckResourceAttrPair(resourceName, "vpn_gateway_id", vpnGatewayResourceName, "id"), ), }, // Test import. { - ResourceName: "aws_dx_private_virtual_interface.foo", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -54,14 +85,17 @@ func TestAccAwsDxPrivateVirtualInterface_basic(t *testing.T) { }) } -func TestAccAwsDxPrivateVirtualInterface_dxGateway(t *testing.T) { +func TestAccAwsDxPrivateVirtualInterface_Tags(t *testing.T) { key := "DX_CONNECTION_ID" connectionId := os.Getenv(key) if connectionId == "" { t.Skipf("Environment variable %s is not set", key) } - vifName := fmt.Sprintf("terraform-testacc-dxvif-%s", acctest.RandString(5)) - amzAsn := randIntRange(64512, 65534) + + var vif directconnect.VirtualInterface + resourceName := "aws_dx_private_virtual_interface.test" + vpnGatewayResourceName := "aws_vpn_gateway.test" + rName := fmt.Sprintf("tf-testacc-private-vif-%s", acctest.RandString(9)) bgpAsn := randIntRange(64512, 65534) vlan := randIntRange(2049, 4094) @@ -71,23 +105,75 @@ func TestAccAwsDxPrivateVirtualInterface_dxGateway(t *testing.T) { CheckDestroy: testAccCheckAwsDxPrivateVirtualInterfaceDestroy, Steps: []resource.TestStep{ { - Config: testAccDxPrivateVirtualInterfaceConfig_dxGateway(connectionId, vifName, amzAsn, bgpAsn, vlan), + Config: testAccDxPrivateVirtualInterfaceConfig_tags(connectionId, rName, bgpAsn, vlan), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsDxPrivateVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_address"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttrSet(resourceName, "customer_address"), + resource.TestCheckResourceAttr(resourceName, "jumbo_frame_capable", "true"), + resource.TestCheckResourceAttr(resourceName, "mtu", "1500"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), + resource.TestCheckResourceAttr(resourceName, "tags.Key1", "Value1"), + resource.TestCheckResourceAttr(resourceName, "tags.Key2", "Value2a"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), + resource.TestCheckResourceAttrPair(resourceName, "vpn_gateway_id", vpnGatewayResourceName, "id"), + ), + }, + { + Config: testAccDxPrivateVirtualInterfaceConfig_tagsUpdated(connectionId, rName, bgpAsn, vlan), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxPrivateVirtualInterfaceExists("aws_dx_private_virtual_interface.foo"), - resource.TestCheckResourceAttr("aws_dx_private_virtual_interface.foo", "name", vifName), + testAccCheckAwsDxPrivateVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_address"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttrSet(resourceName, "customer_address"), + resource.TestCheckResourceAttr(resourceName, "jumbo_frame_capable", "true"), + resource.TestCheckResourceAttr(resourceName, "mtu", "1500"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), + resource.TestCheckResourceAttr(resourceName, "tags.Key2", "Value2b"), + resource.TestCheckResourceAttr(resourceName, "tags.Key3", "Value3"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), + resource.TestCheckResourceAttrPair(resourceName, "vpn_gateway_id", vpnGatewayResourceName, "id"), ), }, + // Test import. + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } -func TestAccAwsDxPrivateVirtualInterface_mtuUpdate(t *testing.T) { +func TestAccAwsDxPrivateVirtualInterface_DxGateway(t *testing.T) { key := "DX_CONNECTION_ID" connectionId := os.Getenv(key) if connectionId == "" { t.Skipf("Environment variable %s is not set", key) } - vifName := fmt.Sprintf("terraform-testacc-dxvif-%s", acctest.RandString(5)) + + var vif directconnect.VirtualInterface + resourceName := "aws_dx_private_virtual_interface.test" + dxGatewayResourceName := "aws_dx_gateway.test" + rName := fmt.Sprintf("tf-testacc-private-vif-%s", acctest.RandString(9)) + amzAsn := randIntRange(64512, 65534) bgpAsn := randIntRange(64512, 65534) vlan := randIntRange(2049, 4094) @@ -97,150 +183,132 @@ func TestAccAwsDxPrivateVirtualInterface_mtuUpdate(t *testing.T) { CheckDestroy: testAccCheckAwsDxPrivateVirtualInterfaceDestroy, Steps: []resource.TestStep{ { - Config: testAccDxPrivateVirtualInterfaceConfig_noTags(connectionId, vifName, bgpAsn, vlan), - Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxPrivateVirtualInterfaceExists("aws_dx_private_virtual_interface.foo"), - resource.TestCheckResourceAttr("aws_dx_private_virtual_interface.foo", "name", vifName), - resource.TestCheckResourceAttr("aws_dx_private_virtual_interface.foo", "mtu", "1500"), - resource.TestCheckResourceAttr("aws_dx_private_virtual_interface.foo", "jumbo_frame_capable", "true"), - ), - }, - { - Config: testAccDxPrivateVirtualInterfaceConfig_jumboFrames(connectionId, vifName, bgpAsn, vlan), + Config: testAccDxPrivateVirtualInterfaceConfig_dxGateway(connectionId, rName, amzAsn, bgpAsn, vlan), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxPrivateVirtualInterfaceExists("aws_dx_private_virtual_interface.foo"), - resource.TestCheckResourceAttr("aws_dx_private_virtual_interface.foo", "name", vifName), - resource.TestCheckResourceAttr("aws_dx_private_virtual_interface.foo", "mtu", "9001"), + testAccCheckAwsDxPrivateVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_address"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttrSet(resourceName, "customer_address"), + resource.TestCheckResourceAttrPair(resourceName, "dx_gateway_id", dxGatewayResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "jumbo_frame_capable", "true"), + resource.TestCheckResourceAttr(resourceName, "mtu", "1500"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), ), }, + // Test import. { - Config: testAccDxPrivateVirtualInterfaceConfig_noTags(connectionId, vifName, bgpAsn, vlan), - Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxPrivateVirtualInterfaceExists("aws_dx_private_virtual_interface.foo"), - resource.TestCheckResourceAttr("aws_dx_private_virtual_interface.foo", "name", vifName), - resource.TestCheckResourceAttr("aws_dx_private_virtual_interface.foo", "mtu", "1500"), - ), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, }, }, }) } func testAccCheckAwsDxPrivateVirtualInterfaceDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).dxconn - - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_dx_private_virtual_interface" { - continue - } - - input := &directconnect.DescribeVirtualInterfacesInput{ - VirtualInterfaceId: aws.String(rs.Primary.ID), - } - - resp, err := conn.DescribeVirtualInterfaces(input) - if err != nil { - return err - } - for _, v := range resp.VirtualInterfaces { - if *v.VirtualInterfaceId == rs.Primary.ID && !(*v.VirtualInterfaceState == directconnect.VirtualInterfaceStateDeleted) { - return fmt.Errorf("[DESTROY ERROR] Dx Private VIF (%s) not deleted", rs.Primary.ID) - } - } - } - return nil + return testAccCheckDxVirtualInterfaceDestroy(s, "aws_dx_private_virtual_interface") } -func testAccCheckAwsDxPrivateVirtualInterfaceExists(name string) resource.TestCheckFunc { - return func(s *terraform.State) error { - _, ok := s.RootModule().Resources[name] - if !ok { - return fmt.Errorf("Not found: %s", name) - } - - return nil - } +func testAccCheckAwsDxPrivateVirtualInterfaceExists(name string, vif *directconnect.VirtualInterface) resource.TestCheckFunc { + return testAccCheckDxVirtualInterfaceExists(name, vif) } -func testAccDxPrivateVirtualInterfaceConfig_noTags(cid, n string, bgpAsn, vlan int) string { +func testAccDxPrivateVirtualInterfaceConfig_vpnGateway(rName string) string { return fmt.Sprintf(` -resource "aws_vpn_gateway" "foo" { +resource "aws_vpn_gateway" "test" { tags = { - Name = "%s" + Name = %[1]q } +}`, rName) } -resource "aws_dx_private_virtual_interface" "foo" { - connection_id = "%s" - - vpn_gateway_id = "${aws_vpn_gateway.foo.id}" - name = "%s" - vlan = %d +func testAccDxPrivateVirtualInterfaceConfig_basic(cid, rName string, bgpAsn, vlan int) string { + return testAccDxPrivateVirtualInterfaceConfig_vpnGateway(rName) + fmt.Sprintf(` +resource "aws_dx_private_virtual_interface" "test" { address_family = "ipv4" - bgp_asn = %d + bgp_asn = %[3]d + connection_id = %[1]q + name = %[2]q + vlan = %[4]d + vpn_gateway_id = "${aws_vpn_gateway.test.id}" } -`, n, cid, n, vlan, bgpAsn) +`, cid, rName, bgpAsn, vlan) } -func testAccDxPrivateVirtualInterfaceConfig_tags(cid, n string, bgpAsn, vlan int) string { - return fmt.Sprintf(` -resource "aws_vpn_gateway" "foo" { - tags = { - Name = "%s" - } +func testAccDxPrivateVirtualInterfaceConfig_updated(cid, rName string, bgpAsn, vlan int) string { + return testAccDxPrivateVirtualInterfaceConfig_vpnGateway(rName) + fmt.Sprintf(` +resource "aws_dx_private_virtual_interface" "test" { + address_family = "ipv4" + bgp_asn = %[3]d + connection_id = %[1]q + mtu = 9001 + name = %[2]q + vlan = %[4]d + vpn_gateway_id = "${aws_vpn_gateway.test.id}" +} +`, cid, rName, bgpAsn, vlan) } -resource "aws_dx_private_virtual_interface" "foo" { - connection_id = "%s" - - vpn_gateway_id = "${aws_vpn_gateway.foo.id}" - name = "%s" - vlan = %d +func testAccDxPrivateVirtualInterfaceConfig_tags(cid, rName string, bgpAsn, vlan int) string { + return testAccDxPrivateVirtualInterfaceConfig_vpnGateway(rName) + fmt.Sprintf(` +resource "aws_dx_private_virtual_interface" "test" { address_family = "ipv4" - bgp_asn = %d + bgp_asn = %[3]d + connection_id = %[1]q + name = %[2]q + vlan = %[4]d + vpn_gateway_id = "${aws_vpn_gateway.test.id}" tags = { - Environment = "test" + Name = %[2]q + Key1 = "Value1" + Key2 = "Value2a" } } -`, n, cid, n, vlan, bgpAsn) +`, cid, rName, bgpAsn, vlan) } -func testAccDxPrivateVirtualInterfaceConfig_dxGateway(cid, n string, amzAsn, bgpAsn, vlan int) string { - return fmt.Sprintf(` -resource "aws_dx_gateway" "foo" { - name = "%s" - amazon_side_asn = %d -} - -resource "aws_dx_private_virtual_interface" "foo" { - connection_id = "%s" - - dx_gateway_id = "${aws_dx_gateway.foo.id}" - name = "%s" - vlan = %d +func testAccDxPrivateVirtualInterfaceConfig_tagsUpdated(cid, rName string, bgpAsn, vlan int) string { + return testAccDxPrivateVirtualInterfaceConfig_vpnGateway(rName) + fmt.Sprintf(` +resource "aws_dx_private_virtual_interface" "test" { address_family = "ipv4" - bgp_asn = %d -} -`, n, amzAsn, cid, n, vlan, bgpAsn) -} + bgp_asn = %[3]d + connection_id = %[1]q + name = %[2]q + vlan = %[4]d + vpn_gateway_id = "${aws_vpn_gateway.test.id}" -func testAccDxPrivateVirtualInterfaceConfig_jumboFrames(cid, n string, bgpAsn, vlan int) string { - return fmt.Sprintf(` -resource "aws_vpn_gateway" "foo" { tags = { - Name = "%s" + Name = %[2]q + Key2 = "Value2b" + Key3 = "Value3" } } +`, cid, rName, bgpAsn, vlan) +} -resource "aws_dx_private_virtual_interface" "foo" { - connection_id = "%s" +func testAccDxPrivateVirtualInterfaceConfig_dxGateway(cid, rName string, amzAsn, bgpAsn, vlan int) string { + return fmt.Sprintf(` +resource "aws_dx_gateway" "test" { + amazon_side_asn = %[3]d + name = %[2]q +} - vpn_gateway_id = "${aws_vpn_gateway.foo.id}" - name = "%s" - vlan = %d +resource "aws_dx_private_virtual_interface" "test" { address_family = "ipv4" - bgp_asn = %d - mtu = 9001 + bgp_asn = %[4]d + dx_gateway_id = "${aws_dx_gateway.test.id}" + connection_id = %[1]q + name = %[2]q + vlan = %[5]d } -`, n, cid, n, vlan, bgpAsn) +`, cid, rName, amzAsn, bgpAsn, vlan) } diff --git a/aws/resource_aws_dx_public_virtual_interface.go b/aws/resource_aws_dx_public_virtual_interface.go index b65c5113c36..0df67b4db8c 100644 --- a/aws/resource_aws_dx_public_virtual_interface.go +++ b/aws/resource_aws_dx_public_virtual_interface.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "strconv" "time" "github.com/aws/aws-sdk-go/aws" @@ -10,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/directconnect" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDxPublicVirtualInterface() *schema.Resource { @@ -24,25 +26,32 @@ func resourceAwsDxPublicVirtualInterface() *schema.Resource { CustomizeDiff: resourceAwsDxPublicVirtualInterfaceCustomizeDiff, Schema: map[string]*schema.Schema{ - "arn": { - Type: schema.TypeString, - Computed: true, - }, - "connection_id": { + "address_family": { Type: schema.TypeString, Required: true, ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + directconnect.AddressFamilyIpv4, + directconnect.AddressFamilyIpv6, + }, false), }, - "name": { + "amazon_address": { Type: schema.TypeString, - Required: true, + Optional: true, + Computed: true, ForceNew: true, }, - "vlan": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, - ValidateFunc: validation.IntBetween(1, 4094), + "amazon_side_asn": { + Type: schema.TypeString, + Computed: true, + }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "aws_device": { + Type: schema.TypeString, + Computed: true, }, "bgp_asn": { Type: schema.TypeInt, @@ -55,11 +64,10 @@ func resourceAwsDxPublicVirtualInterface() *schema.Resource { Computed: true, ForceNew: true, }, - "address_family": { - Type: schema.TypeString, - Required: true, - ForceNew: true, - ValidateFunc: validation.StringInSlice([]string{directconnect.AddressFamilyIpv4, directconnect.AddressFamilyIpv6}, false), + "connection_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, }, "customer_address": { Type: schema.TypeString, @@ -67,10 +75,9 @@ func resourceAwsDxPublicVirtualInterface() *schema.Resource { Computed: true, ForceNew: true, }, - "amazon_address": { + "name": { Type: schema.TypeString, - Optional: true, - Computed: true, + Required: true, ForceNew: true, }, "route_filter_prefixes": { @@ -81,9 +88,11 @@ func resourceAwsDxPublicVirtualInterface() *schema.Resource { MinItems: 1, }, "tags": tagsSchema(), - "aws_device": { - Type: schema.TypeString, - Computed: true, + "vlan": { + Type: schema.TypeInt, + Required: true, + ForceNew: true, + ValidateFunc: validation.IntBetween(1, 4094), }, }, @@ -100,46 +109,41 @@ func resourceAwsDxPublicVirtualInterfaceCreate(d *schema.ResourceData, meta inte req := &directconnect.CreatePublicVirtualInterfaceInput{ ConnectionId: aws.String(d.Get("connection_id").(string)), NewPublicVirtualInterface: &directconnect.NewPublicVirtualInterface{ + AddressFamily: aws.String(d.Get("address_family").(string)), + Asn: aws.Int64(int64(d.Get("bgp_asn").(int))), VirtualInterfaceName: aws.String(d.Get("name").(string)), Vlan: aws.Int64(int64(d.Get("vlan").(int))), - Asn: aws.Int64(int64(d.Get("bgp_asn").(int))), - AddressFamily: aws.String(d.Get("address_family").(string)), }, } + if v, ok := d.GetOk("amazon_address"); ok && v.(string) != "" { + req.NewPublicVirtualInterface.AmazonAddress = aws.String(v.(string)) + } if v, ok := d.GetOk("bgp_auth_key"); ok && v.(string) != "" { req.NewPublicVirtualInterface.AuthKey = aws.String(v.(string)) } if v, ok := d.GetOk("customer_address"); ok && v.(string) != "" { req.NewPublicVirtualInterface.CustomerAddress = aws.String(v.(string)) } - if v, ok := d.GetOk("amazon_address"); ok && v.(string) != "" { - req.NewPublicVirtualInterface.AmazonAddress = aws.String(v.(string)) - } if v, ok := d.GetOk("route_filter_prefixes"); ok { req.NewPublicVirtualInterface.RouteFilterPrefixes = expandDxRouteFilterPrefixes(v.(*schema.Set)) } + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + req.NewPublicVirtualInterface.Tags = keyvaluetags.New(v).IgnoreAws().DirectconnectTags() + } - log.Printf("[DEBUG] Creating Direct Connect public virtual interface: %#v", req) + log.Printf("[DEBUG] Creating Direct Connect public virtual interface: %s", req) resp, err := conn.CreatePublicVirtualInterface(req) if err != nil { - return fmt.Errorf("Error creating Direct Connect public virtual interface: %s", err) + return fmt.Errorf("error creating Direct Connect public virtual interface: %s", err) } d.SetId(aws.StringValue(resp.VirtualInterfaceId)) - arn := arn.ARN{ - Partition: meta.(*AWSClient).partition, - Region: meta.(*AWSClient).region, - Service: "directconnect", - AccountID: meta.(*AWSClient).accountid, - Resource: fmt.Sprintf("dxvif/%s", d.Id()), - }.String() - d.Set("arn", arn) if err := dxPublicVirtualInterfaceWaitUntilAvailable(conn, d.Id(), d.Timeout(schema.TimeoutCreate)); err != nil { return err } - return resourceAwsDxPublicVirtualInterfaceUpdate(d, meta) + return resourceAwsDxPublicVirtualInterfaceRead(d, meta) } func resourceAwsDxPublicVirtualInterfaceRead(d *schema.ResourceData, meta interface{}) error { @@ -155,18 +159,39 @@ func resourceAwsDxPublicVirtualInterfaceRead(d *schema.ResourceData, meta interf return nil } - d.Set("connection_id", vif.ConnectionId) - d.Set("name", vif.VirtualInterfaceName) - d.Set("vlan", vif.Vlan) - d.Set("bgp_asn", vif.Asn) - d.Set("bgp_auth_key", vif.AuthKey) d.Set("address_family", vif.AddressFamily) - d.Set("customer_address", vif.CustomerAddress) d.Set("amazon_address", vif.AmazonAddress) - d.Set("route_filter_prefixes", flattenDxRouteFilterPrefixes(vif.RouteFilterPrefixes)) + d.Set("amazon_side_asn", strconv.FormatInt(aws.Int64Value(vif.AmazonSideAsn), 10)) + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Region: meta.(*AWSClient).region, + Service: "directconnect", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("dxvif/%s", d.Id()), + }.String() + d.Set("arn", arn) d.Set("aws_device", vif.AwsDeviceV2) - err1 := getTagsDX(conn, d, d.Get("arn").(string)) - return err1 + d.Set("bgp_asn", vif.Asn) + d.Set("bgp_auth_key", vif.AuthKey) + d.Set("customer_address", vif.CustomerAddress) + d.Set("connection_id", vif.ConnectionId) + d.Set("name", vif.VirtualInterfaceName) + if err := d.Set("route_filter_prefixes", flattenDxRouteFilterPrefixes(vif.RouteFilterPrefixes)); err != nil { + return fmt.Errorf("error setting route_filter_prefixes: %s", err) + } + d.Set("vlan", vif.Vlan) + + tags, err := keyvaluetags.DirectconnectListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for Direct Connect public virtual interface (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + return nil } func resourceAwsDxPublicVirtualInterfaceUpdate(d *schema.ResourceData, meta interface{}) error { @@ -182,14 +207,19 @@ func resourceAwsDxPublicVirtualInterfaceDelete(d *schema.ResourceData, meta inte } func resourceAwsDxPublicVirtualInterfaceImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - arn := arn.ARN{ - Partition: meta.(*AWSClient).partition, - Region: meta.(*AWSClient).region, - Service: "directconnect", - AccountID: meta.(*AWSClient).accountid, - Resource: fmt.Sprintf("dxvif/%s", d.Id()), - }.String() - d.Set("arn", arn) + conn := meta.(*AWSClient).dxconn + + vif, err := dxVirtualInterfaceRead(d.Id(), conn) + if err != nil { + return nil, err + } + if vif == nil { + return nil, fmt.Errorf("virtual interface (%s) not found", d.Id()) + } + + if vifType := aws.StringValue(vif.VirtualInterfaceType); vifType != "public" { + return nil, fmt.Errorf("virtual interface (%s) has incorrect type: %s", d.Id(), vifType) + } return []*schema.ResourceData{d}, nil } diff --git a/aws/resource_aws_dx_public_virtual_interface_test.go b/aws/resource_aws_dx_public_virtual_interface_test.go index 48096a954c1..6f3dd0b7af0 100644 --- a/aws/resource_aws_dx_public_virtual_interface_test.go +++ b/aws/resource_aws_dx_public_virtual_interface_test.go @@ -3,6 +3,8 @@ package aws import ( "fmt" "os" + "regexp" + "strconv" "testing" "github.com/aws/aws-sdk-go/aws" @@ -18,7 +20,16 @@ func TestAccAwsDxPublicVirtualInterface_basic(t *testing.T) { if connectionId == "" { t.Skipf("Environment variable %s is not set", key) } - vifName := fmt.Sprintf("terraform-testacc-dxvif-%s", acctest.RandString(5)) + + var vif directconnect.VirtualInterface + resourceName := "aws_dx_public_virtual_interface.test" + rName := fmt.Sprintf("tf-testacc-public-vif-%s", acctest.RandString(10)) + // DirectConnectClientException: Amazon Address is not allowed to contain a private IP + // DirectConnectClientException: Amazon Address and Customer Address must be in the same CIDR + // DirectConnectClientException: Amazon Address is address 0 on its subnet. + // DirectConnectClientException: Amazon Address is the broadcast address on its subnet. + amazonAddress := "175.45.176.1/28" + customerAddress := "175.45.176.2/28" bgpAsn := randIntRange(64512, 65534) vlan := randIntRange(2049, 4094) @@ -28,25 +39,107 @@ func TestAccAwsDxPublicVirtualInterface_basic(t *testing.T) { CheckDestroy: testAccCheckAwsDxPublicVirtualInterfaceDestroy, Steps: []resource.TestStep{ { - Config: testAccDxPublicVirtualInterfaceConfig_noTags(connectionId, vifName, bgpAsn, vlan), + Config: testAccDxPublicVirtualInterfaceConfig_basic(connectionId, rName, amazonAddress, customerAddress, bgpAsn, vlan), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxPublicVirtualInterfaceExists("aws_dx_public_virtual_interface.foo"), - resource.TestCheckResourceAttr("aws_dx_public_virtual_interface.foo", "name", vifName), - resource.TestCheckResourceAttr("aws_dx_public_virtual_interface.foo", "tags.%", "0"), + testAccCheckAwsDxPublicVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttr(resourceName, "amazon_address", amazonAddress), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttr(resourceName, "customer_address", customerAddress), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.#", "2"), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.1752038751", "210.52.109.0/24"), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.4290081960", "175.45.176.0/22"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), ), }, + // Test import. + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAwsDxPublicVirtualInterface_Tags(t *testing.T) { + key := "DX_CONNECTION_ID" + connectionId := os.Getenv(key) + if connectionId == "" { + t.Skipf("Environment variable %s is not set", key) + } + + var vif directconnect.VirtualInterface + resourceName := "aws_dx_public_virtual_interface.test" + rName := fmt.Sprintf("tf-testacc-public-vif-%s", acctest.RandString(10)) + amazonAddress := "175.45.176.3/28" + customerAddress := "175.45.176.4/28" + bgpAsn := randIntRange(64512, 65534) + vlan := randIntRange(2049, 4094) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsDxPublicVirtualInterfaceDestroy, + Steps: []resource.TestStep{ { - Config: testAccDxPublicVirtualInterfaceConfig_tags(connectionId, vifName, bgpAsn, vlan), + Config: testAccDxPublicVirtualInterfaceConfig_tags(connectionId, rName, amazonAddress, customerAddress, bgpAsn, vlan), Check: resource.ComposeTestCheckFunc( - testAccCheckAwsDxPublicVirtualInterfaceExists("aws_dx_public_virtual_interface.foo"), - resource.TestCheckResourceAttr("aws_dx_public_virtual_interface.foo", "name", vifName), - resource.TestCheckResourceAttr("aws_dx_public_virtual_interface.foo", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_dx_public_virtual_interface.foo", "tags.Environment", "test"), + testAccCheckAwsDxPublicVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttr(resourceName, "amazon_address", amazonAddress), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttr(resourceName, "customer_address", customerAddress), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.#", "2"), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.1752038751", "210.52.109.0/24"), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.4290081960", "175.45.176.0/22"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), + resource.TestCheckResourceAttr(resourceName, "tags.Key1", "Value1"), + resource.TestCheckResourceAttr(resourceName, "tags.Key2", "Value2a"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), + ), + }, + { + Config: testAccDxPublicVirtualInterfaceConfig_tagsUpdated(connectionId, rName, amazonAddress, customerAddress, bgpAsn, vlan), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsDxPublicVirtualInterfaceExists(resourceName, &vif), + resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), + resource.TestCheckResourceAttr(resourceName, "amazon_address", amazonAddress), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), + resource.TestCheckResourceAttrSet(resourceName, "aws_device"), + resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), + resource.TestCheckResourceAttrSet(resourceName, "bgp_auth_key"), + resource.TestCheckResourceAttr(resourceName, "connection_id", connectionId), + resource.TestCheckResourceAttr(resourceName, "customer_address", customerAddress), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.#", "2"), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.1752038751", "210.52.109.0/24"), + resource.TestCheckResourceAttr(resourceName, "route_filter_prefixes.4290081960", "175.45.176.0/22"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), + resource.TestCheckResourceAttr(resourceName, "tags.Key2", "Value2b"), + resource.TestCheckResourceAttr(resourceName, "tags.Key3", "Value3"), + resource.TestCheckResourceAttr(resourceName, "vlan", strconv.Itoa(vlan)), ), }, // Test import. { - ResourceName: "aws_dx_public_virtual_interface.foo", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -55,83 +148,78 @@ func TestAccAwsDxPublicVirtualInterface_basic(t *testing.T) { } func testAccCheckAwsDxPublicVirtualInterfaceDestroy(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).dxconn - - for _, rs := range s.RootModule().Resources { - if rs.Type != "aws_dx_public_virtual_interface" { - continue - } - - input := &directconnect.DescribeVirtualInterfacesInput{ - VirtualInterfaceId: aws.String(rs.Primary.ID), - } - - resp, err := conn.DescribeVirtualInterfaces(input) - if err != nil { - return err - } - for _, v := range resp.VirtualInterfaces { - if *v.VirtualInterfaceId == rs.Primary.ID && !(*v.VirtualInterfaceState == directconnect.VirtualInterfaceStateDeleted) { - return fmt.Errorf("[DESTROY ERROR] Dx Public VIF (%s) not deleted", rs.Primary.ID) - } - } - } - return nil + return testAccCheckDxVirtualInterfaceDestroy(s, "aws_dx_public_virtual_interface") } -func testAccCheckAwsDxPublicVirtualInterfaceExists(name string) resource.TestCheckFunc { - return func(s *terraform.State) error { - _, ok := s.RootModule().Resources[name] - if !ok { - return fmt.Errorf("Not found: %s", name) - } - - return nil - } +func testAccCheckAwsDxPublicVirtualInterfaceExists(name string, vif *directconnect.VirtualInterface) resource.TestCheckFunc { + return testAccCheckDxVirtualInterfaceExists(name, vif) } -func testAccDxPublicVirtualInterfaceConfig_noTags(cid, n string, bgpAsn, vlan int) string { +func testAccDxPublicVirtualInterfaceConfig_basic(cid, rName, amzAddr, custAddr string, bgpAsn, vlan int) string { return fmt.Sprintf(` -resource "aws_dx_public_virtual_interface" "foo" { - connection_id = "%s" - - name = "%s" - vlan = %d - address_family = "ipv4" - bgp_asn = %d - - customer_address = "175.45.176.1/30" - amazon_address = "175.45.176.2/30" +resource "aws_dx_public_virtual_interface" "test" { + address_family = "ipv4" + amazon_address = %[3]q + bgp_asn = %[5]d + connection_id = %[1]q + customer_address = %[4]q + name = %[2]q + vlan = %[6]d route_filter_prefixes = [ - "210.52.109.0/24", "175.45.176.0/22", + "210.52.109.0/24", ] } -`, cid, n, vlan, bgpAsn) +`, cid, rName, amzAddr, custAddr, bgpAsn, vlan) } -func testAccDxPublicVirtualInterfaceConfig_tags(cid, n string, bgpAsn, vlan int) string { +func testAccDxPublicVirtualInterfaceConfig_tags(cid, rName, amzAddr, custAddr string, bgpAsn, vlan int) string { return fmt.Sprintf(` -resource "aws_dx_public_virtual_interface" "foo" { - connection_id = "%s" +resource "aws_dx_public_virtual_interface" "test" { + address_family = "ipv4" + amazon_address = %[3]q + bgp_asn = %[5]d + connection_id = %[1]q + customer_address = %[4]q + name = %[2]q + vlan = %[6]d - name = "%s" - vlan = %d - address_family = "ipv4" - bgp_asn = %d + route_filter_prefixes = [ + "175.45.176.0/22", + "210.52.109.0/24", + ] - customer_address = "175.45.176.1/30" - amazon_address = "175.45.176.2/30" + tags = { + Name = %[2]q + Key1 = "Value1" + Key2 = "Value2a" + } +} +`, cid, rName, amzAddr, custAddr, bgpAsn, vlan) +} + +func testAccDxPublicVirtualInterfaceConfig_tagsUpdated(cid, rName, amzAddr, custAddr string, bgpAsn, vlan int) string { + return fmt.Sprintf(` +resource "aws_dx_public_virtual_interface" "test" { + address_family = "ipv4" + amazon_address = %[3]q + bgp_asn = %[5]d + connection_id = %[1]q + customer_address = %[4]q + name = %[2]q + vlan = %[6]d route_filter_prefixes = [ - "210.52.109.0/24", "175.45.176.0/22", + "210.52.109.0/24", ] tags = { - Environment = "test" + Name = %[2]q + Key2 = "Value2b" + Key3 = "Value3" } } -`, cid, n, vlan, bgpAsn) +`, cid, rName, amzAddr, custAddr, bgpAsn, vlan) } diff --git a/aws/resource_aws_dx_transit_virtual_interface.go b/aws/resource_aws_dx_transit_virtual_interface.go index 24c2262d763..c28817d2b85 100644 --- a/aws/resource_aws_dx_transit_virtual_interface.go +++ b/aws/resource_aws_dx_transit_virtual_interface.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "strconv" "time" "github.com/aws/aws-sdk-go/aws" @@ -10,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/directconnect" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDxTransitVirtualInterface() *schema.Resource { @@ -38,6 +40,10 @@ func resourceAwsDxTransitVirtualInterface() *schema.Resource { Computed: true, ForceNew: true, }, + "amazon_side_asn": { + Type: schema.TypeString, + Computed: true, + }, "arn": { Type: schema.TypeString, Computed: true, @@ -128,8 +134,8 @@ func resourceAwsDxTransitVirtualInterfaceCreate(d *schema.ResourceData, meta int if v, ok := d.GetOk("customer_address"); ok && v.(string) != "" { req.NewTransitVirtualInterface.CustomerAddress = aws.String(v.(string)) } - if v, ok := d.GetOk("tags"); ok { - req.NewTransitVirtualInterface.Tags = tagsFromMapDX(v.(map[string]interface{})) + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + req.NewTransitVirtualInterface.Tags = keyvaluetags.New(v).IgnoreAws().DirectconnectTags() } log.Printf("[DEBUG] Creating Direct Connect transit virtual interface: %s", req) @@ -162,6 +168,7 @@ func resourceAwsDxTransitVirtualInterfaceRead(d *schema.ResourceData, meta inter d.Set("address_family", vif.AddressFamily) d.Set("amazon_address", vif.AmazonAddress) + d.Set("amazon_side_asn", strconv.FormatInt(aws.Int64Value(vif.AmazonSideAsn), 10)) arn := arn.ARN{ Partition: meta.(*AWSClient).partition, Region: meta.(*AWSClient).region, @@ -180,8 +187,15 @@ func resourceAwsDxTransitVirtualInterfaceRead(d *schema.ResourceData, meta inter d.Set("mtu", vif.Mtu) d.Set("name", vif.VirtualInterfaceName) d.Set("vlan", vif.Vlan) - if err := getTagsDX(conn, d, d.Get("arn").(string)); err != nil { - return fmt.Errorf("error getting Direct Connect transit virtual interface (%s) tags: %s", d.Id(), err) + + tags, err := keyvaluetags.DirectconnectListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for Direct Connect transit virtual interface (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil diff --git a/aws/resource_aws_dx_transit_virtual_interface_test.go b/aws/resource_aws_dx_transit_virtual_interface_test.go index 54aab557aa9..33ad9010f2e 100644 --- a/aws/resource_aws_dx_transit_virtual_interface_test.go +++ b/aws/resource_aws_dx_transit_virtual_interface_test.go @@ -54,6 +54,7 @@ func testAccAwsDxTransitVirtualInterface_basic(t *testing.T) { testAccCheckAwsDxTransitVirtualInterfaceExists(resourceName, &vif), resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), resource.TestCheckResourceAttrSet(resourceName, "amazon_address"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), resource.TestCheckResourceAttrSet(resourceName, "aws_device"), resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), @@ -74,6 +75,7 @@ func testAccAwsDxTransitVirtualInterface_basic(t *testing.T) { testAccCheckAwsDxTransitVirtualInterfaceExists(resourceName, &vif), resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), resource.TestCheckResourceAttrSet(resourceName, "amazon_address"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), resource.TestCheckResourceAttrSet(resourceName, "aws_device"), resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), @@ -124,6 +126,7 @@ func testAccAwsDxTransitVirtualInterface_Tags(t *testing.T) { testAccCheckAwsDxTransitVirtualInterfaceExists(resourceName, &vif), resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), resource.TestCheckResourceAttrSet(resourceName, "amazon_address"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), resource.TestCheckResourceAttrSet(resourceName, "aws_device"), resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), @@ -147,6 +150,7 @@ func testAccAwsDxTransitVirtualInterface_Tags(t *testing.T) { testAccCheckAwsDxTransitVirtualInterfaceExists(resourceName, &vif), resource.TestCheckResourceAttr(resourceName, "address_family", "ipv4"), resource.TestCheckResourceAttrSet(resourceName, "amazon_address"), + resource.TestCheckResourceAttrSet(resourceName, "amazon_side_asn"), testAccMatchResourceAttrRegionalARN(resourceName, "arn", "directconnect", regexp.MustCompile(fmt.Sprintf("dxvif/%s", aws.StringValue(vif.VirtualInterfaceId)))), resource.TestCheckResourceAttrSet(resourceName, "aws_device"), resource.TestCheckResourceAttr(resourceName, "bgp_asn", strconv.Itoa(bgpAsn)), diff --git a/aws/resource_aws_dynamodb_global_table_test.go b/aws/resource_aws_dynamodb_global_table_test.go index c0596bdc3dd..185adf46c5b 100644 --- a/aws/resource_aws_dynamodb_global_table_test.go +++ b/aws/resource_aws_dynamodb_global_table_test.go @@ -43,6 +43,11 @@ func TestAccAWSDynamoDbGlobalTable_basic(t *testing.T) { regexp.MustCompile("^arn:aws:dynamodb::[0-9]{12}:global-table/[a-z0-9-]+$")), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -67,6 +72,11 @@ func TestAccAWSDynamoDbGlobalTable_multipleRegions(t *testing.T) { regexp.MustCompile("^arn:aws:dynamodb::[0-9]{12}:global-table/[a-z0-9-]+$")), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccDynamoDbGlobalTableConfig_multipleRegions2(tableName), Check: resource.ComposeTestCheckFunc( @@ -89,28 +99,6 @@ func TestAccAWSDynamoDbGlobalTable_multipleRegions(t *testing.T) { }) } -func TestAccAWSDynamoDbGlobalTable_import(t *testing.T) { - resourceName := "aws_dynamodb_global_table.test" - tableName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSDynamodbGlobalTable(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckSesTemplateDestroy, - Steps: []resource.TestStep{ - { - Config: testAccDynamoDbGlobalTableConfig_basic(tableName), - }, - - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func testAccCheckAwsDynamoDbGlobalTableDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).dynamodbconn diff --git a/aws/resource_aws_dynamodb_table.go b/aws/resource_aws_dynamodb_table.go index f34d571e6e3..83e71b6b9a3 100644 --- a/aws/resource_aws_dynamodb_table.go +++ b/aws/resource_aws_dynamodb_table.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsDynamoDbTable() *schema.Resource { @@ -253,7 +254,12 @@ func resourceAwsDynamoDbTable() *schema.Resource { "enabled": { Type: schema.TypeBool, Required: true, - ForceNew: true, + }, + "kms_key_arn": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validateArn, }, }, }, @@ -289,7 +295,7 @@ func resourceAwsDynamoDbTableCreate(d *schema.ResourceData, meta interface{}) er log.Printf("[DEBUG] Creating DynamoDB table with key schema: %#v", keySchemaMap) - tags := tagsFromMapDynamoDb(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().DynamodbTags() req := &dynamodb.CreateTableInput{ TableName: aws.String(d.Get("name").(string)), @@ -344,13 +350,7 @@ func resourceAwsDynamoDbTableCreate(d *schema.ResourceData, meta interface{}) er } if v, ok := d.GetOk("server_side_encryption"); ok { - options := v.([]interface{}) - if options[0] == nil { - return fmt.Errorf("At least one field is expected inside server_side_encryption") - } - - s := options[0].(map[string]interface{}) - req.SSESpecification = expandDynamoDbEncryptAtRestOptions(s) + req.SSESpecification = expandDynamoDbEncryptAtRestOptions(v.([]interface{})) } var output *dynamodb.CreateTableOutput @@ -401,7 +401,7 @@ func resourceAwsDynamoDbTableCreate(d *schema.ResourceData, meta interface{}) er } if requiresTagging { - if err := setTagsDynamoDb(conn, d); err != nil { + if err := keyvaluetags.DynamodbUpdateTags(conn, d.Get("arn").(string), nil, tags); err != nil { return fmt.Errorf("error adding DynamoDB Table (%s) tags: %s", d.Id(), err) } } @@ -561,6 +561,21 @@ func resourceAwsDynamoDbTableUpdate(d *schema.ResourceData, meta interface{}) er } } + if d.HasChange("server_side_encryption") { + // "ValidationException: One or more parameter values were invalid: Server-Side Encryption modification must be the only operation in the request". + _, err := conn.UpdateTable(&dynamodb.UpdateTableInput{ + TableName: aws.String(d.Id()), + SSESpecification: expandDynamoDbEncryptAtRestOptions(d.Get("server_side_encryption").([]interface{})), + }) + if err != nil { + return fmt.Errorf("error updating DynamoDB Table (%s) SSE: %s", d.Id(), err) + } + + if err := waitForDynamoDbSSEUpdateToBeCompleted(d.Id(), d.Timeout(schema.TimeoutUpdate), conn); err != nil { + return fmt.Errorf("error waiting for DynamoDB Table (%s) SSE update: %s", d.Id(), err) + } + } + if d.HasChange("ttl") { if err := updateDynamoDbTimeToLive(d.Id(), d.Get("ttl").([]interface{}), conn); err != nil { return fmt.Errorf("error updating DynamoDB Table (%s) time to live: %s", d.Id(), err) @@ -568,7 +583,8 @@ func resourceAwsDynamoDbTableUpdate(d *schema.ResourceData, meta interface{}) er } if d.HasChange("tags") { - if err := setTagsDynamoDb(conn, d); err != nil { + o, n := d.GetChange("tags") + if err := keyvaluetags.DynamodbUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { return fmt.Errorf("error updating DynamoDB Table (%s) tags: %s", d.Id(), err) } } @@ -617,6 +633,7 @@ func resourceAwsDynamoDbTableRead(d *schema.ResourceData, meta interface{}) erro if err != nil { return err } + d.Set("tags", tags) pitrOut, err := conn.DescribeContinuousBackups(&dynamodb.DescribeContinuousBackupsInput{ @@ -677,13 +694,12 @@ func deleteAwsDynamoDbTable(tableName string, conn *dynamodb.DynamoDB) error { } return nil }) + if isResourceTimeoutError(err) { _, err = conn.DeleteTable(input) } - if err != nil { - return fmt.Errorf("Error deleting DynamoDB table: %s", err) - } - return nil + + return err } func waitForDynamodbTableDeletion(conn *dynamodb.DynamoDB, tableName string, timeout time.Duration) error { @@ -793,7 +809,7 @@ func readDynamoDbTableTags(arn string, conn *dynamodb.DynamoDB) (map[string]stri return nil, fmt.Errorf("Error reading tags from dynamodb resource: %s", err) } - result := tagsToMapDynamoDb(output.Tags) + result := keyvaluetags.DynamodbKeyValueTags(output.Tags).IgnoreAws().Map() // TODO Read NextToken if available @@ -969,6 +985,38 @@ func waitForDynamoDbTtlUpdateToBeCompleted(tableName string, toEnable bool, conn return err } +func waitForDynamoDbSSEUpdateToBeCompleted(tableName string, timeout time.Duration, conn *dynamodb.DynamoDB) error { + stateConf := &resource.StateChangeConf{ + Pending: []string{ + dynamodb.SSEStatusDisabling, + dynamodb.SSEStatusEnabling, + dynamodb.SSEStatusUpdating, + }, + Target: []string{ + dynamodb.SSEStatusDisabled, + dynamodb.SSEStatusEnabled, + }, + Timeout: timeout, + Refresh: func() (interface{}, string, error) { + result, err := conn.DescribeTable(&dynamodb.DescribeTableInput{ + TableName: aws.String(tableName), + }) + if err != nil { + return 42, "", err + } + + // Disabling SSE returns null SSEDescription. + if result.Table.SSEDescription == nil { + return result, dynamodb.SSEStatusDisabled, nil + } + return result, aws.StringValue(result.Table.SSEDescription.Status), nil + }, + } + _, err := stateConf.WaitForState() + + return err +} + func isDynamoDbTableOptionDisabled(v interface{}) bool { options := v.([]interface{}) if len(options) == 0 { diff --git a/aws/resource_aws_dynamodb_table_test.go b/aws/resource_aws_dynamodb_table_test.go index 6f1992a900e..21b37ad009e 100644 --- a/aws/resource_aws_dynamodb_table_test.go +++ b/aws/resource_aws_dynamodb_table_test.go @@ -319,52 +319,9 @@ func TestDiffDynamoDbGSI(t *testing.T) { } } -func TestAccAWSDynamoDbTable_importBasic(t *testing.T) { - resourceName := "aws_dynamodb_table.basic-dynamodb-table" - - rName := acctest.RandomWithPrefix("TerraformTestTable-") - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSDynamoDbConfigInitialState(rName), - }, - - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - -func TestAccAWSDynamoDbTable_importTags(t *testing.T) { - resourceName := "aws_dynamodb_table.basic-dynamodb-table" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSDynamoDbConfigTags(), - }, - - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func TestAccAWSDynamoDbTable_basic(t *testing.T) { var conf dynamodb.DescribeTableOutput - + resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix("TerraformTestTable-") resource.ParallelTest(t, resource.TestCase{ @@ -375,22 +332,28 @@ func TestAccAWSDynamoDbTable_basic(t *testing.T) { { Config: testAccAWSDynamoDbConfig_basic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.basic-dynamodb-table", &conf), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "name", rName), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "write_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "hash_key", "TestTableHashKey"), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "attribute.2990477658.name", "TestTableHashKey"), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "attribute.2990477658.type", "S"), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "write_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "hash_key", "TestTableHashKey"), + resource.TestCheckResourceAttr(resourceName, "attribute.2990477658.name", "TestTableHashKey"), + resource.TestCheckResourceAttr(resourceName, "attribute.2990477658.type", "S"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSDynamoDbTable_disappears(t *testing.T) { var table1 dynamodb.DescribeTableOutput - resourceName := "aws_dynamodb_table.basic-dynamodb-table" + resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix("TerraformTestTable-") resource.ParallelTest(t, resource.TestCase{ @@ -412,7 +375,7 @@ func TestAccAWSDynamoDbTable_disappears(t *testing.T) { func TestAccAWSDynamoDbTable_disappears_PayPerRequestWithGSI(t *testing.T) { var table1, table2 dynamodb.DescribeTableOutput - resourceName := "aws_dynamodb_table.basic-dynamodb-table" + resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix("TerraformTestTable-") resource.ParallelTest(t, resource.TestCase{ @@ -434,13 +397,18 @@ func TestAccAWSDynamoDbTable_disappears_PayPerRequestWithGSI(t *testing.T) { testAccCheckInitialAWSDynamoDbTableExists(resourceName, &table2), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSDynamoDbTable_extended(t *testing.T) { var conf dynamodb.DescribeTableOutput - + resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix("TerraformTestTable-") resource.ParallelTest(t, resource.TestCase{ @@ -451,14 +419,19 @@ func TestAccAWSDynamoDbTable_extended(t *testing.T) { { Config: testAccAWSDynamoDbConfigInitialState(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.basic-dynamodb-table", &conf), - testAccCheckInitialAWSDynamoDbTableConf("aws_dynamodb_table.basic-dynamodb-table"), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), + testAccCheckInitialAWSDynamoDbTableConf(resourceName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSDynamoDbConfigAddSecondaryGSI(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckDynamoDbTableWasUpdated("aws_dynamodb_table.basic-dynamodb-table"), + testAccCheckDynamoDbTableWasUpdated(resourceName), ), }, }, @@ -467,7 +440,7 @@ func TestAccAWSDynamoDbTable_extended(t *testing.T) { func TestAccAWSDynamoDbTable_enablePitr(t *testing.T) { var conf dynamodb.DescribeTableOutput - + resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix("TerraformTestTable-") resource.ParallelTest(t, resource.TestCase{ @@ -478,16 +451,21 @@ func TestAccAWSDynamoDbTable_enablePitr(t *testing.T) { { Config: testAccAWSDynamoDbConfigInitialState(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.basic-dynamodb-table", &conf), - testAccCheckInitialAWSDynamoDbTableConf("aws_dynamodb_table.basic-dynamodb-table"), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), + testAccCheckInitialAWSDynamoDbTableConf(resourceName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSDynamoDbConfig_backup(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckDynamoDbTableHasPointInTimeRecoveryEnabled("aws_dynamodb_table.basic-dynamodb-table"), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "point_in_time_recovery.#", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "point_in_time_recovery.0.enabled", "true"), + testAccCheckDynamoDbTableHasPointInTimeRecoveryEnabled(resourceName), + resource.TestCheckResourceAttr(resourceName, "point_in_time_recovery.#", "1"), + resource.TestCheckResourceAttr(resourceName, "point_in_time_recovery.0.enabled", "true"), ), }, }, @@ -495,6 +473,7 @@ func TestAccAWSDynamoDbTable_enablePitr(t *testing.T) { } func TestAccAWSDynamoDbTable_BillingMode_PayPerRequestToProvisioned(t *testing.T) { + resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix("TerraformTestTable-") resource.ParallelTest(t, resource.TestCase{ @@ -505,13 +484,18 @@ func TestAccAWSDynamoDbTable_BillingMode_PayPerRequestToProvisioned(t *testing.T { Config: testAccAWSDynamoDbBilling_PayPerRequest(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckDynamoDbTableHasBilling_PayPerRequest("aws_dynamodb_table.basic-dynamodb-table"), + testAccCheckDynamoDbTableHasBilling_PayPerRequest(resourceName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSDynamoDbBilling_Provisioned(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckDynamoDbTableHasBilling_Provisioned("aws_dynamodb_table.basic-dynamodb-table"), + testAccCheckDynamoDbTableHasBilling_Provisioned(resourceName), ), }, }, @@ -519,6 +503,7 @@ func TestAccAWSDynamoDbTable_BillingMode_PayPerRequestToProvisioned(t *testing.T } func TestAccAWSDynamoDbTable_BillingMode_ProvisionedToPayPerRequest(t *testing.T) { + resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix("TerraformTestTable-") resource.ParallelTest(t, resource.TestCase{ @@ -529,13 +514,18 @@ func TestAccAWSDynamoDbTable_BillingMode_ProvisionedToPayPerRequest(t *testing.T { Config: testAccAWSDynamoDbBilling_Provisioned(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckDynamoDbTableHasBilling_Provisioned("aws_dynamodb_table.basic-dynamodb-table"), + testAccCheckDynamoDbTableHasBilling_Provisioned(resourceName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSDynamoDbBilling_PayPerRequest(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckDynamoDbTableHasBilling_PayPerRequest("aws_dynamodb_table.basic-dynamodb-table"), + testAccCheckDynamoDbTableHasBilling_PayPerRequest(resourceName), ), }, }, @@ -543,6 +533,7 @@ func TestAccAWSDynamoDbTable_BillingMode_ProvisionedToPayPerRequest(t *testing.T } func TestAccAWSDynamoDbTable_BillingMode_GSI_PayPerRequestToProvisioned(t *testing.T) { + resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix("TerraformTestTable-") resource.ParallelTest(t, resource.TestCase{ @@ -553,13 +544,18 @@ func TestAccAWSDynamoDbTable_BillingMode_GSI_PayPerRequestToProvisioned(t *testi { Config: testAccAWSDynamoDbBilling_PayPerRequestWithGSI(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckDynamoDbTableHasBilling_PayPerRequest("aws_dynamodb_table.basic-dynamodb-table"), + testAccCheckDynamoDbTableHasBilling_PayPerRequest(resourceName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSDynamoDbBilling_ProvisionedWithGSI(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckDynamoDbTableHasBilling_Provisioned("aws_dynamodb_table.basic-dynamodb-table"), + testAccCheckDynamoDbTableHasBilling_Provisioned(resourceName), ), }, }, @@ -567,6 +563,7 @@ func TestAccAWSDynamoDbTable_BillingMode_GSI_PayPerRequestToProvisioned(t *testi } func TestAccAWSDynamoDbTable_BillingMode_GSI_ProvisionedToPayPerRequest(t *testing.T) { + resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix("TerraformTestTable-") resource.ParallelTest(t, resource.TestCase{ @@ -577,13 +574,18 @@ func TestAccAWSDynamoDbTable_BillingMode_GSI_ProvisionedToPayPerRequest(t *testi { Config: testAccAWSDynamoDbBilling_ProvisionedWithGSI(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckDynamoDbTableHasBilling_Provisioned("aws_dynamodb_table.basic-dynamodb-table"), + testAccCheckDynamoDbTableHasBilling_Provisioned(resourceName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSDynamoDbBilling_PayPerRequestWithGSI(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckDynamoDbTableHasBilling_PayPerRequest("aws_dynamodb_table.basic-dynamodb-table"), + testAccCheckDynamoDbTableHasBilling_PayPerRequest(resourceName), ), }, }, @@ -592,7 +594,7 @@ func TestAccAWSDynamoDbTable_BillingMode_GSI_ProvisionedToPayPerRequest(t *testi func TestAccAWSDynamoDbTable_streamSpecification(t *testing.T) { var conf dynamodb.DescribeTableOutput - + resourceName := "aws_dynamodb_table.test" tableName := fmt.Sprintf("TerraformTestStreamTable-%s", acctest.RandString(8)) resource.ParallelTest(t, resource.TestCase{ @@ -603,21 +605,26 @@ func TestAccAWSDynamoDbTable_streamSpecification(t *testing.T) { { Config: testAccAWSDynamoDbConfigStreamSpecification(tableName, true, "KEYS_ONLY"), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.basic-dynamodb-table", &conf), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "stream_enabled", "true"), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "stream_view_type", "KEYS_ONLY"), - resource.TestCheckResourceAttrSet("aws_dynamodb_table.basic-dynamodb-table", "stream_arn"), - resource.TestCheckResourceAttrSet("aws_dynamodb_table.basic-dynamodb-table", "stream_label"), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "stream_enabled", "true"), + resource.TestCheckResourceAttr(resourceName, "stream_view_type", "KEYS_ONLY"), + resource.TestCheckResourceAttrSet(resourceName, "stream_arn"), + resource.TestCheckResourceAttrSet(resourceName, "stream_label"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSDynamoDbConfigStreamSpecification(tableName, false, ""), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.basic-dynamodb-table", &conf), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "stream_enabled", "false"), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "stream_view_type", ""), - resource.TestCheckResourceAttrSet("aws_dynamodb_table.basic-dynamodb-table", "stream_arn"), - resource.TestCheckResourceAttrSet("aws_dynamodb_table.basic-dynamodb-table", "stream_label"), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "stream_enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "stream_view_type", ""), + resource.TestCheckResourceAttrSet(resourceName, "stream_arn"), + resource.TestCheckResourceAttrSet(resourceName, "stream_label"), ), }, }, @@ -640,6 +647,7 @@ func TestAccAWSDynamoDbTable_streamSpecificationValidation(t *testing.T) { func TestAccAWSDynamoDbTable_tags(t *testing.T) { var conf dynamodb.DescribeTableOutput + resourceName := "aws_dynamodb_table.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -649,12 +657,17 @@ func TestAccAWSDynamoDbTable_tags(t *testing.T) { { Config: testAccAWSDynamoDbConfigTags(), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.basic-dynamodb-table", &conf), - testAccCheckInitialAWSDynamoDbTableConf("aws_dynamodb_table.basic-dynamodb-table"), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), + testAccCheckInitialAWSDynamoDbTableConf(resourceName), resource.TestCheckResourceAttr( - "aws_dynamodb_table.basic-dynamodb-table", "tags.%", "3"), + resourceName, "tags.%", "3"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -662,6 +675,7 @@ func TestAccAWSDynamoDbTable_tags(t *testing.T) { // https://github.com/hashicorp/terraform/issues/13243 func TestAccAWSDynamoDbTable_gsiUpdateCapacity(t *testing.T) { var conf dynamodb.DescribeTableOutput + resourceName := "aws_dynamodb_table.test" name := acctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ @@ -672,27 +686,32 @@ func TestAccAWSDynamoDbTable_gsiUpdateCapacity(t *testing.T) { { Config: testAccAWSDynamoDbConfigGsiUpdate(name), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.test", &conf), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.#", "3"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.write_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2726077800.read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2726077800.write_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.3405251423.read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.3405251423.write_capacity", "1"), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.#", "3"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.write_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2726077800.read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2726077800.write_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.3405251423.read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.3405251423.write_capacity", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSDynamoDbConfigGsiUpdatedCapacity(name), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.test", &conf), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.#", "3"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.705130498.read_capacity", "2"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.705130498.write_capacity", "2"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1115936309.read_capacity", "2"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1115936309.write_capacity", "2"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.4212014188.read_capacity", "2"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.4212014188.write_capacity", "2"), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.#", "3"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.705130498.read_capacity", "2"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.705130498.write_capacity", "2"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1115936309.read_capacity", "2"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1115936309.write_capacity", "2"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.4212014188.read_capacity", "2"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.4212014188.write_capacity", "2"), ), }, }, @@ -701,6 +720,7 @@ func TestAccAWSDynamoDbTable_gsiUpdateCapacity(t *testing.T) { func TestAccAWSDynamoDbTable_gsiUpdateOtherAttributes(t *testing.T) { var conf dynamodb.DescribeTableOutput + resourceName := "aws_dynamodb_table.test" name := acctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ @@ -711,58 +731,63 @@ func TestAccAWSDynamoDbTable_gsiUpdateOtherAttributes(t *testing.T) { { Config: testAccAWSDynamoDbConfigGsiUpdate(name), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.test", &conf), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.#", "3"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2726077800.hash_key", "att3"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2726077800.name", "att3-index"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2726077800.non_key_attributes.#", "0"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2726077800.projection_type", "ALL"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2726077800.range_key", ""), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2726077800.read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2726077800.write_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.hash_key", "att1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.name", "att1-index"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.non_key_attributes.#", "0"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.projection_type", "ALL"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.range_key", ""), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.write_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.3405251423.hash_key", "att2"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.3405251423.name", "att2-index"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.3405251423.non_key_attributes.#", "0"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.3405251423.projection_type", "ALL"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.3405251423.range_key", ""), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.3405251423.read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.3405251423.write_capacity", "1"), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.#", "3"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2726077800.hash_key", "att3"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2726077800.name", "att3-index"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2726077800.non_key_attributes.#", "0"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2726077800.projection_type", "ALL"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2726077800.range_key", ""), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2726077800.read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2726077800.write_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.hash_key", "att1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.name", "att1-index"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.non_key_attributes.#", "0"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.projection_type", "ALL"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.range_key", ""), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.write_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.3405251423.hash_key", "att2"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.3405251423.name", "att2-index"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.3405251423.non_key_attributes.#", "0"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.3405251423.projection_type", "ALL"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.3405251423.range_key", ""), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.3405251423.read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.3405251423.write_capacity", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSDynamoDbConfigGsiUpdatedOtherAttributes(name), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.test", &conf), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.#", "3"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.hash_key", "att4"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.name", "att2-index"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.non_key_attributes.#", "0"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.projection_type", "ALL"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.range_key", "att2"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.write_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.hash_key", "att3"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.name", "att3-index"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.non_key_attributes.#", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.non_key_attributes.0", "RandomAttribute"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.projection_type", "INCLUDE"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.range_key", "att4"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.write_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.hash_key", "att1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.name", "att1-index"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.non_key_attributes.#", "0"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.projection_type", "ALL"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.range_key", ""), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.write_capacity", "1"), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.#", "3"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.hash_key", "att4"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.name", "att2-index"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.non_key_attributes.#", "0"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.projection_type", "ALL"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.range_key", "att2"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.write_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.hash_key", "att3"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.name", "att3-index"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.non_key_attributes.#", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.non_key_attributes.0", "RandomAttribute"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.projection_type", "INCLUDE"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.range_key", "att4"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.write_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.hash_key", "att1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.name", "att1-index"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.non_key_attributes.#", "0"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.projection_type", "ALL"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.range_key", ""), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.write_capacity", "1"), ), }, }, @@ -772,6 +797,7 @@ func TestAccAWSDynamoDbTable_gsiUpdateOtherAttributes(t *testing.T) { // https://github.com/terraform-providers/terraform-provider-aws/issues/566 func TestAccAWSDynamoDbTable_gsiUpdateNonKeyAttributes(t *testing.T) { var conf dynamodb.DescribeTableOutput + resourceName := "aws_dynamodb_table.test" name := acctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ @@ -782,60 +808,65 @@ func TestAccAWSDynamoDbTable_gsiUpdateNonKeyAttributes(t *testing.T) { { Config: testAccAWSDynamoDbConfigGsiUpdatedOtherAttributes(name), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.test", &conf), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.#", "3"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.hash_key", "att4"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.name", "att2-index"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.non_key_attributes.#", "0"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.projection_type", "ALL"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.range_key", "att2"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.write_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.hash_key", "att3"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.name", "att3-index"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.non_key_attributes.#", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.non_key_attributes.0", "RandomAttribute"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.projection_type", "INCLUDE"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.range_key", "att4"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.2311632778.write_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.hash_key", "att1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.name", "att1-index"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.non_key_attributes.#", "0"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.projection_type", "ALL"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.range_key", ""), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.write_capacity", "1"), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.#", "3"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.hash_key", "att4"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.name", "att2-index"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.non_key_attributes.#", "0"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.projection_type", "ALL"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.range_key", "att2"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.write_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.hash_key", "att3"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.name", "att3-index"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.non_key_attributes.#", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.non_key_attributes.0", "RandomAttribute"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.projection_type", "INCLUDE"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.range_key", "att4"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.2311632778.write_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.hash_key", "att1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.name", "att1-index"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.non_key_attributes.#", "0"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.projection_type", "ALL"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.range_key", ""), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.write_capacity", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSDynamoDbConfigGsiUpdatedNonKeyAttributes(name), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.test", &conf), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.#", "3"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.hash_key", "att4"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.name", "att2-index"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.non_key_attributes.#", "0"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.projection_type", "ALL"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.range_key", "att2"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1182392663.write_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.102175821.hash_key", "att3"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.102175821.name", "att3-index"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.102175821.non_key_attributes.#", "2"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.102175821.non_key_attributes.0", "RandomAttribute"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.102175821.non_key_attributes.1", "AnotherAttribute"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.102175821.projection_type", "INCLUDE"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.102175821.range_key", "att4"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.102175821.read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.102175821.write_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.hash_key", "att1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.name", "att1-index"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.non_key_attributes.#", "0"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.projection_type", "ALL"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.range_key", ""), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.read_capacity", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.test", "global_secondary_index.1937107206.write_capacity", "1"), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.#", "3"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.hash_key", "att4"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.name", "att2-index"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.non_key_attributes.#", "0"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.projection_type", "ALL"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.range_key", "att2"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1182392663.write_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.102175821.hash_key", "att3"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.102175821.name", "att3-index"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.102175821.non_key_attributes.#", "2"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.102175821.non_key_attributes.0", "RandomAttribute"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.102175821.non_key_attributes.1", "AnotherAttribute"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.102175821.projection_type", "INCLUDE"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.102175821.range_key", "att4"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.102175821.read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.102175821.write_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.hash_key", "att1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.name", "att1-index"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.non_key_attributes.#", "0"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.projection_type", "ALL"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.range_key", ""), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.read_capacity", "1"), + resource.TestCheckResourceAttr(resourceName, "global_secondary_index.1937107206.write_capacity", "1"), ), }, }, @@ -846,8 +877,8 @@ func TestAccAWSDynamoDbTable_gsiUpdateNonKeyAttributes(t *testing.T) { // ValidationException: Time to live has been modified multiple times within a fixed interval func TestAccAWSDynamoDbTable_Ttl_Enabled(t *testing.T) { var table dynamodb.DescribeTableOutput - rName := acctest.RandomWithPrefix("TerraformTestTable-") resourceName := "aws_dynamodb_table.test" + rName := acctest.RandomWithPrefix("TerraformTestTable-") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -875,8 +906,8 @@ func TestAccAWSDynamoDbTable_Ttl_Enabled(t *testing.T) { // ValidationException: Time to live has been modified multiple times within a fixed interval func TestAccAWSDynamoDbTable_Ttl_Disabled(t *testing.T) { var table dynamodb.DescribeTableOutput - rName := acctest.RandomWithPrefix("TerraformTestTable-") resourceName := "aws_dynamodb_table.test" + rName := acctest.RandomWithPrefix("TerraformTestTable-") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -910,7 +941,7 @@ func TestAccAWSDynamoDbTable_Ttl_Disabled(t *testing.T) { func TestAccAWSDynamoDbTable_attributeUpdate(t *testing.T) { var conf dynamodb.DescribeTableOutput - + resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix("TerraformTestTable-") resource.ParallelTest(t, resource.TestCase{ @@ -921,25 +952,30 @@ func TestAccAWSDynamoDbTable_attributeUpdate(t *testing.T) { { Config: testAccAWSDynamoDbConfigOneAttribute(rName, "firstKey", "firstKey", "S"), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.basic-dynamodb-table", &conf), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { // Attribute type change Config: testAccAWSDynamoDbConfigOneAttribute(rName, "firstKey", "firstKey", "N"), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.basic-dynamodb-table", &conf), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), ), }, { // New attribute addition (index update) Config: testAccAWSDynamoDbConfigTwoAttributes(rName, "firstKey", "secondKey", "firstKey", "N", "secondKey", "S"), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.basic-dynamodb-table", &conf), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), ), }, { // Attribute removal (index update) Config: testAccAWSDynamoDbConfigOneAttribute(rName, "firstKey", "firstKey", "S"), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.basic-dynamodb-table", &conf), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &conf), ), }, }, @@ -967,9 +1003,11 @@ func TestAccAWSDynamoDbTable_attributeUpdateValidation(t *testing.T) { } func TestAccAWSDynamoDbTable_encryption(t *testing.T) { - var confEncEnabled, confEncDisabled, confBasic dynamodb.DescribeTableOutput - + var confBYOK, confEncEnabled, confEncDisabled dynamodb.DescribeTableOutput + resourceName := "aws_dynamodb_table.test" rName := acctest.RandomWithPrefix("TerraformTestTable-") + kmsKeyResourceName := "aws_kms_key.test" + kmsAliasDatasourceName := "data.aws_kms_alias.dynamodb" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -977,34 +1015,42 @@ func TestAccAWSDynamoDbTable_encryption(t *testing.T) { CheckDestroy: testAccCheckAWSDynamoDbTableDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSDynamoDbConfigInitialStateWithEncryption(rName, true), + Config: testAccAWSDynamoDbConfigInitialStateWithEncryptionBYOK(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.basic-dynamodb-table", &confEncEnabled), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "server_side_encryption.#", "1"), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "server_side_encryption.0.enabled", "true"), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &confBYOK), + resource.TestCheckResourceAttr(resourceName, "server_side_encryption.#", "1"), + resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.enabled", "true"), + resource.TestCheckResourceAttrPair(resourceName, "server_side_encryption.0.kms_key_arn", kmsKeyResourceName, "arn"), ), }, { - Config: testAccAWSDynamoDbConfigInitialStateWithEncryption(rName, false), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSDynamoDbConfigInitialStateWithEncryptionAmazonCMK(rName, false), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.basic-dynamodb-table", &confEncDisabled), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "server_side_encryption.#", "0"), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &confEncDisabled), + resource.TestCheckResourceAttr(resourceName, "server_side_encryption.#", "0"), func(s *terraform.State) error { - if confEncDisabled.Table.CreationDateTime.Equal(*confEncEnabled.Table.CreationDateTime) { - return fmt.Errorf("DynamoDB table not recreated when changing SSE") + if !confEncDisabled.Table.CreationDateTime.Equal(*confBYOK.Table.CreationDateTime) { + return fmt.Errorf("DynamoDB table recreated when changing SSE") } return nil }, ), }, { - Config: testAccAWSDynamoDbConfig_basic(rName), + Config: testAccAWSDynamoDbConfigInitialStateWithEncryptionAmazonCMK(rName, true), Check: resource.ComposeTestCheckFunc( - testAccCheckInitialAWSDynamoDbTableExists("aws_dynamodb_table.basic-dynamodb-table", &confBasic), - resource.TestCheckResourceAttr("aws_dynamodb_table.basic-dynamodb-table", "server_side_encryption.#", "0"), + testAccCheckInitialAWSDynamoDbTableExists(resourceName, &confEncEnabled), + resource.TestCheckResourceAttr(resourceName, "server_side_encryption.#", "1"), + resource.TestCheckResourceAttr(resourceName, "server_side_encryption.0.enabled", "true"), + resource.TestCheckResourceAttrPair(resourceName, "server_side_encryption.0.kms_key_arn", kmsAliasDatasourceName, "target_key_arn"), func(s *terraform.State) error { - if !confBasic.Table.CreationDateTime.Equal(*confEncDisabled.Table.CreationDateTime) { - return fmt.Errorf("DynamoDB table was recreated unexpectedly") + if !confEncEnabled.Table.CreationDateTime.Equal(*confEncDisabled.Table.CreationDateTime) { + return fmt.Errorf("DynamoDB table recreated when changing SSE") } return nil }, @@ -1358,7 +1404,7 @@ func dynamoDbAttributesToMap(attributes *[]*dynamodb.AttributeDefinition) map[st func testAccAWSDynamoDbConfig_basic(rName string) string { return fmt.Sprintf(` -resource "aws_dynamodb_table" "basic-dynamodb-table" { +resource "aws_dynamodb_table" "test" { name = "%s" read_capacity = 1 write_capacity = 1 @@ -1374,7 +1420,7 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" { func testAccAWSDynamoDbConfig_backup(rName string) string { return fmt.Sprintf(` -resource "aws_dynamodb_table" "basic-dynamodb-table" { +resource "aws_dynamodb_table" "test" { name = "%s" read_capacity = 1 write_capacity = 1 @@ -1394,7 +1440,7 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" { func testAccAWSDynamoDbBilling_PayPerRequest(rName string) string { return fmt.Sprintf(` -resource "aws_dynamodb_table" "basic-dynamodb-table" { +resource "aws_dynamodb_table" "test" { name = "%s" billing_mode = "PAY_PER_REQUEST" hash_key = "TestTableHashKey" @@ -1409,7 +1455,7 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" { func testAccAWSDynamoDbBilling_Provisioned(rName string) string { return fmt.Sprintf(` -resource "aws_dynamodb_table" "basic-dynamodb-table" { +resource "aws_dynamodb_table" "test" { name = "%s" billing_mode = "PROVISIONED" hash_key = "TestTableHashKey" @@ -1427,7 +1473,7 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" { func testAccAWSDynamoDbBilling_PayPerRequestWithGSI(rName string) string { return fmt.Sprintf(` -resource "aws_dynamodb_table" "basic-dynamodb-table" { +resource "aws_dynamodb_table" "test" { name = "%s" billing_mode = "PAY_PER_REQUEST" hash_key = "TestTableHashKey" @@ -1453,7 +1499,7 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" { func testAccAWSDynamoDbBilling_ProvisionedWithGSI(rName string) string { return fmt.Sprintf(` -resource "aws_dynamodb_table" "basic-dynamodb-table" { +resource "aws_dynamodb_table" "test" { billing_mode = "PROVISIONED" hash_key = "TestTableHashKey" name = %q @@ -1483,7 +1529,7 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" { func testAccAWSDynamoDbConfigInitialState(rName string) string { return fmt.Sprintf(` -resource "aws_dynamodb_table" "basic-dynamodb-table" { +resource "aws_dynamodb_table" "test" { name = "%s" read_capacity = 1 write_capacity = 2 @@ -1528,9 +1574,17 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" { `, rName) } -func testAccAWSDynamoDbConfigInitialStateWithEncryption(rName string, enabled bool) string { +func testAccAWSDynamoDbConfigInitialStateWithEncryptionAmazonCMK(rName string, enabled bool) string { return fmt.Sprintf(` -resource "aws_dynamodb_table" "basic-dynamodb-table" { +data "aws_kms_alias" "dynamodb" { + name = "alias/aws/dynamodb" +} + +resource "aws_kms_key" "test" { + description = "DynamoDbTest" +} + +resource "aws_dynamodb_table" "test" { name = "%s" read_capacity = 1 write_capacity = 1 @@ -1548,9 +1602,34 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" { `, rName, enabled) } +func testAccAWSDynamoDbConfigInitialStateWithEncryptionBYOK(rName string) string { + return fmt.Sprintf(` +resource "aws_kms_key" "test" { + description = "DynamoDbTest" +} + +resource "aws_dynamodb_table" "test" { + name = "%s" + read_capacity = 2 + write_capacity = 2 + hash_key = "TestTableHashKey" + + attribute { + name = "TestTableHashKey" + type = "S" + } + + server_side_encryption { + enabled = true + kms_key_arn = "${aws_kms_key.test.arn}" + } +} +`, rName) +} + func testAccAWSDynamoDbConfigAddSecondaryGSI(rName string) string { return fmt.Sprintf(` -resource "aws_dynamodb_table" "basic-dynamodb-table" { +resource "aws_dynamodb_table" "test" { name = "%s" read_capacity = 2 write_capacity = 2 @@ -1598,7 +1677,7 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" { func testAccAWSDynamoDbConfigStreamSpecification(tableName string, enabled bool, viewType string) string { return fmt.Sprintf(` -resource "aws_dynamodb_table" "basic-dynamodb-table" { +resource "aws_dynamodb_table" "test" { name = "%s" read_capacity = 1 write_capacity = 2 @@ -1617,7 +1696,7 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" { func testAccAWSDynamoDbConfigTags() string { return fmt.Sprintf(` -resource "aws_dynamodb_table" "basic-dynamodb-table" { +resource "aws_dynamodb_table" "test" { name = "TerraformTestTable-%d" read_capacity = 1 write_capacity = 2 @@ -1943,7 +2022,7 @@ resource "aws_dynamodb_table" "test" { func testAccAWSDynamoDbConfigOneAttribute(rName, hashKey, attrName, attrType string) string { return fmt.Sprintf(` -resource "aws_dynamodb_table" "basic-dynamodb-table" { +resource "aws_dynamodb_table" "test" { name = "%s" read_capacity = 10 write_capacity = 10 @@ -1972,7 +2051,7 @@ resource "aws_dynamodb_table" "basic-dynamodb-table" { func testAccAWSDynamoDbConfigTwoAttributes(rName, hashKey, rangeKey, attrName1, attrType1, attrName2, attrType2 string) string { return fmt.Sprintf(` -resource "aws_dynamodb_table" "basic-dynamodb-table" { +resource "aws_dynamodb_table" "test" { name = "%s" read_capacity = 10 write_capacity = 10 diff --git a/aws/resource_aws_ebs_snapshot.go b/aws/resource_aws_ebs_snapshot.go index dde4d0d7e6c..994db2d237d 100644 --- a/aws/resource_aws_ebs_snapshot.go +++ b/aws/resource_aws_ebs_snapshot.go @@ -9,12 +9,14 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsEbsSnapshot() *schema.Resource { return &schema.Resource{ Create: resourceAwsEbsSnapshotCreate, Read: resourceAwsEbsSnapshotRead, + Update: resourceAwsEbsSnapshotUpdate, Delete: resourceAwsEbsSnapshotDelete, Timeouts: &schema.ResourceTimeout{ @@ -57,12 +59,7 @@ func resourceAwsEbsSnapshot() *schema.Resource { Type: schema.TypeString, Computed: true, }, - - "tags": { - Type: schema.TypeMap, - Optional: true, - ForceNew: true, - }, + "tags": tagsSchema(), }, } } @@ -71,7 +68,8 @@ func resourceAwsEbsSnapshotCreate(d *schema.ResourceData, meta interface{}) erro conn := meta.(*AWSClient).ec2conn request := &ec2.CreateSnapshotInput{ - VolumeId: aws.String(d.Get("volume_id").(string)), + VolumeId: aws.String(d.Get("volume_id").(string)), + TagSpecifications: ec2TagSpecificationsFromMap(d.Get("tags").(map[string]interface{}), ec2.ResourceTypeSnapshot), } if v, ok := d.GetOk("description"); ok { request.Description = aws.String(v.(string)) @@ -106,10 +104,6 @@ func resourceAwsEbsSnapshotCreate(d *schema.ResourceData, meta interface{}) erro return err } - if err := setTags(conn, d); err != nil { - log.Printf("[WARN] error setting tags: %s", err) - } - return resourceAwsEbsSnapshotRead(d, meta) } @@ -145,13 +139,26 @@ func resourceAwsEbsSnapshotRead(d *schema.ResourceData, meta interface{}) error d.Set("kms_key_id", snapshot.KmsKeyId) d.Set("volume_size", snapshot.VolumeSize) - if err := d.Set("tags", tagsToMap(snapshot.Tags)); err != nil { - log.Printf("[WARN] error saving tags to state: %s", err) + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(snapshot.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil } +func resourceAwsEbsSnapshotUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + + return resourceAwsEbsSnapshotRead(d, meta) +} + func resourceAwsEbsSnapshotDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn input := &ec2.DeleteSnapshotInput{ diff --git a/aws/resource_aws_ebs_snapshot_copy.go b/aws/resource_aws_ebs_snapshot_copy.go index 1e1db5642e4..84e9f19c061 100644 --- a/aws/resource_aws_ebs_snapshot_copy.go +++ b/aws/resource_aws_ebs_snapshot_copy.go @@ -9,12 +9,14 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsEbsSnapshotCopy() *schema.Resource { return &schema.Resource{ Create: resourceAwsEbsSnapshotCopyCreate, Read: resourceAwsEbsSnapshotCopyRead, + Update: resourceAwsEbsSnapshotCopyUpdate, Delete: resourceAwsEbsSnapshotCopyDelete, Schema: map[string]*schema.Schema{ @@ -63,11 +65,7 @@ func resourceAwsEbsSnapshotCopy() *schema.Resource { Required: true, ForceNew: true, }, - "tags": { - Type: schema.TypeMap, - Optional: true, - ForceNew: true, - }, + "tags": tagsSchema(), }, } } @@ -76,8 +74,9 @@ func resourceAwsEbsSnapshotCopyCreate(d *schema.ResourceData, meta interface{}) conn := meta.(*AWSClient).ec2conn request := &ec2.CopySnapshotInput{ - SourceRegion: aws.String(d.Get("source_region").(string)), - SourceSnapshotId: aws.String(d.Get("source_snapshot_id").(string)), + SourceRegion: aws.String(d.Get("source_region").(string)), + SourceSnapshotId: aws.String(d.Get("source_snapshot_id").(string)), + TagSpecifications: ec2TagSpecificationsFromMap(d.Get("tags").(map[string]interface{}), ec2.ResourceTypeSnapshot), } if v, ok := d.GetOk("description"); ok { request.Description = aws.String(v.(string)) @@ -101,10 +100,6 @@ func resourceAwsEbsSnapshotCopyCreate(d *schema.ResourceData, meta interface{}) return err } - if err := setTags(conn, d); err != nil { - log.Printf("[WARN] error setting tags: %s", err) - } - return resourceAwsEbsSnapshotCopyRead(d, meta) } @@ -132,8 +127,8 @@ func resourceAwsEbsSnapshotCopyRead(d *schema.ResourceData, meta interface{}) er d.Set("kms_key_id", snapshot.KmsKeyId) d.Set("volume_size", snapshot.VolumeSize) - if err := d.Set("tags", tagsToMap(snapshot.Tags)); err != nil { - log.Printf("[WARN] error saving tags to state: %s", err) + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(snapshot.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -172,6 +167,19 @@ func resourceAwsEbsSnapshotCopyDelete(d *schema.ResourceData, meta interface{}) return nil } +func resourceAwsEbsSnapshotCopyUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + + return resourceAwsEbsSnapshotRead(d, meta) +} + func resourceAwsEbsSnapshotCopyWaitForAvailable(id string, conn *ec2.EC2) error { log.Printf("Waiting for Snapshot %s to become available...", id) diff --git a/aws/resource_aws_ebs_snapshot_copy_test.go b/aws/resource_aws_ebs_snapshot_copy_test.go index 8d1390cf9cd..d2c0fe4da26 100644 --- a/aws/resource_aws_ebs_snapshot_copy_test.go +++ b/aws/resource_aws_ebs_snapshot_copy_test.go @@ -24,7 +24,46 @@ func TestAccAWSEbsSnapshotCopy_basic(t *testing.T) { Config: testAccAwsEbsSnapshotCopyConfig, Check: resource.ComposeTestCheckFunc( testAccCheckEbsSnapshotCopyExists(resourceName, &snapshot), - testAccCheckTags(&snapshot.Tags, "Name", "testAccAwsEbsSnapshotCopyConfig"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", "testAccAwsEbsSnapshotCopyConfig"), + ), + }, + }, + }) +} + +func TestAccAWSEbsSnapshotCopy_tags(t *testing.T) { + var snapshot ec2.Snapshot + resourceName := "aws_ebs_snapshot_copy.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckEbsSnapshotCopyDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsEbsSnapshotCopyConfigTags1("key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckEbsSnapshotCopyExists(resourceName, &snapshot), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + Config: testAccAwsEbsSnapshotCopyConfigTags2("key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckEbsSnapshotCopyExists(resourceName, &snapshot), + resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAwsEbsSnapshotCopyConfigTags1("key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckEbsSnapshotCopyExists(resourceName, &snapshot), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, }, @@ -223,6 +262,73 @@ resource "aws_ebs_snapshot_copy" "test" { } ` +func testAccAwsEbsSnapshotCopyConfigTags1(tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "available" { + state = "available" +} + +data "aws_region" "current" {} + +resource "aws_ebs_volume" "test" { + availability_zone = "${data.aws_availability_zones.available.names[0]}" + size = 1 +} + +resource "aws_ebs_snapshot" "test" { + volume_id = "${aws_ebs_volume.test.id}" + + tags = { + Name = "testAccAwsEbsSnapshotCopyConfig" + } +} + +resource "aws_ebs_snapshot_copy" "test" { + source_snapshot_id = "${aws_ebs_snapshot.test.id}" + source_region = "${data.aws_region.current.name}" + + tags = { + Name = "testAccAwsEbsSnapshotCopyConfig" + "%s" = "%s" + } +} +`, tagKey1, tagValue1) +} + +func testAccAwsEbsSnapshotCopyConfigTags2(tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "available" { + state = "available" +} + +data "aws_region" "current" {} + +resource "aws_ebs_volume" "test" { + availability_zone = "${data.aws_availability_zones.available.names[0]}" + size = 1 +} + +resource "aws_ebs_snapshot" "test" { + volume_id = "${aws_ebs_volume.test.id}" + + tags = { + Name = "testAccAwsEbsSnapshotCopyConfig" + } +} + +resource "aws_ebs_snapshot_copy" "test" { + source_snapshot_id = "${aws_ebs_snapshot.test.id}" + source_region = "${data.aws_region.current.name}" + + tags = { + Name = "testAccAwsEbsSnapshotCopyConfig" + "%s" = "%s" + "%s" = "%s" + } +} +`, tagKey1, tagValue1, tagKey2, tagValue2) +} + const testAccAwsEbsSnapshotCopyConfigWithDescription = ` data "aws_availability_zones" "available" { state = "available" diff --git a/aws/resource_aws_ebs_snapshot_test.go b/aws/resource_aws_ebs_snapshot_test.go index 79679112946..d21422f2ae2 100644 --- a/aws/resource_aws_ebs_snapshot_test.go +++ b/aws/resource_aws_ebs_snapshot_test.go @@ -15,6 +15,7 @@ import ( func TestAccAWSEBSSnapshot_basic(t *testing.T) { var v ec2.Snapshot rName := fmt.Sprintf("tf-acc-ebs-snapshot-basic-%s", acctest.RandString(7)) + resourceName := "aws_ebs_snapshot.test" deleteSnapshot := func() { conn := testAccProvider.Meta().(*AWSClient).ec2conn @@ -47,16 +48,57 @@ func TestAccAWSEBSSnapshot_basic(t *testing.T) { { Config: testAccAwsEbsSnapshotConfigBasic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckSnapshotExists("aws_ebs_snapshot.test", &v), - testAccCheckTags(&v.Tags, "Name", rName), + testAccCheckSnapshotExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), ), }, { PreConfig: deleteSnapshot, Config: testAccAwsEbsSnapshotConfigBasic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckSnapshotExists("aws_ebs_snapshot.test", &v), - testAccCheckTags(&v.Tags, "Name", rName), + testAccCheckSnapshotExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", rName), + ), + }, + }, + }) +} + +func TestAccAWSEBSSnapshot_tags(t *testing.T) { + var v ec2.Snapshot + rName := fmt.Sprintf("tf-acc-ebs-snapshot-desc-%s", acctest.RandString(7)) + resourceName := "aws_ebs_snapshot.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEbsSnapshotDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsEbsSnapshotConfigBasicTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckSnapshotExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + Config: testAccAwsEbsSnapshotConfigBasicTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckSnapshotExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAwsEbsSnapshotConfigBasicTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckSnapshotExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, }, @@ -66,6 +108,7 @@ func TestAccAWSEBSSnapshot_basic(t *testing.T) { func TestAccAWSEBSSnapshot_withDescription(t *testing.T) { var v ec2.Snapshot rName := fmt.Sprintf("tf-acc-ebs-snapshot-desc-%s", acctest.RandString(7)) + resourceName := "aws_ebs_snapshot.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -75,8 +118,8 @@ func TestAccAWSEBSSnapshot_withDescription(t *testing.T) { { Config: testAccAwsEbsSnapshotConfigWithDescription(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckSnapshotExists("aws_ebs_snapshot.test", &v), - resource.TestCheckResourceAttr("aws_ebs_snapshot.test", "description", rName), + testAccCheckSnapshotExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "description", rName), ), }, }, @@ -86,6 +129,7 @@ func TestAccAWSEBSSnapshot_withDescription(t *testing.T) { func TestAccAWSEBSSnapshot_withKms(t *testing.T) { var v ec2.Snapshot rName := fmt.Sprintf("tf-acc-ebs-snapshot-kms-%s", acctest.RandString(7)) + resourceName := "aws_ebs_snapshot.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -95,8 +139,8 @@ func TestAccAWSEBSSnapshot_withKms(t *testing.T) { { Config: testAccAwsEbsSnapshotConfigWithKms(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckSnapshotExists("aws_ebs_snapshot.test", &v), - resource.TestMatchResourceAttr("aws_ebs_snapshot.test", "kms_key_id", + testAccCheckSnapshotExists(resourceName, &v), + resource.TestMatchResourceAttr(resourceName, "kms_key_id", regexp.MustCompile(`^arn:aws:kms:[a-z]{2}-[a-z]+-\d{1}:[0-9]{12}:key/[a-z0-9-]{36}$`)), ), }, @@ -182,6 +226,57 @@ resource "aws_ebs_snapshot" "test" { `, rName) } +func testAccAwsEbsSnapshotConfigBasicTags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +data "aws_region" "current" {} + +resource "aws_ebs_volume" "test" { + availability_zone = "${data.aws_region.current.name}a" + size = 1 +} + +resource "aws_ebs_snapshot" "test" { + volume_id = "${aws_ebs_volume.test.id}" + + tags = { + Name = "%s" + "%s" = "%s" + } + + timeouts { + create = "10m" + delete = "10m" + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccAwsEbsSnapshotConfigBasicTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +data "aws_region" "current" {} + +resource "aws_ebs_volume" "test" { + availability_zone = "${data.aws_region.current.name}a" + size = 1 +} + +resource "aws_ebs_snapshot" "test" { + volume_id = "${aws_ebs_volume.test.id}" + + tags = { + Name = "%s" + "%s" = "%s" + "%s" = "%s" + } + + timeouts { + create = "10m" + delete = "10m" + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + func testAccAwsEbsSnapshotConfigWithDescription(rName string) string { return fmt.Sprintf(` data "aws_region" "current" {} diff --git a/aws/resource_aws_ebs_volume.go b/aws/resource_aws_ebs_volume.go index 76ae339aef7..89add9e1a8b 100644 --- a/aws/resource_aws_ebs_volume.go +++ b/aws/resource_aws_ebs_volume.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsEbsVolume() *schema.Resource { @@ -80,7 +81,8 @@ func resourceAwsEbsVolumeCreate(d *schema.ResourceData, meta interface{}) error conn := meta.(*AWSClient).ec2conn request := &ec2.CreateVolumeInput{ - AvailabilityZone: aws.String(d.Get("availability_zone").(string)), + AvailabilityZone: aws.String(d.Get("availability_zone").(string)), + TagSpecifications: ec2TagSpecificationsFromMap(d.Get("tags").(map[string]interface{}), ec2.ResourceTypeVolume), } if value, ok := d.GetOk("encrypted"); ok { request.Encrypted = aws.Bool(value.(bool)) @@ -94,14 +96,6 @@ func resourceAwsEbsVolumeCreate(d *schema.ResourceData, meta interface{}) error if value, ok := d.GetOk("snapshot_id"); ok { request.SnapshotId = aws.String(value.(string)) } - if value, ok := d.GetOk("tags"); ok { - request.TagSpecifications = []*ec2.TagSpecification{ - { - ResourceType: aws.String(ec2.ResourceTypeVolume), - Tags: tagsFromMap(value.(map[string]interface{})), - }, - } - } // 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 @@ -154,11 +148,6 @@ func resourceAwsEbsVolumeCreate(d *schema.ResourceData, meta interface{}) error 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 fmt.Errorf("Error updating tags for EBS Volume: %s", err) - } - } requestUpdate := false params := &ec2.ModifyVolumeInput{ @@ -203,6 +192,14 @@ func resourceAWSEbsVolumeUpdate(d *schema.ResourceData, meta interface{}) error } } + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + return resourceAwsEbsVolumeRead(d, meta) } @@ -268,7 +265,7 @@ func resourceAwsEbsVolumeRead(d *schema.ResourceData, meta interface{}) error { d.Set("size", aws.Int64Value(volume.Size)) d.Set("snapshot_id", aws.StringValue(volume.SnapshotId)) - if err := d.Set("tags", tagsToMap(volume.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(volume.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } diff --git a/aws/resource_aws_ec2_capacity_reservation.go b/aws/resource_aws_ec2_capacity_reservation.go index b4e6ca5707c..dc0f734c74d 100644 --- a/aws/resource_aws_ec2_capacity_reservation.go +++ b/aws/resource_aws_ec2_capacity_reservation.go @@ -9,6 +9,12 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +const ( + // There is no constant in the SDK for this resource type + ec2ResourceTypeCapacityReservation = "capacity-reservation" ) func resourceAwsEc2CapacityReservation() *schema.Resource { @@ -106,11 +112,12 @@ func resourceAwsEc2CapacityReservationCreate(d *schema.ResourceData, meta interf conn := meta.(*AWSClient).ec2conn opts := &ec2.CreateCapacityReservationInput{ - AvailabilityZone: aws.String(d.Get("availability_zone").(string)), - EndDateType: aws.String(d.Get("end_date_type").(string)), - InstanceCount: aws.Int64(int64(d.Get("instance_count").(int))), - InstancePlatform: aws.String(d.Get("instance_platform").(string)), - InstanceType: aws.String(d.Get("instance_type").(string)), + AvailabilityZone: aws.String(d.Get("availability_zone").(string)), + EndDateType: aws.String(d.Get("end_date_type").(string)), + InstanceCount: aws.Int64(int64(d.Get("instance_count").(int))), + InstancePlatform: aws.String(d.Get("instance_platform").(string)), + InstanceType: aws.String(d.Get("instance_type").(string)), + TagSpecifications: ec2TagSpecificationsFromMap(d.Get("tags").(map[string]interface{}), ec2ResourceTypeCapacityReservation), } if v, ok := d.GetOk("ebs_optimized"); ok { @@ -137,16 +144,6 @@ func resourceAwsEc2CapacityReservationCreate(d *schema.ResourceData, meta interf opts.Tenancy = aws.String(v.(string)) } - if v, ok := d.GetOk("tags"); ok && len(v.(map[string]interface{})) > 0 { - opts.TagSpecifications = []*ec2.TagSpecification{ - { - // There is no constant in the SDK for this resource type - ResourceType: aws.String("capacity-reservation"), - Tags: tagsFromMap(v.(map[string]interface{})), - }, - } - } - log.Printf("[DEBUG] Capacity reservation: %s", opts) out, err := conn.CreateCapacityReservation(opts) @@ -200,7 +197,7 @@ func resourceAwsEc2CapacityReservationRead(d *schema.ResourceData, meta interfac d.Set("instance_platform", reservation.InstancePlatform) d.Set("instance_type", reservation.InstanceType) - if err := d.Set("tags", tagsToMap(reservation.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(reservation.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -212,18 +209,6 @@ func resourceAwsEc2CapacityReservationRead(d *schema.ResourceData, meta interfac func resourceAwsEc2CapacityReservationUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - d.Partial(true) - - if d.HasChange("tags") { - if err := setTags(conn, d); err != nil { - return err - } else { - d.SetPartial("tags") - } - } - - d.Partial(false) - opts := &ec2.ModifyCapacityReservationInput{ CapacityReservationId: aws.String(d.Id()), EndDateType: aws.String(d.Get("end_date_type").(string)), @@ -244,6 +229,15 @@ func resourceAwsEc2CapacityReservationUpdate(d *schema.ResourceData, meta interf if err != nil { return fmt.Errorf("Error modifying EC2 Capacity Reservation: %s", err) } + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + return resourceAwsEc2CapacityReservationRead(d, meta) } diff --git a/aws/resource_aws_ec2_capacity_reservation_test.go b/aws/resource_aws_ec2_capacity_reservation_test.go index 5bcba8b29c2..09e3c7f5a53 100644 --- a/aws/resource_aws_ec2_capacity_reservation_test.go +++ b/aws/resource_aws_ec2_capacity_reservation_test.go @@ -162,6 +162,7 @@ func TestAccAWSEc2CapacityReservation_endDate(t *testing.T) { func TestAccAWSEc2CapacityReservation_endDateType(t *testing.T) { var cr ec2.CapacityReservation + endDate := time.Now().UTC().Add(12 * time.Hour).Format(time.RFC3339) resourceName := "aws_ec2_capacity_reservation.test" resource.ParallelTest(t, resource.TestCase{ @@ -182,10 +183,10 @@ func TestAccAWSEc2CapacityReservation_endDateType(t *testing.T) { ImportStateVerify: true, }, { - Config: testAccEc2CapacityReservationConfig_endDate("2019-10-31T07:39:57Z"), + Config: testAccEc2CapacityReservationConfig_endDate(endDate), Check: resource.ComposeTestCheckFunc( testAccCheckEc2CapacityReservationExists(resourceName, &cr), - resource.TestCheckResourceAttr(resourceName, "end_date", "2019-10-31T07:39:57Z"), + resource.TestCheckResourceAttr(resourceName, "end_date", endDate), resource.TestCheckResourceAttr(resourceName, "end_date_type", "limited"), ), }, diff --git a/aws/resource_aws_ec2_client_vpn_endpoint.go b/aws/resource_aws_ec2_client_vpn_endpoint.go index 62d05390495..cb1e7cca2ef 100644 --- a/aws/resource_aws_ec2_client_vpn_endpoint.go +++ b/aws/resource_aws_ec2_client_vpn_endpoint.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsEc2ClientVpnEndpoint() *schema.Resource { @@ -223,7 +224,12 @@ func resourceAwsEc2ClientVpnEndpointRead(d *schema.ResourceData, meta interface{ d.Set("server_certificate_arn", result.ClientVpnEndpoints[0].ServerCertificateArn) d.Set("transport_protocol", result.ClientVpnEndpoints[0].TransportProtocol) d.Set("dns_name", result.ClientVpnEndpoints[0].DnsName) - d.Set("status", result.ClientVpnEndpoints[0].Status) + d.Set("dns_servers", result.ClientVpnEndpoints[0].DnsServers) + + if result.ClientVpnEndpoints[0].Status != nil { + d.Set("status", result.ClientVpnEndpoints[0].Status.Code) + } + d.Set("split_tunnel", result.ClientVpnEndpoints[0].SplitTunnel) err = d.Set("authentication_options", flattenAuthOptsConfig(result.ClientVpnEndpoints[0].AuthenticationOptions)) @@ -236,7 +242,7 @@ func resourceAwsEc2ClientVpnEndpointRead(d *schema.ResourceData, meta interface{ return fmt.Errorf("error setting connection_log_options: %s", err) } - err = d.Set("tags", tagsToMap(result.ClientVpnEndpoints[0].Tags)) + err = d.Set("tags", keyvaluetags.Ec2KeyValueTags(result.ClientVpnEndpoints[0].Tags).IgnoreAws().Map()) if err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -320,10 +326,13 @@ func resourceAwsEc2ClientVpnEndpointUpdate(d *schema.ResourceData, meta interfac return fmt.Errorf("Error modifying Client VPN endpoint: %s", err) } - if err := setTags(conn, d); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating EC2 Client VPN Endpoint (%s) tags: %s", d.Id(), err) + } } - d.SetPartial("tags") d.Partial(false) return resourceAwsEc2ClientVpnEndpointRead(d, meta) diff --git a/aws/resource_aws_ec2_client_vpn_endpoint_test.go b/aws/resource_aws_ec2_client_vpn_endpoint_test.go index eda8ad6692c..c2ce2d7076f 100644 --- a/aws/resource_aws_ec2_client_vpn_endpoint_test.go +++ b/aws/resource_aws_ec2_client_vpn_endpoint_test.go @@ -86,6 +86,7 @@ func TestAccAwsEc2ClientVpnEndpoint_basic(t *testing.T) { testAccCheckAwsEc2ClientVpnEndpointExists("aws_ec2_client_vpn_endpoint.test"), resource.TestCheckResourceAttr("aws_ec2_client_vpn_endpoint.test", "authentication_options.#", "1"), resource.TestCheckResourceAttr("aws_ec2_client_vpn_endpoint.test", "authentication_options.0.type", "certificate-authentication"), + resource.TestCheckResourceAttr("aws_ec2_client_vpn_endpoint.test", "status", ec2.ClientVpnEndpointStatusCodePendingAssociate), ), }, @@ -198,10 +199,9 @@ func TestAccAwsEc2ClientVpnEndpoint_withDNSServers(t *testing.T) { }, { - ResourceName: "aws_ec2_client_vpn_endpoint.test", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"dns_servers"}, + ResourceName: "aws_ec2_client_vpn_endpoint.test", + ImportState: true, + ImportStateVerify: true, }, }, }) diff --git a/aws/resource_aws_ec2_client_vpn_network_association_test.go b/aws/resource_aws_ec2_client_vpn_network_association_test.go index 6691f154404..ee7f733ab9e 100644 --- a/aws/resource_aws_ec2_client_vpn_network_association_test.go +++ b/aws/resource_aws_ec2_client_vpn_network_association_test.go @@ -148,6 +148,12 @@ resource "aws_acm_certificate" "test" { func testAccEc2ClientVpnNetworkAssociationConfig(rName string) string { return testAccEc2ClientVpnNetworkAssociationConfigAcmCertificateBase() + fmt.Sprintf(` +data "aws_availability_zones" "available" { + # InvalidParameterValue: AZ us-west-2d is not currently supported. Please choose another az in this region + blacklisted_zone_ids = ["usw2-az4"] + state = "available" +} + resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" @@ -157,6 +163,7 @@ resource "aws_vpc" "test" { } resource "aws_subnet" "test" { + availability_zone = data.aws_availability_zones.available.names[0] cidr_block = "10.1.1.0/24" vpc_id = "${aws_vpc.test.id}" map_public_ip_on_launch = true diff --git a/aws/resource_aws_ec2_fleet.go b/aws/resource_aws_ec2_fleet.go index 953444c76c0..5eaf702df93 100644 --- a/aws/resource_aws_ec2_fleet.go +++ b/aws/resource_aws_ec2_fleet.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsEc2Fleet() *schema.Resource { @@ -192,12 +193,7 @@ func resourceAwsEc2Fleet() *schema.Resource { }, }, }, - "tags": { - Type: schema.TypeMap, - Optional: true, - ForceNew: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, + "tags": tagsSchema(), "target_capacity_specification": { Type: schema.TypeList, Required: true, @@ -312,7 +308,7 @@ func resourceAwsEc2FleetCreate(d *schema.ResourceData, meta interface{}) error { SpotOptions: expandEc2SpotOptionsRequest(d.Get("spot_options").([]interface{})), TargetCapacitySpecification: expandEc2TargetCapacitySpecificationRequest(d.Get("target_capacity_specification").([]interface{})), TerminateInstancesWithExpiration: aws.Bool(d.Get("terminate_instances_with_expiration").(bool)), - TagSpecifications: expandEc2TagSpecifications(d.Get("tags").(map[string]interface{})), + TagSpecifications: ec2TagSpecificationsFromMap(d.Get("tags").(map[string]interface{}), ec2.ResourceTypeFleet), Type: aws.String(d.Get("type").(string)), } @@ -435,7 +431,7 @@ func resourceAwsEc2FleetRead(d *schema.ResourceData, meta interface{}) error { d.Set("terminate_instances_with_expiration", fleet.TerminateInstancesWithExpiration) d.Set("type", fleet.Type) - if err := d.Set("tags", tagsToMap(fleet.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(fleet.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -475,6 +471,14 @@ func resourceAwsEc2FleetUpdate(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error waiting for EC2 Fleet (%s) modification: %s", d.Id(), err) } + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + return resourceAwsEc2FleetRead(d, meta) } @@ -693,19 +697,6 @@ func expandEc2SpotOptionsRequest(l []interface{}) *ec2.SpotOptionsRequest { return spotOptionsRequest } -func expandEc2TagSpecifications(m map[string]interface{}) []*ec2.TagSpecification { - if len(m) == 0 { - return nil - } - - return []*ec2.TagSpecification{ - { - ResourceType: aws.String("fleet"), - Tags: tagsFromMap(m), - }, - } -} - func expandEc2TargetCapacitySpecificationRequest(l []interface{}) *ec2.TargetCapacitySpecificationRequest { if len(l) == 0 || l[0] == nil { return nil diff --git a/aws/resource_aws_ec2_fleet_test.go b/aws/resource_aws_ec2_fleet_test.go index 3e7d797bbe8..2ee8f058d69 100644 --- a/aws/resource_aws_ec2_fleet_test.go +++ b/aws/resource_aws_ec2_fleet_test.go @@ -4,7 +4,9 @@ import ( "errors" "fmt" "strconv" + "strings" "testing" + "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" @@ -783,7 +785,6 @@ func TestAccAWSEc2Fleet_Tags(t *testing.T) { Config: testAccAWSEc2FleetConfig_Tags(rName, "key1", "value1updated"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEc2FleetExists(resourceName, &fleet2), - testAccCheckAWSEc2FleetRecreated(&fleet1, &fleet2), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), ), @@ -987,6 +988,183 @@ func TestAccAWSEc2Fleet_Type(t *testing.T) { }) } +// Test for the bug described in https://github.com/terraform-providers/terraform-provider-aws/issues/6777 +func TestAccAWSEc2Fleet_TemplateMultipleNetworkInterfaces(t *testing.T) { + var fleet1 ec2.FleetData + resourceName := "aws_ec2_fleet.test" + rInt := acctest.RandInt() + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2Fleet(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEc2FleetDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEc2FleetConfig_multipleNetworkInterfaces(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEc2FleetExists(resourceName, &fleet1), + resource.TestCheckResourceAttr(resourceName, "type", "maintain"), + testAccCheckAWSEc2FleetHistory(resourceName, "The associatePublicIPAddress parameter cannot be specified when launching with multiple network interfaces"), + ), + }, + }, + }) +} + +func testAccAWSEc2FleetConfig_multipleNetworkInterfaces(rInt int) string { + return fmt.Sprintf(` +data "aws_ami" "test" { + most_recent = true + + filter { + name = "name" + values = ["ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-*"] + } + + filter { + name = "virtualization-type" + values = ["hvm"] + } + + owners = ["099720109477"] # Canonical +} + +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" +} + +resource "aws_internet_gateway" "test" { + vpc_id = "${aws_vpc.test.id}" +} + +resource "aws_subnet" "test" { + cidr_block = "10.1.0.0/24" + vpc_id = "${aws_vpc.test.id}" +} + +resource "aws_security_group" "test" { + name = "security-group-%d" + description = "Testacc SSH security group" + vpc_id = "${aws_vpc.test.id}" + + ingress { + protocol = "tcp" + from_port = 22 + to_port = 22 + cidr_blocks = ["0.0.0.0/0"] + } + egress { + protocol = "-1" + from_port = 0 + to_port = 0 + cidr_blocks = ["0.0.0.0/0"] + } +} + +resource "aws_network_interface" "test" { + subnet_id = "${aws_subnet.test.id}" + security_groups = ["${aws_security_group.test.id}"] +} + +resource "aws_launch_template" "test" { + name = "testacc-lt-%d" + image_id = "${data.aws_ami.test.id}" + + instance_market_options { + spot_options { + spot_instance_type = "persistent" + } + market_type="spot" + } + + network_interfaces { + device_index = 0 + delete_on_termination = true + network_interface_id = "${aws_network_interface.test.id}" + } + network_interfaces { + device_index = 1 + delete_on_termination = true + subnet_id = "${aws_subnet.test.id}" + } + +} + +resource "aws_ec2_fleet" "test" { + terminate_instances = true + + launch_template_config { + launch_template_specification { + launch_template_id = "${aws_launch_template.test.id}" + version = "${aws_launch_template.test.latest_version}" + } + # allow to choose from several instance types if there is no spot capacity for some type + override { + instance_type = "t2.micro" + } + override { + instance_type = "t3.micro" + } + override { + instance_type = "t3.small" + } + } + + target_capacity_specification { + default_target_capacity_type = "spot" + total_target_capacity = 1 + } +} +`, rInt, rInt) +} + +func testAccCheckAWSEc2FleetHistory(resourceName string, errorMsg string) resource.TestCheckFunc { + return func(s *terraform.State) error { + time.Sleep(time.Minute * 2) // We have to wait a bit for the history to get populated. + + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No EC2 Fleet ID is set") + } + + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + input := &ec2.DescribeFleetHistoryInput{ + FleetId: aws.String(rs.Primary.ID), + StartTime: aws.Time(time.Now().Add(time.Hour * -2)), + } + + output, err := conn.DescribeFleetHistory(input) + + if err != nil { + return err + } + + if output == nil { + return fmt.Errorf("EC2 Fleet history not found") + } + + if output.HistoryRecords == nil { + return fmt.Errorf("No fleet history records found for fleet %s", rs.Primary.ID) + } + + for _, record := range output.HistoryRecords { + if record == nil { + continue + } + if strings.Contains(aws.StringValue(record.EventInformation.EventDescription), errorMsg) { + return fmt.Errorf("Error %s found in fleet history event", errorMsg) + } + } + + return nil + } +} + func testAccCheckAWSEc2FleetExists(resourceName string, fleet *ec2.FleetData) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[resourceName] diff --git a/aws/resource_aws_ec2_traffic_mirror_filter.go b/aws/resource_aws_ec2_traffic_mirror_filter.go new file mode 100644 index 00000000000..f64163cc566 --- /dev/null +++ b/aws/resource_aws_ec2_traffic_mirror_filter.go @@ -0,0 +1,131 @@ +package aws + +import ( + "fmt" + "log" + + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func resourceAwsEc2TrafficMirrorFilter() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsEc2TrafficMirrorinFilterCreate, + Read: resourceAwsEc2TrafficMirrorFilterRead, + Update: resourceAwsEc2TrafficMirrorFilterUpdate, + Delete: resourceAwsEc2TrafficMirrorFilterDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "description": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "network_services": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{ + "amazon-dns", + }, false), + }, + }, + }, + } +} + +func resourceAwsEc2TrafficMirrorinFilterCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + input := &ec2.CreateTrafficMirrorFilterInput{} + + if description, ok := d.GetOk("description"); ok { + input.Description = aws.String(description.(string)) + } + + out, err := conn.CreateTrafficMirrorFilter(input) + if err != nil { + return fmt.Errorf("Error while creating traffic filter %s", err) + } + + d.SetId(*out.TrafficMirrorFilter.TrafficMirrorFilterId) + + return resourceAwsEc2TrafficMirrorFilterUpdate(d, meta) +} + +func resourceAwsEc2TrafficMirrorFilterUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + if d.HasChange("network_services") { + input := &ec2.ModifyTrafficMirrorFilterNetworkServicesInput{ + TrafficMirrorFilterId: aws.String(d.Id()), + } + + o, n := d.GetChange("network_services") + newServices := n.(*schema.Set).Difference(o.(*schema.Set)).List() + if len(newServices) > 0 { + input.AddNetworkServices = expandStringList(newServices) + } + + removeServices := o.(*schema.Set).Difference(n.(*schema.Set)).List() + if len(removeServices) > 0 { + input.RemoveNetworkServices = expandStringList(removeServices) + } + + _, err := conn.ModifyTrafficMirrorFilterNetworkServices(input) + if err != nil { + return fmt.Errorf("error modifying EC2 Traffic Mirror Filter (%s) network services: %w", d.Id(), err) + } + } + + return resourceAwsEc2TrafficMirrorFilterRead(d, meta) +} + +func resourceAwsEc2TrafficMirrorFilterRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + input := &ec2.DescribeTrafficMirrorFiltersInput{ + TrafficMirrorFilterIds: aws.StringSlice([]string{d.Id()}), + } + + out, err := conn.DescribeTrafficMirrorFilters(input) + if err != nil { + return fmt.Errorf("Error describing traffic mirror filter %v: %v", d.Id(), err) + } + + if len(out.TrafficMirrorFilters) == 0 { + log.Printf("[WARN] EC2 Traffic Mirror Filter (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + d.SetId(*out.TrafficMirrorFilters[0].TrafficMirrorFilterId) + d.Set("description", out.TrafficMirrorFilters[0].Description) + + if err := d.Set("network_services", aws.StringValueSlice(out.TrafficMirrorFilters[0].NetworkServices)); err != nil { + return fmt.Errorf("error setting network_services for filter %v: %s", d.Id(), err) + } + + return nil +} + +func resourceAwsEc2TrafficMirrorFilterDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + input := &ec2.DeleteTrafficMirrorFilterInput{ + TrafficMirrorFilterId: aws.String(d.Id()), + } + + _, err := conn.DeleteTrafficMirrorFilter(input) + if err != nil { + return fmt.Errorf("Error deleting traffic mirror filter %v: %v", d.Id(), err) + } + + return nil +} diff --git a/aws/resource_aws_ec2_traffic_mirror_filter_rule.go b/aws/resource_aws_ec2_traffic_mirror_filter_rule.go new file mode 100644 index 00000000000..792d054b307 --- /dev/null +++ b/aws/resource_aws_ec2_traffic_mirror_filter_rule.go @@ -0,0 +1,356 @@ +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-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" +) + +func resourceAwsEc2TrafficMirrorFilterRule() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsEc2TrafficMirrorFilterRuleCreate, + Read: resourceAwsEc2TrafficMirrorFilterRuleRead, + Update: resourceAwsEc2TrafficMirrorFilterRuleUpdate, + Delete: resourceAwsEc2TrafficMirrorFilterRuleDelete, + Importer: &schema.ResourceImporter{ + State: resourceAwsEc2TrafficMirrorFilterRuleImport, + }, + Schema: map[string]*schema.Schema{ + "description": { + Type: schema.TypeString, + Optional: true, + }, + "traffic_mirror_filter_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "destination_cidr_block": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validateCIDRNetworkAddress, + }, + "destination_port_range": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "from_port": { + Type: schema.TypeInt, + Optional: true, + }, + "to_port": { + Type: schema.TypeInt, + Optional: true, + }, + }, + }, + }, + "protocol": { + Type: schema.TypeInt, + Optional: true, + }, + "rule_action": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + ec2.TrafficMirrorRuleActionAccept, + ec2.TrafficMirrorRuleActionReject, + }, false), + }, + "rule_number": { + Type: schema.TypeInt, + Required: true, + }, + "source_cidr_block": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validateCIDRNetworkAddress, + }, + "source_port_range": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "from_port": { + Type: schema.TypeInt, + Optional: true, + }, + "to_port": { + Type: schema.TypeInt, + Optional: true, + }, + }, + }, + }, + "traffic_direction": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + ec2.TrafficDirectionIngress, + ec2.TrafficDirectionEgress, + }, false), + }, + }, + } +} + +func resourceAwsEc2TrafficMirrorFilterRuleCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + filterId := d.Get("traffic_mirror_filter_id") + + input := &ec2.CreateTrafficMirrorFilterRuleInput{ + TrafficMirrorFilterId: aws.String(filterId.(string)), + DestinationCidrBlock: aws.String(d.Get("destination_cidr_block").(string)), + SourceCidrBlock: aws.String(d.Get("source_cidr_block").(string)), + RuleAction: aws.String(d.Get("rule_action").(string)), + RuleNumber: aws.Int64(int64(d.Get("rule_number").(int))), + TrafficDirection: aws.String(d.Get("traffic_direction").(string)), + } + + if v, ok := d.GetOk("description"); ok { + input.Description = aws.String(v.(string)) + } + + if v, ok := d.GetOk("protocol"); ok { + input.Protocol = aws.Int64(int64(v.(int))) + } + + if v, ok := d.GetOk("destination_port_range"); ok { + input.DestinationPortRange = buildTrafficMirrorPortRangeRequest(v.([]interface{})) + } + + if v, ok := d.GetOk("source_port_range"); ok { + input.SourcePortRange = buildTrafficMirrorPortRangeRequest(v.([]interface{})) + } + + out, err := conn.CreateTrafficMirrorFilterRule(input) + if err != nil { + return fmt.Errorf("error creating EC2 Traffic Mirror Filter Rule (%s): %w", filterId, err) + } + + d.SetId(*out.TrafficMirrorFilterRule.TrafficMirrorFilterRuleId) + return resourceAwsEc2TrafficMirrorFilterRuleRead(d, meta) +} + +func resourceAwsEc2TrafficMirrorFilterRuleRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + ruleId := d.Id() + + var rule *ec2.TrafficMirrorFilterRule + filterId, filterIdSet := d.GetOk("traffic_mirror_filter_id") + input := &ec2.DescribeTrafficMirrorFiltersInput{} + if filterIdSet { + input.TrafficMirrorFilterIds = aws.StringSlice([]string{filterId.(string)}) + } + + err := conn.DescribeTrafficMirrorFiltersPages(input, func(page *ec2.DescribeTrafficMirrorFiltersOutput, lastPage bool) bool { + rule = findEc2TrafficMirrorFilterRule(ruleId, page.TrafficMirrorFilters) + return nil == rule + }) + + if err != nil { + return fmt.Errorf("Error while describing filters: %v", err) + } + + if nil == rule { + log.Printf("[WARN] EC2 Traffic Mirror Filter (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + d.SetId(*rule.TrafficMirrorFilterRuleId) + d.Set("traffic_mirror_filter_id", rule.TrafficMirrorFilterId) + d.Set("destination_cidr_block", rule.DestinationCidrBlock) + d.Set("source_cidr_block", rule.SourceCidrBlock) + d.Set("rule_action", rule.RuleAction) + d.Set("rule_number", rule.RuleNumber) + d.Set("traffic_direction", rule.TrafficDirection) + d.Set("description", rule.Description) + d.Set("protocol", rule.Protocol) + + if err := d.Set("destination_port_range", buildTrafficMirrorFilterRulePortRangeSchema(rule.DestinationPortRange)); err != nil { + return fmt.Errorf("error setting destination_port_range: %s", err) + } + + if err := d.Set("source_port_range", buildTrafficMirrorFilterRulePortRangeSchema(rule.SourcePortRange)); err != nil { + return fmt.Errorf("error setting source_port_range: %s", err) + } + + return nil +} + +func findEc2TrafficMirrorFilterRule(ruleId string, filters []*ec2.TrafficMirrorFilter) (rule *ec2.TrafficMirrorFilterRule) { + log.Printf("[DEBUG] searching %s in %d filters", ruleId, len(filters)) + for _, v := range filters { + log.Printf("[DEBUG]: searching filter %s, ingress rule count = %d, egress rule count = %d", *v.TrafficMirrorFilterId, len(v.IngressFilterRules), len(v.EgressFilterRules)) + for _, r := range v.IngressFilterRules { + if *r.TrafficMirrorFilterRuleId == ruleId { + rule = r + break + } + } + for _, r := range v.EgressFilterRules { + if *r.TrafficMirrorFilterRuleId == ruleId { + rule = r + break + } + } + } + + if nil != rule { + log.Printf("[DEBUG]: Found %s in %s", ruleId, *rule.TrafficDirection) + } + + return rule +} + +func resourceAwsEc2TrafficMirrorFilterRuleUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + ruleId := d.Id() + + input := &ec2.ModifyTrafficMirrorFilterRuleInput{ + TrafficMirrorFilterRuleId: &ruleId, + } + + var removeFields []*string + if d.HasChange("protocol") { + n := d.Get("protocol") + if n == "0" { + removeFields = append(removeFields, aws.String(ec2.TrafficMirrorFilterRuleFieldProtocol)) + } else { + input.Protocol = aws.Int64(int64(d.Get("protocol").(int))) + } + } + + if d.HasChange("description") { + n := d.Get("description") + if n != "" { + input.Description = aws.String(n.(string)) + } else { + removeFields = append(removeFields, aws.String(ec2.TrafficMirrorFilterRuleFieldDescription)) + } + } + + if d.HasChange("destination_cidr_block") { + input.DestinationCidrBlock = aws.String(d.Get("destination_cidr_block").(string)) + } + + if d.HasChange("source_cidr_block") { + input.SourceCidrBlock = aws.String(d.Get("source_cidr_block").(string)) + } + + if d.HasChange("destination_port_range") { + v := d.Get("destination_port_range") + n := v.([]interface{}) + if 0 == len(n) { + removeFields = append(removeFields, aws.String(ec2.TrafficMirrorFilterRuleFieldDestinationPortRange)) + } else { + //Modify request that adds port range seems to fail if protocol is not set in the request + input.Protocol = aws.Int64(int64(d.Get("protocol").(int))) + input.DestinationPortRange = buildTrafficMirrorPortRangeRequest(n) + } + } + + if d.HasChange("source_port_range") { + v := d.Get("source_port_range") + n := v.([]interface{}) + if 0 == len(n) { + removeFields = append(removeFields, aws.String(ec2.TrafficMirrorFilterRuleFieldSourcePortRange)) + } else { + //Modify request that adds port range seems to fail if protocol is not set in the request + input.Protocol = aws.Int64(int64(d.Get("protocol").(int))) + input.SourcePortRange = buildTrafficMirrorPortRangeRequest(n) + } + } + + if d.HasChange("rule_action") { + input.RuleAction = aws.String(d.Get("rule_action").(string)) + } + + if d.HasChange("rule_number") { + input.RuleNumber = aws.Int64(int64(d.Get("rule_action").(int))) + } + + if d.HasChange("traffic_direction") { + input.TrafficDirection = aws.String(d.Get("traffic_direction").(string)) + } + + if len(removeFields) > 0 { + input.SetRemoveFields(removeFields) + } + + _, err := conn.ModifyTrafficMirrorFilterRule(input) + if err != nil { + return fmt.Errorf("error modifying EC2 Traffic Mirror Filter Rule (%s): %w", ruleId, err) + } + + return resourceAwsEc2TrafficMirrorFilterRuleRead(d, meta) +} + +func resourceAwsEc2TrafficMirrorFilterRuleDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + ruleId := d.Id() + input := &ec2.DeleteTrafficMirrorFilterRuleInput{ + TrafficMirrorFilterRuleId: &ruleId, + } + + _, err := conn.DeleteTrafficMirrorFilterRule(input) + if err != nil { + return fmt.Errorf("error deleting EC2 Traffic Mirror Filter Rule (%s): %w", ruleId, err) + } + + return nil +} + +func buildTrafficMirrorPortRangeRequest(p []interface{}) (out *ec2.TrafficMirrorPortRangeRequest) { + portSchema := p[0].(map[string]interface{}) + + portRange := ec2.TrafficMirrorPortRangeRequest{} + if v, ok := portSchema["from_port"]; ok { + portRange.FromPort = aws.Int64(int64(v.(int))) + out = &portRange + } + + if v, ok := portSchema["to_port"]; ok { + portRange.ToPort = aws.Int64(int64(v.(int))) + out = &portRange + } + + return out +} + +func buildTrafficMirrorFilterRulePortRangeSchema(portRange *ec2.TrafficMirrorPortRange) interface{} { + if nil == portRange { + return nil + } + + var out [1]interface{} + elem := make(map[string]interface{}) + elem["from_port"] = portRange.FromPort + elem["to_port"] = portRange.ToPort + out[0] = elem + + return out +} + +func resourceAwsEc2TrafficMirrorFilterRuleImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + parts := strings.SplitN(d.Id(), ":", 2) + if len(parts) != 2 || parts[0] == "" || parts[1] == "" { + return nil, fmt.Errorf("unexpected format (%q), expected :", d.Id()) + } + + d.Set("traffic_mirror_filter_id", parts[0]) + d.SetId(parts[1]) + + return []*schema.ResourceData{d}, nil +} diff --git a/aws/resource_aws_ec2_traffic_mirror_filter_rule_test.go b/aws/resource_aws_ec2_traffic_mirror_filter_rule_test.go new file mode 100644 index 00000000000..cf5c6789f53 --- /dev/null +++ b/aws/resource_aws_ec2_traffic_mirror_filter_rule_test.go @@ -0,0 +1,261 @@ +package aws + +import ( + "fmt" + "regexp" + "strconv" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ec2" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func TestAccAWSEc2TrafficMirrorFilterRule_basic(t *testing.T) { + resourceName := "aws_ec2_traffic_mirror_filter_rule.rule" + dstCidr := "10.0.0.0/8" + srcCidr := "0.0.0.0/0" + ruleNum := 1 + action := "accept" + direction := "ingress" + description := "test rule" + protocol := 6 + srcPortFrom := 32000 + srcPortTo := 64000 + dstPortFrom := 10000 + dstPortTo := 10001 + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckAWSEc2TrafficMirrorFilterRule(t) + }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEc2TrafficMirrorFilterRuleDestroy, + Steps: []resource.TestStep{ + //create + { + Config: testAccEc2TrafficMirrorFilterRuleConfig(dstCidr, srcCidr, action, direction, ruleNum), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEc2TrafficMirrorFilterRuleExists(resourceName), + resource.TestMatchResourceAttr(resourceName, "traffic_mirror_filter_id", regexp.MustCompile("tmf-.*")), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", dstCidr), + resource.TestCheckResourceAttr(resourceName, "rule_action", action), + resource.TestCheckResourceAttr(resourceName, "rule_number", strconv.Itoa(ruleNum)), + resource.TestCheckResourceAttr(resourceName, "source_cidr_block", srcCidr), + resource.TestCheckResourceAttr(resourceName, "traffic_direction", direction), + resource.TestCheckResourceAttr(resourceName, "description", ""), + resource.TestCheckNoResourceAttr(resourceName, "destination_port_range"), + resource.TestCheckResourceAttr(resourceName, "protocol", "0"), + resource.TestCheckNoResourceAttr(resourceName, "source_port_range"), + ), + }, + // Add all optionals + { + Config: testAccEc2TrafficMirrorFilterRuleConfigFull(dstCidr, srcCidr, action, direction, description, ruleNum, srcPortFrom, srcPortTo, dstPortFrom, dstPortTo, protocol), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEc2TrafficMirrorFilterRuleExists(resourceName), + resource.TestMatchResourceAttr(resourceName, "traffic_mirror_filter_id", regexp.MustCompile("tmf-.*")), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", dstCidr), + resource.TestCheckResourceAttr(resourceName, "rule_action", action), + resource.TestCheckResourceAttr(resourceName, "rule_number", strconv.Itoa(ruleNum)), + resource.TestCheckResourceAttr(resourceName, "source_cidr_block", srcCidr), + resource.TestCheckResourceAttr(resourceName, "traffic_direction", direction), + resource.TestCheckResourceAttr(resourceName, "description", description), + resource.TestCheckResourceAttr(resourceName, "destination_port_range.#", "1"), + resource.TestCheckResourceAttr(resourceName, "destination_port_range.0.from_port", strconv.Itoa(dstPortFrom)), + resource.TestCheckResourceAttr(resourceName, "destination_port_range.0.to_port", strconv.Itoa(dstPortTo)), + resource.TestCheckResourceAttr(resourceName, "source_port_range.#", "1"), + resource.TestCheckResourceAttr(resourceName, "source_port_range.0.from_port", strconv.Itoa(srcPortFrom)), + resource.TestCheckResourceAttr(resourceName, "source_port_range.0.to_port", strconv.Itoa(srcPortTo)), + resource.TestCheckResourceAttr(resourceName, "protocol", strconv.Itoa(protocol)), + ), + }, + // remove optionals + { + Config: testAccEc2TrafficMirrorFilterRuleConfig(dstCidr, srcCidr, action, direction, ruleNum), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEc2TrafficMirrorFilterRuleExists(resourceName), + resource.TestMatchResourceAttr(resourceName, "traffic_mirror_filter_id", regexp.MustCompile("tmf-.*")), + resource.TestCheckResourceAttr(resourceName, "destination_cidr_block", dstCidr), + resource.TestCheckResourceAttr(resourceName, "rule_action", action), + resource.TestCheckResourceAttr(resourceName, "rule_number", strconv.Itoa(ruleNum)), + resource.TestCheckResourceAttr(resourceName, "source_cidr_block", srcCidr), + resource.TestCheckResourceAttr(resourceName, "traffic_direction", direction), + resource.TestCheckResourceAttr(resourceName, "description", ""), + resource.TestCheckResourceAttr(resourceName, "destination_port_range.#", "0"), + resource.TestCheckResourceAttr(resourceName, "protocol", "0"), + resource.TestCheckResourceAttr(resourceName, "source_port_range.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEc2TrafficMirrorFilterRuleImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckAWSEc2TrafficMirrorFilterRuleExists(name string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[name] + if !ok { + return fmt.Errorf("Not found: %s", name) + } + if rs.Primary.ID == "" { + return fmt.Errorf("No ID set for %s", name) + } + + ruleId := rs.Primary.ID + filterId := rs.Primary.Attributes["traffic_mirror_filter_id"] + + conn := testAccProvider.Meta().(*AWSClient).ec2conn + out, err := conn.DescribeTrafficMirrorFilters(&ec2.DescribeTrafficMirrorFiltersInput{ + TrafficMirrorFilterIds: []*string{ + aws.String(filterId), + }, + }) + + if err != nil { + return err + } + + if 0 == len(out.TrafficMirrorFilters) { + return fmt.Errorf("Traffic mirror filter %s not found", rs.Primary.ID) + } + + filter := out.TrafficMirrorFilters[0] + var ruleList []*ec2.TrafficMirrorFilterRule + ruleList = append(ruleList, filter.IngressFilterRules...) + ruleList = append(ruleList, filter.EgressFilterRules...) + + var exists bool + for _, rule := range ruleList { + if *rule.TrafficMirrorFilterRuleId == ruleId { + exists = true + break + } + } + + if !exists { + return fmt.Errorf("Rule %s not found inside filter %s", ruleId, filterId) + } + + return nil + } +} + +func testAccEc2TrafficMirrorFilterRuleConfig(dstCidr, srcCidr, action, dir string, num int) string { + return fmt.Sprintf(` +resource "aws_ec2_traffic_mirror_filter" "filter" { +} + +resource "aws_ec2_traffic_mirror_filter_rule" "rule" { + traffic_mirror_filter_id = "${aws_ec2_traffic_mirror_filter.filter.id}" + destination_cidr_block = "%s" + rule_action = "%s" + rule_number = %d + source_cidr_block = "%s" + traffic_direction = "%s" +} +`, dstCidr, action, num, srcCidr, dir) +} + +func testAccEc2TrafficMirrorFilterRuleConfigFull(dstCidr, srcCidr, action, dir, description string, ruleNum, srcPortFrom, srcPortTo, dstPortFrom, dstPortTo, protocol int) string { + return fmt.Sprintf(` +resource "aws_ec2_traffic_mirror_filter" "filter" { +} + +resource "aws_ec2_traffic_mirror_filter_rule" "rule" { + traffic_mirror_filter_id = "${aws_ec2_traffic_mirror_filter.filter.id}" + destination_cidr_block = "%s" + rule_action = "%s" + rule_number = %d + source_cidr_block = "%s" + traffic_direction = "%s" + description = "%s" + protocol = %d + source_port_range { + from_port = %d + to_port = %d + } + destination_port_range { + from_port = %d + to_port = %d + } +} +`, dstCidr, action, ruleNum, srcCidr, dir, description, protocol, srcPortFrom, srcPortTo, dstPortFrom, dstPortTo) +} + +func testAccPreCheckAWSEc2TrafficMirrorFilterRule(t *testing.T) { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + _, err := conn.DescribeTrafficMirrorFilters(&ec2.DescribeTrafficMirrorFiltersInput{}) + + if testAccPreCheckSkipError(err) { + t.Skip("skipping traffic mirror filter rule acceprance test: ", err) + } + + if err != nil { + t.Fatal("Unexpected PreCheck error: ", err) + } +} + +func testAccCheckAWSEc2TrafficMirrorFilterRuleDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_ec2_traffic_mirror_filter_rule" { + continue + } + + ruleId := rs.Primary.ID + filterId := rs.Primary.Attributes["traffic_mirror_filter_id"] + + out, err := conn.DescribeTrafficMirrorFilters(&ec2.DescribeTrafficMirrorFiltersInput{ + TrafficMirrorFilterIds: []*string{ + aws.String(filterId), + }, + }) + + if isAWSErr(err, "InvalidTrafficMirrorFilterId.NotFound", "") { + continue + } + + if err != nil { + return err + } + + if 0 == len(out.TrafficMirrorFilters) { + return nil + } + + filter := out.TrafficMirrorFilters[0] + var ruleList []*ec2.TrafficMirrorFilterRule + ruleList = append(ruleList, filter.IngressFilterRules...) + ruleList = append(ruleList, filter.EgressFilterRules...) + + for _, rule := range ruleList { + if *rule.TrafficMirrorFilterRuleId == ruleId { + return fmt.Errorf("Rule %s still exists in filter %s", ruleId, filterId) + } + } + } + + return nil +} + +func testAccAWSEc2TrafficMirrorFilterRuleImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return "", fmt.Errorf("Not found: %s", resourceName) + } + + return fmt.Sprintf("%s:%s", rs.Primary.Attributes["traffic_mirror_filter_id"], rs.Primary.ID), nil + } +} diff --git a/aws/resource_aws_ec2_traffic_mirror_filter_test.go b/aws/resource_aws_ec2_traffic_mirror_filter_test.go new file mode 100644 index 00000000000..bf7604ced6d --- /dev/null +++ b/aws/resource_aws_ec2_traffic_mirror_filter_test.go @@ -0,0 +1,150 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ec2" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func TestAccAWSEc2TrafficMirrorFilter_basic(t *testing.T) { + resourceName := "aws_ec2_traffic_mirror_filter.filter" + description := "test filter" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckAWSEc2TrafficMirrorFilter(t) + }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEc2TrafficMirrorFilterDestroy, + Steps: []resource.TestStep{ + //create + { + Config: testAccTrafficMirrorFilterConfig(description), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEc2TrafficMirrorFilterExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "description", description), + resource.TestCheckResourceAttr(resourceName, "network_services.#", "1"), + ), + }, + // Test Disable DNS service + { + Config: testAccTrafficMirrorFilterConfigWithoutDNS(description), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEc2TrafficMirrorFilterExists(resourceName), + resource.TestCheckNoResourceAttr(resourceName, "network_services"), + ), + }, + // Test Enable DNS service + { + Config: testAccTrafficMirrorFilterConfig(description), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEc2TrafficMirrorFilterExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "description", description), + resource.TestCheckResourceAttr(resourceName, "network_services.#", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckAWSEc2TrafficMirrorFilterExists(name string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[name] + if !ok { + return fmt.Errorf("Not found: %s", name) + } + if rs.Primary.ID == "" { + return fmt.Errorf("No ID set for %s", name) + } + + conn := testAccProvider.Meta().(*AWSClient).ec2conn + out, err := conn.DescribeTrafficMirrorFilters(&ec2.DescribeTrafficMirrorFiltersInput{ + TrafficMirrorFilterIds: []*string{ + aws.String(rs.Primary.ID), + }, + }) + + if err != nil { + return err + } + + if 0 == len(out.TrafficMirrorFilters) { + return fmt.Errorf("Traffic mirror filter %s not found", rs.Primary.ID) + } + + return nil + } +} + +func testAccTrafficMirrorFilterConfig(description string) string { + return fmt.Sprintf(` +resource "aws_ec2_traffic_mirror_filter" "filter" { + description = "%s" + + network_services = ["amazon-dns"] +} +`, description) +} + +func testAccTrafficMirrorFilterConfigWithoutDNS(description string) string { + return fmt.Sprintf(` +resource "aws_ec2_traffic_mirror_filter" "filter" { + description = "%s" +} +`, description) +} + +func testAccPreCheckAWSEc2TrafficMirrorFilter(t *testing.T) { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + _, err := conn.DescribeTrafficMirrorFilters(&ec2.DescribeTrafficMirrorFiltersInput{}) + + if testAccPreCheckSkipError(err) { + t.Skip("skipping traffic mirror filter acceprance test: ", err) + } + + if err != nil { + t.Fatal("Unexpected PreCheck error: ", err) + } +} + +func testAccCheckAWSEc2TrafficMirrorFilterDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_ec2_traffic_mirror_filter" { + continue + } + + out, err := conn.DescribeTrafficMirrorFilters(&ec2.DescribeTrafficMirrorFiltersInput{ + TrafficMirrorFilterIds: []*string{ + aws.String(rs.Primary.ID), + }, + }) + + if isAWSErr(err, "InvalidTrafficMirrorFilterId.NotFound", "") { + continue + } + + if err != nil { + return err + } + + if len(out.TrafficMirrorFilters) != 0 { + return fmt.Errorf("Traffic mirror filter %s still not destroyed", rs.Primary.ID) + } + } + + return nil +} diff --git a/aws/resource_aws_ec2_traffic_mirror_session.go b/aws/resource_aws_ec2_traffic_mirror_session.go new file mode 100644 index 00000000000..c9d69f9f233 --- /dev/null +++ b/aws/resource_aws_ec2_traffic_mirror_session.go @@ -0,0 +1,206 @@ +package aws + +import ( + "fmt" + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" +) + +func resourceAwsEc2TrafficMirrorSession() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsEc2TrafficMirrorSessionCreate, + Update: resourceAwsEc2TrafficMirrorSessionUpdate, + Read: resourceAwsEc2TrafficMirrorSessionRead, + Delete: resourceAwsEc2TrafficMirrorSessionDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "description": { + Type: schema.TypeString, + Optional: true, + }, + "network_interface_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "packet_length": { + Type: schema.TypeInt, + Optional: true, + }, + "session_number": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntBetween(1, 32766), + }, + "traffic_mirror_filter_id": { + Type: schema.TypeString, + Required: true, + }, + "traffic_mirror_target_id": { + Type: schema.TypeString, + Required: true, + }, + "virtual_network_id": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + ValidateFunc: validation.IntBetween(1, 16777216), + }, + }, + } +} + +func resourceAwsEc2TrafficMirrorSessionCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + input := &ec2.CreateTrafficMirrorSessionInput{ + NetworkInterfaceId: aws.String(d.Get("network_interface_id").(string)), + TrafficMirrorFilterId: aws.String(d.Get("traffic_mirror_filter_id").(string)), + TrafficMirrorTargetId: aws.String(d.Get("traffic_mirror_target_id").(string)), + } + + if v, ok := d.GetOk("description"); ok { + input.Description = aws.String(v.(string)) + } + + if v, ok := d.GetOk("packet_length"); ok { + input.PacketLength = aws.Int64(int64(v.(int))) + } + + if v, ok := d.GetOk("session_number"); ok { + input.SessionNumber = aws.Int64(int64(v.(int))) + } + + if v, ok := d.GetOk("virtual_network_id"); ok { + input.VirtualNetworkId = aws.Int64(int64(v.(int))) + } + + out, err := conn.CreateTrafficMirrorSession(input) + if nil != err { + return fmt.Errorf("Error creating traffic mirror session %v", err) + } + + d.SetId(*out.TrafficMirrorSession.TrafficMirrorSessionId) + return resourceAwsEc2TrafficMirrorSessionRead(d, meta) +} + +func resourceAwsEc2TrafficMirrorSessionUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + sessionId := d.Id() + input := &ec2.ModifyTrafficMirrorSessionInput{ + TrafficMirrorSessionId: &sessionId, + } + + if d.HasChange("session_number") { + n := d.Get("session_number") + input.SessionNumber = aws.Int64(int64(n.(int))) + } + + if d.HasChange("traffic_mirror_filter_id") { + n := d.Get("traffic_mirror_filter_id") + input.TrafficMirrorFilterId = aws.String(n.(string)) + } + + if d.HasChange("traffic_mirror_target_id") { + n := d.Get("traffic_mirror_target_id") + input.TrafficMirrorTargetId = aws.String(n.(string)) + } + + var removeFields []*string + if d.HasChange("description") { + n := d.Get("description") + if "" != n { + input.Description = aws.String(n.(string)) + } else { + removeFields = append(removeFields, aws.String("description")) + } + } + + if d.HasChange("packet_length") { + n := d.Get("packet_length") + if nil != n && n.(int) > 0 { + input.PacketLength = aws.Int64(int64(n.(int))) + } else { + removeFields = append(removeFields, aws.String("packet-length")) + } + } + log.Printf("[DEBUG] removeFields %v", removeFields) + + if d.HasChange("virtual_network_id") { + n := d.Get("virtual_network_id") + log.Printf("[DEBUG] VNI has change %v", n) + if nil != n && n.(int) > 0 { + input.VirtualNetworkId = aws.Int64(int64(n.(int))) + } else { + removeFields = append(removeFields, aws.String("virtual-network-id")) + } + } + + log.Printf("[DEBUG] removeFields %v", removeFields) + if len(removeFields) > 0 { + input.SetRemoveFields(removeFields) + } + + _, err := conn.ModifyTrafficMirrorSession(input) + if nil != err { + return fmt.Errorf("Error updating traffic mirror session %v", err) + } + + return resourceAwsEc2TrafficMirrorSessionRead(d, meta) +} + +func resourceAwsEc2TrafficMirrorSessionRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + sessionId := d.Id() + input := &ec2.DescribeTrafficMirrorSessionsInput{ + TrafficMirrorSessionIds: []*string{ + &sessionId, + }, + } + + out, err := conn.DescribeTrafficMirrorSessions(input) + if nil != err { + return fmt.Errorf("error describing EC2 Traffic Mirror Session (%s): %w", sessionId, err) + } + + if 0 == len(out.TrafficMirrorSessions) { + log.Printf("[WARN] EC2 Traffic Mirror Session (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + session := out.TrafficMirrorSessions[0] + d.Set("network_interface_id", session.NetworkInterfaceId) + d.Set("session_number", session.SessionNumber) + d.Set("traffic_mirror_filter_id", session.TrafficMirrorFilterId) + d.Set("traffic_mirror_target_id", session.TrafficMirrorTargetId) + d.Set("description", session.Description) + d.Set("packet_length", session.PacketLength) + d.Set("virtual_network_id", session.VirtualNetworkId) + + return nil +} + +func resourceAwsEc2TrafficMirrorSessionDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + sessionId := d.Id() + input := &ec2.DeleteTrafficMirrorSessionInput{ + TrafficMirrorSessionId: &sessionId, + } + + _, err := conn.DeleteTrafficMirrorSession(input) + if nil != err { + return fmt.Errorf("error deleting EC2 Traffic Mirror Session (%s): %w", sessionId, err) + } + + return nil +} diff --git a/aws/resource_aws_ec2_traffic_mirror_session_test.go b/aws/resource_aws_ec2_traffic_mirror_session_test.go new file mode 100644 index 00000000000..3ded7fea1dd --- /dev/null +++ b/aws/resource_aws_ec2_traffic_mirror_session_test.go @@ -0,0 +1,244 @@ +package aws + +import ( + "fmt" + "regexp" + "strconv" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ec2" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func TestAccAWSEc2TrafficMirrorSession_basic(t *testing.T) { + resourceName := "aws_ec2_traffic_mirror_session.session" + description := "test session" + session := acctest.RandIntRange(1, 32766) + lbName := acctest.RandString(31) + pLen := acctest.RandIntRange(1, 255) + vni := acctest.RandIntRange(1, 16777216) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckAWSEc2TrafficMirrorSession(t) + }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEc2TrafficMirrorSessionDestroy, + Steps: []resource.TestStep{ + //create + { + Config: testAccTrafficMirrorSessionConfig(lbName, session), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEc2TrafficMirrorSessionExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "description", ""), + resource.TestCheckResourceAttr(resourceName, "packet_length", "0"), + resource.TestCheckResourceAttr(resourceName, "session_number", strconv.Itoa(session)), + resource.TestMatchResourceAttr(resourceName, "virtual_network_id", regexp.MustCompile(`\d+`)), + ), + }, + // update of description, packet length and VNI + { + Config: testAccTrafficMirrorSessionConfigWithOptionals(description, lbName, session, pLen, vni), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEc2TrafficMirrorSessionExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "description", description), + resource.TestCheckResourceAttr(resourceName, "packet_length", strconv.Itoa(pLen)), + resource.TestCheckResourceAttr(resourceName, "session_number", strconv.Itoa(session)), + resource.TestCheckResourceAttr(resourceName, "virtual_network_id", strconv.Itoa(vni)), + ), + }, + // removal of description, packet length and VNI + { + Config: testAccTrafficMirrorSessionConfig(lbName, session), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEc2TrafficMirrorSessionExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "description", ""), + resource.TestCheckResourceAttr(resourceName, "packet_length", "0"), + resource.TestCheckResourceAttr(resourceName, "session_number", strconv.Itoa(session)), + resource.TestMatchResourceAttr(resourceName, "virtual_network_id", regexp.MustCompile(`\d+`)), + ), + }, + // import test without VNI + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckAWSEc2TrafficMirrorSessionExists(name string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[name] + if !ok { + return fmt.Errorf("Not found: %s", name) + } + if rs.Primary.ID == "" { + return fmt.Errorf("No ID set for %s", name) + } + + conn := testAccProvider.Meta().(*AWSClient).ec2conn + out, err := conn.DescribeTrafficMirrorSessions(&ec2.DescribeTrafficMirrorSessionsInput{ + TrafficMirrorSessionIds: []*string{ + aws.String(rs.Primary.ID), + }, + }) + + if err != nil { + return err + } + + if 0 == len(out.TrafficMirrorSessions) { + return fmt.Errorf("Traffic mirror session %s not found", rs.Primary.ID) + } + + return nil + } +} + +func testAccTrafficMirrorSessionConfigBase(lbName string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "azs" { + state = "available" +} + +data "aws_ami" "amzn-linux" { + most_recent = true + + filter { + name = "name" + values = ["amzn2-ami-hvm-2.0*"] + } + + filter { + name = "architecture" + values = ["x86_64"] + } + + owners = ["137112412989"] +} + +resource "aws_vpc" "vpc" { + cidr_block = "10.0.0.0/16" +} + +resource "aws_subnet" "sub1" { + vpc_id = "${aws_vpc.vpc.id}" + cidr_block = "10.0.0.0/24" + availability_zone = "${data.aws_availability_zones.azs.names[0]}" +} + +resource "aws_subnet" "sub2" { + vpc_id = "${aws_vpc.vpc.id}" + cidr_block = "10.0.1.0/24" + availability_zone = "${data.aws_availability_zones.azs.names[1]}" +} + +resource "aws_instance" "src" { + ami = "${data.aws_ami.amzn-linux.id}" + instance_type = "m5.large" # m5.large required because only Nitro instances support mirroring + subnet_id = "${aws_subnet.sub1.id}" +} + +resource "aws_lb" "lb" { + name = "%s" + internal = true + load_balancer_type = "network" + subnets = ["${aws_subnet.sub1.id}", "${aws_subnet.sub2.id}"] + + enable_deletion_protection = false + + tags = { + Environment = "production" + } +} + +resource "aws_ec2_traffic_mirror_filter" "filter" { +} + +resource "aws_ec2_traffic_mirror_target" "target" { + network_load_balancer_arn = "${aws_lb.lb.arn}" +} + +`, lbName) +} + +func testAccTrafficMirrorSessionConfig(lbName string, session int) string { + return fmt.Sprintf(` +%s + +resource "aws_ec2_traffic_mirror_session" "session" { + traffic_mirror_filter_id = "${aws_ec2_traffic_mirror_filter.filter.id}" + traffic_mirror_target_id = "${aws_ec2_traffic_mirror_target.target.id}" + network_interface_id = "${aws_instance.src.primary_network_interface_id}" + session_number = %d +} +`, testAccTrafficMirrorSessionConfigBase(lbName), session) +} + +func testAccTrafficMirrorSessionConfigWithOptionals(description string, lbName string, session, pLen, vni int) string { + return fmt.Sprintf(` +%s + +resource "aws_ec2_traffic_mirror_session" "session" { + description = "%s" + traffic_mirror_filter_id = "${aws_ec2_traffic_mirror_filter.filter.id}" + traffic_mirror_target_id = "${aws_ec2_traffic_mirror_target.target.id}" + network_interface_id = "${aws_instance.src.primary_network_interface_id}" + session_number = %d + packet_length = %d + virtual_network_id = %d +} +`, testAccTrafficMirrorSessionConfigBase(lbName), description, session, pLen, vni) +} + +func testAccPreCheckAWSEc2TrafficMirrorSession(t *testing.T) { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + _, err := conn.DescribeTrafficMirrorSessions(&ec2.DescribeTrafficMirrorSessionsInput{}) + + if testAccPreCheckSkipError(err) { + t.Skip("skipping traffic mirror sessions acceprance test: ", err) + } + + if err != nil { + t.Fatal("Unexpected PreCheck error: ", err) + } +} + +func testAccCheckAWSEc2TrafficMirrorSessionDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_ec2_traffic_mirror_session" { + continue + } + + out, err := conn.DescribeTrafficMirrorSessions(&ec2.DescribeTrafficMirrorSessionsInput{ + TrafficMirrorSessionIds: []*string{ + aws.String(rs.Primary.ID), + }, + }) + + if isAWSErr(err, "InvalidTrafficMirrorSessionId.NotFound", "") { + continue + } + + if err != nil { + return err + } + + if len(out.TrafficMirrorSessions) != 0 { + return fmt.Errorf("Traffic mirror session %s still not destroyed", rs.Primary.ID) + } + } + + return nil +} diff --git a/aws/resource_aws_ec2_traffic_mirror_target.go b/aws/resource_aws_ec2_traffic_mirror_target.go new file mode 100644 index 00000000000..3d44f95490b --- /dev/null +++ b/aws/resource_aws_ec2_traffic_mirror_target.go @@ -0,0 +1,121 @@ +package aws + +import ( + "fmt" + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func resourceAwsEc2TrafficMirrorTarget() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsEc2TrafficMirrorTargetCreate, + Read: resourceAwsEc2TrafficMirrorTargetRead, + Delete: resourceAwsEc2TrafficMirrorTargetDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "description": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "network_interface_id": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ExactlyOneOf: []string{ + "network_interface_id", + "network_load_balancer_arn", + }, + }, + "network_load_balancer_arn": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ExactlyOneOf: []string{ + "network_interface_id", + "network_load_balancer_arn", + }, + }, + }, + } +} + +func resourceAwsEc2TrafficMirrorTargetCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + input := &ec2.CreateTrafficMirrorTargetInput{} + if v, ok := d.GetOk("description"); ok { + input.Description = aws.String(v.(string)) + } + + if v, ok := d.GetOk("network_interface_id"); ok { + input.NetworkInterfaceId = aws.String(v.(string)) + } + + if v, ok := d.GetOk("network_load_balancer_arn"); ok { + input.NetworkLoadBalancerArn = aws.String(v.(string)) + } + + out, err := conn.CreateTrafficMirrorTarget(input) + if err != nil { + return fmt.Errorf("Error creating traffic mirror target %v", err) + } + + d.SetId(*out.TrafficMirrorTarget.TrafficMirrorTargetId) + + return resourceAwsEc2TrafficMirrorTargetRead(d, meta) +} + +func resourceAwsEc2TrafficMirrorTargetRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + targetId := d.Id() + input := &ec2.DescribeTrafficMirrorTargetsInput{ + TrafficMirrorTargetIds: []*string{&targetId}, + } + + out, err := conn.DescribeTrafficMirrorTargets(input) + if isAWSErr(err, "InvalidTrafficMirrorTargetId.NotFound", "") { + log.Printf("[WARN] EC2 Traffic Mirror Target (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + if err != nil { + return fmt.Errorf("error describing EC2 Traffic Mirror Target (%s): %w", targetId, err) + } + + if nil == out || 0 == len(out.TrafficMirrorTargets) { + log.Printf("[WARN] EC2 Traffic Mirror Target (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + target := out.TrafficMirrorTargets[0] + d.Set("description", target.Description) + d.Set("network_interface_id", target.NetworkInterfaceId) + d.Set("network_load_balancer_arn", target.NetworkLoadBalancerArn) + + return nil +} + +func resourceAwsEc2TrafficMirrorTargetDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + targetId := d.Id() + input := &ec2.DeleteTrafficMirrorTargetInput{ + TrafficMirrorTargetId: &targetId, + } + + _, err := conn.DeleteTrafficMirrorTarget(input) + if nil != err { + return fmt.Errorf("error deleting EC2 Traffic Mirror Target (%s): %w", targetId, err) + } + + return nil +} diff --git a/aws/resource_aws_ec2_traffic_mirror_target_test.go b/aws/resource_aws_ec2_traffic_mirror_target_test.go new file mode 100644 index 00000000000..6fad7456d0c --- /dev/null +++ b/aws/resource_aws_ec2_traffic_mirror_target_test.go @@ -0,0 +1,242 @@ +package aws + +import ( + "fmt" + "regexp" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ec2" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func TestAccAWSEc2TrafficMirrorTarget_nlb(t *testing.T) { + resourceName := "aws_ec2_traffic_mirror_target.target" + description := "test nlb target" + lbName := acctest.RandString(32) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckAWSEc2TrafficMirrorTarget(t) + }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEc2TrafficMirrorTargetDestroy, + Steps: []resource.TestStep{ + //create + { + Config: testAccTrafficMirrorTargetConfigNlb(description, lbName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEc2TrafficMirrorTargetExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "description", description), + resource.TestMatchResourceAttr(resourceName, "network_load_balancer_arn", regexp.MustCompile("arn:aws:elasticloadbalancing:.*")), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEc2TrafficMirrorTarget_eni(t *testing.T) { + resourceName := "aws_ec2_traffic_mirror_target.target" + description := "test eni target" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckAWSEc2TrafficMirrorTarget(t) + }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEc2TrafficMirrorTargetDestroy, + Steps: []resource.TestStep{ + //create + { + Config: testAccTrafficMirrorTargetConfigEni(description), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEc2TrafficMirrorTargetExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "description", description), + resource.TestMatchResourceAttr(resourceName, "network_interface_id", regexp.MustCompile("eni-.*")), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckAWSEc2TrafficMirrorTargetExists(name string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[name] + if !ok { + return fmt.Errorf("Not found: %s", name) + } + if rs.Primary.ID == "" { + return fmt.Errorf("No ID set for %s", name) + } + + conn := testAccProvider.Meta().(*AWSClient).ec2conn + out, err := conn.DescribeTrafficMirrorTargets(&ec2.DescribeTrafficMirrorTargetsInput{ + TrafficMirrorTargetIds: []*string{ + aws.String(rs.Primary.ID), + }, + }) + + if err != nil { + return err + } + + if 0 == len(out.TrafficMirrorTargets) { + return fmt.Errorf("Traffic mirror target %s not found", rs.Primary.ID) + } + + return nil + } +} + +func testAccTrafficMirrorTargetConfigNlb(description string, lbName string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "azs" { + state = "available" +} + +resource "aws_vpc" "vpc" { + cidr_block = "10.0.0.0/16" +} + +resource "aws_subnet" "sub1" { + vpc_id = "${aws_vpc.vpc.id}" + cidr_block = "10.0.0.0/24" + availability_zone = "${data.aws_availability_zones.azs.names[0]}" +} + +resource "aws_subnet" "sub2" { + vpc_id = "${aws_vpc.vpc.id}" + cidr_block = "10.0.1.0/24" + availability_zone = "${data.aws_availability_zones.azs.names[1]}" +} + +resource "aws_lb" "lb" { + name = "%s" + internal = true + load_balancer_type = "network" + subnets = ["${aws_subnet.sub1.id}", "${aws_subnet.sub2.id}"] + + enable_deletion_protection = false + + tags = { + Environment = "production" + } +} + +resource "aws_ec2_traffic_mirror_target" "target" { + description = "%s" + network_load_balancer_arn = "${aws_lb.lb.arn}" +} +`, lbName, description) +} + +func testAccTrafficMirrorTargetConfigEni(description string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "azs" { + state = "available" +} + +data "aws_ami" "amzn-linux" { + most_recent = true + + filter { + name = "name" + values = ["amzn2-ami-hvm-2.0*"] + } + + filter { + name = "architecture" + values = ["x86_64"] + } + + owners = ["137112412989"] +} + +resource "aws_vpc" "vpc" { + cidr_block = "10.0.0.0/16" +} + +resource "aws_subnet" "sub1" { + vpc_id = "${aws_vpc.vpc.id}" + cidr_block = "10.0.0.0/24" + availability_zone = "${data.aws_availability_zones.azs.names[0]}" +} + +resource "aws_subnet" "sub2" { + vpc_id = "${aws_vpc.vpc.id}" + cidr_block = "10.0.1.0/24" + availability_zone = "${data.aws_availability_zones.azs.names[1]}" +} + +resource "aws_instance" "src" { + ami = "${data.aws_ami.amzn-linux.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.sub1.id}" +} + +resource "aws_ec2_traffic_mirror_target" "target" { + description = "%s" + network_interface_id = "${aws_instance.src.primary_network_interface_id}" +} +`, description) +} + +func testAccPreCheckAWSEc2TrafficMirrorTarget(t *testing.T) { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + _, err := conn.DescribeTrafficMirrorTargets(&ec2.DescribeTrafficMirrorTargetsInput{}) + + if testAccPreCheckSkipError(err) { + t.Skip("skipping traffic mirror target acceprance test: ", err) + } + + if err != nil { + t.Fatal("Unexpected PreCheck error: ", err) + } +} + +func testAccCheckAWSEc2TrafficMirrorTargetDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_ec2_traffic_mirror_target" { + continue + } + + out, err := conn.DescribeTrafficMirrorTargets(&ec2.DescribeTrafficMirrorTargetsInput{ + TrafficMirrorTargetIds: []*string{ + aws.String(rs.Primary.ID), + }, + }) + + if isAWSErr(err, "InvalidTrafficMirrorTargetId.NotFound", "") { + continue + } + + if err != nil { + return err + } + + if len(out.TrafficMirrorTargets) != 0 { + return fmt.Errorf("Traffic mirror target %s still not destroyed", rs.Primary.ID) + } + } + + return nil +} diff --git a/aws/resource_aws_ec2_transit_gateway.go b/aws/resource_aws_ec2_transit_gateway.go index 45e5b275676..d3d61582b0b 100644 --- a/aws/resource_aws_ec2_transit_gateway.go +++ b/aws/resource_aws_ec2_transit_gateway.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsEc2TransitGateway() *schema.Resource { @@ -90,11 +91,7 @@ func resourceAwsEc2TransitGateway() *schema.Resource { Type: schema.TypeString, Computed: true, }, - "tags": { - Type: schema.TypeMap, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, + "tags": tagsSchema(), "vpn_ecmp_support": { Type: schema.TypeString, Optional: true, @@ -120,7 +117,7 @@ func resourceAwsEc2TransitGatewayCreate(d *schema.ResourceData, meta interface{} DnsSupport: aws.String(d.Get("dns_support").(string)), VpnEcmpSupport: aws.String(d.Get("vpn_ecmp_support").(string)), }, - TagSpecifications: expandEc2TransitGatewayTagSpecifications(d.Get("tags").(map[string]interface{})), + TagSpecifications: ec2TagSpecificationsFromMap(d.Get("tags").(map[string]interface{}), ec2.ResourceTypeTransitGateway), } if v, ok := d.GetOk("amazon_side_asn"); ok { @@ -188,7 +185,7 @@ func resourceAwsEc2TransitGatewayRead(d *schema.ResourceData, meta interface{}) d.Set("owner_id", transitGateway.OwnerId) d.Set("propagation_default_route_table_id", transitGateway.Options.PropagationDefaultRouteTableId) - if err := d.Set("tags", tagsToMap(transitGateway.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(transitGateway.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -200,8 +197,12 @@ func resourceAwsEc2TransitGatewayRead(d *schema.ResourceData, meta interface{}) func resourceAwsEc2TransitGatewayUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - if err := setTags(conn, d); err != nil { - return fmt.Errorf("error updating EC2 Transit Gateway (%s) tags: %s", d.Id(), err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating EC2 Transit Gateway (%s) tags: %s", d.Id(), err) + } } return nil diff --git a/aws/resource_aws_ec2_transit_gateway_route_table.go b/aws/resource_aws_ec2_transit_gateway_route_table.go index 3d7eb158db1..5b20ae467c1 100644 --- a/aws/resource_aws_ec2_transit_gateway_route_table.go +++ b/aws/resource_aws_ec2_transit_gateway_route_table.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsEc2TransitGatewayRouteTable() *schema.Resource { @@ -29,11 +30,7 @@ func resourceAwsEc2TransitGatewayRouteTable() *schema.Resource { Type: schema.TypeBool, Computed: true, }, - "tags": { - Type: schema.TypeMap, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, + "tags": tagsSchema(), "transit_gateway_id": { Type: schema.TypeString, Required: true, @@ -49,7 +46,7 @@ func resourceAwsEc2TransitGatewayRouteTableCreate(d *schema.ResourceData, meta i input := &ec2.CreateTransitGatewayRouteTableInput{ TransitGatewayId: aws.String(d.Get("transit_gateway_id").(string)), - TagSpecifications: expandEc2TransitGatewayRouteTableTagSpecifications(d.Get("tags").(map[string]interface{})), + TagSpecifications: ec2TagSpecificationsFromMap(d.Get("tags").(map[string]interface{}), ec2.ResourceTypeTransitGatewayRouteTable), } log.Printf("[DEBUG] Creating EC2 Transit Gateway Route Table: %s", input) @@ -97,7 +94,7 @@ func resourceAwsEc2TransitGatewayRouteTableRead(d *schema.ResourceData, meta int d.Set("default_association_route_table", aws.BoolValue(transitGatewayRouteTable.DefaultAssociationRouteTable)) d.Set("default_propagation_route_table", aws.BoolValue(transitGatewayRouteTable.DefaultPropagationRouteTable)) - if err := d.Set("tags", tagsToMap(transitGatewayRouteTable.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(transitGatewayRouteTable.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -109,8 +106,12 @@ func resourceAwsEc2TransitGatewayRouteTableRead(d *schema.ResourceData, meta int func resourceAwsEc2TransitGatewayRouteTableUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - if err := setTags(conn, d); err != nil { - return fmt.Errorf("error updating EC2 Transit Gateway Route Table (%s) tags: %s", d.Id(), err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating EC2 Transit Gateway Route Table (%s) tags: %s", d.Id(), err) + } } return nil diff --git a/aws/resource_aws_ec2_transit_gateway_vpc_attachment.go b/aws/resource_aws_ec2_transit_gateway_vpc_attachment.go index b958e478e4a..29f41e961eb 100644 --- a/aws/resource_aws_ec2_transit_gateway_vpc_attachment.go +++ b/aws/resource_aws_ec2_transit_gateway_vpc_attachment.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsEc2TransitGatewayVpcAttachment() *schema.Resource { @@ -45,11 +46,7 @@ func resourceAwsEc2TransitGatewayVpcAttachment() *schema.Resource { MinItems: 1, Elem: &schema.Schema{Type: schema.TypeString}, }, - "tags": { - Type: schema.TypeMap, - Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - }, + "tags": tagsSchema(), "transit_gateway_default_route_table_association": { Type: schema.TypeBool, Optional: true, @@ -92,7 +89,7 @@ func resourceAwsEc2TransitGatewayVpcAttachmentCreate(d *schema.ResourceData, met }, SubnetIds: expandStringSet(d.Get("subnet_ids").(*schema.Set)), TransitGatewayId: aws.String(transitGatewayID), - TagSpecifications: expandEc2TransitGatewayAttachmentTagSpecifications(d.Get("tags").(map[string]interface{})), + TagSpecifications: ec2TagSpecificationsFromMap(d.Get("tags").(map[string]interface{}), ec2.ResourceTypeTransitGatewayAttachment), VpcId: aws.String(d.Get("vpc_id").(string)), } @@ -197,7 +194,7 @@ func resourceAwsEc2TransitGatewayVpcAttachmentRead(d *schema.ResourceData, meta return fmt.Errorf("error setting subnet_ids: %s", err) } - if err := d.Set("tags", tagsToMap(transitGatewayVpcAttachment.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(transitGatewayVpcAttachment.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -269,7 +266,9 @@ func resourceAwsEc2TransitGatewayVpcAttachmentUpdate(d *schema.ResourceData, met } if d.HasChange("tags") { - if err := setTags(conn, d); err != nil { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { return fmt.Errorf("error updating EC2 Transit Gateway VPC Attachment (%s) tags: %s", d.Id(), err) } } diff --git a/aws/resource_aws_ec2_transit_gateway_vpc_attachment_accepter.go b/aws/resource_aws_ec2_transit_gateway_vpc_attachment_accepter.go index 47b51f07e5f..bb2fc407e65 100644 --- a/aws/resource_aws_ec2_transit_gateway_vpc_attachment_accepter.go +++ b/aws/resource_aws_ec2_transit_gateway_vpc_attachment_accepter.go @@ -7,6 +7,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsEc2TransitGatewayVpcAttachmentAccepter() *schema.Resource { @@ -85,8 +86,10 @@ func resourceAwsEc2TransitGatewayVpcAttachmentAccepterCreate(d *schema.ResourceD return fmt.Errorf("error waiting for EC2 Transit Gateway VPC Attachment (%s) availability: %s", d.Id(), err) } - if err := setTags(conn, d); err != nil { - return fmt.Errorf("error updating EC2 Transit Gateway VPC Attachment (%s) tags: %s", d.Id(), err) + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), nil, v); err != nil { + return fmt.Errorf("error updating EC2 Transit Gateway VPC Attachment (%s) tags: %s", d.Id(), err) + } } transitGateway, err := ec2DescribeTransitGateway(conn, transitGatewayID) @@ -169,7 +172,7 @@ func resourceAwsEc2TransitGatewayVpcAttachmentAccepterRead(d *schema.ResourceDat return fmt.Errorf("error setting subnet_ids: %s", err) } - if err := d.Set("tags", tagsToMap(transitGatewayVpcAttachment.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(transitGatewayVpcAttachment.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -212,7 +215,9 @@ func resourceAwsEc2TransitGatewayVpcAttachmentAccepterUpdate(d *schema.ResourceD } if d.HasChange("tags") { - if err := setTags(conn, d); err != nil { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { return fmt.Errorf("error updating EC2 Transit Gateway VPC Attachment (%s) tags: %s", d.Id(), err) } } diff --git a/aws/resource_aws_ecr_lifecycle_policy_test.go b/aws/resource_aws_ecr_lifecycle_policy_test.go index f6261901afb..3b84a49c443 100644 --- a/aws/resource_aws_ecr_lifecycle_policy_test.go +++ b/aws/resource_aws_ecr_lifecycle_policy_test.go @@ -14,6 +14,7 @@ import ( func TestAccAWSEcrLifecyclePolicy_basic(t *testing.T) { randString := acctest.RandString(10) rName := fmt.Sprintf("tf-acc-test-lifecycle-%s", randString) + resourceName := "aws_ecr_lifecycle_policy.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -23,27 +24,9 @@ func TestAccAWSEcrLifecyclePolicy_basic(t *testing.T) { { Config: testAccEcrLifecyclePolicyConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcrLifecyclePolicyExists("aws_ecr_lifecycle_policy.foo"), + testAccCheckAWSEcrLifecyclePolicyExists(resourceName), ), }, - }, - }) -} - -func TestAccAWSEcrLifecyclePolicy_import(t *testing.T) { - resourceName := "aws_ecr_lifecycle_policy.foo" - randString := acctest.RandString(10) - rName := fmt.Sprintf("tf-acc-test-lifecycle-%s", randString) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEcrLifecyclePolicyDestroy, - Steps: []resource.TestStep{ - { - Config: testAccEcrLifecyclePolicyConfig(rName), - }, - { ResourceName: resourceName, ImportState: true, @@ -100,12 +83,12 @@ func testAccCheckAWSEcrLifecyclePolicyExists(name string) resource.TestCheckFunc func testAccEcrLifecyclePolicyConfig(rName string) string { return fmt.Sprintf(` -resource "aws_ecr_repository" "foo" { +resource "aws_ecr_repository" "test" { name = "%s" } -resource "aws_ecr_lifecycle_policy" "foo" { - repository = "${aws_ecr_repository.foo.name}" +resource "aws_ecr_lifecycle_policy" "test" { + repository = "${aws_ecr_repository.test.name}" policy = < 0 { + imageScanningConfig := imageScanningConfigs[0] + if imageScanningConfig != nil { + configMap := imageScanningConfig.(map[string]interface{}) + input.ImageScanningConfiguration = &ecr.ImageScanningConfiguration{ + ScanOnPush: aws.Bool(configMap["scan_on_push"].(bool)), + } + } } log.Printf("[DEBUG] Creating ECR repository: %#v", input) @@ -119,21 +144,46 @@ func resourceAwsEcrRepositoryRead(d *schema.ResourceData, meta interface{}) erro } repository := out.Repositories[0] + arn := aws.StringValue(repository.RepositoryArn) - d.Set("arn", repository.RepositoryArn) + d.Set("arn", arn) d.Set("name", repository.RepositoryName) d.Set("registry_id", repository.RegistryId) d.Set("repository_url", repository.RepositoryUri) d.Set("image_tag_mutability", repository.ImageTagMutability) - if err := getTagsECR(conn, d); err != nil { - return fmt.Errorf("error getting ECR repository tags: %s", err) + if err := d.Set("image_scanning_configuration", flattenImageScanningConfiguration(repository.ImageScanningConfiguration)); err != nil { + return fmt.Errorf("error setting image_scanning_configuration: %s", err) + } + + tags, err := keyvaluetags.EcrListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for ECR Repository (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil } +func flattenImageScanningConfiguration(isc *ecr.ImageScanningConfiguration) []map[string]interface{} { + if isc == nil { + return nil + } + + config := make(map[string]interface{}) + config["scan_on_push"] = aws.BoolValue(isc.ScanOnPush) + + return []map[string]interface{}{ + config, + } +} + func resourceAwsEcrRepositoryUpdate(d *schema.ResourceData, meta interface{}) error { + arn := d.Get("arn").(string) conn := meta.(*AWSClient).ecrconn if d.HasChange("image_tag_mutability") { @@ -142,8 +192,18 @@ func resourceAwsEcrRepositoryUpdate(d *schema.ResourceData, meta interface{}) er } } - if err := setTagsECR(conn, d); err != nil { - return fmt.Errorf("error setting ECR repository tags: %s", err) + if d.HasChange("image_scanning_configuration") { + if err := resourceAwsEcrRepositoryUpdateImageScanningConfiguration(conn, d); err != nil { + return err + } + } + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.EcrUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating ECR Repository (%s) tags: %s", arn, err) + } } return resourceAwsEcrRepositoryRead(d, meta) @@ -210,3 +270,28 @@ func resourceAwsEcrRepositoryUpdateImageTagMutability(conn *ecr.ECR, d *schema.R return nil } +func resourceAwsEcrRepositoryUpdateImageScanningConfiguration(conn *ecr.ECR, d *schema.ResourceData) error { + + var ecrImageScanningConfig ecr.ImageScanningConfiguration + imageScanningConfigs := d.Get("image_scanning_configuration").([]interface{}) + if len(imageScanningConfigs) > 0 { + imageScanningConfig := imageScanningConfigs[0] + if imageScanningConfig != nil { + configMap := imageScanningConfig.(map[string]interface{}) + ecrImageScanningConfig.ScanOnPush = aws.Bool(configMap["scan_on_push"].(bool)) + } + } + + input := &ecr.PutImageScanningConfigurationInput{ + ImageScanningConfiguration: &ecrImageScanningConfig, + RepositoryName: aws.String(d.Id()), + RegistryId: aws.String(d.Get("registry_id").(string)), + } + + _, err := conn.PutImageScanningConfiguration(input) + if err != nil { + return fmt.Errorf("Error setting image scanning configuration: %s", err.Error()) + } + + return nil +} diff --git a/aws/resource_aws_ecr_repository_test.go b/aws/resource_aws_ecr_repository_test.go index c999b9e0b0c..3c54a6476cb 100644 --- a/aws/resource_aws_ecr_repository_test.go +++ b/aws/resource_aws_ecr_repository_test.go @@ -96,6 +96,54 @@ func TestAccAWSEcrRepository_immutability(t *testing.T) { }) } +func TestAccAWSEcrRepository_image_scanning_configuration(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecr_repository.default" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcrRepositoryDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcrRepositoryConfig_image_scanning_configuration(rName, true), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcrRepositoryExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "image_scanning_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "image_scanning_configuration.0.scan_on_push", "true"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + // Test that the removal of the non-default image_scanning_configuration causes plan changes + Config: testAccAWSEcrRepositoryConfig(rName), + PlanOnly: true, + ExpectNonEmptyPlan: true, + }, + { + // Test attribute update + Config: testAccAWSEcrRepositoryConfig_image_scanning_configuration(rName, false), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcrRepositoryExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "image_scanning_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "image_scanning_configuration.0.scan_on_push", "false"), + ), + }, + { + // Test that the removal of the default image_scanning_configuration doesn't cause any plan changes + Config: testAccAWSEcrRepositoryConfig(rName), + PlanOnly: true, + ExpectNonEmptyPlan: false, + }, + }, + }) +} + func testAccCheckAWSEcrRepositoryDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).ecrconn @@ -194,3 +242,14 @@ resource "aws_ecr_repository" "default" { } `, rName) } + +func testAccAWSEcrRepositoryConfig_image_scanning_configuration(rName string, scanOnPush bool) string { + return fmt.Sprintf(` +resource "aws_ecr_repository" "default" { + name = %q + image_scanning_configuration { + scan_on_push = %t + } +} +`, rName, scanOnPush) +} diff --git a/aws/resource_aws_ecs_capacity_provider.go b/aws/resource_aws_ecs_capacity_provider.go new file mode 100644 index 00000000000..2907693e4a0 --- /dev/null +++ b/aws/resource_aws_ecs_capacity_provider.go @@ -0,0 +1,271 @@ +package aws + +import ( + "fmt" + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" + "github.com/aws/aws-sdk-go/service/ecs" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +func resourceAwsEcsCapacityProvider() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsEcsCapacityProviderCreate, + Read: resourceAwsEcsCapacityProviderRead, + Update: resourceAwsEcsCapacityProviderUpdate, + Delete: resourceAwsEcsCapacityProviderDelete, + Importer: &schema.ResourceImporter{ + State: resourceAwsEcsCapacityProviderImport, + }, + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "auto_scaling_group_provider": { + Type: schema.TypeList, + MaxItems: 1, + Required: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "auto_scaling_group_arn": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validateArn, + ForceNew: true, + }, + "managed_termination_protection": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + ecs.ManagedTerminationProtectionEnabled, + ecs.ManagedTerminationProtectionDisabled, + }, false), + }, + "managed_scaling": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "maximum_scaling_step_size": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validation.IntBetween(1, 10000), + }, + "minimum_scaling_step_size": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validation.IntBetween(1, 10000), + }, + "status": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + ecs.ManagedScalingStatusEnabled, + ecs.ManagedScalingStatusDisabled, + }, false)}, + "target_capacity": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validation.IntBetween(1, 100), + }, + }, + }, + }, + }, + }, + }, + "tags": tagsSchema(), + }, + } +} + +func resourceAwsEcsCapacityProviderCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ecsconn + + input := ecs.CreateCapacityProviderInput{ + Name: aws.String(d.Get("name").(string)), + AutoScalingGroupProvider: expandAutoScalingGroupProvider(d.Get("auto_scaling_group_provider")), + } + + // `CreateCapacityProviderInput` does not accept an empty array of tags + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + input.Tags = keyvaluetags.New(v).IgnoreAws().EcsTags() + } + + out, err := conn.CreateCapacityProvider(&input) + + if err != nil { + return fmt.Errorf("error creating capacity provider: %s", err) + } + + provider := *out.CapacityProvider + + log.Printf("[DEBUG] ECS Capacity Provider created: %s", aws.StringValue(provider.CapacityProviderArn)) + d.SetId(aws.StringValue(provider.CapacityProviderArn)) + + return resourceAwsEcsCapacityProviderRead(d, meta) +} + +func resourceAwsEcsCapacityProviderRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ecsconn + + input := &ecs.DescribeCapacityProvidersInput{ + CapacityProviders: []*string{aws.String(d.Id())}, + Include: []*string{aws.String(ecs.CapacityProviderFieldTags)}, + } + + output, err := conn.DescribeCapacityProviders(input) + + if err != nil { + return fmt.Errorf("error reading ECS Capacity Provider (%s): %s", d.Id(), err) + } + + var provider *ecs.CapacityProvider + for _, cp := range output.CapacityProviders { + if aws.StringValue(cp.CapacityProviderArn) == d.Id() { + provider = cp + break + } + } + + if provider == nil { + log.Printf("[WARN] ECS Capacity Provider (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + d.Set("arn", provider.CapacityProviderArn) + d.Set("name", provider.Name) + + if err := d.Set("tags", keyvaluetags.EcsKeyValueTags(provider.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + if err := d.Set("auto_scaling_group_provider", flattenAutoScalingGroupProvider(provider.AutoScalingGroupProvider)); err != nil { + return fmt.Errorf("error setting autoscaling group provider: %s", err) + } + + return nil +} + +func resourceAwsEcsCapacityProviderUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ecsconn + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.EcsUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating ECS Cluster (%s) tags: %s", d.Id(), err) + } + } + + return nil +} + +func resourceAwsEcsCapacityProviderDelete(d *schema.ResourceData, meta interface{}) error { + // Reference: https://github.com/aws/containers-roadmap/issues/632 + log.Printf("[WARN] delete is not yet implemented for ECS capacity providers") + return nil +} + +func resourceAwsEcsCapacityProviderImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + d.Set("name", d.Id()) + d.SetId(arn.ARN{ + Partition: meta.(*AWSClient).partition, + Region: meta.(*AWSClient).region, + AccountID: meta.(*AWSClient).accountid, + Service: "ecs", + Resource: fmt.Sprintf("capacity-provider/%s", d.Id()), + }.String()) + return []*schema.ResourceData{d}, nil +} + +func expandAutoScalingGroupProvider(configured interface{}) *ecs.AutoScalingGroupProvider { + if configured == nil { + return nil + } + + if configured.([]interface{}) == nil || len(configured.([]interface{})) == 0 { + return nil + } + + prov := ecs.AutoScalingGroupProvider{} + p := configured.([]interface{})[0].(map[string]interface{}) + arn := p["auto_scaling_group_arn"].(string) + prov.AutoScalingGroupArn = aws.String(arn) + + if mtp := p["managed_termination_protection"].(string); len(mtp) > 0 { + prov.ManagedTerminationProtection = aws.String(mtp) + } + + if v := p["managed_scaling"].([]interface{}); len(v) > 0 && v[0].(map[string]interface{}) != nil { + ms := v[0].(map[string]interface{}) + managedScaling := ecs.ManagedScaling{} + + if val, ok := ms["maximum_scaling_step_size"].(int); ok && val != 0 { + managedScaling.MaximumScalingStepSize = aws.Int64(int64(val)) + } + if val, ok := ms["minimum_scaling_step_size"].(int); ok && val != 0 { + managedScaling.MinimumScalingStepSize = aws.Int64(int64(val)) + } + if val, ok := ms["status"].(string); ok && len(val) > 0 { + managedScaling.Status = aws.String(val) + } + if val, ok := ms["target_capacity"].(int); ok && val != 0 { + managedScaling.TargetCapacity = aws.Int64(int64(val)) + } + prov.ManagedScaling = &managedScaling + } + + return &prov +} + +func flattenAutoScalingGroupProvider(provider *ecs.AutoScalingGroupProvider) []map[string]interface{} { + if provider == nil { + return nil + } + + p := map[string]interface{}{ + "auto_scaling_group_arn": aws.StringValue(provider.AutoScalingGroupArn), + "managed_termination_protection": aws.StringValue(provider.ManagedTerminationProtection), + "managed_scaling": []map[string]interface{}{}, + } + + if provider.ManagedScaling != nil { + m := map[string]interface{}{ + "maximum_scaling_step_size": aws.Int64Value(provider.ManagedScaling.MaximumScalingStepSize), + "minimum_scaling_step_size": aws.Int64Value(provider.ManagedScaling.MinimumScalingStepSize), + "status": aws.StringValue(provider.ManagedScaling.Status), + "target_capacity": aws.Int64Value(provider.ManagedScaling.TargetCapacity), + } + + p["managed_scaling"] = []map[string]interface{}{m} + } + + result := []map[string]interface{}{p} + return result +} diff --git a/aws/resource_aws_ecs_capacity_provider_test.go b/aws/resource_aws_ecs_capacity_provider_test.go new file mode 100644 index 00000000000..0c8aaa1f6a2 --- /dev/null +++ b/aws/resource_aws_ecs_capacity_provider_test.go @@ -0,0 +1,322 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ecs" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +// TODO sweepers once Delete is implemented + +func TestAccAWSEcsCapacityProvider_basic(t *testing.T) { + var provider ecs.CapacityProvider + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecs_capacity_provider.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcsCapacityProviderDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcsCapacityProviderConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsCapacityProviderExists(resourceName, &provider), + resource.TestCheckResourceAttr(resourceName, "name", rName), + testAccCheckResourceAttrRegionalARN(resourceName, "id", "ecs", fmt.Sprintf("capacity-provider/%s", rName)), + resource.TestCheckResourceAttrPair(resourceName, "id", resourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttrPair(resourceName, "auto_scaling_group_provider.0.auto_scaling_group_arn", "aws_autoscaling_group.test", "arn"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_termination_protection", "DISABLED"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.minimum_scaling_step_size", "1"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.maximum_scaling_step_size", "10000"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.status", "DISABLED"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.target_capacity", "100"), + ), + }, + { + ResourceName: resourceName, + ImportStateId: rName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEcsCapacityProvider_ManagedScaling(t *testing.T) { + var provider ecs.CapacityProvider + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecs_capacity_provider.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcsCapacityProviderDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcsCapacityProviderConfigManagedScaling(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsCapacityProviderExists(resourceName, &provider), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrPair(resourceName, "auto_scaling_group_provider.0.auto_scaling_group_arn", "aws_autoscaling_group.test", "arn"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_termination_protection", "DISABLED"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.minimum_scaling_step_size", "2"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.maximum_scaling_step_size", "10"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.status", "ENABLED"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.target_capacity", "50"), + ), + }, + { + ResourceName: resourceName, + ImportStateId: rName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEcsCapacityProvider_ManagedScalingPartial(t *testing.T) { + var provider ecs.CapacityProvider + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecs_capacity_provider.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcsCapacityProviderDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcsCapacityProviderConfigManagedScalingPartial(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsCapacityProviderExists(resourceName, &provider), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrPair(resourceName, "auto_scaling_group_provider.0.auto_scaling_group_arn", "aws_autoscaling_group.test", "arn"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_termination_protection", "DISABLED"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.minimum_scaling_step_size", "2"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.maximum_scaling_step_size", "10000"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.status", "ENABLED"), + resource.TestCheckResourceAttr(resourceName, "auto_scaling_group_provider.0.managed_scaling.0.target_capacity", "100"), + ), + }, + { + ResourceName: resourceName, + ImportStateId: rName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEcsCapacityProvider_Tags(t *testing.T) { + var provider ecs.CapacityProvider + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecs_capacity_provider.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcsCapacityProviderDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcsCapacityProviderConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsCapacityProviderExists(resourceName, &provider), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportStateId: rName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSEcsCapacityProviderConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsCapacityProviderExists(resourceName, &provider), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSEcsCapacityProviderConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsCapacityProviderExists(resourceName, &provider), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + +// TODO add an update test config - Reference: https://github.com/aws/containers-roadmap/issues/633 + +func testAccCheckAWSEcsCapacityProviderDestroy(s *terraform.State) error { + // Reference: https://github.com/aws/containers-roadmap/issues/632 + return nil +} + +func testAccCheckAWSEcsCapacityProviderExists(resourceName string, provider *ecs.CapacityProvider) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + conn := testAccProvider.Meta().(*AWSClient).ecsconn + + input := &ecs.DescribeCapacityProvidersInput{ + CapacityProviders: []*string{aws.String(rs.Primary.ID)}, + Include: []*string{aws.String(ecs.CapacityProviderFieldTags)}, + } + + output, err := conn.DescribeCapacityProviders(input) + + if err != nil { + return fmt.Errorf("error reading ECS Capacity Provider (%s): %s", rs.Primary.ID, err) + } + + for _, cp := range output.CapacityProviders { + if aws.StringValue(cp.CapacityProviderArn) == rs.Primary.ID { + *provider = *cp + return nil + } + } + + return fmt.Errorf("ECS Capacity Provider (%s) not found", rs.Primary.ID) + } +} + +func testAccAWSEcsCapacityProviderConfigBase(rName string) string { + return fmt.Sprintf(` +data "aws_ami" "test" { + most_recent = true + owners = ["amazon"] + + filter { + name = "name" + values = ["amzn-ami-hvm-*-x86_64-gp2"] + } +} + +data "aws_availability_zones" "available" {} + +resource "aws_launch_template" "test" { + image_id = data.aws_ami.test.id + instance_type = "t3.micro" + name = %[1]q +} + +resource "aws_autoscaling_group" "test" { + availability_zones = data.aws_availability_zones.available.names + desired_capacity = 0 + max_size = 0 + min_size = 0 + name = %[1]q + + launch_template { + id = aws_launch_template.test.id + } + + tags = [ + { + key = "foo" + value = "bar" + propagate_at_launch = true + }, + ] +} +`, rName) +} + +func testAccAWSEcsCapacityProviderConfig(rName string) string { + return testAccAWSEcsCapacityProviderConfigBase(rName) + fmt.Sprintf(` +resource "aws_ecs_capacity_provider" "test" { + name = %q + + auto_scaling_group_provider { + auto_scaling_group_arn = aws_autoscaling_group.test.arn + } +} +`, rName) +} + +func testAccAWSEcsCapacityProviderConfigManagedScaling(rName string) string { + return testAccAWSEcsCapacityProviderConfigBase(rName) + fmt.Sprintf(` +resource "aws_ecs_capacity_provider" "test" { + name = %q + + auto_scaling_group_provider { + auto_scaling_group_arn = aws_autoscaling_group.test.arn + + managed_scaling { + maximum_scaling_step_size = 10 + minimum_scaling_step_size = 2 + status = "ENABLED" + target_capacity = 50 + } + } +} +`, rName) +} + +func testAccAWSEcsCapacityProviderConfigManagedScalingPartial(rName string) string { + return testAccAWSEcsCapacityProviderConfigBase(rName) + fmt.Sprintf(` +resource "aws_ecs_capacity_provider" "test" { + name = %q + + auto_scaling_group_provider { + auto_scaling_group_arn = aws_autoscaling_group.test.arn + + managed_scaling { + minimum_scaling_step_size = 2 + status = "ENABLED" + } + } +} +`, rName) +} + +func testAccAWSEcsCapacityProviderConfigTags1(rName, tag1Key, tag1Value string) string { + return testAccAWSEcsCapacityProviderConfigBase(rName) + fmt.Sprintf(` +resource "aws_ecs_capacity_provider" "test" { + name = %q + + tags = { + %q = %q, + } + + auto_scaling_group_provider { + auto_scaling_group_arn = aws_autoscaling_group.test.arn + } +} +`, rName, tag1Key, tag1Value) +} + +func testAccAWSEcsCapacityProviderConfigTags2(rName, tag1Key, tag1Value, tag2Key, tag2Value string) string { + return testAccAWSEcsCapacityProviderConfigBase(rName) + fmt.Sprintf(` +resource "aws_ecs_capacity_provider" "test" { + name = %q + + tags = { + %q = %q, + %q = %q, + } + + auto_scaling_group_provider { + auto_scaling_group_arn = aws_autoscaling_group.test.arn + } +} +`, rName, tag1Key, tag1Value, tag2Key, tag2Value) +} diff --git a/aws/resource_aws_ecs_cluster.go b/aws/resource_aws_ecs_cluster.go index 4de16d92968..c8bd30dabdf 100644 --- a/aws/resource_aws_ecs_cluster.go +++ b/aws/resource_aws_ecs_cluster.go @@ -11,6 +11,13 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +const ( + ecsClusterTimeoutCreate = 10 * time.Minute + ecsClusterTimeoutDelete = 10 * time.Minute + ecsClusterTimeoutUpdate = 10 * time.Minute ) func resourceAwsEcsCluster() *schema.Resource { @@ -29,11 +36,41 @@ func resourceAwsEcsCluster() *schema.Resource { Required: true, ForceNew: true, }, - "tags": tagsSchema(), "arn": { Type: schema.TypeString, Computed: true, }, + "capacity_providers": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + }, + }, + "default_capacity_provider_strategy": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "base": { + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntBetween(0, 100000), + }, + + "capacity_provider": { + Type: schema.TypeString, + Required: true, + }, + + "weight": { + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntBetween(0, 1000), + }, + }, + }, + }, "setting": { Type: schema.TypeSet, Optional: true, @@ -54,6 +91,7 @@ func resourceAwsEcsCluster() *schema.Resource { }, }, }, + "tags": tagsSchema(), }, } } @@ -78,20 +116,30 @@ func resourceAwsEcsClusterCreate(d *schema.ResourceData, meta interface{}) error input := ecs.CreateClusterInput{ ClusterName: aws.String(clusterName), - Tags: tagsFromMapECS(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().EcsTags(), } if v, ok := d.GetOk("setting"); ok { - input.Settings = expandEcsSettings(v.(*schema.Set).List()) + input.Settings = expandEcsSettings(v.(*schema.Set)) } + if v, ok := d.GetOk("capacity_providers"); ok { + input.CapacityProviders = expandStringSet(v.(*schema.Set)) + } + + input.DefaultCapacityProviderStrategy = expandEcsCapacityProviderStrategy(d.Get("default_capacity_provider_strategy").(*schema.Set)) + out, err := conn.CreateCluster(&input) if err != nil { return err } - log.Printf("[DEBUG] ECS cluster %s created", *out.Cluster.ClusterArn) + log.Printf("[DEBUG] ECS cluster %s created", aws.StringValue(out.Cluster.ClusterArn)) - d.SetId(*out.Cluster.ClusterArn) + d.SetId(aws.StringValue(out.Cluster.ClusterArn)) + + if err = waitForEcsClusterActive(conn, clusterName, ecsClusterTimeoutCreate); err != nil { + return fmt.Errorf("error waiting for ECS Cluster (%s) creation: %s", d.Id(), err) + } return resourceAwsEcsClusterRead(d, meta) } @@ -161,11 +209,18 @@ func resourceAwsEcsClusterRead(d *schema.ResourceData, meta interface{}) error { d.Set("arn", cluster.ClusterArn) d.Set("name", cluster.ClusterName) + if err := d.Set("capacity_providers", aws.StringValueSlice(cluster.CapacityProviders)); err != nil { + return fmt.Errorf("error setting capacity_providers: %s", err) + } + if err := d.Set("default_capacity_provider_strategy", flattenEcsCapacityProviderStrategy(cluster.DefaultCapacityProviderStrategy)); err != nil { + return fmt.Errorf("error setting default_capacity_provider_strategy: %s", err) + } + if err := d.Set("setting", flattenEcsSettings(cluster.Settings)); err != nil { return fmt.Errorf("error setting setting: %s", err) } - if err := d.Set("tags", tagsToMapECS(cluster.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.EcsKeyValueTags(cluster.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -175,51 +230,64 @@ func resourceAwsEcsClusterRead(d *schema.ResourceData, meta interface{}) error { func resourceAwsEcsClusterUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ecsconn + clusterName := d.Get("name").(string) + if d.HasChange("setting") { input := ecs.UpdateClusterSettingsInput{ Cluster: aws.String(d.Id()), - Settings: expandEcsSettings(d.Get("setting").(*schema.Set).List()), + Settings: expandEcsSettings(d.Get("setting").(*schema.Set)), } _, err := conn.UpdateClusterSettings(&input) if err != nil { return fmt.Errorf("error changing ECS cluster settings (%s): %s", d.Id(), err) } + + if err = waitForEcsClusterActive(conn, clusterName, ecsClusterTimeoutUpdate); err != nil { + return fmt.Errorf("error waiting for ECS Cluster (%s) update: %s", d.Id(), err) + } } if d.HasChange("tags") { - oldTagsRaw, newTagsRaw := d.GetChange("tags") - oldTagsMap := oldTagsRaw.(map[string]interface{}) - newTagsMap := newTagsRaw.(map[string]interface{}) - createTags, removeTags := diffTagsECS(tagsFromMapECS(oldTagsMap), tagsFromMapECS(newTagsMap)) - - if len(removeTags) > 0 { - removeTagKeys := make([]*string, len(removeTags)) - for i, removeTag := range removeTags { - removeTagKeys[i] = removeTag.Key - } + o, n := d.GetChange("tags") - input := &ecs.UntagResourceInput{ - ResourceArn: aws.String(d.Id()), - TagKeys: removeTagKeys, - } + if err := keyvaluetags.EcsUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating ECS Cluster (%s) tags: %s", d.Id(), err) + } + } - log.Printf("[DEBUG] Untagging ECS Cluster: %s", input) - if _, err := conn.UntagResource(input); err != nil { - return fmt.Errorf("error untagging ECS Cluster (%s): %s", d.Id(), err) - } + if d.HasChange("capacity_providers") || d.HasChange("default_capacity_provider_strategy") { + input := ecs.PutClusterCapacityProvidersInput{ + Cluster: aws.String(d.Id()), + CapacityProviders: expandStringSet(d.Get("capacity_providers").(*schema.Set)), + DefaultCapacityProviderStrategy: expandEcsCapacityProviderStrategy(d.Get("default_capacity_provider_strategy").(*schema.Set)), } - if len(createTags) > 0 { - input := &ecs.TagResourceInput{ - ResourceArn: aws.String(d.Id()), - Tags: createTags, + err := resource.Retry(ecsClusterTimeoutUpdate, func() *resource.RetryError { + _, err := conn.PutClusterCapacityProviders(&input) + if err != nil { + if isAWSErr(err, ecs.ErrCodeClientException, "Cluster was not ACTIVE") { + return resource.RetryableError(err) + } + if isAWSErr(err, ecs.ErrCodeResourceInUseException, "") { + return resource.RetryableError(err) + } + if isAWSErr(err, ecs.ErrCodeUpdateInProgressException, "") { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) } + return nil + }) + if isResourceTimeoutError(err) { + _, err = conn.PutClusterCapacityProviders(&input) + } + if err != nil { + return fmt.Errorf("error changing ECS cluster capacity provider settings (%s): %s", d.Id(), err) + } - log.Printf("[DEBUG] Tagging ECS Cluster: %s", input) - if _, err := conn.TagResource(input); err != nil { - return fmt.Errorf("error tagging ECS Cluster (%s): %s", d.Id(), err) - } + if err = waitForEcsClusterActive(conn, clusterName, ecsClusterTimeoutUpdate); err != nil { + return fmt.Errorf("error waiting for ECS Cluster (%s) update: %s", d.Id(), err) } } @@ -233,7 +301,7 @@ func resourceAwsEcsClusterDelete(d *schema.ResourceData, meta interface{}) error input := &ecs.DeleteClusterInput{ Cluster: aws.String(d.Id()), } - err := resource.Retry(10*time.Minute, func() *resource.RetryError { + err := resource.Retry(ecsClusterTimeoutDelete, func() *resource.RetryError { _, err := conn.DeleteCluster(input) if err == nil { @@ -249,6 +317,10 @@ func resourceAwsEcsClusterDelete(d *schema.ResourceData, meta interface{}) error log.Printf("[TRACE] Retrying ECS cluster %q deletion after %s", d.Id(), err) return resource.RetryableError(err) } + if isAWSErr(err, ecs.ErrCodeUpdateInProgressException, "") { + log.Printf("[TRACE] Retrying ECS cluster %q deletion after %s", d.Id(), err) + return resource.RetryableError(err) + } return resource.NonRetryableError(err) }) if isResourceTimeoutError(err) { @@ -259,32 +331,13 @@ func resourceAwsEcsClusterDelete(d *schema.ResourceData, meta interface{}) error } clusterName := d.Get("name").(string) - dcInput := &ecs.DescribeClustersInput{ - Clusters: []*string{aws.String(clusterName)}, - } - var out *ecs.DescribeClustersOutput - 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(dcInput) - - if err != nil { - return resource.NonRetryableError(err) - } - if !ecsClusterInactive(out, clusterName) { - return resource.RetryableError(fmt.Errorf("ECS Cluster %q is not inactive", clusterName)) - } - - return nil - }) - if isResourceTimeoutError(err) { - out, err = conn.DescribeClusters(dcInput) - if err != nil { - return fmt.Errorf("Error waiting for ECS cluster to become inactive: %s", err) - } - if !ecsClusterInactive(out, clusterName) { - return fmt.Errorf("ECS Cluster %q is still not inactive", clusterName) - } + stateConf := resource.StateChangeConf{ + Pending: []string{"ACTIVE", "DEPROVISIONING"}, + Target: []string{"INACTIVE"}, + Timeout: ecsClusterTimeoutDelete, + Refresh: refreshEcsClusterStatus(conn, clusterName), } + _, err = stateConf.WaitForState() if err != nil { return fmt.Errorf("Error waiting for ECS cluster to become inactive: %s", err) } @@ -293,25 +346,44 @@ func resourceAwsEcsClusterDelete(d *schema.ResourceData, meta interface{}) error return nil } -func ecsClusterInactive(out *ecs.DescribeClustersOutput, clusterName string) bool { - for _, c := range out.Clusters { - if aws.StringValue(c.ClusterName) == clusterName { - if *c.Status == "INACTIVE" { - return true +func waitForEcsClusterActive(conn *ecs.ECS, clusterName string, timeout time.Duration) error { + stateConf := resource.StateChangeConf{ + Pending: []string{"PROVISIONING"}, + Target: []string{"ACTIVE"}, + Timeout: timeout, + Refresh: refreshEcsClusterStatus(conn, clusterName), + Delay: 10 * time.Second, + } + _, err := stateConf.WaitForState() + return err +} + +func refreshEcsClusterStatus(conn *ecs.ECS, clusterName string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + output, err := conn.DescribeClusters(&ecs.DescribeClustersInput{ + Clusters: []*string{aws.String(clusterName)}, + }) + if err != nil { + return nil, "", err + } + for _, c := range output.Clusters { + if aws.StringValue(c.ClusterName) == clusterName { + return c, aws.StringValue(c.Status), nil } } + return nil, "", fmt.Errorf("ECS cluster %q missing", clusterName) } - return false } -func expandEcsSettings(configured []interface{}) []*ecs.ClusterSetting { - if len(configured) == 0 { +func expandEcsSettings(configured *schema.Set) []*ecs.ClusterSetting { + list := configured.List() + if len(list) == 0 { return nil } - settings := make([]*ecs.ClusterSetting, 0, len(configured)) + settings := make([]*ecs.ClusterSetting, 0, len(list)) - for _, raw := range configured { + for _, raw := range list { data := raw.(map[string]interface{}) setting := &ecs.ClusterSetting{ diff --git a/aws/resource_aws_ecs_cluster_test.go b/aws/resource_aws_ecs_cluster_test.go index 8c7604fd36e..c5703eca95a 100644 --- a/aws/resource_aws_ecs_cluster_test.go +++ b/aws/resource_aws_ecs_cluster_test.go @@ -157,6 +157,135 @@ func TestAccAWSEcsCluster_Tags(t *testing.T) { }) } +func TestAccAWSEcsCluster_SingleCapacityProvider(t *testing.T) { + var cluster1 ecs.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + providerName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecs_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcsClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcsClusterSingleCapacityProvider(rName, providerName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsClusterExists(resourceName, &cluster1), + ), + }, + { + ResourceName: resourceName, + ImportStateId: rName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEcsCluster_CapacityProviders(t *testing.T) { + var cluster ecs.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecs_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcsClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcsClusterCapacityProviders(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsClusterExists(resourceName, &cluster), + ), + }, + { + ResourceName: resourceName, + ImportStateId: rName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSEcsClusterCapacityProvidersReOrdered(rName), + PlanOnly: true, + }, + }, + }) +} + +func TestAccAWSEcsCluster_CapacityProvidersUpdate(t *testing.T) { + var cluster1 ecs.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + providerName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecs_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcsClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcsClusterCapacityProvidersFargate(rName, providerName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsClusterExists(resourceName, &cluster1), + ), + }, + { + ResourceName: resourceName, + ImportStateId: rName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSEcsClusterCapacityProvidersFargateSpot(rName, providerName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsClusterExists(resourceName, &cluster1), + ), + }, + { + Config: testAccAWSEcsClusterCapacityProvidersFargateBoth(rName, providerName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsClusterExists(resourceName, &cluster1), + ), + }, + }, + }) +} + +func TestAccAWSEcsCluster_CapacityProvidersNoStrategy(t *testing.T) { + var cluster1 ecs.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + providerName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_ecs_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcsClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcsClusterCapacityProvidersFargateNoStrategy(rName, providerName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsClusterExists(resourceName, &cluster1), + ), + }, + { + ResourceName: resourceName, + ImportStateId: rName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSEcsClusterCapacityProvidersFargateSpotNoStrategy(rName, providerName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsClusterExists(resourceName, &cluster1), + ), + }, + }, + }) +} + func TestAccAWSEcsCluster_containerInsights(t *testing.T) { var cluster1 ecs.Cluster rName := acctest.RandomWithPrefix("tf-acc-test") @@ -291,6 +420,144 @@ resource "aws_ecs_cluster" "test" { `, rName, tag1Key, tag1Value) } +func testAccAWSEcsClusterCapacityProviderConfig(rName string) string { + return testAccAWSEcsCapacityProviderConfigBase(rName) + fmt.Sprintf(` +resource "aws_ecs_capacity_provider" "test" { + name = %q + + auto_scaling_group_provider { + auto_scaling_group_arn = aws_autoscaling_group.test.arn + } +} +`, rName) +} + +func testAccAWSEcsClusterSingleCapacityProvider(rName, providerName string) string { + return testAccAWSEcsClusterCapacityProviderConfig(providerName) + fmt.Sprintf(` +resource "aws_ecs_cluster" "test" { + name = %[1]q + + capacity_providers = [aws_ecs_capacity_provider.test.name] + + default_capacity_provider_strategy { + base = 1 + capacity_provider = aws_ecs_capacity_provider.test.name + weight = 1 + } +} +`, rName) +} + +func testAccAWSEcsClusterCapacityProviders(rName string) string { + return fmt.Sprintf(` +resource "aws_ecs_cluster" "test" { + name = %[1]q + + capacity_providers = ["FARGATE_SPOT", "FARGATE"] + + default_capacity_provider_strategy { + capacity_provider = "FARGATE_SPOT" + weight = 1 + base = 1 + } + + default_capacity_provider_strategy { + capacity_provider = "FARGATE" + weight = 1 + } +} +`, rName) +} + +func testAccAWSEcsClusterCapacityProvidersReOrdered(rName string) string { + return fmt.Sprintf(` +resource "aws_ecs_cluster" "test" { + name = %[1]q + + capacity_providers = ["FARGATE", "FARGATE_SPOT"] + + default_capacity_provider_strategy { + capacity_provider = "FARGATE" + weight = 1 + } + + default_capacity_provider_strategy { + capacity_provider = "FARGATE_SPOT" + weight = 1 + base = 1 + } +} +`, rName) +} + +func testAccAWSEcsClusterCapacityProvidersFargate(rName, providerName string) string { + return fmt.Sprintf(` +resource "aws_ecs_cluster" "test" { + name = %[1]q + + capacity_providers = ["FARGATE"] + + default_capacity_provider_strategy { + base = 1 + capacity_provider = "FARGATE" + weight = 1 + } +} +`, rName) +} + +func testAccAWSEcsClusterCapacityProvidersFargateSpot(rName, providerName string) string { + return fmt.Sprintf(` +resource "aws_ecs_cluster" "test" { + name = %[1]q + + capacity_providers = ["FARGATE_SPOT"] + + default_capacity_provider_strategy { + base = 1 + capacity_provider = "FARGATE_SPOT" + weight = 1 + } +} +`, rName) +} + +func testAccAWSEcsClusterCapacityProvidersFargateBoth(rName, providerName string) string { + return fmt.Sprintf(` +resource "aws_ecs_cluster" "test" { + name = %[1]q + + capacity_providers = ["FARGATE", "FARGATE_SPOT"] + + default_capacity_provider_strategy { + base = 1 + capacity_provider = "FARGATE_SPOT" + weight = 1 + } +} +`, rName) +} + +func testAccAWSEcsClusterCapacityProvidersFargateNoStrategy(rName, providerName string) string { + return fmt.Sprintf(` +resource "aws_ecs_cluster" "test" { + name = %[1]q + + capacity_providers = ["FARGATE"] +} +`, rName) +} + +func testAccAWSEcsClusterCapacityProvidersFargateSpotNoStrategy(rName, providerName string) string { + return fmt.Sprintf(` +resource "aws_ecs_cluster" "test" { + name = %[1]q + + capacity_providers = ["FARGATE_SPOT"] +} +`, rName) +} + func testAccAWSEcsClusterConfigTags2(rName, tag1Key, tag1Value, tag2Key, tag2Value string) string { return fmt.Sprintf(` resource "aws_ecs_cluster" "test" { diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index ae10d1f38f6..1f8ab812de1 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsEcsService() *schema.Resource { @@ -34,6 +35,34 @@ func resourceAwsEcsService() *schema.Resource { ForceNew: true, }, + "capacity_provider_strategy": { + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "base": { + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntBetween(0, 100000), + ForceNew: true, + }, + + "capacity_provider": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "weight": { + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntBetween(0, 1000), + ForceNew: true, + }, + }, + }, + }, "cluster": { Type: schema.TypeString, Optional: true, @@ -70,7 +99,11 @@ func resourceAwsEcsService() *schema.Resource { Type: schema.TypeString, ForceNew: true, Optional: true, - Default: "EC2", + Computed: true, + ValidateFunc: validation.StringInSlice([]string{ + ecs.LaunchTypeEc2, + ecs.LaunchTypeFargate, + }, false), }, "platform_version": { @@ -161,9 +194,10 @@ func resourceAwsEcsService() *schema.Resource { }, "target_group_arn": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validateArn, }, "container_name": { @@ -173,9 +207,10 @@ func resourceAwsEcsService() *schema.Resource { }, "container_port": { - Type: schema.TypeInt, - Required: true, - ForceNew: true, + Type: schema.TypeInt, + Required: true, + ForceNew: true, + ValidateFunc: validation.IntBetween(0, 65536), }, }, }, @@ -218,6 +253,11 @@ func resourceAwsEcsService() *schema.Resource { "type": { Type: schema.TypeString, Required: true, + ValidateFunc: validation.StringInSlice([]string{ + ecs.PlacementStrategyTypeBinpack, + ecs.PlacementStrategyTypeRandom, + ecs.PlacementStrategyTypeSpread, + }, false), }, "field": { Type: schema.TypeString, @@ -270,6 +310,10 @@ func resourceAwsEcsService() *schema.Resource { Type: schema.TypeString, ForceNew: true, Required: true, + ValidateFunc: validation.StringInSlice([]string{ + ecs.PlacementConstraintTypeDistinctInstance, + ecs.PlacementConstraintTypeMemberOf, + }, false), }, "expression": { Type: schema.TypeString, @@ -362,7 +406,7 @@ func resourceAwsEcsServiceCreate(d *schema.ResourceData, meta interface{}) error DeploymentController: expandEcsDeploymentController(d.Get("deployment_controller").([]interface{})), SchedulingStrategy: aws.String(schedulingStrategy), ServiceName: aws.String(d.Get("name").(string)), - Tags: tagsFromMapECS(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().EcsTags(), TaskDefinition: aws.String(d.Get("task_definition").(string)), EnableECSManagedTags: aws.Bool(d.Get("enable_ecs_managed_tags").(bool)), } @@ -399,6 +443,8 @@ func resourceAwsEcsServiceCreate(d *schema.ResourceData, meta interface{}) error input.PlatformVersion = aws.String(v.(string)) } + input.CapacityProviderStrategy = expandEcsCapacityProviderStrategy(d.Get("capacity_provider_strategy").(*schema.Set)) + loadBalancers := expandEcsLoadBalancers(d.Get("load_balancer").(*schema.Set).List()) if len(loadBalancers) > 0 { log.Printf("[DEBUG] Adding ECS load balancers: %s", loadBalancers) @@ -481,6 +527,10 @@ func resourceAwsEcsServiceCreate(d *schema.ResourceData, meta interface{}) error if isAWSErr(err, ecs.ErrCodeInvalidParameterException, "does not have an associated load balancer") { return resource.RetryableError(err) } + if isAWSErr(err, ecs.ErrCodeInvalidParameterException, "Unable to assume the service linked role."+ + " Please verify that the ECS service linked role exists") { + return resource.RetryableError(err) + } return resource.NonRetryableError(err) } @@ -495,8 +545,8 @@ func resourceAwsEcsServiceCreate(d *schema.ResourceData, meta interface{}) error service := *out.Service - log.Printf("[DEBUG] ECS service created: %s", *service.ServiceArn) - d.SetId(*service.ServiceArn) + log.Printf("[DEBUG] ECS service created: %s", aws.StringValue(service.ServiceArn)) + d.SetId(aws.StringValue(service.ServiceArn)) return resourceAwsEcsServiceRead(d, meta) } @@ -565,7 +615,7 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { log.Printf("[DEBUG] Received ECS service %s", service) - d.SetId(*service.ServiceArn) + d.SetId(aws.StringValue(service.ServiceArn)) d.Set("name", service.ServiceName) // Save task definition in the same format @@ -615,6 +665,10 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { d.Set("load_balancer", flattenEcsLoadBalancers(service.LoadBalancers)) } + if err := d.Set("capacity_provider_strategy", flattenEcsCapacityProviderStrategy(service.CapacityProviderStrategy)); err != nil { + return fmt.Errorf("error setting capacity_provider_strategy: %s", err) + } + if err := d.Set("ordered_placement_strategy", flattenPlacementStrategy(service.PlacementStrategy)); err != nil { return fmt.Errorf("error setting ordered_placement_strategy: %s", err) } @@ -631,7 +685,7 @@ func resourceAwsEcsServiceRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error setting service_registries for (%s): %s", d.Id(), err) } - if err := d.Set("tags", tagsToMapECS(service.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.EcsKeyValueTags(service.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -702,6 +756,46 @@ func expandEcsNetworkConfiguration(nc []interface{}) *ecs.NetworkConfiguration { return &ecs.NetworkConfiguration{AwsvpcConfiguration: awsVpcConfig} } +func expandEcsCapacityProviderStrategy(cps *schema.Set) []*ecs.CapacityProviderStrategyItem { + list := cps.List() + results := make([]*ecs.CapacityProviderStrategyItem, 0) + for _, raw := range list { + cp := raw.(map[string]interface{}) + ps := &ecs.CapacityProviderStrategyItem{} + if val, ok := cp["base"]; ok { + ps.Base = aws.Int64(int64(val.(int))) + } + if val, ok := cp["weight"]; ok { + ps.Weight = aws.Int64(int64(val.(int))) + } + if val, ok := cp["capacity_provider"]; ok { + ps.CapacityProvider = aws.String(val.(string)) + } + + results = append(results, ps) + } + return results +} + +func flattenEcsCapacityProviderStrategy(cps []*ecs.CapacityProviderStrategyItem) []map[string]interface{} { + if cps == nil { + return nil + } + results := make([]map[string]interface{}, 0) + for _, cp := range cps { + s := make(map[string]interface{}) + s["capacity_provider"] = aws.StringValue(cp.CapacityProvider) + if cp.Weight != nil { + s["weight"] = aws.Int64Value(cp.Weight) + } + if cp.Base != nil { + s["base"] = aws.Int64Value(cp.Base) + } + results = append(results, s) + } + return results +} + func flattenServicePlacementConstraints(pcs []*ecs.PlacementConstraint) []map[string]interface{} { if len(pcs) == 0 { return nil @@ -842,6 +936,11 @@ func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error input.NetworkConfiguration = expandEcsNetworkConfiguration(d.Get("network_configuration").([]interface{})) } + if d.HasChange("capacity_provider_strategy") { + updateService = true + input.CapacityProviderStrategy = expandEcsCapacityProviderStrategy(d.Get("capacity_provider_strategy").(*schema.Set)) + } + if updateService { log.Printf("[DEBUG] Updating ECS Service (%s): %s", d.Id(), input) // Retry due to IAM eventual consistency @@ -867,38 +966,10 @@ func resourceAwsEcsServiceUpdate(d *schema.ResourceData, meta interface{}) error } if d.HasChange("tags") { - oldTagsRaw, newTagsRaw := d.GetChange("tags") - oldTagsMap := oldTagsRaw.(map[string]interface{}) - newTagsMap := newTagsRaw.(map[string]interface{}) - createTags, removeTags := diffTagsECS(tagsFromMapECS(oldTagsMap), tagsFromMapECS(newTagsMap)) - - if len(removeTags) > 0 { - removeTagKeys := make([]*string, len(removeTags)) - for i, removeTag := range removeTags { - removeTagKeys[i] = removeTag.Key - } - - input := &ecs.UntagResourceInput{ - ResourceArn: aws.String(d.Id()), - TagKeys: removeTagKeys, - } + o, n := d.GetChange("tags") - log.Printf("[DEBUG] Untagging ECS Cluster: %s", input) - if _, err := conn.UntagResource(input); err != nil { - return fmt.Errorf("error untagging ECS Cluster (%s): %s", d.Id(), err) - } - } - - if len(createTags) > 0 { - input := &ecs.TagResourceInput{ - ResourceArn: aws.String(d.Id()), - Tags: createTags, - } - - log.Printf("[DEBUG] Tagging ECS Cluster: %s", input) - if _, err := conn.TagResource(input); err != nil { - return fmt.Errorf("error tagging ECS Cluster (%s): %s", d.Id(), err) - } + if err := keyvaluetags.EcsUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating ECS Service (%s) tags: %s", d.Id(), err) } } diff --git a/aws/resource_aws_ecs_service_test.go b/aws/resource_aws_ecs_service_test.go index a749c8e4eaf..53f43dc934a 100644 --- a/aws/resource_aws_ecs_service_test.go +++ b/aws/resource_aws_ecs_service_test.go @@ -227,6 +227,61 @@ func TestAccAWSEcsService_withUnnormalizedPlacementStrategy(t *testing.T) { }) } +func TestAccAWSEcsService_withCapacityProviderStrategy(t *testing.T) { + var service ecs.Service + rString := acctest.RandString(8) + + clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-ups-%s", rString) + tdName := fmt.Sprintf("tf-acc-td-svc-w-ups-%s", rString) + svcName := fmt.Sprintf("tf-acc-svc-w-ups-%s", rString) + providerName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcsServiceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcsServiceWithCapacityProviderStrategy(providerName, clusterName, tdName, svcName, 1, 0), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service), + ), + }, + { + Config: testAccAWSEcsServiceWithCapacityProviderStrategy(providerName, clusterName, tdName, svcName, 10, 1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service), + ), + }, + }, + }) +} + +func TestAccAWSEcsService_withMultipleCapacityProviderStrategies(t *testing.T) { + var service ecs.Service + rString := acctest.RandString(8) + + clusterName := fmt.Sprintf("tf-acc-cluster-svc-w-mcps-%s", rString) + tdName := fmt.Sprintf("tf-acc-td-svc-w-mcps-%s", rString) + svcName := fmt.Sprintf("tf-acc-svc-w-mcps-%s", rString) + sgName := fmt.Sprintf("tf-acc-sg-svc-w-mcps-%s", rString) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcsServiceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcsServiceWithMultipleCapacityProviderStrategies(clusterName, tdName, svcName, sgName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsServiceExists("aws_ecs_service.mongo", &service), + resource.TestCheckResourceAttr("aws_ecs_service.mongo", "capacity_provider_strategy.#", "2"), + ), + }, + }, + }) +} + func TestAccAWSEcsService_withFamilyAndRevision(t *testing.T) { var service ecs.Service rString := acctest.RandString(8) @@ -267,11 +322,6 @@ func TestAccAWSEcsService_withRenamedCluster(t *testing.T) { tdName := fmt.Sprintf("tf-acc-td-svc-w-rc-%s", rString) svcName := fmt.Sprintf("tf-acc-svc-w-rc-%s", rString) - originalRegexp := regexp.MustCompile( - "^arn:aws:ecs:[^:]+:[0-9]+:cluster/" + clusterName + "$") - modifiedRegexp := regexp.MustCompile( - "^arn:aws:ecs:[^:]+:[0-9]+:cluster/" + uClusterName + "$") - resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -281,8 +331,7 @@ func TestAccAWSEcsService_withRenamedCluster(t *testing.T) { Config: testAccAWSEcsServiceWithRenamedCluster(clusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists("aws_ecs_service.ghost", &service), - resource.TestMatchResourceAttr( - "aws_ecs_service.ghost", "cluster", originalRegexp), + resource.TestCheckResourceAttrPair("aws_ecs_service.ghost", "cluster", "aws_ecs_cluster.default", "arn"), ), }, @@ -290,8 +339,7 @@ func TestAccAWSEcsService_withRenamedCluster(t *testing.T) { Config: testAccAWSEcsServiceWithRenamedCluster(uClusterName, tdName, svcName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsServiceExists("aws_ecs_service.ghost", &service), - resource.TestMatchResourceAttr( - "aws_ecs_service.ghost", "cluster", modifiedRegexp), + resource.TestCheckResourceAttrPair("aws_ecs_service.ghost", "cluster", "aws_ecs_cluster.default", "arn"), ), }, }, @@ -1236,6 +1284,127 @@ resource "aws_ecs_service" "mongo" { `, clusterName, tdName, svcName) } +func testAccAWSEcsServiceWithCapacityProviderStrategy(providerName, clusterName, tdName, svcName string, weight, base int) string { + return testAccAWSEcsCapacityProviderConfigBase(providerName) + fmt.Sprintf(` +resource "aws_ecs_capacity_provider" "test" { + name = %q + auto_scaling_group_provider { + auto_scaling_group_arn = aws_autoscaling_group.test.arn + } +} + +resource "aws_ecs_cluster" "default" { + name = "%s" +} + +resource "aws_ecs_task_definition" "mongo" { + family = "%s" + + container_definitions = < 0 { - removeTagKeys := make([]*string, len(removeTags)) - for i, removeTag := range removeTags { - removeTagKeys[i] = removeTag.Key - } + o, n := d.GetChange("tags") - input := &ecs.UntagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - TagKeys: removeTagKeys, - } - - log.Printf("[DEBUG] Untagging ECS Cluster: %s", input) - if _, err := conn.UntagResource(input); err != nil { - return fmt.Errorf("error untagging ECS Cluster (%s): %s", d.Get("arn").(string), err) - } - } - - if len(createTags) > 0 { - input := &ecs.TagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - Tags: createTags, - } - - log.Printf("[DEBUG] Tagging ECS Cluster: %s", input) - if _, err := conn.TagResource(input); err != nil { - return fmt.Errorf("error tagging ECS Cluster (%s): %s", d.Get("arn").(string), err) - } + if err := keyvaluetags.EcsUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating ECS Task Definition (%s) tags: %s", d.Id(), err) } } diff --git a/aws/resource_aws_ecs_task_definition_test.go b/aws/resource_aws_ecs_task_definition_test.go index 7ccfeaacbf9..867eb51550f 100644 --- a/aws/resource_aws_ecs_task_definition_test.go +++ b/aws/resource_aws_ecs_task_definition_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -14,9 +15,8 @@ import ( func TestAccAWSEcsTaskDefinition_basic(t *testing.T) { var def ecs.TaskDefinition - rString := acctest.RandString(8) - tdName := fmt.Sprintf("tf_acc_td_basic_%s", rString) - resourceName := "aws_ecs_task_definition.jenkins" + tdName := acctest.RandomWithPrefix("tf-acc-td-basic") + resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -27,12 +27,14 @@ func TestAccAWSEcsTaskDefinition_basic(t *testing.T) { Config: testAccAWSEcsTaskDefinition(tdName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ecs", regexp.MustCompile(`task-definition/.+`)), ), }, { Config: testAccAWSEcsTaskDefinitionModified(tdName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "ecs", regexp.MustCompile(`task-definition/.+`)), ), }, { @@ -49,8 +51,8 @@ func TestAccAWSEcsTaskDefinition_basic(t *testing.T) { func TestAccAWSEcsTaskDefinition_withScratchVolume(t *testing.T) { var def ecs.TaskDefinition - rString := acctest.RandString(8) - tdName := fmt.Sprintf("tf_acc_td_with_scratch_volume_%s", rString) + tdName := acctest.RandomWithPrefix("tf-acc-td-with-scratch-volume") + resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -60,9 +62,15 @@ func TestAccAWSEcsTaskDefinition_withScratchVolume(t *testing.T) { { Config: testAccAWSEcsTaskDefinitionWithScratchVolume(tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.sleep", &def), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, }, }) } @@ -70,8 +78,8 @@ func TestAccAWSEcsTaskDefinition_withScratchVolume(t *testing.T) { func TestAccAWSEcsTaskDefinition_withDockerVolume(t *testing.T) { var def ecs.TaskDefinition - rString := acctest.RandString(8) - tdName := fmt.Sprintf("tf_acc_td_with_docker_volume_%s", rString) + tdName := acctest.RandomWithPrefix("tf-acc-td-with-docker-volume") + resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -81,31 +89,26 @@ func TestAccAWSEcsTaskDefinition_withDockerVolume(t *testing.T) { { Config: testAccAWSEcsTaskDefinitionWithDockerVolumes(tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.sleep", &def), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.#", "1"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.#", "1"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.0.scope", "shared"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.0.autoprovision", "true"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.0.driver", "local"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.0.driver_opts.%", "2"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.0.driver_opts.uid", "1000"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.0.driver_opts.device", "tmpfs"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.0.labels.%", "2"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.0.labels.stack", "april"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.0.labels.environment", "test"), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), + resource.TestCheckResourceAttr(resourceName, "volume.#", "1"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.docker_volume_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.docker_volume_configuration.0.scope", "shared"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.docker_volume_configuration.0.autoprovision", "true"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.docker_volume_configuration.0.driver", "local"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.docker_volume_configuration.0.driver_opts.%", "2"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.docker_volume_configuration.0.driver_opts.uid", "1000"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.docker_volume_configuration.0.driver_opts.device", "tmpfs"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.docker_volume_configuration.0.labels.%", "2"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.docker_volume_configuration.0.labels.stack", "april"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.docker_volume_configuration.0.labels.environment", "test"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, }, }) } @@ -113,8 +116,8 @@ func TestAccAWSEcsTaskDefinition_withDockerVolume(t *testing.T) { func TestAccAWSEcsTaskDefinition_withDockerVolumeMinimalConfig(t *testing.T) { var def ecs.TaskDefinition - rString := acctest.RandString(8) - tdName := fmt.Sprintf("tf_acc_td_with_docker_volume_%s", rString) + tdName := acctest.RandomWithPrefix("tf-acc-td-with-docker-volume") + resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -124,17 +127,82 @@ func TestAccAWSEcsTaskDefinition_withDockerVolumeMinimalConfig(t *testing.T) { { Config: testAccAWSEcsTaskDefinitionWithDockerVolumesMinimalConfig(tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.sleep", &def), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.#", "1"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.#", "1"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.0.scope", "task"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.0.driver", "local"), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), + resource.TestCheckResourceAttr(resourceName, "volume.#", "1"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.docker_volume_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.docker_volume_configuration.0.scope", "task"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.docker_volume_configuration.0.driver", "local"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEcsTaskDefinition_withEFSVolumeMinimal(t *testing.T) { + var def ecs.TaskDefinition + + tdName := acctest.RandomWithPrefix("tf-acc-td-with-efs-volume-min") + resourceName := "aws_ecs_task_definition.test" + efsResourceName := "aws_efs_file_system.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcsTaskDefinitionWithEFSVolumeMinimal(tdName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), + resource.TestCheckResourceAttr(resourceName, "volume.#", "1"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.efs_volume_configuration.#", "1"), + resource.TestCheckResourceAttrPair(resourceName, "volume.584193650.efs_volume_configuration.0.file_system_id", efsResourceName, "id"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEcsTaskDefinition_withEFSVolume(t *testing.T) { + var def ecs.TaskDefinition + + tdName := acctest.RandomWithPrefix("tf-acc-td-with-efs-volume") + resourceName := "aws_ecs_task_definition.test" + efsResourceName := "aws_efs_file_system.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEcsTaskDefinitionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEcsTaskDefinitionWithEFSVolume(tdName, "/home/test"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), + resource.TestCheckResourceAttr(resourceName, "volume.#", "1"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.efs_volume_configuration.#", "1"), + resource.TestCheckResourceAttrPair(resourceName, "volume.584193650.efs_volume_configuration.0.file_system_id", efsResourceName, "id"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.efs_volume_configuration.0.root_directory", "/home/test"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, }, }) } @@ -142,8 +210,8 @@ func TestAccAWSEcsTaskDefinition_withDockerVolumeMinimalConfig(t *testing.T) { func TestAccAWSEcsTaskDefinition_withTaskScopedDockerVolume(t *testing.T) { var def ecs.TaskDefinition - rString := acctest.RandString(8) - tdName := fmt.Sprintf("tf_acc_td_with_docker_volume_%s", rString) + tdName := acctest.RandomWithPrefix("tf-acc-td-with-docker-volume") + resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -153,18 +221,19 @@ func TestAccAWSEcsTaskDefinition_withTaskScopedDockerVolume(t *testing.T) { { Config: testAccAWSEcsTaskDefinitionWithTaskScopedDockerVolume(tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.sleep", &def), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), testAccCheckAWSTaskDefinitionDockerVolumeConfigurationAutoprovisionNil(&def), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.#", "1"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.#", "1"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.0.scope", "task"), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "volume.584193650.docker_volume_configuration.0.driver", "local"), + resource.TestCheckResourceAttr(resourceName, "volume.#", "1"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.docker_volume_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "volume.584193650.docker_volume_configuration.0.scope", "task"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, }, }) } @@ -174,10 +243,10 @@ func TestAccAWSEcsTaskDefinition_withEcsService(t *testing.T) { var def ecs.TaskDefinition var service ecs.Service - rString := acctest.RandString(8) - clusterName := fmt.Sprintf("tf_acc_cluster_with_ecs_service_%s", rString) - svcName := fmt.Sprintf("tf_acc_td_with_ecs_service_%s", rString) - tdName := fmt.Sprintf("tf_acc_td_with_ecs_service_%s", rString) + clusterName := acctest.RandomWithPrefix("tf-acc-cluster-with-ecs-service") + svcName := acctest.RandomWithPrefix("tf-acc-td-with-ecs-service") + tdName := acctest.RandomWithPrefix("tf-acc-td-with-ecs-service") + resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -187,17 +256,23 @@ func TestAccAWSEcsTaskDefinition_withEcsService(t *testing.T) { { Config: testAccAWSEcsTaskDefinitionWithEcsService(clusterName, svcName, tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.sleep", &def), - testAccCheckAWSEcsServiceExists("aws_ecs_service.sleep-svc", &service), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), + testAccCheckAWSEcsServiceExists("aws_ecs_service.test", &service), ), }, { Config: testAccAWSEcsTaskDefinitionWithEcsServiceModified(clusterName, svcName, tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.sleep", &def), - testAccCheckAWSEcsServiceExists("aws_ecs_service.sleep-svc", &service), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), + testAccCheckAWSEcsServiceExists("aws_ecs_service.test", &service), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, }, }) } @@ -205,10 +280,10 @@ func TestAccAWSEcsTaskDefinition_withEcsService(t *testing.T) { func TestAccAWSEcsTaskDefinition_withTaskRoleArn(t *testing.T) { var def ecs.TaskDefinition - rString := acctest.RandString(8) - roleName := fmt.Sprintf("tf_acc_role_ecs_td_with_task_role_arn_%s", rString) - policyName := fmt.Sprintf("tf-acc-policy-ecs-td-with-task-role-arn-%s", rString) - tdName := fmt.Sprintf("tf_acc_td_with_task_role_arn_%s", rString) + roleName := acctest.RandomWithPrefix("tf-acc-role-ecs-td-with-task-role-arn") + policyName := acctest.RandomWithPrefix("tf-acc-policy-ecs-td-with-task-role-arn") + tdName := acctest.RandomWithPrefix("tf-acc-td-with-task-role-arn") + resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -218,9 +293,15 @@ func TestAccAWSEcsTaskDefinition_withTaskRoleArn(t *testing.T) { { Config: testAccAWSEcsTaskDefinitionWithTaskRoleArn(roleName, policyName, tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.sleep", &def), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, }, }) } @@ -228,10 +309,10 @@ func TestAccAWSEcsTaskDefinition_withTaskRoleArn(t *testing.T) { func TestAccAWSEcsTaskDefinition_withNetworkMode(t *testing.T) { var def ecs.TaskDefinition - rString := acctest.RandString(8) - roleName := fmt.Sprintf("tf_acc_ecs_td_with_network_mode_%s", rString) - policyName := fmt.Sprintf("tf_acc_ecs_td_with_network_mode_%s", rString) - tdName := fmt.Sprintf("tf_acc_td_with_network_mode_%s", rString) + roleName := acctest.RandomWithPrefix("tf-acc-ecs-td-with-network-mode") + policyName := acctest.RandomWithPrefix("tf-acc-ecs-td-with-network-mode") + tdName := acctest.RandomWithPrefix("tf-acc-td-with-network-mode") + resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -241,11 +322,16 @@ func TestAccAWSEcsTaskDefinition_withNetworkMode(t *testing.T) { { Config: testAccAWSEcsTaskDefinitionWithNetworkMode(roleName, policyName, tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.sleep", &def), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "network_mode", "bridge"), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), + resource.TestCheckResourceAttr(resourceName, "network_mode", "bridge"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, }, }) } @@ -253,10 +339,10 @@ func TestAccAWSEcsTaskDefinition_withNetworkMode(t *testing.T) { func TestAccAWSEcsTaskDefinition_withIPCMode(t *testing.T) { var def ecs.TaskDefinition - rString := acctest.RandString(8) - roleName := fmt.Sprintf("tf_acc_ecs_td_with_ipc_mode_%s", rString) - policyName := fmt.Sprintf("tf_acc_ecs_td_with_ipc_mode_%s", rString) - tdName := fmt.Sprintf("tf_acc_td_with_ipc_mode_%s", rString) + roleName := acctest.RandomWithPrefix("tf-acc-ecs-td-with-ipc-mode") + policyName := acctest.RandomWithPrefix("tf-acc-ecs-td-with-ipc-mode") + tdName := acctest.RandomWithPrefix("tf-acc-td-with-ipc-mode") + resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -266,11 +352,16 @@ func TestAccAWSEcsTaskDefinition_withIPCMode(t *testing.T) { { Config: testAccAWSEcsTaskDefinitionWithIpcMode(roleName, policyName, tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.sleep", &def), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "ipc_mode", "host"), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), + resource.TestCheckResourceAttr(resourceName, "ipc_mode", "host"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, }, }) } @@ -278,10 +369,10 @@ func TestAccAWSEcsTaskDefinition_withIPCMode(t *testing.T) { func TestAccAWSEcsTaskDefinition_withPidMode(t *testing.T) { var def ecs.TaskDefinition - rString := acctest.RandString(8) - roleName := fmt.Sprintf("tf_acc_ecs_td_with_pid_mode_%s", rString) - policyName := fmt.Sprintf("tf_acc_ecs_td_with_pid_mode_%s", rString) - tdName := fmt.Sprintf("tf_acc_td_with_pid_mode_%s", rString) + roleName := acctest.RandomWithPrefix("tf-acc-ecs-td-with-pid-mode") + policyName := acctest.RandomWithPrefix("tf-acc-ecs-td-with-pid-mode") + tdName := acctest.RandomWithPrefix("tf-acc-td-with-pid-mode") + resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -291,11 +382,16 @@ func TestAccAWSEcsTaskDefinition_withPidMode(t *testing.T) { { Config: testAccAWSEcsTaskDefinitionWithPidMode(roleName, policyName, tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.sleep", &def), - resource.TestCheckResourceAttr( - "aws_ecs_task_definition.sleep", "pid_mode", "host"), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), + resource.TestCheckResourceAttr(resourceName, "pid_mode", "host"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, }, }) } @@ -303,8 +399,8 @@ func TestAccAWSEcsTaskDefinition_withPidMode(t *testing.T) { func TestAccAWSEcsTaskDefinition_constraint(t *testing.T) { var def ecs.TaskDefinition - rString := acctest.RandString(8) - tdName := fmt.Sprintf("tf_acc_td_constraint_%s", rString) + tdName := acctest.RandomWithPrefix("tf-acc-td-constraint") + resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -314,11 +410,17 @@ func TestAccAWSEcsTaskDefinition_constraint(t *testing.T) { { Config: testAccAWSEcsTaskDefinition_constraint(tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.jenkins", &def), - resource.TestCheckResourceAttr("aws_ecs_task_definition.jenkins", "placement_constraints.#", "1"), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), + resource.TestCheckResourceAttr(resourceName, "placement_constraints.#", "1"), testAccCheckAWSTaskDefinitionConstraintsAttrs(&def), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, }, }) } @@ -327,8 +429,8 @@ func TestAccAWSEcsTaskDefinition_changeVolumesForcesNewResource(t *testing.T) { var before ecs.TaskDefinition var after ecs.TaskDefinition - rString := acctest.RandString(8) - tdName := fmt.Sprintf("tf_acc_td_change_vol_forces_new_resource_%s", rString) + tdName := acctest.RandomWithPrefix("tf-acc-td-change-vol-forces-new-resource") + resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -338,16 +440,22 @@ func TestAccAWSEcsTaskDefinition_changeVolumesForcesNewResource(t *testing.T) { { Config: testAccAWSEcsTaskDefinition(tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.jenkins", &before), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &before), ), }, { Config: testAccAWSEcsTaskDefinitionUpdatedVolume(tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.jenkins", &after), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &after), testAccCheckEcsTaskDefinitionRecreated(t, &before, &after), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, }, }) } @@ -355,9 +463,9 @@ func TestAccAWSEcsTaskDefinition_changeVolumesForcesNewResource(t *testing.T) { // Regression for https://github.com/terraform-providers/terraform-provider-aws/issues/2336 func TestAccAWSEcsTaskDefinition_arrays(t *testing.T) { var conf ecs.TaskDefinition + resourceName := "aws_ecs_task_definition.test" - rString := acctest.RandString(8) - tdName := fmt.Sprintf("tf_acc_td_arrays_%s", rString) + tdName := acctest.RandomWithPrefix("tf-acc-td-arrays") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -367,9 +475,15 @@ func TestAccAWSEcsTaskDefinition_arrays(t *testing.T) { { Config: testAccAWSEcsTaskDefinitionArrays(tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.test", &conf), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &conf), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, }, }) } @@ -377,8 +491,8 @@ func TestAccAWSEcsTaskDefinition_arrays(t *testing.T) { func TestAccAWSEcsTaskDefinition_Fargate(t *testing.T) { var conf ecs.TaskDefinition - rString := acctest.RandString(8) - tdName := fmt.Sprintf("tf_acc_td_fargate_%s", rString) + tdName := acctest.RandomWithPrefix("tf-acc-td-fargate") + resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -388,12 +502,18 @@ func TestAccAWSEcsTaskDefinition_Fargate(t *testing.T) { { Config: testAccAWSEcsTaskDefinitionFargate(tdName, `[{"protocol": "tcp", "containerPort": 8000}]`), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.fargate", &conf), - resource.TestCheckResourceAttr("aws_ecs_task_definition.fargate", "requires_compatibilities.#", "1"), - resource.TestCheckResourceAttr("aws_ecs_task_definition.fargate", "cpu", "256"), - resource.TestCheckResourceAttr("aws_ecs_task_definition.fargate", "memory", "512"), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "requires_compatibilities.#", "1"), + resource.TestCheckResourceAttr(resourceName, "cpu", "256"), + resource.TestCheckResourceAttr(resourceName, "memory", "512"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, { ExpectNonEmptyPlan: false, PlanOnly: true, @@ -406,10 +526,10 @@ func TestAccAWSEcsTaskDefinition_Fargate(t *testing.T) { func TestAccAWSEcsTaskDefinition_ExecutionRole(t *testing.T) { var conf ecs.TaskDefinition - rString := acctest.RandString(8) - roleName := fmt.Sprintf("tf_acc_role_ecs_td_execution_role_%s", rString) - policyName := fmt.Sprintf("tf-acc-policy-ecs-td-execution-role-%s", rString) - tdName := fmt.Sprintf("tf_acc_td_execution_role_%s", rString) + roleName := acctest.RandomWithPrefix("tf-acc-role-ecs-td-execution-role") + policyName := acctest.RandomWithPrefix("tf-acc-policy-ecs-td-execution-role") + tdName := acctest.RandomWithPrefix("tf-acc-td-execution-role") + resourceName := "aws_ecs_task_definition.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -419,9 +539,15 @@ func TestAccAWSEcsTaskDefinition_ExecutionRole(t *testing.T) { { Config: testAccAWSEcsTaskDefinitionExecutionRole(roleName, policyName, tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.fargate", &conf), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &conf), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, }, }) } @@ -430,8 +556,8 @@ func TestAccAWSEcsTaskDefinition_ExecutionRole(t *testing.T) { func TestAccAWSEcsTaskDefinition_Inactive(t *testing.T) { var def ecs.TaskDefinition - rString := acctest.RandString(8) - tdName := fmt.Sprintf("tf_acc_td_basic_%s", rString) + tdName := acctest.RandomWithPrefix("tf-acc-td-basic") + resourceName := "aws_ecs_task_definition.test" markTaskDefinitionInactive := func() { conn := testAccProvider.Meta().(*AWSClient).ecsconn @@ -453,13 +579,19 @@ func TestAccAWSEcsTaskDefinition_Inactive(t *testing.T) { { Config: testAccAWSEcsTaskDefinition(tdName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEcsTaskDefinitionExists("aws_ecs_task_definition.jenkins", &def), + testAccCheckAWSEcsTaskDefinitionExists(resourceName, &def), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, { Config: testAccAWSEcsTaskDefinition(tdName), PreConfig: markTaskDefinitionInactive, - Check: resource.TestCheckResourceAttr("aws_ecs_task_definition.jenkins", "revision", "2"), // should get re-created + Check: resource.TestCheckResourceAttr(resourceName, "revision", "2"), // should get re-created }, }, }) @@ -483,6 +615,12 @@ func TestAccAWSEcsTaskDefinition_Tags(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEcsTaskDefinitionImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, { Config: testAccAWSEcsTaskDefinitionConfigTags2(rName, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeTestCheckFunc( @@ -697,7 +835,7 @@ func testAccCheckAWSEcsTaskDefinitionDestroy(s *terraform.State) error { return err } - if out.TaskDefinition != nil && *out.TaskDefinition.Status != "INACTIVE" { + if out.TaskDefinition != nil && *out.TaskDefinition.Status != ecs.TaskDefinitionStatusInactive { return fmt.Errorf("ECS task definition still exists:\n%#v", *out.TaskDefinition) } } @@ -744,7 +882,7 @@ func testAccCheckAWSTaskDefinitionDockerVolumeConfigurationAutoprovisionNil(def func testAccAWSEcsTaskDefinition_constraint(tdName string) string { return fmt.Sprintf(` -resource "aws_ecs_task_definition" "jenkins" { +resource "aws_ecs_task_definition" "test" { family = "%s" container_definitions = < 0 { for _, igw := range resp.EgressOnlyInternetGateways { if aws.StringValue(igw.EgressOnlyInternetGatewayId) == id { - found = true - break + return igw } } } - return found + return nil } func resourceAwsEgressOnlyInternetGatewayDelete(d *schema.ResourceData, meta interface{}) error { diff --git a/aws/resource_aws_egress_only_internet_gateway_test.go b/aws/resource_aws_egress_only_internet_gateway_test.go index 8305db19dfa..49ebe1cc81c 100644 --- a/aws/resource_aws_egress_only_internet_gateway_test.go +++ b/aws/resource_aws_egress_only_internet_gateway_test.go @@ -63,6 +63,8 @@ func testSweepEc2EgressOnlyInternetGateways(region string) error { func TestAccAWSEgressOnlyInternetGateway_basic(t *testing.T) { var igw ec2.EgressOnlyInternetGateway + resourceName := "aws_egress_only_internet_gateway.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -71,9 +73,14 @@ func TestAccAWSEgressOnlyInternetGateway_basic(t *testing.T) { { Config: testAccAWSEgressOnlyInternetGatewayConfig_basic, Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSEgressOnlyInternetGatewayExists("aws_egress_only_internet_gateway.foo", &igw), + testAccCheckAWSEgressOnlyInternetGatewayExists(resourceName, &igw), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -132,15 +139,16 @@ func testAccCheckAWSEgressOnlyInternetGatewayExists(n string, igw *ec2.EgressOnl } const testAccAWSEgressOnlyInternetGatewayConfig_basic = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - assign_generated_ipv6_cidr_block = true - tags = { - Name = "terraform-testacc-egress-only-igw-basic" - } +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + assign_generated_ipv6_cidr_block = true + + tags = { + Name = "terraform-testacc-egress-only-igw-basic" + } } -resource "aws_egress_only_internet_gateway" "foo" { - vpc_id = "${aws_vpc.foo.id}" +resource "aws_egress_only_internet_gateway" "test" { + vpc_id = "${aws_vpc.test.id}" } ` diff --git a/aws/resource_aws_eip.go b/aws/resource_aws_eip.go index 0ae376dcadb..e820bb832a3 100644 --- a/aws/resource_aws_eip.go +++ b/aws/resource_aws_eip.go @@ -12,6 +12,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsEip() *schema.Resource { @@ -141,9 +142,9 @@ func resourceAwsEipCreate(d *schema.ResourceData, meta interface{}) error { log.Printf("[INFO] EIP ID: %s (domain: %v)", d.Id(), *allocResp.Domain) - if _, ok := d.GetOk("tags"); ok { - if err := setTags(ec2conn, d); err != nil { - return fmt.Errorf("Error creating EIP tags: %s", err) + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + if err := keyvaluetags.Ec2UpdateTags(ec2conn, d.Id(), nil, v); err != nil { + return fmt.Errorf("error adding tags: %s", err) } } @@ -272,7 +273,9 @@ func resourceAwsEipRead(d *schema.ResourceData, meta interface{}) error { d.SetId(*address.AllocationId) } - d.Set("tags", tagsToMap(address.Tags)) + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(address.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } @@ -355,9 +358,10 @@ func resourceAwsEipUpdate(d *schema.ResourceData, meta interface{}) error { } } - if _, ok := d.GetOk("tags"); ok { - if err := setTags(ec2conn, d); err != nil { - return fmt.Errorf("Error updating EIP tags: %s", err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.Ec2UpdateTags(ec2conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating EIP (%s) tags: %s", d.Id(), err) } } diff --git a/aws/resource_aws_eip_association_test.go b/aws/resource_aws_eip_association_test.go index 124ee536ebd..ae6a795d6aa 100644 --- a/aws/resource_aws_eip_association_test.go +++ b/aws/resource_aws_eip_association_test.go @@ -12,8 +12,9 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSEIPAssociation_importInstance(t *testing.T) { +func TestAccAWSEIPAssociation_instance(t *testing.T) { resourceName := "aws_eip_association.test" + var a ec2.Address resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -22,6 +23,14 @@ func TestAccAWSEIPAssociation_importInstance(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccAWSEIPAssociationConfig_instance, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEIPExists( + "aws_eip.test", &a), + testAccCheckAWSEIPAssociationExists( + resourceName, &a), + testAccCheckAWSEIPAssociationExists( + resourceName, &a), + ), }, { ResourceName: resourceName, @@ -32,8 +41,9 @@ func TestAccAWSEIPAssociation_importInstance(t *testing.T) { }) } -func TestAccAWSEIPAssociation_importNetworkInterface(t *testing.T) { +func TestAccAWSEIPAssociation_networkInterface(t *testing.T) { resourceName := "aws_eip_association.test" + var a ec2.Address resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -42,6 +52,12 @@ func TestAccAWSEIPAssociation_importNetworkInterface(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccAWSEIPAssociationConfig_networkInterface, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEIPExists( + "aws_eip.test", &a), + testAccCheckAWSEIPAssociationExists( + resourceName, &a), + ), }, { ResourceName: resourceName, @@ -54,9 +70,10 @@ func TestAccAWSEIPAssociation_importNetworkInterface(t *testing.T) { func TestAccAWSEIPAssociation_basic(t *testing.T) { var a ec2.Address + resourceName := "aws_eip_association.by_allocation_id" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccEC2VPCOnlyPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPAssociationDestroy, Steps: []resource.TestStep{ @@ -64,25 +81,31 @@ func TestAccAWSEIPAssociation_basic(t *testing.T) { Config: testAccAWSEIPAssociationConfig, Check: resource.ComposeTestCheckFunc( testAccCheckAWSEIPExists( - "aws_eip.bar.0", &a), + "aws_eip.test.0", &a), testAccCheckAWSEIPAssociationExists( "aws_eip_association.by_allocation_id", &a), testAccCheckAWSEIPExists( - "aws_eip.bar.1", &a), + "aws_eip.test.1", &a), testAccCheckAWSEIPAssociationExists( "aws_eip_association.by_public_ip", &a), testAccCheckAWSEIPExists( - "aws_eip.bar.2", &a), + "aws_eip.test.2", &a), testAccCheckAWSEIPAssociationExists( "aws_eip_association.to_eni", &a), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSEIPAssociation_ec2Classic(t *testing.T) { var a ec2.Address + resourceName := "aws_eip_association.test" oldvar := os.Getenv("AWS_DEFAULT_REGION") os.Setenv("AWS_DEFAULT_REGION", "us-east-1") @@ -97,12 +120,17 @@ func TestAccAWSEIPAssociation_ec2Classic(t *testing.T) { Config: testAccAWSEIPAssociationConfig_ec2Classic, Check: resource.ComposeTestCheckFunc( testAccCheckAWSEIPExists("aws_eip.test", &a), - testAccCheckAWSEIPAssociationExists("aws_eip_association.test", &a), - resource.TestCheckResourceAttrSet("aws_eip_association.test", "public_ip"), - resource.TestCheckResourceAttr("aws_eip_association.test", "allocation_id", ""), - testAccCheckAWSEIPAssociationHasIpBasedId("aws_eip_association.test", &a), + testAccCheckAWSEIPAssociationExists(resourceName, &a), + resource.TestCheckResourceAttrSet(resourceName, "public_ip"), + resource.TestCheckResourceAttr(resourceName, "allocation_id", ""), + testAccCheckAWSEIPAssociationHasIpBasedId(resourceName, &a), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -110,6 +138,7 @@ func TestAccAWSEIPAssociation_ec2Classic(t *testing.T) { func TestAccAWSEIPAssociation_spotInstance(t *testing.T) { var a ec2.Address rInt := acctest.RandInt() + resourceName := "aws_eip_association.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -120,11 +149,16 @@ func TestAccAWSEIPAssociation_spotInstance(t *testing.T) { Config: testAccAWSEIPAssociationConfig_spotInstance(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckAWSEIPExists("aws_eip.test", &a), - testAccCheckAWSEIPAssociationExists("aws_eip_association.test", &a), - resource.TestCheckResourceAttrSet("aws_eip_association.test", "allocation_id"), - resource.TestCheckResourceAttrSet("aws_eip_association.test", "instance_id"), + testAccCheckAWSEIPAssociationExists(resourceName, &a), + resource.TestCheckResourceAttrSet(resourceName, "allocation_id"), + resource.TestCheckResourceAttrSet(resourceName, "instance_id"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -248,61 +282,90 @@ func testAccCheckAWSEIPAssociationDestroy(s *terraform.State) error { } const testAccAWSEIPAssociationConfig = ` -resource "aws_vpc" "main" { +data "aws_availability_zones" "available" { + state = "available" +} + +resource "aws_vpc" "test" { cidr_block = "192.168.0.0/24" tags = { Name = "terraform-testacc-eip-association" } } -resource "aws_subnet" "sub" { - vpc_id = "${aws_vpc.main.id}" + +data "aws_ami" "amzn-ami-minimal-pv" { + most_recent = true + owners = ["amazon"] + + filter { + name = "name" + values = ["amzn-ami-minimal-pv-*"] + } +} + +resource "aws_subnet" "test" { + vpc_id = "${aws_vpc.test.id}" cidr_block = "192.168.0.0/25" - availability_zone = "us-west-2a" + availability_zone = "${data.aws_availability_zones.available.names[0]}" tags = { Name = "tf-acc-eip-association" } } -resource "aws_internet_gateway" "igw" { - vpc_id = "${aws_vpc.main.id}" +resource "aws_internet_gateway" "test" { + vpc_id = "${aws_vpc.test.id}" } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { count = 2 - ami = "ami-21f78e11" - availability_zone = "us-west-2a" - instance_type = "t1.micro" - subnet_id = "${aws_subnet.sub.id}" + ami = "${data.aws_ami.amzn-ami-minimal-pv.id}" + availability_zone = "${data.aws_availability_zones.available.names[0]}" + instance_type = "m1.small" + subnet_id = "${aws_subnet.test.id}" private_ip = "192.168.0.${count.index+10}" } -resource "aws_eip" "bar" { +resource "aws_eip" "test" { count = 3 vpc = true } resource "aws_eip_association" "by_allocation_id" { - allocation_id = "${aws_eip.bar.0.id}" - instance_id = "${aws_instance.foo.0.id}" - depends_on = ["aws_instance.foo"] + allocation_id = "${aws_eip.test.0.id}" + instance_id = "${aws_instance.test.0.id}" + depends_on = ["aws_instance.test"] } resource "aws_eip_association" "by_public_ip" { - public_ip = "${aws_eip.bar.1.public_ip}" - instance_id = "${aws_instance.foo.1.id}" - depends_on = ["aws_instance.foo"] + public_ip = "${aws_eip.test.1.public_ip}" + instance_id = "${aws_instance.test.1.id}" + depends_on = ["aws_instance.test"] } resource "aws_eip_association" "to_eni" { - allocation_id = "${aws_eip.bar.2.id}" - network_interface_id = "${aws_network_interface.baz.id}" + allocation_id = "${aws_eip.test.2.id}" + network_interface_id = "${aws_network_interface.test.id}" } -resource "aws_network_interface" "baz" { - subnet_id = "${aws_subnet.sub.id}" +resource "aws_network_interface" "test" { + subnet_id = "${aws_subnet.test.id}" private_ips = ["192.168.0.50"] - depends_on = ["aws_instance.foo"] + depends_on = ["aws_instance.test"] attachment { - instance = "${aws_instance.foo.0.id}" + instance = "${aws_instance.test.0.id}" device_index = 1 } } ` const testAccAWSEIPAssociationConfigDisappears = ` +data "aws_availability_zones" "available" { + state = "available" +} + +data "aws_ami" "amzn-ami-minimal-pv" { + most_recent = true + owners = ["amazon"] + + filter { + name = "name" + values = ["amzn-ami-minimal-pv-*"] + } +} + resource "aws_vpc" "main" { cidr_block = "192.168.0.0/24" tags = { @@ -312,7 +375,7 @@ resource "aws_vpc" "main" { resource "aws_subnet" "sub" { vpc_id = "${aws_vpc.main.id}" cidr_block = "192.168.0.0/25" - availability_zone = "us-west-2a" + availability_zone = "${data.aws_availability_zones.available.names[0]}" tags = { Name = "tf-acc-eip-association-disappears" } @@ -321,9 +384,9 @@ resource "aws_internet_gateway" "igw" { vpc_id = "${aws_vpc.main.id}" } resource "aws_instance" "foo" { - ami = "ami-21f78e11" - availability_zone = "us-west-2a" - instance_type = "t1.micro" + ami = "${data.aws_ami.amzn-ami-minimal-pv.id}" + availability_zone = "${data.aws_availability_zones.available.names[0]}" + instance_type = "m1.small" subnet_id = "${aws_subnet.sub.id}" } resource "aws_eip" "bar" { @@ -341,7 +404,9 @@ provider "aws" { resource "aws_eip" "test" {} -data "aws_availability_zones" "available" {} +data "aws_availability_zones" "available" { + state = "available" +} data "aws_ami" "ubuntu" { most_recent = true diff --git a/aws/resource_aws_eip_test.go b/aws/resource_aws_eip_test.go index 6b68fcaa257..0476d9e5801 100644 --- a/aws/resource_aws_eip_test.go +++ b/aws/resource_aws_eip_test.go @@ -85,12 +85,13 @@ func testSweepEc2Eips(region string) error { return nil } -func TestAccAWSEIP_importEc2Classic(t *testing.T) { +func TestAccAWSEIP_Ec2Classic(t *testing.T) { oldvar := os.Getenv("AWS_DEFAULT_REGION") os.Setenv("AWS_DEFAULT_REGION", "us-east-1") defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - resourceName := "aws_eip.bar" + resourceName := "aws_eip.test" + var conf ec2.Address resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, @@ -99,26 +100,11 @@ func TestAccAWSEIP_importEc2Classic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccAWSEIPInstanceEc2Classic, - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - -func TestAccAWSEIP_importVpc(t *testing.T) { - resourceName := "aws_eip.bar" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSEIPDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSEIPNetworkInterfaceConfig, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEIPExists(resourceName, &conf), + testAccCheckAWSEIPAttributes(&conf), + testAccCheckAWSEIPPublicDNS(resourceName), + ), }, { ResourceName: resourceName, @@ -131,46 +117,57 @@ func TestAccAWSEIP_importVpc(t *testing.T) { func TestAccAWSEIP_basic(t *testing.T) { var conf ec2.Address + resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_eip.bar", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, Steps: []resource.TestStep{ { Config: testAccAWSEIPConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEIPExists("aws_eip.bar", &conf), + testAccCheckAWSEIPExists(resourceName, &conf), testAccCheckAWSEIPAttributes(&conf), - testAccCheckAWSEIPPublicDNS("aws_eip.bar"), + testAccCheckAWSEIPPublicDNS(resourceName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSEIP_instance(t *testing.T) { var conf ec2.Address + resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_eip.bar", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, Steps: []resource.TestStep{ { Config: testAccAWSEIPInstanceConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEIPExists("aws_eip.bar", &conf), + testAccCheckAWSEIPExists(resourceName, &conf), testAccCheckAWSEIPAttributes(&conf), ), }, - + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSEIPInstanceConfig2, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEIPExists("aws_eip.bar", &conf), + testAccCheckAWSEIPExists(resourceName, &conf), testAccCheckAWSEIPAttributes(&conf), ), }, @@ -178,48 +175,62 @@ func TestAccAWSEIP_instance(t *testing.T) { }) } -func TestAccAWSEIP_network_interface(t *testing.T) { +func TestAccAWSEIP_networkInterface(t *testing.T) { var conf ec2.Address + resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_eip.bar", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, Steps: []resource.TestStep{ { Config: testAccAWSEIPNetworkInterfaceConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEIPExists("aws_eip.bar", &conf), + testAccCheckAWSEIPExists(resourceName, &conf), testAccCheckAWSEIPAttributes(&conf), testAccCheckAWSEIPAssociated(&conf), - testAccCheckAWSEIPPrivateDNS("aws_eip.bar"), + testAccCheckAWSEIPPrivateDNS(resourceName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSEIP_twoEIPsOneNetworkInterface(t *testing.T) { var one, two ec2.Address + resourceName := "aws_eip.test" + resourceName2 := "aws_eip.test2" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_eip.one", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, Steps: []resource.TestStep{ { Config: testAccAWSEIPMultiNetworkInterfaceConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEIPExists("aws_eip.one", &one), + testAccCheckAWSEIPExists(resourceName, &one), testAccCheckAWSEIPAttributes(&one), testAccCheckAWSEIPAssociated(&one), - testAccCheckAWSEIPExists("aws_eip.two", &two), + testAccCheckAWSEIPExists(resourceName2, &two), testAccCheckAWSEIPAttributes(&two), testAccCheckAWSEIPAssociated(&two), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"associate_with_private_ip"}, + }, }, }) } @@ -228,26 +239,32 @@ func TestAccAWSEIP_twoEIPsOneNetworkInterface(t *testing.T) { // associated Private EIPs of two instances func TestAccAWSEIP_associated_user_private_ip(t *testing.T) { var one ec2.Address + resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_eip.bar", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, Steps: []resource.TestStep{ { Config: testAccAWSEIPInstanceConfig_associated, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEIPExists("aws_eip.bar", &one), + testAccCheckAWSEIPExists(resourceName, &one), testAccCheckAWSEIPAttributes(&one), testAccCheckAWSEIPAssociated(&one), ), }, - + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"associate_with_private_ip"}, + }, { Config: testAccAWSEIPInstanceConfig_associated_switch, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEIPExists("aws_eip.bar", &one), + testAccCheckAWSEIPExists(resourceName, &one), testAccCheckAWSEIPAttributes(&one), testAccCheckAWSEIPAssociated(&one), ), @@ -272,10 +289,10 @@ func TestAccAWSEIP_classic_disassociate(t *testing.T) { Config: testAccAWSEIP_classic_disassociate("instance-store"), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet( - "aws_eip.ip.0", + "aws_eip.test.0", "instance"), resource.TestCheckResourceAttrSet( - "aws_eip.ip.1", + "aws_eip.test.1", "instance"), ), }, @@ -283,10 +300,10 @@ func TestAccAWSEIP_classic_disassociate(t *testing.T) { Config: testAccAWSEIP_classic_disassociate("ebs"), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttrSet( - "aws_eip.ip.0", + "aws_eip.test.0", "instance"), resource.TestCheckResourceAttrSet( - "aws_eip.ip.1", + "aws_eip.test.1", "instance"), ), }, @@ -296,6 +313,7 @@ func TestAccAWSEIP_classic_disassociate(t *testing.T) { func TestAccAWSEIP_disappears(t *testing.T) { var conf ec2.Address + resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -305,7 +323,7 @@ func TestAccAWSEIP_disappears(t *testing.T) { { Config: testAccAWSEIPConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEIPExists("aws_eip.bar", &conf), + testAccCheckAWSEIPExists(resourceName, &conf), testAccCheckAWSEIPDisappears(&conf), ), ExpectNonEmptyPlan: true, @@ -314,27 +332,32 @@ func TestAccAWSEIP_disappears(t *testing.T) { }) } -func TestAccAWSEIPAssociate_not_associated(t *testing.T) { +func TestAccAWSEIPAssociate_notAssociated(t *testing.T) { var conf ec2.Address + resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_eip.bar", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, Steps: []resource.TestStep{ { Config: testAccAWSEIPAssociate_not_associated, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEIPExists("aws_eip.bar", &conf), + testAccCheckAWSEIPExists(resourceName, &conf), testAccCheckAWSEIPAttributes(&conf), ), }, - + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSEIPAssociate_associated, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSEIPExists("aws_eip.bar", &conf), + testAccCheckAWSEIPExists(resourceName, &conf), testAccCheckAWSEIPAttributes(&conf), testAccCheckAWSEIPAssociated(&conf), ), @@ -345,13 +368,13 @@ func TestAccAWSEIPAssociate_not_associated(t *testing.T) { func TestAccAWSEIP_tags(t *testing.T) { var conf ec2.Address - resourceName := "aws_eip.bar" + resourceName := "aws_eip.test" rName1 := fmt.Sprintf("%s-%d", t.Name(), acctest.RandInt()) rName2 := fmt.Sprintf("%s-%d", t.Name(), acctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_eip.bar", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSEIPDestroy, Steps: []resource.TestStep{ @@ -365,6 +388,11 @@ func TestAccAWSEIP_tags(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "tags.TestName", t.Name()), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSEIPConfig_tags(rName2, t.Name()), Check: resource.ComposeTestCheckFunc( @@ -381,7 +409,7 @@ func TestAccAWSEIP_tags(t *testing.T) { func TestAccAWSEIP_PublicIpv4Pool_default(t *testing.T) { var conf ec2.Address - resourceName := "aws_eip.bar" + resourceName := "aws_eip.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -397,6 +425,11 @@ func TestAccAWSEIP_PublicIpv4Pool_default(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "public_ipv4_pool", "amazon"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -407,7 +440,7 @@ func TestAccAWSEIP_PublicIpv4Pool_custom(t *testing.T) { } var conf ec2.Address - resourceName := "aws_eip.bar" + resourceName := "aws_eip.test" poolName := os.Getenv("AWS_EC2_EIP_PUBLIC_IPV4_POOL") @@ -425,6 +458,11 @@ func TestAccAWSEIP_PublicIpv4Pool_custom(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "public_ipv4_pool", poolName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -608,13 +646,13 @@ func testAccCheckAWSEIPPublicDNS(resourceName string) resource.TestCheckFunc { } const testAccAWSEIPConfig = ` -resource "aws_eip" "bar" { +resource "aws_eip" "test" { } ` func testAccAWSEIPConfig_tags(rName, testName string) string { return fmt.Sprintf(` -resource "aws_eip" "bar" { +resource "aws_eip" "test" { tags = { RandomName = "%[1]s" TestName = "%[2]s" @@ -624,14 +662,14 @@ resource "aws_eip" "bar" { } const testAccAWSEIPConfig_PublicIpv4Pool_default = ` -resource "aws_eip" "bar" { +resource "aws_eip" "test" { vpc = true } ` func testAccAWSEIPConfig_PublicIpv4Pool_custom(poolName string) string { return fmt.Sprintf(` -resource "aws_eip" "bar" { +resource "aws_eip" "test" { vpc = true public_ipv4_pool = "%s" } @@ -657,7 +695,7 @@ data "aws_ami" "amzn-ami-minimal-pv" { } } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "${data.aws_ami.amzn-ami-minimal-pv.id}" instance_type = "m1.small" tags = { @@ -665,8 +703,8 @@ resource "aws_instance" "foo" { } } -resource "aws_eip" "bar" { - instance = "${aws_instance.foo.id}" +resource "aws_eip" "test" { + instance = "${aws_instance.test.id}" } ` @@ -685,13 +723,13 @@ data "aws_ami" "amzn-ami-minimal-pv" { } } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "${data.aws_ami.amzn-ami-minimal-pv.id}" instance_type = "m1.small" } -resource "aws_eip" "bar" { - instance = "${aws_instance.foo.id}" +resource "aws_eip" "test" { + instance = "${aws_instance.test.id}" } ` @@ -710,13 +748,13 @@ data "aws_ami" "amzn-ami-minimal-pv" { } } -resource "aws_instance" "bar" { +resource "aws_instance" "test" { ami = "${data.aws_ami.amzn-ami-minimal-pv.id}" instance_type = "m1.small" } -resource "aws_eip" "bar" { - instance = "${aws_instance.bar.id}" +resource "aws_eip" "test" { + instance = "${aws_instance.test.id}" } ` @@ -764,7 +802,7 @@ resource "aws_subnet" "tf_test_subnet" { } } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "${data.aws_ami.amzn-ami-minimal-hvm.id}" instance_type = "t2.micro" @@ -772,11 +810,11 @@ resource "aws_instance" "foo" { subnet_id = "${aws_subnet.tf_test_subnet.id}" tags = { - Name = "foo instance" + Name = "test instance" } } -resource "aws_instance" "bar" { +resource "aws_instance" "test2" { ami = "${data.aws_ami.amzn-ami-minimal-hvm.id}" instance_type = "t2.micro" @@ -785,14 +823,14 @@ resource "aws_instance" "bar" { subnet_id = "${aws_subnet.tf_test_subnet.id}" tags = { - Name = "bar instance" + Name = "test2 instance" } } -resource "aws_eip" "bar" { +resource "aws_eip" "test" { vpc = true - instance = "${aws_instance.bar.id}" + instance = "${aws_instance.test2.id}" associate_with_private_ip = "10.0.0.19" } ` @@ -840,7 +878,7 @@ resource "aws_subnet" "tf_test_subnet" { } } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "${data.aws_ami.amzn-ami-minimal-hvm.id}" instance_type = "t2.micro" @@ -848,11 +886,11 @@ resource "aws_instance" "foo" { subnet_id = "${aws_subnet.tf_test_subnet.id}" tags = { - Name = "foo instance" + Name = "test instance" } } -resource "aws_instance" "bar" { +resource "aws_instance" "test2" { ami = "${data.aws_ami.amzn-ami-minimal-hvm.id}" instance_type = "t2.micro" @@ -861,91 +899,99 @@ resource "aws_instance" "bar" { subnet_id = "${aws_subnet.tf_test_subnet.id}" tags = { - Name = "bar instance" + Name = "test2 instance" } } -resource "aws_eip" "bar" { +resource "aws_eip" "test" { vpc = true - instance = "${aws_instance.foo.id}" + instance = "${aws_instance.test.id}" associate_with_private_ip = "10.0.0.12" } ` const testAccAWSEIPNetworkInterfaceConfig = ` -resource "aws_vpc" "bar" { +data "aws_availability_zones" "available" { + state = "available" +} + +resource "aws_vpc" "test" { cidr_block = "10.0.0.0/24" tags = { Name = "terraform-testacc-eip-network-interface" } } -resource "aws_internet_gateway" "bar" { - vpc_id = "${aws_vpc.bar.id}" +resource "aws_internet_gateway" "test" { + vpc_id = "${aws_vpc.test.id}" } -resource "aws_subnet" "bar" { - vpc_id = "${aws_vpc.bar.id}" - availability_zone = "us-west-2a" +resource "aws_subnet" "test" { + vpc_id = "${aws_vpc.test.id}" + availability_zone = "${data.aws_availability_zones.available.names[0]}" cidr_block = "10.0.0.0/24" tags = { Name = "tf-acc-eip-network-interface" } } -resource "aws_network_interface" "bar" { - subnet_id = "${aws_subnet.bar.id}" +resource "aws_network_interface" "test" { + subnet_id = "${aws_subnet.test.id}" private_ips = ["10.0.0.10"] - security_groups = [ "${aws_vpc.bar.default_security_group_id}" ] + security_groups = [ "${aws_vpc.test.default_security_group_id}" ] } -resource "aws_eip" "bar" { +resource "aws_eip" "test" { vpc = "true" - network_interface = "${aws_network_interface.bar.id}" - depends_on = ["aws_internet_gateway.bar"] + network_interface = "${aws_network_interface.test.id}" + depends_on = ["aws_internet_gateway.test"] } ` const testAccAWSEIPMultiNetworkInterfaceConfig = ` -resource "aws_vpc" "bar" { +data "aws_availability_zones" "available" { + state = "available" +} + +resource "aws_vpc" "test" { cidr_block = "10.0.0.0/24" tags = { Name = "terraform-testacc-eip-multi-network-interface" } } -resource "aws_internet_gateway" "bar" { - vpc_id = "${aws_vpc.bar.id}" +resource "aws_internet_gateway" "test" { + vpc_id = "${aws_vpc.test.id}" } -resource "aws_subnet" "bar" { - vpc_id = "${aws_vpc.bar.id}" - availability_zone = "us-west-2a" +resource "aws_subnet" "test" { + vpc_id = "${aws_vpc.test.id}" + availability_zone = "${data.aws_availability_zones.available.names[0]}" cidr_block = "10.0.0.0/24" tags = { Name = "tf-acc-eip-multi-network-interface" } } -resource "aws_network_interface" "bar" { - subnet_id = "${aws_subnet.bar.id}" +resource "aws_network_interface" "test" { + subnet_id = "${aws_subnet.test.id}" private_ips = ["10.0.0.10", "10.0.0.11"] - security_groups = ["${aws_vpc.bar.default_security_group_id}"] + security_groups = ["${aws_vpc.test.default_security_group_id}"] } -resource "aws_eip" "one" { +resource "aws_eip" "test" { vpc = "true" - network_interface = "${aws_network_interface.bar.id}" + network_interface = "${aws_network_interface.test.id}" associate_with_private_ip = "10.0.0.10" - depends_on = ["aws_internet_gateway.bar"] + depends_on = ["aws_internet_gateway.test"] } -resource "aws_eip" "two" { +resource "aws_eip" "test2" { vpc = "true" - network_interface = "${aws_network_interface.bar.id}" + network_interface = "${aws_network_interface.test.id}" associate_with_private_ip = "10.0.0.11" - depends_on = ["aws_internet_gateway.bar"] + depends_on = ["aws_internet_gateway.test"] } ` @@ -973,7 +1019,11 @@ data "aws_ami" "amzn-ami-minimal-pv" { } } -resource "aws_eip" "ip" { +data "aws_availability_zones" "available" { + state = "available" +} + +resource "aws_eip" "test" { count = "${var.server_count}" instance = "${element(aws_instance.example.*.id, count.index)}" vpc = true @@ -985,8 +1035,8 @@ resource "aws_instance" "example" { ami = "${data.aws_ami.amzn-ami-minimal-pv.id}" instance_type = "m1.small" associate_public_ip_address = true - subnet_id = "${aws_subnet.us-east-1b-public.id}" - availability_zone = "${aws_subnet.us-east-1b-public.availability_zone}" + subnet_id = "${aws_subnet.us-east-1-0-public.id}" + availability_zone = "${aws_subnet.us-east-1-0-public.availability_zone}" tags = { Name = "testAccAWSEIP_classic_disassociate" @@ -1008,11 +1058,11 @@ resource "aws_internet_gateway" "example" { vpc_id = "${aws_vpc.example.id}" } -resource "aws_subnet" "us-east-1b-public" { +resource "aws_subnet" "us-east-1-0-public" { vpc_id = "${aws_vpc.example.id}" cidr_block = "10.0.0.0/24" - availability_zone = "us-east-1b" + availability_zone = "${data.aws_availability_zones.available.names[0]}" tags = { Name = "tf-acc-eip-classic-disassociate" } @@ -1027,8 +1077,8 @@ resource "aws_route_table" "us-east-1-public" { } } -resource "aws_route_table_association" "us-east-1b-public" { - subnet_id = "${aws_subnet.us-east-1b-public.id}" +resource "aws_route_table_association" "us-east-1-0-public" { + subnet_id = "${aws_subnet.us-east-1-0-public.id}" route_table_id = "${aws_route_table.us-east-1-public.id}" } `, rootDeviceType) @@ -1049,12 +1099,12 @@ data "aws_ami" "amzn-ami-minimal-pv" { } } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "${data.aws_ami.amzn-ami-minimal-pv.id}" instance_type = "m1.small" } -resource "aws_eip" "bar" { +resource "aws_eip" "test" { } ` @@ -1073,12 +1123,12 @@ data "aws_ami" "amzn-ami-minimal-pv" { } } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "${data.aws_ami.amzn-ami-minimal-pv.id}" instance_type = "m1.small" } -resource "aws_eip" "bar" { - instance = "${aws_instance.foo.id}" +resource "aws_eip" "test" { + instance = "${aws_instance.test.id}" } ` diff --git a/aws/resource_aws_eks_cluster.go b/aws/resource_aws_eks_cluster.go index 0f50efd11ff..6ed55e4166a 100644 --- a/aws/resource_aws_eks_cluster.go +++ b/aws/resource_aws_eks_cluster.go @@ -118,6 +118,10 @@ func resourceAwsEksCluster() *schema.Resource { Required: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + "cluster_security_group_id": { + Type: schema.TypeString, + Computed: true, + }, "endpoint_private_access": { Type: schema.TypeBool, Optional: true, @@ -141,6 +145,15 @@ func resourceAwsEksCluster() *schema.Resource { MinItems: 1, Elem: &schema.Schema{Type: schema.TypeString}, }, + "public_access_cidrs": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validateCIDRNetworkAddress, + }, + }, "vpc_id": { Type: schema.TypeString, Computed: true, @@ -188,6 +201,10 @@ func resourceAwsEksClusterCreate(d *schema.ResourceData, meta interface{}) error if isAWSErr(err, eks.ErrCodeInvalidParameterException, "does not exist") { return resource.RetryableError(err) } + // InvalidParameterException: Error in role params + if isAWSErr(err, eks.ErrCodeInvalidParameterException, "Error in role params") { + return resource.RetryableError(err) + } if isAWSErr(err, eks.ErrCodeInvalidParameterException, "Role could not be assumed because the trusted entity is not correct") { return resource.RetryableError(err) } @@ -346,7 +363,7 @@ func resourceAwsEksClusterUpdate(d *schema.ResourceData, meta interface{}) error } } - if d.HasChange("vpc_config.0.endpoint_private_access") || d.HasChange("vpc_config.0.endpoint_public_access") { + if d.HasChange("vpc_config.0.endpoint_private_access") || d.HasChange("vpc_config.0.endpoint_public_access") || d.HasChange("vpc_config.0.public_access_cidrs") { input := &eks.UpdateClusterConfigInput{ Name: aws.String(d.Id()), ResourcesVpcConfig: expandEksVpcConfigUpdateRequest(d.Get("vpc_config").([]interface{})), @@ -419,12 +436,18 @@ func expandEksVpcConfigRequest(l []interface{}) *eks.VpcConfigRequest { m := l[0].(map[string]interface{}) - return &eks.VpcConfigRequest{ + vpcConfigRequest := &eks.VpcConfigRequest{ EndpointPrivateAccess: aws.Bool(m["endpoint_private_access"].(bool)), EndpointPublicAccess: aws.Bool(m["endpoint_public_access"].(bool)), SecurityGroupIds: expandStringSet(m["security_group_ids"].(*schema.Set)), SubnetIds: expandStringSet(m["subnet_ids"].(*schema.Set)), } + + if v, ok := m["public_access_cidrs"].(*schema.Set); ok && v.Len() > 0 { + vpcConfigRequest.PublicAccessCidrs = expandStringSet(v) + } + + return vpcConfigRequest } func expandEksVpcConfigUpdateRequest(l []interface{}) *eks.VpcConfigRequest { @@ -434,10 +457,16 @@ func expandEksVpcConfigUpdateRequest(l []interface{}) *eks.VpcConfigRequest { m := l[0].(map[string]interface{}) - return &eks.VpcConfigRequest{ + vpcConfigRequest := &eks.VpcConfigRequest{ EndpointPrivateAccess: aws.Bool(m["endpoint_private_access"].(bool)), EndpointPublicAccess: aws.Bool(m["endpoint_public_access"].(bool)), } + + if v, ok := m["public_access_cidrs"].(*schema.Set); ok && v.Len() > 0 { + vpcConfigRequest.PublicAccessCidrs = expandStringSet(v) + } + + return vpcConfigRequest } func expandEksLoggingTypes(vEnabledLogTypes *schema.Set) *eks.Logging { @@ -503,11 +532,13 @@ func flattenEksVpcConfigResponse(vpcConfig *eks.VpcConfigResponse) []map[string] } m := map[string]interface{}{ - "endpoint_private_access": aws.BoolValue(vpcConfig.EndpointPrivateAccess), - "endpoint_public_access": aws.BoolValue(vpcConfig.EndpointPublicAccess), - "security_group_ids": schema.NewSet(schema.HashString, flattenStringList(vpcConfig.SecurityGroupIds)), - "subnet_ids": schema.NewSet(schema.HashString, flattenStringList(vpcConfig.SubnetIds)), - "vpc_id": aws.StringValue(vpcConfig.VpcId), + "cluster_security_group_id": aws.StringValue(vpcConfig.ClusterSecurityGroupId), + "endpoint_private_access": aws.BoolValue(vpcConfig.EndpointPrivateAccess), + "endpoint_public_access": aws.BoolValue(vpcConfig.EndpointPublicAccess), + "security_group_ids": schema.NewSet(schema.HashString, flattenStringList(vpcConfig.SecurityGroupIds)), + "subnet_ids": schema.NewSet(schema.HashString, flattenStringList(vpcConfig.SubnetIds)), + "public_access_cidrs": schema.NewSet(schema.HashString, flattenStringList(vpcConfig.PublicAccessCidrs)), + "vpc_id": aws.StringValue(vpcConfig.VpcId), } return []map[string]interface{}{m} diff --git a/aws/resource_aws_eks_cluster_test.go b/aws/resource_aws_eks_cluster_test.go index 4351921e023..e4a70e0a018 100644 --- a/aws/resource_aws_eks_cluster_test.go +++ b/aws/resource_aws_eks_cluster_test.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/eks" + multierror "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" @@ -20,6 +21,10 @@ func init() { resource.AddTestSweepers("aws_eks_cluster", &resource.Sweeper{ Name: "aws_eks_cluster", F: testSweepEksClusters, + Dependencies: []string{ + "aws_eks_fargate_profile", + "aws_eks_fargate_node_group", + }, }) } @@ -30,45 +35,35 @@ func testSweepEksClusters(region string) error { } conn := client.(*AWSClient).eksconn + var errors error input := &eks.ListClustersInput{} - for { - out, err := conn.ListClusters(input) - if err != nil { - if testSweepSkipSweepError(err) { - log.Printf("[WARN] Skipping EKS Clusters sweep for %s: %s", region, err) - return nil - } - return fmt.Errorf("Error retrieving EKS Clusters: %s", err) - } - - if out == nil || len(out.Clusters) == 0 { - log.Printf("[INFO] No EKS Clusters to sweep") - return nil - } - - for _, cluster := range out.Clusters { + err = conn.ListClustersPages(input, func(page *eks.ListClustersOutput, lastPage bool) bool { + for _, cluster := range page.Clusters { name := aws.StringValue(cluster) log.Printf("[INFO] Deleting EKS Cluster: %s", name) err := deleteEksCluster(conn, name) if err != nil { - log.Printf("[ERROR] Failed to delete EKS Cluster %s: %s", name, err) + errors = multierror.Append(errors, fmt.Errorf("error deleting EKS Cluster %q: %w", name, err)) continue } err = waitForDeleteEksCluster(conn, name, 15*time.Minute) if err != nil { - log.Printf("[ERROR] Failed to wait for EKS Cluster %s deletion: %s", name, err) + errors = multierror.Append(errors, fmt.Errorf("error waiting for EKS Cluster %q deletion: %w", name, err)) + continue } } - - if out.NextToken == nil { - break - } - - input.NextToken = out.NextToken + return true + }) + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping EKS Clusters sweep for %s: %s", region, err) + return errors // In case we have completed some pages, but had errors + } + if err != nil { + errors = multierror.Append(errors, fmt.Errorf("error retrieving EKS Clusters: %w", err)) } - return nil + return errors } func TestAccAWSEksCluster_basic(t *testing.T) { @@ -362,6 +357,42 @@ func TestAccAWSEksCluster_VpcConfig_EndpointPublicAccess(t *testing.T) { }) } +func TestAccAWSEksCluster_VpcConfig_PublicAccessCidrs(t *testing.T) { + var cluster1 eks.Cluster + + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + resourceName := "aws_eks_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksClusterConfig_VpcConfig_PublicAccessCidrs(rName, `["1.2.3.4/32", "5.6.7.8/32"]`), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksClusterExists(resourceName, &cluster1), + resource.TestCheckResourceAttr(resourceName, "vpc_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "vpc_config.0.public_access_cidrs.#", "2"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSEksClusterConfig_VpcConfig_PublicAccessCidrs(rName, `["4.3.2.1/32", "8.7.6.5/32"]`), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksClusterExists(resourceName, &cluster1), + resource.TestCheckResourceAttr(resourceName, "vpc_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "vpc_config.0.public_access_cidrs.#", "2"), + ), + }, + }, + }) +} + func testAccCheckAWSEksClusterExists(resourceName string, cluster *eks.Cluster) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[resourceName] @@ -667,3 +698,23 @@ resource "aws_eks_cluster" "test" { } `, testAccAWSEksClusterConfig_Base(rName), rName, endpointPublicAccess) } + +func testAccAWSEksClusterConfig_VpcConfig_PublicAccessCidrs(rName string, publicAccessCidr string) string { + return fmt.Sprintf(` +%[1]s + +resource "aws_eks_cluster" "test" { + name = %[2]q + role_arn = "${aws_iam_role.test.arn}" + + vpc_config { + endpoint_private_access = true + endpoint_public_access = true + public_access_cidrs = %s + subnet_ids = ["${aws_subnet.test.*.id[0]}", "${aws_subnet.test.*.id[1]}"] + } + + depends_on = ["aws_iam_role_policy_attachment.test-AmazonEKSClusterPolicy", "aws_iam_role_policy_attachment.test-AmazonEKSServicePolicy"] +} +`, testAccAWSEksClusterConfig_Base(rName), rName, publicAccessCidr) +} diff --git a/aws/resource_aws_eks_fargate_profile.go b/aws/resource_aws_eks_fargate_profile.go new file mode 100644 index 00000000000..939dda3bc66 --- /dev/null +++ b/aws/resource_aws_eks_fargate_profile.go @@ -0,0 +1,351 @@ +package aws + +import ( + "fmt" + "log" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/eks" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +func resourceAwsEksFargateProfile() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsEksFargateProfileCreate, + Read: resourceAwsEksFargateProfileRead, + Update: resourceAwsEksFargateProfileUpdate, + Delete: resourceAwsEksFargateProfileDelete, + + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(10 * time.Minute), + Delete: schema.DefaultTimeout(10 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "cluster_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.NoZeroValues, + }, + "fargate_profile_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.NoZeroValues, + }, + "pod_execution_role_arn": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.NoZeroValues, + }, + "selector": { + Type: schema.TypeSet, + Required: true, + ForceNew: true, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "labels": { + Type: schema.TypeMap, + Optional: true, + ForceNew: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "namespace": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.NoZeroValues, + }, + }, + }, + }, + "status": { + Type: schema.TypeString, + Computed: true, + }, + "subnet_ids": { + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + MinItems: 1, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "tags": tagsSchema(), + }, + } +} + +func resourceAwsEksFargateProfileCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).eksconn + clusterName := d.Get("cluster_name").(string) + fargateProfileName := d.Get("fargate_profile_name").(string) + id := fmt.Sprintf("%s:%s", clusterName, fargateProfileName) + + input := &eks.CreateFargateProfileInput{ + ClientRequestToken: aws.String(resource.UniqueId()), + ClusterName: aws.String(clusterName), + FargateProfileName: aws.String(fargateProfileName), + PodExecutionRoleArn: aws.String(d.Get("pod_execution_role_arn").(string)), + Selectors: expandEksFargateProfileSelectors(d.Get("selector").(*schema.Set).List()), + Subnets: expandStringSet(d.Get("subnet_ids").(*schema.Set)), + } + + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + input.Tags = keyvaluetags.New(v).IgnoreAws().EksTags() + } + + err := resource.Retry(2*time.Minute, func() *resource.RetryError { + _, err := conn.CreateFargateProfile(input) + + // Retry for IAM eventual consistency on error: + // InvalidParameterException: Misconfigured PodExecutionRole Trust Policy; Please add the eks-fargate-pods.amazonaws.com Service Principal + if isAWSErr(err, eks.ErrCodeInvalidParameterException, "Misconfigured PodExecutionRole Trust Policy") { + return resource.RetryableError(err) + } + + if err != nil { + return resource.NonRetryableError(err) + } + + return nil + }) + + if isResourceTimeoutError(err) { + _, err = conn.CreateFargateProfile(input) + } + + if err != nil { + return fmt.Errorf("error creating EKS Fargate Profile (%s): %s", id, err) + } + + d.SetId(id) + + stateConf := resource.StateChangeConf{ + Pending: []string{eks.FargateProfileStatusCreating}, + Target: []string{eks.FargateProfileStatusActive}, + Timeout: d.Timeout(schema.TimeoutCreate), + Refresh: refreshEksFargateProfileStatus(conn, clusterName, fargateProfileName), + } + + if _, err := stateConf.WaitForState(); err != nil { + return fmt.Errorf("error waiting for EKS Fargate Profile (%s) creation: %s", d.Id(), err) + } + + return resourceAwsEksFargateProfileRead(d, meta) +} + +func resourceAwsEksFargateProfileRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).eksconn + + clusterName, fargateProfileName, err := resourceAwsEksFargateProfileParseId(d.Id()) + if err != nil { + return err + } + + input := &eks.DescribeFargateProfileInput{ + ClusterName: aws.String(clusterName), + FargateProfileName: aws.String(fargateProfileName), + } + + output, err := conn.DescribeFargateProfile(input) + + if isAWSErr(err, eks.ErrCodeResourceNotFoundException, "") { + log.Printf("[WARN] EKS Fargate Profile (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + if err != nil { + return fmt.Errorf("error reading EKS Fargate Profile (%s): %s", d.Id(), err) + } + + fargateProfile := output.FargateProfile + + if fargateProfile == nil { + log.Printf("[WARN] EKS Fargate Profile (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + d.Set("arn", fargateProfile.FargateProfileArn) + d.Set("cluster_name", fargateProfile.ClusterName) + d.Set("fargate_profile_name", fargateProfile.FargateProfileName) + d.Set("pod_execution_role_arn", fargateProfile.PodExecutionRoleArn) + + if err := d.Set("selector", flattenEksFargateProfileSelectors(fargateProfile.Selectors)); err != nil { + return fmt.Errorf("error setting selector: %s", err) + } + + d.Set("status", fargateProfile.Status) + + if err := d.Set("subnet_ids", aws.StringValueSlice(fargateProfile.Subnets)); err != nil { + return fmt.Errorf("error setting subnets: %s", err) + } + + if err := d.Set("tags", keyvaluetags.EksKeyValueTags(fargateProfile.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + return nil +} + +func resourceAwsEksFargateProfileUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).eksconn + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.EksUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + + return resourceAwsEksFargateProfileRead(d, meta) +} + +func resourceAwsEksFargateProfileDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).eksconn + + clusterName, fargateProfileName, err := resourceAwsEksFargateProfileParseId(d.Id()) + if err != nil { + return err + } + + input := &eks.DeleteFargateProfileInput{ + ClusterName: aws.String(clusterName), + FargateProfileName: aws.String(fargateProfileName), + } + + _, err = conn.DeleteFargateProfile(input) + + if isAWSErr(err, eks.ErrCodeResourceNotFoundException, "") { + return nil + } + + if err != nil { + return fmt.Errorf("error deleting EKS Fargate Profile (%s): %s", d.Id(), err) + } + + if err := waitForEksFargateProfileDeletion(conn, clusterName, fargateProfileName, d.Timeout(schema.TimeoutDelete)); err != nil { + return fmt.Errorf("error waiting for EKS Fargate Profile (%s) deletion: %s", d.Id(), err) + } + + return nil +} + +func expandEksFargateProfileSelectors(l []interface{}) []*eks.FargateProfileSelector { + if len(l) == 0 { + return nil + } + + fargateProfileSelectors := make([]*eks.FargateProfileSelector, 0, len(l)) + + for _, mRaw := range l { + m, ok := mRaw.(map[string]interface{}) + + if !ok { + continue + } + + fargateProfileSelector := &eks.FargateProfileSelector{} + + if v, ok := m["labels"].(map[string]interface{}); ok && len(v) > 0 { + fargateProfileSelector.Labels = stringMapToPointers(v) + } + + if v, ok := m["namespace"].(string); ok && v != "" { + fargateProfileSelector.Namespace = aws.String(v) + } + + fargateProfileSelectors = append(fargateProfileSelectors, fargateProfileSelector) + } + + return fargateProfileSelectors +} + +func flattenEksFargateProfileSelectors(fargateProfileSelectors []*eks.FargateProfileSelector) []map[string]interface{} { + if len(fargateProfileSelectors) == 0 { + return []map[string]interface{}{} + } + + l := make([]map[string]interface{}, 0, len(fargateProfileSelectors)) + + for _, fargateProfileSelector := range fargateProfileSelectors { + m := map[string]interface{}{ + "labels": aws.StringValueMap(fargateProfileSelector.Labels), + "namespace": aws.StringValue(fargateProfileSelector.Namespace), + } + + l = append(l, m) + } + + return l +} + +func refreshEksFargateProfileStatus(conn *eks.EKS, clusterName string, fargateProfileName string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + input := &eks.DescribeFargateProfileInput{ + ClusterName: aws.String(clusterName), + FargateProfileName: aws.String(fargateProfileName), + } + + output, err := conn.DescribeFargateProfile(input) + + if err != nil { + return "", "", err + } + + fargateProfile := output.FargateProfile + + if fargateProfile == nil { + return fargateProfile, "", fmt.Errorf("EKS Fargate Profile (%s:%s) missing", clusterName, fargateProfileName) + } + + return fargateProfile, aws.StringValue(fargateProfile.Status), nil + } +} + +func waitForEksFargateProfileDeletion(conn *eks.EKS, clusterName string, fargateProfileName string, timeout time.Duration) error { + stateConf := resource.StateChangeConf{ + Pending: []string{ + eks.FargateProfileStatusActive, + eks.FargateProfileStatusDeleting, + }, + Target: []string{""}, + Timeout: timeout, + Refresh: refreshEksFargateProfileStatus(conn, clusterName, fargateProfileName), + } + + _, err := stateConf.WaitForState() + + if isAWSErr(err, eks.ErrCodeResourceNotFoundException, "") { + return nil + } + + return err +} + +func resourceAwsEksFargateProfileParseId(id string) (string, string, error) { + parts := strings.Split(id, ":") + + if len(parts) != 2 || parts[0] == "" || parts[1] == "" { + return "", "", fmt.Errorf("unexpected format of ID (%s), expected cluster-name:fargate-profile-name", id) + } + + return parts[0], parts[1], nil +} diff --git a/aws/resource_aws_eks_fargate_profile_test.go b/aws/resource_aws_eks_fargate_profile_test.go new file mode 100644 index 00000000000..50617362970 --- /dev/null +++ b/aws/resource_aws_eks_fargate_profile_test.go @@ -0,0 +1,594 @@ +package aws + +import ( + "fmt" + "log" + "regexp" + "testing" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/eks" + multierror "github.com/hashicorp/go-multierror" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func init() { + resource.AddTestSweepers("aws_eks_fargate_profile", &resource.Sweeper{ + Name: "aws_eks_fargate_profile", + F: testSweepEksFargateProfiles, + }) +} + +func testSweepEksFargateProfiles(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + conn := client.(*AWSClient).eksconn + + var errors error + input := &eks.ListClustersInput{} + err = conn.ListClustersPages(input, func(page *eks.ListClustersOutput, lastPage bool) bool { + for _, cluster := range page.Clusters { + clusterName := aws.StringValue(cluster) + input := &eks.ListFargateProfilesInput{ + ClusterName: cluster, + } + err := conn.ListFargateProfilesPages(input, func(page *eks.ListFargateProfilesOutput, lastPage bool) bool { + for _, profile := range page.FargateProfileNames { + profileName := aws.StringValue(profile) + log.Printf("[INFO] Deleting Fargate Profile %q", profileName) + input := &eks.DeleteFargateProfileInput{ + ClusterName: cluster, + FargateProfileName: profile, + } + _, err := conn.DeleteFargateProfile(input) + + if err != nil && !isAWSErr(err, eks.ErrCodeResourceNotFoundException, "") { + errors = multierror.Append(errors, fmt.Errorf("error deleting EKS Fargate Profile %q: %w", profileName, err)) + continue + } + + if err := waitForEksFargateProfileDeletion(conn, clusterName, profileName, 10*time.Minute); err != nil { + errors = multierror.Append(errors, fmt.Errorf("error waiting for EKS Fargate Profile %q deletion: %w", profileName, err)) + continue + } + } + return true + }) + if err != nil { + errors = multierror.Append(errors, fmt.Errorf("error listing Fargate Profiles for EKS Cluster %s: %w", clusterName, err)) + } + } + + return true + }) + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping EKS Clusters sweep for %s: %s", region, err) + return errors // In case we have completed some pages, but had errors + } + if err != nil { + errors = multierror.Append(errors, fmt.Errorf("error retrieving EKS Clusters: %w", err)) + } + + return errors +} + +func TestAccAWSEksFargateProfile_basic(t *testing.T) { + var fargateProfile eks.FargateProfile + rName := acctest.RandomWithPrefix("tf-acc-test") + eksClusterResourceName := "aws_eks_cluster.test" + iamRoleResourceName := "aws_iam_role.pod" + resourceName := "aws_eks_fargate_profile.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t); testAccPreCheckAWSEksFargateProfile(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksFargateProfileDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksFargateProfileConfigFargateProfileName(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksFargateProfileExists(resourceName, &fargateProfile), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "eks", regexp.MustCompile(fmt.Sprintf("fargateprofile/%[1]s/%[1]s/.+", rName))), + resource.TestCheckResourceAttrPair(resourceName, "cluster_name", eksClusterResourceName, "name"), + resource.TestCheckResourceAttr(resourceName, "fargate_profile_name", rName), + resource.TestCheckResourceAttrPair(resourceName, "pod_execution_role_arn", iamRoleResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "selector.#", "1"), + resource.TestCheckResourceAttr(resourceName, "status", eks.FargateProfileStatusActive), + resource.TestCheckResourceAttr(resourceName, "subnet_ids.#", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEksFargateProfile_disappears(t *testing.T) { + var fargateProfile eks.FargateProfile + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_fargate_profile.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t); testAccPreCheckAWSEksFargateProfile(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksFargateProfileDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksFargateProfileConfigFargateProfileName(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksFargateProfileExists(resourceName, &fargateProfile), + testAccCheckAWSEksFargateProfileDisappears(&fargateProfile), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAWSEksFargateProfile_Selector_Labels(t *testing.T) { + var fargateProfile1 eks.FargateProfile + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_fargate_profile.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t); testAccPreCheckAWSEksFargateProfile(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksFargateProfileDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksFargateProfileConfigSelectorLabels1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksFargateProfileExists(resourceName, &fargateProfile1), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEksFargateProfile_Tags(t *testing.T) { + var fargateProfile1, fargateProfile2, fargateProfile3 eks.FargateProfile + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_fargate_profile.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t); testAccPreCheckAWSEksFargateProfile(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksFargateProfileDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksFargateProfileConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksFargateProfileExists(resourceName, &fargateProfile1), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSEksFargateProfileConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksFargateProfileExists(resourceName, &fargateProfile2), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSEksFargateProfileConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksFargateProfileExists(resourceName, &fargateProfile3), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + +func testAccCheckAWSEksFargateProfileExists(resourceName string, fargateProfile *eks.FargateProfile) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No EKS Fargate Profile ID is set") + } + + clusterName, fargateProfileName, err := resourceAwsEksFargateProfileParseId(rs.Primary.ID) + if err != nil { + return err + } + + conn := testAccProvider.Meta().(*AWSClient).eksconn + + input := &eks.DescribeFargateProfileInput{ + ClusterName: aws.String(clusterName), + FargateProfileName: aws.String(fargateProfileName), + } + + output, err := conn.DescribeFargateProfile(input) + + if err != nil { + return err + } + + if output == nil || output.FargateProfile == nil { + return fmt.Errorf("EKS Fargate Profile (%s) not found", rs.Primary.ID) + } + + if aws.StringValue(output.FargateProfile.FargateProfileName) != fargateProfileName { + return fmt.Errorf("EKS Fargate Profile (%s) not found", rs.Primary.ID) + } + + if got, want := aws.StringValue(output.FargateProfile.Status), eks.FargateProfileStatusActive; got != want { + return fmt.Errorf("EKS Fargate Profile (%s) not in %s status, got: %s", rs.Primary.ID, want, got) + } + + *fargateProfile = *output.FargateProfile + + return nil + } +} + +func testAccCheckAWSEksFargateProfileDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).eksconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_eks_fargate_profile" { + continue + } + + clusterName, fargateProfileName, err := resourceAwsEksFargateProfileParseId(rs.Primary.ID) + if err != nil { + return err + } + + input := &eks.DescribeFargateProfileInput{ + ClusterName: aws.String(clusterName), + FargateProfileName: aws.String(fargateProfileName), + } + + output, err := conn.DescribeFargateProfile(input) + + if isAWSErr(err, eks.ErrCodeResourceNotFoundException, "") { + continue + } + + if output != nil && output.FargateProfile != nil && aws.StringValue(output.FargateProfile.FargateProfileName) == fargateProfileName { + return fmt.Errorf("EKS Fargate Profile (%s) still exists", rs.Primary.ID) + } + } + + return nil +} + +func testAccCheckAWSEksFargateProfileDisappears(fargateProfile *eks.FargateProfile) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).eksconn + + input := &eks.DeleteFargateProfileInput{ + ClusterName: fargateProfile.ClusterName, + FargateProfileName: fargateProfile.FargateProfileName, + } + + _, err := conn.DeleteFargateProfile(input) + + if isAWSErr(err, eks.ErrCodeResourceNotFoundException, "") { + return nil + } + + if err != nil { + return err + } + + return waitForEksFargateProfileDeletion(conn, aws.StringValue(fargateProfile.ClusterName), aws.StringValue(fargateProfile.FargateProfileName), 10*time.Minute) + } +} + +func testAccPreCheckAWSEksFargateProfile(t *testing.T) { + // Most PreCheck functions try to use a list or describe API call to + // determine service or functionality availability, however + // ListFargateProfiles requires a valid ClusterName and does not indicate + // that the functionality is unavailable in a region. The create API call + // fails with same "ResourceNotFoundException: No cluster found" before + // returning the definitive "InvalidRequestException: CreateFargateProfile + // is not supported for region" error. We do not want to wait 20 minutes to + // create and destroy an EKS Cluster just to find the real error, instead + // we take the least desirable approach of hardcoding allowed regions. + allowedRegions := []string{ + "ap-northeast-1", + "eu-west-1", + "us-east-1", + "us-east-2", + } + region := testAccProvider.Meta().(*AWSClient).region + + for _, allowedRegion := range allowedRegions { + if region == allowedRegion { + return + } + } + + message := fmt.Sprintf(`Test provider region (%s) not found in allowed EKS Fargate regions: %v + +The allowed regions are hardcoded in the acceptance testing since dynamically determining the +functionality requires creating and destroying a real EKS Cluster, which is a lengthy process. +If this check is out of date, please create an issue in the Terraform AWS Provider +repository (https://github.com/terraform-providers/terraform-provider-aws) or submit a PR to update the +check itself (testAccPreCheckAWSEksFargateProfile). + +For the most up to date supported region information, see the EKS User Guide: +https://docs.aws.amazon.com/eks/latest/userguide/fargate.html +`, region, allowedRegions) + + t.Skipf("skipping acceptance testing:\n\n%s", message) +} + +func testAccAWSEksFargateProfileConfigBase(rName string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "available" { + state = "available" +} + +data "aws_partition" "current" {} + +resource "aws_iam_role" "cluster" { + name = "%[1]s-cluster" + + assume_role_policy = jsonencode({ + Statement = [{ + Action = "sts:AssumeRole" + Effect = "Allow" + Principal = { + Service = "eks.${data.aws_partition.current.dns_suffix}" + } + }] + Version = "2012-10-17" + }) +} + +resource "aws_iam_role_policy_attachment" "cluster-AmazonEKSClusterPolicy" { + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/AmazonEKSClusterPolicy" + role = aws_iam_role.cluster.name +} + +resource "aws_iam_role_policy_attachment" "cluster-AmazonEKSServicePolicy" { + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/AmazonEKSServicePolicy" + role = aws_iam_role.cluster.name +} + +resource "aws_iam_role" "pod" { + name = "%[1]s-pod" + + assume_role_policy = jsonencode({ + Statement = [{ + Action = "sts:AssumeRole" + Effect = "Allow" + Principal = { + Service = "eks-fargate-pods.${data.aws_partition.current.dns_suffix}" + } + }] + Version = "2012-10-17" + }) +} + +resource "aws_iam_role_policy_attachment" "pod-AmazonEKSFargatePodExecutionRolePolicy" { + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/AmazonEKSFargatePodExecutionRolePolicy" + role = aws_iam_role.pod.name +} + +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + enable_dns_hostnames = true + enable_dns_support = true + + tags = { + Name = "tf-acc-test-eks-fargate-profile" + "kubernetes.io/cluster/%[1]s" = "shared" + } +} + +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id +} + +resource "aws_route_table" "public" { + vpc_id = aws_vpc.test.id + + route { + cidr_block = "0.0.0.0/0" + gateway_id = aws_internet_gateway.test.id + } +} + +resource "aws_main_route_table_association" "test" { + route_table_id = aws_route_table.public.id + vpc_id = aws_vpc.test.id +} + +resource "aws_subnet" "private" { + count = 2 + + availability_zone = data.aws_availability_zones.available.names[count.index] + cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index+2) + vpc_id = aws_vpc.test.id + + tags = { + Name = "tf-acc-test-eks-fargate-profile-private" + "kubernetes.io/cluster/%[1]s" = "shared" + } +} + +resource "aws_eip" "private" { + count = 2 + depends_on = [aws_internet_gateway.test] + + vpc = true +} + +resource "aws_nat_gateway" "private" { + count = 2 + + allocation_id = aws_eip.private[count.index].id + subnet_id = aws_subnet.private[count.index].id +} + +resource "aws_route_table" "private" { + count = 2 + + vpc_id = aws_vpc.test.id + + route { + cidr_block = "0.0.0.0/0" + nat_gateway_id = aws_nat_gateway.private[count.index].id + } +} + +resource "aws_route_table_association" "private" { + count = 2 + + subnet_id = aws_subnet.private[count.index].id + route_table_id = aws_route_table.private[count.index].id +} + +resource "aws_subnet" "public" { + count = 2 + + availability_zone = data.aws_availability_zones.available.names[count.index] + cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) + vpc_id = aws_vpc.test.id + + tags = { + Name = "tf-acc-test-eks-fargate-profile-public" + "kubernetes.io/cluster/%[1]s" = "shared" + } +} + +resource "aws_eks_cluster" "test" { + name = %[1]q + role_arn = aws_iam_role.cluster.arn + + vpc_config { + subnet_ids = aws_subnet.public[*].id + } + + depends_on = [ + aws_iam_role_policy_attachment.cluster-AmazonEKSClusterPolicy, + aws_iam_role_policy_attachment.cluster-AmazonEKSServicePolicy, + aws_main_route_table_association.test, + ] +} +`, rName) +} + +func testAccAWSEksFargateProfileConfigFargateProfileName(rName string) string { + return testAccAWSEksFargateProfileConfigBase(rName) + fmt.Sprintf(` +resource "aws_eks_fargate_profile" "test" { + cluster_name = aws_eks_cluster.test.name + fargate_profile_name = %[1]q + pod_execution_role_arn = aws_iam_role.pod.arn + subnet_ids = aws_subnet.private[*].id + + selector { + namespace = "test" + } + + depends_on = [ + aws_iam_role_policy_attachment.pod-AmazonEKSFargatePodExecutionRolePolicy, + aws_route_table_association.private, + ] +} +`, rName) +} + +func testAccAWSEksFargateProfileConfigSelectorLabels1(rName, labelKey1, labelValue1 string) string { + return testAccAWSEksFargateProfileConfigBase(rName) + fmt.Sprintf(` +resource "aws_eks_fargate_profile" "test" { + cluster_name = aws_eks_cluster.test.name + fargate_profile_name = %[1]q + pod_execution_role_arn = aws_iam_role.pod.arn + subnet_ids = aws_subnet.private[*].id + + selector { + labels = { + %[2]q = %[3]q + } + namespace = "test" + } + + depends_on = [ + aws_iam_role_policy_attachment.pod-AmazonEKSFargatePodExecutionRolePolicy, + aws_route_table_association.private, + ] +} +`, rName, labelKey1, labelValue1) +} + +func testAccAWSEksFargateProfileConfigTags1(rName, tagKey1, tagValue1 string) string { + return testAccAWSEksFargateProfileConfigBase(rName) + fmt.Sprintf(` +resource "aws_eks_fargate_profile" "test" { + cluster_name = aws_eks_cluster.test.name + fargate_profile_name = %[1]q + pod_execution_role_arn = aws_iam_role.pod.arn + subnet_ids = aws_subnet.private[*].id + + selector { + namespace = "test" + } + + tags = { + %[2]q = %[3]q + } + + depends_on = [ + aws_iam_role_policy_attachment.pod-AmazonEKSFargatePodExecutionRolePolicy, + aws_route_table_association.private, + ] +} +`, rName, tagKey1, tagValue1) +} + +func testAccAWSEksFargateProfileConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccAWSEksFargateProfileConfigBase(rName) + fmt.Sprintf(` +resource "aws_eks_fargate_profile" "test" { + cluster_name = aws_eks_cluster.test.name + fargate_profile_name = %[1]q + pod_execution_role_arn = aws_iam_role.pod.arn + subnet_ids = aws_subnet.private[*].id + + selector { + namespace = "test" + } + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } + + depends_on = [ + aws_iam_role_policy_attachment.pod-AmazonEKSFargatePodExecutionRolePolicy, + aws_route_table_association.private, + ] +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} diff --git a/aws/resource_aws_eks_node_group.go b/aws/resource_aws_eks_node_group.go new file mode 100644 index 00000000000..6b298f05184 --- /dev/null +++ b/aws/resource_aws_eks_node_group.go @@ -0,0 +1,692 @@ +package aws + +import ( + "fmt" + "log" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/eks" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +func resourceAwsEksNodeGroup() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsEksNodeGroupCreate, + Read: resourceAwsEksNodeGroupRead, + Update: resourceAwsEksNodeGroupUpdate, + Delete: resourceAwsEksNodeGroupDelete, + + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(60 * time.Minute), + Update: schema.DefaultTimeout(60 * time.Minute), + Delete: schema.DefaultTimeout(60 * time.Minute), + }, + + Schema: map[string]*schema.Schema{ + "ami_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + eks.AMITypesAl2X8664, + eks.AMITypesAl2X8664Gpu, + }, false), + }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "cluster_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.NoZeroValues, + }, + "disk_size": { + Type: schema.TypeInt, + Optional: true, + Computed: true, + ForceNew: true, + }, + "instance_types": { + Type: schema.TypeSet, + Optional: true, + Computed: true, + ForceNew: true, + // Multiple instance types returns an API error currently: + // InvalidParameterException: Instance type list not valid, only one instance type is supported! + MaxItems: 1, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "labels": { + Type: schema.TypeMap, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "node_group_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.NoZeroValues, + }, + "node_role_arn": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.NoZeroValues, + }, + "release_version": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + "remote_access": { + Type: schema.TypeList, + Optional: true, + ForceNew: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ec2_ssh_key": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, + "source_security_group_ids": { + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + }, + }, + "resources": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "autoscaling_groups": { + Type: schema.TypeList, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "remote_access_security_group_id": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "scaling_config": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "desired_size": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntAtLeast(1), + }, + "max_size": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntAtLeast(1), + }, + "min_size": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntAtLeast(1), + }, + }, + }, + }, + "status": { + Type: schema.TypeString, + Computed: true, + }, + "subnet_ids": { + Type: schema.TypeSet, + Required: true, + ForceNew: true, + MinItems: 1, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "tags": tagsSchema(), + "version": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, + }, + } +} + +func resourceAwsEksNodeGroupCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).eksconn + clusterName := d.Get("cluster_name").(string) + nodeGroupName := d.Get("node_group_name").(string) + + input := &eks.CreateNodegroupInput{ + ClientRequestToken: aws.String(resource.UniqueId()), + ClusterName: aws.String(clusterName), + NodegroupName: aws.String(nodeGroupName), + NodeRole: aws.String(d.Get("node_role_arn").(string)), + Subnets: expandStringSet(d.Get("subnet_ids").(*schema.Set)), + } + + if v, ok := d.GetOk("ami_type"); ok { + input.AmiType = aws.String(v.(string)) + } + + if v, ok := d.GetOk("disk_size"); ok { + input.DiskSize = aws.Int64(int64(v.(int))) + } + + if v := d.Get("instance_types").(*schema.Set); v.Len() > 0 { + input.InstanceTypes = expandStringSet(v) + } + + if v := d.Get("labels").(map[string]interface{}); len(v) > 0 { + input.Labels = stringMapToPointers(v) + } + + if v, ok := d.GetOk("release_version"); ok { + input.ReleaseVersion = aws.String(v.(string)) + } + + if v := d.Get("remote_access").([]interface{}); len(v) > 0 { + input.RemoteAccess = expandEksRemoteAccessConfig(v) + } + + if v := d.Get("scaling_config").([]interface{}); len(v) > 0 { + input.ScalingConfig = expandEksNodegroupScalingConfig(v) + } + + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + input.Tags = keyvaluetags.New(v).IgnoreAws().EksTags() + } + + if v, ok := d.GetOk("version"); ok { + input.Version = aws.String(v.(string)) + } + + _, err := conn.CreateNodegroup(input) + + id := fmt.Sprintf("%s:%s", clusterName, nodeGroupName) + + if err != nil { + return fmt.Errorf("error creating EKS Node Group (%s): %s", id, err) + } + + d.SetId(id) + + stateConf := resource.StateChangeConf{ + Pending: []string{eks.NodegroupStatusCreating}, + Target: []string{eks.NodegroupStatusActive}, + Timeout: d.Timeout(schema.TimeoutCreate), + Refresh: refreshEksNodeGroupStatus(conn, clusterName, nodeGroupName), + } + + if _, err := stateConf.WaitForState(); err != nil { + return fmt.Errorf("error waiting for EKS Node Group (%s) creation: %s", d.Id(), err) + } + + return resourceAwsEksNodeGroupRead(d, meta) +} + +func resourceAwsEksNodeGroupRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).eksconn + + clusterName, nodeGroupName, err := resourceAwsEksNodeGroupParseId(d.Id()) + if err != nil { + return err + } + + input := &eks.DescribeNodegroupInput{ + ClusterName: aws.String(clusterName), + NodegroupName: aws.String(nodeGroupName), + } + + output, err := conn.DescribeNodegroup(input) + + if isAWSErr(err, eks.ErrCodeResourceNotFoundException, "") { + log.Printf("[WARN] EKS Node Group (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + if err != nil { + return fmt.Errorf("error reading EKS Node Group (%s): %s", d.Id(), err) + } + + nodeGroup := output.Nodegroup + if nodeGroup == nil { + log.Printf("[WARN] EKS Node Group (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + d.Set("ami_type", nodeGroup.AmiType) + d.Set("arn", nodeGroup.NodegroupArn) + d.Set("cluster_name", nodeGroup.ClusterName) + d.Set("disk_size", nodeGroup.DiskSize) + + if err := d.Set("instance_types", aws.StringValueSlice(nodeGroup.InstanceTypes)); err != nil { + return fmt.Errorf("error setting instance_types: %s", err) + } + + if err := d.Set("labels", aws.StringValueMap(nodeGroup.Labels)); err != nil { + return fmt.Errorf("error setting labels: %s", err) + } + + d.Set("node_group_name", nodeGroup.NodegroupName) + d.Set("node_role_arn", nodeGroup.NodeRole) + d.Set("release_version", nodeGroup.ReleaseVersion) + + if err := d.Set("remote_access", flattenEksRemoteAccessConfig(nodeGroup.RemoteAccess)); err != nil { + return fmt.Errorf("error setting remote_access: %s", err) + } + + if err := d.Set("resources", flattenEksNodeGroupResources(nodeGroup.Resources)); err != nil { + return fmt.Errorf("error setting resources: %s", err) + } + + if err := d.Set("scaling_config", flattenEksNodeGroupScalingConfig(nodeGroup.ScalingConfig)); err != nil { + return fmt.Errorf("error setting scaling_config: %s", err) + } + + d.Set("status", nodeGroup.Status) + + if err := d.Set("subnet_ids", aws.StringValueSlice(nodeGroup.Subnets)); err != nil { + return fmt.Errorf("error setting subnets: %s", err) + } + + if err := d.Set("tags", keyvaluetags.EksKeyValueTags(nodeGroup.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + d.Set("version", nodeGroup.Version) + + return nil +} + +func resourceAwsEksNodeGroupUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).eksconn + + clusterName, nodeGroupName, err := resourceAwsEksNodeGroupParseId(d.Id()) + if err != nil { + return err + } + + if d.HasChange("labels") || d.HasChange("scaling_config") { + oldLabelsRaw, newLabelsRaw := d.GetChange("labels") + + input := &eks.UpdateNodegroupConfigInput{ + ClientRequestToken: aws.String(resource.UniqueId()), + ClusterName: aws.String(clusterName), + Labels: expandEksUpdateLabelsPayload(oldLabelsRaw, newLabelsRaw), + NodegroupName: aws.String(nodeGroupName), + } + + if v := d.Get("scaling_config").([]interface{}); len(v) > 0 { + input.ScalingConfig = expandEksNodegroupScalingConfig(v) + } + + output, err := conn.UpdateNodegroupConfig(input) + + if err != nil { + return fmt.Errorf("error updating EKS Node Group (%s) config: %s", d.Id(), err) + } + + if output == nil || output.Update == nil || output.Update.Id == nil { + return fmt.Errorf("error determining EKS Node Group (%s) config update ID: empty response", d.Id()) + } + + updateID := aws.StringValue(output.Update.Id) + + err = waitForEksNodeGroupUpdate(conn, clusterName, nodeGroupName, updateID, d.Timeout(schema.TimeoutUpdate)) + if err != nil { + return fmt.Errorf("error waiting for EKS Node Group (%s) config update (%s): %s", d.Id(), updateID, err) + } + } + + if d.HasChange("release_version") || d.HasChange("version") { + input := &eks.UpdateNodegroupVersionInput{ + ClientRequestToken: aws.String(resource.UniqueId()), + ClusterName: aws.String(clusterName), + Force: aws.Bool(false), + NodegroupName: aws.String(nodeGroupName), + } + + if v, ok := d.GetOk("release_version"); ok { + input.ReleaseVersion = aws.String(v.(string)) + } + + if v, ok := d.GetOk("version"); ok { + input.Version = aws.String(v.(string)) + } + + output, err := conn.UpdateNodegroupVersion(input) + + if err != nil { + return fmt.Errorf("error updating EKS Node Group (%s) version: %s", d.Id(), err) + } + + if output == nil || output.Update == nil || output.Update.Id == nil { + return fmt.Errorf("error determining EKS Node Group (%s) version update ID: empty response", d.Id()) + } + + updateID := aws.StringValue(output.Update.Id) + + err = waitForEksNodeGroupUpdate(conn, clusterName, nodeGroupName, updateID, d.Timeout(schema.TimeoutUpdate)) + if err != nil { + return fmt.Errorf("error waiting for EKS Node Group (%s) version update (%s): %s", d.Id(), updateID, err) + } + } + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.EksUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + + return resourceAwsEksNodeGroupRead(d, meta) +} + +func resourceAwsEksNodeGroupDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).eksconn + + clusterName, nodeGroupName, err := resourceAwsEksNodeGroupParseId(d.Id()) + if err != nil { + return err + } + + input := &eks.DeleteNodegroupInput{ + ClusterName: aws.String(clusterName), + NodegroupName: aws.String(nodeGroupName), + } + + _, err = conn.DeleteNodegroup(input) + + if isAWSErr(err, eks.ErrCodeResourceNotFoundException, "") { + return nil + } + + if err != nil { + return fmt.Errorf("error deleting EKS Node Group (%s): %s", d.Id(), err) + } + + if err := waitForEksNodeGroupDeletion(conn, clusterName, nodeGroupName, d.Timeout(schema.TimeoutDelete)); err != nil { + return fmt.Errorf("error waiting for EKS Node Group (%s) deletion: %s", d.Id(), err) + } + + return nil +} + +func expandEksNodegroupScalingConfig(l []interface{}) *eks.NodegroupScalingConfig { + if len(l) == 0 || l[0] == nil { + return nil + } + + m := l[0].(map[string]interface{}) + + config := &eks.NodegroupScalingConfig{} + + if v, ok := m["desired_size"].(int); ok && v != 0 { + config.DesiredSize = aws.Int64(int64(v)) + } + + if v, ok := m["max_size"].(int); ok && v != 0 { + config.MaxSize = aws.Int64(int64(v)) + } + + if v, ok := m["min_size"].(int); ok && v != 0 { + config.MinSize = aws.Int64(int64(v)) + } + + return config +} + +func expandEksRemoteAccessConfig(l []interface{}) *eks.RemoteAccessConfig { + if len(l) == 0 || l[0] == nil { + return nil + } + + m := l[0].(map[string]interface{}) + + config := &eks.RemoteAccessConfig{} + + if v, ok := m["ec2_ssh_key"].(string); ok && v != "" { + config.Ec2SshKey = aws.String(v) + } + + if v, ok := m["source_security_group_ids"].(*schema.Set); ok && v.Len() > 0 { + config.SourceSecurityGroups = expandStringSet(v) + } + + return config +} + +func expandEksUpdateLabelsPayload(oldLabelsMap, newLabelsMap interface{}) *eks.UpdateLabelsPayload { + // EKS Labels operate similarly to keyvaluetags + oldLabels := keyvaluetags.New(oldLabelsMap) + newLabels := keyvaluetags.New(newLabelsMap) + + removedLabels := oldLabels.Removed(newLabels) + updatedLabels := oldLabels.Updated(newLabels) + + if len(removedLabels) == 0 && len(updatedLabels) == 0 { + return nil + } + + updateLabelsPayload := &eks.UpdateLabelsPayload{} + + if len(removedLabels) > 0 { + updateLabelsPayload.RemoveLabels = aws.StringSlice(removedLabels.Keys()) + } + + if len(updatedLabels) > 0 { + updateLabelsPayload.AddOrUpdateLabels = aws.StringMap(updatedLabels.Map()) + } + + return updateLabelsPayload +} + +func flattenEksAutoScalingGroups(autoScalingGroups []*eks.AutoScalingGroup) []map[string]interface{} { + if len(autoScalingGroups) == 0 { + return []map[string]interface{}{} + } + + l := make([]map[string]interface{}, 0, len(autoScalingGroups)) + + for _, autoScalingGroup := range autoScalingGroups { + m := map[string]interface{}{ + "name": aws.StringValue(autoScalingGroup.Name), + } + + l = append(l, m) + } + + return l +} + +func flattenEksNodeGroupResources(resources *eks.NodegroupResources) []map[string]interface{} { + if resources == nil { + return []map[string]interface{}{} + } + + m := map[string]interface{}{ + "autoscaling_groups": flattenEksAutoScalingGroups(resources.AutoScalingGroups), + "remote_access_security_group_id": aws.StringValue(resources.RemoteAccessSecurityGroup), + } + + return []map[string]interface{}{m} +} + +func flattenEksNodeGroupScalingConfig(config *eks.NodegroupScalingConfig) []map[string]interface{} { + if config == nil { + return []map[string]interface{}{} + } + + m := map[string]interface{}{ + "desired_size": aws.Int64Value(config.DesiredSize), + "max_size": aws.Int64Value(config.MaxSize), + "min_size": aws.Int64Value(config.MinSize), + } + + return []map[string]interface{}{m} +} + +func flattenEksRemoteAccessConfig(config *eks.RemoteAccessConfig) []map[string]interface{} { + if config == nil { + return []map[string]interface{}{} + } + + m := map[string]interface{}{ + "ec2_ssh_key": aws.StringValue(config.Ec2SshKey), + "source_security_group_ids": aws.StringValueSlice(config.SourceSecurityGroups), + } + + return []map[string]interface{}{m} +} + +func refreshEksNodeGroupStatus(conn *eks.EKS, clusterName string, nodeGroupName string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + input := &eks.DescribeNodegroupInput{ + ClusterName: aws.String(clusterName), + NodegroupName: aws.String(nodeGroupName), + } + + output, err := conn.DescribeNodegroup(input) + + if err != nil { + return "", "", err + } + + nodeGroup := output.Nodegroup + + if nodeGroup == nil { + return nodeGroup, "", fmt.Errorf("EKS Node Group (%s:%s) missing", clusterName, nodeGroupName) + } + + status := aws.StringValue(nodeGroup.Status) + + // Return enhanced error messaging if available, instead of: + // unexpected state 'CREATE_FAILED', wanted target 'ACTIVE'. last error: %!s() + if status == eks.NodegroupStatusCreateFailed || status == eks.NodegroupStatusDeleteFailed { + if nodeGroup.Health == nil || len(nodeGroup.Health.Issues) == 0 || nodeGroup.Health.Issues[0] == nil { + return nodeGroup, status, fmt.Errorf("unable to find additional information about %s status, check EKS Node Group (%s:%s) health", status, clusterName, nodeGroupName) + } + + issue := nodeGroup.Health.Issues[0] + + return nodeGroup, status, fmt.Errorf("%s: %s. Resource IDs: %v", aws.StringValue(issue.Code), aws.StringValue(issue.Message), aws.StringValueSlice(issue.ResourceIds)) + } + + return nodeGroup, status, nil + } +} + +func refreshEksNodeGroupUpdateStatus(conn *eks.EKS, clusterName string, nodeGroupName string, updateID string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + input := &eks.DescribeUpdateInput{ + Name: aws.String(clusterName), + NodegroupName: aws.String(nodeGroupName), + UpdateId: aws.String(updateID), + } + + output, err := conn.DescribeUpdate(input) + + if err != nil { + return nil, "", err + } + + if output == nil || output.Update == nil { + return nil, "", fmt.Errorf("EKS Node Group (%s:%s) update (%s) missing", clusterName, nodeGroupName, updateID) + } + + return output.Update, aws.StringValue(output.Update.Status), nil + } +} + +func waitForEksNodeGroupDeletion(conn *eks.EKS, clusterName string, nodeGroupName string, timeout time.Duration) error { + stateConf := resource.StateChangeConf{ + Pending: []string{ + eks.NodegroupStatusActive, + eks.NodegroupStatusDeleting, + }, + Target: []string{""}, + Timeout: timeout, + Refresh: refreshEksNodeGroupStatus(conn, clusterName, nodeGroupName), + } + + _, err := stateConf.WaitForState() + + if isAWSErr(err, eks.ErrCodeResourceNotFoundException, "") { + return nil + } + + return err +} + +func waitForEksNodeGroupUpdate(conn *eks.EKS, clusterName, nodeGroupName string, updateID string, timeout time.Duration) error { + stateConf := resource.StateChangeConf{ + Pending: []string{eks.UpdateStatusInProgress}, + Target: []string{ + eks.UpdateStatusCancelled, + eks.UpdateStatusFailed, + eks.UpdateStatusSuccessful, + }, + Timeout: timeout, + Refresh: refreshEksNodeGroupUpdateStatus(conn, clusterName, nodeGroupName, updateID), + } + + updateRaw, err := stateConf.WaitForState() + + if err != nil { + return err + } + + update := updateRaw.(*eks.Update) + + if aws.StringValue(update.Status) == eks.UpdateStatusSuccessful { + return nil + } + + var detailedErrors []string + for i, updateError := range update.Errors { + detailedErrors = append(detailedErrors, fmt.Sprintf("Error %d: Code: %s / Message: %s", i+1, aws.StringValue(updateError.ErrorCode), aws.StringValue(updateError.ErrorMessage))) + } + + return fmt.Errorf("EKS Node Group (%s) update (%s) status (%s) not successful: Errors:\n%s", clusterName, updateID, aws.StringValue(update.Status), strings.Join(detailedErrors, "\n")) +} + +func resourceAwsEksNodeGroupParseId(id string) (string, string, error) { + parts := strings.Split(id, ":") + + if len(parts) != 2 { + return "", "", fmt.Errorf("unexpected format of ID (%s), expected cluster-name:node-group-name", id) + } + + return parts[0], parts[1], nil +} diff --git a/aws/resource_aws_eks_node_group_test.go b/aws/resource_aws_eks_node_group_test.go new file mode 100644 index 00000000000..4c77c3d1805 --- /dev/null +++ b/aws/resource_aws_eks_node_group_test.go @@ -0,0 +1,1123 @@ +package aws + +import ( + "fmt" + "log" + "regexp" + "testing" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/eks" + multierror "github.com/hashicorp/go-multierror" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func init() { + resource.AddTestSweepers("aws_eks_fargate_node_group", &resource.Sweeper{ + Name: "aws_eks_fargate_node_group", + F: testSweepEksFargateNodegroups, + }) +} + +func testSweepEksFargateNodegroups(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + conn := client.(*AWSClient).eksconn + + var errors error + input := &eks.ListClustersInput{} + err = conn.ListClustersPages(input, func(page *eks.ListClustersOutput, lastPage bool) bool { + for _, cluster := range page.Clusters { + clusterName := aws.StringValue(cluster) + input := &eks.ListNodegroupsInput{ + ClusterName: cluster, + } + err := conn.ListNodegroupsPages(input, func(page *eks.ListNodegroupsOutput, lastPage bool) bool { + for _, nodegroup := range page.Nodegroups { + nodegroupName := aws.StringValue(nodegroup) + log.Printf("[INFO] Deleting EKS Node Group %q", nodegroupName) + input := &eks.DeleteNodegroupInput{ + ClusterName: cluster, + NodegroupName: nodegroup, + } + _, err := conn.DeleteNodegroup(input) + + if err != nil && !isAWSErr(err, eks.ErrCodeResourceNotFoundException, "") { + errors = multierror.Append(errors, fmt.Errorf("error deleting EKS Node Group %q: %w", nodegroupName, err)) + continue + } + + if err := waitForEksNodeGroupDeletion(conn, clusterName, nodegroupName, 10*time.Minute); err != nil { + errors = multierror.Append(errors, fmt.Errorf("error waiting for EKS Node Group %q deletion: %w", nodegroupName, err)) + continue + } + } + return true + }) + if err != nil { + errors = multierror.Append(errors, fmt.Errorf("error listing Node Groups for EKS Cluster %s: %w", clusterName, err)) + } + } + + return true + }) + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping EKS Clusters sweep for %s: %s", region, err) + return errors // In case we have completed some pages, but had errors + } + if err != nil { + errors = multierror.Append(errors, fmt.Errorf("error retrieving EKS Clusters: %w", err)) + } + + return errors +} + +func TestAccAWSEksNodeGroup_basic(t *testing.T) { + var nodeGroup eks.Nodegroup + rName := acctest.RandomWithPrefix("tf-acc-test") + eksClusterResourceName := "aws_eks_cluster.test" + iamRoleResourceName := "aws_iam_role.node" + resourceName := "aws_eks_node_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksNodeGroupConfigNodeGroupName(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup), + resource.TestCheckResourceAttr(resourceName, "ami_type", eks.AMITypesAl2X8664), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "eks", regexp.MustCompile(fmt.Sprintf("nodegroup/%[1]s/%[1]s/.+", rName))), + resource.TestCheckResourceAttrPair(resourceName, "cluster_name", eksClusterResourceName, "name"), + resource.TestCheckResourceAttr(resourceName, "disk_size", "20"), + resource.TestCheckResourceAttr(resourceName, "instance_types.#", "1"), + resource.TestCheckResourceAttr(resourceName, "labels.%", "0"), + resource.TestCheckResourceAttr(resourceName, "node_group_name", rName), + resource.TestCheckResourceAttrPair(resourceName, "node_role_arn", iamRoleResourceName, "arn"), + resource.TestMatchResourceAttr(resourceName, "release_version", regexp.MustCompile(`^\d+\.\d+\.\d+-\d{8}$`)), + resource.TestCheckResourceAttr(resourceName, "remote_access.#", "0"), + resource.TestCheckResourceAttr(resourceName, "resources.#", "1"), + resource.TestCheckResourceAttr(resourceName, "resources.0.autoscaling_groups.#", "1"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.desired_size", "1"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.max_size", "1"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.min_size", "1"), + resource.TestCheckResourceAttr(resourceName, "status", eks.NodegroupStatusActive), + resource.TestCheckResourceAttr(resourceName, "subnet_ids.#", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + resource.TestCheckResourceAttrPair(resourceName, "version", eksClusterResourceName, "version"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEksNodeGroup_disappears(t *testing.T) { + var nodeGroup eks.Nodegroup + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_node_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksNodeGroupConfigNodeGroupName(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup), + testAccCheckAWSEksNodeGroupDisappears(&nodeGroup), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAWSEksNodeGroup_AmiType(t *testing.T) { + var nodeGroup1 eks.Nodegroup + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_node_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksNodeGroupConfigAmiType(rName, eks.AMITypesAl2X8664Gpu), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup1), + resource.TestCheckResourceAttr(resourceName, "ami_type", eks.AMITypesAl2X8664Gpu), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEksNodeGroup_DiskSize(t *testing.T) { + var nodeGroup1 eks.Nodegroup + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_node_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksNodeGroupConfigDiskSize(rName, 21), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup1), + resource.TestCheckResourceAttr(resourceName, "disk_size", "21"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEksNodeGroup_InstanceTypes(t *testing.T) { + var nodeGroup1 eks.Nodegroup + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_node_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksNodeGroupConfigInstanceTypes1(rName, "t3.large"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup1), + resource.TestCheckResourceAttr(resourceName, "instance_types.#", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEksNodeGroup_Labels(t *testing.T) { + var nodeGroup1, nodeGroup2, nodeGroup3 eks.Nodegroup + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_node_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksNodeGroupConfigLabels1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup1), + resource.TestCheckResourceAttr(resourceName, "labels.%", "1"), + resource.TestCheckResourceAttr(resourceName, "labels.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSEksNodeGroupConfigLabels2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup2), + resource.TestCheckResourceAttr(resourceName, "labels.%", "2"), + resource.TestCheckResourceAttr(resourceName, "labels.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "labels.key2", "value2"), + ), + }, + { + Config: testAccAWSEksNodeGroupConfigLabels1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup3), + resource.TestCheckResourceAttr(resourceName, "labels.%", "1"), + resource.TestCheckResourceAttr(resourceName, "labels.key2", "value2"), + ), + }, + }, + }) +} + +func TestAccAWSEksNodeGroup_ReleaseVersion(t *testing.T) { + var nodeGroup1 eks.Nodegroup + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_node_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksNodeGroupConfigReleaseVersion(rName, "1.14.8-20191213"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup1), + resource.TestCheckResourceAttr(resourceName, "release_version", "1.14.8-20191213"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEksNodeGroup_RemoteAccess_Ec2SshKey(t *testing.T) { + var nodeGroup1 eks.Nodegroup + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_node_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksNodeGroupConfigRemoteAccessEc2SshKey(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup1), + resource.TestCheckResourceAttr(resourceName, "remote_access.#", "1"), + resource.TestCheckResourceAttr(resourceName, "remote_access.0.ec2_ssh_key", rName), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEksNodeGroup_RemoteAccess_SourceSecurityGroupIds(t *testing.T) { + var nodeGroup1 eks.Nodegroup + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_node_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksNodeGroupConfigRemoteAccessSourceSecurityGroupIds1(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup1), + resource.TestCheckResourceAttr(resourceName, "remote_access.#", "1"), + resource.TestCheckResourceAttr(resourceName, "remote_access.0.source_security_group_ids.#", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSEksNodeGroup_ScalingConfig_DesiredSize(t *testing.T) { + var nodeGroup1, nodeGroup2 eks.Nodegroup + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_node_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksNodeGroupConfigScalingConfigSizes(rName, 2, 2, 1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup1), + resource.TestCheckResourceAttr(resourceName, "scaling_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.desired_size", "2"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.max_size", "2"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.min_size", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSEksNodeGroupConfigScalingConfigSizes(rName, 1, 2, 1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup2), + resource.TestCheckResourceAttr(resourceName, "scaling_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.desired_size", "1"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.max_size", "2"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.min_size", "1"), + ), + }, + }, + }) +} + +func TestAccAWSEksNodeGroup_ScalingConfig_MaxSize(t *testing.T) { + var nodeGroup1, nodeGroup2 eks.Nodegroup + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_node_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksNodeGroupConfigScalingConfigSizes(rName, 1, 2, 1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup1), + resource.TestCheckResourceAttr(resourceName, "scaling_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.desired_size", "1"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.max_size", "2"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.min_size", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSEksNodeGroupConfigScalingConfigSizes(rName, 1, 1, 1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup2), + resource.TestCheckResourceAttr(resourceName, "scaling_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.desired_size", "1"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.max_size", "1"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.min_size", "1"), + ), + }, + }, + }) +} + +func TestAccAWSEksNodeGroup_ScalingConfig_MinSize(t *testing.T) { + var nodeGroup1, nodeGroup2 eks.Nodegroup + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_node_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksNodeGroupConfigScalingConfigSizes(rName, 2, 2, 2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup1), + resource.TestCheckResourceAttr(resourceName, "scaling_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.desired_size", "2"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.max_size", "2"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.min_size", "2"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSEksNodeGroupConfigScalingConfigSizes(rName, 2, 2, 1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup2), + resource.TestCheckResourceAttr(resourceName, "scaling_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.desired_size", "2"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.max_size", "2"), + resource.TestCheckResourceAttr(resourceName, "scaling_config.0.min_size", "1"), + ), + }, + }, + }) +} + +func TestAccAWSEksNodeGroup_Tags(t *testing.T) { + var nodeGroup1, nodeGroup2, nodeGroup3 eks.Nodegroup + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_node_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksNodeGroupConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup1), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSEksNodeGroupConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup2), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSEksNodeGroupConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup3), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + +func TestAccAWSEksNodeGroup_Version(t *testing.T) { + var nodeGroup1 eks.Nodegroup + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_eks_node_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEks(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEksNodeGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEksNodeGroupConfigVersion(rName, "1.14"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEksNodeGroupExists(resourceName, &nodeGroup1), + resource.TestCheckResourceAttr(resourceName, "version", "1.14"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckAWSEksNodeGroupExists(resourceName string, nodeGroup *eks.Nodegroup) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No EKS Node Group ID is set") + } + + clusterName, nodeGroupName, err := resourceAwsEksNodeGroupParseId(rs.Primary.ID) + if err != nil { + return err + } + + conn := testAccProvider.Meta().(*AWSClient).eksconn + + input := &eks.DescribeNodegroupInput{ + ClusterName: aws.String(clusterName), + NodegroupName: aws.String(nodeGroupName), + } + + output, err := conn.DescribeNodegroup(input) + + if err != nil { + return err + } + + if output == nil || output.Nodegroup == nil { + return fmt.Errorf("EKS Node Group (%s) not found", rs.Primary.ID) + } + + if aws.StringValue(output.Nodegroup.NodegroupName) != nodeGroupName { + return fmt.Errorf("EKS Node Group (%s) not found", rs.Primary.ID) + } + + if got, want := aws.StringValue(output.Nodegroup.Status), eks.NodegroupStatusActive; got != want { + return fmt.Errorf("EKS Node Group (%s) not in %s status, got: %s", rs.Primary.ID, want, got) + } + + *nodeGroup = *output.Nodegroup + + return nil + } +} + +func testAccCheckAWSEksNodeGroupDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).eksconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_eks_node_group" { + continue + } + + clusterName, nodeGroupName, err := resourceAwsEksNodeGroupParseId(rs.Primary.ID) + if err != nil { + return err + } + + input := &eks.DescribeNodegroupInput{ + ClusterName: aws.String(clusterName), + NodegroupName: aws.String(nodeGroupName), + } + + output, err := conn.DescribeNodegroup(input) + + if isAWSErr(err, eks.ErrCodeResourceNotFoundException, "") { + continue + } + + if output != nil && output.Nodegroup != nil && aws.StringValue(output.Nodegroup.NodegroupName) == nodeGroupName { + return fmt.Errorf("EKS Node Group (%s) still exists", rs.Primary.ID) + } + } + + return nil +} + +func testAccCheckAWSEksNodeGroupDisappears(nodeGroup *eks.Nodegroup) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).eksconn + + input := &eks.DeleteNodegroupInput{ + ClusterName: nodeGroup.ClusterName, + NodegroupName: nodeGroup.NodegroupName, + } + + _, err := conn.DeleteNodegroup(input) + + if isAWSErr(err, eks.ErrCodeResourceNotFoundException, "") { + return nil + } + + if err != nil { + return err + } + + return waitForEksNodeGroupDeletion(conn, aws.StringValue(nodeGroup.ClusterName), aws.StringValue(nodeGroup.NodegroupName), 60*time.Minute) + } +} + +func testAccAWSEksNodeGroupConfigBase(rName string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "available" { + state = "available" +} + +data "aws_partition" "current" {} + +resource "aws_iam_role" "cluster" { + name = "%[1]s-cluster" + + assume_role_policy = jsonencode({ + Statement = [{ + Action = "sts:AssumeRole" + Effect = "Allow" + Principal = { + Service = [ + "eks.${data.aws_partition.current.dns_suffix}", + "eks-nodegroup.${data.aws_partition.current.dns_suffix}", + ] + } + }] + Version = "2012-10-17" + }) +} + +resource "aws_iam_role_policy_attachment" "cluster-AmazonEKSClusterPolicy" { + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/AmazonEKSClusterPolicy" + role = aws_iam_role.cluster.name +} + +resource "aws_iam_role_policy_attachment" "cluster-AmazonEKSServicePolicy" { + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/AmazonEKSServicePolicy" + role = aws_iam_role.cluster.name +} + +resource "aws_iam_role" "node" { + name = "%[1]s-node" + + assume_role_policy = jsonencode({ + Statement = [{ + Action = "sts:AssumeRole" + Effect = "Allow" + Principal = { + Service = "ec2.${data.aws_partition.current.dns_suffix}" + } + }] + Version = "2012-10-17" + }) +} + +resource "aws_iam_role_policy_attachment" "node-AmazonEKSWorkerNodePolicy" { + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/AmazonEKSWorkerNodePolicy" + role = aws_iam_role.node.name +} + +resource "aws_iam_role_policy_attachment" "node-AmazonEKS_CNI_Policy" { + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/AmazonEKS_CNI_Policy" + role = aws_iam_role.node.name +} + +resource "aws_iam_role_policy_attachment" "node-AmazonEC2ContainerRegistryReadOnly" { + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly" + role = aws_iam_role.node.name +} + +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + enable_dns_hostnames = true + enable_dns_support = true + + tags = { + Name = "tf-acc-test-eks-node-group" + "kubernetes.io/cluster/%[1]s" = "shared" + } +} + +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id +} + +resource "aws_route_table" "test" { + vpc_id = aws_vpc.test.id + + route { + cidr_block = "0.0.0.0/0" + gateway_id = aws_internet_gateway.test.id + } +} + +resource "aws_main_route_table_association" "test" { + route_table_id = aws_route_table.test.id + vpc_id = aws_vpc.test.id +} + +resource "aws_security_group" "test" { + name = %[1]q + vpc_id = aws_vpc.test.id + + egress { + cidr_blocks = ["0.0.0.0/0"] + from_port = 0 + protocol = -1 + to_port = 0 + } + + ingress { + cidr_blocks = [aws_vpc.test.cidr_block] + from_port = 0 + protocol = -1 + to_port = 0 + } +} + +resource "aws_subnet" "test" { + count = 2 + + availability_zone = data.aws_availability_zones.available.names[count.index] + cidr_block = cidrsubnet(aws_vpc.test.cidr_block, 8, count.index) + vpc_id = aws_vpc.test.id + + tags = { + Name = "tf-acc-test-eks-node-group" + "kubernetes.io/cluster/%[1]s" = "shared" + } +} + +resource "aws_eks_cluster" "test" { + name = %[1]q + role_arn = aws_iam_role.cluster.arn + + vpc_config { + subnet_ids = aws_subnet.test[*].id + } + + depends_on = [ + "aws_iam_role_policy_attachment.cluster-AmazonEKSClusterPolicy", + "aws_iam_role_policy_attachment.cluster-AmazonEKSServicePolicy", + "aws_main_route_table_association.test", + ] +} +`, rName) +} + +func testAccAWSEksNodeGroupConfigNodeGroupName(rName string) string { + return testAccAWSEksNodeGroupConfigBase(rName) + fmt.Sprintf(` +resource "aws_eks_node_group" "test" { + cluster_name = aws_eks_cluster.test.name + node_group_name = %[1]q + node_role_arn = aws_iam_role.node.arn + subnet_ids = aws_subnet.test[*].id + + scaling_config { + desired_size = 1 + max_size = 1 + min_size = 1 + } + + depends_on = [ + "aws_iam_role_policy_attachment.node-AmazonEKSWorkerNodePolicy", + "aws_iam_role_policy_attachment.node-AmazonEKS_CNI_Policy", + "aws_iam_role_policy_attachment.node-AmazonEC2ContainerRegistryReadOnly", + ] +} +`, rName) +} + +func testAccAWSEksNodeGroupConfigAmiType(rName, amiType string) string { + return testAccAWSEksNodeGroupConfigBase(rName) + fmt.Sprintf(` +resource "aws_eks_node_group" "test" { + ami_type = %[2]q + cluster_name = aws_eks_cluster.test.name + node_group_name = %[1]q + node_role_arn = aws_iam_role.node.arn + subnet_ids = aws_subnet.test[*].id + + scaling_config { + desired_size = 1 + max_size = 1 + min_size = 1 + } + + depends_on = [ + "aws_iam_role_policy_attachment.node-AmazonEKSWorkerNodePolicy", + "aws_iam_role_policy_attachment.node-AmazonEKS_CNI_Policy", + "aws_iam_role_policy_attachment.node-AmazonEC2ContainerRegistryReadOnly", + ] +} +`, rName, amiType) +} + +func testAccAWSEksNodeGroupConfigDiskSize(rName string, diskSize int) string { + return testAccAWSEksNodeGroupConfigBase(rName) + fmt.Sprintf(` +resource "aws_eks_node_group" "test" { + cluster_name = aws_eks_cluster.test.name + disk_size = %[2]d + node_group_name = %[1]q + node_role_arn = aws_iam_role.node.arn + subnet_ids = aws_subnet.test[*].id + + scaling_config { + desired_size = 1 + max_size = 1 + min_size = 1 + } + + depends_on = [ + "aws_iam_role_policy_attachment.node-AmazonEKSWorkerNodePolicy", + "aws_iam_role_policy_attachment.node-AmazonEKS_CNI_Policy", + "aws_iam_role_policy_attachment.node-AmazonEC2ContainerRegistryReadOnly", + ] +} +`, rName, diskSize) +} + +func testAccAWSEksNodeGroupConfigInstanceTypes1(rName, instanceType1 string) string { + return testAccAWSEksNodeGroupConfigBase(rName) + fmt.Sprintf(` +resource "aws_eks_node_group" "test" { + cluster_name = aws_eks_cluster.test.name + instance_types = [%[2]q] + node_group_name = %[1]q + node_role_arn = aws_iam_role.node.arn + subnet_ids = aws_subnet.test[*].id + + scaling_config { + desired_size = 1 + max_size = 1 + min_size = 1 + } + + depends_on = [ + "aws_iam_role_policy_attachment.node-AmazonEKSWorkerNodePolicy", + "aws_iam_role_policy_attachment.node-AmazonEKS_CNI_Policy", + "aws_iam_role_policy_attachment.node-AmazonEC2ContainerRegistryReadOnly", + ] +} +`, rName, instanceType1) +} + +func testAccAWSEksNodeGroupConfigLabels1(rName, labelKey1, labelValue1 string) string { + return testAccAWSEksNodeGroupConfigBase(rName) + fmt.Sprintf(` +resource "aws_eks_node_group" "test" { + cluster_name = aws_eks_cluster.test.name + node_group_name = %[1]q + node_role_arn = aws_iam_role.node.arn + subnet_ids = aws_subnet.test[*].id + + labels = { + %[2]q = %[3]q + } + + scaling_config { + desired_size = 1 + max_size = 1 + min_size = 1 + } + + depends_on = [ + "aws_iam_role_policy_attachment.node-AmazonEKSWorkerNodePolicy", + "aws_iam_role_policy_attachment.node-AmazonEKS_CNI_Policy", + "aws_iam_role_policy_attachment.node-AmazonEC2ContainerRegistryReadOnly", + ] +} +`, rName, labelKey1, labelValue1) +} + +func testAccAWSEksNodeGroupConfigLabels2(rName, labelKey1, labelValue1, labelKey2, labelValue2 string) string { + return testAccAWSEksNodeGroupConfigBase(rName) + fmt.Sprintf(` +resource "aws_eks_node_group" "test" { + cluster_name = aws_eks_cluster.test.name + node_group_name = %[1]q + node_role_arn = aws_iam_role.node.arn + subnet_ids = aws_subnet.test[*].id + + labels = { + %[2]q = %[3]q + %[4]q = %[5]q + } + + scaling_config { + desired_size = 1 + max_size = 1 + min_size = 1 + } + + depends_on = [ + "aws_iam_role_policy_attachment.node-AmazonEKSWorkerNodePolicy", + "aws_iam_role_policy_attachment.node-AmazonEKS_CNI_Policy", + "aws_iam_role_policy_attachment.node-AmazonEC2ContainerRegistryReadOnly", + ] +} +`, rName, labelKey1, labelValue1, labelKey2, labelValue2) +} + +func testAccAWSEksNodeGroupConfigReleaseVersion(rName, releaseVersion string) string { + return testAccAWSEksNodeGroupConfigBase(rName) + fmt.Sprintf(` +resource "aws_eks_node_group" "test" { + cluster_name = aws_eks_cluster.test.name + node_group_name = %[1]q + node_role_arn = aws_iam_role.node.arn + release_version = %[2]q + subnet_ids = aws_subnet.test[*].id + + scaling_config { + desired_size = 1 + max_size = 1 + min_size = 1 + } + + depends_on = [ + "aws_iam_role_policy_attachment.node-AmazonEKSWorkerNodePolicy", + "aws_iam_role_policy_attachment.node-AmazonEKS_CNI_Policy", + "aws_iam_role_policy_attachment.node-AmazonEC2ContainerRegistryReadOnly", + ] +} +`, rName, releaseVersion) +} + +func testAccAWSEksNodeGroupConfigRemoteAccessEc2SshKey(rName string) string { + return testAccAWSEksNodeGroupConfigBase(rName) + fmt.Sprintf(` +resource "aws_key_pair" "test" { + key_name = %[1]q + public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 example@example.com" +} + +resource "aws_eks_node_group" "test" { + cluster_name = aws_eks_cluster.test.name + node_group_name = %[1]q + node_role_arn = aws_iam_role.node.arn + subnet_ids = aws_subnet.test[*].id + + remote_access { + ec2_ssh_key = aws_key_pair.test.key_name + } + + scaling_config { + desired_size = 1 + max_size = 1 + min_size = 1 + } + + depends_on = [ + "aws_iam_role_policy_attachment.node-AmazonEKSWorkerNodePolicy", + "aws_iam_role_policy_attachment.node-AmazonEKS_CNI_Policy", + "aws_iam_role_policy_attachment.node-AmazonEC2ContainerRegistryReadOnly", + ] +} +`, rName) +} + +func testAccAWSEksNodeGroupConfigRemoteAccessSourceSecurityGroupIds1(rName string) string { + return testAccAWSEksNodeGroupConfigBase(rName) + fmt.Sprintf(` +resource "aws_key_pair" "test" { + key_name = %[1]q + public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 example@example.com" +} + +resource "aws_eks_node_group" "test" { + cluster_name = aws_eks_cluster.test.name + node_group_name = %[1]q + node_role_arn = aws_iam_role.node.arn + subnet_ids = aws_subnet.test[*].id + + remote_access { + ec2_ssh_key = aws_key_pair.test.key_name + source_security_group_ids = [aws_security_group.test.id] + } + + scaling_config { + desired_size = 1 + max_size = 1 + min_size = 1 + } + + depends_on = [ + "aws_iam_role_policy_attachment.node-AmazonEKSWorkerNodePolicy", + "aws_iam_role_policy_attachment.node-AmazonEKS_CNI_Policy", + "aws_iam_role_policy_attachment.node-AmazonEC2ContainerRegistryReadOnly", + ] +} +`, rName) +} + +func testAccAWSEksNodeGroupConfigScalingConfigSizes(rName string, desiredSize, maxSize, minSize int) string { + return testAccAWSEksNodeGroupConfigBase(rName) + fmt.Sprintf(` +resource "aws_eks_node_group" "test" { + cluster_name = aws_eks_cluster.test.name + node_group_name = %[1]q + node_role_arn = aws_iam_role.node.arn + subnet_ids = aws_subnet.test[*].id + + scaling_config { + desired_size = %[2]d + max_size = %[3]d + min_size = %[4]d + } + + depends_on = [ + "aws_iam_role_policy_attachment.node-AmazonEKSWorkerNodePolicy", + "aws_iam_role_policy_attachment.node-AmazonEKS_CNI_Policy", + "aws_iam_role_policy_attachment.node-AmazonEC2ContainerRegistryReadOnly", + ] +} +`, rName, desiredSize, maxSize, minSize) +} + +func testAccAWSEksNodeGroupConfigTags1(rName, tagKey1, tagValue1 string) string { + return testAccAWSEksNodeGroupConfigBase(rName) + fmt.Sprintf(` +resource "aws_eks_node_group" "test" { + cluster_name = aws_eks_cluster.test.name + node_group_name = %[1]q + node_role_arn = aws_iam_role.node.arn + subnet_ids = aws_subnet.test[*].id + + tags = { + %[2]q = %[3]q + } + + scaling_config { + desired_size = 1 + max_size = 1 + min_size = 1 + } + + depends_on = [ + "aws_iam_role_policy_attachment.node-AmazonEKSWorkerNodePolicy", + "aws_iam_role_policy_attachment.node-AmazonEKS_CNI_Policy", + "aws_iam_role_policy_attachment.node-AmazonEC2ContainerRegistryReadOnly", + ] +} +`, rName, tagKey1, tagValue1) +} + +func testAccAWSEksNodeGroupConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccAWSEksNodeGroupConfigBase(rName) + fmt.Sprintf(` +resource "aws_eks_node_group" "test" { + cluster_name = aws_eks_cluster.test.name + node_group_name = %[1]q + node_role_arn = aws_iam_role.node.arn + subnet_ids = aws_subnet.test[*].id + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } + + scaling_config { + desired_size = 1 + max_size = 1 + min_size = 1 + } + + depends_on = [ + "aws_iam_role_policy_attachment.node-AmazonEKSWorkerNodePolicy", + "aws_iam_role_policy_attachment.node-AmazonEKS_CNI_Policy", + "aws_iam_role_policy_attachment.node-AmazonEC2ContainerRegistryReadOnly", + ] +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + +func testAccAWSEksNodeGroupConfigVersion(rName, version string) string { + return testAccAWSEksNodeGroupConfigBase(rName) + fmt.Sprintf(` +resource "aws_eks_node_group" "test" { + cluster_name = aws_eks_cluster.test.name + node_group_name = %[1]q + node_role_arn = aws_iam_role.node.arn + subnet_ids = aws_subnet.test[*].id + version = %[2]q + + scaling_config { + desired_size = 1 + max_size = 1 + min_size = 1 + } + + depends_on = [ + "aws_iam_role_policy_attachment.node-AmazonEKSWorkerNodePolicy", + "aws_iam_role_policy_attachment.node-AmazonEKS_CNI_Policy", + "aws_iam_role_policy_attachment.node-AmazonEC2ContainerRegistryReadOnly", + ] +} +`, rName, version) +} diff --git a/aws/resource_aws_elastic_beanstalk_application.go b/aws/resource_aws_elastic_beanstalk_application.go index 11fea76b624..a8566ab6582 100644 --- a/aws/resource_aws_elastic_beanstalk_application.go +++ b/aws/resource_aws_elastic_beanstalk_application.go @@ -5,11 +5,11 @@ import ( "log" "time" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticbeanstalk" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsElasticBeanstalkApplication() *schema.Resource { @@ -79,7 +79,7 @@ func resourceAwsElasticBeanstalkApplicationCreate(d *schema.ResourceData, meta i req := &elasticbeanstalk.CreateApplicationInput{ ApplicationName: aws.String(name), Description: aws.String(description), - Tags: tagsFromMapBeanstalk(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreElasticbeanstalk().ElasticbeanstalkTags(), } app, err := beanstalkConn.CreateApplication(req) @@ -97,22 +97,27 @@ func resourceAwsElasticBeanstalkApplicationCreate(d *schema.ResourceData, meta i } func resourceAwsElasticBeanstalkApplicationUpdate(d *schema.ResourceData, meta interface{}) error { - beanstalkConn := meta.(*AWSClient).elasticbeanstalkconn + conn := meta.(*AWSClient).elasticbeanstalkconn if d.HasChange("description") { - if err := resourceAwsElasticBeanstalkApplicationDescriptionUpdate(beanstalkConn, d); err != nil { + if err := resourceAwsElasticBeanstalkApplicationDescriptionUpdate(conn, d); err != nil { return err } } if d.HasChange("appversion_lifecycle") { - if err := resourceAwsElasticBeanstalkApplicationAppversionLifecycleUpdate(beanstalkConn, d, nil); err != nil { + if err := resourceAwsElasticBeanstalkApplicationAppversionLifecycleUpdate(conn, d, nil); err != nil { return err } } - if err := setTagsBeanstalk(beanstalkConn, d, d.Get("arn").(string)); err != nil { - return fmt.Errorf("error setting tags for %s: %s", d.Id(), err) + arn := d.Get("arn").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.ElasticbeanstalkUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating Elastic Beanstalk Application (%s) tags: %s", arn, err) + } } return resourceAwsElasticBeanstalkApplicationRead(d, meta) @@ -236,7 +241,8 @@ func resourceAwsElasticBeanstalkApplicationRead(d *schema.ResourceData, meta int return err } - d.Set("arn", app.ApplicationArn) + arn := aws.StringValue(app.ApplicationArn) + d.Set("arn", arn) d.Set("name", app.ApplicationName) d.Set("description", app.Description) @@ -244,8 +250,14 @@ func resourceAwsElasticBeanstalkApplicationRead(d *schema.ResourceData, meta int d.Set("appversion_lifecycle", flattenResourceLifecycleConfig(app.ResourceLifecycleConfig)) } - if err := saveTagsBeanstalk(conn, d, aws.StringValue(app.ApplicationArn)); err != nil { - return fmt.Errorf("error saving tags for %s: %s", d.Id(), err) + tags, err := keyvaluetags.ElasticbeanstalkListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for Elastic Beanstalk Application (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreElasticbeanstalk().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil diff --git a/aws/resource_aws_elastic_beanstalk_application_test.go b/aws/resource_aws_elastic_beanstalk_application_test.go index 2ba4be06a05..c603043b991 100644 --- a/aws/resource_aws_elastic_beanstalk_application_test.go +++ b/aws/resource_aws_elastic_beanstalk_application_test.go @@ -15,14 +15,14 @@ import ( // initialize sweeper func init() { - resource.AddTestSweepers("aws_beanstalk_application", &resource.Sweeper{ - Name: "aws_beanstalk_application", - Dependencies: []string{"aws_beanstalk_environment"}, - F: testSweepBeanstalkApplications, + resource.AddTestSweepers("aws_elastic_beanstalk_application", &resource.Sweeper{ + Name: "aws_elastic_beanstalk_application", + Dependencies: []string{"aws_elastic_beanstalk_environment"}, + F: testSweepElasticBeanstalkApplications, }) } -func testSweepBeanstalkApplications(region string) error { +func testSweepElasticBeanstalkApplications(region string) error { client, err := sharedClientForRegion(region) if err != nil { return fmt.Errorf("error getting client: %s", err) diff --git a/aws/resource_aws_elastic_beanstalk_application_version.go b/aws/resource_aws_elastic_beanstalk_application_version.go index 118a767339b..c269e3e5716 100644 --- a/aws/resource_aws_elastic_beanstalk_application_version.go +++ b/aws/resource_aws_elastic_beanstalk_application_version.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/elasticbeanstalk" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsElasticBeanstalkApplicationVersion() *schema.Resource { @@ -75,8 +76,8 @@ func resourceAwsElasticBeanstalkApplicationVersionCreate(d *schema.ResourceData, ApplicationName: aws.String(application), Description: aws.String(description), SourceBundle: &s3Location, + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreElasticbeanstalk().ElasticbeanstalkTags(), VersionLabel: aws.String(name), - Tags: tagsFromMapBeanstalk(d.Get("tags").(map[string]interface{})), } log.Printf("[DEBUG] Elastic Beanstalk Application Version create opts: %s", createOpts) @@ -113,16 +114,18 @@ func resourceAwsElasticBeanstalkApplicationVersionRead(d *schema.ResourceData, m len(resp.ApplicationVersions), d.Id()) } - if err := d.Set("description", resp.ApplicationVersions[0].Description); err != nil { - return err - } + arn := aws.StringValue(resp.ApplicationVersions[0].ApplicationVersionArn) + d.Set("arn", arn) + d.Set("description", resp.ApplicationVersions[0].Description) - if err := d.Set("arn", resp.ApplicationVersions[0].ApplicationVersionArn); err != nil { - return err + tags, err := keyvaluetags.ElasticbeanstalkListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for Elastic Beanstalk Application version (%s): %s", arn, err) } - if err := saveTagsBeanstalk(conn, d, aws.StringValue(resp.ApplicationVersions[0].ApplicationVersionArn)); err != nil { - return fmt.Errorf("error saving tags for %s: %s", d.Id(), err) + if err := d.Set("tags", tags.IgnoreElasticbeanstalk().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -137,8 +140,13 @@ func resourceAwsElasticBeanstalkApplicationVersionUpdate(d *schema.ResourceData, } } - if err := setTagsBeanstalk(conn, d, d.Get("arn").(string)); err != nil { - return fmt.Errorf("error setting tags for %s: %s", d.Id(), err) + arn := d.Get("arn").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.ElasticbeanstalkUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating Elastic Beanstalk Application version (%s) tags: %s", arn, err) + } } return resourceAwsElasticBeanstalkApplicationVersionRead(d, meta) diff --git a/aws/resource_aws_elastic_beanstalk_environment.go b/aws/resource_aws_elastic_beanstalk_environment.go index 96c81091464..5814852c248 100644 --- a/aws/resource_aws_elastic_beanstalk_environment.go +++ b/aws/resource_aws_elastic_beanstalk_environment.go @@ -8,15 +8,15 @@ import ( "strings" "time" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/ec2" + "github.com/aws/aws-sdk-go/service/elasticbeanstalk" "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/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" "github.com/hashicorp/terraform-plugin-sdk/helper/structure" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsElasticBeanstalkOptionSetting() *schema.Resource { @@ -224,14 +224,11 @@ func resourceAwsElasticBeanstalkEnvironmentCreate(d *schema.ResourceData, meta i platformArn := d.Get("platform_arn").(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{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreElasticbeanstalk().ElasticbeanstalkTags(), } if desc != "" { @@ -479,25 +476,14 @@ func resourceAwsElasticBeanstalkEnvironmentUpdate(d *schema.ResourceData, meta i } } + arn := d.Get("arn").(string) if d.HasChange("tags") { o, n := d.GetChange("tags") - oldTags := tagsFromMapBeanstalk(o.(map[string]interface{})) - newTags := tagsFromMapBeanstalk(n.(map[string]interface{})) - - tagsToAdd, tagNamesToRemove := diffTagsBeanstalk(oldTags, newTags) - - updateTags := elasticbeanstalk.UpdateTagsForResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - TagsToAdd: tagsToAdd, - TagsToRemove: tagNamesToRemove, - } // Get the current time to filter getBeanstalkEnvironmentErrors messages t := time.Now() - log.Printf("[DEBUG] Elastic Beanstalk Environment update tags: %s", updateTags) - _, err := conn.UpdateTagsForResource(&updateTags) - if err != nil { - return err + if err := keyvaluetags.ElasticbeanstalkUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating Elastic Beanstalk environment (%s) tags: %s", arn, err) } waitForReadyTimeOut, err := time.ParseDuration(d.Get("wait_for_ready_timeout").(string)) @@ -580,7 +566,8 @@ func resourceAwsElasticBeanstalkEnvironmentRead(d *schema.ResourceData, meta int return err } - d.Set("arn", env.EnvironmentArn) + arn := aws.StringValue(env.EnvironmentArn) + d.Set("arn", arn) if err := d.Set("name", env.EnvironmentName); err != nil { return err @@ -602,7 +589,7 @@ func resourceAwsElasticBeanstalkEnvironmentRead(d *schema.ResourceData, meta int return err } - if err := d.Set("tier", *env.Tier.Name); err != nil { + if err := d.Set("tier", env.Tier.Name); err != nil { return err } @@ -657,16 +644,14 @@ func resourceAwsElasticBeanstalkEnvironmentRead(d *schema.ResourceData, meta int return err } - tags, err := conn.ListTagsForResource(&elasticbeanstalk.ListTagsForResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - }) + tags, err := keyvaluetags.ElasticbeanstalkListTags(conn, arn) if err != nil { - return err + return fmt.Errorf("error listing tags for Elastic Beanstalk environment (%s): %s", arn, err) } - if err := d.Set("tags", tagsToMapBeanstalk(tags.ResourceTags)); err != nil { - return err + if err := d.Set("tags", tags.IgnoreElasticbeanstalk().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return resourceAwsElasticBeanstalkEnvironmentSettingsRead(d, meta) diff --git a/aws/resource_aws_elastic_beanstalk_environment_test.go b/aws/resource_aws_elastic_beanstalk_environment_test.go index 8d9ac96d9b7..8c30d5acbe6 100644 --- a/aws/resource_aws_elastic_beanstalk_environment_test.go +++ b/aws/resource_aws_elastic_beanstalk_environment_test.go @@ -15,17 +15,18 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) // initialize sweeper func init() { - resource.AddTestSweepers("aws_beanstalk_environment", &resource.Sweeper{ - Name: "aws_beanstalk_environment", - F: testSweepBeanstalkEnvironments, + resource.AddTestSweepers("aws_elastic_beanstalk_environment", &resource.Sweeper{ + Name: "aws_elastic_beanstalk_environment", + F: testSweepElasticBeanstalkEnvironments, }) } -func testSweepBeanstalkEnvironments(region string) error { +func testSweepElasticBeanstalkEnvironments(region string) error { client, err := sharedClientForRegion(region) if err != nil { return fmt.Errorf("error getting client: %s", err) @@ -95,50 +96,17 @@ func testSweepBeanstalkEnvironments(region string) error { return nil } -func TestAWSElasticBeanstalkEnvironment_importBasic(t *testing.T) { - resourceName := "aws_elastic_beanstalk_application.tftest" - - applicationName := fmt.Sprintf("tf-test-name-%d", acctest.RandInt()) - environmentName := fmt.Sprintf("tf-test-env-name-%d", acctest.RandInt()) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckBeanstalkAppDestroy, - Steps: []resource.TestStep{ - { - Config: testAccBeanstalkEnvImportConfig(applicationName, environmentName), - }, - - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - -func testAccBeanstalkEnvImportConfig(appName, envName string) string { - return fmt.Sprintf(` -resource "aws_elastic_beanstalk_application" "tftest" { - name = "%s" - description = "tf-test-desc" - } - - resource "aws_elastic_beanstalk_environment" "tfenvtest" { - name = "%s" - application = "${aws_elastic_beanstalk_application.tftest.name}" - solution_stack_name = "64bit Amazon Linux running Python" - }`, appName, envName) -} - func TestAccAWSBeanstalkEnv_basic(t *testing.T) { var app elasticbeanstalk.EnvironmentDescription - rString := acctest.RandString(8) - appName := fmt.Sprintf("tf_acc_app_env_basic_%s", rString) - envName := fmt.Sprintf("tf-acc-env-basic-%s", rString) + resourceName := "aws_elastic_beanstalk_environment.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + beanstalkAsgNameRegexp := regexp.MustCompile("awseb.+?AutoScalingGroup[^,]+") + beanstalkElbNameRegexp := regexp.MustCompile("awseb.+?EBLoa[^,]+") + beanstalkInstancesNameRegexp := regexp.MustCompile("i-([0-9a-fA-F]{8}|[0-9a-fA-F]{17})") + beanstalkLcNameRegexp := regexp.MustCompile("awseb.+?AutoScalingLaunch[^,]+") + beanstalkEndpointUrl := regexp.MustCompile("awseb.+?EBLoa[^,].+?elb.amazonaws.com") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -146,14 +114,26 @@ func TestAccAWSBeanstalkEnv_basic(t *testing.T) { CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ { - Config: testAccBeanstalkEnvConfig(appName, envName), + Config: testAccBeanstalkEnvConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tfenvtest", &app), - resource.TestMatchResourceAttr( - "aws_elastic_beanstalk_environment.tfenvtest", "arn", - regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:elasticbeanstalk:[^:]+:[^:]+:environment/%s/%s$", appName, envName))), + testAccCheckBeanstalkEnvExists(resourceName, &app), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "elasticbeanstalk", fmt.Sprintf("environment/%s/%s", rName, rName)), + resource.TestMatchResourceAttr(resourceName, "autoscaling_groups.0", beanstalkAsgNameRegexp), + resource.TestMatchResourceAttr(resourceName, "endpoint_url", beanstalkEndpointUrl), + resource.TestMatchResourceAttr(resourceName, "instances.0", beanstalkInstancesNameRegexp), + resource.TestMatchResourceAttr(resourceName, "launch_configurations.0", beanstalkLcNameRegexp), + resource.TestMatchResourceAttr(resourceName, "load_balancers.0", beanstalkElbNameRegexp), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "setting", + "wait_for_ready_timeout", + }, + }, }, }) } @@ -162,12 +142,8 @@ func TestAccAWSBeanstalkEnv_tier(t *testing.T) { var app elasticbeanstalk.EnvironmentDescription beanstalkQueuesNameRegexp := regexp.MustCompile("https://sqs.+?awseb[^,]+") - rString := acctest.RandString(8) - instanceProfileName := fmt.Sprintf("tf_acc_profile_beanstalk_env_tier_%s", rString) - roleName := fmt.Sprintf("tf_acc_role_beanstalk_env_tier_%s", rString) - policyName := fmt.Sprintf("tf_acc_policy_beanstalk_env_tier_%s", rString) - appName := fmt.Sprintf("tf_acc_app_env_tier_%s", rString) - envName := fmt.Sprintf("tf-acc-env-tier-%s", rString) + resourceName := "aws_elastic_beanstalk_environment.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -175,50 +151,20 @@ func TestAccAWSBeanstalkEnv_tier(t *testing.T) { CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ { - Config: testAccBeanstalkWorkerEnvConfig(instanceProfileName, roleName, policyName, appName, envName), + Config: testAccBeanstalkWorkerEnvConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvTier("aws_elastic_beanstalk_environment.tfenvtest", &app), - resource.TestMatchResourceAttr( - "aws_elastic_beanstalk_environment.tfenvtest", "queues.0", beanstalkQueuesNameRegexp), + testAccCheckBeanstalkEnvTier(resourceName, &app), + resource.TestMatchResourceAttr(resourceName, "queues.0", beanstalkQueuesNameRegexp), ), }, - }, - }) -} - -func TestAccAWSBeanstalkEnv_outputs(t *testing.T) { - var app elasticbeanstalk.EnvironmentDescription - - beanstalkAsgNameRegexp := regexp.MustCompile("awseb.+?AutoScalingGroup[^,]+") - beanstalkElbNameRegexp := regexp.MustCompile("awseb.+?EBLoa[^,]+") - beanstalkInstancesNameRegexp := regexp.MustCompile("i-([0-9a-fA-F]{8}|[0-9a-fA-F]{17})") - beanstalkLcNameRegexp := regexp.MustCompile("awseb.+?AutoScalingLaunch[^,]+") - beanstalkEndpointUrl := regexp.MustCompile("awseb.+?EBLoa[^,].+?elb.amazonaws.com") - - rString := acctest.RandString(8) - appName := fmt.Sprintf("tf_acc_app_env_outputs_%s", rString) - envName := fmt.Sprintf("tf-acc-env-outputs-%s", rString) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckBeanstalkEnvDestroy, - Steps: []resource.TestStep{ { - Config: testAccBeanstalkEnvConfig(appName, envName), - Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tfenvtest", &app), - resource.TestMatchResourceAttr( - "aws_elastic_beanstalk_environment.tfenvtest", "autoscaling_groups.0", beanstalkAsgNameRegexp), - resource.TestMatchResourceAttr( - "aws_elastic_beanstalk_environment.tfenvtest", "load_balancers.0", beanstalkElbNameRegexp), - resource.TestMatchResourceAttr( - "aws_elastic_beanstalk_environment.tfenvtest", "instances.0", beanstalkInstancesNameRegexp), - resource.TestMatchResourceAttr( - "aws_elastic_beanstalk_environment.tfenvtest", "launch_configurations.0", beanstalkLcNameRegexp), - resource.TestMatchResourceAttr( - "aws_elastic_beanstalk_environment.tfenvtest", "endpoint_url", beanstalkEndpointUrl), - ), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "setting", + "wait_for_ready_timeout", + }, }, }, }) @@ -227,12 +173,10 @@ func TestAccAWSBeanstalkEnv_outputs(t *testing.T) { func TestAccAWSBeanstalkEnv_cname_prefix(t *testing.T) { var app elasticbeanstalk.EnvironmentDescription - rString := acctest.RandString(8) - appName := fmt.Sprintf("tf_acc_app_env_cname_prefix_%s", rString) - envName := fmt.Sprintf("tf-acc-env-cname-prefix-%s", rString) - cnamePrefix := fmt.Sprintf("tf-acc-cname-%s", rString) + resourceName := "aws_elastic_beanstalk_environment.test" + rName := acctest.RandomWithPrefix("tf-acc-test") - beanstalkCnameRegexp := regexp.MustCompile("^" + cnamePrefix + ".+?elasticbeanstalk.com$") + beanstalkCnameRegexp := regexp.MustCompile("^" + rName + ".+?elasticbeanstalk.com$") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -240,13 +184,21 @@ func TestAccAWSBeanstalkEnv_cname_prefix(t *testing.T) { CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ { - Config: testAccBeanstalkEnvCnamePrefixConfig(appName, envName, cnamePrefix), + Config: testAccBeanstalkEnvCnamePrefixConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tfenvtest", &app), - resource.TestMatchResourceAttr( - "aws_elastic_beanstalk_environment.tfenvtest", "cname", beanstalkCnameRegexp), + testAccCheckBeanstalkEnvExists(resourceName, &app), + resource.TestMatchResourceAttr(resourceName, "cname", beanstalkCnameRegexp), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "setting", + "wait_for_ready_timeout", + }, + }, }, }) } @@ -254,10 +206,8 @@ func TestAccAWSBeanstalkEnv_cname_prefix(t *testing.T) { func TestAccAWSBeanstalkEnv_config(t *testing.T) { var app elasticbeanstalk.EnvironmentDescription - rString := acctest.RandString(8) - appName := fmt.Sprintf("tf_acc_app_env_config_%s", rString) - envName := fmt.Sprintf("tf-acc-env-config-%s", rString) - cfgTplName := fmt.Sprintf("tf_acc_cfg_tpl_config_%s", rString) + resourceName := "aws_elastic_beanstalk_environment.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -265,26 +215,34 @@ func TestAccAWSBeanstalkEnv_config(t *testing.T) { CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ { - Config: testAccBeanstalkConfigTemplate(appName, envName, cfgTplName, 1), + Config: testAccBeanstalkConfigTemplate(rName, 1), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tftest", &app), - testAccCheckBeanstalkEnvConfigValue("aws_elastic_beanstalk_environment.tftest", "1"), + testAccCheckBeanstalkEnvExists(resourceName, &app), + testAccCheckBeanstalkEnvConfigValue(resourceName, "1"), ), }, - { - Config: testAccBeanstalkConfigTemplate(appName, envName, cfgTplName, 2), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "setting", + "template_name", + "wait_for_ready_timeout", + }, + }, + { + Config: testAccBeanstalkConfigTemplate(rName, 2), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tftest", &app), - testAccCheckBeanstalkEnvConfigValue("aws_elastic_beanstalk_environment.tftest", "2"), + testAccCheckBeanstalkEnvExists(resourceName, &app), + testAccCheckBeanstalkEnvConfigValue(resourceName, "2"), ), }, - { - Config: testAccBeanstalkConfigTemplate(appName, envName, cfgTplName, 3), + Config: testAccBeanstalkConfigTemplate(rName, 3), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tftest", &app), - testAccCheckBeanstalkEnvConfigValue("aws_elastic_beanstalk_environment.tftest", "3"), + testAccCheckBeanstalkEnvExists(resourceName, &app), + testAccCheckBeanstalkEnvConfigValue(resourceName, "3"), ), }, }, @@ -294,9 +252,8 @@ func TestAccAWSBeanstalkEnv_config(t *testing.T) { func TestAccAWSBeanstalkEnv_resource(t *testing.T) { var app elasticbeanstalk.EnvironmentDescription - rString := acctest.RandString(8) - appName := fmt.Sprintf("tf_acc_app_env_resource_%s", rString) - envName := fmt.Sprintf("tf-acc-env-resource-%s", rString) + resourceName := "aws_elastic_beanstalk_environment.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -304,11 +261,20 @@ func TestAccAWSBeanstalkEnv_resource(t *testing.T) { CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ { - Config: testAccBeanstalkResourceOptionSetting(appName, envName), + Config: testAccBeanstalkResourceOptionSetting(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tfenvtest", &app), + testAccCheckBeanstalkEnvExists(resourceName, &app), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "setting", + "wait_for_ready_timeout", + }, + }, }, }) } @@ -316,9 +282,8 @@ func TestAccAWSBeanstalkEnv_resource(t *testing.T) { func TestAccAWSBeanstalkEnv_tags(t *testing.T) { var app elasticbeanstalk.EnvironmentDescription - rString := acctest.RandString(8) - appName := fmt.Sprintf("tf_acc_app_env_resource_%s", rString) - envName := fmt.Sprintf("tf-acc-env-resource-%s", rString) + resourceName := "aws_elastic_beanstalk_environment.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -326,33 +291,32 @@ func TestAccAWSBeanstalkEnv_tags(t *testing.T) { CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ { - Config: testAccBeanstalkEnvConfig_empty_settings(appName, envName), + Config: testAccBeanstalkTagsTemplate(rName, "test1", "test2"), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tfenvtest", &app), - testAccCheckBeanstalkEnvTagsMatch(&app, map[string]string{}), + testAccCheckBeanstalkEnvExists(resourceName, &app), + testAccCheckBeanstalkEnvTagsMatch(&app, map[string]string{"firstTag": "test1", "secondTag": "test2"}), ), }, - { - Config: testAccBeanstalkTagsTemplate(appName, envName, "test1", "test2"), - Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tfenvtest", &app), - testAccCheckBeanstalkEnvTagsMatch(&app, map[string]string{"firstTag": "test1", "secondTag": "test2"}), - ), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "setting", + "wait_for_ready_timeout", + }, }, - { - Config: testAccBeanstalkTagsTemplate(appName, envName, "test2", "test1"), + Config: testAccBeanstalkTagsTemplate(rName, "test2", "test1"), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tfenvtest", &app), + testAccCheckBeanstalkEnvExists(resourceName, &app), testAccCheckBeanstalkEnvTagsMatch(&app, map[string]string{"firstTag": "test2", "secondTag": "test1"}), ), }, - { - Config: testAccBeanstalkEnvConfig_empty_settings(appName, envName), + Config: testAccBeanstalkEnvConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tfenvtest", &app), + testAccCheckBeanstalkEnvExists(resourceName, &app), testAccCheckBeanstalkEnvTagsMatch(&app, map[string]string{}), ), }, @@ -360,38 +324,11 @@ func TestAccAWSBeanstalkEnv_tags(t *testing.T) { }) } -func TestAccAWSBeanstalkEnv_vpc(t *testing.T) { - var app elasticbeanstalk.EnvironmentDescription - - rString := acctest.RandString(8) - sgName := fmt.Sprintf("tf_acc_sg_beanstalk_env_vpc_%s", rString) - appName := fmt.Sprintf("tf_acc_app_env_vpc_%s", rString) - envName := fmt.Sprintf("tf-acc-env-vpc-%s", rString) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - }, - Providers: testAccProviders, - CheckDestroy: testAccCheckBeanstalkEnvDestroy, - Steps: []resource.TestStep{ - { - Config: testAccBeanstalkEnv_VPC(sgName, appName, envName), - Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.default", &app), - ), - }, - }, - }) -} - func TestAccAWSBeanstalkEnv_template_change(t *testing.T) { var app elasticbeanstalk.EnvironmentDescription - rString := acctest.RandString(8) - appName := fmt.Sprintf("tf_acc_app_env_tpl_change_%s", rString) - envName := fmt.Sprintf("tf-acc-env-tpl-change-%s", rString) - cfgTplName := fmt.Sprintf("tf_acc_tpl_env_tpl_change_%s", rString) + resourceName := "aws_elastic_beanstalk_environment.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { @@ -401,33 +338,32 @@ func TestAccAWSBeanstalkEnv_template_change(t *testing.T) { CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ { - Config: testAccBeanstalkEnv_TemplateChange_stack(appName, envName, cfgTplName), + Config: testAccBeanstalkEnv_TemplateChange_stack(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.environment", &app), + testAccCheckBeanstalkEnvExists(resourceName, &app), ), }, { - Config: testAccBeanstalkEnv_TemplateChange_temp(appName, envName, cfgTplName), + Config: testAccBeanstalkEnv_TemplateChange_temp(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.environment", &app), + testAccCheckBeanstalkEnvExists(resourceName, &app), ), }, { - Config: testAccBeanstalkEnv_TemplateChange_stack(appName, envName, cfgTplName), + Config: testAccBeanstalkEnv_TemplateChange_stack(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.environment", &app), + testAccCheckBeanstalkEnvExists(resourceName, &app), ), }, }, }) } -func TestAccAWSBeanstalkEnv_basic_settings_update(t *testing.T) { +func TestAccAWSBeanstalkEnv_settings_update(t *testing.T) { var app elasticbeanstalk.EnvironmentDescription - rString := acctest.RandString(8) - appName := fmt.Sprintf("tf_acc_app_env_basic_settings_upd_%s", rString) - envName := fmt.Sprintf("tf-acc-env-basic-settings-upd-%s", rString) + resourceName := "aws_elastic_beanstalk_environment.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -435,30 +371,30 @@ func TestAccAWSBeanstalkEnv_basic_settings_update(t *testing.T) { CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ { - Config: testAccBeanstalkEnvConfig_empty_settings(appName, envName), + Config: testAccBeanstalkEnvConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tfenvtest", &app), + testAccCheckBeanstalkEnvExists(resourceName, &app), testAccVerifyBeanstalkConfig(&app, []string{}), ), }, { - Config: testAccBeanstalkEnvConfig_settings(appName, envName), + Config: testAccBeanstalkEnvConfig_settings(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tfenvtest", &app), + testAccCheckBeanstalkEnvExists(resourceName, &app), testAccVerifyBeanstalkConfig(&app, []string{"ENV_STATIC", "ENV_UPDATE"}), ), }, { - Config: testAccBeanstalkEnvConfig_settings(appName, envName), + Config: testAccBeanstalkEnvConfig_settings(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tfenvtest", &app), + testAccCheckBeanstalkEnvExists(resourceName, &app), testAccVerifyBeanstalkConfig(&app, []string{"ENV_STATIC", "ENV_UPDATE"}), ), }, { - Config: testAccBeanstalkEnvConfig_empty_settings(appName, envName), + Config: testAccBeanstalkEnvConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tfenvtest", &app), + testAccCheckBeanstalkEnvExists(resourceName, &app), testAccVerifyBeanstalkConfig(&app, []string{}), ), }, @@ -469,12 +405,8 @@ func TestAccAWSBeanstalkEnv_basic_settings_update(t *testing.T) { func TestAccAWSBeanstalkEnv_version_label(t *testing.T) { var app elasticbeanstalk.EnvironmentDescription - rString := acctest.RandString(8) - bucketName := fmt.Sprintf("tf-acc-bucket-beanstalk-env-version-label-%s", rString) - appName := fmt.Sprintf("tf_acc_app_env_version_label_%s", rString) - appVersionName := fmt.Sprintf("tf_acc_version_env_version_label_%s", rString) - uAppVersionName := fmt.Sprintf("tf_acc_version_env_version_label_v2_%s", rString) - envName := fmt.Sprintf("tf-acc-env-version-label-%s", rString) + resourceName := "aws_elastic_beanstalk_environment.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -482,15 +414,24 @@ func TestAccAWSBeanstalkEnv_version_label(t *testing.T) { CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ { - Config: testAccBeanstalkEnvApplicationVersionConfig(bucketName, appName, appVersionName, envName), + Config: testAccBeanstalkEnvApplicationVersionConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkApplicationVersionDeployed("aws_elastic_beanstalk_environment.default", &app), + testAccCheckBeanstalkApplicationVersionDeployed(resourceName, &app), ), }, { - Config: testAccBeanstalkEnvApplicationVersionConfig(bucketName, appName, uAppVersionName, envName), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "setting", + "wait_for_ready_timeout", + }, + }, + { + Config: testAccBeanstalkEnvApplicationVersionConfigUpdate(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkApplicationVersionDeployed("aws_elastic_beanstalk_environment.default", &app), + testAccCheckBeanstalkApplicationVersionDeployed(resourceName, &app), ), }, }, @@ -500,14 +441,8 @@ func TestAccAWSBeanstalkEnv_version_label(t *testing.T) { func TestAccAWSBeanstalkEnv_settingWithJsonValue(t *testing.T) { var app elasticbeanstalk.EnvironmentDescription - rString := acctest.RandString(8) - appName := fmt.Sprintf("tf_acc_app_env_setting_w_json_value_%s", rString) - queueName := fmt.Sprintf("tf_acc_queue_beanstalk_env_setting_w_json_value_%s", rString) - keyPairName := fmt.Sprintf("tf_acc_keypair_beanstalk_env_setting_w_json_value_%s", rString) - instanceProfileName := fmt.Sprintf("tf_acc_profile_beanstalk_env_setting_w_json_value_%s", rString) - roleName := fmt.Sprintf("tf_acc_role_beanstalk_env_setting_w_json_value_%s", rString) - policyName := fmt.Sprintf("tf-acc-policy-beanstalk-env-setting-w-json-value-%s", rString) - envName := fmt.Sprintf("tf-acc-env-setting-w-json-value-%s", rString) + resourceName := "aws_elastic_beanstalk_environment.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -515,11 +450,20 @@ func TestAccAWSBeanstalkEnv_settingWithJsonValue(t *testing.T) { CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ { - Config: testAccBeanstalkEnvSettingJsonValue(appName, queueName, keyPairName, instanceProfileName, roleName, policyName, envName), + Config: testAccBeanstalkEnvSettingJsonValue(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.default", &app), + testAccCheckBeanstalkEnvExists(resourceName, &app), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "setting", + "wait_for_ready_timeout", + }, + }, }, }) } @@ -527,10 +471,8 @@ func TestAccAWSBeanstalkEnv_settingWithJsonValue(t *testing.T) { func TestAccAWSBeanstalkEnv_platformArn(t *testing.T) { var app elasticbeanstalk.EnvironmentDescription - rString := acctest.RandString(8) - appName := fmt.Sprintf("tf_acc_app_env_platform_arn_%s", rString) - envName := fmt.Sprintf("tf-acc-env-platform-arn-%s", rString) - platformArn := "arn:aws:elasticbeanstalk:us-east-1::platform/Go 1 running on 64bit Amazon Linux/2.9.0" + resourceName := "aws_elastic_beanstalk_environment.test" + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -538,12 +480,21 @@ func TestAccAWSBeanstalkEnv_platformArn(t *testing.T) { CheckDestroy: testAccCheckBeanstalkEnvDestroy, Steps: []resource.TestStep{ { - Config: testAccBeanstalkEnvConfig_platform_arn(appName, envName, platformArn), + Config: testAccBeanstalkEnvConfig_platform_arn(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckBeanstalkEnvExists("aws_elastic_beanstalk_environment.tfenvtest", &app), - resource.TestCheckResourceAttr("aws_elastic_beanstalk_environment.tfenvtest", "platform_arn", platformArn), + testAccCheckBeanstalkEnvExists(resourceName, &app), + testAccCheckResourceAttrRegionalARNNoAccount(resourceName, "platform_arn", "elasticbeanstalk", "platform/Python 3.6 running on 64bit Amazon Linux/2.9.4"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "setting", + "wait_for_ready_timeout", + }, + }, }, }) } @@ -746,7 +697,7 @@ func testAccCheckBeanstalkEnvTagsMatch(env *elasticbeanstalk.EnvironmentDescript return err } - foundTags := tagsToMapBeanstalk(tags.ResourceTags) + foundTags := keyvaluetags.ElasticbeanstalkKeyValueTags(tags.ResourceTags).IgnoreElasticbeanstalk().Map() if !reflect.DeepEqual(foundTags, expectedValue) { return fmt.Errorf("Tag value: %s. Expected %s", foundTags, expectedValue) @@ -803,71 +754,163 @@ func describeBeanstalkEnv(conn *elasticbeanstalk.ElasticBeanstalk, return resp.Environments[0], nil } -func testAccBeanstalkEnvConfig(appName, envName string) string { +func testAccBeanstalkEnvConfigBase(rName string) string { return fmt.Sprintf(` - resource "aws_elastic_beanstalk_application" "tftest" { - name = "%s" - description = "tf-test-desc" - } +data "aws_availability_zones" "available" { + # Default instance type of t2.micro is not available in this Availability Zone + # The failure will occur during Elastic Beanstalk CloudFormation Template handling + # after waiting upwards of one hour to initialize the Auto Scaling Group. + blacklisted_zone_ids = ["usw2-az4"] + state = "available" +} - resource "aws_elastic_beanstalk_environment" "tfenvtest" { - name = "%s" - application = "${aws_elastic_beanstalk_application.tftest.name}" - solution_stack_name = "64bit Amazon Linux running Python" - depends_on = ["aws_elastic_beanstalk_application.tftest"] - } -`, appName, envName) +data "aws_elastic_beanstalk_solution_stack" "test" { + most_recent = true + name_regex = "64bit Amazon Linux .* running Python .*" } -func testAccBeanstalkEnvConfig_platform_arn(appName, envName, platformArn string) string { - return fmt.Sprintf(` -provider "aws" { - region = "us-east-1" +data "aws_partition" "current" {} + +data "aws_region" "current" {} + +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + + tags = { + Name = "terraform-testacc-elastic-beanstalk-env-vpc" + } } -resource "aws_elastic_beanstalk_application" "tftest" { - name = "%s" - description = "tf-test-desc" +resource "aws_internet_gateway" "test" { + vpc_id = aws_vpc.test.id } -resource "aws_elastic_beanstalk_environment" "tfenvtest" { - name = "%s" - application = "${aws_elastic_beanstalk_application.tftest.name}" - platform_arn = "%s" +resource "aws_route" "test" { + destination_cidr_block = "0.0.0.0/0" + gateway_id = aws_internet_gateway.test.id + route_table_id = aws_vpc.test.main_route_table_id } -`, appName, envName, platformArn) + +resource "aws_subnet" "test" { + availability_zone = data.aws_availability_zones.available.names[0] + cidr_block = "10.0.0.0/24" + vpc_id = aws_vpc.test.id + + tags = { + Name = "tf-acc-elastic-beanstalk-env-vpc" + } } -func testAccBeanstalkEnvConfig_empty_settings(appName, envName string) string { - return fmt.Sprintf(` -resource "aws_elastic_beanstalk_application" "tftest" { - name = "%s" +resource "aws_security_group" "test" { + name = %[1]q + vpc_id = aws_vpc.test.id +} + +resource "aws_elastic_beanstalk_application" "test" { description = "tf-test-desc" + name = %[1]q +} +`, rName) } -resource "aws_elastic_beanstalk_environment" "tfenvtest" { - name = "%s" - application = "${aws_elastic_beanstalk_application.tftest.name}" - solution_stack_name = "64bit Amazon Linux running Python" +func testAccBeanstalkEnvConfig(rName string) string { + return testAccBeanstalkEnvConfigBase(rName) + fmt.Sprintf(` +resource "aws_elastic_beanstalk_environment" "test" { + application = aws_elastic_beanstalk_application.test.name + name = %[1]q + solution_stack_name = data.aws_elastic_beanstalk_solution_stack.test.name + + setting { + namespace = "aws:ec2:vpc" + name = "VPCId" + value = aws_vpc.test.id + } - wait_for_ready_timeout = "15m" + setting { + namespace = "aws:ec2:vpc" + name = "Subnets" + value = aws_subnet.test.id + } + + setting { + namespace = "aws:ec2:vpc" + name = "AssociatePublicIpAddress" + value = "true" + } + + setting { + namespace = "aws:autoscaling:launchconfiguration" + name = "SecurityGroups" + value = aws_security_group.test.id + } } -`, appName, envName) +`, rName) } -func testAccBeanstalkEnvConfig_settings(appName, envName string) string { - return fmt.Sprintf(` -resource "aws_elastic_beanstalk_application" "tftest" { - name = "%s" - description = "tf-test-desc" +func testAccBeanstalkEnvConfig_platform_arn(rName string) string { + return testAccBeanstalkEnvConfigBase(rName) + fmt.Sprintf(` +resource "aws_elastic_beanstalk_environment" "test" { + application = aws_elastic_beanstalk_application.test.name + name = %[1]q + platform_arn = "arn:${data.aws_partition.current.partition}:elasticbeanstalk:${data.aws_region.current.name}::platform/Python 3.6 running on 64bit Amazon Linux/2.9.4" + + setting { + namespace = "aws:ec2:vpc" + name = "VPCId" + value = aws_vpc.test.id + } + + setting { + namespace = "aws:ec2:vpc" + name = "Subnets" + value = aws_subnet.test.id + } + + setting { + namespace = "aws:ec2:vpc" + name = "AssociatePublicIpAddress" + value = "true" + } + + setting { + namespace = "aws:autoscaling:launchconfiguration" + name = "SecurityGroups" + value = aws_security_group.test.id + } +} +`, rName) } -resource "aws_elastic_beanstalk_environment" "tfenvtest" { - name = "%s" - application = "${aws_elastic_beanstalk_application.tftest.name}" - solution_stack_name = "64bit Amazon Linux running Python" +func testAccBeanstalkEnvConfig_settings(rName string) string { + return testAccBeanstalkEnvConfigBase(rName) + fmt.Sprintf(` +resource "aws_elastic_beanstalk_environment" "test" { + application = aws_elastic_beanstalk_application.test.name + name = %[1]q + solution_stack_name = data.aws_elastic_beanstalk_solution_stack.test.name + + setting { + namespace = "aws:ec2:vpc" + name = "VPCId" + value = aws_vpc.test.id + } + + setting { + namespace = "aws:ec2:vpc" + name = "Subnets" + value = aws_subnet.test.id + } + + setting { + namespace = "aws:ec2:vpc" + name = "AssociatePublicIpAddress" + value = "true" + } - wait_for_ready_timeout = "15m" + setting { + namespace = "aws:autoscaling:launchconfiguration" + name = "SecurityGroups" + value = aws_security_group.test.id + } setting { namespace = "aws:elasticbeanstalk:application:environment" @@ -908,101 +951,176 @@ resource "aws_elastic_beanstalk_environment" "tfenvtest" { value = "2016-07-28T04:07:02Z" } } -`, appName, envName) +`, rName) } -func testAccBeanstalkWorkerEnvConfig(instanceProfileName, roleName, policyName, appName, envName string) string { - return fmt.Sprintf(` - resource "aws_iam_instance_profile" "tftest" { - name = "%s" - roles = ["${aws_iam_role.tftest.name}"] - } - - resource "aws_iam_role" "tftest" { - name = "%s" - path = "/" - assume_role_policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Action\":\"sts:AssumeRole\",\"Principal\":{\"Service\":\"ec2.amazonaws.com\"},\"Effect\":\"Allow\",\"Sid\":\"\"}]}" - } - - resource "aws_iam_role_policy" "tftest" { - name = "%s" - role = "${aws_iam_role.tftest.id}" - policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Sid\":\"QueueAccess\",\"Action\":[\"sqs:ChangeMessageVisibility\",\"sqs:DeleteMessage\",\"sqs:ReceiveMessage\"],\"Effect\":\"Allow\",\"Resource\":\"*\"}]}" - } - - resource "aws_elastic_beanstalk_application" "tftest" { - name = "%s" - description = "tf-test-desc" - } - - resource "aws_elastic_beanstalk_environment" "tfenvtest" { - name = "%s" - application = "${aws_elastic_beanstalk_application.tftest.name}" - tier = "Worker" - solution_stack_name = "64bit Amazon Linux running Python" - - setting { - namespace = "aws:autoscaling:launchconfiguration" - name = "IamInstanceProfile" - value = "${aws_iam_instance_profile.tftest.name}" - } - }`, instanceProfileName, roleName, policyName, appName, envName) -} - -func testAccBeanstalkEnvCnamePrefixConfig(appName, envName, cnamePrefix string) string { - return fmt.Sprintf(` -resource "aws_elastic_beanstalk_application" "tftest" { - name = "%s" - description = "tf-test-desc" +func testAccBeanstalkWorkerEnvConfig(rName string) string { + return testAccBeanstalkEnvConfigBase(rName) + fmt.Sprintf(` +resource "aws_iam_instance_profile" "test" { + name = %[1]q + roles = [aws_iam_role.test.name] } -resource "aws_elastic_beanstalk_environment" "tfenvtest" { - name = "%s" - application = "${aws_elastic_beanstalk_application.tftest.name}" - cname_prefix = "%s" - solution_stack_name = "64bit Amazon Linux running Python" +resource "aws_iam_role" "test" { + assume_role_policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Action\":\"sts:AssumeRole\",\"Principal\":{\"Service\":\"ec2.${data.aws_partition.current.dns_suffix}\"},\"Effect\":\"Allow\",\"Sid\":\"\"}]}" + name = %[1]q } -`, appName, envName, cnamePrefix) + +resource "aws_iam_role_policy_attachment" "test" { + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/AWSElasticBeanstalkWorkerTier" + role = aws_iam_role.test.id } -func testAccBeanstalkConfigTemplate(appName, envName, cfgTplName string, cfgTplValue int) string { - return fmt.Sprintf(` -resource "aws_elastic_beanstalk_application" "tftest" { - name = "%s" - description = "tf-test-desc" +resource "aws_elastic_beanstalk_environment" "test" { + application = aws_elastic_beanstalk_application.test.name + name = %[1]q + solution_stack_name = data.aws_elastic_beanstalk_solution_stack.test.name + tier = "Worker" + + setting { + namespace = "aws:ec2:vpc" + name = "VPCId" + value = aws_vpc.test.id + } + + setting { + namespace = "aws:ec2:vpc" + name = "Subnets" + value = aws_subnet.test.id + } + + setting { + namespace = "aws:ec2:vpc" + name = "AssociatePublicIpAddress" + value = "true" + } + + setting { + namespace = "aws:autoscaling:launchconfiguration" + name = "SecurityGroups" + value = aws_security_group.test.id + } + + setting { + namespace = "aws:autoscaling:launchconfiguration" + name = "IamInstanceProfile" + value = aws_iam_instance_profile.test.name + } +} +`, rName) +} + +func testAccBeanstalkEnvCnamePrefixConfig(rName string) string { + return testAccBeanstalkEnvConfigBase(rName) + fmt.Sprintf(` +resource "aws_elastic_beanstalk_environment" "test" { + application = aws_elastic_beanstalk_application.test.name + cname_prefix = %[1]q + name = %[1]q + solution_stack_name = data.aws_elastic_beanstalk_solution_stack.test.name + + setting { + namespace = "aws:ec2:vpc" + name = "VPCId" + value = aws_vpc.test.id + } + + setting { + namespace = "aws:ec2:vpc" + name = "Subnets" + value = aws_subnet.test.id + } + + setting { + namespace = "aws:ec2:vpc" + name = "AssociatePublicIpAddress" + value = "true" + } + + setting { + namespace = "aws:autoscaling:launchconfiguration" + name = "SecurityGroups" + value = aws_security_group.test.id + } +} +`, rName) } -resource "aws_elastic_beanstalk_environment" "tftest" { - name = "%s" - application = "${aws_elastic_beanstalk_application.tftest.name}" - template_name = "${aws_elastic_beanstalk_configuration_template.tftest.name}" +func testAccBeanstalkConfigTemplate(rName string, cfgTplValue int) string { + return testAccBeanstalkEnvConfigBase(rName) + fmt.Sprintf(` +resource "aws_elastic_beanstalk_environment" "test" { + application = aws_elastic_beanstalk_application.test.name + name = %[1]q + template_name = aws_elastic_beanstalk_configuration_template.test.name } -resource "aws_elastic_beanstalk_configuration_template" "tftest" { - name = "%s" - application = "${aws_elastic_beanstalk_application.tftest.name}" - solution_stack_name = "64bit Amazon Linux running Python" +resource "aws_elastic_beanstalk_configuration_template" "test" { + application = aws_elastic_beanstalk_application.test.name + name = %[1]q + solution_stack_name = data.aws_elastic_beanstalk_solution_stack.test.name + + setting { + namespace = "aws:ec2:vpc" + name = "VPCId" + value = aws_vpc.test.id + } + + setting { + namespace = "aws:ec2:vpc" + name = "Subnets" + value = aws_subnet.test.id + } + + setting { + namespace = "aws:ec2:vpc" + name = "AssociatePublicIpAddress" + value = "true" + } + + setting { + namespace = "aws:autoscaling:launchconfiguration" + name = "SecurityGroups" + value = aws_security_group.test.id + } setting { namespace = "aws:elasticbeanstalk:application:environment" name = "TEMPLATE" - value = "%d" + value = %[2]d } } -`, appName, envName, cfgTplName, cfgTplValue) +`, rName, cfgTplValue) } -func testAccBeanstalkResourceOptionSetting(appName, envName string) string { - return fmt.Sprintf(` -resource "aws_elastic_beanstalk_application" "tftest" { - name = "%s" - description = "tf-test-desc" -} +func testAccBeanstalkResourceOptionSetting(rName string) string { + return testAccBeanstalkEnvConfigBase(rName) + fmt.Sprintf(` +resource "aws_elastic_beanstalk_environment" "test" { + application = aws_elastic_beanstalk_application.test.name + name = %[1]q + solution_stack_name = data.aws_elastic_beanstalk_solution_stack.test.name -resource "aws_elastic_beanstalk_environment" "tfenvtest" { - name = "%s" - application = "${aws_elastic_beanstalk_application.tftest.name}" - solution_stack_name = "64bit Amazon Linux running Python" + setting { + namespace = "aws:ec2:vpc" + name = "VPCId" + value = aws_vpc.test.id + } + + setting { + namespace = "aws:ec2:vpc" + name = "Subnets" + value = aws_subnet.test.id + } + + setting { + namespace = "aws:ec2:vpc" + name = "AssociatePublicIpAddress" + value = "true" + } + + setting { + namespace = "aws:autoscaling:launchconfiguration" + name = "SecurityGroups" + value = aws_security_group.test.id + } setting { namespace = "aws:autoscaling:scheduledaction" @@ -1025,85 +1143,105 @@ resource "aws_elastic_beanstalk_environment" "tfenvtest" { value = "0 8 * * *" } } -`, appName, envName) +`, rName) } -func testAccBeanstalkTagsTemplate(appName, envName, firstTag, secondTag string) string { - return fmt.Sprintf(` -resource "aws_elastic_beanstalk_application" "tftest" { - name = "%s" - description = "tf-test-desc" -} +func testAccBeanstalkTagsTemplate(rName, firstTag, secondTag string) string { + return testAccBeanstalkEnvConfigBase(rName) + fmt.Sprintf(` +resource "aws_elastic_beanstalk_environment" "test" { + application = aws_elastic_beanstalk_application.test.name + name = %[1]q + solution_stack_name = data.aws_elastic_beanstalk_solution_stack.test.name -resource "aws_elastic_beanstalk_environment" "tfenvtest" { - name = "%s" - application = "${aws_elastic_beanstalk_application.tftest.name}" - solution_stack_name = "64bit Amazon Linux running Python" + setting { + namespace = "aws:ec2:vpc" + name = "VPCId" + value = aws_vpc.test.id + } - wait_for_ready_timeout = "15m" + setting { + namespace = "aws:ec2:vpc" + name = "Subnets" + value = aws_subnet.test.id + } - tags = { - firstTag = "%s" - secondTag = "%s" + setting { + namespace = "aws:ec2:vpc" + name = "AssociatePublicIpAddress" + value = "true" } -} -`, appName, envName, firstTag, secondTag) -} -func testAccBeanstalkEnv_VPC(sgName, appName, envName string) string { - return fmt.Sprintf(` -resource "aws_vpc" "tf_b_test" { - cidr_block = "10.0.0.0/16" + setting { + namespace = "aws:autoscaling:launchconfiguration" + name = "SecurityGroups" + value = aws_security_group.test.id + } tags = { - Name = "terraform-testacc-elastic-beanstalk-env-vpc" + firstTag = %[2]q + secondTag = %[3]q } } - -resource "aws_internet_gateway" "tf_b_test" { - vpc_id = "${aws_vpc.tf_b_test.id}" +`, rName, firstTag, secondTag) } -resource "aws_route" "r" { - route_table_id = "${aws_vpc.tf_b_test.main_route_table_id}" - destination_cidr_block = "0.0.0.0/0" - gateway_id = "${aws_internet_gateway.tf_b_test.id}" -} +func testAccBeanstalkEnv_TemplateChange_stack(rName string) string { + return testAccBeanstalkEnvConfigBase(rName) + fmt.Sprintf(` +resource "aws_elastic_beanstalk_environment" "test" { + application = aws_elastic_beanstalk_application.test.name + name = %[1]q + solution_stack_name = data.aws_elastic_beanstalk_solution_stack.test.name -resource "aws_subnet" "main" { - vpc_id = "${aws_vpc.tf_b_test.id}" - cidr_block = "10.0.0.0/24" + setting { + namespace = "aws:ec2:vpc" + name = "VPCId" + value = aws_vpc.test.id + } - tags = { - Name = "tf-acc-elastic-beanstalk-env-vpc" + setting { + namespace = "aws:ec2:vpc" + name = "Subnets" + value = aws_subnet.test.id } -} -resource "aws_security_group" "default" { - name = "%s" - vpc_id = "${aws_vpc.tf_b_test.id}" + setting { + namespace = "aws:ec2:vpc" + name = "AssociatePublicIpAddress" + value = "true" + } + + setting { + namespace = "aws:autoscaling:launchconfiguration" + name = "SecurityGroups" + value = aws_security_group.test.id + } } -resource "aws_elastic_beanstalk_application" "default" { - name = "%s" - description = "tf-test-desc" +resource "aws_elastic_beanstalk_configuration_template" "test" { + application = aws_elastic_beanstalk_application.test.name + name = %[1]q + solution_stack_name = data.aws_elastic_beanstalk_solution_stack.test.name +} +`, rName) } -resource "aws_elastic_beanstalk_environment" "default" { - name = "%s" - application = "${aws_elastic_beanstalk_application.default.name}" - solution_stack_name = "64bit Amazon Linux running Python" +func testAccBeanstalkEnv_TemplateChange_temp(rName string) string { + return testAccBeanstalkEnvConfigBase(rName) + fmt.Sprintf(` +resource "aws_elastic_beanstalk_environment" "test" { + application = aws_elastic_beanstalk_application.test.name + name = %[1]q + template_name = aws_elastic_beanstalk_configuration_template.test.name setting { namespace = "aws:ec2:vpc" name = "VPCId" - value = "${aws_vpc.tf_b_test.id}" + value = aws_vpc.test.id } setting { namespace = "aws:ec2:vpc" name = "Subnets" - value = "${aws_subnet.main.id}" + value = aws_subnet.test.id } setting { @@ -1115,127 +1253,140 @@ resource "aws_elastic_beanstalk_environment" "default" { setting { namespace = "aws:autoscaling:launchconfiguration" name = "SecurityGroups" - value = "${aws_security_group.default.id}" + value = aws_security_group.test.id } } -`, sgName, appName, envName) -} -func testAccBeanstalkEnv_TemplateChange_stack(appName, envName, cfgTplName string) string { - return fmt.Sprintf(` -provider "aws" { - region = "us-east-1" +resource "aws_elastic_beanstalk_configuration_template" "test" { + application = aws_elastic_beanstalk_application.test.name + name = %[1]q + solution_stack_name = data.aws_elastic_beanstalk_solution_stack.test.name } - -resource "aws_elastic_beanstalk_application" "app" { - name = "%s" - description = "" +`, rName) } -resource "aws_elastic_beanstalk_environment" "environment" { - name = "%s" - application = "${aws_elastic_beanstalk_application.app.name}" - - # Go 1.4 - solution_stack_name = "64bit Amazon Linux 2016.03 v2.1.0 running Go 1.4" +func testAccBeanstalkEnvApplicationVersionConfig(rName string) string { + return testAccBeanstalkEnvConfigBase(rName) + fmt.Sprintf(` +resource "aws_s3_bucket" "test" { + bucket = %[1]q } -resource "aws_elastic_beanstalk_configuration_template" "template" { - name = "%s" - application = "${aws_elastic_beanstalk_application.app.name}" - - # Go 1.5 - solution_stack_name = "64bit Amazon Linux 2016.03 v2.1.3 running Go 1.5" -} -`, appName, envName, cfgTplName) +resource "aws_s3_bucket_object" "test" { + bucket = aws_s3_bucket.test.id + key = "python-v1.zip" + source = "test-fixtures/python-v1.zip" } -func testAccBeanstalkEnv_TemplateChange_temp(appName, envName, cfgTplName string) string { - return fmt.Sprintf(` -provider "aws" { - region = "us-east-1" +resource "aws_elastic_beanstalk_application_version" "test" { + application = aws_elastic_beanstalk_application.test.name + bucket = aws_s3_bucket.test.id + key = aws_s3_bucket_object.test.id + name = "%[1]s-1" } -resource "aws_elastic_beanstalk_application" "app" { - name = "%s" - description = "" -} +resource "aws_elastic_beanstalk_environment" "test" { + application = aws_elastic_beanstalk_application.test.name + name = %[1]q + solution_stack_name = data.aws_elastic_beanstalk_solution_stack.test.name + version_label = aws_elastic_beanstalk_application_version.test.name -resource "aws_elastic_beanstalk_environment" "environment" { - name = "%s" - application = "${aws_elastic_beanstalk_application.app.name}" + setting { + namespace = "aws:ec2:vpc" + name = "VPCId" + value = aws_vpc.test.id + } - # Go 1.4 - template_name = "${aws_elastic_beanstalk_configuration_template.template.name}" -} + setting { + namespace = "aws:ec2:vpc" + name = "Subnets" + value = aws_subnet.test.id + } -resource "aws_elastic_beanstalk_configuration_template" "template" { - name = "%s" - application = "${aws_elastic_beanstalk_application.app.name}" + setting { + namespace = "aws:ec2:vpc" + name = "AssociatePublicIpAddress" + value = "true" + } - # Go 1.5 - solution_stack_name = "64bit Amazon Linux 2016.03 v2.1.3 running Go 1.5" + setting { + namespace = "aws:autoscaling:launchconfiguration" + name = "SecurityGroups" + value = aws_security_group.test.id + } } -`, appName, envName, cfgTplName) +`, rName) } -func testAccBeanstalkEnvApplicationVersionConfig(bucketName, appName, appVersionName, envName string) string { - return fmt.Sprintf(` -resource "aws_s3_bucket" "default" { - bucket = "%s" +func testAccBeanstalkEnvApplicationVersionConfigUpdate(rName string) string { + return testAccBeanstalkEnvConfigBase(rName) + fmt.Sprintf(` +resource "aws_s3_bucket" "test" { + bucket = %[1]q } -resource "aws_s3_bucket_object" "default" { - bucket = "${aws_s3_bucket.default.id}" +resource "aws_s3_bucket_object" "test" { + bucket = aws_s3_bucket.test.id key = "python-v1.zip" source = "test-fixtures/python-v1.zip" } -resource "aws_elastic_beanstalk_application" "default" { - name = "%s" - description = "tf-test-desc" +resource "aws_elastic_beanstalk_application_version" "test" { + application = aws_elastic_beanstalk_application.test.name + bucket = aws_s3_bucket.test.id + key = aws_s3_bucket_object.test.id + name = "%[1]s-2" } -resource "aws_elastic_beanstalk_application_version" "default" { - application = "${aws_elastic_beanstalk_application.default.name}" - name = "%s" - bucket = "${aws_s3_bucket.default.id}" - key = "${aws_s3_bucket_object.default.id}" -} +resource "aws_elastic_beanstalk_environment" "test" { + application = aws_elastic_beanstalk_application.test.name + name = %[1]q + solution_stack_name = data.aws_elastic_beanstalk_solution_stack.test.name + version_label = aws_elastic_beanstalk_application_version.test.name -resource "aws_elastic_beanstalk_environment" "default" { - name = "%s" - application = "${aws_elastic_beanstalk_application.default.name}" - version_label = "${aws_elastic_beanstalk_application_version.default.name}" - solution_stack_name = "64bit Amazon Linux running Python" -} -`, bucketName, appName, appVersionName, envName) -} + setting { + namespace = "aws:ec2:vpc" + name = "VPCId" + value = aws_vpc.test.id + } -func testAccBeanstalkEnvSettingJsonValue(appName, queueName, keyPairName, instanceProfileName, roleName, policyName, envName string) string { - return fmt.Sprintf(` -resource "aws_elastic_beanstalk_application" "app" { - name = "%s" - description = "This is a description" + setting { + namespace = "aws:ec2:vpc" + name = "Subnets" + value = aws_subnet.test.id + } + + setting { + namespace = "aws:ec2:vpc" + name = "AssociatePublicIpAddress" + value = "true" + } + + setting { + namespace = "aws:autoscaling:launchconfiguration" + name = "SecurityGroups" + value = aws_security_group.test.id + } +} +`, rName) } +func testAccBeanstalkEnvSettingJsonValue(rName string) string { + return testAccBeanstalkEnvConfigBase(rName) + fmt.Sprintf(` resource "aws_sqs_queue" "test" { - name = "%s" + name = %[1]q } resource "aws_key_pair" "test" { - key_name = "%s" + key_name = %[1]q public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 email@example.com" } -resource "aws_iam_instance_profile" "app" { - name = "%s" - role = "${aws_iam_role.test.name}" +resource "aws_iam_instance_profile" "test" { + name = %[1]q + role = aws_iam_role.test.name } resource "aws_iam_role" "test" { - name = "%s" - path = "/" + name = %[1]q assume_role_policy = < 0 { - et = resp.TagList + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - d.Set("tags", tagsToMapEC(et)) } return nil @@ -500,15 +504,12 @@ func resourceAwsElasticacheClusterRead(d *schema.ResourceData, meta interface{}) func resourceAwsElasticacheClusterUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).elasticacheconn - arn := arn.ARN{ - Partition: meta.(*AWSClient).partition, - Service: "elasticache", - Region: meta.(*AWSClient).region, - AccountID: meta.(*AWSClient).accountid, - Resource: fmt.Sprintf("cluster:%s", d.Id()), - }.String() - if err := setTagsEC(conn, d, arn); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.ElasticacheUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating Elasticache Cluster (%s) tags: %s", d.Get("arn").(string), err) + } } req := &elasticache.ModifyCacheClusterInput{ diff --git a/aws/resource_aws_elasticache_cluster_test.go b/aws/resource_aws_elasticache_cluster_test.go index 9589f49d94e..20fa0ca9afc 100644 --- a/aws/resource_aws_elasticache_cluster_test.go +++ b/aws/resource_aws_elasticache_cluster_test.go @@ -67,17 +67,13 @@ func testSweepElasticacheClusters(region string) error { return nil } -func TestAccAWSElasticacheCluster_Engine_Memcached_Ec2Classic(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - +func TestAccAWSElasticacheCluster_Engine_Memcached(t *testing.T) { var ec elasticache.CacheCluster rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_elasticache_cluster.bar" + resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -104,17 +100,13 @@ func TestAccAWSElasticacheCluster_Engine_Memcached_Ec2Classic(t *testing.T) { }) } -func TestAccAWSElasticacheCluster_Engine_Redis_Ec2Classic(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - +func TestAccAWSElasticacheCluster_Engine_Redis(t *testing.T) { var ec elasticache.CacheCluster rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_elasticache_cluster.bar" + resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -139,6 +131,25 @@ func TestAccAWSElasticacheCluster_Engine_Redis_Ec2Classic(t *testing.T) { }) } +func TestAccAWSElasticacheCluster_Port_Redis_Default(t *testing.T) { + var ec elasticache.CacheCluster + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSElasticacheClusterConfig_RedisDefaultPort, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSElasticacheClusterExists("aws_elasticache_cluster.test", &ec), + resource.TestCheckResourceAttr("aws_security_group_rule.test", "to_port", "6379"), + resource.TestCheckResourceAttr("aws_security_group_rule.test", "from_port", "6379"), + ), + }, + }, + }) +} + func TestAccAWSElasticacheCluster_ParameterGroupName_Default(t *testing.T) { var ec elasticache.CacheCluster rName := acctest.RandomWithPrefix("tf-acc-test") @@ -170,18 +181,14 @@ func TestAccAWSElasticacheCluster_ParameterGroupName_Default(t *testing.T) { }) } -func TestAccAWSElasticacheCluster_Port_Ec2Classic(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - +func TestAccAWSElasticacheCluster_Port(t *testing.T) { var ec elasticache.CacheCluster port := 11212 rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_elasticache_cluster.bar" + resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -209,21 +216,24 @@ func TestAccAWSElasticacheCluster_Port_Ec2Classic(t *testing.T) { } func TestAccAWSElasticacheCluster_SecurityGroup(t *testing.T) { + oldvar := os.Getenv("AWS_DEFAULT_REGION") + os.Setenv("AWS_DEFAULT_REGION", "us-east-1") + defer os.Setenv("AWS_DEFAULT_REGION", oldvar) + var ec elasticache.CacheCluster resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ { Config: testAccAWSElasticacheClusterConfig_SecurityGroup, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheSecurityGroupExists("aws_elasticache_security_group.bar"), - testAccCheckAWSElasticacheClusterExists("aws_elasticache_cluster.bar", &ec), - resource.TestCheckResourceAttr( - "aws_elasticache_cluster.bar", "cache_nodes.0.id", "0001"), - resource.TestCheckResourceAttrSet("aws_elasticache_cluster.bar", "configuration_endpoint"), - resource.TestCheckResourceAttrSet("aws_elasticache_cluster.bar", "cluster_address"), + testAccCheckAWSElasticacheSecurityGroupExists("aws_elasticache_security_group.test"), + testAccCheckAWSElasticacheClusterExists("aws_elasticache_cluster.test", &ec), + resource.TestCheckResourceAttr("aws_elasticache_cluster.test", "cache_nodes.0.id", "0001"), + resource.TestCheckResourceAttrSet("aws_elasticache_cluster.test", "configuration_endpoint"), + resource.TestCheckResourceAttrSet("aws_elasticache_cluster.test", "cluster_address"), ), }, }, @@ -232,10 +242,7 @@ func TestAccAWSElasticacheCluster_SecurityGroup(t *testing.T) { func TestAccAWSElasticacheCluster_snapshotsWithUpdates(t *testing.T) { var ec elasticache.CacheCluster - - ri := acctest.RandInt() - preConfig := fmt.Sprintf(testAccAWSElasticacheClusterConfig_snapshots, ri, ri, acctest.RandString(10)) - postConfig := fmt.Sprintf(testAccAWSElasticacheClusterConfig_snapshotsUpdated, ri, ri, acctest.RandString(10)) + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -243,26 +250,19 @@ func TestAccAWSElasticacheCluster_snapshotsWithUpdates(t *testing.T) { CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ { - Config: preConfig, + Config: testAccAWSElasticacheClusterConfig_snapshots(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheSecurityGroupExists("aws_elasticache_security_group.bar"), - testAccCheckAWSElasticacheClusterExists("aws_elasticache_cluster.bar", &ec), - resource.TestCheckResourceAttr( - "aws_elasticache_cluster.bar", "snapshot_window", "05:00-09:00"), - resource.TestCheckResourceAttr( - "aws_elasticache_cluster.bar", "snapshot_retention_limit", "3"), + testAccCheckAWSElasticacheClusterExists("aws_elasticache_cluster.test", &ec), + resource.TestCheckResourceAttr("aws_elasticache_cluster.test", "snapshot_window", "05:00-09:00"), + resource.TestCheckResourceAttr("aws_elasticache_cluster.test", "snapshot_retention_limit", "3"), ), }, - { - Config: postConfig, + Config: testAccAWSElasticacheClusterConfig_snapshotsUpdated(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheSecurityGroupExists("aws_elasticache_security_group.bar"), - testAccCheckAWSElasticacheClusterExists("aws_elasticache_cluster.bar", &ec), - resource.TestCheckResourceAttr( - "aws_elasticache_cluster.bar", "snapshot_window", "07:00-09:00"), - resource.TestCheckResourceAttr( - "aws_elasticache_cluster.bar", "snapshot_retention_limit", "7"), + testAccCheckAWSElasticacheClusterExists("aws_elasticache_cluster.test", &ec), + resource.TestCheckResourceAttr("aws_elasticache_cluster.test", "snapshot_window", "07:00-09:00"), + resource.TestCheckResourceAttr("aws_elasticache_cluster.test", "snapshot_retention_limit", "7"), ), }, }, @@ -272,7 +272,7 @@ func TestAccAWSElasticacheCluster_snapshotsWithUpdates(t *testing.T) { func TestAccAWSElasticacheCluster_NumCacheNodes_Decrease(t *testing.T) { var ec elasticache.CacheCluster rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_elasticache_cluster.bar" + resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -300,7 +300,7 @@ func TestAccAWSElasticacheCluster_NumCacheNodes_Decrease(t *testing.T) { func TestAccAWSElasticacheCluster_NumCacheNodes_Increase(t *testing.T) { var ec elasticache.CacheCluster rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_elasticache_cluster.bar" + resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -328,7 +328,7 @@ func TestAccAWSElasticacheCluster_NumCacheNodes_Increase(t *testing.T) { func TestAccAWSElasticacheCluster_NumCacheNodes_IncreaseWithPreferredAvailabilityZones(t *testing.T) { var ec elasticache.CacheCluster rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_elasticache_cluster.bar" + resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -366,8 +366,8 @@ func TestAccAWSElasticacheCluster_vpc(t *testing.T) { { Config: testAccAWSElasticacheClusterInVPCConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheSubnetGroupExists("aws_elasticache_subnet_group.bar", &csg), - testAccCheckAWSElasticacheClusterExists("aws_elasticache_cluster.bar", &ec), + testAccCheckAWSElasticacheSubnetGroupExists("aws_elasticache_subnet_group.test", &csg), + testAccCheckAWSElasticacheClusterExists("aws_elasticache_cluster.test", &ec), testAccCheckAWSElasticacheClusterAttributes(&ec), ), }, @@ -386,77 +386,68 @@ func TestAccAWSElasticacheCluster_multiAZInVpc(t *testing.T) { { Config: testAccAWSElasticacheClusterMultiAZInVPCConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheSubnetGroupExists("aws_elasticache_subnet_group.bar", &csg), - testAccCheckAWSElasticacheClusterExists("aws_elasticache_cluster.bar", &ec), - resource.TestCheckResourceAttr( - "aws_elasticache_cluster.bar", "availability_zone", "Multiple"), + testAccCheckAWSElasticacheSubnetGroupExists("aws_elasticache_subnet_group.test", &csg), + testAccCheckAWSElasticacheClusterExists("aws_elasticache_cluster.test", &ec), + resource.TestCheckResourceAttr("aws_elasticache_cluster.test", "availability_zone", "Multiple"), ), }, }, }) } -func TestAccAWSElasticacheCluster_AZMode_Memcached_Ec2Classic(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - +func TestAccAWSElasticacheCluster_AZMode_Memcached(t *testing.T) { var cluster elasticache.CacheCluster rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_elasticache_cluster.bar" + resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSElasticacheClusterConfig_AZMode_Memcached_Ec2Classic(rName, "unknown"), + Config: testAccAWSElasticacheClusterConfig_AZMode_Memcached(rName, "unknown"), ExpectError: regexp.MustCompile(`expected az_mode to be one of .*, got unknown`), }, { - Config: testAccAWSElasticacheClusterConfig_AZMode_Memcached_Ec2Classic(rName, "cross-az"), + Config: testAccAWSElasticacheClusterConfig_AZMode_Memcached(rName, "cross-az"), ExpectError: regexp.MustCompile(`az_mode "cross-az" is not supported with num_cache_nodes = 1`), }, { - Config: testAccAWSElasticacheClusterConfig_AZMode_Memcached_Ec2Classic(rName, "single-az"), + Config: testAccAWSElasticacheClusterConfig_AZMode_Memcached(rName, "single-az"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheClusterExists(resourceName, &cluster), resource.TestCheckResourceAttr(resourceName, "az_mode", "single-az"), ), }, { - Config: testAccAWSElasticacheClusterConfig_AZMode_Memcached_Ec2Classic(rName, "cross-az"), + Config: testAccAWSElasticacheClusterConfig_AZMode_Memcached(rName, "cross-az"), ExpectError: regexp.MustCompile(`az_mode "cross-az" is not supported with num_cache_nodes = 1`), }, }, }) } -func TestAccAWSElasticacheCluster_AZMode_Redis_Ec2Classic(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - +func TestAccAWSElasticacheCluster_AZMode_Redis(t *testing.T) { var cluster elasticache.CacheCluster rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_elasticache_cluster.bar" + resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSElasticacheClusterConfig_AZMode_Redis_Ec2Classic(rName, "unknown"), + Config: testAccAWSElasticacheClusterConfig_AZMode_Redis(rName, "unknown"), ExpectError: regexp.MustCompile(`expected az_mode to be one of .*, got unknown`), }, { - Config: testAccAWSElasticacheClusterConfig_AZMode_Redis_Ec2Classic(rName, "cross-az"), + Config: testAccAWSElasticacheClusterConfig_AZMode_Redis(rName, "cross-az"), ExpectError: regexp.MustCompile(`az_mode "cross-az" is not supported with num_cache_nodes = 1`), }, { - Config: testAccAWSElasticacheClusterConfig_AZMode_Redis_Ec2Classic(rName, "single-az"), + Config: testAccAWSElasticacheClusterConfig_AZMode_Redis(rName, "single-az"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheClusterExists(resourceName, &cluster), resource.TestCheckResourceAttr(resourceName, "az_mode", "single-az"), @@ -466,29 +457,25 @@ func TestAccAWSElasticacheCluster_AZMode_Redis_Ec2Classic(t *testing.T) { }) } -func TestAccAWSElasticacheCluster_EngineVersion_Memcached_Ec2Classic(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - +func TestAccAWSElasticacheCluster_EngineVersion_Memcached(t *testing.T) { var pre, mid, post elasticache.CacheCluster rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_elasticache_cluster.bar" + resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSElasticacheClusterConfig_EngineVersion_Memcached_Ec2Classic(rName, "1.4.33"), + Config: testAccAWSElasticacheClusterConfig_EngineVersion_Memcached(rName, "1.4.33"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheClusterExists(resourceName, &pre), resource.TestCheckResourceAttr(resourceName, "engine_version", "1.4.33"), ), }, { - Config: testAccAWSElasticacheClusterConfig_EngineVersion_Memcached_Ec2Classic(rName, "1.4.24"), + Config: testAccAWSElasticacheClusterConfig_EngineVersion_Memcached(rName, "1.4.24"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheClusterExists(resourceName, &mid), testAccCheckAWSElasticacheClusterRecreated(&pre, &mid), @@ -496,7 +483,7 @@ func TestAccAWSElasticacheCluster_EngineVersion_Memcached_Ec2Classic(t *testing. ), }, { - Config: testAccAWSElasticacheClusterConfig_EngineVersion_Memcached_Ec2Classic(rName, "1.4.34"), + Config: testAccAWSElasticacheClusterConfig_EngineVersion_Memcached(rName, "1.4.34"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheClusterExists(resourceName, &post), testAccCheckAWSElasticacheClusterNotRecreated(&mid, &post), @@ -507,29 +494,25 @@ func TestAccAWSElasticacheCluster_EngineVersion_Memcached_Ec2Classic(t *testing. }) } -func TestAccAWSElasticacheCluster_EngineVersion_Redis_Ec2Classic(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - +func TestAccAWSElasticacheCluster_EngineVersion_Redis(t *testing.T) { var pre, mid, post elasticache.CacheCluster rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_elasticache_cluster.bar" + resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSElasticacheClusterConfig_EngineVersion_Redis_Ec2Classic(rName, "3.2.6"), + Config: testAccAWSElasticacheClusterConfig_EngineVersion_Redis(rName, "3.2.6"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheClusterExists(resourceName, &pre), resource.TestCheckResourceAttr(resourceName, "engine_version", "3.2.6"), ), }, { - Config: testAccAWSElasticacheClusterConfig_EngineVersion_Redis_Ec2Classic(rName, "3.2.4"), + Config: testAccAWSElasticacheClusterConfig_EngineVersion_Redis(rName, "3.2.4"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheClusterExists(resourceName, &mid), testAccCheckAWSElasticacheClusterRecreated(&pre, &mid), @@ -537,7 +520,7 @@ func TestAccAWSElasticacheCluster_EngineVersion_Redis_Ec2Classic(t *testing.T) { ), }, { - Config: testAccAWSElasticacheClusterConfig_EngineVersion_Redis_Ec2Classic(rName, "3.2.10"), + Config: testAccAWSElasticacheClusterConfig_EngineVersion_Redis(rName, "3.2.10"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheClusterExists(resourceName, &post), testAccCheckAWSElasticacheClusterNotRecreated(&mid, &post), @@ -548,29 +531,25 @@ func TestAccAWSElasticacheCluster_EngineVersion_Redis_Ec2Classic(t *testing.T) { }) } -func TestAccAWSElasticacheCluster_NodeTypeResize_Memcached_Ec2Classic(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - +func TestAccAWSElasticacheCluster_NodeTypeResize_Memcached(t *testing.T) { var pre, post elasticache.CacheCluster rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_elasticache_cluster.bar" + resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSElasticacheClusterConfig_NodeType_Memcached_Ec2Classic(rName, "cache.m3.medium"), + Config: testAccAWSElasticacheClusterConfig_NodeType_Memcached(rName, "cache.m3.medium"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheClusterExists(resourceName, &pre), resource.TestCheckResourceAttr(resourceName, "node_type", "cache.m3.medium"), ), }, { - Config: testAccAWSElasticacheClusterConfig_NodeType_Memcached_Ec2Classic(rName, "cache.m3.large"), + Config: testAccAWSElasticacheClusterConfig_NodeType_Memcached(rName, "cache.m3.large"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheClusterExists(resourceName, &post), testAccCheckAWSElasticacheClusterRecreated(&pre, &post), @@ -581,29 +560,25 @@ func TestAccAWSElasticacheCluster_NodeTypeResize_Memcached_Ec2Classic(t *testing }) } -func TestAccAWSElasticacheCluster_NodeTypeResize_Redis_Ec2Classic(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - +func TestAccAWSElasticacheCluster_NodeTypeResize_Redis(t *testing.T) { var pre, post elasticache.CacheCluster rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_elasticache_cluster.bar" + resourceName := "aws_elasticache_cluster.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSElasticacheClusterConfig_NodeType_Redis_Ec2Classic(rName, "cache.m3.medium"), + Config: testAccAWSElasticacheClusterConfig_NodeType_Redis(rName, "cache.m3.medium"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheClusterExists(resourceName, &pre), resource.TestCheckResourceAttr(resourceName, "node_type", "cache.m3.medium"), ), }, { - Config: testAccAWSElasticacheClusterConfig_NodeType_Redis_Ec2Classic(rName, "cache.m3.large"), + Config: testAccAWSElasticacheClusterConfig_NodeType_Redis(rName, "cache.m3.large"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheClusterExists(resourceName, &post), testAccCheckAWSElasticacheClusterNotRecreated(&pre, &post), @@ -614,20 +589,16 @@ func TestAccAWSElasticacheCluster_NodeTypeResize_Redis_Ec2Classic(t *testing.T) }) } -func TestAccAWSElasticacheCluster_NumCacheNodes_Redis_Ec2Classic(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - +func TestAccAWSElasticacheCluster_NumCacheNodes_Redis(t *testing.T) { rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSElasticacheClusterConfig_NumCacheNodes_Redis_Ec2Classic(rName, 2), + Config: testAccAWSElasticacheClusterConfig_NumCacheNodes_Redis(rName, 2), ExpectError: regexp.MustCompile(`engine "redis" does not support num_cache_nodes > 1`), }, }, @@ -635,14 +606,10 @@ func TestAccAWSElasticacheCluster_NumCacheNodes_Redis_Ec2Classic(t *testing.T) { } func TestAccAWSElasticacheCluster_ReplicationGroupID_InvalidAttributes(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ @@ -714,24 +681,20 @@ func TestAccAWSElasticacheCluster_ReplicationGroupID_InvalidAttributes(t *testin }) } -func TestAccAWSElasticacheCluster_ReplicationGroupID_AvailabilityZone_Ec2Classic(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - +func TestAccAWSElasticacheCluster_ReplicationGroupID_AvailabilityZone(t *testing.T) { var cluster elasticache.CacheCluster var replicationGroup elasticache.ReplicationGroup rName := acctest.RandomWithPrefix("tf-acc-test") - clusterResourceName := "aws_elasticache_cluster.replica" + clusterResourceName := "aws_elasticache_cluster.test" replicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSElasticacheClusterConfig_ReplicationGroupID_AvailabilityZone_Ec2Classic(rName), + Config: testAccAWSElasticacheClusterConfig_ReplicationGroupID_AvailabilityZone(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheReplicationGroupExists(replicationGroupResourceName, &replicationGroup), testAccCheckAWSElasticacheClusterExists(clusterResourceName, &cluster), @@ -742,24 +705,20 @@ func TestAccAWSElasticacheCluster_ReplicationGroupID_AvailabilityZone_Ec2Classic }) } -func TestAccAWSElasticacheCluster_ReplicationGroupID_SingleReplica_Ec2Classic(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - +func TestAccAWSElasticacheCluster_ReplicationGroupID_SingleReplica(t *testing.T) { var cluster elasticache.CacheCluster var replicationGroup elasticache.ReplicationGroup rName := acctest.RandomWithPrefix("tf-acc-test") - clusterResourceName := "aws_elasticache_cluster.replica" + clusterResourceName := "aws_elasticache_cluster.test" replicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSElasticacheClusterConfig_ReplicationGroupID_Replica_Ec2Classic(rName, 1), + Config: testAccAWSElasticacheClusterConfig_ReplicationGroupID_Replica(rName, 1), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheReplicationGroupExists(replicationGroupResourceName, &replicationGroup), testAccCheckAWSElasticacheClusterExists(clusterResourceName, &cluster), @@ -773,25 +732,21 @@ func TestAccAWSElasticacheCluster_ReplicationGroupID_SingleReplica_Ec2Classic(t }) } -func TestAccAWSElasticacheCluster_ReplicationGroupID_MultipleReplica_Ec2Classic(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - +func TestAccAWSElasticacheCluster_ReplicationGroupID_MultipleReplica(t *testing.T) { var cluster1, cluster2 elasticache.CacheCluster var replicationGroup elasticache.ReplicationGroup rName := acctest.RandomWithPrefix("tf-acc-test") - clusterResourceName1 := "aws_elasticache_cluster.replica.0" - clusterResourceName2 := "aws_elasticache_cluster.replica.1" + clusterResourceName1 := "aws_elasticache_cluster.test.0" + clusterResourceName2 := "aws_elasticache_cluster.test.1" replicationGroupResourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSElasticacheClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSElasticacheClusterConfig_ReplicationGroupID_Replica_Ec2Classic(rName, 2), + Config: testAccAWSElasticacheClusterConfig_ReplicationGroupID_Replica(rName, 2), Check: resource.ComposeTestCheckFunc( testAccCheckAWSElasticacheReplicationGroupExists(replicationGroupResourceName, &replicationGroup), testAccCheckAWSElasticacheClusterExists(clusterResourceName1, &cluster1), @@ -913,10 +868,10 @@ func testAccCheckAWSElasticacheClusterExists(n string, v *elasticache.CacheClust func testAccAWSElasticacheClusterConfig_Engine_Memcached(rName string) string { return fmt.Sprintf(` -resource "aws_elasticache_cluster" "bar" { +resource "aws_elasticache_cluster" "test" { cluster_id = "%s" engine = "memcached" - node_type = "cache.m1.small" + node_type = "cache.t3.small" num_cache_nodes = 1 } `, rName) @@ -924,10 +879,10 @@ resource "aws_elasticache_cluster" "bar" { func testAccAWSElasticacheClusterConfig_Engine_Redis(rName string) string { return fmt.Sprintf(` -resource "aws_elasticache_cluster" "bar" { +resource "aws_elasticache_cluster" "test" { cluster_id = "%s" engine = "redis" - node_type = "cache.m1.small" + node_type = "cache.t3.small" num_cache_nodes = 1 } `, rName) @@ -939,7 +894,7 @@ resource "aws_elasticache_cluster" "test" { cluster_id = %q engine = %q engine_version = %q - node_type = "cache.m1.small" + node_type = "cache.t3.small" num_cache_nodes = 1 parameter_group_name = %q } @@ -948,10 +903,10 @@ resource "aws_elasticache_cluster" "test" { func testAccAWSElasticacheClusterConfig_Port(rName string, port int) string { return fmt.Sprintf(` -resource "aws_elasticache_cluster" "bar" { +resource "aws_elasticache_cluster" "test" { cluster_id = "%s" engine = "memcached" - node_type = "cache.m1.small" + node_type = "cache.t3.small" num_cache_nodes = 1 port = %d } @@ -959,114 +914,73 @@ resource "aws_elasticache_cluster" "bar" { } var testAccAWSElasticacheClusterConfig_SecurityGroup = fmt.Sprintf(` -provider "aws" { - region = "us-east-1" -} -resource "aws_security_group" "bar" { - name = "tf-test-security-group-%03d" +resource "aws_security_group" "test" { + name = "tf-test-security-group-%03d" description = "tf-test-security-group-descr" ingress { - from_port = -1 - to_port = -1 - protocol = "icmp" + from_port = -1 + to_port = -1 + protocol = "icmp" cidr_blocks = ["0.0.0.0/0"] } - tags = { - Name = "TestAccAWSElasticacheCluster_basic" - } + tags = { + Name = "TestAccAWSElasticacheCluster_basic" + } } -resource "aws_elasticache_security_group" "bar" { - name = "tf-test-security-group-%03d" - description = "tf-test-security-group-descr" - security_group_names = ["${aws_security_group.bar.name}"] +resource "aws_elasticache_security_group" "test" { + name = "tf-test-security-group-%03d" + description = "tf-test-security-group-descr" + security_group_names = ["${aws_security_group.test.name}"] } -resource "aws_elasticache_cluster" "bar" { - cluster_id = "tf-%s" - engine = "memcached" - node_type = "cache.m1.small" - num_cache_nodes = 1 - port = 11211 - security_group_names = ["${aws_elasticache_security_group.bar.name}"] +resource "aws_elasticache_cluster" "test" { + cluster_id = "tf-%s" + engine = "memcached" + node_type = "cache.m3.medium" + num_cache_nodes = 1 + port = 11211 + security_group_names = ["${aws_elasticache_security_group.test.name}"] } `, acctest.RandInt(), acctest.RandInt(), acctest.RandString(10)) -var testAccAWSElasticacheClusterConfig_snapshots = ` -provider "aws" { - region = "us-east-1" -} -resource "aws_security_group" "bar" { - name = "tf-test-security-group-%03d" - description = "tf-test-security-group-descr" - ingress { - from_port = -1 - to_port = -1 - protocol = "icmp" - cidr_blocks = ["0.0.0.0/0"] - } -} - -resource "aws_elasticache_security_group" "bar" { - name = "tf-test-security-group-%03d" - description = "tf-test-security-group-descr" - security_group_names = ["${aws_security_group.bar.name}"] -} - -resource "aws_elasticache_cluster" "bar" { - cluster_id = "tf-%s" - engine = "redis" - node_type = "cache.m1.small" - num_cache_nodes = 1 - port = 6379 - security_group_names = ["${aws_elasticache_security_group.bar.name}"] - snapshot_window = "05:00-09:00" +func testAccAWSElasticacheClusterConfig_snapshots(rName string) string { + return fmt.Sprintf(` +resource "aws_elasticache_cluster" "test" { + cluster_id = "tf-%s" + engine = "redis" + node_type = "cache.t3.small" + num_cache_nodes = 1 + port = 6379 + snapshot_window = "05:00-09:00" snapshot_retention_limit = 3 } -` - -var testAccAWSElasticacheClusterConfig_snapshotsUpdated = ` -provider "aws" { - region = "us-east-1" -} -resource "aws_security_group" "bar" { - name = "tf-test-security-group-%03d" - description = "tf-test-security-group-descr" - ingress { - from_port = -1 - to_port = -1 - protocol = "icmp" - cidr_blocks = ["0.0.0.0/0"] - } -} - -resource "aws_elasticache_security_group" "bar" { - name = "tf-test-security-group-%03d" - description = "tf-test-security-group-descr" - security_group_names = ["${aws_security_group.bar.name}"] +`, rName) } -resource "aws_elasticache_cluster" "bar" { - cluster_id = "tf-%s" - engine = "redis" - node_type = "cache.m1.small" - num_cache_nodes = 1 - port = 6379 - security_group_names = ["${aws_elasticache_security_group.bar.name}"] - snapshot_window = "07:00-09:00" +func testAccAWSElasticacheClusterConfig_snapshotsUpdated(rName string) string { + return fmt.Sprintf(` +resource "aws_elasticache_cluster" "test" { + cluster_id = "tf-%s" + engine = "redis" + node_type = "cache.t3.small" + num_cache_nodes = 1 + port = 6379 + snapshot_window = "07:00-09:00" snapshot_retention_limit = 7 - apply_immediately = true + apply_immediately = true +} +`, rName) } -` func testAccAWSElasticacheClusterConfig_NumCacheNodes(rName string, numCacheNodes int) string { return fmt.Sprintf(` -resource "aws_elasticache_cluster" "bar" { +resource "aws_elasticache_cluster" "test" { apply_immediately = true cluster_id = "%s" engine = "memcached" - node_type = "cache.m1.small" + node_type = "cache.t3.small" num_cache_nodes = %d } `, rName, numCacheNodes) @@ -1081,11 +995,11 @@ func testAccAWSElasticacheClusterConfig_NumCacheNodesWithPreferredAvailabilityZo return fmt.Sprintf(` data "aws_availability_zones" "available" {} -resource "aws_elasticache_cluster" "bar" { +resource "aws_elasticache_cluster" "test" { apply_immediately = true cluster_id = "%s" engine = "memcached" - node_type = "cache.m1.small" + node_type = "cache.t3.small" num_cache_nodes = %d preferred_availability_zones = [%s] } @@ -1094,112 +1008,108 @@ resource "aws_elasticache_cluster" "bar" { var testAccAWSElasticacheClusterInVPCConfig = fmt.Sprintf(` data "aws_availability_zones" "available" { - # InsufficientCacheClusterCapacity: cache.m1.small (VPC) is not currently supported in the availability zone us-east-1b - blacklisted_zone_ids = ["use1-az1"] - state = "available" + state = "available" } -resource "aws_vpc" "foo" { +resource "aws_vpc" "test" { cidr_block = "192.168.0.0/16" - tags = { + tags = { Name = "terraform-testacc-elasticache-cluster-in-vpc" } } -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" - cidr_block = "192.168.0.0/20" +resource "aws_subnet" "test" { + vpc_id = "${aws_vpc.test.id}" + cidr_block = "192.168.0.0/20" availability_zone = "${data.aws_availability_zones.available.names[0]}" - tags = { + tags = { Name = "tf-acc-elasticache-cluster-in-vpc" } } -resource "aws_elasticache_subnet_group" "bar" { - name = "tf-test-cache-subnet-%03d" +resource "aws_elasticache_subnet_group" "test" { + name = "tf-test-cache-subnet-%03d" description = "tf-test-cache-subnet-group-descr" - subnet_ids = ["${aws_subnet.foo.id}"] + subnet_ids = ["${aws_subnet.test.id}"] } -resource "aws_security_group" "bar" { - name = "tf-test-security-group-%03d" +resource "aws_security_group" "test" { + name = "tf-test-security-group-%03d" description = "tf-test-security-group-descr" - vpc_id = "${aws_vpc.foo.id}" + vpc_id = "${aws_vpc.test.id}" ingress { - from_port = -1 - to_port = -1 - protocol = "icmp" + from_port = -1 + to_port = -1 + protocol = "icmp" cidr_blocks = ["0.0.0.0/0"] } } -resource "aws_elasticache_cluster" "bar" { +resource "aws_elasticache_cluster" "test" { // Including uppercase letters in this name to ensure // that we correctly handle the fact that the API // normalizes names to lowercase. - cluster_id = "tf-%s" - node_type = "cache.m1.small" - num_cache_nodes = 1 - engine = "redis" - engine_version = "2.8.19" - port = 6379 - subnet_group_name = "${aws_elasticache_subnet_group.bar.name}" - security_group_ids = ["${aws_security_group.bar.id}"] - parameter_group_name = "default.redis2.8" - notification_topic_arn = "${aws_sns_topic.topic_example.arn}" - availability_zone = "${data.aws_availability_zones.available.names[0]}" -} - -resource "aws_sns_topic" "topic_example" { - name = "tf-ecache-cluster-test" + cluster_id = "tf-%s" + node_type = "cache.t3.small" + num_cache_nodes = 1 + engine = "redis" + engine_version = "2.8.19" + port = 6379 + subnet_group_name = "${aws_elasticache_subnet_group.test.name}" + security_group_ids = ["${aws_security_group.test.id}"] + parameter_group_name = "default.redis2.8" + notification_topic_arn = "${aws_sns_topic.test.arn}" + availability_zone = "${data.aws_availability_zones.available.names[0]}" +} + +resource "aws_sns_topic" "test" { + name = "tf-ecache-cluster-test" } `, acctest.RandInt(), acctest.RandInt(), acctest.RandString(10)) var testAccAWSElasticacheClusterMultiAZInVPCConfig = fmt.Sprintf(` data "aws_availability_zones" "available" { - # InsufficientCacheClusterCapacity: cache.m1.small (VPC) is not currently supported in the availability zone us-east-1b - blacklisted_zone_ids = ["use1-az1"] - state = "available" + state = "available" } -resource "aws_vpc" "foo" { +resource "aws_vpc" "test" { cidr_block = "192.168.0.0/16" - tags = { + tags = { Name = "terraform-testacc-elasticache-cluster-multi-az-in-vpc" } } -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" - cidr_block = "192.168.0.0/20" +resource "aws_subnet" "test1" { + vpc_id = "${aws_vpc.test.id}" + cidr_block = "192.168.0.0/20" availability_zone = "${data.aws_availability_zones.available.names[0]}" - tags = { + tags = { Name = "tf-acc-elasticache-cluster-multi-az-in-vpc-foo" } } -resource "aws_subnet" "bar" { - vpc_id = "${aws_vpc.foo.id}" - cidr_block = "192.168.16.0/20" +resource "aws_subnet" "test2" { + vpc_id = "${aws_vpc.test.id}" + cidr_block = "192.168.16.0/20" availability_zone = "${data.aws_availability_zones.available.names[1]}" - tags = { + tags = { Name = "tf-acc-elasticache-cluster-multi-az-in-vpc-bar" } } -resource "aws_elasticache_subnet_group" "bar" { - name = "tf-test-cache-subnet-%03d" +resource "aws_elasticache_subnet_group" "test" { + name = "tf-test-cache-subnet-%03d" description = "tf-test-cache-subnet-group-descr" subnet_ids = [ - "${aws_subnet.foo.id}", - "${aws_subnet.bar.id}" + "${aws_subnet.test1.id}", + "${aws_subnet.test2.id}" ] } -resource "aws_security_group" "bar" { - name = "tf-test-security-group-%03d" +resource "aws_security_group" "test" { + name = "tf-test-security-group-%03d" description = "tf-test-security-group-descr" - vpc_id = "${aws_vpc.foo.id}" + vpc_id = "${aws_vpc.test.id}" ingress { from_port = -1 to_port = -1 @@ -1208,15 +1118,15 @@ resource "aws_security_group" "bar" { } } -resource "aws_elasticache_cluster" "bar" { - cluster_id = "tf-%s" - engine = "memcached" - node_type = "cache.m1.small" - num_cache_nodes = 2 - port = 11211 - subnet_group_name = "${aws_elasticache_subnet_group.bar.name}" - security_group_ids = ["${aws_security_group.bar.id}"] - az_mode = "cross-az" +resource "aws_elasticache_cluster" "test" { + cluster_id = "tf-%s" + engine = "memcached" + node_type = "cache.t3.small" + num_cache_nodes = 2 + port = 11211 + subnet_group_name = "${aws_elasticache_subnet_group.test.name}" + security_group_ids = ["${aws_security_group.test.id}"] + az_mode = "cross-az" preferred_availability_zones = [ "${data.aws_availability_zones.available.names[0]}", "${data.aws_availability_zones.available.names[1]}" @@ -1224,152 +1134,176 @@ resource "aws_elasticache_cluster" "bar" { } `, acctest.RandInt(), acctest.RandInt(), acctest.RandString(10)) -func testAccAWSElasticacheClusterConfig_AZMode_Memcached_Ec2Classic(rName, azMode string) string { +var testAccAWSElasticacheClusterConfig_RedisDefaultPort = ` +resource "aws_security_group" "test" { + name = "tf-test-security-group" + description = "tf-test-security-group-descr" +} + +resource "aws_security_group_rule" "test" { + cidr_blocks = ["0.0.0.0/0"] + from_port = aws_elasticache_cluster.test.port + protocol = "tcp" + security_group_id = aws_security_group.test.id + to_port = aws_elasticache_cluster.test.port + type = "ingress" +} + +resource "aws_elasticache_cluster" "test" { + cluster_id = "foo-cluster" + engine = "redis" + engine_version = "5.0.4" + node_type = "cache.t2.micro" + num_cache_nodes = 1 + parameter_group_name = "default.redis5.0" +} +` + +func testAccAWSElasticacheClusterConfig_AZMode_Memcached(rName, azMode string) string { return fmt.Sprintf(` -resource "aws_elasticache_cluster" "bar" { - apply_immediately = true - az_mode = "%[2]s" - cluster_id = "%[1]s" - engine = "memcached" - node_type = "cache.m3.medium" - num_cache_nodes = 1 - port = 11211 +resource "aws_elasticache_cluster" "test" { + apply_immediately = true + az_mode = "%[2]s" + cluster_id = "%[1]s" + engine = "memcached" + node_type = "cache.m3.medium" + num_cache_nodes = 1 + port = 11211 } `, rName, azMode) } -func testAccAWSElasticacheClusterConfig_AZMode_Redis_Ec2Classic(rName, azMode string) string { +func testAccAWSElasticacheClusterConfig_AZMode_Redis(rName, azMode string) string { return fmt.Sprintf(` -resource "aws_elasticache_cluster" "bar" { - apply_immediately = true - az_mode = "%[2]s" - cluster_id = "%[1]s" - engine = "redis" - node_type = "cache.m3.medium" - num_cache_nodes = 1 - port = 6379 +resource "aws_elasticache_cluster" "test" { + apply_immediately = true + az_mode = "%[2]s" + cluster_id = "%[1]s" + engine = "redis" + node_type = "cache.m3.medium" + num_cache_nodes = 1 + port = 6379 } `, rName, azMode) } -func testAccAWSElasticacheClusterConfig_EngineVersion_Memcached_Ec2Classic(rName, engineVersion string) string { +func testAccAWSElasticacheClusterConfig_EngineVersion_Memcached(rName, engineVersion string) string { return fmt.Sprintf(` -resource "aws_elasticache_cluster" "bar" { - apply_immediately = true - cluster_id = "%[1]s" - engine = "memcached" - engine_version = "%[2]s" - node_type = "cache.m3.medium" - num_cache_nodes = 1 - port = 11211 +resource "aws_elasticache_cluster" "test" { + apply_immediately = true + cluster_id = "%[1]s" + engine = "memcached" + engine_version = "%[2]s" + node_type = "cache.m3.medium" + num_cache_nodes = 1 + port = 11211 } `, rName, engineVersion) } -func testAccAWSElasticacheClusterConfig_EngineVersion_Redis_Ec2Classic(rName, engineVersion string) string { +func testAccAWSElasticacheClusterConfig_EngineVersion_Redis(rName, engineVersion string) string { return fmt.Sprintf(` -resource "aws_elasticache_cluster" "bar" { - apply_immediately = true - cluster_id = "%[1]s" - engine = "redis" - engine_version = "%[2]s" - node_type = "cache.m3.medium" - num_cache_nodes = 1 - port = 6379 +resource "aws_elasticache_cluster" "test" { + apply_immediately = true + cluster_id = "%[1]s" + engine = "redis" + engine_version = "%[2]s" + node_type = "cache.m3.medium" + num_cache_nodes = 1 + port = 6379 } `, rName, engineVersion) } -func testAccAWSElasticacheClusterConfig_NodeType_Memcached_Ec2Classic(rName, nodeType string) string { +func testAccAWSElasticacheClusterConfig_NodeType_Memcached(rName, nodeType string) string { return fmt.Sprintf(` -resource "aws_elasticache_cluster" "bar" { - apply_immediately = true - cluster_id = "%[1]s" - engine = "memcached" - node_type = "%[2]s" - num_cache_nodes = 1 - port = 11211 +resource "aws_elasticache_cluster" "test" { + apply_immediately = true + cluster_id = "%[1]s" + engine = "memcached" + node_type = "%[2]s" + num_cache_nodes = 1 + port = 11211 } `, rName, nodeType) } -func testAccAWSElasticacheClusterConfig_NodeType_Redis_Ec2Classic(rName, nodeType string) string { +func testAccAWSElasticacheClusterConfig_NodeType_Redis(rName, nodeType string) string { return fmt.Sprintf(` -resource "aws_elasticache_cluster" "bar" { - apply_immediately = true - cluster_id = "%[1]s" - engine = "redis" - node_type = "%[2]s" - num_cache_nodes = 1 - port = 6379 +resource "aws_elasticache_cluster" "test" { + apply_immediately = true + cluster_id = "%[1]s" + engine = "redis" + node_type = "%[2]s" + num_cache_nodes = 1 + port = 6379 } `, rName, nodeType) } -func testAccAWSElasticacheClusterConfig_NumCacheNodes_Redis_Ec2Classic(rName string, numCacheNodes int) string { +func testAccAWSElasticacheClusterConfig_NumCacheNodes_Redis(rName string, numCacheNodes int) string { return fmt.Sprintf(` -resource "aws_elasticache_cluster" "bar" { - apply_immediately = true - cluster_id = "%[1]s" - engine = "redis" - node_type = "cache.m3.medium" - num_cache_nodes = %[2]d - port = 6379 +resource "aws_elasticache_cluster" "test" { + apply_immediately = true + cluster_id = "%[1]s" + engine = "redis" + node_type = "cache.m3.medium" + num_cache_nodes = %[2]d + port = 6379 } `, rName, numCacheNodes) } func testAccAWSElasticacheClusterConfig_ReplicationGroupID_InvalidAttribute(rName, attrName, attrValue string) string { return fmt.Sprintf(` -resource "aws_elasticache_cluster" "replica" { - cluster_id = "%[1]s" - replication_group_id = "non-existent-id" - %[2]s = "%[3]s" +resource "aws_elasticache_cluster" "test" { + cluster_id = "%[1]s" + replication_group_id = "non-existent-id" + %[2]s = "%[3]s" } `, rName, attrName, attrValue) } -func testAccAWSElasticacheClusterConfig_ReplicationGroupID_AvailabilityZone_Ec2Classic(rName string) string { +func testAccAWSElasticacheClusterConfig_ReplicationGroupID_AvailabilityZone(rName string) string { return fmt.Sprintf(` data "aws_availability_zones" "available" {} resource "aws_elasticache_replication_group" "test" { - replication_group_description = "Terraform Acceptance Testing" - replication_group_id = "%[1]s" - node_type = "cache.m3.medium" - number_cache_clusters = 1 - port = 6379 - - lifecycle { - ignore_changes = ["number_cache_clusters"] - } + replication_group_description = "Terraform Acceptance Testing" + replication_group_id = "%[1]s" + node_type = "cache.m3.medium" + number_cache_clusters = 1 + port = 6379 + + lifecycle { + ignore_changes = ["number_cache_clusters"] + } } -resource "aws_elasticache_cluster" "replica" { - availability_zone = "${data.aws_availability_zones.available.names[0]}" - cluster_id = "%[1]s1" - replication_group_id = "${aws_elasticache_replication_group.test.id}" +resource "aws_elasticache_cluster" "test" { + availability_zone = "${data.aws_availability_zones.available.names[0]}" + cluster_id = "%[1]s1" + replication_group_id = "${aws_elasticache_replication_group.test.id}" } `, rName) } -func testAccAWSElasticacheClusterConfig_ReplicationGroupID_Replica_Ec2Classic(rName string, count int) string { +func testAccAWSElasticacheClusterConfig_ReplicationGroupID_Replica(rName string, count int) string { return fmt.Sprintf(` resource "aws_elasticache_replication_group" "test" { - replication_group_description = "Terraform Acceptance Testing" - replication_group_id = "%[1]s" - node_type = "cache.m3.medium" - number_cache_clusters = 1 - port = 6379 - - lifecycle { - ignore_changes = ["number_cache_clusters"] - } + replication_group_description = "Terraform Acceptance Testing" + replication_group_id = "%[1]s" + node_type = "cache.m3.medium" + number_cache_clusters = 1 + port = 6379 + + lifecycle { + ignore_changes = ["number_cache_clusters"] + } } -resource "aws_elasticache_cluster" "replica" { - count = %[2]d - +resource "aws_elasticache_cluster" "test" { + count = %[2]d cluster_id = "%[1]s${count.index}" replication_group_id = "${aws_elasticache_replication_group.test.id}" } diff --git a/aws/resource_aws_elasticache_replication_group.go b/aws/resource_aws_elasticache_replication_group.go index 9a64dfdaecc..d0b95faae5a 100644 --- a/aws/resource_aws_elasticache_replication_group.go +++ b/aws/resource_aws_elasticache_replication_group.go @@ -9,11 +9,11 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elasticache" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsElasticacheReplicationGroup() *schema.Resource { @@ -165,8 +165,8 @@ func resourceAwsElasticacheReplicationGroup() *schema.Resource { validation.StringLenBetween(1, 40), validation.StringMatch(regexp.MustCompile(`^[0-9a-zA-Z-]+$`), "must contain only alphanumeric characters and hyphens"), validation.StringMatch(regexp.MustCompile(`^[a-zA-Z]`), "must begin with a letter"), - validateStringNotMatch(regexp.MustCompile(`--`), "cannot contain two consecutive hyphens"), - validateStringNotMatch(regexp.MustCompile(`-$`), "cannot end with a hyphen"), + validation.StringDoesNotMatch(regexp.MustCompile(`--`), "cannot contain two consecutive hyphens"), + validation.StringDoesNotMatch(regexp.MustCompile(`-$`), "cannot end with a hyphen"), ), StateFunc: func(val interface{}) string { return strings.ToLower(val.(string)) @@ -229,6 +229,11 @@ func resourceAwsElasticacheReplicationGroup() *schema.Resource { Default: false, ForceNew: true, }, + "kms_key_id": { + Type: schema.TypeString, + ForceNew: true, + Optional: true, + }, }, SchemaVersion: 1, @@ -250,7 +255,7 @@ func resourceAwsElasticacheReplicationGroup() *schema.Resource { func resourceAwsElasticacheReplicationGroupCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).elasticacheconn - tags := tagsFromMapEC(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().ElasticacheTags() params := &elasticache.CreateReplicationGroupInput{ ReplicationGroupId: aws.String(d.Get("replication_group_id").(string)), ReplicationGroupDescription: aws.String(d.Get("replication_group_description").(string)), @@ -306,6 +311,10 @@ func resourceAwsElasticacheReplicationGroupCreate(d *schema.ResourceData, meta i params.NotificationTopicArn = aws.String(v.(string)) } + if v, ok := d.GetOk("kms_key_id"); ok { + params.KmsKeyId = aws.String(v.(string)) + } + if v, ok := d.GetOk("snapshot_retention_limit"); ok { params.SnapshotRetentionLimit = aws.Int64(int64(v.(int))) } @@ -427,6 +436,8 @@ func resourceAwsElasticacheReplicationGroupRead(d *schema.ResourceData, meta int } } + d.Set("kms_key_id", rgp.KmsKeyId) + d.Set("replication_group_description", rgp.Description) d.Set("number_cache_clusters", len(rgp.MemberClusters)) if err := d.Set("member_clusters", flattenStringList(rgp.MemberClusters)); err != nil { diff --git a/aws/resource_aws_elasticache_replication_group_test.go b/aws/resource_aws_elasticache_replication_group_test.go index 68f1c023812..4e6f978991b 100644 --- a/aws/resource_aws_elasticache_replication_group_test.go +++ b/aws/resource_aws_elasticache_replication_group_test.go @@ -3,7 +3,6 @@ package aws import ( "fmt" "log" - "os" "regexp" "strings" "testing" @@ -58,37 +57,10 @@ func testSweepElasticacheReplicationGroups(region string) error { return nil } -func TestAccAWSElasticacheReplicationGroup_importBasic(t *testing.T) { - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - - rName := acctest.RandomWithPrefix("tf-acc-test") - - resourceName := "aws_elasticache_replication_group.bar" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSElasticacheReplicationGroupConfig(rName), - }, - - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"apply_immediately"}, //not in the API - }, - }, - }) -} - func TestAccAWSElasticacheReplicationGroup_basic(t *testing.T) { var rg elasticache.ReplicationGroup rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -98,17 +70,23 @@ func TestAccAWSElasticacheReplicationGroup_basic(t *testing.T) { { Config: testAccAWSElasticacheReplicationGroupConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "cluster_mode.#", "0"), + resourceName, "cluster_mode.#", "0"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "number_cache_clusters", "2"), + resourceName, "number_cache_clusters", "2"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "member_clusters.#", "2"), + resourceName, "member_clusters.#", "2"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "auto_minor_version_upgrade", "false"), + resourceName, "auto_minor_version_upgrade", "false"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately"}, //not in the API + }, }, }) } @@ -116,6 +94,8 @@ func TestAccAWSElasticacheReplicationGroup_basic(t *testing.T) { func TestAccAWSElasticacheReplicationGroup_Uppercase(t *testing.T) { var rg elasticache.ReplicationGroup rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_elasticache_replication_group.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -124,11 +104,17 @@ func TestAccAWSElasticacheReplicationGroup_Uppercase(t *testing.T) { { Config: testAccAWSElasticacheReplicationGroupConfig_Uppercase(strings.ToUpper(rName)), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "replication_group_id", rName), + resourceName, "replication_group_id", rName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately"}, + }, }, }) } @@ -136,6 +122,8 @@ func TestAccAWSElasticacheReplicationGroup_Uppercase(t *testing.T) { func TestAccAWSElasticacheReplicationGroup_updateDescription(t *testing.T) { var rg elasticache.ReplicationGroup rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_elasticache_replication_group.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -144,26 +132,31 @@ func TestAccAWSElasticacheReplicationGroup_updateDescription(t *testing.T) { { Config: testAccAWSElasticacheReplicationGroupConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "number_cache_clusters", "2"), + resourceName, "number_cache_clusters", "2"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "replication_group_description", "test description"), + resourceName, "replication_group_description", "test description"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "auto_minor_version_upgrade", "false"), + resourceName, "auto_minor_version_upgrade", "false"), ), }, - + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately"}, + }, { Config: testAccAWSElasticacheReplicationGroupConfigUpdatedDescription(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "number_cache_clusters", "2"), + resourceName, "number_cache_clusters", "2"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "replication_group_description", "updated description"), + resourceName, "replication_group_description", "updated description"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "auto_minor_version_upgrade", "true"), + resourceName, "auto_minor_version_upgrade", "true"), ), }, }, @@ -173,6 +166,8 @@ func TestAccAWSElasticacheReplicationGroup_updateDescription(t *testing.T) { func TestAccAWSElasticacheReplicationGroup_updateMaintenanceWindow(t *testing.T) { var rg elasticache.ReplicationGroup rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_elasticache_replication_group.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -181,17 +176,23 @@ func TestAccAWSElasticacheReplicationGroup_updateMaintenanceWindow(t *testing.T) { Config: testAccAWSElasticacheReplicationGroupConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "maintenance_window", "tue:06:30-tue:07:30"), + resourceName, "maintenance_window", "tue:06:30-tue:07:30"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately"}, + }, { Config: testAccAWSElasticacheReplicationGroupConfigUpdatedMaintenanceWindow(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "maintenance_window", "wed:03:00-wed:06:00"), + resourceName, "maintenance_window", "wed:03:00-wed:06:00"), ), }, }, @@ -201,6 +202,8 @@ func TestAccAWSElasticacheReplicationGroup_updateMaintenanceWindow(t *testing.T) func TestAccAWSElasticacheReplicationGroup_updateNodeSize(t *testing.T) { var rg elasticache.ReplicationGroup rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_elasticache_replication_group.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -209,22 +212,27 @@ func TestAccAWSElasticacheReplicationGroup_updateNodeSize(t *testing.T) { { Config: testAccAWSElasticacheReplicationGroupConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "number_cache_clusters", "2"), + resourceName, "number_cache_clusters", "2"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "node_type", "cache.m1.small"), + resourceName, "node_type", "cache.t3.small"), ), }, - + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately"}, + }, { Config: testAccAWSElasticacheReplicationGroupConfigUpdatedNodeSize(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "number_cache_clusters", "2"), + resourceName, "number_cache_clusters", "2"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "node_type", "cache.m1.medium"), + resourceName, "node_type", "cache.t3.medium"), ), }, }, @@ -251,7 +259,12 @@ func TestAccAWSElasticacheReplicationGroup_updateParameterGroup(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, "parameter_group_name", parameterGroupResourceName1, "name"), ), }, - + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately"}, + }, { Config: testAccAWSElasticacheReplicationGroupConfigParameterGroupName(rName, 1), Check: resource.ComposeTestCheckFunc( @@ -265,6 +278,8 @@ func TestAccAWSElasticacheReplicationGroup_updateParameterGroup(t *testing.T) { func TestAccAWSElasticacheReplicationGroup_vpc(t *testing.T) { var rg elasticache.ReplicationGroup + resourceName := "aws_elasticache_replication_group.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -273,19 +288,27 @@ func TestAccAWSElasticacheReplicationGroup_vpc(t *testing.T) { { Config: testAccAWSElasticacheReplicationGroupInVPCConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "number_cache_clusters", "1"), + resourceName, "number_cache_clusters", "1"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "auto_minor_version_upgrade", "false"), + resourceName, "auto_minor_version_upgrade", "false"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately", "availability_zones"}, + }, }, }) } func TestAccAWSElasticacheReplicationGroup_multiAzInVpc(t *testing.T) { var rg elasticache.ReplicationGroup + resourceName := "aws_elasticache_replication_group.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -294,25 +317,33 @@ func TestAccAWSElasticacheReplicationGroup_multiAzInVpc(t *testing.T) { { Config: testAccAWSElasticacheReplicationGroupMultiAZInVPCConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "number_cache_clusters", "2"), + resourceName, "number_cache_clusters", "2"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "automatic_failover_enabled", "true"), + resourceName, "automatic_failover_enabled", "true"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "snapshot_window", "02:00-03:00"), + resourceName, "snapshot_window", "02:00-03:00"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "snapshot_retention_limit", "7"), + resourceName, "snapshot_retention_limit", "7"), resource.TestCheckResourceAttrSet( - "aws_elasticache_replication_group.bar", "primary_endpoint_address"), + resourceName, "primary_endpoint_address"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately", "availability_zones"}, + }, }, }) } func TestAccAWSElasticacheReplicationGroup_redisClusterInVpc2(t *testing.T) { var rg elasticache.ReplicationGroup + resourceName := "aws_elasticache_replication_group.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -321,19 +352,25 @@ func TestAccAWSElasticacheReplicationGroup_redisClusterInVpc2(t *testing.T) { { Config: testAccAWSElasticacheReplicationGroupRedisClusterInVPCConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "number_cache_clusters", "2"), + resourceName, "number_cache_clusters", "2"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "automatic_failover_enabled", "false"), + resourceName, "automatic_failover_enabled", "false"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "snapshot_window", "02:00-03:00"), + resourceName, "snapshot_window", "02:00-03:00"), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "snapshot_retention_limit", "7"), + resourceName, "snapshot_retention_limit", "7"), resource.TestCheckResourceAttrSet( - "aws_elasticache_replication_group.bar", "primary_endpoint_address"), + resourceName, "primary_endpoint_address"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately", "availability_zones"}, + }, }, }) } @@ -341,7 +378,7 @@ func TestAccAWSElasticacheReplicationGroup_redisClusterInVpc2(t *testing.T) { func TestAccAWSElasticacheReplicationGroup_ClusterMode_Basic(t *testing.T) { var rg elasticache.ReplicationGroup rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_elasticache_replication_group.bar" + resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -360,6 +397,12 @@ func TestAccAWSElasticacheReplicationGroup_ClusterMode_Basic(t *testing.T) { resource.TestCheckResourceAttrSet(resourceName, "configuration_endpoint_address"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately"}, + }, }, }) } @@ -367,7 +410,7 @@ func TestAccAWSElasticacheReplicationGroup_ClusterMode_Basic(t *testing.T) { func TestAccAWSElasticacheReplicationGroup_ClusterMode_NumNodeGroups(t *testing.T) { var rg elasticache.ReplicationGroup rName := acctest.RandomWithPrefix("tf-acc-test") - resourceName := "aws_elasticache_replication_group.bar" + resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -384,6 +427,12 @@ func TestAccAWSElasticacheReplicationGroup_ClusterMode_NumNodeGroups(t *testing. resource.TestCheckResourceAttr(resourceName, "cluster_mode.0.replicas_per_node_group", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately"}, + }, { Config: testAccAWSElasticacheReplicationGroupNativeRedisClusterConfig(rName, 1, 1), Check: resource.ComposeTestCheckFunc( @@ -428,6 +477,7 @@ func TestAccAWSElasticacheReplicationGroup_clusteringAndCacheNodesCausesError(t func TestAccAWSElasticacheReplicationGroup_enableSnapshotting(t *testing.T) { var rg elasticache.ReplicationGroup rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_elasticache_replication_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -437,18 +487,23 @@ func TestAccAWSElasticacheReplicationGroup_enableSnapshotting(t *testing.T) { { Config: testAccAWSElasticacheReplicationGroupConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "snapshot_retention_limit", "0"), + resourceName, "snapshot_retention_limit", "0"), ), }, - + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately"}, + }, { Config: testAccAWSElasticacheReplicationGroupConfigEnableSnapshotting(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "snapshot_retention_limit", "2"), + resourceName, "snapshot_retention_limit", "2"), ), }, }, @@ -457,6 +512,8 @@ func TestAccAWSElasticacheReplicationGroup_enableSnapshotting(t *testing.T) { func TestAccAWSElasticacheReplicationGroup_enableAuthTokenTransitEncryption(t *testing.T) { var rg elasticache.ReplicationGroup + resourceName := "aws_elasticache_replication_group.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -465,17 +522,25 @@ func TestAccAWSElasticacheReplicationGroup_enableAuthTokenTransitEncryption(t *t { Config: testAccAWSElasticacheReplicationGroup_EnableAuthTokenTransitEncryptionConfig(acctest.RandInt(), acctest.RandString(10), acctest.RandString(16)), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "transit_encryption_enabled", "true"), + resourceName, "transit_encryption_enabled", "true"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately", "auth_token", "availability_zones"}, + }, }, }) } func TestAccAWSElasticacheReplicationGroup_enableAtRestEncryption(t *testing.T) { var rg elasticache.ReplicationGroup + resourceName := "aws_elasticache_replication_group.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -484,9 +549,33 @@ func TestAccAWSElasticacheReplicationGroup_enableAtRestEncryption(t *testing.T) { Config: testAccAWSElasticacheReplicationGroup_EnableAtRestEncryptionConfig(acctest.RandInt(), acctest.RandString(10)), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + testAccCheckAWSElasticacheReplicationGroupExists(resourceName, &rg), resource.TestCheckResourceAttr( - "aws_elasticache_replication_group.bar", "at_rest_encryption_enabled", "true"), + resourceName, "at_rest_encryption_enabled", "true"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately", "availability_zones"}, + }, + }, + }) +} + +func TestAccAWSElasticacheReplicationGroup_useCmkKmsKeyId(t *testing.T) { + var rg elasticache.ReplicationGroup + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSElasticacheReplicationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSElasticacheReplicationGroup_UseCmkKmsKeyId(acctest.RandInt(), acctest.RandString(10)), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSElasticacheReplicationGroupExists("aws_elasticache_replication_group.bar", &rg), + resource.TestCheckResourceAttrSet("aws_elasticache_replication_group.bar", "kms_key_id"), ), }, }, @@ -511,6 +600,12 @@ func TestAccAWSElasticacheReplicationGroup_NumberCacheClusters(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "2"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately"}, + }, { Config: testAccAWSElasticacheReplicationGroupConfig_NumberCacheClusters(rName, 4, false), Check: resource.ComposeTestCheckFunc( @@ -549,6 +644,12 @@ func TestAccAWSElasticacheReplicationGroup_NumberCacheClusters_Failover_AutoFail resource.TestCheckResourceAttr(resourceName, "number_cache_clusters", "3"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"apply_immediately"}, + }, { PreConfig: func() { // Simulate failover so primary is on node we are trying to delete @@ -732,35 +833,12 @@ func testAccCheckAWSElasticacheReplicationDestroy(s *terraform.State) error { func testAccAWSElasticacheReplicationGroupConfig(rName string) string { return fmt.Sprintf(` -provider "aws" { - region = "us-east-1" -} - -resource "aws_security_group" "bar" { - name = %[1]q - description = "tf-test-security-group-descr" - - ingress { - from_port = -1 - to_port = -1 - protocol = "icmp" - cidr_blocks = ["0.0.0.0/0"] - } -} - -resource "aws_elasticache_security_group" "bar" { - name = %[1]q - description = "tf-test-security-group-descr" - security_group_names = ["${aws_security_group.bar.name}"] -} - -resource "aws_elasticache_replication_group" "bar" { +resource "aws_elasticache_replication_group" "test" { replication_group_id = %[1]q replication_group_description = "test description" - node_type = "cache.m1.small" + node_type = "cache.t3.small" number_cache_clusters = 2 port = 6379 - security_group_names = ["${aws_elasticache_security_group.bar.name}"] apply_immediately = true auto_minor_version_upgrade = false maintenance_window = "tue:06:30-tue:07:30" @@ -800,7 +878,7 @@ resource "aws_elasticache_subnet_group" "test" { subnet_ids = ["${aws_subnet.test.*.id[0]}", "${aws_subnet.test.*.id[1]}"] } -resource "aws_elasticache_replication_group" "bar" { +resource "aws_elasticache_replication_group" "test" { node_type = "cache.t2.micro" number_cache_clusters = 1 port = 6379 @@ -813,35 +891,12 @@ resource "aws_elasticache_replication_group" "bar" { func testAccAWSElasticacheReplicationGroupConfigEnableSnapshotting(rName string) string { return fmt.Sprintf(` -provider "aws" { - region = "us-east-1" -} - -resource "aws_security_group" "bar" { - name = %[1]q - description = "tf-test-security-group-descr" - - ingress { - from_port = -1 - to_port = -1 - protocol = "icmp" - cidr_blocks = ["0.0.0.0/0"] - } -} - -resource "aws_elasticache_security_group" "bar" { - name = %[1]q - description = "tf-test-security-group-descr" - security_group_names = ["${aws_security_group.bar.name}"] -} - -resource "aws_elasticache_replication_group" "bar" { +resource "aws_elasticache_replication_group" "test" { replication_group_id = %[1]q replication_group_description = "test description" - node_type = "cache.m1.small" + node_type = "cache.t3.small" number_cache_clusters = 2 port = 6379 - security_group_names = ["${aws_elasticache_security_group.bar.name}"] apply_immediately = true auto_minor_version_upgrade = false maintenance_window = "tue:06:30-tue:07:30" @@ -870,7 +925,7 @@ resource "aws_elasticache_parameter_group" "test" { resource "aws_elasticache_replication_group" "test" { apply_immediately = true - node_type = "cache.m1.small" + node_type = "cache.t3.small" number_cache_clusters = 2 parameter_group_name = "${aws_elasticache_parameter_group.test.*.name[%[2]d]}" replication_group_description = "test description" @@ -881,35 +936,12 @@ resource "aws_elasticache_replication_group" "test" { func testAccAWSElasticacheReplicationGroupConfigUpdatedDescription(rName string) string { return fmt.Sprintf(` -provider "aws" { - region = "us-east-1" -} - -resource "aws_security_group" "bar" { - name = %[1]q - description = "tf-test-security-group-descr" - - ingress { - from_port = -1 - to_port = -1 - protocol = "icmp" - cidr_blocks = ["0.0.0.0/0"] - } -} - -resource "aws_elasticache_security_group" "bar" { - name = %[1]q - description = "tf-test-security-group-descr" - security_group_names = ["${aws_security_group.bar.name}"] -} - -resource "aws_elasticache_replication_group" "bar" { +resource "aws_elasticache_replication_group" "test" { replication_group_id = %[1]q replication_group_description = "updated description" - node_type = "cache.m1.small" + node_type = "cache.t3.small" number_cache_clusters = 2 port = 6379 - security_group_names = ["${aws_elasticache_security_group.bar.name}"] apply_immediately = true auto_minor_version_upgrade = true } @@ -918,35 +950,12 @@ resource "aws_elasticache_replication_group" "bar" { func testAccAWSElasticacheReplicationGroupConfigUpdatedMaintenanceWindow(rName string) string { return fmt.Sprintf(` -provider "aws" { - region = "us-east-1" -} - -resource "aws_security_group" "bar" { - name = %[1]q - description = "tf-test-security-group-descr" - - ingress { - from_port = -1 - to_port = -1 - protocol = "icmp" - cidr_blocks = ["0.0.0.0/0"] - } -} - -resource "aws_elasticache_security_group" "bar" { - name = %[1]q - description = "tf-test-security-group-descr" - security_group_names = ["${aws_security_group.bar.name}"] -} - -resource "aws_elasticache_replication_group" "bar" { +resource "aws_elasticache_replication_group" "test" { replication_group_id = %[1]q replication_group_description = "updated description" - node_type = "cache.m1.small" + node_type = "cache.t3.small" number_cache_clusters = 2 port = 6379 - security_group_names = ["${aws_elasticache_security_group.bar.name}"] apply_immediately = true auto_minor_version_upgrade = true maintenance_window = "wed:03:00-wed:06:00" @@ -957,35 +966,12 @@ resource "aws_elasticache_replication_group" "bar" { func testAccAWSElasticacheReplicationGroupConfigUpdatedNodeSize(rName string) string { return fmt.Sprintf(` -provider "aws" { - region = "us-east-1" -} - -resource "aws_security_group" "bar" { - name = %[1]q - description = "tf-test-security-group-descr" - - ingress { - from_port = -1 - to_port = -1 - protocol = "icmp" - cidr_blocks = ["0.0.0.0/0"] - } -} - -resource "aws_elasticache_security_group" "bar" { - name = %[1]q - description = "tf-test-security-group-descr" - security_group_names = ["${aws_security_group.bar.name}"] -} - -resource "aws_elasticache_replication_group" "bar" { +resource "aws_elasticache_replication_group" "test" { replication_group_id = %[1]q replication_group_description = "updated description" - node_type = "cache.m1.medium" + node_type = "cache.t3.medium" number_cache_clusters = 2 port = 6379 - security_group_names = ["${aws_elasticache_security_group.bar.name}"] apply_immediately = true } `, rName) @@ -993,20 +979,18 @@ resource "aws_elasticache_replication_group" "bar" { var testAccAWSElasticacheReplicationGroupInVPCConfig = fmt.Sprintf(` data "aws_availability_zones" "available" { - # InvalidParameterValue: Specified node type cache.m1.small is not available in AZ us-east-1b. - blacklisted_zone_ids = ["use1-az1"] - state = "available" + state = "available" } -resource "aws_vpc" "foo" { +resource "aws_vpc" "test" { cidr_block = "192.168.0.0/16" tags = { Name = "terraform-testacc-elasticache-replication-group-in-vpc" } } -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" +resource "aws_subnet" "test" { + vpc_id = "${aws_vpc.test.id}" cidr_block = "192.168.0.0/20" availability_zone = "${data.aws_availability_zones.available.names[0]}" tags = { @@ -1014,16 +998,16 @@ resource "aws_subnet" "foo" { } } -resource "aws_elasticache_subnet_group" "bar" { +resource "aws_elasticache_subnet_group" "test" { name = "tf-test-cache-subnet-%03d" description = "tf-test-cache-subnet-group-descr" - subnet_ids = ["${aws_subnet.foo.id}"] + subnet_ids = ["${aws_subnet.test.id}"] } -resource "aws_security_group" "bar" { +resource "aws_security_group" "test" { name = "tf-test-security-group-%03d" description = "tf-test-security-group-descr" - vpc_id = "${aws_vpc.foo.id}" + vpc_id = "${aws_vpc.test.id}" ingress { from_port = -1 to_port = -1 @@ -1032,14 +1016,14 @@ resource "aws_security_group" "bar" { } } -resource "aws_elasticache_replication_group" "bar" { +resource "aws_elasticache_replication_group" "test" { replication_group_id = "tf-%s" replication_group_description = "test description" - node_type = "cache.m1.small" + node_type = "cache.t3.small" number_cache_clusters = 1 port = 6379 - subnet_group_name = "${aws_elasticache_subnet_group.bar.name}" - security_group_ids = ["${aws_security_group.bar.id}"] + subnet_group_name = "${aws_elasticache_subnet_group.test.name}" + security_group_ids = ["${aws_security_group.test.id}"] availability_zones = ["${data.aws_availability_zones.available.names[0]}"] auto_minor_version_upgrade = false } @@ -1047,49 +1031,42 @@ resource "aws_elasticache_replication_group" "bar" { var testAccAWSElasticacheReplicationGroupMultiAZInVPCConfig = fmt.Sprintf(` data "aws_availability_zones" "available" { - # InvalidParameterValue: Specified node type cache.m1.small is not available in AZ us-east-1b. - blacklisted_zone_ids = ["use1-az1"] - state = "available" + state = "available" } - -resource "aws_vpc" "foo" { +resource "aws_vpc" "test" { cidr_block = "192.168.0.0/16" tags = { Name = "terraform-testacc-elasticache-replication-group-multi-az-in-vpc" } } - -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" +resource "aws_subnet" "test" { + vpc_id = "${aws_vpc.test.id}" cidr_block = "192.168.0.0/20" availability_zone = "${data.aws_availability_zones.available.names[0]}" tags = { Name = "tf-acc-elasticache-replication-group-multi-az-in-vpc-foo" } } - -resource "aws_subnet" "bar" { - vpc_id = "${aws_vpc.foo.id}" +resource "aws_subnet" "test2" { + vpc_id = "${aws_vpc.test.id}" cidr_block = "192.168.16.0/20" availability_zone = "${data.aws_availability_zones.available.names[1]}" tags = { Name = "tf-acc-elasticache-replication-group-multi-az-in-vpc-bar" } } - -resource "aws_elasticache_subnet_group" "bar" { +resource "aws_elasticache_subnet_group" "test" { name = "tf-test-cache-subnet-%03d" description = "tf-test-cache-subnet-group-descr" subnet_ids = [ - "${aws_subnet.foo.id}", - "${aws_subnet.bar.id}" + "${aws_subnet.test.id}", + "${aws_subnet.test2.id}" ] } - -resource "aws_security_group" "bar" { +resource "aws_security_group" "test" { name = "tf-test-security-group-%03d" description = "tf-test-security-group-descr" - vpc_id = "${aws_vpc.foo.id}" + vpc_id = "${aws_vpc.test.id}" ingress { from_port = -1 to_port = -1 @@ -1097,15 +1074,14 @@ resource "aws_security_group" "bar" { cidr_blocks = ["0.0.0.0/0"] } } - -resource "aws_elasticache_replication_group" "bar" { +resource "aws_elasticache_replication_group" "test" { replication_group_id = "tf-%s" replication_group_description = "test description" - node_type = "cache.m1.small" + node_type = "cache.t3.small" number_cache_clusters = 2 port = 6379 - subnet_group_name = "${aws_elasticache_subnet_group.bar.name}" - security_group_ids = ["${aws_security_group.bar.id}"] + subnet_group_name = "${aws_elasticache_subnet_group.test.name}" + security_group_ids = ["${aws_security_group.test.id}"] availability_zones = ["${data.aws_availability_zones.available.names[0]}","${data.aws_availability_zones.available.names[1]}"] automatic_failover_enabled = true snapshot_window = "02:00-03:00" @@ -1115,73 +1091,67 @@ resource "aws_elasticache_replication_group" "bar" { var testAccAWSElasticacheReplicationGroupRedisClusterInVPCConfig = fmt.Sprintf(` data "aws_availability_zones" "available" { - # InvalidParameterValue: Specified node type cache.m3.medium is not available in AZ us-east-1b. - blacklisted_zone_ids = ["use1-az1"] - state = "available" -} - -resource "aws_vpc" "foo" { - cidr_block = "192.168.0.0/16" - tags = { - Name = "terraform-testacc-elasticache-replication-group-redis-cluster-in-vpc" - } -} - -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" - cidr_block = "192.168.0.0/20" - availability_zone = "${data.aws_availability_zones.available.names[0]}" - tags = { - Name = "tf-acc-elasticache-replication-group-redis-cluster-in-vpc-foo" - } -} - -resource "aws_subnet" "bar" { - vpc_id = "${aws_vpc.foo.id}" - cidr_block = "192.168.16.0/20" - availability_zone = "${data.aws_availability_zones.available.names[1]}" - tags = { - Name = "tf-acc-elasticache-replication-group-redis-cluster-in-vpc-bar" - } -} - -resource "aws_elasticache_subnet_group" "bar" { - name = "tf-test-cache-subnet-%03d" - description = "tf-test-cache-subnet-group-descr" - subnet_ids = [ - "${aws_subnet.foo.id}", - "${aws_subnet.bar.id}" - ] -} - -resource "aws_security_group" "bar" { - name = "tf-test-security-group-%03d" - description = "tf-test-security-group-descr" - vpc_id = "${aws_vpc.foo.id}" - ingress { - from_port = -1 - to_port = -1 - protocol = "icmp" - cidr_blocks = ["0.0.0.0/0"] - } -} - -resource "aws_elasticache_replication_group" "bar" { - replication_group_id = "tf-%s" - replication_group_description = "test description" - node_type = "cache.m3.medium" - number_cache_clusters = "2" - port = 6379 - subnet_group_name = "${aws_elasticache_subnet_group.bar.name}" - security_group_ids = ["${aws_security_group.bar.id}"] - availability_zones = ["${data.aws_availability_zones.available.names[0]}","${data.aws_availability_zones.available.names[1]}"] - automatic_failover_enabled = false - snapshot_window = "02:00-03:00" - snapshot_retention_limit = 7 - engine_version = "3.2.4" - maintenance_window = "thu:03:00-thu:04:00" -} -`, acctest.RandInt(), acctest.RandInt(), acctest.RandString(10)) + # InvalidParameterValue: Specified node type cache.m3.medium is not available in AZ us-east-1b. + blacklisted_zone_ids = ["use1-az1"] + state = "available" + } + resource "aws_vpc" "test" { + cidr_block = "192.168.0.0/16" + tags = { + Name = "terraform-testacc-elasticache-replication-group-redis-cluster-in-vpc" + } + } + resource "aws_subnet" "test" { + vpc_id = "${aws_vpc.test.id}" + cidr_block = "192.168.0.0/20" + availability_zone = "${data.aws_availability_zones.available.names[0]}" + tags = { + Name = "tf-acc-elasticache-replication-group-redis-cluster-in-vpc-foo" + } + } + resource "aws_subnet" "test2" { + vpc_id = "${aws_vpc.test.id}" + cidr_block = "192.168.16.0/20" + availability_zone = "${data.aws_availability_zones.available.names[1]}" + tags = { + Name = "tf-acc-elasticache-replication-group-redis-cluster-in-vpc-bar" + } + } + resource "aws_elasticache_subnet_group" "test" { + name = "tf-test-cache-subnet-%03d" + description = "tf-test-cache-subnet-group-descr" + subnet_ids = [ + "${aws_subnet.test.id}", + "${aws_subnet.test2.id}" + ] + } + resource "aws_security_group" "test" { + name = "tf-test-security-group-%03d" + description = "tf-test-security-group-descr" + vpc_id = "${aws_vpc.test.id}" + ingress { + from_port = -1 + to_port = -1 + protocol = "icmp" + cidr_blocks = ["0.0.0.0/0"] + } + } + resource "aws_elasticache_replication_group" "test" { + replication_group_id = "tf-%s" + replication_group_description = "test description" + node_type = "cache.m3.medium" + number_cache_clusters = "2" + port = 6379 + subnet_group_name = "${aws_elasticache_subnet_group.test.name}" + security_group_ids = ["${aws_security_group.test.id}"] + availability_zones = ["${data.aws_availability_zones.available.names[0]}","${data.aws_availability_zones.available.names[1]}"] + automatic_failover_enabled = false + snapshot_window = "02:00-03:00" + snapshot_retention_limit = 7 + engine_version = "3.2.4" + maintenance_window = "thu:03:00-thu:04:00" + } + `, acctest.RandInt(), acctest.RandInt(), acctest.RandString(10)) func testAccAWSElasticacheReplicationGroupNativeRedisClusterErrorConfig(rInt int, rName string) string { return fmt.Sprintf(` @@ -1189,7 +1159,7 @@ data "aws_availability_zones" "available" { state = "available" } -resource "aws_vpc" "foo" { +resource "aws_vpc" "test" { cidr_block = "192.168.0.0/16" tags = { @@ -1197,40 +1167,40 @@ resource "aws_vpc" "foo" { } } -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" +resource "aws_subnet" "test" { + vpc_id = "${aws_vpc.test.id}" cidr_block = "192.168.0.0/20" availability_zone = "${data.aws_availability_zones.available.names[0]}" tags = { - Name = "tf-acc-elasticache-replication-group-native-redis-cluster-err-foo" + Name = "tf-acc-elasticache-replication-group-native-redis-cluster-err-test" } } -resource "aws_subnet" "bar" { - vpc_id = "${aws_vpc.foo.id}" +resource "aws_subnet" "test2" { + vpc_id = "${aws_vpc.test.id}" cidr_block = "192.168.16.0/20" availability_zone = "${data.aws_availability_zones.available.names[1]}" tags = { - Name = "tf-acc-elasticache-replication-group-native-redis-cluster-err-bar" + Name = "tf-acc-elasticache-replication-group-native-redis-cluster-err-test" } } -resource "aws_elasticache_subnet_group" "bar" { +resource "aws_elasticache_subnet_group" "test" { name = "tf-test-cache-subnet-%03d" description = "tf-test-cache-subnet-group-descr" subnet_ids = [ - "${aws_subnet.foo.id}", - "${aws_subnet.bar.id}", + "${aws_subnet.test.id}", + "${aws_subnet.test.id}", ] } -resource "aws_security_group" "bar" { +resource "aws_security_group" "test" { name = "tf-test-security-group-%03d" description = "tf-test-security-group-descr" - vpc_id = "${aws_vpc.foo.id}" + vpc_id = "${aws_vpc.test.id}" ingress { from_port = -1 @@ -1240,13 +1210,13 @@ resource "aws_security_group" "bar" { } } -resource "aws_elasticache_replication_group" "bar" { +resource "aws_elasticache_replication_group" "test" { replication_group_id = "tf-%s" replication_group_description = "test description" node_type = "cache.t2.micro" port = 6379 - subnet_group_name = "${aws_elasticache_subnet_group.bar.name}" - security_group_ids = ["${aws_security_group.bar.id}"] + subnet_group_name = "${aws_elasticache_subnet_group.test.name}" + security_group_ids = ["${aws_security_group.test.id}"] automatic_failover_enabled = true cluster_mode { @@ -1265,7 +1235,7 @@ data "aws_availability_zones" "available" { state = "available" } -resource "aws_vpc" "foo" { +resource "aws_vpc" "test" { cidr_block = "192.168.0.0/16" tags = { @@ -1273,40 +1243,40 @@ resource "aws_vpc" "foo" { } } -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" +resource "aws_subnet" "test" { + vpc_id = "${aws_vpc.test.id}" cidr_block = "192.168.0.0/20" availability_zone = "${data.aws_availability_zones.available.names[0]}" tags = { - Name = "tf-acc-elasticache-replication-group-native-redis-cluster-foo" + Name = "tf-acc-elasticache-replication-group-native-redis-cluster-test" } } -resource "aws_subnet" "bar" { - vpc_id = "${aws_vpc.foo.id}" +resource "aws_subnet" "test2" { + vpc_id = "${aws_vpc.test.id}" cidr_block = "192.168.16.0/20" availability_zone = "${data.aws_availability_zones.available.names[1]}" tags = { - Name = "tf-acc-elasticache-replication-group-native-redis-cluster-bar" + Name = "tf-acc-elasticache-replication-group-native-redis-cluster-test" } } -resource "aws_elasticache_subnet_group" "bar" { +resource "aws_elasticache_subnet_group" "test" { name = "tf-test-%[1]s" description = "tf-test-cache-subnet-group-descr" subnet_ids = [ - "${aws_subnet.foo.id}", - "${aws_subnet.bar.id}", + "${aws_subnet.test.id}", + "${aws_subnet.test.id}", ] } -resource "aws_security_group" "bar" { +resource "aws_security_group" "test" { name = "tf-test-%[1]s" description = "tf-test-security-group-descr" - vpc_id = "${aws_vpc.foo.id}" + vpc_id = "${aws_vpc.test.id}" ingress { from_port = -1 @@ -1316,13 +1286,13 @@ resource "aws_security_group" "bar" { } } -resource "aws_elasticache_replication_group" "bar" { +resource "aws_elasticache_replication_group" "test" { replication_group_id = "tf-%[1]s" replication_group_description = "test description" node_type = "cache.t2.micro" port = 6379 - subnet_group_name = "${aws_elasticache_subnet_group.bar.name}" - security_group_ids = ["${aws_security_group.bar.id}"] + subnet_group_name = "${aws_elasticache_subnet_group.test.name}" + security_group_ids = ["${aws_security_group.test.id}"] automatic_failover_enabled = true cluster_mode { @@ -1333,7 +1303,7 @@ resource "aws_elasticache_replication_group" "bar" { `, rName, numNodeGroups, replicasPerNodeGroup) } -func testAccAWSElasticacheReplicationGroup_EnableAtRestEncryptionConfig(rInt int, rString string) string { +func testAccAWSElasticacheReplicationGroup_UseCmkKmsKeyId(rInt int, rString string) string { return fmt.Sprintf(` data "aws_availability_zones" "available" { state = "available" @@ -1379,6 +1349,10 @@ resource "aws_security_group" "bar" { } } +resource "aws_kms_key" "bar" { + description = "tf-test-cmk-kms-key-id" +} + resource "aws_elasticache_replication_group" "bar" { replication_group_id = "tf-%s" replication_group_description = "test description" @@ -1389,6 +1363,69 @@ resource "aws_elasticache_replication_group" "bar" { security_group_ids = ["${aws_security_group.bar.id}"] parameter_group_name = "default.redis3.2" availability_zones = ["${data.aws_availability_zones.available.names[0]}"] + engine_version = "3.2.6" + at_rest_encryption_enabled = true + kms_key_id = "${aws_kms_key.bar.arn}" +} +`, rInt, rInt, rString) +} + +func testAccAWSElasticacheReplicationGroup_EnableAtRestEncryptionConfig(rInt int, rString string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "available" { + state = "available" +} + +resource "aws_vpc" "test" { + cidr_block = "192.168.0.0/16" + + tags = { + Name = "terraform-testacc-elasticache-replication-group-at-rest-encryption" + } +} + +resource "aws_subnet" "test" { + vpc_id = "${aws_vpc.test.id}" + cidr_block = "192.168.0.0/20" + availability_zone = "${data.aws_availability_zones.available.names[0]}" + + tags = { + Name = "tf-acc-elasticache-replication-group-at-rest-encryption" + } +} + +resource "aws_elasticache_subnet_group" "test" { + name = "tf-test-cache-subnet-%03d" + description = "tf-test-cache-subnet-group-descr" + + subnet_ids = [ + "${aws_subnet.test.id}", + ] +} + +resource "aws_security_group" "test" { + name = "tf-test-security-group-%03d" + description = "tf-test-security-group-descr" + vpc_id = "${aws_vpc.test.id}" + + ingress { + from_port = -1 + to_port = -1 + protocol = "icmp" + cidr_blocks = ["0.0.0.0/0"] + } +} + +resource "aws_elasticache_replication_group" "test" { + replication_group_id = "tf-%s" + replication_group_description = "test description" + node_type = "cache.t2.micro" + number_cache_clusters = "1" + port = 6379 + subnet_group_name = "${aws_elasticache_subnet_group.test.name}" + security_group_ids = ["${aws_security_group.test.id}"] + parameter_group_name = "default.redis3.2" + availability_zones = ["${data.aws_availability_zones.available.names[0]}"] engine_version = "3.2.6" at_rest_encryption_enabled = true } @@ -1401,7 +1438,7 @@ data "aws_availability_zones" "available" { state = "available" } -resource "aws_vpc" "foo" { +resource "aws_vpc" "test" { cidr_block = "192.168.0.0/16" tags = { @@ -1409,8 +1446,8 @@ resource "aws_vpc" "foo" { } } -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" +resource "aws_subnet" "test" { + vpc_id = "${aws_vpc.test.id}" cidr_block = "192.168.0.0/20" availability_zone = "${data.aws_availability_zones.available.names[0]}" @@ -1419,19 +1456,19 @@ resource "aws_subnet" "foo" { } } -resource "aws_elasticache_subnet_group" "bar" { +resource "aws_elasticache_subnet_group" "test" { name = "tf-test-cache-subnet-%03d" description = "tf-test-cache-subnet-group-descr" subnet_ids = [ - "${aws_subnet.foo.id}", + "${aws_subnet.test.id}", ] } -resource "aws_security_group" "bar" { +resource "aws_security_group" "test" { name = "tf-test-security-group-%03d" description = "tf-test-security-group-descr" - vpc_id = "${aws_vpc.foo.id}" + vpc_id = "${aws_vpc.test.id}" ingress { from_port = -1 @@ -1441,14 +1478,14 @@ resource "aws_security_group" "bar" { } } -resource "aws_elasticache_replication_group" "bar" { +resource "aws_elasticache_replication_group" "test" { replication_group_id = "tf-%s" replication_group_description = "test description" node_type = "cache.t2.micro" number_cache_clusters = "1" port = 6379 - subnet_group_name = "${aws_elasticache_subnet_group.bar.name}" - security_group_ids = ["${aws_security_group.bar.id}"] + subnet_group_name = "${aws_elasticache_subnet_group.test.name}" + security_group_ids = ["${aws_security_group.test.id}"] parameter_group_name = "default.redis3.2" availability_zones = ["${data.aws_availability_zones.available.names[0]}"] engine_version = "3.2.6" diff --git a/aws/resource_aws_elasticache_security_group_test.go b/aws/resource_aws_elasticache_security_group_test.go index 6e9b3d35f61..35276d4b4fd 100644 --- a/aws/resource_aws_elasticache_security_group_test.go +++ b/aws/resource_aws_elasticache_security_group_test.go @@ -67,29 +67,13 @@ func testSweepElasticacheCacheSecurityGroups(region string) error { } func TestAccAWSElasticacheSecurityGroup_basic(t *testing.T) { - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSElasticacheSecurityGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSElasticacheSecurityGroupConfig, - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheSecurityGroupExists("aws_elasticache_security_group.bar"), - resource.TestCheckResourceAttr( - "aws_elasticache_security_group.bar", "description", "Managed by Terraform"), - ), - }, - }, - }) -} - -func TestAccAWSElasticacheSecurityGroup_Import(t *testing.T) { // Use EC2-Classic enabled us-east-1 for testing oldRegion := os.Getenv("AWS_DEFAULT_REGION") os.Setenv("AWS_DEFAULT_REGION", "us-east-1") defer os.Setenv("AWS_DEFAULT_REGION", oldRegion) + resourceName := "aws_elasticache_security_group.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -97,10 +81,14 @@ func TestAccAWSElasticacheSecurityGroup_Import(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccAWSElasticacheSecurityGroupConfig, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSElasticacheSecurityGroupExists(resourceName), + resource.TestCheckResourceAttr( + resourceName, "description", "Managed by Terraform"), + ), }, - { - ResourceName: "aws_elasticache_security_group.bar", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -157,7 +145,7 @@ provider "aws" { region = "us-east-1" } -resource "aws_security_group" "bar" { +resource "aws_security_group" "test" { name = "tf-test-security-group-%03d" ingress { @@ -168,8 +156,8 @@ resource "aws_security_group" "bar" { } } -resource "aws_elasticache_security_group" "bar" { +resource "aws_elasticache_security_group" "test" { name = "tf-test-security-group-%03d" - security_group_names = ["${aws_security_group.bar.name}"] + security_group_names = ["${aws_security_group.test.name}"] } `, acctest.RandInt(), acctest.RandInt()) diff --git a/aws/resource_aws_elasticache_subnet_group_test.go b/aws/resource_aws_elasticache_subnet_group_test.go index ece6014e9bf..0b60ddf3e84 100644 --- a/aws/resource_aws_elasticache_subnet_group_test.go +++ b/aws/resource_aws_elasticache_subnet_group_test.go @@ -12,9 +12,10 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSElasticacheSubnetGroup_importBasic(t *testing.T) { - resourceName := "aws_elasticache_subnet_group.bar" +func TestAccAWSElasticacheSubnetGroup_basic(t *testing.T) { + var csg elasticache.CacheSubnetGroup config := fmt.Sprintf(testAccAWSElasticacheSubnetGroupConfig, acctest.RandInt()) + resourceName := "aws_elasticache_subnet_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -23,8 +24,12 @@ func TestAccAWSElasticacheSubnetGroup_importBasic(t *testing.T) { Steps: []resource.TestStep{ { Config: config, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSElasticacheSubnetGroupExists(resourceName, &csg), + resource.TestCheckResourceAttr( + resourceName, "description", "Managed by Terraform"), + ), }, - { ResourceName: resourceName, ImportState: true, @@ -36,33 +41,12 @@ func TestAccAWSElasticacheSubnetGroup_importBasic(t *testing.T) { }) } -func TestAccAWSElasticacheSubnetGroup_basic(t *testing.T) { - var csg elasticache.CacheSubnetGroup - config := fmt.Sprintf(testAccAWSElasticacheSubnetGroupConfig, acctest.RandInt()) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSElasticacheSubnetGroupDestroy, - Steps: []resource.TestStep{ - { - Config: config, - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheSubnetGroupExists("aws_elasticache_subnet_group.bar", &csg), - resource.TestCheckResourceAttr( - "aws_elasticache_subnet_group.bar", "description", "Managed by Terraform"), - ), - }, - }, - }) -} - func TestAccAWSElasticacheSubnetGroup_update(t *testing.T) { var csg elasticache.CacheSubnetGroup - rn := "aws_elasticache_subnet_group.bar" - ri := acctest.RandInt() - preConfig := fmt.Sprintf(testAccAWSElasticacheSubnetGroupUpdateConfigPre, ri) - postConfig := fmt.Sprintf(testAccAWSElasticacheSubnetGroupUpdateConfigPost, ri) + resourceName := "aws_elasticache_subnet_group.test" + rInt := acctest.RandInt() + preConfig := fmt.Sprintf(testAccAWSElasticacheSubnetGroupUpdateConfigPre, rInt) + postConfig := fmt.Sprintf(testAccAWSElasticacheSubnetGroupUpdateConfigPost, rInt) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -72,16 +56,22 @@ func TestAccAWSElasticacheSubnetGroup_update(t *testing.T) { { Config: preConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheSubnetGroupExists(rn, &csg), - testAccCheckAWSElastiCacheSubnetGroupAttrs(&csg, rn, 1), + testAccCheckAWSElasticacheSubnetGroupExists(resourceName, &csg), + testAccCheckAWSElastiCacheSubnetGroupAttrs(&csg, resourceName, 1), ), }, - + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "description"}, + }, { Config: postConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSElasticacheSubnetGroupExists(rn, &csg), - testAccCheckAWSElastiCacheSubnetGroupAttrs(&csg, rn, 2), + testAccCheckAWSElasticacheSubnetGroupExists(resourceName, &csg), + testAccCheckAWSElastiCacheSubnetGroupAttrs(&csg, resourceName, 2), ), }, }, @@ -181,7 +171,7 @@ resource "aws_subnet" "foo" { } } -resource "aws_elasticache_subnet_group" "bar" { +resource "aws_elasticache_subnet_group" "test" { // Including uppercase letters in this name to ensure // that we correctly handle the fact that the API // normalizes names to lowercase. @@ -206,7 +196,7 @@ resource "aws_subnet" "foo" { } } -resource "aws_elasticache_subnet_group" "bar" { +resource "aws_elasticache_subnet_group" "test" { name = "tf-test-cache-subnet-%03d" description = "tf-test-cache-subnet-group-descr" subnet_ids = ["${aws_subnet.foo.id}"] @@ -230,21 +220,21 @@ resource "aws_subnet" "foo" { } } -resource "aws_subnet" "bar" { +resource "aws_subnet" "test" { vpc_id = "${aws_vpc.foo.id}" cidr_block = "10.0.2.0/24" availability_zone = "us-west-2a" tags = { - Name = "tf-acc-elasticache-subnet-group-update-bar" + Name = "tf-acc-elasticache-subnet-group-update-test" } } -resource "aws_elasticache_subnet_group" "bar" { +resource "aws_elasticache_subnet_group" "test" { name = "tf-test-cache-subnet-%03d" description = "tf-test-cache-subnet-group-descr-edited" subnet_ids = [ "${aws_subnet.foo.id}", - "${aws_subnet.bar.id}", + "${aws_subnet.test.id}", ] } ` diff --git a/aws/resource_aws_elasticsearch_domain.go b/aws/resource_aws_elasticsearch_domain.go index 3a559c513e0..169e6275dfd 100644 --- a/aws/resource_aws_elasticsearch_domain.go +++ b/aws/resource_aws_elasticsearch_domain.go @@ -15,6 +15,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/structure" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsElasticSearchDomain() *schema.Resource { @@ -86,6 +87,29 @@ func resourceAwsElasticSearchDomain() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "domain_endpoint_options": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enforce_https": { + Type: schema.TypeBool, + Required: true, + }, + "tls_security_policy": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice([]string{ + elasticsearch.TLSSecurityPolicyPolicyMinTls10201907, + elasticsearch.TLSSecurityPolicyPolicyMinTls12201907, + }, false), + }, + }, + }, + }, "endpoint": { Type: schema.TypeString, Computed: true, @@ -443,6 +467,10 @@ func resourceAwsElasticSearchDomainCreate(d *schema.ResourceData, meta interface } } + if v, ok := d.GetOk("domain_endpoint_options"); ok { + input.DomainEndpointOptions = expandESDomainEndpointOptions(v.([]interface{})) + } + if v, ok := d.GetOk("cognito_options"); ok { input.CognitoOptions = expandESCognitoOptions(v.([]interface{})) } @@ -471,6 +499,15 @@ func resourceAwsElasticSearchDomainCreate(d *schema.ResourceData, meta interface if isAWSErr(err, "ValidationException", "The passed role has not propagated yet") { return resource.RetryableError(err) } + if isAWSErr(err, "ValidationException", "Authentication error") { + return resource.RetryableError(err) + } + if isAWSErr(err, "ValidationException", "Unauthorized Operation: Elasticsearch must be authorised to describe") { + return resource.RetryableError(err) + } + if isAWSErr(err, "ValidationException", "The passed role must authorize Amazon Elasticsearch to describe") { + return resource.RetryableError(err) + } return resource.NonRetryableError(err) } @@ -489,21 +526,17 @@ func resourceAwsElasticSearchDomainCreate(d *schema.ResourceData, meta interface // This should mean that if the creation fails (eg because your token expired // whilst the operation is being performed), we still get the required tags on // the resources. - tags := tagsFromMapElasticsearchService(d.Get("tags").(map[string]interface{})) - - if err := setTagsElasticsearchService(conn, d, aws.StringValue(out.DomainStatus.ARN)); err != nil { - return err + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + if err := keyvaluetags.ElasticsearchserviceUpdateTags(conn, d.Id(), nil, v); err != nil { + return fmt.Errorf("error adding Elasticsearch Cluster (%s) tags: %s", d.Id(), err) + } } - d.Set("tags", tagsToMapElasticsearchService(tags)) - d.SetPartial("tags") - log.Printf("[DEBUG] Waiting for ElasticSearch domain %q to be created", d.Id()) err = waitForElasticSearchDomainCreation(conn, d.Get("domain_name").(string), d.Id()) if err != nil { return err } - d.Partial(false) log.Printf("[DEBUG] ElasticSearch domain %q created", d.Id()) @@ -642,21 +675,21 @@ func resourceAwsElasticSearchDomainRead(d *schema.ResourceData, meta interface{} d.Set("log_publishing_options", m) } + if err := d.Set("domain_endpoint_options", flattenESDomainEndpointOptions(ds.DomainEndpointOptions)); err != nil { + return fmt.Errorf("error setting domain_endpoint_options: %s", err) + } + d.Set("arn", ds.ARN) - listOut, err := conn.ListTags(&elasticsearch.ListTagsInput{ - ARN: ds.ARN, - }) + tags, err := keyvaluetags.ElasticsearchserviceListTags(conn, d.Id()) if err != nil { - return err - } - var est []*elasticsearch.Tag - if len(listOut.TagList) > 0 { - est = listOut.TagList + return fmt.Errorf("error listing tags for Elasticsearch Cluster (%s): %s", d.Id(), err) } - d.Set("tags", tagsToMapElasticsearchService(est)) + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } @@ -664,14 +697,14 @@ func resourceAwsElasticSearchDomainRead(d *schema.ResourceData, meta interface{} func resourceAwsElasticSearchDomainUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).esconn - d.Partial(true) + if d.HasChange("tags") { + o, n := d.GetChange("tags") - if err := setTagsElasticsearchService(conn, d, d.Id()); err != nil { - return err + if err := keyvaluetags.ElasticsearchserviceUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating Elasticsearch Cluster (%s) tags: %s", d.Id(), err) + } } - d.SetPartial("tags") - input := elasticsearch.UpdateElasticsearchDomainConfigInput{ DomainName: aws.String(d.Get("domain_name").(string)), } @@ -684,6 +717,10 @@ func resourceAwsElasticSearchDomainUpdate(d *schema.ResourceData, meta interface input.AdvancedOptions = stringMapToPointers(d.Get("advanced_options").(map[string]interface{})) } + if d.HasChange("domain_endpoint_options") { + input.DomainEndpointOptions = expandESDomainEndpointOptions(d.Get("domain_endpoint_options").([]interface{})) + } + if d.HasChange("ebs_options") || d.HasChange("cluster_config") { options := d.Get("ebs_options").([]interface{}) @@ -797,6 +834,13 @@ func resourceAwsElasticSearchDomainUpdate(d *schema.ResourceData, meta interface return nil, "", err } + // Elasticsearch upgrades consist of multiple steps: + // https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-version-migration.html + // Prevent false positive completion where the UpgradeStep is not the final UPGRADE step. + if aws.StringValue(out.StepStatus) == elasticsearch.UpgradeStatusSucceeded && aws.StringValue(out.UpgradeStep) != elasticsearch.UpgradeStepUpgrade { + return out, elasticsearch.UpgradeStatusInProgress, nil + } + return out, aws.StringValue(out.StepStatus), nil }, Timeout: 60 * time.Minute, // TODO: Make this configurable. Large ES domains may take a very long time to upgrade @@ -809,8 +853,6 @@ func resourceAwsElasticSearchDomainUpdate(d *schema.ResourceData, meta interface } } - d.Partial(false) - return resourceAwsElasticSearchDomainRead(d, meta) } diff --git a/aws/resource_aws_elasticsearch_domain_test.go b/aws/resource_aws_elasticsearch_domain_test.go index 47e395b4fa8..d884734879e 100644 --- a/aws/resource_aws_elasticsearch_domain_test.go +++ b/aws/resource_aws_elasticsearch_domain_test.go @@ -4,11 +4,13 @@ import ( "fmt" "log" "regexp" + "strings" "testing" "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/aws/aws-sdk-go/service/iam" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" @@ -58,19 +60,61 @@ func testSweepElasticSearchDomains(region string) error { func TestAccAWSElasticSearchDomain_basic(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus ri := acctest.RandInt() + resourceName := "aws_elasticsearch_domain.test" + resourceId := fmt.Sprintf("tf-test-%d", ri) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { Config: testAccESDomainConfig(ri), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), resource.TestCheckResourceAttr( - "aws_elasticsearch_domain.example", "elasticsearch_version", "1.5"), - resource.TestMatchResourceAttr("aws_elasticsearch_domain.example", "kibana_endpoint", regexp.MustCompile(".*es.amazonaws.com/_plugin/kibana/")), + resourceName, "elasticsearch_version", "1.5"), + resource.TestMatchResourceAttr(resourceName, "kibana_endpoint", regexp.MustCompile(`.*es\..*/_plugin/kibana/`)), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSElasticSearchDomain_RequireHTTPS(t *testing.T) { + var domain elasticsearch.ElasticsearchDomainStatus + ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckESDomainDestroy, + Steps: []resource.TestStep{ + { + Config: testAccESDomainConfig_DomainEndpointOptions(ri, true, "Policy-Min-TLS-1-0-2019-07"), + Check: resource.ComposeTestCheckFunc( + testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainEndpointOptions(true, "Policy-Min-TLS-1-0-2019-07", &domain), + ), + }, + { + ResourceName: "aws_elasticsearch_domain.example", + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, + { + Config: testAccESDomainConfig_DomainEndpointOptions(ri, true, "Policy-Min-TLS-1-2-2019-07"), + Check: resource.ComposeTestCheckFunc( + testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainEndpointOptions(true, "Policy-Min-TLS-1-2-2019-07", &domain), ), }, }, @@ -79,11 +123,11 @@ func TestAccAWSElasticSearchDomain_basic(t *testing.T) { func TestAccAWSElasticSearchDomain_ClusterConfig_ZoneAwarenessConfig(t *testing.T) { var domain1, domain2, domain3, domain4 elasticsearch.ElasticsearchDomainStatus - rName := acctest.RandomWithPrefix("tf-acc-test")[:28] + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandStringFromCharSet(16, acctest.CharSetAlphaNum)) // len = 28 resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ @@ -138,28 +182,36 @@ func TestAccAWSElasticSearchDomain_ClusterConfig_ZoneAwarenessConfig(t *testing. func TestAccAWSElasticSearchDomain_withDedicatedMaster(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus ri := acctest.RandInt() + resourceName := "aws_elasticsearch_domain.test" + resourceId := fmt.Sprintf("tf-test-%d", ri) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { Config: testAccESDomainConfig_WithDedicatedClusterMaster(ri, false), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, { Config: testAccESDomainConfig_WithDedicatedClusterMaster(ri, true), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), ), }, { Config: testAccESDomainConfig_WithDedicatedClusterMaster(ri, false), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), ), }, }, @@ -169,15 +221,16 @@ func TestAccAWSElasticSearchDomain_withDedicatedMaster(t *testing.T) { func TestAccAWSElasticSearchDomain_duplicate(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus ri := acctest.RandInt() - name := fmt.Sprintf("tf-test-%d", ri) + resourceId := fmt.Sprintf("tf-test-%d", ri) + resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: func(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).esconn _, err := conn.DeleteElasticsearchDomain(&elasticsearch.DeleteElasticsearchDomainInput{ - DomainName: aws.String(name), + DomainName: aws.String(resourceId), }) return err }, @@ -187,7 +240,7 @@ func TestAccAWSElasticSearchDomain_duplicate(t *testing.T) { // Create duplicate conn := testAccProvider.Meta().(*AWSClient).esconn _, err := conn.CreateElasticsearchDomain(&elasticsearch.CreateElasticsearchDomainInput{ - DomainName: aws.String(name), + DomainName: aws.String(resourceId), EBSOptions: &elasticsearch.EBSOptions{ EBSEnabled: aws.Bool(true), VolumeSize: aws.Int64(10), @@ -197,16 +250,16 @@ func TestAccAWSElasticSearchDomain_duplicate(t *testing.T) { t.Fatal(err) } - err = waitForElasticSearchDomainCreation(conn, name, name) + err = waitForElasticSearchDomainCreation(conn, resourceId, resourceId) if err != nil { t.Fatal(err) } }, Config: testAccESDomainConfig(ri), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), resource.TestCheckResourceAttr( - "aws_elasticsearch_domain.example", "elasticsearch_version", "1.5"), + resourceName, "elasticsearch_version", "1.5"), ), ExpectError: regexp.MustCompile(`domain .+ already exists`), }, @@ -214,46 +267,31 @@ func TestAccAWSElasticSearchDomain_duplicate(t *testing.T) { }) } -func TestAccAWSElasticSearchDomain_importBasic(t *testing.T) { - resourceName := "aws_elasticsearch_domain.example" - ri := acctest.RandInt() - resourceId := fmt.Sprintf("tf-test-%d", ri) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckESDomainDestroy, - Steps: []resource.TestStep{ - { - Config: testAccESDomainConfig(ri), - }, - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateId: resourceId, - }, - }, - }) -} - func TestAccAWSElasticSearchDomain_v23(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) + resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { Config: testAccESDomainConfigV23(ri), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), resource.TestCheckResourceAttr( - "aws_elasticsearch_domain.example", "elasticsearch_version", "2.3"), + resourceName, "elasticsearch_version", "2.3"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, }, }) } @@ -261,18 +299,26 @@ func TestAccAWSElasticSearchDomain_v23(t *testing.T) { func TestAccAWSElasticSearchDomain_complex(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) + resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { Config: testAccESDomainConfig_complex(ri), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, }, }) } @@ -280,18 +326,26 @@ func TestAccAWSElasticSearchDomain_complex(t *testing.T) { func TestAccAWSElasticSearchDomain_vpc(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) + resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { Config: testAccESDomainConfig_vpc(ri), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, }, }) } @@ -299,23 +353,31 @@ func TestAccAWSElasticSearchDomain_vpc(t *testing.T) { func TestAccAWSElasticSearchDomain_vpc_update(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) + resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { Config: testAccESDomainConfig_vpc_update(ri, false), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), testAccCheckESNumberOfSecurityGroups(1, &domain), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, { Config: testAccESDomainConfig_vpc_update(ri, true), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), testAccCheckESNumberOfSecurityGroups(2, &domain), ), }, @@ -326,22 +388,30 @@ func TestAccAWSElasticSearchDomain_vpc_update(t *testing.T) { func TestAccAWSElasticSearchDomain_internetToVpcEndpoint(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) + resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { Config: testAccESDomainConfig(ri), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, { Config: testAccESDomainConfig_internetToVpcEndpoint(ri), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), ), }, }, @@ -350,17 +420,27 @@ func TestAccAWSElasticSearchDomain_internetToVpcEndpoint(t *testing.T) { func TestAccAWSElasticSearchDomain_LogPublishingOptions(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus + ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) + resourceName := "aws_elasticsearch_domain.test" + resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { - Config: testAccESDomainConfig_LogPublishingOptions(acctest.RandInt()), + Config: testAccESDomainConfig_LogPublishingOptions(ri), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, }, }) } @@ -368,23 +448,35 @@ func TestAccAWSElasticSearchDomain_LogPublishingOptions(t *testing.T) { func TestAccAWSElasticSearchDomain_CognitoOptionsCreateAndRemove(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus ri := acctest.RandInt() + resourceName := "aws_elasticsearch_domain.test" + resourceId := fmt.Sprintf("tf-test-%d", ri) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckAWSCognitoIdentityProvider(t) + testAccPreCheckIamServiceLinkedRoleEs(t) + }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { Config: testAccESDomainConfig_CognitoOptions(ri, true), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), testAccCheckESCognitoOptions(true, &domain), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, { Config: testAccESDomainConfig_CognitoOptions(ri, false), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), testAccCheckESCognitoOptions(false, &domain), ), }, @@ -395,23 +487,35 @@ func TestAccAWSElasticSearchDomain_CognitoOptionsCreateAndRemove(t *testing.T) { func TestAccAWSElasticSearchDomain_CognitoOptionsUpdate(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) + resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckAWSCognitoIdentityProvider(t) + testAccPreCheckIamServiceLinkedRoleEs(t) + }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { Config: testAccESDomainConfig_CognitoOptions(ri, false), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), testAccCheckESCognitoOptions(false, &domain), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, { Config: testAccESDomainConfig_CognitoOptions(ri, true), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), testAccCheckESCognitoOptions(true, &domain), ), }, @@ -419,115 +523,148 @@ func TestAccAWSElasticSearchDomain_CognitoOptionsUpdate(t *testing.T) { }) } -func testAccCheckESNumberOfSecurityGroups(numberOfSecurityGroups int, status *elasticsearch.ElasticsearchDomainStatus) resource.TestCheckFunc { - return func(s *terraform.State) error { - count := len(status.VPCOptions.SecurityGroupIds) - if count != numberOfSecurityGroups { - return fmt.Errorf("Number of security groups differ. Given: %d, Expected: %d", count, numberOfSecurityGroups) - } - return nil - } -} - func TestAccAWSElasticSearchDomain_policy(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus + resourceName := "aws_elasticsearch_domain.test" + ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { - Config: testAccESDomainConfigWithPolicy(acctest.RandInt(), acctest.RandInt()), + Config: testAccESDomainConfigWithPolicy(ri, ri), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, }, }) } func TestAccAWSElasticSearchDomain_encrypt_at_rest_default_key(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus + resourceName := "aws_elasticsearch_domain.test" + ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { - Config: testAccESDomainConfigWithEncryptAtRestDefaultKey(acctest.RandInt()), + Config: testAccESDomainConfigWithEncryptAtRestDefaultKey(ri), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), testAccCheckESEncrypted(true, &domain), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, }, }) } func TestAccAWSElasticSearchDomain_encrypt_at_rest_specify_key(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus + resourceName := "aws_elasticsearch_domain.test" + ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { - Config: testAccESDomainConfigWithEncryptAtRestWithKey(acctest.RandInt()), + Config: testAccESDomainConfigWithEncryptAtRestWithKey(ri), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), testAccCheckESEncrypted(true, &domain), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, }, }) } func TestAccAWSElasticSearchDomain_NodeToNodeEncryption(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus + resourceName := "aws_elasticsearch_domain.test" + ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { - Config: testAccESDomainConfigwithNodeToNodeEncryption(acctest.RandInt()), + Config: testAccESDomainConfigwithNodeToNodeEncryption(ri), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), testAccCheckESNodetoNodeEncrypted(true, &domain), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, }, }) } func TestAccAWSElasticSearchDomain_tags(t *testing.T) { var domain elasticsearch.ElasticsearchDomainStatus - var td elasticsearch.ListTagsOutput ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) + resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSELBDestroy, Steps: []resource.TestStep{ { Config: testAccESDomainConfig(ri), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), + testAccCheckESDomainExists(resourceName, &domain), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, - + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, { Config: testAccESDomainConfig_TagUpdate(ri), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain), - testAccLoadESTags(&domain, &td), - testAccCheckElasticsearchServiceTags(&td.TagList, "foo", "bar"), - testAccCheckElasticsearchServiceTags(&td.TagList, "new", "type"), + testAccCheckESDomainExists(resourceName, &domain), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.foo", "bar"), + resource.TestCheckResourceAttr(resourceName, "tags.new", "type"), ), }, }, @@ -537,24 +674,32 @@ func TestAccAWSElasticSearchDomain_tags(t *testing.T) { func TestAccAWSElasticSearchDomain_update(t *testing.T) { var input elasticsearch.ElasticsearchDomainStatus ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) + resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { Config: testAccESDomainConfig_ClusterUpdate(ri, 2, 22), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &input), + testAccCheckESDomainExists(resourceName, &input), testAccCheckESNumberOfInstances(2, &input), testAccCheckESSnapshotHour(22, &input), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, { Config: testAccESDomainConfig_ClusterUpdate(ri, 4, 23), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &input), + testAccCheckESDomainExists(resourceName, &input), testAccCheckESNumberOfInstances(4, &input), testAccCheckESSnapshotHour(23, &input), ), @@ -565,31 +710,39 @@ func TestAccAWSElasticSearchDomain_update(t *testing.T) { func TestAccAWSElasticSearchDomain_update_volume_type(t *testing.T) { var input elasticsearch.ElasticsearchDomainStatus ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) + resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { Config: testAccESDomainConfig_ClusterUpdateEBSVolume(ri, 24), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &input), + testAccCheckESDomainExists(resourceName, &input), testAccCheckESEBSVolumeEnabled(true, &input), testAccCheckESEBSVolumeSize(24, &input), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, { Config: testAccESDomainConfig_ClusterUpdateInstanceStore(ri), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &input), + testAccCheckESDomainExists(resourceName, &input), testAccCheckESEBSVolumeEnabled(false, &input), ), }, { Config: testAccESDomainConfig_ClusterUpdateEBSVolume(ri, 12), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &input), + testAccCheckESDomainExists(resourceName, &input), testAccCheckESEBSVolumeEnabled(true, &input), testAccCheckESEBSVolumeSize(12, &input), ), @@ -600,38 +753,69 @@ func TestAccAWSElasticSearchDomain_update_volume_type(t *testing.T) { func TestAccAWSElasticSearchDomain_update_version(t *testing.T) { var domain1, domain2, domain3 elasticsearch.ElasticsearchDomainStatus ri := acctest.RandInt() + resourceId := fmt.Sprintf("tf-test-%d", ri) + resourceName := "aws_elasticsearch_domain.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckIamServiceLinkedRoleEs(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckESDomainDestroy, Steps: []resource.TestStep{ { Config: testAccESDomainConfig_ClusterUpdateVersion(ri, "5.5"), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain1), - resource.TestCheckResourceAttr("aws_elasticsearch_domain.example", "elasticsearch_version", "5.5"), + testAccCheckESDomainExists(resourceName, &domain1), + resource.TestCheckResourceAttr(resourceName, "elasticsearch_version", "5.5"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateId: resourceId, + ImportStateVerify: true, + }, { Config: testAccESDomainConfig_ClusterUpdateVersion(ri, "5.6"), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain2), + testAccCheckESDomainExists(resourceName, &domain2), testAccCheckAWSESDomainNotRecreated(&domain1, &domain2), - resource.TestCheckResourceAttr("aws_elasticsearch_domain.example", "elasticsearch_version", "5.6"), + resource.TestCheckResourceAttr(resourceName, "elasticsearch_version", "5.6"), ), }, { Config: testAccESDomainConfig_ClusterUpdateVersion(ri, "6.3"), Check: resource.ComposeTestCheckFunc( - testAccCheckESDomainExists("aws_elasticsearch_domain.example", &domain3), + testAccCheckESDomainExists(resourceName, &domain3), testAccCheckAWSESDomainNotRecreated(&domain2, &domain3), - resource.TestCheckResourceAttr("aws_elasticsearch_domain.example", "elasticsearch_version", "6.3"), + resource.TestCheckResourceAttr(resourceName, "elasticsearch_version", "6.3"), ), }, }}) } +func testAccCheckESDomainEndpointOptions(enforceHTTPS bool, tls string, status *elasticsearch.ElasticsearchDomainStatus) resource.TestCheckFunc { + return func(s *terraform.State) error { + options := status.DomainEndpointOptions + if *options.EnforceHTTPS != enforceHTTPS { + return fmt.Errorf("EnforceHTTPS differ. Given: %t, Expected: %t", *options.EnforceHTTPS, enforceHTTPS) + } + if *options.TLSSecurityPolicy != tls { + return fmt.Errorf("TLSSecurityPolicy differ. Given: %s, Expected: %s", *options.TLSSecurityPolicy, tls) + } + return nil + } +} + +func testAccCheckESNumberOfSecurityGroups(numberOfSecurityGroups int, status *elasticsearch.ElasticsearchDomainStatus) resource.TestCheckFunc { + return func(s *terraform.State) error { + count := len(status.VPCOptions.SecurityGroupIds) + if count != numberOfSecurityGroups { + return fmt.Errorf("Number of security groups differ. Given: %d, Expected: %d", count, numberOfSecurityGroups) + } + return nil + } +} + func testAccCheckESEBSVolumeSize(ebsVolumeSize int, status *elasticsearch.ElasticsearchDomainStatus) resource.TestCheckFunc { return func(s *terraform.State) error { conf := status.EBSOptions @@ -701,24 +885,6 @@ func testAccCheckESCognitoOptions(enabled bool, status *elasticsearch.Elasticsea } } -func testAccLoadESTags(conf *elasticsearch.ElasticsearchDomainStatus, td *elasticsearch.ListTagsOutput) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).esconn - - describe, err := conn.ListTags(&elasticsearch.ListTagsInput{ - ARN: conf.ARN, - }) - - if err != nil { - return err - } - if len(describe.TagList) > 0 { - *td = *describe - } - return nil - } -} - func testAccCheckESDomainExists(n string, domain *elasticsearch.ElasticsearchDomainStatus) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -794,9 +960,41 @@ func testAccCheckESDomainDestroy(s *terraform.State) error { return nil } +func testAccPreCheckIamServiceLinkedRoleEs(t *testing.T) { + conn := testAccProvider.Meta().(*AWSClient).iamconn + dnsSuffix := testAccProvider.Meta().(*AWSClient).dnsSuffix + + input := &iam.ListRolesInput{ + PathPrefix: aws.String("/aws-service-role/es."), + } + + var role *iam.Role + err := conn.ListRolesPages(input, func(page *iam.ListRolesOutput, lastPage bool) bool { + for _, r := range page.Roles { + if strings.HasPrefix(aws.StringValue(r.Path), "/aws-service-role/es.") { + role = r + } + } + + return !lastPage + }) + + if testAccPreCheckSkipError(err) { + t.Skipf("skipping acceptance testing: %s", err) + } + + if err != nil { + t.Fatalf("unexpected PreCheck error: %s", err) + } + + if role == nil { + t.Fatalf("missing IAM Service Linked Role (es.%s), please create it in the AWS account and retry", dnsSuffix) + } +} + func testAccESDomainConfig(randInt int) string { return fmt.Sprintf(` -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" ebs_options { @@ -807,13 +1005,31 @@ resource "aws_elasticsearch_domain" "example" { `, randInt) } +func testAccESDomainConfig_DomainEndpointOptions(randInt int, enforceHttps bool, tlsSecurityPolicy string) string { + return fmt.Sprintf(` +resource "aws_elasticsearch_domain" "example" { + domain_name = "tf-test-%[1]d" + + domain_endpoint_options { + enforce_https = %[2]t + tls_security_policy = %[3]q + } + + ebs_options { + ebs_enabled = true + volume_size = 10 + } +} +`, randInt, enforceHttps, tlsSecurityPolicy) +} + func testAccESDomainConfig_ClusterConfig_ZoneAwarenessConfig_AvailabilityZoneCount(rName string, availabilityZoneCount int) string { return fmt.Sprintf(` resource "aws_elasticsearch_domain" "test" { domain_name = %[1]q cluster_config { - instance_type = "t2.micro.elasticsearch" + instance_type = "t2.small.elasticsearch" instance_count = 6 zone_awareness_enabled = true @@ -836,7 +1052,7 @@ resource "aws_elasticsearch_domain" "test" { domain_name = %[1]q cluster_config { - instance_type = "t2.micro.elasticsearch" + instance_type = "t2.small.elasticsearch" instance_count = 6 zone_awareness_enabled = %[2]t } @@ -851,15 +1067,15 @@ resource "aws_elasticsearch_domain" "test" { func testAccESDomainConfig_WithDedicatedClusterMaster(randInt int, enabled bool) string { return fmt.Sprintf(` -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" cluster_config { - instance_type = "t2.micro.elasticsearch" + instance_type = "t2.small.elasticsearch" instance_count = "1" dedicated_master_enabled = %t dedicated_master_count = "3" - dedicated_master_type = "t2.micro.elasticsearch" + dedicated_master_type = "t2.small.elasticsearch" } ebs_options { @@ -872,7 +1088,7 @@ resource "aws_elasticsearch_domain" "example" { func testAccESDomainConfig_ClusterUpdate(randInt, instanceInt, snapshotInt int) string { return fmt.Sprintf(` -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" advanced_options = { @@ -887,7 +1103,7 @@ resource "aws_elasticsearch_domain" "example" { cluster_config { instance_count = %d zone_awareness_enabled = true - instance_type = "t2.micro.elasticsearch" + instance_type = "t2.small.elasticsearch" } snapshot_options { @@ -899,7 +1115,7 @@ resource "aws_elasticsearch_domain" "example" { func testAccESDomainConfig_ClusterUpdateEBSVolume(randInt, volumeSize int) string { return fmt.Sprintf(` -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" elasticsearch_version = "6.0" @@ -924,7 +1140,7 @@ resource "aws_elasticsearch_domain" "example" { func testAccESDomainConfig_ClusterUpdateVersion(randInt int, version string) string { return fmt.Sprintf(` -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" elasticsearch_version = "%v" @@ -945,7 +1161,7 @@ resource "aws_elasticsearch_domain" "example" { func testAccESDomainConfig_ClusterUpdateInstanceStore(randInt int) string { return fmt.Sprintf(` -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" elasticsearch_version = "6.0" @@ -969,7 +1185,7 @@ resource "aws_elasticsearch_domain" "example" { func testAccESDomainConfig_TagUpdate(randInt int) string { return fmt.Sprintf(` -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" ebs_options { @@ -987,7 +1203,9 @@ resource "aws_elasticsearch_domain" "example" { func testAccESDomainConfigWithPolicy(randESId int, randRoleId int) string { return fmt.Sprintf(` -resource "aws_elasticsearch_domain" "example" { +data "aws_partition" "current" {} + +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" ebs_options { @@ -1005,7 +1223,7 @@ resource "aws_elasticsearch_domain" "example" { "AWS": "${aws_iam_role.example_role.arn}" }, "Action": "es:*", - "Resource": "arn:aws:es:*" + "Resource": "arn:${data.aws_partition.current.partition}:es:*" } ] } @@ -1023,7 +1241,7 @@ data "aws_iam_policy_document" "instance-assume-role-policy" { principals { type = "Service" - identifiers = ["ec2.amazonaws.com"] + identifiers = ["ec2.${data.aws_partition.current.dns_suffix}"] } } } @@ -1032,7 +1250,7 @@ data "aws_iam_policy_document" "instance-assume-role-policy" { func testAccESDomainConfigWithEncryptAtRestDefaultKey(randESId int) string { return fmt.Sprintf(` -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" elasticsearch_version = "6.0" @@ -1061,7 +1279,7 @@ resource "aws_kms_key" "es" { deletion_window_in_days = 7 } -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" elasticsearch_version = "6.0" @@ -1086,7 +1304,7 @@ resource "aws_elasticsearch_domain" "example" { func testAccESDomainConfigwithNodeToNodeEncryption(randInt int) string { return fmt.Sprintf(` -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" elasticsearch_version = "6.0" @@ -1109,7 +1327,7 @@ resource "aws_elasticsearch_domain" "example" { func testAccESDomainConfig_complex(randInt int) string { return fmt.Sprintf(` -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" advanced_options = { @@ -1117,13 +1335,14 @@ resource "aws_elasticsearch_domain" "example" { } ebs_options { - ebs_enabled = false + ebs_enabled = true + volume_size = 10 } cluster_config { instance_count = 2 zone_awareness_enabled = true - instance_type = "m3.medium.elasticsearch" + instance_type = "t2.small.elasticsearch" } snapshot_options { @@ -1139,7 +1358,7 @@ resource "aws_elasticsearch_domain" "example" { func testAccESDomainConfigV23(randInt int) string { return fmt.Sprintf(` -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" ebs_options { @@ -1194,17 +1413,18 @@ resource "aws_security_group" "second" { vpc_id = "${aws_vpc.elasticsearch_in_vpc.id}" } -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" ebs_options { - ebs_enabled = false + ebs_enabled = true + volume_size = 10 } cluster_config { instance_count = 2 zone_awareness_enabled = true - instance_type = "m3.medium.elasticsearch" + instance_type = "t2.small.elasticsearch" } vpc_options { @@ -1286,17 +1506,18 @@ resource "aws_security_group" "second" { vpc_id = "${aws_vpc.elasticsearch_in_vpc.id}" } -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" ebs_options { - ebs_enabled = false + ebs_enabled = true + volume_size = 10 } cluster_config { instance_count = 2 zone_awareness_enabled = true - instance_type = "m3.medium.elasticsearch" + instance_type = "t2.small.elasticsearch" } vpc_options { @@ -1349,7 +1570,7 @@ resource "aws_security_group" "second" { vpc_id = "${aws_vpc.elasticsearch_in_vpc.id}" } -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" ebs_options { @@ -1360,7 +1581,7 @@ resource "aws_elasticsearch_domain" "example" { cluster_config { instance_count = 2 zone_awareness_enabled = true - instance_type = "t2.micro.elasticsearch" + instance_type = "t2.small.elasticsearch" } vpc_options { @@ -1373,7 +1594,9 @@ resource "aws_elasticsearch_domain" "example" { func testAccESDomainConfig_LogPublishingOptions(randInt int) string { return fmt.Sprintf(` -resource "aws_cloudwatch_log_group" "example" { +data "aws_partition" "current" {} + +resource "aws_cloudwatch_log_group" "test" { name = "tf-test-%d" } @@ -1387,21 +1610,21 @@ resource "aws_cloudwatch_log_resource_policy" "example" { { "Effect": "Allow", "Principal": { - "Service": "es.amazonaws.com" + "Service": "es.${data.aws_partition.current.dns_suffix}" }, "Action": [ "logs:PutLogEvents", "logs:PutLogEventsBatch", "logs:CreateLogStream" ], - "Resource": "arn:aws:logs:*" + "Resource": "arn:${data.aws_partition.current.partition}:logs:*" } ] } CONFIG } -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" ebs_options { @@ -1411,7 +1634,7 @@ resource "aws_elasticsearch_domain" "example" { log_publishing_options { log_type = "INDEX_SLOW_LOGS" - cloudwatch_log_group_arn = "${aws_cloudwatch_log_group.example.arn}" + cloudwatch_log_group_arn = "${aws_cloudwatch_log_group.test.arn}" } } `, randInt, randInt, randInt) @@ -1433,6 +1656,8 @@ func testAccESDomainConfig_CognitoOptions(randInt int, includeCognitoOptions boo } return fmt.Sprintf(` +data "aws_partition" "current" {} + resource "aws_cognito_user_pool" "example" { name = "tf-test-%d" } @@ -1452,7 +1677,7 @@ resource "aws_cognito_identity_pool" "example" { } resource "aws_iam_role" "example" { - name = "tf-test-%d" + name = "tf-test-%d" path = "/service-role/" assume_role_policy = "${data.aws_iam_policy_document.assume-role-policy.json}" } @@ -1462,26 +1687,26 @@ data "aws_iam_policy_document" "assume-role-policy" { sid = "" actions = ["sts:AssumeRole"] effect = "Allow" - + principals { type = "Service" - identifiers = ["es.amazonaws.com"] + identifiers = ["es.${data.aws_partition.current.dns_suffix}"] } } } - + resource "aws_iam_role_policy_attachment" "example" { role = "${aws_iam_role.example.name}" - policy_arn = "arn:aws:iam::aws:policy/AmazonESCognitoAccess" + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/AmazonESCognitoAccess" } -resource "aws_elasticsearch_domain" "example" { +resource "aws_elasticsearch_domain" "test" { domain_name = "tf-test-%d" elasticsearch_version = "6.0" %s - + ebs_options { ebs_enabled = true volume_size = 10 diff --git a/aws/resource_aws_elb.go b/aws/resource_aws_elb.go index 11efaeeb905..3b00f2c844e 100644 --- a/aws/resource_aws_elb.go +++ b/aws/resource_aws_elb.go @@ -18,6 +18,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsElb() *schema.Resource { @@ -271,12 +272,16 @@ func resourceAwsElbCreate(d *schema.ResourceData, meta interface{}) error { d.Set("name", elbName) } - tags := tagsFromMapELB(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().ElbTags() + // Provision the elb elbOpts := &elb.CreateLoadBalancerInput{ LoadBalancerName: aws.String(elbName), Listeners: listeners, - Tags: tags, + } + + if len(tags) > 0 { + elbOpts.Tags = tags } if scheme, ok := d.GetOk("internal"); ok && scheme.(bool) { @@ -302,7 +307,7 @@ func resourceAwsElbCreate(d *schema.ResourceData, meta interface{}) error { if err != nil { if awsErr, ok := err.(awserr.Error); ok { // Check for IAM SSL Cert error, eventual consistancy issue - if awsErr.Code() == "CertificateNotFound" { + if awsErr.Code() == elb.ErrCodeCertificateNotFoundException { return resource.RetryableError( fmt.Errorf("Error creating ELB Listener with SSL Cert, retrying: %s", err)) } @@ -331,7 +336,9 @@ func resourceAwsElbCreate(d *schema.ResourceData, meta interface{}) error { d.SetPartial("security_groups") d.SetPartial("subnets") - d.Set("tags", tagsToMapELB(tags)) + if err := d.Set("tags", keyvaluetags.ElbKeyValueTags(tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return resourceAwsElbUpdate(d, meta) } @@ -447,18 +454,15 @@ func flattenAwsELbResource(d *schema.ResourceData, ec2conn *ec2.EC2, elbconn *el } } - resp, err := elbconn.DescribeTags(&elb.DescribeTagsInput{ - LoadBalancerNames: []*string{lb.LoadBalancerName}, - }) + tags, err := keyvaluetags.ElbListTags(elbconn, d.Id()) + if err != nil { - return fmt.Errorf("error describing tags for ELB (%s): %s", d.Id(), err) + return fmt.Errorf("error listing tags for ELB (%s): %s", d.Id(), err) } - var et []*elb.Tag - if len(resp.TagDescriptions) > 0 { - et = resp.TagDescriptions[0].Tags + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - d.Set("tags", tagsToMapELB(et)) // There's only one health check, so save that to state as we // currently can @@ -515,11 +519,11 @@ func resourceAwsElbUpdate(d *schema.ResourceData, meta interface{}) error { log.Printf("[DEBUG] ELB Create Listeners opts: %s", createListenersOpts) _, err := elbconn.CreateLoadBalancerListeners(createListenersOpts) if err != nil { - if isAWSErr(err, "DuplicateListener", "") { + if isAWSErr(err, elb.ErrCodeDuplicateListenerException, "") { log.Printf("[DEBUG] Duplicate listener found for ELB (%s), retrying", d.Id()) return resource.RetryableError(err) } - if isAWSErr(err, "CertificateNotFound", "Server Certificate not found for the key: arn") { + if isAWSErr(err, elb.ErrCodeCertificateNotFoundException, "Server Certificate not found for the key: arn") { log.Printf("[DEBUG] SSL Cert not found for given ARN, retrying") return resource.RetryableError(err) } @@ -769,7 +773,7 @@ func resourceAwsElbUpdate(d *schema.ResourceData, meta interface{}) error { err := resource.Retry(5*time.Minute, func() *resource.RetryError { _, err := elbconn.AttachLoadBalancerToSubnets(attachOpts) if err != nil { - if isAWSErr(err, "InvalidConfigurationRequest", "cannot be attached to multiple subnets in the same AZ") { + if isAWSErr(err, elb.ErrCodeInvalidConfigurationRequestException, "cannot be attached to multiple subnets in the same AZ") { // eventually consistent issue with removing a subnet in AZ1 and // immediately adding a new one in the same AZ log.Printf("[DEBUG] retrying az association") @@ -790,11 +794,19 @@ func resourceAwsElbUpdate(d *schema.ResourceData, meta interface{}) error { d.SetPartial("subnets") } - if err := setTagsELB(elbconn, d); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.ElbUpdateTags(elbconn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating ELB(%s) tags: %s", d.Id(), err) + } } - d.SetPartial("tags") + //if err := setTagsELB(elbconn, d); err != nil { + // return err + //} + // + //d.SetPartial("tags") d.Partial(false) return resourceAwsElbRead(d, meta) @@ -842,7 +854,7 @@ func resourceAwsElbListenerHash(v interface{}) int { func isLoadBalancerNotFound(err error) bool { elberr, ok := err.(awserr.Error) - return ok && elberr.Code() == "LoadBalancerNotFound" + return ok && elberr.Code() == elb.ErrCodeAccessPointNotFoundException } func sourceSGIdByName(conn *ec2.EC2, sg, vpcId string) (string, error) { diff --git a/aws/resource_aws_elb_test.go b/aws/resource_aws_elb_test.go index 5b28dca04ae..23798e1e516 100644 --- a/aws/resource_aws_elb_test.go +++ b/aws/resource_aws_elb_test.go @@ -80,20 +80,14 @@ func TestAccAWSELB_basic(t *testing.T) { testAccCheckAWSELBExists(resourceName, &conf), testAccCheckAWSELBAttributes(&conf), resource.TestCheckResourceAttrSet(resourceName, "arn"), - resource.TestCheckResourceAttr( - resourceName, "availability_zones.#", "3"), - resource.TestCheckResourceAttr( - resourceName, "subnets.#", "3"), - resource.TestCheckResourceAttr( - resourceName, "listener.206423021.instance_port", "8000"), - resource.TestCheckResourceAttr( - resourceName, "listener.206423021.instance_protocol", "http"), - resource.TestCheckResourceAttr( - resourceName, "listener.206423021.lb_port", "80"), - resource.TestCheckResourceAttr( - resourceName, "listener.206423021.lb_protocol", "http"), - resource.TestCheckResourceAttr( - resourceName, "cross_zone_load_balancing", "true"), + resource.TestCheckResourceAttr(resourceName, "availability_zones.#", "3"), + resource.TestCheckResourceAttr(resourceName, "subnets.#", "3"), + resource.TestCheckResourceAttr(resourceName, "listener.206423021.instance_port", "8000"), + resource.TestCheckResourceAttr(resourceName, "listener.206423021.instance_protocol", "http"), + resource.TestCheckResourceAttr(resourceName, "listener.206423021.lb_port", "80"), + resource.TestCheckResourceAttr(resourceName, "listener.206423021.lb_protocol", "http"), + resource.TestCheckResourceAttr(resourceName, "cross_zone_load_balancing", "true"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -141,8 +135,7 @@ func TestAccAWSELB_fullCharacterRange(t *testing.T) { Config: fmt.Sprintf(testAccAWSELBFullRangeOfCharacters, lbName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSELBExists(resourceName, &conf), - resource.TestCheckResourceAttr( - resourceName, "name", lbName), + resource.TestCheckResourceAttr(resourceName, "name", lbName), ), }, }, @@ -152,7 +145,7 @@ func TestAccAWSELB_fullCharacterRange(t *testing.T) { func TestAccAWSELB_AccessLogs_enabled(t *testing.T) { var conf elb.LoadBalancerDescription resourceName := "aws_elb.test" - rName := fmt.Sprintf("terraform-access-logs-bucket-%d", acctest.RandInt()) + rName := fmt.Sprintf("tf-test-access-logs-%d", acctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -171,14 +164,10 @@ func TestAccAWSELB_AccessLogs_enabled(t *testing.T) { Config: testAccAWSELBAccessLogsOn(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSELBExists(resourceName, &conf), - resource.TestCheckResourceAttr( - resourceName, "access_logs.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "access_logs.0.bucket", rName), - resource.TestCheckResourceAttr( - resourceName, "access_logs.0.interval", "5"), - resource.TestCheckResourceAttr( - resourceName, "access_logs.0.enabled", "true"), + resource.TestCheckResourceAttr(resourceName, "access_logs.#", "1"), + resource.TestCheckResourceAttr(resourceName, "access_logs.0.bucket", rName), + resource.TestCheckResourceAttr(resourceName, "access_logs.0.interval", "5"), + resource.TestCheckResourceAttr(resourceName, "access_logs.0.enabled", "true"), ), }, @@ -186,8 +175,7 @@ func TestAccAWSELB_AccessLogs_enabled(t *testing.T) { Config: testAccAWSELBAccessLogs, Check: resource.ComposeTestCheckFunc( testAccCheckAWSELBExists(resourceName, &conf), - resource.TestCheckResourceAttr( - resourceName, "access_logs.#", "0"), + resource.TestCheckResourceAttr(resourceName, "access_logs.#", "0"), ), }, }, @@ -197,7 +185,7 @@ func TestAccAWSELB_AccessLogs_enabled(t *testing.T) { func TestAccAWSELB_AccessLogs_disabled(t *testing.T) { var conf elb.LoadBalancerDescription resourceName := "aws_elb.test" - rName := fmt.Sprintf("terraform-access-logs-bucket-%d", acctest.RandInt()) + rName := fmt.Sprintf("tf-test-access-logs-%d", acctest.RandInt()) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -211,22 +199,16 @@ func TestAccAWSELB_AccessLogs_disabled(t *testing.T) { testAccCheckAWSELBExists(resourceName, &conf), ), }, - { Config: testAccAWSELBAccessLogsDisabled(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSELBExists(resourceName, &conf), - resource.TestCheckResourceAttr( - resourceName, "access_logs.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "access_logs.0.bucket", rName), - resource.TestCheckResourceAttr( - resourceName, "access_logs.0.interval", "5"), - resource.TestCheckResourceAttr( - resourceName, "access_logs.0.enabled", "false"), + resource.TestCheckResourceAttr(resourceName, "access_logs.#", "1"), + resource.TestCheckResourceAttr(resourceName, "access_logs.0.bucket", rName), + resource.TestCheckResourceAttr(resourceName, "access_logs.0.interval", "5"), + resource.TestCheckResourceAttr(resourceName, "access_logs.0.enabled", "false"), ), }, - { Config: testAccAWSELBAccessLogs, Check: resource.ComposeTestCheckFunc( @@ -254,8 +236,7 @@ func TestAccAWSELB_namePrefix(t *testing.T) { Config: testAccAWSELB_namePrefix, Check: resource.ComposeTestCheckFunc( testAccCheckAWSELBExists(resourceName, &conf), - resource.TestMatchResourceAttr( - resourceName, "name", nameRegex), + resource.TestMatchResourceAttr(resourceName, "name", nameRegex), ), }, }, @@ -277,8 +258,7 @@ func TestAccAWSELB_generatedName(t *testing.T) { Config: testAccAWSELBGeneratedName, Check: resource.ComposeTestCheckFunc( testAccCheckAWSELBExists(resourceName, &conf), - resource.TestMatchResourceAttr( - resourceName, "name", generatedNameRegexp), + resource.TestMatchResourceAttr(resourceName, "name", generatedNameRegexp), ), }, }, @@ -300,8 +280,7 @@ func TestAccAWSELB_generatesNameForZeroValue(t *testing.T) { Config: testAccAWSELB_zeroValueName, Check: resource.ComposeTestCheckFunc( testAccCheckAWSELBExists(resourceName, &conf), - resource.TestMatchResourceAttr( - resourceName, "name", generatedNameRegexp), + resource.TestMatchResourceAttr(resourceName, "name", generatedNameRegexp), ), }, }, @@ -322,8 +301,7 @@ func TestAccAWSELB_availabilityZones(t *testing.T) { Config: testAccAWSELBConfig, Check: resource.ComposeTestCheckFunc( testAccCheckAWSELBExists(resourceName, &conf), - resource.TestCheckResourceAttr( - resourceName, "availability_zones.#", "3"), + resource.TestCheckResourceAttr(resourceName, "availability_zones.#", "3"), ), }, @@ -331,8 +309,7 @@ func TestAccAWSELB_availabilityZones(t *testing.T) { Config: testAccAWSELBConfig_AvailabilityZonesUpdate, Check: resource.ComposeTestCheckFunc( testAccCheckAWSELBExists(resourceName, &conf), - resource.TestCheckResourceAttr( - resourceName, "availability_zones.#", "2"), + resource.TestCheckResourceAttr(resourceName, "availability_zones.#", "2"), ), }, }, @@ -341,7 +318,6 @@ func TestAccAWSELB_availabilityZones(t *testing.T) { func TestAccAWSELB_tags(t *testing.T) { var conf elb.LoadBalancerDescription - var td elb.TagDescription resourceName := "aws_elb.test" resource.ParallelTest(t, resource.TestCase{ @@ -351,23 +327,36 @@ func TestAccAWSELB_tags(t *testing.T) { CheckDestroy: testAccCheckAWSELBDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSELBConfig, + Config: testAccAWSELBConfigTags1("key1", "value1"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSELBExists(resourceName, &conf), testAccCheckAWSELBAttributes(&conf), - testAccLoadTags(&conf, &td), - testAccCheckELBTags(&td.Tags, "test", "test2"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSELBConfigTags2("key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSELBExists(resourceName, &conf), + testAccCheckAWSELBAttributes(&conf), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, - { - Config: testAccAWSELBConfig_TagUpdate, + Config: testAccAWSELBConfigTags1("key2", "value2"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSELBExists(resourceName, &conf), testAccCheckAWSELBAttributes(&conf), - testAccLoadTags(&conf, &td), - testAccCheckELBTags(&td.Tags, "test", "test"), - testAccCheckELBTags(&td.Tags, "new", "type"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, }, @@ -428,8 +417,7 @@ func TestAccAWSELB_swap_subnets(t *testing.T) { Config: testAccAWSELBConfig_subnets, Check: resource.ComposeTestCheckFunc( testAccCheckAWSELBExists(resourceName, &conf), - resource.TestCheckResourceAttr( - resourceName, "subnets.#", "2"), + resource.TestCheckResourceAttr(resourceName, "subnets.#", "2"), ), }, @@ -437,8 +425,7 @@ func TestAccAWSELB_swap_subnets(t *testing.T) { Config: testAccAWSELBConfig_subnet_swap, Check: resource.ComposeTestCheckFunc( testAccCheckAWSELBExists("aws_elb.test", &conf), - resource.TestCheckResourceAttr( - "aws_elb.test", "subnets.#", "2"), + resource.TestCheckResourceAttr("aws_elb.test", "subnets.#", "2"), ), }, }, @@ -611,16 +598,11 @@ func TestAccAWSELB_HealthCheck(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAWSELBExists(resourceName, &conf), testAccCheckAWSELBAttributesHealthCheck(&conf), - resource.TestCheckResourceAttr( - resourceName, "health_check.0.healthy_threshold", "5"), - resource.TestCheckResourceAttr( - resourceName, "health_check.0.unhealthy_threshold", "5"), - resource.TestCheckResourceAttr( - resourceName, "health_check.0.target", "HTTP:8000/"), - resource.TestCheckResourceAttr( - resourceName, "health_check.0.timeout", "30"), - resource.TestCheckResourceAttr( - resourceName, "health_check.0.interval", "60"), + resource.TestCheckResourceAttr(resourceName, "health_check.0.healthy_threshold", "5"), + resource.TestCheckResourceAttr(resourceName, "health_check.0.unhealthy_threshold", "5"), + resource.TestCheckResourceAttr(resourceName, "health_check.0.target", "HTTP:8000/"), + resource.TestCheckResourceAttr(resourceName, "health_check.0.timeout", "30"), + resource.TestCheckResourceAttr(resourceName, "health_check.0.interval", "60"), ), }, }, @@ -646,8 +628,7 @@ func TestAccAWSELBUpdate_HealthCheck(t *testing.T) { { Config: testAccAWSELBConfigHealthCheck_update, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr( - resourceName, "health_check.0.healthy_threshold", "10"), + resource.TestCheckResourceAttr(resourceName, "health_check.0.healthy_threshold", "10"), ), }, }, @@ -668,9 +649,7 @@ func TestAccAWSELB_Timeout(t *testing.T) { Config: testAccAWSELBConfigIdleTimeout, Check: resource.ComposeTestCheckFunc( testAccCheckAWSELBExists(resourceName, &conf), - resource.TestCheckResourceAttr( - resourceName, "idle_timeout", "200", - ), + resource.TestCheckResourceAttr(resourceName, "idle_timeout", "200"), ), }, }, @@ -689,17 +668,13 @@ func TestAccAWSELBUpdate_Timeout(t *testing.T) { { Config: testAccAWSELBConfigIdleTimeout, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr( - resourceName, "idle_timeout", "200", - ), + resource.TestCheckResourceAttr(resourceName, "idle_timeout", "200"), ), }, { Config: testAccAWSELBConfigIdleTimeout_update, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr( - resourceName, "idle_timeout", "400", - ), + resource.TestCheckResourceAttr(resourceName, "idle_timeout", "400"), ), }, }, @@ -721,9 +696,7 @@ func TestAccAWSELB_ConnectionDraining(t *testing.T) { resource.TestCheckResourceAttr( resourceName, "connection_draining", "true", ), - resource.TestCheckResourceAttr( - resourceName, "connection_draining_timeout", "400", - ), + resource.TestCheckResourceAttr(resourceName, "connection_draining_timeout", "400"), ), }, }, @@ -742,31 +715,21 @@ func TestAccAWSELBUpdate_ConnectionDraining(t *testing.T) { { Config: testAccAWSELBConfigConnectionDraining, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr( - resourceName, "connection_draining", "true", - ), - resource.TestCheckResourceAttr( - resourceName, "connection_draining_timeout", "400", - ), + resource.TestCheckResourceAttr(resourceName, "connection_draining", "true"), + resource.TestCheckResourceAttr(resourceName, "connection_draining_timeout", "400"), ), }, { Config: testAccAWSELBConfigConnectionDraining_update_timeout, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr( - resourceName, "connection_draining", "true", - ), - resource.TestCheckResourceAttr( - resourceName, "connection_draining_timeout", "600", - ), + resource.TestCheckResourceAttr(resourceName, "connection_draining", "true"), + resource.TestCheckResourceAttr(resourceName, "connection_draining_timeout", "600"), ), }, { Config: testAccAWSELBConfigConnectionDraining_update_disable, Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr( - resourceName, "connection_draining", "false", - ), + resource.TestCheckResourceAttr(resourceName, "connection_draining", "false"), ), }, }, @@ -786,42 +749,20 @@ func TestAccAWSELB_SecurityGroups(t *testing.T) { Config: testAccAWSELBConfig, Check: resource.ComposeTestCheckFunc( // ELBs get a default security group - resource.TestCheckResourceAttr( - resourceName, "security_groups.#", "1", - ), + resource.TestCheckResourceAttr(resourceName, "security_groups.#", "1"), ), }, { Config: testAccAWSELBConfigSecurityGroups, Check: resource.ComposeTestCheckFunc( // Count should still be one as we swap in a custom security group - resource.TestCheckResourceAttr( - resourceName, "security_groups.#", "1", - ), + resource.TestCheckResourceAttr(resourceName, "security_groups.#", "1"), ), }, }, }) } -func testAccLoadTags(conf *elb.LoadBalancerDescription, td *elb.TagDescription) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).elbconn - - describe, err := conn.DescribeTags(&elb.DescribeTagsInput{ - LoadBalancerNames: []*string{conf.LoadBalancerName}, - }) - - if err != nil { - return err - } - if len(describe.TagDescriptions) > 0 { - *td = *describe.TagDescriptions[0] - } - return nil - } -} - // Unit test for listeners hash func TestResourceAwsElbListenerHash(t *testing.T) { cases := map[string]struct { @@ -1052,7 +993,7 @@ func testAccCheckAWSELBDestroy(s *terraform.State) error { return err } - if providerErr.Code() != "LoadBalancerNotFound" { + if providerErr.Code() != elb.ErrCodeAccessPointNotFoundException { return fmt.Errorf("Unexpected error: %s", err) } } @@ -1178,14 +1119,61 @@ resource "aws_elb" "test" { lb_protocol = "http" } - tags = { - test = "test2" - } - cross_zone_load_balancing = true } ` +func testAccAWSELBConfigTags1(tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "available" { + state = "available" +} + +resource "aws_elb" "test" { + availability_zones = ["${data.aws_availability_zones.available.names[0]}", "${data.aws_availability_zones.available.names[1]}", "${data.aws_availability_zones.available.names[2]}"] + + listener { + instance_port = 8000 + instance_protocol = "http" + lb_port = 80 + lb_protocol = "http" + } + + tags = { + %[1]q = %[2]q + } + + cross_zone_load_balancing = true +} +`, tagKey1, tagValue1) +} + +func testAccAWSELBConfigTags2(tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +data "aws_availability_zones" "available" { + state = "available" +} + +resource "aws_elb" "test" { + availability_zones = ["${data.aws_availability_zones.available.names[0]}", "${data.aws_availability_zones.available.names[1]}", "${data.aws_availability_zones.available.names[2]}"] + + listener { + instance_port = 8000 + instance_protocol = "http" + lb_port = 80 + lb_protocol = "http" + } + + tags = { + %[1]q = %[2]q + %[3]q = %[4]q + } + + cross_zone_load_balancing = true +} +`, tagKey1, tagValue1, tagKey2, tagValue2) +} + const testAccAWSELBFullRangeOfCharacters = ` data "aws_availability_zones" "available" { state = "available" @@ -1222,39 +1210,31 @@ resource "aws_elb" "test" { ` func testAccAWSELBAccessLogsOn(r string) string { - return fmt.Sprintf(` -data "aws_availability_zones" "available" { - state = "available" -} - -data "aws_elb_service_account" "current" {} + return ` +resource "aws_elb" "test" { + availability_zones = ["${data.aws_availability_zones.available.names[0]}", "${data.aws_availability_zones.available.names[1]}", "${data.aws_availability_zones.available.names[2]}"] -data "aws_partition" "current" {} + listener { + instance_port = 8000 + instance_protocol = "http" + lb_port = 80 + lb_protocol = "http" + } -resource "aws_s3_bucket" "acceslogs_bucket" { - bucket = "%s" - acl = "private" - force_destroy = true + access_logs { + interval = 5 + bucket = "${aws_s3_bucket.accesslogs_bucket.bucket}" + } +} - policy = < 0 { - log.Printf("[DEBUG] Removing tags: %s", remove) - k := make([]*string, 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{} diff --git a/aws/resource_aws_emr_cluster_test.go b/aws/resource_aws_emr_cluster_test.go index 1da4a92421c..7b8c0075c05 100644 --- a/aws/resource_aws_emr_cluster_test.go +++ b/aws/resource_aws_emr_cluster_test.go @@ -6,9 +6,11 @@ import ( "reflect" "regexp" "testing" + "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/emr" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" @@ -90,6 +92,7 @@ func TestAccAWSEMRCluster_basic(t *testing.T) { testAccCheckAWSEmrClusterExists("aws_emr_cluster.tf-test-cluster", &cluster), resource.TestCheckResourceAttr("aws_emr_cluster.tf-test-cluster", "scale_down_behavior", "TERMINATE_AT_TASK_COMPLETION"), resource.TestCheckResourceAttr("aws_emr_cluster.tf-test-cluster", "step.#", "0"), + resource.TestCheckResourceAttrSet("aws_emr_cluster.tf-test-cluster", "arn"), ), }, { @@ -128,6 +131,26 @@ func TestAccAWSEMRCluster_additionalInfo(t *testing.T) { }) } +func TestAccAWSEMRCluster_disappears(t *testing.T) { + var cluster emr.Cluster + r := acctest.RandInt() + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfig(r), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists("aws_emr_cluster.tf-test-cluster", &cluster), + testAccCheckAWSEmrClusterDisappears(&cluster), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func TestAccAWSEMRCluster_configurationsJson(t *testing.T) { var cluster emr.Cluster r := acctest.RandInt() @@ -658,6 +681,48 @@ func TestAccAWSEMRCluster_updateAutoScalingPolicy(t *testing.T) { }) } +func TestAccAWSEMRCluster_Ec2Attributes_DefaultManagedSecurityGroups(t *testing.T) { + var cluster emr.Cluster + var vpc ec2.Vpc + + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_emr_cluster.tf-test-cluster" + vpcResourceName := "aws_vpc.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigEc2AttributesDefaultManagedSecurityGroups(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + testAccCheckVpcExists(vpcResourceName, &vpc), + ), + }, + { + Config: testAccAWSEmrClusterConfigEc2AttributesDefaultManagedSecurityGroups(rName), + Destroy: true, + ExpectError: regexp.MustCompile(`DependencyViolation`), + }, + { + PreConfig: func() { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + err := testAccEmrDeleteManagedSecurityGroups(conn, &vpc) + + if err != nil { + t.Fatal(err) + } + }, + Config: testAccAWSEmrClusterConfigEc2AttributesDefaultManagedSecurityGroups(rName), + Destroy: true, + }, + }, + }) +} + func TestAccAWSEMRCluster_Kerberos_ClusterDedicatedKdc(t *testing.T) { var cluster emr.Cluster r := acctest.RandInt() @@ -1341,6 +1406,39 @@ func TestAccAWSEMRCluster_root_volume_size(t *testing.T) { }) } +func TestAccAWSEMRCluster_step_concurrency_level(t *testing.T) { + var cluster emr.Cluster + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_emr_cluster.tf-test-cluster" + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrClusterConfigStepConcurrencyLevel(rName, 2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "step_concurrency_level", "2"), + ), + }, + { + Config: testAccAWSEmrClusterConfigStepConcurrencyLevel(rName, 1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(resourceName, &cluster), + resource.TestCheckResourceAttr(resourceName, "step_concurrency_level", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"configurations", "keep_job_flow_alive_when_no_steps"}, + }, + }, + }) +} + func TestAccAWSEMRCluster_custom_ami_id(t *testing.T) { var cluster emr.Cluster r := acctest.RandInt() @@ -1471,6 +1569,64 @@ func testAccCheckAWSEmrClusterExists(n string, v *emr.Cluster) resource.TestChec } } +func testAccCheckAWSEmrClusterDisappears(cluster *emr.Cluster) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).emrconn + id := aws.StringValue(cluster.Id) + + terminateJobFlowsInput := &emr.TerminateJobFlowsInput{ + JobFlowIds: []*string{cluster.Id}, + } + + _, err := conn.TerminateJobFlows(terminateJobFlowsInput) + + if err != nil { + return err + } + + input := &emr.ListInstancesInput{ + ClusterId: cluster.Id, + } + var output *emr.ListInstancesOutput + var instanceCount int + + err = resource.Retry(20*time.Minute, func() *resource.RetryError { + var err error + output, err = conn.ListInstances(input) + + if err != nil { + return resource.NonRetryableError(err) + } + + instanceCount = countEMRRemainingInstances(output, id) + + if instanceCount != 0 { + return resource.RetryableError(fmt.Errorf("EMR Cluster (%s) has (%d) Instances remaining", id, instanceCount)) + } + + return nil + }) + + if isResourceTimeoutError(err) { + output, err = conn.ListInstances(input) + + if err == nil { + instanceCount = countEMRRemainingInstances(output, id) + } + } + + if instanceCount != 0 { + return fmt.Errorf("EMR Cluster (%s) has (%d) Instances remaining", id, instanceCount) + } + + if err != nil { + return fmt.Errorf("error waiting for EMR Cluster (%s) Instances to drain: %s", id, err) + } + + return nil + } +} + func testAccCheckAWSEmrClusterNotRecreated(i, j *emr.Cluster) resource.TestCheckFunc { return func(s *terraform.State) error { if aws.StringValue(i.Id) != aws.StringValue(j.Id) { @@ -1491,9 +1647,107 @@ func testAccCheckAWSEmrClusterRecreated(i, j *emr.Cluster) resource.TestCheckFun } } +func testAccEmrDeleteManagedSecurityGroups(conn *ec2.EC2, vpc *ec2.Vpc) error { + // Reference: https://docs.aws.amazon.com/emr/latest/ManagementGuide/emr-man-sec-groups.html + managedSecurityGroups := map[string]*ec2.SecurityGroup{ + "ElasticMapReduce-master": nil, + "ElasticMapReduce-slave": nil, + } + + for groupName := range managedSecurityGroups { + securityGroup, err := testAccEmrDescribeManagedSecurityGroup(conn, vpc, groupName) + + if err != nil { + return fmt.Errorf("error describing EMR Managed Security Group (%s): %s", groupName, err) + } + + managedSecurityGroups[groupName] = securityGroup + } + + // EMR Managed Security Groups rules reference each other, so rules from all + // groups must be revoked first. + for groupName, securityGroup := range managedSecurityGroups { + if securityGroup == nil { + continue + } + + err := testAccEmrRevokeManagedSecurityGroup(conn, securityGroup) + + if err != nil { + return fmt.Errorf("error revoking EMR Managed Security Group (%s): %s", groupName, err) + } + } + + for groupName, securityGroup := range managedSecurityGroups { + if securityGroup == nil { + continue + } + + err := testAccEmrDeleteManagedSecurityGroup(conn, securityGroup) + + if err != nil { + return fmt.Errorf("error deleting EMR Managed Security Group (%s): %s", groupName, err) + } + } + + return nil +} + +func testAccEmrDescribeManagedSecurityGroup(conn *ec2.EC2, vpc *ec2.Vpc, securityGroupName string) (*ec2.SecurityGroup, error) { + input := &ec2.DescribeSecurityGroupsInput{ + Filters: []*ec2.Filter{ + { + Name: aws.String("group-name"), + Values: aws.StringSlice([]string{securityGroupName}), + }, + { + Name: aws.String("vpc-id"), + Values: []*string{vpc.VpcId}, + }, + }, + } + + output, err := conn.DescribeSecurityGroups(input) + + if err != nil { + return nil, err + } + + if output == nil || len(output.SecurityGroups) != 1 { + return nil, nil + } + + return output.SecurityGroups[0], nil +} + +func testAccEmrRevokeManagedSecurityGroup(conn *ec2.EC2, securityGroup *ec2.SecurityGroup) error { + input := &ec2.RevokeSecurityGroupIngressInput{ + GroupId: securityGroup.GroupId, + IpPermissions: securityGroup.IpPermissions, + } + + _, err := conn.RevokeSecurityGroupIngress(input) + + return err +} + +func testAccEmrDeleteManagedSecurityGroup(conn *ec2.EC2, securityGroup *ec2.SecurityGroup) error { + input := &ec2.DeleteSecurityGroupInput{ + GroupId: securityGroup.GroupId, + } + + _, err := conn.DeleteSecurityGroup(input) + + return err +} + func testAccAWSEmrClusterConfigBaseVpc(mapPublicIpOnLaunch bool) string { return fmt.Sprintf(` -data "aws_availability_zones" "current" {} +data "aws_availability_zones" "available" { + # Many instance types are not available in this availability zone + blacklisted_zone_ids = ["usw2-az4"] + state = "available" +} resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" @@ -1540,7 +1794,7 @@ resource "aws_security_group" "test" { } resource "aws_subnet" "test" { - availability_zone = "${data.aws_availability_zones.current.names[0]}" + availability_zone = "${data.aws_availability_zones.available.names[0]}" cidr_block = "10.0.0.0/24" map_public_ip_on_launch = %[1]t vpc_id = "${aws_vpc.test.id}" @@ -1567,7 +1821,7 @@ resource "aws_route_table_association" "test" { } func testAccAWSEmrClusterConfig_bootstrap(r string) string { - return fmt.Sprintf(` + return testAccAWSEmrClusterConfigBaseVpc(false) + fmt.Sprintf(` resource "aws_emr_cluster" "test" { name = "%s" release_label = "emr-5.0.0" @@ -1577,12 +1831,12 @@ resource "aws_emr_cluster" "test" { core_instance_type = "c4.large" core_instance_count = 1 service_role = "${aws_iam_role.iam_emr_default_role.arn}" - depends_on = ["aws_main_route_table_association.a"] + depends_on = ["aws_route_table_association.test"] ec2_attributes { - subnet_id = "${aws_subnet.main.id}" - emr_managed_master_security_group = "${aws_security_group.allow_all.id}" - emr_managed_slave_security_group = "${aws_security_group.allow_all.id}" + subnet_id = "${aws_subnet.test.id}" + emr_managed_master_security_group = "${aws_security_group.test.id}" + emr_managed_slave_security_group = "${aws_security_group.test.id}" instance_profile = "${aws_iam_instance_profile.emr_profile.arn}" } @@ -1770,76 +2024,6 @@ resource "aws_iam_policy" "iam_emr_profile_policy" { EOT } -resource "aws_vpc" "main" { - cidr_block = "168.31.0.0/16" - enable_dns_hostnames = true - - tags = { - Name = "terraform-testacc-emr-cluster-bootstrap" - } -} - -resource "aws_subnet" "main" { - vpc_id = "${aws_vpc.main.id}" - cidr_block = "168.31.0.0/20" - - tags = { - Name = "tf-acc-emr-cluster-bootstrap" - } -} - -resource "aws_internet_gateway" "gw" { - vpc_id = "${aws_vpc.main.id}" -} - -resource "aws_route_table" "r" { - vpc_id = "${aws_vpc.main.id}" - - route { - cidr_block = "0.0.0.0/0" - gateway_id = "${aws_internet_gateway.gw.id}" - } -} - -resource "aws_main_route_table_association" "a" { - vpc_id = "${aws_vpc.main.id}" - route_table_id = "${aws_route_table.r.id}" -} - -resource "aws_security_group" "allow_all" { - name = "allow_all" - description = "Allow all inbound traffic" - vpc_id = "${aws_vpc.main.id}" - - ingress { - from_port = 0 - to_port = 0 - protocol = "-1" - self = true - } - - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - - depends_on = ["aws_subnet.main"] - - lifecycle { - ignore_changes = ["ingress", "egress"] - } - - tags = { - Name = "emr_test" - } -} - -output "cluser_id" { - value = "${aws_emr_cluster.test.id}" -} - resource "aws_s3_bucket" "tester" { bucket = "%s" acl = "public-read" @@ -1858,16 +2042,16 @@ EOF } func testAccAWSEmrClusterConfig(r int) string { - return fmt.Sprintf(` + return testAccAWSEmrClusterConfigBaseVpc(false) + fmt.Sprintf(` resource "aws_emr_cluster" "tf-test-cluster" { name = "emr-test-%[1]d" release_label = "emr-4.6.0" applications = ["Spark"] ec2_attributes { - subnet_id = "${aws_subnet.main.id}" - emr_managed_master_security_group = "${aws_security_group.allow_all.id}" - emr_managed_slave_security_group = "${aws_security_group.allow_all.id}" + subnet_id = "${aws_subnet.test.id}" + emr_managed_master_security_group = "${aws_security_group.test.id}" + emr_managed_slave_security_group = "${aws_security_group.test.id}" instance_profile = "${aws_iam_instance_profile.emr_profile.arn}" } @@ -1895,104 +2079,38 @@ resource "aws_emr_cluster" "tf-test-cluster" { configurations = "test-fixtures/emr_configurations.json" - depends_on = ["aws_main_route_table_association.a"] + depends_on = ["aws_route_table_association.test"] service_role = "${aws_iam_role.iam_emr_default_role.arn}" autoscaling_role = "${aws_iam_role.emr-autoscaling-role.arn}" ebs_root_volume_size = 21 } -resource "aws_security_group" "allow_all" { - name = "allow_all_%[1]d" - description = "Allow all inbound traffic" - vpc_id = "${aws_vpc.main.id}" - - ingress { - from_port = 0 - to_port = 0 - protocol = "-1" - self = true - } +### - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } +# IAM things - depends_on = ["aws_subnet.main"] +### - lifecycle { - ignore_changes = ["ingress", "egress"] - } +# IAM role for EMR Service +resource "aws_iam_role" "iam_emr_default_role" { + name = "iam_emr_default_role_%[1]d" - tags = { - Name = "emr_test" - } -} - -resource "aws_vpc" "main" { - cidr_block = "168.31.0.0/16" - enable_dns_hostnames = true - - tags = { - Name = "terraform-testacc-emr-cluster" - } -} - -resource "aws_subnet" "main" { - vpc_id = "${aws_vpc.main.id}" - cidr_block = "168.31.0.0/20" - - tags = { - Name = "tf-acc-emr-cluster" - } -} - -resource "aws_internet_gateway" "gw" { - vpc_id = "${aws_vpc.main.id}" -} - -resource "aws_route_table" "r" { - vpc_id = "${aws_vpc.main.id}" - - route { - cidr_block = "0.0.0.0/0" - gateway_id = "${aws_internet_gateway.gw.id}" - } -} - -resource "aws_main_route_table_association" "a" { - vpc_id = "${aws_vpc.main.id}" - route_table_id = "${aws_route_table.r.id}" -} - -### - -# IAM things - -### - -# IAM role for EMR Service -resource "aws_iam_role" "iam_emr_default_role" { - name = "iam_emr_default_role_%[1]d" - - assume_role_policy = < 0: + configOut, err := flattenConfigurationJson(ig.Configurations) + if err != nil { + return fmt.Errorf("Error reading EMR instance group configurations: %s", err) + } + if err := d.Set("configurations_json", configOut); err != nil { + return fmt.Errorf("Error setting EMR configurations_json for instance group (%s): %s", d.Id(), err) + } + default: + d.Set("configurations_json", "") + } + var autoscalingPolicyString string if ig.AutoScalingPolicy != nil { // AutoScalingPolicy has an additional Status field and null values that are causing a new hashcode to be generated for `instance_group`. @@ -230,15 +286,30 @@ func resourceAwsEMRInstanceGroupUpdate(d *schema.ResourceData, meta interface{}) conn := meta.(*AWSClient).emrconn log.Printf("[DEBUG] Modify EMR task group") - if d.HasChange("instance_count") { - instanceCount := d.Get("instance_count").(int) + if d.HasChange("instance_count") || d.HasChange("configurations_json") { + instanceGroupModifyConfig := emr.InstanceGroupModifyConfig{ + InstanceGroupId: aws.String(d.Id()), + } + if d.HasChange("instance_count") { + instanceCount := d.Get("instance_count").(int) + instanceGroupModifyConfig.InstanceCount = aws.Int64(int64(instanceCount)) + } + if d.HasChange("configurations_json") { + if v, ok := d.GetOk("configurations_json"); ok { + info, err := structure.NormalizeJsonString(v) + if err != nil { + return fmt.Errorf("configurations_json contains an invalid JSON: %s", err) + } + instanceGroupModifyConfig.Configurations, err = expandConfigurationJson(info) + if err != nil { + return fmt.Errorf("Error reading EMR configurations_json: %s", err) + } + } + } params := &emr.ModifyInstanceGroupsInput{ InstanceGroups: []*emr.InstanceGroupModifyConfig{ - { - InstanceGroupId: aws.String(d.Id()), - InstanceCount: aws.Int64(int64(instanceCount)), - }, + &instanceGroupModifyConfig, }, } @@ -247,20 +318,7 @@ func resourceAwsEMRInstanceGroupUpdate(d *schema.ResourceData, meta interface{}) return fmt.Errorf("error modifying EMR Instance Group (%s): %s", d.Id(), err) } - stateConf := &resource.StateChangeConf{ - Pending: []string{ - emr.InstanceGroupStateBootstrapping, - emr.InstanceGroupStateProvisioning, - emr.InstanceGroupStateResizing, - }, - Target: []string{emr.InstanceGroupStateRunning}, - Refresh: instanceGroupStateRefresh(conn, d.Get("cluster_id").(string), d.Id()), - Timeout: 10 * time.Minute, - Delay: 10 * time.Second, - MinTimeout: 3 * time.Second, - } - - if _, err := stateConf.WaitForState(); err != nil { + if err := waitForEmrInstanceGroupStateRunning(conn, d.Get("cluster_id").(string), d.Id(), emrInstanceGroupUpdateTimeout); err != nil { return fmt.Errorf("error waiting for EMR Instance Group (%s) modification: %s", d.Id(), err) } } @@ -424,3 +482,23 @@ func marshalWithoutNil(v interface{}) ([]byte, error) { return json.Marshal(cleanRules) } + +func waitForEmrInstanceGroupStateRunning(conn *emr.EMR, clusterID string, instanceGroupID string, timeout time.Duration) error { + stateConf := &resource.StateChangeConf{ + Pending: []string{ + emr.InstanceGroupStateBootstrapping, + emr.InstanceGroupStateProvisioning, + emr.InstanceGroupStateReconfiguring, + emr.InstanceGroupStateResizing, + }, + Target: []string{emr.InstanceGroupStateRunning}, + Refresh: instanceGroupStateRefresh(conn, clusterID, instanceGroupID), + Timeout: timeout, + Delay: 10 * time.Second, + MinTimeout: 3 * time.Second, + } + + _, err := stateConf.WaitForState() + + return err +} diff --git a/aws/resource_aws_emr_instance_group_test.go b/aws/resource_aws_emr_instance_group_test.go index 2a68e8ef1ce..7de2a8a3371 100644 --- a/aws/resource_aws_emr_instance_group_test.go +++ b/aws/resource_aws_emr_instance_group_test.go @@ -91,6 +91,46 @@ func TestAccAWSEMRInstanceGroup_BidPrice(t *testing.T) { }) } +func TestAccAWSEMRInstanceGroup_ConfigurationsJson(t *testing.T) { + var ig emr.InstanceGroup + rInt := acctest.RandInt() + + resourceName := "aws_emr_instance_group.task" + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrInstanceGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrInstanceGroupConfig_ConfigurationsJson(rInt, "partitionName1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrInstanceGroupExists(resourceName, &ig), + resource.TestCheckResourceAttrSet(resourceName, "configurations_json"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEMRInstanceGroupResourceImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + { + Config: testAccAWSEmrInstanceGroupConfig_ConfigurationsJson(rInt, "partitionName2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrInstanceGroupExists(resourceName, &ig), + resource.TestCheckResourceAttrSet(resourceName, "configurations_json"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSEMRInstanceGroupResourceImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, + }, + }) +} + func TestAccAWSEMRInstanceGroup_AutoScalingPolicy(t *testing.T) { var ig emr.InstanceGroup rInt := acctest.RandInt() @@ -161,6 +201,32 @@ func TestAccAWSEMRInstanceGroup_InstanceCount(t *testing.T) { }) } +// Regression test for https://github.com/terraform-providers/terraform-provider-aws/issues/1355 +func TestAccAWSEMRInstanceGroup_EmrClusterDisappears(t *testing.T) { + var cluster emr.Cluster + var ig emr.InstanceGroup + rInt := acctest.RandInt() + emrClusterResourceName := "aws_emr_cluster.tf-test-cluster" + resourceName := "aws_emr_instance_group.task" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSEmrInstanceGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSEmrInstanceGroupConfig_basic(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSEmrClusterExists(emrClusterResourceName, &cluster), + testAccCheckAWSEmrInstanceGroupExists(resourceName, &ig), + testAccCheckAWSEmrClusterDisappears(&cluster), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func TestAccAWSEMRInstanceGroup_EbsConfig_EbsOptimized(t *testing.T) { var ig emr.InstanceGroup rInt := acctest.RandInt() @@ -276,6 +342,14 @@ func testAccAWSEMRInstanceGroupRecreated(t *testing.T, before, after *emr.Instan } const testAccAWSEmrInstanceGroupBase = ` +data "aws_availability_zones" "available" { + # Many instance types are not available in this availability zone + blacklisted_zone_ids = ["usw2-az4"] + state = "available" +} + +data "aws_partition" "current" {} + resource "aws_security_group" "allow_all" { name = "allow_all" description = "Allow all inbound traffic" @@ -308,8 +382,9 @@ resource "aws_vpc" "main" { } resource "aws_subnet" "main" { - vpc_id = "${aws_vpc.main.id}" - cidr_block = "168.31.0.0/20" + availability_zone = data.aws_availability_zones.available.names[0] + cidr_block = "168.31.0.0/20" + vpc_id = aws_vpc.main.id } resource "aws_internet_gateway" "gw" { @@ -332,37 +407,31 @@ resource "aws_main_route_table_association" "a" { ## EMR Cluster Configuration resource "aws_emr_cluster" "tf-test-cluster" { - name = "tf-test-emr-%[1]d" - release_label = "emr-4.6.0" - applications = ["Spark"] + applications = ["Spark"] + autoscaling_role = aws_iam_role.emr-autoscaling-role.arn + configurations = "test-fixtures/emr_configurations.json" + keep_job_flow_alive_when_no_steps = true + name = "tf-test-emr-%[1]d" + release_label = "emr-5.26.0" + service_role = aws_iam_role.iam_emr_default_role.arn ec2_attributes { - subnet_id = "${aws_subnet.main.id}" - emr_managed_master_security_group = "${aws_security_group.allow_all.id}" - emr_managed_slave_security_group = "${aws_security_group.allow_all.id}" - instance_profile = "${aws_iam_instance_profile.emr_profile.arn}" + subnet_id = aws_subnet.main.id + emr_managed_master_security_group = aws_security_group.allow_all.id + emr_managed_slave_security_group = aws_security_group.allow_all.id + instance_profile = aws_iam_instance_profile.emr_profile.arn } master_instance_group { - instance_type = "c4.large" - } + instance_type = "c4.large" + } core_instance_group { - instance_type = "c4.large" - instance_count = 2 - } - - bootstrap_action { - path = "s3://elasticmapreduce/bootstrap-actions/run-if" - name = "runif" - args = ["instance.isMaster=true", "echo running on master node"] + instance_type = "c4.large" + instance_count = 2 } - configurations = "test-fixtures/emr_configurations.json" - service_role = "${aws_iam_role.iam_emr_default_role.arn}" - autoscaling_role = "${aws_iam_role.emr-autoscaling-role.arn}" - - depends_on = ["aws_internet_gateway.gw"] + depends_on = [aws_internet_gateway.gw] } @@ -380,7 +449,7 @@ resource "aws_iam_role" "iam_emr_default_role" { "Sid": "", "Effect": "Allow", "Principal": { - "Service": "elasticmapreduce.amazonaws.com" + "Service": "elasticmapreduce.${data.aws_partition.current.dns_suffix}" }, "Action": "sts:AssumeRole" } @@ -475,7 +544,7 @@ resource "aws_iam_role" "iam_emr_profile_role" { "Sid": "", "Effect": "Allow", "Principal": { - "Service": "ec2.amazonaws.com" + "Service": "ec2.${data.aws_partition.current.dns_suffix}" }, "Action": "sts:AssumeRole" } @@ -544,14 +613,14 @@ data "aws_iam_policy_document" "emr-autoscaling-role-policy" { actions = ["sts:AssumeRole"] principals { type = "Service" - identifiers = ["elasticmapreduce.amazonaws.com","application-autoscaling.amazonaws.com"] + identifiers = ["elasticmapreduce.${data.aws_partition.current.dns_suffix}","application-autoscaling.${data.aws_partition.current.dns_suffix}"] } } } resource "aws_iam_role_policy_attachment" "emr-autoscaling-role" { role = "${aws_iam_role.emr-autoscaling-role.name}" - policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonElasticMapReduceforAutoScalingRole" + policy_arn = "arn:${data.aws_partition.current.partition}:iam::aws:policy/service-role/AmazonElasticMapReduceforAutoScalingRole" } ` @@ -576,6 +645,27 @@ func testAccAWSEmrInstanceGroupConfig_BidPrice(r int) string { `, r) } +func testAccAWSEmrInstanceGroupConfig_ConfigurationsJson(r int, name string) string { + return fmt.Sprintf(testAccAWSEmrInstanceGroupBase+` + resource "aws_emr_instance_group" "task" { + cluster_id = "${aws_emr_cluster.tf-test-cluster.id}" + instance_count = 1 + instance_type = "c4.large" + configurations_json = < 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") @@ -410,8 +300,8 @@ func getGlacierVaultNotification(glacierconn *glacier.Glacier, vaultName string) log.Print("[DEBUG] Flattening Glacier Vault Notifications") - notifications["events"] = schema.NewSet(schema.HashString, glacierPointersToStringList(response.VaultNotificationConfig.Events)) - notifications["sns_topic"] = *response.VaultNotificationConfig.SNSTopic + notifications["events"] = aws.StringValueSlice(response.VaultNotificationConfig.Events) + notifications["sns_topic"] = aws.StringValue(response.VaultNotificationConfig.SNSTopic) return []map[string]interface{}{notifications}, nil } diff --git a/aws/resource_aws_glacier_vault_test.go b/aws/resource_aws_glacier_vault_test.go index e376f200418..e97a630f973 100644 --- a/aws/resource_aws_glacier_vault_test.go +++ b/aws/resource_aws_glacier_vault_test.go @@ -2,13 +2,11 @@ package aws import ( "fmt" - "reflect" "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/glacier" - "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" @@ -93,57 +91,6 @@ func TestAccAWSGlacierVault_RemoveNotifications(t *testing.T) { }) } -func TestDiffGlacierVaultTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create map[string]string - Remove []string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: []string{ - "foo", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: []string{ - "foo", - }, - }, - } - - for i, tc := range cases { - c, r := diffGlacierVaultTags(mapGlacierVaultTags(tc.Old), mapGlacierVaultTags(tc.New)) - - if !reflect.DeepEqual(c, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, c) - } - if !reflect.DeepEqual(r, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, r) - } - } -} - func testAccCheckGlacierVaultExists(name string) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[name] diff --git a/aws/resource_aws_globalaccelerator_accelerator.go b/aws/resource_aws_globalaccelerator_accelerator.go index 33fa7797ab6..56e54d022f7 100644 --- a/aws/resource_aws_globalaccelerator_accelerator.go +++ b/aws/resource_aws_globalaccelerator_accelerator.go @@ -13,6 +13,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) +// Global Route53 Zone ID for Global Accelerators, exported as a +// convenience attribute for Route53 aliases (see +// https://docs.aws.amazon.com/Route53/latest/APIReference/API_AliasTarget.html). +const globalAcceleratorRoute53ZoneID = "Z2BJ6XQ5FK7U4H" + func resourceAwsGlobalAcceleratorAccelerator() *schema.Resource { return &schema.Resource{ Create: resourceAwsGlobalAcceleratorAcceleratorCreate, @@ -42,6 +47,14 @@ func resourceAwsGlobalAcceleratorAccelerator() *schema.Resource { Optional: true, Default: true, }, + "dns_name": { + Type: schema.TypeString, + Computed: true, + }, + "hosted_zone_id": { + Type: schema.TypeString, + Computed: true, + }, "ip_sets": { Type: schema.TypeList, Computed: true, @@ -113,7 +126,7 @@ func resourceAwsGlobalAcceleratorAcceleratorCreate(d *schema.ResourceData, meta d.SetId(*resp.Accelerator.AcceleratorArn) - err = resourceAwsGlobalAcceleratorAcceleratorWaitForState(conn, d.Id()) + err = resourceAwsGlobalAcceleratorAcceleratorWaitForDeployedState(conn, d.Id()) if err != nil { return err } @@ -146,6 +159,8 @@ func resourceAwsGlobalAcceleratorAcceleratorRead(d *schema.ResourceData, meta in d.Set("name", accelerator.Name) d.Set("ip_address_type", accelerator.IpAddressType) d.Set("enabled", accelerator.Enabled) + d.Set("dns_name", accelerator.DnsName) + d.Set("hosted_zone_id", globalAcceleratorRoute53ZoneID) if err := d.Set("ip_sets", resourceAwsGlobalAcceleratorAcceleratorFlattenIpSets(accelerator.IpSets)); err != nil { return fmt.Errorf("Error setting Global Accelerator accelerator ip_sets: %s", err) } @@ -258,7 +273,7 @@ func resourceAwsGlobalAcceleratorAcceleratorUpdate(d *schema.ResourceData, meta d.SetPartial("ip_address_type") d.SetPartial("enabled") - err = resourceAwsGlobalAcceleratorAcceleratorWaitForState(conn, d.Id()) + err = resourceAwsGlobalAcceleratorAcceleratorWaitForDeployedState(conn, d.Id()) if err != nil { return err } @@ -281,7 +296,7 @@ func resourceAwsGlobalAcceleratorAcceleratorUpdate(d *schema.ResourceData, meta return resourceAwsGlobalAcceleratorAcceleratorRead(d, meta) } -func resourceAwsGlobalAcceleratorAcceleratorWaitForState(conn *globalaccelerator.GlobalAccelerator, acceleratorArn string) error { +func resourceAwsGlobalAcceleratorAcceleratorWaitForDeployedState(conn *globalaccelerator.GlobalAccelerator, acceleratorArn string) error { stateConf := &resource.StateChangeConf{ Pending: []string{globalaccelerator.AcceleratorStatusInProgress}, Target: []string{globalaccelerator.AcceleratorStatusDeployed}, @@ -338,7 +353,7 @@ func resourceAwsGlobalAcceleratorAcceleratorDelete(d *schema.ResourceData, meta return fmt.Errorf("Error disabling Global Accelerator accelerator: %s", err) } - err = resourceAwsGlobalAcceleratorAcceleratorWaitForState(conn, d.Id()) + err = resourceAwsGlobalAcceleratorAcceleratorWaitForDeployedState(conn, d.Id()) if err != nil { return err } diff --git a/aws/resource_aws_globalaccelerator_accelerator_test.go b/aws/resource_aws_globalaccelerator_accelerator_test.go index d7f1e87fdad..a631a5cfbeb 100644 --- a/aws/resource_aws_globalaccelerator_accelerator_test.go +++ b/aws/resource_aws_globalaccelerator_accelerator_test.go @@ -2,18 +2,179 @@ package aws import ( "fmt" + "log" "regexp" "testing" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/globalaccelerator" + "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) +func init() { + resource.AddTestSweepers("aws_globalaccelerator_accelerator", &resource.Sweeper{ + Name: "aws_globalaccelerator_accelerator", + F: testSweepGlobalAcceleratorAccelerators, + }) +} + +func testSweepGlobalAcceleratorAccelerators(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("Error getting client: %s", err) + } + conn := client.(*AWSClient).globalacceleratorconn + + input := &globalaccelerator.ListAcceleratorsInput{} + var sweeperErrs *multierror.Error + + for { + output, err := conn.ListAccelerators(input) + + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping Global Accelerator Accelerator sweep for %s: %s", region, err) + return nil + } + + if err != nil { + return fmt.Errorf("Error retrieving Global Accelerator Accelerators: %s", err) + } + + for _, accelerator := range output.Accelerators { + arn := aws.StringValue(accelerator.AcceleratorArn) + + errs := sweepGlobalAcceleratorListeners(conn, accelerator.AcceleratorArn) + if errs != nil { + sweeperErrs = multierror.Append(sweeperErrs, errs) + } + + if aws.BoolValue(accelerator.Enabled) { + input := &globalaccelerator.UpdateAcceleratorInput{ + AcceleratorArn: accelerator.AcceleratorArn, + Enabled: aws.Bool(false), + } + + log.Printf("[INFO] Disabling Global Accelerator Accelerator: %s", arn) + + _, err := conn.UpdateAccelerator(input) + + if err != nil { + sweeperErr := fmt.Errorf("error disabling Global Accelerator Accelerator (%s): %s", arn, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue + } + } + + // Global Accelerator accelerators need to be in `DEPLOYED` state before they can be deleted. + // Removing listeners or disabling can both set the state to `IN_PROGRESS`. + if err := resourceAwsGlobalAcceleratorAcceleratorWaitForDeployedState(conn, arn); err != nil { + sweeperErr := fmt.Errorf("error waiting for Global Accelerator Accelerator (%s): %s", arn, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue + } + + input := &globalaccelerator.DeleteAcceleratorInput{ + AcceleratorArn: accelerator.AcceleratorArn, + } + + log.Printf("[INFO] Deleting Global Accelerator Accelerator: %s", arn) + _, err := conn.DeleteAccelerator(input) + + if err != nil { + sweeperErr := fmt.Errorf("error deleting Global Accelerator Accelerator (%s): %s", arn, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue + } + } + + if aws.StringValue(output.NextToken) == "" { + break + } + + input.NextToken = output.NextToken + } + + return sweeperErrs.ErrorOrNil() +} + +func sweepGlobalAcceleratorListeners(conn *globalaccelerator.GlobalAccelerator, acceleratorArn *string) *multierror.Error { + var sweeperErrs *multierror.Error + + log.Printf("[INFO] deleting Listeners for Accelerator %s", *acceleratorArn) + listenersInput := &globalaccelerator.ListListenersInput{ + AcceleratorArn: acceleratorArn, + } + listenersOutput, err := conn.ListListeners(listenersInput) + if err != nil { + sweeperErr := fmt.Errorf("error listing Global Accelerator Listeners for Accelerator (%s): %s", *acceleratorArn, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + } + + for _, listener := range listenersOutput.Listeners { + errs := sweepGlobalAcceleratorEndpointGroups(conn, listener.ListenerArn) + if errs != nil { + sweeperErrs = multierror.Append(sweeperErrs, errs) + } + + input := &globalaccelerator.DeleteListenerInput{ + ListenerArn: listener.ListenerArn, + } + _, err := conn.DeleteListener(input) + + if err != nil { + sweeperErr := fmt.Errorf("error deleting Global Accelerator listener (%s): %s", *listener.ListenerArn, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue + } + } + + return sweeperErrs +} + +func sweepGlobalAcceleratorEndpointGroups(conn *globalaccelerator.GlobalAccelerator, listenerArn *string) *multierror.Error { + var sweeperErrs *multierror.Error + + log.Printf("[INFO] deleting Endpoint Groups for Listener %s", *listenerArn) + input := &globalaccelerator.ListEndpointGroupsInput{ + ListenerArn: listenerArn, + } + output, err := conn.ListEndpointGroups(input) + if err != nil { + sweeperErr := fmt.Errorf("error listing Global Accelerator Endpoint Groups for Listener (%s): %s", *listenerArn, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + } + + for _, endpoint := range output.EndpointGroups { + input := &globalaccelerator.DeleteEndpointGroupInput{ + EndpointGroupArn: endpoint.EndpointGroupArn, + } + _, err := conn.DeleteEndpointGroup(input) + + if err != nil { + sweeperErr := fmt.Errorf("error deleting Global Accelerator endpoint group (%s): %s", *endpoint.EndpointGroupArn, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue + } + } + + return sweeperErrs +} + func TestAccAwsGlobalAcceleratorAccelerator_basic(t *testing.T) { resourceName := "aws_globalaccelerator_accelerator.example" rName := acctest.RandomWithPrefix("tf-acc-test") ipRegex := regexp.MustCompile(`\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}`) + dnsNameRegex := regexp.MustCompile(`^a[a-f0-9]{16}\.awsglobalaccelerator\.com$`) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -31,6 +192,8 @@ func TestAccAwsGlobalAcceleratorAccelerator_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "attributes.0.flow_logs_enabled", "false"), resource.TestCheckResourceAttr(resourceName, "attributes.0.flow_logs_s3_bucket", ""), resource.TestCheckResourceAttr(resourceName, "attributes.0.flow_logs_s3_prefix", ""), + resource.TestMatchResourceAttr(resourceName, "dns_name", dnsNameRegex), + resource.TestCheckResourceAttr(resourceName, "hosted_zone_id", "Z2BJ6XQ5FK7U4H"), resource.TestCheckResourceAttr(resourceName, "ip_sets.#", "1"), resource.TestCheckResourceAttr(resourceName, "ip_sets.0.ip_addresses.#", "2"), resource.TestMatchResourceAttr(resourceName, "ip_sets.0.ip_addresses.0", ipRegex), @@ -170,7 +333,7 @@ resource "aws_globalaccelerator_accelerator" "example" { func testAccGlobalAcceleratorAccelerator_attributes(rName string) string { return fmt.Sprintf(` resource "aws_s3_bucket" "example" { - bucket_prefix = "tf-globalaccelerator-accelerator-" + bucket_prefix = "tf-test-globalaccelerator-" } resource "aws_globalaccelerator_accelerator" "example" { diff --git a/aws/resource_aws_globalaccelerator_endpoint_group.go b/aws/resource_aws_globalaccelerator_endpoint_group.go index 5aa50b2af01..8135367fbe4 100644 --- a/aws/resource_aws_globalaccelerator_endpoint_group.go +++ b/aws/resource_aws_globalaccelerator_endpoint_group.go @@ -128,8 +128,8 @@ func resourceAwsGlobalAcceleratorEndpointGroupCreate(d *schema.ResourceData, met opts.ThresholdCount = aws.Int64(int64(v.(int))) } - if v, ok := d.GetOk("traffic_dial_percentage"); ok { - opts.TrafficDialPercentage = aws.Float64(v.(float64)) + if v, ok := d.Get("traffic_dial_percentage").(float64); ok { + opts.TrafficDialPercentage = aws.Float64(v) } if v, ok := d.GetOk("endpoint_configuration"); ok { @@ -151,7 +151,7 @@ func resourceAwsGlobalAcceleratorEndpointGroupCreate(d *schema.ResourceData, met return err } - err = resourceAwsGlobalAcceleratorAcceleratorWaitForState(conn, acceleratorArn) + err = resourceAwsGlobalAcceleratorAcceleratorWaitForDeployedState(conn, acceleratorArn) if err != nil { return err @@ -279,8 +279,8 @@ func resourceAwsGlobalAcceleratorEndpointGroupUpdate(d *schema.ResourceData, met opts.ThresholdCount = aws.Int64(int64(v.(int))) } - if v, ok := d.GetOk("traffic_dial_percentage"); ok { - opts.TrafficDialPercentage = aws.Float64(v.(float64)) + if v, ok := d.Get("traffic_dial_percentage").(float64); ok { + opts.TrafficDialPercentage = aws.Float64(v) } if v, ok := d.GetOk("endpoint_configuration"); ok { @@ -302,7 +302,7 @@ func resourceAwsGlobalAcceleratorEndpointGroupUpdate(d *schema.ResourceData, met return err } - err = resourceAwsGlobalAcceleratorAcceleratorWaitForState(conn, acceleratorArn) + err = resourceAwsGlobalAcceleratorAcceleratorWaitForDeployedState(conn, acceleratorArn) if err != nil { return err @@ -332,7 +332,7 @@ func resourceAwsGlobalAcceleratorEndpointGroupDelete(d *schema.ResourceData, met return err } - err = resourceAwsGlobalAcceleratorAcceleratorWaitForState(conn, acceleratorArn) + err = resourceAwsGlobalAcceleratorAcceleratorWaitForDeployedState(conn, acceleratorArn) if err != nil { return err diff --git a/aws/resource_aws_globalaccelerator_endpoint_group_test.go b/aws/resource_aws_globalaccelerator_endpoint_group_test.go index 8a7d777faf7..5351b401949 100644 --- a/aws/resource_aws_globalaccelerator_endpoint_group_test.go +++ b/aws/resource_aws_globalaccelerator_endpoint_group_test.go @@ -61,7 +61,7 @@ func TestAccAwsGlobalAcceleratorEndpointGroup_update(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "health_check_port", "8080"), resource.TestCheckResourceAttr(resourceName, "health_check_protocol", "HTTPS"), resource.TestCheckResourceAttr(resourceName, "threshold_count", "1"), - resource.TestCheckResourceAttr(resourceName, "traffic_dial_percentage", "50"), + resource.TestCheckResourceAttr(resourceName, "traffic_dial_percentage", "0"), resource.TestCheckResourceAttr(resourceName, "endpoint_configuration.#", "1"), ), }, @@ -197,7 +197,7 @@ resource "aws_globalaccelerator_endpoint_group" "example" { health_check_port = 8080 health_check_protocol = "HTTPS" threshold_count = 1 - traffic_dial_percentage = 50 + traffic_dial_percentage = 0 } `, rInt) } diff --git a/aws/resource_aws_globalaccelerator_listener.go b/aws/resource_aws_globalaccelerator_listener.go index 4eee7cc5b18..369bdd71740 100644 --- a/aws/resource_aws_globalaccelerator_listener.go +++ b/aws/resource_aws_globalaccelerator_listener.go @@ -212,17 +212,9 @@ func resourceAwsGlobalAcceleratorListenerUpdate(d *schema.ResourceData, meta int } // Creating a listener triggers the accelerator to change status to InPending - stateConf := &resource.StateChangeConf{ - Pending: []string{globalaccelerator.AcceleratorStatusInProgress}, - Target: []string{globalaccelerator.AcceleratorStatusDeployed}, - Refresh: resourceAwsGlobalAcceleratorAcceleratorStateRefreshFunc(conn, d.Get("accelerator_arn").(string)), - Timeout: 5 * time.Minute, - } - - log.Printf("[DEBUG] Waiting for Global Accelerator listener (%s) availability", d.Id()) - _, err = stateConf.WaitForState() + err = resourceAwsGlobalAcceleratorAcceleratorWaitForDeployedState(conn, d.Get("accelerator_arn").(string)) if err != nil { - return fmt.Errorf("Error waiting for Global Accelerator listener (%s) availability: %s", d.Id(), err) + return err } return resourceAwsGlobalAcceleratorListenerRead(d, meta) @@ -244,17 +236,10 @@ func resourceAwsGlobalAcceleratorListenerDelete(d *schema.ResourceData, meta int } // Deleting a listener triggers the accelerator to change status to InPending - stateConf := &resource.StateChangeConf{ - Pending: []string{globalaccelerator.AcceleratorStatusInProgress}, - Target: []string{globalaccelerator.AcceleratorStatusDeployed}, - Refresh: resourceAwsGlobalAcceleratorAcceleratorStateRefreshFunc(conn, d.Get("accelerator_arn").(string)), - Timeout: 5 * time.Minute, - } - - log.Printf("[DEBUG] Waiting for Global Accelerator listener (%s) deletion", d.Id()) - _, err = stateConf.WaitForState() + // } + err = resourceAwsGlobalAcceleratorAcceleratorWaitForDeployedState(conn, d.Get("accelerator_arn").(string)) if err != nil { - return fmt.Errorf("Error waiting for Global Accelerator listener (%s) deletion: %s", d.Id(), err) + return err } return nil diff --git a/aws/resource_aws_glue_classifier.go b/aws/resource_aws_glue_classifier.go index 94a32e6e578..06d2335398f 100644 --- a/aws/resource_aws_glue_classifier.go +++ b/aws/resource_aws_glue_classifier.go @@ -24,6 +24,18 @@ func resourceAwsGlueClassifier() *schema.Resource { func(diff *schema.ResourceDiff, v interface{}) error { // ForceNew when changing classifier type // InvalidInputException: UpdateClassifierRequest can't change the type of the classifier + if diff.HasChange("csv_classifier") && diff.HasChange("grok_classifier") { + diff.ForceNew("csv_classifier") + diff.ForceNew("grok_classifier") + } + if diff.HasChange("csv_classifier") && diff.HasChange("json_classifier") { + diff.ForceNew("csv_classifier") + diff.ForceNew("json_classifier") + } + if diff.HasChange("csv_classifier") && diff.HasChange("xml_classifier") { + diff.ForceNew("csv_classifier") + diff.ForceNew("xml_classifier") + } if diff.HasChange("grok_classifier") && diff.HasChange("json_classifier") { diff.ForceNew("grok_classifier") diff.ForceNew("json_classifier") @@ -41,11 +53,47 @@ func resourceAwsGlueClassifier() *schema.Resource { ), Schema: map[string]*schema.Schema{ + "csv_classifier": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + ConflictsWith: []string{"grok_classifier", "json_classifier", "xml_classifier"}, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "allow_single_column": { + Type: schema.TypeBool, + Optional: true, + }, + "contains_header": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validateHeaderOptions(), + }, + "delimiter": { + Type: schema.TypeString, + Optional: true, + }, + "disable_value_trimming": { + Type: schema.TypeBool, + Optional: true, + }, + "header": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "quote_symbol": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, "grok_classifier": { Type: schema.TypeList, Optional: true, MaxItems: 1, - ConflictsWith: []string{"json_classifier", "xml_classifier"}, + ConflictsWith: []string{"csv_classifier", "json_classifier", "xml_classifier"}, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "classification": { @@ -69,7 +117,7 @@ func resourceAwsGlueClassifier() *schema.Resource { Type: schema.TypeList, Optional: true, MaxItems: 1, - ConflictsWith: []string{"grok_classifier", "xml_classifier"}, + ConflictsWith: []string{"csv_classifier", "grok_classifier", "xml_classifier"}, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "json_path": { @@ -89,7 +137,7 @@ func resourceAwsGlueClassifier() *schema.Resource { Type: schema.TypeList, Optional: true, MaxItems: 1, - ConflictsWith: []string{"grok_classifier", "json_classifier"}, + ConflictsWith: []string{"csv_classifier", "grok_classifier", "json_classifier"}, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "classification": { @@ -113,6 +161,11 @@ func resourceAwsGlueClassifierCreate(d *schema.ResourceData, meta interface{}) e input := &glue.CreateClassifierInput{} + if v, ok := d.GetOk("csv_classifier"); ok { + m := v.([]interface{})[0].(map[string]interface{}) + input.CsvClassifier = expandGlueCsvClassifierCreate(name, m) + } + if v, ok := d.GetOk("grok_classifier"); ok { m := v.([]interface{})[0].(map[string]interface{}) input.GrokClassifier = expandGlueGrokClassifierCreate(name, m) @@ -164,6 +217,10 @@ func resourceAwsGlueClassifierRead(d *schema.ResourceData, meta interface{}) err return nil } + if err := d.Set("csv_classifier", flattenGlueCsvClassifier(classifier.CsvClassifier)); err != nil { + return fmt.Errorf("error setting match_criteria: %s", err) + } + if err := d.Set("grok_classifier", flattenGlueGrokClassifier(classifier.GrokClassifier)); err != nil { return fmt.Errorf("error setting match_criteria: %s", err) } @@ -186,6 +243,11 @@ func resourceAwsGlueClassifierUpdate(d *schema.ResourceData, meta interface{}) e input := &glue.UpdateClassifierInput{} + if v, ok := d.GetOk("csv_classifier"); ok { + m := v.([]interface{})[0].(map[string]interface{}) + input.CsvClassifier = expandGlueCsvClassifierUpdate(d.Id(), m) + } + if v, ok := d.GetOk("grok_classifier"); ok { m := v.([]interface{})[0].(map[string]interface{}) input.GrokClassifier = expandGlueGrokClassifierUpdate(d.Id(), m) @@ -222,6 +284,14 @@ func resourceAwsGlueClassifierDelete(d *schema.ResourceData, meta interface{}) e return nil } +func validateHeaderOptions() schema.SchemaValidateFunc { + return validation.StringInSlice([]string{ + "UNKNOWN", + "PRESENT", + "ABSENT", + }, true) +} + func deleteGlueClassifier(conn *glue.Glue, name string) error { input := &glue.DeleteClassifierInput{ Name: aws.String(name), @@ -238,6 +308,48 @@ func deleteGlueClassifier(conn *glue.Glue, name string) error { return nil } +func expandGlueCsvClassifierCreate(name string, m map[string]interface{}) *glue.CreateCsvClassifierRequest { + csvClassifier := &glue.CreateCsvClassifierRequest{ + AllowSingleColumn: aws.Bool(m["allow_single_column"].(bool)), + ContainsHeader: aws.String(m["contains_header"].(string)), + Delimiter: aws.String(m["delimiter"].(string)), + DisableValueTrimming: aws.Bool(m["disable_value_trimming"].(bool)), + Name: aws.String(name), + QuoteSymbol: aws.String(m["quote_symbol"].(string)), + } + + if v, ok := m["header"]; ok { + header := make([]string, len(v.([]interface{}))) + for i, item := range v.([]interface{}) { + header[i] = fmt.Sprint(item) + } + csvClassifier.Header = aws.StringSlice(header) + } + + return csvClassifier +} + +func expandGlueCsvClassifierUpdate(name string, m map[string]interface{}) *glue.UpdateCsvClassifierRequest { + csvClassifier := &glue.UpdateCsvClassifierRequest{ + AllowSingleColumn: aws.Bool(m["allow_single_column"].(bool)), + ContainsHeader: aws.String(m["contains_header"].(string)), + Delimiter: aws.String(m["delimiter"].(string)), + DisableValueTrimming: aws.Bool(m["disable_value_trimming"].(bool)), + Name: aws.String(name), + QuoteSymbol: aws.String(m["quote_symbol"].(string)), + } + + if v, ok := m["header"]; ok { + header := make([]string, len(v.([]interface{}))) + for i, item := range v.([]interface{}) { + header[i] = fmt.Sprint(item) + } + csvClassifier.Header = aws.StringSlice(header) + } + + return csvClassifier +} + func expandGlueGrokClassifierCreate(name string, m map[string]interface{}) *glue.CreateGrokClassifierRequest { grokClassifier := &glue.CreateGrokClassifierRequest{ Classification: aws.String(m["classification"].(string)), @@ -308,6 +420,23 @@ func expandGlueXmlClassifierUpdate(name string, m map[string]interface{}) *glue. return xmlClassifier } +func flattenGlueCsvClassifier(csvClassifier *glue.CsvClassifier) []map[string]interface{} { + if csvClassifier == nil { + return []map[string]interface{}{} + } + + m := map[string]interface{}{ + "allow_single_column": aws.BoolValue(csvClassifier.AllowSingleColumn), + "contains_header": aws.StringValue(csvClassifier.ContainsHeader), + "delimiter": aws.StringValue(csvClassifier.Delimiter), + "disable_value_trimming": aws.BoolValue(csvClassifier.DisableValueTrimming), + "header": aws.StringValueSlice(csvClassifier.Header), + "quote_symbol": aws.StringValue(csvClassifier.QuoteSymbol), + } + + return []map[string]interface{}{m} +} + func flattenGlueGrokClassifier(grokClassifier *glue.GrokClassifier) []map[string]interface{} { if grokClassifier == nil { return []map[string]interface{}{} diff --git a/aws/resource_aws_glue_classifier_test.go b/aws/resource_aws_glue_classifier_test.go index 9276343c864..0b1c9520f46 100644 --- a/aws/resource_aws_glue_classifier_test.go +++ b/aws/resource_aws_glue_classifier_test.go @@ -34,7 +34,9 @@ func testSweepGlueClassifiers(region string) error { } for _, classifier := range page.Classifiers { var name string - if classifier.GrokClassifier != nil { + if classifier.CsvClassifier != nil { + name = aws.StringValue(classifier.CsvClassifier.Name) + } else if classifier.GrokClassifier != nil { name = aws.StringValue(classifier.GrokClassifier.Name) } else if classifier.JsonClassifier != nil { name = aws.StringValue(classifier.JsonClassifier.Name) @@ -65,6 +67,62 @@ func testSweepGlueClassifiers(region string) error { return nil } +func TestAccAWSGlueClassifier_CsvClassifier(t *testing.T) { + var classifier glue.Classifier + + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_glue_classifier.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSGlueClassifierDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSGlueClassifierConfig_CsvClassifier(rName, false, "PRESENT", "|", false), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueClassifierExists(resourceName, &classifier), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.#", "1"), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.0.allow_single_column", "false"), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.0.contains_header", "PRESENT"), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.0.delimiter", "|"), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.0.disable_value_trimming", "false"), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.0.header.0", "header_column1"), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.0.header.1", "header_column2"), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.0.quote_symbol", "\""), + resource.TestCheckResourceAttr(resourceName, "grok_classifier.#", "0"), + resource.TestCheckResourceAttr(resourceName, "json_classifier.#", "0"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "xml_classifier.#", "0"), + ), + }, + { + Config: testAccAWSGlueClassifierConfig_CsvClassifier(rName, false, "PRESENT", ",", false), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueClassifierExists(resourceName, &classifier), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.#", "1"), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.0.allow_single_column", "false"), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.0.contains_header", "PRESENT"), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.0.delimiter", ","), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.0.disable_value_trimming", "false"), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.0.header.0", "header_column1"), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.0.header.1", "header_column2"), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.0.quote_symbol", "\""), + resource.TestCheckResourceAttr(resourceName, "grok_classifier.#", "0"), + resource.TestCheckResourceAttr(resourceName, "json_classifier.#", "0"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "xml_classifier.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccAWSGlueClassifier_GrokClassifier(t *testing.T) { var classifier glue.Classifier @@ -80,6 +138,7 @@ func TestAccAWSGlueClassifier_GrokClassifier(t *testing.T) { Config: testAccAWSGlueClassifierConfig_GrokClassifier(rName, "classification1", "pattern1"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSGlueClassifierExists(resourceName, &classifier), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.#", "1"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.0.classification", "classification1"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.0.custom_patterns", ""), @@ -93,6 +152,7 @@ func TestAccAWSGlueClassifier_GrokClassifier(t *testing.T) { Config: testAccAWSGlueClassifierConfig_GrokClassifier(rName, "classification2", "pattern2"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSGlueClassifierExists(resourceName, &classifier), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.#", "1"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.0.classification", "classification2"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.0.custom_patterns", ""), @@ -126,6 +186,7 @@ func TestAccAWSGlueClassifier_GrokClassifier_CustomPatterns(t *testing.T) { Config: testAccAWSGlueClassifierConfig_GrokClassifier_CustomPatterns(rName, "custompattern1"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSGlueClassifierExists(resourceName, &classifier), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.#", "1"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.0.classification", "classification"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.0.custom_patterns", "custompattern1"), @@ -139,6 +200,7 @@ func TestAccAWSGlueClassifier_GrokClassifier_CustomPatterns(t *testing.T) { Config: testAccAWSGlueClassifierConfig_GrokClassifier_CustomPatterns(rName, "custompattern2"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSGlueClassifierExists(resourceName, &classifier), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.#", "1"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.0.classification", "classification"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.0.custom_patterns", "custompattern2"), @@ -172,6 +234,7 @@ func TestAccAWSGlueClassifier_JsonClassifier(t *testing.T) { Config: testAccAWSGlueClassifierConfig_JsonClassifier(rName, "jsonpath1"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSGlueClassifierExists(resourceName, &classifier), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "json_classifier.#", "1"), resource.TestCheckResourceAttr(resourceName, "json_classifier.0.json_path", "jsonpath1"), @@ -183,6 +246,7 @@ func TestAccAWSGlueClassifier_JsonClassifier(t *testing.T) { Config: testAccAWSGlueClassifierConfig_JsonClassifier(rName, "jsonpath2"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSGlueClassifierExists(resourceName, &classifier), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "json_classifier.#", "1"), resource.TestCheckResourceAttr(resourceName, "json_classifier.0.json_path", "jsonpath2"), @@ -214,6 +278,7 @@ func TestAccAWSGlueClassifier_TypeChange(t *testing.T) { Config: testAccAWSGlueClassifierConfig_GrokClassifier(rName, "classification1", "pattern1"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSGlueClassifierExists(resourceName, &classifier), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.#", "1"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.0.classification", "classification1"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.0.custom_patterns", ""), @@ -227,6 +292,7 @@ func TestAccAWSGlueClassifier_TypeChange(t *testing.T) { Config: testAccAWSGlueClassifierConfig_JsonClassifier(rName, "jsonpath1"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSGlueClassifierExists(resourceName, &classifier), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "json_classifier.#", "1"), resource.TestCheckResourceAttr(resourceName, "json_classifier.0.json_path", "jsonpath1"), @@ -238,6 +304,7 @@ func TestAccAWSGlueClassifier_TypeChange(t *testing.T) { Config: testAccAWSGlueClassifierConfig_XmlClassifier(rName, "classification1", "rowtag1"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSGlueClassifierExists(resourceName, &classifier), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "json_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "name", rName), @@ -250,6 +317,7 @@ func TestAccAWSGlueClassifier_TypeChange(t *testing.T) { Config: testAccAWSGlueClassifierConfig_GrokClassifier(rName, "classification1", "pattern1"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSGlueClassifierExists(resourceName, &classifier), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.#", "1"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.0.classification", "classification1"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.0.custom_patterns", ""), @@ -278,6 +346,7 @@ func TestAccAWSGlueClassifier_XmlClassifier(t *testing.T) { Config: testAccAWSGlueClassifierConfig_XmlClassifier(rName, "classification1", "rowtag1"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSGlueClassifierExists(resourceName, &classifier), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "json_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "name", rName), @@ -290,6 +359,7 @@ func TestAccAWSGlueClassifier_XmlClassifier(t *testing.T) { Config: testAccAWSGlueClassifierConfig_XmlClassifier(rName, "classification2", "rowtag2"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSGlueClassifierExists(resourceName, &classifier), + resource.TestCheckResourceAttr(resourceName, "csv_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "grok_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "json_classifier.#", "0"), resource.TestCheckResourceAttr(resourceName, "name", rName), @@ -366,6 +436,23 @@ func testAccCheckAWSGlueClassifierDestroy(s *terraform.State) error { return nil } +func testAccAWSGlueClassifierConfig_CsvClassifier(rName string, allowSingleColumn bool, containsHeader string, delimiter string, disableValueTrimming bool) string { + return fmt.Sprintf(` +resource "aws_glue_classifier" "test" { + name = "%s" + + csv_classifier { + allow_single_column = "%t" + contains_header = "%s" + delimiter = "%s" + disable_value_trimming = "%t" + header = ["header_column1", "header_column2"] + quote_symbol = "\"" + } +} +`, rName, allowSingleColumn, containsHeader, delimiter, disableValueTrimming) +} + func testAccAWSGlueClassifierConfig_GrokClassifier(rName, classification, grokPattern string) string { return fmt.Sprintf(` resource "aws_glue_classifier" "test" { diff --git a/aws/resource_aws_glue_crawler.go b/aws/resource_aws_glue_crawler.go index 50b88936c95..8d7e16adc25 100644 --- a/aws/resource_aws_glue_crawler.go +++ b/aws/resource_aws_glue_crawler.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/structure" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsGlueCrawler() *schema.Resource { @@ -191,6 +192,7 @@ func resourceAwsGlueCrawler() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "tags": tagsSchema(), }, } } @@ -239,6 +241,7 @@ func createCrawlerInput(crawlerName string, d *schema.ResourceData) (*glue.Creat Name: aws.String(crawlerName), DatabaseName: aws.String(d.Get("database_name").(string)), Role: aws.String(d.Get("role").(string)), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().GlueTags(), Targets: crawlerTargets, } if description, ok := d.GetOk("description"); ok { @@ -455,29 +458,49 @@ func resourceAwsGlueCrawlerUpdate(d *schema.ResourceData, meta interface{}) erro glueConn := meta.(*AWSClient).glueconn name := d.Get("name").(string) - updateCrawlerInput, err := updateCrawlerInput(name, d) - if err != nil { - return err - } - - // Retry for IAM eventual consistency - err = resource.Retry(1*time.Minute, func() *resource.RetryError { - _, err := glueConn.UpdateCrawler(updateCrawlerInput) + if d.HasChange("catalog_target") || + d.HasChange("classifiers") || + d.HasChange("configuration") || + d.HasChange("description") || + d.HasChange("dynamodb_target") || + d.HasChange("jdbc_target") || + d.HasChange("role") || + d.HasChange("s3_target") || + d.HasChange("schedule") || + d.HasChange("schema_change_policy") || + d.HasChange("security_configuration") || + d.HasChange("table_prefix") { + updateCrawlerInput, err := updateCrawlerInput(name, d) if err != nil { - if isAWSErr(err, glue.ErrCodeInvalidInputException, "Service is unable to assume role") { - return resource.RetryableError(err) - } - // InvalidInputException: Unable to retrieve connection tf-acc-test-8656357591012534997: User: arn:aws:sts::*******:assumed-role/tf-acc-test-8656357591012534997/AWS-Crawler is not authorized to perform: glue:GetConnection on resource: * (Service: AmazonDataCatalog; Status Code: 400; Error Code: AccessDeniedException; Request ID: 4d72b66f-9c75-11e8-9faf-5b526c7be968) - if isAWSErr(err, glue.ErrCodeInvalidInputException, "is not authorized") { - return resource.RetryableError(err) + return err + } + + // Retry for IAM eventual consistency + err = resource.Retry(1*time.Minute, func() *resource.RetryError { + _, err := glueConn.UpdateCrawler(updateCrawlerInput) + if err != nil { + if isAWSErr(err, glue.ErrCodeInvalidInputException, "Service is unable to assume role") { + return resource.RetryableError(err) + } + // InvalidInputException: Unable to retrieve connection tf-acc-test-8656357591012534997: User: arn:aws:sts::*******:assumed-role/tf-acc-test-8656357591012534997/AWS-Crawler is not authorized to perform: glue:GetConnection on resource: * (Service: AmazonDataCatalog; Status Code: 400; Error Code: AccessDeniedException; Request ID: 4d72b66f-9c75-11e8-9faf-5b526c7be968) + if isAWSErr(err, glue.ErrCodeInvalidInputException, "is not authorized") { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) } - return resource.NonRetryableError(err) + return nil + }) + + if err != nil { + return fmt.Errorf("error updating Glue crawler: %s", err) } - return nil - }) + } - if err != nil { - return fmt.Errorf("error updating Glue crawler: %s", err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.GlueUpdateTags(glueConn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } } return resourceAwsGlueCrawlerRead(d, meta) @@ -559,6 +582,16 @@ func resourceAwsGlueCrawlerRead(d *schema.ResourceData, meta interface{}) error } } + tags, err := keyvaluetags.GlueListTags(glueConn, crawlerARN) + + if err != nil { + return fmt.Errorf("error listing tags for Glue Crawler (%s): %s", crawlerARN, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + return nil } diff --git a/aws/resource_aws_glue_crawler_test.go b/aws/resource_aws_glue_crawler_test.go index 9bb676e30f5..8d509e87d72 100644 --- a/aws/resource_aws_glue_crawler_test.go +++ b/aws/resource_aws_glue_crawler_test.go @@ -89,6 +89,7 @@ func TestAccAWSGlueCrawler_DynamodbTarget(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.delete_behavior", "DEPRECATE_IN_DATABASE"), resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.update_behavior", "UPDATE_IN_DATABASE"), resource.TestCheckResourceAttr(resourceName, "table_prefix", ""), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -111,6 +112,7 @@ func TestAccAWSGlueCrawler_DynamodbTarget(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.delete_behavior", "DEPRECATE_IN_DATABASE"), resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.update_behavior", "UPDATE_IN_DATABASE"), resource.TestCheckResourceAttr(resourceName, "table_prefix", ""), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -154,6 +156,7 @@ func TestAccAWSGlueCrawler_JdbcTarget(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.delete_behavior", "DEPRECATE_IN_DATABASE"), resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.update_behavior", "UPDATE_IN_DATABASE"), resource.TestCheckResourceAttr(resourceName, "table_prefix", ""), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -178,6 +181,7 @@ func TestAccAWSGlueCrawler_JdbcTarget(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.delete_behavior", "DEPRECATE_IN_DATABASE"), resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.update_behavior", "UPDATE_IN_DATABASE"), resource.TestCheckResourceAttr(resourceName, "table_prefix", ""), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -318,6 +322,7 @@ func TestAccAWSGlueCrawler_S3Target(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.delete_behavior", "DEPRECATE_IN_DATABASE"), resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.update_behavior", "UPDATE_IN_DATABASE"), resource.TestCheckResourceAttr(resourceName, "table_prefix", ""), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -341,6 +346,7 @@ func TestAccAWSGlueCrawler_S3Target(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.delete_behavior", "DEPRECATE_IN_DATABASE"), resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.update_behavior", "UPDATE_IN_DATABASE"), resource.TestCheckResourceAttr(resourceName, "table_prefix", ""), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -477,6 +483,7 @@ func TestAccAWSGlueCrawler_CatalogTarget(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.delete_behavior", "LOG"), resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.update_behavior", "UPDATE_IN_DATABASE"), resource.TestCheckResourceAttr(resourceName, "table_prefix", ""), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "configuration", "{\"Version\":1.0,\"Grouping\":{\"TableGroupingPolicy\":\"CombineCompatibleSchemas\"}}"), ), }, @@ -503,6 +510,7 @@ func TestAccAWSGlueCrawler_CatalogTarget(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.delete_behavior", "LOG"), resource.TestCheckResourceAttr(resourceName, "schema_change_policy.0.update_behavior", "UPDATE_IN_DATABASE"), resource.TestCheckResourceAttr(resourceName, "table_prefix", ""), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "configuration", "{\"Version\":1.0,\"Grouping\":{\"TableGroupingPolicy\":\"CombineCompatibleSchemas\"}}"), ), }, @@ -900,6 +908,50 @@ func TestAccAWSGlueCrawler_TablePrefix(t *testing.T) { }) } +func TestAccAWSGlueCrawler_Tags(t *testing.T) { + var crawler1, crawler2, crawler3 glue.Crawler + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_glue_crawler.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSGlueCrawlerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccGlueCrawlerConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueCrawlerExists(resourceName, &crawler1), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccGlueCrawlerConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueCrawlerExists(resourceName, &crawler2), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccGlueCrawlerConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueCrawlerExists(resourceName, &crawler3), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSGlueCrawler_SecurityConfiguration(t *testing.T) { var crawler glue.Crawler rName := acctest.RandomWithPrefix("tf-acc-test") @@ -1690,6 +1742,57 @@ resource "aws_glue_crawler" "test" { `, rName, rName, tablePrefix) } +func testAccGlueCrawlerConfigTags1(rName, tagKey1, tagValue1 string) string { + return testAccGlueCrawlerConfig_Base(rName) + fmt.Sprintf(` +resource "aws_glue_catalog_database" "test" { + name = %[1]q +} + +resource "aws_glue_crawler" "test" { + depends_on = ["aws_iam_role_policy_attachment.test-AWSGlueServiceRole"] + + database_name = "${aws_glue_catalog_database.test.name}" + name = %[1]q + role = "${aws_iam_role.test.name}" + table_prefix = %[1]q + + s3_target { + path = "s3://bucket-name" + } + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccGlueCrawlerConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccGlueCrawlerConfig_Base(rName) + fmt.Sprintf(` +resource "aws_glue_catalog_database" "test" { + name = %[1]q +} + +resource "aws_glue_crawler" "test" { + depends_on = ["aws_iam_role_policy_attachment.test-AWSGlueServiceRole"] + + database_name = "${aws_glue_catalog_database.test.name}" + name = %[1]q + role = "${aws_iam_role.test.name}" + table_prefix = %[1]q + + s3_target { + path = "s3://bucket-name" + } + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + func testAccGlueCrawlerConfig_SecurityConfiguration(rName, securityConfiguration string) string { return testAccGlueCrawlerConfig_Base(rName) + fmt.Sprintf(` resource "aws_glue_catalog_database" "test" { diff --git a/aws/resource_aws_glue_job.go b/aws/resource_aws_glue_job.go index 07aab379c36..afa6e15aca3 100644 --- a/aws/resource_aws_glue_job.go +++ b/aws/resource_aws_glue_job.go @@ -5,9 +5,11 @@ import ( "log" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/glue" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsGlueJob() *schema.Resource { @@ -25,10 +27,14 @@ func resourceAwsGlueJob() *schema.Resource { Type: schema.TypeInt, Optional: true, Computed: true, - ConflictsWith: []string{"max_capacity"}, + ConflictsWith: []string{"max_capacity", "number_of_workers", "worker_type"}, Deprecated: "Please use attribute `max_capacity' instead. This attribute might be removed in future releases.", ValidateFunc: validation.IntAtLeast(2), }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, "command": { Type: schema.TypeList, Required: true, @@ -66,6 +72,11 @@ func resourceAwsGlueJob() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "glue_version": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "execution_property": { Type: schema.TypeList, Optional: true, @@ -86,7 +97,7 @@ func resourceAwsGlueJob() *schema.Resource { Type: schema.TypeFloat, Optional: true, Computed: true, - ConflictsWith: []string{"allocated_capacity"}, + ConflictsWith: []string{"allocated_capacity", "number_of_workers", "worker_type"}, }, "max_retries": { Type: schema.TypeInt, @@ -99,11 +110,27 @@ func resourceAwsGlueJob() *schema.Resource { ForceNew: true, ValidateFunc: validation.NoZeroValues, }, + "notification_property": { + Type: schema.TypeList, + Optional: true, + Computed: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "notify_delay_after": { + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntAtLeast(1), + }, + }, + }, + }, "role_arn": { Type: schema.TypeString, Required: true, ValidateFunc: validateArn, }, + "tags": tagsSchema(), "timeout": { Type: schema.TypeInt, Optional: true, @@ -113,6 +140,22 @@ func resourceAwsGlueJob() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "worker_type": { + Type: schema.TypeString, + Optional: true, + ConflictsWith: []string{"allocated_capacity", "max_capacity"}, + ValidateFunc: validation.StringInSlice([]string{ + glue.WorkerTypeG1x, + glue.WorkerTypeG2x, + glue.WorkerTypeStandard, + }, false), + }, + "number_of_workers": { + Type: schema.TypeInt, + Optional: true, + ConflictsWith: []string{"allocated_capacity", "max_capacity"}, + ValidateFunc: validation.IntAtLeast(2), + }, }, } } @@ -125,6 +168,7 @@ func resourceAwsGlueJobCreate(d *schema.ResourceData, meta interface{}) error { Command: expandGlueJobCommand(d.Get("command").([]interface{})), Name: aws.String(name), Role: aws.String(d.Get("role_arn").(string)), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().GlueTags(), Timeout: aws.Int64(int64(d.Get("timeout").(int))), } @@ -155,6 +199,10 @@ func resourceAwsGlueJobCreate(d *schema.ResourceData, meta interface{}) error { input.Description = aws.String(v.(string)) } + if v, ok := d.GetOk("glue_version"); ok { + input.GlueVersion = aws.String(v.(string)) + } + if v, ok := d.GetOk("execution_property"); ok { input.ExecutionProperty = expandGlueExecutionProperty(v.([]interface{})) } @@ -163,10 +211,22 @@ func resourceAwsGlueJobCreate(d *schema.ResourceData, meta interface{}) error { input.MaxRetries = aws.Int64(int64(v.(int))) } + if v, ok := d.GetOk("notification_property"); ok { + input.NotificationProperty = expandGlueNotificationProperty(v.([]interface{})) + } + if v, ok := d.GetOk("security_configuration"); ok { input.SecurityConfiguration = aws.String(v.(string)) } + if v, ok := d.GetOk("worker_type"); ok { + input.WorkerType = aws.String(v.(string)) + } + + if v, ok := d.GetOk("number_of_workers"); ok { + input.NumberOfWorkers = aws.Int64(int64(v.(int))) + } + log.Printf("[DEBUG] Creating Glue Job: %s", input) _, err := conn.CreateJob(input) if err != nil { @@ -203,6 +263,15 @@ func resourceAwsGlueJobRead(d *schema.ResourceData, meta interface{}) error { return nil } + jobARN := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "glue", + Region: meta.(*AWSClient).region, + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("job/%s", d.Id()), + }.String() + d.Set("arn", jobARN) + if err := d.Set("command", flattenGlueJobCommand(job.Command)); err != nil { return fmt.Errorf("error setting command: %s", err) } @@ -213,18 +282,36 @@ func resourceAwsGlueJobRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error setting default_arguments: %s", err) } d.Set("description", job.Description) + d.Set("glue_version", job.GlueVersion) if err := d.Set("execution_property", flattenGlueExecutionProperty(job.ExecutionProperty)); err != nil { return fmt.Errorf("error setting execution_property: %s", err) } d.Set("max_capacity", aws.Float64Value(job.MaxCapacity)) d.Set("max_retries", int(aws.Int64Value(job.MaxRetries))) + if err := d.Set("notification_property", flattenGlueNotificationProperty(job.NotificationProperty)); err != nil { + return fmt.Errorf("error setting notification_property: #{err}") + } d.Set("name", job.Name) d.Set("role_arn", job.Role) + + tags, err := keyvaluetags.GlueListTags(conn, jobARN) + + if err != nil { + return fmt.Errorf("error listing tags for Glue Job (%s): %s", jobARN, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + d.Set("timeout", int(aws.Int64Value(job.Timeout))) if err := d.Set("security_configuration", job.SecurityConfiguration); err != nil { return fmt.Errorf("error setting security_configuration: %s", err) } + d.Set("worker_type", job.WorkerType) + d.Set("number_of_workers", int(aws.Int64Value(job.NumberOfWorkers))) + // TODO: Deprecated fields - remove in next major version d.Set("allocated_capacity", int(aws.Int64Value(job.AllocatedCapacity))) @@ -234,60 +321,98 @@ func resourceAwsGlueJobRead(d *schema.ResourceData, meta interface{}) error { func resourceAwsGlueJobUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).glueconn - jobUpdate := &glue.JobUpdate{ - Command: expandGlueJobCommand(d.Get("command").([]interface{})), - Role: aws.String(d.Get("role_arn").(string)), - Timeout: aws.Int64(int64(d.Get("timeout").(int))), - } + if d.HasChange("allocated_capacity") || + d.HasChange("command") || + d.HasChange("connections") || + d.HasChange("default_arguments") || + d.HasChange("description") || + d.HasChange("execution_property") || + d.HasChange("glue_version") || + d.HasChange("max_capacity") || + d.HasChange("max_retries") || + d.HasChange("notification_property") || + d.HasChange("number_of_workers") || + d.HasChange("role_arn") || + d.HasChange("security_configuration") || + d.HasChange("timeout") || + d.HasChange("worker_type") { + jobUpdate := &glue.JobUpdate{ + Command: expandGlueJobCommand(d.Get("command").([]interface{})), + Role: aws.String(d.Get("role_arn").(string)), + Timeout: aws.Int64(int64(d.Get("timeout").(int))), + } - if v, ok := d.GetOk("max_capacity"); ok { - jobUpdate.MaxCapacity = aws.Float64(v.(float64)) - } + if v, ok := d.GetOk("number_of_workers"); ok { + jobUpdate.NumberOfWorkers = aws.Int64(int64(v.(int))) + } else { + if v, ok := d.GetOk("max_capacity"); ok { + jobUpdate.MaxCapacity = aws.Float64(v.(float64)) + } + if d.HasChange("allocated_capacity") { + jobUpdate.MaxCapacity = aws.Float64(float64(d.Get("allocated_capacity").(int))) + log.Printf("[WARN] Using deprecated `allocated_capacity' attribute.") + } + } - if d.HasChange("allocated_capacity") { - jobUpdate.MaxCapacity = aws.Float64(float64(d.Get("allocated_capacity").(int))) - log.Printf("[WARN] Using deprecated `allocated_capacity' attribute.") - } + if v, ok := d.GetOk("connections"); ok { + jobUpdate.Connections = &glue.ConnectionsList{ + Connections: expandStringList(v.([]interface{})), + } + } - if v, ok := d.GetOk("connections"); ok { - jobUpdate.Connections = &glue.ConnectionsList{ - Connections: expandStringList(v.([]interface{})), + if kv, ok := d.GetOk("default_arguments"); ok { + defaultArgumentsMap := make(map[string]string) + for k, v := range kv.(map[string]interface{}) { + defaultArgumentsMap[k] = v.(string) + } + jobUpdate.DefaultArguments = aws.StringMap(defaultArgumentsMap) } - } - if kv, ok := d.GetOk("default_arguments"); ok { - defaultArgumentsMap := make(map[string]string) - for k, v := range kv.(map[string]interface{}) { - defaultArgumentsMap[k] = v.(string) + if v, ok := d.GetOk("description"); ok { + jobUpdate.Description = aws.String(v.(string)) } - jobUpdate.DefaultArguments = aws.StringMap(defaultArgumentsMap) - } - if v, ok := d.GetOk("description"); ok { - jobUpdate.Description = aws.String(v.(string)) - } + if v, ok := d.GetOk("glue_version"); ok { + jobUpdate.GlueVersion = aws.String(v.(string)) + } - if v, ok := d.GetOk("execution_property"); ok { - jobUpdate.ExecutionProperty = expandGlueExecutionProperty(v.([]interface{})) - } + if v, ok := d.GetOk("execution_property"); ok { + jobUpdate.ExecutionProperty = expandGlueExecutionProperty(v.([]interface{})) + } - if v, ok := d.GetOk("max_retries"); ok { - jobUpdate.MaxRetries = aws.Int64(int64(v.(int))) - } + if v, ok := d.GetOk("max_retries"); ok { + jobUpdate.MaxRetries = aws.Int64(int64(v.(int))) + } - if v, ok := d.GetOk("security_configuration"); ok { - jobUpdate.SecurityConfiguration = aws.String(v.(string)) - } + if v, ok := d.GetOk("notification_property"); ok { + jobUpdate.NotificationProperty = expandGlueNotificationProperty(v.([]interface{})) + } - input := &glue.UpdateJobInput{ - JobName: aws.String(d.Id()), - JobUpdate: jobUpdate, + if v, ok := d.GetOk("security_configuration"); ok { + jobUpdate.SecurityConfiguration = aws.String(v.(string)) + } + + if v, ok := d.GetOk("worker_type"); ok { + jobUpdate.WorkerType = aws.String(v.(string)) + } + + input := &glue.UpdateJobInput{ + JobName: aws.String(d.Id()), + JobUpdate: jobUpdate, + } + + log.Printf("[DEBUG] Updating Glue Job: %s", input) + _, err := conn.UpdateJob(input) + if err != nil { + return fmt.Errorf("error updating Glue Job (%s): %s", d.Id(), err) + } } - log.Printf("[DEBUG] Updating Glue Job: %s", input) - _, err := conn.UpdateJob(input) - if err != nil { - return fmt.Errorf("error updating Glue Job (%s): %s", d.Id(), err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.GlueUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } } return resourceAwsGlueJobRead(d, meta) @@ -346,6 +471,16 @@ func expandGlueJobCommand(l []interface{}) *glue.JobCommand { return jobCommand } +func expandGlueNotificationProperty(l []interface{}) *glue.NotificationProperty { + m := l[0].(map[string]interface{}) + + notificationProperty := &glue.NotificationProperty{ + NotifyDelayAfter: aws.Int64(int64(m["notify_delay_after"].(int))), + } + + return notificationProperty +} + func flattenGlueConnectionsList(connectionsList *glue.ConnectionsList) []interface{} { if connectionsList == nil { return []interface{}{} @@ -379,3 +514,15 @@ func flattenGlueJobCommand(jobCommand *glue.JobCommand) []map[string]interface{} return []map[string]interface{}{m} } + +func flattenGlueNotificationProperty(notificationProperty *glue.NotificationProperty) []map[string]interface{} { + if notificationProperty == nil { + return []map[string]interface{}{} + } + + m := map[string]interface{}{ + "notify_delay_after": int(aws.Int64Value(notificationProperty.NotifyDelayAfter)), + } + + return []map[string]interface{}{m} +} diff --git a/aws/resource_aws_glue_job_test.go b/aws/resource_aws_glue_job_test.go index 2e549d22d21..065550c1b11 100644 --- a/aws/resource_aws_glue_job_test.go +++ b/aws/resource_aws_glue_job_test.go @@ -70,11 +70,13 @@ func TestAccAWSGlueJob_Basic(t *testing.T) { Config: testAccAWSGlueJobConfig_Required(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSGlueJobExists(resourceName, &job), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "glue", fmt.Sprintf("job/%s", rName)), resource.TestCheckResourceAttr(resourceName, "command.#", "1"), resource.TestCheckResourceAttr(resourceName, "command.0.script_location", "testscriptlocation"), resource.TestCheckResourceAttr(resourceName, "default_arguments.%", "0"), resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestMatchResourceAttr(resourceName, "role_arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:iam::[^:]+:role/%s", rName))), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "timeout", "2880"), ), }, @@ -233,6 +235,40 @@ func TestAccAWSGlueJob_Description(t *testing.T) { }) } +func TestAccAWSGlueJob_GlueVersion(t *testing.T) { + var job glue.Job + + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + resourceName := "aws_glue_job.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSGlueJobDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSGlueJobConfig_GlueVersion(rName, "0.9"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueJobExists(resourceName, &job), + resource.TestCheckResourceAttr(resourceName, "glue_version", "0.9"), + ), + }, + { + Config: testAccAWSGlueJobConfig_GlueVersion(rName, "1.0"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueJobExists(resourceName, &job), + resource.TestCheckResourceAttr(resourceName, "glue_version", "1.0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccAWSGlueJob_ExecutionProperty(t *testing.T) { var job glue.Job @@ -311,6 +347,91 @@ func TestAccAWSGlueJob_MaxRetries(t *testing.T) { }) } +func TestAccAWSGlueJob_NotificationProperty(t *testing.T) { + var job glue.Job + + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + resourceName := "aws_glue_job.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSGlueJobDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSGlueJobConfig_NotificationProperty(rName, 0), + ExpectError: regexp.MustCompile(`expected notification_property.0.notify_delay_after to be at least`), + }, + { + Config: testAccAWSGlueJobConfig_NotificationProperty(rName, 1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueJobExists(resourceName, &job), + resource.TestCheckResourceAttr(resourceName, "notification_property.#", "1"), + resource.TestCheckResourceAttr(resourceName, "notification_property.0.notify_delay_after", "1"), + ), + }, + { + Config: testAccAWSGlueJobConfig_NotificationProperty(rName, 2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueJobExists(resourceName, &job), + resource.TestCheckResourceAttr(resourceName, "notification_property.#", "1"), + resource.TestCheckResourceAttr(resourceName, "notification_property.0.notify_delay_after", "2"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSGlueJob_Tags(t *testing.T) { + var job1, job2, job3 glue.Job + + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + resourceName := "aws_glue_job.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSGlueJobDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSGlueJobConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueJobExists(resourceName, &job1), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSGlueJobConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueJobExists(resourceName, &job2), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSGlueJobConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueJobExists(resourceName, &job3), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSGlueJob_Timeout(t *testing.T) { var job glue.Job @@ -379,6 +500,47 @@ func TestAccAWSGlueJob_SecurityConfiguration(t *testing.T) { }) } +func TestAccAWSGlueJob_WorkerType(t *testing.T) { + var job glue.Job + + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + resourceName := "aws_glue_job.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSGlueJobDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSGlueJobConfig_WorkerType(rName, "Standard"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueJobExists(resourceName, &job), + resource.TestCheckResourceAttr(resourceName, "worker_type", "Standard"), + ), + }, + { + Config: testAccAWSGlueJobConfig_WorkerType(rName, "G.1X"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueJobExists(resourceName, &job), + resource.TestCheckResourceAttr(resourceName, "worker_type", "G.1X"), + ), + }, + { + Config: testAccAWSGlueJobConfig_WorkerType(rName, "G.2X"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueJobExists(resourceName, &job), + resource.TestCheckResourceAttr(resourceName, "worker_type", "G.2X"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccAWSGlueJob_PythonShell(t *testing.T) { var job glue.Job @@ -645,6 +807,25 @@ resource "aws_glue_job" "test" { `, testAccAWSGlueJobConfig_Base(rName), description, rName) } +func testAccAWSGlueJobConfig_GlueVersion(rName, glueVersion string) string { + return fmt.Sprintf(` +%s + +resource "aws_glue_job" "test" { + glue_version = "%s" + name = "%s" + role_arn = "${aws_iam_role.test.arn}" + allocated_capacity = 10 + + command { + script_location = "testscriptlocation" + } + + depends_on = ["aws_iam_role_policy_attachment.test"] +} +`, testAccAWSGlueJobConfig_Base(rName), glueVersion, rName) +} + func testAccAWSGlueJobConfig_ExecutionProperty(rName string, maxConcurrentRuns int) string { return fmt.Sprintf(` %s @@ -686,6 +867,28 @@ resource "aws_glue_job" "test" { `, testAccAWSGlueJobConfig_Base(rName), maxRetries, rName) } +func testAccAWSGlueJobConfig_NotificationProperty(rName string, notifyDelayAfter int) string { + return fmt.Sprintf(` +%s + +resource "aws_glue_job" "test" { + name = "%s" + role_arn = "${aws_iam_role.test.arn}" + allocated_capacity = 10 + + command { + script_location = "testscriptlocation" + } + + notification_property { + notify_delay_after = %d + } + + depends_on = ["aws_iam_role_policy_attachment.test"] +} +`, testAccAWSGlueJobConfig_Base(rName), rName, notifyDelayAfter) +} + func testAccAWSGlueJobConfig_Required(rName string) string { return fmt.Sprintf(` %s @@ -704,6 +907,49 @@ resource "aws_glue_job" "test" { `, testAccAWSGlueJobConfig_Base(rName), rName) } +func testAccAWSGlueJobConfigTags1(rName, tagKey1, tagValue1 string) string { + return testAccAWSGlueJobConfig_Base(rName) + fmt.Sprintf(` +resource "aws_glue_job" "test" { + name = %[1]q + number_of_workers = 2 + role_arn = "${aws_iam_role.test.arn}" + worker_type = "Standard" + + command { + script_location = "testscriptlocation" + } + + tags = { + %[2]q = %[3]q + } + + depends_on = ["aws_iam_role_policy_attachment.test"] +} +`, rName, tagKey1, tagValue1) +} + +func testAccAWSGlueJobConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccAWSGlueJobConfig_Base(rName) + fmt.Sprintf(` +resource "aws_glue_job" "test" { + name = %[1]q + number_of_workers = 2 + role_arn = "${aws_iam_role.test.arn}" + worker_type = "Standard" + + command { + script_location = "testscriptlocation" + } + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } + + depends_on = ["aws_iam_role_policy_attachment.test"] +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + func testAccAWSGlueJobConfig_Timeout(rName string, timeout int) string { return fmt.Sprintf(` %s @@ -742,6 +988,25 @@ resource "aws_glue_job" "test" { `, testAccAWSGlueJobConfig_Base(rName), rName, securityConfiguration) } +func testAccAWSGlueJobConfig_WorkerType(rName string, workerType string) string { + return fmt.Sprintf(` +%s + +resource "aws_glue_job" "test" { + name = "%s" + role_arn = "${aws_iam_role.test.arn}" + worker_type = "%s" + number_of_workers = 10 + + command { + script_location = "testscriptlocation" + } + + depends_on = ["aws_iam_role_policy_attachment.test"] +} +`, testAccAWSGlueJobConfig_Base(rName), rName, workerType) +} + func testAccAWSGlueJobConfig_PythonShell(rName string) string { return fmt.Sprintf(` %s diff --git a/aws/resource_aws_glue_trigger.go b/aws/resource_aws_glue_trigger.go index 5bf95d5253e..3206dbee26b 100644 --- a/aws/resource_aws_glue_trigger.go +++ b/aws/resource_aws_glue_trigger.go @@ -6,10 +6,12 @@ import ( "time" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/glue" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsGlueTrigger() *schema.Resource { @@ -37,9 +39,13 @@ func resourceAwsGlueTrigger() *schema.Resource { Type: schema.TypeMap, Optional: true, }, + "crawler_name": { + Type: schema.TypeString, + Optional: true, + }, "job_name": { Type: schema.TypeString, - Required: true, + Optional: true, }, "timeout": { Type: schema.TypeInt, @@ -48,6 +54,10 @@ func resourceAwsGlueTrigger() *schema.Resource { }, }, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, "description": { Type: schema.TypeString, Optional: true, @@ -77,7 +87,11 @@ func resourceAwsGlueTrigger() *schema.Resource { Schema: map[string]*schema.Schema{ "job_name": { Type: schema.TypeString, - Required: true, + Optional: true, + }, + "crawler_name": { + Type: schema.TypeString, + Optional: true, }, "logical_operator": { Type: schema.TypeString, @@ -88,8 +102,9 @@ func resourceAwsGlueTrigger() *schema.Resource { }, false), }, "state": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Optional: true, + ConflictsWith: []string{"predicate.0.conditions.0.crawl_state"}, ValidateFunc: validation.StringInSlice([]string{ glue.JobRunStateFailed, glue.JobRunStateStopped, @@ -97,6 +112,17 @@ func resourceAwsGlueTrigger() *schema.Resource { glue.JobRunStateTimeout, }, false), }, + "crawl_state": { + Type: schema.TypeString, + Optional: true, + ConflictsWith: []string{"predicate.0.conditions.0.state"}, + ValidateFunc: validation.StringInSlice([]string{ + glue.CrawlStateRunning, + glue.CrawlStateSucceeded, + glue.CrawlStateCancelled, + glue.CrawlStateFailed, + }, false), + }, }, }, }, @@ -116,6 +142,7 @@ func resourceAwsGlueTrigger() *schema.Resource { Type: schema.TypeString, Optional: true, }, + "tags": tagsSchema(), "type": { Type: schema.TypeString, Required: true, @@ -126,6 +153,11 @@ func resourceAwsGlueTrigger() *schema.Resource { glue.TriggerTypeScheduled, }, false), }, + "workflow_name": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + }, }, } } @@ -138,6 +170,7 @@ func resourceAwsGlueTriggerCreate(d *schema.ResourceData, meta interface{}) erro input := &glue.CreateTriggerInput{ Actions: expandGlueActions(d.Get("actions").([]interface{})), Name: aws.String(name), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().GlueTags(), Type: aws.String(triggerType), } @@ -153,10 +186,18 @@ func resourceAwsGlueTriggerCreate(d *schema.ResourceData, meta interface{}) erro input.Schedule = aws.String(v.(string)) } + if v, ok := d.GetOk("workflow_name"); ok { + input.WorkflowName = aws.String(v.(string)) + } + if d.Get("enabled").(bool) && triggerType != glue.TriggerTypeOnDemand { input.StartOnCreation = aws.Bool(true) } + if v, ok := d.GetOk("workflow_name"); ok { + input.WorkflowName = aws.String(v.(string)) + } + log.Printf("[DEBUG] Creating Glue Trigger: %s", input) _, err := conn.CreateTrigger(input) if err != nil { @@ -215,6 +256,15 @@ func resourceAwsGlueTriggerRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("error setting actions: %s", err) } + triggerARN := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "glue", + Region: meta.(*AWSClient).region, + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("trigger/%s", d.Id()), + }.String() + d.Set("arn", triggerARN) + d.Set("description", trigger.Description) var enabled bool @@ -233,7 +283,19 @@ func resourceAwsGlueTriggerRead(d *schema.ResourceData, meta interface{}) error d.Set("name", trigger.Name) d.Set("schedule", trigger.Schedule) + + tags, err := keyvaluetags.GlueListTags(conn, triggerARN) + + if err != nil { + return fmt.Errorf("error listing tags for Glue Trigger (%s): %s", triggerARN, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + d.Set("type", trigger.Type) + d.Set("workflow_name", trigger.WorkflowName) return nil } @@ -296,6 +358,13 @@ func resourceAwsGlueTriggerUpdate(d *schema.ResourceData, meta interface{}) erro } } + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.GlueUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + return nil } @@ -365,8 +434,14 @@ func expandGlueActions(l []interface{}) []*glue.Action { for _, mRaw := range l { m := mRaw.(map[string]interface{}) - action := &glue.Action{ - JobName: aws.String(m["job_name"].(string)), + action := &glue.Action{} + + if v, ok := m["crawler_name"].(string); ok && v != "" { + action.CrawlerName = aws.String(v) + } + + if v, ok := m["job_name"].(string); ok && v != "" { + action.JobName = aws.String(v) } argumentsMap := make(map[string]string) @@ -392,9 +467,23 @@ func expandGlueConditions(l []interface{}) []*glue.Condition { m := mRaw.(map[string]interface{}) condition := &glue.Condition{ - JobName: aws.String(m["job_name"].(string)), LogicalOperator: aws.String(m["logical_operator"].(string)), - State: aws.String(m["state"].(string)), + } + + if v, ok := m["crawler_name"].(string); ok && v != "" { + condition.CrawlerName = aws.String(v) + } + + if v, ok := m["crawl_state"].(string); ok && v != "" { + condition.CrawlState = aws.String(v) + } + + if v, ok := m["job_name"].(string); ok && v != "" { + condition.JobName = aws.String(v) + } + + if v, ok := m["state"].(string); ok && v != "" { + condition.State = aws.String(v) } conditions = append(conditions, condition) @@ -423,9 +512,17 @@ func flattenGlueActions(actions []*glue.Action) []interface{} { for _, action := range actions { m := map[string]interface{}{ "arguments": aws.StringValueMap(action.Arguments), - "job_name": aws.StringValue(action.JobName), "timeout": int(aws.Int64Value(action.Timeout)), } + + if v := aws.StringValue(action.CrawlerName); v != "" { + m["crawler_name"] = v + } + + if v := aws.StringValue(action.JobName); v != "" { + m["job_name"] = v + } + l = append(l, m) } @@ -437,10 +534,25 @@ func flattenGlueConditions(conditions []*glue.Condition) []interface{} { for _, condition := range conditions { m := map[string]interface{}{ - "job_name": aws.StringValue(condition.JobName), "logical_operator": aws.StringValue(condition.LogicalOperator), - "state": aws.StringValue(condition.State), } + + if v := aws.StringValue(condition.CrawlerName); v != "" { + m["crawler_name"] = v + } + + if v := aws.StringValue(condition.CrawlState); v != "" { + m["crawl_state"] = v + } + + if v := aws.StringValue(condition.JobName); v != "" { + m["job_name"] = v + } + + if v := aws.StringValue(condition.State); v != "" { + m["state"] = v + } + l = append(l, m) } diff --git a/aws/resource_aws_glue_trigger_test.go b/aws/resource_aws_glue_trigger_test.go index e328b69b8de..aa1345a3668 100644 --- a/aws/resource_aws_glue_trigger_test.go +++ b/aws/resource_aws_glue_trigger_test.go @@ -36,7 +36,7 @@ func testSweepGlueTriggers(region string) error { name := aws.StringValue(trigger.Name) log.Printf("[INFO] Deleting Glue Trigger: %s", name) - err := deleteGlueJob(conn, name) + err := deleteGlueTrigger(conn, name) if err != nil { log.Printf("[ERROR] Failed to delete Glue Trigger %s: %s", name, err) } @@ -71,12 +71,61 @@ func TestAccAWSGlueTrigger_Basic(t *testing.T) { testAccCheckAWSGlueTriggerExists(resourceName, &trigger), resource.TestCheckResourceAttr(resourceName, "actions.#", "1"), resource.TestCheckResourceAttr(resourceName, "actions.0.job_name", rName), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "glue", fmt.Sprintf("trigger/%s", rName)), resource.TestCheckResourceAttr(resourceName, "description", ""), resource.TestCheckResourceAttr(resourceName, "enabled", "true"), resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttr(resourceName, "predicate.#", "0"), resource.TestCheckResourceAttr(resourceName, "schedule", ""), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "type", "ON_DEMAND"), + resource.TestCheckResourceAttr(resourceName, "workflow_name", ""), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSGlueTrigger_Crawler(t *testing.T) { + var trigger glue.Trigger + + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + resourceName := "aws_glue_trigger.test_trigger" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSGlueTriggerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSGlueTriggerConfig_Crawler(rName, "SUCCEEDED"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueTriggerExists(resourceName, &trigger), + resource.TestCheckResourceAttr(resourceName, "actions.#", "1"), + resource.TestCheckResourceAttr(resourceName, "actions.0.crawler_name", rName), + resource.TestCheckResourceAttr(resourceName, "predicate.#", "1"), + resource.TestCheckResourceAttr(resourceName, "predicate.0.conditions.#", "1"), + resource.TestCheckResourceAttr(resourceName, "predicate.0.conditions.0.crawler_name", fmt.Sprintf("%scrawl2", rName)), + resource.TestCheckResourceAttr(resourceName, "predicate.0.conditions.0.crawl_state", "SUCCEEDED"), + resource.TestCheckResourceAttr(resourceName, "type", "CONDITIONAL"), + ), + }, + { + Config: testAccAWSGlueTriggerConfig_Crawler(rName, "FAILED"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueTriggerExists(resourceName, &trigger), + resource.TestCheckResourceAttr(resourceName, "actions.#", "1"), + resource.TestCheckResourceAttr(resourceName, "actions.0.crawler_name", rName), + resource.TestCheckResourceAttr(resourceName, "predicate.#", "1"), + resource.TestCheckResourceAttr(resourceName, "predicate.0.conditions.#", "1"), + resource.TestCheckResourceAttr(resourceName, "predicate.0.conditions.0.crawler_name", fmt.Sprintf("%scrawl2", rName)), + resource.TestCheckResourceAttr(resourceName, "predicate.0.conditions.0.crawl_state", "FAILED"), + resource.TestCheckResourceAttr(resourceName, "type", "CONDITIONAL"), ), }, { @@ -239,6 +288,78 @@ func TestAccAWSGlueTrigger_Schedule(t *testing.T) { }) } +func TestAccAWSGlueTrigger_Tags(t *testing.T) { + var trigger1, trigger2, trigger3 glue.Trigger + + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + resourceName := "aws_glue_trigger.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSGlueTriggerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSGlueTriggerConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueTriggerExists(resourceName, &trigger1), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSGlueTriggerConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueTriggerExists(resourceName, &trigger2), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSGlueTriggerConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueTriggerExists(resourceName, &trigger3), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + +func TestAccAWSGlueTrigger_WorkflowName(t *testing.T) { + var trigger glue.Trigger + + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + resourceName := "aws_glue_trigger.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSGlueTriggerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSGlueTriggerConfig_WorkflowName(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueTriggerExists(resourceName, &trigger), + resource.TestCheckResourceAttr(resourceName, "workflow_name", rName), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func testAccCheckAWSGlueTriggerExists(resourceName string, trigger *glue.Trigger) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[resourceName] @@ -383,6 +504,40 @@ resource "aws_glue_trigger" "test" { `, testAccAWSGlueJobConfig_Required(rName), rName, rName, state) } +func testAccAWSGlueTriggerConfig_Crawler(rName, state string) string { + return fmt.Sprintf(` +%s + +resource "aws_glue_crawler" "test2" { + depends_on = ["aws_iam_role_policy_attachment.test-AWSGlueServiceRole"] + + database_name = "${aws_glue_catalog_database.test.name}" + name = "%scrawl2" + role = "${aws_iam_role.test.name}" + + s3_target { + path = "s3://test_bucket" + } +} + +resource "aws_glue_trigger" "test_trigger" { + name = "%strigger" + type = "CONDITIONAL" + + actions { + crawler_name = "${aws_glue_crawler.test.name}" + } + + predicate { + conditions { + crawler_name = "${aws_glue_crawler.test2.name}" + crawl_state = "%s" + } + } +} +`, testAccGlueCrawlerConfig_S3Target(rName, "s3://test_bucket"), rName, rName, state) +} + func testAccAWSGlueTriggerConfig_Schedule(rName, schedule string) string { return fmt.Sprintf(` %s @@ -398,3 +553,58 @@ resource "aws_glue_trigger" "test" { } `, testAccAWSGlueJobConfig_Required(rName), rName, schedule) } + +func testAccAWSGlueTriggerConfigTags1(rName, tagKey1, tagValue1 string) string { + return testAccAWSGlueJobConfig_Required(rName) + fmt.Sprintf(` +resource "aws_glue_trigger" "test" { + name = %[1]q + type = "ON_DEMAND" + + actions { + job_name = "${aws_glue_job.test.name}" + } + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccAWSGlueTriggerConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccAWSGlueJobConfig_Required(rName) + fmt.Sprintf(` +resource "aws_glue_trigger" "test" { + name = %[1]q + type = "ON_DEMAND" + + actions { + job_name = "${aws_glue_job.test.name}" + } + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + +func testAccAWSGlueTriggerConfig_WorkflowName(rName string) string { + return fmt.Sprintf(` +%s + +resource "aws_glue_workflow" test { + name = "%s" +} + +resource "aws_glue_trigger" "test" { + name = "%s" + type = "ON_DEMAND" + workflow_name = "${aws_glue_workflow.test.name}" + + actions { + job_name = "${aws_glue_job.test.name}" + } +} +`, testAccAWSGlueJobConfig_Required(rName), rName, rName) +} diff --git a/aws/resource_aws_glue_workflow.go b/aws/resource_aws_glue_workflow.go new file mode 100644 index 00000000000..383cc6b04ad --- /dev/null +++ b/aws/resource_aws_glue_workflow.go @@ -0,0 +1,160 @@ +package aws + +import ( + "fmt" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/glue" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "log" +) + +func resourceAwsGlueWorkflow() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsGlueWorkflowCreate, + Read: resourceAwsGlueWorkflowRead, + Update: resourceAwsGlueWorkflowUpdate, + Delete: resourceAwsGlueWorkflowDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + + Schema: map[string]*schema.Schema{ + "default_run_properties": { + Type: schema.TypeMap, + Optional: true, + Elem: schema.TypeString, + }, + "description": { + Type: schema.TypeString, + Optional: true, + }, + "name": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validation.NoZeroValues, + }, + }, + } +} + +func resourceAwsGlueWorkflowCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).glueconn + name := d.Get("name").(string) + + input := &glue.CreateWorkflowInput{ + Name: aws.String(name), + } + + if kv, ok := d.GetOk("default_run_properties"); ok { + defaultRunPropertiesMap := make(map[string]string) + for k, v := range kv.(map[string]interface{}) { + defaultRunPropertiesMap[k] = v.(string) + } + input.DefaultRunProperties = aws.StringMap(defaultRunPropertiesMap) + } + + if v, ok := d.GetOk("description"); ok { + input.Description = aws.String(v.(string)) + } + + log.Printf("[DEBUG] Creating Glue Workflow: %s", input) + _, err := conn.CreateWorkflow(input) + if err != nil { + return fmt.Errorf("error creating Glue Trigger (%s): %s", name, err) + } + d.SetId(name) + + return resourceAwsGlueWorkflowRead(d, meta) +} + +func resourceAwsGlueWorkflowRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).glueconn + + input := &glue.GetWorkflowInput{ + Name: aws.String(d.Id()), + } + + log.Printf("[DEBUG] Reading Glue Workflow: %s", input) + output, err := conn.GetWorkflow(input) + if err != nil { + if isAWSErr(err, glue.ErrCodeEntityNotFoundException, "") { + log.Printf("[WARN] Glue Workflow (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + return fmt.Errorf("error reading Glue Workflow (%s): %s", d.Id(), err) + } + + workflow := output.Workflow + if workflow == nil { + log.Printf("[WARN] Glue Workflow (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + if err := d.Set("default_run_properties", aws.StringValueMap(workflow.DefaultRunProperties)); err != nil { + return fmt.Errorf("error setting default_run_properties: %s", err) + } + d.Set("description", workflow.Description) + d.Set("name", workflow.Name) + + return nil +} + +func resourceAwsGlueWorkflowUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).glueconn + + input := &glue.UpdateWorkflowInput{ + Name: aws.String(d.Get("name").(string)), + } + + if kv, ok := d.GetOk("default_run_properties"); ok { + defaultRunPropertiesMap := make(map[string]string) + for k, v := range kv.(map[string]interface{}) { + defaultRunPropertiesMap[k] = v.(string) + } + input.DefaultRunProperties = aws.StringMap(defaultRunPropertiesMap) + } + + if v, ok := d.GetOk("description"); ok { + input.Description = aws.String(v.(string)) + } + + log.Printf("[DEBUG] Updating Glue Workflow: %s", input) + _, err := conn.UpdateWorkflow(input) + if err != nil { + return fmt.Errorf("error updating Glue Workflow (%s): %s", d.Id(), err) + } + + return resourceAwsGlueWorkflowRead(d, meta) +} + +func resourceAwsGlueWorkflowDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).glueconn + + log.Printf("[DEBUG] Deleting Glue Workflow: %s", d.Id()) + err := deleteWorkflow(conn, d.Id()) + if err != nil { + return fmt.Errorf("error deleting Glue Workflow (%s): %s", d.Id(), err) + } + + return nil +} + +func deleteWorkflow(conn *glue.Glue, name string) error { + input := &glue.DeleteWorkflowInput{ + Name: aws.String(name), + } + + _, err := conn.DeleteWorkflow(input) + if err != nil { + if isAWSErr(err, glue.ErrCodeEntityNotFoundException, "") { + return nil + } + return err + } + + return nil +} diff --git a/aws/resource_aws_glue_workflow_test.go b/aws/resource_aws_glue_workflow_test.go new file mode 100644 index 00000000000..f33d211ae71 --- /dev/null +++ b/aws/resource_aws_glue_workflow_test.go @@ -0,0 +1,243 @@ +package aws + +import ( + "fmt" + "log" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/glue" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func init() { + resource.AddTestSweepers("aws_glue_workflow", &resource.Sweeper{ + Name: "aws_glue_workflow", + F: testSweepGlueWorkflow, + }) +} + +func testSweepGlueWorkflow(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + conn := client.(*AWSClient).glueconn + + listOutput, err := conn.ListWorkflows(&glue.ListWorkflowsInput{}) + if err != nil { + // Some endpoints that do not support Glue Workflows return InternalFailure + if testSweepSkipSweepError(err) || isAWSErr(err, "InternalFailure", "") { + log.Printf("[WARN] Skipping Glue Workflow sweep for %s: %s", region, err) + return nil + } + return fmt.Errorf("Error retrieving Glue Workflow: %s", err) + } + for _, workflowName := range listOutput.Workflows { + err := deleteWorkflow(conn, *workflowName) + if err != nil { + log.Printf("[ERROR] Failed to delete Glue Workflow %s: %s", *workflowName, err) + } + } + return nil +} + +func TestAccAWSGlueWorkflow_Basic(t *testing.T) { + var workflow glue.Workflow + + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + resourceName := "aws_glue_workflow.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueWorkflow(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSGlueWorkflowDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSGlueWorkflowConfig_Required(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueWorkflowExists(resourceName, &workflow), + resource.TestCheckResourceAttr(resourceName, "name", rName), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSGlueWorkflow_DefaultRunProperties(t *testing.T) { + var workflow glue.Workflow + + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + resourceName := "aws_glue_workflow.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueWorkflow(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSGlueWorkflowDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSGlueWorkflowConfig_DefaultRunProperties(rName, "firstPropValue", "secondPropValue"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueWorkflowExists(resourceName, &workflow), + resource.TestCheckResourceAttr(resourceName, "default_run_properties.%", "2"), + resource.TestCheckResourceAttr(resourceName, "default_run_properties.--run-prop1", "firstPropValue"), + resource.TestCheckResourceAttr(resourceName, "default_run_properties.--run-prop2", "secondPropValue"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSGlueWorkflow_Description(t *testing.T) { + var workflow glue.Workflow + + rName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + resourceName := "aws_glue_workflow.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueWorkflow(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSGlueWorkflowDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSGlueWorkflowConfig_Description(rName, "First Description"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueWorkflowExists(resourceName, &workflow), + resource.TestCheckResourceAttr(resourceName, "description", "First Description"), + ), + }, + { + Config: testAccAWSGlueWorkflowConfig_Description(rName, "Second Description"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSGlueWorkflowExists(resourceName, &workflow), + resource.TestCheckResourceAttr(resourceName, "description", "Second Description"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccPreCheckAWSGlueWorkflow(t *testing.T) { + conn := testAccProvider.Meta().(*AWSClient).glueconn + + _, err := conn.ListWorkflows(&glue.ListWorkflowsInput{}) + + // Some endpoints that do not support Glue Workflows return InternalFailure + if testAccPreCheckSkipError(err) || isAWSErr(err, "InternalFailure", "") { + t.Skipf("skipping acceptance testing: %s", err) + } + + if err != nil { + t.Fatalf("unexpected PreCheck error: %s", err) + } +} + +func testAccCheckAWSGlueWorkflowExists(resourceName string, workflow *glue.Workflow) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No Glue Workflow ID is set") + } + + conn := testAccProvider.Meta().(*AWSClient).glueconn + + output, err := conn.GetWorkflow(&glue.GetWorkflowInput{ + Name: aws.String(rs.Primary.ID), + }) + if err != nil { + return err + } + + if output.Workflow == nil { + return fmt.Errorf("Glue Workflow (%s) not found", rs.Primary.ID) + } + + if aws.StringValue(output.Workflow.Name) == rs.Primary.ID { + *workflow = *output.Workflow + return nil + } + + return fmt.Errorf("Glue Workflow (%s) not found", rs.Primary.ID) + } +} + +func testAccCheckAWSGlueWorkflowDestroy(s *terraform.State) error { + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_glue_workflow" { + continue + } + + conn := testAccProvider.Meta().(*AWSClient).glueconn + + output, err := conn.GetWorkflow(&glue.GetWorkflowInput{ + Name: aws.String(rs.Primary.ID), + }) + + if err != nil { + if isAWSErr(err, glue.ErrCodeEntityNotFoundException, "") { + return nil + } + + } + + workflow := output.Workflow + if workflow != nil && aws.StringValue(workflow.Name) == rs.Primary.ID { + return fmt.Errorf("Glue Workflow %s still exists", rs.Primary.ID) + } + + return err + } + + return nil +} + +func testAccAWSGlueWorkflowConfig_DefaultRunProperties(rName, firstPropValue, secondPropValue string) string { + return fmt.Sprintf(` +resource "aws_glue_workflow" "test" { + name = "%s" + + default_run_properties = { + "--run-prop1" = "%s" + "--run-prop2" = "%s" + } +} +`, rName, firstPropValue, secondPropValue) +} + +func testAccAWSGlueWorkflowConfig_Description(rName, description string) string { + return fmt.Sprintf(` +resource "aws_glue_workflow" "test" { + description = "%s" + name = "%s" +} +`, description, rName) +} + +func testAccAWSGlueWorkflowConfig_Required(rName string) string { + return fmt.Sprintf(` +resource "aws_glue_workflow" "test" { + name = "%s" +} +`, rName) +} diff --git a/aws/resource_aws_guardduty_detector_test.go b/aws/resource_aws_guardduty_detector_test.go index 08c0131b616..47249d8c046 100644 --- a/aws/resource_aws_guardduty_detector_test.go +++ b/aws/resource_aws_guardduty_detector_test.go @@ -2,14 +2,66 @@ package aws import ( "fmt" + "log" "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/guardduty" + "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) +func init() { + resource.AddTestSweepers("aws_guardduty_detector", &resource.Sweeper{ + Name: "aws_guardduty_detector", + F: testSweepGuarddutyDetectors, + }) +} + +func testSweepGuarddutyDetectors(region string) error { + client, err := sharedClientForRegion(region) + + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + + conn := client.(*AWSClient).guarddutyconn + input := &guardduty.ListDetectorsInput{} + var sweeperErrs *multierror.Error + + err = conn.ListDetectorsPages(input, func(page *guardduty.ListDetectorsOutput, lastPage bool) bool { + for _, detectorID := range page.DetectorIds { + id := aws.StringValue(detectorID) + input := &guardduty.DeleteDetectorInput{ + DetectorId: detectorID, + } + + log.Printf("[INFO] Deleting GuardDuty Detector: %s", id) + _, err := conn.DeleteDetector(input) + + if err != nil { + sweeperErr := fmt.Errorf("error deleting GuardDuty Detector (%s): %w", id, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + } + } + + return !lastPage + }) + + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping GuardDuty Detector sweep for %s: %s", region, err) + return nil + } + + if err != nil { + return fmt.Errorf("error retrieving GuardDuty Detectors: %s", err) + } + + return sweeperErrs.ErrorOrNil() +} + func testAccAwsGuardDutyDetector_basic(t *testing.T) { resourceName := "aws_guardduty_detector.test" diff --git a/aws/resource_aws_iam_access_key.go b/aws/resource_aws_iam_access_key.go index fb1046642e8..af8f853f67b 100644 --- a/aws/resource_aws_iam_access_key.go +++ b/aws/resource_aws_iam_access_key.go @@ -38,13 +38,20 @@ func resourceAwsIamAccessKey() *schema.Resource { }, false), }, "secret": { + Type: schema.TypeString, + Computed: true, + Sensitive: true, + }, + "ses_smtp_password": { Type: schema.TypeString, Computed: true, - Deprecated: "Please use a PGP key to encrypt", + Sensitive: true, + Deprecated: "AWS SigV2 for SES SMTP passwords isy deprecated.\nUse 'ses_smtp_password_v4' for region-specific AWS SigV4 signed SES SMTP password instead.", }, - "ses_smtp_password": { - Type: schema.TypeString, - Computed: true, + "ses_smtp_password_v4": { + Type: schema.TypeString, + Computed: true, + Sensitive: true, }, "pgp_key": { Type: schema.TypeString, @@ -104,12 +111,20 @@ func resourceAwsIamAccessKeyCreate(d *schema.ResourceData, meta interface{}) err } } - sesSMTPPassword, err := sesSmtpPasswordFromSecretKey(createResp.AccessKey.SecretAccessKey) + // AWS SigV2 + sesSMTPPassword, err := sesSmtpPasswordFromSecretKeySigV2(createResp.AccessKey.SecretAccessKey) if err != nil { - return fmt.Errorf("error getting SES SMTP Password from Secret Access Key: %s", err) + return fmt.Errorf("error getting SES SigV2 SMTP Password from Secret Access Key: %s", err) } d.Set("ses_smtp_password", sesSMTPPassword) + // AWS SigV4 + sesSMTPPasswordV4, err := sesSmtpPasswordFromSecretKeySigV4(createResp.AccessKey.SecretAccessKey, meta.(*AWSClient).region) + if err != nil { + return fmt.Errorf("error getting SES SigV4 SMTP Password from Secret Access Key: %s", err) + } + d.Set("ses_smtp_password_v4", sesSMTPPasswordV4) + return resourceAwsIamAccessKeyReadResult(d, &iam.AccessKeyMetadata{ AccessKeyId: createResp.AccessKey.AccessKeyId, CreateDate: createResp.AccessKey.CreateDate, @@ -196,7 +211,49 @@ func resourceAwsIamAccessKeyStatusUpdate(iamconn *iam.IAM, d *schema.ResourceDat return nil } -func sesSmtpPasswordFromSecretKey(key *string) (string, error) { +func hmacSignature(key []byte, value []byte) ([]byte, error) { + h := hmac.New(sha256.New, key) + if _, err := h.Write(value); err != nil { + return []byte(""), err + } + return h.Sum(nil), nil +} + +func sesSmtpPasswordFromSecretKeySigV4(key *string, region string) (string, error) { + if key == nil { + return "", nil + } + version := byte(0x04) + date := []byte("11111111") + service := []byte("ses") + terminal := []byte("aws4_request") + message := []byte("SendRawEmail") + + rawSig, err := hmacSignature([]byte("AWS4"+*key), date) + if err != nil { + return "", err + } + + if rawSig, err = hmacSignature(rawSig, []byte(region)); err != nil { + return "", err + } + if rawSig, err = hmacSignature(rawSig, service); err != nil { + return "", err + } + if rawSig, err = hmacSignature(rawSig, terminal); err != nil { + return "", err + } + if rawSig, err = hmacSignature(rawSig, message); err != nil { + return "", err + } + + versionedSig := make([]byte, 0, len(rawSig)+1) + versionedSig = append(versionedSig, version) + versionedSig = append(versionedSig, rawSig...) + return base64.StdEncoding.EncodeToString(versionedSig), nil +} + +func sesSmtpPasswordFromSecretKeySigV2(key *string) (string, error) { if key == nil { return "", nil } diff --git a/aws/resource_aws_iam_access_key_test.go b/aws/resource_aws_iam_access_key_test.go index 0c79e22e158..03e400834c0 100644 --- a/aws/resource_aws_iam_access_key_test.go +++ b/aws/resource_aws_iam_access_key_test.go @@ -234,7 +234,30 @@ resource "aws_iam_access_key" "a_key" { `, rName) } -func TestSesSmtpPasswordFromSecretKey(t *testing.T) { +func TestSesSmtpPasswordFromSecretKeySigV4(t *testing.T) { + cases := []struct { + Region string + Input string + Expected string + }{ + {"eu-central-1", "some+secret+key", "BMXhUYlu5Z3gSXVQORxlVa7XPaz91aGWdfHxvkOZdWZ2"}, + {"eu-central-1", "another+secret+key", "BBbphbrQmrKMx42d1N6+C7VINYEBGI5v9VsZeTxwskfh"}, + {"us-west-1", "some+secret+key", "BH+jbMzper5WwlwUar9E1ySBqHa9whi0GPo+sJ0mVYJj"}, + {"us-west-1", "another+secret+key", "BKVmjjMDFk/qqw8EROW99bjCS65PF8WKvK5bSr4Y6EqF"}, + } + + for _, tc := range cases { + actual, err := sesSmtpPasswordFromSecretKeySigV4(&tc.Input, tc.Region) + if err != nil { + t.Fatalf("unexpected error: %s", err) + } + if actual != tc.Expected { + t.Fatalf("%q: expected %q, got %q", tc.Input, tc.Expected, actual) + } + } +} + +func TestSesSmtpPasswordFromSecretKeySigV2(t *testing.T) { cases := []struct { Input string Expected string @@ -244,7 +267,7 @@ func TestSesSmtpPasswordFromSecretKey(t *testing.T) { } for _, tc := range cases { - actual, err := sesSmtpPasswordFromSecretKey(&tc.Input) + actual, err := sesSmtpPasswordFromSecretKeySigV2(&tc.Input) if err != nil { t.Fatalf("unexpected error: %s", err) } diff --git a/aws/resource_aws_iam_group_policy.go b/aws/resource_aws_iam_group_policy.go index 6091c11e90f..2578b1ee712 100644 --- a/aws/resource_aws_iam_group_policy.go +++ b/aws/resource_aws_iam_group_policy.go @@ -28,8 +28,10 @@ func resourceAwsIamGroupPolicy() *schema.Resource { Schema: map[string]*schema.Schema{ "policy": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Required: true, + ValidateFunc: validateIAMPolicyJson, + DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, }, "name": { Type: schema.TypeString, diff --git a/aws/resource_aws_iam_instance_profile.go b/aws/resource_aws_iam_instance_profile.go index eb56a3b9804..1dbd2ebe371 100644 --- a/aws/resource_aws_iam_instance_profile.go +++ b/aws/resource_aws_iam_instance_profile.go @@ -119,13 +119,6 @@ func resourceAwsIamInstanceProfileCreate(d *schema.ResourceData, meta interface{ name = resource.UniqueId() } - _, hasRoles := d.GetOk("roles") - _, hasRole := d.GetOk("role") - - if !hasRole && !hasRoles { - return fmt.Errorf("Either `role` or `roles` (deprecated) must be specified when creating an IAM Instance Profile") - } - request := &iam.CreateInstanceProfileInput{ InstanceProfileName: aws.String(name), Path: aws.String(d.Get("path").(string)), diff --git a/aws/resource_aws_iam_instance_profile_test.go b/aws/resource_aws_iam_instance_profile_test.go index 84d18c31919..300e6279560 100644 --- a/aws/resource_aws_iam_instance_profile_test.go +++ b/aws/resource_aws_iam_instance_profile_test.go @@ -2,7 +2,6 @@ package aws import ( "fmt" - "regexp" "strings" "testing" @@ -64,7 +63,9 @@ func TestAccAWSIAMInstanceProfile_withRoleNotRoles(t *testing.T) { }) } -func TestAccAWSIAMInstanceProfile_missingRoleThrowsError(t *testing.T) { +func TestAccAWSIAMInstanceProfile_withoutRole(t *testing.T) { + var conf iam.GetInstanceProfileOutput + resourceName := "aws_iam_instance_profile.test" rName := acctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -72,8 +73,16 @@ func TestAccAWSIAMInstanceProfile_missingRoleThrowsError(t *testing.T) { CheckDestroy: testAccCheckAWSInstanceProfileDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsIamInstanceProfileConfigMissingRole(rName), - ExpectError: regexp.MustCompile(regexp.QuoteMeta("Either `role` or `roles` (deprecated) must be specified when creating an IAM Instance Profile")), + Config: testAccAwsIamInstanceProfileConfigWithoutRole(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSInstanceProfileExists(resourceName, &conf), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"name_prefix"}, }, }, }) @@ -192,7 +201,7 @@ resource "aws_iam_instance_profile" "test" { `, rName) } -func testAccAwsIamInstanceProfileConfigMissingRole(rName string) string { +func testAccAwsIamInstanceProfileConfigWithoutRole(rName string) string { return fmt.Sprintf(` resource "aws_iam_instance_profile" "test" { name = "test-%s" diff --git a/aws/resource_aws_iam_policy_attachment.go b/aws/resource_aws_iam_policy_attachment.go index cb3145028fe..16b39853ff9 100644 --- a/aws/resource_aws_iam_policy_attachment.go +++ b/aws/resource_aws_iam_policy_attachment.go @@ -3,13 +3,10 @@ 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-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) @@ -216,39 +213,6 @@ func attachPolicyToRoles(conn *iam.IAM, roles []*string, arn string) error { if err != nil { return err } - - var 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 } diff --git a/aws/resource_aws_iam_role.go b/aws/resource_aws_iam_role.go index 3445c27443a..60f03f8dc02 100644 --- a/aws/resource_aws_iam_role.go +++ b/aws/resource_aws_iam_role.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsIamRole() *schema.Resource { @@ -162,8 +163,8 @@ func resourceAwsIamRoleCreate(d *schema.ResourceData, meta interface{}) error { request.PermissionsBoundary = aws.String(v.(string)) } - if v, ok := d.GetOk("tags"); ok { - request.Tags = tagsFromMapIAM(v.(map[string]interface{})) + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + request.Tags = keyvaluetags.New(v).IgnoreAws().IamTags() } var createResp *iam.CreateRoleOutput @@ -224,7 +225,8 @@ func resourceAwsIamRoleRead(d *schema.ResourceData, meta interface{}) error { d.Set("permissions_boundary", role.PermissionsBoundary.PermissionsBoundaryArn) } d.Set("unique_id", role.RoleId) - if err := d.Set("tags", tagsToMapIAM(role.Tags)); err != nil { + + if err := d.Set("tags", keyvaluetags.IamKeyValueTags(role.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -309,31 +311,10 @@ func resourceAwsIamRoleUpdate(d *schema.ResourceData, meta interface{}) error { } if d.HasChange("tags") { - // Reset all tags to empty set - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - c, r := diffTagsIAM(tagsFromMapIAM(o), tagsFromMapIAM(n)) - - if len(r) > 0 { - _, err := iamconn.UntagRole(&iam.UntagRoleInput{ - RoleName: aws.String(d.Id()), - TagKeys: tagKeysIam(r), - }) - if err != nil { - return fmt.Errorf("error deleting IAM role tags: %s", err) - } - } + o, n := d.GetChange("tags") - if len(c) > 0 { - input := &iam.TagRoleInput{ - RoleName: aws.String(d.Id()), - Tags: c, - } - _, err := iamconn.TagRole(input) - if err != nil { - return fmt.Errorf("error update IAM role tags: %s", err) - } + if err := keyvaluetags.IamRoleUpdateTags(iamconn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating IAM Role (%s) tags: %s", d.Id(), err) } } @@ -372,15 +353,20 @@ func resourceAwsIamRoleDelete(d *schema.ResourceData, meta interface{}) error { return resource.RetryableError(err) } - return resource.NonRetryableError(fmt.Errorf("Error deleting IAM Role %s: %s", d.Id(), err)) + return resource.NonRetryableError(err) } return nil }) if isResourceTimeoutError(err) { _, err = iamconn.DeleteRole(deleteRoleInput) } + + if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { + return nil + } + if err != nil { - return fmt.Errorf("Error deleting IAM role: %s", err) + return fmt.Errorf("Error deleting IAM Role (%s): %s", d.Id(), err) } return nil } @@ -389,6 +375,11 @@ func deleteAwsIamRoleInstanceProfiles(conn *iam.IAM, rolename string) error { resp, err := conn.ListInstanceProfilesForRole(&iam.ListInstanceProfilesForRoleInput{ RoleName: aws.String(rolename), }) + + if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { + return nil + } + if err != nil { return fmt.Errorf("Error listing Profiles for IAM Role (%s) when trying to delete: %s", rolename, err) } @@ -402,8 +393,12 @@ func deleteAwsIamRoleInstanceProfiles(conn *iam.IAM, rolename string) error { _, err := conn.RemoveRoleFromInstanceProfile(input) + if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { + continue + } + if err != nil { - return fmt.Errorf("Error deleting IAM Role %s: %s", rolename, err) + return fmt.Errorf("Error deleting IAM Role (%s) Instance Profile (%s): %s", rolename, aws.StringValue(i.InstanceProfileName), err) } } @@ -422,6 +417,11 @@ func deleteAwsIamRolePolicyAttachments(conn *iam.IAM, rolename string) error { } return !lastPage }) + + if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { + return nil + } + if err != nil { return fmt.Errorf("Error listing Policies for IAM Role (%s) when trying to delete: %s", rolename, err) } diff --git a/aws/resource_aws_iam_role_policy_test.go b/aws/resource_aws_iam_role_policy_test.go index 07d4aecafb5..fba4d77c75a 100644 --- a/aws/resource_aws_iam_role_policy_test.go +++ b/aws/resource_aws_iam_role_policy_test.go @@ -196,6 +196,22 @@ func TestAccAWSIAMRolePolicy_invalidJSON(t *testing.T) { }) } +func TestAccAWSIAMRolePolicy_Policy_InvalidResource(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckIAMRolePolicyDestroy, + Steps: []resource.TestStep{ + { + Config: testAccIAMRolePolicyConfig_Policy_InvalidResource(rName), + ExpectError: regexp.MustCompile("MalformedPolicyDocument"), + }, + }, + }) +} + func testAccCheckIAMRolePolicyDestroy(s *terraform.State) error { iamconn := testAccProvider.Meta().(*AWSClient).iamconn @@ -549,3 +565,41 @@ resource "aws_iam_role_policy" "test" { } `, role, role) } + +func testAccIAMRolePolicyConfig_Policy_InvalidResource(rName string) string { + return fmt.Sprintf(` +resource "aws_iam_role" "test" { + name = %[1]q + + assume_role_policy = < 0 { + request.Tags = keyvaluetags.New(v).IgnoreAws().IamTags() } log.Println("[DEBUG] Create IAM User request:", request) @@ -127,7 +127,8 @@ func resourceAwsIamUserRead(d *schema.ResourceData, meta interface{}) error { d.Set("permissions_boundary", output.User.PermissionsBoundary.PermissionsBoundaryArn) } d.Set("unique_id", output.User.UserId) - if err := d.Set("tags", tagsToMapIAM(output.User.Tags)); err != nil { + + if err := d.Set("tags", keyvaluetags.IamKeyValueTags(output.User.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -184,31 +185,10 @@ func resourceAwsIamUserUpdate(d *schema.ResourceData, meta interface{}) error { } if d.HasChange("tags") { - // Reset all tags to empty set - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - c, r := diffTagsIAM(tagsFromMapIAM(o), tagsFromMapIAM(n)) - - if len(r) > 0 { - _, err := iamconn.UntagUser(&iam.UntagUserInput{ - UserName: aws.String(d.Id()), - TagKeys: tagKeysIam(r), - }) - if err != nil { - return fmt.Errorf("error deleting IAM user tags: %s", err) - } - } + o, n := d.GetChange("tags") - if len(c) > 0 { - input := &iam.TagUserInput{ - UserName: aws.String(d.Id()), - Tags: c, - } - _, err := iamconn.TagUser(input) - if err != nil { - return fmt.Errorf("error update IAM user tags: %s", err) - } + if err := keyvaluetags.IamUserUpdateTags(iamconn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating IAM User (%s) tags: %s", d.Id(), err) } } @@ -233,7 +213,11 @@ func resourceAwsIamUserDelete(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error removing IAM User (%s) SSH keys: %s", d.Id(), err) } - if err := deleteAwsIamUserMFADevices(iamconn, d.Id()); err != nil { + if err := deleteAwsIamUserVirtualMFADevices(iamconn, d.Id()); err != nil { + return fmt.Errorf("error removing IAM User (%s) Virtual MFA devices: %s", d.Id(), err) + } + + if err := deactivateAwsIamUserMFADevices(iamconn, d.Id()); err != nil { return fmt.Errorf("error removing IAM User (%s) MFA devices: %s", d.Id(), err) } @@ -326,7 +310,46 @@ func deleteAwsIamUserSSHKeys(svc *iam.IAM, username string) error { return nil } -func deleteAwsIamUserMFADevices(svc *iam.IAM, username string) error { +func deleteAwsIamUserVirtualMFADevices(svc *iam.IAM, username string) error { + var VirtualMFADevices []string + var err error + + listVirtualMFADevices := &iam.ListVirtualMFADevicesInput{ + AssignmentStatus: aws.String("Assigned"), + } + pageOfVirtualMFADevices := func(page *iam.ListVirtualMFADevicesOutput, lastPage bool) (shouldContinue bool) { + for _, m := range page.VirtualMFADevices { + // UserName is `nil` for the root user + if m.User.UserName != nil && *m.User.UserName == username { + VirtualMFADevices = append(VirtualMFADevices, *m.SerialNumber) + } + } + return !lastPage + } + err = svc.ListVirtualMFADevicesPages(listVirtualMFADevices, pageOfVirtualMFADevices) + if err != nil { + return fmt.Errorf("Error removing Virtual MFA devices of user %s: %s", username, err) + } + for _, m := range VirtualMFADevices { + _, err := svc.DeactivateMFADevice(&iam.DeactivateMFADeviceInput{ + UserName: aws.String(username), + SerialNumber: aws.String(m), + }) + if err != nil { + return fmt.Errorf("Error deactivating Virtual MFA device %s: %s", m, err) + } + _, err = svc.DeleteVirtualMFADevice(&iam.DeleteVirtualMFADeviceInput{ + SerialNumber: aws.String(m), + }) + if err != nil { + return fmt.Errorf("Error deleting Virtual MFA device %s: %s", m, err) + } + } + + return nil +} + +func deactivateAwsIamUserMFADevices(svc *iam.IAM, username string) error { var MFADevices []string var err error diff --git a/aws/resource_aws_iam_user_test.go b/aws/resource_aws_iam_user_test.go index 39d647b7f90..eb6e2dad797 100644 --- a/aws/resource_aws_iam_user_test.go +++ b/aws/resource_aws_iam_user_test.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/iam" + "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" @@ -100,10 +101,45 @@ func testSweepIamUsers(region string) error { return nil } + var sweeperErrs *multierror.Error for _, user := range users { username := aws.StringValue(user.UserName) log.Printf("[DEBUG] Deleting IAM User: %s", username) + listUserPoliciesInput := &iam.ListUserPoliciesInput{ + UserName: user.UserName, + } + listUserPoliciesOutput, err := conn.ListUserPolicies(listUserPoliciesInput) + + if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { + continue + } + if err != nil { + sweeperErr := fmt.Errorf("error listing IAM User (%s) inline policies: %s", username, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue + } + + for _, inlinePolicyName := range listUserPoliciesOutput.PolicyNames { + log.Printf("[DEBUG] Deleting IAM User (%s) inline policy %q", username, *inlinePolicyName) + + input := &iam.DeleteUserPolicyInput{ + PolicyName: inlinePolicyName, + UserName: user.UserName, + } + + if _, err := conn.DeleteUserPolicy(input); err != nil { + if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { + continue + } + sweeperErr := fmt.Errorf("error deleting IAM User (%s) inline policy %q: %s", username, *inlinePolicyName, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue + } + } + listAttachedUserPoliciesInput := &iam.ListAttachedUserPoliciesInput{ UserName: user.UserName, } @@ -112,9 +148,11 @@ func testSweepIamUsers(region string) error { if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { continue } - if err != nil { - return fmt.Errorf("error listing IAM User (%s) attached policies: %s", username, err) + sweeperErr := fmt.Errorf("error listing IAM User (%s) attached policies: %s", username, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue } for _, attachedPolicy := range listAttachedUserPoliciesOutput.AttachedPolicies { @@ -123,28 +161,53 @@ func testSweepIamUsers(region string) error { log.Printf("[DEBUG] Detaching IAM User (%s) attached policy: %s", username, policyARN) if err := detachPolicyFromUser(conn, username, policyARN); err != nil { - return fmt.Errorf("error detaching IAM User (%s) attached policy (%s): %s", username, policyARN, err) + sweeperErr := fmt.Errorf("error detaching IAM User (%s) attached policy (%s): %s", username, policyARN, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue } } if err := deleteAwsIamUserGroupMemberships(conn, username); err != nil { - return fmt.Errorf("error removing IAM User (%s) group memberships: %s", username, err) + sweeperErr := fmt.Errorf("error removing IAM User (%s) group memberships: %s", username, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue } if err := deleteAwsIamUserAccessKeys(conn, username); err != nil { - return fmt.Errorf("error removing IAM User (%s) access keys: %s", username, err) + sweeperErr := fmt.Errorf("error removing IAM User (%s) access keys: %s", username, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue } if err := deleteAwsIamUserSSHKeys(conn, username); err != nil { - return fmt.Errorf("error removing IAM User (%s) SSH keys: %s", username, err) + sweeperErr := fmt.Errorf("error removing IAM User (%s) SSH keys: %s", username, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue } - if err := deleteAwsIamUserMFADevices(conn, username); err != nil { - return fmt.Errorf("error removing IAM User (%s) MFA devices: %s", username, err) + if err := deleteAwsIamUserVirtualMFADevices(conn, username); err != nil { + sweeperErr := fmt.Errorf("error removing IAM User (%s) virtual MFA devices: %s", username, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue + } + + if err := deactivateAwsIamUserMFADevices(conn, username); err != nil { + sweeperErr := fmt.Errorf("error removing IAM User (%s) MFA devices: %s", username, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue } if err := deleteAwsIamUserLoginProfile(conn, username); err != nil { - return fmt.Errorf("error removing IAM User (%s) login profile: %s", username, err) + sweeperErr := fmt.Errorf("error removing IAM User (%s) login profile: %s", username, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue } input := &iam.DeleteUserInput{ @@ -156,13 +219,15 @@ func testSweepIamUsers(region string) error { if isAWSErr(err, iam.ErrCodeNoSuchEntityException, "") { continue } - if err != nil { - return fmt.Errorf("Error deleting IAM User (%s): %s", username, err) + sweeperErr := fmt.Errorf("error deleting IAM User (%s): %s", username, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue } } - return nil + return sweeperErrs.ErrorOrNil() } func TestAccAWSUser_basic(t *testing.T) { diff --git a/aws/resource_aws_inspector_resource_group.go b/aws/resource_aws_inspector_resource_group.go index f568bd504a3..37c6739fdab 100644 --- a/aws/resource_aws_inspector_resource_group.go +++ b/aws/resource_aws_inspector_resource_group.go @@ -1,10 +1,10 @@ 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/inspector" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -18,8 +18,8 @@ func resourceAWSInspectorResourceGroup() *schema.Resource { Schema: map[string]*schema.Schema{ "tags": { ForceNew: true, - Type: schema.TypeMap, Required: true, + Type: schema.TypeMap, }, "arn": { Type: schema.TypeString, @@ -32,17 +32,17 @@ func resourceAWSInspectorResourceGroup() *schema.Resource { 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{})), - }) + req := &inspector.CreateResourceGroupInput{ + ResourceGroupTags: expandInspectorResourceGroupTags(d.Get("tags").(map[string]interface{})), + } + log.Printf("[DEBUG] Creating Inspector resource group: %#v", req) + resp, err := conn.CreateResourceGroup(req) if err != nil { - return err + return fmt.Errorf("error creating Inspector resource group: %s", err) } - d.Set("arn", *resp.ResourceGroupArn) - - d.SetId(*resp.ResourceGroupArn) + d.SetId(aws.StringValue(resp.ResourceGroupArn)) return resourceAwsInspectorResourceGroupRead(d, meta) } @@ -50,19 +50,34 @@ func resourceAwsInspectorResourceGroupCreate(d *schema.ResourceData, meta interf func resourceAwsInspectorResourceGroupRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).inspectorconn - _, err := conn.DescribeResourceGroups(&inspector.DescribeResourceGroupsInput{ - ResourceGroupArns: []*string{ - aws.String(d.Id()), - }, + resp, err := conn.DescribeResourceGroups(&inspector.DescribeResourceGroupsInput{ + ResourceGroupArns: aws.StringSlice([]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 fmt.Errorf("error reading Inspector resource group (%s): %s", d.Id(), err) + } + + if len(resp.ResourceGroups) == 0 { + if failedItem, ok := resp.FailedItems[d.Id()]; ok { + failureCode := aws.StringValue(failedItem.FailureCode) + if failureCode == inspector.FailedItemErrorCodeItemDoesNotExist { + log.Printf("[WARN] Inspector resource group (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + return fmt.Errorf("error reading Inspector resource group (%s): %s", d.Id(), failureCode) } + + return fmt.Errorf("error reading Inspector resource group (%s): %v", d.Id(), resp.FailedItems) + } + + resourceGroup := resp.ResourceGroups[0] + d.Set("arn", resourceGroup.Arn) + + if err := d.Set("tags", flattenInspectorResourceGroupTags(resourceGroup.Tags)); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -71,3 +86,26 @@ func resourceAwsInspectorResourceGroupRead(d *schema.ResourceData, meta interfac func resourceAwsInspectorResourceGroupDelete(d *schema.ResourceData, meta interface{}) error { return nil } + +func expandInspectorResourceGroupTags(m map[string]interface{}) []*inspector.ResourceGroupTag { + var result []*inspector.ResourceGroupTag + + for k, v := range m { + result = append(result, &inspector.ResourceGroupTag{ + Key: aws.String(k), + Value: aws.String(v.(string)), + }) + } + + return result +} + +func flattenInspectorResourceGroupTags(tags []*inspector.ResourceGroupTag) map[string]interface{} { + m := map[string]interface{}{} + + for _, tag := range tags { + m[aws.StringValue(tag.Key)] = aws.StringValue(tag.Value) + } + + return m +} diff --git a/aws/resource_aws_inspector_resource_group_test.go b/aws/resource_aws_inspector_resource_group_test.go index 675ec38ac15..02ed90200b9 100644 --- a/aws/resource_aws_inspector_resource_group_test.go +++ b/aws/resource_aws_inspector_resource_group_test.go @@ -2,13 +2,19 @@ package aws import ( "fmt" + "regexp" "testing" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/inspector" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) func TestAccAWSInspectorResourceGroup_basic(t *testing.T) { + var v1, v2 inspector.ResourceGroup + resourceName := "aws_inspector_resource_group.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -17,40 +23,72 @@ func TestAccAWSInspectorResourceGroup_basic(t *testing.T) { { Config: testAccAWSInspectorResourceGroup, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSInspectorResourceGroupExists("aws_inspector_resource_group.foo"), + testAccCheckAWSInspectorResourceGroupExists(resourceName, &v1), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "inspector", regexp.MustCompile(`resourcegroup/.+`)), + resource.TestCheckResourceAttr(resourceName, "tags.Name", "foo"), ), }, { Config: testAccCheckAWSInspectorResourceGroupModified, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSInspectorResourceGroupExists("aws_inspector_resource_group.foo"), + testAccCheckAWSInspectorResourceGroupExists(resourceName, &v2), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "inspector", regexp.MustCompile(`resourcegroup/.+`)), + resource.TestCheckResourceAttr(resourceName, "tags.Name", "bar"), + testAccCheckAWSInspectorResourceGroupRecreated(t, &v1, &v2), ), }, }, }) } -func testAccCheckAWSInspectorResourceGroupExists(name string) resource.TestCheckFunc { +func testAccCheckAWSInspectorResourceGroupExists(name string, rg *inspector.ResourceGroup) resource.TestCheckFunc { return func(s *terraform.State) error { - _, ok := s.RootModule().Resources[name] + conn := testAccProvider.Meta().(*AWSClient).inspectorconn + + rs, ok := s.RootModule().Resources[name] if !ok { return fmt.Errorf("Not found: %s", name) } + if rs.Primary.ID == "" { + return fmt.Errorf("No ID is set") + } + + output, err := conn.DescribeResourceGroups(&inspector.DescribeResourceGroupsInput{ + ResourceGroupArns: aws.StringSlice([]string{rs.Primary.ID}), + }) + if err != nil { + return err + } + if len(output.ResourceGroups) == 0 { + return fmt.Errorf("No matching Inspector resource groups") + } + + *rg = *output.ResourceGroups[0] + + return nil + } +} + +func testAccCheckAWSInspectorResourceGroupRecreated(t *testing.T, v1, v2 *inspector.ResourceGroup) resource.TestCheckFunc { + return func(s *terraform.State) error { + if v2.CreatedAt.Equal(*v1.CreatedAt) { + return fmt.Errorf("Inspector resource group not recreated when changing tags") + } return nil } } var testAccAWSInspectorResourceGroup = ` -resource "aws_inspector_resource_group" "foo" { - tags = { - Name = "foo" +resource "aws_inspector_resource_group" "test" { + tags = { + Name = "foo" } }` var testAccCheckAWSInspectorResourceGroupModified = ` -resource "aws_inspector_resource_group" "foo" { - tags = { - Name = "bar" +resource "aws_inspector_resource_group" "test" { + tags = { + Name = "bar" } }` diff --git a/aws/resource_aws_instance.go b/aws/resource_aws_instance.go index 6109413ecd9..529b6a37f82 100644 --- a/aws/resource_aws_instance.go +++ b/aws/resource_aws_instance.go @@ -19,6 +19,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsInstance() *schema.Resource { @@ -253,6 +254,12 @@ func resourceAwsInstance() *schema.Resource { Optional: true, }, + "hibernation": { + Type: schema.TypeBool, + Optional: true, + ForceNew: true, + }, + "monitoring": { Type: schema.TypeBool, Optional: true, @@ -336,13 +343,6 @@ func resourceAwsInstance() *schema.Resource { ForceNew: true, }, - "kms_key_id": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ForceNew: true, - }, - "iops": { Type: schema.TypeInt, Optional: true, @@ -351,6 +351,13 @@ func resourceAwsInstance() *schema.Resource { DiffSuppressFunc: iopsDiffSuppressFunc, }, + "kms_key_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + "snapshot_id": { Type: schema.TypeString, Optional: true, @@ -537,6 +544,9 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error { return err } + tagSpecifications := ec2TagSpecificationsFromMap(d.Get("tags").(map[string]interface{}), ec2.ResourceTypeInstance) + tagSpecifications = append(tagSpecifications, ec2TagSpecificationsFromMap(d.Get("volume_tags").(map[string]interface{}), ec2.ResourceTypeVolume)...) + // Build the creation struct runOpts := &ec2.RunInstancesInput{ BlockDeviceMappings: instanceOpts.BlockDeviceMappings, @@ -561,6 +571,8 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error { UserData: instanceOpts.UserData64, CreditSpecification: instanceOpts.CreditSpecification, CpuOptions: instanceOpts.CpuOptions, + HibernationOptions: instanceOpts.HibernationOptions, + TagSpecifications: tagSpecifications, } _, ipv6CountOk := d.GetOk("ipv6_address_count") @@ -570,34 +582,6 @@ func resourceAwsInstanceCreate(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Only 1 of `ipv6_address_count` or `ipv6_addresses` can be specified") } - tagsSpec := make([]*ec2.TagSpecification, 0) - - if v, ok := d.GetOk("tags"); ok { - tags := tagsFromMap(v.(map[string]interface{})) - - spec := &ec2.TagSpecification{ - ResourceType: aws.String("instance"), - Tags: tags, - } - - tagsSpec = append(tagsSpec, spec) - } - - if v, ok := d.GetOk("volume_tags"); ok { - tags := tagsFromMap(v.(map[string]interface{})) - - spec := &ec2.TagSpecification{ - ResourceType: aws.String("volume"), - Tags: tags, - } - - tagsSpec = append(tagsSpec, spec) - } - - if len(tagsSpec) > 0 { - runOpts.TagSpecifications = tagsSpec - } - // Create the instance log.Printf("[DEBUG] Run configuration: %s", runOpts) @@ -735,6 +719,10 @@ func resourceAwsInstanceRead(d *schema.ResourceData, meta interface{}) error { d.Set("cpu_threads_per_core", instance.CpuOptions.ThreadsPerCore) } + if instance.HibernationOptions != nil { + d.Set("hibernation", instance.HibernationOptions.Configured) + } + d.Set("ami", instance.ImageId) d.Set("instance_type", instance.InstanceType) d.Set("key_name", instance.KeyName) @@ -826,12 +814,19 @@ func resourceAwsInstanceRead(d *schema.ResourceData, meta interface{}) error { d.Set("monitoring", monitoringState == "enabled" || monitoringState == "pending") } - d.Set("tags", tagsToMap(instance.Tags)) + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(instance.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } - if err := readVolumeTags(conn, d); err != nil { + volumeTags, err := readVolumeTags(conn, d.Id()) + if err != nil { return err } + if err := d.Set("volume_tags", keyvaluetags.Ec2KeyValueTags(volumeTags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting volume_tags: %s", err) + } + if err := readSecurityGroups(d, instance, conn); err != nil { return err } @@ -923,15 +918,29 @@ func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error { d.Partial(true) if d.HasChange("tags") && !d.IsNewResource() { - if err := setTags(conn, d); err != nil { - return err + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) } + d.SetPartial("tags") } + if d.HasChange("volume_tags") && !d.IsNewResource() { - if err := setVolumeTags(conn, d); err != nil { + volumeIds, err := getAwsInstanceVolumeIds(conn, d.Id()) + if err != nil { return err } + + o, n := d.GetChange("volume_tags") + + for _, volumeId := range volumeIds { + if err := keyvaluetags.Ec2UpdateTags(conn, volumeId, o, n); err != nil { + return fmt.Errorf("error updating volume_tags (%s): %s", volumeId, err) + } + } + d.SetPartial("volume_tags") } @@ -955,29 +964,9 @@ func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error { 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 { - input := &ec2.AssociateIamInstanceProfileInput{ - InstanceId: aws.String(d.Id()), - IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ - Name: aws.String(d.Get("iam_instance_profile").(string)), - }, - } - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - _, err := conn.AssociateIamInstanceProfile(input) - if err != nil { - if isAWSErr(err, "InvalidParameterValue", "Invalid IAM Instance Profile") { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - return nil - }) - if isResourceTimeoutError(err) { - _, err = conn.AssociateIamInstanceProfile(input) - } - if err != nil { - return fmt.Errorf("Error associating instance with instance profile: %s", err) + if err := associateInstanceProfile(d, conn); err != nil { + return err } - } else { // Has an Iam Instance Profile associated with it, need to replace the association associationId := resp.IamInstanceProfileAssociations[0].AssociationId @@ -987,21 +976,37 @@ func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error { Name: aws.String(d.Get("iam_instance_profile").(string)), }, } - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - _, err := conn.ReplaceIamInstanceProfileAssociation(input) - if err != nil { - if isAWSErr(err, "InvalidParameterValue", "Invalid IAM Instance Profile") { - return resource.RetryableError(err) + + // If the instance is running, we can replace the instance profile association. + // If it is stopped, the association must be removed and the new one attached separately. (GH-8262) + instanceState := d.Get("instance_state").(string) + + if instanceState != "" { + if instanceState == ec2.InstanceStateNameStopped || instanceState == ec2.InstanceStateNameStopping || instanceState == ec2.InstanceStateNameShuttingDown { + if err := disassociateInstanceProfile(associationId, conn); err != nil { + return err + } + if err := associateInstanceProfile(d, conn); err != nil { + return err + } + } else { + err := resource.Retry(1*time.Minute, func() *resource.RetryError { + _, err := conn.ReplaceIamInstanceProfileAssociation(input) + if err != nil { + if isAWSErr(err, "InvalidParameterValue", "Invalid IAM Instance Profile") { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) + } + return nil + }) + if isResourceTimeoutError(err) { + _, err = conn.ReplaceIamInstanceProfileAssociation(input) + } + if err != nil { + return fmt.Errorf("Error replacing instance profile association: %s", err) } - return resource.NonRetryableError(err) } - return nil - }) - if isResourceTimeoutError(err) { - _, err = conn.ReplaceIamInstanceProfileAssociation(input) - } - if err != nil { - return fmt.Errorf("Error replacing instance profile association: %s", err) } } // An Iam Instance Profile has _not_ been provided but is pending a change. This means there is a pending removal @@ -1009,11 +1014,7 @@ func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error { 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 { + if err := disassociateInstanceProfile(associationId, conn); err != nil { return err } } @@ -1109,19 +1110,8 @@ func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error stopping instance (%s): %s", d.Id(), err) } - stateConf := &resource.StateChangeConf{ - Pending: []string{"pending", "running", "shutting-down", "stopped", "stopping"}, - Target: []string{"stopped"}, - Refresh: InstanceStateRefreshFunc(conn, d.Id(), []string{}), - Timeout: d.Timeout(schema.TimeoutUpdate), - 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) + if err := waitForInstanceStopping(conn, d.Id(), 10*time.Minute); err != nil { + return err } log.Printf("[INFO] Modifying instance type %s", d.Id()) @@ -1143,7 +1133,7 @@ func resourceAwsInstanceUpdate(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error starting instance (%s): %s", d.Id(), err) } - stateConf = &resource.StateChangeConf{ + stateConf := &resource.StateChangeConf{ Pending: []string{"pending", "stopped"}, Target: []string{"running"}, Refresh: InstanceStateRefreshFunc(conn, d.Id(), []string{"terminated"}), @@ -1233,7 +1223,12 @@ func resourceAwsInstanceDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn err := awsTerminateInstance(conn, d.Id(), d.Timeout(schema.TimeoutDelete)) - return err + + if err != nil { + return fmt.Errorf("error terminating EC2 Instance (%s): %s", d.Id(), err) + } + + return nil } // InstanceStateRefreshFunc returns a resource.StateRefreshFunc that is used to watch @@ -1311,10 +1306,47 @@ func readBlockDevices(d *schema.ResourceData, instance *ec2.Instance, conn *ec2. return nil } +func associateInstanceProfile(d *schema.ResourceData, conn *ec2.EC2) error { + input := &ec2.AssociateIamInstanceProfileInput{ + InstanceId: aws.String(d.Id()), + IamInstanceProfile: &ec2.IamInstanceProfileSpecification{ + Name: aws.String(d.Get("iam_instance_profile").(string)), + }, + } + err := resource.Retry(1*time.Minute, func() *resource.RetryError { + _, err := conn.AssociateIamInstanceProfile(input) + if err != nil { + if isAWSErr(err, "InvalidParameterValue", "Invalid IAM Instance Profile") { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) + } + return nil + }) + if isResourceTimeoutError(err) { + _, err = conn.AssociateIamInstanceProfile(input) + } + if err != nil { + return fmt.Errorf("error associating instance with instance profile: %s", err) + } + return nil +} + +func disassociateInstanceProfile(associationId *string, conn *ec2.EC2) error { + _, err := conn.DisassociateIamInstanceProfile(&ec2.DisassociateIamInstanceProfileInput{ + AssociationId: associationId, + }) + if err != nil { + return fmt.Errorf("error disassociating instance with instance profile: %w", 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 + // Ephemeral devices don't show up in BlockDeviceMappings or DescribeVolumes so we can't actually set them instanceBlockDevices := make(map[string]*ec2.InstanceBlockDeviceMapping) for _, bd := range instance.BlockDeviceMappings { @@ -1404,7 +1436,7 @@ func fetchRootDeviceName(ami string, conn *ec2.EC2) (*string, error) { // For a bad image, we just return nil so we don't block a refresh if len(res.Images) == 0 { - return nil, fmt.Errorf("No images found for AMI %s", ami) + return nil, nil } image := res.Images[0] @@ -1412,7 +1444,7 @@ func fetchRootDeviceName(ami string, conn *ec2.EC2) (*string, error) { // Instance store backed AMIs do not provide a root device name. if *image.RootDeviceType == ec2.DeviceTypeInstanceStore { - return nil, fmt.Errorf("Instance store backed AMIs do not provide a root device name - Use an EBS AMI") + return nil, nil } // Some AMIs have a RootDeviceName like "/dev/sda1" that does not appear as a @@ -1621,52 +1653,42 @@ func readBlockDeviceMappingsFromConfig( log.Print("[WARN] IOPs is only valid for storate type io1 for EBS Volumes") } - dn, err := fetchRootDeviceName(d.Get("ami").(string), conn) - if err != nil { - return nil, fmt.Errorf("Expected 1 AMI for ID: %s (%s)", d.Get("ami").(string), err) - } + 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, - }) + blockDevices = append(blockDevices, &ec2.BlockDeviceMapping{ + DeviceName: dn, + Ebs: ebs, + }) + } else { + return nil, err + } } } return blockDevices, nil } -func readVolumeTags(conn *ec2.EC2, d *schema.ResourceData) error { - volumeIds, err := getAwsInstanceVolumeIds(conn, d) +func readVolumeTags(conn *ec2.EC2, instanceId string) ([]*ec2.Tag, error) { + volumeIds, err := getAwsInstanceVolumeIds(conn, instanceId) if err != nil { - return err + return nil, err } - tagsResp, err := conn.DescribeTags(&ec2.DescribeTagsInput{ - Filters: []*ec2.Filter{ - { - Name: aws.String("resource-id"), - Values: volumeIds, - }, - }, + resp, err := conn.DescribeTags(&ec2.DescribeTagsInput{ + Filters: ec2AttributeFiltersFromMultimap(map[string][]string{ + "resource-id": volumeIds, + }), }) if err != nil { - return err - } - - var tags []*ec2.Tag - - for _, t := range tagsResp.Tags { - tag := &ec2.Tag{ - Key: t.Key, - Value: t.Value, - } - tags = append(tags, tag) + return nil, fmt.Errorf("error getting tags for volumes (%s): %s", volumeIds, err) } - d.Set("volume_tags", tagsToMap(tags)) - - return nil + return ec2TagsFromTagDescriptions(resp.Tags), nil } // Determine whether we're referring to security groups with @@ -1792,6 +1814,7 @@ type awsInstanceOpts struct { UserData64 *string CreditSpecification *ec2.CreditSpecificationRequest CpuOptions *ec2.CpuOptionsRequest + HibernationOptions *ec2.HibernationOptionsRequest } func buildAwsInstanceOpts( @@ -1883,6 +1906,12 @@ func buildAwsInstanceOpts( } } + if v := d.Get("hibernation"); v != "" { + opts.HibernationOptions = &ec2.HibernationOptionsRequest{ + Configured: aws.Bool(v.(bool)), + } + } + var groups []*string if v := d.Get("security_groups"); v != nil { // Security group names. @@ -1967,12 +1996,33 @@ func awsTerminateInstance(conn *ec2.EC2, id string, timeout time.Duration) error if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidInstanceID.NotFound" { return nil } - return fmt.Errorf("Error terminating instance: %s", err) + return err } return waitForInstanceDeletion(conn, id, timeout) } +func waitForInstanceStopping(conn *ec2.EC2, id string, timeout time.Duration) error { + log.Printf("[DEBUG] Waiting for instance (%s) to become stopped", id) + + stateConf := &resource.StateChangeConf{ + Pending: []string{"pending", "running", "shutting-down", "stopped", "stopping"}, + Target: []string{"stopped"}, + Refresh: InstanceStateRefreshFunc(conn, id, []string{}), + Timeout: timeout, + 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", id, err) + } + + return nil +} + func waitForInstanceDeletion(conn *ec2.EC2, id string, timeout time.Duration) error { log.Printf("[DEBUG] Waiting for instance (%s) to become terminated", id) @@ -2015,25 +2065,20 @@ func userDataHashSum(user_data string) string { return hex.EncodeToString(hash[:]) } -func getAwsInstanceVolumeIds(conn *ec2.EC2, d *schema.ResourceData) ([]*string, error) { - volumeIds := make([]*string, 0) +func getAwsInstanceVolumeIds(conn *ec2.EC2, instanceId string) ([]string, error) { + volumeIds := []string{} - opts := &ec2.DescribeVolumesInput{ - Filters: []*ec2.Filter{ - { - Name: aws.String("attachment.instance-id"), - Values: []*string{aws.String(d.Id())}, - }, - }, - } - - resp, err := conn.DescribeVolumes(opts) + resp, err := conn.DescribeVolumes(&ec2.DescribeVolumesInput{ + Filters: buildEC2AttributeFilterList(map[string]string{ + "attachment.instance-id": instanceId, + }), + }) if err != nil { - return nil, err + return nil, fmt.Errorf("error getting volumes for instance (%s): %s", instanceId, err) } for _, v := range resp.Volumes { - volumeIds = append(volumeIds, v.VolumeId) + volumeIds = append(volumeIds, aws.StringValue(v.VolumeId)) } return volumeIds, nil diff --git a/aws/resource_aws_instance_test.go b/aws/resource_aws_instance_test.go index b0e81032a57..d7464e3ec12 100644 --- a/aws/resource_aws_instance_test.go +++ b/aws/resource_aws_instance_test.go @@ -51,6 +51,24 @@ func testSweepInstances(region string) error { log.Printf("[INFO] Terminating EC2 Instance: %s", id) err := awsTerminateInstance(conn, id, 5*time.Minute) + + if isAWSErr(err, "OperationNotPermitted", "Modify its 'disableApiTermination' instance attribute and try again.") { + log.Printf("[INFO] Enabling API Termination on EC2 Instance: %s", id) + + input := &ec2.ModifyInstanceAttributeInput{ + InstanceId: instance.InstanceId, + DisableApiTermination: &ec2.AttributeBooleanValue{ + Value: aws.Bool(false), + }, + } + + _, err = conn.ModifyInstanceAttribute(input) + + if err == nil { + err = awsTerminateInstance(conn, id, 5*time.Minute) + } + } + if err != nil { log.Printf("[ERROR] Error terminating EC2 Instance (%s): %s", id, err) } @@ -128,31 +146,10 @@ func TestFetchRootDevice(t *testing.T) { } } -func TestAccAWSInstance_importBasic(t *testing.T) { - resourceName := "aws_instance.foo" - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckInstanceDestroy, - Steps: []resource.TestStep{ - { - Config: testAccInstanceConfigVPC, - }, - - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"associate_public_ip_address", "user_data"}, - }, - }, - }) -} - -func TestAccAWSInstance_importInDefaultVpcBySgName(t *testing.T) { - resourceName := "aws_instance.foo" - rInt := acctest.RandInt() +func TestAccAWSInstance_inDefaultVpcBySgName(t *testing.T) { + var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -160,9 +157,12 @@ func TestAccAWSInstance_importInDefaultVpcBySgName(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigInDefaultVpcBySgName(rInt), + Config: testAccInstanceConfigInDefaultVpcBySgName(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckInstanceExists( + resourceName, &v), + ), }, - { ResourceName: resourceName, ImportState: true, @@ -172,9 +172,10 @@ func TestAccAWSInstance_importInDefaultVpcBySgName(t *testing.T) { }) } -func TestAccAWSInstance_importInDefaultVpcBySgId(t *testing.T) { - resourceName := "aws_instance.foo" - rInt := acctest.RandInt() +func TestAccAWSInstance_inDefaultVpcBySgId(t *testing.T) { + var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -182,9 +183,12 @@ func TestAccAWSInstance_importInDefaultVpcBySgId(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigInDefaultVpcBySgId(rInt), + Config: testAccInstanceConfigInDefaultVpcBySgId(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckInstanceExists( + resourceName, &v), + ), }, - { ResourceName: resourceName, ImportState: true, @@ -194,9 +198,10 @@ func TestAccAWSInstance_importInDefaultVpcBySgId(t *testing.T) { }) } -func TestAccAWSInstance_importInEc2Classic(t *testing.T) { - resourceName := "aws_instance.foo" +func TestAccAWSInstance_inEc2Classic(t *testing.T) { + resourceName := "aws_instance.test" rInt := acctest.RandInt() + var v ec2.Instance // EC2 Classic enabled oldvar := os.Getenv("AWS_DEFAULT_REGION") @@ -210,8 +215,11 @@ func TestAccAWSInstance_importInEc2Classic(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccInstanceConfigInEc2Classic(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckInstanceExists( + resourceName, &v), + ), }, - { Config: testAccInstanceConfigInEc2Classic(rInt), ResourceName: resourceName, @@ -226,7 +234,7 @@ func TestAccAWSInstance_importInEc2Classic(t *testing.T) { func TestAccAWSInstance_basic(t *testing.T) { var v ec2.Instance var vol *ec2.Volume - + resourceName := "aws_instance.test" rInt := acctest.RandInt() testCheck := func(rInt int) func(*terraform.State) error { @@ -248,7 +256,7 @@ func TestAccAWSInstance_basic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -266,26 +274,29 @@ func TestAccAWSInstance_basic(t *testing.T) { return err }, }, - { Config: testAccInstanceConfig(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists( - "aws_instance.foo", &v), + resourceName, &v), testCheck(rInt), resource.TestCheckResourceAttr( - "aws_instance.foo", + resourceName, "user_data", "3dc39dda39be1205215e776bad998da361a5955d"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_block_device.#", "0"), + resourceName, "ebs_block_device.#", "0"), resource.TestMatchResourceAttr( - "aws_instance.foo", + resourceName, "arn", regexp.MustCompile(`^arn:[^:]+:ec2:[^:]+:\d{12}:instance/i-.+`)), ), }, - + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, // We repeat the exact same test so that we can be sure // that the user data hash stuff is working without generating // an incorrect diff. @@ -293,17 +304,16 @@ func TestAccAWSInstance_basic(t *testing.T) { Config: testAccInstanceConfig(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists( - "aws_instance.foo", &v), + resourceName, &v), testCheck(rInt), resource.TestCheckResourceAttr( - "aws_instance.foo", + resourceName, "user_data", "3dc39dda39be1205215e776bad998da361a5955d"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_block_device.#", "0"), + resourceName, "ebs_block_device.#", "0"), ), }, - // Clean up volume created above { Config: testAccInstanceConfig(rInt), @@ -319,8 +329,8 @@ func TestAccAWSInstance_basic(t *testing.T) { func TestAccAWSInstance_EbsBlockDevice_KmsKeyArn(t *testing.T) { var instance ec2.Instance - kmsKeyResourceName := "aws_kms_key.foo" - resourceName := "aws_instance.foo" + kmsKeyResourceName := "aws_kms_key.test" + resourceName := "aws_instance.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -342,8 +352,8 @@ func TestAccAWSInstance_EbsBlockDevice_KmsKeyArn(t *testing.T) { func TestAccAWSInstance_RootBlockDevice_KmsKeyArn(t *testing.T) { var instance ec2.Instance - kmsKeyResourceName := "aws_kms_key.foo" - resourceName := "aws_instance.foo" + kmsKeyResourceName := "aws_kms_key.test" + resourceName := "aws_instance.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -359,18 +369,23 @@ func TestAccAWSInstance_RootBlockDevice_KmsKeyArn(t *testing.T) { resource.TestCheckResourceAttrPair(resourceName, "root_block_device.0.kms_key_id", kmsKeyResourceName, "arn"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_userDataBase64(t *testing.T) { var v ec2.Instance - + resourceName := "aws_instance.test" rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ @@ -378,19 +393,26 @@ func TestAccAWSInstance_userDataBase64(t *testing.T) { Config: testAccInstanceConfigWithUserDataBase64(rInt), Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists( - "aws_instance.foo", &v), + resourceName, &v), resource.TestCheckResourceAttr( - "aws_instance.foo", + resourceName, "user_data_base64", "aGVsbG8gd29ybGQ="), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"user_data"}, + }, }, }) } func TestAccAWSInstance_GP2IopsDevice(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" testCheck := func() resource.TestCheckFunc { return func(*terraform.State) error { @@ -412,7 +434,7 @@ func TestAccAWSInstance_GP2IopsDevice(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, IDRefreshIgnore: []string{"ephemeral_block_device", "user_data"}, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -422,34 +444,46 @@ func TestAccAWSInstance_GP2IopsDevice(t *testing.T) { //Config: testAccInstanceConfigBlockDevices, Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists( - "aws_instance.foo", &v), + resourceName, &v), resource.TestCheckResourceAttr( - "aws_instance.foo", "root_block_device.#", "1"), + resourceName, "root_block_device.#", "1"), resource.TestCheckResourceAttr( - "aws_instance.foo", "root_block_device.0.volume_size", "11"), + resourceName, "root_block_device.0.volume_size", "11"), resource.TestCheckResourceAttr( - "aws_instance.foo", "root_block_device.0.volume_type", "gp2"), + resourceName, "root_block_device.0.volume_type", "gp2"), resource.TestCheckResourceAttr( - "aws_instance.foo", "root_block_device.0.iops", "100"), + resourceName, "root_block_device.0.iops", "100"), testCheck(), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_GP2WithIopsValue(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, IDRefreshIgnore: []string{"ephemeral_block_device", "user_data"}, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { Config: testAccInstanceGP2WithIopsValue, - Check: testAccCheckInstanceExists("aws_instance.foo", &v), + Check: testAccCheckInstanceExists(resourceName, &v), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, }, { Config: testAccInstanceGP2WithIopsValue, @@ -462,6 +496,7 @@ func TestAccAWSInstance_GP2WithIopsValue(t *testing.T) { func TestAccAWSInstance_blockDevices(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" testCheck := func() resource.TestCheckFunc { return func(*terraform.State) error { @@ -498,7 +533,7 @@ func TestAccAWSInstance_blockDevices(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, IDRefreshIgnore: []string{"ephemeral_block_device"}, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, @@ -507,68 +542,75 @@ func TestAccAWSInstance_blockDevices(t *testing.T) { Config: testAccInstanceConfigBlockDevices, Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists( - "aws_instance.foo", &v), + resourceName, &v), resource.TestCheckResourceAttr( - "aws_instance.foo", "root_block_device.#", "1"), + resourceName, "root_block_device.#", "1"), resource.TestMatchResourceAttr( - "aws_instance.foo", "root_block_device.0.volume_id", regexp.MustCompile("vol-[a-z0-9]+")), + resourceName, "root_block_device.0.volume_id", regexp.MustCompile("vol-[a-z0-9]+")), resource.TestCheckResourceAttr( - "aws_instance.foo", "root_block_device.0.volume_size", "11"), + resourceName, "root_block_device.0.volume_size", "11"), resource.TestCheckResourceAttr( - "aws_instance.foo", "root_block_device.0.volume_type", "gp2"), + resourceName, "root_block_device.0.volume_type", "gp2"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_block_device.#", "3"), + resourceName, "ebs_block_device.#", "3"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_block_device.2576023345.device_name", "/dev/sdb"), + resourceName, "ebs_block_device.2576023345.device_name", "/dev/sdb"), resource.TestMatchResourceAttr( - "aws_instance.foo", "ebs_block_device.2576023345.volume_id", regexp.MustCompile("vol-[a-z0-9]+")), + resourceName, "ebs_block_device.2576023345.volume_id", regexp.MustCompile("vol-[a-z0-9]+")), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_block_device.2576023345.volume_size", "9"), + resourceName, "ebs_block_device.2576023345.volume_size", "9"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_block_device.2576023345.volume_type", "gp2"), + resourceName, "ebs_block_device.2576023345.volume_type", "gp2"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_block_device.2554893574.device_name", "/dev/sdc"), + resourceName, "ebs_block_device.2554893574.device_name", "/dev/sdc"), resource.TestMatchResourceAttr( - "aws_instance.foo", "ebs_block_device.2554893574.volume_id", regexp.MustCompile("vol-[a-z0-9]+")), + resourceName, "ebs_block_device.2554893574.volume_id", regexp.MustCompile("vol-[a-z0-9]+")), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_block_device.2554893574.volume_size", "10"), + resourceName, "ebs_block_device.2554893574.volume_size", "10"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_block_device.2554893574.volume_type", "io1"), + resourceName, "ebs_block_device.2554893574.volume_type", "io1"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_block_device.2554893574.iops", "100"), + resourceName, "ebs_block_device.2554893574.iops", "100"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_block_device.2634515331.device_name", "/dev/sdd"), + resourceName, "ebs_block_device.2634515331.device_name", "/dev/sdd"), resource.TestMatchResourceAttr( - "aws_instance.foo", "ebs_block_device.2634515331.volume_id", regexp.MustCompile("vol-[a-z0-9]+")), + resourceName, "ebs_block_device.2634515331.volume_id", regexp.MustCompile("vol-[a-z0-9]+")), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_block_device.2634515331.encrypted", "true"), + resourceName, "ebs_block_device.2634515331.encrypted", "true"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_block_device.2634515331.volume_size", "12"), + resourceName, "ebs_block_device.2634515331.volume_size", "12"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ephemeral_block_device.#", "1"), + resourceName, "ephemeral_block_device.#", "1"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ephemeral_block_device.1692014856.device_name", "/dev/sde"), + resourceName, "ephemeral_block_device.1692014856.device_name", "/dev/sde"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ephemeral_block_device.1692014856.virtual_name", "ephemeral0"), + resourceName, "ephemeral_block_device.1692014856.virtual_name", "ephemeral0"), testCheck(), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"ephemeral_block_device"}, + }, }, }) } func TestAccAWSInstance_rootInstanceStore(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { Config: ` - resource "aws_instance" "foo" { + resource "aws_instance" "test" { # us-west-2 # Amazon Linux HVM Instance Store 64-bit (2016.09.0) # https://aws.amazon.com/amazon-linux-ami @@ -580,25 +622,31 @@ func TestAccAWSInstance_rootInstanceStore(t *testing.T) { }`, Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists( - "aws_instance.foo", &v), + resourceName, &v), resource.TestCheckResourceAttr( - "aws_instance.foo", "ami", "ami-44c36524"), + resourceName, "ami", "ami-44c36524"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_block_device.#", "0"), + resourceName, "ebs_block_device.#", "0"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_optimized", "false"), + resourceName, "ebs_optimized", "false"), resource.TestCheckResourceAttr( - "aws_instance.foo", "instance_type", "m3.medium"), + resourceName, "instance_type", "m3.medium"), resource.TestCheckResourceAttr( - "aws_instance.foo", "root_block_device.#", "0"), + resourceName, "root_block_device.#", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_noAMIEphemeralDevices(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" testCheck := func() resource.TestCheckFunc { return func(*terraform.State) error { @@ -629,14 +677,14 @@ func TestAccAWSInstance_noAMIEphemeralDevices(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, IDRefreshIgnore: []string{"ephemeral_block_device"}, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { Config: ` - resource "aws_instance" "foo" { + resource "aws_instance" "test" { # us-west-2 ami = "ami-01f05461" // This AMI (Ubuntu) contains two ephemerals @@ -657,40 +705,48 @@ func TestAccAWSInstance_noAMIEphemeralDevices(t *testing.T) { }`, Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists( - "aws_instance.foo", &v), + resourceName, &v), resource.TestCheckResourceAttr( - "aws_instance.foo", "ami", "ami-01f05461"), + resourceName, "ami", "ami-01f05461"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_optimized", "false"), + resourceName, "ebs_optimized", "false"), resource.TestCheckResourceAttr( - "aws_instance.foo", "instance_type", "c3.large"), + resourceName, "instance_type", "c3.large"), resource.TestCheckResourceAttr( - "aws_instance.foo", "root_block_device.#", "1"), + resourceName, "root_block_device.#", "1"), resource.TestCheckResourceAttr( - "aws_instance.foo", "root_block_device.0.volume_size", "11"), + resourceName, "root_block_device.0.volume_size", "11"), resource.TestCheckResourceAttr( - "aws_instance.foo", "root_block_device.0.volume_type", "gp2"), + resourceName, "root_block_device.0.volume_type", "gp2"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ebs_block_device.#", "0"), + resourceName, "ebs_block_device.#", "0"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ephemeral_block_device.#", "2"), + resourceName, "ephemeral_block_device.#", "2"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ephemeral_block_device.172787947.device_name", "/dev/sdb"), + resourceName, "ephemeral_block_device.172787947.device_name", "/dev/sdb"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ephemeral_block_device.172787947.no_device", "true"), + resourceName, "ephemeral_block_device.172787947.no_device", "true"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ephemeral_block_device.3336996981.device_name", "/dev/sdc"), + resourceName, "ephemeral_block_device.3336996981.device_name", "/dev/sdc"), resource.TestCheckResourceAttr( - "aws_instance.foo", "ephemeral_block_device.3336996981.no_device", "true"), + resourceName, "ephemeral_block_device.3336996981.no_device", "true"), testCheck(), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"ephemeral_block_device"}, + }, }, }) } func TestAccAWSInstance_sourceDestCheck(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) testCheck := func(enabled bool) resource.TestCheckFunc { return func(*terraform.State) error { @@ -707,30 +763,33 @@ func TestAccAWSInstance_sourceDestCheck(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigSourceDestDisable, + Config: testAccInstanceConfigSourceDestDisable(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), testCheck(false), ), }, - { - Config: testAccInstanceConfigSourceDestEnable, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccInstanceConfigSourceDestEnable(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), testCheck(true), ), }, - { - Config: testAccInstanceConfigSourceDestDisable, + Config: testAccInstanceConfigSourceDestDisable(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), testCheck(false), ), }, @@ -740,6 +799,8 @@ func TestAccAWSInstance_sourceDestCheck(t *testing.T) { func TestAccAWSInstance_disableApiTermination(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) checkDisableApiTermination := func(expected bool) resource.TestCheckFunc { return func(*terraform.State) error { @@ -761,22 +822,26 @@ func TestAccAWSInstance_disableApiTermination(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigDisableAPITermination(true), + Config: testAccInstanceConfigDisableAPITermination(rName, true), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), checkDisableApiTermination(true), ), }, - { - Config: testAccInstanceConfigDisableAPITermination(false), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccInstanceConfigDisableAPITermination(rName, false), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), checkDisableApiTermination(false), ), }, @@ -786,57 +851,73 @@ func TestAccAWSInstance_disableApiTermination(t *testing.T) { func TestAccAWSInstance_vpc(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, IDRefreshIgnore: []string{"associate_public_ip_address"}, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigVPC, + Config: testAccInstanceConfigVPC(rName), Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists( - "aws_instance.foo", &v), + resourceName, &v), resource.TestCheckResourceAttr( - "aws_instance.foo", + resourceName, "user_data", "562a3e32810edf6ff09994f050f12e799452379d"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"associate_public_ip_address", "user_data"}, + }, }, }) } func TestAccAWSInstance_placementGroup(t *testing.T) { var v ec2.Instance - rStr := acctest.RandString(5) + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, IDRefreshIgnore: []string{"associate_public_ip_address"}, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigPlacementGroup(rStr), + Config: testAccInstanceConfigPlacementGroup(rName), Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists( - "aws_instance.foo", &v), + resourceName, &v), resource.TestCheckResourceAttr( - "aws_instance.foo", + resourceName, "placement_group", - fmt.Sprintf("testAccInstanceConfigPlacementGroup_%s", rStr)), + rName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_ipv6_supportAddressCount(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -844,21 +925,27 @@ func TestAccAWSInstance_ipv6_supportAddressCount(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigIpv6Support, + Config: testAccInstanceConfigIpv6Support(rName), Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists( - "aws_instance.foo", &v), + resourceName, &v), resource.TestCheckResourceAttr( - "aws_instance.foo", + resourceName, "ipv6_address_count", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_ipv6AddressCountAndSingleAddressCausesError(t *testing.T) { + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -866,7 +953,7 @@ func TestAccAWSInstance_ipv6AddressCountAndSingleAddressCausesError(t *testing.T CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigIpv6ErrorConfig, + Config: testAccInstanceConfigIpv6ErrorConfig(rName), ExpectError: regexp.MustCompile("Only 1 of `ipv6_address_count` or `ipv6_addresses` can be specified"), }, }, @@ -875,6 +962,8 @@ func TestAccAWSInstance_ipv6AddressCountAndSingleAddressCausesError(t *testing.T func TestAccAWSInstance_ipv6_supportAddressCountWithIpv4(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -882,22 +971,28 @@ func TestAccAWSInstance_ipv6_supportAddressCountWithIpv4(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigIpv6SupportWithIpv4, + Config: testAccInstanceConfigIpv6SupportWithIpv4(rName), Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists( - "aws_instance.foo", &v), + resourceName, &v), resource.TestCheckResourceAttr( - "aws_instance.foo", + resourceName, "ipv6_address_count", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_multipleRegions(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" // record the initialized providers so that we can use them to // check for the instances in each region @@ -911,9 +1006,9 @@ func TestAccAWSInstance_multipleRegions(t *testing.T) { { Config: testAccInstanceConfigMultipleRegions, Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExistsWithProvider("aws_instance.foo", &v, + testAccCheckInstanceExistsWithProvider(resourceName, &v, testAccAwsRegionProviderFunc("us-west-2", &providers)), - testAccCheckInstanceExistsWithProvider("aws_instance.bar", &v, + testAccCheckInstanceExistsWithProvider("aws_instance.test2", &v, testAccAwsRegionProviderFunc("us-east-1", &providers)), ), }, @@ -923,58 +1018,68 @@ func TestAccAWSInstance_multipleRegions(t *testing.T) { func TestAccAWSInstance_NetworkInstanceSecurityGroups(t *testing.T) { var v ec2.Instance - - rInt := acctest.RandInt() + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo_instance", + IDRefreshName: resourceName, IDRefreshIgnore: []string{"associate_public_ip_address"}, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceNetworkInstanceSecurityGroups(rInt), + Config: testAccInstanceNetworkInstanceSecurityGroups(rName), Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists( - "aws_instance.foo_instance", &v), + resourceName, &v), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_NetworkInstanceRemovingAllSecurityGroups(t *testing.T) { var v ec2.Instance - - rInt := acctest.RandInt() + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo_instance", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceNetworkInstanceVPCSecurityGroupIDs(rInt), + Config: testAccInstanceNetworkInstanceVPCSecurityGroupIDs(rName), Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists( - "aws_instance.foo_instance", &v), + resourceName, &v), resource.TestCheckResourceAttr( - "aws_instance.foo_instance", "security_groups.#", "0"), + resourceName, "security_groups.#", "0"), resource.TestCheckResourceAttr( - "aws_instance.foo_instance", "vpc_security_group_ids.#", "1"), + resourceName, "vpc_security_group_ids.#", "1"), ), }, { - Config: testAccInstanceNetworkInstanceVPCRemoveSecurityGroupIDs(rInt), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccInstanceNetworkInstanceVPCRemoveSecurityGroupIDs(rName), Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists( - "aws_instance.foo_instance", &v), + resourceName, &v), resource.TestCheckResourceAttr( - "aws_instance.foo_instance", "security_groups.#", "0"), + resourceName, "security_groups.#", "0"), resource.TestCheckResourceAttr( - "aws_instance.foo_instance", "vpc_security_group_ids.#", "1"), + resourceName, "vpc_security_group_ids.#", "1"), ), ExpectError: regexp.MustCompile(`VPC-based instances require at least one security group to be attached`), }, @@ -984,32 +1089,38 @@ func TestAccAWSInstance_NetworkInstanceRemovingAllSecurityGroups(t *testing.T) { func TestAccAWSInstance_NetworkInstanceVPCSecurityGroupIDs(t *testing.T) { var v ec2.Instance - - rInt := acctest.RandInt() + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo_instance", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceNetworkInstanceVPCSecurityGroupIDs(rInt), + Config: testAccInstanceNetworkInstanceVPCSecurityGroupIDs(rName), Check: resource.ComposeTestCheckFunc( testAccCheckInstanceExists( - "aws_instance.foo_instance", &v), + resourceName, &v), resource.TestCheckResourceAttr( - "aws_instance.foo_instance", "security_groups.#", "0"), + resourceName, "security_groups.#", "0"), resource.TestCheckResourceAttr( - "aws_instance.foo_instance", "vpc_security_group_ids.#", "1"), + resourceName, "vpc_security_group_ids.#", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_tags(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1019,18 +1130,23 @@ func TestAccAWSInstance_tags(t *testing.T) { { Config: testAccCheckInstanceConfigTags, Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), - testAccCheckTags(&v.Tags, "foo", "bar"), + testAccCheckInstanceExists(resourceName, &v), + testAccCheckTags(&v.Tags, "test", "test2"), // Guard against regression of https://github.com/hashicorp/terraform/issues/914 testAccCheckTags(&v.Tags, "#", ""), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccCheckInstanceConfigTagsUpdate, Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), - testAccCheckTags(&v.Tags, "foo", ""), - testAccCheckTags(&v.Tags, "bar", "baz"), + testAccCheckInstanceExists(resourceName, &v), + testAccCheckTags(&v.Tags, "test", ""), + testAccCheckTags(&v.Tags, "test2", "test3"), ), }, }, @@ -1039,6 +1155,7 @@ func TestAccAWSInstance_tags(t *testing.T) { func TestAccAWSInstance_volumeTags(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1048,39 +1165,45 @@ func TestAccAWSInstance_volumeTags(t *testing.T) { { Config: testAccCheckInstanceConfigNoVolumeTags, Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), resource.TestCheckNoResourceAttr( - "aws_instance.foo", "volume_tags"), + resourceName, "volume_tags"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"ephemeral_block_device"}, + }, { Config: testAccCheckInstanceConfigWithVolumeTags, Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), resource.TestCheckResourceAttr( - "aws_instance.foo", "volume_tags.%", "1"), + resourceName, "volume_tags.%", "1"), resource.TestCheckResourceAttr( - "aws_instance.foo", "volume_tags.Name", "acceptance-test-volume-tag"), + resourceName, "volume_tags.Name", "acceptance-test-volume-tag"), ), }, { Config: testAccCheckInstanceConfigWithVolumeTagsUpdate, Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), resource.TestCheckResourceAttr( - "aws_instance.foo", "volume_tags.%", "2"), + resourceName, "volume_tags.%", "2"), resource.TestCheckResourceAttr( - "aws_instance.foo", "volume_tags.Name", "acceptance-test-volume-tag"), + resourceName, "volume_tags.Name", "acceptance-test-volume-tag"), resource.TestCheckResourceAttr( - "aws_instance.foo", "volume_tags.Environment", "dev"), + resourceName, "volume_tags.Environment", "dev"), ), }, { Config: testAccCheckInstanceConfigNoVolumeTags, Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), resource.TestCheckNoResourceAttr( - "aws_instance.foo", "volume_tags"), + resourceName, "volume_tags"), ), }, }, @@ -1089,6 +1212,7 @@ func TestAccAWSInstance_volumeTags(t *testing.T) { func TestAccAWSInstance_volumeTagsComputed(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1098,16 +1222,23 @@ func TestAccAWSInstance_volumeTagsComputed(t *testing.T) { { Config: testAccCheckInstanceConfigWithAttachedVolume, Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_instanceProfileChange(t *testing.T) { var v ec2.Instance - rName := acctest.RandString(5) + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) + rName2 := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) testCheckInstanceProfile := func() resource.TestCheckFunc { return func(*terraform.State) error { @@ -1121,20 +1252,38 @@ func TestAccAWSInstance_instanceProfileChange(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { Config: testAccInstanceConfigWithoutInstanceProfile(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccInstanceConfigWithInstanceProfile(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckInstanceExists(resourceName, &v), + testCheckInstanceProfile(), ), }, { Config: testAccInstanceConfigWithInstanceProfile(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckStopInstance(&v), // GH-8262 + ), + }, + { + Config: testAccInstanceConfigWithInstanceProfile(rName2), + Check: resource.ComposeTestCheckFunc( + testAccCheckInstanceExists(resourceName, &v), testCheckInstanceProfile(), ), }, @@ -1144,7 +1293,8 @@ func TestAccAWSInstance_instanceProfileChange(t *testing.T) { func TestAccAWSInstance_withIamInstanceProfile(t *testing.T) { var v ec2.Instance - rName := acctest.RandString(5) + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) testCheckInstanceProfile := func() resource.TestCheckFunc { return func(*terraform.State) error { @@ -1158,23 +1308,30 @@ func TestAccAWSInstance_withIamInstanceProfile(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { Config: testAccInstanceConfigWithInstanceProfile(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), testCheckInstanceProfile(), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_privateIP(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) testCheckPrivateIP := func() resource.TestCheckFunc { return func(*terraform.State) error { @@ -1188,23 +1345,30 @@ func TestAccAWSInstance_privateIP(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigPrivateIP, + Config: testAccInstanceConfigPrivateIP(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), testCheckPrivateIP(), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_associatePublicIPAndPrivateIP(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) testCheckPrivateIP := func() resource.TestCheckFunc { return func(*terraform.State) error { @@ -1218,18 +1382,23 @@ func TestAccAWSInstance_associatePublicIPAndPrivateIP(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, IDRefreshIgnore: []string{"associate_public_ip_address"}, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigAssociatePublicIPAndPrivateIP, + Config: testAccInstanceConfigAssociatePublicIPAndPrivateIP(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), testCheckPrivateIP(), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -1238,6 +1407,8 @@ func TestAccAWSInstance_associatePublicIPAndPrivateIP(t *testing.T) { // https://github.com/hashicorp/terraform/issues/2302 func TestAccAWSInstance_keyPairCheck(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) testCheckKeyPair := func(keyName string) resource.TestCheckFunc { return func(*terraform.State) error { @@ -1252,20 +1423,18 @@ func TestAccAWSInstance_keyPairCheck(t *testing.T) { } } - keyPairName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) - resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, IDRefreshIgnore: []string{"source_dest_check"}, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigKeyPair(keyPairName), + Config: testAccInstanceConfigKeyPair(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), - testCheckKeyPair(keyPairName), + testAccCheckInstanceExists(resourceName, &v), + testCheckKeyPair(rName), ), }, }, @@ -1274,6 +1443,8 @@ func TestAccAWSInstance_keyPairCheck(t *testing.T) { func TestAccAWSInstance_rootBlockDeviceMismatch(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1281,13 +1452,19 @@ func TestAccAWSInstance_rootBlockDeviceMismatch(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigRootBlockDeviceMismatch, + Config: testAccInstanceConfigRootBlockDeviceMismatch(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), resource.TestCheckResourceAttr( - "aws_instance.foo", "root_block_device.0.volume_size", "13"), + resourceName, "root_block_device.0.volume_size", "13"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"root_block_device"}, + }, }, }) } @@ -1303,27 +1480,34 @@ func TestAccAWSInstance_rootBlockDeviceMismatch(t *testing.T) { // set NewRemoved on the .# field when it changes to 0. func TestAccAWSInstance_forceNewAndTagsDrift(t *testing.T) { var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_instance.foo", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigForceNewAndTagsDrift, + Config: testAccInstanceConfigForceNewAndTagsDrift(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), driftTags(&v), ), ExpectNonEmptyPlan: true, }, { - Config: testAccInstanceConfigForceNewAndTagsDrift_Update, + Config: testAccInstanceConfigForceNewAndTagsDrift_Update(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &v), + testAccCheckInstanceExists(resourceName, &v), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -1331,6 +1515,7 @@ func TestAccAWSInstance_forceNewAndTagsDrift(t *testing.T) { func TestAccAWSInstance_changeInstanceType(t *testing.T) { var before ec2.Instance var after ec2.Instance + resourceName := "aws_instance.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1340,13 +1525,18 @@ func TestAccAWSInstance_changeInstanceType(t *testing.T) { { Config: testAccInstanceConfigWithSmallInstanceType, Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &before), + testAccCheckInstanceExists(resourceName, &before), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccInstanceConfigUpdateInstanceType, Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &after), + testAccCheckInstanceExists(resourceName, &after), testAccCheckInstanceNotRecreated( t, &before, &after), ), @@ -1357,7 +1547,10 @@ func TestAccAWSInstance_changeInstanceType(t *testing.T) { func TestAccAWSInstance_primaryNetworkInterface(t *testing.T) { var instance ec2.Instance - var ini ec2.NetworkInterface + var eni ec2.NetworkInterface + resourceName := "aws_instance.test" + eniResourceName := "aws_network_interface.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1365,20 +1558,29 @@ func TestAccAWSInstance_primaryNetworkInterface(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigPrimaryNetworkInterface, + Config: testAccInstanceConfigPrimaryNetworkInterface(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &instance), - testAccCheckAWSENIExists("aws_network_interface.bar", &ini), - resource.TestCheckResourceAttr("aws_instance.foo", "network_interface.#", "1"), + testAccCheckInstanceExists(resourceName, &instance), + testAccCheckAWSENIExists(eniResourceName, &eni), + resource.TestCheckResourceAttr(resourceName, "network_interface.#", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"network_interface"}, + }, }, }) } func TestAccAWSInstance_primaryNetworkInterfaceSourceDestCheck(t *testing.T) { var instance ec2.Instance - var ini ec2.NetworkInterface + var eni ec2.NetworkInterface + resourceName := "aws_instance.test" + eniResourceName := "aws_network_interface.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1386,13 +1588,19 @@ func TestAccAWSInstance_primaryNetworkInterfaceSourceDestCheck(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigPrimaryNetworkInterfaceSourceDestCheck, + Config: testAccInstanceConfigPrimaryNetworkInterfaceSourceDestCheck(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &instance), - testAccCheckAWSENIExists("aws_network_interface.bar", &ini), - resource.TestCheckResourceAttr("aws_instance.foo", "source_dest_check", "false"), + testAccCheckInstanceExists(resourceName, &instance), + testAccCheckAWSENIExists(eniResourceName, &eni), + resource.TestCheckResourceAttr(resourceName, "source_dest_check", "false"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"network_interface"}, + }, }, }) } @@ -1400,8 +1608,12 @@ func TestAccAWSInstance_primaryNetworkInterfaceSourceDestCheck(t *testing.T) { func TestAccAWSInstance_addSecondaryInterface(t *testing.T) { var before ec2.Instance var after ec2.Instance - var iniPrimary ec2.NetworkInterface - var iniSecondary ec2.NetworkInterface + var eniPrimary ec2.NetworkInterface + var eniSecondary ec2.NetworkInterface + resourceName := "aws_instance.test" + eniPrimaryResourceName := "aws_network_interface.primary" + eniSecondaryResourceName := "aws_network_interface.secondary" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1409,20 +1621,26 @@ func TestAccAWSInstance_addSecondaryInterface(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigAddSecondaryNetworkInterfaceBefore, + Config: testAccInstanceConfigAddSecondaryNetworkInterfaceBefore(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &before), - testAccCheckAWSENIExists("aws_network_interface.primary", &iniPrimary), - resource.TestCheckResourceAttr("aws_instance.foo", "network_interface.#", "1"), + testAccCheckInstanceExists(resourceName, &before), + testAccCheckAWSENIExists(eniPrimaryResourceName, &eniPrimary), + resource.TestCheckResourceAttr(resourceName, "network_interface.#", "1"), ), }, { - Config: testAccInstanceConfigAddSecondaryNetworkInterfaceAfter, - Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &after), - testAccCheckAWSENIExists("aws_network_interface.secondary", &iniSecondary), - resource.TestCheckResourceAttr("aws_instance.foo", "network_interface.#", "1"), - ), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"network_interface"}, + }, + { + Config: testAccInstanceConfigAddSecondaryNetworkInterfaceAfter(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckInstanceExists(resourceName, &after), + testAccCheckAWSENIExists(eniSecondaryResourceName, &eniSecondary), + resource.TestCheckResourceAttr(resourceName, "network_interface.#", "1"), + ), }, }, }) @@ -1432,6 +1650,8 @@ func TestAccAWSInstance_addSecondaryInterface(t *testing.T) { func TestAccAWSInstance_addSecurityGroupNetworkInterface(t *testing.T) { var before ec2.Instance var after ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1439,17 +1659,22 @@ func TestAccAWSInstance_addSecurityGroupNetworkInterface(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfigAddSecurityGroupBefore, + Config: testAccInstanceConfigAddSecurityGroupBefore(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &before), - resource.TestCheckResourceAttr("aws_instance.foo", "vpc_security_group_ids.#", "1"), + testAccCheckInstanceExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "vpc_security_group_ids.#", "1"), ), }, { - Config: testAccInstanceConfigAddSecurityGroupAfter, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccInstanceConfigAddSecurityGroupAfter(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &after), - resource.TestCheckResourceAttr("aws_instance.foo", "vpc_security_group_ids.#", "2"), + testAccCheckInstanceExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "vpc_security_group_ids.#", "2"), ), }, }, @@ -1458,9 +1683,9 @@ func TestAccAWSInstance_addSecurityGroupNetworkInterface(t *testing.T) { // https://github.com/terraform-providers/terraform-provider-aws/issues/227 func TestAccAWSInstance_associatePublic_defaultPrivate(t *testing.T) { - var before ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1468,22 +1693,27 @@ func TestAccAWSInstance_associatePublic_defaultPrivate(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_associatePublic_defaultPrivate(rInt), + Config: testAccInstanceConfig_associatePublic_defaultPrivate(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &before), - resource.TestCheckResourceAttr(resName, "associate_public_ip_address", "false"), - resource.TestCheckResourceAttr(resName, "public_ip", ""), + testAccCheckInstanceExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "associate_public_ip_address", "false"), + resource.TestCheckResourceAttr(resourceName, "public_ip", ""), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } // https://github.com/terraform-providers/terraform-provider-aws/issues/227 func TestAccAWSInstance_associatePublic_defaultPublic(t *testing.T) { - var before ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1491,22 +1721,27 @@ func TestAccAWSInstance_associatePublic_defaultPublic(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_associatePublic_defaultPublic(rInt), + Config: testAccInstanceConfig_associatePublic_defaultPublic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &before), - resource.TestCheckResourceAttr(resName, "associate_public_ip_address", "true"), - resource.TestCheckResourceAttrSet(resName, "public_ip"), + testAccCheckInstanceExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "associate_public_ip_address", "true"), + resource.TestCheckResourceAttrSet(resourceName, "public_ip"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } // https://github.com/terraform-providers/terraform-provider-aws/issues/227 func TestAccAWSInstance_associatePublic_explicitPublic(t *testing.T) { - var before ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1514,22 +1749,27 @@ func TestAccAWSInstance_associatePublic_explicitPublic(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_associatePublic_explicitPublic(rInt), + Config: testAccInstanceConfig_associatePublic_explicitPublic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &before), - resource.TestCheckResourceAttr(resName, "associate_public_ip_address", "true"), - resource.TestCheckResourceAttrSet(resName, "public_ip"), + testAccCheckInstanceExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "associate_public_ip_address", "true"), + resource.TestCheckResourceAttrSet(resourceName, "public_ip"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } // https://github.com/terraform-providers/terraform-provider-aws/issues/227 func TestAccAWSInstance_associatePublic_explicitPrivate(t *testing.T) { - var before ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1537,22 +1777,27 @@ func TestAccAWSInstance_associatePublic_explicitPrivate(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_associatePublic_explicitPrivate(rInt), + Config: testAccInstanceConfig_associatePublic_explicitPrivate(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &before), - resource.TestCheckResourceAttr(resName, "associate_public_ip_address", "false"), - resource.TestCheckResourceAttr(resName, "public_ip", ""), + testAccCheckInstanceExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "associate_public_ip_address", "false"), + resource.TestCheckResourceAttr(resourceName, "public_ip", ""), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } // https://github.com/terraform-providers/terraform-provider-aws/issues/227 func TestAccAWSInstance_associatePublic_overridePublic(t *testing.T) { - var before ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1560,22 +1805,27 @@ func TestAccAWSInstance_associatePublic_overridePublic(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_associatePublic_overridePublic(rInt), + Config: testAccInstanceConfig_associatePublic_overridePublic(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &before), - resource.TestCheckResourceAttr(resName, "associate_public_ip_address", "true"), - resource.TestCheckResourceAttrSet(resName, "public_ip"), + testAccCheckInstanceExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "associate_public_ip_address", "true"), + resource.TestCheckResourceAttrSet(resourceName, "public_ip"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } // https://github.com/terraform-providers/terraform-provider-aws/issues/227 func TestAccAWSInstance_associatePublic_overridePrivate(t *testing.T) { - var before ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1583,21 +1833,26 @@ func TestAccAWSInstance_associatePublic_overridePrivate(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_associatePublic_overridePrivate(rInt), + Config: testAccInstanceConfig_associatePublic_overridePrivate(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &before), - resource.TestCheckResourceAttr(resName, "associate_public_ip_address", "false"), - resource.TestCheckResourceAttr(resName, "public_ip", ""), + testAccCheckInstanceExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "associate_public_ip_address", "false"), + resource.TestCheckResourceAttr(resourceName, "public_ip", ""), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_getPasswordData_falseToTrue(t *testing.T) { var before, after ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1605,20 +1860,25 @@ func TestAccAWSInstance_getPasswordData_falseToTrue(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_getPasswordData(false, rInt), + Config: testAccInstanceConfig_getPasswordData(rName, false), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &before), - resource.TestCheckResourceAttr(resName, "get_password_data", "false"), - resource.TestCheckResourceAttr(resName, "password_data", ""), + testAccCheckInstanceExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "get_password_data", "false"), + resource.TestCheckResourceAttr(resourceName, "password_data", ""), ), }, { - Config: testAccInstanceConfig_getPasswordData(true, rInt), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccInstanceConfig_getPasswordData(rName, true), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &after), + testAccCheckInstanceExists(resourceName, &after), testAccCheckInstanceNotRecreated(t, &before, &after), - resource.TestCheckResourceAttr(resName, "get_password_data", "true"), - resource.TestCheckResourceAttrSet(resName, "password_data"), + resource.TestCheckResourceAttr(resourceName, "get_password_data", "true"), + resource.TestCheckResourceAttrSet(resourceName, "password_data"), ), }, }, @@ -1627,8 +1887,8 @@ func TestAccAWSInstance_getPasswordData_falseToTrue(t *testing.T) { func TestAccAWSInstance_getPasswordData_trueToFalse(t *testing.T) { var before, after ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1636,20 +1896,26 @@ func TestAccAWSInstance_getPasswordData_trueToFalse(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_getPasswordData(true, rInt), + Config: testAccInstanceConfig_getPasswordData(rName, true), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &before), - resource.TestCheckResourceAttr(resName, "get_password_data", "true"), - resource.TestCheckResourceAttrSet(resName, "password_data"), + testAccCheckInstanceExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "get_password_data", "true"), + resource.TestCheckResourceAttrSet(resourceName, "password_data"), ), }, { - Config: testAccInstanceConfig_getPasswordData(false, rInt), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"password_data", "get_password_data"}, + }, + { + Config: testAccInstanceConfig_getPasswordData(rName, false), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &after), + testAccCheckInstanceExists(resourceName, &after), testAccCheckInstanceNotRecreated(t, &before, &after), - resource.TestCheckResourceAttr(resName, "get_password_data", "false"), - resource.TestCheckResourceAttr(resName, "password_data", ""), + resource.TestCheckResourceAttr(resourceName, "get_password_data", "false"), + resource.TestCheckResourceAttr(resourceName, "password_data", ""), ), }, }, @@ -1657,9 +1923,9 @@ func TestAccAWSInstance_getPasswordData_trueToFalse(t *testing.T) { } func TestAccAWSInstance_CreditSpecification_Empty_NonBurstable(t *testing.T) { - var instance ec2.Instance + var v ec2.Instance resourceName := "aws_instance.test" - rName := acctest.RandomWithPrefix("tf-acc-test") + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1669,9 +1935,15 @@ func TestAccAWSInstance_CreditSpecification_Empty_NonBurstable(t *testing.T) { { Config: testAccInstanceConfig_CreditSpecification_Empty_NonBurstable(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resourceName, &instance), + testAccCheckInstanceExists(resourceName, &v), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"credit_specification"}, + }, }, }) } @@ -1680,7 +1952,7 @@ func TestAccAWSInstance_CreditSpecification_Empty_NonBurstable(t *testing.T) { func TestAccAWSInstance_CreditSpecification_UnspecifiedToEmpty_NonBurstable(t *testing.T) { var instance ec2.Instance resourceName := "aws_instance.test" - rName := acctest.RandomWithPrefix("tf-acc-test") + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1693,6 +1965,11 @@ func TestAccAWSInstance_CreditSpecification_UnspecifiedToEmpty_NonBurstable(t *t testAccCheckInstanceExists(resourceName, &instance), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccInstanceConfig_CreditSpecification_Empty_NonBurstable(rName), Check: resource.ComposeTestCheckFunc( @@ -1704,9 +1981,9 @@ func TestAccAWSInstance_CreditSpecification_UnspecifiedToEmpty_NonBurstable(t *t } func TestAccAWSInstance_creditSpecification_unspecifiedDefaultsToStandard(t *testing.T) { - var instance ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1714,21 +1991,26 @@ func TestAccAWSInstance_creditSpecification_unspecifiedDefaultsToStandard(t *tes CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_creditSpecification_unspecified(rInt), + Config: testAccInstanceConfig_creditSpecification_unspecified(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &instance), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "standard"), + testAccCheckInstanceExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "standard"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_creditSpecification_standardCpuCredits(t *testing.T) { var first, second ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1736,19 +2018,24 @@ func TestAccAWSInstance_creditSpecification_standardCpuCredits(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_creditSpecification_standardCpuCredits(rInt), + Config: testAccInstanceConfig_creditSpecification_standardCpuCredits(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &first), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "standard"), + testAccCheckInstanceExists(resourceName, &first), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "standard"), ), }, { - Config: testAccInstanceConfig_creditSpecification_unspecified(rInt), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccInstanceConfig_creditSpecification_unspecified(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &second), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "standard"), + testAccCheckInstanceExists(resourceName, &second), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "standard"), ), }, }, @@ -1757,8 +2044,8 @@ func TestAccAWSInstance_creditSpecification_standardCpuCredits(t *testing.T) { func TestAccAWSInstance_creditSpecification_unlimitedCpuCredits(t *testing.T) { var first, second ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1766,19 +2053,24 @@ func TestAccAWSInstance_creditSpecification_unlimitedCpuCredits(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_creditSpecification_unlimitedCpuCredits(rInt), + Config: testAccInstanceConfig_creditSpecification_unlimitedCpuCredits(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &first), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "unlimited"), + testAccCheckInstanceExists(resourceName, &first), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "unlimited"), ), }, { - Config: testAccInstanceConfig_creditSpecification_unspecified(rInt), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccInstanceConfig_creditSpecification_unspecified(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &second), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "unlimited"), + testAccCheckInstanceExists(resourceName, &second), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "unlimited"), ), }, }, @@ -1786,9 +2078,9 @@ func TestAccAWSInstance_creditSpecification_unlimitedCpuCredits(t *testing.T) { } func TestAccAWSInstance_creditSpecification_unknownCpuCredits_t2(t *testing.T) { - var instance ec2.Instance - rInt := acctest.RandInt() - resName := "aws_instance.foo" + var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1796,21 +2088,26 @@ func TestAccAWSInstance_creditSpecification_unknownCpuCredits_t2(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_creditSpecification_unknownCpuCredits(rInt, "t2.micro"), + Config: testAccInstanceConfig_creditSpecification_unknownCpuCredits(rName, "t2.micro"), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &instance), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "standard"), + testAccCheckInstanceExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "standard"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_creditSpecification_unknownCpuCredits_t3(t *testing.T) { - var instance ec2.Instance - rInt := acctest.RandInt() - resName := "aws_instance.foo" + var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1818,21 +2115,26 @@ func TestAccAWSInstance_creditSpecification_unknownCpuCredits_t3(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_creditSpecification_unknownCpuCredits(rInt, "t3.micro"), + Config: testAccInstanceConfig_creditSpecification_unknownCpuCredits(rName, "t3.micro"), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &instance), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "unlimited"), + testAccCheckInstanceExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "unlimited"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_creditSpecification_updateCpuCredits(t *testing.T) { var first, second, third ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1840,27 +2142,32 @@ func TestAccAWSInstance_creditSpecification_updateCpuCredits(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_creditSpecification_standardCpuCredits(rInt), + Config: testAccInstanceConfig_creditSpecification_standardCpuCredits(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &first), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "standard"), + testAccCheckInstanceExists(resourceName, &first), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "standard"), ), }, { - Config: testAccInstanceConfig_creditSpecification_unlimitedCpuCredits(rInt), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccInstanceConfig_creditSpecification_unlimitedCpuCredits(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &second), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "unlimited"), + testAccCheckInstanceExists(resourceName, &second), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "unlimited"), ), }, { - Config: testAccInstanceConfig_creditSpecification_standardCpuCredits(rInt), + Config: testAccInstanceConfig_creditSpecification_standardCpuCredits(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &third), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "standard"), + testAccCheckInstanceExists(resourceName, &third), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "standard"), ), }, }, @@ -1868,9 +2175,9 @@ func TestAccAWSInstance_creditSpecification_updateCpuCredits(t *testing.T) { } func TestAccAWSInstance_creditSpecification_isNotAppliedToNonBurstable(t *testing.T) { - var instance ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1878,19 +2185,25 @@ func TestAccAWSInstance_creditSpecification_isNotAppliedToNonBurstable(t *testin CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_creditSpecification_isNotAppliedToNonBurstable(rInt), + Config: testAccInstanceConfig_creditSpecification_isNotAppliedToNonBurstable(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &instance), + testAccCheckInstanceExists(resourceName, &v), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"credit_specification"}, + }, }, }) } func TestAccAWSInstance_creditSpecificationT3_unspecifiedDefaultsToUnlimited(t *testing.T) { - var instance ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + var v ec2.Instance + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1898,21 +2211,26 @@ func TestAccAWSInstance_creditSpecificationT3_unspecifiedDefaultsToUnlimited(t * CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_creditSpecification_unspecified_t3(rInt), + Config: testAccInstanceConfig_creditSpecification_unspecified_t3(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &instance), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "unlimited"), + testAccCheckInstanceExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "unlimited"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSInstance_creditSpecificationT3_standardCpuCredits(t *testing.T) { var first, second ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1920,19 +2238,24 @@ func TestAccAWSInstance_creditSpecificationT3_standardCpuCredits(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_creditSpecification_standardCpuCredits_t3(rInt), + Config: testAccInstanceConfig_creditSpecification_standardCpuCredits_t3(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &first), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "standard"), + testAccCheckInstanceExists(resourceName, &first), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "standard"), ), }, { - Config: testAccInstanceConfig_creditSpecification_unspecified_t3(rInt), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccInstanceConfig_creditSpecification_unspecified_t3(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &second), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "standard"), + testAccCheckInstanceExists(resourceName, &second), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "standard"), ), }, }, @@ -1941,8 +2264,8 @@ func TestAccAWSInstance_creditSpecificationT3_standardCpuCredits(t *testing.T) { func TestAccAWSInstance_creditSpecificationT3_unlimitedCpuCredits(t *testing.T) { var first, second ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1950,19 +2273,24 @@ func TestAccAWSInstance_creditSpecificationT3_unlimitedCpuCredits(t *testing.T) CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_creditSpecification_unlimitedCpuCredits_t3(rInt), + Config: testAccInstanceConfig_creditSpecification_unlimitedCpuCredits_t3(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &first), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "unlimited"), + testAccCheckInstanceExists(resourceName, &first), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "unlimited"), ), }, { - Config: testAccInstanceConfig_creditSpecification_unspecified_t3(rInt), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccInstanceConfig_creditSpecification_unspecified_t3(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &second), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "unlimited"), + testAccCheckInstanceExists(resourceName, &second), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "unlimited"), ), }, }, @@ -1971,8 +2299,8 @@ func TestAccAWSInstance_creditSpecificationT3_unlimitedCpuCredits(t *testing.T) func TestAccAWSInstance_creditSpecificationT3_updateCpuCredits(t *testing.T) { var first, second, third ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -1980,27 +2308,32 @@ func TestAccAWSInstance_creditSpecificationT3_updateCpuCredits(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_creditSpecification_standardCpuCredits_t3(rInt), + Config: testAccInstanceConfig_creditSpecification_standardCpuCredits_t3(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &first), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "standard"), + testAccCheckInstanceExists(resourceName, &first), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "standard"), ), }, { - Config: testAccInstanceConfig_creditSpecification_unlimitedCpuCredits_t3(rInt), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccInstanceConfig_creditSpecification_unlimitedCpuCredits_t3(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &second), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "unlimited"), + testAccCheckInstanceExists(resourceName, &second), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "unlimited"), ), }, { - Config: testAccInstanceConfig_creditSpecification_standardCpuCredits_t3(rInt), + Config: testAccInstanceConfig_creditSpecification_standardCpuCredits_t3(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &third), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "standard"), + testAccCheckInstanceExists(resourceName, &third), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "standard"), ), }, }, @@ -2009,8 +2342,8 @@ func TestAccAWSInstance_creditSpecificationT3_updateCpuCredits(t *testing.T) { func TestAccAWSInstance_creditSpecification_standardCpuCredits_t2Tot3Taint(t *testing.T) { var before, after ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -2018,21 +2351,26 @@ func TestAccAWSInstance_creditSpecification_standardCpuCredits_t2Tot3Taint(t *te CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_creditSpecification_standardCpuCredits(rInt), + Config: testAccInstanceConfig_creditSpecification_standardCpuCredits(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &before), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "standard"), + testAccCheckInstanceExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "standard"), ), }, { - Config: testAccInstanceConfig_creditSpecification_standardCpuCredits_t3(rInt), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccInstanceConfig_creditSpecification_standardCpuCredits_t3(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &after), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "standard"), + testAccCheckInstanceExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "standard"), ), - Taint: []string{resName}, + Taint: []string{resourceName}, }, }, }) @@ -2040,8 +2378,8 @@ func TestAccAWSInstance_creditSpecification_standardCpuCredits_t2Tot3Taint(t *te func TestAccAWSInstance_creditSpecification_unlimitedCpuCredits_t2Tot3Taint(t *testing.T) { var before, after ec2.Instance - resName := "aws_instance.foo" - rInt := acctest.RandInt() + resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -2049,21 +2387,26 @@ func TestAccAWSInstance_creditSpecification_unlimitedCpuCredits_t2Tot3Taint(t *t CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_creditSpecification_unlimitedCpuCredits(rInt), + Config: testAccInstanceConfig_creditSpecification_unlimitedCpuCredits(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &before), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "unlimited"), + testAccCheckInstanceExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "unlimited"), ), }, { - Config: testAccInstanceConfig_creditSpecification_unlimitedCpuCredits_t3(rInt), + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccInstanceConfig_creditSpecification_unlimitedCpuCredits_t3(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resName, &after), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "unlimited"), + testAccCheckInstanceExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "unlimited"), ), - Taint: []string{resName}, + Taint: []string{resourceName}, }, }, }) @@ -2072,6 +2415,7 @@ func TestAccAWSInstance_creditSpecification_unlimitedCpuCredits_t2Tot3Taint(t *t func TestAccAWSInstance_disappears(t *testing.T) { var conf ec2.Instance rInt := acctest.RandInt() + resourceName := "aws_instance.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -2081,7 +2425,7 @@ func TestAccAWSInstance_disappears(t *testing.T) { { Config: testAccInstanceConfig(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists("aws_instance.foo", &conf), + testAccCheckInstanceExists(resourceName, &conf), testAccCheckInstanceDisappears(&conf), ), ExpectNonEmptyPlan: true, @@ -2091,9 +2435,9 @@ func TestAccAWSInstance_disappears(t *testing.T) { } func TestAccAWSInstance_UserData_EmptyStringToUnspecified(t *testing.T) { - var instance ec2.Instance - rInt := acctest.RandInt() + var v ec2.Instance resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -2101,14 +2445,20 @@ func TestAccAWSInstance_UserData_EmptyStringToUnspecified(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_UserData_EmptyString(rInt), + Config: testAccInstanceConfig_UserData_EmptyString(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resourceName, &instance), + testAccCheckInstanceExists(resourceName, &v), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"user_data"}, + }, // Switching should show no difference { - Config: testAccInstanceConfig_UserData_Unspecified(rInt), + Config: testAccInstanceConfig_UserData_Unspecified(rName), ExpectNonEmptyPlan: false, PlanOnly: true, }, @@ -2117,9 +2467,9 @@ func TestAccAWSInstance_UserData_EmptyStringToUnspecified(t *testing.T) { } func TestAccAWSInstance_UserData_UnspecifiedToEmptyString(t *testing.T) { - var instance ec2.Instance - rInt := acctest.RandInt() + var v ec2.Instance resourceName := "aws_instance.test" + rName := fmt.Sprintf("tf-testacc-instance-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -2127,14 +2477,19 @@ func TestAccAWSInstance_UserData_UnspecifiedToEmptyString(t *testing.T) { CheckDestroy: testAccCheckInstanceDestroy, Steps: []resource.TestStep{ { - Config: testAccInstanceConfig_UserData_Unspecified(rInt), + Config: testAccInstanceConfig_UserData_Unspecified(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckInstanceExists(resourceName, &instance), + testAccCheckInstanceExists(resourceName, &v), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, // Switching should show no difference { - Config: testAccInstanceConfig_UserData_EmptyString(rInt), + Config: testAccInstanceConfig_UserData_EmptyString(rName), ExpectNonEmptyPlan: false, PlanOnly: true, }, @@ -2142,6 +2497,39 @@ func TestAccAWSInstance_UserData_UnspecifiedToEmptyString(t *testing.T) { }) } +func TestAccAWSInstance_hibernation(t *testing.T) { + var instance1, instance2 ec2.Instance + resourceName := "aws_instance.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckInstanceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccInstanceConfigHibernation(true), + Check: resource.ComposeTestCheckFunc( + testAccCheckInstanceExists(resourceName, &instance1), + resource.TestCheckResourceAttr(resourceName, "hibernation", "true"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccInstanceConfigHibernation(false), + Check: resource.ComposeTestCheckFunc( + testAccCheckInstanceExists(resourceName, &instance2), + testAccCheckInstanceRecreated(&instance1, &instance2), + resource.TestCheckResourceAttr(resourceName, "hibernation", "false"), + ), + }, + }, + }) +} + func testAccCheckInstanceNotRecreated(t *testing.T, before, after *ec2.Instance) resource.TestCheckFunc { return func(s *terraform.State) error { @@ -2152,6 +2540,16 @@ func testAccCheckInstanceNotRecreated(t *testing.T, } } +func testAccCheckInstanceRecreated(before, after *ec2.Instance) resource.TestCheckFunc { + return func(s *terraform.State) error { + if aws.StringValue(before.InstanceId) == aws.StringValue(after.InstanceId) { + return fmt.Errorf("EC2 Instance (%s) not recreated", aws.StringValue(before.InstanceId)) + } + + return nil + } +} + func testAccCheckInstanceDestroy(s *terraform.State) error { return testAccCheckInstanceDestroyWithProvider(s, testAccProvider) } @@ -2239,6 +2637,21 @@ func testAccCheckInstanceDisappears(conf *ec2.Instance) resource.TestCheckFunc { } } +func testAccCheckStopInstance(conf *ec2.Instance) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + params := &ec2.StopInstancesInput{ + InstanceIds: []*string{conf.InstanceId}, + } + if _, err := conn.StopInstances(params); err != nil { + return err + } + + return waitForInstanceStopping(conn, *conf.InstanceId, 10*time.Minute) + } +} + func TestInstanceTenancySchema(t *testing.T) { actualSchema := resourceAwsInstance().Schema["tenancy"] expectedSchema := &schema.Schema{ @@ -2319,76 +2732,56 @@ func driftTags(instance *ec2.Instance) resource.TestCheckFunc { } } -func testAccInstanceConfigInDefaultVpcBySgName(rInt int) string { - return fmt.Sprintf(` -data "aws_ami" "ubuntu" { - most_recent = true - - filter { - name = "name" - values = ["ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-*"] - } - - filter { - name = "virtualization-type" - values = ["hvm"] - } - - owners = ["099720109477"] # Canonical +func testAccInstanceConfigInDefaultVpcBySgName(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + fmt.Sprintf(` +data "aws_availability_zones" "current" { + # Exclude usw2-az4 (us-west-2d) as it has limited instance types. + blacklisted_zone_ids = ["usw2-az4"] } data "aws_vpc" "default" { default = true } -resource "aws_security_group" "sg" { - name = "tf_acc_test_%d" - description = "Test security group" +resource "aws_security_group" "test" { + name = %[1]q + description = %[1]q vpc_id = "${data.aws_vpc.default.id}" } -resource "aws_instance" "foo" { - ami = "${data.aws_ami.ubuntu.id}" - instance_type = "t2.micro" - security_groups = ["${aws_security_group.sg.name}"] +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + security_groups = ["${aws_security_group.test.name}"] + availability_zone = "${data.aws_availability_zones.current.names[0]}" } -`, rInt) +`, rName) } -func testAccInstanceConfigInDefaultVpcBySgId(rInt int) string { - return fmt.Sprintf(` -data "aws_ami" "ubuntu" { - most_recent = true - - filter { - name = "name" - values = ["ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-*"] - } - - filter { - name = "virtualization-type" - values = ["hvm"] - } - - owners = ["099720109477"] # Canonical +func testAccInstanceConfigInDefaultVpcBySgId(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + fmt.Sprintf(` +data "aws_availability_zones" "current" { + # Exclude usw2-az4 (us-west-2d) as it has limited instance types. + blacklisted_zone_ids = ["usw2-az4"] } data "aws_vpc" "default" { default = true } -resource "aws_security_group" "sg" { - name = "tf_acc_test_%d" - description = "Test security group" +resource "aws_security_group" "test" { + name = %[1]q + description = %[1]q vpc_id = "${data.aws_vpc.default.id}" } -resource "aws_instance" "foo" { - ami = "${data.aws_ami.ubuntu.id}" +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" instance_type = "t2.micro" - vpc_security_group_ids = ["${aws_security_group.sg.id}"] + vpc_security_group_ids = ["${aws_security_group.test.id}"] + availability_zone = "${data.aws_availability_zones.current.names[0]}" } -`, rInt) +`, rName) } func testAccInstanceConfigInEc2Classic(rInt int) string { @@ -2418,7 +2811,7 @@ resource "aws_security_group" "sg" { description = "Test security group" } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "${data.aws_ami.ubuntu.id}" instance_type = "m3.medium" security_groups = ["${aws_security_group.sg.name}"] @@ -2428,9 +2821,9 @@ resource "aws_instance" "foo" { func testAccInstanceConfig_pre(rInt int) string { return fmt.Sprintf(` -resource "aws_security_group" "tf_test_foo" { +resource "aws_security_group" "tf_test_test" { name = "tf_test_%d" - description = "foo" + description = "test" ingress { protocol = "icmp" @@ -2444,9 +2837,9 @@ resource "aws_security_group" "tf_test_foo" { func testAccInstanceConfig(rInt int) string { return fmt.Sprintf(` -resource "aws_security_group" "tf_test_foo" { +resource "aws_security_group" "tf_test_test" { name = "tf_test_%d" - description = "foo" + description = "test" ingress { protocol = "icmp" @@ -2456,13 +2849,13 @@ resource "aws_security_group" "tf_test_foo" { } } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { # us-west-2 ami = "ami-4fccb37f" availability_zone = "us-west-2a" instance_type = "m1.small" - security_groups = ["${aws_security_group.tf_test_foo.name}"] + security_groups = ["${aws_security_group.tf_test_test.name}"] user_data = "foo:-with-character's" } `, rInt) @@ -2470,9 +2863,9 @@ resource "aws_instance" "foo" { func testAccInstanceConfigWithUserDataBase64(rInt int) string { return fmt.Sprintf(` -resource "aws_security_group" "tf_test_foo" { +resource "aws_security_group" "tf_test_test" { name = "tf_test_%d" - description = "foo" + description = "test" ingress { protocol = "icmp" @@ -2482,20 +2875,20 @@ resource "aws_security_group" "tf_test_foo" { } } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { # us-west-2 ami = "ami-4fccb37f" availability_zone = "us-west-2a" instance_type = "m1.small" - security_groups = ["${aws_security_group.tf_test_foo.name}"] + security_groups = ["${aws_security_group.tf_test_test.name}"] user_data_base64 = "${base64encode("hello world")}" } `, rInt) } const testAccInstanceConfigWithSmallInstanceType = ` -resource "aws_instance" "foo" { +resource "aws_instance" "test" { # us-west-2 ami = "ami-55a7ea65" availability_zone = "us-west-2a" @@ -2509,7 +2902,7 @@ resource "aws_instance" "foo" { ` const testAccInstanceConfigUpdateInstanceType = ` -resource "aws_instance" "foo" { +resource "aws_instance" "test" { # us-west-2 ami = "ami-55a7ea65" availability_zone = "us-west-2a" @@ -2523,7 +2916,7 @@ resource "aws_instance" "foo" { ` const testAccInstanceGP2IopsDevice = ` -resource "aws_instance" "foo" { +resource "aws_instance" "test" { # us-west-2 ami = "ami-55a7ea65" @@ -2540,7 +2933,7 @@ resource "aws_instance" "foo" { ` const testAccInstanceGP2WithIopsValue = ` -resource "aws_instance" "foo" { +resource "aws_instance" "test" { # us-west-2 ami = "ami-55a7ea65" @@ -2559,7 +2952,7 @@ resource "aws_instance" "foo" { ` const testAccInstanceConfigBlockDevices = ` -resource "aws_instance" "foo" { +resource "aws_instance" "test" { # us-west-2 ami = "ami-55a7ea65" @@ -2599,244 +2992,119 @@ resource "aws_instance" "foo" { } ` -const testAccInstanceConfigSourceDestEnable = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - tags = { - Name = "terraform-testacc-instance-source-dest-enable" - } -} - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - tags = { - Name = "tf-acc-instance-source-dest-enable" - } -} - -resource "aws_instance" "foo" { - # us-west-2 - ami = "ami-4fccb37f" - instance_type = "m1.small" - subnet_id = "${aws_subnet.foo.id}" -} -` - -const testAccInstanceConfigSourceDestDisable = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - tags = { - Name = "terraform-testacc-instance-source-dest-disable" - } -} - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - tags = { - Name = "tf-acc-instance-source-dest-disable" - } +func testAccInstanceConfigSourceDestEnable(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "m1.small" + subnet_id = "${aws_subnet.test.id}" } - -resource "aws_instance" "foo" { - # us-west-2 - ami = "ami-4fccb37f" - instance_type = "m1.small" - subnet_id = "${aws_subnet.foo.id}" - source_dest_check = false +`) } -` - -func testAccInstanceConfigDisableAPITermination(val bool) string { - return fmt.Sprintf(` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - tags = { - Name = "terraform-testacc-instance-disable-api-termination" - } +func testAccInstanceConfigSourceDestDisable(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "m1.small" + subnet_id = "${aws_subnet.test.id}" + source_dest_check = false } - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - - tags = { - Name = "tf-acc-instance-disable-api-termination" - } +`) } -resource "aws_instance" "foo" { - # us-west-2 - ami = "ami-4fccb37f" +func testAccInstanceConfigDisableAPITermination(rName string, val bool) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" instance_type = "m1.small" - subnet_id = "${aws_subnet.foo.id}" - disable_api_termination = %t + subnet_id = "${aws_subnet.test.id}" + disable_api_termination = %[1]t } `, val) } -const testAccInstanceConfigVPC = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - tags = { - Name = "terraform-testacc-instance-vpc" - } -} - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - tags = { - Name = "tf-acc-instance-vpc" - } -} - -resource "aws_instance" "foo" { - # us-west-2 - ami = "ami-4fccb37f" - instance_type = "m1.small" - subnet_id = "${aws_subnet.foo.id}" - associate_public_ip_address = true - tenancy = "dedicated" - # pre-encoded base64 data - user_data = "3dc39dda39be1205215e776bad998da361a5955d" -} -` - -func testAccInstanceConfigPlacementGroup(rStr string) string { - return fmt.Sprintf(` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - - tags = { - Name = "terraform-testacc-instance-placement-group" - } +func testAccInstanceConfigVPC(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "m1.small" + subnet_id = "${aws_subnet.test.id}" + associate_public_ip_address = true + tenancy = "dedicated" + # pre-encoded base64 data + user_data = "3dc39dda39be1205215e776bad998da361a5955d" } - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - - tags = { - Name = "tf-acc-instance-placement-group" - } +`) } -resource "aws_placement_group" "foo" { - name = "testAccInstanceConfigPlacementGroup_%s" +func testAccInstanceConfigPlacementGroup(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_placement_group" "test" { + name = %[1]q strategy = "cluster" } # Limitations: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html#concepts-placement-groups -resource "aws_instance" "foo" { - # us-west-2 - ami = "ami-55a7ea65" +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" instance_type = "c3.large" - subnet_id = "${aws_subnet.foo.id}" + subnet_id = "${aws_subnet.test.id}" associate_public_ip_address = true - placement_group = "${aws_placement_group.foo.name}" + placement_group = "${aws_placement_group.test.name}" # pre-encoded base64 data user_data = "3dc39dda39be1205215e776bad998da361a5955d" } -`, rStr) +`, rName) } -const testAccInstanceConfigIpv6ErrorConfig = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - assign_generated_ipv6_cidr_block = true - tags = { - Name = "terraform-testacc-instance-ipv6-err" - } -} +func testAccInstanceConfigIpv6ErrorConfig(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcIpv6Config(rName) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.test.id}" + ipv6_addresses = ["2600:1f14:bb2:e501::10"] + ipv6_address_count = 1 -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - ipv6_cidr_block = "${cidrsubnet(aws_vpc.foo.ipv6_cidr_block, 8, 1)}" - tags = { - Name = "tf-acc-instance-ipv6-err" - } + tags = { + Name = %[1]q + } } - -resource "aws_instance" "foo" { - # us-west-2 - ami = "ami-c5eabbf5" - instance_type = "t2.micro" - subnet_id = "${aws_subnet.foo.id}" - ipv6_addresses = ["2600:1f14:bb2:e501::10"] - ipv6_address_count = 1 - tags = { - Name = "tf-ipv6-instance-acc-test" - } +`, rName) } -` -const testAccInstanceConfigIpv6Support = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - assign_generated_ipv6_cidr_block = true - tags = { - Name = "terraform-testacc-instance-ipv6-support" - } -} +func testAccInstanceConfigIpv6Support(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcIpv6Config(rName) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.test.id}" + ipv6_address_count = 1 -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - ipv6_cidr_block = "${cidrsubnet(aws_vpc.foo.ipv6_cidr_block, 8, 1)}" - tags = { - Name = "tf-acc-instance-ipv6-support" - } + tags = { + Name = %[1]q + } } - -resource "aws_instance" "foo" { - # us-west-2 - ami = "ami-c5eabbf5" - instance_type = "t2.micro" - subnet_id = "${aws_subnet.foo.id}" - - ipv6_address_count = 1 - tags = { - Name = "tf-ipv6-instance-acc-test" - } +`, rName) } -` -const testAccInstanceConfigIpv6SupportWithIpv4 = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - assign_generated_ipv6_cidr_block = true - tags = { - Name = "terraform-testacc-instance-ipv6-support-with-ipv4" - } -} +func testAccInstanceConfigIpv6SupportWithIpv4(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcIpv6Config(rName) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.test.id}" + associate_public_ip_address = true + ipv6_address_count = 1 -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - ipv6_cidr_block = "${cidrsubnet(aws_vpc.foo.ipv6_cidr_block, 8, 1)}" - tags = { - Name = "tf-acc-instance-ipv6-support-with-ipv4" - } + tags = { + Name = %[1]q + } } - -resource "aws_instance" "foo" { - # us-west-2 - ami = "ami-c5eabbf5" - instance_type = "t2.micro" - subnet_id = "${aws_subnet.foo.id}" - - associate_public_ip_address = true - ipv6_address_count = 1 - tags = { - Name = "tf-ipv6-instance-acc-test" - } +`, rName) } -` const testAccInstanceConfigMultipleRegions = ` provider "aws" { @@ -2848,15 +3116,14 @@ provider "aws" { alias = "east" region = "us-east-1" } - -resource "aws_instance" "foo" { +resource "aws_instance" "test" { # us-west-2 provider = "aws.west" ami = "ami-4fccb37f" instance_type = "m1.small" } -resource "aws_instance" "bar" { +resource "aws_instance" "test2" { # us-east-1 provider = "aws.east" ami = "ami-8c6ea9e4" @@ -2865,21 +3132,21 @@ resource "aws_instance" "bar" { ` const testAccCheckInstanceConfigTags = ` -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "ami-4fccb37f" instance_type = "m1.small" tags = { - foo = "bar" + test = "test2" } } ` const testAccInstanceConfigEbsBlockDeviceKmsKeyArn = ` -resource "aws_kms_key" "foo" { +resource "aws_kms_key" "test" { deletion_window_in_days = 7 } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { # us-west-2 ami = "ami-55a7ea65" @@ -2897,14 +3164,14 @@ resource "aws_instance" "foo" { ebs_block_device { device_name = "/dev/sdd" encrypted = true - kms_key_id = "${aws_kms_key.foo.arn}" + kms_key_id = "${aws_kms_key.test.arn}" volume_size = 12 } } ` const testAccInstanceConfigRootBlockDeviceKmsKeyArn = ` -resource "aws_vpc" "foo" { +resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" tags = { @@ -2912,9 +3179,9 @@ resource "aws_vpc" "foo" { } } -resource "aws_subnet" "foo" { +resource "aws_subnet" "test" { cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" + vpc_id = "${aws_vpc.test.id}" availability_zone = "us-west-2a" tags = { @@ -2922,19 +3189,19 @@ resource "aws_subnet" "foo" { } } -resource "aws_kms_key" "foo" { +resource "aws_kms_key" "test" { deletion_window_in_days = 7 } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "ami-08692d171e3cf02d6" instance_type = "t3.nano" - subnet_id = "${aws_subnet.foo.id}" + subnet_id = "${aws_subnet.test.id}" root_block_device { delete_on_termination = true encrypted = true - kms_key_id = "${aws_kms_key.foo.arn}" + kms_key_id = "${aws_kms_key.test.arn}" } } ` @@ -2966,7 +3233,7 @@ data "aws_ami" "debian_jessie_latest" { owners = ["379101102735"] # Debian } -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "${data.aws_ami.debian_jessie_latest.id}" instance_type = "t2.medium" @@ -2982,7 +3249,7 @@ resource "aws_instance" "foo" { } resource "aws_ebs_volume" "test" { - availability_zone = "${aws_instance.foo.availability_zone}" + availability_zone = "${aws_instance.test.availability_zone}" size = "10" type = "gp2" @@ -2994,12 +3261,12 @@ resource "aws_ebs_volume" "test" { resource "aws_volume_attachment" "test" { device_name = "/dev/xvdg" volume_id = "${aws_ebs_volume.test.id}" - instance_id = "${aws_instance.foo.id}" + instance_id = "${aws_instance.test.id}" } ` const testAccCheckInstanceConfigNoVolumeTags = ` -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "ami-55a7ea65" instance_type = "m3.medium" @@ -3033,7 +3300,7 @@ resource "aws_instance" "foo" { ` const testAccCheckInstanceConfigWithVolumeTags = ` -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "ami-55a7ea65" instance_type = "m3.medium" @@ -3071,7 +3338,7 @@ resource "aws_instance" "foo" { ` const testAccCheckInstanceConfigWithVolumeTagsUpdate = ` -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "ami-55a7ea65" instance_type = "m3.medium" @@ -3110,913 +3377,537 @@ resource "aws_instance" "foo" { ` const testAccCheckInstanceConfigTagsUpdate = ` -resource "aws_instance" "foo" { +resource "aws_instance" "test" { ami = "ami-4fccb37f" instance_type = "m1.small" tags = { - bar = "baz" + test2 = "test3" } } ` func testAccInstanceConfigWithoutInstanceProfile(rName string) string { - return fmt.Sprintf(` + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + fmt.Sprintf(` resource "aws_iam_role" "test" { - name = "test-%s" + name = %[1]q assume_role_policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":[\"ec2.amazonaws.com\"]},\"Action\":[\"sts:AssumeRole\"]}]}" } -resource "aws_instance" "foo" { - ami = "ami-4fccb37f" +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" instance_type = "m1.small" tags = { - bar = "baz" + Name = %[1]q } } `, rName) } func testAccInstanceConfigWithInstanceProfile(rName string) string { - return fmt.Sprintf(` + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + fmt.Sprintf(` resource "aws_iam_role" "test" { - name = "test-%s" + name = %[1]q assume_role_policy = "{\"Version\":\"2012-10-17\",\"Statement\":[{\"Effect\":\"Allow\",\"Principal\":{\"Service\":[\"ec2.amazonaws.com\"]},\"Action\":[\"sts:AssumeRole\"]}]}" } resource "aws_iam_instance_profile" "test" { - name = "test-%s" + name = %[1]q roles = ["${aws_iam_role.test.name}"] } -resource "aws_instance" "foo" { - ami = "ami-4fccb37f" +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" instance_type = "m1.small" iam_instance_profile = "${aws_iam_instance_profile.test.name}" tags = { - bar = "baz" + Name = %[1]q } } -`, rName, rName) +`, rName) } -const testAccInstanceConfigPrivateIP = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - tags = { - Name = "terraform-testacc-instance-private-ip" - } +func testAccInstanceConfigPrivateIP(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.test.id}" + private_ip = "10.1.1.42" } - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - tags = { - Name = "tf-acc-instance-private-ip" - } +`) } -resource "aws_instance" "foo" { - ami = "ami-c5eabbf5" - instance_type = "t2.micro" - subnet_id = "${aws_subnet.foo.id}" - private_ip = "10.1.1.42" +func testAccInstanceConfigAssociatePublicIPAndPrivateIP(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.test.id}" + associate_public_ip_address = true + private_ip = "10.1.1.42" } -` - -const testAccInstanceConfigAssociatePublicIPAndPrivateIP = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - tags = { - Name = "terraform-testacc-instance-public-ip-and-private-ip" - } +`) } -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - tags = { - Name = "tf-acc-instance-public-ip-and-private-ip" - } +func testAccInstanceNetworkInstanceSecurityGroups(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + + testAccAwsInstanceVpcConfig(rName, false) + + testAccAwsInstanceVpcSecurityGroupConfig(rName) + + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t1.micro" + vpc_security_group_ids = ["${aws_security_group.test.id}"] + subnet_id = "${aws_subnet.test.id}" + associate_public_ip_address = true + depends_on = ["aws_internet_gateway.test"] } -resource "aws_instance" "foo" { - ami = "ami-c5eabbf5" - instance_type = "t2.micro" - subnet_id = "${aws_subnet.foo.id}" - associate_public_ip_address = true - private_ip = "10.1.1.42" +resource "aws_eip" "test" { + instance = "${aws_instance.test.id}" + vpc = true + depends_on = ["aws_internet_gateway.test"] } -` - -func testAccInstanceNetworkInstanceSecurityGroups(rInt int) string { - return fmt.Sprintf(` -resource "aws_internet_gateway" "gw" { - vpc_id = "${aws_vpc.foo.id}" +`) } -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - - tags = { - Name = "terraform-testacc-instance-network-security-groups" - } +func testAccInstanceNetworkInstanceVPCSecurityGroupIDs(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + + testAccAwsInstanceVpcConfig(rName, false) + + testAccAwsInstanceVpcSecurityGroupConfig(rName) + + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t1.micro" + vpc_security_group_ids = ["${aws_security_group.test.id}"] + subnet_id = "${aws_subnet.test.id}" + depends_on = ["aws_internet_gateway.test"] } -resource "aws_security_group" "tf_test_foo" { - name = "tf_test_%d" - description = "foo" - vpc_id = "${aws_vpc.foo.id}" - - ingress { - protocol = "icmp" - from_port = -1 - to_port = -1 - cidr_blocks = ["0.0.0.0/0"] - } +resource "aws_eip" "test" { + instance = "${aws_instance.test.id}" + vpc = true + depends_on = ["aws_internet_gateway.test"] } - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - - tags = { - Name = "tf-acc-instance-network-security-groups" - } +`) } -resource "aws_instance" "foo_instance" { - ami = "ami-21f78e11" - instance_type = "t1.micro" - vpc_security_group_ids = ["${aws_security_group.tf_test_foo.id}"] - subnet_id = "${aws_subnet.foo.id}" - associate_public_ip_address = true - depends_on = ["aws_internet_gateway.gw"] +func testAccInstanceNetworkInstanceVPCRemoveSecurityGroupIDs(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + + testAccAwsInstanceVpcConfig(rName, false) + + testAccAwsInstanceVpcSecurityGroupConfig(rName) + + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t1.micro" + vpc_security_group_ids = [] + subnet_id = "${aws_subnet.test.id}" + depends_on = ["aws_internet_gateway.test"] } -resource "aws_eip" "foo_eip" { - instance = "${aws_instance.foo_instance.id}" +resource "aws_eip" "test" { + instance = "${aws_instance.test.id}" vpc = true - depends_on = ["aws_internet_gateway.gw"] + depends_on = ["aws_internet_gateway.test"] } -`, rInt) +`) } -func testAccInstanceNetworkInstanceVPCSecurityGroupIDs(rInt int) string { - return fmt.Sprintf(` -resource "aws_internet_gateway" "gw" { - vpc_id = "${aws_vpc.foo.id}" +func testAccInstanceConfigKeyPair(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + fmt.Sprintf(` +resource "aws_key_pair" "test" { + key_name = %[1]q + public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com" } -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t1.micro" + key_name = "${aws_key_pair.test.key_name}" tags = { - Name = "terraform-testacc-instance-network-vpc-sg-ids" + Name = %[1]q } } +`, rName) +} -resource "aws_security_group" "tf_test_foo" { - name = "tf_test_%d" - description = "foo" - vpc_id = "${aws_vpc.foo.id}" - - ingress { - protocol = "icmp" - from_port = -1 - to_port = -1 - cidr_blocks = ["0.0.0.0/0"] - } -} - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - - tags = { - Name = "tf-acc-instance-network-vpc-sg-ids" - } -} - -resource "aws_instance" "foo_instance" { - ami = "ami-21f78e11" - instance_type = "t1.micro" - vpc_security_group_ids = ["${aws_security_group.tf_test_foo.id}"] - subnet_id = "${aws_subnet.foo.id}" - depends_on = ["aws_internet_gateway.gw"] -} - -resource "aws_eip" "foo_eip" { - instance = "${aws_instance.foo_instance.id}" - vpc = true - depends_on = ["aws_internet_gateway.gw"] -} -`, rInt) -} - -func testAccInstanceNetworkInstanceVPCRemoveSecurityGroupIDs(rInt int) string { - return fmt.Sprintf(` -resource "aws_internet_gateway" "gw" { - vpc_id = "${aws_vpc.foo.id}" -} - -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - - tags = { - Name = "terraform-testacc-instance-network-vpc-sg-ids" - } -} - -resource "aws_security_group" "tf_test_foo" { - name = "tf_test_%d" - description = "foo" - vpc_id = "${aws_vpc.foo.id}" - - ingress { - protocol = "icmp" - from_port = -1 - to_port = -1 - cidr_blocks = ["0.0.0.0/0"] - } -} - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - - tags = { - Name = "tf-acc-instance-network-vpc-sg-ids" - } -} - -resource "aws_instance" "foo_instance" { - ami = "ami-21f78e11" - instance_type = "t1.micro" - vpc_security_group_ids = [] - subnet_id = "${aws_subnet.foo.id}" - depends_on = ["aws_internet_gateway.gw"] -} - -resource "aws_eip" "foo_eip" { - instance = "${aws_instance.foo_instance.id}" - vpc = true - depends_on = ["aws_internet_gateway.gw"] -} -`, rInt) -} - -func testAccInstanceConfigKeyPair(keyPairName string) string { - return fmt.Sprintf(` -provider "aws" { - region = "us-east-1" -} - -resource "aws_key_pair" "debugging" { - key_name = "%s" - public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com" -} - -resource "aws_instance" "foo" { - ami = "ami-408c7f28" +func testAccInstanceConfigRootBlockDeviceMismatch(rName string) string { + return testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + // This is an AMI with RootDeviceName: "/dev/sda1"; actual root: "/dev/sda" + ami = "ami-ef5b69df" instance_type = "t1.micro" - key_name = "${aws_key_pair.debugging.key_name}" + subnet_id = "${aws_subnet.test.id}" - tags = { - Name = "testAccInstanceConfigKeyPair_TestAMI" + root_block_device { + volume_size = 13 } } -`, keyPairName) -} - -const testAccInstanceConfigRootBlockDeviceMismatch = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - tags = { - Name = "terraform-testacc-instance-root-block-device-mismatch" - } -} - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - tags = { - Name = "tf-acc-instance-root-block-device-mismatch" - } -} - -resource "aws_instance" "foo" { - // This is an AMI with RootDeviceName: "/dev/sda1"; actual root: "/dev/sda" - ami = "ami-ef5b69df" - instance_type = "t1.micro" - subnet_id = "${aws_subnet.foo.id}" - root_block_device { - volume_size = 13 - } -} -` - -const testAccInstanceConfigForceNewAndTagsDrift = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - tags = { - Name = "terraform-testacc-instance-force-new-and-tags-drift" - } -} - -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - tags = { - Name = "tf-acc-instance-force-new-and-tags-drift" - } +`) } -resource "aws_instance" "foo" { - ami = "ami-22b9a343" - instance_type = "t2.nano" - subnet_id = "${aws_subnet.foo.id}" +func testAccInstanceConfigForceNewAndTagsDrift(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.nano" + subnet_id = "${aws_subnet.test.id}" } -` - -const testAccInstanceConfigForceNewAndTagsDrift_Update = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" - tags = { - Name = "terraform-testacc-instance-force-new-and-tags-drift" - } +`) } -resource "aws_subnet" "foo" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo.id}" - tags = { - Name = "tf-acc-instance-force-new-and-tags-drift" - } -} - -resource "aws_instance" "foo" { - ami = "ami-22b9a343" - instance_type = "t2.micro" - subnet_id = "${aws_subnet.foo.id}" +func testAccInstanceConfigForceNewAndTagsDrift_Update(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.test.id}" } -` - -const testAccInstanceConfigPrimaryNetworkInterface = ` -resource "aws_vpc" "foo" { - cidr_block = "172.16.0.0/16" - tags = { - Name = "terraform-testacc-instance-primary-network-iface" - } +`) } -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" - cidr_block = "172.16.10.0/24" - availability_zone = "us-west-2a" - tags = { - Name = "tf-acc-instance-primary-network-iface" - } -} +func testAccInstanceConfigPrimaryNetworkInterface(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_network_interface" "test" { + subnet_id = "${aws_subnet.test.id}" + private_ips = ["10.1.1.42"] -resource "aws_network_interface" "bar" { - subnet_id = "${aws_subnet.foo.id}" - private_ips = ["172.16.10.100"] tags = { - Name = "primary_network_interface" + Name = %[1]q } } -resource "aws_instance" "foo" { - ami = "ami-22b9a343" - instance_type = "t2.micro" - network_interface { - network_interface_id = "${aws_network_interface.bar.id}" - device_index = 0 - } -} -` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" -const testAccInstanceConfigPrimaryNetworkInterfaceSourceDestCheck = ` -resource "aws_vpc" "foo" { - cidr_block = "172.16.0.0/16" - tags = { - Name = "terraform-testacc-instance-primary-network-iface-source-dest-check" + network_interface { + network_interface_id = "${aws_network_interface.test.id}" + device_index = 0 } } - -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" - cidr_block = "172.16.10.0/24" - availability_zone = "us-west-2a" - tags = { - Name = "tf-acc-instance-primary-network-iface-source-dest-check" - } +`, rName) } -resource "aws_network_interface" "bar" { - subnet_id = "${aws_subnet.foo.id}" - private_ips = ["172.16.10.100"] +func testAccInstanceConfigPrimaryNetworkInterfaceSourceDestCheck(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_network_interface" "test" { + subnet_id = "${aws_subnet.test.id}" + private_ips = ["10.1.1.42"] source_dest_check = false + tags = { - Name = "primary_network_interface" + Name = %[1]q } } -resource "aws_instance" "foo" { - ami = "ami-22b9a343" - instance_type = "t2.micro" - network_interface { - network_interface_id = "${aws_network_interface.bar.id}" - device_index = 0 - } -} -` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" -const testAccInstanceConfigAddSecondaryNetworkInterfaceBefore = ` -resource "aws_vpc" "foo" { - cidr_block = "172.16.0.0/16" - tags = { - Name = "terraform-testacc-instance-add-secondary-network-iface" + network_interface { + network_interface_id = "${aws_network_interface.test.id}" + device_index = 0 } } - -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" - cidr_block = "172.16.10.0/24" - availability_zone = "us-west-2a" - tags = { - Name = "tf-acc-instance-add-secondary-network-iface" - } +`, rName) } +func testAccInstanceConfigAddSecondaryNetworkInterfaceBefore(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` resource "aws_network_interface" "primary" { - subnet_id = "${aws_subnet.foo.id}" - private_ips = ["172.16.10.100"] + subnet_id = "${aws_subnet.test.id}" + private_ips = ["10.1.1.42"] + tags = { - Name = "primary_network_interface" + Name = %[1]q } } resource "aws_network_interface" "secondary" { - subnet_id = "${aws_subnet.foo.id}" - private_ips = ["172.16.10.101"] + subnet_id = "${aws_subnet.test.id}" + private_ips = ["10.1.1.43"] + tags = { - Name = "secondary_network_interface" + Name = %[1]q } } -resource "aws_instance" "foo" { - ami = "ami-22b9a343" - instance_type = "t2.micro" - network_interface { - network_interface_id = "${aws_network_interface.primary.id}" - device_index = 0 - } -} -` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" -const testAccInstanceConfigAddSecondaryNetworkInterfaceAfter = ` -resource "aws_vpc" "foo" { - cidr_block = "172.16.0.0/16" - tags = { - Name = "terraform-testacc-instance-add-secondary-network-iface" + network_interface { + network_interface_id = "${aws_network_interface.primary.id}" + device_index = 0 } } - -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" - cidr_block = "172.16.10.0/24" - availability_zone = "us-west-2a" - tags = { - Name = "tf-acc-instance-add-secondary-network-iface" - } +`, rName) } +func testAccInstanceConfigAddSecondaryNetworkInterfaceAfter(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` resource "aws_network_interface" "primary" { - subnet_id = "${aws_subnet.foo.id}" - private_ips = ["172.16.10.100"] + subnet_id = "${aws_subnet.test.id}" + private_ips = ["10.1.1.42"] + tags = { - Name = "primary_network_interface" + Name = %[1]q } } // Attach previously created network interface, observe no state diff on instance resource resource "aws_network_interface" "secondary" { - subnet_id = "${aws_subnet.foo.id}" - private_ips = ["172.16.10.101"] + subnet_id = "${aws_subnet.test.id}" + private_ips = ["10.1.1.43"] + tags = { - Name = "secondary_network_interface" + Name = %[1]q } + attachment { - instance = "${aws_instance.foo.id}" + instance = "${aws_instance.test.id}" device_index = 1 } } -resource "aws_instance" "foo" { - ami = "ami-22b9a343" - instance_type = "t2.micro" - network_interface { - network_interface_id = "${aws_network_interface.primary.id}" - device_index = 0 - } -} -` - -const testAccInstanceConfigAddSecurityGroupBefore = ` -resource "aws_vpc" "foo" { - cidr_block = "172.16.0.0/16" - tags = { - Name = "terraform-testacc-instance-add-security-group" - } -} - -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" - cidr_block = "172.16.10.0/24" - availability_zone = "us-west-2a" - tags = { - Name = "tf-acc-instance-add-security-group-foo" - } -} - -resource "aws_subnet" "bar" { - vpc_id = "${aws_vpc.foo.id}" - cidr_block = "172.16.11.0/24" - availability_zone = "us-west-2a" - tags = { - Name = "tf-acc-instance-add-security-group-bar" - } -} - -resource "aws_security_group" "foo" { - vpc_id = "${aws_vpc.foo.id}" - description = "foo" - name = "foo" -} +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" -resource "aws_security_group" "bar" { - vpc_id = "${aws_vpc.foo.id}" - description = "bar" - name = "bar" + network_interface { + network_interface_id = "${aws_network_interface.primary.id}" + device_index = 0 + } } - -resource "aws_instance" "foo" { - ami = "ami-c5eabbf5" - instance_type = "t2.micro" - subnet_id = "${aws_subnet.bar.id}" - associate_public_ip_address = false - vpc_security_group_ids = [ - "${aws_security_group.foo.id}" - ] - tags = { - Name = "foo-instance-sg-add-test" - } -} - -resource "aws_network_interface" "bar" { - subnet_id = "${aws_subnet.foo.id}" - private_ips = ["172.16.10.100"] - security_groups = ["${aws_security_group.foo.id}"] - attachment { - instance = "${aws_instance.foo.id}" - device_index = 1 - } - tags = { - Name = "bar_interface" - } +`, rName) } -` -const testAccInstanceConfigAddSecurityGroupAfter = ` -resource "aws_vpc" "foo" { - cidr_block = "172.16.0.0/16" - tags = { - Name = "terraform-testacc-instance-add-security-group" - } -} +func testAccInstanceConfigAddSecurityGroupBefore(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_subnet" "test2" { + cidr_block = "10.1.2.0/24" + vpc_id = "${aws_vpc.test.id}" + availability_zone = "${data.aws_availability_zones.current.names[0]}" -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" - cidr_block = "172.16.10.0/24" - availability_zone = "us-west-2a" tags = { - Name = "tf-acc-instance-add-security-group-foo" - } + Name = %[1]q + } } -resource "aws_subnet" "bar" { - vpc_id = "${aws_vpc.foo.id}" - cidr_block = "172.16.11.0/24" - availability_zone = "us-west-2a" - tags = { - Name = "tf-acc-instance-add-security-group-bar" - } +resource "aws_security_group" "test" { + vpc_id = "${aws_vpc.test.id}" + description = "%[1]s_1" + name = "%[1]s_1" } -resource "aws_security_group" "foo" { - vpc_id = "${aws_vpc.foo.id}" - description = "foo" - name = "foo" +resource "aws_security_group" "test2" { + vpc_id = "${aws_vpc.test.id}" + description = "%[1]s_2" + name = "%[1]s_2" } -resource "aws_security_group" "bar" { - vpc_id = "${aws_vpc.foo.id}" - description = "bar" - name = "bar" -} +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.test.id}" -resource "aws_instance" "foo" { - ami = "ami-c5eabbf5" - instance_type = "t2.micro" - subnet_id = "${aws_subnet.bar.id}" - associate_public_ip_address = false - vpc_security_group_ids = [ - "${aws_security_group.foo.id}", - "${aws_security_group.bar.id}" - ] - tags = { - Name = "foo-instance-sg-add-test" - } -} - -resource "aws_network_interface" "bar" { - subnet_id = "${aws_subnet.foo.id}" - private_ips = ["172.16.10.100"] - security_groups = ["${aws_security_group.foo.id}"] - attachment { - instance = "${aws_instance.foo.id}" - device_index = 1 - } - tags = { - Name = "bar_interface" - } -} -` + associate_public_ip_address = false -func testAccInstanceConfig_associatePublic_defaultPrivate(rInt int) string { - return fmt.Sprintf(` -resource "aws_vpc" "my_vpc" { - cidr_block = "172.16.0.0/16" + vpc_security_group_ids = [ + "${aws_security_group.test.id}", + ] tags = { - Name = "terraform-testacc-instance-associate-public-default-private" + Name = %[1]q } } -resource "aws_subnet" "public_subnet" { - vpc_id = "${aws_vpc.my_vpc.id}" - cidr_block = "172.16.20.0/24" - availability_zone = "us-west-2a" - map_public_ip_on_launch = false +resource "aws_network_interface" "test" { + subnet_id = "${aws_subnet.test.id}" + private_ips = ["10.1.1.42"] + security_groups = ["${aws_security_group.test.id}"] - tags = { - Name = "tf-acc-instance-associate-public-default-private" + attachment { + instance = "${aws_instance.test.id}" + device_index = 1 } -} - -resource "aws_instance" "foo" { - ami = "ami-22b9a343" # us-west-2 - instance_type = "t2.micro" - subnet_id = "${aws_subnet.public_subnet.id}" tags = { - Name = "tf-acctest-%d" + Name = %[1]q } } -`, rInt) +`, rName) } -func testAccInstanceConfig_associatePublic_defaultPublic(rInt int) string { - return fmt.Sprintf(` -resource "aws_vpc" "my_vpc" { - cidr_block = "172.16.0.0/16" +func testAccInstanceConfigAddSecurityGroupAfter(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_subnet" "test2" { + cidr_block = "10.1.2.0/24" + vpc_id = "${aws_vpc.test.id}" + availability_zone = "${data.aws_availability_zones.current.names[0]}" tags = { - Name = "terraform-testacc-instance-associate-public-default-public" + Name = %[1]q } } -resource "aws_subnet" "public_subnet" { - vpc_id = "${aws_vpc.my_vpc.id}" - cidr_block = "172.16.20.0/24" - availability_zone = "us-west-2a" - map_public_ip_on_launch = true - - tags = { - Name = "tf-acc-instance-associate-public-default-public" - } +resource "aws_security_group" "test" { + vpc_id = "${aws_vpc.test.id}" + description = "%[1]s_1" + name = "%[1]s_1" } -resource "aws_instance" "foo" { - ami = "ami-22b9a343" # us-west-2 - instance_type = "t2.micro" - subnet_id = "${aws_subnet.public_subnet.id}" - - tags = { - Name = "tf-acctest-%d" - } -} -`, rInt) +resource "aws_security_group" "test2" { + vpc_id = "${aws_vpc.test.id}" + description = "%[1]s_2" + name = "%[1]s_2" } -func testAccInstanceConfig_associatePublic_explicitPublic(rInt int) string { - return fmt.Sprintf(` -resource "aws_vpc" "my_vpc" { - cidr_block = "172.16.0.0/16" +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.test.id}" - tags = { - Name = "terraform-testacc-instance-associate-public-explicit-public" - } -} + associate_public_ip_address = false -resource "aws_subnet" "public_subnet" { - vpc_id = "${aws_vpc.my_vpc.id}" - cidr_block = "172.16.20.0/24" - availability_zone = "us-west-2a" - map_public_ip_on_launch = true + vpc_security_group_ids = [ + "${aws_security_group.test.id}", + "${aws_security_group.test2.id}", + ] tags = { - Name = "tf-acc-instance-associate-public-explicit-public" + Name = %[1]q } } -resource "aws_instance" "foo" { - ami = "ami-22b9a343" # us-west-2 - instance_type = "t2.micro" - subnet_id = "${aws_subnet.public_subnet.id}" - associate_public_ip_address = true +resource "aws_network_interface" "test" { + subnet_id = "${aws_subnet.test.id}" + private_ips = ["10.1.1.42"] + security_groups = ["${aws_security_group.test.id}"] - tags = { - Name = "tf-acctest-%d" + attachment { + instance = "${aws_instance.test.id}" + device_index = 1 } -} -`, rInt) -} - -func testAccInstanceConfig_associatePublic_explicitPrivate(rInt int) string { - return fmt.Sprintf(` -resource "aws_vpc" "my_vpc" { - cidr_block = "172.16.0.0/16" tags = { - Name = "terraform-testacc-instance-associate-public-explicit-private" + Name = %[1]q } } - -resource "aws_subnet" "public_subnet" { - vpc_id = "${aws_vpc.my_vpc.id}" - cidr_block = "172.16.20.0/24" - availability_zone = "us-west-2a" - map_public_ip_on_launch = false - - tags = { - Name = "tf-acc-instance-associate-public-explicit-private" - } +`, rName) } -resource "aws_instance" "foo" { - ami = "ami-22b9a343" # us-west-2 - instance_type = "t2.micro" - subnet_id = "${aws_subnet.public_subnet.id}" - associate_public_ip_address = false +func testAccInstanceConfig_associatePublic_defaultPrivate(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.test.id}" tags = { - Name = "tf-acctest-%d" + Name = %[1]q } } -`, rInt) +`, rName) } -func testAccInstanceConfig_associatePublic_overridePublic(rInt int) string { - return fmt.Sprintf(` -resource "aws_vpc" "my_vpc" { - cidr_block = "172.16.0.0/16" +func testAccInstanceConfig_associatePublic_defaultPublic(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, true) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.test.id}" tags = { - Name = "terraform-testacc-instance-associate-public-override-public" + Name = %[1]q } } - -resource "aws_subnet" "public_subnet" { - vpc_id = "${aws_vpc.my_vpc.id}" - cidr_block = "172.16.20.0/24" - availability_zone = "us-west-2a" - map_public_ip_on_launch = false - - tags = { - Name = "tf-acc-instance-associate-public-override-public" - } +`, rName) } -resource "aws_instance" "foo" { - ami = "ami-22b9a343" # us-west-2 +func testAccInstanceConfig_associatePublic_explicitPublic(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, true) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" instance_type = "t2.micro" - subnet_id = "${aws_subnet.public_subnet.id}" + subnet_id = "${aws_subnet.test.id}" associate_public_ip_address = true tags = { - Name = "tf-acctest-%d" + Name = %[1]q } } -`, rInt) +`, rName) } -func testAccInstanceConfig_associatePublic_overridePrivate(rInt int) string { - return fmt.Sprintf(` -resource "aws_vpc" "my_vpc" { - cidr_block = "172.16.0.0/16" +func testAccInstanceConfig_associatePublic_explicitPrivate(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, true) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.test.id}" + associate_public_ip_address = false tags = { - Name = "terraform-testacc-instance-associate-public-override-private" + Name = %[1]q } } - -resource "aws_subnet" "public_subnet" { - vpc_id = "${aws_vpc.my_vpc.id}" - cidr_block = "172.16.20.0/24" - availability_zone = "us-west-2a" - map_public_ip_on_launch = true - - tags = { - Name = "tf-acc-instance-associate-public-override-private" - } +`, rName) } -resource "aws_instance" "foo" { - ami = "ami-22b9a343" # us-west-2 +func testAccInstanceConfig_associatePublic_overridePublic(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" instance_type = "t2.micro" - subnet_id = "${aws_subnet.public_subnet.id}" - associate_public_ip_address = false + subnet_id = "${aws_subnet.test.id}" + associate_public_ip_address = true tags = { - Name = "tf-acctest-%d" + Name = %[1]q } } -`, rInt) +`, rName) } -func testAccInstanceConfig_getPasswordData(val bool, rInt int) string { - return fmt.Sprintf(` -# Find latest Microsoft Windows Server 2016 Core image (Amazon deletes old ones) -data "aws_ami" "win2016core" { - most_recent = true - owners = ["amazon"] +func testAccInstanceConfig_associatePublic_overridePrivate(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, true) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.test.id}" + associate_public_ip_address = false - filter { - name = "name" - values = ["Windows_Server-2016-English-Core-Base-*"] + tags = { + Name = %[1]q } } +`, rName) +} -resource "aws_key_pair" "foo" { - key_name = "tf-acctest-%d" +func testAccInstanceConfig_getPasswordData(rName string, val bool) string { + return testAccLatestWindowsServer2016CoreAmiConfig() + fmt.Sprintf(` +resource "aws_key_pair" "test" { + key_name = %[1]q public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAq6U3HQYC4g8WzU147gZZ7CKQH8TgYn3chZGRPxaGmHW1RUwsyEs0nmombmIhwxudhJ4ehjqXsDLoQpd6+c7BuLgTMvbv8LgE9LX53vnljFe1dsObsr/fYLvpU9LTlo8HgHAqO5ibNdrAUvV31ronzCZhms/Gyfdaue88Fd0/YnsZVGeOZPayRkdOHSpqme2CBrpa8myBeL1CWl0LkDG4+YCURjbaelfyZlIApLYKy3FcCan9XQFKaL32MJZwCgzfOvWIMtYcU8QtXMgnA3/I3gXk8YDUJv5P4lj0s/PJXuTM8DygVAUtebNwPuinS7wwonm5FXcWMuVGsVpG5K7FGQ== tf-acc-winpasswordtest" } -resource "aws_instance" "foo" { - ami = "${data.aws_ami.win2016core.id}" +resource "aws_instance" "test" { + ami = "${data.aws_ami.win2016core-ami.id}" instance_type = "t2.medium" - key_name = "${aws_key_pair.foo.key_name}" + key_name = "${aws_key_pair.test.key_name}" - get_password_data = %t + get_password_data = %[2]t } -`, rInt, val) +`, rName, val) } func testAccInstanceConfig_CreditSpecification_Empty_NonBurstable(rName string) string { - return fmt.Sprintf(` -data "aws_ami" "amzn-ami-minimal-hvm-ebs" { - most_recent = true - owners = ["amazon"] - - filter { - name = "name" - values = ["amzn-ami-minimal-hvm-*"] - } - - filter { - name = "root-device-type" - values = ["ebs"] - } -} - - -resource "aws_vpc" "test" { - cidr_block = "172.16.0.0/16" - - tags = { - Name = %[1]q - } -} - -resource "aws_subnet" "test" { - cidr_block = "172.16.0.0/24" - vpc_id = "${aws_vpc.test.id}" -} - + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` resource "aws_instance" "test" { ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" instance_type = "m5.large" @@ -4024,264 +3915,306 @@ resource "aws_instance" "test" { credit_specification {} } -`, rName) +`) } func testAccInstanceConfig_CreditSpecification_Unspecified_NonBurstable(rName string) string { - return fmt.Sprintf(` -data "aws_ami" "amzn-ami-minimal-hvm-ebs" { - most_recent = true - owners = ["amazon"] - - filter { - name = "name" - values = ["amzn-ami-minimal-hvm-*"] - } - - filter { - name = "root-device-type" - values = ["ebs"] - } -} - -resource "aws_vpc" "test" { - cidr_block = "172.16.0.0/16" - - tags = { - Name = %[1]q - } + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "m5.large" + subnet_id = "${aws_subnet.test.id}" } - -resource "aws_subnet" "test" { - cidr_block = "172.16.0.0/24" - vpc_id = "${aws_vpc.test.id}" +`) } +func testAccInstanceConfig_creditSpecification_unspecified(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` resource "aws_instance" "test" { ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" - instance_type = "m5.large" + instance_type = "t2.micro" subnet_id = "${aws_subnet.test.id}" } -`, rName) +`) } -func testAccInstanceConfig_creditSpecification_unspecified(rInt int) string { - return fmt.Sprintf(` -resource "aws_vpc" "my_vpc" { - cidr_block = "172.16.0.0/16" +func testAccInstanceConfig_creditSpecification_unspecified_t3(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t3.micro" + subnet_id = "${aws_subnet.test.id}" - tags = { - Name = "tf-acctest-%d" - } } - -resource "aws_subnet" "my_subnet" { - vpc_id = "${aws_vpc.my_vpc.id}" - cidr_block = "172.16.20.0/24" - availability_zone = "us-west-2a" +`) } -resource "aws_instance" "foo" { - ami = "ami-22b9a343" # us-west-2 +func testAccInstanceConfig_creditSpecification_standardCpuCredits(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" instance_type = "t2.micro" - subnet_id = "${aws_subnet.my_subnet.id}" + subnet_id = "${aws_subnet.test.id}" + + credit_specification { + cpu_credits = "standard" + } } -`, rInt) +`) } -func testAccInstanceConfig_creditSpecification_unspecified_t3(rInt int) string { - return fmt.Sprintf(` -resource "aws_vpc" "my_vpc" { - cidr_block = "172.16.0.0/16" +func testAccInstanceConfig_creditSpecification_standardCpuCredits_t3(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t3.micro" + subnet_id = "${aws_subnet.test.id}" - tags = { - Name = "tf-acctest-%d" + credit_specification { + cpu_credits = "standard" } } - -resource "aws_subnet" "my_subnet" { - vpc_id = "${aws_vpc.my_vpc.id}" - cidr_block = "172.16.20.0/24" - availability_zone = "us-west-2a" +`) } -resource "aws_instance" "foo" { - ami = "ami-51537029" # us-west-2 - instance_type = "t3.micro" - subnet_id = "${aws_subnet.my_subnet.id}" +func testAccInstanceConfig_creditSpecification_unlimitedCpuCredits(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.test.id}" + credit_specification { + cpu_credits = "unlimited" + } } -`, rInt) +`) } -func testAccInstanceConfig_creditSpecification_standardCpuCredits(rInt int) string { - return fmt.Sprintf(` -resource "aws_vpc" "my_vpc" { - cidr_block = "172.16.0.0/16" +func testAccInstanceConfig_creditSpecification_unlimitedCpuCredits_t3(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t3.micro" + subnet_id = "${aws_subnet.test.id}" - tags = { - Name = "tf-acctest-%d" + credit_specification { + cpu_credits = "unlimited" } } - -resource "aws_subnet" "my_subnet" { - vpc_id = "${aws_vpc.my_vpc.id}" - cidr_block = "172.16.20.0/24" - availability_zone = "us-west-2a" +`) } -resource "aws_instance" "foo" { - ami = "ami-22b9a343" # us-west-2 - instance_type = "t2.micro" - subnet_id = "${aws_subnet.my_subnet.id}" +func testAccInstanceConfig_creditSpecification_isNotAppliedToNonBurstable(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "m1.small" + subnet_id = "${aws_subnet.test.id}" credit_specification { cpu_credits = "standard" } } -`, rInt) +`) } -func testAccInstanceConfig_creditSpecification_standardCpuCredits_t3(rInt int) string { - return fmt.Sprintf(` -resource "aws_vpc" "my_vpc" { - cidr_block = "172.16.0.0/16" +func testAccInstanceConfig_creditSpecification_unknownCpuCredits(rName, instanceType string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = %[1]q + subnet_id = "${aws_subnet.test.id}" - tags = { - Name = "tf-acctest-%d" - } + credit_specification {} +} +`, instanceType) } -resource "aws_subnet" "my_subnet" { - vpc_id = "${aws_vpc.my_vpc.id}" - cidr_block = "172.16.20.0/24" - availability_zone = "us-west-2a" +func testAccInstanceConfig_UserData_Unspecified(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.test.id}" +} +`) } -resource "aws_instance" "foo" { - ami = "ami-51537029" # us-west-2 - instance_type = "t3.micro" - subnet_id = "${aws_subnet.my_subnet.id}" +func testAccInstanceConfig_UserData_EmptyString(rName string) string { + return testAccLatestAmazonLinuxHvmEbsAmiConfig() + testAccAwsInstanceVpcConfig(rName, false) + fmt.Sprintf(` +resource "aws_instance" "test" { + ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.test.id}" + user_data = "" +} +`) +} - credit_specification { - cpu_credits = "standard" +// testAccLatestAmazonLinuxHvmEbsAmiConfig returns the configuration for a data source that +// describes the latest Amazon Linux AMI using HVM virtualization and an EBS root device. +// The data source is named 'amzn-ami-minimal-hvm-ebs'. +func testAccLatestAmazonLinuxHvmEbsAmiConfig() string { + return fmt.Sprintf(` +data "aws_ami" "amzn-ami-minimal-hvm-ebs" { + most_recent = true + owners = ["amazon"] + + filter { + name = "name" + values = ["amzn-ami-minimal-hvm-*"] + } + + filter { + name = "root-device-type" + values = ["ebs"] } } -`, rInt) +`) } -func testAccInstanceConfig_creditSpecification_unlimitedCpuCredits(rInt int) string { +// testAccLatestAmazonLinuxPvEbsAmiConfig returns the configuration for a data source that +// describes the latest Amazon Linux AMI using PV virtualization and an EBS root device. +// The data source is named 'amzn-ami-minimal-pv-ebs'. +/* +func testAccLatestAmazonLinuxPvEbsAmiConfig() string { return fmt.Sprintf(` -resource "aws_vpc" "my_vpc" { - cidr_block = "172.16.0.0/16" +data "aws_ami" "amzn-ami-minimal-hvm-ebs" { + most_recent = true + owners = ["amazon"] - tags = { - Name = "tf-acctest-%d" + filter { + name = "name" + values = ["amzn-ami-minimal-pv-*"] } -} -resource "aws_subnet" "my_subnet" { - vpc_id = "${aws_vpc.my_vpc.id}" - cidr_block = "172.16.20.0/24" - availability_zone = "us-west-2a" + filter { + name = "root-device-type" + values = ["ebs"] + } } +`) +} +*/ -resource "aws_instance" "foo" { - ami = "ami-22b9a343" # us-west-2 - instance_type = "t2.micro" - subnet_id = "${aws_subnet.my_subnet.id}" +// testAccLatestWindowsServer2016CoreAmiConfig returns the configuration for a data source that +// describes the latest Microsoft Windows Server 2016 Core AMI. +// The data source is named 'win2016core-ami'. +func testAccLatestWindowsServer2016CoreAmiConfig() string { + return fmt.Sprintf(` +data "aws_ami" "win2016core-ami" { + most_recent = true + owners = ["amazon"] - credit_specification { - cpu_credits = "unlimited" + filter { + name = "name" + values = ["Windows_Server-2016-English-Core-Base-*"] } } -`, rInt) +`) } -func testAccInstanceConfig_creditSpecification_unlimitedCpuCredits_t3(rInt int) string { +// testAccAwsInstanceVpcConfig returns the configuration for tests that create +// 1) a VPC with IPv6 support +// 2) a subnet in the VPC +// The resources are named 'test'. +func testAccAwsInstanceVpcConfig(rName string, mapPublicIpOnLaunch bool) string { return fmt.Sprintf(` -resource "aws_vpc" "my_vpc" { - cidr_block = "172.16.0.0/16" +data "aws_availability_zones" "current" { + # Exclude usw2-az4 (us-west-2d) as it has limited instance types. + blacklisted_zone_ids = ["usw2-az4"] +} + +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" tags = { - Name = "tf-acctest-%d" + Name = %[1]q } } -resource "aws_subnet" "my_subnet" { - vpc_id = "${aws_vpc.my_vpc.id}" - cidr_block = "172.16.20.0/24" - availability_zone = "us-west-2a" -} - -resource "aws_instance" "foo" { - ami = "ami-51537029" # us-west-2 - instance_type = "t3.micro" - subnet_id = "${aws_subnet.my_subnet.id}" +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = "${aws_vpc.test.id}" + availability_zone = "${data.aws_availability_zones.current.names[0]}" + map_public_ip_on_launch = %[2]t - credit_specification { - cpu_credits = "unlimited" + tags = { + Name = %[1]q } } -`, rInt) +`, rName, mapPublicIpOnLaunch) } -func testAccInstanceConfig_creditSpecification_isNotAppliedToNonBurstable(rInt int) string { +// testAccAwsInstanceVpcSecurityGroupConfig returns the configuration for tests that create +// 1) a VPC security group +// 2) an internet gateway in the VPC +// The resources are named 'test'. +func testAccAwsInstanceVpcSecurityGroupConfig(rName string) string { return fmt.Sprintf(` -resource "aws_vpc" "my_vpc" { - cidr_block = "172.16.0.0/16" +resource "aws_internet_gateway" "test" { + vpc_id = "${aws_vpc.test.id}" tags = { - Name = "tf-acctest-%d" + Name = %[1]q } } -resource "aws_subnet" "my_subnet" { - vpc_id = "${aws_vpc.my_vpc.id}" - cidr_block = "172.16.20.0/24" - availability_zone = "us-west-2a" -} +resource "aws_security_group" "test" { + name = %[1]q + description = "test" + vpc_id = "${aws_vpc.test.id}" -resource "aws_instance" "foo" { - ami = "ami-22b9a343" # us-west-2 - instance_type = "m1.small" - subnet_id = "${aws_subnet.my_subnet.id}" + ingress { + protocol = "icmp" + from_port = -1 + to_port = -1 + cidr_blocks = ["0.0.0.0/0"] + } - credit_specification { - cpu_credits = "standard" + tags = { + Name = %[1]q } } -`, rInt) +`, rName) } -func testAccInstanceConfig_creditSpecification_unknownCpuCredits(rInt int, instanceType string) string { +// testAccAwsInstanceVpcIpv6Config returns the configuration for tests that create +// 1) a VPC with IPv6 support +// 2) a subnet in the VPC +// The resources are named 'test'. +func testAccAwsInstanceVpcIpv6Config(rName string) string { return fmt.Sprintf(` -resource "aws_vpc" "my_vpc" { - cidr_block = "172.16.0.0/16" +data "aws_availability_zones" "current" { + # Exclude usw2-az4 (us-west-2d) as it has limited instance types. + blacklisted_zone_ids = ["usw2-az4"] +} + +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + assign_generated_ipv6_cidr_block = true tags = { - Name = "tf-acctest-%d" + Name = %[1]q } } -resource "aws_subnet" "my_subnet" { - vpc_id = "${aws_vpc.my_vpc.id}" - cidr_block = "172.16.20.0/24" - availability_zone = "us-west-2a" -} - -resource "aws_instance" "foo" { - ami = "ami-51537029" # us-west-2 - instance_type = %q - subnet_id = "${aws_subnet.my_subnet.id}" +resource "aws_subnet" "test" { + cidr_block = "10.1.1.0/24" + vpc_id = "${aws_vpc.test.id}" + availability_zone = "${data.aws_availability_zones.current.names[0]}" + ipv6_cidr_block = "${cidrsubnet(aws_vpc.test.ipv6_cidr_block, 8, 1)}" - credit_specification { + tags = { + Name = %[1]q } } -`, rInt, instanceType) +`, rName) } -func testAccInstanceConfig_UserData_Base(rInt int) string { +func testAccInstanceConfigHibernation(hibernation bool) string { return fmt.Sprintf(` data "aws_ami" "amzn-ami-minimal-hvm-ebs" { most_recent = true @@ -4291,7 +4224,7 @@ data "aws_ami" "amzn-ami-minimal-hvm-ebs" { name = "name" values = ["amzn-ami-minimal-hvm-*"] } - + filter { name = "root-device-type" values = ["ebs"] @@ -4299,41 +4232,33 @@ data "aws_ami" "amzn-ami-minimal-hvm-ebs" { } resource "aws_vpc" "test" { - cidr_block = "172.16.0.0/16" + cidr_block = "10.1.0.0/16" tags = { - Name = "tf-acctest-%d" + Name = "terraform-testacc-instance-hibernation" } } resource "aws_subnet" "test" { - vpc_id = "${aws_vpc.test.id}" - cidr_block = "172.16.0.0/24" + cidr_block = "10.1.1.0/24" + vpc_id = aws_vpc.test.id tags = { - Name = "tf-acctest-%d" + Name = "tf-acc-instance-hibernation" } } -`, rInt, rInt) -} -func testAccInstanceConfig_UserData_Unspecified(rInt int) string { - return testAccInstanceConfig_UserData_Base(rInt) + ` +# must be >= m3 and have an encrypted root volume to eanble hibernation resource "aws_instance" "test" { - ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" - instance_type = "t2.micro" - subnet_id = "${aws_subnet.test.id}" -} -` -} + ami = data.aws_ami.amzn-ami-minimal-hvm-ebs.id + hibernation = %[1]t + instance_type = "m5.large" + subnet_id = aws_subnet.test.id -func testAccInstanceConfig_UserData_EmptyString(rInt int) string { - return testAccInstanceConfig_UserData_Base(rInt) + ` -resource "aws_instance" "test" { - ami = "${data.aws_ami.amzn-ami-minimal-hvm-ebs.id}" - instance_type = "t2.micro" - subnet_id = "${aws_subnet.test.id}" - user_data = "" + root_block_device { + encrypted = true + volume_size = 20 + } } -` +`, hibernation) } diff --git a/aws/resource_aws_iot_certificate.go b/aws/resource_aws_iot_certificate.go index 5ea3194d60a..6d8a54f6704 100644 --- a/aws/resource_aws_iot_certificate.go +++ b/aws/resource_aws_iot_certificate.go @@ -62,7 +62,7 @@ func resourceAwsIotCertificateCreate(d *schema.ResourceData, meta interface{}) e } log.Printf("[DEBUG] Created certificate from CSR") - d.SetId(*out.CertificateId) + d.SetId(aws.StringValue(out.CertificateId)) } else { log.Printf("[DEBUG] Creating keys and certificate") out, err := conn.CreateKeysAndCertificate(&iot.CreateKeysAndCertificateInput{ @@ -73,9 +73,9 @@ func resourceAwsIotCertificateCreate(d *schema.ResourceData, meta interface{}) e } log.Printf("[DEBUG] Created keys and certificate") - d.SetId(*out.CertificateId) - d.Set("public_key", *out.KeyPair.PublicKey) - d.Set("private_key", *out.KeyPair.PrivateKey) + d.SetId(aws.StringValue(out.CertificateId)) + d.Set("public_key", out.KeyPair.PublicKey) + d.Set("private_key", out.KeyPair.PrivateKey) } return resourceAwsIotCertificateRead(d, meta) diff --git a/aws/resource_aws_iot_topic_rule.go b/aws/resource_aws_iot_topic_rule.go index f1bdbcdf4b4..fdfc27bf4b6 100644 --- a/aws/resource_aws_iot_topic_rule.go +++ b/aws/resource_aws_iot_topic_rule.go @@ -23,6 +23,7 @@ func resourceAwsIotTopicRule() *schema.Resource { "name": { Type: schema.TypeString, Required: true, + ForceNew: true, ValidateFunc: validateIoTTopicRuleName, }, "description": { diff --git a/aws/resource_aws_key_pair.go b/aws/resource_aws_key_pair.go index 6541b5d0f4a..c8e9f1fbfc6 100644 --- a/aws/resource_aws_key_pair.go +++ b/aws/resource_aws_key_pair.go @@ -7,6 +7,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" @@ -17,7 +18,7 @@ func resourceAwsKeyPair() *schema.Resource { return &schema.Resource{ Create: resourceAwsKeyPairCreate, Read: resourceAwsKeyPairRead, - Update: nil, + Update: resourceAwsKeyPairUpdate, Delete: resourceAwsKeyPairDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, @@ -59,6 +60,11 @@ func resourceAwsKeyPair() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "key_pair_id": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tagsSchema(), }, } } @@ -88,6 +94,30 @@ func resourceAwsKeyPairCreate(d *schema.ResourceData, meta interface{}) error { } d.SetId(*resp.KeyName) + + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + readReq := &ec2.DescribeKeyPairsInput{ + KeyNames: []*string{aws.String(d.Id())}, + } + readResp, err := conn.DescribeKeyPairs(readReq) + 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 readResp.KeyPairs { + if *keyPair.KeyName == d.Id() { + if err := keyvaluetags.Ec2UpdateTags(conn, aws.StringValue(keyPair.KeyPairId), nil, v); err != nil { + return fmt.Errorf("error adding tags: %s", err) + } + } + } + + } return resourceAwsKeyPairRead(d, meta) } @@ -110,6 +140,10 @@ func resourceAwsKeyPairRead(d *schema.ResourceData, meta interface{}) error { if *keyPair.KeyName == d.Id() { d.Set("key_name", keyPair.KeyName) d.Set("fingerprint", keyPair.KeyFingerprint) + d.Set("key_pair_id", keyPair.KeyPairId) + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(keyPair.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } } @@ -117,6 +151,19 @@ func resourceAwsKeyPairRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Unable to find key pair within: %#v", resp.KeyPairs) } +func resourceAwsKeyPairUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.Ec2UpdateTags(conn, d.Get("key_pair_id").(string), o, n); err != nil { + return fmt.Errorf("error adding tags: %s", err) + } + } + + return resourceAwsKeyPairRead(d, meta) +} + func resourceAwsKeyPairDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn diff --git a/aws/resource_aws_key_pair_test.go b/aws/resource_aws_key_pair_test.go index e6326c2d649..ad4dfee755b 100644 --- a/aws/resource_aws_key_pair_test.go +++ b/aws/resource_aws_key_pair_test.go @@ -86,6 +86,50 @@ func TestAccAWSKeyPair_basic(t *testing.T) { }) } +func TestAccAWSKeyPair_tags(t *testing.T) { + var keyPair ec2.KeyPairInfo + resourceName := "aws_key_pair.a_key_pair" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSKeyPairDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSKeyPairConfigTags1("key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSKeyPairExists(resourceName, &keyPair), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"public_key"}, + }, + { + Config: testAccAWSKeyPairConfigTags2("key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSKeyPairExists(resourceName, &keyPair), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSKeyPairConfigTags1("key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSKeyPairExists(resourceName, &keyPair), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSKeyPair_generatedName(t *testing.T) { var keyPair ec2.KeyPairInfo resourceName := "aws_key_pair.a_key_pair" @@ -142,6 +186,27 @@ func TestAccAWSKeyPair_namePrefix(t *testing.T) { }) } +func TestAccAWSKeyPair_disappears(t *testing.T) { + var keyPair ec2.KeyPairInfo + resourceName := "aws_key_pair.a_key_pair" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSKeyPairDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSKeyPairConfig, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSKeyPairExists(resourceName, &keyPair), + testAccCheckAWSKeyPairDisappears(&keyPair), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func testAccCheckAWSKeyPairDestroy(s *terraform.State) error { ec2conn := testAccProvider.Meta().(*AWSClient).ec2conn @@ -174,6 +239,21 @@ func testAccCheckAWSKeyPairDestroy(s *terraform.State) error { return nil } +func testAccCheckAWSKeyPairDisappears(keyPair *ec2.KeyPairInfo) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + req := &ec2.DeleteKeyPairInput{ + KeyName: keyPair.KeyName, + } + if _, err := conn.DeleteKeyPair(req); err != nil { + return err + } + + return nil + } +} + func testAccCheckAWSKeyPairFingerprint(conf *ec2.KeyPairInfo, expectedFingerprint string) resource.TestCheckFunc { return func(s *terraform.State) error { if aws.StringValue(conf.KeyFingerprint) != expectedFingerprint { @@ -229,6 +309,33 @@ resource "aws_key_pair" "a_key_pair" { } ` +func testAccAWSKeyPairConfigTags1(tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_key_pair" "a_key_pair" { + key_name = "tf-acc-key-pair" + public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com" + + tags = { + %[1]q = %[2]q + } +} +`, tagKey1, tagValue1) +} + +func testAccAWSKeyPairConfigTags2(tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_key_pair" "a_key_pair" { + key_name = "tf-acc-key-pair" + public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com" + + tags = { + %[1]q = %[2]q + %[3]q = %[4]q + } +} +`, tagKey1, tagValue1, tagKey2, tagValue2) +} + const testAccAWSKeyPairConfig_generatedName = ` resource "aws_key_pair" "a_key_pair" { public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com" diff --git a/aws/resource_aws_kinesis_analytics_application.go b/aws/resource_aws_kinesis_analytics_application.go index aff14a988fe..d55dc37259a 100644 --- a/aws/resource_aws_kinesis_analytics_application.go +++ b/aws/resource_aws_kinesis_analytics_application.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsKinesisAnalyticsApplication() *schema.Resource { @@ -589,8 +590,8 @@ func resourceAwsKinesisAnalyticsApplicationCreate(d *schema.ResourceData, meta i createOpts.Outputs = outputs } - if v, ok := d.GetOk("tags"); ok { - createOpts.Tags = tagsFromMapKinesisAnalytics(v.(map[string]interface{})) + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + createOpts.Tags = keyvaluetags.New(v).IgnoreAws().KinesisanalyticsTags() } // Retry for IAM eventual consistency @@ -645,8 +646,9 @@ func resourceAwsKinesisAnalyticsApplicationRead(d *schema.ResourceData, meta int return fmt.Errorf("error reading Kinesis Analytics Application (%s): %s", d.Id(), err) } + arn := aws.StringValue(resp.ApplicationDetail.ApplicationARN) d.Set("name", aws.StringValue(resp.ApplicationDetail.ApplicationName)) - d.Set("arn", aws.StringValue(resp.ApplicationDetail.ApplicationARN)) + d.Set("arn", arn) d.Set("code", aws.StringValue(resp.ApplicationDetail.ApplicationCode)) d.Set("create_timestamp", aws.TimeValue(resp.ApplicationDetail.CreateTimestamp).Format(time.RFC3339)) d.Set("description", aws.StringValue(resp.ApplicationDetail.ApplicationDescription)) @@ -670,7 +672,13 @@ func resourceAwsKinesisAnalyticsApplicationRead(d *schema.ResourceData, meta int return fmt.Errorf("error setting reference_data_sources: %s", err) } - if err := getTagsKinesisAnalytics(conn, d); err != nil { + tags, err := keyvaluetags.KinesisanalyticsListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for Kinesis Analytics Application (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -811,10 +819,14 @@ func resourceAwsKinesisAnalyticsApplicationUpdate(d *schema.ResourceData, meta i } } - if err := setTagsKinesisAnalytics(conn, d); err != nil { - return fmt.Errorf("Error update resource tags for %s: %s", d.Id(), err) - } + arn := d.Get("arn").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.KinesisanalyticsUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating Kinesis Analytics Application (%s) tags: %s", arn, err) + } + } } oldReferenceData, newReferenceData := d.GetChange("reference_data_sources") diff --git a/aws/resource_aws_kinesis_analytics_application_test.go b/aws/resource_aws_kinesis_analytics_application_test.go index 4ef45b02ef4..36bf1348106 100644 --- a/aws/resource_aws_kinesis_analytics_application_test.go +++ b/aws/resource_aws_kinesis_analytics_application_test.go @@ -785,7 +785,7 @@ resource "aws_lambda_function" "test" { function_name = "testAcc-%d" handler = "exports.example" role = "${aws_iam_role.lambda.arn}" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } resource "aws_kinesis_firehose_delivery_stream" "test" { @@ -1053,7 +1053,7 @@ resource "aws_lambda_function" "test" { function_name = "tf-acc-test-%d" handler = "exports.example" role = "${aws_iam_role.lambda_function.arn}" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } resource "aws_kinesis_analytics_application" "test" { diff --git a/aws/resource_aws_kinesis_firehose_delivery_stream.go b/aws/resource_aws_kinesis_firehose_delivery_stream.go index 85d07a02a8b..74d24732cb0 100644 --- a/aws/resource_aws_kinesis_firehose_delivery_stream.go +++ b/aws/resource_aws_kinesis_firehose_delivery_stream.go @@ -14,6 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) const ( @@ -1748,17 +1749,25 @@ func extractProcessors(processingConfigurationProcessors []interface{}) []*fireh processors := []*firehose.Processor{} for _, processor := range processingConfigurationProcessors { - processors = append(processors, extractProcessor(processor.(map[string]interface{}))) + extractedProcessor := extractProcessor(processor.(map[string]interface{})) + if extractedProcessor != nil { + processors = append(processors, extractedProcessor) + } } return processors } func extractProcessor(processingConfigurationProcessor map[string]interface{}) *firehose.Processor { - return &firehose.Processor{ - Type: aws.String(processingConfigurationProcessor["type"].(string)), - Parameters: extractProcessorParameters(processingConfigurationProcessor["parameters"].([]interface{})), + var processor *firehose.Processor + processorType := processingConfigurationProcessor["type"].(string) + if processorType != "" { + processor = &firehose.Processor{ + Type: aws.String(processorType), + Parameters: extractProcessorParameters(processingConfigurationProcessor["parameters"].([]interface{})), + } } + return processor } func extractProcessorParameters(processorParameters []interface{}) []*firehose.ProcessorParameter { @@ -2136,7 +2145,7 @@ func resourceAwsKinesisFirehoseDeliveryStreamCreate(d *schema.ResourceData, meta } if v, ok := d.GetOk("tags"); ok { - createInput.Tags = tagsFromMapKinesisFirehose(v.(map[string]interface{})) + createInput.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().FirehoseTags() } err := resource.Retry(1*time.Minute, func() *resource.RetryError { @@ -2307,10 +2316,12 @@ func resourceAwsKinesisFirehoseDeliveryStreamUpdate(d *schema.ResourceData, meta sn, err) } - if err := setTagsKinesisFirehose(conn, d, sn); err != nil { - return fmt.Errorf( - "Error Updating Kinesis Firehose Delivery Stream tags: \"%s\"\n%s", - sn, err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.FirehoseUpdateTags(conn, sn, o, n); err != nil { + return fmt.Errorf("error updating Kinesis Firehose Delivery Stream (%s) tags: %s", sn, err) + } } if d.HasChange("server_side_encryption") { @@ -2366,8 +2377,14 @@ func resourceAwsKinesisFirehoseDeliveryStreamRead(d *schema.ResourceData, meta i return err } - if err := getTagsKinesisFirehose(conn, d, sn); err != nil { - return err + tags, err := keyvaluetags.FirehoseListTags(conn, sn) + + if err != nil { + return fmt.Errorf("error listing tags for Kinesis Firehose Delivery Stream (%s): %s", sn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil diff --git a/aws/resource_aws_kinesis_firehose_delivery_stream_test.go b/aws/resource_aws_kinesis_firehose_delivery_stream_test.go index 96e391b48e8..482c24edb1b 100644 --- a/aws/resource_aws_kinesis_firehose_delivery_stream_test.go +++ b/aws/resource_aws_kinesis_firehose_delivery_stream_test.go @@ -757,11 +757,14 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3Updates(t *testing.T) { preConfig := testAccFirehoseAWSLambdaConfigBasic(funcName, policyName, roleName) + fmt.Sprintf(testAccKinesisFirehoseDeliveryStreamConfig_extendedS3basic, ri, ri, ri, ri) - postConfig := testAccFirehoseAWSLambdaConfigBasic(funcName, policyName, roleName) + - fmt.Sprintf(testAccKinesisFirehoseDeliveryStreamConfig_extendedS3Updates, + firstUpdateConfig := testAccFirehoseAWSLambdaConfigBasic(funcName, policyName, roleName) + + fmt.Sprintf(testAccKinesisFirehoseDeliveryStreamConfig_extendedS3Updates_Initial, + ri, ri, ri, ri) + removeProcessorsConfig := testAccFirehoseAWSLambdaConfigBasic(funcName, policyName, roleName) + + fmt.Sprintf(testAccKinesisFirehoseDeliveryStreamConfig_extendedS3Updates_RemoveProcessors, ri, ri, ri, ri) - updatedExtendedS3DestinationConfig := &firehose.ExtendedS3DestinationDescription{ + firstUpdateExtendedS3DestinationConfig := &firehose.ExtendedS3DestinationDescription{ BufferingHints: &firehose.BufferingHints{ IntervalInSeconds: aws.Int64(400), SizeInMBs: aws.Int64(10), @@ -783,6 +786,18 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3Updates(t *testing.T) { S3BackupMode: aws.String("Enabled"), } + removeProcessorsExtendedS3DestinationConfig := &firehose.ExtendedS3DestinationDescription{ + BufferingHints: &firehose.BufferingHints{ + IntervalInSeconds: aws.Int64(400), + SizeInMBs: aws.Int64(10), + }, + ProcessingConfiguration: &firehose.ProcessingConfiguration{ + Enabled: aws.Bool(false), + Processors: []*firehose.Processor{}, + }, + S3BackupMode: aws.String("Enabled"), + } + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -801,10 +816,17 @@ func TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3Updates(t *testing.T) { ImportStateVerify: true, }, { - Config: postConfig, + Config: firstUpdateConfig, + Check: resource.ComposeTestCheckFunc( + testAccCheckKinesisFirehoseDeliveryStreamExists(resourceName, &stream), + testAccCheckAWSKinesisFirehoseDeliveryStreamAttributes(&stream, nil, firstUpdateExtendedS3DestinationConfig, nil, nil, nil), + ), + }, + { + Config: removeProcessorsConfig, Check: resource.ComposeTestCheckFunc( testAccCheckKinesisFirehoseDeliveryStreamExists(resourceName, &stream), - testAccCheckAWSKinesisFirehoseDeliveryStreamAttributes(&stream, nil, updatedExtendedS3DestinationConfig, nil, nil, nil), + testAccCheckAWSKinesisFirehoseDeliveryStreamAttributes(&stream, nil, removeProcessorsExtendedS3DestinationConfig, nil, nil, nil), ), }, }, @@ -1314,7 +1336,7 @@ resource "aws_lambda_function" "lambda_function_test" { function_name = "%s" role = "${aws_iam_role.iam_for_lambda.arn}" handler = "exports.example" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } `, funcName) } @@ -1656,7 +1678,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { role_arn = "${aws_iam_role.firehose.arn}" bucket_arn = "${aws_s3_bucket.bucket.arn}" processing_configuration { - enabled = false + enabled = true processors { type = "Lambda" parameters { @@ -2000,7 +2022,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { } ` -var testAccKinesisFirehoseDeliveryStreamConfig_extendedS3Updates = testAccKinesisFirehoseDeliveryStreamBaseConfig + ` +var testAccKinesisFirehoseDeliveryStreamConfig_extendedS3Updates_Initial = testAccKinesisFirehoseDeliveryStreamBaseConfig + ` resource "aws_kinesis_firehose_delivery_stream" "test" { depends_on = ["aws_iam_role_policy.firehose"] name = "terraform-kinesis-firehose-basictest-%d" @@ -2009,7 +2031,7 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { role_arn = "${aws_iam_role.firehose.arn}" bucket_arn = "${aws_s3_bucket.bucket.arn}" processing_configuration { - enabled = false + enabled = true processors { type = "Lambda" parameters { @@ -2030,6 +2052,26 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { } ` +var testAccKinesisFirehoseDeliveryStreamConfig_extendedS3Updates_RemoveProcessors = testAccKinesisFirehoseDeliveryStreamBaseConfig + ` +resource "aws_kinesis_firehose_delivery_stream" "test" { + depends_on = ["aws_iam_role_policy.firehose"] + name = "terraform-kinesis-firehose-basictest-%d" + destination = "extended_s3" + extended_s3_configuration { + role_arn = "${aws_iam_role.firehose.arn}" + bucket_arn = "${aws_s3_bucket.bucket.arn}" + buffer_size = 10 + buffer_interval = 400 + compression_format = "GZIP" + s3_backup_mode = "Enabled" + s3_backup_configuration { + role_arn = "${aws_iam_role.firehose.arn}" + bucket_arn = "${aws_s3_bucket.bucket.arn}" + } + } +} +` + var testAccKinesisFirehoseDeliveryStreamBaseRedshiftConfig = testAccKinesisFirehoseDeliveryStreamBaseConfig + ` resource "aws_redshift_cluster" "test_cluster" { cluster_identifier = "tf-redshift-cluster-%d" diff --git a/aws/resource_aws_kinesis_stream.go b/aws/resource_aws_kinesis_stream.go index 48272ebfff3..af9717dbbc9 100644 --- a/aws/resource_aws_kinesis_stream.go +++ b/aws/resource_aws_kinesis_stream.go @@ -13,6 +13,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +const ( + kinesisStreamStatusDeleted = "DESTROYED" ) func resourceAwsKinesisStream() *schema.Resource { @@ -121,8 +126,8 @@ func resourceAwsKinesisStreamCreate(d *schema.ResourceData, meta interface{}) er // No error, wait for ACTIVE state stateConf := &resource.StateChangeConf{ - Pending: []string{"CREATING"}, - Target: []string{"ACTIVE"}, + Pending: []string{kinesis.StreamStatusCreating}, + Target: []string{kinesis.StreamStatusActive}, Refresh: streamStateRefreshFunc(conn, sn), Timeout: d.Timeout(schema.TimeoutCreate), Delay: 10 * time.Second, @@ -147,13 +152,14 @@ func resourceAwsKinesisStreamCreate(d *schema.ResourceData, meta interface{}) er func resourceAwsKinesisStreamUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).kinesisconn - d.Partial(true) - if err := setTagsKinesis(conn, d); err != nil { - return err - } + sn := d.Get("name").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") - d.SetPartial("tags") - d.Partial(false) + if err := keyvaluetags.KinesisUpdateTags(conn, sn, o, n); err != nil { + return fmt.Errorf("error updating Kinesis Stream (%s) tags: %s", sn, err) + } + } if err := updateKinesisShardCount(conn, d); err != nil { return err @@ -179,11 +185,11 @@ func resourceAwsKinesisStreamRead(d *schema.ResourceData, meta interface{}) erro state, err := readKinesisStreamState(conn, sn) if err != nil { if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ResourceNotFoundException" { + if awsErr.Code() == kinesis.ErrCodeResourceNotFoundException { d.SetId("") return nil } - return fmt.Errorf("Error reading Kinesis Stream: \"%s\", code: \"%s\"", awsErr.Message(), awsErr.Code()) + return fmt.Errorf("error reading Kinesis Stream (%s): %s", d.Id(), err) } return err @@ -200,15 +206,14 @@ func resourceAwsKinesisStreamRead(d *schema.ResourceData, meta interface{}) erro d.Set("shard_level_metrics", state.shardLevelMetrics) } - // set tags - describeTagsOpts := &kinesis.ListTagsForStreamInput{ - StreamName: aws.String(sn), - } - tagsResp, err := conn.ListTagsForStream(describeTagsOpts) + tags, err := keyvaluetags.KinesisListTags(conn, sn) + if err != nil { - log.Printf("[DEBUG] Error retrieving tags for Stream: %s. %s", sn, err) - } else { - d.Set("tags", tagsToMapKinesis(tagsResp.Tags)) + return fmt.Errorf("error listing tags for Kinesis Stream (%s): %s", sn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -227,8 +232,8 @@ func resourceAwsKinesisStreamDelete(d *schema.ResourceData, meta interface{}) er } stateConf := &resource.StateChangeConf{ - Pending: []string{"DELETING"}, - Target: []string{"DESTROYED"}, + Pending: []string{kinesis.StreamStatusDeleting}, + Target: []string{kinesisStreamStatusDeleted}, Refresh: streamStateRefreshFunc(conn, sn), Timeout: d.Timeout(schema.TimeoutDelete), Delay: 10 * time.Second, @@ -485,8 +490,8 @@ func streamStateRefreshFunc(conn *kinesis.Kinesis, sn string) resource.StateRefr state, err := readKinesisStreamState(conn, sn) if err != nil { if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "ResourceNotFoundException" { - return 42, "DESTROYED", nil + if awsErr.Code() == kinesis.ErrCodeResourceNotFoundException { + return 42, kinesisStreamStatusDeleted, nil } return nil, awsErr.Code(), err } @@ -499,8 +504,8 @@ func streamStateRefreshFunc(conn *kinesis.Kinesis, sn string) resource.StateRefr func waitForKinesisToBeActive(conn *kinesis.Kinesis, timeout time.Duration, sn string) error { stateConf := &resource.StateChangeConf{ - Pending: []string{"UPDATING"}, - Target: []string{"ACTIVE"}, + Pending: []string{kinesis.StreamStatusUpdating}, + Target: []string{kinesis.StreamStatusActive}, Refresh: streamStateRefreshFunc(conn, sn), Timeout: timeout, Delay: 10 * time.Second, diff --git a/aws/resource_aws_kinesis_stream_test.go b/aws/resource_aws_kinesis_stream_test.go index ce82c58e191..9a9502b9030 100644 --- a/aws/resource_aws_kinesis_stream_test.go +++ b/aws/resource_aws_kinesis_stream_test.go @@ -2,19 +2,74 @@ package aws import ( "fmt" + "log" + "regexp" "strconv" "strings" "testing" - "regexp" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/kinesis" + "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) +func init() { + resource.AddTestSweepers("aws_kinesis_stream", &resource.Sweeper{ + Name: "aws_kinesis_stream", + F: testSweepKinesisStreams, + }) +} + +func testSweepKinesisStreams(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + conn := client.(*AWSClient).kinesisconn + input := &kinesis.ListStreamsInput{} + var sweeperErrs *multierror.Error + + err = conn.ListStreamsPages(input, func(page *kinesis.ListStreamsOutput, lastPage bool) bool { + for _, streamNamePtr := range page.StreamNames { + if streamNamePtr == nil { + continue + } + + streamName := aws.StringValue(streamNamePtr) + input := &kinesis.DeleteStreamInput{ + EnforceConsumerDeletion: aws.Bool(false), + StreamName: streamNamePtr, + } + + log.Printf("[INFO] Deleting Kinesis Stream: %s", streamName) + + _, err := conn.DeleteStream(input) + + if err != nil { + sweeperErr := fmt.Errorf("error deleting Kinesis Stream (%s): %w", streamName, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + } + } + + return !lastPage + }) + + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping Kinesis Stream sweep for %s: %s", region, err) + return nil + } + + if err != nil { + return fmt.Errorf("Error listing Kinesis Streams: %s", err) + } + + return sweeperErrs.ErrorOrNil() +} + func TestAccAWSKinesisStream_basic(t *testing.T) { var stream kinesis.StreamDescription resourceName := "aws_kinesis_stream.test" @@ -337,9 +392,8 @@ func TestAccAWSKinesisStream_enforceConsumerDeletion(t *testing.T) { func TestAccAWSKinesisStream_Tags(t *testing.T) { var stream kinesis.StreamDescription - resourceName := "aws_kinesis_stream.test" rInt := acctest.RandInt() - streamName := fmt.Sprintf("terraform-kinesis-test-%d", rInt) + resourceName := "aws_kinesis_stream.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -350,21 +404,35 @@ func TestAccAWSKinesisStream_Tags(t *testing.T) { Config: testAccKinesisStreamConfig_Tags(rInt, 21), Check: resource.ComposeTestCheckFunc( testAccCheckKinesisStreamExists(resourceName, &stream), - resource.TestCheckResourceAttr(resourceName, "tags.%", "21"), + testAccCheckKinesisStreamTags(resourceName, 21), ), }, { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateId: streamName, + ImportStateId: fmt.Sprintf("terraform-kinesis-test-%d", rInt), ImportStateVerifyIgnore: []string{"enforce_consumer_deletion"}, }, { Config: testAccKinesisStreamConfig_Tags(rInt, 9), Check: resource.ComposeTestCheckFunc( testAccCheckKinesisStreamExists(resourceName, &stream), - resource.TestCheckResourceAttr(resourceName, "tags.%", "9"), + testAccCheckKinesisStreamTags(resourceName, 9), + ), + }, + { + Config: testAccKinesisStreamConfig_Tags(rInt, 50), + Check: resource.ComposeTestCheckFunc( + testAccCheckKinesisStreamExists(resourceName, &stream), + testAccCheckKinesisStreamTags(resourceName, 50), + ), + }, + { + Config: testAccKinesisStreamConfig(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckKinesisStreamExists(resourceName, &stream), + testAccCheckKinesisStreamTags(resourceName, 0), ), }, }, @@ -455,16 +523,30 @@ func testAccAWSKinesisStreamRegisterStreamConsumer(stream *kinesis.StreamDescrip return nil } } +func testAccCheckKinesisStreamTags(n string, tagCount int) resource.TestCheckFunc { + return func(s *terraform.State) error { + if err := resource.TestCheckResourceAttr(n, "tags.%", fmt.Sprintf("%d", tagCount))(s); err != nil { + return err + } + + for i := 0; i < tagCount; i++ { + key := fmt.Sprintf("Key%0125d", i) + value := fmt.Sprintf("Value%0251d", i) + + if err := resource.TestCheckResourceAttr(n, fmt.Sprintf("tags.%s", key), value)(s); err != nil { + return err + } + } + + return nil + } +} func testAccKinesisStreamConfig(rInt int) string { return fmt.Sprintf(` resource "aws_kinesis_stream" "test" { name = "terraform-kinesis-test-%d" shard_count = 2 - - tags = { - Name = "tf-test" - } } `, rInt) } @@ -617,21 +699,28 @@ resource "aws_kinesis_stream" "test" { } func testAccKinesisStreamConfig_Tags(rInt, tagCount int) string { - var tagPairs string - for i := 1; i <= tagCount; i++ { - tagPairs = tagPairs + fmt.Sprintf("tag%d = \"tag%dvalue\"\n", i, i) + // Tag limits: + // * Maximum number of tags per resource – 50 + // * Maximum key length – 128 Unicode characters in UTF-8 + // * Maximum value length – 256 Unicode characters in UTF-8 + tagPairs := make([]string, tagCount) + for i := 0; i < tagCount; i++ { + key := fmt.Sprintf("Key%0125d", i) + value := fmt.Sprintf("Value%0251d", i) + + tagPairs[i] = fmt.Sprintf("%s = %q", key, value) } return fmt.Sprintf(` resource "aws_kinesis_stream" "test" { - name = "terraform-kinesis-test-%d" + name = "terraform-kinesis-test-%[1]d" shard_count = 2 tags = { - %s + %[2]s } } -`, rInt, tagPairs) +`, rInt, strings.Join(tagPairs, "\n")) } func testAccKinesisStreamConfigWithEnforceConsumerDeletion(rInt int) string { diff --git a/aws/resource_aws_kms_external_key.go b/aws/resource_aws_kms_external_key.go index 46b4a446e50..a21b50e43e0 100644 --- a/aws/resource_aws_kms_external_key.go +++ b/aws/resource_aws_kms_external_key.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/structure" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsKmsExternalKey() *schema.Resource { @@ -105,7 +106,7 @@ func resourceAwsKmsExternalKeyCreate(d *schema.ResourceData, meta interface{}) e } if v, ok := d.GetOk("tags"); ok { - input.Tags = tagsFromMapKMS(v.(map[string]interface{})) + input.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().KmsTags() } var output *kms.CreateKeyOutput @@ -227,20 +228,6 @@ func resourceAwsKmsExternalKeyRead(d *schema.ResourceData, meta interface{}) err return fmt.Errorf("error normalizing KMS External Key (%s) policy: %s", d.Id(), err) } - listResourceTagsInput := &kms.ListResourceTagsInput{ - KeyId: metadata.KeyId, - } - - listResourceTagsOutput, err := conn.ListResourceTags(listResourceTagsInput) - - if err != nil { - return fmt.Errorf("error listing KMS External Key (%s) tags: %s", d.Id(), err) - } - - if listResourceTagsOutput == nil { - return fmt.Errorf("error listing KMS External Key (%s) tags: empty response", d.Id()) - } - d.Set("arn", metadata.Arn) d.Set("description", metadata.Description) d.Set("enabled", metadata.Enabled) @@ -249,7 +236,12 @@ func resourceAwsKmsExternalKeyRead(d *schema.ResourceData, meta interface{}) err d.Set("key_usage", metadata.KeyUsage) d.Set("policy", policy) - if err := d.Set("tags", tagsToMapKMS(listResourceTagsOutput.Tags)); err != nil { + tags, err := keyvaluetags.KmsListTags(conn, d.Id()) + if err != nil { + return fmt.Errorf("error listing tags for KMS Key (%s): %s", d.Id(), err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -314,8 +306,12 @@ func resourceAwsKmsExternalKeyUpdate(d *schema.ResourceData, meta interface{}) e } } - if err := setTagsKMS(conn, d, d.Id()); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.KmsUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating KMS External Key (%s) tags: %s", d.Id(), err) + } } return resourceAwsKmsExternalKeyRead(d, meta) diff --git a/aws/resource_aws_kms_key.go b/aws/resource_aws_kms_key.go index e88b245f3a9..13f1d664000 100644 --- a/aws/resource_aws_kms_key.go +++ b/aws/resource_aws_kms_key.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/structure" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsKmsKey() *schema.Resource { @@ -43,11 +44,27 @@ func resourceAwsKmsKey() *schema.Resource { "key_usage": { Type: schema.TypeString, Optional: true, - Computed: true, + Default: kms.KeyUsageTypeEncryptDecrypt, ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ - "", kms.KeyUsageTypeEncryptDecrypt, + kms.KeyUsageTypeSignVerify, + }, false), + }, + "customer_master_key_spec": { + Type: schema.TypeString, + Optional: true, + Default: kms.CustomerMasterKeySpecSymmetricDefault, + ForceNew: true, + ValidateFunc: validation.StringInSlice([]string{ + kms.CustomerMasterKeySpecSymmetricDefault, + kms.CustomerMasterKeySpecRsa2048, + kms.CustomerMasterKeySpecRsa3072, + kms.CustomerMasterKeySpecRsa4096, + kms.CustomerMasterKeySpecEccNistP256, + kms.CustomerMasterKeySpecEccNistP384, + kms.CustomerMasterKeySpecEccNistP521, + kms.CustomerMasterKeySpecEccSecgP256k1, }, false), }, "policy": { @@ -81,18 +98,18 @@ 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 + req := &kms.CreateKeyInput{ + CustomerMasterKeySpec: aws.String(d.Get("customer_master_key_spec").(string)), + KeyUsage: aws.String(d.Get("key_usage").(string)), + } 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)) } if v, exists := d.GetOk("tags"); exists { - req.Tags = tagsFromMapKMS(v.(map[string]interface{})) + req.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().KmsTags() } var resp *kms.CreateKeyOutput @@ -102,20 +119,20 @@ func resourceAwsKmsKeyCreate(d *schema.ResourceData, meta interface{}) error { // 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", "") { + resp, err = conn.CreateKey(req) + if isAWSErr(err, kms.ErrCodeMalformedPolicyDocumentException, "") { return resource.RetryableError(err) } return resource.NonRetryableError(err) }) if isResourceTimeoutError(err) { - resp, err = conn.CreateKey(&req) + resp, err = conn.CreateKey(req) } if err != nil { return err } - d.SetId(*resp.KeyMetadata.KeyId) + d.SetId(aws.StringValue(resp.KeyMetadata.KeyId)) d.Set("key_id", resp.KeyMetadata.KeyId) return resourceAwsKmsKeyUpdate(d, meta) @@ -132,7 +149,7 @@ func resourceAwsKmsKeyRead(d *schema.ResourceData, meta interface{}) error { var err error if d.IsNewResource() { var out interface{} - out, err = retryOnAwsCode("NotFoundException", func() (interface{}, error) { + out, err = retryOnAwsCode(kms.ErrCodeNotFoundException, func() (interface{}, error) { return conn.DescribeKey(req) }) resp, _ = out.(*kms.DescribeKeyOutput) @@ -144,23 +161,22 @@ func resourceAwsKmsKeyRead(d *schema.ResourceData, meta interface{}) error { } metadata := resp.KeyMetadata - if *metadata.KeyState == "PendingDeletion" { + if aws.StringValue(metadata.KeyState) == kms.KeyStatePendingDeletion { 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("customer_master_key_spec", metadata.CustomerMasterKeySpec) d.Set("is_enabled", metadata.Enabled) - pOut, err := retryOnAwsCode("NotFoundException", func() (interface{}, error) { + pOut, err := retryOnAwsCode(kms.ErrCodeNotFoundException, func() (interface{}, error) { return conn.GetKeyPolicy(&kms.GetKeyPolicyInput{ - KeyId: metadata.KeyId, + KeyId: aws.String(d.Id()), PolicyName: aws.String("default"), }) }) @@ -175,9 +191,9 @@ func resourceAwsKmsKeyRead(d *schema.ResourceData, meta interface{}) error { } d.Set("policy", policy) - out, err := retryOnAwsCode("NotFoundException", func() (interface{}, error) { + out, err := retryOnAwsCode(kms.ErrCodeNotFoundException, func() (interface{}, error) { return conn.GetKeyRotationStatus(&kms.GetKeyRotationStatusInput{ - KeyId: metadata.KeyId, + KeyId: aws.String(d.Id()), }) }) if err != nil { @@ -186,16 +202,14 @@ func resourceAwsKmsKeyRead(d *schema.ResourceData, meta interface{}) error { krs, _ := out.(*kms.GetKeyRotationStatusOutput) d.Set("enable_key_rotation", krs.KeyRotationEnabled) - tOut, err := retryOnAwsCode("NotFoundException", func() (interface{}, error) { - return conn.ListResourceTags(&kms.ListResourceTagsInput{ - KeyId: metadata.KeyId, - }) - }) + tags, err := keyvaluetags.KmsListTags(conn, d.Id()) if err != nil { - return fmt.Errorf("Failed to get KMS key tags (key: %s): %s", d.Get("key_id").(string), err) + return fmt.Errorf("error listing tags for KMS Key (%s): %s", d.Id(), err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - tagList := tOut.(*kms.ListResourceTagsOutput) - d.Set("tags", tagsToMapKMS(tagList.Tags)) return nil } @@ -236,8 +250,12 @@ func resourceAwsKmsKeyUpdate(d *schema.ResourceData, meta interface{}) error { } } - if err := setTagsKMS(conn, d, d.Id()); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.KmsUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating KMS Key (%s) tags: %s", d.Id(), err) + } } return resourceAwsKmsKeyRead(d, meta) @@ -456,8 +474,8 @@ func resourceAwsKmsKeyDelete(d *schema.ResourceData, meta interface{}) error { // Wait for propagation since KMS is eventually consistent wait := resource.StateChangeConf{ - Pending: []string{"Enabled", "Disabled"}, - Target: []string{"PendingDeletion"}, + Pending: []string{kms.KeyStateEnabled, kms.KeyStateDisabled}, + Target: []string{kms.KeyStatePendingDeletion}, Timeout: 20 * time.Minute, MinTimeout: 2 * time.Second, ContinuousTargetOccurence: 10, diff --git a/aws/resource_aws_kms_key_test.go b/aws/resource_aws_kms_key_test.go index c330502f433..3272c7dda24 100644 --- a/aws/resource_aws_kms_key_test.go +++ b/aws/resource_aws_kms_key_test.go @@ -68,8 +68,8 @@ func testSweepKmsKeys(region string) error { } func TestAccAWSKmsKey_basic(t *testing.T) { - var keyBefore, keyAfter kms.KeyMetadata - rName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + var key kms.KeyMetadata + rName := fmt.Sprintf("tf-testacc-kms-key-%s", acctest.RandStringFromCharSet(13, acctest.CharSetAlphaNum)) resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ @@ -80,7 +80,9 @@ func TestAccAWSKmsKey_basic(t *testing.T) { { Config: testAccAWSKmsKey(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSKmsKeyExists(resourceName, &keyBefore), + testAccCheckAWSKmsKeyExists(resourceName, &key), + resource.TestCheckResourceAttr(resourceName, "customer_master_key_spec", "SYMMETRIC_DEFAULT"), + resource.TestCheckResourceAttr(resourceName, "key_usage", "ENCRYPT_DECRYPT"), ), }, { @@ -89,10 +91,26 @@ func TestAccAWSKmsKey_basic(t *testing.T) { ImportStateVerify: true, ImportStateVerifyIgnore: []string{"deletion_window_in_days"}, }, + }, + }) +} + +func TestAccAWSKmsKey_asymmetricKey(t *testing.T) { + var key kms.KeyMetadata + rName := fmt.Sprintf("tf-testacc-kms-key-%s", acctest.RandStringFromCharSet(13, acctest.CharSetAlphaNum)) + resourceName := "aws_kms_key.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSKmsKeyDestroy, + Steps: []resource.TestStep{ { - Config: testAccAWSKmsKey_removedPolicy(rName), + Config: testAccAWSKmsKey_asymmetric(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSKmsKeyExists(resourceName, &keyAfter), + testAccCheckAWSKmsKeyExists(resourceName, &key), + resource.TestCheckResourceAttr(resourceName, "customer_master_key_spec", "ECC_NIST_P384"), + resource.TestCheckResourceAttr(resourceName, "key_usage", "SIGN_VERIFY"), ), }, }, @@ -101,7 +119,7 @@ func TestAccAWSKmsKey_basic(t *testing.T) { func TestAccAWSKmsKey_disappears(t *testing.T) { var key kms.KeyMetadata - rName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + rName := fmt.Sprintf("tf-testacc-kms-key-%s", acctest.RandStringFromCharSet(13, acctest.CharSetAlphaNum)) resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ @@ -113,11 +131,8 @@ func TestAccAWSKmsKey_disappears(t *testing.T) { Config: testAccAWSKmsKey(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSKmsKeyExists(resourceName, &key), + testAccCheckAWSKmsKeyDisappears(&key), ), - }, - { - Config: testAccAWSKmsKey_other_region(rName), - PlanOnly: true, ExpectNonEmptyPlan: true, }, }, @@ -126,7 +141,7 @@ func TestAccAWSKmsKey_disappears(t *testing.T) { func TestAccAWSKmsKey_policy(t *testing.T) { var key kms.KeyMetadata - rName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + rName := fmt.Sprintf("tf-testacc-kms-key-%s", acctest.RandStringFromCharSet(13, acctest.CharSetAlphaNum)) resourceName := "aws_kms_key.test" expectedPolicyText := `{"Version":"2012-10-17","Id":"kms-tf-1","Statement":[{"Sid":"Enable IAM User Permissions","Effect":"Allow","Principal":{"AWS":"*"},"Action":"kms:*","Resource":"*"}]}` @@ -136,7 +151,7 @@ func TestAccAWSKmsKey_policy(t *testing.T) { CheckDestroy: testAccCheckAWSKmsKeyDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSKmsKey(rName), + Config: testAccAWSKmsKey_policy(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSKmsKeyExists(resourceName, &key), testAccCheckAWSKmsKeyHasPolicy(resourceName, expectedPolicyText), @@ -148,13 +163,19 @@ func TestAccAWSKmsKey_policy(t *testing.T) { ImportStateVerify: true, ImportStateVerifyIgnore: []string{"deletion_window_in_days"}, }, + { + Config: testAccAWSKmsKey_removedPolicy(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSKmsKeyExists(resourceName, &key), + ), + }, }, }) } func TestAccAWSKmsKey_isEnabled(t *testing.T) { var key1, key2, key3 kms.KeyMetadata - rName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + rName := fmt.Sprintf("tf-testacc-kms-key-%s", acctest.RandStringFromCharSet(13, acctest.CharSetAlphaNum)) resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ @@ -165,8 +186,8 @@ func TestAccAWSKmsKey_isEnabled(t *testing.T) { { Config: testAccAWSKmsKey_enabledRotation(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSKmsKeyExists("aws_kms_key.test", &key1), - resource.TestCheckResourceAttr("aws_kms_key.test", "is_enabled", "true"), + testAccCheckAWSKmsKeyExists(resourceName, &key1), + resource.TestCheckResourceAttr(resourceName, "is_enabled", "true"), testAccCheckAWSKmsKeyIsEnabled(&key1, true), resource.TestCheckResourceAttr("aws_kms_key.test", "enable_key_rotation", "true"), ), @@ -180,19 +201,19 @@ func TestAccAWSKmsKey_isEnabled(t *testing.T) { { Config: testAccAWSKmsKey_disabled(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSKmsKeyExists("aws_kms_key.test", &key2), - resource.TestCheckResourceAttr("aws_kms_key.test", "is_enabled", "false"), + testAccCheckAWSKmsKeyExists(resourceName, &key2), + resource.TestCheckResourceAttr(resourceName, "is_enabled", "false"), testAccCheckAWSKmsKeyIsEnabled(&key2, false), - resource.TestCheckResourceAttr("aws_kms_key.test", "enable_key_rotation", "false"), + resource.TestCheckResourceAttr(resourceName, "enable_key_rotation", "false"), ), }, { Config: testAccAWSKmsKey_enabled(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSKmsKeyExists("aws_kms_key.test", &key3), - resource.TestCheckResourceAttr("aws_kms_key.test", "is_enabled", "true"), + testAccCheckAWSKmsKeyExists(resourceName, &key3), + resource.TestCheckResourceAttr(resourceName, "is_enabled", "true"), testAccCheckAWSKmsKeyIsEnabled(&key3, true), - resource.TestCheckResourceAttr("aws_kms_key.test", "enable_key_rotation", "true"), + resource.TestCheckResourceAttr(resourceName, "enable_key_rotation", "true"), ), }, }, @@ -200,8 +221,8 @@ func TestAccAWSKmsKey_isEnabled(t *testing.T) { } func TestAccAWSKmsKey_tags(t *testing.T) { - var keyBefore kms.KeyMetadata - rName := acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum) + var key kms.KeyMetadata + rName := fmt.Sprintf("tf-testacc-kms-key-%s", acctest.RandStringFromCharSet(13, acctest.CharSetAlphaNum)) resourceName := "aws_kms_key.test" resource.ParallelTest(t, resource.TestCase{ @@ -212,7 +233,7 @@ func TestAccAWSKmsKey_tags(t *testing.T) { { Config: testAccAWSKmsKey_tags(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSKmsKeyExists(resourceName, &keyBefore), + testAccCheckAWSKmsKeyExists(resourceName, &key), resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), ), }, @@ -222,6 +243,13 @@ func TestAccAWSKmsKey_tags(t *testing.T) { ImportStateVerify: true, ImportStateVerifyIgnore: []string{"deletion_window_in_days"}, }, + { + Config: testAccAWSKmsKey(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSKmsKeyExists(resourceName, &key), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, }, }) } @@ -328,45 +356,44 @@ func testAccCheckAWSKmsKeyIsEnabled(key *kms.KeyMetadata, isEnabled bool) resour } } +func testAccCheckAWSKmsKeyDisappears(key *kms.KeyMetadata) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).kmsconn + + _, err := conn.ScheduleKeyDeletion(&kms.ScheduleKeyDeletionInput{ + KeyId: key.KeyId, + PendingWindowInDays: aws.Int64(int64(7)), + }) + + return err + } +} + func testAccAWSKmsKey(rName string) string { return fmt.Sprintf(` resource "aws_kms_key" "test" { - description = "Terraform acc test %s" + description = %[1]q deletion_window_in_days = 7 - - policy = <= 0 { log.Printf("[DEBUG] Setting Concurrency to %d for the Lambda Function %s", reservedConcurrentExecutions, functionName) @@ -494,7 +506,7 @@ func resourceAwsLambdaFunctionRead(d *schema.ResourceData, meta interface{}) err getFunctionOutput, err := conn.GetFunction(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "ResourceNotFoundException" && !d.IsNewResource() { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == lambda.ErrCodeResourceNotFoundException && !d.IsNewResource() { d.SetId("") return nil } @@ -510,7 +522,9 @@ func resourceAwsLambdaFunctionRead(d *schema.ResourceData, meta interface{}) err // Tagging operations are permitted on Lambda functions only. // Tags on aliases and versions are not supported. if !qualifierExistance { - d.Set("tags", tagsToMapGeneric(getFunctionOutput.Tags)) + if err := d.Set("tags", keyvaluetags.LambdaKeyValueTags(getFunctionOutput.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } } // getFunctionOutput.Code.Location is a pre-signed URL pointing at the zip @@ -659,10 +673,13 @@ func resourceAwsLambdaFunctionUpdate(d *schema.ResourceData, meta interface{}) e d.Partial(true) arn := d.Get("arn").(string) - if tagErr := setTagsLambda(conn, d, arn); tagErr != nil { - return tagErr + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.LambdaUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating Lambda Function (%s) tags: %s", arn, err) + } } - d.SetPartial("tags") configReq := &lambda.UpdateFunctionConfigurationInput{ FunctionName: aws.String(d.Id()), @@ -816,6 +833,10 @@ func resourceAwsLambdaFunctionUpdate(d *schema.ResourceData, meta interface{}) e } } + if err := waitForLambdaFunctionUpdate(conn, d.Id(), d.Timeout(schema.TimeoutUpdate)); err != nil { + return fmt.Errorf("error waiting for Lambda Function (%s) update: %s", d.Id(), err) + } + d.SetPartial("description") d.SetPartial("handler") d.SetPartial("memory_size") @@ -823,10 +844,10 @@ func resourceAwsLambdaFunctionUpdate(d *schema.ResourceData, meta interface{}) e d.SetPartial("timeout") } - if needsFunctionCodeUpdate(d) { + codeUpdate := needsFunctionCodeUpdate(d) + if codeUpdate { codeReq := &lambda.UpdateFunctionCodeInput{ FunctionName: aws.String(d.Id()), - Publish: aws.Bool(d.Get("publish").(bool)), } if v, ok := d.GetOk("filename"); ok { @@ -894,6 +915,18 @@ func resourceAwsLambdaFunctionUpdate(d *schema.ResourceData, meta interface{}) e } } + publish := d.Get("publish").(bool) + if publish && (codeUpdate || configUpdate) { + versionReq := &lambda.PublishVersionInput{ + FunctionName: aws.String(d.Id()), + } + + _, err := conn.PublishVersion(versionReq) + if err != nil { + return fmt.Errorf("Error publishing Lambda Function Version %s: %s", d.Id(), err) + } + } + d.Partial(false) return resourceAwsLambdaFunctionRead(d, meta) @@ -930,3 +963,83 @@ func lambdaFunctionInvokeArn(functionArn string, meta interface{}) string { Resource: fmt.Sprintf("path/2015-03-31/functions/%s/invocations", functionArn), }.String() } + +func refreshLambdaFunctionLastUpdateStatus(conn *lambda.Lambda, functionName string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + input := &lambda.GetFunctionInput{ + FunctionName: aws.String(functionName), + } + + output, err := conn.GetFunction(input) + + if err != nil { + return nil, "", err + } + + if output == nil || output.Configuration == nil { + return nil, "", nil + } + + lastUpdateStatus := aws.StringValue(output.Configuration.LastUpdateStatus) + + if lastUpdateStatus == lambda.LastUpdateStatusFailed { + return output.Configuration, lastUpdateStatus, fmt.Errorf("%s: %s", aws.StringValue(output.Configuration.LastUpdateStatusReasonCode), aws.StringValue(output.Configuration.LastUpdateStatusReason)) + } + + return output.Configuration, lastUpdateStatus, nil + } +} + +func refreshLambdaFunctionState(conn *lambda.Lambda, functionName string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + input := &lambda.GetFunctionInput{ + FunctionName: aws.String(functionName), + } + + output, err := conn.GetFunction(input) + + if err != nil { + return nil, "", err + } + + if output == nil || output.Configuration == nil { + return nil, "", nil + } + + state := aws.StringValue(output.Configuration.State) + + if state == lambda.StateFailed { + return output.Configuration, state, fmt.Errorf("%s: %s", aws.StringValue(output.Configuration.StateReasonCode), aws.StringValue(output.Configuration.StateReason)) + } + + return output.Configuration, state, nil + } +} + +func waitForLambdaFunctionCreation(conn *lambda.Lambda, functionName string, timeout time.Duration) error { + stateConf := &resource.StateChangeConf{ + Pending: []string{lambda.StatePending}, + Target: []string{lambda.StateActive}, + Refresh: refreshLambdaFunctionState(conn, functionName), + Timeout: timeout, + Delay: 5 * time.Second, + } + + _, err := stateConf.WaitForState() + + return err +} + +func waitForLambdaFunctionUpdate(conn *lambda.Lambda, functionName string, timeout time.Duration) error { + stateConf := &resource.StateChangeConf{ + Pending: []string{lambda.LastUpdateStatusInProgress}, + Target: []string{lambda.LastUpdateStatusSuccessful}, + Refresh: refreshLambdaFunctionLastUpdateStatus(conn, functionName), + Timeout: timeout, + Delay: 5 * time.Second, + } + + _, err := stateConf.WaitForState() + + return err +} diff --git a/aws/resource_aws_lambda_function_event_invoke_config.go b/aws/resource_aws_lambda_function_event_invoke_config.go new file mode 100644 index 00000000000..c8bf754f115 --- /dev/null +++ b/aws/resource_aws_lambda_function_event_invoke_config.go @@ -0,0 +1,425 @@ +package aws + +import ( + "fmt" + "log" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" + "github.com/aws/aws-sdk-go/service/lambda" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" +) + +func resourceAwsLambdaFunctionEventInvokeConfig() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsLambdaFunctionEventInvokeConfigCreate, + Read: resourceAwsLambdaFunctionEventInvokeConfigRead, + Update: resourceAwsLambdaFunctionEventInvokeConfigUpdate, + Delete: resourceAwsLambdaFunctionEventInvokeConfigDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + + Schema: map[string]*schema.Schema{ + "destination_config": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "on_failure": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "destination": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validateArn, + }, + }, + }, + }, + "on_success": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "destination": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validateArn, + }, + }, + }, + }, + }, + }, + }, + "function_name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.NoZeroValues, + }, + "maximum_event_age_in_seconds": { + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntBetween(60, 21600), + }, + "maximum_retry_attempts": { + Type: schema.TypeInt, + Optional: true, + Default: 2, + ValidateFunc: validation.IntBetween(0, 2), + }, + "qualifier": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + ValidateFunc: validation.NoZeroValues, + }, + }, + } +} + +func resourceAwsLambdaFunctionEventInvokeConfigCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).lambdaconn + functionName := d.Get("function_name").(string) + qualifier := d.Get("qualifier").(string) + + id := functionName + + if qualifier != "" { + id = fmt.Sprintf("%s:%s", functionName, qualifier) + } + + input := &lambda.PutFunctionEventInvokeConfigInput{ + DestinationConfig: expandLambdaFunctionEventInvokeConfigDestinationConfig(d.Get("destination_config").([]interface{})), + FunctionName: aws.String(functionName), + MaximumRetryAttempts: aws.Int64(int64(d.Get("maximum_retry_attempts").(int))), + } + + if qualifier != "" { + input.Qualifier = aws.String(qualifier) + } + + if v, ok := d.GetOk("maximum_event_age_in_seconds"); ok { + input.MaximumEventAgeInSeconds = aws.Int64(int64(v.(int))) + } + + // Retry for destination validation eventual consistency errors + err := resource.Retry(2*time.Minute, func() *resource.RetryError { + _, err := conn.PutFunctionEventInvokeConfig(input) + + // InvalidParameterValueException: The destination ARN arn:PARTITION:SERVICE:REGION:ACCOUNT:RESOURCE is invalid. + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "destination ARN") { + return resource.RetryableError(err) + } + + // InvalidParameterValueException: The function's execution role does not have permissions to call Publish on arn:... + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "does not have permissions") { + return resource.RetryableError(err) + } + + if err != nil { + return resource.NonRetryableError(err) + } + + return nil + }) + + if isResourceTimeoutError(err) { + _, err = conn.PutFunctionEventInvokeConfig(input) + } + + if err != nil { + return fmt.Errorf("error putting Lambda Function Event Invoke Config (%s): %s", id, err) + } + + d.SetId(id) + + return resourceAwsLambdaFunctionEventInvokeConfigRead(d, meta) +} + +func resourceAwsLambdaFunctionEventInvokeConfigRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).lambdaconn + + functionName, qualifier, err := resourceAwsLambdaFunctionEventInvokeConfigParseId(d.Id()) + + if err != nil { + return err + } + + input := &lambda.GetFunctionEventInvokeConfigInput{ + FunctionName: aws.String(functionName), + } + + if qualifier != "" { + input.Qualifier = aws.String(qualifier) + } + + output, err := conn.GetFunctionEventInvokeConfig(input) + + if isAWSErr(err, lambda.ErrCodeResourceNotFoundException, "") { + log.Printf("[WARN] Lambda Function Event Invoke Config (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + if err != nil { + return fmt.Errorf("error getting Lambda Function Event Invoke Config (%s): %s", d.Id(), err) + } + + if err := d.Set("destination_config", flattenLambdaFunctionEventInvokeConfigDestinationConfig(output.DestinationConfig)); err != nil { + return fmt.Errorf("error setting destination_config: %s", err) + } + + d.Set("function_name", functionName) + d.Set("maximum_event_age_in_seconds", aws.Int64Value(output.MaximumEventAgeInSeconds)) + d.Set("maximum_retry_attempts", aws.Int64Value(output.MaximumRetryAttempts)) + d.Set("qualifier", qualifier) + + return nil +} + +func resourceAwsLambdaFunctionEventInvokeConfigUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).lambdaconn + + functionName, qualifier, err := resourceAwsLambdaFunctionEventInvokeConfigParseId(d.Id()) + + if err != nil { + return err + } + + input := &lambda.PutFunctionEventInvokeConfigInput{ + DestinationConfig: expandLambdaFunctionEventInvokeConfigDestinationConfig(d.Get("destination_config").([]interface{})), + FunctionName: aws.String(functionName), + MaximumRetryAttempts: aws.Int64(int64(d.Get("maximum_retry_attempts").(int))), + } + + if qualifier != "" { + input.Qualifier = aws.String(qualifier) + } + + if v, ok := d.GetOk("maximum_event_age_in_seconds"); ok { + input.MaximumEventAgeInSeconds = aws.Int64(int64(v.(int))) + } + + // Retry for destination validation eventual consistency errors + err = resource.Retry(2*time.Minute, func() *resource.RetryError { + _, err := conn.PutFunctionEventInvokeConfig(input) + + // InvalidParameterValueException: The destination ARN arn:PARTITION:SERVICE:REGION:ACCOUNT:RESOURCE is invalid. + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "destination ARN") { + return resource.RetryableError(err) + } + + // InvalidParameterValueException: The function's execution role does not have permissions to call Publish on arn:... + if isAWSErr(err, lambda.ErrCodeInvalidParameterValueException, "does not have permissions") { + return resource.RetryableError(err) + } + + if err != nil { + return resource.NonRetryableError(err) + } + + return nil + }) + + if isResourceTimeoutError(err) { + _, err = conn.PutFunctionEventInvokeConfig(input) + } + + if err != nil { + return fmt.Errorf("error putting Lambda Function Event Invoke Config (%s): %s", d.Id(), err) + } + + return resourceAwsLambdaFunctionEventInvokeConfigRead(d, meta) +} + +func resourceAwsLambdaFunctionEventInvokeConfigDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).lambdaconn + + functionName, qualifier, err := resourceAwsLambdaFunctionEventInvokeConfigParseId(d.Id()) + + if err != nil { + return err + } + + input := &lambda.DeleteFunctionEventInvokeConfigInput{ + FunctionName: aws.String(functionName), + } + + if qualifier != "" { + input.Qualifier = aws.String(qualifier) + } + + _, err = conn.DeleteFunctionEventInvokeConfig(input) + + if isAWSErr(err, lambda.ErrCodeResourceNotFoundException, "") { + return nil + } + + if err != nil { + return fmt.Errorf("error putting Lambda Function Event Invoke Config (%s): %s", d.Id(), err) + } + + return nil +} + +func resourceAwsLambdaFunctionEventInvokeConfigParseId(id string) (string, string, error) { + if arn.IsARN(id) { + parsedARN, err := arn.Parse(id) + + if err != nil { + return "", "", fmt.Errorf("error parsing ARN (%s): %s", id, err) + } + + function := strings.TrimPrefix(parsedARN.Resource, "function:") + + if !strings.Contains(function, ":") { + // Return ARN for function name to match configuration + return id, "", nil + } + + functionParts := strings.Split(id, ":") + + if len(functionParts) != 2 || functionParts[0] == "" || functionParts[1] == "" { + return "", "", fmt.Errorf("unexpected format of function resource (%s), expected name:qualifier", id) + } + + qualifier := functionParts[1] + // Return ARN minus qualifier for function name to match configuration + functionName := strings.TrimSuffix(id, fmt.Sprintf(":%s", qualifier)) + + return functionName, qualifier, nil + } + + if !strings.Contains(id, ":") { + return id, "", nil + } + + idParts := strings.Split(id, ":") + + if len(idParts) != 2 || idParts[0] == "" || idParts[1] == "" { + return "", "", fmt.Errorf("unexpected format of ID (%s), expected name or name:qualifier", id) + } + + return idParts[0], idParts[1], nil +} + +func expandLambdaFunctionEventInvokeConfigDestinationConfig(l []interface{}) *lambda.DestinationConfig { + if len(l) == 0 || l[0] == nil { + return nil + } + + m := l[0].(map[string]interface{}) + + destinationConfig := &lambda.DestinationConfig{} + + if v, ok := m["on_failure"].([]interface{}); ok { + destinationConfig.OnFailure = expandLambdaFunctionEventInvokeConfigDestinationConfigOnFailure(v) + } + + if v, ok := m["on_success"].([]interface{}); ok { + destinationConfig.OnSuccess = expandLambdaFunctionEventInvokeConfigDestinationConfigOnSuccess(v) + } + + return destinationConfig +} + +func expandLambdaFunctionEventInvokeConfigDestinationConfigOnFailure(l []interface{}) *lambda.OnFailure { + if len(l) == 0 || l[0] == nil { + return nil + } + + m := l[0].(map[string]interface{}) + + onFailure := &lambda.OnFailure{} + + if v, ok := m["destination"].(string); ok { + onFailure.Destination = aws.String(v) + } + + return onFailure +} + +func expandLambdaFunctionEventInvokeConfigDestinationConfigOnSuccess(l []interface{}) *lambda.OnSuccess { + if len(l) == 0 || l[0] == nil { + return nil + } + + m := l[0].(map[string]interface{}) + + onSuccess := &lambda.OnSuccess{} + + if v, ok := m["destination"].(string); ok { + onSuccess.Destination = aws.String(v) + } + + return onSuccess +} + +func flattenLambdaFunctionEventInvokeConfigDestinationConfig(destinationConfig *lambda.DestinationConfig) []interface{} { + // The API will respond with empty OnFailure and OnSuccess destinations when unconfigured: + // "DestinationConfig":{"OnFailure":{"Destination":null},"OnSuccess":{"Destination":null}} + // Return no destination configuration to prevent Terraform state difference + + if destinationConfig == nil { + return []interface{}{} + } + + if destinationConfig.OnFailure == nil && destinationConfig.OnSuccess == nil { + return []interface{}{} + } + + if (destinationConfig.OnFailure != nil && destinationConfig.OnFailure.Destination == nil) && (destinationConfig.OnSuccess != nil && destinationConfig.OnSuccess.Destination == nil) { + return []interface{}{} + } + + m := map[string]interface{}{ + "on_failure": flattenLambdaFunctionEventInvokeConfigDestinationConfigOnFailure(destinationConfig.OnFailure), + "on_success": flattenLambdaFunctionEventInvokeConfigDestinationConfigOnSuccess(destinationConfig.OnSuccess), + } + + return []interface{}{m} +} + +func flattenLambdaFunctionEventInvokeConfigDestinationConfigOnFailure(onFailure *lambda.OnFailure) []interface{} { + // The API will respond with empty OnFailure destination when unconfigured: + // "DestinationConfig":{"OnFailure":{"Destination":null},"OnSuccess":{"Destination":null}} + // Return no on failure configuration to prevent Terraform state difference + + if onFailure == nil || onFailure.Destination == nil { + return []interface{}{} + } + + m := map[string]interface{}{ + "destination": aws.StringValue(onFailure.Destination), + } + + return []interface{}{m} +} + +func flattenLambdaFunctionEventInvokeConfigDestinationConfigOnSuccess(onSuccess *lambda.OnSuccess) []interface{} { + // The API will respond with empty OnSuccess destination when unconfigured: + // "DestinationConfig":{"OnFailure":{"Destination":null},"OnSuccess":{"Destination":null}} + // Return no on success configuration to prevent Terraform state difference + + if onSuccess == nil || onSuccess.Destination == nil { + return []interface{}{} + } + + m := map[string]interface{}{ + "destination": aws.StringValue(onSuccess.Destination), + } + + return []interface{}{m} +} diff --git a/aws/resource_aws_lambda_function_event_invoke_config_test.go b/aws/resource_aws_lambda_function_event_invoke_config_test.go new file mode 100644 index 00000000000..58c7130ae70 --- /dev/null +++ b/aws/resource_aws_lambda_function_event_invoke_config_test.go @@ -0,0 +1,733 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/lambda" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func TestAccAWSLambdaFunctionEventInvokeConfig_basic(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + lambdaFunctionResourceName := "aws_lambda_function.test" + resourceName := "aws_lambda_function_event_invoke_config.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLambdaFunctionEventInvokeConfigFunctionName(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "destination_config.#", "0"), + resource.TestCheckResourceAttrPair(resourceName, "function_name", lambdaFunctionResourceName, "function_name"), + resource.TestCheckResourceAttr(resourceName, "maximum_event_age_in_seconds", "0"), + resource.TestCheckResourceAttr(resourceName, "maximum_retry_attempts", "2"), + resource.TestCheckResourceAttr(resourceName, "qualifier", ""), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSLambdaFunctionEventInvokeConfig_disappears_LambdaFunction(t *testing.T) { + var function lambda.GetFunctionOutput + rName := acctest.RandomWithPrefix("tf-acc-test") + lambdaFunctionResourceName := "aws_lambda_function.test" + resourceName := "aws_lambda_function_event_invoke_config.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLambdaFunctionEventInvokeConfigFunctionName(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionExists(lambdaFunctionResourceName, rName, &function), + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + testAccCheckAwsLambdaFunctionDisappears(&function), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAWSLambdaFunctionEventInvokeConfig_disappears_LambdaFunctionEventInvokeConfig(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_lambda_function_event_invoke_config.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLambdaFunctionEventInvokeConfigFunctionName(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + testAccCheckAwsLambdaFunctionEventInvokeConfigDisappears(resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_OnFailure_Destination(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_lambda_function_event_invoke_config.test" + sqsQueueResourceName := "aws_sqs_queue.test" + snsTopicResourceName := "aws_sns_topic.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLambdaFunctionEventInvokeConfigDestinationConfigOnFailureDestinationSqsQueue(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "destination_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "destination_config.0.on_failure.#", "1"), + resource.TestCheckResourceAttrPair(resourceName, "destination_config.0.on_failure.0.destination", sqsQueueResourceName, "arn"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSLambdaFunctionEventInvokeConfigDestinationConfigOnFailureDestinationSnsTopic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "destination_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "destination_config.0.on_failure.#", "1"), + resource.TestCheckResourceAttrPair(resourceName, "destination_config.0.on_failure.0.destination", snsTopicResourceName, "arn"), + ), + }, + }, + }) +} + +func TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_OnSuccess_Destination(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_lambda_function_event_invoke_config.test" + sqsQueueResourceName := "aws_sqs_queue.test" + snsTopicResourceName := "aws_sns_topic.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLambdaFunctionEventInvokeConfigDestinationConfigOnSuccessDestinationSqsQueue(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "destination_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "destination_config.0.on_success.#", "1"), + resource.TestCheckResourceAttrPair(resourceName, "destination_config.0.on_success.0.destination", sqsQueueResourceName, "arn"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSLambdaFunctionEventInvokeConfigDestinationConfigOnSuccessDestinationSnsTopic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "destination_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "destination_config.0.on_success.#", "1"), + resource.TestCheckResourceAttrPair(resourceName, "destination_config.0.on_success.0.destination", snsTopicResourceName, "arn"), + ), + }, + }, + }) +} + +func TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_Remove(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_lambda_function_event_invoke_config.test" + sqsQueueResourceName := "aws_sqs_queue.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLambdaFunctionEventInvokeConfigDestinationConfigOnFailureDestinationSqsQueue(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "destination_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "destination_config.0.on_failure.#", "1"), + resource.TestCheckResourceAttrPair(resourceName, "destination_config.0.on_failure.0.destination", sqsQueueResourceName, "arn"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSLambdaFunctionEventInvokeConfigQualifierFunctionVersion(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "destination_config.#", "0"), + ), + }, + }, + }) +} + +func TestAccAWSLambdaFunctionEventInvokeConfig_DestinationConfig_Swap(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_lambda_function_event_invoke_config.test" + sqsQueueResourceName := "aws_sqs_queue.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLambdaFunctionEventInvokeConfigDestinationConfigOnFailureDestinationSqsQueue(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "destination_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "destination_config.0.on_failure.#", "1"), + resource.TestCheckResourceAttrPair(resourceName, "destination_config.0.on_failure.0.destination", sqsQueueResourceName, "arn"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSLambdaFunctionEventInvokeConfigDestinationConfigOnSuccessDestinationSqsQueue(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "destination_config.#", "1"), + resource.TestCheckResourceAttr(resourceName, "destination_config.0.on_success.#", "1"), + resource.TestCheckResourceAttrPair(resourceName, "destination_config.0.on_success.0.destination", sqsQueueResourceName, "arn"), + ), + }, + }, + }) +} + +func TestAccAWSLambdaFunctionEventInvokeConfig_FunctionName_Arn(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + lambdaFunctionResourceName := "aws_lambda_function.test" + resourceName := "aws_lambda_function_event_invoke_config.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLambdaFunctionEventInvokeConfigFunctionNameArn(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttrPair(resourceName, "function_name", lambdaFunctionResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "qualifier", ""), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSLambdaFunctionEventInvokeConfig_MaximumEventAgeInSeconds(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_lambda_function_event_invoke_config.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLambdaFunctionEventInvokeConfigMaximumEventAgeInSeconds(rName, 100), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "maximum_event_age_in_seconds", "100"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSLambdaFunctionEventInvokeConfigMaximumEventAgeInSeconds(rName, 200), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "maximum_event_age_in_seconds", "200"), + ), + }, + }, + }) +} + +func TestAccAWSLambdaFunctionEventInvokeConfig_MaximumRetryAttempts(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_lambda_function_event_invoke_config.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLambdaFunctionEventInvokeConfigMaximumRetryAttempts(rName, 0), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "maximum_retry_attempts", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSLambdaFunctionEventInvokeConfigMaximumRetryAttempts(rName, 1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "maximum_retry_attempts", "1"), + ), + }, + { + Config: testAccAWSLambdaFunctionEventInvokeConfigMaximumRetryAttempts(rName, 0), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "maximum_retry_attempts", "0"), + ), + }, + }, + }) +} + +func TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_AliasName(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + lambdaAliasResourceName := "aws_lambda_alias.test" + resourceName := "aws_lambda_function_event_invoke_config.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLambdaFunctionEventInvokeConfigQualifierAliasName(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttrPair(resourceName, "qualifier", lambdaAliasResourceName, "name"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_FunctionVersion(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + lambdaFunctionResourceName := "aws_lambda_function.test" + resourceName := "aws_lambda_function_event_invoke_config.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLambdaFunctionEventInvokeConfigQualifierFunctionVersion(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttrPair(resourceName, "function_name", lambdaFunctionResourceName, "function_name"), + resource.TestCheckResourceAttrPair(resourceName, "qualifier", lambdaFunctionResourceName, "version"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSLambdaFunctionEventInvokeConfig_Qualifier_Latest(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_lambda_function_event_invoke_config.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckLambdaFunctionEventInvokeConfigDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLambdaFunctionEventInvokeConfigQualifierLatest(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "qualifier", "$LATEST"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckLambdaFunctionEventInvokeConfigDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).lambdaconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_lambda_function_event_invoke_config" { + continue + } + + functionName, qualifier, err := resourceAwsLambdaFunctionEventInvokeConfigParseId(rs.Primary.ID) + + if err != nil { + return err + } + + input := &lambda.GetFunctionEventInvokeConfigInput{ + FunctionName: aws.String(functionName), + } + + if qualifier != "" { + input.Qualifier = aws.String(qualifier) + } + + output, err := conn.GetFunctionEventInvokeConfig(input) + + if isAWSErr(err, lambda.ErrCodeResourceNotFoundException, "") { + continue + } + + if err != nil { + return err + } + + if output != nil { + return fmt.Errorf("Lambda Function Event Invoke Config (%s) still exists", rs.Primary.ID) + } + } + + return nil + +} + +func testAccCheckAwsLambdaFunctionEventInvokeConfigDisappears(resourceName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Resource not found: %s", resourceName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("Resource (%s) ID not set", resourceName) + } + + conn := testAccProvider.Meta().(*AWSClient).lambdaconn + + functionName, qualifier, err := resourceAwsLambdaFunctionEventInvokeConfigParseId(rs.Primary.ID) + + if err != nil { + return err + } + + input := &lambda.DeleteFunctionEventInvokeConfigInput{ + FunctionName: aws.String(functionName), + } + + if qualifier != "" { + input.Qualifier = aws.String(qualifier) + } + + _, err = conn.DeleteFunctionEventInvokeConfig(input) + + return err + } +} + +func testAccCheckAwsLambdaFunctionEventInvokeConfigExists(resourceName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Resource not found: %s", resourceName) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("Resource (%s) ID not set", resourceName) + } + + conn := testAccProvider.Meta().(*AWSClient).lambdaconn + + functionName, qualifier, err := resourceAwsLambdaFunctionEventInvokeConfigParseId(rs.Primary.ID) + + if err != nil { + return err + } + + input := &lambda.GetFunctionEventInvokeConfigInput{ + FunctionName: aws.String(functionName), + } + + if qualifier != "" { + input.Qualifier = aws.String(qualifier) + } + + _, err = conn.GetFunctionEventInvokeConfig(input) + + if err != nil { + return err + } + + return nil + } +} + +func testAccAWSLambdaFunctionEventInvokeConfigBase(rName string) string { + return fmt.Sprintf(` +data "aws_partition" "current" {} + +resource "aws_iam_role" "test" { + name = %[1]q + + assume_role_policy = < 0 { @@ -993,7 +1030,7 @@ func getTagSpecifications(t []*ec2.LaunchTemplateTagSpecification) []interface{} for _, v := range t { s = append(s, map[string]interface{}{ "resource_type": aws.StringValue(v.ResourceType), - "tags": tagsToMap(v.Tags), + "tags": keyvaluetags.Ec2KeyValueTags(v.Tags).IgnoreAws().Map(), }) } return s @@ -1074,6 +1111,14 @@ func buildLaunchTemplateData(d *schema.ResourceData) (*ec2.RequestLaunchTemplate } } + if v, ok := d.GetOk("cpu_options"); ok { + co := v.([]interface{}) + + if len(co) > 0 { + opts.CpuOptions = readCpuOptionsFromConfig(co[0].(map[string]interface{})) + } + } + if v, ok := d.GetOk("credit_specification"); ok && (strings.HasPrefix(instanceType, "t2") || strings.HasPrefix(instanceType, "t3")) { cs := v.([]interface{}) @@ -1149,7 +1194,10 @@ func buildLaunchTemplateData(d *schema.ResourceData) (*ec2.RequestLaunchTemplate continue } niData := ni.(map[string]interface{}) - networkInterface := readNetworkInterfacesFromConfig(niData) + networkInterface, err := readNetworkInterfacesFromConfig(niData) + if err != nil { + return nil, err + } networkInterfaces = append(networkInterfaces, networkInterface) } opts.NetworkInterfaces = networkInterfaces @@ -1172,10 +1220,9 @@ func buildLaunchTemplateData(d *schema.ResourceData) (*ec2.RequestLaunchTemplate continue } tsData := ts.(map[string]interface{}) - tags := tagsFromMap(tsData["tags"].(map[string]interface{})) tagSpecification := &ec2.LaunchTemplateTagSpecificationRequest{ ResourceType: aws.String(tsData["resource_type"].(string)), - Tags: tags, + Tags: keyvaluetags.New(tsData["tags"].(map[string]interface{})).IgnoreAws().Ec2Tags(), } tagSpecifications = append(tagSpecifications, tagSpecification) } @@ -1257,7 +1304,7 @@ func readEbsBlockDeviceFromConfig(ebs map[string]interface{}) (*ec2.LaunchTempla return ebsDevice, nil } -func readNetworkInterfacesFromConfig(ni map[string]interface{}) *ec2.LaunchTemplateInstanceNetworkInterfaceSpecificationRequest { +func readNetworkInterfacesFromConfig(ni map[string]interface{}) (*ec2.LaunchTemplateInstanceNetworkInterfaceSpecificationRequest, error) { var ipv4Addresses []*ec2.PrivateIpAddressSpecification var ipv6Addresses []*ec2.InstanceIpv6AddressRequest var privateIpAddress string @@ -1277,8 +1324,14 @@ func readNetworkInterfacesFromConfig(ni map[string]interface{}) *ec2.LaunchTempl if v, ok := ni["network_interface_id"].(string); ok && v != "" { networkInterface.NetworkInterfaceId = aws.String(v) - } else if v, ok := ni["associate_public_ip_address"]; ok { - networkInterface.AssociatePublicIpAddress = aws.Bool(v.(bool)) + } + + if v, ok := ni["associate_public_ip_address"]; ok && v.(string) != "" { + vBool, err := strconv.ParseBool(v.(string)) + if err != nil { + return nil, fmt.Errorf("error converting associate_public_ip_address %q from string to boolean: %s", v.(string), err) + } + networkInterface.AssociatePublicIpAddress = aws.Bool(vBool) } if v, ok := ni["private_ip_address"].(string); ok && v != "" { @@ -1321,7 +1374,7 @@ func readNetworkInterfacesFromConfig(ni map[string]interface{}) *ec2.LaunchTempl networkInterface.PrivateIpAddresses = ipv4Addresses } - return networkInterface + return networkInterface, nil } func readIamInstanceProfileFromConfig(iip map[string]interface{}) *ec2.LaunchTemplateIamInstanceProfileSpecificationRequest { @@ -1366,6 +1419,20 @@ func readCapacityReservationTargetFromConfig(crt map[string]interface{}) *ec2.Ca return capacityReservationTarget } +func readCpuOptionsFromConfig(co map[string]interface{}) *ec2.LaunchTemplateCpuOptionsRequest { + cpuOptions := &ec2.LaunchTemplateCpuOptionsRequest{} + + if v, ok := co["core_count"].(int); ok && v != 0 { + cpuOptions.CoreCount = aws.Int64(int64(v)) + } + + if v, ok := co["threads_per_core"].(int); ok && v != 0 { + cpuOptions.ThreadsPerCore = aws.Int64(int64(v)) + } + + return cpuOptions +} + func readCreditSpecificationFromConfig(cs map[string]interface{}) *ec2.CreditSpecificationRequest { creditSpecification := &ec2.CreditSpecificationRequest{} diff --git a/aws/resource_aws_launch_template_test.go b/aws/resource_aws_launch_template_test.go index 3a173959479..668b529dbad 100644 --- a/aws/resource_aws_launch_template_test.go +++ b/aws/resource_aws_launch_template_test.go @@ -8,56 +8,74 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/aws/aws-sdk-go/service/ec2" + "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSLaunchTemplate_importBasic(t *testing.T) { - resName := "aws_launch_template.foo" - rInt := acctest.RandInt() - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSLaunchTemplateConfig_basic(rInt), - }, - { - ResourceName: resName, - ImportState: true, - ImportStateVerify: true, - }, +func init() { + resource.AddTestSweepers("aws_launch_template", &resource.Sweeper{ + Name: "aws_launch_template", + Dependencies: []string{ + "aws_autoscaling_group", + "aws_batch_compute_environment", }, + F: testSweepLaunchTemplates, }) } -func TestAccAWSLaunchTemplate_importData(t *testing.T) { - resName := "aws_launch_template.foo" - rInt := acctest.RandInt() +func testSweepLaunchTemplates(region string) error { + client, err := sharedClientForRegion(region) - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSLaunchTemplateConfig_data(rInt), - }, - { - ResourceName: resName, - ImportState: true, - ImportStateVerify: true, - }, - }, + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + + conn := client.(*AWSClient).ec2conn + input := &ec2.DescribeLaunchTemplatesInput{} + var sweeperErrs *multierror.Error + + err = conn.DescribeLaunchTemplatesPages(input, func(page *ec2.DescribeLaunchTemplatesOutput, lastPage bool) bool { + for _, launchTemplate := range page.LaunchTemplates { + id := aws.StringValue(launchTemplate.LaunchTemplateId) + input := &ec2.DeleteLaunchTemplateInput{ + LaunchTemplateId: launchTemplate.LaunchTemplateId, + } + + log.Printf("[INFO] Deleting EC2 Launch Template: %s", id) + _, err := conn.DeleteLaunchTemplate(input) + + if isAWSErr(err, "InvalidLaunchTemplateId.NotFound", "") { + continue + } + + if err != nil { + sweeperErr := fmt.Errorf("error deleting EC2 Launch Template (%s): %w", id, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue + } + } + + return !lastPage }) + + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping EC2 Launch Template sweep for %s: %s", region, err) + return nil + } + + if err != nil { + return fmt.Errorf("Error describing EC2 Launch Templates: %w", err) + } + + return sweeperErrs.ErrorOrNil() } func TestAccAWSLaunchTemplate_basic(t *testing.T) { var template ec2.LaunchTemplate - resName := "aws_launch_template.foo" + resourceName := "aws_launch_template.test" rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -68,21 +86,26 @@ func TestAccAWSLaunchTemplate_basic(t *testing.T) { { Config: testAccAWSLaunchTemplateConfig_basic(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), - resource.TestCheckResourceAttr(resName, "default_version", "1"), - resource.TestCheckResourceAttr(resName, "latest_version", "1"), - resource.TestCheckResourceAttrSet(resName, "arn"), - resource.TestCheckResourceAttr(resName, "ebs_optimized", ""), - resource.TestCheckResourceAttr(resName, "elastic_inference_accelerator.#", "0"), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + resource.TestCheckResourceAttr(resourceName, "default_version", "1"), + resource.TestCheckResourceAttr(resourceName, "latest_version", "1"), + resource.TestCheckResourceAttrSet(resourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "ebs_optimized", ""), + resource.TestCheckResourceAttr(resourceName, "elastic_inference_accelerator.#", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSLaunchTemplate_disappears(t *testing.T) { var launchTemplate ec2.LaunchTemplate - resourceName := "aws_launch_template.foo" + resourceName := "aws_launch_template.test" rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -263,7 +286,7 @@ func TestAccAWSLaunchTemplate_ElasticInferenceAccelerator(t *testing.T) { func TestAccAWSLaunchTemplate_data(t *testing.T) { var template ec2.LaunchTemplate - resName := "aws_launch_template.foo" + resourceName := "aws_launch_template.test" rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -274,34 +297,39 @@ func TestAccAWSLaunchTemplate_data(t *testing.T) { { Config: testAccAWSLaunchTemplateConfig_data(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), - resource.TestCheckResourceAttr(resName, "block_device_mappings.#", "1"), - resource.TestCheckResourceAttrSet(resName, "disable_api_termination"), - resource.TestCheckResourceAttr(resName, "ebs_optimized", "false"), - resource.TestCheckResourceAttr(resName, "elastic_gpu_specifications.#", "1"), - resource.TestCheckResourceAttr(resName, "iam_instance_profile.#", "1"), - resource.TestCheckResourceAttrSet(resName, "image_id"), - resource.TestCheckResourceAttrSet(resName, "instance_initiated_shutdown_behavior"), - resource.TestCheckResourceAttr(resName, "instance_market_options.#", "1"), - resource.TestCheckResourceAttrSet(resName, "instance_type"), - resource.TestCheckResourceAttrSet(resName, "kernel_id"), - resource.TestCheckResourceAttrSet(resName, "key_name"), - resource.TestCheckResourceAttr(resName, "monitoring.#", "1"), - resource.TestCheckResourceAttr(resName, "network_interfaces.#", "1"), - resource.TestCheckResourceAttr(resName, "network_interfaces.0.security_groups.#", "1"), - resource.TestCheckResourceAttr(resName, "placement.#", "1"), - resource.TestCheckResourceAttrSet(resName, "ram_disk_id"), - resource.TestCheckResourceAttr(resName, "vpc_security_group_ids.#", "1"), - resource.TestCheckResourceAttr(resName, "tag_specifications.#", "1"), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + resource.TestCheckResourceAttr(resourceName, "block_device_mappings.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "disable_api_termination"), + resource.TestCheckResourceAttr(resourceName, "ebs_optimized", "false"), + resource.TestCheckResourceAttr(resourceName, "elastic_gpu_specifications.#", "1"), + resource.TestCheckResourceAttr(resourceName, "iam_instance_profile.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "image_id"), + resource.TestCheckResourceAttrSet(resourceName, "instance_initiated_shutdown_behavior"), + resource.TestCheckResourceAttr(resourceName, "instance_market_options.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "instance_type"), + resource.TestCheckResourceAttrSet(resourceName, "kernel_id"), + resource.TestCheckResourceAttrSet(resourceName, "key_name"), + resource.TestCheckResourceAttr(resourceName, "monitoring.#", "1"), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.#", "1"), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.0.security_groups.#", "1"), + resource.TestCheckResourceAttr(resourceName, "placement.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "ram_disk_id"), + resource.TestCheckResourceAttr(resourceName, "vpc_security_group_ids.#", "1"), + resource.TestCheckResourceAttr(resourceName, "tag_specifications.#", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSLaunchTemplate_description(t *testing.T) { var template ec2.LaunchTemplate - resName := "aws_launch_template.foo" + resourceName := "aws_launch_template.test" rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ @@ -312,15 +340,20 @@ func TestAccAWSLaunchTemplate_description(t *testing.T) { { Config: testAccAWSLaunchTemplateConfig_description(rName, "Test Description 1"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), - resource.TestCheckResourceAttr(resName, "description", "Test Description 1"), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + resource.TestCheckResourceAttr(resourceName, "description", "Test Description 1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSLaunchTemplateConfig_description(rName, "Test Description 2"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), - resource.TestCheckResourceAttr(resName, "description", "Test Description 2"), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + resource.TestCheckResourceAttr(resourceName, "description", "Test Description 2"), ), }, }, @@ -329,7 +362,7 @@ func TestAccAWSLaunchTemplate_description(t *testing.T) { func TestAccAWSLaunchTemplate_update(t *testing.T) { var template ec2.LaunchTemplate - resName := "aws_launch_template.foo" + resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -339,20 +372,26 @@ func TestAccAWSLaunchTemplate_update(t *testing.T) { { Config: testAccAWSLaunchTemplateConfig_asg_basic, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), - resource.TestCheckResourceAttr(resName, "default_version", "1"), - resource.TestCheckResourceAttr(resName, "latest_version", "1"), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + resource.TestCheckResourceAttr(resourceName, "default_version", "1"), + resource.TestCheckResourceAttr(resourceName, "latest_version", "1"), resource.TestCheckResourceAttr( "aws_autoscaling_group.bar", "launch_template.0.version", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"name_prefix"}, + }, { Config: testAccAWSLaunchTemplateConfig_asg_update, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), - resource.TestCheckResourceAttr(resName, "default_version", "1"), - resource.TestCheckResourceAttr(resName, "latest_version", "2"), - resource.TestCheckResourceAttrSet(resName, "instance_type"), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + resource.TestCheckResourceAttr(resourceName, "default_version", "1"), + resource.TestCheckResourceAttr(resourceName, "latest_version", "2"), + resource.TestCheckResourceAttrSet(resourceName, "instance_type"), resource.TestCheckResourceAttr( "aws_autoscaling_group.bar", "launch_template.0.version", "2"), ), @@ -363,7 +402,7 @@ func TestAccAWSLaunchTemplate_update(t *testing.T) { func TestAccAWSLaunchTemplate_tags(t *testing.T) { var template ec2.LaunchTemplate - resName := "aws_launch_template.foo" + resourceName := "aws_launch_template.test" rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -374,15 +413,20 @@ func TestAccAWSLaunchTemplate_tags(t *testing.T) { { Config: testAccAWSLaunchTemplateConfig_basic(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), - testAccCheckTags(&template.Tags, "foo", "bar"), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + testAccCheckTags(&template.Tags, "test", "bar"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSLaunchTemplateConfig_tagsUpdate(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), - testAccCheckTags(&template.Tags, "foo", ""), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + testAccCheckTags(&template.Tags, "test", ""), testAccCheckTags(&template.Tags, "bar", "baz"), ), }, @@ -392,7 +436,7 @@ func TestAccAWSLaunchTemplate_tags(t *testing.T) { func TestAccAWSLaunchTemplate_capacityReservation_preference(t *testing.T) { var template ec2.LaunchTemplate - resName := "aws_launch_template.foo" + resourceName := "aws_launch_template.test" rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -403,16 +447,21 @@ func TestAccAWSLaunchTemplate_capacityReservation_preference(t *testing.T) { { Config: testAccAWSLaunchTemplateConfig_capacityReservation_preference(rInt, "open"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSLaunchTemplate_capacityReservation_target(t *testing.T) { var template ec2.LaunchTemplate - resName := "aws_launch_template.foo" + resourceName := "aws_launch_template.test" rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -422,6 +471,31 @@ func TestAccAWSLaunchTemplate_capacityReservation_target(t *testing.T) { Steps: []resource.TestStep{ { Config: testAccAWSLaunchTemplateConfig_capacityReservation_target(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSLaunchTemplate_cpuOptions(t *testing.T) { + var template ec2.LaunchTemplate + resName := "aws_launch_template.foo" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLaunchTemplateConfig_cpuOptions(rName, 4, 2), Check: resource.ComposeTestCheckFunc( testAccCheckAWSLaunchTemplateExists(resName, &template), ), @@ -433,7 +507,7 @@ func TestAccAWSLaunchTemplate_capacityReservation_target(t *testing.T) { func TestAccAWSLaunchTemplate_creditSpecification_nonBurstable(t *testing.T) { var template ec2.LaunchTemplate rName := acctest.RandomWithPrefix("tf-acc-test") - resName := "aws_launch_template.foo" + resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -443,9 +517,15 @@ func TestAccAWSLaunchTemplate_creditSpecification_nonBurstable(t *testing.T) { { Config: testAccAWSLaunchTemplateConfig_creditSpecification(rName, "m1.small", "standard"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"credit_specification"}, + }, }, }) } @@ -453,7 +533,7 @@ func TestAccAWSLaunchTemplate_creditSpecification_nonBurstable(t *testing.T) { func TestAccAWSLaunchTemplate_creditSpecification_t2(t *testing.T) { var template ec2.LaunchTemplate rName := acctest.RandomWithPrefix("tf-acc-test") - resName := "aws_launch_template.foo" + resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -463,11 +543,16 @@ func TestAccAWSLaunchTemplate_creditSpecification_t2(t *testing.T) { { Config: testAccAWSLaunchTemplateConfig_creditSpecification(rName, "t2.micro", "unlimited"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "unlimited"), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "unlimited"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -475,7 +560,7 @@ func TestAccAWSLaunchTemplate_creditSpecification_t2(t *testing.T) { func TestAccAWSLaunchTemplate_creditSpecification_t3(t *testing.T) { var template ec2.LaunchTemplate rName := acctest.RandomWithPrefix("tf-acc-test") - resName := "aws_launch_template.foo" + resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -485,11 +570,16 @@ func TestAccAWSLaunchTemplate_creditSpecification_t3(t *testing.T) { { Config: testAccAWSLaunchTemplateConfig_creditSpecification(rName, "t3.micro", "unlimited"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), - resource.TestCheckResourceAttr(resName, "credit_specification.#", "1"), - resource.TestCheckResourceAttr(resName, "credit_specification.0.cpu_credits", "unlimited"), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + resource.TestCheckResourceAttr(resourceName, "credit_specification.#", "1"), + resource.TestCheckResourceAttr(resourceName, "credit_specification.0.cpu_credits", "unlimited"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -518,7 +608,7 @@ func TestAccAWSLaunchTemplate_IamInstanceProfile_EmptyConfigurationBlock(t *test func TestAccAWSLaunchTemplate_networkInterface(t *testing.T) { var template ec2.LaunchTemplate - resName := "aws_launch_template.test" + resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -528,11 +618,65 @@ func TestAccAWSLaunchTemplate_networkInterface(t *testing.T) { { Config: testAccAWSLaunchTemplateConfig_networkInterface, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), - resource.TestCheckResourceAttr(resName, "network_interfaces.#", "1"), - resource.TestCheckResourceAttrSet(resName, "network_interfaces.0.network_interface_id"), - resource.TestCheckResourceAttr(resName, "network_interfaces.0.associate_public_ip_address", "false"), - resource.TestCheckResourceAttr(resName, "network_interfaces.0.ipv4_address_count", "2"), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "network_interfaces.0.network_interface_id"), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.0.associate_public_ip_address", ""), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.0.ipv4_address_count", "2"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSLaunchTemplate_associatePublicIPAddress(t *testing.T) { + var template ec2.LaunchTemplate + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_launch_template.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLaunchTemplateDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLaunchTemplateConfig_associatePublicIpAddress(rName, "true"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "network_interfaces.0.network_interface_id"), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.0.associate_public_ip_address", "true"), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.0.ipv4_address_count", "2"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSLaunchTemplateConfig_associatePublicIpAddress(rName, "false"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "network_interfaces.0.network_interface_id"), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.0.associate_public_ip_address", "false"), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.0.ipv4_address_count", "2"), + ), + }, + { + Config: testAccAWSLaunchTemplateConfig_associatePublicIpAddress(rName, "null"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.#", "1"), + resource.TestCheckResourceAttrSet(resourceName, "network_interfaces.0.network_interface_id"), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.0.associate_public_ip_address", ""), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.0.ipv4_address_count", "2"), ), }, }, @@ -541,7 +685,7 @@ func TestAccAWSLaunchTemplate_networkInterface(t *testing.T) { func TestAccAWSLaunchTemplate_networkInterface_ipv6Addresses(t *testing.T) { var template ec2.LaunchTemplate - resName := "aws_launch_template.test" + resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -551,18 +695,23 @@ func TestAccAWSLaunchTemplate_networkInterface_ipv6Addresses(t *testing.T) { { Config: testAccAWSLaunchTemplateConfig_networkInterface_ipv6Addresses, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), - resource.TestCheckResourceAttr(resName, "network_interfaces.#", "1"), - resource.TestCheckResourceAttr(resName, "network_interfaces.0.ipv6_addresses.#", "2"), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.#", "1"), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.0.ipv6_addresses.#", "2"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSLaunchTemplate_networkInterface_ipv6AddressCount(t *testing.T) { var template ec2.LaunchTemplate - resName := "aws_launch_template.foo" + resourceName := "aws_launch_template.test" rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -573,11 +722,16 @@ func TestAccAWSLaunchTemplate_networkInterface_ipv6AddressCount(t *testing.T) { { Config: testAccAWSLaunchTemplateConfig_ipv6_count(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), - resource.TestCheckResourceAttr(resName, "network_interfaces.#", "1"), - resource.TestCheckResourceAttr(resName, "network_interfaces.0.ipv6_address_count", "1"), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.#", "1"), + resource.TestCheckResourceAttr(resourceName, "network_interfaces.0.ipv6_address_count", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -585,8 +739,8 @@ func TestAccAWSLaunchTemplate_networkInterface_ipv6AddressCount(t *testing.T) { func TestAccAWSLaunchTemplate_instanceMarketOptions(t *testing.T) { var template ec2.LaunchTemplate var group autoscaling.Group - templateName := "aws_launch_template.test" groupName := "aws_autoscaling_group.test" + resourceName := "aws_launch_template.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -596,21 +750,27 @@ func TestAccAWSLaunchTemplate_instanceMarketOptions(t *testing.T) { { Config: testAccAWSLaunchTemplateConfig_instanceMarketOptions_basic, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(templateName, &template), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), testAccCheckAWSAutoScalingGroupExists(groupName, &group), - resource.TestCheckResourceAttr(templateName, "instance_market_options.#", "1"), - resource.TestCheckResourceAttr(templateName, "instance_market_options.0.spot_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "instance_market_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "instance_market_options.0.spot_options.#", "1"), resource.TestCheckResourceAttr(groupName, "launch_template.#", "1"), resource.TestCheckResourceAttr(groupName, "launch_template.0.version", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"name_prefix", "instance_market_options"}, + }, { Config: testAccAWSLaunchTemplateConfig_instanceMarketOptions_update, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(templateName, &template), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), testAccCheckAWSAutoScalingGroupExists(groupName, &group), - resource.TestCheckResourceAttr(templateName, "instance_market_options.#", "1"), - resource.TestCheckResourceAttr(templateName, "instance_market_options.0.spot_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "instance_market_options.#", "1"), + resource.TestCheckResourceAttr(resourceName, "instance_market_options.0.spot_options.#", "1"), resource.TestCheckResourceAttr(groupName, "launch_template.#", "1"), resource.TestCheckResourceAttr(groupName, "launch_template.0.version", "2"), ), @@ -621,7 +781,7 @@ func TestAccAWSLaunchTemplate_instanceMarketOptions(t *testing.T) { func TestAccAWSLaunchTemplate_licenseSpecification(t *testing.T) { var template ec2.LaunchTemplate - resName := "aws_launch_template.example" + resourceName := "aws_launch_template.example" rInt := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ @@ -632,10 +792,15 @@ func TestAccAWSLaunchTemplate_licenseSpecification(t *testing.T) { { Config: testAccAWSLaunchTemplateConfig_licenseSpecification(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSLaunchTemplateExists(resName, &template), - resource.TestCheckResourceAttr(resName, "license_specification.#", "1"), + testAccCheckAWSLaunchTemplateExists(resourceName, &template), + resource.TestCheckResourceAttr(resourceName, "license_specification.#", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -714,11 +879,11 @@ func testAccCheckAWSLaunchTemplateDisappears(launchTemplate *ec2.LaunchTemplate) func testAccAWSLaunchTemplateConfig_basic(rInt int) string { return fmt.Sprintf(` -resource "aws_launch_template" "foo" { - name = "foo_%d" +resource "aws_launch_template" "test" { + name = "test_%d" tags = { - foo = "bar" + test = "bar" } } `, rInt) @@ -726,8 +891,8 @@ resource "aws_launch_template" "foo" { func testAccAWSLaunchTemplateConfig_ipv6_count(rInt int) string { return fmt.Sprintf(` -resource "aws_launch_template" "foo" { - name = "set_ipv6_count_foo_%d" +resource "aws_launch_template" "test" { + name = "set_ipv6_count_test_%d" network_interfaces { ipv6_address_count = 1 @@ -860,8 +1025,8 @@ resource "aws_launch_template" "test" { func testAccAWSLaunchTemplateConfig_data(rInt int) string { return fmt.Sprintf(` -resource "aws_launch_template" "foo" { - name = "foo_%d" +resource "aws_launch_template" "test" { + name = "test_%d" block_device_mappings { device_name = "test" @@ -923,8 +1088,8 @@ resource "aws_launch_template" "foo" { func testAccAWSLaunchTemplateConfig_tagsUpdate(rInt int) string { return fmt.Sprintf(` -resource "aws_launch_template" "foo" { - name = "foo_%d" +resource "aws_launch_template" "test" { + name = "test_%d" tags = { bar = "baz" @@ -935,8 +1100,8 @@ resource "aws_launch_template" "foo" { func testAccAWSLaunchTemplateConfig_capacityReservation_preference(rInt int, preference string) string { return fmt.Sprintf(` -resource "aws_launch_template" "foo" { - name = "foo_%d" +resource "aws_launch_template" "test" { + name = "test_%d" capacity_reservation_specification { capacity_reservation_preference = %q @@ -956,8 +1121,8 @@ resource "aws_ec2_capacity_reservation" "test" { instance_type = "t2.micro" } -resource "aws_launch_template" "foo" { - name = "foo_%d" +resource "aws_launch_template" "test" { + name = "test_%d" capacity_reservation_specification { capacity_reservation_target { @@ -968,9 +1133,22 @@ resource "aws_launch_template" "foo" { `, rInt) } -func testAccAWSLaunchTemplateConfig_creditSpecification(rName, instanceType, cpuCredits string) string { +func testAccAWSLaunchTemplateConfig_cpuOptions(rName string, coreCount, threadsPerCore int) string { return fmt.Sprintf(` resource "aws_launch_template" "foo" { + name = %q + + cpu_options { + core_count = %d + threads_per_core = %d + } +} +`, rName, coreCount, threadsPerCore) +} + +func testAccAWSLaunchTemplateConfig_creditSpecification(rName, instanceType, cpuCredits string) string { + return fmt.Sprintf(` +resource "aws_launch_template" "test" { instance_type = %q name = %q @@ -999,7 +1177,7 @@ resource "aws_licensemanager_license_configuration" "example" { } resource "aws_launch_template" "example" { - name = "foo_%d" + name = "test_%d" license_specification { license_configuration_arn = "${aws_licensemanager_license_configuration.example.id}" @@ -1010,7 +1188,7 @@ resource "aws_launch_template" "example" { func testAccAWSLaunchTemplateConfig_description(rName, description string) string { return fmt.Sprintf(` -resource "aws_launch_template" "foo" { +resource "aws_launch_template" "test" { name = "%s" description = "%s" } @@ -1041,6 +1219,33 @@ resource "aws_launch_template" "test" { } ` +func testAccAWSLaunchTemplateConfig_associatePublicIpAddress(rName, associatePublicIPAddress string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" +} + +resource "aws_subnet" "test" { + vpc_id = "${aws_vpc.test.id}" + cidr_block = "10.1.0.0/24" +} + +resource "aws_network_interface" "test" { + subnet_id = "${aws_subnet.test.id}" +} + +resource "aws_launch_template" "test" { + name = %[1]q + + network_interfaces { + network_interface_id = "${aws_network_interface.test.id}" + associate_public_ip_address = %[2]s + ipv4_address_count = 2 + } +} +`, rName, associatePublicIPAddress) +} + const testAccAWSLaunchTemplateConfig_networkInterface_ipv6Addresses = ` resource "aws_launch_template" "test" { name = "network-interface-ipv6-addresses-launch-template" @@ -1065,8 +1270,8 @@ data "aws_ami" "test_ami" { } } -resource "aws_launch_template" "foo" { - name_prefix = "foobar" +resource "aws_launch_template" "test" { + name_prefix = "testbar" image_id = "${data.aws_ami.test_ami.id}" instance_type = "t2.micro" } @@ -1079,8 +1284,8 @@ resource "aws_autoscaling_group" "bar" { max_size = 0 min_size = 0 launch_template { - id = "${aws_launch_template.foo.id}" - version = "${aws_launch_template.foo.latest_version}" + id = "${aws_launch_template.test.id}" + version = "${aws_launch_template.test.latest_version}" } } ` @@ -1096,8 +1301,8 @@ data "aws_ami" "test_ami" { } } -resource "aws_launch_template" "foo" { - name_prefix = "foobar" +resource "aws_launch_template" "test" { + name_prefix = "testbar" image_id = "${data.aws_ami.test_ami.id}" instance_type = "t2.nano" } @@ -1110,8 +1315,8 @@ resource "aws_autoscaling_group" "bar" { max_size = 0 min_size = 0 launch_template { - id = "${aws_launch_template.foo.id}" - version = "${aws_launch_template.foo.latest_version}" + id = "${aws_launch_template.test.id}" + version = "${aws_launch_template.test.latest_version}" } } ` diff --git a/aws/resource_aws_lb.go b/aws/resource_aws_lb.go index 326eed79168..ab1e84bf2f8 100644 --- a/aws/resource_aws_lb.go +++ b/aws/resource_aws_lb.go @@ -14,6 +14,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsLb() *schema.Resource { @@ -73,7 +75,11 @@ func resourceAwsLb() *schema.Resource { Type: schema.TypeString, ForceNew: true, Optional: true, - Default: "application", + Default: elbv2.LoadBalancerTypeEnumApplication, + ValidateFunc: validation.StringInSlice([]string{ + elbv2.LoadBalancerTypeEnumApplication, + elbv2.LoadBalancerTypeEnumNetwork, + }, false), }, "security_groups": { @@ -162,27 +168,31 @@ func resourceAwsLb() *schema.Resource { Type: schema.TypeInt, Optional: true, Default: 60, - DiffSuppressFunc: suppressIfLBType("network"), + DiffSuppressFunc: suppressIfLBType(elbv2.LoadBalancerTypeEnumNetwork), }, "enable_cross_zone_load_balancing": { Type: schema.TypeBool, Optional: true, Default: false, - DiffSuppressFunc: suppressIfLBType("application"), + DiffSuppressFunc: suppressIfLBType(elbv2.LoadBalancerTypeEnumApplication), }, "enable_http2": { Type: schema.TypeBool, Optional: true, Default: true, - DiffSuppressFunc: suppressIfLBType("network"), + DiffSuppressFunc: suppressIfLBType(elbv2.LoadBalancerTypeEnumNetwork), }, "ip_address_type": { Type: schema.TypeString, Computed: true, Optional: true, + ValidateFunc: validation.StringInSlice([]string{ + elbv2.IpAddressTypeIpv4, + elbv2.IpAddressTypeDualstack, + }, false), }, "vpc_id": { @@ -213,6 +223,7 @@ func suppressIfLBType(t string) schema.SchemaDiffSuppressFunc { func resourceAwsLbCreate(d *schema.ResourceData, meta interface{}) error { elbconn := meta.(*AWSClient).elbv2conn + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().Elbv2Tags() var name string if v, ok := d.GetOk("name"); ok { @@ -227,7 +238,10 @@ func resourceAwsLbCreate(d *schema.ResourceData, meta interface{}) error { elbOpts := &elbv2.CreateLoadBalancerInput{ Name: aws.String(name), Type: aws.String(d.Get("load_balancer_type").(string)), - Tags: tagsFromMapELBv2(d.Get("tags").(map[string]interface{})), + } + + if len(tags) > 0 { + elbOpts.Tags = tags } if scheme, ok := d.GetOk("internal"); ok && scheme.(bool) { @@ -338,9 +352,11 @@ func resourceAwsLbRead(d *schema.ResourceData, meta interface{}) error { func resourceAwsLbUpdate(d *schema.ResourceData, meta interface{}) error { elbconn := meta.(*AWSClient).elbv2conn - if !d.IsNewResource() { - if err := setElbV2Tags(elbconn, d); err != nil { - return fmt.Errorf("Error Modifying Tags on ALB: %s", err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Elbv2UpdateTags(elbconn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating ALB (%s) tags: %s", d.Id(), err) } } @@ -379,7 +395,7 @@ func resourceAwsLbUpdate(d *schema.ResourceData, meta interface{}) error { } switch d.Get("load_balancer_type").(string) { - case "application": + case elbv2.LoadBalancerTypeEnumApplication: if d.HasChange("idle_timeout") || d.IsNewResource() { attributes = append(attributes, &elbv2.LoadBalancerAttribute{ Key: aws.String("idle_timeout.timeout_seconds"), @@ -392,7 +408,7 @@ func resourceAwsLbUpdate(d *schema.ResourceData, meta interface{}) error { Value: aws.String(strconv.FormatBool(d.Get("enable_http2").(bool))), }) } - case "network": + case elbv2.LoadBalancerTypeEnumNetwork: if d.HasChange("enable_cross_zone_load_balancing") || d.IsNewResource() { attributes = append(attributes, &elbv2.LoadBalancerAttribute{ Key: aws.String("load_balancing.cross_zone.enabled"), @@ -702,20 +718,14 @@ func flattenAwsLbResource(d *schema.ResourceData, meta interface{}, lb *elbv2.Lo return fmt.Errorf("error setting subnet_mapping: %s", err) } - respTags, err := elbconn.DescribeTags(&elbv2.DescribeTagsInput{ - ResourceArns: []*string{lb.LoadBalancerArn}, - }) - if err != nil { - return fmt.Errorf("Error retrieving LB Tags: %s", err) - } + tags, err := keyvaluetags.Elbv2ListTags(elbconn, d.Id()) - var et []*elbv2.Tag - if len(respTags.TagDescriptions) > 0 { - et = respTags.TagDescriptions[0].Tags + if err != nil { + return fmt.Errorf("error listing tags for (%s): %s", d.Id(), err) } - if err := d.Set("tags", tagsToMapELBv2(et)); err != nil { - log.Printf("[WARN] Error setting tags for AWS LB (%s): %s", d.Id(), err) + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } attributesResp, err := elbconn.DescribeLoadBalancerAttributes(&elbv2.DescribeLoadBalancerAttributesInput{ @@ -782,7 +792,7 @@ func customizeDiffNLBSubnets(diff *schema.ResourceDiff, v interface{}) error { // Application Load Balancers, so the logic below is simple individual checks. // If other differences arise we'll want to refactor to check other // conditions in combinations, but for now all we handle is subnets - if lbType := diff.Get("load_balancer_type").(string); lbType != "network" { + if lbType := diff.Get("load_balancer_type").(string); lbType != elbv2.LoadBalancerTypeEnumNetwork { return nil } diff --git a/aws/resource_aws_lb_listener_rule.go b/aws/resource_aws_lb_listener_rule.go index bd570389bd9..3b7c9c8adc1 100644 --- a/aws/resource_aws_lb_listener_rule.go +++ b/aws/resource_aws_lb_listener_rule.go @@ -12,6 +12,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/elbv2" + "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" @@ -164,7 +165,7 @@ func resourceAwsLbbListenerRule() *schema.Resource { "authenticate_cognito": { Type: schema.TypeList, Optional: true, - DiffSuppressFunc: suppressIfDefaultActionTypeNot(elbv2.ActionTypeEnumAuthenticateCognito), + DiffSuppressFunc: suppressIfActionTypeNot(elbv2.ActionTypeEnumAuthenticateCognito), MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -216,7 +217,7 @@ func resourceAwsLbbListenerRule() *schema.Resource { "authenticate_oidc": { Type: schema.TypeList, Optional: true, - DiffSuppressFunc: suppressIfDefaultActionTypeNot(elbv2.ActionTypeEnumAuthenticateOidc), + DiffSuppressFunc: suppressIfActionTypeNot(elbv2.ActionTypeEnumAuthenticateOidc), MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ @@ -283,18 +284,147 @@ func resourceAwsLbbListenerRule() *schema.Resource { "condition": { Type: schema.TypeSet, Required: true, + Set: lbListenerRuleConditionSetHash, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "field": { - Type: schema.TypeString, - Optional: true, - ValidateFunc: validation.StringLenBetween(0, 64), + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice([]string{ + "host-header", + "path-pattern", + }, true), + Deprecated: "use 'host_header' or 'path_pattern' attribute instead", }, - "values": { + "host_header": { Type: schema.TypeList, MaxItems: 1, - Elem: &schema.Schema{Type: schema.TypeString}, Optional: true, + Computed: true, // Deprecated: remove Computed + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "values": { + Type: schema.TypeSet, + // Deprecated: Change Optional & Computed to Required in next major version of the provider + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(1, 128), + }, + Set: schema.HashString, + }, + }, + }, + }, + "http_header": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "http_header_name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringMatch(regexp.MustCompile("^[A-Za-z0-9!#$%&'*+-.^_`|~]{1,40}$"), ""), + }, + "values": { + Type: schema.TypeSet, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(1, 128), + }, + Required: true, + Set: schema.HashString, + }, + }, + }, + }, + "http_request_method": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "values": { + Type: schema.TypeSet, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringMatch(regexp.MustCompile(`^[A-Za-z-_]{1,40}$`), ""), + }, + Required: true, + Set: schema.HashString, + }, + }, + }, + }, + "path_pattern": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Computed: true, // Deprecated: remove Computed + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "values": { + Type: schema.TypeSet, + // Deprecated: Change Optional & Computed to Required in next major version of the provider + Optional: true, + Computed: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(1, 128), + }, + Set: schema.HashString, + }, + }, + }, + }, + "query_string": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "key": { + Type: schema.TypeString, + Optional: true, + }, + "value": { + Type: schema.TypeString, + Required: true, + }, + }, + }, + Set: lbListenerRuleConditionQueryStringHash, + }, + "source_ip": { + Type: schema.TypeList, + MaxItems: 1, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "values": { + Type: schema.TypeSet, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validateCIDRNetworkAddress, + }, + Required: true, + Set: schema.HashString, + }, + }, + }, + }, + "values": { + Type: schema.TypeList, + MaxItems: 1, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringLenBetween(1, 128), + }, + Optional: true, + Computed: true, + Deprecated: "use 'host_header' or 'path_pattern' attribute instead", }, }, }, @@ -303,6 +433,92 @@ func resourceAwsLbbListenerRule() *schema.Resource { } } +/* DEPRECATED Backwards compatibility: This primarily exists to set a hash that handles the values to host_header or path_pattern migration. +Can probably be removed on the next major version of the provider. +*/ +func lbListenerRuleConditionSetHash(v interface{}) int { + if v == nil { + return 0 + } + + var field string + var buf strings.Builder + + m := v.(map[string]interface{}) + + if hostHeader, ok := m["host_header"].([]interface{}); ok && len(hostHeader) > 0 { + if hostHeader[0] != nil { + field = "host-header" + values := hostHeader[0].(map[string]interface{})["values"].(*schema.Set) + for _, l := range values.List() { + fmt.Fprint(&buf, l, "-") + } + } + } else if m["field"].(string) == "host-header" { + // Backwards compatibility + field = "host-header" + for _, l := range m["values"].([]interface{}) { + fmt.Fprint(&buf, l, "-") + } + } + + if httpHeader, ok := m["http_header"].([]interface{}); ok && len(httpHeader) > 0 && httpHeader[0] != nil { + field = "http-header" + httpHeaderMap := httpHeader[0].(map[string]interface{}) + fmt.Fprint(&buf, httpHeaderMap["http_header_name"].(string), ":") + httpHeaderValues := httpHeaderMap["values"].(*schema.Set) + for _, l := range httpHeaderValues.List() { + fmt.Fprint(&buf, l, "-") + } + } + + if httpRequestMethod, ok := m["http_request_method"].([]interface{}); ok && len(httpRequestMethod) > 0 && httpRequestMethod[0] != nil { + field = "http-request-method" + values := httpRequestMethod[0].(map[string]interface{})["values"].(*schema.Set) + for _, l := range values.List() { + fmt.Fprint(&buf, l, "-") + } + } + + if pathPattern, ok := m["path_pattern"].([]interface{}); ok && len(pathPattern) > 0 { + if pathPattern[0] != nil { + field = "path-pattern" + values := pathPattern[0].(map[string]interface{})["values"].(*schema.Set) + for _, l := range values.List() { + fmt.Fprint(&buf, l, "-") + } + } + } else if m["field"].(string) == "path-pattern" { + // Backwards compatibility + field = "path-pattern" + for _, l := range m["values"].([]interface{}) { + fmt.Fprint(&buf, l, "-") + } + } + + if queryString, ok := m["query_string"].(*schema.Set); ok && queryString.Len() > 0 { + field = "query-string" + for _, l := range queryString.List() { + fmt.Fprint(&buf, lbListenerRuleConditionQueryStringHash(l), "-") + } + } + + if sourceIp, ok := m["source_ip"].([]interface{}); ok && len(sourceIp) > 0 && sourceIp[0] != nil { + field = "source-ip" + values := sourceIp[0].(map[string]interface{})["values"].(*schema.Set) + for _, l := range values.List() { + fmt.Fprint(&buf, l, "-") + } + } + + return hashcode.String(fmt.Sprintf("%s-%s", field, buf.String())) +} + +func lbListenerRuleConditionQueryStringHash(v interface{}) int { + m := v.(map[string]interface{}) + return hashcode.String(fmt.Sprintf("%s-%s", m["key"], m["value"])) +} + func suppressIfActionTypeNot(t string) schema.SchemaDiffSuppressFunc { return func(k, old, new string, d *schema.ResourceData) bool { take := 2 @@ -452,18 +668,10 @@ func resourceAwsLbListenerRuleCreate(d *schema.ResourceData, meta interface{}) e params.Actions[i] = action } - conditions := d.Get("condition").(*schema.Set).List() - 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)) - } + var err error + params.Conditions, err = lbListenerRuleConditions(d.Get("condition").(*schema.Set).List()) + if err != nil { + return err } var resp *elbv2.CreateRuleOutput @@ -655,15 +863,64 @@ func resourceAwsLbListenerRuleRead(d *schema.ResourceData, meta interface{}) err conditions := make([]interface{}, len(rule.Conditions)) for i, condition := range rule.Conditions { conditionMap := make(map[string]interface{}) + + // Deprecated: remove in next major version of provider conditionMap["field"] = aws.StringValue(condition.Field) - conditionValues := make([]string, len(condition.Values)) - for k, value := range condition.Values { - conditionValues[k] = aws.StringValue(value) + conditionMap["values"] = aws.StringValueSlice(condition.Values) + + switch conditionMap["field"] { + case "host-header": + conditionMap["host_header"] = []interface{}{ + map[string]interface{}{ + "values": flattenStringSet(condition.HostHeaderConfig.Values), + }, + } + + case "http-header": + conditionMap["http_header"] = []interface{}{ + map[string]interface{}{ + "http_header_name": aws.StringValue(condition.HttpHeaderConfig.HttpHeaderName), + "values": flattenStringSet(condition.HttpHeaderConfig.Values), + }, + } + + case "http-request-method": + conditionMap["http_request_method"] = []interface{}{ + map[string]interface{}{ + "values": flattenStringSet(condition.HttpRequestMethodConfig.Values), + }, + } + + case "path-pattern": + conditionMap["path_pattern"] = []interface{}{ + map[string]interface{}{ + "values": flattenStringSet(condition.PathPatternConfig.Values), + }, + } + + case "query-string": + values := make([]interface{}, len(condition.QueryStringConfig.Values)) + for k, value := range condition.QueryStringConfig.Values { + values[k] = map[string]interface{}{ + "key": aws.StringValue(value.Key), + "value": aws.StringValue(value.Value), + } + } + conditionMap["query_string"] = schema.NewSet(lbListenerRuleConditionQueryStringHash, values) + + case "source-ip": + conditionMap["source_ip"] = []interface{}{ + map[string]interface{}{ + "values": flattenStringSet(condition.SourceIpConfig.Values), + }, + } } - conditionMap["values"] = conditionValues + conditions[i] = conditionMap } - d.Set("condition", conditions) + if err := d.Set("condition", conditions); err != nil { + return fmt.Errorf("error setting condition: %s", err) + } return nil } @@ -827,18 +1084,10 @@ func resourceAwsLbListenerRuleUpdate(d *schema.ResourceData, meta interface{}) e } if d.HasChange("condition") { - conditions := d.Get("condition").(*schema.Set).List() - 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)) - } + var err error + params.Conditions, err = lbListenerRuleConditions(d.Get("condition").(*schema.Set).List()) + if err != nil { + return err } requestUpdate = true d.SetPartial("condition") @@ -931,3 +1180,127 @@ func highestListenerRulePriority(conn *elbv2.ELBV2, arn string) (priority int64, return } + +// lbListenerRuleConditions converts data source generated by Terraform into +// an elbv2.RuleCondition object suitable for submitting to AWS API. +func lbListenerRuleConditions(conditions []interface{}) ([]*elbv2.RuleCondition, error) { + elbConditions := make([]*elbv2.RuleCondition, len(conditions)) + for i, condition := range conditions { + elbConditions[i] = &elbv2.RuleCondition{} + conditionMap := condition.(map[string]interface{}) + var field string + var attrs int + + if hostHeader, ok := conditionMap["host_header"].([]interface{}); ok && len(hostHeader) > 0 { + field = "host-header" + attrs += 1 + values := hostHeader[0].(map[string]interface{})["values"].(*schema.Set) + + elbConditions[i].HostHeaderConfig = &elbv2.HostHeaderConditionConfig{ + Values: expandStringSet(values), + } + } + + if httpHeader, ok := conditionMap["http_header"].([]interface{}); ok && len(httpHeader) > 0 { + field = "http-header" + attrs += 1 + httpHeaderMap := httpHeader[0].(map[string]interface{}) + values := httpHeaderMap["values"].(*schema.Set) + + elbConditions[i].HttpHeaderConfig = &elbv2.HttpHeaderConditionConfig{ + HttpHeaderName: aws.String(httpHeaderMap["http_header_name"].(string)), + Values: expandStringSet(values), + } + } + + if httpRequestMethod, ok := conditionMap["http_request_method"].([]interface{}); ok && len(httpRequestMethod) > 0 { + field = "http-request-method" + attrs += 1 + values := httpRequestMethod[0].(map[string]interface{})["values"].(*schema.Set) + + elbConditions[i].HttpRequestMethodConfig = &elbv2.HttpRequestMethodConditionConfig{ + Values: expandStringSet(values), + } + } + + if pathPattern, ok := conditionMap["path_pattern"].([]interface{}); ok && len(pathPattern) > 0 { + field = "path-pattern" + attrs += 1 + values := pathPattern[0].(map[string]interface{})["values"].(*schema.Set) + + elbConditions[i].PathPatternConfig = &elbv2.PathPatternConditionConfig{ + Values: expandStringSet(values), + } + } + + if queryString, ok := conditionMap["query_string"].(*schema.Set); ok && queryString.Len() > 0 { + field = "query-string" + attrs += 1 + values := queryString.List() + + elbConditions[i].QueryStringConfig = &elbv2.QueryStringConditionConfig{ + Values: make([]*elbv2.QueryStringKeyValuePair, len(values)), + } + for j, p := range values { + valuePair := p.(map[string]interface{}) + elbValuePair := &elbv2.QueryStringKeyValuePair{ + Value: aws.String(valuePair["value"].(string)), + } + if valuePair["key"].(string) != "" { + elbValuePair.Key = aws.String(valuePair["key"].(string)) + } + elbConditions[i].QueryStringConfig.Values[j] = elbValuePair + } + } + + if sourceIp, ok := conditionMap["source_ip"].([]interface{}); ok && len(sourceIp) > 0 { + field = "source-ip" + attrs += 1 + values := sourceIp[0].(map[string]interface{})["values"].(*schema.Set) + + elbConditions[i].SourceIpConfig = &elbv2.SourceIpConditionConfig{ + Values: expandStringSet(values), + } + } + + // Deprecated backwards compatibility + // This code is also hit during an update when the condition has not been modified. Issues: GH-11232 and GH-11362 + if cmField, ok := conditionMap["field"].(string); ok && (cmField == "host-header" || cmField == "path-pattern") { + // When the condition is not being updated Terraform feeds in the existing state which has host header and + // path pattern set in both locations with identical values. + if field == cmField { + values := schema.NewSet(schema.HashString, conditionMap["values"].([]interface{})) + var values2 *schema.Set + if cmField == "host-header" { + values2 = conditionMap["host_header"].([]interface{})[0].(map[string]interface{})["values"].(*schema.Set) + } else { + values2 = conditionMap["path_pattern"].([]interface{})[0].(map[string]interface{})["values"].(*schema.Set) + } + if !values2.Equal(values) { + attrs += 1 + } + } else { + field = cmField + attrs += 1 + values := conditionMap["values"].([]interface{}) + if len(values) == 0 { + return nil, errors.New("Both field and values must be set in a condition block") + } + elbConditions[i].Values = expandStringList(values) + } + } + + // FIXME Rework this and use ConflictsWith when it finally works with collections: + // https://github.com/hashicorp/terraform/issues/13016 + // Still need to ensure that one of the condition attributes is set. + if attrs == 0 { + return nil, errors.New("One of host_header, http_header, http_request_method, path_pattern, query_string or source_ip must be set in a condition block") + } else if attrs > 1 { + // Deprecated: remove `field` from message + return nil, errors.New("Only one of field, host_header, http_header, http_request_method, path_pattern, query_string or source_ip can be set in a condition block") + } + + elbConditions[i].Field = aws.String(field) + } + return elbConditions, nil +} diff --git a/aws/resource_aws_lb_listener_rule_test.go b/aws/resource_aws_lb_listener_rule_test.go index 9cb9e084b88..f0d5dc0e52b 100644 --- a/aws/resource_aws_lb_listener_rule_test.go +++ b/aws/resource_aws_lb_listener_rule_test.go @@ -78,10 +78,18 @@ func TestAccAWSLBListenerRule_basic(t *testing.T) { resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "action.0.target_group_arn"), resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.redirect.#", "0"), resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.fixed_response.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.authenticate_cognito.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.authenticate_oidc.#", "0"), resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "1"), - resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1366281676.field", "path-pattern"), - resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1366281676.values.#", "1"), - resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "condition.1366281676.values.0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.447032695.field", "path-pattern"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.447032695.host_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.447032695.http_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.447032695.http_request_method.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.447032695.path_pattern.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.447032695.query_string.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.447032695.source_ip.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.447032695.values.#", "1"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "condition.447032695.values.0"), ), }, }, @@ -112,10 +120,18 @@ func TestAccAWSLBListenerRuleBackwardsCompatibility(t *testing.T) { resource.TestCheckResourceAttrSet("aws_alb_listener_rule.static", "action.0.target_group_arn"), resource.TestCheckResourceAttr("aws_alb_listener_rule.static", "action.0.redirect.#", "0"), resource.TestCheckResourceAttr("aws_alb_listener_rule.static", "action.0.fixed_response.#", "0"), + resource.TestCheckResourceAttr("aws_alb_listener_rule.static", "action.0.authenticate_cognito.#", "0"), + resource.TestCheckResourceAttr("aws_alb_listener_rule.static", "action.0.authenticate_oidc.#", "0"), resource.TestCheckResourceAttr("aws_alb_listener_rule.static", "condition.#", "1"), - resource.TestCheckResourceAttr("aws_alb_listener_rule.static", "condition.1366281676.field", "path-pattern"), - resource.TestCheckResourceAttr("aws_alb_listener_rule.static", "condition.1366281676.values.#", "1"), - resource.TestCheckResourceAttrSet("aws_alb_listener_rule.static", "condition.1366281676.values.0"), + resource.TestCheckResourceAttr("aws_alb_listener_rule.static", "condition.447032695.field", "path-pattern"), + resource.TestCheckResourceAttr("aws_alb_listener_rule.static", "condition.447032695.host_header.#", "0"), + resource.TestCheckResourceAttr("aws_alb_listener_rule.static", "condition.447032695.http_header.#", "0"), + resource.TestCheckResourceAttr("aws_alb_listener_rule.static", "condition.447032695.http_request_method.#", "0"), + resource.TestCheckResourceAttr("aws_alb_listener_rule.static", "condition.447032695.path_pattern.#", "1"), + resource.TestCheckResourceAttr("aws_alb_listener_rule.static", "condition.447032695.query_string.#", "0"), + resource.TestCheckResourceAttr("aws_alb_listener_rule.static", "condition.447032695.source_ip.#", "0"), + resource.TestCheckResourceAttr("aws_alb_listener_rule.static", "condition.447032695.values.#", "1"), + resource.TestCheckResourceAttrSet("aws_alb_listener_rule.static", "condition.447032695.values.0"), ), }, }, @@ -151,10 +167,9 @@ func TestAccAWSLBListenerRule_redirect(t *testing.T) { resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.redirect.0.query", "#{query}"), resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.redirect.0.status_code", "HTTP_301"), resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.fixed_response.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.authenticate_cognito.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.authenticate_oidc.#", "0"), resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "1"), - resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1366281676.field", "path-pattern"), - resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1366281676.values.#", "1"), - resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "condition.1366281676.values.0"), ), }, }, @@ -172,7 +187,7 @@ func TestAccAWSLBListenerRule_fixedResponse(t *testing.T) { CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSLBListenerRuleConfig_fixedResponse(lbName), + Config: testAccAWSLBListenerRuleConfig_fixedResponse(lbName, "Fixed response content"), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), @@ -187,10 +202,38 @@ func TestAccAWSLBListenerRule_fixedResponse(t *testing.T) { resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.fixed_response.0.content_type", "text/plain"), resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.fixed_response.0.message_body", "Fixed response content"), resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.fixed_response.0.status_code", "200"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.authenticate_cognito.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.authenticate_oidc.#", "0"), resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "1"), - resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1366281676.field", "path-pattern"), - resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1366281676.values.#", "1"), - resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "condition.1366281676.values.0"), + ), + }, + }, + }) +} + +// Updating Action breaks Condition change logic GH-11323 and GH-11362 +func TestAccAWSLBListenerRule_updateFixedResponse(t *testing.T) { + var rule elbv2.Rule + lbName := fmt.Sprintf("testrule-basic-%s", acctest.RandStringFromCharSet(13, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: "aws_lb_listener_rule.static", + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLBListenerRuleConfig_fixedResponse(lbName, "Fixed Response 1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &rule), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.fixed_response.0.message_body", "Fixed Response 1"), + ), + }, + { + Config: testAccAWSLBListenerRuleConfig_fixedResponse(lbName, "Fixed Response 2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &rule), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.0.fixed_response.0.message_body", "Fixed Response 2"), ), }, }, @@ -376,9 +419,6 @@ func TestAccAWSLBListenerRule_cognito(t *testing.T) { resource.TestCheckResourceAttr("aws_lb_listener_rule.cognito", "action.1.type", "forward"), resource.TestCheckResourceAttrSet("aws_lb_listener_rule.cognito", "action.1.target_group_arn"), resource.TestCheckResourceAttr("aws_lb_listener_rule.cognito", "condition.#", "1"), - resource.TestCheckResourceAttr("aws_lb_listener_rule.cognito", "condition.1366281676.field", "path-pattern"), - resource.TestCheckResourceAttr("aws_lb_listener_rule.cognito", "condition.1366281676.values.#", "1"), - resource.TestCheckResourceAttrSet("aws_lb_listener_rule.cognito", "condition.1366281676.values.0"), ), }, }, @@ -419,9 +459,6 @@ func TestAccAWSLBListenerRule_oidc(t *testing.T) { resource.TestCheckResourceAttr("aws_lb_listener_rule.oidc", "action.1.type", "forward"), resource.TestCheckResourceAttrSet("aws_lb_listener_rule.oidc", "action.1.target_group_arn"), resource.TestCheckResourceAttr("aws_lb_listener_rule.oidc", "condition.#", "1"), - resource.TestCheckResourceAttr("aws_lb_listener_rule.oidc", "condition.1366281676.field", "path-pattern"), - resource.TestCheckResourceAttr("aws_lb_listener_rule.oidc", "condition.1366281676.values.#", "1"), - resource.TestCheckResourceAttrSet("aws_lb_listener_rule.oidc", "condition.1366281676.values.0"), ), }, }, @@ -475,7 +512,651 @@ func TestAccAWSLBListenerRule_Action_Order_Recreates(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "action.1.order", "2"), testAccCheckAWSLBListenerRuleActionOrderDisappears(&rule, 1), ), - ExpectNonEmptyPlan: true, + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAWSLBListenerRule_conditionAttributesCount(t *testing.T) { + err_zero := regexp.MustCompile("One of host_header, http_header, http_request_method, path_pattern, query_string or source_ip must be set in a condition block") + err_many := regexp.MustCompile("Only one of field, host_header, http_header, http_request_method, path_pattern, query_string or source_ip can be set in a condition block") + err_deprecated := regexp.MustCompile("Both field and values must be set in a condition block") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLBListenerRuleConfig_conditionAttributesCount_empty(), + ExpectError: err_zero, + }, + { + Config: testAccAWSLBListenerRuleConfig_conditionAttributesCount_field(), + ExpectError: err_deprecated, + }, + { + Config: testAccAWSLBListenerRuleConfig_conditionAttributesCount_values(), + ExpectError: err_zero, + }, + { + Config: testAccAWSLBListenerRuleConfig_conditionAttributesCount_http_header(), + ExpectError: err_many, + }, + { + Config: testAccAWSLBListenerRuleConfig_conditionAttributesCount_http_request_method(), + ExpectError: err_many, + }, + { + Config: testAccAWSLBListenerRuleConfig_conditionAttributesCount_path_pattern(), + ExpectError: err_many, + }, + { + Config: testAccAWSLBListenerRuleConfig_conditionAttributesCount_query_string(), + ExpectError: err_many, + }, + { + Config: testAccAWSLBListenerRuleConfig_conditionAttributesCount_source_ip(), + ExpectError: err_many, + }, + { + Config: testAccAWSLBListenerRuleConfig_conditionAttributesCount_classic(), + ExpectError: err_many, + }, + }, + }) +} + +func TestAccAWSLBListenerRule_conditionHostHeader(t *testing.T) { + var conf elbv2.Rule + lbName := fmt.Sprintf("testrule-hostHeader-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: "aws_lb_listener_rule.static", + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLBListenerRuleConfig_conditionHostHeader(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "priority", "100"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1089289132.field", "host-header"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1089289132.host_header.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1089289132.host_header.0.values.#", "2"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1089289132.host_header.0.values.3069857465", "example.com"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1089289132.host_header.0.values.785793723", "www.example.com"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1089289132.http_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1089289132.http_request_method.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1089289132.path_pattern.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1089289132.query_string.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1089289132.source_ip.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1089289132.values.#", "2"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1089289132.values.0", "example.com"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1089289132.values.1", "www.example.com"), + ), + }, + }, + }) +} + +func TestAccAWSLBListenerRule_conditionHostHeader_deprecated(t *testing.T) { + var conf elbv2.Rule + lbName := fmt.Sprintf("testrule-hostHeader-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: "aws_lb_listener_rule.static", + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLBListenerRuleConfig_conditionHostHeader_deprecated(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "priority", "100"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.field", "host-header"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.host_header.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.host_header.0.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.host_header.0.values.3069857465", "example.com"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.http_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.http_request_method.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.path_pattern.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.query_string.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.source_ip.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.values.0", "example.com"), + ), + }, + }, + }) +} + +func TestAccAWSLBListenerRule_conditionHttpHeader(t *testing.T) { + var conf elbv2.Rule + lbName := fmt.Sprintf("testrule-httpHeader-%s", acctest.RandStringFromCharSet(12, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: "aws_lb_listener_rule.static", + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLBListenerRuleConfig_conditionHttpHeader(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "priority", "100"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "2"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.168627567.field", "http-header"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.168627567.host_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.168627567.http_header.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.168627567.http_header.0.http_header_name", "X-Forwarded-For"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.168627567.http_header.0.values.#", "2"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.168627567.http_header.0.values.2895841407", "10.0.0.*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.168627567.http_header.0.values.35666611", "192.168.1.*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.168627567.http_request_method.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.168627567.path_pattern.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.168627567.query_string.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.168627567.source_ip.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.168627567.values.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4090220723.field", "http-header"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4090220723.host_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4090220723.http_header.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4090220723.http_header.0.http_header_name", "Zz9~|_^.-+*'&%$#!0aA"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4090220723.http_header.0.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4090220723.http_header.0.values.1801271041", "RFC7230 Validity"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4090220723.http_request_method.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4090220723.path_pattern.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4090220723.query_string.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4090220723.source_ip.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4090220723.values.#", "0"), + ), + }, + }, + }) +} + +func TestAccAWSLBListenerRule_conditionHttpHeader_invalid(t *testing.T) { + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLBListenerRuleConfig_conditionHttpHeader_invalid(), + ExpectError: regexp.MustCompile(`expected value of condition.0.http_header.0.http_header_name to match regular expression`), + }, + }, + }) +} + +func TestAccAWSLBListenerRule_conditionHttpRequestMethod(t *testing.T) { + var conf elbv2.Rule + lbName := fmt.Sprintf("testrule-httpRequest-%s", acctest.RandStringFromCharSet(11, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: "aws_lb_listener_rule.static", + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLBListenerRuleConfig_conditionHttpRequestMethod(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "priority", "100"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2223521492.field", "http-request-method"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2223521492.host_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2223521492.http_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2223521492.http_request_method.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2223521492.http_request_method.0.values.#", "2"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2223521492.http_request_method.0.values.1805413626", "GET"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2223521492.http_request_method.0.values.1814004025", "POST"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2223521492.path_pattern.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2223521492.query_string.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2223521492.source_ip.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2223521492.values.#", "0"), + ), + }, + }, + }) +} + +func TestAccAWSLBListenerRule_conditionPathPattern(t *testing.T) { + var conf elbv2.Rule + lbName := fmt.Sprintf("testrule-pathPattern-%s", acctest.RandStringFromCharSet(11, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: "aws_lb_listener_rule.static", + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLBListenerRuleConfig_conditionPathPattern(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "priority", "100"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.field", "path-pattern"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.host_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.http_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.http_request_method.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.path_pattern.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.path_pattern.0.values.#", "2"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.path_pattern.0.values.1764929539", "/cgi-bin/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.path_pattern.0.values.1973895062", "/public/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.query_string.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.source_ip.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.values.#", "2"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.values.0", "/cgi-bin/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.values.1", "/public/*"), + ), + }, + }, + }) +} + +func TestAccAWSLBListenerRule_conditionPathPattern_deprecated(t *testing.T) { + var conf elbv2.Rule + lbName := fmt.Sprintf("testrule-pathPattern-%s", acctest.RandStringFromCharSet(11, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: "aws_lb_listener_rule.static", + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLBListenerRuleConfig_conditionPathPattern_deprecated(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "priority", "100"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.field", "path-pattern"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.host_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.http_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.http_request_method.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.path_pattern.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.path_pattern.0.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.path_pattern.0.values.1973895062", "/public/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.query_string.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.source_ip.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.values.0", "/public/*"), + ), + }, + }, + }) +} + +func TestAccAWSLBListenerRule_conditionUpdatePathPattern_deprecated(t *testing.T) { + var conf elbv2.Rule + lbName := fmt.Sprintf("testrule-pathPattern-%s", acctest.RandStringFromCharSet(11, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: "aws_lb_listener_rule.static", + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLBListenerRuleConfig_conditionPathPattern_deprecated(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.field", "path-pattern"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.path_pattern.0.values.1973895062", "/public/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.values.0", "/public/*"), + ), + }, + { + Config: testAccAWSLBListenerRuleConfig_conditionPathPattern_deprecatedUpdated(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3300407761.path_pattern.0.values.1764929539", "/cgi-bin/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3300407761.values.0", "/cgi-bin/*"), + ), + }, + { + Config: testAccAWSLBListenerRuleConfig_conditionPathPattern_migrated(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3300407761.path_pattern.0.values.1764929539", "/cgi-bin/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3300407761.values.0", "/cgi-bin/*"), + ), + }, + { + Config: testAccAWSLBListenerRuleConfig_conditionPathPattern(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.path_pattern.0.values.1764929539", "/cgi-bin/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.path_pattern.0.values.1973895062", "/public/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.values.0", "/cgi-bin/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2177156802.values.1", "/public/*"), + ), + }, + }, + }) +} + +func TestAccAWSLBListenerRule_conditionQueryString(t *testing.T) { + var conf elbv2.Rule + lbName := fmt.Sprintf("testrule-queryString-%s", acctest.RandStringFromCharSet(11, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: "aws_lb_listener_rule.static", + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLBListenerRuleConfig_conditionQueryString(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "priority", "100"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "2"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1697057359.field", "query-string"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1697057359.host_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1697057359.http_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1697057359.http_request_method.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1697057359.path_pattern.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1697057359.query_string.#", "2"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1697057359.query_string.167408634.key", ""), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1697057359.query_string.167408634.value", "surprise"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1697057359.query_string.4042884147.key", ""), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1697057359.query_string.4042884147.value", "blank"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1697057359.source_ip.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.1697057359.values.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.863121889.field", "query-string"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.863121889.host_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.863121889.http_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.863121889.http_request_method.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.863121889.path_pattern.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.863121889.query_string.#", "2"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.863121889.query_string.1123504603.key", "foo"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.863121889.query_string.1123504603.value", "baz"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.863121889.query_string.1278007785.key", "foo"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.863121889.query_string.1278007785.value", "bar"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.863121889.source_ip.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.863121889.values.#", "0"), + ), + }, + }, + }) +} + +func TestAccAWSLBListenerRule_conditionSourceIp(t *testing.T) { + var conf elbv2.Rule + lbName := fmt.Sprintf("testrule-sourceIp-%s", acctest.RandStringFromCharSet(14, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: "aws_lb_listener_rule.static", + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLBListenerRuleConfig_conditionSourceIp(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "priority", "100"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3009583077.field", "source-ip"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3009583077.host_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3009583077.http_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3009583077.http_request_method.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3009583077.path_pattern.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3009583077.query_string.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3009583077.source_ip.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3009583077.source_ip.0.values.#", "2"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3009583077.source_ip.0.values.1567875353", "dead:cafe::/64"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3009583077.source_ip.0.values.3901788224", "192.168.0.0/16"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3009583077.values.#", "0"), + ), + }, + }, + }) +} + +func TestAccAWSLBListenerRule_conditionUpdateMixed(t *testing.T) { + var conf elbv2.Rule + lbName := fmt.Sprintf("testrule-mixed-%s", acctest.RandStringFromCharSet(17, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: "aws_lb_listener_rule.static", + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLBListenerRuleConfig_conditionMixed(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "2"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.field", "path-pattern"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.path_pattern.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.path_pattern.0.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.path_pattern.0.values.1973895062", "/public/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.values.0", "/public/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2986919393.field", "source-ip"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2986919393.source_ip.0.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2986919393.source_ip.0.values.3901788224", "192.168.0.0/16"), + ), + }, + { + Config: testAccAWSLBListenerRuleConfig_conditionMixed_updated(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "2"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.field", "path-pattern"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.path_pattern.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.path_pattern.0.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.path_pattern.0.values.1973895062", "/public/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.values.0", "/public/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2685063104.field", "source-ip"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2685063104.source_ip.0.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2685063104.source_ip.0.values.1567875353", "dead:cafe::/64"), + ), + }, + { + Config: testAccAWSLBListenerRuleConfig_conditionMixed_updated2(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "2"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3300407761.field", "path-pattern"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3300407761.path_pattern.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3300407761.path_pattern.0.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3300407761.path_pattern.0.values.1764929539", "/cgi-bin/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.3300407761.values.0", "/cgi-bin/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2685063104.field", "source-ip"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2685063104.source_ip.0.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2685063104.source_ip.0.values.1567875353", "dead:cafe::/64"), + ), + }, + }, + }) +} + +func TestAccAWSLBListenerRule_conditionMultiple(t *testing.T) { + var conf elbv2.Rule + lbName := fmt.Sprintf("testrule-condMulti-%s", acctest.RandStringFromCharSet(13, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: "aws_lb_listener_rule.static", + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLBListenerRuleConfig_conditionMultiple(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "priority", "100"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "5"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.139999317.field", "http-header"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.139999317.host_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.139999317.http_header.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.139999317.http_header.0.http_header_name", "X-Forwarded-For"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.139999317.http_header.0.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.139999317.http_header.0.values.35666611", "192.168.1.*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.139999317.http_request_method.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.139999317.path_pattern.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.139999317.query_string.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.139999317.source_ip.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.139999317.values.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2986919393.field", "source-ip"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2986919393.host_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2986919393.http_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2986919393.http_request_method.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2986919393.path_pattern.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2986919393.query_string.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2986919393.source_ip.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2986919393.source_ip.0.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2986919393.source_ip.0.values.3901788224", "192.168.0.0/16"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2986919393.values.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4038921246.field", "http-request-method"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4038921246.host_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4038921246.http_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4038921246.http_request_method.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4038921246.http_request_method.0.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4038921246.http_request_method.0.values.1805413626", "GET"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4038921246.path_pattern.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4038921246.query_string.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4038921246.source_ip.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4038921246.values.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.field", "path-pattern"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.host_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.http_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.http_request_method.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.path_pattern.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.path_pattern.0.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.path_pattern.0.values.1973895062", "/public/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.query_string.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.source_ip.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.values.0", "/public/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.field", "host-header"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.host_header.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.host_header.0.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.host_header.0.values.3069857465", "example.com"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.http_header.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.http_request_method.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.path_pattern.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.query_string.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.source_ip.#", "0"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.values.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.values.0", "example.com"), + ), + }, + }, + }) +} + +func TestAccAWSLBListenerRule_conditionUpdateMultiple(t *testing.T) { + var conf elbv2.Rule + lbName := fmt.Sprintf("testrule-condMulti-%s", acctest.RandStringFromCharSet(13, acctest.CharSetAlphaNum)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: "aws_lb_listener_rule.static", + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBListenerRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSLBListenerRuleConfig_conditionMultiple(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "5"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.139999317.field", "http-header"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.139999317.http_header.0.http_header_name", "X-Forwarded-For"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.139999317.http_header.0.values.35666611", "192.168.1.*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2986919393.field", "source-ip"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2986919393.source_ip.0.values.3901788224", "192.168.0.0/16"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4038921246.field", "http-request-method"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.4038921246.http_request_method.0.values.1805413626", "GET"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.field", "path-pattern"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.path_pattern.0.values.1973895062", "/public/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.837782343.values.0", "/public/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.field", "host-header"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.host_header.0.values.3069857465", "example.com"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.887624213.values.0", "example.com"), + ), + }, + { + Config: testAccAWSLBListenerRuleConfig_conditionMultiple_updated(lbName), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSLBListenerRuleExists("aws_lb_listener_rule.static", &conf), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "arn"), + resource.TestCheckResourceAttrSet("aws_lb_listener_rule.static", "listener_arn"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "action.#", "1"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.#", "5"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.451778491.field", "http-header"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.451778491.http_header.0.http_header_name", "X-Forwarded-For"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.451778491.http_header.0.values.6718698", "192.168.2.*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2188908858.field", "source-ip"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.2188908858.source_ip.0.values.766747311", "192.168.0.0/24"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.736971867.field", "http-request-method"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.736971867.http_request_method.0.values.1814004025", "POST"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.941005625.field", "path-pattern"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.941005625.path_pattern.0.values.188114058", "/public/2/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.941005625.values.0", "/public/2/*"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.923495315.field", "host-header"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.923495315.host_header.0.values.854267206", "foobar.com"), + resource.TestCheckResourceAttr("aws_lb_listener_rule.static", "condition.923495315.values.0", "foobar.com"), + ), }, }, }) @@ -1024,7 +1705,7 @@ resource "aws_security_group" "alb_test" { `, lbName) } -func testAccAWSLBListenerRuleConfig_fixedResponse(lbName string) string { +func testAccAWSLBListenerRuleConfig_fixedResponse(lbName, response string) string { return fmt.Sprintf(` resource "aws_lb_listener_rule" "static" { listener_arn = "${aws_lb_listener.front_end.arn}" @@ -1035,7 +1716,7 @@ resource "aws_lb_listener_rule" "static" { fixed_response { content_type = "text/plain" - message_body = "Fixed response content" + message_body = "%s" status_code = "200" } } @@ -1126,7 +1807,7 @@ resource "aws_security_group" "alb_test" { Name = "TestAccAWSALB_fixedresponse" } } -`, lbName) +`, response, lbName) } func testAccAWSLBListenerRuleConfig_updateRulePriority(lbName, targetGroupName string) string { @@ -2037,3 +2718,484 @@ resource "aws_security_group" "test" { } `, rName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key)) } + +func testAccAWSLBListenerRuleConfig_condition_error(condition string) string { + return fmt.Sprintf(` +resource "aws_lb_listener_rule" "error" { + listener_arn = "arn:aws:elasticloadbalancing:us-west-2:111111111111:listener/app/example/1234567890abcdef/1234567890abcdef" + priority = 100 + + action { + type = "fixed-response" + + fixed_response { + content_type = "text/plain" + message_body = "Static" + status_code = 200 + } + } + + %s +} +`, condition) +} + +func testAccAWSLBListenerRuleConfig_conditionAttributesCount_empty() string { + return testAccAWSLBListenerRuleConfig_condition_error("condition {}") +} + +func testAccAWSLBListenerRuleConfig_conditionAttributesCount_field() string { + return testAccAWSLBListenerRuleConfig_condition_error(`condition { field = "host-header" }`) +} + +func testAccAWSLBListenerRuleConfig_conditionAttributesCount_values() string { + return testAccAWSLBListenerRuleConfig_condition_error(`condition { values = ["example.com"] }`) +} + +func testAccAWSLBListenerRuleConfig_conditionAttributesCount_http_header() string { + return testAccAWSLBListenerRuleConfig_condition_error(` +condition { + host_header { + values = ["example.com"] + } + http_header { + http_header_name = "X-Clacks-Overhead" + values = ["GNU Terry Pratchett"] + } +}`) +} + +func testAccAWSLBListenerRuleConfig_conditionAttributesCount_http_request_method() string { + return testAccAWSLBListenerRuleConfig_condition_error(` +condition { + host_header { + values = ["example.com"] + } + http_request_method { + values = ["POST"] + } +}`) +} + +func testAccAWSLBListenerRuleConfig_conditionAttributesCount_path_pattern() string { + return testAccAWSLBListenerRuleConfig_condition_error(` +condition { + host_header { + values = ["example.com"] + } + path_pattern { + values = ["/"] + } +}`) +} + +func testAccAWSLBListenerRuleConfig_conditionAttributesCount_query_string() string { + return testAccAWSLBListenerRuleConfig_condition_error(` +condition { + host_header { + values = ["example.com"] + } + query_string { + key = "foo" + value = "bar" + } +}`) +} + +func testAccAWSLBListenerRuleConfig_conditionAttributesCount_source_ip() string { + return testAccAWSLBListenerRuleConfig_condition_error(` +condition { + host_header { + values = ["example.com"] + } + source_ip { + values = ["192.168.0.0/16"] + } +}`) +} + +func testAccAWSLBListenerRuleConfig_conditionAttributesCount_classic() string { + return testAccAWSLBListenerRuleConfig_condition_error(` +condition { + host_header { + values = ["example.com"] + } + field = "host-header" + values = ["example2.com"] +}`) +} + +func testAccAWSLBListenerRuleConfig_condition_base(condition, name, lbName string) string { + return fmt.Sprintf(` +resource "aws_lb_listener_rule" "static" { + listener_arn = "${aws_lb_listener.front_end.arn}" + priority = 100 + + action { + type = "fixed-response" + + fixed_response { + content_type = "text/plain" + message_body = "Static" + status_code = 200 + } + } + + %s +} + +resource "aws_lb_listener" "front_end" { + load_balancer_arn = "${aws_lb.alb_test.id}" + protocol = "HTTP" + port = "80" + + default_action { + type = "fixed-response" + + fixed_response { + content_type = "text/plain" + message_body = "Not Found" + status_code = 404 + } + } +} + +resource "aws_lb" "alb_test" { + name = "%s" + internal = true + security_groups = ["${aws_security_group.alb_test.id}"] + subnets = ["${aws_subnet.alb_test.*.id[0]}", "${aws_subnet.alb_test.*.id[1]}"] + + idle_timeout = 30 + enable_deletion_protection = false + + tags = { + Name = "TestAccAWSALB_condition%s" + } +} + +variable "subnets" { + default = ["10.0.1.0/24", "10.0.2.0/24"] + type = "list" +} + +data "aws_availability_zones" "available" {} + +resource "aws_vpc" "alb_test" { + cidr_block = "10.0.0.0/16" + + tags = { + Name = "TestAccAWSALB_condition%s" + } +} + +resource "aws_subnet" "alb_test" { + count = 2 + vpc_id = "${aws_vpc.alb_test.id}" + cidr_block = "${element(var.subnets, count.index)}" + map_public_ip_on_launch = true + availability_zone = "${element(data.aws_availability_zones.available.names, count.index)}" + + tags = { + Name = "TestAccAWSALB_condition%s-${count.index}" + } +} + +resource "aws_security_group" "alb_test" { + name = "allow_all_alb_test" + description = "Used for ALB Testing" + vpc_id = "${aws_vpc.alb_test.id}" + + ingress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } + + egress { + from_port = 0 + to_port = 0 + protocol = "-1" + cidr_blocks = ["0.0.0.0/0"] + } + + tags = { + Name = "TestAccAWSALB_condition%s" + } +} +`, condition, lbName, name, name, name, name) +} + +func testAccAWSLBListenerRuleConfig_conditionHostHeader(lbName string) string { + return testAccAWSLBListenerRuleConfig_condition_base(` +condition { + host_header { + values = ["example.com", "www.example.com"] + } +} +`, "HostHeader", lbName) +} + +func testAccAWSLBListenerRuleConfig_conditionHostHeader_deprecated(lbName string) string { + return testAccAWSLBListenerRuleConfig_condition_base(` +condition { + field = "host-header" + values = ["example.com"] +} +`, "HostHeaderDep", lbName) +} + +func testAccAWSLBListenerRuleConfig_conditionHttpHeader(lbName string) string { + return testAccAWSLBListenerRuleConfig_condition_base(` +condition { + http_header { + http_header_name = "X-Forwarded-For" + values = ["192.168.1.*", "10.0.0.*"] + } +} + +condition { + http_header { + http_header_name = "Zz9~|_^.-+*'&%$#!0aA" + values = ["RFC7230 Validity"] + } +} +`, "HttpHeader", lbName) +} + +func testAccAWSLBListenerRuleConfig_conditionHttpHeader_invalid() string { + return ` +resource "aws_lb_listener_rule" "static" { + listener_arn = "arn:aws:elasticloadbalancing:us-west-2:111111111111:listener/app/test/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx" + priority = 100 + + action { + type = "fixed-response" + + fixed_response { + content_type = "text/plain" + message_body = "Static" + status_code = 200 + } + } + + condition { + http_header { + http_header_name = "Invalid@" + values = ["RFC7230 Validity"] + } + } +} +` +} + +func testAccAWSLBListenerRuleConfig_conditionHttpRequestMethod(lbName string) string { + return testAccAWSLBListenerRuleConfig_condition_base(` +condition { + http_request_method { + values = ["GET", "POST"] + } +} +`, "HttpRequestMethod", lbName) +} + +func testAccAWSLBListenerRuleConfig_conditionPathPattern(lbName string) string { + return testAccAWSLBListenerRuleConfig_condition_base(` +condition { + path_pattern { + values = ["/public/*", "/cgi-bin/*"] + } +} +`, "PathPattern", lbName) +} + +func testAccAWSLBListenerRuleConfig_conditionPathPattern_deprecated(lbName string) string { + return testAccAWSLBListenerRuleConfig_condition_base(` +condition { + field = "path-pattern" + values = ["/public/*"] +} +`, "PathPattern", lbName) +} + +func testAccAWSLBListenerRuleConfig_conditionPathPattern_deprecatedUpdated(lbName string) string { + return testAccAWSLBListenerRuleConfig_condition_base(` +condition { + field = "path-pattern" + values = ["/cgi-bin/*"] +} +`, "PathPattern", lbName) +} + +func testAccAWSLBListenerRuleConfig_conditionPathPattern_migrated(lbName string) string { + return testAccAWSLBListenerRuleConfig_condition_base(` +condition { + path_pattern { + values = ["/cgi-bin/*"] + } +} +`, "PathPattern", lbName) +} + +func testAccAWSLBListenerRuleConfig_conditionQueryString(lbName string) string { + return testAccAWSLBListenerRuleConfig_condition_base(` +condition { + query_string { + value = "surprise" + } + query_string { + key = "" + value = "blank" + } +} + +condition { + query_string { + key = "foo" + value = "bar" + } + query_string { + key = "foo" + value = "baz" + } +} +`, "QueryString", lbName) +} + +func testAccAWSLBListenerRuleConfig_conditionSourceIp(lbName string) string { + return testAccAWSLBListenerRuleConfig_condition_base(` +condition { + source_ip { + values = [ + "192.168.0.0/16", + "dead:cafe::/64", + ] + } +} +`, "SourceIp", lbName) +} + +func testAccAWSLBListenerRuleConfig_conditionMixed(lbName string) string { + return testAccAWSLBListenerRuleConfig_condition_base(` +condition { + field = "path-pattern" + values = ["/public/*"] +} + +condition { + source_ip { + values = [ + "192.168.0.0/16", + ] + } +} +`, "Mixed", lbName) +} + +// Update new style condition without modifying deprecated. Issue GH-11323 +func testAccAWSLBListenerRuleConfig_conditionMixed_updated(lbName string) string { + return testAccAWSLBListenerRuleConfig_condition_base(` +condition { + field = "path-pattern" + values = ["/public/*"] +} + +condition { + source_ip { + values = [ + "dead:cafe::/64", + ] + } +} +`, "Mixed", lbName) +} + +// Then update deprecated syntax without touching new. Issue GH-11362 +func testAccAWSLBListenerRuleConfig_conditionMixed_updated2(lbName string) string { + return testAccAWSLBListenerRuleConfig_condition_base(` +condition { + field = "path-pattern" + values = ["/cgi-bin/*"] +} + +condition { + source_ip { + values = [ + "dead:cafe::/64", + ] + } +} +`, "Mixed", lbName) +} + +// Currently a maximum of 5 condition values per rule +func testAccAWSLBListenerRuleConfig_conditionMultiple(lbName string) string { + return testAccAWSLBListenerRuleConfig_condition_base(` +condition { + host_header { + values = ["example.com"] + } +} + +condition { + http_header { + http_header_name = "X-Forwarded-For" + values = ["192.168.1.*"] + } +} + +condition { + http_request_method { + values = ["GET"] + } +} + +condition { + path_pattern { + values = ["/public/*"] + } +} + +condition { + source_ip { + values = ["192.168.0.0/16"] + } +} +`, "Multiple", lbName) +} + +func testAccAWSLBListenerRuleConfig_conditionMultiple_updated(lbName string) string { + return testAccAWSLBListenerRuleConfig_condition_base(` +condition { + host_header { + values = ["foobar.com"] + } +} + +condition { + http_header { + http_header_name = "X-Forwarded-For" + values = ["192.168.2.*"] + } +} + +condition { + http_request_method { + values = ["POST"] + } +} + +condition { + path_pattern { + values = ["/public/2/*"] + } +} + +condition { + source_ip { + values = ["192.168.0.0/24"] + } +} +`, "Multiple", lbName) +} diff --git a/aws/resource_aws_lb_listener_test.go b/aws/resource_aws_lb_listener_test.go index 92a514b72cb..2bc2ca19c4d 100644 --- a/aws/resource_aws_lb_listener_test.go +++ b/aws/resource_aws_lb_listener_test.go @@ -107,17 +107,18 @@ func TestAccAWSLBListener_BackwardsCompatibility(t *testing.T) { func TestAccAWSLBListener_https(t *testing.T) { var conf elbv2.Listener - lbName := fmt.Sprintf("testlistener-https-%s", acctest.RandStringFromCharSet(13, acctest.CharSetAlphaNum)) - targetGroupName := fmt.Sprintf("testtargetgroup-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509SelfSignedCertificatePem(key, "example.com") + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, IDRefreshName: "aws_lb_listener.front_end", - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSLBListenerConfig_https(lbName, targetGroupName), + Config: testAccAWSLBListenerConfig_https(rName, key, certificate), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSLBListenerExists("aws_lb_listener.front_end", &conf), resource.TestCheckResourceAttrSet("aws_lb_listener.front_end", "load_balancer_arn"), @@ -140,16 +141,18 @@ func TestAccAWSLBListener_https(t *testing.T) { func TestAccAWSLBListener_Protocol_Tls(t *testing.T) { var listener1 elbv2.Listener + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509SelfSignedCertificatePem(key, "example.com") rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_lb_listener.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSLBListenerConfig_Protocol_Tls(rName), + Config: testAccAWSLBListenerConfig_Protocol_Tls(rName, key, certificate), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSLBListenerExists(resourceName, &listener1), resource.TestCheckResourceAttr(resourceName, "protocol", "TLS"), @@ -230,16 +233,18 @@ func TestAccAWSLBListener_fixedResponse(t *testing.T) { func TestAccAWSLBListener_cognito(t *testing.T) { var conf elbv2.Listener - rName := acctest.RandString(5) + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509SelfSignedCertificatePem(key, "example.com") + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, IDRefreshName: "aws_lb_listener.test", - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSLBListenerConfig_cognito(rName), + Config: testAccAWSLBListenerConfig_cognito(rName, key, certificate), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSLBListenerExists("aws_lb_listener.test", &conf), resource.TestCheckResourceAttrSet("aws_lb_listener.test", "load_balancer_arn"), @@ -265,16 +270,18 @@ func TestAccAWSLBListener_cognito(t *testing.T) { func TestAccAWSLBListener_oidc(t *testing.T) { var conf elbv2.Listener - rName := acctest.RandString(5) + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509SelfSignedCertificatePem(key, "example.com") + rName := acctest.RandomWithPrefix("tf-acc-test") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, IDRefreshName: "aws_lb_listener.test", - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSLBListenerConfig_oidc(rName), + Config: testAccAWSLBListenerConfig_oidc(rName, key, certificate), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSLBListenerExists("aws_lb_listener.test", &conf), resource.TestCheckResourceAttrSet("aws_lb_listener.test", "load_balancer_arn"), @@ -303,16 +310,18 @@ func TestAccAWSLBListener_oidc(t *testing.T) { func TestAccAWSLBListener_DefaultAction_Order(t *testing.T) { var listener elbv2.Listener + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509SelfSignedCertificatePem(key, "example.com") rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_lb_listener.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSLBListenerConfig_DefaultAction_Order(rName), + Config: testAccAWSLBListenerConfig_DefaultAction_Order(rName, key, certificate), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSLBListenerExists(resourceName, &listener), resource.TestCheckResourceAttr(resourceName, "default_action.#", "2"), @@ -327,16 +336,18 @@ func TestAccAWSLBListener_DefaultAction_Order(t *testing.T) { // Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/6171 func TestAccAWSLBListener_DefaultAction_Order_Recreates(t *testing.T) { var listener elbv2.Listener + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509SelfSignedCertificatePem(key, "example.com") rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_lb_listener.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProvidersWithTLS, + Providers: testAccProviders, CheckDestroy: testAccCheckAWSLBListenerDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSLBListenerConfig_DefaultAction_Order(rName), + Config: testAccAWSLBListenerConfig_DefaultAction_Order(rName, key, certificate), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSLBListenerExists(resourceName, &listener), resource.TestCheckResourceAttr(resourceName, "default_action.#", "2"), @@ -711,7 +722,7 @@ resource "aws_security_group" "alb_test" { `, lbName, targetGroupName) } -func testAccAWSLBListenerConfig_https(lbName, targetGroupName string) string { +func testAccAWSLBListenerConfig_https(rName, key, certificate string) string { return fmt.Sprintf(` resource "aws_lb_listener" "front_end" { load_balancer_arn = "${aws_lb.alb_test.id}" @@ -727,7 +738,7 @@ resource "aws_lb_listener" "front_end" { } resource "aws_lb" "alb_test" { - name = "%s" + name = "%[1]s" internal = false security_groups = ["${aws_security_group.alb_test.id}"] subnets = ["${aws_subnet.alb_test.*.id[0]}", "${aws_subnet.alb_test.*.id[1]}"] @@ -743,7 +754,7 @@ resource "aws_lb" "alb_test" { } resource "aws_lb_target_group" "test" { - name = "%s" + name = "%[1]s" port = 8080 protocol = "HTTP" vpc_id = "${aws_vpc.alb_test.id}" @@ -820,63 +831,20 @@ resource "aws_security_group" "alb_test" { } resource "aws_iam_server_certificate" "test_cert" { - name = "terraform-test-cert-%d" - certificate_body = "${tls_self_signed_cert.example.cert_pem}" - private_key = "${tls_private_key.example.private_key_pem}" + name = "%[1]s" + certificate_body = "%[2]s" + private_key = "%[3]s" } - -resource "tls_private_key" "example" { - algorithm = "RSA" +`, rName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key)) } -resource "tls_self_signed_cert" "example" { - key_algorithm = "RSA" - private_key_pem = "${tls_private_key.example.private_key_pem}" - - subject { - common_name = "example.com" - organization = "ACME Examples, Inc" - } - - validity_period_hours = 12 - - allowed_uses = [ - "key_encipherment", - "digital_signature", - "server_auth", - ] -} -`, lbName, targetGroupName, acctest.RandInt()) -} - -func testAccAWSLBListenerConfig_Protocol_Tls(rName string) string { +func testAccAWSLBListenerConfig_Protocol_Tls(rName, key, certificate string) string { return fmt.Sprintf(` data "aws_availability_zones" "available" {} -resource "tls_private_key" "test" { - algorithm = "RSA" -} - -resource "tls_self_signed_cert" "test" { - allowed_uses = [ - "key_encipherment", - "digital_signature", - "server_auth", - ] - - key_algorithm = "RSA" - private_key_pem = "${tls_private_key.test.private_key_pem}" - validity_period_hours = 12 - - subject { - common_name = "example.com" - organization = "ACME Examples, Inc" - } -} - resource "aws_acm_certificate" "test" { - certificate_body = "${tls_self_signed_cert.test.cert_pem}" - private_key = "${tls_private_key.test.private_key_pem}" + certificate_body = "%[2]s" + private_key = "%[3]s" } resource "aws_vpc" "test" { @@ -902,7 +870,7 @@ resource "aws_subnet" "test" { resource "aws_lb" "test" { internal = true load_balancer_type = "network" - name = %q + name = %[1]q subnets = ["${aws_subnet.test.*.id[0]}", "${aws_subnet.test.*.id[1]}"] tags = { @@ -911,7 +879,7 @@ resource "aws_lb" "test" { } resource "aws_lb_target_group" "test" { - name = %q + name = %[1]q port = 443 protocol = "TCP" vpc_id = "${aws_vpc.test.id}" @@ -941,7 +909,7 @@ resource "aws_lb_listener" "test" { type = "forward" } } -`, rName, rName) +`, rName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key)) } func testAccAWSLBListenerConfig_redirect(lbName string) string { @@ -1114,10 +1082,10 @@ resource "aws_security_group" "alb_test" { `, lbName) } -func testAccAWSLBListenerConfig_cognito(rName string) string { +func testAccAWSLBListenerConfig_cognito(rName, key, certificate string) string { return fmt.Sprintf(` resource "aws_lb" "test" { - name = "%s" + name = "%[1]s" internal = false security_groups = ["${aws_security_group.test.id}"] subnets = ["${aws_subnet.test.*.id[0]}", "${aws_subnet.test.*.id[1]}"] @@ -1125,7 +1093,7 @@ resource "aws_lb" "test" { } resource "aws_lb_target_group" "test" { - name = "%s" + name = "%[1]s" port = 8080 protocol = "HTTP" vpc_id = "${aws_vpc.test.id}" @@ -1166,7 +1134,7 @@ resource "aws_subnet" "test" { } resource "aws_security_group" "test" { - name = "%s" + name = "%[1]s" description = "Used for ALB Testing" vpc_id = "${aws_vpc.test.id}" @@ -1186,11 +1154,11 @@ resource "aws_security_group" "test" { } resource "aws_cognito_user_pool" "test" { - name = "%s" + name = "%[1]s" } resource "aws_cognito_user_pool_client" "test" { - name = "%s" + name = "%[1]s" user_pool_id = "${aws_cognito_user_pool.test.id}" generate_secret = true allowed_oauth_flows_user_pool_client = true @@ -1202,36 +1170,14 @@ resource "aws_cognito_user_pool_client" "test" { } resource "aws_cognito_user_pool_domain" "test" { - domain = "%s" + domain = "%[1]s" user_pool_id = "${aws_cognito_user_pool.test.id}" } resource "aws_iam_server_certificate" "test" { - name = "terraform-test-cert-%s" - certificate_body = "${tls_self_signed_cert.test.cert_pem}" - private_key = "${tls_private_key.test.private_key_pem}" -} - -resource "tls_private_key" "test" { - algorithm = "RSA" -} - -resource "tls_self_signed_cert" "test" { - key_algorithm = "RSA" - private_key_pem = "${tls_private_key.test.private_key_pem}" - - subject { - common_name = "example.com" - organization = "ACME Examples, Inc" - } - - validity_period_hours = 12 - - allowed_uses = [ - "key_encipherment", - "digital_signature", - "server_auth", - ] + name = "%[1]s" + certificate_body = "%[2]s" + private_key = "%[3]s" } resource "aws_lb_listener" "test" { @@ -1260,13 +1206,13 @@ resource "aws_lb_listener" "test" { type = "forward" } } -`, rName, rName, rName, rName, rName, rName, rName) +`, rName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key)) } -func testAccAWSLBListenerConfig_oidc(rName string) string { +func testAccAWSLBListenerConfig_oidc(rName, key, certificate string) string { return fmt.Sprintf(` resource "aws_lb" "test" { - name = "%s" + name = "%[1]s" internal = false security_groups = ["${aws_security_group.test.id}"] subnets = ["${aws_subnet.test.*.id[0]}", "${aws_subnet.test.*.id[1]}"] @@ -1274,7 +1220,7 @@ resource "aws_lb" "test" { } resource "aws_lb_target_group" "test" { - name = "%s" + name = "%[1]s" port = 8080 protocol = "HTTP" vpc_id = "${aws_vpc.test.id}" @@ -1315,7 +1261,7 @@ resource "aws_subnet" "test" { } resource "aws_security_group" "test" { - name = "%s" + name = "%[1]s" description = "Used for ALB Testing" vpc_id = "${aws_vpc.test.id}" @@ -1335,31 +1281,9 @@ resource "aws_security_group" "test" { } resource "aws_iam_server_certificate" "test" { - name = "terraform-test-cert-%s" - certificate_body = "${tls_self_signed_cert.test.cert_pem}" - private_key = "${tls_private_key.test.private_key_pem}" -} - -resource "tls_private_key" "test" { - algorithm = "RSA" -} - -resource "tls_self_signed_cert" "test" { - key_algorithm = "RSA" - private_key_pem = "${tls_private_key.test.private_key_pem}" - - subject { - common_name = "example.com" - organization = "ACME Examples, Inc" - } - - validity_period_hours = 12 - - allowed_uses = [ - "key_encipherment", - "digital_signature", - "server_auth", - ] + name = "%[1]s" + certificate_body = "%[2]s" + private_key = "%[3]s" } resource "aws_lb_listener" "test" { @@ -1391,13 +1315,13 @@ resource "aws_lb_listener" "test" { type = "forward" } } -`, rName, rName, rName, rName) +`, rName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key)) } -func testAccAWSLBListenerConfig_DefaultAction_Order(rName string) string { +func testAccAWSLBListenerConfig_DefaultAction_Order(rName, key, certificate string) string { return fmt.Sprintf(` variable "rName" { - default = %q + default = %[1]q } data "aws_availability_zones" "available" {} @@ -1435,30 +1359,9 @@ resource "aws_lb_listener" "test" { } resource "aws_iam_server_certificate" "test" { - certificate_body = "${tls_self_signed_cert.test.cert_pem}" + certificate_body = "%[2]s" name = "${var.rName}" - private_key = "${tls_private_key.test.private_key_pem}" -} - -resource "tls_private_key" "test" { - algorithm = "RSA" -} - -resource "tls_self_signed_cert" "test" { - key_algorithm = "RSA" - private_key_pem = "${tls_private_key.test.private_key_pem}" - validity_period_hours = 12 - - subject { - common_name = "example.com" - organization = "ACME Examples, Inc" - } - - allowed_uses = [ - "key_encipherment", - "digital_signature", - "server_auth", - ] + private_key = "%[3]s" } resource "aws_lb" "test" { @@ -1529,5 +1432,5 @@ resource "aws_security_group" "test" { Name = "${var.rName}" } } -`, rName) +`, rName, tlsPemEscapeNewlines(certificate), tlsPemEscapeNewlines(key)) } diff --git a/aws/resource_aws_lb_target_group.go b/aws/resource_aws_lb_target_group.go index d22a77ca8e4..b26c8e7ea5c 100644 --- a/aws/resource_aws_lb_target_group.go +++ b/aws/resource_aws_lb_target_group.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsLbTargetGroup() *schema.Resource { @@ -120,6 +121,16 @@ func resourceAwsLbTargetGroup() *schema.Resource { }, false), }, + "load_balancing_algorithm_type": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice([]string{ + "round_robin", + "least_outstanding_requests", + }, false), + }, + "stickiness": { Type: schema.TypeList, Optional: true, @@ -186,7 +197,7 @@ func resourceAwsLbTargetGroup() *schema.Resource { "protocol": { Type: schema.TypeString, Optional: true, - Default: "HTTP", + Default: elbv2.ProtocolEnumHttp, StateFunc: func(v interface{}) string { return strings.ToUpper(v.(string)) }, @@ -288,7 +299,7 @@ func resourceAwsLbTargetGroupCreate(d *schema.ResourceData, meta interface{}) er } healthCheckProtocol := healthCheck["protocol"].(string) - if healthCheckProtocol != "TCP" { + if healthCheckProtocol != elbv2.ProtocolEnumTcp { p := healthCheck["path"].(string) if p != "" { params.HealthCheckPath = aws.String(p) @@ -344,8 +355,12 @@ func resourceAwsLbTargetGroupRead(d *schema.ResourceData, meta interface{}) erro func resourceAwsLbTargetGroupUpdate(d *schema.ResourceData, meta interface{}) error { elbconn := meta.(*AWSClient).elbv2conn - if err := setElbV2Tags(elbconn, d); err != nil { - return fmt.Errorf("Error Modifying Tags on LB Target Group: %s", err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Elbv2UpdateTags(elbconn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating LB Target Group (%s) tags: %s", d.Id(), err) + } } if d.HasChange("health_check") { @@ -371,7 +386,7 @@ func resourceAwsLbTargetGroupUpdate(d *schema.ResourceData, meta interface{}) er healthCheckProtocol := healthCheck["protocol"].(string) - if healthCheckProtocol != "TCP" && !d.IsNewResource() { + if healthCheckProtocol != elbv2.ProtocolEnumTcp && !d.IsNewResource() { params.Matcher = &elbv2.Matcher{ HttpCode: aws.String(healthCheck["matcher"].(string)), } @@ -421,7 +436,7 @@ func resourceAwsLbTargetGroupUpdate(d *schema.ResourceData, meta interface{}) er // groups, so long as it's not enabled. This allows for better support for // modules, but also means we need to completely skip sending the data to the // API if it's defined on a TCP target group. - if d.HasChange("stickiness") && d.Get("protocol") != "TCP" { + if d.HasChange("stickiness") && d.Get("protocol") != elbv2.ProtocolEnumTcp { stickinessBlocks := d.Get("stickiness").([]interface{}) if len(stickinessBlocks) == 1 { stickiness := stickinessBlocks[0].(map[string]interface{}) @@ -446,6 +461,13 @@ func resourceAwsLbTargetGroupUpdate(d *schema.ResourceData, meta interface{}) er }) } } + + if d.HasChange("load_balancing_algorithm_type") { + attrs = append(attrs, &elbv2.TargetGroupAttribute{ + Key: aws.String("load_balancing.algorithm.type"), + Value: aws.String(d.Get("load_balancing_algorithm_type").(string)), + }) + } case elbv2.TargetTypeEnumLambda: if d.HasChange("lambda_multi_value_headers_enabled") { attrs = append(attrs, &elbv2.TargetGroupAttribute{ @@ -603,6 +625,9 @@ func flattenAwsLbTargetGroupResource(d *schema.ResourceData, meta interface{}, t return fmt.Errorf("Error converting slow_start.duration_seconds to int: %s", aws.StringValue(attr.Value)) } d.Set("slow_start", slowStart) + case "load_balancing.algorithm.type": + loadBalancingAlgorithm := aws.StringValue(attr.Value) + d.Set("load_balancing_algorithm_type", loadBalancingAlgorithm) } } @@ -615,28 +640,24 @@ func flattenAwsLbTargetGroupResource(d *schema.ResourceData, meta interface{}, t // This is a workaround to support module design where the module needs to // support HTTP and TCP target groups. switch { - case aws.StringValue(targetGroup.Protocol) != "TCP": + case aws.StringValue(targetGroup.Protocol) != elbv2.ProtocolEnumTcp: if err = flattenAwsLbTargetGroupStickiness(d, attrResp.Attributes); err != nil { return err } - case aws.StringValue(targetGroup.Protocol) == "TCP" && len(d.Get("stickiness").([]interface{})) < 1: + case aws.StringValue(targetGroup.Protocol) == elbv2.ProtocolEnumTcp && len(d.Get("stickiness").([]interface{})) < 1: if err = d.Set("stickiness", []interface{}{}); err != nil { return fmt.Errorf("error setting stickiness: %s", err) } } - tagsResp, err := elbconn.DescribeTags(&elbv2.DescribeTagsInput{ - ResourceArns: []*string{aws.String(d.Id())}, - }) + tags, err := keyvaluetags.Elbv2ListTags(elbconn, d.Id()) + if err != nil { - return fmt.Errorf("Error retrieving Target Group Tags: %s", err) + return fmt.Errorf("error listing tags for LB Target Group (%s): %s", d.Id(), err) } - for _, t := range tagsResp.TagDescriptions { - if aws.StringValue(t.ResourceArn) == d.Id() { - if err := d.Set("tags", tagsToMapELBv2(t.Tags)); err != nil { - return fmt.Errorf("error setting tags: %s", err) - } - } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -681,7 +702,7 @@ func flattenAwsLbTargetGroupStickiness(d *schema.ResourceData, attributes []*elb func resourceAwsLbTargetGroupCustomizeDiff(diff *schema.ResourceDiff, v interface{}) error { protocol := diff.Get("protocol").(string) - if protocol == "TCP" { + if protocol == elbv2.ProtocolEnumTcp { // TCP load balancers do not support stickiness if stickinessBlocks := diff.Get("stickiness").([]interface{}); len(stickinessBlocks) == 1 { stickiness := stickinessBlocks[0].(map[string]interface{}) @@ -697,7 +718,7 @@ func resourceAwsLbTargetGroupCustomizeDiff(diff *schema.ResourceDiff, v interfac healthCheck := healthChecks[0].(map[string]interface{}) protocol := healthCheck["protocol"].(string) - if protocol == "TCP" { + if protocol == elbv2.ProtocolEnumTcp { // Cannot set custom matcher on TCP health checks if m := healthCheck["matcher"].(string); m != "" { return fmt.Errorf("%s: health_check.matcher is not supported for target_groups with TCP protocol", diff.Id()) @@ -718,7 +739,7 @@ func resourceAwsLbTargetGroupCustomizeDiff(diff *schema.ResourceDiff, v interfac } } - if strings.Contains(protocol, "HTTP") { + if strings.Contains(protocol, elbv2.ProtocolEnumHttp) { if healthChecks := diff.Get("health_check").([]interface{}); len(healthChecks) == 1 { healthCheck := healthChecks[0].(map[string]interface{}) // HTTP(S) Target Groups cannot use TCP health checks @@ -732,7 +753,7 @@ func resourceAwsLbTargetGroupCustomizeDiff(diff *schema.ResourceDiff, v interfac return nil } - if protocol == "TCP" { + if protocol == elbv2.ProtocolEnumTcp { if diff.HasChange("health_check.0.interval") { old, new := diff.GetChange("health_check.0.interval") return fmt.Errorf("Health check interval cannot be updated from %d to %d for TCP based Target Group %s,"+ diff --git a/aws/resource_aws_lb_target_group_attachment_test.go b/aws/resource_aws_lb_target_group_attachment_test.go index 608cd8679ba..9d0bb230591 100644 --- a/aws/resource_aws_lb_target_group_attachment_test.go +++ b/aws/resource_aws_lb_target_group_attachment_test.go @@ -17,13 +17,12 @@ func TestAccAWSLBTargetGroupAttachment_basic(t *testing.T) { targetGroupName := fmt.Sprintf("test-target-group-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_lb_target_group.test", - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSLBTargetGroupAttachmentConfig_basic(targetGroupName), + Config: testAccAWSLBTargetGroupAttachmentConfigTargetIdInstance(targetGroupName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSLBTargetGroupAttachmentExists("aws_lb_target_group_attachment.test"), ), @@ -35,13 +34,12 @@ func TestAccAWSLBTargetGroupAttachment_basic(t *testing.T) { func TestAccAWSLBTargetGroupAttachment_disappears(t *testing.T) { targetGroupName := fmt.Sprintf("test-target-group-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_lb_target_group.test", - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSLBTargetGroupAttachmentConfig_basic(targetGroupName), + Config: testAccAWSLBTargetGroupAttachmentConfigTargetIdInstance(targetGroupName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSLBTargetGroupAttachmentExists("aws_lb_target_group_attachment.test"), testAccCheckAWSLBTargetGroupAttachmentDisappears("aws_lb_target_group_attachment.test"), @@ -56,10 +54,9 @@ func TestAccAWSLBTargetGroupAttachment_BackwardsCompatibility(t *testing.T) { targetGroupName := fmt.Sprintf("test-target-group-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_alb_target_group.test", - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, Steps: []resource.TestStep{ { Config: testAccAWSLBTargetGroupAttachmentConfigBackwardsCompatibility(targetGroupName), @@ -71,17 +68,16 @@ func TestAccAWSLBTargetGroupAttachment_BackwardsCompatibility(t *testing.T) { }) } -func TestAccAWSLBTargetGroupAttachment_withoutPort(t *testing.T) { +func TestAccAWSLBTargetGroupAttachment_Port(t *testing.T) { targetGroupName := fmt.Sprintf("test-target-group-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_lb_target_group.test", - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSLBTargetGroupAttachmentConfigWithoutPort(targetGroupName), + Config: testAccAWSLBTargetGroupAttachmentConfigPort(targetGroupName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSLBTargetGroupAttachmentExists("aws_lb_target_group_attachment.test"), ), @@ -94,13 +90,12 @@ func TestAccAWSLBTargetGroupAttachment_ipAddress(t *testing.T) { targetGroupName := fmt.Sprintf("test-target-group-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_lb_target_group.test", - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSLBTargetGroupAttachmentConfigWithIpAddress(targetGroupName), + Config: testAccAWSLBTargetGroupAttachmentConfigTargetIdIpAddress(targetGroupName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSLBTargetGroupAttachmentExists("aws_lb_target_group_attachment.test"), ), @@ -113,13 +108,12 @@ func TestAccAWSLBTargetGroupAttachment_lambda(t *testing.T) { targetGroupName := fmt.Sprintf("test-target-group-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_lb_target_group.test", - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSLBTargetGroupAttachmentDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSLBTargetGroupAttachmentConfigWithLambda(targetGroupName), + Config: testAccAWSLBTargetGroupAttachmentConfigTargetIdLambda(targetGroupName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSLBTargetGroupAttachmentExists("aws_lb_target_group_attachment.test"), ), @@ -243,106 +237,42 @@ func testAccCheckAWSLBTargetGroupAttachmentDestroy(s *terraform.State) error { return nil } -func testAccAWSLBTargetGroupAttachmentConfigWithoutPort(targetGroupName string) string { +func testAccAWSLBTargetGroupAttachmentConfigInstanceBase() string { return fmt.Sprintf(` -resource "aws_lb_target_group_attachment" "test" { - target_group_arn = "${aws_lb_target_group.test.arn}" - target_id = "${aws_instance.test.id}" -} - -resource "aws_instance" "test" { - ami = "ami-f701cb97" - instance_type = "t2.micro" - subnet_id = "${aws_subnet.subnet.id}" -} - -resource "aws_lb_target_group" "test" { - name = "%s" - port = 443 - protocol = "HTTPS" - vpc_id = "${aws_vpc.test.id}" - deregistration_delay = 200 - - stickiness { - type = "lb_cookie" - cookie_duration = 10000 - } - - health_check { - path = "/health" - interval = 60 - port = 8081 - protocol = "HTTP" - timeout = 3 - healthy_threshold = 3 - unhealthy_threshold = 3 - matcher = "200-299" - } +data "aws_availability_zones" "available" { + # t2.micro instance type is not available in these Availability Zones + blacklisted_zone_ids = ["usw2-az4"] + state = "available" } -resource "aws_subnet" "subnet" { - cidr_block = "10.0.1.0/24" - vpc_id = "${aws_vpc.test.id}" +data "aws_ami" "amzn-ami-minimal-hvm-ebs" { + most_recent = true + owners = ["amazon"] - tags = { - Name = "tf-acc-lb-target-group-attachment-without-port" + filter { + name = "name" + values = ["amzn-ami-minimal-hvm-*"] } -} - -resource "aws_vpc" "test" { - cidr_block = "10.0.0.0/16" - - tags = { - Name = "terraform-testacc-lb-target-group-attachment-without-port" + + filter { + name = "root-device-type" + values = ["ebs"] } } -`, targetGroupName) -} - -func testAccAWSLBTargetGroupAttachmentConfig_basic(targetGroupName string) string { - return fmt.Sprintf(` -resource "aws_lb_target_group_attachment" "test" { - target_group_arn = "${aws_lb_target_group.test.arn}" - target_id = "${aws_instance.test.id}" - port = 80 -} resource "aws_instance" "test" { - ami = "ami-f701cb97" + ami = data.aws_ami.amzn-ami-minimal-hvm-ebs.id instance_type = "t2.micro" - subnet_id = "${aws_subnet.subnet.id}" -} - -resource "aws_lb_target_group" "test" { - name = "%s" - port = 443 - protocol = "HTTPS" - vpc_id = "${aws_vpc.test.id}" - deregistration_delay = 200 - - stickiness { - type = "lb_cookie" - cookie_duration = 10000 - } - - health_check { - path = "/health" - interval = 60 - port = 8081 - protocol = "HTTP" - timeout = 3 - healthy_threshold = 3 - unhealthy_threshold = 3 - matcher = "200-299" - } + subnet_id = aws_subnet.test.id } -resource "aws_subnet" "subnet" { - cidr_block = "10.0.1.0/24" - vpc_id = "${aws_vpc.test.id}" +resource "aws_subnet" "test" { + availability_zone = data.aws_availability_zones.available.names[0] + cidr_block = "10.0.1.0/24" + vpc_id = aws_vpc.test.id tags = { - Name = "tf-acc-lb-target-group-attachment-basic" + Name = "tf-acc-test-lb-target-group-attachment" } } @@ -350,149 +280,102 @@ resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" tags = { - Name = "terraform-testacc-lb-target-group-attachment-basic" + Name = "tf-acc-test-lb-target-group-attachment" } } -`, targetGroupName) +`) } -func testAccAWSLBTargetGroupAttachmentConfigBackwardsCompatibility(targetGroupName string) string { - return fmt.Sprintf(` -resource "aws_alb_target_group_attachment" "test" { - target_group_arn = "${aws_alb_target_group.test.arn}" - target_id = "${aws_instance.test.id}" - port = 80 -} - -resource "aws_instance" "test" { - ami = "ami-f701cb97" - instance_type = "t2.micro" - subnet_id = "${aws_subnet.subnet.id}" +func testAccAWSLBTargetGroupAttachmentConfigTargetIdInstance(rName string) string { + return testAccAWSLBTargetGroupAttachmentConfigInstanceBase() + fmt.Sprintf(` +resource "aws_lb_target_group" "test" { + name = %[1]q + port = 443 + protocol = "HTTPS" + vpc_id = aws_vpc.test.id } -resource "aws_alb_target_group" "test" { - name = "%s" - port = 443 - protocol = "HTTPS" - vpc_id = "${aws_vpc.test.id}" - deregistration_delay = 200 - - stickiness { - type = "lb_cookie" - cookie_duration = 10000 - } - - health_check { - path = "/health" - interval = 60 - port = 8081 - protocol = "HTTP" - timeout = 3 - healthy_threshold = 3 - unhealthy_threshold = 3 - matcher = "200-299" - } +resource "aws_lb_target_group_attachment" "test" { + target_group_arn = aws_lb_target_group.test.arn + target_id = aws_instance.test.id } - -resource "aws_subnet" "subnet" { - cidr_block = "10.0.1.0/24" - vpc_id = "${aws_vpc.test.id}" - - tags = { - Name = "tf-acc-lb-target-group-attachment-bc" - } +`, rName) } -resource "aws_vpc" "test" { - cidr_block = "10.0.0.0/16" - - tags = { - Name = "terraform-testacc-lb-target-group-attachment-bc" - } -} -`, targetGroupName) +func testAccAWSLBTargetGroupAttachmentConfigPort(rName string) string { + return testAccAWSLBTargetGroupAttachmentConfigInstanceBase() + fmt.Sprintf(` +resource "aws_lb_target_group" "test" { + name = %[1]q + port = 443 + protocol = "HTTPS" + vpc_id = aws_vpc.test.id } -func testAccAWSLBTargetGroupAttachmentConfigWithIpAddress(targetGroupName string) string { - return fmt.Sprintf(` resource "aws_lb_target_group_attachment" "test" { - target_group_arn = "${aws_lb_target_group.test.arn}" - target_id = "${aws_instance.test.private_ip}" - availability_zone = "${aws_instance.test.availability_zone}" + target_group_arn = aws_lb_target_group.test.arn + target_id = aws_instance.test.id + port = 80 } - -resource "aws_instance" "test" { - ami = "ami-f701cb97" - instance_type = "t2.micro" - subnet_id = "${aws_subnet.subnet.id}" +`, rName) } +func testAccAWSLBTargetGroupAttachmentConfigBackwardsCompatibility(rName string) string { + return testAccAWSLBTargetGroupAttachmentConfigInstanceBase() + fmt.Sprintf(` resource "aws_lb_target_group" "test" { - name = "%s" - port = 443 - protocol = "HTTPS" - vpc_id = "${aws_vpc.test.id}" - target_type = "ip" - deregistration_delay = 200 - - stickiness { - type = "lb_cookie" - cookie_duration = 10000 - } - - health_check { - path = "/health" - interval = 60 - port = 8081 - protocol = "HTTP" - timeout = 3 - healthy_threshold = 3 - unhealthy_threshold = 3 - matcher = "200-299" - } + name = %[1]q + port = 443 + protocol = "HTTPS" + vpc_id = aws_vpc.test.id } -resource "aws_subnet" "subnet" { - cidr_block = "10.0.1.0/24" - vpc_id = "${aws_vpc.test.id}" - - tags = { - Name = "tf-acc-lb-target-group-attachment-with-ip-address" - } +resource "aws_alb_target_group_attachment" "test" { + target_group_arn = aws_lb_target_group.test.arn + target_id = aws_instance.test.id + port = 80 +} +`, rName) } -resource "aws_vpc" "test" { - cidr_block = "10.0.0.0/16" +func testAccAWSLBTargetGroupAttachmentConfigTargetIdIpAddress(rName string) string { + return testAccAWSLBTargetGroupAttachmentConfigInstanceBase() + fmt.Sprintf(` +resource "aws_lb_target_group" "test" { + name = %[1]q + port = 443 + protocol = "HTTPS" + target_type = "ip" + vpc_id = aws_vpc.test.id +} - tags = { - Name = "terraform-testacc-lb-target-group-attachment-with-ip-address" - } +resource "aws_lb_target_group_attachment" "test" { + availability_zone = aws_instance.test.availability_zone + target_group_arn = aws_lb_target_group.test.arn + target_id = aws_instance.test.private_ip } -`, targetGroupName) +`, rName) } -func testAccAWSLBTargetGroupAttachmentConfigWithLambda(targetGroupName string) string { - funcName := fmt.Sprintf("tf_acc_lambda_func_%s", acctest.RandString(8)) - +func testAccAWSLBTargetGroupAttachmentConfigTargetIdLambda(rName string) string { return fmt.Sprintf(` -resource "aws_lambda_permission" "with_lb" { - statement_id = "AllowExecutionFromlb" +data "aws_partition" "current" {} + +resource "aws_lambda_permission" "test" { action = "lambda:InvokeFunction" - function_name = "${aws_lambda_function.test.arn}" - principal = "elasticloadbalancing.amazonaws.com" - source_arn = "${aws_lb_target_group.test.arn}" - qualifier = "${aws_lambda_alias.test.name}" + function_name = aws_lambda_function.test.arn + principal = "elasticloadbalancing.${data.aws_partition.current.dns_suffix}" + qualifier = aws_lambda_alias.test.name + source_arn = aws_lb_target_group.test.arn + statement_id = "AllowExecutionFromlb" } resource "aws_lb_target_group" "test" { - name = "%s" + name = %[1]q target_type = "lambda" } resource "aws_lambda_function" "test" { filename = "test-fixtures/lambda_elb.zip" - function_name = "%s" - role = "${aws_iam_role.iam_for_lambda.arn}" + function_name = %[1]q + role = aws_iam_role.test.arn handler = "lambda_elb.lambda_handler" runtime = "python3.7" } @@ -500,11 +383,11 @@ resource "aws_lambda_function" "test" { resource "aws_lambda_alias" "test" { name = "test" description = "a sample description" - function_name = "${aws_lambda_function.test.function_name}" + function_name = aws_lambda_function.test.function_name function_version = "$LATEST" } -resource "aws_iam_role" "iam_for_lambda" { +resource "aws_iam_role" "test" { assume_role_policy = < 0 { - opts.Tags = tagsFromMapLicenseManager(v.(map[string]interface{})) + opts.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().LicensemanagerTags() } log.Printf("[DEBUG] License Manager license configuration: %s", opts) @@ -127,7 +128,7 @@ func resourceAwsLicenseManagerLicenseConfigurationRead(d *schema.ResourceData, m } d.Set("name", resp.Name) - if err := d.Set("tags", tagsToMapLicenseManager(resp.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.LicensemanagerKeyValueTags(resp.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -140,9 +141,12 @@ func resourceAwsLicenseManagerLicenseConfigurationUpdate(d *schema.ResourceData, d.Partial(true) if d.HasChange("tags") { - if err := setTagsLicenseManager(conn, d); err != nil { - return err + o, n := d.GetChange("tags") + + if err := keyvaluetags.LicensemanagerUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating License Manager License Configuration (%s) tags: %s", d.Id(), err) } + d.SetPartial("tags") } diff --git a/aws/resource_aws_lightsail_instance.go b/aws/resource_aws_lightsail_instance.go index 6972788bb57..cbdab50b97b 100644 --- a/aws/resource_aws_lightsail_instance.go +++ b/aws/resource_aws_lightsail_instance.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsLightsailInstance() *schema.Resource { @@ -135,10 +136,8 @@ func resourceAwsLightsailInstanceCreate(d *schema.ResourceData, meta interface{} req.UserData = aws.String(v.(string)) } - tags := tagsFromMapLightsail(d.Get("tags").(map[string]interface{})) - - if len(tags) != 0 { - req.Tags = tags + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + req.Tags = keyvaluetags.New(v).IgnoreAws().LightsailTags() } resp, err := conn.CreateInstances(&req) @@ -214,8 +213,8 @@ func resourceAwsLightsailInstanceRead(d *schema.ResourceData, meta interface{}) d.Set("private_ip_address", i.PrivateIpAddress) d.Set("public_ip_address", i.PublicIpAddress) - if err := d.Set("tags", tagsToMapLightsail(i.Tags)); err != nil { - return fmt.Errorf("Error setting tags: %s", err) + if err := d.Set("tags", keyvaluetags.LightsailKeyValueTags(i.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -256,10 +255,11 @@ func resourceAwsLightsailInstanceUpdate(d *schema.ResourceData, meta interface{} conn := meta.(*AWSClient).lightsailconn if d.HasChange("tags") { - if err := setTagsLightsail(conn, d); err != nil { - return err + o, n := d.GetChange("tags") + + if err := keyvaluetags.LightsailUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating Lightsail Instance (%s) tags: %s", d.Id(), err) } - d.SetPartial("tags") } return resourceAwsLightsailInstanceRead(d, meta) diff --git a/aws/resource_aws_lightsail_instance_test.go b/aws/resource_aws_lightsail_instance_test.go index 8d7a6f37104..5c4b9b687eb 100644 --- a/aws/resource_aws_lightsail_instance_test.go +++ b/aws/resource_aws_lightsail_instance_test.go @@ -3,6 +3,7 @@ package aws import ( "errors" "fmt" + "log" "regexp" "testing" "time" @@ -10,11 +11,67 @@ import ( "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/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) +func init() { + resource.AddTestSweepers("aws_lightsail_instance", &resource.Sweeper{ + Name: "aws_lightsail_instance", + F: testSweepLightsailInstances, + }) +} + +func testSweepLightsailInstances(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("Error getting client: %s", err) + } + conn := client.(*AWSClient).lightsailconn + + input := &lightsail.GetInstancesInput{} + var sweeperErrs *multierror.Error + + for { + output, err := conn.GetInstances(input) + + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping Lightsail Instance sweep for %s: %s", region, err) + return nil + } + + if err != nil { + return fmt.Errorf("Error retrieving Lightsail Instances: %s", err) + } + + for _, instance := range output.Instances { + name := aws.StringValue(instance.Name) + input := &lightsail.DeleteInstanceInput{ + InstanceName: instance.Name, + } + + log.Printf("[INFO] Deleting Lightsail Instance: %s", name) + _, err := conn.DeleteInstance(input) + + if err != nil { + sweeperErr := fmt.Errorf("error deleting Lightsail Instance (%s): %s", name, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + } + } + + if aws.StringValue(output.NextPageToken) == "" { + break + } + + input.PageToken = output.NextPageToken + } + + return sweeperErrs.ErrorOrNil() +} + func TestAccAWSLightsailInstance_basic(t *testing.T) { var conf lightsail.Instance lightsailName := fmt.Sprintf("tf-test-lightsail-%d", acctest.RandInt()) diff --git a/aws/resource_aws_lightsail_key_pair_test.go b/aws/resource_aws_lightsail_key_pair_test.go index beb220e073c..8796ba6eeab 100644 --- a/aws/resource_aws_lightsail_key_pair_test.go +++ b/aws/resource_aws_lightsail_key_pair_test.go @@ -36,7 +36,7 @@ func TestAccAWSLightsailKeyPair_basic(t *testing.T) { }) } -func TestAccAWSLightsailKeyPair_imported(t *testing.T) { +func TestAccAWSLightsailKeyPair_publicKey(t *testing.T) { var conf lightsail.KeyPair lightsailName := fmt.Sprintf("tf-test-lightsail-%d", acctest.RandInt()) diff --git a/aws/resource_aws_macie_s3_bucket_association_test.go b/aws/resource_aws_macie_s3_bucket_association_test.go index ee7a108ae13..793e5d4a3f3 100644 --- a/aws/resource_aws_macie_s3_bucket_association_test.go +++ b/aws/resource_aws_macie_s3_bucket_association_test.go @@ -160,7 +160,7 @@ func testAccPreCheckAWSMacie(t *testing.T) { func testAccAWSMacieS3BucketAssociationConfig_basic(randInt int) string { return fmt.Sprintf(` resource "aws_s3_bucket" "test" { - bucket = "tf-macie-test-bucket-%d" + bucket = "tf-test-macie-bucket-%d" } resource "aws_macie_s3_bucket_association" "test" { @@ -172,7 +172,7 @@ resource "aws_macie_s3_bucket_association" "test" { func testAccAWSMacieS3BucketAssociationConfig_basicOneTime(randInt int) string { return fmt.Sprintf(` resource "aws_s3_bucket" "test" { - bucket = "tf-macie-test-bucket-%d" + bucket = "tf-test-macie-bucket-%d" } resource "aws_macie_s3_bucket_association" "test" { @@ -188,7 +188,7 @@ resource "aws_macie_s3_bucket_association" "test" { func testAccAWSMacieS3BucketAssociationConfig_accountIdAndPrefix(randInt int) string { return fmt.Sprintf(` resource "aws_s3_bucket" "test" { - bucket = "tf-macie-test-bucket-%d" + bucket = "tf-test-macie-bucket-%d" } data "aws_caller_identity" "current" {} @@ -204,7 +204,7 @@ resource "aws_macie_s3_bucket_association" "test" { func testAccAWSMacieS3BucketAssociationConfig_accountIdAndPrefixOneTime(randInt int) string { return fmt.Sprintf(` resource "aws_s3_bucket" "test" { - bucket = "tf-macie-test-bucket-%d" + bucket = "tf-test-macie-bucket-%d" } data "aws_caller_identity" "current" {} diff --git a/aws/resource_aws_media_convert_queue.go b/aws/resource_aws_media_convert_queue.go new file mode 100644 index 00000000000..b37bb18fc85 --- /dev/null +++ b/aws/resource_aws_media_convert_queue.go @@ -0,0 +1,269 @@ +package aws + +import ( + "fmt" + "log" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/session" + "github.com/aws/aws-sdk-go/service/mediaconvert" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +func resourceAwsMediaConvertQueue() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsMediaConvertQueueCreate, + Read: resourceAwsMediaConvertQueueRead, + Update: resourceAwsMediaConvertQueueUpdate, + Delete: resourceAwsMediaConvertQueueDelete, + + 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, + }, + "description": { + Type: schema.TypeString, + Optional: true, + }, + "pricing_plan": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Default: mediaconvert.PricingPlanOnDemand, + ValidateFunc: validation.StringInSlice([]string{ + mediaconvert.PricingPlanOnDemand, + mediaconvert.PricingPlanReserved, + }, false), + }, + "reservation_plan_settings": { + Type: schema.TypeList, + Computed: true, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "commitment": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + mediaconvert.CommitmentOneYear, + }, false), + }, + "renewal_type": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.StringInSlice([]string{ + mediaconvert.RenewalTypeAutoRenew, + mediaconvert.RenewalTypeExpire, + }, false), + }, + "reserved_slots": { + Type: schema.TypeInt, + Required: true, + }, + }, + }, + }, + "status": { + Type: schema.TypeString, + Optional: true, + Default: mediaconvert.QueueStatusActive, + ValidateFunc: validation.StringInSlice([]string{ + mediaconvert.QueueStatusActive, + mediaconvert.QueueStatusPaused, + }, false), + }, + "tags": tagsSchema(), + }, + } +} + +func resourceAwsMediaConvertQueueCreate(d *schema.ResourceData, meta interface{}) error { + conn, err := getAwsMediaConvertAccountClient(meta.(*AWSClient)) + if err != nil { + return fmt.Errorf("Error getting Media Convert Account Client: %s", err) + } + + createOpts := &mediaconvert.CreateQueueInput{ + Name: aws.String(d.Get("name").(string)), + Status: aws.String(d.Get("status").(string)), + PricingPlan: aws.String(d.Get("pricing_plan").(string)), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().MediaconvertTags(), + } + + if v, ok := d.GetOk("description"); ok { + createOpts.Description = aws.String(v.(string)) + } + + if v, ok := d.Get("reservation_plan_settings").([]interface{}); ok && len(v) > 0 && v[0] != nil { + createOpts.ReservationPlanSettings = expandMediaConvertReservationPlanSettings(v[0].(map[string]interface{})) + } + + resp, err := conn.CreateQueue(createOpts) + if err != nil { + return fmt.Errorf("Error creating Media Convert Queue: %s", err) + } + + d.SetId(aws.StringValue(resp.Queue.Name)) + + return resourceAwsMediaConvertQueueRead(d, meta) +} + +func resourceAwsMediaConvertQueueRead(d *schema.ResourceData, meta interface{}) error { + conn, err := getAwsMediaConvertAccountClient(meta.(*AWSClient)) + if err != nil { + return fmt.Errorf("Error getting Media Convert Account Client: %s", err) + } + + getOpts := &mediaconvert.GetQueueInput{ + Name: aws.String(d.Id()), + } + + resp, err := conn.GetQueue(getOpts) + if isAWSErr(err, mediaconvert.ErrCodeNotFoundException, "") { + log.Printf("[WARN] Media Convert Queue (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + if err != nil { + return fmt.Errorf("Error getting Media Convert Queue: %s", err) + } + + d.Set("arn", resp.Queue.Arn) + d.Set("name", resp.Queue.Name) + d.Set("description", resp.Queue.Description) + d.Set("pricing_plan", resp.Queue.PricingPlan) + d.Set("status", resp.Queue.Status) + + if err := d.Set("reservation_plan_settings", flattenMediaConvertReservationPlan(resp.Queue.ReservationPlan)); err != nil { + return fmt.Errorf("Error setting Media Convert Queue reservation_plan_settings: %s", err) + } + + tags, err := keyvaluetags.MediaconvertListTags(conn, aws.StringValue(resp.Queue.Arn)) + + if err != nil { + return fmt.Errorf("error listing tags for Media Convert Queue (%s): %s", d.Id(), err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + return nil +} + +func resourceAwsMediaConvertQueueUpdate(d *schema.ResourceData, meta interface{}) error { + conn, err := getAwsMediaConvertAccountClient(meta.(*AWSClient)) + if err != nil { + return fmt.Errorf("Error getting Media Convert Account Client: %s", err) + } + + if d.HasChange("description") || d.HasChange("reservation_plan_settings") || d.HasChange("status") { + + updateOpts := &mediaconvert.UpdateQueueInput{ + Name: aws.String(d.Id()), + Status: aws.String(d.Get("status").(string)), + } + + if v, ok := d.GetOk("description"); ok { + updateOpts.Description = aws.String(v.(string)) + } + + if v, ok := d.GetOk("reservation_plan_settings"); ok { + reservationPlanSettings := v.([]interface{})[0].(map[string]interface{}) + updateOpts.ReservationPlanSettings = expandMediaConvertReservationPlanSettings(reservationPlanSettings) + } + + _, err = conn.UpdateQueue(updateOpts) + if isAWSErr(err, mediaconvert.ErrCodeNotFoundException, "") { + log.Printf("[WARN] Media Convert Queue (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + if err != nil { + return fmt.Errorf("Error updating Media Convert Queue: %s", err) + } + } + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.MediaconvertUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + + return resourceAwsMediaConvertQueueRead(d, meta) +} + +func resourceAwsMediaConvertQueueDelete(d *schema.ResourceData, meta interface{}) error { + conn, err := getAwsMediaConvertAccountClient(meta.(*AWSClient)) + if err != nil { + return fmt.Errorf("Error getting Media Convert Account Client: %s", err) + } + + delOpts := &mediaconvert.DeleteQueueInput{ + Name: aws.String(d.Id()), + } + + _, err = conn.DeleteQueue(delOpts) + if isAWSErr(err, mediaconvert.ErrCodeNotFoundException, "") { + return nil + } + if err != nil { + return fmt.Errorf("Error deleting Media Convert Queue: %s", err) + } + + return nil +} + +func getAwsMediaConvertAccountClient(awsClient *AWSClient) (*mediaconvert.MediaConvert, error) { + const mutexKey = `mediaconvertaccountconn` + awsMutexKV.Lock(mutexKey) + defer awsMutexKV.Unlock(mutexKey) + + if awsClient.mediaconvertaccountconn != nil { + return awsClient.mediaconvertaccountconn, nil + } + + input := &mediaconvert.DescribeEndpointsInput{ + Mode: aws.String(mediaconvert.DescribeEndpointsModeDefault), + } + + output, err := awsClient.mediaconvertconn.DescribeEndpoints(input) + + if err != nil { + return nil, fmt.Errorf("error describing MediaConvert Endpoints: %w", err) + } + + if output == nil || len(output.Endpoints) == 0 || output.Endpoints[0] == nil || output.Endpoints[0].Url == nil { + return nil, fmt.Errorf("error describing MediaConvert Endpoints: empty response or URL") + } + + endpointURL := aws.StringValue(output.Endpoints[0].Url) + + sess, err := session.NewSession(&awsClient.mediaconvertconn.Config) + + if err != nil { + return nil, fmt.Errorf("error creating AWS MediaConvert session: %w", err) + } + + conn := mediaconvert.New(sess.Copy(&aws.Config{Endpoint: aws.String(endpointURL)})) + + awsClient.mediaconvertaccountconn = conn + + return conn, nil +} diff --git a/aws/resource_aws_media_convert_queue_test.go b/aws/resource_aws_media_convert_queue_test.go new file mode 100644 index 00000000000..d033c935dab --- /dev/null +++ b/aws/resource_aws_media_convert_queue_test.go @@ -0,0 +1,355 @@ +package aws + +import ( + "fmt" + "regexp" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/mediaconvert" + + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func TestAccAWSMediaConvertQueue_basic(t *testing.T) { + var queue mediaconvert.Queue + resourceName := "aws_media_convert_queue.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaConvert(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsMediaConvertQueueDestroy, + Steps: []resource.TestStep{ + { + Config: testAccMediaConvertQueueConfig_Basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsMediaConvertQueueExists(resourceName, &queue), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "mediaconvert", regexp.MustCompile(`queues/.+`)), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "pricing_plan", mediaconvert.PricingPlanOnDemand), + resource.TestCheckResourceAttr(resourceName, "status", mediaconvert.QueueStatusActive), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSMediaConvertQueue_ReservationPlanSettings(t *testing.T) { + t.Skip("MediaConvert Reserved Queues are $400/month and cannot be deleted for 1 year.") + + var queue mediaconvert.Queue + resourceName := "aws_media_convert_queue.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaConvert(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsMediaConvertQueueDestroy, + Steps: []resource.TestStep{ + { + Config: testAccMediaConvertQueueConfig_ReservedQueue(rName, mediaconvert.CommitmentOneYear, mediaconvert.RenewalTypeAutoRenew, 1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsMediaConvertQueueExists(resourceName, &queue), + resource.TestCheckResourceAttr(resourceName, "pricing_plan", mediaconvert.PricingPlanReserved), + resource.TestCheckResourceAttr(resourceName, "reservation_plan_settings.#", "1"), + resource.TestCheckResourceAttr(resourceName, "reservation_plan_settings.0.commitment", mediaconvert.CommitmentOneYear), + resource.TestCheckResourceAttr(resourceName, "reservation_plan_settings.0.renewal_type", mediaconvert.RenewalTypeAutoRenew), + resource.TestCheckResourceAttr(resourceName, "reservation_plan_settings.0.reserved_slots", "1"), + ), + }, + { + Config: testAccMediaConvertQueueConfig_ReservedQueue(rName, mediaconvert.CommitmentOneYear, mediaconvert.RenewalTypeExpire, 2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsMediaConvertQueueExists(resourceName, &queue), + resource.TestCheckResourceAttr(resourceName, "pricing_plan", mediaconvert.PricingPlanReserved), + resource.TestCheckResourceAttr(resourceName, "reservation_plan_settings.#", "1"), + resource.TestCheckResourceAttr(resourceName, "reservation_plan_settings.0.commitment", mediaconvert.CommitmentOneYear), + resource.TestCheckResourceAttr(resourceName, "reservation_plan_settings.0.renewal_type", mediaconvert.RenewalTypeExpire), + resource.TestCheckResourceAttr(resourceName, "reservation_plan_settings.0.reserved_slots", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSMediaConvertQueue_withStatus(t *testing.T) { + var queue mediaconvert.Queue + resourceName := "aws_media_convert_queue.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaConvert(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsMediaConvertQueueDestroy, + Steps: []resource.TestStep{ + { + Config: testAccMediaConvertQueueConfig_withStatus(rName, mediaconvert.QueueStatusPaused), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsMediaConvertQueueExists(resourceName, &queue), + resource.TestCheckResourceAttr(resourceName, "status", mediaconvert.QueueStatusPaused), + ), + }, + { + Config: testAccMediaConvertQueueConfig_withStatus(rName, mediaconvert.QueueStatusActive), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsMediaConvertQueueExists(resourceName, &queue), + resource.TestCheckResourceAttr(resourceName, "status", mediaconvert.QueueStatusActive), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSMediaConvertQueue_withTags(t *testing.T) { + var queue mediaconvert.Queue + resourceName := "aws_media_convert_queue.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaConvert(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsMediaConvertQueueDestroy, + Steps: []resource.TestStep{ + { + Config: testAccMediaConvertQueueConfig_withTags(rName, "foo", "bar", "fizz", "buzz"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsMediaConvertQueueExists(resourceName, &queue), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.foo", "bar"), + resource.TestCheckResourceAttr(resourceName, "tags.fizz", "buzz"), + ), + }, + { + Config: testAccMediaConvertQueueConfig_withTags(rName, "foo", "bar2", "fizz2", "buzz2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsMediaConvertQueueExists(resourceName, &queue), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.foo", "bar2"), + resource.TestCheckResourceAttr(resourceName, "tags.fizz2", "buzz2"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccMediaConvertQueueConfig_Basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsMediaConvertQueueExists(resourceName, &queue), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + }, + }) +} + +func TestAccAWSMediaConvertQueue_disappears(t *testing.T) { + var queue mediaconvert.Queue + resourceName := "aws_media_convert_queue.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaConvert(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsMediaConvertQueueDestroy, + Steps: []resource.TestStep{ + { + Config: testAccMediaConvertQueueConfig_Basic(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsMediaConvertQueueExists(resourceName, &queue), + testAccCheckAwsMediaConvertQueueDisappears(&queue), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAWSMediaConvertQueue_withDescription(t *testing.T) { + var queue mediaconvert.Queue + resourceName := "aws_media_convert_queue.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + description1 := acctest.RandomWithPrefix("Description: ") + description2 := acctest.RandomWithPrefix("Description: ") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMediaConvert(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsMediaConvertQueueDestroy, + Steps: []resource.TestStep{ + { + Config: testAccMediaConvertQueueConfig_withDescription(rName, description1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsMediaConvertQueueExists(resourceName, &queue), + resource.TestCheckResourceAttr(resourceName, "description", description1), + ), + }, + { + Config: testAccMediaConvertQueueConfig_withDescription(rName, description2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsMediaConvertQueueExists(resourceName, &queue), + resource.TestCheckResourceAttr(resourceName, "description", description2), + ), + }, + }, + }) +} + +func testAccCheckAwsMediaConvertQueueDestroy(s *terraform.State) error { + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_media_convert_queue" { + continue + } + conn, err := getAwsMediaConvertAccountClient(testAccProvider.Meta().(*AWSClient)) + if err != nil { + return fmt.Errorf("Error getting Media Convert Account Client: %s", err) + } + + _, err = conn.GetQueue(&mediaconvert.GetQueueInput{ + Name: aws.String(rs.Primary.ID), + }) + if err != nil { + if isAWSErr(err, mediaconvert.ErrCodeNotFoundException, "") { + continue + } + return err + } + } + + return nil +} + +func testAccCheckAwsMediaConvertQueueDisappears(queue *mediaconvert.Queue) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn, err := getAwsMediaConvertAccountClient(testAccProvider.Meta().(*AWSClient)) + if err != nil { + return fmt.Errorf("Error getting Media Convert Account Client: %s", err) + } + + _, err = conn.DeleteQueue(&mediaconvert.DeleteQueueInput{ + Name: queue.Name, + }) + if err != nil { + return fmt.Errorf("Deleting Media Convert Queue: %s", err) + } + return nil + } +} + +func testAccCheckAwsMediaConvertQueueExists(n string, queue *mediaconvert.Queue) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No Queue id is set") + } + + conn, err := getAwsMediaConvertAccountClient(testAccProvider.Meta().(*AWSClient)) + if err != nil { + return fmt.Errorf("Error getting Media Convert Account Client: %s", err) + } + + resp, err := conn.GetQueue(&mediaconvert.GetQueueInput{ + Name: aws.String(rs.Primary.ID), + }) + if err != nil { + return fmt.Errorf("Error getting queue: %s", err) + } + + *queue = *resp.Queue + return nil + } +} + +func testAccPreCheckAWSMediaConvert(t *testing.T) { + _, err := getAwsMediaConvertAccountClient(testAccProvider.Meta().(*AWSClient)) + + if testAccPreCheckSkipError(err) { + t.Skipf("skipping acceptance testing: %s", err) + } + + if err != nil { + t.Fatalf("unexpected PreCheck error: %s", err) + } +} + +func testAccMediaConvertQueueConfig_Basic(rName string) string { + return fmt.Sprintf(` +resource "aws_media_convert_queue" "test" { + name = %[1]q +} + +`, rName) +} + +func testAccMediaConvertQueueConfig_withStatus(rName, status string) string { + return fmt.Sprintf(` +resource "aws_media_convert_queue" "test" { + name = %[1]q + status = %[2]q +} + +`, rName, status) +} + +func testAccMediaConvertQueueConfig_withDescription(rName, description string) string { + return fmt.Sprintf(` +resource "aws_media_convert_queue" "test" { + name = %[1]q + description = %[2]q +} + +`, rName, description) +} + +func testAccMediaConvertQueueConfig_withTags(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_media_convert_queue" "test" { + name = %[1]q + + tags = { + %[2]s = %[3]q + %[4]s = %[5]q + } +} + +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + +func testAccMediaConvertQueueConfig_ReservedQueue(rName, commitment, renewalType string, reservedSlots int) string { + return fmt.Sprintf(` +resource "aws_media_convert_queue" "test" { + name = %[1]q + pricing_plan = %[2]q + + reservation_plan_settings { + commitment = %[3]q + renewal_type = %[4]q + reserved_slots = %[5]d + } +} + +`, rName, mediaconvert.PricingPlanReserved, commitment, renewalType, reservedSlots) +} diff --git a/aws/resource_aws_media_package_channel.go b/aws/resource_aws_media_package_channel.go index 23da76ecc15..ddf15202c49 100644 --- a/aws/resource_aws_media_package_channel.go +++ b/aws/resource_aws_media_package_channel.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsMediaPackageChannel() *schema.Resource { @@ -79,16 +80,17 @@ func resourceAwsMediaPackageChannelCreate(d *schema.ResourceData, meta interface Description: aws.String(d.Get("description").(string)), } - if attr, ok := d.GetOk("tags"); ok { - input.Tags = tagsFromMapGeneric(attr.(map[string]interface{})) + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + input.Tags = keyvaluetags.New(v).IgnoreAws().MediapackageTags() } - _, err := conn.CreateChannel(input) + resp, err := conn.CreateChannel(input) if err != nil { return fmt.Errorf("error creating MediaPackage Channel: %s", err) } - d.SetId(d.Get("channel_id").(string)) + d.SetId(aws.StringValue(resp.Id)) + return resourceAwsMediaPackageChannelRead(d, meta) } @@ -110,7 +112,7 @@ func resourceAwsMediaPackageChannelRead(d *schema.ResourceData, meta interface{} return fmt.Errorf("error setting hls_ingest: %s", err) } - if err := d.Set("tags", tagsToMapGeneric(resp.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.MediapackageKeyValueTags(resp.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -130,8 +132,13 @@ func resourceAwsMediaPackageChannelUpdate(d *schema.ResourceData, meta interface return fmt.Errorf("error updating MediaPackage Channel: %s", err) } - if err := setTagsMediaPackage(conn, d, d.Get("arn").(string)); err != nil { - return fmt.Errorf("error updating MediaPackage Channel (%s) tags: %s", d.Id(), err) + arn := d.Get("arn").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.MediapackageUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating MediaPackage Channel (%s) tags: %s", arn, err) + } } return resourceAwsMediaPackageChannelRead(d, meta) diff --git a/aws/resource_aws_media_store_container.go b/aws/resource_aws_media_store_container.go index 3bbd17176bb..e25fae91700 100644 --- a/aws/resource_aws_media_store_container.go +++ b/aws/resource_aws_media_store_container.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsMediaStoreContainer() *schema.Resource { @@ -47,17 +48,23 @@ func resourceAwsMediaStoreContainerCreate(d *schema.ResourceData, meta interface input := &mediastore.CreateContainerInput{ ContainerName: aws.String(d.Get("name").(string)), - Tags: tagsFromMapMediaStore(d.Get("tags").(map[string]interface{})), } - _, err := conn.CreateContainer(input) + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + input.Tags = keyvaluetags.New(v).IgnoreAws().MediastoreTags() + } + + resp, err := conn.CreateContainer(input) if err != nil { return err } + + d.SetId(aws.StringValue(resp.Container.Name)) + stateConf := &resource.StateChangeConf{ Pending: []string{mediastore.ContainerStatusCreating}, Target: []string{mediastore.ContainerStatusActive}, - Refresh: mediaStoreContainerRefreshStatusFunc(conn, d.Get("name").(string)), + Refresh: mediaStoreContainerRefreshStatusFunc(conn, d.Id()), Timeout: 10 * time.Minute, Delay: 10 * time.Second, MinTimeout: 3 * time.Second, @@ -68,7 +75,6 @@ func resourceAwsMediaStoreContainerCreate(d *schema.ResourceData, meta interface return err } - d.SetId(d.Get("name").(string)) return resourceAwsMediaStoreContainerRead(d, meta) } @@ -87,17 +93,20 @@ func resourceAwsMediaStoreContainerRead(d *schema.ResourceData, meta interface{} if err != nil { return fmt.Errorf("Error describing media store container %s: %s", d.Id(), err) } - d.Set("arn", resp.Container.ARN) + + arn := aws.StringValue(resp.Container.ARN) + d.Set("arn", arn) d.Set("name", resp.Container.Name) d.Set("endpoint", resp.Container.Endpoint) - if err := saveTagsMediaStore(conn, d, aws.StringValue(resp.Container.ARN)); err != nil { - if isAWSErr(err, mediastore.ErrCodeContainerNotFoundException, "") { - log.Printf("[WARN] No Container found: %s, removing from state", d.Id()) - d.SetId("") - return nil - } - return fmt.Errorf("Error setting tags for %s: %s", d.Id(), err) + tags, err := keyvaluetags.MediastoreListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for media store container (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -106,13 +115,13 @@ func resourceAwsMediaStoreContainerRead(d *schema.ResourceData, meta interface{} func resourceAwsMediaStoreContainerUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).mediastoreconn - if err := setTagsMediaStore(conn, d, d.Get("arn").(string)); err != nil { - if isAWSErr(err, mediastore.ErrCodeContainerNotFoundException, "") { - log.Printf("[WARN] No Container found: %s, removing from state", d.Id()) - d.SetId("") - return nil + arn := d.Get("arn").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.MediastoreUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating media store container (%s) tags: %s", arn, err) } - return fmt.Errorf("Error updating tags for %s: %s", d.Id(), err) } return resourceAwsMediaStoreContainerRead(d, meta) diff --git a/aws/resource_aws_mq_broker.go b/aws/resource_aws_mq_broker.go index 4bc156be442..00ef70f6f4f 100644 --- a/aws/resource_aws_mq_broker.go +++ b/aws/resource_aws_mq_broker.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/mitchellh/copystructure" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsMqBroker() *schema.Resource { @@ -163,7 +164,6 @@ func resourceAwsMqBroker() *schema.Resource { Type: schema.TypeSet, Elem: &schema.Schema{Type: schema.TypeString}, Required: true, - ForceNew: true, }, "subnet_ids": { Type: schema.TypeSet, @@ -264,7 +264,7 @@ func resourceAwsMqBrokerCreate(d *schema.ResourceData, meta interface{}) error { input.SubnetIds = expandStringList(v.(*schema.Set).List()) } if v, ok := d.GetOk("tags"); ok { - input.Tags = tagsFromMapGeneric(v.(map[string]interface{})) + input.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().MqTags() } log.Printf("[INFO] Creating MQ Broker: %s", input) @@ -376,12 +376,32 @@ func resourceAwsMqBrokerRead(d *schema.ResourceData, meta interface{}) error { return err } - return getTagsMQ(conn, d, aws.StringValue(out.BrokerArn)) + tags, err := keyvaluetags.MqListTags(conn, aws.StringValue(out.BrokerArn)) + if err != nil { + return fmt.Errorf("error listing tags for MQ Broker (%s): %s", d.Id(), err) + } + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + return nil } func resourceAwsMqBrokerUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).mqconn + requiresReboot := false + + if d.HasChange("security_groups") { + _, err := conn.UpdateBroker(&mq.UpdateBrokerRequest{ + BrokerId: aws.String(d.Id()), + SecurityGroups: expandStringSet(d.Get("security_groups").(*schema.Set)), + }) + if err != nil { + return fmt.Errorf("error updating MQ Broker (%s) security groups: %s", d.Id(), err) + } + } + if d.HasChange("configuration") || d.HasChange("logs") { _, err := conn.UpdateBroker(&mq.UpdateBrokerRequest{ BrokerId: aws.String(d.Id()), @@ -389,25 +409,34 @@ func resourceAwsMqBrokerUpdate(d *schema.ResourceData, meta interface{}) error { Logs: expandMqLogs(d.Get("logs").([]interface{})), }) if err != nil { - return err + return fmt.Errorf("error updating MQ Broker (%s) configuration: %s", d.Id(), err) } + requiresReboot = true } if d.HasChange("user") { o, n := d.GetChange("user") - err := updateAwsMqBrokerUsers(conn, d.Id(), + var err error + // d.HasChange("user") always reports a change when running resourceAwsMqBrokerUpdate + // updateAwsMqBrokerUsers needs to be called to know if changes to user are actually made + var usersUpdated bool + usersUpdated, err = updateAwsMqBrokerUsers(conn, d.Id(), o.(*schema.Set).List(), n.(*schema.Set).List()) if err != nil { - return err + return fmt.Errorf("error updating MQ Broker (%s) user: %s", d.Id(), err) + } + + if usersUpdated { + requiresReboot = true } } - if d.Get("apply_immediately").(bool) { + if d.Get("apply_immediately").(bool) && requiresReboot { _, err := conn.RebootBroker(&mq.RebootBrokerInput{ BrokerId: aws.String(d.Id()), }) if err != nil { - return err + return fmt.Errorf("error rebooting MQ Broker (%s): %s", d.Id(), err) } stateConf := resource.StateChangeConf{ @@ -434,8 +463,12 @@ func resourceAwsMqBrokerUpdate(d *schema.ResourceData, meta interface{}) error { } } - if tagErr := setTagsMQ(conn, d, d.Get("arn").(string)); tagErr != nil { - return fmt.Errorf("error setting mq broker tags: %s", tagErr) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.MqUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating MQ Broker (%s) tags: %s", d.Get("arn").(string), err) + } } return nil @@ -502,32 +535,38 @@ func waitForMqBrokerDeletion(conn *mq.MQ, id string) error { return err } -func updateAwsMqBrokerUsers(conn *mq.MQ, bId string, oldUsers, newUsers []interface{}) error { +func updateAwsMqBrokerUsers(conn *mq.MQ, bId string, oldUsers, newUsers []interface{}) (bool, error) { + // If there are any user creates/deletes/updates, updatedUsers will be set to true + updatedUsers := false + createL, deleteL, updateL, err := diffAwsMqBrokerUsers(bId, oldUsers, newUsers) if err != nil { - return err + return updatedUsers, err } for _, c := range createL { _, err := conn.CreateUser(c) + updatedUsers = true if err != nil { - return err + return updatedUsers, err } } for _, d := range deleteL { _, err := conn.DeleteUser(d) + updatedUsers = true if err != nil { - return err + return updatedUsers, err } } for _, u := range updateL { _, err := conn.UpdateUser(u) + updatedUsers = true if err != nil { - return err + return updatedUsers, err } } - return nil + return updatedUsers, nil } func diffAwsMqBrokerUsers(bId string, oldUsers, newUsers []interface{}) ( diff --git a/aws/resource_aws_mq_broker_test.go b/aws/resource_aws_mq_broker_test.go index 6e555e46f72..f904e01995e 100644 --- a/aws/resource_aws_mq_broker_test.go +++ b/aws/resource_aws_mq_broker_test.go @@ -644,7 +644,7 @@ func TestAccAWSMqBroker_updateTags(t *testing.T) { resource.TestCheckResourceAttr("aws_mq_broker.test", "tags.env", "test"), ), }, - // Adding new user + modify existing + // Modify existing tags { Config: testAccMqBrokerConfig_updateTags2(sgName, brokerName), Check: resource.ComposeTestCheckFunc( @@ -654,7 +654,7 @@ func TestAccAWSMqBroker_updateTags(t *testing.T) { resource.TestCheckResourceAttr("aws_mq_broker.test", "tags.role", "test-role"), ), }, - // Deleting user + modify existing + // Deleting tags { Config: testAccMqBrokerConfig_updateTags3(sgName, brokerName), Check: resource.ComposeTestCheckFunc( @@ -667,6 +667,45 @@ func TestAccAWSMqBroker_updateTags(t *testing.T) { }) } +func TestAccAWSMqBroker_updateSecurityGroup(t *testing.T) { + sgName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + brokerName := fmt.Sprintf("tf-acc-test-%s", acctest.RandString(5)) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMq(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsMqBrokerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccMqBrokerConfig(sgName, brokerName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsMqBrokerExists("aws_mq_broker.test"), + resource.TestCheckResourceAttr("aws_mq_broker.test", "security_groups.#", "1"), + ), + }, + { + Config: testAccMqBrokerConfig_updateSecurityGroups(sgName, brokerName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsMqBrokerExists("aws_mq_broker.test"), + resource.TestCheckResourceAttr("aws_mq_broker.test", "security_groups.#", "2"), + ), + }, + // Trigger a reboot and ensure the password change was applied + // User hashcode can be retrieved by calling resourceAwsMqUserHash + { + Config: testAccMqBrokerConfig_updateUsersSecurityGroups(sgName, brokerName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsMqBrokerExists("aws_mq_broker.test"), + resource.TestCheckResourceAttr("aws_mq_broker.test", "security_groups.#", "1"), + resource.TestCheckResourceAttr("aws_mq_broker.test", "user.#", "1"), + resource.TestCheckResourceAttr("aws_mq_broker.test", "user.2209734970.username", "Test"), + resource.TestCheckResourceAttr("aws_mq_broker.test", "user.2209734970.password", "TestTest9999"), + ), + }, + }, + }) +} + func testAccCheckAwsMqBrokerDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).mqconn @@ -1128,3 +1167,63 @@ resource "aws_mq_broker" "test" { } `, sgName, brokerName) } + +func testAccMqBrokerConfig_updateSecurityGroups(sgName, brokerName string) string { + return fmt.Sprintf(` +resource "aws_security_group" "test" { + name = "%s" +} + +resource "aws_security_group" "test2" { + name = "%s-2" +} + +resource "aws_mq_broker" "test" { + apply_immediately = true + broker_name = "%s" + engine_type = "ActiveMQ" + engine_version = "5.15.0" + host_instance_type = "mq.t2.micro" + security_groups = ["${aws_security_group.test.id}", "${aws_security_group.test2.id}"] + + logs { + general = true + } + + user { + username = "Test" + password = "TestTest1234" + } +} +`, sgName, sgName, brokerName) +} + +func testAccMqBrokerConfig_updateUsersSecurityGroups(sgName, brokerName string) string { + return fmt.Sprintf(` +resource "aws_security_group" "test" { + name = "%s" +} + +resource "aws_security_group" "test2" { + name = "%s-2" +} + +resource "aws_mq_broker" "test" { + apply_immediately = true + broker_name = "%s" + engine_type = "ActiveMQ" + engine_version = "5.15.0" + host_instance_type = "mq.t2.micro" + security_groups = ["${aws_security_group.test2.id}"] + + logs { + general = true + } + + user { + username = "Test" + password = "TestTest9999" + } +} +`, sgName, sgName, brokerName) +} diff --git a/aws/resource_aws_mq_configuration.go b/aws/resource_aws_mq_configuration.go index 5721be52beb..08afb2ec5bb 100644 --- a/aws/resource_aws_mq_configuration.go +++ b/aws/resource_aws_mq_configuration.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/mq" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsMqConfiguration() *schema.Resource { @@ -82,7 +83,7 @@ func resourceAwsMqConfigurationCreate(d *schema.ResourceData, meta interface{}) } if v, ok := d.GetOk("tags"); ok { - input.Tags = tagsFromMapGeneric(v.(map[string]interface{})) + input.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().MqTags() } log.Printf("[INFO] Creating MQ Configuration: %s", input) @@ -135,7 +136,15 @@ func resourceAwsMqConfigurationRead(d *schema.ResourceData, meta interface{}) er d.Set("data", string(b)) - return getTagsMQ(conn, d, aws.StringValue(out.Arn)) + tags, err := keyvaluetags.MqListTags(conn, aws.StringValue(out.Arn)) + if err != nil { + return fmt.Errorf("error listing tags for MQ Configuration (%s): %s", d.Id(), err) + } + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + return nil } func resourceAwsMqConfigurationUpdate(d *schema.ResourceData, meta interface{}) error { @@ -158,8 +167,12 @@ func resourceAwsMqConfigurationUpdate(d *schema.ResourceData, meta interface{}) return err } - if tagErr := setTagsMQ(conn, d, d.Get("arn").(string)); tagErr != nil { - return fmt.Errorf("error setting mq configuration tags: %s", err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.MqUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating MQ Broker (%s) tags: %s", d.Get("arn").(string), err) + } } return resourceAwsMqConfigurationRead(d, meta) diff --git a/aws/resource_aws_msk_cluster.go b/aws/resource_aws_msk_cluster.go index bdf6e8f302a..74ffbf6b31f 100644 --- a/aws/resource_aws_msk_cluster.go +++ b/aws/resource_aws_msk_cluster.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsMskCluster() *schema.Resource { @@ -188,7 +189,6 @@ func resourceAwsMskCluster() *schema.Resource { Type: schema.TypeString, Optional: true, Default: kafka.EnhancedMonitoringDefault, - ForceNew: true, ValidateFunc: validation.StringInSlice([]string{ kafka.EnhancedMonitoringDefault, kafka.EnhancedMonitoringPerBroker, @@ -204,7 +204,53 @@ func resourceAwsMskCluster() *schema.Resource { "number_of_broker_nodes": { Type: schema.TypeInt, Required: true, - ForceNew: true, + }, + "open_monitoring": { + Type: schema.TypeList, + Optional: true, + DiffSuppressFunc: suppressMissingOptionalConfigurationBlock, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "prometheus": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "jmx_exporter": { + Type: schema.TypeList, + Optional: true, + DiffSuppressFunc: suppressMissingOptionalConfigurationBlock, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled_in_broker": { + Type: schema.TypeBool, + Required: true, + }, + }, + }, + }, + "node_exporter": { + Type: schema.TypeList, + Optional: true, + DiffSuppressFunc: suppressMissingOptionalConfigurationBlock, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "enabled_in_broker": { + Type: schema.TypeBool, + Required: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, }, "tags": tagsSchema(), "zookeeper_connect_string": { @@ -227,7 +273,8 @@ func resourceAwsMskClusterCreate(d *schema.ResourceData, meta interface{}) error EnhancedMonitoring: aws.String(d.Get("enhanced_monitoring").(string)), KafkaVersion: aws.String(d.Get("kafka_version").(string)), NumberOfBrokerNodes: aws.Int64(int64(d.Get("number_of_broker_nodes").(int))), - Tags: tagsFromMapMskCluster(d.Get("tags").(map[string]interface{})), + OpenMonitoring: expandMskOpenMonitoring(d.Get("open_monitoring").([]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().KafkaTags(), } out, err := conn.CreateCluster(input) @@ -338,10 +385,14 @@ func resourceAwsMskClusterRead(d *schema.ResourceData, meta interface{}) error { d.Set("kafka_version", aws.StringValue(cluster.CurrentBrokerSoftwareInfo.KafkaVersion)) d.Set("number_of_broker_nodes", aws.Int64Value(cluster.NumberOfBrokerNodes)) - if err := d.Set("tags", tagsToMapMskCluster(cluster.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.KafkaKeyValueTags(cluster.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } + if err := d.Set("open_monitoring", flattenMskOpenMonitoring(cluster.OpenMonitoring)); err != nil { + return fmt.Errorf("error setting open_monitoring: %s", err) + } + d.Set("zookeeper_connect_string", aws.StringValue(cluster.ZookeeperConnectString)) return nil @@ -379,6 +430,55 @@ func resourceAwsMskClusterUpdate(d *schema.ResourceData, meta interface{}) error } } + if d.HasChange("number_of_broker_nodes") { + input := &kafka.UpdateBrokerCountInput{ + ClusterArn: aws.String(d.Id()), + CurrentVersion: aws.String(d.Get("current_version").(string)), + TargetNumberOfBrokerNodes: aws.Int64(int64(d.Get("number_of_broker_nodes").(int))), + } + + output, err := conn.UpdateBrokerCount(input) + + if err != nil { + return fmt.Errorf("error updating MSK Cluster (%s) broker count: %s", d.Id(), err) + } + + if output == nil { + return fmt.Errorf("error updating MSK Cluster (%s) broker count: empty response", d.Id()) + } + + clusterOperationARN := aws.StringValue(output.ClusterOperationArn) + + if err := waitForMskClusterOperation(conn, clusterOperationARN); err != nil { + return fmt.Errorf("error waiting for MSK Cluster (%s) operation (%s): %s", d.Id(), clusterOperationARN, err) + } + } + + if d.HasChange("enhanced_monitoring") || d.HasChange("open_monitoring") { + input := &kafka.UpdateMonitoringInput{ + ClusterArn: aws.String(d.Id()), + CurrentVersion: aws.String(d.Get("current_version").(string)), + EnhancedMonitoring: aws.String(d.Get("enhanced_monitoring").(string)), + OpenMonitoring: expandMskOpenMonitoring(d.Get("open_monitoring").([]interface{})), + } + + output, err := conn.UpdateMonitoring(input) + + if err != nil { + return fmt.Errorf("error updating MSK Cluster (%s) monitoring: %s", d.Id(), err) + } + + if output == nil { + return fmt.Errorf("error updating MSK Cluster (%s) monitoring: empty response", d.Id()) + } + + clusterOperationARN := aws.StringValue(output.ClusterOperationArn) + + if err := waitForMskClusterOperation(conn, clusterOperationARN); err != nil { + return fmt.Errorf("error waiting for MSK Cluster (%s) operation (%s): %s", d.Id(), clusterOperationARN, err) + } + } + if d.HasChange("configuration_info") { input := &kafka.UpdateClusterConfigurationInput{ ClusterArn: aws.String(d.Id()), @@ -404,8 +504,10 @@ func resourceAwsMskClusterUpdate(d *schema.ResourceData, meta interface{}) error } if d.HasChange("tags") { - if err := setTagsMskCluster(conn, d, d.Id()); err != nil { - return fmt.Errorf("failed updating tags for msk cluster %q: %s", d.Id(), err) + o, n := d.GetChange("tags") + + if err := keyvaluetags.KafkaUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating MSK Cluster (%s) tags: %s", d.Id(), err) } } @@ -513,6 +615,63 @@ func expandMskClusterTls(l []interface{}) *kafka.Tls { return tls } +func expandMskOpenMonitoring(l []interface{}) *kafka.OpenMonitoringInfo { + if len(l) == 0 || l[0] == nil { + return nil + } + + m := l[0].(map[string]interface{}) + + openMonitoring := &kafka.OpenMonitoringInfo{ + Prometheus: expandMskOpenMonitoringPrometheus(m["prometheus"].([]interface{})), + } + + return openMonitoring +} + +func expandMskOpenMonitoringPrometheus(l []interface{}) *kafka.PrometheusInfo { + if len(l) == 0 || l[0] == nil { + return nil + } + + m := l[0].(map[string]interface{}) + + prometheus := &kafka.PrometheusInfo{ + JmxExporter: expandMskOpenMonitoringPrometheusJmxExporter(m["jmx_exporter"].([]interface{})), + NodeExporter: expandMskOpenMonitoringPrometheusNodeExporter(m["node_exporter"].([]interface{})), + } + + return prometheus +} + +func expandMskOpenMonitoringPrometheusJmxExporter(l []interface{}) *kafka.JmxExporterInfo { + if len(l) == 0 || l[0] == nil { + return nil + } + + m := l[0].(map[string]interface{}) + + jmxExporter := &kafka.JmxExporterInfo{ + EnabledInBroker: aws.Bool(m["enabled_in_broker"].(bool)), + } + + return jmxExporter +} + +func expandMskOpenMonitoringPrometheusNodeExporter(l []interface{}) *kafka.NodeExporterInfo { + if len(l) == 0 || l[0] == nil { + return nil + } + + m := l[0].(map[string]interface{}) + + nodeExporter := &kafka.NodeExporterInfo{ + EnabledInBroker: aws.Bool(m["enabled_in_broker"].(bool)), + } + + return nodeExporter +} + func flattenMskBrokerNodeGroupInfo(b *kafka.BrokerNodeGroupInfo) []map[string]interface{} { if b == nil { @@ -596,6 +755,55 @@ func flattenMskTls(tls *kafka.Tls) []map[string]interface{} { return []map[string]interface{}{m} } +func flattenMskOpenMonitoring(e *kafka.OpenMonitoring) []map[string]interface{} { + if e == nil { + return []map[string]interface{}{} + } + + m := map[string]interface{}{ + "prometheus": flattenMskOpenMonitoringPrometheus(e.Prometheus), + } + + return []map[string]interface{}{m} +} + +func flattenMskOpenMonitoringPrometheus(e *kafka.Prometheus) []map[string]interface{} { + if e == nil { + return []map[string]interface{}{} + } + + m := map[string]interface{}{ + "jmx_exporter": flattenMskOpenMonitoringPrometheusJmxExporter(e.JmxExporter), + "node_exporter": flattenMskOpenMonitoringPrometheusNodeExporter(e.NodeExporter), + } + + return []map[string]interface{}{m} +} + +func flattenMskOpenMonitoringPrometheusJmxExporter(e *kafka.JmxExporter) []map[string]interface{} { + if e == nil { + return []map[string]interface{}{} + } + + m := map[string]interface{}{ + "enabled_in_broker": aws.BoolValue(e.EnabledInBroker), + } + + return []map[string]interface{}{m} +} + +func flattenMskOpenMonitoringPrometheusNodeExporter(e *kafka.NodeExporter) []map[string]interface{} { + if e == nil { + return []map[string]interface{}{} + } + + m := map[string]interface{}{ + "enabled_in_broker": aws.BoolValue(e.EnabledInBroker), + } + + return []map[string]interface{}{m} +} + func resourceAwsMskClusterDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).kafkaconn diff --git a/aws/resource_aws_msk_cluster_test.go b/aws/resource_aws_msk_cluster_test.go index 85d1dff2e6f..5cfacf4a664 100644 --- a/aws/resource_aws_msk_cluster_test.go +++ b/aws/resource_aws_msk_cluster_test.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func init() { @@ -91,10 +92,10 @@ func TestAccAWSMskCluster_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "encryption_info.0.encryption_in_transit.0.client_broker", "TLS_PLAINTEXT"), resource.TestCheckResourceAttr(resourceName, "encryption_info.0.encryption_in_transit.0.in_cluster", "true"), resource.TestCheckResourceAttr(resourceName, "enhanced_monitoring", kafka.EnhancedMonitoringDefault), - resource.TestCheckResourceAttr(resourceName, "kafka_version", "2.1.0"), + resource.TestCheckResourceAttr(resourceName, "kafka_version", "2.2.1"), resource.TestCheckResourceAttr(resourceName, "number_of_broker_nodes", "3"), resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), - resource.TestMatchResourceAttr(resourceName, "zookeeper_connect_string", regexp.MustCompile(`^\d+\.\d+\.\d+\.\d+:\d+,\d+\.\d+\.\d+\.\d+:\d+,\d+\.\d+\.\d+\.\d+:\d+$`)), + resource.TestMatchResourceAttr(resourceName, "zookeeper_connect_string", regexp.MustCompile(`^(([-\w]+\.){1,}[\w]+:\d+,){2,}([-\w]+\.){1,}[\w]+:\d+$`)), ), }, { @@ -325,7 +326,7 @@ func TestAccAWSMskCluster_EncryptionInfo_EncryptionInTransit_InCluster(t *testin } func TestAccAWSMskCluster_EnhancedMonitoring(t *testing.T) { - var cluster kafka.ClusterInfo + var cluster1, cluster2 kafka.ClusterInfo rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_msk_cluster.test" @@ -337,7 +338,7 @@ func TestAccAWSMskCluster_EnhancedMonitoring(t *testing.T) { { Config: testAccMskClusterConfigEnhancedMonitoring(rName, "PER_BROKER"), Check: resource.ComposeTestCheckFunc( - testAccCheckMskClusterExists(resourceName, &cluster), + testAccCheckMskClusterExists(resourceName, &cluster1), resource.TestCheckResourceAttr(resourceName, "enhanced_monitoring", kafka.EnhancedMonitoringPerBroker), ), }, @@ -350,12 +351,20 @@ func TestAccAWSMskCluster_EnhancedMonitoring(t *testing.T) { "bootstrap_brokers_tls", // API may mutate ordering and selection of brokers to return }, }, + { + Config: testAccMskClusterConfigEnhancedMonitoring(rName, "PER_TOPIC_PER_BROKER"), + Check: resource.ComposeTestCheckFunc( + testAccCheckMskClusterExists(resourceName, &cluster2), + testAccCheckMskClusterNotRecreated(&cluster1, &cluster2), + resource.TestCheckResourceAttr(resourceName, "enhanced_monitoring", kafka.EnhancedMonitoringPerTopicPerBroker), + ), + }, }, }) } func TestAccAWSMskCluster_NumberOfBrokerNodes(t *testing.T) { - var cluster kafka.ClusterInfo + var cluster1, cluster2 kafka.ClusterInfo rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_msk_cluster.test" @@ -365,9 +374,33 @@ func TestAccAWSMskCluster_NumberOfBrokerNodes(t *testing.T) { CheckDestroy: testAccCheckMskClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccMskClusterConfigNumberOfBrokerNodes(rName), + Config: testAccMskClusterConfigNumberOfBrokerNodes(rName, 3), Check: resource.ComposeTestCheckFunc( - testAccCheckMskClusterExists(resourceName, &cluster), + testAccCheckMskClusterExists(resourceName, &cluster1), + resource.TestMatchResourceAttr(resourceName, "bootstrap_brokers", regexp.MustCompile(`^(([-\w]+\.){1,}[\w]+:\d+,){2,}([-\w]+\.){1,}[\w]+:\d+$`)), + resource.TestMatchResourceAttr(resourceName, "bootstrap_brokers_tls", regexp.MustCompile(`^(([-\w]+\.){1,}[\w]+:\d+,){2,}([-\w]+\.){1,}[\w]+:\d+$`)), + resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.#", "1"), + resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.0.client_subnets.#", "3"), + resource.TestCheckResourceAttrPair(resourceName, "broker_node_group_info.0.client_subnets.0", "aws_subnet.example_subnet_az1", "id"), + resource.TestCheckResourceAttrPair(resourceName, "broker_node_group_info.0.client_subnets.1", "aws_subnet.example_subnet_az2", "id"), + resource.TestCheckResourceAttrPair(resourceName, "broker_node_group_info.0.client_subnets.2", "aws_subnet.example_subnet_az3", "id"), + resource.TestCheckResourceAttr(resourceName, "number_of_broker_nodes", "3"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "bootstrap_brokers", // API may mutate ordering and selection of brokers to return + "bootstrap_brokers_tls", // API may mutate ordering and selection of brokers to return + }, + }, + { + Config: testAccMskClusterConfigNumberOfBrokerNodes(rName, 6), + Check: resource.ComposeTestCheckFunc( + testAccCheckMskClusterExists(resourceName, &cluster2), + testAccCheckMskClusterNotRecreated(&cluster1, &cluster2), resource.TestMatchResourceAttr(resourceName, "bootstrap_brokers", regexp.MustCompile(`^(([-\w]+\.){1,}[\w]+:\d+,){2,}([-\w]+\.){1,}[\w]+:\d+$`)), resource.TestMatchResourceAttr(resourceName, "bootstrap_brokers_tls", regexp.MustCompile(`^(([-\w]+\.){1,}[\w]+:\d+,){2,}([-\w]+\.){1,}[\w]+:\d+$`)), resource.TestCheckResourceAttr(resourceName, "broker_node_group_info.#", "1"), @@ -378,6 +411,32 @@ func TestAccAWSMskCluster_NumberOfBrokerNodes(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "number_of_broker_nodes", "6"), ), }, + }, + }) +} + +func TestAccAWSMskCluster_OpenMonitoring(t *testing.T) { + var cluster1, cluster2 kafka.ClusterInfo + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_msk_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSMsk(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckMskClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccMskClusterConfigOpenMonitoring(rName, false, false), + Check: resource.ComposeTestCheckFunc( + testAccCheckMskClusterExists(resourceName, &cluster1), + resource.TestCheckResourceAttr(resourceName, "open_monitoring.#", "1"), + resource.TestCheckResourceAttr(resourceName, "open_monitoring.0.prometheus.#", "1"), + resource.TestCheckResourceAttr(resourceName, "open_monitoring.0.prometheus.0.jmx_exporter.#", "1"), + resource.TestCheckResourceAttr(resourceName, "open_monitoring.0.prometheus.0.jmx_exporter.0.enabled_in_broker", "false"), + resource.TestCheckResourceAttr(resourceName, "open_monitoring.0.prometheus.0.node_exporter.#", "1"), + resource.TestCheckResourceAttr(resourceName, "open_monitoring.0.prometheus.0.node_exporter.0.enabled_in_broker", "false"), + ), + }, { ResourceName: resourceName, ImportState: true, @@ -387,6 +446,19 @@ func TestAccAWSMskCluster_NumberOfBrokerNodes(t *testing.T) { "bootstrap_brokers_tls", // API may mutate ordering and selection of brokers to return }, }, + { + Config: testAccMskClusterConfigOpenMonitoring(rName, true, false), + Check: resource.ComposeTestCheckFunc( + testAccCheckMskClusterExists(resourceName, &cluster2), + testAccCheckMskClusterNotRecreated(&cluster1, &cluster2), + resource.TestCheckResourceAttr(resourceName, "open_monitoring.#", "1"), + resource.TestCheckResourceAttr(resourceName, "open_monitoring.0.prometheus.#", "1"), + resource.TestCheckResourceAttr(resourceName, "open_monitoring.0.prometheus.0.jmx_exporter.#", "1"), + resource.TestCheckResourceAttr(resourceName, "open_monitoring.0.prometheus.0.jmx_exporter.0.enabled_in_broker", "true"), + resource.TestCheckResourceAttr(resourceName, "open_monitoring.0.prometheus.0.node_exporter.#", "1"), + resource.TestCheckResourceAttr(resourceName, "open_monitoring.0.prometheus.0.node_exporter.0.enabled_in_broker", "false"), + ), + }, }, }) } @@ -508,7 +580,7 @@ func testAccLoadMskTags(cluster *kafka.ClusterInfo, td *kafka.ListTagsForResourc func testAccCheckMskClusterTags(td *kafka.ListTagsForResourceOutput, key string, value string) resource.TestCheckFunc { return func(s *terraform.State) error { - m := tagsToMapMskCluster(td.Tags) + m := keyvaluetags.KafkaKeyValueTags(td.Tags).IgnoreAws().Map() v, ok := m[key] if value != "" && !ok { return fmt.Errorf("Missing tag: %s - (found tags %v)", key, m) @@ -595,9 +667,15 @@ func testAccMskClusterConfig_basic(rName string) string { return testAccMskClusterBaseConfig() + fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q - kafka_version = "2.1.0" + kafka_version = "2.2.1" number_of_broker_nodes = 3 + encryption_info { + encryption_in_transit { + client_broker = "TLS_PLAINTEXT" + } + } + broker_node_group_info { client_subnets = ["${aws_subnet.example_subnet_az1.id}", "${aws_subnet.example_subnet_az2.id}", "${aws_subnet.example_subnet_az3.id}"] ebs_volume_size = 10 @@ -612,9 +690,15 @@ func testAccMskClusterConfigBrokerNodeGroupInfoEbsVolumeSize(rName string, ebsVo return testAccMskClusterBaseConfig() + fmt.Sprintf(` resource "aws_msk_cluster" "test" { cluster_name = %[1]q - kafka_version = "2.1.0" + kafka_version = "2.2.1" number_of_broker_nodes = 3 + encryption_info { + encryption_in_transit { + client_broker = "TLS_PLAINTEXT" + } + } + broker_node_group_info { client_subnets = ["${aws_subnet.example_subnet_az1.id}", "${aws_subnet.example_subnet_az2.id}", "${aws_subnet.example_subnet_az3.id}"] ebs_volume_size = %[2]d @@ -640,7 +724,7 @@ resource "aws_acmpca_certificate_authority" "test" { resource "aws_msk_cluster" "test" { cluster_name = %[1]q - kafka_version = "2.1.0" + kafka_version = "2.2.1" number_of_broker_nodes = 3 broker_node_group_info { @@ -668,7 +752,7 @@ resource "aws_msk_cluster" "test" { func testAccMskClusterConfigConfigurationInfoRevision1(rName string) string { return testAccMskClusterBaseConfig() + fmt.Sprintf(` resource "aws_msk_configuration" "test" { - kafka_versions = ["2.1.0"] + kafka_versions = ["2.2.1"] name = "%[1]s-1" server_properties = < 0 { + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), nil, v); err != nil { + return fmt.Errorf("error adding EC2 NAT Gateway (%s) tags: %s", d.Id(), err) + } + } + + return resourceAwsNatGatewayRead(d, meta) } func resourceAwsNatGatewayRead(d *schema.ResourceData, meta interface{}) error { @@ -125,8 +131,9 @@ func resourceAwsNatGatewayRead(d *schema.ResourceData, meta interface{}) error { d.Set("private_ip", address.PrivateIp) d.Set("public_ip", address.PublicIp) - // Tags - d.Set("tags", tagsToMap(ng.Tags)) + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(ng.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } @@ -134,15 +141,14 @@ func resourceAwsNatGatewayRead(d *schema.ResourceData, meta interface{}) error { func resourceAwsNatGatewayUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - // Turn on partial mode - d.Partial(true) + if d.HasChange("tags") { + o, n := d.GetChange("tags") - if err := setTags(conn, d); err != nil { - return err + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating EC2 NAT Gateway (%s) tags: %s", d.Id(), err) + } } - d.SetPartial("tags") - d.Partial(false) return resourceAwsNatGatewayRead(d, meta) } diff --git a/aws/resource_aws_neptune_cluster.go b/aws/resource_aws_neptune_cluster.go index b2a110fa14f..4283fe4e548 100644 --- a/aws/resource_aws_neptune_cluster.go +++ b/aws/resource_aws_neptune_cluster.go @@ -12,6 +12,15 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +const ( + + // A constant for the supported CloudwatchLogsExports types + // is not currently available in the AWS sdk-for-go + // https://docs.aws.amazon.com/sdk-for-go/api/service/neptune/#pkg-constants + CloudwatchLogsExportsAudit = "audit" ) func resourceAwsNeptuneCluster() *schema.Resource { @@ -46,6 +55,7 @@ func resourceAwsNeptuneCluster() *schema.Resource { "availability_zones": { Type: schema.TypeSet, + MaxItems: 3, Elem: &schema.Schema{Type: schema.TypeString}, Optional: true, ForceNew: true, @@ -94,6 +104,18 @@ func resourceAwsNeptuneCluster() *schema.Resource { Computed: true, }, + "enable_cloudwatch_logs_exports": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validation.StringInSlice([]string{ + CloudwatchLogsExportsAudit, + }, false), + }, + Set: schema.HashString, + }, + "engine": { Type: schema.TypeString, Optional: true, @@ -136,8 +158,11 @@ func resourceAwsNeptuneCluster() *schema.Resource { "iam_roles": { Type: schema.TypeSet, Optional: true, - Elem: &schema.Schema{Type: schema.TypeString}, - Set: schema.HashString, + Elem: &schema.Schema{ + Type: schema.TypeString, + ValidateFunc: validateArn, + }, + Set: schema.HashString, }, "iam_database_authentication_enabled": { @@ -231,13 +256,17 @@ func resourceAwsNeptuneCluster() *schema.Resource { Elem: &schema.Schema{Type: schema.TypeString}, Set: schema.HashString, }, + "deletion_protection": { + Type: schema.TypeBool, + Optional: true, + }, }, } } func resourceAwsNeptuneClusterCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).neptuneconn - tags := tagsFromMapNeptune(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().NeptuneTags() // Check if any of the parameters that require a cluster modification after creation are set clusterUpdate := false @@ -261,6 +290,7 @@ func resourceAwsNeptuneClusterCreate(d *schema.ResourceData, meta interface{}) e Engine: aws.String(d.Get("engine").(string)), Port: aws.Int64(int64(d.Get("port").(int))), StorageEncrypted: aws.Bool(d.Get("storage_encrypted").(bool)), + DeletionProtection: aws.Bool(d.Get("deletion_protection").(bool)), Tags: tags, } restoreDBClusterFromSnapshotInput := &neptune.RestoreDBClusterFromSnapshotInput{ @@ -268,6 +298,7 @@ func resourceAwsNeptuneClusterCreate(d *schema.ResourceData, meta interface{}) e Engine: aws.String(d.Get("engine").(string)), Port: aws.Int64(int64(d.Get("port").(int))), SnapshotIdentifier: aws.String(d.Get("snapshot_identifier").(string)), + DeletionProtection: aws.Bool(d.Get("deletion_protection").(bool)), Tags: tags, } @@ -283,6 +314,11 @@ func resourceAwsNeptuneClusterCreate(d *schema.ResourceData, meta interface{}) e } } + if attr := d.Get("enable_cloudwatch_logs_exports").(*schema.Set); attr.Len() > 0 { + createDbClusterInput.EnableCloudwatchLogsExports = expandStringList(attr.List()) + restoreDBClusterFromSnapshotInput.EnableCloudwatchLogsExports = expandStringList(attr.List()) + } + if attr, ok := d.GetOk("engine_version"); ok { createDbClusterInput.EngineVersion = aws.String(attr.(string)) restoreDBClusterFromSnapshotInput.EngineVersion = aws.String(attr.(string)) @@ -441,6 +477,11 @@ func flattenAwsNeptuneClusterResource(d *schema.ResourceData, meta interface{}, d.Set("backup_retention_period", dbc.BackupRetentionPeriod) d.Set("cluster_identifier", dbc.DBClusterIdentifier) d.Set("cluster_resource_id", dbc.DbClusterResourceId) + + if err := d.Set("enable_cloudwatch_logs_exports", aws.StringValueSlice(dbc.EnabledCloudwatchLogsExports)); err != nil { + return fmt.Errorf("Error saving EnableCloudwatchLogsExports to state for Neptune Cluster (%s): %s", d.Id(), err) + } + d.Set("endpoint", dbc.Endpoint) d.Set("engine_version", dbc.EngineVersion) d.Set("engine", dbc.Engine) @@ -455,6 +496,7 @@ func flattenAwsNeptuneClusterResource(d *schema.ResourceData, meta interface{}, d.Set("reader_endpoint", dbc.ReaderEndpoint) d.Set("replication_source_identifier", dbc.ReplicationSourceIdentifier) d.Set("storage_encrypted", dbc.StorageEncrypted) + d.Set("deletion_protection", dbc.DeletionProtection) var sg []string for _, g := range dbc.VpcSecurityGroups { @@ -484,8 +526,14 @@ func flattenAwsNeptuneClusterResource(d *schema.ResourceData, meta interface{}, arn := aws.StringValue(dbc.DBClusterArn) d.Set("arn", arn) - if err := saveTagsNeptune(conn, d, arn); err != nil { - return fmt.Errorf("Failed to save tags for Neptune Cluster (%s): %s", aws.StringValue(dbc.DBClusterIdentifier), err) + tags, err := keyvaluetags.NeptuneListTags(conn, d.Get("arn").(string)) + + if err != nil { + return fmt.Errorf("error listing tags for Neptune Cluster (%s): %s", d.Get("arn").(string), err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -509,6 +557,27 @@ func resourceAwsNeptuneClusterUpdate(d *schema.ResourceData, meta interface{}) e requestUpdate = true } + if d.HasChange("enable_cloudwatch_logs_exports") { + logs := &neptune.CloudwatchLogsExportConfiguration{} + + old, new := d.GetChange("enable_cloudwatch_logs_exports") + + disableLogTypes := old.(*schema.Set).Difference(new.(*schema.Set)) + + if disableLogTypes.Len() > 0 { + logs.SetDisableLogTypes(expandStringList(disableLogTypes.List())) + } + + enableLogTypes := new.(*schema.Set).Difference(old.(*schema.Set)) + + if enableLogTypes.Len() > 0 { + logs.SetEnableLogTypes(expandStringList(enableLogTypes.List())) + } + + req.CloudwatchLogsExportConfiguration = logs + requestUpdate = true + } + if d.HasChange("preferred_backup_window") { req.PreferredBackupWindow = aws.String(d.Get("preferred_backup_window").(string)) requestUpdate = true @@ -534,6 +603,10 @@ func resourceAwsNeptuneClusterUpdate(d *schema.ResourceData, meta interface{}) e req.EnableIAMDatabaseAuthentication = aws.Bool(d.Get("iam_database_authentication_enabled").(bool)) requestUpdate = true } + if d.HasChange("deletion_protection") { + req.DeletionProtection = aws.Bool(d.Get("deletion_protection").(bool)) + requestUpdate = true + } if requestUpdate { err := resource.Retry(5*time.Minute, func() *resource.RetryError { @@ -601,12 +674,14 @@ func resourceAwsNeptuneClusterUpdate(d *schema.ResourceData, meta interface{}) e } } - if arn, ok := d.GetOk("arn"); ok { - if err := setTagsNeptune(conn, d, arn.(string)); err != nil { - return err - } else { - d.SetPartial("tags") + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.NeptuneUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating Neptune Cluster (%s) tags: %s", d.Get("arn").(string), err) } + + d.SetPartial("tags") } return resourceAwsNeptuneClusterRead(d, meta) diff --git a/aws/resource_aws_neptune_cluster_instance.go b/aws/resource_aws_neptune_cluster_instance.go index 3e655d6b28c..0db3d20cc49 100644 --- a/aws/resource_aws_neptune_cluster_instance.go +++ b/aws/resource_aws_neptune_cluster_instance.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/service/neptune" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsNeptuneClusterInstance() *schema.Resource { @@ -187,7 +188,7 @@ func resourceAwsNeptuneClusterInstance() *schema.Resource { func resourceAwsNeptuneClusterInstanceCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).neptuneconn - tags := tagsFromMapNeptune(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().NeptuneTags() createOpts := &neptune.CreateDBInstanceInput{ DBInstanceClass: aws.String(d.Get("instance_class").(string)), @@ -347,8 +348,14 @@ func resourceAwsNeptuneClusterInstanceRead(d *schema.ResourceData, meta interfac d.Set("neptune_parameter_group_name", db.DBParameterGroups[0].DBParameterGroupName) } - if err := saveTagsNeptune(conn, d, aws.StringValue(db.DBInstanceArn)); err != nil { - return fmt.Errorf("Failed to save tags for Neptune Cluster Instance (%s): %s", aws.StringValue(db.DBInstanceIdentifier), err) + tags, err := keyvaluetags.NeptuneListTags(conn, d.Get("arn").(string)) + + if err != nil { + return fmt.Errorf("error listing tags for Neptune Cluster Instance (%s): %s", d.Get("arn").(string), err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -434,8 +441,14 @@ func resourceAwsNeptuneClusterInstanceUpdate(d *schema.ResourceData, meta interf } - if err := setTagsNeptune(conn, d, d.Get("arn").(string)); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.NeptuneUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating Neptune Cluster Instance (%s) tags: %s", d.Get("arn").(string), err) + } + + d.SetPartial("tags") } return resourceAwsNeptuneClusterInstanceRead(d, meta) diff --git a/aws/resource_aws_neptune_cluster_parameter_group.go b/aws/resource_aws_neptune_cluster_parameter_group.go index 29615405ebc..bc03251088e 100644 --- a/aws/resource_aws_neptune_cluster_parameter_group.go +++ b/aws/resource_aws_neptune_cluster_parameter_group.go @@ -6,10 +6,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/neptune" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) const neptuneClusterParameterGroupMaxParamsBulkEdit = 20 @@ -89,7 +89,7 @@ func resourceAwsNeptuneClusterParameterGroup() *schema.Resource { func resourceAwsNeptuneClusterParameterGroupCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).neptuneconn - tags := tagsFromMapNeptune(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().NeptuneTags() var groupName string if v, ok := d.GetOk("name"); ok { @@ -166,15 +166,14 @@ func resourceAwsNeptuneClusterParameterGroupRead(d *schema.ResourceData, meta in return fmt.Errorf("error setting neptune parameter: %s", err) } - resp, err := conn.ListTagsForResource(&neptune.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) + tags, err := keyvaluetags.NeptuneListTags(conn, d.Get("arn").(string)) + if err != nil { - log.Printf("[DEBUG] Error retrieving tags for ARN: %s", arn) + return fmt.Errorf("error listing tags for Neptune Cluster Parameter Group (%s): %s", d.Get("arn").(string), err) } - if err := d.Set("tags", tagsToMapNeptune(resp.TagList)); err != nil { - return fmt.Errorf("error setting neptune tags: %s", err) + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -228,10 +227,13 @@ func resourceAwsNeptuneClusterParameterGroupUpdate(d *schema.ResourceData, meta } } - arn := d.Get("arn").(string) - if err := setTagsNeptune(conn, d, arn); err != nil { - return err - } else { + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.NeptuneUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating Neptune Cluster Parameter Group (%s) tags: %s", d.Get("arn").(string), err) + } + d.SetPartial("tags") } diff --git a/aws/resource_aws_neptune_cluster_test.go b/aws/resource_aws_neptune_cluster_test.go index 09ebe9501f4..ef19fd7aca3 100644 --- a/aws/resource_aws_neptune_cluster_test.go +++ b/aws/resource_aws_neptune_cluster_test.go @@ -7,19 +7,18 @@ import ( "regexp" "testing" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/neptune" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/terraform" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/neptune" ) func TestAccAWSNeptuneCluster_basic(t *testing.T) { var dbCluster neptune.DBCluster - rInt := acctest.RandInt() - resourceName := "aws_neptune_cluster.default" + rName := acctest.RandomWithPrefix("tf-acc") + resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -27,9 +26,10 @@ func TestAccAWSNeptuneCluster_basic(t *testing.T) { CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSNeptuneClusterConfig(rInt), + Config: testAccAWSNeptuneClusterConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSNeptuneClusterExists(resourceName, &dbCluster), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "rds", regexp.MustCompile(`cluster:.+`)), resource.TestCheckResourceAttr(resourceName, "storage_encrypted", "false"), resource.TestCheckResourceAttr(resourceName, "neptune_cluster_parameter_group_name", "default.neptune1"), resource.TestCheckResourceAttrSet(resourceName, "reader_endpoint"), @@ -37,6 +37,8 @@ func TestAccAWSNeptuneCluster_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "engine", "neptune"), resource.TestCheckResourceAttrSet(resourceName, "engine_version"), resource.TestCheckResourceAttrSet(resourceName, "hosted_zone_id"), + resource.TestCheckResourceAttr(resourceName, "tags.#", "0"), + resource.TestCheckResourceAttr(resourceName, "deletion_protection", "false"), ), }, { @@ -56,6 +58,8 @@ func TestAccAWSNeptuneCluster_basic(t *testing.T) { func TestAccAWSNeptuneCluster_namePrefix(t *testing.T) { var v neptune.DBCluster + rName := "tf-test-" + resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -63,15 +67,14 @@ func TestAccAWSNeptuneCluster_namePrefix(t *testing.T) { CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSNeptuneClusterConfig_namePrefix(), + Config: testAccAWSNeptuneClusterConfig_namePrefix(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSNeptuneClusterExists("aws_neptune_cluster.test", &v), - resource.TestMatchResourceAttr( - "aws_neptune_cluster.test", "cluster_identifier", regexp.MustCompile("^tf-test-")), + testAccCheckAWSNeptuneClusterExists(resourceName, &v), + resource.TestMatchResourceAttr(resourceName, "cluster_identifier", regexp.MustCompile("^tf-test-")), ), }, { - ResourceName: "aws_neptune_cluster.test", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -87,21 +90,22 @@ func TestAccAWSNeptuneCluster_namePrefix(t *testing.T) { func TestAccAWSNeptuneCluster_takeFinalSnapshot(t *testing.T) { var v neptune.DBCluster - rInt := acctest.RandInt() + rName := acctest.RandomWithPrefix("tf-acc") + resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, - CheckDestroy: testAccCheckAWSNeptuneClusterSnapshot(rInt), + CheckDestroy: testAccCheckAWSNeptuneClusterSnapshot(rName), Steps: []resource.TestStep{ { - Config: testAccAWSNeptuneClusterConfigWithFinalSnapshot(rInt), + Config: testAccAWSNeptuneClusterConfigWithFinalSnapshot(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSNeptuneClusterExists("aws_neptune_cluster.default", &v), + testAccCheckAWSNeptuneClusterExists(resourceName, &v), ), }, { - ResourceName: "aws_neptune_cluster.default", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -115,9 +119,10 @@ func TestAccAWSNeptuneCluster_takeFinalSnapshot(t *testing.T) { }) } -func TestAccAWSNeptuneCluster_updateTags(t *testing.T) { +func TestAccAWSNeptuneCluster_tags(t *testing.T) { var v neptune.DBCluster - ri := acctest.RandInt() + rName := acctest.RandomWithPrefix("tf-acc") + resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -125,23 +130,15 @@ func TestAccAWSNeptuneCluster_updateTags(t *testing.T) { CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSNeptuneClusterConfig(ri), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSNeptuneClusterExists("aws_neptune_cluster.default", &v), - resource.TestCheckResourceAttr( - "aws_neptune_cluster.default", "tags.%", "1"), - ), - }, - { - Config: testAccAWSNeptuneClusterConfigUpdatedTags(ri), + Config: testAccAWSNeptuneClusterConfigTags1(rName, "key1", "value1"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSNeptuneClusterExists("aws_neptune_cluster.default", &v), - resource.TestCheckResourceAttr( - "aws_neptune_cluster.default", "tags.%", "2"), + testAccCheckAWSNeptuneClusterExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), }, { - ResourceName: "aws_neptune_cluster.default", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -151,13 +148,31 @@ func TestAccAWSNeptuneCluster_updateTags(t *testing.T) { "skip_final_snapshot", }, }, + { + Config: testAccAWSNeptuneClusterConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSNeptuneClusterExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSNeptuneClusterConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSNeptuneClusterExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, }, }) } func TestAccAWSNeptuneCluster_updateIamRoles(t *testing.T) { var v neptune.DBCluster - ri := acctest.RandInt() + rName := acctest.RandomWithPrefix("tf-acc") + resourceName := "aws_neptune_cluster.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -165,29 +180,27 @@ func TestAccAWSNeptuneCluster_updateIamRoles(t *testing.T) { CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSNeptuneClusterConfigIncludingIamRoles(ri), + Config: testAccAWSNeptuneClusterConfigIncludingIamRoles(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSNeptuneClusterExists("aws_neptune_cluster.default", &v), + testAccCheckAWSNeptuneClusterExists(resourceName, &v), ), }, { - Config: testAccAWSNeptuneClusterConfigAddIamRoles(ri), + Config: testAccAWSNeptuneClusterConfigAddIamRoles(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSNeptuneClusterExists("aws_neptune_cluster.default", &v), - resource.TestCheckResourceAttr( - "aws_neptune_cluster.default", "iam_roles.#", "2"), + testAccCheckAWSNeptuneClusterExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "iam_roles.#", "2"), ), }, { - Config: testAccAWSNeptuneClusterConfigRemoveIamRoles(ri), + Config: testAccAWSNeptuneClusterConfigRemoveIamRoles(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSNeptuneClusterExists("aws_neptune_cluster.default", &v), - resource.TestCheckResourceAttr( - "aws_neptune_cluster.default", "iam_roles.#", "1"), + testAccCheckAWSNeptuneClusterExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "iam_roles.#", "1"), ), }, { - ResourceName: "aws_neptune_cluster.default", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -203,7 +216,9 @@ func TestAccAWSNeptuneCluster_updateIamRoles(t *testing.T) { func TestAccAWSNeptuneCluster_kmsKey(t *testing.T) { var v neptune.DBCluster - keyRegex := regexp.MustCompile("^arn:aws:kms:") + resourceName := "aws_neptune_cluster.test" + keyResourceName := "aws_kms_key.test" + rName := acctest.RandomWithPrefix("tf-acc") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -211,15 +226,14 @@ func TestAccAWSNeptuneCluster_kmsKey(t *testing.T) { CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSNeptuneClusterConfig_kmsKey(acctest.RandInt()), + Config: testAccAWSNeptuneClusterConfig_kmsKey(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSNeptuneClusterExists("aws_neptune_cluster.default", &v), - resource.TestMatchResourceAttr( - "aws_neptune_cluster.default", "kms_key_arn", keyRegex), + testAccCheckAWSNeptuneClusterExists(resourceName, &v), + resource.TestCheckResourceAttrPair(resourceName, "kms_key_arn", keyResourceName, "arn"), ), }, { - ResourceName: "aws_neptune_cluster.default", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -235,6 +249,8 @@ func TestAccAWSNeptuneCluster_kmsKey(t *testing.T) { func TestAccAWSNeptuneCluster_encrypted(t *testing.T) { var v neptune.DBCluster + resourceName := "aws_neptune_cluster.test" + rName := acctest.RandomWithPrefix("tf-acc") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -242,15 +258,14 @@ func TestAccAWSNeptuneCluster_encrypted(t *testing.T) { CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSNeptuneClusterConfig_encrypted(acctest.RandInt()), + Config: testAccAWSNeptuneClusterConfig_encrypted(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSNeptuneClusterExists("aws_neptune_cluster.default", &v), - resource.TestCheckResourceAttr( - "aws_neptune_cluster.default", "storage_encrypted", "true"), + testAccCheckAWSNeptuneClusterExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "storage_encrypted", "true"), ), }, { - ResourceName: "aws_neptune_cluster.default", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -266,39 +281,34 @@ func TestAccAWSNeptuneCluster_encrypted(t *testing.T) { func TestAccAWSNeptuneCluster_backupsUpdate(t *testing.T) { var v neptune.DBCluster + resourceName := "aws_neptune_cluster.test" + rName := acctest.RandomWithPrefix("tf-acc") - ri := acctest.RandInt() resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSNeptuneClusterConfig_backups(ri), + Config: testAccAWSNeptuneClusterConfig_backups(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSNeptuneClusterExists("aws_neptune_cluster.default", &v), - resource.TestCheckResourceAttr( - "aws_neptune_cluster.default", "preferred_backup_window", "07:00-09:00"), - resource.TestCheckResourceAttr( - "aws_neptune_cluster.default", "backup_retention_period", "5"), - resource.TestCheckResourceAttr( - "aws_neptune_cluster.default", "preferred_maintenance_window", "tue:04:00-tue:04:30"), + testAccCheckAWSNeptuneClusterExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "preferred_backup_window", "07:00-09:00"), + resource.TestCheckResourceAttr(resourceName, "backup_retention_period", "5"), + resource.TestCheckResourceAttr(resourceName, "preferred_maintenance_window", "tue:04:00-tue:04:30"), ), }, { - Config: testAccAWSNeptuneClusterConfig_backupsUpdate(ri), + Config: testAccAWSNeptuneClusterConfig_backupsUpdate(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSNeptuneClusterExists("aws_neptune_cluster.default", &v), - resource.TestCheckResourceAttr( - "aws_neptune_cluster.default", "preferred_backup_window", "03:00-09:00"), - resource.TestCheckResourceAttr( - "aws_neptune_cluster.default", "backup_retention_period", "10"), - resource.TestCheckResourceAttr( - "aws_neptune_cluster.default", "preferred_maintenance_window", "wed:01:00-wed:01:30"), + testAccCheckAWSNeptuneClusterExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "preferred_backup_window", "03:00-09:00"), + resource.TestCheckResourceAttr(resourceName, "backup_retention_period", "10"), + resource.TestCheckResourceAttr(resourceName, "preferred_maintenance_window", "wed:01:00-wed:01:30"), ), }, { - ResourceName: "aws_neptune_cluster.default", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -314,6 +324,8 @@ func TestAccAWSNeptuneCluster_backupsUpdate(t *testing.T) { func TestAccAWSNeptuneCluster_iamAuth(t *testing.T) { var v neptune.DBCluster + resourceName := "aws_neptune_cluster.test" + rName := acctest.RandomWithPrefix("tf-acc") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -321,15 +333,14 @@ func TestAccAWSNeptuneCluster_iamAuth(t *testing.T) { CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSNeptuneClusterConfig_iamAuth(acctest.RandInt()), + Config: testAccAWSNeptuneClusterConfig_iamAuth(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSNeptuneClusterExists("aws_neptune_cluster.default", &v), - resource.TestCheckResourceAttr( - "aws_neptune_cluster.default", "iam_database_authentication_enabled", "true"), + testAccCheckAWSNeptuneClusterExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "iam_database_authentication_enabled", "true"), ), }, { - ResourceName: "aws_neptune_cluster.default", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -343,6 +354,99 @@ func TestAccAWSNeptuneCluster_iamAuth(t *testing.T) { }) } +func TestAccAWSNeptuneCluster_updateCloudwatchLogsExports(t *testing.T) { + var dbCluster neptune.DBCluster + rName := acctest.RandomWithPrefix("tf-acc") + resourceName := "aws_neptune_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSNeptuneClusterConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSNeptuneClusterExists(resourceName, &dbCluster), + resource.TestCheckNoResourceAttr(resourceName, "enable_cloudwatch_logs_exports.#"), + ), + }, + { + Config: testAccAWSNeptuneClusterConfig_cloudwatchLogsExports(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSNeptuneClusterExists(resourceName, &dbCluster), + resource.TestCheckResourceAttr(resourceName, "enable_cloudwatch_logs_exports.#", "1"), + resource.TestCheckResourceAttr(resourceName, "enable_cloudwatch_logs_exports.2451111801", "audit"), + ), + }, + { + Config: testAccAWSNeptuneClusterConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSNeptuneClusterExists(resourceName, &dbCluster), + resource.TestCheckResourceAttr(resourceName, "enable_cloudwatch_logs_exports.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "apply_immediately", + "cluster_identifier_prefix", + "final_snapshot_identifier", + "skip_final_snapshot", + }, + }, + }, + }) +} + +func TestAccAWSNeptuneCluster_deleteProtection(t *testing.T) { + var dbCluster neptune.DBCluster + rName := acctest.RandomWithPrefix("tf-acc") + resourceName := "aws_neptune_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSNeptuneClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSNeptuneClusterConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSNeptuneClusterExists(resourceName, &dbCluster), + resource.TestCheckResourceAttr(resourceName, "deletion_protection", "false"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "apply_immediately", + "cluster_identifier_prefix", + "final_snapshot_identifier", + "skip_final_snapshot", + }, + }, + { + Config: testAccAWSNeptuneClusterConfigDeleteProtection(rName, true), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSNeptuneClusterExists(resourceName, &dbCluster), + resource.TestCheckResourceAttr(resourceName, "deletion_protection", "true"), + ), + }, + { + Config: testAccAWSNeptuneClusterConfigDeleteProtection(rName, false), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSNeptuneClusterExists(resourceName, &dbCluster), + resource.TestCheckResourceAttr(resourceName, "deletion_protection", "false"), + ), + }, + }, + }) +} + func testAccCheckAWSNeptuneClusterDestroy(s *terraform.State) error { return testAccCheckAWSNeptuneClusterDestroyWithProvider(s, testAccProvider) } @@ -418,23 +522,20 @@ func testAccCheckAWSNeptuneClusterExistsWithProvider(n string, v *neptune.DBClus } } -func testAccCheckAWSNeptuneClusterSnapshot(rInt int) resource.TestCheckFunc { +func testAccCheckAWSNeptuneClusterSnapshot(rName string) resource.TestCheckFunc { return func(s *terraform.State) error { for _, rs := range s.RootModule().Resources { if rs.Type != "aws_neptune_cluster" { continue } - // Try and delete the snapshot before we check for the cluster not found - snapshot_identifier := fmt.Sprintf("tf-acctest-neptunecluster-snapshot-%d", rInt) - awsClient := testAccProvider.Meta().(*AWSClient) conn := awsClient.neptuneconn - log.Printf("[INFO] Deleting the Snapshot %s", snapshot_identifier) + log.Printf("[INFO] Deleting the Snapshot %s", rName) _, snapDeleteErr := conn.DeleteDBClusterSnapshot( &neptune.DeleteDBClusterSnapshotInput{ - DBClusterSnapshotIdentifier: aws.String(snapshot_identifier), + DBClusterSnapshotIdentifier: aws.String(rName), }) if snapDeleteErr != nil { return snapDeleteErr @@ -468,68 +569,96 @@ func testAccCheckAWSNeptuneClusterSnapshot(rInt int) resource.TestCheckFunc { } } -func testAccAWSNeptuneClusterConfig(n int) string { - return fmt.Sprintf(` -resource "aws_neptune_cluster" "default" { - cluster_identifier = "tf-neptune-cluster-%d" - availability_zones = ["us-west-2a", "us-west-2b", "us-west-2c"] +var testAccAWSNeptuneClusterConfigBase = ` +data "aws_availability_zones" "test" { + state = "available" +} +` + +func testAccAWSNeptuneClusterConfig(rName string) string { + return testAccAWSNeptuneClusterConfigBase + fmt.Sprintf(` +resource "aws_neptune_cluster" "test" { + cluster_identifier = %q + availability_zones = "${slice(data.aws_availability_zones.test.names,0,3)}" engine = "neptune" neptune_cluster_parameter_group_name = "default.neptune1" skip_final_snapshot = true +} +`, rName) +} - tags = { - Environment = "production" - } +func testAccAWSNeptuneClusterConfigDeleteProtection(rName string, isProtected bool) string { + return testAccAWSNeptuneClusterConfigBase + fmt.Sprintf(` +resource "aws_neptune_cluster" "test" { + cluster_identifier = %q + availability_zones = "${slice(data.aws_availability_zones.test.names,0,3)}" + engine = "neptune" + neptune_cluster_parameter_group_name = "default.neptune1" + skip_final_snapshot = true + deletion_protection = %t } -`, n) +`, rName, isProtected) } -func testAccAWSNeptuneClusterConfig_namePrefix() string { +func testAccAWSNeptuneClusterConfig_namePrefix(rName string) string { return fmt.Sprintf(` resource "aws_neptune_cluster" "test" { - cluster_identifier_prefix = "tf-test-" + cluster_identifier_prefix = %q engine = "neptune" neptune_cluster_parameter_group_name = "default.neptune1" skip_final_snapshot = true } -`) +`, rName) } -func testAccAWSNeptuneClusterConfigWithFinalSnapshot(n int) string { - return fmt.Sprintf(` -resource "aws_neptune_cluster" "default" { - cluster_identifier = "tf-neptune-cluster-%d" - availability_zones = ["us-west-2a", "us-west-2b", "us-west-2c"] +func testAccAWSNeptuneClusterConfigWithFinalSnapshot(rName string) string { + return testAccAWSNeptuneClusterConfigBase + fmt.Sprintf(` +resource "aws_neptune_cluster" "test" { + cluster_identifier = %[1]q + availability_zones = "${slice(data.aws_availability_zones.test.names,0,3)}" + neptune_cluster_parameter_group_name = "default.neptune1" + final_snapshot_identifier = %[1]q +} +`, rName) +} + +func testAccAWSNeptuneClusterConfigTags1(rName, tagKey1, tagValue1 string) string { + return testAccAWSNeptuneClusterConfigBase + fmt.Sprintf(` +resource "aws_neptune_cluster" "test" { + cluster_identifier = %[1]q + availability_zones = "${slice(data.aws_availability_zones.test.names,0,3)}" + engine = "neptune" neptune_cluster_parameter_group_name = "default.neptune1" - final_snapshot_identifier = "tf-acctest-neptunecluster-snapshot-%d" + skip_final_snapshot = true tags = { - Environment = "production" + %[2]q = %[3]q } } -`, n, n) +`, rName, tagKey1, tagValue1) } -func testAccAWSNeptuneClusterConfigUpdatedTags(n int) string { - return fmt.Sprintf(` -resource "aws_neptune_cluster" "default" { - cluster_identifier = "tf-neptune-cluster-%d" - availability_zones = ["us-west-2a", "us-west-2b", "us-west-2c"] +func testAccAWSNeptuneClusterConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccAWSNeptuneClusterConfigBase + fmt.Sprintf(` +resource "aws_neptune_cluster" "test" { + cluster_identifier = %[1]q + availability_zones = "${slice(data.aws_availability_zones.test.names,0,3)}" + engine = "neptune" neptune_cluster_parameter_group_name = "default.neptune1" skip_final_snapshot = true tags = { - Environment = "production" - AnotherTag = "test" + %[2]q = %[3]q + %[4]q = %[5]q } } -`, n) +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) } -func testAccAWSNeptuneClusterConfigIncludingIamRoles(n int) string { - return fmt.Sprintf(` -resource "aws_iam_role" "neptune_sample_role" { - name = "neptune_sample_role_%d" +func testAccAWSNeptuneClusterConfigIncludingIamRoles(rName string) string { + return testAccAWSNeptuneClusterConfigBase + fmt.Sprintf(` +resource "aws_iam_role" "test" { + name = %[1]q path = "/" assume_role_policy = < 0 { - input := &organizations.TagResourceInput{ - ResourceId: aws.String(d.Id()), - Tags: tags, - } - - log.Printf("[DEBUG] Adding Organizations Account (%s) tags: %s", d.Id(), input) - - if _, err := conn.TagResource(input); err != nil { - return fmt.Errorf("error updating Organizations Account (%s) tags: %s", d.Id(), err) + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + if err := keyvaluetags.OrganizationsUpdateTags(conn, d.Id(), nil, v); err != nil { + return fmt.Errorf("error adding AWS Organizations Account (%s) tags: %s", d.Id(), err) } } @@ -208,29 +202,21 @@ func resourceAwsOrganizationsAccountRead(d *schema.ResourceData, meta interface{ return fmt.Errorf("error getting AWS Organizations Account (%s) parent: %s", d.Id(), err) } - tagsInput := &organizations.ListTagsForResourceInput{ - ResourceId: aws.String(d.Id()), - } - - tagsOutput, err := conn.ListTagsForResource(tagsInput) - - if err != nil { - return fmt.Errorf("error reading Organizations Account (%s) tags: %s", d.Id(), err) - } - - if tagsOutput == nil { - return fmt.Errorf("error reading Organizations Account (%s) tags: empty result", d.Id()) - } - d.Set("arn", account.Arn) d.Set("email", account.Email) d.Set("joined_method", account.JoinedMethod) - d.Set("joined_timestamp", account.JoinedTimestamp) + d.Set("joined_timestamp", aws.TimeValue(account.JoinedTimestamp).Format(time.RFC3339)) d.Set("name", account.Name) d.Set("parent_id", parentId) d.Set("status", account.Status) - if err := d.Set("tags", tagsToMapOrganizations(tagsOutput.Tags)); err != nil { + tags, err := keyvaluetags.OrganizationsListTags(conn, d.Id()) + + if err != nil { + return fmt.Errorf("error listing tags for AWS Organizations Account (%s): %s", d.Id(), err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -255,35 +241,10 @@ func resourceAwsOrganizationsAccountUpdate(d *schema.ResourceData, meta interfac } if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsOrganizations(tagsFromMapOrganizations(o), tagsFromMapOrganizations(n)) - - // Set tags - if len(remove) > 0 { - input := &organizations.UntagResourceInput{ - ResourceId: aws.String(d.Id()), - TagKeys: remove, - } - - log.Printf("[DEBUG] Removing Organizations Account (%s) tags: %s", d.Id(), input) + o, n := d.GetChange("tags") - if _, err := conn.UntagResource(input); err != nil { - return fmt.Errorf("error removing Organizations Account (%s) tags: %s", d.Id(), err) - } - } - if len(create) > 0 { - input := &organizations.TagResourceInput{ - ResourceId: aws.String(d.Id()), - Tags: create, - } - - log.Printf("[DEBUG] Adding Organizations Account (%s) tags: %s", d.Id(), input) - - if _, err := conn.TagResource(input); err != nil { - return fmt.Errorf("error updating Organizations Account (%s) tags: %s", d.Id(), err) - } + if err := keyvaluetags.OrganizationsUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating AWS Organizations Account (%s) tags: %s", d.Id(), err) } } diff --git a/aws/resource_aws_organizations_account_test.go b/aws/resource_aws_organizations_account_test.go index e78c8f24406..3555e38b267 100644 --- a/aws/resource_aws_organizations_account_test.go +++ b/aws/resource_aws_organizations_account_test.go @@ -37,7 +37,7 @@ func testAccAwsOrganizationsAccount_basic(t *testing.T) { testAccCheckAwsOrganizationsAccountExists("aws_organizations_account.test", &account), resource.TestCheckResourceAttrSet("aws_organizations_account.test", "arn"), resource.TestCheckResourceAttrSet("aws_organizations_account.test", "joined_method"), - resource.TestCheckResourceAttrSet("aws_organizations_account.test", "joined_timestamp"), + testAccCheckResourceAttrRfc3339("aws_organizations_account.test", "joined_timestamp"), resource.TestCheckResourceAttrSet("aws_organizations_account.test", "parent_id"), resource.TestCheckResourceAttr("aws_organizations_account.test", "name", name), resource.TestCheckResourceAttr("aws_organizations_account.test", "email", email), diff --git a/aws/resource_aws_organizations_organization.go b/aws/resource_aws_organizations_organization.go index 6aeff3177d8..41bceff5ed5 100644 --- a/aws/resource_aws_organizations_organization.go +++ b/aws/resource_aws_organizations_organization.go @@ -67,6 +67,10 @@ func resourceAwsOrganizationsOrganization() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "status": { + Type: schema.TypeString, + Computed: true, + }, }, }, }, @@ -91,6 +95,10 @@ func resourceAwsOrganizationsOrganization() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "status": { + Type: schema.TypeString, + Computed: true, + }, }, }, }, @@ -137,6 +145,7 @@ func resourceAwsOrganizationsOrganization() *schema.Resource { Type: schema.TypeString, ValidateFunc: validation.StringInSlice([]string{ organizations.PolicyTypeServiceControlPolicy, + organizations.PolicyTypeTagPolicy, }, false), }, }, @@ -412,10 +421,11 @@ func flattenOrganizationsAccounts(accounts []*organizations.Account) []map[strin var result []map[string]interface{} for _, account := range accounts { result = append(result, map[string]interface{}{ - "arn": aws.StringValue(account.Arn), - "email": aws.StringValue(account.Email), - "id": aws.StringValue(account.Id), - "name": aws.StringValue(account.Name), + "arn": aws.StringValue(account.Arn), + "email": aws.StringValue(account.Email), + "id": aws.StringValue(account.Id), + "name": aws.StringValue(account.Name), + "status": aws.StringValue(account.Status), }) } return result diff --git a/aws/resource_aws_organizations_organization_test.go b/aws/resource_aws_organizations_organization_test.go index b2321ad613b..c081ec29be2 100644 --- a/aws/resource_aws_organizations_organization_test.go +++ b/aws/resource_aws_organizations_organization_test.go @@ -129,6 +129,33 @@ func testAccAwsOrganizationsOrganization_EnabledPolicyTypes(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.#", "1"), ), }, + + { + Config: testAccAwsOrganizationsOrganizationConfigEnabledPolicyTypes1(organizations.PolicyTypeTagPolicy), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsOrganizationsOrganizationExists(resourceName, &organization), + resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.#", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAwsOrganizationsOrganizationConfig, + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsOrganizationsOrganizationExists(resourceName, &organization), + resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.#", "0"), + ), + }, + { + Config: testAccAwsOrganizationsOrganizationConfigEnabledPolicyTypes1(organizations.PolicyTypeTagPolicy), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsOrganizationsOrganizationExists(resourceName, &organization), + resource.TestCheckResourceAttr(resourceName, "enabled_policy_types.#", "1"), + ), + }, }, }) } diff --git a/aws/resource_aws_organizations_policy.go b/aws/resource_aws_organizations_policy.go index c0d3b0ea34f..739a7448a7a 100644 --- a/aws/resource_aws_organizations_policy.go +++ b/aws/resource_aws_organizations_policy.go @@ -48,6 +48,7 @@ func resourceAwsOrganizationsPolicy() *schema.Resource { Default: organizations.PolicyTypeServiceControlPolicy, ValidateFunc: validation.StringInSlice([]string{ organizations.PolicyTypeServiceControlPolicy, + organizations.PolicyTypeTagPolicy, }, false), }, }, diff --git a/aws/resource_aws_organizations_policy_attachment.go b/aws/resource_aws_organizations_policy_attachment.go index c2a47540d1b..8834511ec5c 100644 --- a/aws/resource_aws_organizations_policy_attachment.go +++ b/aws/resource_aws_organizations_policy_attachment.go @@ -84,16 +84,16 @@ func resourceAwsOrganizationsPolicyAttachmentRead(d *schema.ResourceData, meta i return err } - input := &organizations.ListPoliciesForTargetInput{ - Filter: aws.String(organizations.PolicyTypeServiceControlPolicy), - TargetId: aws.String(targetID), + input := &organizations.ListTargetsForPolicyInput{ + PolicyId: aws.String(policyID), } log.Printf("[DEBUG] Listing Organizations Policies for Target: %s", input) - var output *organizations.PolicySummary - err = conn.ListPoliciesForTargetPages(input, func(page *organizations.ListPoliciesForTargetOutput, lastPage bool) bool { - for _, policySummary := range page.Policies { - if aws.StringValue(policySummary.Id) == policyID { + var output *organizations.PolicyTargetSummary + + err = conn.ListTargetsForPolicyPages(input, func(page *organizations.ListTargetsForPolicyOutput, lastPage bool) bool { + for _, policySummary := range page.Targets { + if aws.StringValue(policySummary.TargetId) == targetID { output = policySummary return true } diff --git a/aws/resource_aws_organizations_policy_attachment_test.go b/aws/resource_aws_organizations_policy_attachment_test.go index 51b3df522bc..4db48c1e39b 100644 --- a/aws/resource_aws_organizations_policy_attachment_test.go +++ b/aws/resource_aws_organizations_policy_attachment_test.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "strconv" "testing" "github.com/aws/aws-sdk-go/aws" @@ -18,13 +19,24 @@ func testAccAwsOrganizationsPolicyAttachment_Account(t *testing.T) { policyIdResourceName := "aws_organizations_policy.test" targetIdResourceName := "aws_organizations_organization.test" + serviceControlPolicyContent := `{"Version": "2012-10-17", "Statement": { "Effect": "Allow", "Action": "*", "Resource": "*"}}` + tagPolicyContent := `{ "tags": { "Product": { "tag_key": { "@@assign": "Product" }, "enforced_for": { "@@assign": [ "ec2:instance" ] } } } }` + resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAwsOrganizationsPolicyAttachmentDestroy, Steps: []resource.TestStep{ { - Config: testAccAwsOrganizationsPolicyAttachmentConfig_Account(rName), + Config: testAccAwsOrganizationsPolicyAttachmentConfig_Account(rName, organizations.PolicyTypeServiceControlPolicy, serviceControlPolicyContent), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsOrganizationsPolicyAttachmentExists(resourceName), + resource.TestCheckResourceAttrPair(resourceName, "policy_id", policyIdResourceName, "id"), + resource.TestCheckResourceAttrPair(resourceName, "target_id", targetIdResourceName, "master_account_id"), + ), + }, + { + Config: testAccAwsOrganizationsPolicyAttachmentConfig_Account(rName, organizations.PolicyTypeTagPolicy, tagPolicyContent), Check: resource.ComposeTestCheckFunc( testAccCheckAwsOrganizationsPolicyAttachmentExists(resourceName), resource.TestCheckResourceAttrPair(resourceName, "policy_id", policyIdResourceName, "id"), @@ -163,16 +175,15 @@ func testAccCheckAwsOrganizationsPolicyAttachmentExists(resourceName string) res return err } - input := &organizations.ListPoliciesForTargetInput{ - Filter: aws.String(organizations.PolicyTypeServiceControlPolicy), - TargetId: aws.String(targetID), + input := &organizations.ListTargetsForPolicyInput{ + PolicyId: aws.String(policyID), } log.Printf("[DEBUG] Listing Organizations Policies for Target: %s", input) - var output *organizations.PolicySummary - err = conn.ListPoliciesForTargetPages(input, func(page *organizations.ListPoliciesForTargetOutput, lastPage bool) bool { - for _, policySummary := range page.Policies { - if aws.StringValue(policySummary.Id) == policyID { + var output *organizations.PolicyTargetSummary + err = conn.ListTargetsForPolicyPages(input, func(page *organizations.ListTargetsForPolicyOutput, lastPage bool) bool { + for _, policySummary := range page.Targets { + if aws.StringValue(policySummary.TargetId) == targetID { output = policySummary return true } @@ -192,24 +203,25 @@ func testAccCheckAwsOrganizationsPolicyAttachmentExists(resourceName string) res } } -func testAccAwsOrganizationsPolicyAttachmentConfig_Account(rName string) string { +func testAccAwsOrganizationsPolicyAttachmentConfig_Account(rName, policyType, policyContent string) string { return fmt.Sprintf(` resource "aws_organizations_organization" "test" { - enabled_policy_types = ["SERVICE_CONTROL_POLICY"] + enabled_policy_types = ["SERVICE_CONTROL_POLICY", "TAG_POLICY"] } resource "aws_organizations_policy" "test" { depends_on = ["aws_organizations_organization.test"] - content = "{\"Version\": \"2012-10-17\", \"Statement\": { \"Effect\": \"Allow\", \"Action\": \"*\", \"Resource\": \"*\"}}" name = "%s" + type = "%s" + content = %s } resource "aws_organizations_policy_attachment" "test" { policy_id = "${aws_organizations_policy.test.id}" target_id = "${aws_organizations_organization.test.master_account_id}" } -`, rName) +`, rName, policyType, strconv.Quote(policyContent)) } func testAccAwsOrganizationsPolicyAttachmentConfig_OrganizationalUnit(rName string) string { diff --git a/aws/resource_aws_organizations_policy_test.go b/aws/resource_aws_organizations_policy_test.go index d9879bf9433..e0d8b9d829b 100644 --- a/aws/resource_aws_organizations_policy_test.go +++ b/aws/resource_aws_organizations_policy_test.go @@ -113,6 +113,49 @@ func testAccAwsOrganizationsPolicy_description(t *testing.T) { }) } +func testAccAwsOrganizationsPolicy_type(t *testing.T) { + var policy organizations.Policy + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_organizations_policy.test" + + serviceControlPolicyContent := `{"Version": "2012-10-17", "Statement": { "Effect": "Allow", "Action": "*", "Resource": "*"}}` + tagPolicyContent := `{ "tags": { "Product": { "tag_key": { "@@assign": "Product" }, "enforced_for": { "@@assign": [ "ec2:instance" ] } } } }` + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccOrganizationsAccountPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsOrganizationsPolicyDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsOrganizationsPolicyConfig_Type(rName, serviceControlPolicyContent, organizations.PolicyTypeServiceControlPolicy), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsOrganizationsPolicyExists(resourceName, &policy), + resource.TestCheckResourceAttr(resourceName, "type", organizations.PolicyTypeServiceControlPolicy), + ), + }, + { + Config: testAccAwsOrganizationsPolicyConfig_Type(rName, tagPolicyContent, organizations.PolicyTypeTagPolicy), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsOrganizationsPolicyExists(resourceName, &policy), + resource.TestCheckResourceAttr(resourceName, "type", organizations.PolicyTypeTagPolicy), + ), + }, + { + Config: testAccAwsOrganizationsPolicyConfig_Required(rName, serviceControlPolicyContent), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsOrganizationsPolicyExists(resourceName, &policy), + resource.TestCheckResourceAttr(resourceName, "type", organizations.PolicyTypeServiceControlPolicy), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func testAccCheckAwsOrganizationsPolicyDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).organizationsconn @@ -243,3 +286,17 @@ resource "aws_organizations_policy" "test5" { } `, rName) } + +func testAccAwsOrganizationsPolicyConfig_Type(rName, content, policyType string) string { + return fmt.Sprintf(` +resource "aws_organizations_organization" "test" {} + +resource "aws_organizations_policy" "test" { + content = %s + name = "%s" + type = "%s" + + depends_on = ["aws_organizations_organization.test"] +} +`, strconv.Quote(content), rName, policyType) +} diff --git a/aws/resource_aws_organizations_test.go b/aws/resource_aws_organizations_test.go index 92b32d6a4d9..b2ed655f5e0 100644 --- a/aws/resource_aws_organizations_test.go +++ b/aws/resource_aws_organizations_test.go @@ -22,10 +22,14 @@ func TestAccAWSOrganizations(t *testing.T) { "basic": testAccAwsOrganizationsOrganizationalUnit_basic, "Name": testAccAwsOrganizationsOrganizationalUnit_Name, }, + "OrganizationalUnits": { + "DataSource": testAccDataSourceAwsOrganizationsOrganizationalUnits_basic, + }, "Policy": { "basic": testAccAwsOrganizationsPolicy_basic, "concurrent": testAccAwsOrganizationsPolicy_concurrent, "Description": testAccAwsOrganizationsPolicy_description, + "Type": testAccAwsOrganizationsPolicy_type, }, "PolicyAttachment": { "Account": testAccAwsOrganizationsPolicyAttachment_Account, diff --git a/aws/resource_aws_pinpoint_app.go b/aws/resource_aws_pinpoint_app.go index 5bc65bc5490..17bbf4a5355 100644 --- a/aws/resource_aws_pinpoint_app.go +++ b/aws/resource_aws_pinpoint_app.go @@ -9,6 +9,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsPinpointApp() *schema.Resource { @@ -87,20 +88,24 @@ func resourceAwsPinpointApp() *schema.Resource { Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "daily": { - Type: schema.TypeInt, - Optional: true, + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntBetween(0, 100), }, "maximum_duration": { - Type: schema.TypeInt, - Optional: true, + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntAtLeast(60), }, "messages_per_second": { - Type: schema.TypeInt, - Optional: true, + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntBetween(50, 20000), }, "total": { - Type: schema.TypeInt, - Optional: true, + Type: schema.TypeInt, + Optional: true, + ValidateFunc: validation.IntBetween(0, 100), }, }, }, @@ -158,8 +163,8 @@ func resourceAwsPinpointAppCreate(d *schema.ResourceData, meta interface{}) erro }, } - if v, ok := d.GetOk("tags"); ok { - req.CreateApplicationRequest.Tags = tagsFromMapPinPointApp(v.(map[string]interface{})) + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + req.CreateApplicationRequest.Tags = keyvaluetags.New(v).IgnoreAws().PinpointTags() } output, err := pinpointconn.CreateApp(req) @@ -167,7 +172,7 @@ func resourceAwsPinpointAppCreate(d *schema.ResourceData, meta interface{}) erro return fmt.Errorf("error creating Pinpoint app: %s", err) } - d.SetId(*output.ApplicationResponse.Id) + d.SetId(aws.StringValue(output.ApplicationResponse.Id)) d.Set("arn", output.ApplicationResponse.Arn) return resourceAwsPinpointAppUpdate(d, meta) @@ -204,8 +209,15 @@ func resourceAwsPinpointAppUpdate(d *schema.ResourceData, meta interface{}) erro return err } - if err := setTagsPinPointApp(conn, d); err != nil { - return fmt.Errorf("error updating PinPoint Application (%s) tags: %s", d.Id(), err) + if !d.IsNewResource() { + arn := d.Get("arn").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.PinpointUpdateTags(conn, arn, o, n); err != nil { + return fmt.Errorf("error updating PinPoint Application (%s) tags: %s", arn, err) + } + } } return resourceAwsPinpointAppRead(d, meta) @@ -242,9 +254,10 @@ func resourceAwsPinpointAppRead(d *schema.ResourceData, meta interface{}) error return err } + arn := aws.StringValue(app.ApplicationResponse.Arn) d.Set("name", app.ApplicationResponse.Name) d.Set("application_id", app.ApplicationResponse.Id) - d.Set("arn", app.ApplicationResponse.Arn) + d.Set("arn", arn) if err := d.Set("campaign_hook", flattenPinpointCampaignHook(settings.ApplicationSettingsResource.CampaignHook)); err != nil { return fmt.Errorf("error setting campaign_hook: %s", err) @@ -256,7 +269,13 @@ func resourceAwsPinpointAppRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("error setting quiet_time: %s", err) } - if err := getTagsPinPointApp(conn, d); err != nil { + tags, err := keyvaluetags.PinpointListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for PinPoint Application (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } diff --git a/aws/resource_aws_pinpoint_app_test.go b/aws/resource_aws_pinpoint_app_test.go index a6a7022f6d4..56dadff8961 100644 --- a/aws/resource_aws_pinpoint_app_test.go +++ b/aws/resource_aws_pinpoint_app_test.go @@ -2,27 +2,74 @@ package aws import ( "fmt" - "os" + "log" "testing" - "github.com/aws/aws-sdk-go/service/pinpoint" - "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/pinpoint" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSPinpointApp_basic(t *testing.T) { - oldDefaultRegion := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldDefaultRegion) +func init() { + resource.AddTestSweepers("aws_pinpoint_app", &resource.Sweeper{ + Name: "aws_pinpoint_app", + F: testSweepPinpointApps, + }) +} + +func testSweepPinpointApps(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + conn := client.(*AWSClient).pinpointconn + + input := &pinpoint.GetAppsInput{} + + for { + output, err := conn.GetApps(input) + if err != nil { + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping Pinpoint app sweep for %s: %s", region, err) + return nil + } + return fmt.Errorf("Error retrieving Pinpoint apps: %s", err) + } + + if len(output.ApplicationsResponse.Item) == 0 { + log.Print("[DEBUG] No Pinpoint apps to sweep") + return nil + } + for _, item := range output.ApplicationsResponse.Item { + name := aws.StringValue(item.Name) + + log.Printf("[INFO] Deleting Pinpoint app %s", name) + _, err := conn.DeleteApp(&pinpoint.DeleteAppInput{ + ApplicationId: item.Id, + }) + if err != nil { + return fmt.Errorf("Error deleting Pinpoint app %s: %s", name, err) + } + } + + if output.ApplicationsResponse.NextToken == nil { + break + } + input.Token = output.ApplicationsResponse.NextToken + } + + return nil +} + +func TestAccAWSPinpointApp_basic(t *testing.T) { var application pinpoint.ApplicationResponse - resourceName := "aws_pinpoint_app.test_app" + resourceName := "aws_pinpoint_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccRegionHasServicePreCheck("pinpoint", t) }, IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAppDestroy, @@ -43,23 +90,18 @@ func TestAccAWSPinpointApp_basic(t *testing.T) { } func TestAccAWSPinpointApp_CampaignHookLambda(t *testing.T) { - oldDefaultRegion := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldDefaultRegion) - var application pinpoint.ApplicationResponse - resourceName := "aws_pinpoint_app.test_app" - appName := "terraform-test-pinpointapp-campaignhooklambda" - lambdaName := "test-pinpoint-lambda" + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_pinpoint_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_pinpoint_app.test_app", + PreCheck: func() { testAccPreCheck(t); testAccRegionHasServicePreCheck("pinpoint", t) }, + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAppDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSPinpointAppConfig_CampaignHookLambda(appName, lambdaName), + Config: testAccAWSPinpointAppConfig_CampaignHookLambda(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSPinpointAppExists(resourceName, &application), resource.TestCheckResourceAttr(resourceName, "campaign_hook.#", "1"), @@ -76,25 +118,22 @@ func TestAccAWSPinpointApp_CampaignHookLambda(t *testing.T) { } func TestAccAWSPinpointApp_Limits(t *testing.T) { - oldDefaultRegion := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldDefaultRegion) - var application pinpoint.ApplicationResponse - resourceName := "aws_pinpoint_app.test_app" + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_pinpoint_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_pinpoint_app.test_app", + PreCheck: func() { testAccPreCheck(t); testAccRegionHasServicePreCheck("pinpoint", t) }, + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAppDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSPinpointAppConfig_Limits, + Config: testAccAWSPinpointAppConfig_Limits(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSPinpointAppExists(resourceName, &application), resource.TestCheckResourceAttr(resourceName, "limits.#", "1"), - resource.TestCheckResourceAttr(resourceName, "limits.0.total", "500"), + resource.TestCheckResourceAttr(resourceName, "limits.0.total", "100"), ), }, { @@ -107,21 +146,18 @@ func TestAccAWSPinpointApp_Limits(t *testing.T) { } func TestAccAWSPinpointApp_QuietTime(t *testing.T) { - oldDefaultRegion := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldDefaultRegion) - var application pinpoint.ApplicationResponse - resourceName := "aws_pinpoint_app.test_app" + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_pinpoint_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_pinpoint_app.test_app", + PreCheck: func() { testAccPreCheck(t); testAccRegionHasServicePreCheck("pinpoint", t) }, + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSPinpointAppDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSPinpointAppConfig_QuietTime, + Config: testAccAWSPinpointAppConfig_QuietTime(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSPinpointAppExists(resourceName, &application), resource.TestCheckResourceAttr(resourceName, "quiet_time.#", "1"), @@ -138,21 +174,17 @@ func TestAccAWSPinpointApp_QuietTime(t *testing.T) { } func TestAccAWSPinpointApp_Tags(t *testing.T) { - oldDefaultRegion := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldDefaultRegion) - var application pinpoint.ApplicationResponse - resourceName := "aws_pinpoint_app.test_app" - shareName := fmt.Sprintf("tf-%s", acctest.RandStringFromCharSet(10, acctest.CharSetAlphaNum)) + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_pinpoint_app.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccRegionHasServicePreCheck("pinpoint", t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAwsRamResourceShareDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSPinpointAppConfig_Tag1(shareName, "key1", "value1"), + Config: testAccAWSPinpointAppConfig_Tag1(rName, "key1", "value1"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSPinpointAppExists(resourceName, &application), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -165,7 +197,7 @@ func TestAccAWSPinpointApp_Tags(t *testing.T) { ImportStateVerify: true, }, { - Config: testAccAWSPinpointAppConfig_Tag2(shareName, "key1", "value1updated", "key2", "value2"), + Config: testAccAWSPinpointAppConfig_Tag2(rName, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSPinpointAppExists(resourceName, &application), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), @@ -174,7 +206,7 @@ func TestAccAWSPinpointApp_Tags(t *testing.T) { ), }, { - Config: testAccAWSPinpointAppConfig_Tag1(shareName, "key2", "value2"), + Config: testAccAWSPinpointAppConfig_Tag1(rName, "key2", "value2"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSPinpointAppExists(resourceName, &application), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), @@ -215,39 +247,33 @@ func testAccCheckAWSPinpointAppExists(n string, application *pinpoint.Applicatio } const testAccAWSPinpointAppConfig_withGeneratedName = ` -provider "aws" { - region = "us-east-1" -} - -resource "aws_pinpoint_app" "test_app" {} +resource "aws_pinpoint_app" "test" {} ` -func testAccAWSPinpointAppConfig_CampaignHookLambda(appName, funcName string) string { +func testAccAWSPinpointAppConfig_CampaignHookLambda(rName string) string { return fmt.Sprintf(` -provider "aws" { - region = "us-east-1" -} - -resource "aws_pinpoint_app" "test_app" { - name = "%s" +resource "aws_pinpoint_app" "test" { + name = %[1]q campaign_hook { lambda_function_name = "${aws_lambda_function.test.arn}" mode = "DELIVERY" } + + depends_on = ["aws_lambda_permission.test"] } resource "aws_lambda_function" "test" { filename = "test-fixtures/lambdapinpoint.zip" - function_name = "%s" - role = "${aws_iam_role.iam_for_lambda.arn}" + function_name = %[1]q + role = "${aws_iam_role.test.arn}" handler = "lambdapinpoint.handler" - runtime = "nodejs8.10" + runtime = "nodejs12.x" publish = true } -resource "aws_iam_role" "iam_for_lambda" { - name = "test-role" +resource "aws_iam_role" "test" { + name = %[1]q assume_role_policy = < 0 { + input := ec2.DescribePlacementGroupsInput{ + GroupNames: []*string{aws.String(d.Id())}, + } + out, err := conn.DescribePlacementGroups(&input) + if err != nil { + return err + } + pg := out.PlacementGroups[0] + if err := keyvaluetags.Ec2UpdateTags(conn, aws.StringValue(pg.GroupId), nil, v); err != nil { + return fmt.Errorf("error adding tags: %s", err) + } + } + return resourceAwsPlacementGroupRead(d, meta) } @@ -92,6 +124,12 @@ func resourceAwsPlacementGroupRead(d *schema.ResourceData, meta interface{}) err } out, err := conn.DescribePlacementGroups(&input) if err != nil { + if isAWSErr(err, "InvalidPlacementGroup.Unknown", "") { + log.Printf("[WARN] Placement Group %s not found, removing from state", d.Id()) + d.SetId("") + return nil + } + return err } pg := out.PlacementGroups[0] @@ -100,10 +138,29 @@ func resourceAwsPlacementGroupRead(d *schema.ResourceData, meta interface{}) err d.Set("name", pg.GroupName) d.Set("strategy", pg.Strategy) + d.Set("placement_group_id", pg.GroupId) + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(pg.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } +func resourceAwsPlacementGroupUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).ec2conn + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + pgId := d.Get("placement_group_id").(string) + if err := keyvaluetags.Ec2UpdateTags(conn, pgId, o, n); err != nil { + return fmt.Errorf("error updating Placement Group (%s) tags: %s", pgId, err) + } + } + + return resourceAwsPlacementGroupRead(d, meta) +} + func resourceAwsPlacementGroupDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn @@ -116,8 +173,8 @@ func resourceAwsPlacementGroupDelete(d *schema.ResourceData, meta interface{}) e } wait := resource.StateChangeConf{ - Pending: []string{"deleting"}, - Target: []string{"deleted"}, + Pending: []string{ec2.PlacementGroupStateAvailable, ec2.PlacementGroupStateDeleting}, + Target: []string{ec2.PlacementGroupStateDeleted}, Timeout: 5 * time.Minute, MinTimeout: 1 * time.Second, Refresh: func() (interface{}, string, error) { @@ -134,10 +191,13 @@ func resourceAwsPlacementGroupDelete(d *schema.ResourceData, meta interface{}) e } if len(out.PlacementGroups) == 0 { - return out, "deleted", nil + return out, ec2.PlacementGroupStateDeleted, nil } pg := out.PlacementGroups[0] + if *pg.State == "available" { + log.Printf("[DEBUG] Accepted status when deleting EC2 Placement group: %q %v", d.Id(), *pg.State) + } return out, *pg.State, nil }, diff --git a/aws/resource_aws_placement_group_test.go b/aws/resource_aws_placement_group_test.go index 9896ba0bdd5..2d4be811cb7 100644 --- a/aws/resource_aws_placement_group_test.go +++ b/aws/resource_aws_placement_group_test.go @@ -13,6 +13,7 @@ import ( ) func TestAccAWSPlacementGroup_basic(t *testing.T) { + var pg ec2.PlacementGroup resourceName := "aws_placement_group.test" rName := acctest.RandomWithPrefix("tf-acc-test") @@ -24,7 +25,7 @@ func TestAccAWSPlacementGroup_basic(t *testing.T) { { Config: testAccAWSPlacementGroupConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSPlacementGroupExists(resourceName), + testAccCheckAWSPlacementGroupExists(resourceName, &pg), resource.TestCheckResourceAttr(resourceName, "name", rName), resource.TestCheckResourceAttr(resourceName, "strategy", "cluster"), ), @@ -38,6 +39,71 @@ func TestAccAWSPlacementGroup_basic(t *testing.T) { }) } +func TestAccAWSPlacementGroup_tags(t *testing.T) { + var pg ec2.PlacementGroup + resourceName := "aws_placement_group.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSPlacementGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSPlacementGroupConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSPlacementGroupExists(resourceName, &pg), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSPlacementGroupConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSPlacementGroupExists(resourceName, &pg), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSPlacementGroupConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSPlacementGroupExists(resourceName, &pg), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2")), + }, + }, + }) +} + +func TestAccAWSPlacementGroup_disappears(t *testing.T) { + var pg ec2.PlacementGroup + resourceName := "aws_placement_group.test" + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSPlacementGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSPlacementGroupConfig(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSPlacementGroupExists(resourceName, &pg), + testAccCheckAWSPlacementGroupDisappears(&pg), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func testAccCheckAWSPlacementGroupDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).ec2conn @@ -63,7 +129,17 @@ func testAccCheckAWSPlacementGroupDestroy(s *terraform.State) error { return nil } -func testAccCheckAWSPlacementGroupExists(n string) resource.TestCheckFunc { +func testAccCheckAWSPlacementGroupDisappears(pg *ec2.PlacementGroup) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + req := &ec2.DeletePlacementGroupInput{GroupName: pg.GroupName} + _, err := conn.DeletePlacementGroup(req) + + return err + } +} + +func testAccCheckAWSPlacementGroupExists(n string, pg *ec2.PlacementGroup) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -75,13 +151,16 @@ func testAccCheckAWSPlacementGroupExists(n string) resource.TestCheckFunc { } conn := testAccProvider.Meta().(*AWSClient).ec2conn - _, err := conn.DescribePlacementGroups(&ec2.DescribePlacementGroupsInput{ + resp, err := conn.DescribePlacementGroups(&ec2.DescribePlacementGroupsInput{ GroupNames: []*string{aws.String(rs.Primary.ID)}, }) if err != nil { return fmt.Errorf("Placement Group error: %v", err) } + + *pg = *resp.PlacementGroups[0] + return nil } } @@ -94,3 +173,30 @@ resource "aws_placement_group" "test" { } `, rName) } + +func testAccAWSPlacementGroupConfigTags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_placement_group" "test" { + name = %[1]q + strategy = "cluster" + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccAWSPlacementGroupConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_placement_group" "test" { + name = %[1]q + strategy = "cluster" + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} diff --git a/aws/resource_aws_proxy_protocol_policy.go b/aws/resource_aws_proxy_protocol_policy.go index 2a0e8ec45ef..18c85f00627 100644 --- a/aws/resource_aws_proxy_protocol_policy.go +++ b/aws/resource_aws_proxy_protocol_policy.go @@ -70,11 +70,11 @@ func resourceAwsProxyProtocolPolicyCreate(d *schema.ResourceData, meta interface func resourceAwsProxyProtocolPolicyRead(d *schema.ResourceData, meta interface{}) error { elbconn := meta.(*AWSClient).elbconn - elbname := aws.String(d.Get("load_balancer").(string)) + elbname := d.Get("load_balancer").(string) // Retrieve the current ELB policies for updating the state req := &elb.DescribeLoadBalancersInput{ - LoadBalancerNames: []*string{elbname}, + LoadBalancerNames: []*string{aws.String(elbname)}, } resp, err := elbconn.DescribeLoadBalancers(req) if err != nil { @@ -94,7 +94,7 @@ func resourceAwsProxyProtocolPolicyRead(d *schema.ResourceData, meta interface{} ports = append(ports, &ipstr) } d.Set("instance_ports", ports) - d.Set("load_balancer", *elbname) + d.Set("load_balancer", elbname) return nil } diff --git a/aws/resource_aws_qldb_ledger.go b/aws/resource_aws_qldb_ledger.go new file mode 100644 index 00000000000..0ae4325454e --- /dev/null +++ b/aws/resource_aws_qldb_ledger.go @@ -0,0 +1,270 @@ +package aws + +import ( + "fmt" + "log" + "regexp" + "time" + + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/qldb" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" +) + +func resourceAwsQLDBLedger() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsQLDBLedgerCreate, + Read: resourceAwsQLDBLedgerRead, + Update: resourceAwsQLDBLedgerUpdate, + Delete: resourceAwsQLDBLedgerDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + + Schema: map[string]*schema.Schema{ + "arn": { + Type: schema.TypeString, + Computed: true, + }, + + "name": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validation.All( + validation.StringLenBetween(1, 32), + validation.StringMatch(regexp.MustCompile(`^[A-Za-z0-9_-]+`), "must contain only alphanumeric characters, underscores, and hyphens"), + ), + }, + + "deletion_protection": { + Type: schema.TypeBool, + Optional: true, + Default: true, + }, + + "tags": tagsSchema(), + }, + } +} + +func resourceAwsQLDBLedgerCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).qldbconn + + var name string + if v, ok := d.GetOk("name"); ok { + name = v.(string) + } else { + name = resource.PrefixedUniqueId("tf") + } + + if err := d.Set("name", name); err != nil { + return fmt.Errorf("error setting name: %s", err) + } + + // Create the QLDB Ledger + // The qldb.PermissionsModeAllowAll is currently hardcoded because AWS doesn't support changing the mode. + createOpts := &qldb.CreateLedgerInput{ + Name: aws.String(d.Get("name").(string)), + PermissionsMode: aws.String(qldb.PermissionsModeAllowAll), + DeletionProtection: aws.Bool(d.Get("deletion_protection").(bool)), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().QldbTags(), + } + + log.Printf("[DEBUG] QLDB Ledger create config: %#v", *createOpts) + qldbResp, err := conn.CreateLedger(createOpts) + if err != nil { + return fmt.Errorf("Error creating QLDB Ledger: %s", err) + } + + // Set QLDB ledger name + d.SetId(*qldbResp.Name) + + log.Printf("[INFO] QLDB Ledger name: %s", d.Id()) + + stateConf := &resource.StateChangeConf{ + Pending: []string{qldb.LedgerStateCreating}, + Target: []string{qldb.LedgerStateActive}, + Refresh: qldbLedgerRefreshStatusFunc(conn, d.Id()), + Timeout: 8 * time.Minute, + MinTimeout: 3 * time.Second, + } + + _, err = stateConf.WaitForState() + if err != nil { + return fmt.Errorf("Error waiting for QLDB Ledger status to be \"%s\": %s", qldb.LedgerStateActive, err) + } + + // Update our attributes and return + return resourceAwsQLDBLedgerRead(d, meta) +} + +func resourceAwsQLDBLedgerRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).qldbconn + + // Refresh the QLDB state + input := &qldb.DescribeLedgerInput{ + Name: aws.String(d.Id()), + } + + qldbLedger, err := conn.DescribeLedger(input) + + if isAWSErr(err, qldb.ErrCodeResourceNotFoundException, "") { + log.Printf("[WARN] QLDB Ledger (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + if err != nil { + return fmt.Errorf("error describing QLDB Ledger (%s): %s", d.Id(), err) + } + + // QLDB stuff + if err := d.Set("name", qldbLedger.Name); err != nil { + return fmt.Errorf("error setting name: %s", err) + } + + if err := d.Set("deletion_protection", qldbLedger.DeletionProtection); err != nil { + return fmt.Errorf("error setting deletion protection: %s", err) + } + + // ARN + if err := d.Set("arn", qldbLedger.Arn); err != nil { + return fmt.Errorf("error setting ARN: %s", err) + } + + // Tags + log.Printf("[INFO] Fetching tags for %s", d.Id()) + tags, err := keyvaluetags.QldbListTags(conn, d.Get("arn").(string)) + if err != nil { + return fmt.Errorf("Error listing tags for QLDB Ledger: %s", err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + return nil +} + +func resourceAwsQLDBLedgerUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).qldbconn + + // Turn on partial mode + d.Partial(true) + + if d.HasChange("deletion_protection") { + val := d.Get("deletion_protection").(bool) + modifyOpts := &qldb.UpdateLedgerInput{ + Name: aws.String(d.Id()), + DeletionProtection: aws.Bool(val), + } + log.Printf( + "[INFO] Modifying deletion_protection QLDB attribute for %s: %#v", + d.Id(), modifyOpts) + if _, err := conn.UpdateLedger(modifyOpts); err != nil { + + return err + } + + d.SetPartial("deletion_protection") + } + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.QldbUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + + d.Partial(false) + return resourceAwsQLDBLedgerRead(d, meta) +} + +func resourceAwsQLDBLedgerDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).qldbconn + deleteLedgerOpts := &qldb.DeleteLedgerInput{ + Name: aws.String(d.Id()), + } + log.Printf("[INFO] Deleting QLDB Ledger: %s", d.Id()) + + err := resource.Retry(5*time.Minute, func() *resource.RetryError { + _, err := conn.DeleteLedger(deleteLedgerOpts) + + if isAWSErr(err, qldb.ErrCodeResourceInUseException, "") { + return resource.RetryableError(err) + } + + if err != nil { + return resource.NonRetryableError(err) + } + + return nil + }) + + if isResourceTimeoutError(err) { + _, err = conn.DeleteLedger(deleteLedgerOpts) + } + + if isAWSErr(err, qldb.ErrCodeResourceNotFoundException, "") { + return nil + } + + if err != nil { + return fmt.Errorf("error deleting QLDB Ledger (%s): %s", d.Id(), err) + } + + if err := waitForQLDBLedgerDeletion(conn, d.Id()); err != nil { + return fmt.Errorf("error waiting for QLDB Ledger (%s) deletion: %s", d.Id(), err) + } + + return nil +} + +func qldbLedgerRefreshStatusFunc(conn *qldb.QLDB, ledger string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + input := &qldb.DescribeLedgerInput{ + Name: aws.String(ledger), + } + resp, err := conn.DescribeLedger(input) + if err != nil { + return nil, "failed", err + } + return resp, aws.StringValue(resp.State), nil + } +} + +func waitForQLDBLedgerDeletion(conn *qldb.QLDB, ledgerName string) error { + stateConf := resource.StateChangeConf{ + Pending: []string{qldb.LedgerStateCreating, + qldb.LedgerStateActive, + qldb.LedgerStateDeleting}, + Target: []string{""}, + Timeout: 5 * time.Minute, + MinTimeout: 1 * time.Second, + Refresh: func() (interface{}, string, error) { + resp, err := conn.DescribeLedger(&qldb.DescribeLedgerInput{ + Name: aws.String(ledgerName), + }) + + if isAWSErr(err, qldb.ErrCodeResourceNotFoundException, "") { + return 1, "", nil + } + + if err != nil { + return nil, qldb.ErrCodeResourceInUseException, err + } + + return resp, aws.StringValue(resp.State), nil + }, + } + + _, err := stateConf.WaitForState() + + return err +} diff --git a/aws/resource_aws_qldb_ledger_test.go b/aws/resource_aws_qldb_ledger_test.go new file mode 100644 index 00000000000..61626712996 --- /dev/null +++ b/aws/resource_aws_qldb_ledger_test.go @@ -0,0 +1,240 @@ +package aws + +import ( + "fmt" + "log" + "regexp" + "testing" + + "github.com/aws/aws-sdk-go/service/qldb" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + + "github.com/aws/aws-sdk-go/aws" +) + +func init() { + resource.AddTestSweepers("aws_qldb_ledger", &resource.Sweeper{ + Name: "aws_qldb_ledger", + F: testSweepQLDBLedgers, + }) +} + +func testSweepQLDBLedgers(region string) error { + client, err := sharedClientForRegion(region) + + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + + conn := client.(*AWSClient).qldbconn + input := &qldb.ListLedgersInput{} + page, err := conn.ListLedgers(input) + + if err != nil { + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping QLDB Ledger sweep for %s: %s", region, err) + return nil + } + return fmt.Errorf("Error listing QLDB Ledgers: %s", err) + } + + for _, item := range page.Ledgers { + input := &qldb.DeleteLedgerInput{ + Name: item.Name, + } + name := aws.StringValue(item.Name) + + log.Printf("[INFO] Deleting QLDB Ledger: %s", name) + _, err = conn.DeleteLedger(input) + + if err != nil { + log.Printf("[ERROR] Failed to delete QLDB Ledger %s: %s", name, err) + continue + } + + if err := waitForQLDBLedgerDeletion(conn, name); err != nil { + log.Printf("[ERROR] Error waiting for QLDB Ledger (%s) deletion: %s", name, err) + } + } + + return nil +} + +func TestAccAWSQLDBLedger_basic(t *testing.T) { + var qldbCluster qldb.DescribeLedgerOutput + rInt := acctest.RandInt() + resourceName := "aws_qldb_ledger.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSQLDBLedgerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSQLDBLedgerConfig(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSQLDBLedgerExists(resourceName, &qldbCluster), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "qldb", regexp.MustCompile(`ledger/.+`)), + resource.TestMatchResourceAttr(resourceName, "name", regexp.MustCompile("test-ledger-[0-9]+")), + resource.TestCheckResourceAttr(resourceName, "deletion_protection", "false"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckAWSQLDBLedgerDestroy(s *terraform.State) error { + return testAccCheckAWSLedgerDestroyWithProvider(s, testAccProvider) +} + +func testAccCheckAWSLedgerDestroyWithProvider(s *terraform.State, provider *schema.Provider) error { + conn := provider.Meta().(*AWSClient).qldbconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_qldb_ledger" { + continue + } + + // Try to find the Group + var err error + resp, err := conn.DescribeLedger( + &qldb.DescribeLedgerInput{ + Name: aws.String(rs.Primary.ID), + }) + + if err == nil { + if len(aws.StringValue(resp.Name)) != 0 && aws.StringValue(resp.Name) == rs.Primary.ID { + return fmt.Errorf("QLDB Ledger %s still exists", rs.Primary.ID) + } + } + + // Return nil if the cluster is already destroyed + if isAWSErr(err, qldb.ErrCodeResourceNotFoundException, "") { + continue + } + + if err != nil { + return err + } + } + + return nil +} + +func testAccCheckAWSQLDBLedgerExists(n string, v *qldb.DescribeLedgerOutput) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No QLDB Ledger ID is set") + } + + conn := testAccProvider.Meta().(*AWSClient).qldbconn + resp, err := conn.DescribeLedger(&qldb.DescribeLedgerInput{ + Name: aws.String(rs.Primary.ID), + }) + + if err != nil { + return err + } + + if *resp.Name == rs.Primary.ID { + *v = *resp + return nil + } + + return fmt.Errorf("QLDB Ledger (%s) not found", rs.Primary.ID) + } +} + +func testAccAWSQLDBLedgerConfig(n int) string { + return fmt.Sprintf(` +resource "aws_qldb_ledger" "test" { + name = "test-ledger-%d" + deletion_protection = false +} +`, n) +} + +func TestAccAWSQLDBLedger_Tags(t *testing.T) { + var cluster1, cluster2, cluster3 qldb.DescribeLedgerOutput + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_qldb_ledger.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSQLDBLedgerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSQLDBLedgerConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSQLDBLedgerExists(resourceName, &cluster1), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSQLDBLedgerConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSQLDBLedgerExists(resourceName, &cluster2), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSQLDBLedgerConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSQLDBLedgerExists(resourceName, &cluster3), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + +func testAccAWSQLDBLedgerConfigTags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_qldb_ledger" "test" { + name = %[1]q + deletion_protection = false + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccAWSQLDBLedgerConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_qldb_ledger" "test" { + name = %[1]q + deletion_protection = false + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} diff --git a/aws/resource_aws_quicksight_data_source.go b/aws/resource_aws_quicksight_data_source.go new file mode 100644 index 00000000000..d326df2ce8a --- /dev/null +++ b/aws/resource_aws_quicksight_data_source.go @@ -0,0 +1,1370 @@ +package aws + +import ( + "fmt" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + "log" + "regexp" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/quicksight" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" +) + +func resourceAwsQuickSightDataSource() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsQuickSightDataSourceCreate, + Read: resourceAwsQuickSightDataSourceRead, + Update: resourceAwsQuickSightDataSourceUpdate, + Delete: resourceAwsQuickSightDataSourceDelete, + + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + + Timeouts: &schema.ResourceTimeout{ + Create: schema.DefaultTimeout(60 * time.Second), + Read: schema.DefaultTimeout(60 * time.Second), + Update: schema.DefaultTimeout(60 * time.Second), + Delete: schema.DefaultTimeout(60 * time.Second), + }, + + Schema: map[string]*schema.Schema{ + "arn": { + Type: schema.TypeString, + Computed: true, + }, + + "aws_account_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + }, + + "credentials": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "credential_pair": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "password": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "username": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + }, + }, + }, + }, + }, + }, + + "data_source_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + + "name": { + Type: schema.TypeString, + Required: 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)) + } + if !regexp.MustCompile(`^[\w+=,.@-]*$`).MatchString(value) { + errors = append(errors, fmt.Errorf( + "%q must match [\\w+=,.@-]", k)) + } + return + }, + }, + + "parameters": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "amazon_elasticsearch": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "domain": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + }, + }, + }, + "athena": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "work_group": { + 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)) + } + if !regexp.MustCompile(`^[a-zA-Z0-9._-]*$`).MatchString(value) { + errors = append(errors, fmt.Errorf( + "%q must match [\\w+=,.@-]", k)) + } + return + }, + }, + }, + }, + }, + "aurora": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "database": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "host": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "port": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntAtLeast(1), + }, + }, + }, + }, + "aurora_postgresql": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "database": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "host": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "port": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntAtLeast(1), + }, + }, + }, + }, + "aws_iot_analytics": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "data_set_name": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + }, + }, + }, + "jira": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "site_base_url": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + }, + }, + }, + "maria_db": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "database": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "host": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "port": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntAtLeast(1), + }, + }, + }, + }, + "mysql": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "database": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "host": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "port": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntAtLeast(1), + }, + }, + }, + }, + "postgresql": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "database": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "host": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "port": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntAtLeast(1), + }, + }, + }, + }, + "presto": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "catalog": { + Type: schema.TypeString, + Required: true, + }, + "host": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "port": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntAtLeast(1), + }, + }, + }, + }, + // The documentation is not clear on how to pass RDS parameters... + "redshift": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "cluster_id": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validation.NoZeroValues, + }, + "database": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "host": { + Type: schema.TypeString, + Optional: true, + }, + "port": { + Type: schema.TypeInt, + Optional: true, + }, + }, + }, + }, + "s3": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "manifest_file_location": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "bucket": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "key": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + }, + }, + }, + }, + }, + }, + "service_now": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "site_base_url": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + }, + }, + }, + "snowflake": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "database": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "host": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "warehouse": { + Type: schema.TypeString, + Required: true, + }, + }, + }, + }, + "spark": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "host": { + Type: schema.TypeString, + Required: true, + }, + "port": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntAtLeast(1), + }, + }, + }, + }, + "sql_server": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "database": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "host": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "port": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntAtLeast(1), + }, + }, + }, + }, + "teradata": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "database": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "host": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + "port": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntAtLeast(1), + }, + }, + }, + }, + "twitter": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "max_rows": { + Type: schema.TypeInt, + Required: true, + ValidateFunc: validation.IntAtLeast(1), + }, + "query": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + }, + }, + }, + }, + }, + }, + + "permission": { + Type: schema.TypeList, + Optional: true, + MinItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "actions": { + Type: schema.TypeSet, + Required: true, + Elem: &schema.Schema{Type: schema.TypeString}, + Set: schema.HashString, + }, + "principal": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validation.NoZeroValues, + }, + }, + }, + }, + + "ssl_properties": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "disable_ssl": { + Type: schema.TypeBool, + Optional: true, + }, + }, + }, + }, + + "tags": tagsSchema(), + + // This will be inferred from the passed `parameters` value + "type": { + Type: schema.TypeString, + Computed: true, + }, + + "vpc_connection_properties": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "vpc_connection_arn": { + Type: schema.TypeBool, + Optional: true, + ValidateFunc: validateArn, + }, + }, + }, + }, + }, + } +} + +func resourceAwsQuickSightDataSourceCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).quicksightconn + + awsAccountId := meta.(*AWSClient).accountid + dataSourceId := d.Get("data_source_id").(string) + + if v, ok := d.GetOk("aws_account_id"); ok { + awsAccountId = v.(string) + } + + params := &quicksight.CreateDataSourceInput{ + AwsAccountId: aws.String(awsAccountId), + DataSourceId: aws.String(dataSourceId), + Name: aws.String(d.Get("name").(string)), + } + + if v, ok := d.GetOk("tags"); ok { + params.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().QuicksightTags() + } + if credentials := resourceAwsQuickSightDataSourceCredentials(d); credentials != nil { + params.Credentials = credentials + } + + if dataSourceType, dataSourceParameters := resourceAwsQuickSightDataSourceParameters(d); dataSourceParameters != nil { + params.Type = dataSourceType + params.DataSourceParameters = dataSourceParameters + } + + if v := d.Get("permission"); v != nil && len(v.([]interface{})) != 0 { + params.Permissions = make([]*quicksight.ResourcePermission, 0) + + for _, v := range v.([]interface{}) { + permissionResource := v.(map[string]interface{}) + permission := &quicksight.ResourcePermission{ + Actions: expandStringSet(permissionResource["actions"].(*schema.Set)), + Principal: aws.String(permissionResource["principal"].(string)), + } + + params.Permissions = append(params.Permissions, permission) + } + } + + if sslProperties := resourceAwsQuickSightDataSourceSslProperties(d); sslProperties != nil { + params.SslProperties = sslProperties + } + + if vpcConnectionProperties := resourceAwsQuickSightDataSourceVpcConnectionProperties(d); vpcConnectionProperties != nil { + params.VpcConnectionProperties = vpcConnectionProperties + } + + createOut, err := conn.CreateDataSource(params) + if err != nil { + return fmt.Errorf("Error creating QuickSight Data Source: %s", err) + } else { + _, err = waitQuickSightDataSourceCreate(conn, awsAccountId, dataSourceId, d.Timeout(schema.TimeoutCreate)) + if err != nil { + return fmt.Errorf("Error waiting for Data Source (%s) to become available: %s", dataSourceId, err) + } + + d.SetId(fmt.Sprintf("%s/%s", awsAccountId, dataSourceId)) + d.Set("arn", createOut.Arn) + + return resourceAwsQuickSightDataSourceRead(d, meta) + + } +} + +func waitQuickSightDataSourceCreate(conn *quicksight.QuickSight, awsAccountId string, id string, timeout time.Duration) (interface{}, error) { + stateChangeConf := &resource.StateChangeConf{ + Pending: []string{quicksight.ResourceStatusCreationInProgress}, + Target: []string{quicksight.ResourceStatusCreationSuccessful}, + Refresh: quickSightDataSourceStateRefreshFunc(conn, awsAccountId, id), + Timeout: timeout, + Delay: 5 * time.Second, + } + return stateChangeConf.WaitForState() +} + +func waitQuickSightDataSourceRead(conn *quicksight.QuickSight, awsAccountId string, id string, timeout time.Duration) (interface{}, error) { + stateChangeConf := &resource.StateChangeConf{ + Pending: []string{quicksight.ResourceStatusCreationInProgress, quicksight.ResourceStatusUpdateInProgress}, + Target: []string{quicksight.ResourceStatusCreationSuccessful, quicksight.ResourceStatusUpdateSuccessful}, + Refresh: quickSightDataSourceStateRefreshFunc(conn, awsAccountId, id), + Timeout: timeout, + Delay: 5 * time.Second, + } + return stateChangeConf.WaitForState() +} + +func quickSightDataSourceStateRefreshFunc(conn *quicksight.QuickSight, awsAccountId, id string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + req := &quicksight.DescribeDataSourceInput{ + AwsAccountId: aws.String(awsAccountId), + DataSourceId: aws.String(id), + } + + resp, err := conn.DescribeDataSource(req) + if err != nil { + return nil, "", err + } + + dataSourceId := resp.DataSource.DataSourceId + state := "" + if aws.StringValue(resp.DataSource.Status) == quicksight.ResourceStatusCreationSuccessful { + state = quicksight.ResourceStatusCreationSuccessful + log.Printf("resp.DataSource.Status %#v", aws.StringValue(resp.DataSource.Status)) + } + if aws.StringValue(resp.DataSource.Status) == quicksight.ResourceStatusUpdateSuccessful { + state = quicksight.ResourceStatusUpdateSuccessful + log.Printf("resp.DataSource.Status %#v", aws.StringValue(resp.DataSource.Status)) + } + + return dataSourceId, state, nil + } +} + +func resourceAwsQuickSightDataSourceRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).quicksightconn + + awsAccountId, dataSourceId, err := resourceAwsQuickSightDataSourceParseID(d.Id()) + if err != nil { + return err + } + + descOpts := &quicksight.DescribeDataSourceInput{ + AwsAccountId: aws.String(awsAccountId), + DataSourceId: aws.String(dataSourceId), + } + + var dataSourceResp *quicksight.DescribeDataSourceOutput + dataSourceResp, err = conn.DescribeDataSource(descOpts) + if err != nil { + return fmt.Errorf("Error describing QuickSight Data Source (%s): %s", d.Id(), err) + } else { + _, err = waitQuickSightDataSourceRead(conn, awsAccountId, dataSourceId, d.Timeout(schema.TimeoutRead)) + if err != nil { + return fmt.Errorf("Error waiting for Data Source (%s) to become available: %s", dataSourceId, err) + } + } + + permsResp, err := conn.DescribeDataSourcePermissions(&quicksight.DescribeDataSourcePermissionsInput{ + AwsAccountId: aws.String(awsAccountId), + DataSourceId: aws.String(dataSourceId), + }) + if err != nil { + return fmt.Errorf("Error describing QuickSight Data Source permissions (%s): %s", d.Id(), err) + } + + dataSource := dataSourceResp.DataSource + + d.Set("arn", dataSource.Arn) + d.Set("name", dataSource.Name) + d.Set("data_source_id", dataSource.DataSourceId) + d.Set("aws_account_id", awsAccountId) + + tags, err := keyvaluetags.QuicksightListTags(conn, d.Get("arn").(string)) + if err != nil { + return fmt.Errorf("error listing tags for AWS QuickSight resource (%s): %s", d.Get("arn").(string), err) + } + err = d.Set("tags", tags.IgnoreAws().Map()) + if err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + if err := d.Set("permission", flattenQuickSightPermissions(permsResp.Permissions)); err != nil { + return fmt.Errorf("Error setting permission error: %#v", err) + } + + params := map[string]interface{}{} + + if dataSource.DataSourceParameters.AmazonElasticsearchParameters != nil { + params = map[string]interface{}{ + "amazon_elasticsearch": []interface{}{ + map[string]interface{}{ + "domain": dataSource.DataSourceParameters.AmazonElasticsearchParameters.Domain, + }, + }, + } + } + + if dataSource.DataSourceParameters.AthenaParameters != nil { + params = map[string]interface{}{ + "athena": []interface{}{ + map[string]interface{}{ + "work_group": dataSource.DataSourceParameters.AthenaParameters.WorkGroup, + }, + }, + } + } + + if dataSource.DataSourceParameters.AuroraParameters != nil { + params = map[string]interface{}{ + "aurora": []interface{}{ + map[string]interface{}{ + "database": dataSource.DataSourceParameters.AuroraParameters.Database, + "host": dataSource.DataSourceParameters.AuroraParameters.Host, + "port": dataSource.DataSourceParameters.AuroraParameters.Port, + }, + }, + } + } + + if dataSource.DataSourceParameters.AuroraPostgreSqlParameters != nil { + params = map[string]interface{}{ + "aurora_postgresql": []interface{}{ + map[string]interface{}{ + "database": dataSource.DataSourceParameters.AuroraPostgreSqlParameters.Database, + "host": dataSource.DataSourceParameters.AuroraPostgreSqlParameters.Host, + "port": dataSource.DataSourceParameters.AuroraPostgreSqlParameters.Port, + }, + }, + } + } + + if dataSource.DataSourceParameters.AwsIotAnalyticsParameters != nil { + params = map[string]interface{}{ + "aws_iot_analytics": []interface{}{ + map[string]interface{}{ + "data_set_name": dataSource.DataSourceParameters.AwsIotAnalyticsParameters.DataSetName, + }, + }, + } + } + + if dataSource.DataSourceParameters.JiraParameters != nil { + params = map[string]interface{}{ + "jira": []interface{}{ + map[string]interface{}{ + "site_base_url": dataSource.DataSourceParameters.JiraParameters.SiteBaseUrl, + }, + }, + } + } + + if dataSource.DataSourceParameters.MariaDbParameters != nil { + params = map[string]interface{}{ + "maria_db": []interface{}{ + map[string]interface{}{ + "database": dataSource.DataSourceParameters.MariaDbParameters.Database, + "host": dataSource.DataSourceParameters.MariaDbParameters.Host, + "port": dataSource.DataSourceParameters.MariaDbParameters.Port, + }, + }, + } + } + + if dataSource.DataSourceParameters.MySqlParameters != nil { + params = map[string]interface{}{ + "mysql": []interface{}{ + map[string]interface{}{ + "database": dataSource.DataSourceParameters.MySqlParameters.Database, + "host": dataSource.DataSourceParameters.MySqlParameters.Host, + "port": dataSource.DataSourceParameters.MySqlParameters.Port, + }, + }, + } + } + + if dataSource.DataSourceParameters.PostgreSqlParameters != nil { + params = map[string]interface{}{ + "postgresql": []interface{}{ + map[string]interface{}{ + "database": dataSource.DataSourceParameters.PostgreSqlParameters.Database, + "host": dataSource.DataSourceParameters.PostgreSqlParameters.Host, + "port": dataSource.DataSourceParameters.PostgreSqlParameters.Port, + }, + }, + } + } + + if dataSource.DataSourceParameters.PrestoParameters != nil { + params = map[string]interface{}{ + "presto": []interface{}{ + map[string]interface{}{ + "catalog": dataSource.DataSourceParameters.PrestoParameters.Catalog, + "host": dataSource.DataSourceParameters.PrestoParameters.Host, + "port": dataSource.DataSourceParameters.PrestoParameters.Port, + }, + }, + } + } + + if dataSource.DataSourceParameters.RedshiftParameters != nil { + params = map[string]interface{}{ + "redshift": []interface{}{ + map[string]interface{}{ + "cluster_id": dataSource.DataSourceParameters.RedshiftParameters.ClusterId, + "database": dataSource.DataSourceParameters.RedshiftParameters.Database, + "host": dataSource.DataSourceParameters.RedshiftParameters.Host, + "port": dataSource.DataSourceParameters.RedshiftParameters.Port, + }, + }, + } + } + + if dataSource.DataSourceParameters.S3Parameters != nil { + params = map[string]interface{}{ + "s3": []interface{}{ + map[string]interface{}{ + "manifest_file_location": []interface{}{ + map[string]interface{}{ + "bucket": dataSource.DataSourceParameters.S3Parameters.ManifestFileLocation.Bucket, + "key": dataSource.DataSourceParameters.S3Parameters.ManifestFileLocation.Key, + }, + }, + }, + }, + } + } + + if dataSource.DataSourceParameters.ServiceNowParameters != nil { + params = map[string]interface{}{ + "service_now": []interface{}{ + map[string]interface{}{ + "site_base_url": dataSource.DataSourceParameters.ServiceNowParameters.SiteBaseUrl, + }, + }, + } + } + + if dataSource.DataSourceParameters.SnowflakeParameters != nil { + params = map[string]interface{}{ + "snowflake": []interface{}{ + map[string]interface{}{ + "database": dataSource.DataSourceParameters.SnowflakeParameters.Database, + "host": dataSource.DataSourceParameters.SnowflakeParameters.Host, + "warehouse": dataSource.DataSourceParameters.SnowflakeParameters.Warehouse, + }, + }, + } + } + + if dataSource.DataSourceParameters.SparkParameters != nil { + params = map[string]interface{}{ + "spark": []interface{}{ + map[string]interface{}{ + "host": dataSource.DataSourceParameters.SparkParameters.Host, + "port": dataSource.DataSourceParameters.SparkParameters.Port, + }, + }, + } + } + + if dataSource.DataSourceParameters.SqlServerParameters != nil { + params = map[string]interface{}{ + "sql_server": []interface{}{ + map[string]interface{}{ + "database": dataSource.DataSourceParameters.SqlServerParameters.Database, + "host": dataSource.DataSourceParameters.SqlServerParameters.Host, + "port": dataSource.DataSourceParameters.SqlServerParameters.Port, + }, + }, + } + } + + if dataSource.DataSourceParameters.TeradataParameters != nil { + params = map[string]interface{}{ + "teradata": []interface{}{ + map[string]interface{}{ + "database": dataSource.DataSourceParameters.TeradataParameters.Database, + "host": dataSource.DataSourceParameters.TeradataParameters.Host, + "port": dataSource.DataSourceParameters.TeradataParameters.Port, + }, + }, + } + } + + if dataSource.DataSourceParameters.TwitterParameters != nil { + params = map[string]interface{}{ + "twitter": []interface{}{ + map[string]interface{}{ + "max_rows": dataSource.DataSourceParameters.TwitterParameters.MaxRows, + "query": dataSource.DataSourceParameters.TwitterParameters.Query, + }, + }, + } + } + + d.Set("parameters", []interface{}{params}) + + d.Set("type", inferQuickSightDataSourceTypeFromKey(params)) + + return nil +} + +func resourceAwsQuickSightDataSourceUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).quicksightconn + + awsAccountId, dataSourceId, err := resourceAwsQuickSightDataSourceParseID(d.Id()) + if err != nil { + return err + } + + params := &quicksight.UpdateDataSourceInput{ + AwsAccountId: aws.String(awsAccountId), + DataSourceId: aws.String(dataSourceId), + } + + if credentials := resourceAwsQuickSightDataSourceCredentials(d); credentials != nil { + params.Credentials = credentials + } + + if dataSourceType, dataSourceParameters := resourceAwsQuickSightDataSourceParameters(d); dataSourceParameters != nil { + params.DataSourceParameters = dataSourceParameters + d.Set("type", dataSourceType) + } + + if d.HasChange("permission") { + oraw, nraw := d.GetChange("permission") + o := oraw.([]interface{}) + n := nraw.([]interface{}) + toGrant, toRevoke := diffQuickSightPermissionsToGrantAndRevoke(o, n) + + if len(toGrant) > 0 || len(toRevoke) > 0 { + params := &quicksight.UpdateDataSourcePermissionsInput{ + AwsAccountId: aws.String(awsAccountId), + DataSourceId: aws.String(dataSourceId), + GrantPermissions: toGrant, + RevokePermissions: toRevoke, + } + + _, err := conn.UpdateDataSourcePermissions(params) + if err != nil { + return fmt.Errorf("Error updating QuickSight Data Source permissions: %s", err) + } + } + } + + if sslProperties := resourceAwsQuickSightDataSourceSslProperties(d); sslProperties != nil { + params.SslProperties = sslProperties + } + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + err := keyvaluetags.QuicksightUpdateTags(conn, d.Get("arn").(string), o, n) + if err != nil { + return fmt.Errorf("error updating AWS QuickSight resource (%s) tags: %s", d.Get("arn").(string), err) + } + } + + if vpcConnectionProperties := resourceAwsQuickSightDataSourceVpcConnectionProperties(d); vpcConnectionProperties != nil { + params.VpcConnectionProperties = vpcConnectionProperties + } + + _, err = conn.UpdateDataSource(params) + if isAWSErr(err, quicksight.ErrCodeResourceNotFoundException, "") { + log.Printf("[WARN] QuickSight Data Source %s is already gone", d.Id()) + d.SetId("") + return nil + } + if err != nil { + return fmt.Errorf("Error updating QuickSight Data Source %s: %s", d.Id(), err) + } + + return resourceAwsQuickSightDataSourceRead(d, meta) +} + +func resourceAwsQuickSightDataSourceDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).quicksightconn + + awsAccountId, dataSourceId, err := resourceAwsQuickSightDataSourceParseID(d.Id()) + if err != nil { + return err + } + + deleteOpts := &quicksight.DeleteDataSourceInput{ + AwsAccountId: aws.String(awsAccountId), + DataSourceId: aws.String(dataSourceId), + } + + if _, err := conn.DeleteDataSource(deleteOpts); err != nil { + if isAWSErr(err, quicksight.ErrCodeResourceNotFoundException, "") { + return nil + } + return fmt.Errorf("Error deleting QuickSight Data Source %s: %s", d.Id(), err) + } + + return nil +} + +func resourceAwsQuickSightDataSourceCredentials(d *schema.ResourceData) *quicksight.DataSourceCredentials { + if v := d.Get("credentials"); v != nil { + for _, v := range v.([]interface{}) { + credentials := v.(map[string]interface{}) + + if v := credentials["credential_pair"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + credentialPairResource := v.(map[string]interface{}) + credentialPair := &quicksight.CredentialPair{} + + if v, ok := credentialPairResource["username"]; ok && v.(string) != "" { + credentialPair.Username = aws.String(v.(string)) + } + + if v, ok := credentialPairResource["password"]; ok && v.(string) != "" { + credentialPair.Password = aws.String(v.(string)) + } + + return &quicksight.DataSourceCredentials{ + CredentialPair: credentialPair, + } + } + } + } + } + + return nil +} + +var quickSightDataSourceParamToDataType = map[string]string{ + "amazon_elasticsearch": quicksight.DataSourceTypeAmazonElasticsearch, + "athena": quicksight.DataSourceTypeAthena, + "aurora": quicksight.DataSourceTypeAurora, + "aurora_postgresql": quicksight.DataSourceTypeAuroraPostgresql, + "aws_iot_analytics": quicksight.DataSourceTypeAwsIotAnalytics, + "jira": quicksight.DataSourceTypeJira, + "maria_db": quicksight.DataSourceTypeMariadb, + "mysql": quicksight.DataSourceTypeMysql, + "postgresql": quicksight.DataSourceTypePostgresql, + "presto": quicksight.DataSourceTypePresto, + "redshift": quicksight.DataSourceTypeRedshift, + "s3": quicksight.DataSourceTypeS3, + "service_now": quicksight.DataSourceTypeServicenow, + "snowflake": quicksight.DataSourceTypeSnowflake, + "spark": quicksight.DataSourceTypeSpark, + "sql_server": quicksight.DataSourceTypeSqlserver, + "teradata": quicksight.DataSourceTypeTeradata, + "twitter": quicksight.DataSourceTypeTwitter, +} + +func inferQuickSightDataSourceTypeFromKey(params map[string]interface{}) string { + if len(params) == 1 { + for k := range params { + if dataSourceType, found := quickSightDataSourceParamToDataType[k]; found { + return dataSourceType + } + } + } + + for k, v := range params { + if dataSourceType, found := quickSightDataSourceParamToDataType[k]; found && v.([]interface{}) != nil && len(v.([]interface{})) > 0 { + return dataSourceType + } + } + + return "UNKNOWN" +} + +func resourceAwsQuickSightDataSourceParameters(d *schema.ResourceData) (*string, *quicksight.DataSourceParameters) { + if v := d.Get("parameters"); v != nil { + dataSourceParamsResource := &quicksight.DataSourceParameters{} + var dataSourceType string + for _, v := range v.([]interface{}) { + dataSourceParams := v.(map[string]interface{}) + dataSourceType = inferQuickSightDataSourceTypeFromKey(dataSourceParams) + + if v := dataSourceParams["amazon_elasticsearch"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.AmazonElasticsearchParameters = &quicksight.AmazonElasticsearchParameters{ + Domain: aws.String(psResource["domain"].(string)), + } + } + } + + if v := dataSourceParams["athena"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + ps := &quicksight.AthenaParameters{} + + if v, ok := psResource["work_group"]; ok && v.(string) != "" { + ps.WorkGroup = aws.String(v.(string)) + } + + dataSourceParamsResource.AthenaParameters = ps + } + } + + if v := dataSourceParams["aurora"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.AuroraParameters = &quicksight.AuroraParameters{ + Database: aws.String(psResource["database"].(string)), + Host: aws.String(psResource["host"].(string)), + Port: aws.Int64(psResource["port"].(int64)), + } + } + } + + if v := dataSourceParams["aurora_postgresql"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.AuroraPostgreSqlParameters = &quicksight.AuroraPostgreSqlParameters{ + Database: aws.String(psResource["database"].(string)), + Host: aws.String(psResource["host"].(string)), + Port: aws.Int64(psResource["port"].(int64)), + } + } + } + + if v := dataSourceParams["aws_iot_analytics"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.AwsIotAnalyticsParameters = &quicksight.AwsIotAnalyticsParameters{ + DataSetName: aws.String(psResource["data_set_name"].(string)), + } + } + } + + if v := dataSourceParams["jira"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.JiraParameters = &quicksight.JiraParameters{ + SiteBaseUrl: aws.String(psResource["site_base_url"].(string)), + } + } + } + + if v := dataSourceParams["maria_db"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.MariaDbParameters = &quicksight.MariaDbParameters{ + Database: aws.String(psResource["database"].(string)), + Host: aws.String(psResource["host"].(string)), + Port: aws.Int64(psResource["port"].(int64)), + } + } + } + + if v := dataSourceParams["mysql"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.MySqlParameters = &quicksight.MySqlParameters{ + Database: aws.String(psResource["database"].(string)), + Host: aws.String(psResource["host"].(string)), + Port: aws.Int64(psResource["port"].(int64)), + } + } + } + + if v := dataSourceParams["postgresql"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.PostgreSqlParameters = &quicksight.PostgreSqlParameters{ + Database: aws.String(psResource["database"].(string)), + Host: aws.String(psResource["host"].(string)), + Port: aws.Int64(psResource["port"].(int64)), + } + } + } + + if v := dataSourceParams["presto"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.PrestoParameters = &quicksight.PrestoParameters{ + Catalog: aws.String(psResource["catalog"].(string)), + Host: aws.String(psResource["host"].(string)), + Port: aws.Int64(psResource["port"].(int64)), + } + } + } + + if v := dataSourceParams["redshift"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + ps := &quicksight.RedshiftParameters{ + Database: aws.String(psResource["database"].(string)), + } + + if v, ok := psResource["cluster_id"]; ok && v.(string) != "" { + ps.ClusterId = aws.String(v.(string)) + } + + if v, ok := psResource["host"]; ok && v.(string) != "" { + ps.Host = aws.String(v.(string)) + } + + if v, ok := psResource["port"]; ok && v.(int64) != 0 { + ps.Port = aws.Int64(v.(int64)) + } + + dataSourceParamsResource.RedshiftParameters = ps + } + } + + if v := dataSourceParams["s3"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + s3 := v.(map[string]interface{}) + if v := s3["manifest_file_location"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.S3Parameters = &quicksight.S3Parameters{ + ManifestFileLocation: &quicksight.ManifestFileLocation{ + Bucket: aws.String(psResource["bucket"].(string)), + Key: aws.String(psResource["key"].(string)), + }, + } + } + } + } + } + + if v := dataSourceParams["service_now"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.ServiceNowParameters = &quicksight.ServiceNowParameters{ + SiteBaseUrl: aws.String(psResource["site_base_url"].(string)), + } + } + } + + if v := dataSourceParams["snowflake"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.SnowflakeParameters = &quicksight.SnowflakeParameters{ + Database: aws.String(psResource["database"].(string)), + Host: aws.String(psResource["host"].(string)), + Warehouse: aws.String(psResource["warehouse"].(string)), + } + } + } + + if v := dataSourceParams["spark"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.SparkParameters = &quicksight.SparkParameters{ + Host: aws.String(psResource["host"].(string)), + Port: aws.Int64(psResource["port"].(int64)), + } + } + } + + if v := dataSourceParams["sql_server"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.SqlServerParameters = &quicksight.SqlServerParameters{ + Database: aws.String(psResource["database"].(string)), + Host: aws.String(psResource["host"].(string)), + Port: aws.Int64(psResource["port"].(int64)), + } + } + } + + if v := dataSourceParams["teradata"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.TeradataParameters = &quicksight.TeradataParameters{ + Database: aws.String(psResource["database"].(string)), + Host: aws.String(psResource["host"].(string)), + Port: aws.Int64(psResource["port"].(int64)), + } + } + } + + if v := dataSourceParams["twitter"]; v != nil && v.([]interface{}) != nil { + for _, v := range v.([]interface{}) { + psResource := v.(map[string]interface{}) + dataSourceParamsResource.TwitterParameters = &quicksight.TwitterParameters{ + MaxRows: aws.Int64(psResource["max_rows"].(int64)), + Query: aws.String(psResource["query"].(string)), + } + } + } + + } + return aws.String(dataSourceType), dataSourceParamsResource + } + + return aws.String(""), nil +} + +func resourceAwsQuickSightDataSourceSslProperties(d *schema.ResourceData) *quicksight.SslProperties { + if v := d.Get("ssl_properties"); v != nil { + for _, v := range v.([]interface{}) { + sslProperties := v.(map[string]interface{}) + + if v, present := sslProperties["disable_ssl"]; present { + return &quicksight.SslProperties{ + DisableSsl: aws.Bool(v.(bool)), + } + } + } + } + + return nil +} + +func resourceAwsQuickSightDataSourceVpcConnectionProperties(d *schema.ResourceData) *quicksight.VpcConnectionProperties { + if v := d.Get("vpc_connection_properties"); v != nil { + for _, v := range v.([]interface{}) { + vpcConnectionProperties := v.(map[string]interface{}) + + if v := vpcConnectionProperties["vpc_connection_arn"]; v != nil && v.(string) != "" { + return &quicksight.VpcConnectionProperties{ + VpcConnectionArn: aws.String(v.(string)), + } + } + } + } + + return nil +} + +func resourceAwsQuickSightDataSourceParseID(id string) (string, string, error) { + parts := strings.SplitN(id, "/", 2) + if len(parts) < 2 || parts[0] == "" || parts[1] == "" { + return "", "", fmt.Errorf("unexpected format of ID (%s), expected AWS_ACCOUNT_ID/DATA_SOURCE_ID", id) + } + return parts[0], parts[1], nil +} diff --git a/aws/resource_aws_quicksight_data_source_test.go b/aws/resource_aws_quicksight_data_source_test.go new file mode 100644 index 00000000000..35fa2f52213 --- /dev/null +++ b/aws/resource_aws_quicksight_data_source_test.go @@ -0,0 +1,199 @@ +package aws + +import ( + "fmt" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" + "github.com/aws/aws-sdk-go/service/quicksight" +) + +func TestAccAWSQuickSightDataSource_basic(t *testing.T) { + var dataSource quicksight.DataSource + resourceName := "aws_quicksight_data_source.default" + rName1 := acctest.RandomWithPrefix("tf-acc-test") + rId1 := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckQuickSightDataSourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSQuickSightDataSourceConfig(rId1, rName1), + Check: resource.ComposeTestCheckFunc( + testAccCheckQuickSightDataSourceExists(resourceName, &dataSource), + resource.TestCheckResourceAttr(resourceName, "data_source_id", rId1), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "quicksight", fmt.Sprintf("datasource/%s", rId1)), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSQuickSightDataSource_disappears(t *testing.T) { + var dataSource quicksight.DataSource + resourceName := "aws_quicksight_data_source.default" + rName := acctest.RandomWithPrefix("tf-acc-test") + rId := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckQuickSightDataSourceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSQuickSightDataSourceConfig(rId, rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckQuickSightDataSourceExists(resourceName, &dataSource), + testAccCheckQuickSightDataSourceDisappears(&dataSource), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func testAccCheckQuickSightDataSourceExists(resourceName string, dataSource *quicksight.DataSource) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[resourceName] + if !ok { + return fmt.Errorf("Not found: %s", resourceName) + } + + awsAccountID, dataSourceId, err := resourceAwsQuickSightDataSourceParseID(rs.Primary.ID) + if err != nil { + return err + } + + conn := testAccProvider.Meta().(*AWSClient).quicksightconn + + input := &quicksight.DescribeDataSourceInput{ + AwsAccountId: aws.String(awsAccountID), + DataSourceId: aws.String(dataSourceId), + } + + output, err := conn.DescribeDataSource(input) + + if err != nil { + return err + } + + if output == nil || output.DataSource == nil { + return fmt.Errorf("QuickSight Data Source (%s) not found", rs.Primary.ID) + } + + *dataSource = *output.DataSource + + return nil + } +} + +func testAccCheckQuickSightDataSourceDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).quicksightconn + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_quicksight_data_source" { + continue + } + + awsAccountID, dataSourceId, err := resourceAwsQuickSightDataSourceParseID(rs.Primary.ID) + if err != nil { + return err + } + + _, err = conn.DescribeDataSource(&quicksight.DescribeDataSourceInput{ + AwsAccountId: aws.String(awsAccountID), + DataSourceId: aws.String(dataSourceId), + }) + if isAWSErr(err, quicksight.ErrCodeResourceNotFoundException, "") { + continue + } + + if err != nil { + return err + } + + return fmt.Errorf("QuickSight Data Source '%s' was not deleted properly", rs.Primary.ID) + } + + return nil +} + +func testAccCheckQuickSightDataSourceDisappears(v *quicksight.DataSource) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).quicksightconn + + arn, err := arn.Parse(aws.StringValue(v.Arn)) + if err != nil { + return err + } + + input := &quicksight.DeleteDataSourceInput{ + AwsAccountId: aws.String(arn.AccountID), + DataSourceId: v.DataSourceId, + } + + if _, err := conn.DeleteDataSource(input); err != nil { + return err + } + + return nil + } +} + +func testAccAWSQuickSightDataSourceConfig(rId string, rName string) string { + manifestKey := acctest.RandomWithPrefix("tf-acc-test") + + return fmt.Sprintf(` +resource "aws_quicksight_data_source" "default" { + data_source_id = %[1]q + name = %[2]q + + parameters { + s3 { + manifest_file_location { + bucket = aws_s3_bucket.bucket.bucket + key = aws_s3_bucket_object.manifest.key + } + } + } +} + +resource "aws_s3_bucket" "bucket" { + bucket = %[2]q + acl = "private" +} + +resource "aws_s3_bucket_object" "manifest" { + bucket = aws_s3_bucket.bucket.bucket + key = %[3]q + content = < 0 { + request.Tags = keyvaluetags.New(v).IgnoreAws().RamTags() } log.Println("[DEBUG] Create RAM resource share request:", request) @@ -122,8 +121,8 @@ func resourceAwsRamResourceShareRead(d *schema.ResourceData, meta interface{}) e d.Set("name", resourceShare.Name) d.Set("allow_external_principals", resourceShare.AllowExternalPrincipals) - if err := d.Set("tags", tagsToMapRAM(resourceShare.Tags)); err != nil { - return fmt.Errorf("Error setting tags: %s", err) + if err := d.Set("tags", keyvaluetags.RamKeyValueTags(resourceShare.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -132,8 +131,6 @@ func resourceAwsRamResourceShareRead(d *schema.ResourceData, meta interface{}) e func resourceAwsRamResourceShareUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ramconn - d.Partial(true) - if d.HasChange("name") || d.HasChange("allow_external_principals") { request := &ram.UpdateResourceShareInput{ ResourceShareArn: aws.String(d.Id()), @@ -151,44 +148,16 @@ func resourceAwsRamResourceShareUpdate(d *schema.ResourceData, meta interface{}) } return fmt.Errorf("Error updating RAM resource share %s: %s", d.Id(), err) } - - d.SetPartial("name") - d.SetPartial("allow_external_principals") } if d.HasChange("tags") { - // Reset all tags to empty set - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - c, r := diffTagsRAM(tagsFromMapRAM(o), tagsFromMapRAM(n)) - - if len(r) > 0 { - _, err := conn.UntagResource(&ram.UntagResourceInput{ - ResourceShareArn: aws.String(d.Id()), - TagKeys: tagKeysRam(r), - }) - if err != nil { - return fmt.Errorf("Error deleting RAM resource share tags: %s", err) - } - } + o, n := d.GetChange("tags") - if len(c) > 0 { - input := &ram.TagResourceInput{ - ResourceShareArn: aws.String(d.Id()), - Tags: c, - } - _, err := conn.TagResource(input) - if err != nil { - return fmt.Errorf("Error updating RAM resource share tags: %s", err) - } + if err := keyvaluetags.RamUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating RAM resource share (%s) tags: %s", d.Id(), err) } - - d.SetPartial("tags") } - d.Partial(false) - return resourceAwsRamResourceShareRead(d, meta) } diff --git a/aws/resource_aws_ram_resource_share_accepter.go b/aws/resource_aws_ram_resource_share_accepter.go index 6f2bc07c097..8a15023255a 100644 --- a/aws/resource_aws_ram_resource_share_accepter.go +++ b/aws/resource_aws_ram_resource_share_accepter.go @@ -128,33 +128,50 @@ func resourceAwsRamResourceShareAccepterCreate(d *schema.ResourceData, meta inte } func resourceAwsRamResourceShareAccepterRead(d *schema.ResourceData, meta interface{}) error { + accountID := meta.(*AWSClient).accountid conn := meta.(*AWSClient).ramconn invitation, err := resourceAwsRamResourceShareGetInvitation(conn, d.Id(), ram.ResourceShareInvitationStatusAccepted) - if err == nil && invitation == nil { - log.Printf("[WARN] No RAM resource share invitation by ARN (%s) found, removing from state", d.Id()) - d.SetId("") - return nil + if err != nil { + return fmt.Errorf("Error retrieving invitation for resource share %s: %s", d.Id(), err) + } + + if invitation != nil { + d.Set("invitation_arn", invitation.ResourceShareInvitationArn) + d.Set("receiver_account_id", invitation.ReceiverAccountId) + } else { + d.Set("receiver_account_id", accountID) } + listResourceSharesInput := &ram.GetResourceSharesInput{ + ResourceOwner: aws.String(ram.ResourceOwnerOtherAccounts), + ResourceShareArns: aws.StringSlice([]string{d.Id()}), + } + + shares, err := conn.GetResourceShares(listResourceSharesInput) if err != nil { - return err + return fmt.Errorf("Error retrieving resource shares: %s", err) } - d.Set("status", invitation.Status) - d.Set("receiver_account_id", invitation.ReceiverAccountId) - d.Set("sender_account_id", invitation.SenderAccountId) - d.Set("share_arn", invitation.ResourceShareArn) - d.Set("invitation_arn", invitation.ResourceShareInvitationArn) + if len(shares.ResourceShares) != 1 { + log.Printf("[WARN] No RAM resource share with ARN (%s) found, removing from state", d.Id()) + d.SetId("") + return nil + } + + resourceShare := shares.ResourceShares[0] + + d.Set("status", resourceShare.Status) + d.Set("sender_account_id", resourceShare.OwningAccountId) + d.Set("share_arn", resourceShare.ResourceShareArn) d.Set("share_id", resourceAwsRamResourceShareGetIDFromARN(d.Id())) - d.Set("share_name", invitation.ResourceShareName) + d.Set("share_name", resourceShare.Name) listInput := &ram.ListResourcesInput{ MaxResults: aws.Int64(int64(500)), ResourceOwner: aws.String(ram.ResourceOwnerOtherAccounts), ResourceShareArns: aws.StringSlice([]string{d.Id()}), - Principal: invitation.SenderAccountId, } var resourceARNs []*string diff --git a/aws/resource_aws_ram_resource_share_accepter_test.go b/aws/resource_aws_ram_resource_share_accepter_test.go index 9bafaf6eab5..ec93a33c892 100644 --- a/aws/resource_aws_ram_resource_share_accepter_test.go +++ b/aws/resource_aws_ram_resource_share_accepter_test.go @@ -34,7 +34,7 @@ func TestAccAwsRamResourceShareAccepter_basic(t *testing.T) { resource.TestMatchResourceAttr(resourceName, "share_arn", regexp.MustCompile(`^arn\:aws\:ram\:.*resource-share/.+$`)), resource.TestMatchResourceAttr(resourceName, "invitation_arn", regexp.MustCompile(`^arn\:aws\:ram\:.*resource-share-invitation/.+$`)), resource.TestMatchResourceAttr(resourceName, "share_id", regexp.MustCompile(`^rs-.+$`)), - resource.TestCheckResourceAttr(resourceName, "status", ram.ResourceShareInvitationStatusAccepted), + resource.TestCheckResourceAttr(resourceName, "status", ram.ResourceShareStatusActive), resource.TestMatchResourceAttr(resourceName, "receiver_account_id", regexp.MustCompile(`\d{12}`)), resource.TestMatchResourceAttr(resourceName, "sender_account_id", regexp.MustCompile(`\d{12}`)), resource.TestCheckResourceAttr(resourceName, "share_name", shareName), diff --git a/aws/resource_aws_rds_cluster.go b/aws/resource_aws_rds_cluster.go index d1e142d42d6..ad12871a893 100644 --- a/aws/resource_aws_rds_cluster.go +++ b/aws/resource_aws_rds_cluster.go @@ -13,6 +13,12 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +const ( + rdsClusterScalingConfiguration_DefaultMinCapacity = 2 + rdsClusterScalingConfiguration_DefaultMaxCapacity = 16 ) func resourceAwsRDSCluster() *schema.Resource { @@ -157,15 +163,10 @@ func resourceAwsRDSCluster() *schema.Resource { }, "scaling_configuration": { - Type: schema.TypeList, - Optional: true, - MaxItems: 1, - DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { - if old == "1" && new == "0" { - return true - } - return false - }, + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + DiffSuppressFunc: suppressMissingOptionalConfigurationBlock, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "auto_pause": { @@ -176,12 +177,12 @@ func resourceAwsRDSCluster() *schema.Resource { "max_capacity": { Type: schema.TypeInt, Optional: true, - Default: 16, + Default: rdsClusterScalingConfiguration_DefaultMaxCapacity, }, "min_capacity": { Type: schema.TypeInt, Optional: true, - Default: 2, + Default: rdsClusterScalingConfiguration_DefaultMinCapacity, }, "seconds_until_auto_pause": { Type: schema.TypeInt, @@ -402,6 +403,11 @@ func resourceAwsRDSCluster() *schema.Resource { }, false), }, }, + "enable_http_endpoint": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, "tags": tagsSchema(), }, @@ -419,7 +425,7 @@ func resourceAwsRdsClusterImport( func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).rdsconn - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags() // Some API calls (e.g. RestoreDBClusterFromSnapshot do not support all // parameters to correctly apply all settings in one pass. For missing @@ -447,7 +453,7 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error DeletionProtection: aws.Bool(d.Get("deletion_protection").(bool)), Engine: aws.String(d.Get("engine").(string)), EngineMode: aws.String(d.Get("engine_mode").(string)), - ScalingConfiguration: expandRdsScalingConfiguration(d.Get("scaling_configuration").([]interface{})), + ScalingConfiguration: expandRdsClusterScalingConfiguration(d.Get("scaling_configuration").([]interface{}), d.Get("engine_mode").(string)), SnapshotIdentifier: aws.String(d.Get("snapshot_identifier").(string)), Tags: tags, } @@ -543,7 +549,7 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error Engine: aws.String(d.Get("engine").(string)), EngineMode: aws.String(d.Get("engine_mode").(string)), ReplicationSourceIdentifier: aws.String(d.Get("replication_source_identifier").(string)), - ScalingConfiguration: expandRdsScalingConfiguration(d.Get("scaling_configuration").([]interface{})), + ScalingConfiguration: expandRdsClusterScalingConfiguration(d.Get("scaling_configuration").([]interface{}), d.Get("engine_mode").(string)), Tags: tags, } @@ -762,7 +768,7 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error DeletionProtection: aws.Bool(d.Get("deletion_protection").(bool)), Engine: aws.String(d.Get("engine").(string)), EngineMode: aws.String(d.Get("engine_mode").(string)), - ScalingConfiguration: expandRdsScalingConfiguration(d.Get("scaling_configuration").([]interface{})), + ScalingConfiguration: expandRdsClusterScalingConfiguration(d.Get("scaling_configuration").([]interface{}), d.Get("engine_mode").(string)), Tags: tags, } @@ -774,6 +780,9 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error createOpts.MasterUsername = aws.String(v.(string)) } + if v, ok := d.GetOk("enable_http_endpoint"); ok { + createOpts.EnableHttpEndpoint = aws.Bool(v.(bool)) + } // Need to check value > 0 due to: // InvalidParameterValue: Backtrack is not enabled for the aurora-postgresql engine. if v, ok := d.GetOk("backtrack_window"); ok && v.(int) > 0 { @@ -840,10 +849,6 @@ func resourceAwsRDSClusterCreate(d *schema.ResourceData, meta interface{}) error createOpts.EnableCloudwatchLogsExports = expandStringList(attr.([]interface{})) } - if attr, ok := d.GetOk("scaling_configuration"); ok && len(attr.([]interface{})) > 0 { - createOpts.ScalingConfiguration = expandRdsScalingConfiguration(attr.([]interface{})) - } - if attr, ok := d.GetOkExists("storage_encrypted"); ok { createOpts.StorageEncrypted = aws.Bool(attr.(bool)) } @@ -1023,6 +1028,7 @@ func resourceAwsRDSClusterRead(d *schema.ResourceData, meta interface{}) error { } d.Set("storage_encrypted", dbc.StorageEncrypted) + d.Set("enable_http_endpoint", dbc.HttpEndpointEnabled) var vpcg []string for _, g := range dbc.VpcSecurityGroups { @@ -1032,9 +1038,12 @@ func resourceAwsRDSClusterRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("error setting vpc_security_group_ids: %s", err) } - // Fetch and save tags - if err := saveTagsRDS(conn, d, aws.StringValue(dbc.DBClusterArn)); err != nil { - log.Printf("[WARN] Failed to save tags for RDS Cluster (%s): %s", aws.StringValue(dbc.DBClusterIdentifier), err) + tags, err := keyvaluetags.RdsListTags(conn, aws.StringValue(dbc.DBClusterArn)) + if err != nil { + return fmt.Errorf("error listing tags for RDS Cluster (%s): %s", aws.StringValue(dbc.DBClusterArn), err) + } + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } // Fetch and save Global Cluster if engine mode global @@ -1132,7 +1141,13 @@ func resourceAwsRDSClusterUpdate(d *schema.ResourceData, meta interface{}) error if d.HasChange("scaling_configuration") { d.SetPartial("scaling_configuration") - req.ScalingConfiguration = expandRdsScalingConfiguration(d.Get("scaling_configuration").([]interface{})) + req.ScalingConfiguration = expandRdsClusterScalingConfiguration(d.Get("scaling_configuration").([]interface{}), d.Get("engine_mode").(string)) + requestUpdate = true + } + + if d.HasChange("enable_http_endpoint") { + d.SetPartial("enable_http_endpoint") + req.EnableHttpEndpoint = aws.Bool(d.Get("enable_http_endpoint").(bool)) requestUpdate = true } @@ -1223,8 +1238,10 @@ func resourceAwsRDSClusterUpdate(d *schema.ResourceData, meta interface{}) error } if d.HasChange("tags") { - if err := setTagsRDS(conn, d, d.Get("arn").(string)); err != nil { - return err + o, n := d.GetChange("tags") + + if err := keyvaluetags.RdsUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) } else { d.SetPartial("tags") } diff --git a/aws/resource_aws_rds_cluster_endpoint.go b/aws/resource_aws_rds_cluster_endpoint.go index 71d40ccde46..844ca91d958 100644 --- a/aws/resource_aws_rds_cluster_endpoint.go +++ b/aws/resource_aws_rds_cluster_endpoint.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) const ( @@ -70,6 +71,7 @@ func resourceAwsRDSClusterEndpoint() *schema.Resource { Type: schema.TypeString, Computed: true, }, + "tags": tagsSchema(), }, } } @@ -85,6 +87,7 @@ func resourceAwsRDSClusterEndpointCreate(d *schema.ResourceData, meta interface{ DBClusterIdentifier: aws.String(clusterId), DBClusterEndpointIdentifier: aws.String(endpointId), EndpointType: aws.String(endpointType), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags(), } if v := d.Get("static_members"); v != nil { @@ -140,9 +143,10 @@ func resourceAwsRDSClusterEndpointRead(d *schema.ResourceData, meta interface{}) return nil } + arn := clusterEp.DBClusterEndpointArn d.Set("cluster_endpoint_identifier", clusterEp.DBClusterEndpointIdentifier) d.Set("cluster_identifier", clusterEp.DBClusterIdentifier) - d.Set("arn", clusterEp.DBClusterEndpointArn) + d.Set("arn", arn) d.Set("endpoint", clusterEp.Endpoint) d.Set("custom_endpoint_type", clusterEp.CustomEndpointType) @@ -154,6 +158,16 @@ func resourceAwsRDSClusterEndpointRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("error setting static_members: %s", err) } + tags, err := keyvaluetags.RdsListTags(conn, *arn) + + if err != nil { + return fmt.Errorf("error listing tags for RDS Cluster Endpoint (%s): %s", *arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + return nil } @@ -163,6 +177,14 @@ func resourceAwsRDSClusterEndpointUpdate(d *schema.ResourceData, meta interface{ DBClusterEndpointIdentifier: aws.String(d.Id()), } + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.RdsUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating RDS Cluster Endpoint (%s) tags: %s", d.Get("arn").(string), err) + } + } + if v, ok := d.GetOk("custom_endpoint_type"); ok { input.EndpointType = aws.String(v.(string)) } diff --git a/aws/resource_aws_rds_cluster_endpoint_test.go b/aws/resource_aws_rds_cluster_endpoint_test.go index 9c6b246c20b..eebb9cdd920 100644 --- a/aws/resource_aws_rds_cluster_endpoint_test.go +++ b/aws/resource_aws_rds_cluster_endpoint_test.go @@ -38,6 +38,8 @@ func TestAccAWSRDSClusterEndpoint_basic(t *testing.T) { resource.TestCheckResourceAttrSet(readerResourceName, "endpoint"), testAccMatchResourceAttrRegionalARN(defaultResourceName, "arn", "rds", regexp.MustCompile(`cluster-endpoint:.+`)), resource.TestCheckResourceAttrSet(defaultResourceName, "endpoint"), + resource.TestCheckResourceAttr(defaultResourceName, "tags.%", "0"), + resource.TestCheckResourceAttr(readerResourceName, "tags.%", "0"), ), }, { @@ -55,6 +57,50 @@ func TestAccAWSRDSClusterEndpoint_basic(t *testing.T) { }) } +func TestAccAWSRDSClusterEndpoint_tags(t *testing.T) { + rInt := acctest.RandInt() + var customReaderEndpoint rds.DBClusterEndpoint + resourceName := "aws_rds_cluster_endpoint.reader" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSClusterEndpointDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSClusterEndpointConfigTags1(rInt, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRDSClusterEndpointExists(resourceName, &customReaderEndpoint), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSClusterEndpointConfigTags2(rInt, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRDSClusterEndpointExists(resourceName, &customReaderEndpoint), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSClusterEndpointConfigTags1(rInt, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRDSClusterEndpointExists(resourceName, &customReaderEndpoint), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func testAccCheckAWSRDSClusterEndpointAttributes(v *rds.DBClusterEndpoint) resource.TestCheckFunc { return func(s *terraform.State) error { @@ -160,10 +206,10 @@ func testAccCheckAWSRDSClusterEndpointExistsWithProvider(resourceName string, en } } -func testAccAWSClusterEndpointConfig(n int) string { +func testAccAWSClusterEndpointConfigBase(n int) string { return fmt.Sprintf(` resource "aws_rds_cluster" "default" { - cluster_identifier = "tf-aurora-cluster-%d" + cluster_identifier = "tf-aurora-cluster-%[1]d" availability_zones = ["us-west-2a", "us-west-2b", "us-west-2c"] database_name = "mydb" master_username = "foo" @@ -175,20 +221,24 @@ resource "aws_rds_cluster" "default" { resource "aws_rds_cluster_instance" "test1" { apply_immediately = true cluster_identifier = "${aws_rds_cluster.default.id}" - identifier = "tf-aurora-cluster-instance-test1-%d" + identifier = "tf-aurora-cluster-instance-test1-%[1]d" instance_class = "db.t2.small" } resource "aws_rds_cluster_instance" "test2" { apply_immediately = true cluster_identifier = "${aws_rds_cluster.default.id}" - identifier = "tf-aurora-cluster-instance-test2-%d" + identifier = "tf-aurora-cluster-instance-test2-%[1]d" instance_class = "db.t2.small" } +`, n) +} +func testAccAWSClusterEndpointConfig(n int) string { + return testAccAWSClusterEndpointConfigBase(n) + fmt.Sprintf(` resource "aws_rds_cluster_endpoint" "reader" { cluster_identifier = "${aws_rds_cluster.default.id}" - cluster_endpoint_identifier = "reader-%d" + cluster_endpoint_identifier = "reader-%[1]d" custom_endpoint_type = "READER" static_members = ["${aws_rds_cluster_instance.test2.id}"] @@ -196,10 +246,43 @@ resource "aws_rds_cluster_endpoint" "reader" { resource "aws_rds_cluster_endpoint" "default" { cluster_identifier = "${aws_rds_cluster.default.id}" - cluster_endpoint_identifier = "default-%d" + cluster_endpoint_identifier = "default-%[1]d" custom_endpoint_type = "ANY" excluded_members = ["${aws_rds_cluster_instance.test2.id}"] } -`, n, n, n, n, n) +`, n) +} + +func testAccAWSClusterEndpointConfigTags1(n int, tagKey1, tagValue1 string) string { + return testAccAWSClusterEndpointConfigBase(n) + fmt.Sprintf(` +resource "aws_rds_cluster_endpoint" "reader" { + cluster_identifier = "${aws_rds_cluster.default.id}" + cluster_endpoint_identifier = "reader-%[1]d" + custom_endpoint_type = "READER" + + static_members = ["${aws_rds_cluster_instance.test2.id}"] + + tags = { + %[2]q = %[3]q + } +} +`, n, tagKey1, tagValue1) +} + +func testAccAWSClusterEndpointConfigTags2(n int, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccAWSClusterEndpointConfigBase(n) + fmt.Sprintf(` +resource "aws_rds_cluster_endpoint" "reader" { + cluster_identifier = "${aws_rds_cluster.default.id}" + cluster_endpoint_identifier = "reader-%[1]d" + custom_endpoint_type = "READER" + + static_members = ["${aws_rds_cluster_instance.test2.id}"] + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, n, tagKey1, tagValue1, tagKey2, tagValue2) } diff --git a/aws/resource_aws_rds_cluster_instance.go b/aws/resource_aws_rds_cluster_instance.go index 02e8e94a95e..f3b1fb06788 100644 --- a/aws/resource_aws_rds_cluster_instance.go +++ b/aws/resource_aws_rds_cluster_instance.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsRDSClusterInstance() *schema.Resource { @@ -205,6 +206,11 @@ func resourceAwsRDSClusterInstance() *schema.Resource { Optional: true, Default: false, }, + "ca_cert_identifier": { + Type: schema.TypeString, + Optional: true, + Computed: true, + }, "tags": tagsSchema(), }, @@ -213,7 +219,6 @@ func resourceAwsRDSClusterInstance() *schema.Resource { 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)), @@ -223,7 +228,7 @@ func resourceAwsRDSClusterInstanceCreate(d *schema.ResourceData, meta interface{ 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, + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags(), } if attr, ok := d.GetOk("availability_zone"); ok { @@ -314,6 +319,63 @@ func resourceAwsRDSClusterInstanceCreate(d *schema.ResourceData, meta interface{ return err } + // See also: resource_aws_db_instance.go + // Some API calls (e.g. CreateDBInstanceReadReplica and + // RestoreDBInstanceFromDBSnapshot do not support all parameters to + // correctly apply all settings in one pass. For missing parameters or + // unsupported configurations, we may need to call ModifyDBInstance + // afterwards to prevent Terraform operators from API errors or needing + // to double apply. + var requiresModifyDbInstance bool + modifyDbInstanceInput := &rds.ModifyDBInstanceInput{ + ApplyImmediately: aws.Bool(true), + } + + // Some ModifyDBInstance parameters (e.g. DBParameterGroupName) require + // a database instance reboot to take affect. During resource creation, + // we expect everything to be in sync before returning completion. + var requiresRebootDbInstance bool + + if attr, ok := d.GetOk("ca_cert_identifier"); ok && attr.(string) != aws.StringValue(resp.DBInstance.CACertificateIdentifier) { + modifyDbInstanceInput.CACertificateIdentifier = aws.String(attr.(string)) + requiresModifyDbInstance = true + requiresRebootDbInstance = true + } + + if requiresModifyDbInstance { + modifyDbInstanceInput.DBInstanceIdentifier = aws.String(d.Id()) + + log.Printf("[INFO] DB Instance (%s) configuration requires ModifyDBInstance: %s", d.Id(), modifyDbInstanceInput) + _, err := conn.ModifyDBInstance(modifyDbInstanceInput) + if err != nil { + return fmt.Errorf("error modifying DB Instance (%s): %s", d.Id(), err) + } + + log.Printf("[INFO] Waiting for DB Instance (%s) to be available", d.Id()) + err = waitUntilAwsDbInstanceIsAvailableAfterUpdate(d.Id(), conn, d.Timeout(schema.TimeoutUpdate)) + if err != nil { + return fmt.Errorf("error waiting for DB Instance (%s) to be available: %s", d.Id(), err) + } + } + + if requiresRebootDbInstance { + rebootDbInstanceInput := &rds.RebootDBInstanceInput{ + DBInstanceIdentifier: aws.String(d.Id()), + } + + log.Printf("[INFO] DB Instance (%s) configuration requires RebootDBInstance: %s", d.Id(), rebootDbInstanceInput) + _, err := conn.RebootDBInstance(rebootDbInstanceInput) + if err != nil { + return fmt.Errorf("error rebooting DB Instance (%s): %s", d.Id(), err) + } + + log.Printf("[INFO] Waiting for DB Instance (%s) to be available", d.Id()) + err = waitUntilAwsDbInstanceIsAvailableAfterUpdate(d.Id(), conn, d.Timeout(schema.TimeoutUpdate)) + if err != nil { + return fmt.Errorf("error waiting for DB Instance (%s) to be available: %s", d.Id(), err) + } + } + return resourceAwsRDSClusterInstanceRead(d, meta) } @@ -391,13 +453,18 @@ func resourceAwsRDSClusterInstanceRead(d *schema.ResourceData, meta interface{}) d.Set("promotion_tier", db.PromotionTier) d.Set("publicly_accessible", db.PubliclyAccessible) d.Set("storage_encrypted", db.StorageEncrypted) + d.Set("ca_cert_identifier", db.CACertificateIdentifier) if len(db.DBParameterGroups) > 0 { d.Set("db_parameter_group_name", db.DBParameterGroups[0].DBParameterGroupName) } - if err := saveTagsRDS(conn, d, aws.StringValue(db.DBInstanceArn)); err != nil { - log.Printf("[WARN] Failed to save tags for RDS Cluster Instance (%s): %s", *db.DBClusterIdentifier, err) + tags, err := keyvaluetags.RdsListTags(conn, aws.StringValue(db.DBInstanceArn)) + if err != nil { + return fmt.Errorf("error listing tags for RDS Cluster Instance (%s): %s", d.Id(), err) + } + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -482,6 +549,12 @@ func resourceAwsRDSClusterInstanceUpdate(d *schema.ResourceData, meta interface{ requestUpdate = true } + if d.HasChange("ca_cert_identifier") { + d.SetPartial("ca_cert_identifier") + req.CACertificateIdentifier = aws.String(d.Get("ca_cert_identifier").(string)) + requestUpdate = true + } + log.Printf("[DEBUG] Send DB Instance Modification request: %#v", requestUpdate) if requestUpdate { log.Printf("[DEBUG] DB Instance Modification request: %#v", req) @@ -520,8 +593,12 @@ func resourceAwsRDSClusterInstanceUpdate(d *schema.ResourceData, meta interface{ } - if err := setTagsRDS(conn, d, d.Get("arn").(string)); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.RdsUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating RDS Cluster Instance (%s) tags: %s", d.Id(), err) + } } return resourceAwsRDSClusterInstanceRead(d, meta) @@ -535,8 +612,10 @@ func resourceAwsRDSClusterInstanceDelete(d *schema.ResourceData, meta interface{ 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 + _, err := conn.DeleteDBInstance(&opts) + + if err != nil && !isAWSErr(err, rds.ErrCodeInvalidDBInstanceStateFault, "is already being deleted") { + return fmt.Errorf("error deleting Database Instance %q: %s", d.Id(), err) } // re-uses db_instance refresh func @@ -550,7 +629,7 @@ func resourceAwsRDSClusterInstanceDelete(d *schema.ResourceData, meta interface{ Delay: 30 * time.Second, // Wait 30 secs before starting } - _, err := stateConf.WaitForState() + _, err = stateConf.WaitForState() return err } diff --git a/aws/resource_aws_rds_cluster_instance_test.go b/aws/resource_aws_rds_cluster_instance_test.go index 24551f7f4ae..ea4e527ba27 100644 --- a/aws/resource_aws_rds_cluster_instance_test.go +++ b/aws/resource_aws_rds_cluster_instance_test.go @@ -18,6 +18,7 @@ import ( func TestAccAWSRDSClusterInstance_basic(t *testing.T) { var v rds.DBInstance + resourceName := "aws_rds_cluster_instance.cluster_instances" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -27,21 +28,21 @@ func TestAccAWSRDSClusterInstance_basic(t *testing.T) { { Config: testAccAWSClusterInstanceConfig(acctest.RandInt()), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSClusterInstanceExists("aws_rds_cluster_instance.cluster_instances", &v), + testAccCheckAWSClusterInstanceExists(resourceName, &v), testAccCheckAWSDBClusterInstanceAttributes(&v), - resource.TestMatchResourceAttr("aws_rds_cluster_instance.cluster_instances", "arn", regexp.MustCompile(`^arn:[^:]+:rds:[^:]+:[^:]+:db:.+`)), - resource.TestCheckResourceAttr("aws_rds_cluster_instance.cluster_instances", "auto_minor_version_upgrade", "true"), - resource.TestCheckResourceAttr("aws_rds_cluster_instance.cluster_instances", "copy_tags_to_snapshot", "false"), - resource.TestCheckResourceAttrSet("aws_rds_cluster_instance.cluster_instances", "preferred_maintenance_window"), - resource.TestCheckResourceAttrSet("aws_rds_cluster_instance.cluster_instances", "preferred_backup_window"), - resource.TestCheckResourceAttrSet("aws_rds_cluster_instance.cluster_instances", "dbi_resource_id"), - resource.TestCheckResourceAttrSet("aws_rds_cluster_instance.cluster_instances", "availability_zone"), - resource.TestCheckResourceAttrSet("aws_rds_cluster_instance.cluster_instances", "engine_version"), - resource.TestCheckResourceAttr("aws_rds_cluster_instance.cluster_instances", "engine", "aurora"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "rds", regexp.MustCompile(`db:.+`)), + resource.TestCheckResourceAttr(resourceName, "auto_minor_version_upgrade", "true"), + resource.TestCheckResourceAttr(resourceName, "copy_tags_to_snapshot", "false"), + resource.TestCheckResourceAttrSet(resourceName, "preferred_maintenance_window"), + resource.TestCheckResourceAttrSet(resourceName, "preferred_backup_window"), + resource.TestCheckResourceAttrSet(resourceName, "dbi_resource_id"), + resource.TestCheckResourceAttrSet(resourceName, "availability_zone"), + resource.TestCheckResourceAttrSet(resourceName, "engine_version"), + resource.TestCheckResourceAttr(resourceName, "engine", "aurora"), ), }, { - ResourceName: "aws_rds_cluster_instance.cluster_instances", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -52,17 +53,54 @@ func TestAccAWSRDSClusterInstance_basic(t *testing.T) { { Config: testAccAWSClusterInstanceConfigModified(acctest.RandInt()), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSClusterInstanceExists("aws_rds_cluster_instance.cluster_instances", &v), + testAccCheckAWSClusterInstanceExists(resourceName, &v), testAccCheckAWSDBClusterInstanceAttributes(&v), - resource.TestCheckResourceAttr("aws_rds_cluster_instance.cluster_instances", "auto_minor_version_upgrade", "false"), + resource.TestCheckResourceAttr(resourceName, "auto_minor_version_upgrade", "false"), + ), + }, + }, + }) +} + +func TestAccAWSRDSClusterInstance_isAlreadyBeingDeleted(t *testing.T) { + var v rds.DBInstance + resourceName := "aws_rds_cluster_instance.cluster_instances" + rInt := acctest.RandInt() + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSClusterInstanceConfig(rInt), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSClusterInstanceExists(resourceName, &v), ), }, + { + PreConfig: func() { + // Get Database Instance into deleting state + conn := testAccProvider.Meta().(*AWSClient).rdsconn + input := &rds.DeleteDBInstanceInput{ + DBInstanceIdentifier: aws.String(fmt.Sprintf("tf-cluster-instance-%d", rInt)), + SkipFinalSnapshot: aws.Bool(true), + } + _, err := conn.DeleteDBInstance(input) + if err != nil { + t.Fatalf("error deleting Database Instance: %s", err) + } + }, + Config: testAccAWSClusterInstanceConfig(rInt), + Destroy: true, + }, }, }) } func TestAccAWSRDSClusterInstance_az(t *testing.T) { var v rds.DBInstance + resourceName := "aws_rds_cluster_instance.cluster_instances" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -72,13 +110,13 @@ func TestAccAWSRDSClusterInstance_az(t *testing.T) { { Config: testAccAWSClusterInstanceConfig_az(acctest.RandInt()), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSClusterInstanceExists("aws_rds_cluster_instance.cluster_instances", &v), + testAccCheckAWSClusterInstanceExists(resourceName, &v), testAccCheckAWSDBClusterInstanceAttributes(&v), - resource.TestMatchResourceAttr("aws_rds_cluster_instance.cluster_instances", "availability_zone", regexp.MustCompile("^us-west-2[a-z]{1}$")), + resource.TestMatchResourceAttr(resourceName, "availability_zone", regexp.MustCompile("^us-west-2[a-z]{1}$")), ), }, { - ResourceName: "aws_rds_cluster_instance.cluster_instances", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -93,6 +131,7 @@ func TestAccAWSRDSClusterInstance_az(t *testing.T) { func TestAccAWSRDSClusterInstance_namePrefix(t *testing.T) { var v rds.DBInstance rInt := acctest.RandInt() + resourceName := "aws_rds_cluster_instance.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -102,16 +141,14 @@ func TestAccAWSRDSClusterInstance_namePrefix(t *testing.T) { { Config: testAccAWSClusterInstanceConfig_namePrefix(rInt), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSClusterInstanceExists("aws_rds_cluster_instance.test", &v), + testAccCheckAWSClusterInstanceExists(resourceName, &v), testAccCheckAWSDBClusterInstanceAttributes(&v), - resource.TestCheckResourceAttr( - "aws_rds_cluster_instance.test", "db_subnet_group_name", fmt.Sprintf("tf-test-%d", rInt)), - resource.TestMatchResourceAttr( - "aws_rds_cluster_instance.test", "identifier", regexp.MustCompile("^tf-cluster-instance-")), + resource.TestCheckResourceAttr(resourceName, "db_subnet_group_name", fmt.Sprintf("tf-test-%d", rInt)), + resource.TestMatchResourceAttr(resourceName, "identifier", regexp.MustCompile("^tf-cluster-instance-")), ), }, { - ResourceName: "aws_rds_cluster_instance.test", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -125,6 +162,7 @@ func TestAccAWSRDSClusterInstance_namePrefix(t *testing.T) { func TestAccAWSRDSClusterInstance_generatedName(t *testing.T) { var v rds.DBInstance + resourceName := "aws_rds_cluster_instance.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -134,14 +172,13 @@ func TestAccAWSRDSClusterInstance_generatedName(t *testing.T) { { Config: testAccAWSClusterInstanceConfig_generatedName(acctest.RandInt()), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSClusterInstanceExists("aws_rds_cluster_instance.test", &v), + testAccCheckAWSClusterInstanceExists(resourceName, &v), testAccCheckAWSDBClusterInstanceAttributes(&v), - resource.TestMatchResourceAttr( - "aws_rds_cluster_instance.test", "identifier", regexp.MustCompile("^tf-")), + resource.TestMatchResourceAttr(resourceName, "identifier", regexp.MustCompile("^tf-")), ), }, { - ResourceName: "aws_rds_cluster_instance.test", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -156,6 +193,7 @@ func TestAccAWSRDSClusterInstance_generatedName(t *testing.T) { func TestAccAWSRDSClusterInstance_kmsKey(t *testing.T) { var v rds.DBInstance keyRegex := regexp.MustCompile("^arn:aws:kms:") + resourceName := "aws_rds_cluster_instance.cluster_instances" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -165,13 +203,12 @@ func TestAccAWSRDSClusterInstance_kmsKey(t *testing.T) { { Config: testAccAWSClusterInstanceConfigKmsKey(acctest.RandInt()), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSClusterInstanceExists("aws_rds_cluster_instance.cluster_instances", &v), - resource.TestMatchResourceAttr( - "aws_rds_cluster_instance.cluster_instances", "kms_key_id", keyRegex), + testAccCheckAWSClusterInstanceExists(resourceName, &v), + resource.TestMatchResourceAttr(resourceName, "kms_key_id", keyRegex), ), }, { - ResourceName: "aws_rds_cluster_instance.cluster_instances", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -186,6 +223,7 @@ func TestAccAWSRDSClusterInstance_kmsKey(t *testing.T) { // https://github.com/hashicorp/terraform/issues/5350 func TestAccAWSRDSClusterInstance_disappears(t *testing.T) { var v rds.DBInstance + resourceName := "aws_rds_cluster_instance.cluster_instances" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -195,7 +233,7 @@ func TestAccAWSRDSClusterInstance_disappears(t *testing.T) { { Config: testAccAWSClusterInstanceConfig(acctest.RandInt()), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSClusterInstanceExists("aws_rds_cluster_instance.cluster_instances", &v), + testAccCheckAWSClusterInstanceExists(resourceName, &v), testAccAWSClusterInstanceDisappears(&v), ), // A non-empty plan is what we want. A crash is what we don't want. :) @@ -245,6 +283,7 @@ func TestAccAWSRDSClusterInstance_PubliclyAccessible(t *testing.T) { func TestAccAWSRDSClusterInstance_CopyTagsToSnapshot(t *testing.T) { var dbInstance rds.DBInstance rNameSuffix := acctest.RandInt() + resourceName := "aws_rds_cluster_instance.cluster_instances" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -254,13 +293,12 @@ func TestAccAWSRDSClusterInstance_CopyTagsToSnapshot(t *testing.T) { { Config: testAccAWSClusterInstanceConfig_CopyTagsToSnapshot(rNameSuffix, true), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSClusterInstanceExists("aws_rds_cluster_instance.cluster_instances", &dbInstance), - resource.TestCheckResourceAttr( - "aws_rds_cluster_instance.cluster_instances", "copy_tags_to_snapshot", "true"), + testAccCheckAWSClusterInstanceExists(resourceName, &dbInstance), + resource.TestCheckResourceAttr(resourceName, "copy_tags_to_snapshot", "true"), ), }, { - ResourceName: "aws_rds_cluster_instance.cluster_instances", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -271,9 +309,8 @@ func TestAccAWSRDSClusterInstance_CopyTagsToSnapshot(t *testing.T) { { Config: testAccAWSClusterInstanceConfig_CopyTagsToSnapshot(rNameSuffix, false), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSClusterInstanceExists("aws_rds_cluster_instance.cluster_instances", &dbInstance), - resource.TestCheckResourceAttr( - "aws_rds_cluster_instance.cluster_instances", "copy_tags_to_snapshot", "false"), + testAccCheckAWSClusterInstanceExists(resourceName, &dbInstance), + resource.TestCheckResourceAttr(resourceName, "copy_tags_to_snapshot", "false"), ), }, }, @@ -311,7 +348,7 @@ func testAccAWSClusterInstanceDisappears(v *rds.DBInstance) resource.TestCheckFu _, err := conn.DescribeDBInstances(opts) if err != nil { dbinstanceerr, ok := err.(awserr.Error) - if ok && dbinstanceerr.Code() == "DBInstanceNotFound" { + if ok && dbinstanceerr.Code() == rds.ErrCodeDBInstanceNotFoundFault { return nil } return resource.NonRetryableError( @@ -805,6 +842,43 @@ func TestAccAWSRDSClusterInstance_PerformanceInsightsKmsKeyId_AuroraPostgresql_D }) } +func TestAccAWSRDSClusterInstance_CACertificateIdentifier(t *testing.T) { + var dbInstance rds.DBInstance + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_rds_cluster_instance.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRDSClusterInstanceConfig_CACertificateIdentifier(rName, "rds-ca-2015"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSClusterInstanceExists(resourceName, &dbInstance), + resource.TestCheckResourceAttr(resourceName, "ca_cert_identifier", "rds-ca-2015"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "apply_immediately", + "identifier_prefix", + }, + }, + { + Config: testAccAWSRDSClusterInstanceConfig_CACertificateIdentifier(rName, "rds-ca-2019"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSClusterInstanceExists(resourceName, &dbInstance), + resource.TestCheckResourceAttr(resourceName, "ca_cert_identifier", "rds-ca-2019"), + ), + }, + }, + }) +} + // Add some random to the name, to avoid collision func testAccAWSClusterInstanceConfig(n int) string { return fmt.Sprintf(` @@ -1378,3 +1452,22 @@ resource "aws_rds_cluster_instance" "cluster_instances" { } `, n, n, f) } + +func testAccAWSRDSClusterInstanceConfig_CACertificateIdentifier(rName string, caCertificateIdentifier string) string { + return fmt.Sprintf(` +resource "aws_rds_cluster" "test" { + cluster_identifier = %q + master_username = "foo" + master_password = "mustbeeightcharacters" + skip_final_snapshot = true +} + +resource "aws_rds_cluster_instance" "test" { + apply_immediately = true + cluster_identifier = "${aws_rds_cluster.test.id}" + identifier = %q + instance_class = "db.t2.small" + ca_cert_identifier = %q +} +`, rName, rName, caCertificateIdentifier) +} diff --git a/aws/resource_aws_rds_cluster_parameter_group.go b/aws/resource_aws_rds_cluster_parameter_group.go index 72a11519317..221cf09c53c 100644 --- a/aws/resource_aws_rds_cluster_parameter_group.go +++ b/aws/resource_aws_rds_cluster_parameter_group.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) const rdsClusterParameterGroupMaxParamsBulkEdit = 20 @@ -88,7 +89,6 @@ func resourceAwsRDSClusterParameterGroup() *schema.Resource { func resourceAwsRDSClusterParameterGroupCreate(d *schema.ResourceData, meta interface{}) error { rdsconn := meta.(*AWSClient).rdsconn - tags := tagsFromMapRDS(d.Get("tags").(map[string]interface{})) var groupName string if v, ok := d.GetOk("name"); ok { @@ -103,7 +103,7 @@ func resourceAwsRDSClusterParameterGroupCreate(d *schema.ResourceData, meta inte DBClusterParameterGroupName: aws.String(groupName), DBParameterGroupFamily: aws.String(d.Get("family").(string)), Description: aws.String(d.Get("description").(string)), - Tags: tags, + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RdsTags(), } log.Printf("[DEBUG] Create DB Cluster Parameter Group: %#v", createOpts) @@ -161,7 +161,9 @@ func resourceAwsRDSClusterParameterGroupRead(d *schema.ResourceData, meta interf return err } - d.Set("parameter", flattenParameters(describeParametersResp.Parameters)) + if err := d.Set("parameter", flattenParameters(describeParametersResp.Parameters)); err != nil { + return fmt.Errorf("error setting parameters: %s", err) + } resp, err := rdsconn.ListTagsForResource(&rds.ListTagsForResourceInput{ ResourceName: aws.String(arn), @@ -170,11 +172,9 @@ func resourceAwsRDSClusterParameterGroupRead(d *schema.ResourceData, meta interf log.Printf("[DEBUG] Error retrieving tags for ARN: %s", arn) } - var dt []*rds.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList + if err := d.Set("tags", keyvaluetags.RdsKeyValueTags(resp.TagList).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - d.Set("tags", tagsToMapRDS(dt)) return nil } @@ -221,16 +221,56 @@ func resourceAwsRDSClusterParameterGroupUpdate(d *schema.ResourceData, meta inte 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) + return fmt.Errorf("error modifying DB Cluster Parameter Group: %s", err) + } + } + } + + // Reset parameters that have been removed + parameters, err = expandParameters(os.Difference(ns).List()) + if err != nil { + return err + } + if len(parameters) > 0 { + for parameters != nil { + parameterGroupName := d.Get("name").(string) + var paramsToReset []*rds.Parameter + if len(parameters) <= rdsClusterParameterGroupMaxParamsBulkEdit { + paramsToReset, parameters = parameters[:], nil + } else { + paramsToReset, parameters = parameters[:rdsClusterParameterGroupMaxParamsBulkEdit], parameters[rdsClusterParameterGroupMaxParamsBulkEdit:] + } + + resetOpts := rds.ResetDBClusterParameterGroupInput{ + DBClusterParameterGroupName: aws.String(parameterGroupName), + Parameters: paramsToReset, + ResetAllParameters: aws.Bool(false), + } + + log.Printf("[DEBUG] Reset DB Cluster Parameter Group: %s", resetOpts) + err := resource.Retry(3*time.Minute, func() *resource.RetryError { + _, err := rdsconn.ResetDBClusterParameterGroup(&resetOpts) + if err != nil { + if isAWSErr(err, "InvalidDBParameterGroupState", "has pending changes") { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) + } + return nil + }) + if err != nil { + return fmt.Errorf("error resetting DB Cluster Parameter Group: %s", err) } } - d.SetPartial("parameter") } } - if err := setTagsRDS(rdsconn, d, d.Get("arn").(string)); err != nil { - return err - } else { + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.RdsUpdateTags(rdsconn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating RDS Cluster Parameter Group (%s) tags: %s", d.Id(), err) + } d.SetPartial("tags") } diff --git a/aws/resource_aws_rds_cluster_parameter_group_test.go b/aws/resource_aws_rds_cluster_parameter_group_test.go index 46ab59ab554..fe93ba456bb 100644 --- a/aws/resource_aws_rds_cluster_parameter_group_test.go +++ b/aws/resource_aws_rds_cluster_parameter_group_test.go @@ -161,6 +161,17 @@ func TestAccAWSDBClusterParameterGroup_basic(t *testing.T) { resourceName, "tags.%", "2"), ), }, + { + Config: testAccAWSDBClusterParameterGroupConfig(parameterGroupName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSDBClusterParameterGroupExists(resourceName, &v), + testAccCheckAWSDBClusterParameterGroupAttributes(&v, parameterGroupName), + testAccCheckAWSRDSClusterParameterNotUserDefined(resourceName, "collation_connection"), + testAccCheckAWSRDSClusterParameterNotUserDefined(resourceName, "collation_server"), + resource.TestCheckNoResourceAttr(resourceName, "parameter.2475805061.value"), + resource.TestCheckNoResourceAttr(resourceName, "parameter.1706463059.value"), + ), + }, }, }) } @@ -401,6 +412,39 @@ func testAccCheckAWSDBClusterParameterGroupDestroy(s *terraform.State) error { return nil } +func testAccCheckAWSRDSClusterParameterNotUserDefined(n, paramName string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No DB Parameter Group ID is set") + } + + conn := testAccProvider.Meta().(*AWSClient).rdsconn + + opts := rds.DescribeDBClusterParametersInput{ + DBClusterParameterGroupName: aws.String(rs.Primary.ID), + } + + userDefined := false + out, err := conn.DescribeDBClusterParameters(&opts) + for _, param := range out.Parameters { + if *param.ParameterName == paramName && aws.StringValue(param.ParameterValue) != "" { + // Some of these resets leave the parameter name present but with a nil value + userDefined = true + } + } + + if userDefined { + return fmt.Errorf("DB Parameter %s is user defined", paramName) + } + return err + } +} + func testAccCheckAWSDBClusterParameterGroupAttributes(v *rds.DBClusterParameterGroup, name string) resource.TestCheckFunc { return func(s *terraform.State) error { diff --git a/aws/resource_aws_rds_cluster_test.go b/aws/resource_aws_rds_cluster_test.go index 66f74191b51..f31e8523347 100644 --- a/aws/resource_aws_rds_cluster_test.go +++ b/aws/resource_aws_rds_cluster_test.go @@ -849,6 +849,7 @@ func TestAccAWSRDSCluster_EngineMode(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAWSClusterExists(resourceName, &dbCluster1), resource.TestCheckResourceAttr(resourceName, "engine_mode", "serverless"), + resource.TestCheckResourceAttr(resourceName, "scaling_configuration.#", "1"), ), }, { @@ -869,6 +870,7 @@ func TestAccAWSRDSCluster_EngineMode(t *testing.T) { testAccCheckAWSClusterExists(resourceName, &dbCluster2), testAccCheckAWSClusterRecreated(&dbCluster1, &dbCluster2), resource.TestCheckResourceAttr(resourceName, "engine_mode", "provisioned"), + resource.TestCheckResourceAttr(resourceName, "scaling_configuration.#", "0"), ), }, { @@ -2060,6 +2062,47 @@ func testAccCheckAWSClusterRecreated(i, j *rds.DBCluster) resource.TestCheckFunc } } +func TestAccAWSRDSCluster_EnableHttpEndpoint(t *testing.T) { + var dbCluster rds.DBCluster + + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_rds_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRDSClusterConfig_EnableHttpEndpoint(rName, true), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSClusterExists(resourceName, &dbCluster), + resource.TestCheckResourceAttr(resourceName, "enable_http_endpoint", "true"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "apply_immediately", + "cluster_identifier_prefix", + "master_password", + "skip_final_snapshot", + "snapshot_identifier", + }, + }, + { + Config: testAccAWSRDSClusterConfig_EnableHttpEndpoint(rName, false), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSClusterExists(resourceName, &dbCluster), + resource.TestCheckResourceAttr(resourceName, "enable_http_endpoint", "false"), + ), + }, + }, + }) +} + func testAccAWSClusterConfig(n int) string { return fmt.Sprintf(` resource "aws_rds_cluster" "test" { @@ -2888,6 +2931,10 @@ resource "aws_rds_cluster" "test" { master_password = "barbarbarbar" master_username = "foo" skip_final_snapshot = true + +// scaling_configuration { +// min_capacity = 2 +// } } `, rName, engineMode) } @@ -3320,3 +3367,24 @@ resource "aws_rds_cluster" "test" { } `, n, f) } + +func testAccAWSRDSClusterConfig_EnableHttpEndpoint(rName string, enableHttpEndpoint bool) string { + return fmt.Sprintf(` +resource "aws_rds_cluster" "test" { + cluster_identifier = %q + engine_mode = "serverless" + master_password = "barbarbarbar" + master_username = "foo" + skip_final_snapshot = true + enable_http_endpoint = %t + + scaling_configuration { + auto_pause = false + max_capacity = 128 + min_capacity = 4 + seconds_until_auto_pause = 301 + timeout_action = "RollbackCapacityChange" + } +} +`, rName, enableHttpEndpoint) +} diff --git a/aws/resource_aws_rds_global_cluster.go b/aws/resource_aws_rds_global_cluster.go index 1ddf7a8689d..92f2117dafe 100644 --- a/aws/resource_aws_rds_global_cluster.go +++ b/aws/resource_aws_rds_global_cluster.go @@ -44,6 +44,7 @@ func resourceAwsRDSGlobalCluster() *schema.Resource { Default: "aurora", ValidateFunc: validation.StringInSlice([]string{ "aurora", + "aurora-mysql", }, false), }, "engine_version": { diff --git a/aws/resource_aws_rds_global_cluster_test.go b/aws/resource_aws_rds_global_cluster_test.go index 6517d9a6bb7..02b83e26181 100644 --- a/aws/resource_aws_rds_global_cluster_test.go +++ b/aws/resource_aws_rds_global_cluster_test.go @@ -244,6 +244,32 @@ func TestAccAWSRdsGlobalCluster_EngineVersion_Aurora(t *testing.T) { }) } +func TestAccAWSRdsGlobalCluster_EngineVersion_AuroraMySQL(t *testing.T) { + var globalCluster1 rds.GlobalCluster + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_rds_global_cluster.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSRdsGlobalCluster(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSRdsGlobalClusterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSRdsGlobalClusterConfigEngineVersion(rName, "aurora-mysql", "5.7.mysql_aurora.2.07.1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSRdsGlobalClusterExists(resourceName, &globalCluster1), + resource.TestCheckResourceAttr(resourceName, "engine_version", "5.7.mysql_aurora.2.07.1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccAWSRdsGlobalCluster_StorageEncrypted(t *testing.T) { var globalCluster1, globalCluster2 rds.GlobalCluster rName := acctest.RandomWithPrefix("tf-acc-test") diff --git a/aws/resource_aws_redshift_cluster.go b/aws/resource_aws_redshift_cluster.go index 66e66125664..95051bd3f59 100644 --- a/aws/resource_aws_redshift_cluster.go +++ b/aws/resource_aws_redshift_cluster.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsRedshiftCluster() *schema.Resource { @@ -332,7 +333,7 @@ func resourceAwsRedshiftClusterImport( func resourceAwsRedshiftClusterCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).redshiftconn - tags := tagsFromMapRedshift(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().RedshiftTags() if v, ok := d.GetOk("snapshot_identifier"); ok { restoreOpts := &redshift.RestoreFromClusterSnapshotInput{ @@ -489,7 +490,7 @@ func resourceAwsRedshiftClusterCreate(d *schema.ResourceData, meta interface{}) } stateConf := &resource.StateChangeConf{ - Pending: []string{"creating", "backing-up", "modifying", "restoring"}, + Pending: []string{"creating", "backing-up", "modifying", "restoring", "available, prep-for-resize"}, Target: []string{"available"}, Refresh: resourceAwsRedshiftClusterStateRefreshFunc(d.Id(), conn), Timeout: d.Timeout(schema.TimeoutCreate), @@ -615,8 +616,8 @@ func resourceAwsRedshiftClusterRead(d *schema.ResourceData, meta interface{}) er d.Set("cluster_public_key", rsc.ClusterPublicKey) d.Set("cluster_revision_number", rsc.ClusterRevisionNumber) - if err := d.Set("tags", tagsToMapRedshift(rsc.Tags)); err != nil { - return fmt.Errorf("Error setting Redshift Cluster Tags: %#v", err) + if err := d.Set("tags", keyvaluetags.RedshiftKeyValueTags(rsc.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } d.Set("snapshot_copy", flattenRedshiftSnapshotCopy(rsc.ClusterSnapshotCopyStatus)) @@ -642,9 +643,13 @@ func resourceAwsRedshiftClusterUpdate(d *schema.ResourceData, meta interface{}) conn := meta.(*AWSClient).redshiftconn d.Partial(true) - if tagErr := setTagsRedshift(conn, d); tagErr != nil { - return tagErr - } else { + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.RedshiftUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating Redshift Cluster (%s) tags: %s", d.Get("arn").(string), err) + } + d.SetPartial("tags") } @@ -772,7 +777,7 @@ func resourceAwsRedshiftClusterUpdate(d *schema.ResourceData, meta interface{}) if requestUpdate || d.HasChange("iam_roles") { stateConf := &resource.StateChangeConf{ - Pending: []string{"creating", "deleting", "rebooting", "resizing", "renaming", "modifying"}, + Pending: []string{"creating", "deleting", "rebooting", "resizing", "renaming", "modifying", "available, prep-for-resize"}, Target: []string{"available"}, Refresh: resourceAwsRedshiftClusterStateRefreshFunc(d.Id(), conn), Timeout: d.Timeout(schema.TimeoutUpdate), diff --git a/aws/resource_aws_redshift_cluster_test.go b/aws/resource_aws_redshift_cluster_test.go index b1ca2a224b7..370e5a9ae01 100644 --- a/aws/resource_aws_redshift_cluster_test.go +++ b/aws/resource_aws_redshift_cluster_test.go @@ -256,7 +256,7 @@ func TestAccAWSRedshiftCluster_loggingEnabled(t *testing.T) { resource.TestCheckResourceAttr( "aws_redshift_cluster.default", "logging.0.enable", "true"), resource.TestCheckResourceAttr( - "aws_redshift_cluster.default", "logging.0.bucket_name", fmt.Sprintf("tf-redshift-logging-%d", rInt)), + "aws_redshift_cluster.default", "logging.0.bucket_name", fmt.Sprintf("tf-test-redshift-logging-%d", rInt)), ), }, { @@ -1153,7 +1153,7 @@ func testAccAWSRedshiftClusterConfig_loggingEnabled(rInt int) string { data "aws_redshift_service_account" "main" {} resource "aws_s3_bucket" "bucket" { - bucket = "tf-redshift-logging-%d" + bucket = "tf-test-redshift-logging-%d" force_destroy = true policy = < 0 { - req.Tags = tagsFromMapRoute53Resolver(v.(map[string]interface{})) + req.Tags = keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().Route53resolverTags() } log.Printf("[DEBUG] Creating Route53 Resolver endpoint: %#v", req) @@ -179,8 +180,14 @@ func resourceAwsRoute53ResolverEndpointRead(d *schema.ResourceData, meta interfa return err } - if err := getTagsRoute53Resolver(conn, d); err != nil { - return fmt.Errorf("error getting Route53 Resolver endpoint (%s) tags: %s", d.Id(), err) + tags, err := keyvaluetags.Route53resolverListTags(conn, d.Get("arn").(string)) + + if err != nil { + return fmt.Errorf("error listing tags for Route53 Resolver endpoint (%s): %s", d.Get("arn").(string), err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -257,10 +264,13 @@ func resourceAwsRoute53ResolverEndpointUpdate(d *schema.ResourceData, meta inter d.SetPartial("ip_address") } - if err := setTagsRoute53Resolver(conn, d); err != nil { - return fmt.Errorf("error setting Route53 Resolver endpoint (%s) tags: %s", d.Id(), err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.Route53resolverUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating Route53 Resolver endpoint (%s) tags: %s", d.Get("arn").(string), err) + } + d.SetPartial("tags") } - d.SetPartial("tags") d.Partial(false) return resourceAwsRoute53ResolverEndpointRead(d, meta) diff --git a/aws/resource_aws_route53_resolver_endpoint_test.go b/aws/resource_aws_route53_resolver_endpoint_test.go index 2877834ae03..865c6161f9c 100644 --- a/aws/resource_aws_route53_resolver_endpoint_test.go +++ b/aws/resource_aws_route53_resolver_endpoint_test.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/route53resolver" + "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" @@ -17,6 +18,9 @@ func init() { resource.AddTestSweepers("aws_route53_resolver_endpoint", &resource.Sweeper{ Name: "aws_route53_resolver_endpoint", F: testSweepRoute53ResolverEndpoints, + Dependencies: []string{ + "aws_route53_resolver_rule", + }, }) } @@ -27,6 +31,7 @@ func testSweepRoute53ResolverEndpoints(region string) error { } conn := client.(*AWSClient).route53resolverconn + var errors error err = conn.ListResolverEndpointsPages(&route53resolver.ListResolverEndpointsInput{}, func(page *route53resolver.ListResolverEndpointsOutput, isLast bool) bool { if page == nil { return !isLast @@ -43,7 +48,7 @@ func testSweepRoute53ResolverEndpoints(region string) error { continue } if err != nil { - log.Printf("[ERROR] Error deleting Route53 Resolver endpoint (%s): %s", id, err) + errors = multierror.Append(errors, fmt.Errorf("error deleting Route53 Resolver endpoint (%s): %w", id, err)) continue } @@ -51,7 +56,8 @@ func testSweepRoute53ResolverEndpoints(region string) error { []string{route53resolver.ResolverEndpointStatusDeleting}, []string{route53ResolverEndpointStatusDeleted}) if err != nil { - log.Printf("[ERROR] %s", err) + errors = multierror.Append(errors, err) + continue } } @@ -62,10 +68,10 @@ func testSweepRoute53ResolverEndpoints(region string) error { log.Printf("[WARN] Skipping Route53 Resolver endpoint sweep for %s: %s", region, err) return nil } - return fmt.Errorf("error retrievingRoute53 Resolver endpoints: %s", err) + errors = multierror.Append(errors, fmt.Errorf("error retrievingRoute53 Resolver endpoints: %w", err)) } - return nil + return errors } func TestAccAwsRoute53ResolverEndpoint_basicInbound(t *testing.T) { diff --git a/aws/resource_aws_route53_resolver_rule.go b/aws/resource_aws_route53_resolver_rule.go index 6f781cb168a..937951bea5d 100644 --- a/aws/resource_aws_route53_resolver_rule.go +++ b/aws/resource_aws_route53_resolver_rule.go @@ -3,6 +3,7 @@ package aws import ( "bytes" "fmt" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" "log" "time" @@ -126,7 +127,7 @@ func resourceAwsRoute53ResolverRuleCreate(d *schema.ResourceData, meta interface req.TargetIps = expandRoute53ResolverRuleTargetIps(v.(*schema.Set)) } if v, ok := d.GetOk("tags"); ok && len(v.(map[string]interface{})) > 0 { - req.Tags = tagsFromMapRoute53Resolver(v.(map[string]interface{})) + req.Tags = keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().Route53resolverTags() } log.Printf("[DEBUG] Creating Route 53 Resolver rule: %s", req) @@ -172,9 +173,14 @@ func resourceAwsRoute53ResolverRuleRead(d *schema.ResourceData, meta interface{} return err } - err = getTagsRoute53Resolver(conn, d) + tags, err := keyvaluetags.Route53resolverListTags(conn, d.Get("arn").(string)) + if err != nil { - return fmt.Errorf("Error reading Route 53 Resolver rule tags %s: %s", d.Id(), err) + return fmt.Errorf("error listing tags for Route53 Resolver rule (%s): %s", d.Get("arn").(string), err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -217,10 +223,13 @@ func resourceAwsRoute53ResolverRuleUpdate(d *schema.ResourceData, meta interface d.SetPartial("target_ip") } - if err := setTagsRoute53Resolver(conn, d); err != nil { - return fmt.Errorf("error setting Route53 Resolver rule (%s) tags: %s", d.Id(), err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.Route53resolverUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating Route53 Resolver rule (%s) tags: %s", d.Get("arn").(string), err) + } + d.SetPartial("tags") } - d.SetPartial("tags") d.Partial(false) return resourceAwsRoute53ResolverRuleRead(d, meta) diff --git a/aws/resource_aws_route53_resolver_rule_association_test.go b/aws/resource_aws_route53_resolver_rule_association_test.go index 5b06346aece..14cd84c1511 100644 --- a/aws/resource_aws_route53_resolver_rule_association_test.go +++ b/aws/resource_aws_route53_resolver_rule_association_test.go @@ -2,8 +2,11 @@ package aws import ( "fmt" + "log" "testing" + "time" + multierror "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" @@ -12,6 +15,68 @@ import ( "github.com/aws/aws-sdk-go/service/route53resolver" ) +func init() { + resource.AddTestSweepers("aws_route53_resolver_rule_association", &resource.Sweeper{ + Name: "aws_route53_resolver_rule_association", + F: testSweepRoute53ResolverRuleAssociations, + }) +} + +func testSweepRoute53ResolverRuleAssociations(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + conn := client.(*AWSClient).route53resolverconn + + var errors error + err = conn.ListResolverRuleAssociationsPages(&route53resolver.ListResolverRuleAssociationsInput{}, func(page *route53resolver.ListResolverRuleAssociationsOutput, isLast bool) bool { + if page == nil { + return !isLast + } + + for _, resolverRuleAssociation := range page.ResolverRuleAssociations { + id := aws.StringValue(resolverRuleAssociation.Id) + + log.Printf("[INFO] Deleting Route53 Resolver rule association %q", id) + _, err := conn.DisassociateResolverRule(&route53resolver.DisassociateResolverRuleInput{ + ResolverRuleId: resolverRuleAssociation.ResolverRuleId, + VPCId: resolverRuleAssociation.VPCId, + }) + if isAWSErr(err, route53resolver.ErrCodeResourceNotFoundException, "") { + continue + } + if testSweepSkipSweepError(err) { + log.Printf("[INFO] Skipping Route53 Resolver rule association %q: %s", id, err) + continue + } + if err != nil { + errors = multierror.Append(errors, fmt.Errorf("error deleting Route53 Resolver rule association (%s): %w", id, err)) + continue + } + + err = route53ResolverRuleAssociationWaitUntilTargetState(conn, id, 10*time.Minute, + []string{route53resolver.ResolverRuleAssociationStatusDeleting}, + []string{route53ResolverRuleAssociationStatusDeleted}) + if err != nil { + errors = multierror.Append(errors, err) + continue + } + } + + return !isLast + }) + if err != nil { + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping Route53 Resolver rule association sweep for %s: %s", region, err) + return nil + } + errors = multierror.Append(errors, fmt.Errorf("error retrievingRoute53 Resolver rule associations: %w", err)) + } + + return errors +} + func TestAccAwsRoute53ResolverRuleAssociation_basic(t *testing.T) { var assn route53resolver.ResolverRuleAssociation resourceNameVpc := "aws_vpc.example" diff --git a/aws/resource_aws_route53_resolver_rule_test.go b/aws/resource_aws_route53_resolver_rule_test.go index c0aa13ea483..c1e37b17501 100644 --- a/aws/resource_aws_route53_resolver_rule_test.go +++ b/aws/resource_aws_route53_resolver_rule_test.go @@ -2,8 +2,11 @@ package aws import ( "fmt" + "log" "testing" + "time" + "github.com/hashicorp/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" @@ -12,6 +15,72 @@ import ( "github.com/aws/aws-sdk-go/service/route53resolver" ) +func init() { + resource.AddTestSweepers("aws_route53_resolver_rule", &resource.Sweeper{ + Name: "aws_route53_resolver_rule", + F: testSweepRoute53ResolverRules, + Dependencies: []string{ + "aws_route53_resolver_rule_association", + }, + }) +} + +func testSweepRoute53ResolverRules(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + conn := client.(*AWSClient).route53resolverconn + + var errors error + err = conn.ListResolverRulesPages(&route53resolver.ListResolverRulesInput{}, func(page *route53resolver.ListResolverRulesOutput, isLast bool) bool { + if page == nil { + return !isLast + } + + for _, resolverRule := range page.ResolverRules { + id := aws.StringValue(resolverRule.Id) + + ownerID := aws.StringValue(resolverRule.OwnerId) + if ownerID != client.(*AWSClient).accountid { + log.Printf("[INFO] Skipping Route53 Resolver rule %q, owned by %q", id, ownerID) + continue + } + + log.Printf("[INFO] Deleting Route53 Resolver rule %q", id) + _, err := conn.DeleteResolverRule(&route53resolver.DeleteResolverRuleInput{ + ResolverRuleId: aws.String(id), + }) + if isAWSErr(err, route53resolver.ErrCodeResourceNotFoundException, "") { + continue + } + if err != nil { + errors = multierror.Append(errors, fmt.Errorf("error deleting Route53 Resolver rule (%s): %w", id, err)) + continue + } + + err = route53ResolverRuleWaitUntilTargetState(conn, id, 10*time.Minute, + []string{route53resolver.ResolverRuleStatusDeleting}, + []string{route53ResolverRuleStatusDeleted}) + if err != nil { + errors = multierror.Append(errors, err) + continue + } + } + + return !isLast + }) + if err != nil { + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping Route53 Resolver rule sweep for %s: %s", region, err) + return nil + } + errors = multierror.Append(errors, fmt.Errorf("error retrievingRoute53 Resolver rules: %w", err)) + } + + return errors +} + func TestAccAwsRoute53ResolverRule_basic(t *testing.T) { var rule route53resolver.ResolverRule resourceName := "aws_route53_resolver_rule.example" diff --git a/aws/resource_aws_route53_zone.go b/aws/resource_aws_route53_zone.go index 16ec6968ba0..83ab57f67eb 100644 --- a/aws/resource_aws_route53_zone.go +++ b/aws/resource_aws_route53_zone.go @@ -14,6 +14,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsRoute53Zone() *schema.Resource { @@ -145,8 +146,8 @@ func resourceAwsRoute53ZoneCreate(d *schema.ResourceData, meta interface{}) erro return fmt.Errorf("error waiting for Route53 Hosted Zone (%s) creation: %s", d.Id(), err) } - if err := setTagsR53(conn, d, route53.TagResourceTypeHostedzone); err != nil { - return fmt.Errorf("error setting tags for Route53 Hosted Zone (%s): %s", d.Id(), err) + if err := keyvaluetags.Route53UpdateTags(conn, d.Id(), route53.TagResourceTypeHostedzone, map[string]interface{}{}, d.Get("tags").(map[string]interface{})); err != nil { + return fmt.Errorf("error setting Route53 Zone (%s) tags: %s", d.Id(), err) } // Associate additional VPCs beyond the first @@ -224,26 +225,14 @@ func resourceAwsRoute53ZoneRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("error setting vpc: %s", err) } - // get tags - req := &route53.ListTagsForResourceInput{ - ResourceId: aws.String(d.Id()), - ResourceType: aws.String(route53.TagResourceTypeHostedzone), - } - - log.Printf("[DEBUG] Listing tags for Route53 Hosted Zone: %s", req) - resp, err := conn.ListTagsForResource(req) + tags, err := keyvaluetags.Route53ListTags(conn, d.Id(), route53.TagResourceTypeHostedzone) if err != nil { return fmt.Errorf("error listing tags for Route53 Hosted Zone (%s): %s", d.Id(), err) } - var tags []*route53.Tag - if resp.ResourceTagSet != nil { - tags = resp.ResourceTagSet.Tags - } - - if err := d.Set("tags", tagsToMapR53(tags)); err != nil { - return err + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -271,11 +260,11 @@ func resourceAwsRoute53ZoneUpdate(d *schema.ResourceData, meta interface{}) erro } if d.HasChange("tags") { - if err := setTagsR53(conn, d, route53.TagResourceTypeHostedzone); err != nil { - return err - } + o, n := d.GetChange("tags") - d.SetPartial("tags") + if err := keyvaluetags.Route53UpdateTags(conn, d.Id(), route53.TagResourceTypeHostedzone, o, n); err != nil { + return fmt.Errorf("error updating Route53 Zone (%s) tags: %s", d.Id(), err) + } } if d.HasChange("vpc") { diff --git a/aws/resource_aws_route53_zone_test.go b/aws/resource_aws_route53_zone_test.go index fd20b06c61a..8c8c0229525 100644 --- a/aws/resource_aws_route53_zone_test.go +++ b/aws/resource_aws_route53_zone_test.go @@ -249,7 +249,6 @@ func TestAccAWSRoute53Zone_ForceDestroy_TrailingPeriod(t *testing.T) { func TestAccAWSRoute53Zone_Tags(t *testing.T) { var zone route53.GetHostedZoneOutput - var td route53.ResourceTagSet rName := acctest.RandomWithPrefix("tf-acc-test") resourceName := "aws_route53_zone.test" @@ -266,8 +265,6 @@ func TestAccAWSRoute53Zone_Tags(t *testing.T) { testAccCheckRoute53ZoneExists(resourceName, &zone), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.tag1key", "tag1value"), - testAccLoadTagsR53(&zone, &td), - testAccCheckTagsR53(&td.Tags, "tag1key", "tag1value"), ), }, { @@ -283,9 +280,6 @@ func TestAccAWSRoute53Zone_Tags(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), resource.TestCheckResourceAttr(resourceName, "tags.tag1key", "tag1valueupdated"), resource.TestCheckResourceAttr(resourceName, "tags.tag2key", "tag2value"), - testAccLoadTagsR53(&zone, &td), - testAccCheckTagsR53(&td.Tags, "tag1key", "tag1valueupdated"), - testAccCheckTagsR53(&td.Tags, "tag2key", "tag2value"), ), }, { @@ -294,8 +288,6 @@ func TestAccAWSRoute53Zone_Tags(t *testing.T) { testAccCheckRoute53ZoneExists(resourceName, &zone), resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), resource.TestCheckResourceAttr(resourceName, "tags.tag2key", "tag2value"), - testAccLoadTagsR53(&zone, &td), - testAccCheckTagsR53(&td.Tags, "tag2key", "tag2value"), ), }, }, @@ -556,28 +548,6 @@ func testAccCheckRoute53ZoneAssociatesWithVpc(n string, zone *route53.GetHostedZ } } -func testAccLoadTagsR53(zone *route53.GetHostedZoneOutput, td *route53.ResourceTagSet) resource.TestCheckFunc { - return func(s *terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).r53conn - - zone := cleanZoneID(*zone.HostedZone.Id) - req := &route53.ListTagsForResourceInput{ - ResourceId: aws.String(zone), - ResourceType: aws.String("hostedzone"), - } - - resp, err := conn.ListTagsForResource(req) - if err != nil { - return err - } - - if resp.ResourceTagSet != nil { - *td = *resp.ResourceTagSet - } - - return nil - } -} func testAccCheckDomainName(zone *route53.GetHostedZoneOutput, domain string) resource.TestCheckFunc { return func(s *terraform.State) error { if zone.HostedZone.Name == nil { diff --git a/aws/resource_aws_route_table.go b/aws/resource_aws_route_table.go index 626a8f764e4..ecbf03b29ce 100644 --- a/aws/resource_aws_route_table.go +++ b/aws/resource_aws_route_table.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsRouteTable() *schema.Resource { @@ -218,8 +219,9 @@ func resourceAwsRouteTableRead(d *schema.ResourceData, meta interface{}) error { } d.Set("route", route) - // Tags - d.Set("tags", tagsToMap(rt.Tags)) + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(rt.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } d.Set("owner_id", rt.OwnerId) @@ -403,10 +405,12 @@ func resourceAwsRouteTableUpdate(d *schema.ResourceData, meta interface{}) error } } - if err := setTags(conn, d); err != nil { - return err - } else { - d.SetPartial("tags") + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating EC2 Route Table (%s) tags: %s", d.Id(), err) + } } return resourceAwsRouteTableRead(d, meta) diff --git a/aws/resource_aws_route_table_association.go b/aws/resource_aws_route_table_association.go index 7bcaae1c084..c63095b0796 100644 --- a/aws/resource_aws_route_table_association.go +++ b/aws/resource_aws_route_table_association.go @@ -25,8 +25,16 @@ func resourceAwsRouteTableAssociation() *schema.Resource { Schema: map[string]*schema.Schema{ "subnet_id": { - Type: schema.TypeString, - Required: true, + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"subnet_id", "gateway_id"}, + ForceNew: true, + }, + "gateway_id": { + Type: schema.TypeString, + Optional: true, + ExactlyOneOf: []string{"subnet_id", "gateway_id"}, + ForceNew: true, }, "route_table_id": { @@ -40,14 +48,21 @@ func resourceAwsRouteTableAssociation() *schema.Resource { 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)), + } + if len(d.Get("subnet_id").(string)) > 0 { + log.Printf( + "[INFO] Creating route table association: %s => %s", + d.Get("subnet_id").(string), + d.Get("route_table_id").(string)) + associationOpts.SubnetId = aws.String(d.Get("subnet_id").(string)) + } else if len(d.Get("gateway_id").(string)) > 0 { + log.Printf( + "[INFO] Creating route table association: %s => %s", + d.Get("gateway_id").(string), + d.Get("route_table_id").(string)) + associationOpts.GatewayId = aws.String(d.Get("gateway_id").(string)) } var associationID string @@ -99,7 +114,12 @@ func resourceAwsRouteTableAssociationRead(d *schema.ResourceData, meta interface for _, a := range rt.Associations { if *a.RouteTableAssociationId == d.Id() { found = true - d.Set("subnet_id", *a.SubnetId) + if a.SubnetId != nil { + d.Set("subnet_id", a.SubnetId) + } + if a.GatewayId != nil { + d.Set("gateway_id", a.GatewayId) + } break } } @@ -165,44 +185,57 @@ func resourceAwsRouteTableAssociationDelete(d *schema.ResourceData, meta interfa func resourceAwsRouteTableAssociationImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { parts := strings.Split(d.Id(), "/") if len(parts) != 2 { - return []*schema.ResourceData{}, fmt.Errorf("Wrong format for import: %s. Use 'subnet ID/route table ID'", d.Id()) + return []*schema.ResourceData{}, fmt.Errorf("Unexpected format for import: %s. Use 'subnet ID/route table ID' or 'gateway ID/route table ID", d.Id()) } - subnetID := parts[0] + targetID := parts[0] routeTableID := parts[1] - log.Printf("[DEBUG] Importing route table association, subnet: %s, route table: %s", subnetID, routeTableID) + log.Printf("[DEBUG] Importing route table association, target: %s, route table: %s", targetID, routeTableID) conn := meta.(*AWSClient).ec2conn input := &ec2.DescribeRouteTablesInput{} input.Filters = buildEC2AttributeFilterList( map[string]string{ - "association.subnet-id": subnetID, "association.route-table-id": routeTableID, }, ) output, err := conn.DescribeRouteTables(input) - if err != nil || len(output.RouteTables) == 0 { - return nil, fmt.Errorf("Error finding route table: %v", err) + if err != nil { + return nil, fmt.Errorf("Error finding route table: %s", err) + } + if len(output.RouteTables) == 0 { + return nil, fmt.Errorf("No route table found with ID %s", routeTableID) } rt := output.RouteTables[0] + var targetType string var associationID string for _, a := range rt.Associations { - if aws.StringValue(a.SubnetId) == subnetID { + if aws.StringValue(a.SubnetId) == targetID { + targetType = "subnet" + associationID = aws.StringValue(a.RouteTableAssociationId) + break + } + if aws.StringValue(a.SubnetId) == targetID || aws.StringValue(a.GatewayId) == targetID { + targetType = "gateway" associationID = aws.StringValue(a.RouteTableAssociationId) break } } if associationID == "" { - return nil, fmt.Errorf("Error finding route table, ID: %v", *rt.RouteTableId) + return nil, fmt.Errorf("No association found between route table ID %s and target ID %s", routeTableID, targetID) } d.SetId(associationID) - d.Set("subnet_id", subnetID) + if targetType == "subnet" { + d.Set("subnet_id", targetID) + } else if targetType == "gateway" { + d.Set("gateway_id", targetID) + } d.Set("route_table_id", routeTableID) return []*schema.ResourceData{d}, nil diff --git a/aws/resource_aws_route_table_association_test.go b/aws/resource_aws_route_table_association_test.go index 536212f73db..5276cb81953 100644 --- a/aws/resource_aws_route_table_association_test.go +++ b/aws/resource_aws_route_table_association_test.go @@ -11,10 +11,12 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) -func TestAccAWSRouteTableAssociation_basic(t *testing.T) { - var v, v2 ec2.RouteTable +func TestAccAWSRouteTableAssociation_Subnet_basic(t *testing.T) { + var rta ec2.RouteTableAssociation - resourceName := "aws_route_table_association.foo" + resourceNameAssoc := "aws_route_table_association.foo" + resourceNameRouteTable := "aws_route_table.foo" + resourceNameSubnet := "aws_subnet.foo" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -22,32 +24,95 @@ func TestAccAWSRouteTableAssociation_basic(t *testing.T) { CheckDestroy: testAccCheckRouteTableAssociationDestroy, Steps: []resource.TestStep{ { - Config: testAccRouteTableAssociationConfig, + Config: testAccRouteTableAssociationSubnetConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckRouteTableAssociationExists( - resourceName, &v), + testAccCheckRouteTableAssociationExists(resourceNameAssoc, &rta), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "route_table_id", resourceNameRouteTable, "id"), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "subnet_id", resourceNameSubnet, "id"), ), }, { - Config: testAccRouteTableAssociationConfigChange, + ResourceName: resourceNameAssoc, + ImportState: true, + ImportStateIdFunc: testAccAWSRouteTabAssocImportStateIdFunc(resourceNameAssoc), + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSRouteTableAssociation_Subnet_ChangeRouteTable(t *testing.T) { + var rta1, rta2 ec2.RouteTableAssociation + + resourceNameAssoc := "aws_route_table_association.foo" + resourceNameRouteTable1 := "aws_route_table.foo" + resourceNameRouteTable2 := "aws_route_table.bar" + resourceNameSubnet := "aws_subnet.foo" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckRouteTableAssociationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccRouteTableAssociationSubnetConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckRouteTableAssociationExists( - resourceName, &v2), + testAccCheckRouteTableAssociationExists(resourceNameAssoc, &rta1), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "route_table_id", resourceNameRouteTable1, "id"), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "subnet_id", resourceNameSubnet, "id"), ), }, { - ResourceName: resourceName, - ImportState: true, - ImportStateIdFunc: testAccAWSRouteTabAssocImportStateIdFunc(resourceName), - ImportStateVerify: true, + Config: testAccRouteTableAssociationSubnetConfig_ChangeRouteTable, + Check: resource.ComposeTestCheckFunc( + testAccCheckRouteTableAssociationExists(resourceNameAssoc, &rta2), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "route_table_id", resourceNameRouteTable2, "id"), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "subnet_id", resourceNameSubnet, "id"), + ), + }, + }, + }) +} + +func TestAccAWSRouteTableAssociation_Subnet_ChangeSubnet(t *testing.T) { + var rta1, rta2 ec2.RouteTableAssociation + + resourceNameAssoc := "aws_route_table_association.foo" + resourceNameRouteTable := "aws_route_table.foo" + resourceNameSubnet1 := "aws_subnet.foo" + resourceNameSubnet2 := "aws_subnet.bar" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckRouteTableAssociationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccRouteTableAssociationSubnetConfig, + Check: resource.ComposeTestCheckFunc( + testAccCheckRouteTableAssociationExists(resourceNameAssoc, &rta1), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "route_table_id", resourceNameRouteTable, "id"), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "subnet_id", resourceNameSubnet1, "id"), + ), + }, + { + Config: testAccRouteTableAssociationSubnetConfig_ChangeSubnet, + Check: resource.ComposeTestCheckFunc( + testAccCheckRouteTableAssociationExists(resourceNameAssoc, &rta2), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "route_table_id", resourceNameRouteTable, "id"), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "subnet_id", resourceNameSubnet2, "id"), + ), }, }, }) } -func TestAccAWSRouteTableAssociation_replace(t *testing.T) { - var v, v2 ec2.RouteTable - resourceName := "aws_route_table_association.foo" +func TestAccAWSRouteTableAssociation_Gateway_basic(t *testing.T) { + var rta ec2.RouteTableAssociation + + resourceNameAssoc := "aws_route_table_association.foo" + resourceNameRouteTable := "aws_route_table.foo" + resourceNameGateway := "aws_internet_gateway.foo" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -55,28 +120,109 @@ func TestAccAWSRouteTableAssociation_replace(t *testing.T) { CheckDestroy: testAccCheckRouteTableAssociationDestroy, Steps: []resource.TestStep{ { - Config: testAccRouteTableAssociationConfig, + Config: testAccRouteTableAssociationGatewayConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckRouteTableAssociationExists( - resourceName, &v), + testAccCheckRouteTableAssociationExists(resourceNameAssoc, &rta), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "route_table_id", resourceNameRouteTable, "id"), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "gateway_id", resourceNameGateway, "id"), ), }, { - ResourceName: resourceName, + ResourceName: resourceNameAssoc, ImportState: true, - ImportStateIdFunc: testAccAWSRouteTabAssocImportStateIdFunc(resourceName), + ImportStateIdFunc: testAccAWSRouteTabAssocImportStateIdFunc(resourceNameAssoc), ImportStateVerify: true, }, + }, + }) +} + +func TestAccAWSRouteTableAssociation_Gateway_ChangeRouteTable(t *testing.T) { + var rta1, rta2 ec2.RouteTableAssociation + + resourceNameAssoc := "aws_route_table_association.foo" + resourceNameRouteTable1 := "aws_route_table.foo" + resourceNameRouteTable2 := "aws_route_table.bar" + resourceNameGateway := "aws_internet_gateway.foo" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckRouteTableAssociationDestroy, + Steps: []resource.TestStep{ { - Config: testAccRouteTableAssociationConfigReplace, + Config: testAccRouteTableAssociationGatewayConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckRouteTableAssociationExists( - resourceName, &v2), + testAccCheckRouteTableAssociationExists(resourceNameAssoc, &rta1), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "route_table_id", resourceNameRouteTable1, "id"), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "gateway_id", resourceNameGateway, "id"), + ), + }, + { + Config: testAccRouteTableAssociationGatewayConfig_ChangeRouteTable, + Check: resource.ComposeTestCheckFunc( + testAccCheckRouteTableAssociationExists(resourceNameAssoc, &rta2), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "route_table_id", resourceNameRouteTable2, "id"), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "gateway_id", resourceNameGateway, "id"), ), }, }, }) } +func TestAccAWSRouteTableAssociation_Gateway_ChangeGateway(t *testing.T) { + var rta1, rta2 ec2.RouteTableAssociation + + resourceNameAssoc := "aws_route_table_association.foo" + resourceNameRouteTable := "aws_route_table.foo" + resourceNameGateway1 := "aws_internet_gateway.foo" + resourceNameGateway2 := "aws_vpn_gateway.bar" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckRouteTableAssociationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccRouteTableAssociationGatewayConfig, + Check: resource.ComposeTestCheckFunc( + testAccCheckRouteTableAssociationExists(resourceNameAssoc, &rta1), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "route_table_id", resourceNameRouteTable, "id"), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "gateway_id", resourceNameGateway1, "id"), + ), + }, + { + Config: testAccRouteTableAssociationGatewayConfig_ChangeGateway, + Check: resource.ComposeTestCheckFunc( + testAccCheckRouteTableAssociationExists(resourceNameAssoc, &rta2), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "route_table_id", resourceNameRouteTable, "id"), + resource.TestCheckResourceAttrPair(resourceNameAssoc, "gateway_id", resourceNameGateway2, "id"), + ), + }, + }, + }) +} + +func TestAccAWSRouteTableAssociation_disappears(t *testing.T) { + var rta ec2.RouteTableAssociation + + resourceNameAssoc := "aws_route_table_association.foo" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckRouteTableAssociationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccRouteTableAssociationSubnetConfig, + Check: resource.ComposeTestCheckFunc( + testAccCheckRouteTableAssociationExists(resourceNameAssoc, &rta), + testAccCheckRouteTableAssociationDisappears(&rta), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} func testAccCheckRouteTableAssociationDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).ec2conn @@ -106,14 +252,13 @@ func testAccCheckRouteTableAssociationDestroy(s *terraform.State) error { if len(rt.Associations) > 0 { return fmt.Errorf( "route table %s has associations", *rt.RouteTableId) - } } return nil } -func testAccCheckRouteTableAssociationExists(n string, v *ec2.RouteTable) resource.TestCheckFunc { +func testAccCheckRouteTableAssociationExists(n string, rta *ec2.RouteTableAssociation) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] if !ok { @@ -132,53 +277,94 @@ func testAccCheckRouteTableAssociationExists(n string, v *ec2.RouteTable) resour return err } if len(resp.RouteTables) == 0 { - return fmt.Errorf("RouteTable not found") + return fmt.Errorf("Route Table not found") } - *v = *resp.RouteTables[0] + if len(resp.RouteTables[0].Associations) == 0 { + return fmt.Errorf("no associations found for Route Table %q", rs.Primary.Attributes["route_table_id"]) + } - if len(v.Associations) == 0 { - return fmt.Errorf("no associations") + found := false + for _, association := range resp.RouteTables[0].Associations { + if rs.Primary.ID == *association.RouteTableAssociationId { + found = true + *rta = *association + break + } + } + if !found { + return fmt.Errorf("Association %q not found on Route Table %q", rs.Primary.ID, rs.Primary.Attributes["route_table_id"]) } return nil } } +func testAccCheckRouteTableAssociationDisappears(rta *ec2.RouteTableAssociation) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + _, err := conn.DisassociateRouteTable(&ec2.DisassociateRouteTableInput{ + AssociationId: rta.RouteTableAssociationId, + }) + + return err + } +} + func testAccAWSRouteTabAssocImportStateIdFunc(resourceName string) resource.ImportStateIdFunc { return func(s *terraform.State) (string, error) { rs, ok := s.RootModule().Resources[resourceName] if !ok { return "", fmt.Errorf("not found: %s", resourceName) } - - return fmt.Sprintf("%s/%s", rs.Primary.Attributes["subnet_id"], rs.Primary.Attributes["route_table_id"]), nil + var target string + if rs.Primary.Attributes["subnet_id"] != "" { + target = rs.Primary.Attributes["subnet_id"] + } else if rs.Primary.Attributes["gateway_id"] != "" { + target = rs.Primary.Attributes["gateway_id"] + } + return fmt.Sprintf("%s/%s", target, rs.Primary.Attributes["route_table_id"]), nil } } -const testAccRouteTableAssociationConfig = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" +const testAccRouteTableAssociationSubnetConfig = testAccRouteTableAssociatonCommonVpcConfig + ` +resource "aws_route_table" "foo" { + vpc_id = "${aws_vpc.foo.id}" + route { + cidr_block = "10.0.0.0/8" + gateway_id = "${aws_internet_gateway.foo.id}" + } tags = { Name = "tf-acc-route-table-assoc" } } -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" - cidr_block = "10.1.1.0/24" - tags = { - Name = "tf-acc-route-table-assoc" - } +resource "aws_route_table_association" "foo" { + route_table_id = "${aws_route_table.foo.id}" + subnet_id = "${aws_subnet.foo.id}" } +` -resource "aws_internet_gateway" "foo" { +const testAccRouteTableAssociationSubnetConfig_ChangeRouteTable = testAccRouteTableAssociatonCommonVpcConfig + ` +resource "aws_route_table" "bar" { vpc_id = "${aws_vpc.foo.id}" + route { + cidr_block = "10.0.0.0/8" + gateway_id = "${aws_internet_gateway.foo.id}" + } tags = { - Name = "tf-acc-route-table-assoc" + Name = "tf-acc-route-update-table-assoc" } } +resource "aws_route_table_association" "foo" { + route_table_id = "${aws_route_table.bar.id}" + subnet_id = "${aws_subnet.foo.id}" +} +` + +const testAccRouteTableAssociationSubnetConfig_ChangeSubnet = testAccRouteTableAssociatonCommonVpcConfig + ` resource "aws_route_table" "foo" { vpc_id = "${aws_vpc.foo.id}" route { @@ -190,54 +376,118 @@ resource "aws_route_table" "foo" { } } +resource "aws_subnet" "bar" { + vpc_id = "${aws_vpc.foo.id}" + cidr_block = "10.1.2.0/24" + tags = { + Name = "tf-acc-route-table-assoc" + } +} + resource "aws_route_table_association" "foo" { route_table_id = "${aws_route_table.foo.id}" - subnet_id = "${aws_subnet.foo.id}" + subnet_id = "${aws_subnet.bar.id}" } ` -const testAccRouteTableAssociationConfigChange = ` -resource "aws_vpc" "foo" { - cidr_block = "10.1.0.0/16" +const testAccRouteTableAssociationGatewayConfig = testAccRouteTableAssociatonCommonVpcConfig + ` +resource "aws_route_table" "foo" { + vpc_id = "${aws_vpc.foo.id}" + route { + cidr_block = aws_subnet.foo.cidr_block + network_interface_id = aws_network_interface.appliance.id + } tags = { Name = "tf-acc-route-table-assoc" } } -resource "aws_subnet" "foo" { - vpc_id = "${aws_vpc.foo.id}" - cidr_block = "10.1.1.0/24" +resource "aws_subnet" "appliance" { + vpc_id = aws_vpc.foo.id + cidr_block = "10.1.2.0/24" tags = { Name = "tf-acc-route-table-assoc" } } -resource "aws_internet_gateway" "foo" { +resource "aws_network_interface" "appliance" { + subnet_id = aws_subnet.appliance.id +} + +resource "aws_route_table_association" "foo" { + route_table_id = aws_route_table.foo.id + gateway_id = aws_internet_gateway.foo.id +} +` + +const testAccRouteTableAssociationGatewayConfig_ChangeRouteTable = testAccRouteTableAssociatonCommonVpcConfig + ` +resource "aws_route_table" "bar" { vpc_id = "${aws_vpc.foo.id}" + route { + cidr_block = aws_subnet.foo.cidr_block + network_interface_id = aws_network_interface.appliance.id + } + tags = { + Name = "tf-acc-route-table-assoc" + } +} +resource "aws_subnet" "appliance" { + vpc_id = aws_vpc.foo.id + cidr_block = "10.1.2.0/24" tags = { Name = "tf-acc-route-table-assoc" } } -resource "aws_route_table" "bar" { +resource "aws_network_interface" "appliance" { + subnet_id = aws_subnet.appliance.id +} + +resource "aws_route_table_association" "foo" { + route_table_id = aws_route_table.bar.id + gateway_id = aws_internet_gateway.foo.id +} +` + +const testAccRouteTableAssociationGatewayConfig_ChangeGateway = testAccRouteTableAssociatonCommonVpcConfig + ` +resource "aws_route_table" "foo" { vpc_id = "${aws_vpc.foo.id}" route { - cidr_block = "10.0.0.0/8" - gateway_id = "${aws_internet_gateway.foo.id}" + cidr_block = aws_subnet.foo.cidr_block + network_interface_id = aws_network_interface.appliance.id } tags = { - Name = "tf-acc-route-change-table-assoc" + Name = "tf-acc-route-table-assoc" + } +} + +resource "aws_subnet" "appliance" { + vpc_id = aws_vpc.foo.id + cidr_block = "10.1.2.0/24" + tags = { + Name = "tf-acc-route-table-assoc" + } +} + +resource "aws_network_interface" "appliance" { + subnet_id = aws_subnet.appliance.id +} + +resource "aws_vpn_gateway" "bar" { + vpc_id = "${aws_vpc.foo.id}" + tags = { + Name = "tf-acc-route-table-assoc" } } resource "aws_route_table_association" "foo" { - route_table_id = "${aws_route_table.bar.id}" - subnet_id = "${aws_subnet.foo.id}" + route_table_id = aws_route_table.foo.id + gateway_id = aws_vpn_gateway.bar.id } ` -const testAccRouteTableAssociationConfigReplace = ` +const testAccRouteTableAssociatonCommonVpcConfig = ` resource "aws_vpc" "foo" { cidr_block = "10.1.0.0/16" tags = { @@ -255,25 +505,8 @@ resource "aws_subnet" "foo" { resource "aws_internet_gateway" "foo" { vpc_id = "${aws_vpc.foo.id}" - tags = { Name = "tf-acc-route-table-assoc" } } - -resource "aws_route_table" "bar" { - vpc_id = "${aws_vpc.foo.id}" - route { - cidr_block = "10.0.0.0/16" - gateway_id = "${aws_internet_gateway.foo.id}" - } - tags = { - Name = "tf-acc-replace-route-table-assoc" - } -} - -resource "aws_route_table_association" "foo" { - route_table_id = "${aws_route_table.bar.id}" - subnet_id = "${aws_subnet.foo.id}" -} ` diff --git a/aws/resource_aws_route_table_test.go b/aws/resource_aws_route_table_test.go index f3251c9067e..e71dbec2547 100644 --- a/aws/resource_aws_route_table_test.go +++ b/aws/resource_aws_route_table_test.go @@ -597,6 +597,21 @@ resource "aws_route_table" "foo" { ` const testAccRouteTableConfigInstance = ` +data "aws_ami" "amzn-ami-minimal-hvm" { + most_recent = true + owners = ["amazon"] + + filter { + name = "name" + values = ["amzn-ami-minimal-hvm-*"] + } + + filter { + name = "root-device-type" + values = ["ebs"] + } +} + resource "aws_vpc" "foo" { cidr_block = "10.1.0.0/16" tags = { @@ -613,10 +628,9 @@ resource "aws_subnet" "foo" { } resource "aws_instance" "foo" { - # us-west-2 - ami = "ami-4fccb37f" - instance_type = "m1.small" - subnet_id = "${aws_subnet.foo.id}" + ami = "${data.aws_ami.amzn-ami-minimal-hvm.id}" + instance_type = "t2.micro" + subnet_id = "${aws_subnet.foo.id}" } resource "aws_route_table" "foo" { diff --git a/aws/resource_aws_s3_access_point.go b/aws/resource_aws_s3_access_point.go new file mode 100644 index 00000000000..912024e82f0 --- /dev/null +++ b/aws/resource_aws_s3_access_point.go @@ -0,0 +1,359 @@ +package aws + +import ( + "fmt" + "log" + "strings" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" + "github.com/aws/aws-sdk-go/service/s3control" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" +) + +func resourceAwsS3AccessPoint() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsS3AccessPointCreate, + Read: resourceAwsS3AccessPointRead, + Update: resourceAwsS3AccessPointUpdate, + Delete: resourceAwsS3AccessPointDelete, + + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + + Schema: map[string]*schema.Schema{ + "account_id": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ForceNew: true, + ValidateFunc: validateAwsAccountId, + }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "bucket": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.NoZeroValues, + }, + "domain_name": { + Type: schema.TypeString, + Computed: true, + }, + "has_public_access_policy": { + Type: schema.TypeBool, + Computed: true, + }, + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + ValidateFunc: validation.NoZeroValues, + }, + "network_origin": { + Type: schema.TypeString, + Computed: true, + }, + "policy": { + Type: schema.TypeString, + Optional: true, + DiffSuppressFunc: suppressEquivalentAwsPolicyDiffs, + }, + "public_access_block_configuration": { + Type: schema.TypeList, + Optional: true, + ForceNew: true, + MinItems: 0, + MaxItems: 1, + DiffSuppressFunc: suppressMissingOptionalConfigurationBlock, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "block_public_acls": { + Type: schema.TypeBool, + Optional: true, + Default: true, + ForceNew: true, + }, + "block_public_policy": { + Type: schema.TypeBool, + Optional: true, + Default: true, + ForceNew: true, + }, + "ignore_public_acls": { + Type: schema.TypeBool, + Optional: true, + Default: true, + ForceNew: true, + }, + "restrict_public_buckets": { + Type: schema.TypeBool, + Optional: true, + Default: true, + ForceNew: true, + }, + }, + }, + }, + "vpc_configuration": { + Type: schema.TypeList, + Optional: true, + ForceNew: true, + MinItems: 0, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "vpc_id": { + Type: schema.TypeString, + Required: true, + }, + }, + }, + }, + }, + } +} + +func resourceAwsS3AccessPointCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).s3controlconn + + accountId := meta.(*AWSClient).accountid + if v, ok := d.GetOk("account_id"); ok { + accountId = v.(string) + } + name := d.Get("name").(string) + + input := &s3control.CreateAccessPointInput{ + AccountId: aws.String(accountId), + Bucket: aws.String(d.Get("bucket").(string)), + Name: aws.String(name), + PublicAccessBlockConfiguration: expandS3AccessPointPublicAccessBlockConfiguration(d.Get("public_access_block_configuration").([]interface{})), + VpcConfiguration: expandS3AccessPointVpcConfiguration(d.Get("vpc_configuration").([]interface{})), + } + + log.Printf("[DEBUG] Creating S3 Access Point: %s", input) + _, err := conn.CreateAccessPoint(input) + if err != nil { + return fmt.Errorf("error creating S3 Access Point: %s", err) + } + + d.SetId(fmt.Sprintf("%s:%s", accountId, name)) + + if v, ok := d.GetOk("policy"); ok { + log.Printf("[DEBUG] Putting S3 Access Point policy: %s", d.Id()) + _, err := conn.PutAccessPointPolicy(&s3control.PutAccessPointPolicyInput{ + AccountId: aws.String(accountId), + Name: aws.String(name), + Policy: aws.String(v.(string)), + }) + + if err != nil { + return fmt.Errorf("error putting S3 Access Point (%s) policy: %s", d.Id(), err) + } + } + + return resourceAwsS3AccessPointRead(d, meta) +} + +func resourceAwsS3AccessPointRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).s3controlconn + + accountId, name, err := s3AccessPointParseId(d.Id()) + if err != nil { + return err + } + + output, err := conn.GetAccessPoint(&s3control.GetAccessPointInput{ + AccountId: aws.String(accountId), + Name: aws.String(name), + }) + + if isAWSErr(err, "NoSuchAccessPoint", "") { + log.Printf("[WARN] S3 Access Point (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + if err != nil { + return fmt.Errorf("error reading S3 Access Point (%s): %s", d.Id(), err) + } + + name = aws.StringValue(output.Name) + arn := arn.ARN{ + AccountID: accountId, + Partition: meta.(*AWSClient).partition, + Region: meta.(*AWSClient).region, + Resource: fmt.Sprintf("accesspoint/%s", name), + Service: "s3", + } + d.Set("account_id", accountId) + d.Set("arn", arn.String()) + d.Set("bucket", output.Bucket) + d.Set("domain_name", fmt.Sprintf("%s-%s.s3-accesspoint.%s.amazonaws.com", name, accountId, meta.(*AWSClient).region)) + d.Set("name", name) + d.Set("network_origin", output.NetworkOrigin) + if err := d.Set("public_access_block_configuration", flattenS3AccessPointPublicAccessBlockConfiguration(output.PublicAccessBlockConfiguration)); err != nil { + return fmt.Errorf("error setting public_access_block_configuration: %s", err) + } + if err := d.Set("vpc_configuration", flattenS3AccessPointVpcConfiguration(output.VpcConfiguration)); err != nil { + return fmt.Errorf("error setting vpc_configuration: %s", err) + } + + policyOutput, err := conn.GetAccessPointPolicy(&s3control.GetAccessPointPolicyInput{ + AccountId: aws.String(accountId), + Name: aws.String(name), + }) + + if isAWSErr(err, "NoSuchAccessPointPolicy", "") { + d.Set("policy", "") + } else { + if err != nil { + return fmt.Errorf("error reading S3 Access Point (%s) policy: %s", d.Id(), err) + } + + d.Set("policy", policyOutput.Policy) + } + + policyStatusOutput, err := conn.GetAccessPointPolicyStatus(&s3control.GetAccessPointPolicyStatusInput{ + AccountId: aws.String(accountId), + Name: aws.String(name), + }) + + if isAWSErr(err, "NoSuchAccessPointPolicy", "") { + d.Set("has_public_access_policy", false) + } else { + if err != nil { + return fmt.Errorf("error reading S3 Access Point (%s) policy status: %s", d.Id(), err) + } + + d.Set("has_public_access_policy", policyStatusOutput.PolicyStatus.IsPublic) + } + + return nil +} + +func resourceAwsS3AccessPointUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).s3controlconn + + accountId, name, err := s3AccessPointParseId(d.Id()) + if err != nil { + return err + } + + if d.HasChange("policy") { + if v, ok := d.GetOk("policy"); ok { + log.Printf("[DEBUG] Putting S3 Access Point policy: %s", d.Id()) + _, err := conn.PutAccessPointPolicy(&s3control.PutAccessPointPolicyInput{ + AccountId: aws.String(accountId), + Name: aws.String(name), + Policy: aws.String(v.(string)), + }) + + if err != nil { + return fmt.Errorf("error putting S3 Access Point (%s) policy: %s", d.Id(), err) + } + } else { + log.Printf("[DEBUG] Deleting S3 Access Point policy: %s", d.Id()) + _, err := conn.DeleteAccessPointPolicy(&s3control.DeleteAccessPointPolicyInput{ + AccountId: aws.String(accountId), + Name: aws.String(name), + }) + + if err != nil { + return fmt.Errorf("error deleting S3 Access Point (%s) policy: %s", d.Id(), err) + } + } + } + + return resourceAwsS3AccessPointRead(d, meta) +} + +func resourceAwsS3AccessPointDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).s3controlconn + + accountId, name, err := s3AccessPointParseId(d.Id()) + if err != nil { + return err + } + + log.Printf("[DEBUG] Deleting S3 Access Point: %s", d.Id()) + _, err = conn.DeleteAccessPoint(&s3control.DeleteAccessPointInput{ + AccountId: aws.String(accountId), + Name: aws.String(name), + }) + + if isAWSErr(err, "NoSuchAccessPoint", "") { + return nil + } + + if err != nil { + return fmt.Errorf("error deleting S3 Access Point (%s): %s", d.Id(), err) + } + + return nil +} + +func s3AccessPointParseId(id string) (string, string, error) { + parts := strings.SplitN(id, ":", 2) + + if len(parts) != 2 || parts[0] == "" || parts[1] == "" { + return "", "", fmt.Errorf("unexpected format of ID (%s), expected ACCOUNT_ID:NAME", id) + } + + return parts[0], parts[1], nil +} + +func expandS3AccessPointVpcConfiguration(vConfig []interface{}) *s3control.VpcConfiguration { + if len(vConfig) == 0 || vConfig[0] == nil { + return nil + } + + mConfig := vConfig[0].(map[string]interface{}) + + return &s3control.VpcConfiguration{ + VpcId: aws.String(mConfig["vpc_id"].(string)), + } +} + +func flattenS3AccessPointVpcConfiguration(config *s3control.VpcConfiguration) []interface{} { + if config == nil { + return []interface{}{} + } + + return []interface{}{map[string]interface{}{ + "vpc_id": aws.StringValue(config.VpcId), + }} +} + +func expandS3AccessPointPublicAccessBlockConfiguration(vConfig []interface{}) *s3control.PublicAccessBlockConfiguration { + if len(vConfig) == 0 || vConfig[0] == nil { + return nil + } + + mConfig := vConfig[0].(map[string]interface{}) + + return &s3control.PublicAccessBlockConfiguration{ + BlockPublicAcls: aws.Bool(mConfig["block_public_acls"].(bool)), + BlockPublicPolicy: aws.Bool(mConfig["block_public_policy"].(bool)), + IgnorePublicAcls: aws.Bool(mConfig["ignore_public_acls"].(bool)), + RestrictPublicBuckets: aws.Bool(mConfig["restrict_public_buckets"].(bool)), + } +} + +func flattenS3AccessPointPublicAccessBlockConfiguration(config *s3control.PublicAccessBlockConfiguration) []interface{} { + if config == nil { + return []interface{}{} + } + + return []interface{}{map[string]interface{}{ + "block_public_acls": aws.BoolValue(config.BlockPublicAcls), + "block_public_policy": aws.BoolValue(config.BlockPublicPolicy), + "ignore_public_acls": aws.BoolValue(config.IgnorePublicAcls), + "restrict_public_buckets": aws.BoolValue(config.RestrictPublicBuckets), + }} +} diff --git a/aws/resource_aws_s3_access_point_test.go b/aws/resource_aws_s3_access_point_test.go new file mode 100644 index 00000000000..c091c13f71c --- /dev/null +++ b/aws/resource_aws_s3_access_point_test.go @@ -0,0 +1,621 @@ +package aws + +import ( + "fmt" + "log" + "regexp" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/s3control" + "github.com/hashicorp/go-multierror" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + awspolicy "github.com/jen20/awspolicyequivalence" +) + +func init() { + resource.AddTestSweepers("aws_s3_access_point", &resource.Sweeper{ + Name: "aws_s3_access_point", + F: testSweepS3AccessPoints, + }) +} + +func testSweepS3AccessPoints(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + + accountId := client.(*AWSClient).accountid + conn := client.(*AWSClient).s3controlconn + + input := &s3control.ListAccessPointsInput{ + AccountId: aws.String(accountId), + } + var sweeperErrs *multierror.Error + + err = conn.ListAccessPointsPages(input, func(page *s3control.ListAccessPointsOutput, lastPage bool) bool { + if page == nil { + return !lastPage + } + + for _, accessPoint := range page.AccessPointList { + input := &s3control.DeleteAccessPointInput{ + AccountId: aws.String(accountId), + Name: accessPoint.Name, + } + name := aws.StringValue(accessPoint.Name) + + log.Printf("[INFO] Deleting S3 Access Point: %s", name) + _, err := conn.DeleteAccessPoint(input) + + if isAWSErr(err, "NoSuchAccessPoint", "") { + continue + } + + if err != nil { + sweeperErr := fmt.Errorf("error deleting S3 Access Point (%s): %w", name, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) + continue + } + } + + return !lastPage + }) + + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping S3 Access Point sweep for %s: %s", region, err) + return nil + } + + if err != nil { + return fmt.Errorf("error listing S3 Access Points: %w", err) + } + + return sweeperErrs.ErrorOrNil() +} + +func TestAccAWSS3AccessPoint_basic(t *testing.T) { + var v s3control.GetAccessPointOutput + bucketName := acctest.RandomWithPrefix("tf-acc-test") + accessPointName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_s3_access_point.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3AccessPointDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3AccessPointConfig_basic(bucketName, accessPointName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3AccessPointExists(resourceName, &v), + testAccCheckResourceAttrAccountID(resourceName, "account_id"), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "s3", fmt.Sprintf("accesspoint/%s", accessPointName)), + resource.TestCheckResourceAttr(resourceName, "bucket", bucketName), + testAccMatchResourceAttrRegionalHostname(resourceName, "domain_name", "s3-accesspoint", regexp.MustCompile(fmt.Sprintf("^%s-\\d{12}", accessPointName))), + resource.TestCheckResourceAttr(resourceName, "has_public_access_policy", "false"), + resource.TestCheckResourceAttr(resourceName, "name", accessPointName), + resource.TestCheckResourceAttr(resourceName, "network_origin", "Internet"), + resource.TestCheckResourceAttr(resourceName, "policy", ""), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.block_public_acls", "true"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.block_public_policy", "true"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.ignore_public_acls", "true"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.restrict_public_buckets", "true"), + resource.TestCheckResourceAttr(resourceName, "vpc_configuration.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSS3AccessPoint_disappears(t *testing.T) { + var v s3control.GetAccessPointOutput + bucketName := acctest.RandomWithPrefix("tf-acc-test") + accessPointName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_s3_access_point.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3AccessPointDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3AccessPointConfig_basic(bucketName, accessPointName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3AccessPointExists(resourceName, &v), + testAccCheckAWSS3AccessPointDisappears(resourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAWSS3AccessPoint_bucketDisappears(t *testing.T) { + var v s3control.GetAccessPointOutput + bucketName := acctest.RandomWithPrefix("tf-acc-test") + accessPointName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_s3_access_point.test" + bucketResourceName := "aws_s3_bucket.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3AccessPointDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3AccessPointConfig_basic(bucketName, accessPointName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3AccessPointExists(resourceName, &v), + testAccCheckAWSS3DestroyBucket(bucketResourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func TestAccAWSS3AccessPoint_Policy(t *testing.T) { + var v s3control.GetAccessPointOutput + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_s3_access_point.test" + + expectedPolicyText1 := func() string { + return fmt.Sprintf(` + { + "Version": "2012-10-17", + "Statement": [{ + "Sid": "", + "Effect": "Allow", + "Principal": {"AWS":"*"}, + "Action": "s3:GetObjectTagging", + "Resource": ["arn:%s:s3:%s:%s:accesspoint/%s/object/*"] + }] + } + `, testAccGetPartition(), testAccGetRegion(), testAccGetAccountID(), rName) + } + expectedPolicyText2 := func() string { + return fmt.Sprintf(` + { + "Version": "2012-10-17", + "Statement": [{ + "Sid": "", + "Effect": "Allow", + "Principal": {"AWS":"*"}, + "Action": ["s3:GetObjectLegalHold","s3:GetObjectRetention"], + "Resource": ["arn:%s:s3:%s:%s:accesspoint/%s/object/*"] + }] + } + `, testAccGetPartition(), testAccGetRegion(), testAccGetAccountID(), rName) + } + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3AccessPointDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3AccessPointConfig_policy(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3AccessPointExists(resourceName, &v), + testAccCheckAWSS3AccessPointHasPolicy(resourceName, expectedPolicyText1), + testAccCheckResourceAttrAccountID(resourceName, "account_id"), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "s3", fmt.Sprintf("accesspoint/%s", rName)), + resource.TestCheckResourceAttr(resourceName, "bucket", rName), + resource.TestCheckResourceAttr(resourceName, "has_public_access_policy", "true"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "network_origin", "Internet"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.block_public_acls", "true"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.block_public_policy", "false"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.ignore_public_acls", "true"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.restrict_public_buckets", "false"), + resource.TestCheckResourceAttr(resourceName, "vpc_configuration.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSS3AccessPointConfig_policyUpdated(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3AccessPointExists(resourceName, &v), + testAccCheckAWSS3AccessPointHasPolicy(resourceName, expectedPolicyText2), + ), + }, + { + Config: testAccAWSS3AccessPointConfig_noPolicy(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3AccessPointExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "has_public_access_policy", "false"), + resource.TestCheckResourceAttr(resourceName, "policy", ""), + ), + }, + }, + }) +} + +func TestAccAWSS3AccessPoint_PublicAccessBlockConfiguration(t *testing.T) { + var v s3control.GetAccessPointOutput + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_s3_access_point.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3AccessPointDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3AccessPointConfig_publicAccessBlock(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3AccessPointExists(resourceName, &v), + testAccCheckResourceAttrAccountID(resourceName, "account_id"), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "s3", fmt.Sprintf("accesspoint/%s", rName)), + resource.TestCheckResourceAttr(resourceName, "bucket", rName), + resource.TestCheckResourceAttr(resourceName, "has_public_access_policy", "false"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "network_origin", "Internet"), + resource.TestCheckResourceAttr(resourceName, "policy", ""), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.block_public_acls", "false"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.block_public_policy", "false"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.ignore_public_acls", "false"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.restrict_public_buckets", "false"), + resource.TestCheckResourceAttr(resourceName, "vpc_configuration.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSS3AccessPoint_VpcConfiguration(t *testing.T) { + var v s3control.GetAccessPointOutput + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_s3_access_point.test" + vpcResourceName := "aws_vpc.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3AccessPointDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3AccessPointConfig_vpc(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3AccessPointExists(resourceName, &v), + testAccCheckResourceAttrAccountID(resourceName, "account_id"), + testAccCheckResourceAttrRegionalARN(resourceName, "arn", "s3", fmt.Sprintf("accesspoint/%s", rName)), + resource.TestCheckResourceAttr(resourceName, "bucket", rName), + resource.TestCheckResourceAttr(resourceName, "has_public_access_policy", "false"), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "network_origin", "VPC"), + resource.TestCheckResourceAttr(resourceName, "policy", ""), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.#", "1"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.block_public_acls", "true"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.block_public_policy", "true"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.ignore_public_acls", "true"), + resource.TestCheckResourceAttr(resourceName, "public_access_block_configuration.0.restrict_public_buckets", "true"), + resource.TestCheckResourceAttr(resourceName, "vpc_configuration.#", "1"), + resource.TestCheckResourceAttrPair(resourceName, "vpc_configuration.0.vpc_id", vpcResourceName, "id"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckAWSS3AccessPointDisappears(n string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No S3 Access Point ID is set") + } + + accountId, name, err := s3AccessPointParseId(rs.Primary.ID) + if err != nil { + return err + } + + conn := testAccProvider.Meta().(*AWSClient).s3controlconn + + _, err = conn.DeleteAccessPoint(&s3control.DeleteAccessPointInput{ + AccountId: aws.String(accountId), + Name: aws.String(name), + }) + if err != nil { + return err + } + + return nil + } +} + +func testAccCheckAWSS3AccessPointDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).s3controlconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_s3_access_point" { + continue + } + + accountId, name, err := s3AccessPointParseId(rs.Primary.ID) + if err != nil { + return err + } + + _, err = conn.GetAccessPoint(&s3control.GetAccessPointInput{ + AccountId: aws.String(accountId), + Name: aws.String(name), + }) + if err == nil { + return fmt.Errorf("S3 Access Point still exists") + } + } + return nil +} + +func testAccCheckAWSS3AccessPointExists(n string, output *s3control.GetAccessPointOutput) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No S3 Access Point ID is set") + } + + accountId, name, err := s3AccessPointParseId(rs.Primary.ID) + if err != nil { + return err + } + + conn := testAccProvider.Meta().(*AWSClient).s3controlconn + + resp, err := conn.GetAccessPoint(&s3control.GetAccessPointInput{ + AccountId: aws.String(accountId), + Name: aws.String(name), + }) + if err != nil { + return err + } + + *output = *resp + + return nil + } +} + +func testAccCheckAWSS3AccessPointHasPolicy(n string, fn func() string) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No S3 Access Point ID is set") + } + + accountId, name, err := s3AccessPointParseId(rs.Primary.ID) + if err != nil { + return err + } + + conn := testAccProvider.Meta().(*AWSClient).s3controlconn + + resp, err := conn.GetAccessPointPolicy(&s3control.GetAccessPointPolicyInput{ + AccountId: aws.String(accountId), + Name: aws.String(name), + }) + if err != nil { + return err + } + + actualPolicyText := *resp.Policy + expectedPolicyText := fn() + + equivalent, err := awspolicy.PoliciesAreEquivalent(actualPolicyText, expectedPolicyText) + if err != nil { + return fmt.Errorf("Error testing policy equivalence: %s", err) + } + if !equivalent { + return fmt.Errorf("Non-equivalent policy error:\n\nexpected: %s\n\n got: %s\n", + expectedPolicyText, actualPolicyText) + } + + return nil + } +} + +func testAccAWSS3AccessPointConfig_basic(bucketName, accessPointName string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket" "test" { + bucket = %[1]q +} + +resource "aws_s3_access_point" "test" { + bucket = "${aws_s3_bucket.test.bucket}" + name = %[2]q +} +`, bucketName, accessPointName) +} + +func testAccAWSS3AccessPointConfig_policy(rName string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket" "test" { + bucket = %[1]q +} + +resource "aws_s3_access_point" "test" { + bucket = "${aws_s3_bucket.test.bucket}" + name = %[1]q + policy = "${data.aws_iam_policy_document.test.json}" + + public_access_block_configuration { + block_public_acls = true + block_public_policy = false + ignore_public_acls = true + restrict_public_buckets = false + } +} + +data "aws_caller_identity" "current" {} +data "aws_partition" "current" {} +data "aws_region" "current" {} + +data "aws_iam_policy_document" "test" { + statement { + effect = "Allow" + + actions = [ + "s3:GetObjectTagging", + ] + + resources = [ + "arn:${data.aws_partition.current.partition}:s3:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:accesspoint/%[1]s/object/*", + ] + + principals { + type = "AWS" + identifiers = ["*"] + } + } +} +`, rName) +} + +func testAccAWSS3AccessPointConfig_policyUpdated(rName string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket" "test" { + bucket = %[1]q +} + +resource "aws_s3_access_point" "test" { + bucket = "${aws_s3_bucket.test.bucket}" + name = %[1]q + policy = "${data.aws_iam_policy_document.test.json}" + + public_access_block_configuration { + block_public_acls = true + block_public_policy = false + ignore_public_acls = true + restrict_public_buckets = false + } +} + +data "aws_caller_identity" "current" {} +data "aws_partition" "current" {} +data "aws_region" "current" {} + +data "aws_iam_policy_document" "test" { + statement { + effect = "Allow" + + actions = [ + "s3:GetObjectLegalHold", + "s3:GetObjectRetention" + ] + + resources = [ + "arn:${data.aws_partition.current.partition}:s3:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:accesspoint/%[1]s/object/*", + ] + + principals { + type = "AWS" + identifiers = ["*"] + } + } +} +`, rName) +} + +func testAccAWSS3AccessPointConfig_noPolicy(rName string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket" "test" { + bucket = %[1]q +} + +resource "aws_s3_access_point" "test" { + bucket = "${aws_s3_bucket.test.bucket}" + name = %[1]q + + public_access_block_configuration { + block_public_acls = true + block_public_policy = false + ignore_public_acls = true + restrict_public_buckets = false + } +} +`, rName) +} + +func testAccAWSS3AccessPointConfig_publicAccessBlock(rName string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket" "test" { + bucket = %[1]q +} + +resource "aws_s3_access_point" "test" { + bucket = "${aws_s3_bucket.test.bucket}" + name = %[1]q + + public_access_block_configuration { + block_public_acls = false + block_public_policy = false + ignore_public_acls = false + restrict_public_buckets = false + } +} +`, rName) +} + +func testAccAWSS3AccessPointConfig_vpc(rName string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.1.0.0/16" + + tags = { + Name = %[1]q + } +} + +resource "aws_s3_bucket" "test" { + bucket = %[1]q +} + +resource "aws_s3_access_point" "test" { + bucket = "${aws_s3_bucket.test.bucket}" + name = %[1]q + + vpc_configuration { + vpc_id = "${aws_vpc.test.id}" + } +} +`, rName) +} diff --git a/aws/resource_aws_s3_bucket.go b/aws/resource_aws_s3_bucket.go index 1ba3f64ea8f..42a61e8eb7f 100644 --- a/aws/resource_aws_s3_bucket.go +++ b/aws/resource_aws_s3_bucket.go @@ -20,8 +20,11 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/structure" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) +const s3BucketCreationTimeout = 2 * time.Minute + func resourceAwsS3Bucket() *schema.Resource { return &schema.Resource{ Create: resourceAwsS3BucketCreate, @@ -676,8 +679,13 @@ func resourceAwsS3BucketCreate(d *schema.ResourceData, meta interface{}) error { func resourceAwsS3BucketUpdate(d *schema.ResourceData, meta interface{}) error { s3conn := meta.(*AWSClient).s3conn - if err := setTagsS3Bucket(s3conn, d); err != nil { - return fmt.Errorf("%q: %s", d.Get("bucket").(string), err) + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.S3BucketUpdateTags(s3conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating S3 Bucket (%s) tags: %s", d.Id(), err) + } } if d.HasChange("policy") { @@ -757,19 +765,39 @@ func resourceAwsS3BucketUpdate(d *schema.ResourceData, meta interface{}) error { func resourceAwsS3BucketRead(d *schema.ResourceData, meta interface{}) error { s3conn := meta.(*AWSClient).s3conn - var err error + input := &s3.HeadBucketInput{ + Bucket: aws.String(d.Id()), + } - _, err = retryOnAwsCode(s3.ErrCodeNoSuchBucket, func() (interface{}, error) { - return s3conn.HeadBucket(&s3.HeadBucketInput{ - Bucket: aws.String(d.Id()), - }) + err := resource.Retry(s3BucketCreationTimeout, func() *resource.RetryError { + _, err := s3conn.HeadBucket(input) + + if d.IsNewResource() && isAWSErrRequestFailureStatusCode(err, 404) { + return resource.RetryableError(err) + } + + if d.IsNewResource() && isAWSErr(err, s3.ErrCodeNoSuchBucket, "") { + return resource.RetryableError(err) + } + + if err != nil { + return resource.NonRetryableError(err) + } + + return nil }) + + if isResourceTimeoutError(err) { + _, err = s3conn.HeadBucket(input) + } + + if isAWSErrRequestFailureStatusCode(err, 404) || isAWSErr(err, s3.ErrCodeNoSuchBucket, "") { + log.Printf("[WARN] S3 Bucket (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + 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 - } return fmt.Errorf("error reading S3 Bucket (%s): %s", d.Id(), err) } @@ -1028,7 +1056,7 @@ func resourceAwsS3BucketRead(d *schema.ResourceData, meta interface{}) error { } // Tag if len(filter.And.Tags) > 0 { - rule["tags"] = tagsToMapS3(filter.And.Tags) + rule["tags"] = keyvaluetags.S3KeyValueTags(filter.And.Tags).IgnoreAws().Map() } } else { // Prefix @@ -1037,7 +1065,7 @@ func resourceAwsS3BucketRead(d *schema.ResourceData, meta interface{}) error { } // Tag if filter.Tag != nil { - rule["tags"] = tagsToMapS3([]*s3.Tag{filter.Tag}) + rule["tags"] = keyvaluetags.S3KeyValueTags([]*s3.Tag{filter.Tag}).IgnoreAws().Map() } } } else { @@ -1223,13 +1251,17 @@ func resourceAwsS3BucketRead(d *schema.ResourceData, meta interface{}) error { } } - tagSet, err := getTagSetS3Bucket(s3conn, d.Id()) + // Retry due to S3 eventual consistency + tags, err := retryOnAwsCode(s3.ErrCodeNoSuchBucket, func() (interface{}, error) { + return keyvaluetags.S3BucketListTags(s3conn, d.Id()) + }) + if err != nil { - return fmt.Errorf("error getting S3 bucket tags: %s", err) + return fmt.Errorf("error listing tags for S3 Bucket (%s): %s", d.Id(), err) } - if err := d.Set("tags", tagsToMapS3(tagSet)); err != nil { - return err + if err := d.Set("tags", tags.(keyvaluetags.KeyValueTags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } arn := arn.ARN{ @@ -1911,11 +1943,11 @@ func resourceAwsS3BucketReplicationConfigurationUpdate(s3conn *s3.S3, d *schema. rcRule.Priority = aws.Int64(int64(rr["priority"].(int))) rcRule.Filter = &s3.ReplicationRuleFilter{} filter := f[0].(map[string]interface{}) - tags := filter["tags"].(map[string]interface{}) + tags := keyvaluetags.New(filter["tags"]).IgnoreAws().S3Tags() if len(tags) > 0 { rcRule.Filter.And = &s3.ReplicationRuleAndOperator{ Prefix: aws.String(filter["prefix"].(string)), - Tags: tagsFromMapS3(tags), + Tags: tags, } } else { rcRule.Filter.Prefix = aws.String(filter["prefix"].(string)) @@ -1983,12 +2015,12 @@ func resourceAwsS3BucketLifecycleUpdate(s3conn *s3.S3, d *schema.ResourceData) e rule := &s3.LifecycleRule{} // Filter - tags := r["tags"].(map[string]interface{}) + tags := keyvaluetags.New(r["tags"]).IgnoreAws().S3Tags() filter := &s3.LifecycleRuleFilter{} if len(tags) > 0 { lifecycleRuleAndOp := &s3.LifecycleRuleAndOperator{} lifecycleRuleAndOp.SetPrefix(r["prefix"].(string)) - lifecycleRuleAndOp.SetTags(tagsFromMapS3(tags)) + lifecycleRuleAndOp.SetTags(tags) filter.SetAnd(lifecycleRuleAndOp) } else { filter.SetPrefix(r["prefix"].(string)) @@ -2202,11 +2234,11 @@ func flattenAwsS3BucketReplicationConfiguration(r *s3.ReplicationConfiguration) m["prefix"] = aws.StringValue(f.Prefix) } if t := f.Tag; t != nil { - m["tags"] = tagsMapToRaw(tagsToMapS3([]*s3.Tag{t})) + m["tags"] = keyvaluetags.S3KeyValueTags([]*s3.Tag{t}).IgnoreAws().Map() } if a := f.And; a != nil { m["prefix"] = aws.StringValue(a.Prefix) - m["tags"] = tagsMapToRaw(tagsToMapS3(a.Tags)) + m["tags"] = keyvaluetags.S3KeyValueTags(a.Tags).IgnoreAws().Map() } t["filter"] = []interface{}{m} } @@ -2372,7 +2404,7 @@ func replicationRuleFilterHash(v interface{}) int { buf.WriteString(fmt.Sprintf("%s-", v.(string))) } if v, ok := m["tags"]; ok { - buf.WriteString(fmt.Sprintf("%d-", tagsMapToHash(v.(map[string]interface{})))) + buf.WriteString(fmt.Sprintf("%d-", keyvaluetags.New(v).Hash())) } return hashcode.String(buf.String()) } @@ -2452,6 +2484,11 @@ func readS3ObjectLockConfiguration(conn *s3.S3, bucket string) ([]interface{}, e }) }) if err != nil { + // Certain S3 implementations do not include this API + if isAWSErr(err, "MethodNotAllowed", "") { + return nil, nil + } + if isAWSErr(err, "ObjectLockConfigurationNotFoundError", "") { return nil, nil } diff --git a/aws/resource_aws_s3_bucket_analytics_configuration.go b/aws/resource_aws_s3_bucket_analytics_configuration.go new file mode 100644 index 00000000000..0929e0a5fed --- /dev/null +++ b/aws/resource_aws_s3_bucket_analytics_configuration.go @@ -0,0 +1,437 @@ +package aws + +import ( + "fmt" + "log" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +func resourceAwsS3BucketAnalyticsConfiguration() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsS3BucketAnalyticsConfigurationPut, + Read: resourceAwsS3BucketAnalyticsConfigurationRead, + Update: resourceAwsS3BucketAnalyticsConfigurationPut, + Delete: resourceAwsS3BucketAnalyticsConfigurationDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + + Schema: map[string]*schema.Schema{ + "name": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "bucket": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "filter": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "prefix": { + Type: schema.TypeString, + Optional: true, + AtLeastOneOf: filterAtLeastOneOfKeys, + }, + "tags": { + Type: schema.TypeMap, + Optional: true, + AtLeastOneOf: filterAtLeastOneOfKeys, + }, + }, + }, + }, + "storage_class_analysis": { + Type: schema.TypeList, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "data_export": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "output_schema_version": { + Type: schema.TypeString, + Optional: true, + Default: s3.StorageClassAnalysisSchemaVersionV1, + ValidateFunc: validation.StringInSlice([]string{s3.StorageClassAnalysisSchemaVersionV1}, false), + }, + "destination": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "s3_bucket_destination": { + Type: schema.TypeList, + Required: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "bucket_arn": { + Type: schema.TypeString, + Required: true, + ValidateFunc: validateArn, + }, + "bucket_account_id": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validateAwsAccountId, + }, + "format": { + Type: schema.TypeString, + Optional: true, + Default: s3.AnalyticsS3ExportFileFormatCsv, + ValidateFunc: validation.StringInSlice([]string{s3.AnalyticsS3ExportFileFormatCsv}, false), + }, + "prefix": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } +} + +var filterAtLeastOneOfKeys = []string{"filter.0.prefix", "filter.0.tags"} + +func resourceAwsS3BucketAnalyticsConfigurationPut(d *schema.ResourceData, meta interface{}) error { + s3conn := meta.(*AWSClient).s3conn + + bucket := d.Get("bucket").(string) + name := d.Get("name").(string) + + log.Printf("[DEBUG] S3 bucket %q, add analytics configuration %q", bucket, name) + + analyticsConfiguration := &s3.AnalyticsConfiguration{ + Id: aws.String(name), + Filter: expandS3AnalyticsFilter(d.Get("filter").([]interface{})), + StorageClassAnalysis: expandS3StorageClassAnalysis(d.Get("storage_class_analysis").([]interface{})), + } + + input := &s3.PutBucketAnalyticsConfigurationInput{ + Bucket: aws.String(bucket), + Id: aws.String(name), + AnalyticsConfiguration: analyticsConfiguration, + } + + err := resource.Retry(1*time.Minute, func() *resource.RetryError { + _, err := s3conn.PutBucketAnalyticsConfiguration(input) + if err != nil { + if isAWSErr(err, s3.ErrCodeNoSuchBucket, "") { + return resource.RetryableError(err) + } + return resource.NonRetryableError(err) + } + return nil + }) + if isResourceTimeoutError(err) { + _, err = s3conn.PutBucketAnalyticsConfiguration(input) + } + if err != nil { + return fmt.Errorf("Error adding S3 analytics configuration: %w", err) + } + + d.SetId(fmt.Sprintf("%s:%s", bucket, name)) + + return resourceAwsS3BucketAnalyticsConfigurationRead(d, meta) +} + +func resourceAwsS3BucketAnalyticsConfigurationRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).s3conn + + bucket, name, err := resourceAwsS3BucketAnalyticsConfigurationParseID(d.Id()) + if err != nil { + return err + } + + d.Set("bucket", bucket) + d.Set("name", name) + + input := &s3.GetBucketAnalyticsConfigurationInput{ + Bucket: aws.String(bucket), + Id: aws.String(name), + } + + log.Printf("[DEBUG] Reading S3 bucket analytics configuration: %s", input) + output, err := conn.GetBucketAnalyticsConfiguration(input) + if err != nil { + if isAWSErr(err, s3.ErrCodeNoSuchBucket, "") || isAWSErr(err, "NoSuchConfiguration", "The specified configuration does not exist.") { + log.Printf("[WARN] %s S3 bucket analytics configuration not found, removing from state.", d.Id()) + d.SetId("") + return nil + } + return fmt.Errorf("error getting S3 Bucket Analytics Configuration %q: %w", d.Id(), err) + } + + if err := d.Set("filter", flattenS3AnalyticsFilter(output.AnalyticsConfiguration.Filter)); err != nil { + return fmt.Errorf("error setting filter: %w", err) + } + + if err = d.Set("storage_class_analysis", flattenS3StorageClassAnalysis(output.AnalyticsConfiguration.StorageClassAnalysis)); err != nil { + return fmt.Errorf("error setting storage class anyalytics: %w", err) + } + + return nil +} + +func resourceAwsS3BucketAnalyticsConfigurationDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).s3conn + + bucket, name, err := resourceAwsS3BucketAnalyticsConfigurationParseID(d.Id()) + if err != nil { + return err + } + + input := &s3.DeleteBucketAnalyticsConfigurationInput{ + Bucket: aws.String(bucket), + Id: aws.String(name), + } + + log.Printf("[DEBUG] Deleting S3 bucket analytics configuration: %s", input) + _, err = conn.DeleteBucketAnalyticsConfiguration(input) + if err != nil { + if isAWSErr(err, s3.ErrCodeNoSuchBucket, "") || isAWSErr(err, "NoSuchConfiguration", "The specified configuration does not exist.") { + return nil + } + return fmt.Errorf("Error deleting S3 analytics configuration: %w", err) + } + + return waitForDeleteS3BucketAnalyticsConfiguration(conn, bucket, name, 1*time.Minute) +} + +func resourceAwsS3BucketAnalyticsConfigurationParseID(id string) (string, string, error) { + idParts := strings.Split(id, ":") + if len(idParts) != 2 { + return "", "", fmt.Errorf("please make sure the ID is in the form BUCKET:NAME (i.e. my-bucket:EntireBucket") + } + bucket := idParts[0] + name := idParts[1] + return bucket, name, nil +} + +func expandS3AnalyticsFilter(l []interface{}) *s3.AnalyticsFilter { + if len(l) == 0 || l[0] == nil { + return nil + } + + m := l[0].(map[string]interface{}) + + var prefix string + if v, ok := m["prefix"]; ok { + prefix = v.(string) + } + + var tags []*s3.Tag + if v, ok := m["tags"]; ok { + tags = keyvaluetags.New(v).IgnoreAws().S3Tags() + } + + if prefix == "" && len(tags) == 0 { + return nil + } + analyticsFilter := &s3.AnalyticsFilter{} + if prefix != "" && len(tags) > 0 { + analyticsFilter.And = &s3.AnalyticsAndOperator{ + Prefix: aws.String(prefix), + Tags: tags, + } + } else if len(tags) > 1 { + analyticsFilter.And = &s3.AnalyticsAndOperator{ + Tags: tags, + } + } else if len(tags) == 1 { + analyticsFilter.Tag = tags[0] + } else { + analyticsFilter.Prefix = aws.String(prefix) + } + return analyticsFilter +} + +func expandS3StorageClassAnalysis(l []interface{}) *s3.StorageClassAnalysis { + result := &s3.StorageClassAnalysis{} + + if len(l) == 0 || l[0] == nil { + return result + } + + m := l[0].(map[string]interface{}) + if v, ok := m["data_export"]; ok { + dataExport := &s3.StorageClassAnalysisDataExport{} + result.DataExport = dataExport + + foo := v.([]interface{}) + if len(foo) != 0 && foo[0] != nil { + bar := foo[0].(map[string]interface{}) + if v, ok := bar["output_schema_version"]; ok { + dataExport.OutputSchemaVersion = aws.String(v.(string)) + } + + dataExport.Destination = expandS3AnalyticsExportDestination(bar["destination"].([]interface{})) + } + } + + return result +} + +func expandS3AnalyticsExportDestination(edl []interface{}) *s3.AnalyticsExportDestination { + result := &s3.AnalyticsExportDestination{} + + if len(edl) != 0 && edl[0] != nil { + edm := edl[0].(map[string]interface{}) + result.S3BucketDestination = expandS3AnalyticsS3BucketDestination(edm["s3_bucket_destination"].([]interface{})) + } + return result +} + +func expandS3AnalyticsS3BucketDestination(bdl []interface{}) *s3.AnalyticsS3BucketDestination { + result := &s3.AnalyticsS3BucketDestination{} + + if len(bdl) != 0 && bdl[0] != nil { + bdm := bdl[0].(map[string]interface{}) + result.Bucket = aws.String(bdm["bucket_arn"].(string)) + result.Format = aws.String(bdm["format"].(string)) + + if v, ok := bdm["bucket_account_id"]; ok && v != "" { + result.BucketAccountId = aws.String(v.(string)) + } + + if v, ok := bdm["prefix"]; ok && v != "" { + result.Prefix = aws.String(v.(string)) + } + } + + return result +} + +func flattenS3AnalyticsFilter(analyticsFilter *s3.AnalyticsFilter) []map[string]interface{} { + if analyticsFilter == nil { + return nil + } + + result := make(map[string]interface{}) + if analyticsFilter.And != nil { + and := *analyticsFilter.And + if and.Prefix != nil { + result["prefix"] = *and.Prefix + } + if and.Tags != nil { + result["tags"] = keyvaluetags.S3KeyValueTags(and.Tags).IgnoreAws().Map() + } + } else if analyticsFilter.Prefix != nil { + result["prefix"] = *analyticsFilter.Prefix + } else if analyticsFilter.Tag != nil { + tags := []*s3.Tag{ + analyticsFilter.Tag, + } + result["tags"] = keyvaluetags.S3KeyValueTags(tags).IgnoreAws().Map() + } else { + return nil + } + return []map[string]interface{}{result} +} + +func flattenS3StorageClassAnalysis(storageClassAnalysis *s3.StorageClassAnalysis) []map[string]interface{} { + if storageClassAnalysis == nil || storageClassAnalysis.DataExport == nil { + return []map[string]interface{}{} + } + + dataExport := storageClassAnalysis.DataExport + de := make(map[string]interface{}) + if dataExport.OutputSchemaVersion != nil { + de["output_schema_version"] = aws.StringValue(dataExport.OutputSchemaVersion) + } + if dataExport.Destination != nil { + de["destination"] = flattenS3AnalyticsExportDestination(dataExport.Destination) + } + result := map[string]interface{}{ + "data_export": []interface{}{de}, + } + + return []map[string]interface{}{result} +} + +func flattenS3AnalyticsExportDestination(destination *s3.AnalyticsExportDestination) []interface{} { + if destination == nil || destination.S3BucketDestination == nil { + return []interface{}{} + } + + return []interface{}{ + map[string]interface{}{ + "s3_bucket_destination": flattenS3AnalyticsS3BucketDestination(destination.S3BucketDestination), + }, + } +} + +func flattenS3AnalyticsS3BucketDestination(bucketDestination *s3.AnalyticsS3BucketDestination) []interface{} { + if bucketDestination == nil { + return nil + } + + result := map[string]interface{}{ + "bucket_arn": aws.StringValue(bucketDestination.Bucket), + "format": aws.StringValue(bucketDestination.Format), + } + if bucketDestination.BucketAccountId != nil { + result["bucket_account_id"] = aws.StringValue(bucketDestination.BucketAccountId) + } + if bucketDestination.Prefix != nil { + result["prefix"] = aws.StringValue(bucketDestination.Prefix) + } + + return []interface{}{result} +} + +func waitForDeleteS3BucketAnalyticsConfiguration(conn *s3.S3, bucket, name string, timeout time.Duration) error { + err := resource.Retry(timeout, func() *resource.RetryError { + input := &s3.GetBucketAnalyticsConfigurationInput{ + Bucket: aws.String(bucket), + Id: aws.String(name), + } + log.Printf("[DEBUG] Reading S3 bucket analytics configuration: %s", input) + output, err := conn.GetBucketAnalyticsConfiguration(input) + if err != nil { + if isAWSErr(err, s3.ErrCodeNoSuchBucket, "") || isAWSErr(err, "NoSuchConfiguration", "The specified configuration does not exist.") { + return nil + } + return resource.NonRetryableError(err) + } + if output.AnalyticsConfiguration != nil { + return resource.RetryableError(fmt.Errorf("S3 bucket analytics configuration exists: %v", output)) + } + + return nil + }) + + if err != nil { + return fmt.Errorf("error deleting S3 Bucket Analytics Configuration \"%s:%s\": %w", bucket, name, err) + } + return nil +} diff --git a/aws/resource_aws_s3_bucket_analytics_configuration_test.go b/aws/resource_aws_s3_bucket_analytics_configuration_test.go new file mode 100644 index 00000000000..e08f0cbe9f0 --- /dev/null +++ b/aws/resource_aws_s3_bucket_analytics_configuration_test.go @@ -0,0 +1,1225 @@ +package aws + +import ( + "fmt" + "reflect" + "regexp" + "sort" + "testing" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/s3" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func TestAccAWSS3BucketAnalyticsConfiguration_basic(t *testing.T) { + var ac s3.AnalyticsConfiguration + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_s3_bucket_analytics_configuration.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3BucketAnalyticsConfiguration(rName, rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttrPair(resourceName, "bucket", "aws_s3_bucket.test", "bucket"), + resource.TestCheckResourceAttr(resourceName, "filter.#", "0"), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSS3BucketAnalyticsConfiguration_removed(t *testing.T) { + var ac s3.AnalyticsConfiguration + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_s3_bucket_analytics_configuration.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3BucketAnalyticsConfiguration(rName, rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + ), + }, + { + Config: testAccAWSS3BucketAnalyticsConfiguration_removed(rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationRemoved(rName, rName), + ), + }, + }, + }) +} + +func TestAccAWSS3BucketAnalyticsConfiguration_updateBasic(t *testing.T) { + var ac s3.AnalyticsConfiguration + originalACName := acctest.RandomWithPrefix("tf-acc-test") + originalBucketName := acctest.RandomWithPrefix("tf-acc-test") + updatedACName := acctest.RandomWithPrefix("tf-acc-test") + updatedBucketName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_s3_bucket_analytics_configuration.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3BucketAnalyticsConfiguration(originalACName, originalBucketName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + resource.TestCheckResourceAttr(resourceName, "name", originalACName), + resource.TestCheckResourceAttrPair(resourceName, "bucket", "aws_s3_bucket.test", "bucket"), + resource.TestCheckResourceAttr(resourceName, "filter.#", "0"), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.#", "0"), + ), + }, + { + Config: testAccAWSS3BucketAnalyticsConfiguration(updatedACName, originalBucketName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + testAccCheckAWSS3BucketAnalyticsConfigurationRemoved(originalACName, originalBucketName), + resource.TestCheckResourceAttr(resourceName, "name", updatedACName), + resource.TestCheckResourceAttrPair(resourceName, "bucket", "aws_s3_bucket.test", "bucket"), + resource.TestCheckResourceAttr(resourceName, "filter.#", "0"), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.#", "0"), + ), + }, + { + Config: testAccAWSS3BucketAnalyticsConfigurationUpdateBucket(updatedACName, originalBucketName, updatedBucketName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + testAccCheckAWSS3BucketAnalyticsConfigurationRemoved(updatedACName, originalBucketName), + resource.TestCheckResourceAttr(resourceName, "name", updatedACName), + resource.TestCheckResourceAttrPair(resourceName, "bucket", "aws_s3_bucket.test_2", "bucket"), + resource.TestCheckResourceAttr(resourceName, "filter.#", "0"), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Empty(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3BucketAnalyticsConfigurationWithEmptyFilter(rName, rName), + ExpectError: regexp.MustCompile(`config is invalid:`), + }, + }, + }) +} + +func TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Prefix(t *testing.T) { + var ac s3.AnalyticsConfiguration + rInt := acctest.RandInt() + resourceName := "aws_s3_bucket_analytics_configuration.test" + + rName := fmt.Sprintf("tf-acc-test-%d", rInt) + prefix := fmt.Sprintf("prefix-%d/", rInt) + prefixUpdate := fmt.Sprintf("prefix-update-%d/", rInt) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3BucketAnalyticsConfigurationWithFilterPrefix(rName, rName, prefix), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + resource.TestCheckResourceAttr(resourceName, "filter.#", "1"), + resource.TestCheckResourceAttr(resourceName, "filter.0.prefix", prefix), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.%", "0"), + ), + }, + { + Config: testAccAWSS3BucketAnalyticsConfigurationWithFilterPrefix(rName, rName, prefixUpdate), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + resource.TestCheckResourceAttr(resourceName, "filter.#", "1"), + resource.TestCheckResourceAttr(resourceName, "filter.0.prefix", prefixUpdate), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.%", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_SingleTag(t *testing.T) { + var ac s3.AnalyticsConfiguration + rInt := acctest.RandInt() + resourceName := "aws_s3_bucket_analytics_configuration.test" + + rName := fmt.Sprintf("tf-acc-test-%d", rInt) + tag1 := fmt.Sprintf("tag-%d", rInt) + tag1Update := fmt.Sprintf("tag-update-%d", rInt) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3BucketAnalyticsConfigurationWithFilterSingleTag(rName, rName, tag1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + resource.TestCheckResourceAttr(resourceName, "filter.#", "1"), + resource.TestCheckResourceAttr(resourceName, "filter.0.prefix", ""), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.tag1", tag1), + ), + }, + { + Config: testAccAWSS3BucketAnalyticsConfigurationWithFilterSingleTag(rName, rName, tag1Update), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + resource.TestCheckResourceAttr(resourceName, "filter.#", "1"), + resource.TestCheckResourceAttr(resourceName, "filter.0.prefix", ""), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.tag1", tag1Update), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_MultipleTags(t *testing.T) { + var ac s3.AnalyticsConfiguration + rInt := acctest.RandInt() + resourceName := "aws_s3_bucket_analytics_configuration.test" + + rName := fmt.Sprintf("tf-acc-test-%d", rInt) + tag1 := fmt.Sprintf("tag1-%d", rInt) + tag1Update := fmt.Sprintf("tag1-update-%d", rInt) + tag2 := fmt.Sprintf("tag2-%d", rInt) + tag2Update := fmt.Sprintf("tag2-update-%d", rInt) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3BucketAnalyticsConfigurationWithFilterMultipleTags(rName, rName, tag1, tag2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + resource.TestCheckResourceAttr(resourceName, "filter.#", "1"), + resource.TestCheckResourceAttr(resourceName, "filter.0.prefix", ""), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.tag1", tag1), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.tag2", tag2), + ), + }, + { + Config: testAccAWSS3BucketAnalyticsConfigurationWithFilterMultipleTags(rName, rName, tag1Update, tag2Update), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + resource.TestCheckResourceAttr(resourceName, "filter.#", "1"), + resource.TestCheckResourceAttr(resourceName, "filter.0.prefix", ""), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.tag1", tag1Update), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.tag2", tag2Update), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_PrefixAndTags(t *testing.T) { + var ac s3.AnalyticsConfiguration + rInt := acctest.RandInt() + resourceName := "aws_s3_bucket_analytics_configuration.test" + + rName := fmt.Sprintf("tf-acc-test-%d", rInt) + prefix := fmt.Sprintf("prefix-%d/", rInt) + prefixUpdate := fmt.Sprintf("prefix-update-%d/", rInt) + tag1 := fmt.Sprintf("tag1-%d", rInt) + tag1Update := fmt.Sprintf("tag1-update-%d", rInt) + tag2 := fmt.Sprintf("tag2-%d", rInt) + tag2Update := fmt.Sprintf("tag2-update-%d", rInt) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3BucketAnalyticsConfigurationWithFilterPrefixAndTags(rName, rName, prefix, tag1, tag2), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + resource.TestCheckResourceAttr(resourceName, "filter.#", "1"), + resource.TestCheckResourceAttr(resourceName, "filter.0.prefix", prefix), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.tag1", tag1), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.tag2", tag2), + ), + }, + { + Config: testAccAWSS3BucketAnalyticsConfigurationWithFilterPrefixAndTags(rName, rName, prefixUpdate, tag1Update, tag2Update), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + resource.TestCheckResourceAttr(resourceName, "filter.#", "1"), + resource.TestCheckResourceAttr(resourceName, "filter.0.prefix", prefixUpdate), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.tag1", tag1Update), + resource.TestCheckResourceAttr(resourceName, "filter.0.tags.tag2", tag2Update), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSS3BucketAnalyticsConfiguration_WithFilter_Remove(t *testing.T) { + var ac s3.AnalyticsConfiguration + rInt := acctest.RandInt() + resourceName := "aws_s3_bucket_analytics_configuration.test" + + rName := fmt.Sprintf("tf-acc-test-%d", rInt) + prefix := fmt.Sprintf("prefix-%d/", rInt) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3BucketAnalyticsConfigurationWithFilterPrefix(rName, rName, prefix), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + ), + }, + { + Config: testAccAWSS3BucketAnalyticsConfiguration(rName, rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + resource.TestCheckResourceAttr(resourceName, "filter.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Empty(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3BucketAnalyticsConfigurationWithEmptyStorageClassAnalysis(rName, rName), + ExpectError: regexp.MustCompile(`config is invalid:`), + }, + }, + }) +} + +func TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Default(t *testing.T) { + var ac s3.AnalyticsConfiguration + resourceName := "aws_s3_bucket_analytics_configuration.test" + + rName := acctest.RandomWithPrefix("tf-acc-test") + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3BucketAnalyticsConfigurationWithDefaultStorageClassAnalysis(rName, rName), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.#", "1"), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.0.data_export.#", "1"), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.0.data_export.0.output_schema_version", "V_1"), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.0.data_export.0.destination.#", "1"), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.0.data_export.0.destination.0.s3_bucket_destination.#", "1"), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.0.data_export.0.destination.0.s3_bucket_destination.0.format", "CSV"), + resource.TestCheckResourceAttrPair(resourceName, "storage_class_analysis.0.data_export.0.destination.0.s3_bucket_destination.0.bucket_arn", "aws_s3_bucket.destination", "arn"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSS3BucketAnalyticsConfiguration_WithStorageClassAnalysis_Full(t *testing.T) { + var ac s3.AnalyticsConfiguration + resourceName := "aws_s3_bucket_analytics_configuration.test" + + rInt := acctest.RandInt() + rName := fmt.Sprintf("tf-acc-test-%d", rInt) + prefix := fmt.Sprintf("prefix-%d/", rInt) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3BucketAnalyticsConfigurationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3BucketAnalyticsConfigurationWithFullStorageClassAnalysis(rName, rName, prefix), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketAnalyticsConfigurationExists(resourceName, &ac), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.#", "1"), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.0.data_export.#", "1"), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.0.data_export.0.output_schema_version", "V_1"), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.0.data_export.0.destination.#", "1"), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.0.data_export.0.destination.0.s3_bucket_destination.#", "1"), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.0.data_export.0.destination.0.s3_bucket_destination.0.format", "CSV"), + resource.TestCheckResourceAttrPair(resourceName, "storage_class_analysis.0.data_export.0.destination.0.s3_bucket_destination.0.bucket_arn", "aws_s3_bucket.destination", "arn"), + resource.TestCheckResourceAttr(resourceName, "storage_class_analysis.0.data_export.0.destination.0.s3_bucket_destination.0.prefix", prefix), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckAWSS3BucketAnalyticsConfigurationDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).s3conn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_s3_bucket_analytics_configuration" { + continue + } + + bucket, name, err := resourceAwsS3BucketAnalyticsConfigurationParseID(rs.Primary.ID) + if err != nil { + return err + } + + return waitForDeleteS3BucketAnalyticsConfiguration(conn, bucket, name, 1*time.Minute) + + } + return nil +} + +func testAccCheckAWSS3BucketAnalyticsConfigurationExists(n string, ac *s3.AnalyticsConfiguration) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + conn := testAccProvider.Meta().(*AWSClient).s3conn + output, err := conn.GetBucketAnalyticsConfiguration(&s3.GetBucketAnalyticsConfigurationInput{ + Bucket: aws.String(rs.Primary.Attributes["bucket"]), + Id: aws.String(rs.Primary.Attributes["name"]), + }) + + if err != nil { + return err + } + + if output == nil || output.AnalyticsConfiguration == nil { + return fmt.Errorf("error reading S3 Bucket Analytics Configuration %q: empty response", rs.Primary.ID) + } + + *ac = *output.AnalyticsConfiguration + + return nil + } +} + +func testAccCheckAWSS3BucketAnalyticsConfigurationRemoved(name, bucket string) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).s3conn + return waitForDeleteS3BucketAnalyticsConfiguration(conn, bucket, name, 1*time.Minute) + } +} + +func testAccAWSS3BucketAnalyticsConfiguration(name, bucket string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket_analytics_configuration" "test" { + bucket = aws_s3_bucket.test.bucket + name = "%s" +} + +resource "aws_s3_bucket" "test" { + bucket = "%s" +} +`, name, bucket) +} + +func testAccAWSS3BucketAnalyticsConfiguration_removed(bucket string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket" "test" { + bucket = "%s" +} +`, bucket) +} + +func testAccAWSS3BucketAnalyticsConfigurationUpdateBucket(name, originalBucket, updatedBucket string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket_analytics_configuration" "test" { + bucket = aws_s3_bucket.test_2.bucket + name = "%s" +} + +resource "aws_s3_bucket" "test" { + bucket = "%s" +} + +resource "aws_s3_bucket" "test_2" { + bucket = "%s" +} +`, name, originalBucket, updatedBucket) +} + +func testAccAWSS3BucketAnalyticsConfigurationWithEmptyFilter(name, bucket string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket_analytics_configuration" "test" { + bucket = aws_s3_bucket.test.bucket + name = "%s" + + filter { + } +} + +resource "aws_s3_bucket" "test" { + bucket = "%s" +} +`, name, bucket) +} + +func testAccAWSS3BucketAnalyticsConfigurationWithFilterPrefix(name, bucket, prefix string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket_analytics_configuration" "test" { + bucket = aws_s3_bucket.test.bucket + name = "%s" + + filter { + prefix = "%s" + } +} + +resource "aws_s3_bucket" "test" { + bucket = "%s" +} +`, name, prefix, bucket) +} + +func testAccAWSS3BucketAnalyticsConfigurationWithFilterSingleTag(name, bucket, tag string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket_analytics_configuration" "test" { + bucket = aws_s3_bucket.test.bucket + name = "%s" + + filter { + tags = { + "tag1" = "%s" + } + } +} + +resource "aws_s3_bucket" "test" { + bucket = "%s" +} +`, name, tag, bucket) +} + +func testAccAWSS3BucketAnalyticsConfigurationWithFilterMultipleTags(name, bucket, tag1, tag2 string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket_analytics_configuration" "test" { + bucket = aws_s3_bucket.test.bucket + name = "%s" + + filter { + tags = { + "tag1" = "%s" + "tag2" = "%s" + } + } +} + +resource "aws_s3_bucket" "test" { + bucket = "%s" +} +`, name, tag1, tag2, bucket) +} + +func testAccAWSS3BucketAnalyticsConfigurationWithFilterPrefixAndTags(name, bucket, prefix, tag1, tag2 string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket_analytics_configuration" "test" { + bucket = aws_s3_bucket.test.bucket + name = "%s" + + filter { + prefix = "%s" + + tags = { + "tag1" = "%s" + "tag2" = "%s" + } + } +} + +resource "aws_s3_bucket" "test" { + bucket = "%s" +} +`, name, prefix, tag1, tag2, bucket) +} + +func testAccAWSS3BucketAnalyticsConfigurationWithEmptyStorageClassAnalysis(name, bucket string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket_analytics_configuration" "test" { + bucket = aws_s3_bucket.test.bucket + name = "%s" + + storage_class_analysis { + } +} + +resource "aws_s3_bucket" "test" { + bucket = "%s" +} +`, name, bucket) +} + +func testAccAWSS3BucketAnalyticsConfigurationWithDefaultStorageClassAnalysis(name, bucket string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket_analytics_configuration" "test" { + bucket = aws_s3_bucket.test.bucket + name = "%s" + + storage_class_analysis { + data_export { + destination { + s3_bucket_destination { + bucket_arn = aws_s3_bucket.destination.arn + } + } + } + } +} + +resource "aws_s3_bucket" "test" { + bucket = "%[2]s" +} + +resource "aws_s3_bucket" "destination" { + bucket = "%[2]s-destination" +} +`, name, bucket) +} + +func testAccAWSS3BucketAnalyticsConfigurationWithFullStorageClassAnalysis(name, bucket, prefix string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket_analytics_configuration" "test" { + bucket = aws_s3_bucket.test.bucket + name = "%s" + + storage_class_analysis { + data_export { + output_schema_version = "V_1" + destination { + s3_bucket_destination { + format = "CSV" + bucket_arn = aws_s3_bucket.destination.arn + prefix = "%s" + } + } + } + } +} + +resource "aws_s3_bucket" "test" { + bucket = "%[3]s" +} + +resource "aws_s3_bucket" "destination" { + bucket = "%[3]s-destination" +} +`, name, prefix, bucket) +} + +func TestExpandS3AnalyticsFilter(t *testing.T) { + testCases := map[string]struct { + Input []interface{} + Expected *s3.AnalyticsFilter + }{ + "nil input": { + Input: nil, + Expected: nil, + }, + "empty input": { + Input: []interface{}{}, + Expected: nil, + }, + "prefix only": { + Input: []interface{}{ + map[string]interface{}{ + "prefix": "prefix/", + }, + }, + Expected: &s3.AnalyticsFilter{ + Prefix: aws.String("prefix/"), + }, + }, + "prefix and single tag": { + Input: []interface{}{ + map[string]interface{}{ + "prefix": "prefix/", + "tags": map[string]interface{}{ + "tag1key": "tag1value", + }, + }, + }, + Expected: &s3.AnalyticsFilter{ + And: &s3.AnalyticsAndOperator{ + Prefix: aws.String("prefix/"), + Tags: []*s3.Tag{ + { + Key: aws.String("tag1key"), + Value: aws.String("tag1value"), + }, + }, + }, + }, + }, + "prefix and multiple tags": { + Input: []interface{}{map[string]interface{}{ + "prefix": "prefix/", + "tags": map[string]interface{}{ + "tag1key": "tag1value", + "tag2key": "tag2value", + }, + }, + }, + Expected: &s3.AnalyticsFilter{ + And: &s3.AnalyticsAndOperator{ + Prefix: aws.String("prefix/"), + Tags: []*s3.Tag{ + { + Key: aws.String("tag1key"), + Value: aws.String("tag1value"), + }, + { + Key: aws.String("tag2key"), + Value: aws.String("tag2value"), + }, + }, + }, + }, + }, + "single tag only": { + Input: []interface{}{ + map[string]interface{}{ + "tags": map[string]interface{}{ + "tag1key": "tag1value", + }, + }, + }, + Expected: &s3.AnalyticsFilter{ + Tag: &s3.Tag{ + Key: aws.String("tag1key"), + Value: aws.String("tag1value"), + }, + }, + }, + "multiple tags only": { + Input: []interface{}{ + map[string]interface{}{ + "tags": map[string]interface{}{ + "tag1key": "tag1value", + "tag2key": "tag2value", + }, + }, + }, + Expected: &s3.AnalyticsFilter{ + And: &s3.AnalyticsAndOperator{ + Tags: []*s3.Tag{ + { + Key: aws.String("tag1key"), + Value: aws.String("tag1value"), + }, + { + Key: aws.String("tag2key"), + Value: aws.String("tag2value"), + }, + }, + }, + }, + }, + } + + for k, tc := range testCases { + value := expandS3AnalyticsFilter(tc.Input) + + if value == nil { + if tc.Expected == nil { + continue + } else { + t.Errorf("Case %q: Got nil\nExpected:\n%v", k, tc.Expected) + } + } + + if tc.Expected == nil { + t.Errorf("Case %q: Got: %v\nExpected: nil", k, value) + } + + // Sort tags by key for consistency + if value.And != nil && value.And.Tags != nil { + sort.Slice(value.And.Tags, func(i, j int) bool { + return *value.And.Tags[i].Key < *value.And.Tags[j].Key + }) + } + + // Convert to strings to avoid dealing with pointers + valueS := fmt.Sprintf("%v", value) + expectedValueS := fmt.Sprintf("%v", tc.Expected) + + if valueS != expectedValueS { + t.Errorf("Case %q: Given:\n%s\n\nExpected:\n%s", k, valueS, expectedValueS) + } + } +} + +func TestExpandS3StorageClassAnalysis(t *testing.T) { + testCases := map[string]struct { + Input []interface{} + Expected *s3.StorageClassAnalysis + }{ + "nil input": { + Input: nil, + Expected: &s3.StorageClassAnalysis{}, + }, + "empty input": { + Input: []interface{}{}, + Expected: &s3.StorageClassAnalysis{}, + }, + "nil array": { + Input: []interface{}{ + nil, + }, + Expected: &s3.StorageClassAnalysis{}, + }, + "empty data_export": { + Input: []interface{}{ + map[string]interface{}{ + "data_export": []interface{}{}, + }, + }, + Expected: &s3.StorageClassAnalysis{ + DataExport: &s3.StorageClassAnalysisDataExport{}, + }, + }, + "data_export complete": { + Input: []interface{}{ + map[string]interface{}{ + "data_export": []interface{}{ + map[string]interface{}{ + "output_schema_version": s3.StorageClassAnalysisSchemaVersionV1, + "destination": []interface{}{}, + }, + }, + }, + }, + Expected: &s3.StorageClassAnalysis{ + DataExport: &s3.StorageClassAnalysisDataExport{ + OutputSchemaVersion: aws.String(s3.StorageClassAnalysisSchemaVersionV1), + Destination: &s3.AnalyticsExportDestination{}, + }, + }, + }, + "empty s3_bucket_destination": { + Input: []interface{}{ + map[string]interface{}{ + "data_export": []interface{}{ + map[string]interface{}{ + "destination": []interface{}{ + map[string]interface{}{ + "s3_bucket_destination": []interface{}{}, + }, + }, + }, + }, + }, + }, + Expected: &s3.StorageClassAnalysis{ + DataExport: &s3.StorageClassAnalysisDataExport{ + Destination: &s3.AnalyticsExportDestination{ + S3BucketDestination: &s3.AnalyticsS3BucketDestination{}, + }, + }, + }, + }, + "s3_bucket_destination complete": { + Input: []interface{}{ + map[string]interface{}{ + "data_export": []interface{}{ + map[string]interface{}{ + "destination": []interface{}{ + map[string]interface{}{ + "s3_bucket_destination": []interface{}{ + map[string]interface{}{ + "bucket_arn": "arn:aws:s3", + "bucket_account_id": "1234567890", + "format": s3.AnalyticsS3ExportFileFormatCsv, + "prefix": "prefix/", + }, + }, + }, + }, + }, + }, + }, + }, + Expected: &s3.StorageClassAnalysis{ + DataExport: &s3.StorageClassAnalysisDataExport{ + Destination: &s3.AnalyticsExportDestination{ + S3BucketDestination: &s3.AnalyticsS3BucketDestination{ + Bucket: aws.String("arn:aws:s3"), + BucketAccountId: aws.String("1234567890"), + Format: aws.String(s3.AnalyticsS3ExportFileFormatCsv), + Prefix: aws.String("prefix/"), + }, + }, + }, + }, + }, + "s3_bucket_destination required": { + Input: []interface{}{ + map[string]interface{}{ + "data_export": []interface{}{ + map[string]interface{}{ + "destination": []interface{}{ + map[string]interface{}{ + "s3_bucket_destination": []interface{}{ + map[string]interface{}{ + "bucket_arn": "arn:aws:s3", + "format": s3.AnalyticsS3ExportFileFormatCsv, + }, + }, + }, + }, + }, + }, + }, + }, + Expected: &s3.StorageClassAnalysis{ + DataExport: &s3.StorageClassAnalysisDataExport{ + Destination: &s3.AnalyticsExportDestination{ + S3BucketDestination: &s3.AnalyticsS3BucketDestination{ + Bucket: aws.String("arn:aws:s3"), + BucketAccountId: nil, + Format: aws.String(s3.AnalyticsS3ExportFileFormatCsv), + Prefix: nil, + }, + }, + }, + }, + }, + } + + for k, tc := range testCases { + value := expandS3StorageClassAnalysis(tc.Input) + + if !reflect.DeepEqual(value, tc.Expected) { + t.Errorf("Case %q:\nGot:\n%v\nExpected:\n%v", k, value, tc.Expected) + } + } +} + +func TestFlattenS3AnalyticsFilter(t *testing.T) { + testCases := map[string]struct { + Input *s3.AnalyticsFilter + Expected []map[string]interface{} + }{ + "nil input": { + Input: nil, + Expected: nil, + }, + "empty input": { + Input: &s3.AnalyticsFilter{}, + Expected: nil, + }, + "prefix only": { + Input: &s3.AnalyticsFilter{ + Prefix: aws.String("prefix/"), + }, + Expected: []map[string]interface{}{ + { + "prefix": "prefix/", + }, + }, + }, + "prefix and single tag": { + Input: &s3.AnalyticsFilter{ + And: &s3.AnalyticsAndOperator{ + Prefix: aws.String("prefix/"), + Tags: []*s3.Tag{ + { + Key: aws.String("tag1key"), + Value: aws.String("tag1value"), + }, + }, + }, + }, + Expected: []map[string]interface{}{ + { + "prefix": "prefix/", + "tags": map[string]string{ + "tag1key": "tag1value", + }, + }, + }, + }, + "prefix and multiple tags": { + Input: &s3.AnalyticsFilter{ + And: &s3.AnalyticsAndOperator{ + Prefix: aws.String("prefix/"), + Tags: []*s3.Tag{ + { + Key: aws.String("tag1key"), + Value: aws.String("tag1value"), + }, + { + Key: aws.String("tag2key"), + Value: aws.String("tag2value"), + }, + }, + }, + }, + Expected: []map[string]interface{}{ + { + "prefix": "prefix/", + "tags": map[string]string{ + "tag1key": "tag1value", + "tag2key": "tag2value", + }, + }, + }, + }, + "single tag only": { + Input: &s3.AnalyticsFilter{ + Tag: &s3.Tag{ + Key: aws.String("tag1key"), + Value: aws.String("tag1value"), + }, + }, + Expected: []map[string]interface{}{ + { + "tags": map[string]string{ + "tag1key": "tag1value", + }, + }, + }, + }, + "multiple tags only": { + Input: &s3.AnalyticsFilter{ + And: &s3.AnalyticsAndOperator{ + Tags: []*s3.Tag{ + { + Key: aws.String("tag1key"), + Value: aws.String("tag1value"), + }, + { + Key: aws.String("tag2key"), + Value: aws.String("tag2value"), + }, + }, + }, + }, + Expected: []map[string]interface{}{ + { + "tags": map[string]string{ + "tag1key": "tag1value", + "tag2key": "tag2value", + }, + }, + }, + }, + } + + for k, tc := range testCases { + value := flattenS3AnalyticsFilter(tc.Input) + + if !reflect.DeepEqual(value, tc.Expected) { + t.Errorf("Case %q: Got:\n%v\n\nExpected:\n%v", k, value, tc.Expected) + } + } +} +func TestFlattenS3StorageClassAnalysis(t *testing.T) { + testCases := map[string]struct { + Input *s3.StorageClassAnalysis + Expected []map[string]interface{} + }{ + "nil value": { + Input: nil, + Expected: []map[string]interface{}{}, + }, + "empty root": { + Input: &s3.StorageClassAnalysis{}, + Expected: []map[string]interface{}{}, + }, + "empty data_export": { + Input: &s3.StorageClassAnalysis{ + DataExport: &s3.StorageClassAnalysisDataExport{}, + }, + Expected: []map[string]interface{}{ + { + "data_export": []interface{}{ + map[string]interface{}{}, + }, + }, + }, + }, + "data_export complete": { + Input: &s3.StorageClassAnalysis{ + DataExport: &s3.StorageClassAnalysisDataExport{ + OutputSchemaVersion: aws.String(s3.StorageClassAnalysisSchemaVersionV1), + Destination: &s3.AnalyticsExportDestination{}, + }, + }, + Expected: []map[string]interface{}{ + { + "data_export": []interface{}{ + map[string]interface{}{ + "output_schema_version": s3.StorageClassAnalysisSchemaVersionV1, + "destination": []interface{}{}, + }, + }, + }, + }, + }, + "s3_bucket_destination required": { + Input: &s3.StorageClassAnalysis{ + DataExport: &s3.StorageClassAnalysisDataExport{ + Destination: &s3.AnalyticsExportDestination{ + S3BucketDestination: &s3.AnalyticsS3BucketDestination{ + Bucket: aws.String("arn:aws:s3"), + Format: aws.String(s3.AnalyticsS3ExportFileFormatCsv), + }, + }, + }, + }, + Expected: []map[string]interface{}{ + { + "data_export": []interface{}{ + map[string]interface{}{ + "destination": []interface{}{ + map[string]interface{}{ + "s3_bucket_destination": []interface{}{ + map[string]interface{}{ + + "bucket_arn": "arn:aws:s3", + "format": s3.AnalyticsS3ExportFileFormatCsv, + }, + }, + }, + }, + }, + }, + }, + }, + }, + "s3_bucket_destination complete": { + Input: &s3.StorageClassAnalysis{ + DataExport: &s3.StorageClassAnalysisDataExport{ + Destination: &s3.AnalyticsExportDestination{ + S3BucketDestination: &s3.AnalyticsS3BucketDestination{ + Bucket: aws.String("arn:aws:s3"), + BucketAccountId: aws.String("1234567890"), + Format: aws.String(s3.AnalyticsS3ExportFileFormatCsv), + Prefix: aws.String("prefix/"), + }, + }, + }, + }, + Expected: []map[string]interface{}{ + { + "data_export": []interface{}{ + map[string]interface{}{ + "destination": []interface{}{ + map[string]interface{}{ + "s3_bucket_destination": []interface{}{ + map[string]interface{}{ + "bucket_arn": "arn:aws:s3", + "bucket_account_id": "1234567890", + "format": s3.AnalyticsS3ExportFileFormatCsv, + "prefix": "prefix/", + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + + for k, tc := range testCases { + value := flattenS3StorageClassAnalysis(tc.Input) + + if !reflect.DeepEqual(value, tc.Expected) { + t.Errorf("Case %q:\nGot:\n%v\nExpected:\n%v", k, value, tc.Expected) + } + } +} diff --git a/aws/resource_aws_s3_bucket_inventory.go b/aws/resource_aws_s3_bucket_inventory.go index 79f2201a30f..f503e3ff0f7 100644 --- a/aws/resource_aws_s3_bucket_inventory.go +++ b/aws/resource_aws_s3_bucket_inventory.go @@ -82,8 +82,9 @@ func resourceAwsS3BucketInventory() *schema.Resource { ValidateFunc: validateArn, }, "account_id": { - Type: schema.TypeString, - Optional: true, + Type: schema.TypeString, + Optional: true, + ValidateFunc: validateAwsAccountId, }, "prefix": { Type: schema.TypeString, @@ -172,6 +173,7 @@ func resourceAwsS3BucketInventory() *schema.Resource { s3.InventoryOptionalFieldObjectLockMode, s3.InventoryOptionalFieldObjectLockRetainUntilDate, s3.InventoryOptionalFieldObjectLockLegalHoldStatus, + s3.InventoryOptionalFieldIntelligentTieringAccessTier, }, false), }, Set: schema.HashString, diff --git a/aws/resource_aws_s3_bucket_inventory_test.go b/aws/resource_aws_s3_bucket_inventory_test.go index 0add90ae6bb..960a0e67e1d 100644 --- a/aws/resource_aws_s3_bucket_inventory_test.go +++ b/aws/resource_aws_s3_bucket_inventory_test.go @@ -44,8 +44,8 @@ func TestAccAWSS3BucketInventory_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "destination.#", "1"), resource.TestCheckResourceAttr(resourceName, "destination.0.bucket.#", "1"), - resource.TestCheckResourceAttr(resourceName, "destination.0.bucket.0.bucket_arn", "arn:aws:s3:::"+bucketName), - resource.TestCheckResourceAttrSet(resourceName, "destination.0.bucket.0.account_id"), + testAccCheckResourceAttrGlobalARNNoAccount(resourceName, "destination.0.bucket.0.bucket_arn", "s3", bucketName), + testAccCheckResourceAttrAccountID(resourceName, "destination.0.bucket.0.account_id"), resource.TestCheckResourceAttr(resourceName, "destination.0.bucket.0.format", "ORC"), resource.TestCheckResourceAttr(resourceName, "destination.0.bucket.0.prefix", "inventory"), ), @@ -191,21 +191,20 @@ func testAccCheckAWSS3BucketInventoryDestroy(s *terraform.State) error { func testAccAWSS3BucketInventoryConfigBucket(name string) string { return fmt.Sprintf(` -resource "aws_s3_bucket" "bucket" { - bucket = "%s" +resource "aws_s3_bucket" "test" { + bucket = %[1]q acl = "private" } `, name) } func testAccAWSS3BucketInventoryConfig(bucketName, inventoryName string) string { - return fmt.Sprintf(` -%s + return testAccAWSS3BucketInventoryConfigBucket(bucketName) + fmt.Sprintf(` data "aws_caller_identity" "current" {} resource "aws_s3_bucket_inventory" "test" { - bucket = "${aws_s3_bucket.bucket.id}" - name = "%s" + bucket = "${aws_s3_bucket.test.id}" + name = %[1]q included_object_versions = "All" @@ -225,21 +224,20 @@ resource "aws_s3_bucket_inventory" "test" { destination { bucket { format = "ORC" - bucket_arn = "${aws_s3_bucket.bucket.arn}" + bucket_arn = "${aws_s3_bucket.test.arn}" account_id = "${data.aws_caller_identity.current.account_id}" prefix = "inventory" } } } -`, testAccAWSS3BucketInventoryConfigBucket(bucketName), inventoryName) +`, inventoryName) } func testAccAWSS3BucketInventoryConfigEncryptWithSSES3(bucketName, inventoryName string) string { - return fmt.Sprintf(` -%s + return testAccAWSS3BucketInventoryConfigBucket(bucketName) + fmt.Sprintf(` resource "aws_s3_bucket_inventory" "test" { - bucket = "${aws_s3_bucket.bucket.id}" - name = "%s" + bucket = "${aws_s3_bucket.test.id}" + name = %[1]q included_object_versions = "Current" @@ -250,7 +248,7 @@ resource "aws_s3_bucket_inventory" "test" { destination { bucket { format = "CSV" - bucket_arn = "${aws_s3_bucket.bucket.arn}" + bucket_arn = "${aws_s3_bucket.test.arn}" encryption { sse_s3 {} @@ -258,20 +256,19 @@ resource "aws_s3_bucket_inventory" "test" { } } } -`, testAccAWSS3BucketInventoryConfigBucket(bucketName), inventoryName) +`, inventoryName) } func testAccAWSS3BucketInventoryConfigEncryptWithSSEKMS(bucketName, inventoryName string) string { - return fmt.Sprintf(` -%s -resource "aws_kms_key" "inventory" { - description = "Terraform acc test S3 inventory SSE-KMS encryption: %s" + return testAccAWSS3BucketInventoryConfigBucket(bucketName) + fmt.Sprintf(` +resource "aws_kms_key" "test" { + description = "Terraform acc test S3 inventory SSE-KMS encryption: %[1]s" deletion_window_in_days = 7 } resource "aws_s3_bucket_inventory" "test" { - bucket = "${aws_s3_bucket.bucket.id}" - name = "%s" + bucket = "${aws_s3_bucket.test.id}" + name = %[2]q included_object_versions = "Current" @@ -282,15 +279,15 @@ resource "aws_s3_bucket_inventory" "test" { destination { bucket { format = "Parquet" - bucket_arn = "${aws_s3_bucket.bucket.arn}" + bucket_arn = "${aws_s3_bucket.test.arn}" encryption { sse_kms { - key_id = "${aws_kms_key.inventory.arn}" + key_id = "${aws_kms_key.test.arn}" } } } } } -`, testAccAWSS3BucketInventoryConfigBucket(bucketName), bucketName, inventoryName) +`, bucketName, inventoryName) } diff --git a/aws/resource_aws_s3_bucket_metric.go b/aws/resource_aws_s3_bucket_metric.go index 1f6ce04cb44..b4116535ce7 100644 --- a/aws/resource_aws_s3_bucket_metric.go +++ b/aws/resource_aws_s3_bucket_metric.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/service/s3" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsS3BucketMetric() *schema.Resource { @@ -115,7 +116,7 @@ func resourceAwsS3BucketMetricDelete(d *schema.ResourceData, meta interface{}) e if isAWSErr(err, s3.ErrCodeNoSuchBucket, "") || isAWSErr(err, "NoSuchConfiguration", "The specified configuration does not exist.") { return nil } - return fmt.Errorf("Error deleting S3 metric configuration: %s", err) + return fmt.Errorf("Error deleting S3 metric configuration: %w", err) } return nil @@ -165,7 +166,7 @@ func expandS3MetricsFilter(m map[string]interface{}) *s3.MetricsFilter { var tags []*s3.Tag if v, ok := m["tags"]; ok { - tags = tagsFromMapS3(v.(map[string]interface{})) + tags = keyvaluetags.New(v).IgnoreAws().S3Tags() } metricsFilter := &s3.MetricsFilter{} @@ -195,7 +196,7 @@ func flattenS3MetricsFilter(metricsFilter *s3.MetricsFilter) map[string]interfac m["prefix"] = *and.Prefix } if and.Tags != nil { - m["tags"] = tagsToMapS3(and.Tags) + m["tags"] = keyvaluetags.S3KeyValueTags(and.Tags).IgnoreAws().Map() } } else if metricsFilter.Prefix != nil { m["prefix"] = *metricsFilter.Prefix @@ -203,7 +204,7 @@ func flattenS3MetricsFilter(metricsFilter *s3.MetricsFilter) map[string]interfac tags := []*s3.Tag{ metricsFilter.Tag, } - m["tags"] = tagsToMapS3(tags) + m["tags"] = keyvaluetags.S3KeyValueTags(tags).IgnoreAws().Map() } return m } diff --git a/aws/resource_aws_s3_bucket_notification_test.go b/aws/resource_aws_s3_bucket_notification_test.go index da96768b688..2acba0841fc 100644 --- a/aws/resource_aws_s3_bucket_notification_test.go +++ b/aws/resource_aws_s3_bucket_notification_test.go @@ -612,7 +612,7 @@ resource "aws_lambda_function" "func" { function_name = %[1]q role = "${aws_iam_role.iam_for_lambda.arn}" handler = "exports.example" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } resource "aws_s3_bucket" "bucket" { @@ -651,7 +651,7 @@ resource "aws_lambda_function" "test" { function_name = %[1]q handler = "exports.example" role = "${aws_iam_role.test.arn}" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } resource "aws_lambda_alias" "test" { diff --git a/aws/resource_aws_s3_bucket_object.go b/aws/resource_aws_s3_bucket_object.go index 4043b7c6c56..eca82d8a023 100644 --- a/aws/resource_aws_s3_bucket_object.go +++ b/aws/resource_aws_s3_bucket_object.go @@ -6,19 +6,18 @@ import ( "fmt" "io" "log" - "net/url" "os" "strings" "time" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "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" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/mitchellh/go-homedir" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsS3BucketObject() *schema.Resource { @@ -281,13 +280,9 @@ func resourceAwsS3BucketObjectPut(d *schema.ResourceData, meta interface{}) erro putInput.ServerSideEncryption = aws.String(s3.ServerSideEncryptionAwsKms) } - if v, ok := d.GetOk("tags"); ok { + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { // 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()) + putInput.Tagging = aws.String(keyvaluetags.New(v).IgnoreAws().UrlEncode()) } if v, ok := d.GetOk("website_redirect"); ok { @@ -390,8 +385,17 @@ func resourceAwsS3BucketObjectRead(d *schema.ResourceData, meta interface{}) err d.Set("storage_class", resp.StorageClass) } - if err := getTagsS3Object(s3conn, d); err != nil { - return fmt.Errorf("error getting S3 object tags (bucket: %s, key: %s): %s", bucket, key, err) + // Retry due to S3 eventual consistency + tags, err := retryOnAwsCode(s3.ErrCodeNoSuchBucket, func() (interface{}, error) { + return keyvaluetags.S3ObjectListTags(s3conn, bucket, key) + }) + + if err != nil { + return fmt.Errorf("error listing tags for S3 Bucket (%s) Object (%s): %s", bucket, key, err) + } + + if err := d.Set("tags", tags.(keyvaluetags.KeyValueTags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -422,10 +426,13 @@ func resourceAwsS3BucketObjectUpdate(d *schema.ResourceData, meta interface{}) e conn := meta.(*AWSClient).s3conn + bucket := d.Get("bucket").(string) + key := d.Get("key").(string) + if d.HasChange("acl") { _, err := conn.PutObjectAcl(&s3.PutObjectAclInput{ - Bucket: aws.String(d.Get("bucket").(string)), - Key: aws.String(d.Get("key").(string)), + Bucket: aws.String(bucket), + Key: aws.String(key), ACL: aws.String(d.Get("acl").(string)), }) if err != nil { @@ -435,8 +442,8 @@ func resourceAwsS3BucketObjectUpdate(d *schema.ResourceData, meta interface{}) e if d.HasChange("object_lock_legal_hold_status") { _, err := conn.PutObjectLegalHold(&s3.PutObjectLegalHoldInput{ - Bucket: aws.String(d.Get("bucket").(string)), - Key: aws.String(d.Get("key").(string)), + Bucket: aws.String(bucket), + Key: aws.String(key), LegalHold: &s3.ObjectLockLegalHold{ Status: aws.String(d.Get("object_lock_legal_hold_status").(string)), }, @@ -448,8 +455,8 @@ func resourceAwsS3BucketObjectUpdate(d *schema.ResourceData, meta interface{}) e if d.HasChange("object_lock_mode") || d.HasChange("object_lock_retain_until_date") { req := &s3.PutObjectRetentionInput{ - Bucket: aws.String(d.Get("bucket").(string)), - Key: aws.String(d.Get("key").(string)), + Bucket: aws.String(bucket), + Key: aws.String(key), Retention: &s3.ObjectLockRetention{ Mode: aws.String(d.Get("object_lock_mode").(string)), RetainUntilDate: expandS3ObjectLockRetainUntilDate(d.Get("object_lock_retain_until_date").(string)), @@ -472,8 +479,12 @@ func resourceAwsS3BucketObjectUpdate(d *schema.ResourceData, meta interface{}) e } } - if err := setTagsS3Object(conn, d); err != nil { - return fmt.Errorf("error setting S3 object tags: %s", err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.S3ObjectUpdateTags(conn, bucket, key, o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } } return resourceAwsS3BucketObjectRead(d, meta) diff --git a/aws/resource_aws_s3_bucket_object_test.go b/aws/resource_aws_s3_bucket_object_test.go index 47bb7f9f749..097f17d2eba 100644 --- a/aws/resource_aws_s3_bucket_object_test.go +++ b/aws/resource_aws_s3_bucket_object_test.go @@ -409,6 +409,44 @@ func TestAccAWSS3BucketObject_updatesWithVersioning(t *testing.T) { }) } +func TestAccAWSS3BucketObject_updatesWithVersioningViaAccessPoint(t *testing.T) { + var originalObj, modifiedObj s3.GetObjectOutput + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_s3_bucket_object.test" + accessPointResourceName := "aws_s3_access_point.test" + + sourceInitial := testAccAWSS3BucketObjectCreateTempFile(t, "initial versioned object state") + defer os.Remove(sourceInitial) + sourceModified := testAccAWSS3BucketObjectCreateTempFile(t, "modified versioned object") + defer os.Remove(sourceInitial) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3BucketObjectDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3BucketObjectConfig_updateableViaAccessPoint(rName, true, sourceInitial), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketObjectExists(resourceName, &originalObj), + testAccCheckAWSS3BucketObjectBody(&originalObj, "initial versioned object state"), + resource.TestCheckResourceAttrPair(resourceName, "bucket", accessPointResourceName, "arn"), + resource.TestCheckResourceAttr(resourceName, "etag", "cee4407fa91906284e2a5e5e03e86b1b"), + ), + }, + { + Config: testAccAWSS3BucketObjectConfig_updateableViaAccessPoint(rName, true, sourceModified), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketObjectExists(resourceName, &modifiedObj), + testAccCheckAWSS3BucketObjectBody(&modifiedObj, "modified versioned object"), + resource.TestCheckResourceAttr(resourceName, "etag", "00b8c73b1b50e7cc932362c7225b8e29"), + testAccCheckAWSS3BucketObjectVersionIdDiffers(&modifiedObj, &originalObj), + ), + }, + }, + }) +} + func TestAccAWSS3BucketObject_kms(t *testing.T) { var obj s3.GetObjectOutput resourceName := "aws_s3_bucket_object.object" @@ -630,9 +668,9 @@ func TestAccAWSS3BucketObject_tags(t *testing.T) { testAccCheckAWSS3BucketObjectBody(&obj2, "stuff"), resource.TestCheckResourceAttr(resourceName, "tags.%", "4"), resource.TestCheckResourceAttr(resourceName, "tags.Key2", "BBB"), - resource.TestCheckResourceAttr(resourceName, "tags.Key3", "XXX"), + resource.TestCheckResourceAttr(resourceName, "tags.Key3", "X X"), resource.TestCheckResourceAttr(resourceName, "tags.Key4", "DDD"), - resource.TestCheckResourceAttr(resourceName, "tags.Key5", "EEE"), + resource.TestCheckResourceAttr(resourceName, "tags.Key5", "E:/"), ), }, { @@ -694,9 +732,9 @@ func TestAccAWSS3BucketObject_tagsLeadingSlash(t *testing.T) { testAccCheckAWSS3BucketObjectBody(&obj2, "stuff"), resource.TestCheckResourceAttr(resourceName, "tags.%", "4"), resource.TestCheckResourceAttr(resourceName, "tags.Key2", "BBB"), - resource.TestCheckResourceAttr(resourceName, "tags.Key3", "XXX"), + resource.TestCheckResourceAttr(resourceName, "tags.Key3", "X X"), resource.TestCheckResourceAttr(resourceName, "tags.Key4", "DDD"), - resource.TestCheckResourceAttr(resourceName, "tags.Key5", "EEE"), + resource.TestCheckResourceAttr(resourceName, "tags.Key5", "E:/"), ), }, { @@ -1234,6 +1272,30 @@ resource "aws_s3_bucket_object" "object" { `, randInt, bucketVersioning, source, source) } +func testAccAWSS3BucketObjectConfig_updateableViaAccessPoint(rName string, bucketVersioning bool, source string) string { + return fmt.Sprintf(` +resource "aws_s3_bucket" "test" { + bucket = %[1]q + + versioning { + enabled = %[2]t + } +} + +resource "aws_s3_access_point" "test" { + bucket = "${aws_s3_bucket.test.bucket}" + name = %[1]q +} + +resource "aws_s3_bucket_object" "test" { + bucket = "${aws_s3_access_point.test.arn}" + key = "updateable-key" + source = %[3]q + etag = "${filemd5(%[3]q)}" +} +`, rName, bucketVersioning, source) +} + func testAccAWSS3BucketObjectConfig_withKMSId(randInt int, source string) string { return fmt.Sprintf(` resource "aws_kms_key" "kms_key_1" {} @@ -1341,9 +1403,9 @@ resource "aws_s3_bucket_object" "object" { tags = { Key2 = "BBB" - Key3 = "XXX" + Key3 = "X X" Key4 = "DDD" - Key5 = "EEE" + Key5 = "E:/" } } `, randInt, key, content) diff --git a/aws/resource_aws_s3_bucket_public_access_block.go b/aws/resource_aws_s3_bucket_public_access_block.go index 87f4e60aaf2..4a5e33842f8 100644 --- a/aws/resource_aws_s3_bucket_public_access_block.go +++ b/aws/resource_aws_s3_bucket_public_access_block.go @@ -128,6 +128,11 @@ func resourceAwsS3BucketPublicAccessBlockRead(d *schema.ResourceData, meta inter d.SetId("") return nil } + if isAWSErr(err, s3.ErrCodeNoSuchBucket, "") { + log.Printf("[WARN] S3 Bucket (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } if err != nil { return fmt.Errorf("error reading S3 bucket Public Access Block: %s", err) @@ -161,6 +166,16 @@ func resourceAwsS3BucketPublicAccessBlockUpdate(d *schema.ResourceData, meta int log.Printf("[DEBUG] Updating S3 bucket Public Access Block: %s", input) _, err := s3conn.PutPublicAccessBlock(input) + if isAWSErr(err, s3control.ErrCodeNoSuchPublicAccessBlockConfiguration, "") { + log.Printf("[WARN] S3 Bucket Public Access Block (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + if isAWSErr(err, s3.ErrCodeNoSuchBucket, "") { + log.Printf("[WARN] S3 Bucket (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } if err != nil { return fmt.Errorf("error updating S3 Bucket Public Access Block (%s): %s", d.Id(), err) } @@ -191,6 +206,9 @@ func resourceAwsS3BucketPublicAccessBlockDelete(d *schema.ResourceData, meta int if isAWSErr(err, s3control.ErrCodeNoSuchPublicAccessBlockConfiguration, "") { return nil } + if isAWSErr(err, s3.ErrCodeNoSuchBucket, "") { + return nil + } if err != nil { return fmt.Errorf("error deleting S3 Bucket Public Access Block (%s): %s", d.Id(), err) diff --git a/aws/resource_aws_s3_bucket_public_access_block_test.go b/aws/resource_aws_s3_bucket_public_access_block_test.go index 40828c0db40..6387a3a1f13 100644 --- a/aws/resource_aws_s3_bucket_public_access_block_test.go +++ b/aws/resource_aws_s3_bucket_public_access_block_test.go @@ -67,6 +67,29 @@ func TestAccAWSS3BucketPublicAccessBlock_disappears(t *testing.T) { }) } +func TestAccAWSS3BucketPublicAccessBlock_bucketDisappears(t *testing.T) { + var config s3.PublicAccessBlockConfiguration + name := fmt.Sprintf("tf-test-bucket-%d", acctest.RandInt()) + resourceName := "aws_s3_bucket_public_access_block.bucket" + bucketResourceName := "aws_s3_bucket.bucket" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSS3BucketDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSS3BucketPublicAccessBlockConfig(name, "false", "false", "false", "false"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSS3BucketPublicAccessBlockExists(resourceName, &config), + testAccCheckAWSS3DestroyBucket(bucketResourceName), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func TestAccAWSS3BucketPublicAccessBlock_BlockPublicAcls(t *testing.T) { var config1, config2, config3 s3.PublicAccessBlockConfiguration name := fmt.Sprintf("tf-test-bucket-%d", acctest.RandInt()) diff --git a/aws/resource_aws_s3_bucket_test.go b/aws/resource_aws_s3_bucket_test.go index 3393d43bef4..93ce7f273f0 100644 --- a/aws/resource_aws_s3_bucket_test.go +++ b/aws/resource_aws_s3_bucket_test.go @@ -27,6 +27,7 @@ func init() { Name: "aws_s3_bucket", F: testSweepS3Buckets, Dependencies: []string{ + "aws_s3_access_point", "aws_s3_bucket_object", }, }) @@ -57,20 +58,25 @@ func testSweepS3Buckets(region string) error { return nil } + defaultNameRegexp := regexp.MustCompile(`^terraform-\d+$`) for _, bucket := range output.Buckets { name := aws.StringValue(bucket.Name) - hasPrefix := false - prefixes := []string{"mybucket.", "mylogs.", "tf-acc", "tf-object-test", "tf-test", "tf-emr-bootstrap"} + sweepable := false + prefixes := []string{"mybucket.", "mylogs.", "tf-acc", "tf-object-test", "tf-test", "tf-emr-bootstrap", "terraform-remote-s3-test"} for _, prefix := range prefixes { if strings.HasPrefix(name, prefix) { - hasPrefix = true + sweepable = true break } } - if !hasPrefix { + if defaultNameRegexp.MatchString(name) { + sweepable = true + } + + if !sweepable { log.Printf("[INFO] Skipping S3 Bucket: %s", name) continue } @@ -482,7 +488,7 @@ func TestAccAWSS3Bucket_acceleration(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) - testAccHasServicePreCheck("cloudfront", t) + testAccPartitionHasServicePreCheck("cloudfront", t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSS3BucketDestroy, diff --git a/aws/resource_aws_sagemaker_endpoint.go b/aws/resource_aws_sagemaker_endpoint.go index 422845dfcb5..b48c215a47b 100644 --- a/aws/resource_aws_sagemaker_endpoint.go +++ b/aws/resource_aws_sagemaker_endpoint.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsSagemakerEndpoint() *schema.Resource { @@ -61,7 +62,7 @@ func resourceAwsSagemakerEndpointCreate(d *schema.ResourceData, meta interface{} } if v, ok := d.GetOk("tags"); ok { - createOpts.Tags = tagsFromMapSagemaker(v.(map[string]interface{})) + createOpts.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().SagemakerTags() } log.Printf("[DEBUG] SageMaker Endpoint create config: %#v", *createOpts) @@ -116,15 +117,13 @@ func resourceAwsSagemakerEndpointRead(d *schema.ResourceData, meta interface{}) return err } - tagsOutput, err := conn.ListTags(&sagemaker.ListTagsInput{ - ResourceArn: endpoint.EndpointArn, - }) + tags, err := keyvaluetags.SagemakerListTags(conn, aws.StringValue(endpoint.EndpointArn)) if err != nil { - return fmt.Errorf("error listing tags for SageMaker Endpoint (%s): %s", d.Id(), err) + return fmt.Errorf("error listing tags for Sagemaker Endpoint (%s): %s", d.Id(), err) } - if err := d.Set("tags", tagsToMapSagemaker(tagsOutput.Tags)); err != nil { - return err + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil @@ -135,8 +134,12 @@ func resourceAwsSagemakerEndpointUpdate(d *schema.ResourceData, meta interface{} d.Partial(true) - if err := setSagemakerTags(conn, d); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.SagemakerUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating Sagemaker Endpoint (%s) tags: %s", d.Id(), err) + } } d.SetPartial("tags") diff --git a/aws/resource_aws_sagemaker_endpoint_configuration.go b/aws/resource_aws_sagemaker_endpoint_configuration.go index 841674eed7e..0d5b6668248 100644 --- a/aws/resource_aws_sagemaker_endpoint_configuration.go +++ b/aws/resource_aws_sagemaker_endpoint_configuration.go @@ -4,12 +4,12 @@ import ( "fmt" "log" - "github.com/hashicorp/terraform-plugin-sdk/helper/validation" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsSagemakerEndpointConfiguration() *schema.Resource { @@ -71,7 +71,7 @@ func resourceAwsSagemakerEndpointConfiguration() *schema.Resource { Type: schema.TypeFloat, Optional: true, ForceNew: true, - ValidateFunc: FloatAtLeast(0), + ValidateFunc: validation.FloatAtLeast(0), Default: 1, }, @@ -116,7 +116,7 @@ func resourceAwsSagemakerEndpointConfigurationCreate(d *schema.ResourceData, met } if v, ok := d.GetOk("tags"); ok { - createOpts.Tags = tagsFromMapSagemaker(v.(map[string]interface{})) + createOpts.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().SagemakerTags() } log.Printf("[DEBUG] SageMaker Endpoint Configuration create config: %#v", *createOpts) @@ -159,23 +159,27 @@ func resourceAwsSagemakerEndpointConfigurationRead(d *schema.ResourceData, meta return err } - tagsOutput, err := conn.ListTags(&sagemaker.ListTagsInput{ - ResourceArn: endpointConfig.EndpointConfigArn, - }) + tags, err := keyvaluetags.SagemakerListTags(conn, aws.StringValue(endpointConfig.EndpointConfigArn)) if err != nil { - return fmt.Errorf("error listing tags of SageMaker Endpoint Configuration %s: %s", d.Id(), err) + return fmt.Errorf("error listing tags for Sagemaker Endpoint Configuration (%s): %s", d.Id(), err) } - if err := d.Set("tags", tagsToMapSagemaker(tagsOutput.Tags)); err != nil { - return err + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } + return nil } func resourceAwsSagemakerEndpointConfigurationUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).sagemakerconn - if err := setSagemakerTags(conn, d); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.SagemakerUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating Sagemaker Endpoint Configuration (%s) tags: %s", d.Id(), err) + } } return resourceAwsSagemakerEndpointConfigurationRead(d, meta) } diff --git a/aws/resource_aws_sagemaker_model.go b/aws/resource_aws_sagemaker_model.go index 8e40ae18903..ba977fa3aa2 100644 --- a/aws/resource_aws_sagemaker_model.go +++ b/aws/resource_aws_sagemaker_model.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsSagemakerModel() *schema.Resource { @@ -164,30 +165,27 @@ func resourceAwsSagemakerModelCreate(d *schema.ResourceData, meta interface{}) e } if v, ok := d.GetOk("primary_container"); ok { - m := v.([]interface{})[0].(map[string]interface{}) - createOpts.PrimaryContainer = expandContainer(m) + createOpts.PrimaryContainer = expandContainer(v.([]interface{})[0].(map[string]interface{})) } if v, ok := d.GetOk("container"); ok { - containers := expandContainers(v.([]interface{})) - createOpts.SetContainers(containers) + createOpts.Containers = expandContainers(v.([]interface{})) } if v, ok := d.GetOk("execution_role_arn"); ok { - createOpts.SetExecutionRoleArn(v.(string)) + createOpts.ExecutionRoleArn = aws.String(v.(string)) } if v, ok := d.GetOk("tags"); ok { - createOpts.SetTags(tagsFromMapSagemaker(v.(map[string]interface{}))) + createOpts.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().SagemakerTags() } if v, ok := d.GetOk("vpc_config"); ok { - vpcConfig := expandSageMakerVpcConfigRequest(v.([]interface{})) - createOpts.SetVpcConfig(vpcConfig) + createOpts.VpcConfig = expandSageMakerVpcConfigRequest(v.([]interface{})) } if v, ok := d.GetOk("enable_network_isolation"); ok { - createOpts.SetEnableNetworkIsolation(v.(bool)) + createOpts.EnableNetworkIsolation = aws.Bool(v.(bool)) } log.Printf("[DEBUG] Sagemaker model create config: %#v", *createOpts) @@ -255,16 +253,15 @@ func resourceAwsSagemakerModelRead(d *schema.ResourceData, meta interface{}) err return fmt.Errorf("error setting vpc_config: %s", err) } - tagsOutput, err := conn.ListTags(&sagemaker.ListTagsInput{ - ResourceArn: model.ModelArn, - }) + tags, err := keyvaluetags.SagemakerListTags(conn, aws.StringValue(model.ModelArn)) if err != nil { - return fmt.Errorf("error listing tags of Sagemaker model %s: %s", d.Id(), err) + return fmt.Errorf("error listing tags for Sagemaker Model (%s): %s", d.Id(), err) } - if err := d.Set("tags", tagsToMapSagemaker(tagsOutput.Tags)); err != nil { - return err + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } + return nil } @@ -286,10 +283,12 @@ func resourceAwsSagemakerModelUpdate(d *schema.ResourceData, meta interface{}) e d.Partial(true) - if err := setSagemakerTags(conn, d); err != nil { - return err - } else { - d.SetPartial("tags") + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.SagemakerUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating Sagemaker Model (%s) tags: %s", d.Id(), err) + } } d.Partial(false) diff --git a/aws/resource_aws_sagemaker_notebook_instance.go b/aws/resource_aws_sagemaker_notebook_instance.go index 603bb8f5483..5ce1d792a64 100644 --- a/aws/resource_aws_sagemaker_notebook_instance.go +++ b/aws/resource_aws_sagemaker_notebook_instance.go @@ -9,6 +9,8 @@ import ( "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsSagemakerNotebookInstance() *schema.Resource { @@ -72,6 +74,17 @@ func resourceAwsSagemakerNotebookInstance() *schema.Resource { ForceNew: true, }, + "direct_internet_access": { + Type: schema.TypeString, + Optional: true, + ForceNew: true, + Default: sagemaker.DirectInternetAccessEnabled, + ValidateFunc: validation.StringInSlice([]string{ + sagemaker.DirectInternetAccessDisabled, + sagemaker.DirectInternetAccessEnabled, + }, false), + }, + "tags": tagsSchema(), }, } @@ -89,6 +102,10 @@ func resourceAwsSagemakerNotebookInstanceCreate(d *schema.ResourceData, meta int InstanceType: aws.String(d.Get("instance_type").(string)), } + if v, ok := d.GetOk("direct_internet_access"); ok { + createOpts.DirectInternetAccess = aws.String(v.(string)) + } + if s, ok := d.GetOk("subnet_id"); ok { createOpts.SubnetId = aws.String(s.(string)) } @@ -102,8 +119,7 @@ func resourceAwsSagemakerNotebookInstanceCreate(d *schema.ResourceData, meta int } if v, ok := d.GetOk("tags"); ok { - tagsIn := v.(map[string]interface{}) - createOpts.Tags = tagsFromMapSagemaker(tagsIn) + createOpts.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().SagemakerTags() } log.Printf("[DEBUG] sagemaker notebook instance create config: %#v", *createOpts) @@ -177,16 +193,21 @@ func resourceAwsSagemakerNotebookInstanceRead(d *schema.ResourceData, meta inter if err := d.Set("arn", notebookInstance.NotebookInstanceArn); err != nil { return fmt.Errorf("error setting arn for sagemaker notebook instance (%s): %s", d.Id(), err) } - tagsOutput, err := conn.ListTags(&sagemaker.ListTagsInput{ - ResourceArn: notebookInstance.NotebookInstanceArn, - }) + + if err := d.Set("direct_internet_access", notebookInstance.DirectInternetAccess); err != nil { + return fmt.Errorf("error setting direct_internet_access for sagemaker notebook instance (%s): %s", d.Id(), err) + } + + tags, err := keyvaluetags.SagemakerListTags(conn, aws.StringValue(notebookInstance.NotebookInstanceArn)) + if err != nil { - return fmt.Errorf("error listing tags for sagemaker notebook instance (%s): %s", d.Id(), err) + return fmt.Errorf("error listing tags for Sagemaker Notebook Instance (%s): %s", d.Id(), err) } - if err := d.Set("tags", tagsToMapSagemaker(tagsOutput.Tags)); err != nil { - return fmt.Errorf("error setting tags for notebook instance (%s): %s", d.Id(), err) + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } + return nil } @@ -195,8 +216,12 @@ func resourceAwsSagemakerNotebookInstanceUpdate(d *schema.ResourceData, meta int d.Partial(true) - if err := setSagemakerTags(conn, d); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.SagemakerUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating Sagemaker Notebook Instance (%s) tags: %s", d.Id(), err) + } } d.SetPartial("tags") diff --git a/aws/resource_aws_sagemaker_notebook_instance_lifecycle_configuration_test.go b/aws/resource_aws_sagemaker_notebook_instance_lifecycle_configuration_test.go index eb1f2d91b88..c278a27935a 100644 --- a/aws/resource_aws_sagemaker_notebook_instance_lifecycle_configuration_test.go +++ b/aws/resource_aws_sagemaker_notebook_instance_lifecycle_configuration_test.go @@ -21,6 +21,9 @@ func init() { resource.AddTestSweepers("aws_sagemaker_notebook_instance_lifecycle_configuration", &resource.Sweeper{ Name: "aws_sagemaker_notebook_instance_lifecycle_configuration", F: testSweepSagemakerNotebookInstanceLifecycleConfiguration, + Dependencies: []string{ + "aws_sagemaker_notebook_instance", + }, }) } diff --git a/aws/resource_aws_sagemaker_notebook_instance_test.go b/aws/resource_aws_sagemaker_notebook_instance_test.go index 445d1026e74..cb27c879065 100644 --- a/aws/resource_aws_sagemaker_notebook_instance_test.go +++ b/aws/resource_aws_sagemaker_notebook_instance_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "log" "testing" "time" @@ -9,10 +10,75 @@ import ( "github.com/aws/aws-sdk-go/service/sagemaker" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) const sagemakerTestAccSagemakerNotebookInstanceResourceNamePrefix = "terraform-testacc-" +func init() { + resource.AddTestSweepers("aws_sagemaker_notebook_instance", &resource.Sweeper{ + Name: "aws_sagemaker_notebook_instance", + F: testSweepSagemakerNotebookInstances, + }) +} + +func testSweepSagemakerNotebookInstances(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + conn := client.(*AWSClient).sagemakerconn + + err = conn.ListNotebookInstancesPages(&sagemaker.ListNotebookInstancesInput{}, func(page *sagemaker.ListNotebookInstancesOutput, lastPage bool) bool { + for _, instance := range page.NotebookInstances { + name := aws.StringValue(instance.NotebookInstanceName) + status := aws.StringValue(instance.NotebookInstanceStatus) + + input := &sagemaker.DeleteNotebookInstanceInput{ + NotebookInstanceName: instance.NotebookInstanceName, + } + + log.Printf("[INFO] Stopping SageMaker Notebook Instance: %s", name) + if status != sagemaker.NotebookInstanceStatusFailed && status != sagemaker.NotebookInstanceStatusStopped { + if err := stopSagemakerNotebookInstance(conn, name); err != nil { + log.Printf("[ERROR] Error stopping SageMaker Notebook Instance (%s): %s", name, err) + continue + } + } + + log.Printf("[INFO] Deleting SageMaker Notebook Instance: %s", name) + if _, err := conn.DeleteNotebookInstance(input); err != nil { + log.Printf("[ERROR] Error deleting SageMaker Notebook Instance (%s): %s", name, err) + continue + } + + stateConf := &resource.StateChangeConf{ + Pending: []string{sagemaker.NotebookInstanceStatusDeleting}, + Target: []string{""}, + Refresh: sagemakerNotebookInstanceStateRefreshFunc(conn, name), + Timeout: 10 * time.Minute, + } + + if _, err := stateConf.WaitForState(); err != nil { + log.Printf("[ERROR] Error waiting for SageMaker Notebook Instance (%s) deletion: %s", name, err) + } + } + + return !lastPage + }) + + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping SageMaker Notebook Instance sweep for %s: %s", region, err) + return nil + } + + if err != nil { + return fmt.Errorf("Error retrieving SageMaker Notebook Instances: %s", err) + } + + return nil +} + func TestAccAWSSagemakerNotebookInstance_basic(t *testing.T) { var notebook sagemaker.DescribeNotebookInstanceOutput notebookName := resource.PrefixedUniqueId(sagemakerTestAccSagemakerNotebookInstanceResourceNamePrefix) @@ -259,18 +325,59 @@ func testAccCheckAWSSagemakerNotebookInstanceName(notebook *sagemaker.DescribeNo } } +func TestAccAWSSagemakerNotebookInstance_direct_internet_access(t *testing.T) { + var notebook sagemaker.DescribeNotebookInstanceOutput + notebookName := resource.PrefixedUniqueId(sagemakerTestAccSagemakerNotebookInstanceResourceNamePrefix) + var resourceName = "aws_sagemaker_notebook_instance.foo" + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSagemakerNotebookInstanceDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSagemakerNotebookInstanceConfigDirectInternetAccess(notebookName, "Disabled"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSagemakerNotebookInstanceExists(resourceName, ¬ebook), + testAccCheckAWSSagemakerNotebookDirectInternetAccess(¬ebook, "Disabled"), + ), + }, + { + Config: testAccAWSSagemakerNotebookInstanceConfigDirectInternetAccess(notebookName, "Enabled"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSagemakerNotebookInstanceExists(resourceName, ¬ebook), + testAccCheckAWSSagemakerNotebookDirectInternetAccess(¬ebook, "Enabled"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckAWSSagemakerNotebookDirectInternetAccess(notebook *sagemaker.DescribeNotebookInstanceOutput, expected string) resource.TestCheckFunc { + return func(s *terraform.State) error { + directInternetAccess := notebook.DirectInternetAccess + if *directInternetAccess != expected { + return fmt.Errorf("direct_internet_access setting is incorrect: %s", *notebook.DirectInternetAccess) + } + + return nil + } +} + func testAccCheckAWSSagemakerNotebookInstanceTags(notebook *sagemaker.DescribeNotebookInstanceOutput, key string, value string) resource.TestCheckFunc { return func(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).sagemakerconn - ts, err := conn.ListTags(&sagemaker.ListTagsInput{ - ResourceArn: notebook.NotebookInstanceArn, - }) + tags, err := keyvaluetags.SagemakerListTags(conn, aws.StringValue(notebook.NotebookInstanceArn)) if err != nil { - return fmt.Errorf("Error listing tags: %s", err) + return err } - m := tagsToMapSagemaker(ts.Tags) + m := tags.IgnoreAws().Map() v, ok := m[key] if value != "" && !ok { return fmt.Errorf("Missing tag: %s", key) @@ -436,3 +543,53 @@ data "aws_iam_policy_document" "assume_role" { } `, notebookName, notebookName) } + +func testAccAWSSagemakerNotebookInstanceConfigDirectInternetAccess(notebookName string, directInternetAccess string) string { + return fmt.Sprintf(` +resource "aws_sagemaker_notebook_instance" "foo" { + name = %[1]q + role_arn = "${aws_iam_role.foo.arn}" + instance_type = "ml.t2.medium" + security_groups = ["${aws_security_group.test.id}"] + subnet_id = "${aws_subnet.sagemaker.id}" + direct_internet_access = %[2]q +} + +resource "aws_iam_role" "foo" { + name = %[1]q + path = "/" + assume_role_policy = "${data.aws_iam_policy_document.assume_role.json}" +} + +data "aws_iam_policy_document" "assume_role" { + statement { + actions = [ "sts:AssumeRole" ] + principals { + type = "Service" + identifiers = [ "sagemaker.amazonaws.com" ] + } + } +} + +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + + tags = { + Name = "tf-acc-test-sagemaker-notebook-instance-direct-internet-access" + } +} + +resource "aws_security_group" "test" { + vpc_id = "${aws_vpc.test.id}" +} + +resource "aws_subnet" "sagemaker" { + vpc_id = "${aws_vpc.test.id}" + cidr_block = "10.0.0.0/24" + + tags = { + Name = "tf-acc-test-sagemaker-notebook-instance-direct-internet-access" + } +} +`, notebookName, directInternetAccess) +} diff --git a/aws/resource_aws_secretsmanager_secret.go b/aws/resource_aws_secretsmanager_secret.go index d6ce9b179cd..7395059f16e 100644 --- a/aws/resource_aws_secretsmanager_secret.go +++ b/aws/resource_aws_secretsmanager_secret.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/structure" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsSecretsManagerSecret() *schema.Resource { @@ -118,8 +119,7 @@ func resourceAwsSecretsManagerSecretCreate(d *schema.ResourceData, meta interfac } if v, ok := d.GetOk("tags"); ok { - input.Tags = tagsFromMapSecretsManager(v.(map[string]interface{})) - log.Printf("[DEBUG] Tagging Secrets Manager Secret: %s", input.Tags) + input.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().SecretsmanagerTags() } if v, ok := d.GetOk("kms_key_id"); ok && v.(string) != "" { @@ -248,7 +248,7 @@ func resourceAwsSecretsManagerSecretRead(d *schema.ResourceData, meta interface{ d.Set("rotation_rules", []interface{}{}) } - if err := d.Set("tags", tagsToMapSecretsManager(output.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.SecretsmanagerKeyValueTags(output.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -344,35 +344,9 @@ func resourceAwsSecretsManagerSecretUpdate(d *schema.ResourceData, meta interfac } if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsSecretsManager(tagsFromMapSecretsManager(o), tagsFromMapSecretsManager(n)) - - if len(remove) > 0 { - log.Printf("[DEBUG] Removing Secrets Manager Secret %q tags: %#v", d.Id(), remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.UntagResource(&secretsmanager.UntagResourceInput{ - SecretId: aws.String(d.Id()), - TagKeys: k, - }) - if err != nil { - return fmt.Errorf("error updating Secrets Manager Secrets %q tags: %s", d.Id(), err) - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating Secrets Manager Secret %q tags: %#v", d.Id(), create) - _, err := conn.TagResource(&secretsmanager.TagResourceInput{ - SecretId: aws.String(d.Id()), - Tags: create, - }) - if err != nil { - return fmt.Errorf("error updating Secrets Manager Secrets %q tags: %s", d.Id(), err) - } + o, n := d.GetChange("tags") + if err := keyvaluetags.SecretsmanagerUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) } } diff --git a/aws/resource_aws_secretsmanager_secret_test.go b/aws/resource_aws_secretsmanager_secret_test.go index 9401dd0ce06..ceab0123095 100644 --- a/aws/resource_aws_secretsmanager_secret_test.go +++ b/aws/resource_aws_secretsmanager_secret_test.go @@ -594,7 +594,7 @@ resource "aws_lambda_function" "test1" { function_name = "%[1]s-1" handler = "exports.example" role = "${aws_iam_role.iam_for_lambda.arn}" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } resource "aws_lambda_permission" "test1" { @@ -610,7 +610,7 @@ resource "aws_lambda_function" "test2" { function_name = "%[1]s-2" handler = "exports.example" role = "${aws_iam_role.iam_for_lambda.arn}" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } resource "aws_lambda_permission" "test2" { @@ -637,7 +637,7 @@ resource "aws_lambda_function" "test" { function_name = "%[1]s" handler = "exports.example" role = "${aws_iam_role.iam_for_lambda.arn}" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } resource "aws_lambda_permission" "test" { diff --git a/aws/resource_aws_security_group.go b/aws/resource_aws_security_group.go index d3519d65161..fac3db4540a 100644 --- a/aws/resource_aws_security_group.go +++ b/aws/resource_aws_security_group.go @@ -17,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/naming" ) func resourceAwsSecurityGroup() *schema.Resource { @@ -244,14 +245,7 @@ func resourceAwsSecurityGroupCreate(d *schema.ResourceData, meta interface{}) er 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() - } + groupName := naming.Generate(d.Get("name").(string), d.Get("name_prefix").(string)) securityGroupOpts.GroupName = aws.String(groupName) var err error diff --git a/aws/resource_aws_security_group_rule.go b/aws/resource_aws_security_group_rule.go index b9d4cdf73e6..fc3cb06c5c9 100644 --- a/aws/resource_aws_security_group_rule.go +++ b/aws/resource_aws_security_group_rule.go @@ -759,9 +759,9 @@ func setFromIPPerm(d *schema.ResourceData, sg *ec2.SecurityGroup, rule *ec2.IpPe s := rule.UserIdGroupPairs[0] if isVPC { - d.Set("source_security_group_id", *s.GroupId) + d.Set("source_security_group_id", s.GroupId) } else { - d.Set("source_security_group_id", *s.GroupName) + d.Set("source_security_group_id", s.GroupName) } } diff --git a/aws/resource_aws_security_group_test.go b/aws/resource_aws_security_group_test.go index 40d0a576f71..2ac6e59a179 100644 --- a/aws/resource_aws_security_group_test.go +++ b/aws/resource_aws_security_group_test.go @@ -7,7 +7,6 @@ import ( "reflect" "regexp" "strconv" - "strings" "testing" "time" @@ -18,6 +17,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/naming" ) // add sweeper to delete known test sgs @@ -574,15 +574,9 @@ func TestResourceAwsSecurityGroupIPPermGather(t *testing.T) { } } -func TestAccAWSSecurityGroup_importBasic(t *testing.T) { - checkFn := func(s []*terraform.InstanceState) error { - // Expect 2: group, 2 rules - if len(s) != 2 { - return fmt.Errorf("expected 2 states: %#v", s) - } - - return nil - } +func TestAccAWSSecurityGroup_allowAll(t *testing.T) { + var group ec2.SecurityGroup + resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -590,59 +584,38 @@ func TestAccAWSSecurityGroup_importBasic(t *testing.T) { CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSecurityGroupConfig, + Config: testAccAWSSecurityGroupConfig_allowAll, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSecurityGroupExists(resourceName, &group), + ), }, - { - ResourceName: "aws_security_group.web", + ResourceName: resourceName, ImportState: true, - ImportStateCheck: checkFn, + ImportStateVerify: true, ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, }, }, }) } -func TestAccAWSSecurityGroup_importIpv6(t *testing.T) { - checkFn := func(s []*terraform.InstanceState) error { - // Expect 3: group, 2 rules - if len(s) != 3 { - return fmt.Errorf("expected 3 states: %#v", s) - } - - return nil - } - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSSecurityGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSSecurityGroupConfigIpv6, - }, - - { - ResourceName: "aws_security_group.web", - ImportState: true, - ImportStateCheck: checkFn, - }, - }, - }) -} +func TestAccAWSSecurityGroup_sourceSecurityGroup(t *testing.T) { + var group ec2.SecurityGroup + resourceName := "aws_security_group.test" -func TestAccAWSSecurityGroup_importSelf(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSecurityGroupConfig_importSelf, + Config: testAccAWSSecurityGroupConfig_sourceSecurityGroup, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSecurityGroupExists(resourceName, &group), + ), }, - { - ResourceName: "aws_security_group.allow_all", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, @@ -651,19 +624,25 @@ func TestAccAWSSecurityGroup_importSelf(t *testing.T) { }) } -func TestAccAWSSecurityGroup_importSourceSecurityGroup(t *testing.T) { +func TestAccAWSSecurityGroup_IPRangeAndSecurityGroupWithSameRules(t *testing.T) { + var group ec2.SecurityGroup + resourceName := "aws_security_group.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSecurityGroupConfig_importSourceSecurityGroup, + Config: testAccAWSSecurityGroupConfig_IPRangeAndSecurityGroupWithSameRules, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSecurityGroupExists(resourceName, &group), + ), }, - { - ResourceName: "aws_security_group.test_group_1", + ResourceName: resourceName, ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(4), ImportStateVerify: true, ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, }, @@ -671,71 +650,9 @@ func TestAccAWSSecurityGroup_importSourceSecurityGroup(t *testing.T) { }) } -func TestAccAWSSecurityGroup_importIPRangeAndSecurityGroupWithSameRules(t *testing.T) { - checkFn := func(s []*terraform.InstanceState) error { - // Expect 4: group, 3 rules - if len(s) != 4 { - return fmt.Errorf("expected 4 states: %#v", s) - } - - return nil - } - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSSecurityGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSSecurityGroupConfig_importIPRangeAndSecurityGroupWithSameRules, - }, - - { - ResourceName: "aws_security_group.test_group_1", - ImportState: true, - ImportStateCheck: checkFn, - }, - }, - }) -} - -func TestAccAWSSecurityGroup_importIPRangesWithSameRules(t *testing.T) { - checkFn := func(s []*terraform.InstanceState) error { - // Expect 4: group, 2 rules - if len(s) != 3 { - return fmt.Errorf("expected 3 states: %#v", s) - } - - return nil - } - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSSecurityGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSSecurityGroupConfig_importIPRangesWithSameRules, - }, - - { - ResourceName: "aws_security_group.test_group_1", - ImportState: true, - ImportStateCheck: checkFn, - }, - }, - }) -} - -func TestAccAWSSecurityGroup_importPrefixList(t *testing.T) { - checkFn := func(s []*terraform.InstanceState) error { - // Expect 2: group, 1 rule - if len(s) != 2 { - return fmt.Errorf("expected 2 states: %#v", s) - } - - return nil - } +func TestAccAWSSecurityGroup_IPRangesWithSameRules(t *testing.T) { + var group ec2.SecurityGroup + resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -743,13 +660,17 @@ func TestAccAWSSecurityGroup_importPrefixList(t *testing.T) { CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSecurityGroupConfigPrefixListEgress, + Config: testAccAWSSecurityGroupConfig_IPRangesWithSameRules, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSecurityGroupExists(resourceName, &group), + ), }, - { - ResourceName: "aws_security_group.egress", - ImportState: true, - ImportStateCheck: checkFn, + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(3), + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, }, }, }) @@ -757,38 +678,48 @@ func TestAccAWSSecurityGroup_importPrefixList(t *testing.T) { func TestAccAWSSecurityGroup_basic(t *testing.T) { var group ec2.SecurityGroup + resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_security_group.web", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSecurityGroupConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), + testAccCheckAWSSecurityGroupExists(resourceName, &group), testAccCheckAWSSecurityGroupAttributes(&group), - resource.TestMatchResourceAttr("aws_security_group.web", "arn", regexp.MustCompile(`^arn:[^:]+:ec2:[^:]+:[^:]+:security-group/.+$`)), - resource.TestCheckResourceAttr("aws_security_group.web", "name", "terraform_acceptance_test_example"), - resource.TestCheckResourceAttr("aws_security_group.web", "description", "Used in the terraform acceptance tests"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.cidr_blocks.0", "10.0.0.0/8"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.description", ""), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.to_port", "8000"), + resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(`^arn:[^:]+:ec2:[^:]+:[^:]+:security-group/.+$`)), + resource.TestCheckResourceAttr(resourceName, "name", "terraform_acceptance_test_example"), + resource.TestCheckResourceAttr(resourceName, "description", "Used in the terraform acceptance tests"), + resource.TestCheckResourceAttr(resourceName, "egress.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.cidr_blocks.0", "10.0.0.0/8"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.description", ""), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.self", "false"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.to_port", "8000"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(2), + // NOTE: These ImportStateVerify functions are currently broken because of known issues with multi-import. + // Once those are fixed we can uncomment all these. + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, }, }) } -func TestAccAWSSecurityGroup_Egress_ConfigMode(t *testing.T) { +func TestAccAWSSecurityGroup_egressConfigMode(t *testing.T) { var securityGroup1, securityGroup2, securityGroup3 ec2.SecurityGroup resourceName := "aws_security_group.test" @@ -804,6 +735,13 @@ func TestAccAWSSecurityGroup_Egress_ConfigMode(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "egress.#", "2"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(3), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, { Config: testAccAWSSecurityGroupConfigEgressConfigModeNoBlocks(), Check: resource.ComposeAggregateTestCheckFunc( @@ -822,7 +760,7 @@ func TestAccAWSSecurityGroup_Egress_ConfigMode(t *testing.T) { }) } -func TestAccAWSSecurityGroup_Ingress_ConfigMode(t *testing.T) { +func TestAccAWSSecurityGroup_ingressConfigMode(t *testing.T) { var securityGroup1, securityGroup2, securityGroup3 ec2.SecurityGroup resourceName := "aws_security_group.test" @@ -838,6 +776,13 @@ func TestAccAWSSecurityGroup_Ingress_ConfigMode(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "ingress.#", "2"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(3), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, { Config: testAccAWSSecurityGroupConfigIngressConfigModeNoBlocks(), Check: resource.ComposeAggregateTestCheckFunc( @@ -859,6 +804,7 @@ func TestAccAWSSecurityGroup_Ingress_ConfigMode(t *testing.T) { func TestAccAWSSecurityGroup_ruleGathering(t *testing.T) { var group ec2.SecurityGroup sgName := fmt.Sprintf("tf-acc-security-group-%s", acctest.RandString(7)) + resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -868,187 +814,91 @@ func TestAccAWSSecurityGroup_ruleGathering(t *testing.T) { { Config: testAccAWSSecurityGroupConfig_ruleGathering(sgName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.test", &group), - resource.TestCheckResourceAttr("aws_security_group.test", "name", sgName), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.#", "3"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.2760422146.cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.2760422146.description", "egress for all ipv6"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.2760422146.from_port", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.2760422146.ipv6_cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.2760422146.ipv6_cidr_blocks.0", "::/0"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.2760422146.prefix_list_ids.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.2760422146.protocol", "-1"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.2760422146.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.2760422146.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.2760422146.to_port", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.3161496341.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.3161496341.cidr_blocks.0", "0.0.0.0/0"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.3161496341.description", "egress for all ipv4"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.3161496341.from_port", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.3161496341.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.3161496341.prefix_list_ids.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.3161496341.protocol", "-1"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.3161496341.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.3161496341.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.test", "egress.3161496341.to_port", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.#", "5"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1274017860.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1274017860.cidr_blocks.0", "192.168.0.0/16"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1274017860.description", "ingress from 192.168.0.0/16"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1274017860.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1274017860.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1274017860.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1274017860.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1274017860.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1274017860.to_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1396402051.cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1396402051.description", "ingress from all ipv6"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1396402051.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1396402051.ipv6_cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1396402051.ipv6_cidr_blocks.0", "::/0"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1396402051.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1396402051.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1396402051.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1396402051.to_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1889111182.cidr_blocks.#", "2"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1889111182.cidr_blocks.0", "10.0.2.0/24"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1889111182.cidr_blocks.1", "10.0.3.0/24"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1889111182.description", "ingress from 10.0.0.0/16"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1889111182.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1889111182.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1889111182.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1889111182.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1889111182.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.1889111182.to_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.2038285407.cidr_blocks.#", "2"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.2038285407.cidr_blocks.0", "10.0.0.0/24"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.2038285407.cidr_blocks.1", "10.0.1.0/24"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.2038285407.description", ""), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.2038285407.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.2038285407.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.2038285407.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.2038285407.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.2038285407.self", "true"), - resource.TestCheckResourceAttr("aws_security_group.test", "ingress.2038285407.to_port", "80"), + testAccCheckAWSSecurityGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "name", sgName), + resource.TestCheckResourceAttr(resourceName, "egress.#", "3"), + resource.TestCheckResourceAttr(resourceName, "egress.2760422146.cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.2760422146.description", "egress for all ipv6"), + resource.TestCheckResourceAttr(resourceName, "egress.2760422146.from_port", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.2760422146.ipv6_cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.2760422146.ipv6_cidr_blocks.0", "::/0"), + resource.TestCheckResourceAttr(resourceName, "egress.2760422146.prefix_list_ids.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.2760422146.protocol", "-1"), + resource.TestCheckResourceAttr(resourceName, "egress.2760422146.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.2760422146.self", "false"), + resource.TestCheckResourceAttr(resourceName, "egress.2760422146.to_port", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.3161496341.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.3161496341.cidr_blocks.0", "0.0.0.0/0"), + resource.TestCheckResourceAttr(resourceName, "egress.3161496341.description", "egress for all ipv4"), + resource.TestCheckResourceAttr(resourceName, "egress.3161496341.from_port", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.3161496341.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.3161496341.prefix_list_ids.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.3161496341.protocol", "-1"), + resource.TestCheckResourceAttr(resourceName, "egress.3161496341.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.3161496341.self", "false"), + resource.TestCheckResourceAttr(resourceName, "egress.3161496341.to_port", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.#", "5"), + resource.TestCheckResourceAttr(resourceName, "ingress.1274017860.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.1274017860.cidr_blocks.0", "192.168.0.0/16"), + resource.TestCheckResourceAttr(resourceName, "ingress.1274017860.description", "ingress from 192.168.0.0/16"), + resource.TestCheckResourceAttr(resourceName, "ingress.1274017860.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.1274017860.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.1274017860.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.1274017860.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.1274017860.self", "false"), + resource.TestCheckResourceAttr(resourceName, "ingress.1274017860.to_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.1396402051.cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.1396402051.description", "ingress from all ipv6"), + resource.TestCheckResourceAttr(resourceName, "ingress.1396402051.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.1396402051.ipv6_cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.1396402051.ipv6_cidr_blocks.0", "::/0"), + resource.TestCheckResourceAttr(resourceName, "ingress.1396402051.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.1396402051.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.1396402051.self", "false"), + resource.TestCheckResourceAttr(resourceName, "ingress.1396402051.to_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.1889111182.cidr_blocks.#", "2"), + resource.TestCheckResourceAttr(resourceName, "ingress.1889111182.cidr_blocks.0", "10.0.2.0/24"), + resource.TestCheckResourceAttr(resourceName, "ingress.1889111182.cidr_blocks.1", "10.0.3.0/24"), + resource.TestCheckResourceAttr(resourceName, "ingress.1889111182.description", "ingress from 10.0.0.0/16"), + resource.TestCheckResourceAttr(resourceName, "ingress.1889111182.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.1889111182.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.1889111182.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.1889111182.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.1889111182.self", "false"), + resource.TestCheckResourceAttr(resourceName, "ingress.1889111182.to_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.2038285407.cidr_blocks.#", "2"), + resource.TestCheckResourceAttr(resourceName, "ingress.2038285407.cidr_blocks.0", "10.0.0.0/24"), + resource.TestCheckResourceAttr(resourceName, "ingress.2038285407.cidr_blocks.1", "10.0.1.0/24"), + resource.TestCheckResourceAttr(resourceName, "ingress.2038285407.description", ""), + resource.TestCheckResourceAttr(resourceName, "ingress.2038285407.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.2038285407.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.2038285407.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.2038285407.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.2038285407.self", "true"), + resource.TestCheckResourceAttr(resourceName, "ingress.2038285407.to_port", "80"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(8), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, }, }) } -// cycleIpPermForGroup returns an IpPermission struct with a configured -// UserIdGroupPair for the groupid given. Used in -// TestAccAWSSecurityGroup_forceRevokeRules_should_fail to create a cyclic rule -// between 2 security groups -func cycleIpPermForGroup(groupId string) *ec2.IpPermission { - var perm ec2.IpPermission - perm.FromPort = aws.Int64(0) - perm.ToPort = aws.Int64(0) - perm.IpProtocol = aws.String("icmp") - perm.UserIdGroupPairs = make([]*ec2.UserIdGroupPair, 1) - perm.UserIdGroupPairs[0] = &ec2.UserIdGroupPair{ - GroupId: aws.String(groupId), - } - return &perm -} - -// testAddRuleCycle returns a TestCheckFunc to use at the end of a test, such -// that a Security Group Rule cyclic dependency will be created between the two -// Security Groups. A companion function, testRemoveRuleCycle, will undo this. -func testAddRuleCycle(primary, secondary *ec2.SecurityGroup) resource.TestCheckFunc { - return func(s *terraform.State) error { - if primary.GroupId == nil { - return fmt.Errorf("Primary SG not set for TestAccAWSSecurityGroup_forceRevokeRules_should_fail") - } - if secondary.GroupId == nil { - return fmt.Errorf("Secondary SG not set for TestAccAWSSecurityGroup_forceRevokeRules_should_fail") - } - - conn := testAccProvider.Meta().(*AWSClient).ec2conn - - // cycle from primary to secondary - perm1 := cycleIpPermForGroup(*secondary.GroupId) - // cycle from secondary to primary - perm2 := cycleIpPermForGroup(*primary.GroupId) - - req1 := &ec2.AuthorizeSecurityGroupEgressInput{ - GroupId: primary.GroupId, - IpPermissions: []*ec2.IpPermission{perm1}, - } - req2 := &ec2.AuthorizeSecurityGroupEgressInput{ - GroupId: secondary.GroupId, - IpPermissions: []*ec2.IpPermission{perm2}, - } - - var err error - _, err = conn.AuthorizeSecurityGroupEgress(req1) - if err != nil { - return fmt.Errorf( - "Error authorizing primary security group %s rules: %s", *primary.GroupId, - err) - } - _, err = conn.AuthorizeSecurityGroupEgress(req2) - if err != nil { - return fmt.Errorf( - "Error authorizing secondary security group %s rules: %s", *secondary.GroupId, - err) - } - return nil - } -} - -// testRemoveRuleCycle removes the cyclic dependency between two security groups -// that was added in testAddRuleCycle -func testRemoveRuleCycle(primary, secondary *ec2.SecurityGroup) resource.TestCheckFunc { - return func(s *terraform.State) error { - if primary.GroupId == nil { - return fmt.Errorf("Primary SG not set for TestAccAWSSecurityGroup_forceRevokeRules_should_fail") - } - if secondary.GroupId == nil { - return fmt.Errorf("Secondary SG not set for TestAccAWSSecurityGroup_forceRevokeRules_should_fail") - } - - conn := testAccProvider.Meta().(*AWSClient).ec2conn - for _, sg := range []*ec2.SecurityGroup{primary, secondary} { - var err error - if sg.IpPermissions != nil { - req := &ec2.RevokeSecurityGroupIngressInput{ - GroupId: sg.GroupId, - IpPermissions: sg.IpPermissions, - } - - if _, err = conn.RevokeSecurityGroupIngress(req); err != nil { - return fmt.Errorf( - "Error revoking default ingress rule for Security Group in testRemoveCycle (%s): %s", - *primary.GroupId, err) - } - } - - if sg.IpPermissionsEgress != nil { - req := &ec2.RevokeSecurityGroupEgressInput{ - GroupId: sg.GroupId, - IpPermissions: sg.IpPermissionsEgress, - } - - if _, err = conn.RevokeSecurityGroupEgress(req); err != nil { - return fmt.Errorf( - "Error revoking default egress rule for Security Group in testRemoveCycle (%s): %s", - *sg.GroupId, err) - } - } - } - return nil - } -} - // This test should fail to destroy the Security Groups and VPC, due to a // dependency cycle added outside of terraform's management. There is a sweeper // 'aws_vpc' and 'aws_security_group' that cleans these up, however, the test is // written to allow Terraform to clean it up because we do go and revoke the // cyclic rules that were added. -func TestAccAWSSecurityGroup_forceRevokeRules_true(t *testing.T) { +func TestAccAWSSecurityGroup_forceRevokeRulesTrue(t *testing.T) { var primary ec2.SecurityGroup var secondary ec2.SecurityGroup + resourceName := "aws_security_group.primary" + resourceName2 := "aws_security_group.secondary" // Add rules to create a cycle between primary and secondary. This prevents // Terraform/AWS from being able to destroy the groups @@ -1066,11 +916,18 @@ func TestAccAWSSecurityGroup_forceRevokeRules_true(t *testing.T) { { Config: testAccAWSSecurityGroupConfig_revoke_base, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.primary", &primary), - testAccCheckAWSSecurityGroupExists("aws_security_group.secondary", &secondary), + testAccCheckAWSSecurityGroupExists(resourceName, &primary), + testAccCheckAWSSecurityGroupExists(resourceName2, &secondary), testAddCycle, ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(2), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, // Verify the DependencyViolation error by using a configuration with the // groups removed. Terraform tries to destroy them but cannot. Expect a // DependencyViolation error @@ -1084,8 +941,8 @@ func TestAccAWSSecurityGroup_forceRevokeRules_true(t *testing.T) { Config: testAccAWSSecurityGroupConfig_revoke_base, // ExpectError: regexp.MustCompile("DependencyViolation"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.primary", &primary), - testAccCheckAWSSecurityGroupExists("aws_security_group.secondary", &secondary), + testAccCheckAWSSecurityGroupExists(resourceName, &primary), + testAccCheckAWSSecurityGroupExists(resourceName2, &secondary), testRemoveCycle, ), }, @@ -1103,8 +960,8 @@ func TestAccAWSSecurityGroup_forceRevokeRules_true(t *testing.T) { { Config: testAccAWSSecurityGroupConfig_revoke_true, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.primary", &primary), - testAccCheckAWSSecurityGroupExists("aws_security_group.secondary", &secondary), + testAccCheckAWSSecurityGroupExists(resourceName, &primary), + testAccCheckAWSSecurityGroupExists(resourceName2, &secondary), testAddCycle, ), }, @@ -1117,9 +974,11 @@ func TestAccAWSSecurityGroup_forceRevokeRules_true(t *testing.T) { }) } -func TestAccAWSSecurityGroup_forceRevokeRules_false(t *testing.T) { +func TestAccAWSSecurityGroup_forceRevokeRulesFalse(t *testing.T) { var primary ec2.SecurityGroup var secondary ec2.SecurityGroup + resourceName := "aws_security_group.primary" + resourceName2 := "aws_security_group.secondary" // Add rules to create a cycle between primary and secondary. This prevents // Terraform/AWS from being able to destroy the groups @@ -1139,11 +998,18 @@ func TestAccAWSSecurityGroup_forceRevokeRules_false(t *testing.T) { { Config: testAccAWSSecurityGroupConfig_revoke_false, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.primary", &primary), - testAccCheckAWSSecurityGroupExists("aws_security_group.secondary", &secondary), + testAccCheckAWSSecurityGroupExists(resourceName, &primary), + testAccCheckAWSSecurityGroupExists(resourceName2, &secondary), testAddCycle, ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(2), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, // Verify the DependencyViolation error by using a configuration with the // groups removed, and the Groups not configured to revoke their ruls. // Terraform tries to destroy them but cannot. Expect a @@ -1157,8 +1023,8 @@ func TestAccAWSSecurityGroup_forceRevokeRules_false(t *testing.T) { { Config: testAccAWSSecurityGroupConfig_revoke_false, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.primary", &primary), - testAccCheckAWSSecurityGroupExists("aws_security_group.secondary", &secondary), + testAccCheckAWSSecurityGroupExists(resourceName, &primary), + testAccCheckAWSSecurityGroupExists(resourceName2, &secondary), testRemoveCycle, ), }, @@ -1172,69 +1038,82 @@ func TestAccAWSSecurityGroup_forceRevokeRules_false(t *testing.T) { func TestAccAWSSecurityGroup_ipv6(t *testing.T) { var group ec2.SecurityGroup + resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_security_group.web", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSecurityGroupConfigIpv6, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), - resource.TestCheckResourceAttr("aws_security_group.web", "name", "terraform_acceptance_test_example"), - resource.TestCheckResourceAttr("aws_security_group.web", "description", "Used in the terraform acceptance tests"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2293451516.cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2293451516.description", ""), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2293451516.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2293451516.ipv6_cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2293451516.ipv6_cidr_blocks.0", "::/0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2293451516.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2293451516.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2293451516.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2293451516.to_port", "8000"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.2293451516.cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.2293451516.description", ""), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.2293451516.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.2293451516.ipv6_cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.2293451516.ipv6_cidr_blocks.0", "::/0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.2293451516.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.2293451516.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.2293451516.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.2293451516.to_port", "8000"), + testAccCheckAWSSecurityGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "name", "terraform_acceptance_test_example"), + resource.TestCheckResourceAttr(resourceName, "description", "Used in the terraform acceptance tests"), + resource.TestCheckResourceAttr(resourceName, "egress.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.2293451516.cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.2293451516.description", ""), + resource.TestCheckResourceAttr(resourceName, "egress.2293451516.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "egress.2293451516.ipv6_cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.2293451516.ipv6_cidr_blocks.0", "::/0"), + resource.TestCheckResourceAttr(resourceName, "egress.2293451516.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "egress.2293451516.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.2293451516.self", "false"), + resource.TestCheckResourceAttr(resourceName, "egress.2293451516.to_port", "8000"), + resource.TestCheckResourceAttr(resourceName, "ingress.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.2293451516.cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.2293451516.description", ""), + resource.TestCheckResourceAttr(resourceName, "ingress.2293451516.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.2293451516.ipv6_cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.2293451516.ipv6_cidr_blocks.0", "::/0"), + resource.TestCheckResourceAttr(resourceName, "ingress.2293451516.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.2293451516.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.2293451516.self", "false"), + resource.TestCheckResourceAttr(resourceName, "ingress.2293451516.to_port", "8000"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(3), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, }, }) } func TestAccAWSSecurityGroup_namePrefix(t *testing.T) { var group ec2.SecurityGroup + resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_security_group.baz", - IDRefreshIgnore: []string{"name_prefix"}, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSSecurityGroupDestroy, + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSecurityGroupPrefixNameConfig, + Config: testAccAWSSecurityGroupPrefixNameConfig("tf-acc-test-prefix-"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.baz", &group), - testAccCheckAWSSecurityGroupGeneratedNamePrefix( - "aws_security_group.baz", "baz-"), + testAccCheckAWSSecurityGroupExists(resourceName, &group), + naming.TestCheckResourceAttrNameFromPrefix(resourceName, "name", "tf-acc-test-prefix-"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, }, }) } func TestAccAWSSecurityGroup_self(t *testing.T) { var group ec2.SecurityGroup + resourceName := "aws_security_group.test" checkSelf := func(s *terraform.State) (err error) { defer func() { @@ -1252,201 +1131,224 @@ func TestAccAWSSecurityGroup_self(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_security_group.web", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSecurityGroupConfigSelf, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), - resource.TestCheckResourceAttr("aws_security_group.web", "name", "terraform_acceptance_test_example"), - resource.TestCheckResourceAttr("aws_security_group.web", "description", "Used in the terraform acceptance tests"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3971148406.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3971148406.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3971148406.to_port", "8000"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3971148406.self", "true"), + testAccCheckAWSSecurityGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "name", "terraform_acceptance_test_example"), + resource.TestCheckResourceAttr(resourceName, "description", "Used in the terraform acceptance tests"), + resource.TestCheckResourceAttr(resourceName, "ingress.3971148406.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.3971148406.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.3971148406.to_port", "8000"), + resource.TestCheckResourceAttr(resourceName, "ingress.3971148406.self", "true"), checkSelf, ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(3), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, }, }) } func TestAccAWSSecurityGroup_vpc(t *testing.T) { var group ec2.SecurityGroup - - testCheck := func(*terraform.State) error { - if *group.VpcId == "" { - return fmt.Errorf("should have vpc ID") - } - - return nil - } + resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_security_group.web", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSecurityGroupConfigVpc, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), + testAccCheckAWSSecurityGroupExists(resourceName, &group), testAccCheckAWSSecurityGroupAttributes(&group), resource.TestCheckResourceAttr( - "aws_security_group.web", "name", "terraform_acceptance_test_example"), + resourceName, "name", "terraform_acceptance_test_example"), resource.TestCheckResourceAttr( - "aws_security_group.web", "description", "Used in the terraform acceptance tests"), + resourceName, "description", "Used in the terraform acceptance tests"), resource.TestCheckResourceAttr( - "aws_security_group.web", "ingress.3629188364.protocol", "tcp"), + resourceName, "ingress.3629188364.protocol", "tcp"), resource.TestCheckResourceAttr( - "aws_security_group.web", "ingress.3629188364.from_port", "80"), + resourceName, "ingress.3629188364.from_port", "80"), resource.TestCheckResourceAttr( - "aws_security_group.web", "ingress.3629188364.to_port", "8000"), + resourceName, "ingress.3629188364.to_port", "8000"), resource.TestCheckResourceAttr( - "aws_security_group.web", "ingress.3629188364.cidr_blocks.#", "1"), + resourceName, "ingress.3629188364.cidr_blocks.#", "1"), resource.TestCheckResourceAttr( - "aws_security_group.web", "ingress.3629188364.cidr_blocks.0", "10.0.0.0/8"), + resourceName, "ingress.3629188364.cidr_blocks.0", "10.0.0.0/8"), resource.TestCheckResourceAttr( - "aws_security_group.web", "egress.3629188364.protocol", "tcp"), + resourceName, "egress.3629188364.protocol", "tcp"), resource.TestCheckResourceAttr( - "aws_security_group.web", "egress.3629188364.from_port", "80"), + resourceName, "egress.3629188364.from_port", "80"), resource.TestCheckResourceAttr( - "aws_security_group.web", "egress.3629188364.to_port", "8000"), + resourceName, "egress.3629188364.to_port", "8000"), resource.TestCheckResourceAttr( - "aws_security_group.web", "egress.3629188364.cidr_blocks.#", "1"), + resourceName, "egress.3629188364.cidr_blocks.#", "1"), resource.TestCheckResourceAttr( - "aws_security_group.web", "egress.3629188364.cidr_blocks.0", "10.0.0.0/8"), - testCheck, + resourceName, "egress.3629188364.cidr_blocks.0", "10.0.0.0/8"), + testAccAWSSecurityGroupCheckVPCIDExists(&group), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(3), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, }, }) } func TestAccAWSSecurityGroup_vpcNegOneIngress(t *testing.T) { var group ec2.SecurityGroup - - testCheck := func(*terraform.State) error { - if *group.VpcId == "" { - return fmt.Errorf("should have vpc ID") - } - - return nil - } + resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_security_group.web", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSecurityGroupConfigVpcNegOneIngress, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), + testAccCheckAWSSecurityGroupExists(resourceName, &group), testAccCheckAWSSecurityGroupAttributesNegOneProtocol(&group), resource.TestCheckResourceAttr( - "aws_security_group.web", "name", "terraform_acceptance_test_example"), + resourceName, "name", "terraform_acceptance_test_example"), resource.TestCheckResourceAttr( - "aws_security_group.web", "description", "Used in the terraform acceptance tests"), + resourceName, "description", "Used in the terraform acceptance tests"), resource.TestCheckResourceAttr( - "aws_security_group.web", "ingress.956249133.protocol", "-1"), + resourceName, "ingress.956249133.protocol", "-1"), resource.TestCheckResourceAttr( - "aws_security_group.web", "ingress.956249133.from_port", "0"), + resourceName, "ingress.956249133.from_port", "0"), resource.TestCheckResourceAttr( - "aws_security_group.web", "ingress.956249133.to_port", "0"), + resourceName, "ingress.956249133.to_port", "0"), resource.TestCheckResourceAttr( - "aws_security_group.web", "ingress.956249133.cidr_blocks.#", "1"), + resourceName, "ingress.956249133.cidr_blocks.#", "1"), resource.TestCheckResourceAttr( - "aws_security_group.web", "ingress.956249133.cidr_blocks.0", "10.0.0.0/8"), - testCheck, + resourceName, "ingress.956249133.cidr_blocks.0", "10.0.0.0/8"), + testAccAWSSecurityGroupCheckVPCIDExists(&group), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(2), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, }, }) } func TestAccAWSSecurityGroup_vpcProtoNumIngress(t *testing.T) { var group ec2.SecurityGroup - - testCheck := func(*terraform.State) error { - if *group.VpcId == "" { - return fmt.Errorf("should have vpc ID") - } - - return nil - } + resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_security_group.web", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSecurityGroupConfigVpcProtoNumIngress, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), + testAccCheckAWSSecurityGroupExists(resourceName, &group), resource.TestCheckResourceAttr( - "aws_security_group.web", "name", "terraform_acceptance_test_example"), + resourceName, "name", "terraform_acceptance_test_example"), resource.TestCheckResourceAttr( - "aws_security_group.web", "description", "Used in the terraform acceptance tests"), + resourceName, "description", "Used in the terraform acceptance tests"), resource.TestCheckResourceAttr( - "aws_security_group.web", "ingress.2449525218.protocol", "50"), + resourceName, "ingress.2449525218.protocol", "50"), resource.TestCheckResourceAttr( - "aws_security_group.web", "ingress.2449525218.from_port", "0"), + resourceName, "ingress.2449525218.from_port", "0"), resource.TestCheckResourceAttr( - "aws_security_group.web", "ingress.2449525218.to_port", "0"), + resourceName, "ingress.2449525218.to_port", "0"), resource.TestCheckResourceAttr( - "aws_security_group.web", "ingress.2449525218.cidr_blocks.#", "1"), + resourceName, "ingress.2449525218.cidr_blocks.#", "1"), resource.TestCheckResourceAttr( - "aws_security_group.web", "ingress.2449525218.cidr_blocks.0", "10.0.0.0/8"), - testCheck, + resourceName, "ingress.2449525218.cidr_blocks.0", "10.0.0.0/8"), + testAccAWSSecurityGroupCheckVPCIDExists(&group), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(2), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, }, }) } -func TestAccAWSSecurityGroup_MultiIngress(t *testing.T) { +func TestAccAWSSecurityGroup_multiIngress(t *testing.T) { var group ec2.SecurityGroup + resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_security_group.web", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSecurityGroupConfigMultiIngress, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), + testAccCheckAWSSecurityGroupExists(resourceName, &group), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(3), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, }, }) } -func TestAccAWSSecurityGroup_Change(t *testing.T) { +func TestAccAWSSecurityGroup_change(t *testing.T) { var group ec2.SecurityGroup + resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_security_group.web", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSecurityGroupConfig, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), + testAccCheckAWSSecurityGroupExists(resourceName, &group), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(2), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, { Config: testAccAWSSecurityGroupConfigChange, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), + testAccCheckAWSSecurityGroupExists(resourceName, &group), testAccCheckAWSSecurityGroupAttributesChanged(&group), ), }, @@ -1454,93 +1356,101 @@ func TestAccAWSSecurityGroup_Change(t *testing.T) { }) } -func TestAccAWSSecurityGroup_RuleDescription(t *testing.T) { +func TestAccAWSSecurityGroup_ruleDescription(t *testing.T) { var group ec2.SecurityGroup + resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_security_group.web", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSecurityGroupConfigRuleDescription("Egress description", "Ingress description"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2129912301.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2129912301.cidr_blocks.0", "10.0.0.0/8"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2129912301.description", "Egress description"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2129912301.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2129912301.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2129912301.prefix_list_ids.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2129912301.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2129912301.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2129912301.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.2129912301.to_port", "8000"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1147649399.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1147649399.cidr_blocks.0", "10.0.0.0/8"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1147649399.description", "Ingress description"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1147649399.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1147649399.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1147649399.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1147649399.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1147649399.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1147649399.to_port", "8000"), + testAccCheckAWSSecurityGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "egress.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.2129912301.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.2129912301.cidr_blocks.0", "10.0.0.0/8"), + resource.TestCheckResourceAttr(resourceName, "egress.2129912301.description", "Egress description"), + resource.TestCheckResourceAttr(resourceName, "egress.2129912301.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "egress.2129912301.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.2129912301.prefix_list_ids.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.2129912301.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "egress.2129912301.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.2129912301.self", "false"), + resource.TestCheckResourceAttr(resourceName, "egress.2129912301.to_port", "8000"), + resource.TestCheckResourceAttr(resourceName, "ingress.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.1147649399.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.1147649399.cidr_blocks.0", "10.0.0.0/8"), + resource.TestCheckResourceAttr(resourceName, "ingress.1147649399.description", "Ingress description"), + resource.TestCheckResourceAttr(resourceName, "ingress.1147649399.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.1147649399.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.1147649399.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.1147649399.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.1147649399.self", "false"), + resource.TestCheckResourceAttr(resourceName, "ingress.1147649399.to_port", "8000"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(3), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, // Change just the rule descriptions. { Config: testAccAWSSecurityGroupConfigRuleDescription("New egress description", "New ingress description"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.746197026.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.746197026.cidr_blocks.0", "10.0.0.0/8"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.746197026.description", "New egress description"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.746197026.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.746197026.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.746197026.prefix_list_ids.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.746197026.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.746197026.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.746197026.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.746197026.to_port", "8000"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1341057959.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1341057959.cidr_blocks.0", "10.0.0.0/8"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1341057959.description", "New ingress description"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1341057959.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1341057959.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1341057959.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1341057959.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1341057959.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.1341057959.to_port", "8000"), + testAccCheckAWSSecurityGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "egress.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.746197026.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.746197026.cidr_blocks.0", "10.0.0.0/8"), + resource.TestCheckResourceAttr(resourceName, "egress.746197026.description", "New egress description"), + resource.TestCheckResourceAttr(resourceName, "egress.746197026.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "egress.746197026.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.746197026.prefix_list_ids.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.746197026.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "egress.746197026.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.746197026.self", "false"), + resource.TestCheckResourceAttr(resourceName, "egress.746197026.to_port", "8000"), + resource.TestCheckResourceAttr(resourceName, "ingress.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.1341057959.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.1341057959.cidr_blocks.0", "10.0.0.0/8"), + resource.TestCheckResourceAttr(resourceName, "ingress.1341057959.description", "New ingress description"), + resource.TestCheckResourceAttr(resourceName, "ingress.1341057959.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.1341057959.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.1341057959.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.1341057959.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.1341057959.self", "false"), + resource.TestCheckResourceAttr(resourceName, "ingress.1341057959.to_port", "8000"), ), }, // Remove just the rule descriptions. { Config: testAccAWSSecurityGroupConfigEmptyRuleDescription, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.cidr_blocks.0", "10.0.0.0/8"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.description", ""), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.to_port", "8000"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.cidr_blocks.0", "10.0.0.0/8"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.description", ""), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.to_port", "8000"), + testAccCheckAWSSecurityGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "egress.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.cidr_blocks.0", "10.0.0.0/8"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.description", ""), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.self", "false"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.to_port", "8000"), + resource.TestCheckResourceAttr(resourceName, "ingress.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.cidr_blocks.0", "10.0.0.0/8"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.description", ""), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.self", "false"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.to_port", "8000"), ), }, }, @@ -1549,55 +1459,60 @@ func TestAccAWSSecurityGroup_RuleDescription(t *testing.T) { func TestAccAWSSecurityGroup_generatedName(t *testing.T) { var group ec2.SecurityGroup + resourceName := "aws_security_group.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_security_group.web", - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSSecurityGroupDestroy, + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSecurityGroupConfig_generatedName, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), - resource.TestCheckResourceAttr( - "aws_security_group.web", "description", "Managed by Terraform"), - func(s *terraform.State) error { - if group.GroupName == nil { - return fmt.Errorf("bad: No SG name") - } - if !strings.HasPrefix(*group.GroupName, "terraform-") { - return fmt.Errorf("No terraform- prefix: %s", *group.GroupName) - } - return nil - }, + testAccCheckAWSSecurityGroupExists(resourceName, &group), + naming.TestCheckResourceAttrNameGenerated(resourceName, "name"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, }, }) } -func TestAccAWSSecurityGroup_DefaultEgress_VPC(t *testing.T) { +func TestAccAWSSecurityGroup_defaultEgressVPC(t *testing.T) { + resourceName := "aws_security_group.test" // VPC resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_security_group.worker", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSecurityGroupConfigDefaultEgress, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExistsWithoutDefault("aws_security_group.worker"), + testAccCheckAWSSecurityGroupExistsWithoutDefault(resourceName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(2), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, }, }) } -func TestAccAWSSecurityGroup_DefaultEgress_Classic(t *testing.T) { +func TestAccAWSSecurityGroup_defaultEgressClassic(t *testing.T) { var group ec2.SecurityGroup + resourceName := "aws_security_group.test" oldvar := os.Getenv("AWS_DEFAULT_REGION") os.Setenv("AWS_DEFAULT_REGION", "us-east-1") @@ -1605,23 +1520,32 @@ func TestAccAWSSecurityGroup_DefaultEgress_Classic(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, - IDRefreshName: "aws_security_group.web", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSecurityGroupDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSecurityGroupConfigClassic, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), + testAccCheckAWSSecurityGroupExists(resourceName, &group), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(1), + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, }, }) } // Testing drift detection with groups containing the same port and types func TestAccAWSSecurityGroup_drift(t *testing.T) { + resourceName := "aws_security_group.test" var group ec2.SecurityGroup + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -1630,117 +1554,514 @@ func TestAccAWSSecurityGroup_drift(t *testing.T) { { Config: testAccAWSSecurityGroupConfig_drift(), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), - resource.TestCheckResourceAttr("aws_security_group.web", "description", "Used in the terraform acceptance tests"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.#", "2"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.cidr_blocks.0", "10.0.0.0/8"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.description", ""), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.to_port", "8000"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.cidr_blocks.0", "206.0.0.0/8"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.description", ""), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.to_port", "8000"), + testAccCheckAWSSecurityGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "description", "Used in the terraform acceptance tests"), + resource.TestCheckResourceAttr(resourceName, "egress.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.#", "2"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.cidr_blocks.0", "10.0.0.0/8"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.description", ""), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.self", "false"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.to_port", "8000"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.cidr_blocks.0", "206.0.0.0/8"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.description", ""), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.self", "false"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.to_port", "8000"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(2), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, }, }) } -func TestAccAWSSecurityGroup_drift_complex(t *testing.T) { - var group ec2.SecurityGroup +func TestAccAWSSecurityGroup_driftComplex(t *testing.T) { + var group ec2.SecurityGroup + resourceName := "aws_security_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSecurityGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSecurityGroupConfig_drift_complex(), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSecurityGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "description", "Used in the terraform acceptance tests"), + resource.TestCheckResourceAttr(resourceName, "egress.#", "3"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.cidr_blocks.0", "10.0.0.0/8"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.description", ""), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.prefix_list_ids.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.self", "false"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.to_port", "8000"), + resource.TestCheckResourceAttr(resourceName, "egress.657243763.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.657243763.cidr_blocks.0", "206.0.0.0/8"), + resource.TestCheckResourceAttr(resourceName, "egress.657243763.description", ""), + resource.TestCheckResourceAttr(resourceName, "egress.657243763.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "egress.657243763.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.657243763.prefix_list_ids.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.657243763.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "egress.657243763.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.657243763.self", "false"), + resource.TestCheckResourceAttr(resourceName, "egress.657243763.to_port", "8000"), + resource.TestCheckResourceAttr(resourceName, "ingress.#", "3"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.cidr_blocks.0", "10.0.0.0/8"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.description", ""), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.self", "false"), + resource.TestCheckResourceAttr(resourceName, "ingress.3629188364.to_port", "8000"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.cidr_blocks.0", "206.0.0.0/8"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.description", ""), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.self", "false"), + resource.TestCheckResourceAttr(resourceName, "ingress.657243763.to_port", "8000"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(5), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, + }, + }) +} + +func TestAccAWSSecurityGroup_invalidCIDRBlock(t *testing.T) { + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSecurityGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSecurityGroupInvalidIngressCidr, + ExpectError: regexp.MustCompile("invalid CIDR address: 1.2.3.4/33"), + }, + { + Config: testAccAWSSecurityGroupInvalidEgressCidr, + ExpectError: regexp.MustCompile("invalid CIDR address: 1.2.3.4/33"), + }, + { + Config: testAccAWSSecurityGroupInvalidIPv6IngressCidr, + ExpectError: regexp.MustCompile("invalid CIDR address: ::/244"), + }, + { + Config: testAccAWSSecurityGroupInvalidIPv6EgressCidr, + ExpectError: regexp.MustCompile("invalid CIDR address: ::/244"), + }, + }, + }) +} + +func TestAccAWSSecurityGroup_tags(t *testing.T) { + var group ec2.SecurityGroup + resourceName := "aws_security_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSecurityGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSecurityGroupConfigTags, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSecurityGroupExists(resourceName, &group), + testAccCheckTags(&group.Tags, "foo", "bar"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(1), + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, + { + Config: testAccAWSSecurityGroupConfigTagsUpdate, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSecurityGroupExists(resourceName, &group), + testAccCheckTags(&group.Tags, "foo", ""), + testAccCheckTags(&group.Tags, "bar", "baz"), + testAccCheckTags(&group.Tags, "env", "Production"), + ), + }, + }, + }) +} + +func TestAccAWSSecurityGroup_CIDRandGroups(t *testing.T) { + var group ec2.SecurityGroup + resourceName := "aws_security_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSecurityGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSecurityGroupCombindCIDRandGroups, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSecurityGroupExists(resourceName, &group), + // testAccCheckAWSSecurityGroupAttributes(&group), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(5), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, + }, + }) +} + +func TestAccAWSSecurityGroup_ingressWithCidrAndSGsVPC(t *testing.T) { + var group ec2.SecurityGroup + resourceName := "aws_security_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSecurityGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSecurityGroupConfig_ingressWithCidrAndSGs, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSecurityGroupExists(resourceName, &group), + testAccCheckAWSSecurityGroupSGandCidrAttributes(&group), + resource.TestCheckResourceAttr(resourceName, "egress.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.cidr_blocks.0", "10.0.0.0/8"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.description", ""), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.from_port", "80"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.prefix_list_ids.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.self", "false"), + resource.TestCheckResourceAttr(resourceName, "egress.3629188364.to_port", "8000"), + resource.TestCheckResourceAttr(resourceName, "ingress.#", "2"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.cidr_blocks.0", "192.168.0.1/32"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.description", ""), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.from_port", "22"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.self", "false"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.to_port", "22"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(5), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, + }, + }) +} + +func TestAccAWSSecurityGroup_ingressWithCidrAndSGsClassic(t *testing.T) { + var group ec2.SecurityGroup + resourceName := "aws_security_group.test" + + oldvar := os.Getenv("AWS_DEFAULT_REGION") + os.Setenv("AWS_DEFAULT_REGION", "us-east-1") + defer os.Setenv("AWS_DEFAULT_REGION", oldvar) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSecurityGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSecurityGroupConfig_ingressWithCidrAndSGs_classic, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSecurityGroupExists(resourceName, &group), + testAccCheckAWSSecurityGroupSGandCidrAttributes(&group), + resource.TestCheckResourceAttr(resourceName, "egress.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.#", "2"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.cidr_blocks.0", "192.168.0.1/32"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.description", ""), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.from_port", "22"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.protocol", "tcp"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.self", "false"), + resource.TestCheckResourceAttr(resourceName, "ingress.3893008652.to_port", "22"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(4), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, + }, + }) +} + +func TestAccAWSSecurityGroup_egressWithPrefixList(t *testing.T) { + var group ec2.SecurityGroup + resourceName := "aws_security_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSecurityGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSecurityGroupConfigPrefixListEgress, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSecurityGroupExists(resourceName, &group), + testAccCheckAWSSecurityGroupEgressPrefixListAttributes(&group), + resource.TestCheckResourceAttr( + resourceName, "egress.#", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(2), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, + }, + }) +} + +func TestAccAWSSecurityGroup_ingressWithPrefixList(t *testing.T) { + var group ec2.SecurityGroup + resourceName := "aws_security_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSecurityGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSecurityGroupConfigPrefixListIngress, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSecurityGroupExists(resourceName, &group), + testAccCheckAWSSecurityGroupIngressPrefixListAttributes(&group), + resource.TestCheckResourceAttr( + resourceName, "ingress.#", "1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(2), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete"}, + }, + }, + }) +} + +func TestAccAWSSecurityGroup_ipv4andipv6Egress(t *testing.T) { + var group ec2.SecurityGroup + resourceName := "aws_security_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSecurityGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSecurityGroupConfigIpv4andIpv6Egress, + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSecurityGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "egress.#", "2"), + resource.TestCheckResourceAttr(resourceName, "egress.482069346.cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.482069346.cidr_blocks.0", "0.0.0.0/0"), + resource.TestCheckResourceAttr(resourceName, "egress.482069346.description", ""), + resource.TestCheckResourceAttr(resourceName, "egress.482069346.from_port", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.482069346.ipv6_cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.482069346.prefix_list_ids.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.482069346.protocol", "-1"), + resource.TestCheckResourceAttr(resourceName, "egress.482069346.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.482069346.self", "false"), + resource.TestCheckResourceAttr(resourceName, "egress.482069346.to_port", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.706749478.cidr_blocks.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.706749478.description", ""), + resource.TestCheckResourceAttr(resourceName, "egress.706749478.from_port", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.706749478.ipv6_cidr_blocks.#", "1"), + resource.TestCheckResourceAttr(resourceName, "egress.706749478.ipv6_cidr_blocks.0", "::/0"), + resource.TestCheckResourceAttr(resourceName, "egress.706749478.prefix_list_ids.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.706749478.protocol", "-1"), + resource.TestCheckResourceAttr(resourceName, "egress.706749478.security_groups.#", "0"), + resource.TestCheckResourceAttr(resourceName, "egress.706749478.self", "false"), + resource.TestCheckResourceAttr(resourceName, "egress.706749478.to_port", "0"), + resource.TestCheckResourceAttr(resourceName, "ingress.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateCheck: testAccAWSSecurityGroupImportStateCheckFunc(3), + //ImportStateVerify: true, + //ImportStateVerifyIgnore: []string{"revoke_rules_on_delete", "egress"}, + }, + }, + }) +} + +func testAccAWSSecurityGroupImportStateCheckFunc(expectedStates int) resource.ImportStateCheckFunc { + return func(s []*terraform.InstanceState) error { + if len(s) != expectedStates { + return fmt.Errorf("expected %d states, got %d: %#v", expectedStates, len(s), s) + } + return nil + } +} + +func testAccAWSSecurityGroupCheckVPCIDExists(group *ec2.SecurityGroup) resource.TestCheckFunc { + return func(*terraform.State) error { + if *group.VpcId == "" { + return fmt.Errorf("should have vpc ID") + } + return nil + } +} + +// cycleIpPermForGroup returns an IpPermission struct with a configured +// UserIdGroupPair for the groupid given. Used in +// TestAccAWSSecurityGroup_forceRevokeRules_should_fail to create a cyclic rule +// between 2 security groups +func cycleIpPermForGroup(groupId string) *ec2.IpPermission { + var perm ec2.IpPermission + perm.FromPort = aws.Int64(0) + perm.ToPort = aws.Int64(0) + perm.IpProtocol = aws.String("icmp") + perm.UserIdGroupPairs = make([]*ec2.UserIdGroupPair, 1) + perm.UserIdGroupPairs[0] = &ec2.UserIdGroupPair{ + GroupId: aws.String(groupId), + } + return &perm +} + +// testAddRuleCycle returns a TestCheckFunc to use at the end of a test, such +// that a Security Group Rule cyclic dependency will be created between the two +// Security Groups. A companion function, testRemoveRuleCycle, will undo this. +func testAddRuleCycle(primary, secondary *ec2.SecurityGroup) resource.TestCheckFunc { + return func(s *terraform.State) error { + if primary.GroupId == nil { + return fmt.Errorf("Primary SG not set for TestAccAWSSecurityGroup_forceRevokeRules_should_fail") + } + if secondary.GroupId == nil { + return fmt.Errorf("Secondary SG not set for TestAccAWSSecurityGroup_forceRevokeRules_should_fail") + } + + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + // cycle from primary to secondary + perm1 := cycleIpPermForGroup(*secondary.GroupId) + // cycle from secondary to primary + perm2 := cycleIpPermForGroup(*primary.GroupId) + + req1 := &ec2.AuthorizeSecurityGroupEgressInput{ + GroupId: primary.GroupId, + IpPermissions: []*ec2.IpPermission{perm1}, + } + req2 := &ec2.AuthorizeSecurityGroupEgressInput{ + GroupId: secondary.GroupId, + IpPermissions: []*ec2.IpPermission{perm2}, + } + + var err error + _, err = conn.AuthorizeSecurityGroupEgress(req1) + if err != nil { + return fmt.Errorf( + "Error authorizing primary security group %s rules: %s", *primary.GroupId, + err) + } + _, err = conn.AuthorizeSecurityGroupEgress(req2) + if err != nil { + return fmt.Errorf( + "Error authorizing secondary security group %s rules: %s", *secondary.GroupId, + err) + } + return nil + } +} + +// testRemoveRuleCycle removes the cyclic dependency between two security groups +// that was added in testAddRuleCycle +func testRemoveRuleCycle(primary, secondary *ec2.SecurityGroup) resource.TestCheckFunc { + return func(s *terraform.State) error { + if primary.GroupId == nil { + return fmt.Errorf("Primary SG not set for TestAccAWSSecurityGroup_forceRevokeRules_should_fail") + } + if secondary.GroupId == nil { + return fmt.Errorf("Secondary SG not set for TestAccAWSSecurityGroup_forceRevokeRules_should_fail") + } + + conn := testAccProvider.Meta().(*AWSClient).ec2conn + for _, sg := range []*ec2.SecurityGroup{primary, secondary} { + var err error + if sg.IpPermissions != nil { + req := &ec2.RevokeSecurityGroupIngressInput{ + GroupId: sg.GroupId, + IpPermissions: sg.IpPermissions, + } - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSSecurityGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSSecurityGroupConfig_drift_complex(), - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), - resource.TestCheckResourceAttr("aws_security_group.web", "description", "Used in the terraform acceptance tests"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.#", "3"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.cidr_blocks.0", "10.0.0.0/8"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.description", ""), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.prefix_list_ids.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.to_port", "8000"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.657243763.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.657243763.cidr_blocks.0", "206.0.0.0/8"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.657243763.description", ""), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.657243763.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.657243763.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.657243763.prefix_list_ids.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.657243763.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.657243763.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.657243763.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.657243763.to_port", "8000"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.#", "3"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.cidr_blocks.0", "10.0.0.0/8"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.description", ""), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3629188364.to_port", "8000"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.cidr_blocks.0", "206.0.0.0/8"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.description", ""), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.657243763.to_port", "8000"), - ), - }, - }, - }) -} + if _, err = conn.RevokeSecurityGroupIngress(req); err != nil { + return fmt.Errorf( + "Error revoking default ingress rule for Security Group in testRemoveCycle (%s): %s", + *primary.GroupId, err) + } + } -func TestAccAWSSecurityGroup_invalidCIDRBlock(t *testing.T) { - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSSecurityGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSSecurityGroupInvalidIngressCidr, - ExpectError: regexp.MustCompile("invalid CIDR address: 1.2.3.4/33"), - }, - { - Config: testAccAWSSecurityGroupInvalidEgressCidr, - ExpectError: regexp.MustCompile("invalid CIDR address: 1.2.3.4/33"), - }, - { - Config: testAccAWSSecurityGroupInvalidIPv6IngressCidr, - ExpectError: regexp.MustCompile("invalid CIDR address: ::/244"), - }, - { - Config: testAccAWSSecurityGroupInvalidIPv6EgressCidr, - ExpectError: regexp.MustCompile("invalid CIDR address: ::/244"), - }, - }, - }) + if sg.IpPermissionsEgress != nil { + req := &ec2.RevokeSecurityGroupEgressInput{ + GroupId: sg.GroupId, + IpPermissions: sg.IpPermissionsEgress, + } + + if _, err = conn.RevokeSecurityGroupEgress(req); err != nil { + return fmt.Errorf( + "Error revoking default egress rule for Security Group in testRemoveCycle (%s): %s", + *sg.GroupId, err) + } + } + } + return nil + } } func testAccCheckAWSSecurityGroupDestroy(s *terraform.State) error { @@ -1777,24 +2098,6 @@ func testAccCheckAWSSecurityGroupDestroy(s *terraform.State) error { return nil } -func testAccCheckAWSSecurityGroupGeneratedNamePrefix( - resource, prefix string) resource.TestCheckFunc { - return func(s *terraform.State) error { - r, ok := s.RootModule().Resources[resource] - if !ok { - return fmt.Errorf("Resource not found") - } - name, ok := r.Primary.Attributes["name"] - if !ok { - return fmt.Errorf("Name attr not found: %#v", r.Primary.Attributes) - } - if !strings.HasPrefix(name, prefix) { - return fmt.Errorf("Name: %q, does not have prefix: %q", name, prefix) - } - return nil - } -} - func testAccCheckAWSSecurityGroupExists(n string, group *ec2.SecurityGroup) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[n] @@ -1888,210 +2191,6 @@ func testAccCheckAWSSecurityGroupAttributesNegOneProtocol(group *ec2.SecurityGro } } -func TestAccAWSSecurityGroup_tags(t *testing.T) { - var group ec2.SecurityGroup - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSSecurityGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSSecurityGroupConfigTags, - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.foo", &group), - testAccCheckTags(&group.Tags, "foo", "bar"), - ), - }, - - { - Config: testAccAWSSecurityGroupConfigTagsUpdate, - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.foo", &group), - testAccCheckTags(&group.Tags, "foo", ""), - testAccCheckTags(&group.Tags, "bar", "baz"), - testAccCheckTags(&group.Tags, "env", "Production"), - ), - }, - }, - }) -} - -func TestAccAWSSecurityGroup_CIDRandGroups(t *testing.T) { - var group ec2.SecurityGroup - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSSecurityGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSSecurityGroupCombindCIDRandGroups, - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.mixed", &group), - // testAccCheckAWSSecurityGroupAttributes(&group), - ), - }, - }, - }) -} - -func TestAccAWSSecurityGroup_ingressWithCidrAndSGs(t *testing.T) { - var group ec2.SecurityGroup - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSSecurityGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSSecurityGroupConfig_ingressWithCidrAndSGs, - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), - testAccCheckAWSSecurityGroupSGandCidrAttributes(&group), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.cidr_blocks.0", "10.0.0.0/8"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.description", ""), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.from_port", "80"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.prefix_list_ids.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.3629188364.to_port", "8000"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.#", "2"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.cidr_blocks.0", "192.168.0.1/32"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.description", ""), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.from_port", "22"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.to_port", "22"), - ), - }, - }, - }) -} - -func TestAccAWSSecurityGroup_ingressWithCidrAndSGs_classic(t *testing.T) { - var group ec2.SecurityGroup - - oldvar := os.Getenv("AWS_DEFAULT_REGION") - os.Setenv("AWS_DEFAULT_REGION", "us-east-1") - defer os.Setenv("AWS_DEFAULT_REGION", oldvar) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t); testAccEC2ClassicPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSSecurityGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSSecurityGroupConfig_ingressWithCidrAndSGs_classic, - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.web", &group), - testAccCheckAWSSecurityGroupSGandCidrAttributes(&group), - resource.TestCheckResourceAttr("aws_security_group.web", "egress.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.#", "2"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.cidr_blocks.0", "192.168.0.1/32"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.description", ""), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.from_port", "22"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.protocol", "tcp"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.web", "ingress.3893008652.to_port", "22"), - ), - }, - }, - }) -} - -func TestAccAWSSecurityGroup_egressWithPrefixList(t *testing.T) { - var group ec2.SecurityGroup - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSSecurityGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSSecurityGroupConfigPrefixListEgress, - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.egress", &group), - testAccCheckAWSSecurityGroupEgressPrefixListAttributes(&group), - resource.TestCheckResourceAttr( - "aws_security_group.egress", "egress.#", "1"), - ), - }, - }, - }) -} - -func TestAccAWSSecurityGroup_ingressWithPrefixList(t *testing.T) { - var group ec2.SecurityGroup - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSSecurityGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSSecurityGroupConfigPrefixListIngress, - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.ingress", &group), - testAccCheckAWSSecurityGroupIngressPrefixListAttributes(&group), - resource.TestCheckResourceAttr( - "aws_security_group.ingress", "ingress.#", "1"), - ), - }, - }, - }) -} - -func TestAccAWSSecurityGroup_ipv4andipv6Egress(t *testing.T) { - var group ec2.SecurityGroup - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSSecurityGroupDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSSecurityGroupConfigIpv4andIpv6Egress, - Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSecurityGroupExists("aws_security_group.egress", &group), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.#", "2"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.482069346.cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.482069346.cidr_blocks.0", "0.0.0.0/0"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.482069346.description", ""), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.482069346.from_port", "0"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.482069346.ipv6_cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.482069346.prefix_list_ids.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.482069346.protocol", "-1"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.482069346.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.482069346.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.482069346.to_port", "0"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.706749478.cidr_blocks.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.706749478.description", ""), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.706749478.from_port", "0"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.706749478.ipv6_cidr_blocks.#", "1"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.706749478.ipv6_cidr_blocks.0", "::/0"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.706749478.prefix_list_ids.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.706749478.protocol", "-1"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.706749478.security_groups.#", "0"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.706749478.self", "false"), - resource.TestCheckResourceAttr("aws_security_group.egress", "egress.706749478.to_port", "0"), - resource.TestCheckResourceAttr("aws_security_group.egress", "ingress.#", "0"), - ), - }, - }, - }) -} - // testAccAWSSecurityGroupRulesPerGroupLimitFromEnv returns security group rules per group limit // Currently this information is not available from any EC2 or Trusted Advisor API // Prefers the EC2_SECURITY_GROUP_RULES_PER_GROUP_LIMIT environment variable or defaults to 50 @@ -2652,7 +2751,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "web" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_desc_example" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -2686,7 +2785,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "web" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -2719,7 +2818,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "web" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -2848,7 +2947,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "web" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -2886,7 +2985,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "web" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -2922,7 +3021,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "web" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -2951,7 +3050,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "web" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -2980,7 +3079,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "web" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -3002,7 +3101,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "web" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -3024,7 +3123,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "worker" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example_1" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -3044,7 +3143,7 @@ resource "aws_security_group" "worker" { } } -resource "aws_security_group" "web" { +resource "aws_security_group" "test2" { name = "terraform_acceptance_test_example_2" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -3067,7 +3166,7 @@ resource "aws_security_group" "web" { protocol = "tcp" from_port = 80 to_port = 8000 - security_groups = ["${aws_security_group.worker.id}"] + security_groups = ["${aws_security_group.test.id}"] } egress { @@ -3087,7 +3186,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "foo" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -3106,7 +3205,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "foo" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -3126,7 +3225,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "web" { +resource "aws_security_group" "test" { vpc_id = "${aws_vpc.foo.id}" tags = { @@ -3143,7 +3242,7 @@ resource "aws_vpc" "tf_sg_egress_test" { } } -resource "aws_security_group" "worker" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example_1" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.tf_sg_egress_test.id}" @@ -3158,26 +3257,32 @@ resource "aws_security_group" "worker" { ` const testAccAWSSecurityGroupConfigClassic = ` -resource "aws_security_group" "web" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example_1" description = "Used in the terraform acceptance tests" } ` -const testAccAWSSecurityGroupPrefixNameConfig = ` -provider "aws" { - region = "us-east-1" +func testAccAWSSecurityGroupPrefixNameConfig(namePrefix string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + + tags = { + Name = "tf-acc-test-security-group-name-prefix" + } } -resource "aws_security_group" "baz" { - name_prefix = "baz-" - description = "Used in the terraform acceptance tests" +resource "aws_security_group" "test" { + name_prefix = %[1]q + vpc_id = aws_vpc.test.id +} +`, namePrefix) } -` func testAccAWSSecurityGroupConfig_drift() string { return fmt.Sprintf(` -resource "aws_security_group" "web" { +resource "aws_security_group" "test" { name = "tf_acc_%d" description = "Used in the terraform acceptance tests" @@ -3212,13 +3317,13 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "otherweb" { +resource "aws_security_group" "test2" { name = "tf_acc_%d" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" } -resource "aws_security_group" "web" { +resource "aws_security_group" "test" { name = "tf_acc_%d" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -3241,7 +3346,7 @@ resource "aws_security_group" "web" { protocol = "tcp" from_port = 22 to_port = 22 - security_groups = ["${aws_security_group.otherweb.id}"] + security_groups = ["${aws_security_group.test2.id}"] } egress { @@ -3262,7 +3367,7 @@ resource "aws_security_group" "web" { protocol = "tcp" from_port = 22 to_port = 22 - security_groups = ["${aws_security_group.otherweb.id}"] + security_groups = ["${aws_security_group.test2.id}"] } tags = { @@ -3273,7 +3378,7 @@ resource "aws_security_group" "web" { } const testAccAWSSecurityGroupInvalidIngressCidr = ` -resource "aws_security_group" "foo" { +resource "aws_security_group" "test" { name = "testing-foo" description = "foo-testing" ingress { @@ -3285,7 +3390,7 @@ resource "aws_security_group" "foo" { }` const testAccAWSSecurityGroupInvalidEgressCidr = ` -resource "aws_security_group" "foo" { +resource "aws_security_group" "test" { name = "testing-foo" description = "foo-testing" egress { @@ -3297,7 +3402,7 @@ resource "aws_security_group" "foo" { }` const testAccAWSSecurityGroupInvalidIPv6IngressCidr = ` -resource "aws_security_group" "foo" { +resource "aws_security_group" "test" { name = "testing-foo" description = "foo-testing" ingress { @@ -3309,7 +3414,7 @@ resource "aws_security_group" "foo" { }` const testAccAWSSecurityGroupInvalidIPv6EgressCidr = ` -resource "aws_security_group" "foo" { +resource "aws_security_group" "test" { name = "testing-foo" description = "foo-testing" egress { @@ -3352,7 +3457,7 @@ resource "aws_security_group" "three" { } } -resource "aws_security_group" "mixed" { +resource "aws_security_group" "test" { name = "tf-mix-test" vpc_id = "${aws_vpc.foo.id}" @@ -3383,7 +3488,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "other_web" { +resource "aws_security_group" "test2" { name = "tf_other_acc_tests" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -3393,7 +3498,7 @@ resource "aws_security_group" "other_web" { } } -resource "aws_security_group" "web" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -3413,7 +3518,7 @@ resource "aws_security_group" "web" { from_port = 80 to_port = 8000 cidr_blocks = ["10.0.0.0/8"] - security_groups = ["${aws_security_group.other_web.id}"] + security_groups = ["${aws_security_group.test2.id}"] } egress { @@ -3430,7 +3535,7 @@ resource "aws_security_group" "web" { ` const testAccAWSSecurityGroupConfig_ingressWithCidrAndSGs_classic = ` -resource "aws_security_group" "other_web" { +resource "aws_security_group" "test2" { name = "tf_other_acc_tests" description = "Used in the terraform acceptance tests" @@ -3439,7 +3544,7 @@ resource "aws_security_group" "other_web" { } } -resource "aws_security_group" "web" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example" description = "Used in the terraform acceptance tests" @@ -3458,7 +3563,7 @@ resource "aws_security_group" "web" { from_port = 80 to_port = 8000 cidr_blocks = ["10.0.0.0/8"] - security_groups = ["${aws_security_group.other_web.name}"] + security_groups = ["${aws_security_group.test2.name}"] } tags = { @@ -3513,16 +3618,16 @@ resource "aws_security_group" "nat" { } } ` -const testAccAWSSecurityGroupConfig_importSelf = ` +const testAccAWSSecurityGroupConfig_allowAll = ` resource "aws_vpc" "foo" { cidr_block = "10.1.0.0/16" tags = { - Name = "terraform-testacc-security-group-import-self" + Name = "terraform-testacc-security-group-allow-all" } } -resource "aws_security_group" "allow_all" { +resource "aws_security_group" "test" { name = "allow_all" description = "Allow all inbound traffic" vpc_id = "${aws_vpc.foo.id}" @@ -3535,7 +3640,7 @@ resource "aws_security_group_rule" "allow_all" { protocol = "tcp" cidr_blocks = ["0.0.0.0/0"] - security_group_id = "${aws_security_group.allow_all.id}" + security_group_id = "${aws_security_group.test.id}" } resource "aws_security_group_rule" "allow_all-1" { @@ -3545,56 +3650,56 @@ resource "aws_security_group_rule" "allow_all-1" { protocol = "tcp" self = true - security_group_id = "${aws_security_group.allow_all.id}" + security_group_id = "${aws_security_group.test.id}" } ` -const testAccAWSSecurityGroupConfig_importSourceSecurityGroup = ` +const testAccAWSSecurityGroupConfig_sourceSecurityGroup = ` resource "aws_vpc" "foo" { cidr_block = "10.1.0.0/16" tags = { - Name = "terraform-testacc-security-group-import-source-sg" + Name = "terraform-testacc-security-group-source-sg" } } -resource "aws_security_group" "test_group_1" { +resource "aws_security_group" "test" { name = "test group 1" vpc_id = "${aws_vpc.foo.id}" } -resource "aws_security_group" "test_group_2" { +resource "aws_security_group" "test2" { name = "test group 2" vpc_id = "${aws_vpc.foo.id}" } -resource "aws_security_group" "test_group_3" { +resource "aws_security_group" "test3" { name = "test group 3" vpc_id = "${aws_vpc.foo.id}" } -resource "aws_security_group_rule" "allow_test_group_2" { +resource "aws_security_group_rule" "allow_test2" { type = "ingress" from_port = 0 to_port = 0 protocol = "tcp" - source_security_group_id = "${aws_security_group.test_group_1.id}" - security_group_id = "${aws_security_group.test_group_2.id}" + source_security_group_id = "${aws_security_group.test.id}" + security_group_id = "${aws_security_group.test2.id}" } -resource "aws_security_group_rule" "allow_test_group_3" { +resource "aws_security_group_rule" "allow_test3" { type = "ingress" from_port = 0 to_port = 0 protocol = "tcp" - source_security_group_id = "${aws_security_group.test_group_1.id}" - security_group_id = "${aws_security_group.test_group_3.id}" + source_security_group_id = "${aws_security_group.test.id}" + security_group_id = "${aws_security_group.test3.id}" } ` -const testAccAWSSecurityGroupConfig_importIPRangeAndSecurityGroupWithSameRules = ` +const testAccAWSSecurityGroupConfig_IPRangeAndSecurityGroupWithSameRules = ` resource "aws_vpc" "foo" { cidr_block = "10.1.0.0/16" @@ -3603,12 +3708,12 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "test_group_1" { +resource "aws_security_group" "test" { name = "test group 1" vpc_id = "${aws_vpc.foo.id}" } -resource "aws_security_group" "test_group_2" { +resource "aws_security_group" "test2" { name = "test group 2" vpc_id = "${aws_vpc.foo.id}" } @@ -3619,8 +3724,8 @@ resource "aws_security_group_rule" "allow_security_group" { to_port = 0 protocol = "tcp" - source_security_group_id = "${aws_security_group.test_group_2.id}" - security_group_id = "${aws_security_group.test_group_1.id}" + source_security_group_id = "${aws_security_group.test2.id}" + security_group_id = "${aws_security_group.test.id}" } resource "aws_security_group_rule" "allow_cidr_block" { @@ -3630,7 +3735,7 @@ resource "aws_security_group_rule" "allow_cidr_block" { protocol = "tcp" cidr_blocks = ["10.0.0.0/32"] - security_group_id = "${aws_security_group.test_group_1.id}" + security_group_id = "${aws_security_group.test.id}" } resource "aws_security_group_rule" "allow_ipv6_cidr_block" { @@ -3640,11 +3745,11 @@ resource "aws_security_group_rule" "allow_ipv6_cidr_block" { protocol = "tcp" ipv6_cidr_blocks = ["::/0"] - security_group_id = "${aws_security_group.test_group_1.id}" + security_group_id = "${aws_security_group.test.id}" } ` -const testAccAWSSecurityGroupConfig_importIPRangesWithSameRules = ` +const testAccAWSSecurityGroupConfig_IPRangesWithSameRules = ` resource "aws_vpc" "foo" { cidr_block = "10.1.0.0/16" @@ -3653,7 +3758,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "test_group_1" { +resource "aws_security_group" "test" { name = "test group 1" vpc_id = "${aws_vpc.foo.id}" } @@ -3665,7 +3770,7 @@ resource "aws_security_group_rule" "allow_cidr_block" { protocol = "tcp" cidr_blocks = ["10.0.0.0/32"] - security_group_id = "${aws_security_group.test_group_1.id}" + security_group_id = "${aws_security_group.test.id}" } resource "aws_security_group_rule" "allow_ipv6_cidr_block" { @@ -3675,7 +3780,7 @@ resource "aws_security_group_rule" "allow_ipv6_cidr_block" { protocol = "tcp" ipv6_cidr_blocks = ["::/0"] - security_group_id = "${aws_security_group.test_group_1.id}" + security_group_id = "${aws_security_group.test.id}" } ` @@ -3688,7 +3793,7 @@ resource "aws_vpc" "foo" { } } -resource "aws_security_group" "egress" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_example" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.foo.id}" @@ -3741,7 +3846,7 @@ resource "aws_vpc_endpoint" "test" { POLICY } -resource "aws_security_group" "egress" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_prefix_list_egress" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.tf_sg_prefix_list_egress_test.id}" @@ -3789,7 +3894,7 @@ resource "aws_vpc_endpoint" "test" { POLICY } -resource "aws_security_group" "ingress" { +resource "aws_security_group" "test" { name = "terraform_acceptance_test_prefix_list_ingress" description = "Used in the terraform acceptance tests" vpc_id = "${aws_vpc.tf_sg_prefix_list_ingress_test.id}" diff --git a/aws/resource_aws_securityhub_product_subscription.go b/aws/resource_aws_securityhub_product_subscription.go index 7ae0a98b3f3..358aecb9b61 100644 --- a/aws/resource_aws_securityhub_product_subscription.go +++ b/aws/resource_aws_securityhub_product_subscription.go @@ -73,6 +73,7 @@ func resourceAwsSecurityHubProductSubscriptionRead(d *schema.ResourceData, meta if !exists { log.Printf("[WARN] Security Hub product subscriptions (%s) not found, removing from state", d.Id()) d.SetId("") + return nil } d.Set("product_arn", productArn) diff --git a/aws/resource_aws_service_discovery_private_dns_namespace_test.go b/aws/resource_aws_service_discovery_private_dns_namespace_test.go index 7ec261a4a11..18364ebca65 100644 --- a/aws/resource_aws_service_discovery_private_dns_namespace_test.go +++ b/aws/resource_aws_service_discovery_private_dns_namespace_test.go @@ -57,7 +57,6 @@ func TestAccAWSServiceDiscoveryPrivateDnsNamespace_longname(t *testing.T) { // * https://github.com/terraform-providers/terraform-provider-aws/issues/5532 func TestAccAWSServiceDiscoveryPrivateDnsNamespace_error_Overlap(t *testing.T) { rName := acctest.RandString(5) + ".example.com" - subDomain := acctest.RandString(5) + "." + rName resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSServiceDiscovery(t) }, @@ -65,7 +64,7 @@ func TestAccAWSServiceDiscoveryPrivateDnsNamespace_error_Overlap(t *testing.T) { CheckDestroy: testAccCheckAwsServiceDiscoveryPrivateDnsNamespaceDestroy, Steps: []resource.TestStep{ { - Config: testAccServiceDiscoveryPrivateDnsNamespaceConfigOverlapping(rName, subDomain), + Config: testAccServiceDiscoveryPrivateDnsNamespaceConfigOverlapping(rName), ExpectError: regexp.MustCompile(`overlapping name space`), }, }, @@ -140,7 +139,7 @@ resource "aws_service_discovery_private_dns_namespace" "test" { `, rName) } -func testAccServiceDiscoveryPrivateDnsNamespaceConfigOverlapping(topDomain, subDomain string) string { +func testAccServiceDiscoveryPrivateDnsNamespaceConfigOverlapping(topDomain string) string { return fmt.Sprintf(` resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" @@ -157,8 +156,8 @@ resource "aws_service_discovery_private_dns_namespace" "top" { # Ensure ordering after first namespace resource "aws_service_discovery_private_dns_namespace" "subdomain" { - name = %q + name = "${aws_service_discovery_private_dns_namespace.top.name}" vpc = "${aws_service_discovery_private_dns_namespace.top.vpc}" } -`, topDomain, subDomain) +`, topDomain) } diff --git a/aws/resource_aws_service_discovery_service_test.go b/aws/resource_aws_service_discovery_service_test.go index 485d69c60fd..79792dc1012 100644 --- a/aws/resource_aws_service_discovery_service_test.go +++ b/aws/resource_aws_service_discovery_service_test.go @@ -93,7 +93,7 @@ func TestAccAWSServiceDiscoveryService_public(t *testing.T) { } func TestAccAWSServiceDiscoveryService_http(t *testing.T) { - rName := acctest.RandString(5) + rName := acctest.RandStringFromCharSet(5, acctest.CharSetAlpha) resourceName := "aws_service_discovery_service.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/aws/resource_aws_servicecatalog_portfolio.go b/aws/resource_aws_servicecatalog_portfolio.go index 102618d23a3..95e34a8edd5 100644 --- a/aws/resource_aws_servicecatalog_portfolio.go +++ b/aws/resource_aws_servicecatalog_portfolio.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsServiceCatalogPortfolio() *schema.Resource { @@ -65,6 +66,7 @@ func resourceAwsServiceCatalogPortfolioCreate(d *schema.ResourceData, meta inter AcceptLanguage: aws.String("en"), DisplayName: aws.String(d.Get("name").(string)), IdempotencyToken: aws.String(resource.UniqueId()), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().ServicecatalogTags(), } if v, ok := d.GetOk("description"); ok { @@ -75,19 +77,6 @@ func resourceAwsServiceCatalogPortfolioCreate(d *schema.ResourceData, meta inter input.ProviderName = aws.String(v.(string)) } - if v, ok := d.GetOk("tags"); ok { - tags := []*servicecatalog.Tag{} - t := v.(map[string]interface{}) - for k, v := range t { - tag := servicecatalog.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - tags = append(tags, &tag) - } - input.Tags = tags - } - log.Printf("[DEBUG] Creating Service Catalog Portfolio: %#v", input) resp, err := conn.CreatePortfolio(&input) if err != nil { @@ -123,11 +112,11 @@ func resourceAwsServiceCatalogPortfolioRead(d *schema.ResourceData, meta interfa d.Set("description", portfolioDetail.Description) d.Set("name", portfolioDetail.DisplayName) d.Set("provider_name", portfolioDetail.ProviderName) - tags := map[string]string{} - for _, tag := range resp.Tags { - tags[*tag.Key] = *tag.Value + + if err := d.Set("tags", keyvaluetags.ServicecatalogKeyValueTags(resp.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } - d.Set("tags", tags) + return nil } @@ -159,15 +148,10 @@ func resourceAwsServiceCatalogPortfolioUpdate(d *schema.ResourceData, meta inter } if d.HasChange("tags") { - currentTags, requiredTags := d.GetChange("tags") - log.Printf("[DEBUG] Current Tags: %#v", currentTags) - log.Printf("[DEBUG] Required Tags: %#v", requiredTags) + o, n := d.GetChange("tags") - tagsToAdd, tagsToRemove := tagUpdates(requiredTags.(map[string]interface{}), currentTags.(map[string]interface{})) - log.Printf("[DEBUG] Tags To Add: %#v", tagsToAdd) - log.Printf("[DEBUG] Tags To Remove: %#v", tagsToRemove) - input.AddTags = tagsToAdd - input.RemoveTags = tagsToRemove + input.AddTags = keyvaluetags.New(n).IgnoreAws().ServicecatalogTags() + input.RemoveTags = aws.StringSlice(keyvaluetags.New(o).IgnoreAws().Keys()) } log.Printf("[DEBUG] Update Service Catalog Portfolio: %#v", input) @@ -178,38 +162,6 @@ func resourceAwsServiceCatalogPortfolioUpdate(d *schema.ResourceData, meta inter return resourceAwsServiceCatalogPortfolioRead(d, meta) } -func tagUpdates(requriedTags, currentTags map[string]interface{}) ([]*servicecatalog.Tag, []*string) { - var tagsToAdd []*servicecatalog.Tag - var tagsToRemove []*string - - for rk, rv := range requriedTags { - addTag := true - for ck, cv := range currentTags { - if (rk == ck) && (rv.(string) == cv.(string)) { - addTag = false - } - } - if addTag { - tag := &servicecatalog.Tag{Key: aws.String(rk), Value: aws.String(rv.(string))} - tagsToAdd = append(tagsToAdd, tag) - } - } - - for ck, cv := range currentTags { - removeTag := true - for rk, rv := range requriedTags { - if (rk == ck) && (rv.(string) == cv.(string)) { - removeTag = false - } - } - if removeTag { - tagsToRemove = append(tagsToRemove, aws.String(ck)) - } - } - - return tagsToAdd, tagsToRemove -} - func resourceAwsServiceCatalogPortfolioDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).scconn input := servicecatalog.DeletePortfolioInput{} diff --git a/aws/resource_aws_servicecatalog_portfolio_test.go b/aws/resource_aws_servicecatalog_portfolio_test.go index 659c4da5c96..63e51594c39 100644 --- a/aws/resource_aws_servicecatalog_portfolio_test.go +++ b/aws/resource_aws_servicecatalog_portfolio_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "regexp" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/servicecatalog" @@ -24,16 +25,15 @@ func TestAccAWSServiceCatalogPortfolio_Basic(t *testing.T) { CheckDestroy: testAccCheckServiceCatlaogPortfolioDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckAwsServiceCatalogPortfolioResourceConfigBasic1(name), + Config: testAccCheckAwsServiceCatalogPortfolioResourceConfigBasic(name), Check: resource.ComposeTestCheckFunc( testAccCheckPortfolio(resourceName, &dpo), - resource.TestCheckResourceAttrSet(resourceName, "arn"), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "catalog", regexp.MustCompile(`portfolio/.+`)), resource.TestCheckResourceAttrSet(resourceName, "created_time"), resource.TestCheckResourceAttr(resourceName, "name", name), resource.TestCheckResourceAttr(resourceName, "description", "test-2"), resource.TestCheckResourceAttr(resourceName, "provider_name", "test-3"), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.Key1", "Value One"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { @@ -41,40 +41,35 @@ func TestAccAWSServiceCatalogPortfolio_Basic(t *testing.T) { ImportState: true, ImportStateVerify: true, }, + }, + }) +} + +func TestAccAWSServiceCatalogPortfolio_Disappears(t *testing.T) { + name := acctest.RandString(5) + resourceName := "aws_servicecatalog_portfolio.test" + var dpo servicecatalog.DescribePortfolioOutput + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckServiceCatlaogPortfolioDestroy, + Steps: []resource.TestStep{ { - Config: testAccCheckAwsServiceCatalogPortfolioResourceConfigBasic2(name), - Check: resource.ComposeTestCheckFunc( - testAccCheckPortfolio(resourceName, &dpo), - resource.TestCheckResourceAttrSet(resourceName, "arn"), - resource.TestCheckResourceAttrSet(resourceName, "created_time"), - resource.TestCheckResourceAttr(resourceName, "name", name), - resource.TestCheckResourceAttr(resourceName, "description", "test-b"), - resource.TestCheckResourceAttr(resourceName, "provider_name", "test-c"), - resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags.Key1", "Value 1"), - resource.TestCheckResourceAttr(resourceName, "tags.Key2", "Value Two"), - ), - }, - { - Config: testAccCheckAwsServiceCatalogPortfolioResourceConfigBasic3(name), + Config: testAccCheckAwsServiceCatalogPortfolioResourceConfigBasic(name), Check: resource.ComposeTestCheckFunc( testAccCheckPortfolio(resourceName, &dpo), - resource.TestCheckResourceAttrSet(resourceName, "arn"), - resource.TestCheckResourceAttrSet(resourceName, "created_time"), - resource.TestCheckResourceAttr(resourceName, "name", name), - resource.TestCheckResourceAttr(resourceName, "description", "test-only-change-me"), - resource.TestCheckResourceAttr(resourceName, "provider_name", "test-c"), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.Key3", "Value Three"), + testAccCheckServiceCatlaogPortfolioDisappears(&dpo), ), + ExpectNonEmptyPlan: true, }, }, }) } -func TestAccAWSServiceCatalogPortfolio_Disappears(t *testing.T) { - name := acctest.RandString(5) +func TestAccAWSServiceCatalogPortfolio_Tags(t *testing.T) { resourceName := "aws_servicecatalog_portfolio.test" + name := acctest.RandString(5) var dpo servicecatalog.DescribePortfolioOutput resource.ParallelTest(t, resource.TestCase{ @@ -83,12 +78,37 @@ func TestAccAWSServiceCatalogPortfolio_Disappears(t *testing.T) { CheckDestroy: testAccCheckServiceCatlaogPortfolioDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckAwsServiceCatalogPortfolioResourceConfigBasic1(name), + Config: testAccCheckAwsServiceCatalogPortfolioResourceConfigTags1(name, "key1", "value1"), Check: resource.ComposeTestCheckFunc( testAccCheckPortfolio(resourceName, &dpo), - testAccCheckServiceCatlaogPortfolioDisappears(&dpo), + resource.TestCheckResourceAttr(resourceName, "name", name), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccCheckAwsServiceCatalogPortfolioResourceConfigTags2(name, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckPortfolio(resourceName, &dpo), + resource.TestCheckResourceAttr(resourceName, "name", name), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccCheckAwsServiceCatalogPortfolioResourceConfigTags1(name, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckPortfolio(resourceName, &dpo), + resource.TestCheckResourceAttr(resourceName, "name", name), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), - ExpectNonEmptyPlan: true, }, }, }) @@ -150,45 +170,41 @@ func testAccCheckServiceCatlaogPortfolioDestroy(s *terraform.State) error { return nil } -func testAccCheckAwsServiceCatalogPortfolioResourceConfigBasic1(name string) string { +func testAccCheckAwsServiceCatalogPortfolioResourceConfigBasic(name string) string { return fmt.Sprintf(` resource "aws_servicecatalog_portfolio" "test" { name = "%s" description = "test-2" provider_name = "test-3" - - tags = { - Key1 = "Value One" - } } `, name) } -func testAccCheckAwsServiceCatalogPortfolioResourceConfigBasic2(name string) string { +func testAccCheckAwsServiceCatalogPortfolioResourceConfigTags1(name, tagKey1, tagValue1 string) string { return fmt.Sprintf(` resource "aws_servicecatalog_portfolio" "test" { - name = "%s" + name = %[1]q description = "test-b" provider_name = "test-c" tags = { - Key1 = "Value 1" - Key2 = "Value Two" + %[2]q = %[3]q } } -`, name) +`, name, tagKey1, tagValue1) } -func testAccCheckAwsServiceCatalogPortfolioResourceConfigBasic3(name string) string { +func testAccCheckAwsServiceCatalogPortfolioResourceConfigTags2(name, tagKey1, tagValue1, tagKey2, tagValue2 string) string { return fmt.Sprintf(` resource "aws_servicecatalog_portfolio" "test" { - name = "%s" + name = %[1]q description = "test-only-change-me" provider_name = "test-c" tags = { - Key3 = "Value Three" + %[2]q = %[3]q + %[4]q = %[5]q } } -`, name) +`, name, tagKey1, tagValue1, tagKey2, tagValue2) } diff --git a/aws/resource_aws_servicequotas_service_quota.go b/aws/resource_aws_servicequotas_service_quota.go index a83ddcffd72..6452a3ec626 100644 --- a/aws/resource_aws_servicequotas_service_quota.go +++ b/aws/resource_aws_servicequotas_service_quota.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "log" "strings" "github.com/aws/aws-sdk-go/aws" @@ -129,6 +130,12 @@ func resourceAwsServiceQuotasServiceQuotaRead(d *schema.ResourceData, meta inter output, err := conn.GetServiceQuota(input) + if isAWSErr(err, servicequotas.ErrCodeNoSuchResourceException, "") { + log.Printf("[WARN] Service Quotas Service Quota (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + if err != nil { return fmt.Errorf("error getting Service Quotas Service Quota (%s): %s", d.Id(), err) } diff --git a/aws/resource_aws_ses_receipt_rule.go b/aws/resource_aws_ses_receipt_rule.go index e38e227ecc1..2aee9cc4a9e 100644 --- a/aws/resource_aws_ses_receipt_rule.go +++ b/aws/resource_aws_ses_receipt_rule.go @@ -447,10 +447,10 @@ func resourceAwsSesReceiptRuleRead(d *schema.ResourceData, meta interface{}) err } } - d.Set("enabled", *response.Rule.Enabled) + 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) + d.Set("scan_enabled", response.Rule.ScanEnabled) + d.Set("tls_policy", response.Rule.TlsPolicy) addHeaderActionList := []map[string]interface{}{} bounceActionList := []map[string]interface{}{} diff --git a/aws/resource_aws_sfn_activity.go b/aws/resource_aws_sfn_activity.go index 7f01931d292..fb0fba84afc 100644 --- a/aws/resource_aws_sfn_activity.go +++ b/aws/resource_aws_sfn_activity.go @@ -8,9 +8,9 @@ import ( "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-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsSfnActivity() *schema.Resource { @@ -46,7 +46,7 @@ func resourceAwsSfnActivityCreate(d *schema.ResourceData, meta interface{}) erro params := &sfn.CreateActivityInput{ Name: aws.String(d.Get("name").(string)), - Tags: tagsFromMapSfn(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().SfnTags(), } activity, err := conn.CreateActivity(params) @@ -63,38 +63,9 @@ func resourceAwsSfnActivityUpdate(d *schema.ResourceData, meta interface{}) erro conn := meta.(*AWSClient).sfnconn if d.HasChange("tags") { - oldTagsRaw, newTagsRaw := d.GetChange("tags") - oldTagsMap := oldTagsRaw.(map[string]interface{}) - newTagsMap := newTagsRaw.(map[string]interface{}) - createTags, removeTags := diffTagsSfn(tagsFromMapSfn(oldTagsMap), tagsFromMapSfn(newTagsMap)) - - if len(removeTags) > 0 { - removeTagKeys := make([]*string, len(removeTags)) - for i, removeTag := range removeTags { - removeTagKeys[i] = removeTag.Key - } - - input := &sfn.UntagResourceInput{ - ResourceArn: aws.String(d.Id()), - TagKeys: removeTagKeys, - } - - log.Printf("[DEBUG] Untagging State Function Activity: %s", input) - if _, err := conn.UntagResource(input); err != nil { - return fmt.Errorf("error untagging State Function Activity (%s): %s", d.Id(), err) - } - } - - if len(createTags) > 0 { - input := &sfn.TagResourceInput{ - ResourceArn: aws.String(d.Id()), - Tags: createTags, - } - - log.Printf("[DEBUG] Tagging State Function Activity: %s", input) - if _, err := conn.TagResource(input); err != nil { - return fmt.Errorf("error tagging State Function Activity (%s): %s", d.Id(), err) - } + o, n := d.GetChange("tags") + if err := keyvaluetags.SfnUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) } } @@ -122,17 +93,13 @@ func resourceAwsSfnActivityRead(d *schema.ResourceData, meta interface{}) error log.Printf("[DEBUG] Error setting creation_date: %s", err) } - tagsResp, err := conn.ListTagsForResource( - &sfn.ListTagsForResourceInput{ - ResourceArn: aws.String(d.Id()), - }, - ) + tags, err := keyvaluetags.SfnListTags(conn, d.Id()) if err != nil { - return fmt.Errorf("error listing SFN Activity (%s) tags: %s", d.Id(), err) + return fmt.Errorf("error listing tags for SFN Activity (%s): %s", d.Id(), err) } - if err := d.Set("tags", tagsToMapSfn(tagsResp.Tags)); err != nil { + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -146,20 +113,12 @@ func resourceAwsSfnActivityDelete(d *schema.ResourceData, meta interface{}) erro input := &sfn.DeleteActivityInput{ ActivityArn: aws.String(d.Id()), } - err := resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteActivity(input) - if err == nil { - return nil - } + _, err := conn.DeleteActivity(input) - return resource.NonRetryableError(err) - }) - if isResourceTimeoutError(err) { - _, err = conn.DeleteActivity(input) - } if err != nil { return fmt.Errorf("Error deleting SFN Activity: %s", err) } + return nil } diff --git a/aws/resource_aws_sfn_state_machine.go b/aws/resource_aws_sfn_state_machine.go index 1d735651982..d095d50b73f 100644 --- a/aws/resource_aws_sfn_state_machine.go +++ b/aws/resource_aws_sfn_state_machine.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsSfnStateMachine() *schema.Resource { @@ -65,7 +66,7 @@ func resourceAwsSfnStateMachineCreate(d *schema.ResourceData, meta interface{}) Definition: aws.String(d.Get("definition").(string)), Name: aws.String(d.Get("name").(string)), RoleArn: aws.String(d.Get("role_arn").(string)), - Tags: tagsFromMapSfn(d.Get("tags").(map[string]interface{})), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().SfnTags(), } var activity *sfn.CreateStateMachineOutput @@ -127,23 +128,13 @@ func resourceAwsSfnStateMachineRead(d *schema.ResourceData, meta interface{}) er log.Printf("[DEBUG] Error setting creation_date: %s", err) } - tags := map[string]string{} - - tagsResp, err := conn.ListTagsForResource( - &sfn.ListTagsForResourceInput{ - ResourceArn: aws.String(d.Id()), - }, - ) + tags, err := keyvaluetags.SfnListTags(conn, d.Id()) if err != nil && !isAWSErr(err, "UnknownOperationException", "") { - return fmt.Errorf("error listing SFN Activity (%s) tags: %s", d.Id(), err) - } - - if tagsResp != nil { - tags = tagsToMapSfn(tagsResp.Tags) + return fmt.Errorf("error listing tags for SFN State Machine (%s): %s", d.Id(), err) } - if err := d.Set("tags", tags); err != nil { + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -171,40 +162,12 @@ func resourceAwsSfnStateMachineUpdate(d *schema.ResourceData, meta interface{}) } if d.HasChange("tags") { - oldTagsRaw, newTagsRaw := d.GetChange("tags") - oldTagsMap := oldTagsRaw.(map[string]interface{}) - newTagsMap := newTagsRaw.(map[string]interface{}) - createTags, removeTags := diffTagsSfn(tagsFromMapSfn(oldTagsMap), tagsFromMapSfn(newTagsMap)) - - if len(removeTags) > 0 { - removeTagKeys := make([]*string, len(removeTags)) - for i, removeTag := range removeTags { - removeTagKeys[i] = removeTag.Key - } - - input := &sfn.UntagResourceInput{ - ResourceArn: aws.String(d.Id()), - TagKeys: removeTagKeys, - } - - log.Printf("[DEBUG] Untagging State Function: %s", input) - if _, err := conn.UntagResource(input); err != nil { - return fmt.Errorf("error untagging State Function (%s): %s", d.Id(), err) - } - } - - if len(createTags) > 0 { - input := &sfn.TagResourceInput{ - ResourceArn: aws.String(d.Id()), - Tags: createTags, - } - - log.Printf("[DEBUG] Tagging State Function: %s", input) - if _, err := conn.TagResource(input); err != nil { - return fmt.Errorf("error tagging State Function (%s): %s", d.Id(), err) - } + o, n := d.GetChange("tags") + if err := keyvaluetags.SfnUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) } } + return resourceAwsSfnStateMachineRead(d, meta) } @@ -215,20 +178,12 @@ func resourceAwsSfnStateMachineDelete(d *schema.ResourceData, meta interface{}) input := &sfn.DeleteStateMachineInput{ StateMachineArn: aws.String(d.Id()), } - err := resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteStateMachine(input) - if err == nil { - return nil - } + _, err := conn.DeleteStateMachine(input) - return resource.NonRetryableError(err) - }) - if isResourceTimeoutError(err) { - _, err = conn.DeleteStateMachine(input) - } if err != nil { return fmt.Errorf("Error deleting SFN state machine: %s", err) } + return nil } diff --git a/aws/resource_aws_sfn_state_machine_test.go b/aws/resource_aws_sfn_state_machine_test.go index a00933c29b7..beec17c2dbd 100644 --- a/aws/resource_aws_sfn_state_machine_test.go +++ b/aws/resource_aws_sfn_state_machine_test.go @@ -225,7 +225,7 @@ resource "aws_lambda_function" "lambda_function_test" { function_name = "sfn-%s" role = "${aws_iam_role.iam_for_lambda.arn}" handler = "exports.example" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } resource "aws_sfn_state_machine" "foo" { @@ -343,7 +343,7 @@ resource "aws_lambda_function" "lambda_function_test" { function_name = "sfn-%s" role = "${aws_iam_role.iam_for_lambda.arn}" handler = "exports.example" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } resource "aws_sfn_state_machine" "foo" { @@ -464,7 +464,7 @@ resource "aws_lambda_function" "lambda_function_test" { function_name = "sfn-%s" role = "${aws_iam_role.iam_for_lambda.arn}" handler = "exports.example" - runtime = "nodejs8.10" + runtime = "nodejs12.x" } resource "aws_sfn_state_machine" "foo" { diff --git a/aws/resource_aws_sns_topic.go b/aws/resource_aws_sns_topic.go index a3f593d6e18..271aafad90b 100644 --- a/aws/resource_aws_sns_topic.go +++ b/aws/resource_aws_sns_topic.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/structure" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) // Mutable attributes @@ -151,7 +152,7 @@ func resourceAwsSnsTopic() *schema.Resource { func resourceAwsSnsTopicCreate(d *schema.ResourceData, meta interface{}) error { snsconn := meta.(*AWSClient).snsconn - tags := tagsFromMapSNS(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().SnsTags() var name string if v, ok := d.GetOk("name"); ok { name = v.(string) @@ -174,7 +175,18 @@ func resourceAwsSnsTopicCreate(d *schema.ResourceData, meta interface{}) error { } d.SetId(*output.TopicArn) - return resourceAwsSnsTopicUpdate(d, meta) + + for terraformAttrName, snsAttrName := range SNSAttributeMap { + if d.HasChange(terraformAttrName) { + _, terraformAttrValue := d.GetChange(terraformAttrName) + err := updateAwsSnsTopicAttribute(d.Id(), snsAttrName, terraformAttrValue, snsconn) + if err != nil { + return err + } + } + } + + return resourceAwsSnsTopicRead(d, meta) } func resourceAwsSnsTopicUpdate(d *schema.ResourceData, meta interface{}) error { @@ -189,9 +201,11 @@ func resourceAwsSnsTopicUpdate(d *schema.ResourceData, meta interface{}) error { } } } - if !d.IsNewResource() { - if err := setTagsSNS(conn, d); err != nil { - return fmt.Errorf("error updating SNS Topic tags for %s: %s", d.Id(), err) + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.SnsUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) } } @@ -237,15 +251,13 @@ func resourceAwsSnsTopicRead(d *schema.ResourceData, meta interface{}) error { } } - // List tags + tags, err := keyvaluetags.SnsListTags(snsconn, d.Id()) - tagList, err := snsconn.ListTagsForResource(&sns.ListTagsForResourceInput{ - ResourceArn: aws.String(d.Id()), - }) if err != nil { - return fmt.Errorf("error listing SNS Topic tags for %s: %s", d.Id(), err) + return fmt.Errorf("error listing tags for resource (%s): %s", d.Id(), err) } - if err := d.Set("tags", tagsToMapSNS(tagList.Tags)); err != nil { + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { return fmt.Errorf("error setting tags: %s", err) } diff --git a/aws/resource_aws_sns_topic_subscription_test.go b/aws/resource_aws_sns_topic_subscription_test.go index 20b45c06c89..55c5887c6e0 100644 --- a/aws/resource_aws_sns_topic_subscription_test.go +++ b/aws/resource_aws_sns_topic_subscription_test.go @@ -759,7 +759,7 @@ resource "aws_lambda_function" "authorizer" { function_name = "tf-acc-test-authorizer-%d" role = "${aws_iam_role.iam_for_lambda.arn}" handler = "main.authenticate" - runtime = "nodejs8.10" + runtime = "nodejs12.x" environment { variables = { diff --git a/aws/resource_aws_sns_topic_test.go b/aws/resource_aws_sns_topic_test.go index eb34401f36c..229b1125335 100644 --- a/aws/resource_aws_sns_topic_test.go +++ b/aws/resource_aws_sns_topic_test.go @@ -14,126 +14,128 @@ import ( awspolicy "github.com/jen20/awspolicyequivalence" ) -func TestAccAWSSNSTopic_importBasic(t *testing.T) { - resourceName := "aws_sns_topic.test_topic" - rName := acctest.RandString(10) - - resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, - Providers: testAccProviders, - CheckDestroy: testAccCheckAWSSNSTopicDestroy, - Steps: []resource.TestStep{ - { - Config: testAccAWSSNSTopicConfig_withName(rName), - }, - - { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - }, - }, - }) -} - func TestAccAWSSNSTopic_basic(t *testing.T) { attributes := make(map[string]string) + resourceName := "aws_sns_topic.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_sns_topic.test_topic", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSNSTopicConfig_withGeneratedName, Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSNSTopicExists("aws_sns_topic.test_topic", attributes), + testAccCheckAWSSNSTopicExists(resourceName, attributes), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSSNSTopic_name(t *testing.T) { attributes := make(map[string]string) - + resourceName := "aws_sns_topic.test" rName := acctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_sns_topic.test_topic", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSNSTopicConfig_withName(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSNSTopicExists("aws_sns_topic.test_topic", attributes), + testAccCheckAWSSNSTopicExists(resourceName, attributes), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSSNSTopic_namePrefix(t *testing.T) { attributes := make(map[string]string) - + resourceName := "aws_sns_topic.test" startsWithPrefix := regexp.MustCompile("^terraform-test-topic-") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_sns_topic.test_topic", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSNSTopicConfig_withNamePrefix(), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSNSTopicExists("aws_sns_topic.test_topic", attributes), - resource.TestMatchResourceAttr("aws_sns_topic.test_topic", "name", startsWithPrefix), + testAccCheckAWSSNSTopicExists(resourceName, attributes), + resource.TestMatchResourceAttr(resourceName, "name", startsWithPrefix), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"name_prefix"}, + }, }, }) } func TestAccAWSSNSTopic_policy(t *testing.T) { attributes := make(map[string]string) - + resourceName := "aws_sns_topic.test" rName := acctest.RandString(10) expectedPolicy := `{"Statement":[{"Sid":"Stmt1445931846145","Effect":"Allow","Principal":{"AWS":"*"},"Action":"sns:Publish","Resource":"arn:aws:sns:us-west-2::example"}],"Version":"2012-10-17","Id":"Policy1445931846145"}` + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_sns_topic.test_topic", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSNSTopicWithPolicy(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSNSTopicExists("aws_sns_topic.test_topic", attributes), - testAccCheckAWSNSTopicHasPolicy("aws_sns_topic.test_topic", expectedPolicy), + testAccCheckAWSSNSTopicExists(resourceName, attributes), + testAccCheckAWSNSTopicHasPolicy(resourceName, expectedPolicy), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSSNSTopic_withIAMRole(t *testing.T) { attributes := make(map[string]string) - + resourceName := "aws_sns_topic.test" rName := acctest.RandString(10) + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_sns_topic.test_topic", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSNSTopicConfig_withIAMRole(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSNSTopicExists("aws_sns_topic.test_topic", attributes), + testAccCheckAWSSNSTopicExists(resourceName, attributes), ), }, }, @@ -144,7 +146,7 @@ func TestAccAWSSNSTopic_withFakeIAMRole(t *testing.T) { rName := acctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_sns_topic.test_topic", + IDRefreshName: "aws_sns_topic.test", Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, Steps: []resource.TestStep{ @@ -158,29 +160,35 @@ func TestAccAWSSNSTopic_withFakeIAMRole(t *testing.T) { func TestAccAWSSNSTopic_withDeliveryPolicy(t *testing.T) { attributes := make(map[string]string) - + resourceName := "aws_sns_topic.test" rName := acctest.RandString(10) expectedPolicy := `{"http":{"defaultHealthyRetryPolicy": {"minDelayTarget": 20,"maxDelayTarget": 20,"numMaxDelayRetries": 0,"numRetries": 3,"numNoDelayRetries": 0,"numMinDelayRetries": 0,"backoffFunction": "linear"},"disableSubscriptionOverrides": false}}` + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_sns_topic.test_topic", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSNSTopicConfig_withDeliveryPolicy(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSNSTopicExists("aws_sns_topic.test_topic", attributes), - testAccCheckAWSNSTopicHasDeliveryPolicy("aws_sns_topic.test_topic", expectedPolicy), + testAccCheckAWSSNSTopicExists(resourceName, attributes), + testAccCheckAWSNSTopicHasDeliveryPolicy(resourceName, expectedPolicy), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } func TestAccAWSSNSTopic_deliveryStatus(t *testing.T) { attributes := make(map[string]string) - + resourceName := "aws_sns_topic.test" rName := acctest.RandString(10) arnRegex := regexp.MustCompile("^arn:aws:iam::[0-9]{12}:role/sns-delivery-status-role-") expectedAttributes := map[string]*regexp.Regexp{ @@ -200,27 +208,27 @@ func TestAccAWSSNSTopic_deliveryStatus(t *testing.T) { resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_sns_topic.test_topic", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSNSTopicConfig_deliveryStatus(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSNSTopicExists("aws_sns_topic.test_topic", attributes), + testAccCheckAWSSNSTopicExists(resourceName, attributes), testAccCheckAWSSNSTopicAttributes(attributes, expectedAttributes), - resource.TestMatchResourceAttr("aws_sns_topic.test_topic", "application_success_feedback_role_arn", arnRegex), - resource.TestCheckResourceAttr("aws_sns_topic.test_topic", "application_success_feedback_sample_rate", "100"), - resource.TestMatchResourceAttr("aws_sns_topic.test_topic", "application_failure_feedback_role_arn", arnRegex), - resource.TestMatchResourceAttr("aws_sns_topic.test_topic", "lambda_success_feedback_role_arn", arnRegex), - resource.TestCheckResourceAttr("aws_sns_topic.test_topic", "lambda_success_feedback_sample_rate", "90"), - resource.TestMatchResourceAttr("aws_sns_topic.test_topic", "lambda_failure_feedback_role_arn", arnRegex), - resource.TestMatchResourceAttr("aws_sns_topic.test_topic", "http_success_feedback_role_arn", arnRegex), - resource.TestCheckResourceAttr("aws_sns_topic.test_topic", "http_success_feedback_sample_rate", "80"), - resource.TestMatchResourceAttr("aws_sns_topic.test_topic", "http_failure_feedback_role_arn", arnRegex), - resource.TestMatchResourceAttr("aws_sns_topic.test_topic", "sqs_success_feedback_role_arn", arnRegex), - resource.TestCheckResourceAttr("aws_sns_topic.test_topic", "sqs_success_feedback_sample_rate", "70"), - resource.TestMatchResourceAttr("aws_sns_topic.test_topic", "sqs_failure_feedback_role_arn", arnRegex), + resource.TestMatchResourceAttr(resourceName, "application_success_feedback_role_arn", arnRegex), + resource.TestCheckResourceAttr(resourceName, "application_success_feedback_sample_rate", "100"), + resource.TestMatchResourceAttr(resourceName, "application_failure_feedback_role_arn", arnRegex), + resource.TestMatchResourceAttr(resourceName, "lambda_success_feedback_role_arn", arnRegex), + resource.TestCheckResourceAttr(resourceName, "lambda_success_feedback_sample_rate", "90"), + resource.TestMatchResourceAttr(resourceName, "lambda_failure_feedback_role_arn", arnRegex), + resource.TestMatchResourceAttr(resourceName, "http_success_feedback_role_arn", arnRegex), + resource.TestCheckResourceAttr(resourceName, "http_success_feedback_sample_rate", "80"), + resource.TestMatchResourceAttr(resourceName, "http_failure_feedback_role_arn", arnRegex), + resource.TestMatchResourceAttr(resourceName, "sqs_success_feedback_role_arn", arnRegex), + resource.TestCheckResourceAttr(resourceName, "sqs_success_feedback_sample_rate", "70"), + resource.TestMatchResourceAttr(resourceName, "sqs_failure_feedback_role_arn", arnRegex), ), }, }, @@ -229,27 +237,32 @@ func TestAccAWSSNSTopic_deliveryStatus(t *testing.T) { func TestAccAWSSNSTopic_encryption(t *testing.T) { attributes := make(map[string]string) - + resourceName := "aws_sns_topic.test" rName := acctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_sns_topic.test_topic", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSNSTopicConfig_withEncryption(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSNSTopicExists("aws_sns_topic.test_topic", attributes), - resource.TestCheckResourceAttr("aws_sns_topic.test_topic", "kms_master_key_id", "alias/aws/sns"), + testAccCheckAWSSNSTopicExists(resourceName, attributes), + resource.TestCheckResourceAttr(resourceName, "kms_master_key_id", "alias/aws/sns"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSSNSTopicConfig_withName(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSNSTopicExists("aws_sns_topic.test_topic", attributes), - resource.TestCheckResourceAttr("aws_sns_topic.test_topic", "kms_master_key_id", ""), + testAccCheckAWSSNSTopicExists(resourceName, attributes), + resource.TestCheckResourceAttr(resourceName, "kms_master_key_id", ""), ), }, }, @@ -258,38 +271,43 @@ func TestAccAWSSNSTopic_encryption(t *testing.T) { func TestAccAWSSNSTopic_tags(t *testing.T) { attributes := make(map[string]string) - + resourceName := "aws_sns_topic.test" rName := acctest.RandString(10) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, - IDRefreshName: "aws_sns_topic.test_topic", + IDRefreshName: resourceName, Providers: testAccProviders, CheckDestroy: testAccCheckAWSSNSTopicDestroy, Steps: []resource.TestStep{ { Config: testAccAWSSNSTopicConfigTags1(rName, "key1", "value1"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSNSTopicExists("aws_sns_topic.test_topic", attributes), - resource.TestCheckResourceAttr("aws_sns_topic.test_topic", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_sns_topic.test_topic", "tags.key1", "value1"), + testAccCheckAWSSNSTopicExists(resourceName, attributes), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSSNSTopicConfigTags2(rName, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSNSTopicExists("aws_sns_topic.test_topic", attributes), - resource.TestCheckResourceAttr("aws_sns_topic.test_topic", "tags.%", "2"), - resource.TestCheckResourceAttr("aws_sns_topic.test_topic", "tags.key1", "value1updated"), - resource.TestCheckResourceAttr("aws_sns_topic.test_topic", "tags.key2", "value2"), + testAccCheckAWSSNSTopicExists(resourceName, attributes), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, { Config: testAccAWSSNSTopicConfigTags1(rName, "key2", "value2"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSNSTopicExists("aws_sns_topic.test_topic", attributes), - resource.TestCheckResourceAttr("aws_sns_topic.test_topic", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_sns_topic.test_topic", "tags.key2", "value2"), + testAccCheckAWSSNSTopicExists(resourceName, attributes), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, }, @@ -455,12 +473,12 @@ func testAccCheckAWSSNSTopicExists(n string, attributes map[string]string) resou } const testAccAWSSNSTopicConfig_withGeneratedName = ` -resource "aws_sns_topic" "test_topic" {} +resource "aws_sns_topic" "test" {} ` func testAccAWSSNSTopicConfig_withName(r string) string { return fmt.Sprintf(` -resource "aws_sns_topic" "test_topic" { +resource "aws_sns_topic" "test" { name = "terraform-test-topic-%s" } `, r) @@ -468,7 +486,7 @@ resource "aws_sns_topic" "test_topic" { func testAccAWSSNSTopicConfig_withNamePrefix() string { return ` -resource "aws_sns_topic" "test_topic" { +resource "aws_sns_topic" "test" { name_prefix = "terraform-test-topic-" } ` @@ -476,7 +494,7 @@ resource "aws_sns_topic" "test_topic" { func testAccAWSSNSTopicWithPolicy(r string) string { return fmt.Sprintf(` -resource "aws_sns_topic" "test_topic" { +resource "aws_sns_topic" "test" { name = "example-%s" policy = < 0 { tagsSpec := make([]*ec2.SpotFleetTagSpecification, 0) - tags := tagsFromMap(m) + tags := keyvaluetags.New(m).IgnoreAws().Ec2Tags() spec := &ec2.SpotFleetTagSpecification{ ResourceType: aws.String("instance"), @@ -1070,8 +1071,8 @@ func launchSpecToMap(l *ec2.SpotFleetLaunchSpecification, rootDevName *string) m if l.TagSpecifications != nil { for _, tagSpecs := range l.TagSpecifications { // only "instance" tags are currently supported: http://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SpotFleetTagSpecification.html - if *(tagSpecs.ResourceType) == "instance" { - m["tags"] = tagsToMap(tagSpecs.Tags) + if aws.StringValue(tagSpecs.ResourceType) == ec2.ResourceTypeInstance { + m["tags"] = keyvaluetags.Ec2KeyValueTags(tagSpecs.Tags).IgnoreAws().Map() } } } diff --git a/aws/resource_aws_spot_fleet_request_test.go b/aws/resource_aws_spot_fleet_request_test.go index 3819bc4a557..42366eea3f2 100644 --- a/aws/resource_aws_spot_fleet_request_test.go +++ b/aws/resource_aws_spot_fleet_request_test.go @@ -60,6 +60,7 @@ func TestAccAWSSpotFleetRequest_basic(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -67,11 +68,12 @@ func TestAccAWSSpotFleetRequest_basic(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfig(rName, rInt), + Config: testAccAWSSpotFleetRequestConfig(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists("aws_spot_fleet_request.foo", &sfr), resource.TestCheckResourceAttr("aws_spot_fleet_request.foo", "spot_request_state", "active"), resource.TestCheckResourceAttr("aws_spot_fleet_request.foo", "excess_capacity_termination_policy", "Default"), + resource.TestCheckResourceAttr("aws_spot_fleet_request.foo", "valid_until", validUntil), ), }, }, @@ -82,6 +84,7 @@ func TestAccAWSSpotFleetRequest_associatePublicIpAddress(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -89,7 +92,7 @@ func TestAccAWSSpotFleetRequest_associatePublicIpAddress(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfigAssociatePublicIpAddress(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigAssociatePublicIpAddress(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists("aws_spot_fleet_request.foo", &sfr), resource.TestCheckResourceAttr("aws_spot_fleet_request.foo", "spot_request_state", "active"), @@ -105,6 +108,7 @@ func TestAccAWSSpotFleetRequest_instanceInterruptionBehavior(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -112,7 +116,7 @@ func TestAccAWSSpotFleetRequest_instanceInterruptionBehavior(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfig(rName, rInt), + Config: testAccAWSSpotFleetRequestConfig(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists("aws_spot_fleet_request.foo", &sfr), resource.TestCheckResourceAttr("aws_spot_fleet_request.foo", "spot_request_state", "active"), @@ -127,6 +131,7 @@ func TestAccAWSSpotFleetRequest_fleetType(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -134,7 +139,7 @@ func TestAccAWSSpotFleetRequest_fleetType(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfigFleetType(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigFleetType(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists("aws_spot_fleet_request.foo", &sfr), resource.TestCheckResourceAttr("aws_spot_fleet_request.foo", "spot_request_state", "active"), @@ -149,6 +154,7 @@ func TestAccAWSSpotFleetRequest_iamInstanceProfileArn(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -156,7 +162,7 @@ func TestAccAWSSpotFleetRequest_iamInstanceProfileArn(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfigIamInstanceProfileArn(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigIamInstanceProfileArn(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists( "aws_spot_fleet_request.foo", &sfr), @@ -172,6 +178,7 @@ func TestAccAWSSpotFleetRequest_changePriceForcesNewRequest(t *testing.T) { var before, after ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -179,7 +186,7 @@ func TestAccAWSSpotFleetRequest_changePriceForcesNewRequest(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfig(rName, rInt), + Config: testAccAWSSpotFleetRequestConfig(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists( "aws_spot_fleet_request.foo", &before), @@ -189,7 +196,7 @@ func TestAccAWSSpotFleetRequest_changePriceForcesNewRequest(t *testing.T) { ), }, { - Config: testAccAWSSpotFleetRequestConfigChangeSpotBidPrice(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigChangeSpotBidPrice(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists( "aws_spot_fleet_request.foo", &after), @@ -207,6 +214,7 @@ func TestAccAWSSpotFleetRequest_updateTargetCapacity(t *testing.T) { var before, after ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -214,7 +222,7 @@ func TestAccAWSSpotFleetRequest_updateTargetCapacity(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfig(rName, rInt), + Config: testAccAWSSpotFleetRequestConfig(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists("aws_spot_fleet_request.foo", &before), resource.TestCheckResourceAttr("aws_spot_fleet_request.foo", "spot_request_state", "active"), @@ -222,14 +230,14 @@ func TestAccAWSSpotFleetRequest_updateTargetCapacity(t *testing.T) { ), }, { - Config: testAccAWSSpotFleetRequestConfigTargetCapacity(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigTargetCapacity(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists("aws_spot_fleet_request.foo", &after), resource.TestCheckResourceAttr("aws_spot_fleet_request.foo", "target_capacity", "3"), ), }, { - Config: testAccAWSSpotFleetRequestConfig(rName, rInt), + Config: testAccAWSSpotFleetRequestConfig(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists("aws_spot_fleet_request.foo", &before), resource.TestCheckResourceAttr("aws_spot_fleet_request.foo", "spot_request_state", "active"), @@ -244,6 +252,7 @@ func TestAccAWSSpotFleetRequest_updateExcessCapacityTerminationPolicy(t *testing var before, after ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -251,7 +260,7 @@ func TestAccAWSSpotFleetRequest_updateExcessCapacityTerminationPolicy(t *testing CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfig(rName, rInt), + Config: testAccAWSSpotFleetRequestConfig(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists("aws_spot_fleet_request.foo", &before), resource.TestCheckResourceAttr("aws_spot_fleet_request.foo", "spot_request_state", "active"), @@ -259,7 +268,7 @@ func TestAccAWSSpotFleetRequest_updateExcessCapacityTerminationPolicy(t *testing ), }, { - Config: testAccAWSSpotFleetRequestConfigExcessCapacityTermination(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigExcessCapacityTermination(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists("aws_spot_fleet_request.foo", &after), resource.TestCheckResourceAttr("aws_spot_fleet_request.foo", "excess_capacity_termination_policy", "NoTermination"), @@ -273,6 +282,7 @@ func TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -280,7 +290,7 @@ func TestAccAWSSpotFleetRequest_lowestPriceAzOrSubnetInRegion(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfig(rName, rInt), + Config: testAccAWSSpotFleetRequestConfig(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists( "aws_spot_fleet_request.foo", &sfr), @@ -296,6 +306,7 @@ func TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -303,7 +314,7 @@ func TestAccAWSSpotFleetRequest_lowestPriceAzInGivenList(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfigWithAzs(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigWithAzs(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists( "aws_spot_fleet_request.foo", &sfr), @@ -321,6 +332,7 @@ func TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -328,7 +340,7 @@ func TestAccAWSSpotFleetRequest_lowestPriceSubnetInGivenList(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfigWithSubnet(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigWithSubnet(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists( "aws_spot_fleet_request.foo", &sfr), @@ -344,6 +356,7 @@ func TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -351,7 +364,7 @@ func TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameAz(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfigMultipleInstanceTypesinSameAz(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigMultipleInstanceTypesinSameAz(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists( "aws_spot_fleet_request.foo", &sfr), @@ -371,6 +384,7 @@ func TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet(t *testing.T) var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -378,7 +392,7 @@ func TestAccAWSSpotFleetRequest_multipleInstanceTypesInSameSubnet(t *testing.T) CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfigMultipleInstanceTypesinSameSubnet(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigMultipleInstanceTypesinSameSubnet(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists( "aws_spot_fleet_request.foo", &sfr), @@ -394,6 +408,7 @@ func TestAccAWSSpotFleetRequest_overriddingSpotPrice(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -401,7 +416,7 @@ func TestAccAWSSpotFleetRequest_overriddingSpotPrice(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfigOverridingSpotPrice(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigOverridingSpotPrice(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists( "aws_spot_fleet_request.foo", &sfr), @@ -422,6 +437,7 @@ func TestAccAWSSpotFleetRequest_withoutSpotPrice(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -429,7 +445,7 @@ func TestAccAWSSpotFleetRequest_withoutSpotPrice(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfigWithoutSpotPrice(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigWithoutSpotPrice(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists( "aws_spot_fleet_request.foo", &sfr), @@ -445,6 +461,7 @@ func TestAccAWSSpotFleetRequest_diversifiedAllocation(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -452,7 +469,7 @@ func TestAccAWSSpotFleetRequest_diversifiedAllocation(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfigDiversifiedAllocation(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigDiversifiedAllocation(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists( "aws_spot_fleet_request.foo", &sfr), @@ -469,6 +486,7 @@ func TestAccAWSSpotFleetRequest_multipleInstancePools(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -476,7 +494,7 @@ func TestAccAWSSpotFleetRequest_multipleInstancePools(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfigMultipleInstancePools(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigMultipleInstancePools(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists( "aws_spot_fleet_request.foo", &sfr), @@ -494,6 +512,7 @@ func TestAccAWSSpotFleetRequest_withWeightedCapacity(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) fulfillSleep := func() resource.TestCheckFunc { // sleep so that EC2 can fuflill the request. We do this to guard against a @@ -515,7 +534,7 @@ func TestAccAWSSpotFleetRequest_withWeightedCapacity(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfigWithWeightedCapacity(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigWithWeightedCapacity(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( fulfillSleep(), testAccCheckAWSSpotFleetRequestExists( @@ -536,6 +555,7 @@ func TestAccAWSSpotFleetRequest_withEBSDisk(t *testing.T) { var config ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -543,7 +563,7 @@ func TestAccAWSSpotFleetRequest_withEBSDisk(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestEBSConfig(rName, rInt), + Config: testAccAWSSpotFleetRequestEBSConfig(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists( "aws_spot_fleet_request.foo", &config), @@ -559,6 +579,7 @@ func TestAccAWSSpotFleetRequest_LaunchSpecification_EbsBlockDevice_KmsKeyId(t *t var config ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resourceName := "aws_spot_fleet_request.test" resource.ParallelTest(t, resource.TestCase{ @@ -567,7 +588,7 @@ func TestAccAWSSpotFleetRequest_LaunchSpecification_EbsBlockDevice_KmsKeyId(t *t CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestLaunchSpecificationEbsBlockDeviceKmsKeyId(rName, rInt), + Config: testAccAWSSpotFleetRequestLaunchSpecificationEbsBlockDeviceKmsKeyId(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists(resourceName, &config), ), @@ -580,6 +601,7 @@ func TestAccAWSSpotFleetRequest_LaunchSpecification_RootBlockDevice_KmsKeyId(t * var config ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resourceName := "aws_spot_fleet_request.test" resource.ParallelTest(t, resource.TestCase{ @@ -588,7 +610,7 @@ func TestAccAWSSpotFleetRequest_LaunchSpecification_RootBlockDevice_KmsKeyId(t * CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestLaunchSpecificationRootBlockDeviceKmsKeyId(rName, rInt), + Config: testAccAWSSpotFleetRequestLaunchSpecificationRootBlockDeviceKmsKeyId(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists(resourceName, &config), ), @@ -601,6 +623,7 @@ func TestAccAWSSpotFleetRequest_withTags(t *testing.T) { var config ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -608,7 +631,7 @@ func TestAccAWSSpotFleetRequest_withTags(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestTagsConfig(rName, rInt), + Config: testAccAWSSpotFleetRequestTagsConfig(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists("aws_spot_fleet_request.foo", &config), resource.TestCheckResourceAttr("aws_spot_fleet_request.foo", "launch_specification.24370212.tags.%", "2"), @@ -624,6 +647,7 @@ func TestAccAWSSpotFleetRequest_placementTenancyAndGroup(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -631,7 +655,7 @@ func TestAccAWSSpotFleetRequest_placementTenancyAndGroup(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestTenancyGroupConfig(rName, rInt), + Config: testAccAWSSpotFleetRequestTenancyGroupConfig(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists("aws_spot_fleet_request.foo", &sfr), resource.TestCheckResourceAttr("aws_spot_fleet_request.foo", "spot_request_state", "active"), @@ -646,6 +670,7 @@ func TestAccAWSSpotFleetRequest_WithELBs(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -653,7 +678,7 @@ func TestAccAWSSpotFleetRequest_WithELBs(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfigWithELBs(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigWithELBs(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists( "aws_spot_fleet_request.foo", &sfr), @@ -670,6 +695,7 @@ func TestAccAWSSpotFleetRequest_WithTargetGroups(t *testing.T) { var sfr ec2.SpotFleetRequestConfig rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -677,7 +703,7 @@ func TestAccAWSSpotFleetRequest_WithTargetGroups(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestConfigWithTargetGroups(rName, rInt), + Config: testAccAWSSpotFleetRequestConfigWithTargetGroups(rName, rInt, validUntil), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSSpotFleetRequestExists( "aws_spot_fleet_request.foo", &sfr), @@ -694,6 +720,7 @@ func TestAccAWSSpotFleetRequest_WithInstanceStoreAmi(t *testing.T) { t.Skip("Test fails due to test harness constraints") rName := acctest.RandString(10) rInt := acctest.RandInt() + validUntil := time.Now().UTC().Add(24 * time.Hour).Format(time.RFC3339) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSEc2SpotFleetRequest(t) }, @@ -701,7 +728,7 @@ func TestAccAWSSpotFleetRequest_WithInstanceStoreAmi(t *testing.T) { CheckDestroy: testAccCheckAWSSpotFleetRequestDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSpotFleetRequestLaunchSpecificationWithInstanceStoreAmi(rName, rInt), + Config: testAccAWSSpotFleetRequestLaunchSpecificationWithInstanceStoreAmi(rName, rInt, validUntil), ExpectError: regexp.MustCompile("Instance store backed AMIs do not provide a root device name"), }, }, @@ -922,13 +949,13 @@ resource "aws_iam_policy_attachment" "test-attach" { `, rName, rInt) } -func testAccAWSSpotFleetRequestConfig(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestConfig(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.005" target_capacity = 2 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q terminate_instances_with_expiration = true instance_interruption_behaviour = "stop" wait_for_fulfillment = true @@ -939,16 +966,16 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestConfigAssociatePublicIpAddress(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestConfigAssociatePublicIpAddress(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.027" target_capacity = 2 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q terminate_instances_with_expiration = true wait_for_fulfillment = true launch_specification { @@ -959,16 +986,16 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestConfigTargetCapacity(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestConfigTargetCapacity(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.005" target_capacity = 3 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q fleet_type = "request" terminate_instances_with_expiration = true wait_for_fulfillment = true @@ -978,17 +1005,17 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestConfigExcessCapacityTermination(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestConfigExcessCapacityTermination(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.005" target_capacity = 2 excess_capacity_termination_policy = "NoTermination" - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q fleet_type = "request" terminate_instances_with_expiration = true wait_for_fulfillment = true @@ -998,16 +1025,16 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestConfigFleetType(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestConfigFleetType(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.005" target_capacity = 2 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q fleet_type = "request" terminate_instances_with_expiration = true wait_for_fulfillment = true @@ -1017,10 +1044,10 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestConfigIamInstanceProfileArn(rName string, rInt int) string { +func testAccAWSSpotFleetRequestConfigIamInstanceProfileArn(rName string, rInt int, validUntil string) string { return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_iam_role" "test-role1" { name = "tf-test-role1-%[1]s" @@ -1068,7 +1095,7 @@ resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.005" target_capacity = 2 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[2]q terminate_instances_with_expiration = true instance_interruption_behaviour = "stop" wait_for_fulfillment = true @@ -1080,16 +1107,16 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`, rName) +`, rName, validUntil) } -func testAccAWSSpotFleetRequestConfigChangeSpotBidPrice(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestConfigChangeSpotBidPrice(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.01" target_capacity = 2 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q terminate_instances_with_expiration = true wait_for_fulfillment = true launch_specification { @@ -1099,16 +1126,16 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestConfigWithAzs(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestConfigWithAzs(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.005" target_capacity = 2 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q terminate_instances_with_expiration = true wait_for_fulfillment = true launch_specification { @@ -1125,11 +1152,11 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestConfigWithSubnet(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestConfigWithSubnet(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_vpc" "foo" { cidr_block = "10.1.0.0/16" tags = { @@ -1159,7 +1186,7 @@ resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.05" target_capacity = 4 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q terminate_instances_with_expiration = true wait_for_fulfillment = true launch_specification { @@ -1176,10 +1203,10 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestConfigWithELBs(rName string, rInt int) string { +func testAccAWSSpotFleetRequestConfigWithELBs(rName string, rInt int, validUntil string) string { return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_vpc" "foo" { cidr_block = "10.1.0.0/16" @@ -1204,7 +1231,7 @@ resource "aws_subnet" "bar" { } resource "aws_elb" "elb" { - name = "test-elb-%s" + name = "test-elb-%[1]s" subnets = ["${aws_subnet.foo.id}", "${aws_subnet.bar.id}"] internal = true @@ -1220,7 +1247,7 @@ resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.5" target_capacity = 2 - valid_until = "2029-11-04T20:44:20Z" + valid_until = %[2]q terminate_instances_with_expiration = true wait_for_fulfillment = true load_balancers = ["${aws_elb.elb.name}"] @@ -1232,10 +1259,10 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`, rName) +`, rName, validUntil) } -func testAccAWSSpotFleetRequestConfigWithTargetGroups(rName string, rInt int) string { +func testAccAWSSpotFleetRequestConfigWithTargetGroups(rName string, rInt int, validUntil string) string { return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_vpc" "foo" { cidr_block = "10.1.0.0/16" @@ -1260,7 +1287,7 @@ resource "aws_subnet" "bar" { } resource "aws_alb" "alb" { - name = "test-elb-%s" + name = "test-elb-%[1]s" internal = true subnets = ["${aws_subnet.foo.id}", "${aws_subnet.bar.id}"] } @@ -1287,7 +1314,7 @@ resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.5" target_capacity = 2 - valid_until = "2029-11-04T20:44:20Z" + valid_until = %[2]q terminate_instances_with_expiration = true wait_for_fulfillment = true target_group_arns = ["${aws_alb_target_group.target_group.arn}"] @@ -1299,16 +1326,16 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`, rName) +`, rName, validUntil) } -func testAccAWSSpotFleetRequestConfigMultipleInstanceTypesinSameAz(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestConfigMultipleInstanceTypesinSameAz(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.025" target_capacity = 2 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q terminate_instances_with_expiration = true wait_for_fulfillment = true launch_specification { @@ -1325,11 +1352,11 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestConfigMultipleInstanceTypesinSameSubnet(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestConfigMultipleInstanceTypesinSameSubnet(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_vpc" "foo" { cidr_block = "10.1.0.0/16" tags = { @@ -1350,7 +1377,7 @@ resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.035" target_capacity = 4 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q terminate_instances_with_expiration = true wait_for_fulfillment = true launch_specification { @@ -1367,16 +1394,16 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestConfigOverridingSpotPrice(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestConfigOverridingSpotPrice(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.035" target_capacity = 2 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q terminate_instances_with_expiration = true wait_for_fulfillment = true launch_specification { @@ -1394,15 +1421,15 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestConfigWithoutSpotPrice(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestConfigWithoutSpotPrice(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" target_capacity = 2 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q terminate_instances_with_expiration = true wait_for_fulfillment = true launch_specification { @@ -1419,16 +1446,16 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestConfigMultipleInstancePools(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestConfigMultipleInstancePools(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.7" target_capacity = 30 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q instance_pools_to_use_count = 2 terminate_instances_with_expiration = true wait_for_fulfillment = true @@ -1452,16 +1479,16 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestConfigDiversifiedAllocation(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestConfigDiversifiedAllocation(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.7" target_capacity = 30 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q allocation_strategy = "diversified" terminate_instances_with_expiration = true wait_for_fulfillment = true @@ -1485,16 +1512,16 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestConfigWithWeightedCapacity(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestConfigWithWeightedCapacity(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.7" target_capacity = 10 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q terminate_instances_with_expiration = true wait_for_fulfillment = true launch_specification { @@ -1513,16 +1540,16 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestEBSConfig(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestEBSConfig(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.005" target_capacity = 1 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q terminate_instances_with_expiration = true wait_for_fulfillment = true launch_specification { @@ -1543,11 +1570,11 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestLaunchSpecificationEbsBlockDeviceKmsKeyId(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestLaunchSpecificationEbsBlockDeviceKmsKeyId(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` data "aws_ami" "amzn-ami-minimal-hvm-ebs" { most_recent = true owners = ["amazon"] @@ -1572,7 +1599,7 @@ resource "aws_spot_fleet_request" "test" { spot_price = "0.005" target_capacity = 1 terminate_instances_with_expiration = true - valid_until = "2029-11-04T20:44:20Z" + valid_until = %[1]q wait_for_fulfillment = true launch_specification { @@ -1596,11 +1623,11 @@ resource "aws_spot_fleet_request" "test" { depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestLaunchSpecificationRootBlockDeviceKmsKeyId(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestLaunchSpecificationRootBlockDeviceKmsKeyId(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` data "aws_ami" "amzn-ami-minimal-hvm-ebs" { most_recent = true owners = ["amazon"] @@ -1625,7 +1652,7 @@ resource "aws_spot_fleet_request" "test" { spot_price = "0.005" target_capacity = 1 terminate_instances_with_expiration = true - valid_until = "2029-11-04T20:44:20Z" + valid_until = %[1]q wait_for_fulfillment = true launch_specification { @@ -1642,11 +1669,11 @@ resource "aws_spot_fleet_request" "test" { depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestLaunchSpecificationWithInstanceStoreAmi(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestLaunchSpecificationWithInstanceStoreAmi(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` data "aws_ami" "ubuntu_instance_store" { most_recent = true owners = ["099720109477"] # Canonical @@ -1662,7 +1689,7 @@ resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.03" target_capacity = 2 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q terminate_instances_with_expiration = true wait_for_fulfillment = true @@ -1673,16 +1700,16 @@ resource "aws_spot_fleet_request" "foo" { depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestTagsConfig(rName string, rInt int) string { - return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprint(` +func testAccAWSSpotFleetRequestTagsConfig(rName string, rInt int, validUntil string) string { + return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.005" target_capacity = 1 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[1]q terminate_instances_with_expiration = true wait_for_fulfillment = true launch_specification { @@ -1695,13 +1722,13 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`) +`, validUntil) } -func testAccAWSSpotFleetRequestTenancyGroupConfig(rName string, rInt int) string { +func testAccAWSSpotFleetRequestTenancyGroupConfig(rName string, rInt int, validUntil string) string { return testAccAWSSpotFleetRequestConfigBase(rName, rInt) + fmt.Sprintf(` resource "aws_placement_group" "test" { - name = "test-pg-%s" + name = "test-pg-%[1]s" strategy = "cluster" } @@ -1709,7 +1736,7 @@ resource "aws_spot_fleet_request" "foo" { iam_fleet_role = "${aws_iam_role.test-role.arn}" spot_price = "0.005" target_capacity = 2 - valid_until = "2019-11-04T20:44:20Z" + valid_until = %[2]q terminate_instances_with_expiration = true launch_specification { instance_type = "m1.small" @@ -1720,5 +1747,5 @@ resource "aws_spot_fleet_request" "foo" { } depends_on = ["aws_iam_policy_attachment.test-attach"] } -`, rName) +`, rName, validUntil) } diff --git a/aws/resource_aws_spot_instance_request.go b/aws/resource_aws_spot_instance_request.go index fe31f160fc8..42425b7e78f 100644 --- a/aws/resource_aws_spot_instance_request.go +++ b/aws/resource_aws_spot_instance_request.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsSpotInstanceRequest() *schema.Resource { @@ -226,7 +227,13 @@ func resourceAwsSpotInstanceRequestCreate(d *schema.ResourceData, meta interface } } - return resourceAwsSpotInstanceRequestUpdate(d, meta) + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), nil, v); err != nil { + return fmt.Errorf("error adding EC2 Spot Instance Request (%s) tags: %s", d.Id(), err) + } + } + + return resourceAwsSpotInstanceRequestRead(d, meta) } // Update spot state, etc @@ -264,10 +271,10 @@ func resourceAwsSpotInstanceRequestRead(d *schema.ResourceData, meta interface{} return nil } - d.Set("spot_bid_status", *request.Status.Code) + 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) + 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("Error reading Spot Instance Data: %s", err) @@ -277,7 +284,11 @@ func resourceAwsSpotInstanceRequestRead(d *schema.ResourceData, meta interface{} d.Set("spot_request_state", request.State) d.Set("launch_group", request.LaunchGroup) d.Set("block_duration_minutes", request.BlockDurationMinutes) - d.Set("tags", tagsToMap(request.Tags)) + + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(request.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + d.Set("instance_interruption_behaviour", request.InstanceInterruptionBehavior) d.Set("valid_from", aws.TimeValue(request.ValidFrom).Format(time.RFC3339)) d.Set("valid_until", aws.TimeValue(request.ValidUntil).Format(time.RFC3339)) @@ -373,14 +384,13 @@ func readInstance(d *schema.ResourceData, meta interface{}) error { 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") - } + if d.HasChange("tags") { + o, n := d.GetChange("tags") - d.Partial(false) + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating EC2 Spot Instance Request (%s) tags: %s", d.Id(), err) + } + } return resourceAwsSpotInstanceRequestRead(d, meta) } diff --git a/aws/resource_aws_spot_instance_request_test.go b/aws/resource_aws_spot_instance_request_test.go index 96b3c1ea990..37696a29edf 100644 --- a/aws/resource_aws_spot_instance_request_test.go +++ b/aws/resource_aws_spot_instance_request_test.go @@ -672,89 +672,101 @@ func testAccAWSSpotInstanceRequestConfig_withBlockDuration(rInt int) string { func testAccAWSSpotInstanceRequestConfigVPC(rInt int) string { return fmt.Sprintf(` - resource "aws_vpc" "foo_VPC" { - cidr_block = "10.1.0.0/16" +data "aws_availability_zones" "available" { + blacklisted_zone_ids = ["usw2-az4"] + state = "available" +} + +resource "aws_vpc" "foo_VPC" { + cidr_block = "10.1.0.0/16" tags = { - Name = "terraform-testacc-spot-instance-request-vpc" - } + Name = "terraform-testacc-spot-instance-request-vpc" } +} - resource "aws_subnet" "foo_VPC" { - cidr_block = "10.1.1.0/24" - vpc_id = "${aws_vpc.foo_VPC.id}" +resource "aws_subnet" "foo_VPC" { + availability_zone = "${data.aws_availability_zones.available.names[0]}" + cidr_block = "10.1.1.0/24" + vpc_id = "${aws_vpc.foo_VPC.id}" tags = { - Name = "tf-acc-spot-instance-request-vpc" - } + Name = "tf-acc-spot-instance-request-vpc" } +} - resource "aws_key_pair" "debugging" { - key_name = "tmp-key-%d" - public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com" - } +resource "aws_key_pair" "debugging" { + key_name = "tmp-key-%d" + public_key = "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQD3F6tyPEFEzV0LX3X8BsXdMsQz1x2cEikKDEY0aIj41qgxMCP/iteneqXSIFZBp5vizPvaoIR3Um9xK7PGoW8giupGn+EPuxIA4cDM4vzOqOkiMPhz5XK0whEjkVzTo4+S0puvDZuwIsdiW9mxhJc7tgBNL0cYlWSYVkz4G/fslNfRPW5mYAM49f4fhtxPb5ok4Q2Lg9dPKVHO/Bgeu5woMc7RY0p1ej6D4CKFE6lymSDJpW0YHX/wqE9+cfEauh7xZcG0q9t2ta6F6fmX0agvpFyZo8aFbXeUBr7osSCJNgvavWbM/06niWrOvYX2xwWdhXmXSrbX8ZbabVohBK41 phodgson@thoughtworks.com" +} - resource "aws_spot_instance_request" "foo_VPC" { - ami = "ami-4fccb37f" - instance_type = "m1.small" - key_name = "${aws_key_pair.debugging.key_name}" +resource "aws_spot_instance_request" "foo_VPC" { + ami = "ami-4fccb37f" + instance_type = "m1.small" + key_name = "${aws_key_pair.debugging.key_name}" - // base price is $0.044 hourly, so bidding above that should theoretically - // always fulfill - spot_price = "0.05" + // base price is $0.044 hourly, so bidding above that should theoretically + // always fulfill + spot_price = "0.05" - // VPC settings - subnet_id = "${aws_subnet.foo_VPC.id}" + // VPC settings + subnet_id = "${aws_subnet.foo_VPC.id}" - // we wait for fulfillment because we want to inspect the launched instance - // and verify termination behavior - wait_for_fulfillment = true + // we wait for fulfillment because we want to inspect the launched instance + // and verify termination behavior + wait_for_fulfillment = true - tags = { - Name = "terraform-test-VPC" - } +tags = { + Name = "terraform-test-VPC" } +} `, rInt) } func testAccAWSSpotInstanceRequestConfig_SubnetAndSGAndPublicIpAddress(rInt int) string { return fmt.Sprintf(` - resource "aws_spot_instance_request" "foo" { - ami = "ami-4fccb37f" - instance_type = "m1.small" - spot_price = "0.05" - wait_for_fulfillment = true - subnet_id = "${aws_subnet.tf_test_subnet.id}" - vpc_security_group_ids = ["${aws_security_group.tf_test_sg_ssh.id}"] - associate_public_ip_address = true - } +data "aws_availability_zones" "available" { + blacklisted_zone_ids = ["usw2-az4"] + state = "available" +} - resource "aws_vpc" "default" { - cidr_block = "10.0.0.0/16" - enable_dns_hostnames = true +resource "aws_spot_instance_request" "foo" { + ami = "ami-4fccb37f" + instance_type = "m1.small" + spot_price = "0.05" + wait_for_fulfillment = true + subnet_id = "${aws_subnet.tf_test_subnet.id}" + vpc_security_group_ids = ["${aws_security_group.tf_test_sg_ssh.id}"] + associate_public_ip_address = true +} - tags = { - Name = "terraform-testacc-spot-instance-request-subnet-and-sg-public-ip" - } +resource "aws_vpc" "default" { + cidr_block = "10.0.0.0/16" + enable_dns_hostnames = true + +tags = { + Name = "terraform-testacc-spot-instance-request-subnet-and-sg-public-ip" } +} - resource "aws_subnet" "tf_test_subnet" { - vpc_id = "${aws_vpc.default.id}" - cidr_block = "10.0.0.0/24" - map_public_ip_on_launch = true +resource "aws_subnet" "tf_test_subnet" { + availability_zone = "${data.aws_availability_zones.available.names[0]}" + vpc_id = "${aws_vpc.default.id}" + cidr_block = "10.0.0.0/24" + map_public_ip_on_launch = true - tags = { - Name = "tf-acc-spot-instance-request-subnet-and-sg-public-ip" - } +tags = { + Name = "tf-acc-spot-instance-request-subnet-and-sg-public-ip" } +} - resource "aws_security_group" "tf_test_sg_ssh" { - name = "tf_test_sg_ssh-%d" - description = "tf_test_sg_ssh" - vpc_id = "${aws_vpc.default.id}" +resource "aws_security_group" "tf_test_sg_ssh" { + name = "tf_test_sg_ssh-%d" + description = "tf_test_sg_ssh" + vpc_id = "${aws_vpc.default.id}" - tags = { - Name = "tf_test_sg_ssh-%d" - } +tags = { + Name = "tf_test_sg_ssh-%d" } +} `, rInt, rInt) } diff --git a/aws/resource_aws_sqs_queue.go b/aws/resource_aws_sqs_queue.go index f8b7d1017da..6d55747ec19 100644 --- a/aws/resource_aws_sqs_queue.go +++ b/aws/resource_aws_sqs_queue.go @@ -16,6 +16,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/structure" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) var sqsQueueAttributeMap = map[string]string{ @@ -173,7 +174,7 @@ func resourceAwsSqsQueueCreate(d *schema.ResourceData, meta interface{}) error { // Tag-on-create is currently only supported in AWS Commercial if v, ok := d.GetOk("tags"); ok && meta.(*AWSClient).partition == endpoints.AwsPartitionID { - req.Tags = tagsFromMapGeneric(v.(map[string]interface{})) + req.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().SqsTags() } attributes := make(map[string]*string) @@ -232,8 +233,12 @@ func resourceAwsSqsQueueCreate(d *schema.ResourceData, meta interface{}) error { func resourceAwsSqsQueueUpdate(d *schema.ResourceData, meta interface{}) error { sqsconn := meta.(*AWSClient).sqsconn - if err := setTagsSQS(sqsconn, d); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.SqsUpdateTags(sqsconn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating SQS Queue (%s) tags: %s", d.Id(), err) + } } attributes := make(map[string]*string) @@ -281,7 +286,7 @@ func resourceAwsSqsQueueRead(d *schema.ResourceData, meta interface{}) error { if err != nil { if awsErr, ok := err.(awserr.Error); ok { log.Printf("ERROR Found %s", awsErr.Code()) - if awsErr.Code() == "AWS.SimpleQueueService.NonExistentQueue" { + if awsErr.Code() == sqs.ErrCodeQueueDoesNotExist { d.SetId("") log.Printf("[DEBUG] SQS Queue (%s) not found", d.Get("name").(string)) return nil @@ -410,21 +415,20 @@ func resourceAwsSqsQueueRead(d *schema.ResourceData, meta interface{}) error { } } - tags := make(map[string]string) - listTagsOutput, err := sqsconn.ListQueueTags(&sqs.ListQueueTagsInput{ - QueueUrl: aws.String(d.Id()), - }) + tags, err := keyvaluetags.SqsListTags(sqsconn, d.Id()) + if err != nil { // Non-standard partitions (e.g. US Gov) and some local development // solutions do not yet support this API call. Depending on the // implementation it may return InvalidAction or AWS.SimpleQueueService.UnsupportedOperation if !isAWSErr(err, "InvalidAction", "") && !isAWSErr(err, sqs.ErrCodeUnsupportedOperation, "") { - return err + return fmt.Errorf("error listing tags for SQS Queue (%s): %s", d.Id(), err) } - } else { - tags = tagsToMapGeneric(listTagsOutput.Tags) } - d.Set("tags", tags) + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } @@ -453,39 +457,3 @@ func extractNameFromSqsQueueUrl(queue string) (string, error) { return segments[2], nil } - -func setTagsSQS(conn *sqs.SQS, d *schema.ResourceData) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - create, remove := diffTagsGeneric(oraw.(map[string]interface{}), nraw.(map[string]interface{})) - - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - keys := make([]*string, 0, len(remove)) - for k := range remove { - keys = append(keys, aws.String(k)) - } - - _, err := conn.UntagQueue(&sqs.UntagQueueInput{ - QueueUrl: aws.String(d.Id()), - TagKeys: keys, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - - _, err := conn.TagQueue(&sqs.TagQueueInput{ - QueueUrl: aws.String(d.Id()), - Tags: create, - }) - if err != nil { - return err - } - } - } - - return nil -} diff --git a/aws/resource_aws_sqs_queue_test.go b/aws/resource_aws_sqs_queue_test.go index 8bb84a9095d..0e09388c28c 100644 --- a/aws/resource_aws_sqs_queue_test.go +++ b/aws/resource_aws_sqs_queue_test.go @@ -17,6 +17,7 @@ import ( func TestAccAWSSQSQueue_basic(t *testing.T) { var queueAttributes map[string]*string + resourceName := "aws_sqs_queue.queue" queueName := fmt.Sprintf("sqs-queue-%s", acctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -26,12 +27,12 @@ func TestAccAWSSQSQueue_basic(t *testing.T) { { Config: testAccAWSSQSConfigWithDefaults(queueName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSQSQueueExists("aws_sqs_queue.queue", &queueAttributes), + testAccCheckAWSSQSQueueExists(resourceName, &queueAttributes), testAccCheckAWSSQSQueueDefaultAttributes(&queueAttributes), ), }, { - ResourceName: "aws_sqs_queue.queue", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -41,14 +42,14 @@ func TestAccAWSSQSQueue_basic(t *testing.T) { { Config: testAccAWSSQSConfigWithOverrides(queueName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSQSQueueExists("aws_sqs_queue.queue", &queueAttributes), + testAccCheckAWSSQSQueueExists(resourceName, &queueAttributes), testAccCheckAWSSQSQueueOverrideAttributes(&queueAttributes), ), }, { Config: testAccAWSSQSConfigWithDefaults(queueName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSQSQueueExists("aws_sqs_queue.queue", &queueAttributes), + testAccCheckAWSSQSQueueExists(resourceName, &queueAttributes), testAccCheckAWSSQSQueueDefaultAttributes(&queueAttributes), ), }, @@ -59,6 +60,7 @@ func TestAccAWSSQSQueue_basic(t *testing.T) { func TestAccAWSSQSQueue_tags(t *testing.T) { var queueAttributes map[string]*string + resourceName := "aws_sqs_queue.queue" queueName := fmt.Sprintf("sqs-queue-%s", acctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -68,14 +70,14 @@ func TestAccAWSSQSQueue_tags(t *testing.T) { { Config: testAccAWSSQSConfigWithTags(queueName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSQSQueueExists("aws_sqs_queue.queue", &queueAttributes), + testAccCheckAWSSQSQueueExists(resourceName, &queueAttributes), testAccCheckAWSSQSQueueDefaultAttributes(&queueAttributes), - resource.TestCheckResourceAttr("aws_sqs_queue.queue", "tags.%", "2"), - resource.TestCheckResourceAttr("aws_sqs_queue.queue", "tags.Usage", "original"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.Usage", "original"), ), }, { - ResourceName: "aws_sqs_queue.queue", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -85,18 +87,18 @@ func TestAccAWSSQSQueue_tags(t *testing.T) { { Config: testAccAWSSQSConfigWithTagsChanged(queueName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSQSQueueExists("aws_sqs_queue.queue", &queueAttributes), + testAccCheckAWSSQSQueueExists(resourceName, &queueAttributes), testAccCheckAWSSQSQueueDefaultAttributes(&queueAttributes), - resource.TestCheckResourceAttr("aws_sqs_queue.queue", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_sqs_queue.queue", "tags.Usage", "changed"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.Usage", "changed"), ), }, { Config: testAccAWSSQSConfigWithDefaults(queueName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSQSQueueExists("aws_sqs_queue.queue", &queueAttributes), + testAccCheckAWSSQSQueueExists(resourceName, &queueAttributes), testAccCheckAWSSQSQueueDefaultAttributes(&queueAttributes), - resource.TestCheckNoResourceAttr("aws_sqs_queue.queue", "tags"), + resource.TestCheckNoResourceAttr(resourceName, "tags"), ), }, }, @@ -106,6 +108,7 @@ func TestAccAWSSQSQueue_tags(t *testing.T) { func TestAccAWSSQSQueue_namePrefix(t *testing.T) { var queueAttributes map[string]*string + resourceName := "aws_sqs_queue.queue" prefix := "acctest-sqs-queue" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -115,13 +118,13 @@ func TestAccAWSSQSQueue_namePrefix(t *testing.T) { { Config: testAccAWSSQSConfigWithNamePrefix(prefix), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSQSQueueExists("aws_sqs_queue.queue", &queueAttributes), + testAccCheckAWSSQSQueueExists(resourceName, &queueAttributes), testAccCheckAWSSQSQueueDefaultAttributes(&queueAttributes), - resource.TestMatchResourceAttr("aws_sqs_queue.queue", "name", regexp.MustCompile(`^acctest-sqs-queue`)), + resource.TestMatchResourceAttr(resourceName, "name", regexp.MustCompile(`^acctest-sqs-queue`)), ), }, { - ResourceName: "aws_sqs_queue.queue", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -135,6 +138,7 @@ func TestAccAWSSQSQueue_namePrefix(t *testing.T) { func TestAccAWSSQSQueue_namePrefix_fifo(t *testing.T) { var queueAttributes map[string]*string + resourceName := "aws_sqs_queue.queue" prefix := "acctest-sqs-queue" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -144,13 +148,13 @@ func TestAccAWSSQSQueue_namePrefix_fifo(t *testing.T) { { Config: testAccAWSSQSFifoConfigWithNamePrefix(prefix), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSQSQueueExists("aws_sqs_queue.queue", &queueAttributes), + testAccCheckAWSSQSQueueExists(resourceName, &queueAttributes), testAccCheckAWSSQSQueueDefaultAttributes(&queueAttributes), - resource.TestMatchResourceAttr("aws_sqs_queue.queue", "name", regexp.MustCompile(`^acctest-sqs-queue.*\.fifo$`)), + resource.TestMatchResourceAttr(resourceName, "name", regexp.MustCompile(`^acctest-sqs-queue.*\.fifo$`)), ), }, { - ResourceName: "aws_sqs_queue.queue", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -198,6 +202,7 @@ func TestAccAWSSQSQueue_policy(t *testing.T) { func TestAccAWSSQSQueue_queueDeletedRecently(t *testing.T) { var queueAttributes map[string]*string + resourceName := "aws_sqs_queue.queue" queueName := fmt.Sprintf("sqs-queue-%s", acctest.RandString(10)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -207,17 +212,17 @@ func TestAccAWSSQSQueue_queueDeletedRecently(t *testing.T) { { Config: testAccAWSSQSConfigWithDefaults(queueName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSQSQueueExists("aws_sqs_queue.queue", &queueAttributes), + testAccCheckAWSSQSQueueExists(resourceName, &queueAttributes), testAccCheckAWSSQSQueueDefaultAttributes(&queueAttributes), ), }, { Config: testAccAWSSQSConfigWithDefaults(queueName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSQSQueueExists("aws_sqs_queue.queue", &queueAttributes), + testAccCheckAWSSQSQueueExists(resourceName, &queueAttributes), testAccCheckAWSSQSQueueDefaultAttributes(&queueAttributes), ), - Taint: []string{"aws_sqs_queue.queue"}, + Taint: []string{resourceName}, }, }, }) @@ -283,6 +288,7 @@ func TestAccAWSSQSQueue_Policybasic(t *testing.T) { func TestAccAWSSQSQueue_FIFO(t *testing.T) { var queueAttributes map[string]*string + resourceName := "aws_sqs_queue.queue" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -291,12 +297,12 @@ func TestAccAWSSQSQueue_FIFO(t *testing.T) { { Config: testAccAWSSQSConfigWithFIFO(acctest.RandString(10)), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSQSQueueExists("aws_sqs_queue.queue", &queueAttributes), - resource.TestCheckResourceAttr("aws_sqs_queue.queue", "fifo_queue", "true"), + testAccCheckAWSSQSQueueExists(resourceName, &queueAttributes), + resource.TestCheckResourceAttr(resourceName, "fifo_queue", "true"), ), }, { - ResourceName: "aws_sqs_queue.queue", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -324,6 +330,7 @@ func TestAccAWSSQSQueue_FIFOExpectNameError(t *testing.T) { func TestAccAWSSQSQueue_FIFOWithContentBasedDeduplication(t *testing.T) { var queueAttributes map[string]*string + resourceName := "aws_sqs_queue.queue" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -332,13 +339,13 @@ func TestAccAWSSQSQueue_FIFOWithContentBasedDeduplication(t *testing.T) { { Config: testAccAWSSQSConfigWithFIFOContentBasedDeduplication(acctest.RandString(10)), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSQSQueueExists("aws_sqs_queue.queue", &queueAttributes), - resource.TestCheckResourceAttr("aws_sqs_queue.queue", "fifo_queue", "true"), - resource.TestCheckResourceAttr("aws_sqs_queue.queue", "content_based_deduplication", "true"), + testAccCheckAWSSQSQueueExists(resourceName, &queueAttributes), + resource.TestCheckResourceAttr(resourceName, "fifo_queue", "true"), + resource.TestCheckResourceAttr(resourceName, "content_based_deduplication", "true"), ), }, { - ResourceName: "aws_sqs_queue.queue", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ @@ -366,6 +373,7 @@ func TestAccAWSSQSQueue_ExpectContentBasedDeduplicationError(t *testing.T) { func TestAccAWSSQSQueue_Encryption(t *testing.T) { var queueAttributes map[string]*string + resourceName := "aws_sqs_queue.queue" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -374,12 +382,12 @@ func TestAccAWSSQSQueue_Encryption(t *testing.T) { { Config: testAccAWSSQSConfigWithEncryption(acctest.RandString(10)), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSQSQueueExists("aws_sqs_queue.queue", &queueAttributes), - resource.TestCheckResourceAttr("aws_sqs_queue.queue", "kms_master_key_id", "alias/aws/sqs"), + testAccCheckAWSSQSQueueExists(resourceName, &queueAttributes), + resource.TestCheckResourceAttr(resourceName, "kms_master_key_id", "alias/aws/sqs"), ), }, { - ResourceName: "aws_sqs_queue.queue", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, ImportStateVerifyIgnore: []string{ diff --git a/aws/resource_aws_ssm_activation.go b/aws/resource_aws_ssm_activation.go index b79972fc44c..c26d649c173 100644 --- a/aws/resource_aws_ssm_activation.go +++ b/aws/resource_aws_ssm_activation.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsSsmActivation() *schema.Resource { @@ -36,6 +37,7 @@ func resourceAwsSsmActivation() *schema.Resource { "expiration_date": { Type: schema.TypeString, Optional: true, + Computed: true, ForceNew: true, ValidateFunc: validation.ValidateRFC3339TimeString, }, @@ -92,7 +94,7 @@ func resourceAwsSsmActivationCreate(d *schema.ResourceData, meta interface{}) er activationInput.RegistrationLimit = aws.Int64(int64(d.Get("registration_limit").(int))) } if v, ok := d.GetOk("tags"); ok { - activationInput.Tags = tagsFromMapSSM(v.(map[string]interface{})) + activationInput.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().SsmTags() } // Retry to allow iam_role to be created and policy attachment to take place @@ -149,17 +151,22 @@ func resourceAwsSsmActivationRead(d *schema.ResourceData, meta interface{}) erro return fmt.Errorf("Error reading SSM activation: %s", err) } if resp.ActivationList == nil || len(resp.ActivationList) == 0 { - return fmt.Errorf("ActivationList was nil or empty") + log.Printf("[WARN] SSM Activation (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil } 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("expiration_date", aws.TimeValue(activation.ExpirationDate).Format(time.RFC3339)) d.Set("expired", activation.Expired) d.Set("iam_role", activation.IamRole) d.Set("registration_limit", activation.RegistrationLimit) d.Set("registration_count", activation.RegistrationsCount) + if err := d.Set("tags", keyvaluetags.SsmKeyValueTags(activation.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } diff --git a/aws/resource_aws_ssm_activation_test.go b/aws/resource_aws_ssm_activation_test.go index a6088d3ba94..a51091d9c19 100644 --- a/aws/resource_aws_ssm_activation_test.go +++ b/aws/resource_aws_ssm_activation_test.go @@ -15,8 +15,10 @@ import ( func TestAccAWSSSMActivation_basic(t *testing.T) { var ssmActivation ssm.Activation - name := acctest.RandString(10) - tag := acctest.RandString(10) + name := acctest.RandomWithPrefix("tf-acc") + tag := acctest.RandomWithPrefix("tf-acc") + resourceName := "aws_ssm_activation.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -25,10 +27,11 @@ func TestAccAWSSSMActivation_basic(t *testing.T) { { Config: testAccAWSSSMActivationBasicConfig(name, tag), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSSMActivationExists("aws_ssm_activation.foo", &ssmActivation), - resource.TestCheckResourceAttrSet("aws_ssm_activation.foo", "activation_code"), - resource.TestCheckResourceAttr("aws_ssm_activation.foo", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_ssm_activation.foo", "tags.Name", tag)), + testAccCheckAWSSSMActivationExists(resourceName, &ssmActivation), + resource.TestCheckResourceAttrSet(resourceName, "activation_code"), + testAccCheckResourceAttrRfc3339(resourceName, "expiration_date"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", tag)), }, }, }) @@ -36,7 +39,9 @@ func TestAccAWSSSMActivation_basic(t *testing.T) { func TestAccAWSSSMActivation_update(t *testing.T) { var ssmActivation1, ssmActivation2 ssm.Activation - name := acctest.RandString(10) + name := acctest.RandomWithPrefix("tf-acc") + resourceName := "aws_ssm_activation.test" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -45,19 +50,19 @@ func TestAccAWSSSMActivation_update(t *testing.T) { { Config: testAccAWSSSMActivationBasicConfig(name, "My Activation"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSSMActivationExists("aws_ssm_activation.foo", &ssmActivation1), - resource.TestCheckResourceAttrSet("aws_ssm_activation.foo", "activation_code"), - resource.TestCheckResourceAttr("aws_ssm_activation.foo", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_ssm_activation.foo", "tags.Name", "My Activation"), + testAccCheckAWSSSMActivationExists(resourceName, &ssmActivation1), + resource.TestCheckResourceAttrSet(resourceName, "activation_code"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", "My Activation"), ), }, { Config: testAccAWSSSMActivationBasicConfig(name, "Foo"), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSSMActivationExists("aws_ssm_activation.foo", &ssmActivation2), - resource.TestCheckResourceAttrSet("aws_ssm_activation.foo", "activation_code"), - resource.TestCheckResourceAttr("aws_ssm_activation.foo", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_ssm_activation.foo", "tags.Name", "Foo"), + testAccCheckAWSSSMActivationExists(resourceName, &ssmActivation2), + resource.TestCheckResourceAttrSet(resourceName, "activation_code"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", "Foo"), testAccCheckAWSSSMActivationRecreated(t, &ssmActivation1, &ssmActivation2), ), }, @@ -67,10 +72,10 @@ func TestAccAWSSSMActivation_update(t *testing.T) { func TestAccAWSSSMActivation_expirationDate(t *testing.T) { var ssmActivation ssm.Activation - rName := acctest.RandString(10) - expirationTime := time.Now().Add(48 * time.Hour) + rName := acctest.RandomWithPrefix("tf-acc") + expirationTime := time.Now().Add(48 * time.Hour).UTC() expirationDateS := expirationTime.Format(time.RFC3339) - resourceName := "aws_ssm_activation.foo" + resourceName := "aws_ssm_activation.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -92,6 +97,29 @@ func TestAccAWSSSMActivation_expirationDate(t *testing.T) { }) } +func TestAccAWSSSMActivation_disappears(t *testing.T) { + var ssmActivation ssm.Activation + name := acctest.RandomWithPrefix("tf-acc") + tag := acctest.RandomWithPrefix("tf-acc") + resourceName := "aws_ssm_activation.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSSMActivationDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSSMActivationBasicConfig(name, tag), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSSMActivationExists(resourceName, &ssmActivation), + testAccCheckAWSSSMActivationDisappears(&ssmActivation), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + func testAccCheckAWSSSMActivationRecreated(t *testing.T, before, after *ssm.Activation) resource.TestCheckFunc { return func(s *terraform.State) error { if *before.ActivationId == *after.ActivationId { @@ -136,6 +164,19 @@ func testAccCheckAWSSSMActivationExists(n string, ssmActivation *ssm.Activation) } } +func testAccCheckAWSSSMActivationDisappears(a *ssm.Activation) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).ssmconn + + input := &ssm.DeleteActivationInput{ActivationId: a.ActivationId} + _, err := conn.DeleteActivation(input) + if err != nil { + return fmt.Errorf("Error deleting SSM Activation: %s", err) + } + return nil + } +} + func testAccCheckAWSSSMActivationDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).ssmconn @@ -156,24 +197,27 @@ func testAccCheckAWSSSMActivationDestroy(s *terraform.State) error { MaxResults: aws.Int64(1), }) - if err != nil { - return err + if err == nil { + if len(out.ActivationList) != 0 && + *out.ActivationList[0].ActivationId == rs.Primary.ID { + return fmt.Errorf("SSM Activation still exists") + } } - if len(out.ActivationList) > 0 { - return fmt.Errorf("Expected AWS SSM Activation to be gone, but was still found") + if err != nil { + return err } return nil } - return fmt.Errorf("Default error in SSM Activation Test") + return nil } -func testAccAWSSSMActivationBasicConfig(rName string, rTag string) string { +func testAccAWSSSMActivationBasicConfigBase(rName string) string { return fmt.Sprintf(` resource "aws_iam_role" "test_role" { - name = "test_role-%s" + name = %[1]q assume_role_policy = < 0 { - return fmt.Errorf("Expected AWS SSM Maintenance Document to be gone, but was still found") + // Return nil if the SSM Maintenance Window is already destroyed + if isAWSErr(err, ssm.ErrCodeDoesNotExistException, "") { + continue } - return nil + return err } return nil @@ -488,19 +595,47 @@ resource "aws_ssm_maintenance_window" "test" { `, rName) } -func testAccAWSSSMMaintenanceWindowConfigTags(rName string) string { +func testAccAWSSSMMaintenanceWindowConfigDescription(rName, desc string) string { + return fmt.Sprintf(` +resource "aws_ssm_maintenance_window" "test" { + cutoff = 1 + duration = 3 + name = %[1]q + description = %[2]q + schedule = "cron(0 16 ? * TUE *)" +} +`, rName, desc) +} + +func testAccAWSSSMMaintenanceWindowConfigTags1(rName, tagKey1, tagValue1 string) string { return fmt.Sprintf(` resource "aws_ssm_maintenance_window" "test" { cutoff = 1 duration = 3 - name = %q + name = %[1]q schedule = "cron(0 16 ? * TUE *)" tags = { - Name = "My Maintenance Window" + %[2]q = %[3]q } } -`, rName) +`, rName, tagKey1, tagValue1) +} + +func testAccAWSSSMMaintenanceWindowConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_ssm_maintenance_window" "test" { + cutoff = 1 + duration = 3 + name = %[1]q + schedule = "cron(0 16 ? * TUE *)" + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) } func testAccAWSSSMMaintenanceWindowConfigCutoff(rName string, cutoff int) string { diff --git a/aws/resource_aws_ssm_parameter.go b/aws/resource_aws_ssm_parameter.go index 95ecb8e72d0..43d87163157 100644 --- a/aws/resource_aws_ssm_parameter.go +++ b/aws/resource_aws_ssm_parameter.go @@ -11,6 +11,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/customdiff" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsSsmParameter() *schema.Resource { @@ -122,7 +123,8 @@ func resourceAwsSsmParameterRead(d *schema.ResourceData, meta interface{}) error } param := resp.Parameter - d.Set("name", param.Name) + name := *param.Name + d.Set("name", name) d.Set("type", param.Type) d.Set("value", param.Value) d.Set("version", param.Version) @@ -132,7 +134,7 @@ func resourceAwsSsmParameterRead(d *schema.ResourceData, meta interface{}) error { Key: aws.String("Name"), Option: aws.String("Equals"), - Values: []*string{aws.String(d.Get("name").(string))}, + Values: []*string{aws.String(name)}, }, }, } @@ -156,13 +158,14 @@ func resourceAwsSsmParameterRead(d *schema.ResourceData, meta interface{}) error } d.Set("allowed_pattern", detail.AllowedPattern) - if tagList, err := ssmconn.ListTagsForResource(&ssm.ListTagsForResourceInput{ - ResourceId: aws.String(d.Get("name").(string)), - ResourceType: aws.String("Parameter"), - }); err != nil { - return fmt.Errorf("Failed to get SSM parameter tags for %s: %s", d.Get("name"), err) - } else { - d.Set("tags", tagsToMapSSM(tagList.TagList)) + tags, err := keyvaluetags.SsmListTags(ssmconn, name, ssm.ResourceTypeForTaggingParameter) + + if err != nil { + return fmt.Errorf("error listing tags for SSM Maintenance Window (%s): %s", name, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } arn := arn.ARN{ @@ -211,8 +214,7 @@ func resourceAwsSsmParameterPut(d *schema.ResourceData, meta interface{}) error paramInput.Description = aws.String(n.(string)) } - if keyID, ok := d.GetOk("key_id"); ok { - log.Printf("[DEBUG] Setting key_id for SSM Parameter %v: %s", d.Get("name"), keyID) + if keyID, ok := d.GetOk("key_id"); ok && d.Get("type").(string) == ssm.ParameterTypeSecureString { paramInput.SetKeyId(keyID.(string)) } @@ -228,8 +230,13 @@ func resourceAwsSsmParameterPut(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("error creating SSM parameter: %s", err) } - if err := setTagsSSM(ssmconn, d, d.Get("name").(string), "Parameter"); err != nil { - return fmt.Errorf("error creating SSM parameter tags: %s", err) + name := d.Get("name").(string) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.SsmUpdateTags(ssmconn, name, ssm.ResourceTypeForTaggingParameter, o, n); err != nil { + return fmt.Errorf("error updating SSM Parameter (%s) tags: %s", name, err) + } } d.SetId(d.Get("name").(string)) diff --git a/aws/resource_aws_ssm_parameter_test.go b/aws/resource_aws_ssm_parameter_test.go index 173b6dfe90a..0d099a7fffd 100644 --- a/aws/resource_aws_ssm_parameter_test.go +++ b/aws/resource_aws_ssm_parameter_test.go @@ -29,8 +29,7 @@ func TestAccAWSSSMParameter_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "value", "test2"), resource.TestCheckResourceAttr(resourceName, "type", "String"), resource.TestCheckResourceAttr(resourceName, "tier", "Standard"), - resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), - resource.TestCheckResourceAttr(resourceName, "tags.Name", "My Parameter"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttrSet(resourceName, "version"), ), }, @@ -138,9 +137,9 @@ func TestAccAWSSSMParameter_overwrite(t *testing.T) { }) } -func TestAccAWSSSMParameter_updateTags(t *testing.T) { +func TestAccAWSSSMParameter_tags(t *testing.T) { var param ssm.Parameter - name := fmt.Sprintf("%s_%s", t.Name(), acctest.RandString(10)) + rName := fmt.Sprintf("%s_%s", t.Name(), acctest.RandString(10)) resourceName := "aws_ssm_parameter.test" resource.ParallelTest(t, resource.TestCase{ @@ -149,7 +148,12 @@ func TestAccAWSSSMParameter_updateTags(t *testing.T) { CheckDestroy: testAccCheckAWSSSMParameterDestroy, Steps: []resource.TestStep{ { - Config: testAccAWSSSMParameterBasicConfig(name, "String", "test2"), + Config: testAccAWSSSMParameterBasicConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSSMParameterExists(resourceName, ¶m), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), }, { ResourceName: resourceName, @@ -158,12 +162,50 @@ func TestAccAWSSSMParameter_updateTags(t *testing.T) { ImportStateVerifyIgnore: []string{"overwrite"}, }, { - Config: testAccAWSSSMParameterBasicConfigTagsUpdated(name, "String", "test3"), + Config: testAccAWSSSMParameterBasicConfigTags2(rName, "key1", "value1updated", "key2", "value2"), Check: resource.ComposeTestCheckFunc( testAccCheckAWSSSMParameterExists(resourceName, ¶m), resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), - resource.TestCheckResourceAttr(resourceName, "tags.Name", "My Parameter Updated"), - resource.TestCheckResourceAttr(resourceName, "tags.AnotherTag", "AnotherTagValue"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSSSMParameterBasicConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSSMParameterExists(resourceName, ¶m), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + +func TestAccAWSSSMParameter_updateType(t *testing.T) { + var param ssm.Parameter + name := fmt.Sprintf("%s_%s", t.Name(), acctest.RandString(10)) + resourceName := "aws_ssm_parameter.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSSMParameterDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSSMParameterBasicConfig(name, "SecureString", "test2"), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"overwrite"}, + }, + { + Config: testAccAWSSSMParameterBasicConfig(name, "String", "test2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSSMParameterExists(resourceName, ¶m), + resource.TestCheckResourceAttr(resourceName, "type", "String"), ), }, }, @@ -449,13 +491,9 @@ func testAccCheckAWSSSMParameterDestroy(s *terraform.State) error { func testAccAWSSSMParameterBasicConfig(rName, pType, value string) string { return fmt.Sprintf(` resource "aws_ssm_parameter" "test" { - name = "%s" - type = "%s" - value = "%s" - - tags = { - Name = "My Parameter" - } + name = %[1]q + type = %[2]q + value = %[3]q } `, rName, pType, value) } @@ -471,19 +509,33 @@ resource "aws_ssm_parameter" "test" { `, rName, tier) } -func testAccAWSSSMParameterBasicConfigTagsUpdated(rName, pType, value string) string { +func testAccAWSSSMParameterBasicConfigTags1(rName, tagKey1, tagValue1 string) string { return fmt.Sprintf(` resource "aws_ssm_parameter" "test" { - name = "%s" - type = "%s" - value = "%s" + name = %[1]q + type = "String" + value = %[1]q tags = { - Name = "My Parameter Updated" - AnotherTag = "AnotherTagValue" + %[2]q = %[3]q } } -`, rName, pType, value) +`, rName, tagKey1, tagValue1) +} + +func testAccAWSSSMParameterBasicConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_ssm_parameter" "test" { + name = %[1]q + type = "String" + value = %[1]q + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) } func testAccAWSSSMParameterBasicConfigOverwrite(rName, pType, value string) string { diff --git a/aws/resource_aws_ssm_patch_baseline.go b/aws/resource_aws_ssm_patch_baseline.go index b25929b47b7..d1853aa69d7 100644 --- a/aws/resource_aws_ssm_patch_baseline.go +++ b/aws/resource_aws_ssm_patch_baseline.go @@ -8,6 +8,7 @@ import ( "github.com/aws/aws-sdk-go/service/ssm" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) var ssmPatchComplianceLevels = []string{ @@ -157,7 +158,7 @@ func resourceAwsSsmPatchBaselineCreate(d *schema.ResourceData, meta interface{}) } if v, ok := d.GetOk("tags"); ok { - params.Tags = tagsFromMapSSM(v.(map[string]interface{})) + params.Tags = keyvaluetags.New(v.(map[string]interface{})).IgnoreAws().SsmTags() } if v, ok := d.GetOk("description"); ok { @@ -235,8 +236,10 @@ func resourceAwsSsmPatchBaselineUpdate(d *schema.ResourceData, meta interface{}) } if d.HasChange("tags") { - if err := setTagsSSM(ssmconn, d, d.Id(), ssm.ResourceTypeForTaggingPatchBaseline); err != nil { - return fmt.Errorf("error setting tags for SSM Patch Baseline (%s): %s", d.Id(), err) + o, n := d.GetChange("tags") + + if err := keyvaluetags.SsmUpdateTags(ssmconn, d.Id(), ssm.ResourceTypeForTaggingPatchBaseline, o, n); err != nil { + return fmt.Errorf("error updating SSM Patch Baseline (%s) tags: %s", d.Id(), err) } } @@ -274,8 +277,14 @@ func resourceAwsSsmPatchBaselineRead(d *schema.ResourceData, meta interface{}) e return fmt.Errorf("Error setting approval rules error: %#v", err) } - if err := saveTagsSSM(ssmconn, d, d.Id(), ssm.ResourceTypeForTaggingPatchBaseline); err != nil { - return fmt.Errorf("error saving tags for SSM Patch Baseline (%s): %s", d.Id(), err) + tags, err := keyvaluetags.SsmListTags(ssmconn, d.Id(), ssm.ResourceTypeForTaggingPatchBaseline) + + if err != nil { + return fmt.Errorf("error listing tags for SSM Patch Baseline (%s): %s", d.Id(), err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) } return nil diff --git a/aws/resource_aws_ssm_patch_baseline_test.go b/aws/resource_aws_ssm_patch_baseline_test.go index d568dd4dacd..f9bdc34cf9b 100644 --- a/aws/resource_aws_ssm_patch_baseline_test.go +++ b/aws/resource_aws_ssm_patch_baseline_test.go @@ -14,6 +14,7 @@ import ( func TestAccAWSSSMPatchBaseline_basic(t *testing.T) { var before, after ssm.PatchBaselineIdentity name := acctest.RandString(10) + resourceName := "aws_ssm_patch_baseline.foo" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -22,45 +23,31 @@ func TestAccAWSSSMPatchBaseline_basic(t *testing.T) { { Config: testAccAWSSSMPatchBaselineBasicConfig(name), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSSMPatchBaselineExists("aws_ssm_patch_baseline.foo", &before), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approved_patches.#", "1"), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approved_patches.2062620480", "KB123456"), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "name", fmt.Sprintf("patch-baseline-%s", name)), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approved_patches_compliance_level", ssm.PatchComplianceLevelCritical), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "description", "Baseline containing all updates approved for production systems"), - resource.TestCheckResourceAttr("aws_ssm_patch_baseline.foo", "tags.%", "1"), - resource.TestCheckResourceAttr("aws_ssm_patch_baseline.foo", "tags.Name", "My Patch Baseline"), + testAccCheckAWSSSMPatchBaselineExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "approved_patches.#", "1"), + resource.TestCheckResourceAttr(resourceName, "approved_patches.2062620480", "KB123456"), + resource.TestCheckResourceAttr(resourceName, "name", fmt.Sprintf("patch-baseline-%s", name)), + resource.TestCheckResourceAttr(resourceName, "approved_patches_compliance_level", ssm.PatchComplianceLevelCritical), + resource.TestCheckResourceAttr(resourceName, "description", "Baseline containing all updates approved for production systems"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), ), }, { - ResourceName: "aws_ssm_patch_baseline.foo", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { Config: testAccAWSSSMPatchBaselineBasicConfigUpdated(name), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSSMPatchBaselineExists("aws_ssm_patch_baseline.foo", &after), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approved_patches.#", "2"), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approved_patches.2062620480", "KB123456"), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approved_patches.2291496788", "KB456789"), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "name", fmt.Sprintf("updated-patch-baseline-%s", name)), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approved_patches_compliance_level", ssm.PatchComplianceLevelHigh), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "description", "Baseline containing all updates approved for production systems - August 2017"), - resource.TestCheckResourceAttr("aws_ssm_patch_baseline.foo", "tags.%", "2"), - resource.TestCheckResourceAttr("aws_ssm_patch_baseline.foo", "tags.Name", "My Patch Baseline Aug 17"), - resource.TestCheckResourceAttr("aws_ssm_patch_baseline.foo", "tags.Environment", "production"), + testAccCheckAWSSSMPatchBaselineExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "approved_patches.#", "2"), + resource.TestCheckResourceAttr(resourceName, "approved_patches.2062620480", "KB123456"), + resource.TestCheckResourceAttr(resourceName, "approved_patches.2291496788", "KB456789"), + resource.TestCheckResourceAttr(resourceName, "name", fmt.Sprintf("updated-patch-baseline-%s", name)), + resource.TestCheckResourceAttr(resourceName, "approved_patches_compliance_level", ssm.PatchComplianceLevelHigh), + resource.TestCheckResourceAttr(resourceName, "description", "Baseline containing all updates approved for production systems - August 2017"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), func(*terraform.State) error { if *before.BaselineId != *after.BaselineId { t.Fatal("Baseline IDs changed unexpectedly") @@ -73,6 +60,49 @@ func TestAccAWSSSMPatchBaseline_basic(t *testing.T) { }) } +func TestAccAWSSSMPatchBaseline_tags(t *testing.T) { + var patch ssm.PatchBaselineIdentity + name := acctest.RandString(10) + resourceName := "aws_ssm_patch_baseline.foo" + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSSMPatchBaselineDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSSMPatchBaselineBasicConfigTags1(name, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSSMPatchBaselineExists(resourceName, &patch), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSSSMPatchBaselineBasicConfigTags2(name, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSSMPatchBaselineExists(resourceName, &patch), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSSSMPatchBaselineBasicConfigTags1(name, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSSSMPatchBaselineExists(resourceName, &patch), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSSSMPatchBaseline_disappears(t *testing.T) { var identity ssm.PatchBaselineIdentity name := acctest.RandString(10) @@ -98,6 +128,7 @@ func TestAccAWSSSMPatchBaseline_disappears(t *testing.T) { func TestAccAWSSSMPatchBaseline_OperatingSystem(t *testing.T) { var before, after ssm.PatchBaselineIdentity name := acctest.RandString(10) + resourceName := "aws_ssm_patch_baseline.foo" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -106,40 +137,29 @@ func TestAccAWSSSMPatchBaseline_OperatingSystem(t *testing.T) { { Config: testAccAWSSSMPatchBaselineConfigWithOperatingSystem(name), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSSMPatchBaselineExists("aws_ssm_patch_baseline.foo", &before), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approval_rule.#", "1"), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approval_rule.0.approve_after_days", "7"), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approval_rule.0.patch_filter.#", "2"), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approval_rule.0.compliance_level", ssm.PatchComplianceLevelCritical), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approval_rule.0.enable_non_security", "true"), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "operating_system", "AMAZON_LINUX"), + testAccCheckAWSSSMPatchBaselineExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "approval_rule.#", "1"), + resource.TestCheckResourceAttr(resourceName, "approval_rule.0.approve_after_days", "7"), + resource.TestCheckResourceAttr(resourceName, "approval_rule.0.patch_filter.#", "2"), + resource.TestCheckResourceAttr(resourceName, "approval_rule.0.compliance_level", ssm.PatchComplianceLevelCritical), + resource.TestCheckResourceAttr(resourceName, "approval_rule.0.enable_non_security", "true"), + resource.TestCheckResourceAttr(resourceName, "operating_system", "AMAZON_LINUX"), ), }, { - ResourceName: "aws_ssm_patch_baseline.foo", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, { Config: testAccAWSSSMPatchBaselineConfigWithOperatingSystemUpdated(name), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSSSMPatchBaselineExists("aws_ssm_patch_baseline.foo", &after), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approval_rule.#", "1"), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approval_rule.0.approve_after_days", "7"), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approval_rule.0.patch_filter.#", "2"), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "approval_rule.0.compliance_level", ssm.PatchComplianceLevelInformational), - resource.TestCheckResourceAttr( - "aws_ssm_patch_baseline.foo", "operating_system", ssm.OperatingSystemWindows), + testAccCheckAWSSSMPatchBaselineExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "approval_rule.#", "1"), + resource.TestCheckResourceAttr(resourceName, "approval_rule.0.approve_after_days", "7"), + resource.TestCheckResourceAttr(resourceName, "approval_rule.0.patch_filter.#", "2"), + resource.TestCheckResourceAttr(resourceName, "approval_rule.0.compliance_level", ssm.PatchComplianceLevelInformational), + resource.TestCheckResourceAttr(resourceName, "operating_system", ssm.OperatingSystemWindows), testAccCheckAwsSsmPatchBaselineRecreated(t, &before, &after), ), }, @@ -249,12 +269,39 @@ resource "aws_ssm_patch_baseline" "foo" { description = "Baseline containing all updates approved for production systems" approved_patches = ["KB123456"] approved_patches_compliance_level = "CRITICAL" +} +`, rName) +} + +func testAccAWSSSMPatchBaselineBasicConfigTags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_ssm_patch_baseline" "foo" { + name = %[1]q + description = "Baseline containing all updates approved for production systems" + approved_patches = ["KB123456"] + approved_patches_compliance_level = "CRITICAL" tags = { - Name = "My Patch Baseline" + %[2]q = %[3]q } } -`, rName) +`, rName, tagKey1, tagValue1) +} + +func testAccAWSSSMPatchBaselineBasicConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_ssm_patch_baseline" "foo" { + name = %[1]q + description = "Baseline containing all updates approved for production systems" + approved_patches = ["KB123456"] + approved_patches_compliance_level = "CRITICAL" + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) } func testAccAWSSSMPatchBaselineBasicConfigUpdated(rName string) string { @@ -264,11 +311,6 @@ resource "aws_ssm_patch_baseline" "foo" { description = "Baseline containing all updates approved for production systems - August 2017" approved_patches = ["KB123456", "KB456789"] approved_patches_compliance_level = "HIGH" - - tags = { - Name = "My Patch Baseline Aug 17" - Environment = "production" - } } `, rName) } diff --git a/aws/resource_aws_storagegateway_cached_iscsi_volume.go b/aws/resource_aws_storagegateway_cached_iscsi_volume.go index b61abcb28c0..23905e78c55 100644 --- a/aws/resource_aws_storagegateway_cached_iscsi_volume.go +++ b/aws/resource_aws_storagegateway_cached_iscsi_volume.go @@ -6,18 +6,19 @@ import ( "strings" "time" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/storagegateway" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsStorageGatewayCachedIscsiVolume() *schema.Resource { return &schema.Resource{ Create: resourceAwsStorageGatewayCachedIscsiVolumeCreate, Read: resourceAwsStorageGatewayCachedIscsiVolumeRead, + Update: resourceAwsStorageGatewayCachedIscsiVolumeUpdate, Delete: resourceAwsStorageGatewayCachedIscsiVolumeDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, @@ -85,6 +86,7 @@ func resourceAwsStorageGatewayCachedIscsiVolume() *schema.Resource { Required: true, ForceNew: true, }, + "tags": tagsSchema(), }, } } @@ -98,6 +100,7 @@ func resourceAwsStorageGatewayCachedIscsiVolumeCreate(d *schema.ResourceData, me NetworkInterfaceId: aws.String(d.Get("network_interface_id").(string)), TargetName: aws.String(d.Get("target_name").(string)), VolumeSizeInBytes: aws.Int64(int64(d.Get("volume_size_in_bytes").(int))), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().StoragegatewayTags(), } if v, ok := d.GetOk("snapshot_id"); ok { @@ -119,6 +122,19 @@ func resourceAwsStorageGatewayCachedIscsiVolumeCreate(d *schema.ResourceData, me return resourceAwsStorageGatewayCachedIscsiVolumeRead(d, meta) } +func resourceAwsStorageGatewayCachedIscsiVolumeUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).storagegatewayconn + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.StoragegatewayUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + + return resourceAwsStorageGatewayCachedIscsiVolumeRead(d, meta) +} + func resourceAwsStorageGatewayCachedIscsiVolumeRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).storagegatewayconn @@ -146,12 +162,21 @@ func resourceAwsStorageGatewayCachedIscsiVolumeRead(d *schema.ResourceData, meta volume := output.CachediSCSIVolumes[0] - d.Set("arn", aws.StringValue(volume.VolumeARN)) + arn := aws.StringValue(volume.VolumeARN) + d.Set("arn", arn) d.Set("snapshot_id", aws.StringValue(volume.SourceSnapshotId)) - d.Set("volume_arn", aws.StringValue(volume.VolumeARN)) + d.Set("volume_arn", arn) d.Set("volume_id", aws.StringValue(volume.VolumeId)) d.Set("volume_size_in_bytes", int(aws.Int64Value(volume.VolumeSizeInBytes))) + tags, err := keyvaluetags.StoragegatewayListTags(conn, arn) + if err != nil { + return fmt.Errorf("error listing tags for resource (%s): %s", arn, err) + } + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + if volume.VolumeiSCSIAttributes != nil { d.Set("chap_enabled", aws.BoolValue(volume.VolumeiSCSIAttributes.ChapEnabled)) d.Set("lun_number", int(aws.Int64Value(volume.VolumeiSCSIAttributes.LunNumber))) diff --git a/aws/resource_aws_storagegateway_cached_iscsi_volume_test.go b/aws/resource_aws_storagegateway_cached_iscsi_volume_test.go index 999f8e80ec9..444fbd3d490 100644 --- a/aws/resource_aws_storagegateway_cached_iscsi_volume_test.go +++ b/aws/resource_aws_storagegateway_cached_iscsi_volume_test.go @@ -82,17 +82,17 @@ func TestAccAWSStorageGatewayCachedIscsiVolume_Basic(t *testing.T) { Config: testAccAWSStorageGatewayCachedIscsiVolumeConfig_Basic(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSStorageGatewayCachedIscsiVolumeExists(resourceName, &cachedIscsiVolume), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:\d{12}:gateway/sgw-.+/volume/vol-.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+/volume/vol-.+`)), resource.TestCheckResourceAttr(resourceName, "chap_enabled", "false"), - resource.TestMatchResourceAttr(resourceName, "gateway_arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:\d{12}:gateway/sgw-.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "gateway_arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+`)), resource.TestCheckResourceAttr(resourceName, "lun_number", "0"), resource.TestMatchResourceAttr(resourceName, "network_interface_id", regexp.MustCompile(`^\d+\.\d+\.\d+\.\d+$`)), resource.TestMatchResourceAttr(resourceName, "network_interface_port", regexp.MustCompile(`^\d+$`)), resource.TestCheckResourceAttr(resourceName, "snapshot_id", ""), - resource.TestMatchResourceAttr(resourceName, "target_arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:storagegateway:[^:]+:\\d{12}:gateway/sgw-.+/target/iqn.1997-05.com.amazon:%s$", rName))), + testAccMatchResourceAttrRegionalARN(resourceName, "target_arn", "storagegateway", regexp.MustCompile(fmt.Sprintf(`gateway/sgw-.+/target/iqn.1997-05.com.amazon:%s`, rName))), resource.TestCheckResourceAttr(resourceName, "target_name", rName), resource.TestMatchResourceAttr(resourceName, "volume_id", regexp.MustCompile(`^vol-.+$`)), - resource.TestMatchResourceAttr(resourceName, "volume_arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:\d{12}:gateway/sgw-.+/volume/vol-.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "volume_arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+/volume/vol-.`)), resource.TestCheckResourceAttr(resourceName, "volume_size_in_bytes", "5368709120"), ), }, @@ -105,6 +105,53 @@ func TestAccAWSStorageGatewayCachedIscsiVolume_Basic(t *testing.T) { }) } +func TestAccAWSStorageGatewayCachedIscsiVolume_Tags(t *testing.T) { + var cachedIscsiVolume storagegateway.CachediSCSIVolume + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_storagegateway_cached_iscsi_volume.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSStorageGatewayCachedIscsiVolumeDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSStorageGatewayCachedIscsiVolumeConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewayCachedIscsiVolumeExists(resourceName, &cachedIscsiVolume), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+/volume/vol-.+`)), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSStorageGatewayCachedIscsiVolumeConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewayCachedIscsiVolumeExists(resourceName, &cachedIscsiVolume), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+/volume/vol-.+`)), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSStorageGatewayCachedIscsiVolumeConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewayCachedIscsiVolumeExists(resourceName, &cachedIscsiVolume), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+/volume/vol-.+`)), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSStorageGatewayCachedIscsiVolume_SnapshotId(t *testing.T) { var cachedIscsiVolume storagegateway.CachediSCSIVolume rName := acctest.RandomWithPrefix("tf-acc-test") @@ -119,17 +166,17 @@ func TestAccAWSStorageGatewayCachedIscsiVolume_SnapshotId(t *testing.T) { Config: testAccAWSStorageGatewayCachedIscsiVolumeConfig_SnapshotId(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSStorageGatewayCachedIscsiVolumeExists(resourceName, &cachedIscsiVolume), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:\d{12}:gateway/sgw-.+/volume/vol-.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+/volume/vol-.+`)), resource.TestCheckResourceAttr(resourceName, "chap_enabled", "false"), - resource.TestMatchResourceAttr(resourceName, "gateway_arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:\d{12}:gateway/sgw-.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "gateway_arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+`)), resource.TestCheckResourceAttr(resourceName, "lun_number", "0"), resource.TestMatchResourceAttr(resourceName, "network_interface_id", regexp.MustCompile(`^\d+\.\d+\.\d+\.\d+$`)), resource.TestMatchResourceAttr(resourceName, "network_interface_port", regexp.MustCompile(`^\d+$`)), resource.TestMatchResourceAttr(resourceName, "snapshot_id", regexp.MustCompile(`^snap-.+$`)), - resource.TestMatchResourceAttr(resourceName, "target_arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:storagegateway:[^:]+:\\d{12}:gateway/sgw-.+/target/iqn.1997-05.com.amazon:%s$", rName))), + testAccMatchResourceAttrRegionalARN(resourceName, "target_arn", "storagegateway", regexp.MustCompile(fmt.Sprintf(`gateway/sgw-.+/target/iqn.1997-05.com.amazon:%s`, rName))), resource.TestCheckResourceAttr(resourceName, "target_name", rName), resource.TestMatchResourceAttr(resourceName, "volume_id", regexp.MustCompile(`^vol-.+$`)), - resource.TestMatchResourceAttr(resourceName, "volume_arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:\d{12}:gateway/sgw-.+/volume/vol-.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "volume_arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+/volume/vol-.`)), resource.TestCheckResourceAttr(resourceName, "volume_size_in_bytes", "5368709120"), ), }, @@ -157,16 +204,16 @@ func TestAccAWSStorageGatewayCachedIscsiVolume_SourceVolumeArn(t *testing.T) { Config: testAccAWSStorageGatewayCachedIscsiVolumeConfig_SourceVolumeArn(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSStorageGatewayCachedIscsiVolumeExists(resourceName, &cachedIscsiVolume), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:\d{12}:gateway/sgw-.+/volume/vol-.+$`)), - resource.TestMatchResourceAttr(resourceName, "gateway_arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:\d{12}:gateway/sgw-.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+/volume/vol-.+`)), + testAccMatchResourceAttrRegionalARN(resourceName, "gateway_arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+`)), resource.TestMatchResourceAttr(resourceName, "network_interface_id", regexp.MustCompile(`^\d+\.\d+\.\d+\.\d+$`)), resource.TestMatchResourceAttr(resourceName, "network_interface_port", regexp.MustCompile(`^\d+$`)), resource.TestCheckResourceAttr(resourceName, "snapshot_id", ""), - resource.TestMatchResourceAttr(resourceName, "source_volume_arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:\d{12}:gateway/sgw-.+/volume/vol-.+$`)), - resource.TestMatchResourceAttr(resourceName, "target_arn", regexp.MustCompile(fmt.Sprintf("^arn:[^:]+:storagegateway:[^:]+:\\d{12}:gateway/sgw-.+/target/iqn.1997-05.com.amazon:%s$", rName))), + testAccMatchResourceAttrRegionalARN(resourceName, "source_volume_arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+/volume/vol-.+`)), + testAccMatchResourceAttrRegionalARN(resourceName, "target_arn", "storagegateway", regexp.MustCompile(fmt.Sprintf(`gateway/sgw-.+/target/iqn.1997-05.com.amazon:%s`, rName))), resource.TestCheckResourceAttr(resourceName, "target_name", rName), resource.TestMatchResourceAttr(resourceName, "volume_id", regexp.MustCompile(`^vol-.+$`)), - resource.TestMatchResourceAttr(resourceName, "volume_arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:\d{12}:gateway/sgw-.+/volume/vol-.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "volume_arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+/volume/vol-.`)), resource.TestCheckResourceAttr(resourceName, "volume_size_in_bytes", "1073741824"), ), }, @@ -291,6 +338,109 @@ resource "aws_storagegateway_cached_iscsi_volume" "test" { `, rName, rName) } +func testAccAWSStorageGatewayCachedIscsiVolumeConfigTags1(rName, tagKey1, tagValue1 string) string { + return testAccAWSStorageGatewayGatewayConfig_GatewayType_Cached(rName) + fmt.Sprintf(` +resource "aws_ebs_volume" "test" { + availability_zone = "${aws_instance.test.availability_zone}" + size = 10 + type = "gp2" + + tags = { + Name = %q + } +} + +resource "aws_volume_attachment" "test" { + device_name = "/dev/xvdc" + force_detach = true + instance_id = "${aws_instance.test.id}" + volume_id = "${aws_ebs_volume.test.id}" +} + +data "aws_storagegateway_local_disk" "test" { + disk_path = "${aws_volume_attachment.test.device_name}" + gateway_arn = "${aws_storagegateway_gateway.test.arn}" +} + +resource "aws_storagegateway_cache" "test" { + # ACCEPTANCE TESTING WORKAROUND: + # Data sources are not refreshed before plan after apply in TestStep + # Step 0 error: After applying this step, the plan was not empty: + # disk_id: "0b68f77a-709b-4c79-ad9d-d7728014b291" => "/dev/xvdc" (forces new resource) + # We expect this data source value to change due to how Storage Gateway works. + lifecycle { + ignore_changes = ["disk_id"] + } + + disk_id = "${data.aws_storagegateway_local_disk.test.id}" + gateway_arn = "${aws_storagegateway_gateway.test.arn}" +} + +resource "aws_storagegateway_cached_iscsi_volume" "test" { + gateway_arn = "${aws_storagegateway_cache.test.gateway_arn}" + network_interface_id = "${aws_instance.test.private_ip}" + target_name = %q + volume_size_in_bytes = 5368709120 + + tags = { + %q = %q + } +} +`, rName, rName, tagKey1, tagValue1) +} + +func testAccAWSStorageGatewayCachedIscsiVolumeConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccAWSStorageGatewayGatewayConfig_GatewayType_Cached(rName) + fmt.Sprintf(` +resource "aws_ebs_volume" "test" { + availability_zone = "${aws_instance.test.availability_zone}" + size = 10 + type = "gp2" + + tags = { + Name = %q + } +} + +resource "aws_volume_attachment" "test" { + device_name = "/dev/xvdc" + force_detach = true + instance_id = "${aws_instance.test.id}" + volume_id = "${aws_ebs_volume.test.id}" +} + +data "aws_storagegateway_local_disk" "test" { + disk_path = "${aws_volume_attachment.test.device_name}" + gateway_arn = "${aws_storagegateway_gateway.test.arn}" +} + +resource "aws_storagegateway_cache" "test" { + # ACCEPTANCE TESTING WORKAROUND: + # Data sources are not refreshed before plan after apply in TestStep + # Step 0 error: After applying this step, the plan was not empty: + # disk_id: "0b68f77a-709b-4c79-ad9d-d7728014b291" => "/dev/xvdc" (forces new resource) + # We expect this data source value to change due to how Storage Gateway works. + lifecycle { + ignore_changes = ["disk_id"] + } + + disk_id = "${data.aws_storagegateway_local_disk.test.id}" + gateway_arn = "${aws_storagegateway_gateway.test.arn}" +} + +resource "aws_storagegateway_cached_iscsi_volume" "test" { + gateway_arn = "${aws_storagegateway_cache.test.gateway_arn}" + network_interface_id = "${aws_instance.test.private_ip}" + target_name = %q + volume_size_in_bytes = 5368709120 + + tags = { + %q = %q + %q = %q + } +} +`, rName, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + func testAccAWSStorageGatewayCachedIscsiVolumeConfig_SnapshotId(rName string) string { return testAccAWSStorageGatewayGatewayConfig_GatewayType_Cached(rName) + fmt.Sprintf(` resource "aws_ebs_volume" "cachevolume" { diff --git a/aws/resource_aws_storagegateway_gateway.go b/aws/resource_aws_storagegateway_gateway.go index f2c9b00b011..6389fc922d3 100644 --- a/aws/resource_aws_storagegateway_gateway.go +++ b/aws/resource_aws_storagegateway_gateway.go @@ -13,6 +13,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsStorageGatewayGateway() *schema.Resource { @@ -122,6 +123,12 @@ func resourceAwsStorageGatewayGateway() *schema.Resource { "IBM-ULT3580-TD5", }, false), }, + "tags": tagsSchema(), + "cloudwatch_log_group_arn": { + Type: schema.TypeString, + Optional: true, + ValidateFunc: validateArn, + }, }, } } @@ -196,6 +203,7 @@ func resourceAwsStorageGatewayGatewayCreate(d *schema.ResourceData, meta interfa GatewayName: aws.String(d.Get("gateway_name").(string)), GatewayTimezone: aws.String(d.Get("gateway_timezone").(string)), GatewayType: aws.String(d.Get("gateway_type").(string)), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().StoragegatewayTags(), } if v, ok := d.GetOk("medium_changer_type"); ok { @@ -269,6 +277,19 @@ func resourceAwsStorageGatewayGatewayCreate(d *schema.ResourceData, meta interfa } } + if v, ok := d.GetOk("cloudwatch_log_group_arn"); ok && v.(string) != "" { + input := &storagegateway.UpdateGatewayInformationInput{ + GatewayARN: aws.String(d.Id()), + CloudWatchLogGroupARN: aws.String(v.(string)), + } + + log.Printf("[DEBUG] Storage Gateway Gateway %q setting CloudWatch Log Group", input) + _, err := conn.UpdateGatewayInformation(input) + if err != nil { + return fmt.Errorf("error setting CloudWatch Log Group: %s", err) + } + } + return resourceAwsStorageGatewayGatewayRead(d, meta) } @@ -290,6 +311,10 @@ func resourceAwsStorageGatewayGatewayRead(d *schema.ResourceData, meta interface return fmt.Errorf("error reading Storage Gateway Gateway: %s", err) } + if err := d.Set("tags", keyvaluetags.StoragegatewayKeyValueTags(output.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + smbSettingsInput := &storagegateway.DescribeSMBSettingsInput{ GatewayARN: aws.String(d.Id()), } @@ -364,6 +389,7 @@ func resourceAwsStorageGatewayGatewayRead(d *schema.ResourceData, meta interface // The Storage Gateway API currently provides no way to read this value // We allow Terraform to passthrough the configuration value into the state d.Set("tape_drive_type", d.Get("tape_drive_type").(string)) + d.Set("cloudwatch_log_group_arn", output.CloudWatchLogGroupARN) return nil } @@ -371,11 +397,12 @@ func resourceAwsStorageGatewayGatewayRead(d *schema.ResourceData, meta interface func resourceAwsStorageGatewayGatewayUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).storagegatewayconn - if d.HasChange("gateway_name") || d.HasChange("gateway_timezone") { + if d.HasChange("gateway_name") || d.HasChange("gateway_timezone") || d.HasChange("cloudwatch_log_group_arn") { input := &storagegateway.UpdateGatewayInformationInput{ - GatewayARN: aws.String(d.Id()), - GatewayName: aws.String(d.Get("gateway_name").(string)), - GatewayTimezone: aws.String(d.Get("gateway_timezone").(string)), + GatewayARN: aws.String(d.Id()), + GatewayName: aws.String(d.Get("gateway_name").(string)), + GatewayTimezone: aws.String(d.Get("gateway_timezone").(string)), + CloudWatchLogGroupARN: aws.String(d.Get("cloudwatch_log_group_arn").(string)), } log.Printf("[DEBUG] Updating Storage Gateway Gateway: %s", input) @@ -385,6 +412,13 @@ func resourceAwsStorageGatewayGatewayUpdate(d *schema.ResourceData, meta interfa } } + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.StoragegatewayUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + if d.HasChange("smb_active_directory_settings") { l := d.Get("smb_active_directory_settings").([]interface{}) m := l[0].(map[string]interface{}) diff --git a/aws/resource_aws_storagegateway_gateway_test.go b/aws/resource_aws_storagegateway_gateway_test.go index 609ba2a61a9..720f4bf46c3 100644 --- a/aws/resource_aws_storagegateway_gateway_test.go +++ b/aws/resource_aws_storagegateway_gateway_test.go @@ -76,7 +76,7 @@ func TestAccAWSStorageGatewayGateway_GatewayType_Cached(t *testing.T) { Config: testAccAWSStorageGatewayGatewayConfig_GatewayType_Cached(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSStorageGatewayGatewayExists(resourceName, &gateway), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:[^:]+:gateway/sgw-.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+`)), resource.TestCheckResourceAttrSet(resourceName, "gateway_id"), resource.TestCheckResourceAttr(resourceName, "gateway_name", rName), resource.TestCheckResourceAttr(resourceName, "gateway_timezone", "GMT"), @@ -111,7 +111,7 @@ func TestAccAWSStorageGatewayGateway_GatewayType_FileS3(t *testing.T) { Config: testAccAWSStorageGatewayGatewayConfig_GatewayType_FileS3(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSStorageGatewayGatewayExists(resourceName, &gateway), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:[^:]+:gateway/sgw-.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+`)), resource.TestCheckResourceAttrSet(resourceName, "gateway_id"), resource.TestCheckResourceAttr(resourceName, "gateway_name", rName), resource.TestCheckResourceAttr(resourceName, "gateway_timezone", "GMT"), @@ -146,7 +146,7 @@ func TestAccAWSStorageGatewayGateway_GatewayType_Stored(t *testing.T) { Config: testAccAWSStorageGatewayGatewayConfig_GatewayType_Stored(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSStorageGatewayGatewayExists(resourceName, &gateway), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:[^:]+:gateway/sgw-.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+`)), resource.TestCheckResourceAttrSet(resourceName, "gateway_id"), resource.TestCheckResourceAttr(resourceName, "gateway_name", rName), resource.TestCheckResourceAttr(resourceName, "gateway_timezone", "GMT"), @@ -181,7 +181,7 @@ func TestAccAWSStorageGatewayGateway_GatewayType_Vtl(t *testing.T) { Config: testAccAWSStorageGatewayGatewayConfig_GatewayType_Vtl(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSStorageGatewayGatewayExists(resourceName, &gateway), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:[^:]+:gateway/sgw-.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+`)), resource.TestCheckResourceAttrSet(resourceName, "gateway_id"), resource.TestCheckResourceAttr(resourceName, "gateway_name", rName), resource.TestCheckResourceAttr(resourceName, "gateway_timezone", "GMT"), @@ -202,6 +202,52 @@ func TestAccAWSStorageGatewayGateway_GatewayType_Vtl(t *testing.T) { }) } +func TestAccAWSStorageGatewayGateway_tags(t *testing.T) { + var gateway storagegateway.DescribeGatewayInformationOutput + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_storagegateway_gateway.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSStorageGatewayGatewayConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewayGatewayExists(resourceName, &gateway), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`gateway/sgw-.+`)), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"activation_key", "gateway_ip_address"}, + }, + { + Config: testAccAWSStorageGatewayGatewayConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewayGatewayExists(resourceName, &gateway), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSStorageGatewayGatewayConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewayGatewayExists(resourceName, &gateway), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSStorageGatewayGateway_GatewayName(t *testing.T) { var gateway storagegateway.DescribeGatewayInformationOutput rName1 := acctest.RandomWithPrefix("tf-acc-test") @@ -237,6 +283,34 @@ func TestAccAWSStorageGatewayGateway_GatewayName(t *testing.T) { }) } +func TestAccAWSStorageGatewayGateway_CloudWatchLogs(t *testing.T) { + var gateway storagegateway.DescribeGatewayInformationOutput + rName1 := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_storagegateway_gateway.test" + resourceName2 := "aws_cloudwatch_log_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSStorageGatewayGatewayDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSStorageGatewayGatewayConfig_Log_Group(rName1), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewayGatewayExists(resourceName, &gateway), + resource.TestCheckResourceAttrPair(resourceName, "cloudwatch_log_group_arn", resourceName2, "arn"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"activation_key", "gateway_ip_address"}, + }, + }, + }) +} + func TestAccAWSStorageGatewayGateway_GatewayTimezone(t *testing.T) { var gateway storagegateway.DescribeGatewayInformationOutput rName := acctest.RandomWithPrefix("tf-acc-test") @@ -391,6 +465,12 @@ func testAccCheckAWSStorageGatewayGatewayExists(resourceName string, gateway *st // and security group, suitable for Storage Gateway EC2 instances of any type func testAccAWSStorageGateway_VPCBase(rName string) string { return fmt.Sprintf(` +data "aws_availability_zones" "available" { + # Error launching source instance: Unsupported: Your requested instance type (m4.xlarge) is not supported in your requested Availability Zone (us-west-2d). + blacklisted_zone_ids = ["usw2-az4"] + state = "available" +} + resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" @@ -400,8 +480,9 @@ resource "aws_vpc" "test" { } resource "aws_subnet" "test" { - cidr_block = "10.0.0.0/24" - vpc_id = "${aws_vpc.test.id}" + availability_zone = "${data.aws_availability_zones.available.names[0]}" + cidr_block = "10.0.0.0/24" + vpc_id = "${aws_vpc.test.id}" tags = { Name = %q @@ -542,6 +623,22 @@ resource "aws_storagegateway_gateway" "test" { `, rName) } +func testAccAWSStorageGatewayGatewayConfig_Log_Group(rName string) string { + return testAccAWSStorageGateway_FileGatewayBase(rName) + fmt.Sprintf(` +resource "aws_cloudwatch_log_group" "test" { + name = %[1]q +} + +resource "aws_storagegateway_gateway" "test" { + gateway_ip_address = "${aws_instance.test.public_ip}" + gateway_name = %[1]q + gateway_timezone = "GMT" + gateway_type = "FILE_S3" + cloudwatch_log_group_arn = "${aws_cloudwatch_log_group.test.arn}" +} +`, rName) +} + func testAccAWSStorageGatewayGatewayConfig_GatewayType_Stored(rName string) string { return testAccAWSStorageGateway_TapeAndVolumeGatewayBase(rName) + fmt.Sprintf(` resource "aws_storagegateway_gateway" "test" { @@ -577,7 +674,11 @@ resource "aws_storagegateway_gateway" "test" { func testAccAWSStorageGatewayGatewayConfig_SmbActiveDirectorySettings(rName string) string { return fmt.Sprintf(` -data "aws_availability_zones" "available" {} +data "aws_availability_zones" "available" { + # Error launching source instance: Unsupported: Your requested instance type (m4.xlarge) is not supported in your requested Availability Zone (us-west-2d). + blacklisted_zone_ids = ["usw2-az4"] + state = "available" +} resource "aws_vpc" "test" { cidr_block = "10.0.0.0/16" @@ -730,3 +831,34 @@ resource "aws_storagegateway_gateway" "test" { } `, rName, smbGuestPassword) } + +func testAccAWSStorageGatewayGatewayConfigTags1(rName, tagKey1, tagValue1 string) string { + return testAccAWSStorageGateway_TapeAndVolumeGatewayBase(rName) + fmt.Sprintf(` +resource "aws_storagegateway_gateway" "test" { + gateway_ip_address = "${aws_instance.test.public_ip}" + gateway_name = %q + gateway_timezone = "GMT" + gateway_type = "CACHED" + + tags = { + %q = %q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccAWSStorageGatewayGatewayConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccAWSStorageGateway_TapeAndVolumeGatewayBase(rName) + fmt.Sprintf(` +resource "aws_storagegateway_gateway" "test" { + gateway_ip_address = "${aws_instance.test.public_ip}" + gateway_name = %q + gateway_timezone = "GMT" + gateway_type = "CACHED" + + tags = { + %q = %q + %q = %q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} diff --git a/aws/resource_aws_storagegateway_nfs_file_share.go b/aws/resource_aws_storagegateway_nfs_file_share.go index ef8cf67502b..289b1c2bd1d 100644 --- a/aws/resource_aws_storagegateway_nfs_file_share.go +++ b/aws/resource_aws_storagegateway_nfs_file_share.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsStorageGatewayNfsFileShare() *schema.Resource { @@ -151,6 +152,7 @@ func resourceAwsStorageGatewayNfsFileShare() *schema.Resource { "RootSquash", }, false), }, + "tags": tagsSchema(), }, } } @@ -172,6 +174,7 @@ func resourceAwsStorageGatewayNfsFileShareCreate(d *schema.ResourceData, meta in RequesterPays: aws.Bool(d.Get("requester_pays").(bool)), Role: aws.String(d.Get("role_arn").(string)), Squash: aws.String(d.Get("squash").(string)), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().StoragegatewayTags(), } if v, ok := d.GetOk("kms_key_arn"); ok && v.(string) != "" { @@ -228,7 +231,8 @@ func resourceAwsStorageGatewayNfsFileShareRead(d *schema.ResourceData, meta inte fileshare := output.NFSFileShareInfoList[0] - d.Set("arn", fileshare.FileShareARN) + arn := fileshare.FileShareARN + d.Set("arn", arn) if err := d.Set("client_list", schema.NewSet(schema.HashString, flattenStringList(fileshare.ClientList))); err != nil { return fmt.Errorf("error setting client_list: %s", err) @@ -253,12 +257,27 @@ func resourceAwsStorageGatewayNfsFileShareRead(d *schema.ResourceData, meta inte d.Set("role_arn", fileshare.Role) d.Set("squash", fileshare.Squash) + tags, err := keyvaluetags.StoragegatewayListTags(conn, *arn) + if err != nil { + return fmt.Errorf("error listing tags for resource (%s): %s", *arn, err) + } + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + return nil } func resourceAwsStorageGatewayNfsFileShareUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).storagegatewayconn + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.StoragegatewayUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + input := &storagegateway.UpdateNFSFileShareInput{ ClientList: expandStringSet(d.Get("client_list").(*schema.Set)), DefaultStorageClass: aws.String(d.Get("default_storage_class").(string)), diff --git a/aws/resource_aws_storagegateway_nfs_file_share_test.go b/aws/resource_aws_storagegateway_nfs_file_share_test.go index 8db04ab3bd3..aefa6abc64f 100644 --- a/aws/resource_aws_storagegateway_nfs_file_share_test.go +++ b/aws/resource_aws_storagegateway_nfs_file_share_test.go @@ -26,7 +26,7 @@ func TestAccAWSStorageGatewayNfsFileShare_basic(t *testing.T) { Config: testAccAWSStorageGatewayNfsFileShareConfig_Required(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSStorageGatewayNfsFileShareExists(resourceName, &nfsFileShare), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:[^:]+:share/share-.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`share/share-.+`)), resource.TestCheckResourceAttr(resourceName, "client_list.#", "1"), resource.TestCheckResourceAttr(resourceName, "client_list.217649824", "0.0.0.0/0"), resource.TestCheckResourceAttr(resourceName, "default_storage_class", "S3_STANDARD"), @@ -53,6 +53,53 @@ func TestAccAWSStorageGatewayNfsFileShare_basic(t *testing.T) { }) } +func TestAccAWSStorageGatewayNfsFileShare_tags(t *testing.T) { + var nfsFileShare storagegateway.NFSFileShareInfo + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_storagegateway_nfs_file_share.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSStorageGatewayNfsFileShareDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSStorageGatewayNfsFileShareConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewayNfsFileShareExists(resourceName, &nfsFileShare), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`share/share-.+`)), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSStorageGatewayNfsFileShareConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewayNfsFileShareExists(resourceName, &nfsFileShare), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`share/share-.+`)), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSStorageGatewayNfsFileShareConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewayNfsFileShareExists(resourceName, &nfsFileShare), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`share/share-.+`)), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSStorageGatewayNfsFileShare_ClientList(t *testing.T) { var nfsFileShare storagegateway.NFSFileShareInfo rName := acctest.RandomWithPrefix("tf-acc-test") @@ -532,6 +579,37 @@ resource "aws_storagegateway_nfs_file_share" "test" { ` } +func testAccAWSStorageGatewayNfsFileShareConfigTags1(rName, tagKey1, tagValue1 string) string { + return testAccAWSStorageGateway_S3FileShareBase(rName) + fmt.Sprintf(` +resource "aws_storagegateway_nfs_file_share" "test" { + client_list = ["0.0.0.0/0"] + gateway_arn = "${aws_storagegateway_gateway.test.arn}" + location_arn = "${aws_s3_bucket.test.arn}" + role_arn = "${aws_iam_role.test.arn}" + + tags = { + %q = %q + } +} +`, tagKey1, tagValue1) +} + +func testAccAWSStorageGatewayNfsFileShareConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccAWSStorageGateway_S3FileShareBase(rName) + fmt.Sprintf(` +resource "aws_storagegateway_nfs_file_share" "test" { + client_list = ["0.0.0.0/0"] + gateway_arn = "${aws_storagegateway_gateway.test.arn}" + location_arn = "${aws_s3_bucket.test.arn}" + role_arn = "${aws_iam_role.test.arn}" + + tags = { + %q = %q + %q = %q + } +} +`, tagKey1, tagValue1, tagKey2, tagValue2) +} + func testAccAWSStorageGatewayNfsFileShareConfig_ClientList_Single(rName, clientList1 string) string { return testAccAWSStorageGateway_S3FileShareBase(rName) + fmt.Sprintf(` resource "aws_storagegateway_nfs_file_share" "test" { diff --git a/aws/resource_aws_storagegateway_smb_file_share.go b/aws/resource_aws_storagegateway_smb_file_share.go index 16ce66a6dcd..d4512b156fc 100644 --- a/aws/resource_aws_storagegateway_smb_file_share.go +++ b/aws/resource_aws_storagegateway_smb_file_share.go @@ -10,6 +10,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsStorageGatewaySmbFileShare() *schema.Resource { @@ -123,6 +124,7 @@ func resourceAwsStorageGatewaySmbFileShare() *schema.Resource { Optional: true, Elem: &schema.Schema{Type: schema.TypeString}, }, + "tags": tagsSchema(), }, } } @@ -144,6 +146,7 @@ func resourceAwsStorageGatewaySmbFileShareCreate(d *schema.ResourceData, meta in RequesterPays: aws.Bool(d.Get("requester_pays").(bool)), Role: aws.String(d.Get("role_arn").(string)), ValidUserList: expandStringSet(d.Get("valid_user_list").(*schema.Set)), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().StoragegatewayTags(), } if v, ok := d.GetOk("kms_key_arn"); ok && v.(string) != "" { @@ -200,7 +203,8 @@ func resourceAwsStorageGatewaySmbFileShareRead(d *schema.ResourceData, meta inte fileshare := output.SMBFileShareInfoList[0] - d.Set("arn", fileshare.FileShareARN) + arn := fileshare.FileShareARN + d.Set("arn", arn) d.Set("authentication", fileshare.Authentication) d.Set("default_storage_class", fileshare.DefaultStorageClass) d.Set("fileshare_id", fileshare.FileShareId) @@ -224,12 +228,27 @@ func resourceAwsStorageGatewaySmbFileShareRead(d *schema.ResourceData, meta inte return fmt.Errorf("error setting valid_user_list: %s", err) } + tags, err := keyvaluetags.StoragegatewayListTags(conn, *arn) + if err != nil { + return fmt.Errorf("error listing tags for resource (%s): %s", *arn, err) + } + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + return nil } func resourceAwsStorageGatewaySmbFileShareUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).storagegatewayconn + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.StoragegatewayUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + input := &storagegateway.UpdateSMBFileShareInput{ DefaultStorageClass: aws.String(d.Get("default_storage_class").(string)), FileShareARN: aws.String(d.Id()), diff --git a/aws/resource_aws_storagegateway_smb_file_share_test.go b/aws/resource_aws_storagegateway_smb_file_share_test.go index 0fcad891c55..fcde2602673 100644 --- a/aws/resource_aws_storagegateway_smb_file_share_test.go +++ b/aws/resource_aws_storagegateway_smb_file_share_test.go @@ -26,7 +26,7 @@ func TestAccAWSStorageGatewaySmbFileShare_Authentication_ActiveDirectory(t *test Config: testAccAWSStorageGatewaySmbFileShareConfig_Authentication_ActiveDirectory(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSStorageGatewaySmbFileShareExists(resourceName, &smbFileShare), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:[^:]+:share/share-.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`share/share-.+`)), resource.TestCheckResourceAttr(resourceName, "authentication", "ActiveDirectory"), resource.TestCheckResourceAttr(resourceName, "default_storage_class", "S3_STANDARD"), resource.TestMatchResourceAttr(resourceName, "fileshare_id", regexp.MustCompile(`^share-`)), @@ -66,7 +66,7 @@ func TestAccAWSStorageGatewaySmbFileShare_Authentication_GuestAccess(t *testing. Config: testAccAWSStorageGatewaySmbFileShareConfig_Authentication_GuestAccess(rName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSStorageGatewaySmbFileShareExists(resourceName, &smbFileShare), - resource.TestMatchResourceAttr(resourceName, "arn", regexp.MustCompile(`^arn:[^:]+:storagegateway:[^:]+:[^:]+:share/share-.+$`)), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "storagegateway", regexp.MustCompile(`share/share-.+`)), resource.TestCheckResourceAttr(resourceName, "authentication", "GuestAccess"), resource.TestCheckResourceAttr(resourceName, "default_storage_class", "S3_STANDARD"), resource.TestMatchResourceAttr(resourceName, "fileshare_id", regexp.MustCompile(`^share-`)), @@ -125,6 +125,50 @@ func TestAccAWSStorageGatewaySmbFileShare_DefaultStorageClass(t *testing.T) { }) } +func TestAccAWSStorageGatewaySmbFileShare_Tags(t *testing.T) { + var smbFileShare storagegateway.SMBFileShareInfo + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_storagegateway_smb_file_share.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSStorageGatewaySmbFileShareDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSStorageGatewaySmbFileShareConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewaySmbFileShareExists(resourceName, &smbFileShare), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSStorageGatewaySmbFileShareConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewaySmbFileShareExists(resourceName, &smbFileShare), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSStorageGatewaySmbFileShareConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSStorageGatewaySmbFileShareExists(resourceName, &smbFileShare), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSStorageGatewaySmbFileShare_GuessMIMETypeEnabled(t *testing.T) { var smbFileShare storagegateway.SMBFileShareInfo rName := acctest.RandomWithPrefix("tf-acc-test") @@ -758,3 +802,36 @@ resource "aws_storagegateway_smb_file_share" "test" { } `, validUser1, validUser2) } + +func testAccAWSStorageGatewaySmbFileShareConfigTags1(rName, tagKey1, tagValue1 string) string { + return testAccAWSStorageGateway_SmbFileShare_GuestAccessBase(rName) + fmt.Sprintf(` +resource "aws_storagegateway_smb_file_share" "test" { + # Use GuestAccess to simplify testing + authentication = "GuestAccess" + gateway_arn = "${aws_storagegateway_gateway.test.arn}" + location_arn = "${aws_s3_bucket.test.arn}" + role_arn = "${aws_iam_role.test.arn}" + + tags = { + %q = %q + } +} +`, tagKey1, tagValue1) +} + +func testAccAWSStorageGatewaySmbFileShareConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return testAccAWSStorageGateway_SmbFileShare_GuestAccessBase(rName) + fmt.Sprintf(` +resource "aws_storagegateway_smb_file_share" "test" { + # Use GuestAccess to simplify testing + authentication = "GuestAccess" + gateway_arn = "${aws_storagegateway_gateway.test.arn}" + location_arn = "${aws_s3_bucket.test.arn}" + role_arn = "${aws_iam_role.test.arn}" + + tags = { + %q = %q + %q = %q + } +} +`, tagKey1, tagValue1, tagKey2, tagValue2) +} diff --git a/aws/resource_aws_subnet.go b/aws/resource_aws_subnet.go index 2ce8e8fee31..4615e89eee2 100644 --- a/aws/resource_aws_subnet.go +++ b/aws/resource_aws_subnet.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsSubnet() *schema.Resource { @@ -140,11 +141,75 @@ func resourceAwsSubnetCreate(d *schema.ResourceData, meta interface{}) error { d.Id(), err) } - return resourceAwsSubnetUpdate(d, meta) + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + // Handle EC2 eventual consistency on creation + err := resource.Retry(5*time.Minute, func() *resource.RetryError { + err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), nil, v) + + if isAWSErr(err, "InvalidSubnetID.NotFound", "") { + return resource.RetryableError(err) + } + + if err != nil { + return resource.NonRetryableError(err) + } + + return nil + }) + + if isResourceTimeoutError(err) { + err = keyvaluetags.Ec2UpdateTags(conn, d.Id(), nil, v) + } + + if err != nil { + return fmt.Errorf("error adding tags: %s", err) + } + + d.SetPartial("tags") + } + + // You cannot modify multiple subnet attributes in the same request. + // Reference: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifySubnetAttribute.html + + if d.Get("assign_ipv6_address_on_creation").(bool) { + input := &ec2.ModifySubnetAttributeInput{ + AssignIpv6AddressOnCreation: &ec2.AttributeBooleanValue{ + Value: aws.Bool(true), + }, + SubnetId: aws.String(d.Id()), + } + + if _, err := conn.ModifySubnetAttribute(input); err != nil { + return fmt.Errorf("error enabling EC2 Subnet (%s) assign IPv6 address on creation: %s", d.Id(), err) + } + + d.SetPartial("assign_ipv6_address_on_creation") + } + + if d.Get("map_public_ip_on_launch").(bool) { + input := &ec2.ModifySubnetAttributeInput{ + MapPublicIpOnLaunch: &ec2.AttributeBooleanValue{ + Value: aws.Bool(true), + }, + SubnetId: aws.String(d.Id()), + } + + if _, err := conn.ModifySubnetAttribute(input); err != nil { + return fmt.Errorf("error enabling EC2 Subnet (%s) map public IP on launch: %s", d.Id(), err) + } + + d.SetPartial("map_public_ip_on_launch") + } + + d.Partial(false) + + return resourceAwsSubnetRead(d, meta) } func resourceAwsSubnetRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn + ignoreTags := meta.(*AWSClient).ignoreTags + ignoreTagPrefixes := meta.(*AWSClient).ignoreTagPrefixes resp, err := conn.DescribeSubnets(&ec2.DescribeSubnetsInput{ SubnetIds: []*string{aws.String(d.Id())}, @@ -184,7 +249,11 @@ func resourceAwsSubnetRead(d *schema.ResourceData, meta interface{}) error { } d.Set("arn", subnet.SubnetArn) - d.Set("tags", tagsToMap(subnet.Tags)) + + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(subnet.Tags).IgnoreAws().IgnorePrefixes(ignoreTagPrefixes).Ignore(ignoreTags).Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + d.Set("owner_id", subnet.OwnerId) return nil @@ -195,9 +264,13 @@ func resourceAwsSubnetUpdate(d *schema.ResourceData, meta interface{}) error { d.Partial(true) - if err := setTags(conn, d); err != nil { - return err - } else { + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating EC2 Subnet (%s) tags: %s", d.Id(), err) + } + d.SetPartial("tags") } @@ -220,9 +293,7 @@ func resourceAwsSubnetUpdate(d *schema.ResourceData, meta interface{}) error { } } - // We have to be careful here to not go through a change of association if this is a new resource - // A New resource here would denote that the Update func is called by the Create func - if d.HasChange("ipv6_cidr_block") && !d.IsNewResource() { + if d.HasChange("ipv6_cidr_block") { // We need to handle that we disassociate the IPv6 CIDR block before we try and associate the new one // This could be an issue as, we could error out when we try and add the new one // We may need to roll back the state and reattach the old one if this is the case diff --git a/aws/resource_aws_subnet_test.go b/aws/resource_aws_subnet_test.go index e7dbf7c7960..bb8e333508b 100644 --- a/aws/resource_aws_subnet_test.go +++ b/aws/resource_aws_subnet_test.go @@ -10,8 +10,11 @@ import ( "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/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) // add sweeper to delete known test subnets @@ -22,12 +25,13 @@ func init() { Dependencies: []string{ "aws_autoscaling_group", "aws_batch_compute_environment", - "aws_beanstalk_environment", + "aws_elastic_beanstalk_environment", "aws_cloudhsm_v2_cluster", "aws_db_subnet_group", "aws_directory_service_directory", "aws_ec2_client_vpn_endpoint", "aws_ec2_transit_gateway_vpc_attachment", + "aws_efs_file_system", "aws_eks_cluster", "aws_elasticache_cluster", "aws_elasticache_replication_group", @@ -43,6 +47,7 @@ func init() { "aws_network_interface", "aws_redshift_cluster", "aws_route53_resolver_endpoint", + "aws_sagemaker_notebook_instance", "aws_spot_fleet_request", "aws_vpc_endpoint", }, @@ -55,56 +60,66 @@ func testSweepSubnets(region string) error { return fmt.Errorf("error getting client: %s", err) } conn := client.(*AWSClient).ec2conn + input := &ec2.DescribeSubnetsInput{} + var sweeperErrs *multierror.Error - req := &ec2.DescribeSubnetsInput{} - resp, err := conn.DescribeSubnets(req) - if err != nil { - if testSweepSkipSweepError(err) { - log.Printf("[WARN] Skipping EC2 Subnet sweep for %s: %s", region, err) - return nil - } - return fmt.Errorf("Error describing subnets: %s", err) - } + err = conn.DescribeSubnetsPages(input, func(page *ec2.DescribeSubnetsOutput, lastPage bool) bool { + for _, subnet := range page.Subnets { + if subnet == nil { + continue + } - if len(resp.Subnets) == 0 { - log.Print("[DEBUG] No aws subnets to sweep") - return nil - } + id := aws.StringValue(subnet.SubnetId) + input := &ec2.DeleteSubnetInput{ + SubnetId: subnet.SubnetId, + } - for _, subnet := range resp.Subnets { - if subnet == nil { - continue - } + if aws.BoolValue(subnet.DefaultForAz) { + log.Printf("[DEBUG] Skipping default EC2 Subnet: %s", id) + continue + } - if aws.BoolValue(subnet.DefaultForAz) { - continue - } + log.Printf("[INFO] Deleting EC2 Subnet: %s", id) - input := &ec2.DeleteSubnetInput{ - SubnetId: subnet.SubnetId, - } + // Handle eventual consistency, especially with lingering ENIs from Load Balancers and Lambda + err := resource.Retry(5*time.Minute, func() *resource.RetryError { + _, err := conn.DeleteSubnet(input) + + if isAWSErr(err, "DependencyViolation", "") { + return resource.RetryableError(err) + } - // Handle eventual consistency, especially with lingering ENIs from Load Balancers and Lambda - err := resource.Retry(5*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteSubnet(input) + if err != nil { + return resource.NonRetryableError(err) + } - if isAWSErr(err, "DependencyViolation", "") { - return resource.RetryableError(err) + return nil + }) + + if isResourceTimeoutError(err) { + _, err = conn.DeleteSubnet(input) } if err != nil { - return resource.NonRetryableError(err) + sweeperErr := fmt.Errorf("error deleting EC2 Subnet (%s): %w", id, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) } + } - return nil - }) + return !lastPage + }) - if err != nil { - return fmt.Errorf("Error deleting Subnet (%s): %s", aws.StringValue(subnet.SubnetId), err) - } + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping EC2 Subnet sweep for %s: %s", region, err) + return nil } - return nil + if err != nil { + return fmt.Errorf("Error describing subnets: %s", err) + } + + return sweeperErrs.ErrorOrNil() } func TestAccAWSSubnet_basic(t *testing.T) { @@ -158,6 +173,36 @@ func TestAccAWSSubnet_basic(t *testing.T) { }) } +func TestAccAWSSubnet_ignoreTags(t *testing.T) { + var providers []*schema.Provider + var subnet ec2.Subnet + resourceName := "aws_subnet.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories(&providers), + CheckDestroy: testAccCheckVpcDestroy, + Steps: []resource.TestStep{ + { + Config: testAccSubnetConfig, + Check: resource.ComposeTestCheckFunc( + testAccCheckSubnetExists(resourceName, &subnet), + testAccCheckSubnetUpdateTags(&subnet, nil, map[string]string{"ignorekey1": "ignorevalue1"}), + ), + ExpectNonEmptyPlan: true, + }, + { + Config: testAccProviderConfigIgnoreTagPrefixes1("ignorekey") + testAccSubnetConfig, + PlanOnly: true, + }, + { + Config: testAccProviderConfigIgnoreTags1("ignorekey1") + testAccSubnetConfig, + PlanOnly: true, + }, + }, + }) +} + func TestAccAWSSubnet_ipv6(t *testing.T) { var before, after ec2.Subnet resourceName := "aws_subnet.test" @@ -360,6 +405,14 @@ func testAccCheckSubnetExists(n string, v *ec2.Subnet) resource.TestCheckFunc { } } +func testAccCheckSubnetUpdateTags(subnet *ec2.Subnet, oldTags, newTags map[string]string) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + return keyvaluetags.Ec2UpdateTags(conn, aws.StringValue(subnet.SubnetId), oldTags, newTags) + } +} + const testAccSubnetConfig = ` resource "aws_vpc" "test" { cidr_block = "10.1.0.0/16" diff --git a/aws/resource_aws_swf_domain.go b/aws/resource_aws_swf_domain.go index c032892e6b3..8e35b96af8b 100644 --- a/aws/resource_aws_swf_domain.go +++ b/aws/resource_aws_swf_domain.go @@ -9,12 +9,14 @@ import ( "github.com/aws/aws-sdk-go/service/swf" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsSwfDomain() *schema.Resource { return &schema.Resource{ Create: resourceAwsSwfDomainCreate, Read: resourceAwsSwfDomainRead, + Update: resourceAwsSwfDomainUpdate, Delete: resourceAwsSwfDomainDelete, Importer: &schema.ResourceImporter{ State: schema.ImportStatePassthrough, @@ -52,6 +54,11 @@ func resourceAwsSwfDomain() *schema.Resource { return }, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, + "tags": tagsSchema(), }, } } @@ -72,6 +79,7 @@ func resourceAwsSwfDomainCreate(d *schema.ResourceData, meta interface{}) error input := &swf.RegisterDomainInput{ Name: aws.String(name), WorkflowExecutionRetentionPeriodInDays: aws.String(d.Get("workflow_execution_retention_period_in_days").(string)), + Tags: keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().SwfTags(), } if v, ok := d.GetOk("description"); ok { @@ -111,6 +119,18 @@ func resourceAwsSwfDomainRead(d *schema.ResourceData, meta interface{}) error { return nil } + arn := *resp.DomainInfo.Arn + tags, err := keyvaluetags.SwfListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for SWF Domain (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + d.Set("arn", resp.DomainInfo.Arn) d.Set("name", resp.DomainInfo.Name) d.Set("description", resp.DomainInfo.Description) d.Set("workflow_execution_retention_period_in_days", resp.Configuration.WorkflowExecutionRetentionPeriodInDays) @@ -118,6 +138,20 @@ func resourceAwsSwfDomainRead(d *schema.ResourceData, meta interface{}) error { return nil } +func resourceAwsSwfDomainUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).swfconn + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.SwfUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating SWF Domain (%s) tags: %s", d.Id(), err) + } + } + + return resourceAwsSwfDomainRead(d, meta) +} + func resourceAwsSwfDomainDelete(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).swfconn diff --git a/aws/resource_aws_swf_domain_test.go b/aws/resource_aws_swf_domain_test.go index 631cc1361f3..eef3d8717b7 100644 --- a/aws/resource_aws_swf_domain_test.go +++ b/aws/resource_aws_swf_domain_test.go @@ -38,6 +38,7 @@ func TestAccAWSSwfDomain_basic(t *testing.T) { Config: testAccAWSSwfDomainConfig_Name(rName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAwsSwfDomainExists(resourceName), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "swf", regexp.MustCompile(`/domain/.+`)), resource.TestCheckResourceAttr(resourceName, "description", ""), resource.TestCheckResourceAttr(resourceName, "name", rName), ), @@ -51,6 +52,52 @@ func TestAccAWSSwfDomain_basic(t *testing.T) { }) } +func TestAccAWSSwfDomain_tags(t *testing.T) { + rName := acctest.RandomWithPrefix("tf-acc-test") + resourceName := "aws_swf_domain.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { + testAccPreCheck(t) + testAccPreCheckSwfDomainTestingEnabled(t) + }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsSwfDomainDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSSwfDomainConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAwsSwfDomainExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSSwfDomainConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAwsSwfDomainExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSSwfDomainConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAwsSwfDomainExists(resourceName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSSwfDomain_NamePrefix(t *testing.T) { resourceName := "aws_swf_domain.test" @@ -151,8 +198,8 @@ func testAccCheckAwsSwfDomainDestroy(s *terraform.State) error { return err } - if *resp.DomainInfo.Status != "DEPRECATED" { - return fmt.Errorf(`SWF Domain %s status is %s instead of "DEPRECATED". Failing!`, name, *resp.DomainInfo.Status) + if *resp.DomainInfo.Status != swf.RegistrationStatusDeprecated { + return fmt.Errorf(`SWF Domain %s status is %s instead of %s. Failing!`, name, *resp.DomainInfo.Status, swf.RegistrationStatusDeprecated) } } @@ -182,8 +229,8 @@ func testAccCheckAwsSwfDomainExists(n string) resource.TestCheckFunc { return fmt.Errorf("SWF Domain %s not found in AWS", name) } - if *resp.DomainInfo.Status != "REGISTERED" { - return fmt.Errorf(`SWF Domain %s status is %s instead of "REGISTERED". Failing!`, name, *resp.DomainInfo.Status) + if *resp.DomainInfo.Status != swf.RegistrationStatusRegistered { + return fmt.Errorf(`SWF Domain %s status is %s instead of %s. Failing!`, name, *resp.DomainInfo.Status, swf.RegistrationStatusRegistered) } return nil } @@ -214,6 +261,33 @@ resource "aws_swf_domain" "test" { `, rName) } +func testAccAWSSwfDomainConfigTags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_swf_domain" "test" { + name = %[1]q + workflow_execution_retention_period_in_days = 1 + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccAWSSwfDomainConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_swf_domain" "test" { + name = %[1]q + workflow_execution_retention_period_in_days = 1 + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) +} + const testAccAWSSwfDomainConfig_NamePrefix = ` resource "aws_swf_domain" "test" { name_prefix = "tf-acc-test" diff --git a/aws/resource_aws_transfer_server.go b/aws/resource_aws_transfer_server.go index f2db50b259d..80c7ea9956a 100644 --- a/aws/resource_aws_transfer_server.go +++ b/aws/resource_aws_transfer_server.go @@ -8,10 +8,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/transfer" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsTransferServer() *schema.Resource { @@ -69,6 +69,18 @@ func resourceAwsTransferServer() *schema.Resource { }, }, + "host_key": { + Type: schema.TypeString, + Optional: true, + Sensitive: true, + ValidateFunc: validation.StringLenBetween(0, 4096), + }, + + "host_key_fingerprint": { + Type: schema.TypeString, + Computed: true, + }, + "invocation_role": { Type: schema.TypeString, Optional: true, @@ -110,7 +122,7 @@ func resourceAwsTransferServer() *schema.Resource { func resourceAwsTransferServerCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).transferconn - tags := tagsFromMapTransfer(d.Get("tags").(map[string]interface{})) + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().TransferTags() createOpts := &transfer.CreateServerInput{} if len(tags) != 0 { @@ -146,6 +158,10 @@ func resourceAwsTransferServerCreate(d *schema.ResourceData, meta interface{}) e createOpts.EndpointDetails = expandTransferServerEndpointDetails(attr.([]interface{})) } + if attr, ok := d.GetOk("host_key"); ok { + createOpts.HostKey = aws.String(attr.(string)) + } + log.Printf("[DEBUG] Create Transfer Server Option: %#v", createOpts) resp, err := conn.CreateServer(createOpts) @@ -191,8 +207,9 @@ func resourceAwsTransferServerRead(d *schema.ResourceData, meta interface{}) err d.Set("endpoint_details", flattenTransferServerEndpointDetails(resp.Server.EndpointDetails)) d.Set("identity_provider_type", resp.Server.IdentityProviderType) d.Set("logging_role", resp.Server.LoggingRole) + d.Set("host_key_fingerprint", resp.Server.HostKeyFingerprint) - if err := d.Set("tags", tagsToMapTransfer(resp.Server.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.TransferKeyValueTags(resp.Server.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("Error setting tags: %s", err) } return nil @@ -237,6 +254,13 @@ func resourceAwsTransferServerUpdate(d *schema.ResourceData, meta interface{}) e } } + if d.HasChange("host_key") { + updateFlag = true + if attr, ok := d.GetOk("host_key"); ok { + updateOpts.HostKey = aws.String(attr.(string)) + } + } + if updateFlag { _, err := conn.UpdateServer(updateOpts) if err != nil { @@ -249,8 +273,11 @@ func resourceAwsTransferServerUpdate(d *schema.ResourceData, meta interface{}) e } } - if err := setTagsTransfer(conn, d); err != nil { - return fmt.Errorf("Error update tags: %s", err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.TransferUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } } return resourceAwsTransferServerRead(d, meta) diff --git a/aws/resource_aws_transfer_server_test.go b/aws/resource_aws_transfer_server_test.go index a5a97876ac3..bfa5eb18c4e 100644 --- a/aws/resource_aws_transfer_server_test.go +++ b/aws/resource_aws_transfer_server_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "log" "regexp" "testing" @@ -14,6 +15,56 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/terraform" ) +func init() { + resource.AddTestSweepers("aws_transfer_server", &resource.Sweeper{ + Name: "aws_transfer_server", + F: testSweepTransferServers, + }) +} + +func testSweepTransferServers(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %s", err) + } + conn := client.(*AWSClient).transferconn + input := &transfer.ListServersInput{} + + err = conn.ListServersPages(input, func(page *transfer.ListServersOutput, lastPage bool) bool { + for _, server := range page.Servers { + id := aws.StringValue(server.ServerId) + input := &transfer.DeleteServerInput{ + ServerId: server.ServerId, + } + + log.Printf("[INFO] Deleting Transfer Server: %s", id) + _, err := conn.DeleteServer(input) + + if err != nil { + log.Printf("[ERROR] Error deleting Transfer Server (%s): %s", id, err) + continue + } + + if err := waitForTransferServerDeletion(conn, id); err != nil { + log.Printf("[ERROR] Error waiting for Transfer Server (%s) deletion: %s", id, err) + } + } + + return !lastPage + }) + + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping Transfer Server sweep for %s: %s", region, err) + return nil + } + + if err != nil { + return fmt.Errorf("error listing Transfer Servers: %s", err) + } + + return nil +} + func TestAccAWSTransferServer_basic(t *testing.T) { var conf transfer.DescribedServer rName := acctest.RandString(5) @@ -138,7 +189,7 @@ func TestAccAWSTransferServer_forcedestroy(t *testing.T) { ResourceName: "aws_transfer_server.foo", ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"force_destroy"}, + ImportStateVerifyIgnore: []string{"force_destroy", "host_key"}, }, }, }) @@ -166,7 +217,35 @@ func TestAccAWSTransferServer_vpcEndpointId(t *testing.T) { ResourceName: resourceName, ImportState: true, ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"force_destroy"}, + ImportStateVerifyIgnore: []string{"force_destroy", "host_key"}, + }, + }, + }) +} + +func TestAccAWSTransferServer_hostKey(t *testing.T) { + var conf transfer.DescribedServer + resourceName := "aws_transfer_server.default" + hostKey := "test-fixtures/transfer-ssh-rsa-key" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + IDRefreshName: resourceName, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSTransferServerDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSTransferServerConfig_hostKey(hostKey), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSTransferServerExists(resourceName, &conf), + resource.TestCheckResourceAttr(resourceName, "host_key_fingerprint", "SHA256:Z2pW9sPKDD/T34tVfCoolsRcECNTlekgaKvDn9t+9sg="), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"force_destroy", "host_key"}, }, }, }) @@ -575,3 +654,11 @@ resource "aws_transfer_server" "default" { } } ` + +func testAccAWSTransferServerConfig_hostKey(hostKey string) string { + return fmt.Sprintf(` +resource "aws_transfer_server" "default" { + host_key = "${file("%s")}" +} +`, hostKey) +} diff --git a/aws/resource_aws_transfer_user.go b/aws/resource_aws_transfer_user.go index cd9df67f417..4747829b4e1 100644 --- a/aws/resource_aws_transfer_user.go +++ b/aws/resource_aws_transfer_user.go @@ -8,10 +8,10 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/transfer" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsTransferUser() *schema.Resource { @@ -89,7 +89,7 @@ func resourceAwsTransferUserCreate(d *schema.ResourceData, meta interface{}) err } if attr, ok := d.GetOk("tags"); ok { - createOpts.Tags = tagsFromMapTransfer(attr.(map[string]interface{})) + createOpts.Tags = keyvaluetags.New(attr.(map[string]interface{})).IgnoreAws().TransferTags() } log.Printf("[DEBUG] Create Transfer User Option: %#v", createOpts) @@ -135,7 +135,7 @@ func resourceAwsTransferUserRead(d *schema.ResourceData, meta interface{}) error d.Set("policy", resp.User.Policy) d.Set("role", resp.User.Role) - if err := d.Set("tags", tagsToMapTransfer(resp.User.Tags)); err != nil { + if err := d.Set("tags", keyvaluetags.TransferKeyValueTags(resp.User.Tags).IgnoreAws().Map()); err != nil { return fmt.Errorf("Error setting tags: %s", err) } return nil @@ -181,8 +181,11 @@ func resourceAwsTransferUserUpdate(d *schema.ResourceData, meta interface{}) err } } - if err := setTagsTransfer(conn, d); err != nil { - return fmt.Errorf("Error update tags: %s", err) + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.TransferUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } } return resourceAwsTransferUserRead(d, meta) diff --git a/aws/resource_aws_vpc.go b/aws/resource_aws_vpc.go index bc69605a74d..771c0d2abdb 100644 --- a/aws/resource_aws_vpc.go +++ b/aws/resource_aws_vpc.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsVpc() *schema.Resource { @@ -171,12 +172,102 @@ func resourceAwsVpcCreate(d *schema.ResourceData, meta interface{}) error { } } - // Update our attributes and return - return resourceAwsVpcUpdate(d, meta) + // You cannot modify the DNS resolution and DNS hostnames attributes in the same request. Use separate requests for each attribute. + // Reference: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyVpcAttribute.html + + if d.Get("enable_dns_hostnames").(bool) { + input := &ec2.ModifyVpcAttributeInput{ + EnableDnsHostnames: &ec2.AttributeBooleanValue{ + Value: aws.Bool(true), + }, + VpcId: aws.String(d.Id()), + } + + if _, err := conn.ModifyVpcAttribute(input); err != nil { + return fmt.Errorf("error enabling VPC (%s) DNS hostnames: %s", d.Id(), err) + } + + d.SetPartial("enable_dns_hostnames") + } + + // By default, only the enableDnsSupport attribute is set to true in a VPC created any other way. + // Reference: https://docs.aws.amazon.com/vpc/latest/userguide/vpc-dns.html#vpc-dns-support + + if !d.Get("enable_dns_support").(bool) { + input := &ec2.ModifyVpcAttributeInput{ + EnableDnsSupport: &ec2.AttributeBooleanValue{ + Value: aws.Bool(false), + }, + VpcId: aws.String(d.Id()), + } + + if _, err := conn.ModifyVpcAttribute(input); err != nil { + return fmt.Errorf("error disabling VPC (%s) DNS support: %s", d.Id(), err) + } + + d.SetPartial("enable_dns_support") + } + + if d.Get("enable_classiclink").(bool) { + input := &ec2.EnableVpcClassicLinkInput{ + VpcId: aws.String(d.Id()), + } + + if _, err := conn.EnableVpcClassicLink(input); err != nil { + return fmt.Errorf("error enabling VPC (%s) ClassicLink: %s", d.Id(), err) + } + + d.SetPartial("enable_classiclink") + } + + if d.Get("enable_classiclink_dns_support").(bool) { + input := &ec2.EnableVpcClassicLinkDnsSupportInput{ + VpcId: aws.String(d.Id()), + } + + if _, err := conn.EnableVpcClassicLinkDnsSupport(input); err != nil { + return fmt.Errorf("error enabling VPC (%s) ClassicLink DNS support: %s", d.Id(), err) + } + + d.SetPartial("enable_classiclink_dns_support") + } + + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + // Handle EC2 eventual consistency on creation + err := resource.Retry(5*time.Minute, func() *resource.RetryError { + err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), nil, v) + + if isAWSErr(err, "InvalidVpcID.NotFound", "") { + return resource.RetryableError(err) + } + + if err != nil { + return resource.NonRetryableError(err) + } + + return nil + }) + + if isResourceTimeoutError(err) { + err = keyvaluetags.Ec2UpdateTags(conn, d.Id(), nil, v) + } + + if err != nil { + return fmt.Errorf("error adding tags: %s", err) + } + + d.SetPartial("tags") + } + + d.Partial(false) + + return resourceAwsVpcRead(d, meta) } func resourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn + ignoreTags := meta.(*AWSClient).ignoreTags + ignoreTagPrefixes := meta.(*AWSClient).ignoreTagPrefixes // Refresh the VPC state vpcRaw, _, err := VPCStateRefreshFunc(conn, d.Id())() @@ -205,8 +296,9 @@ func resourceAwsVpcRead(d *schema.ResourceData, meta interface{}) error { }.String() d.Set("arn", arn) - // Tags - d.Set("tags", tagsToMap(vpc.Tags)) + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(vpc.Tags).IgnoreAws().IgnorePrefixes(ignoreTagPrefixes).Ignore(ignoreTags).Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } d.Set("owner_id", vpc.OwnerId) @@ -404,7 +496,7 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error { d.SetPartial("enable_classiclink_dns_support") } - if d.HasChange("assign_generated_ipv6_cidr_block") && !d.IsNewResource() { + if d.HasChange("assign_generated_ipv6_cidr_block") { toAssign := d.Get("assign_generated_ipv6_cidr_block").(bool) log.Printf("[INFO] Modifying assign_generated_ipv6_cidr_block to %#v", toAssign) @@ -445,7 +537,7 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error { d.SetPartial("assign_generated_ipv6_cidr_block") } - if d.HasChange("instance_tenancy") && !d.IsNewResource() { + if d.HasChange("instance_tenancy") { modifyOpts := &ec2.ModifyVpcTenancyInput{ VpcId: aws.String(vpcid), InstanceTenancy: aws.String(d.Get("instance_tenancy").(string)), @@ -460,9 +552,13 @@ func resourceAwsVpcUpdate(d *schema.ResourceData, meta interface{}) error { d.SetPartial("instance_tenancy") } - if err := setTags(conn, d); err != nil { - return err - } else { + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + d.SetPartial("tags") } diff --git a/aws/resource_aws_vpc_dhcp_options.go b/aws/resource_aws_vpc_dhcp_options.go index 66656ac470e..f00956c95d1 100644 --- a/aws/resource_aws_vpc_dhcp_options.go +++ b/aws/resource_aws_vpc_dhcp_options.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsVpcDhcpOptions() *schema.Resource { @@ -136,7 +137,13 @@ func resourceAwsVpcDhcpOptionsCreate(d *schema.ResourceData, meta interface{}) e d.Id(), err) } - return resourceAwsVpcDhcpOptionsUpdate(d, meta) + if v, ok := d.GetOk("tags"); ok { + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), nil, v.(map[string]interface{})); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + + return resourceAwsVpcDhcpOptionsRead(d, meta) } func resourceAwsVpcDhcpOptionsRead(d *schema.ResourceData, meta interface{}) error { @@ -162,7 +169,9 @@ func resourceAwsVpcDhcpOptionsRead(d *schema.ResourceData, meta interface{}) err } opts := resp.DhcpOptions[0] - d.Set("tags", tagsToMap(opts.Tags)) + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(opts.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } d.Set("owner_id", opts.OwnerId) for _, cfg := range opts.DhcpConfigurations { @@ -186,8 +195,11 @@ func resourceAwsVpcDhcpOptionsRead(d *schema.ResourceData, meta interface{}) err func resourceAwsVpcDhcpOptionsUpdate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).ec2conn - if err := setTags(conn, d); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } } return resourceAwsVpcDhcpOptionsRead(d, meta) @@ -262,7 +274,7 @@ func findVPCsByDHCPOptionsID(conn *ec2.EC2, id string) ([]*ec2.Vpc, error) { resp, err := conn.DescribeVpcs(req) if err != nil { - if ec2err, ok := err.(awserr.Error); ok && ec2err.Code() == "InvalidVpcID.NotFound" { + if isAWSErr(err, "InvalidVpcID.NotFound", "") { return nil, nil } return nil, err diff --git a/aws/resource_aws_vpc_dhcp_options_test.go b/aws/resource_aws_vpc_dhcp_options_test.go index 7288e317465..3c5dd67f836 100644 --- a/aws/resource_aws_vpc_dhcp_options_test.go +++ b/aws/resource_aws_vpc_dhcp_options_test.go @@ -6,8 +6,8 @@ import ( "testing" "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-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) @@ -90,6 +90,7 @@ func testSweepVpcDhcpOptions(region string) error { func TestAccAWSDHCPOptions_basic(t *testing.T) { var d ec2.DhcpOptions resourceName := "aws_vpc_dhcp_options.test" + rName := acctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -97,16 +98,16 @@ func TestAccAWSDHCPOptions_basic(t *testing.T) { CheckDestroy: testAccCheckDHCPOptionsDestroy, Steps: []resource.TestStep{ { - Config: testAccDHCPOptionsConfig, + Config: testAccDHCPOptionsConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckDHCPOptionsExists(resourceName, &d), - resource.TestCheckResourceAttr(resourceName, "domain_name", "service.consul"), + resource.TestCheckResourceAttr(resourceName, "domain_name", fmt.Sprintf("service.%s", rName)), resource.TestCheckResourceAttr(resourceName, "domain_name_servers.0", "127.0.0.1"), resource.TestCheckResourceAttr(resourceName, "domain_name_servers.1", "10.0.0.2"), resource.TestCheckResourceAttr(resourceName, "ntp_servers.0", "127.0.0.1"), resource.TestCheckResourceAttr(resourceName, "netbios_name_servers.0", "127.0.0.1"), resource.TestCheckResourceAttr(resourceName, "netbios_node_type", "2"), - resource.TestCheckResourceAttr(resourceName, "tags.Name", "test-name"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), testAccCheckResourceAttrAccountID(resourceName, "owner_id"), ), }, @@ -122,6 +123,7 @@ func TestAccAWSDHCPOptions_basic(t *testing.T) { func TestAccAWSDHCPOptions_deleteOptions(t *testing.T) { var d ec2.DhcpOptions resourceName := "aws_vpc_dhcp_options.test" + rName := acctest.RandString(5) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -129,7 +131,7 @@ func TestAccAWSDHCPOptions_deleteOptions(t *testing.T) { CheckDestroy: testAccCheckDHCPOptionsDestroy, Steps: []resource.TestStep{ { - Config: testAccDHCPOptionsConfig, + Config: testAccDHCPOptionsConfig(rName), Check: resource.ComposeTestCheckFunc( testAccCheckDHCPOptionsExists(resourceName, &d), testAccCheckDHCPOptionsDelete(resourceName), @@ -140,6 +142,50 @@ func TestAccAWSDHCPOptions_deleteOptions(t *testing.T) { }) } +func TestAccAWSDHCPOptions_tags(t *testing.T) { + var d ec2.DhcpOptions + resourceName := "aws_vpc_dhcp_options.test" + rName := acctest.RandString(5) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckDHCPOptionsDestroy, + Steps: []resource.TestStep{ + { + Config: testAccDHCPOptionsConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckDHCPOptionsExists(resourceName, &d), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccDHCPOptionsConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckDHCPOptionsExists(resourceName, &d), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccDHCPOptionsConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckDHCPOptionsExists(resourceName, &d), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func testAccCheckDHCPOptionsDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).ec2conn @@ -154,7 +200,7 @@ func testAccCheckDHCPOptionsDestroy(s *terraform.State) error { aws.String(rs.Primary.ID), }, }) - if ae, ok := err.(awserr.Error); ok && ae.Code() == "InvalidDhcpOptionID.NotFound" { + if isAWSErr(err, "InvalidDhcpOptionID.NotFound", "") { continue } if err == nil { @@ -165,12 +211,7 @@ func testAccCheckDHCPOptionsDestroy(s *terraform.State) error { return nil } - // Verify the error is what we want - ec2err, ok := err.(awserr.Error) - if !ok { - return err - } - if ec2err.Code() != "InvalidDhcpOptionsID.NotFound" { + if !isAWSErr(err, "InvalidDhcpOptionID.NotFound", "") { return err } } @@ -228,16 +269,47 @@ func testAccCheckDHCPOptionsDelete(n string) resource.TestCheckFunc { } } -const testAccDHCPOptionsConfig = ` +func testAccDHCPOptionsConfig(rName string) string { + return fmt.Sprintf(` resource "aws_vpc_dhcp_options" "test" { - domain_name = "service.consul" + domain_name = "service.%s" domain_name_servers = ["127.0.0.1", "10.0.0.2"] ntp_servers = ["127.0.0.1"] netbios_name_servers = ["127.0.0.1"] netbios_node_type = 2 +} +`, rName) +} - tags = { - Name = "test-name" - } +func testAccDHCPOptionsConfigTags1(rName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_vpc_dhcp_options" "test" { + domain_name = "service.%[1]s" + domain_name_servers = ["127.0.0.1", "10.0.0.2"] + ntp_servers = ["127.0.0.1"] + netbios_name_servers = ["127.0.0.1"] + netbios_node_type = 2 + + tags = { + %[2]q = %[3]q + } +} +`, rName, tagKey1, tagValue1) +} + +func testAccDHCPOptionsConfigTags2(rName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_vpc_dhcp_options" "test" { + domain_name = "service.%[1]s" + domain_name_servers = ["127.0.0.1", "10.0.0.2"] + ntp_servers = ["127.0.0.1"] + netbios_name_servers = ["127.0.0.1"] + netbios_node_type = 2 + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, rName, tagKey1, tagValue1, tagKey2, tagValue2) } -` diff --git a/aws/resource_aws_vpc_endpoint.go b/aws/resource_aws_vpc_endpoint.go index 55e298aecd4..ad4f1057299 100644 --- a/aws/resource_aws_vpc_endpoint.go +++ b/aws/resource_aws_vpc_endpoint.go @@ -12,6 +12,7 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/structure" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsVpcEndpoint() *schema.Resource { @@ -186,8 +187,10 @@ func resourceAwsVpcEndpointCreate(d *schema.ResourceData, meta interface{}) erro return err } - if err := setTags(conn, d); err != nil { - return err + if v, ok := d.GetOk("tags"); ok { + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), nil, v.(map[string]interface{})); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } } return resourceAwsVpcEndpointRead(d, meta) @@ -271,10 +274,6 @@ func resourceAwsVpcEndpointRead(d *schema.ResourceData, meta interface{}) error if err != nil { return fmt.Errorf("error setting subnet_ids: %s", err) } - err = d.Set("tags", tagsToMap(vpce.Tags)) - if err != nil { - return fmt.Errorf("error setting tags: %s", err) - } // VPC endpoints don't have types in GovCloud, so set type to default if empty if vpceType := aws.StringValue(vpce.VpcEndpointType); vpceType == "" { d.Set("vpc_endpoint_type", ec2.VpcEndpointTypeGateway) @@ -282,6 +281,10 @@ func resourceAwsVpcEndpointRead(d *schema.ResourceData, meta interface{}) error d.Set("vpc_endpoint_type", vpceType) } + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(vpce.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + return nil } @@ -328,8 +331,11 @@ func resourceAwsVpcEndpointUpdate(d *schema.ResourceData, meta interface{}) erro return err } - if err := setTags(conn, d); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } } return resourceAwsVpcEndpointRead(d, meta) diff --git a/aws/resource_aws_vpc_endpoint_route_table_association.go b/aws/resource_aws_vpc_endpoint_route_table_association.go index 500d585422e..448848ddfcb 100644 --- a/aws/resource_aws_vpc_endpoint_route_table_association.go +++ b/aws/resource_aws_vpc_endpoint_route_table_association.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" @@ -17,7 +18,7 @@ func resourceAwsVpcEndpointRouteTableAssociation() *schema.Resource { Read: resourceAwsVpcEndpointRouteTableAssociationRead, Delete: resourceAwsVpcEndpointRouteTableAssociationDelete, Importer: &schema.ResourceImporter{ - State: schema.ImportStatePassthrough, + State: resourceAwsVpcEndpointRouteTableAssociationImport, }, Schema: map[string]*schema.Schema{ @@ -123,6 +124,23 @@ func resourceAwsVpcEndpointRouteTableAssociationDelete(d *schema.ResourceData, m return nil } +func resourceAwsVpcEndpointRouteTableAssociationImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { + parts := strings.Split(d.Id(), "/") + if len(parts) != 2 { + return nil, fmt.Errorf("Wrong format of resource: %s. Please follow 'vpc-endpoint-id/route-table-id'", d.Id()) + } + + vpceId := parts[0] + rtId := parts[1] + log.Printf("[DEBUG] Importing VPC Endpoint (%s) Route Table (%s) association", vpceId, rtId) + + d.SetId(vpcEndpointIdRouteTableIdHash(vpceId, rtId)) + d.Set("vpc_endpoint_id", vpceId) + d.Set("route_table_id", rtId) + + return []*schema.ResourceData{d}, nil +} + func findResourceVpcEndpoint(conn *ec2.EC2, id string) (*ec2.VpcEndpoint, error) { resp, err := conn.DescribeVpcEndpoints(&ec2.DescribeVpcEndpointsInput{ VpcEndpointIds: aws.StringSlice([]string{id}), diff --git a/aws/resource_aws_vpc_endpoint_route_table_association_test.go b/aws/resource_aws_vpc_endpoint_route_table_association_test.go index 672b58f9683..09360933a2c 100644 --- a/aws/resource_aws_vpc_endpoint_route_table_association_test.go +++ b/aws/resource_aws_vpc_endpoint_route_table_association_test.go @@ -7,12 +7,15 @@ import ( "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-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) func TestAccAWSVpcEndpointRouteTableAssociation_basic(t *testing.T) { var vpce ec2.VpcEndpoint + resourceName := "aws_vpc_endpoint_route_table_association.test" + rName := fmt.Sprintf("tf-testacc-vpce-%s", acctest.RandStringFromCharSet(16, acctest.CharSetAlphaNum)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -20,12 +23,17 @@ func TestAccAWSVpcEndpointRouteTableAssociation_basic(t *testing.T) { CheckDestroy: testAccCheckVpcEndpointRouteTableAssociationDestroy, Steps: []resource.TestStep{ { - Config: testAccVpcEndpointRouteTableAssociationConfig, + Config: testAccVpcEndpointRouteTableAssociationConfig(rName), Check: resource.ComposeTestCheckFunc( - testAccCheckVpcEndpointRouteTableAssociationExists( - "aws_vpc_endpoint_route_table_association.a", &vpce), + testAccCheckVpcEndpointRouteTableAssociationExists(resourceName, &vpce), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateIdFunc: testAccAWSVpcEndpointRouteTableAssociationImportStateIdFunc(resourceName), + ImportStateVerify: true, + }, }, }) } @@ -72,7 +80,7 @@ func testAccCheckVpcEndpointRouteTableAssociationExists(n string, vpce *ec2.VpcE } if rs.Primary.ID == "" { - return fmt.Errorf("No ID is set") + return fmt.Errorf("No VPC Endpoint Route Table Association ID is set") } conn := testAccProvider.Meta().(*AWSClient).ec2conn @@ -83,48 +91,65 @@ func testAccCheckVpcEndpointRouteTableAssociationExists(n string, vpce *ec2.VpcE return err } if len(resp.VpcEndpoints) == 0 { - return fmt.Errorf("VPC endpoint not found") + return fmt.Errorf("VPC Endpoint not found") } *vpce = *resp.VpcEndpoints[0] if len(vpce.RouteTableIds) == 0 { - return fmt.Errorf("no route table associations") + return fmt.Errorf("No VPC Endpoint Route Table Associations") } - for _, id := range vpce.RouteTableIds { - if *id == rs.Primary.Attributes["route_table_id"] { + for _, rtId := range vpce.RouteTableIds { + if aws.StringValue(rtId) == rs.Primary.Attributes["route_table_id"] { return nil } } - return fmt.Errorf("route table association not found") + return fmt.Errorf("VPC Endpoint Route Table Association not found") + } +} + +func testAccAWSVpcEndpointRouteTableAssociationImportStateIdFunc(n string) resource.ImportStateIdFunc { + return func(s *terraform.State) (string, error) { + rs, ok := s.RootModule().Resources[n] + if !ok { + return "", fmt.Errorf("Not found: %s", n) + } + + id := fmt.Sprintf("%s/%s", rs.Primary.Attributes["vpc_endpoint_id"], rs.Primary.Attributes["route_table_id"]) + return id, nil } } -const testAccVpcEndpointRouteTableAssociationConfig = ` -resource "aws_vpc" "foo" { - cidr_block = "10.0.0.0/16" +func testAccVpcEndpointRouteTableAssociationConfig(rName string) string { + return fmt.Sprintf(` +resource "aws_vpc" "test" { + cidr_block = "10.0.0.0/16" + tags = { - Name = "terraform-testacc-vpc-endpoint-route-table-association" - } + Name = %[1]q + } } -resource "aws_vpc_endpoint" "s3" { - vpc_id = "${aws_vpc.foo.id}" - service_name = "com.amazonaws.us-west-2.s3" +data "aws_region" "current" {} + +resource "aws_vpc_endpoint" "test" { + vpc_id = "${aws_vpc.test.id}" + service_name = "com.amazonaws.${data.aws_region.current.name}.s3" } -resource "aws_route_table" "rt" { - vpc_id = "${aws_vpc.foo.id}" +resource "aws_route_table" "test" { + vpc_id = "${aws_vpc.test.id}" tags = { - Name = "test" - } + Name = %[1]q + } } -resource "aws_vpc_endpoint_route_table_association" "a" { - vpc_endpoint_id = "${aws_vpc_endpoint.s3.id}" - route_table_id = "${aws_route_table.rt.id}" +resource "aws_vpc_endpoint_route_table_association" "test" { + vpc_endpoint_id = "${aws_vpc_endpoint.test.id}" + route_table_id = "${aws_route_table.test.id}" +} +`, rName) } -` diff --git a/aws/resource_aws_vpc_endpoint_service.go b/aws/resource_aws_vpc_endpoint_service.go index d3c89ffdfcf..1544f8446a4 100644 --- a/aws/resource_aws_vpc_endpoint_service.go +++ b/aws/resource_aws_vpc_endpoint_service.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsVpcEndpointService() *schema.Resource { @@ -139,7 +140,7 @@ func resourceAwsVpcEndpointServiceRead(d *schema.ResourceData, meta interface{}) d.Set("service_name", svcCfg.ServiceName) d.Set("service_type", svcCfg.ServiceType[0].ServiceType) d.Set("state", svcCfg.ServiceState) - err = d.Set("tags", tagsToMap(svcCfg.Tags)) + err = d.Set("tags", keyvaluetags.Ec2KeyValueTags(svcCfg.Tags).IgnoreAws().Map()) if err != nil { return fmt.Errorf("error setting tags: %s", err) } @@ -202,10 +203,13 @@ func resourceAwsVpcEndpointServiceUpdate(d *schema.ResourceData, meta interface{ d.SetPartial("allowed_principals") } - if err := setTags(conn, d); err != nil { - return err + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating EC2 VPC Endpoint Service (%s) tags: %s", d.Id(), err) + } } - d.SetPartial("tags") d.Partial(false) return resourceAwsVpcEndpointServiceRead(d, meta) diff --git a/aws/resource_aws_vpc_endpoint_test.go b/aws/resource_aws_vpc_endpoint_test.go index 82d9c2245d2..de586af56fb 100644 --- a/aws/resource_aws_vpc_endpoint_test.go +++ b/aws/resource_aws_vpc_endpoint_test.go @@ -84,7 +84,7 @@ func testSweepEc2VpcEndpoints(region string) error { func TestAccAWSVpcEndpoint_gatewayBasic(t *testing.T) { var endpoint ec2.VpcEndpoint resourceName := "aws_vpc_endpoint.test" - rName := fmt.Sprintf("tf-testacc-vpce-%s", acctest.RandStringFromCharSet(16, acctest.CharSetAlphaNum)) + rName := acctest.RandomWithPrefix("tf-testacc-vpce") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -107,6 +107,11 @@ func TestAccAWSVpcEndpoint_gatewayBasic(t *testing.T) { testAccCheckResourceAttrAccountID(resourceName, "owner_id"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -116,7 +121,7 @@ func TestAccAWSVpcEndpoint_gatewayWithRouteTableAndPolicyAndTags(t *testing.T) { var routeTable ec2.RouteTable resourceName := "aws_vpc_endpoint.test" resourceNameRt := "aws_route_table.test" - rName := fmt.Sprintf("tf-testacc-vpce-%s", acctest.RandStringFromCharSet(16, acctest.CharSetAlphaNum)) + rName := acctest.RandomWithPrefix("tf-testacc-vpce") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -205,7 +210,7 @@ func TestAccAWSVpcEndpoint_gatewayPolicy(t *testing.T) { } ` resourceName := "aws_vpc_endpoint.test" - rName := fmt.Sprintf("tf-testacc-vpce-%s", acctest.RandStringFromCharSet(16, acctest.CharSetAlphaNum)) + rName := acctest.RandomWithPrefix("tf-testacc-vpce") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -236,7 +241,7 @@ func TestAccAWSVpcEndpoint_gatewayPolicy(t *testing.T) { func TestAccAWSVpcEndpoint_interfaceBasic(t *testing.T) { var endpoint ec2.VpcEndpoint resourceName := "aws_vpc_endpoint.test" - rName := fmt.Sprintf("tf-testacc-vpce-%s", acctest.RandStringFromCharSet(16, acctest.CharSetAlphaNum)) + rName := acctest.RandomWithPrefix("tf-testacc-vpce") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -260,6 +265,11 @@ func TestAccAWSVpcEndpoint_interfaceBasic(t *testing.T) { testAccCheckResourceAttrAccountID(resourceName, "owner_id"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -267,7 +277,7 @@ func TestAccAWSVpcEndpoint_interfaceBasic(t *testing.T) { func TestAccAWSVpcEndpoint_interfaceWithSubnetAndSecurityGroup(t *testing.T) { var endpoint ec2.VpcEndpoint resourceName := "aws_vpc_endpoint.test" - rName := fmt.Sprintf("tf-testacc-vpce-%s", acctest.RandStringFromCharSet(16, acctest.CharSetAlphaNum)) + rName := acctest.RandomWithPrefix("tf-testacc-vpce") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -321,7 +331,7 @@ func TestAccAWSVpcEndpoint_interfaceWithSubnetAndSecurityGroup(t *testing.T) { func TestAccAWSVpcEndpoint_interfaceNonAWSService(t *testing.T) { var endpoint ec2.VpcEndpoint resourceName := "aws_vpc_endpoint.test" - rName := fmt.Sprintf("tf-testacc-vpce-%s", acctest.RandStringFromCharSet(16, acctest.CharSetAlphaNum)) + rName := acctest.RandomWithPrefix("tf-acc-vpce") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -347,6 +357,12 @@ func TestAccAWSVpcEndpoint_interfaceNonAWSService(t *testing.T) { testAccCheckResourceAttrAccountID(resourceName, "owner_id"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"auto_accept"}, + }, }, }) } @@ -354,19 +370,7 @@ func TestAccAWSVpcEndpoint_interfaceNonAWSService(t *testing.T) { func TestAccAWSVpcEndpoint_removed(t *testing.T) { var endpoint ec2.VpcEndpoint resourceName := "aws_vpc_endpoint.test" - rName := fmt.Sprintf("tf-testacc-vpce-%s", acctest.RandStringFromCharSet(16, acctest.CharSetAlphaNum)) - - // reach out and DELETE the VPC Endpoint outside of Terraform - testDestroy := func(*terraform.State) error { - conn := testAccProvider.Meta().(*AWSClient).ec2conn - input := &ec2.DeleteVpcEndpointsInput{ - VpcEndpointIds: []*string{endpoint.VpcEndpointId}, - } - - _, err := conn.DeleteVpcEndpoints(input) - - return err - } + rName := acctest.RandomWithPrefix("tf-testacc-vpce") resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -377,7 +381,7 @@ func TestAccAWSVpcEndpoint_removed(t *testing.T) { Config: testAccVpcEndpointConfig_gatewayWithoutRouteTableOrPolicyOrTags(rName), Check: resource.ComposeTestCheckFunc( testAccCheckVpcEndpointExists(resourceName, &endpoint), - testDestroy, + testAccCheckVpcEndpointDisappears(&endpoint), ), ExpectNonEmptyPlan: true, }, @@ -385,6 +389,19 @@ func TestAccAWSVpcEndpoint_removed(t *testing.T) { }) } +func testAccCheckVpcEndpointDisappears(endpoint *ec2.VpcEndpoint) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + input := &ec2.DeleteVpcEndpointsInput{ + VpcEndpointIds: []*string{endpoint.VpcEndpointId}, + } + + _, err := conn.DeleteVpcEndpoints(input) + + return err + } +} + func testAccCheckVpcEndpointDestroy(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).ec2conn diff --git a/aws/resource_aws_vpc_peering_connection.go b/aws/resource_aws_vpc_peering_connection.go index d0c48dc89e9..d0de5abcd90 100644 --- a/aws/resource_aws_vpc_peering_connection.go +++ b/aws/resource_aws_vpc_peering_connection.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsVpcPeeringConnection() *schema.Resource { @@ -161,7 +162,7 @@ func resourceAwsVPCPeeringRead(d *schema.ResourceData, meta interface{}) error { return fmt.Errorf("Error setting VPC Peering Connection requester information: %s", err) } - err = d.Set("tags", tagsToMap(pc.Tags)) + err = d.Set("tags", keyvaluetags.Ec2KeyValueTags(pc.Tags).IgnoreAws().Map()) if err != nil { return fmt.Errorf("Error setting VPC Peering Connection tags: %s", err) } @@ -202,10 +203,12 @@ func resourceAwsVpcPeeringConnectionModifyOptions(d *schema.ResourceData, meta i 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") + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating EC2 VPC Peering Connection (%s) tags: %s", d.Id(), err) + } } pcRaw, statusCode, err := vpcPeeringConnectionRefreshState(conn, d.Id())() diff --git a/aws/resource_aws_vpc_peering_connection_accepter.go b/aws/resource_aws_vpc_peering_connection_accepter.go index 7ab8a049553..9ee605d2f00 100644 --- a/aws/resource_aws_vpc_peering_connection_accepter.go +++ b/aws/resource_aws_vpc_peering_connection_accepter.go @@ -1,9 +1,8 @@ package aws import ( - "log" - "fmt" + "log" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -14,6 +13,13 @@ func resourceAwsVpcPeeringConnectionAccepter() *schema.Resource { Read: resourceAwsVPCPeeringRead, Update: resourceAwsVPCPeeringUpdate, Delete: resourceAwsVPCPeeringAccepterDelete, + Importer: &schema.ResourceImporter{ + State: func(d *schema.ResourceData, m interface{}) (result []*schema.ResourceData, err error) { + d.Set("vpc_peering_connection_id", d.Id()) + + return []*schema.ResourceData{d}, nil + }, + }, Schema: map[string]*schema.Schema{ "vpc_peering_connection_id": { diff --git a/aws/resource_aws_vpc_peering_connection_accepter_test.go b/aws/resource_aws_vpc_peering_connection_accepter_test.go index 869a17b142e..4e5c094a8a6 100644 --- a/aws/resource_aws_vpc_peering_connection_accepter_test.go +++ b/aws/resource_aws_vpc_peering_connection_accepter_test.go @@ -52,6 +52,13 @@ func TestAccAWSVPCPeeringConnectionAccepter_sameRegionSameAccount(t *testing.T) resource.TestCheckResourceAttr(resourceNameAccepter, "accept_status", "active"), ), }, + { + Config: testAccAwsVPCPeeringConnectionAccepterConfigSameRegionSameAccount(rName), + ResourceName: resourceNameAccepter, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"auto_accept"}, + }, }, }) } @@ -91,6 +98,13 @@ func TestAccAWSVPCPeeringConnectionAccepter_differentRegionSameAccount(t *testin resource.TestCheckResourceAttr(resourceNameAccepter, "accept_status", "active"), ), }, + { + Config: testAccAwsVPCPeeringConnectionAccepterConfigDifferentRegionSameAccount(rName), + ResourceName: resourceNameAccepter, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{"auto_accept"}, + }, }, }) } diff --git a/aws/resource_aws_vpc_test.go b/aws/resource_aws_vpc_test.go index 6bcf727f7e2..02ffa7eb2c5 100644 --- a/aws/resource_aws_vpc_test.go +++ b/aws/resource_aws_vpc_test.go @@ -10,8 +10,11 @@ import ( "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/go-multierror" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/terraform" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) // add sweeper to delete known test vpcs @@ -39,51 +42,63 @@ func testSweepVPCs(region string) error { return fmt.Errorf("error getting client: %s", err) } conn := client.(*AWSClient).ec2conn + input := &ec2.DescribeVpcsInput{} + var sweeperErrs *multierror.Error - req := &ec2.DescribeVpcsInput{} - resp, err := conn.DescribeVpcs(req) - if err != nil { - if testSweepSkipSweepError(err) { - log.Printf("[WARN] Skipping EC2 VPC sweep for %s: %s", region, err) - return nil - } - return fmt.Errorf("Error describing vpcs: %s", err) - } - - if len(resp.Vpcs) == 0 { - log.Print("[DEBUG] No aws vpcs to sweep") - return nil - } + err = conn.DescribeVpcsPages(input, func(page *ec2.DescribeVpcsOutput, lastPage bool) bool { + for _, vpc := range page.Vpcs { + if vpc == nil { + continue + } - for _, vpc := range resp.Vpcs { - if aws.BoolValue(vpc.IsDefault) { - log.Printf("[DEBUG] Skipping Default VPC: %s", aws.StringValue(vpc.VpcId)) - continue - } + id := aws.StringValue(vpc.VpcId) + input := &ec2.DeleteVpcInput{ + VpcId: vpc.VpcId, + } - input := &ec2.DeleteVpcInput{ - VpcId: vpc.VpcId, - } - log.Printf("[DEBUG] Deleting VPC: %s", input) + if aws.BoolValue(vpc.IsDefault) { + log.Printf("[DEBUG] Skipping default EC2 VPC: %s", id) + continue + } - // Handle EC2 eventual consistency - err := resource.Retry(1*time.Minute, func() *resource.RetryError { - _, err := conn.DeleteVpc(input) - if isAWSErr(err, "DependencyViolation", "") { - return resource.RetryableError(err) + log.Printf("[INFO] Deleting EC2 VPC: %s", id) + + // Handle EC2 eventual consistency + err := resource.Retry(1*time.Minute, func() *resource.RetryError { + _, err := conn.DeleteVpc(input) + if isAWSErr(err, "DependencyViolation", "") { + return resource.RetryableError(err) + } + if err != nil { + return resource.NonRetryableError(err) + } + return nil + }) + + if isResourceTimeoutError(err) { + _, err = conn.DeleteVpc(input) } + if err != nil { - return resource.NonRetryableError(err) + sweeperErr := fmt.Errorf("error deleting EC2 VPC (%s): %w", id, err) + log.Printf("[ERROR] %s", sweeperErr) + sweeperErrs = multierror.Append(sweeperErrs, sweeperErr) } - return nil - }) - - if err != nil { - return fmt.Errorf("Error deleting VPC (%s): %s", aws.StringValue(vpc.VpcId), err) } + + return !lastPage + }) + + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping EC2 VPC sweep for %s: %s", region, err) + return nil } - return nil + if err != nil { + return fmt.Errorf("Error describing vpcs: %s", err) + } + + return sweeperErrs.ErrorOrNil() } func TestAccAWSVpc_basic(t *testing.T) { @@ -142,6 +157,36 @@ func TestAccAWSVpc_disappears(t *testing.T) { }) } +func TestAccAWSVpc_ignoreTags(t *testing.T) { + var providers []*schema.Provider + var vpc ec2.Vpc + resourceName := "aws_vpc.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + ProviderFactories: testAccProviderFactories(&providers), + CheckDestroy: testAccCheckVpcDestroy, + Steps: []resource.TestStep{ + { + Config: testAccVpcConfigTags, + Check: resource.ComposeTestCheckFunc( + testAccCheckVpcExists(resourceName, &vpc), + testAccCheckVpcUpdateTags(&vpc, nil, map[string]string{"ignorekey1": "ignorevalue1"}), + ), + ExpectNonEmptyPlan: true, + }, + { + Config: testAccProviderConfigIgnoreTagPrefixes1("ignorekey") + testAccVpcConfigTags, + PlanOnly: true, + }, + { + Config: testAccProviderConfigIgnoreTags1("ignorekey1") + testAccVpcConfigTags, + PlanOnly: true, + }, + }, + }) +} + func TestAccAWSVpc_AssignGeneratedIpv6CidrBlock(t *testing.T) { var vpc ec2.Vpc resourceName := "aws_vpc.test" @@ -332,6 +377,14 @@ func testAccCheckVpcDestroy(s *terraform.State) error { return nil } +func testAccCheckVpcUpdateTags(vpc *ec2.Vpc, oldTags, newTags map[string]string) resource.TestCheckFunc { + return func(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).ec2conn + + return keyvaluetags.Ec2UpdateTags(conn, aws.StringValue(vpc.VpcId), oldTags, newTags) + } +} + func testAccCheckVpcCidr(vpc *ec2.Vpc, expected string) resource.TestCheckFunc { return func(s *terraform.State) error { if aws.StringValue(vpc.CidrBlock) != expected { diff --git a/aws/resource_aws_vpn_connection.go b/aws/resource_aws_vpn_connection.go index 2a8a10e3a1a..61ffbc3d65a 100644 --- a/aws/resource_aws_vpn_connection.go +++ b/aws/resource_aws_vpn_connection.go @@ -14,10 +14,10 @@ import ( "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-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) type XmlVpnConnectionConfig struct { @@ -322,9 +322,10 @@ func resourceAwsVpnConnectionCreate(d *schema.ResourceData, meta interface{}) er return fmt.Errorf("error waiting for VPN connection (%s) to become available: %s", d.Id(), err) } - // Create tags. - if err := setTags(conn, d); err != nil { - return err + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), nil, v); err != nil { + return fmt.Errorf("error adding EC2 VPN Connection (%s) tags: %s", d.Id(), err) + } } // Read off the API to populate our RO fields. @@ -430,7 +431,10 @@ func resourceAwsVpnConnectionRead(d *schema.ResourceData, meta interface{}) erro d.Set("customer_gateway_id", vpnConnection.CustomerGatewayId) d.Set("transit_gateway_id", vpnConnection.TransitGatewayId) d.Set("type", vpnConnection.Type) - d.Set("tags", tagsToMap(vpnConnection.Tags)) + + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(vpnConnection.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } if vpnConnection.Options != nil { if err := d.Set("static_routes_only", vpnConnection.Options.StaticRoutesOnly); err != nil { @@ -477,12 +481,13 @@ func resourceAwsVpnConnectionRead(d *schema.ResourceData, meta interface{}) erro 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 - } + if d.HasChange("tags") { + o, n := d.GetChange("tags") - d.SetPartial("tags") + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating EC2 VPN Connection (%s) tags: %s", d.Id(), err) + } + } return resourceAwsVpnConnectionRead(d, meta) } diff --git a/aws/resource_aws_vpn_gateway.go b/aws/resource_aws_vpn_gateway.go index b0e3c69c8eb..4d5d2069c7e 100644 --- a/aws/resource_aws_vpn_gateway.go +++ b/aws/resource_aws_vpn_gateway.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsVpnGateway() *schema.Resource { @@ -71,13 +72,21 @@ func resourceAwsVpnGatewayCreate(d *schema.ResourceData, meta interface{}) error 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) + d.SetId(aws.StringValue(resp.VpnGateway.VpnGatewayId)) - // Attach the VPN gateway to the correct VPC - return resourceAwsVpnGatewayUpdate(d, meta) + if _, ok := d.GetOk("vpc_id"); ok { + if err := resourceAwsVpnGatewayAttach(d, meta); err != nil { + return fmt.Errorf("error attaching EC2 VPN Gateway (%s) to VPC: %s", d.Id(), err) + } + } + + if v := d.Get("tags").(map[string]interface{}); len(v) > 0 { + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), nil, v); err != nil { + return fmt.Errorf("error adding EC2 VPN Gateway (%s) tags: %s", d.Id(), err) + } + } + + return resourceAwsVpnGatewayRead(d, meta) } func resourceAwsVpnGatewayRead(d *schema.ResourceData, meta interface{}) error { @@ -108,14 +117,17 @@ func resourceAwsVpnGatewayRead(d *schema.ResourceData, meta interface{}) error { // Gateway exists but not attached to the VPC d.Set("vpc_id", "") } else { - d.Set("vpc_id", *vpnAttachment.VpcId) + d.Set("vpc_id", vpnAttachment.VpcId) } if vpnGateway.AvailabilityZone != nil && *vpnGateway.AvailabilityZone != "" { d.Set("availability_zone", vpnGateway.AvailabilityZone) } d.Set("amazon_side_asn", strconv.FormatInt(aws.Int64Value(vpnGateway.AmazonSideAsn), 10)) - d.Set("tags", tagsToMap(vpnGateway.Tags)) + + if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(vpnGateway.Tags).IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } return nil } @@ -135,11 +147,13 @@ func resourceAwsVpnGatewayUpdate(d *schema.ResourceData, meta interface{}) error conn := meta.(*AWSClient).ec2conn - if err := setTags(conn, d); err != nil { - return err - } + if d.HasChange("tags") { + o, n := d.GetChange("tags") - d.SetPartial("tags") + if err := keyvaluetags.Ec2UpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating EC2 VPN Gateway (%s) tags: %s", d.Id(), err) + } + } return resourceAwsVpnGatewayRead(d, meta) } diff --git a/aws/resource_aws_vpn_gateway_attachment.go b/aws/resource_aws_vpn_gateway_attachment.go index 02a188fdd79..e4906ade09e 100644 --- a/aws/resource_aws_vpn_gateway_attachment.go +++ b/aws/resource_aws_vpn_gateway_attachment.go @@ -106,7 +106,7 @@ func resourceAwsVpnGatewayAttachmentRead(d *schema.ResourceData, meta interface{ return nil } - d.Set("vpc_id", *vga.VpcId) + d.Set("vpc_id", vga.VpcId) return nil } diff --git a/aws/resource_aws_waf_byte_match_set.go b/aws/resource_aws_waf_byte_match_set.go index ec7f7b7f563..075438f45af 100644 --- a/aws/resource_aws_waf_byte_match_set.go +++ b/aws/resource_aws_waf_byte_match_set.go @@ -16,6 +16,9 @@ func resourceAwsWafByteMatchSet() *schema.Resource { Read: resourceAwsWafByteMatchSetRead, Update: resourceAwsWafByteMatchSetUpdate, Delete: resourceAwsWafByteMatchSetDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "name": { diff --git a/aws/resource_aws_waf_byte_match_set_test.go b/aws/resource_aws_waf_byte_match_set_test.go index 0d6da476fa1..93c12896f13 100644 --- a/aws/resource_aws_waf_byte_match_set_test.go +++ b/aws/resource_aws_waf_byte_match_set_test.go @@ -16,6 +16,7 @@ import ( func TestAccAWSWafByteMatchSet_basic(t *testing.T) { var v waf.ByteMatchSet byteMatchSet := fmt.Sprintf("byteMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_byte_match_set.byte_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -25,23 +26,28 @@ func TestAccAWSWafByteMatchSet_basic(t *testing.T) { { Config: testAccAWSWafByteMatchSetConfig(byteMatchSet), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafByteMatchSetExists("aws_waf_byte_match_set.byte_set", &v), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "name", byteMatchSet), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.#", "2"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.field_to_match.#", "1"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.field_to_match.2991901334.data", "referer"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.field_to_match.2991901334.type", "HEADER"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.positional_constraint", "CONTAINS"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.target_string", "badrefer1"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.text_transformation", "NONE"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.839525137.field_to_match.#", "1"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.839525137.field_to_match.2991901334.data", "referer"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.839525137.field_to_match.2991901334.type", "HEADER"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.839525137.positional_constraint", "CONTAINS"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.839525137.target_string", "badrefer2"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.839525137.text_transformation", "NONE"), + testAccCheckAWSWafByteMatchSetExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "name", byteMatchSet), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.#", "2"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.field_to_match.2991901334.data", "referer"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.field_to_match.2991901334.type", "HEADER"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.positional_constraint", "CONTAINS"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.target_string", "badrefer1"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.text_transformation", "NONE"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.839525137.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.839525137.field_to_match.2991901334.data", "referer"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.839525137.field_to_match.2991901334.type", "HEADER"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.839525137.positional_constraint", "CONTAINS"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.839525137.target_string", "badrefer2"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.839525137.text_transformation", "NONE"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -50,6 +56,7 @@ func TestAccAWSWafByteMatchSet_changeNameForceNew(t *testing.T) { var before, after waf.ByteMatchSet byteMatchSet := fmt.Sprintf("byteMatchSet-%s", acctest.RandString(5)) byteMatchSetNewName := fmt.Sprintf("byteMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_byte_match_set.byte_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -59,23 +66,24 @@ func TestAccAWSWafByteMatchSet_changeNameForceNew(t *testing.T) { { Config: testAccAWSWafByteMatchSetConfig(byteMatchSet), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafByteMatchSetExists("aws_waf_byte_match_set.byte_set", &before), - resource.TestCheckResourceAttr( - "aws_waf_byte_match_set.byte_set", "name", byteMatchSet), - resource.TestCheckResourceAttr( - "aws_waf_byte_match_set.byte_set", "byte_match_tuples.#", "2"), + testAccCheckAWSWafByteMatchSetExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "name", byteMatchSet), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.#", "2"), ), }, { Config: testAccAWSWafByteMatchSetConfigChangeName(byteMatchSetNewName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafByteMatchSetExists("aws_waf_byte_match_set.byte_set", &after), - resource.TestCheckResourceAttr( - "aws_waf_byte_match_set.byte_set", "name", byteMatchSetNewName), - resource.TestCheckResourceAttr( - "aws_waf_byte_match_set.byte_set", "byte_match_tuples.#", "2"), + testAccCheckAWSWafByteMatchSetExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", byteMatchSetNewName), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.#", "2"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -83,6 +91,7 @@ func TestAccAWSWafByteMatchSet_changeNameForceNew(t *testing.T) { func TestAccAWSWafByteMatchSet_changeTuples(t *testing.T) { var before, after waf.ByteMatchSet byteMatchSetName := fmt.Sprintf("byteMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_byte_match_set.byte_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -92,43 +101,48 @@ func TestAccAWSWafByteMatchSet_changeTuples(t *testing.T) { { Config: testAccAWSWafByteMatchSetConfig(byteMatchSetName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafByteMatchSetExists("aws_waf_byte_match_set.byte_set", &before), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "name", byteMatchSetName), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.#", "2"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.field_to_match.#", "1"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.field_to_match.2991901334.data", "referer"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.field_to_match.2991901334.type", "HEADER"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.positional_constraint", "CONTAINS"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.target_string", "badrefer1"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.text_transformation", "NONE"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.839525137.field_to_match.#", "1"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.839525137.field_to_match.2991901334.data", "referer"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.839525137.field_to_match.2991901334.type", "HEADER"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.839525137.positional_constraint", "CONTAINS"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.839525137.target_string", "badrefer2"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.839525137.text_transformation", "NONE"), + testAccCheckAWSWafByteMatchSetExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "name", byteMatchSetName), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.#", "2"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.field_to_match.2991901334.data", "referer"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.field_to_match.2991901334.type", "HEADER"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.positional_constraint", "CONTAINS"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.target_string", "badrefer1"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.text_transformation", "NONE"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.839525137.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.839525137.field_to_match.2991901334.data", "referer"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.839525137.field_to_match.2991901334.type", "HEADER"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.839525137.positional_constraint", "CONTAINS"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.839525137.target_string", "badrefer2"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.839525137.text_transformation", "NONE"), ), }, { Config: testAccAWSWafByteMatchSetConfig_changeTuples(byteMatchSetName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafByteMatchSetExists("aws_waf_byte_match_set.byte_set", &after), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "name", byteMatchSetName), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.#", "2"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.field_to_match.#", "1"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.field_to_match.2991901334.data", "referer"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.field_to_match.2991901334.type", "HEADER"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.positional_constraint", "CONTAINS"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.target_string", "badrefer1"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.2174619346.text_transformation", "NONE"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.4224486115.field_to_match.#", "1"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.4224486115.field_to_match.4253810390.data", "GET"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.4224486115.field_to_match.4253810390.type", "METHOD"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.4224486115.positional_constraint", "CONTAINS_WORD"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.4224486115.target_string", "blah"), - resource.TestCheckResourceAttr("aws_waf_byte_match_set.byte_set", "byte_match_tuples.4224486115.text_transformation", "URL_DECODE"), + testAccCheckAWSWafByteMatchSetExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", byteMatchSetName), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.#", "2"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.field_to_match.2991901334.data", "referer"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.field_to_match.2991901334.type", "HEADER"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.positional_constraint", "CONTAINS"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.target_string", "badrefer1"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.2174619346.text_transformation", "NONE"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.4224486115.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.4224486115.field_to_match.4253810390.data", "GET"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.4224486115.field_to_match.4253810390.type", "METHOD"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.4224486115.positional_constraint", "CONTAINS_WORD"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.4224486115.target_string", "blah"), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.4224486115.text_transformation", "URL_DECODE"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -136,6 +150,7 @@ func TestAccAWSWafByteMatchSet_changeTuples(t *testing.T) { func TestAccAWSWafByteMatchSet_noTuples(t *testing.T) { var byteSet waf.ByteMatchSet byteMatchSetName := fmt.Sprintf("byteMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_byte_match_set.byte_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -145,13 +160,16 @@ func TestAccAWSWafByteMatchSet_noTuples(t *testing.T) { { Config: testAccAWSWafByteMatchSetConfig_noTuples(byteMatchSetName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafByteMatchSetExists("aws_waf_byte_match_set.byte_set", &byteSet), - resource.TestCheckResourceAttr( - "aws_waf_byte_match_set.byte_set", "name", byteMatchSetName), - resource.TestCheckResourceAttr( - "aws_waf_byte_match_set.byte_set", "byte_match_tuples.#", "0"), + testAccCheckAWSWafByteMatchSetExists(resourceName, &byteSet), + resource.TestCheckResourceAttr(resourceName, "name", byteMatchSetName), + resource.TestCheckResourceAttr(resourceName, "byte_match_tuples.#", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -159,6 +177,7 @@ func TestAccAWSWafByteMatchSet_noTuples(t *testing.T) { func TestAccAWSWafByteMatchSet_disappears(t *testing.T) { var v waf.ByteMatchSet byteMatchSet := fmt.Sprintf("byteMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_byte_match_set.byte_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -168,7 +187,7 @@ func TestAccAWSWafByteMatchSet_disappears(t *testing.T) { { Config: testAccAWSWafByteMatchSetConfig(byteMatchSet), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafByteMatchSetExists("aws_waf_byte_match_set.byte_set", &v), + testAccCheckAWSWafByteMatchSetExists(resourceName, &v), testAccCheckAWSWafByteMatchSetDisappears(&v), ), ExpectNonEmptyPlan: true, diff --git a/aws/resource_aws_waf_geo_match_set.go b/aws/resource_aws_waf_geo_match_set.go index 86933b6eae8..6c99f9bad5f 100644 --- a/aws/resource_aws_waf_geo_match_set.go +++ b/aws/resource_aws_waf_geo_match_set.go @@ -5,6 +5,7 @@ import ( "log" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -15,6 +16,9 @@ func resourceAwsWafGeoMatchSet() *schema.Resource { Read: resourceAwsWafGeoMatchSetRead, Update: resourceAwsWafGeoMatchSetUpdate, Delete: resourceAwsWafGeoMatchSetDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "name": { @@ -22,6 +26,10 @@ func resourceAwsWafGeoMatchSet() *schema.Resource { Required: true, ForceNew: true, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, "geo_match_constraint": { Type: schema.TypeSet, Optional: true, @@ -75,9 +83,7 @@ func resourceAwsWafGeoMatchSetRead(d *schema.ResourceData, meta interface{}) err resp, err := conn.GetGeoMatchSet(params) if err != nil { - // TODO: Replace with constant once it's available - // See https://github.com/aws/aws-sdk-go/issues/1856 - if isAWSErr(err, "WAFNonexistentItemException", "") { + if isAWSErr(err, waf.ErrCodeNonexistentItemException, "") { log.Printf("[WARN] WAF GeoMatchSet (%s) not found, removing from state", d.Id()) d.SetId("") return nil @@ -89,6 +95,14 @@ func resourceAwsWafGeoMatchSetRead(d *schema.ResourceData, meta interface{}) err d.Set("name", resp.GeoMatchSet.Name) d.Set("geo_match_constraint", flattenWafGeoMatchConstraint(resp.GeoMatchSet.GeoMatchConstraints)) + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "waf", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("geomatchset/%s", d.Id()), + } + d.Set("arn", arn.String()) + return nil } diff --git a/aws/resource_aws_waf_geo_match_set_test.go b/aws/resource_aws_waf_geo_match_set_test.go index fd04c14fa98..c48ef971bfa 100644 --- a/aws/resource_aws_waf_geo_match_set_test.go +++ b/aws/resource_aws_waf_geo_match_set_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "regexp" "testing" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" @@ -15,6 +16,7 @@ import ( func TestAccAWSWafGeoMatchSet_basic(t *testing.T) { var v waf.GeoMatchSet geoMatchSet := fmt.Sprintf("geoMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_geo_match_set.geo_match_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -24,21 +26,21 @@ func TestAccAWSWafGeoMatchSet_basic(t *testing.T) { { Config: testAccAWSWafGeoMatchSetConfig(geoMatchSet), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafGeoMatchSetExists("aws_waf_geo_match_set.geo_match_set", &v), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "name", geoMatchSet), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.#", "2"), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.384465307.type", "Country"), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.384465307.value", "US"), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.1991628426.type", "Country"), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.1991628426.value", "CA"), + testAccCheckAWSWafGeoMatchSetExists(resourceName, &v), + testAccMatchResourceAttrGlobalARN(resourceName, "arn", "waf", regexp.MustCompile(`geomatchset/.+`)), + resource.TestCheckResourceAttr(resourceName, "name", geoMatchSet), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.#", "2"), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.384465307.type", "Country"), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.384465307.value", "US"), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.1991628426.type", "Country"), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.1991628426.value", "CA"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -47,6 +49,7 @@ func TestAccAWSWafGeoMatchSet_changeNameForceNew(t *testing.T) { var before, after waf.GeoMatchSet geoMatchSet := fmt.Sprintf("geoMatchSet-%s", acctest.RandString(5)) geoMatchSetNewName := fmt.Sprintf("geoMatchSetNewName-%s", acctest.RandString(5)) + resourceName := "aws_waf_geo_match_set.geo_match_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -56,23 +59,24 @@ func TestAccAWSWafGeoMatchSet_changeNameForceNew(t *testing.T) { { Config: testAccAWSWafGeoMatchSetConfig(geoMatchSet), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafGeoMatchSetExists("aws_waf_geo_match_set.geo_match_set", &before), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "name", geoMatchSet), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.#", "2"), + testAccCheckAWSWafGeoMatchSetExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "name", geoMatchSet), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.#", "2"), ), }, { Config: testAccAWSWafGeoMatchSetConfigChangeName(geoMatchSetNewName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafGeoMatchSetExists("aws_waf_geo_match_set.geo_match_set", &after), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "name", geoMatchSetNewName), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.#", "2"), + testAccCheckAWSWafGeoMatchSetExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", geoMatchSetNewName), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.#", "2"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -80,6 +84,7 @@ func TestAccAWSWafGeoMatchSet_changeNameForceNew(t *testing.T) { func TestAccAWSWafGeoMatchSet_disappears(t *testing.T) { var v waf.GeoMatchSet geoMatchSet := fmt.Sprintf("geoMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_geo_match_set.geo_match_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -89,7 +94,7 @@ func TestAccAWSWafGeoMatchSet_disappears(t *testing.T) { { Config: testAccAWSWafGeoMatchSetConfig(geoMatchSet), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafGeoMatchSetExists("aws_waf_geo_match_set.geo_match_set", &v), + testAccCheckAWSWafGeoMatchSetExists(resourceName, &v), testAccCheckAWSWafGeoMatchSetDisappears(&v), ), ExpectNonEmptyPlan: true, @@ -101,6 +106,7 @@ func TestAccAWSWafGeoMatchSet_disappears(t *testing.T) { func TestAccAWSWafGeoMatchSet_changeConstraints(t *testing.T) { var before, after waf.GeoMatchSet setName := fmt.Sprintf("geoMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_geo_match_set.geo_match_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -110,39 +116,32 @@ func TestAccAWSWafGeoMatchSet_changeConstraints(t *testing.T) { { Config: testAccAWSWafGeoMatchSetConfig(setName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafGeoMatchSetExists("aws_waf_geo_match_set.geo_match_set", &before), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "name", setName), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.#", "2"), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.384465307.type", "Country"), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.384465307.value", "US"), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.1991628426.type", "Country"), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.1991628426.value", "CA"), + testAccCheckAWSWafGeoMatchSetExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "name", setName), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.#", "2"), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.384465307.type", "Country"), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.384465307.value", "US"), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.1991628426.type", "Country"), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.1991628426.value", "CA"), ), }, { Config: testAccAWSWafGeoMatchSetConfig_changeConstraints(setName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafGeoMatchSetExists("aws_waf_geo_match_set.geo_match_set", &after), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "name", setName), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.#", "2"), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.1174390936.type", "Country"), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.1174390936.value", "RU"), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.4046309957.type", "Country"), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.4046309957.value", "CN"), + testAccCheckAWSWafGeoMatchSetExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", setName), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.#", "2"), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.1174390936.type", "Country"), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.1174390936.value", "RU"), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.4046309957.type", "Country"), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.4046309957.value", "CN"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -150,6 +149,7 @@ func TestAccAWSWafGeoMatchSet_changeConstraints(t *testing.T) { func TestAccAWSWafGeoMatchSet_noConstraints(t *testing.T) { var ipset waf.GeoMatchSet setName := fmt.Sprintf("geoMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_geo_match_set.geo_match_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -159,13 +159,16 @@ func TestAccAWSWafGeoMatchSet_noConstraints(t *testing.T) { { Config: testAccAWSWafGeoMatchSetConfig_noConstraints(setName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafGeoMatchSetExists("aws_waf_geo_match_set.geo_match_set", &ipset), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "name", setName), - resource.TestCheckResourceAttr( - "aws_waf_geo_match_set.geo_match_set", "geo_match_constraint.#", "0"), + testAccCheckAWSWafGeoMatchSetExists(resourceName, &ipset), + resource.TestCheckResourceAttr(resourceName, "name", setName), + resource.TestCheckResourceAttr(resourceName, "geo_match_constraint.#", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -259,7 +262,7 @@ func testAccCheckAWSWafGeoMatchSetDestroy(s *terraform.State) error { } // Return nil if the GeoMatchSet is already destroyed - if isAWSErr(err, "WAFNonexistentItemException", "") { + if isAWSErr(err, waf.ErrCodeNonexistentItemException, "") { return nil } diff --git a/aws/resource_aws_waf_rate_based_rule.go b/aws/resource_aws_waf_rate_based_rule.go index 4f7c7271002..1f52bf092aa 100644 --- a/aws/resource_aws_waf_rate_based_rule.go +++ b/aws/resource_aws_waf_rate_based_rule.go @@ -5,10 +5,12 @@ import ( "log" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsWafRateBasedRule() *schema.Resource { @@ -17,6 +19,9 @@ func resourceAwsWafRateBasedRule() *schema.Resource { Read: resourceAwsWafRateBasedRuleRead, Update: resourceAwsWafRateBasedRuleUpdate, Delete: resourceAwsWafRateBasedRuleDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "name": { @@ -61,12 +66,18 @@ func resourceAwsWafRateBasedRule() *schema.Resource { Required: true, ValidateFunc: validation.IntAtLeast(100), }, + "tags": tagsSchema(), + "arn": { + Type: schema.TypeString, + Computed: true, + }, }, } } func resourceAwsWafRateBasedRuleCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).wafconn + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().WafTags() wr := newWafRetryer(conn) out, err := wr.RetryWithToken(func(token *string) (interface{}, error) { @@ -78,6 +89,10 @@ func resourceAwsWafRateBasedRuleCreate(d *schema.ResourceData, meta interface{}) RateLimit: aws.Int64(int64(d.Get("rate_limit").(int))), } + if len(tags) > 0 { + params.Tags = tags + } + return conn.CreateRateBasedRule(params) }) if err != nil { @@ -85,7 +100,17 @@ func resourceAwsWafRateBasedRuleCreate(d *schema.ResourceData, meta interface{}) } resp := out.(*waf.CreateRateBasedRuleOutput) d.SetId(*resp.Rule.RuleId) - return resourceAwsWafRateBasedRuleUpdate(d, meta) + + newPredicates := d.Get("predicates").(*schema.Set).List() + if len(newPredicates) > 0 { + noPredicates := []interface{}{} + err := updateWafRateBasedRuleResource(*resp.Rule.RuleId, noPredicates, newPredicates, d.Get("rate_limit"), conn) + if err != nil { + return fmt.Errorf("Error Updating WAF Rate Based Rule: %s", err) + } + } + + return resourceAwsWafRateBasedRuleRead(d, meta) } func resourceAwsWafRateBasedRuleRead(d *schema.ResourceData, meta interface{}) error { @@ -97,7 +122,7 @@ func resourceAwsWafRateBasedRuleRead(d *schema.ResourceData, meta interface{}) e resp, err := conn.GetRateBasedRule(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "WAFNonexistentItemException" { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == waf.ErrCodeNonexistentItemException { log.Printf("[WARN] WAF Rate Based Rule (%s) not found, removing from state", d.Id()) d.SetId("") return nil @@ -117,6 +142,22 @@ func resourceAwsWafRateBasedRuleRead(d *schema.ResourceData, meta interface{}) e predicates = append(predicates, predicate) } + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "waf", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("ratebasedrule/%s", d.Id()), + }.String() + d.Set("arn", arn) + + tagList, err := keyvaluetags.WafListTags(conn, arn) + if err != nil { + return fmt.Errorf("Failed to get WAF Rated Based Rule parameter tags for %s: %s", d.Get("name"), err) + } + if err := d.Set("tags", tagList.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + d.Set("predicates", predicates) d.Set("name", resp.Rule.Name) d.Set("metric_name", resp.Rule.MetricName) @@ -140,6 +181,14 @@ func resourceAwsWafRateBasedRuleUpdate(d *schema.ResourceData, meta interface{}) } } + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.WafUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + return resourceAwsWafRateBasedRuleRead(d, meta) } diff --git a/aws/resource_aws_waf_rate_based_rule_test.go b/aws/resource_aws_waf_rate_based_rule_test.go index a3de398590a..226bb5aa14f 100644 --- a/aws/resource_aws_waf_rate_based_rule_test.go +++ b/aws/resource_aws_waf_rate_based_rule_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "regexp" "testing" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" @@ -17,6 +18,8 @@ import ( func TestAccAWSWafRateBasedRule_basic(t *testing.T) { var v waf.RateBasedRule wafRuleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) + resourceName := "aws_waf_rate_based_rule.wafrule" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, Providers: testAccProviders, @@ -25,15 +28,18 @@ func TestAccAWSWafRateBasedRule_basic(t *testing.T) { { Config: testAccAWSWafRateBasedRuleConfig(wafRuleName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRateBasedRuleExists("aws_waf_rate_based_rule.wafrule", &v), - resource.TestCheckResourceAttr( - "aws_waf_rate_based_rule.wafrule", "name", wafRuleName), - resource.TestCheckResourceAttr( - "aws_waf_rate_based_rule.wafrule", "predicates.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_rate_based_rule.wafrule", "metric_name", wafRuleName), + testAccCheckAWSWafRateBasedRuleExists(resourceName, &v), + testAccMatchResourceAttrGlobalARN(resourceName, "arn", "waf", regexp.MustCompile(`ratebasedrule/.+`)), + resource.TestCheckResourceAttr(resourceName, "name", wafRuleName), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafRuleName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -42,6 +48,7 @@ func TestAccAWSWafRateBasedRule_changeNameForceNew(t *testing.T) { var before, after waf.RateBasedRule wafRuleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) wafRuleNewName := fmt.Sprintf("wafrulenew%s", acctest.RandString(5)) + resourceName := "aws_waf_rate_based_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -51,27 +58,26 @@ func TestAccAWSWafRateBasedRule_changeNameForceNew(t *testing.T) { { Config: testAccAWSWafRateBasedRuleConfig(wafRuleName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRateBasedRuleExists("aws_waf_rate_based_rule.wafrule", &before), - resource.TestCheckResourceAttr( - "aws_waf_rate_based_rule.wafrule", "name", wafRuleName), - resource.TestCheckResourceAttr( - "aws_waf_rate_based_rule.wafrule", "predicates.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_rate_based_rule.wafrule", "metric_name", wafRuleName), + testAccCheckAWSWafRateBasedRuleExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "name", wafRuleName), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafRuleName), ), }, { Config: testAccAWSWafRateBasedRuleConfigChangeName(wafRuleNewName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRateBasedRuleExists("aws_waf_rate_based_rule.wafrule", &after), - resource.TestCheckResourceAttr( - "aws_waf_rate_based_rule.wafrule", "name", wafRuleNewName), - resource.TestCheckResourceAttr( - "aws_waf_rate_based_rule.wafrule", "predicates.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_rate_based_rule.wafrule", "metric_name", wafRuleNewName), + testAccCheckAWSWafRateBasedRuleExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", wafRuleNewName), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafRuleNewName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -79,6 +85,8 @@ func TestAccAWSWafRateBasedRule_changeNameForceNew(t *testing.T) { func TestAccAWSWafRateBasedRule_disappears(t *testing.T) { var v waf.RateBasedRule wafRuleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) + resourceName := "aws_waf_rate_based_rule.wafrule" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, Providers: testAccProviders, @@ -87,7 +95,7 @@ func TestAccAWSWafRateBasedRule_disappears(t *testing.T) { { Config: testAccAWSWafRateBasedRuleConfig(wafRuleName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRateBasedRuleExists("aws_waf_rate_based_rule.wafrule", &v), + testAccCheckAWSWafRateBasedRuleExists(resourceName, &v), testAccCheckAWSWafRateBasedRuleDisappears(&v), ), ExpectNonEmptyPlan: true, @@ -103,6 +111,7 @@ func TestAccAWSWafRateBasedRule_changePredicates(t *testing.T) { var before, after waf.RateBasedRule var idx int ruleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) + resourceName := "aws_waf_rate_based_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -113,26 +122,31 @@ func TestAccAWSWafRateBasedRule_changePredicates(t *testing.T) { Config: testAccAWSWafRateBasedRuleConfig(ruleName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSWafIPSetExists("aws_waf_ipset.ipset", &ipset), - testAccCheckAWSWafRateBasedRuleExists("aws_waf_rate_based_rule.wafrule", &before), - resource.TestCheckResourceAttr("aws_waf_rate_based_rule.wafrule", "name", ruleName), - resource.TestCheckResourceAttr("aws_waf_rate_based_rule.wafrule", "predicates.#", "1"), + testAccCheckAWSWafRateBasedRuleExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "name", ruleName), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), computeWafRateBasedRulePredicateWithIpSet(&ipset, false, "IPMatch", &idx), - testCheckResourceAttrWithIndexesAddr("aws_waf_rate_based_rule.wafrule", "predicates.%d.negated", &idx, "false"), - testCheckResourceAttrWithIndexesAddr("aws_waf_rate_based_rule.wafrule", "predicates.%d.type", &idx, "IPMatch"), + testCheckResourceAttrWithIndexesAddr(resourceName, "predicates.%d.negated", &idx, "false"), + testCheckResourceAttrWithIndexesAddr(resourceName, "predicates.%d.type", &idx, "IPMatch"), ), }, { Config: testAccAWSWafRateBasedRuleConfig_changePredicates(ruleName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSWafByteMatchSetExists("aws_waf_byte_match_set.set", &byteMatchSet), - testAccCheckAWSWafRateBasedRuleExists("aws_waf_rate_based_rule.wafrule", &after), - resource.TestCheckResourceAttr("aws_waf_rate_based_rule.wafrule", "name", ruleName), - resource.TestCheckResourceAttr("aws_waf_rate_based_rule.wafrule", "predicates.#", "1"), + testAccCheckAWSWafRateBasedRuleExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", ruleName), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), computeWafRateBasedRulePredicateWithByteMatchSet(&byteMatchSet, true, "ByteMatch", &idx), - testCheckResourceAttrWithIndexesAddr("aws_waf_rate_based_rule.wafrule", "predicates.%d.negated", &idx, "true"), - testCheckResourceAttrWithIndexesAddr("aws_waf_rate_based_rule.wafrule", "predicates.%d.type", &idx, "ByteMatch"), + testCheckResourceAttrWithIndexesAddr(resourceName, "predicates.%d.negated", &idx, "true"), + testCheckResourceAttrWithIndexesAddr(resourceName, "predicates.%d.type", &idx, "ByteMatch"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -178,6 +192,7 @@ func computeWafRateBasedRulePredicateWithByteMatchSet(set *waf.ByteMatchSet, neg func TestAccAWSWafRateBasedRule_noPredicates(t *testing.T) { var rule waf.RateBasedRule ruleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) + resourceName := "aws_waf_rate_based_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -187,13 +202,64 @@ func TestAccAWSWafRateBasedRule_noPredicates(t *testing.T) { { Config: testAccAWSWafRateBasedRuleConfig_noPredicates(ruleName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafRateBasedRuleExists("aws_waf_rate_based_rule.wafrule", &rule), - resource.TestCheckResourceAttr( - "aws_waf_rate_based_rule.wafrule", "name", ruleName), - resource.TestCheckResourceAttr( - "aws_waf_rate_based_rule.wafrule", "predicates.#", "0"), + testAccCheckAWSWafRateBasedRuleExists(resourceName, &rule), + resource.TestCheckResourceAttr(resourceName, "name", ruleName), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func TestAccAWSWafRateBasedRule_Tags(t *testing.T) { + var rule waf.RateBasedRule + ruleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) + resourceName := "aws_waf_rate_based_rule.wafrule" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSWafRateBasedRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSWafRateBasedRuleConfigTags1(ruleName, "key1", "value1"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSWafRateBasedRuleExists(resourceName, &rule), + testAccMatchResourceAttrGlobalARN(resourceName, "arn", "waf", regexp.MustCompile(`ratebasedrule/.+`)), + resource.TestCheckResourceAttr(resourceName, "name", ruleName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + Config: testAccAWSWafRateBasedRuleConfigTags2(ruleName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSWafRateBasedRuleExists(resourceName, &rule), + resource.TestCheckResourceAttr(resourceName, "name", ruleName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSWafRateBasedRuleConfigTags1(ruleName, "key2", "value2"), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAWSWafRateBasedRuleExists(resourceName, &rule), + resource.TestCheckResourceAttr(resourceName, "name", ruleName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -262,7 +328,7 @@ func testAccCheckAWSWafRateBasedRuleDestroy(s *terraform.State) error { // Return nil if the Rule is already destroyed if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "WAFNonexistentItemException" { + if awsErr.Code() == waf.ErrCodeNonexistentItemException { return nil } } @@ -407,3 +473,34 @@ resource "aws_waf_rate_based_rule" "wafrule" { } `, name, name) } + +func testAccAWSWafRateBasedRuleConfigTags1(name, tag1Key, tag1Value string) string { + return fmt.Sprintf(` +resource "aws_waf_rate_based_rule" "wafrule" { + name = "%s" + metric_name = "%s" + rate_key = "IP" + rate_limit = 2000 + + tags = { + %q = %q + } +} +`, name, name, tag1Key, tag1Value) +} + +func testAccAWSWafRateBasedRuleConfigTags2(name, tag1Key, tag1Value, tag2Key, tag2Value string) string { + return fmt.Sprintf(` +resource "aws_waf_rate_based_rule" "wafrule" { + name = "%s" + metric_name = "%s" + rate_key = "IP" + rate_limit = 2000 + + tags = { + %q = %q + %q = %q + } +} +`, name, name, tag1Key, tag1Value, tag2Key, tag2Value) +} diff --git a/aws/resource_aws_waf_regex_match_set.go b/aws/resource_aws_waf_regex_match_set.go index 0806319f867..af8ef7ff054 100644 --- a/aws/resource_aws_waf_regex_match_set.go +++ b/aws/resource_aws_waf_regex_match_set.go @@ -6,6 +6,7 @@ import ( "strings" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -16,6 +17,9 @@ func resourceAwsWafRegexMatchSet() *schema.Resource { Read: resourceAwsWafRegexMatchSetRead, Update: resourceAwsWafRegexMatchSetUpdate, Delete: resourceAwsWafRegexMatchSetDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "name": { @@ -23,6 +27,10 @@ func resourceAwsWafRegexMatchSet() *schema.Resource { Required: true, ForceNew: true, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, "regex_match_tuple": { Type: schema.TypeSet, Optional: true, @@ -96,7 +104,7 @@ func resourceAwsWafRegexMatchSetRead(d *schema.ResourceData, meta interface{}) e resp, err := conn.GetRegexMatchSet(params) if err != nil { - if isAWSErr(err, "WAFNonexistentItemException", "") { + if isAWSErr(err, waf.ErrCodeNonexistentItemException, "") { log.Printf("[WARN] WAF Regex Match Set (%s) not found, removing from state", d.Id()) d.SetId("") return nil @@ -108,6 +116,14 @@ func resourceAwsWafRegexMatchSetRead(d *schema.ResourceData, meta interface{}) e d.Set("name", resp.RegexMatchSet.Name) d.Set("regex_match_tuple", flattenWafRegexMatchTuples(resp.RegexMatchSet.RegexMatchTuples)) + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "waf", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("regexmatchset/%s", d.Id()), + } + d.Set("arn", arn.String()) + return nil } diff --git a/aws/resource_aws_waf_regex_match_set_test.go b/aws/resource_aws_waf_regex_match_set_test.go index d4ecb252104..e5ccc50ae32 100644 --- a/aws/resource_aws_waf_regex_match_set_test.go +++ b/aws/resource_aws_waf_regex_match_set_test.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -99,6 +100,7 @@ func testAccAWSWafRegexMatchSet_basic(t *testing.T) { matchSetName := fmt.Sprintf("tfacc-%s", acctest.RandString(5)) patternSetName := fmt.Sprintf("tfacc-%s", acctest.RandString(5)) + resourceName := "aws_waf_regex_match_set.test" fieldToMatch := waf.FieldToMatch{ Data: aws.String("User-Agent"), @@ -113,17 +115,23 @@ func testAccAWSWafRegexMatchSet_basic(t *testing.T) { { Config: testAccAWSWafRegexMatchSetConfig(matchSetName, patternSetName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRegexMatchSetExists("aws_waf_regex_match_set.test", &matchSet), + testAccCheckAWSWafRegexMatchSetExists(resourceName, &matchSet), testAccCheckAWSWafRegexPatternSetExists("aws_waf_regex_pattern_set.test", &patternSet), + testAccMatchResourceAttrGlobalARN(resourceName, "arn", "waf", regexp.MustCompile(`regexmatchset/.+`)), computeWafRegexMatchSetTuple(&patternSet, &fieldToMatch, "NONE", &idx), - resource.TestCheckResourceAttr("aws_waf_regex_match_set.test", "name", matchSetName), - resource.TestCheckResourceAttr("aws_waf_regex_match_set.test", "regex_match_tuple.#", "1"), - testCheckResourceAttrWithIndexesAddr("aws_waf_regex_match_set.test", "regex_match_tuple.%d.field_to_match.#", &idx, "1"), - testCheckResourceAttrWithIndexesAddr("aws_waf_regex_match_set.test", "regex_match_tuple.%d.field_to_match.0.data", &idx, "user-agent"), - testCheckResourceAttrWithIndexesAddr("aws_waf_regex_match_set.test", "regex_match_tuple.%d.field_to_match.0.type", &idx, "HEADER"), - testCheckResourceAttrWithIndexesAddr("aws_waf_regex_match_set.test", "regex_match_tuple.%d.text_transformation", &idx, "NONE"), + resource.TestCheckResourceAttr(resourceName, "name", matchSetName), + resource.TestCheckResourceAttr(resourceName, "regex_match_tuple.#", "1"), + testCheckResourceAttrWithIndexesAddr(resourceName, "regex_match_tuple.%d.field_to_match.#", &idx, "1"), + testCheckResourceAttrWithIndexesAddr(resourceName, "regex_match_tuple.%d.field_to_match.0.data", &idx, "user-agent"), + testCheckResourceAttrWithIndexesAddr(resourceName, "regex_match_tuple.%d.field_to_match.0.type", &idx, "HEADER"), + testCheckResourceAttrWithIndexesAddr(resourceName, "regex_match_tuple.%d.text_transformation", &idx, "NONE"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -135,6 +143,7 @@ func testAccAWSWafRegexMatchSet_changePatterns(t *testing.T) { matchSetName := fmt.Sprintf("tfacc-%s", acctest.RandString(5)) patternSetName := fmt.Sprintf("tfacc-%s", acctest.RandString(5)) + resourceName := "aws_waf_regex_match_set.test" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -144,31 +153,36 @@ func testAccAWSWafRegexMatchSet_changePatterns(t *testing.T) { { Config: testAccAWSWafRegexMatchSetConfig(matchSetName, patternSetName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafRegexMatchSetExists("aws_waf_regex_match_set.test", &before), + testAccCheckAWSWafRegexMatchSetExists(resourceName, &before), testAccCheckAWSWafRegexPatternSetExists("aws_waf_regex_pattern_set.test", &patternSet), computeWafRegexMatchSetTuple(&patternSet, &waf.FieldToMatch{Data: aws.String("User-Agent"), Type: aws.String("HEADER")}, "NONE", &idx1), - resource.TestCheckResourceAttr("aws_waf_regex_match_set.test", "name", matchSetName), - resource.TestCheckResourceAttr("aws_waf_regex_match_set.test", "regex_match_tuple.#", "1"), - testCheckResourceAttrWithIndexesAddr("aws_waf_regex_match_set.test", "regex_match_tuple.%d.field_to_match.#", &idx1, "1"), - testCheckResourceAttrWithIndexesAddr("aws_waf_regex_match_set.test", "regex_match_tuple.%d.field_to_match.0.data", &idx1, "user-agent"), - testCheckResourceAttrWithIndexesAddr("aws_waf_regex_match_set.test", "regex_match_tuple.%d.field_to_match.0.type", &idx1, "HEADER"), - testCheckResourceAttrWithIndexesAddr("aws_waf_regex_match_set.test", "regex_match_tuple.%d.text_transformation", &idx1, "NONE"), + resource.TestCheckResourceAttr(resourceName, "name", matchSetName), + resource.TestCheckResourceAttr(resourceName, "regex_match_tuple.#", "1"), + testCheckResourceAttrWithIndexesAddr(resourceName, "regex_match_tuple.%d.field_to_match.#", &idx1, "1"), + testCheckResourceAttrWithIndexesAddr(resourceName, "regex_match_tuple.%d.field_to_match.0.data", &idx1, "user-agent"), + testCheckResourceAttrWithIndexesAddr(resourceName, "regex_match_tuple.%d.field_to_match.0.type", &idx1, "HEADER"), + testCheckResourceAttrWithIndexesAddr(resourceName, "regex_match_tuple.%d.text_transformation", &idx1, "NONE"), ), }, { Config: testAccAWSWafRegexMatchSetConfig_changePatterns(matchSetName, patternSetName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafRegexMatchSetExists("aws_waf_regex_match_set.test", &after), - resource.TestCheckResourceAttr("aws_waf_regex_match_set.test", "name", matchSetName), - resource.TestCheckResourceAttr("aws_waf_regex_match_set.test", "regex_match_tuple.#", "1"), + testAccCheckAWSWafRegexMatchSetExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", matchSetName), + resource.TestCheckResourceAttr(resourceName, "regex_match_tuple.#", "1"), computeWafRegexMatchSetTuple(&patternSet, &waf.FieldToMatch{Data: aws.String("Referer"), Type: aws.String("HEADER")}, "COMPRESS_WHITE_SPACE", &idx2), - testCheckResourceAttrWithIndexesAddr("aws_waf_regex_match_set.test", "regex_match_tuple.%d.field_to_match.#", &idx2, "1"), - testCheckResourceAttrWithIndexesAddr("aws_waf_regex_match_set.test", "regex_match_tuple.%d.field_to_match.0.data", &idx2, "referer"), - testCheckResourceAttrWithIndexesAddr("aws_waf_regex_match_set.test", "regex_match_tuple.%d.field_to_match.0.type", &idx2, "HEADER"), - testCheckResourceAttrWithIndexesAddr("aws_waf_regex_match_set.test", "regex_match_tuple.%d.text_transformation", &idx2, "COMPRESS_WHITE_SPACE"), + testCheckResourceAttrWithIndexesAddr(resourceName, "regex_match_tuple.%d.field_to_match.#", &idx2, "1"), + testCheckResourceAttrWithIndexesAddr(resourceName, "regex_match_tuple.%d.field_to_match.0.data", &idx2, "referer"), + testCheckResourceAttrWithIndexesAddr(resourceName, "regex_match_tuple.%d.field_to_match.0.type", &idx2, "HEADER"), + testCheckResourceAttrWithIndexesAddr(resourceName, "regex_match_tuple.%d.text_transformation", &idx2, "COMPRESS_WHITE_SPACE"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -176,6 +190,7 @@ func testAccAWSWafRegexMatchSet_changePatterns(t *testing.T) { func testAccAWSWafRegexMatchSet_noPatterns(t *testing.T) { var matchSet waf.RegexMatchSet matchSetName := fmt.Sprintf("tfacc-%s", acctest.RandString(5)) + resourceName := "aws_waf_regex_match_set.test" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -185,11 +200,16 @@ func testAccAWSWafRegexMatchSet_noPatterns(t *testing.T) { { Config: testAccAWSWafRegexMatchSetConfig_noPatterns(matchSetName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafRegexMatchSetExists("aws_waf_regex_match_set.test", &matchSet), - resource.TestCheckResourceAttr("aws_waf_regex_match_set.test", "name", matchSetName), - resource.TestCheckResourceAttr("aws_waf_regex_match_set.test", "regex_match_tuple.#", "0"), + testAccCheckAWSWafRegexMatchSetExists(resourceName, &matchSet), + resource.TestCheckResourceAttr(resourceName, "name", matchSetName), + resource.TestCheckResourceAttr(resourceName, "regex_match_tuple.#", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -198,6 +218,7 @@ func testAccAWSWafRegexMatchSet_disappears(t *testing.T) { var matchSet waf.RegexMatchSet matchSetName := fmt.Sprintf("tfacc-%s", acctest.RandString(5)) patternSetName := fmt.Sprintf("tfacc-%s", acctest.RandString(5)) + resourceName := "aws_waf_regex_match_set.test" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -207,7 +228,7 @@ func testAccAWSWafRegexMatchSet_disappears(t *testing.T) { { Config: testAccAWSWafRegexMatchSetConfig(matchSetName, patternSetName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRegexMatchSetExists("aws_waf_regex_match_set.test", &matchSet), + testAccCheckAWSWafRegexMatchSetExists(resourceName, &matchSet), testAccCheckAWSWafRegexMatchSetDisappears(&matchSet), ), ExpectNonEmptyPlan: true, @@ -316,7 +337,7 @@ func testAccCheckAWSWafRegexMatchSetDestroy(s *terraform.State) error { } // Return nil if the Regex Pattern Set is already destroyed - if isAWSErr(err, "WAFNonexistentItemException", "") { + if isAWSErr(err, waf.ErrCodeNonexistentItemException, "") { return nil } diff --git a/aws/resource_aws_waf_regex_pattern_set.go b/aws/resource_aws_waf_regex_pattern_set.go index e7e247eaccf..0767255f221 100644 --- a/aws/resource_aws_waf_regex_pattern_set.go +++ b/aws/resource_aws_waf_regex_pattern_set.go @@ -5,6 +5,7 @@ import ( "log" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) @@ -15,6 +16,9 @@ func resourceAwsWafRegexPatternSet() *schema.Resource { Read: resourceAwsWafRegexPatternSetRead, Update: resourceAwsWafRegexPatternSetUpdate, Delete: resourceAwsWafRegexPatternSetDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "name": { @@ -22,6 +26,10 @@ func resourceAwsWafRegexPatternSet() *schema.Resource { Required: true, ForceNew: true, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, "regex_pattern_strings": { Type: schema.TypeSet, Optional: true, @@ -63,9 +71,7 @@ func resourceAwsWafRegexPatternSetRead(d *schema.ResourceData, meta interface{}) resp, err := conn.GetRegexPatternSet(params) if err != nil { - // TODO: Replace with a constant once available - // See https://github.com/aws/aws-sdk-go/issues/1856 - if isAWSErr(err, "WAFNonexistentItemException", "") { + if isAWSErr(err, waf.ErrCodeNonexistentItemException, "") { log.Printf("[WARN] WAF Regex Pattern Set (%s) not found, removing from state", d.Id()) d.SetId("") return nil @@ -77,6 +83,14 @@ func resourceAwsWafRegexPatternSetRead(d *schema.ResourceData, meta interface{}) d.Set("name", resp.RegexPatternSet.Name) d.Set("regex_pattern_strings", aws.StringValueSlice(resp.RegexPatternSet.RegexPatternStrings)) + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "waf", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("regexpatternset/%s", d.Id()), + } + d.Set("arn", arn.String()) + return nil } diff --git a/aws/resource_aws_waf_regex_pattern_set_test.go b/aws/resource_aws_waf_regex_pattern_set_test.go index 8be45a0332d..d8214b62c56 100644 --- a/aws/resource_aws_waf_regex_pattern_set_test.go +++ b/aws/resource_aws_waf_regex_pattern_set_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -32,6 +33,7 @@ func TestAccAWSWafRegexPatternSet(t *testing.T) { func testAccAWSWafRegexPatternSet_basic(t *testing.T) { var v waf.RegexPatternSet patternSetName := fmt.Sprintf("tfacc-%s", acctest.RandString(5)) + resourceName := "aws_waf_regex_pattern_set.test" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -41,13 +43,19 @@ func testAccAWSWafRegexPatternSet_basic(t *testing.T) { { Config: testAccAWSWafRegexPatternSetConfig(patternSetName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRegexPatternSetExists("aws_waf_regex_pattern_set.test", &v), - resource.TestCheckResourceAttr("aws_waf_regex_pattern_set.test", "name", patternSetName), - resource.TestCheckResourceAttr("aws_waf_regex_pattern_set.test", "regex_pattern_strings.#", "2"), - resource.TestCheckResourceAttr("aws_waf_regex_pattern_set.test", "regex_pattern_strings.2848565413", "one"), - resource.TestCheckResourceAttr("aws_waf_regex_pattern_set.test", "regex_pattern_strings.3351840846", "two"), + testAccCheckAWSWafRegexPatternSetExists(resourceName, &v), + testAccMatchResourceAttrGlobalARN(resourceName, "arn", "waf", regexp.MustCompile(`regexpatternset/.+`)), + resource.TestCheckResourceAttr(resourceName, "name", patternSetName), + resource.TestCheckResourceAttr(resourceName, "regex_pattern_strings.#", "2"), + resource.TestCheckResourceAttr(resourceName, "regex_pattern_strings.2848565413", "one"), + resource.TestCheckResourceAttr(resourceName, "regex_pattern_strings.3351840846", "two"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -55,6 +63,7 @@ func testAccAWSWafRegexPatternSet_basic(t *testing.T) { func testAccAWSWafRegexPatternSet_changePatterns(t *testing.T) { var before, after waf.RegexPatternSet patternSetName := fmt.Sprintf("tfacc-%s", acctest.RandString(5)) + resourceName := "aws_waf_regex_pattern_set.test" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -64,24 +73,29 @@ func testAccAWSWafRegexPatternSet_changePatterns(t *testing.T) { { Config: testAccAWSWafRegexPatternSetConfig(patternSetName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafRegexPatternSetExists("aws_waf_regex_pattern_set.test", &before), - resource.TestCheckResourceAttr("aws_waf_regex_pattern_set.test", "name", patternSetName), - resource.TestCheckResourceAttr("aws_waf_regex_pattern_set.test", "regex_pattern_strings.#", "2"), - resource.TestCheckResourceAttr("aws_waf_regex_pattern_set.test", "regex_pattern_strings.2848565413", "one"), - resource.TestCheckResourceAttr("aws_waf_regex_pattern_set.test", "regex_pattern_strings.3351840846", "two"), + testAccCheckAWSWafRegexPatternSetExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "name", patternSetName), + resource.TestCheckResourceAttr(resourceName, "regex_pattern_strings.#", "2"), + resource.TestCheckResourceAttr(resourceName, "regex_pattern_strings.2848565413", "one"), + resource.TestCheckResourceAttr(resourceName, "regex_pattern_strings.3351840846", "two"), ), }, { Config: testAccAWSWafRegexPatternSetConfig_changePatterns(patternSetName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafRegexPatternSetExists("aws_waf_regex_pattern_set.test", &after), - resource.TestCheckResourceAttr("aws_waf_regex_pattern_set.test", "name", patternSetName), - resource.TestCheckResourceAttr("aws_waf_regex_pattern_set.test", "regex_pattern_strings.#", "3"), - resource.TestCheckResourceAttr("aws_waf_regex_pattern_set.test", "regex_pattern_strings.3351840846", "two"), - resource.TestCheckResourceAttr("aws_waf_regex_pattern_set.test", "regex_pattern_strings.2929247714", "three"), - resource.TestCheckResourceAttr("aws_waf_regex_pattern_set.test", "regex_pattern_strings.1294846542", "four"), + testAccCheckAWSWafRegexPatternSetExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", patternSetName), + resource.TestCheckResourceAttr(resourceName, "regex_pattern_strings.#", "3"), + resource.TestCheckResourceAttr(resourceName, "regex_pattern_strings.3351840846", "two"), + resource.TestCheckResourceAttr(resourceName, "regex_pattern_strings.2929247714", "three"), + resource.TestCheckResourceAttr(resourceName, "regex_pattern_strings.1294846542", "four"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -89,6 +103,7 @@ func testAccAWSWafRegexPatternSet_changePatterns(t *testing.T) { func testAccAWSWafRegexPatternSet_noPatterns(t *testing.T) { var patternSet waf.RegexPatternSet patternSetName := fmt.Sprintf("tfacc-%s", acctest.RandString(5)) + resourceName := "aws_waf_regex_pattern_set.test" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -98,11 +113,16 @@ func testAccAWSWafRegexPatternSet_noPatterns(t *testing.T) { { Config: testAccAWSWafRegexPatternSetConfig_noPatterns(patternSetName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafRegexPatternSetExists("aws_waf_regex_pattern_set.test", &patternSet), - resource.TestCheckResourceAttr("aws_waf_regex_pattern_set.test", "name", patternSetName), - resource.TestCheckResourceAttr("aws_waf_regex_pattern_set.test", "regex_pattern_strings.#", "0"), + testAccCheckAWSWafRegexPatternSetExists(resourceName, &patternSet), + resource.TestCheckResourceAttr(resourceName, "name", patternSetName), + resource.TestCheckResourceAttr(resourceName, "regex_pattern_strings.#", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -110,6 +130,7 @@ func testAccAWSWafRegexPatternSet_noPatterns(t *testing.T) { func testAccAWSWafRegexPatternSet_disappears(t *testing.T) { var v waf.RegexPatternSet patternSetName := fmt.Sprintf("tfacc-%s", acctest.RandString(5)) + resourceName := "aws_waf_regex_pattern_set.test" resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -119,7 +140,7 @@ func testAccAWSWafRegexPatternSet_disappears(t *testing.T) { { Config: testAccAWSWafRegexPatternSetConfig(patternSetName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRegexPatternSetExists("aws_waf_regex_pattern_set.test", &v), + testAccCheckAWSWafRegexPatternSetExists(resourceName, &v), testAccCheckAWSWafRegexPatternSetDisappears(&v), ), ExpectNonEmptyPlan: true, @@ -215,7 +236,7 @@ func testAccCheckAWSWafRegexPatternSetDestroy(s *terraform.State) error { } // Return nil if the Regex Pattern Set is already destroyed - if isAWSErr(err, "WAFNonexistentItemException", "") { + if isAWSErr(err, waf.ErrCodeNonexistentItemException, "") { return nil } diff --git a/aws/resource_aws_waf_rule.go b/aws/resource_aws_waf_rule.go index 69a8ef62637..82d8821da02 100644 --- a/aws/resource_aws_waf_rule.go +++ b/aws/resource_aws_waf_rule.go @@ -5,10 +5,12 @@ import ( "log" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsWafRule() *schema.Resource { @@ -55,12 +57,18 @@ func resourceAwsWafRule() *schema.Resource { }, }, }, + "tags": tagsSchema(), + "arn": { + Type: schema.TypeString, + Computed: true, + }, }, } } func resourceAwsWafRuleCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).wafconn + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().WafTags() wr := newWafRetryer(conn) out, err := wr.RetryWithToken(func(token *string) (interface{}, error) { @@ -70,6 +78,10 @@ func resourceAwsWafRuleCreate(d *schema.ResourceData, meta interface{}) error { Name: aws.String(d.Get("name").(string)), } + if len(tags) > 0 { + params.Tags = tags + } + return conn.CreateRule(params) }) if err != nil { @@ -77,7 +89,17 @@ func resourceAwsWafRuleCreate(d *schema.ResourceData, meta interface{}) error { } resp := out.(*waf.CreateRuleOutput) d.SetId(*resp.Rule.RuleId) - return resourceAwsWafRuleUpdate(d, meta) + + newPredicates := d.Get("predicates").(*schema.Set).List() + if len(newPredicates) > 0 { + noPredicates := []interface{}{} + err := updateWafRuleResource(d.Id(), noPredicates, newPredicates, conn) + if err != nil { + return fmt.Errorf("Error Updating WAF Rule: %s", err) + } + } + + return resourceAwsWafRuleRead(d, meta) } func resourceAwsWafRuleRead(d *schema.ResourceData, meta interface{}) error { @@ -89,7 +111,7 @@ func resourceAwsWafRuleRead(d *schema.ResourceData, meta interface{}) error { resp, err := conn.GetRule(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "WAFNonexistentItemException" { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == waf.ErrCodeNonexistentItemException { log.Printf("[WARN] WAF Rule (%s) not found, removing from state", d.Id()) d.SetId("") return nil @@ -109,6 +131,24 @@ func resourceAwsWafRuleRead(d *schema.ResourceData, meta interface{}) error { predicates = append(predicates, predicate) } + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "waf", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("rule/%s", d.Id()), + }.String() + d.Set("arn", arn) + + tags, err := keyvaluetags.WafListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for WAF Rule (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + d.Set("predicates", predicates) d.Set("name", resp.Rule.Name) d.Set("metric_name", resp.Rule.MetricName) @@ -129,6 +169,14 @@ func resourceAwsWafRuleUpdate(d *schema.ResourceData, meta interface{}) error { } } + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.WafUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + return resourceAwsWafRuleRead(d, meta) } diff --git a/aws/resource_aws_waf_rule_group.go b/aws/resource_aws_waf_rule_group.go index 8fdd0406a34..3b2ac9aebde 100644 --- a/aws/resource_aws_waf_rule_group.go +++ b/aws/resource_aws_waf_rule_group.go @@ -5,8 +5,10 @@ import ( "log" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsWafRuleGroup() *schema.Resource { @@ -65,12 +67,18 @@ func resourceAwsWafRuleGroup() *schema.Resource { }, }, }, + "tags": tagsSchema(), + "arn": { + Type: schema.TypeString, + Computed: true, + }, }, } } func resourceAwsWafRuleGroupCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).wafconn + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().WafTags() wr := newWafRetryer(conn) out, err := wr.RetryWithToken(func(token *string) (interface{}, error) { @@ -80,6 +88,10 @@ func resourceAwsWafRuleGroupCreate(d *schema.ResourceData, meta interface{}) err Name: aws.String(d.Get("name").(string)), } + if len(tags) > 0 { + params.Tags = tags + } + return conn.CreateRuleGroup(params) }) if err != nil { @@ -87,7 +99,18 @@ func resourceAwsWafRuleGroupCreate(d *schema.ResourceData, meta interface{}) err } resp := out.(*waf.CreateRuleGroupOutput) d.SetId(*resp.RuleGroup.RuleGroupId) - return resourceAwsWafRuleGroupUpdate(d, meta) + + activatedRules := d.Get("activated_rule").(*schema.Set).List() + if len(activatedRules) > 0 { + noActivatedRules := []interface{}{} + + err := updateWafRuleGroupResource(d.Id(), noActivatedRules, activatedRules, conn) + if err != nil { + return fmt.Errorf("Error Updating WAF Rule Group: %s", err) + } + } + + return resourceAwsWafRuleGroupRead(d, meta) } func resourceAwsWafRuleGroupRead(d *schema.ResourceData, meta interface{}) error { @@ -99,7 +122,7 @@ func resourceAwsWafRuleGroupRead(d *schema.ResourceData, meta interface{}) error resp, err := conn.GetRuleGroup(params) if err != nil { - if isAWSErr(err, "WAFNonexistentItemException", "") { + if isAWSErr(err, waf.ErrCodeNonexistentItemException, "") { log.Printf("[WARN] WAF Rule Group (%s) not found, removing from state", d.Id()) d.SetId("") return nil @@ -115,6 +138,22 @@ func resourceAwsWafRuleGroupRead(d *schema.ResourceData, meta interface{}) error return fmt.Errorf("error listing activated rules in WAF Rule Group (%s): %s", d.Id(), err) } + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "waf", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("rulegroup/%s", d.Id()), + }.String() + d.Set("arn", arn) + + tags, err := keyvaluetags.WafListTags(conn, arn) + if err != nil { + return fmt.Errorf("error listing tags for WAF Rule Group (%s): %s", arn, err) + } + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + d.Set("activated_rule", flattenWafActivatedRules(rResp.ActivatedRules)) d.Set("name", resp.RuleGroup.Name) d.Set("metric_name", resp.RuleGroup.MetricName) @@ -135,6 +174,14 @@ func resourceAwsWafRuleGroupUpdate(d *schema.ResourceData, meta interface{}) err } } + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.WafUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + return resourceAwsWafRuleGroupRead(d, meta) } diff --git a/aws/resource_aws_waf_rule_group_test.go b/aws/resource_aws_waf_rule_group_test.go index 8b6d0024260..886b0dd9fd0 100644 --- a/aws/resource_aws_waf_rule_group_test.go +++ b/aws/resource_aws_waf_rule_group_test.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -88,6 +89,7 @@ func TestAccAWSWafRuleGroup_basic(t *testing.T) { testCheckResourceAttrWithIndexesAddr(resourceName, "activated_rule.%d.action.0.type", &idx, "COUNT"), testCheckResourceAttrWithIndexesAddr(resourceName, "activated_rule.%d.priority", &idx, "50"), testCheckResourceAttrWithIndexesAddr(resourceName, "activated_rule.%d.type", &idx, waf.WafRuleTypeRegular), + testAccMatchResourceAttrGlobalARN(resourceName, "arn", "waf", regexp.MustCompile(`rulegroup/.+`)), ), }, { @@ -250,6 +252,56 @@ func computeWafActivatedRuleWithRuleId(rule *waf.Rule, actionType string, priori } } +func TestAccAWSWafRuleGroup_Tags(t *testing.T) { + var group waf.RuleGroup + groupName := fmt.Sprintf("test%s", acctest.RandString(5)) + resourceName := "aws_waf_rule_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSWafWebAclDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSWafRuleGroupConfigTags1(groupName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRuleGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "name", groupName), + resource.TestCheckResourceAttr(resourceName, "activated_rule.#", "0"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + Config: testAccAWSWafRuleGroupConfigTags2(groupName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRuleGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "name", groupName), + resource.TestCheckResourceAttr(resourceName, "activated_rule.#", "0"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSWafRuleGroupConfigTags1(groupName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRuleGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "name", groupName), + resource.TestCheckResourceAttr(resourceName, "activated_rule.#", "0"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func TestAccAWSWafRuleGroup_noActivatedRules(t *testing.T) { var group waf.RuleGroup groupName := fmt.Sprintf("test%s", acctest.RandString(5)) @@ -264,10 +316,8 @@ func TestAccAWSWafRuleGroup_noActivatedRules(t *testing.T) { Config: testAccAWSWafRuleGroupConfig_noActivatedRules(groupName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSWafRuleGroupExists(resourceName, &group), - resource.TestCheckResourceAttr( - resourceName, "name", groupName), - resource.TestCheckResourceAttr( - resourceName, "activated_rule.#", "0"), + resource.TestCheckResourceAttr(resourceName, "name", groupName), + resource.TestCheckResourceAttr(resourceName, "activated_rule.#", "0"), ), }, }, @@ -337,7 +387,7 @@ func testAccCheckAWSWafRuleGroupDestroy(s *terraform.State) error { } } - if isAWSErr(err, "WAFNonexistentItemException", "") { + if isAWSErr(err, waf.ErrCodeNonexistentItemException, "") { return nil } @@ -458,3 +508,30 @@ resource "aws_waf_rule_group" "test" { } `, groupName) } + +func testAccAWSWafRuleGroupConfigTags1(gName, tag1Key, tag1Value string) string { + return fmt.Sprintf(` +resource "aws_waf_rule_group" "test" { + name = "%[1]s" + metric_name = "%[1]s" + + tags = { + %q = %q + } +} +`, gName, tag1Key, tag1Value) +} + +func testAccAWSWafRuleGroupConfigTags2(gName, tag1Key, tag1Value, tag2Key, tag2Value string) string { + return fmt.Sprintf(` +resource "aws_waf_rule_group" "test" { + name = "%[1]s" + metric_name = "%[1]s" + + tags = { + %q = %q + %q = %q + } +} +`, gName, tag1Key, tag1Value, tag2Key, tag2Value) +} diff --git a/aws/resource_aws_waf_rule_test.go b/aws/resource_aws_waf_rule_test.go index f541571bd14..afd7aacf476 100644 --- a/aws/resource_aws_waf_rule_test.go +++ b/aws/resource_aws_waf_rule_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "regexp" "testing" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" @@ -17,6 +18,7 @@ import ( func TestAccAWSWafRule_basic(t *testing.T) { var v waf.Rule wafRuleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) + resourceName := "aws_waf_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, Providers: testAccProviders, @@ -25,17 +27,15 @@ func TestAccAWSWafRule_basic(t *testing.T) { { Config: testAccAWSWafRuleConfig(wafRuleName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRuleExists("aws_waf_rule.wafrule", &v), - resource.TestCheckResourceAttr( - "aws_waf_rule.wafrule", "name", wafRuleName), - resource.TestCheckResourceAttr( - "aws_waf_rule.wafrule", "predicates.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_rule.wafrule", "metric_name", wafRuleName), + testAccCheckAWSWafRuleExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "name", wafRuleName), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafRuleName), + testAccMatchResourceAttrGlobalARN(resourceName, "arn", "waf", regexp.MustCompile(`rule/.+`)), ), }, { - ResourceName: "aws_waf_rule.wafrule", + ResourceName: resourceName, ImportState: true, ImportStateVerify: true, }, @@ -47,6 +47,7 @@ func TestAccAWSWafRule_changeNameForceNew(t *testing.T) { var before, after waf.Rule wafRuleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) wafRuleNewName := fmt.Sprintf("wafrulenew%s", acctest.RandString(5)) + resourceName := "aws_waf_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -56,25 +57,19 @@ func TestAccAWSWafRule_changeNameForceNew(t *testing.T) { { Config: testAccAWSWafRuleConfig(wafRuleName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRuleExists("aws_waf_rule.wafrule", &before), - resource.TestCheckResourceAttr( - "aws_waf_rule.wafrule", "name", wafRuleName), - resource.TestCheckResourceAttr( - "aws_waf_rule.wafrule", "predicates.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_rule.wafrule", "metric_name", wafRuleName), + testAccCheckAWSWafRuleExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "name", wafRuleName), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafRuleName), ), }, { Config: testAccAWSWafRuleConfigChangeName(wafRuleNewName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRuleExists("aws_waf_rule.wafrule", &after), - resource.TestCheckResourceAttr( - "aws_waf_rule.wafrule", "name", wafRuleNewName), - resource.TestCheckResourceAttr( - "aws_waf_rule.wafrule", "predicates.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_rule.wafrule", "metric_name", wafRuleNewName), + testAccCheckAWSWafRuleExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", wafRuleNewName), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafRuleNewName), ), }, }, @@ -84,6 +79,8 @@ func TestAccAWSWafRule_changeNameForceNew(t *testing.T) { func TestAccAWSWafRule_disappears(t *testing.T) { var v waf.Rule wafRuleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) + resourceName := "aws_waf_rule.wafrule" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, Providers: testAccProviders, @@ -92,7 +89,7 @@ func TestAccAWSWafRule_disappears(t *testing.T) { { Config: testAccAWSWafRuleConfig(wafRuleName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRuleExists("aws_waf_rule.wafrule", &v), + testAccCheckAWSWafRuleExists(resourceName, &v), testAccCheckAWSWafRuleDisappears(&v), ), ExpectNonEmptyPlan: true, @@ -108,6 +105,7 @@ func TestAccAWSWafRule_changePredicates(t *testing.T) { var before, after waf.Rule var idx int ruleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) + resourceName := "aws_waf_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -118,24 +116,24 @@ func TestAccAWSWafRule_changePredicates(t *testing.T) { Config: testAccAWSWafRuleConfig(ruleName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSWafIPSetExists("aws_waf_ipset.ipset", &ipset), - testAccCheckAWSWafRuleExists("aws_waf_rule.wafrule", &before), - resource.TestCheckResourceAttr("aws_waf_rule.wafrule", "name", ruleName), - resource.TestCheckResourceAttr("aws_waf_rule.wafrule", "predicates.#", "1"), + testAccCheckAWSWafRuleExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "name", ruleName), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), computeWafRulePredicateWithIpSet(&ipset, false, "IPMatch", &idx), - testCheckResourceAttrWithIndexesAddr("aws_waf_rule.wafrule", "predicates.%d.negated", &idx, "false"), - testCheckResourceAttrWithIndexesAddr("aws_waf_rule.wafrule", "predicates.%d.type", &idx, "IPMatch"), + testCheckResourceAttrWithIndexesAddr(resourceName, "predicates.%d.negated", &idx, "false"), + testCheckResourceAttrWithIndexesAddr(resourceName, "predicates.%d.type", &idx, "IPMatch"), ), }, { Config: testAccAWSWafRuleConfig_changePredicates(ruleName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSWafByteMatchSetExists("aws_waf_byte_match_set.set", &byteMatchSet), - testAccCheckAWSWafRuleExists("aws_waf_rule.wafrule", &after), - resource.TestCheckResourceAttr("aws_waf_rule.wafrule", "name", ruleName), - resource.TestCheckResourceAttr("aws_waf_rule.wafrule", "predicates.#", "1"), + testAccCheckAWSWafRuleExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", ruleName), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), computeWafRulePredicateWithByteMatchSet(&byteMatchSet, true, "ByteMatch", &idx), - testCheckResourceAttrWithIndexesAddr("aws_waf_rule.wafrule", "predicates.%d.negated", &idx, "true"), - testCheckResourceAttrWithIndexesAddr("aws_waf_rule.wafrule", "predicates.%d.type", &idx, "ByteMatch"), + testCheckResourceAttrWithIndexesAddr(resourceName, "predicates.%d.negated", &idx, "true"), + testCheckResourceAttrWithIndexesAddr(resourceName, "predicates.%d.type", &idx, "ByteMatch"), ), }, }, @@ -148,6 +146,7 @@ func TestAccAWSWafRule_geoMatchSetPredicate(t *testing.T) { var v waf.Rule var idx int ruleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) + resourceName := "aws_waf_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -158,12 +157,12 @@ func TestAccAWSWafRule_geoMatchSetPredicate(t *testing.T) { Config: testAccAWSWafRuleConfig_geoMatchSetPredicate(ruleName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSWafGeoMatchSetExists("aws_waf_geo_match_set.geo_match_set", &geoMatchSet), - testAccCheckAWSWafRuleExists("aws_waf_rule.wafrule", &v), - resource.TestCheckResourceAttr("aws_waf_rule.wafrule", "name", ruleName), - resource.TestCheckResourceAttr("aws_waf_rule.wafrule", "predicates.#", "1"), + testAccCheckAWSWafRuleExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "name", ruleName), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), computeWafRulePredicateWithGeoMatchSet(&geoMatchSet, true, "GeoMatch", &idx), - testCheckResourceAttrWithIndexesAddr("aws_waf_rule.wafrule", "predicates.%d.negated", &idx, "true"), - testCheckResourceAttrWithIndexesAddr("aws_waf_rule.wafrule", "predicates.%d.type", &idx, "GeoMatch"), + testCheckResourceAttrWithIndexesAddr(resourceName, "predicates.%d.negated", &idx, "true"), + testCheckResourceAttrWithIndexesAddr(resourceName, "predicates.%d.type", &idx, "GeoMatch"), ), }, }, @@ -236,6 +235,7 @@ func testCheckResourceAttrWithIndexesAddr(name, format string, idx *int, value s func TestAccAWSWafRule_noPredicates(t *testing.T) { var rule waf.Rule ruleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) + resourceName := "aws_waf_rule.wafrule" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -245,17 +245,68 @@ func TestAccAWSWafRule_noPredicates(t *testing.T) { { Config: testAccAWSWafRuleConfig_noPredicates(ruleName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafRuleExists("aws_waf_rule.wafrule", &rule), - resource.TestCheckResourceAttr( - "aws_waf_rule.wafrule", "name", ruleName), - resource.TestCheckResourceAttr( - "aws_waf_rule.wafrule", "predicates.#", "0"), + testAccCheckAWSWafRuleExists(resourceName, &rule), + resource.TestCheckResourceAttr(resourceName, "name", ruleName), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "0"), ), }, }, }) } +func TestAccAWSWafRule_Tags(t *testing.T) { + var rule waf.Rule + ruleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) + resourceName := "aws_waf_rule.wafrule" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSWafWebAclDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSWafRuleConfigTags1(ruleName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRuleExists(resourceName, &rule), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", ruleName), + resource.TestCheckResourceAttr(resourceName, "name", ruleName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + Config: testAccAWSWafRuleConfigTags2(ruleName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRuleExists(resourceName, &rule), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", ruleName), + resource.TestCheckResourceAttr(resourceName, "name", ruleName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSWafRuleConfigTags1(ruleName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRuleExists(resourceName, &rule), + resource.TestCheckResourceAttr(resourceName, "predicates.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", ruleName), + resource.TestCheckResourceAttr(resourceName, "name", ruleName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func testAccCheckAWSWafRuleDisappears(v *waf.Rule) resource.TestCheckFunc { return func(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).wafconn @@ -319,7 +370,7 @@ func testAccCheckAWSWafRuleDestroy(s *terraform.State) error { // Return nil if the Rule is already destroyed if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "WAFNonexistentItemException" { + if awsErr.Code() == waf.ErrCodeNonexistentItemException { return nil } } @@ -496,3 +547,62 @@ resource "aws_waf_rule" "wafrule" { } `, name, name, name) } + +func testAccAWSWafRuleConfigTags1(rName, tag1Key, tag1Value string) string { + return fmt.Sprintf(` +resource "aws_waf_ipset" "ipset" { + name = "%s" + + ip_set_descriptors { + type = "IPV4" + value = "192.0.7.0/24" + } +} + +resource "aws_waf_rule" "wafrule" { + depends_on = ["aws_waf_ipset.ipset"] + name = "%s" + metric_name = "%s" + + predicates { + data_id = "${aws_waf_ipset.ipset.id}" + negated = false + type = "IPMatch" + } + + tags = { + %q = %q + } +} +`, rName, rName, rName, tag1Key, tag1Value) +} + +func testAccAWSWafRuleConfigTags2(rName, tag1Key, tag1Value, tag2Key, tag2Value string) string { + return fmt.Sprintf(` +resource "aws_waf_ipset" "ipset" { + name = "%s" + + ip_set_descriptors { + type = "IPV4" + value = "192.0.7.0/24" + } +} + +resource "aws_waf_rule" "wafrule" { + depends_on = ["aws_waf_ipset.ipset"] + name = "%s" + metric_name = "%s" + + predicates { + data_id = "${aws_waf_ipset.ipset.id}" + negated = false + type = "IPMatch" + } + + tags = { + %q = %q + %q = %q + } +} +`, rName, rName, rName, tag1Key, tag1Value, tag2Key, tag2Value) +} diff --git a/aws/resource_aws_waf_size_constraint_set.go b/aws/resource_aws_waf_size_constraint_set.go index deb78c7a965..f14ee9ddb52 100644 --- a/aws/resource_aws_waf_size_constraint_set.go +++ b/aws/resource_aws_waf_size_constraint_set.go @@ -5,6 +5,7 @@ import ( "log" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" @@ -16,6 +17,9 @@ func resourceAwsWafSizeConstraintSet() *schema.Resource { Read: resourceAwsWafSizeConstraintSetRead, Update: resourceAwsWafSizeConstraintSetUpdate, Delete: resourceAwsWafSizeConstraintSetDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: wafSizeConstraintSetSchema(), } @@ -54,7 +58,7 @@ func resourceAwsWafSizeConstraintSetRead(d *schema.ResourceData, meta interface{ resp, err := conn.GetSizeConstraintSet(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "WAFNonexistentItemException" { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == waf.ErrCodeNonexistentItemException { log.Printf("[WARN] WAF SizeConstraintSet (%s) not found, removing from state", d.Id()) d.SetId("") return nil @@ -66,6 +70,14 @@ func resourceAwsWafSizeConstraintSetRead(d *schema.ResourceData, meta interface{ d.Set("name", resp.SizeConstraintSet.Name) d.Set("size_constraints", flattenWafSizeConstraints(resp.SizeConstraintSet.SizeConstraints)) + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "waf", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("sizeconstraintset/%s", d.Id()), + } + d.Set("arn", arn.String()) + return nil } diff --git a/aws/resource_aws_waf_size_constraint_set_test.go b/aws/resource_aws_waf_size_constraint_set_test.go index 374793a5185..a506cc44d87 100644 --- a/aws/resource_aws_waf_size_constraint_set_test.go +++ b/aws/resource_aws_waf_size_constraint_set_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "regexp" "testing" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" @@ -16,6 +17,7 @@ import ( func TestAccAWSWafSizeConstraintSet_basic(t *testing.T) { var v waf.SizeConstraintSet sizeConstraintSet := fmt.Sprintf("sizeConstraintSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_size_constraint_set.size_constraint_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -25,25 +27,23 @@ func TestAccAWSWafSizeConstraintSet_basic(t *testing.T) { { Config: testAccAWSWafSizeConstraintSetConfig(sizeConstraintSet), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafSizeConstraintSetExists("aws_waf_size_constraint_set.size_constraint_set", &v), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "name", sizeConstraintSet), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.2029852522.comparison_operator", "EQ"), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.2029852522.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.2029852522.field_to_match.281401076.data", ""), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.2029852522.field_to_match.281401076.type", "BODY"), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.2029852522.size", "4096"), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.2029852522.text_transformation", "NONE"), + testAccCheckAWSWafSizeConstraintSetExists(resourceName, &v), + testAccMatchResourceAttrGlobalARN(resourceName, "arn", "waf", regexp.MustCompile(`sizeconstraintset/.+`)), + resource.TestCheckResourceAttr(resourceName, "name", sizeConstraintSet), + resource.TestCheckResourceAttr(resourceName, "size_constraints.#", "1"), + resource.TestCheckResourceAttr(resourceName, "size_constraints.2029852522.comparison_operator", "EQ"), + resource.TestCheckResourceAttr(resourceName, "size_constraints.2029852522.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "size_constraints.2029852522.field_to_match.281401076.data", ""), + resource.TestCheckResourceAttr(resourceName, "size_constraints.2029852522.field_to_match.281401076.type", "BODY"), + resource.TestCheckResourceAttr(resourceName, "size_constraints.2029852522.size", "4096"), + resource.TestCheckResourceAttr(resourceName, "size_constraints.2029852522.text_transformation", "NONE"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -52,6 +52,7 @@ func TestAccAWSWafSizeConstraintSet_changeNameForceNew(t *testing.T) { var before, after waf.SizeConstraintSet sizeConstraintSet := fmt.Sprintf("sizeConstraintSet-%s", acctest.RandString(5)) sizeConstraintSetNewName := fmt.Sprintf("sizeConstraintSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_size_constraint_set.size_constraint_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -61,23 +62,24 @@ func TestAccAWSWafSizeConstraintSet_changeNameForceNew(t *testing.T) { { Config: testAccAWSWafSizeConstraintSetConfig(sizeConstraintSet), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafSizeConstraintSetExists("aws_waf_size_constraint_set.size_constraint_set", &before), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "name", sizeConstraintSet), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.#", "1"), + testAccCheckAWSWafSizeConstraintSetExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "name", sizeConstraintSet), + resource.TestCheckResourceAttr(resourceName, "size_constraints.#", "1"), ), }, { Config: testAccAWSWafSizeConstraintSetConfigChangeName(sizeConstraintSetNewName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafSizeConstraintSetExists("aws_waf_size_constraint_set.size_constraint_set", &after), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "name", sizeConstraintSetNewName), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.#", "1"), + testAccCheckAWSWafSizeConstraintSetExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", sizeConstraintSetNewName), + resource.TestCheckResourceAttr(resourceName, "size_constraints.#", "1"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -85,6 +87,7 @@ func TestAccAWSWafSizeConstraintSet_changeNameForceNew(t *testing.T) { func TestAccAWSWafSizeConstraintSet_disappears(t *testing.T) { var v waf.SizeConstraintSet sizeConstraintSet := fmt.Sprintf("sizeConstraintSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_size_constraint_set.size_constraint_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -94,7 +97,7 @@ func TestAccAWSWafSizeConstraintSet_disappears(t *testing.T) { { Config: testAccAWSWafSizeConstraintSetConfig(sizeConstraintSet), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafSizeConstraintSetExists("aws_waf_size_constraint_set.size_constraint_set", &v), + testAccCheckAWSWafSizeConstraintSetExists(resourceName, &v), testAccCheckAWSWafSizeConstraintSetDisappears(&v), ), ExpectNonEmptyPlan: true, @@ -106,6 +109,7 @@ func TestAccAWSWafSizeConstraintSet_disappears(t *testing.T) { func TestAccAWSWafSizeConstraintSet_changeConstraints(t *testing.T) { var before, after waf.SizeConstraintSet setName := fmt.Sprintf("sizeConstraintSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_size_constraint_set.size_constraint_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -115,47 +119,36 @@ func TestAccAWSWafSizeConstraintSet_changeConstraints(t *testing.T) { { Config: testAccAWSWafSizeConstraintSetConfig(setName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafSizeConstraintSetExists("aws_waf_size_constraint_set.size_constraint_set", &before), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "name", setName), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.2029852522.comparison_operator", "EQ"), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.2029852522.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.2029852522.field_to_match.281401076.data", ""), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.2029852522.field_to_match.281401076.type", "BODY"), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.2029852522.size", "4096"), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.2029852522.text_transformation", "NONE"), + testAccCheckAWSWafSizeConstraintSetExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "name", setName), + resource.TestCheckResourceAttr(resourceName, "size_constraints.#", "1"), + resource.TestCheckResourceAttr(resourceName, "size_constraints.2029852522.comparison_operator", "EQ"), + resource.TestCheckResourceAttr(resourceName, "size_constraints.2029852522.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "size_constraints.2029852522.field_to_match.281401076.data", ""), + resource.TestCheckResourceAttr(resourceName, "size_constraints.2029852522.field_to_match.281401076.type", "BODY"), + resource.TestCheckResourceAttr(resourceName, "size_constraints.2029852522.size", "4096"), + resource.TestCheckResourceAttr(resourceName, "size_constraints.2029852522.text_transformation", "NONE"), ), }, { Config: testAccAWSWafSizeConstraintSetConfig_changeConstraints(setName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafSizeConstraintSetExists("aws_waf_size_constraint_set.size_constraint_set", &after), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "name", setName), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.3222308386.comparison_operator", "GE"), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.3222308386.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.3222308386.field_to_match.281401076.data", ""), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.3222308386.field_to_match.281401076.type", "BODY"), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.3222308386.size", "1024"), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.3222308386.text_transformation", "NONE"), + testAccCheckAWSWafSizeConstraintSetExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", setName), + resource.TestCheckResourceAttr(resourceName, "size_constraints.#", "1"), + resource.TestCheckResourceAttr(resourceName, "size_constraints.3222308386.comparison_operator", "GE"), + resource.TestCheckResourceAttr(resourceName, "size_constraints.3222308386.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "size_constraints.3222308386.field_to_match.281401076.data", ""), + resource.TestCheckResourceAttr(resourceName, "size_constraints.3222308386.field_to_match.281401076.type", "BODY"), + resource.TestCheckResourceAttr(resourceName, "size_constraints.3222308386.size", "1024"), + resource.TestCheckResourceAttr(resourceName, "size_constraints.3222308386.text_transformation", "NONE"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -163,6 +156,7 @@ func TestAccAWSWafSizeConstraintSet_changeConstraints(t *testing.T) { func TestAccAWSWafSizeConstraintSet_noConstraints(t *testing.T) { var contraints waf.SizeConstraintSet setName := fmt.Sprintf("sizeConstraintSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_size_constraint_set.size_constraint_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -172,13 +166,16 @@ func TestAccAWSWafSizeConstraintSet_noConstraints(t *testing.T) { { Config: testAccAWSWafSizeConstraintSetConfig_noConstraints(setName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafSizeConstraintSetExists("aws_waf_size_constraint_set.size_constraint_set", &contraints), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "name", setName), - resource.TestCheckResourceAttr( - "aws_waf_size_constraint_set.size_constraint_set", "size_constraints.#", "0"), + testAccCheckAWSWafSizeConstraintSetExists(resourceName, &contraints), + resource.TestCheckResourceAttr(resourceName, "name", setName), + resource.TestCheckResourceAttr(resourceName, "size_constraints.#", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -273,7 +270,7 @@ func testAccCheckAWSWafSizeConstraintSetDestroy(s *terraform.State) error { // Return nil if the SizeConstraintSet is already destroyed if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "WAFNonexistentItemException" { + if awsErr.Code() == waf.ErrCodeNonexistentItemException { return nil } } diff --git a/aws/resource_aws_waf_sql_injection_match_set.go b/aws/resource_aws_waf_sql_injection_match_set.go index 2af2d225d14..33268c98f5e 100644 --- a/aws/resource_aws_waf_sql_injection_match_set.go +++ b/aws/resource_aws_waf_sql_injection_match_set.go @@ -98,7 +98,10 @@ func resourceAwsWafSqlInjectionMatchSetRead(d *schema.ResourceData, meta interfa } d.Set("name", resp.SqlInjectionMatchSet.Name) - d.Set("sql_injection_match_tuples", resp.SqlInjectionMatchSet.SqlInjectionMatchTuples) + + if err := d.Set("sql_injection_match_tuples", flattenWafSqlInjectionMatchTuples(resp.SqlInjectionMatchSet.SqlInjectionMatchTuples)); err != nil { + return fmt.Errorf("error setting sql_injection_match_tuples: %s", err) + } return nil } diff --git a/aws/resource_aws_waf_sql_injection_match_set_test.go b/aws/resource_aws_waf_sql_injection_match_set_test.go index 79d986ae17b..cef4f40eb66 100644 --- a/aws/resource_aws_waf_sql_injection_match_set_test.go +++ b/aws/resource_aws_waf_sql_injection_match_set_test.go @@ -134,14 +134,6 @@ func TestAccAWSWafSqlInjectionMatchSet_changeTuples(t *testing.T) { "aws_waf_sql_injection_match_set.sql_injection_match_set", "name", setName), resource.TestCheckResourceAttr( "aws_waf_sql_injection_match_set.sql_injection_match_set", "sql_injection_match_tuples.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_sql_injection_match_set.sql_injection_match_set", "sql_injection_match_tuples.3333510133.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_sql_injection_match_set.sql_injection_match_set", "sql_injection_match_tuples.3333510133.field_to_match.4253810390.data", "GET"), - resource.TestCheckResourceAttr( - "aws_waf_sql_injection_match_set.sql_injection_match_set", "sql_injection_match_tuples.3333510133.field_to_match.4253810390.type", "METHOD"), - resource.TestCheckResourceAttr( - "aws_waf_sql_injection_match_set.sql_injection_match_set", "sql_injection_match_tuples.3333510133.text_transformation", "NONE"), ), }, }, @@ -314,7 +306,6 @@ resource "aws_waf_sql_injection_match_set" "sql_injection_match_set" { field_to_match { type = "METHOD" - data = "GET" } } } diff --git a/aws/resource_aws_waf_web_acl.go b/aws/resource_aws_waf_web_acl.go index cda331ab52a..0e9df3bd4b6 100644 --- a/aws/resource_aws_waf_web_acl.go +++ b/aws/resource_aws_waf_web_acl.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsWafWebAcl() *schema.Resource { @@ -140,12 +141,14 @@ func resourceAwsWafWebAcl() *schema.Resource { }, }, }, + "tags": tagsSchema(), }, } } func resourceAwsWafWebAclCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).wafconn + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().WafTags() wr := newWafRetryer(conn) out, err := wr.RetryWithToken(func(token *string) (interface{}, error) { @@ -156,6 +159,10 @@ func resourceAwsWafWebAclCreate(d *schema.ResourceData, meta interface{}) error Name: aws.String(d.Get("name").(string)), } + if len(tags) > 0 { + params.Tags = tags + } + return conn.CreateWebACL(params) }) if err != nil { @@ -171,9 +178,36 @@ func resourceAwsWafWebAclCreate(d *schema.ResourceData, meta interface{}) error Resource: fmt.Sprintf("webacl/%s", d.Id()), }.String() - // Set for update - d.Set("arn", arn) - return resourceAwsWafWebAclUpdate(d, meta) + loggingConfiguration := d.Get("logging_configuration").([]interface{}) + if len(loggingConfiguration) == 1 { + input := &waf.PutLoggingConfigurationInput{ + LoggingConfiguration: expandWAFLoggingConfiguration(loggingConfiguration, arn), + } + + log.Printf("[DEBUG] Updating WAF Web ACL (%s) Logging Configuration: %s", d.Id(), input) + if _, err := conn.PutLoggingConfiguration(input); err != nil { + return fmt.Errorf("error updating WAF Web ACL (%s) Logging Configuration: %s", d.Id(), err) + } + } + + rules := d.Get("rules").(*schema.Set).List() + if len(rules) > 0 { + wr := newWafRetryer(conn) + _, err := wr.RetryWithToken(func(token *string) (interface{}, error) { + req := &waf.UpdateWebACLInput{ + ChangeToken: token, + DefaultAction: expandWafAction(d.Get("default_action").(*schema.Set).List()), + Updates: diffWafWebAclRules([]interface{}{}, rules), + WebACLId: aws.String(d.Id()), + } + return conn.UpdateWebACL(req) + }) + if err != nil { + return fmt.Errorf("Error Updating WAF ACL: %s", err) + } + } + + return resourceAwsWafWebAclRead(d, meta) } func resourceAwsWafWebAclRead(d *schema.ResourceData, meta interface{}) error { @@ -199,19 +233,23 @@ func resourceAwsWafWebAclRead(d *schema.ResourceData, meta interface{}) error { return nil } - arn := arn.ARN{ - Partition: meta.(*AWSClient).partition, - Service: "waf", - AccountID: meta.(*AWSClient).accountid, - Resource: fmt.Sprintf("webacl/%s", d.Id()), - }.String() - d.Set("arn", arn) + d.Set("arn", resp.WebACL.WebACLArn) + arn := *resp.WebACL.WebACLArn if err := d.Set("default_action", flattenWafAction(resp.WebACL.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) + + tags, err := keyvaluetags.WafListTags(conn, arn) + if err != nil { + return fmt.Errorf("error listing tags for WAF ACL (%s): %s", arn, err) + } + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + if err := d.Set("rules", flattenWafWebAclRules(resp.WebACL.Rules)); err != nil { return fmt.Errorf("error setting rules: %s", err) } @@ -286,6 +324,14 @@ func resourceAwsWafWebAclUpdate(d *schema.ResourceData, meta interface{}) error } + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.WafUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + return resourceAwsWafWebAclRead(d, meta) } diff --git a/aws/resource_aws_waf_web_acl_test.go b/aws/resource_aws_waf_web_acl_test.go index 81dccb0c725..4f98734f80f 100644 --- a/aws/resource_aws_waf_web_acl_test.go +++ b/aws/resource_aws_waf_web_acl_test.go @@ -4,6 +4,7 @@ import ( "fmt" "log" "os" + "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -131,7 +132,9 @@ func TestAccAWSWafWebAcl_basic(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "default_action.4234791575.type", "ALLOW"), resource.TestCheckResourceAttr(resourceName, "metric_name", rName), resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "rules.#", "0"), + testAccMatchResourceAttrGlobalARN(resourceName, "arn", "waf", regexp.MustCompile(`webacl/.+`)), ), }, { @@ -162,6 +165,7 @@ func TestAccAWSWafWebAcl_changeNameForceNew(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "default_action.4234791575.type", "ALLOW"), resource.TestCheckResourceAttr(resourceName, "metric_name", rName1), resource.TestCheckResourceAttr(resourceName, "name", rName1), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "rules.#", "0"), ), }, @@ -173,6 +177,7 @@ func TestAccAWSWafWebAcl_changeNameForceNew(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "default_action.4234791575.type", "ALLOW"), resource.TestCheckResourceAttr(resourceName, "metric_name", rName2), resource.TestCheckResourceAttr(resourceName, "name", rName2), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "rules.#", "0"), ), }, @@ -336,6 +341,65 @@ func TestAccAWSWafWebAcl_disappears(t *testing.T) { }) } +func TestAccAWSWafWebAcl_Tags(t *testing.T) { + var webACL waf.WebACL + rName := fmt.Sprintf("wafacl%s", acctest.RandString(5)) + resourceName := "aws_waf_web_acl.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSWafWebAclDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSWafWebAclConfigTags1(rName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafWebAclExists(resourceName, &webACL), + resource.TestCheckResourceAttr(resourceName, "default_action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "default_action.4234791575.type", "ALLOW"), + resource.TestCheckResourceAttr(resourceName, "metric_name", rName), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + resource.TestCheckResourceAttr(resourceName, "rules.#", "0"), + ), + }, + { + Config: testAccAWSWafWebAclConfigTags2(rName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafWebAclExists(resourceName, &webACL), + resource.TestCheckResourceAttr(resourceName, "default_action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "default_action.4234791575.type", "ALLOW"), + resource.TestCheckResourceAttr(resourceName, "metric_name", rName), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + resource.TestCheckResourceAttr(resourceName, "rules.#", "0"), + ), + }, + { + Config: testAccAWSWafWebAclConfigTags1(rName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafWebAclExists(resourceName, &webACL), + resource.TestCheckResourceAttr(resourceName, "default_action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "default_action.4234791575.type", "ALLOW"), + resource.TestCheckResourceAttr(resourceName, "metric_name", rName), + resource.TestCheckResourceAttr(resourceName, "name", rName), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + resource.TestCheckResourceAttr(resourceName, "rules.#", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + func testAccCheckAWSWafWebAclDisappears(v *waf.WebACL) resource.TestCheckFunc { return func(s *terraform.State) error { conn := testAccProvider.Meta().(*AWSClient).wafconn @@ -683,3 +747,36 @@ resource "aws_kinesis_firehose_delivery_stream" "test" { } `, rName) } + +func testAccAWSWafWebAclConfigTags1(rName, tag1Key, tag1Value string) string { + return fmt.Sprintf(` +resource "aws_waf_web_acl" "test" { + metric_name = %q + name = %q + + default_action { + type = "ALLOW" + } + tags = { + %q = %q + } +} +`, rName, rName, tag1Key, tag1Value) +} + +func testAccAWSWafWebAclConfigTags2(rName, tag1Key, tag1Value, tag2Key, tag2Value string) string { + return fmt.Sprintf(` +resource "aws_waf_web_acl" "test" { + metric_name = %q + name = %q + + default_action { + type = "ALLOW" + } + tags = { + %q = %q + %q = %q + } +} +`, rName, rName, tag1Key, tag1Value, tag2Key, tag2Value) +} diff --git a/aws/resource_aws_waf_xss_match_set.go b/aws/resource_aws_waf_xss_match_set.go index 823cac3514d..da671ca09b2 100644 --- a/aws/resource_aws_waf_xss_match_set.go +++ b/aws/resource_aws_waf_xss_match_set.go @@ -5,6 +5,7 @@ import ( "log" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/waf" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" @@ -16,6 +17,9 @@ func resourceAwsWafXssMatchSet() *schema.Resource { Read: resourceAwsWafXssMatchSetRead, Update: resourceAwsWafXssMatchSetUpdate, Delete: resourceAwsWafXssMatchSetDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "name": { @@ -23,6 +27,10 @@ func resourceAwsWafXssMatchSet() *schema.Resource { Required: true, ForceNew: true, }, + "arn": { + Type: schema.TypeString, + Computed: true, + }, "xss_match_tuples": { Type: schema.TypeSet, Optional: true, @@ -89,7 +97,7 @@ func resourceAwsWafXssMatchSetRead(d *schema.ResourceData, meta interface{}) err resp, err := conn.GetXssMatchSet(params) if err != nil { - if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "WAFNonexistentItemException" { + if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == waf.ErrCodeNonexistentItemException { log.Printf("[WARN] WAF IPSet (%s) not found, removing from state", d.Id()) d.SetId("") return nil @@ -101,6 +109,14 @@ func resourceAwsWafXssMatchSetRead(d *schema.ResourceData, meta interface{}) err d.Set("name", resp.XssMatchSet.Name) d.Set("xss_match_tuples", flattenWafXssMatchTuples(resp.XssMatchSet.XssMatchTuples)) + arn := arn.ARN{ + Partition: meta.(*AWSClient).partition, + Service: "waf", + AccountID: meta.(*AWSClient).accountid, + Resource: fmt.Sprintf("xssmatchset/%s", d.Id()), + } + d.Set("arn", arn.String()) + return nil } diff --git a/aws/resource_aws_waf_xss_match_set_test.go b/aws/resource_aws_waf_xss_match_set_test.go index 84df10e330c..4c19716d84a 100644 --- a/aws/resource_aws_waf_xss_match_set_test.go +++ b/aws/resource_aws_waf_xss_match_set_test.go @@ -2,6 +2,7 @@ package aws import ( "fmt" + "regexp" "testing" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" @@ -16,6 +17,7 @@ import ( func TestAccAWSWafXssMatchSet_basic(t *testing.T) { var v waf.XssMatchSet xssMatchSet := fmt.Sprintf("xssMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_xss_match_set.xss_match_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -25,29 +27,25 @@ func TestAccAWSWafXssMatchSet_basic(t *testing.T) { { Config: testAccAWSWafXssMatchSetConfig(xssMatchSet), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafXssMatchSetExists("aws_waf_xss_match_set.xss_match_set", &v), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "name", xssMatchSet), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.#", "2"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2018581549.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2018581549.field_to_match.2316364334.data", ""), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2018581549.field_to_match.2316364334.type", "QUERY_STRING"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2018581549.text_transformation", "NONE"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2786024938.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2786024938.field_to_match.3756326843.data", ""), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2786024938.field_to_match.3756326843.type", "URI"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2786024938.text_transformation", "NONE"), + testAccCheckAWSWafXssMatchSetExists(resourceName, &v), + testAccMatchResourceAttrGlobalARN(resourceName, "arn", "waf", regexp.MustCompile(`xssmatchset/.+`)), + resource.TestCheckResourceAttr(resourceName, "name", xssMatchSet), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.#", "2"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2018581549.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2018581549.field_to_match.2316364334.data", ""), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2018581549.field_to_match.2316364334.type", "QUERY_STRING"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2018581549.text_transformation", "NONE"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2786024938.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2786024938.field_to_match.3756326843.data", ""), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2786024938.field_to_match.3756326843.type", "URI"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2786024938.text_transformation", "NONE"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -56,6 +54,7 @@ func TestAccAWSWafXssMatchSet_changeNameForceNew(t *testing.T) { var before, after waf.XssMatchSet xssMatchSet := fmt.Sprintf("xssMatchSet-%s", acctest.RandString(5)) xssMatchSetNewName := fmt.Sprintf("xssMatchSetNewName-%s", acctest.RandString(5)) + resourceName := "aws_waf_xss_match_set.xss_match_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -65,23 +64,24 @@ func TestAccAWSWafXssMatchSet_changeNameForceNew(t *testing.T) { { Config: testAccAWSWafXssMatchSetConfig(xssMatchSet), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafXssMatchSetExists("aws_waf_xss_match_set.xss_match_set", &before), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "name", xssMatchSet), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.#", "2"), + testAccCheckAWSWafXssMatchSetExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "name", xssMatchSet), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.#", "2"), ), }, { Config: testAccAWSWafXssMatchSetConfigChangeName(xssMatchSetNewName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafXssMatchSetExists("aws_waf_xss_match_set.xss_match_set", &after), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "name", xssMatchSetNewName), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.#", "2"), + testAccCheckAWSWafXssMatchSetExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", xssMatchSetNewName), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.#", "2"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -89,6 +89,7 @@ func TestAccAWSWafXssMatchSet_changeNameForceNew(t *testing.T) { func TestAccAWSWafXssMatchSet_disappears(t *testing.T) { var v waf.XssMatchSet xssMatchSet := fmt.Sprintf("xssMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_xss_match_set.xss_match_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -98,7 +99,7 @@ func TestAccAWSWafXssMatchSet_disappears(t *testing.T) { { Config: testAccAWSWafXssMatchSetConfig(xssMatchSet), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafXssMatchSetExists("aws_waf_xss_match_set.xss_match_set", &v), + testAccCheckAWSWafXssMatchSetExists(resourceName, &v), testAccCheckAWSWafXssMatchSetDisappears(&v), ), ExpectNonEmptyPlan: true, @@ -110,6 +111,7 @@ func TestAccAWSWafXssMatchSet_disappears(t *testing.T) { func TestAccAWSWafXssMatchSet_changeTuples(t *testing.T) { var before, after waf.XssMatchSet setName := fmt.Sprintf("xssMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_xss_match_set.xss_match_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -119,55 +121,40 @@ func TestAccAWSWafXssMatchSet_changeTuples(t *testing.T) { { Config: testAccAWSWafXssMatchSetConfig(setName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafXssMatchSetExists("aws_waf_xss_match_set.xss_match_set", &before), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "name", setName), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.#", "2"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2018581549.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2018581549.field_to_match.2316364334.data", ""), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2018581549.field_to_match.2316364334.type", "QUERY_STRING"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2018581549.text_transformation", "NONE"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2786024938.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2786024938.field_to_match.3756326843.data", ""), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2786024938.field_to_match.3756326843.type", "URI"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2786024938.text_transformation", "NONE"), + testAccCheckAWSWafXssMatchSetExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "name", setName), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.#", "2"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2018581549.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2018581549.field_to_match.2316364334.data", ""), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2018581549.field_to_match.2316364334.type", "QUERY_STRING"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2018581549.text_transformation", "NONE"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2786024938.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2786024938.field_to_match.3756326843.data", ""), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2786024938.field_to_match.3756326843.type", "URI"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2786024938.text_transformation", "NONE"), ), }, { Config: testAccAWSWafXssMatchSetConfig_changeTuples(setName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafXssMatchSetExists("aws_waf_xss_match_set.xss_match_set", &after), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "name", setName), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.#", "2"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2893682529.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2893682529.field_to_match.4253810390.data", "GET"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2893682529.field_to_match.4253810390.type", "METHOD"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.2893682529.text_transformation", "HTML_ENTITY_DECODE"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.4270311415.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.4270311415.field_to_match.281401076.data", ""), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.4270311415.field_to_match.281401076.type", "BODY"), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.4270311415.text_transformation", "CMD_LINE"), + testAccCheckAWSWafXssMatchSetExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", setName), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.#", "2"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2893682529.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2893682529.field_to_match.4253810390.data", "GET"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2893682529.field_to_match.4253810390.type", "METHOD"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.2893682529.text_transformation", "HTML_ENTITY_DECODE"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.4270311415.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.4270311415.field_to_match.281401076.data", ""), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.4270311415.field_to_match.281401076.type", "BODY"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.4270311415.text_transformation", "CMD_LINE"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -175,6 +162,7 @@ func TestAccAWSWafXssMatchSet_changeTuples(t *testing.T) { func TestAccAWSWafXssMatchSet_noTuples(t *testing.T) { var ipset waf.XssMatchSet setName := fmt.Sprintf("xssMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_waf_xss_match_set.xss_match_set" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWaf(t) }, @@ -184,13 +172,16 @@ func TestAccAWSWafXssMatchSet_noTuples(t *testing.T) { { Config: testAccAWSWafXssMatchSetConfig_noTuples(setName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafXssMatchSetExists("aws_waf_xss_match_set.xss_match_set", &ipset), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "name", setName), - resource.TestCheckResourceAttr( - "aws_waf_xss_match_set.xss_match_set", "xss_match_tuples.#", "0"), + testAccCheckAWSWafXssMatchSetExists(resourceName, &ipset), + resource.TestCheckResourceAttr(resourceName, "name", setName), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuples.#", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -285,7 +276,7 @@ func testAccCheckAWSWafXssMatchSetDestroy(s *terraform.State) error { // Return nil if the XssMatchSet is already destroyed if awsErr, ok := err.(awserr.Error); ok { - if awsErr.Code() == "WAFNonexistentItemException" { + if awsErr.Code() == waf.ErrCodeNonexistentItemException { return nil } } diff --git a/aws/resource_aws_wafregional_rate_based_rule.go b/aws/resource_aws_wafregional_rate_based_rule.go index e329751a4d6..a6fe9f72063 100644 --- a/aws/resource_aws_wafregional_rate_based_rule.go +++ b/aws/resource_aws_wafregional_rate_based_rule.go @@ -5,10 +5,12 @@ import ( "log" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsWafRegionalRateBasedRule() *schema.Resource { @@ -64,6 +66,11 @@ func resourceAwsWafRegionalRateBasedRule() *schema.Resource { Required: true, ValidateFunc: validation.IntAtLeast(100), }, + "tags": tagsSchema(), + "arn": { + Type: schema.TypeString, + Computed: true, + }, }, } } @@ -71,6 +78,7 @@ func resourceAwsWafRegionalRateBasedRule() *schema.Resource { func resourceAwsWafRegionalRateBasedRuleCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).wafregionalconn region := meta.(*AWSClient).region + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().WafregionalTags() wr := newWafRegionalRetryer(conn, region) out, err := wr.RetryWithToken(func(token *string) (interface{}, error) { @@ -82,6 +90,10 @@ func resourceAwsWafRegionalRateBasedRuleCreate(d *schema.ResourceData, meta inte RateLimit: aws.Int64(int64(d.Get("rate_limit").(int))), } + if len(tags) > 0 { + params.Tags = tags + } + return conn.CreateRateBasedRule(params) }) if err != nil { @@ -89,7 +101,17 @@ func resourceAwsWafRegionalRateBasedRuleCreate(d *schema.ResourceData, meta inte } resp := out.(*waf.CreateRateBasedRuleOutput) d.SetId(*resp.Rule.RuleId) - return resourceAwsWafRegionalRateBasedRuleUpdate(d, meta) + + newPredicates := d.Get("predicate").(*schema.Set).List() + if len(newPredicates) > 0 { + noPredicates := []interface{}{} + err := updateWafRateBasedRuleResourceWR(d.Id(), noPredicates, newPredicates, d.Get("rate_limit"), conn, region) + if err != nil { + return fmt.Errorf("Error Updating WAF Rate Based Rule: %s", err) + } + } + + return resourceAwsWafRegionalRateBasedRuleRead(d, meta) } func resourceAwsWafRegionalRateBasedRuleRead(d *schema.ResourceData, meta interface{}) error { @@ -119,6 +141,23 @@ func resourceAwsWafRegionalRateBasedRuleRead(d *schema.ResourceData, meta interf }) } + arn := arn.ARN{ + AccountID: meta.(*AWSClient).accountid, + Partition: meta.(*AWSClient).partition, + Region: meta.(*AWSClient).region, + Resource: fmt.Sprintf("ratebasedrule/%s", d.Id()), + Service: "waf-regional", + }.String() + d.Set("arn", arn) + + tagList, err := keyvaluetags.WafregionalListTags(conn, arn) + if err != nil { + return fmt.Errorf("Failed to get WAF Regional Rated Based Rule parameter tags for %s: %s", d.Get("name"), err) + } + if err := d.Set("tags", tagList.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + d.Set("predicate", predicates) d.Set("name", resp.Rule.Name) d.Set("metric_name", resp.Rule.MetricName) @@ -148,6 +187,14 @@ func resourceAwsWafRegionalRateBasedRuleUpdate(d *schema.ResourceData, meta inte } } + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.WafregionalUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + return resourceAwsWafRegionalRateBasedRuleRead(d, meta) } diff --git a/aws/resource_aws_wafregional_rate_based_rule_test.go b/aws/resource_aws_wafregional_rate_based_rule_test.go index 5157d2025cd..4c45493e926 100644 --- a/aws/resource_aws_wafregional_rate_based_rule_test.go +++ b/aws/resource_aws_wafregional_rate_based_rule_test.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -130,12 +131,10 @@ func TestAccAWSWafRegionalRateBasedRule_basic(t *testing.T) { Config: testAccAWSWafRegionalRateBasedRuleConfig(wafRuleName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalRateBasedRuleExists(resourceName, &v), - resource.TestCheckResourceAttr( - resourceName, "name", wafRuleName), - resource.TestCheckResourceAttr( - resourceName, "predicate.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "metric_name", wafRuleName), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "waf-regional", regexp.MustCompile(`ratebasedrule/.+`)), + resource.TestCheckResourceAttr(resourceName, "name", wafRuleName), + resource.TestCheckResourceAttr(resourceName, "predicate.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafRuleName), ), }, { @@ -147,6 +146,49 @@ func TestAccAWSWafRegionalRateBasedRule_basic(t *testing.T) { }) } +func TestAccAWSWafRegionalRateBasedRule_tags(t *testing.T) { + var v waf.RateBasedRule + resourceName := "aws_wafregional_rate_based_rule.wafrule" + wafRuleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSWafRegionalRateBasedRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSWafRegionalRateBasedRuleConfigTags1(wafRuleName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRegionalRateBasedRuleExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSWafRegionalRateBasedRuleConfigTags2(wafRuleName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRegionalRateBasedRuleExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSWafRegionalRateBasedRuleConfigTags1(wafRuleName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRegionalRateBasedRuleExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSWafRegionalRateBasedRule_changeNameForceNew(t *testing.T) { var before, after waf.RateBasedRule resourceName := "aws_wafregional_rate_based_rule.wafrule" @@ -162,12 +204,9 @@ func TestAccAWSWafRegionalRateBasedRule_changeNameForceNew(t *testing.T) { Config: testAccAWSWafRegionalRateBasedRuleConfig(wafRuleName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalRateBasedRuleExists(resourceName, &before), - resource.TestCheckResourceAttr( - resourceName, "name", wafRuleName), - resource.TestCheckResourceAttr( - resourceName, "predicate.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "metric_name", wafRuleName), + resource.TestCheckResourceAttr(resourceName, "name", wafRuleName), + resource.TestCheckResourceAttr(resourceName, "predicate.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafRuleName), ), }, { @@ -175,12 +214,9 @@ func TestAccAWSWafRegionalRateBasedRule_changeNameForceNew(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalRateBasedRuleExists(resourceName, &after), testAccCheckAWSWafRateBasedRuleIdDiffers(&before, &after), - resource.TestCheckResourceAttr( - resourceName, "name", wafRuleNewName), - resource.TestCheckResourceAttr( - resourceName, "predicate.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "metric_name", wafRuleNewName), + resource.TestCheckResourceAttr(resourceName, "name", wafRuleNewName), + resource.TestCheckResourceAttr(resourceName, "predicate.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafRuleNewName), ), }, { @@ -349,10 +385,8 @@ func TestAccAWSWafRegionalRateBasedRule_noPredicates(t *testing.T) { Config: testAccAWSWafRegionalRateBasedRuleConfig_noPredicates(ruleName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSWafRegionalRateBasedRuleExists(resourceName, &rule), - resource.TestCheckResourceAttr( - resourceName, "name", ruleName), - resource.TestCheckResourceAttr( - resourceName, "predicate.#", "0"), + resource.TestCheckResourceAttr(resourceName, "name", ruleName), + resource.TestCheckResourceAttr(resourceName, "predicate.#", "0"), ), }, { @@ -479,7 +513,7 @@ func testAccCheckAWSWafRegionalRateBasedRuleExists(n string, v *waf.RateBasedRul func testAccAWSWafRegionalRateBasedRuleConfig(name string) string { return fmt.Sprintf(` resource "aws_wafregional_ipset" "ipset" { - name = "%s" + name = %[1]q ip_set_descriptor { type = "IPV4" @@ -488,8 +522,34 @@ resource "aws_wafregional_ipset" "ipset" { } resource "aws_wafregional_rate_based_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q + rate_key = "IP" + rate_limit = 2000 + + predicate { + data_id = "${aws_wafregional_ipset.ipset.id}" + negated = false + type = "IPMatch" + } +} +`, name) +} + +func testAccAWSWafRegionalRateBasedRuleConfigTags1(name, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_wafregional_ipset" "ipset" { + name = %[1]q + + ip_set_descriptor { + type = "IPV4" + value = "192.0.7.0/24" + } +} + +resource "aws_wafregional_rate_based_rule" "wafrule" { + name = %[1]q + metric_name = %[1]q rate_key = "IP" rate_limit = 2000 @@ -498,14 +558,49 @@ resource "aws_wafregional_rate_based_rule" "wafrule" { negated = false type = "IPMatch" } + + tags = { + %[2]q = %[3]q + } } -`, name, name, name) +`, name, tagKey1, tagValue1) +} + +func testAccAWSWafRegionalRateBasedRuleConfigTags2(name, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_wafregional_ipset" "ipset" { + name = %[1]q + + ip_set_descriptor { + type = "IPV4" + value = "192.0.7.0/24" + } +} + +resource "aws_wafregional_rate_based_rule" "wafrule" { + name = %[1]q + metric_name = %[1]q + rate_key = "IP" + rate_limit = 2000 + + predicate { + data_id = "${aws_wafregional_ipset.ipset.id}" + negated = false + type = "IPMatch" + } + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, name, tagKey1, tagValue1, tagKey2, tagValue2) } func testAccAWSWafRegionalRateBasedRuleConfigChangeName(name string) string { return fmt.Sprintf(` resource "aws_wafregional_ipset" "ipset" { - name = "%s" + name = %[1]q ip_set_descriptor { type = "IPV4" @@ -514,8 +609,8 @@ resource "aws_wafregional_ipset" "ipset" { } resource "aws_wafregional_rate_based_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q rate_key = "IP" rate_limit = 2000 @@ -525,13 +620,13 @@ resource "aws_wafregional_rate_based_rule" "wafrule" { type = "IPMatch" } } -`, name, name, name) +`, name) } func testAccAWSWafRegionalRateBasedRuleConfig_changePredicates(name string) string { return fmt.Sprintf(` resource "aws_wafregional_ipset" "ipset" { - name = "%s" + name = %[1]q ip_set_descriptor { type = "IPV4" @@ -540,7 +635,7 @@ resource "aws_wafregional_ipset" "ipset" { } resource "aws_wafregional_byte_match_set" "set" { - name = "%s" + name = %[1]q byte_match_tuples { text_transformation = "NONE" @@ -555,8 +650,8 @@ resource "aws_wafregional_byte_match_set" "set" { } resource "aws_wafregional_rate_based_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q rate_key = "IP" rate_limit = 2000 @@ -566,18 +661,18 @@ resource "aws_wafregional_rate_based_rule" "wafrule" { type = "ByteMatch" } } -`, name, name, name, name) +`, name) } func testAccAWSWafRegionalRateBasedRuleConfig_noPredicates(name string) string { return fmt.Sprintf(` resource "aws_wafregional_rate_based_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q rate_key = "IP" rate_limit = 2000 } -`, name, name) +`, name) } func testAccAWSWafRegionalRateBasedRuleWithRateLimitConfig(name string, limit string) string { diff --git a/aws/resource_aws_wafregional_rule.go b/aws/resource_aws_wafregional_rule.go index 7b139c555f4..b16703e3468 100644 --- a/aws/resource_aws_wafregional_rule.go +++ b/aws/resource_aws_wafregional_rule.go @@ -4,12 +4,13 @@ import ( "fmt" "log" - "github.com/aws/aws-sdk-go/service/wafregional" - "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/waf" + "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsWafRegionalRule() *schema.Resource { @@ -55,6 +56,11 @@ func resourceAwsWafRegionalRule() *schema.Resource { }, }, }, + "tags": tagsSchema(), + "arn": { + Type: schema.TypeString, + Computed: true, + }, }, } } @@ -62,6 +68,7 @@ func resourceAwsWafRegionalRule() *schema.Resource { func resourceAwsWafRegionalRuleCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).wafregionalconn region := meta.(*AWSClient).region + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().WafregionalTags() wr := newWafRegionalRetryer(conn, region) out, err := wr.RetryWithToken(func(token *string) (interface{}, error) { @@ -71,6 +78,10 @@ func resourceAwsWafRegionalRuleCreate(d *schema.ResourceData, meta interface{}) Name: aws.String(d.Get("name").(string)), } + if len(tags) > 0 { + params.Tags = tags + } + return conn.CreateRule(params) }) if err != nil { @@ -78,7 +89,16 @@ func resourceAwsWafRegionalRuleCreate(d *schema.ResourceData, meta interface{}) } resp := out.(*waf.CreateRuleOutput) d.SetId(*resp.Rule.RuleId) - return resourceAwsWafRegionalRuleUpdate(d, meta) + + newPredicates := d.Get("predicate").(*schema.Set).List() + if len(newPredicates) > 0 { + noPredicates := []interface{}{} + err := updateWafRegionalRuleResource(d.Id(), noPredicates, newPredicates, meta) + if err != nil { + return fmt.Errorf("Error Updating WAF Regional Rule: %s", err) + } + } + return resourceAwsWafRegionalRuleRead(d, meta) } func resourceAwsWafRegionalRuleRead(d *schema.ResourceData, meta interface{}) error { @@ -99,6 +119,25 @@ func resourceAwsWafRegionalRuleRead(d *schema.ResourceData, meta interface{}) er return err } + arn := arn.ARN{ + AccountID: meta.(*AWSClient).accountid, + Partition: meta.(*AWSClient).partition, + Region: meta.(*AWSClient).region, + Resource: fmt.Sprintf("rule/%s", d.Id()), + Service: "waf-regional", + }.String() + d.Set("arn", arn) + + tags, err := keyvaluetags.WafregionalListTags(conn, arn) + + if err != nil { + return fmt.Errorf("error listing tags for WAF Regional Rule (%s): %s", arn, err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + d.Set("predicate", flattenWafPredicates(resp.Rule.Predicates)) d.Set("name", resp.Rule.Name) d.Set("metric_name", resp.Rule.MetricName) @@ -107,6 +146,8 @@ func resourceAwsWafRegionalRuleRead(d *schema.ResourceData, meta interface{}) er } func resourceAwsWafRegionalRuleUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).wafregionalconn + if d.HasChange("predicate") { o, n := d.GetChange("predicate") oldP, newP := o.(*schema.Set).List(), n.(*schema.Set).List() @@ -116,6 +157,15 @@ func resourceAwsWafRegionalRuleUpdate(d *schema.ResourceData, meta interface{}) return fmt.Errorf("Error Updating WAF Rule: %s", err) } } + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.WafregionalUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + return resourceAwsWafRegionalRuleRead(d, meta) } diff --git a/aws/resource_aws_wafregional_rule_group.go b/aws/resource_aws_wafregional_rule_group.go index 5d01c1204dd..48b5d97e906 100644 --- a/aws/resource_aws_wafregional_rule_group.go +++ b/aws/resource_aws_wafregional_rule_group.go @@ -5,9 +5,11 @@ import ( "log" "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsWafRegionalRuleGroup() *schema.Resource { @@ -66,6 +68,11 @@ func resourceAwsWafRegionalRuleGroup() *schema.Resource { }, }, }, + "tags": tagsSchema(), + "arn": { + Type: schema.TypeString, + Computed: true, + }, }, } } @@ -73,6 +80,7 @@ func resourceAwsWafRegionalRuleGroup() *schema.Resource { func resourceAwsWafRegionalRuleGroupCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).wafregionalconn region := meta.(*AWSClient).region + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().WafregionalTags() wr := newWafRegionalRetryer(conn, region) out, err := wr.RetryWithToken(func(token *string) (interface{}, error) { @@ -82,6 +90,10 @@ func resourceAwsWafRegionalRuleGroupCreate(d *schema.ResourceData, meta interfac Name: aws.String(d.Get("name").(string)), } + if len(tags) > 0 { + params.Tags = tags + } + return conn.CreateRuleGroup(params) }) if err != nil { @@ -89,7 +101,18 @@ func resourceAwsWafRegionalRuleGroupCreate(d *schema.ResourceData, meta interfac } resp := out.(*waf.CreateRuleGroupOutput) d.SetId(*resp.RuleGroup.RuleGroupId) - return resourceAwsWafRegionalRuleGroupUpdate(d, meta) + + activatedRule := d.Get("activated_rule").(*schema.Set).List() + if len(activatedRule) > 0 { + noActivatedRules := []interface{}{} + + err := updateWafRuleGroupResourceWR(d.Id(), noActivatedRules, activatedRule, conn, region) + if err != nil { + return fmt.Errorf("Error Updating WAF Regional Rule Group: %s", err) + } + } + + return resourceAwsWafRegionalRuleGroupRead(d, meta) } func resourceAwsWafRegionalRuleGroupRead(d *schema.ResourceData, meta interface{}) error { @@ -117,6 +140,23 @@ func resourceAwsWafRegionalRuleGroupRead(d *schema.ResourceData, meta interface{ return fmt.Errorf("error listing activated rules in WAF Regional Rule Group (%s): %s", d.Id(), err) } + arn := arn.ARN{ + AccountID: meta.(*AWSClient).accountid, + Partition: meta.(*AWSClient).partition, + Region: meta.(*AWSClient).region, + Resource: fmt.Sprintf("rulegroup/%s", d.Id()), + Service: "waf-regional", + }.String() + d.Set("arn", arn) + + tags, err := keyvaluetags.WafregionalListTags(conn, arn) + if err != nil { + return fmt.Errorf("error listing tags for WAF Regional Rule Group (%s): %s", arn, err) + } + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + d.Set("activated_rule", flattenWafActivatedRules(rResp.ActivatedRules)) d.Set("name", resp.RuleGroup.Name) d.Set("metric_name", resp.RuleGroup.MetricName) @@ -138,6 +178,14 @@ func resourceAwsWafRegionalRuleGroupUpdate(d *schema.ResourceData, meta interfac } } + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.WafregionalUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + return resourceAwsWafRegionalRuleGroupRead(d, meta) } diff --git a/aws/resource_aws_wafregional_rule_group_test.go b/aws/resource_aws_wafregional_rule_group_test.go index 2a20ef01e75..780fc656e60 100644 --- a/aws/resource_aws_wafregional_rule_group_test.go +++ b/aws/resource_aws_wafregional_rule_group_test.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -78,6 +79,7 @@ func TestAccAWSWafRegionalRuleGroup_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalRuleExists("aws_wafregional_rule.test", &rule), testAccCheckAWSWafRegionalRuleGroupExists(resourceName, &group), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "waf-regional", regexp.MustCompile(`rulegroup/.+`)), resource.TestCheckResourceAttr(resourceName, "name", groupName), resource.TestCheckResourceAttr(resourceName, "activated_rule.#", "1"), resource.TestCheckResourceAttr(resourceName, "metric_name", groupName), @@ -96,6 +98,56 @@ func TestAccAWSWafRegionalRuleGroup_basic(t *testing.T) { }) } +func TestAccAWSWafRegionalRuleGroup_tags(t *testing.T) { + var rule waf.Rule + var group waf.RuleGroup + + ruleName := fmt.Sprintf("tfacc%s", acctest.RandString(5)) + groupName := fmt.Sprintf("tfacc%s", acctest.RandString(5)) + resourceName := "aws_wafregional_rule_group.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSWafRegionalRuleGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSWafRegionalRuleGroupConfigTags1(ruleName, groupName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRegionalRuleExists("aws_wafregional_rule.test", &rule), + testAccCheckAWSWafRegionalRuleGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSWafRegionalRuleGroupConfigTags2(ruleName, groupName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRegionalRuleExists("aws_wafregional_rule.test", &rule), + testAccCheckAWSWafRegionalRuleGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSWafRegionalRuleGroupConfigTags1(ruleName, groupName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRegionalRuleExists("aws_wafregional_rule.test", &rule), + testAccCheckAWSWafRegionalRuleGroupExists(resourceName, &group), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSWafRegionalRuleGroup_changeNameForceNew(t *testing.T) { var before, after waf.RuleGroup @@ -237,10 +289,8 @@ func TestAccAWSWafRegionalRuleGroup_noActivatedRules(t *testing.T) { Config: testAccAWSWafRegionalRuleGroupConfig_noActivatedRules(groupName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSWafRegionalRuleGroupExists(resourceName, &group), - resource.TestCheckResourceAttr( - resourceName, "name", groupName), - resource.TestCheckResourceAttr( - resourceName, "activated_rule.#", "0"), + resource.TestCheckResourceAttr(resourceName, "name", groupName), + resource.TestCheckResourceAttr(resourceName, "activated_rule.#", "0"), ), }, }, @@ -373,6 +423,61 @@ resource "aws_wafregional_rule_group" "test" { `, ruleName, groupName) } +func testAccAWSWafRegionalRuleGroupConfigTags1(ruleName, groupName, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_wafregional_rule" "test" { + name = %[1]q + metric_name = %[1]q +} + +resource "aws_wafregional_rule_group" "test" { + name = %[2]q + metric_name = %[2]q + + activated_rule { + action { + type = "COUNT" + } + + priority = 50 + rule_id = "${aws_wafregional_rule.test.id}" + } + + tags = { + %[3]q = %[4]q + } +} +`, ruleName, groupName, tagKey1, tagValue1) +} + +func testAccAWSWafRegionalRuleGroupConfigTags2(ruleName, groupName, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_wafregional_rule" "test" { + name = %[1]q + metric_name = %[1]q +} + +resource "aws_wafregional_rule_group" "test" { + name = %[2]q + metric_name = %[2]q + + activated_rule { + action { + type = "COUNT" + } + + priority = 50 + rule_id = "${aws_wafregional_rule.test.id}" + } + + tags = { + %[3]q = %[4]q + %[5]q = %[6]q + } +} +`, ruleName, groupName, tagKey1, tagValue1, tagKey2, tagValue2) +} + func testAccAWSWafRegionalRuleGroupConfig_changeActivatedRules(ruleName1, ruleName2, ruleName3, groupName string) string { return fmt.Sprintf(` resource "aws_wafregional_rule" "test" { diff --git a/aws/resource_aws_wafregional_rule_test.go b/aws/resource_aws_wafregional_rule_test.go index 236700d9397..899b4da9374 100644 --- a/aws/resource_aws_wafregional_rule_test.go +++ b/aws/resource_aws_wafregional_rule_test.go @@ -3,6 +3,7 @@ package aws import ( "fmt" "log" + "regexp" "testing" "github.com/aws/aws-sdk-go/aws" @@ -130,12 +131,10 @@ func TestAccAWSWafRegionalRule_basic(t *testing.T) { Config: testAccAWSWafRegionalRuleConfig(wafRuleName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalRuleExists(resourceName, &v), - resource.TestCheckResourceAttr( - resourceName, "name", wafRuleName), - resource.TestCheckResourceAttr( - resourceName, "predicate.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "metric_name", wafRuleName), + testAccMatchResourceAttrRegionalARN(resourceName, "arn", "waf-regional", regexp.MustCompile(`rule/.+`)), + resource.TestCheckResourceAttr(resourceName, "name", wafRuleName), + resource.TestCheckResourceAttr(resourceName, "predicate.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafRuleName), ), }, { @@ -147,6 +146,50 @@ func TestAccAWSWafRegionalRule_basic(t *testing.T) { }) } +func TestAccAWSWafRegionalRule_tags(t *testing.T) { + var v waf.Rule + wafRuleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) + resourceName := "aws_wafregional_rule.wafrule" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSWafRegionalRuleDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSWafRegionalRuleConfigTags1(wafRuleName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRegionalRuleExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSWafRegionalRuleConfigTags2(wafRuleName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRegionalRuleExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSWafRegionalRuleConfigTags1(wafRuleName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRegionalRuleExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSWafRegionalRule_changeNameForceNew(t *testing.T) { var before, after waf.Rule wafRuleName := fmt.Sprintf("wafrule%s", acctest.RandString(5)) @@ -162,24 +205,18 @@ func TestAccAWSWafRegionalRule_changeNameForceNew(t *testing.T) { Config: testAccAWSWafRegionalRuleConfig(wafRuleName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalRuleExists(resourceName, &before), - resource.TestCheckResourceAttr( - resourceName, "name", wafRuleName), - resource.TestCheckResourceAttr( - resourceName, "predicate.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "metric_name", wafRuleName), + resource.TestCheckResourceAttr(resourceName, "name", wafRuleName), + resource.TestCheckResourceAttr(resourceName, "predicate.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafRuleName), ), }, { Config: testAccAWSWafRegionalRuleConfigChangeName(wafRuleNewName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalRuleExists(resourceName, &after), - resource.TestCheckResourceAttr( - resourceName, "name", wafRuleNewName), - resource.TestCheckResourceAttr( - resourceName, "predicate.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "metric_name", wafRuleNewName), + resource.TestCheckResourceAttr(resourceName, "name", wafRuleNewName), + resource.TestCheckResourceAttr(resourceName, "predicate.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafRuleNewName), ), }, { @@ -227,10 +264,8 @@ func TestAccAWSWafRegionalRule_noPredicates(t *testing.T) { Config: testAccAWSWafRegionalRule_noPredicates(wafRuleName), Check: resource.ComposeAggregateTestCheckFunc( testAccCheckAWSWafRegionalRuleExists(resourceName, &v), - resource.TestCheckResourceAttr( - resourceName, "name", wafRuleName), - resource.TestCheckResourceAttr( - resourceName, "predicate.#", "0"), + resource.TestCheckResourceAttr(resourceName, "name", wafRuleName), + resource.TestCheckResourceAttr(resourceName, "predicate.#", "0"), ), }, { @@ -414,7 +449,31 @@ func testAccCheckAWSWafRegionalRuleExists(n string, v *waf.Rule) resource.TestCh func testAccAWSWafRegionalRuleConfig(name string) string { return fmt.Sprintf(` resource "aws_wafregional_ipset" "ipset" { - name = "%s" + name = %[1]q + + ip_set_descriptor { + type = "IPV4" + value = "192.0.7.0/24" + } +} + +resource "aws_wafregional_rule" "wafrule" { + name = %[1]q + metric_name = %[1]q + + predicate { + data_id = "${aws_wafregional_ipset.ipset.id}" + negated = false + type = "IPMatch" + } +} +`, name) +} + +func testAccAWSWafRegionalRuleConfigTags1(name, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_wafregional_ipset" "ipset" { + name = %[1]q ip_set_descriptor { type = "IPV4" @@ -423,22 +482,55 @@ resource "aws_wafregional_ipset" "ipset" { } resource "aws_wafregional_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q predicate { data_id = "${aws_wafregional_ipset.ipset.id}" negated = false type = "IPMatch" } + + tags = { + %[2]q = %[3]q + } +} +`, name, tagKey1, tagValue1) +} + +func testAccAWSWafRegionalRuleConfigTags2(name, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_wafregional_ipset" "ipset" { + name = %[1]q + + ip_set_descriptor { + type = "IPV4" + value = "192.0.7.0/24" + } +} + +resource "aws_wafregional_rule" "wafrule" { + name = %[1]q + metric_name = %[1]q + + predicate { + data_id = "${aws_wafregional_ipset.ipset.id}" + negated = false + type = "IPMatch" + } + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } } -`, name, name, name) +`, name, tagKey1, tagValue1, tagKey2, tagValue2) } func testAccAWSWafRegionalRuleConfigChangeName(name string) string { return fmt.Sprintf(` resource "aws_wafregional_ipset" "ipset" { - name = "%s" + name = %[1]q ip_set_descriptor { type = "IPV4" @@ -447,8 +539,8 @@ resource "aws_wafregional_ipset" "ipset" { } resource "aws_wafregional_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q predicate { data_id = "${aws_wafregional_ipset.ipset.id}" @@ -456,22 +548,22 @@ resource "aws_wafregional_rule" "wafrule" { type = "IPMatch" } } -`, name, name, name) +`, name) } func testAccAWSWafRegionalRule_noPredicates(name string) string { return fmt.Sprintf(` resource "aws_wafregional_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q } -`, name, name) +`, name) } func testAccAWSWafRegionalRule_changePredicates(name string) string { return fmt.Sprintf(` resource "aws_wafregional_ipset" "ipset" { - name = "%s" + name = %[1]q ip_set_descriptor { type = "IPV4" @@ -480,7 +572,7 @@ resource "aws_wafregional_ipset" "ipset" { } resource "aws_wafregional_xss_match_set" "xss_match_set" { - name = "%s" + name = %[1]q xss_match_tuple { text_transformation = "NONE" @@ -492,8 +584,8 @@ resource "aws_wafregional_xss_match_set" "xss_match_set" { } resource "aws_wafregional_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q predicate { data_id = "${aws_wafregional_xss_match_set.xss_match_set.id}" @@ -507,5 +599,5 @@ resource "aws_wafregional_rule" "wafrule" { type = "IPMatch" } } -`, name, name, name, name) +`, name) } diff --git a/aws/resource_aws_wafregional_web_acl.go b/aws/resource_aws_wafregional_web_acl.go index b23f26fa69a..8308b40f23f 100644 --- a/aws/resource_aws_wafregional_web_acl.go +++ b/aws/resource_aws_wafregional_web_acl.go @@ -10,6 +10,7 @@ import ( "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/helper/validation" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) func resourceAwsWafRegionalWebAcl() *schema.Resource { @@ -140,6 +141,7 @@ func resourceAwsWafRegionalWebAcl() *schema.Resource { }, }, }, + "tags": tagsSchema(), }, } } @@ -147,6 +149,7 @@ func resourceAwsWafRegionalWebAcl() *schema.Resource { func resourceAwsWafRegionalWebAclCreate(d *schema.ResourceData, meta interface{}) error { conn := meta.(*AWSClient).wafregionalconn region := meta.(*AWSClient).region + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().WafregionalTags() wr := newWafRegionalRetryer(conn, region) out, err := wr.RetryWithToken(func(token *string) (interface{}, error) { @@ -157,6 +160,10 @@ func resourceAwsWafRegionalWebAclCreate(d *schema.ResourceData, meta interface{} Name: aws.String(d.Get("name").(string)), } + if len(tags) > 0 { + params.Tags = tags + } + return conn.CreateWebACL(params) }) if err != nil { @@ -176,10 +183,38 @@ func resourceAwsWafRegionalWebAclCreate(d *schema.ResourceData, meta interface{} Service: "waf-regional", }.String() } - // Set for update - d.Set("arn", webACLARN) - return resourceAwsWafRegionalWebAclUpdate(d, meta) + loggingConfiguration := d.Get("logging_configuration").([]interface{}) + + if len(loggingConfiguration) == 1 { + input := &waf.PutLoggingConfigurationInput{ + LoggingConfiguration: expandWAFRegionalLoggingConfiguration(loggingConfiguration, webACLARN), + } + + log.Printf("[DEBUG] Updating WAF Regional Web ACL (%s) Logging Configuration: %s", d.Id(), input) + if _, err := conn.PutLoggingConfiguration(input); err != nil { + return fmt.Errorf("error Updating WAF Regional Web ACL (%s) Logging Configuration: %s", d.Id(), err) + } + } + + rules := d.Get("rule").(*schema.Set).List() + if len(rules) > 0 { + wr := newWafRegionalRetryer(conn, region) + _, err := wr.RetryWithToken(func(token *string) (interface{}, error) { + req := &waf.UpdateWebACLInput{ + ChangeToken: token, + DefaultAction: expandWafAction(d.Get("default_action").([]interface{})), + Updates: diffWafWebAclRules([]interface{}{}, rules), + WebACLId: aws.String(d.Id()), + } + return conn.UpdateWebACL(req) + }) + if err != nil { + return fmt.Errorf("Error Updating WAF Regional ACL: %s", err) + } + } + + return resourceAwsWafRegionalWebAclRead(d, meta) } func resourceAwsWafRegionalWebAclRead(d *schema.ResourceData, meta interface{}) error { @@ -227,6 +262,14 @@ func resourceAwsWafRegionalWebAclRead(d *schema.ResourceData, meta interface{}) return fmt.Errorf("error setting rule: %s", err) } + tags, err := keyvaluetags.WafregionalListTags(conn, webACLARN) + if err != nil { + return fmt.Errorf("error listing tags for WAF Regional ACL (%s): %s", webACLARN, err) + } + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + getLoggingConfigurationInput := &waf.GetLoggingConfigurationInput{ ResourceArn: aws.String(d.Get("arn").(string)), } @@ -297,6 +340,14 @@ func resourceAwsWafRegionalWebAclUpdate(d *schema.ResourceData, meta interface{} } } + if d.HasChange("tags") { + o, n := d.GetChange("tags") + + if err := keyvaluetags.WafregionalUpdateTags(conn, d.Get("arn").(string), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + return resourceAwsWafRegionalWebAclRead(d, meta) } diff --git a/aws/resource_aws_wafregional_web_acl_association.go b/aws/resource_aws_wafregional_web_acl_association.go index f69d90682a6..c7814f654e4 100644 --- a/aws/resource_aws_wafregional_web_acl_association.go +++ b/aws/resource_aws_wafregional_web_acl_association.go @@ -17,6 +17,9 @@ func resourceAwsWafRegionalWebAclAssociation() *schema.Resource { Create: resourceAwsWafRegionalWebAclAssociationCreate, Read: resourceAwsWafRegionalWebAclAssociationRead, Delete: resourceAwsWafRegionalWebAclAssociationDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "web_acl_id": { diff --git a/aws/resource_aws_wafregional_web_acl_association_test.go b/aws/resource_aws_wafregional_web_acl_association_test.go index 20186062b4d..dbadd952f7f 100644 --- a/aws/resource_aws_wafregional_web_acl_association_test.go +++ b/aws/resource_aws_wafregional_web_acl_association_test.go @@ -13,6 +13,8 @@ import ( ) func TestAccAWSWafRegionalWebAclAssociation_basic(t *testing.T) { + resourceName := "aws_wafregional_web_acl_association.foo" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -21,9 +23,14 @@ func TestAccAWSWafRegionalWebAclAssociation_basic(t *testing.T) { { Config: testAccCheckWafRegionalWebAclAssociationConfig_basic, Check: resource.ComposeTestCheckFunc( - testAccCheckWafRegionalWebAclAssociationExists("aws_wafregional_web_acl_association.foo"), + testAccCheckWafRegionalWebAclAssociationExists(resourceName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -47,6 +54,8 @@ func TestAccAWSWafRegionalWebAclAssociation_disappears(t *testing.T) { } func TestAccAWSWafRegionalWebAclAssociation_multipleAssociations(t *testing.T) { + resourceName := "aws_wafregional_web_acl_association.foo" + resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, Providers: testAccProviders, @@ -55,10 +64,15 @@ func TestAccAWSWafRegionalWebAclAssociation_multipleAssociations(t *testing.T) { { Config: testAccCheckWafRegionalWebAclAssociationConfig_multipleAssociations, Check: resource.ComposeTestCheckFunc( - testAccCheckWafRegionalWebAclAssociationExists("aws_wafregional_web_acl_association.foo"), + testAccCheckWafRegionalWebAclAssociationExists(resourceName), testAccCheckWafRegionalWebAclAssociationExists("aws_wafregional_web_acl_association.bar"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -78,6 +92,11 @@ func TestAccAWSWafRegionalWebAclAssociation_ResourceArn_ApiGatewayStage(t *testi testAccCheckWafRegionalWebAclAssociationExists(resourceName), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -228,12 +247,6 @@ resource "aws_wafregional_web_acl_association" "bar" { func testAccCheckWafRegionalWebAclAssociationConfigResourceArnApiGatewayStage(rName string) string { return fmt.Sprintf(` -data "aws_caller_identity" "current" {} - -data "aws_partition" "current" {} - -data "aws_region" "current" {} - resource "aws_api_gateway_rest_api" "test" { name = %[1]q } @@ -296,7 +309,7 @@ resource "aws_wafregional_web_acl" "test" { } resource "aws_wafregional_web_acl_association" "test" { - resource_arn = "arn:${data.aws_partition.current.partition}:apigateway:${data.aws_region.current.name}:${data.aws_caller_identity.current.account_id}:/restapis/${aws_api_gateway_rest_api.test.id}/stages/${aws_api_gateway_stage.test.stage_name}" + resource_arn = "${aws_api_gateway_stage.test.arn}" web_acl_id = "${aws_wafregional_web_acl.test.id}" } `, rName) diff --git a/aws/resource_aws_wafregional_web_acl_test.go b/aws/resource_aws_wafregional_web_acl_test.go index 9fecc6b533a..0373989ff77 100644 --- a/aws/resource_aws_wafregional_web_acl_test.go +++ b/aws/resource_aws_wafregional_web_acl_test.go @@ -131,18 +131,12 @@ func TestAccAWSWafRegionalWebAcl_basic(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalWebAclExists(resourceName, &v), testAccMatchResourceAttrRegionalARN(resourceName, "arn", "waf-regional", regexp.MustCompile(`webacl/.+`)), - resource.TestCheckResourceAttr( - resourceName, "default_action.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "default_action.0.type", "ALLOW"), - resource.TestCheckResourceAttr( - resourceName, "name", wafAclName), - resource.TestCheckResourceAttr( - resourceName, "rule.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "metric_name", wafAclName), - resource.TestCheckResourceAttr( - resourceName, "logging_configuration.#", "0"), + resource.TestCheckResourceAttr(resourceName, "default_action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "default_action.0.type", "ALLOW"), + resource.TestCheckResourceAttr(resourceName, "name", wafAclName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafAclName), + resource.TestCheckResourceAttr(resourceName, "logging_configuration.#", "0"), ), }, { @@ -154,6 +148,50 @@ func TestAccAWSWafRegionalWebAcl_basic(t *testing.T) { }) } +func TestAccAWSWafRegionalWebAcl_tags(t *testing.T) { + var v waf.WebACL + wafAclName := fmt.Sprintf("wafacl%s", acctest.RandString(5)) + resourceName := "aws_wafregional_web_acl.waf_acl" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSWafRegionalWebAclDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSWafRegionalWebAclConfigTags1(wafAclName, "key1", "value1"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRegionalWebAclExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAWSWafRegionalWebAclConfigTags2(wafAclName, "key1", "value1updated", "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRegionalWebAclExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.key1", "value1updated"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + { + Config: testAccAWSWafRegionalWebAclConfigTags1(wafAclName, "key2", "value2"), + Check: resource.ComposeTestCheckFunc( + testAccCheckAWSWafRegionalWebAclExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "tags.%", "1"), + resource.TestCheckResourceAttr(resourceName, "tags.key2", "value2"), + ), + }, + }, + }) +} + func TestAccAWSWafRegionalWebAcl_createRateBased(t *testing.T) { var v waf.WebACL wafAclName := fmt.Sprintf("wafacl%s", acctest.RandString(5)) @@ -168,16 +206,11 @@ func TestAccAWSWafRegionalWebAcl_createRateBased(t *testing.T) { Config: testAccAWSWafRegionalWebAclConfigRateBased(wafAclName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalWebAclExists(resourceName, &v), - resource.TestCheckResourceAttr( - resourceName, "default_action.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "default_action.0.type", "ALLOW"), - resource.TestCheckResourceAttr( - resourceName, "name", wafAclName), - resource.TestCheckResourceAttr( - resourceName, "rule.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "metric_name", wafAclName), + resource.TestCheckResourceAttr(resourceName, "default_action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "default_action.0.type", "ALLOW"), + resource.TestCheckResourceAttr(resourceName, "name", wafAclName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafAclName), ), }, }, @@ -198,16 +231,11 @@ func TestAccAWSWafRegionalWebAcl_createGroup(t *testing.T) { Config: testAccAWSWafRegionalWebAclConfigGroup(wafAclName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalWebAclExists(resourceName, &v), - resource.TestCheckResourceAttr( - resourceName, "default_action.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "default_action.0.type", "ALLOW"), - resource.TestCheckResourceAttr( - resourceName, "name", wafAclName), - resource.TestCheckResourceAttr( - resourceName, "rule.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "metric_name", wafAclName), + resource.TestCheckResourceAttr(resourceName, "default_action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "default_action.0.type", "ALLOW"), + resource.TestCheckResourceAttr(resourceName, "name", wafAclName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafAclName), ), }, { @@ -234,32 +262,22 @@ func TestAccAWSWafRegionalWebAcl_changeNameForceNew(t *testing.T) { Config: testAccAWSWafRegionalWebAclConfig(wafAclName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalWebAclExists(resourceName, &before), - resource.TestCheckResourceAttr( - resourceName, "default_action.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "default_action.0.type", "ALLOW"), - resource.TestCheckResourceAttr( - resourceName, "name", wafAclName), - resource.TestCheckResourceAttr( - resourceName, "rule.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "metric_name", wafAclName), + resource.TestCheckResourceAttr(resourceName, "default_action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "default_action.0.type", "ALLOW"), + resource.TestCheckResourceAttr(resourceName, "name", wafAclName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafAclName), ), }, { Config: testAccAWSWafRegionalWebAclConfig_changeName(wafAclNewName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalWebAclExists(resourceName, &after), - resource.TestCheckResourceAttr( - resourceName, "default_action.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "default_action.0.type", "ALLOW"), - resource.TestCheckResourceAttr( - resourceName, "name", wafAclNewName), - resource.TestCheckResourceAttr( - resourceName, "rule.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "metric_name", wafAclNewName), + resource.TestCheckResourceAttr(resourceName, "default_action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "default_action.0.type", "ALLOW"), + resource.TestCheckResourceAttr(resourceName, "name", wafAclNewName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafAclNewName), ), }, { @@ -286,32 +304,22 @@ func TestAccAWSWafRegionalWebAcl_changeDefaultAction(t *testing.T) { Config: testAccAWSWafRegionalWebAclConfig(wafAclName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalWebAclExists(resourceName, &before), - resource.TestCheckResourceAttr( - resourceName, "default_action.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "default_action.0.type", "ALLOW"), - resource.TestCheckResourceAttr( - resourceName, "name", wafAclName), - resource.TestCheckResourceAttr( - resourceName, "rule.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "metric_name", wafAclName), + resource.TestCheckResourceAttr(resourceName, "default_action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "default_action.0.type", "ALLOW"), + resource.TestCheckResourceAttr(resourceName, "name", wafAclName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafAclName), ), }, { Config: testAccAWSWafRegionalWebAclConfig_changeDefaultAction(wafAclNewName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalWebAclExists(resourceName, &after), - resource.TestCheckResourceAttr( - resourceName, "default_action.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "default_action.0.type", "BLOCK"), - resource.TestCheckResourceAttr( - resourceName, "name", wafAclNewName), - resource.TestCheckResourceAttr( - resourceName, "rule.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "metric_name", wafAclNewName), + resource.TestCheckResourceAttr(resourceName, "default_action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "default_action.0.type", "BLOCK"), + resource.TestCheckResourceAttr(resourceName, "name", wafAclNewName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), + resource.TestCheckResourceAttr(resourceName, "metric_name", wafAclNewName), ), }, { @@ -359,14 +367,10 @@ func TestAccAWSWafRegionalWebAcl_noRules(t *testing.T) { Config: testAccAWSWafRegionalWebAclConfig_noRules(wafAclName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalWebAclExists(resourceName, &v), - resource.TestCheckResourceAttr( - resourceName, "default_action.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "default_action.0.type", "ALLOW"), - resource.TestCheckResourceAttr( - resourceName, "name", wafAclName), - resource.TestCheckResourceAttr( - resourceName, "rule.#", "0"), + resource.TestCheckResourceAttr(resourceName, "default_action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "default_action.0.type", "ALLOW"), + resource.TestCheckResourceAttr(resourceName, "name", wafAclName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "0"), ), }, { @@ -395,14 +399,10 @@ func TestAccAWSWafRegionalWebAcl_changeRules(t *testing.T) { Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalRuleExists("aws_wafregional_rule.wafrule", &r), testAccCheckAWSWafRegionalWebAclExists(resourceName, &v), - resource.TestCheckResourceAttr( - resourceName, "default_action.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "default_action.0.type", "ALLOW"), - resource.TestCheckResourceAttr( - resourceName, "name", wafAclName), - resource.TestCheckResourceAttr( - resourceName, "rule.#", "1"), + resource.TestCheckResourceAttr(resourceName, "default_action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "default_action.0.type", "ALLOW"), + resource.TestCheckResourceAttr(resourceName, "name", wafAclName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "1"), computeWafRegionalWebAclRuleIndex(&r.RuleId, 1, "REGULAR", "BLOCK", &idx), testCheckResourceAttrWithIndexesAddr(resourceName, "rule.%d.priority", &idx, "1"), ), @@ -411,14 +411,10 @@ func TestAccAWSWafRegionalWebAcl_changeRules(t *testing.T) { Config: testAccAWSWafRegionalWebAclConfig_changeRules(wafAclName), Check: resource.ComposeTestCheckFunc( testAccCheckAWSWafRegionalWebAclExists(resourceName, &v), - resource.TestCheckResourceAttr( - resourceName, "default_action.#", "1"), - resource.TestCheckResourceAttr( - resourceName, "default_action.0.type", "ALLOW"), - resource.TestCheckResourceAttr( - resourceName, "name", wafAclName), - resource.TestCheckResourceAttr( - resourceName, "rule.#", "2"), + resource.TestCheckResourceAttr(resourceName, "default_action.#", "1"), + resource.TestCheckResourceAttr(resourceName, "default_action.0.type", "ALLOW"), + resource.TestCheckResourceAttr(resourceName, "name", wafAclName), + resource.TestCheckResourceAttr(resourceName, "rule.#", "2"), ), }, { @@ -602,13 +598,40 @@ func testAccCheckAWSWafRegionalWebAclExists(n string, v *waf.WebACL) resource.Te func testAccAWSWafRegionalWebAclConfig(name string) string { return fmt.Sprintf(` resource "aws_wafregional_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q +} + +resource "aws_wafregional_web_acl" "waf_acl" { + name = %[1]q + metric_name = %[1]q + + default_action { + type = "ALLOW" + } + + rule { + action { + type = "BLOCK" + } + + priority = 1 + rule_id = "${aws_wafregional_rule.wafrule.id}" + } +} +`, name) +} + +func testAccAWSWafRegionalWebAclConfigTags1(name, tagKey1, tagValue1 string) string { + return fmt.Sprintf(` +resource "aws_wafregional_rule" "wafrule" { + name = %[1]q + metric_name = %[1]q } resource "aws_wafregional_web_acl" "waf_acl" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q default_action { type = "ALLOW" @@ -622,23 +645,59 @@ resource "aws_wafregional_web_acl" "waf_acl" { priority = 1 rule_id = "${aws_wafregional_rule.wafrule.id}" } + + tags = { + %[2]q = %[3]q + } } -`, name, name, name, name) +`, name, tagKey1, tagValue1) +} + +func testAccAWSWafRegionalWebAclConfigTags2(name, tagKey1, tagValue1, tagKey2, tagValue2 string) string { + return fmt.Sprintf(` +resource "aws_wafregional_rule" "wafrule" { + name = %[1]q + metric_name = %[1]q +} + +resource "aws_wafregional_web_acl" "waf_acl" { + name = %[1]q + metric_name = %[1]q + + default_action { + type = "ALLOW" + } + + rule { + action { + type = "BLOCK" + } + + priority = 1 + rule_id = "${aws_wafregional_rule.wafrule.id}" + } + + tags = { + %[2]q = %[3]q + %[4]q = %[5]q + } +} +`, name, tagKey1, tagValue1, tagKey2, tagValue2) } func testAccAWSWafRegionalWebAclConfigRateBased(name string) string { return fmt.Sprintf(` resource "aws_wafregional_rate_based_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q rate_key = "IP" rate_limit = 2000 } resource "aws_wafregional_web_acl" "waf_acl" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q default_action { type = "ALLOW" @@ -654,19 +713,19 @@ resource "aws_wafregional_web_acl" "waf_acl" { rule_id = "${aws_wafregional_rate_based_rule.wafrule.id}" } } -`, name, name, name, name) +`, name) } func testAccAWSWafRegionalWebAclConfigGroup(name string) string { return fmt.Sprintf(` resource "aws_wafregional_rule_group" "wafrulegroup" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q } resource "aws_wafregional_web_acl" "waf_acl" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q default_action { type = "ALLOW" @@ -682,19 +741,19 @@ resource "aws_wafregional_web_acl" "waf_acl" { rule_id = "${aws_wafregional_rule_group.wafrulegroup.id}" # todo } } -`, name, name, name, name) +`, name) } func testAccAWSWafRegionalWebAclConfig_changeName(name string) string { return fmt.Sprintf(` resource "aws_wafregional_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q } resource "aws_wafregional_web_acl" "waf_acl" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q default_action { type = "ALLOW" @@ -709,19 +768,19 @@ resource "aws_wafregional_web_acl" "waf_acl" { rule_id = "${aws_wafregional_rule.wafrule.id}" } } -`, name, name, name, name) +`, name) } func testAccAWSWafRegionalWebAclConfig_changeDefaultAction(name string) string { return fmt.Sprintf(` resource "aws_wafregional_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q } resource "aws_wafregional_web_acl" "waf_acl" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q default_action { type = "BLOCK" @@ -736,32 +795,32 @@ resource "aws_wafregional_web_acl" "waf_acl" { rule_id = "${aws_wafregional_rule.wafrule.id}" } } -`, name, name, name, name) +`, name) } func testAccAWSWafRegionalWebAclConfig_noRules(name string) string { return fmt.Sprintf(` resource "aws_wafregional_web_acl" "waf_acl" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q default_action { type = "ALLOW" } } -`, name, name) +`, name) } func testAccAWSWafRegionalWebAclConfig_changeRules(name string) string { return fmt.Sprintf(` resource "aws_wafregional_rule" "wafrule" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q } resource "aws_wafregional_web_acl" "waf_acl" { - name = "%s" - metric_name = "%s" + name = %[1]q + metric_name = %[1]q default_action { type = "ALLOW" @@ -785,7 +844,7 @@ resource "aws_wafregional_web_acl" "waf_acl" { rule_id = "${aws_wafregional_rule.wafrule.id}" } } -`, name, name, name, name) +`, name) } func testAccAWSWafRegionalWebAclConfigLoggingConfiguration(rName string) string { diff --git a/aws/resource_aws_wafregional_xss_match_set.go b/aws/resource_aws_wafregional_xss_match_set.go index bd7db2ad49f..26c2a864dbb 100644 --- a/aws/resource_aws_wafregional_xss_match_set.go +++ b/aws/resource_aws_wafregional_xss_match_set.go @@ -16,6 +16,9 @@ func resourceAwsWafRegionalXssMatchSet() *schema.Resource { Read: resourceAwsWafRegionalXssMatchSetRead, Update: resourceAwsWafRegionalXssMatchSetUpdate, Delete: resourceAwsWafRegionalXssMatchSetDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "name": { diff --git a/aws/resource_aws_wafregional_xss_match_set_test.go b/aws/resource_aws_wafregional_xss_match_set_test.go index 2593bed72b9..9ee6770d53f 100644 --- a/aws/resource_aws_wafregional_xss_match_set_test.go +++ b/aws/resource_aws_wafregional_xss_match_set_test.go @@ -15,6 +15,7 @@ import ( func TestAccAWSWafRegionalXssMatchSet_basic(t *testing.T) { var v waf.XssMatchSet xssMatchSet := fmt.Sprintf("xssMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_wafregional_xss_match_set.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -24,29 +25,24 @@ func TestAccAWSWafRegionalXssMatchSet_basic(t *testing.T) { { Config: testAccAWSWafRegionalXssMatchSetConfig(xssMatchSet), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRegionalXssMatchSetExists("aws_wafregional_xss_match_set.xss_match_set", &v), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "name", xssMatchSet), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.#", "2"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2018581549.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2018581549.field_to_match.2316364334.data", ""), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2018581549.field_to_match.2316364334.type", "QUERY_STRING"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2018581549.text_transformation", "NONE"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2786024938.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2786024938.field_to_match.3756326843.data", ""), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2786024938.field_to_match.3756326843.type", "URI"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2786024938.text_transformation", "NONE"), + testAccCheckAWSWafRegionalXssMatchSetExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "name", xssMatchSet), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.#", "2"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2018581549.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2018581549.field_to_match.2316364334.data", ""), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2018581549.field_to_match.2316364334.type", "QUERY_STRING"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2018581549.text_transformation", "NONE"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2786024938.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2786024938.field_to_match.3756326843.data", ""), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2786024938.field_to_match.3756326843.type", "URI"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2786024938.text_transformation", "NONE"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -55,6 +51,7 @@ func TestAccAWSWafRegionalXssMatchSet_changeNameForceNew(t *testing.T) { var before, after waf.XssMatchSet xssMatchSet := fmt.Sprintf("xssMatchSet-%s", acctest.RandString(5)) xssMatchSetNewName := fmt.Sprintf("xssMatchSetNewName-%s", acctest.RandString(5)) + resourceName := "aws_wafregional_xss_match_set.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -64,21 +61,22 @@ func TestAccAWSWafRegionalXssMatchSet_changeNameForceNew(t *testing.T) { { Config: testAccAWSWafRegionalXssMatchSetConfig(xssMatchSet), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRegionalXssMatchSetExists("aws_wafregional_xss_match_set.xss_match_set", &before), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "name", xssMatchSet), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.#", "2"), + testAccCheckAWSWafRegionalXssMatchSetExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "name", xssMatchSet), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.#", "2"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSWafRegionalXssMatchSetConfigChangeName(xssMatchSetNewName), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRegionalXssMatchSetExists("aws_wafregional_xss_match_set.xss_match_set", &after), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "name", xssMatchSetNewName), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.#", "2"), + testAccCheckAWSWafRegionalXssMatchSetExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", xssMatchSetNewName), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.#", "2"), ), }, }, @@ -88,6 +86,7 @@ func TestAccAWSWafRegionalXssMatchSet_changeNameForceNew(t *testing.T) { func TestAccAWSWafRegionalXssMatchSet_disappears(t *testing.T) { var v waf.XssMatchSet xssMatchSet := fmt.Sprintf("xssMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_wafregional_xss_match_set.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -97,7 +96,7 @@ func TestAccAWSWafRegionalXssMatchSet_disappears(t *testing.T) { { Config: testAccAWSWafRegionalXssMatchSetConfig(xssMatchSet), Check: resource.ComposeTestCheckFunc( - testAccCheckAWSWafRegionalXssMatchSetExists("aws_wafregional_xss_match_set.xss_match_set", &v), + testAccCheckAWSWafRegionalXssMatchSetExists(resourceName, &v), testAccCheckAWSWafRegionalXssMatchSetDisappears(&v), ), ExpectNonEmptyPlan: true, @@ -109,6 +108,7 @@ func TestAccAWSWafRegionalXssMatchSet_disappears(t *testing.T) { func TestAccAWSWafRegionalXssMatchSet_changeTuples(t *testing.T) { var before, after waf.XssMatchSet setName := fmt.Sprintf("xssMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_wafregional_xss_match_set.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -118,53 +118,38 @@ func TestAccAWSWafRegionalXssMatchSet_changeTuples(t *testing.T) { { Config: testAccAWSWafRegionalXssMatchSetConfig(setName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafRegionalXssMatchSetExists("aws_wafregional_xss_match_set.xss_match_set", &before), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "name", setName), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.#", "2"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2018581549.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2018581549.field_to_match.2316364334.data", ""), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2018581549.field_to_match.2316364334.type", "QUERY_STRING"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2018581549.text_transformation", "NONE"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2786024938.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2786024938.field_to_match.3756326843.data", ""), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2786024938.field_to_match.3756326843.type", "URI"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2786024938.text_transformation", "NONE"), + testAccCheckAWSWafRegionalXssMatchSetExists(resourceName, &before), + resource.TestCheckResourceAttr(resourceName, "name", setName), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.#", "2"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2018581549.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2018581549.field_to_match.2316364334.data", ""), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2018581549.field_to_match.2316364334.type", "QUERY_STRING"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2018581549.text_transformation", "NONE"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2786024938.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2786024938.field_to_match.3756326843.data", ""), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2786024938.field_to_match.3756326843.type", "URI"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2786024938.text_transformation", "NONE"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, { Config: testAccAWSWafRegionalXssMatchSetConfig_changeTuples(setName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafRegionalXssMatchSetExists("aws_wafregional_xss_match_set.xss_match_set", &after), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "name", setName), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.#", "2"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2893682529.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2893682529.field_to_match.4253810390.data", "GET"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2893682529.field_to_match.4253810390.type", "METHOD"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.2893682529.text_transformation", "HTML_ENTITY_DECODE"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.4270311415.field_to_match.#", "1"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.4270311415.field_to_match.281401076.data", ""), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.4270311415.field_to_match.281401076.type", "BODY"), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.4270311415.text_transformation", "CMD_LINE"), + testAccCheckAWSWafRegionalXssMatchSetExists(resourceName, &after), + resource.TestCheckResourceAttr(resourceName, "name", setName), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.#", "2"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2893682529.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2893682529.field_to_match.4253810390.data", "GET"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2893682529.field_to_match.4253810390.type", "METHOD"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.2893682529.text_transformation", "HTML_ENTITY_DECODE"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.4270311415.field_to_match.#", "1"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.4270311415.field_to_match.281401076.data", ""), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.4270311415.field_to_match.281401076.type", "BODY"), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.4270311415.text_transformation", "CMD_LINE"), ), }, }, @@ -174,6 +159,7 @@ func TestAccAWSWafRegionalXssMatchSet_changeTuples(t *testing.T) { func TestAccAWSWafRegionalXssMatchSet_noTuples(t *testing.T) { var ipset waf.XssMatchSet setName := fmt.Sprintf("xssMatchSet-%s", acctest.RandString(5)) + resourceName := "aws_wafregional_xss_match_set.test" resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -183,13 +169,16 @@ func TestAccAWSWafRegionalXssMatchSet_noTuples(t *testing.T) { { Config: testAccAWSWafRegionalXssMatchSetConfig_noTuples(setName), Check: resource.ComposeAggregateTestCheckFunc( - testAccCheckAWSWafRegionalXssMatchSetExists("aws_wafregional_xss_match_set.xss_match_set", &ipset), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "name", setName), - resource.TestCheckResourceAttr( - "aws_wafregional_xss_match_set.xss_match_set", "xss_match_tuple.#", "0"), + testAccCheckAWSWafRegionalXssMatchSetExists(resourceName, &ipset), + resource.TestCheckResourceAttr(resourceName, "name", setName), + resource.TestCheckResourceAttr(resourceName, "xss_match_tuple.#", "0"), ), }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, }, }) } @@ -208,7 +197,7 @@ func testAccCheckAWSWafRegionalXssMatchSetDisappears(v *waf.XssMatchSet) resourc for _, xssMatchTuple := range v.XssMatchTuples { xssMatchTupleUpdate := &waf.XssMatchSetUpdate{ - Action: aws.String("DELETE"), + Action: aws.String(wafregional.ChangeActionDelete), XssMatchTuple: &waf.XssMatchTuple{ FieldToMatch: xssMatchTuple.FieldToMatch, TextTransformation: xssMatchTuple.TextTransformation, @@ -296,7 +285,7 @@ func testAccCheckAWSWafRegionalXssMatchSetDestroy(s *terraform.State) error { func testAccAWSWafRegionalXssMatchSetConfig(name string) string { return fmt.Sprintf(` -resource "aws_wafregional_xss_match_set" "xss_match_set" { +resource "aws_wafregional_xss_match_set" "test" { name = "%s" xss_match_tuple { @@ -320,7 +309,7 @@ resource "aws_wafregional_xss_match_set" "xss_match_set" { func testAccAWSWafRegionalXssMatchSetConfigChangeName(name string) string { return fmt.Sprintf(` -resource "aws_wafregional_xss_match_set" "xss_match_set" { +resource "aws_wafregional_xss_match_set" "test" { name = "%s" xss_match_tuple { @@ -344,7 +333,7 @@ resource "aws_wafregional_xss_match_set" "xss_match_set" { func testAccAWSWafRegionalXssMatchSetConfig_changeTuples(name string) string { return fmt.Sprintf(` -resource "aws_wafregional_xss_match_set" "xss_match_set" { +resource "aws_wafregional_xss_match_set" "test" { name = "%s" xss_match_tuple { @@ -369,7 +358,7 @@ resource "aws_wafregional_xss_match_set" "xss_match_set" { func testAccAWSWafRegionalXssMatchSetConfig_noTuples(name string) string { return fmt.Sprintf(` -resource "aws_wafregional_xss_match_set" "xss_match_set" { +resource "aws_wafregional_xss_match_set" "test" { name = "%s" } `, name) diff --git a/aws/resource_aws_worklink_fleet_test.go b/aws/resource_aws_worklink_fleet_test.go index 7b013577b30..f293c9548d1 100644 --- a/aws/resource_aws_worklink_fleet_test.go +++ b/aws/resource_aws_worklink_fleet_test.go @@ -9,12 +9,13 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/worklink" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) func TestAccAWSWorkLinkFleet_Basic(t *testing.T) { - suffix := randomString(20) + suffix := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha) resourceName := "aws_worklink_fleet.test" resource.ParallelTest(t, resource.TestCase{ @@ -41,7 +42,7 @@ func TestAccAWSWorkLinkFleet_Basic(t *testing.T) { } func TestAccAWSWorkLinkFleet_DisplayName(t *testing.T) { - suffix := randomString(20) + suffix := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha) resourceName := "aws_worklink_fleet.test" resource.ParallelTest(t, resource.TestCase{ @@ -73,7 +74,7 @@ func TestAccAWSWorkLinkFleet_DisplayName(t *testing.T) { } func TestAccAWSWorkLinkFleet_OptimizeForEndUserLocation(t *testing.T) { - suffix := randomString(20) + suffix := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha) resourceName := "aws_worklink_fleet.test" resource.ParallelTest(t, resource.TestCase{ @@ -105,7 +106,7 @@ func TestAccAWSWorkLinkFleet_OptimizeForEndUserLocation(t *testing.T) { } func TestAccAWSWorkLinkFleet_AuditStreamArn(t *testing.T) { - rName := randomString(20) + rName := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha) resourceName := "aws_worklink_fleet.test" resource.ParallelTest(t, resource.TestCase{ @@ -130,7 +131,7 @@ func TestAccAWSWorkLinkFleet_AuditStreamArn(t *testing.T) { } func TestAccAWSWorkLinkFleet_Network(t *testing.T) { - rName := randomString(20) + rName := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha) resourceName := "aws_worklink_fleet.test" resource.ParallelTest(t, resource.TestCase{ @@ -172,7 +173,7 @@ func TestAccAWSWorkLinkFleet_Network(t *testing.T) { } func TestAccAWSWorkLinkFleet_DeviceCaCertificate(t *testing.T) { - rName := randomString(20) + rName := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha) resourceName := "aws_worklink_fleet.test" fName := "test-fixtures/worklink-device-ca-certificate.pem" @@ -205,7 +206,7 @@ func TestAccAWSWorkLinkFleet_DeviceCaCertificate(t *testing.T) { } func TestAccAWSWorkLinkFleet_IdentityProvider(t *testing.T) { - rName := randomString(20) + rName := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha) resourceName := "aws_worklink_fleet.test" fName := "test-fixtures/saml-metadata.xml" @@ -236,7 +237,7 @@ func TestAccAWSWorkLinkFleet_IdentityProvider(t *testing.T) { } func TestAccAWSWorkLinkFleet_Disappears(t *testing.T) { - rName := randomString(20) + rName := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha) resourceName := "aws_worklink_fleet.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/aws/resource_aws_worklink_website_certificate_authority_association_test.go b/aws/resource_aws_worklink_website_certificate_authority_association_test.go index 5a92d0b542e..7966e08ef14 100644 --- a/aws/resource_aws_worklink_website_certificate_authority_association_test.go +++ b/aws/resource_aws_worklink_website_certificate_authority_association_test.go @@ -9,12 +9,13 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/worklink" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/terraform" ) func TestAccAWSWorkLinkWorkLinkWebsiteCertificateAuthorityAssociation_Basic(t *testing.T) { - suffix := randomString(20) + suffix := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha) resourceName := "aws_worklink_website_certificate_authority_association.test" resource.ParallelTest(t, resource.TestCase{ @@ -42,10 +43,10 @@ func TestAccAWSWorkLinkWorkLinkWebsiteCertificateAuthorityAssociation_Basic(t *t } func TestAccAWSWorkLinkWorkLinkWebsiteCertificateAuthorityAssociation_DisplayName(t *testing.T) { - suffix := randomString(20) + suffix := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha) resourceName := "aws_worklink_website_certificate_authority_association.test" - displayName1 := fmt.Sprintf("tf-website-certificate-%s", randomString(5)) - displayName2 := fmt.Sprintf("tf-website-certificate-%s", randomString(5)) + displayName1 := fmt.Sprintf("tf-website-certificate-%s", acctest.RandStringFromCharSet(5, acctest.CharSetAlpha)) + displayName2 := fmt.Sprintf("tf-website-certificate-%s", acctest.RandStringFromCharSet(5, acctest.CharSetAlpha)) resource.ParallelTest(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSWorkLink(t) }, Providers: testAccProviders, @@ -75,7 +76,7 @@ func TestAccAWSWorkLinkWorkLinkWebsiteCertificateAuthorityAssociation_DisplayNam } func TestAccAWSWorkLinkWorkLinkWebsiteCertificateAuthorityAssociation_Disappears(t *testing.T) { - suffix := randomString(20) + suffix := acctest.RandStringFromCharSet(20, acctest.CharSetAlpha) resourceName := "aws_worklink_website_certificate_authority_association.test" resource.ParallelTest(t, resource.TestCase{ diff --git a/aws/resource_aws_workspaces_directory.go b/aws/resource_aws_workspaces_directory.go new file mode 100644 index 00000000000..ba53854361a --- /dev/null +++ b/aws/resource_aws_workspaces_directory.go @@ -0,0 +1,363 @@ +package aws + +import ( + "fmt" + "log" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/workspaces" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +func resourceAwsWorkspacesDirectory() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsWorkspacesDirectoryCreate, + Read: resourceAwsWorkspacesDirectoryRead, + Update: resourceAwsWorkspacesDirectoryUpdate, + Delete: resourceAwsWorkspacesDirectoryDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, + Schema: map[string]*schema.Schema{ + "directory_id": { + Type: schema.TypeString, + Required: true, + ForceNew: true, + }, + "self_service_permissions": { + Type: schema.TypeList, + Computed: true, + Optional: true, + MaxItems: 1, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "change_compute_type": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "increase_volume_size": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "rebuild_workspace": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + "restart_workspace": { + Type: schema.TypeBool, + Optional: true, + Default: true, + }, + "switch_running_mode": { + Type: schema.TypeBool, + Optional: true, + Default: false, + }, + }, + }, + }, + "subnet_ids": { + Type: schema.TypeSet, + Optional: true, + ForceNew: true, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "tags": tagsSchema(), + }, + } +} + +func resourceAwsWorkspacesDirectoryCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).workspacesconn + directoryId := d.Get("directory_id").(string) + + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().WorkspacesTags() + + input := &workspaces.RegisterWorkspaceDirectoryInput{ + DirectoryId: aws.String(directoryId), + EnableSelfService: aws.Bool(false), // this is handled separately below + EnableWorkDocs: aws.Bool(false), + Tenancy: aws.String(workspaces.TenancyShared), + Tags: tags, + } + + if v, ok := d.GetOk("subnet_ids"); ok { + for _, id := range v.(*schema.Set).List() { + input.SubnetIds = append(input.SubnetIds, aws.String(id.(string))) + } + } + + log.Printf("[DEBUG] Regestering workspaces directory...\n%#v\n", *input) + _, err := conn.RegisterWorkspaceDirectory(input) + if err != nil { + return err + } + d.SetId(directoryId) + + log.Printf("[DEBUG] Waiting for workspaces directory %q to become registered...", d.Id()) + stateConf := &resource.StateChangeConf{ + Pending: []string{ + workspaces.WorkspaceDirectoryStateRegistering, + }, + Target: []string{workspaces.WorkspaceDirectoryStateRegistered}, + Refresh: workspacesDirectoryRefreshStateFunc(conn, directoryId), + PollInterval: 30 * time.Second, + Timeout: 10 * time.Minute, + } + + _, err = stateConf.WaitForState() + if err != nil { + return fmt.Errorf("error registering directory: %s", err) + } + log.Printf("[DEBUG] Workspaces directory %q is registered", d.Id()) + + d.Partial(true) + + log.Printf("[DEBUG] Modifying workspaces directory %q self-service permissions...", d.Id()) + if v, ok := d.GetOk("self_service_permissions"); ok { + _, err := conn.ModifySelfservicePermissions(&workspaces.ModifySelfservicePermissionsInput{ + ResourceId: aws.String(directoryId), + SelfservicePermissions: expandSelfServicePermissions(v.([]interface{})), + }) + if err != nil { + return fmt.Errorf("error setting self service permissions: %s", err) + } + d.SetPartial("self_service_permission") + } + log.Printf("[DEBUG] Workspaces directory %q self-service permissions are set", d.Id()) + + d.Partial(false) + + return resourceAwsWorkspacesDirectoryRead(d, meta) +} + +func resourceAwsWorkspacesDirectoryRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).workspacesconn + + raw, state, err := workspacesDirectoryRefreshStateFunc(conn, d.Id())() + if err != nil { + return fmt.Errorf("error getting workspaces directory (%s): %s", d.Id(), err) + } + if state == workspaces.WorkspaceDirectoryStateDeregistered { + log.Printf("[WARN] workspaces directory (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + dir := raw.(*workspaces.WorkspaceDirectory) + d.Set("directory_id", dir.DirectoryId) + d.Set("subnet_ids", dir.SubnetIds) + if err := d.Set("self_service_permissions", flattenSelfServicePermissions(dir.SelfservicePermissions)); err != nil { + return fmt.Errorf("error setting self_service_permissions: %s", err) + } + + tags, err := keyvaluetags.WorkspacesListTags(conn, d.Id()) + if err != nil { + return fmt.Errorf("error listing tags: %s", err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + return nil +} + +func resourceAwsWorkspacesDirectoryUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).workspacesconn + + d.Partial(true) + + if d.HasChange("self_service_permissions") { + log.Printf("[DEBUG] Modifying workspaces directory %q self-service permissions...", d.Id()) + permissions := d.Get("self_service_permissions").([]interface{}) + + _, err := conn.ModifySelfservicePermissions(&workspaces.ModifySelfservicePermissionsInput{ + ResourceId: aws.String(d.Id()), + SelfservicePermissions: expandSelfServicePermissions(permissions), + }) + if err != nil { + return fmt.Errorf("error updating self service permissions: %s", err) + } + log.Printf("[DEBUG] Workspaces directory %q self-service permissions are set", d.Id()) + d.SetPartial("self_service_permission") + } + + if d.HasChange("tags") { + log.Printf("[DEBUG] Modifying workspaces directory %q tags...", d.Id()) + o, n := d.GetChange("tags") + if err := WorkspacesUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + log.Printf("[DEBUG] Workspaces directory %q tags are modified", d.Id()) + d.SetPartial("tags") + } + + d.Partial(false) + + return resourceAwsWorkspacesDirectoryRead(d, meta) +} + +func resourceAwsWorkspacesDirectoryDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).workspacesconn + + err := workspacesDirectoryDelete(d.Id(), conn) + if err != nil { + return fmt.Errorf("error deleting workspaces directory (%s): %s", d.Id(), err) + } + log.Printf("[DEBUG] Workspaces directory %q is deregistered", d.Id()) + + return nil +} + +func workspacesDirectoryDelete(id string, conn *workspaces.WorkSpaces) error { + input := &workspaces.DeregisterWorkspaceDirectoryInput{ + DirectoryId: aws.String(id), + } + + log.Printf("[DEBUG] Deregistering Workspace Directory %q", id) + _, err := conn.DeregisterWorkspaceDirectory(input) + if err != nil { + return fmt.Errorf("error deregistering Workspace Directory %q: %w", id, err) + } + + log.Printf("[DEBUG] Waiting for Workspace Directory %q to be deregistered", id) + stateConf := &resource.StateChangeConf{ + Pending: []string{ + workspaces.WorkspaceDirectoryStateRegistering, + workspaces.WorkspaceDirectoryStateRegistered, + workspaces.WorkspaceDirectoryStateDeregistering, + }, + Target: []string{ + workspaces.WorkspaceDirectoryStateDeregistered, + }, + Refresh: workspacesDirectoryRefreshStateFunc(conn, id), + PollInterval: 30 * time.Second, + Timeout: 10 * time.Minute, + } + _, err = stateConf.WaitForState() + if err != nil { + return fmt.Errorf("error waiting for Workspace Directory %q to be deregistered: %w", id, err) + } + return nil +} + +func workspacesDirectoryRefreshStateFunc(conn *workspaces.WorkSpaces, directoryID string) resource.StateRefreshFunc { + return func() (interface{}, string, error) { + resp, err := conn.DescribeWorkspaceDirectories(&workspaces.DescribeWorkspaceDirectoriesInput{ + DirectoryIds: []*string{aws.String(directoryID)}, + }) + if err != nil { + return nil, workspaces.WorkspaceDirectoryStateError, err + } + if len(resp.Directories) == 0 { + return resp, workspaces.WorkspaceDirectoryStateDeregistered, nil + } + directory := resp.Directories[0] + return directory, aws.StringValue(directory.State), nil + } +} + +func expandSelfServicePermissions(permissions []interface{}) *workspaces.SelfservicePermissions { + if len(permissions) == 0 || permissions[0] == nil { + return nil + } + + result := &workspaces.SelfservicePermissions{} + + p := permissions[0].(map[string]interface{}) + + if p["change_compute_type"].(bool) { + result.ChangeComputeType = aws.String(workspaces.ReconnectEnumEnabled) + } else { + result.ChangeComputeType = aws.String(workspaces.ReconnectEnumDisabled) + } + + if p["increase_volume_size"].(bool) { + result.IncreaseVolumeSize = aws.String(workspaces.ReconnectEnumEnabled) + } else { + result.IncreaseVolumeSize = aws.String(workspaces.ReconnectEnumDisabled) + } + + if p["rebuild_workspace"].(bool) { + result.RebuildWorkspace = aws.String(workspaces.ReconnectEnumEnabled) + } else { + result.RebuildWorkspace = aws.String(workspaces.ReconnectEnumDisabled) + } + + if p["restart_workspace"].(bool) { + result.RestartWorkspace = aws.String(workspaces.ReconnectEnumEnabled) + } else { + result.RestartWorkspace = aws.String(workspaces.ReconnectEnumDisabled) + } + + if p["switch_running_mode"].(bool) { + result.SwitchRunningMode = aws.String(workspaces.ReconnectEnumEnabled) + } else { + result.SwitchRunningMode = aws.String(workspaces.ReconnectEnumDisabled) + } + + return result +} + +func flattenSelfServicePermissions(permissions *workspaces.SelfservicePermissions) []interface{} { + if permissions == nil { + return []interface{}{} + } + + result := map[string]interface{}{} + + switch *permissions.ChangeComputeType { + case workspaces.ReconnectEnumEnabled: + result["change_compute_type"] = true + case workspaces.ReconnectEnumDisabled: + result["change_compute_type"] = false + default: + result["change_compute_type"] = nil + } + + switch *permissions.IncreaseVolumeSize { + case workspaces.ReconnectEnumEnabled: + result["increase_volume_size"] = true + case workspaces.ReconnectEnumDisabled: + result["increase_volume_size"] = false + default: + result["increase_volume_size"] = nil + } + + switch *permissions.RebuildWorkspace { + case workspaces.ReconnectEnumEnabled: + result["rebuild_workspace"] = true + case workspaces.ReconnectEnumDisabled: + result["rebuild_workspace"] = false + default: + result["rebuild_workspace"] = nil + } + + switch *permissions.RestartWorkspace { + case workspaces.ReconnectEnumEnabled: + result["restart_workspace"] = true + case workspaces.ReconnectEnumDisabled: + result["restart_workspace"] = false + default: + result["restart_workspace"] = nil + } + + switch *permissions.SwitchRunningMode { + case workspaces.ReconnectEnumEnabled: + result["switch_running_mode"] = true + case workspaces.ReconnectEnumDisabled: + result["switch_running_mode"] = false + default: + result["switch_running_mode"] = nil + } + + return []interface{}{result} +} diff --git a/aws/resource_aws_workspaces_directory_test.go b/aws/resource_aws_workspaces_directory_test.go new file mode 100644 index 00000000000..79959174a4c --- /dev/null +++ b/aws/resource_aws_workspaces_directory_test.go @@ -0,0 +1,461 @@ +package aws + +import ( + "fmt" + "log" + "reflect" + "testing" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/workspaces" + multierror "github.com/hashicorp/go-multierror" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +func init() { + resource.AddTestSweepers("aws_workspaces_directory", &resource.Sweeper{ + Name: "aws_workspaces_directory", + F: testSweepWorkspacesDirectories, + }) +} + +func testSweepWorkspacesDirectories(region string) error { + client, err := sharedClientForRegion(region) + if err != nil { + return fmt.Errorf("error getting client: %w", err) + } + conn := client.(*AWSClient).workspacesconn + + var errors error + input := &workspaces.DescribeWorkspaceDirectoriesInput{} + err = conn.DescribeWorkspaceDirectoriesPages(input, func(resp *workspaces.DescribeWorkspaceDirectoriesOutput, _ bool) bool { + for _, directory := range resp.Directories { + err := workspacesDirectoryDelete(aws.StringValue(directory.DirectoryId), conn) + if err != nil { + errors = multierror.Append(errors, err) + } + + } + return true + }) + if testSweepSkipSweepError(err) { + log.Printf("[WARN] Skipping Workspace Directory sweep for %s: %s", region, err) + return errors // In case we have completed some pages, but had errors + } + if err != nil { + errors = multierror.Append(errors, fmt.Errorf("error listing Workspace Directories: %s", err)) + } + + return errors +} + +// These tests need to be serialized, because they all rely on the IAM Role `workspaces_DefaultRole`. +func TestAccAwsWorkspacesDirectory(t *testing.T) { + testCases := map[string]func(t *testing.T){ + "basic": testAccAwsWorkspacesDirectory_basic, + "disappears": testAccAwsWorkspacesDirectory_disappears, + "subnetIds": testAccAwsWorkspacesDirectory_subnetIds, + } + for name, tc := range testCases { + tc := tc + t.Run(name, func(t *testing.T) { + tc(t) + }) + } +} + +func testAccAwsWorkspacesDirectory_basic(t *testing.T) { + var v workspaces.WorkspaceDirectory + booster := acctest.RandString(8) + resourceName := "aws_workspaces_directory.main" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsWorkspacesDirectoryDestroy, + Steps: []resource.TestStep{ + { + Config: testAccWorkspacesDirectoryConfigA(booster), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAwsWorkspacesDirectoryExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "subnet_ids.#", "2"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.#", "1"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.0.change_compute_type", "false"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.0.increase_volume_size", "false"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.0.rebuild_workspace", "false"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.0.restart_workspace", "true"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.0.switch_running_mode", "false"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "3"), + resource.TestCheckResourceAttr(resourceName, "tags.Name", "test"), + resource.TestCheckResourceAttr(resourceName, "tags.Terraform", "true"), + resource.TestCheckResourceAttr(resourceName, "tags.Directory", "tf-acctest.example.com"), + ), + }, + { + Config: testAccWorkspacesDirectoryConfigB(booster), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAwsWorkspacesDirectoryExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.#", "1"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.0.change_compute_type", "false"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.0.increase_volume_size", "true"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.0.rebuild_workspace", "true"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.0.restart_workspace", "false"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.0.switch_running_mode", "true"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "2"), + resource.TestCheckResourceAttr(resourceName, "tags.Directory", "tf-acctest.example.com"), + resource.TestCheckResourceAttr(resourceName, "tags.Purpose", "test"), + ), + }, + { + Config: testAccWorkspacesDirectoryConfigC(booster), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAwsWorkspacesDirectoryExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.#", "1"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.0.change_compute_type", "true"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.0.increase_volume_size", "false"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.0.rebuild_workspace", "false"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.0.restart_workspace", "true"), + resource.TestCheckResourceAttr(resourceName, "self_service_permissions.0.switch_running_mode", "true"), + resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccAwsWorkspacesDirectory_disappears(t *testing.T) { + var v workspaces.WorkspaceDirectory + booster := acctest.RandString(8) + resourceName := "aws_workspaces_directory.main" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsWorkspacesDirectoryDestroy, + Steps: []resource.TestStep{ + { + Config: testAccWorkspacesDirectoryConfigA(booster), + Check: resource.ComposeAggregateTestCheckFunc( + testAccCheckAwsWorkspacesDirectoryExists(resourceName, &v), + testAccCheckAwsWorkspacesDirectoryDisappears(&v), + ), + ExpectNonEmptyPlan: true, + }, + }, + }) +} + +func testAccAwsWorkspacesDirectory_subnetIds(t *testing.T) { + var v workspaces.WorkspaceDirectory + booster := acctest.RandString(8) + resourceName := "aws_workspaces_directory.main" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsWorkspacesDirectoryDestroy, + Steps: []resource.TestStep{ + { + Config: testAccWorkspacesDirectoryConfig_subnetIds(booster), + Check: resource.ComposeTestCheckFunc( + testAccCheckAwsWorkspacesDirectoryExists(resourceName, &v), + resource.TestCheckResourceAttr(resourceName, "subnet_ids.#", "2"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckAwsWorkspacesDirectoryDestroy(s *terraform.State) error { + conn := testAccProvider.Meta().(*AWSClient).workspacesconn + + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_workspaces_directory" { + continue + } + + resp, err := conn.DescribeWorkspaceDirectories(&workspaces.DescribeWorkspaceDirectoriesInput{ + DirectoryIds: []*string{aws.String(rs.Primary.ID)}, + }) + if err != nil { + return err + } + + if len(resp.Directories) == 0 { + return nil + } + + dir := resp.Directories[0] + if *dir.State != workspaces.WorkspaceDirectoryStateDeregistering && *dir.State != workspaces.WorkspaceDirectoryStateDeregistered { + return fmt.Errorf("directory %q was not deregistered", rs.Primary.ID) + } + } + + return nil +} + +func testAccCheckAwsWorkspacesDirectoryDisappears(v *workspaces.WorkspaceDirectory) resource.TestCheckFunc { + return func(s *terraform.State) error { + return workspacesDirectoryDelete(aws.StringValue(v.DirectoryId), testAccProvider.Meta().(*AWSClient).workspacesconn) + } +} + +func testAccCheckAwsWorkspacesDirectoryExists(n string, v *workspaces.WorkspaceDirectory) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("workspaces directory resource is not found: %q", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("workspaces directory resource ID is not set") + } + + conn := testAccProvider.Meta().(*AWSClient).workspacesconn + resp, err := conn.DescribeWorkspaceDirectories(&workspaces.DescribeWorkspaceDirectoriesInput{ + DirectoryIds: []*string{aws.String(rs.Primary.ID)}, + }) + if err != nil { + return err + } + + if *resp.Directories[0].DirectoryId == rs.Primary.ID { + *v = *resp.Directories[0] + + return nil + } + + return fmt.Errorf("workspaces directory %q is not found", rs.Primary.ID) + } +} + +func TestExpandSelfServicePermissions(t *testing.T) { + cases := []struct { + input []interface{} + expected *workspaces.SelfservicePermissions + }{ + // Empty + { + input: []interface{}{}, + expected: nil, + }, + // Full + { + input: []interface{}{ + map[string]interface{}{ + "change_compute_type": false, + "increase_volume_size": false, + "rebuild_workspace": true, + "restart_workspace": true, + "switch_running_mode": true, + }, + }, + expected: &workspaces.SelfservicePermissions{ + ChangeComputeType: aws.String(workspaces.ReconnectEnumDisabled), + IncreaseVolumeSize: aws.String(workspaces.ReconnectEnumDisabled), + RebuildWorkspace: aws.String(workspaces.ReconnectEnumEnabled), + RestartWorkspace: aws.String(workspaces.ReconnectEnumEnabled), + SwitchRunningMode: aws.String(workspaces.ReconnectEnumEnabled), + }, + }, + } + + for _, c := range cases { + actual := expandSelfServicePermissions(c.input) + if !reflect.DeepEqual(actual, c.expected) { + t.Fatalf("expected\n\n%#+v\n\ngot\n\n%#+v", c.expected, actual) + } + } +} + +func TestFlattenSelfServicePermissions(t *testing.T) { + cases := []struct { + input *workspaces.SelfservicePermissions + expected []interface{} + }{ + // Empty + { + input: nil, + expected: []interface{}{}, + }, + // Full + { + input: &workspaces.SelfservicePermissions{ + ChangeComputeType: aws.String(workspaces.ReconnectEnumDisabled), + IncreaseVolumeSize: aws.String(workspaces.ReconnectEnumDisabled), + RebuildWorkspace: aws.String(workspaces.ReconnectEnumEnabled), + RestartWorkspace: aws.String(workspaces.ReconnectEnumEnabled), + SwitchRunningMode: aws.String(workspaces.ReconnectEnumEnabled), + }, + expected: []interface{}{ + map[string]interface{}{ + "change_compute_type": false, + "increase_volume_size": false, + "rebuild_workspace": true, + "restart_workspace": true, + "switch_running_mode": true, + }, + }, + }, + } + + for _, c := range cases { + actual := flattenSelfServicePermissions(c.input) + if !reflect.DeepEqual(actual, c.expected) { + t.Fatalf("expected\n\n%#+v\n\ngot\n\n%#+v", c.expected, actual) + } + } +} + +// Extract common infra +func testAccAwsWorkspacesDirectoryConfig_Prerequisites(booster string) string { + return fmt.Sprintf(` +data "aws_region" "current" {} + +data "aws_availability_zones" "available" { + state = "available" +} + +locals { + region_workspaces_az_ids = { + "us-east-1" = formatlist("use1-az%%d", [2, 4, 6]) + } + + workspaces_az_ids = lookup(local.region_workspaces_az_ids, data.aws_region.current.name, data.aws_availability_zones.available.zone_ids) +} + + resource "aws_vpc" "main" { + cidr_block = "10.0.0.0/16" + + tags = { + Name = "tf-testacc-workspaces-directory-%s" + } + } + + resource "aws_subnet" "primary" { + vpc_id = "${aws_vpc.main.id}" + availability_zone_id = "${local.workspaces_az_ids[0]}" + cidr_block = "10.0.1.0/24" + + tags = { + Name = "tf-testacc-workspaces-directory-%s-primary" + } + } + + resource "aws_subnet" "secondary" { + vpc_id = "${aws_vpc.main.id}" + availability_zone_id = "${local.workspaces_az_ids[1]}" + cidr_block = "10.0.2.0/24" + + tags = { + Name = "tf-testacc-workspaces-directory-%s-secondary" + } + } + +resource "aws_directory_service_directory" "main" { + size = "Small" + name = "tf-acctest.neverland.com" + password = "#S1ncerely" + + vpc_settings { + vpc_id = "${aws_vpc.main.id}" + subnet_ids = ["${aws_subnet.primary.id}","${aws_subnet.secondary.id}"] + } +} + +data "aws_iam_policy_document" "workspaces" { + statement { + actions = ["sts:AssumeRole"] + + principals { + type = "Service" + identifiers = ["workspaces.amazonaws.com"] + } + } +} + +resource "aws_iam_role" "workspaces-default" { + name = "workspaces_DefaultRole" + assume_role_policy = data.aws_iam_policy_document.workspaces.json +} + +resource "aws_iam_role_policy_attachment" "workspaces-default-service-access" { + role = aws_iam_role.workspaces-default.name + policy_arn = "arn:aws:iam::aws:policy/AmazonWorkSpacesServiceAccess" +} + +resource "aws_iam_role_policy_attachment" "workspaces-default-self-service-access" { + role = aws_iam_role.workspaces-default.name + policy_arn = "arn:aws:iam::aws:policy/AmazonWorkSpacesSelfServiceAccess" +} +`, booster, booster, booster) +} + +func testAccWorkspacesDirectoryConfigA(booster string) string { + return testAccAwsWorkspacesDirectoryConfig_Prerequisites(booster) + fmt.Sprintf(` +resource "aws_workspaces_directory" "main" { + directory_id = "${aws_directory_service_directory.main.id}" + + tags = { + Name = "test" + Terraform = true + Directory = "tf-acctest.example.com" + } +} +`) +} + +func testAccWorkspacesDirectoryConfigB(booster string) string { + return testAccAwsWorkspacesDirectoryConfig_Prerequisites(booster) + fmt.Sprintf(` +resource "aws_workspaces_directory" "main" { + directory_id = "${aws_directory_service_directory.main.id}" + + self_service_permissions { + change_compute_type = false + increase_volume_size = true + rebuild_workspace = true + restart_workspace = false + switch_running_mode = true + } + + tags = { + Purpose = "test" + Directory = "tf-acctest.example.com" + } +} +`) +} + +func testAccWorkspacesDirectoryConfigC(booster string) string { + return testAccAwsWorkspacesDirectoryConfig_Prerequisites(booster) + fmt.Sprintf(` +resource "aws_workspaces_directory" "main" { + directory_id = "${aws_directory_service_directory.main.id}" + + self_service_permissions { + change_compute_type = true + switch_running_mode = true + } +} +`) +} + +func testAccWorkspacesDirectoryConfig_subnetIds(booster string) string { + return testAccAwsWorkspacesDirectoryConfig_Prerequisites(booster) + fmt.Sprintf(` +resource "aws_workspaces_directory" "main" { + directory_id = "${aws_directory_service_directory.main.id}" + subnet_ids = ["${aws_subnet.primary.id}","${aws_subnet.secondary.id}"] +} +`) +} diff --git a/aws/resource_aws_workspaces_ip_group.go b/aws/resource_aws_workspaces_ip_group.go new file mode 100644 index 00000000000..9ce1cd6c6b5 --- /dev/null +++ b/aws/resource_aws_workspaces_ip_group.go @@ -0,0 +1,173 @@ +package aws + +import ( + "fmt" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/workspaces" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" + "log" +) + +func resourceAwsWorkspacesIpGroup() *schema.Resource { + return &schema.Resource{ + Create: resourceAwsWorkspacesIpGroupCreate, + Read: resourceAwsWorkspacesIpGroupRead, + Update: resourceAwsWorkspacesIpGroupUpdate, + Delete: resourceAwsWorkspacesIpGroupDelete, + 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, + ForceNew: true, + }, + "rules": { + Type: schema.TypeSet, + Optional: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "source": { + Type: schema.TypeString, + Required: true, + }, + "description": { + Type: schema.TypeString, + Optional: true, + }, + }, + }, + }, + "tags": tagsSchema(), + }, + } +} + +func resourceAwsWorkspacesIpGroupCreate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).workspacesconn + + rules := d.Get("rules").(*schema.Set).List() + + tags := keyvaluetags.New(d.Get("tags").(map[string]interface{})).IgnoreAws().WorkspacesTags() + + resp, err := conn.CreateIpGroup(&workspaces.CreateIpGroupInput{ + GroupName: aws.String(d.Get("name").(string)), + GroupDesc: aws.String(d.Get("description").(string)), + UserRules: expandIpGroupRules(rules), + Tags: tags, + }) + if err != nil { + return err + } + + d.SetId(*resp.GroupId) + + return resourceAwsWorkspacesIpGroupRead(d, meta) +} + +func resourceAwsWorkspacesIpGroupRead(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).workspacesconn + + resp, err := conn.DescribeIpGroups(&workspaces.DescribeIpGroupsInput{ + GroupIds: []*string{aws.String(d.Id())}, + }) + if err != nil { + if len(resp.Result) == 0 { + log.Printf("[WARN] Workspaces Ip Group (%s) not found, removing from state", d.Id()) + d.SetId("") + return nil + } + + return err + } + + d.Set("name", resp.Result[0].GroupName) + d.Set("description", resp.Result[0].GroupDesc) + d.Set("rules", flattenIpGroupRules(resp.Result[0].UserRules)) + + tags, err := keyvaluetags.WorkspacesListTags(conn, d.Id()) + if err != nil { + return fmt.Errorf("error listing tags for Workspaces IP Group (%q): %s", d.Id(), err) + } + + if err := d.Set("tags", tags.IgnoreAws().Map()); err != nil { + return fmt.Errorf("error setting tags: %s", err) + } + + return nil +} + +func resourceAwsWorkspacesIpGroupUpdate(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).workspacesconn + + if d.HasChange("rules") { + rules := d.Get("rules").(*schema.Set).List() + + log.Printf("[INFO] Updating Workspaces IP Group Rules") + _, err := conn.UpdateRulesOfIpGroup(&workspaces.UpdateRulesOfIpGroupInput{ + GroupId: aws.String(d.Id()), + UserRules: expandIpGroupRules(rules), + }) + if err != nil { + return err + } + } + + if d.HasChange("tags") { + o, n := d.GetChange("tags") + if err := keyvaluetags.WorkspacesUpdateTags(conn, d.Id(), o, n); err != nil { + return fmt.Errorf("error updating tags: %s", err) + } + } + + return resourceAwsWorkspacesIpGroupRead(d, meta) +} + +func resourceAwsWorkspacesIpGroupDelete(d *schema.ResourceData, meta interface{}) error { + conn := meta.(*AWSClient).workspacesconn + + log.Printf("[INFO] Deleting Workspaces IP Group") + _, err := conn.DeleteIpGroup(&workspaces.DeleteIpGroupInput{ + GroupId: aws.String(d.Id()), + }) + if err != nil { + return fmt.Errorf("Error Deleting Workspaces IP Group: %s", err) + } + + return nil +} + +func expandIpGroupRules(rules []interface{}) []*workspaces.IpRuleItem { + var result []*workspaces.IpRuleItem + for _, rule := range rules { + r := rule.(map[string]interface{}) + + result = append(result, &workspaces.IpRuleItem{ + IpRule: aws.String(r["source"].(string)), + RuleDesc: aws.String(r["description"].(string)), + }) + } + return result +} + +func flattenIpGroupRules(rules []*workspaces.IpRuleItem) []map[string]interface{} { + result := make([]map[string]interface{}, 0, len(rules)) + for _, rule := range rules { + r := map[string]interface{}{ + "source": *rule.IpRule, + } + if rule.RuleDesc != nil { + r["description"] = *rule.RuleDesc + } + result = append(result, r) + } + return result +} diff --git a/aws/resource_aws_workspaces_ip_group_test.go b/aws/resource_aws_workspaces_ip_group_test.go new file mode 100644 index 00000000000..e68bd993fc3 --- /dev/null +++ b/aws/resource_aws_workspaces_ip_group_test.go @@ -0,0 +1,164 @@ +package aws + +import ( + "fmt" + "strings" + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/terraform" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/workspaces" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" +) + +func TestAccAwsWorkspacesIpGroup_basic(t *testing.T) { + var wipg workspaces.IpGroup + ipGroupName := fmt.Sprintf("terraform-acctest-%s", acctest.RandString(10)) + ipGroupNewName := fmt.Sprintf("terraform-acctest-new-%s", acctest.RandString(10)) + ipGroupDescription := fmt.Sprintf("Terraform Acceptance Test %s", strings.Title(acctest.RandString(20))) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAwsWorkspacesIpGroupDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAwsWorkspacesIpGroupConfigA(ipGroupName, ipGroupDescription), + Check: resource.ComposeAggregateTestCheckFunc( + testAccWorkspacesIpGroupConfigExists("aws_workspaces_ip_group.test", &wipg), + resource.TestCheckResourceAttr( + "aws_workspaces_ip_group.test", "name", ipGroupName), + resource.TestCheckResourceAttr( + "aws_workspaces_ip_group.test", "description", ipGroupDescription), + resource.TestCheckResourceAttr( + "aws_workspaces_ip_group.test", "rules.#", "2"), + ), + }, + { + ResourceName: "aws_workspaces_ip_group.test", + ImportState: true, + ImportStateVerify: true, + }, + { + Config: testAccAwsWorkspacesIpGroupConfigB(ipGroupNewName, ipGroupDescription), + Check: resource.ComposeAggregateTestCheckFunc( + testAccWorkspacesIpGroupConfigExists("aws_workspaces_ip_group.test", &wipg), + resource.TestCheckResourceAttr( + "aws_workspaces_ip_group.test", "name", ipGroupNewName), + resource.TestCheckResourceAttr( + "aws_workspaces_ip_group.test", "description", ipGroupDescription), + resource.TestCheckResourceAttr( + "aws_workspaces_ip_group.test", "rules.#", "1"), + ), + }, + { + ResourceName: "aws_workspaces_ip_group.test", + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} + +func testAccCheckAwsWorkspacesIpGroupDestroy(s *terraform.State) error { + for _, rs := range s.RootModule().Resources { + if rs.Type != "aws_workspaces_ip_group" { + continue + } + + conn := testAccProvider.Meta().(*AWSClient).workspacesconn + resp, err := conn.DescribeIpGroups(&workspaces.DescribeIpGroupsInput{ + GroupIds: []*string{aws.String(rs.Primary.ID)}, + }) + + if err != nil { + return fmt.Errorf("Error Describing Workspaces IP Group: %s", err) + } + + // Return nil if the IP Group is already destroyed (does not exist) + if len(resp.Result) == 0 { + return nil + } + + if *resp.Result[0].GroupId == rs.Primary.ID { + return fmt.Errorf("Workspaces IP Group %s still exists", rs.Primary.ID) + } + } + + return nil +} + +func testAccWorkspacesIpGroupConfigExists(n string, wipg *workspaces.IpGroup) resource.TestCheckFunc { + return func(s *terraform.State) error { + rs, ok := s.RootModule().Resources[n] + if !ok { + return fmt.Errorf("Not found: %s", n) + } + + if rs.Primary.ID == "" { + return fmt.Errorf("No Workpsaces IP Group ID is set") + } + + conn := testAccProvider.Meta().(*AWSClient).workspacesconn + resp, err := conn.DescribeIpGroups(&workspaces.DescribeIpGroupsInput{ + GroupIds: []*string{aws.String(rs.Primary.ID)}, + }) + + if err != nil { + return err + } + + if *resp.Result[0].GroupId == rs.Primary.ID { + wipg = &workspaces.IpGroup{ + GroupId: resp.Result[0].GroupId, + GroupName: resp.Result[0].GroupName, + GroupDesc: resp.Result[0].GroupDesc, + } + return nil + } + + return fmt.Errorf("Workspaces IP Group (%s) not found", rs.Primary.ID) + } +} + +func testAccAwsWorkspacesIpGroupConfigA(name, description string) string { + return fmt.Sprintf(` +resource "aws_workspaces_ip_group" "test" { + name = "%s" + description = "%s" + + rules { + source = "10.0.0.0/16" + } + + rules { + source = "10.0.0.1/16" + description = "Home" + } + + tags = { + Name = "Home IP Group" + } +} +`, name, description) +} + +func testAccAwsWorkspacesIpGroupConfigB(name, description string) string { + return fmt.Sprintf(` +resource "aws_workspaces_ip_group" "test" { + name = "%s" + description = "%s" + + rules { + source = "10.0.0.1/16" + description = "Home" + } + + tags = { + Owner = "Andrew" + } +} +`, name, description) +} diff --git a/aws/s3_tags.go b/aws/s3_tags.go deleted file mode 100644 index 3f99c16982d..00000000000 --- a/aws/s3_tags.go +++ /dev/null @@ -1,170 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/s3" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// 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 getTagSetS3Bucket(conn *s3.S3, bucket string) ([]*s3.Tag, error) { - resp, err := conn.GetBucketTagging(&s3.GetBucketTaggingInput{ - Bucket: aws.String(bucket), - }) - if err != nil { - if isAWSErr(err, "NoSuchTagSet", "") { - return nil, nil - } - return nil, err - } - - return resp.TagSet, nil -} - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsS3Bucket(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{}) - - // Get any existing system tags. - var sysTagSet []*s3.Tag - oTagSet, err := getTagSetS3Bucket(conn, d.Get("bucket").(string)) - if err != nil { - return fmt.Errorf("error getting S3 bucket tags: %s", err) - } - for _, tag := range oTagSet { - if tagIgnoredS3(tag) { - sysTagSet = append(sysTagSet, tag) - } - } - - if len(n)+len(sysTagSet) > 0 { - // The bucket's tag set must include any system tags that Terraform ignores. - nTagSet := append(tagsFromMapS3(n), sysTagSet...) - - req := &s3.PutBucketTaggingInput{ - Bucket: aws.String(d.Get("bucket").(string)), - Tagging: &s3.Tagging{ - TagSet: nTagSet, - }, - } - if _, err := RetryOnAwsCodes([]string{"NoSuchBucket", "OperationAborted"}, func() (interface{}, error) { - return conn.PutBucketTagging(req) - }); err != nil { - return fmt.Errorf("error setting S3 bucket tags: %s", err) - } - } else if len(o) > 0 && len(sysTagSet) == 0 { - req := &s3.DeleteBucketTaggingInput{ - Bucket: aws.String(d.Get("bucket").(string)), - } - if _, err := RetryOnAwsCodes([]string{"NoSuchBucket", "OperationAborted"}, func() (interface{}, error) { - return conn.DeleteBucketTagging(req) - }); err != nil { - return fmt.Errorf("error deleting S3 bucket tags: %s", err) - } - } - } - - return nil -} - -func getTagsS3Object(conn *s3.S3, d *schema.ResourceData) error { - resp, err := retryOnAwsCode(s3.ErrCodeNoSuchKey, func() (interface{}, error) { - return conn.GetObjectTagging(&s3.GetObjectTaggingInput{ - Bucket: aws.String(d.Get("bucket").(string)), - Key: aws.String(d.Get("key").(string)), - }) - }) - if err != nil { - return err - } - - if err := d.Set("tags", tagsToMapS3(resp.(*s3.GetObjectTaggingOutput).TagSet)); err != nil { - return err - } - - return nil -} - -func setTagsS3Object(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{}) - - // Set tags - if len(o) > 0 { - if _, err := conn.DeleteObjectTagging(&s3.DeleteObjectTaggingInput{ - Bucket: aws.String(d.Get("bucket").(string)), - Key: aws.String(d.Get("key").(string)), - }); err != nil { - return err - } - } - if len(n) > 0 { - if _, err := conn.PutObjectTagging(&s3.PutObjectTaggingInput{ - Bucket: aws.String(d.Get("bucket").(string)), - Key: aws.String(d.Get("key").(string)), - Tagging: &s3.Tagging{ - TagSet: tagsFromMapS3(n), - }, - }); err != nil { - return err - } - } - } - - return nil -} - -// 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 -} - -// 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) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/s3_tags_test.go b/aws/s3_tags_test.go deleted file mode 100644 index ec089894bae..00000000000 --- a/aws/s3_tags_test.go +++ /dev/null @@ -1,25 +0,0 @@ -package aws - -import ( - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/s3" -) - -func TestIgnoringTagsS3(t *testing.T) { - var ignoredTags []*s3.Tag - ignoredTags = append(ignoredTags, &s3.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &s3.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredS3(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/structure.go b/aws/structure.go index 52eaa1dce59..fdda9b1257f 100644 --- a/aws/structure.go +++ b/aws/structure.go @@ -4,6 +4,7 @@ import ( "bytes" "encoding/json" "fmt" + "github.com/aws/aws-sdk-go/service/quicksight" "reflect" "regexp" "sort" @@ -147,6 +148,20 @@ func expandEcsVolumes(configured []interface{}) ([]*ecs.Volume, error) { } } + efsConfig, ok := data["efs_volume_configuration"].([]interface{}) + if ok && len(efsConfig) > 0 { + config := efsConfig[0].(map[string]interface{}) + l.EfsVolumeConfiguration = &ecs.EFSVolumeConfiguration{} + + if v, ok := config["file_system_id"].(string); ok && v != "" { + l.EfsVolumeConfiguration.FileSystemId = aws.String(v) + } + + if v, ok := config["root_directory"].(string); ok && v != "" { + l.EfsVolumeConfiguration.RootDirectory = aws.String(v) + } + } + volumes = append(volumes, l) } @@ -685,6 +700,10 @@ func flattenEcsVolumes(list []*ecs.Volume) []map[string]interface{} { l["docker_volume_configuration"] = flattenDockerVolumeConfiguration(volume.DockerVolumeConfiguration) } + if volume.DockerVolumeConfiguration != nil { + l["efs_volume_configuration"] = flattenEFSVolumeConfiguration(volume.EfsVolumeConfiguration) + } + result = append(result, l) } return result @@ -694,24 +713,41 @@ func flattenDockerVolumeConfiguration(config *ecs.DockerVolumeConfiguration) []i var items []interface{} m := make(map[string]interface{}) - if config.Scope != nil { - m["scope"] = aws.StringValue(config.Scope) + if v := config.Scope; v != nil { + m["scope"] = aws.StringValue(v) } - if config.Autoprovision != nil { - m["autoprovision"] = aws.BoolValue(config.Autoprovision) + if v := config.Autoprovision; v != nil { + m["autoprovision"] = aws.BoolValue(v) } - if config.Driver != nil { - m["driver"] = aws.StringValue(config.Driver) + if v := config.Driver; v != nil { + m["driver"] = aws.StringValue(v) } if config.DriverOpts != nil { m["driver_opts"] = pointersMapToStringList(config.DriverOpts) } - if config.Labels != nil { - m["labels"] = pointersMapToStringList(config.Labels) + if v := config.Labels; v != nil { + m["labels"] = pointersMapToStringList(v) + } + + items = append(items, m) + return items +} + +func flattenEFSVolumeConfiguration(config *ecs.EFSVolumeConfiguration) []interface{} { + var items []interface{} + m := make(map[string]interface{}) + if config != nil { + if v := config.FileSystemId; v != nil { + m["file_system_id"] = aws.StringValue(v) + } + + if v := config.RootDirectory; v != nil { + m["root_directory"] = aws.StringValue(v) + } } items = append(items, m) @@ -1313,6 +1349,38 @@ func flattenESCognitoOptions(c *elasticsearch.CognitoOptions) []map[string]inter return []map[string]interface{}{m} } +func expandESDomainEndpointOptions(l []interface{}) *elasticsearch.DomainEndpointOptions { + if len(l) == 0 || l[0] == nil { + return nil + } + + m := l[0].(map[string]interface{}) + domainEndpointOptions := &elasticsearch.DomainEndpointOptions{} + + if v, ok := m["enforce_https"].(bool); ok { + domainEndpointOptions.EnforceHTTPS = aws.Bool(v) + } + + if v, ok := m["tls_security_policy"].(string); ok { + domainEndpointOptions.TLSSecurityPolicy = aws.String(v) + } + + return domainEndpointOptions +} + +func flattenESDomainEndpointOptions(domainEndpointOptions *elasticsearch.DomainEndpointOptions) []interface{} { + if domainEndpointOptions == nil { + return nil + } + + m := map[string]interface{}{ + "enforce_https": aws.BoolValue(domainEndpointOptions.EnforceHTTPS), + "tls_security_policy": aws.StringValue(domainEndpointOptions.TLSSecurityPolicy), + } + + return []interface{}{m} +} + func flattenESSnapshotOptions(snapshotOptions *elasticsearch.SnapshotOptions) []map[string]interface{} { if snapshotOptions == nil { return []map[string]interface{}{} @@ -1525,6 +1593,45 @@ func flattenLambdaEnvironment(lambdaEnv *lambda.EnvironmentResponse) []interface return []interface{}{envs} } +func expandLambdaEventSourceMappingDestinationConfig(vDest []interface{}) *lambda.DestinationConfig { + if len(vDest) == 0 { + return nil + } + + dest := &lambda.DestinationConfig{} + onFailure := &lambda.OnFailure{} + + if len(vDest) > 0 { + if config, ok := vDest[0].(map[string]interface{}); ok { + if vOnFailure, ok := config["on_failure"].([]interface{}); ok && len(vOnFailure) > 0 && vOnFailure[0] != nil { + mOnFailure := vOnFailure[0].(map[string]interface{}) + onFailure.SetDestination(mOnFailure["destination_arn"].(string)) + } + } + } + dest.SetOnFailure(onFailure) + return dest +} + +func flattenLambdaEventSourceMappingDestinationConfig(dest *lambda.DestinationConfig) []interface{} { + mDest := map[string]interface{}{} + mOnFailure := map[string]interface{}{} + if dest != nil { + if dest.OnFailure != nil { + if dest.OnFailure.Destination != nil { + mOnFailure["destination_arn"] = *dest.OnFailure.Destination + mDest["on_failure"] = []interface{}{mOnFailure} + } + } + } + + if len(mDest) == 0 { + return nil + } + + return []interface{}{mDest} +} + func flattenLambdaLayers(layers []*lambda.Layer) []interface{} { arns := make([]*string, len(layers)) for i, layer := range layers { @@ -1622,25 +1729,6 @@ func flattenAllCloudFormationParameters(cfParams []*cloudformation.Parameter) ma 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 { @@ -2740,6 +2828,10 @@ func expandCognitoUserPoolPasswordPolicy(config map[string]interface{}) *cognito configs.RequireUppercase = aws.Bool(v.(bool)) } + if v, ok := config["temporary_password_validity_days"]; ok { + configs.TemporaryPasswordValidityDays = aws.Int64(int64(v.(int))) + } + return configs } @@ -3012,6 +3104,10 @@ func flattenCognitoUserPoolPasswordPolicy(s *cognitoidentityprovider.PasswordPol m["require_uppercase"] = *s.RequireUppercase } + if s.TemporaryPasswordValidityDays != nil { + m["temporary_password_validity_days"] = *s.TemporaryPasswordValidityDays + } + if len(m) > 0 { return []map[string]interface{}{m} } @@ -3871,6 +3967,120 @@ func flattenCognitoIdentityPoolRolesAttachmentMappingRules(d []*cognitoidentity. return rules } +func diffQuickSightPermissionsToGrantAndRevoke(oldPerms []interface{}, newPerms []interface{}) ([]*quicksight.ResourcePermission, []*quicksight.ResourcePermission) { + grants := diffQuickSightPermissionsLookup(oldPerms, newPerms) + + toGrant := make([]*quicksight.ResourcePermission, 0) + toRevoke := make([]*quicksight.ResourcePermission, 0) + + for principal, actions := range grants { + grant := &quicksight.ResourcePermission{ + Principal: aws.String(principal), + Actions: make([]*string, 0), + } + revoke := &quicksight.ResourcePermission{ + Principal: aws.String(principal), + Actions: make([]*string, 0), + } + + for action, shouldGrant := range actions { + if shouldGrant { + grant.Actions = append(grant.Actions, aws.String(action)) + } else { + revoke.Actions = append(revoke.Actions, aws.String(action)) + } + } + + if len(grant.Actions) > 0 { + toGrant = append(toGrant, grant) + } + + if len(revoke.Actions) > 0 { + toRevoke = append(toRevoke, revoke) + } + } + + return toGrant, toRevoke +} + +func diffQuickSightPermissionsLookup(oldPerms []interface{}, newPerms []interface{}) map[string]map[string]bool { + // Map principal to permissions. `true` means grant, `false` means + // revoke and absence means leave alone (i.e. unchanged) + grants := make(map[string]map[string]bool) + + // All new params should be granted until further notice... + for _, v := range newPerms { + s := v.(map[string]interface{}) + + if p, ok := s["principal"].(string); ok { + if _, present := grants[p]; !present { + grants[p] = make(map[string]bool) + } + + for _, v := range s["actions"].(*schema.Set).List() { + grants[p][v.(string)] = true + } + } + } + + // Don't touch principal-action combos that are unchanged, revoke combos that + // are in old but not new + for _, v := range oldPerms { + s := v.(map[string]interface{}) + + if p, ok := s["principal"].(string); ok { + if principalGrants, present := grants[p]; present { + for _, v := range s["actions"].(*schema.Set).List() { + action := v.(string) + + if _, present := principalGrants[action]; !present { + // In old but not in new so revoke + grants[p][action] = false + } else { + // In old and in new so leave alone + delete(grants[p], action) + } + } + } else { + grants[p] = make(map[string]bool) + + // The principal is not desired in new + // permissions so revoke all + for _, v := range s["actions"].(*schema.Set).List() { + grants[p][v.(string)] = false + } + } + + } + } + + return grants +} + +func flattenQuickSightPermissions(perms []*quicksight.ResourcePermission) []map[string]interface{} { + values := make([]map[string]interface{}, 0) + + for _, v := range perms { + perm := make(map[string]interface{}) + + if v == nil { + return nil + } + + if v.Principal != nil { + perm["principal"] = *v.Principal + } + + if v.Actions != nil { + perm["actions"] = flattenStringList(v.Actions) + } + + values = append(values, perm) + } + + return values +} + func flattenRedshiftLogging(ls *redshift.LoggingStatus) []interface{} { if ls == nil { return []interface{}{} @@ -4370,10 +4580,11 @@ func flattenAwsDynamoDbTableResource(d *schema.ResourceData, table *dynamodb.Tab } sseOptions := []map[string]interface{}{} - if table.SSEDescription != nil { - m := map[string]interface{}{} - m["enabled"] = aws.StringValue(table.SSEDescription.Status) == dynamodb.SSEStatusEnabled - sseOptions = []map[string]interface{}{m} + if sseDescription := table.SSEDescription; sseDescription != nil { + sseOptions = []map[string]interface{}{{ + "enabled": aws.StringValue(sseDescription.Status) == dynamodb.SSEStatusEnabled, + "kms_key_arn": aws.StringValue(sseDescription.KMSMasterKeyArn), + }} } err = d.Set("server_side_encryption", sseOptions) if err != nil { @@ -4497,14 +4708,24 @@ func expandDynamoDbKeySchema(data map[string]interface{}) []*dynamodb.KeySchemaE return keySchema } -func expandDynamoDbEncryptAtRestOptions(m map[string]interface{}) *dynamodb.SSESpecification { - options := dynamodb.SSESpecification{} +func expandDynamoDbEncryptAtRestOptions(vOptions []interface{}) *dynamodb.SSESpecification { + options := &dynamodb.SSESpecification{} - if v, ok := m["enabled"]; ok { - options.Enabled = aws.Bool(v.(bool)) + enabled := false + if len(vOptions) > 0 { + mOptions := vOptions[0].(map[string]interface{}) + + enabled = mOptions["enabled"].(bool) + if enabled { + if vKmsKeyArn, ok := mOptions["kms_key_arn"].(string); ok && vKmsKeyArn != "" { + options.KMSMasterKeyId = aws.String(vKmsKeyArn) + options.SSEType = aws.String(dynamodb.SSETypeKms) + } + } } + options.Enabled = aws.Bool(enabled) - return &options + return options } func expandDynamoDbTableItemAttributes(input string) (map[string]*dynamodb.AttributeValue, error) { @@ -4794,9 +5015,17 @@ func flattenDaxEncryptAtRestOptions(options *dax.SSEDescription) []map[string]in return []map[string]interface{}{m} } -func expandRdsScalingConfiguration(l []interface{}) *rds.ScalingConfiguration { +func expandRdsClusterScalingConfiguration(l []interface{}, engineMode string) *rds.ScalingConfiguration { if len(l) == 0 || l[0] == nil { - return nil + // Our default value for MinCapacity is different from AWS's. + // We need to override it here to avoid a non-empty plan with an empty ScalingConfiguration. + if engineMode == "serverless" { + return &rds.ScalingConfiguration{ + MinCapacity: aws.Int64(int64(rdsClusterScalingConfiguration_DefaultMinCapacity)), + } + } else { + return nil + } } m := l[0].(map[string]interface{}) @@ -5280,6 +5509,10 @@ func expandAppmeshRouteSpec(vSpec []interface{}) *appmesh.RouteSpec { } mSpec := vSpec[0].(map[string]interface{}) + if vPriority, ok := mSpec["priority"].(int); ok && vPriority > 0 { + spec.Priority = aws.Int64(int64(vPriority)) + } + if vHttpRoute, ok := mSpec["http_route"].([]interface{}); ok && len(vHttpRoute) > 0 && vHttpRoute[0] != nil { mHttpRoute := vHttpRoute[0].(map[string]interface{}) @@ -5299,7 +5532,7 @@ func expandAppmeshRouteSpec(vSpec []interface{}) *appmesh.RouteSpec { if vVirtualNode, ok := mWeightedTarget["virtual_node"].(string); ok && vVirtualNode != "" { weightedTarget.VirtualNode = aws.String(vVirtualNode) } - if vWeight, ok := mWeightedTarget["weight"].(int); ok { + if vWeight, ok := mWeightedTarget["weight"].(int); ok && vWeight > 0 { weightedTarget.Weight = aws.Int64(int64(vWeight)) } @@ -5313,13 +5546,74 @@ func expandAppmeshRouteSpec(vSpec []interface{}) *appmesh.RouteSpec { } if vHttpRouteMatch, ok := mHttpRoute["match"].([]interface{}); ok && len(vHttpRouteMatch) > 0 && vHttpRouteMatch[0] != nil { + httpRouteMatch := &appmesh.HttpRouteMatch{} + mHttpRouteMatch := vHttpRouteMatch[0].(map[string]interface{}) + if vMethod, ok := mHttpRouteMatch["method"].(string); ok && vMethod != "" { + httpRouteMatch.Method = aws.String(vMethod) + } if vPrefix, ok := mHttpRouteMatch["prefix"].(string); ok && vPrefix != "" { - spec.HttpRoute.Match = &appmesh.HttpRouteMatch{ - Prefix: aws.String(vPrefix), + httpRouteMatch.Prefix = aws.String(vPrefix) + } + if vScheme, ok := mHttpRouteMatch["scheme"].(string); ok && vScheme != "" { + httpRouteMatch.Scheme = aws.String(vScheme) + } + + if vHttpRouteHeaders, ok := mHttpRouteMatch["header"].(*schema.Set); ok && vHttpRouteHeaders.Len() > 0 { + httpRouteHeaders := []*appmesh.HttpRouteHeader{} + + for _, vHttpRouteHeader := range vHttpRouteHeaders.List() { + httpRouteHeader := &appmesh.HttpRouteHeader{} + + mHttpRouteHeader := vHttpRouteHeader.(map[string]interface{}) + + if vInvert, ok := mHttpRouteHeader["invert"].(bool); ok { + httpRouteHeader.Invert = aws.Bool(vInvert) + } + if vName, ok := mHttpRouteHeader["name"].(string); ok && vName != "" { + httpRouteHeader.Name = aws.String(vName) + } + + if vMatch, ok := mHttpRouteHeader["match"].([]interface{}); ok && len(vMatch) > 0 && vMatch[0] != nil { + httpRouteHeader.Match = &appmesh.HeaderMatchMethod{} + + mMatch := vMatch[0].(map[string]interface{}) + + if vExact, ok := mMatch["exact"].(string); ok && vExact != "" { + httpRouteHeader.Match.Exact = aws.String(vExact) + } + if vPrefix, ok := mMatch["prefix"].(string); ok && vPrefix != "" { + httpRouteHeader.Match.Prefix = aws.String(vPrefix) + } + if vRegex, ok := mMatch["regex"].(string); ok && vRegex != "" { + httpRouteHeader.Match.Regex = aws.String(vRegex) + } + if vSuffix, ok := mMatch["suffix"].(string); ok && vSuffix != "" { + httpRouteHeader.Match.Suffix = aws.String(vSuffix) + } + + if vRange, ok := mMatch["range"].([]interface{}); ok && len(vRange) > 0 && vRange[0] != nil { + httpRouteHeader.Match.Range = &appmesh.MatchRange{} + + mRange := vRange[0].(map[string]interface{}) + + if vEnd, ok := mRange["end"].(int); ok && vEnd > 0 { + httpRouteHeader.Match.Range.End = aws.Int64(int64(vEnd)) + } + if vStart, ok := mRange["start"].(int); ok && vStart > 0 { + httpRouteHeader.Match.Range.Start = aws.Int64(int64(vStart)) + } + } + } + + httpRouteHeaders = append(httpRouteHeaders, httpRouteHeader) } + + httpRouteMatch.Headers = httpRouteHeaders } + + spec.HttpRoute.Match = httpRouteMatch } } @@ -5342,7 +5636,7 @@ func expandAppmeshRouteSpec(vSpec []interface{}) *appmesh.RouteSpec { if vVirtualNode, ok := mWeightedTarget["virtual_node"].(string); ok && vVirtualNode != "" { weightedTarget.VirtualNode = aws.String(vVirtualNode) } - if vWeight, ok := mWeightedTarget["weight"].(int); ok { + if vWeight, ok := mWeightedTarget["weight"].(int); ok && vWeight > 0 { weightedTarget.Weight = aws.Int64(int64(vWeight)) } @@ -5364,34 +5658,72 @@ func flattenAppmeshRouteSpec(spec *appmesh.RouteSpec) []interface{} { return []interface{}{} } - mSpec := map[string]interface{}{} + mSpec := map[string]interface{}{ + "priority": int(aws.Int64Value(spec.Priority)), + } - if spec.HttpRoute != nil { + if httpRoute := spec.HttpRoute; httpRoute != nil { mHttpRoute := map[string]interface{}{} - if spec.HttpRoute.Action != nil && spec.HttpRoute.Action.WeightedTargets != nil { - vWeightedTargets := []interface{}{} + if action := httpRoute.Action; action != nil { + if weightedTargets := action.WeightedTargets; weightedTargets != nil { + vWeightedTargets := []interface{}{} - for _, weightedTarget := range spec.HttpRoute.Action.WeightedTargets { - mWeightedTarget := map[string]interface{}{ - "virtual_node": aws.StringValue(weightedTarget.VirtualNode), - "weight": int(aws.Int64Value(weightedTarget.Weight)), + for _, weightedTarget := range weightedTargets { + mWeightedTarget := map[string]interface{}{ + "virtual_node": aws.StringValue(weightedTarget.VirtualNode), + "weight": int(aws.Int64Value(weightedTarget.Weight)), + } + + vWeightedTargets = append(vWeightedTargets, mWeightedTarget) } - vWeightedTargets = append(vWeightedTargets, mWeightedTarget) + mHttpRoute["action"] = []interface{}{ + map[string]interface{}{ + "weighted_target": schema.NewSet(appmeshWeightedTargetHash, vWeightedTargets), + }, + } } + } - mHttpRoute["action"] = []interface{}{ - map[string]interface{}{ - "weighted_target": schema.NewSet(appmeshRouteWeightedTargetHash, vWeightedTargets), - }, + if httpRouteMatch := httpRoute.Match; httpRouteMatch != nil { + vHttpRouteHeaders := []interface{}{} + + for _, httpRouteHeader := range httpRouteMatch.Headers { + mHttpRouteHeader := map[string]interface{}{ + "invert": aws.BoolValue(httpRouteHeader.Invert), + "name": aws.StringValue(httpRouteHeader.Name), + } + + if match := httpRouteHeader.Match; match != nil { + mMatch := map[string]interface{}{ + "exact": aws.StringValue(match.Exact), + "prefix": aws.StringValue(match.Prefix), + "regex": aws.StringValue(match.Regex), + "suffix": aws.StringValue(match.Suffix), + } + + if r := match.Range; r != nil { + mRange := map[string]interface{}{ + "end": int(aws.Int64Value(r.End)), + "start": int(aws.Int64Value(r.Start)), + } + + mMatch["range"] = []interface{}{mRange} + } + + mHttpRouteHeader["match"] = []interface{}{mMatch} + } + + vHttpRouteHeaders = append(vHttpRouteHeaders, mHttpRouteHeader) } - } - if spec.HttpRoute.Match != nil { mHttpRoute["match"] = []interface{}{ map[string]interface{}{ - "prefix": aws.StringValue(spec.HttpRoute.Match.Prefix), + "header": schema.NewSet(appmeshHttpRouteHeaderHash, vHttpRouteHeaders), + "method": aws.StringValue(httpRouteMatch.Method), + "prefix": aws.StringValue(httpRouteMatch.Prefix), + "scheme": aws.StringValue(httpRouteMatch.Scheme), }, } } @@ -5399,25 +5731,27 @@ func flattenAppmeshRouteSpec(spec *appmesh.RouteSpec) []interface{} { mSpec["http_route"] = []interface{}{mHttpRoute} } - if spec.TcpRoute != nil { + if tcpRoute := spec.TcpRoute; tcpRoute != nil { mTcpRoute := map[string]interface{}{} - if spec.TcpRoute.Action != nil && spec.TcpRoute.Action.WeightedTargets != nil { - vWeightedTargets := []interface{}{} + if action := tcpRoute.Action; action != nil { + if weightedTargets := action.WeightedTargets; weightedTargets != nil { + vWeightedTargets := []interface{}{} - for _, weightedTarget := range spec.TcpRoute.Action.WeightedTargets { - mWeightedTarget := map[string]interface{}{ - "virtual_node": aws.StringValue(weightedTarget.VirtualNode), - "weight": int(aws.Int64Value(weightedTarget.Weight)), - } + for _, weightedTarget := range weightedTargets { + mWeightedTarget := map[string]interface{}{ + "virtual_node": aws.StringValue(weightedTarget.VirtualNode), + "weight": int(aws.Int64Value(weightedTarget.Weight)), + } - vWeightedTargets = append(vWeightedTargets, mWeightedTarget) - } + vWeightedTargets = append(vWeightedTargets, mWeightedTarget) + } - mTcpRoute["action"] = []interface{}{ - map[string]interface{}{ - "weighted_target": schema.NewSet(appmeshRouteWeightedTargetHash, vWeightedTargets), - }, + mTcpRoute["action"] = []interface{}{ + map[string]interface{}{ + "weighted_target": schema.NewSet(appmeshWeightedTargetHash, vWeightedTargets), + }, + } } } diff --git a/aws/structure_test.go b/aws/structure_test.go index dcc487b4f34..ab8c416a3d0 100644 --- a/aws/structure_test.go +++ b/aws/structure_test.go @@ -13,6 +13,7 @@ import ( "github.com/aws/aws-sdk-go/service/elasticache" "github.com/aws/aws-sdk-go/service/elb" "github.com/aws/aws-sdk-go/service/kinesis" + "github.com/aws/aws-sdk-go/service/organizations" "github.com/aws/aws-sdk-go/service/rds" "github.com/aws/aws-sdk-go/service/redshift" "github.com/aws/aws-sdk-go/service/route53" @@ -418,6 +419,29 @@ func TestFlattenHealthCheck(t *testing.T) { } } +func TestFlattenOrganizationsOrganizationalUnits(t *testing.T) { + input := []*organizations.OrganizationalUnit{ + { + Arn: aws.String("arn:aws:organizations::123456789012:ou/o-abcde12345/ou-ab12-abcd1234"), + Id: aws.String("ou-ab12-abcd1234"), + Name: aws.String("Engineering"), + }, + } + + expected_output := []map[string]interface{}{ + { + "arn": "arn:aws:organizations::123456789012:ou/o-abcde12345/ou-ab12-abcd1234", + "id": "ou-ab12-abcd1234", + "name": "Engineering", + }, + } + + output := flattenOrganizationsOrganizationalUnits(input) + if !reflect.DeepEqual(expected_output, output) { + t.Fatalf("Got:\n\n%#v\n\nExpected:\n\n%#v", output, expected_output) + } +} + func TestExpandStringList(t *testing.T) { expanded := []interface{}{"us-east-1a", "us-east-1b"} stringList := expandStringList(expanded) @@ -1521,3 +1545,102 @@ const testExampleXML_from_msdn_flawed = ` ` + +func TestExpandRdsClusterScalingConfiguration_serverless(t *testing.T) { + type testCase struct { + EngineMode string + Input []interface{} + Expected *rds.ScalingConfiguration + } + cases := []testCase{ + { + EngineMode: "serverless", + Input: []interface{}{ + map[string]interface{}{ + "auto_pause": false, + "max_capacity": 32, + "min_capacity": 4, + "seconds_until_auto_pause": 600, + "timeout_action": "ForceApplyCapacityChange", + }, + }, + Expected: &rds.ScalingConfiguration{ + AutoPause: aws.Bool(false), + MaxCapacity: aws.Int64(32), + MinCapacity: aws.Int64(4), + SecondsUntilAutoPause: aws.Int64(600), + TimeoutAction: aws.String("ForceApplyCapacityChange"), + }, + }, + { + EngineMode: "serverless", + Input: []interface{}{}, + Expected: &rds.ScalingConfiguration{ + MinCapacity: aws.Int64(2), + }, + }, + { + EngineMode: "serverless", + Input: []interface{}{ + nil, + }, + Expected: &rds.ScalingConfiguration{ + MinCapacity: aws.Int64(2), + }, + }, + } + + for _, tc := range cases { + output := expandRdsClusterScalingConfiguration(tc.Input, tc.EngineMode) + if !reflect.DeepEqual(output, tc.Expected) { + t.Errorf("EngineMode: %s\nExpected: %v,\nGot: %v", tc.EngineMode, tc.Expected, output) + } + } +} + +func TestExpandRdsClusterScalingConfiguration_basic(t *testing.T) { + type testCase struct { + EngineMode string + Input []interface{} + ExpectNil bool + } + cases := []testCase{} + + // RDS Cluster Scaling Configuration is only valid for serverless, but we're relying on AWS errors. + // If Terraform adds whole-resource validation, we can do our own validation at plan time. + for _, engineMode := range []string{"global", "multimaster", "parallelquery", "provisioned"} { + cases = append(cases, []testCase{ + { + EngineMode: engineMode, + Input: []interface{}{ + map[string]interface{}{ + "auto_pause": false, + "max_capacity": 32, + "min_capacity": 4, + "seconds_until_auto_pause": 600, + "timeout_action": "ForceApplyCapacityChange", + }, + }, + ExpectNil: false, + }, + { + EngineMode: engineMode, + Input: []interface{}{}, + ExpectNil: true, + }, { + EngineMode: engineMode, + Input: []interface{}{ + nil, + }, + ExpectNil: true, + }, + }...) + } + + for _, tc := range cases { + output := expandRdsClusterScalingConfiguration(tc.Input, tc.EngineMode) + if tc.ExpectNil != (output == nil) { + t.Errorf("EngineMode %q: Expected nil: %t, Got: %v", tc.EngineMode, tc.ExpectNil, output) + } + } +} diff --git a/aws/tags.go b/aws/tags.go index ea003997197..db1f5438c4a 100644 --- a/aws/tags.go +++ b/aws/tags.go @@ -1,7 +1,6 @@ package aws import ( - "fmt" "log" "regexp" "strings" @@ -10,10 +9,9 @@ import ( "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/elbv2" - "github.com/hashicorp/terraform-plugin-sdk/helper/hashcode" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" ) // tagsSchema returns the schema to use for tags. @@ -41,124 +39,6 @@ func tagsSchemaForceNew() *schema.Schema { } } -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 -} - -func setVolumeTags(conn *ec2.EC2, d *schema.ResourceData) error { - if d.HasChange("volume_tags") { - oraw, nraw := d.GetChange("volume_tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTags(tagsFromMap(o), tagsFromMap(n)) - - volumeIds, err := getAwsInstanceVolumeIds(conn, d) - if err != nil { - return err - } - - if len(remove) > 0 { - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] Removing volume tags: %#v from %s", remove, d.Id()) - _, err := conn.DeleteTags(&ec2.DeleteTagsInput{ - Resources: volumeIds, - 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 { - // Retry without time bounds for EC2 throttling - if isResourceTimeoutError(err) { - log.Printf("[DEBUG] Removing volume tags: %#v from %s", remove, d.Id()) - _, err := conn.DeleteTags(&ec2.DeleteTagsInput{ - Resources: volumeIds, - Tags: remove, - }) - if err != nil { - return err - } - } else { - return err - } - } - } - if len(create) > 0 { - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] Creating vol tags: %s for %s", create, d.Id()) - _, err := conn.CreateTags(&ec2.CreateTagsInput{ - Resources: volumeIds, - 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 { - // Retry without time bounds for EC2 throttling - if isResourceTimeoutError(err) { - log.Printf("[DEBUG] Creating vol tags: %s for %s", create, d.Id()) - _, err := conn.CreateTags(&ec2.CreateTagsInput{ - Resources: volumeIds, - Tags: create, - }) - if err != nil { - return err - } - } else { - 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 { @@ -291,54 +171,6 @@ func tagsToMap(ts []*ec2.Tag) map[string]string { 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 { @@ -354,41 +186,25 @@ func tagIgnored(t *ec2.Tag) bool { 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) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} - -// tagsMapToHash returns a stable hash value for a raw tags map. -// The returned value map be negative (i.e. not suitable for a 'Set' function). -func tagsMapToHash(tags map[string]interface{}) int { - total := 0 - for k, v := range tags { - total = total ^ hashcode.String(fmt.Sprintf("%s-%s", k, v)) +// ec2TagsFromTagDescriptions returns the tags from the given tag descriptions. +// No attempt is made to remove duplicates. +func ec2TagsFromTagDescriptions(tds []*ec2.TagDescription) []*ec2.Tag { + if len(tds) == 0 { + return nil } - return total -} -// tagsMapToRaw converts a tags map to its "raw" type. -func tagsMapToRaw(m map[string]string) map[string]interface{} { - raw := make(map[string]interface{}) - for k, v := range m { - raw[k] = v + tags := []*ec2.Tag{} + for _, td := range tds { + tags = append(tags, &ec2.Tag{ + Key: td.Key, + Value: td.Value, + }) } - return raw + return tags } -// ec2TagSpecificationsFromMap returns the tag specifications for the given map of data m and resource type t. +// ec2TagSpecificationsFromMap returns the tag specifications for the given tag key/value map and resource type. func ec2TagSpecificationsFromMap(m map[string]interface{}, t string) []*ec2.TagSpecification { if len(m) == 0 { return nil @@ -397,7 +213,7 @@ func ec2TagSpecificationsFromMap(m map[string]interface{}, t string) []*ec2.TagS return []*ec2.TagSpecification{ { ResourceType: aws.String(t), - Tags: tagsFromMap(m), + Tags: keyvaluetags.New(m).IgnoreAws().Ec2Tags(), }, } } diff --git a/aws/tagsACM.go b/aws/tagsACM.go deleted file mode 100644 index 2cddba0fef6..00000000000 --- a/aws/tagsACM.go +++ /dev/null @@ -1,88 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/acm" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func setTagsACM(conn *acm.ACM, 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 := diffTagsACM(tagsFromMapACM(o), tagsFromMapACM(n)) - - // Set tags - if len(remove) > 0 { - input := acm.RemoveTagsFromCertificateInput{ - CertificateArn: aws.String(d.Get("arn").(string)), - Tags: remove, - } - log.Printf("[DEBUG] Removing ACM tags: %s", input) - _, err := conn.RemoveTagsFromCertificate(&input) - if err != nil { - return err - } - } - if len(create) > 0 { - input := acm.AddTagsToCertificateInput{ - CertificateArn: aws.String(d.Get("arn").(string)), - Tags: create, - } - log.Printf("[DEBUG] Adding ACM tags: %s", input) - _, err := conn.AddTagsToCertificate(&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 diffTagsACM(oldTags, newTags []*acm.Tag) ([]*acm.Tag, []*acm.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 []*acm.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapACM(create), remove -} - -func tagsFromMapACM(m map[string]interface{}) []*acm.Tag { - result := []*acm.Tag{} - for k, v := range m { - result = append(result, &acm.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - }) - } - - return result -} - -func tagsToMapACM(ts []*acm.Tag) map[string]string { - result := map[string]string{} - for _, t := range ts { - result[*t.Key] = *t.Value - } - - return result -} diff --git a/aws/tagsACMPCA.go b/aws/tagsACMPCA.go deleted file mode 100644 index f497f3aee5b..00000000000 --- a/aws/tagsACMPCA.go +++ /dev/null @@ -1,50 +0,0 @@ -package aws - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/acmpca" -) - -// 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 diffTagsACMPCA(oldTags, newTags []*acmpca.Tag) ([]*acmpca.Tag, []*acmpca.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*acmpca.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapACMPCA(create), remove -} - -func tagsFromMapACMPCA(m map[string]interface{}) []*acmpca.Tag { - result := []*acmpca.Tag{} - for k, v := range m { - result = append(result, &acmpca.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - }) - } - - return result -} - -func tagsToMapACMPCA(ts []*acmpca.Tag) map[string]string { - result := map[string]string{} - for _, t := range ts { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - return result -} diff --git a/aws/tagsACMPCA_test.go b/aws/tagsACMPCA_test.go deleted file mode 100644 index 9c3183be494..00000000000 --- a/aws/tagsACMPCA_test.go +++ /dev/null @@ -1,57 +0,0 @@ -package aws - -import ( - "reflect" - "testing" -) - -func TestDiffTagsACMPCA(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsACMPCA(tagsFromMapACMPCA(tc.Old), tagsFromMapACMPCA(tc.New)) - cm := tagsToMapACMPCA(c) - rm := tagsToMapACMPCA(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} diff --git a/aws/tagsACM_test.go b/aws/tagsACM_test.go deleted file mode 100644 index 6c5ec130f3a..00000000000 --- a/aws/tagsACM_test.go +++ /dev/null @@ -1,57 +0,0 @@ -package aws - -import ( - "reflect" - "testing" -) - -func TestDiffTagsACM(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsACM(tagsFromMapACM(tc.Old), tagsFromMapACM(tc.New)) - cm := tagsToMapACM(c) - rm := tagsToMapACM(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} diff --git a/aws/tagsAppmesh.go b/aws/tagsAppmesh.go deleted file mode 100644 index 1c759926649..00000000000 --- a/aws/tagsAppmesh.go +++ /dev/null @@ -1,131 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/appmesh" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsAppmesh(conn *appmesh.AppMesh, 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 := diffTagsAppmesh(tagsFromMapAppmesh(o), tagsFromMapAppmesh(n)) - - // Set tags - if len(remove) > 0 { - input := appmesh.UntagResourceInput{ - ResourceArn: aws.String(arn), - TagKeys: remove, - } - log.Printf("[DEBUG] Removing Appmesh tags: %s", input) - _, err := conn.UntagResource(&input) - if err != nil { - return err - } - } - if len(create) > 0 { - input := appmesh.TagResourceInput{ - ResourceArn: aws.String(arn), - Tags: create, - } - log.Printf("[DEBUG] Adding Appmesh tags: %s", input) - _, err := conn.TagResource(&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 diffTagsAppmesh(oldTags, newTags []*appmesh.TagRef) ([]*appmesh.TagRef, []*string) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*string - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - remove = append(remove, t.Key) - } else if ok { - // already present so remove from new - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapAppmesh(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapAppmesh(m map[string]interface{}) []*appmesh.TagRef { - var result []*appmesh.TagRef - for k, v := range m { - t := &appmesh.TagRef{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredAppmesh(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapAppmesh(ts []*appmesh.TagRef) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredAppmesh(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -func saveTagsAppmesh(conn *appmesh.AppMesh, d *schema.ResourceData, arn string) error { - resp, err := conn.ListTagsForResource(&appmesh.ListTagsForResourceInput{ - ResourceArn: aws.String(arn), - }) - if err != nil { - return err - } - - var dt []*appmesh.TagRef - if len(resp.Tags) > 0 { - dt = resp.Tags - } - - return d.Set("tags", tagsToMapAppmesh(dt)) -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredAppmesh(t *appmesh.TagRef) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, aws.StringValue(t.Key)) - r, _ := regexp.MatchString(v, aws.StringValue(t.Key)) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", aws.StringValue(t.Key), aws.StringValue(t.Value)) - return true - } - } - return false -} diff --git a/aws/tagsAppmesh_test.go b/aws/tagsAppmesh_test.go deleted file mode 100644 index 0351979bf6c..00000000000 --- a/aws/tagsAppmesh_test.go +++ /dev/null @@ -1,113 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/appmesh" -) - -func TestDiffAppmeshTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create map[string]string - Remove []string - }{ - // Add - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: []string{}, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: []string{ - "foo", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: []string{ - "foo", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: []string{ - "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsAppmesh(tagsFromMapAppmesh(tc.Old), tagsFromMapAppmesh(tc.New)) - cm := tagsToMapAppmesh(c) - rl := []string{} - for _, tagName := range r { - rl = append(rl, *tagName) - } - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rl, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rl) - } - } -} - -func TestIgnoringTagsAppmesh(t *testing.T) { - var ignoredTags []*appmesh.TagRef - ignoredTags = append(ignoredTags, &appmesh.TagRef{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &appmesh.TagRef{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredAppmesh(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsAppsync.go b/aws/tagsAppsync.go deleted file mode 100644 index ba038595c78..00000000000 --- a/aws/tagsAppsync.go +++ /dev/null @@ -1,50 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/appsync" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func setTagsAppsync(conn *appsync.AppSync, 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 := diffTagsGeneric(o, n) - - // remove old tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - keys := make([]*string, 0, len(remove)) - for k := range remove { - keys = append(keys, aws.String(k)) - } - - _, err := conn.UntagResource(&appsync.UntagResourceInput{ - ResourceArn: aws.String(arn), - TagKeys: keys, - }) - if err != nil { - return err - } - } - - // create new tags - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - - _, err := conn.TagResource(&appsync.TagResourceInput{ - ResourceArn: aws.String(arn), - Tags: create, - }) - if err != nil { - return err - } - } - } - - return nil -} diff --git a/aws/tagsBeanstalk.go b/aws/tagsBeanstalk.go deleted file mode 100644 index cbb78c986ce..00000000000 --- a/aws/tagsBeanstalk.go +++ /dev/null @@ -1,113 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/elasticbeanstalk" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// saveTagsBeanstalk is a helper to save the tags for a resource. It expects the -// tags field to be named "tags" -func saveTagsBeanstalk(conn *elasticbeanstalk.ElasticBeanstalk, d *schema.ResourceData, arn string) error { - resp, err := conn.ListTagsForResource(&elasticbeanstalk.ListTagsForResourceInput{ - ResourceArn: aws.String(arn), - }) - if err != nil { - return err - } - - if err := d.Set("tags", tagsToMapBeanstalk(resp.ResourceTags)); 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 setTagsBeanstalk(conn *elasticbeanstalk.ElasticBeanstalk, 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{}) - add, remove := diffTagsBeanstalk(tagsFromMapBeanstalk(o), tagsFromMapBeanstalk(n)) - - if _, err := conn.UpdateTagsForResource(&elasticbeanstalk.UpdateTagsForResourceInput{ - ResourceArn: aws.String(arn), - TagsToAdd: add, - TagsToRemove: remove, - }); 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 diffTagsBeanstalk(oldTags, newTags []*elasticbeanstalk.Tag) ([]*elasticbeanstalk.Tag, []*string) { - // 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 []*string - for _, t := range oldTags { - if _, ok := create[*t.Key]; !ok { - // Delete it! - remove = append(remove, t.Key) - } - } - - 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:", "^elasticbeanstalk:", "Name"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsBeanstalk_test.go b/aws/tagsBeanstalk_test.go deleted file mode 100644 index 46ebfb23755..00000000000 --- a/aws/tagsBeanstalk_test.go +++ /dev/null @@ -1,79 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/elasticbeanstalk" -) - -func TestDiffBeanstalkTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create map[string]string - Remove []string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: []string{ - "foo", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: []string{}, - }, - } - - for i, tc := range cases { - c, r := diffTagsBeanstalk(tagsFromMapBeanstalk(tc.Old), tagsFromMapBeanstalk(tc.New)) - cm := tagsToMapBeanstalk(c) - rl := []string{} - for _, tagName := range r { - rl = append(rl, *tagName) - } - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rl, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rl) - } - } -} - -func TestIgnoringTagsBeanstalk(t *testing.T) { - var ignoredTags []*elasticbeanstalk.Tag - ignoredTags = append(ignoredTags, &elasticbeanstalk.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &elasticbeanstalk.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredBeanstalk(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsCloudFront.go b/aws/tagsCloudFront.go deleted file mode 100644 index 5faa4db5f02..00000000000 --- a/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-plugin-sdk/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/aws/tagsCloudWatch.go b/aws/tagsCloudWatch.go deleted file mode 100644 index 465bdf9d60b..00000000000 --- a/aws/tagsCloudWatch.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/cloudwatch" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsCloudWatch(conn *cloudwatch.CloudWatch, 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 := diffTagsCloudWatch(tagsFromMapCloudWatch(o), tagsFromMapCloudWatch(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.UntagResource(&cloudwatch.UntagResourceInput{ - ResourceARN: aws.String(arn), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&cloudwatch.TagResourceInput{ - ResourceARN: 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 diffTagsCloudWatch(oldTags, newTags []*cloudwatch.Tag) ([]*cloudwatch.Tag, []*cloudwatch.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 []*cloudwatch.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapCloudWatch(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapCloudWatch(m map[string]interface{}) []*cloudwatch.Tag { - var result []*cloudwatch.Tag - for k, v := range m { - t := &cloudwatch.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredCloudWatch(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapCloudWatch(ts []*cloudwatch.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredCloudWatch(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -func saveTagsCloudWatch(conn *cloudwatch.CloudWatch, d *schema.ResourceData, arn string) error { - resp, err := conn.ListTagsForResource(&cloudwatch.ListTagsForResourceInput{ - ResourceARN: aws.String(arn), - }) - - if err != nil { - return fmt.Errorf("Error retreiving tags for ARN(%s): %s", arn, err) - } - - var tagList []*cloudwatch.Tag - if len(resp.Tags) > 0 { - tagList = resp.Tags - } - - return d.Set("tags", tagsToMapCloudWatch(tagList)) -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredCloudWatch(t *cloudwatch.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsCloudWatchEvent.go b/aws/tagsCloudWatchEvent.go deleted file mode 100644 index 0387786ad1a..00000000000 --- a/aws/tagsCloudWatchEvent.go +++ /dev/null @@ -1,133 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - events "github.com/aws/aws-sdk-go/service/cloudwatchevents" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsCloudWatchEvents(conn *events.CloudWatchEvents, 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 := diffTagsCloudWatchEvents(tagsFromMapCloudWatchEvents(o), tagsFromMapCloudWatchEvents(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.UntagResource(&events.UntagResourceInput{ - ResourceARN: aws.String(arn), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&events.TagResourceInput{ - ResourceARN: 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 diffTagsCloudWatchEvents(oldTags, newTags []*events.Tag) ([]*events.Tag, []*events.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 []*events.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapCloudWatchEvents(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapCloudWatchEvents(m map[string]interface{}) []*events.Tag { - var result []*events.Tag - for k, v := range m { - t := &events.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredCloudWatchEvents(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapCloudWatchEvents(ts []*events.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredCloudWatchEvents(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -func saveTagsCloudWatchEvents(conn *events.CloudWatchEvents, d *schema.ResourceData, arn string) error { - resp, err := conn.ListTagsForResource(&events.ListTagsForResourceInput{ - ResourceARN: aws.String(arn), - }) - - if err != nil && !isAWSErr(err, "UnknownOperationException", "") { - return fmt.Errorf("Error retreiving tags for %s: %s", arn, err) - } - - var tagList []*events.Tag - if resp != nil && len(resp.Tags) > 0 { - tagList = resp.Tags - } - - return d.Set("tags", tagsToMapCloudWatchEvents(tagList)) -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredCloudWatchEvents(t *events.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsCloudWatchEvent_test.go b/aws/tagsCloudWatchEvent_test.go deleted file mode 100644 index 9c8b8938631..00000000000 --- a/aws/tagsCloudWatchEvent_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - events "github.com/aws/aws-sdk-go/service/cloudwatchevents" -) - -func TestDiffCloudWatchEventTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsCloudWatchEvents(tagsFromMapCloudWatchEvents(tc.Old), tagsFromMapCloudWatchEvents(tc.New)) - cm := tagsToMapCloudWatchEvents(c) - rm := tagsToMapCloudWatchEvents(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsCloudWatchEvents(t *testing.T) { - var ignoredTags []*events.Tag - ignoredTags = append(ignoredTags, &events.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &events.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredCloudWatchEvents(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsCloudWatch_test.go b/aws/tagsCloudWatch_test.go deleted file mode 100644 index ff8d173bab7..00000000000 --- a/aws/tagsCloudWatch_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudwatch" -) - -func TestDiffCloudWatchTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsCloudWatch(tagsFromMapCloudWatch(tc.Old), tagsFromMapCloudWatch(tc.New)) - cm := tagsToMapCloudWatch(c) - rm := tagsToMapCloudWatch(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsCloudWatch(t *testing.T) { - var ignoredTags []*cloudwatch.Tag - ignoredTags = append(ignoredTags, &cloudwatch.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &cloudwatch.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredCloudWatch(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsCloudtrail.go b/aws/tagsCloudtrail.go deleted file mode 100644 index 4636f71bc09..00000000000 --- a/aws/tagsCloudtrail.go +++ /dev/null @@ -1,113 +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-plugin-sdk/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) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsCloudtrail_test.go b/aws/tagsCloudtrail_test.go deleted file mode 100644 index 0bfe1a28463..00000000000 --- a/aws/tagsCloudtrail_test.go +++ /dev/null @@ -1,91 +0,0 @@ -package aws - -import ( - "fmt" - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cloudtrail" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" -) - -func TestDiffCloudtrailTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsCloudtrail(tagsFromMapCloudtrail(tc.Old), tagsFromMapCloudtrail(tc.New)) - cm := tagsToMapCloudtrail(c) - rm := tagsToMapCloudtrail(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsCloudtrail(t *testing.T) { - var ignoredTags []*cloudtrail.Tag - ignoredTags = append(ignoredTags, &cloudtrail.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &cloudtrail.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredCloudtrail(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} - -// testAccCheckCloudTrailCheckTags can be used to check the tags on a trail -func testAccCheckCloudTrailCheckTags(tags *[]*cloudtrail.Tag, expectedTags map[string]string) resource.TestCheckFunc { - return func(s *terraform.State) error { - if !reflect.DeepEqual(expectedTags, tagsToMapCloudtrail(*tags)) { - return fmt.Errorf("Tags mismatch.\nExpected: %#v\nGiven: %#v", - expectedTags, tagsToMapCloudtrail(*tags)) - } - return nil - } -} diff --git a/aws/tagsCodeBuild.go b/aws/tagsCodeBuild.go deleted file mode 100644 index 0a300697239..00000000000 --- a/aws/tagsCodeBuild.go +++ /dev/null @@ -1,27 +0,0 @@ -package aws - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/codebuild" -) - -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 -} diff --git a/aws/tagsCodeCommit.go b/aws/tagsCodeCommit.go deleted file mode 100644 index adc975d8c22..00000000000 --- a/aws/tagsCodeCommit.go +++ /dev/null @@ -1,107 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/codecommit" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsCodeCommit(conn *codecommit.CodeCommit, 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 := diffTagsCodeCommit(tagsFromMapCodeCommit(o), tagsFromMapCodeCommit(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - keys := make([]*string, 0, len(remove)) - for k := range remove { - keys = append(keys, aws.String(k)) - } - - _, err := conn.UntagResource(&codecommit.UntagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - TagKeys: keys, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&codecommit.TagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(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 diffTagsCodeCommit(oldTags, newTags map[string]*string) (map[string]*string, map[string]*string) { - // Build the list of what to remove - remove := make(map[string]*string) - for k, v := range oldTags { - newVal, existsInNew := newTags[k] - if !existsInNew || *newVal != *v { - // Delete it! - remove[k] = v - } else if existsInNew { - delete(newTags, k) - } - } - return newTags, remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapCodeCommit(m map[string]interface{}) map[string]*string { - result := make(map[string]*string) - for k, v := range m { - if !tagIgnoredCodeCommit(k, v.(string)) { - result[k] = aws.String(v.(string)) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapCodeCommit(ts map[string]*string) map[string]string { - result := make(map[string]string) - for k, v := range ts { - if !tagIgnoredCodeCommit(k, aws.StringValue(v)) { - result[k] = aws.StringValue(v) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredCodeCommit(key, value string) bool { - filter := []string{"^aws:"} - for _, ignore := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", ignore, key) - r, _ := regexp.MatchString(ignore, key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val %s), ignoring.\n", key, value) - return true - } - } - return false -} diff --git a/aws/tagsCodeCommit_test.go b/aws/tagsCodeCommit_test.go deleted file mode 100644 index 2c6a3e4cad0..00000000000 --- a/aws/tagsCodeCommit_test.go +++ /dev/null @@ -1,104 +0,0 @@ -package aws - -import ( - "reflect" - "testing" -) - -// go test -v -run="TestDiffCodeCommitTags" -func TestDiffCodeCommitTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsCodeCommit(tagsFromMapCodeCommit(tc.Old), tagsFromMapCodeCommit(tc.New)) - cm := tagsToMapCodeCommit(c) - rm := tagsToMapCodeCommit(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsCodeCommit" -func TestIgnoringTagsCodeCommit(t *testing.T) { - ignoredTags := map[string]string{ - "aws:cloudformation:logical-id": "foo", - "aws:foo:bar": "baz", - } - for k, v := range ignoredTags { - if !tagIgnoredCodeCommit(k, v) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", k, v) - } - } -} diff --git a/aws/tagsCodePipeline.go b/aws/tagsCodePipeline.go deleted file mode 100644 index 36f8fca2a0f..00000000000 --- a/aws/tagsCodePipeline.go +++ /dev/null @@ -1,137 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/codepipeline" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsCodePipeline(conn *codepipeline.CodePipeline, 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 := diffTagsCodePipeline(tagsFromMapCodePipeline(o), tagsFromMapCodePipeline(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.UntagResource(&codepipeline.UntagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&codepipeline.TagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(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 diffTagsCodePipeline(oldTags, newTags []*codepipeline.Tag) ([]*codepipeline.Tag, []*codepipeline.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*codepipeline.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } else if ok { - // already present so remove from new - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapCodePipeline(create), remove -} - -func saveTagsCodePipeline(conn *codepipeline.CodePipeline, d *schema.ResourceData) error { - resp, err := conn.ListTagsForResource(&codepipeline.ListTagsForResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - }) - - if err != nil { - return fmt.Errorf("Error retreiving tags for ARN: %s", d.Get("arn").(string)) - } - - var dt []*codepipeline.Tag - if len(resp.Tags) > 0 { - dt = resp.Tags - } - - return d.Set("tags", tagsToMapCodePipeline(dt)) -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapCodePipeline(m map[string]interface{}) []*codepipeline.Tag { - result := make([]*codepipeline.Tag, 0, len(m)) - for k, v := range m { - t := &codepipeline.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredCodePipeline(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapCodePipeline(ts []*codepipeline.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredCodePipeline(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredCodePipeline(t *codepipeline.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, aws.StringValue(t.Key)) - r, _ := regexp.MatchString(v, aws.StringValue(t.Key)) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", aws.StringValue(t.Key), aws.StringValue(t.Value)) - return true - } - } - return false -} diff --git a/aws/tagsCodePipeline_test.go b/aws/tagsCodePipeline_test.go deleted file mode 100644 index a47c839cd45..00000000000 --- a/aws/tagsCodePipeline_test.go +++ /dev/null @@ -1,112 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/codepipeline" -) - -// go test -v -run="TestDiffCodePipelineTags" -func TestDiffCodePipelineTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsCodePipeline(tagsFromMapCodePipeline(tc.Old), tagsFromMapCodePipeline(tc.New)) - cm := tagsToMapCodePipeline(c) - rm := tagsToMapCodePipeline(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsCodePipeline" -func TestIgnoringTagsCodePipeline(t *testing.T) { - var ignoredTags []*codepipeline.Tag - ignoredTags = append(ignoredTags, &codepipeline.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &codepipeline.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredCodePipeline(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsCognito.go b/aws/tagsCognito.go deleted file mode 100644 index ca7db30e5e0..00000000000 --- a/aws/tagsCognito.go +++ /dev/null @@ -1,82 +0,0 @@ -package aws - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/cognitoidentity" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "log" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsCognito(conn *cognitoidentity.CognitoIdentity, 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 := diffTagsCognito(tagsFromMapCognito(o), tagsFromMapCognito(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %s", remove) - tagsToRemove := &cognitoidentity.UntagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - TagKeys: aws.StringSlice(remove), - } - - _, err := conn.UntagResource(tagsToRemove) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %s", create) - tagsToAdd := &cognitoidentity.TagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - Tags: aws.StringMap(create), - } - _, err := conn.TagResource(tagsToAdd) - 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 diffTagsCognito(oldTags, newTags map[string]string) (map[string]string, []string) { - // First, we're creating everything we have - 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) - } else if ok { - // already present so remove from new - delete(create, k) - } - } - - return create, remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapCognito(m map[string]interface{}) map[string]string { - results := make(map[string]string) - for k, v := range m { - results[k] = v.(string) - } - - return results -} diff --git a/aws/tagsCognito_test.go b/aws/tagsCognito_test.go deleted file mode 100644 index b19f3fcf536..00000000000 --- a/aws/tagsCognito_test.go +++ /dev/null @@ -1,92 +0,0 @@ -package aws - -import ( - "reflect" - "testing" -) - -// go test -v -run="TestDiffCognitoTags" -func TestDiffCognitoTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create map[string]string - Remove []string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: []string{ - "foo", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: []string{ - "foo", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: []string{ - "foo", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: []string{ - "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsCognito(tagsFromMapCognito(tc.Old), tagsFromMapCognito(tc.New)) - - if !reflect.DeepEqual(c, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, c) - - } - if !reflect.DeepEqual(r, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, r) - } - } -} diff --git a/aws/tagsConfigService.go b/aws/tagsConfigService.go deleted file mode 100644 index 3a74429e8d8..00000000000 --- a/aws/tagsConfigService.go +++ /dev/null @@ -1,135 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/configservice" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsConfigService(conn *configservice.ConfigService, 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 := diffTagsConfigService(tagsFromMapConfigService(o), tagsFromMapConfigService(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %s", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.UntagResource(&configservice.UntagResourceInput{ - ResourceArn: aws.String(arn), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %s", create) - _, err := conn.TagResource(&configservice.TagResourceInput{ - ResourceArn: 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 diffTagsConfigService(oldTags, newTags []*configservice.Tag) ([]*configservice.Tag, []*configservice.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*configservice.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } else if ok { - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapConfigService(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapConfigService(m map[string]interface{}) []*configservice.Tag { - result := make([]*configservice.Tag, 0, len(m)) - for k, v := range m { - t := &configservice.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredConfigService(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapConfigService(ts []*configservice.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredConfigService(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredConfigService(t *configservice.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, aws.StringValue(t.Key)) - r, _ := regexp.MatchString(v, aws.StringValue(t.Key)) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", aws.StringValue(t.Key), aws.StringValue(t.Value)) - return true - } - } - return false -} - -func saveTagsConfigService(conn *configservice.ConfigService, d *schema.ResourceData, arn string) error { - resp, err := conn.ListTagsForResource(&configservice.ListTagsForResourceInput{ - ResourceArn: aws.String(arn), - }) - - if err != nil { - return err - } - - var dt []*configservice.Tag - if len(resp.Tags) > 0 { - dt = resp.Tags - } - - return d.Set("tags", tagsToMapConfigService(dt)) -} diff --git a/aws/tagsConfigService_test.go b/aws/tagsConfigService_test.go deleted file mode 100644 index 6a55b1a319c..00000000000 --- a/aws/tagsConfigService_test.go +++ /dev/null @@ -1,112 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/configservice" -) - -// go test -v -run="TestDiffConfigServiceTags" -func TestDiffConfigServiceTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsConfigService(tagsFromMapConfigService(tc.Old), tagsFromMapConfigService(tc.New)) - cm := tagsToMapConfigService(c) - rm := tagsToMapConfigService(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsConfigService" -func TestIgnoringTagsConfigService(t *testing.T) { - var ignoredTags []*configservice.Tag - ignoredTags = append(ignoredTags, &configservice.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &configservice.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredConfigService(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsDAX.go b/aws/tagsDAX.go deleted file mode 100644 index 4cf66a0c571..00000000000 --- a/aws/tagsDAX.go +++ /dev/null @@ -1,116 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/dax" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsDax(conn *dax.DAX, 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 := diffTagsDax(tagsFromMapDax(o), tagsFromMapDax(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.UntagResource(&dax.UntagResourceInput{ - ResourceName: aws.String(arn), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&dax.TagResourceInput{ - 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 diffTagsDax(oldTags, newTags []*dax.Tag) ([]*dax.Tag, []*dax.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 []*dax.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapDax(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapDax(m map[string]interface{}) []*dax.Tag { - result := make([]*dax.Tag, 0, len(m)) - for k, v := range m { - t := &dax.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredDax(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapDax(ts []*dax.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredDax(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 tagIgnoredDax(t *dax.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsDAX_test.go b/aws/tagsDAX_test.go deleted file mode 100644 index 6838b5c64a2..00000000000 --- a/aws/tagsDAX_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/dax" -) - -func TestDaxTagsDiff(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsDax(tagsFromMapDax(tc.Old), tagsFromMapDax(tc.New)) - cm := tagsToMapDax(c) - rm := tagsToMapDax(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestTagsDaxIgnore(t *testing.T) { - var ignoredTags []*dax.Tag - ignoredTags = append(ignoredTags, &dax.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &dax.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredDax(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsDS.go b/aws/tagsDS.go deleted file mode 100644 index a8e3b948c60..00000000000 --- a/aws/tagsDS.go +++ /dev/null @@ -1,116 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/directoryservice" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsDS(conn *directoryservice.DirectoryService, d *schema.ResourceData, resourceId string) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsDS(tagsFromMapDS(o), tagsFromMapDS(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %s", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.RemoveTagsFromResource(&directoryservice.RemoveTagsFromResourceInput{ - ResourceId: aws.String(resourceId), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %s", create) - _, err := conn.AddTagsToResource(&directoryservice.AddTagsToResourceInput{ - ResourceId: aws.String(resourceId), - 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 diffTagsDS(oldTags, newTags []*directoryservice.Tag) ([]*directoryservice.Tag, []*directoryservice.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 []*directoryservice.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapDS(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapDS(m map[string]interface{}) []*directoryservice.Tag { - result := make([]*directoryservice.Tag, 0, len(m)) - for k, v := range m { - t := &directoryservice.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredDS(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapDS(ts []*directoryservice.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredDS(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 tagIgnoredDS(t *directoryservice.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsDX.go b/aws/tagsDX.go deleted file mode 100644 index 63a38e2d595..00000000000 --- a/aws/tagsDX.go +++ /dev/null @@ -1,138 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/directconnect" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// getTags is a helper to get the tags for a resource. It expects the -// tags field to be named "tags" -func getTagsDX(conn *directconnect.DirectConnect, d *schema.ResourceData, arn string) error { - resp, err := conn.DescribeTags(&directconnect.DescribeTagsInput{ - ResourceArns: aws.StringSlice([]string{arn}), - }) - if err != nil { - return err - } - - var tags []*directconnect.Tag - if len(resp.ResourceTags) == 1 && aws.StringValue(resp.ResourceTags[0].ResourceArn) == arn { - tags = resp.ResourceTags[0].Tags - } - - if err := d.Set("tags", tagsToMapDX(tags)); 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 setTagsDX(conn *directconnect.DirectConnect, 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 := diffTagsDX(tagsFromMapDX(o), tagsFromMapDX(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.UntagResource(&directconnect.UntagResourceInput{ - ResourceArn: aws.String(arn), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&directconnect.TagResourceInput{ - ResourceArn: 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 diffTagsDX(oldTags, newTags []*directconnect.Tag) ([]*directconnect.Tag, []*directconnect.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*directconnect.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapDX(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapDX(m map[string]interface{}) []*directconnect.Tag { - result := make([]*directconnect.Tag, 0, len(m)) - for k, v := range m { - t := &directconnect.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredDX(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapDX(ts []*directconnect.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredDX(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredDX(t *directconnect.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsDX_test.go b/aws/tagsDX_test.go deleted file mode 100644 index 9af6d1b101d..00000000000 --- a/aws/tagsDX_test.go +++ /dev/null @@ -1,79 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/directconnect" -) - -// go test -v -run="TestDiffDXTags" -func TestDiffDXTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsDX(tagsFromMapDX(tc.Old), tagsFromMapDX(tc.New)) - cm := tagsToMapDX(c) - rm := tagsToMapDX(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsDX" -func TestIgnoringTagsDX(t *testing.T) { - var ignoredTags []*directconnect.Tag - ignoredTags = append(ignoredTags, &directconnect.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &directconnect.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredDX(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsDataPipeline.go b/aws/tagsDataPipeline.go deleted file mode 100644 index 1abaf926d22..00000000000 --- a/aws/tagsDataPipeline.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/datapipeline" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsDataPipeline(conn *datapipeline.DataPipeline, 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 := diffTagsDataPipeline(tagsFromMapDataPipeline(o), tagsFromMapDataPipeline(n)) - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - _, err := conn.RemoveTags(&datapipeline.RemoveTagsInput{ - PipelineId: aws.String(d.Id()), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.AddTags(&datapipeline.AddTagsInput{ - PipelineId: 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 diffTagsDataPipeline(oldTags, newTags []*datapipeline.Tag) ([]*datapipeline.Tag, []*datapipeline.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - // Build the list of what to remove - var remove []*datapipeline.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } else if ok { - // already present so remove from new - delete(create, aws.StringValue(t.Key)) - } - } - return tagsFromMapDataPipeline(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapDataPipeline(m map[string]interface{}) []*datapipeline.Tag { - var result []*datapipeline.Tag - for k, v := range m { - t := &datapipeline.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredDataPipeline(t) { - result = append(result, t) - } - } - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapDataPipeline(ts []*datapipeline.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredDataPipeline(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredDataPipeline(t *datapipeline.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, aws.StringValue(t.Key)) - if r, _ := regexp.MatchString(v, aws.StringValue(t.Key)); r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", aws.StringValue(t.Key), aws.StringValue(t.Value)) - return true - } - } - return false -} diff --git a/aws/tagsDataPipeline_test.go b/aws/tagsDataPipeline_test.go deleted file mode 100644 index 0f70089b200..00000000000 --- a/aws/tagsDataPipeline_test.go +++ /dev/null @@ -1,108 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/datapipeline" -) - -func TestDiffTagsDataPipeline(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - for i, tc := range cases { - c, r := diffTagsDataPipeline(tagsFromMapDataPipeline(tc.Old), tagsFromMapDataPipeline(tc.New)) - cm := tagsToMapDataPipeline(c) - rm := tagsToMapDataPipeline(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} -func TestIgnoringTagsDataPipeline(t *testing.T) { - var ignoredTags []*datapipeline.Tag - ignoredTags = append(ignoredTags, &datapipeline.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &datapipeline.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredDataPipeline(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsDocDB.go b/aws/tagsDocDB.go deleted file mode 100644 index 62f3424131a..00000000000 --- a/aws/tagsDocDB.go +++ /dev/null @@ -1,137 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/docdb" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsDocDB(conn *docdb.DocDB, 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 := diffTagsDocDB(tagsFromMapDocDB(o), tagsFromMapDocDB(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.RemoveTagsFromResource(&docdb.RemoveTagsFromResourceInput{ - ResourceName: aws.String(d.Get("arn").(string)), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.AddTagsToResource(&docdb.AddTagsToResourceInput{ - ResourceName: aws.String(d.Get("arn").(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 diffTagsDocDB(oldTags, newTags []*docdb.Tag) ([]*docdb.Tag, []*docdb.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*docdb.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } else if ok { - // already present so remove from new - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapDocDB(create), remove -} - -func saveTagsDocDB(conn *docdb.DocDB, d *schema.ResourceData, arn string) error { - resp, err := conn.ListTagsForResource(&docdb.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) - - if err != nil { - return fmt.Errorf("Error retreiving tags for ARN: %s", arn) - } - - var dt []*docdb.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList - } - - return d.Set("tags", tagsToMapDocDB(dt)) -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapDocDB(m map[string]interface{}) []*docdb.Tag { - result := make([]*docdb.Tag, 0, len(m)) - for k, v := range m { - t := &docdb.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredDocDB(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapDocDB(ts []*docdb.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredDocDB(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredDocDB(t *docdb.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, aws.StringValue(t.Key)) - r, _ := regexp.MatchString(v, aws.StringValue(t.Key)) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", aws.StringValue(t.Key), aws.StringValue(t.Value)) - return true - } - } - return false -} diff --git a/aws/tagsDocDB_test.go b/aws/tagsDocDB_test.go deleted file mode 100644 index 7c8bf77b819..00000000000 --- a/aws/tagsDocDB_test.go +++ /dev/null @@ -1,112 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/docdb" -) - -// go test -v -run="TestDiffDocDBTags" -func TestDiffDocDBTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsDocDB(tagsFromMapDocDB(tc.Old), tagsFromMapDocDB(tc.New)) - cm := tagsToMapDocDB(c) - rm := tagsToMapDocDB(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsDocDB" -func TestIgnoringTagsDocDB(t *testing.T) { - var ignoredTags []*docdb.Tag - ignoredTags = append(ignoredTags, &docdb.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &docdb.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredDocDB(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsDynamoDb.go b/aws/tagsDynamoDb.go deleted file mode 100644 index 1d96a05b092..00000000000 --- a/aws/tagsDynamoDb.go +++ /dev/null @@ -1,139 +0,0 @@ -package aws - -import ( - "log" - "regexp" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/dynamodb" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" and the ARN field to be named "arn". -func setTagsDynamoDb(conn *dynamodb.DynamoDB, d *schema.ResourceData) error { - 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 { - input := &dynamodb.UntagResourceInput{ - ResourceArn: aws.String(arn), - TagKeys: remove, - } - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] Removing tags: %#v from %s", remove, d.Id()) - _, err := conn.UntagResource(input) - if err != nil { - if isAWSErr(err, dynamodb.ErrCodeResourceNotFoundException, "") { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - return nil - }) - if isResourceTimeoutError(err) { - _, err = conn.UntagResource(input) - } - if err != nil { - return err - } - } - if len(create) > 0 { - input := &dynamodb.TagResourceInput{ - ResourceArn: aws.String(arn), - Tags: create, - } - err := resource.Retry(2*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] Creating tags: %s for %s", create, d.Id()) - _, err := conn.TagResource(input) - if err != nil { - if isAWSErr(err, dynamodb.ErrCodeResourceNotFoundException, "") { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - return nil - }) - if isResourceTimeoutError(err) { - _, err = conn.TagResource(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 diffTagsDynamoDb(oldTags, newTags []*dynamodb.Tag) ([]*dynamodb.Tag, []*string) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*string - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - remove = append(remove, t.Key) - } else if ok { - // already present so remove from new - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapDynamoDb(create), remove -} - -// tagsFromMapDynamoDb returns the tags for the given map of data. -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)), - } - if !tagIgnoredDynamoDb(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapDynamoDb(ts []*dynamodb.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredDynamoDb(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredDynamoDb(t *dynamodb.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsDynamoDb_test.go b/aws/tagsDynamoDb_test.go deleted file mode 100644 index abcc3512f6a..00000000000 --- a/aws/tagsDynamoDb_test.go +++ /dev/null @@ -1,111 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/dynamodb" -) - -func TestDiffDynamoDbTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Add - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{}, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsDynamoDb(tagsFromMapDynamoDb(tc.Old), tagsFromMapDynamoDb(tc.New)) - cm := tagsToMapDynamoDb(c) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - for _, key := range r { - if _, ok := tc.Remove[aws.StringValue(key)]; !ok { - t.Fatalf("%d: bad remove: %#v", i, key) - } - } - } -} - -func TestIgnoringTagsDynamoDb(t *testing.T) { - ignoredTags := []*dynamodb.Tag{ - { - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }, - { - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }, - } - for _, tag := range ignoredTags { - if !tagIgnoredDynamoDb(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsEC.go b/aws/tagsEC.go deleted file mode 100644 index 2e11ea7bd1a..00000000000 --- a/aws/tagsEC.go +++ /dev/null @@ -1,116 +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-plugin-sdk/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)) - 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) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsECR.go b/aws/tagsECR.go deleted file mode 100644 index b8b5a800d24..00000000000 --- a/aws/tagsECR.go +++ /dev/null @@ -1,135 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ecr" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// getTags is a helper to get the tags for a resource. It expects the -// tags field to be named "tags" and the ARN field to be named "arn". -func getTagsECR(conn *ecr.ECR, d *schema.ResourceData) error { - resp, err := conn.ListTagsForResource(&ecr.ListTagsForResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - }) - if err != nil { - return err - } - - if err := d.Set("tags", tagsToMapECR(resp.Tags)); 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" and the ARN field to be named "arn". -func setTagsECR(conn *ecr.ECR, 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 := diffTagsECR(tagsFromMapECR(o), tagsFromMapECR(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.UntagResource(&ecr.UntagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&ecr.TagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(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 diffTagsECR(oldTags, newTags []*ecr.Tag) ([]*ecr.Tag, []*ecr.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*ecr.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - remove = append(remove, t) - } else if ok { - // already present so remove from new - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapECR(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapECR(m map[string]interface{}) []*ecr.Tag { - result := make([]*ecr.Tag, 0, len(m)) - for k, v := range m { - t := &ecr.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredECR(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapECR(ts []*ecr.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredECR(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredECR(t *ecr.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsECR_test.go b/aws/tagsECR_test.go deleted file mode 100644 index 3cba90bf5be..00000000000 --- a/aws/tagsECR_test.go +++ /dev/null @@ -1,111 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ecr" -) - -// go test -v -run="TestDiffECRTags" -func TestDiffECRTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Add - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{}, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsECR(tagsFromMapECR(tc.Old), tagsFromMapECR(tc.New)) - cm := tagsToMapECR(c) - rm := tagsToMapECR(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsECR" -func TestIgnoringTagsECR(t *testing.T) { - var ignoredTags []*ecr.Tag - ignoredTags = append(ignoredTags, &ecr.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &ecr.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredECR(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsECS.go b/aws/tagsECS.go deleted file mode 100644 index 67a924155ff..00000000000 --- a/aws/tagsECS.go +++ /dev/null @@ -1,78 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ecs" -) - -// 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 diffTagsECS(oldTags, newTags []*ecs.Tag) ([]*ecs.Tag, []*ecs.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*ecs.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } else if ok { - // already present so remove from new - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapECS(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapECS(tagMap map[string]interface{}) []*ecs.Tag { - tags := make([]*ecs.Tag, 0, len(tagMap)) - for tagKey, tagValueRaw := range tagMap { - tag := &ecs.Tag{ - Key: aws.String(tagKey), - Value: aws.String(tagValueRaw.(string)), - } - if !tagIgnoredECS(tag) { - tags = append(tags, tag) - } - } - - return tags -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapECS(tags []*ecs.Tag) map[string]string { - tagMap := make(map[string]string) - for _, tag := range tags { - if !tagIgnoredECS(tag) { - tagMap[aws.StringValue(tag.Key)] = aws.StringValue(tag.Value) - } - } - - return tagMap -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredECS(t *ecs.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, aws.StringValue(t.Key)) - r, _ := regexp.MatchString(v, aws.StringValue(t.Key)) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", aws.StringValue(t.Key), aws.StringValue(t.Value)) - return true - } - } - return false -} diff --git a/aws/tagsECS_test.go b/aws/tagsECS_test.go deleted file mode 100644 index cc9289df4a7..00000000000 --- a/aws/tagsECS_test.go +++ /dev/null @@ -1,110 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ecs" -) - -func TestDiffECSTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Add - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{}, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsECS(tagsFromMapECS(tc.Old), tagsFromMapECS(tc.New)) - cm := tagsToMapECS(c) - rm := tagsToMapECS(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsECS(t *testing.T) { - ignoredTags := []*ecs.Tag{ - { - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }, - { - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }, - } - for _, tag := range ignoredTags { - if !tagIgnoredECS(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsEC_test.go b/aws/tagsEC_test.go deleted file mode 100644 index a67aae6bac3..00000000000 --- a/aws/tagsEC_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/elasticache" -) - -func TestDiffelasticacheTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsEC(tagsFromMapEC(tc.Old), tagsFromMapEC(tc.New)) - cm := tagsToMapEC(c) - rm := tagsToMapEC(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsEC(t *testing.T) { - var ignoredTags []*elasticache.Tag - ignoredTags = append(ignoredTags, &elasticache.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &elasticache.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredEC(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsEFS.go b/aws/tagsEFS.go deleted file mode 100644 index 09ecb64713d..00000000000 --- a/aws/tagsEFS.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/efs" - "github.com/hashicorp/terraform-plugin-sdk/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) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsEFS_test.go b/aws/tagsEFS_test.go deleted file mode 100644 index a354fbb3c49..00000000000 --- a/aws/tagsEFS_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/efs" -) - -func TestDiffEFSTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsEFS(tagsFromMapEFS(tc.Old), tagsFromMapEFS(tc.New)) - cm := tagsToMapEFS(c) - rm := tagsToMapEFS(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsEFS(t *testing.T) { - var ignoredTags []*efs.Tag - ignoredTags = append(ignoredTags, &efs.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &efs.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredEFS(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsELB.go b/aws/tagsELB.go deleted file mode 100644 index 9986f9bf608..00000000000 --- a/aws/tagsELB.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/elb" - "github.com/hashicorp/terraform-plugin-sdk/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) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsELB_test.go b/aws/tagsELB_test.go deleted file mode 100644 index 6f51ee922da..00000000000 --- a/aws/tagsELB_test.go +++ /dev/null @@ -1,103 +0,0 @@ -package aws - -import ( - "fmt" - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/elb" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" -) - -func TestDiffELBTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsELB(tagsFromMapELB(tc.Old), tagsFromMapELB(tc.New)) - cm := tagsToMapELB(c) - rm := tagsToMapELB(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsELB(t *testing.T) { - var ignoredTags []*elb.Tag - ignoredTags = append(ignoredTags, &elb.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &elb.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredELB(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} - -// testAccCheckTags can be used to check the tags on a resource. -func testAccCheckELBTags( - ts *[]*elb.Tag, key string, value string) resource.TestCheckFunc { - return func(s *terraform.State) error { - m := tagsToMapELB(*ts) - v, ok := m[key] - if value != "" && !ok { - return fmt.Errorf("Missing tag: %s", key) - } else if value == "" && ok { - return fmt.Errorf("Extra tag: %s", key) - } - if value == "" { - return nil - } - - if v != value { - return fmt.Errorf("%s: bad value: %s", key, v) - } - - return nil - } -} diff --git a/aws/tagsFSX.go b/aws/tagsFSX.go deleted file mode 100644 index c04ed349372..00000000000 --- a/aws/tagsFSX.go +++ /dev/null @@ -1,120 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/fsx" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags". It also expects to take the resource -// ARN as the primary ID based on the requirements of the FSx API (as -// opposed to the resource ID like other tagging helpers). -func setTagsFSX(conn *fsx.FSx, 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 := diffTagsFSX(tagsFromMapFSX(o), tagsFromMapFSX(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.UntagResource(&fsx.UntagResourceInput{ - ResourceARN: aws.String(d.Get("arn").(string)), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&fsx.TagResourceInput{ - ResourceARN: aws.String(d.Get("arn").(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 diffTagsFSX(oldTags, newTags []*fsx.Tag) ([]*fsx.Tag, []*fsx.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 []*fsx.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } else if ok { - // already present so remove from new - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapFSX(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapFSX(m map[string]interface{}) []*fsx.Tag { - var result []*fsx.Tag - for k, v := range m { - t := &fsx.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredFSX(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapFSX(ts []*fsx.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredFSX(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 tagIgnoredFSX(t *fsx.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsFSX_test.go b/aws/tagsFSX_test.go deleted file mode 100644 index 84cacd1c84c..00000000000 --- a/aws/tagsFSX_test.go +++ /dev/null @@ -1,110 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/fsx" -) - -func TestDiffFSXTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsFSX(tagsFromMapFSX(tc.Old), tagsFromMapFSX(tc.New)) - cm := tagsToMapFSX(c) - rm := tagsToMapFSX(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsFSX(t *testing.T) { - var ignoredTags []*fsx.Tag - ignoredTags = append(ignoredTags, &fsx.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &fsx.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredFSX(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsGeneric.go b/aws/tagsGeneric.go deleted file mode 100644 index 2deb9baba71..00000000000 --- a/aws/tagsGeneric.go +++ /dev/null @@ -1,70 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" -) - -// 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 diffTagsGeneric(oldTags, newTags map[string]interface{}) (map[string]*string, map[string]*string) { - // First, we're creating everything we have - create := make(map[string]*string) - for k, v := range newTags { - create[k] = aws.String(v.(string)) - } - - // Build the map of what to remove - remove := make(map[string]*string) - for k, v := range oldTags { - old, ok := create[k] - if !ok || old != aws.String(v.(string)) { - // Delete it! - remove[k] = aws.String(v.(string)) - } - } - - return create, remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapGeneric(m map[string]interface{}) map[string]*string { - result := make(map[string]*string) - for k, v := range m { - if !tagIgnoredGeneric(k) { - result[k] = aws.String(v.(string)) - } - } - - return result -} - -// tagsToMap turns the tags into a map. -func tagsToMapGeneric(ts map[string]*string) map[string]string { - result := make(map[string]string) - for k, v := range ts { - if !tagIgnoredGeneric(k) { - result[k] = aws.StringValue(v) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredGeneric(k string) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, k) - r, _ := regexp.MatchString(v, k) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s, ignoring.\n", k) - return true - } - } - return false -} diff --git a/aws/tagsGeneric_test.go b/aws/tagsGeneric_test.go deleted file mode 100644 index 2477f3aa507..00000000000 --- a/aws/tagsGeneric_test.go +++ /dev/null @@ -1,73 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" -) - -// go test -v -run="TestDiffGenericTags" -func TestDiffGenericTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsGeneric(tc.Old, tc.New) - cm := tagsToMapGeneric(c) - rm := tagsToMapGeneric(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsGeneric" -func TestIgnoringTagsGeneric(t *testing.T) { - ignoredTags := map[string]*string{ - "aws:cloudformation:logical-id": aws.String("foo"), - "aws:foo:bar": aws.String("baz"), - } - for k, v := range ignoredTags { - if !tagIgnoredGeneric(k) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", k, *v) - } - } -} diff --git a/aws/tagsIAM.go b/aws/tagsIAM.go deleted file mode 100644 index 6610ba8c5d8..00000000000 --- a/aws/tagsIAM.go +++ /dev/null @@ -1,86 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/iam" -) - -// 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 diffTagsIAM(oldTags, newTags []*iam.Tag) ([]*iam.Tag, []*iam.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*iam.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } else if ok { - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapIAM(create), remove -} - -// tagsFromMapIAM returns the tags for the given map of data for IAM. -func tagsFromMapIAM(m map[string]interface{}) []*iam.Tag { - result := make([]*iam.Tag, 0, len(m)) - for k, v := range m { - t := &iam.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredIAM(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMapIAM turns the list of IAM tags into a map. -func tagsToMapIAM(ts []*iam.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredIAM(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredIAM(t *iam.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} - -// tagKeysIam returns the keys for the list of IAM tags -func tagKeysIam(ts []*iam.Tag) []*string { - result := make([]*string, 0, len(ts)) - for _, t := range ts { - result = append(result, t.Key) - } - return result -} diff --git a/aws/tagsIAM_test.go b/aws/tagsIAM_test.go deleted file mode 100644 index 4a74062f5e9..00000000000 --- a/aws/tagsIAM_test.go +++ /dev/null @@ -1,111 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/iam" -) - -// go test -v -run="TestDiffIAMTags" -func TestDiffIAMTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Add - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{}, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsIAM(tagsFromMapIAM(tc.Old), tagsFromMapIAM(tc.New)) - cm := tagsToMapIAM(c) - rm := tagsToMapIAM(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsIAM" -func TestIgnoringTagsIAM(t *testing.T) { - var ignoredTags []*iam.Tag - ignoredTags = append(ignoredTags, &iam.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &iam.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredIAM(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsInspector.go b/aws/tagsInspector.go deleted file mode 100644 index 41e4336d7c1..00000000000 --- a/aws/tagsInspector.go +++ /dev/null @@ -1,40 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/inspector" -) - -// 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 -} - -// 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) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsKMS.go b/aws/tagsKMS.go deleted file mode 100644 index 07a86a397ed..00000000000 --- a/aws/tagsKMS.go +++ /dev/null @@ -1,116 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/kms" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsKMS(conn *kms.KMS, d *schema.ResourceData, keyId string) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsKMS(tagsFromMapKMS(o), tagsFromMapKMS(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.TagKey - } - - _, err := conn.UntagResource(&kms.UntagResourceInput{ - KeyId: aws.String(keyId), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&kms.TagResourceInput{ - KeyId: aws.String(keyId), - 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 diffTagsKMS(oldTags, newTags []*kms.Tag) ([]*kms.Tag, []*kms.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.TagKey)] = aws.StringValue(t.TagValue) - } - - // Build the list of what to remove - var remove []*kms.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.TagKey)] - if !ok || old != aws.StringValue(t.TagValue) { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapKMS(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapKMS(m map[string]interface{}) []*kms.Tag { - result := make([]*kms.Tag, 0, len(m)) - for k, v := range m { - t := &kms.Tag{ - TagKey: aws.String(k), - TagValue: aws.String(v.(string)), - } - if !tagIgnoredKMS(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapKMS(ts []*kms.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredKMS(t) { - result[aws.StringValue(t.TagKey)] = aws.StringValue(t.TagValue) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredKMS(t *kms.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.TagKey) - r, _ := regexp.MatchString(v, *t.TagKey) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.TagKey, *t.TagValue) - return true - } - } - return false -} diff --git a/aws/tagsKMS_test.go b/aws/tagsKMS_test.go deleted file mode 100644 index ece14b9bcc5..00000000000 --- a/aws/tagsKMS_test.go +++ /dev/null @@ -1,79 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/kms" -) - -// go test -v -run="TestDiffKMSTags" -func TestDiffKMSTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsKMS(tagsFromMapKMS(tc.Old), tagsFromMapKMS(tc.New)) - cm := tagsToMapKMS(c) - rm := tagsToMapKMS(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsKMS" -func TestIgnoringTagsKMS(t *testing.T) { - var ignoredTags []*kms.Tag - ignoredTags = append(ignoredTags, &kms.Tag{ - TagKey: aws.String("aws:cloudformation:logical-id"), - TagValue: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &kms.Tag{ - TagKey: aws.String("aws:foo:bar"), - TagValue: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredKMS(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.TagKey, *tag.TagValue) - } - } -} diff --git a/aws/tagsKinesisAnalytics.go b/aws/tagsKinesisAnalytics.go deleted file mode 100644 index a7c2277fec9..00000000000 --- a/aws/tagsKinesisAnalytics.go +++ /dev/null @@ -1,135 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/kinesisanalytics" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// getTags is a helper to get the tags for a resource. It expects the -// tags field to be named "tags" and the ARN field to be named "arn". -func getTagsKinesisAnalytics(conn *kinesisanalytics.KinesisAnalytics, d *schema.ResourceData) error { - resp, err := conn.ListTagsForResource(&kinesisanalytics.ListTagsForResourceInput{ - ResourceARN: aws.String(d.Get("arn").(string)), - }) - if err != nil { - return err - } - - if err := d.Set("tags", tagsToMapKinesisAnalytics(resp.Tags)); 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" and the ARN field to be named "arn". -func setTagsKinesisAnalytics(conn *kinesisanalytics.KinesisAnalytics, 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 := diffTagsKinesisAnalytics(tagsFromMapKinesisAnalytics(o), tagsFromMapKinesisAnalytics(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.UntagResource(&kinesisanalytics.UntagResourceInput{ - ResourceARN: aws.String(d.Get("arn").(string)), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&kinesisanalytics.TagResourceInput{ - ResourceARN: aws.String(d.Get("arn").(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 diffTagsKinesisAnalytics(oldTags, newTags []*kinesisanalytics.Tag) ([]*kinesisanalytics.Tag, []*kinesisanalytics.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*kinesisanalytics.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - remove = append(remove, t) - } else if ok { - // already present so remove from new - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapKinesisAnalytics(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapKinesisAnalytics(m map[string]interface{}) []*kinesisanalytics.Tag { - result := make([]*kinesisanalytics.Tag, 0, len(m)) - for k, v := range m { - t := &kinesisanalytics.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredKinesisAnalytics(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapKinesisAnalytics(ts []*kinesisanalytics.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredKinesisAnalytics(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredKinesisAnalytics(t *kinesisanalytics.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsKinesisAnalytics_test.go b/aws/tagsKinesisAnalytics_test.go deleted file mode 100644 index da0d2595b46..00000000000 --- a/aws/tagsKinesisAnalytics_test.go +++ /dev/null @@ -1,109 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/kinesisanalytics" -) - -func TestDiffKinesisAnalyticsTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Add - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{}, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsKinesisAnalytics(tagsFromMapKinesisAnalytics(tc.Old), tagsFromMapKinesisAnalytics(tc.New)) - cm := tagsToMapKinesisAnalytics(c) - rm := tagsToMapKinesisAnalytics(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsKinesisAnalytics(t *testing.T) { - var ignoredTags []*kinesisanalytics.Tag - ignoredTags = append(ignoredTags, &kinesisanalytics.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &kinesisanalytics.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredKinesisAnalytics(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsKinesisFirehose.go b/aws/tagsKinesisFirehose.go deleted file mode 100644 index aa8bf266252..00000000000 --- a/aws/tagsKinesisFirehose.go +++ /dev/null @@ -1,149 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/firehose" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// getTags is a helper to get the tags for a resource. It expects the -// tags field to be named "tags" -func getTagsKinesisFirehose(conn *firehose.Firehose, d *schema.ResourceData, sn string) error { - tags := make([]*firehose.Tag, 0) - var exclusiveStartTagKey string - for { - req := &firehose.ListTagsForDeliveryStreamInput{ - DeliveryStreamName: aws.String(sn), - } - if exclusiveStartTagKey != "" { - req.ExclusiveStartTagKey = aws.String(exclusiveStartTagKey) - } - - resp, err := conn.ListTagsForDeliveryStream(req) - if err != nil { - return err - } - - tags = append(tags, resp.Tags...) - - // If HasMoreTags is true in the response, more tags are available. - // To list the remaining tags, set ExclusiveStartTagKey to the key - // of the last tag returned and call ListTagsForDeliveryStream again. - if !aws.BoolValue(resp.HasMoreTags) { - break - } - exclusiveStartTagKey = aws.StringValue(tags[len(tags)-1].Key) - } - - err := d.Set("tags", tagsToMapKinesisFirehose(tags)) - return err -} - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsKinesisFirehose(conn *firehose.Firehose, d *schema.ResourceData, sn string) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsKinesisFirehose(tagsFromMapKinesisFirehose(o), tagsFromMapKinesisFirehose(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.UntagDeliveryStream(&firehose.UntagDeliveryStreamInput{ - DeliveryStreamName: aws.String(sn), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagDeliveryStream(&firehose.TagDeliveryStreamInput{ - DeliveryStreamName: aws.String(sn), - 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 diffTagsKinesisFirehose(oldTags, newTags []*firehose.Tag) ([]*firehose.Tag, []*firehose.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*firehose.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapKinesisFirehose(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapKinesisFirehose(m map[string]interface{}) []*firehose.Tag { - result := make([]*firehose.Tag, 0, len(m)) - for k, v := range m { - t := &firehose.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredKinesisFirehose(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapKinesisFirehose(ts []*firehose.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredKinesisFirehose(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredKinesisFirehose(t *firehose.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsKinesisFirehose_test.go b/aws/tagsKinesisFirehose_test.go deleted file mode 100644 index bd6be030aee..00000000000 --- a/aws/tagsKinesisFirehose_test.go +++ /dev/null @@ -1,79 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/firehose" -) - -// go test -v -run="TestDiffKinesisFirehoseTags" -func TestDiffKinesisFirehoseTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsKinesisFirehose(tagsFromMapKinesisFirehose(tc.Old), tagsFromMapKinesisFirehose(tc.New)) - cm := tagsToMapKinesisFirehose(c) - rm := tagsToMapKinesisFirehose(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsKinesisFirehose" -func TestIgnoringTagsKinesisFirehose(t *testing.T) { - var ignoredTags []*firehose.Tag - ignoredTags = append(ignoredTags, &firehose.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &firehose.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredKinesisFirehose(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsLambda.go b/aws/tagsLambda.go deleted file mode 100644 index b6a08c6e9ed..00000000000 --- a/aws/tagsLambda.go +++ /dev/null @@ -1,50 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/lambda" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsLambda(conn *lambda.Lambda, 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 := diffTagsGeneric(o, n) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - keys := make([]*string, 0, len(remove)) - for k := range remove { - keys = append(keys, aws.String(k)) - } - - _, err := conn.UntagResource(&lambda.UntagResourceInput{ - Resource: aws.String(arn), - TagKeys: keys, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - - _, err := conn.TagResource(&lambda.TagResourceInput{ - Resource: aws.String(arn), - Tags: create, - }) - if err != nil { - return err - } - } - } - - return nil -} diff --git a/aws/tagsLicenseManager.go b/aws/tagsLicenseManager.go deleted file mode 100644 index 867a82c51c7..00000000000 --- a/aws/tagsLicenseManager.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/licensemanager" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsLicenseManager(conn *licensemanager.LicenseManager, 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 := diffTagsLicenseManager(tagsFromMapLicenseManager(o), tagsFromMapLicenseManager(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.UntagResource(&licensemanager.UntagResourceInput{ - ResourceArn: aws.String(d.Id()), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&licensemanager.TagResourceInput{ - ResourceArn: 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 diffTagsLicenseManager(oldTags, newTags []*licensemanager.Tag) ([]*licensemanager.Tag, []*licensemanager.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 []*licensemanager.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapLicenseManager(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapLicenseManager(m map[string]interface{}) []*licensemanager.Tag { - result := make([]*licensemanager.Tag, 0, len(m)) - for k, v := range m { - t := &licensemanager.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredLicenseManager(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapLicenseManager(ts []*licensemanager.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredLicenseManager(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 tagIgnoredLicenseManager(t *licensemanager.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 { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsLightsail.go b/aws/tagsLightsail.go deleted file mode 100644 index b6a3ea06de9..00000000000 --- a/aws/tagsLightsail.go +++ /dev/null @@ -1,97 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/lightsail" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// 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 diffTagsLightsail(oldTags, newTags []*lightsail.Tag) ([]*lightsail.Tag, []*lightsail.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*lightsail.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } else if ok { - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapLightsail(create), remove -} - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsLightsail(conn *lightsail.Lightsail, 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 := diffTagsLightsail(tagsFromMapLightsail(o), tagsFromMapLightsail(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.UntagResource(&lightsail.UntagResourceInput{ - ResourceName: aws.String(d.Get("name").(string)), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&lightsail.TagResourceInput{ - ResourceName: aws.String(d.Get("name").(string)), - Tags: create, - }) - if err != nil { - return err - } - } - } - - return nil -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapLightsail(m map[string]interface{}) []*lightsail.Tag { - result := make([]*lightsail.Tag, 0, len(m)) - for k, v := range m { - result = append(result, &lightsail.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - }) - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapLightsail(ts []*lightsail.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - return result -} diff --git a/aws/tagsLightsail_test.go b/aws/tagsLightsail_test.go deleted file mode 100644 index e448efe6389..00000000000 --- a/aws/tagsLightsail_test.go +++ /dev/null @@ -1,91 +0,0 @@ -package aws - -import ( - "reflect" - "testing" -) - -// go test -v -run="TestDiffLightsailTags" -func TestDiffLightsailTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsLightsail(tagsFromMapLightsail(tc.Old), tagsFromMapLightsail(tc.New)) - cm := tagsToMapLightsail(c) - rm := tagsToMapLightsail(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} diff --git a/aws/tagsMQ.go b/aws/tagsMQ.go deleted file mode 100644 index ae45d735f53..00000000000 --- a/aws/tagsMQ.go +++ /dev/null @@ -1,67 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/mq" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// getTags is a helper to get the tags for a resource. It expects the -// tags field to be named "tags" -func getTagsMQ(conn *mq.MQ, d *schema.ResourceData, arn string) error { - resp, err := conn.ListTags(&mq.ListTagsInput{ - ResourceArn: aws.String(arn), - }) - if err != nil { - return err - } - - if err := d.Set("tags", tagsToMapGeneric(resp.Tags)); 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 setTagsMQ(conn *mq.MQ, 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 := diffTagsGeneric(o, n) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - keys := make([]*string, 0, len(remove)) - for k := range remove { - keys = append(keys, aws.String(k)) - } - - _, err := conn.DeleteTags(&mq.DeleteTagsInput{ - ResourceArn: aws.String(arn), - TagKeys: keys, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - - _, err := conn.CreateTags(&mq.CreateTagsInput{ - ResourceArn: aws.String(arn), - Tags: create, - }) - if err != nil { - return err - } - } - } - - return nil -} diff --git a/aws/tagsMediaStore.go b/aws/tagsMediaStore.go deleted file mode 100644 index 976975da186..00000000000 --- a/aws/tagsMediaStore.go +++ /dev/null @@ -1,135 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/mediastore" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsMediaStore(conn *mediastore.MediaStore, 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 := diffTagsMediaStore(tagsFromMapMediaStore(o), tagsFromMapMediaStore(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %s", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.UntagResource(&mediastore.UntagResourceInput{ - Resource: aws.String(arn), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %s", create) - _, err := conn.TagResource(&mediastore.TagResourceInput{ - Resource: 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 diffTagsMediaStore(oldTags, newTags []*mediastore.Tag) ([]*mediastore.Tag, []*mediastore.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*mediastore.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } else if ok { - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapMediaStore(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapMediaStore(m map[string]interface{}) []*mediastore.Tag { - result := make([]*mediastore.Tag, 0, len(m)) - for k, v := range m { - t := &mediastore.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredMediaStore(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapMediaStore(ts []*mediastore.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredMediaStore(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredMediaStore(t *mediastore.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, aws.StringValue(t.Key)) - r, _ := regexp.MatchString(v, aws.StringValue(t.Key)) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", aws.StringValue(t.Key), aws.StringValue(t.Value)) - return true - } - } - return false -} - -func saveTagsMediaStore(conn *mediastore.MediaStore, d *schema.ResourceData, arn string) error { - resp, err := conn.ListTagsForResource(&mediastore.ListTagsForResourceInput{ - Resource: aws.String(arn), - }) - - if err != nil { - return err - } - - var dt []*mediastore.Tag - if len(resp.Tags) > 0 { - dt = resp.Tags - } - - return d.Set("tags", tagsToMapMediaStore(dt)) -} diff --git a/aws/tagsMediaStore_test.go b/aws/tagsMediaStore_test.go deleted file mode 100644 index 29d0acba31e..00000000000 --- a/aws/tagsMediaStore_test.go +++ /dev/null @@ -1,112 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/mediastore" -) - -// go test -v -run="TestDiffMediaStoreTags" -func TestDiffMediaStoreTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsMediaStore(tagsFromMapMediaStore(tc.Old), tagsFromMapMediaStore(tc.New)) - cm := tagsToMapMediaStore(c) - rm := tagsToMapMediaStore(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsMediaStore" -func TestIgnoringTagsMediaStore(t *testing.T) { - var ignoredTags []*mediastore.Tag - ignoredTags = append(ignoredTags, &mediastore.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &mediastore.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredMediaStore(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsMediapackage.go b/aws/tagsMediapackage.go deleted file mode 100644 index f945cf1cfe5..00000000000 --- a/aws/tagsMediapackage.go +++ /dev/null @@ -1,47 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/mediapackage" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func setTagsMediaPackage(conn *mediapackage.MediaPackage, 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 := diffTagsGeneric(o, n) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - keys := make([]*string, 0, len(remove)) - for k := range remove { - keys = append(keys, aws.String(k)) - } - - _, err := conn.UntagResource(&mediapackage.UntagResourceInput{ - ResourceArn: aws.String(arn), - TagKeys: keys, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&mediapackage.TagResourceInput{ - ResourceArn: aws.String(arn), - Tags: create, - }) - if err != nil { - return err - } - } - } - - return nil -} diff --git a/aws/tagsNeptune.go b/aws/tagsNeptune.go deleted file mode 100644 index 10a32c1010d..00000000000 --- a/aws/tagsNeptune.go +++ /dev/null @@ -1,134 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/neptune" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsNeptune(conn *neptune.Neptune, 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 := diffTagsNeptune(tagsFromMapNeptune(o), tagsFromMapNeptune(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %s", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.RemoveTagsFromResource(&neptune.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(&neptune.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 diffTagsNeptune(oldTags, newTags []*neptune.Tag) ([]*neptune.Tag, []*neptune.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*neptune.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapNeptune(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapNeptune(m map[string]interface{}) []*neptune.Tag { - result := make([]*neptune.Tag, 0, len(m)) - for k, v := range m { - t := &neptune.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredNeptune(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapNeptune(ts []*neptune.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredNeptune(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredNeptune(t *neptune.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, aws.StringValue(t.Key)) - r, _ := regexp.MatchString(v, aws.StringValue(t.Key)) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", aws.StringValue(t.Key), aws.StringValue(t.Value)) - return true - } - } - return false -} - -func saveTagsNeptune(conn *neptune.Neptune, d *schema.ResourceData, arn string) error { - resp, err := conn.ListTagsForResource(&neptune.ListTagsForResourceInput{ - ResourceName: aws.String(arn), - }) - - if err != nil { - return fmt.Errorf("Error retreiving tags for ARN: %s", arn) - } - - var dt []*neptune.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList - } - - return d.Set("tags", tagsToMapNeptune(dt)) -} diff --git a/aws/tagsNeptune_test.go b/aws/tagsNeptune_test.go deleted file mode 100644 index a5389bc493e..00000000000 --- a/aws/tagsNeptune_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/neptune" -) - -func TestDiffNeptuneTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsNeptune(tagsFromMapNeptune(tc.Old), tagsFromMapNeptune(tc.New)) - cm := tagsToMapNeptune(c) - rm := tagsToMapNeptune(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsNeptune(t *testing.T) { - var ignoredTags []*neptune.Tag - ignoredTags = append(ignoredTags, &neptune.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &neptune.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredNeptune(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsOpsworks.go b/aws/tagsOpsworks.go deleted file mode 100644 index 24163859cfe..00000000000 --- a/aws/tagsOpsworks.go +++ /dev/null @@ -1,50 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/opsworks" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsOpsworks(conn *opsworks.OpsWorks, 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 := diffTagsGeneric(o, n) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - keys := make([]*string, 0, len(remove)) - for k := range remove { - keys = append(keys, aws.String(k)) - } - - _, err := conn.UntagResource(&opsworks.UntagResourceInput{ - ResourceArn: aws.String(arn), - TagKeys: keys, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - - _, err := conn.TagResource(&opsworks.TagResourceInput{ - ResourceArn: aws.String(arn), - Tags: create, - }) - if err != nil { - return err - } - } - } - - return nil -} diff --git a/aws/tagsOrganizations.go b/aws/tagsOrganizations.go deleted file mode 100644 index 065623f3758..00000000000 --- a/aws/tagsOrganizations.go +++ /dev/null @@ -1,77 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/organizations" -) - -// 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 diffTagsOrganizations(oldTags, newTags []*organizations.Tag) ([]*organizations.Tag, []*string) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*string - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - remove = append(remove, t.Key) - } else if ok { - // already present so remove from new - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapOrganizations(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapOrganizations(m map[string]interface{}) []*organizations.Tag { - var result []*organizations.Tag - for k, v := range m { - t := &organizations.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredOrganizations(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapOrganizations(ts []*organizations.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredOrganizations(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredOrganizations(t *organizations.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, aws.StringValue(t.Key)) - r, _ := regexp.MatchString(v, aws.StringValue(t.Key)) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", aws.StringValue(t.Key), aws.StringValue(t.Value)) - return true - } - } - return false -} diff --git a/aws/tagsOrganizations_test.go b/aws/tagsOrganizations_test.go deleted file mode 100644 index d282ba82a17..00000000000 --- a/aws/tagsOrganizations_test.go +++ /dev/null @@ -1,113 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/organizations" -) - -func TestDiffOrganizationsTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create map[string]string - Remove []string - }{ - // Add - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: []string{}, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: []string{ - "foo", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: []string{ - "foo", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: []string{ - "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsOrganizations(tagsFromMapOrganizations(tc.Old), tagsFromMapOrganizations(tc.New)) - cm := tagsToMapOrganizations(c) - rl := []string{} - for _, tagName := range r { - rl = append(rl, aws.StringValue(tagName)) - } - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rl, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rl) - } - } -} - -func TestIgnoringTagsOrganizations(t *testing.T) { - var ignoredTags []*organizations.Tag - ignoredTags = append(ignoredTags, &organizations.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &organizations.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredOrganizations(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", aws.StringValue(tag.Key), aws.StringValue(tag.Value)) - } - } -} diff --git a/aws/tagsPinPointApp.go b/aws/tagsPinPointApp.go deleted file mode 100644 index 397c4cff6d6..00000000000 --- a/aws/tagsPinPointApp.go +++ /dev/null @@ -1,133 +0,0 @@ -package aws - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/pinpoint" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" - "log" - "regexp" -) - -// getTags is a helper to get the tags for a resource. It expects the -// tags field to be named "tags" -func getTagsPinPointApp(conn *pinpoint.Pinpoint, d *schema.ResourceData) error { - resp, err := conn.ListTagsForResource(&pinpoint.ListTagsForResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - }) - if err != nil { - return err - } - - if err := d.Set("tags", tagsToMapPinPointApp(resp.TagsModel)); err != nil { - return err - } - - return nil -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapPinPointApp(tm *pinpoint.TagsModel) map[string]string { - result := make(map[string]string) - for key, value := range tm.Tags { - if !tagIgnoredPinPointApp(key, *value) { - result[key] = aws.StringValue(value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredPinPointApp(tagKey string, tagValue string) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, tagKey) - r, _ := regexp.MatchString(v, tagKey) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", tagKey, tagValue) - return true - } - } - return false -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapPinPointApp(m map[string]interface{}) map[string]*string { - result := make(map[string]*string) - for k, v := range m { - if !tagIgnoredPinPointApp(k, v.(string)) { - result[k] = aws.String(v.(string)) - } - } - - return result -} - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsPinPointApp(conn *pinpoint.Pinpoint, 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 := diffTagsPinPointApp(tagsFromMapPinPointApp(o), tagsFromMapPinPointApp(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, 0, len(remove)) - for i := range remove { - k = append(k, &i) - } - - log.Printf("[DEBUG] Removing old tags: %#v", k) - log.Printf("[DEBUG] Removing for arn: %#v", aws.String(d.Get("arn").(string))) - - _, err := conn.UntagResource(&pinpoint.UntagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&pinpoint.TagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - TagsModel: &pinpoint.TagsModel{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 diffTagsPinPointApp(oldTags, newTags map[string]*string) (map[string]*string, map[string]*string) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for k, v := range newTags { - create[k] = aws.StringValue(v) - } - - // Build the list of what to remove - var remove = make(map[string]*string) - for k, v := range oldTags { - old, ok := create[k] - if !ok || old != aws.StringValue(v) { - // Delete it! - remove[k] = v - } else if ok { - delete(create, k) - } - } - - return tagsFromMapPinPointApp(create), remove -} diff --git a/aws/tagsPinPointApp_test.go b/aws/tagsPinPointApp_test.go deleted file mode 100644 index c63e9dc4f42..00000000000 --- a/aws/tagsPinPointApp_test.go +++ /dev/null @@ -1,106 +0,0 @@ -package aws - -import ( - "github.com/aws/aws-sdk-go/service/pinpoint" - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" -) - -// go test -v -run="TestDiffTagsPinPointApp" -func TestDiffTagsPinPointApp(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Add - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{}, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsPinPointApp(tagsFromMapPinPointApp(tc.Old), tagsFromMapPinPointApp(tc.New)) - - cm := tagsToMapPinPointApp(&pinpoint.TagsModel{Tags: c}) - rm := tagsToMapPinPointApp(&pinpoint.TagsModel{Tags: r}) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsPinPointApp" -func TestIgnoringTagsPinPointApp(t *testing.T) { - var ignoredTags = make(map[string]*string) - ignoredTags["aws:cloudformation:logical-id"] = aws.String("foo") - ignoredTags["aws:foo:bar"] = aws.String("baz") - for key, value := range ignoredTags { - if !tagIgnoredPinPointApp(key, *value) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", &key, &value) - } - } -} diff --git a/aws/tagsRAM.go b/aws/tagsRAM.go deleted file mode 100644 index f9fb6bd90fb..00000000000 --- a/aws/tagsRAM.go +++ /dev/null @@ -1,85 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ram" -) - -// 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 diffTagsRAM(oldTags, newTags []*ram.Tag) ([]*ram.Tag, []*ram.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*ram.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } else if ok { - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapRAM(create), remove -} - -// tagsFromMapRAM returns the tags for the given map of data for RAM. -func tagsFromMapRAM(m map[string]interface{}) []*ram.Tag { - result := make([]*ram.Tag, 0, len(m)) - for k, v := range m { - t := &ram.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredRAM(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMapRAM turns the list of RAM tags into a map. -func tagsToMapRAM(ts []*ram.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredRAM(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredRAM(t *ram.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 { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} - -// tagKeysRam returns the keys for the list of RAM tags -func tagKeysRam(ts []*ram.Tag) []*string { - result := make([]*string, 0, len(ts)) - for _, t := range ts { - result = append(result, t.Key) - } - return result -} diff --git a/aws/tagsRAM_test.go b/aws/tagsRAM_test.go deleted file mode 100644 index a18f91ee3a6..00000000000 --- a/aws/tagsRAM_test.go +++ /dev/null @@ -1,111 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ram" -) - -// go test -v -run="TestDiffRAMTags" -func TestDiffRAMTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Add - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{}, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsRAM(tagsFromMapRAM(tc.Old), tagsFromMapRAM(tc.New)) - cm := tagsToMapRAM(c) - rm := tagsToMapRAM(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsRAM" -func TestIgnoringTagsRAM(t *testing.T) { - var ignoredTags []*ram.Tag - ignoredTags = append(ignoredTags, &ram.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &ram.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredRAM(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsRDS.go b/aws/tagsRDS.go deleted file mode 100644 index 9ec4206920a..00000000000 --- a/aws/tagsRDS.go +++ /dev/null @@ -1,134 +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-plugin-sdk/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)) - 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("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) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsRDS_test.go b/aws/tagsRDS_test.go deleted file mode 100644 index 9eceb271792..00000000000 --- a/aws/tagsRDS_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/rds" -) - -func TestDiffRDSTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsRDS(tagsFromMapRDS(tc.Old), tagsFromMapRDS(tc.New)) - cm := tagsToMapRDS(c) - rm := tagsToMapRDS(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsRDS(t *testing.T) { - var ignoredTags []*rds.Tag - ignoredTags = append(ignoredTags, &rds.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &rds.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredRDS(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsRedshift.go b/aws/tagsRedshift.go deleted file mode 100644 index 0747ce29676..00000000000 --- a/aws/tagsRedshift.go +++ /dev/null @@ -1,110 +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-plugin-sdk/helper/schema" -) - -func setTagsRedshift(conn *redshift.Redshift, 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 := diffTagsRedshift(tagsFromMapRedshift(o), tagsFromMapRedshift(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, 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) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsRedshift_test.go b/aws/tagsRedshift_test.go deleted file mode 100644 index ec269e540c9..00000000000 --- a/aws/tagsRedshift_test.go +++ /dev/null @@ -1,74 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/redshift" -) - -func TestDiffRedshiftTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsRedshift(tagsFromMapRedshift(tc.Old), tagsFromMapRedshift(tc.New)) - cm := tagsToMapRedshift(c) - rm := tagsToMapRedshift(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsRedshift(t *testing.T) { - var ignoredTags []*redshift.Tag - ignoredTags = append(ignoredTags, &redshift.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &redshift.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredRedshift(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsRoute53Resolver.go b/aws/tagsRoute53Resolver.go deleted file mode 100644 index 4da93f8fb10..00000000000 --- a/aws/tagsRoute53Resolver.go +++ /dev/null @@ -1,145 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/route53resolver" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// getTags is a helper to get the tags for a resource. It expects the -// tags field to be named "tags" and the ARN field to be named "arn". -func getTagsRoute53Resolver(conn *route53resolver.Route53Resolver, d *schema.ResourceData) error { - tags := make([]*route53resolver.Tag, 0) - req := &route53resolver.ListTagsForResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - } - for { - resp, err := conn.ListTagsForResource(req) - if err != nil { - return err - } - - tags = append(tags, resp.Tags...) - - if resp.NextToken == nil { - break - } - req.NextToken = resp.NextToken - } - - if err := d.Set("tags", tagsToMapRoute53Resolver(tags)); 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" and the ARN field to be named "arn". -func setTagsRoute53Resolver(conn *route53resolver.Route53Resolver, 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 := diffTagsRoute53Resolver(tagsFromMapRoute53Resolver(o), tagsFromMapRoute53Resolver(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.UntagResource(&route53resolver.UntagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&route53resolver.TagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(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 diffTagsRoute53Resolver(oldTags, newTags []*route53resolver.Tag) ([]*route53resolver.Tag, []*route53resolver.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*route53resolver.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - remove = append(remove, t) - } else if ok { - // already present so remove from new - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapRoute53Resolver(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapRoute53Resolver(m map[string]interface{}) []*route53resolver.Tag { - result := make([]*route53resolver.Tag, 0, len(m)) - for k, v := range m { - t := &route53resolver.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredRoute53Resolver(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapRoute53Resolver(ts []*route53resolver.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredRoute53Resolver(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredRoute53Resolver(t *route53resolver.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 { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsRoute53Resolver_test.go b/aws/tagsRoute53Resolver_test.go deleted file mode 100644 index 7a106bd8286..00000000000 --- a/aws/tagsRoute53Resolver_test.go +++ /dev/null @@ -1,111 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/route53resolver" -) - -// go test -v -run="TestDiffRoute53ResolverTags" -func TestDiffRoute53ResolverTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Add - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{}, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsRoute53Resolver(tagsFromMapRoute53Resolver(tc.Old), tagsFromMapRoute53Resolver(tc.New)) - cm := tagsToMapRoute53Resolver(c) - rm := tagsToMapRoute53Resolver(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsRoute53Resolver" -func TestIgnoringTagsRoute53Resolver(t *testing.T) { - var ignoredTags []*route53resolver.Tag - ignoredTags = append(ignoredTags, &route53resolver.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &route53resolver.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredRoute53Resolver(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsSNS.go b/aws/tagsSNS.go deleted file mode 100644 index d8862fc2f1f..00000000000 --- a/aws/tagsSNS.go +++ /dev/null @@ -1,118 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/sns" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" and the ARN field to be named "arn". -func setTagsSNS(conn *sns.SNS, 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 := diffTagsSNS(tagsFromMapSNS(o), tagsFromMapSNS(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.UntagResource(&sns.UntagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&sns.TagResourceInput{ - ResourceArn: aws.String(d.Get("arn").(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 diffTagsSNS(oldTags, newTags []*sns.Tag) ([]*sns.Tag, []*sns.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*sns.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - remove = append(remove, t) - } else if ok { - // already present so remove from new - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapSNS(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapSNS(m map[string]interface{}) []*sns.Tag { - result := make([]*sns.Tag, 0, len(m)) - for k, v := range m { - t := &sns.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredSNS(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapSNS(ts []*sns.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredSNS(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredSNS(t *sns.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsSNS_test.go b/aws/tagsSNS_test.go deleted file mode 100644 index 77a9c149750..00000000000 --- a/aws/tagsSNS_test.go +++ /dev/null @@ -1,110 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/sns" -) - -func TestDiffSNSTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Add - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{}, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsSNS(tagsFromMapSNS(tc.Old), tagsFromMapSNS(tc.New)) - cm := tagsToMapSNS(c) - rm := tagsToMapSNS(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsSNS(t *testing.T) { - ignoredTags := []*sns.Tag{ - { - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }, - { - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }, - } - for _, tag := range ignoredTags { - if !tagIgnoredSNS(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsSSM.go b/aws/tagsSSM.go deleted file mode 100644 index 54b85fc5b39..00000000000 --- a/aws/tagsSSM.go +++ /dev/null @@ -1,137 +0,0 @@ -package aws - -import ( - "fmt" - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ssm" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsSSM(conn *ssm.SSM, d *schema.ResourceData, id, resourceType string) error { - if d.HasChange("tags") { - oraw, nraw := d.GetChange("tags") - o := oraw.(map[string]interface{}) - n := nraw.(map[string]interface{}) - create, remove := diffTagsSSM(tagsFromMapSSM(o), tagsFromMapSSM(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.RemoveTagsFromResource(&ssm.RemoveTagsFromResourceInput{ - ResourceId: aws.String(id), - ResourceType: aws.String(resourceType), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.AddTagsToResource(&ssm.AddTagsToResourceInput{ - ResourceId: aws.String(id), - ResourceType: aws.String(resourceType), - 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 diffTagsSSM(oldTags, newTags []*ssm.Tag) ([]*ssm.Tag, []*ssm.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 []*ssm.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapSSM(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapSSM(m map[string]interface{}) []*ssm.Tag { - result := make([]*ssm.Tag, 0, len(m)) - for k, v := range m { - t := &ssm.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredSSM(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapSSM(ts []*ssm.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredSSM(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 tagIgnoredSSM(t *ssm.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} - -func saveTagsSSM(conn *ssm.SSM, d *schema.ResourceData, id, resourceType string) error { - resp, err := conn.ListTagsForResource(&ssm.ListTagsForResourceInput{ - ResourceId: aws.String(id), - ResourceType: aws.String(resourceType), - }) - - if err != nil { - return fmt.Errorf("Error retrieving tags for SSM resource (%s): %s", id, err) - } - - var dt []*ssm.Tag - if len(resp.TagList) > 0 { - dt = resp.TagList - } - - return d.Set("tags", tagsToMapSSM(dt)) -} diff --git a/aws/tagsSSM_test.go b/aws/tagsSSM_test.go deleted file mode 100644 index 06a0dbc47ea..00000000000 --- a/aws/tagsSSM_test.go +++ /dev/null @@ -1,79 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/ssm" -) - -// go test -v -run="TestDiffSSMTags" -func TestDiffSSMTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsSSM(tagsFromMapSSM(tc.Old), tagsFromMapSSM(tc.New)) - cm := tagsToMapSSM(c) - rm := tagsToMapSSM(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsSSM" -func TestIgnoringTagsSSM(t *testing.T) { - var ignoredTags []*ssm.Tag - ignoredTags = append(ignoredTags, &ssm.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &ssm.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredSSM(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsSecretsManager.go b/aws/tagsSecretsManager.go deleted file mode 100644 index e7547ad7fe6..00000000000 --- a/aws/tagsSecretsManager.go +++ /dev/null @@ -1,75 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/secretsmanager" -) - -// 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 diffTagsSecretsManager(oldTags, newTags []*secretsmanager.Tag) ([]*secretsmanager.Tag, []*secretsmanager.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 []*secretsmanager.Tag - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - // Delete it! - remove = append(remove, t) - } - } - - return tagsFromMapSecretsManager(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapSecretsManager(m map[string]interface{}) []*secretsmanager.Tag { - result := make([]*secretsmanager.Tag, 0, len(m)) - for k, v := range m { - t := &secretsmanager.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredSecretsManager(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapSecretsManager(ts []*secretsmanager.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredSecretsManager(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 tagIgnoredSecretsManager(t *secretsmanager.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, *t.Key) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tagsSecretsManager_test.go b/aws/tagsSecretsManager_test.go deleted file mode 100644 index d6eebe5343c..00000000000 --- a/aws/tagsSecretsManager_test.go +++ /dev/null @@ -1,79 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/secretsmanager" -) - -// go test -v -run="TestDiffSecretsManagerTags" -func TestDiffSecretsManagerTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsSecretsManager(tagsFromMapSecretsManager(tc.Old), tagsFromMapSecretsManager(tc.New)) - cm := tagsToMapSecretsManager(c) - rm := tagsToMapSecretsManager(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsSecretsManager" -func TestIgnoringTagsSecretsManager(t *testing.T) { - var ignoredTags []*secretsmanager.Tag - ignoredTags = append(ignoredTags, &secretsmanager.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &secretsmanager.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredSecretsManager(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsSfn.go b/aws/tagsSfn.go deleted file mode 100644 index 093fbc78fa4..00000000000 --- a/aws/tagsSfn.go +++ /dev/null @@ -1,78 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/sfn" -) - -// 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 diffTagsSfn(oldTags, newTags []*sfn.Tag) ([]*sfn.Tag, []*sfn.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*sfn.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } else if ok { - // already present so remove from new - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapSfn(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapSfn(tagMap map[string]interface{}) []*sfn.Tag { - tags := make([]*sfn.Tag, 0, len(tagMap)) - for tagKey, tagValueRaw := range tagMap { - tag := &sfn.Tag{ - Key: aws.String(tagKey), - Value: aws.String(tagValueRaw.(string)), - } - if !tagIgnoredSfn(tag) { - tags = append(tags, tag) - } - } - - return tags -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapSfn(tags []*sfn.Tag) map[string]string { - tagMap := make(map[string]string) - for _, tag := range tags { - if !tagIgnoredSfn(tag) { - tagMap[aws.StringValue(tag.Key)] = aws.StringValue(tag.Value) - } - } - - return tagMap -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredSfn(t *sfn.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, aws.StringValue(t.Key)) - r, _ := regexp.MatchString(v, aws.StringValue(t.Key)) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", aws.StringValue(t.Key), aws.StringValue(t.Value)) - return true - } - } - return false -} diff --git a/aws/tagsSfn_test.go b/aws/tagsSfn_test.go deleted file mode 100644 index cdb727ef7ec..00000000000 --- a/aws/tagsSfn_test.go +++ /dev/null @@ -1,110 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/sfn" -) - -func TestDiffSfnTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Add - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{}, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsSfn(tagsFromMapSfn(tc.Old), tagsFromMapSfn(tc.New)) - cm := tagsToMapSfn(c) - rm := tagsToMapSfn(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsSfn(t *testing.T) { - ignoredTags := []*sfn.Tag{ - { - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }, - { - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }, - } - for _, tag := range ignoredTags { - if !tagIgnoredSfn(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsTransfer.go b/aws/tagsTransfer.go deleted file mode 100644 index 941e542fc92..00000000000 --- a/aws/tagsTransfer.go +++ /dev/null @@ -1,118 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/transfer" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsTransfer(conn *transfer.Transfer, 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 := diffTagsTransfer(tagsFromMapTransfer(o), tagsFromMapTransfer(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - k := make([]*string, len(remove)) - for i, t := range remove { - k[i] = t.Key - } - - _, err := conn.UntagResource(&transfer.UntagResourceInput{ - Arn: aws.String(d.Get("arn").(string)), - TagKeys: k, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&transfer.TagResourceInput{ - Arn: aws.String(d.Get("arn").(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 diffTagsTransfer(oldTags, newTags []*transfer.Tag) ([]*transfer.Tag, []*transfer.Tag) { - // First, we're creating everything we have - create := make(map[string]interface{}) - for _, t := range newTags { - create[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - - // Build the list of what to remove - var remove []*transfer.Tag - for _, t := range oldTags { - old, ok := create[aws.StringValue(t.Key)] - if !ok || old != aws.StringValue(t.Value) { - // Delete it! - remove = append(remove, t) - } else if ok { - // already present so remove from new - delete(create, aws.StringValue(t.Key)) - } - } - - return tagsFromMapTransfer(create), remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapTransfer(m map[string]interface{}) []*transfer.Tag { - result := make([]*transfer.Tag, 0, len(m)) - for k, v := range m { - t := &transfer.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredTransfer(t) { - result = append(result, t) - } - } - - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapTransfer(ts []*transfer.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredTransfer(t) { - result[aws.StringValue(t.Key)] = aws.StringValue(t.Value) - } - } - - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredTransfer(t *transfer.Tag) bool { - filter := []string{"^aws:"} - for _, v := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", v, aws.StringValue(t.Key)) - if r, _ := regexp.MatchString(v, aws.StringValue(t.Key)); r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", aws.StringValue(t.Key), aws.StringValue(t.Value)) - return true - } - } - return false -} diff --git a/aws/tagsTransfer_test.go b/aws/tagsTransfer_test.go deleted file mode 100644 index abb8cf19638..00000000000 --- a/aws/tagsTransfer_test.go +++ /dev/null @@ -1,112 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/transfer" -) - -// go test -v -run="TestDiffTransferTags" -func TestDiffTransferTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Overlap - { - Old: map[string]interface{}{ - "foo": "bar", - "hello": "world", - }, - New: map[string]interface{}{ - "foo": "baz", - "hello": "world", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Remove - { - Old: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - New: map[string]interface{}{ - "foo": "bar", - }, - Create: map[string]string{}, - Remove: map[string]string{ - "bar": "baz", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsTransfer(tagsFromMapTransfer(tc.Old), tagsFromMapTransfer(tc.New)) - cm := tagsToMapTransfer(c) - rm := tagsToMapTransfer(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -// go test -v -run="TestIgnoringTagsTransfer" -func TestIgnoringTagsTransfer(t *testing.T) { - var ignoredTags []*transfer.Tag - ignoredTags = append(ignoredTags, &transfer.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &transfer.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredTransfer(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tagsWorkspaces.go b/aws/tagsWorkspaces.go new file mode 100644 index 00000000000..c4a925d824d --- /dev/null +++ b/aws/tagsWorkspaces.go @@ -0,0 +1,38 @@ +package aws + +import ( + "fmt" + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/service/workspaces" + "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags" +) + +// WorkspacesUpdateTags custom function, which updates workspaces service tags. +// The identifier is typically the Amazon Resource Name (ARN), although +// it may also be a different identifier depending on the service. +func WorkspacesUpdateTags(conn *workspaces.WorkSpaces, identifier string, oldTagsMap interface{}, newTagsMap interface{}) error { + oldTags := keyvaluetags.New(oldTagsMap) + newTags := keyvaluetags.New(newTagsMap) + + if len(newTags) == 0 { + input := &workspaces.DeleteTagsInput{ + ResourceId: aws.String(identifier), + TagKeys: aws.StringSlice(oldTags.Keys()), + } + + if _, err := conn.DeleteTags(input); err != nil { + return fmt.Errorf("error untagging resource (%s): %w", identifier, err) + } + } else { + input := &workspaces.CreateTagsInput{ + ResourceId: aws.String(identifier), + Tags: newTags.IgnoreAws().WorkspacesTags(), + } + + if _, err := conn.CreateTags(input); err != nil { + return fmt.Errorf("error tagging resource (%s): %w", identifier, err) + } + } + + return nil +} diff --git a/aws/tags_apigateway.go b/aws/tags_apigateway.go deleted file mode 100644 index 56645afd45a..00000000000 --- a/aws/tags_apigateway.go +++ /dev/null @@ -1,44 +0,0 @@ -package aws - -import ( - "log" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/apigateway" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func setTagsAPIGatewayStage(conn *apigateway.APIGateway, 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 := diffTagsGeneric(o, n) - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - keys := make([]*string, 0, len(remove)) - for k := range remove { - keys = append(keys, aws.String(k)) - } - - _, err := conn.UntagResource(&apigateway.UntagResourceInput{ - ResourceArn: aws.String(arn), - TagKeys: keys, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&apigateway.TagResourceInput{ - ResourceArn: aws.String(arn), - Tags: create, - }) - if err != nil { - return err - } - } - } - return nil -} diff --git a/aws/tags_dms.go b/aws/tags_dms.go deleted file mode 100644 index 82bb6aa57ac..00000000000 --- a/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-plugin-sdk/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/aws/tags_dms_test.go b/aws/tags_dms_test.go deleted file mode 100644 index 78388f74dd1..00000000000 --- a/aws/tags_dms_test.go +++ /dev/null @@ -1,114 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - dms "github.com/aws/aws-sdk-go/service/databasemigrationservice" -) - -func TestDmsTagsToMap(t *testing.T) { - tags := []*dms.Tag{ - { - Key: aws.String("test-key-1"), - Value: aws.String("test-value-1"), - }, - { - Key: aws.String("test-key-2"), - Value: aws.String("test-value-2"), - }, - } - - result := dmsTagsToMap(tags) - - for _, tag := range tags { - if v, ok := result[*tag.Key]; ok { - if v != *tag.Value { - t.Fatalf("Key %s had value of %s. Expected %s.", *tag.Key, v, *tag.Value) - } - } else { - t.Fatalf("Key %s not in map.", *tag.Key) - } - } -} - -func TestDmsTagsFromMap(t *testing.T) { - tagMap := map[string]interface{}{ - "test-key-1": "test-value-1", - "test-key-2": "test-value-2", - } - - result := dmsTagsFromMap(tagMap) - - for k, v := range tagMap { - found := false - for _, tag := range result { - if k == *tag.Key { - if v != *tag.Value { - t.Fatalf("Key %s had value of %s. Expected %s.", k, v, *tag.Value) - } - found = true - break - } - } - if !found { - t.Fatalf("Key %s not in tags.", k) - } - } -} - -func TestDmsDiffTags(t *testing.T) { - cases := []struct { - o, n map[string]interface{} - a, r map[string]string - }{ - // basic add / remove - { - o: map[string]interface{}{"test-key-1": "test-value-1"}, - n: map[string]interface{}{"test-key-2": "test-value-2"}, - a: map[string]string{"test-key-2": "test-value-2"}, - r: map[string]string{"test-key-1": "test-value-1"}, - }, - // modify - { - o: map[string]interface{}{"test-key-1": "test-value-1"}, - n: map[string]interface{}{"test-key-1": "test-value-1-modified"}, - a: map[string]string{"test-key-1": "test-value-1-modified"}, - r: map[string]string{"test-key-1": "test-value-1"}, - }, - } - - for _, c := range cases { - ar, rr := dmsDiffTags(dmsTagsFromMap(c.o), dmsTagsFromMap(c.n)) - a := dmsTagsToMap(ar) - r := dmsTagsToMap(rr) - - if !reflect.DeepEqual(a, c.a) { - t.Fatalf("Add tags mismatch: Actual %#v; Expected %#v", a, c.a) - } - if !reflect.DeepEqual(r, c.r) { - t.Fatalf("Remove tags mismatch: Actual %#v; Expected %#v", r, c.r) - } - } -} - -func TestDmsGetTagKeys(t *testing.T) { - tags := []*dms.Tag{ - { - Key: aws.String("test-key-1"), - Value: aws.String("test-value-1"), - }, - { - Key: aws.String("test-key-2"), - Value: aws.String("test-value-2"), - }, - } - - result := dmsGetTagKeys(tags) - expected := []*string{aws.String("test-key-1"), aws.String("test-key-2")} - - if !reflect.DeepEqual(result, expected) { - t.Fatalf("Actual %s; Expected %s", aws.StringValueSlice(result), aws.StringValueSlice(expected)) - } -} diff --git a/aws/tags_elasticsearchservice.go b/aws/tags_elasticsearchservice.go deleted file mode 100644 index 4a79e1450b8..00000000000 --- a/aws/tags_elasticsearchservice.go +++ /dev/null @@ -1,115 +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-plugin-sdk/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) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tags_elasticsearchservice_test.go b/aws/tags_elasticsearchservice_test.go deleted file mode 100644 index c595b997fb8..00000000000 --- a/aws/tags_elasticsearchservice_test.go +++ /dev/null @@ -1,103 +0,0 @@ -package aws - -import ( - "fmt" - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - elasticsearch "github.com/aws/aws-sdk-go/service/elasticsearchservice" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" -) - -func TestDiffElasticsearchServiceTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsElasticsearchService(tagsFromMapElasticsearchService(tc.Old), tagsFromMapElasticsearchService(tc.New)) - cm := tagsToMapElasticsearchService(c) - rm := tagsToMapElasticsearchService(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsElasticsearchService(t *testing.T) { - var ignoredTags []*elasticsearch.Tag - ignoredTags = append(ignoredTags, &elasticsearch.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &elasticsearch.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredElasticsearchService(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} - -// testAccCheckTags can be used to check the tags on a resource. -func testAccCheckElasticsearchServiceTags( - ts *[]*elasticsearch.Tag, key string, value string) resource.TestCheckFunc { - return func(s *terraform.State) error { - m := tagsToMapElasticsearchService(*ts) - v, ok := m[key] - if value != "" && !ok { - return fmt.Errorf("Missing tag: %s", key) - } else if value == "" && ok { - return fmt.Errorf("Extra tag: %s", key) - } - if value == "" { - return nil - } - - if v != value { - return fmt.Errorf("%s: bad value: %s", key, v) - } - - return nil - } -} diff --git a/aws/tags_kinesis.go b/aws/tags_kinesis.go deleted file mode 100644 index b73809aea3a..00000000000 --- a/aws/tags_kinesis.go +++ /dev/null @@ -1,146 +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-plugin-sdk/helper/schema" -) - -// Kinesis requires tagging operations be split into 10 tag batches -const kinesisTagBatchLimit = 10 - -// 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) - - tagKeysBatch := make([]*string, 0, kinesisTagBatchLimit) - tagKeysBatches := make([][]*string, 0, len(remove)/kinesisTagBatchLimit+1) - for _, tag := range remove { - if len(tagKeysBatch) == kinesisTagBatchLimit { - tagKeysBatches = append(tagKeysBatches, tagKeysBatch) - tagKeysBatch = make([]*string, 0, kinesisTagBatchLimit) - } - tagKeysBatch = append(tagKeysBatch, tag.Key) - } - tagKeysBatches = append(tagKeysBatches, tagKeysBatch) - - for _, tagKeys := range tagKeysBatches { - _, err := conn.RemoveTagsFromStream(&kinesis.RemoveTagsFromStreamInput{ - StreamName: aws.String(sn), - TagKeys: tagKeys, - }) - if err != nil { - return err - } - } - } - - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - - tagsBatch := make(map[string]*string) - tagsBatches := make([]map[string]*string, 0, len(create)/kinesisTagBatchLimit+1) - for _, tag := range create { - if len(tagsBatch) == kinesisTagBatchLimit { - tagsBatches = append(tagsBatches, tagsBatch) - tagsBatch = make(map[string]*string) - } - tagsBatch[aws.StringValue(tag.Key)] = tag.Value - } - tagsBatches = append(tagsBatches, tagsBatch) - - for _, tags := range tagsBatches { - _, err := conn.AddTagsToStream(&kinesis.AddTagsToStreamInput{ - StreamName: aws.String(sn), - Tags: tags, - }) - 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) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tags_kinesis_test.go b/aws/tags_kinesis_test.go deleted file mode 100644 index 2c499f1fb92..00000000000 --- a/aws/tags_kinesis_test.go +++ /dev/null @@ -1,77 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/kinesis" -) - -func TestDiffTagsKinesis(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsKinesis(tagsFromMapKinesis(tc.Old), tagsFromMapKinesis(tc.New)) - cm := tagsToMapKinesis(c) - rm := tagsToMapKinesis(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsKinesis(t *testing.T) { - var ignoredTags []*kinesis.Tag - ignoredTags = append(ignoredTags, &kinesis.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &kinesis.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredKinesis(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} diff --git a/aws/tags_msk.go b/aws/tags_msk.go deleted file mode 100644 index 56ce5689097..00000000000 --- a/aws/tags_msk.go +++ /dev/null @@ -1,102 +0,0 @@ -package aws - -import ( - "log" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - kafka "github.com/aws/aws-sdk-go/service/kafka" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -// setTags is a helper to set the tags for a resource. It expects the -// tags field to be named "tags" -func setTagsMskCluster(conn *kafka.Kafka, 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 := diffTagsMskCluster(tagsFromMapMskCluster(o), tagsFromMapMskCluster(n)) - - // Set tags - if len(remove) > 0 { - log.Printf("[DEBUG] Removing tags: %#v", remove) - keys := make([]*string, 0, len(remove)) - for k := range remove { - keys = append(keys, aws.String(k)) - } - _, err := conn.UntagResource(&kafka.UntagResourceInput{ - ResourceArn: aws.String(arn), - TagKeys: keys, - }) - if err != nil { - return err - } - } - if len(create) > 0 { - log.Printf("[DEBUG] Creating tags: %#v", create) - _, err := conn.TagResource(&kafka.TagResourceInput{ - ResourceArn: 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 diffTagsMskCluster(oldTags, newTags map[string]*string) (map[string]*string, map[string]*string) { - - // Build the list of what to remove - remove := make(map[string]*string) - for k, v := range oldTags { - newVal, existsInNew := newTags[k] - if !existsInNew || *newVal != *v { - // Delete it! - remove[k] = v - } - } - return newTags, remove -} - -// tagsFromMap returns the tags for the given map of data. -func tagsFromMapMskCluster(m map[string]interface{}) map[string]*string { - result := make(map[string]*string) - for k, v := range m { - if !tagIgnoredMskCluster(k, v.(string)) { - result[k] = aws.String(v.(string)) - } - } - return result -} - -// tagsToMap turns the list of tags into a map. -func tagsToMapMskCluster(ts map[string]*string) map[string]string { - result := make(map[string]string) - for k, v := range ts { - if !tagIgnoredMskCluster(k, aws.StringValue(v)) { - result[k] = aws.StringValue(v) - } - } - return result -} - -// compare a tag against a list of strings and checks if it should -// be ignored or not -func tagIgnoredMskCluster(key, value string) bool { - filter := []string{"^aws:"} - for _, ignore := range filter { - log.Printf("[DEBUG] Matching %v with %v\n", ignore, key) - r, _ := regexp.MatchString(ignore, key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val %s), ignoring.\n", key, value) - return true - } - } - return false -} diff --git a/aws/tags_msk_test.go b/aws/tags_msk_test.go deleted file mode 100644 index fb19a55866e..00000000000 --- a/aws/tags_msk_test.go +++ /dev/null @@ -1,104 +0,0 @@ -package aws - -import ( - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/kafka" -) - -func TestDiffMskClusterTags(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsMskCluster(tagsFromMapMskCluster(tc.Old), tagsFromMapMskCluster(tc.New)) - cm := tagsToMapMskCluster(c) - rm := tagsToMapMskCluster(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestTagsToMapMskCluster(t *testing.T) { - source := map[string]*string{ - "foo": aws.String("bar"), - "bar": aws.String("baz"), - } - - inter := make(map[string]interface{}) - for k, v := range tagsToMapMskCluster(source) { - inter[k] = v - } - - final := tagsFromMapMskCluster(inter) - - if !reflect.DeepEqual(source, final) { - t.Fatalf("bad tag transformation: %v -> %v -> %v", source, inter, final) - } -} - -func TestIgnoringTagsMskCluster(t *testing.T) { - ignoredTags := map[string]string{ - "aws:cloudformation:logical-id": "foo", - "aws:foo:bar": "baz", - } - for k, v := range ignoredTags { - if !tagIgnoredMskCluster(k, v) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", k, v) - } - } -} - -func TestCheckMskClusterTags(t *testing.T) { - tags := make(map[string]*string) - tags["foo"] = aws.String("bar") - td := &kafka.ListTagsForResourceOutput{ - Tags: tags, - } - - testFunc := testAccCheckMskClusterTags(td, "foo", "bar") - err := testFunc(nil) - if err != nil { - t.Fatalf("Failed when expected to succeed: %s", err) - } -} diff --git a/aws/tags_route53.go b/aws/tags_route53.go deleted file mode 100644 index 0238250e9ad..00000000000 --- a/aws/tags_route53.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/route53" - "github.com/hashicorp/terraform-plugin-sdk/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) - r, _ := regexp.MatchString(v, *t.Key) - if r { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tags_route53_test.go b/aws/tags_route53_test.go deleted file mode 100644 index 139d13b0313..00000000000 --- a/aws/tags_route53_test.go +++ /dev/null @@ -1,103 +0,0 @@ -package aws - -import ( - "fmt" - "reflect" - "testing" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/service/route53" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/terraform" -) - -func TestDiffTagsR53(t *testing.T) { - cases := []struct { - Old, New map[string]interface{} - Create, Remove map[string]string - }{ - // Basic add/remove - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "bar": "baz", - }, - Create: map[string]string{ - "bar": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - - // Modify - { - Old: map[string]interface{}{ - "foo": "bar", - }, - New: map[string]interface{}{ - "foo": "baz", - }, - Create: map[string]string{ - "foo": "baz", - }, - Remove: map[string]string{ - "foo": "bar", - }, - }, - } - - for i, tc := range cases { - c, r := diffTagsR53(tagsFromMapR53(tc.Old), tagsFromMapR53(tc.New)) - cm := tagsToMapR53(c) - rm := tagsToMapR53(r) - if !reflect.DeepEqual(cm, tc.Create) { - t.Fatalf("%d: bad create: %#v", i, cm) - } - if !reflect.DeepEqual(rm, tc.Remove) { - t.Fatalf("%d: bad remove: %#v", i, rm) - } - } -} - -func TestIgnoringTagsRoute53(t *testing.T) { - var ignoredTags []*route53.Tag - ignoredTags = append(ignoredTags, &route53.Tag{ - Key: aws.String("aws:cloudformation:logical-id"), - Value: aws.String("foo"), - }) - ignoredTags = append(ignoredTags, &route53.Tag{ - Key: aws.String("aws:foo:bar"), - Value: aws.String("baz"), - }) - for _, tag := range ignoredTags { - if !tagIgnoredRoute53(tag) { - t.Fatalf("Tag %v with value %v not ignored, but should be!", *tag.Key, *tag.Value) - } - } -} - -// testAccCheckTags can be used to check the tags on a resource. -func testAccCheckTagsR53( - ts *[]*route53.Tag, key string, value string) resource.TestCheckFunc { - return func(s *terraform.State) error { - m := tagsToMapR53(*ts) - v, ok := m[key] - if value != "" && !ok { - return fmt.Errorf("Missing tag: %s", key) - } else if value == "" && ok { - return fmt.Errorf("Extra tag: %s", key) - } - if value == "" { - return nil - } - - if v != value { - return fmt.Errorf("%s: bad value: %s", key, v) - } - - return nil - } -} diff --git a/aws/tags_sagemaker.go b/aws/tags_sagemaker.go deleted file mode 100644 index 4f88959a4e8..00000000000 --- a/aws/tags_sagemaker.go +++ /dev/null @@ -1,128 +0,0 @@ -package aws - -import ( - "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/sagemaker" - "github.com/hashicorp/terraform-plugin-sdk/helper/resource" - "github.com/hashicorp/terraform-plugin-sdk/helper/schema" -) - -func tagsFromMapSagemaker(m map[string]interface{}) []*sagemaker.Tag { - result := make([]*sagemaker.Tag, 0, len(m)) - for k, v := range m { - t := &sagemaker.Tag{ - Key: aws.String(k), - Value: aws.String(v.(string)), - } - if !tagIgnoredSagemaker(t) { - result = append(result, t) - } - } - - return result -} - -func tagsToMapSagemaker(ts []*sagemaker.Tag) map[string]string { - result := make(map[string]string) - for _, t := range ts { - if !tagIgnoredSagemaker(t) { - result[*t.Key] = *t.Value - } - } - - return result -} - -func setSagemakerTags(conn *sagemaker.SageMaker, 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 := diffSagemakerTags(tagsFromMapSagemaker(o), tagsFromMapSagemaker(n)) - - if len(remove) > 0 { - input := &sagemaker.DeleteTagsInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - TagKeys: remove, - } - err := resource.Retry(5*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] Removing tags: %#v from %s", remove, d.Id()) - _, err := conn.DeleteTags(input) - if err != nil { - sagemakerErr, ok := err.(awserr.Error) - if ok && sagemakerErr.Code() == "ResourceNotFound" { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - return nil - }) - if isResourceTimeoutError(err) { - _, err = conn.DeleteTags(input) - } - if err != nil { - return err - } - } - if len(create) > 0 { - input := &sagemaker.AddTagsInput{ - ResourceArn: aws.String(d.Get("arn").(string)), - Tags: create, - } - err := resource.Retry(5*time.Minute, func() *resource.RetryError { - log.Printf("[DEBUG] Creating tags: %s for %s", create, d.Id()) - _, err := conn.AddTags(input) - if err != nil { - sagemakerErr, ok := err.(awserr.Error) - if ok && sagemakerErr.Code() == "ResourceNotFound" { - return resource.RetryableError(err) - } - return resource.NonRetryableError(err) - } - return nil - }) - if isResourceTimeoutError(err) { - _, err = conn.AddTags(input) - } - if err != nil { - return err - } - } - } - - return nil -} - -func diffSagemakerTags(oldTags, newTags []*sagemaker.Tag) ([]*sagemaker.Tag, []*string) { - create := make(map[string]interface{}) - for _, t := range newTags { - create[*t.Key] = *t.Value - } - - var remove []*string - for _, t := range oldTags { - old, ok := create[*t.Key] - if !ok || old != *t.Value { - remove = append(remove, t.Key) - } - } - - return tagsFromMapSagemaker(create), remove -} - -func tagIgnoredSagemaker(t *sagemaker.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 { - log.Printf("[DEBUG] Found AWS specific tag %s (val: %s), ignoring.\n", *t.Key, *t.Value) - return true - } - } - return false -} diff --git a/aws/tags_test.go b/aws/tags_test.go index 33354d72a6a..e48be979273 100644 --- a/aws/tags_test.go +++ b/aws/tags_test.go @@ -112,50 +112,6 @@ func TestIgnoringTags(t *testing.T) { } } -func TestTagsMapToHash(t *testing.T) { - cases := []struct { - Left, Right map[string]interface{} - MustBeEqual bool - }{ - { - Left: map[string]interface{}{}, - Right: map[string]interface{}{}, - MustBeEqual: true, - }, - { - Left: map[string]interface{}{ - "foo": "bar", - "bar": "baz", - }, - Right: map[string]interface{}{ - "bar": "baz", - "foo": "bar", - }, - MustBeEqual: true, - }, - { - Left: map[string]interface{}{ - "foo": "bar", - }, - Right: map[string]interface{}{ - "bar": "baz", - }, - MustBeEqual: false, - }, - } - - for i, tc := range cases { - l := tagsMapToHash(tc.Left) - r := tagsMapToHash(tc.Right) - if tc.MustBeEqual && (l != r) { - t.Fatalf("%d: Hashes don't match", i) - } - if !tc.MustBeEqual && (l == r) { - t.Logf("%d: Hashes match", i) - } - } -} - // testAccCheckTags can be used to check the tags on a resource. func testAccCheckTags( ts *[]*ec2.Tag, key string, value string) resource.TestCheckFunc { diff --git a/aws/test-fixtures/transfer-ssh-rsa-key b/aws/test-fixtures/transfer-ssh-rsa-key new file mode 100644 index 00000000000..fcb660f95d5 --- /dev/null +++ b/aws/test-fixtures/transfer-ssh-rsa-key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEA4ax0cQyliFL+b8XVO3nRaOp2w1HBts8rAGO+kSNw/1rPcZgt +SzUfYkGEPGRnPfvBhqB5AurPdcy1QPAdXTa3XWoDMkBHNJL7jLObbCatUG74Nu5S +SBZoARYHCvG7+R+XQor8rQqX85eMycJssaPpi3Dw2iRlxd46eapgT5tQhJRnY9aC +EKud20UL7bMoM0QwBR+jD2F0yZ4ColcbltObrauxtgnlVs09iGrOYwXeJ14JR6Za +JI9QnTsvP/Y8vBfnvOZVhcngPFJG2UqHafut0g/SMc55GjXMdIff6qsfVui+SrbU +Z4OpdqdzfuK3gUVGa6H2W+znJgen8hRWXJAK5wIDAQABAoIBAQC6HYEWruhhypie +U9jsqSWkUiHKKcYJ30dGlfxXNJR/dEQ7GdbY/KG6ZfAJ4oAm5VcQkY3bcw3PyBj/ +ykddVb/Z4ZFrQwm2eTXOL14RzsAG4s4Ad4ISg7AYnTMHup9c8MnNjlSe3Wq98ZGh +35/GzTjR0D5Cmdv5WLJ/Hp05agz4mOKexdHSjVjAafbw6SRBseeREWOaGZGiWJPn +iaZFAnP6N16dEo3WwPcA12KOIuUaBNb5FY2TBo8srqmvC57/UlyD9UmCMVQ8tMUR +1pGMoCyyc2ozrh2y5G49Kq2KzXwl692IOOXTbqCLSqXndBj5+J5zSl9onb7fdNgC +0XO6xcEJAoGBAP6+U/ntiz9c6lJtmIYqMsYh2MtunsCvr64U46Ry8ITkkgyiMy1K +T0k7FIKXt/TI5iCb/LrnV5TIWTlN3GnuPzodLNkQTgnmvj16zSLktKQvof93ztVF +E0a/ge2zf/FumbVBKzqL+njjfEskcAM1+mLm+kXGsCZXqhj8EwOpLFh1AoGBAOLJ +a2VsDEQmjmlnK8cwWLlpraEgzgPxpExqL4M3Ca59mrfr9QS06BlhQILkBsTjq/GH +L0uoOQkI0YrgBAREXCc2LbiTiYhys98NA+asIvaek+ar2Dd9ulktT3Fi/+SpQwpc +8oJswMp8aLiSobnDrj0F7q5WgwomI0ilNDkW+IprAoGBAJmZcVEVZgzCnZct9fWP +pCXLasje3mIYjLlOZyRVGalHmLh9ZJY+ZCgns2o6yPST3g5zf6PCshBH7WScCfbl +bMJBrTUEm8lkk/jF/sK3XCRThD5hoxj9GW5jMph8zvxoT832iXY3yMLzh5JXWiLV +fS/9TZKdBsFXwnxmIaDndJGxAoGAde2lQg0oZ7vg7CBxHFggmvHADvx/BIAAHphM +8p+JEkpQTPmO5I6p7qCqqiWm+3UkcSkJx/7HAdKrG9sXW5ysittadROLPf/fVspu +z+GNIM8fO6D6gwiHAV5VZDHFvQLjUJ06oeWpbuG4ltnw7Sc7EJJoJhHofDuOt3To +rhMq1NcCgYBli9IKolI0a6BqCiObf0lBHRmoygx6z/i/1B1ClgtFsPrI4u7yQhIc +Zav2+HR68nDd+OeUmns6nTDuUulUGcpoVGUCbJZXTBCHf4ofkWFb2CNoAqr5aKa4 +gTXiO9Zs8zwiuVAggcdPSNQIPrqh+mVD7pEhcM0HYQ7fD2FS4OS3Gw== +-----END RSA PRIVATE KEY----- diff --git a/aws/tls.go b/aws/tls.go index bbb807d74dc..e91f9ecba77 100644 --- a/aws/tls.go +++ b/aws/tls.go @@ -3,6 +3,7 @@ package aws import ( "crypto/rand" "crypto/rsa" + "crypto/sha1" "crypto/x509" "crypto/x509/pkix" "encoding/pem" @@ -63,6 +64,122 @@ func tlsRsaPublicKeyPem(keyPem string) string { return string(pem.EncodeToMemory(block)) } +// tlsRsaX509LocallySignedCertificatePem generates a local CA x509 certificate PEM string. +// Wrap with tlsPemEscapeNewlines() to allow simple fmt.Sprintf() +// configurations such as: certificate_pem = "%[1]s" +func tlsRsaX509LocallySignedCertificatePem(caKeyPem, caCertificatePem, keyPem, commonName string) string { + caCertificateBlock, _ := pem.Decode([]byte(caCertificatePem)) + + caCertificate, err := x509.ParseCertificate(caCertificateBlock.Bytes) + + if err != nil { + panic(err) + } + + caKeyBlock, _ := pem.Decode([]byte(caKeyPem)) + + caKey, err := x509.ParsePKCS1PrivateKey(caKeyBlock.Bytes) + + if err != nil { + panic(err) + } + + keyBlock, _ := pem.Decode([]byte(keyPem)) + + key, err := x509.ParsePKCS1PrivateKey(keyBlock.Bytes) + + if err != nil { + panic(err) + } + + serialNumber, err := rand.Int(rand.Reader, tlsX509CertificateSerialNumberLimit) + + if err != nil { + panic(err) + } + + certificate := &x509.Certificate{ + BasicConstraintsValid: true, + ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, + KeyUsage: x509.KeyUsageDigitalSignature | x509.KeyUsageKeyEncipherment, + NotAfter: time.Now().Add(24 * time.Hour), + NotBefore: time.Now(), + SerialNumber: serialNumber, + Subject: pkix.Name{ + CommonName: commonName, + Organization: []string{"ACME Examples, Inc"}, + }, + } + + certificateBytes, err := x509.CreateCertificate(rand.Reader, certificate, caCertificate, &key.PublicKey, caKey) + + if err != nil { + panic(err) + } + + certificateBlock := &pem.Block{ + Bytes: certificateBytes, + Type: pemBlockTypeCertificate, + } + + return string(pem.EncodeToMemory(certificateBlock)) +} + +// tlsRsaX509SelfSignedCaCertificatePem generates a x509 CA certificate PEM string. +// Wrap with tlsPemEscapeNewlines() to allow simple fmt.Sprintf() +// configurations such as: root_certificate_pem = "%[1]s" +func tlsRsaX509SelfSignedCaCertificatePem(keyPem string) string { + keyBlock, _ := pem.Decode([]byte(keyPem)) + + key, err := x509.ParsePKCS1PrivateKey(keyBlock.Bytes) + + if err != nil { + panic(err) + } + + publicKeyBytes, err := x509.MarshalPKIXPublicKey(&key.PublicKey) + + if err != nil { + panic(err) + } + + publicKeyBytesSha1 := sha1.Sum(publicKeyBytes) + + serialNumber, err := rand.Int(rand.Reader, tlsX509CertificateSerialNumberLimit) + + if err != nil { + panic(err) + } + + certificate := &x509.Certificate{ + BasicConstraintsValid: true, + ExtKeyUsage: []x509.ExtKeyUsage{x509.ExtKeyUsageServerAuth}, + IsCA: true, + KeyUsage: x509.KeyUsageDigitalSignature | x509.KeyUsageKeyEncipherment, + NotAfter: time.Now().Add(24 * time.Hour), + NotBefore: time.Now(), + SerialNumber: serialNumber, + Subject: pkix.Name{ + CommonName: "ACME Root CA", + Organization: []string{"ACME Examples, Inc"}, + }, + SubjectKeyId: publicKeyBytesSha1[:], + } + + certificateBytes, err := x509.CreateCertificate(rand.Reader, certificate, certificate, &key.PublicKey, key) + + if err != nil { + panic(err) + } + + certificateBlock := &pem.Block{ + Bytes: certificateBytes, + Type: pemBlockTypeCertificate, + } + + return string(pem.EncodeToMemory(certificateBlock)) +} + // tlsRsaX509SelfSignedCertificatePem generates a x509 certificate PEM string. // Wrap with tlsPemEscapeNewlines() to allow simple fmt.Sprintf() // configurations such as: private_key_pem = "%[1]s" diff --git a/aws/tls_test.go b/aws/tls_test.go index 259f766e5d1..315907f4db9 100644 --- a/aws/tls_test.go +++ b/aws/tls_test.go @@ -22,11 +22,31 @@ func TestTlsRsaPublicKeyPem(t *testing.T) { } } -func TestTlsRsaX509CertificatePem(t *testing.T) { +func TestTlsRsaX509LocallySignedCertificatePem(t *testing.T) { + caKey := tlsRsaPrivateKeyPem(2048) + caCertificate := tlsRsaX509SelfSignedCaCertificatePem(caKey) + key := tlsRsaPrivateKeyPem(2048) + certificate := tlsRsaX509LocallySignedCertificatePem(caKey, caCertificate, key, "example.com") + + if !strings.Contains(certificate, pemBlockTypeCertificate) { + t.Errorf("certificate does not contain CERTIFICATE: %s", certificate) + } +} + +func TestTlsRsaX509SelfSignedCaCertificatePem(t *testing.T) { + caKey := tlsRsaPrivateKeyPem(2048) + caCertificate := tlsRsaX509SelfSignedCaCertificatePem(caKey) + + if !strings.Contains(caCertificate, pemBlockTypeCertificate) { + t.Errorf("CA certificate does not contain CERTIFICATE: %s", caCertificate) + } +} + +func TestTlsRsaX509SelfSignedCertificatePem(t *testing.T) { key := tlsRsaPrivateKeyPem(2048) certificate := tlsRsaX509SelfSignedCertificatePem(key, "example.com") if !strings.Contains(certificate, pemBlockTypeCertificate) { - t.Errorf("key does not contain CERTIFICATE: %s", certificate) + t.Errorf("certificate does not contain CERTIFICATE: %s", certificate) } } diff --git a/aws/validators.go b/aws/validators.go index f2f549bb768..5a177cd1427 100644 --- a/aws/validators.go +++ b/aws/validators.go @@ -10,6 +10,7 @@ import ( "strings" "time" + "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/service/apigateway" "github.com/aws/aws-sdk-go/service/cognitoidentity" "github.com/aws/aws-sdk-go/service/configservice" @@ -21,47 +22,15 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) -// FloatAtLeast returns a SchemaValidateFunc which tests if the provided value -// is of type float and is at least min (inclusive) -func FloatAtLeast(min float64) schema.SchemaValidateFunc { - return func(i interface{}, k string) (s []string, es []error) { - v, ok := i.(float64) - if !ok { - es = append(es, fmt.Errorf("expected type of %s to be float", k)) - return - } - - if v < min { - es = append(es, fmt.Errorf("expected %s to be at least (%f), got %f", k, min, v)) - return - } - - return - } -} - -// validateStringNotMatch returns a SchemaValidateFunc which tests if the provided value -// does not match a given regexp. Optionally an error message can be provided to -// return something friendlier than "must match some globby regexp". -// This function is an inverse copy of validation.StringMatch and will be -// migrated to the Terraform Provider SDK. -func validateStringNotMatch(r *regexp.Regexp, message string) schema.SchemaValidateFunc { - return func(i interface{}, k string) ([]string, []error) { - v, ok := i.(string) - if !ok { - return nil, []error{fmt.Errorf("expected type of %s to be string", k)} - } +const ( + awsAccountIDRegexpPattern = `^(aws|\d{12})$` + awsPartitionRegexpPattern = `^aws(-[a-z]+)*$` + awsRegionRegexpPattern = `^[a-z]{2}(-[a-z]+)+-\d$` +) - if ok := r.MatchString(v); ok { - if message != "" { - return nil, []error{fmt.Errorf("invalid value for %s (%s)", k, message)} - - } - return nil, []error{fmt.Errorf("expected value of %s to not match regular expression %q", k, r)} - } - return nil, nil - } -} +var awsAccountIDRegexp = regexp.MustCompile(awsAccountIDRegexpPattern) +var awsPartitionRegexp = regexp.MustCompile(awsPartitionRegexpPattern) +var awsRegionRegexp = regexp.MustCompile(awsRegionRegexpPattern) // validateTypeStringNullableBoolean provides custom error messaging for TypeString booleans // Some arguments require three values: true, false, and "" (unspecified). @@ -688,12 +657,29 @@ func validateArn(v interface{}, k string) (ws []string, errors []error) { return } - // http://docs.aws.amazon.com/lambda/latest/dg/API_AddPermission.html - pattern := `^arn:[\w-]+:([a-zA-Z0-9\-])+:([a-z]{2}-(gov-)?[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)) + parsedARN, err := arn.Parse(value) + + if err != nil { + errors = append(errors, fmt.Errorf("%q (%s) is an invalid ARN: %s", k, value, err)) + return + } + + if parsedARN.Partition == "" { + errors = append(errors, fmt.Errorf("%q (%s) is an invalid ARN: missing partition value", k, value)) + } else if !awsPartitionRegexp.MatchString(parsedARN.Partition) { + errors = append(errors, fmt.Errorf("%q (%s) is an invalid ARN: invalid partition value (expecting to match regular expression: %s)", k, value, awsPartitionRegexpPattern)) + } + + if parsedARN.Region != "" && !awsRegionRegexp.MatchString(parsedARN.Region) { + errors = append(errors, fmt.Errorf("%q (%s) is an invalid ARN: invalid region value (expecting to match regular expression: %s)", k, value, awsRegionRegexpPattern)) + } + + if parsedARN.AccountID != "" && !awsAccountIDRegexp.MatchString(parsedARN.AccountID) { + errors = append(errors, fmt.Errorf("%q (%s) is an invalid ARN: invalid account ID value (expecting to match regular expression: %s)", k, value, awsAccountIDRegexpPattern)) + } + + if parsedARN.Resource == "" { + errors = append(errors, fmt.Errorf("%q (%s) is an invalid ARN: missing resource value", k, value)) } return @@ -1821,6 +1807,14 @@ func validateBatchName(v interface{}, k string) (ws []string, errors []error) { return } +func validateBatchPrefix(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + if !regexp.MustCompile(`^[0-9a-zA-Z]{1}[0-9a-zA-Z_\-]{0,101}$`).MatchString(value) { + errors = append(errors, fmt.Errorf("%q (%q) must be up to 102 letters (uppercase and lowercase), numbers, underscores and dashes, and must start with an alphanumeric.", k, v)) + } + return +} + func validateSecurityGroupRuleDescription(v interface{}, k string) (ws []string, errors []error) { value := v.(string) if len(value) > 255 { @@ -1830,7 +1824,7 @@ func validateSecurityGroupRuleDescription(v interface{}, k string) (ws []string, // https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IpRange.html. Note that // "" is an allowable description value. - pattern := `^[A-Za-z0-9 \.\_\-\:\/\(\)\#\,\@\[\]\+\=\;\{\}\!\$\*]*$` + pattern := `^[A-Za-z0-9 \.\_\-\:\/\(\)\#\,\@\[\]\+\=\&\;\{\}\!\$\*]*$` if !regexp.MustCompile(pattern).MatchString(value) { errors = append(errors, fmt.Errorf( "%q doesn't comply with restrictions (%q): %q", diff --git a/aws/validators_test.go b/aws/validators_test.go index 623f684f573..3625b451c06 100644 --- a/aws/validators_test.go +++ b/aws/validators_test.go @@ -2,11 +2,11 @@ package aws import ( "fmt" + "github.com/aws/aws-sdk-go/service/cognitoidentity" + "github.com/hashicorp/terraform-plugin-sdk/helper/acctest" "regexp" "strings" "testing" - - "github.com/aws/aws-sdk-go/service/cognitoidentity" ) func TestValidateTypeStringNullableBoolean(t *testing.T) { @@ -321,13 +321,20 @@ func TestValidateArn(t *testing.T) { validNames := []string{ "arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/MyEnvironment", // Beanstalk "arn:aws:iam::123456789012:user/David", // IAM User + "arn:aws:iam::aws:policy/CloudWatchReadOnlyAccess", // Managed IAM policy "arn:aws:rds:eu-west-1:123456789012:db:mysql-db", // RDS "arn:aws:s3:::my_corporate_bucket/exampleobject.png", // S3 object "arn:aws:events:us-east-1:319201112229:rule/rule_name", // CloudWatch Rule "arn:aws:lambda:eu-west-1:319201112229:function:myCustomFunction", // Lambda function "arn:aws:lambda:eu-west-1:319201112229:function:myCustomFunction:Qualifier", // Lambda func qualifier - "arn:aws-us-gov:s3:::corp_bucket/object.png", // GovCloud ARN - "arn:aws-us-gov:kms:us-gov-west-1:123456789012:key/some-uuid-abc123", // GovCloud KMS ARN + "arn:aws-cn:ec2:cn-north-1:123456789012:instance/i-12345678", // China EC2 ARN + "arn:aws-cn:s3:::bucket/object", // China S3 ARN + "arn:aws-iso:ec2:us-iso-east-1:123456789012:instance/i-12345678", // C2S EC2 ARN + "arn:aws-iso:s3:::bucket/object", // C2S S3 ARN + "arn:aws-iso-b:ec2:us-isob-east-1:123456789012:instance/i-12345678", // SC2S EC2 ARN + "arn:aws-iso-b:s3:::bucket/object", // SC2S S3 ARN + "arn:aws-us-gov:ec2:us-gov-west-1:123456789012:instance/i-12345678", // GovCloud EC2 ARN + "arn:aws-us-gov:s3:::bucket/object", // GovCloud S3 ARN } for _, v := range validNames { _, errors := validateArn(v, "arn") @@ -1474,7 +1481,7 @@ func TestValidateNeptuneEventSubscriptionName(t *testing.T) { ErrCount: 1, }, { - Value: randomString(256), + Value: acctest.RandStringFromCharSet(256, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -1504,7 +1511,7 @@ func TestValidateNeptuneEventSubscriptionNamePrefix(t *testing.T) { ErrCount: 1, }, { - Value: randomString(254), + Value: acctest.RandStringFromCharSet(254, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -1534,7 +1541,7 @@ func TestValidateDbSubnetGroupName(t *testing.T) { ErrCount: 1, }, { - Value: randomString(300), + Value: acctest.RandStringFromCharSet(300, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -1566,7 +1573,7 @@ func TestValidateNeptuneSubnetGroupName(t *testing.T) { ErrCount: 1, }, { - Value: randomString(300), + Value: acctest.RandStringFromCharSet(300, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -1594,7 +1601,7 @@ func TestValidateDbSubnetGroupNamePrefix(t *testing.T) { ErrCount: 1, }, { - Value: randomString(230), + Value: acctest.RandStringFromCharSet(230, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -1622,7 +1629,7 @@ func TestValidateNeptuneSubnetGroupNamePrefix(t *testing.T) { ErrCount: 1, }, { - Value: randomString(230), + Value: acctest.RandStringFromCharSet(230, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -1658,7 +1665,7 @@ func TestValidateDbOptionGroupName(t *testing.T) { ErrCount: 1, }, { - Value: randomString(256), + Value: acctest.RandStringFromCharSet(256, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -1690,7 +1697,7 @@ func TestValidateDbOptionGroupNamePrefix(t *testing.T) { ErrCount: 1, }, { - Value: randomString(230), + Value: acctest.RandStringFromCharSet(230, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -1734,7 +1741,7 @@ func TestValidateDbParamGroupName(t *testing.T) { ErrCount: 1, }, { - Value: randomString(256), + Value: acctest.RandStringFromCharSet(256, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -2225,6 +2232,29 @@ func TestValidateBatchName(t *testing.T) { } } +func TestValidateBatchPrefix(t *testing.T) { + validPrefixes := []string{ + strings.Repeat("W", 102), // <= 102 + } + for _, v := range validPrefixes { + _, errors := validateBatchPrefix(v, "prefix") + if len(errors) != 0 { + t.Fatalf("%q should be a valid Batch prefix: %q", v, errors) + } + } + + invalidPrefixes := []string{ + "s@mple", + strings.Repeat("W", 103), // >= 103 + } + for _, v := range invalidPrefixes { + _, errors := validateBatchPrefix(v, "prefix") + if len(errors) == 0 { + t.Fatalf("%q should be a invalid Batch prefix: %q", v, errors) + } + } +} + func TestValidateCognitoRoleMappingsAmbiguousRoleResolutionAgainstType(t *testing.T) { cases := []struct { AmbiguousRoleResolution interface{} @@ -2330,7 +2360,7 @@ func TestValidateSecurityGroupRuleDescription(t *testing.T) { "testrule", "testRule", "testRule 123", - `testRule 123 ._-:/()#,@[]+=;{}!$*`, + `testRule 123 ._-:/()#,@[]+=&;{}!$*`, } for _, v := range validDescriptions { _, errors := validateSecurityGroupRuleDescription(v, "description") @@ -2342,6 +2372,7 @@ func TestValidateSecurityGroupRuleDescription(t *testing.T) { invalidDescriptions := []string{ "`", "%%", + `\`, } for _, v := range invalidDescriptions { _, errors := validateSecurityGroupRuleDescription(v, "description") @@ -2451,7 +2482,7 @@ func TestResourceAWSElastiCacheReplicationGroupAuthTokenValidation(t *testing.T) ErrCount: 1, }, { - Value: randomString(129), + Value: acctest.RandStringFromCharSet(129, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -2664,7 +2695,7 @@ func TestValidateNeptuneParamGroupName(t *testing.T) { ErrCount: 1, }, { - Value: randomString(256), + Value: acctest.RandStringFromCharSet(256, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -2704,7 +2735,7 @@ func TestValidateNeptuneParamGroupNamePrefix(t *testing.T) { ErrCount: 1, }, { - Value: randomString(256), + Value: acctest.RandStringFromCharSet(256, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -2732,7 +2763,7 @@ func TestValidateCloudFrontPublicKeyName(t *testing.T) { ErrCount: 1, }, { - Value: randomString(129), + Value: acctest.RandStringFromCharSet(129, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -2760,7 +2791,7 @@ func TestValidateCloudFrontPublicKeyNamePrefix(t *testing.T) { ErrCount: 1, }, { - Value: randomString(128), + Value: acctest.RandStringFromCharSet(128, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -2827,7 +2858,7 @@ func TestValidateLbTargetGroupName(t *testing.T) { ErrCount: 1, }, { - Value: randomString(33), + Value: acctest.RandStringFromCharSet(33, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -2853,7 +2884,7 @@ func TestValidateLbTargetGroupNamePrefix(t *testing.T) { ErrCount: 1, }, { - Value: randomString(32), + Value: acctest.RandStringFromCharSet(32, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -2879,7 +2910,7 @@ func TestValidateSecretManagerSecretName(t *testing.T) { ErrCount: 1, }, { - Value: randomString(513), + Value: acctest.RandStringFromCharSet(513, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -2905,7 +2936,7 @@ func TestValidateSecretManagerSecretNamePrefix(t *testing.T) { ErrCount: 1, }, { - Value: randomString(512), + Value: acctest.RandStringFromCharSet(512, acctest.CharSetAlpha), ErrCount: 1, }, } @@ -2931,7 +2962,7 @@ func TestValidateRoute53ResolverName(t *testing.T) { ErrCount: 0, }, { - Value: randomString(65), + Value: acctest.RandStringFromCharSet(65, acctest.CharSetAlpha), ErrCount: 1, }, { diff --git a/aws/waf_helpers.go b/aws/waf_helpers.go index 0e7b3437536..917f44f480f 100644 --- a/aws/waf_helpers.go +++ b/aws/waf_helpers.go @@ -18,7 +18,10 @@ func wafSizeConstraintSetSchema() map[string]*schema.Schema { Required: true, ForceNew: true, }, - + "arn": { + Type: schema.TypeString, + Computed: true, + }, "size_constraints": { Type: schema.TypeSet, Optional: true, diff --git a/awsproviderlint/README.md b/awsproviderlint/README.md new file mode 100644 index 00000000000..05e64c17d0b --- /dev/null +++ b/awsproviderlint/README.md @@ -0,0 +1,45 @@ +# awsproviderlint + +The `awsproviderlint` tool is a Terraform Provider code linting tool, specifically tailored for the Terraform AWS Provider. + +## Lint Checks + +For additional information about each check, you can run `awsproviderlint help NAME`. + +### tfproviderlint Checks + +The `awsproviderlint` tool extends the `tfproviderlint` tool and its checks. See the [`tfproviderlint` documentation](https://github.com/bflad/tfproviderlint) for additional information about the checks it provides. + +### AWS Acceptance Test Checks + +| Check | Description | +|---|---| +| [AWSAT001](passes/AWSAT001/README.md) | check for `resource.TestMatchResourceAttr()` calls against ARN attributes | + +## Development and Testing + +This project is built on the [`tfproviderlint`](https://github.com/bflad/tfproviderlint) project and the [`go/analysis`](https://godoc.org/golang.org/x/tools/go/analysis) framework. + +Helpful tooling for development: + +* [`astdump`](https://github.com/wingyplus/astdump): a tool for displaying the AST form of Go file + +### Unit Testing + +```console +$ go test ./... +``` + +### Adding an Analyzer + +NOTE: Provider-specific analyzers should implement their own namespace outside `tfproviderlint`'s AT### (acceptance testing), R### (resource), and S### (schema) to prevent naming collisions. + +* Create new analyzer directory in `passes/`. The new directory name should match the name of the new analyzer. + * Add `passes/NAME/README.md` which documents at least a description of analyzer. + * Add `passes/NAME/NAME.go` which implements `Analyzer`. + * If analyzer is a full check: + * Include passing and failing example code in `passes/NAME/README.md`. + * Add `passes/NAME/NAME_test.go` which implements `analysistest.TestData()` and `analysistest.Run()`. + * Add `passes/NAME/testdata/src/a` directory with Go source files that implement passing and failing code based on `analysistest` framework. + * Since the [`analysistest` package](https://godoc.org/golang.org/x/tools/go/analysis/analysistest) does not support Go Modules currently, each analyzer that implements testing must add a symlink to the top level `vendor` directory in the `testdata/src/a` directory. e.g. `ln -s ../../../../../../vendor passes/NAME/testdata/src/a/vendor`. +* Add new `Analyzer` in `main.go`. diff --git a/awsproviderlint/main.go b/awsproviderlint/main.go new file mode 100644 index 00000000000..e0a91270c5d --- /dev/null +++ b/awsproviderlint/main.go @@ -0,0 +1,18 @@ +// The awsproviderlint command is a static checker for the Terraform AWS Provider. +package main + +import ( + tfpasses "github.com/bflad/tfproviderlint/passes" + tfxpasses "github.com/bflad/tfproviderlint/xpasses" + awspasses "github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/multichecker" +) + +func main() { + var analyzers []*analysis.Analyzer + analyzers = append(analyzers, tfpasses.AllChecks...) + analyzers = append(analyzers, tfxpasses.AllChecks...) + analyzers = append(analyzers, awspasses.AllChecks...) + multichecker.Main(analyzers...) +} diff --git a/awsproviderlint/passes/AWSAT001/AWSAT001.go b/awsproviderlint/passes/AWSAT001/AWSAT001.go new file mode 100644 index 00000000000..2b9ac236153 --- /dev/null +++ b/awsproviderlint/passes/AWSAT001/AWSAT001.go @@ -0,0 +1,87 @@ +package AWSAT001 + +import ( + "go/ast" + "strings" + + "github.com/bflad/tfproviderlint/helper/astutils" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/resource/testmatchresourceattrcallexpr" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for resource.TestMatchResourceAttr() calls against ARN attributes + +The AWSAT001 analyzer reports when a resource.TestMatchResourceAttr() call references an Amazon +Resource Name (ARN) attribute. It is preferred to use resource.TestCheckResourceAttrPair() or one +one of the available Terraform AWS Provider ARN testing check functions instead building full ARN +regular expressions. These testing helper functions consider the value of the AWS Account ID, +Partition, and Region of the acceptance test runner. + +The resource.TestCheckResourceAttrPair() call can be used when the Terraform state has the ARN +value already available, such as when the current resource is referencing an ARN attribute of +another resource. + +Otherwise, available ARN testing check functions include: + +- testAccCheckResourceAttrGlobalARN +- testAccCheckResourceAttrGlobalARNNoAccount +- testAccCheckResourceAttrRegionalARN +- testAccMatchResourceAttrGlobalARN +- testAccMatchResourceAttrRegionalARN +- testAccMatchResourceAttrRegionalARNNoAccount +` + +const analyzerName = "AWSAT001" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + testmatchresourceattrcallexpr.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + callExprs := pass.ResultOf[testmatchresourceattrcallexpr.Analyzer].([]*ast.CallExpr) + commentIgnorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + + for _, callExpr := range callExprs { + if commentIgnorer.ShouldIgnore(analyzerName, callExpr) { + continue + } + + attributeName := astutils.ExprStringValue(callExpr.Args[1]) + + if attributeName == nil { + continue + } + + if !AttributeNameAppearsArnRelated(*attributeName) { + continue + } + + pass.Reportf(callExpr.Pos(), "%s: prefer resource.TestCheckResourceAttrPair() or ARN check functions (e.g. testAccMatchResourceAttrRegionalARN)", analyzerName) + } + + return nil, nil +} + +func AttributeNameAppearsArnRelated(attributeName string) bool { + if attributeName == "arn" { + return true + } + + if strings.HasSuffix(attributeName, "_arn") { + return true + } + + // Handle flatmap nested attribute + if strings.HasSuffix(attributeName, ".arn") { + return true + } + + return false +} diff --git a/awsproviderlint/passes/AWSAT001/AWSAT001_test.go b/awsproviderlint/passes/AWSAT001/AWSAT001_test.go new file mode 100644 index 00000000000..ab6b8f4e027 --- /dev/null +++ b/awsproviderlint/passes/AWSAT001/AWSAT001_test.go @@ -0,0 +1,64 @@ +package AWSAT001_test + +import ( + "testing" + + "github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSAT001" + "golang.org/x/tools/go/analysis/analysistest" +) + +func TestAWSAT001(t *testing.T) { + testdata := analysistest.TestData() + analysistest.Run(t, testdata, AWSAT001.Analyzer, "a") +} + +func TestAttributeNameAppearsArnRelated(t *testing.T) { + testCases := []struct { + Name string + AttributeName string + Expected bool + }{ + { + Name: "empty", + AttributeName: "", + Expected: false, + }, + { + Name: "not arn", + AttributeName: "test", + Expected: false, + }, + { + Name: "equals arn", + AttributeName: "arn", + Expected: true, + }, + { + Name: "arn suffix", + AttributeName: "some_arn", + Expected: true, + }, + { + Name: "nested attribute equals arn", + AttributeName: "config_block.0.arn", + Expected: true, + }, + { + Name: "nested attribute arn suffix", + AttributeName: "config_block.0.some_arn", + Expected: true, + }, + } + + for _, testCase := range testCases { + testCase := testCase + + t.Run(testCase.Name, func(t *testing.T) { + got := AWSAT001.AttributeNameAppearsArnRelated(testCase.AttributeName) + + if got != testCase.Expected { + t.Errorf("got %t, expected %t", got, testCase.Expected) + } + }) + } +} diff --git a/awsproviderlint/passes/AWSAT001/README.md b/awsproviderlint/passes/AWSAT001/README.md new file mode 100644 index 00000000000..a8baca5fdf1 --- /dev/null +++ b/awsproviderlint/passes/AWSAT001/README.md @@ -0,0 +1,43 @@ +# AWSAT001 + +The `AWSAT001` analyzer reports when a `resource.TestMatchResourceAttr()` call references an Amazon +Resource Name (ARN) attribute. It is preferred to use `resource.TestCheckResourceAttrPair()` or one +one of the available Terraform AWS Provider ARN testing check functions instead building full ARN +regular expressions. These testing helper functions consider the value of the AWS Account ID, +Partition, and Region of the acceptance test runner. + +The `resource.TestCheckResourceAttrPair()` call can be used when the Terraform state has the ARN +value already available, such as when the current resource is referencing an ARN attribute of +another resource. + +Otherwise, available ARN testing check functions include: + +- `testAccCheckResourceAttrGlobalARN` +- `testAccCheckResourceAttrGlobalARNNoAccount` +- `testAccCheckResourceAttrRegionalARN` +- `testAccMatchResourceAttrGlobalARN` +- `testAccMatchResourceAttrRegionalARN` +- `testAccMatchResourceAttrRegionalARNNoAccount` + +## Flagged Code + +```go +resource.TestMatchResourceAttr("aws_lb_listener.test", "certificate_arn", regexp.MustCompile(`^arn:[^:]+:acm:[^:]+:[^:]+:certificate/.+$`)) +``` + +## Passing Code + +```go +resource.TestCheckResourceAttrPair("aws_lb_listener.test", "certificate_arn", "aws_acm_certificate.test", "arn") + +testAccMatchResourceAttrRegionalARN("aws_lb_listener.test", "certificate_arn", "acm", regexp.MustCompile(`certificate/.+`)) +``` + +## Ignoring Check + +The check can be ignored for a certain line via a `//lintignore:AWSAT001` comment on the previous line or at the end of the offending line, e.g. + +```go +//lintignore:AWSAT001 +resource.TestMatchResourceAttr("aws_lb_listener.test", "certificate_arn", regexp.MustCompile(`^arn:[^:]+:acm:[^:]+:[^:]+:certificate/.+$`)) +``` diff --git a/awsproviderlint/passes/AWSAT001/testdata/src/a/main.go b/awsproviderlint/passes/AWSAT001/testdata/src/a/main.go new file mode 100644 index 00000000000..ce09ccc7a09 --- /dev/null +++ b/awsproviderlint/passes/AWSAT001/testdata/src/a/main.go @@ -0,0 +1,31 @@ +package a + +import ( + "regexp" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +const resourceName = `aws_example_thing.test` + +var testRegexp = regexp.MustCompile(`.*`) + +func f() { + /* Passing cases */ + + resource.TestMatchResourceAttr(resourceName, "not_matching", testRegexp) + + /* Comment ignored cases */ + + //lintignore:AWSAT001 + resource.TestMatchResourceAttr(resourceName, "arn", testRegexp) + + resource.TestMatchResourceAttr(resourceName, "some_arn", testRegexp) //lintignore:AWSAT001 + + /* Failing cases */ + + resource.TestMatchResourceAttr(resourceName, "arn", testRegexp) // want "prefer resource.TestCheckResourceAttrPair\\(\\) or ARN check functions" + resource.TestMatchResourceAttr(resourceName, "some_arn", testRegexp) // want "prefer resource.TestCheckResourceAttrPair\\(\\) or ARN check functions" + resource.TestMatchResourceAttr(resourceName, "config_block.0.arn", testRegexp) // want "prefer resource.TestCheckResourceAttrPair\\(\\) or ARN check functions" + resource.TestMatchResourceAttr(resourceName, "config_block.0.some_arn", testRegexp) // want "prefer resource.TestCheckResourceAttrPair\\(\\) or ARN check functions" +} diff --git a/awsproviderlint/passes/AWSAT001/testdata/src/a/vendor b/awsproviderlint/passes/AWSAT001/testdata/src/a/vendor new file mode 120000 index 00000000000..ce7b6d9c07f --- /dev/null +++ b/awsproviderlint/passes/AWSAT001/testdata/src/a/vendor @@ -0,0 +1 @@ +../../../../../../vendor \ No newline at end of file diff --git a/awsproviderlint/passes/checks.go b/awsproviderlint/passes/checks.go new file mode 100644 index 00000000000..7cfcbcab24c --- /dev/null +++ b/awsproviderlint/passes/checks.go @@ -0,0 +1,10 @@ +package passes + +import ( + "github.com/terraform-providers/terraform-provider-aws/awsproviderlint/passes/AWSAT001" + "golang.org/x/tools/go/analysis" +) + +var AllChecks = []*analysis.Analyzer{ + AWSAT001.Analyzer, +} diff --git a/awsproviderlint/passes/checks_test.go b/awsproviderlint/passes/checks_test.go new file mode 100644 index 00000000000..ab7b38da685 --- /dev/null +++ b/awsproviderlint/passes/checks_test.go @@ -0,0 +1,15 @@ +package passes + +import ( + "testing" + + "golang.org/x/tools/go/analysis" +) + +func TestValidateAllChecks(t *testing.T) { + err := analysis.Validate(AllChecks) + + if err != nil { + t.Fatal(err) + } +} diff --git a/examples/eks-getting-started/eks-cluster.tf b/examples/eks-getting-started/eks-cluster.tf index 4e12b9262e6..b2b0453b153 100644 --- a/examples/eks-getting-started/eks-cluster.tf +++ b/examples/eks-getting-started/eks-cluster.tf @@ -26,18 +26,18 @@ POLICY resource "aws_iam_role_policy_attachment" "demo-cluster-AmazonEKSClusterPolicy" { policy_arn = "arn:aws:iam::aws:policy/AmazonEKSClusterPolicy" - role = "${aws_iam_role.demo-cluster.name}" + role = aws_iam_role.demo-cluster.name } resource "aws_iam_role_policy_attachment" "demo-cluster-AmazonEKSServicePolicy" { policy_arn = "arn:aws:iam::aws:policy/AmazonEKSServicePolicy" - role = "${aws_iam_role.demo-cluster.name}" + role = aws_iam_role.demo-cluster.name } resource "aws_security_group" "demo-cluster" { name = "terraform-eks-demo-cluster" description = "Cluster communication with worker nodes" - vpc_id = "${aws_vpc.demo.id}" + vpc_id = aws_vpc.demo.id egress { from_port = 0 @@ -51,37 +51,27 @@ resource "aws_security_group" "demo-cluster" { } } -resource "aws_security_group_rule" "demo-cluster-ingress-node-https" { - description = "Allow pods to communicate with the cluster API Server" - from_port = 443 - protocol = "tcp" - security_group_id = "${aws_security_group.demo-cluster.id}" - source_security_group_id = "${aws_security_group.demo-node.id}" - to_port = 443 - type = "ingress" -} - resource "aws_security_group_rule" "demo-cluster-ingress-workstation-https" { - cidr_blocks = ["${local.workstation-external-cidr}"] + cidr_blocks = [local.workstation-external-cidr] description = "Allow workstation to communicate with the cluster API Server" from_port = 443 protocol = "tcp" - security_group_id = "${aws_security_group.demo-cluster.id}" + security_group_id = aws_security_group.demo-cluster.id to_port = 443 type = "ingress" } resource "aws_eks_cluster" "demo" { - name = "${var.cluster-name}" - role_arn = "${aws_iam_role.demo-cluster.arn}" + name = var.cluster-name + role_arn = aws_iam_role.demo-cluster.arn vpc_config { - security_group_ids = ["${aws_security_group.demo-cluster.id}"] - subnet_ids = "${aws_subnet.demo[*].id}" + security_group_ids = [aws_security_group.demo-cluster.id] + subnet_ids = aws_subnet.demo[*].id } depends_on = [ - "aws_iam_role_policy_attachment.demo-cluster-AmazonEKSClusterPolicy", - "aws_iam_role_policy_attachment.demo-cluster-AmazonEKSServicePolicy", + aws_iam_role_policy_attachment.demo-cluster-AmazonEKSClusterPolicy, + aws_iam_role_policy_attachment.demo-cluster-AmazonEKSServicePolicy, ] } diff --git a/examples/eks-getting-started/eks-worker-nodes.tf b/examples/eks-getting-started/eks-worker-nodes.tf index d0e57e85b95..7121d198338 100644 --- a/examples/eks-getting-started/eks-worker-nodes.tf +++ b/examples/eks-getting-started/eks-worker-nodes.tf @@ -1,10 +1,7 @@ # # EKS Worker Nodes Resources # * IAM role allowing Kubernetes actions to access other AWS services -# * EC2 Security Group to allow networking traffic -# * Data source to fetch latest EKS worker AMI -# * AutoScaling Launch Configuration to configure worker instances -# * AutoScaling Group to launch worker instances +# * EKS Node Group to launch worker nodes # resource "aws_iam_role" "demo-node" { @@ -28,118 +25,34 @@ POLICY resource "aws_iam_role_policy_attachment" "demo-node-AmazonEKSWorkerNodePolicy" { policy_arn = "arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy" - role = "${aws_iam_role.demo-node.name}" + role = aws_iam_role.demo-node.name } resource "aws_iam_role_policy_attachment" "demo-node-AmazonEKS_CNI_Policy" { policy_arn = "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy" - role = "${aws_iam_role.demo-node.name}" + role = aws_iam_role.demo-node.name } resource "aws_iam_role_policy_attachment" "demo-node-AmazonEC2ContainerRegistryReadOnly" { policy_arn = "arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly" - role = "${aws_iam_role.demo-node.name}" + role = aws_iam_role.demo-node.name } -resource "aws_iam_instance_profile" "demo-node" { - name = "terraform-eks-demo" - role = "${aws_iam_role.demo-node.name}" -} - -resource "aws_security_group" "demo-node" { - name = "terraform-eks-demo-node" - description = "Security group for all nodes in the cluster" - vpc_id = "${aws_vpc.demo.id}" - - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["0.0.0.0/0"] - } - - tags = "${ - map( - "Name", "terraform-eks-demo-node", - "kubernetes.io/cluster/${var.cluster-name}", "owned", - ) - }" -} +resource "aws_eks_node_group" "demo" { + cluster_name = aws_eks_cluster.demo.name + node_group_name = "demo" + node_role_arn = aws_iam_role.demo-node.arn + subnet_ids = aws_subnet.demo[*].id -resource "aws_security_group_rule" "demo-node-ingress-self" { - description = "Allow node to communicate with each other" - from_port = 0 - protocol = "-1" - security_group_id = "${aws_security_group.demo-node.id}" - source_security_group_id = "${aws_security_group.demo-node.id}" - to_port = 65535 - type = "ingress" -} - -resource "aws_security_group_rule" "demo-node-ingress-cluster" { - description = "Allow worker Kubelets and pods to receive communication from the cluster control plane" - from_port = 1025 - protocol = "tcp" - security_group_id = "${aws_security_group.demo-node.id}" - source_security_group_id = "${aws_security_group.demo-cluster.id}" - to_port = 65535 - type = "ingress" -} - -data "aws_ami" "eks-worker" { - filter { - name = "name" - values = ["amazon-eks-node-${aws_eks_cluster.demo.version}-v*"] + scaling_config { + desired_size = 1 + max_size = 1 + min_size = 1 } - most_recent = true - owners = ["602401143452"] # Amazon EKS AMI Account ID -} - -# EKS currently documents this required userdata for EKS worker nodes to -# properly configure Kubernetes applications on the EC2 instance. -# We utilize a Terraform local here to simplify Base64 encoding this -# information into the AutoScaling Launch Configuration. -# More information: https://docs.aws.amazon.com/eks/latest/userguide/launch-workers.html -locals { - demo-node-userdata = <= arnSections-1 +} + // String returns the canonical representation of the ARN func (arn ARN) String() string { return arnPrefix + diff --git a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go index 285e54d6799..a4eb6a7f43a 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/awsutil/path_value.go @@ -70,7 +70,7 @@ func rValuesAtPath(v interface{}, path string, createPath, caseSensitive, nilTer value = value.FieldByNameFunc(func(name string) bool { if c == name { return true - } else if !caseSensitive && strings.ToLower(name) == strings.ToLower(c) { + } else if !caseSensitive && strings.EqualFold(name, c) { return true } return false 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 c022407f57b..03334d69207 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 @@ -12,6 +12,7 @@ import ( type Config struct { Config *aws.Config Handlers request.Handlers + PartitionID string Endpoint string SigningRegion string SigningName string 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 0fda42510f0..9f6af19dd45 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 @@ -16,11 +16,11 @@ import ( type DefaultRetryer struct { // Num max Retries is the number of max retries that will be performed. // By default, this is zero. - NumMaxRetries int + NumMaxRetries int // MinRetryDelay is the minimum retry delay after which retry will be performed. // If not set, the value is 0ns. - MinRetryDelay time.Duration + MinRetryDelay time.Duration // MinThrottleRetryDelay is the minimum retry delay when throttled. // If not set, the value is 0ns. @@ -28,7 +28,7 @@ type DefaultRetryer struct { // MaxRetryDelay is the maximum retry delay before which retry must be performed. // If not set, the value is 0ns. - MaxRetryDelay time.Duration + MaxRetryDelay time.Duration // MaxThrottleDelay is the maximum retry delay when throttled. // If not set, the value is 0ns. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go b/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go index 920e9fddf87..0c48f72e08e 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/client/metadata/client_info.go @@ -5,6 +5,7 @@ type ClientInfo struct { ServiceName string ServiceID string APIVersion string + PartitionID string Endpoint string SigningName string SigningRegion string diff --git a/vendor/github.com/aws/aws-sdk-go/aws/config.go b/vendor/github.com/aws/aws-sdk-go/aws/config.go index fd1e240f6eb..2def23fa1d1 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/config.go @@ -161,6 +161,17 @@ type Config struct { // on GetObject API calls. S3DisableContentMD5Validation *bool + // Set this to `true` to have the S3 service client to use the region specified + // in the ARN, when an ARN is provided as an argument to a bucket parameter. + S3UseARNRegion *bool + + // Set this to `true` to enable the SDK to unmarshal API response header maps to + // normalized lower case map keys. + // + // For example S3's X-Amz-Meta prefixed header will be unmarshaled to lower case + // Metadata member's map keys. The value of the header in the map is unaffected. + LowerCaseHeaderMaps *bool + // Set this to `true` to disable the EC2Metadata client from overriding the // default http.Client's Timeout. This is helpful if you do not want the // EC2Metadata client to create a new http.Client. This options is only @@ -246,6 +257,12 @@ type Config struct { // Disabling this feature is useful when you want to use local endpoints // for testing that do not support the modeled host prefix pattern. DisableEndpointHostPrefix *bool + + // STSRegionalEndpoint will enable regional or legacy endpoint resolving + STSRegionalEndpoint endpoints.STSRegionalEndpoint + + // S3UsEast1RegionalEndpoint will enable regional or legacy endpoint resolving + S3UsEast1RegionalEndpoint endpoints.S3UsEast1RegionalEndpoint } // NewConfig returns a new Config pointer that can be chained with builder @@ -379,6 +396,13 @@ func (c *Config) WithS3DisableContentMD5Validation(enable bool) *Config { } +// WithS3UseARNRegion sets a config S3UseARNRegion value and +// returning a Config pointer for chaining +func (c *Config) WithS3UseARNRegion(enable bool) *Config { + c.S3UseARNRegion = &enable + return c +} + // WithUseDualStack sets a config UseDualStack value returning a Config // pointer for chaining. func (c *Config) WithUseDualStack(enable bool) *Config { @@ -420,6 +444,20 @@ func (c *Config) MergeIn(cfgs ...*Config) { } } +// WithSTSRegionalEndpoint will set whether or not to use regional endpoint flag +// when resolving the endpoint for a service +func (c *Config) WithSTSRegionalEndpoint(sre endpoints.STSRegionalEndpoint) *Config { + c.STSRegionalEndpoint = sre + return c +} + +// WithS3UsEast1RegionalEndpoint will set whether or not to use regional endpoint flag +// when resolving the endpoint for a service +func (c *Config) WithS3UsEast1RegionalEndpoint(sre endpoints.S3UsEast1RegionalEndpoint) *Config { + c.S3UsEast1RegionalEndpoint = sre + return c +} + func mergeInConfig(dst *Config, other *Config) { if other == nil { return @@ -493,6 +531,10 @@ func mergeInConfig(dst *Config, other *Config) { dst.S3DisableContentMD5Validation = other.S3DisableContentMD5Validation } + if other.S3UseARNRegion != nil { + dst.S3UseARNRegion = other.S3UseARNRegion + } + if other.UseDualStack != nil { dst.UseDualStack = other.UseDualStack } @@ -520,6 +562,14 @@ func mergeInConfig(dst *Config, other *Config) { if other.DisableEndpointHostPrefix != nil { dst.DisableEndpointHostPrefix = other.DisableEndpointHostPrefix } + + if other.STSRegionalEndpoint != endpoints.UnsetSTSEndpoint { + dst.STSRegionalEndpoint = other.STSRegionalEndpoint + } + + if other.S3UsEast1RegionalEndpoint != endpoints.UnsetS3UsEast1Endpoint { + dst.S3UsEast1RegionalEndpoint = other.S3UsEast1RegionalEndpoint + } } // Copy will return a shallow copy of the Config object. If any additional diff --git a/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_5.go b/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_5.go index 66c5945db15..2f9446333a6 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_5.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/context_background_1_5.go @@ -2,42 +2,8 @@ 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) +import ( + "github.com/aws/aws-sdk-go/internal/context" ) // BackgroundContext returns a context that will never be canceled, has no @@ -52,5 +18,5 @@ var ( // // See https://golang.org/pkg/context for more information on Contexts. func BackgroundContext() Context { - return backgroundCtx + return context.BackgroundCtx } 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 0c60e612ea5..aa902d70837 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 @@ -161,7 +161,7 @@ func handleSendError(r *request.Request, err error) { } // Catch all request errors, and let the default retrier determine // if the error is retryable. - r.Error = awserr.New("RequestError", "send request failed", err) + r.Error = awserr.New(request.ErrCodeRequestError, "send request failed", err) // Override the error with a context canceled error, if that was canceled. ctx := r.Context() diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_background_go1.5.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_background_go1.5.go new file mode 100644 index 00000000000..5852b264870 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_background_go1.5.go @@ -0,0 +1,22 @@ +// +build !go1.7 + +package credentials + +import ( + "github.com/aws/aws-sdk-go/internal/context" +) + +// backgroundContext returns a context that will never be canceled, has no +// values, and no deadline. This context is used by the SDK to provide +// backwards compatibility with non-context API operations and functionality. +// +// Go 1.6 and before: +// This context function is equivalent to context.Background in the Go stdlib. +// +// Go 1.7 and later: +// The context returned will be the value returned by context.Background() +// +// See https://golang.org/pkg/context for more information on Contexts. +func backgroundContext() Context { + return context.BackgroundCtx +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_background_go1.7.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_background_go1.7.go new file mode 100644 index 00000000000..388b2154182 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_background_go1.7.go @@ -0,0 +1,20 @@ +// +build go1.7 + +package credentials + +import "context" + +// backgroundContext returns a context that will never be canceled, has no +// values, and no deadline. This context is used by the SDK to provide +// backwards compatibility with non-context API operations and functionality. +// +// Go 1.6 and before: +// This context function is equivalent to context.Background in the Go stdlib. +// +// Go 1.7 and later: +// The context returned will be the value returned by context.Background() +// +// See https://golang.org/pkg/context for more information on Contexts. +func backgroundContext() Context { + return context.Background() +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_go1.5.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_go1.5.go new file mode 100644 index 00000000000..8152a864add --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_go1.5.go @@ -0,0 +1,39 @@ +// +build !go1.9 + +package credentials + +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. +// +// This type, aws.Context, and context.Context are equivalent. +// +// 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{} +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_go1.9.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_go1.9.go new file mode 100644 index 00000000000..4356edb3d5d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/context_go1.9.go @@ -0,0 +1,13 @@ +// +build go1.9 + +package credentials + +import "context" + +// Context is an alias of the Go stdlib's context.Context interface. +// It can be used within the SDK's API operation "WithContext" methods. +// +// This type, aws.Context, and context.Context are equivalent. +// +// See https://golang.org/pkg/context on how to use contexts. +type Context = context.Context diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/credentials.go index 4af59215814..c75d7bba033 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 @@ -50,10 +50,11 @@ package credentials import ( "fmt" - "sync" + "sync/atomic" "time" "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/internal/sync/singleflight" ) // AnonymousCredentials is an empty Credential object that can be used as @@ -197,24 +198,24 @@ func (e *Expiry) ExpiresAt() time.Time { // first instance of the credentials Value. All calls to Get() after that // will return the cached credentials Value until IsExpired() returns true. type Credentials struct { - creds Value - forceRefresh bool - - m sync.RWMutex + creds atomic.Value + sf singleflight.Group provider Provider } // NewCredentials returns a pointer to a new Credentials with the provider set. func NewCredentials(provider Provider) *Credentials { - return &Credentials{ - provider: provider, - forceRefresh: true, + c := &Credentials{ + provider: provider, } + c.creds.Store(Value{}) + return c } -// Get returns the credentials value, or error if the credentials Value failed -// to be retrieved. +// GetWithContext returns the credentials value, or error if the credentials +// Value failed to be retrieved. Will return early if the passed in context is +// canceled. // // Will return the cached credentials Value if it has not expired. If the // credentials Value has expired the Provider's Retrieve() will be called @@ -222,31 +223,50 @@ func NewCredentials(provider Provider) *Credentials { // // If Credentials.Expire() was called the credentials Value will be force // expired, and the next call to Get() will cause them to be refreshed. -func (c *Credentials) Get() (Value, error) { - // Check the cached credentials first with just the read lock. - c.m.RLock() - if !c.isExpired() { - creds := c.creds - c.m.RUnlock() - return creds, nil +// +// Passed in Context is equivalent to aws.Context, and context.Context. +func (c *Credentials) GetWithContext(ctx Context) (Value, error) { + if curCreds := c.creds.Load(); !c.isExpired(curCreds) { + return curCreds.(Value), nil } - c.m.RUnlock() - - // Credentials are expired need to retrieve the credentials taking the full - // lock. - c.m.Lock() - defer c.m.Unlock() - - if c.isExpired() { - creds, err := c.provider.Retrieve() - if err != nil { - return Value{}, err - } - c.creds = creds - c.forceRefresh = false + + // Cannot pass context down to the actual retrieve, because the first + // context would cancel the whole group when there is not direct + // association of items in the group. + resCh := c.sf.DoChan("", c.singleRetrieve) + select { + case res := <-resCh: + return res.Val.(Value), res.Err + case <-ctx.Done(): + return Value{}, awserr.New("RequestCanceled", + "request context canceled", ctx.Err()) } +} + +func (c *Credentials) singleRetrieve() (interface{}, error) { + if curCreds := c.creds.Load(); !c.isExpired(curCreds) { + return curCreds.(Value), nil + } + + creds, err := c.provider.Retrieve() + if err == nil { + c.creds.Store(creds) + } + + return creds, err +} - return c.creds, nil +// Get returns the credentials value, or error if the credentials Value failed +// to be retrieved. +// +// Will return the cached credentials Value if it has not expired. If the +// credentials Value has expired the Provider's Retrieve() will be called +// to refresh the credentials. +// +// If Credentials.Expire() was called the credentials Value will be force +// expired, and the next call to Get() will cause them to be refreshed. +func (c *Credentials) Get() (Value, error) { + return c.GetWithContext(backgroundContext()) } // Expire expires the credentials and forces them to be retrieved on the @@ -255,10 +275,7 @@ func (c *Credentials) Get() (Value, error) { // This will override the Provider's expired state, and force Credentials // to call the Provider's Retrieve(). func (c *Credentials) Expire() { - c.m.Lock() - defer c.m.Unlock() - - c.forceRefresh = true + c.creds.Store(Value{}) } // IsExpired returns if the credentials are no longer valid, and need @@ -267,31 +284,25 @@ func (c *Credentials) Expire() { // If the Credentials were forced to be expired with Expire() this will // reflect that override. func (c *Credentials) IsExpired() bool { - c.m.RLock() - defer c.m.RUnlock() - - return c.isExpired() + return c.isExpired(c.creds.Load()) } // isExpired helper method wrapping the definition of expired credentials. -func (c *Credentials) isExpired() bool { - return c.forceRefresh || c.provider.IsExpired() +func (c *Credentials) isExpired(creds interface{}) bool { + return creds == nil || creds.(Value) == Value{} || c.provider.IsExpired() } // ExpiresAt provides access to the functionality of the Expirer interface of // the underlying Provider, if it supports that interface. Otherwise, it returns // an error. func (c *Credentials) ExpiresAt() (time.Time, error) { - c.m.RLock() - defer c.m.RUnlock() - expirer, ok := c.provider.(Expirer) if !ok { return time.Time{}, awserr.New("ProviderNotExpirer", - fmt.Sprintf("provider %s does not support ExpiresAt()", c.creds.ProviderName), + fmt.Sprintf("provider %s does not support ExpiresAt()", c.creds.Load().(Value).ProviderName), nil) } - if c.forceRefresh { + if c.creds.Load().(Value) == (Value{}) { // set expiration time to the distant past return time.Time{}, nil } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go b/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go index 1980c8c140a..e6248360029 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/processcreds/provider.go @@ -90,6 +90,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/internal/sdkio" ) const ( @@ -142,7 +143,7 @@ const ( // DefaultBufSize limits buffer size from growing to an enormous // amount due to a faulty process. - DefaultBufSize = 1024 + DefaultBufSize = int(8 * sdkio.KibiByte) // DefaultTimeout default limit on time a process can run. DefaultTimeout = time.Duration(1) * time.Minute 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 2e528d130d4..9f37f44bcfa 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/credentials/stscreds/assume_role_provider.go @@ -144,6 +144,13 @@ type AssumeRoleProvider struct { // Session name, if you wish to reuse the credentials elsewhere. RoleSessionName string + // Optional, you can pass tag key-value pairs to your session. These tags are called session tags. + Tags []*sts.Tag + + // A list of keys for session tags that you want to set as transitive. + // If you set a tag key as transitive, the corresponding key and value passes to subsequent sessions in a role chain. + TransitiveTagKeys []*string + // Expiry duration of the STS credentials. Defaults to 15 minutes if not set. Duration time.Duration @@ -269,10 +276,12 @@ func (p *AssumeRoleProvider) Retrieve() (credentials.Value, error) { } jitter := time.Duration(sdkrand.SeededRand.Float64() * p.MaxJitterFrac * float64(p.Duration)) input := &sts.AssumeRoleInput{ - DurationSeconds: aws.Int64(int64((p.Duration - jitter) / time.Second)), - RoleArn: aws.String(p.RoleARN), - RoleSessionName: aws.String(p.RoleSessionName), - ExternalId: p.ExternalID, + DurationSeconds: aws.Int64(int64((p.Duration - jitter) / time.Second)), + RoleArn: aws.String(p.RoleARN), + RoleSessionName: aws.String(p.RoleSessionName), + ExternalId: p.ExternalID, + Tags: p.Tags, + TransitiveTagKeys: p.TransitiveTagKeys, } if p.Policy != nil { input.Policy = p.Policy diff --git a/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go b/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go index c7008d8c3fc..835bcd49cba 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/csm/reporter.go @@ -66,7 +66,6 @@ func (rep *Reporter) sendAPICallAttemptMetric(r *request.Request) { XAmzRequestID: aws.String(r.RequestID), - AttemptCount: aws.Int(r.RetryCount + 1), AttemptLatency: aws.Int(int(now.Sub(r.AttemptTime).Nanoseconds() / int64(time.Millisecond))), AccessKey: aws.String(creds.AccessKeyID), } @@ -90,7 +89,7 @@ func getMetricException(err awserr.Error) metricException { code := err.Code() switch code { - case "RequestError", + case request.ErrCodeRequestError, request.ErrCodeSerialization, request.CanceledErrorCode: return sdkException{ diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go index d126764ce4e..12897eef626 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/api.go @@ -4,6 +4,7 @@ import ( "encoding/json" "fmt" "net/http" + "strconv" "strings" "time" @@ -12,8 +13,41 @@ import ( "github.com/aws/aws-sdk-go/internal/sdkuri" ) +// getToken uses the duration to return a token for EC2 metadata service, +// or an error if the request failed. +func (c *EC2Metadata) getToken(duration time.Duration) (tokenOutput, error) { + op := &request.Operation{ + Name: "GetToken", + HTTPMethod: "PUT", + HTTPPath: "/api/token", + } + + var output tokenOutput + req := c.NewRequest(op, nil, &output) + + // remove the fetch token handler from the request handlers to avoid infinite recursion + req.Handlers.Sign.RemoveByName(fetchTokenHandlerName) + + // Swap the unmarshalMetadataHandler with unmarshalTokenHandler on this request. + req.Handlers.Unmarshal.Swap(unmarshalMetadataHandlerName, unmarshalTokenHandler) + + ttl := strconv.FormatInt(int64(duration/time.Second), 10) + req.HTTPRequest.Header.Set(ttlHeader, ttl) + + err := req.Send() + + // Errors with bad request status should be returned. + if err != nil { + err = awserr.NewRequestFailure( + awserr.New(req.HTTPResponse.Status, http.StatusText(req.HTTPResponse.StatusCode), err), + req.HTTPResponse.StatusCode, req.RequestID) + } + + return output, err +} + // GetMetadata uses the path provided to request information from the EC2 -// instance metdata service. The content will be returned as a string, or +// instance metadata service. The content will be returned as a string, or // error if the request failed. func (c *EC2Metadata) GetMetadata(p string) (string, error) { op := &request.Operation{ @@ -21,11 +55,11 @@ func (c *EC2Metadata) GetMetadata(p string) (string, error) { HTTPMethod: "GET", HTTPPath: sdkuri.PathJoin("/meta-data", p), } - output := &metadataOutput{} + req := c.NewRequest(op, nil, output) - err := req.Send() + err := req.Send() return output.Content, err } @@ -41,13 +75,8 @@ func (c *EC2Metadata) GetUserData() (string, error) { output := &metadataOutput{} req := c.NewRequest(op, nil, output) - req.Handlers.UnmarshalError.PushBack(func(r *request.Request) { - if r.HTTPResponse.StatusCode == http.StatusNotFound { - r.Error = awserr.New("NotFoundError", "user-data not found", r.Error) - } - }) - err := req.Send() + err := req.Send() return output.Content, err } @@ -63,8 +92,8 @@ func (c *EC2Metadata) GetDynamicData(p string) (string, error) { output := &metadataOutput{} req := c.NewRequest(op, nil, output) - err := req.Send() + err := req.Send() return output.Content, err } @@ -116,17 +145,17 @@ func (c *EC2Metadata) IAMInfo() (EC2IAMInfo, error) { // Region returns the region the instance is running in. func (c *EC2Metadata) Region() (string, error) { - resp, err := c.GetMetadata("placement/availability-zone") + ec2InstanceIdentityDocument, err := c.GetInstanceIdentityDocument() if err != nil { return "", err } - - if len(resp) == 0 { - return "", awserr.New("EC2MetadataError", "invalid Region response", nil) + // extract region from the ec2InstanceIdentityDocument + region := ec2InstanceIdentityDocument.Region + if len(region) == 0 { + return "", awserr.New("EC2MetadataError", "invalid region received for ec2metadata instance", nil) } - - // returns region without the suffix. Eg: us-west-2a becomes us-west-2 - return resp[:len(resp)-1], nil + // returns region + return region, nil } // Available returns if the application has access to the EC2 Metadata service. diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go index 4c5636e3500..b8b2940d744 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/service.go @@ -13,6 +13,7 @@ import ( "io" "net/http" "os" + "strconv" "strings" "time" @@ -24,9 +25,25 @@ import ( "github.com/aws/aws-sdk-go/aws/request" ) -// ServiceName is the name of the service. -const ServiceName = "ec2metadata" -const disableServiceEnvVar = "AWS_EC2_METADATA_DISABLED" +const ( + // ServiceName is the name of the service. + ServiceName = "ec2metadata" + disableServiceEnvVar = "AWS_EC2_METADATA_DISABLED" + + // Headers for Token and TTL + ttlHeader = "x-aws-ec2-metadata-token-ttl-seconds" + tokenHeader = "x-aws-ec2-metadata-token" + + // Named Handler constants + fetchTokenHandlerName = "FetchTokenHandler" + unmarshalMetadataHandlerName = "unmarshalMetadataHandler" + unmarshalTokenHandlerName = "unmarshalTokenHandler" + enableTokenProviderHandlerName = "enableTokenProviderHandler" + + // TTL constants + defaultTTL = 21600 * time.Second + ttlExpirationWindow = 30 * time.Second +) // A EC2Metadata is an EC2 Metadata service Client. type EC2Metadata struct { @@ -63,8 +80,10 @@ func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio // use a shorter timeout than default because the metadata // service is local if it is running, and to fail faster // if not running on an ec2 instance. - Timeout: 5 * time.Second, + Timeout: 1 * time.Second, } + // max number of retries on the client operation + cfg.MaxRetries = aws.Int(2) } svc := &EC2Metadata{ @@ -80,13 +99,27 @@ func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ), } - svc.Handlers.Unmarshal.PushBack(unmarshalHandler) + // token provider instance + tp := newTokenProvider(svc, defaultTTL) + + // NamedHandler for fetching token + svc.Handlers.Sign.PushBackNamed(request.NamedHandler{ + Name: fetchTokenHandlerName, + Fn: tp.fetchTokenHandler, + }) + // NamedHandler for enabling token provider + svc.Handlers.Complete.PushBackNamed(request.NamedHandler{ + Name: enableTokenProviderHandlerName, + Fn: tp.enableTokenProviderHandler, + }) + + svc.Handlers.Unmarshal.PushBackNamed(unmarshalHandler) svc.Handlers.UnmarshalError.PushBack(unmarshalError) svc.Handlers.Validate.Clear() svc.Handlers.Validate.PushBack(validateEndpointHandler) // Disable the EC2 Metadata service if the environment variable is set. - // This shortcirctes the service's functionality to always fail to send + // This short-circuits the service's functionality to always fail to send // requests. if strings.ToLower(os.Getenv(disableServiceEnvVar)) == "true" { svc.Handlers.Send.SwapNamed(request.NamedHandler{ @@ -107,7 +140,6 @@ func NewClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio for _, option := range opts { option(svc.Client) } - return svc } @@ -119,30 +151,74 @@ type metadataOutput struct { Content string } -func unmarshalHandler(r *request.Request) { - defer r.HTTPResponse.Body.Close() - b := &bytes.Buffer{} - if _, err := io.Copy(b, r.HTTPResponse.Body); err != nil { - r.Error = awserr.New(request.ErrCodeSerialization, "unable to unmarshal EC2 metadata response", err) - return - } +type tokenOutput struct { + Token string + TTL time.Duration +} - if data, ok := r.Data.(*metadataOutput); ok { - data.Content = b.String() - } +// unmarshal token handler is used to parse the response of a getToken operation +var unmarshalTokenHandler = request.NamedHandler{ + Name: unmarshalTokenHandlerName, + Fn: func(r *request.Request) { + defer r.HTTPResponse.Body.Close() + var b bytes.Buffer + if _, err := io.Copy(&b, r.HTTPResponse.Body); err != nil { + r.Error = awserr.NewRequestFailure(awserr.New(request.ErrCodeSerialization, + "unable to unmarshal EC2 metadata response", err), r.HTTPResponse.StatusCode, r.RequestID) + return + } + + v := r.HTTPResponse.Header.Get(ttlHeader) + data, ok := r.Data.(*tokenOutput) + if !ok { + return + } + + data.Token = b.String() + // TTL is in seconds + i, err := strconv.ParseInt(v, 10, 64) + if err != nil { + r.Error = awserr.NewRequestFailure(awserr.New(request.ParamFormatErrCode, + "unable to parse EC2 token TTL response", err), r.HTTPResponse.StatusCode, r.RequestID) + return + } + t := time.Duration(i) * time.Second + data.TTL = t + }, +} + +var unmarshalHandler = request.NamedHandler{ + Name: unmarshalMetadataHandlerName, + Fn: func(r *request.Request) { + defer r.HTTPResponse.Body.Close() + var b bytes.Buffer + if _, err := io.Copy(&b, r.HTTPResponse.Body); err != nil { + r.Error = awserr.NewRequestFailure(awserr.New(request.ErrCodeSerialization, + "unable to unmarshal EC2 metadata response", err), r.HTTPResponse.StatusCode, r.RequestID) + return + } + + if data, ok := r.Data.(*metadataOutput); ok { + data.Content = b.String() + } + }, } func unmarshalError(r *request.Request) { defer r.HTTPResponse.Body.Close() - b := &bytes.Buffer{} - if _, err := io.Copy(b, r.HTTPResponse.Body); err != nil { - r.Error = awserr.New(request.ErrCodeSerialization, "unable to unmarshal EC2 metadata error response", err) + var b bytes.Buffer + + if _, err := io.Copy(&b, r.HTTPResponse.Body); err != nil { + r.Error = awserr.NewRequestFailure( + awserr.New(request.ErrCodeSerialization, "unable to unmarshal EC2 metadata error response", err), + r.HTTPResponse.StatusCode, r.RequestID) return } // Response body format is not consistent between metadata endpoints. // Grab the error message as a string and include that as the source error - r.Error = awserr.New("EC2MetadataError", "failed to make EC2Metadata request", errors.New(b.String())) + r.Error = awserr.NewRequestFailure(awserr.New("EC2MetadataError", "failed to make EC2Metadata request", errors.New(b.String())), + r.HTTPResponse.StatusCode, r.RequestID) } func validateEndpointHandler(r *request.Request) { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go new file mode 100644 index 00000000000..663372a9154 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/ec2metadata/token_provider.go @@ -0,0 +1,92 @@ +package ec2metadata + +import ( + "net/http" + "sync/atomic" + "time" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/request" +) + +// A tokenProvider struct provides access to EC2Metadata client +// and atomic instance of a token, along with configuredTTL for it. +// tokenProvider also provides an atomic flag to disable the +// fetch token operation. +// The disabled member will use 0 as false, and 1 as true. +type tokenProvider struct { + client *EC2Metadata + token atomic.Value + configuredTTL time.Duration + disabled uint32 +} + +// A ec2Token struct helps use of token in EC2 Metadata service ops +type ec2Token struct { + token string + credentials.Expiry +} + +// newTokenProvider provides a pointer to a tokenProvider instance +func newTokenProvider(c *EC2Metadata, duration time.Duration) *tokenProvider { + return &tokenProvider{client: c, configuredTTL: duration} +} + +// fetchTokenHandler fetches token for EC2Metadata service client by default. +func (t *tokenProvider) fetchTokenHandler(r *request.Request) { + + // short-circuits to insecure data flow if tokenProvider is disabled. + if v := atomic.LoadUint32(&t.disabled); v == 1 { + return + } + + if ec2Token, ok := t.token.Load().(ec2Token); ok && !ec2Token.IsExpired() { + r.HTTPRequest.Header.Set(tokenHeader, ec2Token.token) + return + } + + output, err := t.client.getToken(t.configuredTTL) + + if err != nil { + + // change the disabled flag on token provider to true, + // when error is request timeout error. + if requestFailureError, ok := err.(awserr.RequestFailure); ok { + switch requestFailureError.StatusCode() { + case http.StatusForbidden, http.StatusNotFound, http.StatusMethodNotAllowed: + atomic.StoreUint32(&t.disabled, 1) + case http.StatusBadRequest: + r.Error = requestFailureError + } + + // Check if request timed out while waiting for response + if e, ok := requestFailureError.OrigErr().(awserr.Error); ok { + if e.Code() == request.ErrCodeRequestError { + atomic.StoreUint32(&t.disabled, 1) + } + } + } + return + } + + newToken := ec2Token{ + token: output.Token, + } + newToken.SetExpiration(time.Now().Add(output.TTL), ttlExpirationWindow) + t.token.Store(newToken) + + // Inject token header to the request. + if ec2Token, ok := t.token.Load().(ec2Token); ok { + r.HTTPRequest.Header.Set(tokenHeader, ec2Token.token) + } +} + +// enableTokenProviderHandler enables the token provider +func (t *tokenProvider) enableTokenProviderHandler(r *request.Request) { + // If the error code status is 401, we enable the token provider + if e, ok := r.Error.(awserr.RequestFailure); ok && e != nil && + e.StatusCode() == http.StatusUnauthorized { + atomic.StoreUint32(&t.disabled, 0) + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go index 87b9ff3ffec..343a2106f81 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/decode.go @@ -83,6 +83,7 @@ func decodeV3Endpoints(modelDef modelDefinition, opts DecodeModelOptions) (Resol p := &ps[i] custAddEC2Metadata(p) custAddS3DualStack(p) + custRegionalS3(p) custRmIotDataService(p) custFixAppAutoscalingChina(p) custFixAppAutoscalingUsGov(p) @@ -100,6 +101,33 @@ func custAddS3DualStack(p *partition) { custAddDualstack(p, "s3-control") } +func custRegionalS3(p *partition) { + if p.ID != "aws" { + return + } + + service, ok := p.Services["s3"] + if !ok { + return + } + + // If global endpoint already exists no customization needed. + if _, ok := service.Endpoints["aws-global"]; ok { + return + } + + service.PartitionEndpoint = "aws-global" + service.Endpoints["us-east-1"] = endpoint{} + service.Endpoints["aws-global"] = endpoint{ + Hostname: "s3.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + } + + p.Services["s3"] = service +} + func custAddDualstack(p *partition, svcName string) { s, ok := p.Services[svcName] if !ok { 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 452cefda6bb..aaf521d6ccb 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 @@ -169,7 +169,7 @@ var awsPartition = partition{ "us-east-1": endpoint{}, }, }, - "acm": service{ + "access-analyzer": service{ Endpoints: endpoints{ "ap-east-1": endpoint{}, @@ -192,6 +192,59 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "acm": service{ + + Endpoints: endpoints{ + "ap-east-1": endpoint{}, + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "ca-central-1-fips": endpoint{ + Hostname: "acm-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-1-fips": endpoint{ + Hostname: "acm-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{}, + "us-east-2-fips": endpoint{ + Hostname: "acm-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-1": endpoint{}, + "us-west-1-fips": endpoint{ + Hostname: "acm-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "us-west-2": endpoint{}, + "us-west-2-fips": endpoint{ + Hostname: "acm-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, "acm-pca": service{ Defaults: endpoint{ Protocols: []string{"https"}, @@ -209,10 +262,42 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-ca-central-1": endpoint{ + Hostname: "acm-pca-fips.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "fips-us-east-1": endpoint{ + Hostname: "acm-pca-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "acm-pca-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "acm-pca-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "acm-pca-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "api.ecr": service{ @@ -366,6 +451,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ @@ -422,11 +508,7 @@ var awsPartition = partition{ }, "application-autoscaling": service{ Defaults: endpoint{ - Hostname: "autoscaling.{region}.amazonaws.com", Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Service: "application-autoscaling", - }, }, Endpoints: endpoints{ "ap-east-1": endpoint{}, @@ -459,8 +541,12 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -481,8 +567,14 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "fips": endpoint{ + Hostname: "appstream2-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "appsync": service{ @@ -515,8 +607,12 @@ var awsPartition = partition{ "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -547,11 +643,7 @@ var awsPartition = partition{ }, "autoscaling-plans": service{ Defaults: endpoint{ - Hostname: "autoscaling.{region}.amazonaws.com", Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Service: "autoscaling-plans", - }, }, Endpoints: endpoints{ "ap-northeast-1": endpoint{}, @@ -572,14 +664,20 @@ var awsPartition = partition{ "backup": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -656,9 +754,15 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, @@ -750,6 +854,7 @@ var awsPartition = partition{ "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -844,6 +949,7 @@ var awsPartition = partition{ "codecommit": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -861,11 +967,12 @@ var awsPartition = partition{ Region: "ca-central-1", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "codedeploy": service{ @@ -1008,6 +1115,9 @@ var awsPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, @@ -1058,8 +1168,10 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-west-2": endpoint{}, }, @@ -1083,6 +1195,22 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "dataexchange": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "datapipeline": service{ Endpoints: endpoints{ @@ -1096,12 +1224,18 @@ var awsPartition = partition{ "datasync": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "fips-us-east-1": endpoint{ Hostname: "datasync-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -1127,6 +1261,7 @@ var awsPartition = partition{ }, }, "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -1142,6 +1277,8 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1181,7 +1318,8 @@ var awsPartition = partition{ "discovery": service{ Endpoints: endpoints{ - "us-west-2": endpoint{}, + "eu-central-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "dms": service{ @@ -1222,12 +1360,30 @@ var awsPartition = partition{ Region: "ap-northeast-2", }, }, + "ap-south-1": endpoint{ + Hostname: "rds.ap-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-south-1", + }, + }, + "ap-southeast-1": endpoint{ + Hostname: "rds.ap-southeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-1", + }, + }, "ap-southeast-2": endpoint{ Hostname: "rds.ap-southeast-2.amazonaws.com", CredentialScope: credentialScope{ Region: "ap-southeast-2", }, }, + "ca-central-1": endpoint{ + Hostname: "rds.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, "eu-central-1": endpoint{ Hostname: "rds.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ @@ -1246,6 +1402,12 @@ var awsPartition = partition{ Region: "eu-west-2", }, }, + "eu-west-3": endpoint{ + Hostname: "rds.eu-west-3.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-3", + }, + }, "us-east-1": endpoint{ Hostname: "rds.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -1269,6 +1431,7 @@ var awsPartition = partition{ "ds": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1279,6 +1442,7 @@ var awsPartition = partition{ "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1462,6 +1626,7 @@ var awsPartition = partition{ "elasticfilesystem": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -1469,9 +1634,12 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -1634,6 +1802,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -1648,17 +1817,45 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, + "forecast": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "forecastquery": 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{}, + }, + }, "fsx": service{ Endpoints: endpoints{ @@ -1764,8 +1961,10 @@ var awsPartition = partition{ "groundstation": service{ Endpoints: endpoints{ - "us-east-2": endpoint{}, - "us-west-2": endpoint{}, + "eu-north-1": endpoint{}, + "me-south-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, }, }, "guardduty": service{ @@ -1911,9 +2110,12 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, @@ -1928,6 +2130,18 @@ var awsPartition = partition{ Region: "ap-northeast-1", }, }, + "ap-northeast-2": endpoint{ + Hostname: "data.iotevents.ap-northeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-northeast-2", + }, + }, + "ap-southeast-1": endpoint{ + Hostname: "data.iotevents.ap-southeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-1", + }, + }, "ap-southeast-2": endpoint{ Hostname: "data.iotevents.ap-southeast-2.amazonaws.com", CredentialScope: credentialScope{ @@ -1946,6 +2160,12 @@ var awsPartition = partition{ Region: "eu-west-1", }, }, + "eu-west-2": endpoint{ + Hostname: "data.iotevents.eu-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-2", + }, + }, "us-east-1": endpoint{ Hostname: "data.iotevents.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -1966,35 +2186,64 @@ var awsPartition = partition{ }, }, }, - "iotthingsgraph": service{ - Defaults: endpoint{ - CredentialScope: credentialScope{ - Service: "iotthingsgraph", - }, - }, - Endpoints: endpoints{ - "ap-northeast-1": endpoint{}, - "ap-southeast-2": endpoint{}, - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, - }, - }, - "kafka": service{ + "iotsecuredtunneling": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "iotthingsgraph": service{ + Defaults: endpoint{ + CredentialScope: credentialScope{ + Service: "iotthingsgraph", + }, + }, + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "kafka": service{ + + Endpoints: endpoints{ + "ap-east-1": endpoint{}, + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -2024,16 +2273,20 @@ var awsPartition = partition{ "kinesisanalytics": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-2": endpoint{}, @@ -2042,11 +2295,20 @@ var awsPartition = partition{ "kinesisvideo": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, + "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -2077,9 +2339,17 @@ 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{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -2177,6 +2447,12 @@ var awsPartition = partition{ "us-east-1": endpoint{}, }, }, + "managedblockchain": service{ + + Endpoints: endpoints{ + "us-east-1": endpoint{}, + }, + }, "marketplacecommerceanalytics": service{ Endpoints: endpoints{ @@ -2186,6 +2462,7 @@ var awsPartition = partition{ "mediaconnect": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2234,8 +2511,11 @@ var awsPartition = partition{ "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, + "us-east-2": endpoint{}, "us-west-2": endpoint{}, }, }, @@ -2300,7 +2580,8 @@ var awsPartition = partition{ "mgh": service{ Endpoints: endpoints{ - "us-west-2": endpoint{}, + "eu-central-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "mobileanalytics": service{ @@ -2316,9 +2597,10 @@ var awsPartition = partition{ }, }, Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "monitoring": service{ @@ -2349,6 +2631,7 @@ var awsPartition = partition{ "mq": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2356,13 +2639,40 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, - "us-east-1": endpoint{}, - "us-east-2": endpoint{}, - "us-west-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "mq-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-east-2": endpoint{ + Hostname: "mq-fips.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "fips-us-west-1": endpoint{ + Hostname: "mq-fips.us-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "mq-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "mturk-requester": service{ @@ -2408,6 +2718,12 @@ var awsPartition = partition{ Region: "ap-southeast-2", }, }, + "ca-central-1": endpoint{ + Hostname: "rds.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, "eu-central-1": endpoint{ Hostname: "rds.eu-central-1.amazonaws.com", CredentialScope: credentialScope{ @@ -2432,6 +2748,12 @@ var awsPartition = partition{ Region: "eu-west-2", }, }, + "me-south-1": endpoint{ + Hostname: "rds.me-south-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "me-south-1", + }, + }, "us-east-1": endpoint{ Hostname: "rds.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -2452,6 +2774,65 @@ var awsPartition = partition{ }, }, }, + "oidc": service{ + + Endpoints: endpoints{ + "ap-southeast-1": endpoint{ + Hostname: "oidc.ap-southeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-1", + }, + }, + "ap-southeast-2": endpoint{ + Hostname: "oidc.ap-southeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-2", + }, + }, + "ca-central-1": endpoint{ + Hostname: "oidc.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "eu-central-1": endpoint{ + Hostname: "oidc.eu-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-central-1", + }, + }, + "eu-west-1": endpoint{ + Hostname: "oidc.eu-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-1", + }, + }, + "eu-west-2": endpoint{ + Hostname: "oidc.eu-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-2", + }, + }, + "us-east-1": endpoint{ + Hostname: "oidc.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{ + Hostname: "oidc.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-2": endpoint{ + Hostname: "oidc.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, "opsworks": service{ Endpoints: endpoints{ @@ -2499,6 +2880,27 @@ var awsPartition = partition{ }, }, }, + "outposts": service{ + + Endpoints: endpoints{ + "ap-east-1": endpoint{}, + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "pinpoint": service{ Defaults: endpoint{ CredentialScope: credentialScope{ @@ -2510,13 +2912,36 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "fips-us-east-1": endpoint{ + Hostname: "pinpoint-fips.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "fips-us-west-2": endpoint{ + Hostname: "pinpoint-fips.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + "us-east-1": endpoint{ + Hostname: "pinpoint.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-west-2": endpoint{ + Hostname: "pinpoint.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, }, }, "polly": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2528,6 +2953,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2535,6 +2961,65 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "portal.sso": service{ + + Endpoints: endpoints{ + "ap-southeast-1": endpoint{ + Hostname: "portal.sso.ap-southeast-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-1", + }, + }, + "ap-southeast-2": endpoint{ + Hostname: "portal.sso.ap-southeast-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ap-southeast-2", + }, + }, + "ca-central-1": endpoint{ + Hostname: "portal.sso.ca-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "ca-central-1", + }, + }, + "eu-central-1": endpoint{ + Hostname: "portal.sso.eu-central-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-central-1", + }, + }, + "eu-west-1": endpoint{ + Hostname: "portal.sso.eu-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-1", + }, + }, + "eu-west-2": endpoint{ + Hostname: "portal.sso.eu-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "eu-west-2", + }, + }, + "us-east-1": endpoint{ + Hostname: "portal.sso.us-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + "us-east-2": endpoint{ + Hostname: "portal.sso.us-east-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-2", + }, + }, + "us-west-2": endpoint{ + Hostname: "portal.sso.us-west-2.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-west-2", + }, + }, + }, + }, "projects.iot1click": service{ Endpoints: endpoints{ @@ -2551,6 +3036,10 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -2560,6 +3049,7 @@ var awsPartition = partition{ "ram": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2571,6 +3061,8 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, "us-west-1": endpoint{}, @@ -2725,6 +3217,7 @@ var awsPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -2732,6 +3225,7 @@ var awsPartition = partition{ "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, @@ -2748,9 +3242,10 @@ var awsPartition = partition{ }, }, Endpoints: endpoints{ - "eu-west-1": endpoint{}, - "us-east-1": endpoint{}, - "us-west-2": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-west-2": endpoint{}, }, }, "runtime.sagemaker": service{ @@ -2768,6 +3263,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ @@ -2800,7 +3296,7 @@ var awsPartition = partition{ }, }, "s3": service{ - PartitionEndpoint: "us-east-1", + PartitionEndpoint: "aws-global", IsRegionalized: boxedTrue, Defaults: endpoint{ Protocols: []string{"http", "https"}, @@ -2825,6 +3321,13 @@ var awsPartition = partition{ Hostname: "s3.ap-southeast-2.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, + "aws-global": endpoint{ + Hostname: "s3.amazonaws.com", + SignatureVersions: []string{"s3", "s3v4"}, + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, "eu-north-1": endpoint{}, @@ -2847,7 +3350,7 @@ var awsPartition = partition{ SignatureVersions: []string{"s3", "s3v4"}, }, "us-east-1": endpoint{ - Hostname: "s3.amazonaws.com", + Hostname: "s3.us-east-1.amazonaws.com", SignatureVersions: []string{"s3", "s3v4"}, }, "us-east-2": endpoint{}, @@ -3012,6 +3515,29 @@ var awsPartition = partition{ }, }, }, + "savingsplans": service{ + PartitionEndpoint: "aws-global", + IsRegionalized: boxedFalse, + + Endpoints: endpoints{ + "aws-global": endpoint{ + Hostname: "savingsplans.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-east-1", + }, + }, + }, + }, + "schemas": service{ + + Endpoints: endpoints{ + "ap-northeast-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "sdb": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, @@ -3033,6 +3559,7 @@ var awsPartition = partition{ "secretsmanager": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -3044,6 +3571,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ @@ -3090,6 +3618,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -3102,6 +3631,9 @@ var awsPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{ + Protocols: []string{"https"}, + }, "ap-northeast-1": endpoint{ Protocols: []string{"https"}, }, @@ -3135,6 +3667,9 @@ var awsPartition = partition{ "eu-west-3": endpoint{ Protocols: []string{"https"}, }, + "me-south-1": endpoint{ + Protocols: []string{"https"}, + }, "sa-east-1": endpoint{ Protocols: []string{"https"}, }, @@ -3155,6 +3690,7 @@ var awsPartition = partition{ "servicecatalog": service{ Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, @@ -3166,6 +3702,7 @@ var awsPartition = partition{ "eu-west-1": endpoint{}, "eu-west-2": endpoint{}, "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, "sa-east-1": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ @@ -3224,6 +3761,10 @@ var awsPartition = partition{ Endpoints: endpoints{ "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "eu-central-1": endpoint{}, "eu-west-1": endpoint{}, "us-east-1": endpoint{}, "us-east-2": endpoint{}, @@ -3495,44 +4036,29 @@ var awsPartition = partition{ }, "sts": service{ PartitionEndpoint: "aws-global", - Defaults: endpoint{ - Hostname: "sts.amazonaws.com", - CredentialScope: credentialScope{ - Region: "us-east-1", - }, - }, + Endpoints: endpoints{ - "ap-east-1": endpoint{ - Hostname: "sts.ap-east-1.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-east-1", - }, - }, + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, - "ap-northeast-2": endpoint{ - Hostname: "sts.ap-northeast-2.amazonaws.com", - CredentialScope: credentialScope{ - Region: "ap-northeast-2", - }, - }, + "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, "ap-southeast-2": endpoint{}, - "aws-global": endpoint{}, - "ca-central-1": endpoint{}, - "eu-central-1": endpoint{}, - "eu-north-1": endpoint{}, - "eu-west-1": endpoint{}, - "eu-west-2": endpoint{}, - "eu-west-3": endpoint{}, - "me-south-1": endpoint{ - Hostname: "sts.me-south-1.amazonaws.com", + "aws-global": endpoint{ + Hostname: "sts.amazonaws.com", CredentialScope: credentialScope{ - Region: "me-south-1", + Region: "us-east-1", }, }, - "sa-east-1": endpoint{}, - "us-east-1": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "sts-fips.us-east-1.amazonaws.com", CredentialScope: credentialScope{ @@ -3620,6 +4146,41 @@ var awsPartition = partition{ "us-west-2": endpoint{}, }, }, + "transcribe": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "ap-east-1": endpoint{}, + "ap-northeast-1": endpoint{}, + "ap-northeast-2": endpoint{}, + "ap-south-1": endpoint{}, + "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, + "me-south-1": endpoint{}, + "sa-east-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-1": endpoint{}, + "us-west-2": endpoint{}, + }, + }, + "transcribestreaming": service{ + + Endpoints: endpoints{ + "ap-southeast-2": endpoint{}, + "ca-central-1": endpoint{}, + "eu-west-1": endpoint{}, + "us-east-1": endpoint{}, + "us-east-2": endpoint{}, + "us-west-2": endpoint{}, + }, + }, "transfer": service{ Endpoints: endpoints{ @@ -3646,13 +4207,18 @@ var awsPartition = partition{ Protocols: []string{"https"}, }, Endpoints: endpoints{ + "ap-east-1": endpoint{}, "ap-northeast-1": endpoint{}, "ap-northeast-2": endpoint{}, "ap-south-1": endpoint{}, "ap-southeast-1": endpoint{}, + "ap-southeast-2": endpoint{}, "ca-central-1": endpoint{}, "eu-central-1": endpoint{}, + "eu-north-1": endpoint{}, "eu-west-1": endpoint{}, + "eu-west-2": endpoint{}, + "eu-west-3": endpoint{}, "us-east-1": endpoint{}, "us-east-1-fips": endpoint{ Hostname: "translate-fips.us-east-1.amazonaws.com", @@ -3667,6 +4233,7 @@ var awsPartition = partition{ Region: "us-east-2", }, }, + "us-west-1": endpoint{}, "us-west-2": endpoint{}, "us-west-2-fips": endpoint{ Hostname: "translate-fips.us-west-2.amazonaws.com", @@ -3828,17 +4395,25 @@ var awscnPartition = partition{ }, "application-autoscaling": service{ Defaults: endpoint{ - Hostname: "autoscaling.{region}.amazonaws.com.cn", Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Service: "application-autoscaling", - }, }, Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, }, }, + "appsync": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + }, + }, + "athena": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{}, + }, + }, "autoscaling": service{ Defaults: endpoint{ Protocols: []string{"http", "https"}, @@ -3848,6 +4423,20 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "backup": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "batch": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, "cloudformation": service{ Endpoints: endpoints{ @@ -3903,6 +4492,12 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "dax": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{}, + }, + }, "directconnect": service{ Endpoints: endpoints{ @@ -3974,6 +4569,13 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "elasticfilesystem": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, "elasticloadbalancing": service{ Defaults: endpoint{ Protocols: []string{"https"}, @@ -4028,6 +4630,12 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "glue": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{}, + }, + }, "greengrass": service{ IsRegionalized: boxedTrue, Defaults: endpoint{ @@ -4037,6 +4645,13 @@ var awscnPartition = partition{ "cn-north-1": endpoint{}, }, }, + "health": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, "iam": service{ PartitionEndpoint: "aws-cn-global", IsRegionalized: boxedFalse, @@ -4116,6 +4731,17 @@ var awscnPartition = partition{ "cn-northwest-1": endpoint{}, }, }, + "neptune": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{ + Hostname: "rds.cn-northwest-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, "polly": service{ Endpoints: endpoints{ @@ -4168,6 +4794,26 @@ var awscnPartition = partition{ }, }, }, + "secretsmanager": service{ + + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "serverlessrepo": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{ + Protocols: []string{"https"}, + }, + "cn-northwest-1": endpoint{ + Protocols: []string{"https"}, + }, + }, + }, "sms": service{ Endpoints: endpoints{ @@ -4217,7 +4863,8 @@ var awscnPartition = partition{ "storagegateway": service{ Endpoints: endpoints{ - "cn-north-1": endpoint{}, + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, }, }, "streams.dynamodb": service{ @@ -4244,7 +4891,7 @@ var awscnPartition = partition{ Endpoints: endpoints{ "aws-cn-global": endpoint{ - Hostname: "support.cn-north-1.amazonaws.com", + Hostname: "support.cn-north-1.amazonaws.com.cn", CredentialScope: credentialScope{ Region: "cn-north-1", }, @@ -4260,6 +4907,38 @@ var awscnPartition = partition{ }, "tagging": service{ + Endpoints: endpoints{ + "cn-north-1": endpoint{}, + "cn-northwest-1": endpoint{}, + }, + }, + "transcribe": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "cn-north-1": endpoint{ + Hostname: "cn.transcribe.cn-north-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-north-1", + }, + }, + "cn-northwest-1": endpoint{ + Hostname: "cn.transcribe.cn-northwest-1.amazonaws.com.cn", + CredentialScope: credentialScope{ + Region: "cn-northwest-1", + }, + }, + }, + }, + "workspaces": service{ + + Endpoints: endpoints{ + "cn-northwest-1": endpoint{}, + }, + }, + "xray": service{ + Endpoints: endpoints{ "cn-north-1": endpoint{}, "cn-northwest-1": endpoint{}, @@ -4297,6 +4976,13 @@ var awsusgovPartition = partition{ }, }, Services: services{ + "access-analyzer": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, "acm": service{ Endpoints: endpoints{ @@ -4345,7 +5031,8 @@ var awsusgovPartition = partition{ }, "application-autoscaling": service{ Defaults: endpoint{ - Hostname: "autoscaling.{region}.amazonaws.com", + Hostname: "autoscaling.{region}.amazonaws.com", + Protocols: []string{"http", "https"}, CredentialScope: credentialScope{ Service: "application-autoscaling", }, @@ -4355,6 +5042,23 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "appstream2": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + CredentialScope: credentialScope{ + Service: "appstream", + }, + }, + Endpoints: endpoints{ + "fips": endpoint{ + Hostname: "appstream2-fips.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-west-1": endpoint{}, + }, + }, "athena": service{ Endpoints: endpoints{ @@ -4371,6 +5075,22 @@ var awsusgovPartition = partition{ }, }, }, + "autoscaling-plans": service{ + Defaults: endpoint{ + Protocols: []string{"http", "https"}, + }, + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, + "batch": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, "clouddirectory": service{ Endpoints: endpoints{ @@ -4449,6 +5169,12 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "comprehendmedical": service{ + + Endpoints: endpoints{ + "us-gov-west-1": endpoint{}, + }, + }, "config": service{ Endpoints: endpoints{ @@ -4465,6 +5191,7 @@ var awsusgovPartition = partition{ Region: "us-gov-west-1", }, }, + "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, @@ -4556,6 +5283,7 @@ var awsusgovPartition = partition{ "elasticfilesystem": service{ Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, "us-gov-west-1": endpoint{}, }, }, @@ -4802,6 +5530,25 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "resource-groups": service{ + + Endpoints: endpoints{ + "fips-us-gov-east-1": endpoint{ + Hostname: "resource-groups.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, + "fips-us-gov-west-1": endpoint{ + Hostname: "resource-groups.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, "route53": service{ PartitionEndpoint: "aws-us-gov-global", IsRegionalized: boxedFalse, @@ -4815,6 +5562,13 @@ var awsusgovPartition = partition{ }, }, }, + "route53resolver": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, "runtime.sagemaker": service{ Endpoints: endpoints{ @@ -4881,6 +5635,13 @@ var awsusgovPartition = partition{ "secretsmanager": service{ Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-east-1-fips": endpoint{ + Hostname: "secretsmanager-fips.us-gov-east-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-east-1", + }, + }, "us-gov-west-1": endpoint{}, "us-gov-west-1-fips": endpoint{ Hostname: "secretsmanager-fips.us-gov-west-1.amazonaws.com", @@ -4998,6 +5759,18 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "support": service{ + PartitionEndpoint: "aws-us-gov-global", + + Endpoints: endpoints{ + "aws-us-gov-global": endpoint{ + Hostname: "support.us-gov-west-1.amazonaws.com", + CredentialScope: credentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, "swf": service{ Endpoints: endpoints{ @@ -5012,6 +5785,15 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "transcribe": service{ + Defaults: endpoint{ + Protocols: []string{"https"}, + }, + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, "translate": service{ Defaults: endpoint{ Protocols: []string{"https"}, @@ -5038,6 +5820,13 @@ var awsusgovPartition = partition{ "us-gov-west-1": endpoint{}, }, }, + "xray": service{ + + Endpoints: endpoints{ + "us-gov-east-1": endpoint{}, + "us-gov-west-1": endpoint{}, + }, + }, }, } @@ -5078,13 +5867,21 @@ var awsisoPartition = partition{ }, }, }, + "api.sagemaker": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, + "apigateway": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, "application-autoscaling": service{ Defaults: endpoint{ - Hostname: "autoscaling.{region}.amazonaws.com", Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Service: "application-autoscaling", - }, }, Endpoints: endpoints{ "us-iso-east-1": endpoint{}, @@ -5293,6 +6090,12 @@ var awsisoPartition = partition{ }, }, }, + "runtime.sagemaker": service{ + + Endpoints: endpoints{ + "us-iso-east-1": endpoint{}, + }, + }, "s3": service{ Defaults: endpoint{ SignatureVersions: []string{"s3v4"}, @@ -5406,11 +6209,7 @@ var awsisobPartition = partition{ Services: services{ "application-autoscaling": service{ Defaults: endpoint{ - Hostname: "autoscaling.{region}.amazonaws.com", Protocols: []string{"http", "https"}, - CredentialScope: credentialScope{ - Service: "application-autoscaling", - }, }, Endpoints: endpoints{ "us-isob-east-1": endpoint{}, @@ -5606,6 +6405,12 @@ var awsisobPartition = partition{ "us-isob-east-1": endpoint{}, }, }, + "ssm": service{ + + Endpoints: endpoints{ + "us-isob-east-1": endpoint{}, + }, + }, "states": service{ Endpoints: endpoints{ 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 9c936be6cf9..ca956e5f12a 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/endpoints.go @@ -3,6 +3,7 @@ package endpoints import ( "fmt" "regexp" + "strings" "github.com/aws/aws-sdk-go/aws/awserr" ) @@ -46,6 +47,108 @@ type Options struct { // // This option is ignored if StrictMatching is enabled. ResolveUnknownService bool + + // STS Regional Endpoint flag helps with resolving the STS endpoint + STSRegionalEndpoint STSRegionalEndpoint + + // S3 Regional Endpoint flag helps with resolving the S3 endpoint + S3UsEast1RegionalEndpoint S3UsEast1RegionalEndpoint +} + +// STSRegionalEndpoint is an enum for the states of the STS Regional Endpoint +// options. +type STSRegionalEndpoint int + +func (e STSRegionalEndpoint) String() string { + switch e { + case LegacySTSEndpoint: + return "legacy" + case RegionalSTSEndpoint: + return "regional" + case UnsetSTSEndpoint: + return "" + default: + return "unknown" + } +} + +const ( + + // UnsetSTSEndpoint represents that STS Regional Endpoint flag is not specified. + UnsetSTSEndpoint STSRegionalEndpoint = iota + + // LegacySTSEndpoint represents when STS Regional Endpoint flag is specified + // to use legacy endpoints. + LegacySTSEndpoint + + // RegionalSTSEndpoint represents when STS Regional Endpoint flag is specified + // to use regional endpoints. + RegionalSTSEndpoint +) + +// GetSTSRegionalEndpoint function returns the STSRegionalEndpointFlag based +// on the input string provided in env config or shared config by the user. +// +// `legacy`, `regional` are the only case-insensitive valid strings for +// resolving the STS regional Endpoint flag. +func GetSTSRegionalEndpoint(s string) (STSRegionalEndpoint, error) { + switch { + case strings.EqualFold(s, "legacy"): + return LegacySTSEndpoint, nil + case strings.EqualFold(s, "regional"): + return RegionalSTSEndpoint, nil + default: + return UnsetSTSEndpoint, fmt.Errorf("unable to resolve the value of STSRegionalEndpoint for %v", s) + } +} + +// S3UsEast1RegionalEndpoint is an enum for the states of the S3 us-east-1 +// Regional Endpoint options. +type S3UsEast1RegionalEndpoint int + +func (e S3UsEast1RegionalEndpoint) String() string { + switch e { + case LegacyS3UsEast1Endpoint: + return "legacy" + case RegionalS3UsEast1Endpoint: + return "regional" + case UnsetS3UsEast1Endpoint: + return "" + default: + return "unknown" + } +} + +const ( + + // UnsetS3UsEast1Endpoint represents that S3 Regional Endpoint flag is not + // specified. + UnsetS3UsEast1Endpoint S3UsEast1RegionalEndpoint = iota + + // LegacyS3UsEast1Endpoint represents when S3 Regional Endpoint flag is + // specified to use legacy endpoints. + LegacyS3UsEast1Endpoint + + // RegionalS3UsEast1Endpoint represents when S3 Regional Endpoint flag is + // specified to use regional endpoints. + RegionalS3UsEast1Endpoint +) + +// GetS3UsEast1RegionalEndpoint function returns the S3UsEast1RegionalEndpointFlag based +// on the input string provided in env config or shared config by the user. +// +// `legacy`, `regional` are the only case-insensitive valid strings for +// resolving the S3 regional Endpoint flag. +func GetS3UsEast1RegionalEndpoint(s string) (S3UsEast1RegionalEndpoint, error) { + switch { + case strings.EqualFold(s, "legacy"): + return LegacyS3UsEast1Endpoint, nil + case strings.EqualFold(s, "regional"): + return RegionalS3UsEast1Endpoint, nil + default: + return UnsetS3UsEast1Endpoint, + fmt.Errorf("unable to resolve the value of S3UsEast1RegionalEndpoint for %v", s) + } } // Set combines all of the option functions together. @@ -79,6 +182,12 @@ func ResolveUnknownServiceOption(o *Options) { o.ResolveUnknownService = true } +// STSRegionalEndpointOption enables the STS endpoint resolver behavior to resolve +// STS endpoint to their regional endpoint, instead of the global endpoint. +func STSRegionalEndpointOption(o *Options) { + o.STSRegionalEndpoint = RegionalSTSEndpoint +} + // A Resolver provides the interface for functionality to resolve endpoints. // The build in Partition and DefaultResolver return value satisfy this interface. type Resolver interface { @@ -194,7 +303,7 @@ func (p Partition) ID() string { return p.id } // require the provided service and region to be known by the partition. // If the endpoint cannot be strictly resolved an error will be returned. This // mode is useful to ensure the endpoint resolved is valid. Without -// StrictMatching enabled the endpoint returned my look valid but may not work. +// StrictMatching enabled the endpoint returned may look valid but may not work. // StrictMatching requires the SDK to be updated if you want to take advantage // of new regions and services expansions. // @@ -208,7 +317,7 @@ func (p Partition) EndpointFor(service, region string, opts ...func(*Options)) ( // Regions returns a map of Regions indexed by their ID. This is useful for // enumerating over the regions in a partition. func (p Partition) Regions() map[string]Region { - rs := map[string]Region{} + rs := make(map[string]Region, len(p.p.Regions)) for id, r := range p.p.Regions { rs[id] = Region{ id: id, @@ -223,7 +332,7 @@ func (p Partition) Regions() map[string]Region { // Services returns a map of Service indexed by their ID. This is useful for // enumerating over the services in a partition. func (p Partition) Services() map[string]Service { - ss := map[string]Service{} + ss := make(map[string]Service, len(p.p.Services)) for id := range p.p.Services { ss[id] = Service{ id: id, @@ -310,7 +419,7 @@ func (s Service) Regions() map[string]Region { // A region is the AWS region the service exists in. Whereas a Endpoint is // an URL that can be resolved to a instance of a service. func (s Service) Endpoints() map[string]Endpoint { - es := map[string]Endpoint{} + es := make(map[string]Endpoint, len(s.p.Services[s.id].Endpoints)) for id := range s.p.Services[s.id].Endpoints { es[id] = Endpoint{ id: id, @@ -350,6 +459,9 @@ type ResolvedEndpoint struct { // The endpoint URL URL string + // The endpoint partition + PartitionID string + // The region that should be used for signing requests. SigningRegion string diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/legacy_regions.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/legacy_regions.go new file mode 100644 index 00000000000..df75e899adb --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/legacy_regions.go @@ -0,0 +1,24 @@ +package endpoints + +var legacyGlobalRegions = map[string]map[string]struct{}{ + "sts": { + "ap-northeast-1": {}, + "ap-south-1": {}, + "ap-southeast-1": {}, + "ap-southeast-2": {}, + "ca-central-1": {}, + "eu-central-1": {}, + "eu-north-1": {}, + "eu-west-1": {}, + "eu-west-2": {}, + "eu-west-3": {}, + "sa-east-1": {}, + "us-east-1": {}, + "us-east-2": {}, + "us-west-1": {}, + "us-west-2": {}, + }, + "s3": { + "us-east-1": {}, + }, +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go index 523ad79ac0a..eb2ac83c992 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/endpoints/v3model.go @@ -75,24 +75,56 @@ func (p partition) canResolveEndpoint(service, region string, strictMatch bool) return p.RegionRegex.MatchString(region) } +func allowLegacyEmptyRegion(service string) bool { + legacy := map[string]struct{}{ + "budgets": {}, + "ce": {}, + "chime": {}, + "cloudfront": {}, + "ec2metadata": {}, + "iam": {}, + "importexport": {}, + "organizations": {}, + "route53": {}, + "sts": {}, + "support": {}, + "waf": {}, + } + + _, allowed := legacy[service] + return allowed +} + func (p partition) EndpointFor(service, region string, opts ...func(*Options)) (resolved ResolvedEndpoint, err error) { var opt Options opt.Set(opts...) s, hasService := p.Services[service] - if !(hasService || opt.ResolveUnknownService) { + if len(service) == 0 || !(hasService || opt.ResolveUnknownService) { // Only return error if the resolver will not fallback to creating // endpoint based on service endpoint ID passed in. return resolved, NewUnknownServiceError(p.ID, service, serviceList(p.Services)) } + if len(region) == 0 && allowLegacyEmptyRegion(service) && len(s.PartitionEndpoint) != 0 { + region = s.PartitionEndpoint + } + + if (service == "sts" && opt.STSRegionalEndpoint != RegionalSTSEndpoint) || + (service == "s3" && opt.S3UsEast1RegionalEndpoint != RegionalS3UsEast1Endpoint) { + if _, ok := legacyGlobalRegions[service][region]; ok { + region = "aws-global" + } + } + e, hasEndpoint := s.endpointForRegion(region) - if !hasEndpoint && opt.StrictMatching { + if len(region) == 0 || (!hasEndpoint && opt.StrictMatching) { return resolved, NewUnknownEndpointError(p.ID, service, region, endpointList(s.Endpoints)) } defs := []endpoint{p.Defaults, s.Defaults} - return e.resolve(service, region, p.DNSSuffix, defs, opt), nil + + return e.resolve(service, p.ID, region, p.DNSSuffix, defs, opt), nil } func serviceList(ss services) []string { @@ -201,7 +233,7 @@ func getByPriority(s []string, p []string, def string) string { return s[0] } -func (e endpoint) resolve(service, region, dnsSuffix string, defs []endpoint, opts Options) ResolvedEndpoint { +func (e endpoint) resolve(service, partitionID, region, dnsSuffix string, defs []endpoint, opts Options) ResolvedEndpoint { var merged endpoint for _, def := range defs { merged.mergeIn(def) @@ -209,11 +241,23 @@ func (e endpoint) resolve(service, region, dnsSuffix string, defs []endpoint, op merged.mergeIn(e) e = merged - hostname := e.Hostname + signingRegion := e.CredentialScope.Region + if len(signingRegion) == 0 { + signingRegion = region + } + signingName := e.CredentialScope.Service + var signingNameDerived bool + if len(signingName) == 0 { + signingName = service + signingNameDerived = true + } + + hostname := e.Hostname // Offset the hostname for dualstack if enabled if opts.UseDualStack && e.HasDualStack == boxedTrue { hostname = e.DualStackHostname + region = signingRegion } u := strings.Replace(hostname, "{service}", service, 1) @@ -223,20 +267,9 @@ func (e endpoint) resolve(service, region, dnsSuffix string, defs []endpoint, op scheme := getEndpointScheme(e.Protocols, opts.DisableSSL) u = fmt.Sprintf("%s://%s", scheme, u) - signingRegion := e.CredentialScope.Region - if len(signingRegion) == 0 { - signingRegion = region - } - - signingName := e.CredentialScope.Service - var signingNameDerived bool - if len(signingName) == 0 { - signingName = service - signingNameDerived = true - } - return ResolvedEndpoint{ URL: u, + PartitionID: partitionID, SigningRegion: signingRegion, SigningName: signingName, SigningNameDerived: signingNameDerived, 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 185b073181e..e819ab6c0e8 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 @@ -10,6 +10,7 @@ import ( type Handlers struct { Validate HandlerList Build HandlerList + BuildStream HandlerList Sign HandlerList Send HandlerList ValidateResponse HandlerList @@ -28,6 +29,7 @@ func (h *Handlers) Copy() Handlers { return Handlers{ Validate: h.Validate.copy(), Build: h.Build.copy(), + BuildStream: h.BuildStream.copy(), Sign: h.Sign.copy(), Send: h.Send.copy(), ValidateResponse: h.ValidateResponse.copy(), @@ -46,6 +48,7 @@ func (h *Handlers) Copy() Handlers { func (h *Handlers) Clear() { h.Validate.Clear() h.Build.Clear() + h.BuildStream.Clear() h.Send.Clear() h.Sign.Clear() h.Unmarshal.Clear() @@ -67,6 +70,9 @@ func (h *Handlers) IsEmpty() bool { if h.Build.Len() != 0 { return false } + if h.BuildStream.Len() != 0 { + return false + } if h.Send.Len() != 0 { return false } @@ -320,3 +326,18 @@ func MakeAddToUserAgentFreeFormHandler(s string) func(*Request) { AddToUserAgent(r, s) } } + +// WithSetRequestHeaders updates the operation request's HTTP header to contain +// the header key value pairs provided. If the header key already exists in the +// request's HTTP header set, the existing value(s) will be replaced. +func WithSetRequestHeaders(h map[string]string) Option { + return withRequestHeader(h).SetRequestHeaders +} + +type withRequestHeader map[string]string + +func (h withRequestHeader) SetRequestHeaders(r *Request) { + for k, v := range h { + r.HTTPRequest.Header[k] = []string{v} + } +} 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 8e332cce6a6..d597c6ead55 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 @@ -36,6 +36,10 @@ const ( // API request that was canceled. Requests given a aws.Context may // return this error when canceled. CanceledErrorCode = "RequestCanceled" + + // ErrCodeRequestError is an error preventing the SDK from continuing to + // process the request. + ErrCodeRequestError = "RequestError" ) // A Request is the service request to be made. @@ -51,6 +55,7 @@ type Request struct { HTTPRequest *http.Request HTTPResponse *http.Response Body io.ReadSeeker + streamingBody io.ReadCloser BodyStart int64 // offset from beginning of Body that the request body starts Params interface{} Error error @@ -99,8 +104,12 @@ type Operation struct { BeforePresignFn func(r *Request) error } -// New returns a new Request pointer for the service API -// operation and parameters. +// New returns a new Request pointer for the service API operation and +// parameters. +// +// A Retryer should be provided to direct how the request is retried. If +// Retryer is nil, a default no retry value will be used. You can use +// NoOpRetryer in the Client package to disable retry behavior directly. // // Params is any value of input parameters to be the request payload. // Data is pointer value to an object which the request's response @@ -108,6 +117,10 @@ type Operation struct { func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers, retryer Retryer, operation *Operation, params interface{}, data interface{}) *Request { + if retryer == nil { + retryer = noOpRetryer{} + } + method := operation.HTTPMethod if method == "" { method = "POST" @@ -122,8 +135,6 @@ func New(cfg aws.Config, clientInfo metadata.ClientInfo, handlers Handlers, err = awserr.New("InvalidEndpointURL", "invalid endpoint uri", err) } - SanitizeHostForHeader(httpReq) - r := &Request{ Config: cfg, ClientInfo: clientInfo, @@ -287,6 +298,13 @@ func (r *Request) SetReaderBody(reader io.ReadSeeker) { r.ResetBody() } +// SetStreamingBody set the reader to be used for the request that will stream +// bytes to the server. Request's Body must not be set to any reader. +func (r *Request) SetStreamingBody(reader io.ReadCloser) { + r.streamingBody = reader + r.SetReaderBody(aws.ReadSeekCloser(reader)) +} + // Presign returns the request's signed URL. Error will be returned // if the signing fails. The expire parameter is only used for presigned Amazon // S3 API requests. All other AWS services will use a fixed expiration @@ -406,11 +424,17 @@ func (r *Request) Sign() error { return r.Error } + SanitizeHostForHeader(r.HTTPRequest) + r.Handlers.Sign.Run(r) return r.Error } func (r *Request) getNextRequestBody() (body io.ReadCloser, err error) { + if r.streamingBody != nil { + return r.streamingBody, nil + } + if r.safeBody != nil { r.safeBody.Close() } @@ -615,6 +639,10 @@ func getHost(r *http.Request) string { return r.Host } + if r.URL == nil { + return "" + } + return r.URL.Host } 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 f093fc542df..64784e16f3d 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/request/request_pagination.go @@ -17,11 +17,13 @@ import ( // does the pagination between API operations, and Paginator defines the // configuration that will be used per page request. // -// cont := true -// for p.Next() && cont { +// for p.Next() { // data := p.Page().(*s3.ListObjectsOutput) // // process the page's data +// // ... +// // break out of loop to stop fetching additional pages // } +// // return p.Err() // // See service client API operation Pages methods for examples how the SDK will 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 e84084da5ef..752ae47f845 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 @@ -35,16 +35,47 @@ type Retryer interface { } // WithRetryer sets a Retryer value to the given Config returning the Config -// value for chaining. +// value for chaining. The value must not be nil. func WithRetryer(cfg *aws.Config, retryer Retryer) *aws.Config { + if retryer == nil { + if cfg.Logger != nil { + cfg.Logger.Log("ERROR: Request.WithRetryer called with nil retryer. Replacing with retry disabled Retryer.") + } + retryer = noOpRetryer{} + } cfg.Retryer = retryer return cfg + +} + +// noOpRetryer is a internal no op retryer used when a request is created +// without a retryer. +// +// Provides a retryer that performs no retries. +// It should be used when we do not want retries to be performed. +type noOpRetryer struct{} + +// MaxRetries returns the number of maximum returns the service will use to make +// an individual API; For NoOpRetryer the MaxRetries will always be zero. +func (d noOpRetryer) MaxRetries() int { + return 0 +} + +// ShouldRetry will always return false for NoOpRetryer, as it should never retry. +func (d noOpRetryer) ShouldRetry(_ *Request) bool { + return false +} + +// RetryRules returns the delay duration before retrying this request again; +// since NoOpRetryer does not retry, RetryRules always returns 0. +func (d noOpRetryer) RetryRules(_ *Request) time.Duration { + return 0 } // retryableCodes is a collection of service response codes which are retry-able // without any further action. var retryableCodes = map[string]struct{}{ - "RequestError": {}, + ErrCodeRequestError: {}, "RequestTimeout": {}, ErrCodeResponseTimeout: {}, "RequestTimeoutException": {}, // Glacier's flavor of RequestTimeout @@ -52,6 +83,7 @@ var retryableCodes = map[string]struct{}{ var throttleCodes = map[string]struct{}{ "ProvisionedThroughputExceededException": {}, + "ThrottledException": {}, // SNS, XRay, ResourceGroupsTagging API "Throttling": {}, "ThrottlingException": {}, "RequestLimitExceeded": {}, @@ -60,6 +92,7 @@ var throttleCodes = map[string]struct{}{ "TooManyRequestsException": {}, // Lambda functions "PriorRequestNotComplete": {}, // Route53 "TransactionInProgressException": {}, + "EC2ThrottledException": {}, // EC2 } // credsExpiredCodes is a collection of error codes which signify the credentials @@ -145,8 +178,8 @@ func shouldRetryError(origErr error) bool { origErr := err.OrigErr() var shouldRetry bool if origErr != nil { - shouldRetry := shouldRetryError(origErr) - if err.Code() == "RequestError" && !shouldRetry { + shouldRetry = shouldRetryError(origErr) + if err.Code() == ErrCodeRequestError && !shouldRetry { return false } } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go b/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go index 7713ccfca5e..cc64e24f1d5 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/credentials.go @@ -47,10 +47,10 @@ func resolveCredentials(cfg *aws.Config, } // WebIdentityEmptyRoleARNErr will occur if 'AWS_WEB_IDENTITY_TOKEN_FILE' was set but -// 'AWS_IAM_ROLE_ARN' was not set. +// 'AWS_ROLE_ARN' was not set. var WebIdentityEmptyRoleARNErr = awserr.New(stscreds.ErrCodeWebIdentity, "role ARN is not set", nil) -// WebIdentityEmptyTokenFilePathErr will occur if 'AWS_IAM_ROLE_ARN' was set but +// WebIdentityEmptyTokenFilePathErr will occur if 'AWS_ROLE_ARN' was set but // 'AWS_WEB_IDENTITY_TOKEN_FILE' was not set. var WebIdentityEmptyTokenFilePathErr = awserr.New(stscreds.ErrCodeWebIdentity, "token file path is not set", nil) 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 60a6f9ce2a4..c1e0e9c9543 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/session/env_config.go @@ -1,12 +1,15 @@ package session import ( + "fmt" "os" "strconv" + "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/defaults" + "github.com/aws/aws-sdk-go/aws/endpoints" ) // EnvProviderName provides a name of the provider when config is loaded from environment. @@ -125,6 +128,26 @@ type envConfig struct { // // AWS_ROLE_SESSION_NAME=session_name RoleSessionName string + + // Specifies the STS Regional Endpoint flag for the SDK to resolve the endpoint + // for a service. + // + // AWS_STS_REGIONAL_ENDPOINTS=regional + // This can take value as `regional` or `legacy` + STSRegionalEndpoint endpoints.STSRegionalEndpoint + + // Specifies the S3 Regional Endpoint flag for the SDK to resolve the + // endpoint for a service. + // + // AWS_S3_US_EAST_1_REGIONAL_ENDPOINT=regional + // This can take value as `regional` or `legacy` + S3UsEast1RegionalEndpoint endpoints.S3UsEast1RegionalEndpoint + + // Specifies if the S3 service should allow ARNs to direct the region + // the client's requests are sent to. + // + // AWS_S3_USE_ARN_REGION=true + S3UseARNRegion bool } var ( @@ -179,6 +202,15 @@ var ( roleSessionNameEnvKey = []string{ "AWS_ROLE_SESSION_NAME", } + stsRegionalEndpointKey = []string{ + "AWS_STS_REGIONAL_ENDPOINTS", + } + s3UsEast1RegionalEndpoint = []string{ + "AWS_S3_US_EAST_1_REGIONAL_ENDPOINT", + } + s3UseARNRegionEnvKey = []string{ + "AWS_S3_USE_ARN_REGION", + } ) // loadEnvConfig retrieves the SDK's environment configuration. @@ -187,7 +219,7 @@ var ( // If the environment variable `AWS_SDK_LOAD_CONFIG` is set to a truthy value // the shared SDK config will be loaded in addition to the SDK's specific // configuration values. -func loadEnvConfig() envConfig { +func loadEnvConfig() (envConfig, error) { enableSharedConfig, _ := strconv.ParseBool(os.Getenv("AWS_SDK_LOAD_CONFIG")) return envConfigLoad(enableSharedConfig) } @@ -198,11 +230,11 @@ func loadEnvConfig() envConfig { // Loads the shared configuration in addition to the SDK's specific configuration. // This will load the same values as `loadEnvConfig` if the `AWS_SDK_LOAD_CONFIG` // environment variable is set. -func loadSharedEnvConfig() envConfig { +func loadSharedEnvConfig() (envConfig, error) { return envConfigLoad(true) } -func envConfigLoad(enableSharedConfig bool) envConfig { +func envConfigLoad(enableSharedConfig bool) (envConfig, error) { cfg := envConfig{} cfg.EnableSharedConfig = enableSharedConfig @@ -264,12 +296,48 @@ func envConfigLoad(enableSharedConfig bool) envConfig { cfg.CustomCABundle = os.Getenv("AWS_CA_BUNDLE") - return cfg + var err error + // STS Regional Endpoint variable + for _, k := range stsRegionalEndpointKey { + if v := os.Getenv(k); len(v) != 0 { + cfg.STSRegionalEndpoint, err = endpoints.GetSTSRegionalEndpoint(v) + if err != nil { + return cfg, fmt.Errorf("failed to load, %v from env config, %v", k, err) + } + } + } + + // S3 Regional Endpoint variable + for _, k := range s3UsEast1RegionalEndpoint { + if v := os.Getenv(k); len(v) != 0 { + cfg.S3UsEast1RegionalEndpoint, err = endpoints.GetS3UsEast1RegionalEndpoint(v) + if err != nil { + return cfg, fmt.Errorf("failed to load, %v from env config, %v", k, err) + } + } + } + + var s3UseARNRegion string + setFromEnvVal(&s3UseARNRegion, s3UseARNRegionEnvKey) + if len(s3UseARNRegion) != 0 { + switch { + case strings.EqualFold(s3UseARNRegion, "false"): + cfg.S3UseARNRegion = false + case strings.EqualFold(s3UseARNRegion, "true"): + cfg.S3UseARNRegion = true + default: + return envConfig{}, fmt.Errorf( + "invalid value for environment variable, %s=%s, need true or false", + s3UseARNRegionEnvKey[0], s3UseARNRegion) + } + } + + return cfg, nil } func setFromEnvVal(dst *string, keys []string) { for _, k := range keys { - if v := os.Getenv(k); len(v) > 0 { + if v := os.Getenv(k); len(v) != 0 { *dst = v break } 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 7b0a942e223..0ff49960510 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 @@ -73,7 +73,7 @@ type Session struct { // func is called instead of waiting to receive an error until a request is made. func New(cfgs ...*aws.Config) *Session { // load initial config from environment - envCfg := loadEnvConfig() + envCfg, envErr := loadEnvConfig() if envCfg.EnableSharedConfig { var cfg aws.Config @@ -93,17 +93,17 @@ func New(cfgs ...*aws.Config) *Session { // Session creation failed, need to report the error and prevent // any requests from succeeding. s = &Session{Config: defaults.Config()} - s.Config.MergeIn(cfgs...) - s.Config.Logger.Log("ERROR:", msg, "Error:", err) - s.Handlers.Validate.PushBack(func(r *request.Request) { - r.Error = err - }) + s.logDeprecatedNewSessionError(msg, err, cfgs) } return s } s := deprecatedNewSession(cfgs...) + if envErr != nil { + msg := "failed to load env config" + s.logDeprecatedNewSessionError(msg, envErr, cfgs) + } if csmCfg, err := loadCSMConfig(envCfg, []string{}); err != nil { if l := s.Config.Logger; l != nil { @@ -112,11 +112,8 @@ func New(cfgs ...*aws.Config) *Session { } else if csmCfg.Enabled { err := enableCSM(&s.Handlers, csmCfg, s.Config.Logger) if err != nil { - err = fmt.Errorf("failed to enable CSM, %v", err) - s.Config.Logger.Log("ERROR:", err.Error()) - s.Handlers.Validate.PushBack(func(r *request.Request) { - r.Error = err - }) + msg := "failed to enable CSM" + s.logDeprecatedNewSessionError(msg, err, cfgs) } } @@ -279,10 +276,17 @@ type Options struct { // })) func NewSessionWithOptions(opts Options) (*Session, error) { var envCfg envConfig + var err error if opts.SharedConfigState == SharedConfigEnable { - envCfg = loadSharedEnvConfig() + envCfg, err = loadSharedEnvConfig() + if err != nil { + return nil, fmt.Errorf("failed to load shared config, %v", err) + } } else { - envCfg = loadEnvConfig() + envCfg, err = loadEnvConfig() + if err != nil { + return nil, fmt.Errorf("failed to load environment config, %v", err) + } } if len(opts.Profile) != 0 { @@ -550,6 +554,22 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, } } + // Regional Endpoint flag for STS endpoint resolving + mergeSTSRegionalEndpointConfig(cfg, []endpoints.STSRegionalEndpoint{ + userCfg.STSRegionalEndpoint, + envCfg.STSRegionalEndpoint, + sharedCfg.STSRegionalEndpoint, + endpoints.LegacySTSEndpoint, + }) + + // Regional Endpoint flag for S3 endpoint resolving + mergeS3UsEast1RegionalEndpointConfig(cfg, []endpoints.S3UsEast1RegionalEndpoint{ + userCfg.S3UsEast1RegionalEndpoint, + envCfg.S3UsEast1RegionalEndpoint, + sharedCfg.S3UsEast1RegionalEndpoint, + endpoints.LegacyS3UsEast1Endpoint, + }) + // Configure credentials if not already set by the user when creating the // Session. if cfg.Credentials == credentials.AnonymousCredentials && userCfg.Credentials == nil { @@ -560,9 +580,35 @@ func mergeConfigSrcs(cfg, userCfg *aws.Config, cfg.Credentials = creds } + cfg.S3UseARNRegion = userCfg.S3UseARNRegion + if cfg.S3UseARNRegion == nil { + cfg.S3UseARNRegion = &envCfg.S3UseARNRegion + } + if cfg.S3UseARNRegion == nil { + cfg.S3UseARNRegion = &sharedCfg.S3UseARNRegion + } + return nil } +func mergeSTSRegionalEndpointConfig(cfg *aws.Config, values []endpoints.STSRegionalEndpoint) { + for _, v := range values { + if v != endpoints.UnsetSTSEndpoint { + cfg.STSRegionalEndpoint = v + break + } + } +} + +func mergeS3UsEast1RegionalEndpointConfig(cfg *aws.Config, values []endpoints.S3UsEast1RegionalEndpoint) { + for _, v := range values { + if v != endpoints.UnsetS3UsEast1Endpoint { + cfg.S3UsEast1RegionalEndpoint = v + break + } + } +} + func initHandlers(s *Session) { // Add the Validate parameter handler if it is not disabled. s.Handlers.Validate.Remove(corehandlers.ValidateParametersHandler) @@ -591,47 +637,67 @@ func (s *Session) Copy(cfgs ...*aws.Config) *Session { // ClientConfig satisfies the client.ConfigProvider interface and is used to // configure the service client instances. Passing the Session to the service // client's constructor (New) will use this method to configure the client. -func (s *Session) ClientConfig(serviceName string, cfgs ...*aws.Config) client.Config { - // Backwards compatibility, the error will be eaten if user calls ClientConfig - // directly. All SDK services will use ClientconfigWithError. - cfg, _ := s.clientConfigWithErr(serviceName, cfgs...) - - return cfg -} - -func (s *Session) clientConfigWithErr(serviceName string, cfgs ...*aws.Config) (client.Config, error) { +func (s *Session) ClientConfig(service string, cfgs ...*aws.Config) client.Config { s = s.Copy(cfgs...) - var resolved endpoints.ResolvedEndpoint - var err error - region := aws.StringValue(s.Config.Region) - - if endpoint := aws.StringValue(s.Config.Endpoint); len(endpoint) != 0 { - resolved.URL = endpoints.AddScheme(endpoint, aws.BoolValue(s.Config.DisableSSL)) - resolved.SigningRegion = region - } else { - resolved, err = s.Config.EndpointResolver.EndpointFor( - serviceName, region, - func(opt *endpoints.Options) { - opt.DisableSSL = aws.BoolValue(s.Config.DisableSSL) - opt.UseDualStack = aws.BoolValue(s.Config.UseDualStack) - - // Support the condition where the service is modeled but its - // endpoint metadata is not available. - opt.ResolveUnknownService = true - }, - ) + resolved, err := s.resolveEndpoint(service, region, s.Config) + if err != nil { + s.Handlers.Validate.PushBack(func(r *request.Request) { + if len(r.ClientInfo.Endpoint) != 0 { + // Error occurred while resolving endpoint, but the request + // being invoked has had an endpoint specified after the client + // was created. + return + } + r.Error = err + }) } return client.Config{ Config: s.Config, Handlers: s.Handlers, + PartitionID: resolved.PartitionID, Endpoint: resolved.URL, SigningRegion: resolved.SigningRegion, SigningNameDerived: resolved.SigningNameDerived, SigningName: resolved.SigningName, - }, err + } +} + +func (s *Session) resolveEndpoint(service, region string, cfg *aws.Config) (endpoints.ResolvedEndpoint, error) { + + if ep := aws.StringValue(cfg.Endpoint); len(ep) != 0 { + return endpoints.ResolvedEndpoint{ + URL: endpoints.AddScheme(ep, aws.BoolValue(cfg.DisableSSL)), + SigningRegion: region, + }, nil + } + + resolved, err := cfg.EndpointResolver.EndpointFor(service, region, + func(opt *endpoints.Options) { + opt.DisableSSL = aws.BoolValue(cfg.DisableSSL) + opt.UseDualStack = aws.BoolValue(cfg.UseDualStack) + // Support for STSRegionalEndpoint where the STSRegionalEndpoint is + // provided in envConfig or sharedConfig with envConfig getting + // precedence. + opt.STSRegionalEndpoint = cfg.STSRegionalEndpoint + + // Support for S3UsEast1RegionalEndpoint where the S3UsEast1RegionalEndpoint is + // provided in envConfig or sharedConfig with envConfig getting + // precedence. + opt.S3UsEast1RegionalEndpoint = cfg.S3UsEast1RegionalEndpoint + + // Support the condition where the service is modeled but its + // endpoint metadata is not available. + opt.ResolveUnknownService = true + }, + ) + if err != nil { + return endpoints.ResolvedEndpoint{}, err + } + + return resolved, nil } // ClientConfigNoResolveEndpoint is the same as ClientConfig with the exception @@ -641,12 +707,9 @@ func (s *Session) ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) client.Conf s = s.Copy(cfgs...) var resolved endpoints.ResolvedEndpoint - - region := aws.StringValue(s.Config.Region) - if ep := aws.StringValue(s.Config.Endpoint); len(ep) > 0 { resolved.URL = endpoints.AddScheme(ep, aws.BoolValue(s.Config.DisableSSL)) - resolved.SigningRegion = region + resolved.SigningRegion = aws.StringValue(s.Config.Region) } return client.Config{ @@ -658,3 +721,14 @@ func (s *Session) ClientConfigNoResolveEndpoint(cfgs ...*aws.Config) client.Conf SigningName: resolved.SigningName, } } + +// logDeprecatedNewSessionError function enables error handling for session +func (s *Session) logDeprecatedNewSessionError(msg string, err error, cfgs []*aws.Config) { + // Session creation failed, need to report the error and prevent + // any requests from succeeding. + s.Config.MergeIn(cfgs...) + s.Config.Logger.Log("ERROR:", msg, "Error:", err) + s.Handlers.Validate.PushBack(func(r *request.Request) { + r.Error = err + }) +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go b/vendor/github.com/aws/aws-sdk-go/aws/session/shared_config.go index d91ac93a544..a8ed8807600 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 @@ -5,6 +5,7 @@ import ( "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/credentials" + "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/internal/ini" ) @@ -40,10 +41,19 @@ const ( // Web Identity Token File webIdentityTokenFileKey = `web_identity_token_file` // optional + // Additional config fields for regional or legacy endpoints + stsRegionalEndpointSharedKey = `sts_regional_endpoints` + + // Additional config fields for regional or legacy endpoints + s3UsEast1RegionalSharedKey = `s3_us_east_1_regional_endpoint` + // DefaultSharedConfigProfile is the default profile to be used when // loading configuration from the config files if another profile name // is not provided. DefaultSharedConfigProfile = `default` + + // S3 ARN Region Usage + s3UseARNRegionKey = "s3_use_arn_region" ) // sharedConfig represents the configuration fields of the SDK config files. @@ -88,6 +98,24 @@ type sharedConfig struct { CSMHost string CSMPort string CSMClientID string + + // Specifies the Regional Endpoint flag for the SDK to resolve the endpoint for a service + // + // sts_regional_endpoints = regional + // This can take value as `LegacySTSEndpoint` or `RegionalSTSEndpoint` + STSRegionalEndpoint endpoints.STSRegionalEndpoint + + // Specifies the Regional Endpoint flag for the SDK to resolve the endpoint for a service + // + // s3_us_east_1_regional_endpoint = regional + // This can take value as `LegacyS3UsEast1Endpoint` or `RegionalS3UsEast1Endpoint` + S3UsEast1RegionalEndpoint endpoints.S3UsEast1RegionalEndpoint + + // Specifies if the S3 service should allow ARNs to direct the region + // the client's requests are sent to. + // + // s3_use_arn_region=true + S3UseARNRegion bool } type sharedConfigFile struct { @@ -244,8 +272,25 @@ func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile, e updateString(&cfg.RoleSessionName, section, roleSessionNameKey) updateString(&cfg.SourceProfileName, section, sourceProfileKey) updateString(&cfg.CredentialSource, section, credentialSourceKey) - updateString(&cfg.Region, section, regionKey) + + if v := section.String(stsRegionalEndpointSharedKey); len(v) != 0 { + sre, err := endpoints.GetSTSRegionalEndpoint(v) + if err != nil { + return fmt.Errorf("failed to load %s from shared config, %s, %v", + stsRegionalEndpointSharedKey, file.Filename, err) + } + cfg.STSRegionalEndpoint = sre + } + + if v := section.String(s3UsEast1RegionalSharedKey); len(v) != 0 { + sre, err := endpoints.GetS3UsEast1RegionalEndpoint(v) + if err != nil { + return fmt.Errorf("failed to load %s from shared config, %s, %v", + s3UsEast1RegionalSharedKey, file.Filename, err) + } + cfg.S3UsEast1RegionalEndpoint = sre + } } updateString(&cfg.CredentialProcess, section, credentialProcessKey) @@ -271,6 +316,8 @@ func (cfg *sharedConfig) setFromIniFile(profile string, file sharedConfigFile, e updateString(&cfg.CSMPort, section, csmPortKey) updateString(&cfg.CSMClientID, section, csmClientIDKey) + updateBool(&cfg.S3UseARNRegion, section, s3UseARNRegionKey) + return nil } @@ -363,6 +410,15 @@ func updateString(dst *string, section ini.Section, key string) { *dst = section.String(key) } +// updateBool will only update the dst with the value in the section key, key +// is present in the section. +func updateBool(dst *bool, section ini.Section, key string) { + if !section.Has(key) { + return + } + *dst = section.Bool(key) +} + // updateBoolPtr will only update the dst with the value in the section key, // key is present in the section. func updateBoolPtr(dst **bool, section ini.Section, key string) { diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/header_rules.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/header_rules.go index 244c86da054..07ea799fbd3 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/header_rules.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/header_rules.go @@ -1,8 +1,7 @@ package v4 import ( - "net/http" - "strings" + "github.com/aws/aws-sdk-go/internal/strings" ) // validator houses a set of rule needed for validation of a @@ -61,7 +60,7 @@ type patterns []string // been found func (p patterns) IsValid(value string) bool { for _, pattern := range p { - if strings.HasPrefix(http.CanonicalHeaderKey(value), pattern) { + if strings.HasPrefixFold(value, pattern) { return true } } diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/request_context_go1.5.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/request_context_go1.5.go new file mode 100644 index 00000000000..f35fc860b3b --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/request_context_go1.5.go @@ -0,0 +1,13 @@ +// +build !go1.7 + +package v4 + +import ( + "net/http" + + "github.com/aws/aws-sdk-go/aws" +) + +func requestContext(r *http.Request) aws.Context { + return aws.BackgroundContext() +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/request_context_go1.7.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/request_context_go1.7.go new file mode 100644 index 00000000000..fed5c859ca6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/request_context_go1.7.go @@ -0,0 +1,13 @@ +// +build go1.7 + +package v4 + +import ( + "net/http" + + "github.com/aws/aws-sdk-go/aws" +) + +func requestContext(r *http.Request) aws.Context { + return r.Context() +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/stream.go b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/stream.go new file mode 100644 index 00000000000..02cbd97e234 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/aws/signer/v4/stream.go @@ -0,0 +1,63 @@ +package v4 + +import ( + "encoding/hex" + "strings" + "time" + + "github.com/aws/aws-sdk-go/aws/credentials" +) + +type credentialValueProvider interface { + Get() (credentials.Value, error) +} + +// StreamSigner implements signing of event stream encoded payloads +type StreamSigner struct { + region string + service string + + credentials credentialValueProvider + + prevSig []byte +} + +// NewStreamSigner creates a SigV4 signer used to sign Event Stream encoded messages +func NewStreamSigner(region, service string, seedSignature []byte, credentials *credentials.Credentials) *StreamSigner { + return &StreamSigner{ + region: region, + service: service, + credentials: credentials, + prevSig: seedSignature, + } +} + +// GetSignature takes an event stream encoded headers and payload and returns a signature +func (s *StreamSigner) GetSignature(headers, payload []byte, date time.Time) ([]byte, error) { + credValue, err := s.credentials.Get() + if err != nil { + return nil, err + } + + sigKey := deriveSigningKey(s.region, s.service, credValue.SecretAccessKey, date) + + keyPath := buildSigningScope(s.region, s.service, date) + + stringToSign := buildEventStreamStringToSign(headers, payload, s.prevSig, keyPath, date) + + signature := hmacSHA256(sigKey, []byte(stringToSign)) + s.prevSig = signature + + return signature, nil +} + +func buildEventStreamStringToSign(headers, payload, prevSig []byte, scope string, date time.Time) string { + return strings.Join([]string{ + "AWS4-HMAC-SHA256-PAYLOAD", + formatTime(date), + scope, + hex.EncodeToString(prevSig), + hex.EncodeToString(hashSHA256(headers)), + hex.EncodeToString(hashSHA256(payload)), + }, "\n") +} 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 8104793aa5b..d71f7b3f4fa 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 @@ -76,9 +76,14 @@ import ( ) const ( + authorizationHeader = "Authorization" + authHeaderSignatureElem = "Signature=" + signatureQueryKey = "X-Amz-Signature" + authHeaderPrefix = "AWS4-HMAC-SHA256" timeFormat = "20060102T150405Z" shortTimeFormat = "20060102" + awsV4Request = "aws4_request" // emptyStringSHA256 is a SHA256 of an empty string emptyStringSHA256 = `e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855` @@ -87,9 +92,9 @@ const ( var ignoredHeaders = rules{ blacklist{ mapRule{ - "Authorization": struct{}{}, - "User-Agent": struct{}{}, - "X-Amzn-Trace-Id": struct{}{}, + authorizationHeader: struct{}{}, + "User-Agent": struct{}{}, + "X-Amzn-Trace-Id": struct{}{}, }, }, } @@ -229,11 +234,9 @@ type signingCtx struct { DisableURIPathEscaping bool - credValues credentials.Value - isPresign bool - formattedTime string - formattedShortTime string - unsignedPayload bool + credValues credentials.Value + isPresign bool + unsignedPayload bool bodyDigest string signedHeaders string @@ -337,7 +340,7 @@ func (v4 Signer) signWithBody(r *http.Request, body io.ReadSeeker, service, regi } var err error - ctx.credValues, err = v4.Credentials.Get() + ctx.credValues, err = v4.Credentials.GetWithContext(requestContext(r)) if err != nil { return http.Header{}, err } @@ -532,39 +535,56 @@ func (ctx *signingCtx) build(disableHeaderHoisting bool) error { ctx.buildSignature() // depends on string to sign if ctx.isPresign { - ctx.Request.URL.RawQuery += "&X-Amz-Signature=" + ctx.signature + ctx.Request.URL.RawQuery += "&" + signatureQueryKey + "=" + ctx.signature } else { parts := []string{ authHeaderPrefix + " Credential=" + ctx.credValues.AccessKeyID + "/" + ctx.credentialString, "SignedHeaders=" + ctx.signedHeaders, - "Signature=" + ctx.signature, + authHeaderSignatureElem + ctx.signature, } - ctx.Request.Header.Set("Authorization", strings.Join(parts, ", ")) + ctx.Request.Header.Set(authorizationHeader, strings.Join(parts, ", ")) } return nil } -func (ctx *signingCtx) buildTime() { - ctx.formattedTime = ctx.Time.UTC().Format(timeFormat) - ctx.formattedShortTime = ctx.Time.UTC().Format(shortTimeFormat) +// GetSignedRequestSignature attempts to extract the signature of the request. +// Returning an error if the request is unsigned, or unable to extract the +// signature. +func GetSignedRequestSignature(r *http.Request) ([]byte, error) { + + if auth := r.Header.Get(authorizationHeader); len(auth) != 0 { + ps := strings.Split(auth, ", ") + for _, p := range ps { + if idx := strings.Index(p, authHeaderSignatureElem); idx >= 0 { + sig := p[len(authHeaderSignatureElem):] + if len(sig) == 0 { + return nil, fmt.Errorf("invalid request signature authorization header") + } + return hex.DecodeString(sig) + } + } + } + + if sig := r.URL.Query().Get("X-Amz-Signature"); len(sig) != 0 { + return hex.DecodeString(sig) + } + + return nil, fmt.Errorf("request not signed") +} +func (ctx *signingCtx) buildTime() { if ctx.isPresign { duration := int64(ctx.ExpireTime / time.Second) - ctx.Query.Set("X-Amz-Date", ctx.formattedTime) + ctx.Query.Set("X-Amz-Date", formatTime(ctx.Time)) ctx.Query.Set("X-Amz-Expires", strconv.FormatInt(duration, 10)) } else { - ctx.Request.Header.Set("X-Amz-Date", ctx.formattedTime) + ctx.Request.Header.Set("X-Amz-Date", formatTime(ctx.Time)) } } func (ctx *signingCtx) buildCredentialString() { - ctx.credentialString = strings.Join([]string{ - ctx.formattedShortTime, - ctx.Region, - ctx.ServiceName, - "aws4_request", - }, "/") + ctx.credentialString = buildSigningScope(ctx.Region, ctx.ServiceName, ctx.Time) if ctx.isPresign { ctx.Query.Set("X-Amz-Credential", ctx.credValues.AccessKeyID+"/"+ctx.credentialString) @@ -588,8 +608,7 @@ func (ctx *signingCtx) buildCanonicalHeaders(r rule, header http.Header) { var headers []string headers = append(headers, "host") for k, v := range header { - canonicalKey := http.CanonicalHeaderKey(k) - if !r.IsValid(canonicalKey) { + if !r.IsValid(k) { continue // ignored header } if ctx.SignedHeaderVals == nil { @@ -653,19 +672,15 @@ func (ctx *signingCtx) buildCanonicalString() { func (ctx *signingCtx) buildStringToSign() { ctx.stringToSign = strings.Join([]string{ authHeaderPrefix, - ctx.formattedTime, + formatTime(ctx.Time), ctx.credentialString, - hex.EncodeToString(makeSha256([]byte(ctx.canonicalString))), + hex.EncodeToString(hashSHA256([]byte(ctx.canonicalString))), }, "\n") } func (ctx *signingCtx) buildSignature() { - secret := ctx.credValues.SecretAccessKey - date := makeHmac([]byte("AWS4"+secret), []byte(ctx.formattedShortTime)) - region := makeHmac(date, []byte(ctx.Region)) - service := makeHmac(region, []byte(ctx.ServiceName)) - credentials := makeHmac(service, []byte("aws4_request")) - signature := makeHmac(credentials, []byte(ctx.stringToSign)) + creds := deriveSigningKey(ctx.Region, ctx.ServiceName, ctx.credValues.SecretAccessKey, ctx.Time) + signature := hmacSHA256(creds, []byte(ctx.stringToSign)) ctx.signature = hex.EncodeToString(signature) } @@ -726,13 +741,13 @@ func (ctx *signingCtx) removePresign() { ctx.Query.Del("X-Amz-SignedHeaders") } -func makeHmac(key []byte, data []byte) []byte { +func hmacSHA256(key []byte, data []byte) []byte { hash := hmac.New(sha256.New, key) hash.Write(data) return hash.Sum(nil) } -func makeSha256(data []byte) []byte { +func hashSHA256(data []byte) []byte { hash := sha256.New() hash.Write(data) return hash.Sum(nil) @@ -804,3 +819,28 @@ func stripExcessSpaces(vals []string) { vals[i] = string(buf[:m]) } } + +func buildSigningScope(region, service string, dt time.Time) string { + return strings.Join([]string{ + formatShortTime(dt), + region, + service, + awsV4Request, + }, "/") +} + +func deriveSigningKey(region, service, secretKey string, dt time.Time) []byte { + kDate := hmacSHA256([]byte("AWS4"+secretKey), []byte(formatShortTime(dt))) + kRegion := hmacSHA256(kDate, []byte(region)) + kService := hmacSHA256(kRegion, []byte(service)) + signingKey := hmacSHA256(kService, []byte(awsV4Request)) + return signingKey +} + +func formatShortTime(dt time.Time) string { + return dt.UTC().Format(shortTimeFormat) +} + +func formatTime(dt time.Time) string { + return dt.UTC().Format(timeFormat) +} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/types.go b/vendor/github.com/aws/aws-sdk-go/aws/types.go index 455091540fd..d542ef01bc8 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/types.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/types.go @@ -2,6 +2,7 @@ package aws import ( "io" + "strings" "sync" "github.com/aws/aws-sdk-go/internal/sdkio" @@ -205,3 +206,36 @@ func (b *WriteAtBuffer) Bytes() []byte { defer b.m.Unlock() return b.buf } + +// MultiCloser is a utility to close multiple io.Closers within a single +// statement. +type MultiCloser []io.Closer + +// Close closes all of the io.Closers making up the MultiClosers. Any +// errors that occur while closing will be returned in the order they +// occur. +func (m MultiCloser) Close() error { + var errs errors + for _, c := range m { + err := c.Close() + if err != nil { + errs = append(errs, err) + } + } + if len(errs) != 0 { + return errs + } + + return nil +} + +type errors []error + +func (es errors) Error() string { + var parts []string + for _, e := range es { + parts = append(parts, e.Error()) + } + + return strings.Join(parts, "\n") +} 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 31475957363..aaa87302aac 100644 --- a/vendor/github.com/aws/aws-sdk-go/aws/version.go +++ b/vendor/github.com/aws/aws-sdk-go/aws/version.go @@ -5,4 +5,4 @@ package aws const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK -const SDKVersion = "1.25.4" +const SDKVersion = "1.29.16" diff --git a/vendor/github.com/aws/aws-sdk-go/internal/context/background_go1.5.go b/vendor/github.com/aws/aws-sdk-go/internal/context/background_go1.5.go new file mode 100644 index 00000000000..876dcb3fde2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/context/background_go1.5.go @@ -0,0 +1,40 @@ +// +build !go1.7 + +package context + +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" +} + +// BackgroundCtx is the common base context. +var BackgroundCtx = new(emptyCtx) diff --git a/vendor/github.com/aws/aws-sdk-go/internal/strings/strings.go b/vendor/github.com/aws/aws-sdk-go/internal/strings/strings.go new file mode 100644 index 00000000000..d008ae27cb3 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/strings/strings.go @@ -0,0 +1,11 @@ +package strings + +import ( + "strings" +) + +// HasPrefixFold tests whether the string s begins with prefix, interpreted as UTF-8 strings, +// under Unicode case-folding. +func HasPrefixFold(s, prefix string) bool { + return len(s) >= len(prefix) && strings.EqualFold(s[0:len(prefix)], prefix) +} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/sync/singleflight/LICENSE b/vendor/github.com/aws/aws-sdk-go/internal/sync/singleflight/LICENSE new file mode 100644 index 00000000000..6a66aea5eaf --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sync/singleflight/LICENSE @@ -0,0 +1,27 @@ +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/aws/aws-sdk-go/internal/sync/singleflight/singleflight.go b/vendor/github.com/aws/aws-sdk-go/internal/sync/singleflight/singleflight.go new file mode 100644 index 00000000000..14ad0c58911 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/internal/sync/singleflight/singleflight.go @@ -0,0 +1,120 @@ +// 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 singleflight provides a duplicate function call suppression +// mechanism. +package singleflight + +import "sync" + +// call is an in-flight or completed singleflight.Do call +type call struct { + wg sync.WaitGroup + + // These fields are written once before the WaitGroup is done + // and are only read after the WaitGroup is done. + val interface{} + err error + + // forgotten indicates whether Forget was called with this call's key + // while the call was still in flight. + forgotten bool + + // These fields are read and written with the singleflight + // mutex held before the WaitGroup is done, and are read but + // not written after the WaitGroup is done. + dups int + chans []chan<- Result +} + +// Group represents a class of work and forms a namespace in +// which units of work can be executed with duplicate suppression. +type Group struct { + mu sync.Mutex // protects m + m map[string]*call // lazily initialized +} + +// Result holds the results of Do, so they can be passed +// on a channel. +type Result struct { + Val interface{} + Err error + Shared bool +} + +// 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 *Group) Do(key string, fn func() (interface{}, error)) (v interface{}, err error, shared bool) { + g.mu.Lock() + if g.m == nil { + g.m = make(map[string]*call) + } + if c, ok := g.m[key]; ok { + c.dups++ + g.mu.Unlock() + c.wg.Wait() + return c.val, c.err, true + } + c := new(call) + c.wg.Add(1) + g.m[key] = c + g.mu.Unlock() + + g.doCall(c, key, fn) + return c.val, c.err, c.dups > 0 +} + +// DoChan is like Do but returns a channel that will receive the +// results when they are ready. +func (g *Group) DoChan(key string, fn func() (interface{}, error)) <-chan Result { + ch := make(chan Result, 1) + g.mu.Lock() + if g.m == nil { + g.m = make(map[string]*call) + } + if c, ok := g.m[key]; ok { + c.dups++ + c.chans = append(c.chans, ch) + g.mu.Unlock() + return ch + } + c := &call{chans: []chan<- Result{ch}} + c.wg.Add(1) + g.m[key] = c + g.mu.Unlock() + + go g.doCall(c, key, fn) + + return ch +} + +// doCall handles the single call for a key. +func (g *Group) doCall(c *call, key string, fn func() (interface{}, error)) { + c.val, c.err = fn() + c.wg.Done() + + g.mu.Lock() + if !c.forgotten { + delete(g.m, key) + } + for _, ch := range c.chans { + ch <- Result{c.val, c.err, c.dups > 0} + } + g.mu.Unlock() +} + +// Forget tells the singleflight to forget about a key. Future calls +// to Do for this key will call the function rather than waiting for +// an earlier call to complete. +func (g *Group) Forget(key string) { + g.mu.Lock() + if c, ok := g.m[key]; ok { + c.forgotten = true + } + delete(g.m, key) + g.mu.Unlock() +} 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 index 50c5ed76005..5d500be27f3 100644 --- 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 @@ -1,7 +1,7 @@ // 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 +//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/input/ec2.json build_test.go import ( "net/url" 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 index 105d732f9d3..c42b04a8d55 100644 --- 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 @@ -1,6 +1,6 @@ package ec2query -//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/ec2.json unmarshal_test.go +//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/output/ec2.json unmarshal_test.go import ( "encoding/xml" diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go index ecc7bf82fa2..151054971a5 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go @@ -101,7 +101,7 @@ func (hs *decodedHeaders) UnmarshalJSON(b []byte) error { } headers.Set(h.Name, value) } - (*hs) = decodedHeaders(headers) + *hs = decodedHeaders(headers) return nil } diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go index 4b972b2d666..47433939189 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go @@ -21,10 +21,24 @@ type Decoder struct { // NewDecoder initializes and returns a Decoder for decoding event // stream messages from the reader provided. -func NewDecoder(r io.Reader) *Decoder { - return &Decoder{ +func NewDecoder(r io.Reader, opts ...func(*Decoder)) *Decoder { + d := &Decoder{ r: r, } + + for _, opt := range opts { + opt(d) + } + + return d +} + +// DecodeWithLogger adds a logger to be used by the decoder when decoding +// stream events. +func DecodeWithLogger(logger aws.Logger) func(*Decoder) { + return func(d *Decoder) { + d.logger = logger + } } // Decode attempts to decode a single message from the event stream reader. @@ -40,6 +54,15 @@ func (d *Decoder) Decode(payloadBuf []byte) (m Message, err error) { }() } + m, err = Decode(reader, payloadBuf) + + return m, err +} + +// Decode attempts to decode a single message from the event stream reader. +// Will return the event stream message, or error if Decode fails to read +// the message from the reader. +func Decode(reader io.Reader, payloadBuf []byte) (m Message, err error) { crc := crc32.New(crc32IEEETable) hashReader := io.TeeReader(reader, crc) @@ -72,12 +95,6 @@ func (d *Decoder) Decode(payloadBuf []byte) (m Message, err error) { return m, nil } -// UseLogger specifies the Logger that that the decoder should use to log the -// message decode to. -func (d *Decoder) UseLogger(logger aws.Logger) { - d.logger = logger -} - func logMessageDecode(logger aws.Logger, msgBuf *bytes.Buffer, msg Message, decodeErr error) { w := bytes.NewBuffer(nil) defer func() { logger.Log(w.String()) }() diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode.go index 150a60981d8..ffade3bc0c8 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode.go @@ -3,61 +3,107 @@ package eventstream import ( "bytes" "encoding/binary" + "encoding/hex" + "encoding/json" + "fmt" "hash" "hash/crc32" "io" + + "github.com/aws/aws-sdk-go/aws" ) // Encoder provides EventStream message encoding. type Encoder struct { - w io.Writer + w io.Writer + logger aws.Logger headersBuf *bytes.Buffer } // NewEncoder initializes and returns an Encoder to encode Event Stream // messages to an io.Writer. -func NewEncoder(w io.Writer) *Encoder { - return &Encoder{ +func NewEncoder(w io.Writer, opts ...func(*Encoder)) *Encoder { + e := &Encoder{ w: w, headersBuf: bytes.NewBuffer(nil), } + + for _, opt := range opts { + opt(e) + } + + return e +} + +// EncodeWithLogger adds a logger to be used by the encode when decoding +// stream events. +func EncodeWithLogger(logger aws.Logger) func(*Encoder) { + return func(d *Encoder) { + d.logger = logger + } } // Encode encodes a single EventStream message to the io.Writer the Encoder // was created with. An error is returned if writing the message fails. -func (e *Encoder) Encode(msg Message) error { +func (e *Encoder) Encode(msg Message) (err error) { e.headersBuf.Reset() - err := encodeHeaders(e.headersBuf, msg.Headers) - if err != nil { + writer := e.w + if e.logger != nil { + encodeMsgBuf := bytes.NewBuffer(nil) + writer = io.MultiWriter(writer, encodeMsgBuf) + defer func() { + logMessageEncode(e.logger, encodeMsgBuf, msg, err) + }() + } + + if err = EncodeHeaders(e.headersBuf, msg.Headers); err != nil { return err } crc := crc32.New(crc32IEEETable) - hashWriter := io.MultiWriter(e.w, crc) + hashWriter := io.MultiWriter(writer, crc) headersLen := uint32(e.headersBuf.Len()) payloadLen := uint32(len(msg.Payload)) - if err := encodePrelude(hashWriter, crc, headersLen, payloadLen); err != nil { + if err = encodePrelude(hashWriter, crc, headersLen, payloadLen); err != nil { return err } if headersLen > 0 { - if _, err := io.Copy(hashWriter, e.headersBuf); err != nil { + if _, err = io.Copy(hashWriter, e.headersBuf); err != nil { return err } } if payloadLen > 0 { - if _, err := hashWriter.Write(msg.Payload); err != nil { + if _, err = hashWriter.Write(msg.Payload); err != nil { return err } } msgCRC := crc.Sum32() - return binary.Write(e.w, binary.BigEndian, msgCRC) + return binary.Write(writer, binary.BigEndian, msgCRC) +} + +func logMessageEncode(logger aws.Logger, msgBuf *bytes.Buffer, msg Message, encodeErr error) { + w := bytes.NewBuffer(nil) + defer func() { logger.Log(w.String()) }() + + fmt.Fprintf(w, "Message to encode:\n") + encoder := json.NewEncoder(w) + if err := encoder.Encode(msg); err != nil { + fmt.Fprintf(w, "Failed to get encoded message, %v\n", err) + } + + if encodeErr != nil { + fmt.Fprintf(w, "Encode error: %v\n", encodeErr) + return + } + + fmt.Fprintf(w, "Raw message:\n%s\n", hex.Dump(msgBuf.Bytes())) } func encodePrelude(w io.Writer, crc hash.Hash32, headersLen, payloadLen uint32) error { @@ -86,7 +132,9 @@ func encodePrelude(w io.Writer, crc hash.Hash32, headersLen, payloadLen uint32) return nil } -func encodeHeaders(w io.Writer, headers Headers) error { +// EncodeHeaders writes the header values to the writer encoded in the event +// stream format. Returns an error if a header fails to encode. +func EncodeHeaders(w io.Writer, headers Headers) error { for _, h := range headers { hn := headerName{ Len: uint8(len(h.Name)), diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/api.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/api.go deleted file mode 100644 index 97937c8e598..00000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/api.go +++ /dev/null @@ -1,196 +0,0 @@ -package eventstreamapi - -import ( - "fmt" - "io" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/eventstream" -) - -// Unmarshaler provides the interface for unmarshaling a EventStream -// message into a SDK type. -type Unmarshaler interface { - UnmarshalEvent(protocol.PayloadUnmarshaler, eventstream.Message) error -} - -// EventStream headers with specific meaning to async API functionality. -const ( - MessageTypeHeader = `:message-type` // Identifies type of message. - EventMessageType = `event` - ErrorMessageType = `error` - ExceptionMessageType = `exception` - - // Message Events - EventTypeHeader = `:event-type` // Identifies message event type e.g. "Stats". - - // Message Error - ErrorCodeHeader = `:error-code` - ErrorMessageHeader = `:error-message` - - // Message Exception - ExceptionTypeHeader = `:exception-type` -) - -// EventReader provides reading from the EventStream of an reader. -type EventReader struct { - reader io.ReadCloser - decoder *eventstream.Decoder - - unmarshalerForEventType func(string) (Unmarshaler, error) - payloadUnmarshaler protocol.PayloadUnmarshaler - - payloadBuf []byte -} - -// NewEventReader returns a EventReader built from the reader and unmarshaler -// provided. Use ReadStream method to start reading from the EventStream. -func NewEventReader( - reader io.ReadCloser, - payloadUnmarshaler protocol.PayloadUnmarshaler, - unmarshalerForEventType func(string) (Unmarshaler, error), -) *EventReader { - return &EventReader{ - reader: reader, - decoder: eventstream.NewDecoder(reader), - payloadUnmarshaler: payloadUnmarshaler, - unmarshalerForEventType: unmarshalerForEventType, - payloadBuf: make([]byte, 10*1024), - } -} - -// UseLogger instructs the EventReader to use the logger and log level -// specified. -func (r *EventReader) UseLogger(logger aws.Logger, logLevel aws.LogLevelType) { - if logger != nil && logLevel.Matches(aws.LogDebugWithEventStreamBody) { - r.decoder.UseLogger(logger) - } -} - -// ReadEvent attempts to read a message from the EventStream and return the -// unmarshaled event value that the message is for. -// -// For EventStream API errors check if the returned error satisfies the -// awserr.Error interface to get the error's Code and Message components. -// -// EventUnmarshalers called with EventStream messages must take copies of the -// message's Payload. The payload will is reused between events read. -func (r *EventReader) ReadEvent() (event interface{}, err error) { - msg, err := r.decoder.Decode(r.payloadBuf) - if err != nil { - return nil, err - } - defer func() { - // Reclaim payload buffer for next message read. - r.payloadBuf = msg.Payload[0:0] - }() - - typ, err := GetHeaderString(msg, MessageTypeHeader) - if err != nil { - return nil, err - } - - switch typ { - case EventMessageType: - return r.unmarshalEventMessage(msg) - case ExceptionMessageType: - err = r.unmarshalEventException(msg) - return nil, err - case ErrorMessageType: - return nil, r.unmarshalErrorMessage(msg) - default: - return nil, fmt.Errorf("unknown eventstream message type, %v", typ) - } -} - -func (r *EventReader) unmarshalEventMessage( - msg eventstream.Message, -) (event interface{}, err error) { - eventType, err := GetHeaderString(msg, EventTypeHeader) - if err != nil { - return nil, err - } - - ev, err := r.unmarshalerForEventType(eventType) - if err != nil { - return nil, err - } - - err = ev.UnmarshalEvent(r.payloadUnmarshaler, msg) - if err != nil { - return nil, err - } - - return ev, nil -} - -func (r *EventReader) unmarshalEventException( - msg eventstream.Message, -) (err error) { - eventType, err := GetHeaderString(msg, ExceptionTypeHeader) - if err != nil { - return err - } - - ev, err := r.unmarshalerForEventType(eventType) - if err != nil { - return err - } - - err = ev.UnmarshalEvent(r.payloadUnmarshaler, msg) - if err != nil { - return err - } - - var ok bool - err, ok = ev.(error) - if !ok { - err = messageError{ - code: "SerializationError", - msg: fmt.Sprintf( - "event stream exception %s mapped to non-error %T, %v", - eventType, ev, ev, - ), - } - } - - return err -} - -func (r *EventReader) unmarshalErrorMessage(msg eventstream.Message) (err error) { - var msgErr messageError - - msgErr.code, err = GetHeaderString(msg, ErrorCodeHeader) - if err != nil { - return err - } - - msgErr.msg, err = GetHeaderString(msg, ErrorMessageHeader) - if err != nil { - return err - } - - return msgErr -} - -// Close closes the EventReader's EventStream reader. -func (r *EventReader) Close() error { - return r.reader.Close() -} - -// GetHeaderString returns the value of the header as a string. If the header -// is not set or the value is not a string an error will be returned. -func GetHeaderString(msg eventstream.Message, headerName string) (string, error) { - headerVal := msg.Headers.Get(headerName) - if headerVal == nil { - return "", fmt.Errorf("error header %s not present", headerName) - } - - v, ok := headerVal.Get().(string) - if !ok { - return "", fmt.Errorf("error header value is not a string, %T", headerVal) - } - - return v, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/error.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/error.go index 5ea5a988b63..34c2e89d539 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/error.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/error.go @@ -1,6 +1,9 @@ package eventstreamapi -import "fmt" +import ( + "fmt" + "sync" +) type messageError struct { code string @@ -22,3 +25,53 @@ func (e messageError) Error() string { func (e messageError) OrigErr() error { return nil } + +// OnceError wraps the behavior of recording an error +// once and signal on a channel when this has occurred. +// Signaling is done by closing of the channel. +// +// Type is safe for concurrent usage. +type OnceError struct { + mu sync.RWMutex + err error + ch chan struct{} +} + +// NewOnceError return a new OnceError +func NewOnceError() *OnceError { + return &OnceError{ + ch: make(chan struct{}, 1), + } +} + +// Err acquires a read-lock and returns an +// error if one has been set. +func (e *OnceError) Err() error { + e.mu.RLock() + err := e.err + e.mu.RUnlock() + + return err +} + +// SetError acquires a write-lock and will set +// the underlying error value if one has not been set. +func (e *OnceError) SetError(err error) { + if err == nil { + return + } + + e.mu.Lock() + if e.err == nil { + e.err = err + close(e.ch) + } + e.mu.Unlock() +} + +// ErrorSet returns a channel that will be used to signal +// that an error has been set. This channel will be closed +// when the error value has been set for OnceError. +func (e *OnceError) ErrorSet() <-chan struct{} { + return e.ch +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/reader.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/reader.go new file mode 100644 index 00000000000..bb8ea5da165 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/reader.go @@ -0,0 +1,160 @@ +package eventstreamapi + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/eventstream" +) + +// Unmarshaler provides the interface for unmarshaling a EventStream +// message into a SDK type. +type Unmarshaler interface { + UnmarshalEvent(protocol.PayloadUnmarshaler, eventstream.Message) error +} + +// EventReader provides reading from the EventStream of an reader. +type EventReader struct { + decoder *eventstream.Decoder + + unmarshalerForEventType func(string) (Unmarshaler, error) + payloadUnmarshaler protocol.PayloadUnmarshaler + + payloadBuf []byte +} + +// NewEventReader returns a EventReader built from the reader and unmarshaler +// provided. Use ReadStream method to start reading from the EventStream. +func NewEventReader( + decoder *eventstream.Decoder, + payloadUnmarshaler protocol.PayloadUnmarshaler, + unmarshalerForEventType func(string) (Unmarshaler, error), +) *EventReader { + return &EventReader{ + decoder: decoder, + payloadUnmarshaler: payloadUnmarshaler, + unmarshalerForEventType: unmarshalerForEventType, + payloadBuf: make([]byte, 10*1024), + } +} + +// ReadEvent attempts to read a message from the EventStream and return the +// unmarshaled event value that the message is for. +// +// For EventStream API errors check if the returned error satisfies the +// awserr.Error interface to get the error's Code and Message components. +// +// EventUnmarshalers called with EventStream messages must take copies of the +// message's Payload. The payload will is reused between events read. +func (r *EventReader) ReadEvent() (event interface{}, err error) { + msg, err := r.decoder.Decode(r.payloadBuf) + if err != nil { + return nil, err + } + defer func() { + // Reclaim payload buffer for next message read. + r.payloadBuf = msg.Payload[0:0] + }() + + typ, err := GetHeaderString(msg, MessageTypeHeader) + if err != nil { + return nil, err + } + + switch typ { + case EventMessageType: + return r.unmarshalEventMessage(msg) + case ExceptionMessageType: + return nil, r.unmarshalEventException(msg) + case ErrorMessageType: + return nil, r.unmarshalErrorMessage(msg) + default: + return nil, fmt.Errorf("unknown eventstream message type, %v", typ) + } +} + +func (r *EventReader) unmarshalEventMessage( + msg eventstream.Message, +) (event interface{}, err error) { + eventType, err := GetHeaderString(msg, EventTypeHeader) + if err != nil { + return nil, err + } + + ev, err := r.unmarshalerForEventType(eventType) + if err != nil { + return nil, err + } + + err = ev.UnmarshalEvent(r.payloadUnmarshaler, msg) + if err != nil { + return nil, err + } + + return ev, nil +} + +func (r *EventReader) unmarshalEventException( + msg eventstream.Message, +) (err error) { + eventType, err := GetHeaderString(msg, ExceptionTypeHeader) + if err != nil { + return err + } + + ev, err := r.unmarshalerForEventType(eventType) + if err != nil { + return err + } + + err = ev.UnmarshalEvent(r.payloadUnmarshaler, msg) + if err != nil { + return err + } + + var ok bool + err, ok = ev.(error) + if !ok { + err = messageError{ + code: "SerializationError", + msg: fmt.Sprintf( + "event stream exception %s mapped to non-error %T, %v", + eventType, ev, ev, + ), + } + } + + return err +} + +func (r *EventReader) unmarshalErrorMessage(msg eventstream.Message) (err error) { + var msgErr messageError + + msgErr.code, err = GetHeaderString(msg, ErrorCodeHeader) + if err != nil { + return err + } + + msgErr.msg, err = GetHeaderString(msg, ErrorMessageHeader) + if err != nil { + return err + } + + return msgErr +} + +// GetHeaderString returns the value of the header as a string. If the header +// is not set or the value is not a string an error will be returned. +func GetHeaderString(msg eventstream.Message, headerName string) (string, error) { + headerVal := msg.Headers.Get(headerName) + if headerVal == nil { + return "", fmt.Errorf("error header %s not present", headerName) + } + + v, ok := headerVal.Get().(string) + if !ok { + return "", fmt.Errorf("error header value is not a string, %T", headerVal) + } + + return v, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/shared.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/shared.go new file mode 100644 index 00000000000..e46b8acc200 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/shared.go @@ -0,0 +1,23 @@ +package eventstreamapi + +// EventStream headers with specific meaning to async API functionality. +const ( + ChunkSignatureHeader = `:chunk-signature` // chunk signature for message + DateHeader = `:date` // Date header for signature + + // Message header and values + MessageTypeHeader = `:message-type` // Identifies type of message. + EventMessageType = `event` + ErrorMessageType = `error` + ExceptionMessageType = `exception` + + // Message Events + EventTypeHeader = `:event-type` // Identifies message event type e.g. "Stats". + + // Message Error + ErrorCodeHeader = `:error-code` + ErrorMessageHeader = `:error-message` + + // Message Exception + ExceptionTypeHeader = `:exception-type` +) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/signer.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/signer.go new file mode 100644 index 00000000000..3a7ba5cd57a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/signer.go @@ -0,0 +1,123 @@ +package eventstreamapi + +import ( + "bytes" + "strings" + "time" + + "github.com/aws/aws-sdk-go/private/protocol/eventstream" +) + +var timeNow = time.Now + +// StreamSigner defines an interface for the implementation of signing of event stream payloads +type StreamSigner interface { + GetSignature(headers, payload []byte, date time.Time) ([]byte, error) +} + +// SignEncoder envelopes event stream messages +// into an event stream message payload with included +// signature headers using the provided signer and encoder. +type SignEncoder struct { + signer StreamSigner + encoder Encoder + bufEncoder *BufferEncoder + + closeErr error + closed bool +} + +// NewSignEncoder returns a new SignEncoder using the provided stream signer and +// event stream encoder. +func NewSignEncoder(signer StreamSigner, encoder Encoder) *SignEncoder { + // TODO: Need to pass down logging + + return &SignEncoder{ + signer: signer, + encoder: encoder, + bufEncoder: NewBufferEncoder(), + } +} + +// Close encodes a final event stream signing envelope with an empty event stream +// payload. This final end-frame is used to mark the conclusion of the stream. +func (s *SignEncoder) Close() error { + if s.closed { + return s.closeErr + } + + if err := s.encode([]byte{}); err != nil { + if strings.Contains(err.Error(), "on closed pipe") { + return nil + } + + s.closeErr = err + s.closed = true + return s.closeErr + } + + return nil +} + +// Encode takes the provided message and add envelopes the message +// with the required signature. +func (s *SignEncoder) Encode(msg eventstream.Message) error { + payload, err := s.bufEncoder.Encode(msg) + if err != nil { + return err + } + + return s.encode(payload) +} + +func (s SignEncoder) encode(payload []byte) error { + date := timeNow() + + var msg eventstream.Message + msg.Headers.Set(DateHeader, eventstream.TimestampValue(date)) + msg.Payload = payload + + var headers bytes.Buffer + if err := eventstream.EncodeHeaders(&headers, msg.Headers); err != nil { + return err + } + + sig, err := s.signer.GetSignature(headers.Bytes(), msg.Payload, date) + if err != nil { + return err + } + + msg.Headers.Set(ChunkSignatureHeader, eventstream.BytesValue(sig)) + + return s.encoder.Encode(msg) +} + +// BufferEncoder is a utility that provides a buffered +// event stream encoder +type BufferEncoder struct { + encoder Encoder + buffer *bytes.Buffer +} + +// NewBufferEncoder returns a new BufferEncoder initialized +// with a 1024 byte buffer. +func NewBufferEncoder() *BufferEncoder { + buf := bytes.NewBuffer(make([]byte, 1024)) + return &BufferEncoder{ + encoder: eventstream.NewEncoder(buf), + buffer: buf, + } +} + +// Encode returns the encoded message as a byte slice. +// The returned byte slice will be modified on the next encode call +// and should not be held onto. +func (e *BufferEncoder) Encode(msg eventstream.Message) ([]byte, error) { + e.buffer.Reset() + + if err := e.encoder.Encode(msg); err != nil { + return nil, err + } + + return e.buffer.Bytes(), nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/stream_writer.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/stream_writer.go new file mode 100644 index 00000000000..433bb1630a7 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/stream_writer.go @@ -0,0 +1,129 @@ +package eventstreamapi + +import ( + "fmt" + "io" + "sync" + + "github.com/aws/aws-sdk-go/aws" +) + +// StreamWriter provides concurrent safe writing to an event stream. +type StreamWriter struct { + eventWriter *EventWriter + stream chan eventWriteAsyncReport + + done chan struct{} + closeOnce sync.Once + err *OnceError + + streamCloser io.Closer +} + +// NewStreamWriter returns a StreamWriter for the event writer, and stream +// closer provided. +func NewStreamWriter(eventWriter *EventWriter, streamCloser io.Closer) *StreamWriter { + w := &StreamWriter{ + eventWriter: eventWriter, + streamCloser: streamCloser, + stream: make(chan eventWriteAsyncReport), + done: make(chan struct{}), + err: NewOnceError(), + } + go w.writeStream() + + return w +} + +// Close terminates the writers ability to write new events to the stream. Any +// future call to Send will fail with an error. +func (w *StreamWriter) Close() error { + w.closeOnce.Do(w.safeClose) + return w.Err() +} + +func (w *StreamWriter) safeClose() { + close(w.done) +} + +// ErrorSet returns a channel which will be closed +// if an error occurs. +func (w *StreamWriter) ErrorSet() <-chan struct{} { + return w.err.ErrorSet() +} + +// Err returns any error that occurred while attempting to write an event to the +// stream. +func (w *StreamWriter) Err() error { + return w.err.Err() +} + +// Send writes a single event to the stream returning an error if the write +// failed. +// +// Send may be called concurrently. Events will be written to the stream +// safely. +func (w *StreamWriter) Send(ctx aws.Context, event Marshaler) error { + if err := w.Err(); err != nil { + return err + } + + resultCh := make(chan error) + wrapped := eventWriteAsyncReport{ + Event: event, + Result: resultCh, + } + + select { + case w.stream <- wrapped: + case <-ctx.Done(): + return ctx.Err() + case <-w.done: + return fmt.Errorf("stream closed, unable to send event") + } + + select { + case err := <-resultCh: + return err + case <-ctx.Done(): + return ctx.Err() + case <-w.done: + return fmt.Errorf("stream closed, unable to send event") + } +} + +func (w *StreamWriter) writeStream() { + defer w.Close() + + for { + select { + case wrapper := <-w.stream: + err := w.eventWriter.WriteEvent(wrapper.Event) + wrapper.ReportResult(w.done, err) + if err != nil { + w.err.SetError(err) + return + } + + case <-w.done: + if err := w.streamCloser.Close(); err != nil { + w.err.SetError(err) + } + return + } + } +} + +type eventWriteAsyncReport struct { + Event Marshaler + Result chan<- error +} + +func (e eventWriteAsyncReport) ReportResult(cancel <-chan struct{}, err error) bool { + select { + case e.Result <- err: + return true + case <-cancel: + return false + } +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/writer.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/writer.go new file mode 100644 index 00000000000..10a3823dfa6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/writer.go @@ -0,0 +1,109 @@ +package eventstreamapi + +import ( + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/eventstream" +) + +// Marshaler provides a marshaling interface for event types to event stream +// messages. +type Marshaler interface { + MarshalEvent(protocol.PayloadMarshaler) (eventstream.Message, error) +} + +// Encoder is an stream encoder that will encode an event stream message for +// the transport. +type Encoder interface { + Encode(eventstream.Message) error +} + +// EventWriter provides a wrapper around the underlying event stream encoder +// for an io.WriteCloser. +type EventWriter struct { + encoder Encoder + payloadMarshaler protocol.PayloadMarshaler + eventTypeFor func(Marshaler) (string, error) +} + +// NewEventWriter returns a new event stream writer, that will write to the +// writer provided. Use the WriteEvent method to write an event to the stream. +func NewEventWriter(encoder Encoder, pm protocol.PayloadMarshaler, eventTypeFor func(Marshaler) (string, error), +) *EventWriter { + return &EventWriter{ + encoder: encoder, + payloadMarshaler: pm, + eventTypeFor: eventTypeFor, + } +} + +// WriteEvent writes an event to the stream. Returns an error if the event +// fails to marshal into a message, or writing to the underlying writer fails. +func (w *EventWriter) WriteEvent(event Marshaler) error { + msg, err := w.marshal(event) + if err != nil { + return err + } + + return w.encoder.Encode(msg) +} + +func (w *EventWriter) marshal(event Marshaler) (eventstream.Message, error) { + eventType, err := w.eventTypeFor(event) + if err != nil { + return eventstream.Message{}, err + } + + msg, err := event.MarshalEvent(w.payloadMarshaler) + if err != nil { + return eventstream.Message{}, err + } + + msg.Headers.Set(EventTypeHeader, eventstream.StringValue(eventType)) + return msg, nil +} + +//type EventEncoder struct { +// encoder Encoder +// ppayloadMarshaler protocol.PayloadMarshaler +// eventTypeFor func(Marshaler) (string, error) +//} +// +//func (e EventEncoder) Encode(event Marshaler) error { +// msg, err := e.marshal(event) +// if err != nil { +// return err +// } +// +// return w.encoder.Encode(msg) +//} +// +//func (e EventEncoder) marshal(event Marshaler) (eventstream.Message, error) { +// eventType, err := w.eventTypeFor(event) +// if err != nil { +// return eventstream.Message{}, err +// } +// +// msg, err := event.MarshalEvent(w.payloadMarshaler) +// if err != nil { +// return eventstream.Message{}, err +// } +// +// msg.Headers.Set(EventTypeHeader, eventstream.StringValue(eventType)) +// return msg, nil +//} +// +//func (w *EventWriter) marshal(event Marshaler) (eventstream.Message, error) { +// eventType, err := w.eventTypeFor(event) +// if err != nil { +// return eventstream.Message{}, err +// } +// +// msg, err := event.MarshalEvent(w.payloadMarshaler) +// if err != nil { +// return eventstream.Message{}, err +// } +// +// msg.Headers.Set(EventTypeHeader, eventstream.StringValue(eventType)) +// return msg, nil +//} +// diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value.go index e3fc0766a9e..9f509d8f6dc 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value.go @@ -461,6 +461,11 @@ func (v *TimestampValue) decode(r io.Reader) error { return nil } +// MarshalJSON implements the json.Marshaler interface +func (v TimestampValue) MarshalJSON() ([]byte, error) { + return []byte(v.String()), nil +} + func timeFromEpochMilli(t int64) time.Time { secs := t / 1e3 msec := t % 1e3 diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go index 2dc012a66e2..25c9783cde6 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go @@ -27,7 +27,7 @@ func (m *Message) rawMessage() (rawMessage, error) { if len(m.Headers) > 0 { var headers bytes.Buffer - if err := encodeHeaders(&headers, m.Headers); err != nil { + if err := EncodeHeaders(&headers, m.Headers); err != nil { return rawMessage{}, err } raw.Headers = headers.Bytes() diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go index ea0da79a5e0..5e9499699ba 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/json/jsonutil/unmarshal.go @@ -7,6 +7,7 @@ import ( "fmt" "io" "reflect" + "strings" "time" "github.com/aws/aws-sdk-go/aws" @@ -45,10 +46,31 @@ func UnmarshalJSON(v interface{}, stream io.Reader) error { return err } - return unmarshalAny(reflect.ValueOf(v), out, "") + return unmarshaler{}.unmarshalAny(reflect.ValueOf(v), out, "") } -func unmarshalAny(value reflect.Value, data interface{}, tag reflect.StructTag) error { +// UnmarshalJSONCaseInsensitive reads a stream and unmarshals the result into the +// object v. Ignores casing for structure members. +func UnmarshalJSONCaseInsensitive(v interface{}, stream io.Reader) error { + var out interface{} + + err := json.NewDecoder(stream).Decode(&out) + if err == io.EOF { + return nil + } else if err != nil { + return err + } + + return unmarshaler{ + caseInsensitive: true, + }.unmarshalAny(reflect.ValueOf(v), out, "") +} + +type unmarshaler struct { + caseInsensitive bool +} + +func (u unmarshaler) 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 @@ -80,17 +102,17 @@ func unmarshalAny(value reflect.Value, data interface{}, tag reflect.StructTag) if field, ok := vtype.FieldByName("_"); ok { tag = field.Tag } - return unmarshalStruct(value, data, tag) + return u.unmarshalStruct(value, data, tag) case "list": - return unmarshalList(value, data, tag) + return u.unmarshalList(value, data, tag) case "map": - return unmarshalMap(value, data, tag) + return u.unmarshalMap(value, data, tag) default: - return unmarshalScalar(value, data, tag) + return u.unmarshalScalar(value, data, tag) } } -func unmarshalStruct(value reflect.Value, data interface{}, tag reflect.StructTag) error { +func (u unmarshaler) unmarshalStruct(value reflect.Value, data interface{}, tag reflect.StructTag) error { if data == nil { return nil } @@ -114,7 +136,7 @@ func unmarshalStruct(value reflect.Value, data interface{}, tag reflect.StructTa // unwrap any payloads if payload := tag.Get("payload"); payload != "" { field, _ := t.FieldByName(payload) - return unmarshalAny(value.FieldByName(payload), data, field.Tag) + return u.unmarshalAny(value.FieldByName(payload), data, field.Tag) } for i := 0; i < t.NumField(); i++ { @@ -128,9 +150,19 @@ func unmarshalStruct(value reflect.Value, data interface{}, tag reflect.StructTa if locName := field.Tag.Get("locationName"); locName != "" { name = locName } + if u.caseInsensitive { + if _, ok := mapData[name]; !ok { + // Fallback to uncased name search if the exact name didn't match. + for kn, v := range mapData { + if strings.EqualFold(kn, name) { + mapData[name] = v + } + } + } + } member := value.FieldByIndex(field.Index) - err := unmarshalAny(member, mapData[name], field.Tag) + err := u.unmarshalAny(member, mapData[name], field.Tag) if err != nil { return err } @@ -138,7 +170,7 @@ func unmarshalStruct(value reflect.Value, data interface{}, tag reflect.StructTa return nil } -func unmarshalList(value reflect.Value, data interface{}, tag reflect.StructTag) error { +func (u unmarshaler) unmarshalList(value reflect.Value, data interface{}, tag reflect.StructTag) error { if data == nil { return nil } @@ -153,7 +185,7 @@ func unmarshalList(value reflect.Value, data interface{}, tag reflect.StructTag) } for i, c := range listData { - err := unmarshalAny(value.Index(i), c, "") + err := u.unmarshalAny(value.Index(i), c, "") if err != nil { return err } @@ -162,7 +194,7 @@ func unmarshalList(value reflect.Value, data interface{}, tag reflect.StructTag) return nil } -func unmarshalMap(value reflect.Value, data interface{}, tag reflect.StructTag) error { +func (u unmarshaler) unmarshalMap(value reflect.Value, data interface{}, tag reflect.StructTag) error { if data == nil { return nil } @@ -179,14 +211,14 @@ func unmarshalMap(value reflect.Value, data interface{}, tag reflect.StructTag) kvalue := reflect.ValueOf(k) vvalue := reflect.New(value.Type().Elem()).Elem() - unmarshalAny(vvalue, v, "") + u.unmarshalAny(vvalue, v, "") value.SetMapIndex(kvalue, vvalue) } return nil } -func unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTag) error { +func (u unmarshaler) unmarshalScalar(value reflect.Value, data interface{}, tag reflect.StructTag) error { switch d := data.(type) { case 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 index bfedc9fd422..a029217e4c6 100644 --- 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 @@ -2,12 +2,10 @@ // 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 +//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/input/json.json build_test.go +//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/output/json.json unmarshal_test.go import ( - "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" @@ -16,17 +14,26 @@ import ( 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} +// BuildHandler is a named request handler for building jsonrpc protocol +// requests +var BuildHandler = request.NamedHandler{ + Name: "awssdk.jsonrpc.Build", + Fn: Build, +} -// UnmarshalMetaHandler is a named request handler for unmarshaling jsonrpc protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.jsonrpc.UnmarshalMeta", Fn: UnmarshalMeta} +// UnmarshalHandler is a named request handler for unmarshaling jsonrpc +// protocol requests +var UnmarshalHandler = request.NamedHandler{ + Name: "awssdk.jsonrpc.Unmarshal", + Fn: Unmarshal, +} -// UnmarshalErrorHandler is a named request handler for unmarshaling jsonrpc protocol request errors -var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.jsonrpc.UnmarshalError", Fn: UnmarshalError} +// UnmarshalMetaHandler is a named request handler for unmarshaling jsonrpc +// protocol request metadata +var UnmarshalMetaHandler = request.NamedHandler{ + Name: "awssdk.jsonrpc.UnmarshalMeta", + Fn: UnmarshalMeta, +} // Build builds a JSON payload for a JSON RPC request. func Build(req *request.Request) { @@ -79,32 +86,3 @@ func Unmarshal(req *request.Request) { 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() - - var jsonErr jsonErrorResponse - err := jsonutil.UnmarshalJSONError(&jsonErr, req.HTTPResponse.Body) - if err != nil { - req.Error = awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, - "failed to unmarshal error message", err), - req.HTTPResponse.StatusCode, - req.RequestID, - ) - return - } - - codes := strings.SplitN(jsonErr.Code, "#", 2) - req.Error = awserr.NewRequestFailure( - awserr.New(codes[len(codes)-1], jsonErr.Message, nil), - req.HTTPResponse.StatusCode, - req.RequestID, - ) -} - -type jsonErrorResponse struct { - Code string `json:"__type"` - Message string `json:"message"` -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_error.go new file mode 100644 index 00000000000..c0c52e2db0f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/jsonrpc/unmarshal_error.go @@ -0,0 +1,107 @@ +package jsonrpc + +import ( + "bytes" + "io" + "io/ioutil" + "net/http" + "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" + "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" +) + +// UnmarshalTypedError provides unmarshaling errors API response errors +// for both typed and untyped errors. +type UnmarshalTypedError struct { + exceptions map[string]func(protocol.ResponseMetadata) error +} + +// NewUnmarshalTypedError returns an UnmarshalTypedError initialized for the +// set of exception names to the error unmarshalers +func NewUnmarshalTypedError(exceptions map[string]func(protocol.ResponseMetadata) error) *UnmarshalTypedError { + return &UnmarshalTypedError{ + exceptions: exceptions, + } +} + +// UnmarshalError attempts to unmarshal the HTTP response error as a known +// error type. If unable to unmarshal the error type, the generic SDK error +// type will be used. +func (u *UnmarshalTypedError) UnmarshalError( + resp *http.Response, + respMeta protocol.ResponseMetadata, +) (error, error) { + + var buf bytes.Buffer + var jsonErr jsonErrorResponse + teeReader := io.TeeReader(resp.Body, &buf) + err := jsonutil.UnmarshalJSONError(&jsonErr, teeReader) + if err != nil { + return nil, err + } + body := ioutil.NopCloser(&buf) + + // Code may be separated by hash(#), with the last element being the code + // used by the SDK. + codeParts := strings.SplitN(jsonErr.Code, "#", 2) + code := codeParts[len(codeParts)-1] + msg := jsonErr.Message + + if fn, ok := u.exceptions[code]; ok { + // If exception code is know, use associated constructor to get a value + // for the exception that the JSON body can be unmarshaled into. + v := fn(respMeta) + err := jsonutil.UnmarshalJSONCaseInsensitive(v, body) + if err != nil { + return nil, err + } + + return v, nil + } + + // fallback to unmodeled generic exceptions + return awserr.NewRequestFailure( + awserr.New(code, msg, nil), + respMeta.StatusCode, + respMeta.RequestID, + ), nil +} + +// UnmarshalErrorHandler is a named request handler for unmarshaling jsonrpc +// protocol request errors +var UnmarshalErrorHandler = request.NamedHandler{ + Name: "awssdk.jsonrpc.UnmarshalError", + Fn: UnmarshalError, +} + +// UnmarshalError unmarshals an error response for a JSON RPC service. +func UnmarshalError(req *request.Request) { + defer req.HTTPResponse.Body.Close() + + var jsonErr jsonErrorResponse + err := jsonutil.UnmarshalJSONError(&jsonErr, req.HTTPResponse.Body) + if err != nil { + req.Error = awserr.NewRequestFailure( + awserr.New(request.ErrCodeSerialization, + "failed to unmarshal error message", err), + req.HTTPResponse.StatusCode, + req.RequestID, + ) + 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/payload.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go index e21614a1250..0ea0647a57d 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/payload.go @@ -64,7 +64,7 @@ func (h HandlerPayloadMarshal) MarshalPayload(w io.Writer, v interface{}) error metadata.ClientInfo{}, request.Handlers{}, nil, - &request.Operation{HTTPMethod: "GET"}, + &request.Operation{HTTPMethod: "PUT"}, v, nil, ) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/protocol.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/protocol.go new file mode 100644 index 00000000000..9d521dcb950 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/protocol.go @@ -0,0 +1,49 @@ +package protocol + +import ( + "fmt" + "strings" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" +) + +// RequireHTTPMinProtocol request handler is used to enforce that +// the target endpoint supports the given major and minor HTTP protocol version. +type RequireHTTPMinProtocol struct { + Major, Minor int +} + +// Handler will mark the request.Request with an error if the +// target endpoint did not connect with the required HTTP protocol +// major and minor version. +func (p RequireHTTPMinProtocol) Handler(r *request.Request) { + if r.Error != nil || r.HTTPResponse == nil { + return + } + + if !strings.HasPrefix(r.HTTPResponse.Proto, "HTTP") { + r.Error = newMinHTTPProtoError(p.Major, p.Minor, r) + } + + if r.HTTPResponse.ProtoMajor < p.Major || r.HTTPResponse.ProtoMinor < p.Minor { + r.Error = newMinHTTPProtoError(p.Major, p.Minor, r) + } +} + +// ErrCodeMinimumHTTPProtocolError error code is returned when the target endpoint +// did not match the required HTTP major and minor protocol version. +const ErrCodeMinimumHTTPProtocolError = "MinimumHTTPProtocolError" + +func newMinHTTPProtoError(major, minor int, r *request.Request) error { + return awserr.NewRequestFailure( + awserr.New("MinimumHTTPProtocolError", + fmt.Sprintf( + "operation requires minimum HTTP protocol of HTTP/%d.%d, but was %s", + major, minor, r.HTTPResponse.Proto, + ), + nil, + ), + r.HTTPResponse.StatusCode, r.RequestID, + ) +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go index 0cb99eb5796..d40346a7790 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/build.go @@ -1,7 +1,7 @@ // Package query provides serialization of AWS query requests, and responses. package query -//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/query.json build_test.go +//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/input/query.json build_test.go import ( "net/url" diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go index f69c1efc93a..9231e95d160 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/query/unmarshal.go @@ -1,6 +1,6 @@ package query -//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/query.json unmarshal_test.go +//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/output/query.json unmarshal_test.go import ( "encoding/xml" 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 74e361e070d..92f8b4d9a48 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 @@ -15,6 +15,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/request" + awsStrings "github.com/aws/aws-sdk-go/internal/strings" "github.com/aws/aws-sdk-go/private/protocol" ) @@ -28,7 +29,9 @@ var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.rest.UnmarshalMeta func Unmarshal(r *request.Request) { if r.DataFilled() { v := reflect.Indirect(reflect.ValueOf(r.Data)) - unmarshalBody(r, v) + if err := unmarshalBody(r, v); err != nil { + r.Error = err + } } } @@ -40,12 +43,21 @@ func UnmarshalMeta(r *request.Request) { r.RequestID = r.HTTPResponse.Header.Get("X-Amz-Request-Id") } if r.DataFilled() { - v := reflect.Indirect(reflect.ValueOf(r.Data)) - unmarshalLocationElements(r, v) + if err := UnmarshalResponse(r.HTTPResponse, r.Data, aws.BoolValue(r.Config.LowerCaseHeaderMaps)); err != nil { + r.Error = err + } } } -func unmarshalBody(r *request.Request, v reflect.Value) { +// UnmarshalResponse attempts to unmarshal the REST response headers to +// the data type passed in. The type must be a pointer. An error is returned +// with any error unmarshaling the response into the target datatype. +func UnmarshalResponse(resp *http.Response, data interface{}, lowerCaseHeaderMaps bool) error { + v := reflect.Indirect(reflect.ValueOf(data)) + return unmarshalLocationElements(resp, v, lowerCaseHeaderMaps) +} + +func unmarshalBody(r *request.Request, v reflect.Value) error { if field, ok := v.Type().FieldByName("_"); ok { if payloadName := field.Tag.Get("payload"); payloadName != "" { pfield, _ := v.Type().FieldByName(payloadName) @@ -57,35 +69,38 @@ func unmarshalBody(r *request.Request, v reflect.Value) { defer r.HTTPResponse.Body.Close() b, err := ioutil.ReadAll(r.HTTPResponse.Body) if err != nil { - r.Error = awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) - } else { - payload.Set(reflect.ValueOf(b)) + return awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) } + + payload.Set(reflect.ValueOf(b)) + case *string: defer r.HTTPResponse.Body.Close() b, err := ioutil.ReadAll(r.HTTPResponse.Body) if err != nil { - r.Error = awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) - } else { - str := string(b) - payload.Set(reflect.ValueOf(&str)) + return awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) } + + str := string(b) + payload.Set(reflect.ValueOf(&str)) + default: switch payload.Type().String() { case "io.ReadCloser": payload.Set(reflect.ValueOf(r.HTTPResponse.Body)) + case "io.ReadSeeker": b, err := ioutil.ReadAll(r.HTTPResponse.Body) if err != nil { - r.Error = awserr.New(request.ErrCodeSerialization, + return awserr.New(request.ErrCodeSerialization, "failed to read response body", err) - return } payload.Set(reflect.ValueOf(ioutil.NopCloser(bytes.NewReader(b)))) + default: io.Copy(ioutil.Discard, r.HTTPResponse.Body) - defer r.HTTPResponse.Body.Close() - r.Error = awserr.New(request.ErrCodeSerialization, + r.HTTPResponse.Body.Close() + return awserr.New(request.ErrCodeSerialization, "failed to decode REST response", fmt.Errorf("unknown payload type %s", payload.Type())) } @@ -94,9 +109,11 @@ func unmarshalBody(r *request.Request, v reflect.Value) { } } } + + return nil } -func unmarshalLocationElements(r *request.Request, v reflect.Value) { +func unmarshalLocationElements(resp *http.Response, v reflect.Value, lowerCaseHeaderMaps bool) error { for i := 0; i < v.NumField(); i++ { m, field := v.Field(i), v.Type().Field(i) if n := field.Name; n[0:1] == strings.ToLower(n[0:1]) { @@ -111,26 +128,25 @@ func unmarshalLocationElements(r *request.Request, v reflect.Value) { switch field.Tag.Get("location") { case "statusCode": - unmarshalStatusCode(m, r.HTTPResponse.StatusCode) + unmarshalStatusCode(m, resp.StatusCode) + case "header": - err := unmarshalHeader(m, r.HTTPResponse.Header.Get(name), field.Tag) + err := unmarshalHeader(m, resp.Header.Get(name), field.Tag) if err != nil { - r.Error = awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) - break + return awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) } + case "headers": prefix := field.Tag.Get("locationName") - err := unmarshalHeaderMap(m, r.HTTPResponse.Header, prefix) + err := unmarshalHeaderMap(m, resp.Header, prefix, lowerCaseHeaderMaps) if err != nil { - r.Error = awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) - break + awserr.New(request.ErrCodeSerialization, "failed to decode REST response", err) } } } - if r.Error != nil { - return - } } + + return nil } func unmarshalStatusCode(v reflect.Value, statusCode int) { @@ -145,7 +161,7 @@ func unmarshalStatusCode(v reflect.Value, statusCode int) { } } -func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) error { +func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string, normalize bool) error { if len(headers) == 0 { return nil } @@ -153,8 +169,12 @@ func unmarshalHeaderMap(r reflect.Value, headers http.Header, prefix string) err case map[string]*string: // we only support string map value types out := map[string]*string{} for k, v := range headers { - k = http.CanonicalHeaderKey(k) - if strings.HasPrefix(strings.ToLower(k), strings.ToLower(prefix)) { + if awsStrings.HasPrefixFold(k, prefix) { + if normalize == true { + k = strings.ToLower(k) + } else { + k = http.CanonicalHeaderKey(k) + } out[k[len(prefix):]] = &v[0] } } 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 index af4f6154d70..2e0e205af37 100644 --- 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 @@ -2,30 +2,35 @@ // 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 +//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/input/rest-json.json build_test.go +//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/output/rest-json.json unmarshal_test.go import ( - "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/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} +// BuildHandler is a named request handler for building restjson protocol +// requests +var BuildHandler = request.NamedHandler{ + Name: "awssdk.restjson.Build", + Fn: Build, +} -// UnmarshalMetaHandler is a named request handler for unmarshaling restjson protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.restjson.UnmarshalMeta", Fn: UnmarshalMeta} +// UnmarshalHandler is a named request handler for unmarshaling restjson +// protocol requests +var UnmarshalHandler = request.NamedHandler{ + Name: "awssdk.restjson.Unmarshal", + Fn: Unmarshal, +} -// UnmarshalErrorHandler is a named request handler for unmarshaling restjson protocol request errors -var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.restjson.UnmarshalError", Fn: UnmarshalError} +// UnmarshalMetaHandler is a named request handler for unmarshaling restjson +// protocol request metadata +var UnmarshalMetaHandler = request.NamedHandler{ + Name: "awssdk.restjson.UnmarshalMeta", + Fn: UnmarshalMeta, +} // Build builds a request for the REST JSON protocol. func Build(r *request.Request) { @@ -52,37 +57,3 @@ func Unmarshal(r *request.Request) { 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() - - var jsonErr jsonErrorResponse - err := jsonutil.UnmarshalJSONError(&jsonErr, r.HTTPResponse.Body) - if err != nil { - r.Error = awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, - "failed to unmarshal response error", err), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return - } - - code := r.HTTPResponse.Header.Get("X-Amzn-Errortype") - if code == "" { - code = jsonErr.Code - } - - code = strings.SplitN(code, ":", 2)[0] - r.Error = awserr.NewRequestFailure( - awserr.New(code, jsonErr.Message, nil), - r.HTTPResponse.StatusCode, - r.RequestID, - ) -} - -type jsonErrorResponse struct { - Code string `json:"code"` - Message string `json:"message"` -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_error.go new file mode 100644 index 00000000000..d756d8cc529 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/restjson/unmarshal_error.go @@ -0,0 +1,134 @@ +package restjson + +import ( + "bytes" + "io" + "io/ioutil" + "net/http" + "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" + "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" + "github.com/aws/aws-sdk-go/private/protocol/rest" +) + +const ( + errorTypeHeader = "X-Amzn-Errortype" + errorMessageHeader = "X-Amzn-Errormessage" +) + +// UnmarshalTypedError provides unmarshaling errors API response errors +// for both typed and untyped errors. +type UnmarshalTypedError struct { + exceptions map[string]func(protocol.ResponseMetadata) error +} + +// NewUnmarshalTypedError returns an UnmarshalTypedError initialized for the +// set of exception names to the error unmarshalers +func NewUnmarshalTypedError(exceptions map[string]func(protocol.ResponseMetadata) error) *UnmarshalTypedError { + return &UnmarshalTypedError{ + exceptions: exceptions, + } +} + +// UnmarshalError attempts to unmarshal the HTTP response error as a known +// error type. If unable to unmarshal the error type, the generic SDK error +// type will be used. +func (u *UnmarshalTypedError) UnmarshalError( + resp *http.Response, + respMeta protocol.ResponseMetadata, +) (error, error) { + + code := resp.Header.Get(errorTypeHeader) + msg := resp.Header.Get(errorMessageHeader) + + body := resp.Body + if len(code) == 0 { + // If unable to get code from HTTP headers have to parse JSON message + // to determine what kind of exception this will be. + var buf bytes.Buffer + var jsonErr jsonErrorResponse + teeReader := io.TeeReader(resp.Body, &buf) + err := jsonutil.UnmarshalJSONError(&jsonErr, teeReader) + if err != nil { + return nil, err + } + + body = ioutil.NopCloser(&buf) + code = jsonErr.Code + msg = jsonErr.Message + } + + // If code has colon separators remove them so can compare against modeled + // exception names. + code = strings.SplitN(code, ":", 2)[0] + + if fn, ok := u.exceptions[code]; ok { + // If exception code is know, use associated constructor to get a value + // for the exception that the JSON body can be unmarshaled into. + v := fn(respMeta) + if err := jsonutil.UnmarshalJSONCaseInsensitive(v, body); err != nil { + return nil, err + } + + if err := rest.UnmarshalResponse(resp, v, true); err != nil { + return nil, err + } + + return v, nil + } + + // fallback to unmodeled generic exceptions + return awserr.NewRequestFailure( + awserr.New(code, msg, nil), + respMeta.StatusCode, + respMeta.RequestID, + ), nil +} + +// UnmarshalErrorHandler is a named request handler for unmarshaling restjson +// protocol request errors +var UnmarshalErrorHandler = request.NamedHandler{ + Name: "awssdk.restjson.UnmarshalError", + Fn: UnmarshalError, +} + +// UnmarshalError unmarshals a response error for the REST JSON protocol. +func UnmarshalError(r *request.Request) { + defer r.HTTPResponse.Body.Close() + + var jsonErr jsonErrorResponse + err := jsonutil.UnmarshalJSONError(&jsonErr, r.HTTPResponse.Body) + if err != nil { + r.Error = awserr.NewRequestFailure( + awserr.New(request.ErrCodeSerialization, + "failed to unmarshal response error", err), + r.HTTPResponse.StatusCode, + r.RequestID, + ) + return + } + + code := r.HTTPResponse.Header.Get(errorTypeHeader) + if code == "" { + code = jsonErr.Code + } + msg := r.HTTPResponse.Header.Get(errorMessageHeader) + if msg == "" { + msg = jsonErr.Message + } + + 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/restxml/restxml.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go index 07a6187ea62..b1ae3648719 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go @@ -2,8 +2,8 @@ // requests and responses. package restxml -//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/input/rest-xml.json build_test.go -//go:generate go run -tags codegen ../../../models/protocol_tests/generate.go ../../../models/protocol_tests/output/rest-xml.json unmarshal_test.go +//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/input/rest-xml.json build_test.go +//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/output/rest-xml.json unmarshal_test.go import ( "bytes" diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go index da1a68111db..f614ef898be 100644 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal.go @@ -19,3 +19,9 @@ func UnmarshalDiscardBody(r *request.Request) { io.Copy(ioutil.Discard, r.HTTPResponse.Body) r.HTTPResponse.Body.Close() } + +// ResponseMetadata provides the SDK response metadata attributes. +type ResponseMetadata struct { + StatusCode int + RequestID string +} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal_error.go new file mode 100644 index 00000000000..cc857f136c5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/private/protocol/unmarshal_error.go @@ -0,0 +1,65 @@ +package protocol + +import ( + "net/http" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/request" +) + +// UnmarshalErrorHandler provides unmarshaling errors API response errors for +// both typed and untyped errors. +type UnmarshalErrorHandler struct { + unmarshaler ErrorUnmarshaler +} + +// ErrorUnmarshaler is an abstract interface for concrete implementations to +// unmarshal protocol specific response errors. +type ErrorUnmarshaler interface { + UnmarshalError(*http.Response, ResponseMetadata) (error, error) +} + +// NewUnmarshalErrorHandler returns an UnmarshalErrorHandler +// initialized for the set of exception names to the error unmarshalers +func NewUnmarshalErrorHandler(unmarshaler ErrorUnmarshaler) *UnmarshalErrorHandler { + return &UnmarshalErrorHandler{ + unmarshaler: unmarshaler, + } +} + +// UnmarshalErrorHandlerName is the name of the named handler. +const UnmarshalErrorHandlerName = "awssdk.protocol.UnmarshalError" + +// NamedHandler returns a NamedHandler for the unmarshaler using the set of +// errors the unmarshaler was initialized for. +func (u *UnmarshalErrorHandler) NamedHandler() request.NamedHandler { + return request.NamedHandler{ + Name: UnmarshalErrorHandlerName, + Fn: u.UnmarshalError, + } +} + +// UnmarshalError will attempt to unmarshal the API response's error message +// into either a generic SDK error type, or a typed error corresponding to the +// errors exception name. +func (u *UnmarshalErrorHandler) UnmarshalError(r *request.Request) { + defer r.HTTPResponse.Body.Close() + + respMeta := ResponseMetadata{ + StatusCode: r.HTTPResponse.StatusCode, + RequestID: r.RequestID, + } + + v, err := u.unmarshaler.UnmarshalError(r.HTTPResponse, respMeta) + if err != nil { + r.Error = awserr.NewRequestFailure( + awserr.New(request.ErrCodeSerialization, + "failed to unmarshal response error", err), + respMeta.StatusCode, + respMeta.RequestID, + ) + return + } + + r.Error = v +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/accessanalyzer/api.go b/vendor/github.com/aws/aws-sdk-go/service/accessanalyzer/api.go new file mode 100644 index 00000000000..8565aeada46 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/accessanalyzer/api.go @@ -0,0 +1,4745 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package accessanalyzer + +import ( + "fmt" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/restjson" +) + +const opCreateAnalyzer = "CreateAnalyzer" + +// CreateAnalyzerRequest generates a "aws/request.Request" representing the +// client's request for the CreateAnalyzer operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateAnalyzer for more information on using the CreateAnalyzer +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateAnalyzerRequest method. +// req, resp := client.CreateAnalyzerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/CreateAnalyzer +func (c *AccessAnalyzer) CreateAnalyzerRequest(input *CreateAnalyzerInput) (req *request.Request, output *CreateAnalyzerOutput) { + op := &request.Operation{ + Name: opCreateAnalyzer, + HTTPMethod: "PUT", + HTTPPath: "/analyzer", + } + + if input == nil { + input = &CreateAnalyzerInput{} + } + + output = &CreateAnalyzerOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateAnalyzer API operation for Access Analyzer. +// +// Creates an analyzer 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 Access Analyzer's +// API operation CreateAnalyzer for usage and error information. +// +// Returned Error Types: +// * ConflictException +// A conflict exception error. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ServiceQuotaExceededException +// Service quote met error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/CreateAnalyzer +func (c *AccessAnalyzer) CreateAnalyzer(input *CreateAnalyzerInput) (*CreateAnalyzerOutput, error) { + req, out := c.CreateAnalyzerRequest(input) + return out, req.Send() +} + +// CreateAnalyzerWithContext is the same as CreateAnalyzer with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAnalyzer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) CreateAnalyzerWithContext(ctx aws.Context, input *CreateAnalyzerInput, opts ...request.Option) (*CreateAnalyzerOutput, error) { + req, out := c.CreateAnalyzerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateArchiveRule = "CreateArchiveRule" + +// CreateArchiveRuleRequest generates a "aws/request.Request" representing the +// client's request for the CreateArchiveRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateArchiveRule for more information on using the CreateArchiveRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateArchiveRuleRequest method. +// req, resp := client.CreateArchiveRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/CreateArchiveRule +func (c *AccessAnalyzer) CreateArchiveRuleRequest(input *CreateArchiveRuleInput) (req *request.Request, output *CreateArchiveRuleOutput) { + op := &request.Operation{ + Name: opCreateArchiveRule, + HTTPMethod: "PUT", + HTTPPath: "/analyzer/{analyzerName}/archive-rule", + } + + if input == nil { + input = &CreateArchiveRuleInput{} + } + + output = &CreateArchiveRuleOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// CreateArchiveRule API operation for Access Analyzer. +// +// Creates an archive rule for the specified analyzer. Archive rules automatically +// archive findings that meet the criteria you define when you create 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 Access Analyzer's +// API operation CreateArchiveRule for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. +// +// * ConflictException +// A conflict exception error. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ServiceQuotaExceededException +// Service quote met error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/CreateArchiveRule +func (c *AccessAnalyzer) CreateArchiveRule(input *CreateArchiveRuleInput) (*CreateArchiveRuleOutput, error) { + req, out := c.CreateArchiveRuleRequest(input) + return out, req.Send() +} + +// CreateArchiveRuleWithContext is the same as CreateArchiveRule with the addition of +// the ability to pass a context and additional request options. +// +// See CreateArchiveRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) CreateArchiveRuleWithContext(ctx aws.Context, input *CreateArchiveRuleInput, opts ...request.Option) (*CreateArchiveRuleOutput, error) { + req, out := c.CreateArchiveRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteAnalyzer = "DeleteAnalyzer" + +// DeleteAnalyzerRequest generates a "aws/request.Request" representing the +// client's request for the DeleteAnalyzer operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteAnalyzer for more information on using the DeleteAnalyzer +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteAnalyzerRequest method. +// req, resp := client.DeleteAnalyzerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/DeleteAnalyzer +func (c *AccessAnalyzer) DeleteAnalyzerRequest(input *DeleteAnalyzerInput) (req *request.Request, output *DeleteAnalyzerOutput) { + op := &request.Operation{ + Name: opDeleteAnalyzer, + HTTPMethod: "DELETE", + HTTPPath: "/analyzer/{analyzerName}", + } + + if input == nil { + input = &DeleteAnalyzerInput{} + } + + output = &DeleteAnalyzerOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteAnalyzer API operation for Access Analyzer. +// +// Deletes the specified analyzer. When you delete an analyzer, Access Analyzer +// is disabled for the account in the current or specific Region. All findings +// that were generated by the analyzer are deleted. You cannot undo 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 Access Analyzer's +// API operation DeleteAnalyzer for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/DeleteAnalyzer +func (c *AccessAnalyzer) DeleteAnalyzer(input *DeleteAnalyzerInput) (*DeleteAnalyzerOutput, error) { + req, out := c.DeleteAnalyzerRequest(input) + return out, req.Send() +} + +// DeleteAnalyzerWithContext is the same as DeleteAnalyzer with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAnalyzer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) DeleteAnalyzerWithContext(ctx aws.Context, input *DeleteAnalyzerInput, opts ...request.Option) (*DeleteAnalyzerOutput, error) { + req, out := c.DeleteAnalyzerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteArchiveRule = "DeleteArchiveRule" + +// DeleteArchiveRuleRequest generates a "aws/request.Request" representing the +// client's request for the DeleteArchiveRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteArchiveRule for more information on using the DeleteArchiveRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteArchiveRuleRequest method. +// req, resp := client.DeleteArchiveRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/DeleteArchiveRule +func (c *AccessAnalyzer) DeleteArchiveRuleRequest(input *DeleteArchiveRuleInput) (req *request.Request, output *DeleteArchiveRuleOutput) { + op := &request.Operation{ + Name: opDeleteArchiveRule, + HTTPMethod: "DELETE", + HTTPPath: "/analyzer/{analyzerName}/archive-rule/{ruleName}", + } + + if input == nil { + input = &DeleteArchiveRuleInput{} + } + + output = &DeleteArchiveRuleOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteArchiveRule API operation for Access Analyzer. +// +// Deletes the specified archive 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 Access Analyzer's +// API operation DeleteArchiveRule for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/DeleteArchiveRule +func (c *AccessAnalyzer) DeleteArchiveRule(input *DeleteArchiveRuleInput) (*DeleteArchiveRuleOutput, error) { + req, out := c.DeleteArchiveRuleRequest(input) + return out, req.Send() +} + +// DeleteArchiveRuleWithContext is the same as DeleteArchiveRule with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteArchiveRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) DeleteArchiveRuleWithContext(ctx aws.Context, input *DeleteArchiveRuleInput, opts ...request.Option) (*DeleteArchiveRuleOutput, error) { + req, out := c.DeleteArchiveRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetAnalyzedResource = "GetAnalyzedResource" + +// GetAnalyzedResourceRequest generates a "aws/request.Request" representing the +// client's request for the GetAnalyzedResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetAnalyzedResource for more information on using the GetAnalyzedResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetAnalyzedResourceRequest method. +// req, resp := client.GetAnalyzedResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/GetAnalyzedResource +func (c *AccessAnalyzer) GetAnalyzedResourceRequest(input *GetAnalyzedResourceInput) (req *request.Request, output *GetAnalyzedResourceOutput) { + op := &request.Operation{ + Name: opGetAnalyzedResource, + HTTPMethod: "GET", + HTTPPath: "/analyzed-resource", + } + + if input == nil { + input = &GetAnalyzedResourceInput{} + } + + output = &GetAnalyzedResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetAnalyzedResource API operation for Access Analyzer. +// +// Retrieves information about a resource that was analyzed. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Access Analyzer's +// API operation GetAnalyzedResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/GetAnalyzedResource +func (c *AccessAnalyzer) GetAnalyzedResource(input *GetAnalyzedResourceInput) (*GetAnalyzedResourceOutput, error) { + req, out := c.GetAnalyzedResourceRequest(input) + return out, req.Send() +} + +// GetAnalyzedResourceWithContext is the same as GetAnalyzedResource with the addition of +// the ability to pass a context and additional request options. +// +// See GetAnalyzedResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) GetAnalyzedResourceWithContext(ctx aws.Context, input *GetAnalyzedResourceInput, opts ...request.Option) (*GetAnalyzedResourceOutput, error) { + req, out := c.GetAnalyzedResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetAnalyzer = "GetAnalyzer" + +// GetAnalyzerRequest generates a "aws/request.Request" representing the +// client's request for the GetAnalyzer operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetAnalyzer for more information on using the GetAnalyzer +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetAnalyzerRequest method. +// req, resp := client.GetAnalyzerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/GetAnalyzer +func (c *AccessAnalyzer) GetAnalyzerRequest(input *GetAnalyzerInput) (req *request.Request, output *GetAnalyzerOutput) { + op := &request.Operation{ + Name: opGetAnalyzer, + HTTPMethod: "GET", + HTTPPath: "/analyzer/{analyzerName}", + } + + if input == nil { + input = &GetAnalyzerInput{} + } + + output = &GetAnalyzerOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetAnalyzer API operation for Access Analyzer. +// +// Retrieves information about the specified analyzer. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Access Analyzer's +// API operation GetAnalyzer for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/GetAnalyzer +func (c *AccessAnalyzer) GetAnalyzer(input *GetAnalyzerInput) (*GetAnalyzerOutput, error) { + req, out := c.GetAnalyzerRequest(input) + return out, req.Send() +} + +// GetAnalyzerWithContext is the same as GetAnalyzer with the addition of +// the ability to pass a context and additional request options. +// +// See GetAnalyzer for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) GetAnalyzerWithContext(ctx aws.Context, input *GetAnalyzerInput, opts ...request.Option) (*GetAnalyzerOutput, error) { + req, out := c.GetAnalyzerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetArchiveRule = "GetArchiveRule" + +// GetArchiveRuleRequest generates a "aws/request.Request" representing the +// client's request for the GetArchiveRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetArchiveRule for more information on using the GetArchiveRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetArchiveRuleRequest method. +// req, resp := client.GetArchiveRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/GetArchiveRule +func (c *AccessAnalyzer) GetArchiveRuleRequest(input *GetArchiveRuleInput) (req *request.Request, output *GetArchiveRuleOutput) { + op := &request.Operation{ + Name: opGetArchiveRule, + HTTPMethod: "GET", + HTTPPath: "/analyzer/{analyzerName}/archive-rule/{ruleName}", + } + + if input == nil { + input = &GetArchiveRuleInput{} + } + + output = &GetArchiveRuleOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetArchiveRule API operation for Access Analyzer. +// +// Retrieves information about an archive 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 Access Analyzer's +// API operation GetArchiveRule for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/GetArchiveRule +func (c *AccessAnalyzer) GetArchiveRule(input *GetArchiveRuleInput) (*GetArchiveRuleOutput, error) { + req, out := c.GetArchiveRuleRequest(input) + return out, req.Send() +} + +// GetArchiveRuleWithContext is the same as GetArchiveRule with the addition of +// the ability to pass a context and additional request options. +// +// See GetArchiveRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) GetArchiveRuleWithContext(ctx aws.Context, input *GetArchiveRuleInput, opts ...request.Option) (*GetArchiveRuleOutput, error) { + req, out := c.GetArchiveRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetFinding = "GetFinding" + +// GetFindingRequest generates a "aws/request.Request" representing the +// client's request for the GetFinding operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetFinding for more information on using the GetFinding +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetFindingRequest method. +// req, resp := client.GetFindingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/GetFinding +func (c *AccessAnalyzer) GetFindingRequest(input *GetFindingInput) (req *request.Request, output *GetFindingOutput) { + op := &request.Operation{ + Name: opGetFinding, + HTTPMethod: "GET", + HTTPPath: "/finding/{id}", + } + + if input == nil { + input = &GetFindingInput{} + } + + output = &GetFindingOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetFinding API operation for Access Analyzer. +// +// Retrieves information about the specified finding. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Access Analyzer's +// API operation GetFinding for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/GetFinding +func (c *AccessAnalyzer) GetFinding(input *GetFindingInput) (*GetFindingOutput, error) { + req, out := c.GetFindingRequest(input) + return out, req.Send() +} + +// GetFindingWithContext is the same as GetFinding with the addition of +// the ability to pass a context and additional request options. +// +// See GetFinding for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) GetFindingWithContext(ctx aws.Context, input *GetFindingInput, opts ...request.Option) (*GetFindingOutput, error) { + req, out := c.GetFindingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListAnalyzedResources = "ListAnalyzedResources" + +// ListAnalyzedResourcesRequest generates a "aws/request.Request" representing the +// client's request for the ListAnalyzedResources operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListAnalyzedResources for more information on using the ListAnalyzedResources +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListAnalyzedResourcesRequest method. +// req, resp := client.ListAnalyzedResourcesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/ListAnalyzedResources +func (c *AccessAnalyzer) ListAnalyzedResourcesRequest(input *ListAnalyzedResourcesInput) (req *request.Request, output *ListAnalyzedResourcesOutput) { + op := &request.Operation{ + Name: opListAnalyzedResources, + HTTPMethod: "POST", + HTTPPath: "/analyzed-resource", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListAnalyzedResourcesInput{} + } + + output = &ListAnalyzedResourcesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListAnalyzedResources API operation for Access Analyzer. +// +// Retrieves a list of resources of the specified type that have been analyzed +// by the specified analyzer.. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Access Analyzer's +// API operation ListAnalyzedResources for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/ListAnalyzedResources +func (c *AccessAnalyzer) ListAnalyzedResources(input *ListAnalyzedResourcesInput) (*ListAnalyzedResourcesOutput, error) { + req, out := c.ListAnalyzedResourcesRequest(input) + return out, req.Send() +} + +// ListAnalyzedResourcesWithContext is the same as ListAnalyzedResources with the addition of +// the ability to pass a context and additional request options. +// +// See ListAnalyzedResources for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) ListAnalyzedResourcesWithContext(ctx aws.Context, input *ListAnalyzedResourcesInput, opts ...request.Option) (*ListAnalyzedResourcesOutput, error) { + req, out := c.ListAnalyzedResourcesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListAnalyzedResourcesPages iterates over the pages of a ListAnalyzedResources operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListAnalyzedResources 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 ListAnalyzedResources operation. +// pageNum := 0 +// err := client.ListAnalyzedResourcesPages(params, +// func(page *accessanalyzer.ListAnalyzedResourcesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *AccessAnalyzer) ListAnalyzedResourcesPages(input *ListAnalyzedResourcesInput, fn func(*ListAnalyzedResourcesOutput, bool) bool) error { + return c.ListAnalyzedResourcesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListAnalyzedResourcesPagesWithContext same as ListAnalyzedResourcesPages 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 *AccessAnalyzer) ListAnalyzedResourcesPagesWithContext(ctx aws.Context, input *ListAnalyzedResourcesInput, fn func(*ListAnalyzedResourcesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAnalyzedResourcesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAnalyzedResourcesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListAnalyzedResourcesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListAnalyzers = "ListAnalyzers" + +// ListAnalyzersRequest generates a "aws/request.Request" representing the +// client's request for the ListAnalyzers operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListAnalyzers for more information on using the ListAnalyzers +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListAnalyzersRequest method. +// req, resp := client.ListAnalyzersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/ListAnalyzers +func (c *AccessAnalyzer) ListAnalyzersRequest(input *ListAnalyzersInput) (req *request.Request, output *ListAnalyzersOutput) { + op := &request.Operation{ + Name: opListAnalyzers, + HTTPMethod: "GET", + HTTPPath: "/analyzer", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListAnalyzersInput{} + } + + output = &ListAnalyzersOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListAnalyzers API operation for Access Analyzer. +// +// Retrieves a list of analyzers. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Access Analyzer's +// API operation ListAnalyzers for usage and error information. +// +// Returned Error Types: +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/ListAnalyzers +func (c *AccessAnalyzer) ListAnalyzers(input *ListAnalyzersInput) (*ListAnalyzersOutput, error) { + req, out := c.ListAnalyzersRequest(input) + return out, req.Send() +} + +// ListAnalyzersWithContext is the same as ListAnalyzers with the addition of +// the ability to pass a context and additional request options. +// +// See ListAnalyzers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) ListAnalyzersWithContext(ctx aws.Context, input *ListAnalyzersInput, opts ...request.Option) (*ListAnalyzersOutput, error) { + req, out := c.ListAnalyzersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListAnalyzersPages iterates over the pages of a ListAnalyzers operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListAnalyzers 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 ListAnalyzers operation. +// pageNum := 0 +// err := client.ListAnalyzersPages(params, +// func(page *accessanalyzer.ListAnalyzersOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *AccessAnalyzer) ListAnalyzersPages(input *ListAnalyzersInput, fn func(*ListAnalyzersOutput, bool) bool) error { + return c.ListAnalyzersPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListAnalyzersPagesWithContext same as ListAnalyzersPages 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 *AccessAnalyzer) ListAnalyzersPagesWithContext(ctx aws.Context, input *ListAnalyzersInput, fn func(*ListAnalyzersOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAnalyzersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAnalyzersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListAnalyzersOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListArchiveRules = "ListArchiveRules" + +// ListArchiveRulesRequest generates a "aws/request.Request" representing the +// client's request for the ListArchiveRules operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListArchiveRules for more information on using the ListArchiveRules +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListArchiveRulesRequest method. +// req, resp := client.ListArchiveRulesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/ListArchiveRules +func (c *AccessAnalyzer) ListArchiveRulesRequest(input *ListArchiveRulesInput) (req *request.Request, output *ListArchiveRulesOutput) { + op := &request.Operation{ + Name: opListArchiveRules, + HTTPMethod: "GET", + HTTPPath: "/analyzer/{analyzerName}/archive-rule", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListArchiveRulesInput{} + } + + output = &ListArchiveRulesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListArchiveRules API operation for Access Analyzer. +// +// Retrieves a list of archive rules created for the specified analyzer. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Access Analyzer's +// API operation ListArchiveRules for usage and error information. +// +// Returned Error Types: +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/ListArchiveRules +func (c *AccessAnalyzer) ListArchiveRules(input *ListArchiveRulesInput) (*ListArchiveRulesOutput, error) { + req, out := c.ListArchiveRulesRequest(input) + return out, req.Send() +} + +// ListArchiveRulesWithContext is the same as ListArchiveRules with the addition of +// the ability to pass a context and additional request options. +// +// See ListArchiveRules for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) ListArchiveRulesWithContext(ctx aws.Context, input *ListArchiveRulesInput, opts ...request.Option) (*ListArchiveRulesOutput, error) { + req, out := c.ListArchiveRulesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListArchiveRulesPages iterates over the pages of a ListArchiveRules operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListArchiveRules 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 ListArchiveRules operation. +// pageNum := 0 +// err := client.ListArchiveRulesPages(params, +// func(page *accessanalyzer.ListArchiveRulesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *AccessAnalyzer) ListArchiveRulesPages(input *ListArchiveRulesInput, fn func(*ListArchiveRulesOutput, bool) bool) error { + return c.ListArchiveRulesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListArchiveRulesPagesWithContext same as ListArchiveRulesPages 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 *AccessAnalyzer) ListArchiveRulesPagesWithContext(ctx aws.Context, input *ListArchiveRulesInput, fn func(*ListArchiveRulesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListArchiveRulesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListArchiveRulesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListArchiveRulesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListFindings = "ListFindings" + +// ListFindingsRequest generates a "aws/request.Request" representing the +// client's request for the ListFindings operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListFindings for more information on using the ListFindings +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListFindingsRequest method. +// req, resp := client.ListFindingsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/ListFindings +func (c *AccessAnalyzer) ListFindingsRequest(input *ListFindingsInput) (req *request.Request, output *ListFindingsOutput) { + op := &request.Operation{ + Name: opListFindings, + HTTPMethod: "POST", + HTTPPath: "/finding", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListFindingsInput{} + } + + output = &ListFindingsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListFindings API operation for Access Analyzer. +// +// Retrieves a list of findings generated by the specified analyzer. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Access Analyzer's +// API operation ListFindings for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/ListFindings +func (c *AccessAnalyzer) ListFindings(input *ListFindingsInput) (*ListFindingsOutput, error) { + req, out := c.ListFindingsRequest(input) + return out, req.Send() +} + +// ListFindingsWithContext is the same as ListFindings with the addition of +// the ability to pass a context and additional request options. +// +// See ListFindings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) ListFindingsWithContext(ctx aws.Context, input *ListFindingsInput, opts ...request.Option) (*ListFindingsOutput, error) { + req, out := c.ListFindingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListFindingsPages iterates over the pages of a ListFindings operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListFindings 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 ListFindings operation. +// pageNum := 0 +// err := client.ListFindingsPages(params, +// func(page *accessanalyzer.ListFindingsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *AccessAnalyzer) ListFindingsPages(input *ListFindingsInput, fn func(*ListFindingsOutput, bool) bool) error { + return c.ListFindingsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListFindingsPagesWithContext same as ListFindingsPages 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 *AccessAnalyzer) ListFindingsPagesWithContext(ctx aws.Context, input *ListFindingsInput, fn func(*ListFindingsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListFindingsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListFindingsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListFindingsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/ListTagsForResource +func (c *AccessAnalyzer) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { + op := &request.Operation{ + Name: opListTagsForResource, + HTTPMethod: "GET", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &ListTagsForResourceInput{} + } + + output = &ListTagsForResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTagsForResource API operation for Access Analyzer. +// +// Retrieves a list of tags applied 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 Access Analyzer's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/ListTagsForResource +func (c *AccessAnalyzer) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartResourceScan = "StartResourceScan" + +// StartResourceScanRequest generates a "aws/request.Request" representing the +// client's request for the StartResourceScan operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartResourceScan for more information on using the StartResourceScan +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartResourceScanRequest method. +// req, resp := client.StartResourceScanRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/StartResourceScan +func (c *AccessAnalyzer) StartResourceScanRequest(input *StartResourceScanInput) (req *request.Request, output *StartResourceScanOutput) { + op := &request.Operation{ + Name: opStartResourceScan, + HTTPMethod: "POST", + HTTPPath: "/resource/scan", + } + + if input == nil { + input = &StartResourceScanInput{} + } + + output = &StartResourceScanOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StartResourceScan API operation for Access Analyzer. +// +// Immediately starts a scan of the policies applied 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 Access Analyzer's +// API operation StartResourceScan for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/StartResourceScan +func (c *AccessAnalyzer) StartResourceScan(input *StartResourceScanInput) (*StartResourceScanOutput, error) { + req, out := c.StartResourceScanRequest(input) + return out, req.Send() +} + +// StartResourceScanWithContext is the same as StartResourceScan with the addition of +// the ability to pass a context and additional request options. +// +// See StartResourceScan for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) StartResourceScanWithContext(ctx aws.Context, input *StartResourceScanInput, opts ...request.Option) (*StartResourceScanOutput, error) { + req, out := c.StartResourceScanRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/TagResource +func (c *AccessAnalyzer) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { + op := &request.Operation{ + Name: opTagResource, + HTTPMethod: "POST", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &TagResourceInput{} + } + + output = &TagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for Access Analyzer. +// +// Adds a tag 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 Access Analyzer's +// API operation TagResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/TagResource +func (c *AccessAnalyzer) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/UntagResource +func (c *AccessAnalyzer) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { + op := &request.Operation{ + Name: opUntagResource, + HTTPMethod: "DELETE", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &UntagResourceInput{} + } + + output = &UntagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for Access Analyzer. +// +// Removes a tag 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 Access Analyzer's +// API operation UntagResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/UntagResource +func (c *AccessAnalyzer) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateArchiveRule = "UpdateArchiveRule" + +// UpdateArchiveRuleRequest generates a "aws/request.Request" representing the +// client's request for the UpdateArchiveRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateArchiveRule for more information on using the UpdateArchiveRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateArchiveRuleRequest method. +// req, resp := client.UpdateArchiveRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/UpdateArchiveRule +func (c *AccessAnalyzer) UpdateArchiveRuleRequest(input *UpdateArchiveRuleInput) (req *request.Request, output *UpdateArchiveRuleOutput) { + op := &request.Operation{ + Name: opUpdateArchiveRule, + HTTPMethod: "PUT", + HTTPPath: "/analyzer/{analyzerName}/archive-rule/{ruleName}", + } + + if input == nil { + input = &UpdateArchiveRuleInput{} + } + + output = &UpdateArchiveRuleOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateArchiveRule API operation for Access Analyzer. +// +// Updates the criteria and values for the specified archive 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 Access Analyzer's +// API operation UpdateArchiveRule for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/UpdateArchiveRule +func (c *AccessAnalyzer) UpdateArchiveRule(input *UpdateArchiveRuleInput) (*UpdateArchiveRuleOutput, error) { + req, out := c.UpdateArchiveRuleRequest(input) + return out, req.Send() +} + +// UpdateArchiveRuleWithContext is the same as UpdateArchiveRule with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateArchiveRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) UpdateArchiveRuleWithContext(ctx aws.Context, input *UpdateArchiveRuleInput, opts ...request.Option) (*UpdateArchiveRuleOutput, error) { + req, out := c.UpdateArchiveRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateFindings = "UpdateFindings" + +// UpdateFindingsRequest generates a "aws/request.Request" representing the +// client's request for the UpdateFindings operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateFindings for more information on using the UpdateFindings +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateFindingsRequest method. +// req, resp := client.UpdateFindingsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/UpdateFindings +func (c *AccessAnalyzer) UpdateFindingsRequest(input *UpdateFindingsInput) (req *request.Request, output *UpdateFindingsOutput) { + op := &request.Operation{ + Name: opUpdateFindings, + HTTPMethod: "PUT", + HTTPPath: "/finding", + } + + if input == nil { + input = &UpdateFindingsInput{} + } + + output = &UpdateFindingsOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateFindings API operation for Access Analyzer. +// +// Updates the status for the specified 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 Access Analyzer's +// API operation UpdateFindings for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. +// +// * ValidationException +// Validation exception error. +// +// * InternalServerException +// Internal server error. +// +// * ThrottlingException +// Throttling limit exceeded error. +// +// * AccessDeniedException +// You do not have sufficient access to perform this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01/UpdateFindings +func (c *AccessAnalyzer) UpdateFindings(input *UpdateFindingsInput) (*UpdateFindingsOutput, error) { + req, out := c.UpdateFindingsRequest(input) + return out, req.Send() +} + +// UpdateFindingsWithContext is the same as UpdateFindings with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateFindings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AccessAnalyzer) UpdateFindingsWithContext(ctx aws.Context, input *UpdateFindingsInput, opts ...request.Option) (*UpdateFindingsOutput, error) { + req, out := c.UpdateFindingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// You do not have sufficient access to perform this action. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Contains details about the analyzed resource. +type AnalyzedResource struct { + _ struct{} `type:"structure"` + + // The actions that an external principal is granted permission to use by the + // policy that generated the finding. + Actions []*string `locationName:"actions" type:"list"` + + // The time at which the resource was analyzed. + // + // AnalyzedAt is a required field + AnalyzedAt *time.Time `locationName:"analyzedAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // The time at which the finding was created. + // + // CreatedAt is a required field + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // An error message. + Error *string `locationName:"error" type:"string"` + + // Indicates whether the policy that generated the finding grants public access + // to the resource. + // + // IsPublic is a required field + IsPublic *bool `locationName:"isPublic" type:"boolean" required:"true"` + + // The ARN of the resource that was analyzed. + // + // ResourceArn is a required field + ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"` + + // The type of the resource that was analyzed. + // + // ResourceType is a required field + ResourceType *string `locationName:"resourceType" type:"string" required:"true" enum:"ResourceType"` + + // Indicates how the access that generated the finding is granted. + SharedVia []*string `locationName:"sharedVia" type:"list"` + + // The current status of the finding generated from the analyzed resource. + Status *string `locationName:"status" type:"string" enum:"FindingStatus"` + + // The time at which the finding was updated. + // + // UpdatedAt is a required field + UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` +} + +// String returns the string representation +func (s AnalyzedResource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnalyzedResource) GoString() string { + return s.String() +} + +// SetActions sets the Actions field's value. +func (s *AnalyzedResource) SetActions(v []*string) *AnalyzedResource { + s.Actions = v + return s +} + +// SetAnalyzedAt sets the AnalyzedAt field's value. +func (s *AnalyzedResource) SetAnalyzedAt(v time.Time) *AnalyzedResource { + s.AnalyzedAt = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *AnalyzedResource) SetCreatedAt(v time.Time) *AnalyzedResource { + s.CreatedAt = &v + return s +} + +// SetError sets the Error field's value. +func (s *AnalyzedResource) SetError(v string) *AnalyzedResource { + s.Error = &v + return s +} + +// SetIsPublic sets the IsPublic field's value. +func (s *AnalyzedResource) SetIsPublic(v bool) *AnalyzedResource { + s.IsPublic = &v + return s +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *AnalyzedResource) SetResourceArn(v string) *AnalyzedResource { + s.ResourceArn = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *AnalyzedResource) SetResourceType(v string) *AnalyzedResource { + s.ResourceType = &v + return s +} + +// SetSharedVia sets the SharedVia field's value. +func (s *AnalyzedResource) SetSharedVia(v []*string) *AnalyzedResource { + s.SharedVia = v + return s +} + +// SetStatus sets the Status field's value. +func (s *AnalyzedResource) SetStatus(v string) *AnalyzedResource { + s.Status = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *AnalyzedResource) SetUpdatedAt(v time.Time) *AnalyzedResource { + s.UpdatedAt = &v + return s +} + +// Contains the ARN of the analyzed resource. +type AnalyzedResourceSummary struct { + _ struct{} `type:"structure"` + + // The ARN of the analyzed resource. + // + // ResourceArn is a required field + ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"` + + // The type of resource that was analyzed. + // + // ResourceType is a required field + ResourceType *string `locationName:"resourceType" type:"string" required:"true" enum:"ResourceType"` +} + +// String returns the string representation +func (s AnalyzedResourceSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnalyzedResourceSummary) GoString() string { + return s.String() +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *AnalyzedResourceSummary) SetResourceArn(v string) *AnalyzedResourceSummary { + s.ResourceArn = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *AnalyzedResourceSummary) SetResourceType(v string) *AnalyzedResourceSummary { + s.ResourceType = &v + return s +} + +// Contains information about the analyzer. +type AnalyzerSummary struct { + _ struct{} `type:"structure"` + + // The ARN of the analyzer. + // + // Arn is a required field + Arn *string `locationName:"arn" type:"string" required:"true"` + + // A timestamp for the time at which the analyzer was created. + // + // CreatedAt is a required field + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // The resource that was most recently analyzed by the analyzer. + LastResourceAnalyzed *string `locationName:"lastResourceAnalyzed" type:"string"` + + // The time at which the most recently analyzed resource was analyzed. + LastResourceAnalyzedAt *time.Time `locationName:"lastResourceAnalyzedAt" type:"timestamp" timestampFormat:"iso8601"` + + // The name of the analyzer. + // + // Name is a required field + Name *string `locationName:"name" min:"1" type:"string" required:"true"` + + // The tags added to the analyzer. + Tags map[string]*string `locationName:"tags" type:"map"` + + // The type of analyzer, which corresponds to the zone of trust chosen for the + // analyzer. + // + // Type is a required field + Type *string `locationName:"type" type:"string" required:"true" enum:"Type"` +} + +// String returns the string representation +func (s AnalyzerSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnalyzerSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *AnalyzerSummary) SetArn(v string) *AnalyzerSummary { + s.Arn = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *AnalyzerSummary) SetCreatedAt(v time.Time) *AnalyzerSummary { + s.CreatedAt = &v + return s +} + +// SetLastResourceAnalyzed sets the LastResourceAnalyzed field's value. +func (s *AnalyzerSummary) SetLastResourceAnalyzed(v string) *AnalyzerSummary { + s.LastResourceAnalyzed = &v + return s +} + +// SetLastResourceAnalyzedAt sets the LastResourceAnalyzedAt field's value. +func (s *AnalyzerSummary) SetLastResourceAnalyzedAt(v time.Time) *AnalyzerSummary { + s.LastResourceAnalyzedAt = &v + return s +} + +// SetName sets the Name field's value. +func (s *AnalyzerSummary) SetName(v string) *AnalyzerSummary { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *AnalyzerSummary) SetTags(v map[string]*string) *AnalyzerSummary { + s.Tags = v + return s +} + +// SetType sets the Type field's value. +func (s *AnalyzerSummary) SetType(v string) *AnalyzerSummary { + s.Type = &v + return s +} + +// Contains information about an archive rule. +type ArchiveRuleSummary struct { + _ struct{} `type:"structure"` + + // The time at which the archive rule was created. + // + // CreatedAt is a required field + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // A filter used to define the archive rule. + // + // Filter is a required field + Filter map[string]*Criterion `locationName:"filter" type:"map" required:"true"` + + // The name of the archive rule. + // + // RuleName is a required field + RuleName *string `locationName:"ruleName" min:"1" type:"string" required:"true"` + + // The time at which the archive rule was last updated. + // + // UpdatedAt is a required field + UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` +} + +// String returns the string representation +func (s ArchiveRuleSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ArchiveRuleSummary) GoString() string { + return s.String() +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *ArchiveRuleSummary) SetCreatedAt(v time.Time) *ArchiveRuleSummary { + s.CreatedAt = &v + return s +} + +// SetFilter sets the Filter field's value. +func (s *ArchiveRuleSummary) SetFilter(v map[string]*Criterion) *ArchiveRuleSummary { + s.Filter = v + return s +} + +// SetRuleName sets the RuleName field's value. +func (s *ArchiveRuleSummary) SetRuleName(v string) *ArchiveRuleSummary { + s.RuleName = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *ArchiveRuleSummary) SetUpdatedAt(v time.Time) *ArchiveRuleSummary { + s.UpdatedAt = &v + return s +} + +// A conflict exception error. +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + // The ID of the resource. + // + // 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"` +} + +// String returns the string representation +func (s ConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictException) GoString() string { + return s.String() +} + +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" +} + +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil +} + +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID +} + +// Creates an analyzer. +type CreateAnalyzerInput struct { + _ struct{} `type:"structure"` + + // The name of the analyzer to create. + // + // AnalyzerName is a required field + AnalyzerName *string `locationName:"analyzerName" min:"1" type:"string" required:"true"` + + // Specifies the archive rules to add for the analyzer. Archive rules automatically + // archive findings that meet the criteria you define for the rule. + ArchiveRules []*InlineArchiveRule `locationName:"archiveRules" type:"list"` + + // A client token. + ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` + + // The tags to apply to the analyzer. + Tags map[string]*string `locationName:"tags" type:"map"` + + // The type of analyzer to create. Only ACCOUNT analyzers are supported. You + // can create only one analyzer per account per Region. + // + // Type is a required field + Type *string `locationName:"type" type:"string" required:"true" enum:"Type"` +} + +// String returns the string representation +func (s CreateAnalyzerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAnalyzerInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateAnalyzerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateAnalyzerInput"} + if s.AnalyzerName == nil { + invalidParams.Add(request.NewErrParamRequired("AnalyzerName")) + } + if s.AnalyzerName != nil && len(*s.AnalyzerName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AnalyzerName", 1)) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + if s.ArchiveRules != nil { + for i, v := range s.ArchiveRules { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ArchiveRules", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnalyzerName sets the AnalyzerName field's value. +func (s *CreateAnalyzerInput) SetAnalyzerName(v string) *CreateAnalyzerInput { + s.AnalyzerName = &v + return s +} + +// SetArchiveRules sets the ArchiveRules field's value. +func (s *CreateAnalyzerInput) SetArchiveRules(v []*InlineArchiveRule) *CreateAnalyzerInput { + s.ArchiveRules = v + return s +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateAnalyzerInput) SetClientToken(v string) *CreateAnalyzerInput { + s.ClientToken = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateAnalyzerInput) SetTags(v map[string]*string) *CreateAnalyzerInput { + s.Tags = v + return s +} + +// SetType sets the Type field's value. +func (s *CreateAnalyzerInput) SetType(v string) *CreateAnalyzerInput { + s.Type = &v + return s +} + +// The response to the request to create an analyzer. +type CreateAnalyzerOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the analyzer that was created by the request. + Arn *string `locationName:"arn" type:"string"` +} + +// String returns the string representation +func (s CreateAnalyzerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAnalyzerOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateAnalyzerOutput) SetArn(v string) *CreateAnalyzerOutput { + s.Arn = &v + return s +} + +// Creates an archive rule. +type CreateArchiveRuleInput struct { + _ struct{} `type:"structure"` + + // The name of the created analyzer. + // + // AnalyzerName is a required field + AnalyzerName *string `location:"uri" locationName:"analyzerName" min:"1" type:"string" required:"true"` + + // A client token. + ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` + + // The criteria for the rule. + // + // Filter is a required field + Filter map[string]*Criterion `locationName:"filter" type:"map" required:"true"` + + // The name of the rule to create. + // + // RuleName is a required field + RuleName *string `locationName:"ruleName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateArchiveRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateArchiveRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateArchiveRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateArchiveRuleInput"} + if s.AnalyzerName == nil { + invalidParams.Add(request.NewErrParamRequired("AnalyzerName")) + } + if s.AnalyzerName != nil && len(*s.AnalyzerName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AnalyzerName", 1)) + } + if s.Filter == nil { + invalidParams.Add(request.NewErrParamRequired("Filter")) + } + if s.RuleName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleName")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + if s.Filter != nil { + for i, v := range s.Filter { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filter", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnalyzerName sets the AnalyzerName field's value. +func (s *CreateArchiveRuleInput) SetAnalyzerName(v string) *CreateArchiveRuleInput { + s.AnalyzerName = &v + return s +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateArchiveRuleInput) SetClientToken(v string) *CreateArchiveRuleInput { + s.ClientToken = &v + return s +} + +// SetFilter sets the Filter field's value. +func (s *CreateArchiveRuleInput) SetFilter(v map[string]*Criterion) *CreateArchiveRuleInput { + s.Filter = v + return s +} + +// SetRuleName sets the RuleName field's value. +func (s *CreateArchiveRuleInput) SetRuleName(v string) *CreateArchiveRuleInput { + s.RuleName = &v + return s +} + +type CreateArchiveRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CreateArchiveRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateArchiveRuleOutput) GoString() string { + return s.String() +} + +// The criteria to use in the filter that defines the archive rule. +type Criterion struct { + _ struct{} `type:"structure"` + + // A "contains" operator to match for the filter used to create the rule. + Contains []*string `locationName:"contains" min:"1" type:"list"` + + // An "equals" operator to match for the filter used to create the rule. + Eq []*string `locationName:"eq" min:"1" type:"list"` + + // An "exists" operator to match for the filter used to create the rule. + Exists *bool `locationName:"exists" type:"boolean"` + + // A "not equals" operator to match for the filter used to create the rule. + Neq []*string `locationName:"neq" min:"1" type:"list"` +} + +// String returns the string representation +func (s Criterion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Criterion) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Criterion) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Criterion"} + if s.Contains != nil && len(s.Contains) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Contains", 1)) + } + if s.Eq != nil && len(s.Eq) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Eq", 1)) + } + if s.Neq != nil && len(s.Neq) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Neq", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetContains sets the Contains field's value. +func (s *Criterion) SetContains(v []*string) *Criterion { + s.Contains = v + return s +} + +// SetEq sets the Eq field's value. +func (s *Criterion) SetEq(v []*string) *Criterion { + s.Eq = v + return s +} + +// SetExists sets the Exists field's value. +func (s *Criterion) SetExists(v bool) *Criterion { + s.Exists = &v + return s +} + +// SetNeq sets the Neq field's value. +func (s *Criterion) SetNeq(v []*string) *Criterion { + s.Neq = v + return s +} + +// Deletes an analyzer. +type DeleteAnalyzerInput struct { + _ struct{} `type:"structure"` + + // The name of the analyzer to delete. + // + // AnalyzerName is a required field + AnalyzerName *string `location:"uri" locationName:"analyzerName" min:"1" type:"string" required:"true"` + + // A client token. + ClientToken *string `location:"querystring" locationName:"clientToken" type:"string" idempotencyToken:"true"` +} + +// String returns the string representation +func (s DeleteAnalyzerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAnalyzerInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteAnalyzerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteAnalyzerInput"} + if s.AnalyzerName == nil { + invalidParams.Add(request.NewErrParamRequired("AnalyzerName")) + } + if s.AnalyzerName != nil && len(*s.AnalyzerName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AnalyzerName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnalyzerName sets the AnalyzerName field's value. +func (s *DeleteAnalyzerInput) SetAnalyzerName(v string) *DeleteAnalyzerInput { + s.AnalyzerName = &v + return s +} + +// SetClientToken sets the ClientToken field's value. +func (s *DeleteAnalyzerInput) SetClientToken(v string) *DeleteAnalyzerInput { + s.ClientToken = &v + return s +} + +type DeleteAnalyzerOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteAnalyzerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAnalyzerOutput) GoString() string { + return s.String() +} + +// Deletes an archive rule. +type DeleteArchiveRuleInput struct { + _ struct{} `type:"structure"` + + // The name of the analyzer that associated with the archive rule to delete. + // + // AnalyzerName is a required field + AnalyzerName *string `location:"uri" locationName:"analyzerName" min:"1" type:"string" required:"true"` + + // A client token. + ClientToken *string `location:"querystring" locationName:"clientToken" type:"string" idempotencyToken:"true"` + + // The name of the rule to delete. + // + // RuleName is a required field + RuleName *string `location:"uri" locationName:"ruleName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteArchiveRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteArchiveRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteArchiveRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteArchiveRuleInput"} + if s.AnalyzerName == nil { + invalidParams.Add(request.NewErrParamRequired("AnalyzerName")) + } + if s.AnalyzerName != nil && len(*s.AnalyzerName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AnalyzerName", 1)) + } + if s.RuleName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleName")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnalyzerName sets the AnalyzerName field's value. +func (s *DeleteArchiveRuleInput) SetAnalyzerName(v string) *DeleteArchiveRuleInput { + s.AnalyzerName = &v + return s +} + +// SetClientToken sets the ClientToken field's value. +func (s *DeleteArchiveRuleInput) SetClientToken(v string) *DeleteArchiveRuleInput { + s.ClientToken = &v + return s +} + +// SetRuleName sets the RuleName field's value. +func (s *DeleteArchiveRuleInput) SetRuleName(v string) *DeleteArchiveRuleInput { + s.RuleName = &v + return s +} + +type DeleteArchiveRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteArchiveRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteArchiveRuleOutput) GoString() string { + return s.String() +} + +// Contains information about a finding. +type Finding struct { + _ struct{} `type:"structure"` + + // The action in the analyzed policy statement that an external principal has + // permission to use. + Action []*string `locationName:"action" type:"list"` + + // The time at which the resource was analyzed. + // + // AnalyzedAt is a required field + AnalyzedAt *time.Time `locationName:"analyzedAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // The condition in the analyzed policy statement that resulted in a finding. + // + // Condition is a required field + Condition map[string]*string `locationName:"condition" type:"map" required:"true"` + + // The time at which the finding was generated. + // + // CreatedAt is a required field + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // An error. + Error *string `locationName:"error" type:"string"` + + // The ID of the finding. + // + // Id is a required field + Id *string `locationName:"id" type:"string" required:"true"` + + // Indicates whether the policy that generated the finding allows public access + // to the resource. + IsPublic *bool `locationName:"isPublic" type:"boolean"` + + // The external principal that access to a resource within the zone of trust. + Principal map[string]*string `locationName:"principal" type:"map"` + + // The resource that an external principal has access to. + Resource *string `locationName:"resource" type:"string"` + + // The type of the resource reported in the finding. + // + // ResourceType is a required field + ResourceType *string `locationName:"resourceType" type:"string" required:"true" enum:"ResourceType"` + + // The current status of the finding. + // + // Status is a required field + Status *string `locationName:"status" type:"string" required:"true" enum:"FindingStatus"` + + // The time at which the finding was updated. + // + // UpdatedAt is a required field + UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" 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() +} + +// SetAction sets the Action field's value. +func (s *Finding) SetAction(v []*string) *Finding { + s.Action = v + return s +} + +// SetAnalyzedAt sets the AnalyzedAt field's value. +func (s *Finding) SetAnalyzedAt(v time.Time) *Finding { + s.AnalyzedAt = &v + return s +} + +// SetCondition sets the Condition field's value. +func (s *Finding) SetCondition(v map[string]*string) *Finding { + s.Condition = v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *Finding) SetCreatedAt(v time.Time) *Finding { + s.CreatedAt = &v + return s +} + +// SetError sets the Error field's value. +func (s *Finding) SetError(v string) *Finding { + s.Error = &v + return s +} + +// SetId sets the Id field's value. +func (s *Finding) SetId(v string) *Finding { + s.Id = &v + return s +} + +// SetIsPublic sets the IsPublic field's value. +func (s *Finding) SetIsPublic(v bool) *Finding { + s.IsPublic = &v + return s +} + +// SetPrincipal sets the Principal field's value. +func (s *Finding) SetPrincipal(v map[string]*string) *Finding { + s.Principal = v + return s +} + +// SetResource sets the Resource field's value. +func (s *Finding) SetResource(v string) *Finding { + s.Resource = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *Finding) SetResourceType(v string) *Finding { + s.ResourceType = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *Finding) SetStatus(v string) *Finding { + s.Status = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *Finding) SetUpdatedAt(v time.Time) *Finding { + s.UpdatedAt = &v + return s +} + +// Contains information about a finding. +type FindingSummary struct { + _ struct{} `type:"structure"` + + // The action in the analyzed policy statement that an external principal has + // permission to use. + Action []*string `locationName:"action" type:"list"` + + // The time at which the resource-based policy that generated the finding was + // analyzed. + // + // AnalyzedAt is a required field + AnalyzedAt *time.Time `locationName:"analyzedAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // The condition in the analyzed policy statement that resulted in a finding. + // + // Condition is a required field + Condition map[string]*string `locationName:"condition" type:"map" required:"true"` + + // The time at which the finding was created. + // + // CreatedAt is a required field + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // The error that resulted in an Error finding. + Error *string `locationName:"error" type:"string"` + + // The ID of the finding. + // + // Id is a required field + Id *string `locationName:"id" type:"string" required:"true"` + + // Indicates whether the finding reports a resource that has a policy that allows + // public access. + IsPublic *bool `locationName:"isPublic" type:"boolean"` + + // The external principal that has access to a resource within the zone of trust. + Principal map[string]*string `locationName:"principal" type:"map"` + + // The resource that the external principal has access to. + Resource *string `locationName:"resource" type:"string"` + + // The type of the resource that the external principal has access to. + // + // ResourceType is a required field + ResourceType *string `locationName:"resourceType" type:"string" required:"true" enum:"ResourceType"` + + // The status of the finding. + // + // Status is a required field + Status *string `locationName:"status" type:"string" required:"true" enum:"FindingStatus"` + + // The time at which the finding was most recently updated. + // + // UpdatedAt is a required field + UpdatedAt *time.Time `locationName:"updatedAt" type:"timestamp" timestampFormat:"iso8601" required:"true"` +} + +// String returns the string representation +func (s FindingSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FindingSummary) GoString() string { + return s.String() +} + +// SetAction sets the Action field's value. +func (s *FindingSummary) SetAction(v []*string) *FindingSummary { + s.Action = v + return s +} + +// SetAnalyzedAt sets the AnalyzedAt field's value. +func (s *FindingSummary) SetAnalyzedAt(v time.Time) *FindingSummary { + s.AnalyzedAt = &v + return s +} + +// SetCondition sets the Condition field's value. +func (s *FindingSummary) SetCondition(v map[string]*string) *FindingSummary { + s.Condition = v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *FindingSummary) SetCreatedAt(v time.Time) *FindingSummary { + s.CreatedAt = &v + return s +} + +// SetError sets the Error field's value. +func (s *FindingSummary) SetError(v string) *FindingSummary { + s.Error = &v + return s +} + +// SetId sets the Id field's value. +func (s *FindingSummary) SetId(v string) *FindingSummary { + s.Id = &v + return s +} + +// SetIsPublic sets the IsPublic field's value. +func (s *FindingSummary) SetIsPublic(v bool) *FindingSummary { + s.IsPublic = &v + return s +} + +// SetPrincipal sets the Principal field's value. +func (s *FindingSummary) SetPrincipal(v map[string]*string) *FindingSummary { + s.Principal = v + return s +} + +// SetResource sets the Resource field's value. +func (s *FindingSummary) SetResource(v string) *FindingSummary { + s.Resource = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *FindingSummary) SetResourceType(v string) *FindingSummary { + s.ResourceType = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *FindingSummary) SetStatus(v string) *FindingSummary { + s.Status = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *FindingSummary) SetUpdatedAt(v time.Time) *FindingSummary { + s.UpdatedAt = &v + return s +} + +// Retrieves an analyzed resource. +type GetAnalyzedResourceInput struct { + _ struct{} `type:"structure"` + + // The ARN of the analyzer to retrieve information from. + // + // AnalyzerArn is a required field + AnalyzerArn *string `location:"querystring" locationName:"analyzerArn" type:"string" required:"true"` + + // The ARN of the resource to retrieve information about. + // + // ResourceArn is a required field + ResourceArn *string `location:"querystring" locationName:"resourceArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetAnalyzedResourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAnalyzedResourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAnalyzedResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAnalyzedResourceInput"} + if s.AnalyzerArn == nil { + invalidParams.Add(request.NewErrParamRequired("AnalyzerArn")) + } + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnalyzerArn sets the AnalyzerArn field's value. +func (s *GetAnalyzedResourceInput) SetAnalyzerArn(v string) *GetAnalyzedResourceInput { + s.AnalyzerArn = &v + return s +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *GetAnalyzedResourceInput) SetResourceArn(v string) *GetAnalyzedResourceInput { + s.ResourceArn = &v + return s +} + +// The response to the request. +type GetAnalyzedResourceOutput struct { + _ struct{} `type:"structure"` + + // An AnalyedResource object that contains information that Access Analyzer + // found when it analyzed the resource. + Resource *AnalyzedResource `locationName:"resource" type:"structure"` +} + +// String returns the string representation +func (s GetAnalyzedResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAnalyzedResourceOutput) GoString() string { + return s.String() +} + +// SetResource sets the Resource field's value. +func (s *GetAnalyzedResourceOutput) SetResource(v *AnalyzedResource) *GetAnalyzedResourceOutput { + s.Resource = v + return s +} + +// Retrieves an analyzer. +type GetAnalyzerInput struct { + _ struct{} `type:"structure"` + + // The name of the analyzer retrieved. + // + // AnalyzerName is a required field + AnalyzerName *string `location:"uri" locationName:"analyzerName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetAnalyzerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAnalyzerInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAnalyzerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAnalyzerInput"} + if s.AnalyzerName == nil { + invalidParams.Add(request.NewErrParamRequired("AnalyzerName")) + } + if s.AnalyzerName != nil && len(*s.AnalyzerName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AnalyzerName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnalyzerName sets the AnalyzerName field's value. +func (s *GetAnalyzerInput) SetAnalyzerName(v string) *GetAnalyzerInput { + s.AnalyzerName = &v + return s +} + +// The response to the request. +type GetAnalyzerOutput struct { + _ struct{} `type:"structure"` + + // An AnalyzerSummary object that contains information about the analyzer. + // + // Analyzer is a required field + Analyzer *AnalyzerSummary `locationName:"analyzer" type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetAnalyzerOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAnalyzerOutput) GoString() string { + return s.String() +} + +// SetAnalyzer sets the Analyzer field's value. +func (s *GetAnalyzerOutput) SetAnalyzer(v *AnalyzerSummary) *GetAnalyzerOutput { + s.Analyzer = v + return s +} + +// Retrieves an archive rule. +type GetArchiveRuleInput struct { + _ struct{} `type:"structure"` + + // The name of the analyzer to retrieve rules from. + // + // AnalyzerName is a required field + AnalyzerName *string `location:"uri" locationName:"analyzerName" min:"1" type:"string" required:"true"` + + // The name of the rule to retrieve. + // + // RuleName is a required field + RuleName *string `location:"uri" locationName:"ruleName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetArchiveRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetArchiveRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetArchiveRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetArchiveRuleInput"} + if s.AnalyzerName == nil { + invalidParams.Add(request.NewErrParamRequired("AnalyzerName")) + } + if s.AnalyzerName != nil && len(*s.AnalyzerName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AnalyzerName", 1)) + } + if s.RuleName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleName")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnalyzerName sets the AnalyzerName field's value. +func (s *GetArchiveRuleInput) SetAnalyzerName(v string) *GetArchiveRuleInput { + s.AnalyzerName = &v + return s +} + +// SetRuleName sets the RuleName field's value. +func (s *GetArchiveRuleInput) SetRuleName(v string) *GetArchiveRuleInput { + s.RuleName = &v + return s +} + +// The response to the request. +type GetArchiveRuleOutput struct { + _ struct{} `type:"structure"` + + // Contains information about an archive rule. + // + // ArchiveRule is a required field + ArchiveRule *ArchiveRuleSummary `locationName:"archiveRule" type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetArchiveRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetArchiveRuleOutput) GoString() string { + return s.String() +} + +// SetArchiveRule sets the ArchiveRule field's value. +func (s *GetArchiveRuleOutput) SetArchiveRule(v *ArchiveRuleSummary) *GetArchiveRuleOutput { + s.ArchiveRule = v + return s +} + +// Retrieves a finding. +type GetFindingInput struct { + _ struct{} `type:"structure"` + + // The ARN of the analyzer that generated the finding. + // + // AnalyzerArn is a required field + AnalyzerArn *string `location:"querystring" locationName:"analyzerArn" type:"string" required:"true"` + + // The ID of the finding to retrieve. + // + // Id is a required field + Id *string `location:"uri" locationName:"id" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetFindingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFindingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetFindingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetFindingInput"} + if s.AnalyzerArn == nil { + invalidParams.Add(request.NewErrParamRequired("AnalyzerArn")) + } + 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 +} + +// SetAnalyzerArn sets the AnalyzerArn field's value. +func (s *GetFindingInput) SetAnalyzerArn(v string) *GetFindingInput { + s.AnalyzerArn = &v + return s +} + +// SetId sets the Id field's value. +func (s *GetFindingInput) SetId(v string) *GetFindingInput { + s.Id = &v + return s +} + +// The response to the request. +type GetFindingOutput struct { + _ struct{} `type:"structure"` + + // A finding object that contains finding details. + Finding *Finding `locationName:"finding" type:"structure"` +} + +// String returns the string representation +func (s GetFindingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFindingOutput) GoString() string { + return s.String() +} + +// SetFinding sets the Finding field's value. +func (s *GetFindingOutput) SetFinding(v *Finding) *GetFindingOutput { + s.Finding = v + return s +} + +// An criterion statement in an archive rule. Each archive rule may have multiple +// criteria. +type InlineArchiveRule struct { + _ struct{} `type:"structure"` + + // The condition and values for a criterion. + // + // Filter is a required field + Filter map[string]*Criterion `locationName:"filter" type:"map" required:"true"` + + // The name of the rule. + // + // RuleName is a required field + RuleName *string `locationName:"ruleName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s InlineArchiveRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InlineArchiveRule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *InlineArchiveRule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InlineArchiveRule"} + if s.Filter == nil { + invalidParams.Add(request.NewErrParamRequired("Filter")) + } + if s.RuleName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleName")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + if s.Filter != nil { + for i, v := range s.Filter { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filter", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFilter sets the Filter field's value. +func (s *InlineArchiveRule) SetFilter(v map[string]*Criterion) *InlineArchiveRule { + s.Filter = v + return s +} + +// SetRuleName sets the RuleName field's value. +func (s *InlineArchiveRule) SetRuleName(v string) *InlineArchiveRule { + s.RuleName = &v + return s +} + +// Internal server error. +type InternalServerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + // The seconds to wait to retry. + RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" type:"integer"` +} + +// String returns the string representation +func (s InternalServerException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerException) GoString() string { + return s.String() +} + +func newErrorInternalServerException(v protocol.ResponseMetadata) error { + return &InternalServerException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerException) Code() string { + return "InternalServerException" +} + +// Message returns the exception's message. +func (s InternalServerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerException) OrigErr() error { + return nil +} + +func (s InternalServerException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerException) RequestID() string { + return s.respMetadata.RequestID +} + +// Retrieves a list of resources that have been analyzed. +type ListAnalyzedResourcesInput struct { + _ struct{} `type:"structure"` + + // The ARN of the analyzer to retrieve a list of analyzed resources from. + // + // AnalyzerArn is a required field + AnalyzerArn *string `locationName:"analyzerArn" type:"string" required:"true"` + + // The maximum number of results to return in the response. + MaxResults *int64 `locationName:"maxResults" type:"integer"` + + // A token used for pagination of results returned. + NextToken *string `locationName:"nextToken" type:"string"` + + // The type of resource. + ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` +} + +// String returns the string representation +func (s ListAnalyzedResourcesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAnalyzedResourcesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListAnalyzedResourcesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAnalyzedResourcesInput"} + if s.AnalyzerArn == nil { + invalidParams.Add(request.NewErrParamRequired("AnalyzerArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnalyzerArn sets the AnalyzerArn field's value. +func (s *ListAnalyzedResourcesInput) SetAnalyzerArn(v string) *ListAnalyzedResourcesInput { + s.AnalyzerArn = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListAnalyzedResourcesInput) SetMaxResults(v int64) *ListAnalyzedResourcesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListAnalyzedResourcesInput) SetNextToken(v string) *ListAnalyzedResourcesInput { + s.NextToken = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ListAnalyzedResourcesInput) SetResourceType(v string) *ListAnalyzedResourcesInput { + s.ResourceType = &v + return s +} + +// The response to the request. +type ListAnalyzedResourcesOutput struct { + _ struct{} `type:"structure"` + + // A list of resources that were analyzed. + // + // AnalyzedResources is a required field + AnalyzedResources []*AnalyzedResourceSummary `locationName:"analyzedResources" type:"list" required:"true"` + + // A token used for pagination of results returned. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListAnalyzedResourcesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAnalyzedResourcesOutput) GoString() string { + return s.String() +} + +// SetAnalyzedResources sets the AnalyzedResources field's value. +func (s *ListAnalyzedResourcesOutput) SetAnalyzedResources(v []*AnalyzedResourceSummary) *ListAnalyzedResourcesOutput { + s.AnalyzedResources = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListAnalyzedResourcesOutput) SetNextToken(v string) *ListAnalyzedResourcesOutput { + s.NextToken = &v + return s +} + +// Retrieves a list of analyzers. +type ListAnalyzersInput struct { + _ struct{} `type:"structure"` + + // The maximum number of results to return in the response. + MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"` + + // A token used for pagination of results returned. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + + // The type of analyzer. + Type *string `location:"querystring" locationName:"type" type:"string" enum:"Type"` +} + +// String returns the string representation +func (s ListAnalyzersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAnalyzersInput) GoString() string { + return s.String() +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListAnalyzersInput) SetMaxResults(v int64) *ListAnalyzersInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListAnalyzersInput) SetNextToken(v string) *ListAnalyzersInput { + s.NextToken = &v + return s +} + +// SetType sets the Type field's value. +func (s *ListAnalyzersInput) SetType(v string) *ListAnalyzersInput { + s.Type = &v + return s +} + +// The response to the request. +type ListAnalyzersOutput struct { + _ struct{} `type:"structure"` + + // The analyzers retrieved. + // + // Analyzers is a required field + Analyzers []*AnalyzerSummary `locationName:"analyzers" type:"list" required:"true"` + + // A token used for pagination of results returned. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListAnalyzersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAnalyzersOutput) GoString() string { + return s.String() +} + +// SetAnalyzers sets the Analyzers field's value. +func (s *ListAnalyzersOutput) SetAnalyzers(v []*AnalyzerSummary) *ListAnalyzersOutput { + s.Analyzers = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListAnalyzersOutput) SetNextToken(v string) *ListAnalyzersOutput { + s.NextToken = &v + return s +} + +// Retrieves a list of archive rules created for the specified analyzer. +type ListArchiveRulesInput struct { + _ struct{} `type:"structure"` + + // The name of the analyzer to retrieve rules from. + // + // AnalyzerName is a required field + AnalyzerName *string `location:"uri" locationName:"analyzerName" min:"1" type:"string" required:"true"` + + // The maximum number of results to return in the request. + MaxResults *int64 `location:"querystring" locationName:"maxResults" type:"integer"` + + // A token used for pagination of results returned. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListArchiveRulesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListArchiveRulesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListArchiveRulesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListArchiveRulesInput"} + if s.AnalyzerName == nil { + invalidParams.Add(request.NewErrParamRequired("AnalyzerName")) + } + if s.AnalyzerName != nil && len(*s.AnalyzerName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AnalyzerName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnalyzerName sets the AnalyzerName field's value. +func (s *ListArchiveRulesInput) SetAnalyzerName(v string) *ListArchiveRulesInput { + s.AnalyzerName = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListArchiveRulesInput) SetMaxResults(v int64) *ListArchiveRulesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListArchiveRulesInput) SetNextToken(v string) *ListArchiveRulesInput { + s.NextToken = &v + return s +} + +// The response to the request. +type ListArchiveRulesOutput struct { + _ struct{} `type:"structure"` + + // A list of archive rules created for the specified analyzer. + // + // ArchiveRules is a required field + ArchiveRules []*ArchiveRuleSummary `locationName:"archiveRules" type:"list" required:"true"` + + // A token used for pagination of results returned. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListArchiveRulesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListArchiveRulesOutput) GoString() string { + return s.String() +} + +// SetArchiveRules sets the ArchiveRules field's value. +func (s *ListArchiveRulesOutput) SetArchiveRules(v []*ArchiveRuleSummary) *ListArchiveRulesOutput { + s.ArchiveRules = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListArchiveRulesOutput) SetNextToken(v string) *ListArchiveRulesOutput { + s.NextToken = &v + return s +} + +// Retrieves a list of findings generated by the specified analyzer. +type ListFindingsInput struct { + _ struct{} `type:"structure"` + + // The ARN of the analyzer to retrieve findings from. + // + // AnalyzerArn is a required field + AnalyzerArn *string `locationName:"analyzerArn" type:"string" required:"true"` + + // A filter to match for the findings to return. + Filter map[string]*Criterion `locationName:"filter" type:"map"` + + // The maximum number of results to return in the response. + MaxResults *int64 `locationName:"maxResults" type:"integer"` + + // A token used for pagination of results returned. + NextToken *string `locationName:"nextToken" type:"string"` + + // The sort order for the findings returned. + Sort *SortCriteria `locationName:"sort" type:"structure"` +} + +// 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.AnalyzerArn == nil { + invalidParams.Add(request.NewErrParamRequired("AnalyzerArn")) + } + if s.Filter != nil { + for i, v := range s.Filter { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filter", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnalyzerArn sets the AnalyzerArn field's value. +func (s *ListFindingsInput) SetAnalyzerArn(v string) *ListFindingsInput { + s.AnalyzerArn = &v + return s +} + +// SetFilter sets the Filter field's value. +func (s *ListFindingsInput) SetFilter(v map[string]*Criterion) *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 +} + +// SetSort sets the Sort field's value. +func (s *ListFindingsInput) SetSort(v *SortCriteria) *ListFindingsInput { + s.Sort = v + return s +} + +// The response to the request. +type ListFindingsOutput struct { + _ struct{} `type:"structure"` + + // A list of findings retrieved from the analyzer that match the filter criteria + // specified, if any. + // + // Findings is a required field + Findings []*FindingSummary `locationName:"findings" type:"list" required:"true"` + + // A token used for pagination of results returned. + NextToken *string `locationName:"nextToken" 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() +} + +// SetFindings sets the Findings field's value. +func (s *ListFindingsOutput) SetFindings(v []*FindingSummary) *ListFindingsOutput { + s.Findings = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListFindingsOutput) SetNextToken(v string) *ListFindingsOutput { + s.NextToken = &v + return s +} + +// Retrieves a list of tags applied to the specified resource. +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // The ARN of the resource to retrieve tags from. + // + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resourceArn" 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 +} + +// The response to the request. +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // The tags that are applied to the specified resource. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// 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 map[string]*string) *ListTagsForResourceOutput { + s.Tags = v + return s +} + +// The specified resource could not be found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + // The ID of the resource. + // + // ResourceId is a required field + ResourceId *string `locationName:"resourceId" type:"string" required:"true"` + + // The type of the resource. + // + // ResourceType is a required field + ResourceType *string `locationName:"resourceType" type:"string" required:"true"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Service quote met error. +type ServiceQuotaExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + // The resource ID. + // + // 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"` +} + +// String returns the string representation +func (s ServiceQuotaExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceQuotaExceededException) GoString() string { + return s.String() +} + +func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { + return &ServiceQuotaExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceQuotaExceededException) Code() string { + return "ServiceQuotaExceededException" +} + +// Message returns the exception's message. +func (s ServiceQuotaExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceQuotaExceededException) OrigErr() error { + return nil +} + +func (s ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceQuotaExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceQuotaExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The criteria used to sort. +type SortCriteria struct { + _ struct{} `type:"structure"` + + // The name of the attribute to sort on. + AttributeName *string `locationName:"attributeName" type:"string"` + + // The sort order, ascending or descending. + OrderBy *string `locationName:"orderBy" type:"string" enum:"OrderBy"` +} + +// String returns the string representation +func (s SortCriteria) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SortCriteria) GoString() string { + return s.String() +} + +// SetAttributeName sets the AttributeName field's value. +func (s *SortCriteria) SetAttributeName(v string) *SortCriteria { + s.AttributeName = &v + return s +} + +// SetOrderBy sets the OrderBy field's value. +func (s *SortCriteria) SetOrderBy(v string) *SortCriteria { + s.OrderBy = &v + return s +} + +// Starts a scan of the policies applied to the specified resource. +type StartResourceScanInput struct { + _ struct{} `type:"structure"` + + // The ARN of the analyzer to use to scan the policies applied to the specified + // resource. + // + // AnalyzerArn is a required field + AnalyzerArn *string `locationName:"analyzerArn" type:"string" required:"true"` + + // The ARN of the resource to scan. + // + // ResourceArn is a required field + ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s StartResourceScanInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartResourceScanInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartResourceScanInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartResourceScanInput"} + if s.AnalyzerArn == nil { + invalidParams.Add(request.NewErrParamRequired("AnalyzerArn")) + } + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnalyzerArn sets the AnalyzerArn field's value. +func (s *StartResourceScanInput) SetAnalyzerArn(v string) *StartResourceScanInput { + s.AnalyzerArn = &v + return s +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *StartResourceScanInput) SetResourceArn(v string) *StartResourceScanInput { + s.ResourceArn = &v + return s +} + +type StartResourceScanOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s StartResourceScanOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartResourceScanOutput) GoString() string { + return s.String() +} + +// Adds a tag to the specified resource. +type TagResourceInput struct { + _ struct{} `type:"structure"` + + // The ARN of the resource to add the tag to. + // + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` + + // The tags to add to the resource. + // + // Tags is a required field + Tags map[string]*string `locationName:"tags" type:"map" 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 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 map[string]*string) *TagResourceInput { + s.Tags = v + return s +} + +// The response to the request. +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() +} + +// Throttling limit exceeded error. +type ThrottlingException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + // The seconds to wait to retry. + RetryAfterSeconds *int64 `location:"header" locationName:"Retry-After" type:"integer"` +} + +// String returns the string representation +func (s ThrottlingException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ThrottlingException) GoString() string { + return s.String() +} + +func newErrorThrottlingException(v protocol.ResponseMetadata) error { + return &ThrottlingException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ThrottlingException) Code() string { + return "ThrottlingException" +} + +// Message returns the exception's message. +func (s ThrottlingException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ThrottlingException) OrigErr() error { + return nil +} + +func (s ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ThrottlingException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ThrottlingException) RequestID() string { + return s.respMetadata.RequestID +} + +// Removes a tag from the specified resource. +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // The ARN of the resource to remove the tag from. + // + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` + + // The key for the tag to add. + // + // TagKeys is a required field + TagKeys []*string `location:"querystring" locationName:"tagKeys" 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 +} + +// The response to the request. +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() +} + +// Updates the specified archive rule. +type UpdateArchiveRuleInput struct { + _ struct{} `type:"structure"` + + // The name of the analyzer to update the archive rules for. + // + // AnalyzerName is a required field + AnalyzerName *string `location:"uri" locationName:"analyzerName" min:"1" type:"string" required:"true"` + + // A client token. + ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` + + // A filter to match for the rules to update. Only rules that match the filter + // are updated. + // + // Filter is a required field + Filter map[string]*Criterion `locationName:"filter" type:"map" required:"true"` + + // The name of the rule to update. + // + // RuleName is a required field + RuleName *string `location:"uri" locationName:"ruleName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateArchiveRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateArchiveRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateArchiveRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateArchiveRuleInput"} + if s.AnalyzerName == nil { + invalidParams.Add(request.NewErrParamRequired("AnalyzerName")) + } + if s.AnalyzerName != nil && len(*s.AnalyzerName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AnalyzerName", 1)) + } + if s.Filter == nil { + invalidParams.Add(request.NewErrParamRequired("Filter")) + } + if s.RuleName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleName")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + if s.Filter != nil { + for i, v := range s.Filter { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Filter", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnalyzerName sets the AnalyzerName field's value. +func (s *UpdateArchiveRuleInput) SetAnalyzerName(v string) *UpdateArchiveRuleInput { + s.AnalyzerName = &v + return s +} + +// SetClientToken sets the ClientToken field's value. +func (s *UpdateArchiveRuleInput) SetClientToken(v string) *UpdateArchiveRuleInput { + s.ClientToken = &v + return s +} + +// SetFilter sets the Filter field's value. +func (s *UpdateArchiveRuleInput) SetFilter(v map[string]*Criterion) *UpdateArchiveRuleInput { + s.Filter = v + return s +} + +// SetRuleName sets the RuleName field's value. +func (s *UpdateArchiveRuleInput) SetRuleName(v string) *UpdateArchiveRuleInput { + s.RuleName = &v + return s +} + +type UpdateArchiveRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateArchiveRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateArchiveRuleOutput) GoString() string { + return s.String() +} + +// Updates findings with the new values provided in the request. +type UpdateFindingsInput struct { + _ struct{} `type:"structure"` + + // The ARN of the analyzer that generated the findings to update. + // + // AnalyzerArn is a required field + AnalyzerArn *string `locationName:"analyzerArn" type:"string" required:"true"` + + // A client token. + ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` + + // The IDs of the findings to update. + Ids []*string `locationName:"ids" type:"list"` + + // The ARN of the resource identified in the finding. + ResourceArn *string `locationName:"resourceArn" type:"string"` + + // The state represents the action to take to update the finding Status. Use + // ARCHIVE to change an Active finding to an Archived finding. Use ACTIVE to + // change an Archived finding to an Active finding. + // + // Status is a required field + Status *string `locationName:"status" type:"string" required:"true" enum:"FindingStatusUpdate"` +} + +// String returns the string representation +func (s UpdateFindingsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateFindingsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateFindingsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateFindingsInput"} + if s.AnalyzerArn == nil { + invalidParams.Add(request.NewErrParamRequired("AnalyzerArn")) + } + if s.Status == nil { + invalidParams.Add(request.NewErrParamRequired("Status")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnalyzerArn sets the AnalyzerArn field's value. +func (s *UpdateFindingsInput) SetAnalyzerArn(v string) *UpdateFindingsInput { + s.AnalyzerArn = &v + return s +} + +// SetClientToken sets the ClientToken field's value. +func (s *UpdateFindingsInput) SetClientToken(v string) *UpdateFindingsInput { + s.ClientToken = &v + return s +} + +// SetIds sets the Ids field's value. +func (s *UpdateFindingsInput) SetIds(v []*string) *UpdateFindingsInput { + s.Ids = v + return s +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *UpdateFindingsInput) SetResourceArn(v string) *UpdateFindingsInput { + s.ResourceArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *UpdateFindingsInput) SetStatus(v string) *UpdateFindingsInput { + s.Status = &v + return s +} + +type UpdateFindingsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateFindingsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateFindingsOutput) GoString() string { + return s.String() +} + +// Validation exception error. +type ValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A list of fields that didn't validate. + FieldList []*ValidationExceptionField `locationName:"fieldList" type:"list"` + + Message_ *string `locationName:"message" type:"string"` + + // The reason for the exception. + // + // Reason is a required field + Reason *string `locationName:"reason" type:"string" required:"true" enum:"ValidationExceptionReason"` +} + +// String returns the string representation +func (s ValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationException) GoString() string { + return s.String() +} + +func newErrorValidationException(v protocol.ResponseMetadata) error { + return &ValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ValidationException) Code() string { + return "ValidationException" +} + +// Message returns the exception's message. +func (s ValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ValidationException) OrigErr() error { + return nil +} + +func (s ValidationException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ValidationException) RequestID() string { + return s.respMetadata.RequestID +} + +// Contains information about a validation exception. +type ValidationExceptionField struct { + _ struct{} `type:"structure"` + + // A message about the validation exception. + // + // Message is a required field + Message *string `locationName:"message" type:"string" required:"true"` + + // The name of the validation exception. + // + // Name is a required field + Name *string `locationName:"name" type:"string" required:"true"` +} + +// String returns the string representation +func (s ValidationExceptionField) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationExceptionField) GoString() string { + return s.String() +} + +// SetMessage sets the Message field's value. +func (s *ValidationExceptionField) SetMessage(v string) *ValidationExceptionField { + s.Message = &v + return s +} + +// SetName sets the Name field's value. +func (s *ValidationExceptionField) SetName(v string) *ValidationExceptionField { + s.Name = &v + return s +} + +const ( + // FindingStatusActive is a FindingStatus enum value + FindingStatusActive = "ACTIVE" + + // FindingStatusArchived is a FindingStatus enum value + FindingStatusArchived = "ARCHIVED" + + // FindingStatusResolved is a FindingStatus enum value + FindingStatusResolved = "RESOLVED" +) + +const ( + // FindingStatusUpdateActive is a FindingStatusUpdate enum value + FindingStatusUpdateActive = "ACTIVE" + + // FindingStatusUpdateArchived is a FindingStatusUpdate enum value + FindingStatusUpdateArchived = "ARCHIVED" +) + +const ( + // OrderByAsc is a OrderBy enum value + OrderByAsc = "ASC" + + // OrderByDesc is a OrderBy enum value + OrderByDesc = "DESC" +) + +const ( + // ResourceTypeAwsIamRole is a ResourceType enum value + ResourceTypeAwsIamRole = "AWS::IAM::Role" + + // ResourceTypeAwsKmsKey is a ResourceType enum value + ResourceTypeAwsKmsKey = "AWS::KMS::Key" + + // ResourceTypeAwsLambdaFunction is a ResourceType enum value + ResourceTypeAwsLambdaFunction = "AWS::Lambda::Function" + + // ResourceTypeAwsLambdaLayerVersion is a ResourceType enum value + ResourceTypeAwsLambdaLayerVersion = "AWS::Lambda::LayerVersion" + + // ResourceTypeAwsS3Bucket is a ResourceType enum value + ResourceTypeAwsS3Bucket = "AWS::S3::Bucket" + + // ResourceTypeAwsSqsQueue is a ResourceType enum value + ResourceTypeAwsSqsQueue = "AWS::SQS::Queue" +) + +const ( + // TypeAccount is a Type enum value + TypeAccount = "ACCOUNT" +) + +const ( + // ValidationExceptionReasonCannotParse is a ValidationExceptionReason enum value + ValidationExceptionReasonCannotParse = "cannotParse" + + // ValidationExceptionReasonFieldValidationFailed is a ValidationExceptionReason enum value + ValidationExceptionReasonFieldValidationFailed = "fieldValidationFailed" + + // ValidationExceptionReasonOther is a ValidationExceptionReason enum value + ValidationExceptionReasonOther = "other" + + // ValidationExceptionReasonUnknownOperation is a ValidationExceptionReason enum value + ValidationExceptionReasonUnknownOperation = "unknownOperation" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/accessanalyzer/doc.go b/vendor/github.com/aws/aws-sdk-go/service/accessanalyzer/doc.go new file mode 100644 index 00000000000..3f932dae7f8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/accessanalyzer/doc.go @@ -0,0 +1,37 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package accessanalyzer provides the client and types for making API +// requests to Access Analyzer. +// +// AWS IAM Access Analyzer helps identify potential resource-access risks by +// enabling you to identify any policies that grant access to an external principal. +// It does this by using logic-based reasoning to analyze resource-based policies +// in your AWS environment. An external principal can be another AWS account, +// a root user, an IAM user or role, a federated user, an AWS service, or an +// anonymous user. This guide describes the AWS IAM Access Analyzer operations +// that you can call programmatically. For general information about Access +// Analyzer, see the AWS IAM Access Analyzer section of the IAM User Guide (https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html). +// +// To start using Access Analyzer, you first need to create an analyzer. +// +// See https://docs.aws.amazon.com/goto/WebAPI/accessanalyzer-2019-11-01 for more information on this service. +// +// See accessanalyzer package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/accessanalyzer/ +// +// Using the Client +// +// To contact Access Analyzer 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 Access Analyzer client AccessAnalyzer for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/accessanalyzer/#New +package accessanalyzer diff --git a/vendor/github.com/aws/aws-sdk-go/service/accessanalyzer/errors.go b/vendor/github.com/aws/aws-sdk-go/service/accessanalyzer/errors.go new file mode 100644 index 00000000000..820e7a54e78 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/accessanalyzer/errors.go @@ -0,0 +1,62 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package accessanalyzer + +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + +const ( + + // ErrCodeAccessDeniedException for service response error code + // "AccessDeniedException". + // + // You do not have sufficient access to perform this action. + ErrCodeAccessDeniedException = "AccessDeniedException" + + // ErrCodeConflictException for service response error code + // "ConflictException". + // + // A conflict exception error. + ErrCodeConflictException = "ConflictException" + + // ErrCodeInternalServerException for service response error code + // "InternalServerException". + // + // Internal server error. + ErrCodeInternalServerException = "InternalServerException" + + // ErrCodeResourceNotFoundException for service response error code + // "ResourceNotFoundException". + // + // The specified resource could not be found. + ErrCodeResourceNotFoundException = "ResourceNotFoundException" + + // ErrCodeServiceQuotaExceededException for service response error code + // "ServiceQuotaExceededException". + // + // Service quote met error. + ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" + + // ErrCodeThrottlingException for service response error code + // "ThrottlingException". + // + // Throttling limit exceeded error. + ErrCodeThrottlingException = "ThrottlingException" + + // ErrCodeValidationException for service response error code + // "ValidationException". + // + // Validation exception error. + ErrCodeValidationException = "ValidationException" +) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "ConflictException": newErrorConflictException, + "InternalServerException": newErrorInternalServerException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, + "ThrottlingException": newErrorThrottlingException, + "ValidationException": newErrorValidationException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/accessanalyzer/service.go b/vendor/github.com/aws/aws-sdk-go/service/accessanalyzer/service.go new file mode 100644 index 00000000000..05fabf7ec45 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/accessanalyzer/service.go @@ -0,0 +1,104 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package accessanalyzer + +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" + "github.com/aws/aws-sdk-go/private/protocol/restjson" +) + +// AccessAnalyzer provides the API operation methods for making requests to +// Access Analyzer. See this package's package overview docs +// for details on the service. +// +// AccessAnalyzer methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type AccessAnalyzer 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 = "AccessAnalyzer" // Name of service. + EndpointsID = "access-analyzer" // ID to lookup a service endpoint with. + ServiceID = "AccessAnalyzer" // ServiceID is a unique identifier of a specific service. +) + +// New creates a new instance of the AccessAnalyzer client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// mySession := session.Must(session.NewSession()) +// +// // Create a AccessAnalyzer client from just a session. +// svc := accessanalyzer.New(mySession) +// +// // Create a AccessAnalyzer client with additional configuration +// svc := accessanalyzer.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *AccessAnalyzer { + c := p.ClientConfig(EndpointsID, cfgs...) + if c.SigningNameDerived || len(c.SigningName) == 0 { + c.SigningName = "access-analyzer" + } + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *AccessAnalyzer { + svc := &AccessAnalyzer{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + PartitionID: partitionID, + Endpoint: endpoint, + APIVersion: "2019-11-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( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a AccessAnalyzer operation and runs any +// custom request initialization. +func (c *AccessAnalyzer) 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/acm/api.go b/vendor/github.com/aws/aws-sdk-go/service/acm/api.go index 575c8261a63..0135a159d3e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/acm/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/acm/api.go @@ -83,21 +83,27 @@ func (c *ACM) AddTagsToCertificateRequest(input *AddTagsToCertificateInput) (req // See the AWS API reference guide for AWS Certificate Manager's // API operation AddTagsToCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified certificate cannot be found in the caller's account or the // caller's account cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidTagException "InvalidTagException" +// * 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" +// * TooManyTagsException // The request contains too many tags. Try the request again with fewer tags. // +// * TagPolicyException +// A specified tag did not comply with an existing tag policy and was rejected. +// +// * InvalidParameterException +// An input parameter was invalid. +// // See also, 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) @@ -182,16 +188,16 @@ func (c *ACM) DeleteCertificateRequest(input *DeleteCertificateInput) (req *requ // See the AWS API reference guide for AWS Certificate Manager's // API operation DeleteCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified certificate cannot be found in the caller's account or the // caller's account cannot be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The certificate is in use by another AWS service in the caller's account. // Remove the association and try again. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/DeleteCertificate @@ -269,12 +275,12 @@ func (c *ACM) DescribeCertificateRequest(input *DescribeCertificateInput) (req * // See the AWS API reference guide for AWS Certificate Manager's // API operation DescribeCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified certificate cannot be found in the caller's account or the // caller's account cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/DescribeCertificate @@ -344,14 +350,13 @@ func (c *ACM) ExportCertificateRequest(input *ExportCertificateInput) (req *requ // ExportCertificate API operation for AWS Certificate Manager. // // Exports a private certificate issued by a private certificate authority (CA) -// for use anywhere. You can export the certificate, the certificate chain, -// and the encrypted private key associated with the public key embedded in -// the certificate. You must store the private key securely. The private key -// is a 2048 bit RSA key. You must provide a passphrase for the private key -// when exporting it. You can use the following OpenSSL command to decrypt it -// later. Provide the passphrase when prompted. +// for use anywhere. The exported file contains the certificate, the certificate +// chain, and the encrypted private 2048-bit RSA key associated with the public +// key that is embedded in the certificate. For security, you must assign a +// passphrase for the private key when exporting it. // -// openssl rsa -in encrypted_key.pem -out decrypted_key.pem +// For information about exporting and formatting a certificate using the ACM +// console or CLI, see Export a Private Certificate (https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-export-private.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 @@ -360,16 +365,16 @@ func (c *ACM) ExportCertificateRequest(input *ExportCertificateInput) (req *requ // See the AWS API reference guide for AWS Certificate Manager's // API operation ExportCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified certificate cannot be found in the caller's account or the // caller's account cannot be found. // -// * ErrCodeRequestInProgressException "RequestInProgressException" +// * RequestInProgressException // The certificate request is in process and the certificate in your account // has not yet been issued. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ExportCertificate @@ -452,16 +457,16 @@ func (c *ACM) GetCertificateRequest(input *GetCertificateInput) (req *request.Re // See the AWS API reference guide for AWS Certificate Manager's // API operation GetCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified certificate cannot be found in the caller's account or the // caller's account cannot be found. // -// * ErrCodeRequestInProgressException "RequestInProgressException" +// * RequestInProgressException // The certificate request is in process and the certificate in your account // has not yet been issued. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/GetCertificate @@ -566,7 +571,7 @@ func (c *ACM) ImportCertificateRequest(input *ImportCertificateInput) (req *requ // * The OCSP authority URL, if present, must not exceed 1000 characters. // // * To import a new certificate, omit the CertificateArn argument. Include -// this argument only when you want to replace a previously imported certificate. +// this argument only when you want to replace a previously imported certifica // // * When you import a certificate by using the CLI, you must specify the // certificate, the certificate chain, and the private key by their file @@ -579,6 +584,10 @@ func (c *ACM) ImportCertificateRequest(input *ImportCertificateInput) (req *requ // certificate, the certificate chain, and the private key files in the manner // required by the programming language you're using. // +// * The cryptographic algorithm of an imported certificate must match the +// algorithm of the signing CA. For example, if the signing CA key type is +// RSA, then the certificate key type must also be RSA. +// // This operation returns the Amazon Resource Name (ARN) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // of the imported certificate. // @@ -589,14 +598,27 @@ func (c *ACM) ImportCertificateRequest(input *ImportCertificateInput) (req *requ // See the AWS API reference guide for AWS Certificate Manager's // API operation ImportCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified certificate cannot be found in the caller's account or the // caller's account cannot be found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // An ACM limit has been exceeded. // +// * 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:. +// +// * TooManyTagsException +// The request contains too many tags. Try the request again with fewer tags. +// +// * TagPolicyException +// A specified tag did not comply with an existing tag policy and was rejected. +// +// * InvalidParameterException +// An input parameter was invalid. +// // See also, 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) @@ -671,7 +693,8 @@ func (c *ACM) ListCertificatesRequest(input *ListCertificatesInput) (req *reques // // Retrieves a list of certificate ARNs and domain names. You can request that // only certificates that match a specific status be listed. You can also filter -// by specific attributes of the certificate. +// by specific attributes of the certificate. Default filtering returns only +// RSA_2048 certificates. For more information, see Filters. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -680,8 +703,8 @@ func (c *ACM) ListCertificatesRequest(input *ListCertificatesInput) (req *reques // See the AWS API reference guide for AWS Certificate Manager's // API operation ListCertificates for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgsException "InvalidArgsException" +// Returned Error Types: +// * InvalidArgsException // One or more of of request parameters specified is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ListCertificates @@ -749,10 +772,12 @@ func (c *ACM) ListCertificatesPagesWithContext(ctx aws.Context, input *ListCerti }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCertificatesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListCertificatesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -812,12 +837,12 @@ func (c *ACM) ListTagsForCertificateRequest(input *ListTagsForCertificateInput) // See the AWS API reference guide for AWS Certificate Manager's // API operation ListTagsForCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified certificate cannot be found in the caller's account or the // caller's account cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ListTagsForCertificate @@ -903,18 +928,24 @@ func (c *ACM) RemoveTagsFromCertificateRequest(input *RemoveTagsFromCertificateI // See the AWS API reference guide for AWS Certificate Manager's // API operation RemoveTagsFromCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified certificate cannot be found in the caller's account or the // caller's account cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidTagException "InvalidTagException" +// * 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:. // +// * TagPolicyException +// A specified tag did not comply with an existing tag policy and was rejected. +// +// * InvalidParameterException +// An input parameter was invalid. +// // See also, 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) @@ -996,12 +1027,12 @@ func (c *ACM) RenewCertificateRequest(input *RenewCertificateInput) (req *reques // See the AWS API reference guide for AWS Certificate Manager's // API operation RenewCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified certificate cannot be found in the caller's account or the // caller's account cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/RenewCertificate @@ -1090,16 +1121,29 @@ func (c *ACM) RequestCertificateRequest(input *RequestCertificateInput) (req *re // See the AWS API reference guide for AWS Certificate Manager's // API operation RequestCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // An ACM limit has been exceeded. // -// * ErrCodeInvalidDomainValidationOptionsException "InvalidDomainValidationOptionsException" +// * InvalidDomainValidationOptionsException // One or more values in the DomainValidationOption structure is incorrect. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // +// * 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:. +// +// * TooManyTagsException +// The request contains too many tags. Try the request again with fewer tags. +// +// * TagPolicyException +// A specified tag did not comply with an existing tag policy and was rejected. +// +// * InvalidParameterException +// An input parameter was invalid. +// // See also, 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) @@ -1186,18 +1230,18 @@ func (c *ACM) ResendValidationEmailRequest(input *ResendValidationEmailInput) (r // See the AWS API reference guide for AWS Certificate Manager's // API operation ResendValidationEmail for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified certificate cannot be found in the caller's account or the // caller's account cannot be found. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // Processing has reached an invalid state. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidDomainValidationOptionsException "InvalidDomainValidationOptionsException" +// * InvalidDomainValidationOptionsException // One or more values in the DomainValidationOption structure is incorrect. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/ResendValidationEmail @@ -1279,18 +1323,18 @@ func (c *ACM) UpdateCertificateOptionsRequest(input *UpdateCertificateOptionsInp // See the AWS API reference guide for AWS Certificate Manager's // API operation UpdateCertificateOptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified certificate cannot be found in the caller's account or the // caller's account cannot be found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // An ACM limit has been exceeded. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // Processing has reached an invalid state. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-2015-12-08/UpdateCertificateOptions @@ -2224,6 +2268,11 @@ type Filters struct { ExtendedKeyUsage []*string `locationName:"extendedKeyUsage" type:"list"` // Specify one or more algorithms that can be used to generate key pairs. + // + // Default filtering returns only RSA_2048 certificates. To return other certificate + // types, provide the desired type signatures in a comma-separated list. For + // example, "keyTypes": ["RSA_2048,RSA_4096"] returns both RSA_2048 and RSA_4096 + // certificates. KeyTypes []*string `locationName:"keyTypes" type:"list"` // Specify one or more KeyUsage extension values. @@ -2364,6 +2413,11 @@ type ImportCertificateInput struct { // // PrivateKey is a required field PrivateKey []byte `min:"1" type:"blob" required:"true" sensitive:"true"` + + // One or more resource tags to associate with the imported certificate. + // + // Note: You cannot apply tags when reimporting a certificate. + Tags []*Tag `min:"1" type:"list"` } // String returns the string representation @@ -2397,6 +2451,19 @@ func (s *ImportCertificateInput) Validate() error { if s.PrivateKey != nil && len(s.PrivateKey) < 1 { invalidParams.Add(request.NewErrParamMinLen("PrivateKey", 1)) } + 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 @@ -2428,6 +2495,12 @@ func (s *ImportCertificateInput) SetPrivateKey(v []byte) *ImportCertificateInput return s } +// SetTags sets the Tags field's value. +func (s *ImportCertificateInput) SetTags(v []*Tag) *ImportCertificateInput { + s.Tags = v + return s +} + type ImportCertificateOutput struct { _ struct{} `type:"structure"` @@ -2452,6 +2525,343 @@ func (s *ImportCertificateOutput) SetCertificateArn(v string) *ImportCertificate return s } +// One or more of of request parameters specified is not valid. +type InvalidArgsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidArgsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidArgsException) GoString() string { + return s.String() +} + +func newErrorInvalidArgsException(v protocol.ResponseMetadata) error { + return &InvalidArgsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidArgsException) Code() string { + return "InvalidArgsException" +} + +// Message returns the exception's message. +func (s InvalidArgsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidArgsException) OrigErr() error { + return nil +} + +func (s InvalidArgsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidArgsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidArgsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested Amazon Resource Name (ARN) does not refer to an existing resource. +type InvalidArnException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidArnException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidArnException) GoString() string { + return s.String() +} + +func newErrorInvalidArnException(v protocol.ResponseMetadata) error { + return &InvalidArnException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidArnException) Code() string { + return "InvalidArnException" +} + +// Message returns the exception's message. +func (s InvalidArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidArnException) OrigErr() error { + return nil +} + +func (s InvalidArnException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidArnException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidArnException) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more values in the DomainValidationOption structure is incorrect. +type InvalidDomainValidationOptionsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidDomainValidationOptionsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDomainValidationOptionsException) GoString() string { + return s.String() +} + +func newErrorInvalidDomainValidationOptionsException(v protocol.ResponseMetadata) error { + return &InvalidDomainValidationOptionsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDomainValidationOptionsException) Code() string { + return "InvalidDomainValidationOptionsException" +} + +// Message returns the exception's message. +func (s InvalidDomainValidationOptionsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDomainValidationOptionsException) OrigErr() error { + return nil +} + +func (s InvalidDomainValidationOptionsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDomainValidationOptionsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDomainValidationOptionsException) RequestID() string { + return s.respMetadata.RequestID +} + +// An input parameter was invalid. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} + +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// Processing has reached an invalid state. +type InvalidStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidStateException) GoString() string { + return s.String() +} + +func newErrorInvalidStateException(v protocol.ResponseMetadata) error { + return &InvalidStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidStateException) Code() string { + return "InvalidStateException" +} + +// Message returns the exception's message. +func (s InvalidStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidStateException) OrigErr() error { + return nil +} + +func (s InvalidStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidStateException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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:. +type InvalidTagException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidTagException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidTagException) GoString() string { + return s.String() +} + +func newErrorInvalidTagException(v protocol.ResponseMetadata) error { + return &InvalidTagException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidTagException) Code() string { + return "InvalidTagException" +} + +// Message returns the exception's message. +func (s InvalidTagException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTagException) OrigErr() error { + return nil +} + +func (s InvalidTagException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTagException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidTagException) RequestID() string { + return s.respMetadata.RequestID +} + // The Key Usage X.509 v3 extension defines the purpose of the public key contained // in the certificate. type KeyUsage struct { @@ -2477,6 +2887,62 @@ func (s *KeyUsage) SetName(v string) *KeyUsage { return s } +// An ACM limit has been exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListCertificatesInput struct { _ struct{} `type:"structure"` @@ -2882,7 +3348,7 @@ type RequestCertificateInput struct { // certificate that protects several sites in the same domain. For example, // *.example.com protects www.example.com, site.example.com, and images.example.com. // - // The first domain name you enter cannot exceed 63 octets, including periods. + // The first domain name you enter cannot exceed 64 octets, including periods. // Each subsequent Subject Alternative Name (SAN), however, can be up to 253 // octets in length. // @@ -2933,6 +3399,9 @@ type RequestCertificateInput struct { // the total length of the DNS name (63+1+63+1+63+1+62) exceeds 253 octets. SubjectAlternativeNames []*string `min:"1" type:"list"` + // One or more resource tags to associate with the certificate. + Tags []*Tag `min:"1" type:"list"` + // The method you want to use if you are requesting a public certificate to // validate that you own or control domain. You can validate with DNS (https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-dns.html) // or validate with email (https://docs.aws.amazon.com/acm/latest/userguide/gs-acm-validate-email.html). @@ -2971,6 +3440,9 @@ func (s *RequestCertificateInput) Validate() error { if s.SubjectAlternativeNames != nil && len(s.SubjectAlternativeNames) < 1 { invalidParams.Add(request.NewErrParamMinLen("SubjectAlternativeNames", 1)) } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } if s.DomainValidationOptions != nil { for i, v := range s.DomainValidationOptions { if v == nil { @@ -2981,6 +3453,16 @@ func (s *RequestCertificateInput) Validate() error { } } } + 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 @@ -3024,6 +3506,12 @@ func (s *RequestCertificateInput) SetSubjectAlternativeNames(v []*string) *Reque return s } +// SetTags sets the Tags field's value. +func (s *RequestCertificateInput) SetTags(v []*Tag) *RequestCertificateInput { + s.Tags = v + return s +} + // SetValidationMethod sets the ValidationMethod field's value. func (s *RequestCertificateInput) SetValidationMethod(v string) *RequestCertificateInput { s.ValidationMethod = &v @@ -3056,6 +3544,63 @@ func (s *RequestCertificateOutput) SetCertificateArn(v string) *RequestCertifica return s } +// The certificate request is in process and the certificate in your account +// has not yet been issued. +type RequestInProgressException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RequestInProgressException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestInProgressException) GoString() string { + return s.String() +} + +func newErrorRequestInProgressException(v protocol.ResponseMetadata) error { + return &RequestInProgressException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RequestInProgressException) Code() string { + return "RequestInProgressException" +} + +// Message returns the exception's message. +func (s RequestInProgressException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RequestInProgressException) OrigErr() error { + return nil +} + +func (s RequestInProgressException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RequestInProgressException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RequestInProgressException) RequestID() string { + return s.respMetadata.RequestID +} + type ResendValidationEmailInput struct { _ struct{} `type:"structure"` @@ -3167,6 +3712,120 @@ func (s ResendValidationEmailOutput) GoString() string { return s.String() } +// The certificate is in use by another AWS service in the caller's account. +// Remove the association and try again. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified certificate cannot be found in the caller's account or the +// caller's account cannot be found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains a DNS record value that you can use to can use to validate ownership // or control of a domain. This is used by the DescribeCertificate action. type ResourceRecord struct { @@ -3269,6 +3928,118 @@ func (s *Tag) SetValue(v string) *Tag { return s } +// A specified tag did not comply with an existing tag policy and was rejected. +type TagPolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TagPolicyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagPolicyException) GoString() string { + return s.String() +} + +func newErrorTagPolicyException(v protocol.ResponseMetadata) error { + return &TagPolicyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagPolicyException) Code() string { + return "TagPolicyException" +} + +// Message returns the exception's message. +func (s TagPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagPolicyException) OrigErr() error { + return nil +} + +func (s TagPolicyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagPolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagPolicyException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request contains too many tags. Try the request again with fewer tags. +type TooManyTagsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyTagsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyTagsException) GoString() string { + return s.String() +} + +func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { + return &TooManyTagsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyTagsException) Code() string { + return "TooManyTagsException" +} + +// Message returns the exception's message. +func (s TooManyTagsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTagsException) OrigErr() error { + return nil +} + +func (s TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTagsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyTagsException) RequestID() string { + return s.respMetadata.RequestID +} + type UpdateCertificateOptionsInput struct { _ struct{} `type:"structure"` @@ -3466,6 +4237,9 @@ const ( // FailureReasonPcaRequestFailed is a FailureReason enum value FailureReasonPcaRequestFailed = "PCA_REQUEST_FAILED" + // FailureReasonPcaNameConstraintsValidation is a FailureReason enum value + FailureReasonPcaNameConstraintsValidation = "PCA_NAME_CONSTRAINTS_VALIDATION" + // FailureReasonPcaResourceNotFound is a FailureReason enum value FailureReasonPcaResourceNotFound = "PCA_RESOURCE_NOT_FOUND" 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 index 28d93aa374f..54de486c39a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/acm/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/acm/errors.go @@ -2,6 +2,10 @@ package acm +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInvalidArgsException for service response error code @@ -22,6 +26,12 @@ const ( // One or more values in the DomainValidationOption structure is incorrect. ErrCodeInvalidDomainValidationOptionsException = "InvalidDomainValidationOptionsException" + // ErrCodeInvalidParameterException for service response error code + // "InvalidParameterException". + // + // An input parameter was invalid. + ErrCodeInvalidParameterException = "InvalidParameterException" + // ErrCodeInvalidStateException for service response error code // "InvalidStateException". // @@ -62,9 +72,30 @@ const ( // caller's account cannot be found. ErrCodeResourceNotFoundException = "ResourceNotFoundException" + // ErrCodeTagPolicyException for service response error code + // "TagPolicyException". + // + // A specified tag did not comply with an existing tag policy and was rejected. + ErrCodeTagPolicyException = "TagPolicyException" + // ErrCodeTooManyTagsException for service response error code // "TooManyTagsException". // // The request contains too many tags. Try the request again with fewer tags. ErrCodeTooManyTagsException = "TooManyTagsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InvalidArgsException": newErrorInvalidArgsException, + "InvalidArnException": newErrorInvalidArnException, + "InvalidDomainValidationOptionsException": newErrorInvalidDomainValidationOptionsException, + "InvalidParameterException": newErrorInvalidParameterException, + "InvalidStateException": newErrorInvalidStateException, + "InvalidTagException": newErrorInvalidTagException, + "LimitExceededException": newErrorLimitExceededException, + "RequestInProgressException": newErrorRequestInProgressException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "TagPolicyException": newErrorTagPolicyException, + "TooManyTagsException": newErrorTooManyTagsException, +} 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 index 9817d0c0a5a..d5a56d01eab 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/acm/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/acm/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "acm" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "ACM" // ServiceID is a unique identifer of a specific service. + ServiceID = "ACM" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ACM client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ACM client from just a session. // svc := acm.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ACM { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ACM { svc := &ACM{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-12-08", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/acmpca/api.go b/vendor/github.com/aws/aws-sdk-go/service/acmpca/api.go index b9f53ae7a2d..d339900f2f3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/acmpca/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/acmpca/api.go @@ -75,19 +75,19 @@ func (c *ACMPCA) CreateCertificateAuthorityRequest(input *CreateCertificateAutho // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation CreateCertificateAuthority for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgsException "InvalidArgsException" +// Returned Error Types: +// * InvalidArgsException // One or more of the specified arguments was not valid. // -// * ErrCodeInvalidPolicyException "InvalidPolicyException" +// * InvalidPolicyException // The S3 bucket policy is not valid. The policy must give ACM Private CA rights // to read from and write to the bucket and find the bucket location. // -// * ErrCodeInvalidTagException "InvalidTagException" +// * InvalidTagException // The tag associated with the CA is not valid. The invalid argument is contained // in the message field. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // An ACM Private CA limit has been exceeded. See the exception message returned // to determine the limit that was exceeded. // @@ -168,24 +168,24 @@ func (c *ACMPCA) CreateCertificateAuthorityAuditReportRequest(input *CreateCerti // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation CreateCertificateAuthorityAuditReport for usage and error information. // -// Returned Error Codes: -// * ErrCodeRequestInProgressException "RequestInProgressException" +// Returned Error Types: +// * RequestInProgressException // Your request is already in progress. // -// * ErrCodeRequestFailedException "RequestFailedException" +// * RequestFailedException // The request has failed for an unspecified reason. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidArgsException "InvalidArgsException" +// * InvalidArgsException // One or more of the specified arguments was not valid. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // @@ -274,26 +274,26 @@ func (c *ACMPCA) CreatePermissionRequest(input *CreatePermissionInput) (req *req // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation CreatePermission for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodePermissionAlreadyExistsException "PermissionAlreadyExistsException" +// * PermissionAlreadyExistsException // The designated permission has already been given to the user. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // An ACM Private CA limit has been exceeded. See the exception message returned // to determine the limit that was exceeded. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // -// * ErrCodeRequestFailedException "RequestFailedException" +// * RequestFailedException // The request has failed for an unspecified reason. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-pca-2017-08-22/CreatePermission @@ -394,18 +394,18 @@ func (c *ACMPCA) DeleteCertificateAuthorityRequest(input *DeleteCertificateAutho // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation DeleteCertificateAuthority for usage and error information. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// Returned Error Types: +// * ConcurrentModificationException // A previous update to your private CA is still ongoing. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // @@ -487,19 +487,19 @@ func (c *ACMPCA) DeletePermissionRequest(input *DeletePermissionInput) (req *req // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation DeletePermission for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // -// * ErrCodeRequestFailedException "RequestFailedException" +// * RequestFailedException // The request has failed for an unspecified reason. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-pca-2017-08-22/DeletePermission @@ -599,12 +599,12 @@ func (c *ACMPCA) DescribeCertificateAuthorityRequest(input *DescribeCertificateA // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation DescribeCertificateAuthority for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-pca-2017-08-22/DescribeCertificateAuthority @@ -685,15 +685,15 @@ func (c *ACMPCA) DescribeCertificateAuthorityAuditReportRequest(input *DescribeC // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation DescribeCertificateAuthorityAuditReport for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidArgsException "InvalidArgsException" +// * InvalidArgsException // One or more of the specified arguments was not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-pca-2017-08-22/DescribeCertificateAuthorityAuditReport @@ -777,21 +777,21 @@ func (c *ACMPCA) GetCertificateRequest(input *GetCertificateInput) (req *request // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation GetCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeRequestInProgressException "RequestInProgressException" +// Returned Error Types: +// * RequestInProgressException // Your request is already in progress. // -// * ErrCodeRequestFailedException "RequestFailedException" +// * RequestFailedException // The request has failed for an unspecified reason. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // @@ -873,16 +873,16 @@ func (c *ACMPCA) GetCertificateAuthorityCertificateRequest(input *GetCertificate // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation GetCertificateAuthorityCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-pca-2017-08-22/GetCertificateAuthorityCertificate @@ -965,21 +965,21 @@ func (c *ACMPCA) GetCertificateAuthorityCsrRequest(input *GetCertificateAuthorit // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation GetCertificateAuthorityCsr for usage and error information. // -// Returned Error Codes: -// * ErrCodeRequestInProgressException "RequestInProgressException" +// Returned Error Types: +// * RequestInProgressException // Your request is already in progress. // -// * ErrCodeRequestFailedException "RequestFailedException" +// * RequestFailedException // The request has failed for an unspecified reason. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // @@ -1092,34 +1092,34 @@ func (c *ACMPCA) ImportCertificateAuthorityCertificateRequest(input *ImportCerti // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation ImportCertificateAuthorityCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// Returned Error Types: +// * ConcurrentModificationException // A previous update to your private CA is still ongoing. // -// * ErrCodeRequestInProgressException "RequestInProgressException" +// * RequestInProgressException // Your request is already in progress. // -// * ErrCodeRequestFailedException "RequestFailedException" +// * RequestFailedException // The request has failed for an unspecified reason. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request action cannot be performed or is prohibited. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // -// * ErrCodeMalformedCertificateException "MalformedCertificateException" +// * MalformedCertificateException // One or more fields in the certificate are invalid. // -// * ErrCodeCertificateMismatchException "CertificateMismatchException" +// * CertificateMismatchException // The certificate authority certificate you are importing does not comply with // conditions specified in the certificate that signed it. // @@ -1204,26 +1204,26 @@ func (c *ACMPCA) IssueCertificateRequest(input *IssueCertificateInput) (req *req // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation IssueCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // An ACM Private CA limit has been exceeded. See the exception message returned // to determine the limit that was exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidArgsException "InvalidArgsException" +// * InvalidArgsException // One or more of the specified arguments was not valid. // -// * ErrCodeMalformedCSRException "MalformedCSRException" +// * MalformedCSRException // The certificate signing request is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-pca-2017-08-22/IssueCertificate @@ -1308,8 +1308,8 @@ func (c *ACMPCA) ListCertificateAuthoritiesRequest(input *ListCertificateAuthori // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation ListCertificateAuthorities for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The token specified in the NextToken argument is not valid. Use the token // returned from your previous call to ListCertificateAuthorities. // @@ -1378,10 +1378,12 @@ func (c *ACMPCA) ListCertificateAuthoritiesPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCertificateAuthoritiesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListCertificateAuthoritiesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1446,23 +1448,23 @@ func (c *ACMPCA) ListPermissionsRequest(input *ListPermissionsInput) (req *reque // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation ListPermissions for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The token specified in the NextToken argument is not valid. Use the token // returned from your previous call to ListCertificateAuthorities. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // -// * ErrCodeRequestFailedException "RequestFailedException" +// * RequestFailedException // The request has failed for an unspecified reason. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-pca-2017-08-22/ListPermissions @@ -1530,10 +1532,12 @@ func (c *ACMPCA) ListPermissionsPagesWithContext(ctx aws.Context, input *ListPer }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPermissionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPermissionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1600,15 +1604,15 @@ func (c *ACMPCA) ListTagsRequest(input *ListTagsInput) (req *request.Request, ou // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation ListTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // @@ -1677,10 +1681,12 @@ func (c *ACMPCA) ListTagsPagesWithContext(ctx aws.Context, input *ListTagsInput, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTagsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1750,16 +1756,16 @@ func (c *ACMPCA) RestoreCertificateAuthorityRequest(input *RestoreCertificateAut // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation RestoreCertificateAuthority for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-pca-2017-08-22/RestoreCertificateAuthority @@ -1846,35 +1852,35 @@ func (c *ACMPCA) RevokeCertificateRequest(input *RevokeCertificateInput) (req *r // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation RevokeCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// Returned Error Types: +// * ConcurrentModificationException // A previous update to your private CA is still ongoing. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request action cannot be performed or is prohibited. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // An ACM Private CA limit has been exceeded. See the exception message returned // to determine the limit that was exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeRequestAlreadyProcessedException "RequestAlreadyProcessedException" +// * RequestAlreadyProcessedException // Your request has already been completed. // -// * ErrCodeRequestInProgressException "RequestInProgressException" +// * RequestInProgressException // Your request is already in progress. // -// * ErrCodeRequestFailedException "RequestFailedException" +// * RequestFailedException // The request has failed for an unspecified reason. // // See also, https://docs.aws.amazon.com/goto/WebAPI/acm-pca-2017-08-22/RevokeCertificate @@ -1961,23 +1967,23 @@ func (c *ACMPCA) TagCertificateAuthorityRequest(input *TagCertificateAuthorityIn // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation TagCertificateAuthority for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // -// * ErrCodeInvalidTagException "InvalidTagException" +// * InvalidTagException // The tag associated with the CA is not valid. The invalid argument is contained // in the message field. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // You can associate up to 50 tags with a private CA. Exception information // is contained in the exception message field. // @@ -2062,19 +2068,19 @@ func (c *ACMPCA) UntagCertificateAuthorityRequest(input *UntagCertificateAuthori // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation UntagCertificateAuthority for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // -// * ErrCodeInvalidTagException "InvalidTagException" +// * InvalidTagException // The tag associated with the CA is not valid. The invalid argument is contained // in the message field. // @@ -2157,25 +2163,25 @@ func (c *ACMPCA) UpdateCertificateAuthorityRequest(input *UpdateCertificateAutho // See the AWS API reference guide for AWS Certificate Manager Private Certificate Authority's // API operation UpdateCertificateAuthority for usage and error information. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// Returned Error Types: +// * ConcurrentModificationException // A previous update to your private CA is still ongoing. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource such as a private CA, S3 bucket, certificate, or audit report // cannot be found. // -// * ErrCodeInvalidArgsException "InvalidArgsException" +// * InvalidArgsException // One or more of the specified arguments was not valid. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The requested Amazon Resource Name (ARN) does not refer to an existing resource. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // The private CA is in a state during which a report or certificate cannot // be generated. // -// * ErrCodeInvalidPolicyException "InvalidPolicyException" +// * InvalidPolicyException // The S3 bucket policy is not valid. The policy must give ACM Private CA rights // to read from and write to the bucket and find the bucket location. // @@ -2570,6 +2576,119 @@ func (s *CertificateAuthorityConfiguration) SetSubject(v *ASN1Subject) *Certific return s } +// The certificate authority certificate you are importing does not comply with +// conditions specified in the certificate that signed it. +type CertificateMismatchException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CertificateMismatchException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CertificateMismatchException) GoString() string { + return s.String() +} + +func newErrorCertificateMismatchException(v protocol.ResponseMetadata) error { + return &CertificateMismatchException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CertificateMismatchException) Code() string { + return "CertificateMismatchException" +} + +// Message returns the exception's message. +func (s CertificateMismatchException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CertificateMismatchException) OrigErr() error { + return nil +} + +func (s CertificateMismatchException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CertificateMismatchException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CertificateMismatchException) RequestID() string { + return s.respMetadata.RequestID +} + +// A previous update to your private CA is still ongoing. +type ConcurrentModificationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentModificationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentModificationException) GoString() string { + return s.String() +} + +func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { + return &ConcurrentModificationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentModificationException) Code() string { + return "ConcurrentModificationException" +} + +// Message returns the exception's message. +func (s ConcurrentModificationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentModificationException) OrigErr() error { + return nil +} + +func (s ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentModificationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentModificationException) RequestID() string { + return s.respMetadata.RequestID +} + type CreateCertificateAuthorityAuditReportInput struct { _ struct{} `type:"structure"` @@ -3727,6 +3846,402 @@ func (s ImportCertificateAuthorityCertificateOutput) GoString() string { return s.String() } +// One or more of the specified arguments was not valid. +type InvalidArgsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidArgsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidArgsException) GoString() string { + return s.String() +} + +func newErrorInvalidArgsException(v protocol.ResponseMetadata) error { + return &InvalidArgsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidArgsException) Code() string { + return "InvalidArgsException" +} + +// Message returns the exception's message. +func (s InvalidArgsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidArgsException) OrigErr() error { + return nil +} + +func (s InvalidArgsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidArgsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidArgsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested Amazon Resource Name (ARN) does not refer to an existing resource. +type InvalidArnException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidArnException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidArnException) GoString() string { + return s.String() +} + +func newErrorInvalidArnException(v protocol.ResponseMetadata) error { + return &InvalidArnException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidArnException) Code() string { + return "InvalidArnException" +} + +// Message returns the exception's message. +func (s InvalidArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidArnException) OrigErr() error { + return nil +} + +func (s InvalidArnException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidArnException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidArnException) RequestID() string { + return s.respMetadata.RequestID +} + +// The token specified in the NextToken argument is not valid. Use the token +// returned from your previous call to ListCertificateAuthorities. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNextTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// The S3 bucket policy is not valid. The policy must give ACM Private CA rights +// to read from and write to the bucket and find the bucket location. +type InvalidPolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidPolicyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPolicyException) GoString() string { + return s.String() +} + +func newErrorInvalidPolicyException(v protocol.ResponseMetadata) error { + return &InvalidPolicyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPolicyException) Code() string { + return "InvalidPolicyException" +} + +// Message returns the exception's message. +func (s InvalidPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPolicyException) OrigErr() error { + return nil +} + +func (s InvalidPolicyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPolicyException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request action cannot be performed or is prohibited. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// The private CA is in a state during which a report or certificate cannot +// be generated. +type InvalidStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidStateException) GoString() string { + return s.String() +} + +func newErrorInvalidStateException(v protocol.ResponseMetadata) error { + return &InvalidStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidStateException) Code() string { + return "InvalidStateException" +} + +// Message returns the exception's message. +func (s InvalidStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidStateException) OrigErr() error { + return nil +} + +func (s InvalidStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidStateException) RequestID() string { + return s.respMetadata.RequestID +} + +// The tag associated with the CA is not valid. The invalid argument is contained +// in the message field. +type InvalidTagException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidTagException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidTagException) GoString() string { + return s.String() +} + +func newErrorInvalidTagException(v protocol.ResponseMetadata) error { + return &InvalidTagException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidTagException) Code() string { + return "InvalidTagException" +} + +// Message returns the exception's message. +func (s InvalidTagException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTagException) OrigErr() error { + return nil +} + +func (s InvalidTagException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTagException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidTagException) RequestID() string { + return s.respMetadata.RequestID +} + type IssueCertificateInput struct { _ struct{} `type:"structure"` @@ -3910,6 +4425,63 @@ func (s *IssueCertificateOutput) SetCertificateArn(v string) *IssueCertificateOu return s } +// An ACM Private CA limit has been exceeded. See the exception message returned +// to determine the limit that was exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListCertificateAuthoritiesInput struct { _ struct{} `type:"structure"` @@ -4210,6 +4782,118 @@ func (s *ListTagsOutput) SetTags(v []*Tag) *ListTagsOutput { return s } +// The certificate signing request is invalid. +type MalformedCSRException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s MalformedCSRException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MalformedCSRException) GoString() string { + return s.String() +} + +func newErrorMalformedCSRException(v protocol.ResponseMetadata) error { + return &MalformedCSRException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MalformedCSRException) Code() string { + return "MalformedCSRException" +} + +// Message returns the exception's message. +func (s MalformedCSRException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MalformedCSRException) OrigErr() error { + return nil +} + +func (s MalformedCSRException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MalformedCSRException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MalformedCSRException) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more fields in the certificate are invalid. +type MalformedCertificateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s MalformedCertificateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MalformedCertificateException) GoString() string { + return s.String() +} + +func newErrorMalformedCertificateException(v protocol.ResponseMetadata) error { + return &MalformedCertificateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MalformedCertificateException) Code() string { + return "MalformedCertificateException" +} + +// Message returns the exception's message. +func (s MalformedCertificateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MalformedCertificateException) OrigErr() error { + return nil +} + +func (s MalformedCertificateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MalformedCertificateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MalformedCertificateException) RequestID() string { + return s.respMetadata.RequestID +} + // Permissions designate which private CA actions can be performed by an AWS // service or entity. In order for ACM to automatically renew private certificates, // you must give the ACM service principal all available permissions (IssueCertificate, @@ -4286,6 +4970,287 @@ func (s *Permission) SetSourceAccount(v string) *Permission { return s } +// The designated permission has already been given to the user. +type PermissionAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PermissionAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PermissionAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorPermissionAlreadyExistsException(v protocol.ResponseMetadata) error { + return &PermissionAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PermissionAlreadyExistsException) Code() string { + return "PermissionAlreadyExistsException" +} + +// Message returns the exception's message. +func (s PermissionAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PermissionAlreadyExistsException) OrigErr() error { + return nil +} + +func (s PermissionAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PermissionAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PermissionAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// Your request has already been completed. +type RequestAlreadyProcessedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RequestAlreadyProcessedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestAlreadyProcessedException) GoString() string { + return s.String() +} + +func newErrorRequestAlreadyProcessedException(v protocol.ResponseMetadata) error { + return &RequestAlreadyProcessedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RequestAlreadyProcessedException) Code() string { + return "RequestAlreadyProcessedException" +} + +// Message returns the exception's message. +func (s RequestAlreadyProcessedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RequestAlreadyProcessedException) OrigErr() error { + return nil +} + +func (s RequestAlreadyProcessedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RequestAlreadyProcessedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RequestAlreadyProcessedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request has failed for an unspecified reason. +type RequestFailedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RequestFailedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestFailedException) GoString() string { + return s.String() +} + +func newErrorRequestFailedException(v protocol.ResponseMetadata) error { + return &RequestFailedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RequestFailedException) Code() string { + return "RequestFailedException" +} + +// Message returns the exception's message. +func (s RequestFailedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RequestFailedException) OrigErr() error { + return nil +} + +func (s RequestFailedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RequestFailedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RequestFailedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Your request is already in progress. +type RequestInProgressException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RequestInProgressException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestInProgressException) GoString() string { + return s.String() +} + +func newErrorRequestInProgressException(v protocol.ResponseMetadata) error { + return &RequestInProgressException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RequestInProgressException) Code() string { + return "RequestInProgressException" +} + +// Message returns the exception's message. +func (s RequestInProgressException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RequestInProgressException) OrigErr() error { + return nil +} + +func (s RequestInProgressException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RequestInProgressException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RequestInProgressException) RequestID() string { + return s.respMetadata.RequestID +} + +// A resource such as a private CA, S3 bucket, certificate, or audit report +// cannot be found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + type RestoreCertificateAuthorityInput struct { _ struct{} `type:"structure"` @@ -4625,6 +5590,63 @@ func (s TagCertificateAuthorityOutput) GoString() string { return s.String() } +// You can associate up to 50 tags with a private CA. Exception information +// is contained in the exception message field. +type TooManyTagsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyTagsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyTagsException) GoString() string { + return s.String() +} + +func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { + return &TooManyTagsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyTagsException) Code() string { + return "TooManyTagsException" +} + +// Message returns the exception's message. +func (s TooManyTagsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTagsException) OrigErr() error { + return nil +} + +func (s TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTagsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyTagsException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagCertificateAuthorityInput struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/acmpca/errors.go b/vendor/github.com/aws/aws-sdk-go/service/acmpca/errors.go index c9095bbe2af..62564f2a81c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/acmpca/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/acmpca/errors.go @@ -2,6 +2,10 @@ package acmpca +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeCertificateMismatchException for service response error code @@ -120,3 +124,24 @@ const ( // is contained in the exception message field. ErrCodeTooManyTagsException = "TooManyTagsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "CertificateMismatchException": newErrorCertificateMismatchException, + "ConcurrentModificationException": newErrorConcurrentModificationException, + "InvalidArgsException": newErrorInvalidArgsException, + "InvalidArnException": newErrorInvalidArnException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "InvalidPolicyException": newErrorInvalidPolicyException, + "InvalidRequestException": newErrorInvalidRequestException, + "InvalidStateException": newErrorInvalidStateException, + "InvalidTagException": newErrorInvalidTagException, + "LimitExceededException": newErrorLimitExceededException, + "MalformedCSRException": newErrorMalformedCSRException, + "MalformedCertificateException": newErrorMalformedCertificateException, + "PermissionAlreadyExistsException": newErrorPermissionAlreadyExistsException, + "RequestAlreadyProcessedException": newErrorRequestAlreadyProcessedException, + "RequestFailedException": newErrorRequestFailedException, + "RequestInProgressException": newErrorRequestInProgressException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "TooManyTagsException": newErrorTooManyTagsException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/acmpca/service.go b/vendor/github.com/aws/aws-sdk-go/service/acmpca/service.go index 6c231c1d700..57c1d570b49 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/acmpca/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/acmpca/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "acm-pca" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "ACM PCA" // ServiceID is a unique identifer of a specific service. + ServiceID = "ACM PCA" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ACMPCA client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ACMPCA client from just a session. // svc := acmpca.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := acmpca.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *ACMPCA { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ACMPCA { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ACMPCA { svc := &ACMPCA{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-08-22", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/amplify/api.go b/vendor/github.com/aws/aws-sdk-go/service/amplify/api.go index 1ab5ba1c9da..0eac1f76a1d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/amplify/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/amplify/api.go @@ -66,22 +66,22 @@ func (c *Amplify) CreateAppRequest(input *CreateAppInput) (req *request.Request, // See the AWS API reference guide for AWS Amplify's // API operation CreateApp for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // -// * ErrCodeDependentServiceFailureException "DependentServiceFailureException" +// * DependentServiceFailureException // Exception thrown when an operation fails due to a dependent service throwing // an exception. // @@ -107,6 +107,99 @@ func (c *Amplify) CreateAppWithContext(ctx aws.Context, input *CreateAppInput, o return out, req.Send() } +const opCreateBackendEnvironment = "CreateBackendEnvironment" + +// CreateBackendEnvironmentRequest generates a "aws/request.Request" representing the +// client's request for the CreateBackendEnvironment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateBackendEnvironment for more information on using the CreateBackendEnvironment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateBackendEnvironmentRequest method. +// req, resp := client.CreateBackendEnvironmentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/amplify-2017-07-25/CreateBackendEnvironment +func (c *Amplify) CreateBackendEnvironmentRequest(input *CreateBackendEnvironmentInput) (req *request.Request, output *CreateBackendEnvironmentOutput) { + op := &request.Operation{ + Name: opCreateBackendEnvironment, + HTTPMethod: "POST", + HTTPPath: "/apps/{appId}/backendenvironments", + } + + if input == nil { + input = &CreateBackendEnvironmentInput{} + } + + output = &CreateBackendEnvironmentOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateBackendEnvironment API operation for AWS Amplify. +// +// Creates a new backend environment for an Amplify App. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Amplify's +// API operation CreateBackendEnvironment for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Exception thrown when a request contains unexpected data. +// +// * UnauthorizedException +// Exception thrown when an operation fails due to a lack of access. +// +// * NotFoundException +// Exception thrown when an entity has not been found during an operation. +// +// * InternalFailureException +// Exception thrown when the service fails to perform an operation due to an +// internal issue. +// +// * LimitExceededException +// Exception thrown when a resource could not be created because of service +// limits. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/amplify-2017-07-25/CreateBackendEnvironment +func (c *Amplify) CreateBackendEnvironment(input *CreateBackendEnvironmentInput) (*CreateBackendEnvironmentOutput, error) { + req, out := c.CreateBackendEnvironmentRequest(input) + return out, req.Send() +} + +// CreateBackendEnvironmentWithContext is the same as CreateBackendEnvironment with the addition of +// the ability to pass a context and additional request options. +// +// See CreateBackendEnvironment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Amplify) CreateBackendEnvironmentWithContext(ctx aws.Context, input *CreateBackendEnvironmentInput, opts ...request.Option) (*CreateBackendEnvironmentOutput, error) { + req, out := c.CreateBackendEnvironmentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateBranch = "CreateBranch" // CreateBranchRequest generates a "aws/request.Request" representing the @@ -160,25 +253,25 @@ func (c *Amplify) CreateBranchRequest(input *CreateBranchInput) (req *request.Re // See the AWS API reference guide for AWS Amplify's // API operation CreateBranch for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // -// * ErrCodeDependentServiceFailureException "DependentServiceFailureException" +// * DependentServiceFailureException // Exception thrown when an operation fails due to a dependent service throwing // an exception. // @@ -257,18 +350,18 @@ func (c *Amplify) CreateDeploymentRequest(input *CreateDeploymentInput) (req *re // See the AWS API reference guide for AWS Amplify's // API operation CreateDeployment for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // @@ -347,25 +440,25 @@ func (c *Amplify) CreateDomainAssociationRequest(input *CreateDomainAssociationI // See the AWS API reference guide for AWS Amplify's // API operation CreateDomainAssociation for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // -// * ErrCodeDependentServiceFailureException "DependentServiceFailureException" +// * DependentServiceFailureException // Exception thrown when an operation fails due to a dependent service throwing // an exception. // @@ -444,25 +537,25 @@ func (c *Amplify) CreateWebhookRequest(input *CreateWebhookInput) (req *request. // See the AWS API reference guide for AWS Amplify's // API operation CreateWebhook for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // -// * ErrCodeDependentServiceFailureException "DependentServiceFailureException" +// * DependentServiceFailureException // Exception thrown when an operation fails due to a dependent service throwing // an exception. // @@ -541,21 +634,21 @@ func (c *Amplify) DeleteAppRequest(input *DeleteAppInput) (req *request.Request, // See the AWS API reference guide for AWS Amplify's // API operation DeleteApp for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeDependentServiceFailureException "DependentServiceFailureException" +// * DependentServiceFailureException // Exception thrown when an operation fails due to a dependent service throwing // an exception. // @@ -581,6 +674,99 @@ func (c *Amplify) DeleteAppWithContext(ctx aws.Context, input *DeleteAppInput, o return out, req.Send() } +const opDeleteBackendEnvironment = "DeleteBackendEnvironment" + +// DeleteBackendEnvironmentRequest generates a "aws/request.Request" representing the +// client's request for the DeleteBackendEnvironment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteBackendEnvironment for more information on using the DeleteBackendEnvironment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteBackendEnvironmentRequest method. +// req, resp := client.DeleteBackendEnvironmentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/amplify-2017-07-25/DeleteBackendEnvironment +func (c *Amplify) DeleteBackendEnvironmentRequest(input *DeleteBackendEnvironmentInput) (req *request.Request, output *DeleteBackendEnvironmentOutput) { + op := &request.Operation{ + Name: opDeleteBackendEnvironment, + HTTPMethod: "DELETE", + HTTPPath: "/apps/{appId}/backendenvironments/{environmentName}", + } + + if input == nil { + input = &DeleteBackendEnvironmentInput{} + } + + output = &DeleteBackendEnvironmentOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteBackendEnvironment API operation for AWS Amplify. +// +// Delete backend environment for an Amplify App. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Amplify's +// API operation DeleteBackendEnvironment for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Exception thrown when a request contains unexpected data. +// +// * UnauthorizedException +// Exception thrown when an operation fails due to a lack of access. +// +// * NotFoundException +// Exception thrown when an entity has not been found during an operation. +// +// * InternalFailureException +// Exception thrown when the service fails to perform an operation due to an +// internal issue. +// +// * DependentServiceFailureException +// Exception thrown when an operation fails due to a dependent service throwing +// an exception. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/amplify-2017-07-25/DeleteBackendEnvironment +func (c *Amplify) DeleteBackendEnvironment(input *DeleteBackendEnvironmentInput) (*DeleteBackendEnvironmentOutput, error) { + req, out := c.DeleteBackendEnvironmentRequest(input) + return out, req.Send() +} + +// DeleteBackendEnvironmentWithContext is the same as DeleteBackendEnvironment with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteBackendEnvironment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Amplify) DeleteBackendEnvironmentWithContext(ctx aws.Context, input *DeleteBackendEnvironmentInput, opts ...request.Option) (*DeleteBackendEnvironmentOutput, error) { + req, out := c.DeleteBackendEnvironmentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteBranch = "DeleteBranch" // DeleteBranchRequest generates a "aws/request.Request" representing the @@ -634,21 +820,21 @@ func (c *Amplify) DeleteBranchRequest(input *DeleteBranchInput) (req *request.Re // See the AWS API reference guide for AWS Amplify's // API operation DeleteBranch for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeDependentServiceFailureException "DependentServiceFailureException" +// * DependentServiceFailureException // Exception thrown when an operation fails due to a dependent service throwing // an exception. // @@ -727,21 +913,21 @@ func (c *Amplify) DeleteDomainAssociationRequest(input *DeleteDomainAssociationI // See the AWS API reference guide for AWS Amplify's // API operation DeleteDomainAssociation for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeDependentServiceFailureException "DependentServiceFailureException" +// * DependentServiceFailureException // Exception thrown when an operation fails due to a dependent service throwing // an exception. // @@ -820,21 +1006,21 @@ func (c *Amplify) DeleteJobRequest(input *DeleteJobInput) (req *request.Request, // See the AWS API reference guide for AWS Amplify's // API operation DeleteJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // @@ -913,21 +1099,21 @@ func (c *Amplify) DeleteWebhookRequest(input *DeleteWebhookInput) (req *request. // See the AWS API reference guide for AWS Amplify's // API operation DeleteWebhook for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // @@ -998,7 +1184,6 @@ func (c *Amplify) GenerateAccessLogsRequest(input *GenerateAccessLogsInput) (req // GenerateAccessLogs API operation for AWS Amplify. // // Retrieve website access logs for a specific time range via a pre-signed URL. -// Optionally, deliver the logs to a given S3 bucket. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1007,17 +1192,17 @@ func (c *Amplify) GenerateAccessLogsRequest(input *GenerateAccessLogsInput) (req // See the AWS API reference guide for AWS Amplify's // API operation GenerateAccessLogs for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // @@ -1096,17 +1281,17 @@ func (c *Amplify) GetAppRequest(input *GetAppInput) (req *request.Request, outpu // See the AWS API reference guide for AWS Amplify's // API operation GetApp for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // @@ -1185,21 +1370,21 @@ func (c *Amplify) GetArtifactUrlRequest(input *GetArtifactUrlInput) (req *reques // See the AWS API reference guide for AWS Amplify's // API operation GetArtifactUrl for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // @@ -1225,6 +1410,95 @@ func (c *Amplify) GetArtifactUrlWithContext(ctx aws.Context, input *GetArtifactU return out, req.Send() } +const opGetBackendEnvironment = "GetBackendEnvironment" + +// GetBackendEnvironmentRequest generates a "aws/request.Request" representing the +// client's request for the GetBackendEnvironment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBackendEnvironment for more information on using the GetBackendEnvironment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBackendEnvironmentRequest method. +// req, resp := client.GetBackendEnvironmentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/amplify-2017-07-25/GetBackendEnvironment +func (c *Amplify) GetBackendEnvironmentRequest(input *GetBackendEnvironmentInput) (req *request.Request, output *GetBackendEnvironmentOutput) { + op := &request.Operation{ + Name: opGetBackendEnvironment, + HTTPMethod: "GET", + HTTPPath: "/apps/{appId}/backendenvironments/{environmentName}", + } + + if input == nil { + input = &GetBackendEnvironmentInput{} + } + + output = &GetBackendEnvironmentOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBackendEnvironment API operation for AWS Amplify. +// +// Retrieves a backend environment for an Amplify App. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Amplify's +// API operation GetBackendEnvironment for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Exception thrown when a request contains unexpected data. +// +// * UnauthorizedException +// Exception thrown when an operation fails due to a lack of access. +// +// * NotFoundException +// Exception thrown when an entity has not been found during an operation. +// +// * InternalFailureException +// Exception thrown when the service fails to perform an operation due to an +// internal issue. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/amplify-2017-07-25/GetBackendEnvironment +func (c *Amplify) GetBackendEnvironment(input *GetBackendEnvironmentInput) (*GetBackendEnvironmentOutput, error) { + req, out := c.GetBackendEnvironmentRequest(input) + return out, req.Send() +} + +// GetBackendEnvironmentWithContext is the same as GetBackendEnvironment with the addition of +// the ability to pass a context and additional request options. +// +// See GetBackendEnvironment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Amplify) GetBackendEnvironmentWithContext(ctx aws.Context, input *GetBackendEnvironmentInput, opts ...request.Option) (*GetBackendEnvironmentOutput, error) { + req, out := c.GetBackendEnvironmentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetBranch = "GetBranch" // GetBranchRequest generates a "aws/request.Request" representing the @@ -1278,17 +1552,17 @@ func (c *Amplify) GetBranchRequest(input *GetBranchInput) (req *request.Request, // See the AWS API reference guide for AWS Amplify's // API operation GetBranch for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // @@ -1367,17 +1641,17 @@ func (c *Amplify) GetDomainAssociationRequest(input *GetDomainAssociationInput) // See the AWS API reference guide for AWS Amplify's // API operation GetDomainAssociation for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // @@ -1456,21 +1730,21 @@ func (c *Amplify) GetJobRequest(input *GetJobInput) (req *request.Request, outpu // See the AWS API reference guide for AWS Amplify's // API operation GetJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // @@ -1549,21 +1823,21 @@ func (c *Amplify) GetWebhookRequest(input *GetWebhookInput) (req *request.Reques // See the AWS API reference guide for AWS Amplify's // API operation GetWebhook for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // @@ -1642,14 +1916,14 @@ func (c *Amplify) ListAppsRequest(input *ListAppsInput) (req *request.Request, o // See the AWS API reference guide for AWS Amplify's // API operation ListApps for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // @@ -1728,18 +2002,18 @@ func (c *Amplify) ListArtifactsRequest(input *ListArtifactsInput) (req *request. // See the AWS API reference guide for AWS Amplify's // API operation ListArtifacts for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // @@ -1765,6 +2039,92 @@ func (c *Amplify) ListArtifactsWithContext(ctx aws.Context, input *ListArtifacts return out, req.Send() } +const opListBackendEnvironments = "ListBackendEnvironments" + +// ListBackendEnvironmentsRequest generates a "aws/request.Request" representing the +// client's request for the ListBackendEnvironments operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListBackendEnvironments for more information on using the ListBackendEnvironments +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListBackendEnvironmentsRequest method. +// req, resp := client.ListBackendEnvironmentsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/amplify-2017-07-25/ListBackendEnvironments +func (c *Amplify) ListBackendEnvironmentsRequest(input *ListBackendEnvironmentsInput) (req *request.Request, output *ListBackendEnvironmentsOutput) { + op := &request.Operation{ + Name: opListBackendEnvironments, + HTTPMethod: "GET", + HTTPPath: "/apps/{appId}/backendenvironments", + } + + if input == nil { + input = &ListBackendEnvironmentsInput{} + } + + output = &ListBackendEnvironmentsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListBackendEnvironments API operation for AWS Amplify. +// +// Lists backend environments for an Amplify App. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Amplify's +// API operation ListBackendEnvironments for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Exception thrown when a request contains unexpected data. +// +// * UnauthorizedException +// Exception thrown when an operation fails due to a lack of access. +// +// * InternalFailureException +// Exception thrown when the service fails to perform an operation due to an +// internal issue. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/amplify-2017-07-25/ListBackendEnvironments +func (c *Amplify) ListBackendEnvironments(input *ListBackendEnvironmentsInput) (*ListBackendEnvironmentsOutput, error) { + req, out := c.ListBackendEnvironmentsRequest(input) + return out, req.Send() +} + +// ListBackendEnvironmentsWithContext is the same as ListBackendEnvironments with the addition of +// the ability to pass a context and additional request options. +// +// See ListBackendEnvironments for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Amplify) ListBackendEnvironmentsWithContext(ctx aws.Context, input *ListBackendEnvironmentsInput, opts ...request.Option) (*ListBackendEnvironmentsOutput, error) { + req, out := c.ListBackendEnvironmentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opListBranches = "ListBranches" // ListBranchesRequest generates a "aws/request.Request" representing the @@ -1818,14 +2178,14 @@ func (c *Amplify) ListBranchesRequest(input *ListBranchesInput) (req *request.Re // See the AWS API reference guide for AWS Amplify's // API operation ListBranches for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // @@ -1904,14 +2264,14 @@ func (c *Amplify) ListDomainAssociationsRequest(input *ListDomainAssociationsInp // See the AWS API reference guide for AWS Amplify's // API operation ListDomainAssociations for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // @@ -1990,18 +2350,18 @@ func (c *Amplify) ListJobsRequest(input *ListJobsInput) (req *request.Request, o // See the AWS API reference guide for AWS Amplify's // API operation ListJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // @@ -2080,15 +2440,15 @@ func (c *Amplify) ListTagsForResourceRequest(input *ListTagsForResourceInput) (r // See the AWS API reference guide for AWS Amplify's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalFailureException "InternalFailureException" +// Returned Error Types: +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception thrown when an operation fails due to non-existent resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/amplify-2017-07-25/ListTagsForResource @@ -2166,18 +2526,18 @@ func (c *Amplify) ListWebhooksRequest(input *ListWebhooksInput) (req *request.Re // See the AWS API reference guide for AWS Amplify's // API operation ListWebhooks for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // @@ -2256,21 +2616,21 @@ func (c *Amplify) StartDeploymentRequest(input *StartDeploymentInput) (req *requ // See the AWS API reference guide for AWS Amplify's // API operation StartDeployment for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // @@ -2349,21 +2709,21 @@ func (c *Amplify) StartJobRequest(input *StartJobInput) (req *request.Request, o // See the AWS API reference guide for AWS Amplify's // API operation StartJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // @@ -2442,21 +2802,21 @@ func (c *Amplify) StopJobRequest(input *StopJobInput) (req *request.Request, out // See the AWS API reference guide for AWS Amplify's // API operation StopJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exception thrown when a resource could not be created because of service // limits. // @@ -2536,15 +2896,15 @@ func (c *Amplify) TagResourceRequest(input *TagResourceInput) (req *request.Requ // See the AWS API reference guide for AWS Amplify's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalFailureException "InternalFailureException" +// Returned Error Types: +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception thrown when an operation fails due to non-existent resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/amplify-2017-07-25/TagResource @@ -2623,15 +2983,15 @@ func (c *Amplify) UntagResourceRequest(input *UntagResourceInput) (req *request. // See the AWS API reference guide for AWS Amplify's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalFailureException "InternalFailureException" +// Returned Error Types: +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception thrown when an operation fails due to non-existent resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/amplify-2017-07-25/UntagResource @@ -2709,17 +3069,17 @@ func (c *Amplify) UpdateAppRequest(input *UpdateAppInput) (req *request.Request, // See the AWS API reference guide for AWS Amplify's // API operation UpdateApp for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // @@ -2798,21 +3158,21 @@ func (c *Amplify) UpdateBranchRequest(input *UpdateBranchInput) (req *request.Re // See the AWS API reference guide for AWS Amplify's // API operation UpdateBranch for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeDependentServiceFailureException "DependentServiceFailureException" +// * DependentServiceFailureException // Exception thrown when an operation fails due to a dependent service throwing // an exception. // @@ -2891,21 +3251,21 @@ func (c *Amplify) UpdateDomainAssociationRequest(input *UpdateDomainAssociationI // See the AWS API reference guide for AWS Amplify's // API operation UpdateDomainAssociation for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeDependentServiceFailureException "DependentServiceFailureException" +// * DependentServiceFailureException // Exception thrown when an operation fails due to a dependent service throwing // an exception. // @@ -2984,21 +3344,21 @@ func (c *Amplify) UpdateWebhookRequest(input *UpdateWebhookInput) (req *request. // See the AWS API reference guide for AWS Amplify's // API operation UpdateWebhook for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception thrown when a request contains unexpected data. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Exception thrown when an operation fails due to a lack of access. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception thrown when an entity has not been found during an operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // Exception thrown when the service fails to perform an operation due to an // internal issue. // -// * ErrCodeDependentServiceFailureException "DependentServiceFailureException" +// * DependentServiceFailureException // Exception thrown when an operation fails due to a dependent service throwing // an exception. // @@ -3315,6 +3675,9 @@ type AutoBranchCreationConfig struct { // Framework for the auto created branch. Framework *string `locationName:"framework" type:"string"` + // The Amplify Environment name for the pull request. + PullRequestEnvironmentName *string `locationName:"pullRequestEnvironmentName" type:"string"` + // Stage for the auto created branch. Stage *string `locationName:"stage" type:"string" enum:"Stage"` } @@ -3384,12 +3747,152 @@ func (s *AutoBranchCreationConfig) SetFramework(v string) *AutoBranchCreationCon return s } +// SetPullRequestEnvironmentName sets the PullRequestEnvironmentName field's value. +func (s *AutoBranchCreationConfig) SetPullRequestEnvironmentName(v string) *AutoBranchCreationConfig { + s.PullRequestEnvironmentName = &v + return s +} + // SetStage sets the Stage field's value. func (s *AutoBranchCreationConfig) SetStage(v string) *AutoBranchCreationConfig { s.Stage = &v return s } +// Backend environment for an Amplify App. +type BackendEnvironment struct { + _ struct{} `type:"structure"` + + // Arn for a backend environment, part of an Amplify App. + // + // BackendEnvironmentArn is a required field + BackendEnvironmentArn *string `locationName:"backendEnvironmentArn" min:"1" type:"string" required:"true"` + + // Creation date and time for a backend environment, part of an Amplify App. + // + // CreateTime is a required field + CreateTime *time.Time `locationName:"createTime" type:"timestamp" required:"true"` + + // Name of deployment artifacts. + DeploymentArtifacts *string `locationName:"deploymentArtifacts" min:"1" type:"string"` + + // Name for a backend environment, part of an Amplify App. + // + // EnvironmentName is a required field + EnvironmentName *string `locationName:"environmentName" min:"1" type:"string" required:"true"` + + // CloudFormation stack name of backend environment. + StackName *string `locationName:"stackName" min:"1" type:"string"` + + // Last updated date and time for a backend environment, part of an Amplify + // App. + // + // UpdateTime is a required field + UpdateTime *time.Time `locationName:"updateTime" type:"timestamp" required:"true"` +} + +// String returns the string representation +func (s BackendEnvironment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BackendEnvironment) GoString() string { + return s.String() +} + +// SetBackendEnvironmentArn sets the BackendEnvironmentArn field's value. +func (s *BackendEnvironment) SetBackendEnvironmentArn(v string) *BackendEnvironment { + s.BackendEnvironmentArn = &v + return s +} + +// SetCreateTime sets the CreateTime field's value. +func (s *BackendEnvironment) SetCreateTime(v time.Time) *BackendEnvironment { + s.CreateTime = &v + return s +} + +// SetDeploymentArtifacts sets the DeploymentArtifacts field's value. +func (s *BackendEnvironment) SetDeploymentArtifacts(v string) *BackendEnvironment { + s.DeploymentArtifacts = &v + return s +} + +// SetEnvironmentName sets the EnvironmentName field's value. +func (s *BackendEnvironment) SetEnvironmentName(v string) *BackendEnvironment { + s.EnvironmentName = &v + return s +} + +// SetStackName sets the StackName field's value. +func (s *BackendEnvironment) SetStackName(v string) *BackendEnvironment { + s.StackName = &v + return s +} + +// SetUpdateTime sets the UpdateTime field's value. +func (s *BackendEnvironment) SetUpdateTime(v time.Time) *BackendEnvironment { + s.UpdateTime = &v + return s +} + +// Exception thrown when a request contains unexpected data. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // Branch for an Amplify App, which maps to a 3rd party repository branch. type Branch struct { _ struct{} `type:"structure"` @@ -3402,6 +3905,9 @@ type Branch struct { // List of custom resources that are linked to this branch. AssociatedResources []*string `locationName:"associatedResources" type:"list"` + // ARN for a Backend Environment, part of an Amplify App. + BackendEnvironmentArn *string `locationName:"backendEnvironmentArn" min:"1" type:"string"` + // Basic Authorization credentials for a branch, part of an Amplify App. BasicAuthCredentials *string `locationName:"basicAuthCredentials" type:"string"` @@ -3471,6 +3977,9 @@ type Branch struct { // Framework is a required field Framework *string `locationName:"framework" type:"string" required:"true"` + // The Amplify Environment name for the pull request. + PullRequestEnvironmentName *string `locationName:"pullRequestEnvironmentName" type:"string"` + // The source branch if the branch is a pull request branch. SourceBranch *string `locationName:"sourceBranch" min:"1" type:"string"` @@ -3523,6 +4032,12 @@ func (s *Branch) SetAssociatedResources(v []*string) *Branch { return s } +// SetBackendEnvironmentArn sets the BackendEnvironmentArn field's value. +func (s *Branch) SetBackendEnvironmentArn(v string) *Branch { + s.BackendEnvironmentArn = &v + return s +} + // SetBasicAuthCredentials sets the BasicAuthCredentials field's value. func (s *Branch) SetBasicAuthCredentials(v string) *Branch { s.BasicAuthCredentials = &v @@ -3613,6 +4128,12 @@ func (s *Branch) SetFramework(v string) *Branch { return s } +// SetPullRequestEnvironmentName sets the PullRequestEnvironmentName field's value. +func (s *Branch) SetPullRequestEnvironmentName(v string) *Branch { + s.PullRequestEnvironmentName = &v + return s +} + // SetSourceBranch sets the SourceBranch field's value. func (s *Branch) SetSourceBranch(v string) *Branch { s.SourceBranch = &v @@ -3897,6 +4418,115 @@ func (s *CreateAppOutput) SetApp(v *App) *CreateAppOutput { return s } +// Request structure for a backend environment create request. +type CreateBackendEnvironmentInput struct { + _ struct{} `type:"structure"` + + // Unique Id for an Amplify App. + // + // AppId is a required field + AppId *string `location:"uri" locationName:"appId" min:"1" type:"string" required:"true"` + + // Name of deployment artifacts. + DeploymentArtifacts *string `locationName:"deploymentArtifacts" min:"1" type:"string"` + + // Name for the backend environment. + // + // EnvironmentName is a required field + EnvironmentName *string `locationName:"environmentName" min:"1" type:"string" required:"true"` + + // CloudFormation stack name of backend environment. + StackName *string `locationName:"stackName" min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateBackendEnvironmentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateBackendEnvironmentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateBackendEnvironmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateBackendEnvironmentInput"} + if s.AppId == nil { + invalidParams.Add(request.NewErrParamRequired("AppId")) + } + if s.AppId != nil && len(*s.AppId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AppId", 1)) + } + if s.DeploymentArtifacts != nil && len(*s.DeploymentArtifacts) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DeploymentArtifacts", 1)) + } + if s.EnvironmentName == nil { + invalidParams.Add(request.NewErrParamRequired("EnvironmentName")) + } + if s.EnvironmentName != nil && len(*s.EnvironmentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 1)) + } + if s.StackName != nil && len(*s.StackName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StackName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAppId sets the AppId field's value. +func (s *CreateBackendEnvironmentInput) SetAppId(v string) *CreateBackendEnvironmentInput { + s.AppId = &v + return s +} + +// SetDeploymentArtifacts sets the DeploymentArtifacts field's value. +func (s *CreateBackendEnvironmentInput) SetDeploymentArtifacts(v string) *CreateBackendEnvironmentInput { + s.DeploymentArtifacts = &v + return s +} + +// SetEnvironmentName sets the EnvironmentName field's value. +func (s *CreateBackendEnvironmentInput) SetEnvironmentName(v string) *CreateBackendEnvironmentInput { + s.EnvironmentName = &v + return s +} + +// SetStackName sets the StackName field's value. +func (s *CreateBackendEnvironmentInput) SetStackName(v string) *CreateBackendEnvironmentInput { + s.StackName = &v + return s +} + +// Result structure for create backend environment. +type CreateBackendEnvironmentOutput struct { + _ struct{} `type:"structure"` + + // Backend environment structure for an amplify App. + // + // BackendEnvironment is a required field + BackendEnvironment *BackendEnvironment `locationName:"backendEnvironment" type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateBackendEnvironmentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateBackendEnvironmentOutput) GoString() string { + return s.String() +} + +// SetBackendEnvironment sets the BackendEnvironment field's value. +func (s *CreateBackendEnvironmentOutput) SetBackendEnvironment(v *BackendEnvironment) *CreateBackendEnvironmentOutput { + s.BackendEnvironment = v + return s +} + // Request structure for a branch create request. type CreateBranchInput struct { _ struct{} `type:"structure"` @@ -3906,6 +4536,9 @@ type CreateBranchInput struct { // AppId is a required field AppId *string `location:"uri" locationName:"appId" min:"1" type:"string" required:"true"` + // ARN for a Backend Environment, part of an Amplify App. + BackendEnvironmentArn *string `locationName:"backendEnvironmentArn" min:"1" type:"string"` + // Basic Authorization credentials for the branch. BasicAuthCredentials *string `locationName:"basicAuthCredentials" type:"string"` @@ -3941,6 +4574,9 @@ type CreateBranchInput struct { // Framework for the branch. Framework *string `locationName:"framework" type:"string"` + // The Amplify Environment name for the pull request. + PullRequestEnvironmentName *string `locationName:"pullRequestEnvironmentName" type:"string"` + // Stage for the branch. Stage *string `locationName:"stage" type:"string" enum:"Stage"` @@ -3970,6 +4606,9 @@ func (s *CreateBranchInput) Validate() error { if s.AppId != nil && len(*s.AppId) < 1 { invalidParams.Add(request.NewErrParamMinLen("AppId", 1)) } + if s.BackendEnvironmentArn != nil && len(*s.BackendEnvironmentArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("BackendEnvironmentArn", 1)) + } if s.BranchName == nil { invalidParams.Add(request.NewErrParamRequired("BranchName")) } @@ -3995,6 +4634,12 @@ func (s *CreateBranchInput) SetAppId(v string) *CreateBranchInput { return s } +// SetBackendEnvironmentArn sets the BackendEnvironmentArn field's value. +func (s *CreateBranchInput) SetBackendEnvironmentArn(v string) *CreateBranchInput { + s.BackendEnvironmentArn = &v + return s +} + // SetBasicAuthCredentials sets the BasicAuthCredentials field's value. func (s *CreateBranchInput) SetBasicAuthCredentials(v string) *CreateBranchInput { s.BasicAuthCredentials = &v @@ -4061,6 +4706,12 @@ func (s *CreateBranchInput) SetFramework(v string) *CreateBranchInput { return s } +// SetPullRequestEnvironmentName sets the PullRequestEnvironmentName field's value. +func (s *CreateBranchInput) SetPullRequestEnvironmentName(v string) *CreateBranchInput { + s.PullRequestEnvironmentName = &v + return s +} + // SetStage sets the Stage field's value. func (s *CreateBranchInput) SetStage(v string) *CreateBranchInput { s.Stage = &v @@ -4237,7 +4888,7 @@ type CreateDomainAssociationInput struct { // DomainName is a required field DomainName *string `locationName:"domainName" type:"string" required:"true"` - // Enables automated creation of Subdomains for branches. + // Enables automated creation of Subdomains for branches. (Currently not supported) EnableAutoSubDomain *bool `locationName:"enableAutoSubDomain" type:"boolean"` // Setting structure for the Subdomain. @@ -4584,6 +5235,91 @@ func (s *DeleteAppOutput) SetApp(v *App) *DeleteAppOutput { return s } +// Request structure for delete backend environment request. +type DeleteBackendEnvironmentInput struct { + _ struct{} `type:"structure"` + + // Unique Id of an Amplify App. + // + // AppId is a required field + AppId *string `location:"uri" locationName:"appId" min:"1" type:"string" required:"true"` + + // Name of a backend environment of an Amplify App. + // + // EnvironmentName is a required field + EnvironmentName *string `location:"uri" locationName:"environmentName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteBackendEnvironmentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBackendEnvironmentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteBackendEnvironmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteBackendEnvironmentInput"} + if s.AppId == nil { + invalidParams.Add(request.NewErrParamRequired("AppId")) + } + if s.AppId != nil && len(*s.AppId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AppId", 1)) + } + if s.EnvironmentName == nil { + invalidParams.Add(request.NewErrParamRequired("EnvironmentName")) + } + if s.EnvironmentName != nil && len(*s.EnvironmentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAppId sets the AppId field's value. +func (s *DeleteBackendEnvironmentInput) SetAppId(v string) *DeleteBackendEnvironmentInput { + s.AppId = &v + return s +} + +// SetEnvironmentName sets the EnvironmentName field's value. +func (s *DeleteBackendEnvironmentInput) SetEnvironmentName(v string) *DeleteBackendEnvironmentInput { + s.EnvironmentName = &v + return s +} + +// Result structure of a delete backend environment result. +type DeleteBackendEnvironmentOutput struct { + _ struct{} `type:"structure"` + + // Backend environment structure for an Amplify App. + // + // BackendEnvironment is a required field + BackendEnvironment *BackendEnvironment `locationName:"backendEnvironment" type:"structure" required:"true"` +} + +// String returns the string representation +func (s DeleteBackendEnvironmentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBackendEnvironmentOutput) GoString() string { + return s.String() +} + +// SetBackendEnvironment sets the BackendEnvironment field's value. +func (s *DeleteBackendEnvironmentOutput) SetBackendEnvironment(v *BackendEnvironment) *DeleteBackendEnvironmentOutput { + s.BackendEnvironment = v + return s +} + // Request structure for delete branch request. type DeleteBranchInput struct { _ struct{} `type:"structure"` @@ -4924,6 +5660,63 @@ func (s *DeleteWebhookOutput) SetWebhook(v *Webhook) *DeleteWebhookOutput { return s } +// Exception thrown when an operation fails due to a dependent service throwing +// an exception. +type DependentServiceFailureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DependentServiceFailureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DependentServiceFailureException) GoString() string { + return s.String() +} + +func newErrorDependentServiceFailureException(v protocol.ResponseMetadata) error { + return &DependentServiceFailureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DependentServiceFailureException) Code() string { + return "DependentServiceFailureException" +} + +// Message returns the exception's message. +func (s DependentServiceFailureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DependentServiceFailureException) OrigErr() error { + return nil +} + +func (s DependentServiceFailureException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DependentServiceFailureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DependentServiceFailureException) RequestID() string { + return s.respMetadata.RequestID +} + // Structure for Domain Association, which associates a custom domain with an // Amplify App. type DomainAssociation struct { @@ -4947,7 +5740,7 @@ type DomainAssociation struct { // DomainStatus is a required field DomainStatus *string `locationName:"domainStatus" type:"string" required:"true" enum:"DomainStatus"` - // Enables automated creation of Subdomains for branches. + // Enables automated creation of Subdomains for branches. (Currently not supported) // // EnableAutoSubDomain is a required field EnableAutoSubDomain *bool `locationName:"enableAutoSubDomain" type:"boolean" required:"true"` @@ -5232,35 +6025,120 @@ type GetArtifactUrlOutput struct { // ArtifactId is a required field ArtifactId *string `locationName:"artifactId" type:"string" required:"true"` - // Presigned url for the artifact. + // Presigned url for the artifact. + // + // ArtifactUrl is a required field + ArtifactUrl *string `locationName:"artifactUrl" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetArtifactUrlOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetArtifactUrlOutput) GoString() string { + return s.String() +} + +// SetArtifactId sets the ArtifactId field's value. +func (s *GetArtifactUrlOutput) SetArtifactId(v string) *GetArtifactUrlOutput { + s.ArtifactId = &v + return s +} + +// SetArtifactUrl sets the ArtifactUrl field's value. +func (s *GetArtifactUrlOutput) SetArtifactUrl(v string) *GetArtifactUrlOutput { + s.ArtifactUrl = &v + return s +} + +// Request structure for get backend environment request. +type GetBackendEnvironmentInput struct { + _ struct{} `type:"structure"` + + // Unique Id for an Amplify App. + // + // AppId is a required field + AppId *string `location:"uri" locationName:"appId" min:"1" type:"string" required:"true"` + + // Name for the backend environment. + // + // EnvironmentName is a required field + EnvironmentName *string `location:"uri" locationName:"environmentName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBackendEnvironmentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBackendEnvironmentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBackendEnvironmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBackendEnvironmentInput"} + if s.AppId == nil { + invalidParams.Add(request.NewErrParamRequired("AppId")) + } + if s.AppId != nil && len(*s.AppId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AppId", 1)) + } + if s.EnvironmentName == nil { + invalidParams.Add(request.NewErrParamRequired("EnvironmentName")) + } + if s.EnvironmentName != nil && len(*s.EnvironmentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAppId sets the AppId field's value. +func (s *GetBackendEnvironmentInput) SetAppId(v string) *GetBackendEnvironmentInput { + s.AppId = &v + return s +} + +// SetEnvironmentName sets the EnvironmentName field's value. +func (s *GetBackendEnvironmentInput) SetEnvironmentName(v string) *GetBackendEnvironmentInput { + s.EnvironmentName = &v + return s +} + +// Result structure for get backend environment result. +type GetBackendEnvironmentOutput struct { + _ struct{} `type:"structure"` + + // Backend environment structure for an an Amplify App. // - // ArtifactUrl is a required field - ArtifactUrl *string `locationName:"artifactUrl" type:"string" required:"true"` + // BackendEnvironment is a required field + BackendEnvironment *BackendEnvironment `locationName:"backendEnvironment" type:"structure" required:"true"` } // String returns the string representation -func (s GetArtifactUrlOutput) String() string { +func (s GetBackendEnvironmentOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetArtifactUrlOutput) GoString() string { +func (s GetBackendEnvironmentOutput) GoString() string { return s.String() } -// SetArtifactId sets the ArtifactId field's value. -func (s *GetArtifactUrlOutput) SetArtifactId(v string) *GetArtifactUrlOutput { - s.ArtifactId = &v - return s -} - -// SetArtifactUrl sets the ArtifactUrl field's value. -func (s *GetArtifactUrlOutput) SetArtifactUrl(v string) *GetArtifactUrlOutput { - s.ArtifactUrl = &v +// SetBackendEnvironment sets the BackendEnvironment field's value. +func (s *GetBackendEnvironmentOutput) SetBackendEnvironment(v *BackendEnvironment) *GetBackendEnvironmentOutput { + s.BackendEnvironment = v return s } -// Result structure for get branch request. +// Request structure for get branch request. type GetBranchInput struct { _ struct{} `type:"structure"` @@ -5598,6 +6476,63 @@ func (s *GetWebhookOutput) SetWebhook(v *Webhook) *GetWebhookOutput { return s } +// Exception thrown when the service fails to perform an operation due to an +// internal issue. +type InternalFailureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalFailureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalFailureException) GoString() string { + return s.String() +} + +func newErrorInternalFailureException(v protocol.ResponseMetadata) error { + return &InternalFailureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalFailureException) Code() string { + return "InternalFailureException" +} + +// Message returns the exception's message. +func (s InternalFailureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalFailureException) OrigErr() error { + return nil +} + +func (s InternalFailureException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalFailureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalFailureException) RequestID() string { + return s.respMetadata.RequestID +} + // Structure for an execution job for an Amplify App. type Job struct { _ struct{} `type:"structure"` @@ -5749,6 +6684,63 @@ func (s *JobSummary) SetStatus(v string) *JobSummary { return s } +// Exception thrown when a resource could not be created because of service +// limits. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Request structure for an Amplify App list request. type ListAppsInput struct { _ struct{} `type:"structure"` @@ -5842,9 +6834,6 @@ type ListArtifactsInput struct { // AppId is a required field AppId *string `location:"uri" locationName:"appId" min:"1" type:"string" required:"true"` - // Type for an artifact. - ArtifactType *string `locationName:"artifactType" type:"string" enum:"ArtifactType"` - // Name for a branch, part of an Amplify App. // // BranchName is a required field @@ -5911,12 +6900,6 @@ func (s *ListArtifactsInput) SetAppId(v string) *ListArtifactsInput { return s } -// SetArtifactType sets the ArtifactType field's value. -func (s *ListArtifactsInput) SetArtifactType(v string) *ListArtifactsInput { - s.ArtifactType = &v - return s -} - // SetBranchName sets the BranchName field's value. func (s *ListArtifactsInput) SetBranchName(v string) *ListArtifactsInput { s.BranchName = &v @@ -5977,6 +6960,119 @@ func (s *ListArtifactsOutput) SetNextToken(v string) *ListArtifactsOutput { return s } +// Request structure for list backend environments request. +type ListBackendEnvironmentsInput struct { + _ struct{} `type:"structure"` + + // Unique Id for an amplify App. + // + // AppId is a required field + AppId *string `location:"uri" locationName:"appId" min:"1" type:"string" required:"true"` + + // Name of the backend environment + EnvironmentName *string `locationName:"environmentName" min:"1" type:"string"` + + // Maximum number of records to list in a single response. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // Pagination token. Set to null to start listing backen environments from start. + // If a non-null pagination token is returned in a result, then pass its value + // in here to list more backend environments. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListBackendEnvironmentsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListBackendEnvironmentsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListBackendEnvironmentsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListBackendEnvironmentsInput"} + if s.AppId == nil { + invalidParams.Add(request.NewErrParamRequired("AppId")) + } + if s.AppId != nil && len(*s.AppId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AppId", 1)) + } + if s.EnvironmentName != nil && len(*s.EnvironmentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EnvironmentName", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAppId sets the AppId field's value. +func (s *ListBackendEnvironmentsInput) SetAppId(v string) *ListBackendEnvironmentsInput { + s.AppId = &v + return s +} + +// SetEnvironmentName sets the EnvironmentName field's value. +func (s *ListBackendEnvironmentsInput) SetEnvironmentName(v string) *ListBackendEnvironmentsInput { + s.EnvironmentName = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListBackendEnvironmentsInput) SetMaxResults(v int64) *ListBackendEnvironmentsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListBackendEnvironmentsInput) SetNextToken(v string) *ListBackendEnvironmentsInput { + s.NextToken = &v + return s +} + +// Result structure for list backend environments result. +type ListBackendEnvironmentsOutput struct { + _ struct{} `type:"structure"` + + // List of backend environments for an Amplify App. + // + // BackendEnvironments is a required field + BackendEnvironments []*BackendEnvironment `locationName:"backendEnvironments" type:"list" required:"true"` + + // Pagination token. If non-null pagination token is returned in a result, then + // pass its value in another request to fetch more entries. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListBackendEnvironmentsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListBackendEnvironmentsOutput) GoString() string { + return s.String() +} + +// SetBackendEnvironments sets the BackendEnvironments field's value. +func (s *ListBackendEnvironmentsOutput) SetBackendEnvironments(v []*BackendEnvironment) *ListBackendEnvironmentsOutput { + s.BackendEnvironments = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListBackendEnvironmentsOutput) SetNextToken(v string) *ListBackendEnvironmentsOutput { + s.NextToken = &v + return s +} + // Request structure for list branches request. type ListBranchesInput struct { _ struct{} `type:"structure"` @@ -6464,6 +7560,62 @@ func (s *ListWebhooksOutput) SetWebhooks(v []*Webhook) *ListWebhooksOutput { return s } +// Exception thrown when an entity has not been found during an operation. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Structure with Production Branch information. type ProductionBranch struct { _ struct{} `type:"structure"` @@ -6515,6 +7667,64 @@ func (s *ProductionBranch) SetThumbnailUrl(v string) *ProductionBranch { return s } +// Exception thrown when an operation fails due to non-existent resource. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"code" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Request structure for start a deployment. type StartDeploymentInput struct { _ struct{} `type:"structure"` @@ -7169,6 +8379,62 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// Exception thrown when an operation fails due to a lack of access. +type UnauthorizedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnauthorizedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnauthorizedException) GoString() string { + return s.String() +} + +func newErrorUnauthorizedException(v protocol.ResponseMetadata) error { + return &UnauthorizedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnauthorizedException) Code() string { + return "UnauthorizedException" +} + +// Message returns the exception's message. +func (s UnauthorizedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnauthorizedException) OrigErr() error { + return nil +} + +func (s UnauthorizedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnauthorizedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnauthorizedException) RequestID() string { + return s.respMetadata.RequestID +} + // Request structure used to untag resource. type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -7493,6 +8759,9 @@ type UpdateBranchInput struct { // AppId is a required field AppId *string `location:"uri" locationName:"appId" min:"1" type:"string" required:"true"` + // ARN for a Backend Environment, part of an Amplify App. + BackendEnvironmentArn *string `locationName:"backendEnvironmentArn" min:"1" type:"string"` + // Basic Authorization credentials for the branch. BasicAuthCredentials *string `locationName:"basicAuthCredentials" type:"string"` @@ -7528,6 +8797,9 @@ type UpdateBranchInput struct { // Framework for the branch. Framework *string `locationName:"framework" type:"string"` + // The Amplify Environment name for the pull request. + PullRequestEnvironmentName *string `locationName:"pullRequestEnvironmentName" type:"string"` + // Stage for the branch. Stage *string `locationName:"stage" type:"string" enum:"Stage"` @@ -7554,6 +8826,9 @@ func (s *UpdateBranchInput) Validate() error { if s.AppId != nil && len(*s.AppId) < 1 { invalidParams.Add(request.NewErrParamMinLen("AppId", 1)) } + if s.BackendEnvironmentArn != nil && len(*s.BackendEnvironmentArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("BackendEnvironmentArn", 1)) + } if s.BranchName == nil { invalidParams.Add(request.NewErrParamRequired("BranchName")) } @@ -7576,6 +8851,12 @@ func (s *UpdateBranchInput) SetAppId(v string) *UpdateBranchInput { return s } +// SetBackendEnvironmentArn sets the BackendEnvironmentArn field's value. +func (s *UpdateBranchInput) SetBackendEnvironmentArn(v string) *UpdateBranchInput { + s.BackendEnvironmentArn = &v + return s +} + // SetBasicAuthCredentials sets the BasicAuthCredentials field's value. func (s *UpdateBranchInput) SetBasicAuthCredentials(v string) *UpdateBranchInput { s.BasicAuthCredentials = &v @@ -7642,6 +8923,12 @@ func (s *UpdateBranchInput) SetFramework(v string) *UpdateBranchInput { return s } +// SetPullRequestEnvironmentName sets the PullRequestEnvironmentName field's value. +func (s *UpdateBranchInput) SetPullRequestEnvironmentName(v string) *UpdateBranchInput { + s.PullRequestEnvironmentName = &v + return s +} + // SetStage sets the Stage field's value. func (s *UpdateBranchInput) SetStage(v string) *UpdateBranchInput { s.Stage = &v @@ -7694,7 +8981,7 @@ type UpdateDomainAssociationInput struct { // DomainName is a required field DomainName *string `location:"uri" locationName:"domainName" type:"string" required:"true"` - // Enables automated creation of Subdomains for branches. + // Enables automated creation of Subdomains for branches. (Currently not supported) EnableAutoSubDomain *bool `locationName:"enableAutoSubDomain" type:"boolean"` // Setting structure for the Subdomain. @@ -7979,11 +9266,6 @@ func (s *Webhook) SetWebhookUrl(v string) *Webhook { return s } -const ( - // ArtifactTypeTest is a ArtifactType enum value - ArtifactTypeTest = "TEST" -) - const ( // DomainStatusPendingVerification is a DomainStatus enum value DomainStatusPendingVerification = "PENDING_VERIFICATION" diff --git a/vendor/github.com/aws/aws-sdk-go/service/amplify/errors.go b/vendor/github.com/aws/aws-sdk-go/service/amplify/errors.go index ba7fd5a9acb..4e406d9ce46 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/amplify/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/amplify/errors.go @@ -2,6 +2,10 @@ package amplify +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadRequestException for service response error code @@ -49,3 +53,13 @@ const ( // Exception thrown when an operation fails due to a lack of access. ErrCodeUnauthorizedException = "UnauthorizedException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadRequestException": newErrorBadRequestException, + "DependentServiceFailureException": newErrorDependentServiceFailureException, + "InternalFailureException": newErrorInternalFailureException, + "LimitExceededException": newErrorLimitExceededException, + "NotFoundException": newErrorNotFoundException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "UnauthorizedException": newErrorUnauthorizedException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/amplify/service.go b/vendor/github.com/aws/aws-sdk-go/service/amplify/service.go index f7073bd9961..340a68be15c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/amplify/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/amplify/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "Amplify" // Name of service. EndpointsID = "amplify" // ID to lookup a service endpoint with. - ServiceID = "Amplify" // ServiceID is a unique identifer of a specific service. + ServiceID = "Amplify" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Amplify client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Amplify client from just a session. // svc := amplify.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *Amplify { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "amplify" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Amplify { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Amplify { svc := &Amplify{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-07-25", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 41fd5458bf5..e2e1306b9f2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/apigateway/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/apigateway/api.go @@ -3,6 +3,7 @@ package apigateway import ( + "fmt" "time" "github.com/aws/aws-sdk-go/aws" @@ -65,25 +66,25 @@ func (c *APIGateway) CreateApiKeyRequest(input *CreateApiKeyInput) (req *request // See the AWS API reference guide for Amazon API Gateway's // API operation CreateApiKey for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -161,21 +162,21 @@ func (c *APIGateway) CreateAuthorizerRequest(input *CreateAuthorizerInput) (req // See the AWS API reference guide for Amazon API Gateway's // API operation CreateAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -251,22 +252,22 @@ func (c *APIGateway) CreateBasePathMappingRequest(input *CreateBasePathMappingIn // See the AWS API reference guide for Amazon API Gateway's // API operation CreateBasePathMapping for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -343,29 +344,29 @@ func (c *APIGateway) CreateDeploymentRequest(input *CreateDeploymentInput) (req // See the AWS API reference guide for Amazon API Gateway's // API operation CreateDeployment for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The requested service is not available. For details see the accompanying // error message. Retry after the specified time period. // @@ -439,25 +440,25 @@ func (c *APIGateway) CreateDocumentationPartRequest(input *CreateDocumentationPa // See the AWS API reference guide for Amazon API Gateway's // API operation CreateDocumentationPart for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -531,25 +532,25 @@ func (c *APIGateway) CreateDocumentationVersionRequest(input *CreateDocumentatio // See the AWS API reference guide for Amazon API Gateway's // API operation CreateDocumentationVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -625,19 +626,19 @@ func (c *APIGateway) CreateDomainNameRequest(input *CreateDomainNameInput) (req // See the AWS API reference guide for Amazon API Gateway's // API operation CreateDomainName for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -713,25 +714,25 @@ func (c *APIGateway) CreateModelRequest(input *CreateModelInput) (req *request.R // See the AWS API reference guide for Amazon API Gateway's // API operation CreateModel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -807,21 +808,21 @@ func (c *APIGateway) CreateRequestValidatorRequest(input *CreateRequestValidator // See the AWS API reference guide for Amazon API Gateway's // API operation CreateRequestValidator for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -897,25 +898,25 @@ func (c *APIGateway) CreateResourceRequest(input *CreateResourceInput) (req *req // See the AWS API reference guide for Amazon API Gateway's // API operation CreateResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -991,18 +992,18 @@ func (c *APIGateway) CreateRestApiRequest(input *CreateRestApiInput) (req *reque // See the AWS API reference guide for Amazon API Gateway's // API operation CreateRestApi for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -1079,25 +1080,25 @@ func (c *APIGateway) CreateStageRequest(input *CreateStageInput) (req *request.R // See the AWS API reference guide for Amazon API Gateway's // API operation CreateStage for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -1174,26 +1175,26 @@ func (c *APIGateway) CreateUsagePlanRequest(input *CreateUsagePlanInput) (req *r // See the AWS API reference guide for Amazon API Gateway's // API operation CreateUsagePlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // func (c *APIGateway) CreateUsagePlan(input *CreateUsagePlanInput) (*UsagePlan, error) { @@ -1268,22 +1269,22 @@ func (c *APIGateway) CreateUsagePlanKeyRequest(input *CreateUsagePlanKeyInput) ( // See the AWS API reference guide for Amazon API Gateway's // API operation CreateUsagePlanKey for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -1362,15 +1363,15 @@ func (c *APIGateway) CreateVpcLinkRequest(input *CreateVpcLinkInput) (req *reque // See the AWS API reference guide for Amazon API Gateway's // API operation CreateVpcLink for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -1447,14 +1448,14 @@ func (c *APIGateway) DeleteApiKeyRequest(input *DeleteApiKeyInput) (req *request // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteApiKey for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -1533,22 +1534,22 @@ func (c *APIGateway) DeleteAuthorizerRequest(input *DeleteAuthorizerInput) (req // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -1625,22 +1626,22 @@ func (c *APIGateway) DeleteBasePathMappingRequest(input *DeleteBasePathMappingIn // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteBasePathMapping for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -1717,19 +1718,19 @@ func (c *APIGateway) DeleteClientCertificateRequest(input *DeleteClientCertifica // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteClientCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // func (c *APIGateway) DeleteClientCertificate(input *DeleteClientCertificateInput) (*DeleteClientCertificateOutput, error) { @@ -1806,18 +1807,18 @@ func (c *APIGateway) DeleteDeploymentRequest(input *DeleteDeploymentInput) (req // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteDeployment for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -1892,22 +1893,22 @@ func (c *APIGateway) DeleteDocumentationPartRequest(input *DeleteDocumentationPa // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteDocumentationPart for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // @@ -1982,22 +1983,22 @@ func (c *APIGateway) DeleteDocumentationVersionRequest(input *DeleteDocumentatio // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteDocumentationVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -2074,18 +2075,18 @@ func (c *APIGateway) DeleteDomainNameRequest(input *DeleteDomainNameInput) (req // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteDomainName for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // @@ -2163,22 +2164,22 @@ func (c *APIGateway) DeleteGatewayResponseRequest(input *DeleteGatewayResponseIn // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteGatewayResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -2255,18 +2256,18 @@ func (c *APIGateway) DeleteIntegrationRequest(input *DeleteIntegrationInput) (re // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteIntegration for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -2343,22 +2344,22 @@ func (c *APIGateway) DeleteIntegrationResponseRequest(input *DeleteIntegrationRe // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteIntegrationResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -2435,18 +2436,18 @@ func (c *APIGateway) DeleteMethodRequest(input *DeleteMethodInput) (req *request // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteMethod for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -2523,22 +2524,22 @@ func (c *APIGateway) DeleteMethodResponseRequest(input *DeleteMethodResponseInpu // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteMethodResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -2615,22 +2616,22 @@ func (c *APIGateway) DeleteModelRequest(input *DeleteModelInput) (req *request.R // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteModel for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -2707,22 +2708,22 @@ func (c *APIGateway) DeleteRequestValidatorRequest(input *DeleteRequestValidator // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteRequestValidator for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -2799,22 +2800,22 @@ func (c *APIGateway) DeleteResourceRequest(input *DeleteResourceInput) (req *req // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -2891,18 +2892,18 @@ func (c *APIGateway) DeleteRestApiRequest(input *DeleteRestApiInput) (req *reque // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteRestApi for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // @@ -2979,18 +2980,18 @@ func (c *APIGateway) DeleteStageRequest(input *DeleteStageInput) (req *request.R // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteStage for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // @@ -3067,19 +3068,19 @@ func (c *APIGateway) DeleteUsagePlanRequest(input *DeleteUsagePlanInput) (req *r // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteUsagePlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // func (c *APIGateway) DeleteUsagePlan(input *DeleteUsagePlanInput) (*DeleteUsagePlanOutput, error) { @@ -3156,22 +3157,22 @@ func (c *APIGateway) DeleteUsagePlanKeyRequest(input *DeleteUsagePlanKeyInput) ( // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteUsagePlanKey for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -3248,18 +3249,18 @@ func (c *APIGateway) DeleteVpcLinkRequest(input *DeleteVpcLinkInput) (req *reque // See the AWS API reference guide for Amazon API Gateway's // API operation DeleteVpcLink for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // @@ -3336,18 +3337,18 @@ func (c *APIGateway) FlushStageAuthorizersCacheRequest(input *FlushStageAuthoriz // See the AWS API reference guide for Amazon API Gateway's // API operation FlushStageAuthorizersCache for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -3424,18 +3425,18 @@ func (c *APIGateway) FlushStageCacheRequest(input *FlushStageCacheInput) (req *r // See the AWS API reference guide for Amazon API Gateway's // API operation FlushStageCache for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -3511,15 +3512,15 @@ func (c *APIGateway) GenerateClientCertificateRequest(input *GenerateClientCerti // See the AWS API reference guide for Amazon API Gateway's // API operation GenerateClientCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // func (c *APIGateway) GenerateClientCertificate(input *GenerateClientCertificateInput) (*ClientCertificate, error) { @@ -3594,14 +3595,14 @@ func (c *APIGateway) GetAccountRequest(input *GetAccountInput) (req *request.Req // See the AWS API reference guide for Amazon API Gateway's // API operation GetAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -3677,14 +3678,14 @@ func (c *APIGateway) GetApiKeyRequest(input *GetApiKeyInput) (req *request.Reque // See the AWS API reference guide for Amazon API Gateway's // API operation GetApiKey for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -3766,15 +3767,15 @@ func (c *APIGateway) GetApiKeysRequest(input *GetApiKeysInput) (req *request.Req // See the AWS API reference guide for Amazon API Gateway's // API operation GetApiKeys for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -3842,10 +3843,12 @@ func (c *APIGateway) GetApiKeysPagesWithContext(ctx aws.Context, input *GetApiKe }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetApiKeysOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetApiKeysOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3902,14 +3905,14 @@ func (c *APIGateway) GetAuthorizerRequest(input *GetAuthorizerInput) (req *reque // See the AWS API reference guide for Amazon API Gateway's // API operation GetAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -3987,18 +3990,18 @@ func (c *APIGateway) GetAuthorizersRequest(input *GetAuthorizersInput) (req *req // See the AWS API reference guide for Amazon API Gateway's // API operation GetAuthorizers for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -4074,14 +4077,14 @@ func (c *APIGateway) GetBasePathMappingRequest(input *GetBasePathMappingInput) ( // See the AWS API reference guide for Amazon API Gateway's // API operation GetBasePathMapping for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -4163,14 +4166,14 @@ func (c *APIGateway) GetBasePathMappingsRequest(input *GetBasePathMappingsInput) // See the AWS API reference guide for Amazon API Gateway's // API operation GetBasePathMappings for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -4238,10 +4241,12 @@ func (c *APIGateway) GetBasePathMappingsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetBasePathMappingsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetBasePathMappingsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4296,14 +4301,14 @@ func (c *APIGateway) GetClientCertificateRequest(input *GetClientCertificateInpu // See the AWS API reference guide for Amazon API Gateway's // API operation GetClientCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -4385,15 +4390,15 @@ func (c *APIGateway) GetClientCertificatesRequest(input *GetClientCertificatesIn // See the AWS API reference guide for Amazon API Gateway's // API operation GetClientCertificates for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -4461,10 +4466,12 @@ func (c *APIGateway) GetClientCertificatesPagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetClientCertificatesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetClientCertificatesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4519,18 +4526,18 @@ func (c *APIGateway) GetDeploymentRequest(input *GetDeploymentInput) (req *reque // See the AWS API reference guide for Amazon API Gateway's // API operation GetDeployment for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The requested service is not available. For details see the accompanying // error message. Retry after the specified time period. // @@ -4612,19 +4619,19 @@ func (c *APIGateway) GetDeploymentsRequest(input *GetDeploymentsInput) (req *req // See the AWS API reference guide for Amazon API Gateway's // API operation GetDeployments for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The requested service is not available. For details see the accompanying // error message. Retry after the specified time period. // @@ -4692,10 +4699,12 @@ func (c *APIGateway) GetDeploymentsPagesWithContext(ctx aws.Context, input *GetD }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetDeploymentsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetDeploymentsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4748,14 +4757,14 @@ func (c *APIGateway) GetDocumentationPartRequest(input *GetDocumentationPartInpu // See the AWS API reference guide for Amazon API Gateway's // API operation GetDocumentationPart for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -4829,18 +4838,18 @@ func (c *APIGateway) GetDocumentationPartsRequest(input *GetDocumentationPartsIn // See the AWS API reference guide for Amazon API Gateway's // API operation GetDocumentationParts for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -4914,14 +4923,14 @@ func (c *APIGateway) GetDocumentationVersionRequest(input *GetDocumentationVersi // See the AWS API reference guide for Amazon API Gateway's // API operation GetDocumentationVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -4995,18 +5004,18 @@ func (c *APIGateway) GetDocumentationVersionsRequest(input *GetDocumentationVers // See the AWS API reference guide for Amazon API Gateway's // API operation GetDocumentationVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -5083,18 +5092,18 @@ func (c *APIGateway) GetDomainNameRequest(input *GetDomainNameInput) (req *reque // See the AWS API reference guide for Amazon API Gateway's // API operation GetDomainName for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The requested service is not available. For details see the accompanying // error message. Retry after the specified time period. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -5176,15 +5185,15 @@ func (c *APIGateway) GetDomainNamesRequest(input *GetDomainNamesInput) (req *req // See the AWS API reference guide for Amazon API Gateway's // API operation GetDomainNames for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -5252,10 +5261,12 @@ func (c *APIGateway) GetDomainNamesPagesWithContext(ctx aws.Context, input *GetD }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetDomainNamesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetDomainNamesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5310,22 +5321,22 @@ func (c *APIGateway) GetExportRequest(input *GetExportInput) (req *request.Reque // See the AWS API reference guide for Amazon API Gateway's // API operation GetExport for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -5401,14 +5412,14 @@ func (c *APIGateway) GetGatewayResponseRequest(input *GetGatewayResponseInput) ( // See the AWS API reference guide for Amazon API Gateway's // API operation GetGatewayResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -5487,18 +5498,18 @@ func (c *APIGateway) GetGatewayResponsesRequest(input *GetGatewayResponsesInput) // See the AWS API reference guide for Amazon API Gateway's // API operation GetGatewayResponses for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -5574,14 +5585,14 @@ func (c *APIGateway) GetIntegrationRequest(input *GetIntegrationInput) (req *req // See the AWS API reference guide for Amazon API Gateway's // API operation GetIntegration for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -5657,14 +5668,14 @@ func (c *APIGateway) GetIntegrationResponseRequest(input *GetIntegrationResponse // See the AWS API reference guide for Amazon API Gateway's // API operation GetIntegrationResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -5740,14 +5751,14 @@ func (c *APIGateway) GetMethodRequest(input *GetMethodInput) (req *request.Reque // See the AWS API reference guide for Amazon API Gateway's // API operation GetMethod for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -5823,14 +5834,14 @@ func (c *APIGateway) GetMethodResponseRequest(input *GetMethodResponseInput) (re // See the AWS API reference guide for Amazon API Gateway's // API operation GetMethodResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -5906,14 +5917,14 @@ func (c *APIGateway) GetModelRequest(input *GetModelInput) (req *request.Request // See the AWS API reference guide for Amazon API Gateway's // API operation GetModel for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -5990,18 +6001,18 @@ func (c *APIGateway) GetModelTemplateRequest(input *GetModelTemplateInput) (req // See the AWS API reference guide for Amazon API Gateway's // API operation GetModelTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -6083,18 +6094,18 @@ func (c *APIGateway) GetModelsRequest(input *GetModelsInput) (req *request.Reque // See the AWS API reference guide for Amazon API Gateway's // API operation GetModels for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -6162,10 +6173,12 @@ func (c *APIGateway) GetModelsPagesWithContext(ctx aws.Context, input *GetModels }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetModelsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetModelsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6220,14 +6233,14 @@ func (c *APIGateway) GetRequestValidatorRequest(input *GetRequestValidatorInput) // See the AWS API reference guide for Amazon API Gateway's // API operation GetRequestValidator for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -6303,18 +6316,18 @@ func (c *APIGateway) GetRequestValidatorsRequest(input *GetRequestValidatorsInpu // See the AWS API reference guide for Amazon API Gateway's // API operation GetRequestValidators for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -6390,14 +6403,14 @@ func (c *APIGateway) GetResourceRequest(input *GetResourceInput) (req *request.R // See the AWS API reference guide for Amazon API Gateway's // API operation GetResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -6479,18 +6492,18 @@ func (c *APIGateway) GetResourcesRequest(input *GetResourcesInput) (req *request // See the AWS API reference guide for Amazon API Gateway's // API operation GetResources for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -6558,10 +6571,12 @@ func (c *APIGateway) GetResourcesPagesWithContext(ctx aws.Context, input *GetRes }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetResourcesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetResourcesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6616,14 +6631,14 @@ func (c *APIGateway) GetRestApiRequest(input *GetRestApiInput) (req *request.Req // See the AWS API reference guide for Amazon API Gateway's // API operation GetRestApi for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -6705,15 +6720,15 @@ func (c *APIGateway) GetRestApisRequest(input *GetRestApisInput) (req *request.R // See the AWS API reference guide for Amazon API Gateway's // API operation GetRestApis for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -6781,10 +6796,12 @@ func (c *APIGateway) GetRestApisPagesWithContext(ctx aws.Context, input *GetRest }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetRestApisOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetRestApisOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6839,22 +6856,22 @@ func (c *APIGateway) GetSdkRequest(input *GetSdkInput) (req *request.Request, ou // See the AWS API reference guide for Amazon API Gateway's // API operation GetSdk for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -6928,14 +6945,14 @@ func (c *APIGateway) GetSdkTypeRequest(input *GetSdkTypeInput) (req *request.Req // See the AWS API reference guide for Amazon API Gateway's // API operation GetSdkType for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -7009,11 +7026,11 @@ func (c *APIGateway) GetSdkTypesRequest(input *GetSdkTypesInput) (req *request.R // See the AWS API reference guide for Amazon API Gateway's // API operation GetSdkTypes for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -7089,14 +7106,14 @@ func (c *APIGateway) GetStageRequest(input *GetStageInput) (req *request.Request // See the AWS API reference guide for Amazon API Gateway's // API operation GetStage for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -7172,14 +7189,14 @@ func (c *APIGateway) GetStagesRequest(input *GetStagesInput) (req *request.Reque // See the AWS API reference guide for Amazon API Gateway's // API operation GetStages for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -7255,22 +7272,22 @@ func (c *APIGateway) GetTagsRequest(input *GetTagsInput) (req *request.Request, // See the AWS API reference guide for Amazon API Gateway's // API operation GetTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // func (c *APIGateway) GetTags(input *GetTagsInput) (*GetTagsOutput, error) { @@ -7351,18 +7368,18 @@ func (c *APIGateway) GetUsageRequest(input *GetUsageInput) (req *request.Request // See the AWS API reference guide for Amazon API Gateway's // API operation GetUsage for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -7430,10 +7447,12 @@ func (c *APIGateway) GetUsagePagesWithContext(ctx aws.Context, input *GetUsageIn }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*Usage), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*Usage), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7488,18 +7507,18 @@ func (c *APIGateway) GetUsagePlanRequest(input *GetUsagePlanInput) (req *request // See the AWS API reference guide for Amazon API Gateway's // API operation GetUsagePlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -7575,18 +7594,18 @@ func (c *APIGateway) GetUsagePlanKeyRequest(input *GetUsagePlanKeyInput) (req *r // See the AWS API reference guide for Amazon API Gateway's // API operation GetUsagePlanKey for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -7669,18 +7688,18 @@ func (c *APIGateway) GetUsagePlanKeysRequest(input *GetUsagePlanKeysInput) (req // See the AWS API reference guide for Amazon API Gateway's // API operation GetUsagePlanKeys for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -7748,10 +7767,12 @@ func (c *APIGateway) GetUsagePlanKeysPagesWithContext(ctx aws.Context, input *Ge }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetUsagePlanKeysOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetUsagePlanKeysOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7812,23 +7833,23 @@ func (c *APIGateway) GetUsagePlansRequest(input *GetUsagePlansInput) (req *reque // See the AWS API reference guide for Amazon API Gateway's // API operation GetUsagePlans for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // func (c *APIGateway) GetUsagePlans(input *GetUsagePlansInput) (*GetUsagePlansOutput, error) { @@ -7895,10 +7916,12 @@ func (c *APIGateway) GetUsagePlansPagesWithContext(ctx aws.Context, input *GetUs }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetUsagePlansOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetUsagePlansOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7953,14 +7976,14 @@ func (c *APIGateway) GetVpcLinkRequest(input *GetVpcLinkInput) (req *request.Req // See the AWS API reference guide for Amazon API Gateway's // API operation GetVpcLink for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -8042,15 +8065,15 @@ func (c *APIGateway) GetVpcLinksRequest(input *GetVpcLinksInput) (req *request.R // See the AWS API reference guide for Amazon API Gateway's // API operation GetVpcLinks for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -8118,10 +8141,12 @@ func (c *APIGateway) GetVpcLinksPagesWithContext(ctx aws.Context, input *GetVpcL }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetVpcLinksOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetVpcLinksOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8176,25 +8201,25 @@ func (c *APIGateway) ImportApiKeysRequest(input *ImportApiKeysInput) (req *reque // See the AWS API reference guide for Amazon API Gateway's // API operation ImportApiKeys for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -8268,21 +8293,21 @@ func (c *APIGateway) ImportDocumentationPartsRequest(input *ImportDocumentationP // See the AWS API reference guide for Amazon API Gateway's // API operation ImportDocumentationParts for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -8359,22 +8384,22 @@ func (c *APIGateway) ImportRestApiRequest(input *ImportRestApiInput) (req *reque // See the AWS API reference guide for Amazon API Gateway's // API operation ImportRestApi for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -8451,21 +8476,21 @@ func (c *APIGateway) PutGatewayResponseRequest(input *PutGatewayResponseInput) ( // See the AWS API reference guide for Amazon API Gateway's // API operation PutGatewayResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -8541,22 +8566,22 @@ func (c *APIGateway) PutIntegrationRequest(input *PutIntegrationInput) (req *req // See the AWS API reference guide for Amazon API Gateway's // API operation PutIntegration for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -8632,25 +8657,25 @@ func (c *APIGateway) PutIntegrationResponseRequest(input *PutIntegrationResponse // See the AWS API reference guide for Amazon API Gateway's // API operation PutIntegrationResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -8726,25 +8751,25 @@ func (c *APIGateway) PutMethodRequest(input *PutMethodInput) (req *request.Reque // See the AWS API reference guide for Amazon API Gateway's // API operation PutMethod for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -8820,25 +8845,25 @@ func (c *APIGateway) PutMethodResponseRequest(input *PutMethodResponseInput) (re // See the AWS API reference guide for Amazon API Gateway's // API operation PutMethodResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -8917,25 +8942,25 @@ func (c *APIGateway) PutRestApiRequest(input *PutRestApiInput) (req *request.Req // See the AWS API reference guide for Amazon API Gateway's // API operation PutRestApi for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -9012,25 +9037,25 @@ func (c *APIGateway) TagResourceRequest(input *TagResourceInput) (req *request.R // See the AWS API reference guide for Amazon API Gateway's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -9110,18 +9135,18 @@ func (c *APIGateway) TestInvokeAuthorizerRequest(input *TestInvokeAuthorizerInpu // See the AWS API reference guide for Amazon API Gateway's // API operation TestInvokeAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -9198,18 +9223,18 @@ func (c *APIGateway) TestInvokeMethodRequest(input *TestInvokeMethodInput) (req // See the AWS API reference guide for Amazon API Gateway's // API operation TestInvokeMethod for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -9286,22 +9311,22 @@ func (c *APIGateway) UntagResourceRequest(input *UntagResourceInput) (req *reque // See the AWS API reference guide for Amazon API Gateway's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -9377,18 +9402,18 @@ func (c *APIGateway) UpdateAccountRequest(input *UpdateAccountInput) (req *reque // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -9464,22 +9489,22 @@ func (c *APIGateway) UpdateApiKeyRequest(input *UpdateApiKeyInput) (req *request // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateApiKey for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -9557,18 +9582,18 @@ func (c *APIGateway) UpdateAuthorizerRequest(input *UpdateAuthorizerInput) (req // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -9644,22 +9669,22 @@ func (c *APIGateway) UpdateBasePathMappingRequest(input *UpdateBasePathMappingIn // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateBasePathMapping for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -9735,19 +9760,19 @@ func (c *APIGateway) UpdateClientCertificateRequest(input *UpdateClientCertifica // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateClientCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // func (c *APIGateway) UpdateClientCertificate(input *UpdateClientCertificateInput) (*ClientCertificate, error) { @@ -9822,22 +9847,22 @@ func (c *APIGateway) UpdateDeploymentRequest(input *UpdateDeploymentInput) (req // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateDeployment for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The requested service is not available. For details see the accompanying // error message. Retry after the specified time period. // @@ -9911,25 +9936,25 @@ func (c *APIGateway) UpdateDocumentationPartRequest(input *UpdateDocumentationPa // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateDocumentationPart for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -10003,22 +10028,22 @@ func (c *APIGateway) UpdateDocumentationVersionRequest(input *UpdateDocumentatio // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateDocumentationVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -10094,22 +10119,22 @@ func (c *APIGateway) UpdateDomainNameRequest(input *UpdateDomainNameInput) (req // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateDomainName for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -10185,18 +10210,18 @@ func (c *APIGateway) UpdateGatewayResponseRequest(input *UpdateGatewayResponseIn // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateGatewayResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -10272,22 +10297,22 @@ func (c *APIGateway) UpdateIntegrationRequest(input *UpdateIntegrationInput) (re // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateIntegration for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -10363,22 +10388,22 @@ func (c *APIGateway) UpdateIntegrationResponseRequest(input *UpdateIntegrationRe // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateIntegrationResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -10454,22 +10479,22 @@ func (c *APIGateway) UpdateMethodRequest(input *UpdateMethodInput) (req *request // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateMethod for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -10545,25 +10570,25 @@ func (c *APIGateway) UpdateMethodResponseRequest(input *UpdateMethodResponseInpu // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateMethodResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded the rate limit. Retry after the specified time period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -10639,22 +10664,22 @@ func (c *APIGateway) UpdateModelRequest(input *UpdateModelInput) (req *request.R // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateModel for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -10730,18 +10755,18 @@ func (c *APIGateway) UpdateRequestValidatorRequest(input *UpdateRequestValidator // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateRequestValidator for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -10817,22 +10842,22 @@ func (c *APIGateway) UpdateResourceRequest(input *UpdateResourceInput) (req *req // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -10908,22 +10933,22 @@ func (c *APIGateway) UpdateRestApiRequest(input *UpdateRestApiInput) (req *reque // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateRestApi for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -10999,22 +11024,22 @@ func (c *APIGateway) UpdateStageRequest(input *UpdateStageInput) (req *request.R // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateStage for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -11091,19 +11116,19 @@ func (c *APIGateway) UpdateUsageRequest(input *UpdateUsageInput) (req *request.R // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateUsage for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // func (c *APIGateway) UpdateUsage(input *UpdateUsageInput) (*Usage, error) { @@ -11178,22 +11203,22 @@ func (c *APIGateway) UpdateUsagePlanRequest(input *UpdateUsagePlanInput) (req *r // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateUsagePlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // @@ -11269,22 +11294,22 @@ func (c *APIGateway) UpdateVpcLinkRequest(input *UpdateVpcLinkInput) (req *reque // See the AWS API reference guide for Amazon API Gateway's // API operation UpdateVpcLink for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request is denied because the caller has insufficient permissions. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource is not found. Make sure that the request URI is correct. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The submitted request is not valid, for example, the input is incomplete // or incorrect. See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request configuration has conflicts. For details, see the accompanying // error message. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The request has reached its throttling limit. Retry after the specified time // period. // @@ -11739,6 +11764,63 @@ func (s *Authorizer) SetType(v string) *Authorizer { return s } +// The submitted request is not valid, for example, the input is incomplete +// or incorrect. See the accompanying error message for details. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents the base path that callers of the API must provide as part of // the URL after the domain name. // @@ -11919,6 +12001,63 @@ func (s *ClientCertificate) SetTags(v map[string]*string) *ClientCertificate { return s } +// The request configuration has conflicts. For details, see the accompanying +// error message. +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictException) GoString() string { + return s.String() +} + +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" +} + +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil +} + +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID +} + // Request to create an ApiKey resource. type CreateApiKeyInput struct { _ struct{} `type:"structure"` @@ -20142,6 +20281,64 @@ func (s *IntegrationResponse) SetStatusCode(v string) *IntegrationResponse { return s } +// The request exceeded the rate limit. Retry after the specified time period. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + RetryAfterSeconds *string `location:"header" locationName:"Retry-After" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // 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 @@ -20731,6 +20928,62 @@ func (s *Model) SetSchema(v string) *Model { return s } +// The requested resource is not found. Make sure that the request URI is correct. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // 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. @@ -22139,6 +22392,65 @@ func (s *SdkType) SetId(v string) *SdkType { return s } +// The requested service is not available. For details see the accompanying +// error message. Retry after the specified time period. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + RetryAfterSeconds *string `location:"header" locationName:"Retry-After" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents a unique identifier for a version of a deployed RestApi that is // callable by users. // @@ -22863,6 +23175,121 @@ func (s *ThrottleSettings) SetRateLimit(v float64) *ThrottleSettings { return s } +// The request has reached its throttling limit. Retry after the specified time +// period. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + RetryAfterSeconds *string `location:"header" locationName:"Retry-After" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request is denied because the caller has insufficient permissions. +type UnauthorizedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnauthorizedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnauthorizedException) GoString() string { + return s.String() +} + +func newErrorUnauthorizedException(v protocol.ResponseMetadata) error { + return &UnauthorizedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnauthorizedException) Code() string { + return "UnauthorizedException" +} + +// Message returns the exception's message. +func (s UnauthorizedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnauthorizedException) OrigErr() error { + return nil +} + +func (s UnauthorizedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnauthorizedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnauthorizedException) RequestID() string { + return s.respMetadata.RequestID +} + // Removes a tag from a given resource. type UntagResourceInput struct { _ struct{} `type:"structure"` 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 index 99208e8455f..fffbcf214b3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/apigateway/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/apigateway/errors.go @@ -2,6 +2,10 @@ package apigateway +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadRequestException for service response error code @@ -50,3 +54,13 @@ const ( // The request is denied because the caller has insufficient permissions. ErrCodeUnauthorizedException = "UnauthorizedException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadRequestException": newErrorBadRequestException, + "ConflictException": newErrorConflictException, + "LimitExceededException": newErrorLimitExceededException, + "NotFoundException": newErrorNotFoundException, + "ServiceUnavailableException": newErrorServiceUnavailableException, + "TooManyRequestsException": newErrorTooManyRequestsException, + "UnauthorizedException": newErrorUnauthorizedException, +} 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 index 8064d24fc02..2f7f7f30c8e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/apigateway/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/apigateway/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "apigateway" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "API Gateway" // ServiceID is a unique identifer of a specific service. + ServiceID = "API Gateway" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the APIGateway client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a APIGateway client from just a session. // svc := apigateway.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *APIGateway { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *APIGateway { svc := &APIGateway{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-07-09", }, @@ -71,7 +75,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/apigatewayv2/api.go b/vendor/github.com/aws/aws-sdk-go/service/apigatewayv2/api.go index 75480a1c75d..7f2175abdf5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/apigatewayv2/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/apigatewayv2/api.go @@ -3,6 +3,7 @@ package apigatewayv2 import ( + "fmt" "time" "github.com/aws/aws-sdk-go/aws" @@ -65,19 +66,19 @@ func (c *ApiGatewayV2) CreateApiRequest(input *CreateApiInput) (req *request.Req // See the AWS API reference guide for AmazonApiGatewayV2's // API operation CreateApi for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -157,19 +158,19 @@ func (c *ApiGatewayV2) CreateApiMappingRequest(input *CreateApiMappingInput) (re // See the AWS API reference guide for AmazonApiGatewayV2's // API operation CreateApiMapping for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -249,19 +250,19 @@ func (c *ApiGatewayV2) CreateAuthorizerRequest(input *CreateAuthorizerInput) (re // See the AWS API reference guide for AmazonApiGatewayV2's // API operation CreateAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -341,19 +342,19 @@ func (c *ApiGatewayV2) CreateDeploymentRequest(input *CreateDeploymentInput) (re // See the AWS API reference guide for AmazonApiGatewayV2's // API operation CreateDeployment for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -433,23 +434,25 @@ func (c *ApiGatewayV2) CreateDomainNameRequest(input *CreateDomainNameInput) (re // See the AWS API reference guide for AmazonApiGatewayV2's // API operation CreateDomainName for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. // +// * AccessDeniedException +// // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/CreateDomainName func (c *ApiGatewayV2) CreateDomainName(input *CreateDomainNameInput) (*CreateDomainNameOutput, error) { req, out := c.CreateDomainNameRequest(input) @@ -525,19 +528,19 @@ func (c *ApiGatewayV2) CreateIntegrationRequest(input *CreateIntegrationInput) ( // See the AWS API reference guide for AmazonApiGatewayV2's // API operation CreateIntegration for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -617,19 +620,19 @@ func (c *ApiGatewayV2) CreateIntegrationResponseRequest(input *CreateIntegration // See the AWS API reference guide for AmazonApiGatewayV2's // API operation CreateIntegrationResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -709,19 +712,19 @@ func (c *ApiGatewayV2) CreateModelRequest(input *CreateModelInput) (req *request // See the AWS API reference guide for AmazonApiGatewayV2's // API operation CreateModel for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -801,19 +804,19 @@ func (c *ApiGatewayV2) CreateRouteRequest(input *CreateRouteInput) (req *request // See the AWS API reference guide for AmazonApiGatewayV2's // API operation CreateRoute for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -893,19 +896,19 @@ func (c *ApiGatewayV2) CreateRouteResponseRequest(input *CreateRouteResponseInpu // See the AWS API reference guide for AmazonApiGatewayV2's // API operation CreateRouteResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -985,19 +988,19 @@ func (c *ApiGatewayV2) CreateStageRequest(input *CreateStageInput) (req *request // See the AWS API reference guide for AmazonApiGatewayV2's // API operation CreateStage for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -1078,12 +1081,12 @@ func (c *ApiGatewayV2) DeleteApiRequest(input *DeleteApiInput) (req *request.Req // See the AWS API reference guide for AmazonApiGatewayV2's // API operation DeleteApi for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/DeleteApi @@ -1162,15 +1165,15 @@ func (c *ApiGatewayV2) DeleteApiMappingRequest(input *DeleteApiMappingInput) (re // See the AWS API reference guide for AmazonApiGatewayV2's // API operation DeleteApiMapping for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // @@ -1250,12 +1253,12 @@ func (c *ApiGatewayV2) DeleteAuthorizerRequest(input *DeleteAuthorizerInput) (re // See the AWS API reference guide for AmazonApiGatewayV2's // API operation DeleteAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/DeleteAuthorizer @@ -1280,6 +1283,90 @@ func (c *ApiGatewayV2) DeleteAuthorizerWithContext(ctx aws.Context, input *Delet return out, req.Send() } +const opDeleteCorsConfiguration = "DeleteCorsConfiguration" + +// DeleteCorsConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteCorsConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteCorsConfiguration for more information on using the DeleteCorsConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteCorsConfigurationRequest method. +// req, resp := client.DeleteCorsConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/DeleteCorsConfiguration +func (c *ApiGatewayV2) DeleteCorsConfigurationRequest(input *DeleteCorsConfigurationInput) (req *request.Request, output *DeleteCorsConfigurationOutput) { + op := &request.Operation{ + Name: opDeleteCorsConfiguration, + HTTPMethod: "DELETE", + HTTPPath: "/v2/apis/{apiId}/cors", + } + + if input == nil { + input = &DeleteCorsConfigurationInput{} + } + + output = &DeleteCorsConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteCorsConfiguration API operation for AmazonApiGatewayV2. +// +// Deletes a CORS 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 AmazonApiGatewayV2's +// API operation DeleteCorsConfiguration for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// The resource specified in the request was not found. See the message field +// for more information. +// +// * TooManyRequestsException +// A limit has been exceeded. See the accompanying error message for details. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/DeleteCorsConfiguration +func (c *ApiGatewayV2) DeleteCorsConfiguration(input *DeleteCorsConfigurationInput) (*DeleteCorsConfigurationOutput, error) { + req, out := c.DeleteCorsConfigurationRequest(input) + return out, req.Send() +} + +// DeleteCorsConfigurationWithContext is the same as DeleteCorsConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteCorsConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ApiGatewayV2) DeleteCorsConfigurationWithContext(ctx aws.Context, input *DeleteCorsConfigurationInput, opts ...request.Option) (*DeleteCorsConfigurationOutput, error) { + req, out := c.DeleteCorsConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteDeployment = "DeleteDeployment" // DeleteDeploymentRequest generates a "aws/request.Request" representing the @@ -1334,12 +1421,12 @@ func (c *ApiGatewayV2) DeleteDeploymentRequest(input *DeleteDeploymentInput) (re // See the AWS API reference guide for AmazonApiGatewayV2's // API operation DeleteDeployment for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/DeleteDeployment @@ -1418,12 +1505,12 @@ func (c *ApiGatewayV2) DeleteDomainNameRequest(input *DeleteDomainNameInput) (re // See the AWS API reference guide for AmazonApiGatewayV2's // API operation DeleteDomainName for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/DeleteDomainName @@ -1502,12 +1589,12 @@ func (c *ApiGatewayV2) DeleteIntegrationRequest(input *DeleteIntegrationInput) ( // See the AWS API reference guide for AmazonApiGatewayV2's // API operation DeleteIntegration for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/DeleteIntegration @@ -1586,12 +1673,12 @@ func (c *ApiGatewayV2) DeleteIntegrationResponseRequest(input *DeleteIntegration // See the AWS API reference guide for AmazonApiGatewayV2's // API operation DeleteIntegrationResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/DeleteIntegrationResponse @@ -1670,12 +1757,12 @@ func (c *ApiGatewayV2) DeleteModelRequest(input *DeleteModelInput) (req *request // See the AWS API reference guide for AmazonApiGatewayV2's // API operation DeleteModel for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/DeleteModel @@ -1754,12 +1841,12 @@ func (c *ApiGatewayV2) DeleteRouteRequest(input *DeleteRouteInput) (req *request // See the AWS API reference guide for AmazonApiGatewayV2's // API operation DeleteRoute for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/DeleteRoute @@ -1838,12 +1925,12 @@ func (c *ApiGatewayV2) DeleteRouteResponseRequest(input *DeleteRouteResponseInpu // See the AWS API reference guide for AmazonApiGatewayV2's // API operation DeleteRouteResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/DeleteRouteResponse @@ -1868,6 +1955,90 @@ func (c *ApiGatewayV2) DeleteRouteResponseWithContext(ctx aws.Context, input *De return out, req.Send() } +const opDeleteRouteSettings = "DeleteRouteSettings" + +// DeleteRouteSettingsRequest generates a "aws/request.Request" representing the +// client's request for the DeleteRouteSettings operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteRouteSettings for more information on using the DeleteRouteSettings +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteRouteSettingsRequest method. +// req, resp := client.DeleteRouteSettingsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/DeleteRouteSettings +func (c *ApiGatewayV2) DeleteRouteSettingsRequest(input *DeleteRouteSettingsInput) (req *request.Request, output *DeleteRouteSettingsOutput) { + op := &request.Operation{ + Name: opDeleteRouteSettings, + HTTPMethod: "DELETE", + HTTPPath: "/v2/apis/{apiId}/stages/{stageName}/routesettings/{routeKey}", + } + + if input == nil { + input = &DeleteRouteSettingsInput{} + } + + output = &DeleteRouteSettingsOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteRouteSettings API operation for AmazonApiGatewayV2. +// +// Deletes the RouteSettings for 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 AmazonApiGatewayV2's +// API operation DeleteRouteSettings for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// The resource specified in the request was not found. See the message field +// for more information. +// +// * TooManyRequestsException +// A limit has been exceeded. See the accompanying error message for details. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/DeleteRouteSettings +func (c *ApiGatewayV2) DeleteRouteSettings(input *DeleteRouteSettingsInput) (*DeleteRouteSettingsOutput, error) { + req, out := c.DeleteRouteSettingsRequest(input) + return out, req.Send() +} + +// DeleteRouteSettingsWithContext is the same as DeleteRouteSettings with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRouteSettings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ApiGatewayV2) DeleteRouteSettingsWithContext(ctx aws.Context, input *DeleteRouteSettingsInput, opts ...request.Option) (*DeleteRouteSettingsOutput, error) { + req, out := c.DeleteRouteSettingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteStage = "DeleteStage" // DeleteStageRequest generates a "aws/request.Request" representing the @@ -1922,12 +2093,12 @@ func (c *ApiGatewayV2) DeleteStageRequest(input *DeleteStageInput) (req *request // See the AWS API reference guide for AmazonApiGatewayV2's // API operation DeleteStage for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/DeleteStage @@ -2005,12 +2176,12 @@ func (c *ApiGatewayV2) GetApiRequest(input *GetApiInput) (req *request.Request, // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetApi for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/GetApi @@ -2079,7 +2250,7 @@ func (c *ApiGatewayV2) GetApiMappingRequest(input *GetApiMappingInput) (req *req // GetApiMapping API operation for AmazonApiGatewayV2. // -// The API mapping. +// Gets an API mapping. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2088,15 +2259,15 @@ func (c *ApiGatewayV2) GetApiMappingRequest(input *GetApiMappingInput) (req *req // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetApiMapping for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // @@ -2166,7 +2337,7 @@ func (c *ApiGatewayV2) GetApiMappingsRequest(input *GetApiMappingsInput) (req *r // GetApiMappings API operation for AmazonApiGatewayV2. // -// The API mappings. +// Gets API mappings. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2175,15 +2346,15 @@ func (c *ApiGatewayV2) GetApiMappingsRequest(input *GetApiMappingsInput) (req *r // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetApiMappings for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // @@ -2262,15 +2433,15 @@ func (c *ApiGatewayV2) GetApisRequest(input *GetApisInput) (req *request.Request // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetApis for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // @@ -2349,12 +2520,12 @@ func (c *ApiGatewayV2) GetAuthorizerRequest(input *GetAuthorizerInput) (req *req // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/GetAuthorizer @@ -2432,15 +2603,15 @@ func (c *ApiGatewayV2) GetAuthorizersRequest(input *GetAuthorizersInput) (req *r // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetAuthorizers for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // @@ -2519,12 +2690,12 @@ func (c *ApiGatewayV2) GetDeploymentRequest(input *GetDeploymentInput) (req *req // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetDeployment for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/GetDeployment @@ -2602,15 +2773,15 @@ func (c *ApiGatewayV2) GetDeploymentsRequest(input *GetDeploymentsInput) (req *r // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetDeployments for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // @@ -2689,12 +2860,12 @@ func (c *ApiGatewayV2) GetDomainNameRequest(input *GetDomainNameInput) (req *req // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetDomainName for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/GetDomainName @@ -2772,15 +2943,15 @@ func (c *ApiGatewayV2) GetDomainNamesRequest(input *GetDomainNamesInput) (req *r // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetDomainNames for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // @@ -2859,12 +3030,12 @@ func (c *ApiGatewayV2) GetIntegrationRequest(input *GetIntegrationInput) (req *r // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetIntegration for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/GetIntegration @@ -2942,12 +3113,12 @@ func (c *ApiGatewayV2) GetIntegrationResponseRequest(input *GetIntegrationRespon // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetIntegrationResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/GetIntegrationResponse @@ -3025,15 +3196,15 @@ func (c *ApiGatewayV2) GetIntegrationResponsesRequest(input *GetIntegrationRespo // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetIntegrationResponses for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // @@ -3112,15 +3283,15 @@ func (c *ApiGatewayV2) GetIntegrationsRequest(input *GetIntegrationsInput) (req // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetIntegrations for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // @@ -3199,12 +3370,12 @@ func (c *ApiGatewayV2) GetModelRequest(input *GetModelInput) (req *request.Reque // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetModel for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/GetModel @@ -3282,12 +3453,12 @@ func (c *ApiGatewayV2) GetModelTemplateRequest(input *GetModelTemplateInput) (re // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetModelTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/GetModelTemplate @@ -3365,15 +3536,15 @@ func (c *ApiGatewayV2) GetModelsRequest(input *GetModelsInput) (req *request.Req // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetModels for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // @@ -3452,12 +3623,12 @@ func (c *ApiGatewayV2) GetRouteRequest(input *GetRouteInput) (req *request.Reque // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetRoute for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/GetRoute @@ -3535,12 +3706,12 @@ func (c *ApiGatewayV2) GetRouteResponseRequest(input *GetRouteResponseInput) (re // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetRouteResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/GetRouteResponse @@ -3618,15 +3789,15 @@ func (c *ApiGatewayV2) GetRouteResponsesRequest(input *GetRouteResponsesInput) ( // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetRouteResponses for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // @@ -3705,15 +3876,15 @@ func (c *ApiGatewayV2) GetRoutesRequest(input *GetRoutesInput) (req *request.Req // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetRoutes for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // @@ -3792,12 +3963,12 @@ func (c *ApiGatewayV2) GetStageRequest(input *GetStageInput) (req *request.Reque // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetStage for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // // See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/GetStage @@ -3875,15 +4046,15 @@ func (c *ApiGatewayV2) GetStagesRequest(input *GetStagesInput) (req *request.Req // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetStages for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // @@ -3953,7 +4124,7 @@ func (c *ApiGatewayV2) GetTagsRequest(input *GetTagsInput) (req *request.Request // GetTags API operation for AmazonApiGatewayV2. // -// Gets the Tags for a resource. +// Gets a collection of Tag 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 @@ -3962,19 +4133,19 @@ func (c *ApiGatewayV2) GetTagsRequest(input *GetTagsInput) (req *request.Request // See the AWS API reference guide for AmazonApiGatewayV2's // API operation GetTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -4001,6 +4172,190 @@ func (c *ApiGatewayV2) GetTagsWithContext(ctx aws.Context, input *GetTagsInput, return out, req.Send() } +const opImportApi = "ImportApi" + +// ImportApiRequest generates a "aws/request.Request" representing the +// client's request for the ImportApi operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ImportApi for more information on using the ImportApi +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ImportApiRequest method. +// req, resp := client.ImportApiRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/ImportApi +func (c *ApiGatewayV2) ImportApiRequest(input *ImportApiInput) (req *request.Request, output *ImportApiOutput) { + op := &request.Operation{ + Name: opImportApi, + HTTPMethod: "PUT", + HTTPPath: "/v2/apis", + } + + if input == nil { + input = &ImportApiInput{} + } + + output = &ImportApiOutput{} + req = c.newRequest(op, input, output) + return +} + +// ImportApi API operation for AmazonApiGatewayV2. +// +// Imports 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 AmazonApiGatewayV2's +// API operation ImportApi for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// The resource specified in the request was not found. See the message field +// for more information. +// +// * TooManyRequestsException +// A limit has been exceeded. See the accompanying error message for details. +// +// * BadRequestException +// The request is not valid, for example, the input is incomplete or incorrect. +// See the accompanying error message for details. +// +// * ConflictException +// The requested operation would cause a conflict with the current state of +// a service resource associated with the request. Resolve the conflict before +// retrying this request. See the accompanying error message for details. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/ImportApi +func (c *ApiGatewayV2) ImportApi(input *ImportApiInput) (*ImportApiOutput, error) { + req, out := c.ImportApiRequest(input) + return out, req.Send() +} + +// ImportApiWithContext is the same as ImportApi with the addition of +// the ability to pass a context and additional request options. +// +// See ImportApi for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ApiGatewayV2) ImportApiWithContext(ctx aws.Context, input *ImportApiInput, opts ...request.Option) (*ImportApiOutput, error) { + req, out := c.ImportApiRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opReimportApi = "ReimportApi" + +// ReimportApiRequest generates a "aws/request.Request" representing the +// client's request for the ReimportApi operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ReimportApi for more information on using the ReimportApi +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ReimportApiRequest method. +// req, resp := client.ReimportApiRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/ReimportApi +func (c *ApiGatewayV2) ReimportApiRequest(input *ReimportApiInput) (req *request.Request, output *ReimportApiOutput) { + op := &request.Operation{ + Name: opReimportApi, + HTTPMethod: "PUT", + HTTPPath: "/v2/apis/{apiId}", + } + + if input == nil { + input = &ReimportApiInput{} + } + + output = &ReimportApiOutput{} + req = c.newRequest(op, input, output) + return +} + +// ReimportApi API operation for AmazonApiGatewayV2. +// +// Puts an Api 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 AmazonApiGatewayV2's +// API operation ReimportApi for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// The resource specified in the request was not found. See the message field +// for more information. +// +// * TooManyRequestsException +// A limit has been exceeded. See the accompanying error message for details. +// +// * BadRequestException +// The request is not valid, for example, the input is incomplete or incorrect. +// See the accompanying error message for details. +// +// * ConflictException +// The requested operation would cause a conflict with the current state of +// a service resource associated with the request. Resolve the conflict before +// retrying this request. See the accompanying error message for details. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/apigatewayv2-2018-11-29/ReimportApi +func (c *ApiGatewayV2) ReimportApi(input *ReimportApiInput) (*ReimportApiOutput, error) { + req, out := c.ReimportApiRequest(input) + return out, req.Send() +} + +// ReimportApiWithContext is the same as ReimportApi with the addition of +// the ability to pass a context and additional request options. +// +// See ReimportApi for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ApiGatewayV2) ReimportApiWithContext(ctx aws.Context, input *ReimportApiInput, opts ...request.Option) (*ReimportApiOutput, error) { + req, out := c.ReimportApiRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opTagResource = "TagResource" // TagResourceRequest generates a "aws/request.Request" representing the @@ -4046,6 +4401,8 @@ func (c *ApiGatewayV2) TagResourceRequest(input *TagResourceInput) (req *request // TagResource API operation for AmazonApiGatewayV2. // +// Creates a new Tag resource to represent a tag. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -4053,19 +4410,19 @@ func (c *ApiGatewayV2) TagResourceRequest(input *TagResourceInput) (req *request // See the AWS API reference guide for AmazonApiGatewayV2's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -4137,6 +4494,8 @@ func (c *ApiGatewayV2) UntagResourceRequest(input *UntagResourceInput) (req *req // UntagResource API operation for AmazonApiGatewayV2. // +// Deletes a Tag. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -4144,19 +4503,19 @@ func (c *ApiGatewayV2) UntagResourceRequest(input *UntagResourceInput) (req *req // See the AWS API reference guide for AmazonApiGatewayV2's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -4236,19 +4595,19 @@ func (c *ApiGatewayV2) UpdateApiRequest(input *UpdateApiInput) (req *request.Req // See the AWS API reference guide for AmazonApiGatewayV2's // API operation UpdateApi for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -4328,19 +4687,19 @@ func (c *ApiGatewayV2) UpdateApiMappingRequest(input *UpdateApiMappingInput) (re // See the AWS API reference guide for AmazonApiGatewayV2's // API operation UpdateApiMapping for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -4420,19 +4779,19 @@ func (c *ApiGatewayV2) UpdateAuthorizerRequest(input *UpdateAuthorizerInput) (re // See the AWS API reference guide for AmazonApiGatewayV2's // API operation UpdateAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -4512,19 +4871,19 @@ func (c *ApiGatewayV2) UpdateDeploymentRequest(input *UpdateDeploymentInput) (re // See the AWS API reference guide for AmazonApiGatewayV2's // API operation UpdateDeployment for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -4604,19 +4963,19 @@ func (c *ApiGatewayV2) UpdateDomainNameRequest(input *UpdateDomainNameInput) (re // See the AWS API reference guide for AmazonApiGatewayV2's // API operation UpdateDomainName for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -4696,19 +5055,19 @@ func (c *ApiGatewayV2) UpdateIntegrationRequest(input *UpdateIntegrationInput) ( // See the AWS API reference guide for AmazonApiGatewayV2's // API operation UpdateIntegration for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -4788,19 +5147,19 @@ func (c *ApiGatewayV2) UpdateIntegrationResponseRequest(input *UpdateIntegration // See the AWS API reference guide for AmazonApiGatewayV2's // API operation UpdateIntegrationResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -4880,19 +5239,19 @@ func (c *ApiGatewayV2) UpdateModelRequest(input *UpdateModelInput) (req *request // See the AWS API reference guide for AmazonApiGatewayV2's // API operation UpdateModel for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -4972,19 +5331,19 @@ func (c *ApiGatewayV2) UpdateRouteRequest(input *UpdateRouteInput) (req *request // See the AWS API reference guide for AmazonApiGatewayV2's // API operation UpdateRoute for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -5064,19 +5423,19 @@ func (c *ApiGatewayV2) UpdateRouteResponseRequest(input *UpdateRouteResponseInpu // See the AWS API reference guide for AmazonApiGatewayV2's // API operation UpdateRouteResponse for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -5156,19 +5515,19 @@ func (c *ApiGatewayV2) UpdateStageRequest(input *UpdateStageInput) (req *request // See the AWS API reference guide for AmazonApiGatewayV2's // API operation UpdateStage for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. See the message field // for more information. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // A limit has been exceeded. See the accompanying error message for details. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not valid, for example, the input is incomplete or incorrect. // See the accompanying error message for details. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. See the accompanying error message for details. @@ -5195,11 +5554,66 @@ func (c *ApiGatewayV2) UpdateStageWithContext(ctx aws.Context, input *UpdateStag return out, req.Send() } -// Settings for logging access in a stage. -type AccessLogSettings struct { - _ struct{} `type:"structure"` +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The ARN of the CloudWatch Logs log group to receive access logs. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Settings for logging access in a stage. +type AccessLogSettings struct { + _ struct{} `type:"structure"` + + // The ARN of the CloudWatch Logs log group to receive access logs. DestinationArn *string `locationName:"destinationArn" type:"string"` // A single line format of the access logs of data, as specified by selected @@ -5241,34 +5655,46 @@ type Api struct { // The API ID. ApiId *string `locationName:"apiId" type:"string"` - // An API key selection expression. See API Key Selection Expressions (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions). + // An API key selection expression. Supported only for WebSocket APIs. See API + // Key Selection Expressions (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions). ApiKeySelectionExpression *string `locationName:"apiKeySelectionExpression" type:"string"` + // A CORS configuration. Supported only for HTTP APIs. + CorsConfiguration *Cors `locationName:"corsConfiguration" type:"structure"` + // The timestamp when the API was created. CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601"` // The description of the API. Description *string `locationName:"description" type:"string"` - // Avoid validating models when creating a deployment. + // Avoid validating models when creating a deployment. Supported only for WebSocket + // APIs. DisableSchemaValidation *bool `locationName:"disableSchemaValidation" type:"boolean"` + // The validation information during API import. This may include particular + // properties of your OpenAPI definition which are ignored during import. Supported + // only for HTTP APIs. + ImportInfo []*string `locationName:"importInfo" type:"list"` + // The name of the API. // // Name is a required field Name *string `locationName:"name" type:"string" required:"true"` - // The API protocol: Currently only WEBSOCKET is supported. + // The API protocol. // // ProtocolType is a required field ProtocolType *string `locationName:"protocolType" type:"string" required:"true" enum:"ProtocolType"` - // The route selection expression for the API. + // The route selection expression for the API. For HTTP APIs, the routeSelectionExpression + // must be ${request.method} ${request.path}. If not provided, this will be + // the default for HTTP APIs. This property is required for WebSocket APIs. // // RouteSelectionExpression is a required field RouteSelectionExpression *string `locationName:"routeSelectionExpression" type:"string" required:"true"` - // Tags for the API. + // A collection of tags associated with the API. Tags map[string]*string `locationName:"tags" type:"map"` // A version identifier for the API. @@ -5307,6 +5733,12 @@ func (s *Api) SetApiKeySelectionExpression(v string) *Api { return s } +// SetCorsConfiguration sets the CorsConfiguration field's value. +func (s *Api) SetCorsConfiguration(v *Cors) *Api { + s.CorsConfiguration = v + return s +} + // SetCreatedDate sets the CreatedDate field's value. func (s *Api) SetCreatedDate(v time.Time) *Api { s.CreatedDate = &v @@ -5325,6 +5757,12 @@ func (s *Api) SetDisableSchemaValidation(v bool) *Api { return s } +// SetImportInfo sets the ImportInfo field's value. +func (s *Api) SetImportInfo(v []*string) *Api { + s.ImportInfo = v + return s +} + // SetName sets the Name field's value. func (s *Api) SetName(v string) *Api { s.Name = &v @@ -5423,20 +5861,19 @@ type Authorizer struct { // Specifies the required credentials as an IAM role for API Gateway to invoke // the authorizer. To specify an IAM role for API Gateway to assume, use the // role's Amazon Resource Name (ARN). To use resource-based permissions on the - // Lambda function, specify null. + // Lambda function, specify null. Supported only for REQUEST authorizers. AuthorizerCredentialsArn *string `locationName:"authorizerCredentialsArn" type:"string"` // The authorizer identifier. AuthorizerId *string `locationName:"authorizerId" type:"string"` - // The time to live (TTL), in seconds, of cached authorizer results. If it equals - // 0, authorization caching is disabled. If it is 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. + // Authorizer caching is not currently supported. Don't specify this value for + // authorizers. AuthorizerResultTtlInSeconds *int64 `locationName:"authorizerResultTtlInSeconds" type:"integer"` - // The authorizer type. Currently the only valid value is REQUEST, for a Lambda - // function using incoming request parameters. + // The authorizer type. For WebSocket APIs, specify REQUEST for a Lambda function + // using incoming request parameters. For HTTP APIs, specify JWT to use JSON + // Web Tokens. AuthorizerType *string `locationName:"authorizerType" type:"string" enum:"AuthorizerType"` // The authorizer's Uniform Resource Identifier (URI). ForREQUEST authorizers, @@ -5445,36 +5882,40 @@ type Authorizer struct { // , 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. + // is usually of the form /2015-03-31/functions/[FunctionARN]/invocations. Supported + // only for REQUEST authorizers. AuthorizerUri *string `locationName:"authorizerUri" type:"string"` // The identity source for which authorization is requested. // - // For the REQUEST authorizer, this is required when authorization caching is - // enabled. The value is a comma-separated string of one or more mapping expressions - // of the specified request parameters. For example, if an Auth header and a - // Name query string parameters are defined as identity sources, this value - // is method.request.header.Auth, method.request.querystring.Name. These parameters - // will be used to derive the authorization caching key and to perform runtime - // validation of the REQUEST authorizer by verifying all of the identity-related - // request parameters are present, not null, and non-empty. Only when this is - // true does the authorizer invoke the authorizer Lambda function, otherwise, - // it returns a 401 Unauthorized response without calling the Lambda function. - // The valid value is a string of comma-separated mapping expressions of the - // specified request parameters. When the authorization caching is not enabled, - // this property is optional. + // For a REQUEST authorizer, this is optional. The value is a set of one or + // more mapping expressions of the specified request parameters. Currently, + // the identity source can be headers, query string parameters, stage variables, + // and context parameters. For example, if an Auth header and a Name query string + // parameter are defined as identity sources, this value is route.request.header.Auth, + // route.request.querystring.Name. These parameters will be used to perform + // runtime validation for Lambda-based authorizers by verifying all of the identity-related + // request parameters are present in the request, not null, and non-empty. Only + // when this is true does the authorizer invoke the authorizer Lambda function. + // Otherwise, it returns a 401 Unauthorized response without calling the Lambda + // function. + // + // For JWT, a single entry that specifies where to extract the JSON Web Token + // (JWT) from inbound requests. Currently only header-based and query parameter-based + // selections are supported, for example "$request.header.Authorization". IdentitySource []*string `locationName:"identitySource" type:"list"` // The validation expression does not apply to the REQUEST authorizer. IdentityValidationExpression *string `locationName:"identityValidationExpression" type:"string"` + // Represents the configuration of a JWT authorizer. Required for the JWT authorizer + // type. Supported only for HTTP APIs. + JwtConfiguration *JWTConfiguration `locationName:"jwtConfiguration" type:"structure"` + // The name of the authorizer. // // Name is a required field Name *string `locationName:"name" type:"string" required:"true"` - - // For REQUEST authorizer, this is not defined. - ProviderArns []*string `locationName:"providerArns" type:"list"` } // String returns the string representation @@ -5529,15 +5970,219 @@ func (s *Authorizer) SetIdentityValidationExpression(v string) *Authorizer { return s } +// SetJwtConfiguration sets the JwtConfiguration field's value. +func (s *Authorizer) SetJwtConfiguration(v *JWTConfiguration) *Authorizer { + s.JwtConfiguration = 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 +// The request is not valid, for example, the input is incomplete or incorrect. +// See the accompanying error message for details. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Describes the error encountered. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested operation would cause a conflict with the current state of +// a service resource associated with the request. Resolve the conflict before +// retrying this request. See the accompanying error message for details. +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Describes the error encountered. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictException) GoString() string { + return s.String() +} + +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" +} + +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil +} + +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID +} + +// Represents a CORS configuration. Supported only for HTTP APIs. See Configuring +// CORS (https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html) +// for more information. +type Cors struct { + _ struct{} `type:"structure"` + + // Specifies whether credentials are included in the CORS request. Supported + // only for HTTP APIs. + AllowCredentials *bool `locationName:"allowCredentials" type:"boolean"` + + // Represents a collection of allowed headers. Supported only for HTTP APIs. + AllowHeaders []*string `locationName:"allowHeaders" type:"list"` + + // Represents a collection of allowed HTTP methods. Supported only for HTTP + // APIs. + AllowMethods []*string `locationName:"allowMethods" type:"list"` + + // Represents a collection of allowed origins. Supported only for HTTP APIs. + AllowOrigins []*string `locationName:"allowOrigins" type:"list"` + + // Represents a collection of exposed headers. Supported only for HTTP APIs. + ExposeHeaders []*string `locationName:"exposeHeaders" type:"list"` + + // The number of seconds that the browser should cache preflight request results. + // Supported only for HTTP APIs. + MaxAge *int64 `locationName:"maxAge" type:"integer"` +} + +// String returns the string representation +func (s Cors) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Cors) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Cors) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Cors"} + if s.MaxAge != nil && *s.MaxAge < -1 { + invalidParams.Add(request.NewErrParamMinValue("MaxAge", -1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAllowCredentials sets the AllowCredentials field's value. +func (s *Cors) SetAllowCredentials(v bool) *Cors { + s.AllowCredentials = &v + return s +} + +// SetAllowHeaders sets the AllowHeaders field's value. +func (s *Cors) SetAllowHeaders(v []*string) *Cors { + s.AllowHeaders = v + return s +} + +// SetAllowMethods sets the AllowMethods field's value. +func (s *Cors) SetAllowMethods(v []*string) *Cors { + s.AllowMethods = v + return s +} + +// SetAllowOrigins sets the AllowOrigins field's value. +func (s *Cors) SetAllowOrigins(v []*string) *Cors { + s.AllowOrigins = v + return s +} + +// SetExposeHeaders sets the ExposeHeaders field's value. +func (s *Cors) SetExposeHeaders(v []*string) *Cors { + s.ExposeHeaders = v + return s +} + +// SetMaxAge sets the MaxAge field's value. +func (s *Cors) SetMaxAge(v int64) *Cors { + s.MaxAge = &v return s } @@ -5549,6 +6194,14 @@ type CreateApiInput struct { // for more information. ApiKeySelectionExpression *string `locationName:"apiKeySelectionExpression" type:"string"` + // Represents a CORS configuration. Supported only for HTTP APIs. See Configuring + // CORS (https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html) + // for more information. + CorsConfiguration *Cors `locationName:"corsConfiguration" type:"structure"` + + // Represents an Amazon Resource Name (ARN). + CredentialsArn *string `locationName:"credentialsArn" type:"string"` + // A string with a length between [0-1024]. Description *string `locationName:"description" type:"string"` @@ -5559,15 +6212,28 @@ type CreateApiInput struct { // Name is a required field Name *string `locationName:"name" type:"string" required:"true"` + // Represents a protocol type. + // // ProtocolType is a required field ProtocolType *string `locationName:"protocolType" type:"string" required:"true" enum:"ProtocolType"` + // After evaluating a selection expression, the result is compared against one + // or more selection keys to find a matching key. See Selection Expressions + // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) + // for a list of expressions and each expression's associated selection key + // type. + RouteKey *string `locationName:"routeKey" type:"string"` + // An expression used to extract information at runtime. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for more information. - // - // RouteSelectionExpression is a required field - RouteSelectionExpression *string `locationName:"routeSelectionExpression" type:"string" required:"true"` + RouteSelectionExpression *string `locationName:"routeSelectionExpression" type:"string"` + + // Represents a collection of tags associated with the resource. + Tags map[string]*string `locationName:"tags" type:"map"` + + // A string representation of a URI with a length between [1-2048]. + Target *string `locationName:"target" type:"string"` // A string with a length between [1-64]. Version *string `locationName:"version" type:"string"` @@ -5592,8 +6258,10 @@ func (s *CreateApiInput) Validate() error { if s.ProtocolType == nil { invalidParams.Add(request.NewErrParamRequired("ProtocolType")) } - if s.RouteSelectionExpression == nil { - invalidParams.Add(request.NewErrParamRequired("RouteSelectionExpression")) + if s.CorsConfiguration != nil { + if err := s.CorsConfiguration.Validate(); err != nil { + invalidParams.AddNested("CorsConfiguration", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -5608,6 +6276,18 @@ func (s *CreateApiInput) SetApiKeySelectionExpression(v string) *CreateApiInput return s } +// SetCorsConfiguration sets the CorsConfiguration field's value. +func (s *CreateApiInput) SetCorsConfiguration(v *Cors) *CreateApiInput { + s.CorsConfiguration = v + return s +} + +// SetCredentialsArn sets the CredentialsArn field's value. +func (s *CreateApiInput) SetCredentialsArn(v string) *CreateApiInput { + s.CredentialsArn = &v + return s +} + // SetDescription sets the Description field's value. func (s *CreateApiInput) SetDescription(v string) *CreateApiInput { s.Description = &v @@ -5632,12 +6312,30 @@ func (s *CreateApiInput) SetProtocolType(v string) *CreateApiInput { return s } +// SetRouteKey sets the RouteKey field's value. +func (s *CreateApiInput) SetRouteKey(v string) *CreateApiInput { + s.RouteKey = &v + return s +} + // SetRouteSelectionExpression sets the RouteSelectionExpression field's value. func (s *CreateApiInput) SetRouteSelectionExpression(v string) *CreateApiInput { s.RouteSelectionExpression = &v return s } +// SetTags sets the Tags field's value. +func (s *CreateApiInput) SetTags(v map[string]*string) *CreateApiInput { + s.Tags = v + return s +} + +// SetTarget sets the Target field's value. +func (s *CreateApiInput) SetTarget(v string) *CreateApiInput { + s.Target = &v + return s +} + // SetVersion sets the Version field's value. func (s *CreateApiInput) SetVersion(v string) *CreateApiInput { s.Version = &v @@ -5652,7 +6350,7 @@ type CreateApiMappingInput struct { // ApiId is a required field ApiId *string `locationName:"apiId" type:"string" required:"true"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -5733,7 +6431,7 @@ type CreateApiMappingOutput struct { // The identifier. ApiMappingId *string `locationName:"apiMappingId" type:"string"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -5791,6 +6489,11 @@ type CreateApiOutput struct { // for more information. ApiKeySelectionExpression *string `locationName:"apiKeySelectionExpression" type:"string"` + // Represents a CORS configuration. Supported only for HTTP APIs. See Configuring + // CORS (https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html) + // for more information. + CorsConfiguration *Cors `locationName:"corsConfiguration" type:"structure"` + CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601"` // A string with a length between [0-1024]. @@ -5798,9 +6501,12 @@ type CreateApiOutput struct { DisableSchemaValidation *bool `locationName:"disableSchemaValidation" type:"boolean"` + ImportInfo []*string `locationName:"importInfo" type:"list"` + // A string with a length between [1-128]. Name *string `locationName:"name" type:"string"` + // Represents a protocol type. ProtocolType *string `locationName:"protocolType" type:"string" enum:"ProtocolType"` // An expression used to extract information at runtime. See Selection Expressions @@ -5808,6 +6514,9 @@ type CreateApiOutput struct { // for more information. RouteSelectionExpression *string `locationName:"routeSelectionExpression" type:"string"` + // Represents a collection of tags associated with the resource. + Tags map[string]*string `locationName:"tags" type:"map"` + // A string with a length between [1-64]. Version *string `locationName:"version" type:"string"` @@ -5842,6 +6551,12 @@ func (s *CreateApiOutput) SetApiKeySelectionExpression(v string) *CreateApiOutpu return s } +// SetCorsConfiguration sets the CorsConfiguration field's value. +func (s *CreateApiOutput) SetCorsConfiguration(v *Cors) *CreateApiOutput { + s.CorsConfiguration = v + return s +} + // SetCreatedDate sets the CreatedDate field's value. func (s *CreateApiOutput) SetCreatedDate(v time.Time) *CreateApiOutput { s.CreatedDate = &v @@ -5860,6 +6575,12 @@ func (s *CreateApiOutput) SetDisableSchemaValidation(v bool) *CreateApiOutput { return s } +// SetImportInfo sets the ImportInfo field's value. +func (s *CreateApiOutput) SetImportInfo(v []*string) *CreateApiOutput { + s.ImportInfo = v + return s +} + // SetName sets the Name field's value. func (s *CreateApiOutput) SetName(v string) *CreateApiOutput { s.Name = &v @@ -5878,6 +6599,12 @@ func (s *CreateApiOutput) SetRouteSelectionExpression(v string) *CreateApiOutput return s } +// SetTags sets the Tags field's value. +func (s *CreateApiOutput) SetTags(v map[string]*string) *CreateApiOutput { + s.Tags = v + return s +} + // SetVersion sets the Version field's value. func (s *CreateApiOutput) SetVersion(v string) *CreateApiOutput { s.Version = &v @@ -5902,16 +6629,15 @@ type CreateAuthorizerInput struct { // An integer with a value between [0-3600]. AuthorizerResultTtlInSeconds *int64 `locationName:"authorizerResultTtlInSeconds" type:"integer"` - // The authorizer type. Currently the only valid value is REQUEST, for a Lambda - // function using incoming request parameters. + // The authorizer type. For WebSocket APIs, specify REQUEST for a Lambda function + // using incoming request parameters. For HTTP APIs, specify JWT to use JSON + // Web Tokens. // // AuthorizerType is a required field AuthorizerType *string `locationName:"authorizerType" type:"string" required:"true" enum:"AuthorizerType"` // A string representation of a URI with a length between [1-2048]. - // - // AuthorizerUri is a required field - AuthorizerUri *string `locationName:"authorizerUri" type:"string" required:"true"` + AuthorizerUri *string `locationName:"authorizerUri" type:"string"` // The identity source for which authorization is requested. For the REQUEST // authorizer, this is required when authorization caching is enabled. The value @@ -5933,13 +6659,14 @@ type CreateAuthorizerInput struct { // A string with a length between [0-1024]. IdentityValidationExpression *string `locationName:"identityValidationExpression" type:"string"` + // Represents the configuration of a JWT authorizer. Required for the JWT authorizer + // type. Supported only for HTTP APIs. + JwtConfiguration *JWTConfiguration `locationName:"jwtConfiguration" type:"structure"` + // A string with a length between [1-128]. // // Name is a required field Name *string `locationName:"name" type:"string" required:"true"` - - // For REQUEST authorizer, this is not defined. - ProviderArns []*string `locationName:"providerArns" type:"list"` } // String returns the string representation @@ -5964,9 +6691,6 @@ func (s *CreateAuthorizerInput) Validate() error { if s.AuthorizerType == nil { invalidParams.Add(request.NewErrParamRequired("AuthorizerType")) } - if s.AuthorizerUri == nil { - invalidParams.Add(request.NewErrParamRequired("AuthorizerUri")) - } if s.IdentitySource == nil { invalidParams.Add(request.NewErrParamRequired("IdentitySource")) } @@ -6022,15 +6746,15 @@ func (s *CreateAuthorizerInput) SetIdentityValidationExpression(v string) *Creat return s } -// SetName sets the Name field's value. -func (s *CreateAuthorizerInput) SetName(v string) *CreateAuthorizerInput { - s.Name = &v +// SetJwtConfiguration sets the JwtConfiguration field's value. +func (s *CreateAuthorizerInput) SetJwtConfiguration(v *JWTConfiguration) *CreateAuthorizerInput { + s.JwtConfiguration = v return s } -// SetProviderArns sets the ProviderArns field's value. -func (s *CreateAuthorizerInput) SetProviderArns(v []*string) *CreateAuthorizerInput { - s.ProviderArns = v +// SetName sets the Name field's value. +func (s *CreateAuthorizerInput) SetName(v string) *CreateAuthorizerInput { + s.Name = &v return s } @@ -6046,8 +6770,9 @@ type CreateAuthorizerOutput struct { // An integer with a value between [0-3600]. AuthorizerResultTtlInSeconds *int64 `locationName:"authorizerResultTtlInSeconds" type:"integer"` - // The authorizer type. Currently the only valid value is REQUEST, for a Lambda - // function using incoming request parameters. + // The authorizer type. For WebSocket APIs, specify REQUEST for a Lambda function + // using incoming request parameters. For HTTP APIs, specify JWT to use JSON + // Web Tokens. AuthorizerType *string `locationName:"authorizerType" type:"string" enum:"AuthorizerType"` // A string representation of a URI with a length between [1-2048]. @@ -6071,11 +6796,12 @@ type CreateAuthorizerOutput struct { // A string with a length between [0-1024]. IdentityValidationExpression *string `locationName:"identityValidationExpression" type:"string"` + // Represents the configuration of a JWT authorizer. Required for the JWT authorizer + // type. Supported only for HTTP APIs. + JwtConfiguration *JWTConfiguration `locationName:"jwtConfiguration" type:"structure"` + // A string with a length between [1-128]. Name *string `locationName:"name" type:"string"` - - // For REQUEST authorizer, this is not defined. - ProviderArns []*string `locationName:"providerArns" type:"list"` } // String returns the string representation @@ -6130,15 +6856,15 @@ func (s *CreateAuthorizerOutput) SetIdentityValidationExpression(v string) *Crea return s } -// SetName sets the Name field's value. -func (s *CreateAuthorizerOutput) SetName(v string) *CreateAuthorizerOutput { - s.Name = &v +// SetJwtConfiguration sets the JwtConfiguration field's value. +func (s *CreateAuthorizerOutput) SetJwtConfiguration(v *JWTConfiguration) *CreateAuthorizerOutput { + s.JwtConfiguration = v return s } -// SetProviderArns sets the ProviderArns field's value. -func (s *CreateAuthorizerOutput) SetProviderArns(v []*string) *CreateAuthorizerOutput { - s.ProviderArns = v +// SetName sets the Name field's value. +func (s *CreateAuthorizerOutput) SetName(v string) *CreateAuthorizerOutput { + s.Name = &v return s } @@ -6202,6 +6928,8 @@ func (s *CreateDeploymentInput) SetStageName(v string) *CreateDeploymentInput { type CreateDeploymentOutput struct { _ struct{} `type:"structure"` + AutoDeployed *bool `locationName:"autoDeployed" type:"boolean"` + CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601"` // The identifier. @@ -6226,6 +6954,12 @@ func (s CreateDeploymentOutput) GoString() string { return s.String() } +// SetAutoDeployed sets the AutoDeployed field's value. +func (s *CreateDeploymentOutput) SetAutoDeployed(v bool) *CreateDeploymentOutput { + s.AutoDeployed = &v + return s +} + // SetCreatedDate sets the CreatedDate field's value. func (s *CreateDeploymentOutput) SetCreatedDate(v time.Time) *CreateDeploymentOutput { s.CreatedDate = &v @@ -6267,8 +7001,7 @@ type CreateDomainNameInput struct { // The domain name configurations. DomainNameConfigurations []*DomainNameConfiguration `locationName:"domainNameConfigurations" type:"list"` - // A key value pair of string with key length between[1-128] and value length - // between[1-256] + // Represents a collection of tags associated with the resource. Tags map[string]*string `locationName:"tags" type:"map"` } @@ -6327,8 +7060,7 @@ type CreateDomainNameOutput struct { // The domain name configurations. DomainNameConfigurations []*DomainNameConfiguration `locationName:"domainNameConfigurations" type:"list"` - // A key value pair of string with key length between[1-128] and value length - // between[1-256] + // Represents a collection of tags associated with the resource. Tags map[string]*string `locationName:"tags" type:"map"` } @@ -6378,7 +7110,8 @@ type CreateIntegrationInput struct { // Represents a connection type. ConnectionType *string `locationName:"connectionType" type:"string" enum:"ConnectionType"` - // Specifies how to handle response payload content type conversions. + // Specifies how to handle response payload content type conversions. Supported + // only for WebSocket APIs. ContentHandlingStrategy *string `locationName:"contentHandlingStrategy" type:"string" enum:"ContentHandlingStrategy"` // Represents an Amazon Resource Name (ARN). @@ -6398,9 +7131,13 @@ type CreateIntegrationInput struct { // A string representation of a URI with a length between [1-2048]. IntegrationUri *string `locationName:"integrationUri" type:"string"` - // Represents passthrough behavior for an integration response. + // Represents passthrough behavior for an integration response. Supported only + // for WebSocket APIs. PassthroughBehavior *string `locationName:"passthroughBehavior" type:"string" enum:"PassthroughBehavior"` + // A string with a length between [1-64]. + PayloadFormatVersion *string `locationName:"payloadFormatVersion" type:"string"` + // A key-value map specifying response parameters that are passed to the method // response from the backend. The key is a method response header parameter // name and the mapped value is an integration response header value, a static @@ -6519,6 +7256,12 @@ func (s *CreateIntegrationInput) SetPassthroughBehavior(v string) *CreateIntegra return s } +// SetPayloadFormatVersion sets the PayloadFormatVersion field's value. +func (s *CreateIntegrationInput) SetPayloadFormatVersion(v string) *CreateIntegrationInput { + s.PayloadFormatVersion = &v + return s +} + // SetRequestParameters sets the RequestParameters field's value. func (s *CreateIntegrationInput) SetRequestParameters(v map[string]*string) *CreateIntegrationInput { s.RequestParameters = v @@ -6546,13 +7289,16 @@ func (s *CreateIntegrationInput) SetTimeoutInMillis(v int64) *CreateIntegrationI type CreateIntegrationOutput struct { _ struct{} `type:"structure"` + ApiGatewayManaged *bool `locationName:"apiGatewayManaged" type:"boolean"` + // A string with a length between [1-1024]. ConnectionId *string `locationName:"connectionId" type:"string"` // Represents a connection type. ConnectionType *string `locationName:"connectionType" type:"string" enum:"ConnectionType"` - // Specifies how to handle response payload content type conversions. + // Specifies how to handle response payload content type conversions. Supported + // only for WebSocket APIs. ContentHandlingStrategy *string `locationName:"contentHandlingStrategy" type:"string" enum:"ContentHandlingStrategy"` // Represents an Amazon Resource Name (ARN). @@ -6578,9 +7324,13 @@ type CreateIntegrationOutput struct { // A string representation of a URI with a length between [1-2048]. IntegrationUri *string `locationName:"integrationUri" type:"string"` - // Represents passthrough behavior for an integration response. + // Represents passthrough behavior for an integration response. Supported only + // for WebSocket APIs. PassthroughBehavior *string `locationName:"passthroughBehavior" type:"string" enum:"PassthroughBehavior"` + // A string with a length between [1-64]. + PayloadFormatVersion *string `locationName:"payloadFormatVersion" type:"string"` + // A key-value map specifying response parameters that are passed to the method // response from the backend. The key is a method response header parameter // name and the mapped value is an integration response header value, a static @@ -6617,6 +7367,12 @@ func (s CreateIntegrationOutput) GoString() string { return s.String() } +// SetApiGatewayManaged sets the ApiGatewayManaged field's value. +func (s *CreateIntegrationOutput) SetApiGatewayManaged(v bool) *CreateIntegrationOutput { + s.ApiGatewayManaged = &v + return s +} + // SetConnectionId sets the ConnectionId field's value. func (s *CreateIntegrationOutput) SetConnectionId(v string) *CreateIntegrationOutput { s.ConnectionId = &v @@ -6683,6 +7439,12 @@ func (s *CreateIntegrationOutput) SetPassthroughBehavior(v string) *CreateIntegr return s } +// SetPayloadFormatVersion sets the PayloadFormatVersion field's value. +func (s *CreateIntegrationOutput) SetPayloadFormatVersion(v string) *CreateIntegrationOutput { + s.PayloadFormatVersion = &v + return s +} + // SetRequestParameters sets the RequestParameters field's value. func (s *CreateIntegrationOutput) SetRequestParameters(v map[string]*string) *CreateIntegrationOutput { s.RequestParameters = v @@ -6713,13 +7475,14 @@ type CreateIntegrationResponseInput struct { // ApiId is a required field ApiId *string `location:"uri" locationName:"apiId" type:"string" required:"true"` - // Specifies how to handle response payload content type conversions. + // Specifies how to handle response payload content type conversions. Supported + // only for WebSocket APIs. ContentHandlingStrategy *string `locationName:"contentHandlingStrategy" type:"string" enum:"ContentHandlingStrategy"` // IntegrationId is a required field IntegrationId *string `location:"uri" locationName:"integrationId" type:"string" required:"true"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -6831,13 +7594,14 @@ func (s *CreateIntegrationResponseInput) SetTemplateSelectionExpression(v string type CreateIntegrationResponseOutput struct { _ struct{} `type:"structure"` - // Specifies how to handle response payload content type conversions. + // Specifies how to handle response payload content type conversions. Supported + // only for WebSocket APIs. ContentHandlingStrategy *string `locationName:"contentHandlingStrategy" type:"string" enum:"ContentHandlingStrategy"` // The identifier. IntegrationResponseId *string `locationName:"integrationResponseId" type:"string"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -7066,17 +7830,18 @@ type CreateRouteInput struct { ApiKeyRequired *bool `locationName:"apiKeyRequired" type:"boolean"` // A list of authorization scopes configured on a route. The scopes are used - // with a COGNITO_USER_POOLS authorizer to authorize the method invocation. - // The authorization works by matching the route scopes against the scopes parsed - // from the access token in the incoming request. The method invocation is authorized - // if any route scope matches a claimed scope in the access token. Otherwise, - // the invocation is not authorized. When the route scope is configured, the - // client must provide an access token instead of an identity token for authorization - // purposes. + // with a JWT authorizer to authorize the method invocation. The authorization + // works by matching the route scopes against the scopes parsed from the access + // token in the incoming request. The method invocation is authorized if any + // route scope matches a claimed scope in the access token. Otherwise, the invocation + // is not authorized. When the route scope is configured, the client must provide + // an access token instead of an identity token for authorization purposes. AuthorizationScopes []*string `locationName:"authorizationScopes" type:"list"` - // The authorization type. Valid values are NONE for open access, AWS_IAM for - // using AWS IAM permissions, and CUSTOM for using a Lambda authorizer. + // The authorization type. For WebSocket APIs, valid values are NONE for open + // access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda + // authorizer. For HTTP APIs, valid values are NONE for open access, or JWT + // for using JSON Web Tokens. AuthorizationType *string `locationName:"authorizationType" type:"string" enum:"AuthorizationType"` // The identifier. @@ -7096,7 +7861,7 @@ type CreateRouteInput struct { // The route parameters. RequestParameters map[string]*ParameterConstraints `locationName:"requestParameters" type:"map"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -7218,20 +7983,23 @@ func (s *CreateRouteInput) SetTarget(v string) *CreateRouteInput { type CreateRouteOutput struct { _ struct{} `type:"structure"` + ApiGatewayManaged *bool `locationName:"apiGatewayManaged" type:"boolean"` + ApiKeyRequired *bool `locationName:"apiKeyRequired" type:"boolean"` // A list of authorization scopes configured on a route. The scopes are used - // with a COGNITO_USER_POOLS authorizer to authorize the method invocation. - // The authorization works by matching the route scopes against the scopes parsed - // from the access token in the incoming request. The method invocation is authorized - // if any route scope matches a claimed scope in the access token. Otherwise, - // the invocation is not authorized. When the route scope is configured, the - // client must provide an access token instead of an identity token for authorization - // purposes. + // with a JWT authorizer to authorize the method invocation. The authorization + // works by matching the route scopes against the scopes parsed from the access + // token in the incoming request. The method invocation is authorized if any + // route scope matches a claimed scope in the access token. Otherwise, the invocation + // is not authorized. When the route scope is configured, the client must provide + // an access token instead of an identity token for authorization purposes. AuthorizationScopes []*string `locationName:"authorizationScopes" type:"list"` - // The authorization type. Valid values are NONE for open access, AWS_IAM for - // using AWS IAM permissions, and CUSTOM for using a Lambda authorizer. + // The authorization type. For WebSocket APIs, valid values are NONE for open + // access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda + // authorizer. For HTTP APIs, valid values are NONE for open access, or JWT + // for using JSON Web Tokens. AuthorizationType *string `locationName:"authorizationType" type:"string" enum:"AuthorizationType"` // The identifier. @@ -7254,7 +8022,7 @@ type CreateRouteOutput struct { // The identifier. RouteId *string `locationName:"routeId" type:"string"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -7280,6 +8048,12 @@ func (s CreateRouteOutput) GoString() string { return s.String() } +// SetApiGatewayManaged sets the ApiGatewayManaged field's value. +func (s *CreateRouteOutput) SetApiGatewayManaged(v bool) *CreateRouteOutput { + s.ApiGatewayManaged = &v + return s +} + // SetApiKeyRequired sets the ApiKeyRequired field's value. func (s *CreateRouteOutput) SetApiKeyRequired(v bool) *CreateRouteOutput { s.ApiKeyRequired = &v @@ -7372,7 +8146,7 @@ type CreateRouteResponseInput struct { // RouteId is a required field RouteId *string `location:"uri" locationName:"routeId" type:"string" required:"true"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -7470,7 +8244,7 @@ type CreateRouteResponseOutput struct { // The identifier. RouteResponseId *string `locationName:"routeResponseId" type:"string"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -7527,6 +8301,8 @@ type CreateStageInput struct { // ApiId is a required field ApiId *string `location:"uri" locationName:"apiId" type:"string" required:"true"` + AutoDeploy *bool `locationName:"autoDeploy" type:"boolean"` + // The identifier. ClientCertificateId *string `locationName:"clientCertificateId" type:"string"` @@ -7550,8 +8326,7 @@ type CreateStageInput struct { // The stage variable map. StageVariables map[string]*string `locationName:"stageVariables" type:"map"` - // A key value pair of string with key length between[1-128] and value length - // between[1-256] + // Represents a collection of tags associated with the resource. Tags map[string]*string `locationName:"tags" type:"map"` } @@ -7596,6 +8371,12 @@ func (s *CreateStageInput) SetApiId(v string) *CreateStageInput { return s } +// SetAutoDeploy sets the AutoDeploy field's value. +func (s *CreateStageInput) SetAutoDeploy(v bool) *CreateStageInput { + s.AutoDeploy = &v + return s +} + // SetClientCertificateId sets the ClientCertificateId field's value. func (s *CreateStageInput) SetClientCertificateId(v string) *CreateStageInput { s.ClientCertificateId = &v @@ -7650,6 +8431,10 @@ type CreateStageOutput struct { // Settings for logging access in a stage. AccessLogSettings *AccessLogSettings `locationName:"accessLogSettings" type:"structure"` + ApiGatewayManaged *bool `locationName:"apiGatewayManaged" type:"boolean"` + + AutoDeploy *bool `locationName:"autoDeploy" type:"boolean"` + // The identifier. ClientCertificateId *string `locationName:"clientCertificateId" type:"string"` @@ -7664,6 +8449,8 @@ type CreateStageOutput struct { // A string with a length between [0-1024]. Description *string `locationName:"description" type:"string"` + LastDeploymentStatusMessage *string `locationName:"lastDeploymentStatusMessage" type:"string"` + LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601"` // The route settings map. @@ -7675,8 +8462,7 @@ type CreateStageOutput struct { // The stage variable map. StageVariables map[string]*string `locationName:"stageVariables" type:"map"` - // A key value pair of string with key length between[1-128] and value length - // between[1-256] + // Represents a collection of tags associated with the resource. Tags map[string]*string `locationName:"tags" type:"map"` } @@ -7696,7 +8482,19 @@ func (s *CreateStageOutput) SetAccessLogSettings(v *AccessLogSettings) *CreateSt return s } -// SetClientCertificateId sets the ClientCertificateId field's value. +// SetApiGatewayManaged sets the ApiGatewayManaged field's value. +func (s *CreateStageOutput) SetApiGatewayManaged(v bool) *CreateStageOutput { + s.ApiGatewayManaged = &v + return s +} + +// SetAutoDeploy sets the AutoDeploy field's value. +func (s *CreateStageOutput) SetAutoDeploy(v bool) *CreateStageOutput { + s.AutoDeploy = &v + return s +} + +// SetClientCertificateId sets the ClientCertificateId field's value. func (s *CreateStageOutput) SetClientCertificateId(v string) *CreateStageOutput { s.ClientCertificateId = &v return s @@ -7726,6 +8524,12 @@ func (s *CreateStageOutput) SetDescription(v string) *CreateStageOutput { return s } +// SetLastDeploymentStatusMessage sets the LastDeploymentStatusMessage field's value. +func (s *CreateStageOutput) SetLastDeploymentStatusMessage(v string) *CreateStageOutput { + s.LastDeploymentStatusMessage = &v + return s +} + // SetLastUpdatedDate sets the LastUpdatedDate field's value. func (s *CreateStageOutput) SetLastUpdatedDate(v time.Time) *CreateStageOutput { s.LastUpdatedDate = &v @@ -7945,6 +8749,59 @@ func (s DeleteAuthorizerOutput) GoString() string { return s.String() } +type DeleteCorsConfigurationInput struct { + _ struct{} `type:"structure"` + + // ApiId is a required field + ApiId *string `location:"uri" locationName:"apiId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteCorsConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCorsConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteCorsConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteCorsConfigurationInput"} + if s.ApiId == nil { + invalidParams.Add(request.NewErrParamRequired("ApiId")) + } + if s.ApiId != nil && len(*s.ApiId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApiId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApiId sets the ApiId field's value. +func (s *DeleteCorsConfigurationInput) SetApiId(v string) *DeleteCorsConfigurationInput { + s.ApiId = &v + return s +} + +type DeleteCorsConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteCorsConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCorsConfigurationOutput) GoString() string { + return s.String() +} + type DeleteDeploymentInput struct { _ struct{} `type:"structure"` @@ -8436,6 +9293,95 @@ func (s DeleteRouteResponseOutput) GoString() string { return s.String() } +type DeleteRouteSettingsInput struct { + _ struct{} `type:"structure"` + + // ApiId is a required field + ApiId *string `location:"uri" locationName:"apiId" type:"string" required:"true"` + + // After evaluating a selection expression, the result is compared against one + // or more selection keys to find a matching key. See Selection Expressions + // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) + // for a list of expressions and each expression's associated selection key + // type. + // + // RouteKey is a required field + RouteKey *string `location:"uri" locationName:"routeKey" type:"string" required:"true"` + + // StageName is a required field + StageName *string `location:"uri" locationName:"stageName" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteRouteSettingsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRouteSettingsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteRouteSettingsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteRouteSettingsInput"} + if s.ApiId == nil { + invalidParams.Add(request.NewErrParamRequired("ApiId")) + } + if s.ApiId != nil && len(*s.ApiId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApiId", 1)) + } + if s.RouteKey == nil { + invalidParams.Add(request.NewErrParamRequired("RouteKey")) + } + if s.RouteKey != nil && len(*s.RouteKey) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RouteKey", 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 invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApiId sets the ApiId field's value. +func (s *DeleteRouteSettingsInput) SetApiId(v string) *DeleteRouteSettingsInput { + s.ApiId = &v + return s +} + +// SetRouteKey sets the RouteKey field's value. +func (s *DeleteRouteSettingsInput) SetRouteKey(v string) *DeleteRouteSettingsInput { + s.RouteKey = &v + return s +} + +// SetStageName sets the StageName field's value. +func (s *DeleteRouteSettingsInput) SetStageName(v string) *DeleteRouteSettingsInput { + s.StageName = &v + return s +} + +type DeleteRouteSettingsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteRouteSettingsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRouteSettingsOutput) GoString() string { + return s.String() +} + type DeleteStageInput struct { _ struct{} `type:"structure"` @@ -8509,6 +9455,9 @@ func (s DeleteStageOutput) GoString() string { type Deployment struct { _ struct{} `type:"structure"` + // Specifies whether a deployment was automatically released. + AutoDeployed *bool `locationName:"autoDeployed" type:"boolean"` + // The date and time when the Deployment resource was created. CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601"` @@ -8535,6 +9484,12 @@ func (s Deployment) GoString() string { return s.String() } +// SetAutoDeployed sets the AutoDeployed field's value. +func (s *Deployment) SetAutoDeployed(v bool) *Deployment { + s.AutoDeployed = &v + return s +} + // SetCreatedDate sets the CreatedDate field's value. func (s *Deployment) SetCreatedDate(v time.Time) *Deployment { s.CreatedDate = &v @@ -8580,7 +9535,7 @@ type DomainName struct { // The domain name configurations. DomainNameConfigurations []*DomainNameConfiguration `locationName:"domainNameConfigurations" type:"list"` - // Tags for the DomainName. + // The collection of tags associated with a domain name. Tags map[string]*string `locationName:"tags" type:"map"` } @@ -8622,7 +9577,7 @@ func (s *DomainName) SetTags(v map[string]*string) *DomainName { type DomainNameConfiguration struct { _ struct{} `type:"structure"` - // A domain name for the WebSocket API. + // A domain name for the API. ApiGatewayDomainName *string `locationName:"apiGatewayDomainName" type:"string"` // An AWS-managed certificate that will be used by the edge-optimized endpoint @@ -8637,6 +9592,10 @@ type DomainNameConfiguration struct { // for this domain name was uploaded. CertificateUploadDate *time.Time `locationName:"certificateUploadDate" type:"timestamp" timestampFormat:"iso8601"` + // The status of the domain name migration. The valid values are AVAILABLE and + // UPDATING. If the status is UPDATING, the domain cannot be modified further + // until the existing operation is complete. If it is AVAILABLE, the domain + // can be updated. DomainNameStatus *string `locationName:"domainNameStatus" type:"string" enum:"DomainNameStatus"` // An optional text message containing detailed information about status of @@ -8649,6 +9608,8 @@ type DomainNameConfiguration struct { // The Amazon Route 53 Hosted Zone ID of the endpoint. HostedZoneId *string `locationName:"hostedZoneId" type:"string"` + // The Transport Layer Security (TLS) version of the security policy for this + // domain name. The valid values are TLS_1_0 and TLS_1_2. SecurityPolicy *string `locationName:"securityPolicy" type:"string" enum:"SecurityPolicy"` } @@ -8818,7 +9779,7 @@ type GetApiMappingOutput struct { // The identifier. ApiMappingId *string `locationName:"apiMappingId" type:"string"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -8963,6 +9924,11 @@ type GetApiOutput struct { // for more information. ApiKeySelectionExpression *string `locationName:"apiKeySelectionExpression" type:"string"` + // Represents a CORS configuration. Supported only for HTTP APIs. See Configuring + // CORS (https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html) + // for more information. + CorsConfiguration *Cors `locationName:"corsConfiguration" type:"structure"` + CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601"` // A string with a length between [0-1024]. @@ -8970,9 +9936,12 @@ type GetApiOutput struct { DisableSchemaValidation *bool `locationName:"disableSchemaValidation" type:"boolean"` + ImportInfo []*string `locationName:"importInfo" type:"list"` + // A string with a length between [1-128]. Name *string `locationName:"name" type:"string"` + // Represents a protocol type. ProtocolType *string `locationName:"protocolType" type:"string" enum:"ProtocolType"` // An expression used to extract information at runtime. See Selection Expressions @@ -8980,8 +9949,7 @@ type GetApiOutput struct { // for more information. RouteSelectionExpression *string `locationName:"routeSelectionExpression" type:"string"` - // A key value pair of string with key length between[1-128] and value length - // between[1-256] + // Represents a collection of tags associated with the resource. Tags map[string]*string `locationName:"tags" type:"map"` // A string with a length between [1-64]. @@ -9018,6 +9986,12 @@ func (s *GetApiOutput) SetApiKeySelectionExpression(v string) *GetApiOutput { return s } +// SetCorsConfiguration sets the CorsConfiguration field's value. +func (s *GetApiOutput) SetCorsConfiguration(v *Cors) *GetApiOutput { + s.CorsConfiguration = v + return s +} + // SetCreatedDate sets the CreatedDate field's value. func (s *GetApiOutput) SetCreatedDate(v time.Time) *GetApiOutput { s.CreatedDate = &v @@ -9036,6 +10010,12 @@ func (s *GetApiOutput) SetDisableSchemaValidation(v bool) *GetApiOutput { return s } +// SetImportInfo sets the ImportInfo field's value. +func (s *GetApiOutput) SetImportInfo(v []*string) *GetApiOutput { + s.ImportInfo = v + return s +} + // SetName sets the Name field's value. func (s *GetApiOutput) SetName(v string) *GetApiOutput { s.Name = &v @@ -9200,8 +10180,9 @@ type GetAuthorizerOutput struct { // An integer with a value between [0-3600]. AuthorizerResultTtlInSeconds *int64 `locationName:"authorizerResultTtlInSeconds" type:"integer"` - // The authorizer type. Currently the only valid value is REQUEST, for a Lambda - // function using incoming request parameters. + // The authorizer type. For WebSocket APIs, specify REQUEST for a Lambda function + // using incoming request parameters. For HTTP APIs, specify JWT to use JSON + // Web Tokens. AuthorizerType *string `locationName:"authorizerType" type:"string" enum:"AuthorizerType"` // A string representation of a URI with a length between [1-2048]. @@ -9225,11 +10206,12 @@ type GetAuthorizerOutput struct { // A string with a length between [0-1024]. IdentityValidationExpression *string `locationName:"identityValidationExpression" type:"string"` + // Represents the configuration of a JWT authorizer. Required for the JWT authorizer + // type. Supported only for HTTP APIs. + JwtConfiguration *JWTConfiguration `locationName:"jwtConfiguration" type:"structure"` + // A string with a length between [1-128]. Name *string `locationName:"name" type:"string"` - - // For REQUEST authorizer, this is not defined. - ProviderArns []*string `locationName:"providerArns" type:"list"` } // String returns the string representation @@ -9284,15 +10266,15 @@ func (s *GetAuthorizerOutput) SetIdentityValidationExpression(v string) *GetAuth return s } -// SetName sets the Name field's value. -func (s *GetAuthorizerOutput) SetName(v string) *GetAuthorizerOutput { - s.Name = &v +// SetJwtConfiguration sets the JwtConfiguration field's value. +func (s *GetAuthorizerOutput) SetJwtConfiguration(v *JWTConfiguration) *GetAuthorizerOutput { + s.JwtConfiguration = v return s } -// SetProviderArns sets the ProviderArns field's value. -func (s *GetAuthorizerOutput) SetProviderArns(v []*string) *GetAuthorizerOutput { - s.ProviderArns = v +// SetName sets the Name field's value. +func (s *GetAuthorizerOutput) SetName(v string) *GetAuthorizerOutput { + s.Name = &v return s } @@ -9440,6 +10422,8 @@ func (s *GetDeploymentInput) SetDeploymentId(v string) *GetDeploymentInput { type GetDeploymentOutput struct { _ struct{} `type:"structure"` + AutoDeployed *bool `locationName:"autoDeployed" type:"boolean"` + CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601"` // The identifier. @@ -9464,6 +10448,12 @@ func (s GetDeploymentOutput) GoString() string { return s.String() } +// SetAutoDeployed sets the AutoDeployed field's value. +func (s *GetDeploymentOutput) SetAutoDeployed(v bool) *GetDeploymentOutput { + s.AutoDeployed = &v + return s +} + // SetCreatedDate sets the CreatedDate field's value. func (s *GetDeploymentOutput) SetCreatedDate(v time.Time) *GetDeploymentOutput { s.CreatedDate = &v @@ -9634,8 +10624,7 @@ type GetDomainNameOutput struct { // The domain name configurations. DomainNameConfigurations []*DomainNameConfiguration `locationName:"domainNameConfigurations" type:"list"` - // A key value pair of string with key length between[1-128] and value length - // between[1-256] + // Represents a collection of tags associated with the resource. Tags map[string]*string `locationName:"tags" type:"map"` } @@ -9792,13 +10781,16 @@ func (s *GetIntegrationInput) SetIntegrationId(v string) *GetIntegrationInput { type GetIntegrationOutput struct { _ struct{} `type:"structure"` + ApiGatewayManaged *bool `locationName:"apiGatewayManaged" type:"boolean"` + // A string with a length between [1-1024]. ConnectionId *string `locationName:"connectionId" type:"string"` // Represents a connection type. ConnectionType *string `locationName:"connectionType" type:"string" enum:"ConnectionType"` - // Specifies how to handle response payload content type conversions. + // Specifies how to handle response payload content type conversions. Supported + // only for WebSocket APIs. ContentHandlingStrategy *string `locationName:"contentHandlingStrategy" type:"string" enum:"ContentHandlingStrategy"` // Represents an Amazon Resource Name (ARN). @@ -9824,9 +10816,13 @@ type GetIntegrationOutput struct { // A string representation of a URI with a length between [1-2048]. IntegrationUri *string `locationName:"integrationUri" type:"string"` - // Represents passthrough behavior for an integration response. + // Represents passthrough behavior for an integration response. Supported only + // for WebSocket APIs. PassthroughBehavior *string `locationName:"passthroughBehavior" type:"string" enum:"PassthroughBehavior"` + // A string with a length between [1-64]. + PayloadFormatVersion *string `locationName:"payloadFormatVersion" type:"string"` + // A key-value map specifying response parameters that are passed to the method // response from the backend. The key is a method response header parameter // name and the mapped value is an integration response header value, a static @@ -9863,6 +10859,12 @@ func (s GetIntegrationOutput) GoString() string { return s.String() } +// SetApiGatewayManaged sets the ApiGatewayManaged field's value. +func (s *GetIntegrationOutput) SetApiGatewayManaged(v bool) *GetIntegrationOutput { + s.ApiGatewayManaged = &v + return s +} + // SetConnectionId sets the ConnectionId field's value. func (s *GetIntegrationOutput) SetConnectionId(v string) *GetIntegrationOutput { s.ConnectionId = &v @@ -9929,6 +10931,12 @@ func (s *GetIntegrationOutput) SetPassthroughBehavior(v string) *GetIntegrationO return s } +// SetPayloadFormatVersion sets the PayloadFormatVersion field's value. +func (s *GetIntegrationOutput) SetPayloadFormatVersion(v string) *GetIntegrationOutput { + s.PayloadFormatVersion = &v + return s +} + // SetRequestParameters sets the RequestParameters field's value. func (s *GetIntegrationOutput) SetRequestParameters(v map[string]*string) *GetIntegrationOutput { s.RequestParameters = v @@ -10025,13 +11033,14 @@ func (s *GetIntegrationResponseInput) SetIntegrationResponseId(v string) *GetInt type GetIntegrationResponseOutput struct { _ struct{} `type:"structure"` - // Specifies how to handle response payload content type conversions. + // Specifies how to handle response payload content type conversions. Supported + // only for WebSocket APIs. ContentHandlingStrategy *string `locationName:"contentHandlingStrategy" type:"string" enum:"ContentHandlingStrategy"` // The identifier. IntegrationResponseId *string `locationName:"integrationResponseId" type:"string"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -10629,20 +11638,23 @@ func (s *GetRouteInput) SetRouteId(v string) *GetRouteInput { type GetRouteOutput struct { _ struct{} `type:"structure"` + ApiGatewayManaged *bool `locationName:"apiGatewayManaged" type:"boolean"` + ApiKeyRequired *bool `locationName:"apiKeyRequired" type:"boolean"` // A list of authorization scopes configured on a route. The scopes are used - // with a COGNITO_USER_POOLS authorizer to authorize the method invocation. - // The authorization works by matching the route scopes against the scopes parsed - // from the access token in the incoming request. The method invocation is authorized - // if any route scope matches a claimed scope in the access token. Otherwise, - // the invocation is not authorized. When the route scope is configured, the - // client must provide an access token instead of an identity token for authorization - // purposes. + // with a JWT authorizer to authorize the method invocation. The authorization + // works by matching the route scopes against the scopes parsed from the access + // token in the incoming request. The method invocation is authorized if any + // route scope matches a claimed scope in the access token. Otherwise, the invocation + // is not authorized. When the route scope is configured, the client must provide + // an access token instead of an identity token for authorization purposes. AuthorizationScopes []*string `locationName:"authorizationScopes" type:"list"` - // The authorization type. Valid values are NONE for open access, AWS_IAM for - // using AWS IAM permissions, and CUSTOM for using a Lambda authorizer. + // The authorization type. For WebSocket APIs, valid values are NONE for open + // access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda + // authorizer. For HTTP APIs, valid values are NONE for open access, or JWT + // for using JSON Web Tokens. AuthorizationType *string `locationName:"authorizationType" type:"string" enum:"AuthorizationType"` // The identifier. @@ -10665,7 +11677,7 @@ type GetRouteOutput struct { // The identifier. RouteId *string `locationName:"routeId" type:"string"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -10691,6 +11703,12 @@ func (s GetRouteOutput) GoString() string { return s.String() } +// SetApiGatewayManaged sets the ApiGatewayManaged field's value. +func (s *GetRouteOutput) SetApiGatewayManaged(v bool) *GetRouteOutput { + s.ApiGatewayManaged = &v + return s +} + // SetApiKeyRequired sets the ApiKeyRequired field's value. func (s *GetRouteOutput) SetApiKeyRequired(v bool) *GetRouteOutput { s.ApiKeyRequired = &v @@ -10849,7 +11867,7 @@ type GetRouteResponseOutput struct { // The identifier. RouteResponseId *string `locationName:"routeResponseId" type:"string"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -11146,6 +12164,10 @@ type GetStageOutput struct { // Settings for logging access in a stage. AccessLogSettings *AccessLogSettings `locationName:"accessLogSettings" type:"structure"` + ApiGatewayManaged *bool `locationName:"apiGatewayManaged" type:"boolean"` + + AutoDeploy *bool `locationName:"autoDeploy" type:"boolean"` + // The identifier. ClientCertificateId *string `locationName:"clientCertificateId" type:"string"` @@ -11160,6 +12182,8 @@ type GetStageOutput struct { // A string with a length between [0-1024]. Description *string `locationName:"description" type:"string"` + LastDeploymentStatusMessage *string `locationName:"lastDeploymentStatusMessage" type:"string"` + LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601"` // The route settings map. @@ -11171,8 +12195,7 @@ type GetStageOutput struct { // The stage variable map. StageVariables map[string]*string `locationName:"stageVariables" type:"map"` - // A key value pair of string with key length between[1-128] and value length - // between[1-256] + // Represents a collection of tags associated with the resource. Tags map[string]*string `locationName:"tags" type:"map"` } @@ -11192,6 +12215,18 @@ func (s *GetStageOutput) SetAccessLogSettings(v *AccessLogSettings) *GetStageOut return s } +// SetApiGatewayManaged sets the ApiGatewayManaged field's value. +func (s *GetStageOutput) SetApiGatewayManaged(v bool) *GetStageOutput { + s.ApiGatewayManaged = &v + return s +} + +// SetAutoDeploy sets the AutoDeploy field's value. +func (s *GetStageOutput) SetAutoDeploy(v bool) *GetStageOutput { + s.AutoDeploy = &v + return s +} + // SetClientCertificateId sets the ClientCertificateId field's value. func (s *GetStageOutput) SetClientCertificateId(v string) *GetStageOutput { s.ClientCertificateId = &v @@ -11222,6 +12257,12 @@ func (s *GetStageOutput) SetDescription(v string) *GetStageOutput { return s } +// SetLastDeploymentStatusMessage sets the LastDeploymentStatusMessage field's value. +func (s *GetStageOutput) SetLastDeploymentStatusMessage(v string) *GetStageOutput { + s.LastDeploymentStatusMessage = &v + return s +} + // SetLastUpdatedDate sets the LastUpdatedDate field's value. func (s *GetStageOutput) SetLastUpdatedDate(v time.Time) *GetStageOutput { s.LastUpdatedDate = &v @@ -11381,7 +12422,10 @@ func (s *GetTagsInput) SetResourceArn(v string) *GetTagsInput { type GetTagsOutput struct { _ struct{} `type:"structure"` - Tags map[string]*string `locationName:"tags" type:"map"` + // Represents a collection of tags associated with the resource. + // + // Tags is a required field + Tags map[string]*string `locationName:"tags" type:"map" required:"true"` } // String returns the string representation @@ -11400,81 +12444,283 @@ func (s *GetTagsOutput) SetTags(v map[string]*string) *GetTagsOutput { return s } -// Represents an integration. -type Integration struct { +type ImportApiInput struct { _ struct{} `type:"structure"` - // The connection ID. - ConnectionId *string `locationName:"connectionId" type:"string"` + Basepath *string `location:"querystring" locationName:"basepath" type:"string"` - // The type of the network connection to the integration endpoint. Currently - // the only valid value is INTERNET, for connections through the public routable - // internet. - ConnectionType *string `locationName:"connectionType" type:"string" enum:"ConnectionType"` + // Body is a required field + Body *string `locationName:"body" type:"string" required:"true"` - // 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 route response or method response without - // modification. - ContentHandlingStrategy *string `locationName:"contentHandlingStrategy" type:"string" enum:"ContentHandlingStrategy"` + FailOnWarnings *bool `location:"querystring" locationName:"failOnWarnings" type:"boolean"` +} - // Specifies the credentials required for the integration, if any. For AWS integrations, - // three options are available. To specify an IAM Role for 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. - CredentialsArn *string `locationName:"credentialsArn" type:"string"` +// String returns the string representation +func (s ImportApiInput) String() string { + return awsutil.Prettify(s) +} - // Represents the description of an integration. - Description *string `locationName:"description" type:"string"` +// GoString returns the string representation +func (s ImportApiInput) GoString() string { + return s.String() +} - // Represents the identifier of an integration. - IntegrationId *string `locationName:"integrationId" type:"string"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *ImportApiInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ImportApiInput"} + if s.Body == nil { + invalidParams.Add(request.NewErrParamRequired("Body")) + } - // Specifies the integration's HTTP method type. - IntegrationMethod *string `locationName:"integrationMethod" type:"string"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // The integration response selection expression for the integration. See Integration - // Response Selection Expressions (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-integration-response-selection-expressions). - IntegrationResponseSelectionExpression *string `locationName:"integrationResponseSelectionExpression" type:"string"` +// SetBasepath sets the Basepath field's value. +func (s *ImportApiInput) SetBasepath(v string) *ImportApiInput { + s.Basepath = &v + return s +} - // The integration type of an integration. One of the following: - // - // AWS: for integrating the route or method request with an AWS service action, - // including the Lambda function-invoking action. With the Lambda function-invoking - // action, this is referred to as the Lambda custom integration. With any other - // AWS service action, this is known as AWS integration. - // - // AWS_PROXY: for integrating the route or method request with the Lambda function-invoking - // action with the client request passed through as-is. This integration is - // also referred to as Lambda proxy integration. - // - // HTTP: for integrating the route or method request with an HTTP endpoint. - // This integration is also referred to as the HTTP custom integration. - // - // HTTP_PROXY: for integrating route or method request with an HTTP endpoint, - // with the client request passed through as-is. This is also referred to as - // HTTP proxy integration. - // - // MOCK: for integrating the route or method request with API Gateway as a "loopback" - // endpoint without invoking any backend. - IntegrationType *string `locationName:"integrationType" type:"string" enum:"IntegrationType"` +// SetBody sets the Body field's value. +func (s *ImportApiInput) SetBody(v string) *ImportApiInput { + s.Body = &v + return s +} - // For a Lambda proxy integration, this is the URI of the Lambda function. - IntegrationUri *string `locationName:"integrationUri" type:"string"` +// SetFailOnWarnings sets the FailOnWarnings field's value. +func (s *ImportApiInput) SetFailOnWarnings(v bool) *ImportApiInput { + s.FailOnWarnings = &v + return s +} - // Specifies the pass-through behavior for incoming requests based on the Content-Type +type ImportApiOutput struct { + _ struct{} `type:"structure"` + + ApiEndpoint *string `locationName:"apiEndpoint" type:"string"` + + // The identifier. + ApiId *string `locationName:"apiId" type:"string"` + + // An expression used to extract information at runtime. See Selection Expressions + // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) + // for more information. + ApiKeySelectionExpression *string `locationName:"apiKeySelectionExpression" type:"string"` + + // Represents a CORS configuration. Supported only for HTTP APIs. See Configuring + // CORS (https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html) + // for more information. + CorsConfiguration *Cors `locationName:"corsConfiguration" type:"structure"` + + CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601"` + + // A string with a length between [0-1024]. + Description *string `locationName:"description" type:"string"` + + DisableSchemaValidation *bool `locationName:"disableSchemaValidation" type:"boolean"` + + ImportInfo []*string `locationName:"importInfo" type:"list"` + + // A string with a length between [1-128]. + Name *string `locationName:"name" type:"string"` + + // Represents a protocol type. + ProtocolType *string `locationName:"protocolType" type:"string" enum:"ProtocolType"` + + // An expression used to extract information at runtime. See Selection Expressions + // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) + // for more information. + RouteSelectionExpression *string `locationName:"routeSelectionExpression" type:"string"` + + // Represents a collection of tags associated with the resource. + Tags map[string]*string `locationName:"tags" type:"map"` + + // A string with a length between [1-64]. + Version *string `locationName:"version" type:"string"` + + Warnings []*string `locationName:"warnings" type:"list"` +} + +// String returns the string representation +func (s ImportApiOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportApiOutput) GoString() string { + return s.String() +} + +// SetApiEndpoint sets the ApiEndpoint field's value. +func (s *ImportApiOutput) SetApiEndpoint(v string) *ImportApiOutput { + s.ApiEndpoint = &v + return s +} + +// SetApiId sets the ApiId field's value. +func (s *ImportApiOutput) SetApiId(v string) *ImportApiOutput { + s.ApiId = &v + return s +} + +// SetApiKeySelectionExpression sets the ApiKeySelectionExpression field's value. +func (s *ImportApiOutput) SetApiKeySelectionExpression(v string) *ImportApiOutput { + s.ApiKeySelectionExpression = &v + return s +} + +// SetCorsConfiguration sets the CorsConfiguration field's value. +func (s *ImportApiOutput) SetCorsConfiguration(v *Cors) *ImportApiOutput { + s.CorsConfiguration = v + return s +} + +// SetCreatedDate sets the CreatedDate field's value. +func (s *ImportApiOutput) SetCreatedDate(v time.Time) *ImportApiOutput { + s.CreatedDate = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *ImportApiOutput) SetDescription(v string) *ImportApiOutput { + s.Description = &v + return s +} + +// SetDisableSchemaValidation sets the DisableSchemaValidation field's value. +func (s *ImportApiOutput) SetDisableSchemaValidation(v bool) *ImportApiOutput { + s.DisableSchemaValidation = &v + return s +} + +// SetImportInfo sets the ImportInfo field's value. +func (s *ImportApiOutput) SetImportInfo(v []*string) *ImportApiOutput { + s.ImportInfo = v + return s +} + +// SetName sets the Name field's value. +func (s *ImportApiOutput) SetName(v string) *ImportApiOutput { + s.Name = &v + return s +} + +// SetProtocolType sets the ProtocolType field's value. +func (s *ImportApiOutput) SetProtocolType(v string) *ImportApiOutput { + s.ProtocolType = &v + return s +} + +// SetRouteSelectionExpression sets the RouteSelectionExpression field's value. +func (s *ImportApiOutput) SetRouteSelectionExpression(v string) *ImportApiOutput { + s.RouteSelectionExpression = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *ImportApiOutput) SetTags(v map[string]*string) *ImportApiOutput { + s.Tags = v + return s +} + +// SetVersion sets the Version field's value. +func (s *ImportApiOutput) SetVersion(v string) *ImportApiOutput { + s.Version = &v + return s +} + +// SetWarnings sets the Warnings field's value. +func (s *ImportApiOutput) SetWarnings(v []*string) *ImportApiOutput { + s.Warnings = v + return s +} + +// Represents an integration. +type Integration struct { + _ struct{} `type:"structure"` + + // Specifies whether an integration is managed by API Gateway. If you created + // an API using using quick create, the resulting integration is managed by + // API Gateway. You can update a managed integration, but you can't delete it. + ApiGatewayManaged *bool `locationName:"apiGatewayManaged" type:"boolean"` + + // The connection ID. + ConnectionId *string `locationName:"connectionId" type:"string"` + + // The type of the network connection to the integration endpoint. Currently + // the only valid value is INTERNET, for connections through the public routable + // internet. + ConnectionType *string `locationName:"connectionType" type:"string" enum:"ConnectionType"` + + // Supported only for WebSocket APIs. 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 route response or method response without + // modification. + ContentHandlingStrategy *string `locationName:"contentHandlingStrategy" 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 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. + CredentialsArn *string `locationName:"credentialsArn" type:"string"` + + // Represents the description of an integration. + Description *string `locationName:"description" type:"string"` + + // Represents the identifier of an integration. + IntegrationId *string `locationName:"integrationId" type:"string"` + + // Specifies the integration's HTTP method type. + IntegrationMethod *string `locationName:"integrationMethod" type:"string"` + + // The integration response selection expression for the integration. Supported + // only for WebSocket APIs. See Integration Response Selection Expressions (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-integration-response-selection-expressions). + IntegrationResponseSelectionExpression *string `locationName:"integrationResponseSelectionExpression" type:"string"` + + // The integration type of an integration. One of the following: + // + // AWS: for integrating the route or method request with an AWS service action, + // including the Lambda function-invoking action. With the Lambda function-invoking + // action, this is referred to as the Lambda custom integration. With any other + // AWS service action, this is known as AWS integration. Supported only for + // WebSocket APIs. + // + // AWS_PROXY: for integrating the route or method request with the Lambda function-invoking + // action with the client request passed through as-is. This integration is + // also referred to as Lambda proxy integration. + // + // HTTP: for integrating the route or method request with an HTTP endpoint. + // This integration is also referred to as the HTTP custom integration. Supported + // only for WebSocket APIs. + // + // HTTP_PROXY: for integrating route or method request with an HTTP endpoint, + // with the client request passed through as-is. This is also referred to as + // HTTP proxy integration. + // + // MOCK: for integrating the route or method request with API Gateway as a "loopback" + // endpoint without invoking any backend. Supported only for WebSocket APIs. + IntegrationType *string `locationName:"integrationType" type:"string" enum:"IntegrationType"` + + // For a Lambda proxy integration, this is the URI of the Lambda function. + IntegrationUri *string `locationName:"integrationUri" 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. + // values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, and NEVER. Supported only for WebSocket + // APIs. // // WHEN_NO_MATCH passes the request body for unmapped content types through // to the integration backend without transformation. @@ -11488,6 +12734,10 @@ type Integration struct { // Media Type response. PassthroughBehavior *string `locationName:"passthroughBehavior" type:"string" enum:"PassthroughBehavior"` + // Specifies the format of the payload sent to an integration. Required for + // HTTP APIs. Currently, the only supported value is 1.0. + PayloadFormatVersion *string `locationName:"payloadFormatVersion" type:"string"` + // A key-value map specifying request parameters that are passed from the method // request to the backend. The key is an integration request parameter name // and the associated value is a method request parameter value or static value @@ -11495,20 +12745,22 @@ type Integration struct { // the backend. 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. + // name. Supported only for WebSocket APIs. 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. + // value. Supported only for WebSocket APIs. RequestTemplates map[string]*string `locationName:"requestTemplates" type:"map"` - // The template selection expression for the integration. + // The template selection expression for the integration. Supported only for + // WebSocket APIs. TemplateSelectionExpression *string `locationName:"templateSelectionExpression" type:"string"` // Custom timeout between 50 and 29,000 milliseconds. The default value is 29,000 - // milliseconds or 29 seconds. + // milliseconds or 29 seconds for WebSocket APIs. The default value is 5,000 + // milliseconds, or 5 seconds for HTTP APIs. TimeoutInMillis *int64 `locationName:"timeoutInMillis" min:"50" type:"integer"` } @@ -11522,6 +12774,12 @@ func (s Integration) GoString() string { return s.String() } +// SetApiGatewayManaged sets the ApiGatewayManaged field's value. +func (s *Integration) SetApiGatewayManaged(v bool) *Integration { + s.ApiGatewayManaged = &v + return s +} + // SetConnectionId sets the ConnectionId field's value. func (s *Integration) SetConnectionId(v string) *Integration { s.ConnectionId = &v @@ -11588,6 +12846,12 @@ func (s *Integration) SetPassthroughBehavior(v string) *Integration { return s } +// SetPayloadFormatVersion sets the PayloadFormatVersion field's value. +func (s *Integration) SetPayloadFormatVersion(v string) *Integration { + s.PayloadFormatVersion = &v + return s +} + // SetRequestParameters sets the RequestParameters field's value. func (s *Integration) SetRequestParameters(v map[string]*string) *Integration { s.RequestParameters = v @@ -11616,8 +12880,9 @@ func (s *Integration) SetTimeoutInMillis(v int64) *Integration { 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: + // Supported only for WebSocket APIs. 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. @@ -11665,132 +12930,439 @@ func (s IntegrationResponse) String() string { } // GoString returns the string representation -func (s IntegrationResponse) GoString() string { +func (s IntegrationResponse) GoString() string { + return s.String() +} + +// SetContentHandlingStrategy sets the ContentHandlingStrategy field's value. +func (s *IntegrationResponse) SetContentHandlingStrategy(v string) *IntegrationResponse { + s.ContentHandlingStrategy = &v + return s +} + +// SetIntegrationResponseId sets the IntegrationResponseId field's value. +func (s *IntegrationResponse) SetIntegrationResponseId(v string) *IntegrationResponse { + s.IntegrationResponseId = &v + return s +} + +// SetIntegrationResponseKey sets the IntegrationResponseKey field's value. +func (s *IntegrationResponse) SetIntegrationResponseKey(v string) *IntegrationResponse { + s.IntegrationResponseKey = &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 +} + +// SetTemplateSelectionExpression sets the TemplateSelectionExpression field's value. +func (s *IntegrationResponse) SetTemplateSelectionExpression(v string) *IntegrationResponse { + s.TemplateSelectionExpression = &v + return s +} + +// Represents the configuration of a JWT authorizer. Required for the JWT authorizer +// type. Supported only for HTTP APIs. +type JWTConfiguration struct { + _ struct{} `type:"structure"` + + // A list of the intended recipients of the JWT. A valid JWT must provide an + // aud that matches at least one entry in this list. See RFC 7519 (https://tools.ietf.org/html/rfc7519#section-4.1.3). + // Supported only for HTTP APIs. + Audience []*string `locationName:"audience" type:"list"` + + // The base domain of the identity provider that issues JSON Web Tokens. For + // example, an Amazon Cognito user pool has the following format: https://cognito-idp.{region}.amazonaws.com/{userPoolId} + // . Required for the JWT authorizer type. Supported only for HTTP APIs. + Issuer *string `locationName:"issuer" type:"string"` +} + +// String returns the string representation +func (s JWTConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s JWTConfiguration) GoString() string { + return s.String() +} + +// SetAudience sets the Audience field's value. +func (s *JWTConfiguration) SetAudience(v []*string) *JWTConfiguration { + s.Audience = v + return s +} + +// SetIssuer sets the Issuer field's value. +func (s *JWTConfiguration) SetIssuer(v string) *JWTConfiguration { + s.Issuer = &v + return s +} + +// Represents a data model for an API. Supported only for WebSocket APIs. See +// Create Models and Mapping Templates for Request and Response Mappings (https://docs.aws.amazon.com/apigateway/latest/developerguide/models-mappings.html). +type Model struct { + _ struct{} `type:"structure"` + + // The content-type for the model, for example, "application/json". + ContentType *string `locationName:"contentType" type:"string"` + + // The description of the model. + Description *string `locationName:"description" type:"string"` + + // The model identifier. + ModelId *string `locationName:"modelId" type:"string"` + + // The name of the model. Must be alphanumeric. + // + // Name is a required field + Name *string `locationName:"name" type:"string" required:"true"` + + // The schema for the model. For application/json models, this should be JSON + // schema draft 4 model. + 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 +} + +// SetModelId sets the ModelId field's value. +func (s *Model) SetModelId(v string) *Model { + s.ModelId = &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 +} + +// The resource specified in the request was not found. See the message field +// for more information. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Describes the error encountered. + Message_ *string `locationName:"message" type:"string"` + + // The resource type. + ResourceType *string `locationName:"resourceType" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Validation constraints imposed on parameters of a request (path, query string, +// headers). +type ParameterConstraints struct { + _ struct{} `type:"structure"` + + // Whether or not the parameter is required. + Required *bool `locationName:"required" type:"boolean"` +} + +// 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() +} + +// SetRequired sets the Required field's value. +func (s *ParameterConstraints) SetRequired(v bool) *ParameterConstraints { + s.Required = &v + return s +} + +type ReimportApiInput struct { + _ struct{} `type:"structure"` + + // ApiId is a required field + ApiId *string `location:"uri" locationName:"apiId" type:"string" required:"true"` + + Basepath *string `location:"querystring" locationName:"basepath" type:"string"` + + // Body is a required field + Body *string `locationName:"body" type:"string" required:"true"` + + FailOnWarnings *bool `location:"querystring" locationName:"failOnWarnings" type:"boolean"` +} + +// String returns the string representation +func (s ReimportApiInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReimportApiInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReimportApiInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReimportApiInput"} + if s.ApiId == nil { + invalidParams.Add(request.NewErrParamRequired("ApiId")) + } + if s.ApiId != nil && len(*s.ApiId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApiId", 1)) + } + if s.Body == nil { + invalidParams.Add(request.NewErrParamRequired("Body")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApiId sets the ApiId field's value. +func (s *ReimportApiInput) SetApiId(v string) *ReimportApiInput { + s.ApiId = &v + return s +} + +// SetBasepath sets the Basepath field's value. +func (s *ReimportApiInput) SetBasepath(v string) *ReimportApiInput { + s.Basepath = &v + return s +} + +// SetBody sets the Body field's value. +func (s *ReimportApiInput) SetBody(v string) *ReimportApiInput { + s.Body = &v + return s +} + +// SetFailOnWarnings sets the FailOnWarnings field's value. +func (s *ReimportApiInput) SetFailOnWarnings(v bool) *ReimportApiInput { + s.FailOnWarnings = &v + return s +} + +type ReimportApiOutput struct { + _ struct{} `type:"structure"` + + ApiEndpoint *string `locationName:"apiEndpoint" type:"string"` + + // The identifier. + ApiId *string `locationName:"apiId" type:"string"` + + // An expression used to extract information at runtime. See Selection Expressions + // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) + // for more information. + ApiKeySelectionExpression *string `locationName:"apiKeySelectionExpression" type:"string"` + + // Represents a CORS configuration. Supported only for HTTP APIs. See Configuring + // CORS (https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html) + // for more information. + CorsConfiguration *Cors `locationName:"corsConfiguration" type:"structure"` + + CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601"` + + // A string with a length between [0-1024]. + Description *string `locationName:"description" type:"string"` + + DisableSchemaValidation *bool `locationName:"disableSchemaValidation" type:"boolean"` + + ImportInfo []*string `locationName:"importInfo" type:"list"` + + // A string with a length between [1-128]. + Name *string `locationName:"name" type:"string"` + + // Represents a protocol type. + ProtocolType *string `locationName:"protocolType" type:"string" enum:"ProtocolType"` + + // An expression used to extract information at runtime. See Selection Expressions + // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) + // for more information. + RouteSelectionExpression *string `locationName:"routeSelectionExpression" type:"string"` + + // Represents a collection of tags associated with the resource. + Tags map[string]*string `locationName:"tags" type:"map"` + + // A string with a length between [1-64]. + Version *string `locationName:"version" type:"string"` + + Warnings []*string `locationName:"warnings" type:"list"` +} + +// String returns the string representation +func (s ReimportApiOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReimportApiOutput) GoString() string { return s.String() } -// SetContentHandlingStrategy sets the ContentHandlingStrategy field's value. -func (s *IntegrationResponse) SetContentHandlingStrategy(v string) *IntegrationResponse { - s.ContentHandlingStrategy = &v - return s -} - -// SetIntegrationResponseId sets the IntegrationResponseId field's value. -func (s *IntegrationResponse) SetIntegrationResponseId(v string) *IntegrationResponse { - s.IntegrationResponseId = &v +// SetApiEndpoint sets the ApiEndpoint field's value. +func (s *ReimportApiOutput) SetApiEndpoint(v string) *ReimportApiOutput { + s.ApiEndpoint = &v return s } -// SetIntegrationResponseKey sets the IntegrationResponseKey field's value. -func (s *IntegrationResponse) SetIntegrationResponseKey(v string) *IntegrationResponse { - s.IntegrationResponseKey = &v +// SetApiId sets the ApiId field's value. +func (s *ReimportApiOutput) SetApiId(v string) *ReimportApiOutput { + s.ApiId = &v return s } -// SetResponseParameters sets the ResponseParameters field's value. -func (s *IntegrationResponse) SetResponseParameters(v map[string]*string) *IntegrationResponse { - s.ResponseParameters = v +// SetApiKeySelectionExpression sets the ApiKeySelectionExpression field's value. +func (s *ReimportApiOutput) SetApiKeySelectionExpression(v string) *ReimportApiOutput { + s.ApiKeySelectionExpression = &v return s } -// SetResponseTemplates sets the ResponseTemplates field's value. -func (s *IntegrationResponse) SetResponseTemplates(v map[string]*string) *IntegrationResponse { - s.ResponseTemplates = v +// SetCorsConfiguration sets the CorsConfiguration field's value. +func (s *ReimportApiOutput) SetCorsConfiguration(v *Cors) *ReimportApiOutput { + s.CorsConfiguration = v return s } -// SetTemplateSelectionExpression sets the TemplateSelectionExpression field's value. -func (s *IntegrationResponse) SetTemplateSelectionExpression(v string) *IntegrationResponse { - s.TemplateSelectionExpression = &v +// SetCreatedDate sets the CreatedDate field's value. +func (s *ReimportApiOutput) SetCreatedDate(v time.Time) *ReimportApiOutput { + s.CreatedDate = &v return s } -// Represents a data model for an API. See Create Models and Mapping Templates -// for Request and Response Mappings (https://docs.aws.amazon.com/apigateway/latest/developerguide/models-mappings.html). -type Model struct { - _ struct{} `type:"structure"` - - // The content-type for the model, for example, "application/json". - ContentType *string `locationName:"contentType" type:"string"` - - // The description of the model. - Description *string `locationName:"description" type:"string"` - - // The model identifier. - ModelId *string `locationName:"modelId" type:"string"` - - // The name of the model. Must be alphanumeric. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The schema for the model. For application/json models, this should be JSON - // schema draft 4 model. - 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 +// SetDescription sets the Description field's value. +func (s *ReimportApiOutput) SetDescription(v string) *ReimportApiOutput { + s.Description = &v return s } -// SetDescription sets the Description field's value. -func (s *Model) SetDescription(v string) *Model { - s.Description = &v +// SetDisableSchemaValidation sets the DisableSchemaValidation field's value. +func (s *ReimportApiOutput) SetDisableSchemaValidation(v bool) *ReimportApiOutput { + s.DisableSchemaValidation = &v return s } -// SetModelId sets the ModelId field's value. -func (s *Model) SetModelId(v string) *Model { - s.ModelId = &v +// SetImportInfo sets the ImportInfo field's value. +func (s *ReimportApiOutput) SetImportInfo(v []*string) *ReimportApiOutput { + s.ImportInfo = v return s } // SetName sets the Name field's value. -func (s *Model) SetName(v string) *Model { +func (s *ReimportApiOutput) SetName(v string) *ReimportApiOutput { s.Name = &v return s } -// SetSchema sets the Schema field's value. -func (s *Model) SetSchema(v string) *Model { - s.Schema = &v +// SetProtocolType sets the ProtocolType field's value. +func (s *ReimportApiOutput) SetProtocolType(v string) *ReimportApiOutput { + s.ProtocolType = &v return s } -// Validation constraints imposed on parameters of a request (path, query string, -// headers). -type ParameterConstraints struct { - _ struct{} `type:"structure"` - - // Whether or not the parameter is required. - Required *bool `locationName:"required" type:"boolean"` +// SetRouteSelectionExpression sets the RouteSelectionExpression field's value. +func (s *ReimportApiOutput) SetRouteSelectionExpression(v string) *ReimportApiOutput { + s.RouteSelectionExpression = &v + return s } -// String returns the string representation -func (s ParameterConstraints) String() string { - return awsutil.Prettify(s) +// SetTags sets the Tags field's value. +func (s *ReimportApiOutput) SetTags(v map[string]*string) *ReimportApiOutput { + s.Tags = v + return s } -// GoString returns the string representation -func (s ParameterConstraints) GoString() string { - return s.String() +// SetVersion sets the Version field's value. +func (s *ReimportApiOutput) SetVersion(v string) *ReimportApiOutput { + s.Version = &v + return s } -// SetRequired sets the Required field's value. -func (s *ParameterConstraints) SetRequired(v bool) *ParameterConstraints { - s.Required = &v +// SetWarnings sets the Warnings field's value. +func (s *ReimportApiOutput) SetWarnings(v []*string) *ReimportApiOutput { + s.Warnings = v return s } @@ -11798,38 +13370,46 @@ func (s *ParameterConstraints) SetRequired(v bool) *ParameterConstraints { type Route struct { _ struct{} `type:"structure"` - // Specifies whether an API key is required for this route. + // Specifies whether a route is managed by API Gateway. If you created an API + // using quick create, the $default route is managed by API Gateway. You can't + // modify the $default route key. + ApiGatewayManaged *bool `locationName:"apiGatewayManaged" type:"boolean"` + + // Specifies whether an API key is required for this route. Supported only for + // WebSocket APIs. ApiKeyRequired *bool `locationName:"apiKeyRequired" type:"boolean"` // A list of authorization scopes configured on a route. The scopes are used - // with a COGNITO_USER_POOLS authorizer to authorize the method invocation. - // The authorization works by matching the route scopes against the scopes parsed - // from the access token in the incoming request. The method invocation is authorized - // if any route scope matches a claimed scope in the access token. Otherwise, - // the invocation is not authorized. When the route scope is configured, the - // client must provide an access token instead of an identity token for authorization - // purposes. + // with a JWT authorizer to authorize the method invocation. The authorization + // works by matching the route scopes against the scopes parsed from the access + // token in the incoming request. The method invocation is authorized if any + // route scope matches a claimed scope in the access token. Otherwise, the invocation + // is not authorized. When the route scope is configured, the client must provide + // an access token instead of an identity token for authorization purposes. AuthorizationScopes []*string `locationName:"authorizationScopes" type:"list"` - // The authorization type for the route. Valid values are NONE for open access, - // AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer + // The authorization type for the route. For WebSocket APIs, valid values are + // NONE for open access, AWS_IAM for using AWS IAM permissions, and CUSTOM for + // using a Lambda authorizer For HTTP APIs, valid values are NONE for open access, + // or JWT for using JSON Web Tokens. AuthorizationType *string `locationName:"authorizationType" type:"string" enum:"AuthorizationType"` - // The identifier of the Authorizer resource to be associated with this route, - // if the authorizationType is CUSTOM . The authorizer identifier is generated - // by API Gateway when you created the authorizer. + // The identifier of the Authorizer resource to be associated with this route. + // The authorizer identifier is generated by API Gateway when you created the + // authorizer. AuthorizerId *string `locationName:"authorizerId" type:"string"` - // The model selection expression for the route. + // The model selection expression for the route. Supported only for WebSocket + // APIs. ModelSelectionExpression *string `locationName:"modelSelectionExpression" type:"string"` // The operation name for the route. OperationName *string `locationName:"operationName" type:"string"` - // The request models for the route. + // The request models for the route. Supported only for WebSocket APIs. RequestModels map[string]*string `locationName:"requestModels" type:"map"` - // The request parameters for the route. + // The request parameters for the route. Supported only for WebSocket APIs. RequestParameters map[string]*ParameterConstraints `locationName:"requestParameters" type:"map"` // The route ID. @@ -11840,7 +13420,8 @@ type Route struct { // RouteKey is a required field RouteKey *string `locationName:"routeKey" type:"string" required:"true"` - // The route response selection expression for the route. + // The route response selection expression for the route. Supported only for + // WebSocket APIs. RouteResponseSelectionExpression *string `locationName:"routeResponseSelectionExpression" type:"string"` // The target for the route. @@ -11857,6 +13438,12 @@ func (s Route) GoString() string { return s.String() } +// SetApiGatewayManaged sets the ApiGatewayManaged field's value. +func (s *Route) SetApiGatewayManaged(v bool) *Route { + s.ApiGatewayManaged = &v + return s +} + // SetApiKeyRequired sets the ApiKeyRequired field's value. func (s *Route) SetApiKeyRequired(v bool) *Route { s.ApiKeyRequired = &v @@ -11933,7 +13520,8 @@ func (s *Route) SetTarget(v string) *Route { type RouteResponse struct { _ struct{} `type:"structure"` - // Represents the model selection expression of a route response. + // Represents the model selection expression of a route response. Supported + // only for WebSocket APIs. ModelSelectionExpression *string `locationName:"modelSelectionExpression" type:"string"` // Represents the response models of a route response. @@ -11997,20 +13585,21 @@ type RouteSettings struct { // Specifies whether (true) or not (false) data trace logging is enabled for // this route. This property affects the log entries pushed to Amazon CloudWatch - // Logs. + // Logs. Supported only for WebSocket APIs. DataTraceEnabled *bool `locationName:"dataTraceEnabled" type:"boolean"` // Specifies whether detailed metrics are enabled. DetailedMetricsEnabled *bool `locationName:"detailedMetricsEnabled" type:"boolean"` - // Specifies the logging level for this route: DEBUG, INFO, or WARN. This property - // affects the log entries pushed to Amazon CloudWatch Logs. + // Specifies the logging level for this route: INFO, ERROR, or OFF. This property + // affects the log entries pushed to Amazon CloudWatch Logs. Supported only + // for WebSocket APIs. LoggingLevel *string `locationName:"loggingLevel" type:"string" enum:"LoggingLevel"` - // Specifies the throttling burst limit. + // Specifies the throttling burst limit. Supported only for WebSocket APIs. ThrottlingBurstLimit *int64 `locationName:"throttlingBurstLimit" type:"integer"` - // Specifies the throttling rate limit. + // Specifies the throttling rate limit. Supported only for WebSocket APIs. ThrottlingRateLimit *float64 `locationName:"throttlingRateLimit" type:"double"` } @@ -12061,7 +13650,17 @@ type Stage struct { // Settings for logging access in this stage. AccessLogSettings *AccessLogSettings `locationName:"accessLogSettings" type:"structure"` - // The identifier of a client certificate for a Stage. + // Specifies whether a stage is managed by API Gateway. If you created an API + // using quick create, the $default stage is managed by API Gateway. You can't + // modify the $default stage. + ApiGatewayManaged *bool `locationName:"apiGatewayManaged" type:"boolean"` + + // Specifies whether updates to an API automatically trigger a new deployment. + // The default value is false. + AutoDeploy *bool `locationName:"autoDeploy" type:"boolean"` + + // The identifier of a client certificate for a Stage. Supported only for WebSocket + // APIs. ClientCertificateId *string `locationName:"clientCertificateId" type:"string"` // The timestamp when the stage was created. @@ -12070,16 +13669,21 @@ type Stage struct { // Default route settings for the stage. DefaultRouteSettings *RouteSettings `locationName:"defaultRouteSettings" type:"structure"` - // The identifier of the Deployment that the Stage is associated with. + // The identifier of the Deployment that the Stage is associated with. Can't + // be updated if autoDeploy is enabled. DeploymentId *string `locationName:"deploymentId" type:"string"` // The description of the stage. Description *string `locationName:"description" type:"string"` + // Describes the status of the last deployment of a stage. Supported only for + // stages with autoDeploy enabled. + LastDeploymentStatusMessage *string `locationName:"lastDeploymentStatusMessage" type:"string"` + // The timestamp when the stage was last updated. LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601"` - // Route settings for the stage. + // Route settings for the stage, by routeKey. RouteSettings map[string]*RouteSettings `locationName:"routeSettings" type:"map"` // The name of the stage. @@ -12089,10 +13693,10 @@ type Stage struct { // 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-._~:/?#&=,]+. + // [A-Za-z0-9-._~:/?#&=,]+. Supported only for WebSocket APIs. StageVariables map[string]*string `locationName:"stageVariables" type:"map"` - // Tags for the Stage. + // The collection of tags. Each tag element is associated with a given resource. Tags map[string]*string `locationName:"tags" type:"map"` } @@ -12112,6 +13716,18 @@ func (s *Stage) SetAccessLogSettings(v *AccessLogSettings) *Stage { return s } +// SetApiGatewayManaged sets the ApiGatewayManaged field's value. +func (s *Stage) SetApiGatewayManaged(v bool) *Stage { + s.ApiGatewayManaged = &v + return s +} + +// SetAutoDeploy sets the AutoDeploy field's value. +func (s *Stage) SetAutoDeploy(v bool) *Stage { + s.AutoDeploy = &v + return s +} + // SetClientCertificateId sets the ClientCertificateId field's value. func (s *Stage) SetClientCertificateId(v string) *Stage { s.ClientCertificateId = &v @@ -12142,6 +13758,12 @@ func (s *Stage) SetDescription(v string) *Stage { return s } +// SetLastDeploymentStatusMessage sets the LastDeploymentStatusMessage field's value. +func (s *Stage) SetLastDeploymentStatusMessage(v string) *Stage { + s.LastDeploymentStatusMessage = &v + return s +} + // SetLastUpdatedDate sets the LastUpdatedDate field's value. func (s *Stage) SetLastUpdatedDate(v time.Time) *Stage { s.LastUpdatedDate = &v @@ -12178,8 +13800,7 @@ type TagResourceInput struct { // ResourceArn is a required field ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` - // A key value pair of string with key length between[1-128] and value length - // between[1-256] + // Represents a collection of tags associated with the resource. Tags map[string]*string `locationName:"tags" type:"map"` } @@ -12235,6 +13856,64 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// A limit has been exceeded. See the accompanying error message for details. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + LimitType *string `locationName:"limitType" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -12311,6 +13990,14 @@ type UpdateApiInput struct { // for more information. ApiKeySelectionExpression *string `locationName:"apiKeySelectionExpression" type:"string"` + // Represents a CORS configuration. Supported only for HTTP APIs. See Configuring + // CORS (https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html) + // for more information. + CorsConfiguration *Cors `locationName:"corsConfiguration" type:"structure"` + + // Represents an Amazon Resource Name (ARN). + CredentialsArn *string `locationName:"credentialsArn" type:"string"` + // A string with a length between [0-1024]. Description *string `locationName:"description" type:"string"` @@ -12319,11 +14006,21 @@ type UpdateApiInput struct { // A string with a length between [1-128]. Name *string `locationName:"name" type:"string"` + // After evaluating a selection expression, the result is compared against one + // or more selection keys to find a matching key. See Selection Expressions + // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) + // for a list of expressions and each expression's associated selection key + // type. + RouteKey *string `locationName:"routeKey" type:"string"` + // An expression used to extract information at runtime. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for more information. RouteSelectionExpression *string `locationName:"routeSelectionExpression" type:"string"` + // A string representation of a URI with a length between [1-2048]. + Target *string `locationName:"target" type:"string"` + // A string with a length between [1-64]. Version *string `locationName:"version" type:"string"` } @@ -12347,6 +14044,11 @@ func (s *UpdateApiInput) Validate() error { if s.ApiId != nil && len(*s.ApiId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApiId", 1)) } + if s.CorsConfiguration != nil { + if err := s.CorsConfiguration.Validate(); err != nil { + invalidParams.AddNested("CorsConfiguration", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -12366,6 +14068,18 @@ func (s *UpdateApiInput) SetApiKeySelectionExpression(v string) *UpdateApiInput return s } +// SetCorsConfiguration sets the CorsConfiguration field's value. +func (s *UpdateApiInput) SetCorsConfiguration(v *Cors) *UpdateApiInput { + s.CorsConfiguration = v + return s +} + +// SetCredentialsArn sets the CredentialsArn field's value. +func (s *UpdateApiInput) SetCredentialsArn(v string) *UpdateApiInput { + s.CredentialsArn = &v + return s +} + // SetDescription sets the Description field's value. func (s *UpdateApiInput) SetDescription(v string) *UpdateApiInput { s.Description = &v @@ -12384,12 +14098,24 @@ func (s *UpdateApiInput) SetName(v string) *UpdateApiInput { return s } +// SetRouteKey sets the RouteKey field's value. +func (s *UpdateApiInput) SetRouteKey(v string) *UpdateApiInput { + s.RouteKey = &v + return s +} + // SetRouteSelectionExpression sets the RouteSelectionExpression field's value. func (s *UpdateApiInput) SetRouteSelectionExpression(v string) *UpdateApiInput { s.RouteSelectionExpression = &v return s } +// SetTarget sets the Target field's value. +func (s *UpdateApiInput) SetTarget(v string) *UpdateApiInput { + s.Target = &v + return s +} + // SetVersion sets the Version field's value. func (s *UpdateApiInput) SetVersion(v string) *UpdateApiInput { s.Version = &v @@ -12407,7 +14133,7 @@ type UpdateApiMappingInput struct { // ApiMappingId is a required field ApiMappingId *string `location:"uri" locationName:"apiMappingId" type:"string" required:"true"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -12495,7 +14221,7 @@ type UpdateApiMappingOutput struct { // The identifier. ApiMappingId *string `locationName:"apiMappingId" type:"string"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -12553,6 +14279,11 @@ type UpdateApiOutput struct { // for more information. ApiKeySelectionExpression *string `locationName:"apiKeySelectionExpression" type:"string"` + // Represents a CORS configuration. Supported only for HTTP APIs. See Configuring + // CORS (https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-cors.html) + // for more information. + CorsConfiguration *Cors `locationName:"corsConfiguration" type:"structure"` + CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601"` // A string with a length between [0-1024]. @@ -12560,9 +14291,12 @@ type UpdateApiOutput struct { DisableSchemaValidation *bool `locationName:"disableSchemaValidation" type:"boolean"` + ImportInfo []*string `locationName:"importInfo" type:"list"` + // A string with a length between [1-128]. Name *string `locationName:"name" type:"string"` + // Represents a protocol type. ProtocolType *string `locationName:"protocolType" type:"string" enum:"ProtocolType"` // An expression used to extract information at runtime. See Selection Expressions @@ -12570,8 +14304,7 @@ type UpdateApiOutput struct { // for more information. RouteSelectionExpression *string `locationName:"routeSelectionExpression" type:"string"` - // A key value pair of string with key length between[1-128] and value length - // between[1-256] + // Represents a collection of tags associated with the resource. Tags map[string]*string `locationName:"tags" type:"map"` // A string with a length between [1-64]. @@ -12608,6 +14341,12 @@ func (s *UpdateApiOutput) SetApiKeySelectionExpression(v string) *UpdateApiOutpu return s } +// SetCorsConfiguration sets the CorsConfiguration field's value. +func (s *UpdateApiOutput) SetCorsConfiguration(v *Cors) *UpdateApiOutput { + s.CorsConfiguration = v + return s +} + // SetCreatedDate sets the CreatedDate field's value. func (s *UpdateApiOutput) SetCreatedDate(v time.Time) *UpdateApiOutput { s.CreatedDate = &v @@ -12626,6 +14365,12 @@ func (s *UpdateApiOutput) SetDisableSchemaValidation(v bool) *UpdateApiOutput { return s } +// SetImportInfo sets the ImportInfo field's value. +func (s *UpdateApiOutput) SetImportInfo(v []*string) *UpdateApiOutput { + s.ImportInfo = v + return s +} + // SetName sets the Name field's value. func (s *UpdateApiOutput) SetName(v string) *UpdateApiOutput { s.Name = &v @@ -12677,8 +14422,9 @@ type UpdateAuthorizerInput struct { // An integer with a value between [0-3600]. AuthorizerResultTtlInSeconds *int64 `locationName:"authorizerResultTtlInSeconds" type:"integer"` - // The authorizer type. Currently the only valid value is REQUEST, for a Lambda - // function using incoming request parameters. + // The authorizer type. For WebSocket APIs, specify REQUEST for a Lambda function + // using incoming request parameters. For HTTP APIs, specify JWT to use JSON + // Web Tokens. AuthorizerType *string `locationName:"authorizerType" type:"string" enum:"AuthorizerType"` // A string representation of a URI with a length between [1-2048]. @@ -12702,11 +14448,12 @@ type UpdateAuthorizerInput struct { // A string with a length between [0-1024]. IdentityValidationExpression *string `locationName:"identityValidationExpression" type:"string"` + // Represents the configuration of a JWT authorizer. Required for the JWT authorizer + // type. Supported only for HTTP APIs. + JwtConfiguration *JWTConfiguration `locationName:"jwtConfiguration" type:"structure"` + // A string with a length between [1-128]. Name *string `locationName:"name" type:"string"` - - // For REQUEST authorizer, this is not defined. - ProviderArns []*string `locationName:"providerArns" type:"list"` } // String returns the string representation @@ -12789,15 +14536,15 @@ func (s *UpdateAuthorizerInput) SetIdentityValidationExpression(v string) *Updat return s } -// SetName sets the Name field's value. -func (s *UpdateAuthorizerInput) SetName(v string) *UpdateAuthorizerInput { - s.Name = &v +// SetJwtConfiguration sets the JwtConfiguration field's value. +func (s *UpdateAuthorizerInput) SetJwtConfiguration(v *JWTConfiguration) *UpdateAuthorizerInput { + s.JwtConfiguration = v return s } -// SetProviderArns sets the ProviderArns field's value. -func (s *UpdateAuthorizerInput) SetProviderArns(v []*string) *UpdateAuthorizerInput { - s.ProviderArns = v +// SetName sets the Name field's value. +func (s *UpdateAuthorizerInput) SetName(v string) *UpdateAuthorizerInput { + s.Name = &v return s } @@ -12813,8 +14560,9 @@ type UpdateAuthorizerOutput struct { // An integer with a value between [0-3600]. AuthorizerResultTtlInSeconds *int64 `locationName:"authorizerResultTtlInSeconds" type:"integer"` - // The authorizer type. Currently the only valid value is REQUEST, for a Lambda - // function using incoming request parameters. + // The authorizer type. For WebSocket APIs, specify REQUEST for a Lambda function + // using incoming request parameters. For HTTP APIs, specify JWT to use JSON + // Web Tokens. AuthorizerType *string `locationName:"authorizerType" type:"string" enum:"AuthorizerType"` // A string representation of a URI with a length between [1-2048]. @@ -12838,11 +14586,12 @@ type UpdateAuthorizerOutput struct { // A string with a length between [0-1024]. IdentityValidationExpression *string `locationName:"identityValidationExpression" type:"string"` + // Represents the configuration of a JWT authorizer. Required for the JWT authorizer + // type. Supported only for HTTP APIs. + JwtConfiguration *JWTConfiguration `locationName:"jwtConfiguration" type:"structure"` + // A string with a length between [1-128]. Name *string `locationName:"name" type:"string"` - - // For REQUEST authorizer, this is not defined. - ProviderArns []*string `locationName:"providerArns" type:"list"` } // String returns the string representation @@ -12897,15 +14646,15 @@ func (s *UpdateAuthorizerOutput) SetIdentityValidationExpression(v string) *Upda return s } -// SetName sets the Name field's value. -func (s *UpdateAuthorizerOutput) SetName(v string) *UpdateAuthorizerOutput { - s.Name = &v +// SetJwtConfiguration sets the JwtConfiguration field's value. +func (s *UpdateAuthorizerOutput) SetJwtConfiguration(v *JWTConfiguration) *UpdateAuthorizerOutput { + s.JwtConfiguration = v return s } -// SetProviderArns sets the ProviderArns field's value. -func (s *UpdateAuthorizerOutput) SetProviderArns(v []*string) *UpdateAuthorizerOutput { - s.ProviderArns = v +// SetName sets the Name field's value. +func (s *UpdateAuthorizerOutput) SetName(v string) *UpdateAuthorizerOutput { + s.Name = &v return s } @@ -12975,6 +14724,8 @@ func (s *UpdateDeploymentInput) SetDescription(v string) *UpdateDeploymentInput type UpdateDeploymentOutput struct { _ struct{} `type:"structure"` + AutoDeployed *bool `locationName:"autoDeployed" type:"boolean"` + CreatedDate *time.Time `locationName:"createdDate" type:"timestamp" timestampFormat:"iso8601"` // The identifier. @@ -12999,6 +14750,12 @@ func (s UpdateDeploymentOutput) GoString() string { return s.String() } +// SetAutoDeployed sets the AutoDeployed field's value. +func (s *UpdateDeploymentOutput) SetAutoDeployed(v bool) *UpdateDeploymentOutput { + s.AutoDeployed = &v + return s +} + // SetCreatedDate sets the CreatedDate field's value. func (s *UpdateDeploymentOutput) SetCreatedDate(v time.Time) *UpdateDeploymentOutput { s.CreatedDate = &v @@ -13091,8 +14848,7 @@ type UpdateDomainNameOutput struct { // The domain name configurations. DomainNameConfigurations []*DomainNameConfiguration `locationName:"domainNameConfigurations" type:"list"` - // A key value pair of string with key length between[1-128] and value length - // between[1-256] + // Represents a collection of tags associated with the resource. Tags map[string]*string `locationName:"tags" type:"map"` } @@ -13142,7 +14898,8 @@ type UpdateIntegrationInput struct { // Represents a connection type. ConnectionType *string `locationName:"connectionType" type:"string" enum:"ConnectionType"` - // Specifies how to handle response payload content type conversions. + // Specifies how to handle response payload content type conversions. Supported + // only for WebSocket APIs. ContentHandlingStrategy *string `locationName:"contentHandlingStrategy" type:"string" enum:"ContentHandlingStrategy"` // Represents an Amazon Resource Name (ARN). @@ -13163,9 +14920,13 @@ type UpdateIntegrationInput struct { // A string representation of a URI with a length between [1-2048]. IntegrationUri *string `locationName:"integrationUri" type:"string"` - // Represents passthrough behavior for an integration response. + // Represents passthrough behavior for an integration response. Supported only + // for WebSocket APIs. PassthroughBehavior *string `locationName:"passthroughBehavior" type:"string" enum:"PassthroughBehavior"` + // A string with a length between [1-64]. + PayloadFormatVersion *string `locationName:"payloadFormatVersion" type:"string"` + // A key-value map specifying response parameters that are passed to the method // response from the backend. The key is a method response header parameter // name and the mapped value is an integration response header value, a static @@ -13293,6 +15054,12 @@ func (s *UpdateIntegrationInput) SetPassthroughBehavior(v string) *UpdateIntegra return s } +// SetPayloadFormatVersion sets the PayloadFormatVersion field's value. +func (s *UpdateIntegrationInput) SetPayloadFormatVersion(v string) *UpdateIntegrationInput { + s.PayloadFormatVersion = &v + return s +} + // SetRequestParameters sets the RequestParameters field's value. func (s *UpdateIntegrationInput) SetRequestParameters(v map[string]*string) *UpdateIntegrationInput { s.RequestParameters = v @@ -13320,13 +15087,16 @@ func (s *UpdateIntegrationInput) SetTimeoutInMillis(v int64) *UpdateIntegrationI type UpdateIntegrationOutput struct { _ struct{} `type:"structure"` + ApiGatewayManaged *bool `locationName:"apiGatewayManaged" type:"boolean"` + // A string with a length between [1-1024]. ConnectionId *string `locationName:"connectionId" type:"string"` // Represents a connection type. ConnectionType *string `locationName:"connectionType" type:"string" enum:"ConnectionType"` - // Specifies how to handle response payload content type conversions. + // Specifies how to handle response payload content type conversions. Supported + // only for WebSocket APIs. ContentHandlingStrategy *string `locationName:"contentHandlingStrategy" type:"string" enum:"ContentHandlingStrategy"` // Represents an Amazon Resource Name (ARN). @@ -13352,9 +15122,13 @@ type UpdateIntegrationOutput struct { // A string representation of a URI with a length between [1-2048]. IntegrationUri *string `locationName:"integrationUri" type:"string"` - // Represents passthrough behavior for an integration response. + // Represents passthrough behavior for an integration response. Supported only + // for WebSocket APIs. PassthroughBehavior *string `locationName:"passthroughBehavior" type:"string" enum:"PassthroughBehavior"` + // A string with a length between [1-64]. + PayloadFormatVersion *string `locationName:"payloadFormatVersion" type:"string"` + // A key-value map specifying response parameters that are passed to the method // response from the backend. The key is a method response header parameter // name and the mapped value is an integration response header value, a static @@ -13391,6 +15165,12 @@ func (s UpdateIntegrationOutput) GoString() string { return s.String() } +// SetApiGatewayManaged sets the ApiGatewayManaged field's value. +func (s *UpdateIntegrationOutput) SetApiGatewayManaged(v bool) *UpdateIntegrationOutput { + s.ApiGatewayManaged = &v + return s +} + // SetConnectionId sets the ConnectionId field's value. func (s *UpdateIntegrationOutput) SetConnectionId(v string) *UpdateIntegrationOutput { s.ConnectionId = &v @@ -13457,6 +15237,12 @@ func (s *UpdateIntegrationOutput) SetPassthroughBehavior(v string) *UpdateIntegr return s } +// SetPayloadFormatVersion sets the PayloadFormatVersion field's value. +func (s *UpdateIntegrationOutput) SetPayloadFormatVersion(v string) *UpdateIntegrationOutput { + s.PayloadFormatVersion = &v + return s +} + // SetRequestParameters sets the RequestParameters field's value. func (s *UpdateIntegrationOutput) SetRequestParameters(v map[string]*string) *UpdateIntegrationOutput { s.RequestParameters = v @@ -13487,7 +15273,8 @@ type UpdateIntegrationResponseInput struct { // ApiId is a required field ApiId *string `location:"uri" locationName:"apiId" type:"string" required:"true"` - // Specifies how to handle response payload content type conversions. + // Specifies how to handle response payload content type conversions. Supported + // only for WebSocket APIs. ContentHandlingStrategy *string `locationName:"contentHandlingStrategy" type:"string" enum:"ContentHandlingStrategy"` // IntegrationId is a required field @@ -13496,7 +15283,7 @@ type UpdateIntegrationResponseInput struct { // IntegrationResponseId is a required field IntegrationResponseId *string `location:"uri" locationName:"integrationResponseId" type:"string" required:"true"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -13615,13 +15402,14 @@ func (s *UpdateIntegrationResponseInput) SetTemplateSelectionExpression(v string type UpdateIntegrationResponseOutput struct { _ struct{} `type:"structure"` - // Specifies how to handle response payload content type conversions. + // Specifies how to handle response payload content type conversions. Supported + // only for WebSocket APIs. ContentHandlingStrategy *string `locationName:"contentHandlingStrategy" type:"string" enum:"ContentHandlingStrategy"` // The identifier. IntegrationResponseId *string `locationName:"integrationResponseId" type:"string"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -13855,17 +15643,18 @@ type UpdateRouteInput struct { ApiKeyRequired *bool `locationName:"apiKeyRequired" type:"boolean"` // A list of authorization scopes configured on a route. The scopes are used - // with a COGNITO_USER_POOLS authorizer to authorize the method invocation. - // The authorization works by matching the route scopes against the scopes parsed - // from the access token in the incoming request. The method invocation is authorized - // if any route scope matches a claimed scope in the access token. Otherwise, - // the invocation is not authorized. When the route scope is configured, the - // client must provide an access token instead of an identity token for authorization - // purposes. + // with a JWT authorizer to authorize the method invocation. The authorization + // works by matching the route scopes against the scopes parsed from the access + // token in the incoming request. The method invocation is authorized if any + // route scope matches a claimed scope in the access token. Otherwise, the invocation + // is not authorized. When the route scope is configured, the client must provide + // an access token instead of an identity token for authorization purposes. AuthorizationScopes []*string `locationName:"authorizationScopes" type:"list"` - // The authorization type. Valid values are NONE for open access, AWS_IAM for - // using AWS IAM permissions, and CUSTOM for using a Lambda authorizer. + // The authorization type. For WebSocket APIs, valid values are NONE for open + // access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda + // authorizer. For HTTP APIs, valid values are NONE for open access, or JWT + // for using JSON Web Tokens. AuthorizationType *string `locationName:"authorizationType" type:"string" enum:"AuthorizationType"` // The identifier. @@ -13888,7 +15677,7 @@ type UpdateRouteInput struct { // RouteId is a required field RouteId *string `location:"uri" locationName:"routeId" type:"string" required:"true"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -14017,20 +15806,23 @@ func (s *UpdateRouteInput) SetTarget(v string) *UpdateRouteInput { type UpdateRouteOutput struct { _ struct{} `type:"structure"` + ApiGatewayManaged *bool `locationName:"apiGatewayManaged" type:"boolean"` + ApiKeyRequired *bool `locationName:"apiKeyRequired" type:"boolean"` // A list of authorization scopes configured on a route. The scopes are used - // with a COGNITO_USER_POOLS authorizer to authorize the method invocation. - // The authorization works by matching the route scopes against the scopes parsed - // from the access token in the incoming request. The method invocation is authorized - // if any route scope matches a claimed scope in the access token. Otherwise, - // the invocation is not authorized. When the route scope is configured, the - // client must provide an access token instead of an identity token for authorization - // purposes. + // with a JWT authorizer to authorize the method invocation. The authorization + // works by matching the route scopes against the scopes parsed from the access + // token in the incoming request. The method invocation is authorized if any + // route scope matches a claimed scope in the access token. Otherwise, the invocation + // is not authorized. When the route scope is configured, the client must provide + // an access token instead of an identity token for authorization purposes. AuthorizationScopes []*string `locationName:"authorizationScopes" type:"list"` - // The authorization type. Valid values are NONE for open access, AWS_IAM for - // using AWS IAM permissions, and CUSTOM for using a Lambda authorizer. + // The authorization type. For WebSocket APIs, valid values are NONE for open + // access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda + // authorizer. For HTTP APIs, valid values are NONE for open access, or JWT + // for using JSON Web Tokens. AuthorizationType *string `locationName:"authorizationType" type:"string" enum:"AuthorizationType"` // The identifier. @@ -14053,7 +15845,7 @@ type UpdateRouteOutput struct { // The identifier. RouteId *string `locationName:"routeId" type:"string"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -14079,6 +15871,12 @@ func (s UpdateRouteOutput) GoString() string { return s.String() } +// SetApiGatewayManaged sets the ApiGatewayManaged field's value. +func (s *UpdateRouteOutput) SetApiGatewayManaged(v bool) *UpdateRouteOutput { + s.ApiGatewayManaged = &v + return s +} + // SetApiKeyRequired sets the ApiKeyRequired field's value. func (s *UpdateRouteOutput) SetApiKeyRequired(v bool) *UpdateRouteOutput { s.ApiKeyRequired = &v @@ -14174,7 +15972,7 @@ type UpdateRouteResponseInput struct { // RouteResponseId is a required field RouteResponseId *string `location:"uri" locationName:"routeResponseId" type:"string" required:"true"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -14279,7 +16077,7 @@ type UpdateRouteResponseOutput struct { // The identifier. RouteResponseId *string `locationName:"routeResponseId" type:"string"` - // After evaulating a selection expression, the result is compared against one + // After evaluating a selection expression, the result is compared against one // or more selection keys to find a matching key. See Selection Expressions // (https://docs.aws.amazon.com/apigateway/latest/developerguide/apigateway-websocket-api-selection-expressions.html#apigateway-websocket-api-apikey-selection-expressions) // for a list of expressions and each expression's associated selection key @@ -14336,6 +16134,8 @@ type UpdateStageInput struct { // ApiId is a required field ApiId *string `location:"uri" locationName:"apiId" type:"string" required:"true"` + AutoDeploy *bool `locationName:"autoDeploy" type:"boolean"` + // The identifier. ClientCertificateId *string `locationName:"clientCertificateId" type:"string"` @@ -14402,6 +16202,12 @@ func (s *UpdateStageInput) SetApiId(v string) *UpdateStageInput { return s } +// SetAutoDeploy sets the AutoDeploy field's value. +func (s *UpdateStageInput) SetAutoDeploy(v bool) *UpdateStageInput { + s.AutoDeploy = &v + return s +} + // SetClientCertificateId sets the ClientCertificateId field's value. func (s *UpdateStageInput) SetClientCertificateId(v string) *UpdateStageInput { s.ClientCertificateId = &v @@ -14450,6 +16256,10 @@ type UpdateStageOutput struct { // Settings for logging access in a stage. AccessLogSettings *AccessLogSettings `locationName:"accessLogSettings" type:"structure"` + ApiGatewayManaged *bool `locationName:"apiGatewayManaged" type:"boolean"` + + AutoDeploy *bool `locationName:"autoDeploy" type:"boolean"` + // The identifier. ClientCertificateId *string `locationName:"clientCertificateId" type:"string"` @@ -14464,6 +16274,8 @@ type UpdateStageOutput struct { // A string with a length between [0-1024]. Description *string `locationName:"description" type:"string"` + LastDeploymentStatusMessage *string `locationName:"lastDeploymentStatusMessage" type:"string"` + LastUpdatedDate *time.Time `locationName:"lastUpdatedDate" type:"timestamp" timestampFormat:"iso8601"` // The route settings map. @@ -14475,8 +16287,7 @@ type UpdateStageOutput struct { // The stage variable map. StageVariables map[string]*string `locationName:"stageVariables" type:"map"` - // A key value pair of string with key length between[1-128] and value length - // between[1-256] + // Represents a collection of tags associated with the resource. Tags map[string]*string `locationName:"tags" type:"map"` } @@ -14496,6 +16307,18 @@ func (s *UpdateStageOutput) SetAccessLogSettings(v *AccessLogSettings) *UpdateSt return s } +// SetApiGatewayManaged sets the ApiGatewayManaged field's value. +func (s *UpdateStageOutput) SetApiGatewayManaged(v bool) *UpdateStageOutput { + s.ApiGatewayManaged = &v + return s +} + +// SetAutoDeploy sets the AutoDeploy field's value. +func (s *UpdateStageOutput) SetAutoDeploy(v bool) *UpdateStageOutput { + s.AutoDeploy = &v + return s +} + // SetClientCertificateId sets the ClientCertificateId field's value. func (s *UpdateStageOutput) SetClientCertificateId(v string) *UpdateStageOutput { s.ClientCertificateId = &v @@ -14526,6 +16349,12 @@ func (s *UpdateStageOutput) SetDescription(v string) *UpdateStageOutput { return s } +// SetLastDeploymentStatusMessage sets the LastDeploymentStatusMessage field's value. +func (s *UpdateStageOutput) SetLastDeploymentStatusMessage(v string) *UpdateStageOutput { + s.LastDeploymentStatusMessage = &v + return s +} + // SetLastUpdatedDate sets the LastUpdatedDate field's value. func (s *UpdateStageOutput) SetLastUpdatedDate(v time.Time) *UpdateStageOutput { s.LastUpdatedDate = &v @@ -14556,8 +16385,10 @@ func (s *UpdateStageOutput) SetTags(v map[string]*string) *UpdateStageOutput { return s } -// The authorization type. Valid values are NONE for open access, AWS_IAM for -// using AWS IAM permissions, and CUSTOM for using a Lambda authorizer. +// The authorization type. For WebSocket APIs, valid values are NONE for open +// access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda +// authorizer. For HTTP APIs, valid values are NONE for open access, or JWT +// for using JSON Web Tokens. const ( // AuthorizationTypeNone is a AuthorizationType enum value AuthorizationTypeNone = "NONE" @@ -14567,13 +16398,20 @@ const ( // AuthorizationTypeCustom is a AuthorizationType enum value AuthorizationTypeCustom = "CUSTOM" + + // AuthorizationTypeJwt is a AuthorizationType enum value + AuthorizationTypeJwt = "JWT" ) -// The authorizer type. Currently the only valid value is REQUEST, for a Lambda -// function using incoming request parameters. +// The authorizer type. For WebSocket APIs, specify REQUEST for a Lambda function +// using incoming request parameters. For HTTP APIs, specify JWT to use JSON +// Web Tokens. const ( // AuthorizerTypeRequest is a AuthorizerType enum value AuthorizerTypeRequest = "REQUEST" + + // AuthorizerTypeJwt is a AuthorizerType enum value + AuthorizerTypeJwt = "JWT" ) // Represents a connection type. @@ -14585,7 +16423,8 @@ const ( ConnectionTypeVpcLink = "VPC_LINK" ) -// Specifies how to handle response payload content type conversions. +// Specifies how to handle response payload content type conversions. Supported +// only for WebSocket APIs. const ( // ContentHandlingStrategyConvertToBinary is a ContentHandlingStrategy enum value ContentHandlingStrategyConvertToBinary = "CONVERT_TO_BINARY" @@ -14606,6 +16445,10 @@ const ( DeploymentStatusDeployed = "DEPLOYED" ) +// The status of the domain name migration. The valid values are AVAILABLE and +// UPDATING. If the status is UPDATING, the domain cannot be modified further +// until the existing operation is complete. If it is AVAILABLE, the domain +// can be updated. const ( // DomainNameStatusAvailable is a DomainNameStatus enum value DomainNameStatusAvailable = "AVAILABLE" @@ -14653,7 +16496,8 @@ const ( LoggingLevelFalse = "false" ) -// Represents passthrough behavior for an integration response. +// Represents passthrough behavior for an integration response. Supported only +// for WebSocket APIs. const ( // PassthroughBehaviorWhenNoMatch is a PassthroughBehavior enum value PassthroughBehaviorWhenNoMatch = "WHEN_NO_MATCH" @@ -14665,11 +16509,17 @@ const ( PassthroughBehaviorWhenNoTemplates = "WHEN_NO_TEMPLATES" ) +// Represents a protocol type. const ( // ProtocolTypeWebsocket is a ProtocolType enum value ProtocolTypeWebsocket = "WEBSOCKET" + + // ProtocolTypeHttp is a ProtocolType enum value + ProtocolTypeHttp = "HTTP" ) +// The Transport Layer Security (TLS) version of the security policy for this +// domain name. The valid values are TLS_1_0 and TLS_1_2. const ( // SecurityPolicyTls10 is a SecurityPolicy enum value SecurityPolicyTls10 = "TLS_1_0" diff --git a/vendor/github.com/aws/aws-sdk-go/service/apigatewayv2/errors.go b/vendor/github.com/aws/aws-sdk-go/service/apigatewayv2/errors.go index 141b1bab7df..196b5441c53 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/apigatewayv2/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/apigatewayv2/errors.go @@ -2,8 +2,16 @@ package apigatewayv2 +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( + // ErrCodeAccessDeniedException for service response error code + // "AccessDeniedException". + ErrCodeAccessDeniedException = "AccessDeniedException" + // ErrCodeBadRequestException for service response error code // "BadRequestException". // @@ -32,3 +40,11 @@ const ( // A limit has been exceeded. See the accompanying error message for details. ErrCodeTooManyRequestsException = "TooManyRequestsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "BadRequestException": newErrorBadRequestException, + "ConflictException": newErrorConflictException, + "NotFoundException": newErrorNotFoundException, + "TooManyRequestsException": newErrorTooManyRequestsException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/apigatewayv2/service.go b/vendor/github.com/aws/aws-sdk-go/service/apigatewayv2/service.go index 02f80c40830..d248211d266 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/apigatewayv2/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/apigatewayv2/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "ApiGatewayV2" // Name of service. EndpointsID = "apigateway" // ID to lookup a service endpoint with. - ServiceID = "ApiGatewayV2" // ServiceID is a unique identifer of a specific service. + ServiceID = "ApiGatewayV2" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ApiGatewayV2 client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ApiGatewayV2 client from just a session. // svc := apigatewayv2.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *ApiGatewayV2 { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "apigateway" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ApiGatewayV2 { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ApiGatewayV2 { svc := &ApiGatewayV2{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-11-29", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 83cc7565b92..78ddc344345 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/api.go @@ -78,23 +78,23 @@ func (c *ApplicationAutoScaling) DeleteScalingPolicyRequest(input *DeleteScaling // See the AWS API reference guide for Application Auto Scaling's // API operation DeleteScalingPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the available parameters // for the API request. // -// * ErrCodeObjectNotFoundException "ObjectNotFoundException" +// * ObjectNotFoundException // The specified object could not be found. For any operation that 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 operation that deletes or deregisters a resource, // this exception is thrown if the resource cannot be found. // -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" +// * 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" +// * InternalServiceException // The service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeleteScalingPolicy @@ -177,23 +177,23 @@ func (c *ApplicationAutoScaling) DeleteScheduledActionRequest(input *DeleteSched // See the AWS API reference guide for Application Auto Scaling's // API operation DeleteScheduledAction for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the available parameters // for the API request. // -// * ErrCodeObjectNotFoundException "ObjectNotFoundException" +// * ObjectNotFoundException // The specified object could not be found. For any operation that 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 operation that deletes or deregisters a resource, // this exception is thrown if the resource cannot be found. // -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" +// * 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" +// * InternalServiceException // The service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeleteScheduledAction @@ -277,23 +277,23 @@ func (c *ApplicationAutoScaling) DeregisterScalableTargetRequest(input *Deregist // See the AWS API reference guide for Application Auto Scaling's // API operation DeregisterScalableTarget for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the available parameters // for the API request. // -// * ErrCodeObjectNotFoundException "ObjectNotFoundException" +// * ObjectNotFoundException // The specified object could not be found. For any operation that 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 operation that deletes or deregisters a resource, // this exception is thrown if the resource cannot be found. // -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" +// * 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" +// * InternalServiceException // The service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DeregisterScalableTarget @@ -383,19 +383,19 @@ func (c *ApplicationAutoScaling) DescribeScalableTargetsRequest(input *DescribeS // See the AWS API reference guide for Application Auto Scaling's // API operation DescribeScalableTargets for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the available parameters // for the API request. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token supplied was invalid. // -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" +// * 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" +// * InternalServiceException // The service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalableTargets @@ -463,10 +463,12 @@ func (c *ApplicationAutoScaling) DescribeScalableTargetsPagesWithContext(ctx aws }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScalableTargetsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeScalableTargetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -537,19 +539,19 @@ func (c *ApplicationAutoScaling) DescribeScalingActivitiesRequest(input *Describ // See the AWS API reference guide for Application Auto Scaling's // API operation DescribeScalingActivities for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the available parameters // for the API request. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token supplied was invalid. // -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" +// * 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" +// * InternalServiceException // The service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalingActivities @@ -617,10 +619,12 @@ func (c *ApplicationAutoScaling) DescribeScalingActivitiesPagesWithContext(ctx a }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScalingActivitiesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeScalingActivitiesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -689,12 +693,12 @@ func (c *ApplicationAutoScaling) DescribeScalingPoliciesRequest(input *DescribeS // See the AWS API reference guide for Application Auto Scaling's // API operation DescribeScalingPolicies for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the available parameters // for the API request. // -// * ErrCodeFailedResourceAccessException "FailedResourceAccessException" +// * FailedResourceAccessException // Failed access to resources caused an exception. This exception 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 @@ -702,14 +706,14 @@ func (c *ApplicationAutoScaling) DescribeScalingPoliciesRequest(input *DescribeS // DescribeAlarms (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html) // on your behalf. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token supplied was invalid. // -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" +// * 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" +// * InternalServiceException // The service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScalingPolicies @@ -777,10 +781,12 @@ func (c *ApplicationAutoScaling) DescribeScalingPoliciesPagesWithContext(ctx aws }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScalingPoliciesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeScalingPoliciesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -850,19 +856,19 @@ func (c *ApplicationAutoScaling) DescribeScheduledActionsRequest(input *Describe // See the AWS API reference guide for Application Auto Scaling's // API operation DescribeScheduledActions for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the available parameters // for the API request. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token supplied was invalid. // -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" +// * 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" +// * InternalServiceException // The service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/DescribeScheduledActions @@ -930,10 +936,12 @@ func (c *ApplicationAutoScaling) DescribeScheduledActionsPagesWithContext(ctx aw }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScheduledActionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeScheduledActionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1000,7 +1008,7 @@ func (c *ApplicationAutoScaling) PutScalingPolicyRequest(input *PutScalingPolicy // more step scaling policies, or both. However, there is a chance that multiple // policies could conflict, instructing the scalable target to scale out or // in at the same time. Application Auto Scaling gives precedence to the policy -// that provides the largest capacity for both scale in and scale out. For example, +// that provides the largest capacity for both scale out and scale in. For example, // if one policy increases capacity by 3, another policy increases capacity // by 200 percent, and the current capacity is 10, Application Auto Scaling // uses the policy with the highest calculated capacity (200% of 10 = 20) and @@ -1016,27 +1024,27 @@ func (c *ApplicationAutoScaling) PutScalingPolicyRequest(input *PutScalingPolicy // See the AWS API reference guide for Application Auto Scaling's // API operation PutScalingPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the available parameters // for the API request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A per-account resource limit is exceeded. For more information, see Application // Auto Scaling Limits (https://docs.aws.amazon.com/ApplicationAutoScaling/latest/userguide/application-auto-scaling-limits.html). // -// * ErrCodeObjectNotFoundException "ObjectNotFoundException" +// * ObjectNotFoundException // The specified object could not be found. For any operation that 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 operation that deletes or deregisters a resource, // this exception is thrown if the resource cannot be found. // -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" +// * 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. // -// * ErrCodeFailedResourceAccessException "FailedResourceAccessException" +// * FailedResourceAccessException // Failed access to resources caused an exception. This exception 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 @@ -1044,7 +1052,7 @@ func (c *ApplicationAutoScaling) PutScalingPolicyRequest(input *PutScalingPolicy // DescribeAlarms (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html) // on your behalf. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/PutScalingPolicy @@ -1140,27 +1148,27 @@ func (c *ApplicationAutoScaling) PutScheduledActionRequest(input *PutScheduledAc // See the AWS API reference guide for Application Auto Scaling's // API operation PutScheduledAction for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the available parameters // for the API request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A per-account resource limit is exceeded. For more information, see Application // Auto Scaling Limits (https://docs.aws.amazon.com/ApplicationAutoScaling/latest/userguide/application-auto-scaling-limits.html). // -// * ErrCodeObjectNotFoundException "ObjectNotFoundException" +// * ObjectNotFoundException // The specified object could not be found. For any operation that 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 operation that deletes or deregisters a resource, // this exception is thrown if the resource cannot be found. // -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" +// * 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" +// * InternalServiceException // The service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/PutScheduledAction @@ -1258,20 +1266,20 @@ func (c *ApplicationAutoScaling) RegisterScalableTargetRequest(input *RegisterSc // See the AWS API reference guide for Application Auto Scaling's // API operation RegisterScalableTarget for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the available parameters // for the API request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A per-account resource limit is exceeded. For more information, see Application // Auto Scaling Limits (https://docs.aws.amazon.com/ApplicationAutoScaling/latest/userguide/application-auto-scaling-limits.html). // -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" +// * 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" +// * InternalServiceException // The service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-autoscaling-2016-02-06/RegisterScalableTarget @@ -1333,6 +1341,63 @@ func (s *Alarm) SetAlarmName(v string) *Alarm { return s } +// Concurrent updates caused an exception, for example, if you request an update +// to an Application Auto Scaling resource that already has a pending update. +type ConcurrentUpdateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentUpdateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentUpdateException) GoString() string { + return s.String() +} + +func newErrorConcurrentUpdateException(v protocol.ResponseMetadata) error { + return &ConcurrentUpdateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentUpdateException) Code() string { + return "ConcurrentUpdateException" +} + +// Message returns the exception's message. +func (s ConcurrentUpdateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentUpdateException) OrigErr() error { + return nil +} + +func (s ConcurrentUpdateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentUpdateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentUpdateException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents a CloudWatch metric of your choosing for a target tracking scaling // policy to use with Application Auto Scaling. // @@ -1471,15 +1536,15 @@ type DeleteScalingPolicyInput struct { // is the fleet name. Example: fleet/sample-fleet. // // * DynamoDB table - The resource type is table and the unique identifier - // is the resource ID. Example: table/my-table. + // is the table name. Example: table/my-table. // // * DynamoDB global secondary index - The resource type is index and the - // unique identifier is the resource ID. Example: table/my-table/index/my-table-index. + // unique identifier is the index name. Example: table/my-table/index/my-table-index. // // * Aurora DB cluster - The resource type is cluster and the unique identifier // is the cluster name. Example: cluster:my-db-cluster. // - // * Amazon SageMaker endpoint variants - The resource type is variant and + // * Amazon SageMaker endpoint variant - The resource type is variant and // the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering. // // * Custom resources are not supported with a resource type. This parameter @@ -1487,6 +1552,14 @@ type DeleteScalingPolicyInput struct { // to access the resources. The unique identifier is defined by the service // provider. More information is available in our GitHub repository (https://github.com/aws/aws-auto-scaling-custom-resource). // + // * Amazon Comprehend document classification endpoint - The resource type + // and unique identifier are specified using the endpoint ARN. Example: arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE. + // + // * Lambda provisioned concurrency - The resource type is function and the + // unique identifier is the function name with a function version or alias + // name suffix that is not $LATEST. Example: function:my-function:prod or + // function:my-function:1. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -1526,6 +1599,13 @@ type DeleteScalingPolicyInput struct { // * custom-resource:ResourceType:Property - The scalable dimension for a // custom resource provided by your own application or service. // + // * comprehend:document-classifier-endpoint:DesiredInferenceUnits - The + // number of inference units for an Amazon Comprehend document classification + // endpoint. + // + // * lambda:function:ProvisionedConcurrency - The provisioned concurrency + // for a Lambda function. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -1633,15 +1713,15 @@ type DeleteScheduledActionInput struct { // is the fleet name. Example: fleet/sample-fleet. // // * DynamoDB table - The resource type is table and the unique identifier - // is the resource ID. Example: table/my-table. + // is the table name. Example: table/my-table. // // * DynamoDB global secondary index - The resource type is index and the - // unique identifier is the resource ID. Example: table/my-table/index/my-table-index. + // unique identifier is the index name. Example: table/my-table/index/my-table-index. // // * Aurora DB cluster - The resource type is cluster and the unique identifier // is the cluster name. Example: cluster:my-db-cluster. // - // * Amazon SageMaker endpoint variants - The resource type is variant and + // * Amazon SageMaker endpoint variant - The resource type is variant and // the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering. // // * Custom resources are not supported with a resource type. This parameter @@ -1649,6 +1729,14 @@ type DeleteScheduledActionInput struct { // to access the resources. The unique identifier is defined by the service // provider. More information is available in our GitHub repository (https://github.com/aws/aws-auto-scaling-custom-resource). // + // * Amazon Comprehend document classification endpoint - The resource type + // and unique identifier are specified using the endpoint ARN. Example: arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE. + // + // * Lambda provisioned concurrency - The resource type is function and the + // unique identifier is the function name with a function version or alias + // name suffix that is not $LATEST. Example: function:my-function:prod or + // function:my-function:1. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -1688,6 +1776,13 @@ type DeleteScheduledActionInput struct { // * custom-resource:ResourceType:Property - The scalable dimension for a // custom resource provided by your own application or service. // + // * comprehend:document-classifier-endpoint:DesiredInferenceUnits - The + // number of inference units for an Amazon Comprehend document classification + // endpoint. + // + // * lambda:function:ProvisionedConcurrency - The provisioned concurrency + // for a Lambda function. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -1800,15 +1895,15 @@ type DeregisterScalableTargetInput struct { // is the fleet name. Example: fleet/sample-fleet. // // * DynamoDB table - The resource type is table and the unique identifier - // is the resource ID. Example: table/my-table. + // is the table name. Example: table/my-table. // // * DynamoDB global secondary index - The resource type is index and the - // unique identifier is the resource ID. Example: table/my-table/index/my-table-index. + // unique identifier is the index name. Example: table/my-table/index/my-table-index. // // * Aurora DB cluster - The resource type is cluster and the unique identifier // is the cluster name. Example: cluster:my-db-cluster. // - // * Amazon SageMaker endpoint variants - The resource type is variant and + // * Amazon SageMaker endpoint variant - The resource type is variant and // the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering. // // * Custom resources are not supported with a resource type. This parameter @@ -1816,6 +1911,14 @@ type DeregisterScalableTargetInput struct { // to access the resources. The unique identifier is defined by the service // provider. More information is available in our GitHub repository (https://github.com/aws/aws-auto-scaling-custom-resource). // + // * Amazon Comprehend document classification endpoint - The resource type + // and unique identifier are specified using the endpoint ARN. Example: arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE. + // + // * Lambda provisioned concurrency - The resource type is function and the + // unique identifier is the function name with a function version or alias + // name suffix that is not $LATEST. Example: function:my-function:prod or + // function:my-function:1. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -1855,6 +1958,13 @@ type DeregisterScalableTargetInput struct { // * custom-resource:ResourceType:Property - The scalable dimension for a // custom resource provided by your own application or service. // + // * comprehend:document-classifier-endpoint:DesiredInferenceUnits - The + // number of inference units for an Amazon Comprehend document classification + // endpoint. + // + // * lambda:function:ProvisionedConcurrency - The provisioned concurrency + // for a Lambda function. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -1963,21 +2073,29 @@ type DescribeScalableTargetsInput struct { // is the fleet name. Example: fleet/sample-fleet. // // * DynamoDB table - The resource type is table and the unique identifier - // is the resource ID. Example: table/my-table. + // is the table name. Example: table/my-table. // // * DynamoDB global secondary index - The resource type is index and the - // unique identifier is the resource ID. Example: table/my-table/index/my-table-index. + // unique identifier is the index name. Example: table/my-table/index/my-table-index. // // * Aurora DB cluster - The resource type is cluster and the unique identifier // is the cluster name. Example: cluster:my-db-cluster. // - // * Amazon SageMaker endpoint variants - The resource type is variant and + // * Amazon SageMaker endpoint variant - The resource type is variant and // the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering. // // * Custom resources are not supported with a resource type. This parameter // must specify the OutputValue from the CloudFormation template stack used // to access the resources. The unique identifier is defined by the service // provider. More information is available in our GitHub repository (https://github.com/aws/aws-auto-scaling-custom-resource). + // + // * Amazon Comprehend document classification endpoint - The resource type + // and unique identifier are specified using the endpoint ARN. Example: arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE. + // + // * Lambda provisioned concurrency - The resource type is function and the + // unique identifier is the function name with a function version or alias + // name suffix that is not $LATEST. Example: function:my-function:prod or + // function:my-function:1. ResourceIds []*string `type:"list"` // The scalable dimension associated with the scalable target. This string consists @@ -2016,6 +2134,13 @@ type DescribeScalableTargetsInput struct { // // * custom-resource:ResourceType:Property - The scalable dimension for a // custom resource provided by your own application or service. + // + // * comprehend:document-classifier-endpoint:DesiredInferenceUnits - The + // number of inference units for an Amazon Comprehend document classification + // endpoint. + // + // * lambda:function:ProvisionedConcurrency - The provisioned concurrency + // for a Lambda function. ScalableDimension *string `type:"string" enum:"ScalableDimension"` // The namespace of the AWS service that provides the resource or custom-resource @@ -2145,21 +2270,29 @@ type DescribeScalingActivitiesInput struct { // is the fleet name. Example: fleet/sample-fleet. // // * DynamoDB table - The resource type is table and the unique identifier - // is the resource ID. Example: table/my-table. + // is the table name. Example: table/my-table. // // * DynamoDB global secondary index - The resource type is index and the - // unique identifier is the resource ID. Example: table/my-table/index/my-table-index. + // unique identifier is the index name. Example: table/my-table/index/my-table-index. // // * Aurora DB cluster - The resource type is cluster and the unique identifier // is the cluster name. Example: cluster:my-db-cluster. // - // * Amazon SageMaker endpoint variants - The resource type is variant and + // * Amazon SageMaker endpoint variant - The resource type is variant and // the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering. // // * Custom resources are not supported with a resource type. This parameter // must specify the OutputValue from the CloudFormation template stack used // to access the resources. The unique identifier is defined by the service // provider. More information is available in our GitHub repository (https://github.com/aws/aws-auto-scaling-custom-resource). + // + // * Amazon Comprehend document classification endpoint - The resource type + // and unique identifier are specified using the endpoint ARN. Example: arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE. + // + // * Lambda provisioned concurrency - The resource type is function and the + // unique identifier is the function name with a function version or alias + // name suffix that is not $LATEST. Example: function:my-function:prod or + // function:my-function:1. ResourceId *string `min:"1" type:"string"` // The scalable dimension. This string consists of the service namespace, resource @@ -2198,6 +2331,13 @@ type DescribeScalingActivitiesInput struct { // // * custom-resource:ResourceType:Property - The scalable dimension for a // custom resource provided by your own application or service. + // + // * comprehend:document-classifier-endpoint:DesiredInferenceUnits - The + // number of inference units for an Amazon Comprehend document classification + // endpoint. + // + // * lambda:function:ProvisionedConcurrency - The provisioned concurrency + // for a Lambda function. ScalableDimension *string `type:"string" enum:"ScalableDimension"` // The namespace of the AWS service that provides the resource or custom-resource @@ -2333,21 +2473,29 @@ type DescribeScalingPoliciesInput struct { // is the fleet name. Example: fleet/sample-fleet. // // * DynamoDB table - The resource type is table and the unique identifier - // is the resource ID. Example: table/my-table. + // is the table name. Example: table/my-table. // // * DynamoDB global secondary index - The resource type is index and the - // unique identifier is the resource ID. Example: table/my-table/index/my-table-index. + // unique identifier is the index name. Example: table/my-table/index/my-table-index. // // * Aurora DB cluster - The resource type is cluster and the unique identifier // is the cluster name. Example: cluster:my-db-cluster. // - // * Amazon SageMaker endpoint variants - The resource type is variant and + // * Amazon SageMaker endpoint variant - The resource type is variant and // the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering. // // * Custom resources are not supported with a resource type. This parameter // must specify the OutputValue from the CloudFormation template stack used // to access the resources. The unique identifier is defined by the service // provider. More information is available in our GitHub repository (https://github.com/aws/aws-auto-scaling-custom-resource). + // + // * Amazon Comprehend document classification endpoint - The resource type + // and unique identifier are specified using the endpoint ARN. Example: arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE. + // + // * Lambda provisioned concurrency - The resource type is function and the + // unique identifier is the function name with a function version or alias + // name suffix that is not $LATEST. Example: function:my-function:prod or + // function:my-function:1. ResourceId *string `min:"1" type:"string"` // The scalable dimension. This string consists of the service namespace, resource @@ -2386,6 +2534,13 @@ type DescribeScalingPoliciesInput struct { // // * custom-resource:ResourceType:Property - The scalable dimension for a // custom resource provided by your own application or service. + // + // * comprehend:document-classifier-endpoint:DesiredInferenceUnits - The + // number of inference units for an Amazon Comprehend document classification + // endpoint. + // + // * lambda:function:ProvisionedConcurrency - The provisioned concurrency + // for a Lambda function. ScalableDimension *string `type:"string" enum:"ScalableDimension"` // The namespace of the AWS service that provides the resource or custom-resource @@ -2524,21 +2679,29 @@ type DescribeScheduledActionsInput struct { // is the fleet name. Example: fleet/sample-fleet. // // * DynamoDB table - The resource type is table and the unique identifier - // is the resource ID. Example: table/my-table. + // is the table name. Example: table/my-table. // // * DynamoDB global secondary index - The resource type is index and the - // unique identifier is the resource ID. Example: table/my-table/index/my-table-index. + // unique identifier is the index name. Example: table/my-table/index/my-table-index. // // * Aurora DB cluster - The resource type is cluster and the unique identifier // is the cluster name. Example: cluster:my-db-cluster. // - // * Amazon SageMaker endpoint variants - The resource type is variant and + // * Amazon SageMaker endpoint variant - The resource type is variant and // the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering. // // * Custom resources are not supported with a resource type. This parameter // must specify the OutputValue from the CloudFormation template stack used // to access the resources. The unique identifier is defined by the service // provider. More information is available in our GitHub repository (https://github.com/aws/aws-auto-scaling-custom-resource). + // + // * Amazon Comprehend document classification endpoint - The resource type + // and unique identifier are specified using the endpoint ARN. Example: arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE. + // + // * Lambda provisioned concurrency - The resource type is function and the + // unique identifier is the function name with a function version or alias + // name suffix that is not $LATEST. Example: function:my-function:prod or + // function:my-function:1. ResourceId *string `min:"1" type:"string"` // The scalable dimension. This string consists of the service namespace, resource @@ -2577,6 +2740,13 @@ type DescribeScheduledActionsInput struct { // // * custom-resource:ResourceType:Property - The scalable dimension for a // custom resource provided by your own application or service. + // + // * comprehend:document-classifier-endpoint:DesiredInferenceUnits - The + // number of inference units for an Amazon Comprehend document classification + // endpoint. + // + // * lambda:function:ProvisionedConcurrency - The provisioned concurrency + // for a Lambda function. ScalableDimension *string `type:"string" enum:"ScalableDimension"` // The names of the scheduled actions to describe. @@ -2686,6 +2856,236 @@ func (s *DescribeScheduledActionsOutput) SetScheduledActions(v []*ScheduledActio return s } +// Failed access to resources caused an exception. This exception 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 permission to call the CloudWatch +// DescribeAlarms (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarms.html) +// on your behalf. +type FailedResourceAccessException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s FailedResourceAccessException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FailedResourceAccessException) GoString() string { + return s.String() +} + +func newErrorFailedResourceAccessException(v protocol.ResponseMetadata) error { + return &FailedResourceAccessException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FailedResourceAccessException) Code() string { + return "FailedResourceAccessException" +} + +// Message returns the exception's message. +func (s FailedResourceAccessException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FailedResourceAccessException) OrigErr() error { + return nil +} + +func (s FailedResourceAccessException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FailedResourceAccessException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FailedResourceAccessException) RequestID() string { + return s.respMetadata.RequestID +} + +// The service encountered an internal error. +type InternalServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServiceException) GoString() string { + return s.String() +} + +func newErrorInternalServiceException(v protocol.ResponseMetadata) error { + return &InternalServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServiceException) Code() string { + return "InternalServiceException" +} + +// Message returns the exception's message. +func (s InternalServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServiceException) OrigErr() error { + return nil +} + +func (s InternalServiceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServiceException) RequestID() string { + return s.respMetadata.RequestID +} + +// The next token supplied was invalid. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNextTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// A per-account resource limit is exceeded. For more information, see Application +// Auto Scaling Limits (https://docs.aws.amazon.com/ApplicationAutoScaling/latest/userguide/application-auto-scaling-limits.html). +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes the dimension names and values associated with a metric. type MetricDimension struct { _ struct{} `type:"structure"` @@ -2739,6 +3139,66 @@ func (s *MetricDimension) SetValue(v string) *MetricDimension { return s } +// The specified object could not be found. For any operation that 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 operation that deletes or deregisters a resource, +// this exception is thrown if the resource cannot be found. +type ObjectNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ObjectNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ObjectNotFoundException) GoString() string { + return s.String() +} + +func newErrorObjectNotFoundException(v protocol.ResponseMetadata) error { + return &ObjectNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ObjectNotFoundException) Code() string { + return "ObjectNotFoundException" +} + +// Message returns the exception's message. +func (s ObjectNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ObjectNotFoundException) OrigErr() error { + return nil +} + +func (s ObjectNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ObjectNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ObjectNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents a predefined metric for a target tracking scaling policy to use // with Application Auto Scaling. type PredefinedMetricSpecification struct { @@ -2816,13 +3276,12 @@ type PutScalingPolicyInput struct { // // The following policy types are supported: // - // TargetTrackingScaling—Not supported for Amazon EMR or AppStream + // TargetTrackingScaling—Not supported for Amazon EMR // - // StepScaling—Not supported for Amazon DynamoDB + // StepScaling—Not supported for DynamoDB, Amazon Comprehend, or AWS Lambda // - // For more information, see Step Scaling Policies for Application Auto Scaling - // (https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-step-scaling-policies.html) - // and Target Tracking Scaling Policies for Application Auto Scaling (https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html) + // For more information, see Target Tracking Scaling Policies (https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html) + // and Step Scaling Policies (https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-step-scaling-policies.html) // in the Application Auto Scaling User Guide. PolicyType *string `type:"string" enum:"PolicyType"` @@ -2842,15 +3301,15 @@ type PutScalingPolicyInput struct { // is the fleet name. Example: fleet/sample-fleet. // // * DynamoDB table - The resource type is table and the unique identifier - // is the resource ID. Example: table/my-table. + // is the table name. Example: table/my-table. // // * DynamoDB global secondary index - The resource type is index and the - // unique identifier is the resource ID. Example: table/my-table/index/my-table-index. + // unique identifier is the index name. Example: table/my-table/index/my-table-index. // // * Aurora DB cluster - The resource type is cluster and the unique identifier // is the cluster name. Example: cluster:my-db-cluster. // - // * Amazon SageMaker endpoint variants - The resource type is variant and + // * Amazon SageMaker endpoint variant - The resource type is variant and // the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering. // // * Custom resources are not supported with a resource type. This parameter @@ -2858,6 +3317,14 @@ type PutScalingPolicyInput struct { // to access the resources. The unique identifier is defined by the service // provider. More information is available in our GitHub repository (https://github.com/aws/aws-auto-scaling-custom-resource). // + // * Amazon Comprehend document classification endpoint - The resource type + // and unique identifier are specified using the endpoint ARN. Example: arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE. + // + // * Lambda provisioned concurrency - The resource type is function and the + // unique identifier is the function name with a function version or alias + // name suffix that is not $LATEST. Example: function:my-function:prod or + // function:my-function:1. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -2897,6 +3364,13 @@ type PutScalingPolicyInput struct { // * custom-resource:ResourceType:Property - The scalable dimension for a // custom resource provided by your own application or service. // + // * comprehend:document-classifier-endpoint:DesiredInferenceUnits - The + // number of inference units for an Amazon Comprehend document classification + // endpoint. + // + // * lambda:function:ProvisionedConcurrency - The provisioned concurrency + // for a Lambda function. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -3068,15 +3542,15 @@ type PutScheduledActionInput struct { // is the fleet name. Example: fleet/sample-fleet. // // * DynamoDB table - The resource type is table and the unique identifier - // is the resource ID. Example: table/my-table. + // is the table name. Example: table/my-table. // // * DynamoDB global secondary index - The resource type is index and the - // unique identifier is the resource ID. Example: table/my-table/index/my-table-index. + // unique identifier is the index name. Example: table/my-table/index/my-table-index. // // * Aurora DB cluster - The resource type is cluster and the unique identifier // is the cluster name. Example: cluster:my-db-cluster. // - // * Amazon SageMaker endpoint variants - The resource type is variant and + // * Amazon SageMaker endpoint variant - The resource type is variant and // the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering. // // * Custom resources are not supported with a resource type. This parameter @@ -3084,6 +3558,14 @@ type PutScheduledActionInput struct { // to access the resources. The unique identifier is defined by the service // provider. More information is available in our GitHub repository (https://github.com/aws/aws-auto-scaling-custom-resource). // + // * Amazon Comprehend document classification endpoint - The resource type + // and unique identifier are specified using the endpoint ARN. Example: arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE. + // + // * Lambda provisioned concurrency - The resource type is function and the + // unique identifier is the function name with a function version or alias + // name suffix that is not $LATEST. Example: function:my-function:prod or + // function:my-function:1. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -3123,6 +3605,13 @@ type PutScheduledActionInput struct { // * custom-resource:ResourceType:Property - The scalable dimension for a // custom resource provided by your own application or service. // + // * comprehend:document-classifier-endpoint:DesiredInferenceUnits - The + // number of inference units for an Amazon Comprehend document classification + // endpoint. + // + // * lambda:function:ProvisionedConcurrency - The provisioned concurrency + // for a Lambda function. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -3297,15 +3786,15 @@ type RegisterScalableTargetInput struct { // is the fleet name. Example: fleet/sample-fleet. // // * DynamoDB table - The resource type is table and the unique identifier - // is the resource ID. Example: table/my-table. + // is the table name. Example: table/my-table. // // * DynamoDB global secondary index - The resource type is index and the - // unique identifier is the resource ID. Example: table/my-table/index/my-table-index. + // unique identifier is the index name. Example: table/my-table/index/my-table-index. // // * Aurora DB cluster - The resource type is cluster and the unique identifier // is the cluster name. Example: cluster:my-db-cluster. // - // * Amazon SageMaker endpoint variants - The resource type is variant and + // * Amazon SageMaker endpoint variant - The resource type is variant and // the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering. // // * Custom resources are not supported with a resource type. This parameter @@ -3313,6 +3802,14 @@ type RegisterScalableTargetInput struct { // to access the resources. The unique identifier is defined by the service // provider. More information is available in our GitHub repository (https://github.com/aws/aws-auto-scaling-custom-resource). // + // * Amazon Comprehend document classification endpoint - The resource type + // and unique identifier are specified using the endpoint ARN. Example: arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE. + // + // * Lambda provisioned concurrency - The resource type is function and the + // unique identifier is the function name with a function version or alias + // name suffix that is not $LATEST. Example: function:my-function:prod or + // function:my-function:1. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -3320,9 +3817,9 @@ type RegisterScalableTargetInput struct { // to modify the scalable target on your behalf. For more information, see Service-Linked // Roles for Application Auto Scaling (https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-service-linked-roles.html). // - // For resources that are not supported using a service-linked role, this parameter - // is required, and it must specify the ARN of an IAM role that allows Application - // Auto Scaling to modify the scalable target on your behalf. + // For Amazon EMR, this parameter is required, and it must specify the ARN of + // an IAM role that allows Application Auto Scaling to modify the scalable target + // on your behalf. RoleARN *string `min:"1" type:"string"` // The scalable dimension associated with the scalable target. This string consists @@ -3361,6 +3858,13 @@ type RegisterScalableTargetInput struct { // * custom-resource:ResourceType:Property - The scalable dimension for a // custom resource provided by your own application or service. // + // * comprehend:document-classifier-endpoint:DesiredInferenceUnits - The + // number of inference units for an Amazon Comprehend document classification + // endpoint. + // + // * lambda:function:ProvisionedConcurrency - The provisioned concurrency + // for a Lambda function. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -3388,7 +3892,7 @@ type RegisterScalableTargetInput struct { // * For ScheduledScalingSuspended, while a suspension is in effect, all // scaling activities that involve scheduled actions are suspended. // - // For more information, see Suspend and Resume Application Auto Scaling (https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-suspend-resume-scaling.html) + // For more information, see Suspending and Resuming Scaling (https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-suspend-resume-scaling.html) // in the Application Auto Scaling User Guide. SuspendedState *SuspendedState `type:"structure"` } @@ -3519,15 +4023,15 @@ type ScalableTarget struct { // is the fleet name. Example: fleet/sample-fleet. // // * DynamoDB table - The resource type is table and the unique identifier - // is the resource ID. Example: table/my-table. + // is the table name. Example: table/my-table. // // * DynamoDB global secondary index - The resource type is index and the - // unique identifier is the resource ID. Example: table/my-table/index/my-table-index. + // unique identifier is the index name. Example: table/my-table/index/my-table-index. // // * Aurora DB cluster - The resource type is cluster and the unique identifier // is the cluster name. Example: cluster:my-db-cluster. // - // * Amazon SageMaker endpoint variants - The resource type is variant and + // * Amazon SageMaker endpoint variant - The resource type is variant and // the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering. // // * Custom resources are not supported with a resource type. This parameter @@ -3535,6 +4039,14 @@ type ScalableTarget struct { // to access the resources. The unique identifier is defined by the service // provider. More information is available in our GitHub repository (https://github.com/aws/aws-auto-scaling-custom-resource). // + // * Amazon Comprehend document classification endpoint - The resource type + // and unique identifier are specified using the endpoint ARN. Example: arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE. + // + // * Lambda provisioned concurrency - The resource type is function and the + // unique identifier is the function name with a function version or alias + // name suffix that is not $LATEST. Example: function:my-function:prod or + // function:my-function:1. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -3580,6 +4092,13 @@ type ScalableTarget struct { // * custom-resource:ResourceType:Property - The scalable dimension for a // custom resource provided by your own application or service. // + // * comprehend:document-classifier-endpoint:DesiredInferenceUnits - The + // number of inference units for an Amazon Comprehend document classification + // endpoint. + // + // * lambda:function:ProvisionedConcurrency - The provisioned concurrency + // for a Lambda function. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -3728,15 +4247,15 @@ type ScalingActivity struct { // is the fleet name. Example: fleet/sample-fleet. // // * DynamoDB table - The resource type is table and the unique identifier - // is the resource ID. Example: table/my-table. + // is the table name. Example: table/my-table. // // * DynamoDB global secondary index - The resource type is index and the - // unique identifier is the resource ID. Example: table/my-table/index/my-table-index. + // unique identifier is the index name. Example: table/my-table/index/my-table-index. // // * Aurora DB cluster - The resource type is cluster and the unique identifier // is the cluster name. Example: cluster:my-db-cluster. // - // * Amazon SageMaker endpoint variants - The resource type is variant and + // * Amazon SageMaker endpoint variant - The resource type is variant and // the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering. // // * Custom resources are not supported with a resource type. This parameter @@ -3744,6 +4263,14 @@ type ScalingActivity struct { // to access the resources. The unique identifier is defined by the service // provider. More information is available in our GitHub repository (https://github.com/aws/aws-auto-scaling-custom-resource). // + // * Amazon Comprehend document classification endpoint - The resource type + // and unique identifier are specified using the endpoint ARN. Example: arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE. + // + // * Lambda provisioned concurrency - The resource type is function and the + // unique identifier is the function name with a function version or alias + // name suffix that is not $LATEST. Example: function:my-function:prod or + // function:my-function:1. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -3783,6 +4310,13 @@ type ScalingActivity struct { // * custom-resource:ResourceType:Property - The scalable dimension for a // custom resource provided by your own application or service. // + // * comprehend:document-classifier-endpoint:DesiredInferenceUnits - The + // number of inference units for an Amazon Comprehend document classification + // endpoint. + // + // * lambda:function:ProvisionedConcurrency - The provisioned concurrency + // for a Lambda function. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -3927,15 +4461,15 @@ type ScalingPolicy struct { // is the fleet name. Example: fleet/sample-fleet. // // * DynamoDB table - The resource type is table and the unique identifier - // is the resource ID. Example: table/my-table. + // is the table name. Example: table/my-table. // // * DynamoDB global secondary index - The resource type is index and the - // unique identifier is the resource ID. Example: table/my-table/index/my-table-index. + // unique identifier is the index name. Example: table/my-table/index/my-table-index. // // * Aurora DB cluster - The resource type is cluster and the unique identifier // is the cluster name. Example: cluster:my-db-cluster. // - // * Amazon SageMaker endpoint variants - The resource type is variant and + // * Amazon SageMaker endpoint variant - The resource type is variant and // the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering. // // * Custom resources are not supported with a resource type. This parameter @@ -3943,6 +4477,14 @@ type ScalingPolicy struct { // to access the resources. The unique identifier is defined by the service // provider. More information is available in our GitHub repository (https://github.com/aws/aws-auto-scaling-custom-resource). // + // * Amazon Comprehend document classification endpoint - The resource type + // and unique identifier are specified using the endpoint ARN. Example: arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE. + // + // * Lambda provisioned concurrency - The resource type is function and the + // unique identifier is the function name with a function version or alias + // name suffix that is not $LATEST. Example: function:my-function:prod or + // function:my-function:1. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -3982,6 +4524,13 @@ type ScalingPolicy struct { // * custom-resource:ResourceType:Property - The scalable dimension for a // custom resource provided by your own application or service. // + // * comprehend:document-classifier-endpoint:DesiredInferenceUnits - The + // number of inference units for an Amazon Comprehend document classification + // endpoint. + // + // * lambda:function:ProvisionedConcurrency - The provisioned concurrency + // for a Lambda function. + // // ScalableDimension is a required field ScalableDimension *string `type:"string" required:"true" enum:"ScalableDimension"` @@ -4098,15 +4647,15 @@ type ScheduledAction struct { // is the fleet name. Example: fleet/sample-fleet. // // * DynamoDB table - The resource type is table and the unique identifier - // is the resource ID. Example: table/my-table. + // is the table name. Example: table/my-table. // // * DynamoDB global secondary index - The resource type is index and the - // unique identifier is the resource ID. Example: table/my-table/index/my-table-index. + // unique identifier is the index name. Example: table/my-table/index/my-table-index. // // * Aurora DB cluster - The resource type is cluster and the unique identifier // is the cluster name. Example: cluster:my-db-cluster. // - // * Amazon SageMaker endpoint variants - The resource type is variant and + // * Amazon SageMaker endpoint variant - The resource type is variant and // the unique identifier is the resource ID. Example: endpoint/my-end-point/variant/KMeansClustering. // // * Custom resources are not supported with a resource type. This parameter @@ -4114,6 +4663,14 @@ type ScheduledAction struct { // to access the resources. The unique identifier is defined by the service // provider. More information is available in our GitHub repository (https://github.com/aws/aws-auto-scaling-custom-resource). // + // * Amazon Comprehend document classification endpoint - The resource type + // and unique identifier are specified using the endpoint ARN. Example: arn:aws:comprehend:us-west-2:123456789012:document-classifier-endpoint/EXAMPLE. + // + // * Lambda provisioned concurrency - The resource type is function and the + // unique identifier is the function name with a function version or alias + // name suffix that is not $LATEST. Example: function:my-function:prod or + // function:my-function:1. + // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` @@ -4152,6 +4709,13 @@ type ScheduledAction struct { // // * custom-resource:ResourceType:Property - The scalable dimension for a // custom resource provided by your own application or service. + // + // * comprehend:document-classifier-endpoint:DesiredInferenceUnits - The + // number of inference units for an Amazon Comprehend document classification + // endpoint. + // + // * lambda:function:ProvisionedConcurrency - The provisioned concurrency + // for a Lambda function. ScalableDimension *string `type:"string" enum:"ScalableDimension"` // The new minimum and maximum capacity. You can set both values or just one. @@ -4646,6 +5210,63 @@ func (s *TargetTrackingScalingPolicyConfiguration) SetTargetValue(v float64) *Ta return s } +// An exception was thrown for a validation issue. Review the available parameters +// for the API request. +type ValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationException) GoString() string { + return s.String() +} + +func newErrorValidationException(v protocol.ResponseMetadata) error { + return &ValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ValidationException) Code() string { + return "ValidationException" +} + +// Message returns the exception's message. +func (s ValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ValidationException) OrigErr() error { + return nil +} + +func (s ValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ValidationException) RequestID() string { + return s.respMetadata.RequestID +} + const ( // AdjustmentTypeChangeInCapacity is a AdjustmentType enum value AdjustmentTypeChangeInCapacity = "ChangeInCapacity" @@ -4718,6 +5339,15 @@ const ( // MetricTypeEcsserviceAverageMemoryUtilization is a MetricType enum value MetricTypeEcsserviceAverageMemoryUtilization = "ECSServiceAverageMemoryUtilization" + + // MetricTypeAppStreamAverageCapacityUtilization is a MetricType enum value + MetricTypeAppStreamAverageCapacityUtilization = "AppStreamAverageCapacityUtilization" + + // MetricTypeComprehendInferenceUtilization is a MetricType enum value + MetricTypeComprehendInferenceUtilization = "ComprehendInferenceUtilization" + + // MetricTypeLambdaProvisionedConcurrencyUtilization is a MetricType enum value + MetricTypeLambdaProvisionedConcurrencyUtilization = "LambdaProvisionedConcurrencyUtilization" ) const ( @@ -4761,6 +5391,12 @@ const ( // ScalableDimensionCustomResourceResourceTypeProperty is a ScalableDimension enum value ScalableDimensionCustomResourceResourceTypeProperty = "custom-resource:ResourceType:Property" + + // ScalableDimensionComprehendDocumentClassifierEndpointDesiredInferenceUnits is a ScalableDimension enum value + ScalableDimensionComprehendDocumentClassifierEndpointDesiredInferenceUnits = "comprehend:document-classifier-endpoint:DesiredInferenceUnits" + + // ScalableDimensionLambdaFunctionProvisionedConcurrency is a ScalableDimension enum value + ScalableDimensionLambdaFunctionProvisionedConcurrency = "lambda:function:ProvisionedConcurrency" ) const ( @@ -4807,4 +5443,10 @@ const ( // ServiceNamespaceCustomResource is a ServiceNamespace enum value ServiceNamespaceCustomResource = "custom-resource" + + // ServiceNamespaceComprehend is a ServiceNamespace enum value + ServiceNamespaceComprehend = "comprehend" + + // ServiceNamespaceLambda is a ServiceNamespace enum value + ServiceNamespaceLambda = "lambda" ) diff --git a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/doc.go b/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/doc.go index fbaa9db4693..4a1a89ee70a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/doc.go @@ -22,6 +22,10 @@ // // * Custom resources provided by your own applications or services // +// * Amazon Comprehend document classification endpoints +// +// * AWS Lambda function provisioned concurrency +// // API Summary // // The Application Auto Scaling service API includes three key sets of actions: 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 index 7d410101382..acb9104661a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/errors.go @@ -2,6 +2,10 @@ package applicationautoscaling +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeConcurrentUpdateException for service response error code @@ -58,3 +62,13 @@ const ( // for the API request. ErrCodeValidationException = "ValidationException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ConcurrentUpdateException": newErrorConcurrentUpdateException, + "FailedResourceAccessException": newErrorFailedResourceAccessException, + "InternalServiceException": newErrorInternalServiceException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "LimitExceededException": newErrorLimitExceededException, + "ObjectNotFoundException": newErrorObjectNotFoundException, + "ValidationException": newErrorValidationException, +} 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 index 902d81d426e..68e93cefc5b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/applicationautoscaling/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "autoscaling" // Name of service. EndpointsID = "application-autoscaling" // ID to lookup a service endpoint with. - ServiceID = "Application Auto Scaling" // ServiceID is a unique identifer of a specific service. + ServiceID = "Application Auto Scaling" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ApplicationAutoScaling client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ApplicationAutoScaling client from just a session. // svc := applicationautoscaling.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *ApplicationAutoScaling { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "application-autoscaling" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ApplicationAutoScaling { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ApplicationAutoScaling { svc := &ApplicationAutoScaling{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-02-06", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/applicationinsights/api.go b/vendor/github.com/aws/aws-sdk-go/service/applicationinsights/api.go index 249f1cd2f9a..94be2102e16 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/applicationinsights/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/applicationinsights/api.go @@ -3,6 +3,7 @@ package applicationinsights import ( + "fmt" "time" "github.com/aws/aws-sdk-go/aws" @@ -65,19 +66,22 @@ func (c *ApplicationInsights) CreateApplicationRequest(input *CreateApplicationI // See the AWS API reference guide for Amazon CloudWatch Application Insights's // API operation CreateApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The resource is already created or in use. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource does not exist in the customer account. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The parameter is not valid. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // +// * TagsAlreadyExistException +// Tags are already registered for the specified application ARN. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/CreateApplication func (c *ApplicationInsights) CreateApplication(input *CreateApplicationInput) (*CreateApplicationOutput, error) { req, out := c.CreateApplicationRequest(input) @@ -154,17 +158,17 @@ func (c *ApplicationInsights) CreateComponentRequest(input *CreateComponentInput // See the AWS API reference guide for Amazon CloudWatch Application Insights's // API operation CreateComponent for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The resource is already created or in use. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource does not exist in the customer account. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The parameter is not valid. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/CreateComponent @@ -189,6 +193,94 @@ func (c *ApplicationInsights) CreateComponentWithContext(ctx aws.Context, input return out, req.Send() } +const opCreateLogPattern = "CreateLogPattern" + +// CreateLogPatternRequest generates a "aws/request.Request" representing the +// client's request for the CreateLogPattern operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateLogPattern for more information on using the CreateLogPattern +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateLogPatternRequest method. +// req, resp := client.CreateLogPatternRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/CreateLogPattern +func (c *ApplicationInsights) CreateLogPatternRequest(input *CreateLogPatternInput) (req *request.Request, output *CreateLogPatternOutput) { + op := &request.Operation{ + Name: opCreateLogPattern, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateLogPatternInput{} + } + + output = &CreateLogPatternOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateLogPattern API operation for Amazon CloudWatch Application Insights. +// +// Adds an log pattern to a LogPatternSet. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Application Insights's +// API operation CreateLogPattern for usage and error information. +// +// Returned Error Types: +// * ResourceInUseException +// The resource is already created or in use. +// +// * ResourceNotFoundException +// The resource does not exist in the customer account. +// +// * ValidationException +// The parameter is not valid. +// +// * InternalServerException +// The server encountered an internal error and is unable to complete the request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/CreateLogPattern +func (c *ApplicationInsights) CreateLogPattern(input *CreateLogPatternInput) (*CreateLogPatternOutput, error) { + req, out := c.CreateLogPatternRequest(input) + return out, req.Send() +} + +// CreateLogPatternWithContext is the same as CreateLogPattern with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLogPattern for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ApplicationInsights) CreateLogPatternWithContext(ctx aws.Context, input *CreateLogPatternInput, opts ...request.Option) (*CreateLogPatternOutput, error) { + req, out := c.CreateLogPatternRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteApplication = "DeleteApplication" // DeleteApplicationRequest generates a "aws/request.Request" representing the @@ -243,17 +335,17 @@ func (c *ApplicationInsights) DeleteApplicationRequest(input *DeleteApplicationI // See the AWS API reference guide for Amazon CloudWatch Application Insights's // API operation DeleteApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The resource does not exist in the customer account. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The parameter is not valid. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not understood by the server. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/DeleteApplication @@ -334,14 +426,14 @@ func (c *ApplicationInsights) DeleteComponentRequest(input *DeleteComponentInput // See the AWS API reference guide for Amazon CloudWatch Application Insights's // API operation DeleteComponent for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The resource does not exist in the customer account. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The parameter is not valid. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/DeleteComponent @@ -366,6 +458,95 @@ func (c *ApplicationInsights) DeleteComponentWithContext(ctx aws.Context, input return out, req.Send() } +const opDeleteLogPattern = "DeleteLogPattern" + +// DeleteLogPatternRequest generates a "aws/request.Request" representing the +// client's request for the DeleteLogPattern operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteLogPattern for more information on using the DeleteLogPattern +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteLogPatternRequest method. +// req, resp := client.DeleteLogPatternRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/DeleteLogPattern +func (c *ApplicationInsights) DeleteLogPatternRequest(input *DeleteLogPatternInput) (req *request.Request, output *DeleteLogPatternOutput) { + op := &request.Operation{ + Name: opDeleteLogPattern, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteLogPatternInput{} + } + + output = &DeleteLogPatternOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteLogPattern API operation for Amazon CloudWatch Application Insights. +// +// Removes the specified log pattern from a LogPatternSet. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Application Insights's +// API operation DeleteLogPattern for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource does not exist in the customer account. +// +// * ValidationException +// The parameter is not valid. +// +// * BadRequestException +// The request is not understood by the server. +// +// * InternalServerException +// The server encountered an internal error and is unable to complete the request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/DeleteLogPattern +func (c *ApplicationInsights) DeleteLogPattern(input *DeleteLogPatternInput) (*DeleteLogPatternOutput, error) { + req, out := c.DeleteLogPatternRequest(input) + return out, req.Send() +} + +// DeleteLogPatternWithContext is the same as DeleteLogPattern with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLogPattern for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ApplicationInsights) DeleteLogPatternWithContext(ctx aws.Context, input *DeleteLogPatternInput, opts ...request.Option) (*DeleteLogPatternOutput, error) { + req, out := c.DeleteLogPatternRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeApplication = "DescribeApplication" // DescribeApplicationRequest generates a "aws/request.Request" representing the @@ -419,14 +600,14 @@ func (c *ApplicationInsights) DescribeApplicationRequest(input *DescribeApplicat // See the AWS API reference guide for Amazon CloudWatch Application Insights's // API operation DescribeApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The resource does not exist in the customer account. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The parameter is not valid. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/DescribeApplication @@ -505,14 +686,14 @@ func (c *ApplicationInsights) DescribeComponentRequest(input *DescribeComponentI // See the AWS API reference guide for Amazon CloudWatch Application Insights's // API operation DescribeComponent for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The resource does not exist in the customer account. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The parameter is not valid. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/DescribeComponent @@ -590,14 +771,14 @@ func (c *ApplicationInsights) DescribeComponentConfigurationRequest(input *Descr // See the AWS API reference guide for Amazon CloudWatch Application Insights's // API operation DescribeComponentConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The resource does not exist in the customer account. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The parameter is not valid. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/DescribeComponentConfiguration @@ -675,14 +856,14 @@ func (c *ApplicationInsights) DescribeComponentConfigurationRecommendationReques // See the AWS API reference guide for Amazon CloudWatch Application Insights's // API operation DescribeComponentConfigurationRecommendation for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The resource does not exist in the customer account. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The parameter is not valid. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/DescribeComponentConfigurationRecommendation @@ -707,6 +888,91 @@ func (c *ApplicationInsights) DescribeComponentConfigurationRecommendationWithCo return out, req.Send() } +const opDescribeLogPattern = "DescribeLogPattern" + +// DescribeLogPatternRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLogPattern operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeLogPattern for more information on using the DescribeLogPattern +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeLogPatternRequest method. +// req, resp := client.DescribeLogPatternRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/DescribeLogPattern +func (c *ApplicationInsights) DescribeLogPatternRequest(input *DescribeLogPatternInput) (req *request.Request, output *DescribeLogPatternOutput) { + op := &request.Operation{ + Name: opDescribeLogPattern, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeLogPatternInput{} + } + + output = &DescribeLogPatternOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeLogPattern API operation for Amazon CloudWatch Application Insights. +// +// Describe a specific log pattern from a LogPatternSet. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Application Insights's +// API operation DescribeLogPattern for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource does not exist in the customer account. +// +// * ValidationException +// The parameter is not valid. +// +// * InternalServerException +// The server encountered an internal error and is unable to complete the request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/DescribeLogPattern +func (c *ApplicationInsights) DescribeLogPattern(input *DescribeLogPatternInput) (*DescribeLogPatternOutput, error) { + req, out := c.DescribeLogPatternRequest(input) + return out, req.Send() +} + +// DescribeLogPatternWithContext is the same as DescribeLogPattern with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLogPattern for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ApplicationInsights) DescribeLogPatternWithContext(ctx aws.Context, input *DescribeLogPatternInput, opts ...request.Option) (*DescribeLogPatternOutput, error) { + req, out := c.DescribeLogPatternRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeObservation = "DescribeObservation" // DescribeObservationRequest generates a "aws/request.Request" representing the @@ -760,14 +1026,14 @@ func (c *ApplicationInsights) DescribeObservationRequest(input *DescribeObservat // See the AWS API reference guide for Amazon CloudWatch Application Insights's // API operation DescribeObservation for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The parameter is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource does not exist in the customer account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/DescribeObservation @@ -845,14 +1111,14 @@ func (c *ApplicationInsights) DescribeProblemRequest(input *DescribeProblemInput // See the AWS API reference guide for Amazon CloudWatch Application Insights's // API operation DescribeProblem for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The parameter is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource does not exist in the customer account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/DescribeProblem @@ -930,14 +1196,14 @@ func (c *ApplicationInsights) DescribeProblemObservationsRequest(input *Describe // See the AWS API reference guide for Amazon CloudWatch Application Insights's // API operation DescribeProblemObservations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The parameter is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource does not exist in the customer account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/DescribeProblemObservations @@ -1021,11 +1287,11 @@ func (c *ApplicationInsights) ListApplicationsRequest(input *ListApplicationsInp // See the AWS API reference guide for Amazon CloudWatch Application Insights's // API operation ListApplications for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The parameter is not valid. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/ListApplications @@ -1093,10 +1359,12 @@ func (c *ApplicationInsights) ListApplicationsPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListApplicationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListApplicationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1159,14 +1427,14 @@ func (c *ApplicationInsights) ListComponentsRequest(input *ListComponentsInput) // See the AWS API reference guide for Amazon CloudWatch Application Insights's // API operation ListComponents for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The resource does not exist in the customer account. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The parameter is not valid. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/ListComponents @@ -1234,42 +1502,44 @@ func (c *ApplicationInsights) ListComponentsPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListComponentsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListComponentsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opListProblems = "ListProblems" +const opListConfigurationHistory = "ListConfigurationHistory" -// ListProblemsRequest generates a "aws/request.Request" representing the -// client's request for the ListProblems operation. The "output" return +// ListConfigurationHistoryRequest generates a "aws/request.Request" representing the +// client's request for the ListConfigurationHistory operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListProblems for more information on using the ListProblems +// See ListConfigurationHistory for more information on using the ListConfigurationHistory // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListProblemsRequest method. -// req, resp := client.ListProblemsRequest(params) +// // Example sending a request using the ListConfigurationHistoryRequest method. +// req, resp := client.ListConfigurationHistoryRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/ListProblems -func (c *ApplicationInsights) ListProblemsRequest(input *ListProblemsInput) (req *request.Request, output *ListProblemsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/ListConfigurationHistory +func (c *ApplicationInsights) ListConfigurationHistoryRequest(input *ListConfigurationHistoryInput) (req *request.Request, output *ListConfigurationHistoryOutput) { op := &request.Operation{ - Name: opListProblems, + Name: opListConfigurationHistory, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -1281,517 +1551,2431 @@ func (c *ApplicationInsights) ListProblemsRequest(input *ListProblemsInput) (req } if input == nil { - input = &ListProblemsInput{} + input = &ListConfigurationHistoryInput{} } - output = &ListProblemsOutput{} + output = &ListConfigurationHistoryOutput{} req = c.newRequest(op, input, output) return } -// ListProblems API operation for Amazon CloudWatch Application Insights. +// ListConfigurationHistory API operation for Amazon CloudWatch Application Insights. // -// Lists the problems with your application. +// Lists the INFO, WARN, and ERROR events for periodic configuration updates +// performed by Application Insights. Examples of events represented are: +// +// * INFO: creating a new alarm or updating an alarm threshold. +// +// * WARN: alarm not created due to insufficient data points used to predict +// thresholds. +// +// * ERROR: alarm not created due to permission errors or exceeding quotas. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 Application Insights's -// API operation ListProblems for usage and error information. +// API operation ListConfigurationHistory for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The parameter is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource does not exist in the customer account. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/ListProblems -func (c *ApplicationInsights) ListProblems(input *ListProblemsInput) (*ListProblemsOutput, error) { - req, out := c.ListProblemsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/ListConfigurationHistory +func (c *ApplicationInsights) ListConfigurationHistory(input *ListConfigurationHistoryInput) (*ListConfigurationHistoryOutput, error) { + req, out := c.ListConfigurationHistoryRequest(input) return out, req.Send() } -// ListProblemsWithContext is the same as ListProblems with the addition of +// ListConfigurationHistoryWithContext is the same as ListConfigurationHistory with the addition of // the ability to pass a context and additional request options. // -// See ListProblems for details on how to use this API operation. +// See ListConfigurationHistory for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ApplicationInsights) ListProblemsWithContext(ctx aws.Context, input *ListProblemsInput, opts ...request.Option) (*ListProblemsOutput, error) { - req, out := c.ListProblemsRequest(input) +func (c *ApplicationInsights) ListConfigurationHistoryWithContext(ctx aws.Context, input *ListConfigurationHistoryInput, opts ...request.Option) (*ListConfigurationHistoryOutput, error) { + req, out := c.ListConfigurationHistoryRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListProblemsPages iterates over the pages of a ListProblems operation, +// ListConfigurationHistoryPages iterates over the pages of a ListConfigurationHistory operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See ListProblems method for more information on how to use this operation. +// See ListConfigurationHistory 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 ListProblems operation. +// // Example iterating over at most 3 pages of a ListConfigurationHistory operation. // pageNum := 0 -// err := client.ListProblemsPages(params, -// func(page *applicationinsights.ListProblemsOutput, lastPage bool) bool { +// err := client.ListConfigurationHistoryPages(params, +// func(page *applicationinsights.ListConfigurationHistoryOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *ApplicationInsights) ListProblemsPages(input *ListProblemsInput, fn func(*ListProblemsOutput, bool) bool) error { - return c.ListProblemsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *ApplicationInsights) ListConfigurationHistoryPages(input *ListConfigurationHistoryInput, fn func(*ListConfigurationHistoryOutput, bool) bool) error { + return c.ListConfigurationHistoryPagesWithContext(aws.BackgroundContext(), input, fn) } -// ListProblemsPagesWithContext same as ListProblemsPages except +// ListConfigurationHistoryPagesWithContext same as ListConfigurationHistoryPages 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 *ApplicationInsights) ListProblemsPagesWithContext(ctx aws.Context, input *ListProblemsInput, fn func(*ListProblemsOutput, bool) bool, opts ...request.Option) error { +func (c *ApplicationInsights) ListConfigurationHistoryPagesWithContext(ctx aws.Context, input *ListConfigurationHistoryInput, fn func(*ListConfigurationHistoryOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *ListProblemsInput + var inCpy *ListConfigurationHistoryInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.ListProblemsRequest(inCpy) + req, _ := c.ListConfigurationHistoryRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListProblemsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListConfigurationHistoryOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opUpdateApplication = "UpdateApplication" +const opListLogPatternSets = "ListLogPatternSets" -// UpdateApplicationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateApplication operation. The "output" return +// ListLogPatternSetsRequest generates a "aws/request.Request" representing the +// client's request for the ListLogPatternSets operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateApplication for more information on using the UpdateApplication +// See ListLogPatternSets for more information on using the ListLogPatternSets // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateApplicationRequest method. -// req, resp := client.UpdateApplicationRequest(params) +// // Example sending a request using the ListLogPatternSetsRequest method. +// req, resp := client.ListLogPatternSetsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UpdateApplication -func (c *ApplicationInsights) UpdateApplicationRequest(input *UpdateApplicationInput) (req *request.Request, output *UpdateApplicationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/ListLogPatternSets +func (c *ApplicationInsights) ListLogPatternSetsRequest(input *ListLogPatternSetsInput) (req *request.Request, output *ListLogPatternSetsOutput) { op := &request.Operation{ - Name: opUpdateApplication, + Name: opListLogPatternSets, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &UpdateApplicationInput{} + input = &ListLogPatternSetsInput{} } - output = &UpdateApplicationOutput{} + output = &ListLogPatternSetsOutput{} req = c.newRequest(op, input, output) return } -// UpdateApplication API operation for Amazon CloudWatch Application Insights. +// ListLogPatternSets API operation for Amazon CloudWatch Application Insights. // -// Updates the application. +// Lists the log pattern sets in the specific 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 Amazon CloudWatch Application Insights's -// API operation UpdateApplication for usage and error information. +// API operation ListLogPatternSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" -// The server encountered an internal error and is unable to complete the request. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The resource does not exist in the customer account. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The parameter is not valid. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UpdateApplication -func (c *ApplicationInsights) UpdateApplication(input *UpdateApplicationInput) (*UpdateApplicationOutput, error) { - req, out := c.UpdateApplicationRequest(input) +// * InternalServerException +// The server encountered an internal error and is unable to complete the request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/ListLogPatternSets +func (c *ApplicationInsights) ListLogPatternSets(input *ListLogPatternSetsInput) (*ListLogPatternSetsOutput, error) { + req, out := c.ListLogPatternSetsRequest(input) return out, req.Send() } -// UpdateApplicationWithContext is the same as UpdateApplication with the addition of +// ListLogPatternSetsWithContext is the same as ListLogPatternSets with the addition of // the ability to pass a context and additional request options. // -// See UpdateApplication for details on how to use this API operation. +// See ListLogPatternSets for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ApplicationInsights) UpdateApplicationWithContext(ctx aws.Context, input *UpdateApplicationInput, opts ...request.Option) (*UpdateApplicationOutput, error) { - req, out := c.UpdateApplicationRequest(input) +func (c *ApplicationInsights) ListLogPatternSetsWithContext(ctx aws.Context, input *ListLogPatternSetsInput, opts ...request.Option) (*ListLogPatternSetsOutput, error) { + req, out := c.ListLogPatternSetsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateComponent = "UpdateComponent" +// ListLogPatternSetsPages iterates over the pages of a ListLogPatternSets operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListLogPatternSets 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 ListLogPatternSets operation. +// pageNum := 0 +// err := client.ListLogPatternSetsPages(params, +// func(page *applicationinsights.ListLogPatternSetsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *ApplicationInsights) ListLogPatternSetsPages(input *ListLogPatternSetsInput, fn func(*ListLogPatternSetsOutput, bool) bool) error { + return c.ListLogPatternSetsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// UpdateComponentRequest generates a "aws/request.Request" representing the -// client's request for the UpdateComponent operation. The "output" return +// ListLogPatternSetsPagesWithContext same as ListLogPatternSetsPages 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 *ApplicationInsights) ListLogPatternSetsPagesWithContext(ctx aws.Context, input *ListLogPatternSetsInput, fn func(*ListLogPatternSetsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListLogPatternSetsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListLogPatternSetsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListLogPatternSetsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListLogPatterns = "ListLogPatterns" + +// ListLogPatternsRequest generates a "aws/request.Request" representing the +// client's request for the ListLogPatterns operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateComponent for more information on using the UpdateComponent +// See ListLogPatterns for more information on using the ListLogPatterns // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateComponentRequest method. -// req, resp := client.UpdateComponentRequest(params) +// // Example sending a request using the ListLogPatternsRequest method. +// req, resp := client.ListLogPatternsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UpdateComponent -func (c *ApplicationInsights) UpdateComponentRequest(input *UpdateComponentInput) (req *request.Request, output *UpdateComponentOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/ListLogPatterns +func (c *ApplicationInsights) ListLogPatternsRequest(input *ListLogPatternsInput) (req *request.Request, output *ListLogPatternsOutput) { op := &request.Operation{ - Name: opUpdateComponent, + Name: opListLogPatterns, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &UpdateComponentInput{} + input = &ListLogPatternsInput{} } - output = &UpdateComponentOutput{} + output = &ListLogPatternsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateComponent API operation for Amazon CloudWatch Application Insights. +// ListLogPatterns API operation for Amazon CloudWatch Application Insights. // -// Updates the custom component name and/or the list of resources that make -// up the component. +// Lists the log patterns in the specific log LogPatternSet. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 Application Insights's -// API operation UpdateComponent for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// The resource is already created or in use. +// API operation ListLogPatterns for usage and error information. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The resource does not exist in the customer account. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The parameter is not valid. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UpdateComponent -func (c *ApplicationInsights) UpdateComponent(input *UpdateComponentInput) (*UpdateComponentOutput, error) { - req, out := c.UpdateComponentRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/ListLogPatterns +func (c *ApplicationInsights) ListLogPatterns(input *ListLogPatternsInput) (*ListLogPatternsOutput, error) { + req, out := c.ListLogPatternsRequest(input) return out, req.Send() } -// UpdateComponentWithContext is the same as UpdateComponent with the addition of +// ListLogPatternsWithContext is the same as ListLogPatterns with the addition of // the ability to pass a context and additional request options. // -// See UpdateComponent for details on how to use this API operation. +// See ListLogPatterns for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ApplicationInsights) UpdateComponentWithContext(ctx aws.Context, input *UpdateComponentInput, opts ...request.Option) (*UpdateComponentOutput, error) { - req, out := c.UpdateComponentRequest(input) +func (c *ApplicationInsights) ListLogPatternsWithContext(ctx aws.Context, input *ListLogPatternsInput, opts ...request.Option) (*ListLogPatternsOutput, error) { + req, out := c.ListLogPatternsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateComponentConfiguration = "UpdateComponentConfiguration" +// ListLogPatternsPages iterates over the pages of a ListLogPatterns operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListLogPatterns 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 ListLogPatterns operation. +// pageNum := 0 +// err := client.ListLogPatternsPages(params, +// func(page *applicationinsights.ListLogPatternsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *ApplicationInsights) ListLogPatternsPages(input *ListLogPatternsInput, fn func(*ListLogPatternsOutput, bool) bool) error { + return c.ListLogPatternsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// UpdateComponentConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateComponentConfiguration operation. The "output" return +// ListLogPatternsPagesWithContext same as ListLogPatternsPages 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 *ApplicationInsights) ListLogPatternsPagesWithContext(ctx aws.Context, input *ListLogPatternsInput, fn func(*ListLogPatternsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListLogPatternsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListLogPatternsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListLogPatternsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListProblems = "ListProblems" + +// ListProblemsRequest generates a "aws/request.Request" representing the +// client's request for the ListProblems operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateComponentConfiguration for more information on using the UpdateComponentConfiguration +// See ListProblems for more information on using the ListProblems // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateComponentConfigurationRequest method. -// req, resp := client.UpdateComponentConfigurationRequest(params) +// // Example sending a request using the ListProblemsRequest method. +// req, resp := client.ListProblemsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UpdateComponentConfiguration -func (c *ApplicationInsights) UpdateComponentConfigurationRequest(input *UpdateComponentConfigurationInput) (req *request.Request, output *UpdateComponentConfigurationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/ListProblems +func (c *ApplicationInsights) ListProblemsRequest(input *ListProblemsInput) (req *request.Request, output *ListProblemsOutput) { op := &request.Operation{ - Name: opUpdateComponentConfiguration, + Name: opListProblems, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &UpdateComponentConfigurationInput{} + input = &ListProblemsInput{} } - output = &UpdateComponentConfigurationOutput{} + output = &ListProblemsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateComponentConfiguration API operation for Amazon CloudWatch Application Insights. +// ListProblems API operation for Amazon CloudWatch Application Insights. // -// Updates the monitoring configurations for the component. The configuration -// input parameter is an escaped JSON of the configuration and should match -// the schema of what is returned by DescribeComponentConfigurationRecommendation. +// Lists the problems with your 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 Amazon CloudWatch Application Insights's -// API operation UpdateComponentConfiguration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource does not exist in the customer account. +// API operation ListProblems for usage and error information. // -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The parameter is not valid. // -// * ErrCodeInternalServerException "InternalServerException" +// * ResourceNotFoundException +// The resource does not exist in the customer account. +// +// * InternalServerException // The server encountered an internal error and is unable to complete the request. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UpdateComponentConfiguration -func (c *ApplicationInsights) UpdateComponentConfiguration(input *UpdateComponentConfigurationInput) (*UpdateComponentConfigurationOutput, error) { - req, out := c.UpdateComponentConfigurationRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/ListProblems +func (c *ApplicationInsights) ListProblems(input *ListProblemsInput) (*ListProblemsOutput, error) { + req, out := c.ListProblemsRequest(input) return out, req.Send() } -// UpdateComponentConfigurationWithContext is the same as UpdateComponentConfiguration with the addition of +// ListProblemsWithContext is the same as ListProblems with the addition of // the ability to pass a context and additional request options. // -// See UpdateComponentConfiguration for details on how to use this API operation. +// See ListProblems for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ApplicationInsights) UpdateComponentConfigurationWithContext(ctx aws.Context, input *UpdateComponentConfigurationInput, opts ...request.Option) (*UpdateComponentConfigurationOutput, error) { - req, out := c.UpdateComponentConfigurationRequest(input) +func (c *ApplicationInsights) ListProblemsWithContext(ctx aws.Context, input *ListProblemsInput, opts ...request.Option) (*ListProblemsOutput, error) { + req, out := c.ListProblemsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// Describes a standalone resource or similarly grouped resources that the application -// is made up of. -type ApplicationComponent struct { - _ struct{} `type:"structure"` - - // The name of the component. - ComponentName *string `type:"string"` +// ListProblemsPages iterates over the pages of a ListProblems operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListProblems 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 ListProblems operation. +// pageNum := 0 +// err := client.ListProblemsPages(params, +// func(page *applicationinsights.ListProblemsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *ApplicationInsights) ListProblemsPages(input *ListProblemsInput, fn func(*ListProblemsOutput, bool) bool) error { + return c.ListProblemsPagesWithContext(aws.BackgroundContext(), input, fn) +} - // Indicates whether the application component is monitored. - Monitor *bool `type:"boolean"` +// ListProblemsPagesWithContext same as ListProblemsPages 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 *ApplicationInsights) ListProblemsPagesWithContext(ctx aws.Context, input *ListProblemsInput, fn func(*ListProblemsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListProblemsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListProblemsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } - // The resource type. Supported resource types include EC2 instances, Auto Scaling - // group, Classic ELB, Application ELB, and SQS Queue. - ResourceType *string `type:"string"` + for p.Next() { + if !fn(p.Page().(*ListProblemsOutput), !p.HasNextPage()) { + break + } + } - // The stack tier of the application component. - Tier *string `type:"string"` + return p.Err() } -// String returns the string representation -func (s ApplicationComponent) String() string { - return awsutil.Prettify(s) -} +const opListTagsForResource = "ListTagsForResource" -// GoString returns the string representation -func (s ApplicationComponent) GoString() string { - return s.String() -} +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/ListTagsForResource +func (c *ApplicationInsights) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { + op := &request.Operation{ + Name: opListTagsForResource, + HTTPMethod: "POST", + HTTPPath: "/", + } -// SetComponentName sets the ComponentName field's value. -func (s *ApplicationComponent) SetComponentName(v string) *ApplicationComponent { - s.ComponentName = &v - return s + if input == nil { + input = &ListTagsForResourceInput{} + } + + output = &ListTagsForResourceOutput{} + req = c.newRequest(op, input, output) + return } -// SetMonitor sets the Monitor field's value. -func (s *ApplicationComponent) SetMonitor(v bool) *ApplicationComponent { +// ListTagsForResource API operation for Amazon CloudWatch Application Insights. +// +// Retrieve a list of the tags (keys and values) that are associated with a +// specified application. A tag is a label that you optionally define and associate +// with an application. Each tag consists of a required tag key and an optional +// associated tag value. A tag key is a general label that acts as a category +// for more specific tag values. A tag value acts as a descriptor within a tag +// 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 CloudWatch Application Insights's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource does not exist in the customer account. +// +// * ValidationException +// The parameter is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/ListTagsForResource +func (c *ApplicationInsights) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ApplicationInsights) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/TagResource +func (c *ApplicationInsights) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for Amazon CloudWatch Application Insights. +// +// Add one or more tags (keys and values) to a specified application. A tag +// is a label that you optionally define and associate with an application. +// Tags can help you categorize and manage application in different ways, such +// as by purpose, owner, environment, or other criteria. +// +// Each tag consists of a required tag key and an associated tag value, both +// of which you define. A tag key is a general label that acts as a category +// for more specific tag values. A tag value acts as a descriptor within a tag +// 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 CloudWatch Application Insights's +// API operation TagResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource does not exist in the customer account. +// +// * TooManyTagsException +// The number of the provided tags is beyond the limit, or the number of total +// tags you are trying to attach to the specified resource exceeds the limit. +// +// * ValidationException +// The parameter is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/TagResource +func (c *ApplicationInsights) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ApplicationInsights) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UntagResource +func (c *ApplicationInsights) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for Amazon CloudWatch Application Insights. +// +// Remove one or more tags (keys and values) from a 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 Amazon CloudWatch Application Insights's +// API operation UntagResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource does not exist in the customer account. +// +// * ValidationException +// The parameter is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UntagResource +func (c *ApplicationInsights) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ApplicationInsights) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateApplication = "UpdateApplication" + +// UpdateApplicationRequest generates a "aws/request.Request" representing the +// client's request for the UpdateApplication operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateApplication for more information on using the UpdateApplication +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateApplicationRequest method. +// req, resp := client.UpdateApplicationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UpdateApplication +func (c *ApplicationInsights) 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) + return +} + +// UpdateApplication API operation for Amazon CloudWatch Application Insights. +// +// Updates the 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 Amazon CloudWatch Application Insights's +// API operation UpdateApplication for usage and error information. +// +// Returned Error Types: +// * InternalServerException +// The server encountered an internal error and is unable to complete the request. +// +// * ResourceNotFoundException +// The resource does not exist in the customer account. +// +// * ValidationException +// The parameter is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UpdateApplication +func (c *ApplicationInsights) UpdateApplication(input *UpdateApplicationInput) (*UpdateApplicationOutput, error) { + req, out := c.UpdateApplicationRequest(input) + return out, req.Send() +} + +// UpdateApplicationWithContext is the same as UpdateApplication with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApplication for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ApplicationInsights) UpdateApplicationWithContext(ctx aws.Context, input *UpdateApplicationInput, opts ...request.Option) (*UpdateApplicationOutput, error) { + req, out := c.UpdateApplicationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateComponent = "UpdateComponent" + +// UpdateComponentRequest generates a "aws/request.Request" representing the +// client's request for the UpdateComponent operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateComponent for more information on using the UpdateComponent +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateComponentRequest method. +// req, resp := client.UpdateComponentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UpdateComponent +func (c *ApplicationInsights) UpdateComponentRequest(input *UpdateComponentInput) (req *request.Request, output *UpdateComponentOutput) { + op := &request.Operation{ + Name: opUpdateComponent, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateComponentInput{} + } + + output = &UpdateComponentOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateComponent API operation for Amazon CloudWatch Application Insights. +// +// Updates the custom component name and/or the list of resources that make +// up the component. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Application Insights's +// API operation UpdateComponent for usage and error information. +// +// Returned Error Types: +// * ResourceInUseException +// The resource is already created or in use. +// +// * ResourceNotFoundException +// The resource does not exist in the customer account. +// +// * ValidationException +// The parameter is not valid. +// +// * InternalServerException +// The server encountered an internal error and is unable to complete the request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UpdateComponent +func (c *ApplicationInsights) UpdateComponent(input *UpdateComponentInput) (*UpdateComponentOutput, error) { + req, out := c.UpdateComponentRequest(input) + return out, req.Send() +} + +// UpdateComponentWithContext is the same as UpdateComponent with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateComponent for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ApplicationInsights) UpdateComponentWithContext(ctx aws.Context, input *UpdateComponentInput, opts ...request.Option) (*UpdateComponentOutput, error) { + req, out := c.UpdateComponentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateComponentConfiguration = "UpdateComponentConfiguration" + +// UpdateComponentConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the UpdateComponentConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateComponentConfiguration for more information on using the UpdateComponentConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateComponentConfigurationRequest method. +// req, resp := client.UpdateComponentConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UpdateComponentConfiguration +func (c *ApplicationInsights) UpdateComponentConfigurationRequest(input *UpdateComponentConfigurationInput) (req *request.Request, output *UpdateComponentConfigurationOutput) { + op := &request.Operation{ + Name: opUpdateComponentConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateComponentConfigurationInput{} + } + + output = &UpdateComponentConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateComponentConfiguration API operation for Amazon CloudWatch Application Insights. +// +// Updates the monitoring configurations for the component. The configuration +// input parameter is an escaped JSON of the configuration and should match +// the schema of what is returned by DescribeComponentConfigurationRecommendation. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Application Insights's +// API operation UpdateComponentConfiguration for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource does not exist in the customer account. +// +// * ValidationException +// The parameter is not valid. +// +// * InternalServerException +// The server encountered an internal error and is unable to complete the request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UpdateComponentConfiguration +func (c *ApplicationInsights) UpdateComponentConfiguration(input *UpdateComponentConfigurationInput) (*UpdateComponentConfigurationOutput, error) { + req, out := c.UpdateComponentConfigurationRequest(input) + return out, req.Send() +} + +// UpdateComponentConfigurationWithContext is the same as UpdateComponentConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateComponentConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ApplicationInsights) UpdateComponentConfigurationWithContext(ctx aws.Context, input *UpdateComponentConfigurationInput, opts ...request.Option) (*UpdateComponentConfigurationOutput, error) { + req, out := c.UpdateComponentConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateLogPattern = "UpdateLogPattern" + +// UpdateLogPatternRequest generates a "aws/request.Request" representing the +// client's request for the UpdateLogPattern operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateLogPattern for more information on using the UpdateLogPattern +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateLogPatternRequest method. +// req, resp := client.UpdateLogPatternRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UpdateLogPattern +func (c *ApplicationInsights) UpdateLogPatternRequest(input *UpdateLogPatternInput) (req *request.Request, output *UpdateLogPatternOutput) { + op := &request.Operation{ + Name: opUpdateLogPattern, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateLogPatternInput{} + } + + output = &UpdateLogPatternOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateLogPattern API operation for Amazon CloudWatch Application Insights. +// +// Adds a log pattern to a LogPatternSet. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Application Insights's +// API operation UpdateLogPattern for usage and error information. +// +// Returned Error Types: +// * ResourceInUseException +// The resource is already created or in use. +// +// * ResourceNotFoundException +// The resource does not exist in the customer account. +// +// * ValidationException +// The parameter is not valid. +// +// * InternalServerException +// The server encountered an internal error and is unable to complete the request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/application-insights-2018-11-25/UpdateLogPattern +func (c *ApplicationInsights) UpdateLogPattern(input *UpdateLogPatternInput) (*UpdateLogPatternOutput, error) { + req, out := c.UpdateLogPatternRequest(input) + return out, req.Send() +} + +// UpdateLogPatternWithContext is the same as UpdateLogPattern with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateLogPattern for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ApplicationInsights) UpdateLogPatternWithContext(ctx aws.Context, input *UpdateLogPatternInput, opts ...request.Option) (*UpdateLogPatternOutput, error) { + req, out := c.UpdateLogPatternRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Describes a standalone resource or similarly grouped resources that the application +// is made up of. +type ApplicationComponent struct { + _ struct{} `type:"structure"` + + // The name of the component. + ComponentName *string `type:"string"` + + // Indicates whether the application component is monitored. + Monitor *bool `type:"boolean"` + + // The resource type. Supported resource types include EC2 instances, Auto Scaling + // group, Classic ELB, Application ELB, and SQS Queue. + ResourceType *string `type:"string"` + + // The stack tier of the application component. + Tier *string `min:"1" type:"string" enum:"Tier"` +} + +// String returns the string representation +func (s ApplicationComponent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApplicationComponent) GoString() string { + return s.String() +} + +// SetComponentName sets the ComponentName field's value. +func (s *ApplicationComponent) SetComponentName(v string) *ApplicationComponent { + s.ComponentName = &v + return s +} + +// SetMonitor sets the Monitor field's value. +func (s *ApplicationComponent) SetMonitor(v bool) *ApplicationComponent { + s.Monitor = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ApplicationComponent) SetResourceType(v string) *ApplicationComponent { + s.ResourceType = &v + return s +} + +// SetTier sets the Tier field's value. +func (s *ApplicationComponent) SetTier(v string) *ApplicationComponent { + s.Tier = &v + return s +} + +// Describes the status of the application. +type ApplicationInfo struct { + _ struct{} `type:"structure"` + + // The lifecycle of the application. + LifeCycle *string `type:"string"` + + // Indicates whether Application Insights will create opsItems for any problem + // detected by Application Insights for an application. + OpsCenterEnabled *bool `type:"boolean"` + + // The SNS topic provided to Application Insights that is associated to the + // created opsItems to receive SNS notifications for opsItem updates. + OpsItemSNSTopicArn *string `min:"20" type:"string"` + + // The issues on the user side that block Application Insights from successfully + // monitoring an application. Example remarks include: + // + // * “Configuring application, detected 1 Errors, 3 Warnings” + // + // * “Configuring application, detected 1 Unconfigured Components” + Remarks *string `type:"string"` + + // The name of the resource group used for the application. + ResourceGroupName *string `min:"1" type:"string"` +} + +// 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() +} + +// SetLifeCycle sets the LifeCycle field's value. +func (s *ApplicationInfo) SetLifeCycle(v string) *ApplicationInfo { + s.LifeCycle = &v + return s +} + +// SetOpsCenterEnabled sets the OpsCenterEnabled field's value. +func (s *ApplicationInfo) SetOpsCenterEnabled(v bool) *ApplicationInfo { + s.OpsCenterEnabled = &v + return s +} + +// SetOpsItemSNSTopicArn sets the OpsItemSNSTopicArn field's value. +func (s *ApplicationInfo) SetOpsItemSNSTopicArn(v string) *ApplicationInfo { + s.OpsItemSNSTopicArn = &v + return s +} + +// SetRemarks sets the Remarks field's value. +func (s *ApplicationInfo) SetRemarks(v string) *ApplicationInfo { + s.Remarks = &v + return s +} + +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *ApplicationInfo) SetResourceGroupName(v string) *ApplicationInfo { + s.ResourceGroupName = &v + return s +} + +// The request is not understood by the server. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// The event information. +type ConfigurationEvent struct { + _ struct{} `type:"structure"` + + // The details of the event in plain text. + EventDetail *string `type:"string"` + + // The name of the resource Application Insights attempted to configure. + EventResourceName *string `type:"string"` + + // The resource type that Application Insights attempted to configure, for example, + // CLOUDWATCH_ALARM. + EventResourceType *string `type:"string" enum:"ConfigurationEventResourceType"` + + // The status of the configuration update event. Possible values include INFO, + // WARN, and ERROR. + EventStatus *string `type:"string" enum:"ConfigurationEventStatus"` + + // The timestamp of the event. + EventTime *time.Time `type:"timestamp"` + + // The resource monitored by Application Insights. + MonitoredResourceARN *string `type:"string"` +} + +// String returns the string representation +func (s ConfigurationEvent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConfigurationEvent) GoString() string { + return s.String() +} + +// SetEventDetail sets the EventDetail field's value. +func (s *ConfigurationEvent) SetEventDetail(v string) *ConfigurationEvent { + s.EventDetail = &v + return s +} + +// SetEventResourceName sets the EventResourceName field's value. +func (s *ConfigurationEvent) SetEventResourceName(v string) *ConfigurationEvent { + s.EventResourceName = &v + return s +} + +// SetEventResourceType sets the EventResourceType field's value. +func (s *ConfigurationEvent) SetEventResourceType(v string) *ConfigurationEvent { + s.EventResourceType = &v + return s +} + +// SetEventStatus sets the EventStatus field's value. +func (s *ConfigurationEvent) SetEventStatus(v string) *ConfigurationEvent { + s.EventStatus = &v + return s +} + +// SetEventTime sets the EventTime field's value. +func (s *ConfigurationEvent) SetEventTime(v time.Time) *ConfigurationEvent { + s.EventTime = &v + return s +} + +// SetMonitoredResourceARN sets the MonitoredResourceARN field's value. +func (s *ConfigurationEvent) SetMonitoredResourceARN(v string) *ConfigurationEvent { + s.MonitoredResourceARN = &v + return s +} + +type CreateApplicationInput struct { + _ struct{} `type:"structure"` + + // When set to true, creates opsItems for any problems detected on an application. + OpsCenterEnabled *bool `type:"boolean"` + + // The SNS topic provided to Application Insights that is associated to the + // created opsItem. Allows you to receive notifications for updates to the opsItem. + OpsItemSNSTopicArn *string `min:"20" type:"string"` + + // The name of the resource group. + // + // ResourceGroupName is a required field + ResourceGroupName *string `min:"1" type:"string" required:"true"` + + // List of tags to add to the application. tag key (Key) and an associated tag + // value (Value). The maximum length of a tag key is 128 characters. The maximum + // length of a tag value is 256 characters. + Tags []*Tag `type:"list"` +} + +// 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.OpsItemSNSTopicArn != nil && len(*s.OpsItemSNSTopicArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("OpsItemSNSTopicArn", 20)) + } + if s.ResourceGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) + } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 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 +} + +// SetOpsCenterEnabled sets the OpsCenterEnabled field's value. +func (s *CreateApplicationInput) SetOpsCenterEnabled(v bool) *CreateApplicationInput { + s.OpsCenterEnabled = &v + return s +} + +// SetOpsItemSNSTopicArn sets the OpsItemSNSTopicArn field's value. +func (s *CreateApplicationInput) SetOpsItemSNSTopicArn(v string) *CreateApplicationInput { + s.OpsItemSNSTopicArn = &v + return s +} + +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *CreateApplicationInput) SetResourceGroupName(v string) *CreateApplicationInput { + s.ResourceGroupName = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateApplicationInput) SetTags(v []*Tag) *CreateApplicationInput { + s.Tags = v + return s +} + +type CreateApplicationOutput struct { + _ struct{} `type:"structure"` + + // Information about the application. + ApplicationInfo *ApplicationInfo `type:"structure"` +} + +// 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() +} + +// SetApplicationInfo sets the ApplicationInfo field's value. +func (s *CreateApplicationOutput) SetApplicationInfo(v *ApplicationInfo) *CreateApplicationOutput { + s.ApplicationInfo = v + return s +} + +type CreateComponentInput struct { + _ struct{} `type:"structure"` + + // The name of the component. + // + // ComponentName is a required field + ComponentName *string `type:"string" required:"true"` + + // The name of the resource group. + // + // ResourceGroupName is a required field + ResourceGroupName *string `min:"1" type:"string" required:"true"` + + // The list of resource ARNs that belong to the component. + // + // ResourceList is a required field + ResourceList []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s CreateComponentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateComponentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateComponentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateComponentInput"} + if s.ComponentName == nil { + invalidParams.Add(request.NewErrParamRequired("ComponentName")) + } + if s.ResourceGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) + } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } + if s.ResourceList == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceList")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComponentName sets the ComponentName field's value. +func (s *CreateComponentInput) SetComponentName(v string) *CreateComponentInput { + s.ComponentName = &v + return s +} + +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *CreateComponentInput) SetResourceGroupName(v string) *CreateComponentInput { + s.ResourceGroupName = &v + return s +} + +// SetResourceList sets the ResourceList field's value. +func (s *CreateComponentInput) SetResourceList(v []*string) *CreateComponentInput { + s.ResourceList = v + return s +} + +type CreateComponentOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CreateComponentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateComponentOutput) GoString() string { + return s.String() +} + +type CreateLogPatternInput struct { + _ struct{} `type:"structure"` + + // The log pattern. + // + // Pattern is a required field + Pattern *string `min:"1" type:"string" required:"true"` + + // The name of the log pattern. + // + // PatternName is a required field + PatternName *string `min:"1" type:"string" required:"true"` + + // The name of the log pattern set. + // + // PatternSetName is a required field + PatternSetName *string `min:"1" type:"string" required:"true"` + + // Rank of the log pattern. + // + // Rank is a required field + Rank *int64 `type:"integer" required:"true"` + + // The name of the resource group. + // + // ResourceGroupName is a required field + ResourceGroupName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateLogPatternInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLogPatternInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateLogPatternInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLogPatternInput"} + if s.Pattern == nil { + invalidParams.Add(request.NewErrParamRequired("Pattern")) + } + if s.Pattern != nil && len(*s.Pattern) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Pattern", 1)) + } + if s.PatternName == nil { + invalidParams.Add(request.NewErrParamRequired("PatternName")) + } + if s.PatternName != nil && len(*s.PatternName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PatternName", 1)) + } + if s.PatternSetName == nil { + invalidParams.Add(request.NewErrParamRequired("PatternSetName")) + } + if s.PatternSetName != nil && len(*s.PatternSetName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PatternSetName", 1)) + } + if s.Rank == nil { + invalidParams.Add(request.NewErrParamRequired("Rank")) + } + if s.ResourceGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) + } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPattern sets the Pattern field's value. +func (s *CreateLogPatternInput) SetPattern(v string) *CreateLogPatternInput { + s.Pattern = &v + return s +} + +// SetPatternName sets the PatternName field's value. +func (s *CreateLogPatternInput) SetPatternName(v string) *CreateLogPatternInput { + s.PatternName = &v + return s +} + +// SetPatternSetName sets the PatternSetName field's value. +func (s *CreateLogPatternInput) SetPatternSetName(v string) *CreateLogPatternInput { + s.PatternSetName = &v + return s +} + +// SetRank sets the Rank field's value. +func (s *CreateLogPatternInput) SetRank(v int64) *CreateLogPatternInput { + s.Rank = &v + return s +} + +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *CreateLogPatternInput) SetResourceGroupName(v string) *CreateLogPatternInput { + s.ResourceGroupName = &v + return s +} + +type CreateLogPatternOutput struct { + _ struct{} `type:"structure"` + + // The successfully created log pattern. + LogPattern *LogPattern `type:"structure"` + + // The name of the resource group. + ResourceGroupName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateLogPatternOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLogPatternOutput) GoString() string { + return s.String() +} + +// SetLogPattern sets the LogPattern field's value. +func (s *CreateLogPatternOutput) SetLogPattern(v *LogPattern) *CreateLogPatternOutput { + s.LogPattern = v + return s +} + +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *CreateLogPatternOutput) SetResourceGroupName(v string) *CreateLogPatternOutput { + s.ResourceGroupName = &v + return s +} + +type DeleteApplicationInput struct { + _ struct{} `type:"structure"` + + // The name of the resource group. + // + // ResourceGroupName is a required field + ResourceGroupName *string `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.ResourceGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) + } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *DeleteApplicationInput) SetResourceGroupName(v string) *DeleteApplicationInput { + s.ResourceGroupName = &v + return s +} + +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() +} + +type DeleteComponentInput struct { + _ struct{} `type:"structure"` + + // The name of the component. + // + // ComponentName is a required field + ComponentName *string `type:"string" required:"true"` + + // The name of the resource group. + // + // ResourceGroupName is a required field + ResourceGroupName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteComponentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteComponentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteComponentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteComponentInput"} + if s.ComponentName == nil { + invalidParams.Add(request.NewErrParamRequired("ComponentName")) + } + if s.ResourceGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) + } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComponentName sets the ComponentName field's value. +func (s *DeleteComponentInput) SetComponentName(v string) *DeleteComponentInput { + s.ComponentName = &v + return s +} + +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *DeleteComponentInput) SetResourceGroupName(v string) *DeleteComponentInput { + s.ResourceGroupName = &v + return s +} + +type DeleteComponentOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteComponentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteComponentOutput) GoString() string { + return s.String() +} + +type DeleteLogPatternInput struct { + _ struct{} `type:"structure"` + + // The name of the log pattern. + // + // PatternName is a required field + PatternName *string `min:"1" type:"string" required:"true"` + + // The name of the log pattern set. + // + // PatternSetName is a required field + PatternSetName *string `min:"1" type:"string" required:"true"` + + // The name of the resource group. + // + // ResourceGroupName is a required field + ResourceGroupName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteLogPatternInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLogPatternInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteLogPatternInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteLogPatternInput"} + if s.PatternName == nil { + invalidParams.Add(request.NewErrParamRequired("PatternName")) + } + if s.PatternName != nil && len(*s.PatternName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PatternName", 1)) + } + if s.PatternSetName == nil { + invalidParams.Add(request.NewErrParamRequired("PatternSetName")) + } + if s.PatternSetName != nil && len(*s.PatternSetName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PatternSetName", 1)) + } + if s.ResourceGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) + } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPatternName sets the PatternName field's value. +func (s *DeleteLogPatternInput) SetPatternName(v string) *DeleteLogPatternInput { + s.PatternName = &v + return s +} + +// SetPatternSetName sets the PatternSetName field's value. +func (s *DeleteLogPatternInput) SetPatternSetName(v string) *DeleteLogPatternInput { + s.PatternSetName = &v + return s +} + +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *DeleteLogPatternInput) SetResourceGroupName(v string) *DeleteLogPatternInput { + s.ResourceGroupName = &v + return s +} + +type DeleteLogPatternOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteLogPatternOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLogPatternOutput) GoString() string { + return s.String() +} + +type DescribeApplicationInput struct { + _ struct{} `type:"structure"` + + // The name of the resource group. + // + // ResourceGroupName is a required field + ResourceGroupName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeApplicationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeApplicationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeApplicationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeApplicationInput"} + if s.ResourceGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) + } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *DescribeApplicationInput) SetResourceGroupName(v string) *DescribeApplicationInput { + s.ResourceGroupName = &v + return s +} + +type DescribeApplicationOutput struct { + _ struct{} `type:"structure"` + + // Information about the application. + ApplicationInfo *ApplicationInfo `type:"structure"` +} + +// String returns the string representation +func (s DescribeApplicationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeApplicationOutput) GoString() string { + return s.String() +} + +// SetApplicationInfo sets the ApplicationInfo field's value. +func (s *DescribeApplicationOutput) SetApplicationInfo(v *ApplicationInfo) *DescribeApplicationOutput { + s.ApplicationInfo = v + return s +} + +type DescribeComponentConfigurationInput struct { + _ struct{} `type:"structure"` + + // The name of the component. + // + // ComponentName is a required field + ComponentName *string `type:"string" required:"true"` + + // The name of the resource group. + // + // ResourceGroupName is a required field + ResourceGroupName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeComponentConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeComponentConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeComponentConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeComponentConfigurationInput"} + if s.ComponentName == nil { + invalidParams.Add(request.NewErrParamRequired("ComponentName")) + } + if s.ResourceGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) + } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComponentName sets the ComponentName field's value. +func (s *DescribeComponentConfigurationInput) SetComponentName(v string) *DescribeComponentConfigurationInput { + s.ComponentName = &v + return s +} + +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *DescribeComponentConfigurationInput) SetResourceGroupName(v string) *DescribeComponentConfigurationInput { + s.ResourceGroupName = &v + return s +} + +type DescribeComponentConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The configuration settings of the component. The value is the escaped JSON + // of the configuration. + ComponentConfiguration *string `min:"1" type:"string"` + + // Indicates whether the application component is monitored. + Monitor *bool `type:"boolean"` + + // The tier of the application component. Supported tiers include DOT_NET_CORE, + // DOT_NET_WORKER, DOT_NET_WEB, SQL_SERVER, and DEFAULT + Tier *string `min:"1" type:"string" enum:"Tier"` +} + +// String returns the string representation +func (s DescribeComponentConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeComponentConfigurationOutput) GoString() string { + return s.String() +} + +// SetComponentConfiguration sets the ComponentConfiguration field's value. +func (s *DescribeComponentConfigurationOutput) SetComponentConfiguration(v string) *DescribeComponentConfigurationOutput { + s.ComponentConfiguration = &v + return s +} + +// SetMonitor sets the Monitor field's value. +func (s *DescribeComponentConfigurationOutput) SetMonitor(v bool) *DescribeComponentConfigurationOutput { s.Monitor = &v return s } -// SetResourceType sets the ResourceType field's value. -func (s *ApplicationComponent) SetResourceType(v string) *ApplicationComponent { - s.ResourceType = &v +// SetTier sets the Tier field's value. +func (s *DescribeComponentConfigurationOutput) SetTier(v string) *DescribeComponentConfigurationOutput { + s.Tier = &v + return s +} + +type DescribeComponentConfigurationRecommendationInput struct { + _ struct{} `type:"structure"` + + // The name of the component. + // + // ComponentName is a required field + ComponentName *string `type:"string" required:"true"` + + // The name of the resource group. + // + // ResourceGroupName is a required field + ResourceGroupName *string `min:"1" type:"string" required:"true"` + + // The tier of the application component. Supported tiers include DOT_NET_CORE, + // DOT_NET_WORKER, DOT_NET_WEB, SQL_SERVER, and DEFAULT. + // + // Tier is a required field + Tier *string `min:"1" type:"string" required:"true" enum:"Tier"` +} + +// String returns the string representation +func (s DescribeComponentConfigurationRecommendationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeComponentConfigurationRecommendationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeComponentConfigurationRecommendationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeComponentConfigurationRecommendationInput"} + if s.ComponentName == nil { + invalidParams.Add(request.NewErrParamRequired("ComponentName")) + } + if s.ResourceGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) + } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } + if s.Tier == nil { + invalidParams.Add(request.NewErrParamRequired("Tier")) + } + if s.Tier != nil && len(*s.Tier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tier", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComponentName sets the ComponentName field's value. +func (s *DescribeComponentConfigurationRecommendationInput) SetComponentName(v string) *DescribeComponentConfigurationRecommendationInput { + s.ComponentName = &v + return s +} + +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *DescribeComponentConfigurationRecommendationInput) SetResourceGroupName(v string) *DescribeComponentConfigurationRecommendationInput { + s.ResourceGroupName = &v + return s +} + +// SetTier sets the Tier field's value. +func (s *DescribeComponentConfigurationRecommendationInput) SetTier(v string) *DescribeComponentConfigurationRecommendationInput { + s.Tier = &v + return s +} + +type DescribeComponentConfigurationRecommendationOutput struct { + _ struct{} `type:"structure"` + + // The recommended configuration settings of the component. The value is the + // escaped JSON of the configuration. + ComponentConfiguration *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DescribeComponentConfigurationRecommendationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeComponentConfigurationRecommendationOutput) GoString() string { + return s.String() +} + +// SetComponentConfiguration sets the ComponentConfiguration field's value. +func (s *DescribeComponentConfigurationRecommendationOutput) SetComponentConfiguration(v string) *DescribeComponentConfigurationRecommendationOutput { + s.ComponentConfiguration = &v + return s +} + +type DescribeComponentInput struct { + _ struct{} `type:"structure"` + + // The name of the component. + // + // ComponentName is a required field + ComponentName *string `type:"string" required:"true"` + + // The name of the resource group. + // + // ResourceGroupName is a required field + ResourceGroupName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeComponentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeComponentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeComponentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeComponentInput"} + if s.ComponentName == nil { + invalidParams.Add(request.NewErrParamRequired("ComponentName")) + } + if s.ResourceGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) + } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComponentName sets the ComponentName field's value. +func (s *DescribeComponentInput) SetComponentName(v string) *DescribeComponentInput { + s.ComponentName = &v return s } -// SetTier sets the Tier field's value. -func (s *ApplicationComponent) SetTier(v string) *ApplicationComponent { - s.Tier = &v +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *DescribeComponentInput) SetResourceGroupName(v string) *DescribeComponentInput { + s.ResourceGroupName = &v return s } -// Describes the status of the application. -type ApplicationInfo struct { +type DescribeComponentOutput struct { _ struct{} `type:"structure"` - // The lifecycle of the application. - LifeCycle *string `type:"string"` + // Describes a standalone resource or similarly grouped resources that the application + // is made up of. + ApplicationComponent *ApplicationComponent `type:"structure"` - // Indicates whether Application Insights will create opsItems for any problem - // detected by Application Insights for an application. - OpsCenterEnabled *bool `type:"boolean"` + // The list of resource ARNs that belong to the component. + ResourceList []*string `type:"list"` +} - // The SNS topic provided to Application Insights that is associated to the - // created opsItems to receive SNS notifications for opsItem updates. - OpsItemSNSTopicArn *string `type:"string"` +// String returns the string representation +func (s DescribeComponentOutput) String() string { + return awsutil.Prettify(s) +} - // The issues on the user side that block Application Insights from successfully - // monitoring an application. - Remarks *string `type:"string"` +// GoString returns the string representation +func (s DescribeComponentOutput) GoString() string { + return s.String() +} - // The name of the resource group used for the application. - ResourceGroupName *string `type:"string"` +// SetApplicationComponent sets the ApplicationComponent field's value. +func (s *DescribeComponentOutput) SetApplicationComponent(v *ApplicationComponent) *DescribeComponentOutput { + s.ApplicationComponent = v + return s +} + +// SetResourceList sets the ResourceList field's value. +func (s *DescribeComponentOutput) SetResourceList(v []*string) *DescribeComponentOutput { + s.ResourceList = v + return s +} + +type DescribeLogPatternInput struct { + _ struct{} `type:"structure"` + + // The name of the log pattern. + // + // PatternName is a required field + PatternName *string `min:"1" type:"string" required:"true"` + + // The name of the log pattern set. + // + // PatternSetName is a required field + PatternSetName *string `min:"1" type:"string" required:"true"` + + // The name of the resource group. + // + // ResourceGroupName is a required field + ResourceGroupName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s ApplicationInfo) String() string { +func (s DescribeLogPatternInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ApplicationInfo) GoString() string { +func (s DescribeLogPatternInput) GoString() string { return s.String() } -// SetLifeCycle sets the LifeCycle field's value. -func (s *ApplicationInfo) SetLifeCycle(v string) *ApplicationInfo { - s.LifeCycle = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLogPatternInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLogPatternInput"} + if s.PatternName == nil { + invalidParams.Add(request.NewErrParamRequired("PatternName")) + } + if s.PatternName != nil && len(*s.PatternName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PatternName", 1)) + } + if s.PatternSetName == nil { + invalidParams.Add(request.NewErrParamRequired("PatternSetName")) + } + if s.PatternSetName != nil && len(*s.PatternSetName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PatternSetName", 1)) + } + if s.ResourceGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) + } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPatternName sets the PatternName field's value. +func (s *DescribeLogPatternInput) SetPatternName(v string) *DescribeLogPatternInput { + s.PatternName = &v return s } -// SetOpsCenterEnabled sets the OpsCenterEnabled field's value. -func (s *ApplicationInfo) SetOpsCenterEnabled(v bool) *ApplicationInfo { - s.OpsCenterEnabled = &v +// SetPatternSetName sets the PatternSetName field's value. +func (s *DescribeLogPatternInput) SetPatternSetName(v string) *DescribeLogPatternInput { + s.PatternSetName = &v return s } -// SetOpsItemSNSTopicArn sets the OpsItemSNSTopicArn field's value. -func (s *ApplicationInfo) SetOpsItemSNSTopicArn(v string) *ApplicationInfo { - s.OpsItemSNSTopicArn = &v +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *DescribeLogPatternInput) SetResourceGroupName(v string) *DescribeLogPatternInput { + s.ResourceGroupName = &v return s } -// SetRemarks sets the Remarks field's value. -func (s *ApplicationInfo) SetRemarks(v string) *ApplicationInfo { - s.Remarks = &v +type DescribeLogPatternOutput struct { + _ struct{} `type:"structure"` + + // The successfully created log pattern. + LogPattern *LogPattern `type:"structure"` + + // The name of the resource group. + ResourceGroupName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DescribeLogPatternOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLogPatternOutput) GoString() string { + return s.String() +} + +// SetLogPattern sets the LogPattern field's value. +func (s *DescribeLogPatternOutput) SetLogPattern(v *LogPattern) *DescribeLogPatternOutput { + s.LogPattern = v return s } // SetResourceGroupName sets the ResourceGroupName field's value. -func (s *ApplicationInfo) SetResourceGroupName(v string) *ApplicationInfo { +func (s *DescribeLogPatternOutput) SetResourceGroupName(v string) *DescribeLogPatternOutput { s.ResourceGroupName = &v return s } -type CreateApplicationInput struct { +type DescribeObservationInput struct { _ struct{} `type:"structure"` - // When set to true, creates opsItems for any problems detected on an application. - OpsCenterEnabled *bool `type:"boolean"` - - // The SNS topic provided to Application Insights that is associated to the - // created opsItem. Allows you to receive notifications for updates to the opsItem. - OpsItemSNSTopicArn *string `type:"string"` - - // The name of the resource group. + // The ID of the observation. // - // ResourceGroupName is a required field - ResourceGroupName *string `type:"string" required:"true"` + // ObservationId is a required field + ObservationId *string `min:"38" type:"string" required:"true"` } // String returns the string representation -func (s CreateApplicationInput) String() string { +func (s DescribeObservationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateApplicationInput) GoString() string { +func (s DescribeObservationInput) 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.ResourceGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) +func (s *DescribeObservationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeObservationInput"} + if s.ObservationId == nil { + invalidParams.Add(request.NewErrParamRequired("ObservationId")) + } + if s.ObservationId != nil && len(*s.ObservationId) < 38 { + invalidParams.Add(request.NewErrParamMinLen("ObservationId", 38)) } if invalidParams.Len() > 0 { @@ -1800,211 +3984,245 @@ func (s *CreateApplicationInput) Validate() error { return nil } -// SetOpsCenterEnabled sets the OpsCenterEnabled field's value. -func (s *CreateApplicationInput) SetOpsCenterEnabled(v bool) *CreateApplicationInput { - s.OpsCenterEnabled = &v +// SetObservationId sets the ObservationId field's value. +func (s *DescribeObservationInput) SetObservationId(v string) *DescribeObservationInput { + s.ObservationId = &v return s } -// SetOpsItemSNSTopicArn sets the OpsItemSNSTopicArn field's value. -func (s *CreateApplicationInput) SetOpsItemSNSTopicArn(v string) *CreateApplicationInput { - s.OpsItemSNSTopicArn = &v - return s +type DescribeObservationOutput struct { + _ struct{} `type:"structure"` + + // Information about the observation. + Observation *Observation `type:"structure"` } -// SetResourceGroupName sets the ResourceGroupName field's value. -func (s *CreateApplicationInput) SetResourceGroupName(v string) *CreateApplicationInput { - s.ResourceGroupName = &v +// String returns the string representation +func (s DescribeObservationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeObservationOutput) GoString() string { + return s.String() +} + +// SetObservation sets the Observation field's value. +func (s *DescribeObservationOutput) SetObservation(v *Observation) *DescribeObservationOutput { + s.Observation = v return s } -type CreateApplicationOutput struct { +type DescribeProblemInput struct { _ struct{} `type:"structure"` - // Information about the application. - ApplicationInfo *ApplicationInfo `type:"structure"` + // The ID of the problem. + // + // ProblemId is a required field + ProblemId *string `min:"38" type:"string" required:"true"` } // String returns the string representation -func (s CreateApplicationOutput) String() string { +func (s DescribeProblemInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateApplicationOutput) GoString() string { +func (s DescribeProblemInput) GoString() string { return s.String() } -// SetApplicationInfo sets the ApplicationInfo field's value. -func (s *CreateApplicationOutput) SetApplicationInfo(v *ApplicationInfo) *CreateApplicationOutput { - s.ApplicationInfo = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeProblemInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeProblemInput"} + if s.ProblemId == nil { + invalidParams.Add(request.NewErrParamRequired("ProblemId")) + } + if s.ProblemId != nil && len(*s.ProblemId) < 38 { + invalidParams.Add(request.NewErrParamMinLen("ProblemId", 38)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetProblemId sets the ProblemId field's value. +func (s *DescribeProblemInput) SetProblemId(v string) *DescribeProblemInput { + s.ProblemId = &v return s } -type CreateComponentInput struct { +type DescribeProblemObservationsInput struct { _ struct{} `type:"structure"` - // The name of the component. - // - // ComponentName is a required field - ComponentName *string `type:"string" required:"true"` - - // The name of the resource group. - // - // ResourceGroupName is a required field - ResourceGroupName *string `type:"string" required:"true"` - - // The list of resource ARNs that belong to the component. + // The ID of the problem. // - // ResourceList is a required field - ResourceList []*string `type:"list" required:"true"` + // ProblemId is a required field + ProblemId *string `min:"38" type:"string" required:"true"` } // String returns the string representation -func (s CreateComponentInput) String() string { +func (s DescribeProblemObservationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateComponentInput) GoString() string { +func (s DescribeProblemObservationsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateComponentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateComponentInput"} - if s.ComponentName == nil { - invalidParams.Add(request.NewErrParamRequired("ComponentName")) +func (s *DescribeProblemObservationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeProblemObservationsInput"} + if s.ProblemId == nil { + invalidParams.Add(request.NewErrParamRequired("ProblemId")) } - if s.ResourceGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) + if s.ProblemId != nil && len(*s.ProblemId) < 38 { + invalidParams.Add(request.NewErrParamMinLen("ProblemId", 38)) } - if s.ResourceList == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceList")) + + if invalidParams.Len() > 0 { + return invalidParams } + return nil +} + +// SetProblemId sets the ProblemId field's value. +func (s *DescribeProblemObservationsInput) SetProblemId(v string) *DescribeProblemObservationsInput { + s.ProblemId = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +type DescribeProblemObservationsOutput struct { + _ struct{} `type:"structure"` + + // Observations related to the problem. + RelatedObservations *RelatedObservations `type:"structure"` } -// SetComponentName sets the ComponentName field's value. -func (s *CreateComponentInput) SetComponentName(v string) *CreateComponentInput { - s.ComponentName = &v - return s +// String returns the string representation +func (s DescribeProblemObservationsOutput) String() string { + return awsutil.Prettify(s) } -// SetResourceGroupName sets the ResourceGroupName field's value. -func (s *CreateComponentInput) SetResourceGroupName(v string) *CreateComponentInput { - s.ResourceGroupName = &v - return s +// GoString returns the string representation +func (s DescribeProblemObservationsOutput) GoString() string { + return s.String() } -// SetResourceList sets the ResourceList field's value. -func (s *CreateComponentInput) SetResourceList(v []*string) *CreateComponentInput { - s.ResourceList = v +// SetRelatedObservations sets the RelatedObservations field's value. +func (s *DescribeProblemObservationsOutput) SetRelatedObservations(v *RelatedObservations) *DescribeProblemObservationsOutput { + s.RelatedObservations = v return s } -type CreateComponentOutput struct { +type DescribeProblemOutput struct { _ struct{} `type:"structure"` + + // Information about the problem. + Problem *Problem `type:"structure"` } // String returns the string representation -func (s CreateComponentOutput) String() string { +func (s DescribeProblemOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateComponentOutput) GoString() string { +func (s DescribeProblemOutput) GoString() string { return s.String() } -type DeleteApplicationInput struct { - _ struct{} `type:"structure"` +// SetProblem sets the Problem field's value. +func (s *DescribeProblemOutput) SetProblem(v *Problem) *DescribeProblemOutput { + s.Problem = v + return s +} - // The name of the resource group. - // - // ResourceGroupName is a required field - ResourceGroupName *string `type:"string" required:"true"` +// The server encountered an internal error and is unable to complete the request. +type InternalServerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s DeleteApplicationInput) String() string { +func (s InternalServerException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteApplicationInput) GoString() string { +func (s InternalServerException) 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.ResourceGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) +func newErrorInternalServerException(v protocol.ResponseMetadata) error { + return &InternalServerException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InternalServerException) Code() string { + return "InternalServerException" +} + +// Message returns the exception's message. +func (s InternalServerException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetResourceGroupName sets the ResourceGroupName field's value. -func (s *DeleteApplicationInput) SetResourceGroupName(v string) *DeleteApplicationInput { - s.ResourceGroupName = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerException) OrigErr() error { + return nil } -type DeleteApplicationOutput struct { - _ struct{} `type:"structure"` +func (s InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// String returns the string representation -func (s DeleteApplicationOutput) String() string { - return awsutil.Prettify(s) +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerException) StatusCode() int { + return s.respMetadata.StatusCode } -// GoString returns the string representation -func (s DeleteApplicationOutput) GoString() string { - return s.String() +// RequestID returns the service's response RequestID for request. +func (s InternalServerException) RequestID() string { + return s.respMetadata.RequestID } -type DeleteComponentInput struct { +type ListApplicationsInput struct { _ struct{} `type:"structure"` - // The name of the component. - // - // ComponentName is a required field - ComponentName *string `type:"string" required:"true"` + // 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:"1" type:"integer"` - // The name of the resource group. - // - // ResourceGroupName is a required field - ResourceGroupName *string `type:"string" required:"true"` + // The token to request the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DeleteComponentInput) String() string { +func (s ListApplicationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteComponentInput) GoString() string { +func (s ListApplicationsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteComponentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteComponentInput"} - if s.ComponentName == nil { - invalidParams.Add(request.NewErrParamRequired("ComponentName")) - } - if s.ResourceGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) +func (s *ListApplicationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListApplicationsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -2013,57 +4231,89 @@ func (s *DeleteComponentInput) Validate() error { return nil } -// SetComponentName sets the ComponentName field's value. -func (s *DeleteComponentInput) SetComponentName(v string) *DeleteComponentInput { - s.ComponentName = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListApplicationsInput) SetMaxResults(v int64) *ListApplicationsInput { + s.MaxResults = &v return s } -// SetResourceGroupName sets the ResourceGroupName field's value. -func (s *DeleteComponentInput) SetResourceGroupName(v string) *DeleteComponentInput { - s.ResourceGroupName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListApplicationsInput) SetNextToken(v string) *ListApplicationsInput { + s.NextToken = &v return s } -type DeleteComponentOutput struct { +type ListApplicationsOutput struct { _ struct{} `type:"structure"` + + // The list of applications. + ApplicationInfoList []*ApplicationInfo `type:"list"` + + // The token used to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string `type:"string"` } // String returns the string representation -func (s DeleteComponentOutput) String() string { +func (s ListApplicationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteComponentOutput) GoString() string { +func (s ListApplicationsOutput) GoString() string { return s.String() } -type DescribeApplicationInput struct { +// SetApplicationInfoList sets the ApplicationInfoList field's value. +func (s *ListApplicationsOutput) SetApplicationInfoList(v []*ApplicationInfo) *ListApplicationsOutput { + s.ApplicationInfoList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListApplicationsOutput) SetNextToken(v string) *ListApplicationsOutput { + s.NextToken = &v + return s +} + +type ListComponentsInput struct { _ struct{} `type:"structure"` + // 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:"1" type:"integer"` + + // The token to request the next page of results. + NextToken *string `type:"string"` + // The name of the resource group. // // ResourceGroupName is a required field - ResourceGroupName *string `type:"string" required:"true"` + ResourceGroupName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s DescribeApplicationInput) String() string { +func (s ListComponentsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeApplicationInput) GoString() string { +func (s ListComponentsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeApplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeApplicationInput"} +func (s *ListComponentsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListComponentsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } if s.ResourceGroupName == nil { invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -2071,67 +4321,106 @@ func (s *DescribeApplicationInput) Validate() error { return nil } +// SetMaxResults sets the MaxResults field's value. +func (s *ListComponentsInput) SetMaxResults(v int64) *ListComponentsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListComponentsInput) SetNextToken(v string) *ListComponentsInput { + s.NextToken = &v + return s +} + // SetResourceGroupName sets the ResourceGroupName field's value. -func (s *DescribeApplicationInput) SetResourceGroupName(v string) *DescribeApplicationInput { +func (s *ListComponentsInput) SetResourceGroupName(v string) *ListComponentsInput { s.ResourceGroupName = &v return s } -type DescribeApplicationOutput struct { +type ListComponentsOutput struct { _ struct{} `type:"structure"` - // Information about the application. - ApplicationInfo *ApplicationInfo `type:"structure"` + // The list of application components. + ApplicationComponentList []*ApplicationComponent `type:"list"` + + // The token to request the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeApplicationOutput) String() string { +func (s ListComponentsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeApplicationOutput) GoString() string { +func (s ListComponentsOutput) GoString() string { return s.String() } -// SetApplicationInfo sets the ApplicationInfo field's value. -func (s *DescribeApplicationOutput) SetApplicationInfo(v *ApplicationInfo) *DescribeApplicationOutput { - s.ApplicationInfo = v +// SetApplicationComponentList sets the ApplicationComponentList field's value. +func (s *ListComponentsOutput) SetApplicationComponentList(v []*ApplicationComponent) *ListComponentsOutput { + s.ApplicationComponentList = v return s } -type DescribeComponentConfigurationInput struct { +// SetNextToken sets the NextToken field's value. +func (s *ListComponentsOutput) SetNextToken(v string) *ListComponentsOutput { + s.NextToken = &v + return s +} + +type ListConfigurationHistoryInput struct { _ struct{} `type:"structure"` - // The name of the component. - // - // ComponentName is a required field - ComponentName *string `type:"string" required:"true"` + // The end time of the event. + EndTime *time.Time `type:"timestamp"` - // The name of the resource group. - // - // ResourceGroupName is a required field - ResourceGroupName *string `type:"string" required:"true"` + // The status of the configuration update event. Possible values include INFO, + // WARN, and ERROR. + EventStatus *string `type:"string" enum:"ConfigurationEventStatus"` + + // The maximum number of results returned by ListConfigurationHistory in paginated + // output. When this parameter is used, ListConfigurationHistory returns only + // MaxResults in a single page along with a NextToken response element. The + // remaining results of the initial request can be seen by sending another ListConfigurationHistory + // request with the returned NextToken value. If this parameter is not used, + // then ListConfigurationHistory returns all results. + MaxResults *int64 `min:"1" type:"integer"` + + // The NextToken value returned from a previous paginated ListConfigurationHistory + // 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"` + + // Resource group to which the application belongs. + ResourceGroupName *string `min:"1" type:"string"` + + // The start time of the event. + StartTime *time.Time `type:"timestamp"` } // String returns the string representation -func (s DescribeComponentConfigurationInput) String() string { +func (s ListConfigurationHistoryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeComponentConfigurationInput) GoString() string { +func (s ListConfigurationHistoryInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeComponentConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeComponentConfigurationInput"} - if s.ComponentName == nil { - invalidParams.Add(request.NewErrParamRequired("ComponentName")) +func (s *ListConfigurationHistoryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListConfigurationHistoryInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } - if s.ResourceGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) } if invalidParams.Len() > 0 { @@ -2140,102 +4429,114 @@ func (s *DescribeComponentConfigurationInput) Validate() error { return nil } -// SetComponentName sets the ComponentName field's value. -func (s *DescribeComponentConfigurationInput) SetComponentName(v string) *DescribeComponentConfigurationInput { - s.ComponentName = &v +// SetEndTime sets the EndTime field's value. +func (s *ListConfigurationHistoryInput) SetEndTime(v time.Time) *ListConfigurationHistoryInput { + s.EndTime = &v + return s +} + +// SetEventStatus sets the EventStatus field's value. +func (s *ListConfigurationHistoryInput) SetEventStatus(v string) *ListConfigurationHistoryInput { + s.EventStatus = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListConfigurationHistoryInput) SetMaxResults(v int64) *ListConfigurationHistoryInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListConfigurationHistoryInput) SetNextToken(v string) *ListConfigurationHistoryInput { + s.NextToken = &v return s } // SetResourceGroupName sets the ResourceGroupName field's value. -func (s *DescribeComponentConfigurationInput) SetResourceGroupName(v string) *DescribeComponentConfigurationInput { +func (s *ListConfigurationHistoryInput) SetResourceGroupName(v string) *ListConfigurationHistoryInput { s.ResourceGroupName = &v return s } -type DescribeComponentConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The configuration settings of the component. The value is the escaped JSON - // of the configuration. - ComponentConfiguration *string `type:"string"` +// SetStartTime sets the StartTime field's value. +func (s *ListConfigurationHistoryInput) SetStartTime(v time.Time) *ListConfigurationHistoryInput { + s.StartTime = &v + return s +} - // Indicates whether the application component is monitored. - Monitor *bool `type:"boolean"` +type ListConfigurationHistoryOutput struct { + _ struct{} `type:"structure"` - // The tier of the application component. Supported tiers include DOT_NET_WORKER, - // DOT_NET_WEB, SQL_SERVER, and DEFAULT - Tier *string `type:"string"` + // The list of configuration events and their corresponding details. + EventList []*ConfigurationEvent `type:"list"` + + // The NextToken value to include in a future ListConfigurationHistory request. + // When the results of a ListConfigurationHistory 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"` } // String returns the string representation -func (s DescribeComponentConfigurationOutput) String() string { +func (s ListConfigurationHistoryOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeComponentConfigurationOutput) GoString() string { +func (s ListConfigurationHistoryOutput) GoString() string { return s.String() } -// SetComponentConfiguration sets the ComponentConfiguration field's value. -func (s *DescribeComponentConfigurationOutput) SetComponentConfiguration(v string) *DescribeComponentConfigurationOutput { - s.ComponentConfiguration = &v - return s -} - -// SetMonitor sets the Monitor field's value. -func (s *DescribeComponentConfigurationOutput) SetMonitor(v bool) *DescribeComponentConfigurationOutput { - s.Monitor = &v +// SetEventList sets the EventList field's value. +func (s *ListConfigurationHistoryOutput) SetEventList(v []*ConfigurationEvent) *ListConfigurationHistoryOutput { + s.EventList = v return s } -// SetTier sets the Tier field's value. -func (s *DescribeComponentConfigurationOutput) SetTier(v string) *DescribeComponentConfigurationOutput { - s.Tier = &v +// SetNextToken sets the NextToken field's value. +func (s *ListConfigurationHistoryOutput) SetNextToken(v string) *ListConfigurationHistoryOutput { + s.NextToken = &v return s } -type DescribeComponentConfigurationRecommendationInput struct { +type ListLogPatternSetsInput struct { _ struct{} `type:"structure"` - // The name of the component. - // - // ComponentName is a required field - ComponentName *string `type:"string" required:"true"` + // 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:"1" type:"integer"` + + // The token to request the next page of results. + NextToken *string `type:"string"` // The name of the resource group. // // ResourceGroupName is a required field - ResourceGroupName *string `type:"string" required:"true"` - - // The tier of the application component. Supported tiers include DOT_NET_WORKER, - // DOT_NET_WEB, SQL_SERVER, and DEFAULT. - // - // Tier is a required field - Tier *string `type:"string" required:"true"` + ResourceGroupName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s DescribeComponentConfigurationRecommendationInput) String() string { +func (s ListLogPatternSetsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeComponentConfigurationRecommendationInput) GoString() string { +func (s ListLogPatternSetsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeComponentConfigurationRecommendationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeComponentConfigurationRecommendationInput"} - if s.ComponentName == nil { - invalidParams.Add(request.NewErrParamRequired("ComponentName")) +func (s *ListLogPatternSetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListLogPatternSetsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if s.ResourceGroupName == nil { invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) } - if s.Tier == nil { - invalidParams.Add(request.NewErrParamRequired("Tier")) + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) } if invalidParams.Len() > 0 { @@ -2244,81 +4545,110 @@ func (s *DescribeComponentConfigurationRecommendationInput) Validate() error { return nil } -// SetComponentName sets the ComponentName field's value. -func (s *DescribeComponentConfigurationRecommendationInput) SetComponentName(v string) *DescribeComponentConfigurationRecommendationInput { - s.ComponentName = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListLogPatternSetsInput) SetMaxResults(v int64) *ListLogPatternSetsInput { + s.MaxResults = &v return s } -// SetResourceGroupName sets the ResourceGroupName field's value. -func (s *DescribeComponentConfigurationRecommendationInput) SetResourceGroupName(v string) *DescribeComponentConfigurationRecommendationInput { - s.ResourceGroupName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListLogPatternSetsInput) SetNextToken(v string) *ListLogPatternSetsInput { + s.NextToken = &v return s } -// SetTier sets the Tier field's value. -func (s *DescribeComponentConfigurationRecommendationInput) SetTier(v string) *DescribeComponentConfigurationRecommendationInput { - s.Tier = &v +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *ListLogPatternSetsInput) SetResourceGroupName(v string) *ListLogPatternSetsInput { + s.ResourceGroupName = &v return s } -type DescribeComponentConfigurationRecommendationOutput struct { +type ListLogPatternSetsOutput struct { _ struct{} `type:"structure"` - // The recommended configuration settings of the component. The value is the - // escaped JSON of the configuration. - ComponentConfiguration *string `type:"string"` + // The list of log pattern sets. + LogPatternSets []*string `type:"list"` + + // The token used to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string `type:"string"` + + // The name of the resource group. + ResourceGroupName *string `min:"1" type:"string"` } // String returns the string representation -func (s DescribeComponentConfigurationRecommendationOutput) String() string { +func (s ListLogPatternSetsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeComponentConfigurationRecommendationOutput) GoString() string { +func (s ListLogPatternSetsOutput) GoString() string { return s.String() } -// SetComponentConfiguration sets the ComponentConfiguration field's value. -func (s *DescribeComponentConfigurationRecommendationOutput) SetComponentConfiguration(v string) *DescribeComponentConfigurationRecommendationOutput { - s.ComponentConfiguration = &v +// SetLogPatternSets sets the LogPatternSets field's value. +func (s *ListLogPatternSetsOutput) SetLogPatternSets(v []*string) *ListLogPatternSetsOutput { + s.LogPatternSets = v return s } -type DescribeComponentInput struct { +// SetNextToken sets the NextToken field's value. +func (s *ListLogPatternSetsOutput) SetNextToken(v string) *ListLogPatternSetsOutput { + s.NextToken = &v + return s +} + +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *ListLogPatternSetsOutput) SetResourceGroupName(v string) *ListLogPatternSetsOutput { + s.ResourceGroupName = &v + return s +} + +type ListLogPatternsInput struct { _ struct{} `type:"structure"` - // The name of the component. - // - // ComponentName is a required field - ComponentName *string `type:"string" required:"true"` + // 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:"1" type:"integer"` + + // The token to request the next page of results. + NextToken *string `type:"string"` + + // The name of the log pattern set. + PatternSetName *string `min:"1" type:"string"` // The name of the resource group. // // ResourceGroupName is a required field - ResourceGroupName *string `type:"string" required:"true"` + ResourceGroupName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s DescribeComponentInput) String() string { +func (s ListLogPatternsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeComponentInput) GoString() string { +func (s ListLogPatternsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeComponentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeComponentInput"} - if s.ComponentName == nil { - invalidParams.Add(request.NewErrParamRequired("ComponentName")) +func (s *ListLogPatternsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListLogPatternsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.PatternSetName != nil && len(*s.PatternSetName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PatternSetName", 1)) } if s.ResourceGroupName == nil { invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -2326,75 +4656,112 @@ func (s *DescribeComponentInput) Validate() error { return nil } -// SetComponentName sets the ComponentName field's value. -func (s *DescribeComponentInput) SetComponentName(v string) *DescribeComponentInput { - s.ComponentName = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListLogPatternsInput) SetMaxResults(v int64) *ListLogPatternsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListLogPatternsInput) SetNextToken(v string) *ListLogPatternsInput { + s.NextToken = &v + return s +} + +// SetPatternSetName sets the PatternSetName field's value. +func (s *ListLogPatternsInput) SetPatternSetName(v string) *ListLogPatternsInput { + s.PatternSetName = &v return s } // SetResourceGroupName sets the ResourceGroupName field's value. -func (s *DescribeComponentInput) SetResourceGroupName(v string) *DescribeComponentInput { +func (s *ListLogPatternsInput) SetResourceGroupName(v string) *ListLogPatternsInput { s.ResourceGroupName = &v return s } -type DescribeComponentOutput struct { +type ListLogPatternsOutput struct { _ struct{} `type:"structure"` - // Describes a standalone resource or similarly grouped resources that the application - // is made up of. - ApplicationComponent *ApplicationComponent `type:"structure"` + // The list of log patterns. + LogPatterns []*LogPattern `type:"list"` - // The list of resource ARNs that belong to the component. - ResourceList []*string `type:"list"` + // The token used to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string `type:"string"` + + // The name of the resource group. + ResourceGroupName *string `min:"1" type:"string"` } // String returns the string representation -func (s DescribeComponentOutput) String() string { +func (s ListLogPatternsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeComponentOutput) GoString() string { +func (s ListLogPatternsOutput) GoString() string { return s.String() } -// SetApplicationComponent sets the ApplicationComponent field's value. -func (s *DescribeComponentOutput) SetApplicationComponent(v *ApplicationComponent) *DescribeComponentOutput { - s.ApplicationComponent = v +// SetLogPatterns sets the LogPatterns field's value. +func (s *ListLogPatternsOutput) SetLogPatterns(v []*LogPattern) *ListLogPatternsOutput { + s.LogPatterns = v return s } -// SetResourceList sets the ResourceList field's value. -func (s *DescribeComponentOutput) SetResourceList(v []*string) *DescribeComponentOutput { - s.ResourceList = v +// SetNextToken sets the NextToken field's value. +func (s *ListLogPatternsOutput) SetNextToken(v string) *ListLogPatternsOutput { + s.NextToken = &v return s } -type DescribeObservationInput struct { +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *ListLogPatternsOutput) SetResourceGroupName(v string) *ListLogPatternsOutput { + s.ResourceGroupName = &v + return s +} + +type ListProblemsInput struct { _ struct{} `type:"structure"` - // The ID of the observation. - // - // ObservationId is a required field - ObservationId *string `type:"string" required:"true"` + // The time when the problem ended, in epoch seconds. If not specified, problems + // within the past seven days are returned. + EndTime *time.Time `type:"timestamp"` + + // 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:"1" type:"integer"` + + // The token to request the next page of results. + NextToken *string `type:"string"` + + // The name of the resource group. + ResourceGroupName *string `min:"1" type:"string"` + + // The time when the problem was detected, in epoch seconds. If you don't specify + // a time frame for the request, problems within the past seven days are returned. + StartTime *time.Time `type:"timestamp"` } // String returns the string representation -func (s DescribeObservationInput) String() string { +func (s ListProblemsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeObservationInput) GoString() string { +func (s ListProblemsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeObservationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeObservationInput"} - if s.ObservationId == nil { - invalidParams.Add(request.NewErrParamRequired("ObservationId")) +func (s *ListProblemsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListProblemsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) } if invalidParams.Len() > 0 { @@ -2403,97 +4770,97 @@ func (s *DescribeObservationInput) Validate() error { return nil } -// SetObservationId sets the ObservationId field's value. -func (s *DescribeObservationInput) SetObservationId(v string) *DescribeObservationInput { - s.ObservationId = &v +// SetEndTime sets the EndTime field's value. +func (s *ListProblemsInput) SetEndTime(v time.Time) *ListProblemsInput { + s.EndTime = &v return s } -type DescribeObservationOutput struct { - _ struct{} `type:"structure"` - - // Information about the observation. - Observation *Observation `type:"structure"` +// SetMaxResults sets the MaxResults field's value. +func (s *ListProblemsInput) SetMaxResults(v int64) *ListProblemsInput { + s.MaxResults = &v + return s } -// String returns the string representation -func (s DescribeObservationOutput) String() string { - return awsutil.Prettify(s) +// SetNextToken sets the NextToken field's value. +func (s *ListProblemsInput) SetNextToken(v string) *ListProblemsInput { + s.NextToken = &v + return s } -// GoString returns the string representation -func (s DescribeObservationOutput) GoString() string { - return s.String() +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *ListProblemsInput) SetResourceGroupName(v string) *ListProblemsInput { + s.ResourceGroupName = &v + return s } -// SetObservation sets the Observation field's value. -func (s *DescribeObservationOutput) SetObservation(v *Observation) *DescribeObservationOutput { - s.Observation = v +// SetStartTime sets the StartTime field's value. +func (s *ListProblemsInput) SetStartTime(v time.Time) *ListProblemsInput { + s.StartTime = &v return s } -type DescribeProblemInput struct { +type ListProblemsOutput struct { _ struct{} `type:"structure"` - // The ID of the problem. - // - // ProblemId is a required field - ProblemId *string `type:"string" required:"true"` + // The token used to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string `type:"string"` + + // The list of problems. + ProblemList []*Problem `type:"list"` } // String returns the string representation -func (s DescribeProblemInput) String() string { +func (s ListProblemsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeProblemInput) GoString() string { +func (s ListProblemsOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeProblemInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeProblemInput"} - if s.ProblemId == nil { - invalidParams.Add(request.NewErrParamRequired("ProblemId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetNextToken sets the NextToken field's value. +func (s *ListProblemsOutput) SetNextToken(v string) *ListProblemsOutput { + s.NextToken = &v + return s } -// SetProblemId sets the ProblemId field's value. -func (s *DescribeProblemInput) SetProblemId(v string) *DescribeProblemInput { - s.ProblemId = &v +// SetProblemList sets the ProblemList field's value. +func (s *ListProblemsOutput) SetProblemList(v []*Problem) *ListProblemsOutput { + s.ProblemList = v return s } -type DescribeProblemObservationsInput struct { +type ListTagsForResourceInput struct { _ struct{} `type:"structure"` - // The ID of the problem. + // The Amazon Resource Name (ARN) of the application that you want to retrieve + // tag information for. // - // ProblemId is a required field - ProblemId *string `type:"string" required:"true"` + // ResourceARN is a required field + ResourceARN *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s DescribeProblemObservationsInput) String() string { +func (s ListTagsForResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeProblemObservationsInput) GoString() string { +func (s ListTagsForResourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeProblemObservationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeProblemObservationsInput"} - if s.ProblemId == nil { - invalidParams.Add(request.NewErrParamRequired("ProblemId")) +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 { @@ -2502,599 +4869,819 @@ func (s *DescribeProblemObservationsInput) Validate() error { return nil } -// SetProblemId sets the ProblemId field's value. -func (s *DescribeProblemObservationsInput) SetProblemId(v string) *DescribeProblemObservationsInput { - s.ProblemId = &v +// SetResourceARN sets the ResourceARN field's value. +func (s *ListTagsForResourceInput) SetResourceARN(v string) *ListTagsForResourceInput { + s.ResourceARN = &v return s } -type DescribeProblemObservationsOutput struct { +type ListTagsForResourceOutput struct { _ struct{} `type:"structure"` - // Observations related to the problem. - RelatedObservations *RelatedObservations `type:"structure"` + // An array that lists all the tags that are associated with the application. + // Each tag consists of a required tag key (Key) and an associated tag value + // (Value). + Tags []*Tag `type:"list"` } // String returns the string representation -func (s DescribeProblemObservationsOutput) String() string { +func (s ListTagsForResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeProblemObservationsOutput) GoString() string { +func (s ListTagsForResourceOutput) GoString() string { return s.String() } -// SetRelatedObservations sets the RelatedObservations field's value. -func (s *DescribeProblemObservationsOutput) SetRelatedObservations(v *RelatedObservations) *DescribeProblemObservationsOutput { - s.RelatedObservations = v +// SetTags sets the Tags field's value. +func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { + s.Tags = v return s } -type DescribeProblemOutput struct { +// An object that defines the log patterns that belongs to a LogPatternSet. +type LogPattern struct { _ struct{} `type:"structure"` - // Information about the problem. - Problem *Problem `type:"structure"` + // A regular expression that defines the log pattern. A log pattern can contains + // at many as 50 characters, and it cannot be empty. + Pattern *string `min:"1" type:"string"` + + // The name of the log pattern. A log pattern name can contains at many as 50 + // characters, and it cannot be empty. The characters can be Unicode letters, + // digits or one of the following symbols: period, dash, underscore. + PatternName *string `min:"1" type:"string"` + + // The name of the log pattern. A log pattern name can contains at many as 30 + // characters, and it cannot be empty. The characters can be Unicode letters, + // digits or one of the following symbols: period, dash, underscore. + PatternSetName *string `min:"1" type:"string"` + + // Rank of the log pattern. + Rank *int64 `type:"integer"` } // String returns the string representation -func (s DescribeProblemOutput) String() string { +func (s LogPattern) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeProblemOutput) GoString() string { +func (s LogPattern) GoString() string { return s.String() } -// SetProblem sets the Problem field's value. -func (s *DescribeProblemOutput) SetProblem(v *Problem) *DescribeProblemOutput { - s.Problem = v +// SetPattern sets the Pattern field's value. +func (s *LogPattern) SetPattern(v string) *LogPattern { + s.Pattern = &v return s } -type ListApplicationsInput struct { +// SetPatternName sets the PatternName field's value. +func (s *LogPattern) SetPatternName(v string) *LogPattern { + s.PatternName = &v + return s +} + +// SetPatternSetName sets the PatternSetName field's value. +func (s *LogPattern) SetPatternSetName(v string) *LogPattern { + s.PatternSetName = &v + return s +} + +// SetRank sets the Rank field's value. +func (s *LogPattern) SetRank(v int64) *LogPattern { + s.Rank = &v + return s +} + +// Describes an anomaly or error with the application. +type Observation struct { _ struct{} `type:"structure"` - // 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:"1" type:"integer"` + // The time when the observation ended, in epoch seconds. + EndTime *time.Time `type:"timestamp"` - // The token to request the next page of results. - NextToken *string `type:"string"` + // The ID of the observation type. + Id *string `min:"38" type:"string"` + + // The timestamp in the CloudWatch Logs that specifies when the matched line + // occurred. + LineTime *time.Time `type:"timestamp"` + + // The log filter of the observation. + LogFilter *string `type:"string" enum:"LogFilter"` + + // The log group name. + LogGroup *string `type:"string"` + + // The log text of the observation. + LogText *string `type:"string"` + + // The name of the observation metric. + MetricName *string `type:"string"` + + // The namespace of the observation metric. + MetricNamespace *string `type:"string"` + + // The source resource ARN of the observation. + SourceARN *string `type:"string"` + + // The source type of the observation. + SourceType *string `type:"string"` + + // The time when the observation was first detected, in epoch seconds. + StartTime *time.Time `type:"timestamp"` + + // The unit of the source observation metric. + Unit *string `type:"string"` + + // The value of the source observation metric. + Value *float64 `type:"double"` } // String returns the string representation -func (s ListApplicationsInput) String() string { +func (s Observation) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListApplicationsInput) GoString() string { +func (s Observation) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListApplicationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListApplicationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } +// SetEndTime sets the EndTime field's value. +func (s *Observation) SetEndTime(v time.Time) *Observation { + s.EndTime = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetId sets the Id field's value. +func (s *Observation) SetId(v string) *Observation { + s.Id = &v + return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListApplicationsInput) SetMaxResults(v int64) *ListApplicationsInput { - s.MaxResults = &v +// SetLineTime sets the LineTime field's value. +func (s *Observation) SetLineTime(v time.Time) *Observation { + s.LineTime = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListApplicationsInput) SetNextToken(v string) *ListApplicationsInput { - s.NextToken = &v +// SetLogFilter sets the LogFilter field's value. +func (s *Observation) SetLogFilter(v string) *Observation { + s.LogFilter = &v return s } -type ListApplicationsOutput struct { - _ struct{} `type:"structure"` +// SetLogGroup sets the LogGroup field's value. +func (s *Observation) SetLogGroup(v string) *Observation { + s.LogGroup = &v + return s +} - // The list of applications. - ApplicationInfoList []*ApplicationInfo `type:"list"` +// SetLogText sets the LogText field's value. +func (s *Observation) SetLogText(v string) *Observation { + s.LogText = &v + return s +} - // The token used to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string `type:"string"` +// SetMetricName sets the MetricName field's value. +func (s *Observation) SetMetricName(v string) *Observation { + s.MetricName = &v + return s } -// String returns the string representation -func (s ListApplicationsOutput) String() string { - return awsutil.Prettify(s) +// SetMetricNamespace sets the MetricNamespace field's value. +func (s *Observation) SetMetricNamespace(v string) *Observation { + s.MetricNamespace = &v + return s } -// GoString returns the string representation -func (s ListApplicationsOutput) GoString() string { - return s.String() +// SetSourceARN sets the SourceARN field's value. +func (s *Observation) SetSourceARN(v string) *Observation { + s.SourceARN = &v + return s } -// SetApplicationInfoList sets the ApplicationInfoList field's value. -func (s *ListApplicationsOutput) SetApplicationInfoList(v []*ApplicationInfo) *ListApplicationsOutput { - s.ApplicationInfoList = v +// SetSourceType sets the SourceType field's value. +func (s *Observation) SetSourceType(v string) *Observation { + s.SourceType = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListApplicationsOutput) SetNextToken(v string) *ListApplicationsOutput { - s.NextToken = &v +// SetStartTime sets the StartTime field's value. +func (s *Observation) SetStartTime(v time.Time) *Observation { + s.StartTime = &v return s } -type ListComponentsInput struct { +// SetUnit sets the Unit field's value. +func (s *Observation) SetUnit(v string) *Observation { + s.Unit = &v + return s +} + +// SetValue sets the Value field's value. +func (s *Observation) SetValue(v float64) *Observation { + s.Value = &v + return s +} + +// Describes a problem that is detected by correlating observations. +type Problem struct { _ struct{} `type:"structure"` - // 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:"1" type:"integer"` + // The resource affected by the problem. + AffectedResource *string `type:"string"` - // The token to request the next page of results. - NextToken *string `type:"string"` + // The time when the problem ended, in epoch seconds. + EndTime *time.Time `type:"timestamp"` - // The name of the resource group. - // - // ResourceGroupName is a required field - ResourceGroupName *string `type:"string" required:"true"` + // Feedback provided by the user about the problem. + Feedback map[string]*string `type:"map"` + + // The ID of the problem. + Id *string `min:"38" type:"string"` + + // A detailed analysis of the problem using machine learning. + Insights *string `type:"string"` + + // The name of the resource group affected by the problem. + ResourceGroupName *string `min:"1" type:"string"` + + // A measure of the level of impact of the problem. + SeverityLevel *string `type:"string" enum:"SeverityLevel"` + + // The time when the problem started, in epoch seconds. + StartTime *time.Time `type:"timestamp"` + + // The status of the problem. + Status *string `type:"string" enum:"Status"` + + // The name of the problem. + Title *string `type:"string"` } // String returns the string representation -func (s ListComponentsInput) String() string { +func (s Problem) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListComponentsInput) GoString() string { +func (s Problem) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListComponentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListComponentsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.ResourceGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) - } +// SetAffectedResource sets the AffectedResource field's value. +func (s *Problem) SetAffectedResource(v string) *Problem { + s.AffectedResource = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *Problem) SetEndTime(v time.Time) *Problem { + s.EndTime = &v + return s +} + +// SetFeedback sets the Feedback field's value. +func (s *Problem) SetFeedback(v map[string]*string) *Problem { + s.Feedback = v + return s +} + +// SetId sets the Id field's value. +func (s *Problem) SetId(v string) *Problem { + s.Id = &v + return s +} + +// SetInsights sets the Insights field's value. +func (s *Problem) SetInsights(v string) *Problem { + s.Insights = &v + return s +} + +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *Problem) SetResourceGroupName(v string) *Problem { + s.ResourceGroupName = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetSeverityLevel sets the SeverityLevel field's value. +func (s *Problem) SetSeverityLevel(v string) *Problem { + s.SeverityLevel = &v + return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListComponentsInput) SetMaxResults(v int64) *ListComponentsInput { - s.MaxResults = &v +// SetStartTime sets the StartTime field's value. +func (s *Problem) SetStartTime(v time.Time) *Problem { + s.StartTime = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListComponentsInput) SetNextToken(v string) *ListComponentsInput { - s.NextToken = &v +// SetStatus sets the Status field's value. +func (s *Problem) SetStatus(v string) *Problem { + s.Status = &v return s } -// SetResourceGroupName sets the ResourceGroupName field's value. -func (s *ListComponentsInput) SetResourceGroupName(v string) *ListComponentsInput { - s.ResourceGroupName = &v +// SetTitle sets the Title field's value. +func (s *Problem) SetTitle(v string) *Problem { + s.Title = &v return s } -type ListComponentsOutput struct { +// Describes observations related to the problem. +type RelatedObservations struct { _ struct{} `type:"structure"` - // The list of application components. - ApplicationComponentList []*ApplicationComponent `type:"list"` - - // The token to request the next page of results. - NextToken *string `type:"string"` + // The list of observations related to the problem. + ObservationList []*Observation `type:"list"` } // String returns the string representation -func (s ListComponentsOutput) String() string { +func (s RelatedObservations) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListComponentsOutput) GoString() string { +func (s RelatedObservations) GoString() string { return s.String() } -// SetApplicationComponentList sets the ApplicationComponentList field's value. -func (s *ListComponentsOutput) SetApplicationComponentList(v []*ApplicationComponent) *ListComponentsOutput { - s.ApplicationComponentList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListComponentsOutput) SetNextToken(v string) *ListComponentsOutput { - s.NextToken = &v +// SetObservationList sets the ObservationList field's value. +func (s *RelatedObservations) SetObservationList(v []*Observation) *RelatedObservations { + s.ObservationList = v return s } -type ListProblemsInput struct { - _ struct{} `type:"structure"` - - // The time when the problem ended, in epoch seconds. If not specified, problems - // within the past seven days are returned. - EndTime *time.Time `type:"timestamp"` - - // 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:"1" type:"integer"` - - // The token to request the next page of results. - NextToken *string `type:"string"` - - // The name of the resource group. - ResourceGroupName *string `type:"string"` +// The resource is already created or in use. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The time when the problem was detected, in epoch seconds. If you don't specify - // a time frame for the request, problems within the past seven days are returned. - StartTime *time.Time `type:"timestamp"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s ListProblemsInput) String() string { +func (s ResourceInUseException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListProblemsInput) GoString() string { +func (s ResourceInUseException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListProblemsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListProblemsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, } - return nil } -// SetEndTime sets the EndTime field's value. -func (s *ListProblemsInput) SetEndTime(v time.Time) *ListProblemsInput { - s.EndTime = &v - return s +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" } -// SetMaxResults sets the MaxResults field's value. -func (s *ListProblemsInput) SetMaxResults(v int64) *ListProblemsInput { - s.MaxResults = &v - return s +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetNextToken sets the NextToken field's value. -func (s *ListProblemsInput) SetNextToken(v string) *ListProblemsInput { - s.NextToken = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil } -// SetResourceGroupName sets the ResourceGroupName field's value. -func (s *ListProblemsInput) SetResourceGroupName(v string) *ListProblemsInput { - s.ResourceGroupName = &v - return s +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetStartTime sets the StartTime field's value. -func (s *ListProblemsInput) SetStartTime(v time.Time) *ListProblemsInput { - s.StartTime = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode } -type ListProblemsOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} - // The token used to retrieve the next page of results. This value is null when - // there are no more results to return. - NextToken *string `type:"string"` +// The resource does not exist in the customer account. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The list of problems. - ProblemList []*Problem `type:"list"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s ListProblemsOutput) String() string { +func (s ResourceNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListProblemsOutput) GoString() string { +func (s ResourceNotFoundException) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListProblemsOutput) SetNextToken(v string) *ListProblemsOutput { - s.NextToken = &v - return s +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } } -// SetProblemList sets the ProblemList field's value. -func (s *ListProblemsOutput) SetProblemList(v []*Problem) *ListProblemsOutput { - s.ProblemList = v - return s +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" } -// Describes an anomaly or error with the application. -type Observation struct { - _ struct{} `type:"structure"` - - // The time when the observation ended, in epoch seconds. - EndTime *time.Time `type:"timestamp"` - - // The ID of the observation type. - Id *string `type:"string"` - - // The timestamp in the CloudWatch Logs that specifies when the matched line - // occurred. - LineTime *time.Time `type:"timestamp"` - - // The log filter of the observation. - LogFilter *string `type:"string" enum:"LogFilter"` - - // The log group name. - LogGroup *string `type:"string"` - - // The log text of the observation. - LogText *string `type:"string"` +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The name of the observation metric. - MetricName *string `type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} - // The namespace of the observation metric. - MetricNamespace *string `type:"string"` +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The source resource ARN of the observation. - SourceARN *string `type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The source type of the observation. - SourceType *string `type:"string"` +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} - // The time when the observation was first detected, in epoch seconds. - StartTime *time.Time `type:"timestamp"` +// An object that defines the tags associated with an application. A tag is +// a label that you optionally define and associate with an application. Tags +// can help you categorize and manage resources in different ways, such as by +// purpose, owner, environment, or other criteria. +// +// Each tag consists of a required tag key and an associated tag value, both +// of which you define. A tag key is a general label that acts as a category +// for a more specific tag value. A tag value acts as a descriptor within a +// tag key. A tag key can contain as many as 128 characters. A tag value can +// contain as many as 256 characters. The characters can be Unicode letters, +// digits, white space, or one of the following symbols: _ . : / = + -. The +// following additional restrictions apply to tags: +// +// * Tag keys and values are case sensitive. +// +// * For each associated resource, each tag key must be unique and it can +// have only one value. +// +// * The aws: prefix is reserved for use by AWS; you can’t use it in any +// tag keys or values that you define. In addition, you can't edit or remove +// tag keys or values that use this prefix. +type Tag struct { + _ struct{} `type:"structure"` - // The unit of the source observation metric. - Unit *string `type:"string"` + // One part of a key-value pair that defines a tag. The maximum length of a + // tag key is 128 characters. The minimum length is 1 character. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` - // The value of the source observation metric. - Value *float64 `type:"double"` + // The optional part of a key-value pair that defines a tag. The maximum length + // of a tag value is 256 characters. The minimum length is 0 characters. If + // you don't want an application to have a specific tag value, don't specify + // a value for this parameter. + // + // Value is a required field + Value *string `type:"string" required:"true"` } // String returns the string representation -func (s Observation) String() string { +func (s Tag) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Observation) GoString() string { +func (s Tag) GoString() string { return s.String() } -// SetEndTime sets the EndTime field's value. -func (s *Observation) SetEndTime(v time.Time) *Observation { - s.EndTime = &v - return s +// 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 } -// SetId sets the Id field's value. -func (s *Observation) SetId(v string) *Observation { - s.Id = &v +// SetKey sets the Key field's value. +func (s *Tag) SetKey(v string) *Tag { + s.Key = &v return s } -// SetLineTime sets the LineTime field's value. -func (s *Observation) SetLineTime(v time.Time) *Observation { - s.LineTime = &v +// SetValue sets the Value field's value. +func (s *Tag) SetValue(v string) *Tag { + s.Value = &v return s } -// SetLogFilter sets the LogFilter field's value. -func (s *Observation) SetLogFilter(v string) *Observation { - s.LogFilter = &v - return s +type TagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the application that you want to add one + // or more tags to. + // + // ResourceARN is a required field + ResourceARN *string `min:"1" type:"string" required:"true"` + + // A list of tags that to add to the application. A tag consists of a required + // tag key (Key) and an associated tag value (Value). The maximum length of + // a tag key is 128 characters. The maximum length of a tag value is 256 characters. + // + // Tags is a required field + Tags []*Tag `type:"list" required:"true"` } -// SetLogGroup sets the LogGroup field's value. -func (s *Observation) SetLogGroup(v string) *Observation { - s.LogGroup = &v - return s +// String returns the string representation +func (s TagResourceInput) String() string { + return awsutil.Prettify(s) } -// SetLogText sets the LogText field's value. -func (s *Observation) SetLogText(v string) *Observation { - s.LogText = &v - return s +// GoString returns the string representation +func (s TagResourceInput) GoString() string { + return s.String() } -// SetMetricName sets the MetricName field's value. -func (s *Observation) SetMetricName(v string) *Observation { - s.MetricName = &v - return s +// 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 } -// SetMetricNamespace sets the MetricNamespace field's value. -func (s *Observation) SetMetricNamespace(v string) *Observation { - s.MetricNamespace = &v +// SetResourceARN sets the ResourceARN field's value. +func (s *TagResourceInput) SetResourceARN(v string) *TagResourceInput { + s.ResourceARN = &v return s } -// SetSourceARN sets the SourceARN field's value. -func (s *Observation) SetSourceARN(v string) *Observation { - s.SourceARN = &v +// SetTags sets the Tags field's value. +func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { + s.Tags = v return s } -// SetSourceType sets the SourceType field's value. -func (s *Observation) SetSourceType(v string) *Observation { - s.SourceType = &v - return s +type TagResourceOutput struct { + _ struct{} `type:"structure"` } -// SetStartTime sets the StartTime field's value. -func (s *Observation) SetStartTime(v time.Time) *Observation { - s.StartTime = &v - return s +// 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() } -// SetUnit sets the Unit field's value. -func (s *Observation) SetUnit(v string) *Observation { - s.Unit = &v - return s +// Tags are already registered for the specified application ARN. +type TagsAlreadyExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` } -// SetValue sets the Value field's value. -func (s *Observation) SetValue(v float64) *Observation { - s.Value = &v - return s +// String returns the string representation +func (s TagsAlreadyExistException) String() string { + return awsutil.Prettify(s) } -// Describes a problem that is detected by correlating observations. -type Problem struct { - _ struct{} `type:"structure"` +// GoString returns the string representation +func (s TagsAlreadyExistException) GoString() string { + return s.String() +} - // The resource affected by the problem. - AffectedResource *string `type:"string"` +func newErrorTagsAlreadyExistException(v protocol.ResponseMetadata) error { + return &TagsAlreadyExistException{ + respMetadata: v, + } +} - // The time when the problem ended, in epoch seconds. - EndTime *time.Time `type:"timestamp"` +// Code returns the exception type name. +func (s TagsAlreadyExistException) Code() string { + return "TagsAlreadyExistException" +} - // Feedback provided by the user about the problem. - Feedback map[string]*string `type:"map"` +// Message returns the exception's message. +func (s TagsAlreadyExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The ID of the problem. - Id *string `type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagsAlreadyExistException) OrigErr() error { + return nil +} - // A detailed analysis of the problem using machine learning. - Insights *string `type:"string"` +func (s TagsAlreadyExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The name of the resource group affected by the problem. - ResourceGroupName *string `type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s TagsAlreadyExistException) StatusCode() int { + return s.respMetadata.StatusCode +} - // A measure of the level of impact of the problem. - SeverityLevel *string `type:"string" enum:"SeverityLevel"` +// RequestID returns the service's response RequestID for request. +func (s TagsAlreadyExistException) RequestID() string { + return s.respMetadata.RequestID +} - // The time when the problem started, in epoch seconds. - StartTime *time.Time `type:"timestamp"` +// The number of the provided tags is beyond the limit, or the number of total +// tags you are trying to attach to the specified resource exceeds the limit. +type TooManyTagsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The status of the problem. - Status *string `type:"string" enum:"Status"` + Message_ *string `locationName:"Message" type:"string"` - // The name of the problem. - Title *string `type:"string"` + // The name of the resource with too many tags. + ResourceName *string `min:"1" type:"string"` } // String returns the string representation -func (s Problem) String() string { +func (s TooManyTagsException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Problem) GoString() string { +func (s TooManyTagsException) GoString() string { return s.String() } -// SetAffectedResource sets the AffectedResource field's value. -func (s *Problem) SetAffectedResource(v string) *Problem { - s.AffectedResource = &v - return s +func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { + return &TooManyTagsException{ + respMetadata: v, + } } -// SetEndTime sets the EndTime field's value. -func (s *Problem) SetEndTime(v time.Time) *Problem { - s.EndTime = &v - return s +// Code returns the exception type name. +func (s TooManyTagsException) Code() string { + return "TooManyTagsException" } -// SetFeedback sets the Feedback field's value. -func (s *Problem) SetFeedback(v map[string]*string) *Problem { - s.Feedback = v - return s +// Message returns the exception's message. +func (s TooManyTagsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetId sets the Id field's value. -func (s *Problem) SetId(v string) *Problem { - s.Id = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTagsException) OrigErr() error { + return nil } -// SetInsights sets the Insights field's value. -func (s *Problem) SetInsights(v string) *Problem { - s.Insights = &v - return s +func (s TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetResourceGroupName sets the ResourceGroupName field's value. -func (s *Problem) SetResourceGroupName(v string) *Problem { - s.ResourceGroupName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTagsException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetSeverityLevel sets the SeverityLevel field's value. -func (s *Problem) SetSeverityLevel(v string) *Problem { - s.SeverityLevel = &v - return s +// RequestID returns the service's response RequestID for request. +func (s TooManyTagsException) RequestID() string { + return s.respMetadata.RequestID } -// SetStartTime sets the StartTime field's value. -func (s *Problem) SetStartTime(v time.Time) *Problem { - s.StartTime = &v - return s +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the application that you want to remove + // one or more tags from. + // + // ResourceARN is a required field + ResourceARN *string `min:"1" type:"string" required:"true"` + + // The tags (tag keys) that you want to remove from the resource. When you specify + // a tag key, the action removes both that key and its associated tag value. + // + // To remove more than one tag from the application, append the TagKeys parameter + // and argument for each additional tag to remove, separated by an ampersand. + // + // TagKeys is a required field + TagKeys []*string `type:"list" required:"true"` } -// SetStatus sets the Status field's value. -func (s *Problem) SetStatus(v string) *Problem { - s.Status = &v +// 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 } -// SetTitle sets the Title field's value. -func (s *Problem) SetTitle(v string) *Problem { - s.Title = &v +// SetTagKeys sets the TagKeys field's value. +func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { + s.TagKeys = v return s } -// Describes observations related to the problem. -type RelatedObservations struct { +type UntagResourceOutput struct { _ struct{} `type:"structure"` - - // The list of observations related to the problem. - ObservationList []*Observation `type:"list"` } // String returns the string representation -func (s RelatedObservations) String() string { +func (s UntagResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RelatedObservations) GoString() string { +func (s UntagResourceOutput) GoString() string { return s.String() } -// SetObservationList sets the ObservationList field's value. -func (s *RelatedObservations) SetObservationList(v []*Observation) *RelatedObservations { - s.ObservationList = v - return s -} - type UpdateApplicationInput struct { _ struct{} `type:"structure"` @@ -3103,7 +5690,7 @@ type UpdateApplicationInput struct { // The SNS topic provided to Application Insights that is associated to the // created opsItem. Allows you to receive notifications for updates to the opsItem. - OpsItemSNSTopicArn *string `type:"string"` + OpsItemSNSTopicArn *string `min:"20" type:"string"` // Disassociates the SNS topic from the opsItem created for detected problems. RemoveSNSTopic *bool `type:"boolean"` @@ -3111,7 +5698,7 @@ type UpdateApplicationInput struct { // The name of the resource group. // // ResourceGroupName is a required field - ResourceGroupName *string `type:"string" required:"true"` + ResourceGroupName *string `min:"1" type:"string" required:"true"` } // String returns the string representation @@ -3127,9 +5714,15 @@ func (s UpdateApplicationInput) GoString() 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.OpsItemSNSTopicArn != nil && len(*s.OpsItemSNSTopicArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("OpsItemSNSTopicArn", 20)) + } if s.ResourceGroupName == nil { invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -3191,8 +5784,9 @@ type UpdateComponentConfigurationInput struct { // of the configuration. For more information about the JSON format, see Working // with JSON (https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/working-with-json.html). // You can send a request to DescribeComponentConfigurationRecommendation to - // see the recommended configuration for a component. - ComponentConfiguration *string `type:"string"` + // see the recommended configuration for a component. For the complete format + // of the component configuration file, see Component Configuration (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/component-config.html). + ComponentConfiguration *string `min:"1" type:"string"` // The name of the component. // @@ -3205,11 +5799,11 @@ type UpdateComponentConfigurationInput struct { // The name of the resource group. // // ResourceGroupName is a required field - ResourceGroupName *string `type:"string" required:"true"` + ResourceGroupName *string `min:"1" type:"string" required:"true"` // The tier of the application component. Supported tiers include DOT_NET_WORKER, - // DOT_NET_WEB, SQL_SERVER, and DEFAULT. - Tier *string `type:"string"` + // DOT_NET_WEB, DOT_NET_CORE, SQL_SERVER, and DEFAULT. + Tier *string `min:"1" type:"string" enum:"Tier"` } // String returns the string representation @@ -3225,12 +5819,21 @@ func (s UpdateComponentConfigurationInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *UpdateComponentConfigurationInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "UpdateComponentConfigurationInput"} + if s.ComponentConfiguration != nil && len(*s.ComponentConfiguration) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ComponentConfiguration", 1)) + } if s.ComponentName == nil { invalidParams.Add(request.NewErrParamRequired("ComponentName")) } if s.ResourceGroupName == nil { invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } + if s.Tier != nil && len(*s.Tier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tier", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -3296,7 +5899,7 @@ type UpdateComponentInput struct { // The name of the resource group. // // ResourceGroupName is a required field - ResourceGroupName *string `type:"string" required:"true"` + ResourceGroupName *string `min:"1" type:"string" required:"true"` // The list of resource ARNs that belong to the component. ResourceList []*string `type:"list"` @@ -3321,6 +5924,9 @@ func (s *UpdateComponentInput) Validate() error { if s.ResourceGroupName == nil { invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -3366,6 +5972,212 @@ func (s UpdateComponentOutput) GoString() string { return s.String() } +type UpdateLogPatternInput struct { + _ struct{} `type:"structure"` + + // The log pattern. + Pattern *string `min:"1" type:"string"` + + // The name of the log pattern. + // + // PatternName is a required field + PatternName *string `min:"1" type:"string" required:"true"` + + // The name of the log pattern set. + // + // PatternSetName is a required field + PatternSetName *string `min:"1" type:"string" required:"true"` + + // Rank of the log pattern. + Rank *int64 `type:"integer"` + + // The name of the resource group. + // + // ResourceGroupName is a required field + ResourceGroupName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateLogPatternInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateLogPatternInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateLogPatternInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateLogPatternInput"} + if s.Pattern != nil && len(*s.Pattern) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Pattern", 1)) + } + if s.PatternName == nil { + invalidParams.Add(request.NewErrParamRequired("PatternName")) + } + if s.PatternName != nil && len(*s.PatternName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PatternName", 1)) + } + if s.PatternSetName == nil { + invalidParams.Add(request.NewErrParamRequired("PatternSetName")) + } + if s.PatternSetName != nil && len(*s.PatternSetName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PatternSetName", 1)) + } + if s.ResourceGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceGroupName")) + } + if s.ResourceGroupName != nil && len(*s.ResourceGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceGroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPattern sets the Pattern field's value. +func (s *UpdateLogPatternInput) SetPattern(v string) *UpdateLogPatternInput { + s.Pattern = &v + return s +} + +// SetPatternName sets the PatternName field's value. +func (s *UpdateLogPatternInput) SetPatternName(v string) *UpdateLogPatternInput { + s.PatternName = &v + return s +} + +// SetPatternSetName sets the PatternSetName field's value. +func (s *UpdateLogPatternInput) SetPatternSetName(v string) *UpdateLogPatternInput { + s.PatternSetName = &v + return s +} + +// SetRank sets the Rank field's value. +func (s *UpdateLogPatternInput) SetRank(v int64) *UpdateLogPatternInput { + s.Rank = &v + return s +} + +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *UpdateLogPatternInput) SetResourceGroupName(v string) *UpdateLogPatternInput { + s.ResourceGroupName = &v + return s +} + +type UpdateLogPatternOutput struct { + _ struct{} `type:"structure"` + + // The successfully created log pattern. + LogPattern *LogPattern `type:"structure"` + + // The name of the resource group. + ResourceGroupName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateLogPatternOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateLogPatternOutput) GoString() string { + return s.String() +} + +// SetLogPattern sets the LogPattern field's value. +func (s *UpdateLogPatternOutput) SetLogPattern(v *LogPattern) *UpdateLogPatternOutput { + s.LogPattern = v + return s +} + +// SetResourceGroupName sets the ResourceGroupName field's value. +func (s *UpdateLogPatternOutput) SetResourceGroupName(v string) *UpdateLogPatternOutput { + s.ResourceGroupName = &v + return s +} + +// The parameter is not valid. +type ValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationException) GoString() string { + return s.String() +} + +func newErrorValidationException(v protocol.ResponseMetadata) error { + return &ValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ValidationException) Code() string { + return "ValidationException" +} + +// Message returns the exception's message. +func (s ValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ValidationException) OrigErr() error { + return nil +} + +func (s ValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ValidationException) RequestID() string { + return s.respMetadata.RequestID +} + +const ( + // ConfigurationEventResourceTypeCloudwatchAlarm is a ConfigurationEventResourceType enum value + ConfigurationEventResourceTypeCloudwatchAlarm = "CLOUDWATCH_ALARM" + + // ConfigurationEventResourceTypeCloudformation is a ConfigurationEventResourceType enum value + ConfigurationEventResourceTypeCloudformation = "CLOUDFORMATION" + + // ConfigurationEventResourceTypeSsmAssociation is a ConfigurationEventResourceType enum value + ConfigurationEventResourceTypeSsmAssociation = "SSM_ASSOCIATION" +) + +const ( + // ConfigurationEventStatusInfo is a ConfigurationEventStatus enum value + ConfigurationEventStatusInfo = "INFO" + + // ConfigurationEventStatusWarn is a ConfigurationEventStatus enum value + ConfigurationEventStatusWarn = "WARN" + + // ConfigurationEventStatusError is a ConfigurationEventStatus enum value + ConfigurationEventStatusError = "ERROR" +) + const ( // FeedbackKeyInsightsFeedback is a FeedbackKey enum value FeedbackKeyInsightsFeedback = "INSIGHTS_FEEDBACK" @@ -3395,13 +6207,13 @@ const ( const ( // SeverityLevelLow is a SeverityLevel enum value - SeverityLevelLow = "LOW" + SeverityLevelLow = "Low" // SeverityLevelMedium is a SeverityLevel enum value - SeverityLevelMedium = "MEDIUM" + SeverityLevelMedium = "Medium" // SeverityLevelHigh is a SeverityLevel enum value - SeverityLevelHigh = "HIGH" + SeverityLevelHigh = "High" ) const ( @@ -3414,3 +6226,20 @@ const ( // StatusPending is a Status enum value StatusPending = "PENDING" ) + +const ( + // TierDefault is a Tier enum value + TierDefault = "DEFAULT" + + // TierDotNetCore is a Tier enum value + TierDotNetCore = "DOT_NET_CORE" + + // TierDotNetWorker is a Tier enum value + TierDotNetWorker = "DOT_NET_WORKER" + + // TierDotNetWeb is a Tier enum value + TierDotNetWeb = "DOT_NET_WEB" + + // TierSqlServer is a Tier enum value + TierSqlServer = "SQL_SERVER" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/applicationinsights/errors.go b/vendor/github.com/aws/aws-sdk-go/service/applicationinsights/errors.go index c75e208d945..e78ba6a6042 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/applicationinsights/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/applicationinsights/errors.go @@ -2,6 +2,10 @@ package applicationinsights +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadRequestException for service response error code @@ -28,9 +32,32 @@ const ( // The resource does not exist in the customer account. ErrCodeResourceNotFoundException = "ResourceNotFoundException" + // ErrCodeTagsAlreadyExistException for service response error code + // "TagsAlreadyExistException". + // + // Tags are already registered for the specified application ARN. + ErrCodeTagsAlreadyExistException = "TagsAlreadyExistException" + + // ErrCodeTooManyTagsException for service response error code + // "TooManyTagsException". + // + // The number of the provided tags is beyond the limit, or the number of total + // tags you are trying to attach to the specified resource exceeds the limit. + ErrCodeTooManyTagsException = "TooManyTagsException" + // ErrCodeValidationException for service response error code // "ValidationException". // // The parameter is not valid. ErrCodeValidationException = "ValidationException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadRequestException": newErrorBadRequestException, + "InternalServerException": newErrorInternalServerException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "TagsAlreadyExistException": newErrorTagsAlreadyExistException, + "TooManyTagsException": newErrorTooManyTagsException, + "ValidationException": newErrorValidationException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/applicationinsights/service.go b/vendor/github.com/aws/aws-sdk-go/service/applicationinsights/service.go index 72b8030bd46..641d9d10a48 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/applicationinsights/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/applicationinsights/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "Application Insights" // Name of service. EndpointsID = "applicationinsights" // ID to lookup a service endpoint with. - ServiceID = "Application Insights" // ServiceID is a unique identifer of a specific service. + ServiceID = "Application Insights" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ApplicationInsights client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ApplicationInsights client from just a session. // svc := applicationinsights.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *ApplicationInsights { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "applicationinsights" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ApplicationInsights { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ApplicationInsights { svc := &ApplicationInsights{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-11-25", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/appmesh/api.go b/vendor/github.com/aws/aws-sdk-go/service/appmesh/api.go index 59daa7c77e8..63706b6980b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/appmesh/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/appmesh/api.go @@ -71,34 +71,34 @@ func (c *AppMesh) CreateMeshRequest(input *CreateMeshInput) (req *request.Reques // See the AWS API reference guide for AWS App Mesh's // API operation CreateMesh for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request contains a client token that was used for a previous update resource // call with different specifications. Try the request again with a new client // token. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have exceeded a service limit for your account. For more information, // see Service Limits (https://docs.aws.amazon.com/app-mesh/latest/userguide/service_limits.html) // in the AWS App Mesh User Guide. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -179,6 +179,8 @@ func (c *AppMesh) CreateRouteRequest(input *CreateRouteInput) (req *request.Requ // If your route matches a request, you can distribute traffic to one or more // target virtual nodes with relative weighting. // +// For more information about routes, see Routes (https://docs.aws.amazon.com//app-mesh/latest/userguide/routes.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. @@ -186,34 +188,34 @@ func (c *AppMesh) CreateRouteRequest(input *CreateRouteInput) (req *request.Requ // See the AWS API reference guide for AWS App Mesh's // API operation CreateRoute for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request contains a client token that was used for a previous update resource // call with different specifications. Try the request again with a new client // token. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have exceeded a service limit for your account. For more information, // see Service Limits (https://docs.aws.amazon.com/app-mesh/latest/userguide/service_limits.html) // in the AWS App Mesh User Guide. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -305,6 +307,8 @@ func (c *AppMesh) CreateVirtualNodeRequest(input *CreateVirtualNodeInput) (req * // override the node.cluster value that is set by APPMESH_VIRTUAL_NODE_NAME // with the APPMESH_VIRTUAL_NODE_CLUSTER environment variable. // +// For more information about virtual nodes, see Virtual Nodes (https://docs.aws.amazon.com//app-mesh/latest/userguide/virtual_nodes.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. @@ -312,34 +316,34 @@ func (c *AppMesh) CreateVirtualNodeRequest(input *CreateVirtualNodeInput) (req * // See the AWS API reference guide for AWS App Mesh's // API operation CreateVirtualNode for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request contains a client token that was used for a previous update resource // call with different specifications. Try the request again with a new client // token. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have exceeded a service limit for your account. For more information, // see Service Limits (https://docs.aws.amazon.com/app-mesh/latest/userguide/service_limits.html) // in the AWS App Mesh User Guide. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -419,6 +423,8 @@ func (c *AppMesh) CreateVirtualRouterRequest(input *CreateVirtualRouterInput) (r // mesh. After you create your virtual router, create and associate routes for // your virtual router that direct incoming requests to different virtual nodes. // +// For more information about virtual routers, see Virtual Routers (https://docs.aws.amazon.com//app-mesh/latest/userguide/virtual_routers.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. @@ -426,34 +432,34 @@ func (c *AppMesh) CreateVirtualRouterRequest(input *CreateVirtualRouterInput) (r // See the AWS API reference guide for AWS App Mesh's // API operation CreateVirtualRouter for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request contains a client token that was used for a previous update resource // call with different specifications. Try the request again with a new client // token. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have exceeded a service limit for your account. For more information, // see Service Limits (https://docs.aws.amazon.com/app-mesh/latest/userguide/service_limits.html) // in the AWS App Mesh User Guide. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -532,6 +538,8 @@ func (c *AppMesh) CreateVirtualServiceRequest(input *CreateVirtualServiceInput) // are routed to the virtual node or virtual router that is specified as the // provider for the virtual service. // +// For more information about virtual services, see Virtual Services (https://docs.aws.amazon.com//app-mesh/latest/userguide/virtual_services.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. @@ -539,34 +547,34 @@ func (c *AppMesh) CreateVirtualServiceRequest(input *CreateVirtualServiceInput) // See the AWS API reference guide for AWS App Mesh's // API operation CreateVirtualService for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request contains a client token that was used for a previous update resource // call with different specifications. Try the request again with a new client // token. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have exceeded a service limit for your account. For more information, // see Service Limits (https://docs.aws.amazon.com/app-mesh/latest/userguide/service_limits.html) // in the AWS App Mesh User Guide. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -649,28 +657,28 @@ func (c *AppMesh) DeleteMeshRequest(input *DeleteMeshInput) (req *request.Reques // See the AWS API reference guide for AWS App Mesh's // API operation DeleteMesh for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // You can't delete the specified resource because it's in use or required by // another resource. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -750,28 +758,28 @@ func (c *AppMesh) DeleteRouteRequest(input *DeleteRouteInput) (req *request.Requ // See the AWS API reference guide for AWS App Mesh's // API operation DeleteRoute for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // You can't delete the specified resource because it's in use or required by // another resource. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -854,28 +862,28 @@ func (c *AppMesh) DeleteVirtualNodeRequest(input *DeleteVirtualNodeInput) (req * // See the AWS API reference guide for AWS App Mesh's // API operation DeleteVirtualNode for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // You can't delete the specified resource because it's in use or required by // another resource. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -958,28 +966,28 @@ func (c *AppMesh) DeleteVirtualRouterRequest(input *DeleteVirtualRouterInput) (r // See the AWS API reference guide for AWS App Mesh's // API operation DeleteVirtualRouter for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // You can't delete the specified resource because it's in use or required by // another resource. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -1059,24 +1067,24 @@ func (c *AppMesh) DeleteVirtualServiceRequest(input *DeleteVirtualServiceInput) // See the AWS API reference guide for AWS App Mesh's // API operation DeleteVirtualService for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -1156,24 +1164,24 @@ func (c *AppMesh) DescribeMeshRequest(input *DescribeMeshInput) (req *request.Re // See the AWS API reference guide for AWS App Mesh's // API operation DescribeMesh for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -1253,24 +1261,24 @@ func (c *AppMesh) DescribeRouteRequest(input *DescribeRouteInput) (req *request. // See the AWS API reference guide for AWS App Mesh's // API operation DescribeRoute for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -1350,24 +1358,24 @@ func (c *AppMesh) DescribeVirtualNodeRequest(input *DescribeVirtualNodeInput) (r // See the AWS API reference guide for AWS App Mesh's // API operation DescribeVirtualNode for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -1447,24 +1455,24 @@ func (c *AppMesh) DescribeVirtualRouterRequest(input *DescribeVirtualRouterInput // See the AWS API reference guide for AWS App Mesh's // API operation DescribeVirtualRouter for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -1544,24 +1552,24 @@ func (c *AppMesh) DescribeVirtualServiceRequest(input *DescribeVirtualServiceInp // See the AWS API reference guide for AWS App Mesh's // API operation DescribeVirtualService for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -1647,24 +1655,24 @@ func (c *AppMesh) ListMeshesRequest(input *ListMeshesInput) (req *request.Reques // See the AWS API reference guide for AWS App Mesh's // API operation ListMeshes for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -1734,10 +1742,12 @@ func (c *AppMesh) ListMeshesPagesWithContext(ctx aws.Context, input *ListMeshesI }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListMeshesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListMeshesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1800,24 +1810,24 @@ func (c *AppMesh) ListRoutesRequest(input *ListRoutesInput) (req *request.Reques // See the AWS API reference guide for AWS App Mesh's // API operation ListRoutes for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -1887,10 +1897,12 @@ func (c *AppMesh) ListRoutesPagesWithContext(ctx aws.Context, input *ListRoutesI }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRoutesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListRoutesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1953,24 +1965,24 @@ func (c *AppMesh) ListTagsForResourceRequest(input *ListTagsForResourceInput) (r // See the AWS API reference guide for AWS App Mesh's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -2040,10 +2052,12 @@ func (c *AppMesh) ListTagsForResourcePagesWithContext(ctx aws.Context, input *Li }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2106,24 +2120,24 @@ func (c *AppMesh) ListVirtualNodesRequest(input *ListVirtualNodesInput) (req *re // See the AWS API reference guide for AWS App Mesh's // API operation ListVirtualNodes for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -2193,10 +2207,12 @@ func (c *AppMesh) ListVirtualNodesPagesWithContext(ctx aws.Context, input *ListV }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListVirtualNodesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListVirtualNodesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2259,24 +2275,24 @@ func (c *AppMesh) ListVirtualRoutersRequest(input *ListVirtualRoutersInput) (req // See the AWS API reference guide for AWS App Mesh's // API operation ListVirtualRouters for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -2346,10 +2362,12 @@ func (c *AppMesh) ListVirtualRoutersPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListVirtualRoutersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListVirtualRoutersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2412,24 +2430,24 @@ func (c *AppMesh) ListVirtualServicesRequest(input *ListVirtualServicesInput) (r // See the AWS API reference guide for AWS App Mesh's // API operation ListVirtualServices for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -2499,10 +2517,12 @@ func (c *AppMesh) ListVirtualServicesPagesWithContext(ctx aws.Context, input *Li }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListVirtualServicesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListVirtualServicesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2563,29 +2583,29 @@ func (c *AppMesh) TagResourceRequest(input *TagResourceInput) (req *request.Requ // See the AWS API reference guide for AWS App Mesh's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // The request exceeds the maximum allowed number of tags allowed per resource. // The current limit is 50 user tags per resource. You must reduce the number // of tags in the request. None of the tags in this request were applied. @@ -2666,24 +2686,24 @@ func (c *AppMesh) UntagResourceRequest(input *UntagResourceInput) (req *request. // See the AWS API reference guide for AWS App Mesh's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -2763,29 +2783,29 @@ func (c *AppMesh) UpdateMeshRequest(input *UpdateMeshInput) (req *request.Reques // See the AWS API reference guide for AWS App Mesh's // API operation UpdateMesh for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request contains a client token that was used for a previous update resource // call with different specifications. Try the request again with a new client // token. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -2865,34 +2885,34 @@ func (c *AppMesh) UpdateRouteRequest(input *UpdateRouteInput) (req *request.Requ // See the AWS API reference guide for AWS App Mesh's // API operation UpdateRoute for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request contains a client token that was used for a previous update resource // call with different specifications. Try the request again with a new client // token. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have exceeded a service limit for your account. For more information, // see Service Limits (https://docs.aws.amazon.com/app-mesh/latest/userguide/service_limits.html) // in the AWS App Mesh User Guide. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -2972,34 +2992,34 @@ func (c *AppMesh) UpdateVirtualNodeRequest(input *UpdateVirtualNodeInput) (req * // See the AWS API reference guide for AWS App Mesh's // API operation UpdateVirtualNode for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request contains a client token that was used for a previous update resource // call with different specifications. Try the request again with a new client // token. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have exceeded a service limit for your account. For more information, // see Service Limits (https://docs.aws.amazon.com/app-mesh/latest/userguide/service_limits.html) // in the AWS App Mesh User Guide. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -3079,34 +3099,34 @@ func (c *AppMesh) UpdateVirtualRouterRequest(input *UpdateVirtualRouterInput) (r // See the AWS API reference guide for AWS App Mesh's // API operation UpdateVirtualRouter for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request contains a client token that was used for a previous update resource // call with different specifications. Try the request again with a new client // token. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have exceeded a service limit for your account. For more information, // see Service Limits (https://docs.aws.amazon.com/app-mesh/latest/userguide/service_limits.html) // in the AWS App Mesh User Guide. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -3186,34 +3206,34 @@ func (c *AppMesh) UpdateVirtualServiceRequest(input *UpdateVirtualServiceInput) // See the AWS API reference guide for AWS App Mesh's // API operation UpdateVirtualService for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request syntax was malformed. Check your request syntax and try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The request contains a client token that was used for a previous update resource // call with different specifications. Try the request again with a new client // token. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // You don't have permissions to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The request processing has failed because of an unknown error, exception, // or failure. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have exceeded a service limit for your account. For more information, // see Service Limits (https://docs.aws.amazon.com/app-mesh/latest/userguide/service_limits.html) // in the AWS App Mesh User Guide. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified resource doesn't exist. Check your request syntax and try again. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request has failed due to a temporary failure of the service. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The maximum request rate permitted by the App Mesh APIs has been exceeded // for your account. For best results, use an increasing or variable sleep interval // between requests. @@ -3240,11 +3260,11 @@ func (c *AppMesh) UpdateVirtualServiceWithContext(ctx aws.Context, input *Update return out, req.Send() } -// An object representing the access logging information for a virtual node. +// An object that represents the access logging information for a virtual node. type AccessLog struct { _ struct{} `type:"structure"` - // An object representing an access log file. + // An object that represents an access log file. File *FileAccessLog `locationName:"file" type:"structure"` } @@ -3279,8 +3299,8 @@ func (s *AccessLog) SetFile(v *FileAccessLog) *AccessLog { return s } -// An object representing the AWS Cloud Map attribute information for your virtual -// node. +// An object that represents the AWS Cloud Map attribute information for your +// virtual node. type AwsCloudMapInstanceAttribute struct { _ struct{} `type:"structure"` @@ -3335,8 +3355,8 @@ func (s *AwsCloudMapInstanceAttribute) SetValue(v string) *AwsCloudMapInstanceAt return s } -// An object representing the AWS Cloud Map service discovery information for -// your virtual node. +// An object that represents the AWS Cloud Map service discovery information +// for your virtual node. type AwsCloudMapServiceDiscovery struct { _ struct{} `type:"structure"` @@ -3409,12 +3429,12 @@ func (s *AwsCloudMapServiceDiscovery) SetServiceName(v string) *AwsCloudMapServi return s } -// An object representing the backends that a virtual node is expected to send -// outbound traffic to. +// An object that represents the backends that a virtual node is expected to +// send outbound traffic to. type Backend struct { _ struct{} `type:"structure"` - // An object representing a virtual service backend for a virtual node. + // An object that represents a virtual service backend for a virtual node. VirtualService *VirtualServiceBackend `locationName:"virtualService" type:"structure"` } @@ -3449,6 +3469,258 @@ func (s *Backend) SetVirtualService(v *VirtualServiceBackend) *Backend { return s } +// An object that represents the default properties for a backend. +type BackendDefaults struct { + _ struct{} `type:"structure"` + + // An object that represents a client policy. + ClientPolicy *ClientPolicy `locationName:"clientPolicy" type:"structure"` +} + +// String returns the string representation +func (s BackendDefaults) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BackendDefaults) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BackendDefaults) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BackendDefaults"} + if s.ClientPolicy != nil { + if err := s.ClientPolicy.Validate(); err != nil { + invalidParams.AddNested("ClientPolicy", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientPolicy sets the ClientPolicy field's value. +func (s *BackendDefaults) SetClientPolicy(v *ClientPolicy) *BackendDefaults { + s.ClientPolicy = v + return s +} + +// The request syntax was malformed. Check your request syntax and try again. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// An object that represents a client policy. +type ClientPolicy struct { + _ struct{} `type:"structure"` + + // An object that represents a Transport Layer Security (TLS) client policy. + Tls *ClientPolicyTls `locationName:"tls" type:"structure"` +} + +// String returns the string representation +func (s ClientPolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClientPolicy) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ClientPolicy) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ClientPolicy"} + if s.Tls != nil { + if err := s.Tls.Validate(); err != nil { + invalidParams.AddNested("Tls", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTls sets the Tls field's value. +func (s *ClientPolicy) SetTls(v *ClientPolicyTls) *ClientPolicy { + s.Tls = v + return s +} + +// An object that represents a Transport Layer Security (TLS) client policy. +type ClientPolicyTls struct { + _ struct{} `type:"structure"` + + Enforce *bool `locationName:"enforce" type:"boolean"` + + Ports []*int64 `locationName:"ports" type:"list"` + + // An object that represents a Transport Layer Security (TLS) validation context. + // + // Validation is a required field + Validation *TlsValidationContext `locationName:"validation" type:"structure" required:"true"` +} + +// String returns the string representation +func (s ClientPolicyTls) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClientPolicyTls) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ClientPolicyTls) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ClientPolicyTls"} + if s.Validation == nil { + invalidParams.Add(request.NewErrParamRequired("Validation")) + } + if s.Validation != nil { + if err := s.Validation.Validate(); err != nil { + invalidParams.AddNested("Validation", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEnforce sets the Enforce field's value. +func (s *ClientPolicyTls) SetEnforce(v bool) *ClientPolicyTls { + s.Enforce = &v + return s +} + +// SetPorts sets the Ports field's value. +func (s *ClientPolicyTls) SetPorts(v []*int64) *ClientPolicyTls { + s.Ports = v + return s +} + +// SetValidation sets the Validation field's value. +func (s *ClientPolicyTls) SetValidation(v *TlsValidationContext) *ClientPolicyTls { + s.Validation = v + return s +} + +// The request contains a client token that was used for a previous update resource +// call with different specifications. Try the request again with a new client +// token. +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictException) GoString() string { + return s.String() +} + +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" +} + +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil +} + +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID +} + type CreateMeshInput struct { _ struct{} `type:"structure"` @@ -3457,7 +3729,7 @@ type CreateMeshInput struct { // MeshName is a required field MeshName *string `locationName:"meshName" min:"1" type:"string" required:"true"` - // An object representing the specification of a service mesh. + // An object that represents the specification of a service mesh. Spec *MeshSpec `locationName:"spec" type:"structure"` Tags []*TagRef `locationName:"tags" type:"list"` @@ -3531,7 +3803,7 @@ func (s *CreateMeshInput) SetTags(v []*TagRef) *CreateMeshInput { type CreateMeshOutput struct { _ struct{} `type:"structure" payload:"Mesh"` - // An object representing a service mesh returned by a describe operation. + // An object that represents a service mesh returned by a describe operation. // // Mesh is a required field Mesh *MeshData `locationName:"mesh" type:"structure" required:"true"` @@ -3564,7 +3836,7 @@ type CreateRouteInput struct { // RouteName is a required field RouteName *string `locationName:"routeName" min:"1" type:"string" required:"true"` - // An object representing the specification of a route. + // An object that represents a route specification. Specify one route type. // // Spec is a required field Spec *RouteSpec `locationName:"spec" type:"structure" required:"true"` @@ -3670,7 +3942,7 @@ func (s *CreateRouteInput) SetVirtualRouterName(v string) *CreateRouteInput { type CreateRouteOutput struct { _ struct{} `type:"structure" payload:"Route"` - // An object representing a route returned by a describe operation. + // An object that represents a route returned by a describe operation. // // Route is a required field Route *RouteData `locationName:"route" type:"structure" required:"true"` @@ -3700,7 +3972,7 @@ type CreateVirtualNodeInput struct { // MeshName is a required field MeshName *string `location:"uri" locationName:"meshName" min:"1" type:"string" required:"true"` - // An object representing the specification of a virtual node. + // An object that represents the specification of a virtual node. // // Spec is a required field Spec *VirtualNodeSpec `locationName:"spec" type:"structure" required:"true"` @@ -3794,7 +4066,7 @@ func (s *CreateVirtualNodeInput) SetVirtualNodeName(v string) *CreateVirtualNode type CreateVirtualNodeOutput struct { _ struct{} `type:"structure" payload:"VirtualNode"` - // An object representing a virtual node returned by a describe operation. + // An object that represents a virtual node returned by a describe operation. // // VirtualNode is a required field VirtualNode *VirtualNodeData `locationName:"virtualNode" type:"structure" required:"true"` @@ -3824,7 +4096,7 @@ type CreateVirtualRouterInput struct { // MeshName is a required field MeshName *string `location:"uri" locationName:"meshName" min:"1" type:"string" required:"true"` - // An object representing the specification of a virtual router. + // An object that represents the specification of a virtual router. // // Spec is a required field Spec *VirtualRouterSpec `locationName:"spec" type:"structure" required:"true"` @@ -3918,7 +4190,7 @@ func (s *CreateVirtualRouterInput) SetVirtualRouterName(v string) *CreateVirtual type CreateVirtualRouterOutput struct { _ struct{} `type:"structure" payload:"VirtualRouter"` - // An object representing a virtual router returned by a describe operation. + // An object that represents a virtual router returned by a describe operation. // // VirtualRouter is a required field VirtualRouter *VirtualRouterData `locationName:"virtualRouter" type:"structure" required:"true"` @@ -3948,7 +4220,7 @@ type CreateVirtualServiceInput struct { // MeshName is a required field MeshName *string `location:"uri" locationName:"meshName" min:"1" type:"string" required:"true"` - // An object representing the specification of a virtual service. + // An object that represents the specification of a virtual service. // // Spec is a required field Spec *VirtualServiceSpec `locationName:"spec" type:"structure" required:"true"` @@ -4039,7 +4311,7 @@ func (s *CreateVirtualServiceInput) SetVirtualServiceName(v string) *CreateVirtu type CreateVirtualServiceOutput struct { _ struct{} `type:"structure" payload:"VirtualService"` - // An object representing a virtual service returned by a describe operation. + // An object that represents a virtual service returned by a describe operation. // // VirtualService is a required field VirtualService *VirtualServiceData `locationName:"virtualService" type:"structure" required:"true"` @@ -4103,7 +4375,7 @@ func (s *DeleteMeshInput) SetMeshName(v string) *DeleteMeshInput { type DeleteMeshOutput struct { _ struct{} `type:"structure" payload:"Mesh"` - // An object representing a service mesh returned by a describe operation. + // An object that represents a service mesh returned by a describe operation. // // Mesh is a required field Mesh *MeshData `locationName:"mesh" type:"structure" required:"true"` @@ -4197,7 +4469,7 @@ func (s *DeleteRouteInput) SetVirtualRouterName(v string) *DeleteRouteInput { type DeleteRouteOutput struct { _ struct{} `type:"structure" payload:"Route"` - // An object representing a route returned by a describe operation. + // An object that represents a route returned by a describe operation. // // Route is a required field Route *RouteData `locationName:"route" type:"structure" required:"true"` @@ -4276,7 +4548,7 @@ func (s *DeleteVirtualNodeInput) SetVirtualNodeName(v string) *DeleteVirtualNode type DeleteVirtualNodeOutput struct { _ struct{} `type:"structure" payload:"VirtualNode"` - // An object representing a virtual node returned by a describe operation. + // An object that represents a virtual node returned by a describe operation. // // VirtualNode is a required field VirtualNode *VirtualNodeData `locationName:"virtualNode" type:"structure" required:"true"` @@ -4355,7 +4627,7 @@ func (s *DeleteVirtualRouterInput) SetVirtualRouterName(v string) *DeleteVirtual type DeleteVirtualRouterOutput struct { _ struct{} `type:"structure" payload:"VirtualRouter"` - // An object representing a virtual router returned by a describe operation. + // An object that represents a virtual router returned by a describe operation. // // VirtualRouter is a required field VirtualRouter *VirtualRouterData `locationName:"virtualRouter" type:"structure" required:"true"` @@ -4434,7 +4706,7 @@ func (s *DeleteVirtualServiceInput) SetVirtualServiceName(v string) *DeleteVirtu type DeleteVirtualServiceOutput struct { _ struct{} `type:"structure" payload:"VirtualService"` - // An object representing a virtual service returned by a describe operation. + // An object that represents a virtual service returned by a describe operation. // // VirtualService is a required field VirtualService *VirtualServiceData `locationName:"virtualService" type:"structure" required:"true"` @@ -4498,7 +4770,7 @@ func (s *DescribeMeshInput) SetMeshName(v string) *DescribeMeshInput { type DescribeMeshOutput struct { _ struct{} `type:"structure" payload:"Mesh"` - // An object representing a service mesh returned by a describe operation. + // An object that represents a service mesh returned by a describe operation. // // Mesh is a required field Mesh *MeshData `locationName:"mesh" type:"structure" required:"true"` @@ -4592,7 +4864,7 @@ func (s *DescribeRouteInput) SetVirtualRouterName(v string) *DescribeRouteInput type DescribeRouteOutput struct { _ struct{} `type:"structure" payload:"Route"` - // An object representing a route returned by a describe operation. + // An object that represents a route returned by a describe operation. // // Route is a required field Route *RouteData `locationName:"route" type:"structure" required:"true"` @@ -4671,7 +4943,7 @@ func (s *DescribeVirtualNodeInput) SetVirtualNodeName(v string) *DescribeVirtual type DescribeVirtualNodeOutput struct { _ struct{} `type:"structure" payload:"VirtualNode"` - // An object representing a virtual node returned by a describe operation. + // An object that represents a virtual node returned by a describe operation. // // VirtualNode is a required field VirtualNode *VirtualNodeData `locationName:"virtualNode" type:"structure" required:"true"` @@ -4750,7 +5022,7 @@ func (s *DescribeVirtualRouterInput) SetVirtualRouterName(v string) *DescribeVir type DescribeVirtualRouterOutput struct { _ struct{} `type:"structure" payload:"VirtualRouter"` - // An object representing a virtual router returned by a describe operation. + // An object that represents a virtual router returned by a describe operation. // // VirtualRouter is a required field VirtualRouter *VirtualRouterData `locationName:"virtualRouter" type:"structure" required:"true"` @@ -4829,7 +5101,7 @@ func (s *DescribeVirtualServiceInput) SetVirtualServiceName(v string) *DescribeV type DescribeVirtualServiceOutput struct { _ struct{} `type:"structure" payload:"VirtualService"` - // An object representing a virtual service returned by a describe operation. + // An object that represents a virtual service returned by a describe operation. // // VirtualService is a required field VirtualService *VirtualServiceData `locationName:"virtualService" type:"structure" required:"true"` @@ -4851,8 +5123,8 @@ func (s *DescribeVirtualServiceOutput) SetVirtualService(v *VirtualServiceData) return s } -// An object representing the DNS service discovery information for your virtual -// node. +// An object that represents the DNS service discovery information for your +// virtual node. type DnsServiceDiscovery struct { _ struct{} `type:"structure"` @@ -4889,7 +5161,7 @@ func (s *DnsServiceDiscovery) SetHostname(v string) *DnsServiceDiscovery { return s } -// An object representing the duration between retry attempts. +// An object that represents a duration of time. type Duration struct { _ struct{} `type:"structure"` @@ -4920,7 +5192,7 @@ func (s *Duration) SetValue(v int64) *Duration { return s } -// An object representing the egress filter rules for a service mesh. +// An object that represents the egress filter rules for a service mesh. type EgressFilter struct { _ struct{} `type:"structure"` @@ -4957,7 +5229,7 @@ func (s *EgressFilter) SetType(v string) *EgressFilter { return s } -// An object representing an access log file. +// An object that represents an access log file. type FileAccessLog struct { _ struct{} `type:"structure"` @@ -4997,54 +5269,110 @@ func (s *FileAccessLog) SetPath(v string) *FileAccessLog { return s } -// An object representing the method and value to match the header value sent -// with a request. Specify one match method. -type HeaderMatchMethod struct { +// You don't have permissions to perform this action. +type ForbiddenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ForbiddenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ForbiddenException) GoString() string { + return s.String() +} + +func newErrorForbiddenException(v protocol.ResponseMetadata) error { + return &ForbiddenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ForbiddenException) Code() string { + return "ForbiddenException" +} + +// Message returns the exception's message. +func (s ForbiddenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ForbiddenException) OrigErr() error { + return nil +} + +func (s ForbiddenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ForbiddenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ForbiddenException) RequestID() string { + return s.respMetadata.RequestID +} + +// An object that represents a retry policy. Specify at least one value for +// at least one of the types of RetryEvents, a value for maxRetries, and a value +// for perRetryTimeout. +type GrpcRetryPolicy struct { _ struct{} `type:"structure"` - Exact *string `locationName:"exact" min:"1" type:"string"` + GrpcRetryEvents []*string `locationName:"grpcRetryEvents" min:"1" type:"list"` - Prefix *string `locationName:"prefix" min:"1" type:"string"` + HttpRetryEvents []*string `locationName:"httpRetryEvents" min:"1" type:"list"` - // The range of values to match on. The first character of the range is included - // in the range, though the last character is not. For example, if the range - // specified were 1-100, only values 1-99 would be matched. - Range *MatchRange `locationName:"range" type:"structure"` + // MaxRetries is a required field + MaxRetries *int64 `locationName:"maxRetries" type:"long" required:"true"` - Regex *string `locationName:"regex" min:"1" type:"string"` + // An object that represents a duration of time. + // + // PerRetryTimeout is a required field + PerRetryTimeout *Duration `locationName:"perRetryTimeout" type:"structure" required:"true"` - Suffix *string `locationName:"suffix" min:"1" type:"string"` + TcpRetryEvents []*string `locationName:"tcpRetryEvents" min:"1" type:"list"` } // String returns the string representation -func (s HeaderMatchMethod) String() string { +func (s GrpcRetryPolicy) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HeaderMatchMethod) GoString() string { +func (s GrpcRetryPolicy) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *HeaderMatchMethod) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HeaderMatchMethod"} - if s.Exact != nil && len(*s.Exact) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Exact", 1)) +func (s *GrpcRetryPolicy) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GrpcRetryPolicy"} + if s.GrpcRetryEvents != nil && len(s.GrpcRetryEvents) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GrpcRetryEvents", 1)) } - if s.Prefix != nil && len(*s.Prefix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Prefix", 1)) + if s.HttpRetryEvents != nil && len(s.HttpRetryEvents) < 1 { + invalidParams.Add(request.NewErrParamMinLen("HttpRetryEvents", 1)) } - if s.Regex != nil && len(*s.Regex) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Regex", 1)) + if s.MaxRetries == nil { + invalidParams.Add(request.NewErrParamRequired("MaxRetries")) } - if s.Suffix != nil && len(*s.Suffix) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Suffix", 1)) + if s.PerRetryTimeout == nil { + invalidParams.Add(request.NewErrParamRequired("PerRetryTimeout")) } - if s.Range != nil { - if err := s.Range.Validate(); err != nil { - invalidParams.AddNested("Range", err.(request.ErrInvalidParams)) - } + if s.TcpRetryEvents != nil && len(s.TcpRetryEvents) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TcpRetryEvents", 1)) } if invalidParams.Len() > 0 { @@ -5053,47 +5381,476 @@ func (s *HeaderMatchMethod) Validate() error { return nil } -// SetExact sets the Exact field's value. -func (s *HeaderMatchMethod) SetExact(v string) *HeaderMatchMethod { - s.Exact = &v +// SetGrpcRetryEvents sets the GrpcRetryEvents field's value. +func (s *GrpcRetryPolicy) SetGrpcRetryEvents(v []*string) *GrpcRetryPolicy { + s.GrpcRetryEvents = v return s } -// SetPrefix sets the Prefix field's value. -func (s *HeaderMatchMethod) SetPrefix(v string) *HeaderMatchMethod { - s.Prefix = &v +// SetHttpRetryEvents sets the HttpRetryEvents field's value. +func (s *GrpcRetryPolicy) SetHttpRetryEvents(v []*string) *GrpcRetryPolicy { + s.HttpRetryEvents = v return s } -// SetRange sets the Range field's value. -func (s *HeaderMatchMethod) SetRange(v *MatchRange) *HeaderMatchMethod { - s.Range = v +// SetMaxRetries sets the MaxRetries field's value. +func (s *GrpcRetryPolicy) SetMaxRetries(v int64) *GrpcRetryPolicy { + s.MaxRetries = &v return s } -// SetRegex sets the Regex field's value. -func (s *HeaderMatchMethod) SetRegex(v string) *HeaderMatchMethod { - s.Regex = &v +// SetPerRetryTimeout sets the PerRetryTimeout field's value. +func (s *GrpcRetryPolicy) SetPerRetryTimeout(v *Duration) *GrpcRetryPolicy { + s.PerRetryTimeout = v return s } -// SetSuffix sets the Suffix field's value. -func (s *HeaderMatchMethod) SetSuffix(v string) *HeaderMatchMethod { - s.Suffix = &v +// SetTcpRetryEvents sets the TcpRetryEvents field's value. +func (s *GrpcRetryPolicy) SetTcpRetryEvents(v []*string) *GrpcRetryPolicy { + s.TcpRetryEvents = v return s } -// An object representing the health check policy for a virtual node's listener. -type HealthCheckPolicy struct { +// An object that represents a gRPC route type. +type GrpcRoute struct { _ struct{} `type:"structure"` - // HealthyThreshold is a required field - HealthyThreshold *int64 `locationName:"healthyThreshold" min:"2" type:"integer" required:"true"` + // An object that represents the action to take if a match is determined. + // + // Action is a required field + Action *GrpcRouteAction `locationName:"action" type:"structure" required:"true"` - // IntervalMillis is a required field - IntervalMillis *int64 `locationName:"intervalMillis" min:"5000" type:"long" required:"true"` + // An object that represents the criteria for determining a request match. + // + // Match is a required field + Match *GrpcRouteMatch `locationName:"match" type:"structure" required:"true"` - Path *string `locationName:"path" type:"string"` + // An object that represents a retry policy. Specify at least one value for + // at least one of the types of RetryEvents, a value for maxRetries, and a value + // for perRetryTimeout. + RetryPolicy *GrpcRetryPolicy `locationName:"retryPolicy" type:"structure"` +} + +// String returns the string representation +func (s GrpcRoute) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GrpcRoute) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GrpcRoute) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GrpcRoute"} + if s.Action == nil { + invalidParams.Add(request.NewErrParamRequired("Action")) + } + if s.Match == nil { + invalidParams.Add(request.NewErrParamRequired("Match")) + } + if s.Action != nil { + if err := s.Action.Validate(); err != nil { + invalidParams.AddNested("Action", err.(request.ErrInvalidParams)) + } + } + if s.Match != nil { + if err := s.Match.Validate(); err != nil { + invalidParams.AddNested("Match", err.(request.ErrInvalidParams)) + } + } + if s.RetryPolicy != nil { + if err := s.RetryPolicy.Validate(); err != nil { + invalidParams.AddNested("RetryPolicy", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAction sets the Action field's value. +func (s *GrpcRoute) SetAction(v *GrpcRouteAction) *GrpcRoute { + s.Action = v + return s +} + +// SetMatch sets the Match field's value. +func (s *GrpcRoute) SetMatch(v *GrpcRouteMatch) *GrpcRoute { + s.Match = v + return s +} + +// SetRetryPolicy sets the RetryPolicy field's value. +func (s *GrpcRoute) SetRetryPolicy(v *GrpcRetryPolicy) *GrpcRoute { + s.RetryPolicy = v + return s +} + +// An object that represents the action to take if a match is determined. +type GrpcRouteAction struct { + _ struct{} `type:"structure"` + + // WeightedTargets is a required field + WeightedTargets []*WeightedTarget `locationName:"weightedTargets" min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s GrpcRouteAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GrpcRouteAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GrpcRouteAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GrpcRouteAction"} + if s.WeightedTargets == nil { + invalidParams.Add(request.NewErrParamRequired("WeightedTargets")) + } + if s.WeightedTargets != nil && len(s.WeightedTargets) < 1 { + invalidParams.Add(request.NewErrParamMinLen("WeightedTargets", 1)) + } + if s.WeightedTargets != nil { + for i, v := range s.WeightedTargets { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "WeightedTargets", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetWeightedTargets sets the WeightedTargets field's value. +func (s *GrpcRouteAction) SetWeightedTargets(v []*WeightedTarget) *GrpcRouteAction { + s.WeightedTargets = v + return s +} + +// An object that represents the criteria for determining a request match. +type GrpcRouteMatch struct { + _ struct{} `type:"structure"` + + Metadata []*GrpcRouteMetadata `locationName:"metadata" min:"1" type:"list"` + + MethodName *string `locationName:"methodName" min:"1" type:"string"` + + ServiceName *string `locationName:"serviceName" type:"string"` +} + +// String returns the string representation +func (s GrpcRouteMatch) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GrpcRouteMatch) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GrpcRouteMatch) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GrpcRouteMatch"} + if s.Metadata != nil && len(s.Metadata) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Metadata", 1)) + } + if s.MethodName != nil && len(*s.MethodName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MethodName", 1)) + } + if s.Metadata != nil { + for i, v := range s.Metadata { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Metadata", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMetadata sets the Metadata field's value. +func (s *GrpcRouteMatch) SetMetadata(v []*GrpcRouteMetadata) *GrpcRouteMatch { + s.Metadata = v + return s +} + +// SetMethodName sets the MethodName field's value. +func (s *GrpcRouteMatch) SetMethodName(v string) *GrpcRouteMatch { + s.MethodName = &v + return s +} + +// SetServiceName sets the ServiceName field's value. +func (s *GrpcRouteMatch) SetServiceName(v string) *GrpcRouteMatch { + s.ServiceName = &v + return s +} + +// An object that represents the match metadata for the route. +type GrpcRouteMetadata struct { + _ struct{} `type:"structure"` + + Invert *bool `locationName:"invert" type:"boolean"` + + // An object that represents the match method. Specify one of the match values. + Match *GrpcRouteMetadataMatchMethod `locationName:"match" type:"structure"` + + // Name is a required field + Name *string `locationName:"name" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GrpcRouteMetadata) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GrpcRouteMetadata) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GrpcRouteMetadata) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GrpcRouteMetadata"} + 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.Match != nil { + if err := s.Match.Validate(); err != nil { + invalidParams.AddNested("Match", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInvert sets the Invert field's value. +func (s *GrpcRouteMetadata) SetInvert(v bool) *GrpcRouteMetadata { + s.Invert = &v + return s +} + +// SetMatch sets the Match field's value. +func (s *GrpcRouteMetadata) SetMatch(v *GrpcRouteMetadataMatchMethod) *GrpcRouteMetadata { + s.Match = v + return s +} + +// SetName sets the Name field's value. +func (s *GrpcRouteMetadata) SetName(v string) *GrpcRouteMetadata { + s.Name = &v + return s +} + +// An object that represents the match method. Specify one of the match values. +type GrpcRouteMetadataMatchMethod struct { + _ struct{} `type:"structure"` + + Exact *string `locationName:"exact" min:"1" type:"string"` + + Prefix *string `locationName:"prefix" min:"1" type:"string"` + + // An object that represents the range of values to match on. The first character + // of the range is included in the range, though the last character is not. + // For example, if the range specified were 1-100, only values 1-99 would be + // matched. + Range *MatchRange `locationName:"range" type:"structure"` + + Regex *string `locationName:"regex" min:"1" type:"string"` + + Suffix *string `locationName:"suffix" min:"1" type:"string"` +} + +// String returns the string representation +func (s GrpcRouteMetadataMatchMethod) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GrpcRouteMetadataMatchMethod) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GrpcRouteMetadataMatchMethod) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GrpcRouteMetadataMatchMethod"} + if s.Exact != nil && len(*s.Exact) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Exact", 1)) + } + if s.Prefix != nil && len(*s.Prefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Prefix", 1)) + } + if s.Regex != nil && len(*s.Regex) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Regex", 1)) + } + if s.Suffix != nil && len(*s.Suffix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Suffix", 1)) + } + if s.Range != nil { + if err := s.Range.Validate(); err != nil { + invalidParams.AddNested("Range", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetExact sets the Exact field's value. +func (s *GrpcRouteMetadataMatchMethod) SetExact(v string) *GrpcRouteMetadataMatchMethod { + s.Exact = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *GrpcRouteMetadataMatchMethod) SetPrefix(v string) *GrpcRouteMetadataMatchMethod { + s.Prefix = &v + return s +} + +// SetRange sets the Range field's value. +func (s *GrpcRouteMetadataMatchMethod) SetRange(v *MatchRange) *GrpcRouteMetadataMatchMethod { + s.Range = v + return s +} + +// SetRegex sets the Regex field's value. +func (s *GrpcRouteMetadataMatchMethod) SetRegex(v string) *GrpcRouteMetadataMatchMethod { + s.Regex = &v + return s +} + +// SetSuffix sets the Suffix field's value. +func (s *GrpcRouteMetadataMatchMethod) SetSuffix(v string) *GrpcRouteMetadataMatchMethod { + s.Suffix = &v + return s +} + +// An object that represents the method and value to match with the header value +// sent in a request. Specify one match method. +type HeaderMatchMethod struct { + _ struct{} `type:"structure"` + + Exact *string `locationName:"exact" min:"1" type:"string"` + + Prefix *string `locationName:"prefix" min:"1" type:"string"` + + // An object that represents the range of values to match on. The first character + // of the range is included in the range, though the last character is not. + // For example, if the range specified were 1-100, only values 1-99 would be + // matched. + Range *MatchRange `locationName:"range" type:"structure"` + + Regex *string `locationName:"regex" min:"1" type:"string"` + + Suffix *string `locationName:"suffix" min:"1" type:"string"` +} + +// String returns the string representation +func (s HeaderMatchMethod) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HeaderMatchMethod) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *HeaderMatchMethod) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HeaderMatchMethod"} + if s.Exact != nil && len(*s.Exact) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Exact", 1)) + } + if s.Prefix != nil && len(*s.Prefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Prefix", 1)) + } + if s.Regex != nil && len(*s.Regex) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Regex", 1)) + } + if s.Suffix != nil && len(*s.Suffix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Suffix", 1)) + } + if s.Range != nil { + if err := s.Range.Validate(); err != nil { + invalidParams.AddNested("Range", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetExact sets the Exact field's value. +func (s *HeaderMatchMethod) SetExact(v string) *HeaderMatchMethod { + s.Exact = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *HeaderMatchMethod) SetPrefix(v string) *HeaderMatchMethod { + s.Prefix = &v + return s +} + +// SetRange sets the Range field's value. +func (s *HeaderMatchMethod) SetRange(v *MatchRange) *HeaderMatchMethod { + s.Range = v + return s +} + +// SetRegex sets the Regex field's value. +func (s *HeaderMatchMethod) SetRegex(v string) *HeaderMatchMethod { + s.Regex = &v + return s +} + +// SetSuffix sets the Suffix field's value. +func (s *HeaderMatchMethod) SetSuffix(v string) *HeaderMatchMethod { + s.Suffix = &v + return s +} + +// An object that represents the health check policy for a virtual node's listener. +type HealthCheckPolicy struct { + _ struct{} `type:"structure"` + + // HealthyThreshold is a required field + HealthyThreshold *int64 `locationName:"healthyThreshold" min:"2" type:"integer" required:"true"` + + // IntervalMillis is a required field + IntervalMillis *int64 `locationName:"intervalMillis" min:"5000" type:"long" required:"true"` + + Path *string `locationName:"path" type:"string"` Port *int64 `locationName:"port" min:"1" type:"integer"` @@ -5199,7 +5956,9 @@ func (s *HealthCheckPolicy) SetUnhealthyThreshold(v int64) *HealthCheckPolicy { return s } -// An object that represents a retry policy. +// An object that represents a retry policy. Specify at least one value for +// at least one of the types of RetryEvents, a value for maxRetries, and a value +// for perRetryTimeout. type HttpRetryPolicy struct { _ struct{} `type:"structure"` @@ -5208,7 +5967,7 @@ type HttpRetryPolicy struct { // MaxRetries is a required field MaxRetries *int64 `locationName:"maxRetries" type:"long" required:"true"` - // An object representing the duration between retry attempts. + // An object that represents a duration of time. // // PerRetryTimeout is a required field PerRetryTimeout *Duration `locationName:"perRetryTimeout" type:"structure" required:"true"` @@ -5272,23 +6031,24 @@ func (s *HttpRetryPolicy) SetTcpRetryEvents(v []*string) *HttpRetryPolicy { return s } -// An object representing the HTTP routing specification for a route. +// An object that represents an HTTP or HTTP/2 route type. type HttpRoute struct { _ struct{} `type:"structure"` - // An object representing the traffic distribution requirements for matched - // HTTP requests. + // An object that represents the action to take if a match is determined. // // Action is a required field Action *HttpRouteAction `locationName:"action" type:"structure" required:"true"` - // An object representing the requirements for a route to match HTTP requests + // An object that represents the requirements for a route to match HTTP requests // for a virtual router. // // Match is a required field Match *HttpRouteMatch `locationName:"match" type:"structure" required:"true"` - // An object that represents a retry policy. + // An object that represents a retry policy. Specify at least one value for + // at least one of the types of RetryEvents, a value for maxRetries, and a value + // for perRetryTimeout. RetryPolicy *HttpRetryPolicy `locationName:"retryPolicy" type:"structure"` } @@ -5351,8 +6111,7 @@ func (s *HttpRoute) SetRetryPolicy(v *HttpRetryPolicy) *HttpRoute { return s } -// An object representing the traffic distribution requirements for matched -// HTTP requests. +// An object that represents the action to take if a match is determined. type HttpRouteAction struct { _ struct{} `type:"structure"` @@ -5402,14 +6161,14 @@ func (s *HttpRouteAction) SetWeightedTargets(v []*WeightedTarget) *HttpRouteActi return s } -// An object representing the HTTP header in the request. +// An object that represents the HTTP header in the request. type HttpRouteHeader struct { _ struct{} `type:"structure"` Invert *bool `locationName:"invert" type:"boolean"` - // An object representing the method and value to match the header value sent - // with a request. Specify one match method. + // An object that represents the method and value to match with the header value + // sent in a request. Specify one match method. Match *HeaderMatchMethod `locationName:"match" type:"structure"` // Name is a required field @@ -5465,7 +6224,7 @@ func (s *HttpRouteHeader) SetName(v string) *HttpRouteHeader { return s } -// An object representing the requirements for a route to match HTTP requests +// An object that represents the requirements for a route to match HTTP requests // for a virtual router. type HttpRouteMatch struct { _ struct{} `type:"structure"` @@ -5540,6 +6299,121 @@ func (s *HttpRouteMatch) SetScheme(v string) *HttpRouteMatch { return s } +// The request processing has failed because of an unknown error, exception, +// or failure. +type InternalServerErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalServerErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerErrorException) GoString() string { + return s.String() +} + +func newErrorInternalServerErrorException(v protocol.ResponseMetadata) error { + return &InternalServerErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerErrorException) Code() string { + return "InternalServerErrorException" +} + +// Message returns the exception's message. +func (s InternalServerErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerErrorException) OrigErr() error { + return nil +} + +func (s InternalServerErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// You have exceeded a service limit for your account. For more information, +// see Service Limits (https://docs.aws.amazon.com/app-mesh/latest/userguide/service_limits.html) +// in the AWS App Mesh User Guide. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListMeshesInput struct { _ struct{} `type:"structure"` @@ -6071,17 +6945,21 @@ func (s *ListVirtualServicesOutput) SetVirtualServices(v []*VirtualServiceRef) * return s } -// An object representing a listener for a virtual node. +// An object that represents a listener for a virtual node. type Listener struct { _ struct{} `type:"structure"` - // An object representing the health check policy for a virtual node's listener. + // An object that represents the health check policy for a virtual node's listener. HealthCheck *HealthCheckPolicy `locationName:"healthCheck" type:"structure"` - // An object representing a virtual node or virtual router listener port mapping. + // An object that represents a port mapping. // // PortMapping is a required field PortMapping *PortMapping `locationName:"portMapping" type:"structure" required:"true"` + + // An object that represents the Transport Layer Security (TLS) properties for + // a listener. + Tls *ListenerTls `locationName:"tls" type:"structure"` } // String returns the string representation @@ -6110,6 +6988,11 @@ func (s *Listener) Validate() error { invalidParams.AddNested("PortMapping", err.(request.ErrInvalidParams)) } } + if s.Tls != nil { + if err := s.Tls.Validate(); err != nil { + invalidParams.AddNested("Tls", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -6129,11 +7012,223 @@ func (s *Listener) SetPortMapping(v *PortMapping) *Listener { return s } -// An object representing the logging information for a virtual node. +// SetTls sets the Tls field's value. +func (s *Listener) SetTls(v *ListenerTls) *Listener { + s.Tls = v + return s +} + +// An object that represents the Transport Layer Security (TLS) properties for +// a listener. +type ListenerTls struct { + _ struct{} `type:"structure"` + + // An object that represents a listener's Transport Layer Security (TLS) certificate. + // + // Certificate is a required field + Certificate *ListenerTlsCertificate `locationName:"certificate" type:"structure" required:"true"` + + // Mode is a required field + Mode *string `locationName:"mode" type:"string" required:"true" enum:"ListenerTlsMode"` +} + +// String returns the string representation +func (s ListenerTls) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListenerTls) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListenerTls) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListenerTls"} + if s.Certificate == nil { + invalidParams.Add(request.NewErrParamRequired("Certificate")) + } + if s.Mode == nil { + invalidParams.Add(request.NewErrParamRequired("Mode")) + } + if s.Certificate != nil { + if err := s.Certificate.Validate(); err != nil { + invalidParams.AddNested("Certificate", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCertificate sets the Certificate field's value. +func (s *ListenerTls) SetCertificate(v *ListenerTlsCertificate) *ListenerTls { + s.Certificate = v + return s +} + +// SetMode sets the Mode field's value. +func (s *ListenerTls) SetMode(v string) *ListenerTls { + s.Mode = &v + return s +} + +// An object that represents an AWS Certicate Manager (ACM) certificate. +type ListenerTlsAcmCertificate struct { + _ struct{} `type:"structure"` + + // CertificateArn is a required field + CertificateArn *string `locationName:"certificateArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListenerTlsAcmCertificate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListenerTlsAcmCertificate) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListenerTlsAcmCertificate) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListenerTlsAcmCertificate"} + 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 *ListenerTlsAcmCertificate) SetCertificateArn(v string) *ListenerTlsAcmCertificate { + s.CertificateArn = &v + return s +} + +// An object that represents a listener's Transport Layer Security (TLS) certificate. +type ListenerTlsCertificate struct { + _ struct{} `type:"structure"` + + // An object that represents an AWS Certicate Manager (ACM) certificate. + Acm *ListenerTlsAcmCertificate `locationName:"acm" type:"structure"` + + // An object that represents a local file certificate. The certificate must + // meet specific requirements and you must have proxy authorization enabled. + // For more information, see TLS Encryption (https://docs.aws.amazon.com//app-mesh/latest/userguide/virtual-node-tls.html#virtual-node-tls-prerequisites). + File *ListenerTlsFileCertificate `locationName:"file" type:"structure"` +} + +// String returns the string representation +func (s ListenerTlsCertificate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListenerTlsCertificate) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListenerTlsCertificate) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListenerTlsCertificate"} + if s.Acm != nil { + if err := s.Acm.Validate(); err != nil { + invalidParams.AddNested("Acm", err.(request.ErrInvalidParams)) + } + } + if s.File != nil { + if err := s.File.Validate(); err != nil { + invalidParams.AddNested("File", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAcm sets the Acm field's value. +func (s *ListenerTlsCertificate) SetAcm(v *ListenerTlsAcmCertificate) *ListenerTlsCertificate { + s.Acm = v + return s +} + +// SetFile sets the File field's value. +func (s *ListenerTlsCertificate) SetFile(v *ListenerTlsFileCertificate) *ListenerTlsCertificate { + s.File = v + return s +} + +// An object that represents a local file certificate. The certificate must +// meet specific requirements and you must have proxy authorization enabled. +// For more information, see TLS Encryption (https://docs.aws.amazon.com//app-mesh/latest/userguide/virtual-node-tls.html#virtual-node-tls-prerequisites). +type ListenerTlsFileCertificate struct { + _ struct{} `type:"structure"` + + // CertificateChain is a required field + CertificateChain *string `locationName:"certificateChain" min:"1" type:"string" required:"true"` + + // PrivateKey is a required field + PrivateKey *string `locationName:"privateKey" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListenerTlsFileCertificate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListenerTlsFileCertificate) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListenerTlsFileCertificate) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListenerTlsFileCertificate"} + if s.CertificateChain == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateChain")) + } + 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 +} + +// SetCertificateChain sets the CertificateChain field's value. +func (s *ListenerTlsFileCertificate) SetCertificateChain(v string) *ListenerTlsFileCertificate { + s.CertificateChain = &v + return s +} + +// SetPrivateKey sets the PrivateKey field's value. +func (s *ListenerTlsFileCertificate) SetPrivateKey(v string) *ListenerTlsFileCertificate { + s.PrivateKey = &v + return s +} + +// An object that represents the logging information for a virtual node. type Logging struct { _ struct{} `type:"structure"` - // An object representing the access logging information for a virtual node. + // An object that represents the access logging information for a virtual node. AccessLog *AccessLog `locationName:"accessLog" type:"structure"` } @@ -6168,9 +7263,10 @@ func (s *Logging) SetAccessLog(v *AccessLog) *Logging { return s } -// The range of values to match on. The first character of the range is included -// in the range, though the last character is not. For example, if the range -// specified were 1-100, only values 1-99 would be matched. +// An object that represents the range of values to match on. The first character +// of the range is included in the range, though the last character is not. +// For example, if the range specified were 1-100, only values 1-99 would be +// matched. type MatchRange struct { _ struct{} `type:"structure"` @@ -6219,24 +7315,24 @@ func (s *MatchRange) SetStart(v int64) *MatchRange { return s } -// An object representing a service mesh returned by a describe operation. +// An object that represents a service mesh returned by a describe operation. type MeshData struct { _ struct{} `type:"structure"` // MeshName is a required field MeshName *string `locationName:"meshName" min:"1" type:"string" required:"true"` - // An object representing metadata for a resource. + // An object that represents metadata for a resource. // // Metadata is a required field Metadata *ResourceMetadata `locationName:"metadata" type:"structure" required:"true"` - // An object representing the specification of a service mesh. + // An object that represents the specification of a service mesh. // // Spec is a required field Spec *MeshSpec `locationName:"spec" type:"structure" required:"true"` - // An object representing the status of a service mesh. + // An object that represents the status of a service mesh. // // Status is a required field Status *MeshStatus `locationName:"status" type:"structure" required:"true"` @@ -6276,7 +7372,7 @@ func (s *MeshData) SetStatus(v *MeshStatus) *MeshData { return s } -// An object representing a service mesh returned by a list operation. +// An object that represents a service mesh returned by a list operation. type MeshRef struct { _ struct{} `type:"structure"` @@ -6309,11 +7405,11 @@ func (s *MeshRef) SetMeshName(v string) *MeshRef { return s } -// An object representing the specification of a service mesh. +// An object that represents the specification of a service mesh. type MeshSpec struct { _ struct{} `type:"structure"` - // An object representing the egress filter rules for a service mesh. + // An object that represents the egress filter rules for a service mesh. EgressFilter *EgressFilter `locationName:"egressFilter" type:"structure"` } @@ -6348,7 +7444,7 @@ func (s *MeshSpec) SetEgressFilter(v *EgressFilter) *MeshSpec { return s } -// An object representing the status of a service mesh. +// An object that represents the status of a service mesh. type MeshStatus struct { _ struct{} `type:"structure"` @@ -6371,7 +7467,63 @@ func (s *MeshStatus) SetStatus(v string) *MeshStatus { return s } -// An object representing a virtual node or virtual router listener port mapping. +// The specified resource doesn't exist. Check your request syntax and try again. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// An object that represents a port mapping. type PortMapping struct { _ struct{} `type:"structure"` @@ -6405,25 +7557,82 @@ func (s *PortMapping) Validate() error { invalidParams.Add(request.NewErrParamRequired("Protocol")) } - if invalidParams.Len() > 0 { - return invalidParams + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPort sets the Port field's value. +func (s *PortMapping) SetPort(v int64) *PortMapping { + s.Port = &v + return s +} + +// SetProtocol sets the Protocol field's value. +func (s *PortMapping) SetProtocol(v string) *PortMapping { + s.Protocol = &v + return s +} + +// You can't delete the specified resource because it's in use or required by +// another resource. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { return nil } -// SetPort sets the Port field's value. -func (s *PortMapping) SetPort(v int64) *PortMapping { - s.Port = &v - return s +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetProtocol sets the Protocol field's value. -func (s *PortMapping) SetProtocol(v string) *PortMapping { - s.Protocol = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID } -// An object representing metadata for a resource. +// An object that represents metadata for a resource. type ResourceMetadata struct { _ struct{} `type:"structure"` @@ -6483,14 +7692,14 @@ func (s *ResourceMetadata) SetVersion(v int64) *ResourceMetadata { return s } -// An object representing a route returned by a describe operation. +// An object that represents a route returned by a describe operation. type RouteData struct { _ struct{} `type:"structure"` // MeshName is a required field MeshName *string `locationName:"meshName" min:"1" type:"string" required:"true"` - // An object representing metadata for a resource. + // An object that represents metadata for a resource. // // Metadata is a required field Metadata *ResourceMetadata `locationName:"metadata" type:"structure" required:"true"` @@ -6498,12 +7707,12 @@ type RouteData struct { // RouteName is a required field RouteName *string `locationName:"routeName" min:"1" type:"string" required:"true"` - // An object representing the specification of a route. + // An object that represents a route specification. Specify one route type. // // Spec is a required field Spec *RouteSpec `locationName:"spec" type:"structure" required:"true"` - // An object representing the current status of a route. + // An object that represents the current status of a route. // // Status is a required field Status *RouteStatus `locationName:"status" type:"structure" required:"true"` @@ -6558,7 +7767,7 @@ func (s *RouteData) SetVirtualRouterName(v string) *RouteData { return s } -// An object representing a route returned by a list operation. +// An object that represents a route returned by a list operation. type RouteRef struct { _ struct{} `type:"structure"` @@ -6609,16 +7818,22 @@ func (s *RouteRef) SetVirtualRouterName(v string) *RouteRef { return s } -// An object representing the specification of a route. +// An object that represents a route specification. Specify one route type. type RouteSpec struct { _ struct{} `type:"structure"` - // An object representing the HTTP routing specification for a route. + // An object that represents a gRPC route type. + GrpcRoute *GrpcRoute `locationName:"grpcRoute" type:"structure"` + + // An object that represents an HTTP or HTTP/2 route type. + Http2Route *HttpRoute `locationName:"http2Route" type:"structure"` + + // An object that represents an HTTP or HTTP/2 route type. HttpRoute *HttpRoute `locationName:"httpRoute" type:"structure"` Priority *int64 `locationName:"priority" type:"integer"` - // An object representing the TCP routing specification for a route. + // An object that represents a TCP route type. TcpRoute *TcpRoute `locationName:"tcpRoute" type:"structure"` } @@ -6635,6 +7850,16 @@ func (s RouteSpec) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *RouteSpec) Validate() error { invalidParams := request.ErrInvalidParams{Context: "RouteSpec"} + if s.GrpcRoute != nil { + if err := s.GrpcRoute.Validate(); err != nil { + invalidParams.AddNested("GrpcRoute", err.(request.ErrInvalidParams)) + } + } + if s.Http2Route != nil { + if err := s.Http2Route.Validate(); err != nil { + invalidParams.AddNested("Http2Route", err.(request.ErrInvalidParams)) + } + } if s.HttpRoute != nil { if err := s.HttpRoute.Validate(); err != nil { invalidParams.AddNested("HttpRoute", err.(request.ErrInvalidParams)) @@ -6652,6 +7877,18 @@ func (s *RouteSpec) Validate() error { return nil } +// SetGrpcRoute sets the GrpcRoute field's value. +func (s *RouteSpec) SetGrpcRoute(v *GrpcRoute) *RouteSpec { + s.GrpcRoute = v + return s +} + +// SetHttp2Route sets the Http2Route field's value. +func (s *RouteSpec) SetHttp2Route(v *HttpRoute) *RouteSpec { + s.Http2Route = v + return s +} + // SetHttpRoute sets the HttpRoute field's value. func (s *RouteSpec) SetHttpRoute(v *HttpRoute) *RouteSpec { s.HttpRoute = v @@ -6670,7 +7907,7 @@ func (s *RouteSpec) SetTcpRoute(v *TcpRoute) *RouteSpec { return s } -// An object representing the current status of a route. +// An object that represents the current status of a route. type RouteStatus struct { _ struct{} `type:"structure"` @@ -6694,16 +7931,17 @@ func (s *RouteStatus) SetStatus(v string) *RouteStatus { return s } -// An object representing the service discovery information for a virtual node. +// An object that represents the service discovery information for a virtual +// node. type ServiceDiscovery struct { _ struct{} `type:"structure"` - // An object representing the AWS Cloud Map service discovery information for - // your virtual node. + // An object that represents the AWS Cloud Map service discovery information + // for your virtual node. AwsCloudMap *AwsCloudMapServiceDiscovery `locationName:"awsCloudMap" type:"structure"` - // An object representing the DNS service discovery information for your virtual - // node. + // An object that represents the DNS service discovery information for your + // virtual node. Dns *DnsServiceDiscovery `locationName:"dns" type:"structure"` } @@ -6749,6 +7987,62 @@ func (s *ServiceDiscovery) SetDns(v *DnsServiceDiscovery) *ServiceDiscovery { return s } +// The request has failed due to a temporary failure of the service. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + // Optional metadata that you apply to a resource to assist with categorization // and organization. Each tag consists of a key and an optional value, both // of which you define. Tag keys can have a maximum character length of 128 @@ -6872,12 +8166,11 @@ func (s TagResourceOutput) GoString() string { return s.String() } -// An object representing the TCP routing specification for a route. +// An object that represents a TCP route type. type TcpRoute struct { _ struct{} `type:"structure"` - // An object representing the traffic distribution requirements for matched - // TCP requests. + // An object that represents the action to take if a match is determined. // // Action is a required field Action *TcpRouteAction `locationName:"action" type:"structure" required:"true"` @@ -6917,8 +8210,7 @@ func (s *TcpRoute) SetAction(v *TcpRouteAction) *TcpRoute { return s } -// An object representing the traffic distribution requirements for matched -// TCP requests. +// An object that represents the action to take if a match is determined. type TcpRouteAction struct { _ struct{} `type:"structure"` @@ -6968,6 +8260,305 @@ func (s *TcpRouteAction) SetWeightedTargets(v []*WeightedTarget) *TcpRouteAction return s } +// An object that represents a Transport Layer Security (TLS) validation context. +type TlsValidationContext struct { + _ struct{} `type:"structure"` + + // An object that represents a Transport Layer Security (TLS) validation context + // trust. + // + // Trust is a required field + Trust *TlsValidationContextTrust `locationName:"trust" type:"structure" required:"true"` +} + +// String returns the string representation +func (s TlsValidationContext) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TlsValidationContext) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TlsValidationContext) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TlsValidationContext"} + if s.Trust == nil { + invalidParams.Add(request.NewErrParamRequired("Trust")) + } + if s.Trust != nil { + if err := s.Trust.Validate(); err != nil { + invalidParams.AddNested("Trust", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTrust sets the Trust field's value. +func (s *TlsValidationContext) SetTrust(v *TlsValidationContextTrust) *TlsValidationContext { + s.Trust = v + return s +} + +// An object that represents a TLS validation context trust for an AWS Certicate +// Manager (ACM) certificate. +type TlsValidationContextAcmTrust struct { + _ struct{} `type:"structure"` + + // CertificateAuthorityArns is a required field + CertificateAuthorityArns []*string `locationName:"certificateAuthorityArns" min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s TlsValidationContextAcmTrust) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TlsValidationContextAcmTrust) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TlsValidationContextAcmTrust) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TlsValidationContextAcmTrust"} + if s.CertificateAuthorityArns == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateAuthorityArns")) + } + if s.CertificateAuthorityArns != nil && len(s.CertificateAuthorityArns) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CertificateAuthorityArns", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCertificateAuthorityArns sets the CertificateAuthorityArns field's value. +func (s *TlsValidationContextAcmTrust) SetCertificateAuthorityArns(v []*string) *TlsValidationContextAcmTrust { + s.CertificateAuthorityArns = v + return s +} + +// An object that represents a Transport Layer Security (TLS) validation context +// trust for a local file. +type TlsValidationContextFileTrust struct { + _ struct{} `type:"structure"` + + // CertificateChain is a required field + CertificateChain *string `locationName:"certificateChain" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s TlsValidationContextFileTrust) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TlsValidationContextFileTrust) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TlsValidationContextFileTrust) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TlsValidationContextFileTrust"} + if s.CertificateChain == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateChain")) + } + if s.CertificateChain != nil && len(*s.CertificateChain) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CertificateChain", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCertificateChain sets the CertificateChain field's value. +func (s *TlsValidationContextFileTrust) SetCertificateChain(v string) *TlsValidationContextFileTrust { + s.CertificateChain = &v + return s +} + +// An object that represents a Transport Layer Security (TLS) validation context +// trust. +type TlsValidationContextTrust struct { + _ struct{} `type:"structure"` + + // An object that represents a TLS validation context trust for an AWS Certicate + // Manager (ACM) certificate. + Acm *TlsValidationContextAcmTrust `locationName:"acm" type:"structure"` + + // An object that represents a Transport Layer Security (TLS) validation context + // trust for a local file. + File *TlsValidationContextFileTrust `locationName:"file" type:"structure"` +} + +// String returns the string representation +func (s TlsValidationContextTrust) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TlsValidationContextTrust) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TlsValidationContextTrust) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TlsValidationContextTrust"} + if s.Acm != nil { + if err := s.Acm.Validate(); err != nil { + invalidParams.AddNested("Acm", err.(request.ErrInvalidParams)) + } + } + if s.File != nil { + if err := s.File.Validate(); err != nil { + invalidParams.AddNested("File", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAcm sets the Acm field's value. +func (s *TlsValidationContextTrust) SetAcm(v *TlsValidationContextAcmTrust) *TlsValidationContextTrust { + s.Acm = v + return s +} + +// SetFile sets the File field's value. +func (s *TlsValidationContextTrust) SetFile(v *TlsValidationContextFileTrust) *TlsValidationContextTrust { + s.File = v + return s +} + +// The maximum request rate permitted by the App Mesh APIs has been exceeded +// for your account. For best results, use an increasing or variable sleep interval +// between requests. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request exceeds the maximum allowed number of tags allowed per resource. +// The current limit is 50 user tags per resource. You must reduce the number +// of tags in the request. None of the tags in this request were applied. +type TooManyTagsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyTagsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyTagsException) GoString() string { + return s.String() +} + +func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { + return &TooManyTagsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyTagsException) Code() string { + return "TooManyTagsException" +} + +// Message returns the exception's message. +func (s TooManyTagsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTagsException) OrigErr() error { + return nil +} + +func (s TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTagsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyTagsException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -7038,7 +8629,7 @@ type UpdateMeshInput struct { // MeshName is a required field MeshName *string `location:"uri" locationName:"meshName" min:"1" type:"string" required:"true"` - // An object representing the specification of a service mesh. + // An object that represents the specification of a service mesh. Spec *MeshSpec `locationName:"spec" type:"structure"` } @@ -7094,7 +8685,7 @@ func (s *UpdateMeshInput) SetSpec(v *MeshSpec) *UpdateMeshInput { type UpdateMeshOutput struct { _ struct{} `type:"structure" payload:"Mesh"` - // An object representing a service mesh returned by a describe operation. + // An object that represents a service mesh returned by a describe operation. // // Mesh is a required field Mesh *MeshData `locationName:"mesh" type:"structure" required:"true"` @@ -7127,7 +8718,7 @@ type UpdateRouteInput struct { // RouteName is a required field RouteName *string `location:"uri" locationName:"routeName" min:"1" type:"string" required:"true"` - // An object representing the specification of a route. + // An object that represents a route specification. Specify one route type. // // Spec is a required field Spec *RouteSpec `locationName:"spec" type:"structure" required:"true"` @@ -7215,7 +8806,7 @@ func (s *UpdateRouteInput) SetVirtualRouterName(v string) *UpdateRouteInput { type UpdateRouteOutput struct { _ struct{} `type:"structure" payload:"Route"` - // An object representing a route returned by a describe operation. + // An object that represents a route returned by a describe operation. // // Route is a required field Route *RouteData `locationName:"route" type:"structure" required:"true"` @@ -7245,7 +8836,7 @@ type UpdateVirtualNodeInput struct { // MeshName is a required field MeshName *string `location:"uri" locationName:"meshName" min:"1" type:"string" required:"true"` - // An object representing the specification of a virtual node. + // An object that represents the specification of a virtual node. // // Spec is a required field Spec *VirtualNodeSpec `locationName:"spec" type:"structure" required:"true"` @@ -7321,7 +8912,7 @@ func (s *UpdateVirtualNodeInput) SetVirtualNodeName(v string) *UpdateVirtualNode type UpdateVirtualNodeOutput struct { _ struct{} `type:"structure" payload:"VirtualNode"` - // An object representing a virtual node returned by a describe operation. + // An object that represents a virtual node returned by a describe operation. // // VirtualNode is a required field VirtualNode *VirtualNodeData `locationName:"virtualNode" type:"structure" required:"true"` @@ -7351,7 +8942,7 @@ type UpdateVirtualRouterInput struct { // MeshName is a required field MeshName *string `location:"uri" locationName:"meshName" min:"1" type:"string" required:"true"` - // An object representing the specification of a virtual router. + // An object that represents the specification of a virtual router. // // Spec is a required field Spec *VirtualRouterSpec `locationName:"spec" type:"structure" required:"true"` @@ -7427,7 +9018,7 @@ func (s *UpdateVirtualRouterInput) SetVirtualRouterName(v string) *UpdateVirtual type UpdateVirtualRouterOutput struct { _ struct{} `type:"structure" payload:"VirtualRouter"` - // An object representing a virtual router returned by a describe operation. + // An object that represents a virtual router returned by a describe operation. // // VirtualRouter is a required field VirtualRouter *VirtualRouterData `locationName:"virtualRouter" type:"structure" required:"true"` @@ -7457,7 +9048,7 @@ type UpdateVirtualServiceInput struct { // MeshName is a required field MeshName *string `location:"uri" locationName:"meshName" min:"1" type:"string" required:"true"` - // An object representing the specification of a virtual service. + // An object that represents the specification of a virtual service. // // Spec is a required field Spec *VirtualServiceSpec `locationName:"spec" type:"structure" required:"true"` @@ -7533,7 +9124,7 @@ func (s *UpdateVirtualServiceInput) SetVirtualServiceName(v string) *UpdateVirtu type UpdateVirtualServiceOutput struct { _ struct{} `type:"structure" payload:"VirtualService"` - // An object representing a virtual service returned by a describe operation. + // An object that represents a virtual service returned by a describe operation. // // VirtualService is a required field VirtualService *VirtualServiceData `locationName:"virtualService" type:"structure" required:"true"` @@ -7555,24 +9146,24 @@ func (s *UpdateVirtualServiceOutput) SetVirtualService(v *VirtualServiceData) *U return s } -// An object representing a virtual node returned by a describe operation. +// An object that represents a virtual node returned by a describe operation. type VirtualNodeData struct { _ struct{} `type:"structure"` // MeshName is a required field MeshName *string `locationName:"meshName" min:"1" type:"string" required:"true"` - // An object representing metadata for a resource. + // An object that represents metadata for a resource. // // Metadata is a required field Metadata *ResourceMetadata `locationName:"metadata" type:"structure" required:"true"` - // An object representing the specification of a virtual node. + // An object that represents the specification of a virtual node. // // Spec is a required field Spec *VirtualNodeSpec `locationName:"spec" type:"structure" required:"true"` - // An object representing the current status of the virtual node. + // An object that represents the current status of the virtual node. // // Status is a required field Status *VirtualNodeStatus `locationName:"status" type:"structure" required:"true"` @@ -7621,7 +9212,7 @@ func (s *VirtualNodeData) SetVirtualNodeName(v string) *VirtualNodeData { return s } -// An object representing a virtual node returned by a list operation. +// An object that represents a virtual node returned by a list operation. type VirtualNodeRef struct { _ struct{} `type:"structure"` @@ -7663,7 +9254,7 @@ func (s *VirtualNodeRef) SetVirtualNodeName(v string) *VirtualNodeRef { return s } -// An object representing a virtual node service provider. +// An object that represents a virtual node service provider. type VirtualNodeServiceProvider struct { _ struct{} `type:"structure"` @@ -7703,18 +9294,22 @@ func (s *VirtualNodeServiceProvider) SetVirtualNodeName(v string) *VirtualNodeSe return s } -// An object representing the specification of a virtual node. +// An object that represents the specification of a virtual node. type VirtualNodeSpec struct { _ struct{} `type:"structure"` + // An object that represents the default properties for a backend. + BackendDefaults *BackendDefaults `locationName:"backendDefaults" type:"structure"` + Backends []*Backend `locationName:"backends" type:"list"` Listeners []*Listener `locationName:"listeners" type:"list"` - // An object representing the logging information for a virtual node. + // An object that represents the logging information for a virtual node. Logging *Logging `locationName:"logging" type:"structure"` - // An object representing the service discovery information for a virtual node. + // An object that represents the service discovery information for a virtual + // node. ServiceDiscovery *ServiceDiscovery `locationName:"serviceDiscovery" type:"structure"` } @@ -7731,6 +9326,11 @@ func (s VirtualNodeSpec) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *VirtualNodeSpec) Validate() error { invalidParams := request.ErrInvalidParams{Context: "VirtualNodeSpec"} + if s.BackendDefaults != nil { + if err := s.BackendDefaults.Validate(); err != nil { + invalidParams.AddNested("BackendDefaults", err.(request.ErrInvalidParams)) + } + } if s.Backends != nil { for i, v := range s.Backends { if v == nil { @@ -7768,6 +9368,12 @@ func (s *VirtualNodeSpec) Validate() error { return nil } +// SetBackendDefaults sets the BackendDefaults field's value. +func (s *VirtualNodeSpec) SetBackendDefaults(v *BackendDefaults) *VirtualNodeSpec { + s.BackendDefaults = v + return s +} + // SetBackends sets the Backends field's value. func (s *VirtualNodeSpec) SetBackends(v []*Backend) *VirtualNodeSpec { s.Backends = v @@ -7792,7 +9398,7 @@ func (s *VirtualNodeSpec) SetServiceDiscovery(v *ServiceDiscovery) *VirtualNodeS return s } -// An object representing the current status of the virtual node. +// An object that represents the current status of the virtual node. type VirtualNodeStatus struct { _ struct{} `type:"structure"` @@ -7816,24 +9422,24 @@ func (s *VirtualNodeStatus) SetStatus(v string) *VirtualNodeStatus { return s } -// An object representing a virtual router returned by a describe operation. +// An object that represents a virtual router returned by a describe operation. type VirtualRouterData struct { _ struct{} `type:"structure"` // MeshName is a required field MeshName *string `locationName:"meshName" min:"1" type:"string" required:"true"` - // An object representing metadata for a resource. + // An object that represents metadata for a resource. // // Metadata is a required field Metadata *ResourceMetadata `locationName:"metadata" type:"structure" required:"true"` - // An object representing the specification of a virtual router. + // An object that represents the specification of a virtual router. // // Spec is a required field Spec *VirtualRouterSpec `locationName:"spec" type:"structure" required:"true"` - // An object representing the status of a virtual router. + // An object that represents the status of a virtual router. // // Status is a required field Status *VirtualRouterStatus `locationName:"status" type:"structure" required:"true"` @@ -7882,11 +9488,11 @@ func (s *VirtualRouterData) SetVirtualRouterName(v string) *VirtualRouterData { return s } -// An object representing a virtual router listener. +// An object that represents a virtual router listener. type VirtualRouterListener struct { _ struct{} `type:"structure"` - // An object representing a virtual node or virtual router listener port mapping. + // An object that represents a port mapping. // // PortMapping is a required field PortMapping *PortMapping `locationName:"portMapping" type:"structure" required:"true"` @@ -7926,7 +9532,7 @@ func (s *VirtualRouterListener) SetPortMapping(v *PortMapping) *VirtualRouterLis return s } -// An object representing a virtual router returned by a list operation. +// An object that represents a virtual router returned by a list operation. type VirtualRouterRef struct { _ struct{} `type:"structure"` @@ -7968,7 +9574,7 @@ func (s *VirtualRouterRef) SetVirtualRouterName(v string) *VirtualRouterRef { return s } -// An object representing a virtual node service provider. +// An object that represents a virtual node service provider. type VirtualRouterServiceProvider struct { _ struct{} `type:"structure"` @@ -8008,7 +9614,7 @@ func (s *VirtualRouterServiceProvider) SetVirtualRouterName(v string) *VirtualRo return s } -// An object representing the specification of a virtual router. +// An object that represents the specification of a virtual router. type VirtualRouterSpec struct { _ struct{} `type:"structure"` @@ -8054,7 +9660,7 @@ func (s *VirtualRouterSpec) SetListeners(v []*VirtualRouterListener) *VirtualRou return s } -// An object representing the status of a virtual router. +// An object that represents the status of a virtual router. type VirtualRouterStatus struct { _ struct{} `type:"structure"` @@ -8078,10 +9684,13 @@ func (s *VirtualRouterStatus) SetStatus(v string) *VirtualRouterStatus { return s } -// An object representing a virtual service backend for a virtual node. +// An object that represents a virtual service backend for a virtual node. type VirtualServiceBackend struct { _ struct{} `type:"structure"` + // An object that represents a client policy. + ClientPolicy *ClientPolicy `locationName:"clientPolicy" type:"structure"` + // VirtualServiceName is a required field VirtualServiceName *string `locationName:"virtualServiceName" type:"string" required:"true"` } @@ -8102,6 +9711,11 @@ func (s *VirtualServiceBackend) Validate() error { if s.VirtualServiceName == nil { invalidParams.Add(request.NewErrParamRequired("VirtualServiceName")) } + if s.ClientPolicy != nil { + if err := s.ClientPolicy.Validate(); err != nil { + invalidParams.AddNested("ClientPolicy", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -8109,30 +9723,36 @@ func (s *VirtualServiceBackend) Validate() error { return nil } +// SetClientPolicy sets the ClientPolicy field's value. +func (s *VirtualServiceBackend) SetClientPolicy(v *ClientPolicy) *VirtualServiceBackend { + s.ClientPolicy = v + return s +} + // SetVirtualServiceName sets the VirtualServiceName field's value. func (s *VirtualServiceBackend) SetVirtualServiceName(v string) *VirtualServiceBackend { s.VirtualServiceName = &v return s } -// An object representing a virtual service returned by a describe operation. +// An object that represents a virtual service returned by a describe operation. type VirtualServiceData struct { _ struct{} `type:"structure"` // MeshName is a required field MeshName *string `locationName:"meshName" min:"1" type:"string" required:"true"` - // An object representing metadata for a resource. + // An object that represents metadata for a resource. // // Metadata is a required field Metadata *ResourceMetadata `locationName:"metadata" type:"structure" required:"true"` - // An object representing the specification of a virtual service. + // An object that represents the specification of a virtual service. // // Spec is a required field Spec *VirtualServiceSpec `locationName:"spec" type:"structure" required:"true"` - // An object representing the status of a virtual service. + // An object that represents the status of a virtual service. // // Status is a required field Status *VirtualServiceStatus `locationName:"status" type:"structure" required:"true"` @@ -8181,14 +9801,14 @@ func (s *VirtualServiceData) SetVirtualServiceName(v string) *VirtualServiceData return s } -// An object representing the provider for a virtual service. +// An object that represents the provider for a virtual service. type VirtualServiceProvider struct { _ struct{} `type:"structure"` - // An object representing a virtual node service provider. + // An object that represents a virtual node service provider. VirtualNode *VirtualNodeServiceProvider `locationName:"virtualNode" type:"structure"` - // An object representing a virtual node service provider. + // An object that represents a virtual node service provider. VirtualRouter *VirtualRouterServiceProvider `locationName:"virtualRouter" type:"structure"` } @@ -8234,7 +9854,7 @@ func (s *VirtualServiceProvider) SetVirtualRouter(v *VirtualRouterServiceProvide return s } -// An object representing a virtual service returned by a list operation. +// An object that represents a virtual service returned by a list operation. type VirtualServiceRef struct { _ struct{} `type:"structure"` @@ -8276,11 +9896,11 @@ func (s *VirtualServiceRef) SetVirtualServiceName(v string) *VirtualServiceRef { return s } -// An object representing the specification of a virtual service. +// An object that represents the specification of a virtual service. type VirtualServiceSpec struct { _ struct{} `type:"structure"` - // An object representing the provider for a virtual service. + // An object that represents the provider for a virtual service. Provider *VirtualServiceProvider `locationName:"provider" type:"structure"` } @@ -8315,7 +9935,7 @@ func (s *VirtualServiceSpec) SetProvider(v *VirtualServiceProvider) *VirtualServ return s } -// An object representing the status of a virtual service. +// An object that represents the status of a virtual service. type VirtualServiceStatus struct { _ struct{} `type:"structure"` @@ -8339,10 +9959,11 @@ func (s *VirtualServiceStatus) SetStatus(v string) *VirtualServiceStatus { return s } -// An object representing a target and its relative weight. Traffic is distributed +// An object that represents a target and its relative weight. Traffic is distributed // across targets according to their relative weight. For example, a weighted // target with a relative weight of 50 receives five times as much traffic as -// one with a relative weight of 10. +// one with a relative weight of 10. The total weight for all targets combined +// must be less than or equal to 100. type WeightedTarget struct { _ struct{} `type:"structure"` @@ -8410,6 +10031,23 @@ const ( EgressFilterTypeDropAll = "DROP_ALL" ) +const ( + // GrpcRetryPolicyEventCancelled is a GrpcRetryPolicyEvent enum value + GrpcRetryPolicyEventCancelled = "cancelled" + + // GrpcRetryPolicyEventDeadlineExceeded is a GrpcRetryPolicyEvent enum value + GrpcRetryPolicyEventDeadlineExceeded = "deadline-exceeded" + + // GrpcRetryPolicyEventInternal is a GrpcRetryPolicyEvent enum value + GrpcRetryPolicyEventInternal = "internal" + + // GrpcRetryPolicyEventResourceExhausted is a GrpcRetryPolicyEvent enum value + GrpcRetryPolicyEventResourceExhausted = "resource-exhausted" + + // GrpcRetryPolicyEventUnavailable is a GrpcRetryPolicyEvent enum value + GrpcRetryPolicyEventUnavailable = "unavailable" +) + const ( // HttpMethodConnect is a HttpMethod enum value HttpMethodConnect = "CONNECT" @@ -8447,6 +10085,17 @@ const ( HttpSchemeHttps = "https" ) +const ( + // ListenerTlsModeDisabled is a ListenerTlsMode enum value + ListenerTlsModeDisabled = "DISABLED" + + // ListenerTlsModePermissive is a ListenerTlsMode enum value + ListenerTlsModePermissive = "PERMISSIVE" + + // ListenerTlsModeStrict is a ListenerTlsMode enum value + ListenerTlsModeStrict = "STRICT" +) + const ( // MeshStatusCodeActive is a MeshStatusCode enum value MeshStatusCodeActive = "ACTIVE" @@ -8459,9 +10108,15 @@ const ( ) const ( + // PortProtocolGrpc is a PortProtocol enum value + PortProtocolGrpc = "grpc" + // PortProtocolHttp is a PortProtocol enum value PortProtocolHttp = "http" + // PortProtocolHttp2 is a PortProtocol enum value + PortProtocolHttp2 = "http2" + // PortProtocolTcp is a PortProtocol enum value PortProtocolTcp = "tcp" ) diff --git a/vendor/github.com/aws/aws-sdk-go/service/appmesh/errors.go b/vendor/github.com/aws/aws-sdk-go/service/appmesh/errors.go index 28009c07502..9e60da8d1d0 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/appmesh/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/appmesh/errors.go @@ -2,6 +2,10 @@ package appmesh +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadRequestException for service response error code @@ -74,3 +78,16 @@ const ( // of tags in the request. None of the tags in this request were applied. ErrCodeTooManyTagsException = "TooManyTagsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadRequestException": newErrorBadRequestException, + "ConflictException": newErrorConflictException, + "ForbiddenException": newErrorForbiddenException, + "InternalServerErrorException": newErrorInternalServerErrorException, + "LimitExceededException": newErrorLimitExceededException, + "NotFoundException": newErrorNotFoundException, + "ResourceInUseException": newErrorResourceInUseException, + "ServiceUnavailableException": newErrorServiceUnavailableException, + "TooManyRequestsException": newErrorTooManyRequestsException, + "TooManyTagsException": newErrorTooManyTagsException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/appmesh/service.go b/vendor/github.com/aws/aws-sdk-go/service/appmesh/service.go index 88ea209b40e..2116834b9d0 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/appmesh/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/appmesh/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "App Mesh" // Name of service. EndpointsID = "appmesh" // ID to lookup a service endpoint with. - ServiceID = "App Mesh" // ServiceID is a unique identifer of a specific service. + ServiceID = "App Mesh" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the AppMesh client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a AppMesh client from just a session. // svc := appmesh.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *AppMesh { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "appmesh" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *AppMesh { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *AppMesh { svc := &AppMesh{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2019-01-25", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/appstream/api.go b/vendor/github.com/aws/aws-sdk-go/service/appstream/api.go index 8a325ba01ba..18f4e0a360e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/appstream/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/appstream/api.go @@ -67,24 +67,24 @@ func (c *AppStream) AssociateFleetRequest(input *AssociateFleetInput) (req *requ // See the AWS API reference guide for Amazon AppStream's // API operation AssociateFleet for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // The requested limit exceeds the permitted limit for an account. // -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // -// * ErrCodeIncompatibleImageException "IncompatibleImageException" +// * IncompatibleImageException // The image does not support storage connectors. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The attempted operation is not permitted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/AssociateFleet @@ -164,8 +164,8 @@ func (c *AppStream) BatchAssociateUserStackRequest(input *BatchAssociateUserStac // See the AWS API reference guide for Amazon AppStream's // API operation BatchAssociateUserStack for usage and error information. // -// Returned Error Codes: -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// Returned Error Types: +// * OperationNotPermittedException // The attempted operation is not permitted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/BatchAssociateUserStack @@ -318,24 +318,24 @@ func (c *AppStream) CopyImageRequest(input *CopyImageInput) (req *request.Reques // See the AWS API reference guide for Amazon AppStream's // API operation CopyImage for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// Returned Error Types: +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeResourceNotAvailableException "ResourceNotAvailableException" +// * ResourceNotAvailableException // The specified resource exists and is not in use, but isn't available. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested limit exceeds the permitted limit for an account. // -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // -// * ErrCodeIncompatibleImageException "IncompatibleImageException" +// * IncompatibleImageException // The image does not support storage connectors. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/CopyImage @@ -415,14 +415,14 @@ func (c *AppStream) CreateDirectoryConfigRequest(input *CreateDirectoryConfigInp // See the AWS API reference guide for Amazon AppStream's // API operation CreateDirectoryConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// Returned Error Types: +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested limit exceeds the permitted limit for an account. // -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // @@ -502,36 +502,36 @@ func (c *AppStream) CreateFleetRequest(input *CreateFleetInput) (req *request.Re // See the AWS API reference guide for Amazon AppStream's // API operation CreateFleet for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// Returned Error Types: +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeResourceNotAvailableException "ResourceNotAvailableException" +// * ResourceNotAvailableException // The specified resource exists and is not in use, but isn't available. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested limit exceeds the permitted limit for an account. // -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // -// * ErrCodeInvalidRoleException "InvalidRoleException" +// * InvalidRoleException // The specified role is invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Indicates an incorrect combination of parameters, or a missing parameter. // -// * ErrCodeIncompatibleImageException "IncompatibleImageException" +// * IncompatibleImageException // The image does not support storage connectors. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The attempted operation is not permitted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/CreateFleet @@ -613,36 +613,36 @@ func (c *AppStream) CreateImageBuilderRequest(input *CreateImageBuilderInput) (r // See the AWS API reference guide for Amazon AppStream's // API operation CreateImageBuilder for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // The requested limit exceeds the permitted limit for an account. // -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeResourceNotAvailableException "ResourceNotAvailableException" +// * ResourceNotAvailableException // The specified resource exists and is not in use, but isn't available. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidRoleException "InvalidRoleException" +// * InvalidRoleException // The specified role is invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Indicates an incorrect combination of parameters, or a missing parameter. // -// * ErrCodeIncompatibleImageException "IncompatibleImageException" +// * IncompatibleImageException // The image does not support storage connectors. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The attempted operation is not permitted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/CreateImageBuilder @@ -720,11 +720,11 @@ func (c *AppStream) CreateImageBuilderStreamingURLRequest(input *CreateImageBuil // See the AWS API reference guide for Amazon AppStream's // API operation CreateImageBuilderStreamingURL for usage and error information. // -// Returned Error Codes: -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// Returned Error Types: +// * OperationNotPermittedException // The attempted operation is not permitted. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/CreateImageBuilderStreamingURL @@ -803,27 +803,27 @@ func (c *AppStream) CreateStackRequest(input *CreateStackInput) (req *request.Re // See the AWS API reference guide for Amazon AppStream's // API operation CreateStack for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // The requested limit exceeds the permitted limit for an account. // -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // -// * ErrCodeInvalidRoleException "InvalidRoleException" +// * InvalidRoleException // The specified role is invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Indicates an incorrect combination of parameters, or a missing parameter. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/CreateStack @@ -903,17 +903,17 @@ func (c *AppStream) CreateStreamingURLRequest(input *CreateStreamingURLInput) (r // See the AWS API reference guide for Amazon AppStream's // API operation CreateStreamingURL for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeResourceNotAvailableException "ResourceNotAvailableException" +// * ResourceNotAvailableException // The specified resource exists and is not in use, but isn't available. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The attempted operation is not permitted. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Indicates an incorrect combination of parameters, or a missing parameter. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/CreateStreamingURL @@ -991,15 +991,15 @@ func (c *AppStream) CreateUsageReportSubscriptionRequest(input *CreateUsageRepor // See the AWS API reference guide for Amazon AppStream's // API operation CreateUsageReportSubscription for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRoleException "InvalidRoleException" +// Returned Error Types: +// * InvalidRoleException // The specified role is invalid. // -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested limit exceeds the permitted limit for an account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/CreateUsageReportSubscription @@ -1078,21 +1078,21 @@ func (c *AppStream) CreateUserRequest(input *CreateUserInput) (req *request.Requ // See the AWS API reference guide for Amazon AppStream's // API operation CreateUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// Returned Error Types: +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Indicates an incorrect combination of parameters, or a missing parameter. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested limit exceeds the permitted limit for an account. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The attempted operation is not permitted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/CreateUser @@ -1173,11 +1173,11 @@ func (c *AppStream) DeleteDirectoryConfigRequest(input *DeleteDirectoryConfigInp // See the AWS API reference guide for Amazon AppStream's // API operation DeleteDirectoryConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The specified resource is in use. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DeleteDirectoryConfig @@ -1256,14 +1256,14 @@ func (c *AppStream) DeleteFleetRequest(input *DeleteFleetInput) (req *request.Re // See the AWS API reference guide for Amazon AppStream's // API operation DeleteFleet for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The specified resource is in use. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DeleteFleet @@ -1342,17 +1342,17 @@ func (c *AppStream) DeleteImageRequest(input *DeleteImageInput) (req *request.Re // See the AWS API reference guide for Amazon AppStream's // API operation DeleteImage for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The specified resource is in use. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The attempted operation is not permitted. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DeleteImage @@ -1430,14 +1430,14 @@ func (c *AppStream) DeleteImageBuilderRequest(input *DeleteImageBuilderInput) (r // See the AWS API reference guide for Amazon AppStream's // API operation DeleteImageBuilder for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The attempted operation is not permitted. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DeleteImageBuilder @@ -1518,11 +1518,11 @@ func (c *AppStream) DeleteImagePermissionsRequest(input *DeleteImagePermissionsI // See the AWS API reference guide for Amazon AppStream's // API operation DeleteImagePermissions for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotAvailableException "ResourceNotAvailableException" +// Returned Error Types: +// * ResourceNotAvailableException // The specified resource exists and is not in use, but isn't available. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DeleteImagePermissions @@ -1604,14 +1604,14 @@ func (c *AppStream) DeleteStackRequest(input *DeleteStackInput) (req *request.Re // See the AWS API reference guide for Amazon AppStream's // API operation DeleteStack for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The specified resource is in use. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DeleteStack @@ -1690,12 +1690,12 @@ func (c *AppStream) DeleteUsageReportSubscriptionRequest(input *DeleteUsageRepor // See the AWS API reference guide for Amazon AppStream's // API operation DeleteUsageReportSubscription for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// Returned Error Types: +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DeleteUsageReportSubscription @@ -1774,8 +1774,8 @@ func (c *AppStream) DeleteUserRequest(input *DeleteUserInput) (req *request.Requ // See the AWS API reference guide for Amazon AppStream's // API operation DeleteUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DeleteUser @@ -1860,8 +1860,8 @@ func (c *AppStream) DescribeDirectoryConfigsRequest(input *DescribeDirectoryConf // See the AWS API reference guide for Amazon AppStream's // API operation DescribeDirectoryConfigs for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DescribeDirectoryConfigs @@ -1940,8 +1940,8 @@ func (c *AppStream) DescribeFleetsRequest(input *DescribeFleetsInput) (req *requ // See the AWS API reference guide for Amazon AppStream's // API operation DescribeFleets for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DescribeFleets @@ -2021,8 +2021,8 @@ func (c *AppStream) DescribeImageBuildersRequest(input *DescribeImageBuildersInp // See the AWS API reference guide for Amazon AppStream's // API operation DescribeImageBuilders for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DescribeImageBuilders @@ -2107,8 +2107,8 @@ func (c *AppStream) DescribeImagePermissionsRequest(input *DescribeImagePermissi // See the AWS API reference guide for Amazon AppStream's // API operation DescribeImagePermissions for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DescribeImagePermissions @@ -2176,10 +2176,12 @@ func (c *AppStream) DescribeImagePermissionsPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeImagePermissionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeImagePermissionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2244,11 +2246,11 @@ func (c *AppStream) DescribeImagesRequest(input *DescribeImagesInput) (req *requ // See the AWS API reference guide for Amazon AppStream's // API operation DescribeImages for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// Returned Error Types: +// * InvalidParameterCombinationException // Indicates an incorrect combination of parameters, or a missing parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DescribeImages @@ -2316,10 +2318,12 @@ func (c *AppStream) DescribeImagesPagesWithContext(ctx aws.Context, input *Descr }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeImagesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeImagesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2379,8 +2383,8 @@ func (c *AppStream) DescribeSessionsRequest(input *DescribeSessionsInput) (req * // See the AWS API reference guide for Amazon AppStream's // API operation DescribeSessions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// Returned Error Types: +// * InvalidParameterCombinationException // Indicates an incorrect combination of parameters, or a missing parameter. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DescribeSessions @@ -2459,8 +2463,8 @@ func (c *AppStream) DescribeStacksRequest(input *DescribeStacksInput) (req *requ // See the AWS API reference guide for Amazon AppStream's // API operation DescribeStacks for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DescribeStacks @@ -2538,11 +2542,11 @@ func (c *AppStream) DescribeUsageReportSubscriptionsRequest(input *DescribeUsage // See the AWS API reference guide for Amazon AppStream's // API operation DescribeUsageReportSubscriptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // @@ -2627,8 +2631,8 @@ func (c *AppStream) DescribeUserStackAssociationsRequest(input *DescribeUserStac // See the AWS API reference guide for Amazon AppStream's // API operation DescribeUserStackAssociations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// Returned Error Types: +// * InvalidParameterCombinationException // Indicates an incorrect combination of parameters, or a missing parameter. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DescribeUserStackAssociations @@ -2706,11 +2710,11 @@ func (c *AppStream) DescribeUsersRequest(input *DescribeUsersInput) (req *reques // See the AWS API reference guide for Amazon AppStream's // API operation DescribeUsers for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Indicates an incorrect combination of parameters, or a missing parameter. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DescribeUsers @@ -2790,8 +2794,8 @@ func (c *AppStream) DisableUserRequest(input *DisableUserInput) (req *request.Re // See the AWS API reference guide for Amazon AppStream's // API operation DisableUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DisableUser @@ -2870,14 +2874,14 @@ func (c *AppStream) DisassociateFleetRequest(input *DisassociateFleetInput) (req // See the AWS API reference guide for Amazon AppStream's // API operation DisassociateFleet for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The specified resource is in use. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/DisassociateFleet @@ -2957,11 +2961,11 @@ func (c *AppStream) EnableUserRequest(input *EnableUserInput) (req *request.Requ // See the AWS API reference guide for Amazon AppStream's // API operation EnableUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // @@ -3267,8 +3271,8 @@ func (c *AppStream) ListTagsForResourceRequest(input *ListTagsForResourceInput) // See the AWS API reference guide for Amazon AppStream's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/ListTagsForResource @@ -3347,27 +3351,27 @@ func (c *AppStream) StartFleetRequest(input *StartFleetInput) (req *request.Requ // See the AWS API reference guide for Amazon AppStream's // API operation StartFleet for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The attempted operation is not permitted. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested limit exceeds the permitted limit for an account. // -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // -// * ErrCodeResourceNotAvailableException "ResourceNotAvailableException" +// * ResourceNotAvailableException // The specified resource exists and is not in use, but isn't available. // -// * ErrCodeInvalidRoleException "InvalidRoleException" +// * InvalidRoleException // The specified role is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/StartFleet @@ -3445,21 +3449,21 @@ func (c *AppStream) StartImageBuilderRequest(input *StartImageBuilderInput) (req // See the AWS API reference guide for Amazon AppStream's // API operation StartImageBuilder for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotAvailableException "ResourceNotAvailableException" +// Returned Error Types: +// * ResourceNotAvailableException // The specified resource exists and is not in use, but isn't available. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // -// * ErrCodeIncompatibleImageException "IncompatibleImageException" +// * IncompatibleImageException // The image does not support storage connectors. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/StartImageBuilder @@ -3538,11 +3542,11 @@ func (c *AppStream) StopFleetRequest(input *StopFleetInput) (req *request.Reques // See the AWS API reference guide for Amazon AppStream's // API operation StopFleet for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/StopFleet @@ -3620,14 +3624,14 @@ func (c *AppStream) StopImageBuilderRequest(input *StopImageBuilderInput) (req * // See the AWS API reference guide for Amazon AppStream's // API operation StopImageBuilder for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The attempted operation is not permitted. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/StopImageBuilder @@ -3716,15 +3720,15 @@ func (c *AppStream) TagResourceRequest(input *TagResourceInput) (req *request.Re // See the AWS API reference guide for Amazon AppStream's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // The requested limit exceeds the permitted limit for an account. // -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/TagResource @@ -3809,8 +3813,8 @@ func (c *AppStream) UntagResourceRequest(input *UntagResourceInput) (req *reques // See the AWS API reference guide for Amazon AppStream's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/UntagResource @@ -3890,14 +3894,14 @@ func (c *AppStream) UpdateDirectoryConfigRequest(input *UpdateDirectoryConfigInp // See the AWS API reference guide for Amazon AppStream's // API operation UpdateDirectoryConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The specified resource is in use. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/UpdateDirectoryConfig @@ -3981,36 +3985,36 @@ func (c *AppStream) UpdateFleetRequest(input *UpdateFleetInput) (req *request.Re // See the AWS API reference guide for Amazon AppStream's // API operation UpdateFleet for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The specified resource is in use. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested limit exceeds the permitted limit for an account. // -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // -// * ErrCodeInvalidRoleException "InvalidRoleException" +// * InvalidRoleException // The specified role is invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeResourceNotAvailableException "ResourceNotAvailableException" +// * ResourceNotAvailableException // The specified resource exists and is not in use, but isn't available. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Indicates an incorrect combination of parameters, or a missing parameter. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // -// * ErrCodeIncompatibleImageException "IncompatibleImageException" +// * IncompatibleImageException // The image does not support storage connectors. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The attempted operation is not permitted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/UpdateFleet @@ -4089,14 +4093,14 @@ func (c *AppStream) UpdateImagePermissionsRequest(input *UpdateImagePermissionsI // See the AWS API reference guide for Amazon AppStream's // API operation UpdateImagePermissions for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeResourceNotAvailableException "ResourceNotAvailableException" +// * ResourceNotAvailableException // The specified resource exists and is not in use, but isn't available. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested limit exceeds the permitted limit for an account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/UpdateImagePermissions @@ -4174,33 +4178,33 @@ func (c *AppStream) UpdateStackRequest(input *UpdateStackInput) (req *request.Re // See the AWS API reference guide for Amazon AppStream's // API operation UpdateStack for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // -// * ErrCodeInvalidRoleException "InvalidRoleException" +// * InvalidRoleException // The specified role is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Indicates an incorrect combination of parameters, or a missing parameter. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested limit exceeds the permitted limit for an account. // -// * ErrCodeInvalidAccountStatusException "InvalidAccountStatusException" +// * InvalidAccountStatusException // The resource cannot be created because your AWS account is suspended. For // assistance, contact AWS Support. // -// * ErrCodeIncompatibleImageException "IncompatibleImageException" +// * IncompatibleImageException // The image does not support storage connectors. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The attempted operation is not permitted. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // An API error occurred. Wait a few minutes and try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appstream-2016-12-01/UpdateStack @@ -4770,6 +4774,63 @@ func (s *ComputeCapacityStatus) SetRunning(v int64) *ComputeCapacityStatus { return s } +// An API error occurred. Wait a few minutes and try again. +type ConcurrentModificationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message in the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentModificationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentModificationException) GoString() string { + return s.String() +} + +func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { + return &ConcurrentModificationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentModificationException) Code() string { + return "ConcurrentModificationException" +} + +// Message returns the exception's message. +func (s ConcurrentModificationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentModificationException) OrigErr() error { + return nil +} + +func (s ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentModificationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentModificationException) RequestID() string { + return s.respMetadata.RequestID +} + type CopyImageInput struct { _ struct{} `type:"structure"` @@ -5014,7 +5075,13 @@ type CreateFleetInput struct { // The Amazon Resource Name (ARN) of the IAM role to apply to the fleet. To // assume a role, a fleet instance calls the AWS Security Token Service (STS) // AssumeRole API operation and passes the ARN of the role to use. The operation - // creates a new session with temporary credentials. + // creates a new session with temporary credentials. AppStream 2.0 retrieves + // the temporary credentials and creates the AppStream_Machine_Role credential + // profile on the instance. + // + // For more information, see Using an IAM Role to Grant Permissions to Applications + // and Scripts Running on AppStream 2.0 Streaming Instances (https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html) + // in the Amazon AppStream 2.0 Administration Guide. IamRoleArn *string `type:"string"` // The amount of time that users can be idle (inactive) before they are disconnected @@ -5315,7 +5382,13 @@ type CreateImageBuilderInput struct { // The Amazon Resource Name (ARN) of the IAM role to apply to the image builder. // To assume a role, the image builder calls the AWS Security Token Service // (STS) AssumeRole API operation and passes the ARN of the role to use. The - // operation creates a new session with temporary credentials. + // operation creates a new session with temporary credentials. AppStream 2.0 + // retrieves the temporary credentials and creates the AppStream_Machine_Role + // credential profile on the instance. + // + // For more information, see Using an IAM Role to Grant Permissions to Applications + // and Scripts Running on AppStream 2.0 Streaming Instances (https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html) + // in the Amazon AppStream 2.0 Administration Guide. IamRoleArn *string `type:"string"` // The ARN of the public, private, or shared image to use. @@ -5324,7 +5397,48 @@ type CreateImageBuilderInput struct { // The name of the image used to create the image builder. ImageName *string `min:"1" type:"string"` - // The instance type to use when launching the image builder. + // The instance type to use when launching the image builder. The following + // instance types are available: + // + // * stream.standard.medium + // + // * stream.standard.large + // + // * stream.compute.large + // + // * stream.compute.xlarge + // + // * stream.compute.2xlarge + // + // * stream.compute.4xlarge + // + // * stream.compute.8xlarge + // + // * stream.memory.large + // + // * stream.memory.xlarge + // + // * stream.memory.2xlarge + // + // * stream.memory.4xlarge + // + // * stream.memory.8xlarge + // + // * stream.graphics-design.large + // + // * stream.graphics-design.xlarge + // + // * stream.graphics-design.2xlarge + // + // * stream.graphics-design.4xlarge + // + // * stream.graphics-desktop.2xlarge + // + // * stream.graphics-pro.4xlarge + // + // * stream.graphics-pro.8xlarge + // + // * stream.graphics-pro.16xlarge // // InstanceType is a required field InstanceType *string `min:"1" type:"string" required:"true"` @@ -5606,6 +5720,11 @@ type CreateStackInput struct { // The stack name to display. DisplayName *string `type:"string"` + // The domains where AppStream 2.0 streaming sessions can be embedded in an + // iframe. You must approve the domains that you want to host embedded AppStream + // 2.0 streaming sessions. + EmbedHostDomains []*string `min:"1" type:"list"` + // The URL that users are redirected to after they click the Send Feedback link. // If no URL is specified, no Send Feedback link is displayed. FeedbackURL *string `type:"string"` @@ -5657,6 +5776,9 @@ func (s *CreateStackInput) Validate() error { if s.AccessEndpoints != nil && len(s.AccessEndpoints) < 1 { invalidParams.Add(request.NewErrParamMinLen("AccessEndpoints", 1)) } + if s.EmbedHostDomains != nil && len(s.EmbedHostDomains) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EmbedHostDomains", 1)) + } if s.Name == nil { invalidParams.Add(request.NewErrParamRequired("Name")) } @@ -5732,6 +5854,12 @@ func (s *CreateStackInput) SetDisplayName(v string) *CreateStackInput { return s } +// SetEmbedHostDomains sets the EmbedHostDomains field's value. +func (s *CreateStackInput) SetEmbedHostDomains(v []*string) *CreateStackInput { + s.EmbedHostDomains = v + return s +} + // SetFeedbackURL sets the FeedbackURL field's value. func (s *CreateStackInput) SetFeedbackURL(v string) *CreateStackInput { s.FeedbackURL = &v @@ -7947,7 +8075,13 @@ type Fleet struct { // The ARN of the IAM role that is applied to the fleet. To assume a role, the // fleet instance calls the AWS Security Token Service (STS) AssumeRole API // operation and passes the ARN of the role to use. The operation creates a - // new session with temporary credentials. + // new session with temporary credentials. AppStream 2.0 retrieves the temporary + // credentials and creates the AppStream_Machine_Role credential profile on + // the instance. + // + // For more information, see Using an IAM Role to Grant Permissions to Applications + // and Scripts Running on AppStream 2.0 Streaming Instances (https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html) + // in the Amazon AppStream 2.0 Administration Guide. IamRoleArn *string `type:"string"` // The amount of time that users can be idle (inactive) before they are disconnected @@ -7980,7 +8114,48 @@ type Fleet struct { // The name of the image used to create the fleet. ImageName *string `min:"1" type:"string"` - // The instance type to use when launching fleet instances. + // The instance type to use when launching fleet instances. The following instance + // types are available: + // + // * stream.standard.medium + // + // * stream.standard.large + // + // * stream.compute.large + // + // * stream.compute.xlarge + // + // * stream.compute.2xlarge + // + // * stream.compute.4xlarge + // + // * stream.compute.8xlarge + // + // * stream.memory.large + // + // * stream.memory.xlarge + // + // * stream.memory.2xlarge + // + // * stream.memory.4xlarge + // + // * stream.memory.8xlarge + // + // * stream.graphics-design.large + // + // * stream.graphics-design.xlarge + // + // * stream.graphics-design.2xlarge + // + // * stream.graphics-design.4xlarge + // + // * stream.graphics-desktop.2xlarge + // + // * stream.graphics-pro.4xlarge + // + // * stream.graphics-pro.8xlarge + // + // * stream.graphics-pro.16xlarge // // InstanceType is a required field InstanceType *string `min:"1" type:"string" required:"true"` @@ -8365,7 +8540,13 @@ type ImageBuilder struct { // The ARN of the IAM role that is applied to the image builder. To assume a // role, the image builder calls the AWS Security Token Service (STS) AssumeRole // API operation and passes the ARN of the role to use. The operation creates - // a new session with temporary credentials. + // a new session with temporary credentials. AppStream 2.0 retrieves the temporary + // credentials and creates the AppStream_Machine_Role credential profile on + // the instance. + // + // For more information, see Using an IAM Role to Grant Permissions to Applications + // and Scripts Running on AppStream 2.0 Streaming Instances (https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html) + // in the Amazon AppStream 2.0 Administration Guide. IamRoleArn *string `type:"string"` // The ARN of the image from which this builder was created. @@ -8374,7 +8555,48 @@ type ImageBuilder struct { // The image builder errors. ImageBuilderErrors []*ResourceError `type:"list"` - // The instance type for the image builder. + // The instance type for the image builder. The following instance types are + // available: + // + // * stream.standard.medium + // + // * stream.standard.large + // + // * stream.compute.large + // + // * stream.compute.xlarge + // + // * stream.compute.2xlarge + // + // * stream.compute.4xlarge + // + // * stream.compute.8xlarge + // + // * stream.memory.large + // + // * stream.memory.xlarge + // + // * stream.memory.2xlarge + // + // * stream.memory.4xlarge + // + // * stream.memory.8xlarge + // + // * stream.graphics-design.large + // + // * stream.graphics-design.xlarge + // + // * stream.graphics-design.2xlarge + // + // * stream.graphics-design.4xlarge + // + // * stream.graphics-desktop.2xlarge + // + // * stream.graphics-pro.4xlarge + // + // * stream.graphics-pro.8xlarge + // + // * stream.graphics-pro.16xlarge InstanceType *string `min:"1" type:"string"` // The name of the image builder. @@ -8615,6 +8837,235 @@ func (s *ImageStateChangeReason) SetMessage(v string) *ImageStateChangeReason { return s } +// The image does not support storage connectors. +type IncompatibleImageException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message in the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s IncompatibleImageException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IncompatibleImageException) GoString() string { + return s.String() +} + +func newErrorIncompatibleImageException(v protocol.ResponseMetadata) error { + return &IncompatibleImageException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IncompatibleImageException) Code() string { + return "IncompatibleImageException" +} + +// Message returns the exception's message. +func (s IncompatibleImageException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IncompatibleImageException) OrigErr() error { + return nil +} + +func (s IncompatibleImageException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IncompatibleImageException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IncompatibleImageException) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource cannot be created because your AWS account is suspended. For +// assistance, contact AWS Support. +type InvalidAccountStatusException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message in the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidAccountStatusException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidAccountStatusException) GoString() string { + return s.String() +} + +func newErrorInvalidAccountStatusException(v protocol.ResponseMetadata) error { + return &InvalidAccountStatusException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidAccountStatusException) Code() string { + return "InvalidAccountStatusException" +} + +// Message returns the exception's message. +func (s InvalidAccountStatusException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAccountStatusException) OrigErr() error { + return nil +} + +func (s InvalidAccountStatusException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAccountStatusException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAccountStatusException) RequestID() string { + return s.respMetadata.RequestID +} + +// Indicates an incorrect combination of parameters, or a missing parameter. +type InvalidParameterCombinationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message in the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterCombinationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterCombinationException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterCombinationException(v protocol.ResponseMetadata) error { + return &InvalidParameterCombinationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterCombinationException) Code() string { + return "InvalidParameterCombinationException" +} + +// Message returns the exception's message. +func (s InvalidParameterCombinationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterCombinationException) OrigErr() error { + return nil +} + +func (s InvalidParameterCombinationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterCombinationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterCombinationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified role is invalid. +type InvalidRoleException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message in the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidRoleException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRoleException) GoString() string { + return s.String() +} + +func newErrorInvalidRoleException(v protocol.ResponseMetadata) error { + return &InvalidRoleException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRoleException) Code() string { + return "InvalidRoleException" +} + +// Message returns the exception's message. +func (s InvalidRoleException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRoleException) OrigErr() error { + return nil +} + +func (s InvalidRoleException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRoleException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRoleException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes the error that is returned when a usage report can't be generated. type LastReportGenerationExecutionError struct { _ struct{} `type:"structure"` @@ -8650,6 +9101,63 @@ func (s *LastReportGenerationExecutionError) SetErrorMessage(v string) *LastRepo return s } +// The requested limit exceeds the permitted limit for an account. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message in the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListAssociatedFleetsInput struct { _ struct{} `type:"structure"` @@ -8921,6 +9429,120 @@ func (s *NetworkAccessConfiguration) SetEniPrivateIpAddress(v string) *NetworkAc return s } +// The attempted operation is not permitted. +type OperationNotPermittedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message in the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s OperationNotPermittedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OperationNotPermittedException) GoString() string { + return s.String() +} + +func newErrorOperationNotPermittedException(v protocol.ResponseMetadata) error { + return &OperationNotPermittedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OperationNotPermittedException) Code() string { + return "OperationNotPermittedException" +} + +// Message returns the exception's message. +func (s OperationNotPermittedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OperationNotPermittedException) OrigErr() error { + return nil +} + +func (s OperationNotPermittedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OperationNotPermittedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OperationNotPermittedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message in the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes a resource error. type ResourceError struct { _ struct{} `type:"structure"` @@ -8963,6 +9585,177 @@ func (s *ResourceError) SetErrorTimestamp(v time.Time) *ResourceError { return s } +// The specified resource is in use. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message in the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource exists and is not in use, but isn't available. +type ResourceNotAvailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message in the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotAvailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotAvailableException) GoString() string { + return s.String() +} + +func newErrorResourceNotAvailableException(v protocol.ResponseMetadata) error { + return &ResourceNotAvailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotAvailableException) Code() string { + return "ResourceNotAvailableException" +} + +// Message returns the exception's message. +func (s ResourceNotAvailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotAvailableException) OrigErr() error { + return nil +} + +func (s ResourceNotAvailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotAvailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotAvailableException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource was not found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message in the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes the credentials for the service account used by the fleet or image // builder to connect to the directory. type ServiceAccountCredentials struct { @@ -9208,6 +10001,11 @@ type Stack struct { // The stack name to display. DisplayName *string `min:"1" type:"string"` + // The domains where AppStream 2.0 streaming sessions can be embedded in an + // iframe. You must approve the domains that you want to host embedded AppStream + // 2.0 streaming sessions. + EmbedHostDomains []*string `min:"1" type:"list"` + // The URL that users are redirected to after they click the Send Feedback link. // If no URL is specified, no Send Feedback link is displayed. FeedbackURL *string `type:"string"` @@ -9277,6 +10075,12 @@ func (s *Stack) SetDisplayName(v string) *Stack { return s } +// SetEmbedHostDomains sets the EmbedHostDomains field's value. +func (s *Stack) SetEmbedHostDomains(v []*string) *Stack { + s.EmbedHostDomains = v + return s +} + // SetFeedbackURL sets the FeedbackURL field's value. func (s *Stack) SetFeedbackURL(v string) *Stack { s.FeedbackURL = &v @@ -9927,7 +10731,13 @@ type UpdateFleetInput struct { // The Amazon Resource Name (ARN) of the IAM role to apply to the fleet. To // assume a role, a fleet instance calls the AWS Security Token Service (STS) // AssumeRole API operation and passes the ARN of the role to use. The operation - // creates a new session with temporary credentials. + // creates a new session with temporary credentials. AppStream 2.0 retrieves + // the temporary credentials and creates the AppStream_Machine_Role credential + // profile on the instance. + // + // For more information, see Using an IAM Role to Grant Permissions to Applications + // and Scripts Running on AppStream 2.0 Streaming Instances (https://docs.aws.amazon.com/appstream2/latest/developerguide/using-iam-roles-to-grant-permissions-to-applications-scripts-streaming-instances.html) + // in the Amazon AppStream 2.0 Administration Guide. IamRoleArn *string `type:"string"` // The amount of time that users can be idle (inactive) before they are disconnected @@ -10280,6 +11090,11 @@ type UpdateStackInput struct { // The stack name to display. DisplayName *string `type:"string"` + // The domains where AppStream 2.0 streaming sessions can be embedded in an + // iframe. You must approve the domains that you want to host embedded AppStream + // 2.0 streaming sessions. + EmbedHostDomains []*string `min:"1" type:"list"` + // The URL that users are redirected to after they choose the Send Feedback // link. If no URL is specified, no Send Feedback link is displayed. FeedbackURL *string `type:"string"` @@ -10316,6 +11131,9 @@ func (s *UpdateStackInput) Validate() error { if s.AccessEndpoints != nil && len(s.AccessEndpoints) < 1 { invalidParams.Add(request.NewErrParamMinLen("AccessEndpoints", 1)) } + if s.EmbedHostDomains != nil && len(s.EmbedHostDomains) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EmbedHostDomains", 1)) + } if s.Name == nil { invalidParams.Add(request.NewErrParamRequired("Name")) } @@ -10403,6 +11221,12 @@ func (s *UpdateStackInput) SetDisplayName(v string) *UpdateStackInput { return s } +// SetEmbedHostDomains sets the EmbedHostDomains field's value. +func (s *UpdateStackInput) SetEmbedHostDomains(v []*string) *UpdateStackInput { + s.EmbedHostDomains = v + return s +} + // SetFeedbackURL sets the FeedbackURL field's value. func (s *UpdateStackInput) SetFeedbackURL(v string) *UpdateStackInput { s.FeedbackURL = &v @@ -11128,6 +11952,9 @@ const ( // StackAttributeUserSettings is a StackAttribute enum value StackAttributeUserSettings = "USER_SETTINGS" + // StackAttributeEmbedHostDomains is a StackAttribute enum value + StackAttributeEmbedHostDomains = "EMBED_HOST_DOMAINS" + // StackAttributeIamRoleArn is a StackAttribute enum value StackAttributeIamRoleArn = "IAM_ROLE_ARN" diff --git a/vendor/github.com/aws/aws-sdk-go/service/appstream/errors.go b/vendor/github.com/aws/aws-sdk-go/service/appstream/errors.go index 5f8f857ae11..285b79bdeda 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/appstream/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/appstream/errors.go @@ -2,6 +2,10 @@ package appstream +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeConcurrentModificationException for service response error code @@ -71,3 +75,17 @@ const ( // The specified resource was not found. ErrCodeResourceNotFoundException = "ResourceNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ConcurrentModificationException": newErrorConcurrentModificationException, + "IncompatibleImageException": newErrorIncompatibleImageException, + "InvalidAccountStatusException": newErrorInvalidAccountStatusException, + "InvalidParameterCombinationException": newErrorInvalidParameterCombinationException, + "InvalidRoleException": newErrorInvalidRoleException, + "LimitExceededException": newErrorLimitExceededException, + "OperationNotPermittedException": newErrorOperationNotPermittedException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotAvailableException": newErrorResourceNotAvailableException, + "ResourceNotFoundException": newErrorResourceNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/appstream/service.go b/vendor/github.com/aws/aws-sdk-go/service/appstream/service.go index 168cf44e0f7..c9f50f968d5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/appstream/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/appstream/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "appstream2" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "AppStream" // ServiceID is a unique identifer of a specific service. + ServiceID = "AppStream" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the AppStream client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a AppStream client from just a session. // svc := appstream.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *AppStream { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "appstream" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *AppStream { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *AppStream { svc := &AppStream{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-12-01", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/appsync/api.go b/vendor/github.com/aws/aws-sdk-go/service/appsync/api.go index 42881d35619..38075bece57 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/appsync/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/appsync/api.go @@ -12,6 +12,100 @@ import ( "github.com/aws/aws-sdk-go/private/protocol/restjson" ) +const opCreateApiCache = "CreateApiCache" + +// CreateApiCacheRequest generates a "aws/request.Request" representing the +// client's request for the CreateApiCache operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateApiCache for more information on using the CreateApiCache +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateApiCacheRequest method. +// req, resp := client.CreateApiCacheRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/CreateApiCache +func (c *AppSync) CreateApiCacheRequest(input *CreateApiCacheInput) (req *request.Request, output *CreateApiCacheOutput) { + op := &request.Operation{ + Name: opCreateApiCache, + HTTPMethod: "POST", + HTTPPath: "/v1/apis/{apiId}/ApiCaches", + } + + if input == nil { + input = &CreateApiCacheInput{} + } + + output = &CreateApiCacheOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateApiCache API operation for AWS AppSync. +// +// Creates a cache for the GraphQL 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 AppSync's +// API operation CreateApiCache for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// The request is not well formed. For example, a value is invalid or a required +// field is missing. Check the field values, and then try again. +// +// * ConcurrentModificationException +// Another modification is in progress at this time and it must complete before +// you can make your change. +// +// * NotFoundException +// The resource specified in the request was not found. Check the resource, +// and then try again. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * InternalFailureException +// An internal AWS AppSync error occurred. Try your request again. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/CreateApiCache +func (c *AppSync) CreateApiCache(input *CreateApiCacheInput) (*CreateApiCacheOutput, error) { + req, out := c.CreateApiCacheRequest(input) + return out, req.Send() +} + +// CreateApiCacheWithContext is the same as CreateApiCache with the addition of +// the ability to pass a context and additional request options. +// +// See CreateApiCache for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AppSync) CreateApiCacheWithContext(ctx aws.Context, input *CreateApiCacheInput, opts ...request.Option) (*CreateApiCacheOutput, error) { + req, out := c.CreateApiCacheRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateApiKey = "CreateApiKey" // CreateApiKeyRequest generates a "aws/request.Request" representing the @@ -66,31 +160,31 @@ func (c *AppSync) CreateApiKeyRequest(input *CreateApiKeyInput) (req *request.Re // See the AWS API reference guide for AWS AppSync's // API operation CreateApiKey for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // -// * ErrCodeApiKeyLimitExceededException "ApiKeyLimitExceededException" +// * ApiKeyLimitExceededException // The API key exceeded a limit. Try your request again. // -// * ErrCodeApiKeyValidityOutOfBoundsException "ApiKeyValidityOutOfBoundsException" +// * ApiKeyValidityOutOfBoundsException // The API key expiration must be set to a value between 1 and 365 days from // creation (for CreateApiKey) or from update (for UpdateApiKey). // @@ -169,23 +263,23 @@ func (c *AppSync) CreateDataSourceRequest(input *CreateDataSourceInput) (req *re // See the AWS API reference guide for AWS AppSync's // API operation CreateDataSource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/CreateDataSource @@ -266,19 +360,19 @@ func (c *AppSync) CreateFunctionRequest(input *CreateFunctionInput) (req *reques // See the AWS API reference guide for AWS AppSync's // API operation CreateFunction for usage and error information. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// Returned Error Types: +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/CreateFunction @@ -356,25 +450,25 @@ func (c *AppSync) CreateGraphqlApiRequest(input *CreateGraphqlApiInput) (req *re // See the AWS API reference guide for AWS AppSync's // API operation CreateGraphqlApi for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // -// * ErrCodeApiLimitExceededException "ApiLimitExceededException" +// * ApiLimitExceededException // The GraphQL API exceeded a limit. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/CreateGraphqlApi @@ -455,19 +549,19 @@ func (c *AppSync) CreateResolverRequest(input *CreateResolverInput) (req *reques // See the AWS API reference guide for AWS AppSync's // API operation CreateResolver for usage and error information. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// Returned Error Types: +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/CreateResolver @@ -545,23 +639,23 @@ func (c *AppSync) CreateTypeRequest(input *CreateTypeInput) (req *request.Reques // See the AWS API reference guide for AWS AppSync's // API operation CreateType for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/CreateType @@ -586,6 +680,101 @@ func (c *AppSync) CreateTypeWithContext(ctx aws.Context, input *CreateTypeInput, return out, req.Send() } +const opDeleteApiCache = "DeleteApiCache" + +// DeleteApiCacheRequest generates a "aws/request.Request" representing the +// client's request for the DeleteApiCache operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteApiCache for more information on using the DeleteApiCache +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteApiCacheRequest method. +// req, resp := client.DeleteApiCacheRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/DeleteApiCache +func (c *AppSync) DeleteApiCacheRequest(input *DeleteApiCacheInput) (req *request.Request, output *DeleteApiCacheOutput) { + op := &request.Operation{ + Name: opDeleteApiCache, + HTTPMethod: "DELETE", + HTTPPath: "/v1/apis/{apiId}/ApiCaches", + } + + if input == nil { + input = &DeleteApiCacheInput{} + } + + output = &DeleteApiCacheOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteApiCache API operation for AWS AppSync. +// +// Deletes an ApiCache object. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS AppSync's +// API operation DeleteApiCache for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// The request is not well formed. For example, a value is invalid or a required +// field is missing. Check the field values, and then try again. +// +// * ConcurrentModificationException +// Another modification is in progress at this time and it must complete before +// you can make your change. +// +// * NotFoundException +// The resource specified in the request was not found. Check the resource, +// and then try again. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * InternalFailureException +// An internal AWS AppSync error occurred. Try your request again. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/DeleteApiCache +func (c *AppSync) DeleteApiCache(input *DeleteApiCacheInput) (*DeleteApiCacheOutput, error) { + req, out := c.DeleteApiCacheRequest(input) + return out, req.Send() +} + +// DeleteApiCacheWithContext is the same as DeleteApiCache with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteApiCache for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AppSync) DeleteApiCacheWithContext(ctx aws.Context, input *DeleteApiCacheInput, opts ...request.Option) (*DeleteApiCacheOutput, error) { + req, out := c.DeleteApiCacheRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteApiKey = "DeleteApiKey" // DeleteApiKeyRequest generates a "aws/request.Request" representing the @@ -640,19 +829,19 @@ func (c *AppSync) DeleteApiKeyRequest(input *DeleteApiKeyInput) (req *request.Re // See the AWS API reference guide for AWS AppSync's // API operation DeleteApiKey for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/DeleteApiKey @@ -731,23 +920,23 @@ func (c *AppSync) DeleteDataSourceRequest(input *DeleteDataSourceInput) (req *re // See the AWS API reference guide for AWS AppSync's // API operation DeleteDataSource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/DeleteDataSource @@ -826,19 +1015,19 @@ func (c *AppSync) DeleteFunctionRequest(input *DeleteFunctionInput) (req *reques // See the AWS API reference guide for AWS AppSync's // API operation DeleteFunction for usage and error information. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// Returned Error Types: +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/DeleteFunction @@ -917,26 +1106,26 @@ func (c *AppSync) DeleteGraphqlApiRequest(input *DeleteGraphqlApiInput) (req *re // See the AWS API reference guide for AWS AppSync's // API operation DeleteGraphqlApi for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have access to perform this operation on this resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/DeleteGraphqlApi @@ -1015,19 +1204,19 @@ func (c *AppSync) DeleteResolverRequest(input *DeleteResolverInput) (req *reques // See the AWS API reference guide for AWS AppSync's // API operation DeleteResolver for usage and error information. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// Returned Error Types: +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/DeleteResolver @@ -1106,23 +1295,23 @@ func (c *AppSync) DeleteTypeRequest(input *DeleteTypeInput) (req *request.Reques // See the AWS API reference guide for AWS AppSync's // API operation DeleteType for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/DeleteType @@ -1147,315 +1336,504 @@ func (c *AppSync) DeleteTypeWithContext(ctx aws.Context, input *DeleteTypeInput, return out, req.Send() } -const opGetDataSource = "GetDataSource" +const opFlushApiCache = "FlushApiCache" -// GetDataSourceRequest generates a "aws/request.Request" representing the -// client's request for the GetDataSource operation. The "output" return +// FlushApiCacheRequest generates a "aws/request.Request" representing the +// client's request for the FlushApiCache operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetDataSource for more information on using the GetDataSource +// See FlushApiCache for more information on using the FlushApiCache // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetDataSourceRequest method. -// req, resp := client.GetDataSourceRequest(params) +// // Example sending a request using the FlushApiCacheRequest method. +// req, resp := client.FlushApiCacheRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetDataSource -func (c *AppSync) GetDataSourceRequest(input *GetDataSourceInput) (req *request.Request, output *GetDataSourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/FlushApiCache +func (c *AppSync) FlushApiCacheRequest(input *FlushApiCacheInput) (req *request.Request, output *FlushApiCacheOutput) { op := &request.Operation{ - Name: opGetDataSource, - HTTPMethod: "GET", - HTTPPath: "/v1/apis/{apiId}/datasources/{name}", + Name: opFlushApiCache, + HTTPMethod: "DELETE", + HTTPPath: "/v1/apis/{apiId}/FlushCache", } if input == nil { - input = &GetDataSourceInput{} + input = &FlushApiCacheInput{} } - output = &GetDataSourceOutput{} + output = &FlushApiCacheOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// GetDataSource API operation for AWS AppSync. +// FlushApiCache API operation for AWS AppSync. // -// Retrieves a DataSource object. +// Flushes an ApiCache object. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS AppSync's -// API operation GetDataSource for usage and error information. +// API operation FlushApiCache for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetDataSource -func (c *AppSync) GetDataSource(input *GetDataSourceInput) (*GetDataSourceOutput, error) { - req, out := c.GetDataSourceRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/FlushApiCache +func (c *AppSync) FlushApiCache(input *FlushApiCacheInput) (*FlushApiCacheOutput, error) { + req, out := c.FlushApiCacheRequest(input) return out, req.Send() } -// GetDataSourceWithContext is the same as GetDataSource with the addition of +// FlushApiCacheWithContext is the same as FlushApiCache with the addition of // the ability to pass a context and additional request options. // -// See GetDataSource for details on how to use this API operation. +// See FlushApiCache for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *AppSync) GetDataSourceWithContext(ctx aws.Context, input *GetDataSourceInput, opts ...request.Option) (*GetDataSourceOutput, error) { - req, out := c.GetDataSourceRequest(input) +func (c *AppSync) FlushApiCacheWithContext(ctx aws.Context, input *FlushApiCacheInput, opts ...request.Option) (*FlushApiCacheOutput, error) { + req, out := c.FlushApiCacheRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetFunction = "GetFunction" +const opGetApiCache = "GetApiCache" -// GetFunctionRequest generates a "aws/request.Request" representing the -// client's request for the GetFunction operation. The "output" return +// GetApiCacheRequest generates a "aws/request.Request" representing the +// client's request for the GetApiCache operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetFunction for more information on using the GetFunction +// See GetApiCache for more information on using the GetApiCache // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetFunctionRequest method. -// req, resp := client.GetFunctionRequest(params) +// // Example sending a request using the GetApiCacheRequest method. +// req, resp := client.GetApiCacheRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetFunction -func (c *AppSync) GetFunctionRequest(input *GetFunctionInput) (req *request.Request, output *GetFunctionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetApiCache +func (c *AppSync) GetApiCacheRequest(input *GetApiCacheInput) (req *request.Request, output *GetApiCacheOutput) { op := &request.Operation{ - Name: opGetFunction, + Name: opGetApiCache, HTTPMethod: "GET", - HTTPPath: "/v1/apis/{apiId}/functions/{functionId}", + HTTPPath: "/v1/apis/{apiId}/ApiCaches", } if input == nil { - input = &GetFunctionInput{} + input = &GetApiCacheInput{} } - output = &GetFunctionOutput{} + output = &GetApiCacheOutput{} req = c.newRequest(op, input, output) return } -// GetFunction API operation for AWS AppSync. +// GetApiCache API operation for AWS AppSync. // -// Get a Function. +// Retrieves an ApiCache object. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS AppSync's -// API operation GetFunction for usage and error information. +// API operation GetApiCache for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// The request is not well formed. For example, a value is invalid or a required +// field is missing. Check the field values, and then try again. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetFunction -func (c *AppSync) GetFunction(input *GetFunctionInput) (*GetFunctionOutput, error) { - req, out := c.GetFunctionRequest(input) +// * InternalFailureException +// An internal AWS AppSync error occurred. Try your request again. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetApiCache +func (c *AppSync) GetApiCache(input *GetApiCacheInput) (*GetApiCacheOutput, error) { + req, out := c.GetApiCacheRequest(input) return out, req.Send() } -// GetFunctionWithContext is the same as GetFunction with the addition of +// GetApiCacheWithContext is the same as GetApiCache with the addition of // the ability to pass a context and additional request options. // -// See GetFunction for details on how to use this API operation. +// See GetApiCache for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *AppSync) GetFunctionWithContext(ctx aws.Context, input *GetFunctionInput, opts ...request.Option) (*GetFunctionOutput, error) { - req, out := c.GetFunctionRequest(input) +func (c *AppSync) GetApiCacheWithContext(ctx aws.Context, input *GetApiCacheInput, opts ...request.Option) (*GetApiCacheOutput, error) { + req, out := c.GetApiCacheRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetGraphqlApi = "GetGraphqlApi" +const opGetDataSource = "GetDataSource" -// GetGraphqlApiRequest generates a "aws/request.Request" representing the -// client's request for the GetGraphqlApi operation. The "output" return +// GetDataSourceRequest generates a "aws/request.Request" representing the +// client's request for the GetDataSource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetGraphqlApi for more information on using the GetGraphqlApi +// See GetDataSource for more information on using the GetDataSource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetGraphqlApiRequest method. -// req, resp := client.GetGraphqlApiRequest(params) +// // Example sending a request using the GetDataSourceRequest method. +// req, resp := client.GetDataSourceRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetGraphqlApi -func (c *AppSync) GetGraphqlApiRequest(input *GetGraphqlApiInput) (req *request.Request, output *GetGraphqlApiOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetDataSource +func (c *AppSync) GetDataSourceRequest(input *GetDataSourceInput) (req *request.Request, output *GetDataSourceOutput) { op := &request.Operation{ - Name: opGetGraphqlApi, + Name: opGetDataSource, HTTPMethod: "GET", - HTTPPath: "/v1/apis/{apiId}", + HTTPPath: "/v1/apis/{apiId}/datasources/{name}", } if input == nil { - input = &GetGraphqlApiInput{} + input = &GetDataSourceInput{} } - output = &GetGraphqlApiOutput{} + output = &GetDataSourceOutput{} req = c.newRequest(op, input, output) return } -// GetGraphqlApi API operation for AWS AppSync. +// GetDataSource API operation for AWS AppSync. // -// Retrieves a GraphqlApi object. +// Retrieves a DataSource object. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS AppSync's -// API operation GetGraphqlApi for usage and error information. +// API operation GetDataSource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeNotFoundException "NotFoundException" +// * ConcurrentModificationException +// Another modification is in progress at this time and it must complete before +// you can make your change. +// +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have access to perform this operation on this resource. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetGraphqlApi -func (c *AppSync) GetGraphqlApi(input *GetGraphqlApiInput) (*GetGraphqlApiOutput, error) { - req, out := c.GetGraphqlApiRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetDataSource +func (c *AppSync) GetDataSource(input *GetDataSourceInput) (*GetDataSourceOutput, error) { + req, out := c.GetDataSourceRequest(input) return out, req.Send() } -// GetGraphqlApiWithContext is the same as GetGraphqlApi with the addition of +// GetDataSourceWithContext is the same as GetDataSource with the addition of // the ability to pass a context and additional request options. // -// See GetGraphqlApi for details on how to use this API operation. +// See GetDataSource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *AppSync) GetGraphqlApiWithContext(ctx aws.Context, input *GetGraphqlApiInput, opts ...request.Option) (*GetGraphqlApiOutput, error) { - req, out := c.GetGraphqlApiRequest(input) +func (c *AppSync) GetDataSourceWithContext(ctx aws.Context, input *GetDataSourceInput, opts ...request.Option) (*GetDataSourceOutput, error) { + req, out := c.GetDataSourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetIntrospectionSchema = "GetIntrospectionSchema" +const opGetFunction = "GetFunction" -// GetIntrospectionSchemaRequest generates a "aws/request.Request" representing the -// client's request for the GetIntrospectionSchema operation. The "output" return +// GetFunctionRequest generates a "aws/request.Request" representing the +// client's request for the GetFunction operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetIntrospectionSchema for more information on using the GetIntrospectionSchema +// See GetFunction for more information on using the GetFunction // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetIntrospectionSchemaRequest method. -// req, resp := client.GetIntrospectionSchemaRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetIntrospectionSchema -func (c *AppSync) GetIntrospectionSchemaRequest(input *GetIntrospectionSchemaInput) (req *request.Request, output *GetIntrospectionSchemaOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetFunction +func (c *AppSync) GetFunctionRequest(input *GetFunctionInput) (req *request.Request, output *GetFunctionOutput) { op := &request.Operation{ - Name: opGetIntrospectionSchema, + Name: opGetFunction, HTTPMethod: "GET", - HTTPPath: "/v1/apis/{apiId}/schema", + HTTPPath: "/v1/apis/{apiId}/functions/{functionId}", } if input == nil { - input = &GetIntrospectionSchemaInput{} + input = &GetFunctionInput{} + } + + output = &GetFunctionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetFunction API operation for AWS AppSync. +// +// Get a 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 AppSync's +// API operation GetFunction for usage and error information. +// +// Returned Error Types: +// * ConcurrentModificationException +// Another modification is in progress at this time and it must complete before +// you can make your change. +// +// * NotFoundException +// The resource specified in the request was not found. Check the resource, +// and then try again. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetFunction +func (c *AppSync) GetFunction(input *GetFunctionInput) (*GetFunctionOutput, error) { + req, out := c.GetFunctionRequest(input) + return out, req.Send() +} + +// GetFunctionWithContext is the same as GetFunction with the addition of +// the ability to pass a context and additional request options. +// +// See GetFunction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AppSync) GetFunctionWithContext(ctx aws.Context, input *GetFunctionInput, opts ...request.Option) (*GetFunctionOutput, error) { + req, out := c.GetFunctionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetGraphqlApi = "GetGraphqlApi" + +// GetGraphqlApiRequest generates a "aws/request.Request" representing the +// client's request for the GetGraphqlApi operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetGraphqlApi for more information on using the GetGraphqlApi +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetGraphqlApiRequest method. +// req, resp := client.GetGraphqlApiRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetGraphqlApi +func (c *AppSync) GetGraphqlApiRequest(input *GetGraphqlApiInput) (req *request.Request, output *GetGraphqlApiOutput) { + op := &request.Operation{ + Name: opGetGraphqlApi, + HTTPMethod: "GET", + HTTPPath: "/v1/apis/{apiId}", + } + + if input == nil { + input = &GetGraphqlApiInput{} + } + + output = &GetGraphqlApiOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetGraphqlApi API operation for AWS AppSync. +// +// Retrieves a GraphqlApi object. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS AppSync's +// API operation GetGraphqlApi for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// The request is not well formed. For example, a value is invalid or a required +// field is missing. Check the field values, and then try again. +// +// * NotFoundException +// The resource specified in the request was not found. Check the resource, +// and then try again. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * InternalFailureException +// An internal AWS AppSync error occurred. Try your request again. +// +// * AccessDeniedException +// You do not have access to perform this operation on this resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetGraphqlApi +func (c *AppSync) GetGraphqlApi(input *GetGraphqlApiInput) (*GetGraphqlApiOutput, error) { + req, out := c.GetGraphqlApiRequest(input) + return out, req.Send() +} + +// GetGraphqlApiWithContext is the same as GetGraphqlApi with the addition of +// the ability to pass a context and additional request options. +// +// See GetGraphqlApi for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AppSync) GetGraphqlApiWithContext(ctx aws.Context, input *GetGraphqlApiInput, opts ...request.Option) (*GetGraphqlApiOutput, error) { + req, out := c.GetGraphqlApiRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetIntrospectionSchema = "GetIntrospectionSchema" + +// GetIntrospectionSchemaRequest generates a "aws/request.Request" representing the +// client's request for the GetIntrospectionSchema operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetIntrospectionSchema for more information on using the GetIntrospectionSchema +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetIntrospectionSchemaRequest method. +// req, resp := client.GetIntrospectionSchemaRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetIntrospectionSchema +func (c *AppSync) GetIntrospectionSchemaRequest(input *GetIntrospectionSchemaInput) (req *request.Request, output *GetIntrospectionSchemaOutput) { + op := &request.Operation{ + Name: opGetIntrospectionSchema, + HTTPMethod: "GET", + HTTPPath: "/v1/apis/{apiId}/schema", + } + + if input == nil { + input = &GetIntrospectionSchemaInput{} } output = &GetIntrospectionSchemaOutput{} @@ -1474,18 +1852,18 @@ func (c *AppSync) GetIntrospectionSchemaRequest(input *GetIntrospectionSchemaInp // See the AWS API reference guide for AWS AppSync's // API operation GetIntrospectionSchema for usage and error information. // -// Returned Error Codes: -// * ErrCodeGraphQLSchemaException "GraphQLSchemaException" +// Returned Error Types: +// * GraphQLSchemaException // The GraphQL schema is not valid. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetIntrospectionSchema @@ -1563,16 +1941,16 @@ func (c *AppSync) GetResolverRequest(input *GetResolverInput) (req *request.Requ // See the AWS API reference guide for AWS AppSync's // API operation GetResolver for usage and error information. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// Returned Error Types: +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetResolver @@ -1650,19 +2028,19 @@ func (c *AppSync) GetSchemaCreationStatusRequest(input *GetSchemaCreationStatusI // See the AWS API reference guide for AWS AppSync's // API operation GetSchemaCreationStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetSchemaCreationStatus @@ -1740,23 +2118,23 @@ func (c *AppSync) GetTypeRequest(input *GetTypeInput) (req *request.Request, out // See the AWS API reference guide for AWS AppSync's // API operation GetType for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/GetType @@ -1839,19 +2217,19 @@ func (c *AppSync) ListApiKeysRequest(input *ListApiKeysInput) (req *request.Requ // See the AWS API reference guide for AWS AppSync's // API operation ListApiKeys for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/ListApiKeys @@ -1929,19 +2307,19 @@ func (c *AppSync) ListDataSourcesRequest(input *ListDataSourcesInput) (req *requ // See the AWS API reference guide for AWS AppSync's // API operation ListDataSources for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/ListDataSources @@ -2019,19 +2397,19 @@ func (c *AppSync) ListFunctionsRequest(input *ListFunctionsInput) (req *request. // See the AWS API reference guide for AWS AppSync's // API operation ListFunctions for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/ListFunctions @@ -2109,15 +2487,15 @@ func (c *AppSync) ListGraphqlApisRequest(input *ListGraphqlApisInput) (req *requ // See the AWS API reference guide for AWS AppSync's // API operation ListGraphqlApis for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/ListGraphqlApis @@ -2195,19 +2573,19 @@ func (c *AppSync) ListResolversRequest(input *ListResolversInput) (req *request. // See the AWS API reference guide for AWS AppSync's // API operation ListResolvers for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/ListResolvers @@ -2285,19 +2663,19 @@ func (c *AppSync) ListResolversByFunctionRequest(input *ListResolversByFunctionI // See the AWS API reference guide for AWS AppSync's // API operation ListResolversByFunction for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/ListResolversByFunction @@ -2375,25 +2753,25 @@ func (c *AppSync) ListTagsForResourceRequest(input *ListTagsForResourceInput) (r // See the AWS API reference guide for AWS AppSync's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have access to perform this operation on this resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/ListTagsForResource @@ -2471,23 +2849,23 @@ func (c *AppSync) ListTypesRequest(input *ListTypesInput) (req *request.Request, // See the AWS API reference guide for AWS AppSync's // API operation ListTypes for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/ListTypes @@ -2567,23 +2945,23 @@ func (c *AppSync) StartSchemaCreationRequest(input *StartSchemaCreationInput) (r // See the AWS API reference guide for AWS AppSync's // API operation StartSchemaCreation for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/StartSchemaCreation @@ -2662,25 +3040,25 @@ func (c *AppSync) TagResourceRequest(input *TagResourceInput) (req *request.Requ // See the AWS API reference guide for AWS AppSync's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have access to perform this operation on this resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/TagResource @@ -2759,25 +3137,25 @@ func (c *AppSync) UntagResourceRequest(input *UntagResourceInput) (req *request. // See the AWS API reference guide for AWS AppSync's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have access to perform this operation on this resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/UntagResource @@ -2802,6 +3180,100 @@ func (c *AppSync) UntagResourceWithContext(ctx aws.Context, input *UntagResource return out, req.Send() } +const opUpdateApiCache = "UpdateApiCache" + +// UpdateApiCacheRequest generates a "aws/request.Request" representing the +// client's request for the UpdateApiCache operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateApiCache for more information on using the UpdateApiCache +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateApiCacheRequest method. +// req, resp := client.UpdateApiCacheRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/UpdateApiCache +func (c *AppSync) UpdateApiCacheRequest(input *UpdateApiCacheInput) (req *request.Request, output *UpdateApiCacheOutput) { + op := &request.Operation{ + Name: opUpdateApiCache, + HTTPMethod: "POST", + HTTPPath: "/v1/apis/{apiId}/ApiCaches/update", + } + + if input == nil { + input = &UpdateApiCacheInput{} + } + + output = &UpdateApiCacheOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateApiCache API operation for AWS AppSync. +// +// Updates the cache for the GraphQL 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 AppSync's +// API operation UpdateApiCache for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// The request is not well formed. For example, a value is invalid or a required +// field is missing. Check the field values, and then try again. +// +// * ConcurrentModificationException +// Another modification is in progress at this time and it must complete before +// you can make your change. +// +// * NotFoundException +// The resource specified in the request was not found. Check the resource, +// and then try again. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * InternalFailureException +// An internal AWS AppSync error occurred. Try your request again. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/UpdateApiCache +func (c *AppSync) UpdateApiCache(input *UpdateApiCacheInput) (*UpdateApiCacheOutput, error) { + req, out := c.UpdateApiCacheRequest(input) + return out, req.Send() +} + +// UpdateApiCacheWithContext is the same as UpdateApiCache with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApiCache for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *AppSync) UpdateApiCacheWithContext(ctx aws.Context, input *UpdateApiCacheInput, opts ...request.Option) (*UpdateApiCacheOutput, error) { + req, out := c.UpdateApiCacheRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opUpdateApiKey = "UpdateApiKey" // UpdateApiKeyRequest generates a "aws/request.Request" representing the @@ -2855,25 +3327,25 @@ func (c *AppSync) UpdateApiKeyRequest(input *UpdateApiKeyInput) (req *request.Re // See the AWS API reference guide for AWS AppSync's // API operation UpdateApiKey for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // -// * ErrCodeApiKeyValidityOutOfBoundsException "ApiKeyValidityOutOfBoundsException" +// * ApiKeyValidityOutOfBoundsException // The API key expiration must be set to a value between 1 and 365 days from // creation (for CreateApiKey) or from update (for UpdateApiKey). // @@ -2952,23 +3424,23 @@ func (c *AppSync) UpdateDataSourceRequest(input *UpdateDataSourceInput) (req *re // See the AWS API reference guide for AWS AppSync's // API operation UpdateDataSource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/UpdateDataSource @@ -3046,19 +3518,19 @@ func (c *AppSync) UpdateFunctionRequest(input *UpdateFunctionInput) (req *reques // See the AWS API reference guide for AWS AppSync's // API operation UpdateFunction for usage and error information. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// Returned Error Types: +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/UpdateFunction @@ -3136,26 +3608,26 @@ func (c *AppSync) UpdateGraphqlApiRequest(input *UpdateGraphqlApiInput) (req *re // See the AWS API reference guide for AWS AppSync's // API operation UpdateGraphqlApi for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have access to perform this operation on this resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/UpdateGraphqlApi @@ -3233,19 +3705,19 @@ func (c *AppSync) UpdateResolverRequest(input *UpdateResolverInput) (req *reques // See the AWS API reference guide for AWS AppSync's // API operation UpdateResolver for usage and error information. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// Returned Error Types: +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/UpdateResolver @@ -3323,23 +3795,23 @@ func (c *AppSync) UpdateTypeRequest(input *UpdateTypeInput) (req *request.Reques // See the AWS API reference guide for AWS AppSync's // API operation UpdateType for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and then try again. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Another modification is in progress at this time and it must complete before // you can make your change. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource specified in the request was not found. Check the resource, // and then try again. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal AWS AppSync error occurred. Try your request again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/appsync-2017-07-25/UpdateType @@ -3364,37 +3836,93 @@ func (c *AppSync) UpdateTypeWithContext(ctx aws.Context, input *UpdateTypeInput, return out, req.Send() } -// Describes an additional authentication provider. -type AdditionalAuthenticationProvider struct { - _ struct{} `type:"structure"` - - // The authentication type: API key, AWS IAM, OIDC, or Amazon Cognito user pools. - AuthenticationType *string `locationName:"authenticationType" type:"string" enum:"AuthenticationType"` - - // The OpenID Connect configuration. - OpenIDConnectConfig *OpenIDConnectConfig `locationName:"openIDConnectConfig" type:"structure"` +// You do not have access to perform this operation on this resource. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The Amazon Cognito user pool configuration. - UserPoolConfig *CognitoUserPoolConfig `locationName:"userPoolConfig" type:"structure"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s AdditionalAuthenticationProvider) String() string { +func (s AccessDeniedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AdditionalAuthenticationProvider) GoString() string { +func (s AccessDeniedException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AdditionalAuthenticationProvider) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AdditionalAuthenticationProvider"} - if s.OpenIDConnectConfig != nil { - if err := s.OpenIDConnectConfig.Validate(); err != nil { - invalidParams.AddNested("OpenIDConnectConfig", err.(request.ErrInvalidParams)) - } +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Describes an additional authentication provider. +type AdditionalAuthenticationProvider struct { + _ struct{} `type:"structure"` + + // The authentication type: API key, AWS IAM, OIDC, or Amazon Cognito user pools. + AuthenticationType *string `locationName:"authenticationType" type:"string" enum:"AuthenticationType"` + + // The OpenID Connect configuration. + OpenIDConnectConfig *OpenIDConnectConfig `locationName:"openIDConnectConfig" type:"structure"` + + // The Amazon Cognito user pool configuration. + UserPoolConfig *CognitoUserPoolConfig `locationName:"userPoolConfig" type:"structure"` +} + +// String returns the string representation +func (s AdditionalAuthenticationProvider) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AdditionalAuthenticationProvider) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AdditionalAuthenticationProvider) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AdditionalAuthenticationProvider"} + if s.OpenIDConnectConfig != nil { + if err := s.OpenIDConnectConfig.Validate(); err != nil { + invalidParams.AddNested("OpenIDConnectConfig", err.(request.ErrInvalidParams)) + } } if s.UserPoolConfig != nil { if err := s.UserPoolConfig.Validate(); err != nil { @@ -3426,6 +3954,106 @@ func (s *AdditionalAuthenticationProvider) SetUserPoolConfig(v *CognitoUserPoolC return s } +// The ApiCache object. +type ApiCache struct { + _ struct{} `type:"structure"` + + // Caching behavior. + // + // * FULL_REQUEST_CACHING: All requests are fully cached. + // + // * PER_RESOLVER_CACHING: Individual resovlers that you specify are cached. + ApiCachingBehavior *string `locationName:"apiCachingBehavior" type:"string" enum:"ApiCachingBehavior"` + + // At rest encryption flag for cache. This setting cannot be updated after creation. + AtRestEncryptionEnabled *bool `locationName:"atRestEncryptionEnabled" type:"boolean"` + + // The cache instance status. + // + // * AVAILABLE: The instance is available for use. + // + // * CREATING: The instance is currently creating. + // + // * DELETING: The instance is currently deleting. + // + // * MODIFYING: The instance is currently modifying. + // + // * FAILED: The instance has failed creation. + Status *string `locationName:"status" type:"string" enum:"ApiCacheStatus"` + + // Transit encryption flag when connecting to cache. This setting cannot be + // updated after creation. + TransitEncryptionEnabled *bool `locationName:"transitEncryptionEnabled" type:"boolean"` + + // TTL in seconds for cache entries. + // + // Valid values are between 1 and 3600 seconds. + Ttl *int64 `locationName:"ttl" type:"long"` + + // The cache instance type. + // + // * T2_SMALL: A t2.small instance type. + // + // * T2_MEDIUM: A t2.medium instance type. + // + // * R4_LARGE: A r4.large instance type. + // + // * R4_XLARGE: A r4.xlarge instance type. + // + // * R4_2XLARGE: A r4.2xlarge instance type. + // + // * R4_4XLARGE: A r4.4xlarge instance type. + // + // * R4_8XLARGE: A r4.8xlarge instance type. + Type *string `locationName:"type" type:"string" enum:"ApiCacheType"` +} + +// String returns the string representation +func (s ApiCache) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApiCache) GoString() string { + return s.String() +} + +// SetApiCachingBehavior sets the ApiCachingBehavior field's value. +func (s *ApiCache) SetApiCachingBehavior(v string) *ApiCache { + s.ApiCachingBehavior = &v + return s +} + +// SetAtRestEncryptionEnabled sets the AtRestEncryptionEnabled field's value. +func (s *ApiCache) SetAtRestEncryptionEnabled(v bool) *ApiCache { + s.AtRestEncryptionEnabled = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ApiCache) SetStatus(v string) *ApiCache { + s.Status = &v + return s +} + +// SetTransitEncryptionEnabled sets the TransitEncryptionEnabled field's value. +func (s *ApiCache) SetTransitEncryptionEnabled(v bool) *ApiCache { + s.TransitEncryptionEnabled = &v + return s +} + +// SetTtl sets the Ttl field's value. +func (s *ApiCache) SetTtl(v int64) *ApiCache { + s.Ttl = &v + return s +} + +// SetType sets the Type field's value. +func (s *ApiCache) SetType(v string) *ApiCache { + s.Type = &v + return s +} + // Describes an API key. // // Customers invoke AWS AppSync GraphQL API operations with API keys as an identity @@ -3506,6 +4134,175 @@ func (s *ApiKey) SetId(v string) *ApiKey { return s } +// The API key exceeded a limit. Try your request again. +type ApiKeyLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApiKeyLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApiKeyLimitExceededException) GoString() string { + return s.String() +} + +func newErrorApiKeyLimitExceededException(v protocol.ResponseMetadata) error { + return &ApiKeyLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApiKeyLimitExceededException) Code() string { + return "ApiKeyLimitExceededException" +} + +// Message returns the exception's message. +func (s ApiKeyLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApiKeyLimitExceededException) OrigErr() error { + return nil +} + +func (s ApiKeyLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApiKeyLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApiKeyLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The API key expiration must be set to a value between 1 and 365 days from +// creation (for CreateApiKey) or from update (for UpdateApiKey). +type ApiKeyValidityOutOfBoundsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApiKeyValidityOutOfBoundsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApiKeyValidityOutOfBoundsException) GoString() string { + return s.String() +} + +func newErrorApiKeyValidityOutOfBoundsException(v protocol.ResponseMetadata) error { + return &ApiKeyValidityOutOfBoundsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApiKeyValidityOutOfBoundsException) Code() string { + return "ApiKeyValidityOutOfBoundsException" +} + +// Message returns the exception's message. +func (s ApiKeyValidityOutOfBoundsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApiKeyValidityOutOfBoundsException) OrigErr() error { + return nil +} + +func (s ApiKeyValidityOutOfBoundsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApiKeyValidityOutOfBoundsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApiKeyValidityOutOfBoundsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The GraphQL API exceeded a limit. Try your request again. +type ApiLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApiLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApiLimitExceededException) GoString() string { + return s.String() +} + +func newErrorApiLimitExceededException(v protocol.ResponseMetadata) error { + return &ApiLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApiLimitExceededException) Code() string { + return "ApiLimitExceededException" +} + +// Message returns the exception's message. +func (s ApiLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApiLimitExceededException) OrigErr() error { + return nil +} + +func (s ApiLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApiLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApiLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // The authorization config in case the HTTP endpoint requires authorization. type AuthorizationConfig struct { _ struct{} `type:"structure"` @@ -3589,6 +4386,101 @@ func (s *AwsIamConfig) SetSigningServiceName(v string) *AwsIamConfig { return s } +// The request is not well formed. For example, a value is invalid or a required +// field is missing. Check the field values, and then try again. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// The caching configuration for a resolver that has caching enabled. +type CachingConfig struct { + _ struct{} `type:"structure"` + + // The caching keys for a resolver that has caching enabled. + // + // Valid values are entries from the $context.identity and $context.arguments + // maps. + CachingKeys []*string `locationName:"cachingKeys" type:"list"` + + // The TTL in seconds for a resolver that has caching enabled. + // + // Valid values are between 1 and 3600 seconds. + Ttl *int64 `locationName:"ttl" type:"long"` +} + +// String returns the string representation +func (s CachingConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CachingConfig) GoString() string { + return s.String() +} + +// SetCachingKeys sets the CachingKeys field's value. +func (s *CachingConfig) SetCachingKeys(v []*string) *CachingConfig { + s.CachingKeys = v + return s +} + +// SetTtl sets the Ttl field's value. +func (s *CachingConfig) SetTtl(v int64) *CachingConfig { + s.Ttl = &v + return s +} + // Describes an Amazon Cognito user pool configuration. type CognitoUserPoolConfig struct { _ struct{} `type:"structure"` @@ -3652,6 +4544,210 @@ func (s *CognitoUserPoolConfig) SetUserPoolId(v string) *CognitoUserPoolConfig { return s } +// Another modification is in progress at this time and it must complete before +// you can make your change. +type ConcurrentModificationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentModificationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentModificationException) GoString() string { + return s.String() +} + +func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { + return &ConcurrentModificationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentModificationException) Code() string { + return "ConcurrentModificationException" +} + +// Message returns the exception's message. +func (s ConcurrentModificationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentModificationException) OrigErr() error { + return nil +} + +func (s ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentModificationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentModificationException) RequestID() string { + return s.respMetadata.RequestID +} + +// Represents the input of a CreateApiCache operation. +type CreateApiCacheInput struct { + _ struct{} `type:"structure"` + + // Caching behavior. + // + // * FULL_REQUEST_CACHING: All requests are fully cached. + // + // * PER_RESOLVER_CACHING: Individual resovlers that you specify are cached. + // + // ApiCachingBehavior is a required field + ApiCachingBehavior *string `locationName:"apiCachingBehavior" type:"string" required:"true" enum:"ApiCachingBehavior"` + + // The GraphQL API Id. + // + // ApiId is a required field + ApiId *string `location:"uri" locationName:"apiId" type:"string" required:"true"` + + // At rest encryption flag for cache. This setting cannot be updated after creation. + AtRestEncryptionEnabled *bool `locationName:"atRestEncryptionEnabled" type:"boolean"` + + // Transit encryption flag when connecting to cache. This setting cannot be + // updated after creation. + TransitEncryptionEnabled *bool `locationName:"transitEncryptionEnabled" type:"boolean"` + + // TTL in seconds for cache entries. + // + // Valid values are between 1 and 3600 seconds. + // + // Ttl is a required field + Ttl *int64 `locationName:"ttl" type:"long" required:"true"` + + // The cache instance type. + // + // * T2_SMALL: A t2.small instance type. + // + // * T2_MEDIUM: A t2.medium instance type. + // + // * R4_LARGE: A r4.large instance type. + // + // * R4_XLARGE: A r4.xlarge instance type. + // + // * R4_2XLARGE: A r4.2xlarge instance type. + // + // * R4_4XLARGE: A r4.4xlarge instance type. + // + // * R4_8XLARGE: A r4.8xlarge instance type. + // + // Type is a required field + Type *string `locationName:"type" type:"string" required:"true" enum:"ApiCacheType"` +} + +// String returns the string representation +func (s CreateApiCacheInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateApiCacheInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateApiCacheInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateApiCacheInput"} + if s.ApiCachingBehavior == nil { + invalidParams.Add(request.NewErrParamRequired("ApiCachingBehavior")) + } + if s.ApiId == nil { + invalidParams.Add(request.NewErrParamRequired("ApiId")) + } + if s.ApiId != nil && len(*s.ApiId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApiId", 1)) + } + if s.Ttl == nil { + invalidParams.Add(request.NewErrParamRequired("Ttl")) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApiCachingBehavior sets the ApiCachingBehavior field's value. +func (s *CreateApiCacheInput) SetApiCachingBehavior(v string) *CreateApiCacheInput { + s.ApiCachingBehavior = &v + return s +} + +// SetApiId sets the ApiId field's value. +func (s *CreateApiCacheInput) SetApiId(v string) *CreateApiCacheInput { + s.ApiId = &v + return s +} + +// SetAtRestEncryptionEnabled sets the AtRestEncryptionEnabled field's value. +func (s *CreateApiCacheInput) SetAtRestEncryptionEnabled(v bool) *CreateApiCacheInput { + s.AtRestEncryptionEnabled = &v + return s +} + +// SetTransitEncryptionEnabled sets the TransitEncryptionEnabled field's value. +func (s *CreateApiCacheInput) SetTransitEncryptionEnabled(v bool) *CreateApiCacheInput { + s.TransitEncryptionEnabled = &v + return s +} + +// SetTtl sets the Ttl field's value. +func (s *CreateApiCacheInput) SetTtl(v int64) *CreateApiCacheInput { + s.Ttl = &v + return s +} + +// SetType sets the Type field's value. +func (s *CreateApiCacheInput) SetType(v string) *CreateApiCacheInput { + s.Type = &v + return s +} + +// Represents the output of a CreateApiCache operation. +type CreateApiCacheOutput struct { + _ struct{} `type:"structure"` + + // The ApiCache object. + ApiCache *ApiCache `locationName:"apiCache" type:"structure"` +} + +// String returns the string representation +func (s CreateApiCacheOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateApiCacheOutput) GoString() string { + return s.String() +} + +// SetApiCache sets the ApiCache field's value. +func (s *CreateApiCacheOutput) SetApiCache(v *ApiCache) *CreateApiCacheOutput { + s.ApiCache = v + return s +} + type CreateApiKeyInput struct { _ struct{} `type:"structure"` @@ -3763,7 +4859,7 @@ type CreateDataSourceInput struct { // A user-supplied name for the DataSource. // // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` + Name *string `locationName:"name" min:"1" type:"string" required:"true"` // Relational database settings. RelationalDatabaseConfig *RelationalDatabaseDataSourceConfig `locationName:"relationalDatabaseConfig" type:"structure"` @@ -3800,6 +4896,9 @@ func (s *CreateDataSourceInput) Validate() error { 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")) } @@ -3924,7 +5023,7 @@ type CreateFunctionInput struct { // The Function DataSource name. // // DataSourceName is a required field - DataSourceName *string `locationName:"dataSourceName" type:"string" required:"true"` + DataSourceName *string `locationName:"dataSourceName" min:"1" type:"string" required:"true"` // The Function description. Description *string `locationName:"description" type:"string"` @@ -3938,7 +5037,7 @@ type CreateFunctionInput struct { // The Function name. The function name does not have to be unique. // // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` + Name *string `locationName:"name" min:"1" type:"string" required:"true"` // The Function request mapping template. Functions support only the 2018-05-29 // version of the request mapping template. @@ -3972,12 +5071,18 @@ func (s *CreateFunctionInput) Validate() error { if s.DataSourceName == nil { invalidParams.Add(request.NewErrParamRequired("DataSourceName")) } + if s.DataSourceName != nil && len(*s.DataSourceName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSourceName", 1)) + } if s.FunctionVersion == nil { invalidParams.Add(request.NewErrParamRequired("FunctionVersion")) } 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.RequestMappingTemplate == nil { invalidParams.Add(request.NewErrParamRequired("RequestMappingTemplate")) } @@ -4086,6 +5191,9 @@ type CreateGraphqlApiInput struct { // The Amazon Cognito user pool configuration. UserPoolConfig *UserPoolConfig `locationName:"userPoolConfig" type:"structure"` + + // A flag indicating whether to enable X-Ray tracing for the GraphqlApi. + XrayEnabled *bool `locationName:"xrayEnabled" type:"boolean"` } // String returns the string representation @@ -4184,6 +5292,12 @@ func (s *CreateGraphqlApiInput) SetUserPoolConfig(v *UserPoolConfig) *CreateGrap return s } +// SetXrayEnabled sets the XrayEnabled field's value. +func (s *CreateGraphqlApiInput) SetXrayEnabled(v bool) *CreateGraphqlApiInput { + s.XrayEnabled = &v + return s +} + type CreateGraphqlApiOutput struct { _ struct{} `type:"structure"` @@ -4215,13 +5329,16 @@ type CreateResolverInput struct { // ApiId is a required field ApiId *string `location:"uri" locationName:"apiId" type:"string" required:"true"` + // The caching configuration for the resolver. + CachingConfig *CachingConfig `locationName:"cachingConfig" type:"structure"` + // The name of the data source for which the resolver is being created. - DataSourceName *string `locationName:"dataSourceName" type:"string"` + DataSourceName *string `locationName:"dataSourceName" min:"1" type:"string"` // The name of the field to attach the resolver to. // // FieldName is a required field - FieldName *string `locationName:"fieldName" type:"string" required:"true"` + FieldName *string `locationName:"fieldName" min:"1" type:"string" required:"true"` // The resolver type. // @@ -4249,10 +5366,13 @@ type CreateResolverInput struct { // The mapping template to be used for responses from the data source. ResponseMappingTemplate *string `locationName:"responseMappingTemplate" min:"1" type:"string"` + // The SyncConfig for a resolver attached to a versioned datasource. + SyncConfig *SyncConfig `locationName:"syncConfig" type:"structure"` + // The name of the Type. // // TypeName is a required field - TypeName *string `location:"uri" locationName:"typeName" type:"string" required:"true"` + TypeName *string `location:"uri" locationName:"typeName" min:"1" type:"string" required:"true"` } // String returns the string representation @@ -4274,9 +5394,15 @@ func (s *CreateResolverInput) Validate() error { if s.ApiId != nil && len(*s.ApiId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApiId", 1)) } + if s.DataSourceName != nil && len(*s.DataSourceName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSourceName", 1)) + } if s.FieldName == nil { invalidParams.Add(request.NewErrParamRequired("FieldName")) } + if s.FieldName != nil && len(*s.FieldName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FieldName", 1)) + } if s.RequestMappingTemplate == nil { invalidParams.Add(request.NewErrParamRequired("RequestMappingTemplate")) } @@ -4305,6 +5431,12 @@ func (s *CreateResolverInput) SetApiId(v string) *CreateResolverInput { return s } +// SetCachingConfig sets the CachingConfig field's value. +func (s *CreateResolverInput) SetCachingConfig(v *CachingConfig) *CreateResolverInput { + s.CachingConfig = v + return s +} + // SetDataSourceName sets the DataSourceName field's value. func (s *CreateResolverInput) SetDataSourceName(v string) *CreateResolverInput { s.DataSourceName = &v @@ -4341,6 +5473,12 @@ func (s *CreateResolverInput) SetResponseMappingTemplate(v string) *CreateResolv return s } +// SetSyncConfig sets the SyncConfig field's value. +func (s *CreateResolverInput) SetSyncConfig(v *SyncConfig) *CreateResolverInput { + s.SyncConfig = v + return s +} + // SetTypeName sets the TypeName field's value. func (s *CreateResolverInput) SetTypeName(v string) *CreateResolverInput { s.TypeName = &v @@ -4487,7 +5625,7 @@ type DataSource struct { LambdaConfig *LambdaDataSourceConfig `locationName:"lambdaConfig" type:"structure"` // The name of the data source. - Name *string `locationName:"name" type:"string"` + Name *string `locationName:"name" min:"1" type:"string"` // Relational database settings. RelationalDatabaseConfig *RelationalDatabaseDataSourceConfig `locationName:"relationalDatabaseConfig" type:"structure"` @@ -4562,28 +5700,85 @@ func (s *DataSource) SetLambdaConfig(v *LambdaDataSourceConfig) *DataSource { return s } -// SetName sets the Name field's value. -func (s *DataSource) SetName(v string) *DataSource { - s.Name = &v +// SetName sets the Name field's value. +func (s *DataSource) SetName(v string) *DataSource { + s.Name = &v + return s +} + +// SetRelationalDatabaseConfig sets the RelationalDatabaseConfig field's value. +func (s *DataSource) SetRelationalDatabaseConfig(v *RelationalDatabaseDataSourceConfig) *DataSource { + s.RelationalDatabaseConfig = v + return s +} + +// SetServiceRoleArn sets the ServiceRoleArn field's value. +func (s *DataSource) SetServiceRoleArn(v string) *DataSource { + s.ServiceRoleArn = &v + return s +} + +// SetType sets the Type field's value. +func (s *DataSource) SetType(v string) *DataSource { + s.Type = &v + return s +} + +// Represents the input of a DeleteApiCache operation. +type DeleteApiCacheInput struct { + _ struct{} `type:"structure"` + + // The API ID. + // + // ApiId is a required field + ApiId *string `location:"uri" locationName:"apiId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteApiCacheInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteApiCacheInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteApiCacheInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteApiCacheInput"} + if s.ApiId == nil { + invalidParams.Add(request.NewErrParamRequired("ApiId")) + } + if s.ApiId != nil && len(*s.ApiId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApiId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApiId sets the ApiId field's value. +func (s *DeleteApiCacheInput) SetApiId(v string) *DeleteApiCacheInput { + s.ApiId = &v return s } -// SetRelationalDatabaseConfig sets the RelationalDatabaseConfig field's value. -func (s *DataSource) SetRelationalDatabaseConfig(v *RelationalDatabaseDataSourceConfig) *DataSource { - s.RelationalDatabaseConfig = v - return s +// Represents the output of a DeleteApiCache operation. +type DeleteApiCacheOutput struct { + _ struct{} `type:"structure"` } -// SetServiceRoleArn sets the ServiceRoleArn field's value. -func (s *DataSource) SetServiceRoleArn(v string) *DataSource { - s.ServiceRoleArn = &v - return s +// String returns the string representation +func (s DeleteApiCacheOutput) String() string { + return awsutil.Prettify(s) } -// SetType sets the Type field's value. -func (s *DataSource) SetType(v string) *DataSource { - s.Type = &v - return s +// GoString returns the string representation +func (s DeleteApiCacheOutput) GoString() string { + return s.String() } type DeleteApiKeyInput struct { @@ -4669,7 +5864,7 @@ type DeleteDataSourceInput struct { // The name of the data source. // // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` + Name *string `location:"uri" locationName:"name" min:"1" type:"string" required:"true"` } // String returns the string representation @@ -4741,7 +5936,7 @@ type DeleteFunctionInput struct { // The Function ID. // // FunctionId is a required field - FunctionId *string `location:"uri" locationName:"functionId" type:"string" required:"true"` + FunctionId *string `location:"uri" locationName:"functionId" min:"1" type:"string" required:"true"` } // String returns the string representation @@ -4868,12 +6063,12 @@ type DeleteResolverInput struct { // The resolver field name. // // FieldName is a required field - FieldName *string `location:"uri" locationName:"fieldName" type:"string" required:"true"` + FieldName *string `location:"uri" locationName:"fieldName" min:"1" type:"string" required:"true"` // The name of the resolver type. // // TypeName is a required field - TypeName *string `location:"uri" locationName:"typeName" type:"string" required:"true"` + TypeName *string `location:"uri" locationName:"typeName" min:"1" type:"string" required:"true"` } // String returns the string representation @@ -4957,7 +6152,7 @@ type DeleteTypeInput struct { // The type name. // // TypeName is a required field - TypeName *string `location:"uri" locationName:"typeName" type:"string" required:"true"` + TypeName *string `location:"uri" locationName:"typeName" min:"1" type:"string" required:"true"` } // String returns the string representation @@ -5018,6 +6213,49 @@ func (s DeleteTypeOutput) GoString() string { return s.String() } +// Describes a Delta Sync configuration. +type DeltaSyncConfig struct { + _ struct{} `type:"structure"` + + // The number of minutes an Item is stored in the datasource. + BaseTableTTL *int64 `locationName:"baseTableTTL" type:"long"` + + // The Delta Sync table name. + DeltaSyncTableName *string `locationName:"deltaSyncTableName" type:"string"` + + // The number of minutes a Delta Sync log entry is stored in the Delta Sync + // table. + DeltaSyncTableTTL *int64 `locationName:"deltaSyncTableTTL" type:"long"` +} + +// String returns the string representation +func (s DeltaSyncConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeltaSyncConfig) GoString() string { + return s.String() +} + +// SetBaseTableTTL sets the BaseTableTTL field's value. +func (s *DeltaSyncConfig) SetBaseTableTTL(v int64) *DeltaSyncConfig { + s.BaseTableTTL = &v + return s +} + +// SetDeltaSyncTableName sets the DeltaSyncTableName field's value. +func (s *DeltaSyncConfig) SetDeltaSyncTableName(v string) *DeltaSyncConfig { + s.DeltaSyncTableName = &v + return s +} + +// SetDeltaSyncTableTTL sets the DeltaSyncTableTTL field's value. +func (s *DeltaSyncConfig) SetDeltaSyncTableTTL(v int64) *DeltaSyncConfig { + s.DeltaSyncTableTTL = &v + return s +} + // Describes an Amazon DynamoDB data source configuration. type DynamodbDataSourceConfig struct { _ struct{} `type:"structure"` @@ -5027,6 +6265,9 @@ type DynamodbDataSourceConfig struct { // AwsRegion is a required field AwsRegion *string `locationName:"awsRegion" type:"string" required:"true"` + // The DeltaSyncConfig for a versioned datasource. + DeltaSyncConfig *DeltaSyncConfig `locationName:"deltaSyncConfig" type:"structure"` + // The table name. // // TableName is a required field @@ -5034,6 +6275,9 @@ type DynamodbDataSourceConfig struct { // Set to TRUE to use Amazon Cognito credentials with this data source. UseCallerCredentials *bool `locationName:"useCallerCredentials" type:"boolean"` + + // Set to TRUE to use Conflict Detection and Resolution with this data source. + Versioned *bool `locationName:"versioned" type:"boolean"` } // String returns the string representation @@ -5068,6 +6312,12 @@ func (s *DynamodbDataSourceConfig) SetAwsRegion(v string) *DynamodbDataSourceCon return s } +// SetDeltaSyncConfig sets the DeltaSyncConfig field's value. +func (s *DynamodbDataSourceConfig) SetDeltaSyncConfig(v *DeltaSyncConfig) *DynamodbDataSourceConfig { + s.DeltaSyncConfig = v + return s +} + // SetTableName sets the TableName field's value. func (s *DynamodbDataSourceConfig) SetTableName(v string) *DynamodbDataSourceConfig { s.TableName = &v @@ -5080,6 +6330,12 @@ func (s *DynamodbDataSourceConfig) SetUseCallerCredentials(v bool) *DynamodbData return s } +// SetVersioned sets the Versioned field's value. +func (s *DynamodbDataSourceConfig) SetVersioned(v bool) *DynamodbDataSourceConfig { + s.Versioned = &v + return s +} + // Describes an Elasticsearch data source configuration. type ElasticsearchDataSourceConfig struct { _ struct{} `type:"structure"` @@ -5133,13 +6389,70 @@ func (s *ElasticsearchDataSourceConfig) SetEndpoint(v string) *ElasticsearchData return s } +// Represents the input of a FlushApiCache operation. +type FlushApiCacheInput struct { + _ struct{} `type:"structure"` + + // The API ID. + // + // ApiId is a required field + ApiId *string `location:"uri" locationName:"apiId" type:"string" required:"true"` +} + +// String returns the string representation +func (s FlushApiCacheInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FlushApiCacheInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *FlushApiCacheInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "FlushApiCacheInput"} + if s.ApiId == nil { + invalidParams.Add(request.NewErrParamRequired("ApiId")) + } + if s.ApiId != nil && len(*s.ApiId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApiId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApiId sets the ApiId field's value. +func (s *FlushApiCacheInput) SetApiId(v string) *FlushApiCacheInput { + s.ApiId = &v + return s +} + +// Represents the output of a FlushApiCache operation. +type FlushApiCacheOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s FlushApiCacheOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FlushApiCacheOutput) GoString() string { + return s.String() +} + // A function is a reusable entity. Multiple functions can be used to compose // the resolver logic. type FunctionConfiguration struct { _ struct{} `type:"structure"` // The name of the DataSource. - DataSourceName *string `locationName:"dataSourceName" type:"string"` + DataSourceName *string `locationName:"dataSourceName" min:"1" type:"string"` // The Function description. Description *string `locationName:"description" type:"string"` @@ -5155,7 +6468,7 @@ type FunctionConfiguration struct { FunctionVersion *string `locationName:"functionVersion" type:"string"` // The name of the Function object. - Name *string `locationName:"name" type:"string"` + Name *string `locationName:"name" min:"1" type:"string"` // The Function request mapping template. Functions support only the 2018-05-29 // version of the request mapping template. @@ -5223,6 +6536,72 @@ func (s *FunctionConfiguration) SetResponseMappingTemplate(v string) *FunctionCo return s } +// Represents the input of a GetApiCache operation. +type GetApiCacheInput struct { + _ struct{} `type:"structure"` + + // The API ID. + // + // ApiId is a required field + ApiId *string `location:"uri" locationName:"apiId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetApiCacheInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetApiCacheInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetApiCacheInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetApiCacheInput"} + if s.ApiId == nil { + invalidParams.Add(request.NewErrParamRequired("ApiId")) + } + if s.ApiId != nil && len(*s.ApiId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApiId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApiId sets the ApiId field's value. +func (s *GetApiCacheInput) SetApiId(v string) *GetApiCacheInput { + s.ApiId = &v + return s +} + +// Represents the output of a GetApiCache operation. +type GetApiCacheOutput struct { + _ struct{} `type:"structure"` + + // The ApiCache object. + ApiCache *ApiCache `locationName:"apiCache" type:"structure"` +} + +// String returns the string representation +func (s GetApiCacheOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetApiCacheOutput) GoString() string { + return s.String() +} + +// SetApiCache sets the ApiCache field's value. +func (s *GetApiCacheOutput) SetApiCache(v *ApiCache) *GetApiCacheOutput { + s.ApiCache = v + return s +} + type GetDataSourceInput struct { _ struct{} `type:"structure"` @@ -5234,7 +6613,7 @@ type GetDataSourceInput struct { // The name of the data source. // // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` + Name *string `location:"uri" locationName:"name" min:"1" type:"string" required:"true"` } // String returns the string representation @@ -5315,7 +6694,7 @@ type GetFunctionInput struct { // The Function ID. // // FunctionId is a required field - FunctionId *string `location:"uri" locationName:"functionId" type:"string" required:"true"` + FunctionId *string `location:"uri" locationName:"functionId" min:"1" type:"string" required:"true"` } // String returns the string representation @@ -5549,12 +6928,12 @@ type GetResolverInput struct { // The resolver field name. // // FieldName is a required field - FieldName *string `location:"uri" locationName:"fieldName" type:"string" required:"true"` + FieldName *string `location:"uri" locationName:"fieldName" min:"1" type:"string" required:"true"` // The resolver type name. // // TypeName is a required field - TypeName *string `location:"uri" locationName:"typeName" type:"string" required:"true"` + TypeName *string `location:"uri" locationName:"typeName" min:"1" type:"string" required:"true"` } // String returns the string representation @@ -5726,7 +7105,7 @@ type GetTypeInput struct { // The type name. // // TypeName is a required field - TypeName *string `location:"uri" locationName:"typeName" type:"string" required:"true"` + TypeName *string `location:"uri" locationName:"typeName" min:"1" type:"string" required:"true"` } // String returns the string representation @@ -5805,6 +7184,62 @@ func (s *GetTypeOutput) SetType(v *Type) *GetTypeOutput { return s } +// The GraphQL schema is not valid. +type GraphQLSchemaException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s GraphQLSchemaException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GraphQLSchemaException) GoString() string { + return s.String() +} + +func newErrorGraphQLSchemaException(v protocol.ResponseMetadata) error { + return &GraphQLSchemaException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s GraphQLSchemaException) Code() string { + return "GraphQLSchemaException" +} + +// Message returns the exception's message. +func (s GraphQLSchemaException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s GraphQLSchemaException) OrigErr() error { + return nil +} + +func (s GraphQLSchemaException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s GraphQLSchemaException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s GraphQLSchemaException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes a GraphQL API. type GraphqlApi struct { _ struct{} `type:"structure"` @@ -5825,7 +7260,7 @@ type GraphqlApi struct { LogConfig *LogConfig `locationName:"logConfig" type:"structure"` // The API name. - Name *string `locationName:"name" type:"string"` + Name *string `locationName:"name" min:"1" type:"string"` // The OpenID Connect configuration. OpenIDConnectConfig *OpenIDConnectConfig `locationName:"openIDConnectConfig" type:"structure"` @@ -5838,6 +7273,9 @@ type GraphqlApi struct { // The Amazon Cognito user pool configuration. UserPoolConfig *UserPoolConfig `locationName:"userPoolConfig" type:"structure"` + + // A flag representing whether X-Ray tracing is enabled for this GraphqlApi. + XrayEnabled *bool `locationName:"xrayEnabled" type:"boolean"` } // String returns the string representation @@ -5910,6 +7348,12 @@ func (s *GraphqlApi) SetUserPoolConfig(v *UserPoolConfig) *GraphqlApi { return s } +// SetXrayEnabled sets the XrayEnabled field's value. +func (s *GraphqlApi) SetXrayEnabled(v bool) *GraphqlApi { + s.XrayEnabled = &v + return s +} + // Describes an HTTP data source configuration. type HttpDataSourceConfig struct { _ struct{} `type:"structure"` @@ -5961,6 +7405,87 @@ func (s *HttpDataSourceConfig) SetEndpoint(v string) *HttpDataSourceConfig { return s } +// An internal AWS AppSync error occurred. Try your request again. +type InternalFailureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalFailureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalFailureException) GoString() string { + return s.String() +} + +func newErrorInternalFailureException(v protocol.ResponseMetadata) error { + return &InternalFailureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalFailureException) Code() string { + return "InternalFailureException" +} + +// Message returns the exception's message. +func (s InternalFailureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalFailureException) OrigErr() error { + return nil +} + +func (s InternalFailureException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalFailureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalFailureException) RequestID() string { + return s.respMetadata.RequestID +} + +// The LambdaConflictHandlerConfig object when configuring LAMBDA as the Conflict +// Handler. +type LambdaConflictHandlerConfig struct { + _ struct{} `type:"structure"` + + // The Arn for the Lambda function to use as the Conflict Handler. + LambdaConflictHandlerArn *string `locationName:"lambdaConflictHandlerArn" type:"string"` +} + +// String returns the string representation +func (s LambdaConflictHandlerConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LambdaConflictHandlerConfig) GoString() string { + return s.String() +} + +// SetLambdaConflictHandlerArn sets the LambdaConflictHandlerArn field's value. +func (s *LambdaConflictHandlerConfig) SetLambdaConflictHandlerArn(v string) *LambdaConflictHandlerConfig { + s.LambdaConflictHandlerArn = &v + return s +} + // Describes an AWS Lambda data source configuration. type LambdaDataSourceConfig struct { _ struct{} `type:"structure"` @@ -5988,16 +7513,72 @@ func (s *LambdaDataSourceConfig) Validate() error { invalidParams.Add(request.NewErrParamRequired("LambdaFunctionArn")) } - if invalidParams.Len() > 0 { - return invalidParams + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLambdaFunctionArn sets the LambdaFunctionArn field's value. +func (s *LambdaDataSourceConfig) SetLambdaFunctionArn(v string) *LambdaDataSourceConfig { + s.LambdaFunctionArn = &v + return s +} + +// The request exceeded a limit. Try your request again. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { return nil } -// SetLambdaFunctionArn sets the LambdaFunctionArn field's value. -func (s *LambdaDataSourceConfig) SetLambdaFunctionArn(v string) *LambdaDataSourceConfig { - s.LambdaFunctionArn = &v - return s +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID } type ListApiKeysInput struct { @@ -6013,7 +7594,7 @@ type ListApiKeysInput struct { // An identifier that was returned from the previous call to this operation, // which can be used to return the next set of items in the list. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` } // String returns the string representation @@ -6035,6 +7616,9 @@ func (s *ListApiKeysInput) Validate() error { if s.ApiId != nil && len(*s.ApiId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApiId", 1)) } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -6068,7 +7652,7 @@ type ListApiKeysOutput struct { // An identifier to be passed in the next request to this operation to return // the next set of items in the list. - NextToken *string `locationName:"nextToken" type:"string"` + NextToken *string `locationName:"nextToken" min:"1" type:"string"` } // String returns the string representation @@ -6106,7 +7690,7 @@ type ListDataSourcesInput struct { // An identifier that was returned from the previous call to this operation, // which can be used to return the next set of items in the list. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` } // String returns the string representation @@ -6128,6 +7712,9 @@ func (s *ListDataSourcesInput) Validate() error { if s.ApiId != nil && len(*s.ApiId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApiId", 1)) } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -6161,7 +7748,7 @@ type ListDataSourcesOutput struct { // An identifier to be passed in the next request to this operation to return // the next set of items in the list. - NextToken *string `locationName:"nextToken" type:"string"` + NextToken *string `locationName:"nextToken" min:"1" type:"string"` } // String returns the string representation @@ -6199,7 +7786,7 @@ type ListFunctionsInput struct { // An identifier that was returned from the previous call to this operation, // which can be used to return the next set of items in the list. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` } // String returns the string representation @@ -6221,6 +7808,9 @@ func (s *ListFunctionsInput) Validate() error { if s.ApiId != nil && len(*s.ApiId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApiId", 1)) } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -6254,7 +7844,7 @@ type ListFunctionsOutput struct { // An identifier that was returned from the previous call to this operation, // which can be used to return the next set of items in the list. - NextToken *string `locationName:"nextToken" type:"string"` + NextToken *string `locationName:"nextToken" min:"1" type:"string"` } // String returns the string representation @@ -6287,7 +7877,7 @@ type ListGraphqlApisInput struct { // An identifier that was returned from the previous call to this operation, // which can be used to return the next set of items in the list. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` } // String returns the string representation @@ -6300,6 +7890,19 @@ func (s ListGraphqlApisInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListGraphqlApisInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListGraphqlApisInput"} + 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 *ListGraphqlApisInput) SetMaxResults(v int64) *ListGraphqlApisInput { s.MaxResults = &v @@ -6320,7 +7923,7 @@ type ListGraphqlApisOutput struct { // An identifier to be passed in the next request to this operation to return // the next set of items in the list. - NextToken *string `locationName:"nextToken" type:"string"` + NextToken *string `locationName:"nextToken" min:"1" type:"string"` } // String returns the string representation @@ -6363,7 +7966,7 @@ type ListResolversByFunctionInput struct { // An identifier that was returned from the previous call to this operation, // which you can use to return the next set of items in the list. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` } // String returns the string representation @@ -6391,6 +7994,9 @@ func (s *ListResolversByFunctionInput) Validate() error { if s.FunctionId != nil && len(*s.FunctionId) < 1 { invalidParams.Add(request.NewErrParamMinLen("FunctionId", 1)) } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -6426,7 +8032,7 @@ type ListResolversByFunctionOutput struct { _ struct{} `type:"structure"` // An identifier that can be used to return the next set of items in the list. - NextToken *string `locationName:"nextToken" type:"string"` + NextToken *string `locationName:"nextToken" min:"1" type:"string"` // The list of resolvers. Resolvers []*Resolver `locationName:"resolvers" type:"list"` @@ -6467,7 +8073,7 @@ type ListResolversInput struct { // An identifier that was returned from the previous call to this operation, // which can be used to return the next set of items in the list. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` // The type name. // @@ -6494,6 +8100,9 @@ func (s *ListResolversInput) Validate() error { if s.ApiId != nil && len(*s.ApiId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApiId", 1)) } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } if s.TypeName == nil { invalidParams.Add(request.NewErrParamRequired("TypeName")) } @@ -6536,7 +8145,7 @@ type ListResolversOutput struct { // An identifier to be passed in the next request to this operation to return // the next set of items in the list. - NextToken *string `locationName:"nextToken" type:"string"` + NextToken *string `locationName:"nextToken" min:"1" type:"string"` // The Resolver objects. Resolvers []*Resolver `locationName:"resolvers" type:"list"` @@ -6646,7 +8255,7 @@ type ListTypesInput struct { // An identifier that was returned from the previous call to this operation, // which can be used to return the next set of items in the list. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` } // String returns the string representation @@ -6671,6 +8280,9 @@ func (s *ListTypesInput) Validate() error { if s.Format == nil { invalidParams.Add(request.NewErrParamRequired("Format")) } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -6707,7 +8319,7 @@ type ListTypesOutput struct { // An identifier to be passed in the next request to this operation to return // the next set of items in the list. - NextToken *string `locationName:"nextToken" type:"string"` + NextToken *string `locationName:"nextToken" min:"1" type:"string"` // The Type objects. Types []*Type `locationName:"types" type:"list"` @@ -6809,6 +8421,63 @@ func (s *LogConfig) SetFieldLogLevel(v string) *LogConfig { return s } +// The resource specified in the request was not found. Check the resource, +// and then try again. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes an OpenID Connect configuration. type OpenIDConnectConfig struct { _ struct{} `type:"structure"` @@ -7003,11 +8672,14 @@ func (s *RelationalDatabaseDataSourceConfig) SetRelationalDatabaseSourceType(v s type Resolver struct { _ struct{} `type:"structure"` + // The caching configuration for the resolver. + CachingConfig *CachingConfig `locationName:"cachingConfig" type:"structure"` + // The resolver data source name. - DataSourceName *string `locationName:"dataSourceName" type:"string"` + DataSourceName *string `locationName:"dataSourceName" min:"1" type:"string"` // The resolver field name. - FieldName *string `locationName:"fieldName" type:"string"` + FieldName *string `locationName:"fieldName" min:"1" type:"string"` // The resolver type. // @@ -7032,8 +8704,11 @@ type Resolver struct { // The response mapping template. ResponseMappingTemplate *string `locationName:"responseMappingTemplate" min:"1" type:"string"` + // The SyncConfig for a resolver attached to a versioned datasource. + SyncConfig *SyncConfig `locationName:"syncConfig" type:"structure"` + // The resolver type name. - TypeName *string `locationName:"typeName" type:"string"` + TypeName *string `locationName:"typeName" min:"1" type:"string"` } // String returns the string representation @@ -7046,6 +8721,12 @@ func (s Resolver) GoString() string { return s.String() } +// SetCachingConfig sets the CachingConfig field's value. +func (s *Resolver) SetCachingConfig(v *CachingConfig) *Resolver { + s.CachingConfig = v + return s +} + // SetDataSourceName sets the DataSourceName field's value. func (s *Resolver) SetDataSourceName(v string) *Resolver { s.DataSourceName = &v @@ -7088,6 +8769,12 @@ func (s *Resolver) SetResponseMappingTemplate(v string) *Resolver { return s } +// SetSyncConfig sets the SyncConfig field's value. +func (s *Resolver) SetSyncConfig(v *SyncConfig) *Resolver { + s.SyncConfig = v + return s +} + // SetTypeName sets the TypeName field's value. func (s *Resolver) SetTypeName(v string) *Resolver { s.TypeName = &v @@ -7175,6 +8862,63 @@ func (s *StartSchemaCreationOutput) SetStatus(v string) *StartSchemaCreationOutp return s } +// Describes a Sync configuration for a resolver. +// +// Contains information on which Conflict Detection as well as Resolution strategy +// should be performed when the resolver is invoked. +type SyncConfig struct { + _ struct{} `type:"structure"` + + // The Conflict Detection strategy to use. + // + // * VERSION: Detect conflicts based on object versions for this resolver. + // + // * NONE: Do not detect conflicts when executing this resolver. + ConflictDetection *string `locationName:"conflictDetection" type:"string" enum:"ConflictDetectionType"` + + // The Conflict Resolution strategy to perform in the event of a conflict. + // + // * OPTIMISTIC_CONCURRENCY: Resolve conflicts by rejecting mutations when + // versions do not match the latest version at the server. + // + // * AUTOMERGE: Resolve conflicts with the Automerge conflict resolution + // strategy. + // + // * LAMBDA: Resolve conflicts with a Lambda function supplied in the LambdaConflictHandlerConfig. + ConflictHandler *string `locationName:"conflictHandler" type:"string" enum:"ConflictHandlerType"` + + // The LambdaConflictHandlerConfig when configuring LAMBDA as the Conflict Handler. + LambdaConflictHandlerConfig *LambdaConflictHandlerConfig `locationName:"lambdaConflictHandlerConfig" type:"structure"` +} + +// String returns the string representation +func (s SyncConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SyncConfig) GoString() string { + return s.String() +} + +// SetConflictDetection sets the ConflictDetection field's value. +func (s *SyncConfig) SetConflictDetection(v string) *SyncConfig { + s.ConflictDetection = &v + return s +} + +// SetConflictHandler sets the ConflictHandler field's value. +func (s *SyncConfig) SetConflictHandler(v string) *SyncConfig { + s.ConflictHandler = &v + return s +} + +// SetLambdaConflictHandlerConfig sets the LambdaConflictHandlerConfig field's value. +func (s *SyncConfig) SetLambdaConflictHandlerConfig(v *LambdaConflictHandlerConfig) *SyncConfig { + s.LambdaConflictHandlerConfig = v + return s +} + type TagResourceInput struct { _ struct{} `type:"structure"` @@ -7264,7 +9008,7 @@ type Type struct { Format *string `locationName:"format" type:"string" enum:"TypeDefinitionFormat"` // The type name. - Name *string `locationName:"name" type:"string"` + Name *string `locationName:"name" min:"1" type:"string"` } // String returns the string representation @@ -7307,6 +9051,62 @@ func (s *Type) SetName(v string) *Type { return s } +// You are not authorized to perform this operation. +type UnauthorizedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnauthorizedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnauthorizedException) GoString() string { + return s.String() +} + +func newErrorUnauthorizedException(v protocol.ResponseMetadata) error { + return &UnauthorizedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnauthorizedException) Code() string { + return "UnauthorizedException" +} + +// Message returns the exception's message. +func (s UnauthorizedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnauthorizedException) OrigErr() error { + return nil +} + +func (s UnauthorizedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnauthorizedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnauthorizedException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -7379,6 +9179,134 @@ func (s UntagResourceOutput) GoString() string { return s.String() } +// Represents the input of a UpdateApiCache operation. +type UpdateApiCacheInput struct { + _ struct{} `type:"structure"` + + // Caching behavior. + // + // * FULL_REQUEST_CACHING: All requests are fully cached. + // + // * PER_RESOLVER_CACHING: Individual resovlers that you specify are cached. + // + // ApiCachingBehavior is a required field + ApiCachingBehavior *string `locationName:"apiCachingBehavior" type:"string" required:"true" enum:"ApiCachingBehavior"` + + // The GraphQL API Id. + // + // ApiId is a required field + ApiId *string `location:"uri" locationName:"apiId" type:"string" required:"true"` + + // TTL in seconds for cache entries. + // + // Valid values are between 1 and 3600 seconds. + // + // Ttl is a required field + Ttl *int64 `locationName:"ttl" type:"long" required:"true"` + + // The cache instance type. + // + // * T2_SMALL: A t2.small instance type. + // + // * T2_MEDIUM: A t2.medium instance type. + // + // * R4_LARGE: A r4.large instance type. + // + // * R4_XLARGE: A r4.xlarge instance type. + // + // * R4_2XLARGE: A r4.2xlarge instance type. + // + // * R4_4XLARGE: A r4.4xlarge instance type. + // + // * R4_8XLARGE: A r4.8xlarge instance type. + // + // Type is a required field + Type *string `locationName:"type" type:"string" required:"true" enum:"ApiCacheType"` +} + +// String returns the string representation +func (s UpdateApiCacheInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateApiCacheInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateApiCacheInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateApiCacheInput"} + if s.ApiCachingBehavior == nil { + invalidParams.Add(request.NewErrParamRequired("ApiCachingBehavior")) + } + if s.ApiId == nil { + invalidParams.Add(request.NewErrParamRequired("ApiId")) + } + if s.ApiId != nil && len(*s.ApiId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApiId", 1)) + } + if s.Ttl == nil { + invalidParams.Add(request.NewErrParamRequired("Ttl")) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApiCachingBehavior sets the ApiCachingBehavior field's value. +func (s *UpdateApiCacheInput) SetApiCachingBehavior(v string) *UpdateApiCacheInput { + s.ApiCachingBehavior = &v + return s +} + +// SetApiId sets the ApiId field's value. +func (s *UpdateApiCacheInput) SetApiId(v string) *UpdateApiCacheInput { + s.ApiId = &v + return s +} + +// SetTtl sets the Ttl field's value. +func (s *UpdateApiCacheInput) SetTtl(v int64) *UpdateApiCacheInput { + s.Ttl = &v + return s +} + +// SetType sets the Type field's value. +func (s *UpdateApiCacheInput) SetType(v string) *UpdateApiCacheInput { + s.Type = &v + return s +} + +// Represents the output of a UpdateApiCache operation. +type UpdateApiCacheOutput struct { + _ struct{} `type:"structure"` + + // The ApiCache object. + ApiCache *ApiCache `locationName:"apiCache" type:"structure"` +} + +// String returns the string representation +func (s UpdateApiCacheOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateApiCacheOutput) GoString() string { + return s.String() +} + +// SetApiCache sets the ApiCache field's value. +func (s *UpdateApiCacheOutput) SetApiCache(v *ApiCache) *UpdateApiCacheOutput { + s.ApiCache = v + return s +} + type UpdateApiKeyInput struct { _ struct{} `type:"structure"` @@ -7505,7 +9433,7 @@ type UpdateDataSourceInput struct { // The new name for the data source. // // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` + Name *string `location:"uri" locationName:"name" min:"1" type:"string" required:"true"` // The new relational database configuration. RelationalDatabaseConfig *RelationalDatabaseDataSourceConfig `locationName:"relationalDatabaseConfig" type:"structure"` @@ -7668,7 +9596,7 @@ type UpdateFunctionInput struct { // The Function DataSource name. // // DataSourceName is a required field - DataSourceName *string `locationName:"dataSourceName" type:"string" required:"true"` + DataSourceName *string `locationName:"dataSourceName" min:"1" type:"string" required:"true"` // The Function description. Description *string `locationName:"description" type:"string"` @@ -7676,7 +9604,7 @@ type UpdateFunctionInput struct { // The function ID. // // FunctionId is a required field - FunctionId *string `location:"uri" locationName:"functionId" type:"string" required:"true"` + FunctionId *string `location:"uri" locationName:"functionId" min:"1" type:"string" required:"true"` // The version of the request mapping template. Currently the supported value // is 2018-05-29. @@ -7687,7 +9615,7 @@ type UpdateFunctionInput struct { // The Function name. // // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` + Name *string `locationName:"name" min:"1" type:"string" required:"true"` // The Function request mapping template. Functions support only the 2018-05-29 // version of the request mapping template. @@ -7721,6 +9649,9 @@ func (s *UpdateFunctionInput) Validate() error { if s.DataSourceName == nil { invalidParams.Add(request.NewErrParamRequired("DataSourceName")) } + if s.DataSourceName != nil && len(*s.DataSourceName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSourceName", 1)) + } if s.FunctionId == nil { invalidParams.Add(request.NewErrParamRequired("FunctionId")) } @@ -7733,6 +9664,9 @@ func (s *UpdateFunctionInput) Validate() error { 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.RequestMappingTemplate == nil { invalidParams.Add(request.NewErrParamRequired("RequestMappingTemplate")) } @@ -7847,6 +9781,9 @@ type UpdateGraphqlApiInput struct { // The new Amazon Cognito user pool configuration for the GraphqlApi object. UserPoolConfig *UserPoolConfig `locationName:"userPoolConfig" type:"structure"` + + // A flag indicating whether to enable X-Ray tracing for the GraphqlApi. + XrayEnabled *bool `locationName:"xrayEnabled" type:"boolean"` } // String returns the string representation @@ -7945,6 +9882,12 @@ func (s *UpdateGraphqlApiInput) SetUserPoolConfig(v *UserPoolConfig) *UpdateGrap return s } +// SetXrayEnabled sets the XrayEnabled field's value. +func (s *UpdateGraphqlApiInput) SetXrayEnabled(v bool) *UpdateGraphqlApiInput { + s.XrayEnabled = &v + return s +} + type UpdateGraphqlApiOutput struct { _ struct{} `type:"structure"` @@ -7976,13 +9919,16 @@ type UpdateResolverInput struct { // ApiId is a required field ApiId *string `location:"uri" locationName:"apiId" type:"string" required:"true"` + // The caching configuration for the resolver. + CachingConfig *CachingConfig `locationName:"cachingConfig" type:"structure"` + // The new data source name. - DataSourceName *string `locationName:"dataSourceName" type:"string"` + DataSourceName *string `locationName:"dataSourceName" min:"1" type:"string"` // The new field name. // // FieldName is a required field - FieldName *string `location:"uri" locationName:"fieldName" type:"string" required:"true"` + FieldName *string `location:"uri" locationName:"fieldName" min:"1" type:"string" required:"true"` // The resolver type. // @@ -8006,10 +9952,13 @@ type UpdateResolverInput struct { // The new response mapping template. ResponseMappingTemplate *string `locationName:"responseMappingTemplate" min:"1" type:"string"` + // The SyncConfig for a resolver attached to a versioned datasource. + SyncConfig *SyncConfig `locationName:"syncConfig" type:"structure"` + // The new type name. // // TypeName is a required field - TypeName *string `location:"uri" locationName:"typeName" type:"string" required:"true"` + TypeName *string `location:"uri" locationName:"typeName" min:"1" type:"string" required:"true"` } // String returns the string representation @@ -8031,6 +9980,9 @@ func (s *UpdateResolverInput) Validate() error { if s.ApiId != nil && len(*s.ApiId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApiId", 1)) } + if s.DataSourceName != nil && len(*s.DataSourceName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSourceName", 1)) + } if s.FieldName == nil { invalidParams.Add(request.NewErrParamRequired("FieldName")) } @@ -8065,6 +10017,12 @@ func (s *UpdateResolverInput) SetApiId(v string) *UpdateResolverInput { return s } +// SetCachingConfig sets the CachingConfig field's value. +func (s *UpdateResolverInput) SetCachingConfig(v *CachingConfig) *UpdateResolverInput { + s.CachingConfig = v + return s +} + // SetDataSourceName sets the DataSourceName field's value. func (s *UpdateResolverInput) SetDataSourceName(v string) *UpdateResolverInput { s.DataSourceName = &v @@ -8101,6 +10059,12 @@ func (s *UpdateResolverInput) SetResponseMappingTemplate(v string) *UpdateResolv return s } +// SetSyncConfig sets the SyncConfig field's value. +func (s *UpdateResolverInput) SetSyncConfig(v *SyncConfig) *UpdateResolverInput { + s.SyncConfig = v + return s +} + // SetTypeName sets the TypeName field's value. func (s *UpdateResolverInput) SetTypeName(v string) *UpdateResolverInput { s.TypeName = &v @@ -8149,7 +10113,7 @@ type UpdateTypeInput struct { // The new type name. // // TypeName is a required field - TypeName *string `location:"uri" locationName:"typeName" type:"string" required:"true"` + TypeName *string `location:"uri" locationName:"typeName" min:"1" type:"string" required:"true"` } // String returns the string representation @@ -8313,6 +10277,54 @@ func (s *UserPoolConfig) SetUserPoolId(v string) *UserPoolConfig { return s } +const ( + // ApiCacheStatusAvailable is a ApiCacheStatus enum value + ApiCacheStatusAvailable = "AVAILABLE" + + // ApiCacheStatusCreating is a ApiCacheStatus enum value + ApiCacheStatusCreating = "CREATING" + + // ApiCacheStatusDeleting is a ApiCacheStatus enum value + ApiCacheStatusDeleting = "DELETING" + + // ApiCacheStatusModifying is a ApiCacheStatus enum value + ApiCacheStatusModifying = "MODIFYING" + + // ApiCacheStatusFailed is a ApiCacheStatus enum value + ApiCacheStatusFailed = "FAILED" +) + +const ( + // ApiCacheTypeT2Small is a ApiCacheType enum value + ApiCacheTypeT2Small = "T2_SMALL" + + // ApiCacheTypeT2Medium is a ApiCacheType enum value + ApiCacheTypeT2Medium = "T2_MEDIUM" + + // ApiCacheTypeR4Large is a ApiCacheType enum value + ApiCacheTypeR4Large = "R4_LARGE" + + // ApiCacheTypeR4Xlarge is a ApiCacheType enum value + ApiCacheTypeR4Xlarge = "R4_XLARGE" + + // ApiCacheTypeR42xlarge is a ApiCacheType enum value + ApiCacheTypeR42xlarge = "R4_2XLARGE" + + // ApiCacheTypeR44xlarge is a ApiCacheType enum value + ApiCacheTypeR44xlarge = "R4_4XLARGE" + + // ApiCacheTypeR48xlarge is a ApiCacheType enum value + ApiCacheTypeR48xlarge = "R4_8XLARGE" +) + +const ( + // ApiCachingBehaviorFullRequestCaching is a ApiCachingBehavior enum value + ApiCachingBehaviorFullRequestCaching = "FULL_REQUEST_CACHING" + + // ApiCachingBehaviorPerResolverCaching is a ApiCachingBehavior enum value + ApiCachingBehaviorPerResolverCaching = "PER_RESOLVER_CACHING" +) + const ( // AuthenticationTypeApiKey is a AuthenticationType enum value AuthenticationTypeApiKey = "API_KEY" @@ -8332,6 +10344,28 @@ const ( AuthorizationTypeAwsIam = "AWS_IAM" ) +const ( + // ConflictDetectionTypeVersion is a ConflictDetectionType enum value + ConflictDetectionTypeVersion = "VERSION" + + // ConflictDetectionTypeNone is a ConflictDetectionType enum value + ConflictDetectionTypeNone = "NONE" +) + +const ( + // ConflictHandlerTypeOptimisticConcurrency is a ConflictHandlerType enum value + ConflictHandlerTypeOptimisticConcurrency = "OPTIMISTIC_CONCURRENCY" + + // ConflictHandlerTypeLambda is a ConflictHandlerType enum value + ConflictHandlerTypeLambda = "LAMBDA" + + // ConflictHandlerTypeAutomerge is a ConflictHandlerType enum value + ConflictHandlerTypeAutomerge = "AUTOMERGE" + + // ConflictHandlerTypeNone is a ConflictHandlerType enum value + ConflictHandlerTypeNone = "NONE" +) + const ( // DataSourceTypeAwsLambda is a DataSourceType enum value DataSourceTypeAwsLambda = "AWS_LAMBDA" diff --git a/vendor/github.com/aws/aws-sdk-go/service/appsync/errors.go b/vendor/github.com/aws/aws-sdk-go/service/appsync/errors.go index d817d9bb596..f0c0eb3b301 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/appsync/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/appsync/errors.go @@ -2,6 +2,10 @@ package appsync +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccessDeniedException for service response error code @@ -74,3 +78,17 @@ const ( // You are not authorized to perform this operation. ErrCodeUnauthorizedException = "UnauthorizedException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "ApiKeyLimitExceededException": newErrorApiKeyLimitExceededException, + "ApiKeyValidityOutOfBoundsException": newErrorApiKeyValidityOutOfBoundsException, + "ApiLimitExceededException": newErrorApiLimitExceededException, + "BadRequestException": newErrorBadRequestException, + "ConcurrentModificationException": newErrorConcurrentModificationException, + "GraphQLSchemaException": newErrorGraphQLSchemaException, + "InternalFailureException": newErrorInternalFailureException, + "LimitExceededException": newErrorLimitExceededException, + "NotFoundException": newErrorNotFoundException, + "UnauthorizedException": newErrorUnauthorizedException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/appsync/service.go b/vendor/github.com/aws/aws-sdk-go/service/appsync/service.go index 6dae3d4cca7..da4d67cb1ea 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/appsync/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/appsync/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "appsync" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "AppSync" // ServiceID is a unique identifer of a specific service. + ServiceID = "AppSync" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the AppSync client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a AppSync client from just a session. // svc := appsync.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *AppSync { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "appsync" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *AppSync { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *AppSync { svc := &AppSync{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-07-25", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/athena/api.go b/vendor/github.com/aws/aws-sdk-go/service/athena/api.go index 0ac6d4b96c3..e1931f6e160 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/athena/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/athena/api.go @@ -74,12 +74,12 @@ func (c *Athena) BatchGetNamedQueryRequest(input *BatchGetNamedQueryInput) (req // See the AWS API reference guide for Amazon Athena's // API operation BatchGetNamedQuery for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // @@ -163,12 +163,12 @@ func (c *Athena) BatchGetQueryExecutionRequest(input *BatchGetQueryExecutionInpu // See the AWS API reference guide for Amazon Athena's // API operation BatchGetQueryExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // @@ -252,12 +252,12 @@ func (c *Athena) CreateNamedQueryRequest(input *CreateNamedQueryInput) (req *req // See the AWS API reference guide for Amazon Athena's // API operation CreateNamedQuery for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // @@ -337,12 +337,12 @@ func (c *Athena) CreateWorkGroupRequest(input *CreateWorkGroupInput) (req *reque // See the AWS API reference guide for Amazon Athena's // API operation CreateWorkGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // @@ -427,12 +427,12 @@ func (c *Athena) DeleteNamedQueryRequest(input *DeleteNamedQueryInput) (req *req // See the AWS API reference guide for Amazon Athena's // API operation DeleteNamedQuery for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // @@ -513,12 +513,12 @@ func (c *Athena) DeleteWorkGroupRequest(input *DeleteWorkGroupInput) (req *reque // See the AWS API reference guide for Amazon Athena's // API operation DeleteWorkGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // @@ -598,12 +598,12 @@ func (c *Athena) GetNamedQueryRequest(input *GetNamedQueryInput) (req *request.R // See the AWS API reference guide for Amazon Athena's // API operation GetNamedQuery for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // @@ -684,12 +684,12 @@ func (c *Athena) GetQueryExecutionRequest(input *GetQueryExecutionInput) (req *r // See the AWS API reference guide for Amazon Athena's // API operation GetQueryExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // @@ -788,12 +788,12 @@ func (c *Athena) GetQueryResultsRequest(input *GetQueryResultsInput) (req *reque // See the AWS API reference guide for Amazon Athena's // API operation GetQueryResults for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // @@ -862,10 +862,12 @@ func (c *Athena) GetQueryResultsPagesWithContext(ctx aws.Context, input *GetQuer }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetQueryResultsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetQueryResultsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -922,12 +924,12 @@ func (c *Athena) GetWorkGroupRequest(input *GetWorkGroupInput) (req *request.Req // See the AWS API reference guide for Amazon Athena's // API operation GetWorkGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // @@ -1017,12 +1019,12 @@ func (c *Athena) ListNamedQueriesRequest(input *ListNamedQueriesInput) (req *req // See the AWS API reference guide for Amazon Athena's // API operation ListNamedQueries for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // @@ -1091,10 +1093,12 @@ func (c *Athena) ListNamedQueriesPagesWithContext(ctx aws.Context, input *ListNa }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListNamedQueriesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListNamedQueriesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1163,12 +1167,12 @@ func (c *Athena) ListQueryExecutionsRequest(input *ListQueryExecutionsInput) (re // See the AWS API reference guide for Amazon Athena's // API operation ListQueryExecutions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // @@ -1237,10 +1241,12 @@ func (c *Athena) ListQueryExecutionsPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListQueryExecutionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListQueryExecutionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1297,16 +1303,16 @@ func (c *Athena) ListTagsForResourceRequest(input *ListTagsForResourceInput) (re // See the AWS API reference guide for Amazon Athena's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource, such as a workgroup, was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/athena-2017-05-18/ListTagsForResource @@ -1390,12 +1396,12 @@ func (c *Athena) ListWorkGroupsRequest(input *ListWorkGroupsInput) (req *request // See the AWS API reference guide for Amazon Athena's // API operation ListWorkGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // @@ -1464,10 +1470,12 @@ func (c *Athena) ListWorkGroupsPagesWithContext(ctx aws.Context, input *ListWork }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListWorkGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListWorkGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1529,16 +1537,16 @@ func (c *Athena) StartQueryExecutionRequest(input *StartQueryExecutionInput) (re // See the AWS API reference guide for Amazon Athena's // API operation StartQueryExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Indicates that the request was throttled. // // See also, https://docs.aws.amazon.com/goto/WebAPI/athena-2017-05-18/StartQueryExecution @@ -1622,12 +1630,12 @@ func (c *Athena) StopQueryExecutionRequest(input *StopQueryExecutionInput) (req // See the AWS API reference guide for Amazon Athena's // API operation StopQueryExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // @@ -1719,16 +1727,16 @@ func (c *Athena) TagResourceRequest(input *TagResourceInput) (req *request.Reque // See the AWS API reference guide for Amazon Athena's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource, such as a workgroup, was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/athena-2017-05-18/TagResource @@ -1809,16 +1817,16 @@ func (c *Athena) UntagResourceRequest(input *UntagResourceInput) (req *request.R // See the AWS API reference guide for Amazon Athena's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource, such as a workgroup, was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/athena-2017-05-18/UntagResource @@ -1898,12 +1906,12 @@ func (c *Athena) UpdateWorkGroupRequest(input *UpdateWorkGroupInput) (req *reque // See the AWS API reference guide for Amazon Athena's // API operation UpdateWorkGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // Indicates a platform issue, which may be due to a transient condition or // outage. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a required parameter may be missing or out of range. // @@ -2890,6 +2898,124 @@ func (s *GetWorkGroupOutput) SetWorkGroup(v *WorkGroup) *GetWorkGroupOutput { return s } +// Indicates a platform issue, which may be due to a transient condition or +// outage. +type InternalServerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalServerException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerException) GoString() string { + return s.String() +} + +func newErrorInternalServerException(v protocol.ResponseMetadata) error { + return &InternalServerException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerException) Code() string { + return "InternalServerException" +} + +// Message returns the exception's message. +func (s InternalServerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerException) OrigErr() error { + return nil +} + +func (s InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerException) RequestID() string { + return s.respMetadata.RequestID +} + +// Indicates that something is wrong with the input to the request. For example, +// a required parameter may be missing or out of range. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error code returned when the query execution failed to process, or when + // the processing request for the named query failed. + AthenaErrorCode *string `min:"1" type:"string"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + type ListNamedQueriesInput struct { _ struct{} `type:"structure"` @@ -3347,9 +3473,8 @@ type QueryExecution struct { // and DML, such as SHOW CREATE TABLE, or DESCRIBE . StatementType *string `type:"string" enum:"StatementType"` - // The location of a manifest file that tracks file locations generated by the - // query, the amount of data scanned by the query, and the amount of time that - // it took the query to run. + // The amount of data scanned during the query execution and the amount of time + // that it took to execute, and the type of statement that was run. Statistics *QueryExecutionStatistics `type:"structure"` // The completion date, current state, submission time, and state change reason @@ -3455,19 +3580,19 @@ func (s *QueryExecutionContext) SetDatabase(v string) *QueryExecutionContext { return s } -// The location of a manifest file that tracks file locations generated by the -// query, the amount of data scanned by the query, and the amount of time that -// it took the query to run. +// The amount of data scanned during the query execution and the amount of time +// that it took to execute, and the type of statement that was run. type QueryExecutionStatistics struct { _ struct{} `type:"structure"` // The location and file name of a data manifest file. The manifest file is - // saved to the Athena query results location in Amazon S3. It tracks files - // that the query wrote to Amazon S3. If the query fails, the manifest file - // also tracks files that the query intended to write. The manifest is useful - // for identifying orphaned files resulting from a failed query. For more information, - // see Working with Query Output Files (https://docs.aws.amazon.com/athena/latest/ug/querying.html) - // in the Amazon Athena User Guide. + // saved to the Athena query results location in Amazon S3. The manifest file + // tracks files that the query wrote to Amazon S3. If the query fails, the manifest + // file also tracks files that the query intended to write. The manifest is + // useful for identifying orphaned files resulting from a failed query. For + // more information, see Working with Query Results, Output Files, and Query + // History (https://docs.aws.amazon.com/athena/latest/ug/querying.html) in the + // Amazon Athena User Guide. DataManifestLocation *string `type:"string"` // The number of bytes in the data that was queried. @@ -3475,6 +3600,24 @@ type QueryExecutionStatistics struct { // The number of milliseconds that the query took to execute. EngineExecutionTimeInMillis *int64 `type:"long"` + + // The number of milliseconds that Athena took to plan the query processing + // flow. This includes the time spent retrieving table partitions from the data + // source. Note that because the query engine performs the query planning, query + // planning time is a subset of engine processing time. + QueryPlanningTimeInMillis *int64 `type:"long"` + + // The number of milliseconds that the query was in your query queue waiting + // for resources. Note that if transient errors occur, Athena might automatically + // add the query back to the queue. + QueryQueueTimeInMillis *int64 `type:"long"` + + // The number of milliseconds that Athena took to finalize and publish the query + // results after the query engine finished running the query. + ServiceProcessingTimeInMillis *int64 `type:"long"` + + // The number of milliseconds that Athena took to run the query. + TotalExecutionTimeInMillis *int64 `type:"long"` } // String returns the string representation @@ -3505,6 +3648,30 @@ func (s *QueryExecutionStatistics) SetEngineExecutionTimeInMillis(v int64) *Quer return s } +// SetQueryPlanningTimeInMillis sets the QueryPlanningTimeInMillis field's value. +func (s *QueryExecutionStatistics) SetQueryPlanningTimeInMillis(v int64) *QueryExecutionStatistics { + s.QueryPlanningTimeInMillis = &v + return s +} + +// SetQueryQueueTimeInMillis sets the QueryQueueTimeInMillis field's value. +func (s *QueryExecutionStatistics) SetQueryQueueTimeInMillis(v int64) *QueryExecutionStatistics { + s.QueryQueueTimeInMillis = &v + return s +} + +// SetServiceProcessingTimeInMillis sets the ServiceProcessingTimeInMillis field's value. +func (s *QueryExecutionStatistics) SetServiceProcessingTimeInMillis(v int64) *QueryExecutionStatistics { + s.ServiceProcessingTimeInMillis = &v + return s +} + +// SetTotalExecutionTimeInMillis sets the TotalExecutionTimeInMillis field's value. +func (s *QueryExecutionStatistics) SetTotalExecutionTimeInMillis(v int64) *QueryExecutionStatistics { + s.TotalExecutionTimeInMillis = &v + return s +} + // The completion date, current state, submission time, and state change reason // (if applicable) for the query execution. type QueryExecutionStatus struct { @@ -3562,6 +3729,64 @@ func (s *QueryExecutionStatus) SetSubmissionDateTime(v time.Time) *QueryExecutio return s } +// A resource, such as a workgroup, was not found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + ResourceName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // The location in Amazon S3 where query results are stored and the encryption // option, if any, used for query results. These are known as "client-side settings". // If workgroup settings override client-side settings, then the query uses @@ -4097,6 +4322,66 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// Indicates that the request was throttled. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The reason for the query throttling, for example, when it exceeds the concurrent + // query limit. + Reason *string `type:"string" enum:"ThrottleReason"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + // Information about a named query ID that could not be processed. type UnprocessedNamedQueryId struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/athena/errors.go b/vendor/github.com/aws/aws-sdk-go/service/athena/errors.go index 1d280db2b20..5da82bf6a0e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/athena/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/athena/errors.go @@ -2,6 +2,10 @@ package athena +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInternalServerException for service response error code @@ -30,3 +34,10 @@ const ( // Indicates that the request was throttled. ErrCodeTooManyRequestsException = "TooManyRequestsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InternalServerException": newErrorInternalServerException, + "InvalidRequestException": newErrorInvalidRequestException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "TooManyRequestsException": newErrorTooManyRequestsException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/athena/service.go b/vendor/github.com/aws/aws-sdk-go/service/athena/service.go index 6806a62ec95..3b624a855c1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/athena/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/athena/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "athena" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Athena" // ServiceID is a unique identifer of a specific service. + ServiceID = "Athena" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Athena client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Athena client from just a session. // svc := athena.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := athena.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *Athena { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Athena { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Athena { svc := &Athena{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-05-18", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index d1df5efe58f..d80c2f819d9 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/api.go @@ -623,8 +623,8 @@ func (c *AutoScaling) CreateAutoScalingGroupRequest(input *CreateAutoScalingGrou // // If you exceed your maximum limit of Auto Scaling groups, the call fails. // For information about viewing this limit, see DescribeAccountLimits. For -// information about updating this limit, see Amazon EC2 Auto Scaling Limits -// (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html) +// information about updating this limit, see Amazon EC2 Auto Scaling Service +// Quotas (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -722,8 +722,8 @@ func (c *AutoScaling) CreateLaunchConfigurationRequest(input *CreateLaunchConfig // // If you exceed your maximum limit of launch configurations, the call fails. // For information about viewing this limit, see DescribeAccountLimits. For -// information about updating this limit, see Amazon EC2 Auto Scaling Limits -// (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html) +// information about updating this limit, see Amazon EC2 Auto Scaling Service +// Quotas (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html) // in the Amazon EC2 Auto Scaling User Guide. // // For more information, see Launch Configurations (https://docs.aws.amazon.com/autoscaling/ec2/userguide/LaunchConfiguration.html) @@ -1527,11 +1527,11 @@ func (c *AutoScaling) DescribeAccountLimitsRequest(input *DescribeAccountLimitsI // DescribeAccountLimits API operation for Auto Scaling. // -// Describes the current Amazon EC2 Auto Scaling resource limits for your AWS +// Describes the current Amazon EC2 Auto Scaling resource quotas for your AWS // account. // -// For information about requesting an increase in these limits, see Amazon -// EC2 Auto Scaling Limits (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html) +// For information about requesting an increase, see Amazon EC2 Auto Scaling +// Service Quotas (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-account-limits.html) // in the Amazon EC2 Auto Scaling User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1780,10 +1780,12 @@ func (c *AutoScaling) DescribeAutoScalingGroupsPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeAutoScalingGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeAutoScalingGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1919,10 +1921,12 @@ func (c *AutoScaling) DescribeAutoScalingInstancesPagesWithContext(ctx aws.Conte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeAutoScalingInstancesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeAutoScalingInstancesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2138,10 +2142,12 @@ func (c *AutoScaling) DescribeLaunchConfigurationsPagesWithContext(ctx aws.Conte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeLaunchConfigurationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeLaunchConfigurationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2691,10 +2697,12 @@ func (c *AutoScaling) DescribeNotificationConfigurationsPagesWithContext(ctx aws }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeNotificationConfigurationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeNotificationConfigurationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2833,10 +2841,12 @@ func (c *AutoScaling) DescribePoliciesPagesWithContext(ctx aws.Context, input *D }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribePoliciesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribePoliciesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2972,10 +2982,12 @@ func (c *AutoScaling) DescribeScalingActivitiesPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScalingActivitiesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeScalingActivitiesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3193,10 +3205,12 @@ func (c *AutoScaling) DescribeScheduledActionsPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScheduledActionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeScheduledActionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3341,10 +3355,12 @@ func (c *AutoScaling) DescribeTagsPagesWithContext(ctx aws.Context, input *Descr }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTagsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeTagsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3909,6 +3925,15 @@ func (c *AutoScaling) EnterStandbyRequest(input *EnterStandbyInput) (req *reques // // Moves the specified instances into the standby state. // +// If you choose to decrement the desired capacity of the Auto Scaling group, +// the instances can enter standby as long as the desired capacity of the Auto +// Scaling group after the instances are placed into standby is equal to or +// greater than the minimum capacity of the group. +// +// If you choose not to decrement the desired capacity of the Auto Scaling group, +// the Auto Scaling group launches new instances to replace the instances on +// standby. +// // For more information, see Temporarily Removing Instances from Your Auto Scaling // Group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html) // in the Amazon EC2 Auto Scaling User Guide. @@ -4078,6 +4103,8 @@ func (c *AutoScaling) ExitStandbyRequest(input *ExitStandbyInput) (req *request. // // Moves the specified instances out of the standby state. // +// After you put the instances back in service, the desired capacity is incremented. +// // For more information, see Temporarily Removing Instances from Your Auto Scaling // Group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enter-exit-standby.html) // in the Amazon EC2 Auto Scaling User Guide. @@ -4376,10 +4403,7 @@ func (c *AutoScaling) PutScalingPolicyRequest(input *PutScalingPolicyInput) (req // PutScalingPolicy API operation for Auto Scaling. // -// Creates or updates a scaling policy for an Auto Scaling group. To update -// an existing scaling policy, use the existing policy name and set the parameters -// to change. Any existing parameter not changed in an update to an existing -// policy is not changed in this update request. +// Creates or updates a scaling policy for an Auto Scaling group. // // For more information about using scaling policies to scale your Auto Scaling // group automatically, see Dynamic Scaling (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-scale-based-on-demand.html) @@ -5116,10 +5140,20 @@ func (c *AutoScaling) TerminateInstanceInAutoScalingGroupRequest(input *Terminat // TerminateInstanceInAutoScalingGroup API operation for Auto Scaling. // // Terminates the specified instance and optionally adjusts the desired group -// size. +// size. This call simply makes a termination request. The instance is not terminated +// immediately. When an instance is terminated, the instance status changes +// to terminated. You can't connect to or start an instance after you've terminated +// it. // -// This call simply makes a termination request. The instance is not terminated -// immediately. +// If you do not specify the option to decrement the desired capacity, Amazon +// EC2 Auto Scaling launches instances to replace the ones that are terminated. +// +// By default, Amazon EC2 Auto Scaling balances instances across all Availability +// Zones. If you decrement the desired capacity, your Auto Scaling group can +// become unbalanced between Availability Zones. Amazon EC2 Auto Scaling tries +// to rebalance the group, and rebalancing might terminate instances in other +// zones. For more information, see Rebalancing Activities (https://docs.aws.amazon.com/autoscaling/ec2/userguide/auto-scaling-benefits.html#AutoScalingBehavior.InstanceUsage) +// in the Amazon EC2 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 @@ -5209,8 +5243,7 @@ func (c *AutoScaling) UpdateAutoScalingGroupRequest(input *UpdateAutoScalingGrou // To update an Auto Scaling group, specify the name of the group and the parameter // that you want to change. Any parameters that you don't specify are not changed // by this update request. The new settings take effect on any scaling activities -// after this call returns. Scaling activities that are currently in progress -// aren't affected. +// after this call returns. // // If you associate a new launch configuration or template with an Auto Scaling // group, all new instances will get the updated configuration. Existing instances @@ -6120,6 +6153,15 @@ type CreateAutoScalingGroupInput struct { // in the Amazon EC2 Auto Scaling User Guide. LoadBalancerNames []*string `type:"list"` + // The maximum amount of time, in seconds, that an instance can be in service. + // + // For more information, see Replacing Auto Scaling Instances Based on Maximum + // Instance Lifetime (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html) + // in the Amazon EC2 Auto Scaling User Guide. + // + // Valid Range: Minimum value of 604800. + MaxInstanceLifetime *int64 `type:"integer"` + // The maximum size of the group. // // MaxSize is a required field @@ -6354,6 +6396,12 @@ func (s *CreateAutoScalingGroupInput) SetLoadBalancerNames(v []*string) *CreateA return s } +// SetMaxInstanceLifetime sets the MaxInstanceLifetime field's value. +func (s *CreateAutoScalingGroupInput) SetMaxInstanceLifetime(v int64) *CreateAutoScalingGroupInput { + s.MaxInstanceLifetime = &v + return s +} + // SetMaxSize sets the MaxSize field's value. func (s *CreateAutoScalingGroupInput) SetMaxSize(v int64) *CreateAutoScalingGroupInput { s.MaxSize = &v @@ -6562,7 +6610,7 @@ type CreateLaunchConfigurationInput struct { // For more information, see Instance Placement Tenancy (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-in-vpc.html#as-vpc-tenancy) // in the Amazon EC2 Auto Scaling User Guide. // - // Valid values: default | dedicated + // Valid Values: default | dedicated PlacementTenancy *string `min:"1" type:"string"` // The ID of the RAM disk to select. @@ -6582,17 +6630,13 @@ type CreateLaunchConfigurationInput struct { // 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 + // the current Spot price. For more information, see Launching Spot Instances // in Your Auto Scaling Group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html) // in the Amazon EC2 Auto Scaling User Guide. // - // If a Spot price is set, then the Auto Scaling group will only launch instances - // when the Spot price has been met, regardless of the setting in the Auto Scaling - // group's DesiredCapacity. - // - // When you change your Spot price by creating a new launch configuration, running - // instances will continue to run as long as the Spot price for those running - // instances is higher than the current Spot market price. + // When you change your maximum price by creating a new launch configuration, + // running instances will continue to run as long as the maximum price for those + // running instances is higher than the current Spot price. SpotPrice *string `min:"1" type:"string"` // The Base64-encoded user data to make available to the launched EC2 instances. @@ -7449,12 +7493,12 @@ func (s DescribeAccountLimitsInput) GoString() string { type DescribeAccountLimitsOutput struct { _ struct{} `type:"structure"` - // The maximum number of groups allowed for your AWS account. The default limit - // is 200 per AWS Region. + // The maximum number of groups allowed for your AWS account. The default is + // 200 groups per AWS Region. MaxNumberOfAutoScalingGroups *int64 `type:"integer"` // The maximum number of launch configurations allowed for your AWS account. - // The default limit is 200 per AWS Region. + // The default is 200 launch configurations per AWS Region. MaxNumberOfLaunchConfigurations *int64 `type:"integer"` // The current number of groups for your AWS account. @@ -9117,7 +9161,7 @@ type Ebs struct { // or sc1 for Cold HDD. For more information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) // in the Amazon EC2 User Guide for Linux Instances. // - // Valid values: standard | io1 | gp2 | st1 | sc1 + // Valid Values: standard | io1 | gp2 | st1 | sc1 VolumeType *string `min:"1" type:"string"` } @@ -9749,6 +9793,11 @@ type Group struct { // One or more load balancers associated with the group. LoadBalancerNames []*string `type:"list"` + // The maximum amount of time, in seconds, that an instance can be in service. + // + // Valid Range: Minimum value of 604800. + MaxInstanceLifetime *int64 `type:"integer"` + // The maximum size of the group. // // MaxSize is a required field @@ -9880,6 +9929,12 @@ func (s *Group) SetLoadBalancerNames(v []*string) *Group { return s } +// SetMaxInstanceLifetime sets the MaxInstanceLifetime field's value. +func (s *Group) SetMaxInstanceLifetime(v int64) *Group { + s.MaxInstanceLifetime = &v + return s +} + // SetMaxSize sets the MaxSize field's value. func (s *Group) SetMaxSize(v int64) *Group { s.MaxSize = &v @@ -9974,6 +10029,9 @@ type Instance struct { // InstanceId is a required field InstanceId *string `min:"1" type:"string" required:"true"` + // The instance type of the EC2 instance. + InstanceType *string `min:"1" type:"string"` + // The launch configuration associated with the instance. LaunchConfigurationName *string `min:"1" type:"string"` @@ -9991,6 +10049,12 @@ type Instance struct { // // ProtectedFromScaleIn is a required field ProtectedFromScaleIn *bool `type:"boolean" required:"true"` + + // The number of capacity units contributed by the instance based on its instance + // type. + // + // Valid Range: Minimum value of 1. Maximum value of 999. + WeightedCapacity *string `min:"1" type:"string"` } // String returns the string representation @@ -10021,6 +10085,12 @@ func (s *Instance) SetInstanceId(v string) *Instance { return s } +// SetInstanceType sets the InstanceType field's value. +func (s *Instance) SetInstanceType(v string) *Instance { + s.InstanceType = &v + return s +} + // SetLaunchConfigurationName sets the LaunchConfigurationName field's value. func (s *Instance) SetLaunchConfigurationName(v string) *Instance { s.LaunchConfigurationName = &v @@ -10045,6 +10115,12 @@ func (s *Instance) SetProtectedFromScaleIn(v bool) *Instance { return s } +// SetWeightedCapacity sets the WeightedCapacity field's value. +func (s *Instance) SetWeightedCapacity(v string) *Instance { + s.WeightedCapacity = &v + return s +} + // Describes an EC2 instance associated with an Auto Scaling group. type InstanceDetails struct { _ struct{} `type:"structure"` @@ -10072,6 +10148,9 @@ type InstanceDetails struct { // InstanceId is a required field InstanceId *string `min:"1" type:"string" required:"true"` + // The instance type of the EC2 instance. + InstanceType *string `min:"1" type:"string"` + // The launch configuration used to launch the instance. This value is not available // if you attached the instance to the Auto Scaling group. LaunchConfigurationName *string `min:"1" type:"string"` @@ -10089,6 +10168,12 @@ type InstanceDetails struct { // // ProtectedFromScaleIn is a required field ProtectedFromScaleIn *bool `type:"boolean" required:"true"` + + // The number of capacity units contributed by the instance based on its instance + // type. + // + // Valid Range: Minimum value of 1. Maximum value of 999. + WeightedCapacity *string `min:"1" type:"string"` } // String returns the string representation @@ -10125,6 +10210,12 @@ func (s *InstanceDetails) SetInstanceId(v string) *InstanceDetails { return s } +// SetInstanceType sets the InstanceType field's value. +func (s *InstanceDetails) SetInstanceType(v string) *InstanceDetails { + s.InstanceType = &v + return s +} + // SetLaunchConfigurationName sets the LaunchConfigurationName field's value. func (s *InstanceDetails) SetLaunchConfigurationName(v string) *InstanceDetails { s.LaunchConfigurationName = &v @@ -10149,6 +10240,12 @@ func (s *InstanceDetails) SetProtectedFromScaleIn(v bool) *InstanceDetails { return s } +// SetWeightedCapacity sets the WeightedCapacity field's value. +func (s *InstanceDetails) SetWeightedCapacity(v string) *InstanceDetails { + s.WeightedCapacity = &v + return s +} + // Describes whether detailed monitoring is enabled for the Auto Scaling instances. type InstanceMonitoring struct { _ struct{} `type:"structure"` @@ -10179,6 +10276,14 @@ func (s *InstanceMonitoring) SetEnabled(v bool) *InstanceMonitoring { // and Spot Instances, the maximum price to pay for Spot Instances, and how // the Auto Scaling group allocates instance types to fulfill On-Demand and // Spot capacity. +// +// When you update SpotAllocationStrategy, SpotInstancePools, or SpotMaxPrice, +// this update action does not deploy any changes across the running Amazon +// EC2 instances in the group. Your existing Spot Instances continue to run +// as long as the maximum price for those instances is higher than the current +// Spot price. When scale out occurs, Amazon EC2 Auto Scaling launches instances +// based on the new settings. When scale in occurs, Amazon EC2 Auto Scaling +// terminates instances according to the group's termination policies. type InstancesDistribution struct { _ struct{} `type:"structure"` @@ -10197,16 +10302,28 @@ type InstancesDistribution struct { // by On-Demand Instances. This base portion is provisioned first as your group // scales. // - // The default value is 0. If you leave this parameter set to 0, On-Demand Instances - // are launched as a percentage of the Auto Scaling group's desired capacity, - // per the OnDemandPercentageAboveBaseCapacity setting. + // Default if not set is 0. If you leave it set to 0, On-Demand Instances are + // launched as a percentage of the Auto Scaling group's desired capacity, per + // the OnDemandPercentageAboveBaseCapacity setting. + // + // An update to this setting means a gradual replacement of instances to maintain + // the specified number of On-Demand Instances for your base capacity. When + // replacing instances, Amazon EC2 Auto Scaling launches new instances before + // terminating the old ones. OnDemandBaseCapacity *int64 `type:"integer"` // Controls the percentages of On-Demand Instances and Spot Instances for your - // additional capacity beyond OnDemandBaseCapacity. The range is 0–100. + // additional capacity beyond OnDemandBaseCapacity. + // + // Default if not set is 100. If you leave it set to 100, the percentages are + // 100% for On-Demand Instances and 0% for Spot Instances. // - // The default value is 100. If you leave this parameter set to 100, the percentages - // are 100% for On-Demand Instances and 0% for Spot Instances. + // An update to this setting means a gradual replacement of instances to maintain + // the percentage of On-Demand Instances for your additional capacity above + // the base capacity. When replacing instances, Amazon EC2 Auto Scaling launches + // new instances before terminating the old ones. + // + // Valid Range: Minimum value of 0. Maximum value of 100. OnDemandPercentageAboveBaseCapacity *int64 `type:"integer"` // Indicates how to allocate instances across Spot Instance pools. @@ -10226,9 +10343,11 @@ type InstancesDistribution struct { // The number of Spot Instance pools across which to allocate your Spot Instances. // The Spot pools are determined from the different instance types in the Overrides - // array of LaunchTemplate. The range is 1–20. The default value is 2. + // array of LaunchTemplate. Default if not set is 2. + // + // Used only when the Spot allocation strategy is lowest-price. // - // Valid only when the Spot allocation strategy is lowest-price. + // Valid Range: Minimum value of 1. Maximum value of 20. SpotInstancePools *int64 `type:"integer"` // The maximum price per unit hour that you are willing to pay for a Spot Instance. @@ -10402,7 +10521,7 @@ type LaunchConfiguration struct { // 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. + // the current Spot price. // // For more information, see Launching Spot Instances in Your Auto Scaling Group // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-launch-spot-instances.html) @@ -10545,6 +10664,11 @@ func (s *LaunchConfiguration) SetUserData(v string) *LaunchConfiguration { // The overrides are used to override the instance type specified by the launch // template with multiple instance types that can be used to launch On-Demand // Instances and Spot Instances. +// +// When you update the launch template or overrides, existing Amazon EC2 instances +// continue to run. When scale out occurs, Amazon EC2 Auto Scaling launches +// instances to match the new settings. When scale in occurs, Amazon EC2 Auto +// Scaling terminates instances according to the group's termination policies. type LaunchTemplate struct { _ struct{} `type:"structure"` @@ -10552,9 +10676,9 @@ type LaunchTemplate struct { // or launch template name in the request. LaunchTemplateSpecification *LaunchTemplateSpecification `type:"structure"` - // Any parameters that you specify override the same parameters in the launch - // template. Currently, the only supported override is instance type. You must - // specify between 2 and 20 overrides. + // An optional setting. Any parameters that you specify override the same parameters + // in the launch template. Currently, the only supported override is instance + // type. You can specify between 1 and 20 instance types. Overrides []*LaunchTemplateOverrides `type:"list"` } @@ -10615,6 +10739,19 @@ type LaunchTemplateOverrides struct { // (https://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 number of capacity units, which gives the instance type a proportional + // weight to other instance types. For example, larger instance types are generally + // weighted more than smaller instance types. These are the same units that + // you chose to set the desired capacity in terms of instances, or a performance + // attribute such as vCPUs, memory, or I/O. + // + // For more information, see Instance Weighting for Amazon EC2 Auto Scaling + // (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-weighting.html) + // in the Amazon EC2 Auto Scaling User Guide. + // + // Valid Range: Minimum value of 1. Maximum value of 999. + WeightedCapacity *string `min:"1" type:"string"` } // String returns the string representation @@ -10633,6 +10770,9 @@ func (s *LaunchTemplateOverrides) Validate() error { if s.InstanceType != nil && len(*s.InstanceType) < 1 { invalidParams.Add(request.NewErrParamMinLen("InstanceType", 1)) } + if s.WeightedCapacity != nil && len(*s.WeightedCapacity) < 1 { + invalidParams.Add(request.NewErrParamMinLen("WeightedCapacity", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -10646,6 +10786,12 @@ func (s *LaunchTemplateOverrides) SetInstanceType(v string) *LaunchTemplateOverr return s } +// SetWeightedCapacity sets the WeightedCapacity field's value. +func (s *LaunchTemplateOverrides) SetWeightedCapacity(v string) *LaunchTemplateOverrides { + s.WeightedCapacity = &v + return s +} + // Describes a launch template and the launch template version. // // The launch template that is specified must be configured for use with an @@ -11234,8 +11380,8 @@ type MixedInstancesPolicy struct { // The instances distribution to use. // - // If you leave this parameter unspecified when creating a mixed instances policy, - // the default values are used. + // If you leave this parameter unspecified, the value for each parameter in + // InstancesDistribution uses a default value. InstancesDistribution *InstancesDistribution `type:"structure"` // The launch template and instance types (overrides). @@ -11339,13 +11485,7 @@ func (s *NotificationConfiguration) SetTopicARN(v string) *NotificationConfigura type PredefinedMetricSpecification struct { _ struct{} `type:"structure"` - // The metric type. - // - // PredefinedMetricType is a required field - PredefinedMetricType *string `type:"string" required:"true" enum:"MetricType"` - - // Identifies the resource associated with the metric type. The following predefined - // metrics are available: + // The metric type. The following predefined metrics are available: // // * ASGAverageCPUUtilization - Average CPU utilization of the Auto Scaling // group. @@ -11359,15 +11499,21 @@ type PredefinedMetricSpecification struct { // * ALBRequestCountPerTarget - Number of requests completed per target in // an Application Load Balancer target group. // - // For predefined metric types ASGAverageCPUUtilization, ASGAverageNetworkIn, - // and ASGAverageNetworkOut, the parameter must not be specified as the resource - // associated with the metric type is the Auto Scaling group. For predefined - // metric type ALBRequestCountPerTarget, the parameter must be specified in - // the format: app/load-balancer-name/load-balancer-id/targetgroup/target-group-name/target-group-id - // , where app/load-balancer-name/load-balancer-id is the final portion of the - // load balancer ARN, and targetgroup/target-group-name/target-group-id is the - // final portion of the target group ARN. The target group must be attached - // to the Auto Scaling group. + // PredefinedMetricType is a required field + PredefinedMetricType *string `type:"string" required:"true" enum:"MetricType"` + + // Identifies the resource associated with the metric type. You can't specify + // a resource label unless the metric type is ALBRequestCountPerTarget and there + // is a target group attached to the Auto Scaling group. + // + // The format is app/load-balancer-name/load-balancer-id/targetgroup/target-group-name/target-group-id + // , where + // + // * app/load-balancer-name/load-balancer-id is the final portion of the + // load balancer ARN, and + // + // * targetgroup/target-group-name/target-group-id is the final portion of + // the target group ARN. ResourceLabel *string `min:"1" type:"string"` } @@ -11734,6 +11880,12 @@ type PutScalingPolicyInput struct { // in the Amazon EC2 Auto Scaling User Guide. Cooldown *int64 `type:"integer"` + // Indicates whether the scaling policy is enabled or disabled. The default + // is enabled. For more information, see Disabling a Scaling Policy for an Auto + // Scaling Group (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-enable-disable-scaling-policy.html) + // in the Amazon EC2 Auto Scaling User Guide. + Enabled *bool `type:"boolean"` + // 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. @@ -11878,6 +12030,12 @@ func (s *PutScalingPolicyInput) SetCooldown(v int64) *PutScalingPolicyInput { return s } +// SetEnabled sets the Enabled field's value. +func (s *PutScalingPolicyInput) SetEnabled(v bool) *PutScalingPolicyInput { + s.Enabled = &v + return s +} + // SetEstimatedInstanceWarmup sets the EstimatedInstanceWarmup field's value. func (s *PutScalingPolicyInput) SetEstimatedInstanceWarmup(v int64) *PutScalingPolicyInput { s.EstimatedInstanceWarmup = &v @@ -12249,6 +12407,9 @@ type ScalingPolicy struct { // any further dynamic scaling activities can start. Cooldown *int64 `type:"integer"` + // Indicates whether the policy is enabled (true) or disabled (false). + Enabled *bool `type:"boolean"` + // The estimated time, in seconds, until a newly launched instance can contribute // to the CloudWatch metrics. EstimatedInstanceWarmup *int64 `type:"integer"` @@ -12322,6 +12483,12 @@ func (s *ScalingPolicy) SetCooldown(v int64) *ScalingPolicy { return s } +// SetEnabled sets the Enabled field's value. +func (s *ScalingPolicy) SetEnabled(v bool) *ScalingPolicy { + s.Enabled = &v + return s +} + // SetEstimatedInstanceWarmup sets the EstimatedInstanceWarmup field's value. func (s *ScalingPolicy) SetEstimatedInstanceWarmup(v int64) *ScalingPolicy { s.EstimatedInstanceWarmup = &v @@ -13419,11 +13586,6 @@ type UpdateAutoScalingGroupInput struct { // The name of the launch configuration. If you specify LaunchConfigurationName // in your update request, you can't specify LaunchTemplate or MixedInstancesPolicy. - // - // 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 get an error. If you have previously enabled the collection of group - // metrics, you can disable it using DisableMetricsCollection. LaunchConfigurationName *string `min:"1" type:"string"` // The launch template and version to use to specify the updates. If you specify @@ -13434,6 +13596,15 @@ type UpdateAutoScalingGroupInput struct { // in the Amazon EC2 Auto Scaling API Reference. LaunchTemplate *LaunchTemplateSpecification `type:"structure"` + // The maximum amount of time, in seconds, that an instance can be in service. + // + // For more information, see Replacing Auto Scaling Instances Based on Maximum + // Instance Lifetime (https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-max-instance-lifetime.html) + // in the Amazon EC2 Auto Scaling User Guide. + // + // Valid Range: Minimum value of 604800. + MaxInstanceLifetime *int64 `type:"integer"` + // The maximum size of the Auto Scaling group. MaxSize *int64 `type:"integer"` @@ -13590,6 +13761,12 @@ func (s *UpdateAutoScalingGroupInput) SetLaunchTemplate(v *LaunchTemplateSpecifi return s } +// SetMaxInstanceLifetime sets the MaxInstanceLifetime field's value. +func (s *UpdateAutoScalingGroupInput) SetMaxInstanceLifetime(v int64) *UpdateAutoScalingGroupInput { + s.MaxInstanceLifetime = &v + return s +} + // SetMaxSize sets the MaxSize field's value. func (s *UpdateAutoScalingGroupInput) SetMaxSize(v int64) *UpdateAutoScalingGroupInput { s.MaxSize = &v 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 index e1da9fd7546..644838dd337 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscaling/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "autoscaling" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Auto Scaling" // ServiceID is a unique identifer of a specific service. + ServiceID = "Auto Scaling" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the AutoScaling client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a AutoScaling client from just a session. // svc := autoscaling.New(mySession) // @@ -46,11 +48,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *AutoScaling { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *AutoScaling { svc := &AutoScaling{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2011-01-01", }, diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscalingplans/api.go b/vendor/github.com/aws/aws-sdk-go/service/autoscalingplans/api.go index 20a6adb1272..017b19196dd 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscalingplans/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscalingplans/api.go @@ -66,19 +66,19 @@ func (c *AutoScalingPlans) CreateScalingPlanRequest(input *CreateScalingPlanInpu // See the AWS API reference guide for AWS Auto Scaling Plans's // API operation CreateScalingPlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the parameters provided. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Your account exceeded a limit. This exception is thrown when a per-account // resource limit is exceeded. // -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" +// * ConcurrentUpdateException // Concurrent updates caused an exception, for example, if you request an update // to a scaling plan that already has a pending update. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/CreateScalingPlan @@ -163,18 +163,18 @@ func (c *AutoScalingPlans) DeleteScalingPlanRequest(input *DeleteScalingPlanInpu // See the AWS API reference guide for AWS Auto Scaling Plans's // API operation DeleteScalingPlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the parameters provided. // -// * ErrCodeObjectNotFoundException "ObjectNotFoundException" +// * ObjectNotFoundException // The specified object could not be found. // -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" +// * ConcurrentUpdateException // Concurrent updates caused an exception, for example, if you request an update // to a scaling plan that already has a pending update. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DeleteScalingPlan @@ -252,18 +252,18 @@ func (c *AutoScalingPlans) DescribeScalingPlanResourcesRequest(input *DescribeSc // See the AWS API reference guide for AWS Auto Scaling Plans's // API operation DescribeScalingPlanResources for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the parameters provided. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The token provided is not valid. // -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" +// * ConcurrentUpdateException // Concurrent updates caused an exception, for example, if you request an update // to a scaling plan that already has a pending update. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlanResources @@ -341,18 +341,18 @@ func (c *AutoScalingPlans) DescribeScalingPlansRequest(input *DescribeScalingPla // See the AWS API reference guide for AWS Auto Scaling Plans's // API operation DescribeScalingPlans for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the parameters provided. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The token provided is not valid. // -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" +// * ConcurrentUpdateException // Concurrent updates caused an exception, for example, if you request an update // to a scaling plan that already has a pending update. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/DescribeScalingPlans @@ -434,11 +434,11 @@ func (c *AutoScalingPlans) GetScalingPlanResourceForecastDataRequest(input *GetS // See the AWS API reference guide for AWS Auto Scaling Plans's // API operation GetScalingPlanResourceForecastData for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the parameters provided. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/GetScalingPlanResourceForecastData @@ -520,18 +520,18 @@ func (c *AutoScalingPlans) UpdateScalingPlanRequest(input *UpdateScalingPlanInpu // See the AWS API reference guide for AWS Auto Scaling Plans's // API operation UpdateScalingPlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // An exception was thrown for a validation issue. Review the parameters provided. // -// * ErrCodeConcurrentUpdateException "ConcurrentUpdateException" +// * ConcurrentUpdateException // Concurrent updates caused an exception, for example, if you request an update // to a scaling plan that already has a pending update. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an internal error. // -// * ErrCodeObjectNotFoundException "ObjectNotFoundException" +// * ObjectNotFoundException // The specified object could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/autoscaling-plans-2018-01-06/UpdateScalingPlan @@ -609,6 +609,63 @@ func (s *ApplicationSource) SetTagFilters(v []*TagFilter) *ApplicationSource { return s } +// Concurrent updates caused an exception, for example, if you request an update +// to a scaling plan that already has a pending update. +type ConcurrentUpdateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentUpdateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentUpdateException) GoString() string { + return s.String() +} + +func newErrorConcurrentUpdateException(v protocol.ResponseMetadata) error { + return &ConcurrentUpdateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentUpdateException) Code() string { + return "ConcurrentUpdateException" +} + +// Message returns the exception's message. +func (s ConcurrentUpdateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentUpdateException) OrigErr() error { + return nil +} + +func (s ConcurrentUpdateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentUpdateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentUpdateException) RequestID() string { + return s.respMetadata.RequestID +} + type CreateScalingPlanInput struct { _ struct{} `type:"structure"` @@ -1480,6 +1537,175 @@ func (s *GetScalingPlanResourceForecastDataOutput) SetDatapoints(v []*Datapoint) return s } +// The service encountered an internal error. +type InternalServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServiceException) GoString() string { + return s.String() +} + +func newErrorInternalServiceException(v protocol.ResponseMetadata) error { + return &InternalServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServiceException) Code() string { + return "InternalServiceException" +} + +// Message returns the exception's message. +func (s InternalServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServiceException) OrigErr() error { + return nil +} + +func (s InternalServiceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServiceException) RequestID() string { + return s.respMetadata.RequestID +} + +// The token provided is not valid. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNextTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// Your account exceeded a limit. This exception is thrown when a per-account +// resource limit is exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents a dimension for a customized metric. type MetricDimension struct { _ struct{} `type:"structure"` @@ -1533,6 +1759,62 @@ func (s *MetricDimension) SetValue(v string) *MetricDimension { return s } +// The specified object could not be found. +type ObjectNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ObjectNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ObjectNotFoundException) GoString() string { + return s.String() +} + +func newErrorObjectNotFoundException(v protocol.ResponseMetadata) error { + return &ObjectNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ObjectNotFoundException) Code() string { + return "ObjectNotFoundException" +} + +// Message returns the exception's message. +func (s ObjectNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ObjectNotFoundException) OrigErr() error { + return nil +} + +func (s ObjectNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ObjectNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ObjectNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents a predefined metric that can be used for predictive scaling. type PredefinedLoadMetricSpecification struct { _ struct{} `type:"structure"` @@ -2594,6 +2876,62 @@ func (s UpdateScalingPlanOutput) GoString() string { return s.String() } +// An exception was thrown for a validation issue. Review the parameters provided. +type ValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationException) GoString() string { + return s.String() +} + +func newErrorValidationException(v protocol.ResponseMetadata) error { + return &ValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ValidationException) Code() string { + return "ValidationException" +} + +// Message returns the exception's message. +func (s ValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ValidationException) OrigErr() error { + return nil +} + +func (s ValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ValidationException) RequestID() string { + return s.respMetadata.RequestID +} + const ( // ForecastDataTypeCapacityForecast is a ForecastDataType enum value ForecastDataTypeCapacityForecast = "CapacityForecast" diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscalingplans/errors.go b/vendor/github.com/aws/aws-sdk-go/service/autoscalingplans/errors.go index 8f954385969..20d629b8880 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscalingplans/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscalingplans/errors.go @@ -2,6 +2,10 @@ package autoscalingplans +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeConcurrentUpdateException for service response error code @@ -42,3 +46,12 @@ const ( // An exception was thrown for a validation issue. Review the parameters provided. ErrCodeValidationException = "ValidationException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ConcurrentUpdateException": newErrorConcurrentUpdateException, + "InternalServiceException": newErrorInternalServiceException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "LimitExceededException": newErrorLimitExceededException, + "ObjectNotFoundException": newErrorObjectNotFoundException, + "ValidationException": newErrorValidationException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/autoscalingplans/service.go b/vendor/github.com/aws/aws-sdk-go/service/autoscalingplans/service.go index dd6a1ece467..9f5c1db6b68 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/autoscalingplans/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/autoscalingplans/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -30,8 +31,8 @@ var initRequest func(*request.Request) // Service information constants const ( ServiceName = "autoscaling" // Name of service. - EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Auto Scaling Plans" // ServiceID is a unique identifer of a specific service. + EndpointsID = "autoscaling-plans" // ID to lookup a service endpoint with. + ServiceID = "Auto Scaling Plans" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the AutoScalingPlans client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a AutoScalingPlans client from just a session. // svc := autoscalingplans.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *AutoScalingPlans { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "autoscaling-plans" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *AutoScalingPlans { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *AutoScalingPlans { svc := &AutoScalingPlans{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-01-06", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/backup/api.go b/vendor/github.com/aws/aws-sdk-go/service/backup/api.go index 8dca70a5f04..827543e759e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/backup/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/backup/api.go @@ -60,8 +60,8 @@ func (c *Backup) CreateBackupPlanRequest(input *CreateBackupPlanInput) (req *req // Backup plans are documents that contain information that AWS Backup uses // to schedule tasks that create recovery points of resources. // -// If you call CreateBackupPlan with a plan that already exists, the existing -// backupPlanId is returned. +// If you call CreateBackupPlan with a plan that already exists, an AlreadyExistsException +// 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 @@ -70,22 +70,22 @@ func (c *Backup) CreateBackupPlanRequest(input *CreateBackupPlanInput) (req *req // See the AWS API reference guide for AWS Backup's // API operation CreateBackupPlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // A limit in the request has been exceeded; for example, a maximum number of // items allowed in a request. // -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// * AlreadyExistsException // The required resource already exists. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/CreateBackupPlan @@ -162,9 +162,9 @@ func (c *Backup) CreateBackupSelectionRequest(input *CreateBackupSelectionInput) // // * Resources: "arn:aws:ec2:region:account-id:volume/volume-id" // -// * ConditionKey:"department" ConditionValue:"finance" ConditionType:"StringEquals" +// * ConditionKey:"department" ConditionValue:"finance" ConditionType:"STRINGEQUALS" // -// * ConditionKey:"importance" ConditionValue:"critical" ConditionType:"StringEquals" +// * ConditionKey:"importance" ConditionValue:"critical" ConditionType:"STRINGEQUALS" // // Using these patterns would back up all Amazon Elastic Block Store (Amazon // EBS) volumes that are tagged as "department=finance", "importance=critical", @@ -183,22 +183,22 @@ func (c *Backup) CreateBackupSelectionRequest(input *CreateBackupSelectionInput) // See the AWS API reference guide for AWS Backup's // API operation CreateBackupSelection for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // A limit in the request has been exceeded; for example, a maximum number of // items allowed in a request. // -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// * AlreadyExistsException // The required resource already exists. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/CreateBackupSelection @@ -281,22 +281,22 @@ func (c *Backup) CreateBackupVaultRequest(input *CreateBackupVaultInput) (req *r // See the AWS API reference guide for AWS Backup's // API operation CreateBackupVault for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit in the request has been exceeded; for example, a maximum number of // items allowed in a request. // -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// * AlreadyExistsException // The required resource already exists. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/CreateBackupVault @@ -377,21 +377,21 @@ func (c *Backup) DeleteBackupPlanRequest(input *DeleteBackupPlanInput) (req *req // See the AWS API reference guide for AWS Backup's // API operation DeleteBackupPlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a parameter is of the wrong type. // @@ -472,18 +472,18 @@ func (c *Backup) DeleteBackupSelectionRequest(input *DeleteBackupSelectionInput) // See the AWS API reference guide for AWS Backup's // API operation DeleteBackupSelection for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DeleteBackupSelection @@ -563,21 +563,21 @@ func (c *Backup) DeleteBackupVaultRequest(input *DeleteBackupVaultInput) (req *r // See the AWS API reference guide for AWS Backup's // API operation DeleteBackupVault for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a parameter is of the wrong type. // @@ -657,18 +657,18 @@ func (c *Backup) DeleteBackupVaultAccessPolicyRequest(input *DeleteBackupVaultAc // See the AWS API reference guide for AWS Backup's // API operation DeleteBackupVaultAccessPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DeleteBackupVaultAccessPolicy @@ -747,18 +747,18 @@ func (c *Backup) DeleteBackupVaultNotificationsRequest(input *DeleteBackupVaultN // See the AWS API reference guide for AWS Backup's // API operation DeleteBackupVaultNotifications for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DeleteBackupVaultNotifications @@ -837,21 +837,21 @@ func (c *Backup) DeleteRecoveryPointRequest(input *DeleteRecoveryPointInput) (re // See the AWS API reference guide for AWS Backup's // API operation DeleteRecoveryPoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a parameter is of the wrong type. // @@ -930,21 +930,21 @@ func (c *Backup) DescribeBackupJobRequest(input *DescribeBackupJobInput) (req *r // See the AWS API reference guide for AWS Backup's // API operation DescribeBackupJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // -// * ErrCodeDependencyFailureException "DependencyFailureException" +// * DependencyFailureException // A dependent AWS service or resource returned an error to the AWS Backup service, // and the action cannot be completed. // @@ -1023,18 +1023,18 @@ func (c *Backup) DescribeBackupVaultRequest(input *DescribeBackupVaultInput) (re // See the AWS API reference guide for AWS Backup's // API operation DescribeBackupVault for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DescribeBackupVault @@ -1059,6 +1059,95 @@ func (c *Backup) DescribeBackupVaultWithContext(ctx aws.Context, input *Describe return out, req.Send() } +const opDescribeCopyJob = "DescribeCopyJob" + +// DescribeCopyJobRequest generates a "aws/request.Request" representing the +// client's request for the DescribeCopyJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeCopyJob for more information on using the DescribeCopyJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeCopyJobRequest method. +// req, resp := client.DescribeCopyJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DescribeCopyJob +func (c *Backup) DescribeCopyJobRequest(input *DescribeCopyJobInput) (req *request.Request, output *DescribeCopyJobOutput) { + op := &request.Operation{ + Name: opDescribeCopyJob, + HTTPMethod: "GET", + HTTPPath: "/copy-jobs/{copyJobId}", + } + + if input == nil { + input = &DescribeCopyJobInput{} + } + + output = &DescribeCopyJobOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeCopyJob API operation for AWS Backup. +// +// Returns metadata associated with creating a copy of 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 AWS Backup's +// API operation DescribeCopyJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// A resource that is required for the action doesn't exist. +// +// * InvalidParameterValueException +// Indicates that something is wrong with a parameter's value. For example, +// the value is out of range. +// +// * MissingParameterValueException +// Indicates that a required parameter is missing. +// +// * ServiceUnavailableException +// The request failed due to a temporary failure of the server. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DescribeCopyJob +func (c *Backup) DescribeCopyJob(input *DescribeCopyJobInput) (*DescribeCopyJobOutput, error) { + req, out := c.DescribeCopyJobRequest(input) + return out, req.Send() +} + +// DescribeCopyJobWithContext is the same as DescribeCopyJob with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCopyJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Backup) DescribeCopyJobWithContext(ctx aws.Context, input *DescribeCopyJobInput, opts ...request.Option) (*DescribeCopyJobOutput, error) { + req, out := c.DescribeCopyJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeProtectedResource = "DescribeProtectedResource" // DescribeProtectedResourceRequest generates a "aws/request.Request" representing the @@ -1114,18 +1203,18 @@ func (c *Backup) DescribeProtectedResourceRequest(input *DescribeProtectedResour // See the AWS API reference guide for AWS Backup's // API operation DescribeProtectedResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// Returned Error Types: +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DescribeProtectedResource @@ -1204,18 +1293,18 @@ func (c *Backup) DescribeRecoveryPointRequest(input *DescribeRecoveryPointInput) // See the AWS API reference guide for AWS Backup's // API operation DescribeRecoveryPoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/DescribeRecoveryPoint @@ -1294,21 +1383,21 @@ func (c *Backup) DescribeRestoreJobRequest(input *DescribeRestoreJobInput) (req // See the AWS API reference guide for AWS Backup's // API operation DescribeRestoreJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // -// * ErrCodeDependencyFailureException "DependencyFailureException" +// * DependencyFailureException // A dependent AWS service or resource returned an error to the AWS Backup service, // and the action cannot be completed. // @@ -1387,18 +1476,18 @@ func (c *Backup) ExportBackupPlanTemplateRequest(input *ExportBackupPlanTemplate // See the AWS API reference guide for AWS Backup's // API operation ExportBackupPlanTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ExportBackupPlanTemplate @@ -1476,18 +1565,18 @@ func (c *Backup) GetBackupPlanRequest(input *GetBackupPlanInput) (req *request.R // See the AWS API reference guide for AWS Backup's // API operation GetBackupPlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/GetBackupPlan @@ -1565,22 +1654,22 @@ func (c *Backup) GetBackupPlanFromJSONRequest(input *GetBackupPlanFromJSONInput) // See the AWS API reference guide for AWS Backup's // API operation GetBackupPlanFromJSON for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // A limit in the request has been exceeded; for example, a maximum number of // items allowed in a request. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a parameter is of the wrong type. // @@ -1659,18 +1748,18 @@ func (c *Backup) GetBackupPlanFromTemplateRequest(input *GetBackupPlanFromTempla // See the AWS API reference guide for AWS Backup's // API operation GetBackupPlanFromTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/GetBackupPlanFromTemplate @@ -1749,18 +1838,18 @@ func (c *Backup) GetBackupSelectionRequest(input *GetBackupSelectionInput) (req // See the AWS API reference guide for AWS Backup's // API operation GetBackupSelection for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/GetBackupSelection @@ -1839,18 +1928,18 @@ func (c *Backup) GetBackupVaultAccessPolicyRequest(input *GetBackupVaultAccessPo // See the AWS API reference guide for AWS Backup's // API operation GetBackupVaultAccessPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/GetBackupVaultAccessPolicy @@ -1928,18 +2017,18 @@ func (c *Backup) GetBackupVaultNotificationsRequest(input *GetBackupVaultNotific // See the AWS API reference guide for AWS Backup's // API operation GetBackupVaultNotifications for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/GetBackupVaultNotifications @@ -2008,14 +2097,7 @@ func (c *Backup) GetRecoveryPointRestoreMetadataRequest(input *GetRecoveryPointR // GetRecoveryPointRestoreMetadata API operation for AWS Backup. // -// Returns two sets of metadata key-value pairs. The first set lists the metadata -// that the recovery point was created with. The second set lists the metadata -// key-value pairs that are required to restore the recovery point. -// -// These sets can be the same, or the restore metadata set can contain different -// values if the target service to be restored has changed since the recovery -// point was created and now requires additional or different information in -// order to be restored. +// Returns a set of metadata key-value pairs that were used to create the backup. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2024,18 +2106,18 @@ func (c *Backup) GetRecoveryPointRestoreMetadataRequest(input *GetRecoveryPointR // See the AWS API reference guide for AWS Backup's // API operation GetRecoveryPointRestoreMetadata for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/GetRecoveryPointRestoreMetadata @@ -2113,8 +2195,8 @@ func (c *Backup) GetSupportedResourceTypesRequest(input *GetSupportedResourceTyp // See the AWS API reference guide for AWS Backup's // API operation GetSupportedResourceTypes for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/GetSupportedResourceTypes @@ -2198,12 +2280,16 @@ func (c *Backup) ListBackupJobsRequest(input *ListBackupJobsInput) (req *request // See the AWS API reference guide for AWS Backup's // API operation ListBackupJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * InvalidRequestException +// Indicates that something is wrong with the input to the request. For example, +// a parameter is of the wrong type. +// +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListBackupJobs @@ -2271,10 +2357,12 @@ func (c *Backup) ListBackupJobsPagesWithContext(ctx aws.Context, input *ListBack }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListBackupJobsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListBackupJobsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2338,18 +2426,18 @@ func (c *Backup) ListBackupPlanTemplatesRequest(input *ListBackupPlanTemplatesIn // See the AWS API reference guide for AWS Backup's // API operation ListBackupPlanTemplates for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListBackupPlanTemplates @@ -2417,10 +2505,12 @@ func (c *Backup) ListBackupPlanTemplatesPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListBackupPlanTemplatesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListBackupPlanTemplatesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2485,18 +2575,18 @@ func (c *Backup) ListBackupPlanVersionsRequest(input *ListBackupPlanVersionsInpu // See the AWS API reference guide for AWS Backup's // API operation ListBackupPlanVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListBackupPlanVersions @@ -2564,10 +2654,12 @@ func (c *Backup) ListBackupPlanVersionsPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListBackupPlanVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListBackupPlanVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2632,18 +2724,18 @@ func (c *Backup) ListBackupPlansRequest(input *ListBackupPlansInput) (req *reque // See the AWS API reference guide for AWS Backup's // API operation ListBackupPlans for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListBackupPlans @@ -2711,10 +2803,12 @@ func (c *Backup) ListBackupPlansPagesWithContext(ctx aws.Context, input *ListBac }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListBackupPlansOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListBackupPlansOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2778,18 +2872,18 @@ func (c *Backup) ListBackupSelectionsRequest(input *ListBackupSelectionsInput) ( // See the AWS API reference guide for AWS Backup's // API operation ListBackupSelections for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListBackupSelections @@ -2857,10 +2951,12 @@ func (c *Backup) ListBackupSelectionsPagesWithContext(ctx aws.Context, input *Li }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListBackupSelectionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListBackupSelectionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2924,18 +3020,18 @@ func (c *Backup) ListBackupVaultsRequest(input *ListBackupVaultsInput) (req *req // See the AWS API reference guide for AWS Backup's // API operation ListBackupVaults for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListBackupVaults @@ -3003,10 +3099,153 @@ func (c *Backup) ListBackupVaultsPagesWithContext(ctx aws.Context, input *ListBa }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListBackupVaultsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListBackupVaultsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListCopyJobs = "ListCopyJobs" + +// ListCopyJobsRequest generates a "aws/request.Request" representing the +// client's request for the ListCopyJobs operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListCopyJobs for more information on using the ListCopyJobs +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListCopyJobsRequest method. +// req, resp := client.ListCopyJobsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListCopyJobs +func (c *Backup) ListCopyJobsRequest(input *ListCopyJobsInput) (req *request.Request, output *ListCopyJobsOutput) { + op := &request.Operation{ + Name: opListCopyJobs, + HTTPMethod: "GET", + HTTPPath: "/copy-jobs/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListCopyJobsInput{} + } + + output = &ListCopyJobsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListCopyJobs API operation for AWS Backup. +// +// Returns metadata about your copy jobs. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Backup's +// API operation ListCopyJobs for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValueException +// Indicates that something is wrong with a parameter's value. For example, +// the value is out of range. +// +// * ServiceUnavailableException +// The request failed due to a temporary failure of the server. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListCopyJobs +func (c *Backup) ListCopyJobs(input *ListCopyJobsInput) (*ListCopyJobsOutput, error) { + req, out := c.ListCopyJobsRequest(input) + return out, req.Send() +} + +// ListCopyJobsWithContext is the same as ListCopyJobs with the addition of +// the ability to pass a context and additional request options. +// +// See ListCopyJobs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Backup) ListCopyJobsWithContext(ctx aws.Context, input *ListCopyJobsInput, opts ...request.Option) (*ListCopyJobsOutput, error) { + req, out := c.ListCopyJobsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListCopyJobsPages iterates over the pages of a ListCopyJobs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListCopyJobs 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 ListCopyJobs operation. +// pageNum := 0 +// err := client.ListCopyJobsPages(params, +// func(page *backup.ListCopyJobsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Backup) ListCopyJobsPages(input *ListCopyJobsInput, fn func(*ListCopyJobsOutput, bool) bool) error { + return c.ListCopyJobsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListCopyJobsPagesWithContext same as ListCopyJobsPages 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 *Backup) ListCopyJobsPagesWithContext(ctx aws.Context, input *ListCopyJobsInput, fn func(*ListCopyJobsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListCopyJobsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListCopyJobsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListCopyJobsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3071,12 +3310,12 @@ func (c *Backup) ListProtectedResourcesRequest(input *ListProtectedResourcesInpu // See the AWS API reference guide for AWS Backup's // API operation ListProtectedResources for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListProtectedResources @@ -3144,10 +3383,12 @@ func (c *Backup) ListProtectedResourcesPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListProtectedResourcesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListProtectedResourcesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3211,18 +3452,18 @@ func (c *Backup) ListRecoveryPointsByBackupVaultRequest(input *ListRecoveryPoint // See the AWS API reference guide for AWS Backup's // API operation ListRecoveryPointsByBackupVault for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListRecoveryPointsByBackupVault @@ -3290,10 +3531,12 @@ func (c *Backup) ListRecoveryPointsByBackupVaultPagesWithContext(ctx aws.Context }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRecoveryPointsByBackupVaultOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListRecoveryPointsByBackupVaultOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3357,18 +3600,18 @@ func (c *Backup) ListRecoveryPointsByResourceRequest(input *ListRecoveryPointsBy // See the AWS API reference guide for AWS Backup's // API operation ListRecoveryPointsByResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListRecoveryPointsByResource @@ -3436,10 +3679,12 @@ func (c *Backup) ListRecoveryPointsByResourcePagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRecoveryPointsByResourceOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListRecoveryPointsByResourceOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3503,18 +3748,18 @@ func (c *Backup) ListRestoreJobsRequest(input *ListRestoreJobsInput) (req *reque // See the AWS API reference guide for AWS Backup's // API operation ListRestoreJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListRestoreJobs @@ -3582,10 +3827,12 @@ func (c *Backup) ListRestoreJobsPagesWithContext(ctx aws.Context, input *ListRes }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRestoreJobsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListRestoreJobsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3649,18 +3896,18 @@ func (c *Backup) ListTagsRequest(input *ListTagsInput) (req *request.Request, ou // See the AWS API reference guide for AWS Backup's // API operation ListTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/ListTags @@ -3728,10 +3975,12 @@ func (c *Backup) ListTagsPagesWithContext(ctx aws.Context, input *ListTagsInput, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTagsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3791,18 +4040,18 @@ func (c *Backup) PutBackupVaultAccessPolicyRequest(input *PutBackupVaultAccessPo // See the AWS API reference guide for AWS Backup's // API operation PutBackupVaultAccessPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/PutBackupVaultAccessPolicy @@ -3881,18 +4130,18 @@ func (c *Backup) PutBackupVaultNotificationsRequest(input *PutBackupVaultNotific // See the AWS API reference guide for AWS Backup's // API operation PutBackupVaultNotifications for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/PutBackupVaultNotifications @@ -3970,21 +4219,21 @@ func (c *Backup) StartBackupJobRequest(input *StartBackupJobInput) (req *request // See the AWS API reference guide for AWS Backup's // API operation StartBackupJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit in the request has been exceeded; for example, a maximum number of // items allowed in a request. // @@ -4010,6 +4259,99 @@ func (c *Backup) StartBackupJobWithContext(ctx aws.Context, input *StartBackupJo return out, req.Send() } +const opStartCopyJob = "StartCopyJob" + +// StartCopyJobRequest generates a "aws/request.Request" representing the +// client's request for the StartCopyJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartCopyJob for more information on using the StartCopyJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartCopyJobRequest method. +// req, resp := client.StartCopyJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/StartCopyJob +func (c *Backup) StartCopyJobRequest(input *StartCopyJobInput) (req *request.Request, output *StartCopyJobOutput) { + op := &request.Operation{ + Name: opStartCopyJob, + HTTPMethod: "PUT", + HTTPPath: "/copy-jobs", + } + + if input == nil { + input = &StartCopyJobInput{} + } + + output = &StartCopyJobOutput{} + req = c.newRequest(op, input, output) + return +} + +// StartCopyJob API operation for AWS Backup. +// +// Starts a job to create a one-time copy of 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 AWS Backup's +// API operation StartCopyJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// A resource that is required for the action doesn't exist. +// +// * InvalidParameterValueException +// Indicates that something is wrong with a parameter's value. For example, +// the value is out of range. +// +// * MissingParameterValueException +// Indicates that a required parameter is missing. +// +// * ServiceUnavailableException +// The request failed due to a temporary failure of the server. +// +// * LimitExceededException +// A limit in the request has been exceeded; for example, a maximum number of +// items allowed in a request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/StartCopyJob +func (c *Backup) StartCopyJob(input *StartCopyJobInput) (*StartCopyJobOutput, error) { + req, out := c.StartCopyJobRequest(input) + return out, req.Send() +} + +// StartCopyJobWithContext is the same as StartCopyJob with the addition of +// the ability to pass a context and additional request options. +// +// See StartCopyJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Backup) StartCopyJobWithContext(ctx aws.Context, input *StartCopyJobInput, opts ...request.Option) (*StartCopyJobOutput, error) { + req, out := c.StartCopyJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opStartRestoreJob = "StartRestoreJob" // StartRestoreJobRequest generates a "aws/request.Request" representing the @@ -4067,18 +4409,18 @@ func (c *Backup) StartRestoreJobRequest(input *StartRestoreJobInput) (req *reque // See the AWS API reference guide for AWS Backup's // API operation StartRestoreJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/StartRestoreJob @@ -4157,22 +4499,22 @@ func (c *Backup) StopBackupJobRequest(input *StopBackupJobInput) (req *request.R // See the AWS API reference guide for AWS Backup's // API operation StopBackupJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// Returned Error Types: +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Indicates that something is wrong with the input to the request. For example, // a parameter is of the wrong type. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/StopBackupJob @@ -4252,21 +4594,21 @@ func (c *Backup) TagResourceRequest(input *TagResourceInput) (req *request.Reque // See the AWS API reference guide for AWS Backup's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit in the request has been exceeded; for example, a maximum number of // items allowed in a request. // @@ -4347,18 +4689,18 @@ func (c *Backup) UntagResourceRequest(input *UntagResourceInput) (req *request.R // See the AWS API reference guide for AWS Backup's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/UntagResource @@ -4438,18 +4780,18 @@ func (c *Backup) UpdateBackupPlanRequest(input *UpdateBackupPlanInput) (req *req // See the AWS API reference guide for AWS Backup's // API operation UpdateBackupPlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/UpdateBackupPlan @@ -4537,18 +4879,18 @@ func (c *Backup) UpdateRecoveryPointLifecycleRequest(input *UpdateRecoveryPointL // See the AWS API reference guide for AWS Backup's // API operation UpdateRecoveryPointLifecycle for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource that is required for the action doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Indicates that something is wrong with a parameter's value. For example, // the value is out of range. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Indicates that a required parameter is missing. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The request failed due to a temporary failure of the server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/backup-2018-11-15/UpdateRecoveryPointLifecycle @@ -4573,7 +4915,73 @@ func (c *Backup) UpdateRecoveryPointLifecycleWithContext(ctx aws.Context, input return out, req.Send() } -// Contains DeleteAt and MoveToColdStorageAt timestamps, which are used to specify +// The required resource already exists. +type AlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Arn *string `type:"string"` + + Code_ *string `locationName:"Code" type:"string"` + + Context *string `type:"string"` + + CreatorRequestId *string `type:"string"` + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s AlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorAlreadyExistsException(v protocol.ResponseMetadata) error { + return &AlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AlreadyExistsException) Code() string { + return "AlreadyExistsException" +} + +// Message returns the exception's message. +func (s AlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AlreadyExistsException) OrigErr() error { + return nil +} + +func (s AlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// Contains DeleteAt and MoveToColdStorageAt timestamps, which are used to specify // a lifecycle for a recovery point. // // The lifecycle defines when a protected resource is transitioned to cold storage @@ -4617,7 +5025,7 @@ func (s *CalculatedLifecycle) SetMoveToColdStorageAt(v time.Time) *CalculatedLif return s } -// Contains an array of triplets made up of a condition type (such as StringEquals), +// Contains an array of triplets made up of a condition type (such as STRINGEQUALS), // a key, and a value. Conditions are used to filter resources in a selection // that is assigned to a backup plan. type Condition struct { @@ -4629,7 +5037,7 @@ type Condition struct { // ConditionKey is a required field ConditionKey *string `type:"string" required:"true"` - // An operation, such as StringEquals, that is applied to a key-value pair used + // An operation, such as STRINGEQUALS, that is applied to a key-value pair used // to filter resources in a selection. // // ConditionType is a required field @@ -4689,6 +5097,218 @@ func (s *Condition) SetConditionValue(v string) *Condition { return s } +// The details of the copy operation. +type CopyAction struct { + _ struct{} `type:"structure"` + + // An Amazon Resource Name (ARN) that uniquely identifies the destination backup + // vault for the copied backup. For example, arn:aws:backup:us-east-1:123456789012:vault:aBackupVault. + // + // DestinationBackupVaultArn is a required field + DestinationBackupVaultArn *string `type:"string" required:"true"` + + // Contains an array of Transition objects specifying how long in days before + // a recovery point transitions to cold storage or is deleted. + // + // Backups transitioned to cold storage must be stored in cold storage for a + // minimum of 90 days. Therefore, on the console, the “expire after days” + // setting must be 90 days greater than the “transition to cold after days” + // setting. The “transition to cold after days” setting cannot be changed + // after a backup has been transitioned to cold. + Lifecycle *Lifecycle `type:"structure"` +} + +// String returns the string representation +func (s CopyAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CopyAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CopyAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CopyAction"} + if s.DestinationBackupVaultArn == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationBackupVaultArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDestinationBackupVaultArn sets the DestinationBackupVaultArn field's value. +func (s *CopyAction) SetDestinationBackupVaultArn(v string) *CopyAction { + s.DestinationBackupVaultArn = &v + return s +} + +// SetLifecycle sets the Lifecycle field's value. +func (s *CopyAction) SetLifecycle(v *Lifecycle) *CopyAction { + s.Lifecycle = v + return s +} + +// Contains detailed information about a copy job. +type CopyJob struct { + _ struct{} `type:"structure"` + + // The size, in bytes, of a copy job. + BackupSizeInBytes *int64 `type:"long"` + + // The date and time a job to create a copy job is completed, in Unix format + // and Coordinated Universal Time (UTC). The value of CompletionDate is accurate + // to milliseconds. For example, the value 1516925490.087 represents Friday, + // January 26, 2018 12:11:30.087 AM. + CompletionDate *time.Time `type:"timestamp"` + + // Uniquely identifies a request to AWS Backup to copy a resource. + CopyJobId *string `type:"string"` + + // Contains information about the backup plan and rule that AWS Backup used + // to initiate the recovery point backup. + CreatedBy *RecoveryPointCreator `type:"structure"` + + // The date and time a copy job is created, in Unix format and Coordinated Universal + // Time (UTC). The value of CreationDate is accurate to milliseconds. For example, + // the value 1516925490.087 represents Friday, January 26, 2018 12:11:30.087 + // AM. + CreationDate *time.Time `type:"timestamp"` + + // An Amazon Resource Name (ARN) that uniquely identifies a destination copy + // vault; for example, arn:aws:backup:us-east-1:123456789012:vault:aBackupVault. + DestinationBackupVaultArn *string `type:"string"` + + // An ARN that uniquely identifies a destination recovery point; for example, + // arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45. + DestinationRecoveryPointArn *string `type:"string"` + + // Specifies the IAM role ARN used to copy the target recovery point; for example, + // arn:aws:iam::123456789012:role/S3Access. + IamRoleArn *string `type:"string"` + + // The type of AWS resource to be copied; for example, an Amazon Elastic Block + // Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon + // RDS) database. + ResourceArn *string `type:"string"` + + // The type of AWS resource to be copied; for example, an Amazon Elastic Block + // Store (Amazon EBS) volume or an Amazon Relational Database Service (Amazon + // RDS) database. + ResourceType *string `type:"string"` + + // An Amazon Resource Name (ARN) that uniquely identifies a source copy vault; + // for example, arn:aws:backup:us-east-1:123456789012:vault:aBackupVault. + SourceBackupVaultArn *string `type:"string"` + + // An ARN that uniquely identifies a source recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45. + SourceRecoveryPointArn *string `type:"string"` + + // The current state of a resource recovery point. + State *string `type:"string" enum:"CopyJobState"` + + // A detailed message explaining the status of the job that to copy a resource. + StatusMessage *string `type:"string"` +} + +// String returns the string representation +func (s CopyJob) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CopyJob) GoString() string { + return s.String() +} + +// SetBackupSizeInBytes sets the BackupSizeInBytes field's value. +func (s *CopyJob) SetBackupSizeInBytes(v int64) *CopyJob { + s.BackupSizeInBytes = &v + return s +} + +// SetCompletionDate sets the CompletionDate field's value. +func (s *CopyJob) SetCompletionDate(v time.Time) *CopyJob { + s.CompletionDate = &v + return s +} + +// SetCopyJobId sets the CopyJobId field's value. +func (s *CopyJob) SetCopyJobId(v string) *CopyJob { + s.CopyJobId = &v + return s +} + +// SetCreatedBy sets the CreatedBy field's value. +func (s *CopyJob) SetCreatedBy(v *RecoveryPointCreator) *CopyJob { + s.CreatedBy = v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *CopyJob) SetCreationDate(v time.Time) *CopyJob { + s.CreationDate = &v + return s +} + +// SetDestinationBackupVaultArn sets the DestinationBackupVaultArn field's value. +func (s *CopyJob) SetDestinationBackupVaultArn(v string) *CopyJob { + s.DestinationBackupVaultArn = &v + return s +} + +// SetDestinationRecoveryPointArn sets the DestinationRecoveryPointArn field's value. +func (s *CopyJob) SetDestinationRecoveryPointArn(v string) *CopyJob { + s.DestinationRecoveryPointArn = &v + return s +} + +// SetIamRoleArn sets the IamRoleArn field's value. +func (s *CopyJob) SetIamRoleArn(v string) *CopyJob { + s.IamRoleArn = &v + return s +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *CopyJob) SetResourceArn(v string) *CopyJob { + s.ResourceArn = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *CopyJob) SetResourceType(v string) *CopyJob { + s.ResourceType = &v + return s +} + +// SetSourceBackupVaultArn sets the SourceBackupVaultArn field's value. +func (s *CopyJob) SetSourceBackupVaultArn(v string) *CopyJob { + s.SourceBackupVaultArn = &v + return s +} + +// SetSourceRecoveryPointArn sets the SourceRecoveryPointArn field's value. +func (s *CopyJob) SetSourceRecoveryPointArn(v string) *CopyJob { + s.SourceRecoveryPointArn = &v + return s +} + +// SetState sets the State field's value. +func (s *CopyJob) SetState(v string) *CopyJob { + s.State = &v + return s +} + +// SetStatusMessage sets the StatusMessage field's value. +func (s *CopyJob) SetStatusMessage(v string) *CopyJob { + s.StatusMessage = &v + return s +} + type CreateBackupPlanInput struct { _ struct{} `type:"structure"` @@ -4823,10 +5443,6 @@ type CreateBackupSelectionInput struct { // Specifies the body of a request to assign a set of resources to a backup // plan. // - // It includes an array of resources, an optional array of patterns to exclude - // resources, an optional role to provide access to the AWS service the resource - // belongs to, and an optional array of tags used to identify a set of resources. - // // BackupSelection is a required field BackupSelection *Selection `type:"structure" required:"true"` @@ -5473,6 +6089,69 @@ func (s DeleteRecoveryPointOutput) GoString() string { return s.String() } +// A dependent AWS service or resource returned an error to the AWS Backup service, +// and the action cannot be completed. +type DependencyFailureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Context *string `type:"string"` + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s DependencyFailureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DependencyFailureException) GoString() string { + return s.String() +} + +func newErrorDependencyFailureException(v protocol.ResponseMetadata) error { + return &DependencyFailureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DependencyFailureException) Code() string { + return "DependencyFailureException" +} + +// Message returns the exception's message. +func (s DependencyFailureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DependencyFailureException) OrigErr() error { + return nil +} + +func (s DependencyFailureException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DependencyFailureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DependencyFailureException) RequestID() string { + return s.respMetadata.RequestID +} + type DescribeBackupJobInput struct { _ struct{} `type:"structure"` @@ -5829,6 +6508,70 @@ func (s *DescribeBackupVaultOutput) SetNumberOfRecoveryPoints(v int64) *Describe return s } +type DescribeCopyJobInput struct { + _ struct{} `type:"structure"` + + // Uniquely identifies a request to AWS Backup to copy a resource. + // + // CopyJobId is a required field + CopyJobId *string `location:"uri" locationName:"copyJobId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeCopyJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCopyJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeCopyJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeCopyJobInput"} + if s.CopyJobId == nil { + invalidParams.Add(request.NewErrParamRequired("CopyJobId")) + } + if s.CopyJobId != nil && len(*s.CopyJobId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CopyJobId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCopyJobId sets the CopyJobId field's value. +func (s *DescribeCopyJobInput) SetCopyJobId(v string) *DescribeCopyJobInput { + s.CopyJobId = &v + return s +} + +type DescribeCopyJobOutput struct { + _ struct{} `type:"structure"` + + // Contains detailed information about a copy job. + CopyJob *CopyJob `type:"structure"` +} + +// String returns the string representation +func (s DescribeCopyJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCopyJobOutput) GoString() string { + return s.String() +} + +// SetCopyJob sets the CopyJob field's value. +func (s *DescribeCopyJobOutput) SetCopyJob(v *CopyJob) *DescribeCopyJobOutput { + s.CopyJob = v + return s +} + type DescribeProtectedResourceInput struct { _ struct{} `type:"structure"` @@ -6756,11 +7499,6 @@ type GetBackupSelectionOutput struct { // Specifies the body of a request to assign a set of resources to a backup // plan. - // - // It includes an array of resources, an optional array of patterns to exclude - // resources, an optional role to provide access to the AWS service that the - // resource belongs to, and an optional array of tags used to identify a set - // of resources. BackupSelection *Selection `type:"structure"` // The date and time a backup selection is created, in Unix format and Coordinated @@ -7078,9 +7816,10 @@ type GetRecoveryPointRestoreMetadataOutput struct { // An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45. RecoveryPointArn *string `type:"string"` - // A set of metadata key-value pairs that lists the metadata key-value pairs - // that are required to restore the recovery point. - RestoreMetadata map[string]*string `type:"map"` + // The set of metadata key-value pairs that describes the original configuration + // of the backed-up resource. These values vary depending on the service that + // is being restored. + RestoreMetadata map[string]*string `type:"map" sensitive:"true"` } // String returns the string representation @@ -7132,7 +7871,7 @@ type GetSupportedResourceTypesOutput struct { // // * EBS for Amazon Elastic Block Store // - // * SGW for AWS Storage Gateway + // * Storage Gateway for AWS Storage Gateway // // * RDS for Amazon Relational Database Service // @@ -7158,6 +7897,132 @@ func (s *GetSupportedResourceTypesOutput) SetResourceTypes(v []*string) *GetSupp return s } +// Indicates that something is wrong with a parameter's value. For example, +// the value is out of range. +type InvalidParameterValueException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Context *string `type:"string"` + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s InvalidParameterValueException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterValueException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterValueException(v protocol.ResponseMetadata) error { + return &InvalidParameterValueException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterValueException) Code() string { + return "InvalidParameterValueException" +} + +// Message returns the exception's message. +func (s InvalidParameterValueException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterValueException) OrigErr() error { + return nil +} + +func (s InvalidParameterValueException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterValueException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterValueException) RequestID() string { + return s.respMetadata.RequestID +} + +// Indicates that something is wrong with the input to the request. For example, +// a parameter is of the wrong type. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Context *string `type:"string"` + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains detailed information about a backup job. type Job struct { _ struct{} `type:"structure"` @@ -7355,11 +8220,17 @@ func (s *Job) SetStatusMessage(v string) *Job { // Contains an array of Transition objects specifying how long in days before // a recovery point transitions to cold storage or is deleted. +// +// Backups transitioned to cold storage must be stored in cold storage for a +// minimum of 90 days. Therefore, on the console, the “expire after days” +// setting must be 90 days greater than the “transition to cold after days” +// setting. The “transition to cold after days” setting cannot be changed +// after a backup has been transitioned to cold. type Lifecycle struct { _ struct{} `type:"structure"` // Specifies the number of days after creation that a recovery point is deleted. - // Must be greater than MoveToColdStorageAfterDays. + // Must be greater than 90 days plus MoveToColdStorageAfterDays. DeleteAfterDays *int64 `type:"long"` // Specifies the number of days after creation that a recovery point is moved @@ -7389,6 +8260,69 @@ func (s *Lifecycle) SetMoveToColdStorageAfterDays(v int64) *Lifecycle { return s } +// A limit in the request has been exceeded; for example, a maximum number of +// items allowed in a request. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Context *string `type:"string"` + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListBackupJobsInput struct { _ struct{} `type:"structure"` @@ -7410,15 +8344,15 @@ type ListBackupJobsInput struct { // Returns only backup jobs for the specified resources: // + // * DynamoDB for Amazon DynamoDB + // // * EBS for Amazon Elastic Block Store // - // * SGW for AWS Storage Gateway + // * EFS for Amazon Elastic File System // // * RDS for Amazon Relational Database Service // - // * DDB for Amazon DynamoDB - // - // * EFS for Amazon Elastic File System + // * Storage Gateway for AWS Storage Gateway ByResourceType *string `location:"querystring" locationName:"resourceType" type:"string"` // Returns only backup jobs that are in the specified state. @@ -7949,32 +8883,182 @@ func (s *ListBackupVaultsInput) Validate() error { invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } - if invalidParams.Len() > 0 { - return invalidParams - } - return nil + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListBackupVaultsInput) SetMaxResults(v int64) *ListBackupVaultsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListBackupVaultsInput) SetNextToken(v string) *ListBackupVaultsInput { + s.NextToken = &v + return s +} + +type ListBackupVaultsOutput struct { + _ struct{} `type:"structure"` + + // An array of backup vault list members containing vault metadata, including + // Amazon Resource Name (ARN), display name, creation date, number of saved + // recovery points, and encryption information if the resources saved in the + // backup vault are encrypted. + BackupVaultList []*VaultListMember `type:"list"` + + // The next item following a partial list of returned items. For example, if + // a request is made to return maxResults number of items, NextToken allows + // you to return more items in your list starting at the location pointed to + // by the next token. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListBackupVaultsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListBackupVaultsOutput) GoString() string { + return s.String() +} + +// SetBackupVaultList sets the BackupVaultList field's value. +func (s *ListBackupVaultsOutput) SetBackupVaultList(v []*VaultListMember) *ListBackupVaultsOutput { + s.BackupVaultList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListBackupVaultsOutput) SetNextToken(v string) *ListBackupVaultsOutput { + s.NextToken = &v + return s +} + +type ListCopyJobsInput struct { + _ struct{} `type:"structure"` + + // Returns only copy jobs that were created after the specified date. + ByCreatedAfter *time.Time `location:"querystring" locationName:"createdAfter" type:"timestamp"` + + // Returns only copy jobs that were created before the specified date. + ByCreatedBefore *time.Time `location:"querystring" locationName:"createdBefore" type:"timestamp"` + + // An Amazon Resource Name (ARN) that uniquely identifies a source backup vault + // to copy from; for example, arn:aws:backup:us-east-1:123456789012:vault:aBackupVault. + ByDestinationVaultArn *string `location:"querystring" locationName:"destinationVaultArn" type:"string"` + + // Returns only copy jobs that match the specified resource Amazon Resource + // Name (ARN). + ByResourceArn *string `location:"querystring" locationName:"resourceArn" type:"string"` + + // Returns only backup jobs for the specified resources: + // + // * DynamoDB for Amazon DynamoDB + // + // * EBS for Amazon Elastic Block Store + // + // * EFS for Amazon Elastic File System + // + // * RDS for Amazon Relational Database Service + // + // * Storage Gateway for AWS Storage Gateway + ByResourceType *string `location:"querystring" locationName:"resourceType" type:"string"` + + // Returns only copy jobs that are in the specified state. + ByState *string `location:"querystring" locationName:"state" type:"string" enum:"CopyJobState"` + + // The maximum number of items to be returned. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // The next item following a partial list of returned items. For example, if + // a request is made to return maxResults number of items, NextToken allows + // you to return more items in your list starting at the location pointed to + // by the next token. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListCopyJobsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListCopyJobsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListCopyJobsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListCopyJobsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetByCreatedAfter sets the ByCreatedAfter field's value. +func (s *ListCopyJobsInput) SetByCreatedAfter(v time.Time) *ListCopyJobsInput { + s.ByCreatedAfter = &v + return s +} + +// SetByCreatedBefore sets the ByCreatedBefore field's value. +func (s *ListCopyJobsInput) SetByCreatedBefore(v time.Time) *ListCopyJobsInput { + s.ByCreatedBefore = &v + return s +} + +// SetByDestinationVaultArn sets the ByDestinationVaultArn field's value. +func (s *ListCopyJobsInput) SetByDestinationVaultArn(v string) *ListCopyJobsInput { + s.ByDestinationVaultArn = &v + return s +} + +// SetByResourceArn sets the ByResourceArn field's value. +func (s *ListCopyJobsInput) SetByResourceArn(v string) *ListCopyJobsInput { + s.ByResourceArn = &v + return s +} + +// SetByResourceType sets the ByResourceType field's value. +func (s *ListCopyJobsInput) SetByResourceType(v string) *ListCopyJobsInput { + s.ByResourceType = &v + return s +} + +// SetByState sets the ByState field's value. +func (s *ListCopyJobsInput) SetByState(v string) *ListCopyJobsInput { + s.ByState = &v + return s } // SetMaxResults sets the MaxResults field's value. -func (s *ListBackupVaultsInput) SetMaxResults(v int64) *ListBackupVaultsInput { +func (s *ListCopyJobsInput) SetMaxResults(v int64) *ListCopyJobsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListBackupVaultsInput) SetNextToken(v string) *ListBackupVaultsInput { +func (s *ListCopyJobsInput) SetNextToken(v string) *ListCopyJobsInput { s.NextToken = &v return s } -type ListBackupVaultsOutput struct { +type ListCopyJobsOutput struct { _ struct{} `type:"structure"` - // An array of backup vault list members containing vault metadata, including - // Amazon Resource Name (ARN), display name, creation date, number of saved - // recovery points, and encryption information if the resources saved in the - // backup vault are encrypted. - BackupVaultList []*VaultListMember `type:"list"` + // An array of structures containing metadata about your copy jobs returned + // in JSON format. + CopyJobs []*CopyJob `type:"list"` // The next item following a partial list of returned items. For example, if // a request is made to return maxResults number of items, NextToken allows @@ -7984,23 +9068,23 @@ type ListBackupVaultsOutput struct { } // String returns the string representation -func (s ListBackupVaultsOutput) String() string { +func (s ListCopyJobsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListBackupVaultsOutput) GoString() string { +func (s ListCopyJobsOutput) GoString() string { return s.String() } -// SetBackupVaultList sets the BackupVaultList field's value. -func (s *ListBackupVaultsOutput) SetBackupVaultList(v []*VaultListMember) *ListBackupVaultsOutput { - s.BackupVaultList = v +// SetCopyJobs sets the CopyJobs field's value. +func (s *ListCopyJobsOutput) SetCopyJobs(v []*CopyJob) *ListCopyJobsOutput { + s.CopyJobs = v return s } // SetNextToken sets the NextToken field's value. -func (s *ListBackupVaultsOutput) SetNextToken(v string) *ListBackupVaultsOutput { +func (s *ListCopyJobsOutput) SetNextToken(v string) *ListCopyJobsOutput { s.NextToken = &v return s } @@ -8529,6 +9613,68 @@ func (s *ListTagsOutput) SetTags(v map[string]*string) *ListTagsOutput { return s } +// Indicates that a required parameter is missing. +type MissingParameterValueException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Context *string `type:"string"` + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s MissingParameterValueException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MissingParameterValueException) GoString() string { + return s.String() +} + +func newErrorMissingParameterValueException(v protocol.ResponseMetadata) error { + return &MissingParameterValueException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MissingParameterValueException) Code() string { + return "MissingParameterValueException" +} + +// Message returns the exception's message. +func (s MissingParameterValueException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MissingParameterValueException) OrigErr() error { + return nil +} + +func (s MissingParameterValueException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MissingParameterValueException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MissingParameterValueException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains an optional backup plan display name and an array of BackupRule // objects, each of which specifies a backup rule. Each rule in a backup plan // is a separate scheduled task and can back up a different selection of AWS @@ -9293,6 +10439,68 @@ func (s *RecoveryPointCreator) SetBackupRuleId(v string) *RecoveryPointCreator { return s } +// A resource that is required for the action doesn't exist. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Context *string `type:"string"` + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains metadata about a restore job. type RestoreJobsListMember struct { _ struct{} `type:"structure"` @@ -9427,6 +10635,9 @@ type Rule struct { // be completed or it is canceled by AWS Backup. This value is optional. CompletionWindowMinutes *int64 `type:"long"` + // An array of CopyAction objects, which contains the details of the copy operation. + CopyActions []*CopyAction `type:"list"` + // The lifecycle defines when a protected resource is transitioned to cold storage // and when it expires. AWS Backup transitions and expires backups automatically // according to the lifecycle that you define. @@ -9483,6 +10694,12 @@ func (s *Rule) SetCompletionWindowMinutes(v int64) *Rule { return s } +// SetCopyActions sets the CopyActions field's value. +func (s *Rule) SetCopyActions(v []*CopyAction) *Rule { + s.CopyActions = v + return s +} + // SetLifecycle sets the Lifecycle field's value. func (s *Rule) SetLifecycle(v *Lifecycle) *Rule { s.Lifecycle = v @@ -9533,6 +10750,9 @@ type RuleInput struct { // and returning an error. CompletionWindowMinutes *int64 `type:"long"` + // An array of CopyAction objects, which contains the details of the copy operation. + CopyActions []*CopyAction `type:"list"` + // The lifecycle defines when a protected resource is transitioned to cold storage // and when it expires. AWS Backup will transition and expire backups automatically // according to the lifecycle that you define. @@ -9587,6 +10807,16 @@ func (s *RuleInput) Validate() error { if s.TargetBackupVaultName == nil { invalidParams.Add(request.NewErrParamRequired("TargetBackupVaultName")) } + if s.CopyActions != nil { + for i, v := range s.CopyActions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CopyActions", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -9600,6 +10830,12 @@ func (s *RuleInput) SetCompletionWindowMinutes(v int64) *RuleInput { return s } +// SetCopyActions sets the CopyActions field's value. +func (s *RuleInput) SetCopyActions(v []*CopyAction) *RuleInput { + s.CopyActions = v + return s +} + // SetLifecycle sets the Lifecycle field's value. func (s *RuleInput) SetLifecycle(v *Lifecycle) *RuleInput { s.Lifecycle = v @@ -9647,12 +10883,11 @@ type Selection struct { IamRoleArn *string `type:"string" required:"true"` // An array of conditions used to specify a set of resources to assign to a - // backup plan; for example, "StringEquals": {"ec2:ResourceTag/Department": + // backup plan; for example, "STRINGEQUALS": {"ec2:ResourceTag/Department": // "accounting". ListOfTags []*Condition `type:"list"` - // An array of strings that either contain Amazon Resource Names (ARNs) or match - // patterns such as "arn:aws:ec2:us-east-1:123456789012:volume/*" of resources + // An array of strings that contain Amazon Resource Names (ARNs) of resources // to assign to a backup plan. Resources []*string `type:"list"` @@ -9796,6 +11031,68 @@ func (s *SelectionsListMember) SetSelectionName(v string) *SelectionsListMember return s } +// The request failed due to a temporary failure of the server. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Context *string `type:"string"` + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + type StartBackupJobInput struct { _ struct{} `type:"structure"` @@ -9818,11 +11115,7 @@ type StartBackupJobInput struct { IamRoleArn *string `type:"string" required:"true"` // A customer chosen string that can be used to distinguish between calls to - // StartBackupJob. Idempotency tokens time out after one hour. Therefore, if - // you call StartBackupJob multiple times with the same idempotency token within - // one hour, AWS Backup recognizes that you are requesting only one backup job - // and initiates only one. If you change the idempotency token for each call, - // AWS Backup recognizes that you are requesting to start multiple backups. + // StartBackupJob. IdempotencyToken *string `type:"string"` // The lifecycle defines when a protected resource is transitioned to cold storage @@ -9971,6 +11264,153 @@ func (s *StartBackupJobOutput) SetRecoveryPointArn(v string) *StartBackupJobOutp return s } +type StartCopyJobInput struct { + _ struct{} `type:"structure"` + + // An Amazon Resource Name (ARN) that uniquely identifies a destination backup + // vault to copy to; for example, arn:aws:backup:us-east-1:123456789012:vault:aBackupVault. + // + // DestinationBackupVaultArn is a required field + DestinationBackupVaultArn *string `type:"string" required:"true"` + + // Specifies the IAM role ARN used to copy the target recovery point; for example, + // arn:aws:iam::123456789012:role/S3Access. + // + // IamRoleArn is a required field + IamRoleArn *string `type:"string" required:"true"` + + // A customer chosen string that can be used to distinguish between calls to + // StartCopyJob. + IdempotencyToken *string `type:"string"` + + // Contains an array of Transition objects specifying how long in days before + // a recovery point transitions to cold storage or is deleted. + // + // Backups transitioned to cold storage must be stored in cold storage for a + // minimum of 90 days. Therefore, on the console, the “expire after days” + // setting must be 90 days greater than the “transition to cold after days” + // setting. The “transition to cold after days” setting cannot be changed + // after a backup has been transitioned to cold. + Lifecycle *Lifecycle `type:"structure"` + + // An ARN that uniquely identifies a recovery point to use for the copy job; + // for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45. + // + // RecoveryPointArn is a required field + RecoveryPointArn *string `type:"string" required:"true"` + + // The name of a logical source container where backups are stored. Backup vaults + // are identified by names that are unique to the account used to create them + // and the AWS Region where they are created. They consist of lowercase letters, + // numbers, and hyphens. > + // + // SourceBackupVaultName is a required field + SourceBackupVaultName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s StartCopyJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartCopyJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartCopyJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartCopyJobInput"} + if s.DestinationBackupVaultArn == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationBackupVaultArn")) + } + if s.IamRoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("IamRoleArn")) + } + if s.RecoveryPointArn == nil { + invalidParams.Add(request.NewErrParamRequired("RecoveryPointArn")) + } + if s.SourceBackupVaultName == nil { + invalidParams.Add(request.NewErrParamRequired("SourceBackupVaultName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDestinationBackupVaultArn sets the DestinationBackupVaultArn field's value. +func (s *StartCopyJobInput) SetDestinationBackupVaultArn(v string) *StartCopyJobInput { + s.DestinationBackupVaultArn = &v + return s +} + +// SetIamRoleArn sets the IamRoleArn field's value. +func (s *StartCopyJobInput) SetIamRoleArn(v string) *StartCopyJobInput { + s.IamRoleArn = &v + return s +} + +// SetIdempotencyToken sets the IdempotencyToken field's value. +func (s *StartCopyJobInput) SetIdempotencyToken(v string) *StartCopyJobInput { + s.IdempotencyToken = &v + return s +} + +// SetLifecycle sets the Lifecycle field's value. +func (s *StartCopyJobInput) SetLifecycle(v *Lifecycle) *StartCopyJobInput { + s.Lifecycle = v + return s +} + +// SetRecoveryPointArn sets the RecoveryPointArn field's value. +func (s *StartCopyJobInput) SetRecoveryPointArn(v string) *StartCopyJobInput { + s.RecoveryPointArn = &v + return s +} + +// SetSourceBackupVaultName sets the SourceBackupVaultName field's value. +func (s *StartCopyJobInput) SetSourceBackupVaultName(v string) *StartCopyJobInput { + s.SourceBackupVaultName = &v + return s +} + +type StartCopyJobOutput struct { + _ struct{} `type:"structure"` + + // Uniquely identifies a request to AWS Backup to copy a resource. + CopyJobId *string `type:"string"` + + // The date and time that a backup job is started, in Unix format and Coordinated + // Universal Time (UTC). The value of CreationDate is accurate to milliseconds. + // For example, the value 1516925490.087 represents Friday, January 26, 2018 + // 12:11:30.087 AM. > + CreationDate *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s StartCopyJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartCopyJobOutput) GoString() string { + return s.String() +} + +// SetCopyJobId sets the CopyJobId field's value. +func (s *StartCopyJobOutput) SetCopyJobId(v string) *StartCopyJobOutput { + s.CopyJobId = &v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *StartCopyJobOutput) SetCreationDate(v time.Time) *StartCopyJobOutput { + s.CreationDate = &v + return s +} + type StartRestoreJobInput struct { _ struct{} `type:"structure"` @@ -9981,18 +11421,40 @@ type StartRestoreJobInput struct { IamRoleArn *string `type:"string" required:"true"` // A customer chosen string that can be used to distinguish between calls to - // StartRestoreJob. Idempotency tokens time out after one hour. Therefore, if - // you call StartRestoreJob multiple times with the same idempotency token within - // one hour, AWS Backup recognizes that you are requesting only one restore - // job and initiates only one. If you change the idempotency token for each - // call, AWS Backup recognizes that you are requesting to start multiple restores. + // StartRestoreJob. IdempotencyToken *string `type:"string"` - // A set of metadata key-value pairs. Lists the metadata that the recovery point - // was created with. + // A set of metadata key-value pairs. Contains information, such as a resource + // name, required to restore a recovery point. + // + // You can get configuration metadata about a resource at the time it was backed-up + // by calling GetRecoveryPointRestoreMetadata. However, values in addition to + // those provided by GetRecoveryPointRestoreMetadata might be required to restore + // a resource. For example, you might need to provide a new resource name if + // the original already exists. + // + // You need to specify specific metadata to restore an Amazon Elastic File System + // (Amazon EFS) instance: + // + // * file-system-id: ID of the Amazon EFS file system that is backed up by + // AWS Backup. Returned in GetRecoveryPointRestoreMetadata. + // + // * Encrypted: A Boolean value that, if true, specifies that the file system + // is encrypted. If KmsKeyId is specified, Encrypted must be set to true. + // + // * KmsKeyId: Specifies the AWS KMS key that is used to encrypt the restored + // file system. + // + // * PerformanceMode: Specifies the throughput mode of the file system. + // + // * CreationToken: A user-supplied value that ensures the uniqueness (idempotency) + // of the request. + // + // * newFileSystem: A Boolean value that, if true, specifies that the recovery + // point is restored to a new Amazon EFS file system. // // Metadata is a required field - Metadata map[string]*string `type:"map" required:"true"` + Metadata map[string]*string `type:"map" required:"true" sensitive:"true"` // An ARN that uniquely identifies a recovery point; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45. // @@ -10003,7 +11465,7 @@ type StartRestoreJobInput struct { // // * EBS for Amazon Elastic Block Store // - // * SGW for AWS Storage Gateway + // * Storage Gateway for AWS Storage Gateway // // * RDS for Amazon Relational Database Service // @@ -10629,6 +12091,20 @@ const ( ConditionTypeStringequals = "STRINGEQUALS" ) +const ( + // CopyJobStateCreated is a CopyJobState enum value + CopyJobStateCreated = "CREATED" + + // CopyJobStateRunning is a CopyJobState enum value + CopyJobStateRunning = "RUNNING" + + // CopyJobStateCompleted is a CopyJobState enum value + CopyJobStateCompleted = "COMPLETED" + + // CopyJobStateFailed is a CopyJobState enum value + CopyJobStateFailed = "FAILED" +) + const ( // JobStateCreated is a JobState enum value JobStateCreated = "CREATED" @@ -10704,12 +12180,36 @@ const ( // VaultEventBackupJobCompleted is a VaultEvent enum value VaultEventBackupJobCompleted = "BACKUP_JOB_COMPLETED" + // VaultEventBackupJobSuccessful is a VaultEvent enum value + VaultEventBackupJobSuccessful = "BACKUP_JOB_SUCCESSFUL" + + // VaultEventBackupJobFailed is a VaultEvent enum value + VaultEventBackupJobFailed = "BACKUP_JOB_FAILED" + + // VaultEventBackupJobExpired is a VaultEvent enum value + VaultEventBackupJobExpired = "BACKUP_JOB_EXPIRED" + // VaultEventRestoreJobStarted is a VaultEvent enum value VaultEventRestoreJobStarted = "RESTORE_JOB_STARTED" // VaultEventRestoreJobCompleted is a VaultEvent enum value VaultEventRestoreJobCompleted = "RESTORE_JOB_COMPLETED" + // VaultEventRestoreJobSuccessful is a VaultEvent enum value + VaultEventRestoreJobSuccessful = "RESTORE_JOB_SUCCESSFUL" + + // VaultEventRestoreJobFailed is a VaultEvent enum value + VaultEventRestoreJobFailed = "RESTORE_JOB_FAILED" + + // VaultEventCopyJobStarted is a VaultEvent enum value + VaultEventCopyJobStarted = "COPY_JOB_STARTED" + + // VaultEventCopyJobSuccessful is a VaultEvent enum value + VaultEventCopyJobSuccessful = "COPY_JOB_SUCCESSFUL" + + // VaultEventCopyJobFailed is a VaultEvent enum value + VaultEventCopyJobFailed = "COPY_JOB_FAILED" + // VaultEventRecoveryPointModified is a VaultEvent enum value VaultEventRecoveryPointModified = "RECOVERY_POINT_MODIFIED" diff --git a/vendor/github.com/aws/aws-sdk-go/service/backup/errors.go b/vendor/github.com/aws/aws-sdk-go/service/backup/errors.go index 06cc16b5ad0..b0c5ec8a5ff 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/backup/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/backup/errors.go @@ -2,6 +2,10 @@ package backup +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAlreadyExistsException for service response error code @@ -56,3 +60,14 @@ const ( // The request failed due to a temporary failure of the server. ErrCodeServiceUnavailableException = "ServiceUnavailableException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AlreadyExistsException": newErrorAlreadyExistsException, + "DependencyFailureException": newErrorDependencyFailureException, + "InvalidParameterValueException": newErrorInvalidParameterValueException, + "InvalidRequestException": newErrorInvalidRequestException, + "LimitExceededException": newErrorLimitExceededException, + "MissingParameterValueException": newErrorMissingParameterValueException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ServiceUnavailableException": newErrorServiceUnavailableException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/backup/service.go b/vendor/github.com/aws/aws-sdk-go/service/backup/service.go index 2f60e1c1f54..56d44bfd0a0 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/backup/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/backup/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "Backup" // Name of service. EndpointsID = "backup" // ID to lookup a service endpoint with. - ServiceID = "Backup" // ServiceID is a unique identifer of a specific service. + ServiceID = "Backup" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Backup client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Backup client from just a session. // svc := backup.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := backup.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *Backup { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Backup { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Backup { svc := &Backup{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-11-15", }, @@ -71,7 +75,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/batch/api.go b/vendor/github.com/aws/aws-sdk-go/service/batch/api.go index 9cb0000b92f..c2fba8ec066 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/batch/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/batch/api.go @@ -70,13 +70,13 @@ func (c *Batch) CancelJobRequest(input *CancelJobInput) (req *request.Request, o // See the AWS API reference guide for AWS Batch's // API operation CancelJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/CancelJob @@ -193,13 +193,13 @@ func (c *Batch) CreateComputeEnvironmentRequest(input *CreateComputeEnvironmentI // See the AWS API reference guide for AWS Batch's // API operation CreateComputeEnvironment for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/CreateComputeEnvironment @@ -285,13 +285,13 @@ func (c *Batch) CreateJobQueueRequest(input *CreateJobQueueInput) (req *request. // See the AWS API reference guide for AWS Batch's // API operation CreateJobQueue for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/CreateJobQueue @@ -374,13 +374,13 @@ func (c *Batch) DeleteComputeEnvironmentRequest(input *DeleteComputeEnvironmentI // See the AWS API reference guide for AWS Batch's // API operation DeleteComputeEnvironment for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/DeleteComputeEnvironment @@ -464,13 +464,13 @@ func (c *Batch) DeleteJobQueueRequest(input *DeleteJobQueueInput) (req *request. // See the AWS API reference guide for AWS Batch's // API operation DeleteJobQueue for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/DeleteJobQueue @@ -540,7 +540,8 @@ func (c *Batch) DeregisterJobDefinitionRequest(input *DeregisterJobDefinitionInp // DeregisterJobDefinition API operation for AWS Batch. // -// Deregisters an AWS Batch job definition. +// Deregisters an AWS Batch job definition. Job definitions will be permanently +// deleted after 180 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 @@ -549,13 +550,13 @@ func (c *Batch) DeregisterJobDefinitionRequest(input *DeregisterJobDefinitionInp // See the AWS API reference guide for AWS Batch's // API operation DeregisterJobDefinition for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/DeregisterJobDefinition @@ -643,13 +644,13 @@ func (c *Batch) DescribeComputeEnvironmentsRequest(input *DescribeComputeEnviron // See the AWS API reference guide for AWS Batch's // API operation DescribeComputeEnvironments for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/DescribeComputeEnvironments @@ -717,10 +718,12 @@ func (c *Batch) DescribeComputeEnvironmentsPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeComputeEnvironmentsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeComputeEnvironmentsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -784,13 +787,13 @@ func (c *Batch) DescribeJobDefinitionsRequest(input *DescribeJobDefinitionsInput // See the AWS API reference guide for AWS Batch's // API operation DescribeJobDefinitions for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/DescribeJobDefinitions @@ -858,10 +861,12 @@ func (c *Batch) DescribeJobDefinitionsPagesWithContext(ctx aws.Context, input *D }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeJobDefinitionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeJobDefinitionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -924,13 +929,13 @@ func (c *Batch) DescribeJobQueuesRequest(input *DescribeJobQueuesInput) (req *re // See the AWS API reference guide for AWS Batch's // API operation DescribeJobQueues for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/DescribeJobQueues @@ -998,10 +1003,12 @@ func (c *Batch) DescribeJobQueuesPagesWithContext(ctx aws.Context, input *Descri }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeJobQueuesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeJobQueuesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1058,13 +1065,13 @@ func (c *Batch) DescribeJobsRequest(input *DescribeJobsInput) (req *request.Requ // See the AWS API reference guide for AWS Batch's // API operation DescribeJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/DescribeJobs @@ -1159,13 +1166,13 @@ func (c *Batch) ListJobsRequest(input *ListJobsInput) (req *request.Request, out // See the AWS API reference guide for AWS Batch's // API operation ListJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/ListJobs @@ -1233,10 +1240,12 @@ func (c *Batch) ListJobsPagesWithContext(ctx aws.Context, input *ListJobsInput, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1293,13 +1302,13 @@ func (c *Batch) RegisterJobDefinitionRequest(input *RegisterJobDefinitionInput) // See the AWS API reference guide for AWS Batch's // API operation RegisterJobDefinition for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/RegisterJobDefinition @@ -1378,13 +1387,13 @@ func (c *Batch) SubmitJobRequest(input *SubmitJobInput) (req *request.Request, o // See the AWS API reference guide for AWS Batch's // API operation SubmitJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/SubmitJob @@ -1465,13 +1474,13 @@ func (c *Batch) TerminateJobRequest(input *TerminateJobInput) (req *request.Requ // See the AWS API reference guide for AWS Batch's // API operation TerminateJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/TerminateJob @@ -1549,13 +1558,13 @@ func (c *Batch) UpdateComputeEnvironmentRequest(input *UpdateComputeEnvironmentI // See the AWS API reference guide for AWS Batch's // API operation UpdateComputeEnvironment for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/UpdateComputeEnvironment @@ -1633,13 +1642,13 @@ func (c *Batch) UpdateJobQueueRequest(input *UpdateJobQueueInput) (req *request. // See the AWS API reference guide for AWS Batch's // API operation UpdateJobQueue for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientException "ClientException" +// Returned Error Types: +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/batch-2016-08-10/UpdateJobQueue @@ -1965,6 +1974,64 @@ func (s CancelJobOutput) GoString() string { return s.String() } +// 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 permissions to use the +// action or resource, or specifying an identifier that is not valid. +type ClientException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ClientException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClientException) GoString() string { + return s.String() +} + +func newErrorClientException(v protocol.ResponseMetadata) error { + return &ClientException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ClientException) Code() string { + return "ClientException" +} + +// Message returns the exception's message. +func (s ClientException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ClientException) OrigErr() error { + return nil +} + +func (s ClientException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ClientException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ClientException) RequestID() string { + return s.respMetadata.RequestID +} + // An object representing an AWS Batch compute environment. type ComputeEnvironmentDetail struct { _ struct{} `type:"structure"` @@ -2141,19 +2208,38 @@ func (s *ComputeEnvironmentOrder) SetOrder(v int64) *ComputeEnvironmentOrder { type ComputeResource struct { _ struct{} `type:"structure"` + // The allocation strategy to use for the compute resource in case not enough + // instances of the best fitting instance type can be allocated. This could + // be due to availability of the instance type in the region or Amazon EC2 service + // limits (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html). + // If this is not specified, the default is BEST_FIT, which will use only the + // best fitting instance type, waiting for additional capacity if it's not available. + // This allocation strategy keeps costs lower but can limit scaling. If you + // are using Spot Fleets with BEST_FIT then the Spot Fleet IAM Role must be + // specified. BEST_FIT_PROGRESSIVE will select additional instance types that + // are large enough to meet the requirements of the jobs in the queue, with + // a preference for instance types with a lower cost per vCPU. SPOT_CAPACITY_OPTIMIZED + // is only available for Spot Instance compute resources and will select additional + // instance types that are large enough to meet the requirements of the jobs + // in the queue, with a preference for instance types that are less likely to + // be interrupted. For more information, see Allocation Strategies (https://docs.aws.amazon.com/batch/latest/userguide/allocation-strategies.html) + // in the AWS Batch User Guide. + AllocationStrategy *string `locationName:"allocationStrategy" type:"string" enum:"CRAllocationStrategy"` + // The maximum percentage that a Spot Instance price can be when compared with // the On-Demand price for that instance type before instances are launched. // For example, if your maximum percentage is 20%, then the Spot price must - // be below 20% of the current On-Demand price for that EC2 instance. You always - // pay the lowest (market) price and never more than your maximum percentage. - // If you leave this field empty, the default value is 100% of the On-Demand - // price. + // be below 20% of the current On-Demand price for that Amazon EC2 instance. + // You always pay the lowest (market) price and never more than your maximum + // percentage. If you leave this field empty, the default value is 100% of the + // On-Demand price. BidPercentage *int64 `locationName:"bidPercentage" type:"integer"` - // The desired number of EC2 vCPUS in the compute environment. + // The desired number of Amazon EC2 vCPUS in the compute environment. DesiredvCpus *int64 `locationName:"desiredvCpus" type:"integer"` - // The EC2 key pair that is used for instances launched in the compute environment. + // The Amazon EC2 key pair that is used for instances launched in the compute + // environment. Ec2KeyPair *string `locationName:"ec2KeyPair" type:"string"` // The Amazon Machine Image (AMI) ID used for instances launched in the compute @@ -2170,8 +2256,8 @@ type ComputeResource struct { InstanceRole *string `locationName:"instanceRole" type:"string" required:"true"` // The instances types that may be launched. You can specify instance families - // to launch any instance type within those families (for example, c4 or p3), - // or you can specify specific sizes within a family (such as c4.8xlarge). You + // to launch any instance type within those families (for example, c5 or p3), + // or you can specify specific sizes within a family (such as c5.8xlarge). You // can also choose optimal to pick instance types (from the C, M, and R instance // families) on the fly that match the demand of your job queues. // @@ -2186,13 +2272,13 @@ type ComputeResource struct { // in the AWS Batch User Guide. LaunchTemplate *LaunchTemplateSpecification `locationName:"launchTemplate" type:"structure"` - // The maximum number of EC2 vCPUs that an environment can reach. + // The maximum number of Amazon EC2 vCPUs that an environment can reach. // // MaxvCpus is a required field MaxvCpus *int64 `locationName:"maxvCpus" type:"integer" required:"true"` - // The minimum number of EC2 vCPUs that an environment should maintain (even - // if the compute environment is DISABLED). + // The minimum number of Amazon EC2 vCPUs that an environment should maintain + // (even if the compute environment is DISABLED). // // MinvCpus is a required field MinvCpus *int64 `locationName:"minvCpus" type:"integer" required:"true"` @@ -2206,13 +2292,17 @@ type ComputeResource struct { // in the Amazon EC2 User Guide for Linux Instances. PlacementGroup *string `locationName:"placementGroup" type:"string"` - // The EC2 security group that is associated with instances launched in the - // compute environment. + // The Amazon EC2 security groups associated with instances launched in the + // compute environment. One or more security groups must be specified, either + // in securityGroupIds or using a launch template referenced in launchTemplate. + // If security groups are specified using both securityGroupIds and launchTemplate, + // the values in securityGroupIds will be used. SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` // The Amazon Resource Name (ARN) of the Amazon EC2 Spot Fleet IAM role applied - // to a SPOT compute environment. For more information, see Amazon EC2 Spot - // Fleet Role (https://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html) + // to a SPOT compute environment. This role is required if the allocation strategy + // set to BEST_FIT or if the allocation strategy is not specified. For more + // information, see Amazon EC2 Spot Fleet Role (https://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html) // in the AWS Batch User Guide. SpotIamFleetRole *string `locationName:"spotIamFleetRole" type:"string"` @@ -2273,6 +2363,12 @@ func (s *ComputeResource) Validate() error { return nil } +// SetAllocationStrategy sets the AllocationStrategy field's value. +func (s *ComputeResource) SetAllocationStrategy(v string) *ComputeResource { + s.AllocationStrategy = &v + return s +} + // SetBidPercentage sets the BidPercentage field's value. func (s *ComputeResource) SetBidPercentage(v int64) *ComputeResource { s.BidPercentage = &v @@ -2368,13 +2464,13 @@ func (s *ComputeResource) SetType(v string) *ComputeResource { type ComputeResourceUpdate struct { _ struct{} `type:"structure"` - // The desired number of EC2 vCPUS in the compute environment. + // The desired number of Amazon EC2 vCPUS in the compute environment. DesiredvCpus *int64 `locationName:"desiredvCpus" type:"integer"` - // The maximum number of EC2 vCPUs that an environment can reach. + // The maximum number of Amazon EC2 vCPUs that an environment can reach. MaxvCpus *int64 `locationName:"maxvCpus" type:"integer"` - // The minimum number of EC2 vCPUs that an environment should maintain. + // The minimum number of Amazon EC2 vCPUs that an environment should maintain. MinvCpus *int64 `locationName:"minvCpus" type:"integer"` } @@ -4058,7 +4154,7 @@ type JobDetail struct { // state. CreatedAt *int64 `locationName:"createdAt" type:"long"` - // A list of job names or IDs on which this job depends. + // A list of job IDs on which this job depends. DependsOn []*JobDependency `locationName:"dependsOn" type:"list"` // The job definition that is used by this job. @@ -5412,6 +5508,62 @@ func (s *RetryStrategy) SetAttempts(v int64) *RetryStrategy { return s } +// These errors are usually caused by a server issue. +type ServerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServerException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServerException) GoString() string { + return s.String() +} + +func newErrorServerException(v protocol.ResponseMetadata) error { + return &ServerException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServerException) Code() string { + return "ServerException" +} + +// Message returns the exception's message. +func (s ServerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServerException) OrigErr() error { + return nil +} + +func (s ServerException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServerException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServerException) RequestID() string { + return s.respMetadata.RequestID +} + type SubmitJobInput struct { _ struct{} `type:"structure"` @@ -5440,8 +5592,9 @@ type SubmitJobInput struct { // begin. DependsOn []*JobDependency `locationName:"dependsOn" type:"list"` - // The job definition used by this job. This value can be either a name:revision - // or the Amazon Resource Name (ARN) for the job definition. + // The job definition used by this job. This value can be one of name, name:revision, + // or the Amazon Resource Name (ARN) for the job definition. If name is specified + // without a revision then the latest active revision is used. // // JobDefinition is a required field JobDefinition *string `locationName:"jobDefinition" type:"string" required:"true"` @@ -6063,6 +6216,17 @@ const ( CETypeUnmanaged = "UNMANAGED" ) +const ( + // CRAllocationStrategyBestFit is a CRAllocationStrategy enum value + CRAllocationStrategyBestFit = "BEST_FIT" + + // CRAllocationStrategyBestFitProgressive is a CRAllocationStrategy enum value + CRAllocationStrategyBestFitProgressive = "BEST_FIT_PROGRESSIVE" + + // CRAllocationStrategySpotCapacityOptimized is a CRAllocationStrategy enum value + CRAllocationStrategySpotCapacityOptimized = "SPOT_CAPACITY_OPTIMIZED" +) + const ( // CRTypeEc2 is a CRType enum value CRTypeEc2 = "EC2" diff --git a/vendor/github.com/aws/aws-sdk-go/service/batch/errors.go b/vendor/github.com/aws/aws-sdk-go/service/batch/errors.go index eb308658602..ae250859be0 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/batch/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/batch/errors.go @@ -2,6 +2,10 @@ package batch +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeClientException for service response error code @@ -18,3 +22,8 @@ const ( // These errors are usually caused by a server issue. ErrCodeServerException = "ServerException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ClientException": newErrorClientException, + "ServerException": newErrorServerException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/batch/service.go b/vendor/github.com/aws/aws-sdk-go/service/batch/service.go index 6b10821b33f..184de634277 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/batch/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/batch/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "batch" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Batch" // ServiceID is a unique identifer of a specific service. + ServiceID = "Batch" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Batch client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Batch client from just a session. // svc := batch.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := batch.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *Batch { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Batch { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Batch { svc := &Batch{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-08-10", }, @@ -71,7 +75,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/budgets/api.go b/vendor/github.com/aws/aws-sdk-go/service/budgets/api.go index f4c58fb3bb6..d5a922714db 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/budgets/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/budgets/api.go @@ -70,21 +70,24 @@ func (c *Budgets) CreateBudgetRequest(input *CreateBudgetInput) (req *request.Re // See the AWS API reference guide for AWS Budgets's // API operation CreateBudget for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // An error on the client occurred. Typically, the cause is an invalid input // value. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeCreationLimitExceededException "CreationLimitExceededException" +// * CreationLimitExceededException // You've exceeded the notification or subscriber limit. // -// * ErrCodeDuplicateRecordException "DuplicateRecordException" +// * DuplicateRecordException // The budget name already exists. Budget names must be unique within an account. // +// * AccessDeniedException +// You are not authorized to use this operation with the given parameters. +// func (c *Budgets) CreateBudget(input *CreateBudgetInput) (*CreateBudgetOutput, error) { req, out := c.CreateBudgetRequest(input) return out, req.Send() @@ -159,24 +162,27 @@ func (c *Budgets) CreateNotificationRequest(input *CreateNotificationInput) (req // See the AWS API reference guide for AWS Budgets's // API operation CreateNotification for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // An error on the client occurred. Typically, the cause is an invalid input // value. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // We can’t locate the resource that you specified. // -// * ErrCodeCreationLimitExceededException "CreationLimitExceededException" +// * CreationLimitExceededException // You've exceeded the notification or subscriber limit. // -// * ErrCodeDuplicateRecordException "DuplicateRecordException" +// * DuplicateRecordException // The budget name already exists. Budget names must be unique within an account. // +// * AccessDeniedException +// You are not authorized to use this operation with the given parameters. +// func (c *Budgets) CreateNotification(input *CreateNotificationInput) (*CreateNotificationOutput, error) { req, out := c.CreateNotificationRequest(input) return out, req.Send() @@ -251,24 +257,27 @@ func (c *Budgets) CreateSubscriberRequest(input *CreateSubscriberInput) (req *re // See the AWS API reference guide for AWS Budgets's // API operation CreateSubscriber for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // An error on the client occurred. Typically, the cause is an invalid input // value. // -// * ErrCodeCreationLimitExceededException "CreationLimitExceededException" +// * CreationLimitExceededException // You've exceeded the notification or subscriber limit. // -// * ErrCodeDuplicateRecordException "DuplicateRecordException" +// * DuplicateRecordException // The budget name already exists. Budget names must be unique within an account. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // We can’t locate the resource that you specified. // +// * AccessDeniedException +// You are not authorized to use this operation with the given parameters. +// func (c *Budgets) CreateSubscriber(input *CreateSubscriberInput) (*CreateSubscriberOutput, error) { req, out := c.CreateSubscriberRequest(input) return out, req.Send() @@ -345,18 +354,21 @@ func (c *Budgets) DeleteBudgetRequest(input *DeleteBudgetInput) (req *request.Re // See the AWS API reference guide for AWS Budgets's // API operation DeleteBudget for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // An error on the client occurred. Typically, the cause is an invalid input // value. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // We can’t locate the resource that you specified. // +// * AccessDeniedException +// You are not authorized to use this operation with the given parameters. +// func (c *Budgets) DeleteBudget(input *DeleteBudgetInput) (*DeleteBudgetOutput, error) { req, out := c.DeleteBudgetRequest(input) return out, req.Send() @@ -433,18 +445,21 @@ func (c *Budgets) DeleteNotificationRequest(input *DeleteNotificationInput) (req // See the AWS API reference guide for AWS Budgets's // API operation DeleteNotification for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // An error on the client occurred. Typically, the cause is an invalid input // value. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // We can’t locate the resource that you specified. // +// * AccessDeniedException +// You are not authorized to use this operation with the given parameters. +// func (c *Budgets) DeleteNotification(input *DeleteNotificationInput) (*DeleteNotificationOutput, error) { req, out := c.DeleteNotificationRequest(input) return out, req.Send() @@ -520,18 +535,21 @@ func (c *Budgets) DeleteSubscriberRequest(input *DeleteSubscriberInput) (req *re // See the AWS API reference guide for AWS Budgets's // API operation DeleteSubscriber for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // An error on the client occurred. Typically, the cause is an invalid input // value. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // We can’t locate the resource that you specified. // +// * AccessDeniedException +// You are not authorized to use this operation with the given parameters. +// func (c *Budgets) DeleteSubscriber(input *DeleteSubscriberInput) (*DeleteSubscriberOutput, error) { req, out := c.DeleteSubscriberRequest(input) return out, req.Send() @@ -608,18 +626,21 @@ func (c *Budgets) DescribeBudgetRequest(input *DescribeBudgetInput) (req *reques // See the AWS API reference guide for AWS Budgets's // API operation DescribeBudget for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // An error on the client occurred. Typically, the cause is an invalid input // value. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // We can’t locate the resource that you specified. // +// * AccessDeniedException +// You are not authorized to use this operation with the given parameters. +// func (c *Budgets) DescribeBudget(input *DescribeBudgetInput) (*DescribeBudgetOutput, error) { req, out := c.DescribeBudgetRequest(input) return out, req.Send() @@ -693,24 +714,27 @@ func (c *Budgets) DescribeBudgetPerformanceHistoryRequest(input *DescribeBudgetP // See the AWS API reference guide for AWS Budgets's // API operation DescribeBudgetPerformanceHistory for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // An error on the client occurred. Typically, the cause is an invalid input // value. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // We can’t locate the resource that you specified. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The pagination token is invalid. // -// * ErrCodeExpiredNextTokenException "ExpiredNextTokenException" +// * ExpiredNextTokenException // The pagination token expired. // +// * AccessDeniedException +// You are not authorized to use this operation with the given parameters. +// func (c *Budgets) DescribeBudgetPerformanceHistory(input *DescribeBudgetPerformanceHistoryInput) (*DescribeBudgetPerformanceHistoryOutput, error) { req, out := c.DescribeBudgetPerformanceHistoryRequest(input) return out, req.Send() @@ -787,24 +811,27 @@ func (c *Budgets) DescribeBudgetsRequest(input *DescribeBudgetsInput) (req *requ // See the AWS API reference guide for AWS Budgets's // API operation DescribeBudgets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // An error on the client occurred. Typically, the cause is an invalid input // value. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // We can’t locate the resource that you specified. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The pagination token is invalid. // -// * ErrCodeExpiredNextTokenException "ExpiredNextTokenException" +// * ExpiredNextTokenException // The pagination token expired. // +// * AccessDeniedException +// You are not authorized to use this operation with the given parameters. +// func (c *Budgets) DescribeBudgets(input *DescribeBudgetsInput) (*DescribeBudgetsOutput, error) { req, out := c.DescribeBudgetsRequest(input) return out, req.Send() @@ -877,24 +904,27 @@ func (c *Budgets) DescribeNotificationsForBudgetRequest(input *DescribeNotificat // See the AWS API reference guide for AWS Budgets's // API operation DescribeNotificationsForBudget for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // An error on the client occurred. Typically, the cause is an invalid input // value. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // We can’t locate the resource that you specified. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The pagination token is invalid. // -// * ErrCodeExpiredNextTokenException "ExpiredNextTokenException" +// * ExpiredNextTokenException // The pagination token expired. // +// * AccessDeniedException +// You are not authorized to use this operation with the given parameters. +// func (c *Budgets) DescribeNotificationsForBudget(input *DescribeNotificationsForBudgetInput) (*DescribeNotificationsForBudgetOutput, error) { req, out := c.DescribeNotificationsForBudgetRequest(input) return out, req.Send() @@ -967,24 +997,27 @@ func (c *Budgets) DescribeSubscribersForNotificationRequest(input *DescribeSubsc // See the AWS API reference guide for AWS Budgets's // API operation DescribeSubscribersForNotification for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // We can’t locate the resource that you specified. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // An error on the client occurred. Typically, the cause is an invalid input // value. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The pagination token is invalid. // -// * ErrCodeExpiredNextTokenException "ExpiredNextTokenException" +// * ExpiredNextTokenException // The pagination token expired. // +// * AccessDeniedException +// You are not authorized to use this operation with the given parameters. +// func (c *Budgets) DescribeSubscribersForNotification(input *DescribeSubscribersForNotificationInput) (*DescribeSubscribersForNotificationOutput, error) { req, out := c.DescribeSubscribersForNotificationRequest(input) return out, req.Send() @@ -1065,18 +1098,21 @@ func (c *Budgets) UpdateBudgetRequest(input *UpdateBudgetInput) (req *request.Re // See the AWS API reference guide for AWS Budgets's // API operation UpdateBudget for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // An error on the client occurred. Typically, the cause is an invalid input // value. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // We can’t locate the resource that you specified. // +// * AccessDeniedException +// You are not authorized to use this operation with the given parameters. +// func (c *Budgets) UpdateBudget(input *UpdateBudgetInput) (*UpdateBudgetOutput, error) { req, out := c.UpdateBudgetRequest(input) return out, req.Send() @@ -1150,21 +1186,24 @@ func (c *Budgets) UpdateNotificationRequest(input *UpdateNotificationInput) (req // See the AWS API reference guide for AWS Budgets's // API operation UpdateNotification for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // An error on the client occurred. Typically, the cause is an invalid input // value. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // We can’t locate the resource that you specified. // -// * ErrCodeDuplicateRecordException "DuplicateRecordException" +// * DuplicateRecordException // The budget name already exists. Budget names must be unique within an account. // +// * AccessDeniedException +// You are not authorized to use this operation with the given parameters. +// func (c *Budgets) UpdateNotification(input *UpdateNotificationInput) (*UpdateNotificationOutput, error) { req, out := c.UpdateNotificationRequest(input) return out, req.Send() @@ -1238,21 +1277,24 @@ func (c *Budgets) UpdateSubscriberRequest(input *UpdateSubscriberInput) (req *re // See the AWS API reference guide for AWS Budgets's // API operation UpdateSubscriber for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // An error on the client occurred. Typically, the cause is an invalid input // value. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // We can’t locate the resource that you specified. // -// * ErrCodeDuplicateRecordException "DuplicateRecordException" +// * DuplicateRecordException // The budget name already exists. Budget names must be unique within an account. // +// * AccessDeniedException +// You are not authorized to use this operation with the given parameters. +// func (c *Budgets) UpdateSubscriber(input *UpdateSubscriberInput) (*UpdateSubscriberOutput, error) { req, out := c.UpdateSubscriberRequest(input) return out, req.Send() @@ -1274,6 +1316,63 @@ func (c *Budgets) UpdateSubscriberWithContext(ctx aws.Context, input *UpdateSubs return out, req.Send() } +// You are not authorized to use this operation with the given parameters. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message the exception carries. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents the output of the CreateBudget operation. The content consists // of the detailed metadata and data file information, and the current status // of the budget object. @@ -1284,14 +1383,14 @@ func (c *Budgets) UpdateSubscriberWithContext(ctx aws.Context, input *UpdateSubs type Budget struct { _ struct{} `type:"structure"` - // The total amount of cost, usage, RI utilization, or RI coverage that you - // want to track with your budget. + // The total amount of cost, usage, RI utilization, RI coverage, Savings Plans + // utilization, or Savings Plans coverage that you want to track with your budget. // - // BudgetLimit is required for cost or usage budgets, but optional for RI utilization - // or coverage budgets. RI utilization or coverage budgets default to 100, which - // is the only valid value for RI utilization or coverage budgets. You can't - // use BudgetLimit with PlannedBudgetLimits for CreateBudget and UpdateBudget - // actions. + // BudgetLimit is required for cost or usage budgets, but optional for RI or + // Savings Plans utilization or coverage budgets. RI and Savings Plans utilization + // or coverage budgets default to 100, which is the only valid value for RI + // or Savings Plans utilization or coverage budgets. You can't use BudgetLimit + // with PlannedBudgetLimits for CreateBudget and UpdateBudget actions. BudgetLimit *Spend `type:"structure"` // The name of a budget. The name must be unique within an account. The : and @@ -1300,7 +1399,8 @@ type Budget struct { // BudgetName is a required field BudgetName *string `min:"1" type:"string" required:"true"` - // Whether this budget tracks costs, usage, RI utilization, or RI coverage. + // Whether this budget tracks costs, usage, RI utilization, RI coverage, Savings + // Plans utilization, or Savings Plans coverage. // // BudgetType is a required field BudgetType *string `type:"string" required:"true" enum:"BudgetType"` @@ -1325,7 +1425,8 @@ type Budget struct { // The types of costs that are included in this COST budget. // - // USAGE, RI_UTILIZATION, and RI_COVERAGE budgets do not have CostTypes. + // USAGE, RI_UTILIZATION, RI_COVERAGE, Savings_Plans_Utilization, and Savings_Plans_Coverage + // budgets do not have CostTypes. CostTypes *CostTypes `type:"structure"` // The last time that you updated this budget. @@ -1383,7 +1484,8 @@ type Budget struct { TimePeriod *TimePeriod `type:"structure"` // The length of time until a budget resets the actual and forecasted spend. - // DAILY is available only for RI_UTILIZATION and RI_COVERAGE budgets. + // DAILY is available only for RI_UTILIZATION, RI_COVERAGE, Savings_Plans_Utilization, + // and Savings_Plans_Coverage budgets. // // TimeUnit is a required field TimeUnit *string `type:"string" required:"true" enum:"TimeUnit"` @@ -2156,6 +2258,63 @@ func (s CreateSubscriberOutput) GoString() string { return s.String() } +// You've exceeded the notification or subscriber limit. +type CreationLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message the exception carries. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s CreationLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreationLimitExceededException) GoString() string { + return s.String() +} + +func newErrorCreationLimitExceededException(v protocol.ResponseMetadata) error { + return &CreationLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CreationLimitExceededException) Code() string { + return "CreationLimitExceededException" +} + +// Message returns the exception's message. +func (s CreationLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CreationLimitExceededException) OrigErr() error { + return nil +} + +func (s CreationLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CreationLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CreationLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Request of DeleteBudget type DeleteBudgetInput struct { _ struct{} `type:"structure"` @@ -3002,6 +3161,350 @@ func (s *DescribeSubscribersForNotificationOutput) SetSubscribers(v []*Subscribe return s } +// The budget name already exists. Budget names must be unique within an account. +type DuplicateRecordException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message the exception carries. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DuplicateRecordException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DuplicateRecordException) GoString() string { + return s.String() +} + +func newErrorDuplicateRecordException(v protocol.ResponseMetadata) error { + return &DuplicateRecordException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DuplicateRecordException) Code() string { + return "DuplicateRecordException" +} + +// Message returns the exception's message. +func (s DuplicateRecordException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DuplicateRecordException) OrigErr() error { + return nil +} + +func (s DuplicateRecordException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DuplicateRecordException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DuplicateRecordException) RequestID() string { + return s.respMetadata.RequestID +} + +// The pagination token expired. +type ExpiredNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message the exception carries. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ExpiredNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExpiredNextTokenException) GoString() string { + return s.String() +} + +func newErrorExpiredNextTokenException(v protocol.ResponseMetadata) error { + return &ExpiredNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ExpiredNextTokenException) Code() string { + return "ExpiredNextTokenException" +} + +// Message returns the exception's message. +func (s ExpiredNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ExpiredNextTokenException) OrigErr() error { + return nil +} + +func (s ExpiredNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ExpiredNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ExpiredNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// An error on the server occurred during the processing of your request. Try +// again later. +type InternalErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message the exception carries. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalErrorException) GoString() string { + return s.String() +} + +func newErrorInternalErrorException(v protocol.ResponseMetadata) error { + return &InternalErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalErrorException) Code() string { + return "InternalErrorException" +} + +// Message returns the exception's message. +func (s InternalErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalErrorException) OrigErr() error { + return nil +} + +func (s InternalErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// The pagination token is invalid. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message the exception carries. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNextTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// An error on the client occurred. Typically, the cause is an invalid input +// value. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message the exception carries. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} + +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// We can’t locate the resource that you specified. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message the exception carries. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // A notification that is associated with a budget. A budget can have up to // five notifications. // @@ -3263,7 +3766,7 @@ type Subscriber struct { // The address that AWS sends budget notifications to, either an SNS topic or // an email. // - // AWS validates the address for a CreateSubscriber request with the .* regex. + // When you create a subscriber, the value of Address can't contain line breaks. // // Address is a required field Address *string `min:"1" type:"string" required:"true" sensitive:"true"` @@ -3699,6 +4202,12 @@ const ( // BudgetTypeRiCoverage is a BudgetType enum value BudgetTypeRiCoverage = "RI_COVERAGE" + + // BudgetTypeSavingsPlansUtilization is a BudgetType enum value + BudgetTypeSavingsPlansUtilization = "SAVINGS_PLANS_UTILIZATION" + + // BudgetTypeSavingsPlansCoverage is a BudgetType enum value + BudgetTypeSavingsPlansCoverage = "SAVINGS_PLANS_COVERAGE" ) // The comparison operator of a notification. Currently the service supports diff --git a/vendor/github.com/aws/aws-sdk-go/service/budgets/errors.go b/vendor/github.com/aws/aws-sdk-go/service/budgets/errors.go index 8737c2daa53..15cf0ff5d3e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/budgets/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/budgets/errors.go @@ -2,8 +2,18 @@ package budgets +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( + // ErrCodeAccessDeniedException for service response error code + // "AccessDeniedException". + // + // You are not authorized to use this operation with the given parameters. + ErrCodeAccessDeniedException = "AccessDeniedException" + // ErrCodeCreationLimitExceededException for service response error code // "CreationLimitExceededException". // @@ -48,3 +58,14 @@ const ( // We can’t locate the resource that you specified. ErrCodeNotFoundException = "NotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "CreationLimitExceededException": newErrorCreationLimitExceededException, + "DuplicateRecordException": newErrorDuplicateRecordException, + "ExpiredNextTokenException": newErrorExpiredNextTokenException, + "InternalErrorException": newErrorInternalErrorException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "InvalidParameterException": newErrorInvalidParameterException, + "NotFoundException": newErrorNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/budgets/service.go b/vendor/github.com/aws/aws-sdk-go/service/budgets/service.go index dc10c2aaa1b..5e6a1071669 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/budgets/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/budgets/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "budgets" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Budgets" // ServiceID is a unique identifer of a specific service. + ServiceID = "Budgets" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Budgets client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Budgets client from just a session. // svc := budgets.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := budgets.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *Budgets { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Budgets { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Budgets { svc := &Budgets{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-10-20", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloud9/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloud9/api.go index 0710f084449..fb8066d8aa6 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloud9/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloud9/api.go @@ -3,6 +3,7 @@ package cloud9 import ( + "fmt" "time" "github.com/aws/aws-sdk-go/aws" @@ -67,26 +68,26 @@ func (c *Cloud9) CreateEnvironmentEC2Request(input *CreateEnvironmentEC2Input) ( // See the AWS API reference guide for AWS Cloud9's // API operation CreateEnvironmentEC2 for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The target request is invalid. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // A conflict occurred. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The target resource cannot be found. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // An access permissions issue occurred. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Too many service requests were made over the given time period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A service limit was exceeded. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal server error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/CreateEnvironmentEC2 @@ -164,26 +165,26 @@ func (c *Cloud9) CreateEnvironmentMembershipRequest(input *CreateEnvironmentMemb // See the AWS API reference guide for AWS Cloud9's // API operation CreateEnvironmentMembership for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The target request is invalid. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // A conflict occurred. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The target resource cannot be found. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // An access permissions issue occurred. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Too many service requests were made over the given time period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A service limit was exceeded. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal server error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/CreateEnvironmentMembership @@ -263,26 +264,26 @@ func (c *Cloud9) DeleteEnvironmentRequest(input *DeleteEnvironmentInput) (req *r // See the AWS API reference guide for AWS Cloud9's // API operation DeleteEnvironment for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The target request is invalid. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // A conflict occurred. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The target resource cannot be found. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // An access permissions issue occurred. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Too many service requests were made over the given time period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A service limit was exceeded. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal server error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/DeleteEnvironment @@ -361,26 +362,26 @@ func (c *Cloud9) DeleteEnvironmentMembershipRequest(input *DeleteEnvironmentMemb // See the AWS API reference guide for AWS Cloud9's // API operation DeleteEnvironmentMembership for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The target request is invalid. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // A conflict occurred. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The target resource cannot be found. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // An access permissions issue occurred. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Too many service requests were made over the given time period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A service limit was exceeded. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal server error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/DeleteEnvironmentMembership @@ -465,26 +466,26 @@ func (c *Cloud9) DescribeEnvironmentMembershipsRequest(input *DescribeEnvironmen // See the AWS API reference guide for AWS Cloud9's // API operation DescribeEnvironmentMemberships for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The target request is invalid. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // A conflict occurred. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The target resource cannot be found. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // An access permissions issue occurred. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Too many service requests were made over the given time period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A service limit was exceeded. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal server error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/DescribeEnvironmentMemberships @@ -552,10 +553,12 @@ func (c *Cloud9) DescribeEnvironmentMembershipsPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEnvironmentMembershipsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEnvironmentMembershipsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -612,26 +615,26 @@ func (c *Cloud9) DescribeEnvironmentStatusRequest(input *DescribeEnvironmentStat // See the AWS API reference guide for AWS Cloud9's // API operation DescribeEnvironmentStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The target request is invalid. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // A conflict occurred. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The target resource cannot be found. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // An access permissions issue occurred. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Too many service requests were made over the given time period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A service limit was exceeded. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal server error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/DescribeEnvironmentStatus @@ -709,26 +712,26 @@ func (c *Cloud9) DescribeEnvironmentsRequest(input *DescribeEnvironmentsInput) ( // See the AWS API reference guide for AWS Cloud9's // API operation DescribeEnvironments for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The target request is invalid. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // A conflict occurred. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The target resource cannot be found. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // An access permissions issue occurred. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Too many service requests were made over the given time period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A service limit was exceeded. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal server error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/DescribeEnvironments @@ -812,26 +815,26 @@ func (c *Cloud9) ListEnvironmentsRequest(input *ListEnvironmentsInput) (req *req // See the AWS API reference guide for AWS Cloud9's // API operation ListEnvironments for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The target request is invalid. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // A conflict occurred. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The target resource cannot be found. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // An access permissions issue occurred. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Too many service requests were made over the given time period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A service limit was exceeded. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal server error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/ListEnvironments @@ -899,13 +902,275 @@ func (c *Cloud9) ListEnvironmentsPagesWithContext(ctx aws.Context, input *ListEn }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEnvironmentsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListEnvironmentsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/ListTagsForResource +func (c *Cloud9) 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 Cloud9. +// +// Gets a list of the tags associated with an AWS Cloud9 development 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 Cloud9's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// The target resource cannot be found. +// +// * InternalServerErrorException +// An internal server error occurred. +// +// * BadRequestException +// The target request is invalid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/ListTagsForResource +func (c *Cloud9) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Cloud9) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/TagResource +func (c *Cloud9) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for AWS Cloud9. +// +// Adds tags to an AWS Cloud9 development environment. +// +// Tags that you add to an AWS Cloud9 environment by using this method will +// NOT be automatically propagated to underlying 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 AWS Cloud9's +// API operation TagResource for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// The target resource cannot be found. +// +// * InternalServerErrorException +// An internal server error occurred. +// +// * BadRequestException +// The target request is invalid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/TagResource +func (c *Cloud9) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Cloud9) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/UntagResource +func (c *Cloud9) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for AWS Cloud9. +// +// Removes tags from an AWS Cloud9 development 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 Cloud9's +// API operation UntagResource for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// The target resource cannot be found. +// +// * InternalServerErrorException +// An internal server error occurred. +// +// * BadRequestException +// The target request is invalid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/UntagResource +func (c *Cloud9) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Cloud9) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opUpdateEnvironment = "UpdateEnvironment" // UpdateEnvironmentRequest generates a "aws/request.Request" representing the @@ -960,26 +1225,26 @@ func (c *Cloud9) UpdateEnvironmentRequest(input *UpdateEnvironmentInput) (req *r // See the AWS API reference guide for AWS Cloud9's // API operation UpdateEnvironment for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The target request is invalid. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // A conflict occurred. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The target resource cannot be found. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // An access permissions issue occurred. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Too many service requests were made over the given time period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A service limit was exceeded. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal server error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/UpdateEnvironment @@ -1058,26 +1323,26 @@ func (c *Cloud9) UpdateEnvironmentMembershipRequest(input *UpdateEnvironmentMemb // See the AWS API reference guide for AWS Cloud9's // API operation UpdateEnvironmentMembership for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The target request is invalid. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // A conflict occurred. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The target resource cannot be found. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // An access permissions issue occurred. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Too many service requests were made over the given time period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A service limit was exceeded. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal server error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloud9-2017-09-23/UpdateEnvironmentMembership @@ -1102,6 +1367,118 @@ func (c *Cloud9) UpdateEnvironmentMembershipWithContext(ctx aws.Context, input * return out, req.Send() } +// The target request is invalid. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// A conflict occurred. +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictException) GoString() string { + return s.String() +} + +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" +} + +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil +} + +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID +} + type CreateEnvironmentEC2Input struct { _ struct{} `type:"structure"` @@ -1139,6 +1516,10 @@ type CreateEnvironmentEC2Input struct { // The ID of the subnet in Amazon VPC that AWS Cloud9 will use to communicate // with the Amazon EC2 instance. SubnetId *string `locationName:"subnetId" min:"5" type:"string"` + + // An array of key-value pairs that will be associated with the new AWS Cloud9 + // development environment. + Tags []*Tag `locationName:"tags" type:"list"` } // String returns the string representation @@ -1169,6 +1550,16 @@ func (s *CreateEnvironmentEC2Input) Validate() error { if s.SubnetId != nil && len(*s.SubnetId) < 5 { invalidParams.Add(request.NewErrParamMinLen("SubnetId", 5)) } + 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 @@ -1218,6 +1609,12 @@ func (s *CreateEnvironmentEC2Input) SetSubnetId(v string) *CreateEnvironmentEC2I return s } +// SetTags sets the Tags field's value. +func (s *CreateEnvironmentEC2Input) SetTags(v []*Tag) *CreateEnvironmentEC2Input { + s.Tags = v + return s +} + type CreateEnvironmentEC2Output struct { _ struct{} `type:"structure"` @@ -1810,11 +2207,15 @@ type EnvironmentLifecycle struct { // The current creation or deletion lifecycle state of the environment. // + // * CREATING: The environment is in the process of being created. + // // * CREATED: The environment was successfully created. // - // * DELETE_FAILED: The environment failed to delete. + // * CREATE_FAILED: The environment failed to be created. // // * DELETING: The environment is in the process of being deleted. + // + // * DELETE_FAILED: The environment failed to delete. Status *string `locationName:"status" type:"string" enum:"EnvironmentLifecycleStatus"` } @@ -1915,11 +2316,179 @@ func (s *EnvironmentMember) SetUserId(v string) *EnvironmentMember { return s } -type ListEnvironmentsInput struct { - _ struct{} `type:"structure"` +// An access permissions issue occurred. +type ForbiddenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The maximum number of environments to get identifiers for. - MaxResults *int64 `locationName:"maxResults" type:"integer"` + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ForbiddenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ForbiddenException) GoString() string { + return s.String() +} + +func newErrorForbiddenException(v protocol.ResponseMetadata) error { + return &ForbiddenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ForbiddenException) Code() string { + return "ForbiddenException" +} + +// Message returns the exception's message. +func (s ForbiddenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ForbiddenException) OrigErr() error { + return nil +} + +func (s ForbiddenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ForbiddenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ForbiddenException) RequestID() string { + return s.respMetadata.RequestID +} + +// An internal server error occurred. +type InternalServerErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalServerErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerErrorException) GoString() string { + return s.String() +} + +func newErrorInternalServerErrorException(v protocol.ResponseMetadata) error { + return &InternalServerErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerErrorException) Code() string { + return "InternalServerErrorException" +} + +// Message returns the exception's message. +func (s InternalServerErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerErrorException) OrigErr() error { + return nil +} + +func (s InternalServerErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// A service limit was exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +type ListEnvironmentsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of environments to get identifiers for. + MaxResults *int64 `locationName:"maxResults" type:"integer"` // During a previous call, if there are more than 25 items in the list, only // the first 25 items are returned, along with a unique string called a next @@ -1987,6 +2556,385 @@ func (s *ListEnvironmentsOutput) SetNextToken(v string) *ListEnvironmentsOutput return s } +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the AWS Cloud9 development environment + // to get the tags for. + // + // 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 +} + +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // The list of tags associated with the AWS Cloud9 development environment. + 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() +} + +// SetTags sets the Tags field's value. +func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { + s.Tags = v + return s +} + +// The target resource cannot be found. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Metadata that is associated with AWS resources. In particular, a name-value +// pair that can be associated with an AWS Cloud9 development environment. There +// are two types of tags: user tags and system tags. A user tag is created by +// the user. A system tag is automatically created by AWS services. A system +// tag is prefixed with "aws:" and cannot be modified by the user. +type Tag struct { + _ struct{} `type:"structure"` + + // The name part of a tag. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // The value part of a tag. + // + // Value is a required field + Value *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s Tag) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Tag) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Tag) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Tag"} + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + if s.Value == nil { + invalidParams.Add(request.NewErrParamRequired("Value")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKey sets the Key field's value. +func (s *Tag) SetKey(v string) *Tag { + s.Key = &v + return s +} + +// SetValue sets the Value field's value. +func (s *Tag) SetValue(v string) *Tag { + s.Value = &v + return s +} + +type TagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the AWS Cloud9 development environment + // to add tags to. + // + // ResourceARN is a required field + ResourceARN *string `type:"string" required:"true"` + + // The list of tags to add to the given AWS Cloud9 development environment. + // + // 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.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 +} + +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() +} + +// Too many service requests were made over the given time period. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the AWS Cloud9 development environment + // to remove tags from. + // + // ResourceARN is a required field + ResourceARN *string `type:"string" required:"true"` + + // The tag names of the tags to remove from the given AWS Cloud9 development + // environment. + // + // 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.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 +} + +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() +} + type UpdateEnvironmentInput struct { _ struct{} `type:"structure"` @@ -2157,9 +3105,15 @@ func (s UpdateEnvironmentOutput) GoString() string { } const ( + // EnvironmentLifecycleStatusCreating is a EnvironmentLifecycleStatus enum value + EnvironmentLifecycleStatusCreating = "CREATING" + // EnvironmentLifecycleStatusCreated is a EnvironmentLifecycleStatus enum value EnvironmentLifecycleStatusCreated = "CREATED" + // EnvironmentLifecycleStatusCreateFailed is a EnvironmentLifecycleStatus enum value + EnvironmentLifecycleStatusCreateFailed = "CREATE_FAILED" + // EnvironmentLifecycleStatusDeleting is a EnvironmentLifecycleStatus enum value EnvironmentLifecycleStatusDeleting = "DELETING" diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloud9/doc.go b/vendor/github.com/aws/aws-sdk-go/service/cloud9/doc.go index c20c565e261..dd5fc61b903 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloud9/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloud9/doc.go @@ -30,6 +30,12 @@ // // * ListEnvironments: Gets a list of environment identifiers. // +// * ListTagsForResource: Gets the tags for an environment. +// +// * TagResource: Adds tags to an environment. +// +// * UntagResource: Removes tags from an environment. +// // * UpdateEnvironment: Changes the settings of an existing environment. // // * UpdateEnvironmentMembership: Changes the settings of an existing environment diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloud9/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloud9/errors.go index b5369ad46b3..0318a99b302 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloud9/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloud9/errors.go @@ -2,6 +2,10 @@ package cloud9 +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadRequestException for service response error code @@ -46,3 +50,13 @@ const ( // Too many service requests were made over the given time period. ErrCodeTooManyRequestsException = "TooManyRequestsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadRequestException": newErrorBadRequestException, + "ConflictException": newErrorConflictException, + "ForbiddenException": newErrorForbiddenException, + "InternalServerErrorException": newErrorInternalServerErrorException, + "LimitExceededException": newErrorLimitExceededException, + "NotFoundException": newErrorNotFoundException, + "TooManyRequestsException": newErrorTooManyRequestsException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloud9/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloud9/service.go index 8b9d30d5440..cfaec1d7791 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloud9/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloud9/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "cloud9" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Cloud9" // ServiceID is a unique identifer of a specific service. + ServiceID = "Cloud9" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Cloud9 client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Cloud9 client from just a session. // svc := cloud9.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := cloud9.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *Cloud9 { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Cloud9 { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Cloud9 { svc := &Cloud9{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-09-23", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index e0ac414e9d4..d4fbccb7ec2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/api.go @@ -245,10 +245,11 @@ func (c *CloudFormation) CreateChangeSetRequest(input *CreateChangeSetInput) (re // // To create a change set for a stack that doesn't exist, for the ChangeSetType // parameter, specify CREATE. To create a change set for an existing stack, -// specify UPDATE for the ChangeSetType parameter. After the CreateChangeSet -// call successfully completes, AWS CloudFormation starts creating the change -// set. To check the status of the change set or to review it, use the DescribeChangeSet -// action. +// specify UPDATE for the ChangeSetType parameter. To create a change set for +// an import operation, specify IMPORT for the ChangeSetType parameter. After +// the CreateChangeSet call successfully completes, AWS CloudFormation starts +// creating the change set. To check the status of the change set or to review +// it, use the DescribeChangeSet action. // // When you are satisfied with the changes the change set will make, execute // the change set by using the ExecuteChangeSet action. AWS CloudFormation doesn't @@ -437,8 +438,8 @@ func (c *CloudFormation) CreateStackInstancesRequest(input *CreateStackInstances // // Creates stack instances for the specified accounts, within the specified // regions. A stack instance refers to a stack in a specific account and region. -// Accounts and Regions are required parameters—you must specify at least -// one account and one region. +// You must specify at least one value for either Accounts or DeploymentTargets, +// and you must specify at least one value for 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 @@ -930,6 +931,99 @@ func (c *CloudFormation) DeleteStackSetWithContext(ctx aws.Context, input *Delet return out, req.Send() } +const opDeregisterType = "DeregisterType" + +// DeregisterTypeRequest generates a "aws/request.Request" representing the +// client's request for the DeregisterType operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeregisterType for more information on using the DeregisterType +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeregisterTypeRequest method. +// req, resp := client.DeregisterTypeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeregisterType +func (c *CloudFormation) DeregisterTypeRequest(input *DeregisterTypeInput) (req *request.Request, output *DeregisterTypeOutput) { + op := &request.Operation{ + Name: opDeregisterType, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeregisterTypeInput{} + } + + output = &DeregisterTypeOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeregisterType API operation for AWS CloudFormation. +// +// Removes a type or type version from active use in the CloudFormation registry. +// If a type or type version is deregistered, it cannot be used in CloudFormation +// operations. +// +// To deregister a type, you must individually deregister all registered versions +// of that type. If a type has only a single registered version, deregistering +// that version results in the type itself being deregistered. +// +// You cannot deregister the default version of a type, unless it is the only +// registered version of that type, in which case the type itself is deregistered +// as well. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 DeregisterType for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. +// +// * ErrCodeTypeNotFoundException "TypeNotFoundException" +// The specified type does not exist in the CloudFormation registry. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DeregisterType +func (c *CloudFormation) DeregisterType(input *DeregisterTypeInput) (*DeregisterTypeOutput, error) { + req, out := c.DeregisterTypeRequest(input) + return out, req.Send() +} + +// DeregisterTypeWithContext is the same as DeregisterType with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterType for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudFormation) DeregisterTypeWithContext(ctx aws.Context, input *DeregisterTypeInput, opts ...request.Option) (*DeregisterTypeOutput, error) { + req, out := c.DeregisterTypeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeAccountLimits = "DescribeAccountLimits" // DescribeAccountLimitsRequest generates a "aws/request.Request" representing the @@ -1304,10 +1398,12 @@ func (c *CloudFormation) DescribeStackEventsPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeStackEventsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeStackEventsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1608,10 +1704,12 @@ func (c *CloudFormation) DescribeStackResourceDriftsPagesWithContext(ctx aws.Con }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeStackResourceDriftsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeStackResourceDriftsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1993,13 +2091,187 @@ func (c *CloudFormation) DescribeStacksPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeStacksOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeStacksOutput), !p.HasNextPage()) { + break + } } + return p.Err() } +const opDescribeType = "DescribeType" + +// DescribeTypeRequest generates a "aws/request.Request" representing the +// client's request for the DescribeType operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeType for more information on using the DescribeType +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeTypeRequest method. +// req, resp := client.DescribeTypeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeType +func (c *CloudFormation) DescribeTypeRequest(input *DescribeTypeInput) (req *request.Request, output *DescribeTypeOutput) { + op := &request.Operation{ + Name: opDescribeType, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeTypeInput{} + } + + output = &DescribeTypeOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeType API operation for AWS CloudFormation. +// +// Returns detailed information about a type that has been registered. +// +// If you specify a VersionId, DescribeType returns information about that specific +// type version. Otherwise, it returns information about the default type 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 CloudFormation's +// API operation DescribeType for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. +// +// * ErrCodeTypeNotFoundException "TypeNotFoundException" +// The specified type does not exist in the CloudFormation registry. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeType +func (c *CloudFormation) DescribeType(input *DescribeTypeInput) (*DescribeTypeOutput, error) { + req, out := c.DescribeTypeRequest(input) + return out, req.Send() +} + +// DescribeTypeWithContext is the same as DescribeType with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeType for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudFormation) DescribeTypeWithContext(ctx aws.Context, input *DescribeTypeInput, opts ...request.Option) (*DescribeTypeOutput, error) { + req, out := c.DescribeTypeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeTypeRegistration = "DescribeTypeRegistration" + +// DescribeTypeRegistrationRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTypeRegistration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeTypeRegistration for more information on using the DescribeTypeRegistration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeTypeRegistrationRequest method. +// req, resp := client.DescribeTypeRegistrationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeTypeRegistration +func (c *CloudFormation) DescribeTypeRegistrationRequest(input *DescribeTypeRegistrationInput) (req *request.Request, output *DescribeTypeRegistrationOutput) { + op := &request.Operation{ + Name: opDescribeTypeRegistration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeTypeRegistrationInput{} + } + + output = &DescribeTypeRegistrationOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeTypeRegistration API operation for AWS CloudFormation. +// +// Returns information about a type's registration, including its current status +// and type and version identifiers. +// +// When you initiate a registration request using RegisterType , you can then +// use DescribeTypeRegistration to monitor the progress of that registration +// request. +// +// Once the registration request has completed, use DescribeType to return detailed +// informaiton about a 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 AWS CloudFormation's +// API operation DescribeTypeRegistration for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DescribeTypeRegistration +func (c *CloudFormation) DescribeTypeRegistration(input *DescribeTypeRegistrationInput) (*DescribeTypeRegistrationOutput, error) { + req, out := c.DescribeTypeRegistrationRequest(input) + return out, req.Send() +} + +// DescribeTypeRegistrationWithContext is the same as DescribeTypeRegistration with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTypeRegistration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudFormation) DescribeTypeRegistrationWithContext(ctx aws.Context, input *DescribeTypeRegistrationInput, opts ...request.Option) (*DescribeTypeRegistrationOutput, error) { + req, out := c.DescribeTypeRegistrationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDetectStackDrift = "DetectStackDrift" // DetectStackDriftRequest generates a "aws/request.Request" representing the @@ -2186,6 +2458,124 @@ func (c *CloudFormation) DetectStackResourceDriftWithContext(ctx aws.Context, in return out, req.Send() } +const opDetectStackSetDrift = "DetectStackSetDrift" + +// DetectStackSetDriftRequest generates a "aws/request.Request" representing the +// client's request for the DetectStackSetDrift operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DetectStackSetDrift for more information on using the DetectStackSetDrift +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DetectStackSetDriftRequest method. +// req, resp := client.DetectStackSetDriftRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DetectStackSetDrift +func (c *CloudFormation) DetectStackSetDriftRequest(input *DetectStackSetDriftInput) (req *request.Request, output *DetectStackSetDriftOutput) { + op := &request.Operation{ + Name: opDetectStackSetDrift, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DetectStackSetDriftInput{} + } + + output = &DetectStackSetDriftOutput{} + req = c.newRequest(op, input, output) + return +} + +// DetectStackSetDrift API operation for AWS CloudFormation. +// +// Detect drift on a stack set. When CloudFormation performs drift detection +// on a stack set, it performs drift detection on the stack associated with +// each stack instance in the stack set. For more information, see How CloudFormation +// Performs Drift Detection on a Stack Set (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html). +// +// DetectStackSetDrift returns the OperationId of the stack set drift detection +// operation. Use this operation id with DescribeStackSetOperation to monitor +// the progress of the drift detection operation. The drift detection operation +// may take some time, depending on the number of stack instances included in +// the stack set, as well as the number of resources included in each stack. +// +// Once the operation has completed, use the following actions to return drift +// information: +// +// * Use DescribeStackSet to return detailed informaiton about the stack +// set, including detailed information about the last completed drift operation +// performed on the stack set. (Information about drift operations that are +// in progress is not included.) +// +// * Use ListStackInstances to return a list of stack instances belonging +// to the stack set, including the drift status and last drift time checked +// of each instance. +// +// * Use DescribeStackInstance to return detailed information about a specific +// stack instance, including its drift status and last drift time checked. +// +// For more information on performing a drift detection operation on a stack +// set, see Detecting Unmanaged Changes in Stack Sets (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html). +// +// You can only run a single drift detection operation on a given stack set +// at one time. +// +// To stop a drift detection stack set operation, use StopStackSetOperation . +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 DetectStackSetDrift for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidOperationException "InvalidOperationException" +// The specified operation isn't valid. +// +// * ErrCodeOperationInProgressException "OperationInProgressException" +// Another operation is currently in progress for this stack set. Only one operation +// can be performed for a stack set at a given time. +// +// * ErrCodeStackSetNotFoundException "StackSetNotFoundException" +// The specified stack set doesn't exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/DetectStackSetDrift +func (c *CloudFormation) DetectStackSetDrift(input *DetectStackSetDriftInput) (*DetectStackSetDriftOutput, error) { + req, out := c.DetectStackSetDriftRequest(input) + return out, req.Send() +} + +// DetectStackSetDriftWithContext is the same as DetectStackSetDrift with the addition of +// the ability to pass a context and additional request options. +// +// See DetectStackSetDrift for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudFormation) DetectStackSetDriftWithContext(ctx aws.Context, input *DetectStackSetDriftInput, opts ...request.Option) (*DetectStackSetDriftOutput, error) { + req, out := c.DetectStackSetDriftRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opEstimateTemplateCost = "EstimateTemplateCost" // EstimateTemplateCostRequest generates a "aws/request.Request" representing the @@ -2821,10 +3211,12 @@ func (c *CloudFormation) ListExportsPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListExportsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListExportsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2957,10 +3349,12 @@ func (c *CloudFormation) ListImportsPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListImportsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListImportsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3171,10 +3565,12 @@ func (c *CloudFormation) ListStackResourcesPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStackResourcesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListStackResourcesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3541,734 +3937,1414 @@ func (c *CloudFormation) ListStacksPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStacksOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListStacksOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opSetStackPolicy = "SetStackPolicy" +const opListTypeRegistrations = "ListTypeRegistrations" -// SetStackPolicyRequest generates a "aws/request.Request" representing the -// client's request for the SetStackPolicy operation. The "output" return +// ListTypeRegistrationsRequest generates a "aws/request.Request" representing the +// client's request for the ListTypeRegistrations operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See SetStackPolicy for more information on using the SetStackPolicy +// See ListTypeRegistrations for more information on using the ListTypeRegistrations // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the SetStackPolicyRequest method. -// req, resp := client.SetStackPolicyRequest(params) +// // Example sending a request using the ListTypeRegistrationsRequest method. +// req, resp := client.ListTypeRegistrationsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetStackPolicy -func (c *CloudFormation) SetStackPolicyRequest(input *SetStackPolicyInput) (req *request.Request, output *SetStackPolicyOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListTypeRegistrations +func (c *CloudFormation) ListTypeRegistrationsRequest(input *ListTypeRegistrationsInput) (req *request.Request, output *ListTypeRegistrationsOutput) { op := &request.Operation{ - Name: opSetStackPolicy, + Name: opListTypeRegistrations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &SetStackPolicyInput{} + input = &ListTypeRegistrationsInput{} } - output = &SetStackPolicyOutput{} + output = &ListTypeRegistrationsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// SetStackPolicy API operation for AWS CloudFormation. +// ListTypeRegistrations API operation for AWS CloudFormation. // -// Sets a stack policy for a specified stack. +// Returns a list of registration tokens for the specified type(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 AWS CloudFormation's -// API operation SetStackPolicy for usage and error information. -// See also, 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) +// API operation ListTypeRegistrations for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListTypeRegistrations +func (c *CloudFormation) ListTypeRegistrations(input *ListTypeRegistrationsInput) (*ListTypeRegistrationsOutput, error) { + req, out := c.ListTypeRegistrationsRequest(input) return out, req.Send() } -// SetStackPolicyWithContext is the same as SetStackPolicy with the addition of +// ListTypeRegistrationsWithContext is the same as ListTypeRegistrations with the addition of // the ability to pass a context and additional request options. // -// See SetStackPolicy for details on how to use this API operation. +// See ListTypeRegistrations for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudFormation) SetStackPolicyWithContext(ctx aws.Context, input *SetStackPolicyInput, opts ...request.Option) (*SetStackPolicyOutput, error) { - req, out := c.SetStackPolicyRequest(input) +func (c *CloudFormation) ListTypeRegistrationsWithContext(ctx aws.Context, input *ListTypeRegistrationsInput, opts ...request.Option) (*ListTypeRegistrationsOutput, error) { + req, out := c.ListTypeRegistrationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opSignalResource = "SignalResource" +// ListTypeRegistrationsPages iterates over the pages of a ListTypeRegistrations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTypeRegistrations 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 ListTypeRegistrations operation. +// pageNum := 0 +// err := client.ListTypeRegistrationsPages(params, +// func(page *cloudformation.ListTypeRegistrationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CloudFormation) ListTypeRegistrationsPages(input *ListTypeRegistrationsInput, fn func(*ListTypeRegistrationsOutput, bool) bool) error { + return c.ListTypeRegistrationsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// SignalResourceRequest generates a "aws/request.Request" representing the -// client's request for the SignalResource operation. The "output" return +// ListTypeRegistrationsPagesWithContext same as ListTypeRegistrationsPages 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 *CloudFormation) ListTypeRegistrationsPagesWithContext(ctx aws.Context, input *ListTypeRegistrationsInput, fn func(*ListTypeRegistrationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTypeRegistrationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTypeRegistrationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTypeRegistrationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTypeVersions = "ListTypeVersions" + +// ListTypeVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListTypeVersions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See SignalResource for more information on using the SignalResource +// See ListTypeVersions for more information on using the ListTypeVersions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the SignalResourceRequest method. -// req, resp := client.SignalResourceRequest(params) +// // Example sending a request using the ListTypeVersionsRequest method. +// req, resp := client.ListTypeVersionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SignalResource -func (c *CloudFormation) SignalResourceRequest(input *SignalResourceInput) (req *request.Request, output *SignalResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListTypeVersions +func (c *CloudFormation) ListTypeVersionsRequest(input *ListTypeVersionsInput) (req *request.Request, output *ListTypeVersionsOutput) { op := &request.Operation{ - Name: opSignalResource, + Name: opListTypeVersions, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &SignalResourceInput{} + input = &ListTypeVersionsInput{} } - output = &SignalResourceOutput{} + output = &ListTypeVersionsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// SignalResource API operation for AWS CloudFormation. +// ListTypeVersions 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 summary information about the versions of a 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 AWS CloudFormation's -// API operation SignalResource for usage and error information. -// See also, 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) +// API operation ListTypeVersions for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListTypeVersions +func (c *CloudFormation) ListTypeVersions(input *ListTypeVersionsInput) (*ListTypeVersionsOutput, error) { + req, out := c.ListTypeVersionsRequest(input) return out, req.Send() } -// SignalResourceWithContext is the same as SignalResource with the addition of +// ListTypeVersionsWithContext is the same as ListTypeVersions with the addition of // the ability to pass a context and additional request options. // -// See SignalResource for details on how to use this API operation. +// See ListTypeVersions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudFormation) SignalResourceWithContext(ctx aws.Context, input *SignalResourceInput, opts ...request.Option) (*SignalResourceOutput, error) { - req, out := c.SignalResourceRequest(input) +func (c *CloudFormation) ListTypeVersionsWithContext(ctx aws.Context, input *ListTypeVersionsInput, opts ...request.Option) (*ListTypeVersionsOutput, error) { + req, out := c.ListTypeVersionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopStackSetOperation = "StopStackSetOperation" +// ListTypeVersionsPages iterates over the pages of a ListTypeVersions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTypeVersions 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 ListTypeVersions operation. +// pageNum := 0 +// err := client.ListTypeVersionsPages(params, +// func(page *cloudformation.ListTypeVersionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CloudFormation) ListTypeVersionsPages(input *ListTypeVersionsInput, fn func(*ListTypeVersionsOutput, bool) bool) error { + return c.ListTypeVersionsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// StopStackSetOperationRequest generates a "aws/request.Request" representing the -// client's request for the StopStackSetOperation operation. The "output" return +// ListTypeVersionsPagesWithContext same as ListTypeVersionsPages 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 *CloudFormation) ListTypeVersionsPagesWithContext(ctx aws.Context, input *ListTypeVersionsInput, fn func(*ListTypeVersionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTypeVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTypeVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTypeVersionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTypes = "ListTypes" + +// ListTypesRequest generates a "aws/request.Request" representing the +// client's request for the ListTypes operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopStackSetOperation for more information on using the StopStackSetOperation +// See ListTypes for more information on using the ListTypes // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopStackSetOperationRequest method. -// req, resp := client.StopStackSetOperationRequest(params) +// // Example sending a request using the ListTypesRequest method. +// req, resp := client.ListTypesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/StopStackSetOperation -func (c *CloudFormation) StopStackSetOperationRequest(input *StopStackSetOperationInput) (req *request.Request, output *StopStackSetOperationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListTypes +func (c *CloudFormation) ListTypesRequest(input *ListTypesInput) (req *request.Request, output *ListTypesOutput) { op := &request.Operation{ - Name: opStopStackSetOperation, + Name: opListTypes, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &StopStackSetOperationInput{} + input = &ListTypesInput{} } - output = &StopStackSetOperationOutput{} + output = &ListTypesOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// StopStackSetOperation API operation for AWS CloudFormation. +// ListTypes API operation for AWS CloudFormation. // -// Stops an in-progress operation on a stack set and its associated stack instances. +// Returns summary information about types that have been registered with CloudFormation. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 StopStackSetOperation for usage and error information. +// API operation ListTypes for usage and error information. // // Returned Error Codes: -// * ErrCodeStackSetNotFoundException "StackSetNotFoundException" -// The specified stack set doesn't exist. -// -// * ErrCodeOperationNotFoundException "OperationNotFoundException" -// The specified ID refers to an operation that doesn't exist. -// -// * ErrCodeInvalidOperationException "InvalidOperationException" -// The specified operation isn't valid. +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/StopStackSetOperation -func (c *CloudFormation) StopStackSetOperation(input *StopStackSetOperationInput) (*StopStackSetOperationOutput, error) { - req, out := c.StopStackSetOperationRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ListTypes +func (c *CloudFormation) ListTypes(input *ListTypesInput) (*ListTypesOutput, error) { + req, out := c.ListTypesRequest(input) return out, req.Send() } -// StopStackSetOperationWithContext is the same as StopStackSetOperation with the addition of +// ListTypesWithContext is the same as ListTypes with the addition of // the ability to pass a context and additional request options. // -// See StopStackSetOperation for details on how to use this API operation. +// See ListTypes for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudFormation) StopStackSetOperationWithContext(ctx aws.Context, input *StopStackSetOperationInput, opts ...request.Option) (*StopStackSetOperationOutput, error) { - req, out := c.StopStackSetOperationRequest(input) +func (c *CloudFormation) ListTypesWithContext(ctx aws.Context, input *ListTypesInput, opts ...request.Option) (*ListTypesOutput, error) { + req, out := c.ListTypesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateStack = "UpdateStack" +// ListTypesPages iterates over the pages of a ListTypes operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTypes 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 ListTypes operation. +// pageNum := 0 +// err := client.ListTypesPages(params, +// func(page *cloudformation.ListTypesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CloudFormation) ListTypesPages(input *ListTypesInput, fn func(*ListTypesOutput, bool) bool) error { + return c.ListTypesPagesWithContext(aws.BackgroundContext(), input, fn) +} -// UpdateStackRequest generates a "aws/request.Request" representing the -// client's request for the UpdateStack operation. The "output" return +// ListTypesPagesWithContext same as ListTypesPages 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 *CloudFormation) ListTypesPagesWithContext(ctx aws.Context, input *ListTypesInput, fn func(*ListTypesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTypesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTypesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTypesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opRecordHandlerProgress = "RecordHandlerProgress" + +// RecordHandlerProgressRequest generates a "aws/request.Request" representing the +// client's request for the RecordHandlerProgress operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateStack for more information on using the UpdateStack +// See RecordHandlerProgress for more information on using the RecordHandlerProgress // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateStackRequest method. -// req, resp := client.UpdateStackRequest(params) +// // Example sending a request using the RecordHandlerProgressRequest method. +// req, resp := client.RecordHandlerProgressRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStack -func (c *CloudFormation) UpdateStackRequest(input *UpdateStackInput) (req *request.Request, output *UpdateStackOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RecordHandlerProgress +func (c *CloudFormation) RecordHandlerProgressRequest(input *RecordHandlerProgressInput) (req *request.Request, output *RecordHandlerProgressOutput) { op := &request.Operation{ - Name: opUpdateStack, + Name: opRecordHandlerProgress, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateStackInput{} + input = &RecordHandlerProgressInput{} } - output = &UpdateStackOutput{} + output = &RecordHandlerProgressOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 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. +// RecordHandlerProgress API operation for AWS CloudFormation. // -// To get a copy of the template for an existing stack, you can use the GetTemplate -// action. +// Reports progress of a resource handler to CloudFormation. // -// For more information about creating an update template, updating a stack, -// and monitoring the progress of the update, see Updating a Stack (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks.html). +// Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). +// Do not use this API in your code. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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. +// API operation RecordHandlerProgress for usage and error information. // // Returned Error Codes: -// * ErrCodeInsufficientCapabilitiesException "InsufficientCapabilitiesException" -// The template contains resources with capabilities that weren't specified -// in the Capabilities parameter. +// * ErrCodeInvalidStateTransitionException "InvalidStateTransition" +// Error reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). +// CloudFormation does not return this error to users. // -// * ErrCodeTokenAlreadyExistsException "TokenAlreadyExistsException" -// A client request token already exists. +// * ErrCodeOperationStatusCheckFailedException "ConditionalCheckFailed" +// Error reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). +// CloudFormation does not return this error to users. // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RecordHandlerProgress +func (c *CloudFormation) RecordHandlerProgress(input *RecordHandlerProgressInput) (*RecordHandlerProgressOutput, error) { + req, out := c.RecordHandlerProgressRequest(input) return out, req.Send() } -// UpdateStackWithContext is the same as UpdateStack with the addition of +// RecordHandlerProgressWithContext is the same as RecordHandlerProgress with the addition of // the ability to pass a context and additional request options. // -// See UpdateStack for details on how to use this API operation. +// See RecordHandlerProgress for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudFormation) UpdateStackWithContext(ctx aws.Context, input *UpdateStackInput, opts ...request.Option) (*UpdateStackOutput, error) { - req, out := c.UpdateStackRequest(input) +func (c *CloudFormation) RecordHandlerProgressWithContext(ctx aws.Context, input *RecordHandlerProgressInput, opts ...request.Option) (*RecordHandlerProgressOutput, error) { + req, out := c.RecordHandlerProgressRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateStackInstances = "UpdateStackInstances" +const opRegisterType = "RegisterType" -// UpdateStackInstancesRequest generates a "aws/request.Request" representing the -// client's request for the UpdateStackInstances operation. The "output" return +// RegisterTypeRequest generates a "aws/request.Request" representing the +// client's request for the RegisterType operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateStackInstances for more information on using the UpdateStackInstances +// See RegisterType for more information on using the RegisterType // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateStackInstancesRequest method. -// req, resp := client.UpdateStackInstancesRequest(params) +// // Example sending a request using the RegisterTypeRequest method. +// req, resp := client.RegisterTypeRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackInstances -func (c *CloudFormation) UpdateStackInstancesRequest(input *UpdateStackInstancesInput) (req *request.Request, output *UpdateStackInstancesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RegisterType +func (c *CloudFormation) RegisterTypeRequest(input *RegisterTypeInput) (req *request.Request, output *RegisterTypeOutput) { op := &request.Operation{ - Name: opUpdateStackInstances, + Name: opRegisterType, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateStackInstancesInput{} + input = &RegisterTypeInput{} } - output = &UpdateStackInstancesOutput{} + output = &RegisterTypeOutput{} req = c.newRequest(op, input, output) return } -// UpdateStackInstances API operation for AWS CloudFormation. +// RegisterType API operation for AWS CloudFormation. // -// Updates the parameter values for stack instances for the specified accounts, -// within the specified regions. A stack instance refers to a stack in a specific -// account and region. +// Registers a type with the CloudFormation service. Registering a type makes +// it available for use in CloudFormation templates in your AWS account, and +// includes: // -// You can only update stack instances in regions and accounts where they already -// exist; to create additional stack instances, use CreateStackInstances (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStackInstances.html). +// * Validating the resource schema // -// During stack set updates, any parameters overridden for a stack instance -// are not updated, but retain their overridden value. +// * Determining which handlers have been specified for the resource // -// You can only update the parameter values that are specified in the stack -// set; to add or delete a parameter itself, use UpdateStackSet (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html) -// to update the stack set template. If you add a parameter to a template, before -// you can override the parameter value specified in the stack set you must -// first use UpdateStackSet (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html) -// to update all stack instances with the updated template and parameter value -// specified in the stack set. Once a stack instance has been updated with the -// new parameter, you can then override the parameter value using UpdateStackInstances. +// * Making the resource type available for use in your account +// +// For more information on how to develop types and ready them for registeration, +// see Creating Resource Providers (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-types.html) +// in the CloudFormation CLI User Guide. +// +// Once you have initiated a registration request using RegisterType , you can +// use DescribeTypeRegistration to monitor the progress of the registration +// 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 UpdateStackInstances for usage and error information. +// API operation RegisterType for usage and error information. // // Returned Error Codes: -// * ErrCodeStackSetNotFoundException "StackSetNotFoundException" -// The specified stack set doesn't exist. -// -// * ErrCodeStackInstanceNotFoundException "StackInstanceNotFoundException" -// The specified stack instance doesn't exist. -// -// * ErrCodeOperationInProgressException "OperationInProgressException" -// Another operation is currently in progress for this stack set. Only one operation -// can be performed for a stack set at a given time. -// -// * ErrCodeOperationIdAlreadyExistsException "OperationIdAlreadyExistsException" -// The specified operation ID already exists. -// -// * ErrCodeStaleRequestException "StaleRequestException" -// Another operation has been performed on this stack set since the specified -// operation was performed. -// -// * ErrCodeInvalidOperationException "InvalidOperationException" -// The specified operation isn't valid. +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackInstances -func (c *CloudFormation) UpdateStackInstances(input *UpdateStackInstancesInput) (*UpdateStackInstancesOutput, error) { - req, out := c.UpdateStackInstancesRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/RegisterType +func (c *CloudFormation) RegisterType(input *RegisterTypeInput) (*RegisterTypeOutput, error) { + req, out := c.RegisterTypeRequest(input) return out, req.Send() } -// UpdateStackInstancesWithContext is the same as UpdateStackInstances with the addition of +// RegisterTypeWithContext is the same as RegisterType with the addition of // the ability to pass a context and additional request options. // -// See UpdateStackInstances for details on how to use this API operation. +// See RegisterType for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudFormation) UpdateStackInstancesWithContext(ctx aws.Context, input *UpdateStackInstancesInput, opts ...request.Option) (*UpdateStackInstancesOutput, error) { - req, out := c.UpdateStackInstancesRequest(input) +func (c *CloudFormation) RegisterTypeWithContext(ctx aws.Context, input *RegisterTypeInput, opts ...request.Option) (*RegisterTypeOutput, error) { + req, out := c.RegisterTypeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateStackSet = "UpdateStackSet" +const opSetStackPolicy = "SetStackPolicy" -// UpdateStackSetRequest generates a "aws/request.Request" representing the -// client's request for the UpdateStackSet operation. The "output" return +// SetStackPolicyRequest generates a "aws/request.Request" representing the +// client's request for the SetStackPolicy operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateStackSet for more information on using the UpdateStackSet +// See SetStackPolicy for more information on using the SetStackPolicy // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateStackSetRequest method. -// req, resp := client.UpdateStackSetRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackSet -func (c *CloudFormation) UpdateStackSetRequest(input *UpdateStackSetInput) (req *request.Request, output *UpdateStackSetOutput) { +// See also, 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: opUpdateStackSet, + Name: opSetStackPolicy, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateStackSetInput{} + input = &SetStackPolicyInput{} } - output = &UpdateStackSetOutput{} + output = &SetStackPolicyOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateStackSet API operation for AWS CloudFormation. -// -// Updates the stack set, and associated stack instances in the specified accounts -// and regions. +// SetStackPolicy API operation for AWS CloudFormation. // -// Even if the stack set operation created by updating the stack set fails (completely -// or partially, below or above a specified failure tolerance), the stack set -// is updated with your changes. Subsequent CreateStackInstances calls on the -// specified stack set use the updated stack set. +// 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 UpdateStackSet for usage and error information. -// -// Returned Error Codes: -// * ErrCodeStackSetNotFoundException "StackSetNotFoundException" -// The specified stack set doesn't exist. -// -// * ErrCodeOperationInProgressException "OperationInProgressException" -// Another operation is currently in progress for this stack set. Only one operation -// can be performed for a stack set at a given time. -// -// * ErrCodeOperationIdAlreadyExistsException "OperationIdAlreadyExistsException" -// The specified operation ID already exists. -// -// * ErrCodeStaleRequestException "StaleRequestException" -// Another operation has been performed on this stack set since the specified -// operation was performed. -// -// * ErrCodeInvalidOperationException "InvalidOperationException" -// The specified operation isn't valid. -// -// * ErrCodeStackInstanceNotFoundException "StackInstanceNotFoundException" -// The specified stack instance doesn't exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackSet -func (c *CloudFormation) UpdateStackSet(input *UpdateStackSetInput) (*UpdateStackSetOutput, error) { - req, out := c.UpdateStackSetRequest(input) +// API operation SetStackPolicy for usage and error information. +// See also, 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) return out, req.Send() } -// UpdateStackSetWithContext is the same as UpdateStackSet with the addition of +// SetStackPolicyWithContext is the same as SetStackPolicy with the addition of // the ability to pass a context and additional request options. // -// See UpdateStackSet for details on how to use this API operation. +// See SetStackPolicy for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudFormation) UpdateStackSetWithContext(ctx aws.Context, input *UpdateStackSetInput, opts ...request.Option) (*UpdateStackSetOutput, error) { - req, out := c.UpdateStackSetRequest(input) +func (c *CloudFormation) SetStackPolicyWithContext(ctx aws.Context, input *SetStackPolicyInput, opts ...request.Option) (*SetStackPolicyOutput, error) { + req, out := c.SetStackPolicyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateTerminationProtection = "UpdateTerminationProtection" +const opSetTypeDefaultVersion = "SetTypeDefaultVersion" -// UpdateTerminationProtectionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTerminationProtection operation. The "output" return +// SetTypeDefaultVersionRequest generates a "aws/request.Request" representing the +// client's request for the SetTypeDefaultVersion operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateTerminationProtection for more information on using the UpdateTerminationProtection +// See SetTypeDefaultVersion for more information on using the SetTypeDefaultVersion // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateTerminationProtectionRequest method. -// req, resp := client.UpdateTerminationProtectionRequest(params) +// // Example sending a request using the SetTypeDefaultVersionRequest method. +// req, resp := client.SetTypeDefaultVersionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateTerminationProtection -func (c *CloudFormation) UpdateTerminationProtectionRequest(input *UpdateTerminationProtectionInput) (req *request.Request, output *UpdateTerminationProtectionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetTypeDefaultVersion +func (c *CloudFormation) SetTypeDefaultVersionRequest(input *SetTypeDefaultVersionInput) (req *request.Request, output *SetTypeDefaultVersionOutput) { op := &request.Operation{ - Name: opUpdateTerminationProtection, + Name: opSetTypeDefaultVersion, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateTerminationProtectionInput{} + input = &SetTypeDefaultVersionInput{} } - output = &UpdateTerminationProtectionOutput{} + output = &SetTypeDefaultVersionOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateTerminationProtection API operation for AWS CloudFormation. -// -// Updates termination protection for the specified stack. If a user attempts -// to delete a stack with termination protection enabled, the operation fails -// and the stack remains unchanged. For more information, see Protecting a Stack -// From Being Deleted (AWSCloudFormation/latest/UserGuide/using-cfn-protect-stacks.html) -// in the AWS CloudFormation User Guide. +// SetTypeDefaultVersion API operation for AWS CloudFormation. // -// For nested stacks (AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html), -// termination protection is set on the root stack and cannot be changed directly -// on the nested stack. +// Specify the default version of a type. The default version of a type will +// be used in CloudFormation 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 AWS CloudFormation's -// API operation UpdateTerminationProtection for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateTerminationProtection -func (c *CloudFormation) UpdateTerminationProtection(input *UpdateTerminationProtectionInput) (*UpdateTerminationProtectionOutput, error) { - req, out := c.UpdateTerminationProtectionRequest(input) +// API operation SetTypeDefaultVersion for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCFNRegistryException "CFNRegistryException" +// An error occurred during a CloudFormation registry operation. +// +// * ErrCodeTypeNotFoundException "TypeNotFoundException" +// The specified type does not exist in the CloudFormation registry. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/SetTypeDefaultVersion +func (c *CloudFormation) SetTypeDefaultVersion(input *SetTypeDefaultVersionInput) (*SetTypeDefaultVersionOutput, error) { + req, out := c.SetTypeDefaultVersionRequest(input) return out, req.Send() } -// UpdateTerminationProtectionWithContext is the same as UpdateTerminationProtection with the addition of +// SetTypeDefaultVersionWithContext is the same as SetTypeDefaultVersion with the addition of // the ability to pass a context and additional request options. // -// See UpdateTerminationProtection for details on how to use this API operation. +// See SetTypeDefaultVersion for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudFormation) UpdateTerminationProtectionWithContext(ctx aws.Context, input *UpdateTerminationProtectionInput, opts ...request.Option) (*UpdateTerminationProtectionOutput, error) { - req, out := c.UpdateTerminationProtectionRequest(input) +func (c *CloudFormation) SetTypeDefaultVersionWithContext(ctx aws.Context, input *SetTypeDefaultVersionInput, opts ...request.Option) (*SetTypeDefaultVersionOutput, error) { + req, out := c.SetTypeDefaultVersionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opValidateTemplate = "ValidateTemplate" +const opSignalResource = "SignalResource" -// ValidateTemplateRequest generates a "aws/request.Request" representing the -// client's request for the ValidateTemplate operation. The "output" return +// SignalResourceRequest generates a "aws/request.Request" representing the +// client's request for the SignalResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ValidateTemplate for more information on using the ValidateTemplate +// See SignalResource for more information on using the SignalResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ValidateTemplateRequest method. -// req, resp := client.ValidateTemplateRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/ValidateTemplate -func (c *CloudFormation) ValidateTemplateRequest(input *ValidateTemplateInput) (req *request.Request, output *ValidateTemplateOutput) { +// See also, 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: opValidateTemplate, + Name: opSignalResource, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ValidateTemplateInput{} + input = &SignalResourceInput{} } - output = &ValidateTemplateOutput{} + output = &SignalResourceOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ValidateTemplate API operation for AWS CloudFormation. +// SignalResource 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. +// 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 ValidateTemplate for usage and error information. -// See also, 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) +// API operation SignalResource for usage and error information. +// See also, 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) return out, req.Send() } -// ValidateTemplateWithContext is the same as ValidateTemplate with the addition of +// SignalResourceWithContext is the same as SignalResource with the addition of // the ability to pass a context and additional request options. // -// See ValidateTemplate for details on how to use this API operation. +// See SignalResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudFormation) ValidateTemplateWithContext(ctx aws.Context, input *ValidateTemplateInput, opts ...request.Option) (*ValidateTemplateOutput, error) { - req, out := c.ValidateTemplateRequest(input) +func (c *CloudFormation) SignalResourceWithContext(ctx aws.Context, input *SignalResourceInput, opts ...request.Option) (*SignalResourceOutput, error) { + req, out := c.SignalResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// Structure that contains the results of the account gate function which AWS -// CloudFormation invokes, if present, before proceeding with a stack set operation -// in an account and region. +const opStopStackSetOperation = "StopStackSetOperation" + +// StopStackSetOperationRequest generates a "aws/request.Request" representing the +// client's request for the StopStackSetOperation operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. // -// For each account and region, AWS CloudFormation lets you specify a Lamdba -// function that encapsulates any requirements that must be met before CloudFormation -// can proceed with a stack set operation in that account and region. CloudFormation -// invokes the function each time a stack set operation is requested for that -// account and region; if the function returns FAILED, CloudFormation cancels -// the operation in that account and region, and sets the stack set operation -// result status for that account and region to FAILED. +// 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. // -// For more information, see Configuring a target account gate (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-account-gating.html). -type AccountGateResult struct { - _ struct{} `type:"structure"` +// See StopStackSetOperation for more information on using the StopStackSetOperation +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopStackSetOperationRequest method. +// req, resp := client.StopStackSetOperationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/StopStackSetOperation +func (c *CloudFormation) StopStackSetOperationRequest(input *StopStackSetOperationInput) (req *request.Request, output *StopStackSetOperationOutput) { + op := &request.Operation{ + Name: opStopStackSetOperation, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StopStackSetOperationInput{} + } + + output = &StopStackSetOperationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StopStackSetOperation API operation for AWS CloudFormation. +// +// Stops an in-progress operation on a stack set and its associated stack 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 CloudFormation's +// API operation StopStackSetOperation for usage and error information. +// +// Returned Error Codes: +// * ErrCodeStackSetNotFoundException "StackSetNotFoundException" +// The specified stack set doesn't exist. +// +// * ErrCodeOperationNotFoundException "OperationNotFoundException" +// The specified ID refers to an operation that doesn't exist. +// +// * ErrCodeInvalidOperationException "InvalidOperationException" +// The specified operation isn't valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/StopStackSetOperation +func (c *CloudFormation) StopStackSetOperation(input *StopStackSetOperationInput) (*StopStackSetOperationOutput, error) { + req, out := c.StopStackSetOperationRequest(input) + return out, req.Send() +} + +// StopStackSetOperationWithContext is the same as StopStackSetOperation with the addition of +// the ability to pass a context and additional request options. +// +// See StopStackSetOperation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudFormation) StopStackSetOperationWithContext(ctx aws.Context, input *StopStackSetOperationInput, opts ...request.Option) (*StopStackSetOperationOutput, error) { + req, out := c.StopStackSetOperationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateStack = "UpdateStack" + +// UpdateStackRequest generates a "aws/request.Request" representing the +// client's request for the UpdateStack operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateStack for more information on using the UpdateStack +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateStackRequest method. +// req, resp := client.UpdateStackRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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 (https://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 weren't specified +// in the Capabilities parameter. +// +// * ErrCodeTokenAlreadyExistsException "TokenAlreadyExistsException" +// A client request token already exists. +// +// See also, 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) + return out, req.Send() +} + +// UpdateStackWithContext is the same as UpdateStack with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateStack for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudFormation) UpdateStackWithContext(ctx aws.Context, input *UpdateStackInput, opts ...request.Option) (*UpdateStackOutput, error) { + req, out := c.UpdateStackRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateStackInstances = "UpdateStackInstances" + +// UpdateStackInstancesRequest generates a "aws/request.Request" representing the +// client's request for the UpdateStackInstances operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateStackInstances for more information on using the UpdateStackInstances +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateStackInstancesRequest method. +// req, resp := client.UpdateStackInstancesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackInstances +func (c *CloudFormation) UpdateStackInstancesRequest(input *UpdateStackInstancesInput) (req *request.Request, output *UpdateStackInstancesOutput) { + op := &request.Operation{ + Name: opUpdateStackInstances, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateStackInstancesInput{} + } + + output = &UpdateStackInstancesOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateStackInstances API operation for AWS CloudFormation. +// +// Updates the parameter values for stack instances for the specified accounts, +// within the specified regions. A stack instance refers to a stack in a specific +// account and region. +// +// You can only update stack instances in regions and accounts where they already +// exist; to create additional stack instances, use CreateStackInstances (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStackInstances.html). +// +// During stack set updates, any parameters overridden for a stack instance +// are not updated, but retain their overridden value. +// +// You can only update the parameter values that are specified in the stack +// set; to add or delete a parameter itself, use UpdateStackSet (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html) +// to update the stack set template. If you add a parameter to a template, before +// you can override the parameter value specified in the stack set you must +// first use UpdateStackSet (https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_UpdateStackSet.html) +// to update all stack instances with the updated template and parameter value +// specified in the stack set. Once a stack instance has been updated with the +// new parameter, you can then override the parameter value using UpdateStackInstances. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 UpdateStackInstances for usage and error information. +// +// Returned Error Codes: +// * ErrCodeStackSetNotFoundException "StackSetNotFoundException" +// The specified stack set doesn't exist. +// +// * ErrCodeStackInstanceNotFoundException "StackInstanceNotFoundException" +// The specified stack instance doesn't exist. +// +// * ErrCodeOperationInProgressException "OperationInProgressException" +// Another operation is currently in progress for this stack set. Only one operation +// can be performed for a stack set at a given time. +// +// * ErrCodeOperationIdAlreadyExistsException "OperationIdAlreadyExistsException" +// The specified operation ID already exists. +// +// * ErrCodeStaleRequestException "StaleRequestException" +// Another operation has been performed on this stack set since the specified +// operation was performed. +// +// * ErrCodeInvalidOperationException "InvalidOperationException" +// The specified operation isn't valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackInstances +func (c *CloudFormation) UpdateStackInstances(input *UpdateStackInstancesInput) (*UpdateStackInstancesOutput, error) { + req, out := c.UpdateStackInstancesRequest(input) + return out, req.Send() +} + +// UpdateStackInstancesWithContext is the same as UpdateStackInstances with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateStackInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudFormation) UpdateStackInstancesWithContext(ctx aws.Context, input *UpdateStackInstancesInput, opts ...request.Option) (*UpdateStackInstancesOutput, error) { + req, out := c.UpdateStackInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateStackSet = "UpdateStackSet" + +// UpdateStackSetRequest generates a "aws/request.Request" representing the +// client's request for the UpdateStackSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateStackSet for more information on using the UpdateStackSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateStackSetRequest method. +// req, resp := client.UpdateStackSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackSet +func (c *CloudFormation) UpdateStackSetRequest(input *UpdateStackSetInput) (req *request.Request, output *UpdateStackSetOutput) { + op := &request.Operation{ + Name: opUpdateStackSet, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateStackSetInput{} + } + + output = &UpdateStackSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateStackSet API operation for AWS CloudFormation. +// +// Updates the stack set, and associated stack instances in the specified accounts +// and regions. +// +// Even if the stack set operation created by updating the stack set fails (completely +// or partially, below or above a specified failure tolerance), the stack set +// is updated with your changes. Subsequent CreateStackInstances calls on the +// specified stack set use the updated stack 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 UpdateStackSet for usage and error information. +// +// Returned Error Codes: +// * ErrCodeStackSetNotFoundException "StackSetNotFoundException" +// The specified stack set doesn't exist. +// +// * ErrCodeOperationInProgressException "OperationInProgressException" +// Another operation is currently in progress for this stack set. Only one operation +// can be performed for a stack set at a given time. +// +// * ErrCodeOperationIdAlreadyExistsException "OperationIdAlreadyExistsException" +// The specified operation ID already exists. +// +// * ErrCodeStaleRequestException "StaleRequestException" +// Another operation has been performed on this stack set since the specified +// operation was performed. +// +// * ErrCodeInvalidOperationException "InvalidOperationException" +// The specified operation isn't valid. +// +// * ErrCodeStackInstanceNotFoundException "StackInstanceNotFoundException" +// The specified stack instance doesn't exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateStackSet +func (c *CloudFormation) UpdateStackSet(input *UpdateStackSetInput) (*UpdateStackSetOutput, error) { + req, out := c.UpdateStackSetRequest(input) + return out, req.Send() +} + +// UpdateStackSetWithContext is the same as UpdateStackSet with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateStackSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudFormation) UpdateStackSetWithContext(ctx aws.Context, input *UpdateStackSetInput, opts ...request.Option) (*UpdateStackSetOutput, error) { + req, out := c.UpdateStackSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateTerminationProtection = "UpdateTerminationProtection" + +// UpdateTerminationProtectionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateTerminationProtection operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateTerminationProtection for more information on using the UpdateTerminationProtection +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateTerminationProtectionRequest method. +// req, resp := client.UpdateTerminationProtectionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateTerminationProtection +func (c *CloudFormation) UpdateTerminationProtectionRequest(input *UpdateTerminationProtectionInput) (req *request.Request, output *UpdateTerminationProtectionOutput) { + op := &request.Operation{ + Name: opUpdateTerminationProtection, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateTerminationProtectionInput{} + } + + output = &UpdateTerminationProtectionOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateTerminationProtection API operation for AWS CloudFormation. +// +// Updates termination protection for the specified stack. If a user attempts +// to delete a stack with termination protection enabled, the operation fails +// and the stack remains unchanged. For more information, see Protecting a Stack +// From Being Deleted (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-protect-stacks.html) +// in the AWS CloudFormation User Guide. +// +// For nested stacks (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html), +// termination protection is set on the root stack and cannot be changed directly +// on the nested 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 UpdateTerminationProtection for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudformation-2010-05-15/UpdateTerminationProtection +func (c *CloudFormation) UpdateTerminationProtection(input *UpdateTerminationProtectionInput) (*UpdateTerminationProtectionOutput, error) { + req, out := c.UpdateTerminationProtectionRequest(input) + return out, req.Send() +} + +// UpdateTerminationProtectionWithContext is the same as UpdateTerminationProtection with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTerminationProtection for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudFormation) UpdateTerminationProtectionWithContext(ctx aws.Context, input *UpdateTerminationProtectionInput, opts ...request.Option) (*UpdateTerminationProtectionOutput, error) { + req, out := c.UpdateTerminationProtectionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opValidateTemplate = "ValidateTemplate" + +// ValidateTemplateRequest generates a "aws/request.Request" representing the +// client's request for the ValidateTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ValidateTemplate for more information on using the ValidateTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ValidateTemplateRequest method. +// req, resp := client.ValidateTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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. +// See also, 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) + return out, req.Send() +} + +// ValidateTemplateWithContext is the same as ValidateTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See ValidateTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudFormation) ValidateTemplateWithContext(ctx aws.Context, input *ValidateTemplateInput, opts ...request.Option) (*ValidateTemplateOutput, error) { + req, out := c.ValidateTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Structure that contains the results of the account gate function which AWS +// CloudFormation invokes, if present, before proceeding with a stack set operation +// in an account and region. +// +// For each account and region, AWS CloudFormation lets you specify a Lamdba +// function that encapsulates any requirements that must be met before CloudFormation +// can proceed with a stack set operation in that account and region. CloudFormation +// invokes the function each time a stack set operation is requested for that +// account and region; if the function returns FAILED, CloudFormation cancels +// the operation in that account and region, and sets the stack set operation +// result status for that account and region to FAILED. +// +// For more information, see Configuring a target account gate (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-account-gating.html). +type AccountGateResult struct { + _ struct{} `type:"structure"` // The status of the account gate function. // @@ -4321,13 +5397,25 @@ func (s *AccountGateResult) SetStatusReason(v string) *AccountGateResult { return s } -// The AccountLimit data type. For more information about account limits, see -// AWS CloudFormation Limits (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) +// The AccountLimit data type. +// +// CloudFormation has the following limits per account: +// +// * Number of concurrent resources +// +// * Number of stacks +// +// * Number of stack outputs +// +// For more information about these account limits, and other CloudFormation +// limits, see AWS CloudFormation Limits (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/cloudformation-limits.html) // in the AWS CloudFormation User Guide. type AccountLimit struct { _ struct{} `type:"structure"` // The name of the account limit. + // + // Values: ConcurrentResourcesLimit | StackLimit | StackOutputsLimit Name *string `type:"string"` // The value that is associated with the account limit name. @@ -4356,6 +5444,47 @@ func (s *AccountLimit) SetValue(v int64) *AccountLimit { return s } +// [Service-managed permissions] Describes whether StackSets automatically deploys +// to AWS Organizations accounts that are added to a target organization or +// organizational unit (OU). +type AutoDeployment struct { + _ struct{} `type:"structure"` + + // If set to true, StackSets automatically deploys additional stack instances + // to AWS Organizations accounts that are added to a target organization or + // organizational unit (OU) in the specified Regions. If an account is removed + // from a target organization or OU, StackSets deletes stack instances from + // the account in the specified Regions. + Enabled *bool `type:"boolean"` + + // If set to true, stack resources are retained when an account is removed from + // a target organization or OU. If set to false, stack resources are deleted. + // Specify only if Enabled is set to True. + RetainStacksOnAccountRemoval *bool `type:"boolean"` +} + +// String returns the string representation +func (s AutoDeployment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoDeployment) GoString() string { + return s.String() +} + +// SetEnabled sets the Enabled field's value. +func (s *AutoDeployment) SetEnabled(v bool) *AutoDeployment { + s.Enabled = &v + return s +} + +// SetRetainStacksOnAccountRemoval sets the RetainStacksOnAccountRemoval field's value. +func (s *AutoDeployment) SetRetainStacksOnAccountRemoval(v bool) *AutoDeployment { + s.RetainStacksOnAccountRemoval = &v + return s +} + // The input for the CancelUpdateStack action. type CancelUpdateStackInput struct { _ struct{} `type:"structure"` @@ -4709,7 +5838,7 @@ func (s ContinueUpdateRollbackOutput) GoString() string { type CreateChangeSetInput struct { _ struct{} `type:"structure"` - // In some cases, you must explicity acknowledge that your stack template contains + // In some cases, you must explicitly acknowledge that your stack template contains // certain capabilities in order for AWS CloudFormation to create the stack. // // * CAPABILITY_IAM and CAPABILITY_NAMED_IAM Some stack templates might include @@ -4765,6 +5894,7 @@ type CreateChangeSetInput struct { // 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. + // To create a change set for an import operation, specify IMPORT. // // 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 @@ -4807,6 +5937,9 @@ type CreateChangeSetInput struct { // in the AWS CloudFormation User Guide. ResourceTypes []*string `type:"list"` + // The resources to import into your stack. + ResourcesToImport []*ResourceToImport `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 @@ -4897,6 +6030,16 @@ func (s *CreateChangeSetInput) Validate() error { if s.TemplateURL != nil && len(*s.TemplateURL) < 1 { invalidParams.Add(request.NewErrParamMinLen("TemplateURL", 1)) } + if s.ResourcesToImport != nil { + for i, v := range s.ResourcesToImport { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourcesToImport", i), err.(request.ErrInvalidParams)) + } + } + } if s.RollbackConfiguration != nil { if err := s.RollbackConfiguration.Validate(); err != nil { invalidParams.AddNested("RollbackConfiguration", err.(request.ErrInvalidParams)) @@ -4967,6 +6110,12 @@ func (s *CreateChangeSetInput) SetResourceTypes(v []*string) *CreateChangeSetInp return s } +// SetResourcesToImport sets the ResourcesToImport field's value. +func (s *CreateChangeSetInput) SetResourcesToImport(v []*ResourceToImport) *CreateChangeSetInput { + s.ResourcesToImport = v + return s +} + // SetRoleARN sets the RoleARN field's value. func (s *CreateChangeSetInput) SetRoleARN(v string) *CreateChangeSetInput { s.RoleARN = &v @@ -5046,7 +6195,7 @@ func (s *CreateChangeSetOutput) SetStackId(v string) *CreateChangeSetOutput { type CreateStackInput struct { _ struct{} `type:"structure"` - // In some cases, you must explicity acknowledge that your stack template contains + // In some cases, you must explicitly acknowledge that your stack template contains // certain capabilities in order for AWS CloudFormation to create the stack. // // * CAPABILITY_IAM and CAPABILITY_NAMED_IAM Some stack templates might include @@ -5392,11 +6541,17 @@ func (s *CreateStackInput) SetTimeoutInMinutes(v int64) *CreateStackInput { type CreateStackInstancesInput struct { _ struct{} `type:"structure"` - // The names of one or more AWS accounts that you want to create stack instances - // in the specified region(s) for. + // [Self-managed permissions] The names of one or more AWS accounts that you + // want to create stack instances in the specified region(s) for. // - // Accounts is a required field - Accounts []*string `type:"list" required:"true"` + // You can specify Accounts or DeploymentTargets, but not both. + Accounts []*string `type:"list"` + + // [Service-managed permissions] The AWS Organizations accounts for which to + // create stack instances in the specified Regions. + // + // You can specify Accounts or DeploymentTargets, but not both. + DeploymentTargets *DeploymentTargets `type:"structure"` // The unique identifier for this stack set operation. // @@ -5470,9 +6625,6 @@ func (s CreateStackInstancesInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *CreateStackInstancesInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "CreateStackInstancesInput"} - if s.Accounts == nil { - invalidParams.Add(request.NewErrParamRequired("Accounts")) - } if s.OperationId != nil && len(*s.OperationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) } @@ -5500,6 +6652,12 @@ func (s *CreateStackInstancesInput) SetAccounts(v []*string) *CreateStackInstanc return s } +// SetDeploymentTargets sets the DeploymentTargets field's value. +func (s *CreateStackInstancesInput) SetDeploymentTargets(v *DeploymentTargets) *CreateStackInstancesInput { + s.DeploymentTargets = v + return s +} + // SetOperationId sets the OperationId field's value. func (s *CreateStackInstancesInput) SetOperationId(v string) *CreateStackInstancesInput { s.OperationId = &v @@ -5590,7 +6748,14 @@ type CreateStackSetInput struct { // in the AWS CloudFormation User Guide. AdministrationRoleARN *string `min:"20" type:"string"` - // In some cases, you must explicity acknowledge that your stack set template + // Describes whether StackSets automatically deploys to AWS Organizations accounts + // that are added to the target organization or organizational unit (OU). Specify + // only if PermissionModel is SERVICE_MANAGED. + // + // If you specify AutoDeployment, do not specify DeploymentTargets or Regions. + AutoDeployment *AutoDeployment `type:"structure"` + + // In some cases, you must explicitly acknowledge that your stack set template // contains certain capabilities in order for AWS CloudFormation to create the // stack set and related stack instances. // @@ -5653,6 +6818,19 @@ type CreateStackSetInput struct { // The input parameters for the stack set template. Parameters []*Parameter `type:"list"` + // Describes how the IAM roles required for stack set operations are created. + // By default, SELF-MANAGED is specified. + // + // * With self-managed permissions, you must create the administrator and + // execution roles required to deploy to target accounts. For more information, + // see Grant Self-Managed Stack Set Permissions (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html). + // + // * With service-managed permissions, StackSets automatically creates the + // IAM roles required to deploy to accounts managed by AWS Organizations. + // For more information, see Grant Service-Managed Stack Set Permissions + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-service-managed.html). + PermissionModel *string `type:"string" enum:"PermissionModels"` + // The name to associate with the stack set. The name must be unique in the // region where you create your stack set. // @@ -5749,6 +6927,12 @@ func (s *CreateStackSetInput) SetAdministrationRoleARN(v string) *CreateStackSet return s } +// SetAutoDeployment sets the AutoDeployment field's value. +func (s *CreateStackSetInput) SetAutoDeployment(v *AutoDeployment) *CreateStackSetInput { + s.AutoDeployment = v + return s +} + // SetCapabilities sets the Capabilities field's value. func (s *CreateStackSetInput) SetCapabilities(v []*string) *CreateStackSetInput { s.Capabilities = v @@ -5779,6 +6963,12 @@ func (s *CreateStackSetInput) SetParameters(v []*Parameter) *CreateStackSetInput return s } +// SetPermissionModel sets the PermissionModel field's value. +func (s *CreateStackSetInput) SetPermissionModel(v string) *CreateStackSetInput { + s.PermissionModel = &v + return s +} + // SetStackSetName sets the StackSetName field's value. func (s *CreateStackSetInput) SetStackSetName(v string) *CreateStackSetInput { s.StackSetName = &v @@ -5997,10 +7187,17 @@ func (s *DeleteStackInput) SetStackName(v string) *DeleteStackInput { type DeleteStackInstancesInput struct { _ struct{} `type:"structure"` - // The names of the AWS accounts that you want to delete stack instances for. + // [Self-managed permissions] The names of the AWS accounts that you want to + // delete stack instances for. + // + // You can specify Accounts or DeploymentTargets, but not both. + Accounts []*string `type:"list"` + + // [Service-managed permissions] The AWS Organizations accounts from which to + // delete stack instances. // - // Accounts is a required field - Accounts []*string `type:"list" required:"true"` + // You can specify Accounts or DeploymentTargets, but not both. + DeploymentTargets *DeploymentTargets `type:"structure"` // The unique identifier for this stack set operation. // @@ -6052,9 +7249,6 @@ func (s DeleteStackInstancesInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *DeleteStackInstancesInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "DeleteStackInstancesInput"} - if s.Accounts == nil { - invalidParams.Add(request.NewErrParamRequired("Accounts")) - } if s.OperationId != nil && len(*s.OperationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) } @@ -6085,6 +7279,12 @@ func (s *DeleteStackInstancesInput) SetAccounts(v []*string) *DeleteStackInstanc return s } +// SetDeploymentTargets sets the DeploymentTargets field's value. +func (s *DeleteStackInstancesInput) SetDeploymentTargets(v *DeploymentTargets) *DeleteStackInstancesInput { + s.DeploymentTargets = v + return s +} + // SetOperationId sets the OperationId field's value. func (s *DeleteStackInstancesInput) SetOperationId(v string) *DeleteStackInstancesInput { s.OperationId = &v @@ -6123,60 +7323,171 @@ type DeleteStackInstancesOutput struct { } // String returns the string representation -func (s DeleteStackInstancesOutput) String() string { +func (s DeleteStackInstancesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteStackInstancesOutput) GoString() string { + return s.String() +} + +// SetOperationId sets the OperationId field's value. +func (s *DeleteStackInstancesOutput) SetOperationId(v string) *DeleteStackInstancesOutput { + s.OperationId = &v + return s +} + +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() +} + +type DeleteStackSetInput struct { + _ struct{} `type:"structure"` + + // The name or unique ID of the stack set that you're deleting. You can obtain + // this value by running ListStackSets. + // + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteStackSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteStackSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteStackSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteStackSetInput"} + if s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetStackSetName sets the StackSetName field's value. +func (s *DeleteStackSetInput) SetStackSetName(v string) *DeleteStackSetInput { + s.StackSetName = &v + return s +} + +type DeleteStackSetOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteStackSetOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteStackInstancesOutput) GoString() string { +func (s DeleteStackSetOutput) GoString() string { return s.String() } -// SetOperationId sets the OperationId field's value. -func (s *DeleteStackInstancesOutput) SetOperationId(v string) *DeleteStackInstancesOutput { - s.OperationId = &v - return s -} - -type DeleteStackOutput struct { +// [Service-managed permissions] The AWS Organizations accounts to which StackSets +// deploys. +// +// For update operations, you can specify either Accounts or OrganizationalUnitIds. +// For create and delete operations, specify OrganizationalUnitIds. +type DeploymentTargets struct { _ struct{} `type:"structure"` + + // The names of one or more AWS accounts for which you want to deploy stack + // set updates. + Accounts []*string `type:"list"` + + // The organization root ID or organizational unit (OUs) IDs to which StackSets + // deploys. + OrganizationalUnitIds []*string `type:"list"` } // String returns the string representation -func (s DeleteStackOutput) String() string { +func (s DeploymentTargets) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteStackOutput) GoString() string { +func (s DeploymentTargets) GoString() string { return s.String() } -type DeleteStackSetInput struct { +// SetAccounts sets the Accounts field's value. +func (s *DeploymentTargets) SetAccounts(v []*string) *DeploymentTargets { + s.Accounts = v + return s +} + +// SetOrganizationalUnitIds sets the OrganizationalUnitIds field's value. +func (s *DeploymentTargets) SetOrganizationalUnitIds(v []*string) *DeploymentTargets { + s.OrganizationalUnitIds = v + return s +} + +type DeregisterTypeInput struct { _ struct{} `type:"structure"` - // The name or unique ID of the stack set that you're deleting. You can obtain - // this value by running ListStackSets. + // The Amazon Resource Name (ARN) of the type. // - // StackSetName is a required field - StackSetName *string `type:"string" required:"true"` + // Conditional: You must specify either TypeName and Type, or Arn. + Arn *string `type:"string"` + + // The kind of type. + // + // Currently the only valid value is RESOURCE. + // + // Conditional: You must specify either TypeName and Type, or Arn. + Type *string `type:"string" enum:"RegistryType"` + + // The name of the type. + // + // Conditional: You must specify either TypeName and Type, or Arn. + TypeName *string `min:"10" type:"string"` + + // The ID of a specific version of the type. The version ID is the value at + // the end of the Amazon Resource Name (ARN) assigned to the type version when + // it is registered. + VersionId *string `min:"1" type:"string"` } // String returns the string representation -func (s DeleteStackSetInput) String() string { +func (s DeregisterTypeInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteStackSetInput) GoString() string { +func (s DeregisterTypeInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteStackSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteStackSetInput"} - if s.StackSetName == nil { - invalidParams.Add(request.NewErrParamRequired("StackSetName")) +func (s *DeregisterTypeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeregisterTypeInput"} + if s.TypeName != nil && len(*s.TypeName) < 10 { + invalidParams.Add(request.NewErrParamMinLen("TypeName", 10)) + } + if s.VersionId != nil && len(*s.VersionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VersionId", 1)) } if invalidParams.Len() > 0 { @@ -6185,23 +7496,41 @@ func (s *DeleteStackSetInput) Validate() error { return nil } -// SetStackSetName sets the StackSetName field's value. -func (s *DeleteStackSetInput) SetStackSetName(v string) *DeleteStackSetInput { - s.StackSetName = &v +// SetArn sets the Arn field's value. +func (s *DeregisterTypeInput) SetArn(v string) *DeregisterTypeInput { + s.Arn = &v return s } -type DeleteStackSetOutput struct { +// SetType sets the Type field's value. +func (s *DeregisterTypeInput) SetType(v string) *DeregisterTypeInput { + s.Type = &v + return s +} + +// SetTypeName sets the TypeName field's value. +func (s *DeregisterTypeInput) SetTypeName(v string) *DeregisterTypeInput { + s.TypeName = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *DeregisterTypeInput) SetVersionId(v string) *DeregisterTypeInput { + s.VersionId = &v + return s +} + +type DeregisterTypeOutput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s DeleteStackSetOutput) String() string { +func (s DeregisterTypeOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteStackSetOutput) GoString() string { +func (s DeregisterTypeOutput) GoString() string { return s.String() } @@ -7216,38 +8545,239 @@ func (s *DescribeStackSetInput) SetStackSetName(v string) *DescribeStackSetInput type DescribeStackSetOperationInput struct { _ struct{} `type:"structure"` - // The unique ID of the stack set operation. + // The unique ID of the stack set operation. + // + // OperationId is a required field + OperationId *string `min:"1" type:"string" required:"true"` + + // The name or the unique stack ID of the stack set for the stack operation. + // + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeStackSetOperationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeStackSetOperationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeStackSetOperationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeStackSetOperationInput"} + if s.OperationId == nil { + invalidParams.Add(request.NewErrParamRequired("OperationId")) + } + if s.OperationId != nil && len(*s.OperationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) + } + if s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOperationId sets the OperationId field's value. +func (s *DescribeStackSetOperationInput) SetOperationId(v string) *DescribeStackSetOperationInput { + s.OperationId = &v + return s +} + +// SetStackSetName sets the StackSetName field's value. +func (s *DescribeStackSetOperationInput) SetStackSetName(v string) *DescribeStackSetOperationInput { + s.StackSetName = &v + return s +} + +type DescribeStackSetOperationOutput struct { + _ struct{} `type:"structure"` + + // The specified stack set operation. + StackSetOperation *StackSetOperation `type:"structure"` +} + +// String returns the string representation +func (s DescribeStackSetOperationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeStackSetOperationOutput) GoString() string { + return s.String() +} + +// SetStackSetOperation sets the StackSetOperation field's value. +func (s *DescribeStackSetOperationOutput) SetStackSetOperation(v *StackSetOperation) *DescribeStackSetOperationOutput { + s.StackSetOperation = v + return s +} + +type DescribeStackSetOutput struct { + _ struct{} `type:"structure"` + + // The specified stack set. + StackSet *StackSet `type:"structure"` +} + +// String returns the string representation +func (s DescribeStackSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeStackSetOutput) GoString() string { + return s.String() +} + +// SetStackSet sets the StackSet field's value. +func (s *DescribeStackSetOutput) SetStackSet(v *StackSet) *DescribeStackSetOutput { + s.StackSet = v + return s +} + +// The input for DescribeStacks action. +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. +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 +} + +type DescribeTypeInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the type. + // + // Conditional: You must specify either TypeName and Type, or Arn. + Arn *string `type:"string"` + + // The kind of type. + // + // Currently the only valid value is RESOURCE. + // + // Conditional: You must specify either TypeName and Type, or Arn. + Type *string `type:"string" enum:"RegistryType"` + + // The name of the type. // - // OperationId is a required field - OperationId *string `min:"1" type:"string" required:"true"` + // Conditional: You must specify either TypeName and Type, or Arn. + TypeName *string `min:"10" type:"string"` - // The name or the unique stack ID of the stack set for the stack operation. + // The ID of a specific version of the type. The version ID is the value at + // the end of the Amazon Resource Name (ARN) assigned to the type version when + // it is registered. // - // StackSetName is a required field - StackSetName *string `type:"string" required:"true"` + // If you specify a VersionId, DescribeType returns information about that specific + // type version. Otherwise, it returns information about the default type version. + VersionId *string `min:"1" type:"string"` } // String returns the string representation -func (s DescribeStackSetOperationInput) String() string { +func (s DescribeTypeInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackSetOperationInput) GoString() string { +func (s DescribeTypeInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeStackSetOperationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeStackSetOperationInput"} - if s.OperationId == nil { - invalidParams.Add(request.NewErrParamRequired("OperationId")) - } - if s.OperationId != nil && len(*s.OperationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) +func (s *DescribeTypeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTypeInput"} + if s.TypeName != nil && len(*s.TypeName) < 10 { + invalidParams.Add(request.NewErrParamMinLen("TypeName", 10)) } - if s.StackSetName == nil { - invalidParams.Add(request.NewErrParamRequired("StackSetName")) + if s.VersionId != nil && len(*s.VersionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VersionId", 1)) } if invalidParams.Len() > 0 { @@ -7256,98 +8786,252 @@ func (s *DescribeStackSetOperationInput) Validate() error { return nil } -// SetOperationId sets the OperationId field's value. -func (s *DescribeStackSetOperationInput) SetOperationId(v string) *DescribeStackSetOperationInput { - s.OperationId = &v +// SetArn sets the Arn field's value. +func (s *DescribeTypeInput) SetArn(v string) *DescribeTypeInput { + s.Arn = &v return s } -// SetStackSetName sets the StackSetName field's value. -func (s *DescribeStackSetOperationInput) SetStackSetName(v string) *DescribeStackSetOperationInput { - s.StackSetName = &v +// SetType sets the Type field's value. +func (s *DescribeTypeInput) SetType(v string) *DescribeTypeInput { + s.Type = &v return s } -type DescribeStackSetOperationOutput struct { +// SetTypeName sets the TypeName field's value. +func (s *DescribeTypeInput) SetTypeName(v string) *DescribeTypeInput { + s.TypeName = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *DescribeTypeInput) SetVersionId(v string) *DescribeTypeInput { + s.VersionId = &v + return s +} + +type DescribeTypeOutput struct { _ struct{} `type:"structure"` - // The specified stack set operation. - StackSetOperation *StackSetOperation `type:"structure"` + // The Amazon Resource Name (ARN) of the type. + Arn *string `type:"string"` + + // The ID of the default version of the type. The default version is used when + // the type version is not specified. + // + // To set the default version of a type, use SetTypeDefaultVersion . + DefaultVersionId *string `min:"1" type:"string"` + + // The deprecation status of the type. + // + // Valid values include: + // + // * LIVE: The type is registered and can be used in CloudFormation operations, + // dependent on its provisioning behavior and visibility scope. + // + // * DEPRECATED: The type has been deregistered and can no longer be used + // in CloudFormation operations. + DeprecatedStatus *string `type:"string" enum:"DeprecatedStatus"` + + // The description of the registered type. + Description *string `min:"1" type:"string"` + + // The URL of a page providing detailed documentation for this type. + DocumentationUrl *string `type:"string"` + + // The Amazon Resource Name (ARN) of the IAM execution role used to register + // the type. If your resource type calls AWS APIs in any of its handlers, you + // must create an IAM execution role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) + // that includes the necessary permissions to call those AWS APIs, and provision + // that execution role in your account. CloudFormation then assumes that execution + // role to provide your resource type with the appropriate credentials. + ExecutionRoleArn *string `min:"1" type:"string"` + + // When the specified type version was registered. + LastUpdated *time.Time `type:"timestamp"` + + // Contains logging configuration information for a type. + LoggingConfig *LoggingConfig `type:"structure"` + + // The provisioning behavior of the type. AWS CloudFormation determines the + // provisioning type during registration, based on the types of handlers in + // the schema handler package submitted. + // + // Valid values include: + // + // * FULLY_MUTABLE: The type includes an update handler to process updates + // to the type during stack update operations. + // + // * IMMUTABLE: The type does not include an update handler, so the type + // cannot be updated and must instead be replaced during stack update operations. + // + // * NON_PROVISIONABLE: The type does not include all of the following handlers, + // and therefore cannot actually be provisioned. create read delete + ProvisioningType *string `type:"string" enum:"ProvisioningType"` + + // The schema that defines the type. + // + // For more information on type schemas, see Resource Provider Schema (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-schema.html) + // in the CloudFormation CLI User Guide. + Schema *string `min:"1" type:"string"` + + // The URL of the source code for the type. + SourceUrl *string `type:"string"` + + // When the specified type version was registered. + TimeCreated *time.Time `type:"timestamp"` + + // The kind of type. + // + // Currently the only valid value is RESOURCE. + Type *string `type:"string" enum:"RegistryType"` + + // The name of the registered type. + TypeName *string `min:"10" type:"string"` + + // The scope at which the type is visible and usable in CloudFormation operations. + // + // Valid values include: + // + // * PRIVATE: The type is only visible and usable within the account in which + // it is registered. Currently, AWS CloudFormation marks any types you register + // as PRIVATE. + // + // * PUBLIC: The type is publically visible and usable within any Amazon + // account. + Visibility *string `type:"string" enum:"Visibility"` } // String returns the string representation -func (s DescribeStackSetOperationOutput) String() string { +func (s DescribeTypeOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStackSetOperationOutput) GoString() string { +func (s DescribeTypeOutput) GoString() string { return s.String() } -// SetStackSetOperation sets the StackSetOperation field's value. -func (s *DescribeStackSetOperationOutput) SetStackSetOperation(v *StackSetOperation) *DescribeStackSetOperationOutput { - s.StackSetOperation = v +// SetArn sets the Arn field's value. +func (s *DescribeTypeOutput) SetArn(v string) *DescribeTypeOutput { + s.Arn = &v return s } -type DescribeStackSetOutput struct { - _ struct{} `type:"structure"` +// SetDefaultVersionId sets the DefaultVersionId field's value. +func (s *DescribeTypeOutput) SetDefaultVersionId(v string) *DescribeTypeOutput { + s.DefaultVersionId = &v + return s +} - // The specified stack set. - StackSet *StackSet `type:"structure"` +// SetDeprecatedStatus sets the DeprecatedStatus field's value. +func (s *DescribeTypeOutput) SetDeprecatedStatus(v string) *DescribeTypeOutput { + s.DeprecatedStatus = &v + return s } -// String returns the string representation -func (s DescribeStackSetOutput) String() string { - return awsutil.Prettify(s) +// SetDescription sets the Description field's value. +func (s *DescribeTypeOutput) SetDescription(v string) *DescribeTypeOutput { + s.Description = &v + return s } -// GoString returns the string representation -func (s DescribeStackSetOutput) GoString() string { - return s.String() +// SetDocumentationUrl sets the DocumentationUrl field's value. +func (s *DescribeTypeOutput) SetDocumentationUrl(v string) *DescribeTypeOutput { + s.DocumentationUrl = &v + return s } -// SetStackSet sets the StackSet field's value. -func (s *DescribeStackSetOutput) SetStackSet(v *StackSet) *DescribeStackSetOutput { - s.StackSet = v +// SetExecutionRoleArn sets the ExecutionRoleArn field's value. +func (s *DescribeTypeOutput) SetExecutionRoleArn(v string) *DescribeTypeOutput { + s.ExecutionRoleArn = &v return s } -// The input for DescribeStacks action. -type DescribeStacksInput struct { - _ struct{} `type:"structure"` +// SetLastUpdated sets the LastUpdated field's value. +func (s *DescribeTypeOutput) SetLastUpdated(v time.Time) *DescribeTypeOutput { + s.LastUpdated = &v + return s +} - // A string that identifies the next page of stacks that you want to retrieve. - NextToken *string `min:"1" type:"string"` +// SetLoggingConfig sets the LoggingConfig field's value. +func (s *DescribeTypeOutput) SetLoggingConfig(v *LoggingConfig) *DescribeTypeOutput { + s.LoggingConfig = v + return s +} - // 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. +// SetProvisioningType sets the ProvisioningType field's value. +func (s *DescribeTypeOutput) SetProvisioningType(v string) *DescribeTypeOutput { + s.ProvisioningType = &v + return s +} + +// SetSchema sets the Schema field's value. +func (s *DescribeTypeOutput) SetSchema(v string) *DescribeTypeOutput { + s.Schema = &v + return s +} + +// SetSourceUrl sets the SourceUrl field's value. +func (s *DescribeTypeOutput) SetSourceUrl(v string) *DescribeTypeOutput { + s.SourceUrl = &v + return s +} + +// SetTimeCreated sets the TimeCreated field's value. +func (s *DescribeTypeOutput) SetTimeCreated(v time.Time) *DescribeTypeOutput { + s.TimeCreated = &v + return s +} + +// SetType sets the Type field's value. +func (s *DescribeTypeOutput) SetType(v string) *DescribeTypeOutput { + s.Type = &v + return s +} + +// SetTypeName sets the TypeName field's value. +func (s *DescribeTypeOutput) SetTypeName(v string) *DescribeTypeOutput { + s.TypeName = &v + return s +} + +// SetVisibility sets the Visibility field's value. +func (s *DescribeTypeOutput) SetVisibility(v string) *DescribeTypeOutput { + s.Visibility = &v + return s +} + +type DescribeTypeRegistrationInput struct { + _ struct{} `type:"structure"` + + // The identifier for this registration request. // - // * Deleted stacks: You must specify the unique stack ID. + // This registration token is generated by CloudFormation when you initiate + // a registration request using RegisterType . // - // Default: There is no default value. - StackName *string `type:"string"` + // RegistrationToken is a required field + RegistrationToken *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s DescribeStacksInput) String() string { +func (s DescribeTypeRegistrationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStacksInput) GoString() string { +func (s DescribeTypeRegistrationInput) 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)) +func (s *DescribeTypeRegistrationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTypeRegistrationInput"} + if s.RegistrationToken == nil { + invalidParams.Add(request.NewErrParamRequired("RegistrationToken")) + } + if s.RegistrationToken != nil && len(*s.RegistrationToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RegistrationToken", 1)) } if invalidParams.Len() > 0 { @@ -7356,49 +9040,66 @@ func (s *DescribeStacksInput) Validate() error { 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 +// SetRegistrationToken sets the RegistrationToken field's value. +func (s *DescribeTypeRegistrationInput) SetRegistrationToken(v string) *DescribeTypeRegistrationInput { + s.RegistrationToken = &v return s } -// The output for a DescribeStacks action. -type DescribeStacksOutput struct { +type DescribeTypeRegistrationOutput 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"` + // The description of the type registration request. + Description *string `min:"1" type:"string"` - // A list of stack structures. - Stacks []*Stack `type:"list"` + // The current status of the type registration request. + ProgressStatus *string `type:"string" enum:"RegistrationStatus"` + + // The Amazon Resource Name (ARN) of the type being registered. + // + // For registration requests with a ProgressStatus of other than COMPLETE, this + // will be null. + TypeArn *string `type:"string"` + + // The Amazon Resource Name (ARN) of this specific version of the type being + // registered. + // + // For registration requests with a ProgressStatus of other than COMPLETE, this + // will be null. + TypeVersionArn *string `type:"string"` } // String returns the string representation -func (s DescribeStacksOutput) String() string { +func (s DescribeTypeRegistrationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStacksOutput) GoString() string { +func (s DescribeTypeRegistrationOutput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribeStacksOutput) SetNextToken(v string) *DescribeStacksOutput { - s.NextToken = &v +// SetDescription sets the Description field's value. +func (s *DescribeTypeRegistrationOutput) SetDescription(v string) *DescribeTypeRegistrationOutput { + s.Description = &v return s } -// SetStacks sets the Stacks field's value. -func (s *DescribeStacksOutput) SetStacks(v []*Stack) *DescribeStacksOutput { - s.Stacks = v +// SetProgressStatus sets the ProgressStatus field's value. +func (s *DescribeTypeRegistrationOutput) SetProgressStatus(v string) *DescribeTypeRegistrationOutput { + s.ProgressStatus = &v + return s +} + +// SetTypeArn sets the TypeArn field's value. +func (s *DescribeTypeRegistrationOutput) SetTypeArn(v string) *DescribeTypeRegistrationOutput { + s.TypeArn = &v + return s +} + +// SetTypeVersionArn sets the TypeVersionArn field's value. +func (s *DescribeTypeRegistrationOutput) SetTypeVersionArn(v string) *DescribeTypeRegistrationOutput { + s.TypeVersionArn = &v return s } @@ -7527,42 +9228,136 @@ func (s *DetectStackResourceDriftInput) Validate() error { return nil } -// SetLogicalResourceId sets the LogicalResourceId field's value. -func (s *DetectStackResourceDriftInput) SetLogicalResourceId(v string) *DetectStackResourceDriftInput { - s.LogicalResourceId = &v +// SetLogicalResourceId sets the LogicalResourceId field's value. +func (s *DetectStackResourceDriftInput) SetLogicalResourceId(v string) *DetectStackResourceDriftInput { + s.LogicalResourceId = &v + return s +} + +// SetStackName sets the StackName field's value. +func (s *DetectStackResourceDriftInput) SetStackName(v string) *DetectStackResourceDriftInput { + s.StackName = &v + return s +} + +type DetectStackResourceDriftOutput struct { + _ struct{} `type:"structure"` + + // Information about whether the resource's actual configuration has drifted + // from its expected template configuration, including actual and expected property + // values and any differences detected. + // + // StackResourceDrift is a required field + StackResourceDrift *StackResourceDrift `type:"structure" required:"true"` +} + +// String returns the string representation +func (s DetectStackResourceDriftOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetectStackResourceDriftOutput) GoString() string { + return s.String() +} + +// SetStackResourceDrift sets the StackResourceDrift field's value. +func (s *DetectStackResourceDriftOutput) SetStackResourceDrift(v *StackResourceDrift) *DetectStackResourceDriftOutput { + s.StackResourceDrift = v + return s +} + +type DetectStackSetDriftInput struct { + _ struct{} `type:"structure"` + + // The ID of the stack set operation. + OperationId *string `min:"1" type:"string" idempotencyToken:"true"` + + // The user-specified preferences for how AWS CloudFormation performs a stack + // set operation. + // + // For more information on maximum concurrent accounts and failure tolerance, + // see Stack set operation options (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-ops-options). + OperationPreferences *StackSetOperationPreferences `type:"structure"` + + // The name of the stack set on which to perform the drift detection operation. + // + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DetectStackSetDriftInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DetectStackSetDriftInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DetectStackSetDriftInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DetectStackSetDriftInput"} + if s.OperationId != nil && len(*s.OperationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) + } + if s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) + } + if s.OperationPreferences != nil { + if err := s.OperationPreferences.Validate(); err != nil { + invalidParams.AddNested("OperationPreferences", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOperationId sets the OperationId field's value. +func (s *DetectStackSetDriftInput) SetOperationId(v string) *DetectStackSetDriftInput { + s.OperationId = &v return s } -// SetStackName sets the StackName field's value. -func (s *DetectStackResourceDriftInput) SetStackName(v string) *DetectStackResourceDriftInput { - s.StackName = &v +// SetOperationPreferences sets the OperationPreferences field's value. +func (s *DetectStackSetDriftInput) SetOperationPreferences(v *StackSetOperationPreferences) *DetectStackSetDriftInput { + s.OperationPreferences = v return s } -type DetectStackResourceDriftOutput struct { +// SetStackSetName sets the StackSetName field's value. +func (s *DetectStackSetDriftInput) SetStackSetName(v string) *DetectStackSetDriftInput { + s.StackSetName = &v + return s +} + +type DetectStackSetDriftOutput struct { _ struct{} `type:"structure"` - // Information about whether the resource's actual configuration has drifted - // from its expected template configuration, including actual and expected property - // values and any differences detected. + // The ID of the drift detection stack set operation. // - // StackResourceDrift is a required field - StackResourceDrift *StackResourceDrift `type:"structure" required:"true"` + // you can use this operation id with DescribeStackSetOperation to monitor the + // progress of the drift detection operation. + OperationId *string `min:"1" type:"string"` } // String returns the string representation -func (s DetectStackResourceDriftOutput) String() string { +func (s DetectStackSetDriftOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DetectStackResourceDriftOutput) GoString() string { +func (s DetectStackSetDriftOutput) GoString() string { return s.String() } -// SetStackResourceDrift sets the StackResourceDrift field's value. -func (s *DetectStackResourceDriftOutput) SetStackResourceDrift(v *StackResourceDrift) *DetectStackResourceDriftOutput { - s.StackResourceDrift = v +// SetOperationId sets the OperationId field's value. +func (s *DetectStackSetDriftOutput) SetOperationId(v string) *DetectStackSetDriftOutput { + s.OperationId = &v return s } @@ -8083,119 +9878,391 @@ type GetTemplateSummaryOutput struct { // 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 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 resource identifier summaries that describe the target resources + // of an import operation and the properties you can provide during the import + // to identify the target resources. For example, BucketName is a possible identifier + // property for an AWS::S3::Bucket resource. + ResourceIdentifierSummaries []*ResourceIdentifierSummary `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 +} + +// SetResourceIdentifierSummaries sets the ResourceIdentifierSummaries field's value. +func (s *GetTemplateSummaryOutput) SetResourceIdentifierSummaries(v []*ResourceIdentifierSummary) *GetTemplateSummaryOutput { + s.ResourceIdentifierSummaries = 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. +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. +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 +} + +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 +} + +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() +} - // The value that is defined for the Metadata property of the template. - Metadata *string `type:"string"` +// SetExports sets the Exports field's value. +func (s *ListExportsOutput) SetExports(v []*Export) *ListExportsOutput { + s.Exports = v + return s +} - // A list of parameter declarations that describe various properties for each - // parameter. - Parameters []*ParameterDeclaration `type:"list"` +// SetNextToken sets the NextToken field's value. +func (s *ListExportsOutput) SetNextToken(v string) *ListExportsOutput { + s.NextToken = &v + return s +} - // 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"` +type ListImportsInput struct { + _ struct{} `type:"structure"` - // The AWS template format version, which identifies the capabilities of the - // template. - Version *string `type:"string"` + // 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 GetTemplateSummaryOutput) String() string { +func (s ListImportsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetTemplateSummaryOutput) GoString() string { +func (s ListImportsInput) GoString() string { return s.String() } -// SetCapabilities sets the Capabilities field's value. -func (s *GetTemplateSummaryOutput) SetCapabilities(v []*string) *GetTemplateSummaryOutput { - s.Capabilities = v - return s +// 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 } -// SetCapabilitiesReason sets the CapabilitiesReason field's value. -func (s *GetTemplateSummaryOutput) SetCapabilitiesReason(v string) *GetTemplateSummaryOutput { - s.CapabilitiesReason = &v +// SetExportName sets the ExportName field's value. +func (s *ListImportsInput) SetExportName(v string) *ListImportsInput { + s.ExportName = &v return s } -// SetDeclaredTransforms sets the DeclaredTransforms field's value. -func (s *GetTemplateSummaryOutput) SetDeclaredTransforms(v []*string) *GetTemplateSummaryOutput { - s.DeclaredTransforms = v +// SetNextToken sets the NextToken field's value. +func (s *ListImportsInput) SetNextToken(v string) *ListImportsInput { + s.NextToken = &v return s } -// SetDescription sets the Description field's value. -func (s *GetTemplateSummaryOutput) SetDescription(v string) *GetTemplateSummaryOutput { - s.Description = &v - return s +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"` } -// SetMetadata sets the Metadata field's value. -func (s *GetTemplateSummaryOutput) SetMetadata(v string) *GetTemplateSummaryOutput { - s.Metadata = &v - return s +// String returns the string representation +func (s ListImportsOutput) String() string { + return awsutil.Prettify(s) } -// SetParameters sets the Parameters field's value. -func (s *GetTemplateSummaryOutput) SetParameters(v []*ParameterDeclaration) *GetTemplateSummaryOutput { - s.Parameters = v - return s +// GoString returns the string representation +func (s ListImportsOutput) GoString() string { + return s.String() } -// SetResourceTypes sets the ResourceTypes field's value. -func (s *GetTemplateSummaryOutput) SetResourceTypes(v []*string) *GetTemplateSummaryOutput { - s.ResourceTypes = v +// SetImports sets the Imports field's value. +func (s *ListImportsOutput) SetImports(v []*string) *ListImportsOutput { + s.Imports = v return s } -// SetVersion sets the Version field's value. -func (s *GetTemplateSummaryOutput) SetVersion(v string) *GetTemplateSummaryOutput { - s.Version = &v +// SetNextToken sets the NextToken field's value. +func (s *ListImportsOutput) SetNextToken(v string) *ListImportsOutput { + s.NextToken = &v return s } -// The input for the ListChangeSets action. -type ListChangeSetsInput struct { +type ListStackInstancesInput 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. + // 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 `min:"1" type:"integer"` + + // If the previous request didn't return all of the remaining results, the response's + // NextToken parameter value is set to a token. To retrieve the next set of + // results, call ListStackInstances 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 `min:"1" type:"string"` - // The name or the Amazon Resource Name (ARN) of the stack for which you want - // to list change sets. + // The name of the AWS account that you want to list stack instances for. + StackInstanceAccount *string `type:"string"` + + // The name of the region where you want to list stack instances. + StackInstanceRegion *string `type:"string"` + + // The name or unique ID of the stack set that you want to list stack instances + // for. // - // StackName is a required field - StackName *string `min:"1" type:"string" required:"true"` + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` } // String returns the string representation -func (s ListChangeSetsInput) String() string { +func (s ListStackInstancesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListChangeSetsInput) GoString() string { +func (s ListStackInstancesInput) 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"} +func (s *ListStackInstancesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListStackInstancesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } 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 s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) } if invalidParams.Len() > 0 { @@ -8204,77 +10271,113 @@ func (s *ListChangeSetsInput) Validate() error { return nil } +// SetMaxResults sets the MaxResults field's value. +func (s *ListStackInstancesInput) SetMaxResults(v int64) *ListStackInstancesInput { + s.MaxResults = &v + return s +} + // SetNextToken sets the NextToken field's value. -func (s *ListChangeSetsInput) SetNextToken(v string) *ListChangeSetsInput { +func (s *ListStackInstancesInput) SetNextToken(v string) *ListStackInstancesInput { s.NextToken = &v return s } -// SetStackName sets the StackName field's value. -func (s *ListChangeSetsInput) SetStackName(v string) *ListChangeSetsInput { - s.StackName = &v +// SetStackInstanceAccount sets the StackInstanceAccount field's value. +func (s *ListStackInstancesInput) SetStackInstanceAccount(v string) *ListStackInstancesInput { + s.StackInstanceAccount = &v return s } -// The output for the ListChangeSets action. -type ListChangeSetsOutput struct { +// SetStackInstanceRegion sets the StackInstanceRegion field's value. +func (s *ListStackInstancesInput) SetStackInstanceRegion(v string) *ListStackInstancesInput { + s.StackInstanceRegion = &v + return s +} + +// SetStackSetName sets the StackSetName field's value. +func (s *ListStackInstancesInput) SetStackSetName(v string) *ListStackInstancesInput { + s.StackSetName = &v + return s +} + +type ListStackInstancesOutput 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. + // If the request doesn't return all of the remaining results, NextToken is + // set to a token. To retrieve the next set of results, call ListStackInstances + // again and assign that token to the request object's NextToken parameter. + // If the request returns all results, NextToken is set to 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"` + // A list of StackInstanceSummary structures that contain information about + // the specified stack instances. + Summaries []*StackInstanceSummary `type:"list"` } // String returns the string representation -func (s ListChangeSetsOutput) String() string { +func (s ListStackInstancesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListChangeSetsOutput) GoString() string { +func (s ListStackInstancesOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListChangeSetsOutput) SetNextToken(v string) *ListChangeSetsOutput { +func (s *ListStackInstancesOutput) SetNextToken(v string) *ListStackInstancesOutput { s.NextToken = &v return s } // SetSummaries sets the Summaries field's value. -func (s *ListChangeSetsOutput) SetSummaries(v []*ChangeSetSummary) *ListChangeSetsOutput { +func (s *ListStackInstancesOutput) SetSummaries(v []*StackInstanceSummary) *ListStackInstancesOutput { s.Summaries = v return s } -type ListExportsInput struct { +// The input for the ListStackResource action. +type ListStackResourcesInput 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. + // 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 ListExportsInput) String() string { +func (s ListStackResourcesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListExportsInput) GoString() string { +func (s ListStackResourcesInput) 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"} +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 @@ -8283,77 +10386,107 @@ func (s *ListExportsInput) Validate() error { } // SetNextToken sets the NextToken field's value. -func (s *ListExportsInput) SetNextToken(v string) *ListExportsInput { +func (s *ListStackResourcesInput) SetNextToken(v string) *ListStackResourcesInput { s.NextToken = &v return s } -type ListExportsOutput struct { - _ struct{} `type:"structure"` - - // The output for the ListExports action. - Exports []*Export `type:"list"` +// SetStackName sets the StackName field's value. +func (s *ListStackResourcesInput) SetStackName(v string) *ListStackResourcesInput { + s.StackName = &v + return s +} - // 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. +// The output for a ListStackResources action. +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 ListExportsOutput) String() string { +func (s ListStackResourcesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListExportsOutput) GoString() string { +func (s ListStackResourcesOutput) GoString() string { return s.String() } -// SetExports sets the Exports field's value. -func (s *ListExportsOutput) SetExports(v []*Export) *ListExportsOutput { - s.Exports = v +// SetNextToken sets the NextToken field's value. +func (s *ListStackResourcesOutput) SetNextToken(v string) *ListStackResourcesOutput { + s.NextToken = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListExportsOutput) SetNextToken(v string) *ListExportsOutput { - s.NextToken = &v +// SetStackResourceSummaries sets the StackResourceSummaries field's value. +func (s *ListStackResourcesOutput) SetStackResourceSummaries(v []*StackResourceSummary) *ListStackResourcesOutput { + s.StackResourceSummaries = v return s } -type ListImportsInput struct { +type ListStackSetOperationResultsInput 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"` + // 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 `min:"1" type:"integer"` - // A string (provided by the ListImports response output) that identifies the - // next page of stacks that are importing the specified exported output value. + // If the previous request didn't return all of the remaining results, the response + // object's NextToken parameter value is set to a token. To retrieve the next + // set of results, call ListStackSetOperationResults 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 `min:"1" type:"string"` + + // The ID of the stack set operation. + // + // OperationId is a required field + OperationId *string `min:"1" type:"string" required:"true"` + + // The name or unique ID of the stack set that you want to get operation results + // for. + // + // StackSetName is a required field + StackSetName *string `type:"string" required:"true"` } // String returns the string representation -func (s ListImportsInput) String() string { +func (s ListStackSetOperationResultsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListImportsInput) GoString() string { +func (s ListStackSetOperationResultsInput) 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")) +func (s *ListStackSetOperationResultsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListStackSetOperationResultsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if s.NextToken != nil && len(*s.NextToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } + if s.OperationId == nil { + invalidParams.Add(request.NewErrParamRequired("OperationId")) + } + if s.OperationId != nil && len(*s.OperationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) + } + if s.StackSetName == nil { + invalidParams.Add(request.NewErrParamRequired("StackSetName")) + } if invalidParams.Len() > 0 { return invalidParams @@ -8361,52 +10494,68 @@ func (s *ListImportsInput) Validate() error { return nil } -// SetExportName sets the ExportName field's value. -func (s *ListImportsInput) SetExportName(v string) *ListImportsInput { - s.ExportName = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListStackSetOperationResultsInput) SetMaxResults(v int64) *ListStackSetOperationResultsInput { + s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListImportsInput) SetNextToken(v string) *ListImportsInput { +func (s *ListStackSetOperationResultsInput) SetNextToken(v string) *ListStackSetOperationResultsInput { s.NextToken = &v return s } -type ListImportsOutput struct { - _ struct{} `type:"structure"` +// SetOperationId sets the OperationId field's value. +func (s *ListStackSetOperationResultsInput) SetOperationId(v string) *ListStackSetOperationResultsInput { + s.OperationId = &v + return s +} - // A list of stack names that are importing the specified exported output value. - Imports []*string `type:"list"` +// SetStackSetName sets the StackSetName field's value. +func (s *ListStackSetOperationResultsInput) SetStackSetName(v string) *ListStackSetOperationResultsInput { + s.StackSetName = &v + return s +} - // A string that identifies the next page of exports. If there is no additional - // page, this value is null. +type ListStackSetOperationResultsOutput struct { + _ struct{} `type:"structure"` + + // If the request doesn't return all results, NextToken is set to a token. To + // retrieve the next set of results, call ListOperationResults again and assign + // that token to the request object's NextToken parameter. If there are no remaining + // results, NextToken is set to null. NextToken *string `min:"1" type:"string"` + + // A list of StackSetOperationResultSummary structures that contain information + // about the specified operation results, for accounts and regions that are + // included in the operation. + Summaries []*StackSetOperationResultSummary `type:"list"` } // String returns the string representation -func (s ListImportsOutput) String() string { +func (s ListStackSetOperationResultsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListImportsOutput) GoString() string { +func (s ListStackSetOperationResultsOutput) GoString() string { return s.String() } -// SetImports sets the Imports field's value. -func (s *ListImportsOutput) SetImports(v []*string) *ListImportsOutput { - s.Imports = v +// SetNextToken sets the NextToken field's value. +func (s *ListStackSetOperationResultsOutput) SetNextToken(v string) *ListStackSetOperationResultsOutput { + s.NextToken = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListImportsOutput) SetNextToken(v string) *ListImportsOutput { - s.NextToken = &v +// SetSummaries sets the Summaries field's value. +func (s *ListStackSetOperationResultsOutput) SetSummaries(v []*StackSetOperationResultSummary) *ListStackSetOperationResultsOutput { + s.Summaries = v return s } -type ListStackInstancesInput struct { +type ListStackSetOperationsInput struct { _ struct{} `type:"structure"` // The maximum number of results to be returned with a single call. If the number @@ -8415,20 +10564,14 @@ type ListStackInstancesInput struct { // set of results. MaxResults *int64 `min:"1" type:"integer"` - // If the previous request didn't return all of the remaining results, the response's - // NextToken parameter value is set to a token. To retrieve the next set of - // results, call ListStackInstances 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. + // If the previous paginated request didn't return all of the remaining results, + // the response object's NextToken parameter value is set to a token. To retrieve + // the next set of results, call ListStackSetOperations 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 `min:"1" type:"string"` - // The name of the AWS account that you want to list stack instances for. - StackInstanceAccount *string `type:"string"` - - // The name of the region where you want to list stack instances. - StackInstanceRegion *string `type:"string"` - - // The name or unique ID of the stack set that you want to list stack instances + // The name or unique ID of the stack set that you want to get operation summaries // for. // // StackSetName is a required field @@ -8436,18 +10579,18 @@ type ListStackInstancesInput struct { } // String returns the string representation -func (s ListStackInstancesInput) String() string { +func (s ListStackSetOperationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackInstancesInput) GoString() string { +func (s ListStackSetOperationsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListStackInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStackInstancesInput"} +func (s *ListStackSetOperationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListStackSetOperationsInput"} if s.MaxResults != nil && *s.MaxResults < 1 { invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } @@ -8465,112 +10608,98 @@ func (s *ListStackInstancesInput) Validate() error { } // SetMaxResults sets the MaxResults field's value. -func (s *ListStackInstancesInput) SetMaxResults(v int64) *ListStackInstancesInput { +func (s *ListStackSetOperationsInput) SetMaxResults(v int64) *ListStackSetOperationsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListStackInstancesInput) SetNextToken(v string) *ListStackInstancesInput { +func (s *ListStackSetOperationsInput) SetNextToken(v string) *ListStackSetOperationsInput { s.NextToken = &v return s } -// SetStackInstanceAccount sets the StackInstanceAccount field's value. -func (s *ListStackInstancesInput) SetStackInstanceAccount(v string) *ListStackInstancesInput { - s.StackInstanceAccount = &v - return s -} - -// SetStackInstanceRegion sets the StackInstanceRegion field's value. -func (s *ListStackInstancesInput) SetStackInstanceRegion(v string) *ListStackInstancesInput { - s.StackInstanceRegion = &v - return s -} - // SetStackSetName sets the StackSetName field's value. -func (s *ListStackInstancesInput) SetStackSetName(v string) *ListStackInstancesInput { +func (s *ListStackSetOperationsInput) SetStackSetName(v string) *ListStackSetOperationsInput { s.StackSetName = &v return s } -type ListStackInstancesOutput struct { +type ListStackSetOperationsOutput struct { _ struct{} `type:"structure"` - // If the request doesn't return all of the remaining results, NextToken is - // set to a token. To retrieve the next set of results, call ListStackInstances - // again and assign that token to the request object's NextToken parameter. - // If the request returns all results, NextToken is set to null. + // If the request doesn't return all results, NextToken is set to a token. To + // retrieve the next set of results, call ListOperationResults again and assign + // that token to the request object's NextToken parameter. If there are no remaining + // results, NextToken is set to null. NextToken *string `min:"1" type:"string"` - // A list of StackInstanceSummary structures that contain information about - // the specified stack instances. - Summaries []*StackInstanceSummary `type:"list"` + // A list of StackSetOperationSummary structures that contain summary information + // about operations for the specified stack set. + Summaries []*StackSetOperationSummary `type:"list"` } // String returns the string representation -func (s ListStackInstancesOutput) String() string { +func (s ListStackSetOperationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackInstancesOutput) GoString() string { +func (s ListStackSetOperationsOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListStackInstancesOutput) SetNextToken(v string) *ListStackInstancesOutput { +func (s *ListStackSetOperationsOutput) SetNextToken(v string) *ListStackSetOperationsOutput { s.NextToken = &v return s } // SetSummaries sets the Summaries field's value. -func (s *ListStackInstancesOutput) SetSummaries(v []*StackInstanceSummary) *ListStackInstancesOutput { +func (s *ListStackSetOperationsOutput) SetSummaries(v []*StackSetOperationSummary) *ListStackSetOperationsOutput { s.Summaries = v return s } -// The input for the ListStackResource action. -type ListStackResourcesInput struct { +type ListStackSetsInput struct { _ struct{} `type:"structure"` - // A string that identifies the next page of stack resources that you want to - // retrieve. + // 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 `min:"1" type:"integer"` + + // If the previous paginated request didn't return all of the remaining results, + // the response object's NextToken parameter value is set to a token. To retrieve + // the next set of results, call ListStackSets 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 `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"` + // The status of the stack sets that you want to get summary information about. + Status *string `type:"string" enum:"StackSetStatus"` } // String returns the string representation -func (s ListStackResourcesInput) String() string { +func (s ListStackSetsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackResourcesInput) GoString() string { +func (s ListStackSetsInput) 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"} +func (s *ListStackSetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListStackSetsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } 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 @@ -8578,108 +10707,89 @@ func (s *ListStackResourcesInput) Validate() error { return nil } +// SetMaxResults sets the MaxResults field's value. +func (s *ListStackSetsInput) SetMaxResults(v int64) *ListStackSetsInput { + s.MaxResults = &v + return s +} + // SetNextToken sets the NextToken field's value. -func (s *ListStackResourcesInput) SetNextToken(v string) *ListStackResourcesInput { +func (s *ListStackSetsInput) SetNextToken(v string) *ListStackSetsInput { s.NextToken = &v return s } -// SetStackName sets the StackName field's value. -func (s *ListStackResourcesInput) SetStackName(v string) *ListStackResourcesInput { - s.StackName = &v +// SetStatus sets the Status field's value. +func (s *ListStackSetsInput) SetStatus(v string) *ListStackSetsInput { + s.Status = &v return s } -// The output for a ListStackResources action. -type ListStackResourcesOutput struct { +type ListStackSetsOutput 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. + // If the request doesn't return all of the remaining results, NextToken is + // set to a token. To retrieve the next set of results, call ListStackInstances + // again and assign that token to the request object's NextToken parameter. + // If the request returns all results, NextToken is set to null. NextToken *string `min:"1" type:"string"` - // A list of StackResourceSummary structures. - StackResourceSummaries []*StackResourceSummary `type:"list"` + // A list of StackSetSummary structures that contain information about the user's + // stack sets. + Summaries []*StackSetSummary `type:"list"` } // String returns the string representation -func (s ListStackResourcesOutput) String() string { +func (s ListStackSetsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackResourcesOutput) GoString() string { +func (s ListStackSetsOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListStackResourcesOutput) SetNextToken(v string) *ListStackResourcesOutput { +func (s *ListStackSetsOutput) SetNextToken(v string) *ListStackSetsOutput { s.NextToken = &v return s } -// SetStackResourceSummaries sets the StackResourceSummaries field's value. -func (s *ListStackResourcesOutput) SetStackResourceSummaries(v []*StackResourceSummary) *ListStackResourcesOutput { - s.StackResourceSummaries = v +// SetSummaries sets the Summaries field's value. +func (s *ListStackSetsOutput) SetSummaries(v []*StackSetSummary) *ListStackSetsOutput { + s.Summaries = v return s } -type ListStackSetOperationResultsInput struct { +// The input for ListStacks action. +type ListStacksInput struct { _ struct{} `type:"structure"` - // 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 `min:"1" type:"integer"` - - // If the previous request didn't return all of the remaining results, the response - // object's NextToken parameter value is set to a token. To retrieve the next - // set of results, call ListStackSetOperationResults 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. + // A string that identifies the next page of stacks that you want to retrieve. NextToken *string `min:"1" type:"string"` - // The ID of the stack set operation. - // - // OperationId is a required field - OperationId *string `min:"1" type:"string" required:"true"` - - // The name or unique ID of the stack set that you want to get operation results - // for. - // - // StackSetName is a required field - StackSetName *string `type:"string" required:"true"` + // 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 ListStackSetOperationResultsInput) String() string { +func (s ListStacksInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackSetOperationResultsInput) GoString() string { +func (s ListStacksInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListStackSetOperationResultsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStackSetOperationResultsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } +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 s.OperationId == nil { - invalidParams.Add(request.NewErrParamRequired("OperationId")) - } - if s.OperationId != nil && len(*s.OperationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) - } - if s.StackSetName == nil { - invalidParams.Add(request.NewErrParamRequired("StackSetName")) - } if invalidParams.Len() > 0 { return invalidParams @@ -8687,68 +10797,54 @@ func (s *ListStackSetOperationResultsInput) Validate() error { return nil } -// SetMaxResults sets the MaxResults field's value. -func (s *ListStackSetOperationResultsInput) SetMaxResults(v int64) *ListStackSetOperationResultsInput { - s.MaxResults = &v - return s -} - // SetNextToken sets the NextToken field's value. -func (s *ListStackSetOperationResultsInput) SetNextToken(v string) *ListStackSetOperationResultsInput { +func (s *ListStacksInput) SetNextToken(v string) *ListStacksInput { s.NextToken = &v return s } -// SetOperationId sets the OperationId field's value. -func (s *ListStackSetOperationResultsInput) SetOperationId(v string) *ListStackSetOperationResultsInput { - s.OperationId = &v - return s -} - -// SetStackSetName sets the StackSetName field's value. -func (s *ListStackSetOperationResultsInput) SetStackSetName(v string) *ListStackSetOperationResultsInput { - s.StackSetName = &v +// SetStackStatusFilter sets the StackStatusFilter field's value. +func (s *ListStacksInput) SetStackStatusFilter(v []*string) *ListStacksInput { + s.StackStatusFilter = v return s } -type ListStackSetOperationResultsOutput struct { +// The output for ListStacks action. +type ListStacksOutput struct { _ struct{} `type:"structure"` - // If the request doesn't return all results, NextToken is set to a token. To - // retrieve the next set of results, call ListOperationResults again and assign - // that token to the request object's NextToken parameter. If there are no remaining - // results, NextToken is set to null. + // 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 StackSetOperationResultSummary structures that contain information - // about the specified operation results, for accounts and regions that are - // included in the operation. - Summaries []*StackSetOperationResultSummary `type:"list"` + // A list of StackSummary structures containing information about the specified + // stacks. + StackSummaries []*StackSummary `type:"list"` } // String returns the string representation -func (s ListStackSetOperationResultsOutput) String() string { +func (s ListStacksOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackSetOperationResultsOutput) GoString() string { +func (s ListStacksOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListStackSetOperationResultsOutput) SetNextToken(v string) *ListStackSetOperationResultsOutput { +func (s *ListStacksOutput) SetNextToken(v string) *ListStacksOutput { s.NextToken = &v return s } -// SetSummaries sets the Summaries field's value. -func (s *ListStackSetOperationResultsOutput) SetSummaries(v []*StackSetOperationResultSummary) *ListStackSetOperationResultsOutput { - s.Summaries = v +// SetStackSummaries sets the StackSummaries field's value. +func (s *ListStacksOutput) SetStackSummaries(v []*StackSummary) *ListStacksOutput { + s.StackSummaries = v return s } -type ListStackSetOperationsInput struct { +type ListTypeRegistrationsInput struct { _ struct{} `type:"structure"` // The maximum number of results to be returned with a single call. If the number @@ -8759,39 +10855,55 @@ type ListStackSetOperationsInput struct { // If the previous paginated request didn't return all of the remaining results, // the response object's NextToken parameter value is set to a token. To retrieve - // the next set of results, call ListStackSetOperations 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. + // the next set of results, call this action 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 `min:"1" type:"string"` - // The name or unique ID of the stack set that you want to get operation summaries - // for. + // The current status of the type registration request. // - // StackSetName is a required field - StackSetName *string `type:"string" required:"true"` + // The default is IN_PROGRESS. + RegistrationStatusFilter *string `type:"string" enum:"RegistrationStatus"` + + // The kind of type. + // + // Currently the only valid value is RESOURCE. + // + // Conditional: You must specify either TypeName and Type, or Arn. + Type *string `type:"string" enum:"RegistryType"` + + // The Amazon Resource Name (ARN) of the type. + // + // Conditional: You must specify either TypeName and Type, or Arn. + TypeArn *string `type:"string"` + + // The name of the type. + // + // Conditional: You must specify either TypeName and Type, or Arn. + TypeName *string `min:"10" type:"string"` } // String returns the string representation -func (s ListStackSetOperationsInput) String() string { +func (s ListTypeRegistrationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackSetOperationsInput) GoString() string { +func (s ListTypeRegistrationsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListStackSetOperationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStackSetOperationsInput"} +func (s *ListTypeRegistrationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTypeRegistrationsInput"} if s.MaxResults != nil && *s.MaxResults < 1 { invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if s.NextToken != nil && len(*s.NextToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } - if s.StackSetName == nil { - invalidParams.Add(request.NewErrParamRequired("StackSetName")) + if s.TypeName != nil && len(*s.TypeName) < 10 { + invalidParams.Add(request.NewErrParamMinLen("TypeName", 10)) } if invalidParams.Len() > 0 { @@ -8801,62 +10913,102 @@ func (s *ListStackSetOperationsInput) Validate() error { } // SetMaxResults sets the MaxResults field's value. -func (s *ListStackSetOperationsInput) SetMaxResults(v int64) *ListStackSetOperationsInput { +func (s *ListTypeRegistrationsInput) SetMaxResults(v int64) *ListTypeRegistrationsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListStackSetOperationsInput) SetNextToken(v string) *ListStackSetOperationsInput { +func (s *ListTypeRegistrationsInput) SetNextToken(v string) *ListTypeRegistrationsInput { s.NextToken = &v return s } -// SetStackSetName sets the StackSetName field's value. -func (s *ListStackSetOperationsInput) SetStackSetName(v string) *ListStackSetOperationsInput { - s.StackSetName = &v +// SetRegistrationStatusFilter sets the RegistrationStatusFilter field's value. +func (s *ListTypeRegistrationsInput) SetRegistrationStatusFilter(v string) *ListTypeRegistrationsInput { + s.RegistrationStatusFilter = &v return s } -type ListStackSetOperationsOutput struct { +// SetType sets the Type field's value. +func (s *ListTypeRegistrationsInput) SetType(v string) *ListTypeRegistrationsInput { + s.Type = &v + return s +} + +// SetTypeArn sets the TypeArn field's value. +func (s *ListTypeRegistrationsInput) SetTypeArn(v string) *ListTypeRegistrationsInput { + s.TypeArn = &v + return s +} + +// SetTypeName sets the TypeName field's value. +func (s *ListTypeRegistrationsInput) SetTypeName(v string) *ListTypeRegistrationsInput { + s.TypeName = &v + return s +} + +type ListTypeRegistrationsOutput struct { _ struct{} `type:"structure"` - // If the request doesn't return all results, NextToken is set to a token. To - // retrieve the next set of results, call ListOperationResults again and assign - // that token to the request object's NextToken parameter. If there are no remaining - // results, NextToken is set to null. + // If the request doesn't return all of the remaining results, NextToken is + // set to a token. To retrieve the next set of results, call this action again + // and assign that token to the request object's NextToken parameter. If the + // request returns all results, NextToken is set to null. NextToken *string `min:"1" type:"string"` - // A list of StackSetOperationSummary structures that contain summary information - // about operations for the specified stack set. - Summaries []*StackSetOperationSummary `type:"list"` + // A list of type registration tokens. + // + // Use DescribeTypeRegistration to return detailed information about a type + // registration request. + RegistrationTokenList []*string `type:"list"` } // String returns the string representation -func (s ListStackSetOperationsOutput) String() string { +func (s ListTypeRegistrationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackSetOperationsOutput) GoString() string { +func (s ListTypeRegistrationsOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListStackSetOperationsOutput) SetNextToken(v string) *ListStackSetOperationsOutput { +func (s *ListTypeRegistrationsOutput) SetNextToken(v string) *ListTypeRegistrationsOutput { s.NextToken = &v return s } -// SetSummaries sets the Summaries field's value. -func (s *ListStackSetOperationsOutput) SetSummaries(v []*StackSetOperationSummary) *ListStackSetOperationsOutput { - s.Summaries = v +// SetRegistrationTokenList sets the RegistrationTokenList field's value. +func (s *ListTypeRegistrationsOutput) SetRegistrationTokenList(v []*string) *ListTypeRegistrationsOutput { + s.RegistrationTokenList = v return s } -type ListStackSetsInput struct { +type ListTypeVersionsInput struct { _ struct{} `type:"structure"` + // The Amazon Resource Name (ARN) of the type for which you want version summary + // information. + // + // Conditional: You must specify either TypeName and Type, or Arn. + Arn *string `type:"string"` + + // The deprecation status of the type versions that you want to get summary + // information about. + // + // Valid values include: + // + // * LIVE: The type version is registered and can be used in CloudFormation + // operations, dependent on its provisioning behavior and visibility scope. + // + // * DEPRECATED: The type version has been deregistered and can no longer + // be used in CloudFormation operations. + // + // The default is LIVE. + DeprecatedStatus *string `type:"string" enum:"DeprecatedStatus"` + // 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 @@ -8865,34 +11017,46 @@ type ListStackSetsInput struct { // If the previous paginated request didn't return all of the remaining results, // the response object's NextToken parameter value is set to a token. To retrieve - // the next set of results, call ListStackSets again and assign that token to + // the next set of results, call this action 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 `min:"1" type:"string"` - // The status of the stack sets that you want to get summary information about. - Status *string `type:"string" enum:"StackSetStatus"` + // The kind of the type. + // + // Currently the only valid value is RESOURCE. + // + // Conditional: You must specify either TypeName and Type, or Arn. + Type *string `type:"string" enum:"RegistryType"` + + // The name of the type for which you want version summary information. + // + // Conditional: You must specify either TypeName and Type, or Arn. + TypeName *string `min:"10" type:"string"` } // String returns the string representation -func (s ListStackSetsInput) String() string { +func (s ListTypeVersionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackSetsInput) GoString() string { +func (s ListTypeVersionsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListStackSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListStackSetsInput"} +func (s *ListTypeVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTypeVersionsInput"} if s.MaxResults != nil && *s.MaxResults < 1 { invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if s.NextToken != nil && len(*s.NextToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } + if s.TypeName != nil && len(*s.TypeName) < 10 { + invalidParams.Add(request.NewErrParamMinLen("TypeName", 10)) + } if invalidParams.Len() > 0 { return invalidParams @@ -8900,86 +11064,152 @@ func (s *ListStackSetsInput) Validate() error { return nil } +// SetArn sets the Arn field's value. +func (s *ListTypeVersionsInput) SetArn(v string) *ListTypeVersionsInput { + s.Arn = &v + return s +} + +// SetDeprecatedStatus sets the DeprecatedStatus field's value. +func (s *ListTypeVersionsInput) SetDeprecatedStatus(v string) *ListTypeVersionsInput { + s.DeprecatedStatus = &v + return s +} + // SetMaxResults sets the MaxResults field's value. -func (s *ListStackSetsInput) SetMaxResults(v int64) *ListStackSetsInput { +func (s *ListTypeVersionsInput) SetMaxResults(v int64) *ListTypeVersionsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListStackSetsInput) SetNextToken(v string) *ListStackSetsInput { +func (s *ListTypeVersionsInput) SetNextToken(v string) *ListTypeVersionsInput { s.NextToken = &v return s } -// SetStatus sets the Status field's value. -func (s *ListStackSetsInput) SetStatus(v string) *ListStackSetsInput { - s.Status = &v +// SetType sets the Type field's value. +func (s *ListTypeVersionsInput) SetType(v string) *ListTypeVersionsInput { + s.Type = &v return s } -type ListStackSetsOutput struct { +// SetTypeName sets the TypeName field's value. +func (s *ListTypeVersionsInput) SetTypeName(v string) *ListTypeVersionsInput { + s.TypeName = &v + return s +} + +type ListTypeVersionsOutput struct { _ struct{} `type:"structure"` // If the request doesn't return all of the remaining results, NextToken is - // set to a token. To retrieve the next set of results, call ListStackInstances - // again and assign that token to the request object's NextToken parameter. - // If the request returns all results, NextToken is set to null. + // set to a token. To retrieve the next set of results, call this action again + // and assign that token to the request object's NextToken parameter. If the + // request returns all results, NextToken is set to null. NextToken *string `min:"1" type:"string"` - // A list of StackSetSummary structures that contain information about the user's - // stack sets. - Summaries []*StackSetSummary `type:"list"` + // A list of TypeVersionSummary structures that contain information about the + // specified type's versions. + TypeVersionSummaries []*TypeVersionSummary `type:"list"` } // String returns the string representation -func (s ListStackSetsOutput) String() string { +func (s ListTypeVersionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStackSetsOutput) GoString() string { +func (s ListTypeVersionsOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListStackSetsOutput) SetNextToken(v string) *ListStackSetsOutput { +func (s *ListTypeVersionsOutput) SetNextToken(v string) *ListTypeVersionsOutput { s.NextToken = &v return s } -// SetSummaries sets the Summaries field's value. -func (s *ListStackSetsOutput) SetSummaries(v []*StackSetSummary) *ListStackSetsOutput { - s.Summaries = v +// SetTypeVersionSummaries sets the TypeVersionSummaries field's value. +func (s *ListTypeVersionsOutput) SetTypeVersionSummaries(v []*TypeVersionSummary) *ListTypeVersionsOutput { + s.TypeVersionSummaries = v return s } -// The input for ListStacks action. -type ListStacksInput struct { +type ListTypesInput struct { _ struct{} `type:"structure"` - // A string that identifies the next page of stacks that you want to retrieve. + // The deprecation status of the types that you want to get summary information + // about. + // + // Valid values include: + // + // * LIVE: The type is registered for use in CloudFormation operations. + // + // * DEPRECATED: The type has been deregistered and can no longer be used + // in CloudFormation operations. + DeprecatedStatus *string `type:"string" enum:"DeprecatedStatus"` + + // 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 `min:"1" type:"integer"` + + // If the previous paginated request didn't return all of the remaining results, + // the response object's NextToken parameter value is set to a token. To retrieve + // the next set of results, call this action 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 `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"` + // The provisioning behavior of the type. AWS CloudFormation determines the + // provisioning type during registration, based on the types of handlers in + // the schema handler package submitted. + // + // Valid values include: + // + // * FULLY_MUTABLE: The type includes an update handler to process updates + // to the type during stack update operations. + // + // * IMMUTABLE: The type does not include an update handler, so the type + // cannot be updated and must instead be replaced during stack update operations. + // + // * NON_PROVISIONABLE: The type does not include create, read, and delete + // handlers, and therefore cannot actually be provisioned. + ProvisioningType *string `type:"string" enum:"ProvisioningType"` + + // The scope at which the type is visible and usable in CloudFormation operations. + // + // Valid values include: + // + // * PRIVATE: The type is only visible and usable within the account in which + // it is registered. Currently, AWS CloudFormation marks any types you create + // as PRIVATE. + // + // * PUBLIC: The type is publically visible and usable within any Amazon + // account. + // + // The default is PRIVATE. + Visibility *string `type:"string" enum:"Visibility"` } // String returns the string representation -func (s ListStacksInput) String() string { +func (s ListTypesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStacksInput) GoString() string { +func (s ListTypesInput) 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"} +func (s *ListTypesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTypesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } if s.NextToken != nil && len(*s.NextToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } @@ -8990,50 +11220,130 @@ func (s *ListStacksInput) Validate() error { return nil } +// SetDeprecatedStatus sets the DeprecatedStatus field's value. +func (s *ListTypesInput) SetDeprecatedStatus(v string) *ListTypesInput { + s.DeprecatedStatus = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListTypesInput) SetMaxResults(v int64) *ListTypesInput { + s.MaxResults = &v + return s +} + // SetNextToken sets the NextToken field's value. -func (s *ListStacksInput) SetNextToken(v string) *ListStacksInput { +func (s *ListTypesInput) SetNextToken(v string) *ListTypesInput { s.NextToken = &v return s } -// SetStackStatusFilter sets the StackStatusFilter field's value. -func (s *ListStacksInput) SetStackStatusFilter(v []*string) *ListStacksInput { - s.StackStatusFilter = v +// SetProvisioningType sets the ProvisioningType field's value. +func (s *ListTypesInput) SetProvisioningType(v string) *ListTypesInput { + s.ProvisioningType = &v return s } -// The output for ListStacks action. -type ListStacksOutput struct { +// SetVisibility sets the Visibility field's value. +func (s *ListTypesInput) SetVisibility(v string) *ListTypesInput { + s.Visibility = &v + return s +} + +type ListTypesOutput 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. + // If the request doesn't return all of the remaining results, NextToken is + // set to a token. To retrieve the next set of results, call this action again + // and assign that token to the request object's NextToken parameter. If the + // request returns all results, NextToken is set to null. NextToken *string `min:"1" type:"string"` - // A list of StackSummary structures containing information about the specified - // stacks. - StackSummaries []*StackSummary `type:"list"` + // A list of TypeSummary structures that contain information about the specified + // types. + TypeSummaries []*TypeSummary `type:"list"` } // String returns the string representation -func (s ListStacksOutput) String() string { +func (s ListTypesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStacksOutput) GoString() string { +func (s ListTypesOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListStacksOutput) SetNextToken(v string) *ListStacksOutput { +func (s *ListTypesOutput) SetNextToken(v string) *ListTypesOutput { s.NextToken = &v return s } -// SetStackSummaries sets the StackSummaries field's value. -func (s *ListStacksOutput) SetStackSummaries(v []*StackSummary) *ListStacksOutput { - s.StackSummaries = v +// SetTypeSummaries sets the TypeSummaries field's value. +func (s *ListTypesOutput) SetTypeSummaries(v []*TypeSummary) *ListTypesOutput { + s.TypeSummaries = v + return s +} + +// Contains logging configuration information for a type. +type LoggingConfig struct { + _ struct{} `type:"structure"` + + // The Amazon CloudWatch log group to which CloudFormation sends error logging + // information when invoking the type's handlers. + // + // LogGroupName is a required field + LogGroupName *string `min:"1" type:"string" required:"true"` + + // The ARN of the role that CloudFormation should assume when sending log entries + // to CloudWatch logs. + // + // LogRoleArn is a required field + LogRoleArn *string `min:"1" 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.LogGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("LogGroupName")) + } + if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) + } + if s.LogRoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("LogRoleArn")) + } + if s.LogRoleArn != nil && len(*s.LogRoleArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LogRoleArn", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLogGroupName sets the LogGroupName field's value. +func (s *LoggingConfig) SetLogGroupName(v string) *LoggingConfig { + s.LogGroupName = &v + return s +} + +// SetLogRoleArn sets the LogRoleArn field's value. +func (s *LoggingConfig) SetLogRoleArn(v string) *LoggingConfig { + s.LogRoleArn = &v return s } @@ -9355,6 +11665,296 @@ func (s *PropertyDifference) SetPropertyPath(v string) *PropertyDifference { return s } +type RecordHandlerProgressInput struct { + _ struct{} `type:"structure"` + + // Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + // + // BearerToken is a required field + BearerToken *string `min:"1" type:"string" required:"true"` + + // Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + ClientRequestToken *string `min:"1" type:"string"` + + // Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + CurrentOperationStatus *string `type:"string" enum:"OperationStatus"` + + // Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + ErrorCode *string `type:"string" enum:"HandlerErrorCode"` + + // Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + // + // OperationStatus is a required field + OperationStatus *string `type:"string" required:"true" enum:"OperationStatus"` + + // Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + ResourceModel *string `min:"1" type:"string"` + + // Reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + StatusMessage *string `type:"string"` +} + +// String returns the string representation +func (s RecordHandlerProgressInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RecordHandlerProgressInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RecordHandlerProgressInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RecordHandlerProgressInput"} + if s.BearerToken == nil { + invalidParams.Add(request.NewErrParamRequired("BearerToken")) + } + if s.BearerToken != nil && len(*s.BearerToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("BearerToken", 1)) + } + if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) + } + if s.OperationStatus == nil { + invalidParams.Add(request.NewErrParamRequired("OperationStatus")) + } + if s.ResourceModel != nil && len(*s.ResourceModel) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceModel", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBearerToken sets the BearerToken field's value. +func (s *RecordHandlerProgressInput) SetBearerToken(v string) *RecordHandlerProgressInput { + s.BearerToken = &v + return s +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *RecordHandlerProgressInput) SetClientRequestToken(v string) *RecordHandlerProgressInput { + s.ClientRequestToken = &v + return s +} + +// SetCurrentOperationStatus sets the CurrentOperationStatus field's value. +func (s *RecordHandlerProgressInput) SetCurrentOperationStatus(v string) *RecordHandlerProgressInput { + s.CurrentOperationStatus = &v + return s +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *RecordHandlerProgressInput) SetErrorCode(v string) *RecordHandlerProgressInput { + s.ErrorCode = &v + return s +} + +// SetOperationStatus sets the OperationStatus field's value. +func (s *RecordHandlerProgressInput) SetOperationStatus(v string) *RecordHandlerProgressInput { + s.OperationStatus = &v + return s +} + +// SetResourceModel sets the ResourceModel field's value. +func (s *RecordHandlerProgressInput) SetResourceModel(v string) *RecordHandlerProgressInput { + s.ResourceModel = &v + return s +} + +// SetStatusMessage sets the StatusMessage field's value. +func (s *RecordHandlerProgressInput) SetStatusMessage(v string) *RecordHandlerProgressInput { + s.StatusMessage = &v + return s +} + +type RecordHandlerProgressOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RecordHandlerProgressOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RecordHandlerProgressOutput) GoString() string { + return s.String() +} + +type RegisterTypeInput struct { + _ struct{} `type:"structure"` + + // A unique identifier that acts as an idempotency key for this registration + // request. Specifying a client request token prevents CloudFormation from generating + // more than one version of a type from the same registeration request, even + // if the request is submitted multiple times. + ClientRequestToken *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the IAM execution role to use to register + // the type. If your resource type calls AWS APIs in any of its handlers, you + // must create an IAM execution role (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) + // that includes the necessary permissions to call those AWS APIs, and provision + // that execution role in your account. CloudFormation then assumes that execution + // role to provide your resource type with the appropriate credentials. + ExecutionRoleArn *string `min:"1" type:"string"` + + // Specifies logging configuration information for a type. + LoggingConfig *LoggingConfig `type:"structure"` + + // A url to the S3 bucket containing the schema handler package that contains + // the schema, event handlers, and associated files for the type you want to + // register. + // + // For information on generating a schema handler package for the type you want + // to register, see submit (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-type-cli-submit.html) + // in the CloudFormation CLI User Guide. + // + // As part of registering a resource provider type, CloudFormation must be able + // to access the S3 bucket which contains the schema handler package for that + // resource provider. For more information, see IAM Permissions for Registering + // a Resource Provider (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/registry.html#registry-register-permissions) + // in the AWS CloudFormation User Guide. + // + // SchemaHandlerPackage is a required field + SchemaHandlerPackage *string `min:"1" type:"string" required:"true"` + + // The kind of type. + // + // Currently, the only valid value is RESOURCE. + Type *string `type:"string" enum:"RegistryType"` + + // The name of the type being registered. + // + // We recommend that type names adhere to the following pattern: company_or_organization::service::type. + // + // The following organization namespaces are reserved and cannot be used in + // your resource type names: + // + // * Alexa + // + // * AMZN + // + // * Amazon + // + // * AWS + // + // * Custom + // + // * Dev + // + // TypeName is a required field + TypeName *string `min:"10" type:"string" required:"true"` +} + +// String returns the string representation +func (s RegisterTypeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterTypeInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RegisterTypeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RegisterTypeInput"} + if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) + } + if s.ExecutionRoleArn != nil && len(*s.ExecutionRoleArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleArn", 1)) + } + if s.SchemaHandlerPackage == nil { + invalidParams.Add(request.NewErrParamRequired("SchemaHandlerPackage")) + } + if s.SchemaHandlerPackage != nil && len(*s.SchemaHandlerPackage) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SchemaHandlerPackage", 1)) + } + if s.TypeName == nil { + invalidParams.Add(request.NewErrParamRequired("TypeName")) + } + if s.TypeName != nil && len(*s.TypeName) < 10 { + invalidParams.Add(request.NewErrParamMinLen("TypeName", 10)) + } + if s.LoggingConfig != nil { + if err := s.LoggingConfig.Validate(); err != nil { + invalidParams.AddNested("LoggingConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *RegisterTypeInput) SetClientRequestToken(v string) *RegisterTypeInput { + s.ClientRequestToken = &v + return s +} + +// SetExecutionRoleArn sets the ExecutionRoleArn field's value. +func (s *RegisterTypeInput) SetExecutionRoleArn(v string) *RegisterTypeInput { + s.ExecutionRoleArn = &v + return s +} + +// SetLoggingConfig sets the LoggingConfig field's value. +func (s *RegisterTypeInput) SetLoggingConfig(v *LoggingConfig) *RegisterTypeInput { + s.LoggingConfig = v + return s +} + +// SetSchemaHandlerPackage sets the SchemaHandlerPackage field's value. +func (s *RegisterTypeInput) SetSchemaHandlerPackage(v string) *RegisterTypeInput { + s.SchemaHandlerPackage = &v + return s +} + +// SetType sets the Type field's value. +func (s *RegisterTypeInput) SetType(v string) *RegisterTypeInput { + s.Type = &v + return s +} + +// SetTypeName sets the TypeName field's value. +func (s *RegisterTypeInput) SetTypeName(v string) *RegisterTypeInput { + s.TypeName = &v + return s +} + +type RegisterTypeOutput struct { + _ struct{} `type:"structure"` + + // The identifier for this registration request. + // + // Use this registration token when calling DescribeTypeRegistration , which + // returns information about the status and IDs of the type registration. + RegistrationToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s RegisterTypeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterTypeOutput) GoString() string { + return s.String() +} + +// SetRegistrationToken sets the RegistrationToken field's value. +func (s *RegisterTypeOutput) SetRegistrationToken(v string) *RegisterTypeOutput { + s.RegistrationToken = &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. type ResourceChange struct { @@ -9524,21 +12124,68 @@ func (s *ResourceChangeDetail) SetCausingEntity(v string) *ResourceChangeDetail return s } -// SetChangeSource sets the ChangeSource field's value. -func (s *ResourceChangeDetail) SetChangeSource(v string) *ResourceChangeDetail { - s.ChangeSource = &v +// 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 +} + +// Describes the target resources of a specific type in your import template +// (for example, all AWS::S3::Bucket resources) and the properties you can provide +// during the import to identify resources of that type. +type ResourceIdentifierSummary struct { + _ struct{} `type:"structure"` + + // The logical IDs of the target resources of the specified ResourceType, as + // defined in the import template. + LogicalResourceIds []*string `min:"1" type:"list"` + + // The resource properties you can provide during the import to identify your + // target resources. For example, BucketName is a possible identifier property + // for AWS::S3::Bucket resources. + ResourceIdentifiers []*string `type:"list"` + + // The template resource type of the target resources, such as AWS::S3::Bucket. + ResourceType *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ResourceIdentifierSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceIdentifierSummary) GoString() string { + return s.String() +} + +// SetLogicalResourceIds sets the LogicalResourceIds field's value. +func (s *ResourceIdentifierSummary) SetLogicalResourceIds(v []*string) *ResourceIdentifierSummary { + s.LogicalResourceIds = v return s } -// SetEvaluation sets the Evaluation field's value. -func (s *ResourceChangeDetail) SetEvaluation(v string) *ResourceChangeDetail { - s.Evaluation = &v +// SetResourceIdentifiers sets the ResourceIdentifiers field's value. +func (s *ResourceIdentifierSummary) SetResourceIdentifiers(v []*string) *ResourceIdentifierSummary { + s.ResourceIdentifiers = v return s } -// SetTarget sets the Target field's value. -func (s *ResourceChangeDetail) SetTarget(v *ResourceTargetDefinition) *ResourceChangeDetail { - s.Target = v +// SetResourceType sets the ResourceType field's value. +func (s *ResourceIdentifierSummary) SetResourceType(v string) *ResourceIdentifierSummary { + s.ResourceType = &v return s } @@ -9591,6 +12238,81 @@ func (s *ResourceTargetDefinition) SetRequiresRecreation(v string) *ResourceTarg return s } +// Describes the target resource of an import operation. +type ResourceToImport struct { + _ struct{} `type:"structure"` + + // The logical ID of the target resource as specified in the template. + // + // LogicalResourceId is a required field + LogicalResourceId *string `type:"string" required:"true"` + + // A key-value pair that identifies the target resource. The key is an identifier + // property (for example, BucketName for AWS::S3::Bucket resources) and the + // value is the actual property value (for example, MyS3Bucket). + // + // ResourceIdentifier is a required field + ResourceIdentifier map[string]*string `min:"1" type:"map" required:"true"` + + // The type of resource to import into your stack, such as AWS::S3::Bucket. + // + // ResourceType is a required field + ResourceType *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ResourceToImport) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceToImport) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResourceToImport) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResourceToImport"} + if s.LogicalResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("LogicalResourceId")) + } + if s.ResourceIdentifier == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceIdentifier")) + } + if s.ResourceIdentifier != nil && len(s.ResourceIdentifier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceIdentifier", 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 +} + +// SetLogicalResourceId sets the LogicalResourceId field's value. +func (s *ResourceToImport) SetLogicalResourceId(v string) *ResourceToImport { + s.LogicalResourceId = &v + return s +} + +// SetResourceIdentifier sets the ResourceIdentifier field's value. +func (s *ResourceToImport) SetResourceIdentifier(v map[string]*string) *ResourceToImport { + s.ResourceIdentifier = v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ResourceToImport) SetResourceType(v string) *ResourceToImport { + s.ResourceType = &v + return s +} + // Structure containing the rollback triggers for AWS CloudFormation to monitor // during stack creation and updating operations, and for the specified monitoring // period afterwards. @@ -9833,6 +12555,95 @@ func (s SetStackPolicyOutput) GoString() string { return s.String() } +type SetTypeDefaultVersionInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the type for which you want version summary + // information. + // + // Conditional: You must specify either TypeName and Type, or Arn. + Arn *string `type:"string"` + + // The kind of type. + // + // Conditional: You must specify either TypeName and Type, or Arn. + Type *string `type:"string" enum:"RegistryType"` + + // The name of the type. + // + // Conditional: You must specify either TypeName and Type, or Arn. + TypeName *string `min:"10" type:"string"` + + // The ID of a specific version of the type. The version ID is the value at + // the end of the Amazon Resource Name (ARN) assigned to the type version when + // it is registered. + VersionId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s SetTypeDefaultVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetTypeDefaultVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetTypeDefaultVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SetTypeDefaultVersionInput"} + if s.TypeName != nil && len(*s.TypeName) < 10 { + invalidParams.Add(request.NewErrParamMinLen("TypeName", 10)) + } + if s.VersionId != nil && len(*s.VersionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VersionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *SetTypeDefaultVersionInput) SetArn(v string) *SetTypeDefaultVersionInput { + s.Arn = &v + return s +} + +// SetType sets the Type field's value. +func (s *SetTypeDefaultVersionInput) SetType(v string) *SetTypeDefaultVersionInput { + s.Type = &v + return s +} + +// SetTypeName sets the TypeName field's value. +func (s *SetTypeDefaultVersionInput) SetTypeName(v string) *SetTypeDefaultVersionInput { + s.TypeName = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *SetTypeDefaultVersionInput) SetVersionId(v string) *SetTypeDefaultVersionInput { + s.VersionId = &v + return s +} + +type SetTypeDefaultVersionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s SetTypeDefaultVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SetTypeDefaultVersionOutput) GoString() string { + return s.String() +} + // The input for the SignalResource action. type SignalResourceInput struct { _ struct{} `type:"structure"` @@ -10014,7 +12825,7 @@ type Stack struct { RollbackConfiguration *RollbackConfiguration `type:"structure"` // For nested stacks--stacks created as resources for another stack--the stack - // ID of the the top-level stack to which the nested stack ultimately belongs. + // ID of the top-level stack to which the nested stack ultimately belongs. // // For more information, see Working with Nested Stacks (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html) // in the AWS CloudFormation User Guide. @@ -10435,9 +13246,36 @@ func (s *StackEvent) SetTimestamp(v time.Time) *StackEvent { type StackInstance struct { _ struct{} `type:"structure"` - // The name of the AWS account that the stack instance is associated with. + // [Self-managed permissions] The name of the AWS account that the stack instance + // is associated with. Account *string `type:"string"` + // Status of the stack instance's actual configuration compared to the expected + // template and parameter configuration of the stack set to which it belongs. + // + // * DRIFTED: The stack differs from the expected template and parameter + // configuration of the stack set to which it belongs. A stack instance is + // considered to have drifted if one or more of the resources in the associated + // stack have drifted. + // + // * NOT_CHECKED: AWS CloudFormation has not checked if the stack instance + // differs from its expected stack set configuration. + // + // * IN_SYNC: The stack instance's actual configuration matches its expected + // stack set configuration. + // + // * UNKNOWN: This value is reserved for future use. + DriftStatus *string `type:"string" enum:"StackDriftStatus"` + + // Most recent time when CloudFormation performed a drift detection operation + // on the stack instance. This value will be NULL for any stack instance on + // which drift detection has not yet been performed. + LastDriftCheckTimestamp *time.Time `type:"timestamp"` + + // [Service-managed permissions] The organization root ID or organizational + // unit (OU) ID that the stack instance is associated with. + OrganizationalUnitId *string `type:"string"` + // A list of parameters from the stack set template whose values have been overridden // in this stack instance. ParameterOverrides []*Parameter `type:"list"` @@ -10490,6 +13328,24 @@ func (s *StackInstance) SetAccount(v string) *StackInstance { return s } +// SetDriftStatus sets the DriftStatus field's value. +func (s *StackInstance) SetDriftStatus(v string) *StackInstance { + s.DriftStatus = &v + return s +} + +// SetLastDriftCheckTimestamp sets the LastDriftCheckTimestamp field's value. +func (s *StackInstance) SetLastDriftCheckTimestamp(v time.Time) *StackInstance { + s.LastDriftCheckTimestamp = &v + return s +} + +// SetOrganizationalUnitId sets the OrganizationalUnitId field's value. +func (s *StackInstance) SetOrganizationalUnitId(v string) *StackInstance { + s.OrganizationalUnitId = &v + return s +} + // SetParameterOverrides sets the ParameterOverrides field's value. func (s *StackInstance) SetParameterOverrides(v []*Parameter) *StackInstance { s.ParameterOverrides = v @@ -10530,9 +13386,36 @@ func (s *StackInstance) SetStatusReason(v string) *StackInstance { type StackInstanceSummary struct { _ struct{} `type:"structure"` - // The name of the AWS account that the stack instance is associated with. + // [Self-managed permissions] The name of the AWS account that the stack instance + // is associated with. Account *string `type:"string"` + // Status of the stack instance's actual configuration compared to the expected + // template and parameter configuration of the stack set to which it belongs. + // + // * DRIFTED: The stack differs from the expected template and parameter + // configuration of the stack set to which it belongs. A stack instance is + // considered to have drifted if one or more of the resources in the associated + // stack have drifted. + // + // * NOT_CHECKED: AWS CloudFormation has not checked if the stack instance + // differs from its expected stack set configuration. + // + // * IN_SYNC: The stack instance's actual configuration matches its expected + // stack set configuration. + // + // * UNKNOWN: This value is reserved for future use. + DriftStatus *string `type:"string" enum:"StackDriftStatus"` + + // Most recent time when CloudFormation performed a drift detection operation + // on the stack instance. This value will be NULL for any stack instance on + // which drift detection has not yet been performed. + LastDriftCheckTimestamp *time.Time `type:"timestamp"` + + // [Service-managed permissions] The organization root ID or organizational + // unit (OU) ID that the stack instance is associated with. + OrganizationalUnitId *string `type:"string"` + // The name of the AWS region that the stack instance is associated with. Region *string `type:"string"` @@ -10580,6 +13463,24 @@ func (s *StackInstanceSummary) SetAccount(v string) *StackInstanceSummary { return s } +// SetDriftStatus sets the DriftStatus field's value. +func (s *StackInstanceSummary) SetDriftStatus(v string) *StackInstanceSummary { + s.DriftStatus = &v + return s +} + +// SetLastDriftCheckTimestamp sets the LastDriftCheckTimestamp field's value. +func (s *StackInstanceSummary) SetLastDriftCheckTimestamp(v time.Time) *StackInstanceSummary { + s.LastDriftCheckTimestamp = &v + return s +} + +// SetOrganizationalUnitId sets the OrganizationalUnitId field's value. +func (s *StackInstanceSummary) SetOrganizationalUnitId(v string) *StackInstanceSummary { + s.OrganizationalUnitId = &v + return s +} + // SetRegion sets the Region field's value. func (s *StackInstanceSummary) SetRegion(v string) *StackInstanceSummary { s.Region = &v @@ -11223,6 +14124,11 @@ type StackSet struct { // in the AWS CloudFormation User Guide. AdministrationRoleARN *string `min:"20" type:"string"` + // [Service-managed permissions] Describes whether StackSets automatically deploys + // to AWS Organizations accounts that are added to a target organization or + // organizational unit (OU). + AutoDeployment *AutoDeployment `type:"structure"` + // The capabilities that are allowed in the stack set. Some stack set templates // might include resources that can affect permissions in your AWS account—for // example, by creating new AWS Identity and Access Management (IAM) users. @@ -11240,12 +14146,35 @@ type StackSet struct { // groups can include in their stack sets. ExecutionRoleName *string `min:"1" type:"string"` + // [Service-managed permissions] The organization root ID or organizational + // unit (OUs) IDs to which stacks in your stack set have been deployed. + OrganizationalUnitIds []*string `type:"list"` + // A list of input parameters for a stack set. Parameters []*Parameter `type:"list"` + // Describes how the IAM roles required for stack set operations are created. + // + // * With self-managed permissions, you must create the administrator and + // execution roles required to deploy to target accounts. For more information, + // see Grant Self-Managed Stack Set Permissions (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html). + // + // * With service-managed permissions, StackSets automatically creates the + // IAM roles required to deploy to accounts managed by AWS Organizations. + // For more information, see Grant Service-Managed Stack Set Permissions + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-service-managed.html). + PermissionModel *string `type:"string" enum:"PermissionModels"` + // The Amazon Resource Number (ARN) of the stack set. StackSetARN *string `type:"string"` + // Detailed information about the drift status of the stack set. + // + // For stack sets, contains information about the last completed drift operation + // performed on the stack set. Information about drift operations currently + // in progress is not included. + StackSetDriftDetectionDetails *StackSetDriftDetectionDetails `type:"structure"` + // The ID of the stack set. StackSetId *string `type:"string"` @@ -11280,63 +14209,226 @@ func (s *StackSet) SetAdministrationRoleARN(v string) *StackSet { return s } +// SetAutoDeployment sets the AutoDeployment field's value. +func (s *StackSet) SetAutoDeployment(v *AutoDeployment) *StackSet { + s.AutoDeployment = v + return s +} + // SetCapabilities sets the Capabilities field's value. func (s *StackSet) SetCapabilities(v []*string) *StackSet { s.Capabilities = v return s } -// SetDescription sets the Description field's value. -func (s *StackSet) SetDescription(v string) *StackSet { - s.Description = &v - return s +// SetDescription sets the Description field's value. +func (s *StackSet) SetDescription(v string) *StackSet { + s.Description = &v + return s +} + +// SetExecutionRoleName sets the ExecutionRoleName field's value. +func (s *StackSet) SetExecutionRoleName(v string) *StackSet { + s.ExecutionRoleName = &v + return s +} + +// SetOrganizationalUnitIds sets the OrganizationalUnitIds field's value. +func (s *StackSet) SetOrganizationalUnitIds(v []*string) *StackSet { + s.OrganizationalUnitIds = v + return s +} + +// SetParameters sets the Parameters field's value. +func (s *StackSet) SetParameters(v []*Parameter) *StackSet { + s.Parameters = v + return s +} + +// SetPermissionModel sets the PermissionModel field's value. +func (s *StackSet) SetPermissionModel(v string) *StackSet { + s.PermissionModel = &v + return s +} + +// SetStackSetARN sets the StackSetARN field's value. +func (s *StackSet) SetStackSetARN(v string) *StackSet { + s.StackSetARN = &v + return s +} + +// SetStackSetDriftDetectionDetails sets the StackSetDriftDetectionDetails field's value. +func (s *StackSet) SetStackSetDriftDetectionDetails(v *StackSetDriftDetectionDetails) *StackSet { + s.StackSetDriftDetectionDetails = v + return s +} + +// SetStackSetId sets the StackSetId field's value. +func (s *StackSet) SetStackSetId(v string) *StackSet { + s.StackSetId = &v + return s +} + +// SetStackSetName sets the StackSetName field's value. +func (s *StackSet) SetStackSetName(v string) *StackSet { + s.StackSetName = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *StackSet) SetStatus(v string) *StackSet { + s.Status = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *StackSet) SetTags(v []*Tag) *StackSet { + s.Tags = v + return s +} + +// SetTemplateBody sets the TemplateBody field's value. +func (s *StackSet) SetTemplateBody(v string) *StackSet { + s.TemplateBody = &v + return s +} + +// Detailed information about the drift status of the stack set. +// +// For stack sets, contains information about the last completed drift operation +// performed on the stack set. Information about drift operations in-progress +// is not included. +// +// For stack set operations, includes information about drift operations currently +// being performed on the stack set. +// +// For more information, see Detecting Unmanaged Changes in Stack Sets (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html) +// in the AWS CloudFormation User Guide. +type StackSetDriftDetectionDetails struct { + _ struct{} `type:"structure"` + + // The status of the stack set drift detection operation. + // + // * COMPLETED: The drift detection operation completed without failing on + // any stack instances. + // + // * FAILED: The drift detection operation exceeded the specified failure + // tolerance. + // + // * PARTIAL_SUCCESS: The drift detection operation completed without exceeding + // the failure tolerance for the operation. + // + // * IN_PROGRESS: The drift detection operation is currently being performed. + // + // * STOPPED: The user has cancelled the drift detection operation. + DriftDetectionStatus *string `type:"string" enum:"StackSetDriftDetectionStatus"` + + // Status of the stack set's actual configuration compared to its expected template + // and parameter configuration. A stack set is considered to have drifted if + // one or more of its stack instances have drifted from their expected template + // and parameter configuration. + // + // * DRIFTED: One or more of the stack instances belonging to the stack set + // stack differs from the expected template and parameter configuration. + // A stack instance is considered to have drifted if one or more of the resources + // in the associated stack have drifted. + // + // * NOT_CHECKED: AWS CloudFormation has not checked the stack set for drift. + // + // * IN_SYNC: All of the stack instances belonging to the stack set stack + // match from the expected template and parameter configuration. + DriftStatus *string `type:"string" enum:"StackSetDriftStatus"` + + // The number of stack instances that have drifted from the expected template + // and parameter configuration of the stack set. A stack instance is considered + // to have drifted if one or more of the resources in the associated stack do + // not match their expected configuration. + DriftedStackInstancesCount *int64 `type:"integer"` + + // The number of stack instances for which the drift detection operation failed. + FailedStackInstancesCount *int64 `type:"integer"` + + // The number of stack instances that are currently being checked for drift. + InProgressStackInstancesCount *int64 `type:"integer"` + + // The number of stack instances which match the expected template and parameter + // configuration of the stack set. + InSyncStackInstancesCount *int64 `type:"integer"` + + // Most recent time when CloudFormation performed a drift detection operation + // on the stack set. This value will be NULL for any stack set on which drift + // detection has not yet been performed. + LastDriftCheckTimestamp *time.Time `type:"timestamp"` + + // The total number of stack instances belonging to this stack set. + // + // The total number of stack instances is equal to the total of: + // + // * Stack instances that match the stack set configuration. + // + // * Stack instances that have drifted from the stack set configuration. + // + // * Stack instances where the drift detection operation has failed. + // + // * Stack instances currently being checked for drift. + TotalStackInstancesCount *int64 `type:"integer"` +} + +// String returns the string representation +func (s StackSetDriftDetectionDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StackSetDriftDetectionDetails) GoString() string { + return s.String() } -// SetExecutionRoleName sets the ExecutionRoleName field's value. -func (s *StackSet) SetExecutionRoleName(v string) *StackSet { - s.ExecutionRoleName = &v +// SetDriftDetectionStatus sets the DriftDetectionStatus field's value. +func (s *StackSetDriftDetectionDetails) SetDriftDetectionStatus(v string) *StackSetDriftDetectionDetails { + s.DriftDetectionStatus = &v return s } -// SetParameters sets the Parameters field's value. -func (s *StackSet) SetParameters(v []*Parameter) *StackSet { - s.Parameters = v +// SetDriftStatus sets the DriftStatus field's value. +func (s *StackSetDriftDetectionDetails) SetDriftStatus(v string) *StackSetDriftDetectionDetails { + s.DriftStatus = &v return s } -// SetStackSetARN sets the StackSetARN field's value. -func (s *StackSet) SetStackSetARN(v string) *StackSet { - s.StackSetARN = &v +// SetDriftedStackInstancesCount sets the DriftedStackInstancesCount field's value. +func (s *StackSetDriftDetectionDetails) SetDriftedStackInstancesCount(v int64) *StackSetDriftDetectionDetails { + s.DriftedStackInstancesCount = &v return s } -// SetStackSetId sets the StackSetId field's value. -func (s *StackSet) SetStackSetId(v string) *StackSet { - s.StackSetId = &v +// SetFailedStackInstancesCount sets the FailedStackInstancesCount field's value. +func (s *StackSetDriftDetectionDetails) SetFailedStackInstancesCount(v int64) *StackSetDriftDetectionDetails { + s.FailedStackInstancesCount = &v return s } -// SetStackSetName sets the StackSetName field's value. -func (s *StackSet) SetStackSetName(v string) *StackSet { - s.StackSetName = &v +// SetInProgressStackInstancesCount sets the InProgressStackInstancesCount field's value. +func (s *StackSetDriftDetectionDetails) SetInProgressStackInstancesCount(v int64) *StackSetDriftDetectionDetails { + s.InProgressStackInstancesCount = &v return s } -// SetStatus sets the Status field's value. -func (s *StackSet) SetStatus(v string) *StackSet { - s.Status = &v +// SetInSyncStackInstancesCount sets the InSyncStackInstancesCount field's value. +func (s *StackSetDriftDetectionDetails) SetInSyncStackInstancesCount(v int64) *StackSetDriftDetectionDetails { + s.InSyncStackInstancesCount = &v return s } -// SetTags sets the Tags field's value. -func (s *StackSet) SetTags(v []*Tag) *StackSet { - s.Tags = v +// SetLastDriftCheckTimestamp sets the LastDriftCheckTimestamp field's value. +func (s *StackSetDriftDetectionDetails) SetLastDriftCheckTimestamp(v time.Time) *StackSetDriftDetectionDetails { + s.LastDriftCheckTimestamp = &v return s } -// SetTemplateBody sets the TemplateBody field's value. -func (s *StackSet) SetTemplateBody(v string) *StackSet { - s.TemplateBody = &v +// SetTotalStackInstancesCount sets the TotalStackInstancesCount field's value. +func (s *StackSetDriftDetectionDetails) SetTotalStackInstancesCount(v int64) *StackSetDriftDetectionDetails { + s.TotalStackInstancesCount = &v return s } @@ -11366,6 +14458,10 @@ type StackSetOperation struct { // before actually creating the first stacks. CreationTimestamp *time.Time `type:"timestamp"` + // [Service-managed permissions] The AWS Organizations accounts affected by + // the stack operation. + DeploymentTargets *DeploymentTargets `type:"structure"` + // The time at which the stack set operation ended, across all accounts and // regions specified. Note that this doesn't necessarily mean that the stack // set operation was successful, or even attempted, in each account or region. @@ -11389,6 +14485,17 @@ type StackSetOperation struct { // stack to a new stack set. RetainStacks *bool `type:"boolean"` + // Detailed information about the drift status of the stack set. This includes + // information about drift operations currently being performed on the stack + // set. + // + // this information will only be present for stack set operations whose Action + // type is DETECT_DRIFT. + // + // For more information, see Detecting Unmanaged Changes in Stack Sets (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-drift.html) + // in the AWS CloudFormation User Guide. + StackSetDriftDetectionDetails *StackSetDriftDetectionDetails `type:"structure"` + // The ID of the stack set. StackSetId *string `type:"string"` @@ -11402,6 +14509,11 @@ type StackSetOperation struct { // status of the operation as a whole to FAILED, and AWS CloudFormation cancels // the operation in any remaining regions. // + // * QUEUED: [Service-managed permissions] For automatic deployments that + // require a sequence of operations. The operation is queued to be performed. + // For more information, see the stack set operation status codes (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-status-codes) + // in the AWS CloudFormation User Guide. + // // * RUNNING: The operation is currently being performed. // // * STOPPED: The user has cancelled the operation. @@ -11441,6 +14553,12 @@ func (s *StackSetOperation) SetCreationTimestamp(v time.Time) *StackSetOperation return s } +// SetDeploymentTargets sets the DeploymentTargets field's value. +func (s *StackSetOperation) SetDeploymentTargets(v *DeploymentTargets) *StackSetOperation { + s.DeploymentTargets = v + return s +} + // SetEndTimestamp sets the EndTimestamp field's value. func (s *StackSetOperation) SetEndTimestamp(v time.Time) *StackSetOperation { s.EndTimestamp = &v @@ -11471,6 +14589,12 @@ func (s *StackSetOperation) SetRetainStacks(v bool) *StackSetOperation { return s } +// SetStackSetDriftDetectionDetails sets the StackSetDriftDetectionDetails field's value. +func (s *StackSetOperation) SetStackSetDriftDetectionDetails(v *StackSetDriftDetectionDetails) *StackSetOperation { + s.StackSetDriftDetectionDetails = v + return s +} + // SetStackSetId sets the StackSetId field's value. func (s *StackSetOperation) SetStackSetId(v string) *StackSetOperation { s.StackSetId = &v @@ -11605,13 +14729,18 @@ func (s *StackSetOperationPreferences) SetRegionOrder(v []*string) *StackSetOper type StackSetOperationResultSummary struct { _ struct{} `type:"structure"` - // The name of the AWS account for this operation result. + // [Self-managed permissions] The name of the AWS account for this operation + // result. Account *string `type:"string"` // The results of the account gate function AWS CloudFormation invokes, if present, // before proceeding with stack set operations in an account AccountGateResult *AccountGateResult `type:"structure"` + // [Service-managed permissions] The organization root ID or organizational + // unit (OU) ID for this operation result. + OrganizationalUnitId *string `type:"string"` + // The name of the AWS region for this operation result. Region *string `type:"string"` @@ -11662,6 +14791,12 @@ func (s *StackSetOperationResultSummary) SetAccountGateResult(v *AccountGateResu return s } +// SetOrganizationalUnitId sets the OrganizationalUnitId field's value. +func (s *StackSetOperationResultSummary) SetOrganizationalUnitId(v string) *StackSetOperationResultSummary { + s.OrganizationalUnitId = &v + return s +} + // SetRegion sets the Region field's value. func (s *StackSetOperationResultSummary) SetRegion(v string) *StackSetOperationResultSummary { s.Region = &v @@ -11715,6 +14850,11 @@ type StackSetOperationSummary struct { // status of the operation as a whole to FAILED, and AWS CloudFormation cancels // the operation in any remaining regions. // + // * QUEUED: [Service-managed permissions] For automatic deployments that + // require a sequence of operations. The operation is queued to be performed. + // For more information, see the stack set operation status codes (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-concepts.html#stackset-status-codes) + // in the AWS CloudFormation User Guide. + // // * RUNNING: The operation is currently being performed. // // * STOPPED: The user has cancelled the operation. @@ -11771,10 +14911,50 @@ func (s *StackSetOperationSummary) SetStatus(v string) *StackSetOperationSummary type StackSetSummary struct { _ struct{} `type:"structure"` + // [Service-managed permissions] Describes whether StackSets automatically deploys + // to AWS Organizations accounts that are added to a target organizational unit + // (OU). + AutoDeployment *AutoDeployment `type:"structure"` + // A description of the stack set that you specify when the stack set is created // or updated. Description *string `min:"1" type:"string"` + // Status of the stack set's actual configuration compared to its expected template + // and parameter configuration. A stack set is considered to have drifted if + // one or more of its stack instances have drifted from their expected template + // and parameter configuration. + // + // * DRIFTED: One or more of the stack instances belonging to the stack set + // stack differs from the expected template and parameter configuration. + // A stack instance is considered to have drifted if one or more of the resources + // in the associated stack have drifted. + // + // * NOT_CHECKED: AWS CloudFormation has not checked the stack set for drift. + // + // * IN_SYNC: All of the stack instances belonging to the stack set stack + // match from the expected template and parameter configuration. + // + // * UNKNOWN: This value is reserved for future use. + DriftStatus *string `type:"string" enum:"StackDriftStatus"` + + // Most recent time when CloudFormation performed a drift detection operation + // on the stack set. This value will be NULL for any stack set on which drift + // detection has not yet been performed. + LastDriftCheckTimestamp *time.Time `type:"timestamp"` + + // Describes how the IAM roles required for stack set operations are created. + // + // * With self-managed permissions, you must create the administrator and + // execution roles required to deploy to target accounts. For more information, + // see Grant Self-Managed Stack Set Permissions (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html). + // + // * With service-managed permissions, StackSets automatically creates the + // IAM roles required to deploy to accounts managed by AWS Organizations. + // For more information, see Grant Service-Managed Stack Set Permissions + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-service-managed.html). + PermissionModel *string `type:"string" enum:"PermissionModels"` + // The ID of the stack set. StackSetId *string `type:"string"` @@ -11795,12 +14975,36 @@ func (s StackSetSummary) GoString() string { return s.String() } +// SetAutoDeployment sets the AutoDeployment field's value. +func (s *StackSetSummary) SetAutoDeployment(v *AutoDeployment) *StackSetSummary { + s.AutoDeployment = v + return s +} + // SetDescription sets the Description field's value. func (s *StackSetSummary) SetDescription(v string) *StackSetSummary { s.Description = &v return s } +// SetDriftStatus sets the DriftStatus field's value. +func (s *StackSetSummary) SetDriftStatus(v string) *StackSetSummary { + s.DriftStatus = &v + return s +} + +// SetLastDriftCheckTimestamp sets the LastDriftCheckTimestamp field's value. +func (s *StackSetSummary) SetLastDriftCheckTimestamp(v time.Time) *StackSetSummary { + s.LastDriftCheckTimestamp = &v + return s +} + +// SetPermissionModel sets the PermissionModel field's value. +func (s *StackSetSummary) SetPermissionModel(v string) *StackSetSummary { + s.PermissionModel = &v + return s +} + // SetStackSetId sets the StackSetId field's value. func (s *StackSetSummary) SetStackSetId(v string) *StackSetSummary { s.StackSetId = &v @@ -11850,7 +15054,7 @@ type StackSummary struct { ParentId *string `type:"string"` // For nested stacks--stacks created as resources for another stack--the stack - // ID of the the top-level stack to which the nested stack ultimately belongs. + // ID of the top-level stack to which the nested stack ultimately belongs. // // For more information, see Working with Nested Stacks (http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-nested-stacks.html) // in the AWS CloudFormation User Guide. @@ -12137,11 +15341,155 @@ func (s *TemplateParameter) SetParameterKey(v string) *TemplateParameter { return s } +// Contains summary information about the specified CloudFormation type. +type TypeSummary struct { + _ struct{} `type:"structure"` + + // The ID of the default version of the type. The default version is used when + // the type version is not specified. + // + // To set the default version of a type, use SetTypeDefaultVersion . + DefaultVersionId *string `min:"1" type:"string"` + + // The description of the type. + Description *string `min:"1" type:"string"` + + // When the current default version of the type was registered. + LastUpdated *time.Time `type:"timestamp"` + + // The kind of type. + Type *string `type:"string" enum:"RegistryType"` + + // The Amazon Resource Name (ARN) of the type. + TypeArn *string `type:"string"` + + // The name of the type. + TypeName *string `min:"10" type:"string"` +} + +// String returns the string representation +func (s TypeSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TypeSummary) GoString() string { + return s.String() +} + +// SetDefaultVersionId sets the DefaultVersionId field's value. +func (s *TypeSummary) SetDefaultVersionId(v string) *TypeSummary { + s.DefaultVersionId = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *TypeSummary) SetDescription(v string) *TypeSummary { + s.Description = &v + return s +} + +// SetLastUpdated sets the LastUpdated field's value. +func (s *TypeSummary) SetLastUpdated(v time.Time) *TypeSummary { + s.LastUpdated = &v + return s +} + +// SetType sets the Type field's value. +func (s *TypeSummary) SetType(v string) *TypeSummary { + s.Type = &v + return s +} + +// SetTypeArn sets the TypeArn field's value. +func (s *TypeSummary) SetTypeArn(v string) *TypeSummary { + s.TypeArn = &v + return s +} + +// SetTypeName sets the TypeName field's value. +func (s *TypeSummary) SetTypeName(v string) *TypeSummary { + s.TypeName = &v + return s +} + +// Contains summary information about a specific version of a CloudFormation +// type. +type TypeVersionSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the type version. + Arn *string `type:"string"` + + // The description of the type version. + Description *string `min:"1" type:"string"` + + // When the version was registered. + TimeCreated *time.Time `type:"timestamp"` + + // The kind of type. + Type *string `type:"string" enum:"RegistryType"` + + // The name of the type. + TypeName *string `min:"10" type:"string"` + + // The ID of a specific version of the type. The version ID is the value at + // the end of the Amazon Resource Name (ARN) assigned to the type version when + // it is registered. + VersionId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s TypeVersionSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TypeVersionSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *TypeVersionSummary) SetArn(v string) *TypeVersionSummary { + s.Arn = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *TypeVersionSummary) SetDescription(v string) *TypeVersionSummary { + s.Description = &v + return s +} + +// SetTimeCreated sets the TimeCreated field's value. +func (s *TypeVersionSummary) SetTimeCreated(v time.Time) *TypeVersionSummary { + s.TimeCreated = &v + return s +} + +// SetType sets the Type field's value. +func (s *TypeVersionSummary) SetType(v string) *TypeVersionSummary { + s.Type = &v + return s +} + +// SetTypeName sets the TypeName field's value. +func (s *TypeVersionSummary) SetTypeName(v string) *TypeVersionSummary { + s.TypeName = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *TypeVersionSummary) SetVersionId(v string) *TypeVersionSummary { + s.VersionId = &v + return s +} + // The input for an UpdateStack action. type UpdateStackInput struct { _ struct{} `type:"structure"` - // In some cases, you must explicity acknowledge that your stack template contains + // In some cases, you must explicitly acknowledge that your stack template contains // certain capabilities in order for AWS CloudFormation to update the stack. // // * CAPABILITY_IAM and CAPABILITY_NAMED_IAM Some stack templates might include @@ -12480,12 +15828,22 @@ func (s *UpdateStackInput) SetUsePreviousTemplate(v bool) *UpdateStackInput { type UpdateStackInstancesInput struct { _ struct{} `type:"structure"` - // The names of one or more AWS accounts for which you want to update parameter - // values for stack instances. The overridden parameter values will be applied - // to all stack instances in the specified accounts and regions. + // [Self-managed permissions] The names of one or more AWS accounts for which + // you want to update parameter values for stack instances. The overridden parameter + // values will be applied to all stack instances in the specified accounts and + // regions. + // + // You can specify Accounts or DeploymentTargets, but not both. + Accounts []*string `type:"list"` + + // [Service-managed permissions] The AWS Organizations accounts for which you + // want to update parameter values for stack instances. If your update targets + // OUs, the overridden parameter values only apply to the accounts that are + // currently in the target OUs and their child OUs. Accounts added to the target + // OUs and their child OUs in the future won't use the overridden values. // - // Accounts is a required field - Accounts []*string `type:"list" required:"true"` + // You can specify Accounts or DeploymentTargets, but not both. + DeploymentTargets *DeploymentTargets `type:"structure"` // The unique identifier for this stack set operation. // @@ -12561,9 +15919,6 @@ func (s UpdateStackInstancesInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *UpdateStackInstancesInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "UpdateStackInstancesInput"} - if s.Accounts == nil { - invalidParams.Add(request.NewErrParamRequired("Accounts")) - } if s.OperationId != nil && len(*s.OperationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("OperationId", 1)) } @@ -12591,6 +15946,12 @@ func (s *UpdateStackInstancesInput) SetAccounts(v []*string) *UpdateStackInstanc return s } +// SetDeploymentTargets sets the DeploymentTargets field's value. +func (s *UpdateStackInstancesInput) SetDeploymentTargets(v *DeploymentTargets) *UpdateStackInstancesInput { + s.DeploymentTargets = v + return s +} + // SetOperationId sets the OperationId field's value. func (s *UpdateStackInstancesInput) SetOperationId(v string) *UpdateStackInstancesInput { s.OperationId = &v @@ -12671,9 +16032,9 @@ func (s *UpdateStackOutput) SetStackId(v string) *UpdateStackOutput { type UpdateStackSetInput struct { _ struct{} `type:"structure"` - // The accounts in which to update associated stack instances. If you specify - // accounts, you must also specify the regions in which to update stack set - // instances. + // [Self-managed permissions] The accounts in which to update associated stack + // instances. If you specify accounts, you must also specify the regions in + // which to update stack set instances. // // To update all the stack instances associated with this stack set, do not // specify the Accounts or Regions properties. @@ -12702,7 +16063,14 @@ type UpdateStackSetInput struct { // same customized administrator role used with this stack set previously. AdministrationRoleARN *string `min:"20" type:"string"` - // In some cases, you must explicity acknowledge that your stack template contains + // [Service-managed permissions] Describes whether StackSets automatically deploys + // to AWS Organizations accounts that are added to a target organization or + // organizational unit (OU). + // + // If you specify AutoDeployment, do not specify DeploymentTargets or Regions. + AutoDeployment *AutoDeployment `type:"structure"` + + // In some cases, you must explicitly acknowledge that your stack template contains // certain capabilities in order for AWS CloudFormation to update the stack // set and its associated stack instances. // @@ -12741,6 +16109,21 @@ type UpdateStackSetInput struct { // set operation will fail. Capabilities []*string `type:"list"` + // [Service-managed permissions] The AWS Organizations accounts in which to + // update associated stack instances. + // + // To update all the stack instances associated with this stack set, do not + // specify DeploymentTargets or Regions. + // + // If the stack set update includes changes to the template (that is, if TemplateBody + // or TemplateURL is specified), or the Parameters, AWS CloudFormation marks + // all stack instances with a status of OUTDATED prior to updating the stack + // instances in the specified accounts and Regions. If the stack set update + // does not include changes to the template or parameters, AWS CloudFormation + // updates the stack instances in the specified accounts and Regions, while + // leaving all other stack instances with their existing stack instance status. + DeploymentTargets *DeploymentTargets `type:"structure"` + // A brief description of updates that you are making. Description *string `min:"1" type:"string"` @@ -12777,6 +16160,20 @@ type UpdateStackSetInput struct { // A list of input parameters for the stack set template. Parameters []*Parameter `type:"list"` + // Describes how the IAM roles required for stack set operations are created. + // You cannot modify PermissionModel if there are stack instances associated + // with your stack set. + // + // * With self-managed permissions, you must create the administrator and + // execution roles required to deploy to target accounts. For more information, + // see Grant Self-Managed Stack Set Permissions (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-self-managed.html). + // + // * With service-managed permissions, StackSets automatically creates the + // IAM roles required to deploy to accounts managed by AWS Organizations. + // For more information, see Grant Service-Managed Stack Set Permissions + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacksets-prereqs-service-managed.html). + PermissionModel *string `type:"string" enum:"PermissionModels"` + // The regions in which to update associated stack instances. If you specify // regions, you must also specify accounts in which to update stack set instances. // @@ -12921,12 +16318,24 @@ func (s *UpdateStackSetInput) SetAdministrationRoleARN(v string) *UpdateStackSet return s } +// SetAutoDeployment sets the AutoDeployment field's value. +func (s *UpdateStackSetInput) SetAutoDeployment(v *AutoDeployment) *UpdateStackSetInput { + s.AutoDeployment = v + return s +} + // SetCapabilities sets the Capabilities field's value. func (s *UpdateStackSetInput) SetCapabilities(v []*string) *UpdateStackSetInput { s.Capabilities = v return s } +// SetDeploymentTargets sets the DeploymentTargets field's value. +func (s *UpdateStackSetInput) SetDeploymentTargets(v *DeploymentTargets) *UpdateStackSetInput { + s.DeploymentTargets = v + return s +} + // SetDescription sets the Description field's value. func (s *UpdateStackSetInput) SetDescription(v string) *UpdateStackSetInput { s.Description = &v @@ -12957,6 +16366,12 @@ func (s *UpdateStackSetInput) SetParameters(v []*Parameter) *UpdateStackSetInput return s } +// SetPermissionModel sets the PermissionModel field's value. +func (s *UpdateStackSetInput) SetPermissionModel(v string) *UpdateStackSetInput { + s.PermissionModel = &v + return s +} + // SetRegions sets the Regions field's value. func (s *UpdateStackSetInput) SetRegions(v []*string) *UpdateStackSetInput { s.Regions = v @@ -13255,6 +16670,9 @@ const ( // ChangeActionRemove is a ChangeAction enum value ChangeActionRemove = "Remove" + + // ChangeActionImport is a ChangeAction enum value + ChangeActionImport = "Import" ) const ( @@ -13280,6 +16698,9 @@ const ( // ChangeSetTypeUpdate is a ChangeSetType enum value ChangeSetTypeUpdate = "UPDATE" + + // ChangeSetTypeImport is a ChangeSetType enum value + ChangeSetTypeImport = "IMPORT" ) const ( @@ -13304,6 +16725,14 @@ const ( ChangeTypeResource = "Resource" ) +const ( + // DeprecatedStatusLive is a DeprecatedStatus enum value + DeprecatedStatusLive = "LIVE" + + // DeprecatedStatusDeprecated is a DeprecatedStatus enum value + DeprecatedStatusDeprecated = "DEPRECATED" +) + const ( // DifferenceTypeAdd is a DifferenceType enum value DifferenceTypeAdd = "ADD" @@ -13343,6 +16772,50 @@ const ( ExecutionStatusObsolete = "OBSOLETE" ) +const ( + // HandlerErrorCodeNotUpdatable is a HandlerErrorCode enum value + HandlerErrorCodeNotUpdatable = "NotUpdatable" + + // HandlerErrorCodeInvalidRequest is a HandlerErrorCode enum value + HandlerErrorCodeInvalidRequest = "InvalidRequest" + + // HandlerErrorCodeAccessDenied is a HandlerErrorCode enum value + HandlerErrorCodeAccessDenied = "AccessDenied" + + // HandlerErrorCodeInvalidCredentials is a HandlerErrorCode enum value + HandlerErrorCodeInvalidCredentials = "InvalidCredentials" + + // HandlerErrorCodeAlreadyExists is a HandlerErrorCode enum value + HandlerErrorCodeAlreadyExists = "AlreadyExists" + + // HandlerErrorCodeNotFound is a HandlerErrorCode enum value + HandlerErrorCodeNotFound = "NotFound" + + // HandlerErrorCodeResourceConflict is a HandlerErrorCode enum value + HandlerErrorCodeResourceConflict = "ResourceConflict" + + // HandlerErrorCodeThrottling is a HandlerErrorCode enum value + HandlerErrorCodeThrottling = "Throttling" + + // HandlerErrorCodeServiceLimitExceeded is a HandlerErrorCode enum value + HandlerErrorCodeServiceLimitExceeded = "ServiceLimitExceeded" + + // HandlerErrorCodeNotStabilized is a HandlerErrorCode enum value + HandlerErrorCodeNotStabilized = "NotStabilized" + + // HandlerErrorCodeGeneralServiceException is a HandlerErrorCode enum value + HandlerErrorCodeGeneralServiceException = "GeneralServiceException" + + // HandlerErrorCodeServiceInternalError is a HandlerErrorCode enum value + HandlerErrorCodeServiceInternalError = "ServiceInternalError" + + // HandlerErrorCodeNetworkFailure is a HandlerErrorCode enum value + HandlerErrorCodeNetworkFailure = "NetworkFailure" + + // HandlerErrorCodeInternalFailure is a HandlerErrorCode enum value + HandlerErrorCodeInternalFailure = "InternalFailure" +) + const ( // OnFailureDoNothing is a OnFailure enum value OnFailureDoNothing = "DO_NOTHING" @@ -13354,6 +16827,55 @@ const ( OnFailureDelete = "DELETE" ) +const ( + // OperationStatusPending is a OperationStatus enum value + OperationStatusPending = "PENDING" + + // OperationStatusInProgress is a OperationStatus enum value + OperationStatusInProgress = "IN_PROGRESS" + + // OperationStatusSuccess is a OperationStatus enum value + OperationStatusSuccess = "SUCCESS" + + // OperationStatusFailed is a OperationStatus enum value + OperationStatusFailed = "FAILED" +) + +const ( + // PermissionModelsServiceManaged is a PermissionModels enum value + PermissionModelsServiceManaged = "SERVICE_MANAGED" + + // PermissionModelsSelfManaged is a PermissionModels enum value + PermissionModelsSelfManaged = "SELF_MANAGED" +) + +const ( + // ProvisioningTypeNonProvisionable is a ProvisioningType enum value + ProvisioningTypeNonProvisionable = "NON_PROVISIONABLE" + + // ProvisioningTypeImmutable is a ProvisioningType enum value + ProvisioningTypeImmutable = "IMMUTABLE" + + // ProvisioningTypeFullyMutable is a ProvisioningType enum value + ProvisioningTypeFullyMutable = "FULLY_MUTABLE" +) + +const ( + // RegistrationStatusComplete is a RegistrationStatus enum value + RegistrationStatusComplete = "COMPLETE" + + // RegistrationStatusInProgress is a RegistrationStatus enum value + RegistrationStatusInProgress = "IN_PROGRESS" + + // RegistrationStatusFailed is a RegistrationStatus enum value + RegistrationStatusFailed = "FAILED" +) + +const ( + // RegistryTypeResource is a RegistryType enum value + RegistryTypeResource = "RESOURCE" +) + const ( // ReplacementTrue is a Replacement enum value ReplacementTrue = "True" @@ -13434,6 +16956,24 @@ const ( // ResourceStatusUpdateComplete is a ResourceStatus enum value ResourceStatusUpdateComplete = "UPDATE_COMPLETE" + + // ResourceStatusImportFailed is a ResourceStatus enum value + ResourceStatusImportFailed = "IMPORT_FAILED" + + // ResourceStatusImportComplete is a ResourceStatus enum value + ResourceStatusImportComplete = "IMPORT_COMPLETE" + + // ResourceStatusImportInProgress is a ResourceStatus enum value + ResourceStatusImportInProgress = "IMPORT_IN_PROGRESS" + + // ResourceStatusImportRollbackInProgress is a ResourceStatus enum value + ResourceStatusImportRollbackInProgress = "IMPORT_ROLLBACK_IN_PROGRESS" + + // ResourceStatusImportRollbackFailed is a ResourceStatus enum value + ResourceStatusImportRollbackFailed = "IMPORT_ROLLBACK_FAILED" + + // ResourceStatusImportRollbackComplete is a ResourceStatus enum value + ResourceStatusImportRollbackComplete = "IMPORT_ROLLBACK_COMPLETE" ) const ( @@ -13486,6 +17026,34 @@ const ( StackResourceDriftStatusNotChecked = "NOT_CHECKED" ) +const ( + // StackSetDriftDetectionStatusCompleted is a StackSetDriftDetectionStatus enum value + StackSetDriftDetectionStatusCompleted = "COMPLETED" + + // StackSetDriftDetectionStatusFailed is a StackSetDriftDetectionStatus enum value + StackSetDriftDetectionStatusFailed = "FAILED" + + // StackSetDriftDetectionStatusPartialSuccess is a StackSetDriftDetectionStatus enum value + StackSetDriftDetectionStatusPartialSuccess = "PARTIAL_SUCCESS" + + // StackSetDriftDetectionStatusInProgress is a StackSetDriftDetectionStatus enum value + StackSetDriftDetectionStatusInProgress = "IN_PROGRESS" + + // StackSetDriftDetectionStatusStopped is a StackSetDriftDetectionStatus enum value + StackSetDriftDetectionStatusStopped = "STOPPED" +) + +const ( + // StackSetDriftStatusDrifted is a StackSetDriftStatus enum value + StackSetDriftStatusDrifted = "DRIFTED" + + // StackSetDriftStatusInSync is a StackSetDriftStatus enum value + StackSetDriftStatusInSync = "IN_SYNC" + + // StackSetDriftStatusNotChecked is a StackSetDriftStatus enum value + StackSetDriftStatusNotChecked = "NOT_CHECKED" +) + const ( // StackSetOperationActionCreate is a StackSetOperationAction enum value StackSetOperationActionCreate = "CREATE" @@ -13495,6 +17063,9 @@ const ( // StackSetOperationActionDelete is a StackSetOperationAction enum value StackSetOperationActionDelete = "DELETE" + + // StackSetOperationActionDetectDrift is a StackSetOperationAction enum value + StackSetOperationActionDetectDrift = "DETECT_DRIFT" ) const ( @@ -13529,6 +17100,9 @@ const ( // StackSetOperationStatusStopped is a StackSetOperationStatus enum value StackSetOperationStatusStopped = "STOPPED" + + // StackSetOperationStatusQueued is a StackSetOperationStatus enum value + StackSetOperationStatusQueued = "QUEUED" ) const ( @@ -13590,6 +17164,21 @@ const ( // StackStatusReviewInProgress is a StackStatus enum value StackStatusReviewInProgress = "REVIEW_IN_PROGRESS" + + // StackStatusImportInProgress is a StackStatus enum value + StackStatusImportInProgress = "IMPORT_IN_PROGRESS" + + // StackStatusImportComplete is a StackStatus enum value + StackStatusImportComplete = "IMPORT_COMPLETE" + + // StackStatusImportRollbackInProgress is a StackStatus enum value + StackStatusImportRollbackInProgress = "IMPORT_ROLLBACK_IN_PROGRESS" + + // StackStatusImportRollbackFailed is a StackStatus enum value + StackStatusImportRollbackFailed = "IMPORT_ROLLBACK_FAILED" + + // StackStatusImportRollbackComplete is a StackStatus enum value + StackStatusImportRollbackComplete = "IMPORT_ROLLBACK_COMPLETE" ) const ( @@ -13599,3 +17188,11 @@ const ( // TemplateStageProcessed is a TemplateStage enum value TemplateStageProcessed = "Processed" ) + +const ( + // VisibilityPublic is a Visibility enum value + VisibilityPublic = "PUBLIC" + + // VisibilityPrivate is a Visibility enum value + VisibilityPrivate = "PRIVATE" +) 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 index 9ced8d7bd6c..f2312e9fb76 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/errors.go @@ -10,6 +10,12 @@ const ( // The resource with the name requested already exists. ErrCodeAlreadyExistsException = "AlreadyExistsException" + // ErrCodeCFNRegistryException for service response error code + // "CFNRegistryException". + // + // An error occurred during a CloudFormation registry operation. + ErrCodeCFNRegistryException = "CFNRegistryException" + // ErrCodeChangeSetNotFoundException for service response error code // "ChangeSetNotFound". // @@ -44,6 +50,13 @@ const ( // The specified operation isn't valid. ErrCodeInvalidOperationException = "InvalidOperationException" + // ErrCodeInvalidStateTransitionException for service response error code + // "InvalidStateTransition". + // + // Error reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + // CloudFormation does not return this error to users. + ErrCodeInvalidStateTransitionException = "InvalidStateTransition" + // ErrCodeLimitExceededException for service response error code // "LimitExceededException". // @@ -78,6 +91,13 @@ const ( // The specified ID refers to an operation that doesn't exist. ErrCodeOperationNotFoundException = "OperationNotFoundException" + // ErrCodeOperationStatusCheckFailedException for service response error code + // "ConditionalCheckFailed". + // + // Error reserved for use by the CloudFormation CLI (https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/what-is-cloudformation-cli.html). + // CloudFormation does not return this error to users. + ErrCodeOperationStatusCheckFailedException = "ConditionalCheckFailed" + // ErrCodeStackInstanceNotFoundException for service response error code // "StackInstanceNotFoundException". // @@ -110,4 +130,10 @@ const ( // // A client request token already exists. ErrCodeTokenAlreadyExistsException = "TokenAlreadyExistsException" + + // ErrCodeTypeNotFoundException for service response error code + // "TypeNotFoundException". + // + // The specified type does not exist in the CloudFormation registry. + ErrCodeTypeNotFoundException = "TypeNotFoundException" ) 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 index 65df49a0cc8..33748e5d2f6 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "cloudformation" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "CloudFormation" // ServiceID is a unique identifer of a specific service. + ServiceID = "CloudFormation" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CloudFormation client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CloudFormation client from just a session. // svc := cloudformation.New(mySession) // @@ -46,11 +48,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CloudFormation { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CloudFormation { svc := &CloudFormation{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2010-05-15", }, 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 index afe8a1b2eb3..0dbdc6c2353 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudformation/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudformation/waiters.go @@ -188,6 +188,11 @@ func (c *CloudFormation) WaitUntilStackDeleteCompleteWithContext(ctx aws.Context Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", Expected: "ROLLBACK_FAILED", }, + { + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", + Expected: "UPDATE_ROLLBACK_IN_PROGRESS", + }, { State: request.FailureWaiterState, Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", @@ -196,7 +201,7 @@ func (c *CloudFormation) WaitUntilStackDeleteCompleteWithContext(ctx aws.Context { State: request.FailureWaiterState, Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", - Expected: "UPDATE_ROLLBACK_IN_PROGRESS", + Expected: "UPDATE_ROLLBACK_COMPLETE", }, }, Logger: c.Config.Logger, @@ -268,6 +273,82 @@ func (c *CloudFormation) WaitUntilStackExistsWithContext(ctx aws.Context, input return w.WaitWithContext(ctx) } +// WaitUntilStackImportComplete uses the AWS CloudFormation API operation +// DescribeStacks to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *CloudFormation) WaitUntilStackImportComplete(input *DescribeStacksInput) error { + return c.WaitUntilStackImportCompleteWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilStackImportCompleteWithContext is an extended version of WaitUntilStackImportComplete. +// 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 *CloudFormation) WaitUntilStackImportCompleteWithContext(ctx aws.Context, input *DescribeStacksInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilStackImportComplete", + MaxAttempts: 120, + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathAllWaiterMatch, Argument: "Stacks[].StackStatus", + Expected: "IMPORT_COMPLETE", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", + Expected: "ROLLBACK_COMPLETE", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", + Expected: "ROLLBACK_FAILED", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", + Expected: "IMPORT_ROLLBACK_IN_PROGRESS", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", + Expected: "IMPORT_ROLLBACK_FAILED", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathAnyWaiterMatch, Argument: "Stacks[].StackStatus", + Expected: "IMPORT_ROLLBACK_COMPLETE", + }, + { + State: request.FailureWaiterState, + Matcher: request.ErrorWaiterMatch, + Expected: "ValidationError", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeStacksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStacksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + // WaitUntilStackUpdateComplete uses the AWS CloudFormation API operation // DescribeStacks to wait for a condition to be met before returning. // If the condition is not met within the max attempt window, an error will @@ -333,3 +414,54 @@ func (c *CloudFormation) WaitUntilStackUpdateCompleteWithContext(ctx aws.Context return w.WaitWithContext(ctx) } + +// WaitUntilTypeRegistrationComplete uses the AWS CloudFormation API operation +// DescribeTypeRegistration to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *CloudFormation) WaitUntilTypeRegistrationComplete(input *DescribeTypeRegistrationInput) error { + return c.WaitUntilTypeRegistrationCompleteWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilTypeRegistrationCompleteWithContext is an extended version of WaitUntilTypeRegistrationComplete. +// 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 *CloudFormation) WaitUntilTypeRegistrationCompleteWithContext(ctx aws.Context, input *DescribeTypeRegistrationInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilTypeRegistrationComplete", + MaxAttempts: 120, + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "ProgressStatus", + Expected: "COMPLETE", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "ProgressStatus", + Expected: "FAILED", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeTypeRegistrationInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTypeRegistrationRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go index fa0d4110598..316965c88ba 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/api.go @@ -204,7 +204,7 @@ func (c *CloudFront) CreateDistributionRequest(input *CreateDistributionInput) ( // One or more of your trusted signers don't exist. // // * ErrCodeInvalidViewerCertificate "InvalidViewerCertificate" -// A viewer certificate specified in the response body is not valid. +// A viewer certificate specified is not valid. // // * ErrCodeInvalidMinimumProtocolVersion "InvalidMinimumProtocolVersion" // The minimum protocol version specified is not valid. @@ -231,7 +231,7 @@ func (c *CloudFront) CreateDistributionRequest(input *CreateDistributionInput) ( // An invalid error code was specified. // // * ErrCodeInvalidResponseCode "InvalidResponseCode" -// A response code specified in the response body is not valid. +// A response code is not valid. // // * ErrCodeInvalidArgument "InvalidArgument" // The argument is invalid. @@ -287,10 +287,13 @@ func (c *CloudFront) CreateDistributionRequest(input *CreateDistributionInput) ( // to support only clients that support Server Name Indication (SNI). // // * ErrCodeInvalidTTLOrder "InvalidTTLOrder" -// TTL order specified in the response body is not valid. +// The TTL order specified is not valid. // // * ErrCodeInvalidWebACLId "InvalidWebACLId" -// A web ACL id specified in the response body is not valid. +// A web ACL ID specified is not valid. To specify a web ACL created using the +// latest version of AWS WAF, use the ACL ARN, for example arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a. +// To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example +// 473e64fd-f30b-4765-81a0-62ad96dd167a. // // * ErrCodeTooManyOriginCustomHeaders "TooManyOriginCustomHeaders" // Your request contains too many origin custom headers. @@ -299,7 +302,7 @@ func (c *CloudFront) CreateDistributionRequest(input *CreateDistributionInput) ( // Your request contains too many query string parameters. // // * ErrCodeInvalidQueryStringParameters "InvalidQueryStringParameters" -// Query string parameters specified in the response body are not valid. +// The query string parameters specified are not valid. // // * ErrCodeTooManyDistributionsWithLambdaAssociations "TooManyDistributionsWithLambdaAssociations" // Processing your request would cause the maximum number of distributions with @@ -429,7 +432,7 @@ func (c *CloudFront) CreateDistributionWithTagsRequest(input *CreateDistribution // One or more of your trusted signers don't exist. // // * ErrCodeInvalidViewerCertificate "InvalidViewerCertificate" -// A viewer certificate specified in the response body is not valid. +// A viewer certificate specified is not valid. // // * ErrCodeInvalidMinimumProtocolVersion "InvalidMinimumProtocolVersion" // The minimum protocol version specified is not valid. @@ -456,7 +459,7 @@ func (c *CloudFront) CreateDistributionWithTagsRequest(input *CreateDistribution // An invalid error code was specified. // // * ErrCodeInvalidResponseCode "InvalidResponseCode" -// A response code specified in the response body is not valid. +// A response code is not valid. // // * ErrCodeInvalidArgument "InvalidArgument" // The argument is invalid. @@ -512,22 +515,25 @@ func (c *CloudFront) CreateDistributionWithTagsRequest(input *CreateDistribution // to support only clients that support Server Name Indication (SNI). // // * ErrCodeInvalidTTLOrder "InvalidTTLOrder" -// TTL order specified in the response body is not valid. +// The TTL order specified is not valid. // // * ErrCodeInvalidWebACLId "InvalidWebACLId" -// A web ACL id specified in the response body is not valid. +// A web ACL ID specified is not valid. To specify a web ACL created using the +// latest version of AWS WAF, use the ACL ARN, for example arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a. +// To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example +// 473e64fd-f30b-4765-81a0-62ad96dd167a. // // * ErrCodeTooManyOriginCustomHeaders "TooManyOriginCustomHeaders" // Your request contains too many origin custom headers. // // * ErrCodeInvalidTagging "InvalidTagging" -// Tagging specified in the response body is not valid. +// The tagging specified is not valid. // // * ErrCodeTooManyQueryStringParameters "TooManyQueryStringParameters" // Your request contains too many query string parameters. // // * ErrCodeInvalidQueryStringParameters "InvalidQueryStringParameters" -// Query string parameters specified in the response body are not valid. +// The query string parameters specified are not valid. // // * ErrCodeTooManyDistributionsWithLambdaAssociations "TooManyDistributionsWithLambdaAssociations" // Processing your request would cause the maximum number of distributions with @@ -1208,7 +1214,7 @@ func (c *CloudFront) CreateStreamingDistributionWithTagsRequest(input *CreateStr // The value of Quantity and the size of Items don't match. // // * ErrCodeInvalidTagging "InvalidTagging" -// Tagging specified in the response body is not valid. +// The tagging specified is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2019-03-26/CreateStreamingDistributionWithTags func (c *CloudFront) CreateStreamingDistributionWithTags(input *CreateStreamingDistributionWithTagsInput) (*CreateStreamingDistributionWithTagsOutput, error) { @@ -3025,10 +3031,12 @@ func (c *CloudFront) ListCloudFrontOriginAccessIdentitiesPagesWithContext(ctx aw }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCloudFrontOriginAccessIdentitiesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListCloudFrontOriginAccessIdentitiesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3160,10 +3168,12 @@ func (c *CloudFront) ListDistributionsPagesWithContext(ctx aws.Context, input *L }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDistributionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDistributionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3225,7 +3235,10 @@ func (c *CloudFront) ListDistributionsByWebACLIdRequest(input *ListDistributions // The argument is invalid. // // * ErrCodeInvalidWebACLId "InvalidWebACLId" -// A web ACL id specified in the response body is not valid. +// A web ACL ID specified is not valid. To specify a web ACL created using the +// latest version of AWS WAF, use the ACL ARN, for example arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a. +// To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example +// 473e64fd-f30b-4765-81a0-62ad96dd167a. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudfront-2019-03-26/ListDistributionsByWebACLId func (c *CloudFront) ListDistributionsByWebACLId(input *ListDistributionsByWebACLIdInput) (*ListDistributionsByWebACLIdOutput, error) { @@ -3543,10 +3556,12 @@ func (c *CloudFront) ListInvalidationsPagesWithContext(ctx aws.Context, input *L }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInvalidationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListInvalidationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3757,10 +3772,12 @@ func (c *CloudFront) ListStreamingDistributionsPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStreamingDistributionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListStreamingDistributionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3825,7 +3842,7 @@ func (c *CloudFront) ListTagsForResourceRequest(input *ListTagsForResourceInput) // The argument is invalid. // // * ErrCodeInvalidTagging "InvalidTagging" -// Tagging specified in the response body is not valid. +// The tagging specified is not valid. // // * ErrCodeNoSuchResource "NoSuchResource" // A resource that was specified is not valid. @@ -3914,7 +3931,7 @@ func (c *CloudFront) TagResourceRequest(input *TagResourceInput) (req *request.R // The argument is invalid. // // * ErrCodeInvalidTagging "InvalidTagging" -// Tagging specified in the response body is not valid. +// The tagging specified is not valid. // // * ErrCodeNoSuchResource "NoSuchResource" // A resource that was specified is not valid. @@ -4003,7 +4020,7 @@ func (c *CloudFront) UntagResourceRequest(input *UntagResourceInput) (req *reque // The argument is invalid. // // * ErrCodeInvalidTagging "InvalidTagging" -// Tagging specified in the response body is not valid. +// The tagging specified is not valid. // // * ErrCodeNoSuchResource "NoSuchResource" // A resource that was specified is not valid. @@ -4286,7 +4303,7 @@ func (c *CloudFront) UpdateDistributionRequest(input *UpdateDistributionInput) ( // An invalid error code was specified. // // * ErrCodeInvalidResponseCode "InvalidResponseCode" -// A response code specified in the response body is not valid. +// A response code is not valid. // // * ErrCodeInvalidArgument "InvalidArgument" // The argument is invalid. @@ -4301,7 +4318,7 @@ func (c *CloudFront) UpdateDistributionRequest(input *UpdateDistributionInput) ( // One or more of your trusted signers don't exist. // // * ErrCodeInvalidViewerCertificate "InvalidViewerCertificate" -// A viewer certificate specified in the response body is not valid. +// A viewer certificate specified is not valid. // // * ErrCodeInvalidMinimumProtocolVersion "InvalidMinimumProtocolVersion" // The minimum protocol version specified is not valid. @@ -4353,10 +4370,13 @@ func (c *CloudFront) UpdateDistributionRequest(input *UpdateDistributionInput) ( // The specified geo restriction parameter is not valid. // // * ErrCodeInvalidTTLOrder "InvalidTTLOrder" -// TTL order specified in the response body is not valid. +// The TTL order specified is not valid. // // * ErrCodeInvalidWebACLId "InvalidWebACLId" -// A web ACL id specified in the response body is not valid. +// A web ACL ID specified is not valid. To specify a web ACL created using the +// latest version of AWS WAF, use the ACL ARN, for example arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a. +// To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example +// 473e64fd-f30b-4765-81a0-62ad96dd167a. // // * ErrCodeTooManyOriginCustomHeaders "TooManyOriginCustomHeaders" // Your request contains too many origin custom headers. @@ -4365,7 +4385,7 @@ func (c *CloudFront) UpdateDistributionRequest(input *UpdateDistributionInput) ( // Your request contains too many query string parameters. // // * ErrCodeInvalidQueryStringParameters "InvalidQueryStringParameters" -// Query string parameters specified in the response body are not valid. +// The query string parameters specified are not valid. // // * ErrCodeTooManyDistributionsWithLambdaAssociations "TooManyDistributionsWithLambdaAssociations" // Processing your request would cause the maximum number of distributions with @@ -4950,8 +4970,11 @@ type AliasICPRecordal struct { // * SUSPENDED indicates that the associated CNAME does not have a valid // ICP recordal number. // - // * PENDING indicates that at least one CNAME associated with the distribution - // does not have a valid ICP recordal number. + // * PENDING indicates that CloudFront can't determine the ICP recordal status + // of the CNAME associated with the distribution because there was an error + // in trying to determine the status. You can try again to see if the error + // is resolved in which case CloudFront returns an APPROVED or SUSPENDED + // status. ICPRecordalStatus *string `type:"string" enum:"ICPRecordalStatus"` } @@ -5187,7 +5210,8 @@ type CacheBehavior struct { // or for the default cache behavior in your distribution. FieldLevelEncryptionId *string `type:"string"` - // A complex type that specifies how CloudFront handles query strings and cookies. + // A complex type that specifies how CloudFront handles query strings, cookies, + // and HTTP headers. // // ForwardedValues is a required field ForwardedValues *ForwardedValues `type:"structure" required:"true"` @@ -5746,11 +5770,19 @@ 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. + // CloudFront to forward to the origin for this cache behavior. It must contain + // the same number of items that is specified in the Quantity field. + // + // When you set Forward = whitelist (in the CookiePreferences object), this + // field must contain at least one item. Items []*string `locationNameList:"Name" type:"list"` // The number of different cookies that you want CloudFront to forward to the - // origin for this cache behavior. + // origin for this cache behavior. The value must equal the number of items + // that are in the Items field. + // + // When you set Forward = whitelist (in the CookiePreferences object), this + // value must be 1 or higher. // // Quantity is a required field Quantity *int64 `type:"integer" required:"true"` @@ -5808,7 +5840,7 @@ type CookiePreference struct { // 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 + // 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. @@ -6673,9 +6705,6 @@ type CustomErrorResponse struct { // 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 (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/custom-error-pages.html) // in the Amazon CloudFront Developer Guide. ErrorCachingMinTTL *int64 `type:"long"` @@ -6704,8 +6733,7 @@ type CustomErrorResponse struct { // 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. + // ResponsePagePath. ResponseCode *string `type:"string"` // The path to the custom error page that you want CloudFront to return to a @@ -6724,8 +6752,7 @@ type CustomErrorResponse struct { // 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. + // for ResponseCode. // // 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 @@ -7066,7 +7093,8 @@ type DefaultCacheBehavior struct { // or for the default cache behavior in your distribution. FieldLevelEncryptionId *string `type:"string"` - // A complex type that specifies how CloudFront handles query strings and cookies. + // A complex type that specifies how CloudFront handles query strings, cookies, + // and HTTP headers. // // ForwardedValues is a required field ForwardedValues *ForwardedValues `type:"structure" required:"true"` @@ -8013,14 +8041,15 @@ type DistributionConfig struct { // of your content. Restrictions *Restrictions `type:"structure"` - // A complex type that specifies whether you want viewers to use HTTP or HTTPS - // to request your objects, whether you're using an alternate domain name with - // HTTPS, and if so, if you're using AWS Certificate Manager (ACM) or a third-party - // certificate authority. + // A complex type that determines the distribution’s SSL/TLS configuration + // for communicating with viewers. ViewerCertificate *ViewerCertificate `type:"structure"` // A unique identifier that specifies the AWS WAF web ACL, if any, to associate - // with this distribution. + // with this distribution. To specify a web ACL created using the latest version + // of AWS WAF, use the ACL ARN, for example arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a. + // To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example + // 473e64fd-f30b-4765-81a0-62ad96dd167a. // // 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 @@ -8029,7 +8058,7 @@ type DistributionConfig struct { // 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). + // AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/what-is-aws-waf.html). WebACLId *string `type:"string"` } @@ -8464,10 +8493,8 @@ type DistributionSummary struct { // Status is a required field Status *string `type:"string" required:"true"` - // A complex type that specifies whether you want viewers to use HTTP or HTTPS - // to request your objects, whether you're using an alternate domain name with - // HTTPS, and if so, if you're using AWS Certificate Manager (ACM) or a third-party - // certificate authority. + // A complex type that determines the distribution’s SSL/TLS configuration + // for communicating with viewers. // // ViewerCertificate is a required field ViewerCertificate *ViewerCertificate `type:"structure" required:"true"` @@ -9313,7 +9340,8 @@ func (s *FieldPatterns) SetQuantity(v int64) *FieldPatterns { return s } -// A complex type that specifies how CloudFront handles query strings and cookies. +// A complex type that specifies how CloudFront handles query strings, cookies, +// and HTTP headers. type ForwardedValues struct { _ struct{} `type:"structure"` @@ -15066,141 +15094,144 @@ func (s *UpdateStreamingDistributionOutput) SetStreamingDistribution(v *Streamin return s } -// A complex type that specifies the following: -// -// * Whether you want viewers to use HTTP or HTTPS to request your objects. +// A complex type that determines the distribution’s SSL/TLS configuration +// for communicating with viewers. // -// * 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 the distribution doesn’t use Aliases (also known as alternate domain +// names or CNAMEs)—that is, if the distribution uses the CloudFront domain +// name such as d111111abcdef8.cloudfront.net—set CloudFrontDefaultCertificate +// to true and leave all other fields empty. // -// * 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. +// If the distribution uses Aliases (alternate domain names or CNAMEs), use +// the fields in this type to specify the following settings: // -// Specify only one of the following values: +// * Which viewers the distribution accepts HTTPS connections from: only +// viewers that support server name indication (SNI) (https://en.wikipedia.org/wiki/Server_Name_Indication) +// (recommended), or all viewers including those that don’t support SNI. +// To accept HTTPS connections from only viewers that support SNI, set SSLSupportMethod +// to sni-only. This is recommended. Most browsers and clients released after +// 2010 support SNI. To accept HTTPS connections from all viewers, including +// those that don’t support SNI, set SSLSupportMethod to vip. This is not +// recommended, and results in additional monthly charges from CloudFront. // -// * ACMCertificateArn (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ViewerCertificate.html#cloudfront-Type-ViewerCertificate-ACMCertificateArn) +// * The minimum SSL/TLS protocol version that the distribution can use to +// communicate with viewers. To specify a minimum version, choose a value +// for MinimumProtocolVersion. For more information, see Security Policy +// (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValues-security-policy) +// in the Amazon CloudFront Developer Guide. // -// * IAMCertificateId (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ViewerCertificate.html#cloudfront-Type-ViewerCertificate-IAMCertificateId) +// * The location of the SSL/TLS certificate, AWS Certificate Manager (ACM) +// (https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html) (recommended) +// or AWS Identity and Access Management (AWS IAM) (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html). +// You specify the location by setting a value in one of the following fields +// (not both): ACMCertificateArn IAMCertificateId // -// * CloudFrontDefaultCertificate (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ViewerCertificate.html#cloudfront-Type-ViewerCertificate-CloudFrontDefaultCertificate) +// All distributions support HTTPS connections from viewers. To require viewers +// to use HTTPS only, or to redirect them from HTTP to HTTPS, use ViewerProtocolPolicy +// in the CacheBehavior or DefaultCacheBehavior. To specify how CloudFront should +// use SSL/TLS to communicate with your custom origin, use CustomOriginConfig. // -// For more information, see Using Alternate Domain Names and HTTPS (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/SecureConnections.html#CNAMEsAndHTTPS) +// For more information, see Using HTTPS with CloudFront (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https.html) +// and Using Alternate Domain Names and HTTPS (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https-alternate-domain-names.html) // in the Amazon CloudFront Developer Guide. type ViewerCertificate struct { _ struct{} `type:"structure"` - // If you want viewers to use HTTPS to request your objects and you're using - // an alternate domain name, you must choose the type of certificate that you - // want to use. Specify the following value if ACM provided your certificate: - // - // * 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. + // If the distribution uses Aliases (alternate domain names or CNAMEs) and the + // SSL/TLS certificate is stored in AWS Certificate Manager (ACM) (https://docs.aws.amazon.com/acm/latest/userguide/acm-overview.html), + // provide the Amazon Resource Name (ARN) of the ACM certificate. CloudFront + // only supports ACM certificates in the US East (N. Virginia) Region (us-east-1). // - // If you specify ACMCertificateArn, you must also specify a value for SSLSupportMethod. + // If you specify an ACM certificate ARN, you must also specify values for MinimumProtocolVerison + // and SSLSupportMethod. ACMCertificateArn *string `type:"string"` - // This field is no longer used. Use one of the following fields instead: + // This field is deprecated. Use one of the following fields instead: // - // * ACMCertificateArn (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ViewerCertificate.html#cloudfront-Type-ViewerCertificate-ACMCertificateArn) + // * ACMCertificateArn // - // * IAMCertificateId (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ViewerCertificate.html#cloudfront-Type-ViewerCertificate-IAMCertificateId) + // * IAMCertificateId // - // * CloudFrontDefaultCertificate (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ViewerCertificate.html#cloudfront-Type-ViewerCertificate-CloudFrontDefaultCertificate) + // * CloudFrontDefaultCertificate // // Deprecated: Certificate has been deprecated Certificate *string `deprecated:"true" type:"string"` - // This field is no longer used. Use one of the following fields instead: + // This field is deprecated. Use one of the following fields instead: // - // * ACMCertificateArn (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ViewerCertificate.html#cloudfront-Type-ViewerCertificate-ACMCertificateArn) + // * ACMCertificateArn // - // * IAMCertificateId (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ViewerCertificate.html#cloudfront-Type-ViewerCertificate-IAMCertificateId) + // * IAMCertificateId // - // * CloudFrontDefaultCertificate (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ViewerCertificate.html#cloudfront-Type-ViewerCertificate-CloudFrontDefaultCertificate) + // * CloudFrontDefaultCertificate // // Deprecated: CertificateSource has been deprecated CertificateSource *string `deprecated:"true" type:"string" enum:"CertificateSource"` - // If you're using the CloudFront domain name for your distribution, such as - // d111111abcdef8.cloudfront.net, specify the following value: + // If the distribution uses the CloudFront domain name such as d111111abcdef8.cloudfront.net, + // set this field to true. // - // * true + // If the distribution uses Aliases (alternate domain names or CNAMEs), set + // this field to false and specify values for the following fields: + // + // * ACMCertificateArn or IAMCertificateId (specify a value for one, not + // both) + // + // * MinimumProtocolVersion + // + // * SSLSupportMethod CloudFrontDefaultCertificate *bool `type:"boolean"` - // If you want viewers to use HTTPS to request your objects and you're using - // an alternate domain name, you must choose the type of certificate that you - // want to use. Specify the following value if you purchased your certificate - // from a third-party certificate authority: + // If the distribution uses Aliases (alternate domain names or CNAMEs) and the + // SSL/TLS certificate is stored in AWS Identity and Access Management (AWS + // IAM) (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs.html), + // provide the ID of the IAM certificate. // - // * 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 IAMCertificateId, you must also specify a value for SSLSupportMethod. + // If you specify an IAM certificate ID, you must also specify values for MinimumProtocolVerison + // and SSLSupportMethod. IAMCertificateId *string `type:"string"` - // Specify the security policy that you want CloudFront to use for HTTPS connections. - // A security policy determines two settings: - // - // * The minimum SSL/TLS protocol that CloudFront uses to communicate with - // viewers - // - // * The cipher that CloudFront uses to encrypt the content that it returns - // to viewers + // If the distribution uses Aliases (alternate domain names or CNAMEs), specify + // the security policy that you want CloudFront to use for HTTPS connections + // with viewers. The security policy determines two settings: // - // On the CloudFront console, this setting is called Security policy. + // * The minimum SSL/TLS protocol that CloudFront can use to communicate + // with viewers. // - // We recommend that you specify TLSv1.1_2016 unless your users are using browsers - // or devices that do not support TLSv1.1 or later. + // * The ciphers that CloudFront can use to encrypt the content that it returns + // to viewers. // - // When both of the following are true, you must specify TLSv1 or later for - // the security policy: + // For more information, see Security Policy (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-values-specify.html#DownloadDistValues-security-policy) + // and Supported Protocols and Ciphers Between Viewers and CloudFront (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported-viewer-protocols-ciphers.html#secure-connections-supported-ciphers) + // in the Amazon CloudFront Developer Guide. // - // * You're using a custom certificate: you specified a value for ACMCertificateArn - // or for IAMCertificateId + // On the CloudFront console, this setting is called Security Policy. // - // * You're using SNI: you specified sni-only for SSLSupportMethod + // We recommend that you specify TLSv1.2_2018 unless your viewers are using + // browsers or devices that don’t support TLSv1.2. // - // If you specify true for CloudFrontDefaultCertificate, CloudFront automatically - // sets the security policy to TLSv1 regardless of the value that you specify - // for MinimumProtocolVersion. + // When you’re using SNI only (you set SSLSupportMethod to sni-only), you + // must specify TLSv1 or higher. // - // For information about the relationship between the security policy that you - // choose and the protocols and ciphers that CloudFront uses to communicate - // with viewers, see Supported SSL/TLS Protocols and Ciphers for Communication - // Between Viewers and CloudFront (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/secure-connections-supported-viewer-protocols-ciphers.html#secure-connections-supported-ciphers) - // in the Amazon CloudFront Developer Guide. + // If the distribution uses the CloudFront domain name such as d111111abcdef8.cloudfront.net + // (you set CloudFrontDefaultCertificate to true), CloudFront automatically + // sets the security policy to TLSv1 regardless of the value that you set here. MinimumProtocolVersion *string `type:"string" enum:"MinimumProtocolVersion"` - // If you specify a value for ACMCertificateArn (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ViewerCertificate.html#cloudfront-Type-ViewerCertificate-ACMCertificateArn) - // or for IAMCertificateId (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ViewerCertificate.html#cloudfront-Type-ViewerCertificate-IAMCertificateId), - // you must also specify how you want CloudFront to serve HTTPS requests: using - // a method that works for browsers and clients released after 2010 or one that - // works for all clients. - // - // * sni-only: CloudFront can respond to HTTPS requests from viewers that - // support Server Name Indication (SNI). All modern browsers support SNI, - // but there are a few that don't. For a current list of the browsers that - // support SNI, see the Wikipedia entry Server Name Indication (http://en.wikipedia.org/wiki/Server_Name_Indication). - // To learn about options to explore if you have users with browsers that - // don't include SNI support, see Choosing How CloudFront Serves HTTPS Requests - // (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cnames-https-dedicated-ip-or-sni.html) - // in the Amazon CloudFront Developer Guide. - // - // * vip: CloudFront uses dedicated IP addresses for your content and can - // respond to HTTPS requests from any viewer. However, there are additional - // monthly charges. For details, including specific pricing information, - // see Custom SSL options for Amazon CloudFront (http://aws.amazon.com/cloudfront/custom-ssl-domains/) - // on the AWS marketing site. - // - // Don't specify a value for SSLSupportMethod if you specified true. - // - // For more information, see Choosing How CloudFront Serves HTTPS Requests (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cnames-https-dedicated-ip-or-sni.html) - // in the Amazon CloudFront Developer Guide. + // If the distribution uses Aliases (alternate domain names or CNAMEs), specify + // which viewers the distribution accepts HTTPS connections from. + // + // * sni-only – The distribution accepts HTTPS connections from only viewers + // that support server name indication (SNI) (https://en.wikipedia.org/wiki/Server_Name_Indication). + // This is recommended. Most browsers and clients released after 2010 support + // SNI. + // + // * vip – The distribution accepts HTTPS connections from all viewers + // including those that don’t support SNI. This is not recommended, and + // results in additional monthly charges from CloudFront. + // + // If the distribution uses the CloudFront domain name such as d111111abcdef8.cloudfront.net, + // don’t set a value for this field. SSLSupportMethod *string `type:"string" enum:"SSLSupportMethod"` } 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 index db6258af0bf..827ff5f7eba 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/errors.go @@ -189,7 +189,7 @@ const ( // ErrCodeInvalidQueryStringParameters for service response error code // "InvalidQueryStringParameters". // - // Query string parameters specified in the response body are not valid. + // The query string parameters specified are not valid. ErrCodeInvalidQueryStringParameters = "InvalidQueryStringParameters" // ErrCodeInvalidRelativePath for service response error code @@ -210,31 +210,34 @@ const ( // ErrCodeInvalidResponseCode for service response error code // "InvalidResponseCode". // - // A response code specified in the response body is not valid. + // A response code is not valid. ErrCodeInvalidResponseCode = "InvalidResponseCode" // ErrCodeInvalidTTLOrder for service response error code // "InvalidTTLOrder". // - // TTL order specified in the response body is not valid. + // The TTL order specified is not valid. ErrCodeInvalidTTLOrder = "InvalidTTLOrder" // ErrCodeInvalidTagging for service response error code // "InvalidTagging". // - // Tagging specified in the response body is not valid. + // The tagging specified is not valid. ErrCodeInvalidTagging = "InvalidTagging" // ErrCodeInvalidViewerCertificate for service response error code // "InvalidViewerCertificate". // - // A viewer certificate specified in the response body is not valid. + // A viewer certificate specified is not valid. ErrCodeInvalidViewerCertificate = "InvalidViewerCertificate" // ErrCodeInvalidWebACLId for service response error code // "InvalidWebACLId". // - // A web ACL id specified in the response body is not valid. + // A web ACL ID specified is not valid. To specify a web ACL created using the + // latest version of AWS WAF, use the ACL ARN, for example arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a. + // To specify a web ACL created using AWS WAF Classic, use the ACL ID, for example + // 473e64fd-f30b-4765-81a0-62ad96dd167a. ErrCodeInvalidWebACLId = "InvalidWebACLId" // ErrCodeMissingBody for service response error code 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 index d692c8f030f..be2ca42f187 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudfront/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudfront/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "cloudfront" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "CloudFront" // ServiceID is a unique identifer of a specific service. + ServiceID = "CloudFront" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CloudFront client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CloudFront client from just a session. // svc := cloudfront.New(mySession) // @@ -46,11 +48,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CloudFront { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CloudFront { svc := &CloudFront{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2019-03-26", }, diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/api.go index 36a9efd616a..c5fb669db6d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/api.go @@ -66,23 +66,25 @@ func (c *CloudHSMV2) CopyBackupToRegionRequest(input *CopyBackupToRegionInput) ( // See the AWS API reference guide for AWS CloudHSM V2's // API operation CopyBackupToRegion for usage and error information. // -// Returned Error Codes: -// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" +// Returned Error Types: +// * CloudHsmAccessDeniedException +// The request was rejected because the requester does not have permission to +// perform the requested operation. +// +// * CloudHsmInternalFailureException // The request was rejected because of an AWS CloudHSM internal failure. The // request can be retried. // -// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" -// The request was rejected because an error occurred. +// * CloudHsmInvalidRequestException +// The request was rejected because it is not a valid request. // -// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" +// * CloudHsmResourceNotFoundException // The request was rejected because it refers to a resource that cannot be found. // -// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" -// The request was rejected because it is not a valid request. +// * CloudHsmServiceException +// The request was rejected because an error occurred. // -// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" -// The request was rejected because the requester does not have permission to -// perform the requested operation. +// * CloudHsmTagException // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/CopyBackupToRegion func (c *CloudHSMV2) CopyBackupToRegion(input *CopyBackupToRegionInput) (*CopyBackupToRegionOutput, error) { @@ -159,23 +161,25 @@ func (c *CloudHSMV2) CreateClusterRequest(input *CreateClusterInput) (req *reque // See the AWS API reference guide for AWS CloudHSM V2's // API operation CreateCluster for usage and error information. // -// Returned Error Codes: -// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" +// Returned Error Types: +// * CloudHsmAccessDeniedException +// The request was rejected because the requester does not have permission to +// perform the requested operation. +// +// * CloudHsmInternalFailureException // The request was rejected because of an AWS CloudHSM internal failure. The // request can be retried. // -// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" -// The request was rejected because an error occurred. +// * CloudHsmInvalidRequestException +// The request was rejected because it is not a valid request. // -// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" +// * CloudHsmResourceNotFoundException // The request was rejected because it refers to a resource that cannot be found. // -// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" -// The request was rejected because it is not a valid request. +// * CloudHsmServiceException +// The request was rejected because an error occurred. // -// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" -// The request was rejected because the requester does not have permission to -// perform the requested operation. +// * CloudHsmTagException // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/CreateCluster func (c *CloudHSMV2) CreateCluster(input *CreateClusterInput) (*CreateClusterOutput, error) { @@ -253,21 +257,21 @@ func (c *CloudHSMV2) CreateHsmRequest(input *CreateHsmInput) (req *request.Reque // See the AWS API reference guide for AWS CloudHSM V2's // API operation CreateHsm for usage and error information. // -// Returned Error Codes: -// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" +// Returned Error Types: +// * CloudHsmInternalFailureException // The request was rejected because of an AWS CloudHSM internal failure. The // request can be retried. // -// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" +// * CloudHsmServiceException // The request was rejected because an error occurred. // -// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" +// * CloudHsmInvalidRequestException // The request was rejected because it is not a valid request. // -// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" +// * CloudHsmResourceNotFoundException // The request was rejected because it refers to a resource that cannot be found. // -// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" +// * CloudHsmAccessDeniedException // The request was rejected because the requester does not have permission to // perform the requested operation. // @@ -338,8 +342,8 @@ func (c *CloudHSMV2) DeleteBackupRequest(input *DeleteBackupInput) (req *request // DeleteBackup API operation for AWS CloudHSM V2. // // Deletes a specified AWS CloudHSM backup. A backup can be restored up to 7 -// days after the DeleteBackup request. For more information on restoring a -// backup, see RestoreBackup +// days after the DeleteBackup request is made. For more information on restoring +// a backup, see RestoreBackup. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -348,23 +352,23 @@ func (c *CloudHSMV2) DeleteBackupRequest(input *DeleteBackupInput) (req *request // See the AWS API reference guide for AWS CloudHSM V2's // API operation DeleteBackup for usage and error information. // -// Returned Error Codes: -// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" +// Returned Error Types: +// * CloudHsmAccessDeniedException +// The request was rejected because the requester does not have permission to +// perform the requested operation. +// +// * CloudHsmInternalFailureException // The request was rejected because of an AWS CloudHSM internal failure. The // request can be retried. // -// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" -// The request was rejected because an error occurred. +// * CloudHsmInvalidRequestException +// The request was rejected because it is not a valid request. // -// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" +// * CloudHsmResourceNotFoundException // The request was rejected because it refers to a resource that cannot be found. // -// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" -// The request was rejected because it is not a valid request. -// -// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" -// The request was rejected because the requester does not have permission to -// perform the requested operation. +// * CloudHsmServiceException +// The request was rejected because an error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DeleteBackup func (c *CloudHSMV2) DeleteBackup(input *DeleteBackupInput) (*DeleteBackupOutput, error) { @@ -443,23 +447,25 @@ func (c *CloudHSMV2) DeleteClusterRequest(input *DeleteClusterInput) (req *reque // See the AWS API reference guide for AWS CloudHSM V2's // API operation DeleteCluster for usage and error information. // -// Returned Error Codes: -// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" +// Returned Error Types: +// * CloudHsmAccessDeniedException +// The request was rejected because the requester does not have permission to +// perform the requested operation. +// +// * CloudHsmInternalFailureException // The request was rejected because of an AWS CloudHSM internal failure. The // request can be retried. // -// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" -// The request was rejected because an error occurred. +// * CloudHsmInvalidRequestException +// The request was rejected because it is not a valid request. // -// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" +// * CloudHsmResourceNotFoundException // The request was rejected because it refers to a resource that cannot be found. // -// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" -// The request was rejected because it is not a valid request. +// * CloudHsmServiceException +// The request was rejected because an error occurred. // -// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" -// The request was rejected because the requester does not have permission to -// perform the requested operation. +// * CloudHsmTagException // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DeleteCluster func (c *CloudHSMV2) DeleteCluster(input *DeleteClusterInput) (*DeleteClusterOutput, error) { @@ -539,21 +545,21 @@ func (c *CloudHSMV2) DeleteHsmRequest(input *DeleteHsmInput) (req *request.Reque // See the AWS API reference guide for AWS CloudHSM V2's // API operation DeleteHsm for usage and error information. // -// Returned Error Codes: -// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" +// Returned Error Types: +// * CloudHsmInternalFailureException // The request was rejected because of an AWS CloudHSM internal failure. The // request can be retried. // -// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" +// * CloudHsmServiceException // The request was rejected because an error occurred. // -// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" +// * CloudHsmResourceNotFoundException // The request was rejected because it refers to a resource that cannot be found. // -// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" +// * CloudHsmInvalidRequestException // The request was rejected because it is not a valid request. // -// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" +// * CloudHsmAccessDeniedException // The request was rejected because the requester does not have permission to // perform the requested operation. // @@ -645,23 +651,25 @@ func (c *CloudHSMV2) DescribeBackupsRequest(input *DescribeBackupsInput) (req *r // See the AWS API reference guide for AWS CloudHSM V2's // API operation DescribeBackups for usage and error information. // -// Returned Error Codes: -// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" +// Returned Error Types: +// * CloudHsmAccessDeniedException +// The request was rejected because the requester does not have permission to +// perform the requested operation. +// +// * CloudHsmInternalFailureException // The request was rejected because of an AWS CloudHSM internal failure. The // request can be retried. // -// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" -// The request was rejected because an error occurred. +// * CloudHsmInvalidRequestException +// The request was rejected because it is not a valid request. // -// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" +// * CloudHsmResourceNotFoundException // The request was rejected because it refers to a resource that cannot be found. // -// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" -// The request was rejected because it is not a valid request. +// * CloudHsmServiceException +// The request was rejected because an error occurred. // -// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" -// The request was rejected because the requester does not have permission to -// perform the requested operation. +// * CloudHsmTagException // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DescribeBackups func (c *CloudHSMV2) DescribeBackups(input *DescribeBackupsInput) (*DescribeBackupsOutput, error) { @@ -728,10 +736,12 @@ func (c *CloudHSMV2) DescribeBackupsPagesWithContext(ctx aws.Context, input *Des }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeBackupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeBackupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -801,20 +811,22 @@ func (c *CloudHSMV2) DescribeClustersRequest(input *DescribeClustersInput) (req // See the AWS API reference guide for AWS CloudHSM V2's // API operation DescribeClusters for usage and error information. // -// Returned Error Codes: -// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" +// Returned Error Types: +// * CloudHsmAccessDeniedException +// The request was rejected because the requester does not have permission to +// perform the requested operation. +// +// * CloudHsmInternalFailureException // The request was rejected because of an AWS CloudHSM internal failure. The // request can be retried. // -// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" -// The request was rejected because an error occurred. -// -// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" +// * CloudHsmInvalidRequestException // The request was rejected because it is not a valid request. // -// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" -// The request was rejected because the requester does not have permission to -// perform the requested operation. +// * CloudHsmServiceException +// The request was rejected because an error occurred. +// +// * CloudHsmTagException // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/DescribeClusters func (c *CloudHSMV2) DescribeClusters(input *DescribeClustersInput) (*DescribeClustersOutput, error) { @@ -881,10 +893,12 @@ func (c *CloudHSMV2) DescribeClustersPagesWithContext(ctx aws.Context, input *De }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClustersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeClustersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -944,23 +958,23 @@ func (c *CloudHSMV2) InitializeClusterRequest(input *InitializeClusterInput) (re // See the AWS API reference guide for AWS CloudHSM V2's // API operation InitializeCluster for usage and error information. // -// Returned Error Codes: -// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" +// Returned Error Types: +// * CloudHsmAccessDeniedException +// The request was rejected because the requester does not have permission to +// perform the requested operation. +// +// * CloudHsmInternalFailureException // The request was rejected because of an AWS CloudHSM internal failure. The // request can be retried. // -// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" -// The request was rejected because an error occurred. +// * CloudHsmInvalidRequestException +// The request was rejected because it is not a valid request. // -// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" +// * CloudHsmResourceNotFoundException // The request was rejected because it refers to a resource that cannot be found. // -// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" -// The request was rejected because it is not a valid request. -// -// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" -// The request was rejected because the requester does not have permission to -// perform the requested operation. +// * CloudHsmServiceException +// The request was rejected because an error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/InitializeCluster func (c *CloudHSMV2) InitializeCluster(input *InitializeClusterInput) (*InitializeClusterOutput, error) { @@ -1049,23 +1063,25 @@ func (c *CloudHSMV2) ListTagsRequest(input *ListTagsInput) (req *request.Request // See the AWS API reference guide for AWS CloudHSM V2's // API operation ListTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" +// Returned Error Types: +// * CloudHsmAccessDeniedException +// The request was rejected because the requester does not have permission to +// perform the requested operation. +// +// * CloudHsmInternalFailureException // The request was rejected because of an AWS CloudHSM internal failure. The // request can be retried. // -// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" -// The request was rejected because an error occurred. +// * CloudHsmInvalidRequestException +// The request was rejected because it is not a valid request. // -// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" +// * CloudHsmResourceNotFoundException // The request was rejected because it refers to a resource that cannot be found. // -// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" -// The request was rejected because it is not a valid request. +// * CloudHsmServiceException +// The request was rejected because an error occurred. // -// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" -// The request was rejected because the requester does not have permission to -// perform the requested operation. +// * CloudHsmTagException // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/ListTags func (c *CloudHSMV2) ListTags(input *ListTagsInput) (*ListTagsOutput, error) { @@ -1132,10 +1148,12 @@ func (c *CloudHSMV2) ListTagsPagesWithContext(ctx aws.Context, input *ListTagsIn }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTagsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1184,7 +1202,7 @@ func (c *CloudHSMV2) RestoreBackupRequest(input *RestoreBackupInput) (req *reque // RestoreBackup API operation for AWS CloudHSM V2. // // Restores a specified AWS CloudHSM backup that is in the PENDING_DELETION -// state. For more information on deleting a backup, see DeleteBackup. +// state. For mor information on deleting a backup, see DeleteBackup. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1193,23 +1211,23 @@ func (c *CloudHSMV2) RestoreBackupRequest(input *RestoreBackupInput) (req *reque // See the AWS API reference guide for AWS CloudHSM V2's // API operation RestoreBackup for usage and error information. // -// Returned Error Codes: -// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" +// Returned Error Types: +// * CloudHsmAccessDeniedException +// The request was rejected because the requester does not have permission to +// perform the requested operation. +// +// * CloudHsmInternalFailureException // The request was rejected because of an AWS CloudHSM internal failure. The // request can be retried. // -// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" -// The request was rejected because an error occurred. +// * CloudHsmInvalidRequestException +// The request was rejected because it is not a valid request. // -// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" +// * CloudHsmResourceNotFoundException // The request was rejected because it refers to a resource that cannot be found. // -// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" -// The request was rejected because it is not a valid request. -// -// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" -// The request was rejected because the requester does not have permission to -// perform the requested operation. +// * CloudHsmServiceException +// The request was rejected because an error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/RestoreBackup func (c *CloudHSMV2) RestoreBackup(input *RestoreBackupInput) (*RestoreBackupOutput, error) { @@ -1287,23 +1305,25 @@ func (c *CloudHSMV2) TagResourceRequest(input *TagResourceInput) (req *request.R // See the AWS API reference guide for AWS CloudHSM V2's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" +// Returned Error Types: +// * CloudHsmAccessDeniedException +// The request was rejected because the requester does not have permission to +// perform the requested operation. +// +// * CloudHsmInternalFailureException // The request was rejected because of an AWS CloudHSM internal failure. The // request can be retried. // -// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" -// The request was rejected because an error occurred. +// * CloudHsmInvalidRequestException +// The request was rejected because it is not a valid request. // -// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" +// * CloudHsmResourceNotFoundException // The request was rejected because it refers to a resource that cannot be found. // -// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" -// The request was rejected because it is not a valid request. +// * CloudHsmServiceException +// The request was rejected because an error occurred. // -// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" -// The request was rejected because the requester does not have permission to -// perform the requested operation. +// * CloudHsmTagException // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/TagResource func (c *CloudHSMV2) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { @@ -1381,23 +1401,25 @@ func (c *CloudHSMV2) UntagResourceRequest(input *UntagResourceInput) (req *reque // See the AWS API reference guide for AWS CloudHSM V2's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeCloudHsmInternalFailureException "CloudHsmInternalFailureException" +// Returned Error Types: +// * CloudHsmAccessDeniedException +// The request was rejected because the requester does not have permission to +// perform the requested operation. +// +// * CloudHsmInternalFailureException // The request was rejected because of an AWS CloudHSM internal failure. The // request can be retried. // -// * ErrCodeCloudHsmServiceException "CloudHsmServiceException" -// The request was rejected because an error occurred. +// * CloudHsmInvalidRequestException +// The request was rejected because it is not a valid request. // -// * ErrCodeCloudHsmResourceNotFoundException "CloudHsmResourceNotFoundException" +// * CloudHsmResourceNotFoundException // The request was rejected because it refers to a resource that cannot be found. // -// * ErrCodeCloudHsmInvalidRequestException "CloudHsmInvalidRequestException" -// The request was rejected because it is not a valid request. +// * CloudHsmServiceException +// The request was rejected because an error occurred. // -// * ErrCodeCloudHsmAccessDeniedException "CloudHsmAccessDeniedException" -// The request was rejected because the requester does not have permission to -// perform the requested operation. +// * CloudHsmTagException // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/UntagResource func (c *CloudHSMV2) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { @@ -1421,7 +1443,12 @@ func (c *CloudHSMV2) UntagResourceWithContext(ctx aws.Context, input *UntagResou return out, req.Send() } -// Contains information about a backup of an AWS CloudHSM cluster. +// Contains information about a backup of an AWS CloudHSM cluster. All backup +// objects contain the BackupId, BackupState, ClusterId, and CreateTimestamp +// parameters. Backups that were copied into a destination region additionally +// contain the CopyTimestamp, SourceBackup, SourceCluster, and SourceRegion +// paramters. A backup that is pending deletion will include the DeleteTimestamp +// parameter. type Backup struct { _ struct{} `type:"structure"` @@ -1436,6 +1463,7 @@ type Backup struct { // The identifier (ID) of the cluster that was backed up. ClusterId *string `type:"string"` + // The date and time when the backup was copied from a source backup. CopyTimestamp *time.Time `type:"timestamp"` // The date and time when the backup was created. @@ -1444,11 +1472,18 @@ type Backup struct { // The date and time when the backup will be permanently deleted. DeleteTimestamp *time.Time `type:"timestamp"` + // The identifier (ID) of the source backup from which the new backup was copied. SourceBackup *string `type:"string"` + // The identifier (ID) of the cluster containing the source backup from which + // the new backup was copied. . SourceCluster *string `type:"string"` + // The AWS region that contains the source backup from which the new backup + // was copied. SourceRegion *string `type:"string"` + + TagList []*Tag `min:"1" type:"list"` } // String returns the string representation @@ -1515,6 +1550,12 @@ func (s *Backup) SetSourceRegion(v string) *Backup { return s } +// SetTagList sets the TagList field's value. +func (s *Backup) SetTagList(v []*Tag) *Backup { + s.TagList = v + return s +} + // Contains one or more certificates or a certificate signing request (CSR). type Certificates struct { _ struct{} `type:"structure"` @@ -1577,6 +1618,343 @@ func (s *Certificates) SetManufacturerHardwareCertificate(v string) *Certificate return s } +// The request was rejected because the requester does not have permission to +// perform the requested operation. +type CloudHsmAccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s CloudHsmAccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudHsmAccessDeniedException) GoString() string { + return s.String() +} + +func newErrorCloudHsmAccessDeniedException(v protocol.ResponseMetadata) error { + return &CloudHsmAccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CloudHsmAccessDeniedException) Code() string { + return "CloudHsmAccessDeniedException" +} + +// Message returns the exception's message. +func (s CloudHsmAccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CloudHsmAccessDeniedException) OrigErr() error { + return nil +} + +func (s CloudHsmAccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CloudHsmAccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CloudHsmAccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because of an AWS CloudHSM internal failure. The +// request can be retried. +type CloudHsmInternalFailureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s CloudHsmInternalFailureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudHsmInternalFailureException) GoString() string { + return s.String() +} + +func newErrorCloudHsmInternalFailureException(v protocol.ResponseMetadata) error { + return &CloudHsmInternalFailureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CloudHsmInternalFailureException) Code() string { + return "CloudHsmInternalFailureException" +} + +// Message returns the exception's message. +func (s CloudHsmInternalFailureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CloudHsmInternalFailureException) OrigErr() error { + return nil +} + +func (s CloudHsmInternalFailureException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CloudHsmInternalFailureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CloudHsmInternalFailureException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because it is not a valid request. +type CloudHsmInvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s CloudHsmInvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudHsmInvalidRequestException) GoString() string { + return s.String() +} + +func newErrorCloudHsmInvalidRequestException(v protocol.ResponseMetadata) error { + return &CloudHsmInvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CloudHsmInvalidRequestException) Code() string { + return "CloudHsmInvalidRequestException" +} + +// Message returns the exception's message. +func (s CloudHsmInvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CloudHsmInvalidRequestException) OrigErr() error { + return nil +} + +func (s CloudHsmInvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CloudHsmInvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CloudHsmInvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because it refers to a resource that cannot be found. +type CloudHsmResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s CloudHsmResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudHsmResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorCloudHsmResourceNotFoundException(v protocol.ResponseMetadata) error { + return &CloudHsmResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CloudHsmResourceNotFoundException) Code() string { + return "CloudHsmResourceNotFoundException" +} + +// Message returns the exception's message. +func (s CloudHsmResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CloudHsmResourceNotFoundException) OrigErr() error { + return nil +} + +func (s CloudHsmResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CloudHsmResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CloudHsmResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because an error occurred. +type CloudHsmServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s CloudHsmServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudHsmServiceException) GoString() string { + return s.String() +} + +func newErrorCloudHsmServiceException(v protocol.ResponseMetadata) error { + return &CloudHsmServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CloudHsmServiceException) Code() string { + return "CloudHsmServiceException" +} + +// Message returns the exception's message. +func (s CloudHsmServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CloudHsmServiceException) OrigErr() error { + return nil +} + +func (s CloudHsmServiceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CloudHsmServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CloudHsmServiceException) RequestID() string { + return s.respMetadata.RequestID +} + +type CloudHsmTagException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s CloudHsmTagException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudHsmTagException) GoString() string { + return s.String() +} + +func newErrorCloudHsmTagException(v protocol.ResponseMetadata) error { + return &CloudHsmTagException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CloudHsmTagException) Code() string { + return "CloudHsmTagException" +} + +// Message returns the exception's message. +func (s CloudHsmTagException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CloudHsmTagException) OrigErr() error { + return nil +} + +func (s CloudHsmTagException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CloudHsmTagException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CloudHsmTagException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains information about an AWS CloudHSM cluster. type Cluster struct { _ struct{} `type:"structure"` @@ -1615,9 +1993,12 @@ type Cluster struct { // A description of the cluster's state. StateMessage *string `type:"string"` - // A map of the cluster's subnets and their corresponding Availability Zones. + // A map from availability zone to the cluster’s subnet in that availability + // zone. SubnetMapping map[string]*string `type:"map"` + TagList []*Tag `min:"1" type:"list"` + // The identifier (ID) of the virtual private cloud (VPC) that contains the // cluster. VpcId *string `type:"string"` @@ -1705,6 +2086,12 @@ func (s *Cluster) SetSubnetMapping(v map[string]*string) *Cluster { return s } +// SetTagList sets the TagList field's value. +func (s *Cluster) SetTagList(v []*Tag) *Cluster { + s.TagList = v + return s +} + // SetVpcId sets the VpcId field's value. func (s *Cluster) SetVpcId(v string) *Cluster { s.VpcId = &v @@ -1723,6 +2110,8 @@ type CopyBackupToRegionInput struct { // // DestinationRegion is a required field DestinationRegion *string `type:"string" required:"true"` + + TagList []*Tag `min:"1" type:"list"` } // String returns the string representation @@ -1744,6 +2133,19 @@ func (s *CopyBackupToRegionInput) Validate() error { if s.DestinationRegion == nil { invalidParams.Add(request.NewErrParamRequired("DestinationRegion")) } + if s.TagList != nil && len(s.TagList) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TagList", 1)) + } + 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 @@ -1763,6 +2165,12 @@ func (s *CopyBackupToRegionInput) SetDestinationRegion(v string) *CopyBackupToRe return s } +// SetTagList sets the TagList field's value. +func (s *CopyBackupToRegionInput) SetTagList(v []*Tag) *CopyBackupToRegionInput { + s.TagList = v + return s +} + type CopyBackupToRegionOutput struct { _ struct{} `type:"structure"` @@ -1817,6 +2225,8 @@ type CreateClusterInput struct { // // SubnetIds is a required field SubnetIds []*string `min:"1" type:"list" required:"true"` + + TagList []*Tag `min:"1" type:"list"` } // String returns the string representation @@ -1841,6 +2251,19 @@ func (s *CreateClusterInput) Validate() error { if s.SubnetIds != nil && len(s.SubnetIds) < 1 { invalidParams.Add(request.NewErrParamMinLen("SubnetIds", 1)) } + if s.TagList != nil && len(s.TagList) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TagList", 1)) + } + 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 @@ -1866,6 +2289,12 @@ func (s *CreateClusterInput) SetSubnetIds(v []*string) *CreateClusterInput { return s } +// SetTagList sets the TagList field's value. +func (s *CreateClusterInput) SetTagList(v []*Tag) *CreateClusterInput { + s.TagList = v + return s +} + type CreateClusterOutput struct { _ struct{} `type:"structure"` @@ -2217,6 +2646,8 @@ type DescribeBackupsInput struct { // value to get more backups. NextToken *string `type:"string"` + // Designates whether or not to sort the return backups by ascending chronological + // order of generation. SortAscending *bool `type:"boolean"` } @@ -2400,15 +2831,23 @@ func (s *DescribeClustersOutput) SetNextToken(v string) *DescribeClustersOutput return s } +// Contains information about the backup that will be copied and created by +// the CopyBackupToRegion operation. type DestinationBackup struct { _ struct{} `type:"structure"` + // The date and time when both the source backup was created. CreateTimestamp *time.Time `type:"timestamp"` + // The identifier (ID) of the source backup from which the new backup was copied. SourceBackup *string `type:"string"` + // The identifier (ID) of the cluster containing the source backup from which + // the new backup was copied. SourceCluster *string `type:"string"` + // The AWS region that contains the source backup from which the new backup + // was copied. SourceRegion *string `type:"string"` } @@ -2553,10 +2992,10 @@ type InitializeClusterInput struct { SignedCert *string `type:"string" required:"true"` // The issuing certificate of the issuing certificate authority (CA) that issued - // (signed) the cluster certificate. This can be a root (self-signed) certificate - // or a certificate chain that begins with the certificate that issued the cluster - // certificate and ends with a root certificate. The certificate or certificate - // chain must be in PEM format and can contain a maximum of 5000 characters. + // (signed) the cluster certificate. You must use a self-signed certificate. + // The certificate used to sign the HSM CSR must be directly available, and + // thus must be the root certificate. The certificate must be in PEM format + // and can contain a maximum of 5000 characters. // // TrustAnchor is a required field TrustAnchor *string `type:"string" required:"true"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/doc.go b/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/doc.go index fd7b0ef8e83..b1a17410950 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/doc.go @@ -4,7 +4,7 @@ // requests to AWS CloudHSM V2. // // For more information about AWS CloudHSM, see AWS CloudHSM (http://aws.amazon.com/cloudhsm/) -// and the AWS CloudHSM User Guide (http://docs.aws.amazon.com/cloudhsm/latest/userguide/). +// and the AWS CloudHSM User Guide (https://docs.aws.amazon.com/cloudhsm/latest/userguide/). // // See https://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28 for more information on this service. // diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/errors.go index 542f2f40481..a99c421f3f4 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/errors.go @@ -2,6 +2,10 @@ package cloudhsmv2 +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeCloudHsmAccessDeniedException for service response error code @@ -35,4 +39,17 @@ const ( // // The request was rejected because an error occurred. ErrCodeCloudHsmServiceException = "CloudHsmServiceException" + + // ErrCodeCloudHsmTagException for service response error code + // "CloudHsmTagException". + ErrCodeCloudHsmTagException = "CloudHsmTagException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "CloudHsmAccessDeniedException": newErrorCloudHsmAccessDeniedException, + "CloudHsmInternalFailureException": newErrorCloudHsmInternalFailureException, + "CloudHsmInvalidRequestException": newErrorCloudHsmInvalidRequestException, + "CloudHsmResourceNotFoundException": newErrorCloudHsmResourceNotFoundException, + "CloudHsmServiceException": newErrorCloudHsmServiceException, + "CloudHsmTagException": newErrorCloudHsmTagException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/service.go index c86db6ae7b0..6034df79403 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudhsmv2/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "cloudhsmv2" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "CloudHSM V2" // ServiceID is a unique identifer of a specific service. + ServiceID = "CloudHSM V2" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CloudHSMV2 client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CloudHSMV2 client from just a session. // svc := cloudhsmv2.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudHSMV2 { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "cloudhsm" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CloudHSMV2 { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CloudHSMV2 { svc := &CloudHSMV2{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-04-28", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudsearch/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudsearch/api.go index bff1d60da28..a39be361ffd 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudsearch/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudsearch/api.go @@ -1185,6 +1185,99 @@ func (c *CloudSearch) DescribeAvailabilityOptionsWithContext(ctx aws.Context, in return out, req.Send() } +const opDescribeDomainEndpointOptions = "DescribeDomainEndpointOptions" + +// DescribeDomainEndpointOptionsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeDomainEndpointOptions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeDomainEndpointOptions for more information on using the DescribeDomainEndpointOptions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeDomainEndpointOptionsRequest method. +// req, resp := client.DescribeDomainEndpointOptionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *CloudSearch) DescribeDomainEndpointOptionsRequest(input *DescribeDomainEndpointOptionsInput) (req *request.Request, output *DescribeDomainEndpointOptionsOutput) { + op := &request.Operation{ + Name: opDescribeDomainEndpointOptions, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeDomainEndpointOptionsInput{} + } + + output = &DescribeDomainEndpointOptionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeDomainEndpointOptions API operation for Amazon CloudSearch. +// +// Returns the domain's endpoint options, specifically whether all requests +// to the domain must arrive over HTTPS. For more information, see Configuring +// Domain Endpoint Options (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/configuring-domain-endpoint-options.html) +// in the Amazon CloudSearch 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 CloudSearch's +// API operation DescribeDomainEndpointOptions for usage and error information. +// +// Returned Error Codes: +// * ErrCodeBaseException "BaseException" +// An error occurred while processing the request. +// +// * ErrCodeInternalException "InternalException" +// An internal error occurred while processing the request. If this problem +// persists, report an issue from the Service Health Dashboard (http://status.aws.amazon.com/). +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because a resource limit has already been met. +// +// * ErrCodeResourceNotFoundException "ResourceNotFound" +// The request was rejected because it attempted to reference a resource that +// does not exist. +// +// * ErrCodeDisabledOperationException "DisabledAction" +// The request was rejected because it attempted an operation which is not enabled. +// +func (c *CloudSearch) DescribeDomainEndpointOptions(input *DescribeDomainEndpointOptionsInput) (*DescribeDomainEndpointOptionsOutput, error) { + req, out := c.DescribeDomainEndpointOptionsRequest(input) + return out, req.Send() +} + +// DescribeDomainEndpointOptionsWithContext is the same as DescribeDomainEndpointOptions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDomainEndpointOptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudSearch) DescribeDomainEndpointOptionsWithContext(ctx aws.Context, input *DescribeDomainEndpointOptionsInput, opts ...request.Option) (*DescribeDomainEndpointOptionsOutput, error) { + req, out := c.DescribeDomainEndpointOptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeDomains = "DescribeDomains" // DescribeDomainsRequest generates a "aws/request.Request" representing the @@ -1953,6 +2046,9 @@ func (c *CloudSearch) UpdateAvailabilityOptionsRequest(input *UpdateAvailability // * ErrCodeDisabledOperationException "DisabledAction" // The request was rejected because it attempted an operation which is not enabled. // +// * ErrCodeValidationException "ValidationException" +// The request was rejected because it has invalid parameters. +// func (c *CloudSearch) UpdateAvailabilityOptions(input *UpdateAvailabilityOptionsInput) (*UpdateAvailabilityOptionsOutput, error) { req, out := c.UpdateAvailabilityOptionsRequest(input) return out, req.Send() @@ -1974,6 +2070,105 @@ func (c *CloudSearch) UpdateAvailabilityOptionsWithContext(ctx aws.Context, inpu return out, req.Send() } +const opUpdateDomainEndpointOptions = "UpdateDomainEndpointOptions" + +// UpdateDomainEndpointOptionsRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDomainEndpointOptions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateDomainEndpointOptions for more information on using the UpdateDomainEndpointOptions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateDomainEndpointOptionsRequest method. +// req, resp := client.UpdateDomainEndpointOptionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *CloudSearch) UpdateDomainEndpointOptionsRequest(input *UpdateDomainEndpointOptionsInput) (req *request.Request, output *UpdateDomainEndpointOptionsOutput) { + op := &request.Operation{ + Name: opUpdateDomainEndpointOptions, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateDomainEndpointOptionsInput{} + } + + output = &UpdateDomainEndpointOptionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateDomainEndpointOptions API operation for Amazon CloudSearch. +// +// Updates the domain's endpoint options, specifically whether all requests +// to the domain must arrive over HTTPS. For more information, see Configuring +// Domain Endpoint Options (http://docs.aws.amazon.com/cloudsearch/latest/developerguide/configuring-domain-endpoint-options.html) +// in the Amazon CloudSearch 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 CloudSearch's +// API operation UpdateDomainEndpointOptions for usage and error information. +// +// Returned Error Codes: +// * ErrCodeBaseException "BaseException" +// An error occurred while processing the request. +// +// * ErrCodeInternalException "InternalException" +// An internal error occurred while processing the request. If this problem +// persists, report an issue from the Service Health Dashboard (http://status.aws.amazon.com/). +// +// * ErrCodeInvalidTypeException "InvalidType" +// The request was rejected because it specified an invalid type definition. +// +// * ErrCodeLimitExceededException "LimitExceeded" +// The request was rejected because a resource limit has already been met. +// +// * ErrCodeResourceNotFoundException "ResourceNotFound" +// The request was rejected because it attempted to reference a resource that +// does not exist. +// +// * ErrCodeDisabledOperationException "DisabledAction" +// The request was rejected because it attempted an operation which is not enabled. +// +// * ErrCodeValidationException "ValidationException" +// The request was rejected because it has invalid parameters. +// +func (c *CloudSearch) UpdateDomainEndpointOptions(input *UpdateDomainEndpointOptionsInput) (*UpdateDomainEndpointOptionsOutput, error) { + req, out := c.UpdateDomainEndpointOptionsRequest(input) + return out, req.Send() +} + +// UpdateDomainEndpointOptionsWithContext is the same as UpdateDomainEndpointOptions with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDomainEndpointOptions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudSearch) UpdateDomainEndpointOptionsWithContext(ctx aws.Context, input *UpdateDomainEndpointOptionsInput, opts ...request.Option) (*UpdateDomainEndpointOptionsOutput, error) { + req, out := c.UpdateDomainEndpointOptionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opUpdateScalingParameters = "UpdateScalingParameters" // UpdateScalingParametersRequest generates a "aws/request.Request" representing the @@ -3715,6 +3910,85 @@ func (s *DescribeAvailabilityOptionsOutput) SetAvailabilityOptions(v *Availabili return s } +// Container for the parameters to the DescribeDomainEndpointOptions operation. +// Specify the name of the domain you want to describe. To show the active configuration +// and exclude any pending changes, set the Deployed option to true. +type DescribeDomainEndpointOptionsInput struct { + _ struct{} `type:"structure"` + + // Whether to retrieve the latest configuration (which might be in a Processing + // state) or the current, active configuration. Defaults to false. + Deployed *bool `type:"boolean"` + + // A string that represents the name of a domain. + // + // DomainName is a required field + DomainName *string `min:"3" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeDomainEndpointOptionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDomainEndpointOptionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeDomainEndpointOptionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeDomainEndpointOptionsInput"} + 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 +} + +// SetDeployed sets the Deployed field's value. +func (s *DescribeDomainEndpointOptionsInput) SetDeployed(v bool) *DescribeDomainEndpointOptionsInput { + s.Deployed = &v + return s +} + +// SetDomainName sets the DomainName field's value. +func (s *DescribeDomainEndpointOptionsInput) SetDomainName(v string) *DescribeDomainEndpointOptionsInput { + s.DomainName = &v + return s +} + +// The result of a DescribeDomainEndpointOptions request. Contains the status +// and configuration of a search domain's endpoint options. +type DescribeDomainEndpointOptionsOutput struct { + _ struct{} `type:"structure"` + + // The status and configuration of a search domain's endpoint options. + DomainEndpointOptions *DomainEndpointOptionsStatus `type:"structure"` +} + +// String returns the string representation +func (s DescribeDomainEndpointOptionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDomainEndpointOptionsOutput) GoString() string { + return s.String() +} + +// SetDomainEndpointOptions sets the DomainEndpointOptions field's value. +func (s *DescribeDomainEndpointOptionsOutput) SetDomainEndpointOptions(v *DomainEndpointOptionsStatus) *DescribeDomainEndpointOptionsOutput { + s.DomainEndpointOptions = v + return s +} + // Container for the parameters to the DescribeDomains operation. By default // shows the status of all domains. To restrict the response to particular domains, // specify the names of the domains you want to describe. @@ -4269,6 +4543,76 @@ func (s *DocumentSuggesterOptions) SetSourceField(v string) *DocumentSuggesterOp return s } +// The domain's endpoint options. +type DomainEndpointOptions struct { + _ struct{} `type:"structure"` + + // Whether the domain is HTTPS only enabled. + EnforceHTTPS *bool `type:"boolean"` + + // The minimum required TLS version + TLSSecurityPolicy *string `type:"string" enum:"TLSSecurityPolicy"` +} + +// String returns the string representation +func (s DomainEndpointOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DomainEndpointOptions) GoString() string { + return s.String() +} + +// SetEnforceHTTPS sets the EnforceHTTPS field's value. +func (s *DomainEndpointOptions) SetEnforceHTTPS(v bool) *DomainEndpointOptions { + s.EnforceHTTPS = &v + return s +} + +// SetTLSSecurityPolicy sets the TLSSecurityPolicy field's value. +func (s *DomainEndpointOptions) SetTLSSecurityPolicy(v string) *DomainEndpointOptions { + s.TLSSecurityPolicy = &v + return s +} + +// The configuration and status of the domain's endpoint options. +type DomainEndpointOptionsStatus struct { + _ struct{} `type:"structure"` + + // The domain endpoint options configured for the domain. + // + // Options is a required field + Options *DomainEndpointOptions `type:"structure" required:"true"` + + // The status of the configured domain endpoint options. + // + // Status is a required field + Status *OptionStatus `type:"structure" required:"true"` +} + +// String returns the string representation +func (s DomainEndpointOptionsStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DomainEndpointOptionsStatus) GoString() string { + return s.String() +} + +// SetOptions sets the Options field's value. +func (s *DomainEndpointOptionsStatus) SetOptions(v *DomainEndpointOptions) *DomainEndpointOptionsStatus { + s.Options = v + return s +} + +// SetStatus sets the Status field's value. +func (s *DomainEndpointOptionsStatus) SetStatus(v *OptionStatus) *DomainEndpointOptionsStatus { + s.Status = v + return s +} + // The current status of the search domain. type DomainStatus struct { _ struct{} `type:"structure"` @@ -6005,6 +6349,91 @@ func (s *UpdateAvailabilityOptionsOutput) SetAvailabilityOptions(v *Availability return s } +// Container for the parameters to the UpdateDomainEndpointOptions operation. +// Specifies the name of the domain you want to update and the domain endpoint +// options. +type UpdateDomainEndpointOptionsInput struct { + _ struct{} `type:"structure"` + + // Whether to require that all requests to the domain arrive over HTTPS. We + // recommend Policy-Min-TLS-1-2-2019-07 for TLSSecurityPolicy. For compatibility + // with older clients, the default is Policy-Min-TLS-1-0-2019-07. + // + // DomainEndpointOptions is a required field + DomainEndpointOptions *DomainEndpointOptions `type:"structure" required:"true"` + + // A string that represents the name of a domain. + // + // DomainName is a required field + DomainName *string `min:"3" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateDomainEndpointOptionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateDomainEndpointOptionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateDomainEndpointOptionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateDomainEndpointOptionsInput"} + if s.DomainEndpointOptions == nil { + invalidParams.Add(request.NewErrParamRequired("DomainEndpointOptions")) + } + 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 +} + +// SetDomainEndpointOptions sets the DomainEndpointOptions field's value. +func (s *UpdateDomainEndpointOptionsInput) SetDomainEndpointOptions(v *DomainEndpointOptions) *UpdateDomainEndpointOptionsInput { + s.DomainEndpointOptions = v + return s +} + +// SetDomainName sets the DomainName field's value. +func (s *UpdateDomainEndpointOptionsInput) SetDomainName(v string) *UpdateDomainEndpointOptionsInput { + s.DomainName = &v + return s +} + +// The result of a UpdateDomainEndpointOptions request. Contains the configuration +// and status of the domain's endpoint options. +type UpdateDomainEndpointOptionsOutput struct { + _ struct{} `type:"structure"` + + // The newly-configured domain endpoint options. + DomainEndpointOptions *DomainEndpointOptionsStatus `type:"structure"` +} + +// String returns the string representation +func (s UpdateDomainEndpointOptionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateDomainEndpointOptionsOutput) GoString() string { + return s.String() +} + +// SetDomainEndpointOptions sets the DomainEndpointOptions field's value. +func (s *UpdateDomainEndpointOptionsOutput) SetDomainEndpointOptions(v *DomainEndpointOptionsStatus) *UpdateDomainEndpointOptionsOutput { + s.DomainEndpointOptions = v + return s +} + // Container for the parameters to the UpdateScalingParameters operation. Specifies // the name of the domain you want to update and the scaling parameters you // want to configure. @@ -6408,3 +6837,12 @@ const ( // SuggesterFuzzyMatchingHigh is a SuggesterFuzzyMatching enum value SuggesterFuzzyMatchingHigh = "high" ) + +// The minimum required TLS version. +const ( + // TLSSecurityPolicyPolicyMinTls10201907 is a TLSSecurityPolicy enum value + TLSSecurityPolicyPolicyMinTls10201907 = "Policy-Min-TLS-1-0-2019-07" + + // TLSSecurityPolicyPolicyMinTls12201907 is a TLSSecurityPolicy enum value + TLSSecurityPolicyPolicyMinTls12201907 = "Policy-Min-TLS-1-2-2019-07" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudsearch/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudsearch/errors.go index f0ed2f1e2fc..b807f29ab04 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudsearch/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudsearch/errors.go @@ -41,4 +41,10 @@ const ( // The request was rejected because it attempted to reference a resource that // does not exist. ErrCodeResourceNotFoundException = "ResourceNotFound" + + // ErrCodeValidationException for service response error code + // "ValidationException". + // + // The request was rejected because it has invalid parameters. + ErrCodeValidationException = "ValidationException" ) diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudsearch/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudsearch/service.go index 850bc137051..e260fc33df7 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudsearch/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudsearch/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "cloudsearch" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "CloudSearch" // ServiceID is a unique identifer of a specific service. + ServiceID = "CloudSearch" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CloudSearch client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CloudSearch client from just a session. // svc := cloudsearch.New(mySession) // @@ -46,11 +48,11 @@ const ( // svc := cloudsearch.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudSearch { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CloudSearch { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CloudSearch { svc := &CloudSearch{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2013-01-01", }, 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 index 7ddffc705c3..8b227be26c1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go @@ -58,12 +58,13 @@ func (c *CloudTrail) AddTagsRequest(input *AddTagsInput) (req *request.Request, // 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). +// Adds one or more tags to a trail, up to a limit of 50. Overwrites an existing +// tag's value when a new value is specified for an existing tag key. Tag key +// names must be unique for a trail; you cannot have two keys with the same +// name but different values. 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 AWS Regions only from the Region in which the trail +// was created (also known as 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 @@ -72,25 +73,25 @@ func (c *CloudTrail) AddTagsRequest(input *AddTagsInput) (req *request.Request, // See the AWS API reference guide for AWS CloudTrail's // API operation AddTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the specified resource is not found. // -// * ErrCodeARNInvalidException "CloudTrailARNInvalidException" +// * 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-2:123456789012:trail/MyTrail // -// * ErrCodeResourceTypeNotSupportedException "ResourceTypeNotSupportedException" +// * ResourceTypeNotSupportedException // This exception is thrown when the specified resource type is not supported // by CloudTrail. // -// * ErrCodeTagsLimitExceededException "TagsLimitExceededException" +// * TagsLimitExceededException // The number of tags per trail has exceeded the permitted amount. Currently, // the limit is 50. // -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" +// * InvalidTrailNameException // This exception is thrown when the provided trail name is not valid. Trail // names must meet the following requirements: // @@ -106,17 +107,17 @@ func (c *CloudTrail) AddTagsRequest(input *AddTagsInput) (req *request.Request, // // * 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}_.:/=+\\-@]*)$. +// * InvalidTagParameterException +// This exception is thrown when the specified tag key or values are not valid. +// It can also occur if there are duplicate tags or too many tags on the resource. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // This exception is thrown when the requested operation is not supported. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // This exception is thrown when the requested operation is not permitted. // -// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException" +// * NotOrganizationMasterAccountException // This exception is thrown when the AWS account making the request to create // or update an organization trail is not the master account for an organization // in AWS Organizations. For more information, see Prepare For Creating a Trail @@ -189,8 +190,7 @@ func (c *CloudTrail) CreateTrailRequest(input *CreateTrailInput) (req *request.R // 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. +// Amazon S3 bucket. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -199,39 +199,39 @@ func (c *CloudTrail) CreateTrailRequest(input *CreateTrailInput) (req *request.R // See the AWS API reference guide for AWS CloudTrail's // API operation CreateTrail for usage and error information. // -// Returned Error Codes: -// * ErrCodeMaximumNumberOfTrailsExceededException "MaximumNumberOfTrailsExceededException" +// Returned Error Types: +// * MaximumNumberOfTrailsExceededException // This exception is thrown when the maximum number of trails is reached. // -// * ErrCodeTrailAlreadyExistsException "TrailAlreadyExistsException" +// * TrailAlreadyExistsException // This exception is thrown when the specified trail already exists. // -// * ErrCodeS3BucketDoesNotExistException "S3BucketDoesNotExistException" +// * S3BucketDoesNotExistException // This exception is thrown when the specified S3 bucket does not exist. // -// * ErrCodeInsufficientS3BucketPolicyException "InsufficientS3BucketPolicyException" +// * InsufficientS3BucketPolicyException // This exception is thrown when the policy on the S3 bucket is not sufficient. // -// * ErrCodeInsufficientSnsTopicPolicyException "InsufficientSnsTopicPolicyException" +// * InsufficientSnsTopicPolicyException // This exception is thrown when the policy on the SNS topic is not sufficient. // -// * ErrCodeInsufficientEncryptionPolicyException "InsufficientEncryptionPolicyException" +// * InsufficientEncryptionPolicyException // This exception is thrown when the policy on the S3 bucket or KMS key is not // sufficient. // -// * ErrCodeInvalidS3BucketNameException "InvalidS3BucketNameException" +// * InvalidS3BucketNameException // This exception is thrown when the provided S3 bucket name is not valid. // -// * ErrCodeInvalidS3PrefixException "InvalidS3PrefixException" +// * InvalidS3PrefixException // This exception is thrown when the provided S3 prefix is not valid. // -// * ErrCodeInvalidSnsTopicNameException "InvalidSnsTopicNameException" +// * InvalidSnsTopicNameException // This exception is thrown when the provided SNS topic name is not valid. // -// * ErrCodeInvalidKmsKeyIdException "InvalidKmsKeyIdException" +// * InvalidKmsKeyIdException // This exception is thrown when the KMS key ARN is invalid. // -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" +// * InvalidTrailNameException // This exception is thrown when the provided trail name is not valid. Trail // names must meet the following requirements: // @@ -247,63 +247,67 @@ func (c *CloudTrail) CreateTrailRequest(input *CreateTrailInput) (req *request.R // // * Not be in IP address format (for example, 192.168.5.4) // -// * ErrCodeTrailNotProvidedException "TrailNotProvidedException" -// This exception is deprecated. +// * TrailNotProvidedException +// This exception is no longer in use. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // This exception is thrown when the combination of parameters provided is not // valid. // -// * ErrCodeKmsKeyNotFoundException "KmsKeyNotFoundException" +// * 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. +// * KmsKeyDisabledException +// This exception is no longer in use. // -// * ErrCodeKmsException "KmsException" +// * KmsException // This exception is thrown when there is an issue with the specified KMS key // and the trail can’t be updated. // -// * ErrCodeInvalidCloudWatchLogsLogGroupArnException "InvalidCloudWatchLogsLogGroupArnException" +// * InvalidCloudWatchLogsLogGroupArnException // This exception is thrown when the provided CloudWatch log group is not valid. // -// * ErrCodeInvalidCloudWatchLogsRoleArnException "InvalidCloudWatchLogsRoleArnException" +// * InvalidCloudWatchLogsRoleArnException // This exception is thrown when the provided role is not valid. // -// * ErrCodeCloudWatchLogsDeliveryUnavailableException "CloudWatchLogsDeliveryUnavailableException" +// * CloudWatchLogsDeliveryUnavailableException // Cannot set a CloudWatch Logs delivery for this region. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * InvalidTagParameterException +// This exception is thrown when the specified tag key or values are not valid. +// It can also occur if there are duplicate tags or too many tags on the resource. +// +// * UnsupportedOperationException // This exception is thrown when the requested operation is not supported. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // This exception is thrown when the requested operation is not permitted. // -// * ErrCodeAccessNotEnabledException "CloudTrailAccessNotEnabledException" +// * AccessNotEnabledException // This exception is thrown when trusted access has not been enabled between // AWS CloudTrail and AWS Organizations. For more information, see Enabling // Trusted Access with Other AWS Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) // and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). // -// * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException" +// * InsufficientDependencyServiceAccessPermissionException // This exception is thrown when the IAM user or role that is used to create // the organization trail is lacking one or more required permissions for creating // an organization trail in a required service. For more information, see Prepare // For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). // -// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException" +// * NotOrganizationMasterAccountException // This exception is thrown when the AWS account making the request to create // or update an organization trail is not the master account for an organization // in AWS Organizations. For more information, see Prepare For Creating a Trail // For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). // -// * ErrCodeOrganizationsNotInUseException "OrganizationsNotInUseException" +// * OrganizationsNotInUseException // This exception is thrown when the request is made from an AWS account that // is not a member of an organization. To make this request, sign in using the // credentials of an account that belongs to an organization. // -// * ErrCodeOrganizationNotInAllFeaturesModeException "OrganizationNotInAllFeaturesModeException" +// * OrganizationNotInAllFeaturesModeException // This exception is thrown when AWS Organizations is not configured to support // all features. All features must be enabled in AWS Organization to support // creating an organization trail. For more information, see Prepare For Creating @@ -387,11 +391,11 @@ func (c *CloudTrail) DeleteTrailRequest(input *DeleteTrailInput) (req *request.R // See the AWS API reference guide for AWS CloudTrail's // API operation DeleteTrail for usage and error information. // -// Returned Error Codes: -// * ErrCodeTrailNotFoundException "TrailNotFoundException" +// Returned Error Types: +// * TrailNotFoundException // This exception is thrown when the trail with the given name is not found. // -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" +// * InvalidTrailNameException // This exception is thrown when the provided trail name is not valid. Trail // names must meet the following requirements: // @@ -407,23 +411,23 @@ func (c *CloudTrail) DeleteTrailRequest(input *DeleteTrailInput) (req *request.R // // * Not be in IP address format (for example, 192.168.5.4) // -// * ErrCodeInvalidHomeRegionException "InvalidHomeRegionException" +// * 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. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // This exception is thrown when the requested operation is not supported. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // This exception is thrown when the requested operation is not permitted. // -// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException" +// * NotOrganizationMasterAccountException // This exception is thrown when the AWS account making the request to create // or update an organization trail is not the master account for an organization // in AWS Organizations. For more information, see Prepare For Creating a Trail // For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). // -// * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException" +// * InsufficientDependencyServiceAccessPermissionException // This exception is thrown when the IAM user or role that is used to create // the organization trail is lacking one or more required permissions for creating // an organization trail in a required service. For more information, see Prepare @@ -495,8 +499,8 @@ func (c *CloudTrail) DescribeTrailsRequest(input *DescribeTrailsInput) (req *req // DescribeTrails API operation for AWS CloudTrail. // -// Retrieves settings for the trail associated with the current region for your -// account. +// Retrieves settings for one or more trails 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 @@ -505,13 +509,29 @@ func (c *CloudTrail) DescribeTrailsRequest(input *DescribeTrailsInput) (req *req // See the AWS API reference guide for AWS CloudTrail's // API operation DescribeTrails for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// Returned Error Types: +// * UnsupportedOperationException // This exception is thrown when the requested operation is not supported. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // This exception is thrown when the requested operation is not permitted. // +// * 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) +// // See also, 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) @@ -589,7 +609,7 @@ func (c *CloudTrail) GetEventSelectorsRequest(input *GetEventSelectorsInput) (re // * If your event selector includes data events, the Amazon S3 objects or // AWS Lambda functions that you are logging for data events. // -// 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) +// For more information, see Logging Data and Management Events for Trails (https://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 @@ -599,11 +619,11 @@ func (c *CloudTrail) GetEventSelectorsRequest(input *GetEventSelectorsInput) (re // See the AWS API reference guide for AWS CloudTrail's // API operation GetEventSelectors for usage and error information. // -// Returned Error Codes: -// * ErrCodeTrailNotFoundException "TrailNotFoundException" +// Returned Error Types: +// * TrailNotFoundException // This exception is thrown when the trail with the given name is not found. // -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" +// * InvalidTrailNameException // This exception is thrown when the provided trail name is not valid. Trail // names must meet the following requirements: // @@ -619,10 +639,10 @@ func (c *CloudTrail) GetEventSelectorsRequest(input *GetEventSelectorsInput) (re // // * Not be in IP address format (for example, 192.168.5.4) // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // This exception is thrown when the requested operation is not supported. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // This exception is thrown when the requested operation is not permitted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetEventSelectors @@ -647,68 +667,71 @@ func (c *CloudTrail) GetEventSelectorsWithContext(ctx aws.Context, input *GetEve return out, req.Send() } -const opGetTrailStatus = "GetTrailStatus" +const opGetInsightSelectors = "GetInsightSelectors" -// GetTrailStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetTrailStatus operation. The "output" return +// GetInsightSelectorsRequest generates a "aws/request.Request" representing the +// client's request for the GetInsightSelectors operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetTrailStatus for more information on using the GetTrailStatus +// See GetInsightSelectors for more information on using the GetInsightSelectors // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetTrailStatusRequest method. -// req, resp := client.GetTrailStatusRequest(params) +// // Example sending a request using the GetInsightSelectorsRequest method. +// req, resp := client.GetInsightSelectorsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrailStatus -func (c *CloudTrail) GetTrailStatusRequest(input *GetTrailStatusInput) (req *request.Request, output *GetTrailStatusOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetInsightSelectors +func (c *CloudTrail) GetInsightSelectorsRequest(input *GetInsightSelectorsInput) (req *request.Request, output *GetInsightSelectorsOutput) { op := &request.Operation{ - Name: opGetTrailStatus, + Name: opGetInsightSelectors, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetTrailStatusInput{} + input = &GetInsightSelectorsInput{} } - output = &GetTrailStatusOutput{} + output = &GetInsightSelectorsOutput{} req = c.newRequest(op, input, output) return } -// GetTrailStatus API operation for AWS CloudTrail. +// GetInsightSelectors 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. +// Describes the settings for the Insights event selectors that you configured +// for your trail. GetInsightSelectors shows if CloudTrail Insights event logging +// is enabled on the trail, and if it is, which insight types are enabled. If +// you run GetInsightSelectors on a trail that does not have Insights events +// enabled, the operation throws the exception InsightNotEnabledException +// +// For more information, see Logging CloudTrail Insights Events for Trails (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-insights-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 GetTrailStatus for usage and error information. +// API operation GetInsightSelectors for usage and error information. // -// Returned Error Codes: -// * ErrCodeTrailNotFoundException "TrailNotFoundException" +// Returned Error Types: +// * TrailNotFoundException // This exception is thrown when the trail with the given name is not found. // -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" +// * InvalidTrailNameException // This exception is thrown when the provided trail name is not valid. Trail // names must meet the following requirements: // @@ -724,192 +747,201 @@ func (c *CloudTrail) GetTrailStatusRequest(input *GetTrailStatusInput) (req *req // // * Not be in IP address format (for example, 192.168.5.4) // -// See also, 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) +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * InsightNotEnabledException +// If you run GetInsightSelectors on a trail that does not have Insights events +// enabled, the operation throws the exception InsightNotEnabledException. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetInsightSelectors +func (c *CloudTrail) GetInsightSelectors(input *GetInsightSelectorsInput) (*GetInsightSelectorsOutput, error) { + req, out := c.GetInsightSelectorsRequest(input) return out, req.Send() } -// GetTrailStatusWithContext is the same as GetTrailStatus with the addition of +// GetInsightSelectorsWithContext is the same as GetInsightSelectors with the addition of // the ability to pass a context and additional request options. // -// See GetTrailStatus for details on how to use this API operation. +// See GetInsightSelectors for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudTrail) GetTrailStatusWithContext(ctx aws.Context, input *GetTrailStatusInput, opts ...request.Option) (*GetTrailStatusOutput, error) { - req, out := c.GetTrailStatusRequest(input) +func (c *CloudTrail) GetInsightSelectorsWithContext(ctx aws.Context, input *GetInsightSelectorsInput, opts ...request.Option) (*GetInsightSelectorsOutput, error) { + req, out := c.GetInsightSelectorsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListPublicKeys = "ListPublicKeys" +const opGetTrail = "GetTrail" -// ListPublicKeysRequest generates a "aws/request.Request" representing the -// client's request for the ListPublicKeys operation. The "output" return +// GetTrailRequest generates a "aws/request.Request" representing the +// client's request for the GetTrail operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListPublicKeys for more information on using the ListPublicKeys +// See GetTrail for more information on using the GetTrail // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListPublicKeysRequest method. -// req, resp := client.ListPublicKeysRequest(params) +// // Example sending a request using the GetTrailRequest method. +// req, resp := client.GetTrailRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListPublicKeys -func (c *CloudTrail) ListPublicKeysRequest(input *ListPublicKeysInput) (req *request.Request, output *ListPublicKeysOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrail +func (c *CloudTrail) GetTrailRequest(input *GetTrailInput) (req *request.Request, output *GetTrailOutput) { op := &request.Operation{ - Name: opListPublicKeys, + Name: opGetTrail, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ListPublicKeysInput{} + input = &GetTrailInput{} } - output = &ListPublicKeysOutput{} + output = &GetTrailOutput{} 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. +// GetTrail API operation for AWS CloudTrail. // -// 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 settings information for a specified 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 ListPublicKeys for usage and error information. +// API operation GetTrail 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. +// Returned Error Types: +// * TrailNotFoundException +// This exception is thrown when the trail with the given name is not found. +// +// * 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" +// * UnsupportedOperationException // This exception is thrown when the requested operation is not supported. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // This exception is thrown when the requested operation is not permitted. // -// * ErrCodeInvalidTokenException "InvalidTokenException" -// Reserved for future use. -// -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrail +func (c *CloudTrail) GetTrail(input *GetTrailInput) (*GetTrailOutput, error) { + req, out := c.GetTrailRequest(input) return out, req.Send() } -// ListPublicKeysWithContext is the same as ListPublicKeys with the addition of +// GetTrailWithContext is the same as GetTrail with the addition of // the ability to pass a context and additional request options. // -// See ListPublicKeys for details on how to use this API operation. +// See GetTrail for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudTrail) ListPublicKeysWithContext(ctx aws.Context, input *ListPublicKeysInput, opts ...request.Option) (*ListPublicKeysOutput, error) { - req, out := c.ListPublicKeysRequest(input) +func (c *CloudTrail) GetTrailWithContext(ctx aws.Context, input *GetTrailInput, opts ...request.Option) (*GetTrailOutput, error) { + req, out := c.GetTrailRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListTags = "ListTags" +const opGetTrailStatus = "GetTrailStatus" -// ListTagsRequest generates a "aws/request.Request" representing the -// client's request for the ListTags operation. The "output" return +// GetTrailStatusRequest generates a "aws/request.Request" representing the +// client's request for the GetTrailStatus operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListTags for more information on using the ListTags +// See GetTrailStatus for more information on using the GetTrailStatus // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListTagsRequest method. -// req, resp := client.ListTagsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTags -func (c *CloudTrail) ListTagsRequest(input *ListTagsInput) (req *request.Request, output *ListTagsOutput) { +// See also, 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: opListTags, + Name: opGetTrailStatus, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ListTagsInput{} + input = &GetTrailStatusInput{} } - output = &ListTagsOutput{} + output = &GetTrailStatusOutput{} req = c.newRequest(op, input, output) return } -// ListTags API operation for AWS CloudTrail. +// GetTrailStatus API operation for AWS CloudTrail. // -// Lists the tags for the trail in the current region. +// 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 ListTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// This exception is thrown when the specified resource is not found. -// -// * ErrCodeARNInvalidException "CloudTrailARNInvalidException" -// 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-2:123456789012:trail/MyTrail +// API operation GetTrailStatus for usage and error information. // -// * ErrCodeResourceTypeNotSupportedException "ResourceTypeNotSupportedException" -// This exception is thrown when the specified resource type is not supported -// by CloudTrail. +// Returned Error Types: +// * TrailNotFoundException +// This exception is thrown when the trail with the given name is not found. // -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" +// * InvalidTrailNameException // This exception is thrown when the provided trail name is not valid. Trail // names must meet the following requirements: // @@ -925,300 +957,262 @@ func (c *CloudTrail) ListTagsRequest(input *ListTagsInput) (req *request.Request // // * Not be in IP address format (for example, 192.168.5.4) // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // This exception is thrown when the requested operation is not supported. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // This exception is thrown when the requested operation is not permitted. // -// * ErrCodeInvalidTokenException "InvalidTokenException" -// Reserved for future use. -// -// See also, 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) +// See also, 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) return out, req.Send() } -// ListTagsWithContext is the same as ListTags with the addition of +// GetTrailStatusWithContext is the same as GetTrailStatus with the addition of // the ability to pass a context and additional request options. // -// See ListTags for details on how to use this API operation. +// See GetTrailStatus for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudTrail) ListTagsWithContext(ctx aws.Context, input *ListTagsInput, opts ...request.Option) (*ListTagsOutput, error) { - req, out := c.ListTagsRequest(input) +func (c *CloudTrail) GetTrailStatusWithContext(ctx aws.Context, input *GetTrailStatusInput, opts ...request.Option) (*GetTrailStatusOutput, error) { + req, out := c.GetTrailStatusRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opLookupEvents = "LookupEvents" +const opListPublicKeys = "ListPublicKeys" -// LookupEventsRequest generates a "aws/request.Request" representing the -// client's request for the LookupEvents operation. The "output" return +// ListPublicKeysRequest generates a "aws/request.Request" representing the +// client's request for the ListPublicKeys operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See LookupEvents for more information on using the LookupEvents +// See ListPublicKeys for more information on using the ListPublicKeys // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the LookupEventsRequest method. -// req, resp := client.LookupEventsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/LookupEvents -func (c *CloudTrail) LookupEventsRequest(input *LookupEventsInput) (req *request.Request, output *LookupEventsOutput) { +// See also, 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: opLookupEvents, + Name: opListPublicKeys, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", + LimitToken: "", TruncationToken: "", }, } if input == nil { - input = &LookupEventsInput{} + input = &ListPublicKeysInput{} } - output = &LookupEventsOutput{} + output = &ListPublicKeysOutput{} req = c.newRequest(op, input, output) return } -// LookupEvents API operation for AWS CloudTrail. -// -// Looks up management events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html#cloudtrail-concepts-management-events) -// captured by CloudTrail. Events for a region can be looked up in that region -// during the last 90 days. Lookup supports the following attributes: -// -// * AWS access key -// -// * Event ID -// -// * Event name -// -// * Event source -// -// * Read only -// -// * Resource name -// -// * Resource type -// -// * User name -// -// All attributes are optional. The default number of results returned is 50, -// with a maximum of 50 possible. The response includes a token that you can -// use to get the next page of results. +// ListPublicKeys API operation for AWS CloudTrail. // -// The rate of lookup requests is limited to one per second per account. If -// this limit is exceeded, a throttling error occurs. +// 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. // -// Events that occurred during the selected time range will not be available -// for lookup if CloudTrail logging was not enabled when the events occurred. +// 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 LookupEvents for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidLookupAttributesException "InvalidLookupAttributesException" -// Occurs when an invalid lookup attribute is specified. +// API operation ListPublicKeys for usage and error information. // -// * ErrCodeInvalidTimeRangeException "InvalidTimeRangeException" +// Returned Error Types: +// * 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. +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. // -// * 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. +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. // -// See also, 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) +// * InvalidTokenException +// Reserved for future use. +// +// See also, 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) return out, req.Send() } -// LookupEventsWithContext is the same as LookupEvents with the addition of +// ListPublicKeysWithContext is the same as ListPublicKeys with the addition of // the ability to pass a context and additional request options. // -// See LookupEvents for details on how to use this API operation. +// See ListPublicKeys for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudTrail) LookupEventsWithContext(ctx aws.Context, input *LookupEventsInput, opts ...request.Option) (*LookupEventsOutput, error) { - req, out := c.LookupEventsRequest(input) +func (c *CloudTrail) ListPublicKeysWithContext(ctx aws.Context, input *ListPublicKeysInput, opts ...request.Option) (*ListPublicKeysOutput, error) { + req, out := c.ListPublicKeysRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// LookupEventsPages iterates over the pages of a LookupEvents operation, +// ListPublicKeysPages iterates over the pages of a ListPublicKeys 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. +// See ListPublicKeys 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. +// // Example iterating over at most 3 pages of a ListPublicKeys operation. // pageNum := 0 -// err := client.LookupEventsPages(params, -// func(page *cloudtrail.LookupEventsOutput, lastPage bool) bool { +// err := client.ListPublicKeysPages(params, +// func(page *cloudtrail.ListPublicKeysOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *CloudTrail) LookupEventsPages(input *LookupEventsInput, fn func(*LookupEventsOutput, bool) bool) error { - return c.LookupEventsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *CloudTrail) ListPublicKeysPages(input *ListPublicKeysInput, fn func(*ListPublicKeysOutput, bool) bool) error { + return c.ListPublicKeysPagesWithContext(aws.BackgroundContext(), input, fn) } -// LookupEventsPagesWithContext same as LookupEventsPages except +// ListPublicKeysPagesWithContext same as ListPublicKeysPages 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 *CloudTrail) LookupEventsPagesWithContext(ctx aws.Context, input *LookupEventsInput, fn func(*LookupEventsOutput, bool) bool, opts ...request.Option) error { +func (c *CloudTrail) ListPublicKeysPagesWithContext(ctx aws.Context, input *ListPublicKeysInput, fn func(*ListPublicKeysOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *LookupEventsInput + var inCpy *ListPublicKeysInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.LookupEventsRequest(inCpy) + req, _ := c.ListPublicKeysRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*LookupEventsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPublicKeysOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opPutEventSelectors = "PutEventSelectors" +const opListTags = "ListTags" -// PutEventSelectorsRequest generates a "aws/request.Request" representing the -// client's request for the PutEventSelectors operation. The "output" return +// ListTagsRequest generates a "aws/request.Request" representing the +// client's request for the ListTags operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutEventSelectors for more information on using the PutEventSelectors +// See ListTags for more information on using the ListTags // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutEventSelectorsRequest method. -// req, resp := client.PutEventSelectorsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutEventSelectors -func (c *CloudTrail) PutEventSelectorsRequest(input *PutEventSelectorsInput) (req *request.Request, output *PutEventSelectorsOutput) { +// See also, 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: opPutEventSelectors, + Name: opListTags, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "", + TruncationToken: "", + }, } if input == nil { - input = &PutEventSelectorsInput{} + input = &ListTagsInput{} } - output = &PutEventSelectorsOutput{} + output = &ListTagsOutput{} req = c.newRequest(op, input, output) return } -// PutEventSelectors API operation for AWS CloudTrail. -// -// Configures an event selector for your trail. Use event selectors to further -// specify the management and data event settings for your trail. By default, -// trails created without specific event selectors will be configured to log -// all read and write management events, and no 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. +// ListTags API operation for AWS CloudTrail. // -// 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) -// and Limits in AWS CloudTrail (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) -// in the AWS CloudTrail User Guide. +// 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 PutEventSelectors for usage and error information. +// API operation ListTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeTrailNotFoundException "TrailNotFoundException" -// This exception is thrown when the trail with the given name is not found. +// Returned Error Types: +// * ResourceNotFoundException +// This exception is thrown when the specified resource is not found. +// +// * 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-2:123456789012:trail/MyTrail +// +// * ResourceTypeNotSupportedException +// This exception is thrown when the specified resource type is not supported +// by CloudTrail. // -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" +// * InvalidTrailNameException // This exception is thrown when the provided trail name is not valid. Trail // names must meet the following requirements: // @@ -1234,380 +1228,511 @@ func (c *CloudTrail) PutEventSelectorsRequest(input *PutEventSelectorsInput) (re // // * 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 -// a number of event selectors or data resources that is not valid. The combination -// of event selectors and data resources is not valid. A trail can have up to -// 5 event selectors. A trail is limited to 250 data resources. These data resources -// can be distributed across event selectors, but the overall total cannot exceed -// 250. -// -// You can: -// -// * 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. -// The limit of number of resources on an individual event selector is configurable -// up to 250. However, this upper limit is allowed only if the total number -// of data resources does not exceed 250 across all event selectors for a -// trail. -// -// * Specify a valid value for a parameter. For example, specifying the ReadWriteType -// parameter with a value of read-only is invalid. -// -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // This exception is thrown when the requested operation is not supported. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // This exception is thrown when the requested operation is not permitted. // -// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException" -// This exception is thrown when the AWS account making the request to create -// or update an organization trail is not the master account for an organization -// in AWS Organizations. For more information, see Prepare For Creating a Trail -// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). -// -// * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException" -// This exception is thrown when the IAM user or role that is used to create -// the organization trail is lacking one or more required permissions for creating -// an organization trail in a required service. For more information, see Prepare -// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// * InvalidTokenException +// Reserved for future use. // -// See also, 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) +// See also, 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) return out, req.Send() } -// PutEventSelectorsWithContext is the same as PutEventSelectors with the addition of +// ListTagsWithContext is the same as ListTags with the addition of // the ability to pass a context and additional request options. // -// See PutEventSelectors for details on how to use this API operation. +// See ListTags for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudTrail) PutEventSelectorsWithContext(ctx aws.Context, input *PutEventSelectorsInput, opts ...request.Option) (*PutEventSelectorsOutput, error) { - req, out := c.PutEventSelectorsRequest(input) +func (c *CloudTrail) ListTagsWithContext(ctx aws.Context, input *ListTagsInput, opts ...request.Option) (*ListTagsOutput, error) { + req, out := c.ListTagsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRemoveTags = "RemoveTags" +// ListTagsPages iterates over the pages of a ListTags operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTags 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 ListTags operation. +// pageNum := 0 +// err := client.ListTagsPages(params, +// func(page *cloudtrail.ListTagsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CloudTrail) ListTagsPages(input *ListTagsInput, fn func(*ListTagsOutput, bool) bool) error { + return c.ListTagsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// RemoveTagsRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTags operation. The "output" return +// ListTagsPagesWithContext same as ListTagsPages 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 *CloudTrail) ListTagsPagesWithContext(ctx aws.Context, input *ListTagsInput, fn func(*ListTagsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTagsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTagsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTagsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTrails = "ListTrails" + +// ListTrailsRequest generates a "aws/request.Request" representing the +// client's request for the ListTrails operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RemoveTags for more information on using the RemoveTags +// See ListTrails for more information on using the ListTrails // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RemoveTagsRequest method. -// req, resp := client.RemoveTagsRequest(params) +// // Example sending a request using the ListTrailsRequest method. +// req, resp := client.ListTrailsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RemoveTags -func (c *CloudTrail) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, output *RemoveTagsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTrails +func (c *CloudTrail) ListTrailsRequest(input *ListTrailsInput) (req *request.Request, output *ListTrailsOutput) { op := &request.Operation{ - Name: opRemoveTags, + Name: opListTrails, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "", + TruncationToken: "", + }, } if input == nil { - input = &RemoveTagsInput{} + input = &ListTrailsInput{} } - output = &RemoveTagsOutput{} + output = &ListTrailsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// RemoveTags API operation for AWS CloudTrail. +// ListTrails API operation for AWS CloudTrail. // -// Removes the specified tags from a trail. +// Lists trails that are in the current 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 RemoveTags for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// This exception is thrown when the specified resource is not found. -// -// * ErrCodeARNInvalidException "CloudTrailARNInvalidException" -// 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-2: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}_.:/=+\\-@]*)$. +// API operation ListTrails for usage and error information. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// Returned Error Types: +// * UnsupportedOperationException // This exception is thrown when the requested operation is not supported. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // This exception is thrown when the requested operation is not permitted. // -// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException" -// This exception is thrown when the AWS account making the request to create -// or update an organization trail is not the master account for an organization -// in AWS Organizations. For more information, see Prepare For Creating a Trail -// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). -// -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTrails +func (c *CloudTrail) ListTrails(input *ListTrailsInput) (*ListTrailsOutput, error) { + req, out := c.ListTrailsRequest(input) return out, req.Send() } -// RemoveTagsWithContext is the same as RemoveTags with the addition of +// ListTrailsWithContext is the same as ListTrails with the addition of // the ability to pass a context and additional request options. // -// See RemoveTags for details on how to use this API operation. +// See ListTrails for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudTrail) RemoveTagsWithContext(ctx aws.Context, input *RemoveTagsInput, opts ...request.Option) (*RemoveTagsOutput, error) { - req, out := c.RemoveTagsRequest(input) +func (c *CloudTrail) ListTrailsWithContext(ctx aws.Context, input *ListTrailsInput, opts ...request.Option) (*ListTrailsOutput, error) { + req, out := c.ListTrailsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStartLogging = "StartLogging" +// ListTrailsPages iterates over the pages of a ListTrails operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTrails 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 ListTrails operation. +// pageNum := 0 +// err := client.ListTrailsPages(params, +// func(page *cloudtrail.ListTrailsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CloudTrail) ListTrailsPages(input *ListTrailsInput, fn func(*ListTrailsOutput, bool) bool) error { + return c.ListTrailsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// StartLoggingRequest generates a "aws/request.Request" representing the -// client's request for the StartLogging operation. The "output" return +// ListTrailsPagesWithContext same as ListTrailsPages 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 *CloudTrail) ListTrailsPagesWithContext(ctx aws.Context, input *ListTrailsInput, fn func(*ListTrailsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTrailsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTrailsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTrailsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opLookupEvents = "LookupEvents" + +// LookupEventsRequest generates a "aws/request.Request" representing the +// client's request for the LookupEvents operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StartLogging for more information on using the StartLogging +// See LookupEvents for more information on using the LookupEvents // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StartLoggingRequest method. -// req, resp := client.StartLoggingRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartLogging -func (c *CloudTrail) StartLoggingRequest(input *StartLoggingInput) (req *request.Request, output *StartLoggingOutput) { +// See also, 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: opStartLogging, + Name: opLookupEvents, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &StartLoggingInput{} + input = &LookupEventsInput{} } - output = &StartLoggingOutput{} + output = &LookupEventsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// StartLogging API operation for AWS CloudTrail. +// LookupEvents 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. +// Looks up management events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html#cloudtrail-concepts-management-events) +// or CloudTrail Insights events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html#cloudtrail-concepts-insights-events) +// that are captured by CloudTrail. You can look up events that occurred in +// a region within the last 90 days. Lookup supports the following attributes +// for management events: +// +// * AWS access key +// +// * Event ID +// +// * Event name +// +// * Event source +// +// * Read only +// +// * Resource name +// +// * Resource type +// +// * User name +// +// Lookup supports the following attributes for Insights events: +// +// * Event ID +// +// * Event name +// +// * Event source +// +// All attributes are optional. The default number of results returned is 50, +// 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 two per second per account. If +// this limit is exceeded, a throttling error occurs. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 (-) +// API operation LookupEvents for usage and error information. // -// * Start with a letter or number, and end with a letter or number +// Returned Error Types: +// * InvalidLookupAttributesException +// Occurs when an invalid lookup attribute is specified. // -// * Be between 3 and 128 characters +// * 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. // -// * Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are invalid. +// * InvalidMaxResultsException +// This exception is thrown if the limit specified is invalid. // -// * Not be in IP address format (for example, 192.168.5.4) +// * InvalidNextTokenException +// Invalid token or token that was previously used in a request with different +// parameters. This exception is thrown if the token is invalid. // -// * 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. +// * InvalidEventCategoryException +// Occurs if an event category that is not valid is specified as a value of +// EventCategory. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // This exception is thrown when the requested operation is not supported. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // This exception is thrown when the requested operation is not permitted. // -// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException" -// This exception is thrown when the AWS account making the request to create -// or update an organization trail is not the master account for an organization -// in AWS Organizations. For more information, see Prepare For Creating a Trail -// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). -// -// * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException" -// This exception is thrown when the IAM user or role that is used to create -// the organization trail is lacking one or more required permissions for creating -// an organization trail in a required service. For more information, see Prepare -// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). -// -// See also, 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) +// See also, 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) return out, req.Send() } -// StartLoggingWithContext is the same as StartLogging with the addition of +// LookupEventsWithContext is the same as LookupEvents with the addition of // the ability to pass a context and additional request options. // -// See StartLogging for details on how to use this API operation. +// See LookupEvents for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudTrail) StartLoggingWithContext(ctx aws.Context, input *StartLoggingInput, opts ...request.Option) (*StartLoggingOutput, error) { - req, out := c.StartLoggingRequest(input) +func (c *CloudTrail) LookupEventsWithContext(ctx aws.Context, input *LookupEventsInput, opts ...request.Option) (*LookupEventsOutput, error) { + req, out := c.LookupEventsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopLogging = "StopLogging" +// 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 *cloudtrail.LookupEventsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CloudTrail) LookupEventsPages(input *LookupEventsInput, fn func(*LookupEventsOutput, bool) bool) error { + return c.LookupEventsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// StopLoggingRequest generates a "aws/request.Request" representing the -// client's request for the StopLogging operation. The "output" return +// LookupEventsPagesWithContext same as LookupEventsPages 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 *CloudTrail) LookupEventsPagesWithContext(ctx aws.Context, input *LookupEventsInput, fn func(*LookupEventsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *LookupEventsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.LookupEventsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*LookupEventsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opPutEventSelectors = "PutEventSelectors" + +// PutEventSelectorsRequest generates a "aws/request.Request" representing the +// client's request for the PutEventSelectors operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopLogging for more information on using the StopLogging +// See PutEventSelectors for more information on using the PutEventSelectors // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopLoggingRequest method. -// req, resp := client.StopLoggingRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopLogging -func (c *CloudTrail) StopLoggingRequest(input *StopLoggingInput) (req *request.Request, output *StopLoggingOutput) { +// See also, 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: opStopLogging, + Name: opPutEventSelectors, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StopLoggingInput{} + input = &PutEventSelectorsInput{} } - output = &StopLoggingOutput{} + output = &PutEventSelectorsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// StopLogging API operation for AWS CloudTrail. +// PutEventSelectors 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. +// Configures an event selector for your trail. Use event selectors to further +// specify the management and data event settings for your trail. By default, +// trails created without specific event selectors will be configured to log +// all read and write management events, and no 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 (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html) +// and Limits in AWS CloudTrail (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.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 StopLogging for usage and error information. +// API operation PutEventSelectors for usage and error information. // -// Returned Error Codes: -// * ErrCodeTrailNotFoundException "TrailNotFoundException" +// Returned Error Types: +// * TrailNotFoundException // This exception is thrown when the trail with the given name is not found. // -// * ErrCodeInvalidTrailNameException "InvalidTrailNameException" +// * InvalidTrailNameException // This exception is thrown when the provided trail name is not valid. Trail // names must meet the following requirements: // @@ -1623,138 +1748,132 @@ func (c *CloudTrail) StopLoggingRequest(input *StopLoggingInput) (req *request.R // // * Not be in IP address format (for example, 192.168.5.4) // -// * ErrCodeInvalidHomeRegionException "InvalidHomeRegionException" +// * 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. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * InvalidEventSelectorsException +// This exception is thrown when the PutEventSelectors operation is called with +// a number of event selectors or data resources that is not valid. The combination +// of event selectors and data resources is not valid. A trail can have up to +// 5 event selectors. A trail is limited to 250 data resources. These data resources +// can be distributed across event selectors, but the overall total cannot exceed +// 250. +// +// You can: +// +// * 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. +// The limit of number of resources on an individual event selector is configurable +// up to 250. However, this upper limit is allowed only if the total number +// of data resources does not exceed 250 across all event selectors for a +// trail. +// +// * Specify a valid value for a parameter. For example, specifying the ReadWriteType +// parameter with a value of read-only is invalid. +// +// * UnsupportedOperationException // This exception is thrown when the requested operation is not supported. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // This exception is thrown when the requested operation is not permitted. // -// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException" +// * NotOrganizationMasterAccountException // This exception is thrown when the AWS account making the request to create // or update an organization trail is not the master account for an organization // in AWS Organizations. For more information, see Prepare For Creating a Trail // For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). // -// * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException" +// * InsufficientDependencyServiceAccessPermissionException // This exception is thrown when the IAM user or role that is used to create // the organization trail is lacking one or more required permissions for creating // an organization trail in a required service. For more information, see Prepare // For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). // -// See also, 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) +// See also, 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) return out, req.Send() } -// StopLoggingWithContext is the same as StopLogging with the addition of +// PutEventSelectorsWithContext is the same as PutEventSelectors with the addition of // the ability to pass a context and additional request options. // -// See StopLogging for details on how to use this API operation. +// See PutEventSelectors for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudTrail) StopLoggingWithContext(ctx aws.Context, input *StopLoggingInput, opts ...request.Option) (*StopLoggingOutput, error) { - req, out := c.StopLoggingRequest(input) +func (c *CloudTrail) PutEventSelectorsWithContext(ctx aws.Context, input *PutEventSelectorsInput, opts ...request.Option) (*PutEventSelectorsOutput, error) { + req, out := c.PutEventSelectorsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateTrail = "UpdateTrail" +const opPutInsightSelectors = "PutInsightSelectors" -// UpdateTrailRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTrail operation. The "output" return +// PutInsightSelectorsRequest generates a "aws/request.Request" representing the +// client's request for the PutInsightSelectors operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateTrail for more information on using the UpdateTrail +// See PutInsightSelectors for more information on using the PutInsightSelectors // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateTrailRequest method. -// req, resp := client.UpdateTrailRequest(params) +// // Example sending a request using the PutInsightSelectorsRequest method. +// req, resp := client.PutInsightSelectorsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateTrail -func (c *CloudTrail) UpdateTrailRequest(input *UpdateTrailInput) (req *request.Request, output *UpdateTrailOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutInsightSelectors +func (c *CloudTrail) PutInsightSelectorsRequest(input *PutInsightSelectorsInput) (req *request.Request, output *PutInsightSelectorsOutput) { op := &request.Operation{ - Name: opUpdateTrail, + Name: opPutInsightSelectors, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateTrailInput{} + input = &PutInsightSelectorsInput{} } - output = &UpdateTrailOutput{} + output = &PutInsightSelectorsOutput{} req = c.newRequest(op, input, output) return } -// UpdateTrail API operation for AWS CloudTrail. +// PutInsightSelectors 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. +// Lets you enable Insights event logging by specifying the Insights selectors +// that you want to enable on an existing trail. You also use PutInsightSelectors +// to turn off Insights event logging, by passing an empty list of insight types. +// In this release, only ApiCallRateInsight is supported as an Insights selector. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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. +// API operation PutInsightSelectors for usage and error information. // -// * 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" +// Returned Error Types: +// * 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" +// * InvalidTrailNameException // This exception is thrown when the provided trail name is not valid. Trail // names must meet the following requirements: // @@ -1770,1237 +1889,3668 @@ func (c *CloudTrail) UpdateTrailRequest(input *UpdateTrailInput) (req *request.R // // * 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" +// * 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. +// * InvalidInsightSelectorsException +// The formatting or syntax of the InsightSelectors JSON statement in your PutInsightSelectors +// or GetInsightSelectors request is not valid, or the specified insight type +// in the InsightSelectors statement is not a valid insight type. // -// * ErrCodeInvalidCloudWatchLogsRoleArnException "InvalidCloudWatchLogsRoleArnException" -// This exception is thrown when the provided role is not valid. +// * InsufficientS3BucketPolicyException +// This exception is thrown when the policy on the S3 bucket is not sufficient. // -// * ErrCodeCloudWatchLogsDeliveryUnavailableException "CloudWatchLogsDeliveryUnavailableException" -// Cannot set a CloudWatch Logs delivery for this region. +// * InsufficientEncryptionPolicyException +// This exception is thrown when the policy on the S3 bucket or KMS key is not +// sufficient. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // This exception is thrown when the requested operation is not supported. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // This exception is thrown when the requested operation is not permitted. // -// * ErrCodeAccessNotEnabledException "CloudTrailAccessNotEnabledException" -// This exception is thrown when trusted access has not been enabled between -// AWS CloudTrail and AWS Organizations. For more information, see Enabling -// Trusted Access with Other AWS Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). -// -// * ErrCodeInsufficientDependencyServiceAccessPermissionException "InsufficientDependencyServiceAccessPermissionException" -// This exception is thrown when the IAM user or role that is used to create -// the organization trail is lacking one or more required permissions for creating -// an organization trail in a required service. For more information, see Prepare -// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). -// -// * ErrCodeOrganizationsNotInUseException "OrganizationsNotInUseException" -// This exception is thrown when the request is made from an AWS account that -// is not a member of an organization. To make this request, sign in using the -// credentials of an account that belongs to an organization. -// -// * ErrCodeNotOrganizationMasterAccountException "NotOrganizationMasterAccountException" +// * NotOrganizationMasterAccountException // This exception is thrown when the AWS account making the request to create // or update an organization trail is not the master account for an organization // in AWS Organizations. For more information, see Prepare For Creating a Trail // For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). // -// * ErrCodeOrganizationNotInAllFeaturesModeException "OrganizationNotInAllFeaturesModeException" -// This exception is thrown when AWS Organizations is not configured to support -// all features. All features must be enabled in AWS Organization to support -// creating an organization trail. For more information, see Prepare For Creating -// a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). -// -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutInsightSelectors +func (c *CloudTrail) PutInsightSelectors(input *PutInsightSelectorsInput) (*PutInsightSelectorsOutput, error) { + req, out := c.PutInsightSelectorsRequest(input) return out, req.Send() } -// UpdateTrailWithContext is the same as UpdateTrail with the addition of +// PutInsightSelectorsWithContext is the same as PutInsightSelectors with the addition of // the ability to pass a context and additional request options. // -// See UpdateTrail for details on how to use this API operation. +// See PutInsightSelectors for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudTrail) UpdateTrailWithContext(ctx aws.Context, input *UpdateTrailInput, opts ...request.Option) (*UpdateTrailOutput, error) { - req, out := c.UpdateTrailRequest(input) +func (c *CloudTrail) PutInsightSelectorsWithContext(ctx aws.Context, input *PutInsightSelectorsInput, opts ...request.Option) (*PutInsightSelectorsOutput, error) { + req, out := c.PutInsightSelectorsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// Specifies the tags to add to a trail. -type AddTagsInput struct { - _ struct{} `type:"structure"` +const opRemoveTags = "RemoveTags" - // 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-2:123456789012:trail/MyTrail - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` +// RemoveTagsRequest generates a "aws/request.Request" representing the +// client's request for the RemoveTags operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RemoveTags for more information on using the RemoveTags +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RemoveTagsRequest method. +// req, resp := client.RemoveTagsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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: "/", + } - // Contains a list of CloudTrail tags, up to a limit of 50 - TagsList []*Tag `type:"list"` + if input == nil { + input = &RemoveTagsInput{} + } + + output = &RemoveTagsOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return } -// String returns the string representation -func (s AddTagsInput) String() string { - return awsutil.Prettify(s) +// 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 Types: +// * ResourceNotFoundException +// This exception is thrown when the specified resource is not found. +// +// * 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-2:123456789012:trail/MyTrail +// +// * ResourceTypeNotSupportedException +// This exception is thrown when the specified resource type is not supported +// by CloudTrail. +// +// * 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) +// +// * InvalidTagParameterException +// This exception is thrown when the specified tag key or values are not valid. +// It can also occur if there are duplicate tags or too many tags on the resource. +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * NotOrganizationMasterAccountException +// This exception is thrown when the AWS account making the request to create +// or update an organization trail is not the master account for an organization +// in AWS Organizations. For more information, see Prepare For Creating a Trail +// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// See also, 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) + return out, req.Send() } -// GoString returns the string representation -func (s AddTagsInput) GoString() string { - return s.String() +// RemoveTagsWithContext is the same as RemoveTags with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudTrail) RemoveTagsWithContext(ctx aws.Context, input *RemoveTagsInput, opts ...request.Option) (*RemoveTagsOutput, error) { + req, out := c.RemoveTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -// 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)) - } - } +const opStartLogging = "StartLogging" + +// StartLoggingRequest generates a "aws/request.Request" representing the +// client's request for the StartLogging operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartLogging for more information on using the StartLogging +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartLoggingRequest method. +// req, resp := client.StartLoggingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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 invalidParams.Len() > 0 { - return invalidParams + if input == nil { + input = &StartLoggingInput{} } - return nil -} -// SetResourceId sets the ResourceId field's value. -func (s *AddTagsInput) SetResourceId(v string) *AddTagsInput { - s.ResourceId = &v - return s + output = &StartLoggingOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return } -// SetTagsList sets the TagsList field's value. +// 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 Types: +// * TrailNotFoundException +// This exception is thrown when the trail with the given name is not found. +// +// * 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) +// +// * 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. +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * NotOrganizationMasterAccountException +// This exception is thrown when the AWS account making the request to create +// or update an organization trail is not the master account for an organization +// in AWS Organizations. For more information, see Prepare For Creating a Trail +// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// * InsufficientDependencyServiceAccessPermissionException +// This exception is thrown when the IAM user or role that is used to create +// the organization trail is lacking one or more required permissions for creating +// an organization trail in a required service. For more information, see Prepare +// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// See also, 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) + return out, req.Send() +} + +// StartLoggingWithContext is the same as StartLogging with the addition of +// the ability to pass a context and additional request options. +// +// See StartLogging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudTrail) StartLoggingWithContext(ctx aws.Context, input *StartLoggingInput, opts ...request.Option) (*StartLoggingOutput, error) { + req, out := c.StartLoggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopLogging = "StopLogging" + +// StopLoggingRequest generates a "aws/request.Request" representing the +// client's request for the StopLogging operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopLogging for more information on using the StopLogging +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopLoggingRequest method. +// req, resp := client.StopLoggingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + 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 Types: +// * TrailNotFoundException +// This exception is thrown when the trail with the given name is not found. +// +// * 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) +// +// * 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. +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * NotOrganizationMasterAccountException +// This exception is thrown when the AWS account making the request to create +// or update an organization trail is not the master account for an organization +// in AWS Organizations. For more information, see Prepare For Creating a Trail +// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// * InsufficientDependencyServiceAccessPermissionException +// This exception is thrown when the IAM user or role that is used to create +// the organization trail is lacking one or more required permissions for creating +// an organization trail in a required service. For more information, see Prepare +// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// See also, 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) + return out, req.Send() +} + +// StopLoggingWithContext is the same as StopLogging with the addition of +// the ability to pass a context and additional request options. +// +// See StopLogging for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudTrail) StopLoggingWithContext(ctx aws.Context, input *StopLoggingInput, opts ...request.Option) (*StopLoggingOutput, error) { + req, out := c.StopLoggingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateTrail = "UpdateTrail" + +// UpdateTrailRequest generates a "aws/request.Request" representing the +// client's request for the UpdateTrail operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateTrail for more information on using the UpdateTrail +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateTrailRequest method. +// req, resp := client.UpdateTrailRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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 Types: +// * S3BucketDoesNotExistException +// This exception is thrown when the specified S3 bucket does not exist. +// +// * InsufficientS3BucketPolicyException +// This exception is thrown when the policy on the S3 bucket is not sufficient. +// +// * InsufficientSnsTopicPolicyException +// This exception is thrown when the policy on the SNS topic is not sufficient. +// +// * InsufficientEncryptionPolicyException +// This exception is thrown when the policy on the S3 bucket or KMS key is not +// sufficient. +// +// * TrailNotFoundException +// This exception is thrown when the trail with the given name is not found. +// +// * InvalidS3BucketNameException +// This exception is thrown when the provided S3 bucket name is not valid. +// +// * InvalidS3PrefixException +// This exception is thrown when the provided S3 prefix is not valid. +// +// * InvalidSnsTopicNameException +// This exception is thrown when the provided SNS topic name is not valid. +// +// * InvalidKmsKeyIdException +// This exception is thrown when the KMS key ARN is invalid. +// +// * 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) +// +// * TrailNotProvidedException +// This exception is no longer in use. +// +// * InvalidEventSelectorsException +// This exception is thrown when the PutEventSelectors operation is called with +// a number of event selectors or data resources that is not valid. The combination +// of event selectors and data resources is not valid. A trail can have up to +// 5 event selectors. A trail is limited to 250 data resources. These data resources +// can be distributed across event selectors, but the overall total cannot exceed +// 250. +// +// You can: +// +// * 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. +// The limit of number of resources on an individual event selector is configurable +// up to 250. However, this upper limit is allowed only if the total number +// of data resources does not exceed 250 across all event selectors for a +// trail. +// +// * Specify a valid value for a parameter. For example, specifying the ReadWriteType +// parameter with a value of read-only is invalid. +// +// * InvalidParameterCombinationException +// This exception is thrown when the combination of parameters provided is not +// valid. +// +// * 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. +// +// * 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. +// +// * KmsKeyDisabledException +// This exception is no longer in use. +// +// * KmsException +// This exception is thrown when there is an issue with the specified KMS key +// and the trail can’t be updated. +// +// * InvalidCloudWatchLogsLogGroupArnException +// This exception is thrown when the provided CloudWatch log group is not valid. +// +// * InvalidCloudWatchLogsRoleArnException +// This exception is thrown when the provided role is not valid. +// +// * CloudWatchLogsDeliveryUnavailableException +// Cannot set a CloudWatch Logs delivery for this region. +// +// * UnsupportedOperationException +// This exception is thrown when the requested operation is not supported. +// +// * OperationNotPermittedException +// This exception is thrown when the requested operation is not permitted. +// +// * AccessNotEnabledException +// This exception is thrown when trusted access has not been enabled between +// AWS CloudTrail and AWS Organizations. For more information, see Enabling +// Trusted Access with Other AWS Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) +// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// * InsufficientDependencyServiceAccessPermissionException +// This exception is thrown when the IAM user or role that is used to create +// the organization trail is lacking one or more required permissions for creating +// an organization trail in a required service. For more information, see Prepare +// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// * OrganizationsNotInUseException +// This exception is thrown when the request is made from an AWS account that +// is not a member of an organization. To make this request, sign in using the +// credentials of an account that belongs to an organization. +// +// * NotOrganizationMasterAccountException +// This exception is thrown when the AWS account making the request to create +// or update an organization trail is not the master account for an organization +// in AWS Organizations. For more information, see Prepare For Creating a Trail +// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// * OrganizationNotInAllFeaturesModeException +// This exception is thrown when AWS Organizations is not configured to support +// all features. All features must be enabled in AWS Organization to support +// creating an organization trail. For more information, see Prepare For Creating +// a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +// +// See also, 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) + return out, req.Send() +} + +// UpdateTrailWithContext is the same as UpdateTrail with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTrail for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudTrail) UpdateTrailWithContext(ctx aws.Context, input *UpdateTrailInput, opts ...request.Option) (*UpdateTrailOutput, error) { + req, out := c.UpdateTrailRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// 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-2:123456789012:trail/MyTrail +type ARNInvalidException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ARNInvalidException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ARNInvalidException) GoString() string { + return s.String() +} + +func newErrorARNInvalidException(v protocol.ResponseMetadata) error { + return &ARNInvalidException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ARNInvalidException) Code() string { + return "CloudTrailARNInvalidException" +} + +// Message returns the exception's message. +func (s ARNInvalidException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ARNInvalidException) OrigErr() error { + return nil +} + +func (s ARNInvalidException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ARNInvalidException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ARNInvalidException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when trusted access has not been enabled between +// AWS CloudTrail and AWS Organizations. For more information, see Enabling +// Trusted Access with Other AWS Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) +// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +type AccessNotEnabledException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AccessNotEnabledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessNotEnabledException) GoString() string { + return s.String() +} + +func newErrorAccessNotEnabledException(v protocol.ResponseMetadata) error { + return &AccessNotEnabledException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessNotEnabledException) Code() string { + return "CloudTrailAccessNotEnabledException" +} + +// Message returns the exception's message. +func (s AccessNotEnabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessNotEnabledException) OrigErr() error { + return nil +} + +func (s AccessNotEnabledException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessNotEnabledException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessNotEnabledException) RequestID() string { + return s.respMetadata.RequestID +} + +// Specifies the tags to add to a trail. +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-2: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. -type AddTagsOutput struct { - _ struct{} `type:"structure"` +// Returns the objects or data listed below if successful. Otherwise, returns +// an error. +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() +} + +// Cannot set a CloudWatch Logs delivery for this region. +type CloudWatchLogsDeliveryUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CloudWatchLogsDeliveryUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudWatchLogsDeliveryUnavailableException) GoString() string { + return s.String() +} + +func newErrorCloudWatchLogsDeliveryUnavailableException(v protocol.ResponseMetadata) error { + return &CloudWatchLogsDeliveryUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CloudWatchLogsDeliveryUnavailableException) Code() string { + return "CloudWatchLogsDeliveryUnavailableException" +} + +// Message returns the exception's message. +func (s CloudWatchLogsDeliveryUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CloudWatchLogsDeliveryUnavailableException) OrigErr() error { + return nil +} + +func (s CloudWatchLogsDeliveryUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CloudWatchLogsDeliveryUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CloudWatchLogsDeliveryUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + +// Specifies the settings for each trail. +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, which creates a trail only in the region where you + // are signed in. As a best practice, consider creating trails that log events + // in all regions. + IsMultiRegionTrail *bool `type:"boolean"` + + // Specifies whether the trail is created for all accounts in an organization + // in AWS Organizations, or only for the current AWS account. The default is + // false, and cannot be true unless the call is made on behalf of an AWS account + // that is the master account for an organization in AWS Organizations. + IsOrganizationTrail *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-2:123456789012:alias/MyAliasName + // + // * arn:aws:kms:us-east-2: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 (https://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 (https://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"` + + // A list of tags. + TagsList []*Tag `type:"list"` +} + +// 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 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 +} + +// 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 +} + +// SetIsOrganizationTrail sets the IsOrganizationTrail field's value. +func (s *CreateTrailInput) SetIsOrganizationTrail(v bool) *CreateTrailInput { + s.IsOrganizationTrail = &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 +} + +// SetTagsList sets the TagsList field's value. +func (s *CreateTrailInput) SetTagsList(v []*Tag) *CreateTrailInput { + s.TagsList = v + return s +} + +// Returns the objects or data listed below if successful. Otherwise, returns +// an error. +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 whether the trail is an organization trail. + IsOrganizationTrail *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-2: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 (https://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-2:123456789012:MyTopic + SnsTopicARN *string `type:"string"` + + // This field is no longer in use. Use SnsTopicARN. + // + // Deprecated: SnsTopicName has been deprecated + 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-2: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 +} + +// SetIsOrganizationTrail sets the IsOrganizationTrail field's value. +func (s *CreateTrailOutput) SetIsOrganizationTrail(v bool) *CreateTrailOutput { + s.IsOrganizationTrail = &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 buckets or AWS Lambda functions that you specify in your event +// selectors for your trail to log data events. Data events provide information +// about the resource operations performed on or within a resource itself. These +// are also known as data plane operations. You can specify up to 250 data resources +// for a trail. +// +// The total number of allowed data resources is 250. This number can be distributed +// between 1 and 5 event selectors, but the total cannot exceed 250 across all +// selectors. +// +// The following example demonstrates how logging works when you configure logging +// of all data events for an S3 bucket named bucket-1. In this example, the +// CloudTrail user specified an empty prefix, and the option to log both Read +// and Write data events. +// +// A user uploads an image file to bucket-1. +// +// The PutObject API operation is an Amazon S3 object-level API. It is recorded +// as a data event in CloudTrail. Because the CloudTrail user specified an S3 +// bucket with an empty prefix, events that occur on any object in that bucket +// are logged. The trail processes and logs the event. +// +// A user uploads an object to an Amazon S3 bucket named arn:aws:s3:::bucket-2. +// +// The PutObject API operation occurred for an object in an S3 bucket that the +// CloudTrail user didn't specify for the trail. The trail doesn’t log the +// event. +// +// The following example demonstrates how logging works when you configure logging +// of AWS Lambda data events for a Lambda function named MyLambdaFunction, but +// not for all AWS Lambda functions. +// +// A user runs a script that includes a call to the MyLambdaFunction function +// and the MyOtherLambdaFunction function. +// +// The Invoke API operation on MyLambdaFunction is an AWS Lambda API. It is +// recorded as a data event in CloudTrail. Because the CloudTrail user specified +// logging data events for MyLambdaFunction, any invocations of that function +// are logged. The trail processes and logs the event. +// +// The Invoke API operation on MyOtherLambdaFunction is an AWS Lambda API. Because +// the CloudTrail user did not specify logging data events for all Lambda functions, +// the Invoke operation for MyOtherLambdaFunction does not match the function +// specified for the trail. The trail doesn’t log the event. +type DataResource struct { + _ struct{} `type:"structure"` + + // The resource type in which you want to log data events. You can specify AWS::S3::Object + // or AWS::Lambda::Function resources. + Type *string `type:"string"` + + // An array of Amazon Resource Name (ARN) strings or partial ARN strings for + // the specified objects. + // + // * To log data events for all objects in all S3 buckets in your AWS account, + // specify the prefix as arn:aws:s3:::. This will also enable logging of + // data event activity performed by any user or role in your AWS account, + // even if that activity is performed on a bucket that belongs to another + // AWS account. + // + // * 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. + // + // * To log data events for all functions in your AWS account, specify the + // prefix as arn:aws:lambda. This will also enable logging of Invoke activity + // performed by any user or role in your AWS account, even if that activity + // is performed on a function that belongs to another AWS account. + // + // * To log data events for a specific Lambda function, specify the function + // ARN. Lambda function ARNs are exact. For example, if you specify a function + // ARN arn:aws:lambda:us-west-2:111111111111:function:helloworld, data events + // will only be logged for arn:aws:lambda:us-west-2:111111111111:function:helloworld. + // They will not be logged for arn:aws:lambda:us-west-2:111111111111:function:helloworld2. + 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. +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-2: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. +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. +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, or in the case of an organization trail, the replication of an organization + // trail in member accounts. If you do not include shadow trails, organization + // trails in a member account and region replication trails will not be returned. + // 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-2: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. +type DescribeTrailsOutput struct { + _ struct{} `type:"structure"` + + // The list of trail objects. Trail objects with string values are only returned + // if values for the objects exist in a trail's configuration. For example, + // SNSTopicName and SNSTopicARN are only returned in results if a trail is configured + // to send SNS notifications. Similarly, KMSKeyId only appears in results if + // a trail's log files are encrypted with AWS KMS-managed keys. + 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. +type Event struct { + _ struct{} `type:"structure"` + + // The AWS access key ID that was used to sign the request. If the request was + // made with temporary security credentials, this is the access key ID of the + // temporary credentials. + AccessKeyId *string `type:"string"` + + // 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"` + + // Information about whether the event is a write event or a read event. + ReadOnly *string `type:"string"` + + // 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() +} + +// SetAccessKeyId sets the AccessKeyId field's value. +func (s *Event) SetAccessKeyId(v string) *Event { + s.AccessKeyId = &v + return s +} + +// 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 +} + +// SetReadOnly sets the ReadOnly field's value. +func (s *Event) SetReadOnly(v string) *Event { + s.ReadOnly = &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 further specify the management and data event settings +// for your trail. By default, trails created without specific event selectors +// will be configured to log all read and write management events, and no 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. +type EventSelector struct { + _ struct{} `type:"structure"` + + // CloudTrail supports data event logging for Amazon S3 objects and AWS Lambda + // functions. You can specify up to 250 resources for an individual event selector, + // but the total number of data resources cannot exceed 250 across all event + // selectors in a trail. This limit does not apply if you configure resource + // logging for all data events. + // + // For more information, see Data Events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-and-data-events-with-cloudtrail.html#logging-data-events) + // and Limits in AWS CloudTrail (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) + // in the AWS CloudTrail User Guide. + DataResources []*DataResource `type:"list"` + + // An optional list of service event sources from which you do not want management + // events to be logged on your trail. In this release, the list can be empty + // (disables the filter), or it can filter out AWS Key Management Service events + // by containing "kms.amazonaws.com". By default, ExcludeManagementEventSources + // is empty, and AWS KMS events are included in events that are logged to your + // trail. + ExcludeManagementEventSources []*string `type:"list"` + + // Specify if you want your event selector to include management events for + // your trail. + // + // For more information, see Management Events (https://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 +} + +// SetExcludeManagementEventSources sets the ExcludeManagementEventSources field's value. +func (s *EventSelector) SetExcludeManagementEventSources(v []*string) *EventSelector { + s.ExcludeManagementEventSources = 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 +} + +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 not valid. + // + // * 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-2:123456789012:trail/MyTrail + // + // TrailName is a required field + TrailName *string `type:"string" required:"true"` +} + +// 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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetEventSelectorsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetEventSelectorsInput"} + if s.TrailName == nil { + invalidParams.Add(request.NewErrParamRequired("TrailName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTrailName sets the TrailName field's value. +func (s *GetEventSelectorsInput) SetTrailName(v string) *GetEventSelectorsInput { + s.TrailName = &v + return s +} + +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 +} + +type GetInsightSelectorsInput 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 not valid. + // + // * 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-2:123456789012:trail/MyTrail + // + // TrailName is a required field + TrailName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s GetInsightSelectorsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetInsightSelectorsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetInsightSelectorsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetInsightSelectorsInput"} + if s.TrailName == nil { + invalidParams.Add(request.NewErrParamRequired("TrailName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTrailName sets the TrailName field's value. +func (s *GetInsightSelectorsInput) SetTrailName(v string) *GetInsightSelectorsInput { + s.TrailName = &v + return s +} + +type GetInsightSelectorsOutput struct { + _ struct{} `type:"structure"` + + // A JSON string that contains the insight types you want to log on a trail. + // In this release, only ApiCallRateInsight is supported as an insight type. + InsightSelectors []*InsightSelector `type:"list"` + + // The Amazon Resource Name (ARN) of a trail for which you want to get Insights + // selectors. + TrailARN *string `type:"string"` +} + +// String returns the string representation +func (s GetInsightSelectorsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetInsightSelectorsOutput) GoString() string { + return s.String() +} + +// SetInsightSelectors sets the InsightSelectors field's value. +func (s *GetInsightSelectorsOutput) SetInsightSelectors(v []*InsightSelector) *GetInsightSelectorsOutput { + s.InsightSelectors = v + return s +} + +// SetTrailARN sets the TrailARN field's value. +func (s *GetInsightSelectorsOutput) SetTrailARN(v string) *GetInsightSelectorsOutput { + s.TrailARN = &v + return s +} + +type GetTrailInput struct { + _ struct{} `type:"structure"` + + // The name or the Amazon Resource Name (ARN) of the trail for which you want + // to retrieve settings information. + // + // Name is a required field + Name *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s GetTrailInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTrailInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetTrailInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetTrailInput"} + 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 *GetTrailInput) SetName(v string) *GetTrailInput { + s.Name = &v + return s +} + +type GetTrailOutput struct { + _ struct{} `type:"structure"` + + // The settings for a trail. + Trail *Trail `type:"structure"` +} + +// String returns the string representation +func (s GetTrailOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTrailOutput) GoString() string { + return s.String() +} + +// SetTrail sets the Trail field's value. +func (s *GetTrailOutput) SetTrail(v *Trail) *GetTrailOutput { + s.Trail = v + return s +} + +// The name of a trail about which you want the current status. +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-2: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. +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"` + + // This field is no longer in use. + LatestDeliveryAttemptSucceeded *string `type:"string"` + + // This field is no longer in use. + 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 (https://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"` + + // 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 (https://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"` + + // This field is no longer in use. + LatestNotificationAttemptSucceeded *string `type:"string"` + + // This field is no longer in use. + 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 (https://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"` + + // Specifies the most recent date and time when CloudTrail started recording + // API calls for an AWS account. + StartLoggingTime *time.Time `type:"timestamp"` + + // Specifies the most recent date and time when CloudTrail stopped recording + // API calls for an AWS account. + StopLoggingTime *time.Time `type:"timestamp"` + + // This field is no longer in use. + TimeLoggingStarted *string `type:"string"` + + // This field is no longer in use. + 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 +} + +// If you run GetInsightSelectors on a trail that does not have Insights events +// enabled, the operation throws the exception InsightNotEnabledException. +type InsightNotEnabledException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InsightNotEnabledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InsightNotEnabledException) GoString() string { + return s.String() +} + +func newErrorInsightNotEnabledException(v protocol.ResponseMetadata) error { + return &InsightNotEnabledException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InsightNotEnabledException) Code() string { + return "InsightNotEnabledException" +} + +// Message returns the exception's message. +func (s InsightNotEnabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InsightNotEnabledException) OrigErr() error { + return nil +} + +func (s InsightNotEnabledException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InsightNotEnabledException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InsightNotEnabledException) RequestID() string { + return s.respMetadata.RequestID +} + +// A JSON string that contains a list of insight types that are logged on a +// trail. +type InsightSelector struct { + _ struct{} `type:"structure"` + + // The type of insights to log on a trail. In this release, only ApiCallRateInsight + // is supported as an insight type. + InsightType *string `type:"string" enum:"InsightType"` +} + +// String returns the string representation +func (s InsightSelector) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InsightSelector) GoString() string { + return s.String() +} + +// SetInsightType sets the InsightType field's value. +func (s *InsightSelector) SetInsightType(v string) *InsightSelector { + s.InsightType = &v + return s +} + +// This exception is thrown when the IAM user or role that is used to create +// the organization trail is lacking one or more required permissions for creating +// an organization trail in a required service. For more information, see Prepare +// For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +type InsufficientDependencyServiceAccessPermissionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InsufficientDependencyServiceAccessPermissionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InsufficientDependencyServiceAccessPermissionException) GoString() string { + return s.String() +} + +func newErrorInsufficientDependencyServiceAccessPermissionException(v protocol.ResponseMetadata) error { + return &InsufficientDependencyServiceAccessPermissionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InsufficientDependencyServiceAccessPermissionException) Code() string { + return "InsufficientDependencyServiceAccessPermissionException" +} + +// Message returns the exception's message. +func (s InsufficientDependencyServiceAccessPermissionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InsufficientDependencyServiceAccessPermissionException) OrigErr() error { + return nil +} + +func (s InsufficientDependencyServiceAccessPermissionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InsufficientDependencyServiceAccessPermissionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InsufficientDependencyServiceAccessPermissionException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the policy on the S3 bucket or KMS key is not +// sufficient. +type InsufficientEncryptionPolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InsufficientEncryptionPolicyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InsufficientEncryptionPolicyException) GoString() string { + return s.String() +} + +func newErrorInsufficientEncryptionPolicyException(v protocol.ResponseMetadata) error { + return &InsufficientEncryptionPolicyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InsufficientEncryptionPolicyException) Code() string { + return "InsufficientEncryptionPolicyException" +} + +// Message returns the exception's message. +func (s InsufficientEncryptionPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InsufficientEncryptionPolicyException) OrigErr() error { + return nil +} + +func (s InsufficientEncryptionPolicyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InsufficientEncryptionPolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InsufficientEncryptionPolicyException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the policy on the S3 bucket is not sufficient. +type InsufficientS3BucketPolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s AddTagsOutput) String() string { +func (s InsufficientS3BucketPolicyException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AddTagsOutput) GoString() string { +func (s InsufficientS3BucketPolicyException) GoString() string { return s.String() } -// Specifies the settings for each trail. -type CreateTrailInput struct { - _ struct{} `type:"structure"` +func newErrorInsufficientS3BucketPolicyException(v protocol.ResponseMetadata) error { + return &InsufficientS3BucketPolicyException{ + respMetadata: v, + } +} - // 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"` +// Code returns the exception type name. +func (s InsufficientS3BucketPolicyException) Code() string { + return "InsufficientS3BucketPolicyException" +} - // Specifies the role for the CloudWatch Logs endpoint to assume to write to - // a user's log group. - CloudWatchLogsRoleArn *string `type:"string"` +// Message returns the exception's message. +func (s InsufficientS3BucketPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // 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"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InsufficientS3BucketPolicyException) OrigErr() error { + return nil +} - // Specifies whether the trail is publishing events from global services such - // as IAM to the log files. - IncludeGlobalServiceEvents *bool `type:"boolean"` +func (s InsufficientS3BucketPolicyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // Specifies whether the trail is created in the current region or in all regions. - // The default is false. - IsMultiRegionTrail *bool `type:"boolean"` +// Status code returns the HTTP status code for the request's response error. +func (s InsufficientS3BucketPolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} - // Specifies whether the trail is created for all accounts in an organization - // in AWS Organizations, or only for the current AWS account. The default is - // false, and cannot be true unless the call is made on behalf of an AWS account - // that is the master account for an organization in AWS Organizations. - IsOrganizationTrail *bool `type:"boolean"` +// RequestID returns the service's response RequestID for request. +func (s InsufficientS3BucketPolicyException) RequestID() string { + return s.respMetadata.RequestID +} - // 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-2:123456789012:alias/MyAliasName - // - // * arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * 12345678-1234-1234-1234-123456789012 - KmsKeyId *string `type:"string"` +// This exception is thrown when the policy on the SNS topic is not sufficient. +type InsufficientSnsTopicPolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` +} - // 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"` +// String returns the string representation +func (s InsufficientSnsTopicPolicyException) String() string { + return awsutil.Prettify(s) +} - // 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"` +// GoString returns the string representation +func (s InsufficientSnsTopicPolicyException) GoString() string { + return s.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"` +func newErrorInsufficientSnsTopicPolicyException(v protocol.ResponseMetadata) error { + return &InsufficientSnsTopicPolicyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InsufficientSnsTopicPolicyException) Code() string { + return "InsufficientSnsTopicPolicyException" +} + +// Message returns the exception's message. +func (s InsufficientSnsTopicPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InsufficientSnsTopicPolicyException) OrigErr() error { + return nil +} + +func (s InsufficientSnsTopicPolicyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InsufficientSnsTopicPolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InsufficientSnsTopicPolicyException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the provided CloudWatch log group is not valid. +type InvalidCloudWatchLogsLogGroupArnException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s CreateTrailInput) String() string { +func (s InvalidCloudWatchLogsLogGroupArnException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTrailInput) GoString() string { +func (s InvalidCloudWatchLogsLogGroupArnException) 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")) +func newErrorInvalidCloudWatchLogsLogGroupArnException(v protocol.ResponseMetadata) error { + return &InvalidCloudWatchLogsLogGroupArnException{ + respMetadata: v, } - if s.S3BucketName == nil { - invalidParams.Add(request.NewErrParamRequired("S3BucketName")) +} + +// Code returns the exception type name. +func (s InvalidCloudWatchLogsLogGroupArnException) Code() string { + return "InvalidCloudWatchLogsLogGroupArnException" +} + +// Message returns the exception's message. +func (s InvalidCloudWatchLogsLogGroupArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} - if invalidParams.Len() > 0 { - return invalidParams +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidCloudWatchLogsLogGroupArnException) OrigErr() error { + return nil +} + +func (s InvalidCloudWatchLogsLogGroupArnException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidCloudWatchLogsLogGroupArnException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidCloudWatchLogsLogGroupArnException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the provided role is not valid. +type InvalidCloudWatchLogsRoleArnException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidCloudWatchLogsRoleArnException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidCloudWatchLogsRoleArnException) GoString() string { + return s.String() +} + +func newErrorInvalidCloudWatchLogsRoleArnException(v protocol.ResponseMetadata) error { + return &InvalidCloudWatchLogsRoleArnException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidCloudWatchLogsRoleArnException) Code() string { + return "InvalidCloudWatchLogsRoleArnException" +} + +// Message returns the exception's message. +func (s InvalidCloudWatchLogsRoleArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidCloudWatchLogsRoleArnException) OrigErr() error { return nil } -// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. -func (s *CreateTrailInput) SetCloudWatchLogsLogGroupArn(v string) *CreateTrailInput { - s.CloudWatchLogsLogGroupArn = &v - return s +func (s InvalidCloudWatchLogsRoleArnException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. -func (s *CreateTrailInput) SetCloudWatchLogsRoleArn(v string) *CreateTrailInput { - s.CloudWatchLogsRoleArn = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidCloudWatchLogsRoleArnException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetEnableLogFileValidation sets the EnableLogFileValidation field's value. -func (s *CreateTrailInput) SetEnableLogFileValidation(v bool) *CreateTrailInput { - s.EnableLogFileValidation = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidCloudWatchLogsRoleArnException) RequestID() string { + return s.respMetadata.RequestID } -// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. -func (s *CreateTrailInput) SetIncludeGlobalServiceEvents(v bool) *CreateTrailInput { - s.IncludeGlobalServiceEvents = &v - return s +// Occurs if an event category that is not valid is specified as a value of +// EventCategory. +type InvalidEventCategoryException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. -func (s *CreateTrailInput) SetIsMultiRegionTrail(v bool) *CreateTrailInput { - s.IsMultiRegionTrail = &v - return s +// String returns the string representation +func (s InvalidEventCategoryException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidEventCategoryException) GoString() string { + return s.String() +} + +func newErrorInvalidEventCategoryException(v protocol.ResponseMetadata) error { + return &InvalidEventCategoryException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidEventCategoryException) Code() string { + return "InvalidEventCategoryException" +} + +// Message returns the exception's message. +func (s InvalidEventCategoryException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidEventCategoryException) OrigErr() error { + return nil +} + +func (s InvalidEventCategoryException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidEventCategoryException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidEventCategoryException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the PutEventSelectors operation is called with +// a number of event selectors or data resources that is not valid. The combination +// of event selectors and data resources is not valid. A trail can have up to +// 5 event selectors. A trail is limited to 250 data resources. These data resources +// can be distributed across event selectors, but the overall total cannot exceed +// 250. +// +// You can: +// +// * 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. +// The limit of number of resources on an individual event selector is configurable +// up to 250. However, this upper limit is allowed only if the total number +// of data resources does not exceed 250 across all event selectors for a +// trail. +// +// * Specify a valid value for a parameter. For example, specifying the ReadWriteType +// parameter with a value of read-only is invalid. +type InvalidEventSelectorsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidEventSelectorsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidEventSelectorsException) GoString() string { + return s.String() +} + +func newErrorInvalidEventSelectorsException(v protocol.ResponseMetadata) error { + return &InvalidEventSelectorsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidEventSelectorsException) Code() string { + return "InvalidEventSelectorsException" +} + +// Message returns the exception's message. +func (s InvalidEventSelectorsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidEventSelectorsException) OrigErr() error { + return nil +} + +func (s InvalidEventSelectorsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidEventSelectorsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidEventSelectorsException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type InvalidHomeRegionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidHomeRegionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidHomeRegionException) GoString() string { + return s.String() +} + +func newErrorInvalidHomeRegionException(v protocol.ResponseMetadata) error { + return &InvalidHomeRegionException{ + respMetadata: v, + } } -// SetIsOrganizationTrail sets the IsOrganizationTrail field's value. -func (s *CreateTrailInput) SetIsOrganizationTrail(v bool) *CreateTrailInput { - s.IsOrganizationTrail = &v - return s +// Code returns the exception type name. +func (s InvalidHomeRegionException) Code() string { + return "InvalidHomeRegionException" } -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateTrailInput) SetKmsKeyId(v string) *CreateTrailInput { - s.KmsKeyId = &v - return s +// Message returns the exception's message. +func (s InvalidHomeRegionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetName sets the Name field's value. -func (s *CreateTrailInput) SetName(v string) *CreateTrailInput { - s.Name = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidHomeRegionException) OrigErr() error { + return nil } -// SetS3BucketName sets the S3BucketName field's value. -func (s *CreateTrailInput) SetS3BucketName(v string) *CreateTrailInput { - s.S3BucketName = &v - return s +func (s InvalidHomeRegionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *CreateTrailInput) SetS3KeyPrefix(v string) *CreateTrailInput { - s.S3KeyPrefix = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidHomeRegionException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetSnsTopicName sets the SnsTopicName field's value. -func (s *CreateTrailInput) SetSnsTopicName(v string) *CreateTrailInput { - s.SnsTopicName = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidHomeRegionException) RequestID() string { + return s.respMetadata.RequestID } -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -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"` +// The formatting or syntax of the InsightSelectors JSON statement in your PutInsightSelectors +// or GetInsightSelectors request is not valid, or the specified insight type +// in the InsightSelectors statement is not a valid insight type. +type InvalidInsightSelectorsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Specifies the role for the CloudWatch Logs endpoint to assume to write to - // a user's log group. - CloudWatchLogsRoleArn *string `type:"string"` + Message_ *string `locationName:"message" type:"string"` +} - // Specifies whether the trail is publishing events from global services such - // as IAM to the log files. - IncludeGlobalServiceEvents *bool `type:"boolean"` +// String returns the string representation +func (s InvalidInsightSelectorsException) String() string { + return awsutil.Prettify(s) +} - // Specifies whether the trail exists in one region or in all regions. - IsMultiRegionTrail *bool `type:"boolean"` +// GoString returns the string representation +func (s InvalidInsightSelectorsException) GoString() string { + return s.String() +} - // Specifies whether the trail is an organization trail. - IsOrganizationTrail *bool `type:"boolean"` +func newErrorInvalidInsightSelectorsException(v protocol.ResponseMetadata) error { + return &InvalidInsightSelectorsException{ + respMetadata: v, + } +} - // 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-2:123456789012:key/12345678-1234-1234-1234-123456789012 - KmsKeyId *string `type:"string"` +// Code returns the exception type name. +func (s InvalidInsightSelectorsException) Code() string { + return "InvalidInsightSelectorsException" +} - // Specifies whether log file integrity validation is enabled. - LogFileValidationEnabled *bool `type:"boolean"` +// Message returns the exception's message. +func (s InvalidInsightSelectorsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Specifies the name of the trail. - Name *string `type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInsightSelectorsException) OrigErr() error { + return nil +} - // Specifies the name of the Amazon S3 bucket designated for publishing log - // files. - S3BucketName *string `type:"string"` +func (s InvalidInsightSelectorsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // 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"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInsightSelectorsException) StatusCode() int { + return s.respMetadata.StatusCode +} - // 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-2:123456789012:MyTopic - SnsTopicARN *string `type:"string"` +// RequestID returns the service's response RequestID for request. +func (s InvalidInsightSelectorsException) RequestID() string { + return s.respMetadata.RequestID +} - // This field is deprecated. Use SnsTopicARN. - // - // Deprecated: SnsTopicName has been deprecated - SnsTopicName *string `deprecated:"true" type:"string"` +// This exception is thrown when the KMS key ARN is invalid. +type InvalidKmsKeyIdException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Specifies the ARN of the trail that was created. The format of a trail ARN - // is: - // - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - TrailARN *string `type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s CreateTrailOutput) String() string { +func (s InvalidKmsKeyIdException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTrailOutput) GoString() string { +func (s InvalidKmsKeyIdException) GoString() string { return s.String() } -// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. -func (s *CreateTrailOutput) SetCloudWatchLogsLogGroupArn(v string) *CreateTrailOutput { - s.CloudWatchLogsLogGroupArn = &v - return s +func newErrorInvalidKmsKeyIdException(v protocol.ResponseMetadata) error { + return &InvalidKmsKeyIdException{ + respMetadata: v, + } } -// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. -func (s *CreateTrailOutput) SetCloudWatchLogsRoleArn(v string) *CreateTrailOutput { - s.CloudWatchLogsRoleArn = &v - return s +// Code returns the exception type name. +func (s InvalidKmsKeyIdException) Code() string { + return "InvalidKmsKeyIdException" } -// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. -func (s *CreateTrailOutput) SetIncludeGlobalServiceEvents(v bool) *CreateTrailOutput { - s.IncludeGlobalServiceEvents = &v - return s +// Message returns the exception's message. +func (s InvalidKmsKeyIdException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. -func (s *CreateTrailOutput) SetIsMultiRegionTrail(v bool) *CreateTrailOutput { - s.IsMultiRegionTrail = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidKmsKeyIdException) OrigErr() error { + return nil } -// SetIsOrganizationTrail sets the IsOrganizationTrail field's value. -func (s *CreateTrailOutput) SetIsOrganizationTrail(v bool) *CreateTrailOutput { - s.IsOrganizationTrail = &v - return s +func (s InvalidKmsKeyIdException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateTrailOutput) SetKmsKeyId(v string) *CreateTrailOutput { - s.KmsKeyId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidKmsKeyIdException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetLogFileValidationEnabled sets the LogFileValidationEnabled field's value. -func (s *CreateTrailOutput) SetLogFileValidationEnabled(v bool) *CreateTrailOutput { - s.LogFileValidationEnabled = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidKmsKeyIdException) RequestID() string { + return s.respMetadata.RequestID } -// SetName sets the Name field's value. -func (s *CreateTrailOutput) SetName(v string) *CreateTrailOutput { - s.Name = &v - return s +// Occurs when an invalid lookup attribute is specified. +type InvalidLookupAttributesException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetS3BucketName sets the S3BucketName field's value. -func (s *CreateTrailOutput) SetS3BucketName(v string) *CreateTrailOutput { - s.S3BucketName = &v - return s +// String returns the string representation +func (s InvalidLookupAttributesException) String() string { + return awsutil.Prettify(s) } -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *CreateTrailOutput) SetS3KeyPrefix(v string) *CreateTrailOutput { - s.S3KeyPrefix = &v - return s +// GoString returns the string representation +func (s InvalidLookupAttributesException) GoString() string { + return s.String() } -// SetSnsTopicARN sets the SnsTopicARN field's value. -func (s *CreateTrailOutput) SetSnsTopicARN(v string) *CreateTrailOutput { - s.SnsTopicARN = &v - return s +func newErrorInvalidLookupAttributesException(v protocol.ResponseMetadata) error { + return &InvalidLookupAttributesException{ + respMetadata: v, + } } -// SetSnsTopicName sets the SnsTopicName field's value. -func (s *CreateTrailOutput) SetSnsTopicName(v string) *CreateTrailOutput { - s.SnsTopicName = &v - return s +// Code returns the exception type name. +func (s InvalidLookupAttributesException) Code() string { + return "InvalidLookupAttributesException" } -// SetTrailARN sets the TrailARN field's value. -func (s *CreateTrailOutput) SetTrailARN(v string) *CreateTrailOutput { - s.TrailARN = &v - return s +// Message returns the exception's message. +func (s InvalidLookupAttributesException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// The Amazon S3 buckets or AWS Lambda functions that you specify in your event -// selectors for your trail to log data events. Data events provide insight -// into the resource operations performed on or within a resource itself. These -// are also known as data plane operations. You can specify up to 250 data resources -// for a trail. -// -// The total number of allowed data resources is 250. This number can be distributed -// between 1 and 5 event selectors, but the total cannot exceed 250 across all -// selectors. -// -// The following example demonstrates how logging works when you configure logging -// of all data events for an S3 bucket named bucket-1. In this example, the -// CloudTrail user spcified an empty prefix, and the option to log both Read -// and Write data events. -// -// A user uploads an image file to bucket-1. -// -// The PutObject API operation is an Amazon S3 object-level API. It is recorded -// as a data event in CloudTrail. Because the CloudTrail user specified an S3 -// bucket with an empty prefix, events that occur on any object in that bucket -// are logged. The trail processes and logs the event. -// -// A user uploads an object to an Amazon S3 bucket named arn:aws:s3:::bucket-2. -// -// The PutObject API operation occurred for an object in an S3 bucket that the -// CloudTrail user didn't specify for the trail. The trail doesn’t log the -// event. -// -// The following example demonstrates how logging works when you configure logging -// of AWS Lambda data events for a Lambda function named MyLambdaFunction, but -// not for all AWS Lambda functions. -// -// A user runs a script that includes a call to the MyLambdaFunction function -// and the MyOtherLambdaFunction function. -// -// The Invoke API operation on MyLambdaFunction is an AWS Lambda API. It is -// recorded as a data event in CloudTrail. Because the CloudTrail user specified -// logging data events for MyLambdaFunction, any invocations of that function -// are logged. The trail processes and logs the event. -// -// The Invoke API operation on MyOtherLambdaFunction is an AWS Lambda API. Because -// the CloudTrail user did not specify logging data events for all Lambda functions, -// the Invoke operation for MyOtherLambdaFunction does not match the function -// specified for the trail. The trail doesn’t log the event. -type DataResource struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidLookupAttributesException) OrigErr() error { + return nil +} - // The resource type in which you want to log data events. You can specify AWS::S3::Object - // or AWS::Lambda::Function resources. - Type *string `type:"string"` +func (s InvalidLookupAttributesException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // An array of Amazon Resource Name (ARN) strings or partial ARN strings for - // the specified objects. - // - // * To log data events for all objects in all S3 buckets in your AWS account, - // specify the prefix as arn:aws:s3:::. This will also enable logging of - // data event activity performed by any user or role in your AWS account, - // even if that activity is performed on a bucket that belongs to another - // AWS account. - // - // * To log data events for all objects in all S3 buckets that include my-bucket - // in their names, specify the prefix as aws:s3:::my-bucket. The trail logs - // data events for all objects in all buckets whose name contains a match - // for my-bucket. - // - // * 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. - // - // * To log data events for all functions in your AWS account, specify the - // prefix as arn:aws:lambda. This will also enable logging of Invoke activity - // performed by any user or role in your AWS account, even if that activity - // is performed on a function that belongs to another AWS account. - // - // * To log data eents for a specific Lambda function, specify the function - // ARN. Lambda function ARNs are exact. Unlike S3, you cannot use matching. - // For example, if you specify a function ARN arn:aws:lambda:us-west-2:111111111111:function:helloworld, - // data events will only be logged for arn:aws:lambda:us-west-2:111111111111:function:helloworld. - // They will not be logged for arn:aws:lambda:us-west-2:111111111111:function:helloworld2. - Values []*string `type:"list"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidLookupAttributesException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidLookupAttributesException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown if the limit specified is invalid. +type InvalidMaxResultsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DataResource) String() string { +func (s InvalidMaxResultsException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DataResource) GoString() string { +func (s InvalidMaxResultsException) GoString() string { return s.String() } -// SetType sets the Type field's value. -func (s *DataResource) SetType(v string) *DataResource { - s.Type = &v - return s +func newErrorInvalidMaxResultsException(v protocol.ResponseMetadata) error { + return &InvalidMaxResultsException{ + respMetadata: v, + } } -// SetValues sets the Values field's value. -func (s *DataResource) SetValues(v []*string) *DataResource { - s.Values = v - return s +// Code returns the exception type name. +func (s InvalidMaxResultsException) Code() string { + return "InvalidMaxResultsException" } -// The request that specifies the name of a trail to delete. -type DeleteTrailInput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidMaxResultsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidMaxResultsException) OrigErr() error { + return nil +} + +func (s InvalidMaxResultsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidMaxResultsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidMaxResultsException) RequestID() string { + return s.respMetadata.RequestID +} - // 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-2:123456789012:trail/MyTrail - // - // Name is a required field - Name *string `type:"string" required:"true"` +// Invalid token or token that was previously used in a request with different +// parameters. This exception is thrown if the token is invalid. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DeleteTrailInput) String() string { +func (s InvalidNextTokenException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTrailInput) GoString() string { +func (s InvalidNextTokenException) 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")) +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { return nil } -// SetName sets the Name field's value. -func (s *DeleteTrailInput) SetName(v string) *DeleteTrailInput { - s.Name = &v - return s +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -type DeleteTrailOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the combination of parameters provided is not +// valid. +type InvalidParameterCombinationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DeleteTrailOutput) String() string { +func (s InvalidParameterCombinationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTrailOutput) GoString() string { +func (s InvalidParameterCombinationException) GoString() string { return s.String() } -// Returns information about the trail. -type DescribeTrailsInput struct { - _ struct{} `type:"structure"` +func newErrorInvalidParameterCombinationException(v protocol.ResponseMetadata) error { + return &InvalidParameterCombinationException{ + respMetadata: v, + } +} - // 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, or in the case of an organization trail, the replication of an organization - // trail in member accounts. If you do not include shadow trails, organization - // trails in a member account and region replication trails will not be returned. - // The default is true. - IncludeShadowTrails *bool `locationName:"includeShadowTrails" type:"boolean"` +// Code returns the exception type name. +func (s InvalidParameterCombinationException) Code() string { + return "InvalidParameterCombinationException" +} - // 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-2: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"` +// Message returns the exception's message. +func (s InvalidParameterCombinationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s DescribeTrailsInput) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterCombinationException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s DescribeTrailsInput) GoString() string { - return s.String() +func (s InvalidParameterCombinationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetIncludeShadowTrails sets the IncludeShadowTrails field's value. -func (s *DescribeTrailsInput) SetIncludeShadowTrails(v bool) *DescribeTrailsInput { - s.IncludeShadowTrails = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterCombinationException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetTrailNameList sets the TrailNameList field's value. -func (s *DescribeTrailsInput) SetTrailNameList(v []*string) *DescribeTrailsInput { - s.TrailNameList = v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterCombinationException) RequestID() string { + return s.respMetadata.RequestID } -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -type DescribeTrailsOutput struct { - _ struct{} `type:"structure"` +// This exception is thrown when the provided S3 bucket name is not valid. +type InvalidS3BucketNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The list of trail objects. - TrailList []*Trail `locationName:"trailList" type:"list"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DescribeTrailsOutput) String() string { +func (s InvalidS3BucketNameException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeTrailsOutput) GoString() string { +func (s InvalidS3BucketNameException) GoString() string { return s.String() } -// SetTrailList sets the TrailList field's value. -func (s *DescribeTrailsOutput) SetTrailList(v []*Trail) *DescribeTrailsOutput { - s.TrailList = v - return s +func newErrorInvalidS3BucketNameException(v protocol.ResponseMetadata) error { + return &InvalidS3BucketNameException{ + respMetadata: v, + } } -// Contains information about an event that was returned by a lookup request. -// The result includes a representation of a CloudTrail event. -type Event struct { - _ struct{} `type:"structure"` - - // The AWS access key ID that was used to sign the request. If the request was - // made with temporary security credentials, this is the access key ID of the - // temporary credentials. - AccessKeyId *string `type:"string"` - - // A JSON string that contains a representation of the event returned. - CloudTrailEvent *string `type:"string"` +// Code returns the exception type name. +func (s InvalidS3BucketNameException) Code() string { + return "InvalidS3BucketNameException" +} - // The CloudTrail ID of the event returned. - EventId *string `type:"string"` +// Message returns the exception's message. +func (s InvalidS3BucketNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The name of the event returned. - EventName *string `type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidS3BucketNameException) OrigErr() error { + return nil +} - // The AWS service that the request was made to. - EventSource *string `type:"string"` +func (s InvalidS3BucketNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The date and time of the event returned. - EventTime *time.Time `type:"timestamp"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidS3BucketNameException) StatusCode() int { + return s.respMetadata.StatusCode +} - // Information about whether the event is a write event or a read event. - ReadOnly *string `type:"string"` +// RequestID returns the service's response RequestID for request. +func (s InvalidS3BucketNameException) RequestID() string { + return s.respMetadata.RequestID +} - // A list of resources referenced by the event returned. - Resources []*Resource `type:"list"` +// This exception is thrown when the provided S3 prefix is not valid. +type InvalidS3PrefixException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // A user name or role name of the requester that called the API in the event - // returned. - Username *string `type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s Event) String() string { +func (s InvalidS3PrefixException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Event) GoString() string { +func (s InvalidS3PrefixException) GoString() string { return s.String() } -// SetAccessKeyId sets the AccessKeyId field's value. -func (s *Event) SetAccessKeyId(v string) *Event { - s.AccessKeyId = &v - return s -} - -// 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 +func newErrorInvalidS3PrefixException(v protocol.ResponseMetadata) error { + return &InvalidS3PrefixException{ + respMetadata: v, + } } -// SetEventName sets the EventName field's value. -func (s *Event) SetEventName(v string) *Event { - s.EventName = &v - return s +// Code returns the exception type name. +func (s InvalidS3PrefixException) Code() string { + return "InvalidS3PrefixException" } -// SetEventSource sets the EventSource field's value. -func (s *Event) SetEventSource(v string) *Event { - s.EventSource = &v - return s +// Message returns the exception's message. +func (s InvalidS3PrefixException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetEventTime sets the EventTime field's value. -func (s *Event) SetEventTime(v time.Time) *Event { - s.EventTime = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidS3PrefixException) OrigErr() error { + return nil } -// SetReadOnly sets the ReadOnly field's value. -func (s *Event) SetReadOnly(v string) *Event { - s.ReadOnly = &v - return s +func (s InvalidS3PrefixException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetResources sets the Resources field's value. -func (s *Event) SetResources(v []*Resource) *Event { - s.Resources = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidS3PrefixException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetUsername sets the Username field's value. -func (s *Event) SetUsername(v string) *Event { - s.Username = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidS3PrefixException) RequestID() string { + return s.respMetadata.RequestID } -// Use event selectors to further specify the management and data event settings -// for your trail. By default, trails created without specific event selectors -// will be configured to log all read and write management events, and no 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. -type EventSelector struct { - _ struct{} `type:"structure"` - - // CloudTrail supports data event logging for Amazon S3 objects and AWS Lambda - // functions. You can specify up to 250 resources for an individual event selector, - // but the total number of data resources cannot exceed 250 across all event - // selectors in a trail. This limit does not apply if you configure resource - // logging for all data events. - // - // 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) - // and Limits in AWS CloudTrail (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) - // 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"` +// This exception is thrown when the provided SNS topic name is not valid. +type InvalidSnsTopicNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s EventSelector) String() string { +func (s InvalidSnsTopicNameException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EventSelector) GoString() string { +func (s InvalidSnsTopicNameException) GoString() string { return s.String() } -// SetDataResources sets the DataResources field's value. -func (s *EventSelector) SetDataResources(v []*DataResource) *EventSelector { - s.DataResources = v - return s +func newErrorInvalidSnsTopicNameException(v protocol.ResponseMetadata) error { + return &InvalidSnsTopicNameException{ + respMetadata: v, + } } -// SetIncludeManagementEvents sets the IncludeManagementEvents field's value. -func (s *EventSelector) SetIncludeManagementEvents(v bool) *EventSelector { - s.IncludeManagementEvents = &v - return s +// Code returns the exception type name. +func (s InvalidSnsTopicNameException) Code() string { + return "InvalidSnsTopicNameException" } -// SetReadWriteType sets the ReadWriteType field's value. -func (s *EventSelector) SetReadWriteType(v string) *EventSelector { - s.ReadWriteType = &v - return s +// Message returns the exception's message. +func (s InvalidSnsTopicNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type GetEventSelectorsInput struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidSnsTopicNameException) OrigErr() error { + return nil +} - // 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 not valid. - // - // * 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-2:123456789012:trail/MyTrail - // - // TrailName is a required field - TrailName *string `type:"string" required:"true"` +func (s InvalidSnsTopicNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidSnsTopicNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidSnsTopicNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the specified tag key or values are not valid. +// It can also occur if there are duplicate tags or too many tags on the resource. +type InvalidTagParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetEventSelectorsInput) String() string { +func (s InvalidTagParameterException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetEventSelectorsInput) GoString() string { +func (s InvalidTagParameterException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEventSelectorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEventSelectorsInput"} - if s.TrailName == nil { - invalidParams.Add(request.NewErrParamRequired("TrailName")) +func newErrorInvalidTagParameterException(v protocol.ResponseMetadata) error { + return &InvalidTagParameterException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidTagParameterException) Code() string { + return "InvalidTagParameterException" +} + +// Message returns the exception's message. +func (s InvalidTagParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTagParameterException) OrigErr() error { return nil } -// SetTrailName sets the TrailName field's value. -func (s *GetEventSelectorsInput) SetTrailName(v string) *GetEventSelectorsInput { - s.TrailName = &v - return s +func (s InvalidTagParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -type GetEventSelectorsOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTagParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The event selectors that are configured for the trail. - EventSelectors []*EventSelector `type:"list"` +// RequestID returns the service's response RequestID for request. +func (s InvalidTagParameterException) RequestID() string { + return s.respMetadata.RequestID +} - // The specified trail ARN that has the event selectors. - TrailARN *string `type:"string"` +// 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. +type InvalidTimeRangeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetEventSelectorsOutput) String() string { +func (s InvalidTimeRangeException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetEventSelectorsOutput) GoString() string { +func (s InvalidTimeRangeException) GoString() string { return s.String() } -// SetEventSelectors sets the EventSelectors field's value. -func (s *GetEventSelectorsOutput) SetEventSelectors(v []*EventSelector) *GetEventSelectorsOutput { - s.EventSelectors = v - return s +func newErrorInvalidTimeRangeException(v protocol.ResponseMetadata) error { + return &InvalidTimeRangeException{ + respMetadata: v, + } } -// SetTrailARN sets the TrailARN field's value. -func (s *GetEventSelectorsOutput) SetTrailARN(v string) *GetEventSelectorsOutput { - s.TrailARN = &v - return s +// Code returns the exception type name. +func (s InvalidTimeRangeException) Code() string { + return "InvalidTimeRangeException" } -// The name of a trail about which you want the current status. -type GetTrailStatusInput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidTimeRangeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // 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-2:123456789012:trail/MyTrail - // - // Name is a required field - Name *string `type:"string" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTimeRangeException) OrigErr() error { + return nil +} + +func (s InvalidTimeRangeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTimeRangeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidTimeRangeException) RequestID() string { + return s.respMetadata.RequestID +} + +// Reserved for future use. +type InvalidTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetTrailStatusInput) String() string { +func (s InvalidTokenException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetTrailStatusInput) GoString() string { +func (s InvalidTokenException) 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")) +func newErrorInvalidTokenException(v protocol.ResponseMetadata) error { + return &InvalidTokenException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidTokenException) Code() string { + return "InvalidTokenException" +} + +// Message returns the exception's message. +func (s InvalidTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTokenException) OrigErr() error { return nil } -// SetName sets the Name field's value. -func (s *GetTrailStatusInput) SetName(v string) *GetTrailStatusInput { - s.Name = &v - return s +func (s InvalidTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -type GetTrailStatusOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} - // Whether the CloudTrail is currently logging AWS API calls. - IsLogging *bool `type:"boolean"` +// RequestID returns the service's response RequestID for request. +func (s InvalidTokenException) RequestID() string { + return s.respMetadata.RequestID +} - // Displays any CloudWatch Logs error that CloudTrail encountered when attempting - // to deliver logs to CloudWatch Logs. - LatestCloudWatchLogsDeliveryError *string `type:"string"` +// 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) +type InvalidTrailNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Displays the most recent date and time when CloudTrail delivered logs to - // CloudWatch Logs. - LatestCloudWatchLogsDeliveryTime *time.Time `type:"timestamp"` + Message_ *string `locationName:"message" type:"string"` +} - // This field is deprecated. - LatestDeliveryAttemptSucceeded *string `type:"string"` +// String returns the string representation +func (s InvalidTrailNameException) String() string { + return awsutil.Prettify(s) +} - // This field is deprecated. - LatestDeliveryAttemptTime *string `type:"string"` +// GoString returns the string representation +func (s InvalidTrailNameException) GoString() string { + return s.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"` +func newErrorInvalidTrailNameException(v protocol.ResponseMetadata) error { + return &InvalidTrailNameException{ + respMetadata: v, + } +} - // Specifies the date and time that CloudTrail last delivered log files to an - // account's Amazon S3 bucket. - LatestDeliveryTime *time.Time `type:"timestamp"` +// Code returns the exception type name. +func (s InvalidTrailNameException) Code() string { + return "InvalidTrailNameException" +} - // 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"` +// Message returns the exception's message. +func (s InvalidTrailNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Specifies the date and time that CloudTrail last delivered a digest file - // to an account's Amazon S3 bucket. - LatestDigestDeliveryTime *time.Time `type:"timestamp"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTrailNameException) OrigErr() error { + return nil +} - // This field is deprecated. - LatestNotificationAttemptSucceeded *string `type:"string"` +func (s InvalidTrailNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // This field is deprecated. - LatestNotificationAttemptTime *string `type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTrailNameException) StatusCode() int { + return s.respMetadata.StatusCode +} - // 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"` +// RequestID returns the service's response RequestID for request. +func (s InvalidTrailNameException) RequestID() string { + return s.respMetadata.RequestID +} - // 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"` +// This exception is thrown when there is an issue with the specified KMS key +// and the trail can’t be updated. +type KmsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Specifies the most recent date and time when CloudTrail started recording - // API calls for an AWS account. - StartLoggingTime *time.Time `type:"timestamp"` + Message_ *string `locationName:"message" type:"string"` +} - // Specifies the most recent date and time when CloudTrail stopped recording - // API calls for an AWS account. - StopLoggingTime *time.Time `type:"timestamp"` +// String returns the string representation +func (s KmsException) String() string { + return awsutil.Prettify(s) +} - // This field is deprecated. - TimeLoggingStarted *string `type:"string"` +// GoString returns the string representation +func (s KmsException) GoString() string { + return s.String() +} - // This field is deprecated. - TimeLoggingStopped *string `type:"string"` +func newErrorKmsException(v protocol.ResponseMetadata) error { + return &KmsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s KmsException) Code() string { + return "KmsException" +} + +// Message returns the exception's message. +func (s KmsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s KmsException) OrigErr() error { + return nil +} + +func (s KmsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s KmsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KmsException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is no longer in use. +// +// Deprecated: KmsKeyDisabledException has been deprecated +type KmsKeyDisabledException struct { + _ struct{} `deprecated:"true" type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetTrailStatusOutput) String() string { +func (s KmsKeyDisabledException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetTrailStatusOutput) GoString() string { +func (s KmsKeyDisabledException) GoString() string { return s.String() } -// SetIsLogging sets the IsLogging field's value. -func (s *GetTrailStatusOutput) SetIsLogging(v bool) *GetTrailStatusOutput { - s.IsLogging = &v - return s +func newErrorKmsKeyDisabledException(v protocol.ResponseMetadata) error { + return &KmsKeyDisabledException{ + respMetadata: v, + } } -// SetLatestCloudWatchLogsDeliveryError sets the LatestCloudWatchLogsDeliveryError field's value. -func (s *GetTrailStatusOutput) SetLatestCloudWatchLogsDeliveryError(v string) *GetTrailStatusOutput { - s.LatestCloudWatchLogsDeliveryError = &v - return s +// Code returns the exception type name. +func (s KmsKeyDisabledException) Code() string { + return "KmsKeyDisabledException" } -// SetLatestCloudWatchLogsDeliveryTime sets the LatestCloudWatchLogsDeliveryTime field's value. -func (s *GetTrailStatusOutput) SetLatestCloudWatchLogsDeliveryTime(v time.Time) *GetTrailStatusOutput { - s.LatestCloudWatchLogsDeliveryTime = &v - return s +// Message returns the exception's message. +func (s KmsKeyDisabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetLatestDeliveryAttemptSucceeded sets the LatestDeliveryAttemptSucceeded field's value. -func (s *GetTrailStatusOutput) SetLatestDeliveryAttemptSucceeded(v string) *GetTrailStatusOutput { - s.LatestDeliveryAttemptSucceeded = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s KmsKeyDisabledException) OrigErr() error { + return nil } -// SetLatestDeliveryAttemptTime sets the LatestDeliveryAttemptTime field's value. -func (s *GetTrailStatusOutput) SetLatestDeliveryAttemptTime(v string) *GetTrailStatusOutput { - s.LatestDeliveryAttemptTime = &v - return s +func (s KmsKeyDisabledException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetLatestDeliveryError sets the LatestDeliveryError field's value. -func (s *GetTrailStatusOutput) SetLatestDeliveryError(v string) *GetTrailStatusOutput { - s.LatestDeliveryError = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s KmsKeyDisabledException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetLatestDeliveryTime sets the LatestDeliveryTime field's value. -func (s *GetTrailStatusOutput) SetLatestDeliveryTime(v time.Time) *GetTrailStatusOutput { - s.LatestDeliveryTime = &v - return s +// RequestID returns the service's response RequestID for request. +func (s KmsKeyDisabledException) RequestID() string { + return s.respMetadata.RequestID } -// SetLatestDigestDeliveryError sets the LatestDigestDeliveryError field's value. -func (s *GetTrailStatusOutput) SetLatestDigestDeliveryError(v string) *GetTrailStatusOutput { - s.LatestDigestDeliveryError = &v - return s -} +// 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. +type KmsKeyNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata -// SetLatestDigestDeliveryTime sets the LatestDigestDeliveryTime field's value. -func (s *GetTrailStatusOutput) SetLatestDigestDeliveryTime(v time.Time) *GetTrailStatusOutput { - s.LatestDigestDeliveryTime = &v - return s + Message_ *string `locationName:"message" type:"string"` } -// SetLatestNotificationAttemptSucceeded sets the LatestNotificationAttemptSucceeded field's value. -func (s *GetTrailStatusOutput) SetLatestNotificationAttemptSucceeded(v string) *GetTrailStatusOutput { - s.LatestNotificationAttemptSucceeded = &v - return s +// String returns the string representation +func (s KmsKeyNotFoundException) String() string { + return awsutil.Prettify(s) } -// SetLatestNotificationAttemptTime sets the LatestNotificationAttemptTime field's value. -func (s *GetTrailStatusOutput) SetLatestNotificationAttemptTime(v string) *GetTrailStatusOutput { - s.LatestNotificationAttemptTime = &v - return s +// GoString returns the string representation +func (s KmsKeyNotFoundException) GoString() string { + return s.String() } -// SetLatestNotificationError sets the LatestNotificationError field's value. -func (s *GetTrailStatusOutput) SetLatestNotificationError(v string) *GetTrailStatusOutput { - s.LatestNotificationError = &v - return s +func newErrorKmsKeyNotFoundException(v protocol.ResponseMetadata) error { + return &KmsKeyNotFoundException{ + respMetadata: v, + } } -// SetLatestNotificationTime sets the LatestNotificationTime field's value. -func (s *GetTrailStatusOutput) SetLatestNotificationTime(v time.Time) *GetTrailStatusOutput { - s.LatestNotificationTime = &v - return s +// Code returns the exception type name. +func (s KmsKeyNotFoundException) Code() string { + return "KmsKeyNotFoundException" } -// SetStartLoggingTime sets the StartLoggingTime field's value. -func (s *GetTrailStatusOutput) SetStartLoggingTime(v time.Time) *GetTrailStatusOutput { - s.StartLoggingTime = &v - return s +// Message returns the exception's message. +func (s KmsKeyNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s KmsKeyNotFoundException) OrigErr() error { + return nil } -// SetStopLoggingTime sets the StopLoggingTime field's value. -func (s *GetTrailStatusOutput) SetStopLoggingTime(v time.Time) *GetTrailStatusOutput { - s.StopLoggingTime = &v - return s +func (s KmsKeyNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetTimeLoggingStarted sets the TimeLoggingStarted field's value. -func (s *GetTrailStatusOutput) SetTimeLoggingStarted(v string) *GetTrailStatusOutput { - s.TimeLoggingStarted = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s KmsKeyNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetTimeLoggingStopped sets the TimeLoggingStopped field's value. -func (s *GetTrailStatusOutput) SetTimeLoggingStopped(v string) *GetTrailStatusOutput { - s.TimeLoggingStopped = &v - return s +// RequestID returns the service's response RequestID for request. +func (s KmsKeyNotFoundException) RequestID() string { + return s.respMetadata.RequestID } // Requests the public keys for a specified time range. @@ -3169,6 +5719,69 @@ func (s *ListTagsOutput) SetResourceTagList(v []*ResourceTag) *ListTagsOutput { return s } +type ListTrailsInput struct { + _ struct{} `type:"structure"` + + // 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"` +} + +// String returns the string representation +func (s ListTrailsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTrailsInput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTrailsInput) SetNextToken(v string) *ListTrailsInput { + s.NextToken = &v + return s +} + +type ListTrailsOutput struct { + _ struct{} `type:"structure"` + + // 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"` + + // Returns the name, ARN, and home region of trails in the current account. + Trails []*TrailInfo `type:"list"` +} + +// String returns the string representation +func (s ListTrailsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTrailsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTrailsOutput) SetNextToken(v string) *ListTrailsOutput { + s.NextToken = &v + return s +} + +// SetTrails sets the Trails field's value. +func (s *ListTrailsOutput) SetTrails(v []*TrailInfo) *ListTrailsOutput { + s.Trails = v + return s +} + // Specifies an attribute and value that filter the events returned. type LookupAttribute struct { _ struct{} `type:"structure"` @@ -3231,6 +5844,12 @@ type LookupEventsInput struct { // error is returned. EndTime *time.Time `type:"timestamp"` + // Specifies the event category. If you do not specify an event category, events + // of the category are not returned in the response. For example, if you do + // not specify insight as the value of EventCategory, no Insights events are + // returned. + EventCategory *string `type:"string" enum:"EventCategory"` + // Contains a list of lookup attributes. Currently the list can contain only // one item. LookupAttributes []*LookupAttribute `type:"list"` @@ -3253,105 +5872,399 @@ type LookupEventsInput struct { } // String returns the string representation -func (s LookupEventsInput) String() string { +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 +} + +// SetEventCategory sets the EventCategory field's value. +func (s *LookupEventsInput) SetEventCategory(v string) *LookupEventsInput { + s.EventCategory = &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. +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 +} + +// This exception is thrown when the maximum number of trails is reached. +type MaximumNumberOfTrailsExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s MaximumNumberOfTrailsExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MaximumNumberOfTrailsExceededException) GoString() string { + return s.String() +} + +func newErrorMaximumNumberOfTrailsExceededException(v protocol.ResponseMetadata) error { + return &MaximumNumberOfTrailsExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MaximumNumberOfTrailsExceededException) Code() string { + return "MaximumNumberOfTrailsExceededException" +} + +// Message returns the exception's message. +func (s MaximumNumberOfTrailsExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaximumNumberOfTrailsExceededException) OrigErr() error { + return nil +} + +func (s MaximumNumberOfTrailsExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MaximumNumberOfTrailsExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MaximumNumberOfTrailsExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the AWS account making the request to create +// or update an organization trail is not the master account for an organization +// in AWS Organizations. For more information, see Prepare For Creating a Trail +// For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +type NotOrganizationMasterAccountException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotOrganizationMasterAccountException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotOrganizationMasterAccountException) GoString() string { + return s.String() +} + +func newErrorNotOrganizationMasterAccountException(v protocol.ResponseMetadata) error { + return &NotOrganizationMasterAccountException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotOrganizationMasterAccountException) Code() string { + return "NotOrganizationMasterAccountException" +} + +// Message returns the exception's message. +func (s NotOrganizationMasterAccountException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotOrganizationMasterAccountException) OrigErr() error { + return nil +} + +func (s NotOrganizationMasterAccountException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotOrganizationMasterAccountException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotOrganizationMasterAccountException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the requested operation is not permitted. +type OperationNotPermittedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s OperationNotPermittedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OperationNotPermittedException) GoString() string { + return s.String() +} + +func newErrorOperationNotPermittedException(v protocol.ResponseMetadata) error { + return &OperationNotPermittedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OperationNotPermittedException) Code() string { + return "OperationNotPermittedException" +} + +// Message returns the exception's message. +func (s OperationNotPermittedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OperationNotPermittedException) OrigErr() error { + return nil +} + +func (s OperationNotPermittedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OperationNotPermittedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OperationNotPermittedException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when AWS Organizations is not configured to support +// all features. All features must be enabled in AWS Organization to support +// creating an organization trail. For more information, see Prepare For Creating +// a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). +type OrganizationNotInAllFeaturesModeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s OrganizationNotInAllFeaturesModeException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LookupEventsInput) GoString() string { +func (s OrganizationNotInAllFeaturesModeException) 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 +func newErrorOrganizationNotInAllFeaturesModeException(v protocol.ResponseMetadata) error { + return &OrganizationNotInAllFeaturesModeException{ + respMetadata: v, } - return nil } -// SetEndTime sets the EndTime field's value. -func (s *LookupEventsInput) SetEndTime(v time.Time) *LookupEventsInput { - s.EndTime = &v - return s +// Code returns the exception type name. +func (s OrganizationNotInAllFeaturesModeException) Code() string { + return "OrganizationNotInAllFeaturesModeException" } -// SetLookupAttributes sets the LookupAttributes field's value. -func (s *LookupEventsInput) SetLookupAttributes(v []*LookupAttribute) *LookupEventsInput { - s.LookupAttributes = v - return s +// Message returns the exception's message. +func (s OrganizationNotInAllFeaturesModeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetMaxResults sets the MaxResults field's value. -func (s *LookupEventsInput) SetMaxResults(v int64) *LookupEventsInput { - s.MaxResults = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OrganizationNotInAllFeaturesModeException) OrigErr() error { + return nil } -// SetNextToken sets the NextToken field's value. -func (s *LookupEventsInput) SetNextToken(v string) *LookupEventsInput { - s.NextToken = &v - return s +func (s OrganizationNotInAllFeaturesModeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetStartTime sets the StartTime field's value. -func (s *LookupEventsInput) SetStartTime(v time.Time) *LookupEventsInput { - s.StartTime = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s OrganizationNotInAllFeaturesModeException) StatusCode() int { + return s.respMetadata.StatusCode } -// Contains a response to a LookupEvents action. -type LookupEventsOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s OrganizationNotInAllFeaturesModeException) RequestID() string { + return s.respMetadata.RequestID +} - // 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"` +// This exception is thrown when the request is made from an AWS account that +// is not a member of an organization. To make this request, sign in using the +// credentials of an account that belongs to an organization. +type OrganizationsNotInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s LookupEventsOutput) String() string { +func (s OrganizationsNotInUseException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LookupEventsOutput) GoString() string { +func (s OrganizationsNotInUseException) GoString() string { return s.String() } -// SetEvents sets the Events field's value. -func (s *LookupEventsOutput) SetEvents(v []*Event) *LookupEventsOutput { - s.Events = v - return s +func newErrorOrganizationsNotInUseException(v protocol.ResponseMetadata) error { + return &OrganizationsNotInUseException{ + respMetadata: v, + } } -// SetNextToken sets the NextToken field's value. -func (s *LookupEventsOutput) SetNextToken(v string) *LookupEventsOutput { - s.NextToken = &v - return s +// Code returns the exception type name. +func (s OrganizationsNotInUseException) Code() string { + return "OrganizationsNotInUseException" +} + +// Message returns the exception's message. +func (s OrganizationsNotInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OrganizationsNotInUseException) OrigErr() error { + return nil +} + +func (s OrganizationsNotInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OrganizationsNotInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OrganizationsNotInUseException) RequestID() string { + return s.respMetadata.RequestID } // Contains information about a returned public key. @@ -3512,6 +6425,94 @@ func (s *PutEventSelectorsOutput) SetTrailARN(v string) *PutEventSelectorsOutput return s } +type PutInsightSelectorsInput struct { + _ struct{} `type:"structure"` + + // A JSON string that contains the insight types you want to log on a trail. + // In this release, only ApiCallRateInsight is supported as an insight type. + // + // InsightSelectors is a required field + InsightSelectors []*InsightSelector `type:"list" required:"true"` + + // The name of the CloudTrail trail for which you want to change or add Insights + // selectors. + // + // TrailName is a required field + TrailName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s PutInsightSelectorsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutInsightSelectorsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutInsightSelectorsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutInsightSelectorsInput"} + if s.InsightSelectors == nil { + invalidParams.Add(request.NewErrParamRequired("InsightSelectors")) + } + if s.TrailName == nil { + invalidParams.Add(request.NewErrParamRequired("TrailName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInsightSelectors sets the InsightSelectors field's value. +func (s *PutInsightSelectorsInput) SetInsightSelectors(v []*InsightSelector) *PutInsightSelectorsInput { + s.InsightSelectors = v + return s +} + +// SetTrailName sets the TrailName field's value. +func (s *PutInsightSelectorsInput) SetTrailName(v string) *PutInsightSelectorsInput { + s.TrailName = &v + return s +} + +type PutInsightSelectorsOutput struct { + _ struct{} `type:"structure"` + + // A JSON string that contains the insight types you want to log on a trail. + // In this release, only ApiCallRateInsight is supported as an insight type. + InsightSelectors []*InsightSelector `type:"list"` + + // The Amazon Resource Name (ARN) of a trail for which you want to change or + // add Insights selectors. + TrailARN *string `type:"string"` +} + +// String returns the string representation +func (s PutInsightSelectorsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutInsightSelectorsOutput) GoString() string { + return s.String() +} + +// SetInsightSelectors sets the InsightSelectors field's value. +func (s *PutInsightSelectorsOutput) SetInsightSelectors(v []*InsightSelector) *PutInsightSelectorsOutput { + s.InsightSelectors = v + return s +} + +// SetTrailARN sets the TrailARN field's value. +func (s *PutInsightSelectorsOutput) SetTrailARN(v string) *PutInsightSelectorsOutput { + s.TrailARN = &v + return s +} + // Specifies the tags to remove from a trail. type RemoveTagsInput struct { _ struct{} `type:"structure"` @@ -3562,104 +6563,273 @@ func (s *RemoveTagsInput) Validate() error { } // SetResourceId sets the ResourceId field's value. -func (s *RemoveTagsInput) SetResourceId(v string) *RemoveTagsInput { +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. +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. +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. To learn more about how to look up and filter events by the resource + // types supported for a service, see Filtering CloudTrail Events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events-console.html#filtering-cloudtrail-events). + 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 +} + +// This exception is thrown when the specified resource is not found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// A resource tag. +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 *RemoveTagsInput) SetTagsList(v []*Tag) *RemoveTagsInput { +func (s *ResourceTag) SetTagsList(v []*Tag) *ResourceTag { s.TagsList = v return s } -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -type RemoveTagsOutput struct { - _ struct{} `type:"structure"` +// This exception is thrown when the specified resource type is not supported +// by CloudTrail. +type ResourceTypeNotSupportedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s RemoveTagsOutput) String() string { +func (s ResourceTypeNotSupportedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RemoveTagsOutput) GoString() string { +func (s ResourceTypeNotSupportedException) GoString() string { return s.String() } -// Specifies the type and name of a resource referenced by an event. -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"` +func newErrorResourceTypeNotSupportedException(v protocol.ResponseMetadata) error { + return &ResourceTypeNotSupportedException{ + respMetadata: v, + } +} - // 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"` +// Code returns the exception type name. +func (s ResourceTypeNotSupportedException) Code() string { + return "ResourceTypeNotSupportedException" } -// String returns the string representation -func (s Resource) String() string { - return awsutil.Prettify(s) +// Message returns the exception's message. +func (s ResourceTypeNotSupportedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// GoString returns the string representation -func (s Resource) GoString() string { - return s.String() +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceTypeNotSupportedException) OrigErr() error { + return nil } -// SetResourceName sets the ResourceName field's value. -func (s *Resource) SetResourceName(v string) *Resource { - s.ResourceName = &v - return s +func (s ResourceTypeNotSupportedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetResourceType sets the ResourceType field's value. -func (s *Resource) SetResourceType(v string) *Resource { - s.ResourceType = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ResourceTypeNotSupportedException) StatusCode() int { + return s.respMetadata.StatusCode } -// A resource tag. -type ResourceTag struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s ResourceTypeNotSupportedException) RequestID() string { + return s.respMetadata.RequestID +} - // Specifies the ARN of the resource. - ResourceId *string `type:"string"` +// This exception is thrown when the specified S3 bucket does not exist. +type S3BucketDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // A list of tags. - TagsList []*Tag `type:"list"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ResourceTag) String() string { +func (s S3BucketDoesNotExistException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ResourceTag) GoString() string { +func (s S3BucketDoesNotExistException) GoString() string { return s.String() } -// SetResourceId sets the ResourceId field's value. -func (s *ResourceTag) SetResourceId(v string) *ResourceTag { - s.ResourceId = &v - return s +func newErrorS3BucketDoesNotExistException(v protocol.ResponseMetadata) error { + return &S3BucketDoesNotExistException{ + respMetadata: v, + } } -// SetTagsList sets the TagsList field's value. -func (s *ResourceTag) SetTagsList(v []*Tag) *ResourceTag { - s.TagsList = v - return s +// Code returns the exception type name. +func (s S3BucketDoesNotExistException) Code() string { + return "S3BucketDoesNotExistException" +} + +// Message returns the exception's message. +func (s S3BucketDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s S3BucketDoesNotExistException) OrigErr() error { + return nil +} + +func (s S3BucketDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s S3BucketDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s S3BucketDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID } // The request to CloudTrail to start logging AWS API calls for an account. @@ -3829,6 +6999,63 @@ func (s *Tag) SetValue(v string) *Tag { return s } +// The number of tags per trail has exceeded the permitted amount. Currently, +// the limit is 50. +type TagsLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TagsLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagsLimitExceededException) GoString() string { + return s.String() +} + +func newErrorTagsLimitExceededException(v protocol.ResponseMetadata) error { + return &TagsLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagsLimitExceededException) Code() string { + return "TagsLimitExceededException" +} + +// Message returns the exception's message. +func (s TagsLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagsLimitExceededException) OrigErr() error { + return nil +} + +func (s TagsLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagsLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagsLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // The settings for a trail. type Trail struct { _ struct{} `type:"structure"` @@ -3844,6 +7071,10 @@ type Trail struct { // Specifies if the trail has custom event selectors. HasCustomEventSelectors *bool `type:"boolean"` + // Specifies whether a trail has insight types specified in an InsightSelector + // list. + HasInsightSelectors *bool `type:"boolean"` + // The region in which the trail was created. HomeRegion *string `type:"string"` @@ -3851,7 +7082,7 @@ type Trail struct { // Otherwise, False. IncludeGlobalServiceEvents *bool `type:"boolean"` - // Specifies whether the trail belongs only to one region or exists in all regions. + // Specifies whether the trail exists only in one region or exists in all regions. IsMultiRegionTrail *bool `type:"boolean"` // Specifies whether the trail is an organization trail. @@ -3870,12 +7101,12 @@ type Trail struct { 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). + // See Amazon S3 Bucket Naming Requirements (https://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 + // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html).The // maximum length is 200 characters. S3KeyPrefix *string `type:"string"` @@ -3885,7 +7116,7 @@ type Trail struct { // arn:aws:sns:us-east-2:123456789012:MyTopic SnsTopicARN *string `type:"string"` - // This field is deprecated. Use SnsTopicARN. + // This field is no longer in use. Use SnsTopicARN. // // Deprecated: SnsTopicName has been deprecated SnsTopicName *string `deprecated:"true" type:"string"` @@ -3924,6 +7155,12 @@ func (s *Trail) SetHasCustomEventSelectors(v bool) *Trail { return s } +// SetHasInsightSelectors sets the HasInsightSelectors field's value. +func (s *Trail) SetHasInsightSelectors(v bool) *Trail { + s.HasInsightSelectors = &v + return s +} + // SetHomeRegion sets the HomeRegion field's value. func (s *Trail) SetHomeRegion(v string) *Trail { s.HomeRegion = &v @@ -3996,6 +7233,273 @@ func (s *Trail) SetTrailARN(v string) *Trail { return s } +// This exception is thrown when the specified trail already exists. +type TrailAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TrailAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TrailAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorTrailAlreadyExistsException(v protocol.ResponseMetadata) error { + return &TrailAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TrailAlreadyExistsException) Code() string { + return "TrailAlreadyExistsException" +} + +// Message returns the exception's message. +func (s TrailAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TrailAlreadyExistsException) OrigErr() error { + return nil +} + +func (s TrailAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TrailAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TrailAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about a CloudTrail trail, including the trail's name, home region, +// and Amazon Resource Name (ARN). +type TrailInfo struct { + _ struct{} `type:"structure"` + + // The AWS region in which a trail was created. + HomeRegion *string `type:"string"` + + // The name of a trail. + Name *string `type:"string"` + + // The ARN of a trail. + TrailARN *string `type:"string"` +} + +// String returns the string representation +func (s TrailInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TrailInfo) GoString() string { + return s.String() +} + +// SetHomeRegion sets the HomeRegion field's value. +func (s *TrailInfo) SetHomeRegion(v string) *TrailInfo { + s.HomeRegion = &v + return s +} + +// SetName sets the Name field's value. +func (s *TrailInfo) SetName(v string) *TrailInfo { + s.Name = &v + return s +} + +// SetTrailARN sets the TrailARN field's value. +func (s *TrailInfo) SetTrailARN(v string) *TrailInfo { + s.TrailARN = &v + return s +} + +// This exception is thrown when the trail with the given name is not found. +type TrailNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TrailNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TrailNotFoundException) GoString() string { + return s.String() +} + +func newErrorTrailNotFoundException(v protocol.ResponseMetadata) error { + return &TrailNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TrailNotFoundException) Code() string { + return "TrailNotFoundException" +} + +// Message returns the exception's message. +func (s TrailNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TrailNotFoundException) OrigErr() error { + return nil +} + +func (s TrailNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TrailNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TrailNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is no longer in use. +type TrailNotProvidedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TrailNotProvidedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TrailNotProvidedException) GoString() string { + return s.String() +} + +func newErrorTrailNotProvidedException(v protocol.ResponseMetadata) error { + return &TrailNotProvidedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TrailNotProvidedException) Code() string { + return "TrailNotProvidedException" +} + +// Message returns the exception's message. +func (s TrailNotProvidedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TrailNotProvidedException) OrigErr() error { + return nil +} + +func (s TrailNotProvidedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TrailNotProvidedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TrailNotProvidedException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the requested operation is not supported. +type UnsupportedOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedOperationException) GoString() string { + return s.String() +} + +func newErrorUnsupportedOperationException(v protocol.ResponseMetadata) error { + return &UnsupportedOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedOperationException) Code() string { + return "UnsupportedOperationException" +} + +// Message returns the exception's message. +func (s UnsupportedOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedOperationException) OrigErr() error { + return nil +} + +func (s UnsupportedOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedOperationException) RequestID() string { + return s.respMetadata.RequestID +} + // Specifies settings to update for the trail. type UpdateTrailInput struct { _ struct{} `type:"structure"` @@ -4030,7 +7534,8 @@ type UpdateTrailInput struct { // 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. + // it was created, and its shadow trails in other regions will be deleted. As + // a best practice, consider using trails that log events in all regions. IsMultiRegionTrail *bool `type:"boolean"` // Specifies whether the trail is applied to all accounts in an organization @@ -4082,12 +7587,12 @@ type UpdateTrailInput struct { 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). + // files. See Amazon S3 Bucket Naming Requirements (https://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). + // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). // The maximum length is 200 characters. S3KeyPrefix *string `type:"string"` @@ -4226,7 +7731,7 @@ type UpdateTrailOutput struct { // 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). + // Your CloudTrail Log Files (https://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 @@ -4235,7 +7740,7 @@ type UpdateTrailOutput struct { // arn:aws:sns:us-east-2:123456789012:MyTopic SnsTopicARN *string `type:"string"` - // This field is deprecated. Use SnsTopicARN. + // This field is no longer in use. Use SnsTopicARN. // // Deprecated: SnsTopicName has been deprecated SnsTopicName *string `deprecated:"true" type:"string"` @@ -4335,6 +7840,16 @@ func (s *UpdateTrailOutput) SetTrailARN(v string) *UpdateTrailOutput { return s } +const ( + // EventCategoryInsight is a EventCategory enum value + EventCategoryInsight = "insight" +) + +const ( + // InsightTypeApiCallRateInsight is a InsightType enum value + InsightTypeApiCallRateInsight = "ApiCallRateInsight" +) + const ( // LookupAttributeKeyEventId is a LookupAttributeKey enum value LookupAttributeKeyEventId = "EventId" diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/doc.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/doc.go index 8226ac8b068..d2b23643d38 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/doc.go @@ -21,7 +21,7 @@ // 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) +// See the AWS CloudTrail User Guide (https://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. // 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 index 4fdd9a37b55..5feef21ae67 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go @@ -2,6 +2,10 @@ package cloudtrail +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeARNInvalidException for service response error code @@ -28,6 +32,13 @@ const ( // Cannot set a CloudWatch Logs delivery for this region. ErrCodeCloudWatchLogsDeliveryUnavailableException = "CloudWatchLogsDeliveryUnavailableException" + // ErrCodeInsightNotEnabledException for service response error code + // "InsightNotEnabledException". + // + // If you run GetInsightSelectors on a trail that does not have Insights events + // enabled, the operation throws the exception InsightNotEnabledException. + ErrCodeInsightNotEnabledException = "InsightNotEnabledException" + // ErrCodeInsufficientDependencyServiceAccessPermissionException for service response error code // "InsufficientDependencyServiceAccessPermissionException". // @@ -68,6 +79,13 @@ const ( // This exception is thrown when the provided role is not valid. ErrCodeInvalidCloudWatchLogsRoleArnException = "InvalidCloudWatchLogsRoleArnException" + // ErrCodeInvalidEventCategoryException for service response error code + // "InvalidEventCategoryException". + // + // Occurs if an event category that is not valid is specified as a value of + // EventCategory. + ErrCodeInvalidEventCategoryException = "InvalidEventCategoryException" + // ErrCodeInvalidEventSelectorsException for service response error code // "InvalidEventSelectorsException". // @@ -99,6 +117,14 @@ const ( // other than the region in which the trail was created. ErrCodeInvalidHomeRegionException = "InvalidHomeRegionException" + // ErrCodeInvalidInsightSelectorsException for service response error code + // "InvalidInsightSelectorsException". + // + // The formatting or syntax of the InsightSelectors JSON statement in your PutInsightSelectors + // or GetInsightSelectors request is not valid, or the specified insight type + // in the InsightSelectors statement is not a valid insight type. + ErrCodeInvalidInsightSelectorsException = "InvalidInsightSelectorsException" + // ErrCodeInvalidKmsKeyIdException for service response error code // "InvalidKmsKeyIdException". // @@ -152,8 +178,8 @@ const ( // 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}_.:/=+\\-@]*)$. + // This exception is thrown when the specified tag key or values are not valid. + // It can also occur if there are duplicate tags or too many tags on the resource. ErrCodeInvalidTagParameterException = "InvalidTagParameterException" // ErrCodeInvalidTimeRangeException for service response error code @@ -198,7 +224,7 @@ const ( // ErrCodeKmsKeyDisabledException for service response error code // "KmsKeyDisabledException". // - // This exception is deprecated. + // This exception is no longer in use. ErrCodeKmsKeyDisabledException = "KmsKeyDisabledException" // ErrCodeKmsKeyNotFoundException for service response error code @@ -287,7 +313,7 @@ const ( // ErrCodeTrailNotProvidedException for service response error code // "TrailNotProvidedException". // - // This exception is deprecated. + // This exception is no longer in use. ErrCodeTrailNotProvidedException = "TrailNotProvidedException" // ErrCodeUnsupportedOperationException for service response error code @@ -296,3 +322,48 @@ const ( // This exception is thrown when the requested operation is not supported. ErrCodeUnsupportedOperationException = "UnsupportedOperationException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "CloudTrailARNInvalidException": newErrorARNInvalidException, + "CloudTrailAccessNotEnabledException": newErrorAccessNotEnabledException, + "CloudWatchLogsDeliveryUnavailableException": newErrorCloudWatchLogsDeliveryUnavailableException, + "InsightNotEnabledException": newErrorInsightNotEnabledException, + "InsufficientDependencyServiceAccessPermissionException": newErrorInsufficientDependencyServiceAccessPermissionException, + "InsufficientEncryptionPolicyException": newErrorInsufficientEncryptionPolicyException, + "InsufficientS3BucketPolicyException": newErrorInsufficientS3BucketPolicyException, + "InsufficientSnsTopicPolicyException": newErrorInsufficientSnsTopicPolicyException, + "InvalidCloudWatchLogsLogGroupArnException": newErrorInvalidCloudWatchLogsLogGroupArnException, + "InvalidCloudWatchLogsRoleArnException": newErrorInvalidCloudWatchLogsRoleArnException, + "InvalidEventCategoryException": newErrorInvalidEventCategoryException, + "InvalidEventSelectorsException": newErrorInvalidEventSelectorsException, + "InvalidHomeRegionException": newErrorInvalidHomeRegionException, + "InvalidInsightSelectorsException": newErrorInvalidInsightSelectorsException, + "InvalidKmsKeyIdException": newErrorInvalidKmsKeyIdException, + "InvalidLookupAttributesException": newErrorInvalidLookupAttributesException, + "InvalidMaxResultsException": newErrorInvalidMaxResultsException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "InvalidParameterCombinationException": newErrorInvalidParameterCombinationException, + "InvalidS3BucketNameException": newErrorInvalidS3BucketNameException, + "InvalidS3PrefixException": newErrorInvalidS3PrefixException, + "InvalidSnsTopicNameException": newErrorInvalidSnsTopicNameException, + "InvalidTagParameterException": newErrorInvalidTagParameterException, + "InvalidTimeRangeException": newErrorInvalidTimeRangeException, + "InvalidTokenException": newErrorInvalidTokenException, + "InvalidTrailNameException": newErrorInvalidTrailNameException, + "KmsException": newErrorKmsException, + "KmsKeyDisabledException": newErrorKmsKeyDisabledException, + "KmsKeyNotFoundException": newErrorKmsKeyNotFoundException, + "MaximumNumberOfTrailsExceededException": newErrorMaximumNumberOfTrailsExceededException, + "NotOrganizationMasterAccountException": newErrorNotOrganizationMasterAccountException, + "OperationNotPermittedException": newErrorOperationNotPermittedException, + "OrganizationNotInAllFeaturesModeException": newErrorOrganizationNotInAllFeaturesModeException, + "OrganizationsNotInUseException": newErrorOrganizationsNotInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ResourceTypeNotSupportedException": newErrorResourceTypeNotSupportedException, + "S3BucketDoesNotExistException": newErrorS3BucketDoesNotExistException, + "TagsLimitExceededException": newErrorTagsLimitExceededException, + "TrailAlreadyExistsException": newErrorTrailAlreadyExistsException, + "TrailNotFoundException": newErrorTrailNotFoundException, + "TrailNotProvidedException": newErrorTrailNotProvidedException, + "UnsupportedOperationException": newErrorUnsupportedOperationException, +} 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 index 5f1d4ddc41f..fece8a618aa 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "cloudtrail" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "CloudTrail" // ServiceID is a unique identifer of a specific service. + ServiceID = "CloudTrail" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CloudTrail client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CloudTrail client from just a session. // svc := cloudtrail.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CloudTrail { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CloudTrail { svc := &CloudTrail{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2013-11-01", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 0cc1304030f..dec4cd3834b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/api.go @@ -58,9 +58,27 @@ func (c *CloudWatch) DeleteAlarmsRequest(input *DeleteAlarmsInput) (req *request // DeleteAlarms API operation for Amazon CloudWatch. // -// Deletes the specified alarms. You can delete up to 50 alarms in one operation. +// Deletes the specified alarms. You can delete up to 100 alarms in one operation. +// However, this total can include no more than one composite alarm. For example, +// you could delete 99 metric alarms and one composite alarms with one operation, +// but you can't delete two composite alarms with one operation. +// // In the event of an error, no alarms are deleted. // +// It is possible to create a loop or cycle of composite alarms, where composite +// alarm A depends on composite alarm B, and composite alarm B also depends +// on composite alarm A. In this scenario, you can't delete any composite alarm +// that is part of the cycle because there is always still a composite alarm +// that depends on that alarm that you want to delete. +// +// To get out of such a situation, you must break the cycle by changing the +// rule of one of the composite alarms in the cycle to remove a dependency that +// creates the cycle. The simplest change to make to break a cycle is to change +// the AlarmRule of one of the alarms to False. +// +// Additionally, the evaluation of composite alarms stops if CloudWatch detects +// a cycle in the evaluation 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. @@ -270,6 +288,92 @@ func (c *CloudWatch) DeleteDashboardsWithContext(ctx aws.Context, input *DeleteD return out, req.Send() } +const opDeleteInsightRules = "DeleteInsightRules" + +// DeleteInsightRulesRequest generates a "aws/request.Request" representing the +// client's request for the DeleteInsightRules operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteInsightRules for more information on using the DeleteInsightRules +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteInsightRulesRequest method. +// req, resp := client.DeleteInsightRulesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteInsightRules +func (c *CloudWatch) DeleteInsightRulesRequest(input *DeleteInsightRulesInput) (req *request.Request, output *DeleteInsightRulesOutput) { + op := &request.Operation{ + Name: opDeleteInsightRules, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteInsightRulesInput{} + } + + output = &DeleteInsightRulesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteInsightRules API operation for Amazon CloudWatch. +// +// Permanently deletes the specified Contributor Insights rules. +// +// If you create a rule, delete it, and then re-create it with the same name, +// historical data from the first time the rule was created may or may not be +// 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 CloudWatch's +// API operation DeleteInsightRules 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. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DeleteInsightRules +func (c *CloudWatch) DeleteInsightRules(input *DeleteInsightRulesInput) (*DeleteInsightRulesOutput, error) { + req, out := c.DeleteInsightRulesRequest(input) + return out, req.Send() +} + +// DeleteInsightRulesWithContext is the same as DeleteInsightRules with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteInsightRules for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatch) DeleteInsightRulesWithContext(ctx aws.Context, input *DeleteInsightRulesInput, opts ...request.Option) (*DeleteInsightRulesOutput, error) { + req, out := c.DeleteInsightRulesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeAlarmHistory = "DescribeAlarmHistory" // DescribeAlarmHistoryRequest generates a "aws/request.Request" representing the @@ -322,7 +426,7 @@ func (c *CloudWatch) DescribeAlarmHistoryRequest(input *DescribeAlarmHistoryInpu // // 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. +// for either all metric alarms or all composite alarms are returned. // // CloudWatch retains the history of an alarm even if you delete the alarm. // @@ -402,10 +506,12 @@ func (c *CloudWatch) DescribeAlarmHistoryPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeAlarmHistoryOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeAlarmHistoryOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -459,9 +565,8 @@ func (c *CloudWatch) DescribeAlarmsRequest(input *DescribeAlarmsInput) (req *req // 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. +// Retrieves the specified alarms. You can filter the results by specifying +// a 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 @@ -539,10 +644,12 @@ func (c *CloudWatch) DescribeAlarmsPagesWithContext(ctx aws.Context, input *Desc }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeAlarmsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeAlarmsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -708,310 +815,735 @@ func (c *CloudWatch) DescribeAnomalyDetectorsWithContext(ctx aws.Context, input return out, req.Send() } -const opDisableAlarmActions = "DisableAlarmActions" +const opDescribeInsightRules = "DescribeInsightRules" -// DisableAlarmActionsRequest generates a "aws/request.Request" representing the -// client's request for the DisableAlarmActions operation. The "output" return +// DescribeInsightRulesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeInsightRules operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DisableAlarmActions for more information on using the DisableAlarmActions +// See DescribeInsightRules for more information on using the DescribeInsightRules // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DisableAlarmActionsRequest method. -// req, resp := client.DisableAlarmActionsRequest(params) +// // Example sending a request using the DescribeInsightRulesRequest method. +// req, resp := client.DescribeInsightRulesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableAlarmActions -func (c *CloudWatch) DisableAlarmActionsRequest(input *DisableAlarmActionsInput) (req *request.Request, output *DisableAlarmActionsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeInsightRules +func (c *CloudWatch) DescribeInsightRulesRequest(input *DescribeInsightRulesInput) (req *request.Request, output *DescribeInsightRulesOutput) { op := &request.Operation{ - Name: opDisableAlarmActions, + Name: opDescribeInsightRules, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DisableAlarmActionsInput{} + input = &DescribeInsightRulesInput{} } - output = &DisableAlarmActionsOutput{} + output = &DescribeInsightRulesOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DisableAlarmActions API operation for Amazon CloudWatch. +// DescribeInsightRules 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 a list of all the Contributor Insights rules in your account. All +// rules in your account are returned with a single operation. +// +// For more information about Contributor Insights, see Using Contributor Insights +// to Analyze High-Cardinality Data (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights.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 CloudWatch's -// API operation DisableAlarmActions for usage and error information. -// See also, 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) +// API operation DescribeInsightRules for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidNextToken "InvalidNextToken" +// The next token specified is invalid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DescribeInsightRules +func (c *CloudWatch) DescribeInsightRules(input *DescribeInsightRulesInput) (*DescribeInsightRulesOutput, error) { + req, out := c.DescribeInsightRulesRequest(input) return out, req.Send() } -// DisableAlarmActionsWithContext is the same as DisableAlarmActions with the addition of +// DescribeInsightRulesWithContext is the same as DescribeInsightRules with the addition of // the ability to pass a context and additional request options. // -// See DisableAlarmActions for details on how to use this API operation. +// See DescribeInsightRules for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudWatch) DisableAlarmActionsWithContext(ctx aws.Context, input *DisableAlarmActionsInput, opts ...request.Option) (*DisableAlarmActionsOutput, error) { - req, out := c.DisableAlarmActionsRequest(input) +func (c *CloudWatch) DescribeInsightRulesWithContext(ctx aws.Context, input *DescribeInsightRulesInput, opts ...request.Option) (*DescribeInsightRulesOutput, error) { + req, out := c.DescribeInsightRulesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opEnableAlarmActions = "EnableAlarmActions" +// DescribeInsightRulesPages iterates over the pages of a DescribeInsightRules operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeInsightRules 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 DescribeInsightRules operation. +// pageNum := 0 +// err := client.DescribeInsightRulesPages(params, +// func(page *cloudwatch.DescribeInsightRulesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CloudWatch) DescribeInsightRulesPages(input *DescribeInsightRulesInput, fn func(*DescribeInsightRulesOutput, bool) bool) error { + return c.DescribeInsightRulesPagesWithContext(aws.BackgroundContext(), input, fn) +} -// EnableAlarmActionsRequest generates a "aws/request.Request" representing the -// client's request for the EnableAlarmActions operation. The "output" return +// DescribeInsightRulesPagesWithContext same as DescribeInsightRulesPages 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 *CloudWatch) DescribeInsightRulesPagesWithContext(ctx aws.Context, input *DescribeInsightRulesInput, fn func(*DescribeInsightRulesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeInsightRulesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInsightRulesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeInsightRulesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDisableAlarmActions = "DisableAlarmActions" + +// DisableAlarmActionsRequest generates a "aws/request.Request" representing the +// client's request for the DisableAlarmActions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See EnableAlarmActions for more information on using the EnableAlarmActions +// See DisableAlarmActions for more information on using the DisableAlarmActions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the EnableAlarmActionsRequest method. -// req, resp := client.EnableAlarmActionsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/EnableAlarmActions -func (c *CloudWatch) EnableAlarmActionsRequest(input *EnableAlarmActionsInput) (req *request.Request, output *EnableAlarmActionsOutput) { +// See also, 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: opEnableAlarmActions, + Name: opDisableAlarmActions, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &EnableAlarmActionsInput{} + input = &DisableAlarmActionsInput{} } - output = &EnableAlarmActionsOutput{} + output = &DisableAlarmActionsOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// EnableAlarmActions API operation for Amazon CloudWatch. +// DisableAlarmActions API operation for Amazon CloudWatch. // -// Enables the actions for the specified alarms. +// 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 EnableAlarmActions for usage and error information. -// See also, 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) +// API operation DisableAlarmActions for usage and error information. +// See also, 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) return out, req.Send() } -// EnableAlarmActionsWithContext is the same as EnableAlarmActions with the addition of +// DisableAlarmActionsWithContext is the same as DisableAlarmActions with the addition of // the ability to pass a context and additional request options. // -// See EnableAlarmActions for details on how to use this API operation. +// See DisableAlarmActions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudWatch) EnableAlarmActionsWithContext(ctx aws.Context, input *EnableAlarmActionsInput, opts ...request.Option) (*EnableAlarmActionsOutput, error) { - req, out := c.EnableAlarmActionsRequest(input) +func (c *CloudWatch) DisableAlarmActionsWithContext(ctx aws.Context, input *DisableAlarmActionsInput, opts ...request.Option) (*DisableAlarmActionsOutput, error) { + req, out := c.DisableAlarmActionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetDashboard = "GetDashboard" +const opDisableInsightRules = "DisableInsightRules" -// GetDashboardRequest generates a "aws/request.Request" representing the -// client's request for the GetDashboard operation. The "output" return +// DisableInsightRulesRequest generates a "aws/request.Request" representing the +// client's request for the DisableInsightRules operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetDashboard for more information on using the GetDashboard +// See DisableInsightRules for more information on using the DisableInsightRules // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetDashboardRequest method. -// req, resp := client.GetDashboardRequest(params) +// // Example sending a request using the DisableInsightRulesRequest method. +// req, resp := client.DisableInsightRulesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetDashboard -func (c *CloudWatch) GetDashboardRequest(input *GetDashboardInput) (req *request.Request, output *GetDashboardOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableInsightRules +func (c *CloudWatch) DisableInsightRulesRequest(input *DisableInsightRulesInput) (req *request.Request, output *DisableInsightRulesOutput) { op := &request.Operation{ - Name: opGetDashboard, + Name: opDisableInsightRules, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetDashboardInput{} + input = &DisableInsightRulesInput{} } - output = &GetDashboardOutput{} + output = &DisableInsightRulesOutput{} req = c.newRequest(op, input, output) return } -// GetDashboard API operation for Amazon CloudWatch. -// -// Displays the details of the dashboard that you specify. +// DisableInsightRules API operation for Amazon CloudWatch. // -// To copy an existing dashboard, use GetDashboard, and then use the data returned -// within DashboardBody as the template for the new dashboard when you call -// PutDashboard to create the copy. +// Disables the specified Contributor Insights rules. When rules are disabled, +// they do not analyze log groups and do not incur costs. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 GetDashboard for usage and error information. +// API operation DisableInsightRules for usage and error information. // // Returned Error Codes: // * ErrCodeInvalidParameterValueException "InvalidParameterValue" // The value of an input parameter is bad or out-of-range. // -// * ErrCodeDashboardNotFoundError "ResourceNotFound" -// The specified dashboard does not exist. -// -// * ErrCodeInternalServiceFault "InternalServiceError" -// Request processing has failed due to some unknown error, exception, or failure. +// * ErrCodeMissingRequiredParameterException "MissingParameter" +// An input parameter that is required is missing. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetDashboard -func (c *CloudWatch) GetDashboard(input *GetDashboardInput) (*GetDashboardOutput, error) { - req, out := c.GetDashboardRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/DisableInsightRules +func (c *CloudWatch) DisableInsightRules(input *DisableInsightRulesInput) (*DisableInsightRulesOutput, error) { + req, out := c.DisableInsightRulesRequest(input) return out, req.Send() } -// GetDashboardWithContext is the same as GetDashboard with the addition of +// DisableInsightRulesWithContext is the same as DisableInsightRules with the addition of // the ability to pass a context and additional request options. // -// See GetDashboard for details on how to use this API operation. +// See DisableInsightRules for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudWatch) GetDashboardWithContext(ctx aws.Context, input *GetDashboardInput, opts ...request.Option) (*GetDashboardOutput, error) { - req, out := c.GetDashboardRequest(input) +func (c *CloudWatch) DisableInsightRulesWithContext(ctx aws.Context, input *DisableInsightRulesInput, opts ...request.Option) (*DisableInsightRulesOutput, error) { + req, out := c.DisableInsightRulesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetMetricData = "GetMetricData" +const opEnableAlarmActions = "EnableAlarmActions" -// GetMetricDataRequest generates a "aws/request.Request" representing the -// client's request for the GetMetricData operation. The "output" return +// EnableAlarmActionsRequest generates a "aws/request.Request" representing the +// client's request for the EnableAlarmActions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetMetricData for more information on using the GetMetricData +// See EnableAlarmActions for more information on using the EnableAlarmActions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetMetricDataRequest method. -// req, resp := client.GetMetricDataRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricData -func (c *CloudWatch) GetMetricDataRequest(input *GetMetricDataInput) (req *request.Request, output *GetMetricDataOutput) { +// See also, 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: opGetMetricData, + Name: opEnableAlarmActions, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxDatapoints", - TruncationToken: "", - }, } if input == nil { - input = &GetMetricDataInput{} + input = &EnableAlarmActionsInput{} } - output = &GetMetricDataOutput{} + output = &EnableAlarmActionsOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// GetMetricData API operation for Amazon CloudWatch. -// -// You can use the GetMetricData API to retrieve as many as 100 different metrics -// in a single request, with a total of as many as 100,800 datapoints. You can -// also optionally perform math expressions on the values of the returned statistics, -// to create new time series that represent new insights into your data. For -// example, using Lambda metrics, you could divide the Errors metric by the -// Invocations metric to get an error rate time series. For more information -// about metric math expressions, see Metric Math Syntax and Functions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) -// in the Amazon CloudWatch User Guide. +// EnableAlarmActions API operation for Amazon CloudWatch. // -// Calls to the GetMetricData API have a different pricing structure than calls -// to GetMetricStatistics. For more information about pricing, see Amazon CloudWatch -// Pricing (https://aws.amazon.com/cloudwatch/pricing/). +// Enables the actions for the specified alarms. // -// Amazon CloudWatch retains metric data as follows: +// Returns awserr.Error for service API and SDK errors. Use runtime type 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. +// See also, 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) + return out, req.Send() +} + +// EnableAlarmActionsWithContext is the same as EnableAlarmActions with the addition of +// the ability to pass a context and additional request options. +// +// See EnableAlarmActions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatch) EnableAlarmActionsWithContext(ctx aws.Context, input *EnableAlarmActionsInput, opts ...request.Option) (*EnableAlarmActionsOutput, error) { + req, out := c.EnableAlarmActionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opEnableInsightRules = "EnableInsightRules" + +// EnableInsightRulesRequest generates a "aws/request.Request" representing the +// client's request for the EnableInsightRules operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See EnableInsightRules for more information on using the EnableInsightRules +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the EnableInsightRulesRequest method. +// req, resp := client.EnableInsightRulesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/EnableInsightRules +func (c *CloudWatch) EnableInsightRulesRequest(input *EnableInsightRulesInput) (req *request.Request, output *EnableInsightRulesOutput) { + op := &request.Operation{ + Name: opEnableInsightRules, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &EnableInsightRulesInput{} + } + + output = &EnableInsightRulesOutput{} + req = c.newRequest(op, input, output) + return +} + +// EnableInsightRules API operation for Amazon CloudWatch. +// +// Enables the specified Contributor Insights rules. When rules are enabled, +// they immediately begin analyzing log 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 CloudWatch's +// API operation EnableInsightRules 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. +// +// * ErrCodeLimitExceededException "LimitExceededException" +// The operation exceeded one or more limits. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/EnableInsightRules +func (c *CloudWatch) EnableInsightRules(input *EnableInsightRulesInput) (*EnableInsightRulesOutput, error) { + req, out := c.EnableInsightRulesRequest(input) + return out, req.Send() +} + +// EnableInsightRulesWithContext is the same as EnableInsightRules with the addition of +// the ability to pass a context and additional request options. +// +// See EnableInsightRules for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatch) EnableInsightRulesWithContext(ctx aws.Context, input *EnableInsightRulesInput, opts ...request.Option) (*EnableInsightRulesOutput, error) { + req, out := c.EnableInsightRulesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetDashboard = "GetDashboard" + +// GetDashboardRequest generates a "aws/request.Request" representing the +// client's request for the GetDashboard operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetDashboard for more information on using the GetDashboard +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetDashboardRequest method. +// req, resp := client.GetDashboardRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetDashboard +func (c *CloudWatch) GetDashboardRequest(input *GetDashboardInput) (req *request.Request, output *GetDashboardOutput) { + op := &request.Operation{ + Name: opGetDashboard, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetDashboardInput{} + } + + output = &GetDashboardOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetDashboard API operation for Amazon CloudWatch. +// +// Displays the details of the dashboard that you specify. +// +// To copy an existing dashboard, use GetDashboard, and then use the data returned +// within DashboardBody as the template for the new dashboard when you call +// PutDashboard to create the copy. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 GetDashboard for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidParameterValueException "InvalidParameterValue" +// The value of an input parameter is bad or out-of-range. +// +// * ErrCodeDashboardNotFoundError "ResourceNotFound" +// The specified dashboard does not exist. +// +// * ErrCodeInternalServiceFault "InternalServiceError" +// Request processing has failed due to some unknown error, exception, or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetDashboard +func (c *CloudWatch) GetDashboard(input *GetDashboardInput) (*GetDashboardOutput, error) { + req, out := c.GetDashboardRequest(input) + return out, req.Send() +} + +// GetDashboardWithContext is the same as GetDashboard with the addition of +// the ability to pass a context and additional request options. +// +// See GetDashboard for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatch) GetDashboardWithContext(ctx aws.Context, input *GetDashboardInput, opts ...request.Option) (*GetDashboardOutput, error) { + req, out := c.GetDashboardRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetInsightRuleReport = "GetInsightRuleReport" + +// GetInsightRuleReportRequest generates a "aws/request.Request" representing the +// client's request for the GetInsightRuleReport operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetInsightRuleReport for more information on using the GetInsightRuleReport +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetInsightRuleReportRequest method. +// req, resp := client.GetInsightRuleReportRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetInsightRuleReport +func (c *CloudWatch) GetInsightRuleReportRequest(input *GetInsightRuleReportInput) (req *request.Request, output *GetInsightRuleReportOutput) { + op := &request.Operation{ + Name: opGetInsightRuleReport, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetInsightRuleReportInput{} + } + + output = &GetInsightRuleReportOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetInsightRuleReport API operation for Amazon CloudWatch. +// +// This operation returns the time series data collected by a Contributor Insights +// rule. The data includes the identity and number of contributors to the log +// group. +// +// You can also optionally return one or more statistics about each data point +// in the time series. These statistics can include the following: +// +// * UniqueContributors -- the number of unique contributors for each data +// point. +// +// * MaxContributorValue -- the value of the top contributor for each data +// point. The identity of the contributor may change for each data point +// in the graph. If this rule aggregates by COUNT, the top contributor for +// each data point is the contributor with the most occurrences in that period. +// If the rule aggregates by SUM, the top contributor is the contributor +// with the highest sum in the log field specified by the rule's Value, during +// that period. +// +// * SampleCount -- the number of data points matched by the rule. +// +// * Sum -- the sum of the values from all contributors during the time period +// represented by that data point. +// +// * Minimum -- the minimum value from a single observation during the time +// period represented by that data point. +// +// * Maximum -- the maximum value from a single observation during the time +// period represented by that data point. +// +// * Average -- the average value from all contributors during the time period +// represented by that data point. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 GetInsightRuleReport 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. +// +// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// The named resource does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetInsightRuleReport +func (c *CloudWatch) GetInsightRuleReport(input *GetInsightRuleReportInput) (*GetInsightRuleReportOutput, error) { + req, out := c.GetInsightRuleReportRequest(input) + return out, req.Send() +} + +// GetInsightRuleReportWithContext is the same as GetInsightRuleReport with the addition of +// the ability to pass a context and additional request options. +// +// See GetInsightRuleReport for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatch) GetInsightRuleReportWithContext(ctx aws.Context, input *GetInsightRuleReportInput, opts ...request.Option) (*GetInsightRuleReportOutput, error) { + req, out := c.GetInsightRuleReportRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetMetricData = "GetMetricData" + +// GetMetricDataRequest generates a "aws/request.Request" representing the +// client's request for the GetMetricData operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetMetricData for more information on using the GetMetricData +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetMetricDataRequest method. +// req, resp := client.GetMetricDataRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/GetMetricData +func (c *CloudWatch) GetMetricDataRequest(input *GetMetricDataInput) (req *request.Request, output *GetMetricDataOutput) { + op := &request.Operation{ + Name: opGetMetricData, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxDatapoints", + TruncationToken: "", + }, + } + + if input == nil { + input = &GetMetricDataInput{} + } + + output = &GetMetricDataOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetMetricData API operation for Amazon CloudWatch. +// +// You can use the GetMetricData API to retrieve as many as 500 different metrics +// in a single request, with a total of as many as 100,800 data points. You +// can also optionally perform math expressions on the values of the returned +// statistics, to create new time series that represent new insights into your +// data. For example, using Lambda metrics, you could divide the Errors metric +// by the Invocations metric to get an error rate time series. For more information +// about metric math expressions, see Metric Math Syntax and Functions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/using-metric-math.html#metric-math-syntax) +// in the Amazon CloudWatch User Guide. +// +// Calls to the GetMetricData API have a different pricing structure than calls +// to GetMetricStatistics. For more information about pricing, see Amazon CloudWatch +// Pricing (https://aws.amazon.com/cloudwatch/pricing/). +// +// Amazon CloudWatch retains metric data as follows: // // * Data points with a period of less than 60 seconds are available for // 3 hours. These data points are high-resolution metrics and are available @@ -1117,10 +1649,12 @@ func (c *CloudWatch) GetMetricDataPagesWithContext(ctx aws.Context, input *GetMe }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetMetricDataOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetMetricDataOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1490,10 +2024,12 @@ func (c *CloudWatch) ListDashboardsPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDashboardsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDashboardsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1548,14 +2084,17 @@ func (c *CloudWatch) ListMetricsRequest(input *ListMetricsInput) (req *request.R // ListMetrics API operation for Amazon CloudWatch. // // List the specified metrics. You can use the returned metrics with GetMetricData -// or GetMetricStatistics to obtain statistical data. +// (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html) +// or GetMetricStatistics (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html) +// 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 -// GetMetricData or GetMetricStatistics. +// GetMetricData (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html) +// or GetMetricStatistics (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.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 @@ -1636,10 +2175,12 @@ func (c *CloudWatch) ListMetricsPagesWithContext(ctx aws.Context, input *ListMet }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListMetricsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListMetricsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1798,122 +2339,333 @@ func (c *CloudWatch) PutAnomalyDetectorRequest(input *PutAnomalyDetectorInput) ( // * ErrCodeMissingRequiredParameterException "MissingParameter" // An input parameter that is required is missing. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutAnomalyDetector -func (c *CloudWatch) PutAnomalyDetector(input *PutAnomalyDetectorInput) (*PutAnomalyDetectorOutput, error) { - req, out := c.PutAnomalyDetectorRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutAnomalyDetector +func (c *CloudWatch) PutAnomalyDetector(input *PutAnomalyDetectorInput) (*PutAnomalyDetectorOutput, error) { + req, out := c.PutAnomalyDetectorRequest(input) + return out, req.Send() +} + +// PutAnomalyDetectorWithContext is the same as PutAnomalyDetector with the addition of +// the ability to pass a context and additional request options. +// +// See PutAnomalyDetector for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatch) PutAnomalyDetectorWithContext(ctx aws.Context, input *PutAnomalyDetectorInput, opts ...request.Option) (*PutAnomalyDetectorOutput, error) { + req, out := c.PutAnomalyDetectorRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutCompositeAlarm = "PutCompositeAlarm" + +// PutCompositeAlarmRequest generates a "aws/request.Request" representing the +// client's request for the PutCompositeAlarm operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutCompositeAlarm for more information on using the PutCompositeAlarm +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutCompositeAlarmRequest method. +// req, resp := client.PutCompositeAlarmRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutCompositeAlarm +func (c *CloudWatch) PutCompositeAlarmRequest(input *PutCompositeAlarmInput) (req *request.Request, output *PutCompositeAlarmOutput) { + op := &request.Operation{ + Name: opPutCompositeAlarm, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutCompositeAlarmInput{} + } + + output = &PutCompositeAlarmOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutCompositeAlarm API operation for Amazon CloudWatch. +// +// Creates or updates a composite alarm. When you create a composite alarm, +// you specify a rule expression for the alarm that takes into account the alarm +// states of other alarms that you have created. The composite alarm goes into +// ALARM state only if all conditions of the rule are met. +// +// The alarms specified in a composite alarm's rule expression can include metric +// alarms and other composite alarms. +// +// Using composite alarms can reduce alarm noise. You can create multiple metric +// alarms, and also create a composite alarm and set up alerts only for the +// composite alarm. For example, you could create a composite alarm that goes +// into ALARM state only when more than one of the underlying metric alarms +// are in ALARM state. +// +// Currently, the only alarm actions that can be taken by composite alarms are +// notifying SNS topics. +// +// It is possible to create a loop or cycle of composite alarms, where composite +// alarm A depends on composite alarm B, and composite alarm B also depends +// on composite alarm A. In this scenario, you can't delete any composite alarm +// that is part of the cycle because there is always still a composite alarm +// that depends on that alarm that you want to delete. +// +// To get out of such a situation, you must break the cycle by changing the +// rule of one of the composite alarms in the cycle to remove a dependency that +// creates the cycle. The simplest change to make to break a cycle is to change +// the AlarmRule of one of the alarms to False. +// +// Additionally, the evaluation of composite alarms stops if CloudWatch detects +// a cycle in the evaluation path. +// +// When this operation creates an alarm, the alarm state is immediately set +// to INSUFFICIENT_DATA. The alarm is then evaluated and its state is set appropriately. +// Any actions associated with the new state are then executed. For a composite +// alarm, this initial time after creation is the only time that the alarm can +// be in INSUFFICIENT_DATA state. +// +// When you update an existing alarm, its state is left unchanged, but the update +// completely overwrites the previous configuration of 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 PutCompositeAlarm for usage and error information. +// +// Returned Error Codes: +// * ErrCodeLimitExceededFault "LimitExceeded" +// The quota for alarms for this customer has already been reached. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutCompositeAlarm +func (c *CloudWatch) PutCompositeAlarm(input *PutCompositeAlarmInput) (*PutCompositeAlarmOutput, error) { + req, out := c.PutCompositeAlarmRequest(input) + return out, req.Send() +} + +// PutCompositeAlarmWithContext is the same as PutCompositeAlarm with the addition of +// the ability to pass a context and additional request options. +// +// See PutCompositeAlarm for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CloudWatch) PutCompositeAlarmWithContext(ctx aws.Context, input *PutCompositeAlarmInput, opts ...request.Option) (*PutCompositeAlarmOutput, error) { + req, out := c.PutCompositeAlarmRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutDashboard = "PutDashboard" + +// PutDashboardRequest generates a "aws/request.Request" representing the +// client's request for the PutDashboard operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutDashboard for more information on using the PutDashboard +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutDashboardRequest method. +// req, resp := client.PutDashboardRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutDashboard +func (c *CloudWatch) PutDashboardRequest(input *PutDashboardInput) (req *request.Request, output *PutDashboardOutput) { + op := &request.Operation{ + Name: opPutDashboard, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutDashboardInput{} + } + + output = &PutDashboardOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutDashboard API operation for Amazon CloudWatch. +// +// Creates a dashboard if it does not already exist, or updates an existing +// dashboard. If you update a dashboard, the entire contents are replaced with +// what you specify here. +// +// All dashboards in your account are global, not region-specific. +// +// A simple way to create a dashboard using PutDashboard is to copy an existing +// dashboard. To copy an existing dashboard using the console, you can load +// the dashboard and then use the View/edit source command in the Actions menu +// to display the JSON block for that dashboard. Another way to copy a dashboard +// is to use GetDashboard, and then use the data returned within DashboardBody +// as the template for the new dashboard when you call PutDashboard. +// +// When you create a dashboard with PutDashboard, a good practice is to add +// a text widget at the top of the dashboard with a message that the dashboard +// was created by script and should not be changed in the console. This message +// could also point console users to the location of the DashboardBody script +// or the CloudFormation template used to create the dashboard. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 PutDashboard for usage and error information. +// +// Returned Error Codes: +// * ErrCodeDashboardInvalidInputError "InvalidParameterInput" +// Some part of the dashboard data is invalid. +// +// * ErrCodeInternalServiceFault "InternalServiceError" +// Request processing has failed due to some unknown error, exception, or failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutDashboard +func (c *CloudWatch) PutDashboard(input *PutDashboardInput) (*PutDashboardOutput, error) { + req, out := c.PutDashboardRequest(input) return out, req.Send() } -// PutAnomalyDetectorWithContext is the same as PutAnomalyDetector with the addition of +// PutDashboardWithContext is the same as PutDashboard with the addition of // the ability to pass a context and additional request options. // -// See PutAnomalyDetector for details on how to use this API operation. +// See PutDashboard for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudWatch) PutAnomalyDetectorWithContext(ctx aws.Context, input *PutAnomalyDetectorInput, opts ...request.Option) (*PutAnomalyDetectorOutput, error) { - req, out := c.PutAnomalyDetectorRequest(input) +func (c *CloudWatch) PutDashboardWithContext(ctx aws.Context, input *PutDashboardInput, opts ...request.Option) (*PutDashboardOutput, error) { + req, out := c.PutDashboardRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPutDashboard = "PutDashboard" +const opPutInsightRule = "PutInsightRule" -// PutDashboardRequest generates a "aws/request.Request" representing the -// client's request for the PutDashboard operation. The "output" return +// PutInsightRuleRequest generates a "aws/request.Request" representing the +// client's request for the PutInsightRule operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutDashboard for more information on using the PutDashboard +// See PutInsightRule for more information on using the PutInsightRule // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutDashboardRequest method. -// req, resp := client.PutDashboardRequest(params) +// // Example sending a request using the PutInsightRuleRequest method. +// req, resp := client.PutInsightRuleRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutDashboard -func (c *CloudWatch) PutDashboardRequest(input *PutDashboardInput) (req *request.Request, output *PutDashboardOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutInsightRule +func (c *CloudWatch) PutInsightRuleRequest(input *PutInsightRuleInput) (req *request.Request, output *PutInsightRuleOutput) { op := &request.Operation{ - Name: opPutDashboard, + Name: opPutInsightRule, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PutDashboardInput{} + input = &PutInsightRuleInput{} } - output = &PutDashboardOutput{} + output = &PutInsightRuleOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// PutDashboard API operation for Amazon CloudWatch. -// -// Creates a dashboard if it does not already exist, or updates an existing -// dashboard. If you update a dashboard, the entire contents are replaced with -// what you specify here. -// -// All dashboards in your account are global, not region-specific. +// PutInsightRule API operation for Amazon CloudWatch. // -// A simple way to create a dashboard using PutDashboard is to copy an existing -// dashboard. To copy an existing dashboard using the console, you can load -// the dashboard and then use the View/edit source command in the Actions menu -// to display the JSON block for that dashboard. Another way to copy a dashboard -// is to use GetDashboard, and then use the data returned within DashboardBody -// as the template for the new dashboard when you call PutDashboard. +// Creates a Contributor Insights rule. Rules evaluate log events in a CloudWatch +// Logs log group, enabling you to find contributor data for the log events +// in that log group. For more information, see Using Contributor Insights to +// Analyze High-Cardinality Data (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights.html). // -// When you create a dashboard with PutDashboard, a good practice is to add -// a text widget at the top of the dashboard with a message that the dashboard -// was created by script and should not be changed in the console. This message -// could also point console users to the location of the DashboardBody script -// or the CloudFormation template used to create the dashboard. +// If you create a rule, delete it, and then re-create it with the same name, +// historical data from the first time the rule was created may or may not be +// 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 CloudWatch's -// API operation PutDashboard for usage and error information. +// API operation PutInsightRule for usage and error information. // // Returned Error Codes: -// * ErrCodeDashboardInvalidInputError "InvalidParameterInput" -// Some part of the dashboard data is invalid. +// * ErrCodeInvalidParameterValueException "InvalidParameterValue" +// The value of an input parameter is bad or out-of-range. // -// * ErrCodeInternalServiceFault "InternalServiceError" -// Request processing has failed due to some unknown error, exception, or failure. +// * ErrCodeMissingRequiredParameterException "MissingParameter" +// An input parameter that is required is missing. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutDashboard -func (c *CloudWatch) PutDashboard(input *PutDashboardInput) (*PutDashboardOutput, error) { - req, out := c.PutDashboardRequest(input) +// * ErrCodeLimitExceededException "LimitExceededException" +// The operation exceeded one or more limits. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/PutInsightRule +func (c *CloudWatch) PutInsightRule(input *PutInsightRuleInput) (*PutInsightRuleOutput, error) { + req, out := c.PutInsightRuleRequest(input) return out, req.Send() } -// PutDashboardWithContext is the same as PutDashboard with the addition of +// PutInsightRuleWithContext is the same as PutInsightRule with the addition of // the ability to pass a context and additional request options. // -// See PutDashboard for details on how to use this API operation. +// See PutInsightRule for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CloudWatch) PutDashboardWithContext(ctx aws.Context, input *PutDashboardInput, opts ...request.Option) (*PutDashboardOutput, error) { - req, out := c.PutDashboardRequest(input) +func (c *CloudWatch) PutInsightRuleWithContext(ctx aws.Context, input *PutInsightRuleInput, opts ...request.Option) (*PutInsightRuleOutput, error) { + req, out := c.PutInsightRuleRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() @@ -2089,7 +2841,8 @@ func (c *CloudWatch) PutMetricDataRequest(input *PutMetricDataInput) (req *reque // Publishes metric data points to Amazon CloudWatch. CloudWatch associates // the data points with the specified metric. If the specified metric does not // exist, CloudWatch creates the metric. When CloudWatch creates a metric, it -// can take up to fifteen minutes for the metric to appear in calls to ListMetrics. +// can take up to fifteen minutes for the metric to appear in calls to ListMetrics +// (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html). // // You can publish either individual data points in the Value field, or arrays // of values and the number of times each value occurred during the period by @@ -2104,9 +2857,8 @@ func (c *CloudWatch) PutMetricDataRequest(input *PutMetricDataInput) (req *reque // // Although the Value parameter accepts numbers of type Double, 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. +// of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, +// -Infinity) are not supported. // // You can use up to 10 dimensions per metric to further clarify what data the // metric collects. Each dimension consists of a Name and Value pair. For more @@ -2114,8 +2866,12 @@ func (c *CloudWatch) PutMetricDataRequest(input *PutMetricDataInput) (req *reque // in the Amazon CloudWatch User Guide. // // Data points with time stamps from 24 hours ago or longer can take at least -// 48 hours to become available for GetMetricData or GetMetricStatistics from -// the time they are submitted. +// 48 hours to become available for GetMetricData (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html) +// or GetMetricStatistics (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html) +// from the time they are submitted. Data points with time stamps between 3 +// and 24 hours ago can take as much as 2 hours to become available for for +// GetMetricData (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricData.html) +// or GetMetricStatistics (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetMetricStatistics.html). // // CloudWatch needs raw data points to calculate percentile statistics. If you // publish data using a statistic set instead, you can only retrieve percentile @@ -2217,10 +2973,21 @@ func (c *CloudWatch) SetAlarmStateRequest(input *SetAlarmStateInput) (req *reque // 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 SNS message. The alarm returns to its actual state (often -// within seconds). Because the alarm state change happens quickly, it is typically -// only visible in the alarm's History tab in the Amazon CloudWatch console -// or through DescribeAlarmHistory. +// to ALARM sends an SNS message. +// +// Metric alarms returns to their actual state quickly, often within seconds. +// Because the metric alarm state change happens quickly, it is typically only +// visible in the alarm's History tab in the Amazon CloudWatch console or through +// DescribeAlarmHistory (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarmHistory.html). +// +// If you use SetAlarmState on a composite alarm, the composite alarm is not +// guaranteed to return to its actual state. It will return to its actual state +// only once any of its children alarms change state. It is also re-evaluated +// if you update its configuration. +// +// If an alarm triggers EC2 Auto Scaling policies or application Auto Scaling +// policies, you must include information in the StateReasonData parameter to +// enable the policy to take the correct 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 @@ -2304,19 +3071,20 @@ func (c *CloudWatch) TagResourceRequest(input *TagResourceInput) (req *request.R // TagResource API operation for Amazon CloudWatch. // // Assigns one or more tags (key-value pairs) to the specified CloudWatch resource. +// Currently, the only CloudWatch resources that can be tagged are alarms. +// // Tags can help you organize and categorize your resources. You can also use // them to scope user permissions, by granting a user permission to access or -// change only resources with certain tag values. In CloudWatch, alarms can -// be tagged. +// change only resources with certain tag values. // // Tags don't have any semantic meaning to AWS and are interpreted strictly // as strings of characters. // -// You can use the TagResource action with a resource that already has tags. -// If you specify a new tag key for the resource, this tag is appended to the -// list of tags associated with the resource. If you specify a tag key that -// is already associated with the resource, the new tag value that you specify -// replaces the previous value for that tag. +// You can use the TagResource action with an alarm that already has tags. If +// you specify a new tag key for the alarm, this tag is appended to the list +// of tags associated with the alarm. If you specify a tag key that is already +// associated with the alarm, the new tag value that you specify replaces the +// previous value for that tag. // // You can associate as many as 50 tags with a resource. // @@ -2458,6 +3226,9 @@ type AlarmHistoryItem struct { // The descriptive name for the alarm. AlarmName *string `min:"1" type:"string"` + // The type of alarm, either metric alarm or composite alarm. + AlarmType *string `type:"string" enum:"AlarmType"` + // Data about the alarm, in JSON format. HistoryData *string `min:"1" type:"string"` @@ -2487,6 +3258,12 @@ func (s *AlarmHistoryItem) SetAlarmName(v string) *AlarmHistoryItem { return s } +// SetAlarmType sets the AlarmType field's value. +func (s *AlarmHistoryItem) SetAlarmType(v string) *AlarmHistoryItem { + s.AlarmType = &v + return s +} + // SetHistoryData sets the HistoryData field's value. func (s *AlarmHistoryItem) SetHistoryData(v string) *AlarmHistoryItem { s.HistoryData = &v @@ -2512,7 +3289,7 @@ func (s *AlarmHistoryItem) SetTimestamp(v time.Time) *AlarmHistoryItem { } // An anomaly detection model associated with a particular CloudWatch metric -// athresnd statistic. You can use the model to display a band of expected normal +// and statistic. You can use the model to display a band of expected normal // values when the metric is graphed. type AnomalyDetector struct { _ struct{} `type:"structure"` @@ -2533,6 +3310,10 @@ type AnomalyDetector struct { // The statistic associated with the anomaly detection model. Stat *string `type:"string"` + + // The current status of the anomaly detector's training. The possible values + // are TRAINED | PENDING_TRAINING | TRAINED_INSUFFICIENT_DATA + StateValue *string `type:"string" enum:"AnomalyDetectorStateValue"` } // String returns the string representation @@ -2575,6 +3356,12 @@ func (s *AnomalyDetector) SetStat(v string) *AnomalyDetector { return s } +// SetStateValue sets the StateValue field's value. +func (s *AnomalyDetector) SetStateValue(v string) *AnomalyDetector { + s.StateValue = &v + return s +} + // The configuration specifies details about how the anomaly detection model // is to be trained, including time ranges to exclude from use for training // the model and the time zone to use for the metric. @@ -2638,6 +3425,143 @@ func (s *AnomalyDetectorConfiguration) SetMetricTimezone(v string) *AnomalyDetec return s } +// The details about a composite alarm. +type CompositeAlarm 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"` + + // The description of the alarm. + AlarmDescription *string `type:"string"` + + // The name of the alarm. + AlarmName *string `min:"1" type:"string"` + + // The rule that this alarm uses to evaluate its alarm state. + AlarmRule *string `min:"1" 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 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"` + + // 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"` + + // The state value for the alarm. + StateValue *string `type:"string" enum:"StateValue"` +} + +// String returns the string representation +func (s CompositeAlarm) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CompositeAlarm) GoString() string { + return s.String() +} + +// SetActionsEnabled sets the ActionsEnabled field's value. +func (s *CompositeAlarm) SetActionsEnabled(v bool) *CompositeAlarm { + s.ActionsEnabled = &v + return s +} + +// SetAlarmActions sets the AlarmActions field's value. +func (s *CompositeAlarm) SetAlarmActions(v []*string) *CompositeAlarm { + s.AlarmActions = v + return s +} + +// SetAlarmArn sets the AlarmArn field's value. +func (s *CompositeAlarm) SetAlarmArn(v string) *CompositeAlarm { + s.AlarmArn = &v + return s +} + +// SetAlarmConfigurationUpdatedTimestamp sets the AlarmConfigurationUpdatedTimestamp field's value. +func (s *CompositeAlarm) SetAlarmConfigurationUpdatedTimestamp(v time.Time) *CompositeAlarm { + s.AlarmConfigurationUpdatedTimestamp = &v + return s +} + +// SetAlarmDescription sets the AlarmDescription field's value. +func (s *CompositeAlarm) SetAlarmDescription(v string) *CompositeAlarm { + s.AlarmDescription = &v + return s +} + +// SetAlarmName sets the AlarmName field's value. +func (s *CompositeAlarm) SetAlarmName(v string) *CompositeAlarm { + s.AlarmName = &v + return s +} + +// SetAlarmRule sets the AlarmRule field's value. +func (s *CompositeAlarm) SetAlarmRule(v string) *CompositeAlarm { + s.AlarmRule = &v + return s +} + +// SetInsufficientDataActions sets the InsufficientDataActions field's value. +func (s *CompositeAlarm) SetInsufficientDataActions(v []*string) *CompositeAlarm { + s.InsufficientDataActions = v + return s +} + +// SetOKActions sets the OKActions field's value. +func (s *CompositeAlarm) SetOKActions(v []*string) *CompositeAlarm { + s.OKActions = v + return s +} + +// SetStateReason sets the StateReason field's value. +func (s *CompositeAlarm) SetStateReason(v string) *CompositeAlarm { + s.StateReason = &v + return s +} + +// SetStateReasonData sets the StateReasonData field's value. +func (s *CompositeAlarm) SetStateReasonData(v string) *CompositeAlarm { + s.StateReasonData = &v + return s +} + +// SetStateUpdatedTimestamp sets the StateUpdatedTimestamp field's value. +func (s *CompositeAlarm) SetStateUpdatedTimestamp(v time.Time) *CompositeAlarm { + s.StateUpdatedTimestamp = &v + return s +} + +// SetStateValue sets the StateValue field's value. +func (s *CompositeAlarm) SetStateValue(v string) *CompositeAlarm { + s.StateValue = &v + return s +} + // Represents a specific dashboard. type DashboardEntry struct { _ struct{} `type:"structure"` @@ -3021,12 +3945,80 @@ func (s DeleteDashboardsOutput) GoString() string { return s.String() } +type DeleteInsightRulesInput struct { + _ struct{} `type:"structure"` + + // An array of the rule names to delete. If you need to find out the names of + // your rules, use DescribeInsightRules (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html). + // + // RuleNames is a required field + RuleNames []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s DeleteInsightRulesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteInsightRulesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteInsightRulesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteInsightRulesInput"} + if s.RuleNames == nil { + invalidParams.Add(request.NewErrParamRequired("RuleNames")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRuleNames sets the RuleNames field's value. +func (s *DeleteInsightRulesInput) SetRuleNames(v []*string) *DeleteInsightRulesInput { + s.RuleNames = v + return s +} + +type DeleteInsightRulesOutput struct { + _ struct{} `type:"structure"` + + // An array listing the rules that could not be deleted. You cannot delete built-in + // rules. + Failures []*PartialFailure `type:"list"` +} + +// String returns the string representation +func (s DeleteInsightRulesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteInsightRulesOutput) GoString() string { + return s.String() +} + +// SetFailures sets the Failures field's value. +func (s *DeleteInsightRulesOutput) SetFailures(v []*PartialFailure) *DeleteInsightRulesOutput { + s.Failures = v + return s +} + type DescribeAlarmHistoryInput struct { _ struct{} `type:"structure"` // The name of the alarm. AlarmName *string `min:"1" type:"string"` + // Use this parameter to specify whether you want the operation to return metric + // alarms or composite alarms. If you omit this parameter, only metric alarms + // are returned. + AlarmTypes []*string `type:"list"` + // The ending date to retrieve alarm history. EndDate *time.Time `type:"timestamp"` @@ -3040,6 +4032,11 @@ type DescribeAlarmHistoryInput struct { // available. NextToken *string `type:"string"` + // Specified whether to return the newest or oldest alarm history first. Specify + // TimestampDescending to have the newest event history returned first, and + // specify TimestampAscending to have the oldest history returned first. + ScanBy *string `type:"string" enum:"ScanBy"` + // The starting date to retrieve alarm history. StartDate *time.Time `type:"timestamp"` } @@ -3076,6 +4073,12 @@ func (s *DescribeAlarmHistoryInput) SetAlarmName(v string) *DescribeAlarmHistory return s } +// SetAlarmTypes sets the AlarmTypes field's value. +func (s *DescribeAlarmHistoryInput) SetAlarmTypes(v []*string) *DescribeAlarmHistoryInput { + s.AlarmTypes = v + return s +} + // SetEndDate sets the EndDate field's value. func (s *DescribeAlarmHistoryInput) SetEndDate(v time.Time) *DescribeAlarmHistoryInput { s.EndDate = &v @@ -3100,6 +4103,12 @@ func (s *DescribeAlarmHistoryInput) SetNextToken(v string) *DescribeAlarmHistory return s } +// SetScanBy sets the ScanBy field's value. +func (s *DescribeAlarmHistoryInput) SetScanBy(v string) *DescribeAlarmHistoryInput { + s.ScanBy = &v + return s +} + // SetStartDate sets the StartDate field's value. func (s *DescribeAlarmHistoryInput) SetStartDate(v time.Time) *DescribeAlarmHistoryInput { s.StartDate = &v @@ -3283,16 +4292,42 @@ func (s *DescribeAlarmsForMetricOutput) SetMetricAlarms(v []*MetricAlarm) *Descr type DescribeAlarmsInput struct { _ struct{} `type:"structure"` - // The action name prefix. + // Use this parameter to filter the results of the operation to only those alarms + // that use a certain alarm action. For example, you could specify the ARN of + // an SNS topic to find all alarms that send notifications to that topic. ActionPrefix *string `min:"1" type:"string"` - // The alarm name prefix. If this parameter is specified, you cannot specify - // AlarmNames. + // An alarm name prefix. If you specify this parameter, you receive information + // about all alarms that have names that start with this prefix. + // + // If this parameter is specified, you cannot specify AlarmNames. AlarmNamePrefix *string `min:"1" type:"string"` - // The names of the alarms. + // The names of the alarms to retrieve information about. AlarmNames []*string `type:"list"` + // Use this parameter to specify whether you want the operation to return metric + // alarms or composite alarms. If you omit this parameter, only metric alarms + // are returned. + AlarmTypes []*string `type:"list"` + + // If you use this parameter and specify the name of a composite alarm, the + // operation returns information about the "children" alarms of the alarm you + // specify. These are the metric alarms and composite alarms referenced in the + // AlarmRule field of the composite alarm that you specify in ChildrenOfAlarmName. + // Information about the composite alarm that you name in ChildrenOfAlarmName + // is not returned. + // + // If you specify ChildrenOfAlarmName, you cannot specify any other parameters + // in the request except for MaxRecords and NextToken. If you do so, you will + // receive a validation error. + // + // Only the Alarm Name, ARN, StateValue (OK/ALARM/INSUFFICIENT_DATA), and StateUpdatedTimestamp + // information are returned by this operation when you use this parameter. To + // get complete information about these alarms, perform another DescribeAlarms + // operation and specify the parent alarm names in the AlarmNames parameter. + ChildrenOfAlarmName *string `min:"1" type:"string"` + // The maximum number of alarm descriptions to retrieve. MaxRecords *int64 `min:"1" type:"integer"` @@ -3300,7 +4335,24 @@ type DescribeAlarmsInput struct { // available. NextToken *string `type:"string"` - // The state value to be used in matching alarms. + // If you use this parameter and specify the name of a metric or composite alarm, + // the operation returns information about the "parent" alarms of the alarm + // you specify. These are the composite alarms that have AlarmRule parameters + // that reference the alarm named in ParentsOfAlarmName. Information about the + // alarm that you specify in ParentsOfAlarmName is not returned. + // + // If you specify ParentsOfAlarmName, you cannot specify any other parameters + // in the request except for MaxRecords and NextToken. If you do so, you will + // receive a validation error. + // + // Only the Alarm Name and ARN are returned by this operation when you use this + // parameter. To get complete information about these alarms, perform another + // DescribeAlarms operation and specify the parent alarm names in the AlarmNames + // parameter. + ParentsOfAlarmName *string `min:"1" type:"string"` + + // Specify this parameter to receive information only about alarms that are + // currently in the state that you specify. StateValue *string `type:"string" enum:"StateValue"` } @@ -3323,9 +4375,15 @@ func (s *DescribeAlarmsInput) Validate() error { if s.AlarmNamePrefix != nil && len(*s.AlarmNamePrefix) < 1 { invalidParams.Add(request.NewErrParamMinLen("AlarmNamePrefix", 1)) } + if s.ChildrenOfAlarmName != nil && len(*s.ChildrenOfAlarmName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChildrenOfAlarmName", 1)) + } if s.MaxRecords != nil && *s.MaxRecords < 1 { invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 1)) } + if s.ParentsOfAlarmName != nil && len(*s.ParentsOfAlarmName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ParentsOfAlarmName", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -3351,6 +4409,18 @@ func (s *DescribeAlarmsInput) SetAlarmNames(v []*string) *DescribeAlarmsInput { return s } +// SetAlarmTypes sets the AlarmTypes field's value. +func (s *DescribeAlarmsInput) SetAlarmTypes(v []*string) *DescribeAlarmsInput { + s.AlarmTypes = v + return s +} + +// SetChildrenOfAlarmName sets the ChildrenOfAlarmName field's value. +func (s *DescribeAlarmsInput) SetChildrenOfAlarmName(v string) *DescribeAlarmsInput { + s.ChildrenOfAlarmName = &v + return s +} + // SetMaxRecords sets the MaxRecords field's value. func (s *DescribeAlarmsInput) SetMaxRecords(v int64) *DescribeAlarmsInput { s.MaxRecords = &v @@ -3363,6 +4433,12 @@ func (s *DescribeAlarmsInput) SetNextToken(v string) *DescribeAlarmsInput { return s } +// SetParentsOfAlarmName sets the ParentsOfAlarmName field's value. +func (s *DescribeAlarmsInput) SetParentsOfAlarmName(v string) *DescribeAlarmsInput { + s.ParentsOfAlarmName = &v + return s +} + // SetStateValue sets the StateValue field's value. func (s *DescribeAlarmsInput) SetStateValue(v string) *DescribeAlarmsInput { s.StateValue = &v @@ -3372,7 +4448,10 @@ func (s *DescribeAlarmsInput) SetStateValue(v string) *DescribeAlarmsInput { type DescribeAlarmsOutput struct { _ struct{} `type:"structure"` - // The information for the specified alarms. + // The information about any composite alarms returned by the operation. + CompositeAlarms []*CompositeAlarm `type:"list"` + + // The information about any metric alarms returned by the operation. MetricAlarms []*MetricAlarm `type:"list"` // The token that marks the start of the next batch of returned results. @@ -3389,6 +4468,12 @@ func (s DescribeAlarmsOutput) GoString() string { return s.String() } +// SetCompositeAlarms sets the CompositeAlarms field's value. +func (s *DescribeAlarmsOutput) SetCompositeAlarms(v []*CompositeAlarm) *DescribeAlarmsOutput { + s.CompositeAlarms = v + return s +} + // SetMetricAlarms sets the MetricAlarms field's value. func (s *DescribeAlarmsOutput) SetMetricAlarms(v []*MetricAlarm) *DescribeAlarmsOutput { s.MetricAlarms = v @@ -3411,7 +4496,7 @@ type DescribeAnomalyDetectorsInput struct { Dimensions []*Dimension `type:"list"` // The maximum number of results to return in one operation. The maximum value - // you can specify is 10. + // that you can specify is 100. // // To retrieve the remaining results, make another call with the returned NextToken // value. @@ -3533,6 +4618,84 @@ func (s *DescribeAnomalyDetectorsOutput) SetNextToken(v string) *DescribeAnomaly return s } +type DescribeInsightRulesInput struct { + _ struct{} `type:"structure"` + + // This parameter is not currently used. Reserved for future use. If it is used + // in the future, the maximum value may be different. + MaxResults *int64 `min:"1" type:"integer"` + + // Reserved for future use. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeInsightRulesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInsightRulesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeInsightRulesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeInsightRulesInput"} + 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 *DescribeInsightRulesInput) SetMaxResults(v int64) *DescribeInsightRulesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeInsightRulesInput) SetNextToken(v string) *DescribeInsightRulesInput { + s.NextToken = &v + return s +} + +type DescribeInsightRulesOutput struct { + _ struct{} `type:"structure"` + + // The rules returned by the operation. + InsightRules []*InsightRule `type:"list"` + + // Reserved for future use. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeInsightRulesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInsightRulesOutput) GoString() string { + return s.String() +} + +// SetInsightRules sets the InsightRules field's value. +func (s *DescribeInsightRulesOutput) SetInsightRules(v []*InsightRule) *DescribeInsightRulesOutput { + s.InsightRules = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeInsightRulesOutput) SetNextToken(v string) *DescribeInsightRulesOutput { + s.NextToken = &v + return s +} + // Expands the identity of a metric. type Dimension struct { _ struct{} `type:"structure"` @@ -3698,6 +4861,69 @@ func (s DisableAlarmActionsOutput) GoString() string { return s.String() } +type DisableInsightRulesInput struct { + _ struct{} `type:"structure"` + + // An array of the rule names to disable. If you need to find out the names + // of your rules, use DescribeInsightRules (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html). + // + // RuleNames is a required field + RuleNames []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s DisableInsightRulesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableInsightRulesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisableInsightRulesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisableInsightRulesInput"} + if s.RuleNames == nil { + invalidParams.Add(request.NewErrParamRequired("RuleNames")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRuleNames sets the RuleNames field's value. +func (s *DisableInsightRulesInput) SetRuleNames(v []*string) *DisableInsightRulesInput { + s.RuleNames = v + return s +} + +type DisableInsightRulesOutput struct { + _ struct{} `type:"structure"` + + // An array listing the rules that could not be disabled. You cannot disable + // built-in rules. + Failures []*PartialFailure `type:"list"` +} + +// String returns the string representation +func (s DisableInsightRulesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableInsightRulesOutput) GoString() string { + return s.String() +} + +// SetFailures sets the Failures field's value. +func (s *DisableInsightRulesOutput) SetFailures(v []*PartialFailure) *DisableInsightRulesOutput { + s.Failures = v + return s +} + type EnableAlarmActionsInput struct { _ struct{} `type:"structure"` @@ -3740,40 +4966,257 @@ type EnableAlarmActionsOutput struct { _ struct{} `type:"structure"` } -// String returns the string representation -func (s EnableAlarmActionsOutput) String() string { - return awsutil.Prettify(s) -} +// 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() +} + +type EnableInsightRulesInput struct { + _ struct{} `type:"structure"` + + // An array of the rule names to enable. If you need to find out the names of + // your rules, use DescribeInsightRules (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeInsightRules.html). + // + // RuleNames is a required field + RuleNames []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s EnableInsightRulesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableInsightRulesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EnableInsightRulesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EnableInsightRulesInput"} + if s.RuleNames == nil { + invalidParams.Add(request.NewErrParamRequired("RuleNames")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRuleNames sets the RuleNames field's value. +func (s *EnableInsightRulesInput) SetRuleNames(v []*string) *EnableInsightRulesInput { + s.RuleNames = v + return s +} + +type EnableInsightRulesOutput struct { + _ struct{} `type:"structure"` + + // An array listing the rules that could not be enabled. You cannot disable + // or enable built-in rules. + Failures []*PartialFailure `type:"list"` +} + +// String returns the string representation +func (s EnableInsightRulesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableInsightRulesOutput) GoString() string { + return s.String() +} + +// SetFailures sets the Failures field's value. +func (s *EnableInsightRulesOutput) SetFailures(v []*PartialFailure) *EnableInsightRulesOutput { + s.Failures = v + return s +} + +type GetDashboardInput struct { + _ struct{} `type:"structure"` + + // The name of the dashboard to be described. + // + // DashboardName is a required field + DashboardName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s GetDashboardInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDashboardInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetDashboardInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetDashboardInput"} + if s.DashboardName == nil { + invalidParams.Add(request.NewErrParamRequired("DashboardName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDashboardName sets the DashboardName field's value. +func (s *GetDashboardInput) SetDashboardName(v string) *GetDashboardInput { + s.DashboardName = &v + return s +} + +type GetDashboardOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the dashboard. + DashboardArn *string `type:"string"` + + // The detailed information about the dashboard, including what widgets are + // included and their location on the dashboard. For more information about + // the DashboardBody syntax, see Dashboard Body Structure and Syntax (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html). + DashboardBody *string `type:"string"` + + // The name of the dashboard. + DashboardName *string `type:"string"` +} + +// String returns the string representation +func (s GetDashboardOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDashboardOutput) GoString() string { + return s.String() +} + +// SetDashboardArn sets the DashboardArn field's value. +func (s *GetDashboardOutput) SetDashboardArn(v string) *GetDashboardOutput { + s.DashboardArn = &v + return s +} + +// SetDashboardBody sets the DashboardBody field's value. +func (s *GetDashboardOutput) SetDashboardBody(v string) *GetDashboardOutput { + s.DashboardBody = &v + return s +} + +// SetDashboardName sets the DashboardName field's value. +func (s *GetDashboardOutput) SetDashboardName(v string) *GetDashboardOutput { + s.DashboardName = &v + return s +} + +type GetInsightRuleReportInput struct { + _ struct{} `type:"structure"` + + // The end time of the data to use in the report. When used in a raw HTTP Query + // API, it is formatted as yyyy-MM-dd'T'HH:mm:ss. For example, 2019-07-01T23:59:59. + // + // EndTime is a required field + EndTime *time.Time `type:"timestamp" required:"true"` + + // The maximum number of contributors to include in the report. The range is + // 1 to 100. If you omit this, the default of 10 is used. + MaxContributorCount *int64 `type:"integer"` + + // Specifies which metrics to use for aggregation of contributor values for + // the report. You can specify one or more of the following metrics: + // + // * UniqueContributors -- the number of unique contributors for each data + // point. + // + // * MaxContributorValue -- the value of the top contributor for each data + // point. The identity of the contributor may change for each data point + // in the graph. If this rule aggregates by COUNT, the top contributor for + // each data point is the contributor with the most occurrences in that period. + // If the rule aggregates by SUM, the top contributor is the contributor + // with the highest sum in the log field specified by the rule's Value, during + // that period. + // + // * SampleCount -- the number of data points matched by the rule. + // + // * Sum -- the sum of the values from all contributors during the time period + // represented by that data point. + // + // * Minimum -- the minimum value from a single observation during the time + // period represented by that data point. + // + // * Maximum -- the maximum value from a single observation during the time + // period represented by that data point. + // + // * Average -- the average value from all contributors during the time period + // represented by that data point. + Metrics []*string `type:"list"` + + // Determines what statistic to use to rank the contributors. Valid values are + // SUM and MAXIMUM. + OrderBy *string `min:"1" type:"string"` -// GoString returns the string representation -func (s EnableAlarmActionsOutput) GoString() string { - return s.String() -} + // The period, in seconds, to use for the statistics in the InsightRuleMetricDatapoint + // results. + // + // Period is a required field + Period *int64 `min:"1" type:"integer" required:"true"` -type GetDashboardInput struct { - _ struct{} `type:"structure"` + // The name of the rule that you want to see data from. + // + // RuleName is a required field + RuleName *string `min:"1" type:"string" required:"true"` - // The name of the dashboard to be described. + // The start time of the data to use in the report. When used in a raw HTTP + // Query API, it is formatted as yyyy-MM-dd'T'HH:mm:ss. For example, 2019-07-01T23:59:59. // - // DashboardName is a required field - DashboardName *string `type:"string" required:"true"` + // StartTime is a required field + StartTime *time.Time `type:"timestamp" required:"true"` } // String returns the string representation -func (s GetDashboardInput) String() string { +func (s GetInsightRuleReportInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDashboardInput) GoString() string { +func (s GetInsightRuleReportInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetDashboardInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDashboardInput"} - if s.DashboardName == nil { - invalidParams.Add(request.NewErrParamRequired("DashboardName")) +func (s *GetInsightRuleReportInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetInsightRuleReportInput"} + if s.EndTime == nil { + invalidParams.Add(request.NewErrParamRequired("EndTime")) + } + if s.OrderBy != nil && len(*s.OrderBy) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OrderBy", 1)) + } + if s.Period == nil { + invalidParams.Add(request.NewErrParamRequired("Period")) + } + if s.Period != nil && *s.Period < 1 { + invalidParams.Add(request.NewErrParamMinValue("Period", 1)) + } + if s.RuleName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleName")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + if s.StartTime == nil { + invalidParams.Add(request.NewErrParamRequired("StartTime")) } if invalidParams.Len() > 0 { @@ -3782,52 +5225,120 @@ func (s *GetDashboardInput) Validate() error { return nil } -// SetDashboardName sets the DashboardName field's value. -func (s *GetDashboardInput) SetDashboardName(v string) *GetDashboardInput { - s.DashboardName = &v +// SetEndTime sets the EndTime field's value. +func (s *GetInsightRuleReportInput) SetEndTime(v time.Time) *GetInsightRuleReportInput { + s.EndTime = &v return s } -type GetDashboardOutput struct { +// SetMaxContributorCount sets the MaxContributorCount field's value. +func (s *GetInsightRuleReportInput) SetMaxContributorCount(v int64) *GetInsightRuleReportInput { + s.MaxContributorCount = &v + return s +} + +// SetMetrics sets the Metrics field's value. +func (s *GetInsightRuleReportInput) SetMetrics(v []*string) *GetInsightRuleReportInput { + s.Metrics = v + return s +} + +// SetOrderBy sets the OrderBy field's value. +func (s *GetInsightRuleReportInput) SetOrderBy(v string) *GetInsightRuleReportInput { + s.OrderBy = &v + return s +} + +// SetPeriod sets the Period field's value. +func (s *GetInsightRuleReportInput) SetPeriod(v int64) *GetInsightRuleReportInput { + s.Period = &v + return s +} + +// SetRuleName sets the RuleName field's value. +func (s *GetInsightRuleReportInput) SetRuleName(v string) *GetInsightRuleReportInput { + s.RuleName = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *GetInsightRuleReportInput) SetStartTime(v time.Time) *GetInsightRuleReportInput { + s.StartTime = &v + return s +} + +type GetInsightRuleReportOutput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the dashboard. - DashboardArn *string `type:"string"` + // The sum of the values from all individual contributors that match the rule. + AggregateValue *float64 `type:"double"` - // The detailed information about the dashboard, including what widgets are - // included and their location on the dashboard. For more information about - // the DashboardBody syntax, see CloudWatch-Dashboard-Body-Structure. - DashboardBody *string `type:"string"` + // Specifies whether this rule aggregates contributor data by COUNT or SUM. + AggregationStatistic *string `type:"string"` - // The name of the dashboard. - DashboardName *string `type:"string"` + // An approximate count of the unique contributors found by this rule in this + // time period. + ApproximateUniqueCount *int64 `type:"long"` + + // An array of the unique contributors found by this rule in this time period. + // If the rule contains multiple keys, each combination of values for the keys + // counts as a unique contributor. + Contributors []*InsightRuleContributor `type:"list"` + + // An array of the strings used as the keys for this rule. The keys are the + // dimensions used to classify contributors. If the rule contains more than + // one key, then each unique combination of values for the keys is counted as + // a unique contributor. + KeyLabels []*string `type:"list"` + + // A time series of metric data points that matches the time period in the rule + // request. + MetricDatapoints []*InsightRuleMetricDatapoint `type:"list"` } // String returns the string representation -func (s GetDashboardOutput) String() string { +func (s GetInsightRuleReportOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDashboardOutput) GoString() string { +func (s GetInsightRuleReportOutput) GoString() string { return s.String() } -// SetDashboardArn sets the DashboardArn field's value. -func (s *GetDashboardOutput) SetDashboardArn(v string) *GetDashboardOutput { - s.DashboardArn = &v +// SetAggregateValue sets the AggregateValue field's value. +func (s *GetInsightRuleReportOutput) SetAggregateValue(v float64) *GetInsightRuleReportOutput { + s.AggregateValue = &v return s } -// SetDashboardBody sets the DashboardBody field's value. -func (s *GetDashboardOutput) SetDashboardBody(v string) *GetDashboardOutput { - s.DashboardBody = &v +// SetAggregationStatistic sets the AggregationStatistic field's value. +func (s *GetInsightRuleReportOutput) SetAggregationStatistic(v string) *GetInsightRuleReportOutput { + s.AggregationStatistic = &v return s } -// SetDashboardName sets the DashboardName field's value. -func (s *GetDashboardOutput) SetDashboardName(v string) *GetDashboardOutput { - s.DashboardName = &v +// SetApproximateUniqueCount sets the ApproximateUniqueCount field's value. +func (s *GetInsightRuleReportOutput) SetApproximateUniqueCount(v int64) *GetInsightRuleReportOutput { + s.ApproximateUniqueCount = &v + return s +} + +// SetContributors sets the Contributors field's value. +func (s *GetInsightRuleReportOutput) SetContributors(v []*InsightRuleContributor) *GetInsightRuleReportOutput { + s.Contributors = v + return s +} + +// SetKeyLabels sets the KeyLabels field's value. +func (s *GetInsightRuleReportOutput) SetKeyLabels(v []*string) *GetInsightRuleReportOutput { + s.KeyLabels = v + return s +} + +// SetMetricDatapoints sets the MetricDatapoints field's value. +func (s *GetInsightRuleReportOutput) SetMetricDatapoints(v []*InsightRuleMetricDatapoint) *GetInsightRuleReportOutput { + s.MetricDatapoints = v return s } @@ -3853,7 +5364,7 @@ type GetMetricDataInput struct { MaxDatapoints *int64 `type:"integer"` // The metric queries to be returned. A single GetMetricData call can include - // as many as 100 MetricDataQuery structures. Each of these structures can specify + // as many as 500 MetricDataQuery structures. Each of these structures can specify // either a metric to retrieve, or a math expression to perform on retrieved // data. // @@ -4045,7 +5556,8 @@ type GetMetricStatisticsInput struct { // The time stamp that determines the last data point to return. // // The value specified is exclusive; results 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). + // time stamp. In a raw HTTP query, 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" required:"true"` @@ -4093,7 +5605,8 @@ type GetMetricStatisticsInput struct { // 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). + // time stamp. In a raw HTTP query, 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: // @@ -4285,7 +5798,8 @@ type GetMetricWidgetImageInput struct { // limits, and so on. You can include only one MetricWidget parameter in each // GetMetricWidgetImage call. // - // For more information about the syntax of MetricWidget see CloudWatch-Metric-Widget-Structure. + // For more information about the syntax of MetricWidget see GetMetricWidgetImage: + // Metric Widget Structure and Syntax (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Metric-Widget-Structure.html). // // If any metric on the graph could not load all the requested data points, // an orange triangle with an exclamation point appears next to the graph legend. @@ -4386,6 +5900,285 @@ func (s *GetMetricWidgetImageOutput) SetMetricWidgetImage(v []byte) *GetMetricWi return s } +// This structure contains the definition for a Contributor Insights rule. +type InsightRule struct { + _ struct{} `type:"structure"` + + // The definition of the rule, as a JSON object. The definition contains the + // keywords used to define contributors, the value to aggregate on if this rule + // returns a sum instead of a count, and the filters. For details on the valid + // syntax, see Contributor Insights Rule Syntax (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights-RuleSyntax.html). + // + // Definition is a required field + Definition *string `min:"1" type:"string" required:"true"` + + // The name of the rule. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // For rules that you create, this is always {"Name": "CloudWatchLogRule", "Version": + // 1}. For built-in rules, this is {"Name": "ServiceLogRule", "Version": 1} + // + // Schema is a required field + Schema *string `type:"string" required:"true"` + + // Indicates whether the rule is enabled or disabled. + // + // State is a required field + State *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s InsightRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InsightRule) GoString() string { + return s.String() +} + +// SetDefinition sets the Definition field's value. +func (s *InsightRule) SetDefinition(v string) *InsightRule { + s.Definition = &v + return s +} + +// SetName sets the Name field's value. +func (s *InsightRule) SetName(v string) *InsightRule { + s.Name = &v + return s +} + +// SetSchema sets the Schema field's value. +func (s *InsightRule) SetSchema(v string) *InsightRule { + s.Schema = &v + return s +} + +// SetState sets the State field's value. +func (s *InsightRule) SetState(v string) *InsightRule { + s.State = &v + return s +} + +// One of the unique contributors found by a Contributor Insights rule. If the +// rule contains multiple keys, then a unique contributor is a unique combination +// of values from all the keys in the rule. +// +// If the rule contains a single key, then each unique contributor is each unique +// value for this key. +// +// For more information, see GetInsightRuleReport (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetInsightRuleReport.html). +type InsightRuleContributor struct { + _ struct{} `type:"structure"` + + // An approximation of the aggregate value that comes from this contributor. + // + // ApproximateAggregateValue is a required field + ApproximateAggregateValue *float64 `type:"double" required:"true"` + + // An array of the data points where this contributor is present. Only the data + // points when this contributor appeared are included in the array. + // + // Datapoints is a required field + Datapoints []*InsightRuleContributorDatapoint `type:"list" required:"true"` + + // One of the log entry field keywords that is used to define contributors for + // this rule. + // + // Keys is a required field + Keys []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s InsightRuleContributor) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InsightRuleContributor) GoString() string { + return s.String() +} + +// SetApproximateAggregateValue sets the ApproximateAggregateValue field's value. +func (s *InsightRuleContributor) SetApproximateAggregateValue(v float64) *InsightRuleContributor { + s.ApproximateAggregateValue = &v + return s +} + +// SetDatapoints sets the Datapoints field's value. +func (s *InsightRuleContributor) SetDatapoints(v []*InsightRuleContributorDatapoint) *InsightRuleContributor { + s.Datapoints = v + return s +} + +// SetKeys sets the Keys field's value. +func (s *InsightRuleContributor) SetKeys(v []*string) *InsightRuleContributor { + s.Keys = v + return s +} + +// One data point related to one contributor. +// +// For more information, see GetInsightRuleReport (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetInsightRuleReport.html) +// and InsightRuleContributor (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_InsightRuleContributor.html). +type InsightRuleContributorDatapoint struct { + _ struct{} `type:"structure"` + + // The approximate value that this contributor added during this timestamp. + // + // ApproximateValue is a required field + ApproximateValue *float64 `type:"double" required:"true"` + + // The timestamp of the data point. + // + // Timestamp is a required field + Timestamp *time.Time `type:"timestamp" required:"true"` +} + +// String returns the string representation +func (s InsightRuleContributorDatapoint) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InsightRuleContributorDatapoint) GoString() string { + return s.String() +} + +// SetApproximateValue sets the ApproximateValue field's value. +func (s *InsightRuleContributorDatapoint) SetApproximateValue(v float64) *InsightRuleContributorDatapoint { + s.ApproximateValue = &v + return s +} + +// SetTimestamp sets the Timestamp field's value. +func (s *InsightRuleContributorDatapoint) SetTimestamp(v time.Time) *InsightRuleContributorDatapoint { + s.Timestamp = &v + return s +} + +// One data point from the metric time series returned in a Contributor Insights +// rule report. +// +// For more information, see GetInsightRuleReport (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_GetInsightRuleReport.html). +type InsightRuleMetricDatapoint struct { + _ struct{} `type:"structure"` + + // The average value from all contributors during the time period represented + // by that data point. + // + // This statistic is returned only if you included it in the Metrics array in + // your request. + Average *float64 `type:"double"` + + // The maximum value provided by one contributor during this timestamp. Each + // timestamp is evaluated separately, so the identity of the max contributor + // could be different for each timestamp. + // + // This statistic is returned only if you included it in the Metrics array in + // your request. + MaxContributorValue *float64 `type:"double"` + + // The maximum value from a single occurence from a single contributor during + // the time period represented by that data point. + // + // This statistic is returned only if you included it in the Metrics array in + // your request. + Maximum *float64 `type:"double"` + + // The minimum value from a single contributor during the time period represented + // by that data point. + // + // This statistic is returned only if you included it in the Metrics array in + // your request. + Minimum *float64 `type:"double"` + + // The number of occurrences that matched the rule during this data point. + // + // This statistic is returned only if you included it in the Metrics array in + // your request. + SampleCount *float64 `type:"double"` + + // The sum of the values from all contributors during the time period represented + // by that data point. + // + // This statistic is returned only if you included it in the Metrics array in + // your request. + Sum *float64 `type:"double"` + + // The timestamp of the data point. + // + // Timestamp is a required field + Timestamp *time.Time `type:"timestamp" required:"true"` + + // The number of unique contributors who published data during this timestamp. + // + // This statistic is returned only if you included it in the Metrics array in + // your request. + UniqueContributors *float64 `type:"double"` +} + +// String returns the string representation +func (s InsightRuleMetricDatapoint) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InsightRuleMetricDatapoint) GoString() string { + return s.String() +} + +// SetAverage sets the Average field's value. +func (s *InsightRuleMetricDatapoint) SetAverage(v float64) *InsightRuleMetricDatapoint { + s.Average = &v + return s +} + +// SetMaxContributorValue sets the MaxContributorValue field's value. +func (s *InsightRuleMetricDatapoint) SetMaxContributorValue(v float64) *InsightRuleMetricDatapoint { + s.MaxContributorValue = &v + return s +} + +// SetMaximum sets the Maximum field's value. +func (s *InsightRuleMetricDatapoint) SetMaximum(v float64) *InsightRuleMetricDatapoint { + s.Maximum = &v + return s +} + +// SetMinimum sets the Minimum field's value. +func (s *InsightRuleMetricDatapoint) SetMinimum(v float64) *InsightRuleMetricDatapoint { + s.Minimum = &v + return s +} + +// SetSampleCount sets the SampleCount field's value. +func (s *InsightRuleMetricDatapoint) SetSampleCount(v float64) *InsightRuleMetricDatapoint { + s.SampleCount = &v + return s +} + +// SetSum sets the Sum field's value. +func (s *InsightRuleMetricDatapoint) SetSum(v float64) *InsightRuleMetricDatapoint { + s.Sum = &v + return s +} + +// SetTimestamp sets the Timestamp field's value. +func (s *InsightRuleMetricDatapoint) SetTimestamp(v time.Time) *InsightRuleMetricDatapoint { + s.Timestamp = &v + return s +} + +// SetUniqueContributors sets the UniqueContributors field's value. +func (s *InsightRuleMetricDatapoint) SetUniqueContributors(v float64) *InsightRuleMetricDatapoint { + s.UniqueContributors = &v + return s +} + type ListDashboardsInput struct { _ struct{} `type:"structure"` @@ -4729,7 +6522,7 @@ func (s *Metric) SetNamespace(v string) *Metric { return s } -// Represents an alarm. +// The details about a metric alarm. type MetricAlarm struct { _ struct{} `type:"structure"` @@ -4757,7 +6550,7 @@ type MetricAlarm struct { // threshold. The specified statistic value is used as the first operand. ComparisonOperator *string `type:"string" enum:"ComparisonOperator"` - // The number of datapoints that must be breaching to trigger the alarm. + // The number of data points that must be breaching to trigger the alarm. DatapointsToAlarm *int64 `min:"1" type:"integer"` // The dimensions for the metric associated with the alarm. @@ -5011,7 +6804,7 @@ func (s *MetricAlarm) SetUnit(v string) *MetricAlarm { // When used in GetMetricData, it indicates the metric data to return, and whether // this call is just retrieving a batch set of data for one metric, or is performing // a math expression on metric data. A single GetMetricData call can include -// up to 100 MetricDataQuery structures. +// up to 500 MetricDataQuery structures. // // When used in PutMetricAlarm, it enables you to create an alarm based on a // metric math expression. Each MetricDataQuery in the array specifies either @@ -5068,6 +6861,14 @@ type MetricDataQuery struct { // MetricStat but not both. MetricStat *MetricStat `type:"structure"` + // The granularity, in seconds, of the returned data points. For metrics with + // regular resolution, a period can be as short as one minute (60 seconds) and + // must be a multiple of 60. For high-resolution metrics that are collected + // at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, + // or any multiple of 60. High-resolution metrics are those metrics stored by + // a PutMetricData operation that includes a StorageResolution of 1 second. + Period *int64 `min:"1" type:"integer"` + // When used in GetMetricData, this option indicates whether to return the timestamps // and raw data values of this metric. If you are performing this call just // to do math expressions and do not also need the raw data returned, you can @@ -5101,6 +6902,9 @@ func (s *MetricDataQuery) Validate() error { if s.Id != nil && len(*s.Id) < 1 { invalidParams.Add(request.NewErrParamMinLen("Id", 1)) } + if s.Period != nil && *s.Period < 1 { + invalidParams.Add(request.NewErrParamMinValue("Period", 1)) + } if s.MetricStat != nil { if err := s.MetricStat.Validate(); err != nil { invalidParams.AddNested("MetricStat", err.(request.ErrInvalidParams)) @@ -5137,6 +6941,12 @@ func (s *MetricDataQuery) SetMetricStat(v *MetricStat) *MetricDataQuery { return s } +// SetPeriod sets the Period field's value. +func (s *MetricDataQuery) SetPeriod(v int64) *MetricDataQuery { + s.Period = &v + return s +} + // SetReturnData sets the ReturnData field's value. func (s *MetricDataQuery) SetReturnData(v bool) *MetricDataQuery { s.ReturnData = &v @@ -5273,9 +7083,8 @@ type MetricDatum struct { // // Although the parameter accepts numbers of type Double, 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. + // of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, + // -Infinity) are not supported. Value *float64 `type:"double"` // Array of numbers representing the values for the metric during the period. @@ -5286,9 +7095,8 @@ type MetricDatum struct { // // Although the Values array accepts numbers of type Double, 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. + // of -2^360 to 2^360. In addition, special values (for example, NaN, +Infinity, + // -Infinity) are not supported. Values []*float64 `type:"list"` } @@ -5400,7 +7208,25 @@ type MetricStat struct { // Metric is a required field Metric *Metric `type:"structure" required:"true"` - // The period, in seconds, to use when retrieving the metric. + // The granularity, in seconds, of the returned data points. For metrics with + // regular resolution, a period can be as short as one minute (60 seconds) and + // must be a multiple of 60. For high-resolution metrics that are collected + // at intervals of less than one minute, the period can be 1, 5, 10, 30, 60, + // or any multiple of 60. High-resolution metrics are those metrics stored by + // a PutMetricData call that includes a StorageResolution of 1 second. + // + // If the StartTime parameter specifies a time stamp that is greater than 3 + // hours ago, you must specify the period as follows or no data points in that + // time range is returned: + // + // * Start time between 3 hours and 15 days ago - Use a multiple of 60 seconds + // (1 minute). + // + // * 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:"1" type:"integer" required:"true"` @@ -5484,6 +7310,59 @@ func (s *MetricStat) SetUnit(v string) *MetricStat { return s } +// This array is empty if the API operation was successful for all the rules +// specified in the request. If the operation could not process one of the rules, +// the following data is returned for each of those rules. +type PartialFailure struct { + _ struct{} `type:"structure"` + + // The type of error. + ExceptionType *string `type:"string"` + + // The code of the error. + FailureCode *string `type:"string"` + + // A description of the error. + FailureDescription *string `type:"string"` + + // The specified rule that could not be deleted. + FailureResource *string `type:"string"` +} + +// String returns the string representation +func (s PartialFailure) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PartialFailure) GoString() string { + return s.String() +} + +// SetExceptionType sets the ExceptionType field's value. +func (s *PartialFailure) SetExceptionType(v string) *PartialFailure { + s.ExceptionType = &v + return s +} + +// SetFailureCode sets the FailureCode field's value. +func (s *PartialFailure) SetFailureCode(v string) *PartialFailure { + s.FailureCode = &v + return s +} + +// SetFailureDescription sets the FailureDescription field's value. +func (s *PartialFailure) SetFailureDescription(v string) *PartialFailure { + s.FailureDescription = &v + return s +} + +// SetFailureResource sets the FailureResource field's value. +func (s *PartialFailure) SetFailureResource(v string) *PartialFailure { + s.FailureResource = &v + return s +} + type PutAnomalyDetectorInput struct { _ struct{} `type:"structure"` @@ -5609,6 +7488,209 @@ func (s PutAnomalyDetectorOutput) GoString() string { return s.String() } +type PutCompositeAlarmInput struct { + _ struct{} `type:"structure"` + + // Indicates whether actions should be executed during any changes to the alarm + // state of the composite alarm. The default is TRUE. + 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:sns:region:account-id:sns-topic-name + AlarmActions []*string `type:"list"` + + // The description for the composite alarm. + AlarmDescription *string `type:"string"` + + // The name for the composite alarm. This name must be unique within your AWS + // account. + // + // AlarmName is a required field + AlarmName *string `min:"1" type:"string" required:"true"` + + // An expression that specifies which other alarms are to be evaluated to determine + // this composite alarm's state. For each alarm that you reference, you designate + // a function that specifies whether that alarm needs to be in ALARM state, + // OK state, or INSUFFICIENT_DATA state. You can use operators (AND, OR and + // NOT) to combine multiple functions in a single expression. You can use parenthesis + // to logically group the functions in your expression. + // + // You can use either alarm names or ARNs to reference the other alarms that + // are to be evaluated. + // + // Functions can include the following: + // + // * ALARM("alarm-name or alarm-ARN") is TRUE if the named alarm is in ALARM + // state. + // + // * OK("alarm-name or alarm-ARN") is TRUE if the named alarm is in OK state. + // + // * INSUFFICIENT_DATA("alarm-name or alarm-ARN") is TRUE if the named alarm + // is in INSUFFICIENT_DATA state. + // + // * TRUE always evaluates to TRUE. + // + // * FALSE always evaluates to FALSE. + // + // TRUE and FALSE are useful for testing a complex AlarmRule structure, and + // for testing your alarm actions. + // + // Alarm names specified in AlarmRule can be surrounded with double-quotes ("), + // but do not have to be. + // + // The following are some examples of AlarmRule: + // + // * ALARM(CPUUtilizationTooHigh) AND ALARM(DiskReadOpsTooHigh) specifies + // that the composite alarm goes into ALARM state only if both CPUUtilizationTooHigh + // and DiskReadOpsTooHigh alarms are in ALARM state. + // + // * ALARM(CPUUtilizationTooHigh) AND NOT ALARM(DeploymentInProgress) specifies + // that the alarm goes to ALARM state if CPUUtilizationTooHigh is in ALARM + // state and DeploymentInProgress is not in ALARM state. This example reduces + // alarm noise during a known deployment window. + // + // * (ALARM(CPUUtilizationTooHigh) OR ALARM(DiskReadOpsTooHigh)) AND OK(NetworkOutTooHigh) + // goes into ALARM state if CPUUtilizationTooHigh OR DiskReadOpsTooHigh is + // in ALARM state, and if NetworkOutTooHigh is in OK state. This provides + // another example of using a composite alarm to prevent noise. This rule + // ensures that you are not notified with an alarm action on high CPU or + // disk usage if a known network problem is also occurring. + // + // The AlarmRule can specify as many as 100 "children" alarms. The AlarmRule + // expression can have as many as 500 elements. Elements are child alarms, TRUE + // or FALSE statements, and parentheses. + // + // AlarmRule is a required field + AlarmRule *string `min:"1" type:"string" required:"true"` + + // 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:sns:region:account-id:sns-topic-name + InsufficientDataActions []*string `type:"list"` + + // 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:sns:region:account-id:sns-topic-name + OKActions []*string `type:"list"` + + // A list of key-value pairs to associate with the composite alarm. You can + // associate as many as 50 tags with an alarm. + // + // Tags can help you organize and categorize your resources. You can also use + // them to scope user permissions, by granting a user permission to access or + // change only resources with certain tag values. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s PutCompositeAlarmInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutCompositeAlarmInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutCompositeAlarmInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutCompositeAlarmInput"} + 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.AlarmRule == nil { + invalidParams.Add(request.NewErrParamRequired("AlarmRule")) + } + if s.AlarmRule != nil && len(*s.AlarmRule) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AlarmRule", 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 +} + +// SetActionsEnabled sets the ActionsEnabled field's value. +func (s *PutCompositeAlarmInput) SetActionsEnabled(v bool) *PutCompositeAlarmInput { + s.ActionsEnabled = &v + return s +} + +// SetAlarmActions sets the AlarmActions field's value. +func (s *PutCompositeAlarmInput) SetAlarmActions(v []*string) *PutCompositeAlarmInput { + s.AlarmActions = v + return s +} + +// SetAlarmDescription sets the AlarmDescription field's value. +func (s *PutCompositeAlarmInput) SetAlarmDescription(v string) *PutCompositeAlarmInput { + s.AlarmDescription = &v + return s +} + +// SetAlarmName sets the AlarmName field's value. +func (s *PutCompositeAlarmInput) SetAlarmName(v string) *PutCompositeAlarmInput { + s.AlarmName = &v + return s +} + +// SetAlarmRule sets the AlarmRule field's value. +func (s *PutCompositeAlarmInput) SetAlarmRule(v string) *PutCompositeAlarmInput { + s.AlarmRule = &v + return s +} + +// SetInsufficientDataActions sets the InsufficientDataActions field's value. +func (s *PutCompositeAlarmInput) SetInsufficientDataActions(v []*string) *PutCompositeAlarmInput { + s.InsufficientDataActions = v + return s +} + +// SetOKActions sets the OKActions field's value. +func (s *PutCompositeAlarmInput) SetOKActions(v []*string) *PutCompositeAlarmInput { + s.OKActions = v + return s +} + +// SetTags sets the Tags field's value. +func (s *PutCompositeAlarmInput) SetTags(v []*Tag) *PutCompositeAlarmInput { + s.Tags = v + return s +} + +type PutCompositeAlarmOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutCompositeAlarmOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutCompositeAlarmOutput) GoString() string { + return s.String() +} + type PutDashboardInput struct { _ struct{} `type:"structure"` @@ -5616,7 +7698,8 @@ type PutDashboardInput struct { // widgets to include and their location on the dashboard. This parameter is // required. // - // For more information about the syntax, see CloudWatch-Dashboard-Body-Structure. + // For more information about the syntax, see Dashboard Body Structure and Syntax + // (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/CloudWatch-Dashboard-Body-Structure.html). // // DashboardBody is a required field DashboardBody *string `type:"string" required:"true"` @@ -5699,6 +7782,91 @@ func (s *PutDashboardOutput) SetDashboardValidationMessages(v []*DashboardValida return s } +type PutInsightRuleInput struct { + _ struct{} `type:"structure"` + + // The definition of the rule, as a JSON object. For details on the valid syntax, + // see Contributor Insights Rule Syntax (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/ContributorInsights-RuleSyntax.html). + // + // RuleDefinition is a required field + RuleDefinition *string `min:"1" type:"string" required:"true"` + + // A unique name for the rule. + // + // RuleName is a required field + RuleName *string `min:"1" type:"string" required:"true"` + + // The state of the rule. Valid values are ENABLED and DISABLED. + RuleState *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PutInsightRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutInsightRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutInsightRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutInsightRuleInput"} + if s.RuleDefinition == nil { + invalidParams.Add(request.NewErrParamRequired("RuleDefinition")) + } + if s.RuleDefinition != nil && len(*s.RuleDefinition) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleDefinition", 1)) + } + if s.RuleName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleName")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + if s.RuleState != nil && len(*s.RuleState) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleState", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRuleDefinition sets the RuleDefinition field's value. +func (s *PutInsightRuleInput) SetRuleDefinition(v string) *PutInsightRuleInput { + s.RuleDefinition = &v + return s +} + +// SetRuleName sets the RuleName field's value. +func (s *PutInsightRuleInput) SetRuleName(v string) *PutInsightRuleInput { + s.RuleName = &v + return s +} + +// SetRuleState sets the RuleState field's value. +func (s *PutInsightRuleInput) SetRuleState(v string) *PutInsightRuleInput { + s.RuleState = &v + return s +} + +type PutInsightRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutInsightRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutInsightRuleOutput) GoString() string { + return s.String() +} + type PutMetricAlarmInput struct { _ struct{} `type:"structure"` @@ -5711,7 +7879,7 @@ type PutMetricAlarmInput struct { // // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate // | arn:aws:automate:region:ec2:recover | arn:aws:automate:region:ec2:reboot - // | arn:aws:sns:region:account-id:sns-topic-name | arn:aws:autoscaling:region:account-id:scalingPolicy:policy-idautoScalingGroupName/group-friendly-name:policyName/policy-friendly-name + // | arn:aws:sns:region:account-id:sns-topic-name | arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name // // Valid Values (for use with IAM roles): arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0 // | arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0 @@ -5736,7 +7904,7 @@ type PutMetricAlarmInput struct { // ComparisonOperator is a required field ComparisonOperator *string `type:"string" required:"true" enum:"ComparisonOperator"` - // The number of datapoints that must be breaching to trigger the alarm. This + // The number of data points that must be breaching to trigger the alarm. This // is used only if you are setting an "M out of N" alarm. In that case, this // value is the M. For more information, see Evaluating an Alarm (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/AlarmThatSendsEmail.html#alarm-evaluation) // in the Amazon CloudWatch User Guide. @@ -5778,7 +7946,7 @@ type PutMetricAlarmInput struct { // // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate // | arn:aws:automate:region:ec2:recover | arn:aws:automate:region:ec2:reboot - // | arn:aws:sns:region:account-id:sns-topic-name | arn:aws:autoscaling:region:account-id:scalingPolicy:policy-idautoScalingGroupName/group-friendly-name:policyName/policy-friendly-name + // | arn:aws:sns:region:account-id:sns-topic-name | arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name // // Valid Values (for use with IAM roles): >arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0 // | arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0 @@ -5803,7 +7971,7 @@ type PutMetricAlarmInput struct { // // One item in the Metrics array is the expression that the alarm watches. You // designate this expression by setting ReturnValue to true for this object - // in the array. For more information, see MetricDataQuery. + // in the array. For more information, see MetricDataQuery (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDataQuery.html). // // If you use the Metrics parameter, you cannot include the MetricName, Dimensions, // Period, Namespace, Statistic, or ExtendedStatistic parameters of PutMetricAlarm @@ -5819,7 +7987,7 @@ type PutMetricAlarmInput struct { // // Valid Values: arn:aws:automate:region:ec2:stop | arn:aws:automate:region:ec2:terminate // | arn:aws:automate:region:ec2:recover | arn:aws:automate:region:ec2:reboot - // | arn:aws:sns:region:account-id:sns-topic-name | arn:aws:autoscaling:region:account-id:scalingPolicy:policy-idautoScalingGroupName/group-friendly-name:policyName/policy-friendly-name + // | arn:aws:sns:region:account-id:sns-topic-name | arn:aws:autoscaling:region:account-id:scalingPolicy:policy-id:autoScalingGroupName/group-friendly-name:policyName/policy-friendly-name // // Valid Values (for use with IAM roles): arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Stop/1.0 // | arn:aws:swf:region:account-id:action/actions/AWS_EC2.InstanceId.Terminate/1.0 @@ -6290,6 +8458,10 @@ type SetAlarmStateInput struct { StateReason *string `type:"string" required:"true"` // The reason that this alarm is set to this specific state, in JSON format. + // + // For SNS or EC2 alarm actions, this is just informational. But for EC2 Auto + // Scaling or application Auto Scaling alarm actions, the Auto Scaling policy + // uses the information in this field to take the correct action. StateReasonData *string `type:"string"` // The value of the state. @@ -6509,14 +8681,13 @@ func (s *Tag) SetValue(v string) *Tag { type TagResourceInput struct { _ struct{} `type:"structure"` - // The ARN of the CloudWatch resource that you're adding tags to. For more information - // on ARN format, see Example ARNs (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-cloudwatch) - // in the Amazon Web Services General Reference. + // The ARN of the CloudWatch alarm that you're adding tags to. The ARN format + // is arn:aws:cloudwatch:Region:account-id:alarm:alarm-name // // ResourceARN is a required field ResourceARN *string `min:"1" type:"string" required:"true"` - // The list of key-value pairs to associate with the resource. + // The list of key-value pairs to associate with the alarm. // // Tags is a required field Tags []*Tag `type:"list" required:"true"` @@ -6658,6 +8829,25 @@ func (s UntagResourceOutput) GoString() string { return s.String() } +const ( + // AlarmTypeCompositeAlarm is a AlarmType enum value + AlarmTypeCompositeAlarm = "CompositeAlarm" + + // AlarmTypeMetricAlarm is a AlarmType enum value + AlarmTypeMetricAlarm = "MetricAlarm" +) + +const ( + // AnomalyDetectorStateValuePendingTraining is a AnomalyDetectorStateValue enum value + AnomalyDetectorStateValuePendingTraining = "PENDING_TRAINING" + + // AnomalyDetectorStateValueTrainedInsufficientData is a AnomalyDetectorStateValue enum value + AnomalyDetectorStateValueTrainedInsufficientData = "TRAINED_INSUFFICIENT_DATA" + + // AnomalyDetectorStateValueTrained is a AnomalyDetectorStateValue enum value + AnomalyDetectorStateValueTrained = "TRAINED" +) + const ( // ComparisonOperatorGreaterThanOrEqualToThreshold is a ComparisonOperator enum value ComparisonOperatorGreaterThanOrEqualToThreshold = "GreaterThanOrEqualToThreshold" 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 index 0d478662240..c926b57c8e1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "monitoring" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "CloudWatch" // ServiceID is a unique identifer of a specific service. + ServiceID = "CloudWatch" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CloudWatch client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CloudWatch client from just a session. // svc := cloudwatch.New(mySession) // @@ -46,11 +48,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CloudWatch { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CloudWatch { svc := &CloudWatch{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2010-08-01", }, 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 index 21e42ac581b..164d306c452 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatch/waiters.go @@ -54,3 +54,49 @@ func (c *CloudWatch) WaitUntilAlarmExistsWithContext(ctx aws.Context, input *Des return w.WaitWithContext(ctx) } + +// WaitUntilCompositeAlarmExists uses the CloudWatch API operation +// DescribeAlarms to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *CloudWatch) WaitUntilCompositeAlarmExists(input *DescribeAlarmsInput) error { + return c.WaitUntilCompositeAlarmExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilCompositeAlarmExistsWithContext is an extended version of WaitUntilCompositeAlarmExists. +// 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 *CloudWatch) WaitUntilCompositeAlarmExistsWithContext(ctx aws.Context, input *DescribeAlarmsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilCompositeAlarmExists", + MaxAttempts: 40, + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(CompositeAlarms[]) > `0`", + Expected: true, + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeAlarmsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAlarmsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/api.go index 99b12487c2b..4be852438b6 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/api.go @@ -61,8 +61,6 @@ func (c *CloudWatchEvents) ActivateEventSourceRequest(input *ActivateEventSource // Activates a partner event source that has been deactivated. Once activated, // your matching event bus will start receiving events from the event source. // -// This operation is performed by AWS customers, not by SaaS partners. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -70,14 +68,17 @@ func (c *CloudWatchEvents) ActivateEventSourceRequest(input *ActivateEventSource // See the AWS API reference guide for Amazon CloudWatch Events's // API operation ActivateEventSource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. // -// * ErrCodeInvalidStateException "InvalidStateException" -// The specified state isn't a valid state for an event source. +// * InvalidStateException +// The specified state is not a valid state for an event source. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ActivateEventSource @@ -147,11 +148,9 @@ func (c *CloudWatchEvents) CreateEventBusRequest(input *CreateEventBusInput) (re // CreateEventBus API operation for Amazon CloudWatch Events. // // Creates a new event bus within your account. This can be a custom event bus -// which you can use to receive events from your own custom applications and -// services, or it can be a partner event bus which can be matched to a partner -// event source. -// -// This operation is used by AWS customers, not by SaaS partners. +// which you can use to receive events from your custom applications and services, +// or it can be a partner event bus which can be matched to a partner event +// 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 @@ -160,24 +159,24 @@ func (c *CloudWatchEvents) CreateEventBusRequest(input *CreateEventBusInput) (re // See the AWS API reference guide for Amazon CloudWatch Events's // API operation CreateEventBus for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" -// The resource that you're trying to create already exists. +// Returned Error Types: +// * ResourceAlreadyExistsException +// The resource you are trying to create already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodeInvalidStateException "InvalidStateException" -// The specified state isn't a valid state for an event source. +// * InvalidStateException +// The specified state is not a valid state for an event source. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a resource. +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. // -// * ErrCodeLimitExceededException "LimitExceededException" -// You tried to create more resources than is allowed. +// * LimitExceededException +// You tried to create more rules or add more targets to a rule than is allowed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/CreateEventBus func (c *CloudWatchEvents) CreateEventBus(input *CreateEventBusInput) (*CreateEventBusOutput, error) { @@ -245,16 +244,15 @@ func (c *CloudWatchEvents) CreatePartnerEventSourceRequest(input *CreatePartnerE // CreatePartnerEventSource API operation for Amazon CloudWatch Events. // -// Called by an SaaS partner to create a partner event source. -// -// This operation is not used by AWS customers. +// Called by an SaaS partner to create a partner event source. This operation +// is not used by AWS customers. // // Each partner event source can be used by one AWS account to create a matching // partner event bus in that AWS account. A SaaS partner must create one partner // event source for each AWS account that wants to receive those event types. // -// A partner event source creates events based on resources in the SaaS partner's -// service or application. +// A partner event source creates events based on resources within the SaaS +// partner's service or application. // // An AWS account that creates a partner event bus that matches the partner // event source can use that event bus to receive events from the partner, and @@ -262,18 +260,15 @@ func (c *CloudWatchEvents) CreatePartnerEventSourceRequest(input *CreatePartnerE // // Partner event source names follow this format: // -// aws.partner/partner_name/event_namespace/event_name +// partner_name/event_namespace/event_name // -// * partner_name is determined during partner registration and identifies -// the partner to AWS customers. -// -// * For event_namespace, we recommend that partners use a string that identifies -// the AWS customer within the partner's system. This should not be the customer's -// AWS account ID. -// -// * event_name is determined by the partner, and should uniquely identify -// an event-generating resource within the partner system. This should help -// AWS customers decide whether to create an event bus to receive these events. +// partner_name is determined during partner registration and identifies the +// partner to AWS customers. event_namespace is determined by the partner and +// is a way for the partner to categorize their events. event_name is determined +// by the partner, and should uniquely identify an event-generating resource +// within the partner system. The combination of event_namespace and event_name +// should help AWS customers decide whether to create an event bus to receive +// these events. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -282,18 +277,18 @@ func (c *CloudWatchEvents) CreatePartnerEventSourceRequest(input *CreatePartnerE // See the AWS API reference guide for Amazon CloudWatch Events's // API operation CreatePartnerEventSource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" -// The resource that you're trying to create already exists. +// Returned Error Types: +// * ResourceAlreadyExistsException +// The resource you are trying to create already exists. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a resource. +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. // -// * ErrCodeLimitExceededException "LimitExceededException" -// You tried to create more resources than is allowed. +// * LimitExceededException +// You tried to create more rules or add more targets to a rule than is allowed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/CreatePartnerEventSource func (c *CloudWatchEvents) CreatePartnerEventSource(input *CreatePartnerEventSourceInput) (*CreatePartnerEventSourceOutput, error) { @@ -362,11 +357,11 @@ func (c *CloudWatchEvents) DeactivateEventSourceRequest(input *DeactivateEventSo // DeactivateEventSource API operation for Amazon CloudWatch Events. // -// An AWS customer uses this operation to temporarily stop receiving events -// from the specified partner event source. The matching event bus isn't deleted. +// You can use this operation to temporarily stop receiving events from the +// specified partner event source. The matching event bus is not deleted. // // When you deactivate a partner event source, the source goes into PENDING -// state. If it remains in PENDING state for more than two weeks, it's deleted. +// state. If it remains in PENDING state for more than two weeks, it is deleted. // // To activate a deactivated partner event source, use ActivateEventSource. // @@ -377,14 +372,17 @@ func (c *CloudWatchEvents) DeactivateEventSourceRequest(input *DeactivateEventSo // See the AWS API reference guide for Amazon CloudWatch Events's // API operation DeactivateEventSource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. +// +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. // -// * ErrCodeInvalidStateException "InvalidStateException" -// The specified state isn't a valid state for an event source. +// * InvalidStateException +// The specified state is not a valid state for an event source. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeactivateEventSource @@ -455,11 +453,9 @@ func (c *CloudWatchEvents) DeleteEventBusRequest(input *DeleteEventBusInput) (re // DeleteEventBus API operation for Amazon CloudWatch Events. // // Deletes the specified custom event bus or partner event bus. All rules associated -// with this event bus are also deleted. You can't delete your account's default +// with this event bus need to be deleted. You can't delete your account's default // event bus. // -// This operation is performed by AWS customers, not by SaaS partners. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -467,10 +463,13 @@ func (c *CloudWatchEvents) DeleteEventBusRequest(input *DeleteEventBusInput) (re // See the AWS API reference guide for Amazon CloudWatch Events's // API operation DeleteEventBus for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // This exception occurs due to unexpected causes. // +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteEventBus func (c *CloudWatchEvents) DeleteEventBus(input *DeleteEventBusInput) (*DeleteEventBusOutput, error) { req, out := c.DeleteEventBusRequest(input) @@ -539,7 +538,7 @@ func (c *CloudWatchEvents) DeletePartnerEventSourceRequest(input *DeletePartnerE // DeletePartnerEventSource API operation for Amazon CloudWatch Events. // // This operation is used by SaaS partners to delete a partner event source. -// AWS customers don't use this operation. +// This operation is not used by AWS customers. // // When you delete an event source, the status of the corresponding partner // event bus in the AWS customer account becomes DELETED. @@ -551,10 +550,13 @@ func (c *CloudWatchEvents) DeletePartnerEventSourceRequest(input *DeletePartnerE // See the AWS API reference guide for Amazon CloudWatch Events's // API operation DeletePartnerEventSource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // This exception occurs due to unexpected causes. // +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeletePartnerEventSource func (c *CloudWatchEvents) DeletePartnerEventSource(input *DeletePartnerEventSourceInput) (*DeletePartnerEventSourceOutput, error) { req, out := c.DeletePartnerEventSourceRequest(input) @@ -632,7 +634,7 @@ func (c *CloudWatchEvents) DeleteRuleRequest(input *DeleteRuleInput) (req *reque // Managed rules are rules created and managed by another AWS service on your // behalf. These rules are created by those other AWS services to support functionality // in those services. You can delete these rules using the Force option, but -// you should do so only if you're sure that the other service isn't still using +// you should do so only if you are sure the other service is not still using // that rule. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -642,22 +644,23 @@ func (c *CloudWatchEvents) DeleteRuleRequest(input *DeleteRuleInput) (req *reque // 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 resource. +// Returned Error Types: +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. // -// * ErrCodeManagedRuleException "ManagedRuleException" -// An AWS service created this rule on behalf of your account. That service -// manages it. If you see this error in response to DeleteRule or RemoveTargets, -// you can use the Force parameter in those calls to delete the rule or remove -// targets from the rule. You can't modify these managed rules by using DisableRule, -// EnableRule, PutTargets, PutRule, TagResource, or UntagResource. +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// * ResourceNotFoundException +// An entity that you specified does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DeleteRule func (c *CloudWatchEvents) DeleteRule(input *DeleteRuleInput) (*DeleteRuleOutput, error) { @@ -742,11 +745,11 @@ func (c *CloudWatchEvents) DescribeEventBusRequest(input *DescribeEventBusInput) // See the AWS API reference guide for Amazon CloudWatch Events's // API operation DescribeEventBus for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeEventBus @@ -818,8 +821,6 @@ func (c *CloudWatchEvents) DescribeEventSourceRequest(input *DescribeEventSource // This operation lists details about a partner event source that is shared // with your account. // -// This operation is run by AWS customers, not by SaaS partners. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -827,11 +828,11 @@ func (c *CloudWatchEvents) DescribeEventSourceRequest(input *DescribeEventSource // See the AWS API reference guide for Amazon CloudWatch Events's // API operation DescribeEventSource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeEventSource @@ -901,10 +902,9 @@ func (c *CloudWatchEvents) DescribePartnerEventSourceRequest(input *DescribePart // DescribePartnerEventSource API operation for Amazon CloudWatch Events. // // An SaaS partner can use this operation to list details about a partner event -// source that they have created. -// -// AWS customers do not use this operation. Instead, AWS customers can use DescribeEventSource -// to see details about a partner event source that is shared with them. +// source that they have created. AWS customers do not use this operation. Instead, +// AWS customers can use DescribeEventSource to see details about a partner +// event source that is shared 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 @@ -913,11 +913,11 @@ func (c *CloudWatchEvents) DescribePartnerEventSourceRequest(input *DescribePart // See the AWS API reference guide for Amazon CloudWatch Events's // API operation DescribePartnerEventSource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribePartnerEventSource @@ -988,7 +988,7 @@ func (c *CloudWatchEvents) DescribeRuleRequest(input *DescribeRuleInput) (req *r // // Describes the specified rule. // -// DescribeRule doesn't list the targets of a rule. To see the targets associated +// DescribeRule does not list the targets of a rule. To see the targets associated // with a rule, use ListTargetsByRule. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -998,11 +998,11 @@ func (c *CloudWatchEvents) DescribeRuleRequest(input *DescribeRuleInput) (req *r // See the AWS API reference guide for Amazon CloudWatch Events's // API operation DescribeRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DescribeRule @@ -1072,8 +1072,8 @@ func (c *CloudWatchEvents) DisableRuleRequest(input *DisableRuleInput) (req *req // 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. +// 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. Allow a short period of time for changes to take effect. @@ -1085,21 +1085,22 @@ func (c *CloudWatchEvents) DisableRuleRequest(input *DisableRuleInput) (req *req // See the AWS API reference guide for Amazon CloudWatch Events's // API operation DisableRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a resource. +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. // -// * ErrCodeManagedRuleException "ManagedRuleException" -// An AWS service created this rule on behalf of your account. That service -// manages it. If you see this error in response to DeleteRule or RemoveTargets, -// you can use the Force parameter in those calls to delete the rule or remove -// targets from the rule. You can't modify these managed rules by using DisableRule, -// EnableRule, PutTargets, PutRule, TagResource, or UntagResource. +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/DisableRule @@ -1169,7 +1170,7 @@ func (c *CloudWatchEvents) EnableRuleRequest(input *EnableRuleInput) (req *reque // EnableRule API operation for Amazon CloudWatch Events. // -// Enables the specified rule. If the rule doesn't exist, the operation fails. +// 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. Allow a short period of time for changes to take @@ -1182,21 +1183,22 @@ func (c *CloudWatchEvents) EnableRuleRequest(input *EnableRuleInput) (req *reque // See the AWS API reference guide for Amazon CloudWatch Events's // API operation EnableRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a resource. +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. // -// * ErrCodeManagedRuleException "ManagedRuleException" -// An AWS service created this rule on behalf of your account. That service -// manages it. If you see this error in response to DeleteRule or RemoveTargets, -// you can use the Force parameter in those calls to delete the rule or remove -// targets from the rule. You can't modify these managed rules by using DisableRule, -// EnableRule, PutTargets, PutRule, TagResource, or UntagResource. +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/EnableRule @@ -1268,8 +1270,6 @@ func (c *CloudWatchEvents) ListEventBusesRequest(input *ListEventBusesInput) (re // Lists all the event buses in your account, including the default event bus, // custom event buses, and partner event buses. // -// This operation is run by AWS customers, not by SaaS partners. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1277,8 +1277,8 @@ func (c *CloudWatchEvents) ListEventBusesRequest(input *ListEventBusesInput) (re // See the AWS API reference guide for Amazon CloudWatch Events's // API operation ListEventBuses for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListEventBuses @@ -1351,8 +1351,6 @@ func (c *CloudWatchEvents) ListEventSourcesRequest(input *ListEventSourcesInput) // with your AWS account. For more information about partner event sources, // see CreateEventBus. // -// This operation is run by AWS customers, not by SaaS partners. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1360,8 +1358,8 @@ func (c *CloudWatchEvents) ListEventSourcesRequest(input *ListEventSourcesInput) // See the AWS API reference guide for Amazon CloudWatch Events's // API operation ListEventSources for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListEventSources @@ -1431,9 +1429,8 @@ func (c *CloudWatchEvents) ListPartnerEventSourceAccountsRequest(input *ListPart // ListPartnerEventSourceAccounts API operation for Amazon CloudWatch Events. // // An SaaS partner can use this operation to display the AWS account ID that -// a particular partner event source name is associated with. -// -// This operation is used by SaaS partners, not by AWS customers. +// a particular partner event source name is associated with. This operation +// is not used by AWS customers. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1442,11 +1439,11 @@ func (c *CloudWatchEvents) ListPartnerEventSourceAccountsRequest(input *ListPart // See the AWS API reference guide for Amazon CloudWatch Events's // API operation ListPartnerEventSourceAccounts for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListPartnerEventSourceAccounts @@ -1516,9 +1513,7 @@ func (c *CloudWatchEvents) ListPartnerEventSourcesRequest(input *ListPartnerEven // ListPartnerEventSources API operation for Amazon CloudWatch Events. // // An SaaS partner can use this operation to list all the partner event source -// names that they have created. -// -// This operation is not used by AWS customers. +// names that they have created. This operation is not used by AWS customers. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1527,8 +1522,8 @@ func (c *CloudWatchEvents) ListPartnerEventSourcesRequest(input *ListPartnerEven // See the AWS API reference guide for Amazon CloudWatch Events's // API operation ListPartnerEventSources for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListPartnerEventSources @@ -1597,8 +1592,8 @@ func (c *CloudWatchEvents) ListRuleNamesByTargetRequest(input *ListRuleNamesByTa // ListRuleNamesByTarget API operation for Amazon CloudWatch Events. // -// Lists the rules for the specified target. You can see which rules can invoke -// a specific target in your account. +// Lists the rules for the specified target. You can see which of the rules +// in Amazon EventBridge 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 @@ -1607,12 +1602,12 @@ func (c *CloudWatchEvents) ListRuleNamesByTargetRequest(input *ListRuleNamesByTa // See the AWS API reference guide for Amazon CloudWatch Events's // API operation ListRuleNamesByTarget for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // This exception occurs due to unexpected causes. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// * ResourceNotFoundException +// An entity that you specified does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRuleNamesByTarget func (c *CloudWatchEvents) ListRuleNamesByTarget(input *ListRuleNamesByTargetInput) (*ListRuleNamesByTargetOutput, error) { @@ -1680,10 +1675,10 @@ func (c *CloudWatchEvents) ListRulesRequest(input *ListRulesInput) (req *request // ListRules API operation for Amazon CloudWatch Events. // -// Lists your EventBridge rules. You can either list all the rules or provide -// a prefix to match to the rule names. +// Lists your Amazon EventBridge rules. You can either list all the rules or +// you can provide a prefix to match to the rule names. // -// ListRules doesn't list the targets of a rule. To see the targets associated +// ListRules does not list the targets of a rule. To see the targets associated // with a rule, use ListTargetsByRule. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1693,12 +1688,12 @@ func (c *CloudWatchEvents) ListRulesRequest(input *ListRulesInput) (req *request // See the AWS API reference guide for Amazon CloudWatch Events's // API operation ListRules for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // This exception occurs due to unexpected causes. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// * ResourceNotFoundException +// An entity that you specified does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListRules func (c *CloudWatchEvents) ListRules(input *ListRulesInput) (*ListRulesOutput, error) { @@ -1767,7 +1762,7 @@ func (c *CloudWatchEvents) ListTagsForResourceRequest(input *ListTagsForResource // ListTagsForResource API operation for Amazon CloudWatch Events. // // Displays the tags associated with an EventBridge resource. In EventBridge, -// rules can be tagged. +// rules and event buses can be tagged. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1776,11 +1771,11 @@ func (c *CloudWatchEvents) ListTagsForResourceRequest(input *ListTagsForResource // See the AWS API reference guide for Amazon CloudWatch Events's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListTagsForResource @@ -1858,11 +1853,11 @@ func (c *CloudWatchEvents) ListTargetsByRuleRequest(input *ListTargetsByRuleInpu // See the AWS API reference guide for Amazon CloudWatch Events's // API operation ListTargetsByRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/ListTargetsByRule @@ -1931,8 +1926,8 @@ func (c *CloudWatchEvents) PutEventsRequest(input *PutEventsInput) (req *request // PutEvents API operation for Amazon CloudWatch Events. // -// Sends custom events to EventBridge so that they can be matched to rules. -// These events can be from your custom applications and services. +// Sends custom events to Amazon EventBridge 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 @@ -1941,8 +1936,8 @@ func (c *CloudWatchEvents) PutEventsRequest(input *PutEventsInput) (req *request // See the AWS API reference guide for Amazon CloudWatch Events's // API operation PutEvents for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutEvents @@ -2012,10 +2007,7 @@ func (c *CloudWatchEvents) PutPartnerEventsRequest(input *PutPartnerEventsInput) // PutPartnerEvents API operation for Amazon CloudWatch Events. // // This is used by SaaS partners to write events to a customer's partner event -// bus. -// -// AWS customers do not use this operation. Instead, AWS customers can use PutEvents -// to write custom events from their own applications to an event bus. +// bus. AWS customers do not use 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 @@ -2024,8 +2016,8 @@ func (c *CloudWatchEvents) PutPartnerEventsRequest(input *PutPartnerEventsInput) // See the AWS API reference guide for Amazon CloudWatch Events's // API operation PutPartnerEvents for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutPartnerEvents @@ -2096,13 +2088,13 @@ func (c *CloudWatchEvents) PutPermissionRequest(input *PutPermissionInput) (req // PutPermission API operation for Amazon CloudWatch Events. // // Running PutPermission permits the specified AWS account or AWS organization -// to put events to the specified event bus. Rules in your account are triggered -// by these events arriving to an event bus in your account. +// to put events to the specified event bus. CloudWatch Events rules in your +// account are triggered by these events arriving to an event bus in your account. // // For another account to send events to your account, that external account -// must have a rule with your account's event bus as a target. +// must have an EventBridge rule with your account's event bus as a target. // -// To enable multiple AWS accounts to put events to an event bus, run PutPermission +// To enable multiple AWS accounts to put events to your event bus, run PutPermission // once for each of these accounts. Or, if all the accounts are members of the // same AWS organization, you can run PutPermission once specifying Principal // as "*" and specifying the AWS organization ID in Condition, to grant permissions @@ -2114,7 +2106,7 @@ func (c *CloudWatchEvents) PutPermissionRequest(input *PutPermissionInput) (req // and Receiving Events Between AWS Accounts (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) // in the Amazon EventBridge User Guide. // -// The permission policy on an event bus can't exceed 10 KB in size. +// The permission policy on the default event bus cannot exceed 10 KB 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 @@ -2123,18 +2115,18 @@ func (c *CloudWatchEvents) PutPermissionRequest(input *PutPermissionInput) (req // See the AWS API reference guide for Amazon CloudWatch Events's // API operation PutPermission for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodePolicyLengthExceededException "PolicyLengthExceededException" +// * PolicyLengthExceededException // The event bus policy is too long. For more information, see the limits. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a resource. +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutPermission func (c *CloudWatchEvents) PutPermission(input *PutPermissionInput) (*PutPermissionOutput, error) { @@ -2202,7 +2194,7 @@ func (c *CloudWatchEvents) PutRuleRequest(input *PutRuleInput) (req *request.Req // PutRule API operation for Amazon CloudWatch Events. // -// Creates or updates the specified rule. Rules are enabled by default or based +// 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. // // A single rule watches for events from a single event bus. Events generated @@ -2212,9 +2204,10 @@ func (c *CloudWatchEvents) PutRuleRequest(input *PutRuleInput) (req *request.Req // their events go to your default event bus or a custom event bus that you // have created. For more information, see CreateEventBus. // -// If you're updating an existing rule, the rule is replaced with what you specify -// in this PutRule command. If you omit arguments in PutRule, the old values -// for those arguments aren't kept. Instead, they're replaced with null values. +// If you are updating an existing rule, the rule is replaced with what you +// specify in this PutRule command. If you omit arguments in PutRule, the old +// values for those arguments are not kept. Instead, they are replaced with +// null values. // // When you create or update a rule, incoming events might not immediately start // matching to new or updated rules. Allow a short period of time for changes @@ -2240,16 +2233,15 @@ func (c *CloudWatchEvents) PutRuleRequest(input *PutRuleInput) (req *request.Req // Most services in AWS treat : or / as the same character in Amazon Resource // Names (ARNs). However, EventBridge 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 that you want to -// match. +// patterns so that they match the ARN syntax in the event you want to match. // -// In EventBridge, you could create rules that lead to infinite loops, where -// a rule is fired repeatedly. For example, a rule might detect that ACLs have -// changed on an S3 bucket, and trigger software to change them to the desired -// state. If you don't write the rule carefully, the subsequent change to the -// ACLs fires the rule again, creating an infinite loop. +// In EventBridge, it is possible to create rules that lead to infinite loops, +// where a rule is fired repeatedly. For example, a rule might detect that ACLs +// have changed on an S3 bucket, and trigger software to change them to the +// desired state. If the rule is not written carefully, the subsequent change +// to the ACLs fires the rule again, creating an infinite loop. // -// To prevent this, write the rules so that the triggered actions don't refire +// To prevent this, write the rules so that the triggered actions do not re-fire // the same rule. For example, your rule could fire only if ACLs are found to // be in a bad state, instead of after any change. // @@ -2264,28 +2256,29 @@ func (c *CloudWatchEvents) PutRuleRequest(input *PutRuleInput) (req *request.Req // 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 isn't valid. +// Returned Error Types: +// * InvalidEventPatternException +// The event pattern is not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" -// You tried to create more resources than is allowed. +// * 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 resource. +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. // -// * ErrCodeManagedRuleException "ManagedRuleException" -// An AWS service created this rule on behalf of your account. That service -// manages it. If you see this error in response to DeleteRule or RemoveTargets, -// you can use the Force parameter in those calls to delete the rule or remove -// targets from the rule. You can't modify these managed rules by using DisableRule, -// EnableRule, PutTargets, PutRule, TagResource, or UntagResource. +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// * ResourceNotFoundException +// An entity that you specified does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutRule func (c *CloudWatchEvents) PutRule(input *PutRuleInput) (*PutRuleOutput, error) { @@ -2354,11 +2347,11 @@ func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *reque // PutTargets API operation for Amazon CloudWatch Events. // // Adds the specified targets to the specified rule, or updates the targets -// if they're already associated with the rule. +// if they are already associated with the rule. // // Targets are the resources that are invoked when a rule is triggered. // -// You can configure the following as targets in EventBridge: +// You can configure the following as targets for Events: // // * EC2 instances // @@ -2390,7 +2383,7 @@ func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *reque // // * The default event bus of another AWS account // -// Creating rules with built-in targets is supported only on the AWS Management +// Creating rules with built-in targets is supported only in the AWS Management // Console. The built-in targets are EC2 CreateSnapshot API call, EC2 RebootInstances // API call, EC2 StopInstances API call, and EC2 TerminateInstances API call. // @@ -2400,28 +2393,31 @@ func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *reque // 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 EventBridge -// needs the appropriate permissions. For AWS Lambda and Amazon SNS resources, +// 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, // EventBridge relies on resource-based policies. For EC2 instances, Kinesis // data streams, and AWS Step Functions state machines, EventBridge relies on // IAM roles that you specify in the RoleARN argument in PutTargets. For more // information, see Authentication and Access Control (https://docs.aws.amazon.com/eventbridge/latest/userguide/auth-and-access-control-eventbridge.html) // in the Amazon EventBridge User Guide. // -// If another AWS account is in the same Region and has granted you permission +// If another AWS account is in the same region and has granted you permission // (using PutPermission), you can send events to that account. Set that account's // event bus as a target of the rules in your account. To send the matched events // to the other account, specify that account's event bus as the Arn value when // you run PutTargets. If your account sends events to another account, your // account is charged for each sent event. Each event sent to another account -// is charged as a custom event. The account receiving the event isn't charged. -// For more information, see Amazon EventBridge Pricing (https://aws.amazon.com/eventbridge/pricing/). +// is charged as a custom event. The account receiving the event is not charged. +// For more information, see Amazon CloudWatch Pricing (https://aws.amazon.com/cloudwatch/pricing/). // -// If you're setting an event bus in another account as the target and that +// Input, InputPath, and InputTransformer are not available with PutTarget if +// the target is an event bus of a different AWS account. +// +// If you are setting the event bus of another account as the target, and that // account granted permission to your account through an organization instead -// of directly by the account ID, you must specify a RoleArn with proper permissions -// in the Target structure. For more information, see Sending and Receiving -// Events Between AWS Accounts (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) +// of directly by the account ID, then you must specify a RoleArn with proper +// permissions in the Target structure. For more information, see Sending and +// Receiving Events Between AWS Accounts (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) // in the Amazon EventBridge User Guide. // // For more information about enabling cross-account events, see PutPermission. @@ -2429,21 +2425,21 @@ func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *reque // 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, the entire -// event is passed to the target in JSON format (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 none of the following arguments are specified for a target, then +// the entire event is passed to the target in JSON format (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), -// 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). +// 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, 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. +// * 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 specify InputPath or InputTransformer, you must use JSON dot notation, // not bracket notation. @@ -2453,7 +2449,7 @@ func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *reque // of time for changes to take effect. // // This action can partially fail if too many requests are made at the same -// time. If that happens, FailedEntryCount is nonzero in the response, and each +// time. If that happens, FailedEntryCount is non-zero in the response and each // entry in FailedEntries provides the ID of the failed target and the error // code. // @@ -2464,24 +2460,25 @@ func (c *CloudWatchEvents) PutTargetsRequest(input *PutTargetsInput) (req *reque // See the AWS API reference guide for Amazon CloudWatch Events's // API operation PutTargets for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a resource. +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. // -// * ErrCodeLimitExceededException "LimitExceededException" -// You tried to create more resources than is allowed. +// * LimitExceededException +// You tried to create more rules or add more targets to a rule than is allowed. // -// * ErrCodeManagedRuleException "ManagedRuleException" -// An AWS service created this rule on behalf of your account. That service -// manages it. If you see this error in response to DeleteRule or RemoveTargets, -// you can use the Force parameter in those calls to delete the rule or remove -// targets from the rule. You can't modify these managed rules by using DisableRule, -// EnableRule, PutTargets, PutRule, TagResource, or UntagResource. +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/PutTargets @@ -2563,15 +2560,15 @@ func (c *CloudWatchEvents) RemovePermissionRequest(input *RemovePermissionInput) // See the AWS API reference guide for Amazon CloudWatch Events's // API operation RemovePermission for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a resource. +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemovePermission func (c *CloudWatchEvents) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) { @@ -2658,21 +2655,22 @@ func (c *CloudWatchEvents) RemoveTargetsRequest(input *RemoveTargetsInput) (req // See the AWS API reference guide for Amazon CloudWatch Events's // API operation RemoveTargets for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a resource. +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. // -// * ErrCodeManagedRuleException "ManagedRuleException" -// An AWS service created this rule on behalf of your account. That service -// manages it. If you see this error in response to DeleteRule or RemoveTargets, -// you can use the Force parameter in those calls to delete the rule or remove -// targets from the rule. You can't modify these managed rules by using DisableRule, -// EnableRule, PutTargets, PutRule, TagResource, or UntagResource. +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/RemoveTargets @@ -2745,17 +2743,17 @@ func (c *CloudWatchEvents) TagResourceRequest(input *TagResourceInput) (req *req // Assigns one or more tags (key-value pairs) to the specified EventBridge resource. // Tags can help you organize and categorize your resources. You can also use // them to scope user permissions by granting a user permission to access or -// change only resources with certain tag values. In EventBridge, rules can -// be tagged. +// change only resources with certain tag values. In EventBridge, rules and +// event buses can be tagged. // // Tags don't have any semantic meaning to AWS and are interpreted strictly // as strings of characters. // -// You can use the TagResource action with a rule that already has tags. If -// you specify a new tag key for the rule, this tag is appended to the list -// of tags associated with the rule. If you specify a tag key that is already -// associated with the rule, the new tag value that you specify replaces the -// previous value for that tag. +// You can use the TagResource action with a resource that already has tags. +// If you specify a new tag key, this tag is appended to the list of tags associated +// with the resource. If you specify a tag key that is already associated with +// the resource, the new tag value that you specify replaces the previous value +// for that tag. // // You can associate as many as 50 tags with a resource. // @@ -2766,22 +2764,23 @@ func (c *CloudWatchEvents) TagResourceRequest(input *TagResourceInput) (req *req // See the AWS API reference guide for Amazon CloudWatch Events's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a resource. +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // -// * ErrCodeManagedRuleException "ManagedRuleException" -// An AWS service created this rule on behalf of your account. That service -// manages it. If you see this error in response to DeleteRule or RemoveTargets, -// you can use the Force parameter in those calls to delete the rule or remove -// targets from the rule. You can't modify these managed rules by using DisableRule, -// EnableRule, PutTargets, PutRule, TagResource, or UntagResource. +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/TagResource func (c *CloudWatchEvents) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { @@ -2854,8 +2853,7 @@ func (c *CloudWatchEvents) TestEventPatternRequest(input *TestEventPatternInput) // Most services in AWS treat : or / as the same character in Amazon Resource // Names (ARNs). However, EventBridge 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 that you want to -// match. +// 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 @@ -2864,11 +2862,11 @@ func (c *CloudWatchEvents) TestEventPatternRequest(input *TestEventPatternInput) // 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 isn't valid. +// Returned Error Types: +// * InvalidEventPatternException +// The event pattern is not valid. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/TestEventPattern @@ -2938,8 +2936,8 @@ func (c *CloudWatchEvents) UntagResourceRequest(input *UntagResourceInput) (req // UntagResource API operation for Amazon CloudWatch Events. // -// Removes one or more tags from the specified EventBridge resource. In EventBridge, -// rules can be tagged. +// Removes one or more tags from the specified EventBridge resource. In CloudWatch +// Events, rules and event buses can be tagged. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2948,22 +2946,23 @@ func (c *CloudWatchEvents) UntagResourceRequest(input *UntagResourceInput) (req // See the AWS API reference guide for Amazon CloudWatch Events's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// An entity that you specified doesn't exist. +// Returned Error Types: +// * ResourceNotFoundException +// An entity that you specified does not exist. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception occurs due to unexpected causes. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// There is concurrent modification on a resource. +// * ConcurrentModificationException +// There is concurrent modification on a rule or target. // -// * ErrCodeManagedRuleException "ManagedRuleException" -// An AWS service created this rule on behalf of your account. That service -// manages it. If you see this error in response to DeleteRule or RemoveTargets, -// you can use the Force parameter in those calls to delete the rule or remove -// targets from the rule. You can't modify these managed rules by using DisableRule, -// EnableRule, PutTargets, PutRule, TagResource, or UntagResource. +// * ManagedRuleException +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07/UntagResource func (c *CloudWatchEvents) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { @@ -3042,7 +3041,7 @@ func (s ActivateEventSourceOutput) GoString() string { return s.String() } -// This structure specifies the VPC subnets and security groups for the task +// This structure specifies the VPC subnets and security groups for the task, // and whether a public IP address is to be used. This structure is relevant // only for ECS tasks that use the awsvpc network mode. type AwsVpcConfiguration struct { @@ -3055,7 +3054,7 @@ type AwsVpcConfiguration struct { // Specifies the security groups associated with the task. These security groups // must all be in the same VPC. You can specify as many as five security groups. - // If you don't specify a security group, the default security group for the + // If you do not specify a security group, the default security group for the // VPC is used. SecurityGroups []*string `type:"list"` @@ -3157,8 +3156,8 @@ type BatchParameters struct { // JobName is a required field JobName *string `type:"string" required:"true"` - // The retry strategy to use for failed jobs if the target is an AWS Batch job. - // The retry strategy is the number of times to retry the failed job execution. + // The retry strategy to use for failed jobs, if the target is an AWS Batch + // job. The retry strategy is the number of times to retry the failed job execution. // Valid values are 1–10. When you specify a retry strategy here, it overrides // the retry strategy defined in the job definition. RetryStrategy *BatchRetryStrategy `type:"structure"` @@ -3214,9 +3213,9 @@ func (s *BatchParameters) SetRetryStrategy(v *BatchRetryStrategy) *BatchParamete return s } -// The retry strategy to use for failed jobs if the target is an AWS Batch job. -// If you specify a retry strategy here, it overrides the retry strategy defined -// in the job definition. +// The retry strategy to use for failed jobs, if the target is an AWS Batch +// job. If you specify a retry strategy here, it overrides the retry strategy +// defined in the job definition. type BatchRetryStrategy struct { _ struct{} `type:"structure"` @@ -3241,27 +3240,84 @@ func (s *BatchRetryStrategy) SetAttempts(v int64) *BatchRetryStrategy { return s } -// A JSON string that you can use to limit the event bus permissions that you're +// There is concurrent modification on a rule or target. +type ConcurrentModificationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentModificationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentModificationException) GoString() string { + return s.String() +} + +func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { + return &ConcurrentModificationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentModificationException) Code() string { + return "ConcurrentModificationException" +} + +// Message returns the exception's message. +func (s ConcurrentModificationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentModificationException) OrigErr() error { + return nil +} + +func (s ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentModificationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentModificationException) RequestID() string { + return s.respMetadata.RequestID +} + +// A JSON string which you can use to limit the event bus permissions you are // granting to only accounts that fulfill the condition. Currently, the only // supported condition is membership in a certain AWS organization. The string // must contain Type, Key, and Value fields. The Value field specifies the ID -// of the AWS organization. The following is an example value for Condition: +// of the AWS organization. Following is an example value for Condition: // // '{"Type" : "StringEquals", "Key": "aws:PrincipalOrgID", "Value": "o-1234567890"}' type Condition struct { _ struct{} `type:"structure"` - // The key for the condition. Currently, the only supported key is aws:PrincipalOrgID. + // Specifies the key for the condition. Currently the only supported key is + // aws:PrincipalOrgID. // // Key is a required field Key *string `type:"string" required:"true"` - // The type of condition. Currently, the only supported value is StringEquals. + // Specifies the type of condition. Currently the only supported value is StringEquals. // // Type is a required field Type *string `type:"string" required:"true"` - // The value for the key. Currently, this must be the ID of the organization. + // Specifies the value for the key. Currently, this must be the ID of the organization. // // Value is a required field Value *string `type:"string" required:"true"` @@ -3317,22 +3373,24 @@ func (s *Condition) SetValue(v string) *Condition { type CreateEventBusInput struct { _ struct{} `type:"structure"` - // If you're creating a partner event bus, this specifies the partner event + // If you are creating a partner event bus, this specifies the partner event // source that the new event bus will be matched with. EventSourceName *string `min:"1" type:"string"` // The name of the new event bus. // - // The names of custom event buses can't contain the / character. You can't - // use the name default for a custom event bus because this name is already - // used for your account's default event bus. + // Event bus names cannot contain the / character. You can't use the name default + // for a custom event bus, as this name is already used for your account's default + // event bus. // // If this is a partner event bus, the name must exactly match the name of the - // partner event source that this event bus is matched to. This name will include - // the / character. + // partner event source that this event bus is matched to. // // Name is a required field Name *string `min:"1" type:"string" required:"true"` + + // Tags to associate with the event bus. + Tags []*Tag `type:"list"` } // String returns the string representation @@ -3357,6 +3415,16 @@ func (s *CreateEventBusInput) Validate() error { if s.Name != nil && len(*s.Name) < 1 { invalidParams.Add(request.NewErrParamMinLen("Name", 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 @@ -3376,6 +3444,12 @@ func (s *CreateEventBusInput) SetName(v string) *CreateEventBusInput { return s } +// SetTags sets the Tags field's value. +func (s *CreateEventBusInput) SetTags(v []*Tag) *CreateEventBusInput { + s.Tags = v + return s +} + type CreateEventBusOutput struct { _ struct{} `type:"structure"` @@ -3402,8 +3476,8 @@ func (s *CreateEventBusOutput) SetEventBusArn(v string) *CreateEventBusOutput { type CreatePartnerEventSourceInput struct { _ struct{} `type:"structure"` - // The AWS account ID of the customer who is permitted to create a matching - // partner event bus for this partner event source. + // The AWS account ID that is permitted to create a matching partner event bus + // for this partner event source. // // Account is a required field Account *string `min:"12" type:"string" required:"true"` @@ -3880,18 +3954,18 @@ type DescribeEventSourceOutput struct { // The date and time that the event source was created. CreationTime *time.Time `type:"timestamp"` - // The date and time that the event source will expire if you don't create a - // matching event bus. + // The date and time that the event source will expire if you do not create + // a matching event bus. ExpirationTime *time.Time `type:"timestamp"` // The name of the partner event source. Name *string `type:"string"` - // The state of the event source. If it's ACTIVE, you have already created a - // matching event bus for this event source, and that event bus is active. If - // it's PENDING, either you haven't yet created a matching event bus, or that - // event bus is deactivated. If it's DELETED, you have created a matching event - // bus, but the event source has since been deleted. + // The state of the event source. If it is ACTIVE, you have already created + // a matching event bus for this event source, and that event bus is active. + // If it is PENDING, either you haven't yet created a matching event bus, or + // that event bus is deactivated. If it is DELETED, you have created a matching + // event bus, but the event source has since been deleted. State *string `type:"string" enum:"EventSourceState"` } @@ -4080,7 +4154,7 @@ type DescribeRuleOutput struct { // The event bus associated with the rule. EventBusName *string `min:"1" type:"string"` - // The event pattern. For more information, see Event Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) + // The event pattern. For more information, see Events and Event Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) // in the Amazon EventBridge User Guide. EventPattern *string `type:"string"` @@ -4094,7 +4168,7 @@ type DescribeRuleOutput struct { // 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 * * ? *)" or "rate(5 minutes)". + // The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)". ScheduleExpression *string `type:"string"` // Specifies whether the rule is enabled or disabled. @@ -4249,11 +4323,11 @@ type EcsParameters struct { LaunchType *string `type:"string" enum:"LaunchType"` // Use this structure if the ECS task uses the awsvpc network mode. This structure - // specifies the VPC subnets and security groups associated with the task and + // specifies the VPC subnets and security groups associated with the task, and // whether a public IP address is to be used. This structure is required if // LaunchType is FARGATE because the awsvpc mode is required for Fargate tasks. // - // If you specify NetworkConfiguration when the target ECS task doesn't use + // If you specify NetworkConfiguration when the target ECS task does not use // the awsvpc network mode, the task fails. NetworkConfiguration *NetworkConfiguration `type:"structure"` @@ -4473,21 +4547,21 @@ type EventSource struct { // The name of the partner that created the event source. CreatedBy *string `type:"string"` - // The date and time when the event source was created. + // The date and time the event source was created. CreationTime *time.Time `type:"timestamp"` - // The date and time when the event source will expire if the AWS account doesn't + // The date and time that the event source will expire, if the AWS account doesn't // create a matching event bus for it. ExpirationTime *time.Time `type:"timestamp"` // The name of the event source. Name *string `type:"string"` - // The state of the event source. If it's ACTIVE, you have already created a - // matching event bus for this event source, and that event bus is active. If - // it's PENDING, either you haven't yet created a matching event bus, or that - // event bus is deactivated. If it's DELETED, you have created a matching event - // bus, but the event source has since been deleted. + // The state of the event source. If it is ACTIVE, you have already created + // a matching event bus for this event source, and that event bus is active. + // If it is PENDING, either you haven't yet created a matching event bus, or + // that event bus is deactivated. If it is DELETED, you have created a matching + // event bus, but the event source has since been deleted. State *string `type:"string" enum:"EventSourceState"` } @@ -4543,27 +4617,27 @@ type InputTransformer struct { _ struct{} `type:"structure"` // Map of JSON paths to be extracted from the event. You can then insert these - // in the template in InputTemplate to produce the output to be sent to the - // target. + // in the template in InputTemplate to produce the output you want to be sent + // to the target. // // InputPathsMap is an array key-value pairs, where each value is a valid JSON // path. You can have as many as 10 key-value pairs. You must use JSON dot notation, // not bracket notation. // - // The keys can't start with "AWS". + // The keys cannot start with "AWS." InputPathsMap map[string]*string `type:"map"` // Input template where you specify placeholders that will be filled with the // values of the keys from InputPathsMap to customize the data sent to the target. - // Enclose each InputPathsMaps value in brackets: . The InputTemplate + // Enclose each InputPathsMaps value in brackets: The InputTemplate // must be valid JSON. // // If InputTemplate is a JSON object (surrounded by curly braces), the following // restrictions apply: // - // * The placeholder can't be used as an object key + // * The placeholder cannot be used as an object key. // - // * Object values can't include quote marks + // * Object values cannot include quote marks. // // The following example shows the syntax for using InputPathsMap and InputTemplate. // @@ -4632,10 +4706,178 @@ func (s *InputTransformer) SetInputTemplate(v string) *InputTransformer { return s } +// This exception occurs due to unexpected causes. +type InternalException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalException) GoString() string { + return s.String() +} + +func newErrorInternalException(v protocol.ResponseMetadata) error { + return &InternalException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalException) Code() string { + return "InternalException" +} + +// Message returns the exception's message. +func (s InternalException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalException) OrigErr() error { + return nil +} + +func (s InternalException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalException) RequestID() string { + return s.respMetadata.RequestID +} + +// The event pattern is not valid. +type InvalidEventPatternException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidEventPatternException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidEventPatternException) GoString() string { + return s.String() +} + +func newErrorInvalidEventPatternException(v protocol.ResponseMetadata) error { + return &InvalidEventPatternException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidEventPatternException) Code() string { + return "InvalidEventPatternException" +} + +// Message returns the exception's message. +func (s InvalidEventPatternException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidEventPatternException) OrigErr() error { + return nil +} + +func (s InvalidEventPatternException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidEventPatternException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidEventPatternException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified state is not a valid state for an event source. +type InvalidStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidStateException) GoString() string { + return s.String() +} + +func newErrorInvalidStateException(v protocol.ResponseMetadata) error { + return &InvalidStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidStateException) Code() string { + return "InvalidStateException" +} + +// Message returns the exception's message. +func (s InvalidStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidStateException) OrigErr() error { + return nil +} + +func (s InvalidStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidStateException) RequestID() string { + return s.respMetadata.RequestID +} + // This object enables you to specify a JSON path to extract from the event -// and use as the partition key for the Amazon Kinesis data stream so that you -// can control the shard that the event goes to. If you don't include this parameter, -// the default is to use the eventId as the partition key. +// and use as the partition key for the Amazon Kinesis data 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. type KinesisParameters struct { _ struct{} `type:"structure"` @@ -4676,12 +4918,68 @@ func (s *KinesisParameters) SetPartitionKeyPath(v string) *KinesisParameters { return s } +// You tried to create more rules or add more targets to a rule than is allowed. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListEventBusesInput struct { _ struct{} `type:"structure"` // Specifying this limits the number of results returned by this operation. - // The operation also returns a NextToken that you can use in a subsequent operation - // to retrieve the next set of results. + // The operation also returns a NextToken which you can use in a subsequent + // operation to retrieve the next set of results. Limit *int64 `min:"1" type:"integer"` // Specifying this limits the results to only those event buses with names that @@ -4776,8 +5074,8 @@ type ListEventSourcesInput struct { _ struct{} `type:"structure"` // Specifying this limits the number of results returned by this operation. - // The operation also returns a NextToken that you can use in a subsequent operation - // to retrieve the next set of results. + // The operation also returns a NextToken which you can use in a subsequent + // operation to retrieve the next set of results. Limit *int64 `min:"1" type:"integer"` // Specifying this limits the results to only those partner event sources with @@ -4877,8 +5175,8 @@ type ListPartnerEventSourceAccountsInput struct { EventSourceName *string `min:"1" type:"string" required:"true"` // Specifying this limits the number of results returned by this operation. - // The operation also returns a NextToken that you can use in a subsequent operation - // to retrieve the next set of results. + // The operation also returns a NextToken which you can use in a subsequent + // operation to retrieve the next set of results. Limit *int64 `min:"1" type:"integer"` // The token returned by a previous call to this operation. Specifying this @@ -4973,7 +5271,7 @@ type ListPartnerEventSourcesInput struct { _ struct{} `type:"structure"` // pecifying this limits the number of results returned by this operation. The - // operation also returns a NextToken that you can use in a subsequent operation + // operation also returns a NextToken which you can use in a subsequent operation // to retrieve the next set of results. Limit *int64 `min:"1" type:"integer"` @@ -5291,7 +5589,7 @@ func (s *ListRulesOutput) SetRules(v []*Rule) *ListRulesOutput { type ListTagsForResourceInput struct { _ struct{} `type:"structure"` - // The ARN of the rule for which you want to view tags. + // The ARN of the EventBridge resource for which you want to view tags. // // ResourceARN is a required field ResourceARN *string `min:"1" type:"string" required:"true"` @@ -5332,7 +5630,7 @@ func (s *ListTagsForResourceInput) SetResourceARN(v string) *ListTagsForResource type ListTagsForResourceOutput struct { _ struct{} `type:"structure"` - // The list of tag keys and values associated with the rule that you specified. + // The list of tag keys and values associated with the resource you specified Tags []*Tag `type:"list"` } @@ -5463,12 +5761,73 @@ func (s *ListTargetsByRuleOutput) SetTargets(v []*Target) *ListTargetsByRuleOutp return s } +// This rule was created by an AWS service on behalf of your account. It is +// managed by that service. If you see this error in response to DeleteRule +// or RemoveTargets, you can use the Force parameter in those calls to delete +// the rule or remove targets from the rule. You cannot modify these managed +// rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, +// or UntagResource. +type ManagedRuleException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ManagedRuleException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ManagedRuleException) GoString() string { + return s.String() +} + +func newErrorManagedRuleException(v protocol.ResponseMetadata) error { + return &ManagedRuleException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ManagedRuleException) Code() string { + return "ManagedRuleException" +} + +// Message returns the exception's message. +func (s ManagedRuleException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ManagedRuleException) OrigErr() error { + return nil +} + +func (s ManagedRuleException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ManagedRuleException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ManagedRuleException) RequestID() string { + return s.respMetadata.RequestID +} + // This structure specifies the network configuration for an ECS task. type NetworkConfiguration struct { _ struct{} `type:"structure"` // Use this structure to specify the VPC subnets and security groups for the - // task and whether a public IP address is to be used. This structure is relevant + // task, and whether a public IP address is to be used. This structure is relevant // only for ECS tasks that use the awsvpc network mode. AwsvpcConfiguration *AwsVpcConfiguration `locationName:"awsvpcConfiguration" type:"structure"` } @@ -5546,18 +5905,18 @@ type PartnerEventSourceAccount struct { // The AWS account ID that the partner event source was offered to. Account *string `min:"12" type:"string"` - // The date and time when the event source was created. + // The date and time the event source was created. CreationTime *time.Time `type:"timestamp"` - // The date and time when the event source will expire if the AWS account doesn't + // The date and time that the event source will expire, if the AWS account doesn't // create a matching event bus for it. ExpirationTime *time.Time `type:"timestamp"` - // The state of the event source. If it's ACTIVE, you have already created a - // matching event bus for this event source, and that event bus is active. If - // it's PENDING, either you haven't yet created a matching event bus, or that - // event bus is deactivated. If it's DELETED, you have created a matching event - // bus, but the event source has since been deleted. + // The state of the event source. If it is ACTIVE, you have already created + // a matching event bus for this event source, and that event bus is active. + // If it is PENDING, either you haven't yet created a matching event bus, or + // that event bus is deactivated. If it is DELETED, you have created a matching + // event bus, but the event source has since been deleted. State *string `type:"string" enum:"EventSourceState"` } @@ -5595,6 +5954,62 @@ func (s *PartnerEventSourceAccount) SetState(v string) *PartnerEventSourceAccoun return s } +// The event bus policy is too long. For more information, see the limits. +type PolicyLengthExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PolicyLengthExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyLengthExceededException) GoString() string { + return s.String() +} + +func newErrorPolicyLengthExceededException(v protocol.ResponseMetadata) error { + return &PolicyLengthExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PolicyLengthExceededException) Code() string { + return "PolicyLengthExceededException" +} + +// Message returns the exception's message. +func (s PolicyLengthExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PolicyLengthExceededException) OrigErr() error { + return nil +} + +func (s PolicyLengthExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PolicyLengthExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PolicyLengthExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type PutEventsInput struct { _ struct{} `type:"structure"` @@ -5686,26 +6101,26 @@ func (s *PutEventsOutput) SetFailedEntryCount(v int64) *PutEventsOutput { type PutEventsRequestEntry struct { _ struct{} `type:"structure"` - // A valid JSON string. There is no other schema imposed. The JSON string can + // A valid JSON string. There is no other schema imposed. The JSON string may // contain fields and nested subobjects. Detail *string `type:"string"` - // Free-form string used to decide which fields to expect in the event detail. + // Free-form string used to decide what fields to expect in the event detail. DetailType *string `type:"string"` // The event bus that will receive the event. Only the rules that are associated - // with this event bus can match the event. + // with this event bus will be able to match the event. EventBusName *string `min:"1" type:"string"` - // AWS resources, identified by Amazon Resource Name (ARN), that the event primarily - // concerns. Any number, including zero, can be present. + // 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. This field is required. + // 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. + // The time stamp of the event, per RFC3339 (https://www.rfc-editor.org/rfc/rfc3339.txt). + // If no time stamp is provided, the time stamp of the PutEvents call is used. Time *time.Time `type:"timestamp"` } @@ -5838,6 +6253,16 @@ func (s *PutPartnerEventsInput) Validate() error { 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 @@ -5858,7 +6283,7 @@ type PutPartnerEventsOutput struct { // the partner event bus. Entries []*PutPartnerEventsResultEntry `type:"list"` - // The number of events from this operation that couldn't be written to the + // The number of events from this operation that could not be written to the // partner event bus. FailedEntryCount *int64 `type:"integer"` } @@ -5889,19 +6314,19 @@ func (s *PutPartnerEventsOutput) SetFailedEntryCount(v int64) *PutPartnerEventsO type PutPartnerEventsRequestEntry struct { _ struct{} `type:"structure"` - // A valid JSON string. There is no other schema imposed. The JSON string can + // A valid JSON string. There is no other schema imposed. The JSON string may // contain fields and nested subobjects. Detail *string `type:"string"` - // A free-form string used to decide which fields to expect in the event detail. + // A 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), that the event primarily - // concerns. Any number, including zero, can be present. + // 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 event source that is generating the evntry. - Source *string `type:"string"` + Source *string `min:"1" type:"string"` // The date and time of the event. Time *time.Time `type:"timestamp"` @@ -5917,6 +6342,19 @@ func (s PutPartnerEventsRequestEntry) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutPartnerEventsRequestEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutPartnerEventsRequestEntry"} + if s.Source != nil && len(*s.Source) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Source", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetDetail sets the Detail field's value. func (s *PutPartnerEventsRequestEntry) SetDetail(v string) *PutPartnerEventsRequestEntry { s.Detail = &v @@ -5947,7 +6385,7 @@ func (s *PutPartnerEventsRequestEntry) SetTime(v time.Time) *PutPartnerEventsReq return s } -// Represents an event that a partner tried to generate but failed. +// Represents an event that a partner tried to generate, but failed. type PutPartnerEventsResultEntry struct { _ struct{} `type:"structure"` @@ -5992,7 +6430,7 @@ func (s *PutPartnerEventsResultEntry) SetEventId(v string) *PutPartnerEventsResu type PutPermissionInput struct { _ struct{} `type:"structure"` - // The action that you're enabling the other account to perform. Currently, + // The action that you are enabling the other account to perform. Currently, // this must be events:PutEvents. // // Action is a required field @@ -6000,15 +6438,15 @@ type PutPermissionInput struct { // This parameter enables you to limit the permission to accounts that fulfill // a certain condition, such as being a member of a certain AWS organization. - // For more information about AWS Organizations, see What Is AWS Organizations? + // For more information about AWS Organizations, see What Is AWS Organizations // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html) // in the AWS Organizations User Guide. // - // If you specify Condition with an AWS organization ID and specify "*" as the - // value for Principal, you grant permission to all the accounts in the named - // organization. + // If you specify Condition with an AWS organization ID, and specify "*" as + // the value for Principal, you grant permission to all the accounts in the + // named organization. // - // The Condition is a JSON string that must contain Type, Key, and Value fields. + // The Condition is a JSON string which must contain Type, Key, and Value fields. Condition *Condition `type:"structure"` // The event bus associated with the rule. If you omit this, the default event @@ -6020,15 +6458,15 @@ type PutPermissionInput struct { // default event bus. // // If you specify "*" without specifying Condition, avoid creating rules that - // might match undesirable events. To create more secure rules, make sure that + // may match undesirable events. To create more secure rules, make sure that // the event pattern for each rule contains an account field with a specific - // account ID to receive events from. Rules with an account field don't match - // any events sent from other accounts. + // account ID from which to receive events. Rules with an account field do not + // match any events sent from other accounts. // // Principal is a required field Principal *string `min:"1" type:"string" required:"true"` - // An identifier string for the external account that you're granting permissions + // An identifier string for the external account that you are granting permissions // to. If you later want to revoke the permission for this external account, // specify this StatementId when you run RemovePermission. // @@ -6136,11 +6574,11 @@ type PutRuleInput struct { // event bus is used. EventBusName *string `min:"1" type:"string"` - // The event pattern. For more information, see Event Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) + // The event pattern. For more information, see Events and Event Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) // in the Amazon EventBridge User Guide. EventPattern *string `type:"string"` - // The name of the rule that you're creating or updating. + // The name of the rule that you are creating or updating. // // Name is a required field Name *string `min:"1" type:"string" required:"true"` @@ -6148,7 +6586,7 @@ type PutRuleInput struct { // 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 * * ? *)" or "rate(5 minutes)". + // The scheduling expression. For example, "cron(0 20 * * ? *)" or "rate(5 minutes)". ScheduleExpression *string `type:"string"` // Indicates whether the rule is enabled or disabled. @@ -6503,11 +6941,11 @@ type RemoveTargetsInput struct { // The name of the event bus associated with the rule. EventBusName *string `min:"1" type:"string"` - // If this is a managed rule created by an AWS service on your behalf, you must - // specify Force as True to remove targets. This parameter is ignored for rules - // that aren't managed rules. You can check whether a rule is a managed rule - // by using DescribeRule or ListRules and checking the ManagedBy field of the - // response. + // If this is a managed rule, created by an AWS service on your behalf, you + // must specify Force as True to remove targets. This parameter is ignored for + // rules that are not managed rules. You can check whether a rule is a managed + // rule by using DescribeRule or ListRules and checking the ManagedBy field + // of the response. Force *bool `type:"boolean"` // The IDs of the targets to remove from the rule. @@ -6656,6 +7094,118 @@ func (s *RemoveTargetsResultEntry) SetTargetId(v string) *RemoveTargetsResultEnt return s } +// The resource you are trying to create already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// An entity that you specified does not exist. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains information about a rule in Amazon EventBridge. type Rule struct { _ struct{} `type:"structure"` @@ -6669,12 +7219,13 @@ type Rule struct { // The event bus associated with the rule. EventBusName *string `min:"1" type:"string"` - // The event pattern of the rule. For more information, see Event Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) + // The event pattern of the rule. For more information, see Events and Event + // Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) // in the Amazon EventBridge User Guide. EventPattern *string `type:"string"` - // If an AWS service created the rule on behalf of your account, this field - // displays the principal name of the service that created the rule. + // If the rule was created on behalf of your account by an AWS service, this + // field displays the principal name of the service that created the rule. ManagedBy *string `min:"1" type:"string"` // The name of the rule. @@ -6683,7 +7234,7 @@ type Rule struct { // 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 * * ? *)" or "rate(5 minutes)". + // The scheduling expression. For example, "cron(0 20 * * ? *)", "rate(5 minutes)". ScheduleExpression *string `type:"string"` // The state of the rule. @@ -6810,7 +7361,7 @@ func (s *RunCommandParameters) SetRunCommandTargets(v []*RunCommandTarget) *RunC // 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 can specify multiple values. +// but this key may specify multiple values. type RunCommandTarget struct { _ struct{} `type:"structure"` @@ -6895,13 +7446,13 @@ func (s *SqsParameters) SetMessageGroupId(v string) *SqsParameters { return s } -// A key-value pair associated with an AWS resource. In EventBridge, rules support -// tagging. +// A key-value pair associated with an AWS resource. In EventBridge, rules and +// event buses support tagging. type Tag struct { _ struct{} `type:"structure"` - // A string that you can use to assign a value. The combination of tag keys - // and values can help you organize and categorize your resources. + // A string you can use to assign a value. The combination of tag keys and values + // can help you organize and categorize your resources. // // Key is a required field Key *string `min:"1" type:"string" required:"true"` @@ -6956,12 +7507,12 @@ func (s *Tag) SetValue(v string) *Tag { type TagResourceInput struct { _ struct{} `type:"structure"` - // The ARN of the rule that you're adding tags to. + // The ARN of the EventBridge resource that you're adding tags to. // // ResourceARN is a required field ResourceARN *string `min:"1" type:"string" required:"true"` - // The list of key-value pairs to associate with the rule. + // The list of key-value pairs to associate with the resource. // // Tags is a required field Tags []*Tag `type:"list" required:"true"` @@ -7035,11 +7586,11 @@ func (s TagResourceOutput) GoString() string { // Targets are the resources to be invoked when a rule is triggered. For a complete // list of services and resources that can be set as a target, see PutTargets. // -// If you're setting the event bus of another account as the target and that +// If you are setting the event bus of another account as the target, and that // account granted permission to your account through an organization instead -// of directly by the account ID, you must specify a RoleArn with proper permissions -// in the Target structure. For more information, see Sending and Receiving -// Events Between AWS Accounts (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) +// of directly by the account ID, then you must specify a RoleArn with proper +// permissions in the Target structure. For more information, see Sending and +// Receiving Events Between AWS Accounts (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-cross-account-event-delivery.html) // in the Amazon EventBridge User Guide. type Target struct { _ struct{} `type:"structure"` @@ -7054,7 +7605,7 @@ type Target struct { // in the AWS Batch User Guide. BatchParameters *BatchParameters `type:"structure"` - // Contains the Amazon ECS task definition and task count to be used if the + // 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 (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_defintions.html) // in the Amazon EC2 Container Service Developer Guide. @@ -7080,9 +7631,9 @@ type Target struct { // then use that data to send customized input to the target. InputTransformer *InputTransformer `type:"structure"` - // The custom parameter that you can use to control the shard assignment when - // the target is a Kinesis data stream. If you don't include this parameter, - // the default is to use the eventId as the partition key. + // The custom parameter you can use to control the shard assignment, when the + // target is a Kinesis data 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 @@ -7234,7 +7785,7 @@ type TestEventPatternInput struct { // Event is a required field Event *string `type:"string" required:"true"` - // The event pattern. For more information, see Event Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) + // The event pattern. For more information, see Events and Event Patterns (https://docs.aws.amazon.com/eventbridge/latest/userguide/eventbridge-and-event-patterns.html) // in the Amazon EventBridge User Guide. // // EventPattern is a required field @@ -7305,7 +7856,7 @@ func (s *TestEventPatternOutput) SetResult(v bool) *TestEventPatternOutput { type UntagResourceInput struct { _ struct{} `type:"structure"` - // The ARN of the rule that you're removing tags from. + // The ARN of the EventBridge resource from which you are removing tags. // // ResourceARN is a required field ResourceARN *string `min:"1" type:"string" required:"true"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/doc.go b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/doc.go index e6efe0fa259..1078d124fb7 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/doc.go @@ -11,17 +11,17 @@ // to: // // * Automatically invoke an AWS Lambda function to update DNS entries when -// an event notifies you that Amazon EC2 instance enters the running state +// an event notifies you that Amazon EC2 instance enters the running state. // // * Direct specific API records from AWS CloudTrail to an Amazon Kinesis // data stream for detailed analysis of potential security or availability -// risks +// risks. // // * Periodically invoke a built-in target to create a snapshot of an Amazon -// EBS volume +// EBS volume. // // For more information about the features of Amazon EventBridge, see the Amazon -// EventBridge User Guide (https://docs.aws.amazon.com/eventbridge/latest/userguide/). +// EventBridge User Guide (https://docs.aws.amazon.com/eventbridge/latest/userguide). // // See https://docs.aws.amazon.com/goto/WebAPI/events-2015-10-07 for more information on this service. // 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 index 24efbdc1643..059007e401b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/errors.go @@ -2,12 +2,16 @@ package cloudwatchevents +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeConcurrentModificationException for service response error code // "ConcurrentModificationException". // - // There is concurrent modification on a resource. + // There is concurrent modification on a rule or target. ErrCodeConcurrentModificationException = "ConcurrentModificationException" // ErrCodeInternalException for service response error code @@ -19,29 +23,30 @@ const ( // ErrCodeInvalidEventPatternException for service response error code // "InvalidEventPatternException". // - // The event pattern isn't valid. + // The event pattern is not valid. ErrCodeInvalidEventPatternException = "InvalidEventPatternException" // ErrCodeInvalidStateException for service response error code // "InvalidStateException". // - // The specified state isn't a valid state for an event source. + // The specified state is not a valid state for an event source. ErrCodeInvalidStateException = "InvalidStateException" // ErrCodeLimitExceededException for service response error code // "LimitExceededException". // - // You tried to create more resources than is allowed. + // You tried to create more rules or add more targets to a rule than is allowed. ErrCodeLimitExceededException = "LimitExceededException" // ErrCodeManagedRuleException for service response error code // "ManagedRuleException". // - // An AWS service created this rule on behalf of your account. That service - // manages it. If you see this error in response to DeleteRule or RemoveTargets, - // you can use the Force parameter in those calls to delete the rule or remove - // targets from the rule. You can't modify these managed rules by using DisableRule, - // EnableRule, PutTargets, PutRule, TagResource, or UntagResource. + // This rule was created by an AWS service on behalf of your account. It is + // managed by that service. If you see this error in response to DeleteRule + // or RemoveTargets, you can use the Force parameter in those calls to delete + // the rule or remove targets from the rule. You cannot modify these managed + // rules by using DisableRule, EnableRule, PutTargets, PutRule, TagResource, + // or UntagResource. ErrCodeManagedRuleException = "ManagedRuleException" // ErrCodePolicyLengthExceededException for service response error code @@ -53,12 +58,24 @@ const ( // ErrCodeResourceAlreadyExistsException for service response error code // "ResourceAlreadyExistsException". // - // The resource that you're trying to create already exists. + // The resource you are trying to create already exists. ErrCodeResourceAlreadyExistsException = "ResourceAlreadyExistsException" // ErrCodeResourceNotFoundException for service response error code // "ResourceNotFoundException". // - // An entity that you specified doesn't exist. + // An entity that you specified does not exist. ErrCodeResourceNotFoundException = "ResourceNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ConcurrentModificationException": newErrorConcurrentModificationException, + "InternalException": newErrorInternalException, + "InvalidEventPatternException": newErrorInvalidEventPatternException, + "InvalidStateException": newErrorInvalidStateException, + "LimitExceededException": newErrorLimitExceededException, + "ManagedRuleException": newErrorManagedRuleException, + "PolicyLengthExceededException": newErrorPolicyLengthExceededException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceNotFoundException": newErrorResourceNotFoundException, +} 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 index 2a7f6969cd8..b52dda40fa6 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchevents/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "events" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "CloudWatch Events" // ServiceID is a unique identifer of a specific service. + ServiceID = "CloudWatch Events" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CloudWatchEvents client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CloudWatchEvents client from just a session. // svc := cloudwatchevents.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CloudWatchEvents { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CloudWatchEvents { svc := &CloudWatchEvents{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-10-07", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 87cbacabc29..594ec846d09 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/api.go @@ -67,6 +67,10 @@ func (c *CloudWatchLogs) AssociateKmsKeyRequest(input *AssociateKmsKeyInput) (re // within Amazon CloudWatch Logs. This enables Amazon CloudWatch Logs to decrypt // this data whenever it is requested. // +// Important: CloudWatch Logs supports only symmetric CMKs. Do not use an associate +// an asymmetric CMK with your log group. For more information, see Using Symmetric +// and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html). +// // Note that it can take up to 5 minutes for this operation to take effect. // // If you attempt to associate a CMK with a log group but the CMK does not exist @@ -79,17 +83,17 @@ func (c *CloudWatchLogs) AssociateKmsKeyRequest(input *AssociateKmsKeyInput) (re // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation AssociateKmsKey for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeOperationAbortedException "OperationAbortedException" +// * OperationAbortedException // Multiple requests to update the same resource were in conflict. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/AssociateKmsKey @@ -170,17 +174,17 @@ func (c *CloudWatchLogs) CancelExportTaskRequest(input *CancelExportTaskInput) ( // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation CancelExportTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // The operation is not valid on the specified resource. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CancelExportTask @@ -272,23 +276,23 @@ func (c *CloudWatchLogs) CreateExportTaskRequest(input *CreateExportTaskInput) ( // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation CreateExportTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have reached the maximum number of resources that can be created. // -// * ErrCodeOperationAbortedException "OperationAbortedException" +// * OperationAbortedException // Multiple requests to update the same resource were in conflict. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateExportTask @@ -360,7 +364,7 @@ func (c *CloudWatchLogs) CreateLogGroupRequest(input *CreateLogGroupInput) (req // // Creates a log group with the specified name. // -// You can create up to 5000 log groups per account. +// You can create up to 20,000 log groups per account. // // You must use the following guidelines when naming a log group: // @@ -369,7 +373,8 @@ func (c *CloudWatchLogs) CreateLogGroupRequest(input *CreateLogGroupInput) (req // * 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). +// '_' (underscore), '-' (hyphen), '/' (forward slash), '.' (period), and +// '#' (number sign) // // If you associate a AWS Key Management Service (AWS KMS) customer master key // (CMK) with the log group, ingested data is encrypted using the CMK. This @@ -381,6 +386,10 @@ func (c *CloudWatchLogs) CreateLogGroupRequest(input *CreateLogGroupInput) (req // exist or the CMK is disabled, you will receive an InvalidParameterException // error. // +// Important: CloudWatch Logs supports only symmetric CMKs. Do not associate +// an asymmetric CMK with your log group. For more information, see Using Symmetric +// and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.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. @@ -388,20 +397,20 @@ func (c *CloudWatchLogs) CreateLogGroupRequest(input *CreateLogGroupInput) (req // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation CreateLogGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have reached the maximum number of resources that can be created. // -// * ErrCodeOperationAbortedException "OperationAbortedException" +// * OperationAbortedException // Multiple requests to update the same resource were in conflict. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateLogGroup @@ -474,7 +483,8 @@ func (c *CloudWatchLogs) CreateLogStreamRequest(input *CreateLogStreamInput) (re // 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. +// log group. There is a limit of 50 TPS on CreateLogStream operations, after +// which transactions are throttled. // // You must use the following guidelines when naming a log stream: // @@ -491,17 +501,17 @@ func (c *CloudWatchLogs) CreateLogStreamRequest(input *CreateLogStreamInput) (re // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation CreateLogStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/CreateLogStream @@ -582,17 +592,17 @@ func (c *CloudWatchLogs) DeleteDestinationRequest(input *DeleteDestinationInput) // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DeleteDestination for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeOperationAbortedException "OperationAbortedException" +// * OperationAbortedException // Multiple requests to update the same resource were in conflict. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteDestination @@ -672,17 +682,17 @@ func (c *CloudWatchLogs) DeleteLogGroupRequest(input *DeleteLogGroupInput) (req // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DeleteLogGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeOperationAbortedException "OperationAbortedException" +// * OperationAbortedException // Multiple requests to update the same resource were in conflict. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteLogGroup @@ -762,17 +772,17 @@ func (c *CloudWatchLogs) DeleteLogStreamRequest(input *DeleteLogStreamInput) (re // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DeleteLogStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeOperationAbortedException "OperationAbortedException" +// * OperationAbortedException // Multiple requests to update the same resource were in conflict. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteLogStream @@ -851,17 +861,17 @@ func (c *CloudWatchLogs) DeleteMetricFilterRequest(input *DeleteMetricFilterInpu // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DeleteMetricFilter for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeOperationAbortedException "OperationAbortedException" +// * OperationAbortedException // Multiple requests to update the same resource were in conflict. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteMetricFilter @@ -941,14 +951,14 @@ func (c *CloudWatchLogs) DeleteResourcePolicyRequest(input *DeleteResourcePolicy // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DeleteResourcePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteResourcePolicy @@ -1030,17 +1040,17 @@ func (c *CloudWatchLogs) DeleteRetentionPolicyRequest(input *DeleteRetentionPoli // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DeleteRetentionPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeOperationAbortedException "OperationAbortedException" +// * OperationAbortedException // Multiple requests to update the same resource were in conflict. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteRetentionPolicy @@ -1119,17 +1129,17 @@ func (c *CloudWatchLogs) DeleteSubscriptionFilterRequest(input *DeleteSubscripti // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DeleteSubscriptionFilter for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeOperationAbortedException "OperationAbortedException" +// * OperationAbortedException // Multiple requests to update the same resource were in conflict. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DeleteSubscriptionFilter @@ -1214,11 +1224,11 @@ func (c *CloudWatchLogs) DescribeDestinationsRequest(input *DescribeDestinations // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DescribeDestinations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeDestinations @@ -1287,10 +1297,12 @@ func (c *CloudWatchLogs) DescribeDestinationsPagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDestinationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDestinationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1348,11 +1360,11 @@ func (c *CloudWatchLogs) DescribeExportTasksRequest(input *DescribeExportTasksIn // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DescribeExportTasks for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeExportTasks @@ -1437,11 +1449,11 @@ func (c *CloudWatchLogs) DescribeLogGroupsRequest(input *DescribeLogGroupsInput) // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DescribeLogGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeLogGroups @@ -1510,10 +1522,12 @@ func (c *CloudWatchLogs) DescribeLogGroupsPagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeLogGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeLogGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1581,14 +1595,14 @@ func (c *CloudWatchLogs) DescribeLogStreamsRequest(input *DescribeLogStreamsInpu // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DescribeLogStreams for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeLogStreams @@ -1657,10 +1671,12 @@ func (c *CloudWatchLogs) DescribeLogStreamsPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeLogStreamsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeLogStreamsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1725,14 +1741,14 @@ func (c *CloudWatchLogs) DescribeMetricFiltersRequest(input *DescribeMetricFilte // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DescribeMetricFilters for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeMetricFilters @@ -1801,10 +1817,12 @@ func (c *CloudWatchLogs) DescribeMetricFiltersPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeMetricFiltersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeMetricFiltersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1864,14 +1882,14 @@ func (c *CloudWatchLogs) DescribeQueriesRequest(input *DescribeQueriesInput) (re // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DescribeQueries for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeQueries @@ -1949,11 +1967,11 @@ func (c *CloudWatchLogs) DescribeResourcePoliciesRequest(input *DescribeResource // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DescribeResourcePolicies for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeResourcePolicies @@ -2039,14 +2057,14 @@ func (c *CloudWatchLogs) DescribeSubscriptionFiltersRequest(input *DescribeSubsc // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DescribeSubscriptionFilters for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DescribeSubscriptionFilters @@ -2115,10 +2133,12 @@ func (c *CloudWatchLogs) DescribeSubscriptionFiltersPagesWithContext(ctx aws.Con }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSubscriptionFiltersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeSubscriptionFiltersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2184,17 +2204,17 @@ func (c *CloudWatchLogs) DisassociateKmsKeyRequest(input *DisassociateKmsKeyInpu // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation DisassociateKmsKey for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeOperationAbortedException "OperationAbortedException" +// * OperationAbortedException // Multiple requests to update the same resource were in conflict. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/DisassociateKmsKey @@ -2286,14 +2306,14 @@ func (c *CloudWatchLogs) FilterLogEventsRequest(input *FilterLogEventsInput) (re // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation FilterLogEvents for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/FilterLogEvents @@ -2362,10 +2382,12 @@ func (c *CloudWatchLogs) FilterLogEventsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*FilterLogEventsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*FilterLogEventsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2433,14 +2455,14 @@ func (c *CloudWatchLogs) GetLogEventsRequest(input *GetLogEventsInput) (req *req // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation GetLogEvents for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/GetLogEvents @@ -2509,10 +2531,12 @@ func (c *CloudWatchLogs) GetLogEventsPagesWithContext(ctx aws.Context, input *Ge }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetLogEventsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetLogEventsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2577,17 +2601,17 @@ func (c *CloudWatchLogs) GetLogGroupFieldsRequest(input *GetLogGroupFieldsInput) // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation GetLogGroupFields for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have reached the maximum number of resources that can be created. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/GetLogGroupFields @@ -2670,17 +2694,17 @@ func (c *CloudWatchLogs) GetLogRecordRequest(input *GetLogRecordInput) (req *req // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation GetLogRecord for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have reached the maximum number of resources that can be created. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/GetLogRecord @@ -2768,14 +2792,14 @@ func (c *CloudWatchLogs) GetQueryResultsRequest(input *GetQueryResultsInput) (re // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation GetQueryResults for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/GetQueryResults @@ -2853,11 +2877,11 @@ func (c *CloudWatchLogs) ListTagsLogGroupRequest(input *ListTagsLogGroupInput) ( // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation ListTagsLogGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/ListTagsLogGroup @@ -2926,11 +2950,12 @@ func (c *CloudWatchLogs) PutDestinationRequest(input *PutDestinationInput) (req // PutDestination API operation for Amazon CloudWatch Logs. // -// Creates or updates a destination. A destination encapsulates a physical resource -// (such as an Amazon Kinesis stream) and enables you to subscribe to a real-time -// stream of log events for a different account, ingested using PutLogEvents. -// A destination can be an Amazon Kinesis stream, Amazon Kinesis Data Firehose -// strea, or an AWS Lambda function. +// Creates or updates a destination. This operation is used only to create destinations +// for cross-account subscriptions. +// +// A destination encapsulates a physical resource (such as an Amazon Kinesis +// stream) and enables you to subscribe to a real-time stream of log events +// for a different account, ingested using PutLogEvents. // // Through an access policy, a destination controls what is written to it. By // default, PutDestination does not set any access policy with the destination, @@ -2945,14 +2970,14 @@ func (c *CloudWatchLogs) PutDestinationRequest(input *PutDestinationInput) (req // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation PutDestination for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeOperationAbortedException "OperationAbortedException" +// * OperationAbortedException // Multiple requests to update the same resource were in conflict. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutDestination @@ -3034,14 +3059,14 @@ func (c *CloudWatchLogs) PutDestinationPolicyRequest(input *PutDestinationPolicy // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation PutDestinationPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeOperationAbortedException "OperationAbortedException" +// * OperationAbortedException // Multiple requests to update the same resource were in conflict. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutDestinationPolicy @@ -3114,9 +3139,10 @@ func (c *CloudWatchLogs) PutLogEventsRequest(input *PutLogEventsInput) (req *req // // 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. If you -// call PutLogEvents twice within a narrow time period using the same value -// for sequenceToken, both calls may be successful, or one may be rejected. +// token. You can also get the sequence token in the expectedSequenceToken field +// from InvalidSequenceTokenException. If you call PutLogEvents twice within +// a narrow time period using the same value for sequenceToken, both calls may +// be successful, or one may be rejected. // // The batch of events must satisfy the following constraints: // @@ -3136,11 +3162,14 @@ func (c *CloudWatchLogs) PutLogEventsRequest(input *PutLogEventsInput) (req *req // for PowerShell and the AWS SDK for .NET, the timestamp is specified in // .NET format: yyyy-mm-ddThh:mm:ss. For example, 2017-09-15T13:45:30.) // -// * 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. // +// * The maximum number of log events in a batch is 10,000. +// +// * There is a quota of 5 requests per second per log stream. Additional +// requests are throttled. This quota can't be changed. +// // If a call to PutLogEvents returns "UnrecognizedClientException" the most // likely cause is an invalid AWS access key ID or secret key. // @@ -3151,23 +3180,24 @@ func (c *CloudWatchLogs) PutLogEventsRequest(input *PutLogEventsInput) (req *req // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation PutLogEvents for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeInvalidSequenceTokenException "InvalidSequenceTokenException" -// The sequence token is not valid. +// * InvalidSequenceTokenException +// The sequence token is not valid. You can get the correct sequence token in +// the expectedSequenceToken field in the InvalidSequenceTokenException message. // -// * ErrCodeDataAlreadyAcceptedException "DataAlreadyAcceptedException" +// * DataAlreadyAcceptedException // The event was already logged. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // -// * ErrCodeUnrecognizedClientException "UnrecognizedClientException" +// * UnrecognizedClientException // The most likely cause is an invalid AWS access key ID or secret key. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutLogEvents @@ -3251,20 +3281,20 @@ func (c *CloudWatchLogs) PutMetricFilterRequest(input *PutMetricFilterInput) (re // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation PutMetricFilter for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeOperationAbortedException "OperationAbortedException" +// * OperationAbortedException // Multiple requests to update the same resource were in conflict. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have reached the maximum number of resources that can be created. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutMetricFilter @@ -3344,14 +3374,14 @@ func (c *CloudWatchLogs) PutResourcePolicyRequest(input *PutResourcePolicyInput) // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation PutResourcePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have reached the maximum number of resources that can be created. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutResourcePolicy @@ -3432,17 +3462,17 @@ func (c *CloudWatchLogs) PutRetentionPolicyRequest(input *PutRetentionPolicyInpu // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation PutRetentionPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeOperationAbortedException "OperationAbortedException" +// * OperationAbortedException // Multiple requests to update the same resource were in conflict. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutRetentionPolicy @@ -3541,20 +3571,20 @@ func (c *CloudWatchLogs) PutSubscriptionFilterRequest(input *PutSubscriptionFilt // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation PutSubscriptionFilter for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeOperationAbortedException "OperationAbortedException" +// * OperationAbortedException // Multiple requests to update the same resource were in conflict. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have reached the maximum number of resources that can be created. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/PutSubscriptionFilter @@ -3639,24 +3669,24 @@ func (c *CloudWatchLogs) StartQueryRequest(input *StartQueryInput) (req *request // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation StartQuery for usage and error information. // -// Returned Error Codes: -// * ErrCodeMalformedQueryException "MalformedQueryException" +// Returned Error Types: +// * MalformedQueryException // The query string is not valid. Details about this error are displayed in // a QueryCompileError object. For more information, see . // // For more information about valid query syntax, see CloudWatch Logs Insights // Query Syntax (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html). // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have reached the maximum number of resources that can be created. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/StartQuery @@ -3736,14 +3766,14 @@ func (c *CloudWatchLogs) StopQueryRequest(input *StopQueryInput) (req *request.R // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation StopQuery for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/StopQuery @@ -3829,11 +3859,11 @@ func (c *CloudWatchLogs) TagLogGroupRequest(input *TagLogGroupInput) (req *reque // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation TagLogGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // A parameter is specified incorrectly. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/TagLogGroup @@ -3913,11 +3943,11 @@ func (c *CloudWatchLogs) TestMetricFilterRequest(input *TestMetricFilterInput) ( // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation TestMetricFilter for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is specified incorrectly. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/TestMetricFilter @@ -3999,8 +4029,8 @@ func (c *CloudWatchLogs) UntagLogGroupRequest(input *UntagLogGroupInput) (req *r // See the AWS API reference guide for Amazon CloudWatch Logs's // API operation UntagLogGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/logs-2014-03-28/UntagLogGroup @@ -4029,8 +4059,9 @@ type AssociateKmsKeyInput struct { _ struct{} `type:"structure"` // The Amazon Resource Name (ARN) of the CMK to use when encrypting log data. - // For more information, see Amazon Resource Names - AWS Key Management Service - // (AWS KMS) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms). + // This must be a symmetric CMK. For more information, see Amazon Resource Names + // - AWS Key Management Service (AWS KMS) (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms) + // and Using Symmetric and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html). // // KmsKeyId is a required field KmsKeyId *string `locationName:"kmsKeyId" type:"string" required:"true"` @@ -4450,6 +4481,64 @@ func (s CreateLogStreamOutput) GoString() string { return s.String() } +// The event was already logged. +type DataAlreadyAcceptedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + ExpectedSequenceToken *string `locationName:"expectedSequenceToken" min:"1" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DataAlreadyAcceptedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataAlreadyAcceptedException) GoString() string { + return s.String() +} + +func newErrorDataAlreadyAcceptedException(v protocol.ResponseMetadata) error { + return &DataAlreadyAcceptedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DataAlreadyAcceptedException) Code() string { + return "DataAlreadyAcceptedException" +} + +// Message returns the exception's message. +func (s DataAlreadyAcceptedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DataAlreadyAcceptedException) OrigErr() error { + return nil +} + +func (s DataAlreadyAcceptedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DataAlreadyAcceptedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DataAlreadyAcceptedException) RequestID() string { + return s.respMetadata.RequestID +} + type DeleteDestinationInput struct { _ struct{} `type:"structure"` @@ -6311,6 +6400,8 @@ type GetLogEventsInput struct { // The token for the next set of items to return. (You received this token from // a previous call.) + // + // Using this token works only when you specify true for startFromHead. NextToken *string `locationName:"nextToken" min:"1" type:"string"` // If the value is true, the earliest log events are returned first. If the @@ -6745,6 +6836,233 @@ func (s *InputLogEvent) SetTimestamp(v int64) *InputLogEvent { return s } +// The operation is not valid on the specified resource. +type InvalidOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidOperationException) GoString() string { + return s.String() +} + +func newErrorInvalidOperationException(v protocol.ResponseMetadata) error { + return &InvalidOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidOperationException) Code() string { + return "InvalidOperationException" +} + +// Message returns the exception's message. +func (s InvalidOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidOperationException) OrigErr() error { + return nil +} + +func (s InvalidOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidOperationException) RequestID() string { + return s.respMetadata.RequestID +} + +// A parameter is specified incorrectly. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} + +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// The sequence token is not valid. You can get the correct sequence token in +// the expectedSequenceToken field in the InvalidSequenceTokenException message. +type InvalidSequenceTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + ExpectedSequenceToken *string `locationName:"expectedSequenceToken" min:"1" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidSequenceTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidSequenceTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidSequenceTokenException(v protocol.ResponseMetadata) error { + return &InvalidSequenceTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidSequenceTokenException) Code() string { + return "InvalidSequenceTokenException" +} + +// Message returns the exception's message. +func (s InvalidSequenceTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidSequenceTokenException) OrigErr() error { + return nil +} + +func (s InvalidSequenceTokenException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidSequenceTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidSequenceTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// You have reached the maximum number of resources that can be created. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListTagsLogGroupInput struct { _ struct{} `type:"structure"` @@ -6956,9 +7274,9 @@ type LogStream struct { // The number of bytes stored. // - // IMPORTANT: Starting on June 17, 2019, this parameter will be deprecated for - // log streams, and will be reported as zero. This change applies only to log - // streams. The storedBytes parameter for log groups is not affected. + // IMPORTANT:On June 17, 2019, this parameter was deprecated for log streams, + // and is always reported as zero. This change applies only to log streams. + // The storedBytes parameter for log groups is not affected. // // Deprecated: Starting on June 17, 2019, this parameter will be deprecated for log streams, and will be reported as zero. This change applies only to log streams. The storedBytes parameter for log groups is not affected. StoredBytes *int64 `locationName:"storedBytes" deprecated:"true" type:"long"` @@ -7025,6 +7343,69 @@ func (s *LogStream) SetUploadSequenceToken(v string) *LogStream { return s } +// The query string is not valid. Details about this error are displayed in +// a QueryCompileError object. For more information, see . +// +// For more information about valid query syntax, see CloudWatch Logs Insights +// Query Syntax (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html). +type MalformedQueryException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + // Reserved. + QueryCompileError *QueryCompileError `locationName:"queryCompileError" type:"structure"` +} + +// String returns the string representation +func (s MalformedQueryException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MalformedQueryException) GoString() string { + return s.String() +} + +func newErrorMalformedQueryException(v protocol.ResponseMetadata) error { + return &MalformedQueryException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MalformedQueryException) Code() string { + return "MalformedQueryException" +} + +// Message returns the exception's message. +func (s MalformedQueryException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MalformedQueryException) OrigErr() error { + return nil +} + +func (s MalformedQueryException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MalformedQueryException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MalformedQueryException) RequestID() string { + return s.respMetadata.RequestID +} + // Metric filters express how CloudWatch Logs would extract metric observations // from ingested log events and transform them into metric data in a CloudWatch // metric. @@ -7212,6 +7593,62 @@ func (s *MetricTransformation) SetMetricValue(v string) *MetricTransformation { return s } +// Multiple requests to update the same resource were in conflict. +type OperationAbortedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s OperationAbortedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OperationAbortedException) GoString() string { + return s.String() +} + +func newErrorOperationAbortedException(v protocol.ResponseMetadata) error { + return &OperationAbortedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OperationAbortedException) Code() string { + return "OperationAbortedException" +} + +// Message returns the exception's message. +func (s OperationAbortedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OperationAbortedException) OrigErr() error { + return nil +} + +func (s OperationAbortedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OperationAbortedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OperationAbortedException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents a log event. type OutputLogEvent struct { _ struct{} `type:"structure"` @@ -8183,6 +8620,118 @@ func (s *RejectedLogEventsInfo) SetTooOldLogEventEndIndex(v int64) *RejectedLogE return s } +// The specified resource already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource does not exist. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // A policy enabling one or more entities to put logs to a log group in this // account. type ResourcePolicy struct { @@ -8294,6 +8843,62 @@ func (s *SearchedLogStream) SetSearchedCompletely(v bool) *SearchedLogStream { return s } +// The service cannot complete the request. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + type StartQueryInput struct { _ struct{} `type:"structure"` @@ -8306,6 +8911,7 @@ type StartQueryInput struct { // The maximum number of log events to return in the query. If the query string // uses the fields command, only the specified fields and their values are returned. + // The default is 1000. Limit *int64 `locationName:"limit" min:"1" type:"integer"` // The log group on which to perform the query. @@ -8725,6 +9331,62 @@ func (s *TestMetricFilterOutput) SetMatches(v []*MetricFilterMatchRecord) *TestM return s } +// The most likely cause is an invalid AWS access key ID or secret key. +type UnrecognizedClientException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnrecognizedClientException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnrecognizedClientException) GoString() string { + return s.String() +} + +func newErrorUnrecognizedClientException(v protocol.ResponseMetadata) error { + return &UnrecognizedClientException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnrecognizedClientException) Code() string { + return "UnrecognizedClientException" +} + +// Message returns the exception's message. +func (s UnrecognizedClientException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnrecognizedClientException) OrigErr() error { + return nil +} + +func (s UnrecognizedClientException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnrecognizedClientException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnrecognizedClientException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagLogGroupInput struct { _ struct{} `type:"structure"` 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 index d300de63a9a..c6e23336d00 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/errors.go @@ -2,6 +2,10 @@ package cloudwatchlogs +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeDataAlreadyAcceptedException for service response error code @@ -25,7 +29,8 @@ const ( // ErrCodeInvalidSequenceTokenException for service response error code // "InvalidSequenceTokenException". // - // The sequence token is not valid. + // The sequence token is not valid. You can get the correct sequence token in + // the expectedSequenceToken field in the InvalidSequenceTokenException message. ErrCodeInvalidSequenceTokenException = "InvalidSequenceTokenException" // ErrCodeLimitExceededException for service response error code @@ -74,3 +79,17 @@ const ( // The most likely cause is an invalid AWS access key ID or secret key. ErrCodeUnrecognizedClientException = "UnrecognizedClientException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "DataAlreadyAcceptedException": newErrorDataAlreadyAcceptedException, + "InvalidOperationException": newErrorInvalidOperationException, + "InvalidParameterException": newErrorInvalidParameterException, + "InvalidSequenceTokenException": newErrorInvalidSequenceTokenException, + "LimitExceededException": newErrorLimitExceededException, + "MalformedQueryException": newErrorMalformedQueryException, + "OperationAbortedException": newErrorOperationAbortedException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ServiceUnavailableException": newErrorServiceUnavailableException, + "UnrecognizedClientException": newErrorUnrecognizedClientException, +} 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 index 8d5f929df84..41520eda946 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cloudwatchlogs/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "logs" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "CloudWatch Logs" // ServiceID is a unique identifer of a specific service. + ServiceID = "CloudWatch Logs" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CloudWatchLogs client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CloudWatchLogs client from just a session. // svc := cloudwatchlogs.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CloudWatchLogs { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CloudWatchLogs { svc := &CloudWatchLogs{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2014-03-28", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index dd4e19bf8f7..c22775a00ad 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codebuild/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codebuild/api.go @@ -66,8 +66,8 @@ func (c *CodeBuild) BatchDeleteBuildsRequest(input *BatchDeleteBuildsInput) (req // See the AWS API reference guide for AWS CodeBuild's // API operation BatchDeleteBuilds for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input value that was provided is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchDeleteBuilds @@ -136,7 +136,7 @@ func (c *CodeBuild) BatchGetBuildsRequest(input *BatchGetBuildsInput) (req *requ // BatchGetBuilds API operation for AWS CodeBuild. // -// Gets information about builds. +// Gets information about one or more 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 @@ -145,8 +145,8 @@ func (c *CodeBuild) BatchGetBuildsRequest(input *BatchGetBuildsInput) (req *requ // See the AWS API reference guide for AWS CodeBuild's // API operation BatchGetBuilds for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input value that was provided is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetBuilds @@ -215,7 +215,7 @@ func (c *CodeBuild) BatchGetProjectsRequest(input *BatchGetProjectsInput) (req * // BatchGetProjects API operation for AWS CodeBuild. // -// Gets information about build projects. +// Gets information about one or more 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 @@ -224,8 +224,8 @@ func (c *CodeBuild) BatchGetProjectsRequest(input *BatchGetProjectsInput) (req * // See the AWS API reference guide for AWS CodeBuild's // API operation BatchGetProjects for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input value that was provided is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetProjects @@ -250,6 +250,164 @@ func (c *CodeBuild) BatchGetProjectsWithContext(ctx aws.Context, input *BatchGet return out, req.Send() } +const opBatchGetReportGroups = "BatchGetReportGroups" + +// BatchGetReportGroupsRequest generates a "aws/request.Request" representing the +// client's request for the BatchGetReportGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See BatchGetReportGroups for more information on using the BatchGetReportGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the BatchGetReportGroupsRequest method. +// req, resp := client.BatchGetReportGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetReportGroups +func (c *CodeBuild) BatchGetReportGroupsRequest(input *BatchGetReportGroupsInput) (req *request.Request, output *BatchGetReportGroupsOutput) { + op := &request.Operation{ + Name: opBatchGetReportGroups, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &BatchGetReportGroupsInput{} + } + + output = &BatchGetReportGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// BatchGetReportGroups API operation for AWS CodeBuild. +// +// Returns an array of report 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 CodeBuild's +// API operation BatchGetReportGroups for usage and error information. +// +// Returned Error Types: +// * InvalidInputException +// The input value that was provided is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetReportGroups +func (c *CodeBuild) BatchGetReportGroups(input *BatchGetReportGroupsInput) (*BatchGetReportGroupsOutput, error) { + req, out := c.BatchGetReportGroupsRequest(input) + return out, req.Send() +} + +// BatchGetReportGroupsWithContext is the same as BatchGetReportGroups with the addition of +// the ability to pass a context and additional request options. +// +// See BatchGetReportGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) BatchGetReportGroupsWithContext(ctx aws.Context, input *BatchGetReportGroupsInput, opts ...request.Option) (*BatchGetReportGroupsOutput, error) { + req, out := c.BatchGetReportGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opBatchGetReports = "BatchGetReports" + +// BatchGetReportsRequest generates a "aws/request.Request" representing the +// client's request for the BatchGetReports operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See BatchGetReports for more information on using the BatchGetReports +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the BatchGetReportsRequest method. +// req, resp := client.BatchGetReportsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetReports +func (c *CodeBuild) BatchGetReportsRequest(input *BatchGetReportsInput) (req *request.Request, output *BatchGetReportsOutput) { + op := &request.Operation{ + Name: opBatchGetReports, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &BatchGetReportsInput{} + } + + output = &BatchGetReportsOutput{} + req = c.newRequest(op, input, output) + return +} + +// BatchGetReports API operation for AWS CodeBuild. +// +// Returns an array of reports. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 BatchGetReports for usage and error information. +// +// Returned Error Types: +// * InvalidInputException +// The input value that was provided is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/BatchGetReports +func (c *CodeBuild) BatchGetReports(input *BatchGetReportsInput) (*BatchGetReportsOutput, error) { + req, out := c.BatchGetReportsRequest(input) + return out, req.Send() +} + +// BatchGetReportsWithContext is the same as BatchGetReports with the addition of +// the ability to pass a context and additional request options. +// +// See BatchGetReports for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) BatchGetReportsWithContext(ctx aws.Context, input *BatchGetReportsInput, opts ...request.Option) (*BatchGetReportsOutput, error) { + req, out := c.BatchGetReportsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateProject = "CreateProject" // CreateProjectRequest generates a "aws/request.Request" representing the @@ -303,15 +461,15 @@ func (c *CodeBuild) CreateProjectRequest(input *CreateProjectInput) (req *reques // See the AWS API reference guide for AWS CodeBuild's // API operation CreateProject for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input value that was provided is not valid. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified AWS resource cannot be created, because an AWS resource with // the same settings already exists. // -// * ErrCodeAccountLimitExceededException "AccountLimitExceededException" +// * AccountLimitExceededException // An AWS service limit was exceeded for the calling AWS account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/CreateProject @@ -336,6 +494,92 @@ func (c *CodeBuild) CreateProjectWithContext(ctx aws.Context, input *CreateProje return out, req.Send() } +const opCreateReportGroup = "CreateReportGroup" + +// CreateReportGroupRequest generates a "aws/request.Request" representing the +// client's request for the CreateReportGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateReportGroup for more information on using the CreateReportGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateReportGroupRequest method. +// req, resp := client.CreateReportGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/CreateReportGroup +func (c *CodeBuild) CreateReportGroupRequest(input *CreateReportGroupInput) (req *request.Request, output *CreateReportGroupOutput) { + op := &request.Operation{ + Name: opCreateReportGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateReportGroupInput{} + } + + output = &CreateReportGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateReportGroup API operation for AWS CodeBuild. +// +// Creates a report group. A report group contains a collection of reports. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 CreateReportGroup for usage and error information. +// +// Returned Error Types: +// * InvalidInputException +// The input value that was provided is not valid. +// +// * ResourceAlreadyExistsException +// The specified AWS resource cannot be created, because an AWS resource with +// the same settings already exists. +// +// * AccountLimitExceededException +// An AWS service limit was exceeded for the calling AWS account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/CreateReportGroup +func (c *CodeBuild) CreateReportGroup(input *CreateReportGroupInput) (*CreateReportGroupOutput, error) { + req, out := c.CreateReportGroupRequest(input) + return out, req.Send() +} + +// CreateReportGroupWithContext is the same as CreateReportGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateReportGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) CreateReportGroupWithContext(ctx aws.Context, input *CreateReportGroupInput, opts ...request.Option) (*CreateReportGroupOutput, error) { + req, out := c.CreateReportGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateWebhook = "CreateWebhook" // CreateWebhookRequest generates a "aws/request.Request" representing the @@ -400,18 +644,18 @@ func (c *CodeBuild) CreateWebhookRequest(input *CreateWebhookInput) (req *reques // See the AWS API reference guide for AWS CodeBuild's // API operation CreateWebhook for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input value that was provided is not valid. // -// * ErrCodeOAuthProviderException "OAuthProviderException" +// * OAuthProviderException // There was a problem with the underlying OAuth provider. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified AWS resource cannot be created, because an AWS resource with // the same settings already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified AWS resource cannot be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/CreateWebhook @@ -481,7 +725,7 @@ func (c *CodeBuild) DeleteProjectRequest(input *DeleteProjectInput) (req *reques // DeleteProject API operation for AWS CodeBuild. // -// Deletes a build project. +// Deletes a build project. When you delete a project, its builds are 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 @@ -490,8 +734,8 @@ func (c *CodeBuild) DeleteProjectRequest(input *DeleteProjectInput) (req *reques // See the AWS API reference guide for AWS CodeBuild's // API operation DeleteProject for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input value that was provided is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteProject @@ -516,1132 +760,2158 @@ func (c *CodeBuild) DeleteProjectWithContext(ctx aws.Context, input *DeleteProje return out, req.Send() } -const opDeleteSourceCredentials = "DeleteSourceCredentials" +const opDeleteReport = "DeleteReport" -// DeleteSourceCredentialsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSourceCredentials operation. The "output" return +// DeleteReportRequest generates a "aws/request.Request" representing the +// client's request for the DeleteReport operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteSourceCredentials for more information on using the DeleteSourceCredentials +// See DeleteReport for more information on using the DeleteReport // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteSourceCredentialsRequest method. -// req, resp := client.DeleteSourceCredentialsRequest(params) +// // Example sending a request using the DeleteReportRequest method. +// req, resp := client.DeleteReportRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteSourceCredentials -func (c *CodeBuild) DeleteSourceCredentialsRequest(input *DeleteSourceCredentialsInput) (req *request.Request, output *DeleteSourceCredentialsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteReport +func (c *CodeBuild) DeleteReportRequest(input *DeleteReportInput) (req *request.Request, output *DeleteReportOutput) { op := &request.Operation{ - Name: opDeleteSourceCredentials, + Name: opDeleteReport, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteSourceCredentialsInput{} + input = &DeleteReportInput{} } - output = &DeleteSourceCredentialsOutput{} + output = &DeleteReportOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DeleteSourceCredentials API operation for AWS CodeBuild. +// DeleteReport API operation for AWS CodeBuild. // -// Deletes a set of GitHub, GitHub Enterprise, or Bitbucket source credentials. +// Deletes a report. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 DeleteSourceCredentials for usage and error information. +// API operation DeleteReport for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input value that was provided is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified AWS resource cannot be found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteSourceCredentials -func (c *CodeBuild) DeleteSourceCredentials(input *DeleteSourceCredentialsInput) (*DeleteSourceCredentialsOutput, error) { - req, out := c.DeleteSourceCredentialsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteReport +func (c *CodeBuild) DeleteReport(input *DeleteReportInput) (*DeleteReportOutput, error) { + req, out := c.DeleteReportRequest(input) return out, req.Send() } -// DeleteSourceCredentialsWithContext is the same as DeleteSourceCredentials with the addition of +// DeleteReportWithContext is the same as DeleteReport with the addition of // the ability to pass a context and additional request options. // -// See DeleteSourceCredentials for details on how to use this API operation. +// See DeleteReport for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeBuild) DeleteSourceCredentialsWithContext(ctx aws.Context, input *DeleteSourceCredentialsInput, opts ...request.Option) (*DeleteSourceCredentialsOutput, error) { - req, out := c.DeleteSourceCredentialsRequest(input) +func (c *CodeBuild) DeleteReportWithContext(ctx aws.Context, input *DeleteReportInput, opts ...request.Option) (*DeleteReportOutput, error) { + req, out := c.DeleteReportRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteWebhook = "DeleteWebhook" +const opDeleteReportGroup = "DeleteReportGroup" -// DeleteWebhookRequest generates a "aws/request.Request" representing the -// client's request for the DeleteWebhook operation. The "output" return +// DeleteReportGroupRequest generates a "aws/request.Request" representing the +// client's request for the DeleteReportGroup operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteWebhook for more information on using the DeleteWebhook +// See DeleteReportGroup for more information on using the DeleteReportGroup // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteWebhookRequest method. -// req, resp := client.DeleteWebhookRequest(params) +// // Example sending a request using the DeleteReportGroupRequest method. +// req, resp := client.DeleteReportGroupRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteWebhook -func (c *CodeBuild) DeleteWebhookRequest(input *DeleteWebhookInput) (req *request.Request, output *DeleteWebhookOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteReportGroup +func (c *CodeBuild) DeleteReportGroupRequest(input *DeleteReportGroupInput) (req *request.Request, output *DeleteReportGroupOutput) { op := &request.Operation{ - Name: opDeleteWebhook, + Name: opDeleteReportGroup, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteWebhookInput{} + input = &DeleteReportGroupInput{} } - output = &DeleteWebhookOutput{} + output = &DeleteReportGroupOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DeleteWebhook API operation for AWS CodeBuild. +// DeleteReportGroup API operation for AWS CodeBuild. // -// For an existing AWS CodeBuild build project that has its source code stored -// in a GitHub or Bitbucket repository, stops AWS CodeBuild from rebuilding -// the source code every time a code change is pushed to the repository. +// DeleteReportGroup: Deletes a report group. Before you delete a report group, +// you must delete its reports. Use ListReportsForReportGroup (https://docs.aws.amazon.com/codebuild/latest/APIReference/API_ListReportsForReportGroup.html) +// to get the reports in a report group. Use DeleteReport (https://docs.aws.amazon.com/codebuild/latest/APIReference/API_DeleteReport.html) +// to delete the reports. If you call DeleteReportGroup for a report group that +// contains one or more reports, an exception 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 CodeBuild's -// API operation DeleteWebhook for usage and error information. +// API operation DeleteReportGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input value that was provided is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified AWS resource cannot be found. -// -// * ErrCodeOAuthProviderException "OAuthProviderException" -// There was a problem with the underlying OAuth provider. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteWebhook -func (c *CodeBuild) DeleteWebhook(input *DeleteWebhookInput) (*DeleteWebhookOutput, error) { - req, out := c.DeleteWebhookRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteReportGroup +func (c *CodeBuild) DeleteReportGroup(input *DeleteReportGroupInput) (*DeleteReportGroupOutput, error) { + req, out := c.DeleteReportGroupRequest(input) return out, req.Send() } -// DeleteWebhookWithContext is the same as DeleteWebhook with the addition of +// DeleteReportGroupWithContext is the same as DeleteReportGroup with the addition of // the ability to pass a context and additional request options. // -// See DeleteWebhook for details on how to use this API operation. +// See DeleteReportGroup for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeBuild) DeleteWebhookWithContext(ctx aws.Context, input *DeleteWebhookInput, opts ...request.Option) (*DeleteWebhookOutput, error) { - req, out := c.DeleteWebhookRequest(input) +func (c *CodeBuild) DeleteReportGroupWithContext(ctx aws.Context, input *DeleteReportGroupInput, opts ...request.Option) (*DeleteReportGroupOutput, error) { + req, out := c.DeleteReportGroupRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opImportSourceCredentials = "ImportSourceCredentials" +const opDeleteResourcePolicy = "DeleteResourcePolicy" -// ImportSourceCredentialsRequest generates a "aws/request.Request" representing the -// client's request for the ImportSourceCredentials operation. The "output" return +// DeleteResourcePolicyRequest generates a "aws/request.Request" representing the +// client's request for the DeleteResourcePolicy operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ImportSourceCredentials for more information on using the ImportSourceCredentials +// See DeleteResourcePolicy for more information on using the DeleteResourcePolicy // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ImportSourceCredentialsRequest method. -// req, resp := client.ImportSourceCredentialsRequest(params) +// // Example sending a request using the DeleteResourcePolicyRequest method. +// req, resp := client.DeleteResourcePolicyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ImportSourceCredentials -func (c *CodeBuild) ImportSourceCredentialsRequest(input *ImportSourceCredentialsInput) (req *request.Request, output *ImportSourceCredentialsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteResourcePolicy +func (c *CodeBuild) DeleteResourcePolicyRequest(input *DeleteResourcePolicyInput) (req *request.Request, output *DeleteResourcePolicyOutput) { op := &request.Operation{ - Name: opImportSourceCredentials, + Name: opDeleteResourcePolicy, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ImportSourceCredentialsInput{} + input = &DeleteResourcePolicyInput{} } - output = &ImportSourceCredentialsOutput{} + output = &DeleteResourcePolicyOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ImportSourceCredentials API operation for AWS CodeBuild. +// DeleteResourcePolicy API operation for AWS CodeBuild. // -// Imports the source repository credentials for an AWS CodeBuild project that -// has its source code stored in a GitHub, GitHub Enterprise, or Bitbucket repository. +// Deletes a resource policy that is identified by its resource 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 AWS CodeBuild's -// API operation ImportSourceCredentials for usage and error information. +// API operation DeleteResourcePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input value that was provided is not valid. // -// * ErrCodeAccountLimitExceededException "AccountLimitExceededException" -// An AWS service limit was exceeded for the calling AWS account. -// -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" -// The specified AWS resource cannot be created, because an AWS resource with -// the same settings already exists. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ImportSourceCredentials -func (c *CodeBuild) ImportSourceCredentials(input *ImportSourceCredentialsInput) (*ImportSourceCredentialsOutput, error) { - req, out := c.ImportSourceCredentialsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteResourcePolicy +func (c *CodeBuild) DeleteResourcePolicy(input *DeleteResourcePolicyInput) (*DeleteResourcePolicyOutput, error) { + req, out := c.DeleteResourcePolicyRequest(input) return out, req.Send() } -// ImportSourceCredentialsWithContext is the same as ImportSourceCredentials with the addition of +// DeleteResourcePolicyWithContext is the same as DeleteResourcePolicy with the addition of // the ability to pass a context and additional request options. // -// See ImportSourceCredentials for details on how to use this API operation. +// See DeleteResourcePolicy for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeBuild) ImportSourceCredentialsWithContext(ctx aws.Context, input *ImportSourceCredentialsInput, opts ...request.Option) (*ImportSourceCredentialsOutput, error) { - req, out := c.ImportSourceCredentialsRequest(input) +func (c *CodeBuild) DeleteResourcePolicyWithContext(ctx aws.Context, input *DeleteResourcePolicyInput, opts ...request.Option) (*DeleteResourcePolicyOutput, error) { + req, out := c.DeleteResourcePolicyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opInvalidateProjectCache = "InvalidateProjectCache" +const opDeleteSourceCredentials = "DeleteSourceCredentials" -// InvalidateProjectCacheRequest generates a "aws/request.Request" representing the -// client's request for the InvalidateProjectCache operation. The "output" return +// DeleteSourceCredentialsRequest generates a "aws/request.Request" representing the +// client's request for the DeleteSourceCredentials operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See InvalidateProjectCache for more information on using the InvalidateProjectCache +// See DeleteSourceCredentials for more information on using the DeleteSourceCredentials // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the InvalidateProjectCacheRequest method. -// req, resp := client.InvalidateProjectCacheRequest(params) +// // Example sending a request using the DeleteSourceCredentialsRequest method. +// req, resp := client.DeleteSourceCredentialsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/InvalidateProjectCache -func (c *CodeBuild) InvalidateProjectCacheRequest(input *InvalidateProjectCacheInput) (req *request.Request, output *InvalidateProjectCacheOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteSourceCredentials +func (c *CodeBuild) DeleteSourceCredentialsRequest(input *DeleteSourceCredentialsInput) (req *request.Request, output *DeleteSourceCredentialsOutput) { op := &request.Operation{ - Name: opInvalidateProjectCache, + Name: opDeleteSourceCredentials, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &InvalidateProjectCacheInput{} + input = &DeleteSourceCredentialsInput{} } - output = &InvalidateProjectCacheOutput{} + output = &DeleteSourceCredentialsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// InvalidateProjectCache API operation for AWS CodeBuild. +// DeleteSourceCredentials API operation for AWS CodeBuild. // -// Resets the cache for a project. +// Deletes a set of GitHub, GitHub Enterprise, or Bitbucket source credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 InvalidateProjectCache for usage and error information. +// API operation DeleteSourceCredentials for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input value that was provided is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified AWS resource cannot be found. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/InvalidateProjectCache -func (c *CodeBuild) InvalidateProjectCache(input *InvalidateProjectCacheInput) (*InvalidateProjectCacheOutput, error) { - req, out := c.InvalidateProjectCacheRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteSourceCredentials +func (c *CodeBuild) DeleteSourceCredentials(input *DeleteSourceCredentialsInput) (*DeleteSourceCredentialsOutput, error) { + req, out := c.DeleteSourceCredentialsRequest(input) return out, req.Send() } -// InvalidateProjectCacheWithContext is the same as InvalidateProjectCache with the addition of +// DeleteSourceCredentialsWithContext is the same as DeleteSourceCredentials with the addition of // the ability to pass a context and additional request options. // -// See InvalidateProjectCache for details on how to use this API operation. +// See DeleteSourceCredentials for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeBuild) InvalidateProjectCacheWithContext(ctx aws.Context, input *InvalidateProjectCacheInput, opts ...request.Option) (*InvalidateProjectCacheOutput, error) { - req, out := c.InvalidateProjectCacheRequest(input) +func (c *CodeBuild) DeleteSourceCredentialsWithContext(ctx aws.Context, input *DeleteSourceCredentialsInput, opts ...request.Option) (*DeleteSourceCredentialsOutput, error) { + req, out := c.DeleteSourceCredentialsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListBuilds = "ListBuilds" +const opDeleteWebhook = "DeleteWebhook" -// ListBuildsRequest generates a "aws/request.Request" representing the -// client's request for the ListBuilds operation. The "output" return +// DeleteWebhookRequest generates a "aws/request.Request" representing the +// client's request for the DeleteWebhook operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListBuilds for more information on using the ListBuilds +// See DeleteWebhook for more information on using the DeleteWebhook // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListBuildsRequest method. -// req, resp := client.ListBuildsRequest(params) +// // Example sending a request using the DeleteWebhookRequest method. +// req, resp := client.DeleteWebhookRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListBuilds -func (c *CodeBuild) ListBuildsRequest(input *ListBuildsInput) (req *request.Request, output *ListBuildsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteWebhook +func (c *CodeBuild) DeleteWebhookRequest(input *DeleteWebhookInput) (req *request.Request, output *DeleteWebhookOutput) { op := &request.Operation{ - Name: opListBuilds, + Name: opDeleteWebhook, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ListBuildsInput{} + input = &DeleteWebhookInput{} } - output = &ListBuildsOutput{} + output = &DeleteWebhookOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ListBuilds API operation for AWS CodeBuild. +// DeleteWebhook API operation for AWS CodeBuild. // -// Gets a list of build IDs, with each build ID representing a single build. +// For an existing AWS CodeBuild build project that has its source code stored +// in a GitHub or Bitbucket repository, stops AWS CodeBuild from rebuilding +// the source code every time a code change is pushed to the 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 CodeBuild's -// API operation ListBuilds for usage and error information. +// API operation DeleteWebhook for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input value that was provided is not valid. // -// See also, 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) +// * ResourceNotFoundException +// The specified AWS resource cannot be found. +// +// * OAuthProviderException +// There was a problem with the underlying OAuth provider. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DeleteWebhook +func (c *CodeBuild) DeleteWebhook(input *DeleteWebhookInput) (*DeleteWebhookOutput, error) { + req, out := c.DeleteWebhookRequest(input) return out, req.Send() } -// ListBuildsWithContext is the same as ListBuilds with the addition of +// DeleteWebhookWithContext is the same as DeleteWebhook with the addition of // the ability to pass a context and additional request options. // -// See ListBuilds for details on how to use this API operation. +// See DeleteWebhook for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeBuild) ListBuildsWithContext(ctx aws.Context, input *ListBuildsInput, opts ...request.Option) (*ListBuildsOutput, error) { - req, out := c.ListBuildsRequest(input) +func (c *CodeBuild) DeleteWebhookWithContext(ctx aws.Context, input *DeleteWebhookInput, opts ...request.Option) (*DeleteWebhookOutput, error) { + req, out := c.DeleteWebhookRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListBuildsForProject = "ListBuildsForProject" +const opDescribeTestCases = "DescribeTestCases" -// ListBuildsForProjectRequest generates a "aws/request.Request" representing the -// client's request for the ListBuildsForProject operation. The "output" return +// DescribeTestCasesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTestCases operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListBuildsForProject for more information on using the ListBuildsForProject +// See DescribeTestCases for more information on using the DescribeTestCases // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListBuildsForProjectRequest method. -// req, resp := client.ListBuildsForProjectRequest(params) +// // Example sending a request using the DescribeTestCasesRequest method. +// req, resp := client.DescribeTestCasesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListBuildsForProject -func (c *CodeBuild) ListBuildsForProjectRequest(input *ListBuildsForProjectInput) (req *request.Request, output *ListBuildsForProjectOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DescribeTestCases +func (c *CodeBuild) DescribeTestCasesRequest(input *DescribeTestCasesInput) (req *request.Request, output *DescribeTestCasesOutput) { op := &request.Operation{ - Name: opListBuildsForProject, + Name: opDescribeTestCases, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ListBuildsForProjectInput{} + input = &DescribeTestCasesInput{} } - output = &ListBuildsForProjectOutput{} + output = &DescribeTestCasesOutput{} req = c.newRequest(op, input, output) return } -// ListBuildsForProject API operation for AWS CodeBuild. +// DescribeTestCases 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 a list of details about test cases for a report. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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. +// API operation DescribeTestCases for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input value that was provided is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified AWS resource cannot be found. // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/DescribeTestCases +func (c *CodeBuild) DescribeTestCases(input *DescribeTestCasesInput) (*DescribeTestCasesOutput, error) { + req, out := c.DescribeTestCasesRequest(input) return out, req.Send() } -// ListBuildsForProjectWithContext is the same as ListBuildsForProject with the addition of +// DescribeTestCasesWithContext is the same as DescribeTestCases with the addition of // the ability to pass a context and additional request options. // -// See ListBuildsForProject for details on how to use this API operation. +// See DescribeTestCases for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeBuild) ListBuildsForProjectWithContext(ctx aws.Context, input *ListBuildsForProjectInput, opts ...request.Option) (*ListBuildsForProjectOutput, error) { - req, out := c.ListBuildsForProjectRequest(input) +func (c *CodeBuild) DescribeTestCasesWithContext(ctx aws.Context, input *DescribeTestCasesInput, opts ...request.Option) (*DescribeTestCasesOutput, error) { + req, out := c.DescribeTestCasesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListCuratedEnvironmentImages = "ListCuratedEnvironmentImages" +const opGetResourcePolicy = "GetResourcePolicy" -// ListCuratedEnvironmentImagesRequest generates a "aws/request.Request" representing the -// client's request for the ListCuratedEnvironmentImages operation. The "output" return +// GetResourcePolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetResourcePolicy operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListCuratedEnvironmentImages for more information on using the ListCuratedEnvironmentImages +// See GetResourcePolicy for more information on using the GetResourcePolicy // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListCuratedEnvironmentImagesRequest method. -// req, resp := client.ListCuratedEnvironmentImagesRequest(params) +// // Example sending a request using the GetResourcePolicyRequest method. +// req, resp := client.GetResourcePolicyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListCuratedEnvironmentImages -func (c *CodeBuild) ListCuratedEnvironmentImagesRequest(input *ListCuratedEnvironmentImagesInput) (req *request.Request, output *ListCuratedEnvironmentImagesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/GetResourcePolicy +func (c *CodeBuild) GetResourcePolicyRequest(input *GetResourcePolicyInput) (req *request.Request, output *GetResourcePolicyOutput) { op := &request.Operation{ - Name: opListCuratedEnvironmentImages, + Name: opGetResourcePolicy, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ListCuratedEnvironmentImagesInput{} + input = &GetResourcePolicyInput{} } - output = &ListCuratedEnvironmentImagesOutput{} + output = &GetResourcePolicyOutput{} req = c.newRequest(op, input, output) return } -// ListCuratedEnvironmentImages API operation for AWS CodeBuild. +// GetResourcePolicy API operation for AWS CodeBuild. // -// Gets information about Docker images that are managed by AWS CodeBuild. +// Gets a resource policy that is identified by its resource 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 AWS CodeBuild's -// API operation ListCuratedEnvironmentImages for usage and error information. -// See also, 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) +// API operation GetResourcePolicy for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified AWS resource cannot be found. +// +// * InvalidInputException +// The input value that was provided is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/GetResourcePolicy +func (c *CodeBuild) GetResourcePolicy(input *GetResourcePolicyInput) (*GetResourcePolicyOutput, error) { + req, out := c.GetResourcePolicyRequest(input) return out, req.Send() } -// ListCuratedEnvironmentImagesWithContext is the same as ListCuratedEnvironmentImages with the addition of +// GetResourcePolicyWithContext is the same as GetResourcePolicy with the addition of // the ability to pass a context and additional request options. // -// See ListCuratedEnvironmentImages for details on how to use this API operation. +// See GetResourcePolicy for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeBuild) ListCuratedEnvironmentImagesWithContext(ctx aws.Context, input *ListCuratedEnvironmentImagesInput, opts ...request.Option) (*ListCuratedEnvironmentImagesOutput, error) { - req, out := c.ListCuratedEnvironmentImagesRequest(input) +func (c *CodeBuild) GetResourcePolicyWithContext(ctx aws.Context, input *GetResourcePolicyInput, opts ...request.Option) (*GetResourcePolicyOutput, error) { + req, out := c.GetResourcePolicyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListProjects = "ListProjects" +const opImportSourceCredentials = "ImportSourceCredentials" -// ListProjectsRequest generates a "aws/request.Request" representing the -// client's request for the ListProjects operation. The "output" return +// ImportSourceCredentialsRequest generates a "aws/request.Request" representing the +// client's request for the ImportSourceCredentials operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListProjects for more information on using the ListProjects +// See ImportSourceCredentials for more information on using the ImportSourceCredentials // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListProjectsRequest method. -// req, resp := client.ListProjectsRequest(params) +// // Example sending a request using the ImportSourceCredentialsRequest method. +// req, resp := client.ImportSourceCredentialsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListProjects -func (c *CodeBuild) ListProjectsRequest(input *ListProjectsInput) (req *request.Request, output *ListProjectsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ImportSourceCredentials +func (c *CodeBuild) ImportSourceCredentialsRequest(input *ImportSourceCredentialsInput) (req *request.Request, output *ImportSourceCredentialsOutput) { op := &request.Operation{ - Name: opListProjects, + Name: opImportSourceCredentials, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ListProjectsInput{} + input = &ImportSourceCredentialsInput{} } - output = &ListProjectsOutput{} + output = &ImportSourceCredentialsOutput{} req = c.newRequest(op, input, output) return } -// ListProjects API operation for AWS CodeBuild. +// ImportSourceCredentials API operation for AWS CodeBuild. // -// Gets a list of build project names, with each build project name representing -// a single build project. +// Imports the source repository credentials for an AWS CodeBuild project that +// has its source code stored in a GitHub, GitHub Enterprise, or Bitbucket 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 CodeBuild's -// API operation ListProjects for usage and error information. +// API operation ImportSourceCredentials for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input value that was provided is not valid. // -// See also, 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) +// * AccountLimitExceededException +// An AWS service limit was exceeded for the calling AWS account. +// +// * ResourceAlreadyExistsException +// The specified AWS resource cannot be created, because an AWS resource with +// the same settings already exists. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ImportSourceCredentials +func (c *CodeBuild) ImportSourceCredentials(input *ImportSourceCredentialsInput) (*ImportSourceCredentialsOutput, error) { + req, out := c.ImportSourceCredentialsRequest(input) return out, req.Send() } -// ListProjectsWithContext is the same as ListProjects with the addition of +// ImportSourceCredentialsWithContext is the same as ImportSourceCredentials with the addition of // the ability to pass a context and additional request options. // -// See ListProjects for details on how to use this API operation. +// See ImportSourceCredentials for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeBuild) ListProjectsWithContext(ctx aws.Context, input *ListProjectsInput, opts ...request.Option) (*ListProjectsOutput, error) { - req, out := c.ListProjectsRequest(input) +func (c *CodeBuild) ImportSourceCredentialsWithContext(ctx aws.Context, input *ImportSourceCredentialsInput, opts ...request.Option) (*ImportSourceCredentialsOutput, error) { + req, out := c.ImportSourceCredentialsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListSourceCredentials = "ListSourceCredentials" +const opInvalidateProjectCache = "InvalidateProjectCache" -// ListSourceCredentialsRequest generates a "aws/request.Request" representing the -// client's request for the ListSourceCredentials operation. The "output" return +// InvalidateProjectCacheRequest generates a "aws/request.Request" representing the +// client's request for the InvalidateProjectCache operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListSourceCredentials for more information on using the ListSourceCredentials +// See InvalidateProjectCache for more information on using the InvalidateProjectCache // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListSourceCredentialsRequest method. -// req, resp := client.ListSourceCredentialsRequest(params) +// // Example sending a request using the InvalidateProjectCacheRequest method. +// req, resp := client.InvalidateProjectCacheRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListSourceCredentials -func (c *CodeBuild) ListSourceCredentialsRequest(input *ListSourceCredentialsInput) (req *request.Request, output *ListSourceCredentialsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/InvalidateProjectCache +func (c *CodeBuild) InvalidateProjectCacheRequest(input *InvalidateProjectCacheInput) (req *request.Request, output *InvalidateProjectCacheOutput) { op := &request.Operation{ - Name: opListSourceCredentials, + Name: opInvalidateProjectCache, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ListSourceCredentialsInput{} + input = &InvalidateProjectCacheInput{} } - output = &ListSourceCredentialsOutput{} + output = &InvalidateProjectCacheOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ListSourceCredentials API operation for AWS CodeBuild. +// InvalidateProjectCache API operation for AWS CodeBuild. // -// Returns a list of SourceCredentialsInfo objects. +// Resets the cache for a 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 ListSourceCredentials for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListSourceCredentials -func (c *CodeBuild) ListSourceCredentials(input *ListSourceCredentialsInput) (*ListSourceCredentialsOutput, error) { - req, out := c.ListSourceCredentialsRequest(input) +// API operation InvalidateProjectCache for usage and error information. +// +// Returned Error Types: +// * InvalidInputException +// The input value that was provided is not valid. +// +// * ResourceNotFoundException +// The specified AWS resource cannot be found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/InvalidateProjectCache +func (c *CodeBuild) InvalidateProjectCache(input *InvalidateProjectCacheInput) (*InvalidateProjectCacheOutput, error) { + req, out := c.InvalidateProjectCacheRequest(input) return out, req.Send() } -// ListSourceCredentialsWithContext is the same as ListSourceCredentials with the addition of +// InvalidateProjectCacheWithContext is the same as InvalidateProjectCache with the addition of // the ability to pass a context and additional request options. // -// See ListSourceCredentials for details on how to use this API operation. +// See InvalidateProjectCache for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeBuild) ListSourceCredentialsWithContext(ctx aws.Context, input *ListSourceCredentialsInput, opts ...request.Option) (*ListSourceCredentialsOutput, error) { - req, out := c.ListSourceCredentialsRequest(input) +func (c *CodeBuild) InvalidateProjectCacheWithContext(ctx aws.Context, input *InvalidateProjectCacheInput, opts ...request.Option) (*InvalidateProjectCacheOutput, error) { + req, out := c.InvalidateProjectCacheRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStartBuild = "StartBuild" +const opListBuilds = "ListBuilds" -// StartBuildRequest generates a "aws/request.Request" representing the -// client's request for the StartBuild operation. The "output" return +// ListBuildsRequest generates a "aws/request.Request" representing the +// client's request for the ListBuilds operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StartBuild for more information on using the StartBuild +// See ListBuilds for more information on using the ListBuilds // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StartBuildRequest method. -// req, resp := client.StartBuildRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/StartBuild -func (c *CodeBuild) StartBuildRequest(input *StartBuildInput) (req *request.Request, output *StartBuildOutput) { +// See also, 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: opStartBuild, + Name: opListBuilds, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StartBuildInput{} + input = &ListBuildsInput{} } - output = &StartBuildOutput{} + output = &ListBuildsOutput{} req = c.newRequest(op, input, output) return } -// StartBuild API operation for AWS CodeBuild. +// ListBuilds API operation for AWS CodeBuild. // -// Starts running a build. +// 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 StartBuild for usage and error information. +// API operation ListBuilds for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * 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. -// -// See also, 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) +// See also, 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) return out, req.Send() } -// StartBuildWithContext is the same as StartBuild with the addition of +// ListBuildsWithContext is the same as ListBuilds with the addition of // the ability to pass a context and additional request options. // -// See StartBuild for details on how to use this API operation. +// See ListBuilds for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeBuild) StartBuildWithContext(ctx aws.Context, input *StartBuildInput, opts ...request.Option) (*StartBuildOutput, error) { - req, out := c.StartBuildRequest(input) +func (c *CodeBuild) ListBuildsWithContext(ctx aws.Context, input *ListBuildsInput, opts ...request.Option) (*ListBuildsOutput, error) { + req, out := c.ListBuildsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopBuild = "StopBuild" +const opListBuildsForProject = "ListBuildsForProject" -// StopBuildRequest generates a "aws/request.Request" representing the -// client's request for the StopBuild operation. The "output" return +// ListBuildsForProjectRequest generates a "aws/request.Request" representing the +// client's request for the ListBuildsForProject operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopBuild for more information on using the StopBuild +// See ListBuildsForProject for more information on using the ListBuildsForProject // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopBuildRequest method. -// req, resp := client.StopBuildRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/StopBuild -func (c *CodeBuild) StopBuildRequest(input *StopBuildInput) (req *request.Request, output *StopBuildOutput) { +// See also, 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: opStopBuild, + Name: opListBuildsForProject, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StopBuildInput{} + input = &ListBuildsForProjectInput{} } - output = &StopBuildOutput{} + output = &ListBuildsForProjectOutput{} req = c.newRequest(op, input, output) return } -// StopBuild API operation for AWS CodeBuild. +// ListBuildsForProject API operation for AWS CodeBuild. // -// Attempts to stop running a build. +// 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 StopBuild for usage and error information. +// API operation ListBuildsForProject for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input value that was provided is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified AWS resource cannot be found. // -// See also, 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) +// See also, 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) return out, req.Send() } -// StopBuildWithContext is the same as StopBuild with the addition of +// ListBuildsForProjectWithContext is the same as ListBuildsForProject with the addition of // the ability to pass a context and additional request options. // -// See StopBuild for details on how to use this API operation. +// See ListBuildsForProject for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeBuild) StopBuildWithContext(ctx aws.Context, input *StopBuildInput, opts ...request.Option) (*StopBuildOutput, error) { - req, out := c.StopBuildRequest(input) +func (c *CodeBuild) ListBuildsForProjectWithContext(ctx aws.Context, input *ListBuildsForProjectInput, opts ...request.Option) (*ListBuildsForProjectOutput, error) { + req, out := c.ListBuildsForProjectRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateProject = "UpdateProject" +const opListCuratedEnvironmentImages = "ListCuratedEnvironmentImages" -// UpdateProjectRequest generates a "aws/request.Request" representing the -// client's request for the UpdateProject operation. The "output" return +// ListCuratedEnvironmentImagesRequest generates a "aws/request.Request" representing the +// client's request for the ListCuratedEnvironmentImages operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateProject for more information on using the UpdateProject +// See ListCuratedEnvironmentImages for more information on using the ListCuratedEnvironmentImages // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateProjectRequest method. -// req, resp := client.UpdateProjectRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/UpdateProject -func (c *CodeBuild) UpdateProjectRequest(input *UpdateProjectInput) (req *request.Request, output *UpdateProjectOutput) { +// See also, 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: opUpdateProject, + Name: opListCuratedEnvironmentImages, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateProjectInput{} + input = &ListCuratedEnvironmentImagesInput{} } - output = &UpdateProjectOutput{} + output = &ListCuratedEnvironmentImagesOutput{} req = c.newRequest(op, input, output) return } -// UpdateProject API operation for AWS CodeBuild. +// ListCuratedEnvironmentImages API operation for AWS CodeBuild. // -// Changes the settings of a build project. +// 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 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. -// -// See also, 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) +// API operation ListCuratedEnvironmentImages for usage and error information. +// See also, 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) return out, req.Send() } -// UpdateProjectWithContext is the same as UpdateProject with the addition of +// ListCuratedEnvironmentImagesWithContext is the same as ListCuratedEnvironmentImages with the addition of // the ability to pass a context and additional request options. // -// See UpdateProject for details on how to use this API operation. +// See ListCuratedEnvironmentImages for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeBuild) UpdateProjectWithContext(ctx aws.Context, input *UpdateProjectInput, opts ...request.Option) (*UpdateProjectOutput, error) { - req, out := c.UpdateProjectRequest(input) +func (c *CodeBuild) ListCuratedEnvironmentImagesWithContext(ctx aws.Context, input *ListCuratedEnvironmentImagesInput, opts ...request.Option) (*ListCuratedEnvironmentImagesOutput, error) { + req, out := c.ListCuratedEnvironmentImagesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateWebhook = "UpdateWebhook" +const opListProjects = "ListProjects" -// UpdateWebhookRequest generates a "aws/request.Request" representing the -// client's request for the UpdateWebhook operation. The "output" return +// ListProjectsRequest generates a "aws/request.Request" representing the +// client's request for the ListProjects operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateWebhook for more information on using the UpdateWebhook +// See ListProjects for more information on using the ListProjects // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateWebhookRequest method. -// req, resp := client.UpdateWebhookRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/UpdateWebhook -func (c *CodeBuild) UpdateWebhookRequest(input *UpdateWebhookInput) (req *request.Request, output *UpdateWebhookOutput) { +// See also, 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: opUpdateWebhook, + Name: opListProjects, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateWebhookInput{} + input = &ListProjectsInput{} } - output = &UpdateWebhookOutput{} + output = &ListProjectsOutput{} req = c.newRequest(op, input, output) return } -// UpdateWebhook API operation for AWS CodeBuild. -// -// Updates the webhook associated with an AWS CodeBuild build project. +// ListProjects API operation for AWS CodeBuild. // -// If you use Bitbucket for your repository, rotateSecret is ignored. +// 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 UpdateWebhook for usage and error information. +// API operation ListProjects for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input value that was provided is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified AWS resource cannot be found. -// -// * ErrCodeOAuthProviderException "OAuthProviderException" -// There was a problem with the underlying OAuth provider. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/UpdateWebhook -func (c *CodeBuild) UpdateWebhook(input *UpdateWebhookInput) (*UpdateWebhookOutput, error) { - req, out := c.UpdateWebhookRequest(input) +// See also, 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) return out, req.Send() } -// UpdateWebhookWithContext is the same as UpdateWebhook with the addition of +// ListProjectsWithContext is the same as ListProjects with the addition of // the ability to pass a context and additional request options. // -// See UpdateWebhook for details on how to use this API operation. +// See ListProjects for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeBuild) UpdateWebhookWithContext(ctx aws.Context, input *UpdateWebhookInput, opts ...request.Option) (*UpdateWebhookOutput, error) { - req, out := c.UpdateWebhookRequest(input) +func (c *CodeBuild) ListProjectsWithContext(ctx aws.Context, input *ListProjectsInput, opts ...request.Option) (*ListProjectsOutput, error) { + req, out := c.ListProjectsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -type BatchDeleteBuildsInput struct { - _ struct{} `type:"structure"` - - // The IDs of the builds to delete. - // - // Ids is a required field - Ids []*string `locationName:"ids" min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s BatchDeleteBuildsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s BatchDeleteBuildsInput) GoString() string { - return s.String() -} +const opListReportGroups = "ListReportGroups" -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchDeleteBuildsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchDeleteBuildsInput"} - if s.Ids == nil { - invalidParams.Add(request.NewErrParamRequired("Ids")) - } - if s.Ids != nil && len(s.Ids) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Ids", 1)) +// ListReportGroupsRequest generates a "aws/request.Request" representing the +// client's request for the ListReportGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListReportGroups for more information on using the ListReportGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListReportGroupsRequest method. +// req, resp := client.ListReportGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListReportGroups +func (c *CodeBuild) ListReportGroupsRequest(input *ListReportGroupsInput) (req *request.Request, output *ListReportGroupsOutput) { + op := &request.Operation{ + Name: opListReportGroups, + HTTPMethod: "POST", + HTTPPath: "/", } - if invalidParams.Len() > 0 { - return invalidParams + if input == nil { + input = &ListReportGroupsInput{} } - return nil -} -// SetIds sets the Ids field's value. -func (s *BatchDeleteBuildsInput) SetIds(v []*string) *BatchDeleteBuildsInput { - s.Ids = v - return s + output = &ListReportGroupsOutput{} + req = c.newRequest(op, input, output) + return } -type BatchDeleteBuildsOutput struct { - _ struct{} `type:"structure"` - - // The IDs of the builds that were successfully deleted. - BuildsDeleted []*string `locationName:"buildsDeleted" min:"1" type:"list"` - - // Information about any builds that could not be successfully deleted. - BuildsNotDeleted []*BuildNotDeleted `locationName:"buildsNotDeleted" type:"list"` +// ListReportGroups API operation for AWS CodeBuild. +// +// Gets a list ARNs for the report groups in 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 AWS CodeBuild's +// API operation ListReportGroups for usage and error information. +// +// Returned Error Types: +// * InvalidInputException +// The input value that was provided is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListReportGroups +func (c *CodeBuild) ListReportGroups(input *ListReportGroupsInput) (*ListReportGroupsOutput, error) { + req, out := c.ListReportGroupsRequest(input) + return out, req.Send() } -// String returns the string representation -func (s BatchDeleteBuildsOutput) String() string { - return awsutil.Prettify(s) +// ListReportGroupsWithContext is the same as ListReportGroups with the addition of +// the ability to pass a context and additional request options. +// +// See ListReportGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) ListReportGroupsWithContext(ctx aws.Context, input *ListReportGroupsInput, opts ...request.Option) (*ListReportGroupsOutput, error) { + req, out := c.ListReportGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -// GoString returns the string representation -func (s BatchDeleteBuildsOutput) GoString() string { - return s.String() -} +const opListReports = "ListReports" + +// ListReportsRequest generates a "aws/request.Request" representing the +// client's request for the ListReports operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListReports for more information on using the ListReports +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListReportsRequest method. +// req, resp := client.ListReportsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListReports +func (c *CodeBuild) ListReportsRequest(input *ListReportsInput) (req *request.Request, output *ListReportsOutput) { + op := &request.Operation{ + Name: opListReports, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListReportsInput{} + } + + output = &ListReportsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListReports API operation for AWS CodeBuild. +// +// Returns a list of ARNs for the reports in 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 AWS CodeBuild's +// API operation ListReports for usage and error information. +// +// Returned Error Types: +// * InvalidInputException +// The input value that was provided is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListReports +func (c *CodeBuild) ListReports(input *ListReportsInput) (*ListReportsOutput, error) { + req, out := c.ListReportsRequest(input) + return out, req.Send() +} + +// ListReportsWithContext is the same as ListReports with the addition of +// the ability to pass a context and additional request options. +// +// See ListReports for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) ListReportsWithContext(ctx aws.Context, input *ListReportsInput, opts ...request.Option) (*ListReportsOutput, error) { + req, out := c.ListReportsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListReportsForReportGroup = "ListReportsForReportGroup" + +// ListReportsForReportGroupRequest generates a "aws/request.Request" representing the +// client's request for the ListReportsForReportGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListReportsForReportGroup for more information on using the ListReportsForReportGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListReportsForReportGroupRequest method. +// req, resp := client.ListReportsForReportGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListReportsForReportGroup +func (c *CodeBuild) ListReportsForReportGroupRequest(input *ListReportsForReportGroupInput) (req *request.Request, output *ListReportsForReportGroupOutput) { + op := &request.Operation{ + Name: opListReportsForReportGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListReportsForReportGroupInput{} + } + + output = &ListReportsForReportGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListReportsForReportGroup API operation for AWS CodeBuild. +// +// Returns a list of ARNs for the reports that belong to a ReportGroup. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 ListReportsForReportGroup for usage and error information. +// +// Returned Error Types: +// * InvalidInputException +// The input value that was provided is not valid. +// +// * ResourceNotFoundException +// The specified AWS resource cannot be found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListReportsForReportGroup +func (c *CodeBuild) ListReportsForReportGroup(input *ListReportsForReportGroupInput) (*ListReportsForReportGroupOutput, error) { + req, out := c.ListReportsForReportGroupRequest(input) + return out, req.Send() +} + +// ListReportsForReportGroupWithContext is the same as ListReportsForReportGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ListReportsForReportGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) ListReportsForReportGroupWithContext(ctx aws.Context, input *ListReportsForReportGroupInput, opts ...request.Option) (*ListReportsForReportGroupOutput, error) { + req, out := c.ListReportsForReportGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListSharedProjects = "ListSharedProjects" + +// ListSharedProjectsRequest generates a "aws/request.Request" representing the +// client's request for the ListSharedProjects operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListSharedProjects for more information on using the ListSharedProjects +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListSharedProjectsRequest method. +// req, resp := client.ListSharedProjectsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListSharedProjects +func (c *CodeBuild) ListSharedProjectsRequest(input *ListSharedProjectsInput) (req *request.Request, output *ListSharedProjectsOutput) { + op := &request.Operation{ + Name: opListSharedProjects, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListSharedProjectsInput{} + } + + output = &ListSharedProjectsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListSharedProjects API operation for AWS CodeBuild. +// +// Gets a list of projects that are shared with other AWS accounts or 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 CodeBuild's +// API operation ListSharedProjects for usage and error information. +// +// Returned Error Types: +// * InvalidInputException +// The input value that was provided is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListSharedProjects +func (c *CodeBuild) ListSharedProjects(input *ListSharedProjectsInput) (*ListSharedProjectsOutput, error) { + req, out := c.ListSharedProjectsRequest(input) + return out, req.Send() +} + +// ListSharedProjectsWithContext is the same as ListSharedProjects with the addition of +// the ability to pass a context and additional request options. +// +// See ListSharedProjects for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) ListSharedProjectsWithContext(ctx aws.Context, input *ListSharedProjectsInput, opts ...request.Option) (*ListSharedProjectsOutput, error) { + req, out := c.ListSharedProjectsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListSharedReportGroups = "ListSharedReportGroups" + +// ListSharedReportGroupsRequest generates a "aws/request.Request" representing the +// client's request for the ListSharedReportGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListSharedReportGroups for more information on using the ListSharedReportGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListSharedReportGroupsRequest method. +// req, resp := client.ListSharedReportGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListSharedReportGroups +func (c *CodeBuild) ListSharedReportGroupsRequest(input *ListSharedReportGroupsInput) (req *request.Request, output *ListSharedReportGroupsOutput) { + op := &request.Operation{ + Name: opListSharedReportGroups, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListSharedReportGroupsInput{} + } + + output = &ListSharedReportGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListSharedReportGroups API operation for AWS CodeBuild. +// +// Gets a list of report groups that are shared with other AWS accounts or 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 CodeBuild's +// API operation ListSharedReportGroups for usage and error information. +// +// Returned Error Types: +// * InvalidInputException +// The input value that was provided is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListSharedReportGroups +func (c *CodeBuild) ListSharedReportGroups(input *ListSharedReportGroupsInput) (*ListSharedReportGroupsOutput, error) { + req, out := c.ListSharedReportGroupsRequest(input) + return out, req.Send() +} + +// ListSharedReportGroupsWithContext is the same as ListSharedReportGroups with the addition of +// the ability to pass a context and additional request options. +// +// See ListSharedReportGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) ListSharedReportGroupsWithContext(ctx aws.Context, input *ListSharedReportGroupsInput, opts ...request.Option) (*ListSharedReportGroupsOutput, error) { + req, out := c.ListSharedReportGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListSourceCredentials = "ListSourceCredentials" + +// ListSourceCredentialsRequest generates a "aws/request.Request" representing the +// client's request for the ListSourceCredentials operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListSourceCredentials for more information on using the ListSourceCredentials +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListSourceCredentialsRequest method. +// req, resp := client.ListSourceCredentialsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListSourceCredentials +func (c *CodeBuild) ListSourceCredentialsRequest(input *ListSourceCredentialsInput) (req *request.Request, output *ListSourceCredentialsOutput) { + op := &request.Operation{ + Name: opListSourceCredentials, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListSourceCredentialsInput{} + } + + output = &ListSourceCredentialsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListSourceCredentials API operation for AWS CodeBuild. +// +// Returns a list of SourceCredentialsInfo 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 CodeBuild's +// API operation ListSourceCredentials for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/ListSourceCredentials +func (c *CodeBuild) ListSourceCredentials(input *ListSourceCredentialsInput) (*ListSourceCredentialsOutput, error) { + req, out := c.ListSourceCredentialsRequest(input) + return out, req.Send() +} + +// ListSourceCredentialsWithContext is the same as ListSourceCredentials with the addition of +// the ability to pass a context and additional request options. +// +// See ListSourceCredentials for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) ListSourceCredentialsWithContext(ctx aws.Context, input *ListSourceCredentialsInput, opts ...request.Option) (*ListSourceCredentialsOutput, error) { + req, out := c.ListSourceCredentialsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutResourcePolicy = "PutResourcePolicy" + +// PutResourcePolicyRequest generates a "aws/request.Request" representing the +// client's request for the PutResourcePolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutResourcePolicy for more information on using the PutResourcePolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutResourcePolicyRequest method. +// req, resp := client.PutResourcePolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/PutResourcePolicy +func (c *CodeBuild) PutResourcePolicyRequest(input *PutResourcePolicyInput) (req *request.Request, output *PutResourcePolicyOutput) { + op := &request.Operation{ + Name: opPutResourcePolicy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutResourcePolicyInput{} + } + + output = &PutResourcePolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutResourcePolicy API operation for AWS CodeBuild. +// +// Stores a resource policy for the ARN of a Project or ReportGroup object. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS CodeBuild's +// API operation PutResourcePolicy for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified AWS resource cannot be found. +// +// * InvalidInputException +// The input value that was provided is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/PutResourcePolicy +func (c *CodeBuild) PutResourcePolicy(input *PutResourcePolicyInput) (*PutResourcePolicyOutput, error) { + req, out := c.PutResourcePolicyRequest(input) + return out, req.Send() +} + +// PutResourcePolicyWithContext is the same as PutResourcePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutResourcePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) PutResourcePolicyWithContext(ctx aws.Context, input *PutResourcePolicyInput, opts ...request.Option) (*PutResourcePolicyOutput, error) { + req, out := c.PutResourcePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartBuild = "StartBuild" + +// StartBuildRequest generates a "aws/request.Request" representing the +// client's request for the StartBuild operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartBuild for more information on using the StartBuild +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartBuildRequest method. +// req, resp := client.StartBuildRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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 Types: +// * InvalidInputException +// The input value that was provided is not valid. +// +// * ResourceNotFoundException +// The specified AWS resource cannot be found. +// +// * AccountLimitExceededException +// An AWS service limit was exceeded for the calling AWS account. +// +// See also, 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) + return out, req.Send() +} + +// StartBuildWithContext is the same as StartBuild with the addition of +// the ability to pass a context and additional request options. +// +// See StartBuild for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) StartBuildWithContext(ctx aws.Context, input *StartBuildInput, opts ...request.Option) (*StartBuildOutput, error) { + req, out := c.StartBuildRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopBuild = "StopBuild" + +// StopBuildRequest generates a "aws/request.Request" representing the +// client's request for the StopBuild operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopBuild for more information on using the StopBuild +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopBuildRequest method. +// req, resp := client.StopBuildRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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 Types: +// * InvalidInputException +// The input value that was provided is not valid. +// +// * ResourceNotFoundException +// The specified AWS resource cannot be found. +// +// See also, 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) + return out, req.Send() +} + +// StopBuildWithContext is the same as StopBuild with the addition of +// the ability to pass a context and additional request options. +// +// See StopBuild for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) StopBuildWithContext(ctx aws.Context, input *StopBuildInput, opts ...request.Option) (*StopBuildOutput, error) { + req, out := c.StopBuildRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateProject = "UpdateProject" + +// UpdateProjectRequest generates a "aws/request.Request" representing the +// client's request for the UpdateProject operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateProject for more information on using the UpdateProject +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateProjectRequest method. +// req, resp := client.UpdateProjectRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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 Types: +// * InvalidInputException +// The input value that was provided is not valid. +// +// * ResourceNotFoundException +// The specified AWS resource cannot be found. +// +// See also, 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) + return out, req.Send() +} + +// UpdateProjectWithContext is the same as UpdateProject with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateProject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) UpdateProjectWithContext(ctx aws.Context, input *UpdateProjectInput, opts ...request.Option) (*UpdateProjectOutput, error) { + req, out := c.UpdateProjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateReportGroup = "UpdateReportGroup" + +// UpdateReportGroupRequest generates a "aws/request.Request" representing the +// client's request for the UpdateReportGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateReportGroup for more information on using the UpdateReportGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateReportGroupRequest method. +// req, resp := client.UpdateReportGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/UpdateReportGroup +func (c *CodeBuild) UpdateReportGroupRequest(input *UpdateReportGroupInput) (req *request.Request, output *UpdateReportGroupOutput) { + op := &request.Operation{ + Name: opUpdateReportGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateReportGroupInput{} + } + + output = &UpdateReportGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateReportGroup API operation for AWS CodeBuild. +// +// Updates a report 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 CodeBuild's +// API operation UpdateReportGroup for usage and error information. +// +// Returned Error Types: +// * InvalidInputException +// The input value that was provided is not valid. +// +// * ResourceNotFoundException +// The specified AWS resource cannot be found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/UpdateReportGroup +func (c *CodeBuild) UpdateReportGroup(input *UpdateReportGroupInput) (*UpdateReportGroupOutput, error) { + req, out := c.UpdateReportGroupRequest(input) + return out, req.Send() +} + +// UpdateReportGroupWithContext is the same as UpdateReportGroup with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateReportGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) UpdateReportGroupWithContext(ctx aws.Context, input *UpdateReportGroupInput, opts ...request.Option) (*UpdateReportGroupOutput, error) { + req, out := c.UpdateReportGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateWebhook = "UpdateWebhook" + +// UpdateWebhookRequest generates a "aws/request.Request" representing the +// client's request for the UpdateWebhook operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateWebhook for more information on using the UpdateWebhook +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateWebhookRequest method. +// req, resp := client.UpdateWebhookRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/UpdateWebhook +func (c *CodeBuild) UpdateWebhookRequest(input *UpdateWebhookInput) (req *request.Request, output *UpdateWebhookOutput) { + op := &request.Operation{ + Name: opUpdateWebhook, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateWebhookInput{} + } + + output = &UpdateWebhookOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateWebhook API operation for AWS CodeBuild. +// +// Updates the webhook associated with an AWS CodeBuild build project. +// +// If you use Bitbucket for your repository, rotateSecret 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 AWS CodeBuild's +// API operation UpdateWebhook for usage and error information. +// +// Returned Error Types: +// * InvalidInputException +// The input value that was provided is not valid. +// +// * ResourceNotFoundException +// The specified AWS resource cannot be found. +// +// * OAuthProviderException +// There was a problem with the underlying OAuth provider. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06/UpdateWebhook +func (c *CodeBuild) UpdateWebhook(input *UpdateWebhookInput) (*UpdateWebhookOutput, error) { + req, out := c.UpdateWebhookRequest(input) + return out, req.Send() +} + +// UpdateWebhookWithContext is the same as UpdateWebhook with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateWebhook for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeBuild) UpdateWebhookWithContext(ctx aws.Context, input *UpdateWebhookInput, opts ...request.Option) (*UpdateWebhookOutput, error) { + req, out := c.UpdateWebhookRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// An AWS service limit was exceeded for the calling AWS account. +type AccountLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AccountLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountLimitExceededException) GoString() string { + return s.String() +} + +func newErrorAccountLimitExceededException(v protocol.ResponseMetadata) error { + return &AccountLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccountLimitExceededException) Code() string { + return "AccountLimitExceededException" +} + +// Message returns the exception's message. +func (s AccountLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccountLimitExceededException) OrigErr() error { + return nil +} + +func (s AccountLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccountLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccountLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +type BatchDeleteBuildsInput struct { + _ struct{} `type:"structure"` + + // The IDs of the builds to delete. + // + // Ids is a required field + Ids []*string `locationName:"ids" min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchDeleteBuildsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchDeleteBuildsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchDeleteBuildsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchDeleteBuildsInput"} + 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 *BatchDeleteBuildsInput) SetIds(v []*string) *BatchDeleteBuildsInput { + s.Ids = v + return s +} + +type BatchDeleteBuildsOutput struct { + _ struct{} `type:"structure"` + + // The IDs of the builds that were successfully deleted. + BuildsDeleted []*string `locationName:"buildsDeleted" min:"1" type:"list"` + + // Information about any builds that could not be successfully deleted. + BuildsNotDeleted []*BuildNotDeleted `locationName:"buildsNotDeleted" type:"list"` +} + +// String returns the string representation +func (s BatchDeleteBuildsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchDeleteBuildsOutput) GoString() string { + return s.String() +} // SetBuildsDeleted sets the BuildsDeleted field's value. func (s *BatchDeleteBuildsOutput) SetBuildsDeleted(v []*string) *BatchDeleteBuildsOutput { @@ -1649,39 +2919,1826 @@ func (s *BatchDeleteBuildsOutput) SetBuildsDeleted(v []*string) *BatchDeleteBuil return s } -// SetBuildsNotDeleted sets the BuildsNotDeleted field's value. -func (s *BatchDeleteBuildsOutput) SetBuildsNotDeleted(v []*BuildNotDeleted) *BatchDeleteBuildsOutput { - s.BuildsNotDeleted = v +// SetBuildsNotDeleted sets the BuildsNotDeleted field's value. +func (s *BatchDeleteBuildsOutput) SetBuildsNotDeleted(v []*BuildNotDeleted) *BatchDeleteBuildsOutput { + s.BuildsNotDeleted = v + return s +} + +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 +} + +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 +} + +type BatchGetProjectsInput struct { + _ struct{} `type:"structure"` + + // The names or ARNs of the build projects. To get information about a project + // shared with your AWS account, its ARN must be specified. You cannot specify + // a shared project using its name. + // + // 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 +} + +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 +} + +type BatchGetReportGroupsInput struct { + _ struct{} `type:"structure"` + + // An array of report group ARNs that identify the report groups to return. + // + // ReportGroupArns is a required field + ReportGroupArns []*string `locationName:"reportGroupArns" min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchGetReportGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchGetReportGroupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchGetReportGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchGetReportGroupsInput"} + if s.ReportGroupArns == nil { + invalidParams.Add(request.NewErrParamRequired("ReportGroupArns")) + } + if s.ReportGroupArns != nil && len(s.ReportGroupArns) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ReportGroupArns", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetReportGroupArns sets the ReportGroupArns field's value. +func (s *BatchGetReportGroupsInput) SetReportGroupArns(v []*string) *BatchGetReportGroupsInput { + s.ReportGroupArns = v + return s +} + +type BatchGetReportGroupsOutput struct { + _ struct{} `type:"structure"` + + // The array of report groups returned by BatchGetReportGroups. + ReportGroups []*ReportGroup `locationName:"reportGroups" min:"1" type:"list"` + + // An array of ARNs passed to BatchGetReportGroups that are not associated with + // a ReportGroup. + ReportGroupsNotFound []*string `locationName:"reportGroupsNotFound" min:"1" type:"list"` +} + +// String returns the string representation +func (s BatchGetReportGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchGetReportGroupsOutput) GoString() string { + return s.String() +} + +// SetReportGroups sets the ReportGroups field's value. +func (s *BatchGetReportGroupsOutput) SetReportGroups(v []*ReportGroup) *BatchGetReportGroupsOutput { + s.ReportGroups = v + return s +} + +// SetReportGroupsNotFound sets the ReportGroupsNotFound field's value. +func (s *BatchGetReportGroupsOutput) SetReportGroupsNotFound(v []*string) *BatchGetReportGroupsOutput { + s.ReportGroupsNotFound = v + return s +} + +type BatchGetReportsInput struct { + _ struct{} `type:"structure"` + + // An array of ARNs that identify the Report objects to return. + // + // ReportArns is a required field + ReportArns []*string `locationName:"reportArns" min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchGetReportsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchGetReportsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchGetReportsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchGetReportsInput"} + if s.ReportArns == nil { + invalidParams.Add(request.NewErrParamRequired("ReportArns")) + } + if s.ReportArns != nil && len(s.ReportArns) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ReportArns", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetReportArns sets the ReportArns field's value. +func (s *BatchGetReportsInput) SetReportArns(v []*string) *BatchGetReportsInput { + s.ReportArns = v + return s +} + +type BatchGetReportsOutput struct { + _ struct{} `type:"structure"` + + // The array of Report objects returned by BatchGetReports. + Reports []*Report `locationName:"reports" min:"1" type:"list"` + + // An array of ARNs passed to BatchGetReportGroups that are not associated with + // a Report. + ReportsNotFound []*string `locationName:"reportsNotFound" min:"1" type:"list"` +} + +// String returns the string representation +func (s BatchGetReportsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchGetReportsOutput) GoString() string { + return s.String() +} + +// SetReports sets the Reports field's value. +func (s *BatchGetReportsOutput) SetReports(v []*Report) *BatchGetReportsOutput { + s.Reports = v + return s +} + +// SetReportsNotFound sets the ReportsNotFound field's value. +func (s *BatchGetReportsOutput) SetReportsNotFound(v []*string) *BatchGetReportsOutput { + s.ReportsNotFound = v + return s +} + +// Information about a 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 is complete. True if complete; otherwise, false. + BuildComplete *bool `locationName:"buildComplete" type:"boolean"` + + // The number of the build. For each project, the buildNumber of its first build + // is 1. The buildNumber of each subsequent build is incremented by 1. If a + // build is deleted, the buildNumber of other builds does not change. + BuildNumber *int64 `locationName:"buildNumber" type:"long"` + + // 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"` + + // Information about the cache for the build. + Cache *ProjectCache `locationName:"cache" type:"structure"` + + // The current build phase. + CurrentPhase *string `locationName:"currentPhase" type:"string"` + + // The AWS Key Management Service (AWS KMS) customer master key (CMK) to be + // used for encrypting the build output artifacts. + // + // You can use a cross-account KMS key to encrypt the build output artifacts + // if your service role has permission to that key. + // + // You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, + // the CMK's alias (using the format alias/alias-name ). + EncryptionKey *string `locationName:"encryptionKey" min:"1" type:"string"` + + // When the build process ended, expressed in Unix time format. + EndTime *time.Time `locationName:"endTime" type:"timestamp"` + + // Information about the build environment for this build. + Environment *ProjectEnvironment `locationName:"environment" type:"structure"` + + // A list of exported environment variables for this build. + ExportedEnvironmentVariables []*ExportedEnvironmentVariable `locationName:"exportedEnvironmentVariables" type:"list"` + + // An array of ProjectFileSystemLocation objects for a CodeBuild build project. + // A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, + // mountPoint, and type of a file system created using Amazon Elastic File System. + FileSystemLocations []*ProjectFileSystemLocation `locationName:"fileSystemLocations" type:"list"` + + // 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"` + + // Describes a network interface. + NetworkInterface *NetworkInterface `locationName:"networkInterface" type:"structure"` + + // Information about all previous build phases that are complete and information + // about any current build phase that is not yet complete. + Phases []*BuildPhase `locationName:"phases" type:"list"` + + // The name of the AWS CodeBuild project. + ProjectName *string `locationName:"projectName" min:"1" type:"string"` + + // The number of minutes a build is allowed to be queued before it times out. + QueuedTimeoutInMinutes *int64 `locationName:"queuedTimeoutInMinutes" type:"integer"` + + // An array of the ARNs associated with this build's reports. + ReportArns []*string `locationName:"reportArns" type:"list"` + + // An identifier for the version of this build's source code. + // + // * For AWS CodeCommit, GitHub, GitHub Enterprise, and BitBucket, the commit + // ID. + // + // * For AWS CodePipeline, the source revision provided by AWS CodePipeline. + // + // * For Amazon Simple Storage Service (Amazon S3), this does not apply. + ResolvedSourceVersion *string `locationName:"resolvedSourceVersion" min:"1" type:"string"` + + // An array of ProjectArtifacts objects. + SecondaryArtifacts []*BuildArtifacts `locationName:"secondaryArtifacts" type:"list"` + + // An array of ProjectSourceVersion objects. Each ProjectSourceVersion must + // be one of: + // + // * For AWS CodeCommit: the commit ID, branch, or Git tag to use. + // + // * For GitHub: the commit ID, pull request ID, branch name, or tag name + // that corresponds to the version of the source code you want to build. + // If a pull request ID is specified, it must use the format pr/pull-request-ID + // (for example, pr/25). If a branch name is specified, the branch's HEAD + // commit ID is used. If not specified, the default branch's HEAD commit + // ID is used. + // + // * For Bitbucket: the commit ID, branch name, or tag name that corresponds + // to the version of the source code you want to build. If a branch name + // is specified, the branch's HEAD commit ID is used. If not specified, the + // default branch's HEAD commit ID is used. + // + // * For Amazon Simple Storage Service (Amazon S3): the version ID of the + // object that represents the build input ZIP file to use. + SecondarySourceVersions []*ProjectSourceVersion `locationName:"secondarySourceVersions" type:"list"` + + // An array of ProjectSource objects. + SecondarySources []*ProjectSource `locationName:"secondarySources" type:"list"` + + // The name of a service role used for this build. + ServiceRole *string `locationName:"serviceRole" 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. If + // sourceVersion is specified at the project level, then this sourceVersion + // (at the build level) takes precedence. + // + // For more information, see Source Version Sample with CodeBuild (https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html) + // in the AWS CodeBuild User Guide. + 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"` + + // 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"` + + // If your AWS CodeBuild project accesses resources in an Amazon VPC, you provide + // this parameter that identifies the VPC ID and the list of security group + // IDs and subnet IDs. The security groups and subnets must belong to the same + // VPC. You must provide at least one security group and one subnet ID. + VpcConfig *VpcConfig `locationName:"vpcConfig" type:"structure"` +} + +// 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 +} + +// SetBuildNumber sets the BuildNumber field's value. +func (s *Build) SetBuildNumber(v int64) *Build { + s.BuildNumber = &v + return s +} + +// SetBuildStatus sets the BuildStatus field's value. +func (s *Build) SetBuildStatus(v string) *Build { + s.BuildStatus = &v + return s +} + +// SetCache sets the Cache field's value. +func (s *Build) SetCache(v *ProjectCache) *Build { + s.Cache = v + return s +} + +// SetCurrentPhase sets the CurrentPhase field's value. +func (s *Build) SetCurrentPhase(v string) *Build { + s.CurrentPhase = &v + return s +} + +// SetEncryptionKey sets the EncryptionKey field's value. +func (s *Build) SetEncryptionKey(v string) *Build { + s.EncryptionKey = &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 +} + +// SetExportedEnvironmentVariables sets the ExportedEnvironmentVariables field's value. +func (s *Build) SetExportedEnvironmentVariables(v []*ExportedEnvironmentVariable) *Build { + s.ExportedEnvironmentVariables = v + return s +} + +// SetFileSystemLocations sets the FileSystemLocations field's value. +func (s *Build) SetFileSystemLocations(v []*ProjectFileSystemLocation) *Build { + s.FileSystemLocations = 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 +} + +// SetNetworkInterface sets the NetworkInterface field's value. +func (s *Build) SetNetworkInterface(v *NetworkInterface) *Build { + s.NetworkInterface = 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 +} + +// SetQueuedTimeoutInMinutes sets the QueuedTimeoutInMinutes field's value. +func (s *Build) SetQueuedTimeoutInMinutes(v int64) *Build { + s.QueuedTimeoutInMinutes = &v + return s +} + +// SetReportArns sets the ReportArns field's value. +func (s *Build) SetReportArns(v []*string) *Build { + s.ReportArns = v + return s +} + +// SetResolvedSourceVersion sets the ResolvedSourceVersion field's value. +func (s *Build) SetResolvedSourceVersion(v string) *Build { + s.ResolvedSourceVersion = &v + return s +} + +// SetSecondaryArtifacts sets the SecondaryArtifacts field's value. +func (s *Build) SetSecondaryArtifacts(v []*BuildArtifacts) *Build { + s.SecondaryArtifacts = v + return s +} + +// SetSecondarySourceVersions sets the SecondarySourceVersions field's value. +func (s *Build) SetSecondarySourceVersions(v []*ProjectSourceVersion) *Build { + s.SecondarySourceVersions = v + return s +} + +// SetSecondarySources sets the SecondarySources field's value. +func (s *Build) SetSecondarySources(v []*ProjectSource) *Build { + s.SecondarySources = v + return s +} + +// SetServiceRole sets the ServiceRole field's value. +func (s *Build) SetServiceRole(v string) *Build { + s.ServiceRole = &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 +} + +// SetVpcConfig sets the VpcConfig field's value. +func (s *Build) SetVpcConfig(v *VpcConfig) *Build { + s.VpcConfig = v + return s +} + +// Information about build output artifacts. +type BuildArtifacts struct { + _ struct{} `type:"structure"` + + // An identifier for this artifact definition. + ArtifactIdentifier *string `locationName:"artifactIdentifier" type:"string"` + + // Information that tells you if encryption for build artifacts is disabled. + EncryptionDisabled *bool `locationName:"encryptionDisabled" type:"boolean"` + + // 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 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"` + + // If this flag is set, a name specified in the buildspec file overrides the + // artifact name. The name specified in a buildspec file is calculated at build + // time and uses the Shell Command Language. For example, you can append a date + // and time to your artifact name so that it is always unique. + OverrideArtifactName *bool `locationName:"overrideArtifactName" type:"boolean"` + + // The SHA-256 hash of the build artifact. + // + // You can use this hash along with a checksum tool to confirm 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() +} + +// SetArtifactIdentifier sets the ArtifactIdentifier field's value. +func (s *BuildArtifacts) SetArtifactIdentifier(v string) *BuildArtifacts { + s.ArtifactIdentifier = &v + return s +} + +// SetEncryptionDisabled sets the EncryptionDisabled field's value. +func (s *BuildArtifacts) SetEncryptionDisabled(v bool) *BuildArtifacts { + s.EncryptionDisabled = &v + return s +} + +// 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 +} + +// SetOverrideArtifactName sets the OverrideArtifactName field's value. +func (s *BuildArtifacts) SetOverrideArtifactName(v bool) *BuildArtifacts { + s.OverrideArtifactName = &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 build that could not be successfully deleted. +type BuildNotDeleted struct { + _ struct{} `type:"structure"` + + // The ID of the build that could not be successfully deleted. + Id *string `locationName:"id" min:"1" type:"string"` + + // Additional information about the build that could not be successfully deleted. + StatusCode *string `locationName:"statusCode" type:"string"` +} + +// String returns the string representation +func (s BuildNotDeleted) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BuildNotDeleted) GoString() string { + return s.String() +} + +// SetId sets the Id field's value. +func (s *BuildNotDeleted) SetId(v string) *BuildNotDeleted { + s.Id = &v + return s +} + +// SetStatusCode sets the StatusCode field's value. +func (s *BuildNotDeleted) SetStatusCode(v string) *BuildNotDeleted { + s.StatusCode = &v + return s +} + +// Information about a stage for a build. +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"` + + // 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. + // + // * QUEUED: The build has been submitted and is queued behind other submitted + // builds. + // + // * 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. + // + // * QUEUED: The build has been submitted and is queued behind other submitted + // builds. + // + // * 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"` +} + +// 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 +} + +// Information about Amazon CloudWatch Logs for a build project. +type CloudWatchLogsConfig struct { + _ struct{} `type:"structure"` + + // The group name of the logs in Amazon CloudWatch Logs. For more information, + // see Working with Log Groups and Log Streams (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html). + GroupName *string `locationName:"groupName" type:"string"` + + // The current status of the logs in Amazon CloudWatch Logs for a build project. + // Valid values are: + // + // * ENABLED: Amazon CloudWatch Logs are enabled for this build project. + // + // * DISABLED: Amazon CloudWatch Logs are not enabled for this build project. + // + // Status is a required field + Status *string `locationName:"status" type:"string" required:"true" enum:"LogsConfigStatusType"` + + // The prefix of the stream name of the Amazon CloudWatch Logs. For more information, + // see Working with Log Groups and Log Streams (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html). + StreamName *string `locationName:"streamName" type:"string"` +} + +// String returns the string representation +func (s CloudWatchLogsConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudWatchLogsConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CloudWatchLogsConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CloudWatchLogsConfig"} + if s.Status == nil { + invalidParams.Add(request.NewErrParamRequired("Status")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupName sets the GroupName field's value. +func (s *CloudWatchLogsConfig) SetGroupName(v string) *CloudWatchLogsConfig { + s.GroupName = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CloudWatchLogsConfig) SetStatus(v string) *CloudWatchLogsConfig { + s.Status = &v + return s +} + +// SetStreamName sets the StreamName field's value. +func (s *CloudWatchLogsConfig) SetStreamName(v string) *CloudWatchLogsConfig { + s.StreamName = &v + return s +} + +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"` + + // Set this to true to generate a publicly accessible URL for your project's + // build badge. + BadgeEnabled *bool `locationName:"badgeEnabled" type:"boolean"` + + // Stores recently used information so that it can be quickly accessed at a + // later time. + Cache *ProjectCache `locationName:"cache" type:"structure"` + + // 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 use a cross-account KMS key to encrypt the build output artifacts + // if your service role has permission to that key. + // + // You can specify either the Amazon Resource Name (ARN) of the CMK 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"` + + // An array of ProjectFileSystemLocation objects for a CodeBuild build project. + // A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, + // mountPoint, and type of a file system created using Amazon Elastic File System. + FileSystemLocations []*ProjectFileSystemLocation `locationName:"fileSystemLocations" type:"list"` + + // Information about logs for the build project. These can be logs in Amazon + // CloudWatch Logs, logs uploaded to a specified S3 bucket, or both. + LogsConfig *LogsConfig `locationName:"logsConfig" type:"structure"` + + // The name of the build project. + // + // Name is a required field + Name *string `locationName:"name" min:"2" type:"string" required:"true"` + + // The number of minutes a build is allowed to be queued before it times out. + QueuedTimeoutInMinutes *int64 `locationName:"queuedTimeoutInMinutes" min:"5" type:"integer"` + + // An array of ProjectArtifacts objects. + SecondaryArtifacts []*ProjectArtifacts `locationName:"secondaryArtifacts" type:"list"` + + // An array of ProjectSourceVersion objects. If secondarySourceVersions is specified + // at the build level, then they take precedence over these secondarySourceVersions + // (at the project level). + SecondarySourceVersions []*ProjectSourceVersion `locationName:"secondarySourceVersions" type:"list"` + + // An array of ProjectSource objects. + SecondarySources []*ProjectSource `locationName:"secondarySources" type:"list"` + + // 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 is a required field + ServiceRole *string `locationName:"serviceRole" min:"1" type:"string" required:"true"` + + // 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 version of the build input to be built for this project. If not specified, + // the latest version is used. If specified, it must be one of: + // + // * For AWS CodeCommit: the commit ID, branch, or Git tag to use. + // + // * For GitHub: the commit ID, pull request ID, branch name, or tag name + // that corresponds to the version of the source code you want to build. + // If a pull request ID is specified, it must use the format pr/pull-request-ID + // (for example pr/25). If a branch name is specified, the branch's HEAD + // commit ID is used. If not specified, the default branch's HEAD commit + // ID is used. + // + // * For Bitbucket: the commit ID, branch name, or tag name that corresponds + // to the version of the source code you want to build. If a branch name + // is specified, the branch's HEAD commit ID is used. If not specified, the + // default branch's HEAD commit ID is used. + // + // * For Amazon Simple Storage Service (Amazon S3): the version ID of the + // object that represents the build input ZIP file to use. + // + // If sourceVersion is specified at the build level, then that version takes + // precedence over this sourceVersion (at the project level). + // + // For more information, see Source Version Sample with CodeBuild (https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html) + // in the AWS CodeBuild User Guide. + SourceVersion *string `locationName:"sourceVersion" type:"string"` + + // 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 + // before it times out any build that has not been marked as completed. The + // default is 60 minutes. + TimeoutInMinutes *int64 `locationName:"timeoutInMinutes" min:"5" type:"integer"` + + // VpcConfig enables AWS CodeBuild to access resources in an Amazon VPC. + VpcConfig *VpcConfig `locationName:"vpcConfig" type:"structure"` +} + +// 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.QueuedTimeoutInMinutes != nil && *s.QueuedTimeoutInMinutes < 5 { + invalidParams.Add(request.NewErrParamMinValue("QueuedTimeoutInMinutes", 5)) + } + if s.ServiceRole == nil { + invalidParams.Add(request.NewErrParamRequired("ServiceRole")) + } + 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 < 5 { + invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutes", 5)) + } + if s.Artifacts != nil { + if err := s.Artifacts.Validate(); err != nil { + invalidParams.AddNested("Artifacts", err.(request.ErrInvalidParams)) + } + } + if s.Cache != nil { + if err := s.Cache.Validate(); err != nil { + invalidParams.AddNested("Cache", err.(request.ErrInvalidParams)) + } + } + if s.Environment != nil { + if err := s.Environment.Validate(); err != nil { + invalidParams.AddNested("Environment", err.(request.ErrInvalidParams)) + } + } + if s.LogsConfig != nil { + if err := s.LogsConfig.Validate(); err != nil { + invalidParams.AddNested("LogsConfig", err.(request.ErrInvalidParams)) + } + } + if s.SecondaryArtifacts != nil { + for i, v := range s.SecondaryArtifacts { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SecondaryArtifacts", i), err.(request.ErrInvalidParams)) + } + } + } + if s.SecondarySourceVersions != nil { + for i, v := range s.SecondarySourceVersions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SecondarySourceVersions", i), err.(request.ErrInvalidParams)) + } + } + } + if s.SecondarySources != nil { + for i, v := range s.SecondarySources { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SecondarySources", i), 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 s.VpcConfig != nil { + if err := s.VpcConfig.Validate(); err != nil { + invalidParams.AddNested("VpcConfig", 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 +} + +// SetBadgeEnabled sets the BadgeEnabled field's value. +func (s *CreateProjectInput) SetBadgeEnabled(v bool) *CreateProjectInput { + s.BadgeEnabled = &v + return s +} + +// SetCache sets the Cache field's value. +func (s *CreateProjectInput) SetCache(v *ProjectCache) *CreateProjectInput { + s.Cache = 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 +} + +// SetFileSystemLocations sets the FileSystemLocations field's value. +func (s *CreateProjectInput) SetFileSystemLocations(v []*ProjectFileSystemLocation) *CreateProjectInput { + s.FileSystemLocations = v + return s +} + +// SetLogsConfig sets the LogsConfig field's value. +func (s *CreateProjectInput) SetLogsConfig(v *LogsConfig) *CreateProjectInput { + s.LogsConfig = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateProjectInput) SetName(v string) *CreateProjectInput { + s.Name = &v + return s +} + +// SetQueuedTimeoutInMinutes sets the QueuedTimeoutInMinutes field's value. +func (s *CreateProjectInput) SetQueuedTimeoutInMinutes(v int64) *CreateProjectInput { + s.QueuedTimeoutInMinutes = &v + return s +} + +// SetSecondaryArtifacts sets the SecondaryArtifacts field's value. +func (s *CreateProjectInput) SetSecondaryArtifacts(v []*ProjectArtifacts) *CreateProjectInput { + s.SecondaryArtifacts = v + return s +} + +// SetSecondarySourceVersions sets the SecondarySourceVersions field's value. +func (s *CreateProjectInput) SetSecondarySourceVersions(v []*ProjectSourceVersion) *CreateProjectInput { + s.SecondarySourceVersions = v + return s +} + +// SetSecondarySources sets the SecondarySources field's value. +func (s *CreateProjectInput) SetSecondarySources(v []*ProjectSource) *CreateProjectInput { + s.SecondarySources = 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 +} + +// SetSourceVersion sets the SourceVersion field's value. +func (s *CreateProjectInput) SetSourceVersion(v string) *CreateProjectInput { + s.SourceVersion = &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 +} + +// SetVpcConfig sets the VpcConfig field's value. +func (s *CreateProjectInput) SetVpcConfig(v *VpcConfig) *CreateProjectInput { + s.VpcConfig = v + return s +} + +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 +} + +type CreateReportGroupInput struct { + _ struct{} `type:"structure"` + + // A ReportExportConfig object that contains information about where the report + // group test results are exported. + // + // ExportConfig is a required field + ExportConfig *ReportExportConfig `locationName:"exportConfig" type:"structure" required:"true"` + + // The name of the report group. + // + // Name is a required field + Name *string `locationName:"name" min:"2" type:"string" required:"true"` + + // The type of report group. + // + // Type is a required field + Type *string `locationName:"type" type:"string" required:"true" enum:"ReportType"` +} + +// String returns the string representation +func (s CreateReportGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateReportGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateReportGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateReportGroupInput"} + if s.ExportConfig == nil { + invalidParams.Add(request.NewErrParamRequired("ExportConfig")) + } + 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.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + if s.ExportConfig != nil { + if err := s.ExportConfig.Validate(); err != nil { + invalidParams.AddNested("ExportConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetExportConfig sets the ExportConfig field's value. +func (s *CreateReportGroupInput) SetExportConfig(v *ReportExportConfig) *CreateReportGroupInput { + s.ExportConfig = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateReportGroupInput) SetName(v string) *CreateReportGroupInput { + s.Name = &v + return s +} + +// SetType sets the Type field's value. +func (s *CreateReportGroupInput) SetType(v string) *CreateReportGroupInput { + s.Type = &v + return s +} + +type CreateReportGroupOutput struct { + _ struct{} `type:"structure"` + + // Information about the report group that was created. + ReportGroup *ReportGroup `locationName:"reportGroup" type:"structure"` +} + +// String returns the string representation +func (s CreateReportGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateReportGroupOutput) GoString() string { + return s.String() +} + +// SetReportGroup sets the ReportGroup field's value. +func (s *CreateReportGroupOutput) SetReportGroup(v *ReportGroup) *CreateReportGroupOutput { + s.ReportGroup = v + return s +} + +type CreateWebhookInput struct { + _ struct{} `type:"structure"` + + // A regular expression used to determine which repository branches are built + // when a webhook is triggered. If the name of a branch matches the regular + // expression, then it is built. If branchFilter is empty, then all branches + // are built. + // + // It is recommended that you use filterGroups instead of branchFilter. + BranchFilter *string `locationName:"branchFilter" type:"string"` + + // An array of arrays of WebhookFilter objects used to determine which webhooks + // are triggered. At least one WebhookFilter in the array must specify EVENT + // as its type. + // + // For a build to be triggered, at least one filter group in the filterGroups + // array must pass. For a filter group to pass, each of its filters must pass. + FilterGroups [][]*WebhookFilter `locationName:"filterGroups" type:"list"` + + // The name of the AWS CodeBuild project. + // + // ProjectName is a required field + ProjectName *string `locationName:"projectName" min:"2" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateWebhookInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateWebhookInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateWebhookInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateWebhookInput"} + if s.ProjectName == nil { + invalidParams.Add(request.NewErrParamRequired("ProjectName")) + } + if s.ProjectName != nil && len(*s.ProjectName) < 2 { + invalidParams.Add(request.NewErrParamMinLen("ProjectName", 2)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBranchFilter sets the BranchFilter field's value. +func (s *CreateWebhookInput) SetBranchFilter(v string) *CreateWebhookInput { + s.BranchFilter = &v + return s +} + +// SetFilterGroups sets the FilterGroups field's value. +func (s *CreateWebhookInput) SetFilterGroups(v [][]*WebhookFilter) *CreateWebhookInput { + s.FilterGroups = v + return s +} + +// SetProjectName sets the ProjectName field's value. +func (s *CreateWebhookInput) SetProjectName(v string) *CreateWebhookInput { + s.ProjectName = &v + return s +} + +type CreateWebhookOutput struct { + _ struct{} `type:"structure"` + + // Information about a webhook that connects repository events to a build project + // in AWS CodeBuild. + Webhook *Webhook `locationName:"webhook" type:"structure"` +} + +// String returns the string representation +func (s CreateWebhookOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateWebhookOutput) GoString() string { + return s.String() +} + +// SetWebhook sets the Webhook field's value. +func (s *CreateWebhookOutput) SetWebhook(v *Webhook) *CreateWebhookOutput { + s.Webhook = v + return s +} + +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 } -type BatchGetBuildsInput struct { +type DeleteProjectOutput struct { _ struct{} `type:"structure"` +} - // The IDs of the builds. +// 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() +} + +type DeleteReportGroupInput struct { + _ struct{} `type:"structure"` + + // The ARN of the report group to delete. // - // Ids is a required field - Ids []*string `locationName:"ids" min:"1" type:"list" required:"true"` + // Arn is a required field + Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` } // String returns the string representation -func (s BatchGetBuildsInput) String() string { +func (s DeleteReportGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteReportGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteReportGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteReportGroupInput"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.Arn != nil && len(*s.Arn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *DeleteReportGroupInput) SetArn(v string) *DeleteReportGroupInput { + s.Arn = &v + return s +} + +type DeleteReportGroupOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteReportGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteReportGroupOutput) GoString() string { + return s.String() +} + +type DeleteReportInput struct { + _ struct{} `type:"structure"` + + // The ARN of the report to delete. + // + // Arn is a required field + Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteReportInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteReportInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteReportInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteReportInput"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.Arn != nil && len(*s.Arn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *DeleteReportInput) SetArn(v string) *DeleteReportInput { + s.Arn = &v + return s +} + +type DeleteReportOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteReportOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteReportOutput) GoString() string { + return s.String() +} + +type DeleteResourcePolicyInput struct { + _ struct{} `type:"structure"` + + // The ARN of the resource that is associated with the resource policy. + // + // ResourceArn is a required field + ResourceArn *string `locationName:"resourceArn" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteResourcePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteResourcePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteResourcePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteResourcePolicyInput"} + 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 *DeleteResourcePolicyInput) SetResourceArn(v string) *DeleteResourcePolicyInput { + s.ResourceArn = &v + return s +} + +type DeleteResourcePolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteResourcePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteResourcePolicyOutput) GoString() string { + return s.String() +} + +type DeleteSourceCredentialsInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the token. + // + // Arn is a required field + Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteSourceCredentialsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSourceCredentialsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteSourceCredentialsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteSourceCredentialsInput"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.Arn != nil && len(*s.Arn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *DeleteSourceCredentialsInput) SetArn(v string) *DeleteSourceCredentialsInput { + s.Arn = &v + return s +} + +type DeleteSourceCredentialsOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the token. + Arn *string `locationName:"arn" min:"1" type:"string"` +} + +// String returns the string representation +func (s DeleteSourceCredentialsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSourceCredentialsOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DeleteSourceCredentialsOutput) SetArn(v string) *DeleteSourceCredentialsOutput { + s.Arn = &v + return s +} + +type DeleteWebhookInput struct { + _ struct{} `type:"structure"` + + // The name of the AWS CodeBuild project. + // + // ProjectName is a required field + ProjectName *string `locationName:"projectName" min:"2" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteWebhookInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchGetBuildsInput) GoString() string { +func (s DeleteWebhookInput) 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")) +func (s *DeleteWebhookInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteWebhookInput"} + if s.ProjectName == nil { + invalidParams.Add(request.NewErrParamRequired("ProjectName")) } - if s.Ids != nil && len(s.Ids) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Ids", 1)) + if s.ProjectName != nil && len(*s.ProjectName) < 2 { + invalidParams.Add(request.NewErrParamMinLen("ProjectName", 2)) } if invalidParams.Len() > 0 { @@ -1690,71 +4747,70 @@ func (s *BatchGetBuildsInput) Validate() error { return nil } -// SetIds sets the Ids field's value. -func (s *BatchGetBuildsInput) SetIds(v []*string) *BatchGetBuildsInput { - s.Ids = v +// SetProjectName sets the ProjectName field's value. +func (s *DeleteWebhookInput) SetProjectName(v string) *DeleteWebhookInput { + s.ProjectName = &v return s } -type BatchGetBuildsOutput struct { +type DeleteWebhookOutput 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 { +func (s DeleteWebhookOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchGetBuildsOutput) GoString() string { +func (s DeleteWebhookOutput) 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 -} - -type BatchGetProjectsInput struct { +type DescribeTestCasesInput struct { _ struct{} `type:"structure"` - // The names of the build projects. + // A TestCaseFilter object used to filter the returned reports. + Filter *TestCaseFilter `locationName:"filter" type:"structure"` + + // The maximum number of paginated test cases returned per response. Use nextToken + // to iterate pages in the list of returned TestCase objects. The default value + // is 100. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // During a previous call, the maximum number of items that can be returned + // is the value specified in maxResults. If there more items in the list, then + // a unique string called a nextToken is returned. 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 ARN of the report for which test cases are returned. // - // Names is a required field - Names []*string `locationName:"names" min:"1" type:"list" required:"true"` + // ReportArn is a required field + ReportArn *string `locationName:"reportArn" type:"string" required:"true"` } // String returns the string representation -func (s BatchGetProjectsInput) String() string { +func (s DescribeTestCasesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchGetProjectsInput) GoString() string { +func (s DescribeTestCasesInput) 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")) +func (s *DescribeTestCasesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTestCasesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } - if s.Names != nil && len(s.Names) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Names", 1)) + if s.ReportArn == nil { + invalidParams.Add(request.NewErrParamRequired("ReportArn")) } if invalidParams.Len() > 0 { @@ -1763,621 +4819,601 @@ func (s *BatchGetProjectsInput) Validate() error { return nil } -// SetNames sets the Names field's value. -func (s *BatchGetProjectsInput) SetNames(v []*string) *BatchGetProjectsInput { - s.Names = v +// SetFilter sets the Filter field's value. +func (s *DescribeTestCasesInput) SetFilter(v *TestCaseFilter) *DescribeTestCasesInput { + s.Filter = v return s } -type BatchGetProjectsOutput struct { +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeTestCasesInput) SetMaxResults(v int64) *DescribeTestCasesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeTestCasesInput) SetNextToken(v string) *DescribeTestCasesInput { + s.NextToken = &v + return s +} + +// SetReportArn sets the ReportArn field's value. +func (s *DescribeTestCasesInput) SetReportArn(v string) *DescribeTestCasesInput { + s.ReportArn = &v + return s +} + +type DescribeTestCasesOutput struct { _ struct{} `type:"structure"` - // Information about the requested build projects. - Projects []*Project `locationName:"projects" type:"list"` + // During a previous call, the maximum number of items that can be returned + // is the value specified in maxResults. If there more items in the list, then + // a unique string called a nextToken is returned. 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 names of build projects for which information could not be found. - ProjectsNotFound []*string `locationName:"projectsNotFound" min:"1" type:"list"` + // The returned list of test cases. + TestCases []*TestCase `locationName:"testCases" type:"list"` } // String returns the string representation -func (s BatchGetProjectsOutput) String() string { +func (s DescribeTestCasesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchGetProjectsOutput) GoString() string { +func (s DescribeTestCasesOutput) GoString() string { return s.String() } -// SetProjects sets the Projects field's value. -func (s *BatchGetProjectsOutput) SetProjects(v []*Project) *BatchGetProjectsOutput { - s.Projects = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeTestCasesOutput) SetNextToken(v string) *DescribeTestCasesOutput { + s.NextToken = &v return s } -// SetProjectsNotFound sets the ProjectsNotFound field's value. -func (s *BatchGetProjectsOutput) SetProjectsNotFound(v []*string) *BatchGetProjectsOutput { - s.ProjectsNotFound = v +// SetTestCases sets the TestCases field's value. +func (s *DescribeTestCasesOutput) SetTestCases(v []*TestCase) *DescribeTestCasesOutput { + s.TestCases = v return s } -// Information about a build. -type Build struct { +// Information about a Docker image that is managed by AWS CodeBuild. +type EnvironmentImage 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 is complete. True if complete; 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"` - - // Information about the cache for the build. - Cache *ProjectCache `locationName:"cache" type:"structure"` - - // The current build phase. - CurrentPhase *string `locationName:"currentPhase" type:"string"` - - // The AWS Key Management Service (AWS KMS) customer master key (CMK) to be - // used for encrypting the build output artifacts. - // - // You can use a cross-account KMS key to encrypt the build output artifacts - // if your service role has permission to that key. - // - // You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, - // the CMK's alias (using the format alias/alias-name ). - EncryptionKey *string `locationName:"encryptionKey" min:"1" type:"string"` - - // When the build process ended, expressed in Unix time format. - EndTime *time.Time `locationName:"endTime" type:"timestamp"` - - // 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"` - - // Describes a network interface. - NetworkInterface *NetworkInterface `locationName:"networkInterface" type:"structure"` - - // Information about all previous build phases that are complete and information - // about any current build phase that is not yet complete. - Phases []*BuildPhase `locationName:"phases" type:"list"` - - // The name of the AWS CodeBuild project. - ProjectName *string `locationName:"projectName" min:"1" type:"string"` - - // The number of minutes a build is allowed to be queued before it times out. - QueuedTimeoutInMinutes *int64 `locationName:"queuedTimeoutInMinutes" type:"integer"` - - // An identifier for the version of this build's source code. - // - // * For AWS CodeCommit, GitHub, GitHub Enterprise, and BitBucket, the commit - // ID. - // - // * For AWS CodePipeline, the source revision provided by AWS CodePipeline. - // - // * For Amazon Simple Storage Service (Amazon S3), this does not apply. - ResolvedSourceVersion *string `locationName:"resolvedSourceVersion" min:"1" type:"string"` + // The description of the Docker image. + Description *string `locationName:"description" type:"string"` - // An array of ProjectArtifacts objects. - SecondaryArtifacts []*BuildArtifacts `locationName:"secondaryArtifacts" type:"list"` + // The name of the Docker image. + Name *string `locationName:"name" type:"string"` - // An array of ProjectSourceVersion objects. Each ProjectSourceVersion must - // be one of: - // - // * For AWS CodeCommit: the commit ID to use. - // - // * For GitHub: the commit ID, pull request ID, branch name, or tag name - // that corresponds to the version of the source code you want to build. - // If a pull request ID is specified, it must use the format pr/pull-request-ID - // (for example, pr/25). If a branch name is specified, the branch's HEAD - // commit ID is used. If not specified, the default branch's HEAD commit - // ID is used. - // - // * For Bitbucket: the commit ID, branch name, or tag name that corresponds - // to the version of the source code you want to build. If a branch name - // is specified, the branch's HEAD commit ID is used. If not specified, the - // default branch's HEAD commit ID is used. - // - // * For Amazon Simple Storage Service (Amazon S3): the version ID of the - // object that represents the build input ZIP file to use. - SecondarySourceVersions []*ProjectSourceVersion `locationName:"secondarySourceVersions" type:"list"` + // A list of environment image versions. + Versions []*string `locationName:"versions" type:"list"` +} - // An array of ProjectSource objects. - SecondarySources []*ProjectSource `locationName:"secondarySources" type:"list"` +// String returns the string representation +func (s EnvironmentImage) String() string { + return awsutil.Prettify(s) +} - // The name of a service role used for this build. - ServiceRole *string `locationName:"serviceRole" min:"1" type:"string"` +// GoString returns the string representation +func (s EnvironmentImage) GoString() string { + return s.String() +} - // Information about the source code to be built. - Source *ProjectSource `locationName:"source" type:"structure"` +// SetDescription sets the Description field's value. +func (s *EnvironmentImage) SetDescription(v string) *EnvironmentImage { + s.Description = &v + return s +} - // Any version identifier for the version of the source code to be built. If - // sourceVersion is specified at the project level, then this sourceVersion - // (at the build level) takes precedence. - // - // For more information, see Source Version Sample with CodeBuild (https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html) - // in the AWS CodeBuild User Guide. - SourceVersion *string `locationName:"sourceVersion" min:"1" type:"string"` +// SetName sets the Name field's value. +func (s *EnvironmentImage) SetName(v string) *EnvironmentImage { + s.Name = &v + return s +} - // When the build process started, expressed in Unix time format. - StartTime *time.Time `locationName:"startTime" type:"timestamp"` +// SetVersions sets the Versions field's value. +func (s *EnvironmentImage) SetVersions(v []*string) *EnvironmentImage { + s.Versions = v + return s +} - // 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"` +// A set of Docker images that are related by programming language and are managed +// by AWS CodeBuild. +type EnvironmentLanguage struct { + _ struct{} `type:"structure"` - // If your AWS CodeBuild project accesses resources in an Amazon VPC, you provide - // this parameter that identifies the VPC ID and the list of security group - // IDs and subnet IDs. The security groups and subnets must belong to the same - // VPC. You must provide at least one security group and one subnet ID. - VpcConfig *VpcConfig `locationName:"vpcConfig" 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 Build) String() string { +func (s EnvironmentLanguage) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Build) GoString() string { +func (s EnvironmentLanguage) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *Build) SetArn(v string) *Build { - s.Arn = &v +// SetImages sets the Images field's value. +func (s *EnvironmentLanguage) SetImages(v []*EnvironmentImage) *EnvironmentLanguage { + s.Images = v return s } -// SetArtifacts sets the Artifacts field's value. -func (s *Build) SetArtifacts(v *BuildArtifacts) *Build { - s.Artifacts = v +// SetLanguage sets the Language field's value. +func (s *EnvironmentLanguage) SetLanguage(v string) *EnvironmentLanguage { + s.Language = &v return s } -// SetBuildComplete sets the BuildComplete field's value. -func (s *Build) SetBuildComplete(v bool) *Build { - s.BuildComplete = &v - return s +// A set of Docker images that are related by platform and are managed by AWS +// CodeBuild. +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"` } -// SetBuildStatus sets the BuildStatus field's value. -func (s *Build) SetBuildStatus(v string) *Build { - s.BuildStatus = &v - return s +// String returns the string representation +func (s EnvironmentPlatform) String() string { + return awsutil.Prettify(s) } -// SetCache sets the Cache field's value. -func (s *Build) SetCache(v *ProjectCache) *Build { - s.Cache = v - return s +// GoString returns the string representation +func (s EnvironmentPlatform) GoString() string { + return s.String() } -// SetCurrentPhase sets the CurrentPhase field's value. -func (s *Build) SetCurrentPhase(v string) *Build { - s.CurrentPhase = &v +// SetLanguages sets the Languages field's value. +func (s *EnvironmentPlatform) SetLanguages(v []*EnvironmentLanguage) *EnvironmentPlatform { + s.Languages = v return s } -// SetEncryptionKey sets the EncryptionKey field's value. -func (s *Build) SetEncryptionKey(v string) *Build { - s.EncryptionKey = &v +// SetPlatform sets the Platform field's value. +func (s *EnvironmentPlatform) SetPlatform(v string) *EnvironmentPlatform { + s.Platform = &v return s } -// SetEndTime sets the EndTime field's value. -func (s *Build) SetEndTime(v time.Time) *Build { - s.EndTime = &v - return s +// Information about an environment variable for a build project or a build. +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 type of environment variable. Valid values include: + // + // * PARAMETER_STORE: An environment variable stored in Amazon EC2 Systems + // Manager Parameter Store. + // + // * PLAINTEXT: An environment variable in plain text format. This is the + // default value. + // + // * SECRETS_MANAGER: An environment variable stored in AWS Secrets Manager. + Type *string `locationName:"type" type:"string" enum:"EnvironmentVariableType"` + + // The value of the environment variable. + // + // We strongly discourage the use of PLAINTEXT environment variables to store + // sensitive values, especially AWS secret key IDs and secret access keys. PLAINTEXT + // environment variables can be displayed in plain text using the AWS CodeBuild + // console and the AWS Command Line Interface (AWS CLI). For sensitive values, + // we recommend you use an environment variable of type PARAMETER_STORE or SECRETS_MANAGER. + // + // Value is a required field + Value *string `locationName:"value" type:"string" required:"true"` } -// SetEnvironment sets the Environment field's value. -func (s *Build) SetEnvironment(v *ProjectEnvironment) *Build { - s.Environment = v - return s +// String returns the string representation +func (s EnvironmentVariable) String() string { + return awsutil.Prettify(s) } -// SetId sets the Id field's value. -func (s *Build) SetId(v string) *Build { - s.Id = &v - return s +// GoString returns the string representation +func (s EnvironmentVariable) GoString() string { + return s.String() } -// SetInitiator sets the Initiator field's value. -func (s *Build) SetInitiator(v string) *Build { - s.Initiator = &v - return s +// 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 } -// SetLogs sets the Logs field's value. -func (s *Build) SetLogs(v *LogsLocation) *Build { - s.Logs = v +// SetName sets the Name field's value. +func (s *EnvironmentVariable) SetName(v string) *EnvironmentVariable { + s.Name = &v return s } -// SetNetworkInterface sets the NetworkInterface field's value. -func (s *Build) SetNetworkInterface(v *NetworkInterface) *Build { - s.NetworkInterface = v +// SetType sets the Type field's value. +func (s *EnvironmentVariable) SetType(v string) *EnvironmentVariable { + s.Type = &v return s } -// SetPhases sets the Phases field's value. -func (s *Build) SetPhases(v []*BuildPhase) *Build { - s.Phases = v +// SetValue sets the Value field's value. +func (s *EnvironmentVariable) SetValue(v string) *EnvironmentVariable { + s.Value = &v return s } -// SetProjectName sets the ProjectName field's value. -func (s *Build) SetProjectName(v string) *Build { - s.ProjectName = &v - return s +// Information about an exported environment variable. +type ExportedEnvironmentVariable struct { + _ struct{} `type:"structure"` + + // The name of this exported environment variable. + Name *string `locationName:"name" min:"1" type:"string"` + + // The value assigned to this exported environment variable. + // + // During a build, the value of a variable is available starting with the install + // phase. It can be updated between the start of the install phase and the end + // of the post_build phase. After the post_build phase ends, the value of exported + // variables cannot change. + Value *string `locationName:"value" type:"string"` } -// SetQueuedTimeoutInMinutes sets the QueuedTimeoutInMinutes field's value. -func (s *Build) SetQueuedTimeoutInMinutes(v int64) *Build { - s.QueuedTimeoutInMinutes = &v - return s +// String returns the string representation +func (s ExportedEnvironmentVariable) String() string { + return awsutil.Prettify(s) } -// SetResolvedSourceVersion sets the ResolvedSourceVersion field's value. -func (s *Build) SetResolvedSourceVersion(v string) *Build { - s.ResolvedSourceVersion = &v - return s +// GoString returns the string representation +func (s ExportedEnvironmentVariable) GoString() string { + return s.String() } -// SetSecondaryArtifacts sets the SecondaryArtifacts field's value. -func (s *Build) SetSecondaryArtifacts(v []*BuildArtifacts) *Build { - s.SecondaryArtifacts = v +// SetName sets the Name field's value. +func (s *ExportedEnvironmentVariable) SetName(v string) *ExportedEnvironmentVariable { + s.Name = &v return s } -// SetSecondarySourceVersions sets the SecondarySourceVersions field's value. -func (s *Build) SetSecondarySourceVersions(v []*ProjectSourceVersion) *Build { - s.SecondarySourceVersions = v +// SetValue sets the Value field's value. +func (s *ExportedEnvironmentVariable) SetValue(v string) *ExportedEnvironmentVariable { + s.Value = &v return s } -// SetSecondarySources sets the SecondarySources field's value. -func (s *Build) SetSecondarySources(v []*ProjectSource) *Build { - s.SecondarySources = v - return s +type GetResourcePolicyInput struct { + _ struct{} `type:"structure"` + + // The ARN of the resource that is associated with the resource policy. + // + // ResourceArn is a required field + ResourceArn *string `locationName:"resourceArn" min:"1" type:"string" required:"true"` } -// SetServiceRole sets the ServiceRole field's value. -func (s *Build) SetServiceRole(v string) *Build { - s.ServiceRole = &v - return s +// String returns the string representation +func (s GetResourcePolicyInput) String() string { + return awsutil.Prettify(s) } -// SetSource sets the Source field's value. -func (s *Build) SetSource(v *ProjectSource) *Build { - s.Source = v - return s +// GoString returns the string representation +func (s GetResourcePolicyInput) GoString() string { + return s.String() } -// SetSourceVersion sets the SourceVersion field's value. -func (s *Build) SetSourceVersion(v string) *Build { - s.SourceVersion = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetResourcePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetResourcePolicyInput"} + 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 } -// SetStartTime sets the StartTime field's value. -func (s *Build) SetStartTime(v time.Time) *Build { - s.StartTime = &v +// SetResourceArn sets the ResourceArn field's value. +func (s *GetResourcePolicyInput) SetResourceArn(v string) *GetResourcePolicyInput { + s.ResourceArn = &v return s } -// SetTimeoutInMinutes sets the TimeoutInMinutes field's value. -func (s *Build) SetTimeoutInMinutes(v int64) *Build { - s.TimeoutInMinutes = &v - return s +type GetResourcePolicyOutput struct { + _ struct{} `type:"structure"` + + // The resource policy for the resource identified by the input ARN parameter. + Policy *string `locationName:"policy" min:"1" type:"string"` } -// SetVpcConfig sets the VpcConfig field's value. -func (s *Build) SetVpcConfig(v *VpcConfig) *Build { - s.VpcConfig = v +// String returns the string representation +func (s GetResourcePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetResourcePolicyOutput) GoString() string { + return s.String() +} + +// SetPolicy sets the Policy field's value. +func (s *GetResourcePolicyOutput) SetPolicy(v string) *GetResourcePolicyOutput { + s.Policy = &v return s } -// Information about build output artifacts. -type BuildArtifacts struct { +// Information about the Git submodules configuration for an AWS CodeBuild build +// project. +type GitSubmodulesConfig struct { _ struct{} `type:"structure"` - // An identifier for this artifact definition. - ArtifactIdentifier *string `locationName:"artifactIdentifier" type:"string"` + // Set to true to fetch Git submodules for your AWS CodeBuild build project. + // + // FetchSubmodules is a required field + FetchSubmodules *bool `locationName:"fetchSubmodules" type:"boolean" required:"true"` +} - // Information that tells you if encryption for build artifacts is disabled. - EncryptionDisabled *bool `locationName:"encryptionDisabled" type:"boolean"` +// String returns the string representation +func (s GitSubmodulesConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GitSubmodulesConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GitSubmodulesConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GitSubmodulesConfig"} + if s.FetchSubmodules == nil { + invalidParams.Add(request.NewErrParamRequired("FetchSubmodules")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // Information about the location of the build artifacts. - Location *string `locationName:"location" type:"string"` +// SetFetchSubmodules sets the FetchSubmodules field's value. +func (s *GitSubmodulesConfig) SetFetchSubmodules(v bool) *GitSubmodulesConfig { + s.FetchSubmodules = &v + return s +} - // The MD5 hash of the build artifact. +type ImportSourceCredentialsInput struct { + _ struct{} `type:"structure"` + + // The type of authentication used to connect to a GitHub, GitHub Enterprise, + // or Bitbucket repository. An OAUTH connection is not supported by the API + // and must be created using the AWS CodeBuild console. // - // You can use this hash along with a checksum tool to confirm file integrity - // and authenticity. + // AuthType is a required field + AuthType *string `locationName:"authType" type:"string" required:"true" enum:"AuthType"` + + // The source provider used for this project. // - // This value is available only if the build project's packaging value is set - // to ZIP. - Md5sum *string `locationName:"md5sum" type:"string"` + // ServerType is a required field + ServerType *string `locationName:"serverType" type:"string" required:"true" enum:"ServerType"` - // If this flag is set, a name specified in the build spec file overrides the - // artifact name. The name specified in a build spec file is calculated at build - // time and uses the Shell Command Language. For example, you can append a date - // and time to your artifact name so that it is always unique. - OverrideArtifactName *bool `locationName:"overrideArtifactName" type:"boolean"` + // Set to false to prevent overwriting the repository source credentials. Set + // to true to overwrite the repository source credentials. The default value + // is true. + ShouldOverwrite *bool `locationName:"shouldOverwrite" type:"boolean"` - // The SHA-256 hash of the build artifact. - // - // You can use this hash along with a checksum tool to confirm file integrity - // and authenticity. + // For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, + // this is the app password. // - // This value is available only if the build project's packaging value is set - // to ZIP. - Sha256sum *string `locationName:"sha256sum" type:"string"` + // Token is a required field + Token *string `locationName:"token" min:"1" type:"string" required:"true" sensitive:"true"` + + // The Bitbucket username when the authType is BASIC_AUTH. This parameter is + // not valid for other types of source providers or connections. + Username *string `locationName:"username" min:"1" type:"string"` } // String returns the string representation -func (s BuildArtifacts) String() string { +func (s ImportSourceCredentialsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BuildArtifacts) GoString() string { +func (s ImportSourceCredentialsInput) GoString() string { return s.String() } -// SetArtifactIdentifier sets the ArtifactIdentifier field's value. -func (s *BuildArtifacts) SetArtifactIdentifier(v string) *BuildArtifacts { - s.ArtifactIdentifier = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ImportSourceCredentialsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ImportSourceCredentialsInput"} + if s.AuthType == nil { + invalidParams.Add(request.NewErrParamRequired("AuthType")) + } + if s.ServerType == nil { + invalidParams.Add(request.NewErrParamRequired("ServerType")) + } + if s.Token == nil { + invalidParams.Add(request.NewErrParamRequired("Token")) + } + if s.Token != nil && len(*s.Token) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Token", 1)) + } + if s.Username != nil && len(*s.Username) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Username", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetEncryptionDisabled sets the EncryptionDisabled field's value. -func (s *BuildArtifacts) SetEncryptionDisabled(v bool) *BuildArtifacts { - s.EncryptionDisabled = &v +// SetAuthType sets the AuthType field's value. +func (s *ImportSourceCredentialsInput) SetAuthType(v string) *ImportSourceCredentialsInput { + s.AuthType = &v return s } -// SetLocation sets the Location field's value. -func (s *BuildArtifacts) SetLocation(v string) *BuildArtifacts { - s.Location = &v +// SetServerType sets the ServerType field's value. +func (s *ImportSourceCredentialsInput) SetServerType(v string) *ImportSourceCredentialsInput { + s.ServerType = &v return s } -// SetMd5sum sets the Md5sum field's value. -func (s *BuildArtifacts) SetMd5sum(v string) *BuildArtifacts { - s.Md5sum = &v +// SetShouldOverwrite sets the ShouldOverwrite field's value. +func (s *ImportSourceCredentialsInput) SetShouldOverwrite(v bool) *ImportSourceCredentialsInput { + s.ShouldOverwrite = &v return s } -// SetOverrideArtifactName sets the OverrideArtifactName field's value. -func (s *BuildArtifacts) SetOverrideArtifactName(v bool) *BuildArtifacts { - s.OverrideArtifactName = &v +// SetToken sets the Token field's value. +func (s *ImportSourceCredentialsInput) SetToken(v string) *ImportSourceCredentialsInput { + s.Token = &v return s } -// SetSha256sum sets the Sha256sum field's value. -func (s *BuildArtifacts) SetSha256sum(v string) *BuildArtifacts { - s.Sha256sum = &v +// SetUsername sets the Username field's value. +func (s *ImportSourceCredentialsInput) SetUsername(v string) *ImportSourceCredentialsInput { + s.Username = &v return s } -// Information about a build that could not be successfully deleted. -type BuildNotDeleted struct { +type ImportSourceCredentialsOutput struct { _ struct{} `type:"structure"` - // The ID of the build that could not be successfully deleted. - Id *string `locationName:"id" min:"1" type:"string"` - - // Additional information about the build that could not be successfully deleted. - StatusCode *string `locationName:"statusCode" type:"string"` + // The Amazon Resource Name (ARN) of the token. + Arn *string `locationName:"arn" min:"1" type:"string"` } // String returns the string representation -func (s BuildNotDeleted) String() string { +func (s ImportSourceCredentialsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BuildNotDeleted) GoString() string { +func (s ImportSourceCredentialsOutput) GoString() string { return s.String() } -// SetId sets the Id field's value. -func (s *BuildNotDeleted) SetId(v string) *BuildNotDeleted { - s.Id = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *BuildNotDeleted) SetStatusCode(v string) *BuildNotDeleted { - s.StatusCode = &v +// SetArn sets the Arn field's value. +func (s *ImportSourceCredentialsOutput) SetArn(v string) *ImportSourceCredentialsOutput { + s.Arn = &v return s } -// Information about a stage for a build. -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"` - - // 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. - // - // * QUEUED: The build has been submitted and is queued behind other submitted - // builds. - // - // * 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. - // - // * QUEUED: The build has been submitted and is queued behind other submitted - // builds. - // - // * 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"` +// The input value that was provided is not valid. +type InvalidInputException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // When the build phase started, expressed in Unix time format. - StartTime *time.Time `locationName:"startTime" type:"timestamp"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s BuildPhase) String() string { +func (s InvalidInputException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BuildPhase) GoString() string { +func (s InvalidInputException) GoString() string { return s.String() } -// SetContexts sets the Contexts field's value. -func (s *BuildPhase) SetContexts(v []*PhaseContext) *BuildPhase { - s.Contexts = v - return s +func newErrorInvalidInputException(v protocol.ResponseMetadata) error { + return &InvalidInputException{ + respMetadata: v, + } } -// SetDurationInSeconds sets the DurationInSeconds field's value. -func (s *BuildPhase) SetDurationInSeconds(v int64) *BuildPhase { - s.DurationInSeconds = &v - return s +// Code returns the exception type name. +func (s InvalidInputException) Code() string { + return "InvalidInputException" } -// SetEndTime sets the EndTime field's value. -func (s *BuildPhase) SetEndTime(v time.Time) *BuildPhase { - s.EndTime = &v - return s +// Message returns the exception's message. +func (s InvalidInputException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetPhaseStatus sets the PhaseStatus field's value. -func (s *BuildPhase) SetPhaseStatus(v string) *BuildPhase { - s.PhaseStatus = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInputException) OrigErr() error { + return nil } -// SetPhaseType sets the PhaseType field's value. -func (s *BuildPhase) SetPhaseType(v string) *BuildPhase { - s.PhaseType = &v - return s +func (s InvalidInputException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetStartTime sets the StartTime field's value. -func (s *BuildPhase) SetStartTime(v time.Time) *BuildPhase { - s.StartTime = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInputException) StatusCode() int { + return s.respMetadata.StatusCode } -// Information about Amazon CloudWatch Logs for a build project. -type CloudWatchLogsConfig struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidInputException) RequestID() string { + return s.respMetadata.RequestID +} - // The group name of the logs in Amazon CloudWatch Logs. For more information, - // see Working with Log Groups and Log Streams (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html). - GroupName *string `locationName:"groupName" type:"string"` +type InvalidateProjectCacheInput struct { + _ struct{} `type:"structure"` - // The current status of the logs in Amazon CloudWatch Logs for a build project. - // Valid values are: - // - // * ENABLED: Amazon CloudWatch Logs are enabled for this build project. - // - // * DISABLED: Amazon CloudWatch Logs are not enabled for this build project. + // The name of the AWS CodeBuild build project that the cache is reset for. // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"LogsConfigStatusType"` - - // The prefix of the stream name of the Amazon CloudWatch Logs. For more information, - // see Working with Log Groups and Log Streams (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html). - StreamName *string `locationName:"streamName" type:"string"` + // ProjectName is a required field + ProjectName *string `locationName:"projectName" min:"1" type:"string" required:"true"` } // String returns the string representation -func (s CloudWatchLogsConfig) String() string { +func (s InvalidateProjectCacheInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CloudWatchLogsConfig) GoString() string { +func (s InvalidateProjectCacheInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CloudWatchLogsConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CloudWatchLogsConfig"} - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) +func (s *InvalidateProjectCacheInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InvalidateProjectCacheInput"} + 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 { @@ -2386,247 +5422,68 @@ func (s *CloudWatchLogsConfig) Validate() error { return nil } -// SetGroupName sets the GroupName field's value. -func (s *CloudWatchLogsConfig) SetGroupName(v string) *CloudWatchLogsConfig { - s.GroupName = &v +// SetProjectName sets the ProjectName field's value. +func (s *InvalidateProjectCacheInput) SetProjectName(v string) *InvalidateProjectCacheInput { + s.ProjectName = &v return s } -// SetStatus sets the Status field's value. -func (s *CloudWatchLogsConfig) SetStatus(v string) *CloudWatchLogsConfig { - s.Status = &v - return s +type InvalidateProjectCacheOutput struct { + _ struct{} `type:"structure"` } -// SetStreamName sets the StreamName field's value. -func (s *CloudWatchLogsConfig) SetStreamName(v string) *CloudWatchLogsConfig { - s.StreamName = &v - return s +// String returns the string representation +func (s InvalidateProjectCacheOutput) String() string { + return awsutil.Prettify(s) } -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"` - - // Set this to true to generate a publicly accessible URL for your project's - // build badge. - BadgeEnabled *bool `locationName:"badgeEnabled" type:"boolean"` - - // Stores recently used information so that it can be quickly accessed at a - // later time. - Cache *ProjectCache `locationName:"cache" type:"structure"` - - // 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 use a cross-account KMS key to encrypt the build output artifacts - // if your service role has permission to that key. - // - // You can specify either the Amazon Resource Name (ARN) of the CMK 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"` - - // Information about logs for the build project. These can be logs in Amazon - // CloudWatch Logs, logs uploaded to a specified S3 bucket, or both. - LogsConfig *LogsConfig `locationName:"logsConfig" type:"structure"` - - // The name of the build project. - // - // Name is a required field - Name *string `locationName:"name" min:"2" type:"string" required:"true"` - - // The number of minutes a build is allowed to be queued before it times out. - QueuedTimeoutInMinutes *int64 `locationName:"queuedTimeoutInMinutes" min:"5" type:"integer"` - - // An array of ProjectArtifacts objects. - SecondaryArtifacts []*ProjectArtifacts `locationName:"secondaryArtifacts" type:"list"` - - // An array of ProjectSourceVersion objects. If secondarySourceVersions is specified - // at the build level, then they take precedence over these secondarySourceVersions - // (at the project level). - SecondarySourceVersions []*ProjectSourceVersion `locationName:"secondarySourceVersions" type:"list"` +// GoString returns the string representation +func (s InvalidateProjectCacheOutput) GoString() string { + return s.String() +} - // An array of ProjectSource objects. - SecondarySources []*ProjectSource `locationName:"secondarySources" type:"list"` +type ListBuildsForProjectInput struct { + _ struct{} `type:"structure"` - // 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 is a required field - ServiceRole *string `locationName:"serviceRole" min:"1" type:"string" required:"true"` + // 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 nextToken. + // 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"` - // Information about the build input source code for the build project. + // The name of the AWS CodeBuild project. // - // Source is a required field - Source *ProjectSource `locationName:"source" type:"structure" required:"true"` + // 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 project. If not specified, - // the latest version is used. If specified, it must be one of: - // - // * For AWS CodeCommit: the commit ID to use. - // - // * For GitHub: the commit ID, pull request ID, branch name, or tag name - // that corresponds to the version of the source code you want to build. - // If a pull request ID is specified, it must use the format pr/pull-request-ID - // (for example pr/25). If a branch name is specified, the branch's HEAD - // commit ID is used. If not specified, the default branch's HEAD commit - // ID is used. - // - // * For Bitbucket: the commit ID, branch name, or tag name that corresponds - // to the version of the source code you want to build. If a branch name - // is specified, the branch's HEAD commit ID is used. If not specified, the - // default branch's HEAD commit ID is used. - // - // * For Amazon Simple Storage Service (Amazon S3): the version ID of the - // object that represents the build input ZIP file to use. - // - // If sourceVersion is specified at the build level, then that version takes - // precedence over this sourceVersion (at the project level). + // The order to list build IDs. Valid values include: // - // For more information, see Source Version Sample with CodeBuild (https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html) - // in the AWS CodeBuild User Guide. - SourceVersion *string `locationName:"sourceVersion" type:"string"` - - // A set of tags for this build project. + // * ASCENDING: List the build IDs in ascending order by build ID. // - // 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 it times out any build that has not been marked as completed. The - // default is 60 minutes. - TimeoutInMinutes *int64 `locationName:"timeoutInMinutes" min:"5" type:"integer"` - - // VpcConfig enables AWS CodeBuild to access resources in an Amazon VPC. - VpcConfig *VpcConfig `locationName:"vpcConfig" type:"structure"` + // * 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 CreateProjectInput) String() string { +func (s ListBuildsForProjectInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateProjectInput) GoString() string { +func (s ListBuildsForProjectInput) 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.QueuedTimeoutInMinutes != nil && *s.QueuedTimeoutInMinutes < 5 { - invalidParams.Add(request.NewErrParamMinValue("QueuedTimeoutInMinutes", 5)) - } - if s.ServiceRole == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceRole")) - } - 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 < 5 { - invalidParams.Add(request.NewErrParamMinValue("TimeoutInMinutes", 5)) - } - if s.Artifacts != nil { - if err := s.Artifacts.Validate(); err != nil { - invalidParams.AddNested("Artifacts", err.(request.ErrInvalidParams)) - } - } - if s.Cache != nil { - if err := s.Cache.Validate(); err != nil { - invalidParams.AddNested("Cache", err.(request.ErrInvalidParams)) - } - } - if s.Environment != nil { - if err := s.Environment.Validate(); err != nil { - invalidParams.AddNested("Environment", err.(request.ErrInvalidParams)) - } - } - if s.LogsConfig != nil { - if err := s.LogsConfig.Validate(); err != nil { - invalidParams.AddNested("LogsConfig", err.(request.ErrInvalidParams)) - } - } - if s.SecondaryArtifacts != nil { - for i, v := range s.SecondaryArtifacts { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SecondaryArtifacts", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SecondarySourceVersions != nil { - for i, v := range s.SecondarySourceVersions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SecondarySourceVersions", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SecondarySources != nil { - for i, v := range s.SecondarySources { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SecondarySources", i), 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)) - } - } +func (s *ListBuildsForProjectInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListBuildsForProjectInput"} + if s.ProjectName == nil { + invalidParams.Add(request.NewErrParamRequired("ProjectName")) } - if s.VpcConfig != nil { - if err := s.VpcConfig.Validate(); err != nil { - invalidParams.AddNested("VpcConfig", err.(request.ErrInvalidParams)) - } + if s.ProjectName != nil && len(*s.ProjectName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ProjectName", 1)) } if invalidParams.Len() > 0 { @@ -2635,180 +5492,223 @@ func (s *CreateProjectInput) Validate() error { return nil } -// SetArtifacts sets the Artifacts field's value. -func (s *CreateProjectInput) SetArtifacts(v *ProjectArtifacts) *CreateProjectInput { - s.Artifacts = v +// 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 } -// SetBadgeEnabled sets the BadgeEnabled field's value. -func (s *CreateProjectInput) SetBadgeEnabled(v bool) *CreateProjectInput { - s.BadgeEnabled = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListBuildsForProjectInput) SetSortOrder(v string) *ListBuildsForProjectInput { + s.SortOrder = &v return s } -// SetCache sets the Cache field's value. -func (s *CreateProjectInput) SetCache(v *ProjectCache) *CreateProjectInput { - s.Cache = v - return s +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 nextToken. 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"` } -// SetDescription sets the Description field's value. -func (s *CreateProjectInput) SetDescription(v string) *CreateProjectInput { - s.Description = &v - return s +// String returns the string representation +func (s ListBuildsForProjectOutput) String() string { + return awsutil.Prettify(s) } -// SetEncryptionKey sets the EncryptionKey field's value. -func (s *CreateProjectInput) SetEncryptionKey(v string) *CreateProjectInput { - s.EncryptionKey = &v - return s +// GoString returns the string representation +func (s ListBuildsForProjectOutput) GoString() string { + return s.String() } -// SetEnvironment sets the Environment field's value. -func (s *CreateProjectInput) SetEnvironment(v *ProjectEnvironment) *CreateProjectInput { - s.Environment = v +// SetIds sets the Ids field's value. +func (s *ListBuildsForProjectOutput) SetIds(v []*string) *ListBuildsForProjectOutput { + s.Ids = v return s } -// SetLogsConfig sets the LogsConfig field's value. -func (s *CreateProjectInput) SetLogsConfig(v *LogsConfig) *CreateProjectInput { - s.LogsConfig = v +// SetNextToken sets the NextToken field's value. +func (s *ListBuildsForProjectOutput) SetNextToken(v string) *ListBuildsForProjectOutput { + s.NextToken = &v return s } -// SetName sets the Name field's value. -func (s *CreateProjectInput) SetName(v string) *CreateProjectInput { - s.Name = &v - return s +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 nextToken. + // 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"` } -// SetQueuedTimeoutInMinutes sets the QueuedTimeoutInMinutes field's value. -func (s *CreateProjectInput) SetQueuedTimeoutInMinutes(v int64) *CreateProjectInput { - s.QueuedTimeoutInMinutes = &v - return s +// String returns the string representation +func (s ListBuildsInput) String() string { + return awsutil.Prettify(s) } -// SetSecondaryArtifacts sets the SecondaryArtifacts field's value. -func (s *CreateProjectInput) SetSecondaryArtifacts(v []*ProjectArtifacts) *CreateProjectInput { - s.SecondaryArtifacts = v - return s +// GoString returns the string representation +func (s ListBuildsInput) GoString() string { + return s.String() } -// SetSecondarySourceVersions sets the SecondarySourceVersions field's value. -func (s *CreateProjectInput) SetSecondarySourceVersions(v []*ProjectSourceVersion) *CreateProjectInput { - s.SecondarySourceVersions = v +// SetNextToken sets the NextToken field's value. +func (s *ListBuildsInput) SetNextToken(v string) *ListBuildsInput { + s.NextToken = &v return s } -// SetSecondarySources sets the SecondarySources field's value. -func (s *CreateProjectInput) SetSecondarySources(v []*ProjectSource) *CreateProjectInput { - s.SecondarySources = v +// SetSortOrder sets the SortOrder field's value. +func (s *ListBuildsInput) SetSortOrder(v string) *ListBuildsInput { + s.SortOrder = &v return s } -// SetServiceRole sets the ServiceRole field's value. -func (s *CreateProjectInput) SetServiceRole(v string) *CreateProjectInput { - s.ServiceRole = &v - return s +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 nextToken. 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"` } -// SetSource sets the Source field's value. -func (s *CreateProjectInput) SetSource(v *ProjectSource) *CreateProjectInput { - s.Source = v - return s +// String returns the string representation +func (s ListBuildsOutput) String() string { + return awsutil.Prettify(s) } -// SetSourceVersion sets the SourceVersion field's value. -func (s *CreateProjectInput) SetSourceVersion(v string) *CreateProjectInput { - s.SourceVersion = &v - return s +// GoString returns the string representation +func (s ListBuildsOutput) GoString() string { + return s.String() } -// SetTags sets the Tags field's value. -func (s *CreateProjectInput) SetTags(v []*Tag) *CreateProjectInput { - s.Tags = v +// SetIds sets the Ids field's value. +func (s *ListBuildsOutput) SetIds(v []*string) *ListBuildsOutput { + s.Ids = v return s } -// SetTimeoutInMinutes sets the TimeoutInMinutes field's value. -func (s *CreateProjectInput) SetTimeoutInMinutes(v int64) *CreateProjectInput { - s.TimeoutInMinutes = &v +// SetNextToken sets the NextToken field's value. +func (s *ListBuildsOutput) SetNextToken(v string) *ListBuildsOutput { + s.NextToken = &v return s } -// SetVpcConfig sets the VpcConfig field's value. -func (s *CreateProjectInput) SetVpcConfig(v *VpcConfig) *CreateProjectInput { - s.VpcConfig = v - return s +type ListCuratedEnvironmentImagesInput struct { + _ struct{} `type:"structure"` } -type CreateProjectOutput struct { +// 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() +} + +type ListCuratedEnvironmentImagesOutput struct { _ struct{} `type:"structure"` - // Information about the build project that was created. - Project *Project `locationName:"project" 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 CreateProjectOutput) String() string { +func (s ListCuratedEnvironmentImagesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateProjectOutput) GoString() string { +func (s ListCuratedEnvironmentImagesOutput) GoString() string { return s.String() } -// SetProject sets the Project field's value. -func (s *CreateProjectOutput) SetProject(v *Project) *CreateProjectOutput { - s.Project = v +// SetPlatforms sets the Platforms field's value. +func (s *ListCuratedEnvironmentImagesOutput) SetPlatforms(v []*EnvironmentPlatform) *ListCuratedEnvironmentImagesOutput { + s.Platforms = v return s } -type CreateWebhookInput struct { +type ListProjectsInput struct { _ struct{} `type:"structure"` - // A regular expression used to determine which repository branches are built - // when a webhook is triggered. If the name of a branch matches the regular - // expression, then it is built. If branchFilter is empty, then all branches - // are built. - // - // It is recommended that you use filterGroups instead of branchFilter. - BranchFilter *string `locationName:"branchFilter" type:"string"` + // 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 nextToken. + // 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"` - // An array of arrays of WebhookFilter objects used to determine which webhooks - // are triggered. At least one WebhookFilter in the array must specify EVENT - // as its type. + // The criterion to be used to list build project names. Valid values include: // - // For a build to be triggered, at least one filter group in the filterGroups - // array must pass. For a filter group to pass, each of its filters must pass. - FilterGroups [][]*WebhookFilter `locationName:"filterGroups" type:"list"` + // * CREATED_TIME: List based on when each build project was created. + // + // * LAST_MODIFIED_TIME: List based on when information about each build + // project was last changed. + // + // * NAME: List 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 name of the AWS CodeBuild project. + // The order in which to list build projects. Valid values include: // - // ProjectName is a required field - ProjectName *string `locationName:"projectName" min:"2" type:"string" required:"true"` + // * ASCENDING: List in ascending order. + // + // * DESCENDING: List 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 CreateWebhookInput) String() string { +func (s ListProjectsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateWebhookInput) GoString() string { +func (s ListProjectsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateWebhookInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateWebhookInput"} - if s.ProjectName == nil { - invalidParams.Add(request.NewErrParamRequired("ProjectName")) - } - if s.ProjectName != nil && len(*s.ProjectName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ProjectName", 2)) +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 { @@ -2817,75 +5717,106 @@ func (s *CreateWebhookInput) Validate() error { return nil } -// SetBranchFilter sets the BranchFilter field's value. -func (s *CreateWebhookInput) SetBranchFilter(v string) *CreateWebhookInput { - s.BranchFilter = &v +// SetNextToken sets the NextToken field's value. +func (s *ListProjectsInput) SetNextToken(v string) *ListProjectsInput { + s.NextToken = &v return s } -// SetFilterGroups sets the FilterGroups field's value. -func (s *CreateWebhookInput) SetFilterGroups(v [][]*WebhookFilter) *CreateWebhookInput { - s.FilterGroups = v +// SetSortBy sets the SortBy field's value. +func (s *ListProjectsInput) SetSortBy(v string) *ListProjectsInput { + s.SortBy = &v return s } -// SetProjectName sets the ProjectName field's value. -func (s *CreateWebhookInput) SetProjectName(v string) *CreateWebhookInput { - s.ProjectName = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListProjectsInput) SetSortOrder(v string) *ListProjectsInput { + s.SortOrder = &v return s } -type CreateWebhookOutput struct { +type ListProjectsOutput struct { _ struct{} `type:"structure"` - // Information about a webhook that connects repository events to a build project - // in AWS CodeBuild. - Webhook *Webhook `locationName:"webhook" 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 nextToken. 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 CreateWebhookOutput) String() string { +func (s ListProjectsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateWebhookOutput) GoString() string { +func (s ListProjectsOutput) GoString() string { return s.String() } -// SetWebhook sets the Webhook field's value. -func (s *CreateWebhookOutput) SetWebhook(v *Webhook) *CreateWebhookOutput { - s.Webhook = v +// SetNextToken sets the NextToken field's value. +func (s *ListProjectsOutput) SetNextToken(v string) *ListProjectsOutput { + s.NextToken = &v return s } -type DeleteProjectInput struct { +// SetProjects sets the Projects field's value. +func (s *ListProjectsOutput) SetProjects(v []*string) *ListProjectsOutput { + s.Projects = v + return s +} + +type ListReportGroupsInput struct { _ struct{} `type:"structure"` - // The name of the build project. + // The maximum number of paginated report groups returned per response. Use + // nextToken to iterate pages in the list of returned ReportGroup objects. The + // default value is 100. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // During a previous call, the maximum number of items that can be returned + // is the value specified in maxResults. If there more items in the list, then + // a unique string called a nextToken is returned. 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 criterion to be used to list build report groups. Valid values include: // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` + // * CREATED_TIME: List based on when each report group was created. + // + // * LAST_MODIFIED_TIME: List based on when each report group was last changed. + // + // * NAME: List based on each report group's name. + SortBy *string `locationName:"sortBy" type:"string" enum:"ReportGroupSortByType"` + + // Used to specify the order to sort the list of returned report groups. Valid + // values are ASCENDING and DESCENDING. + SortOrder *string `locationName:"sortOrder" type:"string" enum:"SortOrderType"` } // String returns the string representation -func (s DeleteProjectInput) String() string { +func (s ListReportGroupsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteProjectInput) GoString() string { +func (s ListReportGroupsInput) 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)) +func (s *ListReportGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListReportGroupsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -2894,53 +5825,116 @@ func (s *DeleteProjectInput) Validate() error { return nil } -// SetName sets the Name field's value. -func (s *DeleteProjectInput) SetName(v string) *DeleteProjectInput { - s.Name = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListReportGroupsInput) SetMaxResults(v int64) *ListReportGroupsInput { + s.MaxResults = &v return s } -type DeleteProjectOutput struct { +// SetNextToken sets the NextToken field's value. +func (s *ListReportGroupsInput) SetNextToken(v string) *ListReportGroupsInput { + s.NextToken = &v + return s +} + +// SetSortBy sets the SortBy field's value. +func (s *ListReportGroupsInput) SetSortBy(v string) *ListReportGroupsInput { + s.SortBy = &v + return s +} + +// SetSortOrder sets the SortOrder field's value. +func (s *ListReportGroupsInput) SetSortOrder(v string) *ListReportGroupsInput { + s.SortOrder = &v + return s +} + +type ListReportGroupsOutput struct { _ struct{} `type:"structure"` + + // During a previous call, the maximum number of items that can be returned + // is the value specified in maxResults. If there more items in the list, then + // a unique string called a nextToken is returned. 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 list of ARNs for the report groups in the current AWS account. + ReportGroups []*string `locationName:"reportGroups" min:"1" type:"list"` } // String returns the string representation -func (s DeleteProjectOutput) String() string { +func (s ListReportGroupsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteProjectOutput) GoString() string { +func (s ListReportGroupsOutput) GoString() string { return s.String() } -type DeleteSourceCredentialsInput struct { +// SetNextToken sets the NextToken field's value. +func (s *ListReportGroupsOutput) SetNextToken(v string) *ListReportGroupsOutput { + s.NextToken = &v + return s +} + +// SetReportGroups sets the ReportGroups field's value. +func (s *ListReportGroupsOutput) SetReportGroups(v []*string) *ListReportGroupsOutput { + s.ReportGroups = v + return s +} + +type ListReportsForReportGroupInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the token. + // A ReportFilter object used to filter the returned reports. + Filter *ReportFilter `locationName:"filter" type:"structure"` + + // The maximum number of paginated reports in this report group returned per + // response. Use nextToken to iterate pages in the list of returned Report objects. + // The default value is 100. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // During a previous call, the maximum number of items that can be returned + // is the value specified in maxResults. If there more items in the list, then + // a unique string called a nextToken is returned. 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 ARN of the report group for which you want to return report ARNs. // - // Arn is a required field - Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` + // ReportGroupArn is a required field + ReportGroupArn *string `locationName:"reportGroupArn" type:"string" required:"true"` + + // Use to specify whether the results are returned in ascending or descending + // order. + SortOrder *string `locationName:"sortOrder" type:"string" enum:"SortOrderType"` } // String returns the string representation -func (s DeleteSourceCredentialsInput) String() string { +func (s ListReportsForReportGroupInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSourceCredentialsInput) GoString() string { +func (s ListReportsForReportGroupInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSourceCredentialsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSourceCredentialsInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) +func (s *ListReportsForReportGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListReportsForReportGroupInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } - if s.Arn != nil && len(*s.Arn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) + if s.ReportGroupArn == nil { + invalidParams.Add(request.NewErrParamRequired("ReportGroupArn")) } if invalidParams.Len() > 0 { @@ -2949,62 +5943,119 @@ func (s *DeleteSourceCredentialsInput) Validate() error { return nil } -// SetArn sets the Arn field's value. -func (s *DeleteSourceCredentialsInput) SetArn(v string) *DeleteSourceCredentialsInput { - s.Arn = &v +// SetFilter sets the Filter field's value. +func (s *ListReportsForReportGroupInput) SetFilter(v *ReportFilter) *ListReportsForReportGroupInput { + s.Filter = v return s } -type DeleteSourceCredentialsOutput struct { +// SetMaxResults sets the MaxResults field's value. +func (s *ListReportsForReportGroupInput) SetMaxResults(v int64) *ListReportsForReportGroupInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListReportsForReportGroupInput) SetNextToken(v string) *ListReportsForReportGroupInput { + s.NextToken = &v + return s +} + +// SetReportGroupArn sets the ReportGroupArn field's value. +func (s *ListReportsForReportGroupInput) SetReportGroupArn(v string) *ListReportsForReportGroupInput { + s.ReportGroupArn = &v + return s +} + +// SetSortOrder sets the SortOrder field's value. +func (s *ListReportsForReportGroupInput) SetSortOrder(v string) *ListReportsForReportGroupInput { + s.SortOrder = &v + return s +} + +type ListReportsForReportGroupOutput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the token. - Arn *string `locationName:"arn" min:"1" type:"string"` + // During a previous call, the maximum number of items that can be returned + // is the value specified in maxResults. If there more items in the list, then + // a unique string called a nextToken is returned. 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 list of returned report group ARNs. + Reports []*string `locationName:"reports" min:"1" type:"list"` } // String returns the string representation -func (s DeleteSourceCredentialsOutput) String() string { +func (s ListReportsForReportGroupOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSourceCredentialsOutput) GoString() string { +func (s ListReportsForReportGroupOutput) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *DeleteSourceCredentialsOutput) SetArn(v string) *DeleteSourceCredentialsOutput { - s.Arn = &v +// SetNextToken sets the NextToken field's value. +func (s *ListReportsForReportGroupOutput) SetNextToken(v string) *ListReportsForReportGroupOutput { + s.NextToken = &v return s } -type DeleteWebhookInput struct { +// SetReports sets the Reports field's value. +func (s *ListReportsForReportGroupOutput) SetReports(v []*string) *ListReportsForReportGroupOutput { + s.Reports = v + return s +} + +type ListReportsInput struct { _ struct{} `type:"structure"` - // The name of the AWS CodeBuild project. + // A ReportFilter object used to filter the returned reports. + Filter *ReportFilter `locationName:"filter" type:"structure"` + + // The maximum number of paginated reports returned per response. Use nextToken + // to iterate pages in the list of returned Report objects. The default value + // is 100. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // During a previous call, the maximum number of items that can be returned + // is the value specified in maxResults. If there more items in the list, then + // a unique string called a nextToken is returned. 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"` + + // Specifies the sort order for the list of returned reports. Valid values are: // - // ProjectName is a required field - ProjectName *string `locationName:"projectName" min:"2" type:"string" required:"true"` + // * ASCENDING: return reports in chronological order based on their creation + // date. + // + // * DESCENDING: return reports in the reverse chronological order based + // on their creation date. + SortOrder *string `locationName:"sortOrder" type:"string" enum:"SortOrderType"` } // String returns the string representation -func (s DeleteWebhookInput) String() string { +func (s ListReportsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteWebhookInput) GoString() string { +func (s ListReportsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteWebhookInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteWebhookInput"} - if s.ProjectName == nil { - invalidParams.Add(request.NewErrParamRequired("ProjectName")) - } - if s.ProjectName != nil && len(*s.ProjectName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("ProjectName", 2)) +func (s *ListReportsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListReportsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -3013,185 +6064,240 @@ func (s *DeleteWebhookInput) Validate() error { return nil } -// SetProjectName sets the ProjectName field's value. -func (s *DeleteWebhookInput) SetProjectName(v string) *DeleteWebhookInput { - s.ProjectName = &v +// SetFilter sets the Filter field's value. +func (s *ListReportsInput) SetFilter(v *ReportFilter) *ListReportsInput { + s.Filter = v return s } -type DeleteWebhookOutput struct { - _ struct{} `type:"structure"` +// SetMaxResults sets the MaxResults field's value. +func (s *ListReportsInput) SetMaxResults(v int64) *ListReportsInput { + s.MaxResults = &v + return s } -// String returns the string representation -func (s DeleteWebhookOutput) String() string { - return awsutil.Prettify(s) +// SetNextToken sets the NextToken field's value. +func (s *ListReportsInput) SetNextToken(v string) *ListReportsInput { + s.NextToken = &v + return s } -// GoString returns the string representation -func (s DeleteWebhookOutput) GoString() string { - return s.String() +// SetSortOrder sets the SortOrder field's value. +func (s *ListReportsInput) SetSortOrder(v string) *ListReportsInput { + s.SortOrder = &v + return s } -// Information about a Docker image that is managed by AWS CodeBuild. -type EnvironmentImage struct { +type ListReportsOutput 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"` + // During a previous call, the maximum number of items that can be returned + // is the value specified in maxResults. If there more items in the list, then + // a unique string called a nextToken is returned. 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"` - // A list of environment image versions. - Versions []*string `locationName:"versions" type:"list"` + // The list of returned ARNs for the reports in the current AWS account. + Reports []*string `locationName:"reports" min:"1" type:"list"` } // String returns the string representation -func (s EnvironmentImage) String() string { +func (s ListReportsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EnvironmentImage) GoString() string { +func (s ListReportsOutput) 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 +// SetNextToken sets the NextToken field's value. +func (s *ListReportsOutput) SetNextToken(v string) *ListReportsOutput { + s.NextToken = &v return s } -// SetVersions sets the Versions field's value. -func (s *EnvironmentImage) SetVersions(v []*string) *EnvironmentImage { - s.Versions = v +// SetReports sets the Reports field's value. +func (s *ListReportsOutput) SetReports(v []*string) *ListReportsOutput { + s.Reports = v return s } -// A set of Docker images that are related by programming language and are managed -// by AWS CodeBuild. -type EnvironmentLanguage struct { +type ListSharedProjectsInput struct { _ struct{} `type:"structure"` - // The list of Docker images that are related by the specified programming language. - Images []*EnvironmentImage `locationName:"images" type:"list"` + // The maximum number of paginated shared build projects returned per response. + // Use nextToken to iterate pages in the list of returned Project objects. The + // default value is 100. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // During a previous call, the maximum number of items that can be returned + // is the value specified in maxResults. If there more items in the list, then + // a unique string called a nextToken is returned. 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 programming language for the Docker images. - Language *string `locationName:"language" type:"string" enum:"LanguageType"` + // The criterion to be used to list build projects shared with the current AWS + // account or user. Valid values include: + // + // * ARN: List based on the ARN. + // + // * MODIFIED_TIME: List based on when information about the shared project + // was last changed. + SortBy *string `locationName:"sortBy" type:"string" enum:"SharedResourceSortByType"` + + // The order in which to list shared build projects. Valid values include: + // + // * ASCENDING: List in ascending order. + // + // * DESCENDING: List in descending order. + SortOrder *string `locationName:"sortOrder" type:"string" enum:"SortOrderType"` } // String returns the string representation -func (s EnvironmentLanguage) String() string { +func (s ListSharedProjectsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EnvironmentLanguage) GoString() string { +func (s ListSharedProjectsInput) GoString() string { return s.String() } -// SetImages sets the Images field's value. -func (s *EnvironmentLanguage) SetImages(v []*EnvironmentImage) *EnvironmentLanguage { - s.Images = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListSharedProjectsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListSharedProjectsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + 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 *ListSharedProjectsInput) SetMaxResults(v int64) *ListSharedProjectsInput { + s.MaxResults = &v return s } -// SetLanguage sets the Language field's value. -func (s *EnvironmentLanguage) SetLanguage(v string) *EnvironmentLanguage { - s.Language = &v +// SetNextToken sets the NextToken field's value. +func (s *ListSharedProjectsInput) SetNextToken(v string) *ListSharedProjectsInput { + s.NextToken = &v return s } -// A set of Docker images that are related by platform and are managed by AWS -// CodeBuild. -type EnvironmentPlatform struct { +// SetSortBy sets the SortBy field's value. +func (s *ListSharedProjectsInput) SetSortBy(v string) *ListSharedProjectsInput { + s.SortBy = &v + return s +} + +// SetSortOrder sets the SortOrder field's value. +func (s *ListSharedProjectsInput) SetSortOrder(v string) *ListSharedProjectsInput { + s.SortOrder = &v + return s +} + +type ListSharedProjectsOutput struct { _ struct{} `type:"structure"` - // The list of programming languages that are available for the specified platform. - Languages []*EnvironmentLanguage `locationName:"languages" type:"list"` + // During a previous call, the maximum number of items that can be returned + // is the value specified in maxResults. If there more items in the list, then + // a unique string called a nextToken is returned. 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 platform's name. - Platform *string `locationName:"platform" type:"string" enum:"PlatformType"` + // The list of ARNs for the build projects shared with the current AWS account + // or user. + Projects []*string `locationName:"projects" min:"1" type:"list"` } // String returns the string representation -func (s EnvironmentPlatform) String() string { +func (s ListSharedProjectsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EnvironmentPlatform) GoString() string { +func (s ListSharedProjectsOutput) GoString() string { return s.String() } -// SetLanguages sets the Languages field's value. -func (s *EnvironmentPlatform) SetLanguages(v []*EnvironmentLanguage) *EnvironmentPlatform { - s.Languages = v +// SetNextToken sets the NextToken field's value. +func (s *ListSharedProjectsOutput) SetNextToken(v string) *ListSharedProjectsOutput { + s.NextToken = &v return s } -// SetPlatform sets the Platform field's value. -func (s *EnvironmentPlatform) SetPlatform(v string) *EnvironmentPlatform { - s.Platform = &v +// SetProjects sets the Projects field's value. +func (s *ListSharedProjectsOutput) SetProjects(v []*string) *ListSharedProjectsOutput { + s.Projects = v return s } -// Information about an environment variable for a build project or a build. -type EnvironmentVariable struct { +type ListSharedReportGroupsInput 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 maximum number of paginated shared report groups per response. Use nextToken + // to iterate pages in the list of returned ReportGroup objects. The default + // value is 100. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // During a previous call, the maximum number of items that can be returned + // is the value specified in maxResults. If there more items in the list, then + // a unique string called a nextToken is returned. 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 type of environment variable. Valid values include: + // The criterion to be used to list report groups shared with the current AWS + // account or user. Valid values include: // - // * PARAMETER_STORE: An environment variable stored in Amazon EC2 Systems - // Manager Parameter Store. + // * ARN: List based on the ARN. // - // * PLAINTEXT: An environment variable in plaintext format. - Type *string `locationName:"type" type:"string" enum:"EnvironmentVariableType"` + // * MODIFIED_TIME: List based on when information about the shared report + // group was last changed. + SortBy *string `locationName:"sortBy" type:"string" enum:"SharedResourceSortByType"` - // The value of the environment variable. + // The order in which to list shared report groups. Valid values include: // - // We strongly discourage the use of environment variables to store sensitive - // values, especially AWS secret key IDs and secret access keys. Environment - // variables can be displayed in plain text using the AWS CodeBuild console - // and the AWS Command Line Interface (AWS CLI). + // * ASCENDING: List in ascending order. // - // Value is a required field - Value *string `locationName:"value" type:"string" required:"true"` + // * DESCENDING: List in descending order. + SortOrder *string `locationName:"sortOrder" type:"string" enum:"SortOrderType"` } // String returns the string representation -func (s EnvironmentVariable) String() string { +func (s ListSharedReportGroupsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EnvironmentVariable) GoString() string { +func (s ListSharedReportGroupsInput) 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")) +func (s *ListSharedReportGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListSharedReportGroupsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -3200,122 +6306,144 @@ func (s *EnvironmentVariable) Validate() error { return nil } -// SetName sets the Name field's value. -func (s *EnvironmentVariable) SetName(v string) *EnvironmentVariable { - s.Name = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListSharedReportGroupsInput) SetMaxResults(v int64) *ListSharedReportGroupsInput { + s.MaxResults = &v return s } -// SetType sets the Type field's value. -func (s *EnvironmentVariable) SetType(v string) *EnvironmentVariable { - s.Type = &v +// SetNextToken sets the NextToken field's value. +func (s *ListSharedReportGroupsInput) SetNextToken(v string) *ListSharedReportGroupsInput { + s.NextToken = &v return s } -// SetValue sets the Value field's value. -func (s *EnvironmentVariable) SetValue(v string) *EnvironmentVariable { - s.Value = &v +// SetSortBy sets the SortBy field's value. +func (s *ListSharedReportGroupsInput) SetSortBy(v string) *ListSharedReportGroupsInput { + s.SortBy = &v return s } -// Information about the Git submodules configuration for an AWS CodeBuild build -// project. -type GitSubmodulesConfig struct { +// SetSortOrder sets the SortOrder field's value. +func (s *ListSharedReportGroupsInput) SetSortOrder(v string) *ListSharedReportGroupsInput { + s.SortOrder = &v + return s +} + +type ListSharedReportGroupsOutput struct { _ struct{} `type:"structure"` - // Set to true to fetch Git submodules for your AWS CodeBuild build project. - // - // FetchSubmodules is a required field - FetchSubmodules *bool `locationName:"fetchSubmodules" type:"boolean" required:"true"` + // During a previous call, the maximum number of items that can be returned + // is the value specified in maxResults. If there more items in the list, then + // a unique string called a nextToken is returned. 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 list of ARNs for the report groups shared with the current AWS account + // or user. + ReportGroups []*string `locationName:"reportGroups" min:"1" type:"list"` } // String returns the string representation -func (s GitSubmodulesConfig) String() string { +func (s ListSharedReportGroupsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GitSubmodulesConfig) GoString() string { +func (s ListSharedReportGroupsOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GitSubmodulesConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GitSubmodulesConfig"} - if s.FetchSubmodules == nil { - invalidParams.Add(request.NewErrParamRequired("FetchSubmodules")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetNextToken sets the NextToken field's value. +func (s *ListSharedReportGroupsOutput) SetNextToken(v string) *ListSharedReportGroupsOutput { + s.NextToken = &v + return s } -// SetFetchSubmodules sets the FetchSubmodules field's value. -func (s *GitSubmodulesConfig) SetFetchSubmodules(v bool) *GitSubmodulesConfig { - s.FetchSubmodules = &v +// SetReportGroups sets the ReportGroups field's value. +func (s *ListSharedReportGroupsOutput) SetReportGroups(v []*string) *ListSharedReportGroupsOutput { + s.ReportGroups = v return s } -type ImportSourceCredentialsInput struct { +type ListSourceCredentialsInput struct { _ struct{} `type:"structure"` +} - // The type of authentication used to connect to a GitHub, GitHub Enterprise, - // or Bitbucket repository. An OAUTH connection is not supported by the API - // and must be created using the AWS CodeBuild console. - // - // AuthType is a required field - AuthType *string `locationName:"authType" type:"string" required:"true" enum:"AuthType"` +// String returns the string representation +func (s ListSourceCredentialsInput) String() string { + return awsutil.Prettify(s) +} - // The source provider used for this project. - // - // ServerType is a required field - ServerType *string `locationName:"serverType" type:"string" required:"true" enum:"ServerType"` +// GoString returns the string representation +func (s ListSourceCredentialsInput) GoString() string { + return s.String() +} - // Set to false to prevent overwriting the repository source credentials. Set - // to true to overwrite the repository source credentials. The default value - // is true. - ShouldOverwrite *bool `locationName:"shouldOverwrite" type:"boolean"` +type ListSourceCredentialsOutput struct { + _ struct{} `type:"structure"` - // For GitHub or GitHub Enterprise, this is the personal access token. For Bitbucket, - // this is the app password. - // - // Token is a required field - Token *string `locationName:"token" min:"1" type:"string" required:"true" sensitive:"true"` + // A list of SourceCredentialsInfo objects. Each SourceCredentialsInfo object + // includes the authentication type, token ARN, and type of source provider + // for one set of credentials. + SourceCredentialsInfos []*SourceCredentialsInfo `locationName:"sourceCredentialsInfos" type:"list"` +} - // The Bitbucket username when the authType is BASIC_AUTH. This parameter is - // not valid for other types of source providers or connections. - Username *string `locationName:"username" min:"1" type:"string"` +// String returns the string representation +func (s ListSourceCredentialsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListSourceCredentialsOutput) GoString() string { + return s.String() +} + +// SetSourceCredentialsInfos sets the SourceCredentialsInfos field's value. +func (s *ListSourceCredentialsOutput) SetSourceCredentialsInfos(v []*SourceCredentialsInfo) *ListSourceCredentialsOutput { + s.SourceCredentialsInfos = v + return s +} + +// Information about logs for a build project. These can be logs in Amazon CloudWatch +// Logs, built in a specified S3 bucket, or both. +type LogsConfig struct { + _ struct{} `type:"structure"` + + // Information about Amazon CloudWatch Logs for a build project. Amazon CloudWatch + // Logs are enabled by default. + CloudWatchLogs *CloudWatchLogsConfig `locationName:"cloudWatchLogs" type:"structure"` + + // Information about logs built to an S3 bucket for a build project. S3 logs + // are not enabled by default. + S3Logs *S3LogsConfig `locationName:"s3Logs" type:"structure"` } // String returns the string representation -func (s ImportSourceCredentialsInput) String() string { +func (s LogsConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ImportSourceCredentialsInput) GoString() string { +func (s LogsConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ImportSourceCredentialsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportSourceCredentialsInput"} - if s.AuthType == nil { - invalidParams.Add(request.NewErrParamRequired("AuthType")) - } - if s.ServerType == nil { - invalidParams.Add(request.NewErrParamRequired("ServerType")) - } - if s.Token == nil { - invalidParams.Add(request.NewErrParamRequired("Token")) - } - if s.Token != nil && len(*s.Token) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Token", 1)) +func (s *LogsConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LogsConfig"} + if s.CloudWatchLogs != nil { + if err := s.CloudWatchLogs.Validate(); err != nil { + invalidParams.AddNested("CloudWatchLogs", err.(request.ErrInvalidParams)) + } } - if s.Username != nil && len(*s.Username) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Username", 1)) + if s.S3Logs != nil { + if err := s.S3Logs.Validate(); err != nil { + invalidParams.AddNested("S3Logs", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -3324,518 +6452,635 @@ func (s *ImportSourceCredentialsInput) Validate() error { return nil } -// SetAuthType sets the AuthType field's value. -func (s *ImportSourceCredentialsInput) SetAuthType(v string) *ImportSourceCredentialsInput { - s.AuthType = &v +// SetCloudWatchLogs sets the CloudWatchLogs field's value. +func (s *LogsConfig) SetCloudWatchLogs(v *CloudWatchLogsConfig) *LogsConfig { + s.CloudWatchLogs = v return s } -// SetServerType sets the ServerType field's value. -func (s *ImportSourceCredentialsInput) SetServerType(v string) *ImportSourceCredentialsInput { - s.ServerType = &v +// SetS3Logs sets the S3Logs field's value. +func (s *LogsConfig) SetS3Logs(v *S3LogsConfig) *LogsConfig { + s.S3Logs = v return s } -// SetShouldOverwrite sets the ShouldOverwrite field's value. -func (s *ImportSourceCredentialsInput) SetShouldOverwrite(v bool) *ImportSourceCredentialsInput { - s.ShouldOverwrite = &v - return s -} +// Information about build logs in Amazon CloudWatch Logs. +type LogsLocation struct { + _ struct{} `type:"structure"` -// SetToken sets the Token field's value. -func (s *ImportSourceCredentialsInput) SetToken(v string) *ImportSourceCredentialsInput { - s.Token = &v - return s -} + // Information about Amazon CloudWatch Logs for a build project. + CloudWatchLogs *CloudWatchLogsConfig `locationName:"cloudWatchLogs" type:"structure"` -// SetUsername sets the Username field's value. -func (s *ImportSourceCredentialsInput) SetUsername(v string) *ImportSourceCredentialsInput { - s.Username = &v - return s -} + // The ARN of Amazon CloudWatch Logs for a build project. Its format is arn:${Partition}:logs:${Region}:${Account}:log-group:${LogGroupName}:log-stream:${LogStreamName}. + // For more information, see Resources Defined by Amazon CloudWatch Logs (https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazoncloudwatchlogs.html#amazoncloudwatchlogs-resources-for-iam-policies). + CloudWatchLogsArn *string `locationName:"cloudWatchLogsArn" type:"string"` -type ImportSourceCredentialsOutput struct { - _ struct{} `type:"structure"` + // The URL to an individual build log in Amazon CloudWatch Logs. + DeepLink *string `locationName:"deepLink" type:"string"` - // The Amazon Resource Name (ARN) of the token. - Arn *string `locationName:"arn" min:"1" type:"string"` + // The name of the Amazon CloudWatch Logs group for the build logs. + GroupName *string `locationName:"groupName" type:"string"` + + // The URL to a build log in an S3 bucket. + S3DeepLink *string `locationName:"s3DeepLink" type:"string"` + + // Information about S3 logs for a build project. + S3Logs *S3LogsConfig `locationName:"s3Logs" type:"structure"` + + // The ARN of S3 logs for a build project. Its format is arn:${Partition}:s3:::${BucketName}/${ObjectName}. + // For more information, see Resources Defined by Amazon S3 (https://docs.aws.amazon.com/IAM/latest/UserGuide/list_amazons3.html#amazons3-resources-for-iam-policies). + S3LogsArn *string `locationName:"s3LogsArn" 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 ImportSourceCredentialsOutput) String() string { +func (s LogsLocation) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ImportSourceCredentialsOutput) GoString() string { +func (s LogsLocation) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *ImportSourceCredentialsOutput) SetArn(v string) *ImportSourceCredentialsOutput { - s.Arn = &v +// SetCloudWatchLogs sets the CloudWatchLogs field's value. +func (s *LogsLocation) SetCloudWatchLogs(v *CloudWatchLogsConfig) *LogsLocation { + s.CloudWatchLogs = v return s } -type InvalidateProjectCacheInput struct { - _ struct{} `type:"structure"` - - // The name of the AWS CodeBuild build project that the cache is reset for. - // - // ProjectName is a required field - ProjectName *string `locationName:"projectName" min:"1" type:"string" required:"true"` +// SetCloudWatchLogsArn sets the CloudWatchLogsArn field's value. +func (s *LogsLocation) SetCloudWatchLogsArn(v string) *LogsLocation { + s.CloudWatchLogsArn = &v + return s } -// String returns the string representation -func (s InvalidateProjectCacheInput) String() string { - return awsutil.Prettify(s) +// SetDeepLink sets the DeepLink field's value. +func (s *LogsLocation) SetDeepLink(v string) *LogsLocation { + s.DeepLink = &v + return s } -// GoString returns the string representation -func (s InvalidateProjectCacheInput) GoString() string { - return s.String() +// SetGroupName sets the GroupName field's value. +func (s *LogsLocation) SetGroupName(v string) *LogsLocation { + s.GroupName = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *InvalidateProjectCacheInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InvalidateProjectCacheInput"} - if s.ProjectName == nil { - invalidParams.Add(request.NewErrParamRequired("ProjectName")) - } - if s.ProjectName != nil && len(*s.ProjectName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProjectName", 1)) - } +// SetS3DeepLink sets the S3DeepLink field's value. +func (s *LogsLocation) SetS3DeepLink(v string) *LogsLocation { + s.S3DeepLink = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetS3Logs sets the S3Logs field's value. +func (s *LogsLocation) SetS3Logs(v *S3LogsConfig) *LogsLocation { + s.S3Logs = v + return s } -// SetProjectName sets the ProjectName field's value. -func (s *InvalidateProjectCacheInput) SetProjectName(v string) *InvalidateProjectCacheInput { - s.ProjectName = &v +// SetS3LogsArn sets the S3LogsArn field's value. +func (s *LogsLocation) SetS3LogsArn(v string) *LogsLocation { + s.S3LogsArn = &v return s } -type InvalidateProjectCacheOutput struct { +// SetStreamName sets the StreamName field's value. +func (s *LogsLocation) SetStreamName(v string) *LogsLocation { + s.StreamName = &v + return s +} + +// Describes a network interface. +type NetworkInterface struct { _ struct{} `type:"structure"` + + // The ID of the network interface. + NetworkInterfaceId *string `locationName:"networkInterfaceId" min:"1" type:"string"` + + // The ID of the subnet. + SubnetId *string `locationName:"subnetId" min:"1" type:"string"` } // String returns the string representation -func (s InvalidateProjectCacheOutput) String() string { +func (s NetworkInterface) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InvalidateProjectCacheOutput) GoString() string { +func (s NetworkInterface) GoString() string { return s.String() } -type ListBuildsForProjectInput struct { - _ struct{} `type:"structure"` +// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. +func (s *NetworkInterface) SetNetworkInterfaceId(v string) *NetworkInterface { + s.NetworkInterfaceId = &v + return s +} - // 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"` +// SetSubnetId sets the SubnetId field's value. +func (s *NetworkInterface) SetSubnetId(v string) *NetworkInterface { + s.SubnetId = &v + return s +} - // The name of the AWS CodeBuild project. - // - // ProjectName is a required field - ProjectName *string `locationName:"projectName" min:"1" type:"string" required:"true"` +// There was a problem with the underlying OAuth provider. +type OAuthProviderException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListBuildsForProjectInput) String() string { +func (s OAuthProviderException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListBuildsForProjectInput) GoString() string { +func (s OAuthProviderException) 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)) +func newErrorOAuthProviderException(v protocol.ResponseMetadata) error { + return &OAuthProviderException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s OAuthProviderException) Code() string { + return "OAuthProviderException" +} + +// Message returns the exception's message. +func (s OAuthProviderException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OAuthProviderException) OrigErr() error { return nil } -// SetNextToken sets the NextToken field's value. -func (s *ListBuildsForProjectInput) SetNextToken(v string) *ListBuildsForProjectInput { - s.NextToken = &v - return s +func (s OAuthProviderException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetProjectName sets the ProjectName field's value. -func (s *ListBuildsForProjectInput) SetProjectName(v string) *ListBuildsForProjectInput { - s.ProjectName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s OAuthProviderException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetSortOrder sets the SortOrder field's value. -func (s *ListBuildsForProjectInput) SetSortOrder(v string) *ListBuildsForProjectInput { - s.SortOrder = &v - return s +// RequestID returns the service's response RequestID for request. +func (s OAuthProviderException) RequestID() string { + return s.respMetadata.RequestID } -type ListBuildsForProjectOutput struct { +// Additional information about a build phase that has an error. You can use +// this information for troubleshooting. +type PhaseContext 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"` + // An explanation of the build phase's context. This might include a command + // ID and an exit code. + Message *string `locationName:"message" type:"string"` - // 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 status code for the context of the build phase. + StatusCode *string `locationName:"statusCode" type:"string"` } // String returns the string representation -func (s ListBuildsForProjectOutput) String() string { +func (s PhaseContext) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListBuildsForProjectOutput) GoString() string { +func (s PhaseContext) GoString() string { return s.String() } -// SetIds sets the Ids field's value. -func (s *ListBuildsForProjectOutput) SetIds(v []*string) *ListBuildsForProjectOutput { - s.Ids = v +// SetMessage sets the Message field's value. +func (s *PhaseContext) SetMessage(v string) *PhaseContext { + s.Message = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListBuildsForProjectOutput) SetNextToken(v string) *ListBuildsForProjectOutput { - s.NextToken = &v +// SetStatusCode sets the StatusCode field's value. +func (s *PhaseContext) SetStatusCode(v string) *PhaseContext { + s.StatusCode = &v return s } -type ListBuildsInput struct { +// Information about a build project. +type Project 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 Amazon Resource Name (ARN) of the build project. + Arn *string `locationName:"arn" type:"string"` - // The order to list build IDs. Valid values include: + // Information about the build output artifacts for the build project. + Artifacts *ProjectArtifacts `locationName:"artifacts" type:"structure"` + + // Information about the build badge for the build project. + Badge *ProjectBadge `locationName:"badge" type:"structure"` + + // Information about the cache for the build project. + Cache *ProjectCache `locationName:"cache" type:"structure"` + + // When the build project was created, expressed in Unix time format. + Created *time.Time `locationName:"created" type:"timestamp"` + + // 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. // - // * ASCENDING: List the build IDs in ascending order by build ID. + // You can use a cross-account KMS key to encrypt the build output artifacts + // if your service role has permission to that key. // - // * DESCENDING: List the build IDs in descending order by build ID. - SortOrder *string `locationName:"sortOrder" type:"string" enum:"SortOrderType"` -} + // You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, + // the CMK's alias (using the format alias/alias-name ). + EncryptionKey *string `locationName:"encryptionKey" min:"1" type:"string"` -// String returns the string representation -func (s ListBuildsInput) String() string { - return awsutil.Prettify(s) -} + // Information about the build environment for this build project. + Environment *ProjectEnvironment `locationName:"environment" type:"structure"` -// GoString returns the string representation -func (s ListBuildsInput) GoString() string { - return s.String() -} + // An array of ProjectFileSystemLocation objects for a CodeBuild build project. + // A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, + // mountPoint, and type of a file system created using Amazon Elastic File System. + FileSystemLocations []*ProjectFileSystemLocation `locationName:"fileSystemLocations" type:"list"` -// SetNextToken sets the NextToken field's value. -func (s *ListBuildsInput) SetNextToken(v string) *ListBuildsInput { - s.NextToken = &v - return s -} + // When the build project's settings were last modified, expressed in Unix time + // format. + LastModified *time.Time `locationName:"lastModified" type:"timestamp"` -// SetSortOrder sets the SortOrder field's value. -func (s *ListBuildsInput) SetSortOrder(v string) *ListBuildsInput { - s.SortOrder = &v - return s -} + // Information about logs for the build project. A project can create logs in + // Amazon CloudWatch Logs, an S3 bucket, or both. + LogsConfig *LogsConfig `locationName:"logsConfig" type:"structure"` -type ListBuildsOutput struct { - _ struct{} `type:"structure"` + // The name of the build project. + Name *string `locationName:"name" min:"2" type:"string"` - // A list of build IDs, with each build ID representing a single build. - Ids []*string `locationName:"ids" min:"1" type:"list"` + // The number of minutes a build is allowed to be queued before it times out. + QueuedTimeoutInMinutes *int64 `locationName:"queuedTimeoutInMinutes" min:"5" type:"integer"` - // 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"` -} + // An array of ProjectArtifacts objects. + SecondaryArtifacts []*ProjectArtifacts `locationName:"secondaryArtifacts" type:"list"` -// String returns the string representation -func (s ListBuildsOutput) String() string { - return awsutil.Prettify(s) -} + // An array of ProjectSourceVersion objects. If secondarySourceVersions is specified + // at the build level, then they take over these secondarySourceVersions (at + // the project level). + SecondarySourceVersions []*ProjectSourceVersion `locationName:"secondarySourceVersions" type:"list"` -// GoString returns the string representation -func (s ListBuildsOutput) GoString() string { - return s.String() -} + // An array of ProjectSource objects. + SecondarySources []*ProjectSource `locationName:"secondarySources" type:"list"` -// SetIds sets the Ids field's value. -func (s *ListBuildsOutput) SetIds(v []*string) *ListBuildsOutput { - s.Ids = v - return s -} + // 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"` -// SetNextToken sets the NextToken field's value. -func (s *ListBuildsOutput) SetNextToken(v string) *ListBuildsOutput { - s.NextToken = &v - return s -} + // Information about the build input source code for this build project. + Source *ProjectSource `locationName:"source" type:"structure"` + + // A version of the build input to be built for this project. If not specified, + // the latest version is used. If specified, it must be one of: + // + // * For AWS CodeCommit: the commit ID, branch, or Git tag to use. + // + // * For GitHub: the commit ID, pull request ID, branch name, or tag name + // that corresponds to the version of the source code you want to build. + // If a pull request ID is specified, it must use the format pr/pull-request-ID + // (for example pr/25). If a branch name is specified, the branch's HEAD + // commit ID is used. If not specified, the default branch's HEAD commit + // ID is used. + // + // * For Bitbucket: the commit ID, branch name, or tag name that corresponds + // to the version of the source code you want to build. If a branch name + // is specified, the branch's HEAD commit ID is used. If not specified, the + // default branch's HEAD commit ID is used. + // + // * For Amazon Simple Storage Service (Amazon S3): the version ID of the + // object that represents the build input ZIP file to use. + // + // If sourceVersion is specified at the build level, then that version takes + // precedence over this sourceVersion (at the project level). + // + // For more information, see Source Version Sample with CodeBuild (https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html) + // in the AWS CodeBuild User Guide. + SourceVersion *string `locationName:"sourceVersion" type:"string"` + + // 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:"5" type:"integer"` -type ListCuratedEnvironmentImagesInput struct { - _ struct{} `type:"structure"` + // Information about the VPC configuration that AWS CodeBuild accesses. + VpcConfig *VpcConfig `locationName:"vpcConfig" type:"structure"` + + // Information about a webhook that connects repository events to a build project + // in AWS CodeBuild. + Webhook *Webhook `locationName:"webhook" type:"structure"` } // String returns the string representation -func (s ListCuratedEnvironmentImagesInput) String() string { +func (s Project) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListCuratedEnvironmentImagesInput) GoString() string { +func (s Project) GoString() string { return s.String() } -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"` +// SetArn sets the Arn field's value. +func (s *Project) SetArn(v string) *Project { + s.Arn = &v + return s } -// String returns the string representation -func (s ListCuratedEnvironmentImagesOutput) String() string { - return awsutil.Prettify(s) +// SetArtifacts sets the Artifacts field's value. +func (s *Project) SetArtifacts(v *ProjectArtifacts) *Project { + s.Artifacts = v + return s } -// GoString returns the string representation -func (s ListCuratedEnvironmentImagesOutput) GoString() string { - return s.String() +// SetBadge sets the Badge field's value. +func (s *Project) SetBadge(v *ProjectBadge) *Project { + s.Badge = v + return s } -// SetPlatforms sets the Platforms field's value. -func (s *ListCuratedEnvironmentImagesOutput) SetPlatforms(v []*EnvironmentPlatform) *ListCuratedEnvironmentImagesOutput { - s.Platforms = v +// SetCache sets the Cache field's value. +func (s *Project) SetCache(v *ProjectCache) *Project { + s.Cache = v return s } -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 based on when each build project was created. - // - // * LAST_MODIFIED_TIME: List based on when information about each build - // project was last changed. - // - // * NAME: List 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"` +// SetCreated sets the Created field's value. +func (s *Project) SetCreated(v time.Time) *Project { + s.Created = &v + return s +} - // The order in which to list build projects. Valid values include: - // - // * ASCENDING: List in ascending order. - // - // * DESCENDING: List 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"` +// SetDescription sets the Description field's value. +func (s *Project) SetDescription(v string) *Project { + s.Description = &v + return s } -// String returns the string representation -func (s ListProjectsInput) String() string { - return awsutil.Prettify(s) +// SetEncryptionKey sets the EncryptionKey field's value. +func (s *Project) SetEncryptionKey(v string) *Project { + s.EncryptionKey = &v + return s } -// GoString returns the string representation -func (s ListProjectsInput) GoString() string { - return s.String() +// SetEnvironment sets the Environment field's value. +func (s *Project) SetEnvironment(v *ProjectEnvironment) *Project { + s.Environment = v + return s } -// 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)) - } +// SetFileSystemLocations sets the FileSystemLocations field's value. +func (s *Project) SetFileSystemLocations(v []*ProjectFileSystemLocation) *Project { + s.FileSystemLocations = v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetLastModified sets the LastModified field's value. +func (s *Project) SetLastModified(v time.Time) *Project { + s.LastModified = &v + return s } -// SetNextToken sets the NextToken field's value. -func (s *ListProjectsInput) SetNextToken(v string) *ListProjectsInput { - s.NextToken = &v +// SetLogsConfig sets the LogsConfig field's value. +func (s *Project) SetLogsConfig(v *LogsConfig) *Project { + s.LogsConfig = v return s } -// SetSortBy sets the SortBy field's value. -func (s *ListProjectsInput) SetSortBy(v string) *ListProjectsInput { - s.SortBy = &v +// SetName sets the Name field's value. +func (s *Project) SetName(v string) *Project { + s.Name = &v return s } -// SetSortOrder sets the SortOrder field's value. -func (s *ListProjectsInput) SetSortOrder(v string) *ListProjectsInput { - s.SortOrder = &v +// SetQueuedTimeoutInMinutes sets the QueuedTimeoutInMinutes field's value. +func (s *Project) SetQueuedTimeoutInMinutes(v int64) *Project { + s.QueuedTimeoutInMinutes = &v return s } -type ListProjectsOutput struct { - _ struct{} `type:"structure"` +// SetSecondaryArtifacts sets the SecondaryArtifacts field's value. +func (s *Project) SetSecondaryArtifacts(v []*ProjectArtifacts) *Project { + s.SecondaryArtifacts = v + return s +} - // 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"` +// SetSecondarySourceVersions sets the SecondarySourceVersions field's value. +func (s *Project) SetSecondarySourceVersions(v []*ProjectSourceVersion) *Project { + s.SecondarySourceVersions = v + return s +} - // The list of build project names, with each build project name representing - // a single build project. - Projects []*string `locationName:"projects" min:"1" type:"list"` +// SetSecondarySources sets the SecondarySources field's value. +func (s *Project) SetSecondarySources(v []*ProjectSource) *Project { + s.SecondarySources = v + return s } -// String returns the string representation -func (s ListProjectsOutput) String() string { - return awsutil.Prettify(s) +// SetServiceRole sets the ServiceRole field's value. +func (s *Project) SetServiceRole(v string) *Project { + s.ServiceRole = &v + return s } -// GoString returns the string representation -func (s ListProjectsOutput) GoString() string { - return s.String() +// SetSource sets the Source field's value. +func (s *Project) SetSource(v *ProjectSource) *Project { + s.Source = v + return s } -// SetNextToken sets the NextToken field's value. -func (s *ListProjectsOutput) SetNextToken(v string) *ListProjectsOutput { - s.NextToken = &v +// SetSourceVersion sets the SourceVersion field's value. +func (s *Project) SetSourceVersion(v string) *Project { + s.SourceVersion = &v return s } -// SetProjects sets the Projects field's value. -func (s *ListProjectsOutput) SetProjects(v []*string) *ListProjectsOutput { - s.Projects = v +// SetTags sets the Tags field's value. +func (s *Project) SetTags(v []*Tag) *Project { + s.Tags = v return s } -type ListSourceCredentialsInput struct { - _ struct{} `type:"structure"` +// SetTimeoutInMinutes sets the TimeoutInMinutes field's value. +func (s *Project) SetTimeoutInMinutes(v int64) *Project { + s.TimeoutInMinutes = &v + return s } -// String returns the string representation -func (s ListSourceCredentialsInput) String() string { - return awsutil.Prettify(s) +// SetVpcConfig sets the VpcConfig field's value. +func (s *Project) SetVpcConfig(v *VpcConfig) *Project { + s.VpcConfig = v + return s } -// GoString returns the string representation -func (s ListSourceCredentialsInput) GoString() string { - return s.String() +// SetWebhook sets the Webhook field's value. +func (s *Project) SetWebhook(v *Webhook) *Project { + s.Webhook = v + return s } -type ListSourceCredentialsOutput struct { +// Information about the build output artifacts for the build project. +type ProjectArtifacts struct { _ struct{} `type:"structure"` - // A list of SourceCredentialsInfo objects. Each SourceCredentialsInfo object - // includes the authentication type, token ARN, and type of source provider - // for one set of credentials. - SourceCredentialsInfos []*SourceCredentialsInfo `locationName:"sourceCredentialsInfos" type:"list"` -} + // An identifier for this artifact definition. + ArtifactIdentifier *string `locationName:"artifactIdentifier" type:"string"` -// String returns the string representation -func (s ListSourceCredentialsOutput) String() string { - return awsutil.Prettify(s) -} + // Set to true if you do not want your output artifacts encrypted. This option + // is valid only if your artifacts type is Amazon Simple Storage Service (Amazon + // S3). If this is set with another artifacts type, an invalidInputException + // is thrown. + EncryptionDisabled *bool `locationName:"encryptionDisabled" type:"boolean"` -// GoString returns the string representation -func (s ListSourceCredentialsOutput) GoString() string { - return s.String() -} + // Information about the build output artifact location: + // + // * If type is set to CODEPIPELINE, AWS CodePipeline ignores 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, this value is ignored if specified, + // because no build output is 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 uses to + // name and store the output artifact: + // + // * If type is set to CODEPIPELINE, AWS CodePipeline ignores 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, this value is ignored if specified, + // because no build output is produced. + // + // * If type is set to S3, this is the name of the output artifact object. + // If you set the name to be a forward slash ("/"), the artifact is stored + // in the root of the output bucket. + // + // 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 is stored in MyArtifacts/build-ID/MyArtifact.zip. + // + // * If path is empty, namespaceType is set to NONE, and name is set to "/", + // the output artifact is stored in the root of the output bucket. + // + // * If path is set to MyArtifacts, namespaceType is set to BUILD_ID, and + // name is set to "/", the output artifact is stored in MyArtifacts/build-ID . + Name *string `locationName:"name" type:"string"` -// SetSourceCredentialsInfos sets the SourceCredentialsInfos field's value. -func (s *ListSourceCredentialsOutput) SetSourceCredentialsInfos(v []*SourceCredentialsInfo) *ListSourceCredentialsOutput { - s.SourceCredentialsInfos = v - return s -} + // Along with path and name, the pattern that AWS CodeBuild uses to determine + // the name and location to store the output artifact: + // + // * If type is set to CODEPIPELINE, AWS CodePipeline ignores 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, this value is ignored if specified, + // because no build output is produced. + // + // * If type is set to S3, 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, the output artifact is stored in MyArtifacts/build-ID/MyArtifact.zip. + NamespaceType *string `locationName:"namespaceType" type:"string" enum:"ArtifactNamespace"` -// Information about logs for a build project. These can be logs in Amazon CloudWatch -// Logs, built in a specified S3 bucket, or both. -type LogsConfig struct { - _ struct{} `type:"structure"` + // If this flag is set, a name specified in the buildspec file overrides the + // artifact name. The name specified in a buildspec file is calculated at build + // time and uses the Shell Command Language. For example, you can append a date + // and time to your artifact name so that it is always unique. + OverrideArtifactName *bool `locationName:"overrideArtifactName" type:"boolean"` - // Information about Amazon CloudWatch Logs for a build project. Amazon CloudWatch - // Logs are enabled by default. - CloudWatchLogs *CloudWatchLogsConfig `locationName:"cloudWatchLogs" type:"structure"` + // The type of build output artifact to create: + // + // * If type is set to CODEPIPELINE, AWS CodePipeline ignores 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, this value is ignored if specified, + // because no build output is produced. + // + // * If type is set to S3, valid values include: NONE: AWS CodeBuild creates + // in the output bucket a folder that contains the build output. This is + // the default if packaging is not specified. ZIP: AWS CodeBuild creates + // in the output bucket a ZIP file that contains the build output. + Packaging *string `locationName:"packaging" type:"string" enum:"ArtifactPackaging"` - // Information about logs built to an S3 bucket for a build project. S3 logs - // are not enabled by default. - S3Logs *S3LogsConfig `locationName:"s3Logs" type:"structure"` + // Along with namespaceType and name, the pattern that AWS CodeBuild uses to + // name and store the output artifact: + // + // * If type is set to CODEPIPELINE, AWS CodePipeline ignores 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, this value is ignored if specified, + // because no build output is produced. + // + // * If type is set to S3, this is the path to the output artifact. If path + // is not specified, path is not used. + // + // For example, if path is set to MyArtifacts, namespaceType is set to NONE, + // and name is set to MyArtifact.zip, the output artifact is 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 has build output generated through AWS + // CodePipeline. The CODEPIPELINE type is not supported for secondaryArtifacts. + // + // * NO_ARTIFACTS: The build project does not produce any build output. + // + // * S3: The build project stores 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 LogsConfig) String() string { +func (s ProjectArtifacts) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LogsConfig) GoString() string { +func (s ProjectArtifacts) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *LogsConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LogsConfig"} - if s.CloudWatchLogs != nil { - if err := s.CloudWatchLogs.Validate(); err != nil { - invalidParams.AddNested("CloudWatchLogs", err.(request.ErrInvalidParams)) - } - } - if s.S3Logs != nil { - if err := s.S3Logs.Validate(); err != nil { - invalidParams.AddNested("S3Logs", err.(request.ErrInvalidParams)) - } +func (s *ProjectArtifacts) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProjectArtifacts"} + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) } if invalidParams.Len() > 0 { @@ -3844,549 +7089,619 @@ func (s *LogsConfig) Validate() error { return nil } -// SetCloudWatchLogs sets the CloudWatchLogs field's value. -func (s *LogsConfig) SetCloudWatchLogs(v *CloudWatchLogsConfig) *LogsConfig { - s.CloudWatchLogs = v +// SetArtifactIdentifier sets the ArtifactIdentifier field's value. +func (s *ProjectArtifacts) SetArtifactIdentifier(v string) *ProjectArtifacts { + s.ArtifactIdentifier = &v return s } -// SetS3Logs sets the S3Logs field's value. -func (s *LogsConfig) SetS3Logs(v *S3LogsConfig) *LogsConfig { - s.S3Logs = v +// SetEncryptionDisabled sets the EncryptionDisabled field's value. +func (s *ProjectArtifacts) SetEncryptionDisabled(v bool) *ProjectArtifacts { + s.EncryptionDisabled = &v return s } -// Information about build logs in Amazon CloudWatch Logs. -type LogsLocation struct { - _ struct{} `type:"structure"` - - // Information about Amazon CloudWatch Logs for a build project. - CloudWatchLogs *CloudWatchLogsConfig `locationName:"cloudWatchLogs" 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 URL to a build log in an S3 bucket. - S3DeepLink *string `locationName:"s3DeepLink" type:"string"` - - // Information about S3 logs for a build project. - S3Logs *S3LogsConfig `locationName:"s3Logs" type:"structure"` - - // 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() +// SetLocation sets the Location field's value. +func (s *ProjectArtifacts) SetLocation(v string) *ProjectArtifacts { + s.Location = &v + return s } -// SetCloudWatchLogs sets the CloudWatchLogs field's value. -func (s *LogsLocation) SetCloudWatchLogs(v *CloudWatchLogsConfig) *LogsLocation { - s.CloudWatchLogs = v +// SetName sets the Name field's value. +func (s *ProjectArtifacts) SetName(v string) *ProjectArtifacts { + s.Name = &v return s } -// SetDeepLink sets the DeepLink field's value. -func (s *LogsLocation) SetDeepLink(v string) *LogsLocation { - s.DeepLink = &v +// SetNamespaceType sets the NamespaceType field's value. +func (s *ProjectArtifacts) SetNamespaceType(v string) *ProjectArtifacts { + s.NamespaceType = &v return s } -// SetGroupName sets the GroupName field's value. -func (s *LogsLocation) SetGroupName(v string) *LogsLocation { - s.GroupName = &v +// SetOverrideArtifactName sets the OverrideArtifactName field's value. +func (s *ProjectArtifacts) SetOverrideArtifactName(v bool) *ProjectArtifacts { + s.OverrideArtifactName = &v return s } -// SetS3DeepLink sets the S3DeepLink field's value. -func (s *LogsLocation) SetS3DeepLink(v string) *LogsLocation { - s.S3DeepLink = &v +// SetPackaging sets the Packaging field's value. +func (s *ProjectArtifacts) SetPackaging(v string) *ProjectArtifacts { + s.Packaging = &v return s } -// SetS3Logs sets the S3Logs field's value. -func (s *LogsLocation) SetS3Logs(v *S3LogsConfig) *LogsLocation { - s.S3Logs = v +// SetPath sets the Path field's value. +func (s *ProjectArtifacts) SetPath(v string) *ProjectArtifacts { + s.Path = &v return s } -// SetStreamName sets the StreamName field's value. -func (s *LogsLocation) SetStreamName(v string) *LogsLocation { - s.StreamName = &v +// SetType sets the Type field's value. +func (s *ProjectArtifacts) SetType(v string) *ProjectArtifacts { + s.Type = &v return s } -// Describes a network interface. -type NetworkInterface struct { +// Information about the build badge for the build project. +type ProjectBadge struct { _ struct{} `type:"structure"` - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" min:"1" type:"string"` + // Set this to true to generate a publicly accessible URL for your project's + // build badge. + BadgeEnabled *bool `locationName:"badgeEnabled" type:"boolean"` - // The ID of the subnet. - SubnetId *string `locationName:"subnetId" min:"1" type:"string"` + // The publicly-accessible URL through which you can access the build badge + // for your project. + // + // The publicly accessible URL through which you can access the build badge + // for your project. + BadgeRequestUrl *string `locationName:"badgeRequestUrl" type:"string"` } // String returns the string representation -func (s NetworkInterface) String() string { +func (s ProjectBadge) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s NetworkInterface) GoString() string { +func (s ProjectBadge) GoString() string { return s.String() } -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *NetworkInterface) SetNetworkInterfaceId(v string) *NetworkInterface { - s.NetworkInterfaceId = &v +// SetBadgeEnabled sets the BadgeEnabled field's value. +func (s *ProjectBadge) SetBadgeEnabled(v bool) *ProjectBadge { + s.BadgeEnabled = &v return s } -// SetSubnetId sets the SubnetId field's value. -func (s *NetworkInterface) SetSubnetId(v string) *NetworkInterface { - s.SubnetId = &v +// SetBadgeRequestUrl sets the BadgeRequestUrl field's value. +func (s *ProjectBadge) SetBadgeRequestUrl(v string) *ProjectBadge { + s.BadgeRequestUrl = &v return s } -// Additional information about a build phase that has an error. You can use -// this information for troubleshooting. -type PhaseContext struct { +// Information about the cache for the build project. +type ProjectCache struct { _ struct{} `type:"structure"` - // An explanation of the build phase's context. This might include a command - // ID and an exit code. - Message *string `locationName:"message" type:"string"` + // Information about the cache location: + // + // * NO_CACHE or LOCAL: This value is ignored. + // + // * S3: This is the S3 bucket name/prefix. + Location *string `locationName:"location" type:"string"` - // The status code for the context of the build phase. - StatusCode *string `locationName:"statusCode" type:"string"` + // If you use a LOCAL cache, the local cache mode. You can use one or more local + // cache modes at the same time. + // + // * LOCAL_SOURCE_CACHE mode caches Git metadata for primary and secondary + // sources. After the cache is created, subsequent builds pull only the change + // between commits. This mode is a good choice for projects with a clean + // working directory and a source that is a large Git repository. If you + // choose this option and your project does not use a Git repository (GitHub, + // GitHub Enterprise, or Bitbucket), the option is ignored. + // + // * LOCAL_DOCKER_LAYER_CACHE mode caches existing Docker layers. This mode + // is a good choice for projects that build or pull large Docker images. + // It can prevent the performance issues caused by pulling large Docker images + // down from the network. You can use a Docker layer cache in the Linux environment + // only. The privileged flag must be set so that your project has the required + // Docker permissions. You should consider the security implications before + // you use a Docker layer cache. + // + // * LOCAL_CUSTOM_CACHE mode caches directories you specify in the buildspec + // file. This mode is a good choice if your build scenario is not suited + // to one of the other three local cache modes. If you use a custom cache: + // Only directories can be specified for caching. You cannot specify individual + // files. Symlinks are used to reference cached directories. Cached directories + // are linked to your build before it downloads its project sources. Cached + // items are overridden if a source item has the same name. Directories are + // specified using cache paths in the buildspec file. + Modes []*string `locationName:"modes" type:"list"` + + // The type of cache used by the build project. Valid values include: + // + // * NO_CACHE: The build project does not use any cache. + // + // * S3: The build project reads and writes from and to S3. + // + // * LOCAL: The build project stores a cache locally on a build host that + // is only available to that build host. + // + // Type is a required field + Type *string `locationName:"type" type:"string" required:"true" enum:"CacheType"` } // String returns the string representation -func (s PhaseContext) String() string { +func (s ProjectCache) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PhaseContext) GoString() string { +func (s ProjectCache) GoString() string { return s.String() } -// SetMessage sets the Message field's value. -func (s *PhaseContext) SetMessage(v string) *PhaseContext { - s.Message = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ProjectCache) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProjectCache"} + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetStatusCode sets the StatusCode field's value. -func (s *PhaseContext) SetStatusCode(v string) *PhaseContext { - s.StatusCode = &v +// SetLocation sets the Location field's value. +func (s *ProjectCache) SetLocation(v string) *ProjectCache { + s.Location = &v return s } -// Information about a build 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"` - - // Information about the build badge for the build project. - Badge *ProjectBadge `locationName:"badge" type:"structure"` +// SetModes sets the Modes field's value. +func (s *ProjectCache) SetModes(v []*string) *ProjectCache { + s.Modes = v + return s +} - // Information about the cache for the build project. - Cache *ProjectCache `locationName:"cache" type:"structure"` +// SetType sets the Type field's value. +func (s *ProjectCache) SetType(v string) *ProjectCache { + s.Type = &v + return s +} - // When the build project was created, expressed in Unix time format. - Created *time.Time `locationName:"created" type:"timestamp"` +// Information about the build environment of the build project. +type ProjectEnvironment struct { + _ struct{} `type:"structure"` - // A description that makes the build project easy to identify. - Description *string `locationName:"description" type:"string"` + // The certificate to use with this build project. + Certificate *string `locationName:"certificate" type:"string"` - // The AWS Key Management Service (AWS KMS) customer master key (CMK) to be - // used for encrypting the build output artifacts. + // Information about the compute resources the build project uses. Available + // values include: // - // You can use a cross-account KMS key to encrypt the build output artifacts - // if your service role has permission to that key. + // * BUILD_GENERAL1_SMALL: Use up to 3 GB memory and 2 vCPUs for builds. // - // You can specify either the Amazon Resource Name (ARN) of the CMK 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 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"` - - // Information about logs for the build project. A project can create logs in - // Amazon CloudWatch Logs, an S3 bucket, or both. - LogsConfig *LogsConfig `locationName:"logsConfig" type:"structure"` - - // The name of the build project. - Name *string `locationName:"name" min:"2" type:"string"` - - // The number of minutes a build is allowed to be queued before it times out. - QueuedTimeoutInMinutes *int64 `locationName:"queuedTimeoutInMinutes" min:"5" type:"integer"` - - // An array of ProjectArtifacts objects. - SecondaryArtifacts []*ProjectArtifacts `locationName:"secondaryArtifacts" type:"list"` - - // An array of ProjectSourceVersion objects. If secondarySourceVersions is specified - // at the build level, then they take over these secondarySourceVersions (at - // the project level). - SecondarySourceVersions []*ProjectSourceVersion `locationName:"secondarySourceVersions" type:"list"` + // * BUILD_GENERAL1_MEDIUM: Use up to 7 GB memory and 4 vCPUs for builds. + // + // * BUILD_GENERAL1_LARGE: Use up to 16 GB memory and 8 vCPUs for builds, + // depending on your environment type. + // + // * BUILD_GENERAL1_2XLARGE: Use up to 145 GB memory, 72 vCPUs, and 824 GB + // of SSD storage for builds. This compute type supports Docker images up + // to 100 GB uncompressed. + // + // If you use BUILD_GENERAL1_LARGE: + // + // * For environment type LINUX_CONTAINER, you can use up to 15 GB memory + // and 8 vCPUs for builds. + // + // * For environment type LINUX_GPU_CONTAINER, you can use up to 255 GB memory, + // 32 vCPUs, and 4 NVIDIA Tesla V100 GPUs for builds. + // + // * For environment type ARM_CONTAINER, you can use up to 16 GB memory and + // 8 vCPUs on ARM-based processors for builds. + // + // For more information, see Build Environment Compute Types (https://docs.aws.amazon.com/codebuild/latest/userguide/build-env-ref-compute-types.html) + // in the AWS CodeBuild User Guide. + // + // ComputeType is a required field + ComputeType *string `locationName:"computeType" type:"string" required:"true" enum:"ComputeType"` - // An array of ProjectSource objects. - SecondarySources []*ProjectSource `locationName:"secondarySources" type:"list"` + // A set of environment variables to make available to builds for this build + // project. + EnvironmentVariables []*EnvironmentVariable `locationName:"environmentVariables" type:"list"` - // 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"` + // The image tag or image digest that identifies the Docker image to use for + // this build project. Use the following formats: + // + // * For an image tag: registry/repository:tag. For example, to specify an + // image with the tag "latest," use registry/repository:latest. + // + // * For an image digest: registry/repository@digest. For example, to specify + // an image with the digest "sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf," + // use registry/repository@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf. + // + // Image is a required field + Image *string `locationName:"image" min:"1" type:"string" required:"true"` - // Information about the build input source code for this build project. - Source *ProjectSource `locationName:"source" type:"structure"` + // The type of credentials AWS CodeBuild uses to pull images in your build. + // There are two valid values: + // + // * CODEBUILD specifies that AWS CodeBuild uses its own credentials. This + // requires that you modify your ECR repository policy to trust AWS CodeBuild's + // service principal. + // + // * SERVICE_ROLE specifies that AWS CodeBuild uses your build project's + // service role. + // + // When you use a cross-account or private registry image, you must use SERVICE_ROLE + // credentials. When you use an AWS CodeBuild curated image, you must use CODEBUILD + // credentials. + ImagePullCredentialsType *string `locationName:"imagePullCredentialsType" type:"string" enum:"ImagePullCredentialsType"` - // A version of the build input to be built for this project. If not specified, - // the latest version is used. If specified, it must be one of: + // Enables running the Docker daemon inside a Docker container. Set to true + // only if the build project is used to build Docker images. Otherwise, a build + // that attempts to interact with the Docker daemon fails. The default setting + // is false. // - // * For AWS CodeCommit: the commit ID to use. + // You can initialize the Docker daemon during the install phase of your build + // by adding one of the following sets of commands to the install phase of your + // buildspec file: // - // * For GitHub: the commit ID, pull request ID, branch name, or tag name - // that corresponds to the version of the source code you want to build. - // If a pull request ID is specified, it must use the format pr/pull-request-ID - // (for example pr/25). If a branch name is specified, the branch's HEAD - // commit ID is used. If not specified, the default branch's HEAD commit - // ID is used. + // If the operating system's base image is Ubuntu Linux: // - // * For Bitbucket: the commit ID, branch name, or tag name that corresponds - // to the version of the source code you want to build. If a branch name - // is specified, the branch's HEAD commit ID is used. If not specified, the - // default branch's HEAD commit ID is used. + // - nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 + // --storage-driver=overlay& // - // * For Amazon Simple Storage Service (Amazon S3): the version ID of the - // object that represents the build input ZIP file to use. + // - timeout 15 sh -c "until docker info; do echo .; sleep 1; done" // - // If sourceVersion is specified at the build level, then that version takes - // precedence over this sourceVersion (at the project level). + // If the operating system's base image is Alpine Linux and the previous command + // does not work, add the -t argument to timeout: // - // For more information, see Source Version Sample with CodeBuild (https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html) - // in the AWS CodeBuild User Guide. - SourceVersion *string `locationName:"sourceVersion" type:"string"` - - // The tags for this build project. + // - nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 + // --storage-driver=overlay& // - // 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:"5" type:"integer"` + // - timeout -t 15 sh -c "until docker info; do echo .; sleep 1; done" + PrivilegedMode *bool `locationName:"privilegedMode" type:"boolean"` - // Information about the VPC configuration that AWS CodeBuild accesses. - VpcConfig *VpcConfig `locationName:"vpcConfig" type:"structure"` + // The credentials for access to a private registry. + RegistryCredential *RegistryCredential `locationName:"registryCredential" type:"structure"` - // Information about a webhook that connects repository events to a build project - // in AWS CodeBuild. - Webhook *Webhook `locationName:"webhook" type:"structure"` + // The type of build environment to use for related builds. + // + // * The environment type ARM_CONTAINER is available only in regions US East + // (N. Virginia), US East (Ohio), US West (Oregon), EU (Ireland), Asia Pacific + // (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Sydney), and EU (Frankfurt). + // + // * The environment type LINUX_CONTAINER with compute type build.general1.2xlarge + // is available only in regions US East (N. Virginia), US East (N. Virginia), + // US West (Oregon), Canada (Central), EU (Ireland), EU (London), EU (Frankfurt), + // Asia Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), + // Asia Pacific (Sydney), China (Beijing), and China (Ningxia). + // + // * The environment type LINUX_GPU_CONTAINER is available only in regions + // US East (N. Virginia), US East (N. Virginia), US West (Oregon), Canada + // (Central), EU (Ireland), EU (London), EU (Frankfurt), Asia Pacific (Tokyo), + // Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney) + // , China (Beijing), and China (Ningxia). + // + // Type is a required field + Type *string `locationName:"type" type:"string" required:"true" enum:"EnvironmentType"` } // String returns the string representation -func (s Project) String() string { +func (s ProjectEnvironment) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Project) GoString() string { +func (s ProjectEnvironment) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *Project) SetArn(v string) *Project { - s.Arn = &v - return s -} +// 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 s.RegistryCredential != nil { + if err := s.RegistryCredential.Validate(); err != nil { + invalidParams.AddNested("RegistryCredential", err.(request.ErrInvalidParams)) + } + } -// SetArtifacts sets the Artifacts field's value. -func (s *Project) SetArtifacts(v *ProjectArtifacts) *Project { - s.Artifacts = v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetBadge sets the Badge field's value. -func (s *Project) SetBadge(v *ProjectBadge) *Project { - s.Badge = v +// SetCertificate sets the Certificate field's value. +func (s *ProjectEnvironment) SetCertificate(v string) *ProjectEnvironment { + s.Certificate = &v return s } -// SetCache sets the Cache field's value. -func (s *Project) SetCache(v *ProjectCache) *Project { - s.Cache = v +// SetComputeType sets the ComputeType field's value. +func (s *ProjectEnvironment) SetComputeType(v string) *ProjectEnvironment { + s.ComputeType = &v return s } -// SetCreated sets the Created field's value. -func (s *Project) SetCreated(v time.Time) *Project { - s.Created = &v +// SetEnvironmentVariables sets the EnvironmentVariables field's value. +func (s *ProjectEnvironment) SetEnvironmentVariables(v []*EnvironmentVariable) *ProjectEnvironment { + s.EnvironmentVariables = v return s } -// SetDescription sets the Description field's value. -func (s *Project) SetDescription(v string) *Project { - s.Description = &v +// SetImage sets the Image field's value. +func (s *ProjectEnvironment) SetImage(v string) *ProjectEnvironment { + s.Image = &v return s } -// SetEncryptionKey sets the EncryptionKey field's value. -func (s *Project) SetEncryptionKey(v string) *Project { - s.EncryptionKey = &v +// SetImagePullCredentialsType sets the ImagePullCredentialsType field's value. +func (s *ProjectEnvironment) SetImagePullCredentialsType(v string) *ProjectEnvironment { + s.ImagePullCredentialsType = &v return s } -// SetEnvironment sets the Environment field's value. -func (s *Project) SetEnvironment(v *ProjectEnvironment) *Project { - s.Environment = v +// SetPrivilegedMode sets the PrivilegedMode field's value. +func (s *ProjectEnvironment) SetPrivilegedMode(v bool) *ProjectEnvironment { + s.PrivilegedMode = &v return s } -// SetLastModified sets the LastModified field's value. -func (s *Project) SetLastModified(v time.Time) *Project { - s.LastModified = &v +// SetRegistryCredential sets the RegistryCredential field's value. +func (s *ProjectEnvironment) SetRegistryCredential(v *RegistryCredential) *ProjectEnvironment { + s.RegistryCredential = v return s } -// SetLogsConfig sets the LogsConfig field's value. -func (s *Project) SetLogsConfig(v *LogsConfig) *Project { - s.LogsConfig = v +// SetType sets the Type field's value. +func (s *ProjectEnvironment) SetType(v string) *ProjectEnvironment { + s.Type = &v return s } -// SetName sets the Name field's value. -func (s *Project) SetName(v string) *Project { - s.Name = &v - return s -} +// Information about a file system created by Amazon Elastic File System (EFS). +// For more information, see What Is Amazon Elastic File System? (https://docs.aws.amazon.com/efs/latest/ug/whatisefs.html) +type ProjectFileSystemLocation struct { + _ struct{} `type:"structure"` -// SetQueuedTimeoutInMinutes sets the QueuedTimeoutInMinutes field's value. -func (s *Project) SetQueuedTimeoutInMinutes(v int64) *Project { - s.QueuedTimeoutInMinutes = &v - return s -} + // The name used to access a file system created by Amazon EFS. CodeBuild creates + // an environment variable by appending the identifier in all capital letters + // to CODEBUILD_. For example, if you specify my-efs for identifier, a new environment + // variable is create named CODEBUILD_MY-EFS. + // + // The identifier is used to mount your file system. + Identifier *string `locationName:"identifier" type:"string"` -// SetSecondaryArtifacts sets the SecondaryArtifacts field's value. -func (s *Project) SetSecondaryArtifacts(v []*ProjectArtifacts) *Project { - s.SecondaryArtifacts = v - return s -} + // A string that specifies the location of the file system created by Amazon + // EFS. Its format is efs-dns-name:/directory-path. You can find the DNS name + // of file system when you view it in the AWS EFS console. The directory path + // is a path to a directory in the file system that CodeBuild mounts. For example, + // if the DNS name of a file system is fs-abcd1234.efs.us-west-2.amazonaws.com, + // and its mount directory is my-efs-mount-directory, then the location is fs-abcd1234.efs.us-west-2.amazonaws.com:/my-efs-mount-directory. + // + // The directory path in the format efs-dns-name:/directory-path is optional. + // If you do not specify a directory path, the location is only the DNS name + // and CodeBuild mounts the entire file system. + Location *string `locationName:"location" type:"string"` -// SetSecondarySourceVersions sets the SecondarySourceVersions field's value. -func (s *Project) SetSecondarySourceVersions(v []*ProjectSourceVersion) *Project { - s.SecondarySourceVersions = v - return s -} + // The mount options for a file system created by AWS EFS. The default mount + // options used by CodeBuild are nfsvers=4.1,rsize=1048576,wsize=1048576,hard,timeo=600,retrans=2. + // For more information, see Recommended NFS Mount Options (https://docs.aws.amazon.com/efs/latest/ug/mounting-fs-nfs-mount-settings.html). + MountOptions *string `locationName:"mountOptions" type:"string"` -// SetSecondarySources sets the SecondarySources field's value. -func (s *Project) SetSecondarySources(v []*ProjectSource) *Project { - s.SecondarySources = v - return s + // The location in the container where you mount the file system. + MountPoint *string `locationName:"mountPoint" type:"string"` + + // The type of the file system. The one supported type is EFS. + Type *string `locationName:"type" type:"string" enum:"FileSystemType"` } -// SetServiceRole sets the ServiceRole field's value. -func (s *Project) SetServiceRole(v string) *Project { - s.ServiceRole = &v - return s +// String returns the string representation +func (s ProjectFileSystemLocation) String() string { + return awsutil.Prettify(s) } -// SetSource sets the Source field's value. -func (s *Project) SetSource(v *ProjectSource) *Project { - s.Source = v - return s +// GoString returns the string representation +func (s ProjectFileSystemLocation) GoString() string { + return s.String() } -// SetSourceVersion sets the SourceVersion field's value. -func (s *Project) SetSourceVersion(v string) *Project { - s.SourceVersion = &v +// SetIdentifier sets the Identifier field's value. +func (s *ProjectFileSystemLocation) SetIdentifier(v string) *ProjectFileSystemLocation { + s.Identifier = &v return s } -// SetTags sets the Tags field's value. -func (s *Project) SetTags(v []*Tag) *Project { - s.Tags = v +// SetLocation sets the Location field's value. +func (s *ProjectFileSystemLocation) SetLocation(v string) *ProjectFileSystemLocation { + s.Location = &v return s } -// SetTimeoutInMinutes sets the TimeoutInMinutes field's value. -func (s *Project) SetTimeoutInMinutes(v int64) *Project { - s.TimeoutInMinutes = &v +// SetMountOptions sets the MountOptions field's value. +func (s *ProjectFileSystemLocation) SetMountOptions(v string) *ProjectFileSystemLocation { + s.MountOptions = &v return s } -// SetVpcConfig sets the VpcConfig field's value. -func (s *Project) SetVpcConfig(v *VpcConfig) *Project { - s.VpcConfig = v +// SetMountPoint sets the MountPoint field's value. +func (s *ProjectFileSystemLocation) SetMountPoint(v string) *ProjectFileSystemLocation { + s.MountPoint = &v return s } -// SetWebhook sets the Webhook field's value. -func (s *Project) SetWebhook(v *Webhook) *Project { - s.Webhook = v +// SetType sets the Type field's value. +func (s *ProjectFileSystemLocation) SetType(v string) *ProjectFileSystemLocation { + s.Type = &v return s } -// Information about the build output artifacts for the build project. -type ProjectArtifacts struct { +// Information about the build input source code for the build project. +type ProjectSource struct { _ struct{} `type:"structure"` - // An identifier for this artifact definition. - ArtifactIdentifier *string `locationName:"artifactIdentifier" type:"string"` - - // Set to true if you do not want your output artifacts encrypted. This option - // is valid only if your artifacts type is Amazon Simple Storage Service (Amazon - // S3). If this is set with another artifacts type, an invalidInputException - // is thrown. - EncryptionDisabled *bool `locationName:"encryptionDisabled" type:"boolean"` - - // Information about the build output artifact location: - // - // * If type is set to CODEPIPELINE, AWS CodePipeline ignores 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, this value is ignored if specified, - // because no build output is produced. + // Information about the authorization settings for AWS CodeBuild to access + // the source code to be built. // - // * If type is set to S3, this is the name of the output bucket. - Location *string `locationName:"location" type:"string"` + // This information is for the AWS CodeBuild console's use only. Your code should + // not get or set this information directly. + Auth *SourceAuth `locationName:"auth" type:"structure"` - // Along with path and namespaceType, the pattern that AWS CodeBuild uses to - // name and store the output artifact: - // - // * If type is set to CODEPIPELINE, AWS CodePipeline ignores this value - // if specified. This is because AWS CodePipeline manages its build output - // names instead of AWS CodeBuild. + // The buildspec file declaration to use for the builds in this build project. // - // * If type is set to NO_ARTIFACTS, this value is ignored if specified, - // because no build output is produced. + // If this value is set, it can be either an inline buildspec definition, the + // path to an alternate buildspec file relative to the value of the built-in + // CODEBUILD_SRC_DIR environment variable, or the path to an S3 bucket. The + // bucket must be in the same AWS Region as the build project. Specify the buildspec + // file using its ARN (for example, arn:aws:s3:::my-codebuild-sample2/buildspec.yml). + // If this value is not provided or is set to an empty string, the source code + // must contain a buildspec file in its root directory. For more information, + // see Buildspec File Name and Storage Location (https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-name-storage). + Buildspec *string `locationName:"buildspec" type:"string"` + + // Information about the Git clone depth for the build project. + GitCloneDepth *int64 `locationName:"gitCloneDepth" type:"integer"` + + // Information about the Git submodules configuration for the build project. + GitSubmodulesConfig *GitSubmodulesConfig `locationName:"gitSubmodulesConfig" type:"structure"` + + // Enable this flag to ignore SSL warnings while connecting to the project source + // code. + InsecureSsl *bool `locationName:"insecureSsl" type:"boolean"` + + // Information about the location of the source code to be built. Valid values + // include: // - // * If type is set to S3, this is the name of the output artifact object. - // If you set the name to be a forward slash ("/"), the artifact is stored - // in the root of the output bucket. + // * 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 ignores it. This is because AWS CodePipeline + // uses the settings in a pipeline's source action instead of this value. // - // For example: + // * For source code in an AWS CodeCommit repository, the HTTPS clone URL + // to the repository that contains the source code and the buildspec file + // (for example, https://git-codecommit.region-ID.amazonaws.com/v1/repos/repo-name + // ). // - // * If path is set to MyArtifacts, namespaceType is set to BUILD_ID, and - // name is set to MyArtifact.zip, then the output artifact is stored in MyArtifacts/build-ID/MyArtifact.zip. + // * For source code in an Amazon Simple Storage Service (Amazon S3) input + // bucket, one of the following. The path to the ZIP file that contains the + // source code (for example, bucket-name/path/to/object-name.zip). The path + // to the folder that contains the source code (for example, bucket-name/path/to/source-code/folder/). // - // * If path is empty, namespaceType is set to NONE, and name is set to "/", - // the output artifact is stored in the root of the output bucket. + // * For source code in a GitHub repository, the HTTPS clone URL to the repository + // that contains the source and the buildspec file. You must connect your + // AWS account to your GitHub account. Use the AWS CodeBuild console to start + // creating a build project. When you use the console to connect (or reconnect) + // with GitHub, on the GitHub Authorize application page, for Organization + // access, choose Request access next to each repository you want to allow + // AWS CodeBuild to have access to, and then choose Authorize application. + // (After you have connected to your GitHub account, you do not need to finish + // creating the build project. You can leave the AWS CodeBuild console.) + // To instruct AWS CodeBuild to use this connection, in the source object, + // set the auth object's type value to OAUTH. // - // * If path is set to MyArtifacts, namespaceType is set to BUILD_ID, and - // name is set to "/", the output artifact is stored in MyArtifacts/build-ID . - Name *string `locationName:"name" type:"string"` + // * For source code in a Bitbucket repository, the HTTPS clone URL to the + // repository that contains the source and the buildspec file. You must connect + // your AWS account to your Bitbucket account. Use the AWS CodeBuild console + // to start creating a build project. When you use the console to connect + // (or reconnect) with Bitbucket, on the Bitbucket Confirm access to your + // account page, choose Grant access. (After you have connected to your Bitbucket + // account, you do not need to finish creating the build project. You can + // leave the AWS CodeBuild console.) To instruct AWS CodeBuild to use this + // connection, in the source object, set the auth object's type value to + // OAUTH. + Location *string `locationName:"location" type:"string"` - // Along with path and name, the pattern that AWS CodeBuild uses to determine - // the name and location to store the output artifact: - // - // * If type is set to CODEPIPELINE, AWS CodePipeline ignores 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, this value is ignored if specified, - // because no build output is produced. - // - // * If type is set to S3, 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. + // Set to true to report the status of a build's start and finish to your source + // provider. This option is valid only when your source provider is GitHub, + // GitHub Enterprise, or Bitbucket. If this is set and you use a different source + // provider, an invalidInputException is thrown. // - // For example, if path is set to MyArtifacts, namespaceType is set to BUILD_ID, - // and name is set to MyArtifact.zip, the output artifact is stored in MyArtifacts/build-ID/MyArtifact.zip. - NamespaceType *string `locationName:"namespaceType" type:"string" enum:"ArtifactNamespace"` - - // If this flag is set, a name specified in the build spec file overrides the - // artifact name. The name specified in a build spec file is calculated at build - // time and uses the Shell Command Language. For example, you can append a date - // and time to your artifact name so that it is always unique. - OverrideArtifactName *bool `locationName:"overrideArtifactName" type:"boolean"` + // The status of a build triggered by a webhook is always reported to your source + // provider. + ReportBuildStatus *bool `locationName:"reportBuildStatus" type:"boolean"` - // The type of build output artifact to create: - // - // * If type is set to CODEPIPELINE, AWS CodePipeline ignores 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, this value is ignored if specified, - // because no build output is produced. - // - // * If type is set to S3, valid values include: NONE: AWS CodeBuild creates - // in the output bucket a folder that contains the build output. This is - // the default if packaging is not specified. ZIP: AWS CodeBuild creates - // in the output bucket a ZIP file that contains the build output. - Packaging *string `locationName:"packaging" type:"string" enum:"ArtifactPackaging"` + // An identifier for this project source. + SourceIdentifier *string `locationName:"sourceIdentifier" type:"string"` - // Along with namespaceType and name, the pattern that AWS CodeBuild uses to - // name and store the output artifact: + // The type of repository that contains the source code to be built. Valid values + // include: // - // * If type is set to CODEPIPELINE, AWS CodePipeline ignores this value - // if specified. This is because AWS CodePipeline manages its build output - // names instead of AWS CodeBuild. + // * BITBUCKET: The source code is in a Bitbucket repository. // - // * If type is set to NO_ARTIFACTS, this value is ignored if specified, - // because no build output is produced. + // * CODECOMMIT: The source code is in an AWS CodeCommit repository. // - // * If type is set to S3, this is the path to the output artifact. If path - // is not specified, path is not used. + // * CODEPIPELINE: The source code settings are specified in the source action + // of a pipeline in AWS CodePipeline. // - // For example, if path is set to MyArtifacts, namespaceType is set to NONE, - // and name is set to MyArtifact.zip, the output artifact is stored in the output - // bucket at MyArtifacts/MyArtifact.zip. - Path *string `locationName:"path" type:"string"` - - // The type of build output artifact. Valid values include: + // * GITHUB: The source code is in a GitHub repository. // - // * CODEPIPELINE: The build project has build output generated through AWS - // CodePipeline. + // * GITHUB_ENTERPRISE: The source code is in a GitHub Enterprise repository. // - // * NO_ARTIFACTS: The build project does not produce any build output. + // * NO_SOURCE: The project does not have input source code. // - // * S3: The build project stores build output in Amazon Simple Storage Service - // (Amazon S3). + // * 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:"ArtifactsType"` + Type *string `locationName:"type" type:"string" required:"true" enum:"SourceType"` } // String returns the string representation -func (s ProjectArtifacts) String() string { +func (s ProjectSource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ProjectArtifacts) GoString() string { +func (s ProjectSource) 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"} +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 s.GitSubmodulesConfig != nil { + if err := s.GitSubmodulesConfig.Validate(); err != nil { + invalidParams.AddNested("GitSubmodulesConfig", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -4394,165 +7709,269 @@ func (s *ProjectArtifacts) Validate() error { return nil } -// SetArtifactIdentifier sets the ArtifactIdentifier field's value. -func (s *ProjectArtifacts) SetArtifactIdentifier(v string) *ProjectArtifacts { - s.ArtifactIdentifier = &v +// SetAuth sets the Auth field's value. +func (s *ProjectSource) SetAuth(v *SourceAuth) *ProjectSource { + s.Auth = v return s } -// SetEncryptionDisabled sets the EncryptionDisabled field's value. -func (s *ProjectArtifacts) SetEncryptionDisabled(v bool) *ProjectArtifacts { - s.EncryptionDisabled = &v +// 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 *ProjectArtifacts) SetLocation(v string) *ProjectArtifacts { - s.Location = &v +// SetGitCloneDepth sets the GitCloneDepth field's value. +func (s *ProjectSource) SetGitCloneDepth(v int64) *ProjectSource { + s.GitCloneDepth = &v return s } -// SetName sets the Name field's value. -func (s *ProjectArtifacts) SetName(v string) *ProjectArtifacts { - s.Name = &v +// SetGitSubmodulesConfig sets the GitSubmodulesConfig field's value. +func (s *ProjectSource) SetGitSubmodulesConfig(v *GitSubmodulesConfig) *ProjectSource { + s.GitSubmodulesConfig = v return s } -// SetNamespaceType sets the NamespaceType field's value. -func (s *ProjectArtifacts) SetNamespaceType(v string) *ProjectArtifacts { - s.NamespaceType = &v +// SetInsecureSsl sets the InsecureSsl field's value. +func (s *ProjectSource) SetInsecureSsl(v bool) *ProjectSource { + s.InsecureSsl = &v return s } -// SetOverrideArtifactName sets the OverrideArtifactName field's value. -func (s *ProjectArtifacts) SetOverrideArtifactName(v bool) *ProjectArtifacts { - s.OverrideArtifactName = &v +// SetLocation sets the Location field's value. +func (s *ProjectSource) SetLocation(v string) *ProjectSource { + s.Location = &v return s } -// SetPackaging sets the Packaging field's value. -func (s *ProjectArtifacts) SetPackaging(v string) *ProjectArtifacts { - s.Packaging = &v +// SetReportBuildStatus sets the ReportBuildStatus field's value. +func (s *ProjectSource) SetReportBuildStatus(v bool) *ProjectSource { + s.ReportBuildStatus = &v return s } -// SetPath sets the Path field's value. -func (s *ProjectArtifacts) SetPath(v string) *ProjectArtifacts { - s.Path = &v +// SetSourceIdentifier sets the SourceIdentifier field's value. +func (s *ProjectSource) SetSourceIdentifier(v string) *ProjectSource { + s.SourceIdentifier = &v return s } // SetType sets the Type field's value. -func (s *ProjectArtifacts) SetType(v string) *ProjectArtifacts { +func (s *ProjectSource) SetType(v string) *ProjectSource { s.Type = &v return s } -// Information about the build badge for the build project. -type ProjectBadge struct { +// A source identifier and its corresponding version. +type ProjectSourceVersion struct { _ struct{} `type:"structure"` - // Set this to true to generate a publicly accessible URL for your project's - // build badge. - BadgeEnabled *bool `locationName:"badgeEnabled" type:"boolean"` + // An identifier for a source in the build project. + // + // SourceIdentifier is a required field + SourceIdentifier *string `locationName:"sourceIdentifier" type:"string" required:"true"` - // The publicly-accessible URL through which you can access the build badge - // for your project. + // The source version for the corresponding source identifier. If specified, + // must be one of: // - // The publicly accessible URL through which you can access the build badge - // for your project. - BadgeRequestUrl *string `locationName:"badgeRequestUrl" type:"string"` + // * For AWS CodeCommit: the commit ID, branch, or Git tag to use. + // + // * For GitHub: the commit ID, pull request ID, branch name, or tag name + // that corresponds to the version of the source code you want to build. + // If a pull request ID is specified, it must use the format pr/pull-request-ID + // (for example, pr/25). If a branch name is specified, the branch's HEAD + // commit ID is used. If not specified, the default branch's HEAD commit + // ID is used. + // + // * For Bitbucket: the commit ID, branch name, or tag name that corresponds + // to the version of the source code you want to build. If a branch name + // is specified, the branch's HEAD commit ID is used. If not specified, the + // default branch's HEAD commit ID is used. + // + // * For Amazon Simple Storage Service (Amazon S3): the version ID of the + // object that represents the build input ZIP file to use. + // + // For more information, see Source Version Sample with CodeBuild (https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html) + // in the AWS CodeBuild User Guide. + // + // SourceVersion is a required field + SourceVersion *string `locationName:"sourceVersion" type:"string" required:"true"` } // String returns the string representation -func (s ProjectBadge) String() string { +func (s ProjectSourceVersion) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ProjectBadge) GoString() string { +func (s ProjectSourceVersion) GoString() string { return s.String() } -// SetBadgeEnabled sets the BadgeEnabled field's value. -func (s *ProjectBadge) SetBadgeEnabled(v bool) *ProjectBadge { - s.BadgeEnabled = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *ProjectSourceVersion) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProjectSourceVersion"} + if s.SourceIdentifier == nil { + invalidParams.Add(request.NewErrParamRequired("SourceIdentifier")) + } + if s.SourceVersion == nil { + invalidParams.Add(request.NewErrParamRequired("SourceVersion")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSourceIdentifier sets the SourceIdentifier field's value. +func (s *ProjectSourceVersion) SetSourceIdentifier(v string) *ProjectSourceVersion { + s.SourceIdentifier = &v return s } -// SetBadgeRequestUrl sets the BadgeRequestUrl field's value. -func (s *ProjectBadge) SetBadgeRequestUrl(v string) *ProjectBadge { - s.BadgeRequestUrl = &v +// SetSourceVersion sets the SourceVersion field's value. +func (s *ProjectSourceVersion) SetSourceVersion(v string) *ProjectSourceVersion { + s.SourceVersion = &v return s } -// Information about the cache for the build project. -type ProjectCache struct { +type PutResourcePolicyInput struct { _ struct{} `type:"structure"` - // Information about the cache location: - // - // * NO_CACHE or LOCAL: This value is ignored. + // A JSON-formatted resource policy. For more information, see Sharing a Project + // (https://docs.aws.amazon.com/codebuild/latest/userguide/project-sharing.html#project-sharing-share) + // and Sharing a Report Group (https://docs.aws.amazon.com/codebuild/latest/userguide/report-groups-sharing.html#report-groups-sharing-share) + // in the AWS CodeBuild User Guide. // - // * S3: This is the S3 bucket name/prefix. - Location *string `locationName:"location" type:"string"` + // Policy is a required field + Policy *string `locationName:"policy" min:"1" type:"string" required:"true"` - // If you use a LOCAL cache, the local cache mode. You can use one or more local - // cache modes at the same time. - // - // * LOCAL_SOURCE_CACHE mode caches Git metadata for primary and secondary - // sources. After the cache is created, subsequent builds pull only the change - // between commits. This mode is a good choice for projects with a clean - // working directory and a source that is a large Git repository. If you - // choose this option and your project does not use a Git repository (GitHub, - // GitHub Enterprise, or Bitbucket), the option is ignored. - // - // * LOCAL_DOCKER_LAYER_CACHE mode caches existing Docker layers. This mode - // is a good choice for projects that build or pull large Docker images. - // It can prevent the performance issues caused by pulling large Docker images - // down from the network. You can use a Docker layer cache in the Linux environment - // only. The privileged flag must be set so that your project has the required - // Docker permissions. You should consider the security implications before - // you use a Docker layer cache. + // The ARN of the Project or ReportGroup resource you want to associate with + // a resource policy. // - // * LOCAL_CUSTOM_CACHE mode caches directories you specify in the buildspec - // file. This mode is a good choice if your build scenario is not suited - // to one of the other three local cache modes. If you use a custom cache: - // Only directories can be specified for caching. You cannot specify individual - // files. Symlinks are used to reference cached directories. Cached directories - // are linked to your build before it downloads its project sources. Cached - // items are overriden if a source item has the same name. Directories are - // specified using cache paths in the buildspec file. - Modes []*string `locationName:"modes" type:"list"` + // ResourceArn is a required field + ResourceArn *string `locationName:"resourceArn" min:"1" type:"string" required:"true"` +} - // The type of cache used by the build project. Valid values include: - // - // * NO_CACHE: The build project does not use any cache. +// String returns the string representation +func (s PutResourcePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutResourcePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutResourcePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutResourcePolicyInput"} + 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.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 +} + +// SetPolicy sets the Policy field's value. +func (s *PutResourcePolicyInput) SetPolicy(v string) *PutResourcePolicyInput { + s.Policy = &v + return s +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *PutResourcePolicyInput) SetResourceArn(v string) *PutResourcePolicyInput { + s.ResourceArn = &v + return s +} + +type PutResourcePolicyOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the Project or ReportGroup resource that is associated with a + // resource policy. + ResourceArn *string `locationName:"resourceArn" min:"1" type:"string"` +} + +// String returns the string representation +func (s PutResourcePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutResourcePolicyOutput) GoString() string { + return s.String() +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *PutResourcePolicyOutput) SetResourceArn(v string) *PutResourcePolicyOutput { + s.ResourceArn = &v + return s +} + +// Information about credentials that provide access to a private Docker registry. +// When this is set: +// +// * imagePullCredentialsType must be set to SERVICE_ROLE. +// +// * images cannot be curated or an Amazon ECR image. +// +// For more information, see Private Registry with AWS Secrets Manager Sample +// for AWS CodeBuild (https://docs.aws.amazon.com/codebuild/latest/userguide/sample-private-registry.html). +type RegistryCredential struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) or name of credentials created using AWS Secrets + // Manager. // - // * S3: The build project reads and writes from and to S3. + // The credential can use the name of the credentials only if they exist in + // your current AWS Region. // - // * LOCAL: The build project stores a cache locally on a build host that - // is only available to that build host. + // Credential is a required field + Credential *string `locationName:"credential" min:"1" type:"string" required:"true"` + + // The service that created the credentials to access a private Docker registry. + // The valid value, SECRETS_MANAGER, is for AWS Secrets Manager. // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"CacheType"` + // CredentialProvider is a required field + CredentialProvider *string `locationName:"credentialProvider" type:"string" required:"true" enum:"CredentialProviderType"` } // String returns the string representation -func (s ProjectCache) String() string { +func (s RegistryCredential) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ProjectCache) GoString() string { +func (s RegistryCredential) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ProjectCache) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProjectCache"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) +func (s *RegistryCredential) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RegistryCredential"} + if s.Credential == nil { + invalidParams.Add(request.NewErrParamRequired("Credential")) + } + if s.Credential != nil && len(*s.Credential) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Credential", 1)) + } + if s.CredentialProvider == nil { + invalidParams.Add(request.NewErrParamRequired("CredentialProvider")) } if invalidParams.Len() > 0 { @@ -4561,326 +7980,170 @@ func (s *ProjectCache) Validate() error { return nil } -// SetLocation sets the Location field's value. -func (s *ProjectCache) SetLocation(v string) *ProjectCache { - s.Location = &v - return s -} - -// SetModes sets the Modes field's value. -func (s *ProjectCache) SetModes(v []*string) *ProjectCache { - s.Modes = v +// SetCredential sets the Credential field's value. +func (s *RegistryCredential) SetCredential(v string) *RegistryCredential { + s.Credential = &v return s } -// SetType sets the Type field's value. -func (s *ProjectCache) SetType(v string) *ProjectCache { - s.Type = &v +// SetCredentialProvider sets the CredentialProvider field's value. +func (s *RegistryCredential) SetCredentialProvider(v string) *RegistryCredential { + s.CredentialProvider = &v return s } -// Information about the build environment of the build project. -type ProjectEnvironment struct { +// Information about the results from running a series of test cases during +// the run of a build project. The test cases are specified in the buildspec +// for the build project using one or more paths to the test case files. You +// can specify any type of tests you want, such as unit tests, integration tests, +// and functional tests. +type Report struct { _ struct{} `type:"structure"` - // The certificate to use with this build project. - Certificate *string `locationName:"certificate" type:"string"` + // The ARN of the report run. + Arn *string `locationName:"arn" min:"1" type:"string"` - // Information about the compute resources the build project uses. 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"` + // The date and time this report run occurred. + Created *time.Time `locationName:"created" type:"timestamp"` - // A set of environment variables to make available to builds for this build - // project. - EnvironmentVariables []*EnvironmentVariable `locationName:"environmentVariables" type:"list"` + // The ARN of the build run that generated this report. + ExecutionId *string `locationName:"executionId" type:"string"` - // The image tag or image digest that identifies the Docker image to use for - // this build project. Use the following formats: - // - // * For an image tag: registry/repository:tag. For example, to specify an - // image with the tag "latest," use registry/repository:latest. - // - // * For an image digest: registry/repository@digest. For example, to specify - // an image with the digest "sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf," - // use registry/repository@sha256:cbbf2f9a99b47fc460d422812b6a5adff7dfee951d8fa2e4a98caa0382cfbdbf. - // - // Image is a required field - Image *string `locationName:"image" min:"1" type:"string" required:"true"` + // The date and time a report expires. A report expires 30 days after it is + // created. An expired report is not available to view in CodeBuild. + Expired *time.Time `locationName:"expired" type:"timestamp"` - // The type of credentials AWS CodeBuild uses to pull images in your build. - // There are two valid values: - // - // * CODEBUILD specifies that AWS CodeBuild uses its own credentials. This - // requires that you modify your ECR repository policy to trust AWS CodeBuild's - // service principal. - // - // * SERVICE_ROLE specifies that AWS CodeBuild uses your build project's - // service role. - // - // When you use a cross-account or private registry image, you must use SERVICE_ROLE - // credentials. When you use an AWS CodeBuild curated image, you must use CODEBUILD - // credentials. - ImagePullCredentialsType *string `locationName:"imagePullCredentialsType" type:"string" enum:"ImagePullCredentialsType"` + // Information about where the raw data used to generate this report was exported. + ExportConfig *ReportExportConfig `locationName:"exportConfig" type:"structure"` - // Enables running the Docker daemon inside a Docker container. Set to true - // only if the build project is used to build Docker images. Otherwise, a build - // that attempts to interact with the Docker daemon fails. - // - // You can initialize the Docker daemon during the install phase of your build - // by adding one of the following sets of commands to the install phase of your - // buildspec file: - // - // If the operating system's base image is Ubuntu Linux: - // - // - nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 - // --storage-driver=overlay& - // - // - timeout 15 sh -c "until docker info; do echo .; sleep 1; done" - // - // If the operating system's base image is Alpine Linux and the previous command - // does not work, add the -t argument to timeout: - // - // - nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://0.0.0.0:2375 - // --storage-driver=overlay& - // - // - timeout -t 15 sh -c "until docker info; do echo .; sleep 1; done" - PrivilegedMode *bool `locationName:"privilegedMode" type:"boolean"` + // The name of the report that was run. + Name *string `locationName:"name" type:"string"` - // The credentials for access to a private registry. - RegistryCredential *RegistryCredential `locationName:"registryCredential" type:"structure"` + // The ARN of the report group associated with this report. + ReportGroupArn *string `locationName:"reportGroupArn" min:"1" type:"string"` - // 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"` + // The status of this report. + Status *string `locationName:"status" type:"string" enum:"ReportStatusType"` + + // A TestReportSummary object that contains information about this test report. + TestSummary *TestReportSummary `locationName:"testSummary" type:"structure"` + + // A boolean that specifies if this report run is truncated. The list of test + // cases is truncated after the maximum number of test cases is reached. + Truncated *bool `locationName:"truncated" type:"boolean"` + + // The type of the report that was run. + Type *string `locationName:"type" type:"string" enum:"ReportType"` } // String returns the string representation -func (s ProjectEnvironment) String() string { +func (s Report) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ProjectEnvironment) GoString() string { +func (s Report) 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 s.RegistryCredential != nil { - if err := s.RegistryCredential.Validate(); err != nil { - invalidParams.AddNested("RegistryCredential", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetArn sets the Arn field's value. +func (s *Report) SetArn(v string) *Report { + s.Arn = &v + return s } -// SetCertificate sets the Certificate field's value. -func (s *ProjectEnvironment) SetCertificate(v string) *ProjectEnvironment { - s.Certificate = &v +// SetCreated sets the Created field's value. +func (s *Report) SetCreated(v time.Time) *Report { + s.Created = &v return s } -// SetComputeType sets the ComputeType field's value. -func (s *ProjectEnvironment) SetComputeType(v string) *ProjectEnvironment { - s.ComputeType = &v +// SetExecutionId sets the ExecutionId field's value. +func (s *Report) SetExecutionId(v string) *Report { + s.ExecutionId = &v return s } -// SetEnvironmentVariables sets the EnvironmentVariables field's value. -func (s *ProjectEnvironment) SetEnvironmentVariables(v []*EnvironmentVariable) *ProjectEnvironment { - s.EnvironmentVariables = v +// SetExpired sets the Expired field's value. +func (s *Report) SetExpired(v time.Time) *Report { + s.Expired = &v return s } -// SetImage sets the Image field's value. -func (s *ProjectEnvironment) SetImage(v string) *ProjectEnvironment { - s.Image = &v +// SetExportConfig sets the ExportConfig field's value. +func (s *Report) SetExportConfig(v *ReportExportConfig) *Report { + s.ExportConfig = v return s } -// SetImagePullCredentialsType sets the ImagePullCredentialsType field's value. -func (s *ProjectEnvironment) SetImagePullCredentialsType(v string) *ProjectEnvironment { - s.ImagePullCredentialsType = &v +// SetName sets the Name field's value. +func (s *Report) SetName(v string) *Report { + s.Name = &v return s } -// SetPrivilegedMode sets the PrivilegedMode field's value. -func (s *ProjectEnvironment) SetPrivilegedMode(v bool) *ProjectEnvironment { - s.PrivilegedMode = &v +// SetReportGroupArn sets the ReportGroupArn field's value. +func (s *Report) SetReportGroupArn(v string) *Report { + s.ReportGroupArn = &v return s } -// SetRegistryCredential sets the RegistryCredential field's value. -func (s *ProjectEnvironment) SetRegistryCredential(v *RegistryCredential) *ProjectEnvironment { - s.RegistryCredential = v +// SetStatus sets the Status field's value. +func (s *Report) SetStatus(v string) *Report { + s.Status = &v return s } -// SetType sets the Type field's value. -func (s *ProjectEnvironment) SetType(v string) *ProjectEnvironment { - s.Type = &v +// SetTestSummary sets the TestSummary field's value. +func (s *Report) SetTestSummary(v *TestReportSummary) *Report { + s.TestSummary = v return s } -// Information about the build input source code for the build project. -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. - 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 Git clone depth for the build project. - GitCloneDepth *int64 `locationName:"gitCloneDepth" type:"integer"` - - // Information about the Git submodules configuration for the build project. - GitSubmodulesConfig *GitSubmodulesConfig `locationName:"gitSubmodulesConfig" type:"structure"` - - // Enable this flag to ignore SSL warnings while connecting to the project source - // code. - InsecureSsl *bool `locationName:"insecureSsl" type:"boolean"` - - // 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 ignores 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, one of the following. The path to the ZIP file that contains the - // source code (for example, bucket-name/path/to/object-name.zip). The path - // to the folder that contains the source code (for example, bucket-name/path/to/source-code/folder/). - // - // * For source code in a GitHub repository, the HTTPS clone URL to the repository - // that contains the source and the build spec. You must connect your AWS - // account to your GitHub account. Use the AWS CodeBuild console to start - // creating a build project. When you use the console to connect (or reconnect) - // with GitHub, on the GitHub Authorize application page, for Organization - // access, choose Request access next to each repository you want to allow - // AWS CodeBuild to have access to, and then choose Authorize application. - // (After you have connected to your GitHub account, you do not need to finish - // creating the build project. You can leave the AWS CodeBuild console.) - // To instruct AWS CodeBuild to use this connection, in the source object, - // set the auth object's type value to OAUTH. - // - // * For source code in a Bitbucket repository, the HTTPS clone URL to the - // repository that contains the source and the build spec. You must connect - // your AWS account to your Bitbucket account. Use the AWS CodeBuild console - // to start creating a build project. When you use the console to connect - // (or reconnect) with Bitbucket, on the Bitbucket Confirm access to your - // account page, choose Grant access. (After you have connected to your Bitbucket - // account, you do not need to finish creating the build project. You can - // leave the AWS CodeBuild console.) To instruct AWS CodeBuild to use this - // connection, in the source object, set the auth object's type value to - // OAUTH. - Location *string `locationName:"location" type:"string"` +// SetTruncated sets the Truncated field's value. +func (s *Report) SetTruncated(v bool) *Report { + s.Truncated = &v + return s +} - // Set to true to report the status of a build's start and finish to your source - // provider. This option is valid only when your source provider is GitHub, - // GitHub Enterprise, or Bitbucket. If this is set and you use a different source - // provider, an invalidInputException is thrown. - ReportBuildStatus *bool `locationName:"reportBuildStatus" type:"boolean"` +// SetType sets the Type field's value. +func (s *Report) SetType(v string) *Report { + s.Type = &v + return s +} - // An identifier for this project source. - SourceIdentifier *string `locationName:"sourceIdentifier" type:"string"` +// Information about the location where the run of a report is exported. +type ReportExportConfig struct { + _ struct{} `type:"structure"` - // The type of repository that contains the source code to be built. Valid values - // include: - // - // * BITBUCKET: The source code is in a Bitbucket repository. - // - // * 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. - // - // * NO_SOURCE: The project does not have input source code. + // The export configuration type. Valid values are: // - // * S3: The source code is in an Amazon Simple Storage Service (Amazon S3) - // input bucket. + // * S3: The report results are exported to an S3 bucket. // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"SourceType"` + // * NO_EXPORT: The report results are not exported. + ExportConfigType *string `locationName:"exportConfigType" type:"string" enum:"ReportExportConfigType"` + + // A S3ReportExportConfig object that contains information about the S3 bucket + // where the run of a report is exported. + S3Destination *S3ReportExportConfig `locationName:"s3Destination" type:"structure"` } // String returns the string representation -func (s ProjectSource) String() string { +func (s ReportExportConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ProjectSource) GoString() string { +func (s ReportExportConfig) 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 s.GitSubmodulesConfig != nil { - if err := s.GitSubmodulesConfig.Validate(); err != nil { - invalidParams.AddNested("GitSubmodulesConfig", err.(request.ErrInvalidParams)) +func (s *ReportExportConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReportExportConfig"} + if s.S3Destination != nil { + if err := s.S3Destination.Validate(); err != nil { + invalidParams.AddNested("S3Destination", err.(request.ErrInvalidParams)) } } @@ -4890,183 +8153,267 @@ func (s *ProjectSource) Validate() error { return nil } -// SetAuth sets the Auth field's value. -func (s *ProjectSource) SetAuth(v *SourceAuth) *ProjectSource { - s.Auth = v +// SetExportConfigType sets the ExportConfigType field's value. +func (s *ReportExportConfig) SetExportConfigType(v string) *ReportExportConfig { + s.ExportConfigType = &v return s } -// SetBuildspec sets the Buildspec field's value. -func (s *ProjectSource) SetBuildspec(v string) *ProjectSource { - s.Buildspec = &v +// SetS3Destination sets the S3Destination field's value. +func (s *ReportExportConfig) SetS3Destination(v *S3ReportExportConfig) *ReportExportConfig { + s.S3Destination = v return s } -// SetGitCloneDepth sets the GitCloneDepth field's value. -func (s *ProjectSource) SetGitCloneDepth(v int64) *ProjectSource { - s.GitCloneDepth = &v +// A filter used to return reports with the status specified by the input status +// parameter. +type ReportFilter struct { + _ struct{} `type:"structure"` + + // The status used to filter reports. You can filter using one status only. + Status *string `locationName:"status" type:"string" enum:"ReportStatusType"` +} + +// String returns the string representation +func (s ReportFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReportFilter) GoString() string { + return s.String() +} + +// SetStatus sets the Status field's value. +func (s *ReportFilter) SetStatus(v string) *ReportFilter { + s.Status = &v return s } -// SetGitSubmodulesConfig sets the GitSubmodulesConfig field's value. -func (s *ProjectSource) SetGitSubmodulesConfig(v *GitSubmodulesConfig) *ProjectSource { - s.GitSubmodulesConfig = v +// A series of reports. Each report contains information about the results from +// running a series of test cases. You specify the test cases for a report group +// in the buildspec for a build project using one or more paths to the test +// case files. +type ReportGroup struct { + _ struct{} `type:"structure"` + + // The ARN of a ReportGroup. + Arn *string `locationName:"arn" min:"1" type:"string"` + + // The date and time this ReportGroup was created. + Created *time.Time `locationName:"created" type:"timestamp"` + + // Information about the destination where the raw data of this ReportGroup + // is exported. + ExportConfig *ReportExportConfig `locationName:"exportConfig" type:"structure"` + + // The date and time this ReportGroup was last modified. + LastModified *time.Time `locationName:"lastModified" type:"timestamp"` + + // The name of a ReportGroup. + Name *string `locationName:"name" min:"2" type:"string"` + + // The type of the ReportGroup. The one valid value is TEST. + Type *string `locationName:"type" type:"string" enum:"ReportType"` +} + +// String returns the string representation +func (s ReportGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReportGroup) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *ReportGroup) SetArn(v string) *ReportGroup { + s.Arn = &v return s } -// SetInsecureSsl sets the InsecureSsl field's value. -func (s *ProjectSource) SetInsecureSsl(v bool) *ProjectSource { - s.InsecureSsl = &v +// SetCreated sets the Created field's value. +func (s *ReportGroup) SetCreated(v time.Time) *ReportGroup { + s.Created = &v return s } -// SetLocation sets the Location field's value. -func (s *ProjectSource) SetLocation(v string) *ProjectSource { - s.Location = &v +// SetExportConfig sets the ExportConfig field's value. +func (s *ReportGroup) SetExportConfig(v *ReportExportConfig) *ReportGroup { + s.ExportConfig = v return s } -// SetReportBuildStatus sets the ReportBuildStatus field's value. -func (s *ProjectSource) SetReportBuildStatus(v bool) *ProjectSource { - s.ReportBuildStatus = &v +// SetLastModified sets the LastModified field's value. +func (s *ReportGroup) SetLastModified(v time.Time) *ReportGroup { + s.LastModified = &v return s } -// SetSourceIdentifier sets the SourceIdentifier field's value. -func (s *ProjectSource) SetSourceIdentifier(v string) *ProjectSource { - s.SourceIdentifier = &v +// SetName sets the Name field's value. +func (s *ReportGroup) SetName(v string) *ReportGroup { + s.Name = &v return s } // SetType sets the Type field's value. -func (s *ProjectSource) SetType(v string) *ProjectSource { +func (s *ReportGroup) SetType(v string) *ReportGroup { s.Type = &v return s } -// A source identifier and its corresponding version. -type ProjectSourceVersion struct { - _ struct{} `type:"structure"` - - // An identifier for a source in the build project. - // - // SourceIdentifier is a required field - SourceIdentifier *string `locationName:"sourceIdentifier" type:"string" required:"true"` +// The specified AWS resource cannot be created, because an AWS resource with +// the same settings already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The source version for the corresponding source identifier. If specified, - // must be one of: - // - // * For AWS CodeCommit: the commit ID to use. - // - // * For GitHub: the commit ID, pull request ID, branch name, or tag name - // that corresponds to the version of the source code you want to build. - // If a pull request ID is specified, it must use the format pr/pull-request-ID - // (for example, pr/25). If a branch name is specified, the branch's HEAD - // commit ID is used. If not specified, the default branch's HEAD commit - // ID is used. - // - // * For Bitbucket: the commit ID, branch name, or tag name that corresponds - // to the version of the source code you want to build. If a branch name - // is specified, the branch's HEAD commit ID is used. If not specified, the - // default branch's HEAD commit ID is used. - // - // * For Amazon Simple Storage Service (Amazon S3): the version ID of the - // object that represents the build input ZIP file to use. - // - // For more information, see Source Version Sample with CodeBuild (https://docs.aws.amazon.com/codebuild/latest/userguide/sample-source-version.html) - // in the AWS CodeBuild User Guide. - // - // SourceVersion is a required field - SourceVersion *string `locationName:"sourceVersion" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ProjectSourceVersion) String() string { +func (s ResourceAlreadyExistsException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ProjectSourceVersion) GoString() string { +func (s ResourceAlreadyExistsException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ProjectSourceVersion) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProjectSourceVersion"} - if s.SourceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceIdentifier")) +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, } - if s.SourceVersion == nil { - invalidParams.Add(request.NewErrParamRequired("SourceVersion")) +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} - if invalidParams.Len() > 0 { - return invalidParams +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified AWS resource cannot be found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { return nil } -// SetSourceIdentifier sets the SourceIdentifier field's value. -func (s *ProjectSourceVersion) SetSourceIdentifier(v string) *ProjectSourceVersion { - s.SourceIdentifier = &v - return s +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetSourceVersion sets the SourceVersion field's value. -func (s *ProjectSourceVersion) SetSourceVersion(v string) *ProjectSourceVersion { - s.SourceVersion = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode } -// Information about credentials that provide access to a private Docker registry. -// When this is set: -// -// * imagePullCredentialsType must be set to SERVICE_ROLE. -// -// * images cannot be curated or an Amazon ECR image. -// -// For more information, see Private Registry with AWS Secrets Manager Sample -// for AWS CodeBuild (https://docs.aws.amazon.com/codebuild/latest/userguide/sample-private-registry.html). -type RegistryCredential struct { +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about S3 logs for a build project. +type S3LogsConfig struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) or name of credentials created using AWS Secrets - // Manager. + // Set to true if you do not want your S3 build log output encrypted. By default + // S3 build logs are encrypted. + EncryptionDisabled *bool `locationName:"encryptionDisabled" type:"boolean"` + + // The ARN of an S3 bucket and the path prefix for S3 logs. If your Amazon S3 + // bucket name is my-bucket, and your path prefix is build-log, then acceptable + // formats are my-bucket/build-log or arn:aws:s3:::my-bucket/build-log. + Location *string `locationName:"location" type:"string"` + + // The current status of the S3 build logs. Valid values are: // - // The credential can use the name of the credentials only if they exist in - // your current region. + // * ENABLED: S3 build logs are enabled for this build project. // - // Credential is a required field - Credential *string `locationName:"credential" min:"1" type:"string" required:"true"` - - // The service that created the credentials to access a private Docker registry. - // The valid value, SECRETS_MANAGER, is for AWS Secrets Manager. + // * DISABLED: S3 build logs are not enabled for this build project. // - // CredentialProvider is a required field - CredentialProvider *string `locationName:"credentialProvider" type:"string" required:"true" enum:"CredentialProviderType"` + // Status is a required field + Status *string `locationName:"status" type:"string" required:"true" enum:"LogsConfigStatusType"` } // String returns the string representation -func (s RegistryCredential) String() string { +func (s S3LogsConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RegistryCredential) GoString() string { +func (s S3LogsConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *RegistryCredential) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegistryCredential"} - if s.Credential == nil { - invalidParams.Add(request.NewErrParamRequired("Credential")) - } - if s.Credential != nil && len(*s.Credential) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Credential", 1)) - } - if s.CredentialProvider == nil { - invalidParams.Add(request.NewErrParamRequired("CredentialProvider")) +func (s *S3LogsConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "S3LogsConfig"} + if s.Status == nil { + invalidParams.Add(request.NewErrParamRequired("Status")) } if invalidParams.Len() > 0 { @@ -5075,56 +8422,68 @@ func (s *RegistryCredential) Validate() error { return nil } -// SetCredential sets the Credential field's value. -func (s *RegistryCredential) SetCredential(v string) *RegistryCredential { - s.Credential = &v +// SetEncryptionDisabled sets the EncryptionDisabled field's value. +func (s *S3LogsConfig) SetEncryptionDisabled(v bool) *S3LogsConfig { + s.EncryptionDisabled = &v + return s +} + +// SetLocation sets the Location field's value. +func (s *S3LogsConfig) SetLocation(v string) *S3LogsConfig { + s.Location = &v return s } -// SetCredentialProvider sets the CredentialProvider field's value. -func (s *RegistryCredential) SetCredentialProvider(v string) *RegistryCredential { - s.CredentialProvider = &v +// SetStatus sets the Status field's value. +func (s *S3LogsConfig) SetStatus(v string) *S3LogsConfig { + s.Status = &v return s } -// Information about S3 logs for a build project. -type S3LogsConfig struct { +// Information about the S3 bucket where the raw data of a report are exported. +type S3ReportExportConfig struct { _ struct{} `type:"structure"` - // Set to true if you do not want your S3 build log output encrypted. By default - // S3 build logs are encrypted. + // The name of the S3 bucket where the raw data of a report are exported. + Bucket *string `locationName:"bucket" min:"1" type:"string"` + + // A boolean value that specifies if the results of a report are encrypted. EncryptionDisabled *bool `locationName:"encryptionDisabled" type:"boolean"` - // The ARN of an S3 bucket and the path prefix for S3 logs. If your Amazon S3 - // bucket name is my-bucket, and your path prefix is build-log, then acceptable - // formats are my-bucket/build-log or arn:aws:s3:::my-bucket/build-log. - Location *string `locationName:"location" type:"string"` + // The encryption key for the report's encrypted raw data. + EncryptionKey *string `locationName:"encryptionKey" min:"1" type:"string"` - // The current status of the S3 build logs. Valid values are: - // - // * ENABLED: S3 build logs are enabled for this build project. + // The type of build output artifact to create. Valid values include: // - // * DISABLED: S3 build logs are not enabled for this build project. + // * NONE: AWS CodeBuild creates the raw data in the output bucket. This + // is the default if packaging is not specified. // - // Status is a required field - Status *string `locationName:"status" type:"string" required:"true" enum:"LogsConfigStatusType"` + // * ZIP: AWS CodeBuild creates a ZIP file with the raw data in the output + // bucket. + Packaging *string `locationName:"packaging" type:"string" enum:"ReportPackagingType"` + + // The path to the exported report's raw data results. + Path *string `locationName:"path" type:"string"` } // String returns the string representation -func (s S3LogsConfig) String() string { +func (s S3ReportExportConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s S3LogsConfig) GoString() string { +func (s S3ReportExportConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *S3LogsConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3LogsConfig"} - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) +func (s *S3ReportExportConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "S3ReportExportConfig"} + if s.Bucket != nil && len(*s.Bucket) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) + } + if s.EncryptionKey != nil && len(*s.EncryptionKey) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EncryptionKey", 1)) } if invalidParams.Len() > 0 { @@ -5133,21 +8492,33 @@ func (s *S3LogsConfig) Validate() error { return nil } +// SetBucket sets the Bucket field's value. +func (s *S3ReportExportConfig) SetBucket(v string) *S3ReportExportConfig { + s.Bucket = &v + return s +} + // SetEncryptionDisabled sets the EncryptionDisabled field's value. -func (s *S3LogsConfig) SetEncryptionDisabled(v bool) *S3LogsConfig { +func (s *S3ReportExportConfig) SetEncryptionDisabled(v bool) *S3ReportExportConfig { s.EncryptionDisabled = &v return s } -// SetLocation sets the Location field's value. -func (s *S3LogsConfig) SetLocation(v string) *S3LogsConfig { - s.Location = &v +// SetEncryptionKey sets the EncryptionKey field's value. +func (s *S3ReportExportConfig) SetEncryptionKey(v string) *S3ReportExportConfig { + s.EncryptionKey = &v return s } -// SetStatus sets the Status field's value. -func (s *S3LogsConfig) SetStatus(v string) *S3LogsConfig { - s.Status = &v +// SetPackaging sets the Packaging field's value. +func (s *S3ReportExportConfig) SetPackaging(v string) *S3ReportExportConfig { + s.Packaging = &v + return s +} + +// SetPath sets the Path field's value. +func (s *S3ReportExportConfig) SetPath(v string) *S3ReportExportConfig { + s.Path = &v return s } @@ -5259,8 +8630,17 @@ type StartBuildInput struct { // 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 + // A buildspec file declaration that overrides, for this build only, the latest // one already defined in the build project. + // + // If this value is set, it can be either an inline buildspec definition, the + // path to an alternate buildspec file relative to the value of the built-in + // CODEBUILD_SRC_DIR environment variable, or the path to an S3 bucket. The + // bucket must be in the same AWS Region as the build project. Specify the buildspec + // file using its ARN (for example, arn:aws:s3:::my-codebuild-sample2/buildspec.yml). + // If this value is not provided or is set to an empty string, the source code + // must contain a buildspec file in its root directory. For more information, + // see Buildspec File Name and Storage Location (https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html#build-spec-ref-name-storage). BuildspecOverride *string `locationName:"buildspecOverride" type:"string"` // A ProjectCache object specified for this build that overrides the one defined @@ -5275,6 +8655,17 @@ type StartBuildInput struct { // in the build project. ComputeTypeOverride *string `locationName:"computeTypeOverride" type:"string" enum:"ComputeType"` + // The AWS Key Management Service (AWS KMS) customer master key (CMK) that overrides + // the one specified in the build project. The CMK key encrypts the build output + // artifacts. + // + // You can use a cross-account KMS key to encrypt the build output artifacts + // if your service role has permission to that key. + // + // You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, + // the CMK's alias (using the format alias/alias-name ). + EncryptionKeyOverride *string `locationName:"encryptionKeyOverride" min:"1" type:"string"` + // A container type for this build that overrides the one specified in the build // project. EnvironmentTypeOverride *string `locationName:"environmentTypeOverride" type:"string" enum:"EnvironmentType"` @@ -5344,6 +8735,9 @@ type StartBuildInput struct { // Set to true to report to your source provider the status of a build's start // and completion. If you use this option with a source provider other than // GitHub, GitHub Enterprise, or Bitbucket, an invalidInputException is thrown. + // + // The status of a build triggered by a webhook is always reported to your source + // provider. ReportBuildStatusOverride *bool `locationName:"reportBuildStatusOverride" type:"boolean"` // An array of ProjectArtifacts objects. @@ -5376,7 +8770,7 @@ type StartBuildInput struct { // A version of the build input to be built, for this build only. If not specified, // the latest version is used. If specified, must be one of: // - // * For AWS CodeCommit: the commit ID to use. + // * For AWS CodeCommit: the commit ID, branch, or Git tag to use. // // * For GitHub: the commit ID, pull request ID, branch name, or tag name // that corresponds to the version of the source code you want to build. @@ -5418,6 +8812,9 @@ func (s StartBuildInput) GoString() 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.EncryptionKeyOverride != nil && len(*s.EncryptionKeyOverride) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EncryptionKeyOverride", 1)) + } if s.ImageOverride != nil && len(*s.ImageOverride) < 1 { invalidParams.Add(request.NewErrParamMinLen("ImageOverride", 1)) } @@ -5543,6 +8940,12 @@ func (s *StartBuildInput) SetComputeTypeOverride(v string) *StartBuildInput { return s } +// SetEncryptionKeyOverride sets the EncryptionKeyOverride field's value. +func (s *StartBuildInput) SetEncryptionKeyOverride(v string) *StartBuildInput { + s.EncryptionKeyOverride = &v + return s +} + // SetEnvironmentTypeOverride sets the EnvironmentTypeOverride field's value. func (s *StartBuildInput) SetEnvironmentTypeOverride(v string) *StartBuildInput { s.EnvironmentTypeOverride = &v @@ -5819,6 +9222,173 @@ func (s *Tag) SetValue(v string) *Tag { return s } +// Information about a test case created using a framework such as NUnit or +// Cucumber. A test case might be a unit test or a configuration test. +type TestCase struct { + _ struct{} `type:"structure"` + + // The number of nanoseconds it took to run this test case. + DurationInNanoSeconds *int64 `locationName:"durationInNanoSeconds" type:"long"` + + // The date and time a test case expires. A test case expires 30 days after + // it is created. An expired test case is not available to view in CodeBuild. + Expired *time.Time `locationName:"expired" type:"timestamp"` + + // A message associated with a test case. For example, an error message or stack + // trace. + Message *string `locationName:"message" type:"string"` + + // The name of the test case. + Name *string `locationName:"name" type:"string"` + + // A string that is applied to a series of related test cases. CodeBuild generates + // the prefix. The prefix depends on the framework used to generate the tests. + Prefix *string `locationName:"prefix" type:"string"` + + // The ARN of the report to which the test case belongs. + ReportArn *string `locationName:"reportArn" min:"1" type:"string"` + + // The status returned by the test case after it was run. Valid statuses are + // SUCCEEDED, FAILED, ERROR, SKIPPED, and UNKNOWN. + Status *string `locationName:"status" type:"string"` + + // The path to the raw data file that contains the test result. + TestRawDataPath *string `locationName:"testRawDataPath" type:"string"` +} + +// String returns the string representation +func (s TestCase) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TestCase) GoString() string { + return s.String() +} + +// SetDurationInNanoSeconds sets the DurationInNanoSeconds field's value. +func (s *TestCase) SetDurationInNanoSeconds(v int64) *TestCase { + s.DurationInNanoSeconds = &v + return s +} + +// SetExpired sets the Expired field's value. +func (s *TestCase) SetExpired(v time.Time) *TestCase { + s.Expired = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *TestCase) SetMessage(v string) *TestCase { + s.Message = &v + return s +} + +// SetName sets the Name field's value. +func (s *TestCase) SetName(v string) *TestCase { + s.Name = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *TestCase) SetPrefix(v string) *TestCase { + s.Prefix = &v + return s +} + +// SetReportArn sets the ReportArn field's value. +func (s *TestCase) SetReportArn(v string) *TestCase { + s.ReportArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *TestCase) SetStatus(v string) *TestCase { + s.Status = &v + return s +} + +// SetTestRawDataPath sets the TestRawDataPath field's value. +func (s *TestCase) SetTestRawDataPath(v string) *TestCase { + s.TestRawDataPath = &v + return s +} + +// A filter used to return specific types of test cases. +type TestCaseFilter struct { + _ struct{} `type:"structure"` + + // The status used to filter test cases. Valid statuses are SUCCEEDED, FAILED, + // ERROR, SKIPPED, and UNKNOWN. A TestCaseFilter can have one status. + Status *string `locationName:"status" type:"string"` +} + +// String returns the string representation +func (s TestCaseFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TestCaseFilter) GoString() string { + return s.String() +} + +// SetStatus sets the Status field's value. +func (s *TestCaseFilter) SetStatus(v string) *TestCaseFilter { + s.Status = &v + return s +} + +// Information about a test report. +type TestReportSummary struct { + _ struct{} `type:"structure"` + + // The number of nanoseconds it took to run all of the test cases in this report. + // + // DurationInNanoSeconds is a required field + DurationInNanoSeconds *int64 `locationName:"durationInNanoSeconds" type:"long" required:"true"` + + // A map that contains the number of each type of status returned by the test + // results in this TestReportSummary. + // + // StatusCounts is a required field + StatusCounts map[string]*int64 `locationName:"statusCounts" type:"map" required:"true"` + + // The number of test cases in this TestReportSummary. The total includes truncated + // test cases. + // + // Total is a required field + Total *int64 `locationName:"total" type:"integer" required:"true"` +} + +// String returns the string representation +func (s TestReportSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TestReportSummary) GoString() string { + return s.String() +} + +// SetDurationInNanoSeconds sets the DurationInNanoSeconds field's value. +func (s *TestReportSummary) SetDurationInNanoSeconds(v int64) *TestReportSummary { + s.DurationInNanoSeconds = &v + return s +} + +// SetStatusCounts sets the StatusCounts field's value. +func (s *TestReportSummary) SetStatusCounts(v map[string]*int64) *TestReportSummary { + s.StatusCounts = v + return s +} + +// SetTotal sets the Total field's value. +func (s *TestReportSummary) SetTotal(v int64) *TestReportSummary { + s.Total = &v + return s +} + type UpdateProjectInput struct { _ struct{} `type:"structure"` @@ -5850,6 +9420,11 @@ type UpdateProjectInput struct { // Information to be changed about the build environment for the build project. Environment *ProjectEnvironment `locationName:"environment" type:"structure"` + // An array of ProjectFileSystemLocation objects for a CodeBuild build project. + // A ProjectFileSystemLocation object specifies the identifier, location, mountOptions, + // mountPoint, and type of a file system created using Amazon Elastic File System. + FileSystemLocations []*ProjectFileSystemLocation `locationName:"fileSystemLocations" type:"list"` + // Information about logs for the build project. A project can create logs in // Amazon CloudWatch Logs, logs in an S3 bucket, or both. LogsConfig *LogsConfig `locationName:"logsConfig" type:"structure"` @@ -5887,7 +9462,7 @@ type UpdateProjectInput struct { // A version of the build input to be built for this project. If not specified, // the latest version is used. If specified, it must be one of: // - // * For AWS CodeCommit: the commit ID to use. + // * For AWS CodeCommit: the commit ID, branch, or Git tag to use. // // * For GitHub: the commit ID, pull request ID, branch name, or tag name // that corresponds to the version of the source code you want to build. @@ -6069,6 +9644,12 @@ func (s *UpdateProjectInput) SetEnvironment(v *ProjectEnvironment) *UpdateProjec return s } +// SetFileSystemLocations sets the FileSystemLocations field's value. +func (s *UpdateProjectInput) SetFileSystemLocations(v []*ProjectFileSystemLocation) *UpdateProjectInput { + s.FileSystemLocations = v + return s +} + // SetLogsConfig sets the LogsConfig field's value. func (s *UpdateProjectInput) SetLogsConfig(v *LogsConfig) *UpdateProjectInput { s.LogsConfig = v @@ -6164,6 +9745,88 @@ func (s *UpdateProjectOutput) SetProject(v *Project) *UpdateProjectOutput { return s } +type UpdateReportGroupInput struct { + _ struct{} `type:"structure"` + + // The ARN of the report group to update. + // + // Arn is a required field + Arn *string `locationName:"arn" min:"1" type:"string" required:"true"` + + // Used to specify an updated export type. Valid values are: + // + // * S3: The report results are exported to an S3 bucket. + // + // * NO_EXPORT: The report results are not exported. + ExportConfig *ReportExportConfig `locationName:"exportConfig" type:"structure"` +} + +// String returns the string representation +func (s UpdateReportGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateReportGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateReportGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateReportGroupInput"} + 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.ExportConfig != nil { + if err := s.ExportConfig.Validate(); err != nil { + invalidParams.AddNested("ExportConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *UpdateReportGroupInput) SetArn(v string) *UpdateReportGroupInput { + s.Arn = &v + return s +} + +// SetExportConfig sets the ExportConfig field's value. +func (s *UpdateReportGroupInput) SetExportConfig(v *ReportExportConfig) *UpdateReportGroupInput { + s.ExportConfig = v + return s +} + +type UpdateReportGroupOutput struct { + _ struct{} `type:"structure"` + + // Information about the updated report group. + ReportGroup *ReportGroup `locationName:"reportGroup" type:"structure"` +} + +// String returns the string representation +func (s UpdateReportGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateReportGroupOutput) GoString() string { + return s.String() +} + +// SetReportGroup sets the ReportGroup field's value. +func (s *UpdateReportGroupOutput) SetReportGroup(v *ReportGroup) *UpdateReportGroupOutput { + s.ReportGroup = v + return s +} + type UpdateWebhookInput struct { _ struct{} `type:"structure"` @@ -6176,7 +9839,7 @@ type UpdateWebhookInput struct { BranchFilter *string `locationName:"branchFilter" type:"string"` // An array of arrays of WebhookFilter objects used to determine if a webhook - // event can trigger a build. A filter group must pcontain at least one EVENT + // event can trigger a build. A filter group must contain at least one EVENT // WebhookFilter. FilterGroups [][]*WebhookFilter `locationName:"filterGroups" type:"list"` @@ -6602,6 +10265,9 @@ const ( // ComputeTypeBuildGeneral1Large is a ComputeType enum value ComputeTypeBuildGeneral1Large = "BUILD_GENERAL1_LARGE" + + // ComputeTypeBuildGeneral12xlarge is a ComputeType enum value + ComputeTypeBuildGeneral12xlarge = "BUILD_GENERAL1_2XLARGE" ) const ( @@ -6615,6 +10281,12 @@ const ( // EnvironmentTypeLinuxContainer is a EnvironmentType enum value EnvironmentTypeLinuxContainer = "LINUX_CONTAINER" + + // EnvironmentTypeLinuxGpuContainer is a EnvironmentType enum value + EnvironmentTypeLinuxGpuContainer = "LINUX_GPU_CONTAINER" + + // EnvironmentTypeArmContainer is a EnvironmentType enum value + EnvironmentTypeArmContainer = "ARM_CONTAINER" ) const ( @@ -6623,6 +10295,14 @@ const ( // EnvironmentVariableTypeParameterStore is a EnvironmentVariableType enum value EnvironmentVariableTypeParameterStore = "PARAMETER_STORE" + + // EnvironmentVariableTypeSecretsManager is a EnvironmentVariableType enum value + EnvironmentVariableTypeSecretsManager = "SECRETS_MANAGER" +) + +const ( + // FileSystemTypeEfs is a FileSystemType enum value + FileSystemTypeEfs = "EFS" ) const ( @@ -6698,6 +10378,55 @@ const ( ProjectSortByTypeLastModifiedTime = "LAST_MODIFIED_TIME" ) +const ( + // ReportExportConfigTypeS3 is a ReportExportConfigType enum value + ReportExportConfigTypeS3 = "S3" + + // ReportExportConfigTypeNoExport is a ReportExportConfigType enum value + ReportExportConfigTypeNoExport = "NO_EXPORT" +) + +const ( + // ReportGroupSortByTypeName is a ReportGroupSortByType enum value + ReportGroupSortByTypeName = "NAME" + + // ReportGroupSortByTypeCreatedTime is a ReportGroupSortByType enum value + ReportGroupSortByTypeCreatedTime = "CREATED_TIME" + + // ReportGroupSortByTypeLastModifiedTime is a ReportGroupSortByType enum value + ReportGroupSortByTypeLastModifiedTime = "LAST_MODIFIED_TIME" +) + +const ( + // ReportPackagingTypeZip is a ReportPackagingType enum value + ReportPackagingTypeZip = "ZIP" + + // ReportPackagingTypeNone is a ReportPackagingType enum value + ReportPackagingTypeNone = "NONE" +) + +const ( + // ReportStatusTypeGenerating is a ReportStatusType enum value + ReportStatusTypeGenerating = "GENERATING" + + // ReportStatusTypeSucceeded is a ReportStatusType enum value + ReportStatusTypeSucceeded = "SUCCEEDED" + + // ReportStatusTypeFailed is a ReportStatusType enum value + ReportStatusTypeFailed = "FAILED" + + // ReportStatusTypeIncomplete is a ReportStatusType enum value + ReportStatusTypeIncomplete = "INCOMPLETE" + + // ReportStatusTypeDeleting is a ReportStatusType enum value + ReportStatusTypeDeleting = "DELETING" +) + +const ( + // ReportTypeTest is a ReportType enum value + ReportTypeTest = "TEST" +) + const ( // ServerTypeGithub is a ServerType enum value ServerTypeGithub = "GITHUB" @@ -6709,6 +10438,14 @@ const ( ServerTypeGithubEnterprise = "GITHUB_ENTERPRISE" ) +const ( + // SharedResourceSortByTypeArn is a SharedResourceSortByType enum value + SharedResourceSortByTypeArn = "ARN" + + // SharedResourceSortByTypeModifiedTime is a SharedResourceSortByType enum value + SharedResourceSortByTypeModifiedTime = "MODIFIED_TIME" +) + const ( // SortOrderTypeAscending is a SortOrderType enum value SortOrderTypeAscending = "ASCENDING" diff --git a/vendor/github.com/aws/aws-sdk-go/service/codebuild/doc.go b/vendor/github.com/aws/aws-sdk-go/service/codebuild/doc.go index ac6bf62871f..d1b33a4fe72 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codebuild/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codebuild/doc.go @@ -11,12 +11,15 @@ // 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. You pay only for the build time you consume. -// For more information about AWS CodeBuild, see the AWS CodeBuild User Guide. +// For more information about AWS CodeBuild, see the AWS CodeBuild User Guide +// (https://docs.aws.amazon.com/codebuild/latest/userguide/welcome.html). // // AWS CodeBuild supports these operations: // // * BatchDeleteBuilds: Deletes one or more builds. // +// * BatchGetBuilds: Gets information about one or more builds. +// // * BatchGetProjects: Gets information about one or more build projects. // A build project defines how AWS CodeBuild runs a build. This includes // information such as where to get the source code to build, the build environment @@ -25,28 +28,48 @@ // language runtime, and tools that AWS CodeBuild uses to run a build. You // can add tags to build projects to help manage your resources and costs. // +// * BatchGetReportGroups: Returns an array of report groups. +// +// * BatchGetReports: Returns an array of reports. +// // * CreateProject: Creates a build project. // +// * CreateReportGroup: Creates a report group. A report group contains a +// collection of reports. +// // * CreateWebhook: For an existing AWS CodeBuild build project that has // its source code stored in a GitHub or Bitbucket repository, enables AWS // CodeBuild to start rebuilding the source code every time a code change // is pushed to the repository. // -// * UpdateWebhook: Changes the settings of an existing webhook. -// // * DeleteProject: Deletes a build project. // +// * DeleteReport: Deletes a report. +// +// * DeleteReportGroup: Deletes a report group. +// +// * DeleteResourcePolicy: Deletes a resource policy that is identified by +// its resource ARN. +// +// * DeleteSourceCredentials: Deletes a set of GitHub, GitHub Enterprise, +// or Bitbucket source credentials. +// // * DeleteWebhook: For an existing AWS CodeBuild build project that has // its source code stored in a GitHub or Bitbucket repository, stops AWS // CodeBuild from rebuilding the source code every time a code change is // pushed to the repository. // -// * ListProjects: Gets a list of build project names, with each build project -// name representing a single build project. +// * DescribeTestCases: Returns a list of details about test cases for a +// report. // -// * UpdateProject: Changes the settings of an existing build project. +// * GetResourcePolicy: Gets a resource policy that is identified by its +// resource ARN. // -// * BatchGetBuilds: Gets information about one or more builds. +// * ImportSourceCredentials: Imports the source repository credentials for +// an AWS CodeBuild project that has its source code stored in a GitHub, +// GitHub Enterprise, or Bitbucket repository. +// +// * InvalidateProjectCache: Resets the cache for a project. // // * ListBuilds: Gets a list of build IDs, with each build ID representing // a single build. @@ -54,24 +77,43 @@ // * 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. // -// * DeleteSourceCredentials: Deletes a set of GitHub, GitHub Enterprise, -// or Bitbucket source credentials. +// * ListProjects: Gets a list of build project names, with each build project +// name representing a single build project. // -// * ImportSourceCredentials: Imports the source repository credentials for -// an AWS CodeBuild project that has its source code stored in a GitHub, -// GitHub Enterprise, or Bitbucket repository. +// * ListReportGroups: Gets a list ARNs for the report groups in the current +// AWS account. +// +// * ListReports: Gets a list ARNs for the reports in the current AWS account. +// +// * ListReportsForReportGroup: Returns a list of ARNs for the reports that +// belong to a ReportGroup. +// +// * ListSharedProjects: Gets a list of ARNs associated with projects shared +// with the current AWS account or user. +// +// * ListSharedReportGroups: Gets a list of ARNs associated with report groups +// shared with the current AWS account or user // // * ListSourceCredentials: Returns a list of SourceCredentialsInfo objects. // Each SourceCredentialsInfo object includes the authentication type, token // ARN, and type of source provider for one set of credentials. // +// * PutResourcePolicy: Stores a resource policy for the ARN of a Project +// or ReportGroup object. +// +// * StartBuild: Starts running a build. +// +// * StopBuild: Attempts to stop running a build. +// +// * UpdateProject: Changes the settings of an existing build project. +// +// * UpdateReportGroup: Changes a report group. +// +// * UpdateWebhook: Changes the settings of an existing webhook. +// // See https://docs.aws.amazon.com/goto/WebAPI/codebuild-2016-10-06 for more information on this service. // // See codebuild package documentation for more information. 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 index eba0333fb6a..1f4a4d3b920 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codebuild/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codebuild/errors.go @@ -2,6 +2,10 @@ package codebuild +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccountLimitExceededException for service response error code @@ -35,3 +39,11 @@ const ( // The specified AWS resource cannot be found. ErrCodeResourceNotFoundException = "ResourceNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccountLimitExceededException": newErrorAccountLimitExceededException, + "InvalidInputException": newErrorInvalidInputException, + "OAuthProviderException": newErrorOAuthProviderException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceNotFoundException": newErrorResourceNotFoundException, +} 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 index b9ff2b6f76e..2dff5342cc3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codebuild/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codebuild/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "codebuild" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "CodeBuild" // ServiceID is a unique identifer of a specific service. + ServiceID = "CodeBuild" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CodeBuild client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CodeBuild client from just a session. // svc := codebuild.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CodeBuild { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CodeBuild { svc := &CodeBuild{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-10-06", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 4288448dbb5..8a444d564da 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codecommit/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codecommit/api.go @@ -13,6 +13,246 @@ import ( "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) +const opAssociateApprovalRuleTemplateWithRepository = "AssociateApprovalRuleTemplateWithRepository" + +// AssociateApprovalRuleTemplateWithRepositoryRequest generates a "aws/request.Request" representing the +// client's request for the AssociateApprovalRuleTemplateWithRepository operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AssociateApprovalRuleTemplateWithRepository for more information on using the AssociateApprovalRuleTemplateWithRepository +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AssociateApprovalRuleTemplateWithRepositoryRequest method. +// req, resp := client.AssociateApprovalRuleTemplateWithRepositoryRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/AssociateApprovalRuleTemplateWithRepository +func (c *CodeCommit) AssociateApprovalRuleTemplateWithRepositoryRequest(input *AssociateApprovalRuleTemplateWithRepositoryInput) (req *request.Request, output *AssociateApprovalRuleTemplateWithRepositoryOutput) { + op := &request.Operation{ + Name: opAssociateApprovalRuleTemplateWithRepository, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AssociateApprovalRuleTemplateWithRepositoryInput{} + } + + output = &AssociateApprovalRuleTemplateWithRepositoryOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// AssociateApprovalRuleTemplateWithRepository API operation for AWS CodeCommit. +// +// Creates an association between an approval rule template and a specified +// repository. Then, the next time a pull request is created in the repository +// where the destination reference (if specified) matches the destination reference +// (branch) for the pull request, an approval rule that matches the template +// conditions is automatically created for that pull request. If no destination +// references are specified in the template, an approval rule that matches the +// template contents is created for all pull requests in that 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 AssociateApprovalRuleTemplateWithRepository for usage and error information. +// +// Returned Error Types: +// * ApprovalRuleTemplateNameRequiredException +// An approval rule template name is required, but was not specified. +// +// * InvalidApprovalRuleTemplateNameException +// The name of the approval rule template is not valid. Template names must +// be between 1 and 100 valid characters in length. For more information about +// limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). +// +// * ApprovalRuleTemplateDoesNotExistException +// The specified approval rule template does not exist. Verify that the name +// is correct and that you are signed in to the AWS Region where the template +// was created, and then try again. +// +// * MaximumRuleTemplatesAssociatedWithRepositoryException +// The maximum number of approval rule templates for a repository has been exceeded. +// You cannot associate more than 25 approval rule templates with a repository. +// +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. +// +// * InvalidRepositoryNameException +// A specified repository name is not valid. +// +// This exception occurs only 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. +// +// * RepositoryDoesNotExistException +// The specified repository does not exist. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/AssociateApprovalRuleTemplateWithRepository +func (c *CodeCommit) AssociateApprovalRuleTemplateWithRepository(input *AssociateApprovalRuleTemplateWithRepositoryInput) (*AssociateApprovalRuleTemplateWithRepositoryOutput, error) { + req, out := c.AssociateApprovalRuleTemplateWithRepositoryRequest(input) + return out, req.Send() +} + +// AssociateApprovalRuleTemplateWithRepositoryWithContext is the same as AssociateApprovalRuleTemplateWithRepository with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateApprovalRuleTemplateWithRepository for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) AssociateApprovalRuleTemplateWithRepositoryWithContext(ctx aws.Context, input *AssociateApprovalRuleTemplateWithRepositoryInput, opts ...request.Option) (*AssociateApprovalRuleTemplateWithRepositoryOutput, error) { + req, out := c.AssociateApprovalRuleTemplateWithRepositoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opBatchAssociateApprovalRuleTemplateWithRepositories = "BatchAssociateApprovalRuleTemplateWithRepositories" + +// BatchAssociateApprovalRuleTemplateWithRepositoriesRequest generates a "aws/request.Request" representing the +// client's request for the BatchAssociateApprovalRuleTemplateWithRepositories operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See BatchAssociateApprovalRuleTemplateWithRepositories for more information on using the BatchAssociateApprovalRuleTemplateWithRepositories +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the BatchAssociateApprovalRuleTemplateWithRepositoriesRequest method. +// req, resp := client.BatchAssociateApprovalRuleTemplateWithRepositoriesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchAssociateApprovalRuleTemplateWithRepositories +func (c *CodeCommit) BatchAssociateApprovalRuleTemplateWithRepositoriesRequest(input *BatchAssociateApprovalRuleTemplateWithRepositoriesInput) (req *request.Request, output *BatchAssociateApprovalRuleTemplateWithRepositoriesOutput) { + op := &request.Operation{ + Name: opBatchAssociateApprovalRuleTemplateWithRepositories, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &BatchAssociateApprovalRuleTemplateWithRepositoriesInput{} + } + + output = &BatchAssociateApprovalRuleTemplateWithRepositoriesOutput{} + req = c.newRequest(op, input, output) + return +} + +// BatchAssociateApprovalRuleTemplateWithRepositories API operation for AWS CodeCommit. +// +// Creates an association between an approval rule template and one or more +// specified 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 BatchAssociateApprovalRuleTemplateWithRepositories for usage and error information. +// +// Returned Error Types: +// * ApprovalRuleTemplateNameRequiredException +// An approval rule template name is required, but was not specified. +// +// * InvalidApprovalRuleTemplateNameException +// The name of the approval rule template is not valid. Template names must +// be between 1 and 100 valid characters in length. For more information about +// limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). +// +// * ApprovalRuleTemplateDoesNotExistException +// The specified approval rule template does not exist. Verify that the name +// is correct and that you are signed in to the AWS Region where the template +// was created, and then try again. +// +// * RepositoryNamesRequiredException +// At least one repository name object is required, but was not specified. +// +// * MaximumRepositoryNamesExceededException +// The maximum number of allowed repository names was exceeded. Currently, this +// number is 100. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchAssociateApprovalRuleTemplateWithRepositories +func (c *CodeCommit) BatchAssociateApprovalRuleTemplateWithRepositories(input *BatchAssociateApprovalRuleTemplateWithRepositoriesInput) (*BatchAssociateApprovalRuleTemplateWithRepositoriesOutput, error) { + req, out := c.BatchAssociateApprovalRuleTemplateWithRepositoriesRequest(input) + return out, req.Send() +} + +// BatchAssociateApprovalRuleTemplateWithRepositoriesWithContext is the same as BatchAssociateApprovalRuleTemplateWithRepositories with the addition of +// the ability to pass a context and additional request options. +// +// See BatchAssociateApprovalRuleTemplateWithRepositories for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) BatchAssociateApprovalRuleTemplateWithRepositoriesWithContext(ctx aws.Context, input *BatchAssociateApprovalRuleTemplateWithRepositoriesInput, opts ...request.Option) (*BatchAssociateApprovalRuleTemplateWithRepositoriesOutput, error) { + req, out := c.BatchAssociateApprovalRuleTemplateWithRepositoriesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opBatchDescribeMergeConflicts = "BatchDescribeMergeConflicts" // BatchDescribeMergeConflictsRequest generates a "aws/request.Request" representing the @@ -67,77 +307,77 @@ func (c *CodeCommit) BatchDescribeMergeConflictsRequest(input *BatchDescribeMerg // See the AWS API reference guide for AWS CodeCommit's // API operation BatchDescribeMergeConflicts for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeMergeOptionRequiredException "MergeOptionRequiredException" +// * MergeOptionRequiredException // A merge option or stategy is required, and none was provided. // -// * ErrCodeInvalidMergeOptionException "InvalidMergeOptionException" +// * InvalidMergeOptionException // The specified merge option is not valid for this operation. Not all merge // strategies are supported for all operations. // -// * ErrCodeInvalidContinuationTokenException "InvalidContinuationTokenException" +// * InvalidContinuationTokenException // The specified continuation token is not valid. // -// * ErrCodeCommitRequiredException "CommitRequiredException" +// * CommitRequiredException // A commit was not specified. // -// * ErrCodeCommitDoesNotExistException "CommitDoesNotExistException" +// * CommitDoesNotExistException // The specified commit does not exist or no commit was specified, and the specified // repository has no default branch. // -// * ErrCodeInvalidCommitException "InvalidCommitException" +// * InvalidCommitException // The specified commit is not valid. // -// * ErrCodeTipsDivergenceExceededException "TipsDivergenceExceededException" +// * TipsDivergenceExceededException // The divergence between the tips of the provided commit specifiers is too // great to determine whether there might be any merge conflicts. Locally compare // the specifiers using git diff or a diff tool. // -// * ErrCodeInvalidMaxConflictFilesException "InvalidMaxConflictFilesException" +// * InvalidMaxConflictFilesException // The specified value for the number of conflict files to return is not valid. // -// * ErrCodeInvalidMaxMergeHunksException "InvalidMaxMergeHunksException" +// * InvalidMaxMergeHunksException // The specified value for the number of merge hunks to return is not valid. // -// * ErrCodeInvalidConflictDetailLevelException "InvalidConflictDetailLevelException" +// * InvalidConflictDetailLevelException // The specified conflict detail level is not valid. // -// * ErrCodeInvalidConflictResolutionStrategyException "InvalidConflictResolutionStrategyException" +// * InvalidConflictResolutionStrategyException // The specified conflict resolution strategy is not valid. // -// * ErrCodeMaximumFileContentToLoadExceededException "MaximumFileContentToLoadExceededException" +// * MaximumFileContentToLoadExceededException // The number of files to load exceeds the allowed limit. // -// * ErrCodeMaximumItemsToCompareExceededException "MaximumItemsToCompareExceededException" -// The maximum number of items to compare between the source or destination -// branches and the merge base has exceeded the maximum allowed. +// * MaximumItemsToCompareExceededException +// The number of items to compare between the source or destination branches +// and the merge base has exceeded the maximum allowed. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchDescribeMergeConflicts @@ -162,6 +402,118 @@ func (c *CodeCommit) BatchDescribeMergeConflictsWithContext(ctx aws.Context, inp return out, req.Send() } +const opBatchDisassociateApprovalRuleTemplateFromRepositories = "BatchDisassociateApprovalRuleTemplateFromRepositories" + +// BatchDisassociateApprovalRuleTemplateFromRepositoriesRequest generates a "aws/request.Request" representing the +// client's request for the BatchDisassociateApprovalRuleTemplateFromRepositories operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See BatchDisassociateApprovalRuleTemplateFromRepositories for more information on using the BatchDisassociateApprovalRuleTemplateFromRepositories +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the BatchDisassociateApprovalRuleTemplateFromRepositoriesRequest method. +// req, resp := client.BatchDisassociateApprovalRuleTemplateFromRepositoriesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchDisassociateApprovalRuleTemplateFromRepositories +func (c *CodeCommit) BatchDisassociateApprovalRuleTemplateFromRepositoriesRequest(input *BatchDisassociateApprovalRuleTemplateFromRepositoriesInput) (req *request.Request, output *BatchDisassociateApprovalRuleTemplateFromRepositoriesOutput) { + op := &request.Operation{ + Name: opBatchDisassociateApprovalRuleTemplateFromRepositories, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &BatchDisassociateApprovalRuleTemplateFromRepositoriesInput{} + } + + output = &BatchDisassociateApprovalRuleTemplateFromRepositoriesOutput{} + req = c.newRequest(op, input, output) + return +} + +// BatchDisassociateApprovalRuleTemplateFromRepositories API operation for AWS CodeCommit. +// +// Removes the association between an approval rule template and one or more +// specified 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 BatchDisassociateApprovalRuleTemplateFromRepositories for usage and error information. +// +// Returned Error Types: +// * ApprovalRuleTemplateNameRequiredException +// An approval rule template name is required, but was not specified. +// +// * InvalidApprovalRuleTemplateNameException +// The name of the approval rule template is not valid. Template names must +// be between 1 and 100 valid characters in length. For more information about +// limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). +// +// * ApprovalRuleTemplateDoesNotExistException +// The specified approval rule template does not exist. Verify that the name +// is correct and that you are signed in to the AWS Region where the template +// was created, and then try again. +// +// * RepositoryNamesRequiredException +// At least one repository name object is required, but was not specified. +// +// * MaximumRepositoryNamesExceededException +// The maximum number of allowed repository names was exceeded. Currently, this +// number is 100. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchDisassociateApprovalRuleTemplateFromRepositories +func (c *CodeCommit) BatchDisassociateApprovalRuleTemplateFromRepositories(input *BatchDisassociateApprovalRuleTemplateFromRepositoriesInput) (*BatchDisassociateApprovalRuleTemplateFromRepositoriesOutput, error) { + req, out := c.BatchDisassociateApprovalRuleTemplateFromRepositoriesRequest(input) + return out, req.Send() +} + +// BatchDisassociateApprovalRuleTemplateFromRepositoriesWithContext is the same as BatchDisassociateApprovalRuleTemplateFromRepositories with the addition of +// the ability to pass a context and additional request options. +// +// See BatchDisassociateApprovalRuleTemplateFromRepositories for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) BatchDisassociateApprovalRuleTemplateFromRepositoriesWithContext(ctx aws.Context, input *BatchDisassociateApprovalRuleTemplateFromRepositoriesInput, opts ...request.Option) (*BatchDisassociateApprovalRuleTemplateFromRepositoriesOutput, error) { + req, out := c.BatchDisassociateApprovalRuleTemplateFromRepositoriesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opBatchGetCommits = "BatchGetCommits" // BatchGetCommitsRequest generates a "aws/request.Request" representing the @@ -215,40 +567,42 @@ func (c *CodeCommit) BatchGetCommitsRequest(input *BatchGetCommitsInput) (req *r // See the AWS API reference guide for AWS CodeCommit's // API operation BatchGetCommits for usage and error information. // -// Returned Error Codes: -// * ErrCodeCommitIdsListRequiredException "CommitIdsListRequiredException" +// Returned Error Types: +// * CommitIdsListRequiredException +// A list of commit IDs is required, but was either not specified or the list +// was empty. // -// * ErrCodeCommitIdsLimitExceededException "CommitIdsLimitExceededException" +// * CommitIdsLimitExceededException // The maximum number of allowed commit IDs in a batch request is 100. Verify // that your batch requests contains no more than 100 commit IDs, and then try // again. // -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchGetCommits @@ -321,9 +675,9 @@ func (c *CodeCommit) BatchGetRepositoriesRequest(input *BatchGetRepositoriesInpu // // 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. +// and display it in a webpage can 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 webpage. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -332,34 +686,34 @@ func (c *CodeCommit) BatchGetRepositoriesRequest(input *BatchGetRepositoriesInpu // 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. +// Returned Error Types: +// * RepositoryNamesRequiredException +// At least one repository name object is required, but was not specified. // -// * ErrCodeMaximumRepositoryNamesExceededException "MaximumRepositoryNamesExceededException" +// * MaximumRepositoryNamesExceededException // The maximum number of allowed repository names was exceeded. Currently, this -// number is 25. +// number is 100. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/BatchGetRepositories @@ -384,110 +738,219 @@ func (c *CodeCommit) BatchGetRepositoriesWithContext(ctx aws.Context, input *Bat return out, req.Send() } -const opCreateBranch = "CreateBranch" +const opCreateApprovalRuleTemplate = "CreateApprovalRuleTemplate" -// CreateBranchRequest generates a "aws/request.Request" representing the -// client's request for the CreateBranch operation. The "output" return +// CreateApprovalRuleTemplateRequest generates a "aws/request.Request" representing the +// client's request for the CreateApprovalRuleTemplate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See CreateBranch for more information on using the CreateBranch +// See CreateApprovalRuleTemplate for more information on using the CreateApprovalRuleTemplate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the CreateBranchRequest method. -// req, resp := client.CreateBranchRequest(params) +// // Example sending a request using the CreateApprovalRuleTemplateRequest method. +// req, resp := client.CreateApprovalRuleTemplateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateBranch -func (c *CodeCommit) CreateBranchRequest(input *CreateBranchInput) (req *request.Request, output *CreateBranchOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateApprovalRuleTemplate +func (c *CodeCommit) CreateApprovalRuleTemplateRequest(input *CreateApprovalRuleTemplateInput) (req *request.Request, output *CreateApprovalRuleTemplateOutput) { op := &request.Operation{ - Name: opCreateBranch, + Name: opCreateApprovalRuleTemplate, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &CreateBranchInput{} + input = &CreateApprovalRuleTemplateInput{} } - output = &CreateBranchOutput{} + output = &CreateApprovalRuleTemplateOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// CreateBranch API operation for AWS CodeCommit. -// -// Creates a new branch in a repository and points the branch to a commit. +// CreateApprovalRuleTemplate API operation for AWS CodeCommit. // -// Calling the create branch operation does not set a repository's default branch. -// To do this, call the update default branch operation. +// Creates a template for approval rules that can then be associated with one +// or more repositories in your AWS account. When you associate a template with +// a repository, AWS CodeCommit creates an approval rule that matches the conditions +// of the template for all pull requests that meet the conditions of the template. +// For more information, see AssociateApprovalRuleTemplateWithRepository. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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. +// API operation CreateApprovalRuleTemplate for usage and error information. // -// * ErrCodeBranchNameRequiredException "BranchNameRequiredException" -// A branch name is required but was not specified. +// Returned Error Types: +// * ApprovalRuleTemplateNameRequiredException +// An approval rule template name is required, but was not specified. // -// * ErrCodeBranchNameExistsException "BranchNameExistsException" -// The specified branch name already exists. -// -// * ErrCodeInvalidBranchNameException "InvalidBranchNameException" -// The specified reference name is not valid. +// * InvalidApprovalRuleTemplateNameException +// The name of the approval rule template is not valid. Template names must +// be between 1 and 100 valid characters in length. For more information about +// limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). // -// * ErrCodeCommitIdRequiredException "CommitIdRequiredException" -// A commit ID was not specified. +// * ApprovalRuleTemplateNameAlreadyExistsException +// You cannot create an approval rule template with that name because a template +// with that name already exists in this AWS Region for your AWS account. Approval +// rule template names must be unique. // -// * ErrCodeCommitDoesNotExistException "CommitDoesNotExistException" -// The specified commit does not exist or no commit was specified, and the specified -// repository has no default branch. +// * ApprovalRuleTemplateContentRequiredException +// The content for the approval rule template is empty. You must provide some +// content for an approval rule template. The content cannot be null. // -// * ErrCodeInvalidCommitIdException "InvalidCommitIdException" -// The specified commit ID is not valid. +// * InvalidApprovalRuleTemplateContentException +// The content of the approval rule template is not valid. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. +// * InvalidApprovalRuleTemplateDescriptionException +// The description for the approval rule template is not valid because it exceeds +// the maximum characters allowed for a description. For more information about +// limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. +// * NumberOfRuleTemplatesExceededException +// The maximum number of approval rule templates has been exceeded for this +// AWS Region. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateApprovalRuleTemplate +func (c *CodeCommit) CreateApprovalRuleTemplate(input *CreateApprovalRuleTemplateInput) (*CreateApprovalRuleTemplateOutput, error) { + req, out := c.CreateApprovalRuleTemplateRequest(input) + return out, req.Send() +} + +// CreateApprovalRuleTemplateWithContext is the same as CreateApprovalRuleTemplate with the addition of +// the ability to pass a context and additional request options. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. +// See CreateApprovalRuleTemplate for details on how to use this API operation. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) CreateApprovalRuleTemplateWithContext(ctx aws.Context, input *CreateApprovalRuleTemplateInput, opts ...request.Option) (*CreateApprovalRuleTemplateOutput, error) { + req, out := c.CreateApprovalRuleTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateBranch = "CreateBranch" + +// CreateBranchRequest generates a "aws/request.Request" representing the +// client's request for the CreateBranch operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateBranch for more information on using the CreateBranch +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateBranchRequest method. +// req, resp := client.CreateBranchRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// CreateBranch API operation for AWS CodeCommit. +// +// Creates a 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 Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. +// +// * InvalidRepositoryNameException +// A specified repository name is not valid. +// +// This exception occurs only 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. +// +// * RepositoryDoesNotExistException +// The specified repository does not exist. +// +// * BranchNameRequiredException +// A branch name is required, but was not specified. +// +// * BranchNameExistsException +// The specified branch name already exists. +// +// * InvalidBranchNameException +// The specified reference name is not valid. +// +// * CommitIdRequiredException +// A commit ID was not specified. +// +// * CommitDoesNotExistException +// The specified commit does not exist or no commit was specified, and the specified +// repository has no default branch. +// +// * InvalidCommitIdException +// The specified commit ID is not valid. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateBranch func (c *CodeCommit) CreateBranch(input *CreateBranchInput) (*CreateBranchOutput, error) { @@ -564,161 +1027,161 @@ func (c *CodeCommit) CreateCommitRequest(input *CreateCommitInput) (req *request // See the AWS API reference guide for AWS CodeCommit's // API operation CreateCommit for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeParentCommitIdRequiredException "ParentCommitIdRequiredException" +// * ParentCommitIdRequiredException // A parent commit ID is required. To view the full commit ID of a branch in // a repository, use GetBranch or a Git command (for example, git pull or git // log). // -// * ErrCodeInvalidParentCommitIdException "InvalidParentCommitIdException" +// * InvalidParentCommitIdException // The parent commit ID is not valid. The commit ID cannot be empty, and must // match the head commit ID for the branch of the repository where you want // to add or update a file. // -// * ErrCodeParentCommitDoesNotExistException "ParentCommitDoesNotExistException" +// * ParentCommitDoesNotExistException // The parent commit ID is not valid because it does not exist. The specified // parent commit ID does not exist in the specified branch of the repository. // -// * ErrCodeParentCommitIdOutdatedException "ParentCommitIdOutdatedException" +// * ParentCommitIdOutdatedException // The file could not be added because the provided parent commit ID is not // the current tip of the specified branch. To view the full commit ID of the // current head of the branch, use GetBranch. // -// * ErrCodeBranchNameRequiredException "BranchNameRequiredException" -// A branch name is required but was not specified. +// * BranchNameRequiredException +// A branch name is required, but was not specified. // -// * ErrCodeInvalidBranchNameException "InvalidBranchNameException" +// * InvalidBranchNameException // The specified reference name is not valid. // -// * ErrCodeBranchDoesNotExistException "BranchDoesNotExistException" +// * BranchDoesNotExistException // The specified branch does not exist. // -// * ErrCodeBranchNameIsTagNameException "BranchNameIsTagNameException" -// The specified branch name is not valid because it is a tag name. Type the -// name of a current branch in the repository. For a list of valid branch names, -// use ListBranches. +// * BranchNameIsTagNameException +// The specified branch name is not valid because it is a tag name. Enter the +// name of a branch in the repository. For a list of valid branch names, use +// ListBranches. // -// * ErrCodeFileEntryRequiredException "FileEntryRequiredException" +// * FileEntryRequiredException // The commit cannot be created because no files have been specified as added, // updated, or changed (PutFile or DeleteFile) for the commit. // -// * ErrCodeMaximumFileEntriesExceededException "MaximumFileEntriesExceededException" +// * MaximumFileEntriesExceededException // The number of specified files to change as part of this commit exceeds the // maximum number of files that can be changed in a single commit. Consider // using a Git client for these changes. // -// * ErrCodePutFileEntryConflictException "PutFileEntryConflictException" +// * PutFileEntryConflictException // The commit cannot be created because one or more files specified in the commit // reference both a file and a folder. // -// * ErrCodeSourceFileOrContentRequiredException "SourceFileOrContentRequiredException" +// * SourceFileOrContentRequiredException // The commit cannot be created because no source files or file content have // been specified for the commit. // -// * ErrCodeFileContentAndSourceFileSpecifiedException "FileContentAndSourceFileSpecifiedException" +// * FileContentAndSourceFileSpecifiedException // The commit cannot be created because both a source file and file content // have been specified for the same file. You cannot provide both. Either specify -// a source file, or provide the file content directly. +// a source file or provide the file content directly. // -// * ErrCodePathRequiredException "PathRequiredException" +// * PathRequiredException // The folderPath for a location cannot be null. // -// * ErrCodeInvalidPathException "InvalidPathException" +// * InvalidPathException // The specified path is not valid. // -// * ErrCodeSamePathRequestException "SamePathRequestException" +// * SamePathRequestException // The commit cannot be created because one or more changes in this commit duplicate // actions in the same file path. For example, you cannot make the same delete // request to the same file in the same file path twice, or make a delete request // and a move request to the same file as part of the same commit. // -// * ErrCodeFileDoesNotExistException "FileDoesNotExistException" -// The specified file does not exist. Verify that you have provided the correct -// name of the file, including its full path and extension. +// * FileDoesNotExistException +// The specified file does not exist. Verify that you have used the correct +// file name, full path, and extension. // -// * ErrCodeFileContentSizeLimitExceededException "FileContentSizeLimitExceededException" -// The file cannot be added because it is too large. The maximum file size that -// can be added is 6 MB, and the combined file content change size is 7 MB. -// Consider making these changes using a Git client. +// * FileContentSizeLimitExceededException +// The file cannot be added because it is too large. The maximum file size is +// 6 MB, and the combined file content change size is 7 MB. Consider making +// these changes using a Git client. // -// * ErrCodeFolderContentSizeLimitExceededException "FolderContentSizeLimitExceededException" +// * FolderContentSizeLimitExceededException // The commit cannot be created because at least one of the overall changes // in the commit results in a folder whose contents exceed the limit of 6 MB. // Either reduce the number and size of your changes, or split the changes across // multiple folders. // -// * ErrCodeInvalidDeletionParameterException "InvalidDeletionParameterException" +// * InvalidDeletionParameterException // The specified deletion parameter is not valid. // -// * ErrCodeRestrictedSourceFileException "RestrictedSourceFileException" +// * RestrictedSourceFileException // The commit cannot be created because one of the changes specifies copying // or moving a .gitkeep file. // -// * ErrCodeFileModeRequiredException "FileModeRequiredException" -// The commit cannot be created because a file mode is required to update mode -// permissions for an existing file, but no file mode has been specified. +// * FileModeRequiredException +// The commit cannot be created because no file mode has been specified. A file +// mode is required to update mode permissions for a file. // -// * ErrCodeInvalidFileModeException "InvalidFileModeException" +// * InvalidFileModeException // The specified file mode permission is not valid. For a list of valid file // mode permissions, see PutFile. // -// * ErrCodeNameLengthExceededException "NameLengthExceededException" +// * NameLengthExceededException // The user name is not valid because it has exceeded the character limit for // author names. // -// * ErrCodeInvalidEmailException "InvalidEmailException" +// * InvalidEmailException // The specified email address either contains one or more characters that are // not allowed, or it exceeds the maximum number of characters allowed for an // email address. // -// * ErrCodeCommitMessageLengthExceededException "CommitMessageLengthExceededException" +// * CommitMessageLengthExceededException // The commit message is too long. Provide a shorter string. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// * ErrCodeNoChangeException "NoChangeException" +// * NoChangeException // The commit cannot be created because no changes will be made to the repository // as a result of this commit. A commit must contain at least one change. // -// * ErrCodeFileNameConflictsWithDirectoryNameException "FileNameConflictsWithDirectoryNameException" +// * FileNameConflictsWithDirectoryNameException // A file cannot be added to the repository because the specified file name // has the same name as a directory in this repository. Either provide another // name for the file, or add the file in a directory that does not match the // file name. // -// * ErrCodeDirectoryNameConflictsWithFileNameException "DirectoryNameConflictsWithFileNameException" +// * DirectoryNameConflictsWithFileNameException // A file cannot be added to the repository because the specified path name // has the same name as a file that already exists in this repository. Either // provide a different name for the file, or specify a different path for the // file. // -// * ErrCodeFilePathConflictsWithSubmodulePathException "FilePathConflictsWithSubmodulePathException" +// * FilePathConflictsWithSubmodulePathException // The commit cannot be created because a specified file path points to a submodule. // Verify that the destination files have valid file paths that do not point // to a submodule. @@ -798,107 +1261,107 @@ func (c *CodeCommit) CreatePullRequestRequest(input *CreatePullRequestInput) (re // See the AWS API reference guide for AWS CodeCommit's // API operation CreatePullRequest for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// * ErrCodeClientRequestTokenRequiredException "ClientRequestTokenRequiredException" +// * ClientRequestTokenRequiredException // A client request token is required. A client request token is an unique, -// client-generated idempotency token that when provided in a request, ensures +// client-generated idempotency token that, when provided in a request, ensures // the request cannot be repeated with a changed parameter. If a request is -// received with the same parameters and a token is included, the request will -// return information about the initial request that used that token. +// received with the same parameters and a token is included, the request returns +// information about the initial request that used that token. // -// * ErrCodeInvalidClientRequestTokenException "InvalidClientRequestTokenException" +// * InvalidClientRequestTokenException // The client request token is not valid. // -// * ErrCodeIdempotencyParameterMismatchException "IdempotencyParameterMismatchException" +// * IdempotencyParameterMismatchException // The client request token is not valid. Either the token is not in a valid -// format, or the token has been used in a previous request and cannot be re-used. +// format, or the token has been used in a previous request and cannot be reused. // -// * ErrCodeReferenceNameRequiredException "ReferenceNameRequiredException" +// * ReferenceNameRequiredException // A reference name is required, but none was provided. // -// * ErrCodeInvalidReferenceNameException "InvalidReferenceNameException" +// * InvalidReferenceNameException // The specified reference name format is not valid. Reference names must conform -// to the Git references format, for example refs/heads/master. For more information, +// to the Git references format (for example, refs/heads/master). For more information, // see Git Internals - Git References (https://git-scm.com/book/en/v2/Git-Internals-Git-References) // or consult your Git documentation. // -// * ErrCodeReferenceDoesNotExistException "ReferenceDoesNotExistException" +// * ReferenceDoesNotExistException // The specified reference does not exist. You must provide a full commit ID. // -// * ErrCodeReferenceTypeNotSupportedException "ReferenceTypeNotSupportedException" +// * ReferenceTypeNotSupportedException // The specified reference is not a supported type. // -// * ErrCodeTitleRequiredException "TitleRequiredException" +// * TitleRequiredException // A pull request title is required. It cannot be empty or null. // -// * ErrCodeInvalidTitleException "InvalidTitleException" +// * InvalidTitleException // The title of the pull request is not valid. Pull request titles cannot exceed // 100 characters in length. // -// * ErrCodeInvalidDescriptionException "InvalidDescriptionException" -// The pull request description is not valid. Descriptions are limited to 1,000 -// characters in length. +// * InvalidDescriptionException +// The pull request description is not valid. Descriptions cannot be more than +// 1,000 characters. // -// * ErrCodeTargetsRequiredException "TargetsRequiredException" +// * TargetsRequiredException // An array of target objects is required. It cannot be empty or null. // -// * ErrCodeInvalidTargetsException "InvalidTargetsException" +// * InvalidTargetsException // The targets for the pull request is not valid or not in a valid format. Targets // are a list of target objects. Each target object must contain the full values // for the repository name, source branch, and destination branch for a pull // request. // -// * ErrCodeTargetRequiredException "TargetRequiredException" +// * TargetRequiredException // A pull request target is required. It cannot be empty or null. A pull request // target must contain the full values for the repository name, source branch, // and destination branch for the pull request. // -// * ErrCodeInvalidTargetException "InvalidTargetException" +// * InvalidTargetException // The target for the pull request is not valid. A target must contain the full // values for the repository name, source branch, and destination branch for // the pull request. // -// * ErrCodeMultipleRepositoriesInPullRequestException "MultipleRepositoriesInPullRequestException" +// * MultipleRepositoriesInPullRequestException // You cannot include more than one repository in a pull request. Make sure // you have specified only one repository name in your request, and then try // again. // -// * ErrCodeMaximumOpenPullRequestsExceededException "MaximumOpenPullRequestsExceededException" +// * MaximumOpenPullRequestsExceededException // You cannot create the pull request because the repository has too many open // pull requests. The maximum number of open pull requests for a repository // is 1,000. Close one or more open pull requests, and then try again. // -// * ErrCodeSourceAndDestinationAreSameException "SourceAndDestinationAreSameException" -// The source branch and the destination branch for the pull request are the -// same. You must specify different branches for the source and destination. +// * SourceAndDestinationAreSameException +// The source branch and destination branch for the pull request are the same. +// You must specify different branches for the source and destination. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreatePullRequest func (c *CodeCommit) CreatePullRequest(input *CreatePullRequestInput) (*CreatePullRequestOutput, error) { @@ -922,6 +1385,133 @@ func (c *CodeCommit) CreatePullRequestWithContext(ctx aws.Context, input *Create return out, req.Send() } +const opCreatePullRequestApprovalRule = "CreatePullRequestApprovalRule" + +// CreatePullRequestApprovalRuleRequest generates a "aws/request.Request" representing the +// client's request for the CreatePullRequestApprovalRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreatePullRequestApprovalRule for more information on using the CreatePullRequestApprovalRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreatePullRequestApprovalRuleRequest method. +// req, resp := client.CreatePullRequestApprovalRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreatePullRequestApprovalRule +func (c *CodeCommit) CreatePullRequestApprovalRuleRequest(input *CreatePullRequestApprovalRuleInput) (req *request.Request, output *CreatePullRequestApprovalRuleOutput) { + op := &request.Operation{ + Name: opCreatePullRequestApprovalRule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreatePullRequestApprovalRuleInput{} + } + + output = &CreatePullRequestApprovalRuleOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreatePullRequestApprovalRule API operation for AWS CodeCommit. +// +// Creates an approval rule for a pull 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 CodeCommit's +// API operation CreatePullRequestApprovalRule for usage and error information. +// +// Returned Error Types: +// * ApprovalRuleNameRequiredException +// An approval rule name is required, but was not specified. +// +// * InvalidApprovalRuleNameException +// The name for the approval rule is not valid. +// +// * ApprovalRuleNameAlreadyExistsException +// An approval rule with that name already exists. Approval rule names must +// be unique within the scope of a pull request. +// +// * ApprovalRuleContentRequiredException +// The content for the approval rule is empty. You must provide some content +// for an approval rule. The content cannot be null. +// +// * InvalidApprovalRuleContentException +// The content for the approval rule is not valid. +// +// * NumberOfRulesExceededException +// The approval rule cannot be added. The pull request has the maximum number +// of approval rules associated with it. +// +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. +// +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. +// +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. +// +// * PullRequestAlreadyClosedException +// The pull request status cannot be updated because it is already closed. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreatePullRequestApprovalRule +func (c *CodeCommit) CreatePullRequestApprovalRule(input *CreatePullRequestApprovalRuleInput) (*CreatePullRequestApprovalRuleOutput, error) { + req, out := c.CreatePullRequestApprovalRuleRequest(input) + return out, req.Send() +} + +// CreatePullRequestApprovalRuleWithContext is the same as CreatePullRequestApprovalRule with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePullRequestApprovalRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) CreatePullRequestApprovalRuleWithContext(ctx aws.Context, input *CreatePullRequestApprovalRuleInput, opts ...request.Option) (*CreatePullRequestApprovalRuleOutput, error) { + req, out := c.CreatePullRequestApprovalRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateRepository = "CreateRepository" // CreateRepositoryRequest generates a "aws/request.Request" representing the @@ -975,51 +1565,51 @@ func (c *CodeCommit) CreateRepositoryRequest(input *CreateRepositoryInput) (req // See the AWS API reference guide for AWS CodeCommit's // API operation CreateRepository for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameExistsException "RepositoryNameExistsException" +// Returned Error Types: +// * RepositoryNameExistsException // The specified repository name already exists. // -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * InvalidRepositoryDescriptionException // The specified repository description is not valid. // -// * ErrCodeRepositoryLimitExceededException "RepositoryLimitExceededException" +// * RepositoryLimitExceededException // A repository resource limit was exceeded. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// * ErrCodeInvalidTagsMapException "InvalidTagsMapException" +// * InvalidTagsMapException // The map of tags is not valid. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // The maximum number of tags for an AWS CodeCommit resource has been exceeded. // -// * ErrCodeInvalidSystemTagUsageException "InvalidSystemTagUsageException" +// * InvalidSystemTagUsageException // The specified tag is not valid. Key names cannot be prefixed with aws:. // -// * ErrCodeTagPolicyException "TagPolicyException" +// * TagPolicyException // The tag policy is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateRepository @@ -1091,7 +1681,7 @@ func (c *CodeCommit) CreateUnreferencedMergeCommitRequest(input *CreateUnreferen // Creates an unreferenced commit that represents the result of merging two // branches using a specified merge strategy. This can help you determine the // outcome of a potential merge. This API cannot be used with the fast-forward -// merge strategy, as that strategy does not create a merge commit. +// merge strategy because that strategy does not create a merge commit. // // This unreferenced merge commit can only be accessed using the GetCommit API // or through git commands such as git fetch. To retrieve this commit, you must @@ -1104,138 +1694,138 @@ func (c *CodeCommit) CreateUnreferencedMergeCommitRequest(input *CreateUnreferen // See the AWS API reference guide for AWS CodeCommit's // API operation CreateUnreferencedMergeCommit for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeTipsDivergenceExceededException "TipsDivergenceExceededException" +// * TipsDivergenceExceededException // The divergence between the tips of the provided commit specifiers is too // great to determine whether there might be any merge conflicts. Locally compare // the specifiers using git diff or a diff tool. // -// * ErrCodeCommitRequiredException "CommitRequiredException" +// * CommitRequiredException // A commit was not specified. // -// * ErrCodeInvalidCommitException "InvalidCommitException" +// * InvalidCommitException // The specified commit is not valid. // -// * ErrCodeCommitDoesNotExistException "CommitDoesNotExistException" +// * CommitDoesNotExistException // The specified commit does not exist or no commit was specified, and the specified // repository has no default branch. // -// * ErrCodeMergeOptionRequiredException "MergeOptionRequiredException" +// * MergeOptionRequiredException // A merge option or stategy is required, and none was provided. // -// * ErrCodeInvalidMergeOptionException "InvalidMergeOptionException" +// * InvalidMergeOptionException // The specified merge option is not valid for this operation. Not all merge // strategies are supported for all operations. // -// * ErrCodeInvalidConflictDetailLevelException "InvalidConflictDetailLevelException" +// * InvalidConflictDetailLevelException // The specified conflict detail level is not valid. // -// * ErrCodeInvalidConflictResolutionStrategyException "InvalidConflictResolutionStrategyException" +// * InvalidConflictResolutionStrategyException // The specified conflict resolution strategy is not valid. // -// * ErrCodeInvalidConflictResolutionException "InvalidConflictResolutionException" +// * InvalidConflictResolutionException // The specified conflict resolution list is not valid. // -// * ErrCodeManualMergeRequiredException "ManualMergeRequiredException" +// * ManualMergeRequiredException // The pull request cannot be merged automatically into the destination branch. // You must manually merge the branches and resolve any conflicts. // -// * ErrCodeMaximumConflictResolutionEntriesExceededException "MaximumConflictResolutionEntriesExceededException" +// * MaximumConflictResolutionEntriesExceededException // The number of allowed conflict resolution entries was exceeded. // -// * ErrCodeMultipleConflictResolutionEntriesException "MultipleConflictResolutionEntriesException" +// * MultipleConflictResolutionEntriesException // More than one conflict resolution entries exists for the conflict. A conflict // can have only one conflict resolution entry. // -// * ErrCodeReplacementTypeRequiredException "ReplacementTypeRequiredException" +// * ReplacementTypeRequiredException // A replacement type is required. // -// * ErrCodeInvalidReplacementTypeException "InvalidReplacementTypeException" +// * InvalidReplacementTypeException // Automerge was specified for resolving the conflict, but the specified replacement // type is not valid. // -// * ErrCodeReplacementContentRequiredException "ReplacementContentRequiredException" -// USE_NEW_CONTENT was specified but no replacement content has been provided. +// * ReplacementContentRequiredException +// USE_NEW_CONTENT was specified, but no replacement content has been provided. // -// * ErrCodeInvalidReplacementContentException "InvalidReplacementContentException" +// * InvalidReplacementContentException // Automerge was specified for resolving the conflict, but the replacement type // is not valid or content is missing. // -// * ErrCodePathRequiredException "PathRequiredException" +// * PathRequiredException // The folderPath for a location cannot be null. // -// * ErrCodeInvalidPathException "InvalidPathException" +// * InvalidPathException // The specified path is not valid. // -// * ErrCodeFileContentSizeLimitExceededException "FileContentSizeLimitExceededException" -// The file cannot be added because it is too large. The maximum file size that -// can be added is 6 MB, and the combined file content change size is 7 MB. -// Consider making these changes using a Git client. +// * FileContentSizeLimitExceededException +// The file cannot be added because it is too large. The maximum file size is +// 6 MB, and the combined file content change size is 7 MB. Consider making +// these changes using a Git client. // -// * ErrCodeFolderContentSizeLimitExceededException "FolderContentSizeLimitExceededException" +// * FolderContentSizeLimitExceededException // The commit cannot be created because at least one of the overall changes // in the commit results in a folder whose contents exceed the limit of 6 MB. // Either reduce the number and size of your changes, or split the changes across // multiple folders. // -// * ErrCodeMaximumFileContentToLoadExceededException "MaximumFileContentToLoadExceededException" +// * MaximumFileContentToLoadExceededException // The number of files to load exceeds the allowed limit. // -// * ErrCodeMaximumItemsToCompareExceededException "MaximumItemsToCompareExceededException" -// The maximum number of items to compare between the source or destination -// branches and the merge base has exceeded the maximum allowed. +// * MaximumItemsToCompareExceededException +// The number of items to compare between the source or destination branches +// and the merge base has exceeded the maximum allowed. // -// * ErrCodeConcurrentReferenceUpdateException "ConcurrentReferenceUpdateException" +// * ConcurrentReferenceUpdateException // The merge cannot be completed because the target branch has been modified. // Another user might have modified the target branch while the merge was in // progress. Wait a few minutes, and then try again. // -// * ErrCodeFileModeRequiredException "FileModeRequiredException" -// The commit cannot be created because a file mode is required to update mode -// permissions for an existing file, but no file mode has been specified. +// * FileModeRequiredException +// The commit cannot be created because no file mode has been specified. A file +// mode is required to update mode permissions for a file. // -// * ErrCodeInvalidFileModeException "InvalidFileModeException" +// * InvalidFileModeException // The specified file mode permission is not valid. For a list of valid file // mode permissions, see PutFile. // -// * ErrCodeNameLengthExceededException "NameLengthExceededException" +// * NameLengthExceededException // The user name is not valid because it has exceeded the character limit for // author names. // -// * ErrCodeInvalidEmailException "InvalidEmailException" +// * InvalidEmailException // The specified email address either contains one or more characters that are // not allowed, or it exceeds the maximum number of characters allowed for an // email address. // -// * ErrCodeCommitMessageLengthExceededException "CommitMessageLengthExceededException" +// * CommitMessageLengthExceededException // The commit message is too long. Provide a shorter string. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateUnreferencedMergeCommit @@ -1260,6 +1850,96 @@ func (c *CodeCommit) CreateUnreferencedMergeCommitWithContext(ctx aws.Context, i return out, req.Send() } +const opDeleteApprovalRuleTemplate = "DeleteApprovalRuleTemplate" + +// DeleteApprovalRuleTemplateRequest generates a "aws/request.Request" representing the +// client's request for the DeleteApprovalRuleTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteApprovalRuleTemplate for more information on using the DeleteApprovalRuleTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteApprovalRuleTemplateRequest method. +// req, resp := client.DeleteApprovalRuleTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteApprovalRuleTemplate +func (c *CodeCommit) DeleteApprovalRuleTemplateRequest(input *DeleteApprovalRuleTemplateInput) (req *request.Request, output *DeleteApprovalRuleTemplateOutput) { + op := &request.Operation{ + Name: opDeleteApprovalRuleTemplate, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteApprovalRuleTemplateInput{} + } + + output = &DeleteApprovalRuleTemplateOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteApprovalRuleTemplate API operation for AWS CodeCommit. +// +// Deletes a specified approval rule template. Deleting a template does not +// remove approval rules on pull requests already created with 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 CodeCommit's +// API operation DeleteApprovalRuleTemplate for usage and error information. +// +// Returned Error Types: +// * ApprovalRuleTemplateNameRequiredException +// An approval rule template name is required, but was not specified. +// +// * InvalidApprovalRuleTemplateNameException +// The name of the approval rule template is not valid. Template names must +// be between 1 and 100 valid characters in length. For more information about +// limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). +// +// * ApprovalRuleTemplateInUseException +// The approval rule template is associated with one or more repositories. You +// cannot delete a template that is associated with a repository. Remove all +// associations, and then try again. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteApprovalRuleTemplate +func (c *CodeCommit) DeleteApprovalRuleTemplate(input *DeleteApprovalRuleTemplateInput) (*DeleteApprovalRuleTemplateOutput, error) { + req, out := c.DeleteApprovalRuleTemplateRequest(input) + return out, req.Send() +} + +// DeleteApprovalRuleTemplateWithContext is the same as DeleteApprovalRuleTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteApprovalRuleTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) DeleteApprovalRuleTemplateWithContext(ctx aws.Context, input *DeleteApprovalRuleTemplateInput, opts ...request.Option) (*DeleteApprovalRuleTemplateOutput, error) { + req, out := c.DeleteApprovalRuleTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteBranch = "DeleteBranch" // DeleteBranchRequest generates a "aws/request.Request" representing the @@ -1314,44 +1994,44 @@ func (c *CodeCommit) DeleteBranchRequest(input *DeleteBranchInput) (req *request // See the AWS API reference guide for AWS CodeCommit's // API operation DeleteBranch for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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. +// * BranchNameRequiredException +// A branch name is required, but was not specified. // -// * ErrCodeInvalidBranchNameException "InvalidBranchNameException" +// * InvalidBranchNameException // The specified reference name is not valid. // -// * ErrCodeDefaultBranchCannotBeDeletedException "DefaultBranchCannotBeDeletedException" +// * DefaultBranchCannotBeDeletedException // The specified branch is the default branch for the repository, and cannot // be deleted. To delete this branch, you must first set another branch as the // default branch. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteBranch @@ -1429,19 +2109,19 @@ func (c *CodeCommit) DeleteCommentContentRequest(input *DeleteCommentContentInpu // See the AWS API reference guide for AWS CodeCommit's // API operation DeleteCommentContent for usage and error information. // -// Returned Error Codes: -// * ErrCodeCommentDoesNotExistException "CommentDoesNotExistException" -// No comment exists with the provided ID. Verify that you have provided the -// correct ID, and then try again. +// Returned Error Types: +// * CommentDoesNotExistException +// No comment exists with the provided ID. Verify that you have used the correct +// ID, and then try again. // -// * ErrCodeCommentIdRequiredException "CommentIdRequiredException" +// * CommentIdRequiredException // The comment ID is missing or null. A comment ID is required. // -// * ErrCodeInvalidCommentIdException "InvalidCommentIdException" +// * InvalidCommentIdException // The comment ID is not in a valid format. Make sure that you have provided // the full comment ID. // -// * ErrCodeCommentDeletedException "CommentDeletedException" +// * CommentDeletedException // This comment has already been deleted. You cannot edit or delete a deleted // comment. // @@ -1512,8 +2192,8 @@ func (c *CodeCommit) DeleteFileRequest(input *DeleteFileInput) (req *request.Req // DeleteFile API operation for AWS CodeCommit. // // Deletes a specified file from a specified branch. A commit is created on -// the branch that contains the revision. The file will still exist in the commits -// prior to the commit that contains the deletion. +// the branch that contains the revision. The file still exists in the commits +// earlier to the commit that contains the deletion. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1522,88 +2202,88 @@ func (c *CodeCommit) DeleteFileRequest(input *DeleteFileInput) (req *request.Req // See the AWS API reference guide for AWS CodeCommit's // API operation DeleteFile for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeParentCommitIdRequiredException "ParentCommitIdRequiredException" +// * ParentCommitIdRequiredException // A parent commit ID is required. To view the full commit ID of a branch in // a repository, use GetBranch or a Git command (for example, git pull or git // log). // -// * ErrCodeInvalidParentCommitIdException "InvalidParentCommitIdException" +// * InvalidParentCommitIdException // The parent commit ID is not valid. The commit ID cannot be empty, and must // match the head commit ID for the branch of the repository where you want // to add or update a file. // -// * ErrCodeParentCommitDoesNotExistException "ParentCommitDoesNotExistException" +// * ParentCommitDoesNotExistException // The parent commit ID is not valid because it does not exist. The specified // parent commit ID does not exist in the specified branch of the repository. // -// * ErrCodeParentCommitIdOutdatedException "ParentCommitIdOutdatedException" +// * ParentCommitIdOutdatedException // The file could not be added because the provided parent commit ID is not // the current tip of the specified branch. To view the full commit ID of the // current head of the branch, use GetBranch. // -// * ErrCodePathRequiredException "PathRequiredException" +// * PathRequiredException // The folderPath for a location cannot be null. // -// * ErrCodeInvalidPathException "InvalidPathException" +// * InvalidPathException // The specified path is not valid. // -// * ErrCodeFileDoesNotExistException "FileDoesNotExistException" -// The specified file does not exist. Verify that you have provided the correct -// name of the file, including its full path and extension. +// * FileDoesNotExistException +// The specified file does not exist. Verify that you have used the correct +// file name, full path, and extension. // -// * ErrCodeBranchNameRequiredException "BranchNameRequiredException" -// A branch name is required but was not specified. +// * BranchNameRequiredException +// A branch name is required, but was not specified. // -// * ErrCodeInvalidBranchNameException "InvalidBranchNameException" +// * InvalidBranchNameException // The specified reference name is not valid. // -// * ErrCodeBranchDoesNotExistException "BranchDoesNotExistException" +// * BranchDoesNotExistException // The specified branch does not exist. // -// * ErrCodeBranchNameIsTagNameException "BranchNameIsTagNameException" -// The specified branch name is not valid because it is a tag name. Type the -// name of a current branch in the repository. For a list of valid branch names, -// use ListBranches. +// * BranchNameIsTagNameException +// The specified branch name is not valid because it is a tag name. Enter the +// name of a branch in the repository. For a list of valid branch names, use +// ListBranches. // -// * ErrCodeNameLengthExceededException "NameLengthExceededException" +// * NameLengthExceededException // The user name is not valid because it has exceeded the character limit for // author names. // -// * ErrCodeInvalidEmailException "InvalidEmailException" +// * InvalidEmailException // The specified email address either contains one or more characters that are // not allowed, or it exceeds the maximum number of characters allowed for an // email address. // -// * ErrCodeCommitMessageLengthExceededException "CommitMessageLengthExceededException" +// * CommitMessageLengthExceededException // The commit message is too long. Provide a shorter string. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteFile @@ -1628,88 +2308,209 @@ func (c *CodeCommit) DeleteFileWithContext(ctx aws.Context, input *DeleteFileInp return out, req.Send() } -const opDeleteRepository = "DeleteRepository" +const opDeletePullRequestApprovalRule = "DeletePullRequestApprovalRule" -// DeleteRepositoryRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRepository operation. The "output" return +// DeletePullRequestApprovalRuleRequest generates a "aws/request.Request" representing the +// client's request for the DeletePullRequestApprovalRule operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteRepository for more information on using the DeleteRepository +// See DeletePullRequestApprovalRule for more information on using the DeletePullRequestApprovalRule // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteRepositoryRequest method. -// req, resp := client.DeleteRepositoryRequest(params) +// // Example sending a request using the DeletePullRequestApprovalRuleRequest method. +// req, resp := client.DeletePullRequestApprovalRuleRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteRepository -func (c *CodeCommit) DeleteRepositoryRequest(input *DeleteRepositoryInput) (req *request.Request, output *DeleteRepositoryOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeletePullRequestApprovalRule +func (c *CodeCommit) DeletePullRequestApprovalRuleRequest(input *DeletePullRequestApprovalRuleInput) (req *request.Request, output *DeletePullRequestApprovalRuleOutput) { op := &request.Operation{ - Name: opDeleteRepository, + Name: opDeletePullRequestApprovalRule, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteRepositoryInput{} + input = &DeletePullRequestApprovalRuleInput{} } - output = &DeleteRepositoryOutput{} + output = &DeletePullRequestApprovalRuleOutput{} 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. +// DeletePullRequestApprovalRule API operation for AWS CodeCommit. // -// 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. +// Deletes an approval rule from a specified pull request. Approval rules can +// be deleted from a pull request only if the pull request is open, and if the +// approval rule was created specifically for a pull request and not generated +// from an approval rule template associated with the repository where the pull +// request was created. You cannot delete an approval rule from a merged or +// closed pull 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 CodeCommit's -// API operation DeleteRepository for usage and error information. +// API operation DeletePullRequestApprovalRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. // -// 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. +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * PullRequestAlreadyClosedException +// The pull request status cannot be updated because it is already closed. +// +// * ApprovalRuleNameRequiredException +// An approval rule name is required, but was not specified. +// +// * InvalidApprovalRuleNameException +// The name for the approval rule is not valid. +// +// * CannotDeleteApprovalRuleFromTemplateException +// The approval rule cannot be deleted from the pull request because it was +// created by an approval rule template and applied to the pull request automatically. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeletePullRequestApprovalRule +func (c *CodeCommit) DeletePullRequestApprovalRule(input *DeletePullRequestApprovalRuleInput) (*DeletePullRequestApprovalRuleOutput, error) { + req, out := c.DeletePullRequestApprovalRuleRequest(input) + return out, req.Send() +} + +// DeletePullRequestApprovalRuleWithContext is the same as DeletePullRequestApprovalRule with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePullRequestApprovalRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) DeletePullRequestApprovalRuleWithContext(ctx aws.Context, input *DeletePullRequestApprovalRuleInput, opts ...request.Option) (*DeletePullRequestApprovalRuleOutput, error) { + req, out := c.DeletePullRequestApprovalRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteRepository = "DeleteRepository" + +// DeleteRepositoryRequest generates a "aws/request.Request" representing the +// client's request for the DeleteRepository operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteRepository for more information on using the DeleteRepository +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteRepositoryRequest method. +// req, resp := client.DeleteRepositoryRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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 is returned. +// +// Deleting a repository also deletes all associated objects and metadata. After +// a repository is deleted, all future push calls to the deleted repository +// 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 Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. +// +// * InvalidRepositoryNameException +// A specified repository name is not valid. +// +// This exception occurs only 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. +// +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DeleteRepository @@ -1787,7 +2588,7 @@ func (c *CodeCommit) DescribeMergeConflictsRequest(input *DescribeMergeConflicts // Returns information about one or more merge conflicts in the attempted merge // of two commit specifiers using the squash or three-way merge strategy. If // the merge option for the attempted merge is specified as FAST_FORWARD_MERGE, -// an exception will be thrown. +// an exception 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 @@ -1796,84 +2597,84 @@ func (c *CodeCommit) DescribeMergeConflictsRequest(input *DescribeMergeConflicts // See the AWS API reference guide for AWS CodeCommit's // API operation DescribeMergeConflicts for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeMergeOptionRequiredException "MergeOptionRequiredException" +// * MergeOptionRequiredException // A merge option or stategy is required, and none was provided. // -// * ErrCodeInvalidMergeOptionException "InvalidMergeOptionException" +// * InvalidMergeOptionException // The specified merge option is not valid for this operation. Not all merge // strategies are supported for all operations. // -// * ErrCodeInvalidContinuationTokenException "InvalidContinuationTokenException" +// * InvalidContinuationTokenException // The specified continuation token is not valid. // -// * ErrCodeCommitRequiredException "CommitRequiredException" +// * CommitRequiredException // A commit was not specified. // -// * ErrCodeCommitDoesNotExistException "CommitDoesNotExistException" +// * CommitDoesNotExistException // The specified commit does not exist or no commit was specified, and the specified // repository has no default branch. // -// * ErrCodeInvalidCommitException "InvalidCommitException" +// * InvalidCommitException // The specified commit is not valid. // -// * ErrCodeTipsDivergenceExceededException "TipsDivergenceExceededException" +// * TipsDivergenceExceededException // The divergence between the tips of the provided commit specifiers is too // great to determine whether there might be any merge conflicts. Locally compare // the specifiers using git diff or a diff tool. // -// * ErrCodePathRequiredException "PathRequiredException" +// * PathRequiredException // The folderPath for a location cannot be null. // -// * ErrCodeInvalidPathException "InvalidPathException" +// * InvalidPathException // The specified path is not valid. // -// * ErrCodeFileDoesNotExistException "FileDoesNotExistException" -// The specified file does not exist. Verify that you have provided the correct -// name of the file, including its full path and extension. +// * FileDoesNotExistException +// The specified file does not exist. Verify that you have used the correct +// file name, full path, and extension. // -// * ErrCodeInvalidMaxMergeHunksException "InvalidMaxMergeHunksException" +// * InvalidMaxMergeHunksException // The specified value for the number of merge hunks to return is not valid. // -// * ErrCodeInvalidConflictDetailLevelException "InvalidConflictDetailLevelException" +// * InvalidConflictDetailLevelException // The specified conflict detail level is not valid. // -// * ErrCodeInvalidConflictResolutionStrategyException "InvalidConflictResolutionStrategyException" +// * InvalidConflictResolutionStrategyException // The specified conflict resolution strategy is not valid. // -// * ErrCodeMaximumFileContentToLoadExceededException "MaximumFileContentToLoadExceededException" +// * MaximumFileContentToLoadExceededException // The number of files to load exceeds the allowed limit. // -// * ErrCodeMaximumItemsToCompareExceededException "MaximumItemsToCompareExceededException" -// The maximum number of items to compare between the source or destination -// branches and the merge base has exceeded the maximum allowed. +// * MaximumItemsToCompareExceededException +// The number of items to compare between the source or destination branches +// and the merge base has exceeded the maximum allowed. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DescribeMergeConflicts @@ -1941,10 +2742,12 @@ func (c *CodeCommit) DescribeMergeConflictsPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeMergeConflictsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeMergeConflictsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2007,49 +2810,49 @@ func (c *CodeCommit) DescribePullRequestEventsRequest(input *DescribePullRequest // See the AWS API reference guide for AWS CodeCommit's // API operation DescribePullRequestEvents for usage and error information. // -// Returned Error Codes: -// * ErrCodePullRequestDoesNotExistException "PullRequestDoesNotExistException" +// Returned Error Types: +// * PullRequestDoesNotExistException // The pull request ID could not be found. Make sure that you have specified // the correct repository name and pull request ID, and then try again. // -// * ErrCodeInvalidPullRequestIdException "InvalidPullRequestIdException" +// * InvalidPullRequestIdException // The pull request ID is not valid. Make sure that you have provided the full // ID and that the pull request is in the specified repository, and then try // again. // -// * ErrCodePullRequestIdRequiredException "PullRequestIdRequiredException" +// * PullRequestIdRequiredException // A pull request ID is required, but none was provided. // -// * ErrCodeInvalidPullRequestEventTypeException "InvalidPullRequestEventTypeException" +// * InvalidPullRequestEventTypeException // The pull request event type is not valid. // -// * ErrCodeInvalidActorArnException "InvalidActorArnException" +// * InvalidActorArnException // The Amazon Resource Name (ARN) is not valid. Make sure that you have provided // the full ARN for the user who initiated the change for the pull request, // and then try again. // -// * ErrCodeActorDoesNotExistException "ActorDoesNotExistException" +// * ActorDoesNotExistException // The specified Amazon Resource Name (ARN) does not exist in the AWS account. // -// * ErrCodeInvalidMaxResultsException "InvalidMaxResultsException" +// * InvalidMaxResultsException // The specified number of maximum results is not valid. // -// * ErrCodeInvalidContinuationTokenException "InvalidContinuationTokenException" +// * InvalidContinuationTokenException // The specified continuation token is not valid. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DescribePullRequestEvents @@ -2117,6897 +2920,20786 @@ func (c *CodeCommit) DescribePullRequestEventsPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribePullRequestEventsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribePullRequestEventsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opGetBlob = "GetBlob" +const opDisassociateApprovalRuleTemplateFromRepository = "DisassociateApprovalRuleTemplateFromRepository" -// GetBlobRequest generates a "aws/request.Request" representing the -// client's request for the GetBlob operation. The "output" return +// DisassociateApprovalRuleTemplateFromRepositoryRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateApprovalRuleTemplateFromRepository operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetBlob for more information on using the GetBlob +// See DisassociateApprovalRuleTemplateFromRepository for more information on using the DisassociateApprovalRuleTemplateFromRepository // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetBlobRequest method. -// req, resp := client.GetBlobRequest(params) +// // Example sending a request using the DisassociateApprovalRuleTemplateFromRepositoryRequest method. +// req, resp := client.DisassociateApprovalRuleTemplateFromRepositoryRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBlob -func (c *CodeCommit) GetBlobRequest(input *GetBlobInput) (req *request.Request, output *GetBlobOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DisassociateApprovalRuleTemplateFromRepository +func (c *CodeCommit) DisassociateApprovalRuleTemplateFromRepositoryRequest(input *DisassociateApprovalRuleTemplateFromRepositoryInput) (req *request.Request, output *DisassociateApprovalRuleTemplateFromRepositoryOutput) { op := &request.Operation{ - Name: opGetBlob, + Name: opDisassociateApprovalRuleTemplateFromRepository, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetBlobInput{} + input = &DisassociateApprovalRuleTemplateFromRepositoryInput{} } - output = &GetBlobOutput{} + output = &DisassociateApprovalRuleTemplateFromRepositoryOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// GetBlob API operation for AWS CodeCommit. +// DisassociateApprovalRuleTemplateFromRepository API operation for AWS CodeCommit. // -// Returns the base-64 encoded content of an individual blob within a repository. +// Removes the association between a template and a repository so that approval +// rules based on the template are not automatically created when pull requests +// are created in the specified repository. This does not delete any approval +// rules previously created for pull requests through the template 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 AWS CodeCommit's -// API operation GetBlob for usage and error information. +// API operation DisassociateApprovalRuleTemplateFromRepository for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * ApprovalRuleTemplateNameRequiredException +// An approval rule template name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidApprovalRuleTemplateNameException +// The name of the approval rule template is not valid. Template names must +// be between 1 and 100 valid characters in length. For more information about +// limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). // -// 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. +// * ApprovalRuleTemplateDoesNotExistException +// The specified approval rule template does not exist. Verify that the name +// is correct and that you are signed in to the AWS Region where the template +// was created, and then try again. // -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeBlobIdRequiredException "BlobIdRequiredException" -// A blob ID is required but was not specified. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// * ErrCodeInvalidBlobIdException "InvalidBlobIdException" -// The specified blob is not valid. +// This exception occurs only 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. // -// * ErrCodeBlobIdDoesNotExistException "BlobIdDoesNotExistException" -// The specified blob does not exist. +// * RepositoryDoesNotExistException +// The specified repository does not exist. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * 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 -// (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). -// -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/DisassociateApprovalRuleTemplateFromRepository +func (c *CodeCommit) DisassociateApprovalRuleTemplateFromRepository(input *DisassociateApprovalRuleTemplateFromRepositoryInput) (*DisassociateApprovalRuleTemplateFromRepositoryOutput, error) { + req, out := c.DisassociateApprovalRuleTemplateFromRepositoryRequest(input) return out, req.Send() } -// GetBlobWithContext is the same as GetBlob with the addition of +// DisassociateApprovalRuleTemplateFromRepositoryWithContext is the same as DisassociateApprovalRuleTemplateFromRepository with the addition of // the ability to pass a context and additional request options. // -// See GetBlob for details on how to use this API operation. +// See DisassociateApprovalRuleTemplateFromRepository for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) GetBlobWithContext(ctx aws.Context, input *GetBlobInput, opts ...request.Option) (*GetBlobOutput, error) { - req, out := c.GetBlobRequest(input) +func (c *CodeCommit) DisassociateApprovalRuleTemplateFromRepositoryWithContext(ctx aws.Context, input *DisassociateApprovalRuleTemplateFromRepositoryInput, opts ...request.Option) (*DisassociateApprovalRuleTemplateFromRepositoryOutput, error) { + req, out := c.DisassociateApprovalRuleTemplateFromRepositoryRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetBranch = "GetBranch" +const opEvaluatePullRequestApprovalRules = "EvaluatePullRequestApprovalRules" -// GetBranchRequest generates a "aws/request.Request" representing the -// client's request for the GetBranch operation. The "output" return +// EvaluatePullRequestApprovalRulesRequest generates a "aws/request.Request" representing the +// client's request for the EvaluatePullRequestApprovalRules operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetBranch for more information on using the GetBranch +// See EvaluatePullRequestApprovalRules for more information on using the EvaluatePullRequestApprovalRules // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetBranchRequest method. -// req, resp := client.GetBranchRequest(params) +// // Example sending a request using the EvaluatePullRequestApprovalRulesRequest method. +// req, resp := client.EvaluatePullRequestApprovalRulesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetBranch -func (c *CodeCommit) GetBranchRequest(input *GetBranchInput) (req *request.Request, output *GetBranchOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/EvaluatePullRequestApprovalRules +func (c *CodeCommit) EvaluatePullRequestApprovalRulesRequest(input *EvaluatePullRequestApprovalRulesInput) (req *request.Request, output *EvaluatePullRequestApprovalRulesOutput) { op := &request.Operation{ - Name: opGetBranch, + Name: opEvaluatePullRequestApprovalRules, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetBranchInput{} + input = &EvaluatePullRequestApprovalRulesInput{} } - output = &GetBranchOutput{} + output = &EvaluatePullRequestApprovalRulesOutput{} req = c.newRequest(op, input, output) return } -// GetBranch API operation for AWS CodeCommit. +// EvaluatePullRequestApprovalRules API operation for AWS CodeCommit. // -// Returns information about a repository branch, including its name and the -// last commit ID. +// Evaluates whether a pull request has met all the conditions specified in +// its associated approval 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 CodeCommit's -// API operation GetBranch for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// API operation EvaluatePullRequestApprovalRules for usage and error information. // -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. +// Returned Error Types: +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. // -// 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. +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. // -// * ErrCodeBranchNameRequiredException "BranchNameRequiredException" -// A branch name is required but was not specified. +// * InvalidRevisionIdException +// The revision ID is not valid. Use GetPullRequest to determine the value. // -// * ErrCodeInvalidBranchNameException "InvalidBranchNameException" -// The specified reference name is not valid. +// * RevisionIdRequiredException +// A revision ID is required, but was not provided. // -// * ErrCodeBranchDoesNotExistException "BranchDoesNotExistException" -// The specified branch does not exist. +// * RevisionNotCurrentException +// The revision ID provided in the request does not match the current revision +// ID. Use GetPullRequest to retrieve the current revision ID. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/EvaluatePullRequestApprovalRules +func (c *CodeCommit) EvaluatePullRequestApprovalRules(input *EvaluatePullRequestApprovalRulesInput) (*EvaluatePullRequestApprovalRulesOutput, error) { + req, out := c.EvaluatePullRequestApprovalRulesRequest(input) return out, req.Send() } -// GetBranchWithContext is the same as GetBranch with the addition of +// EvaluatePullRequestApprovalRulesWithContext is the same as EvaluatePullRequestApprovalRules with the addition of // the ability to pass a context and additional request options. // -// See GetBranch for details on how to use this API operation. +// See EvaluatePullRequestApprovalRules for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) GetBranchWithContext(ctx aws.Context, input *GetBranchInput, opts ...request.Option) (*GetBranchOutput, error) { - req, out := c.GetBranchRequest(input) +func (c *CodeCommit) EvaluatePullRequestApprovalRulesWithContext(ctx aws.Context, input *EvaluatePullRequestApprovalRulesInput, opts ...request.Option) (*EvaluatePullRequestApprovalRulesOutput, error) { + req, out := c.EvaluatePullRequestApprovalRulesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetComment = "GetComment" +const opGetApprovalRuleTemplate = "GetApprovalRuleTemplate" -// GetCommentRequest generates a "aws/request.Request" representing the -// client's request for the GetComment operation. The "output" return +// GetApprovalRuleTemplateRequest generates a "aws/request.Request" representing the +// client's request for the GetApprovalRuleTemplate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetComment for more information on using the GetComment +// See GetApprovalRuleTemplate for more information on using the GetApprovalRuleTemplate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetCommentRequest method. -// req, resp := client.GetCommentRequest(params) +// // Example sending a request using the GetApprovalRuleTemplateRequest method. +// req, resp := client.GetApprovalRuleTemplateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetComment -func (c *CodeCommit) GetCommentRequest(input *GetCommentInput) (req *request.Request, output *GetCommentOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetApprovalRuleTemplate +func (c *CodeCommit) GetApprovalRuleTemplateRequest(input *GetApprovalRuleTemplateInput) (req *request.Request, output *GetApprovalRuleTemplateOutput) { op := &request.Operation{ - Name: opGetComment, + Name: opGetApprovalRuleTemplate, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetCommentInput{} + input = &GetApprovalRuleTemplateInput{} } - output = &GetCommentOutput{} + output = &GetApprovalRuleTemplateOutput{} req = c.newRequest(op, input, output) return } -// GetComment API operation for AWS CodeCommit. +// GetApprovalRuleTemplate API operation for AWS CodeCommit. // -// Returns the content of a comment made on a change, file, or commit in a repository. +// Returns information about a specified approval rule 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 CodeCommit's -// API operation GetComment for usage and error information. +// API operation GetApprovalRuleTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeCommentDoesNotExistException "CommentDoesNotExistException" -// No comment exists with the provided ID. Verify that you have provided the -// correct ID, and then try again. +// Returned Error Types: +// * ApprovalRuleTemplateNameRequiredException +// An approval rule template name is required, but was not specified. // -// * ErrCodeCommentIdRequiredException "CommentIdRequiredException" -// The comment ID is missing or null. A comment ID is required. -// -// * ErrCodeInvalidCommentIdException "InvalidCommentIdException" -// The comment ID is not in a valid format. Make sure that you have provided -// the full comment ID. +// * InvalidApprovalRuleTemplateNameException +// The name of the approval rule template is not valid. Template names must +// be between 1 and 100 valid characters in length. For more information about +// limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). // -// * ErrCodeCommentDeletedException "CommentDeletedException" -// This comment has already been deleted. You cannot edit or delete a deleted -// comment. +// * ApprovalRuleTemplateDoesNotExistException +// The specified approval rule template does not exist. Verify that the name +// is correct and that you are signed in to the AWS Region where the template +// was created, and then try again. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetComment -func (c *CodeCommit) GetComment(input *GetCommentInput) (*GetCommentOutput, error) { - req, out := c.GetCommentRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetApprovalRuleTemplate +func (c *CodeCommit) GetApprovalRuleTemplate(input *GetApprovalRuleTemplateInput) (*GetApprovalRuleTemplateOutput, error) { + req, out := c.GetApprovalRuleTemplateRequest(input) return out, req.Send() } -// GetCommentWithContext is the same as GetComment with the addition of +// GetApprovalRuleTemplateWithContext is the same as GetApprovalRuleTemplate with the addition of // the ability to pass a context and additional request options. // -// See GetComment for details on how to use this API operation. +// See GetApprovalRuleTemplate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) GetCommentWithContext(ctx aws.Context, input *GetCommentInput, opts ...request.Option) (*GetCommentOutput, error) { - req, out := c.GetCommentRequest(input) +func (c *CodeCommit) GetApprovalRuleTemplateWithContext(ctx aws.Context, input *GetApprovalRuleTemplateInput, opts ...request.Option) (*GetApprovalRuleTemplateOutput, error) { + req, out := c.GetApprovalRuleTemplateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetCommentsForComparedCommit = "GetCommentsForComparedCommit" +const opGetBlob = "GetBlob" -// GetCommentsForComparedCommitRequest generates a "aws/request.Request" representing the -// client's request for the GetCommentsForComparedCommit operation. The "output" return +// GetBlobRequest generates a "aws/request.Request" representing the +// client's request for the GetBlob operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetCommentsForComparedCommit for more information on using the GetCommentsForComparedCommit +// See GetBlob for more information on using the GetBlob // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetCommentsForComparedCommitRequest method. -// req, resp := client.GetCommentsForComparedCommitRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommentsForComparedCommit -func (c *CodeCommit) GetCommentsForComparedCommitRequest(input *GetCommentsForComparedCommitInput) (req *request.Request, output *GetCommentsForComparedCommitOutput) { +// See also, 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: opGetCommentsForComparedCommit, + Name: opGetBlob, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, } if input == nil { - input = &GetCommentsForComparedCommitInput{} + input = &GetBlobInput{} } - output = &GetCommentsForComparedCommitOutput{} + output = &GetBlobOutput{} req = c.newRequest(op, input, output) return } -// GetCommentsForComparedCommit API operation for AWS CodeCommit. +// GetBlob API operation for AWS CodeCommit. // -// Returns information about comments made on the comparison between two commits. +// Returns the base-64 encoded content of an individual blob 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 GetCommentsForComparedCommit for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// API operation GetBlob for usage and error information. // -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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. // -// * ErrCodeCommitIdRequiredException "CommitIdRequiredException" -// A commit ID was not specified. -// -// * ErrCodeInvalidCommitIdException "InvalidCommitIdException" -// The specified commit ID is not valid. +// * RepositoryDoesNotExistException +// The specified repository does not exist. // -// * ErrCodeCommitDoesNotExistException "CommitDoesNotExistException" -// The specified commit does not exist or no commit was specified, and the specified -// repository has no default branch. +// * BlobIdRequiredException +// A blob ID is required, but was not specified. // -// * ErrCodeInvalidMaxResultsException "InvalidMaxResultsException" -// The specified number of maximum results is not valid. +// * InvalidBlobIdException +// The specified blob is not valid. // -// * ErrCodeInvalidContinuationTokenException "InvalidContinuationTokenException" -// The specified continuation token is not valid. +// * BlobIdDoesNotExistException +// The specified blob does not exist. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommentsForComparedCommit -func (c *CodeCommit) GetCommentsForComparedCommit(input *GetCommentsForComparedCommitInput) (*GetCommentsForComparedCommitOutput, error) { - req, out := c.GetCommentsForComparedCommitRequest(input) +// * 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 +// (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). +// +// See also, 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) return out, req.Send() } -// GetCommentsForComparedCommitWithContext is the same as GetCommentsForComparedCommit with the addition of +// GetBlobWithContext is the same as GetBlob with the addition of // the ability to pass a context and additional request options. // -// See GetCommentsForComparedCommit for details on how to use this API operation. +// See GetBlob for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) GetCommentsForComparedCommitWithContext(ctx aws.Context, input *GetCommentsForComparedCommitInput, opts ...request.Option) (*GetCommentsForComparedCommitOutput, error) { - req, out := c.GetCommentsForComparedCommitRequest(input) +func (c *CodeCommit) GetBlobWithContext(ctx aws.Context, input *GetBlobInput, opts ...request.Option) (*GetBlobOutput, error) { + req, out := c.GetBlobRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// GetCommentsForComparedCommitPages iterates over the pages of a GetCommentsForComparedCommit operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetCommentsForComparedCommit 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 GetCommentsForComparedCommit operation. -// pageNum := 0 -// err := client.GetCommentsForComparedCommitPages(params, -// func(page *codecommit.GetCommentsForComparedCommitOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeCommit) GetCommentsForComparedCommitPages(input *GetCommentsForComparedCommitInput, fn func(*GetCommentsForComparedCommitOutput, bool) bool) error { - return c.GetCommentsForComparedCommitPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetCommentsForComparedCommitPagesWithContext same as GetCommentsForComparedCommitPages 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 *CodeCommit) GetCommentsForComparedCommitPagesWithContext(ctx aws.Context, input *GetCommentsForComparedCommitInput, fn func(*GetCommentsForComparedCommitOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetCommentsForComparedCommitInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetCommentsForComparedCommitRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetCommentsForComparedCommitOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opGetCommentsForPullRequest = "GetCommentsForPullRequest" +const opGetBranch = "GetBranch" -// GetCommentsForPullRequestRequest generates a "aws/request.Request" representing the -// client's request for the GetCommentsForPullRequest operation. The "output" return +// GetBranchRequest generates a "aws/request.Request" representing the +// client's request for the GetBranch operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetCommentsForPullRequest for more information on using the GetCommentsForPullRequest +// See GetBranch for more information on using the GetBranch // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetCommentsForPullRequestRequest method. -// req, resp := client.GetCommentsForPullRequestRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommentsForPullRequest -func (c *CodeCommit) GetCommentsForPullRequestRequest(input *GetCommentsForPullRequestInput) (req *request.Request, output *GetCommentsForPullRequestOutput) { +// See also, 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: opGetCommentsForPullRequest, + Name: opGetBranch, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, } if input == nil { - input = &GetCommentsForPullRequestInput{} + input = &GetBranchInput{} } - output = &GetCommentsForPullRequestOutput{} + output = &GetBranchOutput{} req = c.newRequest(op, input, output) return } -// GetCommentsForPullRequest API operation for AWS CodeCommit. +// GetBranch API operation for AWS CodeCommit. // -// Returns comments made on a pull request. +// 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 GetCommentsForPullRequest for usage and error information. -// -// Returned Error Codes: -// * ErrCodePullRequestIdRequiredException "PullRequestIdRequiredException" -// A pull request ID is required, but none was provided. -// -// * ErrCodePullRequestDoesNotExistException "PullRequestDoesNotExistException" -// The pull request ID could not be found. Make sure that you have specified -// the correct repository name and pull request ID, and then try again. -// -// * ErrCodeInvalidPullRequestIdException "InvalidPullRequestIdException" -// The pull request ID is not valid. Make sure that you have provided the full -// ID and that the pull request is in the specified repository, and then try -// again. +// API operation GetBranch for usage and error information. // -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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. // -// * ErrCodeCommitIdRequiredException "CommitIdRequiredException" -// A commit ID was not specified. -// -// * ErrCodeInvalidCommitIdException "InvalidCommitIdException" -// The specified commit ID is not valid. -// -// * ErrCodeCommitDoesNotExistException "CommitDoesNotExistException" -// The specified commit does not exist or no commit was specified, and the specified -// repository has no default branch. -// -// * ErrCodeInvalidMaxResultsException "InvalidMaxResultsException" -// The specified number of maximum results is not valid. +// * BranchNameRequiredException +// A branch name is required, but was not specified. // -// * ErrCodeInvalidContinuationTokenException "InvalidContinuationTokenException" -// The specified continuation token is not valid. +// * InvalidBranchNameException +// The specified reference name is not valid. // -// * ErrCodeRepositoryNotAssociatedWithPullRequestException "RepositoryNotAssociatedWithPullRequestException" -// The repository does not contain any pull requests with that pull request -// ID. Use GetPullRequest to verify the correct repository name for the pull -// request ID. +// * BranchDoesNotExistException +// The specified branch does not exist. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommentsForPullRequest -func (c *CodeCommit) GetCommentsForPullRequest(input *GetCommentsForPullRequestInput) (*GetCommentsForPullRequestOutput, error) { - req, out := c.GetCommentsForPullRequestRequest(input) +// See also, 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) return out, req.Send() } -// GetCommentsForPullRequestWithContext is the same as GetCommentsForPullRequest with the addition of +// GetBranchWithContext is the same as GetBranch with the addition of // the ability to pass a context and additional request options. // -// See GetCommentsForPullRequest for details on how to use this API operation. +// See GetBranch for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) GetCommentsForPullRequestWithContext(ctx aws.Context, input *GetCommentsForPullRequestInput, opts ...request.Option) (*GetCommentsForPullRequestOutput, error) { - req, out := c.GetCommentsForPullRequestRequest(input) +func (c *CodeCommit) GetBranchWithContext(ctx aws.Context, input *GetBranchInput, opts ...request.Option) (*GetBranchOutput, error) { + req, out := c.GetBranchRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// GetCommentsForPullRequestPages iterates over the pages of a GetCommentsForPullRequest operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetCommentsForPullRequest 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 GetCommentsForPullRequest operation. -// pageNum := 0 -// err := client.GetCommentsForPullRequestPages(params, -// func(page *codecommit.GetCommentsForPullRequestOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeCommit) GetCommentsForPullRequestPages(input *GetCommentsForPullRequestInput, fn func(*GetCommentsForPullRequestOutput, bool) bool) error { - return c.GetCommentsForPullRequestPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetCommentsForPullRequestPagesWithContext same as GetCommentsForPullRequestPages 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 *CodeCommit) GetCommentsForPullRequestPagesWithContext(ctx aws.Context, input *GetCommentsForPullRequestInput, fn func(*GetCommentsForPullRequestOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetCommentsForPullRequestInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetCommentsForPullRequestRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetCommentsForPullRequestOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opGetCommit = "GetCommit" +const opGetComment = "GetComment" -// GetCommitRequest generates a "aws/request.Request" representing the -// client's request for the GetCommit operation. The "output" return +// GetCommentRequest generates a "aws/request.Request" representing the +// client's request for the GetComment operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetCommit for more information on using the GetCommit +// See GetComment for more information on using the GetComment // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetCommitRequest method. -// req, resp := client.GetCommitRequest(params) +// // Example sending a request using the GetCommentRequest method. +// req, resp := client.GetCommentRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommit -func (c *CodeCommit) GetCommitRequest(input *GetCommitInput) (req *request.Request, output *GetCommitOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetComment +func (c *CodeCommit) GetCommentRequest(input *GetCommentInput) (req *request.Request, output *GetCommentOutput) { op := &request.Operation{ - Name: opGetCommit, + Name: opGetComment, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetCommitInput{} + input = &GetCommentInput{} } - output = &GetCommitOutput{} + output = &GetCommentOutput{} req = c.newRequest(op, input, output) return } -// GetCommit API operation for AWS CodeCommit. +// GetComment API operation for AWS CodeCommit. // -// Returns information about a commit, including commit message and committer -// information. +// Returns the content of a comment made on a change, file, or commit 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 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. +// API operation GetComment for usage and error information. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. +// Returned Error Types: +// * CommentDoesNotExistException +// No comment exists with the provided ID. Verify that you have used the correct +// ID, and then try again. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. +// * CommentIdRequiredException +// The comment ID is missing or null. A comment ID is required. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. +// * InvalidCommentIdException +// The comment ID is not in a valid format. Make sure that you have provided +// the full comment ID. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. +// * CommentDeletedException +// This comment has already been deleted. You cannot edit or delete a deleted +// comment. // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetComment +func (c *CodeCommit) GetComment(input *GetCommentInput) (*GetCommentOutput, error) { + req, out := c.GetCommentRequest(input) return out, req.Send() } -// GetCommitWithContext is the same as GetCommit with the addition of +// GetCommentWithContext is the same as GetComment with the addition of // the ability to pass a context and additional request options. // -// See GetCommit for details on how to use this API operation. +// See GetComment for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) GetCommitWithContext(ctx aws.Context, input *GetCommitInput, opts ...request.Option) (*GetCommitOutput, error) { - req, out := c.GetCommitRequest(input) +func (c *CodeCommit) GetCommentWithContext(ctx aws.Context, input *GetCommentInput, opts ...request.Option) (*GetCommentOutput, error) { + req, out := c.GetCommentRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetDifferences = "GetDifferences" +const opGetCommentsForComparedCommit = "GetCommentsForComparedCommit" -// GetDifferencesRequest generates a "aws/request.Request" representing the -// client's request for the GetDifferences operation. The "output" return +// GetCommentsForComparedCommitRequest generates a "aws/request.Request" representing the +// client's request for the GetCommentsForComparedCommit operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetDifferences for more information on using the GetDifferences +// See GetCommentsForComparedCommit for more information on using the GetCommentsForComparedCommit // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetDifferencesRequest method. -// req, resp := client.GetDifferencesRequest(params) +// // Example sending a request using the GetCommentsForComparedCommitRequest method. +// req, resp := client.GetCommentsForComparedCommitRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetDifferences -func (c *CodeCommit) GetDifferencesRequest(input *GetDifferencesInput) (req *request.Request, output *GetDifferencesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommentsForComparedCommit +func (c *CodeCommit) GetCommentsForComparedCommitRequest(input *GetCommentsForComparedCommitInput) (req *request.Request, output *GetCommentsForComparedCommitOutput) { op := &request.Operation{ - Name: opGetDifferences, + Name: opGetCommentsForComparedCommit, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", TruncationToken: "", }, } if input == nil { - input = &GetDifferencesInput{} + input = &GetCommentsForComparedCommitInput{} } - output = &GetDifferencesOutput{} + output = &GetCommentsForComparedCommitOutput{} req = c.newRequest(op, input, output) return } -// GetDifferences API operation for AWS CodeCommit. +// GetCommentsForComparedCommit 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 information about comments made on the comparison between two commits. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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. +// API operation GetCommentsForComparedCommit for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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. +// * CommitIdRequiredException +// A commit ID was not specified. // -// * ErrCodeInvalidCommitIdException "InvalidCommitIdException" +// * 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" +// * 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. +// * InvalidMaxResultsException +// The specified number of maximum results is not valid. // -// * ErrCodePathDoesNotExistException "PathDoesNotExistException" -// The specified path does not exist. +// * InvalidContinuationTokenException +// The specified continuation token is not valid. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommentsForComparedCommit +func (c *CodeCommit) GetCommentsForComparedCommit(input *GetCommentsForComparedCommitInput) (*GetCommentsForComparedCommitOutput, error) { + req, out := c.GetCommentsForComparedCommitRequest(input) return out, req.Send() } -// GetDifferencesWithContext is the same as GetDifferences with the addition of +// GetCommentsForComparedCommitWithContext is the same as GetCommentsForComparedCommit with the addition of // the ability to pass a context and additional request options. // -// See GetDifferences for details on how to use this API operation. +// See GetCommentsForComparedCommit for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) GetDifferencesWithContext(ctx aws.Context, input *GetDifferencesInput, opts ...request.Option) (*GetDifferencesOutput, error) { - req, out := c.GetDifferencesRequest(input) +func (c *CodeCommit) GetCommentsForComparedCommitWithContext(ctx aws.Context, input *GetCommentsForComparedCommitInput, opts ...request.Option) (*GetCommentsForComparedCommitOutput, error) { + req, out := c.GetCommentsForComparedCommitRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// GetDifferencesPages iterates over the pages of a GetDifferences operation, +// GetCommentsForComparedCommitPages iterates over the pages of a GetCommentsForComparedCommit 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. +// See GetCommentsForComparedCommit 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. +// // Example iterating over at most 3 pages of a GetCommentsForComparedCommit operation. // pageNum := 0 -// err := client.GetDifferencesPages(params, -// func(page *codecommit.GetDifferencesOutput, lastPage bool) bool { +// err := client.GetCommentsForComparedCommitPages(params, +// func(page *codecommit.GetCommentsForComparedCommitOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *CodeCommit) GetDifferencesPages(input *GetDifferencesInput, fn func(*GetDifferencesOutput, bool) bool) error { - return c.GetDifferencesPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *CodeCommit) GetCommentsForComparedCommitPages(input *GetCommentsForComparedCommitInput, fn func(*GetCommentsForComparedCommitOutput, bool) bool) error { + return c.GetCommentsForComparedCommitPagesWithContext(aws.BackgroundContext(), input, fn) } -// GetDifferencesPagesWithContext same as GetDifferencesPages except +// GetCommentsForComparedCommitPagesWithContext same as GetCommentsForComparedCommitPages 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 *CodeCommit) GetDifferencesPagesWithContext(ctx aws.Context, input *GetDifferencesInput, fn func(*GetDifferencesOutput, bool) bool, opts ...request.Option) error { +func (c *CodeCommit) GetCommentsForComparedCommitPagesWithContext(ctx aws.Context, input *GetCommentsForComparedCommitInput, fn func(*GetCommentsForComparedCommitOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *GetDifferencesInput + var inCpy *GetCommentsForComparedCommitInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.GetDifferencesRequest(inCpy) + req, _ := c.GetCommentsForComparedCommitRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetDifferencesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetCommentsForComparedCommitOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opGetFile = "GetFile" +const opGetCommentsForPullRequest = "GetCommentsForPullRequest" -// GetFileRequest generates a "aws/request.Request" representing the -// client's request for the GetFile operation. The "output" return +// GetCommentsForPullRequestRequest generates a "aws/request.Request" representing the +// client's request for the GetCommentsForPullRequest operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetFile for more information on using the GetFile +// See GetCommentsForPullRequest for more information on using the GetCommentsForPullRequest // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetFileRequest method. -// req, resp := client.GetFileRequest(params) +// // Example sending a request using the GetCommentsForPullRequestRequest method. +// req, resp := client.GetCommentsForPullRequestRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetFile -func (c *CodeCommit) GetFileRequest(input *GetFileInput) (req *request.Request, output *GetFileOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommentsForPullRequest +func (c *CodeCommit) GetCommentsForPullRequestRequest(input *GetCommentsForPullRequestInput) (req *request.Request, output *GetCommentsForPullRequestOutput) { op := &request.Operation{ - Name: opGetFile, + Name: opGetCommentsForPullRequest, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, } if input == nil { - input = &GetFileInput{} + input = &GetCommentsForPullRequestInput{} } - output = &GetFileOutput{} + output = &GetCommentsForPullRequestOutput{} req = c.newRequest(op, input, output) return } -// GetFile API operation for AWS CodeCommit. +// GetCommentsForPullRequest API operation for AWS CodeCommit. // -// Returns the base-64 encoded contents of a specified file and its metadata. +// Returns comments made on a pull 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 CodeCommit's -// API operation GetFile for usage and error information. +// API operation GetCommentsForPullRequest for usage and error information. +// +// Returned Error Types: +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. +// +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. +// +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. +// +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// * RepositoryDoesNotExistException +// The specified repository does not exist. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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. +// * CommitIdRequiredException +// A commit ID was not specified. // -// * ErrCodeInvalidCommitException "InvalidCommitException" -// The specified commit is not valid. +// * InvalidCommitIdException +// The specified commit ID is not valid. // -// * ErrCodeCommitDoesNotExistException "CommitDoesNotExistException" +// * CommitDoesNotExistException // The specified commit does not exist or no commit was specified, and the specified // repository has no default branch. // -// * ErrCodePathRequiredException "PathRequiredException" -// The folderPath for a location cannot be null. +// * InvalidMaxResultsException +// The specified number of maximum results is not valid. // -// * ErrCodeInvalidPathException "InvalidPathException" -// The specified path is not valid. +// * InvalidContinuationTokenException +// The specified continuation token is not valid. // -// * ErrCodeFileDoesNotExistException "FileDoesNotExistException" -// The specified file does not exist. Verify that you have provided the correct -// name of the file, including its full path and extension. +// * RepositoryNotAssociatedWithPullRequestException +// The repository does not contain any pull requests with that pull request +// ID. Use GetPullRequest to verify the correct repository name for the pull +// request ID. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * 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 -// (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetFile -func (c *CodeCommit) GetFile(input *GetFileInput) (*GetFileOutput, error) { - req, out := c.GetFileRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetCommentsForPullRequest +func (c *CodeCommit) GetCommentsForPullRequest(input *GetCommentsForPullRequestInput) (*GetCommentsForPullRequestOutput, error) { + req, out := c.GetCommentsForPullRequestRequest(input) return out, req.Send() } -// GetFileWithContext is the same as GetFile with the addition of +// GetCommentsForPullRequestWithContext is the same as GetCommentsForPullRequest with the addition of // the ability to pass a context and additional request options. // -// See GetFile for details on how to use this API operation. +// See GetCommentsForPullRequest for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) GetFileWithContext(ctx aws.Context, input *GetFileInput, opts ...request.Option) (*GetFileOutput, error) { - req, out := c.GetFileRequest(input) +func (c *CodeCommit) GetCommentsForPullRequestWithContext(ctx aws.Context, input *GetCommentsForPullRequestInput, opts ...request.Option) (*GetCommentsForPullRequestOutput, error) { + req, out := c.GetCommentsForPullRequestRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetFolder = "GetFolder" +// GetCommentsForPullRequestPages iterates over the pages of a GetCommentsForPullRequest operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetCommentsForPullRequest 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 GetCommentsForPullRequest operation. +// pageNum := 0 +// err := client.GetCommentsForPullRequestPages(params, +// func(page *codecommit.GetCommentsForPullRequestOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CodeCommit) GetCommentsForPullRequestPages(input *GetCommentsForPullRequestInput, fn func(*GetCommentsForPullRequestOutput, bool) bool) error { + return c.GetCommentsForPullRequestPagesWithContext(aws.BackgroundContext(), input, fn) +} -// GetFolderRequest generates a "aws/request.Request" representing the -// client's request for the GetFolder operation. The "output" return +// GetCommentsForPullRequestPagesWithContext same as GetCommentsForPullRequestPages 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 *CodeCommit) GetCommentsForPullRequestPagesWithContext(ctx aws.Context, input *GetCommentsForPullRequestInput, fn func(*GetCommentsForPullRequestOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetCommentsForPullRequestInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetCommentsForPullRequestRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*GetCommentsForPullRequestOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opGetCommit = "GetCommit" + +// GetCommitRequest generates a "aws/request.Request" representing the +// client's request for the GetCommit operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetFolder for more information on using the GetFolder +// See GetCommit for more information on using the GetCommit // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetFolderRequest method. -// req, resp := client.GetFolderRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetFolder -func (c *CodeCommit) GetFolderRequest(input *GetFolderInput) (req *request.Request, output *GetFolderOutput) { +// See also, 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: opGetFolder, + Name: opGetCommit, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetFolderInput{} + input = &GetCommitInput{} } - output = &GetFolderOutput{} + output = &GetCommitOutput{} req = c.newRequest(op, input, output) return } -// GetFolder API operation for AWS CodeCommit. +// GetCommit API operation for AWS CodeCommit. // -// Returns the contents of a specified folder in a repository. +// 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 GetFolder for usage and error information. +// API operation GetCommit for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * 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. -// -// * ErrCodePathRequiredException "PathRequiredException" -// The folderPath for a location cannot be null. +// * CommitIdRequiredException +// A commit ID was not specified. // -// * ErrCodeInvalidPathException "InvalidPathException" -// The specified path is not valid. +// * InvalidCommitIdException +// The specified commit ID is not valid. // -// * ErrCodeFolderDoesNotExistException "FolderDoesNotExistException" -// The specified folder does not exist. Either the folder name is not correct, -// or you did not provide the full path to the folder. +// * CommitIdDoesNotExistException +// The specified commit ID does not exist. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetFolder -func (c *CodeCommit) GetFolder(input *GetFolderInput) (*GetFolderOutput, error) { - req, out := c.GetFolderRequest(input) +// See also, 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) return out, req.Send() } -// GetFolderWithContext is the same as GetFolder with the addition of +// GetCommitWithContext is the same as GetCommit with the addition of // the ability to pass a context and additional request options. // -// See GetFolder for details on how to use this API operation. +// See GetCommit for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) GetFolderWithContext(ctx aws.Context, input *GetFolderInput, opts ...request.Option) (*GetFolderOutput, error) { - req, out := c.GetFolderRequest(input) +func (c *CodeCommit) GetCommitWithContext(ctx aws.Context, input *GetCommitInput, opts ...request.Option) (*GetCommitOutput, error) { + req, out := c.GetCommitRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetMergeCommit = "GetMergeCommit" +const opGetDifferences = "GetDifferences" -// GetMergeCommitRequest generates a "aws/request.Request" representing the -// client's request for the GetMergeCommit operation. The "output" return +// GetDifferencesRequest generates a "aws/request.Request" representing the +// client's request for the GetDifferences operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetMergeCommit for more information on using the GetMergeCommit +// See GetDifferences for more information on using the GetDifferences // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetMergeCommitRequest method. -// req, resp := client.GetMergeCommitRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeCommit -func (c *CodeCommit) GetMergeCommitRequest(input *GetMergeCommitInput) (req *request.Request, output *GetMergeCommitOutput) { +// See also, 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: opGetMergeCommit, + Name: opGetDifferences, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } - if input == nil { - input = &GetMergeCommitInput{} - } - - output = &GetMergeCommitOutput{} + if input == nil { + input = &GetDifferencesInput{} + } + + output = &GetDifferencesOutput{} req = c.newRequest(op, input, output) return } -// GetMergeCommit API operation for AWS CodeCommit. +// GetDifferences API operation for AWS CodeCommit. // -// Returns information about a specified merge commit. +// 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 GetMergeCommit for usage and error information. +// API operation GetDifferences for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * RepositoryDoesNotExistException +// The specified repository does not exist. +// +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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. +// * InvalidContinuationTokenException +// The specified continuation token is not valid. // -// * ErrCodeCommitRequiredException "CommitRequiredException" +// * InvalidMaxResultsException +// The specified number of maximum results is not valid. +// +// * InvalidCommitIdException +// The specified commit ID is not valid. +// +// * CommitRequiredException // A commit was not specified. // -// * ErrCodeInvalidCommitException "InvalidCommitException" +// * InvalidCommitException // The specified commit is not valid. // -// * ErrCodeCommitDoesNotExistException "CommitDoesNotExistException" +// * CommitDoesNotExistException // The specified commit does not exist or no commit was specified, and the specified // repository has no default branch. // -// * ErrCodeInvalidConflictDetailLevelException "InvalidConflictDetailLevelException" -// The specified conflict detail level is not valid. +// * InvalidPathException +// The specified path is not valid. // -// * ErrCodeInvalidConflictResolutionStrategyException "InvalidConflictResolutionStrategyException" -// The specified conflict resolution strategy is not valid. +// * PathDoesNotExistException +// The specified path does not exist. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeCommit -func (c *CodeCommit) GetMergeCommit(input *GetMergeCommitInput) (*GetMergeCommitOutput, error) { - req, out := c.GetMergeCommitRequest(input) +// See also, 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) return out, req.Send() } -// GetMergeCommitWithContext is the same as GetMergeCommit with the addition of +// GetDifferencesWithContext is the same as GetDifferences with the addition of // the ability to pass a context and additional request options. // -// See GetMergeCommit for details on how to use this API operation. +// See GetDifferences for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) GetMergeCommitWithContext(ctx aws.Context, input *GetMergeCommitInput, opts ...request.Option) (*GetMergeCommitOutput, error) { - req, out := c.GetMergeCommitRequest(input) +func (c *CodeCommit) GetDifferencesWithContext(ctx aws.Context, input *GetDifferencesInput, opts ...request.Option) (*GetDifferencesOutput, error) { + req, out := c.GetDifferencesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetMergeConflicts = "GetMergeConflicts" +// 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 *codecommit.GetDifferencesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CodeCommit) GetDifferencesPages(input *GetDifferencesInput, fn func(*GetDifferencesOutput, bool) bool) error { + return c.GetDifferencesPagesWithContext(aws.BackgroundContext(), input, fn) +} -// GetMergeConflictsRequest generates a "aws/request.Request" representing the -// client's request for the GetMergeConflicts operation. The "output" return +// GetDifferencesPagesWithContext same as GetDifferencesPages 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 *CodeCommit) GetDifferencesPagesWithContext(ctx aws.Context, input *GetDifferencesInput, fn func(*GetDifferencesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetDifferencesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetDifferencesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*GetDifferencesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opGetFile = "GetFile" + +// GetFileRequest generates a "aws/request.Request" representing the +// client's request for the GetFile operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetMergeConflicts for more information on using the GetMergeConflicts +// See GetFile for more information on using the GetFile // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetMergeConflictsRequest method. -// req, resp := client.GetMergeConflictsRequest(params) +// // Example sending a request using the GetFileRequest method. +// req, resp := client.GetFileRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeConflicts -func (c *CodeCommit) GetMergeConflictsRequest(input *GetMergeConflictsInput) (req *request.Request, output *GetMergeConflictsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetFile +func (c *CodeCommit) GetFileRequest(input *GetFileInput) (req *request.Request, output *GetFileOutput) { op := &request.Operation{ - Name: opGetMergeConflicts, + Name: opGetFile, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxConflictFiles", - TruncationToken: "", - }, } if input == nil { - input = &GetMergeConflictsInput{} + input = &GetFileInput{} } - output = &GetMergeConflictsOutput{} + output = &GetFileOutput{} req = c.newRequest(op, input, output) return } -// GetMergeConflicts API operation for AWS CodeCommit. +// GetFile API operation for AWS CodeCommit. // -// Returns information about merge conflicts between the before and after commit -// IDs for a pull request in a repository. +// Returns the base-64 encoded contents of a specified file and its metadata. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 GetMergeConflicts for usage and error information. +// API operation GetFile for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeMergeOptionRequiredException "MergeOptionRequiredException" -// A merge option or stategy is required, and none was provided. -// -// * ErrCodeInvalidMergeOptionException "InvalidMergeOptionException" -// The specified merge option is not valid for this operation. Not all merge -// strategies are supported for all operations. -// -// * ErrCodeInvalidContinuationTokenException "InvalidContinuationTokenException" -// The specified continuation token is not valid. -// -// * ErrCodeCommitRequiredException "CommitRequiredException" -// A commit was not specified. +// * InvalidCommitException +// The specified commit is not valid. // -// * ErrCodeCommitDoesNotExistException "CommitDoesNotExistException" +// * CommitDoesNotExistException // The specified commit does not exist or no commit was specified, and the specified // repository has no default branch. // -// * ErrCodeInvalidCommitException "InvalidCommitException" -// The specified commit is not valid. -// -// * ErrCodeTipsDivergenceExceededException "TipsDivergenceExceededException" -// The divergence between the tips of the provided commit specifiers is too -// great to determine whether there might be any merge conflicts. Locally compare -// the specifiers using git diff or a diff tool. -// -// * ErrCodeInvalidMaxConflictFilesException "InvalidMaxConflictFilesException" -// The specified value for the number of conflict files to return is not valid. -// -// * ErrCodeInvalidConflictDetailLevelException "InvalidConflictDetailLevelException" -// The specified conflict detail level is not valid. -// -// * ErrCodeInvalidDestinationCommitSpecifierException "InvalidDestinationCommitSpecifierException" -// The destination commit specifier is not valid. You must provide a valid branch -// name, tag, or full commit ID. -// -// * ErrCodeInvalidSourceCommitSpecifierException "InvalidSourceCommitSpecifierException" -// The source commit specifier is not valid. You must provide a valid branch -// name, tag, or full commit ID. -// -// * ErrCodeInvalidConflictResolutionStrategyException "InvalidConflictResolutionStrategyException" -// The specified conflict resolution strategy is not valid. +// * PathRequiredException +// The folderPath for a location cannot be null. // -// * ErrCodeMaximumFileContentToLoadExceededException "MaximumFileContentToLoadExceededException" -// The number of files to load exceeds the allowed limit. +// * InvalidPathException +// The specified path is not valid. // -// * ErrCodeMaximumItemsToCompareExceededException "MaximumItemsToCompareExceededException" -// The maximum number of items to compare between the source or destination -// branches and the merge base has exceeded the maximum allowed. +// * FileDoesNotExistException +// The specified file does not exist. Verify that you have used the correct +// file name, full path, and extension. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeConflicts -func (c *CodeCommit) GetMergeConflicts(input *GetMergeConflictsInput) (*GetMergeConflictsOutput, error) { - req, out := c.GetMergeConflictsRequest(input) +// * 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 +// (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetFile +func (c *CodeCommit) GetFile(input *GetFileInput) (*GetFileOutput, error) { + req, out := c.GetFileRequest(input) return out, req.Send() } -// GetMergeConflictsWithContext is the same as GetMergeConflicts with the addition of +// GetFileWithContext is the same as GetFile with the addition of // the ability to pass a context and additional request options. // -// See GetMergeConflicts for details on how to use this API operation. +// See GetFile for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) GetMergeConflictsWithContext(ctx aws.Context, input *GetMergeConflictsInput, opts ...request.Option) (*GetMergeConflictsOutput, error) { - req, out := c.GetMergeConflictsRequest(input) +func (c *CodeCommit) GetFileWithContext(ctx aws.Context, input *GetFileInput, opts ...request.Option) (*GetFileOutput, error) { + req, out := c.GetFileRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// GetMergeConflictsPages iterates over the pages of a GetMergeConflicts operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetMergeConflicts 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 GetMergeConflicts operation. -// pageNum := 0 -// err := client.GetMergeConflictsPages(params, -// func(page *codecommit.GetMergeConflictsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeCommit) GetMergeConflictsPages(input *GetMergeConflictsInput, fn func(*GetMergeConflictsOutput, bool) bool) error { - return c.GetMergeConflictsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetMergeConflictsPagesWithContext same as GetMergeConflictsPages 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 *CodeCommit) GetMergeConflictsPagesWithContext(ctx aws.Context, input *GetMergeConflictsInput, fn func(*GetMergeConflictsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetMergeConflictsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetMergeConflictsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetMergeConflictsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opGetMergeOptions = "GetMergeOptions" +const opGetFolder = "GetFolder" -// GetMergeOptionsRequest generates a "aws/request.Request" representing the -// client's request for the GetMergeOptions operation. The "output" return +// GetFolderRequest generates a "aws/request.Request" representing the +// client's request for the GetFolder operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetMergeOptions for more information on using the GetMergeOptions +// See GetFolder for more information on using the GetFolder // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetMergeOptionsRequest method. -// req, resp := client.GetMergeOptionsRequest(params) +// // Example sending a request using the GetFolderRequest method. +// req, resp := client.GetFolderRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeOptions -func (c *CodeCommit) GetMergeOptionsRequest(input *GetMergeOptionsInput) (req *request.Request, output *GetMergeOptionsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetFolder +func (c *CodeCommit) GetFolderRequest(input *GetFolderInput) (req *request.Request, output *GetFolderOutput) { op := &request.Operation{ - Name: opGetMergeOptions, + Name: opGetFolder, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetMergeOptionsInput{} + input = &GetFolderInput{} } - output = &GetMergeOptionsOutput{} + output = &GetFolderOutput{} req = c.newRequest(op, input, output) return } -// GetMergeOptions API operation for AWS CodeCommit. +// GetFolder API operation for AWS CodeCommit. // -// Returns information about the merge options available for merging two specified -// branches. For details about why a particular merge option is not available, -// use GetMergeConflicts or DescribeMergeConflicts. +// Returns the contents of a specified folder 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 GetMergeOptions for usage and error information. +// API operation GetFolder for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeCommitRequiredException "CommitRequiredException" -// A commit was not specified. +// * InvalidCommitException +// The specified commit is not valid. // -// * ErrCodeCommitDoesNotExistException "CommitDoesNotExistException" +// * CommitDoesNotExistException // The specified commit does not exist or no commit was specified, and the specified // repository has no default branch. // -// * ErrCodeInvalidCommitException "InvalidCommitException" -// The specified commit is not valid. +// * PathRequiredException +// The folderPath for a location cannot be null. // -// * ErrCodeTipsDivergenceExceededException "TipsDivergenceExceededException" -// The divergence between the tips of the provided commit specifiers is too -// great to determine whether there might be any merge conflicts. Locally compare -// the specifiers using git diff or a diff tool. -// -// * ErrCodeInvalidConflictDetailLevelException "InvalidConflictDetailLevelException" -// The specified conflict detail level is not valid. -// -// * ErrCodeInvalidConflictResolutionStrategyException "InvalidConflictResolutionStrategyException" -// The specified conflict resolution strategy is not valid. -// -// * ErrCodeMaximumFileContentToLoadExceededException "MaximumFileContentToLoadExceededException" -// The number of files to load exceeds the allowed limit. +// * InvalidPathException +// The specified path is not valid. // -// * ErrCodeMaximumItemsToCompareExceededException "MaximumItemsToCompareExceededException" -// The maximum number of items to compare between the source or destination -// branches and the merge base has exceeded the maximum allowed. +// * FolderDoesNotExistException +// The specified folder does not exist. Either the folder name is not correct, +// or you did not enter the full path to the folder. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeOptions -func (c *CodeCommit) GetMergeOptions(input *GetMergeOptionsInput) (*GetMergeOptionsOutput, error) { - req, out := c.GetMergeOptionsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetFolder +func (c *CodeCommit) GetFolder(input *GetFolderInput) (*GetFolderOutput, error) { + req, out := c.GetFolderRequest(input) return out, req.Send() } -// GetMergeOptionsWithContext is the same as GetMergeOptions with the addition of +// GetFolderWithContext is the same as GetFolder with the addition of // the ability to pass a context and additional request options. // -// See GetMergeOptions for details on how to use this API operation. +// See GetFolder for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) GetMergeOptionsWithContext(ctx aws.Context, input *GetMergeOptionsInput, opts ...request.Option) (*GetMergeOptionsOutput, error) { - req, out := c.GetMergeOptionsRequest(input) +func (c *CodeCommit) GetFolderWithContext(ctx aws.Context, input *GetFolderInput, opts ...request.Option) (*GetFolderOutput, error) { + req, out := c.GetFolderRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetPullRequest = "GetPullRequest" +const opGetMergeCommit = "GetMergeCommit" -// GetPullRequestRequest generates a "aws/request.Request" representing the -// client's request for the GetPullRequest operation. The "output" return +// GetMergeCommitRequest generates a "aws/request.Request" representing the +// client's request for the GetMergeCommit operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetPullRequest for more information on using the GetPullRequest +// See GetMergeCommit for more information on using the GetMergeCommit // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetPullRequestRequest method. -// req, resp := client.GetPullRequestRequest(params) +// // Example sending a request using the GetMergeCommitRequest method. +// req, resp := client.GetMergeCommitRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetPullRequest -func (c *CodeCommit) GetPullRequestRequest(input *GetPullRequestInput) (req *request.Request, output *GetPullRequestOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeCommit +func (c *CodeCommit) GetMergeCommitRequest(input *GetMergeCommitInput) (req *request.Request, output *GetMergeCommitOutput) { op := &request.Operation{ - Name: opGetPullRequest, + Name: opGetMergeCommit, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetPullRequestInput{} + input = &GetMergeCommitInput{} } - output = &GetPullRequestOutput{} + output = &GetMergeCommitOutput{} req = c.newRequest(op, input, output) return } -// GetPullRequest API operation for AWS CodeCommit. +// GetMergeCommit API operation for AWS CodeCommit. // -// Gets information about a pull request in a specified repository. +// Returns information about a specified merge commit. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 GetPullRequest for usage and error information. +// API operation GetMergeCommit for usage and error information. // -// Returned Error Codes: -// * ErrCodePullRequestDoesNotExistException "PullRequestDoesNotExistException" -// The pull request ID could not be found. Make sure that you have specified -// the correct repository name and pull request ID, and then try again. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidPullRequestIdException "InvalidPullRequestIdException" -// The pull request ID is not valid. Make sure that you have provided the full -// ID and that the pull request is in the specified repository, and then try -// again. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// * ErrCodePullRequestIdRequiredException "PullRequestIdRequiredException" -// A pull request ID is required, but none was provided. +// This exception occurs only 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. +// +// * RepositoryDoesNotExistException +// The specified repository does not exist. +// +// * CommitRequiredException +// A commit was not specified. +// +// * InvalidCommitException +// The specified commit is not valid. +// +// * CommitDoesNotExistException +// The specified commit does not exist or no commit was specified, and the specified +// repository has no default branch. +// +// * InvalidConflictDetailLevelException +// The specified conflict detail level is not valid. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * InvalidConflictResolutionStrategyException +// The specified conflict resolution strategy is not valid. +// +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetPullRequest -func (c *CodeCommit) GetPullRequest(input *GetPullRequestInput) (*GetPullRequestOutput, error) { - req, out := c.GetPullRequestRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeCommit +func (c *CodeCommit) GetMergeCommit(input *GetMergeCommitInput) (*GetMergeCommitOutput, error) { + req, out := c.GetMergeCommitRequest(input) return out, req.Send() } -// GetPullRequestWithContext is the same as GetPullRequest with the addition of +// GetMergeCommitWithContext is the same as GetMergeCommit with the addition of // the ability to pass a context and additional request options. // -// See GetPullRequest for details on how to use this API operation. +// See GetMergeCommit for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) GetPullRequestWithContext(ctx aws.Context, input *GetPullRequestInput, opts ...request.Option) (*GetPullRequestOutput, error) { - req, out := c.GetPullRequestRequest(input) +func (c *CodeCommit) GetMergeCommitWithContext(ctx aws.Context, input *GetMergeCommitInput, opts ...request.Option) (*GetMergeCommitOutput, error) { + req, out := c.GetMergeCommitRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetRepository = "GetRepository" +const opGetMergeConflicts = "GetMergeConflicts" -// GetRepositoryRequest generates a "aws/request.Request" representing the -// client's request for the GetRepository operation. The "output" return +// GetMergeConflictsRequest generates a "aws/request.Request" representing the +// client's request for the GetMergeConflicts operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetRepository for more information on using the GetRepository +// See GetMergeConflicts for more information on using the GetMergeConflicts // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetRepositoryRequest method. -// req, resp := client.GetRepositoryRequest(params) +// // Example sending a request using the GetMergeConflictsRequest method. +// req, resp := client.GetMergeConflictsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepository -func (c *CodeCommit) GetRepositoryRequest(input *GetRepositoryInput) (req *request.Request, output *GetRepositoryOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeConflicts +func (c *CodeCommit) GetMergeConflictsRequest(input *GetMergeConflictsInput) (req *request.Request, output *GetMergeConflictsOutput) { op := &request.Operation{ - Name: opGetRepository, + Name: opGetMergeConflicts, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxConflictFiles", + TruncationToken: "", + }, } if input == nil { - input = &GetRepositoryInput{} + input = &GetMergeConflictsInput{} } - output = &GetRepositoryOutput{} + output = &GetMergeConflictsOutput{} req = c.newRequest(op, input, output) return } -// GetRepository API operation for AWS CodeCommit. -// -// Returns information about a repository. +// GetMergeConflicts API operation for AWS CodeCommit. // -// 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 information about merge conflicts between the before and after commit +// IDs for a pull request 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 GetRepository for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// API operation GetMergeConflicts for usage and error information. // -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException +// The specified repository does not exist. +// +// * MergeOptionRequiredException +// A merge option or stategy is required, and none was provided. +// +// * InvalidMergeOptionException +// The specified merge option is not valid for this operation. Not all merge +// strategies are supported for all operations. +// +// * InvalidContinuationTokenException +// The specified continuation token is not valid. +// +// * CommitRequiredException +// A commit was not specified. +// +// * CommitDoesNotExistException +// The specified commit does not exist or no commit was specified, and the specified +// repository has no default branch. +// +// * InvalidCommitException +// The specified commit is not valid. +// +// * TipsDivergenceExceededException +// The divergence between the tips of the provided commit specifiers is too +// great to determine whether there might be any merge conflicts. Locally compare +// the specifiers using git diff or a diff tool. +// +// * InvalidMaxConflictFilesException +// The specified value for the number of conflict files to return is not valid. +// +// * InvalidConflictDetailLevelException +// The specified conflict detail level is not valid. +// +// * InvalidDestinationCommitSpecifierException +// The destination commit specifier is not valid. You must provide a valid branch +// name, tag, or full commit ID. +// +// * InvalidSourceCommitSpecifierException +// The source commit specifier is not valid. You must provide a valid branch +// name, tag, or full commit ID. +// +// * InvalidConflictResolutionStrategyException +// The specified conflict resolution strategy is not valid. +// +// * MaximumFileContentToLoadExceededException +// The number of files to load exceeds the allowed limit. +// +// * MaximumItemsToCompareExceededException +// The number of items to compare between the source or destination branches +// and the merge base has exceeded the maximum allowed. +// +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeConflicts +func (c *CodeCommit) GetMergeConflicts(input *GetMergeConflictsInput) (*GetMergeConflictsOutput, error) { + req, out := c.GetMergeConflictsRequest(input) return out, req.Send() } -// GetRepositoryWithContext is the same as GetRepository with the addition of +// GetMergeConflictsWithContext is the same as GetMergeConflicts with the addition of // the ability to pass a context and additional request options. // -// See GetRepository for details on how to use this API operation. +// See GetMergeConflicts for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) GetRepositoryWithContext(ctx aws.Context, input *GetRepositoryInput, opts ...request.Option) (*GetRepositoryOutput, error) { - req, out := c.GetRepositoryRequest(input) +func (c *CodeCommit) GetMergeConflictsWithContext(ctx aws.Context, input *GetMergeConflictsInput, opts ...request.Option) (*GetMergeConflictsOutput, error) { + req, out := c.GetMergeConflictsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetRepositoryTriggers = "GetRepositoryTriggers" +// GetMergeConflictsPages iterates over the pages of a GetMergeConflicts operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetMergeConflicts 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 GetMergeConflicts operation. +// pageNum := 0 +// err := client.GetMergeConflictsPages(params, +// func(page *codecommit.GetMergeConflictsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CodeCommit) GetMergeConflictsPages(input *GetMergeConflictsInput, fn func(*GetMergeConflictsOutput, bool) bool) error { + return c.GetMergeConflictsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// GetRepositoryTriggersRequest generates a "aws/request.Request" representing the -// client's request for the GetRepositoryTriggers operation. The "output" return +// GetMergeConflictsPagesWithContext same as GetMergeConflictsPages 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 *CodeCommit) GetMergeConflictsPagesWithContext(ctx aws.Context, input *GetMergeConflictsInput, fn func(*GetMergeConflictsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetMergeConflictsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetMergeConflictsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*GetMergeConflictsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opGetMergeOptions = "GetMergeOptions" + +// GetMergeOptionsRequest generates a "aws/request.Request" representing the +// client's request for the GetMergeOptions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetRepositoryTriggers for more information on using the GetRepositoryTriggers +// See GetMergeOptions for more information on using the GetMergeOptions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetRepositoryTriggersRequest method. -// req, resp := client.GetRepositoryTriggersRequest(params) +// // Example sending a request using the GetMergeOptionsRequest method. +// req, resp := client.GetMergeOptionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetRepositoryTriggers -func (c *CodeCommit) GetRepositoryTriggersRequest(input *GetRepositoryTriggersInput) (req *request.Request, output *GetRepositoryTriggersOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeOptions +func (c *CodeCommit) GetMergeOptionsRequest(input *GetMergeOptionsInput) (req *request.Request, output *GetMergeOptionsOutput) { op := &request.Operation{ - Name: opGetRepositoryTriggers, + Name: opGetMergeOptions, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetRepositoryTriggersInput{} + input = &GetMergeOptionsInput{} } - output = &GetRepositoryTriggersOutput{} + output = &GetMergeOptionsOutput{} req = c.newRequest(op, input, output) return } -// GetRepositoryTriggers API operation for AWS CodeCommit. +// GetMergeOptions API operation for AWS CodeCommit. // -// Gets information about triggers configured for a repository. +// Returns information about the merge options available for merging two specified +// branches. For details about why a merge option is not available, use GetMergeConflicts +// or DescribeMergeConflicts. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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. +// API operation GetMergeOptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. +// * CommitRequiredException +// A commit was not specified. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * CommitDoesNotExistException +// The specified commit does not exist or no commit was specified, and the specified +// repository has no default branch. +// +// * InvalidCommitException +// The specified commit is not valid. +// +// * TipsDivergenceExceededException +// The divergence between the tips of the provided commit specifiers is too +// great to determine whether there might be any merge conflicts. Locally compare +// the specifiers using git diff or a diff tool. +// +// * InvalidConflictDetailLevelException +// The specified conflict detail level is not valid. +// +// * InvalidConflictResolutionStrategyException +// The specified conflict resolution strategy is not valid. +// +// * MaximumFileContentToLoadExceededException +// The number of files to load exceeds the allowed limit. +// +// * MaximumItemsToCompareExceededException +// The number of items to compare between the source or destination branches +// and the merge base has exceeded the maximum allowed. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetMergeOptions +func (c *CodeCommit) GetMergeOptions(input *GetMergeOptionsInput) (*GetMergeOptionsOutput, error) { + req, out := c.GetMergeOptionsRequest(input) return out, req.Send() } -// GetRepositoryTriggersWithContext is the same as GetRepositoryTriggers with the addition of +// GetMergeOptionsWithContext is the same as GetMergeOptions with the addition of // the ability to pass a context and additional request options. // -// See GetRepositoryTriggers for details on how to use this API operation. +// See GetMergeOptions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) GetRepositoryTriggersWithContext(ctx aws.Context, input *GetRepositoryTriggersInput, opts ...request.Option) (*GetRepositoryTriggersOutput, error) { - req, out := c.GetRepositoryTriggersRequest(input) +func (c *CodeCommit) GetMergeOptionsWithContext(ctx aws.Context, input *GetMergeOptionsInput, opts ...request.Option) (*GetMergeOptionsOutput, error) { + req, out := c.GetMergeOptionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListBranches = "ListBranches" +const opGetPullRequest = "GetPullRequest" -// ListBranchesRequest generates a "aws/request.Request" representing the -// client's request for the ListBranches operation. The "output" return +// GetPullRequestRequest generates a "aws/request.Request" representing the +// client's request for the GetPullRequest operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListBranches for more information on using the ListBranches +// See GetPullRequest for more information on using the GetPullRequest // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListBranchesRequest method. -// req, resp := client.ListBranchesRequest(params) +// // Example sending a request using the GetPullRequestRequest method. +// req, resp := client.GetPullRequestRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListBranches -func (c *CodeCommit) ListBranchesRequest(input *ListBranchesInput) (req *request.Request, output *ListBranchesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetPullRequest +func (c *CodeCommit) GetPullRequestRequest(input *GetPullRequestInput) (req *request.Request, output *GetPullRequestOutput) { op := &request.Operation{ - Name: opListBranches, + Name: opGetPullRequest, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, } if input == nil { - input = &ListBranchesInput{} + input = &GetPullRequestInput{} } - output = &ListBranchesOutput{} + output = &GetPullRequestOutput{} req = c.newRequest(op, input, output) return } -// ListBranches API operation for AWS CodeCommit. +// GetPullRequest API operation for AWS CodeCommit. // -// Gets information about one or more branches in a repository. +// Gets information about a pull request in 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 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. +// API operation GetPullRequest for usage and error information. // -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. +// Returned Error Types: +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. // -// 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. +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// * ErrCodeInvalidContinuationTokenException "InvalidContinuationTokenException" -// The specified continuation token is not valid. -// -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetPullRequest +func (c *CodeCommit) GetPullRequest(input *GetPullRequestInput) (*GetPullRequestOutput, error) { + req, out := c.GetPullRequestRequest(input) return out, req.Send() } -// ListBranchesWithContext is the same as ListBranches with the addition of +// GetPullRequestWithContext is the same as GetPullRequest with the addition of // the ability to pass a context and additional request options. // -// See ListBranches for details on how to use this API operation. +// See GetPullRequest for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) ListBranchesWithContext(ctx aws.Context, input *ListBranchesInput, opts ...request.Option) (*ListBranchesOutput, error) { - req, out := c.ListBranchesRequest(input) +func (c *CodeCommit) GetPullRequestWithContext(ctx aws.Context, input *GetPullRequestInput, opts ...request.Option) (*GetPullRequestOutput, error) { + req, out := c.GetPullRequestRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// 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 *codecommit.ListBranchesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeCommit) ListBranchesPages(input *ListBranchesInput, fn func(*ListBranchesOutput, bool) bool) error { - return c.ListBranchesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListBranchesPagesWithContext same as ListBranchesPages 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 *CodeCommit) ListBranchesPagesWithContext(ctx aws.Context, input *ListBranchesInput, fn func(*ListBranchesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListBranchesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListBranchesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListBranchesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListPullRequests = "ListPullRequests" +const opGetPullRequestApprovalStates = "GetPullRequestApprovalStates" -// ListPullRequestsRequest generates a "aws/request.Request" representing the -// client's request for the ListPullRequests operation. The "output" return +// GetPullRequestApprovalStatesRequest generates a "aws/request.Request" representing the +// client's request for the GetPullRequestApprovalStates operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListPullRequests for more information on using the ListPullRequests +// See GetPullRequestApprovalStates for more information on using the GetPullRequestApprovalStates // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListPullRequestsRequest method. -// req, resp := client.ListPullRequestsRequest(params) +// // Example sending a request using the GetPullRequestApprovalStatesRequest method. +// req, resp := client.GetPullRequestApprovalStatesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListPullRequests -func (c *CodeCommit) ListPullRequestsRequest(input *ListPullRequestsInput) (req *request.Request, output *ListPullRequestsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetPullRequestApprovalStates +func (c *CodeCommit) GetPullRequestApprovalStatesRequest(input *GetPullRequestApprovalStatesInput) (req *request.Request, output *GetPullRequestApprovalStatesOutput) { op := &request.Operation{ - Name: opListPullRequests, + Name: opGetPullRequestApprovalStates, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListPullRequestsInput{} + input = &GetPullRequestApprovalStatesInput{} } - output = &ListPullRequestsOutput{} + output = &GetPullRequestApprovalStatesOutput{} req = c.newRequest(op, input, output) return } -// ListPullRequests API operation for AWS CodeCommit. +// GetPullRequestApprovalStates API operation for AWS CodeCommit. // -// Returns a list of pull requests for a specified repository. The return list -// can be refined by pull request status or pull request author ARN. +// Gets information about the approval states for a specified pull request. +// Approval states only apply to pull requests that have one or more approval +// rules applied to 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 AWS CodeCommit's -// API operation ListPullRequests for usage and error information. +// API operation GetPullRequestApprovalStates for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidPullRequestStatusException "InvalidPullRequestStatusException" -// The pull request status is not valid. The only valid values are OPEN and -// CLOSED. -// -// * ErrCodeInvalidAuthorArnException "InvalidAuthorArnException" -// The Amazon Resource Name (ARN) is not valid. Make sure that you have provided -// the full ARN for the author of the pull request, and then try again. -// -// * ErrCodeAuthorDoesNotExistException "AuthorDoesNotExistException" -// The specified Amazon Resource Name (ARN) does not exist in the AWS account. -// -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. -// -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// Returned Error Types: +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. // -// 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. +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. // -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. // -// * ErrCodeInvalidMaxResultsException "InvalidMaxResultsException" -// The specified number of maximum results is not valid. +// * InvalidRevisionIdException +// The revision ID is not valid. Use GetPullRequest to determine the value. // -// * ErrCodeInvalidContinuationTokenException "InvalidContinuationTokenException" -// The specified continuation token is not valid. +// * RevisionIdRequiredException +// A revision ID is required, but was not provided. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListPullRequests -func (c *CodeCommit) ListPullRequests(input *ListPullRequestsInput) (*ListPullRequestsOutput, error) { - req, out := c.ListPullRequestsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetPullRequestApprovalStates +func (c *CodeCommit) GetPullRequestApprovalStates(input *GetPullRequestApprovalStatesInput) (*GetPullRequestApprovalStatesOutput, error) { + req, out := c.GetPullRequestApprovalStatesRequest(input) return out, req.Send() } -// ListPullRequestsWithContext is the same as ListPullRequests with the addition of +// GetPullRequestApprovalStatesWithContext is the same as GetPullRequestApprovalStates with the addition of // the ability to pass a context and additional request options. // -// See ListPullRequests for details on how to use this API operation. +// See GetPullRequestApprovalStates for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) ListPullRequestsWithContext(ctx aws.Context, input *ListPullRequestsInput, opts ...request.Option) (*ListPullRequestsOutput, error) { - req, out := c.ListPullRequestsRequest(input) +func (c *CodeCommit) GetPullRequestApprovalStatesWithContext(ctx aws.Context, input *GetPullRequestApprovalStatesInput, opts ...request.Option) (*GetPullRequestApprovalStatesOutput, error) { + req, out := c.GetPullRequestApprovalStatesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListPullRequestsPages iterates over the pages of a ListPullRequests operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPullRequests 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 ListPullRequests operation. -// pageNum := 0 -// err := client.ListPullRequestsPages(params, -// func(page *codecommit.ListPullRequestsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *CodeCommit) ListPullRequestsPages(input *ListPullRequestsInput, fn func(*ListPullRequestsOutput, bool) bool) error { - return c.ListPullRequestsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPullRequestsPagesWithContext same as ListPullRequestsPages 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 *CodeCommit) ListPullRequestsPagesWithContext(ctx aws.Context, input *ListPullRequestsInput, fn func(*ListPullRequestsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPullRequestsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPullRequestsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPullRequestsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListRepositories = "ListRepositories" +const opGetPullRequestOverrideState = "GetPullRequestOverrideState" -// ListRepositoriesRequest generates a "aws/request.Request" representing the -// client's request for the ListRepositories operation. The "output" return +// GetPullRequestOverrideStateRequest generates a "aws/request.Request" representing the +// client's request for the GetPullRequestOverrideState operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListRepositories for more information on using the ListRepositories +// See GetPullRequestOverrideState for more information on using the GetPullRequestOverrideState // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListRepositoriesRequest method. -// req, resp := client.ListRepositoriesRequest(params) +// // Example sending a request using the GetPullRequestOverrideStateRequest method. +// req, resp := client.GetPullRequestOverrideStateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListRepositories -func (c *CodeCommit) ListRepositoriesRequest(input *ListRepositoriesInput) (req *request.Request, output *ListRepositoriesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetPullRequestOverrideState +func (c *CodeCommit) GetPullRequestOverrideStateRequest(input *GetPullRequestOverrideStateInput) (req *request.Request, output *GetPullRequestOverrideStateOutput) { op := &request.Operation{ - Name: opListRepositories, + Name: opGetPullRequestOverrideState, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "", - TruncationToken: "", - }, } if input == nil { - input = &ListRepositoriesInput{} + input = &GetPullRequestOverrideStateInput{} } - output = &ListRepositoriesOutput{} + output = &GetPullRequestOverrideStateOutput{} req = c.newRequest(op, input, output) return } -// ListRepositories API operation for AWS CodeCommit. +// GetPullRequestOverrideState API operation for AWS CodeCommit. // -// Gets information about one or more repositories. +// Returns information about whether approval rules have been set aside (overridden) +// for a pull request, and if so, the Amazon Resource Name (ARN) of the user +// or identity that overrode the rules and their requirements for the pull 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 CodeCommit's -// API operation ListRepositories for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidSortByException "InvalidSortByException" -// The specified sort by value is not valid. +// API operation GetPullRequestOverrideState for usage and error information. // -// * ErrCodeInvalidOrderException "InvalidOrderException" -// The specified sort order is not valid. +// Returned Error Types: +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. // -// * ErrCodeInvalidContinuationTokenException "InvalidContinuationTokenException" -// The specified continuation token is not valid. +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. // -// See also, 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) - return out, req.Send() -} - -// ListRepositoriesWithContext is the same as ListRepositories with the addition of -// the ability to pass a context and additional request options. +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. // -// See ListRepositories for details on how to use this API operation. +// * InvalidRevisionIdException +// The revision ID is not valid. Use GetPullRequest to determine the value. // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CodeCommit) ListRepositoriesWithContext(ctx aws.Context, input *ListRepositoriesInput, opts ...request.Option) (*ListRepositoriesOutput, error) { - req, out := c.ListRepositoriesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// 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. +// * RevisionIdRequiredException +// A revision ID is required, but was not provided. // -// See ListRepositories method for more information on how to use this operation. +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. // -// Note: This operation can generate multiple requests to a service. +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. // -// // Example iterating over at most 3 pages of a ListRepositories operation. -// pageNum := 0 -// err := client.ListRepositoriesPages(params, -// func(page *codecommit.ListRepositoriesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// * EncryptionKeyDisabledException +// The encryption key is disabled. // -func (c *CodeCommit) ListRepositoriesPages(input *ListRepositoriesInput, fn func(*ListRepositoriesOutput, bool) bool) error { - return c.ListRepositoriesPagesWithContext(aws.BackgroundContext(), input, fn) +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/GetPullRequestOverrideState +func (c *CodeCommit) GetPullRequestOverrideState(input *GetPullRequestOverrideStateInput) (*GetPullRequestOverrideStateOutput, error) { + req, out := c.GetPullRequestOverrideStateRequest(input) + return out, req.Send() } -// ListRepositoriesPagesWithContext same as ListRepositoriesPages except -// it takes a Context and allows setting request options on the pages. +// GetPullRequestOverrideStateWithContext is the same as GetPullRequestOverrideState with the addition of +// the ability to pass a context and additional request options. +// +// See GetPullRequestOverrideState for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) ListRepositoriesPagesWithContext(ctx aws.Context, input *ListRepositoriesInput, fn func(*ListRepositoriesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListRepositoriesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListRepositoriesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRepositoriesOutput), !p.HasNextPage()) - } - return p.Err() +func (c *CodeCommit) GetPullRequestOverrideStateWithContext(ctx aws.Context, input *GetPullRequestOverrideStateInput, opts ...request.Option) (*GetPullRequestOverrideStateOutput, error) { + req, out := c.GetPullRequestOverrideStateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -const opListTagsForResource = "ListTagsForResource" +const opGetRepository = "GetRepository" -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource operation. The "output" return +// GetRepositoryRequest generates a "aws/request.Request" representing the +// client's request for the GetRepository operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListTagsForResource for more information on using the ListTagsForResource +// See GetRepository for more information on using the GetRepository // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListTagsForResource -func (c *CodeCommit) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { +// See also, 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: opListTagsForResource, + Name: opGetRepository, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ListTagsForResourceInput{} + input = &GetRepositoryInput{} } - output = &ListTagsForResourceOutput{} + output = &GetRepositoryOutput{} req = c.newRequest(op, input, output) return } -// ListTagsForResource API operation for AWS CodeCommit. +// GetRepository API operation for AWS CodeCommit. // -// Gets information about AWS tags for a specified Amazon Resource Name (ARN) -// in AWS CodeCommit. For a list of valid resources in AWS CodeCommit, see CodeCommit -// Resources and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) -// in the AWS CodeCommit User Guide. +// 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 webpage can 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 webpage. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 ListTagsForResource for usage and error information. +// API operation GetRepository for usage and error information. +// +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// Returned Error Codes: -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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. // -// * ErrCodeResourceArnRequiredException "ResourceArnRequiredException" -// A valid Amazon Resource Name (ARN) for an AWS CodeCommit resource is required. -// For a list of valid resources in AWS CodeCommit, see CodeCommit Resources -// and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) -// in the AWS CodeCommit User Guide. +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. // -// * ErrCodeInvalidResourceArnException "InvalidResourceArnException" -// The value for the resource ARN is not valid. For more information about resources -// in AWS CodeCommit, see CodeCommit Resources and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) -// in the AWS CodeCommit User Guide. +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListTagsForResource -func (c *CodeCommit) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, 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) return out, req.Send() } -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// GetRepositoryWithContext is the same as GetRepository with the addition of // the ability to pass a context and additional request options. // -// See ListTagsForResource for details on how to use this API operation. +// See GetRepository for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) +func (c *CodeCommit) GetRepositoryWithContext(ctx aws.Context, input *GetRepositoryInput, opts ...request.Option) (*GetRepositoryOutput, error) { + req, out := c.GetRepositoryRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opMergeBranchesByFastForward = "MergeBranchesByFastForward" +const opGetRepositoryTriggers = "GetRepositoryTriggers" -// MergeBranchesByFastForwardRequest generates a "aws/request.Request" representing the -// client's request for the MergeBranchesByFastForward operation. The "output" return +// GetRepositoryTriggersRequest generates a "aws/request.Request" representing the +// client's request for the GetRepositoryTriggers operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See MergeBranchesByFastForward for more information on using the MergeBranchesByFastForward +// See GetRepositoryTriggers for more information on using the GetRepositoryTriggers // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the MergeBranchesByFastForwardRequest method. -// req, resp := client.MergeBranchesByFastForwardRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesByFastForward -func (c *CodeCommit) MergeBranchesByFastForwardRequest(input *MergeBranchesByFastForwardInput) (req *request.Request, output *MergeBranchesByFastForwardOutput) { +// See also, 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: opMergeBranchesByFastForward, + Name: opGetRepositoryTriggers, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &MergeBranchesByFastForwardInput{} + input = &GetRepositoryTriggersInput{} } - output = &MergeBranchesByFastForwardOutput{} + output = &GetRepositoryTriggersOutput{} req = c.newRequest(op, input, output) return } -// MergeBranchesByFastForward API operation for AWS CodeCommit. +// GetRepositoryTriggers API operation for AWS CodeCommit. // -// Merges two branches using the fast-forward merge strategy. +// 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 MergeBranchesByFastForward for usage and error information. +// API operation GetRepositoryTriggers for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeTipsDivergenceExceededException "TipsDivergenceExceededException" -// The divergence between the tips of the provided commit specifiers is too -// great to determine whether there might be any merge conflicts. Locally compare -// the specifiers using git diff or a diff tool. -// -// * 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. -// -// * ErrCodeInvalidTargetBranchException "InvalidTargetBranchException" -// The specified target branch is not valid. -// -// * ErrCodeInvalidBranchNameException "InvalidBranchNameException" -// The specified reference name is not valid. -// -// * ErrCodeBranchNameRequiredException "BranchNameRequiredException" -// A branch name is required but was not specified. -// -// * ErrCodeBranchNameIsTagNameException "BranchNameIsTagNameException" -// The specified branch name is not valid because it is a tag name. Type the -// name of a current branch in the repository. For a list of valid branch names, -// use ListBranches. -// -// * ErrCodeBranchDoesNotExistException "BranchDoesNotExistException" -// The specified branch does not exist. -// -// * ErrCodeManualMergeRequiredException "ManualMergeRequiredException" -// The pull request cannot be merged automatically into the destination branch. -// You must manually merge the branches and resolve any conflicts. -// -// * ErrCodeConcurrentReferenceUpdateException "ConcurrentReferenceUpdateException" -// The merge cannot be completed because the target branch has been modified. -// Another user might have modified the target branch while the merge was in -// progress. Wait a few minutes, and then try again. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesByFastForward -func (c *CodeCommit) MergeBranchesByFastForward(input *MergeBranchesByFastForwardInput) (*MergeBranchesByFastForwardOutput, error) { - req, out := c.MergeBranchesByFastForwardRequest(input) +// See also, 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) return out, req.Send() } -// MergeBranchesByFastForwardWithContext is the same as MergeBranchesByFastForward with the addition of +// GetRepositoryTriggersWithContext is the same as GetRepositoryTriggers with the addition of // the ability to pass a context and additional request options. // -// See MergeBranchesByFastForward for details on how to use this API operation. +// See GetRepositoryTriggers for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) MergeBranchesByFastForwardWithContext(ctx aws.Context, input *MergeBranchesByFastForwardInput, opts ...request.Option) (*MergeBranchesByFastForwardOutput, error) { - req, out := c.MergeBranchesByFastForwardRequest(input) +func (c *CodeCommit) GetRepositoryTriggersWithContext(ctx aws.Context, input *GetRepositoryTriggersInput, opts ...request.Option) (*GetRepositoryTriggersOutput, error) { + req, out := c.GetRepositoryTriggersRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opMergeBranchesBySquash = "MergeBranchesBySquash" +const opListApprovalRuleTemplates = "ListApprovalRuleTemplates" -// MergeBranchesBySquashRequest generates a "aws/request.Request" representing the -// client's request for the MergeBranchesBySquash operation. The "output" return +// ListApprovalRuleTemplatesRequest generates a "aws/request.Request" representing the +// client's request for the ListApprovalRuleTemplates operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See MergeBranchesBySquash for more information on using the MergeBranchesBySquash +// See ListApprovalRuleTemplates for more information on using the ListApprovalRuleTemplates // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the MergeBranchesBySquashRequest method. -// req, resp := client.MergeBranchesBySquashRequest(params) +// // Example sending a request using the ListApprovalRuleTemplatesRequest method. +// req, resp := client.ListApprovalRuleTemplatesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesBySquash -func (c *CodeCommit) MergeBranchesBySquashRequest(input *MergeBranchesBySquashInput) (req *request.Request, output *MergeBranchesBySquashOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListApprovalRuleTemplates +func (c *CodeCommit) ListApprovalRuleTemplatesRequest(input *ListApprovalRuleTemplatesInput) (req *request.Request, output *ListApprovalRuleTemplatesOutput) { op := &request.Operation{ - Name: opMergeBranchesBySquash, + Name: opListApprovalRuleTemplates, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, } if input == nil { - input = &MergeBranchesBySquashInput{} + input = &ListApprovalRuleTemplatesInput{} } - output = &MergeBranchesBySquashOutput{} + output = &ListApprovalRuleTemplatesOutput{} req = c.newRequest(op, input, output) return } -// MergeBranchesBySquash API operation for AWS CodeCommit. +// ListApprovalRuleTemplates API operation for AWS CodeCommit. // -// Merges two branches using the squash merge strategy. +// Lists all approval rule templates in the specified AWS Region in your AWS +// account. If an AWS Region is not specified, the AWS Region where you are +// signed in is used. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 MergeBranchesBySquash for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// API operation ListApprovalRuleTemplates for usage and error information. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// Returned Error Types: +// * InvalidMaxResultsException +// The specified number of maximum results 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. +// * InvalidContinuationTokenException +// The specified continuation token is not valid. // -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListApprovalRuleTemplates +func (c *CodeCommit) ListApprovalRuleTemplates(input *ListApprovalRuleTemplatesInput) (*ListApprovalRuleTemplatesOutput, error) { + req, out := c.ListApprovalRuleTemplatesRequest(input) + return out, req.Send() +} + +// ListApprovalRuleTemplatesWithContext is the same as ListApprovalRuleTemplates with the addition of +// the ability to pass a context and additional request options. // -// * ErrCodeTipsDivergenceExceededException "TipsDivergenceExceededException" -// The divergence between the tips of the provided commit specifiers is too -// great to determine whether there might be any merge conflicts. Locally compare -// the specifiers using git diff or a diff tool. +// See ListApprovalRuleTemplates for details on how to use this API operation. // -// * ErrCodeCommitRequiredException "CommitRequiredException" -// A commit was not specified. +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) ListApprovalRuleTemplatesWithContext(ctx aws.Context, input *ListApprovalRuleTemplatesInput, opts ...request.Option) (*ListApprovalRuleTemplatesOutput, error) { + req, out := c.ListApprovalRuleTemplatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListApprovalRuleTemplatesPages iterates over the pages of a ListApprovalRuleTemplates operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. // -// * ErrCodeInvalidCommitException "InvalidCommitException" -// The specified commit is not valid. +// See ListApprovalRuleTemplates method for more information on how to use this operation. // -// * ErrCodeCommitDoesNotExistException "CommitDoesNotExistException" -// The specified commit does not exist or no commit was specified, and the specified -// repository has no default branch. +// Note: This operation can generate multiple requests to a service. // -// * ErrCodeInvalidTargetBranchException "InvalidTargetBranchException" -// The specified target branch is not valid. -// -// * ErrCodeInvalidBranchNameException "InvalidBranchNameException" -// The specified reference name is not valid. -// -// * ErrCodeBranchNameRequiredException "BranchNameRequiredException" -// A branch name is required but was not specified. -// -// * ErrCodeBranchNameIsTagNameException "BranchNameIsTagNameException" -// The specified branch name is not valid because it is a tag name. Type the -// name of a current branch in the repository. For a list of valid branch names, -// use ListBranches. -// -// * ErrCodeBranchDoesNotExistException "BranchDoesNotExistException" -// The specified branch does not exist. -// -// * ErrCodeManualMergeRequiredException "ManualMergeRequiredException" -// The pull request cannot be merged automatically into the destination branch. -// You must manually merge the branches and resolve any conflicts. -// -// * ErrCodeInvalidConflictDetailLevelException "InvalidConflictDetailLevelException" -// The specified conflict detail level is not valid. -// -// * ErrCodeInvalidConflictResolutionStrategyException "InvalidConflictResolutionStrategyException" -// The specified conflict resolution strategy is not valid. -// -// * ErrCodeInvalidConflictResolutionException "InvalidConflictResolutionException" -// The specified conflict resolution list is not valid. -// -// * ErrCodeMaximumConflictResolutionEntriesExceededException "MaximumConflictResolutionEntriesExceededException" -// The number of allowed conflict resolution entries was exceeded. -// -// * ErrCodeMultipleConflictResolutionEntriesException "MultipleConflictResolutionEntriesException" -// More than one conflict resolution entries exists for the conflict. A conflict -// can have only one conflict resolution entry. -// -// * ErrCodeReplacementTypeRequiredException "ReplacementTypeRequiredException" -// A replacement type is required. -// -// * ErrCodeInvalidReplacementTypeException "InvalidReplacementTypeException" -// Automerge was specified for resolving the conflict, but the specified replacement -// type is not valid. -// -// * ErrCodeReplacementContentRequiredException "ReplacementContentRequiredException" -// USE_NEW_CONTENT was specified but no replacement content has been provided. -// -// * ErrCodeInvalidReplacementContentException "InvalidReplacementContentException" -// Automerge was specified for resolving the conflict, but the replacement type -// is not valid or content is missing. -// -// * ErrCodePathRequiredException "PathRequiredException" -// The folderPath for a location cannot be null. -// -// * ErrCodeInvalidPathException "InvalidPathException" -// The specified path is not valid. -// -// * ErrCodeFileContentSizeLimitExceededException "FileContentSizeLimitExceededException" -// The file cannot be added because it is too large. The maximum file size that -// can be added is 6 MB, and the combined file content change size is 7 MB. -// Consider making these changes using a Git client. -// -// * ErrCodeFolderContentSizeLimitExceededException "FolderContentSizeLimitExceededException" -// The commit cannot be created because at least one of the overall changes -// in the commit results in a folder whose contents exceed the limit of 6 MB. -// Either reduce the number and size of your changes, or split the changes across -// multiple folders. -// -// * ErrCodeMaximumFileContentToLoadExceededException "MaximumFileContentToLoadExceededException" -// The number of files to load exceeds the allowed limit. -// -// * ErrCodeMaximumItemsToCompareExceededException "MaximumItemsToCompareExceededException" -// The maximum number of items to compare between the source or destination -// branches and the merge base has exceeded the maximum allowed. -// -// * ErrCodeFileModeRequiredException "FileModeRequiredException" -// The commit cannot be created because a file mode is required to update mode -// permissions for an existing file, but no file mode has been specified. -// -// * ErrCodeInvalidFileModeException "InvalidFileModeException" -// The specified file mode permission is not valid. For a list of valid file -// mode permissions, see PutFile. -// -// * ErrCodeNameLengthExceededException "NameLengthExceededException" -// The user name is not valid because it has exceeded the character limit for -// author names. -// -// * ErrCodeInvalidEmailException "InvalidEmailException" -// The specified email address either contains one or more characters that are -// not allowed, or it exceeds the maximum number of characters allowed for an -// email address. -// -// * ErrCodeCommitMessageLengthExceededException "CommitMessageLengthExceededException" -// The commit message is too long. Provide a shorter string. -// -// * ErrCodeConcurrentReferenceUpdateException "ConcurrentReferenceUpdateException" -// The merge cannot be completed because the target branch has been modified. -// Another user might have modified the target branch while the merge was in -// progress. Wait a few minutes, and then try again. -// -// * 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. +// // Example iterating over at most 3 pages of a ListApprovalRuleTemplates operation. +// pageNum := 0 +// err := client.ListApprovalRuleTemplatesPages(params, +// func(page *codecommit.ListApprovalRuleTemplatesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesBySquash -func (c *CodeCommit) MergeBranchesBySquash(input *MergeBranchesBySquashInput) (*MergeBranchesBySquashOutput, error) { - req, out := c.MergeBranchesBySquashRequest(input) - return out, req.Send() +func (c *CodeCommit) ListApprovalRuleTemplatesPages(input *ListApprovalRuleTemplatesInput, fn func(*ListApprovalRuleTemplatesOutput, bool) bool) error { + return c.ListApprovalRuleTemplatesPagesWithContext(aws.BackgroundContext(), input, fn) } -// MergeBranchesBySquashWithContext is the same as MergeBranchesBySquash with the addition of -// the ability to pass a context and additional request options. -// -// See MergeBranchesBySquash for details on how to use this API operation. +// ListApprovalRuleTemplatesPagesWithContext same as ListApprovalRuleTemplatesPages 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 *CodeCommit) MergeBranchesBySquashWithContext(ctx aws.Context, input *MergeBranchesBySquashInput, opts ...request.Option) (*MergeBranchesBySquashOutput, error) { - req, out := c.MergeBranchesBySquashRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() +func (c *CodeCommit) ListApprovalRuleTemplatesPagesWithContext(ctx aws.Context, input *ListApprovalRuleTemplatesInput, fn func(*ListApprovalRuleTemplatesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListApprovalRuleTemplatesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListApprovalRuleTemplatesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListApprovalRuleTemplatesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() } -const opMergeBranchesByThreeWay = "MergeBranchesByThreeWay" +const opListAssociatedApprovalRuleTemplatesForRepository = "ListAssociatedApprovalRuleTemplatesForRepository" -// MergeBranchesByThreeWayRequest generates a "aws/request.Request" representing the -// client's request for the MergeBranchesByThreeWay operation. The "output" return +// ListAssociatedApprovalRuleTemplatesForRepositoryRequest generates a "aws/request.Request" representing the +// client's request for the ListAssociatedApprovalRuleTemplatesForRepository operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See MergeBranchesByThreeWay for more information on using the MergeBranchesByThreeWay +// See ListAssociatedApprovalRuleTemplatesForRepository for more information on using the ListAssociatedApprovalRuleTemplatesForRepository // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the MergeBranchesByThreeWayRequest method. -// req, resp := client.MergeBranchesByThreeWayRequest(params) +// // Example sending a request using the ListAssociatedApprovalRuleTemplatesForRepositoryRequest method. +// req, resp := client.ListAssociatedApprovalRuleTemplatesForRepositoryRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesByThreeWay -func (c *CodeCommit) MergeBranchesByThreeWayRequest(input *MergeBranchesByThreeWayInput) (req *request.Request, output *MergeBranchesByThreeWayOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListAssociatedApprovalRuleTemplatesForRepository +func (c *CodeCommit) ListAssociatedApprovalRuleTemplatesForRepositoryRequest(input *ListAssociatedApprovalRuleTemplatesForRepositoryInput) (req *request.Request, output *ListAssociatedApprovalRuleTemplatesForRepositoryOutput) { op := &request.Operation{ - Name: opMergeBranchesByThreeWay, + Name: opListAssociatedApprovalRuleTemplatesForRepository, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, } if input == nil { - input = &MergeBranchesByThreeWayInput{} + input = &ListAssociatedApprovalRuleTemplatesForRepositoryInput{} } - output = &MergeBranchesByThreeWayOutput{} + output = &ListAssociatedApprovalRuleTemplatesForRepositoryOutput{} req = c.newRequest(op, input, output) return } -// MergeBranchesByThreeWay API operation for AWS CodeCommit. +// ListAssociatedApprovalRuleTemplatesForRepository API operation for AWS CodeCommit. // -// Merges two specified branches using the three-way merge strategy. +// Lists all approval rule templates that are associated with 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 AWS CodeCommit's -// API operation MergeBranchesByThreeWay for usage and error information. +// API operation ListAssociatedApprovalRuleTemplatesForRepository for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeTipsDivergenceExceededException "TipsDivergenceExceededException" -// The divergence between the tips of the provided commit specifiers is too -// great to determine whether there might be any merge conflicts. Locally compare -// the specifiers using git diff or a diff tool. -// -// * 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. -// -// * ErrCodeInvalidTargetBranchException "InvalidTargetBranchException" -// The specified target branch is not valid. -// -// * ErrCodeInvalidBranchNameException "InvalidBranchNameException" -// The specified reference name is not valid. -// -// * ErrCodeBranchNameRequiredException "BranchNameRequiredException" -// A branch name is required but was not specified. -// -// * ErrCodeBranchNameIsTagNameException "BranchNameIsTagNameException" -// The specified branch name is not valid because it is a tag name. Type the -// name of a current branch in the repository. For a list of valid branch names, -// use ListBranches. -// -// * ErrCodeBranchDoesNotExistException "BranchDoesNotExistException" -// The specified branch does not exist. -// -// * ErrCodeManualMergeRequiredException "ManualMergeRequiredException" -// The pull request cannot be merged automatically into the destination branch. -// You must manually merge the branches and resolve any conflicts. -// -// * ErrCodeConcurrentReferenceUpdateException "ConcurrentReferenceUpdateException" -// The merge cannot be completed because the target branch has been modified. -// Another user might have modified the target branch while the merge was in -// progress. Wait a few minutes, and then try again. -// -// * ErrCodeInvalidConflictDetailLevelException "InvalidConflictDetailLevelException" -// The specified conflict detail level is not valid. -// -// * ErrCodeInvalidConflictResolutionStrategyException "InvalidConflictResolutionStrategyException" -// The specified conflict resolution strategy is not valid. -// -// * ErrCodeInvalidConflictResolutionException "InvalidConflictResolutionException" -// The specified conflict resolution list is not valid. -// -// * ErrCodeMaximumConflictResolutionEntriesExceededException "MaximumConflictResolutionEntriesExceededException" -// The number of allowed conflict resolution entries was exceeded. -// -// * ErrCodeMultipleConflictResolutionEntriesException "MultipleConflictResolutionEntriesException" -// More than one conflict resolution entries exists for the conflict. A conflict -// can have only one conflict resolution entry. -// -// * ErrCodeReplacementTypeRequiredException "ReplacementTypeRequiredException" -// A replacement type is required. -// -// * ErrCodeInvalidReplacementTypeException "InvalidReplacementTypeException" -// Automerge was specified for resolving the conflict, but the specified replacement -// type is not valid. -// -// * ErrCodeReplacementContentRequiredException "ReplacementContentRequiredException" -// USE_NEW_CONTENT was specified but no replacement content has been provided. -// -// * ErrCodeInvalidReplacementContentException "InvalidReplacementContentException" -// Automerge was specified for resolving the conflict, but the replacement type -// is not valid or content is missing. -// -// * ErrCodePathRequiredException "PathRequiredException" -// The folderPath for a location cannot be null. -// -// * ErrCodeInvalidPathException "InvalidPathException" -// The specified path is not valid. -// -// * ErrCodeFileContentSizeLimitExceededException "FileContentSizeLimitExceededException" -// The file cannot be added because it is too large. The maximum file size that -// can be added is 6 MB, and the combined file content change size is 7 MB. -// Consider making these changes using a Git client. -// -// * ErrCodeFolderContentSizeLimitExceededException "FolderContentSizeLimitExceededException" -// The commit cannot be created because at least one of the overall changes -// in the commit results in a folder whose contents exceed the limit of 6 MB. -// Either reduce the number and size of your changes, or split the changes across -// multiple folders. -// -// * ErrCodeMaximumFileContentToLoadExceededException "MaximumFileContentToLoadExceededException" -// The number of files to load exceeds the allowed limit. -// -// * ErrCodeMaximumItemsToCompareExceededException "MaximumItemsToCompareExceededException" -// The maximum number of items to compare between the source or destination -// branches and the merge base has exceeded the maximum allowed. -// -// * ErrCodeFileModeRequiredException "FileModeRequiredException" -// The commit cannot be created because a file mode is required to update mode -// permissions for an existing file, but no file mode has been specified. -// -// * ErrCodeInvalidFileModeException "InvalidFileModeException" -// The specified file mode permission is not valid. For a list of valid file -// mode permissions, see PutFile. -// -// * ErrCodeNameLengthExceededException "NameLengthExceededException" -// The user name is not valid because it has exceeded the character limit for -// author names. -// -// * ErrCodeInvalidEmailException "InvalidEmailException" -// The specified email address either contains one or more characters that are -// not allowed, or it exceeds the maximum number of characters allowed for an -// email address. +// * InvalidMaxResultsException +// The specified number of maximum results is not valid. // -// * ErrCodeCommitMessageLengthExceededException "CommitMessageLengthExceededException" -// The commit message is too long. Provide a shorter string. +// * InvalidContinuationTokenException +// The specified continuation token is not valid. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesByThreeWay -func (c *CodeCommit) MergeBranchesByThreeWay(input *MergeBranchesByThreeWayInput) (*MergeBranchesByThreeWayOutput, error) { - req, out := c.MergeBranchesByThreeWayRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListAssociatedApprovalRuleTemplatesForRepository +func (c *CodeCommit) ListAssociatedApprovalRuleTemplatesForRepository(input *ListAssociatedApprovalRuleTemplatesForRepositoryInput) (*ListAssociatedApprovalRuleTemplatesForRepositoryOutput, error) { + req, out := c.ListAssociatedApprovalRuleTemplatesForRepositoryRequest(input) return out, req.Send() } -// MergeBranchesByThreeWayWithContext is the same as MergeBranchesByThreeWay with the addition of +// ListAssociatedApprovalRuleTemplatesForRepositoryWithContext is the same as ListAssociatedApprovalRuleTemplatesForRepository with the addition of // the ability to pass a context and additional request options. // -// See MergeBranchesByThreeWay for details on how to use this API operation. +// See ListAssociatedApprovalRuleTemplatesForRepository for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) MergeBranchesByThreeWayWithContext(ctx aws.Context, input *MergeBranchesByThreeWayInput, opts ...request.Option) (*MergeBranchesByThreeWayOutput, error) { - req, out := c.MergeBranchesByThreeWayRequest(input) +func (c *CodeCommit) ListAssociatedApprovalRuleTemplatesForRepositoryWithContext(ctx aws.Context, input *ListAssociatedApprovalRuleTemplatesForRepositoryInput, opts ...request.Option) (*ListAssociatedApprovalRuleTemplatesForRepositoryOutput, error) { + req, out := c.ListAssociatedApprovalRuleTemplatesForRepositoryRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opMergePullRequestByFastForward = "MergePullRequestByFastForward" +// ListAssociatedApprovalRuleTemplatesForRepositoryPages iterates over the pages of a ListAssociatedApprovalRuleTemplatesForRepository operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListAssociatedApprovalRuleTemplatesForRepository 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 ListAssociatedApprovalRuleTemplatesForRepository operation. +// pageNum := 0 +// err := client.ListAssociatedApprovalRuleTemplatesForRepositoryPages(params, +// func(page *codecommit.ListAssociatedApprovalRuleTemplatesForRepositoryOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CodeCommit) ListAssociatedApprovalRuleTemplatesForRepositoryPages(input *ListAssociatedApprovalRuleTemplatesForRepositoryInput, fn func(*ListAssociatedApprovalRuleTemplatesForRepositoryOutput, bool) bool) error { + return c.ListAssociatedApprovalRuleTemplatesForRepositoryPagesWithContext(aws.BackgroundContext(), input, fn) +} -// MergePullRequestByFastForwardRequest generates a "aws/request.Request" representing the -// client's request for the MergePullRequestByFastForward operation. The "output" return +// ListAssociatedApprovalRuleTemplatesForRepositoryPagesWithContext same as ListAssociatedApprovalRuleTemplatesForRepositoryPages 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 *CodeCommit) ListAssociatedApprovalRuleTemplatesForRepositoryPagesWithContext(ctx aws.Context, input *ListAssociatedApprovalRuleTemplatesForRepositoryInput, fn func(*ListAssociatedApprovalRuleTemplatesForRepositoryOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAssociatedApprovalRuleTemplatesForRepositoryInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAssociatedApprovalRuleTemplatesForRepositoryRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListAssociatedApprovalRuleTemplatesForRepositoryOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListBranches = "ListBranches" + +// ListBranchesRequest generates a "aws/request.Request" representing the +// client's request for the ListBranches operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See MergePullRequestByFastForward for more information on using the MergePullRequestByFastForward +// See ListBranches for more information on using the ListBranches // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the MergePullRequestByFastForwardRequest method. -// req, resp := client.MergePullRequestByFastForwardRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestByFastForward -func (c *CodeCommit) MergePullRequestByFastForwardRequest(input *MergePullRequestByFastForwardInput) (req *request.Request, output *MergePullRequestByFastForwardOutput) { +// See also, 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: opMergePullRequestByFastForward, + Name: opListBranches, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "", + TruncationToken: "", + }, } if input == nil { - input = &MergePullRequestByFastForwardInput{} + input = &ListBranchesInput{} } - output = &MergePullRequestByFastForwardOutput{} + output = &ListBranchesOutput{} req = c.newRequest(op, input, output) return } -// MergePullRequestByFastForward API operation for AWS CodeCommit. +// ListBranches API operation for AWS CodeCommit. // -// Attempts to merge the source commit of a pull request into the specified -// destination branch for that pull request at the specified commit using the -// fast-forward merge strategy. If the merge is successful, it closes the pull -// request. +// 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 MergePullRequestByFastForward for usage and error information. -// -// Returned Error Codes: -// * ErrCodeManualMergeRequiredException "ManualMergeRequiredException" -// The pull request cannot be merged automatically into the destination branch. -// You must manually merge the branches and resolve any conflicts. -// -// * ErrCodePullRequestAlreadyClosedException "PullRequestAlreadyClosedException" -// The pull request status cannot be updated because it is already closed. -// -// * ErrCodePullRequestDoesNotExistException "PullRequestDoesNotExistException" -// The pull request ID could not be found. Make sure that you have specified -// the correct repository name and pull request ID, and then try again. -// -// * ErrCodeInvalidPullRequestIdException "InvalidPullRequestIdException" -// The pull request ID is not valid. Make sure that you have provided the full -// ID and that the pull request is in the specified repository, and then try -// again. -// -// * ErrCodePullRequestIdRequiredException "PullRequestIdRequiredException" -// A pull request ID is required, but none was provided. -// -// * ErrCodeTipOfSourceReferenceIsDifferentException "TipOfSourceReferenceIsDifferentException" -// The tip of the source branch in the destination repository does not match -// the tip of the source branch specified in your request. The pull request -// might have been updated. Make sure that you have the latest changes. -// -// * ErrCodeReferenceDoesNotExistException "ReferenceDoesNotExistException" -// The specified reference does not exist. You must provide a full commit ID. -// -// * ErrCodeInvalidCommitIdException "InvalidCommitIdException" -// The specified commit ID is not valid. +// API operation ListBranches for usage and error information. // -// * ErrCodeRepositoryNotAssociatedWithPullRequestException "RepositoryNotAssociatedWithPullRequestException" -// The repository does not contain any pull requests with that pull request -// ID. Use GetPullRequest to verify the correct repository name for the pull -// request ID. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// * RepositoryDoesNotExistException +// The specified repository does not exist. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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. -// -// * ErrCodeConcurrentReferenceUpdateException "ConcurrentReferenceUpdateException" -// The merge cannot be completed because the target branch has been modified. -// Another user might have modified the target branch while the merge was in -// progress. Wait a few minutes, and then try again. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestByFastForward -func (c *CodeCommit) MergePullRequestByFastForward(input *MergePullRequestByFastForwardInput) (*MergePullRequestByFastForwardOutput, error) { - req, out := c.MergePullRequestByFastForwardRequest(input) +// * InvalidContinuationTokenException +// The specified continuation token is not valid. +// +// See also, 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) return out, req.Send() } -// MergePullRequestByFastForwardWithContext is the same as MergePullRequestByFastForward with the addition of +// ListBranchesWithContext is the same as ListBranches with the addition of // the ability to pass a context and additional request options. // -// See MergePullRequestByFastForward for details on how to use this API operation. +// See ListBranches for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) MergePullRequestByFastForwardWithContext(ctx aws.Context, input *MergePullRequestByFastForwardInput, opts ...request.Option) (*MergePullRequestByFastForwardOutput, error) { - req, out := c.MergePullRequestByFastForwardRequest(input) +func (c *CodeCommit) ListBranchesWithContext(ctx aws.Context, input *ListBranchesInput, opts ...request.Option) (*ListBranchesOutput, error) { + req, out := c.ListBranchesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opMergePullRequestBySquash = "MergePullRequestBySquash" +// 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 *codecommit.ListBranchesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CodeCommit) ListBranchesPages(input *ListBranchesInput, fn func(*ListBranchesOutput, bool) bool) error { + return c.ListBranchesPagesWithContext(aws.BackgroundContext(), input, fn) +} -// MergePullRequestBySquashRequest generates a "aws/request.Request" representing the -// client's request for the MergePullRequestBySquash operation. The "output" return +// ListBranchesPagesWithContext same as ListBranchesPages 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 *CodeCommit) ListBranchesPagesWithContext(ctx aws.Context, input *ListBranchesInput, fn func(*ListBranchesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListBranchesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListBranchesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListBranchesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListPullRequests = "ListPullRequests" + +// ListPullRequestsRequest generates a "aws/request.Request" representing the +// client's request for the ListPullRequests operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See MergePullRequestBySquash for more information on using the MergePullRequestBySquash +// See ListPullRequests for more information on using the ListPullRequests // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the MergePullRequestBySquashRequest method. -// req, resp := client.MergePullRequestBySquashRequest(params) +// // Example sending a request using the ListPullRequestsRequest method. +// req, resp := client.ListPullRequestsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestBySquash -func (c *CodeCommit) MergePullRequestBySquashRequest(input *MergePullRequestBySquashInput) (req *request.Request, output *MergePullRequestBySquashOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListPullRequests +func (c *CodeCommit) ListPullRequestsRequest(input *ListPullRequestsInput) (req *request.Request, output *ListPullRequestsOutput) { op := &request.Operation{ - Name: opMergePullRequestBySquash, + Name: opListPullRequests, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, } if input == nil { - input = &MergePullRequestBySquashInput{} + input = &ListPullRequestsInput{} } - output = &MergePullRequestBySquashOutput{} + output = &ListPullRequestsOutput{} req = c.newRequest(op, input, output) return } -// MergePullRequestBySquash API operation for AWS CodeCommit. +// ListPullRequests API operation for AWS CodeCommit. // -// Attempts to merge the source commit of a pull request into the specified -// destination branch for that pull request at the specified commit using the -// squash merge strategy. If the merge is successful, it closes the pull request. +// Returns a list of pull requests for a specified repository. The return list +// can be refined by pull request status or pull request author 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 AWS CodeCommit's -// API operation MergePullRequestBySquash for usage and error information. -// -// Returned Error Codes: -// * ErrCodePullRequestAlreadyClosedException "PullRequestAlreadyClosedException" -// The pull request status cannot be updated because it is already closed. -// -// * ErrCodePullRequestDoesNotExistException "PullRequestDoesNotExistException" -// The pull request ID could not be found. Make sure that you have specified -// the correct repository name and pull request ID, and then try again. -// -// * ErrCodePullRequestIdRequiredException "PullRequestIdRequiredException" -// A pull request ID is required, but none was provided. -// -// * ErrCodeInvalidPullRequestIdException "InvalidPullRequestIdException" -// The pull request ID is not valid. Make sure that you have provided the full -// ID and that the pull request is in the specified repository, and then try -// again. -// -// * ErrCodeInvalidCommitIdException "InvalidCommitIdException" -// The specified commit ID is not valid. -// -// * ErrCodeManualMergeRequiredException "ManualMergeRequiredException" -// The pull request cannot be merged automatically into the destination branch. -// You must manually merge the branches and resolve any conflicts. -// -// * ErrCodeTipOfSourceReferenceIsDifferentException "TipOfSourceReferenceIsDifferentException" -// The tip of the source branch in the destination repository does not match -// the tip of the source branch specified in your request. The pull request -// might have been updated. Make sure that you have the latest changes. -// -// * ErrCodeTipsDivergenceExceededException "TipsDivergenceExceededException" -// The divergence between the tips of the provided commit specifiers is too -// great to determine whether there might be any merge conflicts. Locally compare -// the specifiers using git diff or a diff tool. -// -// * ErrCodeNameLengthExceededException "NameLengthExceededException" -// The user name is not valid because it has exceeded the character limit for -// author names. -// -// * ErrCodeInvalidEmailException "InvalidEmailException" -// The specified email address either contains one or more characters that are -// not allowed, or it exceeds the maximum number of characters allowed for an -// email address. -// -// * ErrCodeCommitMessageLengthExceededException "CommitMessageLengthExceededException" -// The commit message is too long. Provide a shorter string. -// -// * ErrCodeInvalidConflictDetailLevelException "InvalidConflictDetailLevelException" -// The specified conflict detail level is not valid. -// -// * ErrCodeInvalidConflictResolutionStrategyException "InvalidConflictResolutionStrategyException" -// The specified conflict resolution strategy is not valid. -// -// * ErrCodeInvalidConflictResolutionException "InvalidConflictResolutionException" -// The specified conflict resolution list is not valid. -// -// * ErrCodeReplacementTypeRequiredException "ReplacementTypeRequiredException" -// A replacement type is required. -// -// * ErrCodeInvalidReplacementTypeException "InvalidReplacementTypeException" -// Automerge was specified for resolving the conflict, but the specified replacement -// type is not valid. -// -// * ErrCodeMultipleConflictResolutionEntriesException "MultipleConflictResolutionEntriesException" -// More than one conflict resolution entries exists for the conflict. A conflict -// can have only one conflict resolution entry. -// -// * ErrCodeReplacementContentRequiredException "ReplacementContentRequiredException" -// USE_NEW_CONTENT was specified but no replacement content has been provided. -// -// * ErrCodeMaximumConflictResolutionEntriesExceededException "MaximumConflictResolutionEntriesExceededException" -// The number of allowed conflict resolution entries was exceeded. -// -// * ErrCodeConcurrentReferenceUpdateException "ConcurrentReferenceUpdateException" -// The merge cannot be completed because the target branch has been modified. -// Another user might have modified the target branch while the merge was in -// progress. Wait a few minutes, and then try again. -// -// * ErrCodePathRequiredException "PathRequiredException" -// The folderPath for a location cannot be null. -// -// * ErrCodeInvalidPathException "InvalidPathException" -// The specified path is not valid. -// -// * ErrCodeInvalidFileModeException "InvalidFileModeException" -// The specified file mode permission is not valid. For a list of valid file -// mode permissions, see PutFile. -// -// * ErrCodeInvalidReplacementContentException "InvalidReplacementContentException" -// Automerge was specified for resolving the conflict, but the replacement type -// is not valid or content is missing. -// -// * ErrCodeFileContentSizeLimitExceededException "FileContentSizeLimitExceededException" -// The file cannot be added because it is too large. The maximum file size that -// can be added is 6 MB, and the combined file content change size is 7 MB. -// Consider making these changes using a Git client. +// API operation ListPullRequests for usage and error information. // -// * ErrCodeFolderContentSizeLimitExceededException "FolderContentSizeLimitExceededException" -// The commit cannot be created because at least one of the overall changes -// in the commit results in a folder whose contents exceed the limit of 6 MB. -// Either reduce the number and size of your changes, or split the changes across -// multiple folders. +// Returned Error Types: +// * InvalidPullRequestStatusException +// The pull request status is not valid. The only valid values are OPEN and +// CLOSED. // -// * ErrCodeMaximumFileContentToLoadExceededException "MaximumFileContentToLoadExceededException" -// The number of files to load exceeds the allowed limit. +// * InvalidAuthorArnException +// The Amazon Resource Name (ARN) is not valid. Make sure that you have provided +// the full ARN for the author of the pull request, and then try again. // -// * ErrCodeMaximumItemsToCompareExceededException "MaximumItemsToCompareExceededException" -// The maximum number of items to compare between the source or destination -// branches and the merge base has exceeded the maximum allowed. +// * AuthorDoesNotExistException +// The specified Amazon Resource Name (ARN) does not exist in the AWS account. // -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeRepositoryNotAssociatedWithPullRequestException "RepositoryNotAssociatedWithPullRequestException" -// The repository does not contain any pull requests with that pull request -// ID. Use GetPullRequest to verify the correct repository name for the pull -// request ID. +// * InvalidMaxResultsException +// The specified number of maximum results is not valid. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * InvalidContinuationTokenException +// The specified continuation token is not valid. +// +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestBySquash -func (c *CodeCommit) MergePullRequestBySquash(input *MergePullRequestBySquashInput) (*MergePullRequestBySquashOutput, error) { - req, out := c.MergePullRequestBySquashRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListPullRequests +func (c *CodeCommit) ListPullRequests(input *ListPullRequestsInput) (*ListPullRequestsOutput, error) { + req, out := c.ListPullRequestsRequest(input) return out, req.Send() } -// MergePullRequestBySquashWithContext is the same as MergePullRequestBySquash with the addition of +// ListPullRequestsWithContext is the same as ListPullRequests with the addition of // the ability to pass a context and additional request options. // -// See MergePullRequestBySquash for details on how to use this API operation. +// See ListPullRequests for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) MergePullRequestBySquashWithContext(ctx aws.Context, input *MergePullRequestBySquashInput, opts ...request.Option) (*MergePullRequestBySquashOutput, error) { - req, out := c.MergePullRequestBySquashRequest(input) +func (c *CodeCommit) ListPullRequestsWithContext(ctx aws.Context, input *ListPullRequestsInput, opts ...request.Option) (*ListPullRequestsOutput, error) { + req, out := c.ListPullRequestsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opMergePullRequestByThreeWay = "MergePullRequestByThreeWay" - -// MergePullRequestByThreeWayRequest generates a "aws/request.Request" representing the -// client's request for the MergePullRequestByThreeWay operation. The "output" return +// ListPullRequestsPages iterates over the pages of a ListPullRequests operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListPullRequests 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 ListPullRequests operation. +// pageNum := 0 +// err := client.ListPullRequestsPages(params, +// func(page *codecommit.ListPullRequestsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CodeCommit) ListPullRequestsPages(input *ListPullRequestsInput, fn func(*ListPullRequestsOutput, bool) bool) error { + return c.ListPullRequestsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListPullRequestsPagesWithContext same as ListPullRequestsPages 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 *CodeCommit) ListPullRequestsPagesWithContext(ctx aws.Context, input *ListPullRequestsInput, fn func(*ListPullRequestsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListPullRequestsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListPullRequestsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListPullRequestsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListRepositories = "ListRepositories" + +// ListRepositoriesRequest generates a "aws/request.Request" representing the +// client's request for the ListRepositories operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See MergePullRequestByThreeWay for more information on using the MergePullRequestByThreeWay +// See ListRepositories for more information on using the ListRepositories // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the MergePullRequestByThreeWayRequest method. -// req, resp := client.MergePullRequestByThreeWayRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestByThreeWay -func (c *CodeCommit) MergePullRequestByThreeWayRequest(input *MergePullRequestByThreeWayInput) (req *request.Request, output *MergePullRequestByThreeWayOutput) { +// See also, 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: opMergePullRequestByThreeWay, + Name: opListRepositories, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "", + TruncationToken: "", + }, } if input == nil { - input = &MergePullRequestByThreeWayInput{} + input = &ListRepositoriesInput{} } - output = &MergePullRequestByThreeWayOutput{} + output = &ListRepositoriesOutput{} req = c.newRequest(op, input, output) return } -// MergePullRequestByThreeWay API operation for AWS CodeCommit. +// ListRepositories API operation for AWS CodeCommit. // -// Attempts to merge the source commit of a pull request into the specified -// destination branch for that pull request at the specified commit using the -// three-way merge strategy. If the merge is successful, it closes the pull -// request. +// 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 MergePullRequestByThreeWay for usage and error information. -// -// Returned Error Codes: -// * ErrCodePullRequestAlreadyClosedException "PullRequestAlreadyClosedException" -// The pull request status cannot be updated because it is already closed. -// -// * ErrCodePullRequestDoesNotExistException "PullRequestDoesNotExistException" -// The pull request ID could not be found. Make sure that you have specified -// the correct repository name and pull request ID, and then try again. -// -// * ErrCodePullRequestIdRequiredException "PullRequestIdRequiredException" -// A pull request ID is required, but none was provided. -// -// * ErrCodeInvalidPullRequestIdException "InvalidPullRequestIdException" -// The pull request ID is not valid. Make sure that you have provided the full -// ID and that the pull request is in the specified repository, and then try -// again. -// -// * ErrCodeInvalidCommitIdException "InvalidCommitIdException" -// The specified commit ID is not valid. -// -// * ErrCodeManualMergeRequiredException "ManualMergeRequiredException" -// The pull request cannot be merged automatically into the destination branch. -// You must manually merge the branches and resolve any conflicts. -// -// * ErrCodeTipOfSourceReferenceIsDifferentException "TipOfSourceReferenceIsDifferentException" -// The tip of the source branch in the destination repository does not match -// the tip of the source branch specified in your request. The pull request -// might have been updated. Make sure that you have the latest changes. +// API operation ListRepositories for usage and error information. // -// * ErrCodeTipsDivergenceExceededException "TipsDivergenceExceededException" -// The divergence between the tips of the provided commit specifiers is too -// great to determine whether there might be any merge conflicts. Locally compare -// the specifiers using git diff or a diff tool. +// Returned Error Types: +// * InvalidSortByException +// The specified sort by value is not valid. // -// * ErrCodeNameLengthExceededException "NameLengthExceededException" -// The user name is not valid because it has exceeded the character limit for -// author names. +// * InvalidOrderException +// The specified sort order is not valid. // -// * ErrCodeInvalidEmailException "InvalidEmailException" -// The specified email address either contains one or more characters that are -// not allowed, or it exceeds the maximum number of characters allowed for an -// email address. +// * InvalidContinuationTokenException +// The specified continuation token is not valid. // -// * ErrCodeCommitMessageLengthExceededException "CommitMessageLengthExceededException" -// The commit message is too long. Provide a shorter string. +// See also, 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) + return out, req.Send() +} + +// ListRepositoriesWithContext is the same as ListRepositories with the addition of +// the ability to pass a context and additional request options. // -// * ErrCodeInvalidConflictDetailLevelException "InvalidConflictDetailLevelException" -// The specified conflict detail level is not valid. +// See ListRepositories for details on how to use this API operation. // -// * ErrCodeInvalidConflictResolutionStrategyException "InvalidConflictResolutionStrategyException" -// The specified conflict resolution strategy is not valid. +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) ListRepositoriesWithContext(ctx aws.Context, input *ListRepositoriesInput, opts ...request.Option) (*ListRepositoriesOutput, error) { + req, out := c.ListRepositoriesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// 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. // -// * ErrCodeInvalidConflictResolutionException "InvalidConflictResolutionException" -// The specified conflict resolution list is not valid. +// See ListRepositories method for more information on how to use this operation. // -// * ErrCodeReplacementTypeRequiredException "ReplacementTypeRequiredException" -// A replacement type is required. +// Note: This operation can generate multiple requests to a service. // -// * ErrCodeInvalidReplacementTypeException "InvalidReplacementTypeException" -// Automerge was specified for resolving the conflict, but the specified replacement -// type is not valid. +// // Example iterating over at most 3 pages of a ListRepositories operation. +// pageNum := 0 +// err := client.ListRepositoriesPages(params, +// func(page *codecommit.ListRepositoriesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) // -// * ErrCodeMultipleConflictResolutionEntriesException "MultipleConflictResolutionEntriesException" -// More than one conflict resolution entries exists for the conflict. A conflict -// can have only one conflict resolution entry. +func (c *CodeCommit) ListRepositoriesPages(input *ListRepositoriesInput, fn func(*ListRepositoriesOutput, bool) bool) error { + return c.ListRepositoriesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListRepositoriesPagesWithContext same as ListRepositoriesPages except +// it takes a Context and allows setting request options on the pages. // -// * ErrCodeReplacementContentRequiredException "ReplacementContentRequiredException" -// USE_NEW_CONTENT was specified but no replacement content has been provided. +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) ListRepositoriesPagesWithContext(ctx aws.Context, input *ListRepositoriesInput, fn func(*ListRepositoriesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListRepositoriesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListRepositoriesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListRepositoriesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListRepositoriesForApprovalRuleTemplate = "ListRepositoriesForApprovalRuleTemplate" + +// ListRepositoriesForApprovalRuleTemplateRequest generates a "aws/request.Request" representing the +// client's request for the ListRepositoriesForApprovalRuleTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. // -// * ErrCodeMaximumConflictResolutionEntriesExceededException "MaximumConflictResolutionEntriesExceededException" -// The number of allowed conflict resolution entries was exceeded. +// 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. // -// * ErrCodePathRequiredException "PathRequiredException" -// The folderPath for a location cannot be null. +// See ListRepositoriesForApprovalRuleTemplate for more information on using the ListRepositoriesForApprovalRuleTemplate +// API call, and error handling. // -// * ErrCodeInvalidPathException "InvalidPathException" -// The specified path is not valid. +// 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. // -// * ErrCodeInvalidFileModeException "InvalidFileModeException" -// The specified file mode permission is not valid. For a list of valid file -// mode permissions, see PutFile. // -// * ErrCodeInvalidReplacementContentException "InvalidReplacementContentException" -// Automerge was specified for resolving the conflict, but the replacement type -// is not valid or content is missing. +// // Example sending a request using the ListRepositoriesForApprovalRuleTemplateRequest method. +// req, resp := client.ListRepositoriesForApprovalRuleTemplateRequest(params) // -// * ErrCodeFileContentSizeLimitExceededException "FileContentSizeLimitExceededException" -// The file cannot be added because it is too large. The maximum file size that -// can be added is 6 MB, and the combined file content change size is 7 MB. -// Consider making these changes using a Git client. +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } // -// * ErrCodeFolderContentSizeLimitExceededException "FolderContentSizeLimitExceededException" -// The commit cannot be created because at least one of the overall changes -// in the commit results in a folder whose contents exceed the limit of 6 MB. -// Either reduce the number and size of your changes, or split the changes across -// multiple folders. +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListRepositoriesForApprovalRuleTemplate +func (c *CodeCommit) ListRepositoriesForApprovalRuleTemplateRequest(input *ListRepositoriesForApprovalRuleTemplateInput) (req *request.Request, output *ListRepositoriesForApprovalRuleTemplateOutput) { + op := &request.Operation{ + Name: opListRepositoriesForApprovalRuleTemplate, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListRepositoriesForApprovalRuleTemplateInput{} + } + + output = &ListRepositoriesForApprovalRuleTemplateOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListRepositoriesForApprovalRuleTemplate API operation for AWS CodeCommit. // -// * ErrCodeMaximumFileContentToLoadExceededException "MaximumFileContentToLoadExceededException" -// The number of files to load exceeds the allowed limit. +// Lists all repositories associated with the specified approval rule template. // -// * ErrCodeMaximumItemsToCompareExceededException "MaximumItemsToCompareExceededException" -// The maximum number of items to compare between the source or destination -// branches and the merge base has exceeded the maximum 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. // -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// See the AWS API reference guide for AWS CodeCommit's +// API operation ListRepositoriesForApprovalRuleTemplate for usage and error information. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// Returned Error Types: +// * ApprovalRuleTemplateNameRequiredException +// An approval rule template name is required, but was not specified. // -// 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. +// * InvalidApprovalRuleTemplateNameException +// The name of the approval rule template is not valid. Template names must +// be between 1 and 100 valid characters in length. For more information about +// limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). // -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. +// * ApprovalRuleTemplateDoesNotExistException +// The specified approval rule template does not exist. Verify that the name +// is correct and that you are signed in to the AWS Region where the template +// was created, and then try again. // -// * ErrCodeRepositoryNotAssociatedWithPullRequestException "RepositoryNotAssociatedWithPullRequestException" -// The repository does not contain any pull requests with that pull request -// ID. Use GetPullRequest to verify the correct repository name for the pull -// request ID. +// * InvalidMaxResultsException +// The specified number of maximum results is not valid. // -// * ErrCodeConcurrentReferenceUpdateException "ConcurrentReferenceUpdateException" -// The merge cannot be completed because the target branch has been modified. -// Another user might have modified the target branch while the merge was in -// progress. Wait a few minutes, and then try again. +// * InvalidContinuationTokenException +// The specified continuation token is not valid. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestByThreeWay -func (c *CodeCommit) MergePullRequestByThreeWay(input *MergePullRequestByThreeWayInput) (*MergePullRequestByThreeWayOutput, error) { - req, out := c.MergePullRequestByThreeWayRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListRepositoriesForApprovalRuleTemplate +func (c *CodeCommit) ListRepositoriesForApprovalRuleTemplate(input *ListRepositoriesForApprovalRuleTemplateInput) (*ListRepositoriesForApprovalRuleTemplateOutput, error) { + req, out := c.ListRepositoriesForApprovalRuleTemplateRequest(input) return out, req.Send() } -// MergePullRequestByThreeWayWithContext is the same as MergePullRequestByThreeWay with the addition of +// ListRepositoriesForApprovalRuleTemplateWithContext is the same as ListRepositoriesForApprovalRuleTemplate with the addition of // the ability to pass a context and additional request options. // -// See MergePullRequestByThreeWay for details on how to use this API operation. +// See ListRepositoriesForApprovalRuleTemplate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) MergePullRequestByThreeWayWithContext(ctx aws.Context, input *MergePullRequestByThreeWayInput, opts ...request.Option) (*MergePullRequestByThreeWayOutput, error) { - req, out := c.MergePullRequestByThreeWayRequest(input) +func (c *CodeCommit) ListRepositoriesForApprovalRuleTemplateWithContext(ctx aws.Context, input *ListRepositoriesForApprovalRuleTemplateInput, opts ...request.Option) (*ListRepositoriesForApprovalRuleTemplateOutput, error) { + req, out := c.ListRepositoriesForApprovalRuleTemplateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPostCommentForComparedCommit = "PostCommentForComparedCommit" - -// PostCommentForComparedCommitRequest generates a "aws/request.Request" representing the -// client's request for the PostCommentForComparedCommit operation. The "output" return +// ListRepositoriesForApprovalRuleTemplatePages iterates over the pages of a ListRepositoriesForApprovalRuleTemplate operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListRepositoriesForApprovalRuleTemplate 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 ListRepositoriesForApprovalRuleTemplate operation. +// pageNum := 0 +// err := client.ListRepositoriesForApprovalRuleTemplatePages(params, +// func(page *codecommit.ListRepositoriesForApprovalRuleTemplateOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CodeCommit) ListRepositoriesForApprovalRuleTemplatePages(input *ListRepositoriesForApprovalRuleTemplateInput, fn func(*ListRepositoriesForApprovalRuleTemplateOutput, bool) bool) error { + return c.ListRepositoriesForApprovalRuleTemplatePagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListRepositoriesForApprovalRuleTemplatePagesWithContext same as ListRepositoriesForApprovalRuleTemplatePages 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 *CodeCommit) ListRepositoriesForApprovalRuleTemplatePagesWithContext(ctx aws.Context, input *ListRepositoriesForApprovalRuleTemplateInput, fn func(*ListRepositoriesForApprovalRuleTemplateOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListRepositoriesForApprovalRuleTemplateInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListRepositoriesForApprovalRuleTemplateRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListRepositoriesForApprovalRuleTemplateOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PostCommentForComparedCommit for more information on using the PostCommentForComparedCommit +// See ListTagsForResource for more information on using the ListTagsForResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PostCommentForComparedCommitRequest method. -// req, resp := client.PostCommentForComparedCommitRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentForComparedCommit -func (c *CodeCommit) PostCommentForComparedCommitRequest(input *PostCommentForComparedCommitInput) (req *request.Request, output *PostCommentForComparedCommitOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListTagsForResource +func (c *CodeCommit) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { op := &request.Operation{ - Name: opPostCommentForComparedCommit, + Name: opListTagsForResource, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PostCommentForComparedCommitInput{} + input = &ListTagsForResourceInput{} } - output = &PostCommentForComparedCommitOutput{} + output = &ListTagsForResourceOutput{} req = c.newRequest(op, input, output) return } -// PostCommentForComparedCommit API operation for AWS CodeCommit. +// ListTagsForResource API operation for AWS CodeCommit. // -// Posts a comment on the comparison between two commits. +// Gets information about AWS tags for a specified Amazon Resource Name (ARN) +// in AWS CodeCommit. For a list of valid resources in AWS CodeCommit, see CodeCommit +// Resources and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) +// 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 PostCommentForComparedCommit for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// API operation ListTagsForResource for usage and error information. // -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" +// Returned Error Types: +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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. // -// * ErrCodeClientRequestTokenRequiredException "ClientRequestTokenRequiredException" -// A client request token is required. A client request token is an unique, -// client-generated idempotency token that when provided in a request, ensures -// the request cannot be repeated with a changed parameter. If a request is -// received with the same parameters and a token is included, the request will -// return information about the initial request that used that token. -// -// * ErrCodeInvalidClientRequestTokenException "InvalidClientRequestTokenException" -// The client request token is not valid. -// -// * ErrCodeIdempotencyParameterMismatchException "IdempotencyParameterMismatchException" -// The client request token is not valid. Either the token is not in a valid -// format, or the token has been used in a previous request and cannot be re-used. -// -// * ErrCodeCommentContentRequiredException "CommentContentRequiredException" -// The comment is empty. You must provide some content for a comment. The content -// cannot be null. -// -// * ErrCodeCommentContentSizeLimitExceededException "CommentContentSizeLimitExceededException" -// The comment is too large. Comments are limited to 1,000 characters. -// -// * ErrCodeInvalidFileLocationException "InvalidFileLocationException" -// The location of the file is not valid. Make sure that you include the extension -// of the file as well as the file name. -// -// * ErrCodeInvalidRelativeFileVersionEnumException "InvalidRelativeFileVersionEnumException" -// Either the enum is not in a valid format, or the specified file version enum -// is not valid in respect to the current file version. -// -// * ErrCodePathRequiredException "PathRequiredException" -// The folderPath for a location cannot be null. -// -// * ErrCodeInvalidFilePositionException "InvalidFilePositionException" -// The position is not valid. Make sure that the line number exists in the version -// of the file you want to comment on. -// -// * ErrCodeCommitIdRequiredException "CommitIdRequiredException" -// A commit ID was not specified. -// -// * 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. -// -// * ErrCodeBeforeCommitIdAndAfterCommitIdAreSameException "BeforeCommitIdAndAfterCommitIdAreSameException" -// The before commit ID and the after commit ID are the same, which is not valid. -// The before commit ID and the after commit ID must be different commit IDs. -// -// * 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. +// * ResourceArnRequiredException +// A valid Amazon Resource Name (ARN) for an AWS CodeCommit resource is required. +// For a list of valid resources in AWS CodeCommit, see CodeCommit Resources +// and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) +// in the AWS CodeCommit User Guide. // -// * ErrCodePathDoesNotExistException "PathDoesNotExistException" -// The specified path does not exist. +// * InvalidResourceArnException +// The value for the resource ARN is not valid. For more information about resources +// in AWS CodeCommit, see CodeCommit Resources and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) +// in the AWS CodeCommit User Guide. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentForComparedCommit -func (c *CodeCommit) PostCommentForComparedCommit(input *PostCommentForComparedCommitInput) (*PostCommentForComparedCommitOutput, error) { - req, out := c.PostCommentForComparedCommitRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/ListTagsForResource +func (c *CodeCommit) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) return out, req.Send() } -// PostCommentForComparedCommitWithContext is the same as PostCommentForComparedCommit with the addition of +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of // the ability to pass a context and additional request options. // -// See PostCommentForComparedCommit for details on how to use this API operation. +// See ListTagsForResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) PostCommentForComparedCommitWithContext(ctx aws.Context, input *PostCommentForComparedCommitInput, opts ...request.Option) (*PostCommentForComparedCommitOutput, error) { - req, out := c.PostCommentForComparedCommitRequest(input) +func (c *CodeCommit) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPostCommentForPullRequest = "PostCommentForPullRequest" +const opMergeBranchesByFastForward = "MergeBranchesByFastForward" -// PostCommentForPullRequestRequest generates a "aws/request.Request" representing the -// client's request for the PostCommentForPullRequest operation. The "output" return +// MergeBranchesByFastForwardRequest generates a "aws/request.Request" representing the +// client's request for the MergeBranchesByFastForward operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PostCommentForPullRequest for more information on using the PostCommentForPullRequest +// See MergeBranchesByFastForward for more information on using the MergeBranchesByFastForward // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PostCommentForPullRequestRequest method. -// req, resp := client.PostCommentForPullRequestRequest(params) +// // Example sending a request using the MergeBranchesByFastForwardRequest method. +// req, resp := client.MergeBranchesByFastForwardRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentForPullRequest -func (c *CodeCommit) PostCommentForPullRequestRequest(input *PostCommentForPullRequestInput) (req *request.Request, output *PostCommentForPullRequestOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesByFastForward +func (c *CodeCommit) MergeBranchesByFastForwardRequest(input *MergeBranchesByFastForwardInput) (req *request.Request, output *MergeBranchesByFastForwardOutput) { op := &request.Operation{ - Name: opPostCommentForPullRequest, + Name: opMergeBranchesByFastForward, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PostCommentForPullRequestInput{} + input = &MergeBranchesByFastForwardInput{} } - output = &PostCommentForPullRequestOutput{} + output = &MergeBranchesByFastForwardOutput{} req = c.newRequest(op, input, output) return } -// PostCommentForPullRequest API operation for AWS CodeCommit. +// MergeBranchesByFastForward API operation for AWS CodeCommit. // -// Posts a comment on a pull request. +// Merges two branches using the fast-forward merge strategy. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 PostCommentForPullRequest for usage and error information. -// -// Returned Error Codes: -// * ErrCodePullRequestDoesNotExistException "PullRequestDoesNotExistException" -// The pull request ID could not be found. Make sure that you have specified -// the correct repository name and pull request ID, and then try again. -// -// * ErrCodeInvalidPullRequestIdException "InvalidPullRequestIdException" -// The pull request ID is not valid. Make sure that you have provided the full -// ID and that the pull request is in the specified repository, and then try -// again. -// -// * ErrCodePullRequestIdRequiredException "PullRequestIdRequiredException" -// A pull request ID is required, but none was provided. -// -// * ErrCodeRepositoryNotAssociatedWithPullRequestException "RepositoryNotAssociatedWithPullRequestException" -// The repository does not contain any pull requests with that pull request -// ID. Use GetPullRequest to verify the correct repository name for the pull -// request ID. -// -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// API operation MergeBranchesByFastForward for usage and error information. // -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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. // -// * ErrCodeClientRequestTokenRequiredException "ClientRequestTokenRequiredException" -// A client request token is required. A client request token is an unique, -// client-generated idempotency token that when provided in a request, ensures -// the request cannot be repeated with a changed parameter. If a request is -// received with the same parameters and a token is included, the request will -// return information about the initial request that used that token. +// * RepositoryDoesNotExistException +// The specified repository does not exist. // -// * ErrCodeInvalidClientRequestTokenException "InvalidClientRequestTokenException" -// The client request token is not valid. +// * TipsDivergenceExceededException +// The divergence between the tips of the provided commit specifiers is too +// great to determine whether there might be any merge conflicts. Locally compare +// the specifiers using git diff or a diff tool. // -// * ErrCodeIdempotencyParameterMismatchException "IdempotencyParameterMismatchException" -// The client request token is not valid. Either the token is not in a valid -// format, or the token has been used in a previous request and cannot be re-used. +// * CommitRequiredException +// A commit was not specified. // -// * ErrCodeCommentContentRequiredException "CommentContentRequiredException" -// The comment is empty. You must provide some content for a comment. The content -// cannot be null. +// * InvalidCommitException +// The specified commit is not valid. // -// * ErrCodeCommentContentSizeLimitExceededException "CommentContentSizeLimitExceededException" -// The comment is too large. Comments are limited to 1,000 characters. +// * CommitDoesNotExistException +// The specified commit does not exist or no commit was specified, and the specified +// repository has no default branch. // -// * ErrCodeInvalidFileLocationException "InvalidFileLocationException" -// The location of the file is not valid. Make sure that you include the extension -// of the file as well as the file name. +// * InvalidTargetBranchException +// The specified target branch is not valid. // -// * ErrCodeInvalidRelativeFileVersionEnumException "InvalidRelativeFileVersionEnumException" -// Either the enum is not in a valid format, or the specified file version enum -// is not valid in respect to the current file version. +// * InvalidBranchNameException +// The specified reference name is not valid. // -// * ErrCodePathRequiredException "PathRequiredException" -// The folderPath for a location cannot be null. +// * BranchNameRequiredException +// A branch name is required, but was not specified. // -// * ErrCodeInvalidFilePositionException "InvalidFilePositionException" -// The position is not valid. Make sure that the line number exists in the version -// of the file you want to comment on. +// * BranchNameIsTagNameException +// The specified branch name is not valid because it is a tag name. Enter the +// name of a branch in the repository. For a list of valid branch names, use +// ListBranches. // -// * ErrCodeCommitIdRequiredException "CommitIdRequiredException" -// A commit ID was not specified. +// * BranchDoesNotExistException +// The specified branch does not exist. // -// * ErrCodeInvalidCommitIdException "InvalidCommitIdException" -// The specified commit ID is not valid. +// * ManualMergeRequiredException +// The pull request cannot be merged automatically into the destination branch. +// You must manually merge the branches and resolve any conflicts. +// +// * ConcurrentReferenceUpdateException +// The merge cannot be completed because the target branch has been modified. +// Another user might have modified the target branch while the merge was in +// progress. Wait a few minutes, and then try again. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// * 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. -// -// * ErrCodePathRequiredException "PathRequiredException" -// The folderPath for a location cannot be null. -// -// * ErrCodeBeforeCommitIdAndAfterCommitIdAreSameException "BeforeCommitIdAndAfterCommitIdAreSameException" -// The before commit ID and the after commit ID are the same, which is not valid. -// The before commit ID and the after commit ID must be different commit IDs. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentForPullRequest -func (c *CodeCommit) PostCommentForPullRequest(input *PostCommentForPullRequestInput) (*PostCommentForPullRequestOutput, error) { - req, out := c.PostCommentForPullRequestRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesByFastForward +func (c *CodeCommit) MergeBranchesByFastForward(input *MergeBranchesByFastForwardInput) (*MergeBranchesByFastForwardOutput, error) { + req, out := c.MergeBranchesByFastForwardRequest(input) return out, req.Send() } -// PostCommentForPullRequestWithContext is the same as PostCommentForPullRequest with the addition of +// MergeBranchesByFastForwardWithContext is the same as MergeBranchesByFastForward with the addition of // the ability to pass a context and additional request options. // -// See PostCommentForPullRequest for details on how to use this API operation. +// See MergeBranchesByFastForward for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) PostCommentForPullRequestWithContext(ctx aws.Context, input *PostCommentForPullRequestInput, opts ...request.Option) (*PostCommentForPullRequestOutput, error) { - req, out := c.PostCommentForPullRequestRequest(input) +func (c *CodeCommit) MergeBranchesByFastForwardWithContext(ctx aws.Context, input *MergeBranchesByFastForwardInput, opts ...request.Option) (*MergeBranchesByFastForwardOutput, error) { + req, out := c.MergeBranchesByFastForwardRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPostCommentReply = "PostCommentReply" +const opMergeBranchesBySquash = "MergeBranchesBySquash" -// PostCommentReplyRequest generates a "aws/request.Request" representing the -// client's request for the PostCommentReply operation. The "output" return +// MergeBranchesBySquashRequest generates a "aws/request.Request" representing the +// client's request for the MergeBranchesBySquash operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PostCommentReply for more information on using the PostCommentReply +// See MergeBranchesBySquash for more information on using the MergeBranchesBySquash // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PostCommentReplyRequest method. -// req, resp := client.PostCommentReplyRequest(params) +// // Example sending a request using the MergeBranchesBySquashRequest method. +// req, resp := client.MergeBranchesBySquashRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentReply -func (c *CodeCommit) PostCommentReplyRequest(input *PostCommentReplyInput) (req *request.Request, output *PostCommentReplyOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesBySquash +func (c *CodeCommit) MergeBranchesBySquashRequest(input *MergeBranchesBySquashInput) (req *request.Request, output *MergeBranchesBySquashOutput) { op := &request.Operation{ - Name: opPostCommentReply, + Name: opMergeBranchesBySquash, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PostCommentReplyInput{} + input = &MergeBranchesBySquashInput{} } - output = &PostCommentReplyOutput{} + output = &MergeBranchesBySquashOutput{} req = c.newRequest(op, input, output) return } -// PostCommentReply API operation for AWS CodeCommit. +// MergeBranchesBySquash API operation for AWS CodeCommit. // -// Posts a comment in reply to an existing comment on a comparison between commits -// or a pull request. +// Merges two branches using the squash merge strategy. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 PostCommentReply for usage and error information. +// API operation MergeBranchesBySquash for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientRequestTokenRequiredException "ClientRequestTokenRequiredException" -// A client request token is required. A client request token is an unique, -// client-generated idempotency token that when provided in a request, ensures -// the request cannot be repeated with a changed parameter. If a request is -// received with the same parameters and a token is included, the request will -// return information about the initial request that used that token. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidClientRequestTokenException "InvalidClientRequestTokenException" -// The client request token is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// * ErrCodeIdempotencyParameterMismatchException "IdempotencyParameterMismatchException" -// The client request token is not valid. Either the token is not in a valid -// format, or the token has been used in a previous request and cannot be re-used. +// This exception occurs only 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. // -// * ErrCodeCommentContentRequiredException "CommentContentRequiredException" -// The comment is empty. You must provide some content for a comment. The content -// cannot be null. +// * RepositoryDoesNotExistException +// The specified repository does not exist. // -// * ErrCodeCommentContentSizeLimitExceededException "CommentContentSizeLimitExceededException" -// The comment is too large. Comments are limited to 1,000 characters. +// * TipsDivergenceExceededException +// The divergence between the tips of the provided commit specifiers is too +// great to determine whether there might be any merge conflicts. Locally compare +// the specifiers using git diff or a diff tool. // -// * ErrCodeCommentDoesNotExistException "CommentDoesNotExistException" -// No comment exists with the provided ID. Verify that you have provided the -// correct ID, and then try again. +// * CommitRequiredException +// A commit was not specified. // -// * ErrCodeCommentIdRequiredException "CommentIdRequiredException" -// The comment ID is missing or null. A comment ID is required. +// * InvalidCommitException +// The specified commit is not valid. // -// * ErrCodeInvalidCommentIdException "InvalidCommentIdException" -// The comment ID is not in a valid format. Make sure that you have provided -// the full comment ID. +// * CommitDoesNotExistException +// The specified commit does not exist or no commit was specified, and the specified +// repository has no default branch. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentReply -func (c *CodeCommit) PostCommentReply(input *PostCommentReplyInput) (*PostCommentReplyOutput, error) { - req, out := c.PostCommentReplyRequest(input) +// * InvalidTargetBranchException +// The specified target branch is not valid. +// +// * InvalidBranchNameException +// The specified reference name is not valid. +// +// * BranchNameRequiredException +// A branch name is required, but was not specified. +// +// * BranchNameIsTagNameException +// The specified branch name is not valid because it is a tag name. Enter the +// name of a branch in the repository. For a list of valid branch names, use +// ListBranches. +// +// * BranchDoesNotExistException +// The specified branch does not exist. +// +// * ManualMergeRequiredException +// The pull request cannot be merged automatically into the destination branch. +// You must manually merge the branches and resolve any conflicts. +// +// * InvalidConflictDetailLevelException +// The specified conflict detail level is not valid. +// +// * InvalidConflictResolutionStrategyException +// The specified conflict resolution strategy is not valid. +// +// * InvalidConflictResolutionException +// The specified conflict resolution list is not valid. +// +// * MaximumConflictResolutionEntriesExceededException +// The number of allowed conflict resolution entries was exceeded. +// +// * MultipleConflictResolutionEntriesException +// More than one conflict resolution entries exists for the conflict. A conflict +// can have only one conflict resolution entry. +// +// * ReplacementTypeRequiredException +// A replacement type is required. +// +// * InvalidReplacementTypeException +// Automerge was specified for resolving the conflict, but the specified replacement +// type is not valid. +// +// * ReplacementContentRequiredException +// USE_NEW_CONTENT was specified, but no replacement content has been provided. +// +// * InvalidReplacementContentException +// Automerge was specified for resolving the conflict, but the replacement type +// is not valid or content is missing. +// +// * PathRequiredException +// The folderPath for a location cannot be null. +// +// * InvalidPathException +// The specified path is not valid. +// +// * FileContentSizeLimitExceededException +// The file cannot be added because it is too large. The maximum file size is +// 6 MB, and the combined file content change size is 7 MB. Consider making +// these changes using a Git client. +// +// * FolderContentSizeLimitExceededException +// The commit cannot be created because at least one of the overall changes +// in the commit results in a folder whose contents exceed the limit of 6 MB. +// Either reduce the number and size of your changes, or split the changes across +// multiple folders. +// +// * MaximumFileContentToLoadExceededException +// The number of files to load exceeds the allowed limit. +// +// * MaximumItemsToCompareExceededException +// The number of items to compare between the source or destination branches +// and the merge base has exceeded the maximum allowed. +// +// * FileModeRequiredException +// The commit cannot be created because no file mode has been specified. A file +// mode is required to update mode permissions for a file. +// +// * InvalidFileModeException +// The specified file mode permission is not valid. For a list of valid file +// mode permissions, see PutFile. +// +// * NameLengthExceededException +// The user name is not valid because it has exceeded the character limit for +// author names. +// +// * InvalidEmailException +// The specified email address either contains one or more characters that are +// not allowed, or it exceeds the maximum number of characters allowed for an +// email address. +// +// * CommitMessageLengthExceededException +// The commit message is too long. Provide a shorter string. +// +// * ConcurrentReferenceUpdateException +// The merge cannot be completed because the target branch has been modified. +// Another user might have modified the target branch while the merge was in +// progress. Wait a few minutes, and then try again. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesBySquash +func (c *CodeCommit) MergeBranchesBySquash(input *MergeBranchesBySquashInput) (*MergeBranchesBySquashOutput, error) { + req, out := c.MergeBranchesBySquashRequest(input) return out, req.Send() } -// PostCommentReplyWithContext is the same as PostCommentReply with the addition of +// MergeBranchesBySquashWithContext is the same as MergeBranchesBySquash with the addition of // the ability to pass a context and additional request options. // -// See PostCommentReply for details on how to use this API operation. +// See MergeBranchesBySquash for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) PostCommentReplyWithContext(ctx aws.Context, input *PostCommentReplyInput, opts ...request.Option) (*PostCommentReplyOutput, error) { - req, out := c.PostCommentReplyRequest(input) +func (c *CodeCommit) MergeBranchesBySquashWithContext(ctx aws.Context, input *MergeBranchesBySquashInput, opts ...request.Option) (*MergeBranchesBySquashOutput, error) { + req, out := c.MergeBranchesBySquashRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPutFile = "PutFile" +const opMergeBranchesByThreeWay = "MergeBranchesByThreeWay" -// PutFileRequest generates a "aws/request.Request" representing the -// client's request for the PutFile operation. The "output" return +// MergeBranchesByThreeWayRequest generates a "aws/request.Request" representing the +// client's request for the MergeBranchesByThreeWay operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutFile for more information on using the PutFile +// See MergeBranchesByThreeWay for more information on using the MergeBranchesByThreeWay // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutFileRequest method. -// req, resp := client.PutFileRequest(params) +// // Example sending a request using the MergeBranchesByThreeWayRequest method. +// req, resp := client.MergeBranchesByThreeWayRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PutFile -func (c *CodeCommit) PutFileRequest(input *PutFileInput) (req *request.Request, output *PutFileOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesByThreeWay +func (c *CodeCommit) MergeBranchesByThreeWayRequest(input *MergeBranchesByThreeWayInput) (req *request.Request, output *MergeBranchesByThreeWayOutput) { op := &request.Operation{ - Name: opPutFile, + Name: opMergeBranchesByThreeWay, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PutFileInput{} + input = &MergeBranchesByThreeWayInput{} } - output = &PutFileOutput{} + output = &MergeBranchesByThreeWayOutput{} req = c.newRequest(op, input, output) return } -// PutFile API operation for AWS CodeCommit. +// MergeBranchesByThreeWay API operation for AWS CodeCommit. // -// Adds or updates a file in a branch in an AWS CodeCommit repository, and generates -// a commit for the addition in the specified branch. +// Merges two specified branches using the three-way merge strategy. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 PutFile for usage and error information. +// API operation MergeBranchesByThreeWay for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeParentCommitIdRequiredException "ParentCommitIdRequiredException" -// A parent commit ID is required. To view the full commit ID of a branch in -// a repository, use GetBranch or a Git command (for example, git pull or git -// log). +// * TipsDivergenceExceededException +// The divergence between the tips of the provided commit specifiers is too +// great to determine whether there might be any merge conflicts. Locally compare +// the specifiers using git diff or a diff tool. // -// * ErrCodeInvalidParentCommitIdException "InvalidParentCommitIdException" -// The parent commit ID is not valid. The commit ID cannot be empty, and must -// match the head commit ID for the branch of the repository where you want -// to add or update a file. +// * CommitRequiredException +// A commit was not specified. // -// * ErrCodeParentCommitDoesNotExistException "ParentCommitDoesNotExistException" -// The parent commit ID is not valid because it does not exist. The specified -// parent commit ID does not exist in the specified branch of the repository. +// * InvalidCommitException +// The specified commit is not valid. // -// * ErrCodeParentCommitIdOutdatedException "ParentCommitIdOutdatedException" -// The file could not be added because the provided parent commit ID is not -// the current tip of the specified branch. To view the full commit ID of the -// current head of the branch, use GetBranch. +// * CommitDoesNotExistException +// The specified commit does not exist or no commit was specified, and the specified +// repository has no default branch. // -// * ErrCodeFileContentRequiredException "FileContentRequiredException" -// The file cannot be added because it is empty. Empty files cannot be added -// to the repository with this API. +// * InvalidTargetBranchException +// The specified target branch is not valid. // -// * ErrCodeFileContentSizeLimitExceededException "FileContentSizeLimitExceededException" -// The file cannot be added because it is too large. The maximum file size that -// can be added is 6 MB, and the combined file content change size is 7 MB. -// Consider making these changes using a Git client. +// * InvalidBranchNameException +// The specified reference name is not valid. // -// * ErrCodeFolderContentSizeLimitExceededException "FolderContentSizeLimitExceededException" -// The commit cannot be created because at least one of the overall changes -// in the commit results in a folder whose contents exceed the limit of 6 MB. -// Either reduce the number and size of your changes, or split the changes across -// multiple folders. +// * BranchNameRequiredException +// A branch name is required, but was not specified. +// +// * BranchNameIsTagNameException +// The specified branch name is not valid because it is a tag name. Enter the +// name of a branch in the repository. For a list of valid branch names, use +// ListBranches. +// +// * BranchDoesNotExistException +// The specified branch does not exist. +// +// * ManualMergeRequiredException +// The pull request cannot be merged automatically into the destination branch. +// You must manually merge the branches and resolve any conflicts. +// +// * ConcurrentReferenceUpdateException +// The merge cannot be completed because the target branch has been modified. +// Another user might have modified the target branch while the merge was in +// progress. Wait a few minutes, and then try again. +// +// * InvalidConflictDetailLevelException +// The specified conflict detail level is not valid. +// +// * InvalidConflictResolutionStrategyException +// The specified conflict resolution strategy is not valid. +// +// * InvalidConflictResolutionException +// The specified conflict resolution list is not valid. +// +// * MaximumConflictResolutionEntriesExceededException +// The number of allowed conflict resolution entries was exceeded. +// +// * MultipleConflictResolutionEntriesException +// More than one conflict resolution entries exists for the conflict. A conflict +// can have only one conflict resolution entry. +// +// * ReplacementTypeRequiredException +// A replacement type is required. +// +// * InvalidReplacementTypeException +// Automerge was specified for resolving the conflict, but the specified replacement +// type is not valid. +// +// * ReplacementContentRequiredException +// USE_NEW_CONTENT was specified, but no replacement content has been provided. // -// * ErrCodePathRequiredException "PathRequiredException" +// * InvalidReplacementContentException +// Automerge was specified for resolving the conflict, but the replacement type +// is not valid or content is missing. +// +// * PathRequiredException // The folderPath for a location cannot be null. // -// * ErrCodeInvalidPathException "InvalidPathException" +// * InvalidPathException // The specified path is not valid. // -// * ErrCodeBranchNameRequiredException "BranchNameRequiredException" -// A branch name is required but was not specified. +// * FileContentSizeLimitExceededException +// The file cannot be added because it is too large. The maximum file size is +// 6 MB, and the combined file content change size is 7 MB. Consider making +// these changes using a Git client. // -// * ErrCodeInvalidBranchNameException "InvalidBranchNameException" -// The specified reference name is not valid. +// * FolderContentSizeLimitExceededException +// The commit cannot be created because at least one of the overall changes +// in the commit results in a folder whose contents exceed the limit of 6 MB. +// Either reduce the number and size of your changes, or split the changes across +// multiple folders. // -// * ErrCodeBranchDoesNotExistException "BranchDoesNotExistException" -// The specified branch does not exist. +// * MaximumFileContentToLoadExceededException +// The number of files to load exceeds the allowed limit. // -// * ErrCodeBranchNameIsTagNameException "BranchNameIsTagNameException" -// The specified branch name is not valid because it is a tag name. Type the -// name of a current branch in the repository. For a list of valid branch names, -// use ListBranches. +// * MaximumItemsToCompareExceededException +// The number of items to compare between the source or destination branches +// and the merge base has exceeded the maximum allowed. // -// * ErrCodeInvalidFileModeException "InvalidFileModeException" +// * FileModeRequiredException +// The commit cannot be created because no file mode has been specified. A file +// mode is required to update mode permissions for a file. +// +// * InvalidFileModeException // The specified file mode permission is not valid. For a list of valid file // mode permissions, see PutFile. // -// * ErrCodeNameLengthExceededException "NameLengthExceededException" +// * NameLengthExceededException // The user name is not valid because it has exceeded the character limit for // author names. // -// * ErrCodeInvalidEmailException "InvalidEmailException" +// * InvalidEmailException // The specified email address either contains one or more characters that are // not allowed, or it exceeds the maximum number of characters allowed for an // email address. // -// * ErrCodeCommitMessageLengthExceededException "CommitMessageLengthExceededException" +// * CommitMessageLengthExceededException // The commit message is too long. Provide a shorter string. // -// * ErrCodeInvalidDeletionParameterException "InvalidDeletionParameterException" -// The specified deletion parameter is not valid. -// -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// * ErrCodeSameFileContentException "SameFileContentException" -// The file was not added or updated because the content of the file is exactly -// the same as the content of that file in the repository and branch that you -// specified. -// -// * ErrCodeFileNameConflictsWithDirectoryNameException "FileNameConflictsWithDirectoryNameException" -// A file cannot be added to the repository because the specified file name -// has the same name as a directory in this repository. Either provide another -// name for the file, or add the file in a directory that does not match the -// file name. -// -// * ErrCodeDirectoryNameConflictsWithFileNameException "DirectoryNameConflictsWithFileNameException" -// A file cannot be added to the repository because the specified path name -// has the same name as a file that already exists in this repository. Either -// provide a different name for the file, or specify a different path for the -// file. -// -// * ErrCodeFilePathConflictsWithSubmodulePathException "FilePathConflictsWithSubmodulePathException" -// The commit cannot be created because a specified file path points to a submodule. -// Verify that the destination files have valid file paths that do not point -// to a submodule. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PutFile -func (c *CodeCommit) PutFile(input *PutFileInput) (*PutFileOutput, error) { - req, out := c.PutFileRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergeBranchesByThreeWay +func (c *CodeCommit) MergeBranchesByThreeWay(input *MergeBranchesByThreeWayInput) (*MergeBranchesByThreeWayOutput, error) { + req, out := c.MergeBranchesByThreeWayRequest(input) return out, req.Send() } -// PutFileWithContext is the same as PutFile with the addition of +// MergeBranchesByThreeWayWithContext is the same as MergeBranchesByThreeWay with the addition of // the ability to pass a context and additional request options. // -// See PutFile for details on how to use this API operation. +// See MergeBranchesByThreeWay for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) PutFileWithContext(ctx aws.Context, input *PutFileInput, opts ...request.Option) (*PutFileOutput, error) { - req, out := c.PutFileRequest(input) +func (c *CodeCommit) MergeBranchesByThreeWayWithContext(ctx aws.Context, input *MergeBranchesByThreeWayInput, opts ...request.Option) (*MergeBranchesByThreeWayOutput, error) { + req, out := c.MergeBranchesByThreeWayRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPutRepositoryTriggers = "PutRepositoryTriggers" +const opMergePullRequestByFastForward = "MergePullRequestByFastForward" -// PutRepositoryTriggersRequest generates a "aws/request.Request" representing the -// client's request for the PutRepositoryTriggers operation. The "output" return +// MergePullRequestByFastForwardRequest generates a "aws/request.Request" representing the +// client's request for the MergePullRequestByFastForward operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutRepositoryTriggers for more information on using the PutRepositoryTriggers +// See MergePullRequestByFastForward for more information on using the MergePullRequestByFastForward // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutRepositoryTriggersRequest method. -// req, resp := client.PutRepositoryTriggersRequest(params) +// // Example sending a request using the MergePullRequestByFastForwardRequest method. +// req, resp := client.MergePullRequestByFastForwardRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PutRepositoryTriggers -func (c *CodeCommit) PutRepositoryTriggersRequest(input *PutRepositoryTriggersInput) (req *request.Request, output *PutRepositoryTriggersOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestByFastForward +func (c *CodeCommit) MergePullRequestByFastForwardRequest(input *MergePullRequestByFastForwardInput) (req *request.Request, output *MergePullRequestByFastForwardOutput) { op := &request.Operation{ - Name: opPutRepositoryTriggers, + Name: opMergePullRequestByFastForward, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PutRepositoryTriggersInput{} + input = &MergePullRequestByFastForwardInput{} } - output = &PutRepositoryTriggersOutput{} + output = &MergePullRequestByFastForwardOutput{} req = c.newRequest(op, input, output) return } -// PutRepositoryTriggers API operation for AWS CodeCommit. +// MergePullRequestByFastForward API operation for AWS CodeCommit. // -// Replaces all triggers for a repository. This can be used to create or delete -// triggers. +// Attempts to merge the source commit of a pull request into the specified +// destination branch for that pull request at the specified commit using the +// fast-forward merge strategy. If the merge is successful, it closes the pull +// 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 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. +// API operation MergePullRequestByFastForward for usage and error information. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// Returned Error Types: +// * ManualMergeRequiredException +// The pull request cannot be merged automatically into the destination branch. +// You must manually merge the branches and resolve any conflicts. // -// 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. +// * PullRequestAlreadyClosedException +// The pull request status cannot be updated because it is already closed. // -// * ErrCodeRepositoryTriggersListRequiredException "RepositoryTriggersListRequiredException" -// The list of triggers for the repository is required but was not specified. +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. // -// * ErrCodeMaximumRepositoryTriggersExceededException "MaximumRepositoryTriggersExceededException" -// The number of triggers allowed for the repository was exceeded. +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. // -// * ErrCodeInvalidRepositoryTriggerNameException "InvalidRepositoryTriggerNameException" -// The name of the trigger is not valid. +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. // -// * 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. +// * TipOfSourceReferenceIsDifferentException +// The tip of the source branch in the destination repository does not match +// the tip of the source branch specified in your request. The pull request +// might have been updated. Make sure that you have the latest changes. // -// * 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. +// * ReferenceDoesNotExistException +// The specified reference does not exist. You must provide a full commit ID. // -// * ErrCodeInvalidRepositoryTriggerCustomDataException "InvalidRepositoryTriggerCustomDataException" -// The custom data provided for the trigger is not valid. +// * InvalidCommitIdException +// The specified commit ID is not valid. // -// * ErrCodeMaximumBranchesExceededException "MaximumBranchesExceededException" -// The number of branches for the trigger was exceeded. +// * RepositoryNotAssociatedWithPullRequestException +// The repository does not contain any pull requests with that pull request +// ID. Use GetPullRequest to verify the correct repository name for the pull +// request ID. // -// * ErrCodeInvalidRepositoryTriggerBranchNameException "InvalidRepositoryTriggerBranchNameException" -// One or more branch names specified for the trigger is not valid. +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * 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. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// * ErrCodeRepositoryTriggerNameRequiredException "RepositoryTriggerNameRequiredException" -// A name for the trigger is required but was not specified. +// This exception occurs only 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. // -// * ErrCodeRepositoryTriggerDestinationArnRequiredException "RepositoryTriggerDestinationArnRequiredException" -// A destination ARN for the target service for the trigger is required but -// was not specified. +// * RepositoryDoesNotExistException +// The specified repository does not exist. // -// * ErrCodeRepositoryTriggerBranchNameListRequiredException "RepositoryTriggerBranchNameListRequiredException" -// At least one branch name is required but was not specified in the trigger -// configuration. +// * ConcurrentReferenceUpdateException +// The merge cannot be completed because the target branch has been modified. +// Another user might have modified the target branch while the merge was in +// progress. Wait a few minutes, and then try again. // -// * ErrCodeRepositoryTriggerEventsListRequiredException "RepositoryTriggerEventsListRequiredException" -// At least one event for the trigger is required but was not specified. +// * PullRequestApprovalRulesNotSatisfiedException +// The pull request cannot be merged because one or more approval rules applied +// to the pull request have conditions that have not been met. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestByFastForward +func (c *CodeCommit) MergePullRequestByFastForward(input *MergePullRequestByFastForwardInput) (*MergePullRequestByFastForwardOutput, error) { + req, out := c.MergePullRequestByFastForwardRequest(input) return out, req.Send() } -// PutRepositoryTriggersWithContext is the same as PutRepositoryTriggers with the addition of +// MergePullRequestByFastForwardWithContext is the same as MergePullRequestByFastForward with the addition of // the ability to pass a context and additional request options. // -// See PutRepositoryTriggers for details on how to use this API operation. +// See MergePullRequestByFastForward for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) PutRepositoryTriggersWithContext(ctx aws.Context, input *PutRepositoryTriggersInput, opts ...request.Option) (*PutRepositoryTriggersOutput, error) { - req, out := c.PutRepositoryTriggersRequest(input) +func (c *CodeCommit) MergePullRequestByFastForwardWithContext(ctx aws.Context, input *MergePullRequestByFastForwardInput, opts ...request.Option) (*MergePullRequestByFastForwardOutput, error) { + req, out := c.MergePullRequestByFastForwardRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opTagResource = "TagResource" +const opMergePullRequestBySquash = "MergePullRequestBySquash" -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource operation. The "output" return +// MergePullRequestBySquashRequest generates a "aws/request.Request" representing the +// client's request for the MergePullRequestBySquash operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See TagResource for more information on using the TagResource +// See MergePullRequestBySquash for more information on using the MergePullRequestBySquash // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) +// // Example sending a request using the MergePullRequestBySquashRequest method. +// req, resp := client.MergePullRequestBySquashRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/TagResource -func (c *CodeCommit) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestBySquash +func (c *CodeCommit) MergePullRequestBySquashRequest(input *MergePullRequestBySquashInput) (req *request.Request, output *MergePullRequestBySquashOutput) { op := &request.Operation{ - Name: opTagResource, + Name: opMergePullRequestBySquash, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &TagResourceInput{} + input = &MergePullRequestBySquashInput{} } - output = &TagResourceOutput{} + output = &MergePullRequestBySquashOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// TagResource API operation for AWS CodeCommit. +// MergePullRequestBySquash API operation for AWS CodeCommit. // -// Adds or updates tags for a resource in AWS CodeCommit. For a list of valid -// resources in AWS CodeCommit, see CodeCommit Resources and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) -// in the AWS CodeCommit User Guide. +// Attempts to merge the source commit of a pull request into the specified +// destination branch for that pull request at the specified commit using the +// squash merge strategy. If the merge is successful, it closes the pull 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 CodeCommit's -// API operation TagResource for usage and error information. +// API operation MergePullRequestBySquash for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. +// Returned Error Types: +// * PullRequestAlreadyClosedException +// The pull request status cannot be updated because it is already closed. +// +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. +// +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. +// +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. +// +// * InvalidCommitIdException +// The specified commit ID is not valid. +// +// * ManualMergeRequiredException +// The pull request cannot be merged automatically into the destination branch. +// You must manually merge the branches and resolve any conflicts. +// +// * TipOfSourceReferenceIsDifferentException +// The tip of the source branch in the destination repository does not match +// the tip of the source branch specified in your request. The pull request +// might have been updated. Make sure that you have the latest changes. +// +// * TipsDivergenceExceededException +// The divergence between the tips of the provided commit specifiers is too +// great to determine whether there might be any merge conflicts. Locally compare +// the specifiers using git diff or a diff tool. +// +// * NameLengthExceededException +// The user name is not valid because it has exceeded the character limit for +// author names. +// +// * InvalidEmailException +// The specified email address either contains one or more characters that are +// not allowed, or it exceeds the maximum number of characters allowed for an +// email address. +// +// * CommitMessageLengthExceededException +// The commit message is too long. Provide a shorter string. +// +// * InvalidConflictDetailLevelException +// The specified conflict detail level is not valid. +// +// * InvalidConflictResolutionStrategyException +// The specified conflict resolution strategy is not valid. +// +// * InvalidConflictResolutionException +// The specified conflict resolution list is not valid. +// +// * ReplacementTypeRequiredException +// A replacement type is required. +// +// * InvalidReplacementTypeException +// Automerge was specified for resolving the conflict, but the specified replacement +// type is not valid. +// +// * MultipleConflictResolutionEntriesException +// More than one conflict resolution entries exists for the conflict. A conflict +// can have only one conflict resolution entry. +// +// * ReplacementContentRequiredException +// USE_NEW_CONTENT was specified, but no replacement content has been provided. +// +// * MaximumConflictResolutionEntriesExceededException +// The number of allowed conflict resolution entries was exceeded. +// +// * ConcurrentReferenceUpdateException +// The merge cannot be completed because the target branch has been modified. +// Another user might have modified the target branch while the merge was in +// progress. Wait a few minutes, and then try again. +// +// * PathRequiredException +// The folderPath for a location cannot be null. +// +// * InvalidPathException +// The specified path is not valid. +// +// * InvalidFileModeException +// The specified file mode permission is not valid. For a list of valid file +// mode permissions, see PutFile. +// +// * InvalidReplacementContentException +// Automerge was specified for resolving the conflict, but the replacement type +// is not valid or content is missing. +// +// * FileContentSizeLimitExceededException +// The file cannot be added because it is too large. The maximum file size is +// 6 MB, and the combined file content change size is 7 MB. Consider making +// these changes using a Git client. +// +// * FolderContentSizeLimitExceededException +// The commit cannot be created because at least one of the overall changes +// in the commit results in a folder whose contents exceed the limit of 6 MB. +// Either reduce the number and size of your changes, or split the changes across +// multiple folders. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * MaximumFileContentToLoadExceededException +// The number of files to load exceeds the allowed limit. +// +// * MaximumItemsToCompareExceededException +// The number of items to compare between the source or destination branches +// and the merge base has exceeded the maximum allowed. +// +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. +// +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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. // -// * ErrCodeResourceArnRequiredException "ResourceArnRequiredException" -// A valid Amazon Resource Name (ARN) for an AWS CodeCommit resource is required. -// For a list of valid resources in AWS CodeCommit, see CodeCommit Resources -// and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) -// in the AWS CodeCommit User Guide. +// * RepositoryDoesNotExistException +// The specified repository does not exist. // -// * ErrCodeInvalidResourceArnException "InvalidResourceArnException" -// The value for the resource ARN is not valid. For more information about resources -// in AWS CodeCommit, see CodeCommit Resources and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) -// in the AWS CodeCommit User Guide. +// * RepositoryNotAssociatedWithPullRequestException +// The repository does not contain any pull requests with that pull request +// ID. Use GetPullRequest to verify the correct repository name for the pull +// request ID. // -// * ErrCodeTagsMapRequiredException "TagsMapRequiredException" -// A map of tags is required. +// * PullRequestApprovalRulesNotSatisfiedException +// The pull request cannot be merged because one or more approval rules applied +// to the pull request have conditions that have not been met. // -// * ErrCodeInvalidTagsMapException "InvalidTagsMapException" -// The map of tags is not valid. +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. // -// * ErrCodeTooManyTagsException "TooManyTagsException" -// The maximum number of tags for an AWS CodeCommit resource has been exceeded. +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. // -// * ErrCodeInvalidSystemTagUsageException "InvalidSystemTagUsageException" -// The specified tag is not valid. Key names cannot be prefixed with aws:. +// * EncryptionKeyDisabledException +// The encryption key is disabled. // -// * ErrCodeTagPolicyException "TagPolicyException" -// The tag policy is not valid. +// * EncryptionKeyNotFoundException +// No encryption key was found. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/TagResource -func (c *CodeCommit) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestBySquash +func (c *CodeCommit) MergePullRequestBySquash(input *MergePullRequestBySquashInput) (*MergePullRequestBySquashOutput, error) { + req, out := c.MergePullRequestBySquashRequest(input) return out, req.Send() } -// TagResourceWithContext is the same as TagResource with the addition of +// MergePullRequestBySquashWithContext is the same as MergePullRequestBySquash with the addition of // the ability to pass a context and additional request options. // -// See TagResource for details on how to use this API operation. +// See MergePullRequestBySquash for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) +func (c *CodeCommit) MergePullRequestBySquashWithContext(ctx aws.Context, input *MergePullRequestBySquashInput, opts ...request.Option) (*MergePullRequestBySquashOutput, error) { + req, out := c.MergePullRequestBySquashRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opTestRepositoryTriggers = "TestRepositoryTriggers" +const opMergePullRequestByThreeWay = "MergePullRequestByThreeWay" -// TestRepositoryTriggersRequest generates a "aws/request.Request" representing the -// client's request for the TestRepositoryTriggers operation. The "output" return +// MergePullRequestByThreeWayRequest generates a "aws/request.Request" representing the +// client's request for the MergePullRequestByThreeWay operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See TestRepositoryTriggers for more information on using the TestRepositoryTriggers +// See MergePullRequestByThreeWay for more information on using the MergePullRequestByThreeWay // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the TestRepositoryTriggersRequest method. -// req, resp := client.TestRepositoryTriggersRequest(params) +// // Example sending a request using the MergePullRequestByThreeWayRequest method. +// req, resp := client.MergePullRequestByThreeWayRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/TestRepositoryTriggers -func (c *CodeCommit) TestRepositoryTriggersRequest(input *TestRepositoryTriggersInput) (req *request.Request, output *TestRepositoryTriggersOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestByThreeWay +func (c *CodeCommit) MergePullRequestByThreeWayRequest(input *MergePullRequestByThreeWayInput) (req *request.Request, output *MergePullRequestByThreeWayOutput) { op := &request.Operation{ - Name: opTestRepositoryTriggers, + Name: opMergePullRequestByThreeWay, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &TestRepositoryTriggersInput{} + input = &MergePullRequestByThreeWayInput{} } - output = &TestRepositoryTriggersOutput{} + output = &MergePullRequestByThreeWayOutput{} req = c.newRequest(op, input, output) return } -// TestRepositoryTriggers API operation for AWS CodeCommit. +// MergePullRequestByThreeWay 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. +// Attempts to merge the source commit of a pull request into the specified +// destination branch for that pull request at the specified commit using the +// three-way merge strategy. If the merge is successful, it closes the pull +// 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 CodeCommit's -// API operation TestRepositoryTriggers for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. +// API operation MergePullRequestByThreeWay for usage and error information. // -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// Returned Error Types: +// * PullRequestAlreadyClosedException +// The pull request status cannot be updated because it is already closed. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. // -// 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. +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. // -// * ErrCodeRepositoryTriggersListRequiredException "RepositoryTriggersListRequiredException" -// The list of triggers for the repository is required but was not specified. +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. // -// * ErrCodeMaximumRepositoryTriggersExceededException "MaximumRepositoryTriggersExceededException" -// The number of triggers allowed for the repository was exceeded. +// * InvalidCommitIdException +// The specified commit ID is not valid. // -// * ErrCodeInvalidRepositoryTriggerNameException "InvalidRepositoryTriggerNameException" -// The name of the trigger is not valid. +// * ManualMergeRequiredException +// The pull request cannot be merged automatically into the destination branch. +// You must manually merge the branches and resolve any conflicts. // -// * 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. +// * TipOfSourceReferenceIsDifferentException +// The tip of the source branch in the destination repository does not match +// the tip of the source branch specified in your request. The pull request +// might have been updated. Make sure that you have the latest changes. // -// * 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. +// * TipsDivergenceExceededException +// The divergence between the tips of the provided commit specifiers is too +// great to determine whether there might be any merge conflicts. Locally compare +// the specifiers using git diff or a diff tool. // -// * ErrCodeInvalidRepositoryTriggerCustomDataException "InvalidRepositoryTriggerCustomDataException" -// The custom data provided for the trigger is not valid. +// * NameLengthExceededException +// The user name is not valid because it has exceeded the character limit for +// author names. // -// * ErrCodeMaximumBranchesExceededException "MaximumBranchesExceededException" -// The number of branches for the trigger was exceeded. +// * InvalidEmailException +// The specified email address either contains one or more characters that are +// not allowed, or it exceeds the maximum number of characters allowed for an +// email address. // -// * ErrCodeInvalidRepositoryTriggerBranchNameException "InvalidRepositoryTriggerBranchNameException" -// One or more branch names specified for the trigger is not valid. +// * CommitMessageLengthExceededException +// The commit message is too long. Provide a shorter string. // -// * 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. +// * InvalidConflictDetailLevelException +// The specified conflict detail level is not valid. // -// * ErrCodeRepositoryTriggerNameRequiredException "RepositoryTriggerNameRequiredException" -// A name for the trigger is required but was not specified. +// * InvalidConflictResolutionStrategyException +// The specified conflict resolution strategy is not valid. // -// * ErrCodeRepositoryTriggerDestinationArnRequiredException "RepositoryTriggerDestinationArnRequiredException" -// A destination ARN for the target service for the trigger is required but -// was not specified. +// * InvalidConflictResolutionException +// The specified conflict resolution list is not valid. // -// * ErrCodeRepositoryTriggerBranchNameListRequiredException "RepositoryTriggerBranchNameListRequiredException" -// At least one branch name is required but was not specified in the trigger -// configuration. +// * ReplacementTypeRequiredException +// A replacement type is required. +// +// * InvalidReplacementTypeException +// Automerge was specified for resolving the conflict, but the specified replacement +// type is not valid. +// +// * MultipleConflictResolutionEntriesException +// More than one conflict resolution entries exists for the conflict. A conflict +// can have only one conflict resolution entry. +// +// * ReplacementContentRequiredException +// USE_NEW_CONTENT was specified, but no replacement content has been provided. +// +// * MaximumConflictResolutionEntriesExceededException +// The number of allowed conflict resolution entries was exceeded. +// +// * PathRequiredException +// The folderPath for a location cannot be null. +// +// * InvalidPathException +// The specified path is not valid. +// +// * InvalidFileModeException +// The specified file mode permission is not valid. For a list of valid file +// mode permissions, see PutFile. +// +// * InvalidReplacementContentException +// Automerge was specified for resolving the conflict, but the replacement type +// is not valid or content is missing. +// +// * FileContentSizeLimitExceededException +// The file cannot be added because it is too large. The maximum file size is +// 6 MB, and the combined file content change size is 7 MB. Consider making +// these changes using a Git client. +// +// * FolderContentSizeLimitExceededException +// The commit cannot be created because at least one of the overall changes +// in the commit results in a folder whose contents exceed the limit of 6 MB. +// Either reduce the number and size of your changes, or split the changes across +// multiple folders. +// +// * MaximumFileContentToLoadExceededException +// The number of files to load exceeds the allowed limit. +// +// * MaximumItemsToCompareExceededException +// The number of items to compare between the source or destination branches +// and the merge base has exceeded the maximum allowed. +// +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. +// +// * InvalidRepositoryNameException +// A specified repository name is not valid. +// +// This exception occurs only 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. +// +// * RepositoryDoesNotExistException +// The specified repository does not exist. +// +// * RepositoryNotAssociatedWithPullRequestException +// The repository does not contain any pull requests with that pull request +// ID. Use GetPullRequest to verify the correct repository name for the pull +// request ID. +// +// * ConcurrentReferenceUpdateException +// The merge cannot be completed because the target branch has been modified. +// Another user might have modified the target branch while the merge was in +// progress. Wait a few minutes, and then try again. // -// * ErrCodeRepositoryTriggerEventsListRequiredException "RepositoryTriggerEventsListRequiredException" -// At least one event for the trigger is required but was not specified. +// * PullRequestApprovalRulesNotSatisfiedException +// The pull request cannot be merged because one or more approval rules applied +// to the pull request have conditions that have not been met. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/MergePullRequestByThreeWay +func (c *CodeCommit) MergePullRequestByThreeWay(input *MergePullRequestByThreeWayInput) (*MergePullRequestByThreeWayOutput, error) { + req, out := c.MergePullRequestByThreeWayRequest(input) return out, req.Send() } -// TestRepositoryTriggersWithContext is the same as TestRepositoryTriggers with the addition of +// MergePullRequestByThreeWayWithContext is the same as MergePullRequestByThreeWay with the addition of // the ability to pass a context and additional request options. // -// See TestRepositoryTriggers for details on how to use this API operation. +// See MergePullRequestByThreeWay for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) TestRepositoryTriggersWithContext(ctx aws.Context, input *TestRepositoryTriggersInput, opts ...request.Option) (*TestRepositoryTriggersOutput, error) { - req, out := c.TestRepositoryTriggersRequest(input) +func (c *CodeCommit) MergePullRequestByThreeWayWithContext(ctx aws.Context, input *MergePullRequestByThreeWayInput, opts ...request.Option) (*MergePullRequestByThreeWayOutput, error) { + req, out := c.MergePullRequestByThreeWayRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUntagResource = "UntagResource" +const opOverridePullRequestApprovalRules = "OverridePullRequestApprovalRules" -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource operation. The "output" return +// OverridePullRequestApprovalRulesRequest generates a "aws/request.Request" representing the +// client's request for the OverridePullRequestApprovalRules operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UntagResource for more information on using the UntagResource +// See OverridePullRequestApprovalRules for more information on using the OverridePullRequestApprovalRules // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) +// // Example sending a request using the OverridePullRequestApprovalRulesRequest method. +// req, resp := client.OverridePullRequestApprovalRulesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UntagResource -func (c *CodeCommit) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/OverridePullRequestApprovalRules +func (c *CodeCommit) OverridePullRequestApprovalRulesRequest(input *OverridePullRequestApprovalRulesInput) (req *request.Request, output *OverridePullRequestApprovalRulesOutput) { op := &request.Operation{ - Name: opUntagResource, + Name: opOverridePullRequestApprovalRules, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UntagResourceInput{} + input = &OverridePullRequestApprovalRulesInput{} } - output = &UntagResourceOutput{} + output = &OverridePullRequestApprovalRulesOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UntagResource API operation for AWS CodeCommit. +// OverridePullRequestApprovalRules API operation for AWS CodeCommit. // -// Removes tags for a resource in AWS CodeCommit. For a list of valid resources -// in AWS CodeCommit, see CodeCommit Resources and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) -// in the AWS CodeCommit User Guide. +// Sets aside (overrides) all approval rule requirements for a specified pull +// 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 CodeCommit's -// API operation UntagResource for usage and error information. +// API operation OverridePullRequestApprovalRules for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" -// The specified repository does not exist. +// Returned Error Types: +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. // -// 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. +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. // -// * ErrCodeResourceArnRequiredException "ResourceArnRequiredException" -// A valid Amazon Resource Name (ARN) for an AWS CodeCommit resource is required. -// For a list of valid resources in AWS CodeCommit, see CodeCommit Resources -// and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) -// in the AWS CodeCommit User Guide. +// * InvalidRevisionIdException +// The revision ID is not valid. Use GetPullRequest to determine the value. // -// * ErrCodeInvalidResourceArnException "InvalidResourceArnException" -// The value for the resource ARN is not valid. For more information about resources -// in AWS CodeCommit, see CodeCommit Resources and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) -// in the AWS CodeCommit User Guide. +// * RevisionIdRequiredException +// A revision ID is required, but was not provided. // -// * ErrCodeTagKeysListRequiredException "TagKeysListRequiredException" -// A list of tag keys is required. The list cannot be empty or null. +// * InvalidOverrideStatusException +// The override status is not valid. Valid statuses are OVERRIDE and REVOKE. // -// * ErrCodeInvalidTagKeysListException "InvalidTagKeysListException" -// The list of tags is not valid. +// * OverrideStatusRequiredException +// An override status is required, but no value was provided. Valid values include +// OVERRIDE and REVOKE. // -// * ErrCodeTooManyTagsException "TooManyTagsException" -// The maximum number of tags for an AWS CodeCommit resource has been exceeded. +// * OverrideAlreadySetException +// The pull request has already had its approval rules set to override. // -// * ErrCodeInvalidSystemTagUsageException "InvalidSystemTagUsageException" -// The specified tag is not valid. Key names cannot be prefixed with aws:. +// * RevisionNotCurrentException +// The revision ID provided in the request does not match the current revision +// ID. Use GetPullRequest to retrieve the current revision ID. // -// * ErrCodeTagPolicyException "TagPolicyException" -// The tag policy is not valid. +// * PullRequestAlreadyClosedException +// The pull request status cannot be updated because it is already closed. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UntagResource -func (c *CodeCommit) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/OverridePullRequestApprovalRules +func (c *CodeCommit) OverridePullRequestApprovalRules(input *OverridePullRequestApprovalRulesInput) (*OverridePullRequestApprovalRulesOutput, error) { + req, out := c.OverridePullRequestApprovalRulesRequest(input) return out, req.Send() } -// UntagResourceWithContext is the same as UntagResource with the addition of +// OverridePullRequestApprovalRulesWithContext is the same as OverridePullRequestApprovalRules with the addition of // the ability to pass a context and additional request options. // -// See UntagResource for details on how to use this API operation. +// See OverridePullRequestApprovalRules for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) +func (c *CodeCommit) OverridePullRequestApprovalRulesWithContext(ctx aws.Context, input *OverridePullRequestApprovalRulesInput, opts ...request.Option) (*OverridePullRequestApprovalRulesOutput, error) { + req, out := c.OverridePullRequestApprovalRulesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateComment = "UpdateComment" +const opPostCommentForComparedCommit = "PostCommentForComparedCommit" -// UpdateCommentRequest generates a "aws/request.Request" representing the -// client's request for the UpdateComment operation. The "output" return +// PostCommentForComparedCommitRequest generates a "aws/request.Request" representing the +// client's request for the PostCommentForComparedCommit operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateComment for more information on using the UpdateComment +// See PostCommentForComparedCommit for more information on using the PostCommentForComparedCommit // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateCommentRequest method. -// req, resp := client.UpdateCommentRequest(params) +// // Example sending a request using the PostCommentForComparedCommitRequest method. +// req, resp := client.PostCommentForComparedCommitRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateComment -func (c *CodeCommit) UpdateCommentRequest(input *UpdateCommentInput) (req *request.Request, output *UpdateCommentOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentForComparedCommit +func (c *CodeCommit) PostCommentForComparedCommitRequest(input *PostCommentForComparedCommitInput) (req *request.Request, output *PostCommentForComparedCommitOutput) { op := &request.Operation{ - Name: opUpdateComment, + Name: opPostCommentForComparedCommit, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateCommentInput{} + input = &PostCommentForComparedCommitInput{} } - output = &UpdateCommentOutput{} + output = &PostCommentForComparedCommitOutput{} req = c.newRequest(op, input, output) return } -// UpdateComment API operation for AWS CodeCommit. +// PostCommentForComparedCommit API operation for AWS CodeCommit. // -// Replaces the contents of a comment. +// Posts a comment on the comparison between two commits. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 UpdateComment for usage and error information. +// API operation PostCommentForComparedCommit for usage and error information. +// +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. +// +// * RepositoryDoesNotExistException +// The specified repository does not exist. +// +// * InvalidRepositoryNameException +// A specified repository name is not valid. +// +// This exception occurs only 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. +// +// * ClientRequestTokenRequiredException +// A client request token is required. A client request token is an unique, +// client-generated idempotency token that, when provided in a request, ensures +// the request cannot be repeated with a changed parameter. If a request is +// received with the same parameters and a token is included, the request returns +// information about the initial request that used that token. +// +// * InvalidClientRequestTokenException +// The client request token is not valid. +// +// * IdempotencyParameterMismatchException +// The client request token is not valid. Either the token is not in a valid +// format, or the token has been used in a previous request and cannot be reused. // -// Returned Error Codes: -// * ErrCodeCommentContentRequiredException "CommentContentRequiredException" +// * CommentContentRequiredException // The comment is empty. You must provide some content for a comment. The content // cannot be null. // -// * ErrCodeCommentContentSizeLimitExceededException "CommentContentSizeLimitExceededException" +// * CommentContentSizeLimitExceededException // The comment is too large. Comments are limited to 1,000 characters. // -// * ErrCodeCommentDoesNotExistException "CommentDoesNotExistException" -// No comment exists with the provided ID. Verify that you have provided the -// correct ID, and then try again. +// * InvalidFileLocationException +// The location of the file is not valid. Make sure that you include the file +// name and extension. // -// * ErrCodeCommentIdRequiredException "CommentIdRequiredException" -// The comment ID is missing or null. A comment ID is required. +// * InvalidRelativeFileVersionEnumException +// Either the enum is not in a valid format, or the specified file version enum +// is not valid in respect to the current file version. // -// * ErrCodeInvalidCommentIdException "InvalidCommentIdException" -// The comment ID is not in a valid format. Make sure that you have provided -// the full comment ID. +// * PathRequiredException +// The folderPath for a location cannot be null. // -// * ErrCodeCommentNotCreatedByCallerException "CommentNotCreatedByCallerException" -// You cannot modify or delete this comment. Only comment authors can modify -// or delete their comments. +// * InvalidFilePositionException +// The position is not valid. Make sure that the line number exists in the version +// of the file you want to comment on. // -// * ErrCodeCommentDeletedException "CommentDeletedException" -// This comment has already been deleted. You cannot edit or delete a deleted -// comment. +// * CommitIdRequiredException +// A commit ID was not specified. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateComment -func (c *CodeCommit) UpdateComment(input *UpdateCommentInput) (*UpdateCommentOutput, error) { - req, out := c.UpdateCommentRequest(input) +// * InvalidCommitIdException +// The specified commit ID is not valid. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// * BeforeCommitIdAndAfterCommitIdAreSameException +// The before commit ID and the after commit ID are the same, which is not valid. +// The before commit ID and the after commit ID must be different commit IDs. +// +// * CommitDoesNotExistException +// The specified commit does not exist or no commit was specified, and the specified +// repository has no default branch. +// +// * InvalidPathException +// The specified path is not valid. +// +// * PathDoesNotExistException +// The specified path does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentForComparedCommit +func (c *CodeCommit) PostCommentForComparedCommit(input *PostCommentForComparedCommitInput) (*PostCommentForComparedCommitOutput, error) { + req, out := c.PostCommentForComparedCommitRequest(input) return out, req.Send() } -// UpdateCommentWithContext is the same as UpdateComment with the addition of +// PostCommentForComparedCommitWithContext is the same as PostCommentForComparedCommit with the addition of // the ability to pass a context and additional request options. // -// See UpdateComment for details on how to use this API operation. +// See PostCommentForComparedCommit for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) UpdateCommentWithContext(ctx aws.Context, input *UpdateCommentInput, opts ...request.Option) (*UpdateCommentOutput, error) { - req, out := c.UpdateCommentRequest(input) +func (c *CodeCommit) PostCommentForComparedCommitWithContext(ctx aws.Context, input *PostCommentForComparedCommitInput, opts ...request.Option) (*PostCommentForComparedCommitOutput, error) { + req, out := c.PostCommentForComparedCommitRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateDefaultBranch = "UpdateDefaultBranch" +const opPostCommentForPullRequest = "PostCommentForPullRequest" -// UpdateDefaultBranchRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDefaultBranch operation. The "output" return +// PostCommentForPullRequestRequest generates a "aws/request.Request" representing the +// client's request for the PostCommentForPullRequest operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateDefaultBranch for more information on using the UpdateDefaultBranch +// See PostCommentForPullRequest for more information on using the PostCommentForPullRequest // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateDefaultBranchRequest method. -// req, resp := client.UpdateDefaultBranchRequest(params) +// // Example sending a request using the PostCommentForPullRequestRequest method. +// req, resp := client.PostCommentForPullRequestRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateDefaultBranch -func (c *CodeCommit) UpdateDefaultBranchRequest(input *UpdateDefaultBranchInput) (req *request.Request, output *UpdateDefaultBranchOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentForPullRequest +func (c *CodeCommit) PostCommentForPullRequestRequest(input *PostCommentForPullRequestInput) (req *request.Request, output *PostCommentForPullRequestOutput) { op := &request.Operation{ - Name: opUpdateDefaultBranch, + Name: opPostCommentForPullRequest, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateDefaultBranchInput{} + input = &PostCommentForPullRequestInput{} } - output = &UpdateDefaultBranchOutput{} + output = &PostCommentForPullRequestOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateDefaultBranch API operation for AWS CodeCommit. +// PostCommentForPullRequest 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. +// Posts a comment on a pull 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 CodeCommit's -// API operation UpdateDefaultBranch for usage and error information. +// API operation PostCommentForPullRequest for usage and error information. +// +// Returned Error Types: +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. +// +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. +// +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. // -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// * RepositoryNotAssociatedWithPullRequestException +// The repository does not contain any pull requests with that pull request +// ID. Use GetPullRequest to verify the correct repository name for the pull +// request ID. +// +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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. +// * ClientRequestTokenRequiredException +// A client request token is required. A client request token is an unique, +// client-generated idempotency token that, when provided in a request, ensures +// the request cannot be repeated with a changed parameter. If a request is +// received with the same parameters and a token is included, the request returns +// information about the initial request that used that token. // -// * ErrCodeInvalidBranchNameException "InvalidBranchNameException" -// The specified reference name is not valid. +// * InvalidClientRequestTokenException +// The client request token is not valid. // -// * ErrCodeBranchDoesNotExistException "BranchDoesNotExistException" -// The specified branch does not exist. +// * IdempotencyParameterMismatchException +// The client request token is not valid. Either the token is not in a valid +// format, or the token has been used in a previous request and cannot be reused. +// +// * CommentContentRequiredException +// The comment is empty. You must provide some content for a comment. The content +// cannot be null. +// +// * CommentContentSizeLimitExceededException +// The comment is too large. Comments are limited to 1,000 characters. +// +// * InvalidFileLocationException +// The location of the file is not valid. Make sure that you include the file +// name and extension. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * InvalidRelativeFileVersionEnumException +// Either the enum is not in a valid format, or the specified file version enum +// is not valid in respect to the current file version. +// +// * PathRequiredException +// The folderPath for a location cannot be null. +// +// * InvalidFilePositionException +// The position is not valid. Make sure that the line number exists in the version +// of the file you want to comment on. +// +// * CommitIdRequiredException +// A commit ID was not specified. +// +// * InvalidCommitIdException +// The specified commit ID is not valid. +// +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, 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) +// * CommitDoesNotExistException +// The specified commit does not exist or no commit was specified, and the specified +// repository has no default branch. +// +// * InvalidPathException +// The specified path is not valid. +// +// * PathDoesNotExistException +// The specified path does not exist. +// +// * PathRequiredException +// The folderPath for a location cannot be null. +// +// * BeforeCommitIdAndAfterCommitIdAreSameException +// The before commit ID and the after commit ID are the same, which is not valid. +// The before commit ID and the after commit ID must be different commit IDs. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentForPullRequest +func (c *CodeCommit) PostCommentForPullRequest(input *PostCommentForPullRequestInput) (*PostCommentForPullRequestOutput, error) { + req, out := c.PostCommentForPullRequestRequest(input) return out, req.Send() } -// UpdateDefaultBranchWithContext is the same as UpdateDefaultBranch with the addition of +// PostCommentForPullRequestWithContext is the same as PostCommentForPullRequest with the addition of // the ability to pass a context and additional request options. // -// See UpdateDefaultBranch for details on how to use this API operation. +// See PostCommentForPullRequest for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) UpdateDefaultBranchWithContext(ctx aws.Context, input *UpdateDefaultBranchInput, opts ...request.Option) (*UpdateDefaultBranchOutput, error) { - req, out := c.UpdateDefaultBranchRequest(input) +func (c *CodeCommit) PostCommentForPullRequestWithContext(ctx aws.Context, input *PostCommentForPullRequestInput, opts ...request.Option) (*PostCommentForPullRequestOutput, error) { + req, out := c.PostCommentForPullRequestRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdatePullRequestDescription = "UpdatePullRequestDescription" +const opPostCommentReply = "PostCommentReply" -// UpdatePullRequestDescriptionRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePullRequestDescription operation. The "output" return +// PostCommentReplyRequest generates a "aws/request.Request" representing the +// client's request for the PostCommentReply operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdatePullRequestDescription for more information on using the UpdatePullRequestDescription +// See PostCommentReply for more information on using the PostCommentReply // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdatePullRequestDescriptionRequest method. -// req, resp := client.UpdatePullRequestDescriptionRequest(params) +// // Example sending a request using the PostCommentReplyRequest method. +// req, resp := client.PostCommentReplyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestDescription -func (c *CodeCommit) UpdatePullRequestDescriptionRequest(input *UpdatePullRequestDescriptionInput) (req *request.Request, output *UpdatePullRequestDescriptionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentReply +func (c *CodeCommit) PostCommentReplyRequest(input *PostCommentReplyInput) (req *request.Request, output *PostCommentReplyOutput) { op := &request.Operation{ - Name: opUpdatePullRequestDescription, + Name: opPostCommentReply, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdatePullRequestDescriptionInput{} + input = &PostCommentReplyInput{} } - output = &UpdatePullRequestDescriptionOutput{} + output = &PostCommentReplyOutput{} req = c.newRequest(op, input, output) return } -// UpdatePullRequestDescription API operation for AWS CodeCommit. +// PostCommentReply API operation for AWS CodeCommit. // -// Replaces the contents of the description of a pull request. +// Posts a comment in reply to an existing comment on a comparison between commits +// or a pull 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 CodeCommit's -// API operation UpdatePullRequestDescription for usage and error information. +// API operation PostCommentReply for usage and error information. // -// Returned Error Codes: -// * ErrCodePullRequestDoesNotExistException "PullRequestDoesNotExistException" -// The pull request ID could not be found. Make sure that you have specified -// the correct repository name and pull request ID, and then try again. +// Returned Error Types: +// * ClientRequestTokenRequiredException +// A client request token is required. A client request token is an unique, +// client-generated idempotency token that, when provided in a request, ensures +// the request cannot be repeated with a changed parameter. If a request is +// received with the same parameters and a token is included, the request returns +// information about the initial request that used that token. // -// * ErrCodeInvalidPullRequestIdException "InvalidPullRequestIdException" -// The pull request ID is not valid. Make sure that you have provided the full -// ID and that the pull request is in the specified repository, and then try -// again. +// * InvalidClientRequestTokenException +// The client request token is not valid. // -// * ErrCodePullRequestIdRequiredException "PullRequestIdRequiredException" -// A pull request ID is required, but none was provided. +// * IdempotencyParameterMismatchException +// The client request token is not valid. Either the token is not in a valid +// format, or the token has been used in a previous request and cannot be reused. // -// * ErrCodeInvalidDescriptionException "InvalidDescriptionException" -// The pull request description is not valid. Descriptions are limited to 1,000 -// characters in length. +// * CommentContentRequiredException +// The comment is empty. You must provide some content for a comment. The content +// cannot be null. // -// * ErrCodePullRequestAlreadyClosedException "PullRequestAlreadyClosedException" -// The pull request status cannot be updated because it is already closed. +// * CommentContentSizeLimitExceededException +// The comment is too large. Comments are limited to 1,000 characters. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestDescription -func (c *CodeCommit) UpdatePullRequestDescription(input *UpdatePullRequestDescriptionInput) (*UpdatePullRequestDescriptionOutput, error) { - req, out := c.UpdatePullRequestDescriptionRequest(input) +// * CommentDoesNotExistException +// No comment exists with the provided ID. Verify that you have used the correct +// ID, and then try again. +// +// * CommentIdRequiredException +// The comment ID is missing or null. A comment ID is required. +// +// * InvalidCommentIdException +// The comment ID is not in a valid format. Make sure that you have provided +// the full comment ID. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PostCommentReply +func (c *CodeCommit) PostCommentReply(input *PostCommentReplyInput) (*PostCommentReplyOutput, error) { + req, out := c.PostCommentReplyRequest(input) return out, req.Send() } -// UpdatePullRequestDescriptionWithContext is the same as UpdatePullRequestDescription with the addition of +// PostCommentReplyWithContext is the same as PostCommentReply with the addition of // the ability to pass a context and additional request options. // -// See UpdatePullRequestDescription for details on how to use this API operation. +// See PostCommentReply for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) UpdatePullRequestDescriptionWithContext(ctx aws.Context, input *UpdatePullRequestDescriptionInput, opts ...request.Option) (*UpdatePullRequestDescriptionOutput, error) { - req, out := c.UpdatePullRequestDescriptionRequest(input) +func (c *CodeCommit) PostCommentReplyWithContext(ctx aws.Context, input *PostCommentReplyInput, opts ...request.Option) (*PostCommentReplyOutput, error) { + req, out := c.PostCommentReplyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdatePullRequestStatus = "UpdatePullRequestStatus" +const opPutFile = "PutFile" -// UpdatePullRequestStatusRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePullRequestStatus operation. The "output" return +// PutFileRequest generates a "aws/request.Request" representing the +// client's request for the PutFile operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdatePullRequestStatus for more information on using the UpdatePullRequestStatus +// See PutFile for more information on using the PutFile // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdatePullRequestStatusRequest method. -// req, resp := client.UpdatePullRequestStatusRequest(params) +// // Example sending a request using the PutFileRequest method. +// req, resp := client.PutFileRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestStatus -func (c *CodeCommit) UpdatePullRequestStatusRequest(input *UpdatePullRequestStatusInput) (req *request.Request, output *UpdatePullRequestStatusOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PutFile +func (c *CodeCommit) PutFileRequest(input *PutFileInput) (req *request.Request, output *PutFileOutput) { op := &request.Operation{ - Name: opUpdatePullRequestStatus, + Name: opPutFile, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdatePullRequestStatusInput{} + input = &PutFileInput{} } - output = &UpdatePullRequestStatusOutput{} + output = &PutFileOutput{} req = c.newRequest(op, input, output) return } -// UpdatePullRequestStatus API operation for AWS CodeCommit. +// PutFile API operation for AWS CodeCommit. // -// Updates the status of a pull request. +// Adds or updates a file in a branch in an AWS CodeCommit repository, and generates +// a commit for the addition in the specified branch. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 UpdatePullRequestStatus for usage and error information. +// API operation PutFile for usage and error information. // -// Returned Error Codes: -// * ErrCodePullRequestDoesNotExistException "PullRequestDoesNotExistException" -// The pull request ID could not be found. Make sure that you have specified -// the correct repository name and pull request ID, and then try again. +// Returned Error Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidPullRequestIdException "InvalidPullRequestIdException" -// The pull request ID is not valid. Make sure that you have provided the full -// ID and that the pull request is in the specified repository, and then try -// again. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// * ErrCodePullRequestIdRequiredException "PullRequestIdRequiredException" -// A pull request ID is required, but none was provided. +// This exception occurs only 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. // -// * ErrCodeInvalidPullRequestStatusUpdateException "InvalidPullRequestStatusUpdateException" -// The pull request status update is not valid. The only valid update is from -// OPEN to CLOSED. +// * RepositoryDoesNotExistException +// The specified repository does not exist. // -// * ErrCodeInvalidPullRequestStatusException "InvalidPullRequestStatusException" -// The pull request status is not valid. The only valid values are OPEN and -// CLOSED. +// * ParentCommitIdRequiredException +// A parent commit ID is required. To view the full commit ID of a branch in +// a repository, use GetBranch or a Git command (for example, git pull or git +// log). // -// * ErrCodePullRequestStatusRequiredException "PullRequestStatusRequiredException" -// A pull request status is required, but none was provided. +// * InvalidParentCommitIdException +// The parent commit ID is not valid. The commit ID cannot be empty, and must +// match the head commit ID for the branch of the repository where you want +// to add or update a file. +// +// * ParentCommitDoesNotExistException +// The parent commit ID is not valid because it does not exist. The specified +// parent commit ID does not exist in the specified branch of the repository. +// +// * ParentCommitIdOutdatedException +// The file could not be added because the provided parent commit ID is not +// the current tip of the specified branch. To view the full commit ID of the +// current head of the branch, use GetBranch. +// +// * FileContentRequiredException +// The file cannot be added because it is empty. Empty files cannot be added +// to the repository with this API. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" +// * FileContentSizeLimitExceededException +// The file cannot be added because it is too large. The maximum file size is +// 6 MB, and the combined file content change size is 7 MB. Consider making +// these changes using a Git client. +// +// * FolderContentSizeLimitExceededException +// The commit cannot be created because at least one of the overall changes +// in the commit results in a folder whose contents exceed the limit of 6 MB. +// Either reduce the number and size of your changes, or split the changes across +// multiple folders. +// +// * PathRequiredException +// The folderPath for a location cannot be null. +// +// * InvalidPathException +// The specified path is not valid. +// +// * BranchNameRequiredException +// A branch name is required, but was not specified. +// +// * InvalidBranchNameException +// The specified reference name is not valid. +// +// * BranchDoesNotExistException +// The specified branch does not exist. +// +// * BranchNameIsTagNameException +// The specified branch name is not valid because it is a tag name. Enter the +// name of a branch in the repository. For a list of valid branch names, use +// ListBranches. +// +// * InvalidFileModeException +// The specified file mode permission is not valid. For a list of valid file +// mode permissions, see PutFile. +// +// * NameLengthExceededException +// The user name is not valid because it has exceeded the character limit for +// author names. +// +// * InvalidEmailException +// The specified email address either contains one or more characters that are +// not allowed, or it exceeds the maximum number of characters allowed for an +// email address. +// +// * CommitMessageLengthExceededException +// The commit message is too long. Provide a shorter string. +// +// * InvalidDeletionParameterException +// The specified deletion parameter is not valid. +// +// * EncryptionIntegrityChecksFailedException // An encryption integrity check failed. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" +// * EncryptionKeyAccessDeniedException // An encryption key could not be accessed. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" +// * EncryptionKeyDisabledException // The encryption key is disabled. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" +// * EncryptionKeyNotFoundException // No encryption key was found. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" +// * EncryptionKeyUnavailableException // The encryption key is not available. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestStatus -func (c *CodeCommit) UpdatePullRequestStatus(input *UpdatePullRequestStatusInput) (*UpdatePullRequestStatusOutput, error) { - req, out := c.UpdatePullRequestStatusRequest(input) +// * SameFileContentException +// The file was not added or updated because the content of the file is exactly +// the same as the content of that file in the repository and branch that you +// specified. +// +// * FileNameConflictsWithDirectoryNameException +// A file cannot be added to the repository because the specified file name +// has the same name as a directory in this repository. Either provide another +// name for the file, or add the file in a directory that does not match the +// file name. +// +// * DirectoryNameConflictsWithFileNameException +// A file cannot be added to the repository because the specified path name +// has the same name as a file that already exists in this repository. Either +// provide a different name for the file, or specify a different path for the +// file. +// +// * FilePathConflictsWithSubmodulePathException +// The commit cannot be created because a specified file path points to a submodule. +// Verify that the destination files have valid file paths that do not point +// to a submodule. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/PutFile +func (c *CodeCommit) PutFile(input *PutFileInput) (*PutFileOutput, error) { + req, out := c.PutFileRequest(input) return out, req.Send() } -// UpdatePullRequestStatusWithContext is the same as UpdatePullRequestStatus with the addition of +// PutFileWithContext is the same as PutFile with the addition of // the ability to pass a context and additional request options. // -// See UpdatePullRequestStatus for details on how to use this API operation. +// See PutFile for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) UpdatePullRequestStatusWithContext(ctx aws.Context, input *UpdatePullRequestStatusInput, opts ...request.Option) (*UpdatePullRequestStatusOutput, error) { - req, out := c.UpdatePullRequestStatusRequest(input) +func (c *CodeCommit) PutFileWithContext(ctx aws.Context, input *PutFileInput, opts ...request.Option) (*PutFileOutput, error) { + req, out := c.PutFileRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdatePullRequestTitle = "UpdatePullRequestTitle" +const opPutRepositoryTriggers = "PutRepositoryTriggers" -// UpdatePullRequestTitleRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePullRequestTitle operation. The "output" return +// PutRepositoryTriggersRequest generates a "aws/request.Request" representing the +// client's request for the PutRepositoryTriggers operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdatePullRequestTitle for more information on using the UpdatePullRequestTitle +// See PutRepositoryTriggers for more information on using the PutRepositoryTriggers // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdatePullRequestTitleRequest method. -// req, resp := client.UpdatePullRequestTitleRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestTitle -func (c *CodeCommit) UpdatePullRequestTitleRequest(input *UpdatePullRequestTitleInput) (req *request.Request, output *UpdatePullRequestTitleOutput) { +// See also, 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: opUpdatePullRequestTitle, + Name: opPutRepositoryTriggers, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdatePullRequestTitleInput{} + input = &PutRepositoryTriggersInput{} } - output = &UpdatePullRequestTitleOutput{} + output = &PutRepositoryTriggersOutput{} req = c.newRequest(op, input, output) return } -// UpdatePullRequestTitle API operation for AWS CodeCommit. +// PutRepositoryTriggers API operation for AWS CodeCommit. // -// Replaces the title of a pull request. +// Replaces all triggers for a repository. 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 UpdatePullRequestTitle for usage and error information. +// API operation PutRepositoryTriggers for usage and error information. // -// Returned Error Codes: -// * ErrCodePullRequestDoesNotExistException "PullRequestDoesNotExistException" -// The pull request ID could not be found. Make sure that you have specified -// the correct repository name and pull request ID, and then try again. +// Returned Error Types: +// * RepositoryDoesNotExistException +// The specified repository does not exist. // -// * ErrCodeInvalidPullRequestIdException "InvalidPullRequestIdException" -// The pull request ID is not valid. Make sure that you have provided the full -// ID and that the pull request is in the specified repository, and then try -// again. +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodePullRequestIdRequiredException "PullRequestIdRequiredException" -// A pull request ID is required, but none was provided. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// * ErrCodeTitleRequiredException "TitleRequiredException" -// A pull request title is required. It cannot be empty or null. +// This exception occurs only 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. // -// * ErrCodeInvalidTitleException "InvalidTitleException" -// The title of the pull request is not valid. Pull request titles cannot exceed -// 100 characters in length. +// * RepositoryTriggersListRequiredException +// The list of triggers for the repository is required, but was not specified. // -// * ErrCodePullRequestAlreadyClosedException "PullRequestAlreadyClosedException" -// The pull request status cannot be updated because it is already closed. +// * MaximumRepositoryTriggersExceededException +// The number of triggers allowed for the repository was exceeded. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestTitle -func (c *CodeCommit) UpdatePullRequestTitle(input *UpdatePullRequestTitleInput) (*UpdatePullRequestTitleOutput, error) { - req, out := c.UpdatePullRequestTitleRequest(input) +// * InvalidRepositoryTriggerNameException +// The name of the trigger is not valid. +// +// * 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. +// +// * InvalidRepositoryTriggerRegionException +// The AWS Region for the trigger target does not match the AWS Region for the +// repository. Triggers must be created in the same Region as the target for +// the trigger. +// +// * InvalidRepositoryTriggerCustomDataException +// The custom data provided for the trigger is not valid. +// +// * MaximumBranchesExceededException +// The number of branches for the trigger was exceeded. +// +// * InvalidRepositoryTriggerBranchNameException +// One or more branch names specified for the trigger is not valid. +// +// * 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. +// +// * RepositoryTriggerNameRequiredException +// A name for the trigger is required, but was not specified. +// +// * RepositoryTriggerDestinationArnRequiredException +// A destination ARN for the target service for the trigger is required, but +// was not specified. +// +// * RepositoryTriggerBranchNameListRequiredException +// At least one branch name is required, but was not specified in the trigger +// configuration. +// +// * RepositoryTriggerEventsListRequiredException +// At least one event for the trigger is required, but was not specified. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, 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) return out, req.Send() } -// UpdatePullRequestTitleWithContext is the same as UpdatePullRequestTitle with the addition of +// PutRepositoryTriggersWithContext is the same as PutRepositoryTriggers with the addition of // the ability to pass a context and additional request options. // -// See UpdatePullRequestTitle for details on how to use this API operation. +// See PutRepositoryTriggers for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) UpdatePullRequestTitleWithContext(ctx aws.Context, input *UpdatePullRequestTitleInput, opts ...request.Option) (*UpdatePullRequestTitleOutput, error) { - req, out := c.UpdatePullRequestTitleRequest(input) +func (c *CodeCommit) PutRepositoryTriggersWithContext(ctx aws.Context, input *PutRepositoryTriggersInput, opts ...request.Option) (*PutRepositoryTriggersOutput, error) { + req, out := c.PutRepositoryTriggersRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateRepositoryDescription = "UpdateRepositoryDescription" +const opTagResource = "TagResource" -// UpdateRepositoryDescriptionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRepositoryDescription operation. The "output" return +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateRepositoryDescription for more information on using the UpdateRepositoryDescription +// See TagResource for more information on using the TagResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateRepositoryDescriptionRequest method. -// req, resp := client.UpdateRepositoryDescriptionRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryDescription -func (c *CodeCommit) UpdateRepositoryDescriptionRequest(input *UpdateRepositoryDescriptionInput) (req *request.Request, output *UpdateRepositoryDescriptionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/TagResource +func (c *CodeCommit) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { op := &request.Operation{ - Name: opUpdateRepositoryDescription, + Name: opTagResource, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateRepositoryDescriptionInput{} + input = &TagResourceInput{} } - output = &UpdateRepositoryDescriptionOutput{} + output = &TagResourceOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateRepositoryDescription API operation for AWS CodeCommit. -// -// Sets or changes the comment or description for a repository. +// TagResource API operation for AWS CodeCommit. // -// 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. +// Adds or updates tags for a resource in AWS CodeCommit. For a list of valid +// resources in AWS CodeCommit, see CodeCommit Resources and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) +// 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 UpdateRepositoryDescription for usage and error information. -// -// Returned Error Codes: -// * ErrCodeRepositoryNameRequiredException "RepositoryNameRequiredException" -// A repository name is required but was not specified. +// API operation TagResource for usage and error information. // -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" +// Returned Error Types: +// * RepositoryDoesNotExistException // The specified repository does not exist. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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. +// * ResourceArnRequiredException +// A valid Amazon Resource Name (ARN) for an AWS CodeCommit resource is required. +// For a list of valid resources in AWS CodeCommit, see CodeCommit Resources +// and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) +// in the AWS CodeCommit User Guide. // -// * ErrCodeEncryptionIntegrityChecksFailedException "EncryptionIntegrityChecksFailedException" -// An encryption integrity check failed. +// * InvalidResourceArnException +// The value for the resource ARN is not valid. For more information about resources +// in AWS CodeCommit, see CodeCommit Resources and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) +// in the AWS CodeCommit User Guide. // -// * ErrCodeEncryptionKeyAccessDeniedException "EncryptionKeyAccessDeniedException" -// An encryption key could not be accessed. +// * TagsMapRequiredException +// A map of tags is required. // -// * ErrCodeEncryptionKeyDisabledException "EncryptionKeyDisabledException" -// The encryption key is disabled. +// * InvalidTagsMapException +// The map of tags is not valid. // -// * ErrCodeEncryptionKeyNotFoundException "EncryptionKeyNotFoundException" -// No encryption key was found. +// * TooManyTagsException +// The maximum number of tags for an AWS CodeCommit resource has been exceeded. // -// * ErrCodeEncryptionKeyUnavailableException "EncryptionKeyUnavailableException" -// The encryption key is not available. +// * InvalidSystemTagUsageException +// The specified tag is not valid. Key names cannot be prefixed with aws:. // -// See also, 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) +// * TagPolicyException +// The tag policy is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/TagResource +func (c *CodeCommit) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) return out, req.Send() } -// UpdateRepositoryDescriptionWithContext is the same as UpdateRepositoryDescription with the addition of +// TagResourceWithContext is the same as TagResource with the addition of // the ability to pass a context and additional request options. // -// See UpdateRepositoryDescription for details on how to use this API operation. +// See TagResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) UpdateRepositoryDescriptionWithContext(ctx aws.Context, input *UpdateRepositoryDescriptionInput, opts ...request.Option) (*UpdateRepositoryDescriptionOutput, error) { - req, out := c.UpdateRepositoryDescriptionRequest(input) +func (c *CodeCommit) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateRepositoryName = "UpdateRepositoryName" +const opTestRepositoryTriggers = "TestRepositoryTriggers" -// UpdateRepositoryNameRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRepositoryName operation. The "output" return +// TestRepositoryTriggersRequest generates a "aws/request.Request" representing the +// client's request for the TestRepositoryTriggers operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateRepositoryName for more information on using the UpdateRepositoryName +// See TestRepositoryTriggers for more information on using the TestRepositoryTriggers // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateRepositoryNameRequest method. -// req, resp := client.UpdateRepositoryNameRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateRepositoryName -func (c *CodeCommit) UpdateRepositoryNameRequest(input *UpdateRepositoryNameInput) (req *request.Request, output *UpdateRepositoryNameOutput) { +// See also, 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: opUpdateRepositoryName, + Name: opTestRepositoryTriggers, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateRepositoryNameInput{} + input = &TestRepositoryTriggersInput{} } - output = &UpdateRepositoryNameOutput{} + output = &TestRepositoryTriggersOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateRepositoryName API operation for AWS CodeCommit. +// TestRepositoryTriggers 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 (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html) -// in the AWS CodeCommit User Guide. +// Tests the functionality of repository triggers by sending information to +// the trigger target. If real data is available in the repository, the test +// sends data from the last commit. If no data is available, sample data is +// 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 UpdateRepositoryName for usage and error information. +// API operation TestRepositoryTriggers for usage and error information. // -// Returned Error Codes: -// * ErrCodeRepositoryDoesNotExistException "RepositoryDoesNotExistException" +// Returned Error Types: +// * 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. +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. // -// * ErrCodeInvalidRepositoryNameException "InvalidRepositoryNameException" -// At least one specified repository name is not valid. +// * InvalidRepositoryNameException +// A specified repository name is not valid. // -// This exception only occurs when a specified repository name is not valid. +// This exception occurs only 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. // -// See also, 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) +// * RepositoryTriggersListRequiredException +// The list of triggers for the repository is required, but was not specified. +// +// * MaximumRepositoryTriggersExceededException +// The number of triggers allowed for the repository was exceeded. +// +// * InvalidRepositoryTriggerNameException +// The name of the trigger is not valid. +// +// * 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. +// +// * InvalidRepositoryTriggerRegionException +// The AWS Region for the trigger target does not match the AWS Region for the +// repository. Triggers must be created in the same Region as the target for +// the trigger. +// +// * InvalidRepositoryTriggerCustomDataException +// The custom data provided for the trigger is not valid. +// +// * MaximumBranchesExceededException +// The number of branches for the trigger was exceeded. +// +// * InvalidRepositoryTriggerBranchNameException +// One or more branch names specified for the trigger is not valid. +// +// * 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. +// +// * RepositoryTriggerNameRequiredException +// A name for the trigger is required, but was not specified. +// +// * RepositoryTriggerDestinationArnRequiredException +// A destination ARN for the target service for the trigger is required, but +// was not specified. +// +// * RepositoryTriggerBranchNameListRequiredException +// At least one branch name is required, but was not specified in the trigger +// configuration. +// +// * RepositoryTriggerEventsListRequiredException +// At least one event for the trigger is required, but was not specified. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, 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) return out, req.Send() } -// UpdateRepositoryNameWithContext is the same as UpdateRepositoryName with the addition of +// TestRepositoryTriggersWithContext is the same as TestRepositoryTriggers with the addition of // the ability to pass a context and additional request options. // -// See UpdateRepositoryName for details on how to use this API operation. +// See TestRepositoryTriggers for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *CodeCommit) UpdateRepositoryNameWithContext(ctx aws.Context, input *UpdateRepositoryNameInput, opts ...request.Option) (*UpdateRepositoryNameOutput, error) { - req, out := c.UpdateRepositoryNameRequest(input) +func (c *CodeCommit) TestRepositoryTriggersWithContext(ctx aws.Context, input *TestRepositoryTriggersInput, opts ...request.Option) (*TestRepositoryTriggersOutput, error) { + req, out := c.TestRepositoryTriggersRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// Information about errors in a BatchDescribeMergeConflicts operation. -type BatchDescribeMergeConflictsError struct { - _ struct{} `type:"structure"` - - // The name of the exception. - // - // ExceptionName is a required field - ExceptionName *string `locationName:"exceptionName" type:"string" required:"true"` - - // The path to the file. - // - // FilePath is a required field - FilePath *string `locationName:"filePath" type:"string" required:"true"` - - // The message provided by the exception. - // - // Message is a required field - Message *string `locationName:"message" type:"string" required:"true"` -} +const opUntagResource = "UntagResource" -// String returns the string representation -func (s BatchDescribeMergeConflictsError) String() string { - return awsutil.Prettify(s) +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UntagResource +func (c *CodeCommit) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for AWS CodeCommit. +// +// Removes tags for a resource in AWS CodeCommit. For a list of valid resources +// in AWS CodeCommit, see CodeCommit Resources and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) +// 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 UntagResource for usage and error information. +// +// Returned Error Types: +// * RepositoryDoesNotExistException +// The specified repository does not exist. +// +// * InvalidRepositoryNameException +// A specified repository name is not valid. +// +// This exception occurs only 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. +// +// * ResourceArnRequiredException +// A valid Amazon Resource Name (ARN) for an AWS CodeCommit resource is required. +// For a list of valid resources in AWS CodeCommit, see CodeCommit Resources +// and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) +// in the AWS CodeCommit User Guide. +// +// * InvalidResourceArnException +// The value for the resource ARN is not valid. For more information about resources +// in AWS CodeCommit, see CodeCommit Resources and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) +// in the AWS CodeCommit User Guide. +// +// * TagKeysListRequiredException +// A list of tag keys is required. The list cannot be empty or null. +// +// * InvalidTagKeysListException +// The list of tags is not valid. +// +// * TooManyTagsException +// The maximum number of tags for an AWS CodeCommit resource has been exceeded. +// +// * InvalidSystemTagUsageException +// The specified tag is not valid. Key names cannot be prefixed with aws:. +// +// * TagPolicyException +// The tag policy is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UntagResource +func (c *CodeCommit) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateApprovalRuleTemplateContent = "UpdateApprovalRuleTemplateContent" + +// UpdateApprovalRuleTemplateContentRequest generates a "aws/request.Request" representing the +// client's request for the UpdateApprovalRuleTemplateContent operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateApprovalRuleTemplateContent for more information on using the UpdateApprovalRuleTemplateContent +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateApprovalRuleTemplateContentRequest method. +// req, resp := client.UpdateApprovalRuleTemplateContentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateApprovalRuleTemplateContent +func (c *CodeCommit) UpdateApprovalRuleTemplateContentRequest(input *UpdateApprovalRuleTemplateContentInput) (req *request.Request, output *UpdateApprovalRuleTemplateContentOutput) { + op := &request.Operation{ + Name: opUpdateApprovalRuleTemplateContent, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateApprovalRuleTemplateContentInput{} + } + + output = &UpdateApprovalRuleTemplateContentOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateApprovalRuleTemplateContent API operation for AWS CodeCommit. +// +// Updates the content of an approval rule template. You can change the number +// of required approvals, the membership of the approval rule, and whether an +// approval pool is defined. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 UpdateApprovalRuleTemplateContent for usage and error information. +// +// Returned Error Types: +// * InvalidApprovalRuleTemplateNameException +// The name of the approval rule template is not valid. Template names must +// be between 1 and 100 valid characters in length. For more information about +// limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). +// +// * ApprovalRuleTemplateNameRequiredException +// An approval rule template name is required, but was not specified. +// +// * ApprovalRuleTemplateDoesNotExistException +// The specified approval rule template does not exist. Verify that the name +// is correct and that you are signed in to the AWS Region where the template +// was created, and then try again. +// +// * InvalidApprovalRuleTemplateContentException +// The content of the approval rule template is not valid. +// +// * InvalidRuleContentSha256Exception +// The SHA-256 hash signature for the rule content is not valid. +// +// * ApprovalRuleTemplateContentRequiredException +// The content for the approval rule template is empty. You must provide some +// content for an approval rule template. The content cannot be null. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateApprovalRuleTemplateContent +func (c *CodeCommit) UpdateApprovalRuleTemplateContent(input *UpdateApprovalRuleTemplateContentInput) (*UpdateApprovalRuleTemplateContentOutput, error) { + req, out := c.UpdateApprovalRuleTemplateContentRequest(input) + return out, req.Send() +} + +// UpdateApprovalRuleTemplateContentWithContext is the same as UpdateApprovalRuleTemplateContent with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApprovalRuleTemplateContent for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) UpdateApprovalRuleTemplateContentWithContext(ctx aws.Context, input *UpdateApprovalRuleTemplateContentInput, opts ...request.Option) (*UpdateApprovalRuleTemplateContentOutput, error) { + req, out := c.UpdateApprovalRuleTemplateContentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateApprovalRuleTemplateDescription = "UpdateApprovalRuleTemplateDescription" + +// UpdateApprovalRuleTemplateDescriptionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateApprovalRuleTemplateDescription operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateApprovalRuleTemplateDescription for more information on using the UpdateApprovalRuleTemplateDescription +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateApprovalRuleTemplateDescriptionRequest method. +// req, resp := client.UpdateApprovalRuleTemplateDescriptionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateApprovalRuleTemplateDescription +func (c *CodeCommit) UpdateApprovalRuleTemplateDescriptionRequest(input *UpdateApprovalRuleTemplateDescriptionInput) (req *request.Request, output *UpdateApprovalRuleTemplateDescriptionOutput) { + op := &request.Operation{ + Name: opUpdateApprovalRuleTemplateDescription, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateApprovalRuleTemplateDescriptionInput{} + } + + output = &UpdateApprovalRuleTemplateDescriptionOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateApprovalRuleTemplateDescription API operation for AWS CodeCommit. +// +// Updates the description for a specified approval rule 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 CodeCommit's +// API operation UpdateApprovalRuleTemplateDescription for usage and error information. +// +// Returned Error Types: +// * InvalidApprovalRuleTemplateNameException +// The name of the approval rule template is not valid. Template names must +// be between 1 and 100 valid characters in length. For more information about +// limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). +// +// * ApprovalRuleTemplateNameRequiredException +// An approval rule template name is required, but was not specified. +// +// * ApprovalRuleTemplateDoesNotExistException +// The specified approval rule template does not exist. Verify that the name +// is correct and that you are signed in to the AWS Region where the template +// was created, and then try again. +// +// * InvalidApprovalRuleTemplateDescriptionException +// The description for the approval rule template is not valid because it exceeds +// the maximum characters allowed for a description. For more information about +// limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateApprovalRuleTemplateDescription +func (c *CodeCommit) UpdateApprovalRuleTemplateDescription(input *UpdateApprovalRuleTemplateDescriptionInput) (*UpdateApprovalRuleTemplateDescriptionOutput, error) { + req, out := c.UpdateApprovalRuleTemplateDescriptionRequest(input) + return out, req.Send() +} + +// UpdateApprovalRuleTemplateDescriptionWithContext is the same as UpdateApprovalRuleTemplateDescription with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApprovalRuleTemplateDescription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) UpdateApprovalRuleTemplateDescriptionWithContext(ctx aws.Context, input *UpdateApprovalRuleTemplateDescriptionInput, opts ...request.Option) (*UpdateApprovalRuleTemplateDescriptionOutput, error) { + req, out := c.UpdateApprovalRuleTemplateDescriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateApprovalRuleTemplateName = "UpdateApprovalRuleTemplateName" + +// UpdateApprovalRuleTemplateNameRequest generates a "aws/request.Request" representing the +// client's request for the UpdateApprovalRuleTemplateName operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateApprovalRuleTemplateName for more information on using the UpdateApprovalRuleTemplateName +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateApprovalRuleTemplateNameRequest method. +// req, resp := client.UpdateApprovalRuleTemplateNameRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateApprovalRuleTemplateName +func (c *CodeCommit) UpdateApprovalRuleTemplateNameRequest(input *UpdateApprovalRuleTemplateNameInput) (req *request.Request, output *UpdateApprovalRuleTemplateNameOutput) { + op := &request.Operation{ + Name: opUpdateApprovalRuleTemplateName, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateApprovalRuleTemplateNameInput{} + } + + output = &UpdateApprovalRuleTemplateNameOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateApprovalRuleTemplateName API operation for AWS CodeCommit. +// +// Updates the name of a specified approval rule 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 CodeCommit's +// API operation UpdateApprovalRuleTemplateName for usage and error information. +// +// Returned Error Types: +// * InvalidApprovalRuleTemplateNameException +// The name of the approval rule template is not valid. Template names must +// be between 1 and 100 valid characters in length. For more information about +// limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). +// +// * ApprovalRuleTemplateNameRequiredException +// An approval rule template name is required, but was not specified. +// +// * ApprovalRuleTemplateDoesNotExistException +// The specified approval rule template does not exist. Verify that the name +// is correct and that you are signed in to the AWS Region where the template +// was created, and then try again. +// +// * ApprovalRuleTemplateNameAlreadyExistsException +// You cannot create an approval rule template with that name because a template +// with that name already exists in this AWS Region for your AWS account. Approval +// rule template names must be unique. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateApprovalRuleTemplateName +func (c *CodeCommit) UpdateApprovalRuleTemplateName(input *UpdateApprovalRuleTemplateNameInput) (*UpdateApprovalRuleTemplateNameOutput, error) { + req, out := c.UpdateApprovalRuleTemplateNameRequest(input) + return out, req.Send() +} + +// UpdateApprovalRuleTemplateNameWithContext is the same as UpdateApprovalRuleTemplateName with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApprovalRuleTemplateName for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) UpdateApprovalRuleTemplateNameWithContext(ctx aws.Context, input *UpdateApprovalRuleTemplateNameInput, opts ...request.Option) (*UpdateApprovalRuleTemplateNameOutput, error) { + req, out := c.UpdateApprovalRuleTemplateNameRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateComment = "UpdateComment" + +// UpdateCommentRequest generates a "aws/request.Request" representing the +// client's request for the UpdateComment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateComment for more information on using the UpdateComment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateCommentRequest method. +// req, resp := client.UpdateCommentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateComment +func (c *CodeCommit) UpdateCommentRequest(input *UpdateCommentInput) (req *request.Request, output *UpdateCommentOutput) { + op := &request.Operation{ + Name: opUpdateComment, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateCommentInput{} + } + + output = &UpdateCommentOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateComment API operation for AWS CodeCommit. +// +// Replaces the contents of a comment. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 UpdateComment for usage and error information. +// +// Returned Error Types: +// * CommentContentRequiredException +// The comment is empty. You must provide some content for a comment. The content +// cannot be null. +// +// * CommentContentSizeLimitExceededException +// The comment is too large. Comments are limited to 1,000 characters. +// +// * CommentDoesNotExistException +// No comment exists with the provided ID. Verify that you have used the correct +// ID, and then try again. +// +// * CommentIdRequiredException +// The comment ID is missing or null. A comment ID is required. +// +// * InvalidCommentIdException +// The comment ID is not in a valid format. Make sure that you have provided +// the full comment ID. +// +// * CommentNotCreatedByCallerException +// You cannot modify or delete this comment. Only comment authors can modify +// or delete their comments. +// +// * CommentDeletedException +// This comment has already been deleted. You cannot edit or delete a deleted +// comment. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateComment +func (c *CodeCommit) UpdateComment(input *UpdateCommentInput) (*UpdateCommentOutput, error) { + req, out := c.UpdateCommentRequest(input) + return out, req.Send() +} + +// UpdateCommentWithContext is the same as UpdateComment with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateComment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) UpdateCommentWithContext(ctx aws.Context, input *UpdateCommentInput, opts ...request.Option) (*UpdateCommentOutput, error) { + req, out := c.UpdateCommentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateDefaultBranch = "UpdateDefaultBranch" + +// UpdateDefaultBranchRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDefaultBranch operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateDefaultBranch for more information on using the UpdateDefaultBranch +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateDefaultBranchRequest method. +// req, resp := client.UpdateDefaultBranchRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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.Swap(jsonrpc.UnmarshalHandler.Name, 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 Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. +// +// * RepositoryDoesNotExistException +// The specified repository does not exist. +// +// * InvalidRepositoryNameException +// A specified repository name is not valid. +// +// This exception occurs only 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. +// +// * BranchNameRequiredException +// A branch name is required, but was not specified. +// +// * InvalidBranchNameException +// The specified reference name is not valid. +// +// * BranchDoesNotExistException +// The specified branch does not exist. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, 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) + return out, req.Send() +} + +// UpdateDefaultBranchWithContext is the same as UpdateDefaultBranch with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDefaultBranch for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) UpdateDefaultBranchWithContext(ctx aws.Context, input *UpdateDefaultBranchInput, opts ...request.Option) (*UpdateDefaultBranchOutput, error) { + req, out := c.UpdateDefaultBranchRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdatePullRequestApprovalRuleContent = "UpdatePullRequestApprovalRuleContent" + +// UpdatePullRequestApprovalRuleContentRequest generates a "aws/request.Request" representing the +// client's request for the UpdatePullRequestApprovalRuleContent operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdatePullRequestApprovalRuleContent for more information on using the UpdatePullRequestApprovalRuleContent +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdatePullRequestApprovalRuleContentRequest method. +// req, resp := client.UpdatePullRequestApprovalRuleContentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestApprovalRuleContent +func (c *CodeCommit) UpdatePullRequestApprovalRuleContentRequest(input *UpdatePullRequestApprovalRuleContentInput) (req *request.Request, output *UpdatePullRequestApprovalRuleContentOutput) { + op := &request.Operation{ + Name: opUpdatePullRequestApprovalRuleContent, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdatePullRequestApprovalRuleContentInput{} + } + + output = &UpdatePullRequestApprovalRuleContentOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdatePullRequestApprovalRuleContent API operation for AWS CodeCommit. +// +// Updates the structure of an approval rule created specifically for a pull +// request. For example, you can change the number of required approvers and +// the approval pool for approvers. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 UpdatePullRequestApprovalRuleContent for usage and error information. +// +// Returned Error Types: +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. +// +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. +// +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. +// +// * PullRequestAlreadyClosedException +// The pull request status cannot be updated because it is already closed. +// +// * ApprovalRuleNameRequiredException +// An approval rule name is required, but was not specified. +// +// * InvalidApprovalRuleNameException +// The name for the approval rule is not valid. +// +// * ApprovalRuleDoesNotExistException +// The specified approval rule does not exist. +// +// * InvalidRuleContentSha256Exception +// The SHA-256 hash signature for the rule content is not valid. +// +// * ApprovalRuleContentRequiredException +// The content for the approval rule is empty. You must provide some content +// for an approval rule. The content cannot be null. +// +// * InvalidApprovalRuleContentException +// The content for the approval rule is not valid. +// +// * CannotModifyApprovalRuleFromTemplateException +// The approval rule cannot be modified for the pull request because it was +// created by an approval rule template and applied to the pull request automatically. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestApprovalRuleContent +func (c *CodeCommit) UpdatePullRequestApprovalRuleContent(input *UpdatePullRequestApprovalRuleContentInput) (*UpdatePullRequestApprovalRuleContentOutput, error) { + req, out := c.UpdatePullRequestApprovalRuleContentRequest(input) + return out, req.Send() +} + +// UpdatePullRequestApprovalRuleContentWithContext is the same as UpdatePullRequestApprovalRuleContent with the addition of +// the ability to pass a context and additional request options. +// +// See UpdatePullRequestApprovalRuleContent for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) UpdatePullRequestApprovalRuleContentWithContext(ctx aws.Context, input *UpdatePullRequestApprovalRuleContentInput, opts ...request.Option) (*UpdatePullRequestApprovalRuleContentOutput, error) { + req, out := c.UpdatePullRequestApprovalRuleContentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdatePullRequestApprovalState = "UpdatePullRequestApprovalState" + +// UpdatePullRequestApprovalStateRequest generates a "aws/request.Request" representing the +// client's request for the UpdatePullRequestApprovalState operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdatePullRequestApprovalState for more information on using the UpdatePullRequestApprovalState +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdatePullRequestApprovalStateRequest method. +// req, resp := client.UpdatePullRequestApprovalStateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestApprovalState +func (c *CodeCommit) UpdatePullRequestApprovalStateRequest(input *UpdatePullRequestApprovalStateInput) (req *request.Request, output *UpdatePullRequestApprovalStateOutput) { + op := &request.Operation{ + Name: opUpdatePullRequestApprovalState, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdatePullRequestApprovalStateInput{} + } + + output = &UpdatePullRequestApprovalStateOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdatePullRequestApprovalState API operation for AWS CodeCommit. +// +// Updates the state of a user's approval on a pull request. The user is derived +// from the signed-in account when the request is made. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 UpdatePullRequestApprovalState for usage and error information. +// +// Returned Error Types: +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. +// +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. +// +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. +// +// * InvalidRevisionIdException +// The revision ID is not valid. Use GetPullRequest to determine the value. +// +// * RevisionIdRequiredException +// A revision ID is required, but was not provided. +// +// * InvalidApprovalStateException +// The state for the approval is not valid. Valid values include APPROVE and +// REVOKE. +// +// * ApprovalStateRequiredException +// An approval state is required, but was not specified. +// +// * PullRequestCannotBeApprovedByAuthorException +// The approval cannot be applied because the user approving the pull request +// matches the user who created the pull request. You cannot approve a pull +// request that you created. +// +// * RevisionNotCurrentException +// The revision ID provided in the request does not match the current revision +// ID. Use GetPullRequest to retrieve the current revision ID. +// +// * PullRequestAlreadyClosedException +// The pull request status cannot be updated because it is already closed. +// +// * MaximumNumberOfApprovalsExceededException +// The number of approvals required for the approval rule exceeds the maximum +// number allowed. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestApprovalState +func (c *CodeCommit) UpdatePullRequestApprovalState(input *UpdatePullRequestApprovalStateInput) (*UpdatePullRequestApprovalStateOutput, error) { + req, out := c.UpdatePullRequestApprovalStateRequest(input) + return out, req.Send() +} + +// UpdatePullRequestApprovalStateWithContext is the same as UpdatePullRequestApprovalState with the addition of +// the ability to pass a context and additional request options. +// +// See UpdatePullRequestApprovalState for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) UpdatePullRequestApprovalStateWithContext(ctx aws.Context, input *UpdatePullRequestApprovalStateInput, opts ...request.Option) (*UpdatePullRequestApprovalStateOutput, error) { + req, out := c.UpdatePullRequestApprovalStateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdatePullRequestDescription = "UpdatePullRequestDescription" + +// UpdatePullRequestDescriptionRequest generates a "aws/request.Request" representing the +// client's request for the UpdatePullRequestDescription operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdatePullRequestDescription for more information on using the UpdatePullRequestDescription +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdatePullRequestDescriptionRequest method. +// req, resp := client.UpdatePullRequestDescriptionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestDescription +func (c *CodeCommit) UpdatePullRequestDescriptionRequest(input *UpdatePullRequestDescriptionInput) (req *request.Request, output *UpdatePullRequestDescriptionOutput) { + op := &request.Operation{ + Name: opUpdatePullRequestDescription, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdatePullRequestDescriptionInput{} + } + + output = &UpdatePullRequestDescriptionOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdatePullRequestDescription API operation for AWS CodeCommit. +// +// Replaces the contents of the description of a pull 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 CodeCommit's +// API operation UpdatePullRequestDescription for usage and error information. +// +// Returned Error Types: +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. +// +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. +// +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. +// +// * InvalidDescriptionException +// The pull request description is not valid. Descriptions cannot be more than +// 1,000 characters. +// +// * PullRequestAlreadyClosedException +// The pull request status cannot be updated because it is already closed. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestDescription +func (c *CodeCommit) UpdatePullRequestDescription(input *UpdatePullRequestDescriptionInput) (*UpdatePullRequestDescriptionOutput, error) { + req, out := c.UpdatePullRequestDescriptionRequest(input) + return out, req.Send() +} + +// UpdatePullRequestDescriptionWithContext is the same as UpdatePullRequestDescription with the addition of +// the ability to pass a context and additional request options. +// +// See UpdatePullRequestDescription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) UpdatePullRequestDescriptionWithContext(ctx aws.Context, input *UpdatePullRequestDescriptionInput, opts ...request.Option) (*UpdatePullRequestDescriptionOutput, error) { + req, out := c.UpdatePullRequestDescriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdatePullRequestStatus = "UpdatePullRequestStatus" + +// UpdatePullRequestStatusRequest generates a "aws/request.Request" representing the +// client's request for the UpdatePullRequestStatus operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdatePullRequestStatus for more information on using the UpdatePullRequestStatus +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdatePullRequestStatusRequest method. +// req, resp := client.UpdatePullRequestStatusRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestStatus +func (c *CodeCommit) UpdatePullRequestStatusRequest(input *UpdatePullRequestStatusInput) (req *request.Request, output *UpdatePullRequestStatusOutput) { + op := &request.Operation{ + Name: opUpdatePullRequestStatus, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdatePullRequestStatusInput{} + } + + output = &UpdatePullRequestStatusOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdatePullRequestStatus API operation for AWS CodeCommit. +// +// Updates the status of a pull 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 CodeCommit's +// API operation UpdatePullRequestStatus for usage and error information. +// +// Returned Error Types: +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. +// +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. +// +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. +// +// * InvalidPullRequestStatusUpdateException +// The pull request status update is not valid. The only valid update is from +// OPEN to CLOSED. +// +// * InvalidPullRequestStatusException +// The pull request status is not valid. The only valid values are OPEN and +// CLOSED. +// +// * PullRequestStatusRequiredException +// A pull request status is required, but none was provided. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestStatus +func (c *CodeCommit) UpdatePullRequestStatus(input *UpdatePullRequestStatusInput) (*UpdatePullRequestStatusOutput, error) { + req, out := c.UpdatePullRequestStatusRequest(input) + return out, req.Send() +} + +// UpdatePullRequestStatusWithContext is the same as UpdatePullRequestStatus with the addition of +// the ability to pass a context and additional request options. +// +// See UpdatePullRequestStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) UpdatePullRequestStatusWithContext(ctx aws.Context, input *UpdatePullRequestStatusInput, opts ...request.Option) (*UpdatePullRequestStatusOutput, error) { + req, out := c.UpdatePullRequestStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdatePullRequestTitle = "UpdatePullRequestTitle" + +// UpdatePullRequestTitleRequest generates a "aws/request.Request" representing the +// client's request for the UpdatePullRequestTitle operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdatePullRequestTitle for more information on using the UpdatePullRequestTitle +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdatePullRequestTitleRequest method. +// req, resp := client.UpdatePullRequestTitleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestTitle +func (c *CodeCommit) UpdatePullRequestTitleRequest(input *UpdatePullRequestTitleInput) (req *request.Request, output *UpdatePullRequestTitleOutput) { + op := &request.Operation{ + Name: opUpdatePullRequestTitle, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdatePullRequestTitleInput{} + } + + output = &UpdatePullRequestTitleOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdatePullRequestTitle API operation for AWS CodeCommit. +// +// Replaces the title of a pull 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 CodeCommit's +// API operation UpdatePullRequestTitle for usage and error information. +// +// Returned Error Types: +// * PullRequestDoesNotExistException +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. +// +// * InvalidPullRequestIdException +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. +// +// * PullRequestIdRequiredException +// A pull request ID is required, but none was provided. +// +// * TitleRequiredException +// A pull request title is required. It cannot be empty or null. +// +// * InvalidTitleException +// The title of the pull request is not valid. Pull request titles cannot exceed +// 100 characters in length. +// +// * PullRequestAlreadyClosedException +// The pull request status cannot be updated because it is already closed. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdatePullRequestTitle +func (c *CodeCommit) UpdatePullRequestTitle(input *UpdatePullRequestTitleInput) (*UpdatePullRequestTitleOutput, error) { + req, out := c.UpdatePullRequestTitleRequest(input) + return out, req.Send() +} + +// UpdatePullRequestTitleWithContext is the same as UpdatePullRequestTitle with the addition of +// the ability to pass a context and additional request options. +// +// See UpdatePullRequestTitle for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) UpdatePullRequestTitleWithContext(ctx aws.Context, input *UpdatePullRequestTitleInput, opts ...request.Option) (*UpdatePullRequestTitleOutput, error) { + req, out := c.UpdatePullRequestTitleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateRepositoryDescription = "UpdateRepositoryDescription" + +// UpdateRepositoryDescriptionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateRepositoryDescription operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateRepositoryDescription for more information on using the UpdateRepositoryDescription +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateRepositoryDescriptionRequest method. +// req, resp := client.UpdateRepositoryDescriptionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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.Swap(jsonrpc.UnmarshalHandler.Name, 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 webpage can 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 webpage. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Types: +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. +// +// * RepositoryDoesNotExistException +// The specified repository does not exist. +// +// * InvalidRepositoryNameException +// A specified repository name is not valid. +// +// This exception occurs only 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. +// +// * InvalidRepositoryDescriptionException +// The specified repository description is not valid. +// +// * EncryptionIntegrityChecksFailedException +// An encryption integrity check failed. +// +// * EncryptionKeyAccessDeniedException +// An encryption key could not be accessed. +// +// * EncryptionKeyDisabledException +// The encryption key is disabled. +// +// * EncryptionKeyNotFoundException +// No encryption key was found. +// +// * EncryptionKeyUnavailableException +// The encryption key is not available. +// +// See also, 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) + return out, req.Send() +} + +// UpdateRepositoryDescriptionWithContext is the same as UpdateRepositoryDescription with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateRepositoryDescription for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) UpdateRepositoryDescriptionWithContext(ctx aws.Context, input *UpdateRepositoryDescriptionInput, opts ...request.Option) (*UpdateRepositoryDescriptionOutput, error) { + req, out := c.UpdateRepositoryDescriptionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateRepositoryName = "UpdateRepositoryName" + +// UpdateRepositoryNameRequest generates a "aws/request.Request" representing the +// client's request for the UpdateRepositoryName operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateRepositoryName for more information on using the UpdateRepositoryName +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateRepositoryNameRequest method. +// req, resp := client.UpdateRepositoryNameRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateRepositoryName API operation for AWS CodeCommit. +// +// Renames a repository. The repository name must be unique across the calling +// AWS account. Repository names are limited to 100 alphanumeric, dash, and +// underscore characters, and cannot include certain characters. The suffix +// .git is prohibited. For more information about the limits on repository names, +// see Limits (https://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 Types: +// * RepositoryDoesNotExistException +// The specified repository does not exist. +// +// * RepositoryNameExistsException +// The specified repository name already exists. +// +// * RepositoryNameRequiredException +// A repository name is required, but was not specified. +// +// * InvalidRepositoryNameException +// A specified repository name is not valid. +// +// This exception occurs only 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. +// +// See also, 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) + return out, req.Send() +} + +// UpdateRepositoryNameWithContext is the same as UpdateRepositoryName with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateRepositoryName for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeCommit) UpdateRepositoryNameWithContext(ctx aws.Context, input *UpdateRepositoryNameInput, opts ...request.Option) (*UpdateRepositoryNameOutput, error) { + req, out := c.UpdateRepositoryNameRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// The specified Amazon Resource Name (ARN) does not exist in the AWS account. +type ActorDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ActorDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ActorDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorActorDoesNotExistException(v protocol.ResponseMetadata) error { + return &ActorDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ActorDoesNotExistException) Code() string { + return "ActorDoesNotExistException" +} + +// Message returns the exception's message. +func (s ActorDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ActorDoesNotExistException) OrigErr() error { + return nil +} + +func (s ActorDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ActorDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ActorDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returns information about a specific approval on a pull request. +type Approval struct { + _ struct{} `type:"structure"` + + // The state of the approval, APPROVE or REVOKE. REVOKE states are not stored. + ApprovalState *string `locationName:"approvalState" type:"string" enum:"ApprovalState"` + + // The Amazon Resource Name (ARN) of the user. + UserArn *string `locationName:"userArn" type:"string"` +} + +// String returns the string representation +func (s Approval) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Approval) GoString() string { + return s.String() +} + +// SetApprovalState sets the ApprovalState field's value. +func (s *Approval) SetApprovalState(v string) *Approval { + s.ApprovalState = &v + return s +} + +// SetUserArn sets the UserArn field's value. +func (s *Approval) SetUserArn(v string) *Approval { + s.UserArn = &v + return s +} + +// Returns information about an approval rule. +type ApprovalRule struct { + _ struct{} `type:"structure"` + + // The content of the approval rule. + ApprovalRuleContent *string `locationName:"approvalRuleContent" min:"1" type:"string"` + + // The system-generated ID of the approval rule. + ApprovalRuleId *string `locationName:"approvalRuleId" type:"string"` + + // The name of the approval rule. + ApprovalRuleName *string `locationName:"approvalRuleName" min:"1" type:"string"` + + // The date the approval rule was created, in timestamp format. + CreationDate *time.Time `locationName:"creationDate" type:"timestamp"` + + // The date the approval rule was most recently changed, in timestamp format. + LastModifiedDate *time.Time `locationName:"lastModifiedDate" type:"timestamp"` + + // The Amazon Resource Name (ARN) of the user who made the most recent changes + // to the approval rule. + LastModifiedUser *string `locationName:"lastModifiedUser" type:"string"` + + // The approval rule template used to create the rule. + OriginApprovalRuleTemplate *OriginApprovalRuleTemplate `locationName:"originApprovalRuleTemplate" type:"structure"` + + // The SHA-256 hash signature for the content of the approval rule. + RuleContentSha256 *string `locationName:"ruleContentSha256" type:"string"` +} + +// String returns the string representation +func (s ApprovalRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalRule) GoString() string { + return s.String() +} + +// SetApprovalRuleContent sets the ApprovalRuleContent field's value. +func (s *ApprovalRule) SetApprovalRuleContent(v string) *ApprovalRule { + s.ApprovalRuleContent = &v + return s +} + +// SetApprovalRuleId sets the ApprovalRuleId field's value. +func (s *ApprovalRule) SetApprovalRuleId(v string) *ApprovalRule { + s.ApprovalRuleId = &v + return s +} + +// SetApprovalRuleName sets the ApprovalRuleName field's value. +func (s *ApprovalRule) SetApprovalRuleName(v string) *ApprovalRule { + s.ApprovalRuleName = &v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *ApprovalRule) SetCreationDate(v time.Time) *ApprovalRule { + s.CreationDate = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *ApprovalRule) SetLastModifiedDate(v time.Time) *ApprovalRule { + s.LastModifiedDate = &v + return s +} + +// SetLastModifiedUser sets the LastModifiedUser field's value. +func (s *ApprovalRule) SetLastModifiedUser(v string) *ApprovalRule { + s.LastModifiedUser = &v + return s +} + +// SetOriginApprovalRuleTemplate sets the OriginApprovalRuleTemplate field's value. +func (s *ApprovalRule) SetOriginApprovalRuleTemplate(v *OriginApprovalRuleTemplate) *ApprovalRule { + s.OriginApprovalRuleTemplate = v + return s +} + +// SetRuleContentSha256 sets the RuleContentSha256 field's value. +func (s *ApprovalRule) SetRuleContentSha256(v string) *ApprovalRule { + s.RuleContentSha256 = &v + return s +} + +// The content for the approval rule is empty. You must provide some content +// for an approval rule. The content cannot be null. +type ApprovalRuleContentRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApprovalRuleContentRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalRuleContentRequiredException) GoString() string { + return s.String() +} + +func newErrorApprovalRuleContentRequiredException(v protocol.ResponseMetadata) error { + return &ApprovalRuleContentRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApprovalRuleContentRequiredException) Code() string { + return "ApprovalRuleContentRequiredException" +} + +// Message returns the exception's message. +func (s ApprovalRuleContentRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApprovalRuleContentRequiredException) OrigErr() error { + return nil +} + +func (s ApprovalRuleContentRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApprovalRuleContentRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApprovalRuleContentRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified approval rule does not exist. +type ApprovalRuleDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApprovalRuleDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalRuleDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorApprovalRuleDoesNotExistException(v protocol.ResponseMetadata) error { + return &ApprovalRuleDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApprovalRuleDoesNotExistException) Code() string { + return "ApprovalRuleDoesNotExistException" +} + +// Message returns the exception's message. +func (s ApprovalRuleDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApprovalRuleDoesNotExistException) OrigErr() error { + return nil +} + +func (s ApprovalRuleDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApprovalRuleDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApprovalRuleDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returns information about an event for an approval rule. +type ApprovalRuleEventMetadata struct { + _ struct{} `type:"structure"` + + // The content of the approval rule. + ApprovalRuleContent *string `locationName:"approvalRuleContent" min:"1" type:"string"` + + // The system-generated ID of the approval rule. + ApprovalRuleId *string `locationName:"approvalRuleId" type:"string"` + + // The name of the approval rule. + ApprovalRuleName *string `locationName:"approvalRuleName" min:"1" type:"string"` +} + +// String returns the string representation +func (s ApprovalRuleEventMetadata) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalRuleEventMetadata) GoString() string { + return s.String() +} + +// SetApprovalRuleContent sets the ApprovalRuleContent field's value. +func (s *ApprovalRuleEventMetadata) SetApprovalRuleContent(v string) *ApprovalRuleEventMetadata { + s.ApprovalRuleContent = &v + return s +} + +// SetApprovalRuleId sets the ApprovalRuleId field's value. +func (s *ApprovalRuleEventMetadata) SetApprovalRuleId(v string) *ApprovalRuleEventMetadata { + s.ApprovalRuleId = &v + return s +} + +// SetApprovalRuleName sets the ApprovalRuleName field's value. +func (s *ApprovalRuleEventMetadata) SetApprovalRuleName(v string) *ApprovalRuleEventMetadata { + s.ApprovalRuleName = &v + return s +} + +// An approval rule with that name already exists. Approval rule names must +// be unique within the scope of a pull request. +type ApprovalRuleNameAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApprovalRuleNameAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalRuleNameAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorApprovalRuleNameAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ApprovalRuleNameAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApprovalRuleNameAlreadyExistsException) Code() string { + return "ApprovalRuleNameAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ApprovalRuleNameAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApprovalRuleNameAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ApprovalRuleNameAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApprovalRuleNameAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApprovalRuleNameAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// An approval rule name is required, but was not specified. +type ApprovalRuleNameRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApprovalRuleNameRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalRuleNameRequiredException) GoString() string { + return s.String() +} + +func newErrorApprovalRuleNameRequiredException(v protocol.ResponseMetadata) error { + return &ApprovalRuleNameRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApprovalRuleNameRequiredException) Code() string { + return "ApprovalRuleNameRequiredException" +} + +// Message returns the exception's message. +func (s ApprovalRuleNameRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApprovalRuleNameRequiredException) OrigErr() error { + return nil +} + +func (s ApprovalRuleNameRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApprovalRuleNameRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApprovalRuleNameRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returns information about an override event for approval rules for a pull +// request. +type ApprovalRuleOverriddenEventMetadata struct { + _ struct{} `type:"structure"` + + // The status of the override event. + OverrideStatus *string `locationName:"overrideStatus" type:"string" enum:"OverrideStatus"` + + // The revision ID of the pull request when the override event occurred. + RevisionId *string `locationName:"revisionId" type:"string"` +} + +// String returns the string representation +func (s ApprovalRuleOverriddenEventMetadata) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalRuleOverriddenEventMetadata) GoString() string { + return s.String() +} + +// SetOverrideStatus sets the OverrideStatus field's value. +func (s *ApprovalRuleOverriddenEventMetadata) SetOverrideStatus(v string) *ApprovalRuleOverriddenEventMetadata { + s.OverrideStatus = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *ApprovalRuleOverriddenEventMetadata) SetRevisionId(v string) *ApprovalRuleOverriddenEventMetadata { + s.RevisionId = &v + return s +} + +// Returns information about an approval rule template. +type ApprovalRuleTemplate struct { + _ struct{} `type:"structure"` + + // The content of the approval rule template. + ApprovalRuleTemplateContent *string `locationName:"approvalRuleTemplateContent" min:"1" type:"string"` + + // The description of the approval rule template. + ApprovalRuleTemplateDescription *string `locationName:"approvalRuleTemplateDescription" type:"string"` + + // The system-generated ID of the approval rule template. + ApprovalRuleTemplateId *string `locationName:"approvalRuleTemplateId" type:"string"` + + // The name of the approval rule template. + ApprovalRuleTemplateName *string `locationName:"approvalRuleTemplateName" min:"1" type:"string"` + + // The date the approval rule template was created, in timestamp format. + CreationDate *time.Time `locationName:"creationDate" type:"timestamp"` + + // The date the approval rule template was most recently changed, in timestamp + // format. + LastModifiedDate *time.Time `locationName:"lastModifiedDate" type:"timestamp"` + + // The Amazon Resource Name (ARN) of the user who made the most recent changes + // to the approval rule template. + LastModifiedUser *string `locationName:"lastModifiedUser" type:"string"` + + // The SHA-256 hash signature for the content of the approval rule template. + RuleContentSha256 *string `locationName:"ruleContentSha256" type:"string"` +} + +// String returns the string representation +func (s ApprovalRuleTemplate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalRuleTemplate) GoString() string { + return s.String() +} + +// SetApprovalRuleTemplateContent sets the ApprovalRuleTemplateContent field's value. +func (s *ApprovalRuleTemplate) SetApprovalRuleTemplateContent(v string) *ApprovalRuleTemplate { + s.ApprovalRuleTemplateContent = &v + return s +} + +// SetApprovalRuleTemplateDescription sets the ApprovalRuleTemplateDescription field's value. +func (s *ApprovalRuleTemplate) SetApprovalRuleTemplateDescription(v string) *ApprovalRuleTemplate { + s.ApprovalRuleTemplateDescription = &v + return s +} + +// SetApprovalRuleTemplateId sets the ApprovalRuleTemplateId field's value. +func (s *ApprovalRuleTemplate) SetApprovalRuleTemplateId(v string) *ApprovalRuleTemplate { + s.ApprovalRuleTemplateId = &v + return s +} + +// SetApprovalRuleTemplateName sets the ApprovalRuleTemplateName field's value. +func (s *ApprovalRuleTemplate) SetApprovalRuleTemplateName(v string) *ApprovalRuleTemplate { + s.ApprovalRuleTemplateName = &v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *ApprovalRuleTemplate) SetCreationDate(v time.Time) *ApprovalRuleTemplate { + s.CreationDate = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *ApprovalRuleTemplate) SetLastModifiedDate(v time.Time) *ApprovalRuleTemplate { + s.LastModifiedDate = &v + return s +} + +// SetLastModifiedUser sets the LastModifiedUser field's value. +func (s *ApprovalRuleTemplate) SetLastModifiedUser(v string) *ApprovalRuleTemplate { + s.LastModifiedUser = &v + return s +} + +// SetRuleContentSha256 sets the RuleContentSha256 field's value. +func (s *ApprovalRuleTemplate) SetRuleContentSha256(v string) *ApprovalRuleTemplate { + s.RuleContentSha256 = &v + return s +} + +// The content for the approval rule template is empty. You must provide some +// content for an approval rule template. The content cannot be null. +type ApprovalRuleTemplateContentRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApprovalRuleTemplateContentRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalRuleTemplateContentRequiredException) GoString() string { + return s.String() +} + +func newErrorApprovalRuleTemplateContentRequiredException(v protocol.ResponseMetadata) error { + return &ApprovalRuleTemplateContentRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApprovalRuleTemplateContentRequiredException) Code() string { + return "ApprovalRuleTemplateContentRequiredException" +} + +// Message returns the exception's message. +func (s ApprovalRuleTemplateContentRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApprovalRuleTemplateContentRequiredException) OrigErr() error { + return nil +} + +func (s ApprovalRuleTemplateContentRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApprovalRuleTemplateContentRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApprovalRuleTemplateContentRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified approval rule template does not exist. Verify that the name +// is correct and that you are signed in to the AWS Region where the template +// was created, and then try again. +type ApprovalRuleTemplateDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApprovalRuleTemplateDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalRuleTemplateDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorApprovalRuleTemplateDoesNotExistException(v protocol.ResponseMetadata) error { + return &ApprovalRuleTemplateDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApprovalRuleTemplateDoesNotExistException) Code() string { + return "ApprovalRuleTemplateDoesNotExistException" +} + +// Message returns the exception's message. +func (s ApprovalRuleTemplateDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApprovalRuleTemplateDoesNotExistException) OrigErr() error { + return nil +} + +func (s ApprovalRuleTemplateDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApprovalRuleTemplateDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApprovalRuleTemplateDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// The approval rule template is associated with one or more repositories. You +// cannot delete a template that is associated with a repository. Remove all +// associations, and then try again. +type ApprovalRuleTemplateInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApprovalRuleTemplateInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalRuleTemplateInUseException) GoString() string { + return s.String() +} + +func newErrorApprovalRuleTemplateInUseException(v protocol.ResponseMetadata) error { + return &ApprovalRuleTemplateInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApprovalRuleTemplateInUseException) Code() string { + return "ApprovalRuleTemplateInUseException" +} + +// Message returns the exception's message. +func (s ApprovalRuleTemplateInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApprovalRuleTemplateInUseException) OrigErr() error { + return nil +} + +func (s ApprovalRuleTemplateInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApprovalRuleTemplateInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApprovalRuleTemplateInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// You cannot create an approval rule template with that name because a template +// with that name already exists in this AWS Region for your AWS account. Approval +// rule template names must be unique. +type ApprovalRuleTemplateNameAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApprovalRuleTemplateNameAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalRuleTemplateNameAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorApprovalRuleTemplateNameAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ApprovalRuleTemplateNameAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApprovalRuleTemplateNameAlreadyExistsException) Code() string { + return "ApprovalRuleTemplateNameAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ApprovalRuleTemplateNameAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApprovalRuleTemplateNameAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ApprovalRuleTemplateNameAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApprovalRuleTemplateNameAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApprovalRuleTemplateNameAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// An approval rule template name is required, but was not specified. +type ApprovalRuleTemplateNameRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApprovalRuleTemplateNameRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalRuleTemplateNameRequiredException) GoString() string { + return s.String() +} + +func newErrorApprovalRuleTemplateNameRequiredException(v protocol.ResponseMetadata) error { + return &ApprovalRuleTemplateNameRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApprovalRuleTemplateNameRequiredException) Code() string { + return "ApprovalRuleTemplateNameRequiredException" +} + +// Message returns the exception's message. +func (s ApprovalRuleTemplateNameRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApprovalRuleTemplateNameRequiredException) OrigErr() error { + return nil +} + +func (s ApprovalRuleTemplateNameRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApprovalRuleTemplateNameRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApprovalRuleTemplateNameRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returns information about a change in the approval state for a pull request. +type ApprovalStateChangedEventMetadata struct { + _ struct{} `type:"structure"` + + // The approval status for the pull request. + ApprovalStatus *string `locationName:"approvalStatus" type:"string" enum:"ApprovalState"` + + // The revision ID of the pull request when the approval state changed. + RevisionId *string `locationName:"revisionId" type:"string"` +} + +// String returns the string representation +func (s ApprovalStateChangedEventMetadata) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalStateChangedEventMetadata) GoString() string { + return s.String() +} + +// SetApprovalStatus sets the ApprovalStatus field's value. +func (s *ApprovalStateChangedEventMetadata) SetApprovalStatus(v string) *ApprovalStateChangedEventMetadata { + s.ApprovalStatus = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *ApprovalStateChangedEventMetadata) SetRevisionId(v string) *ApprovalStateChangedEventMetadata { + s.RevisionId = &v + return s +} + +// An approval state is required, but was not specified. +type ApprovalStateRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApprovalStateRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalStateRequiredException) GoString() string { + return s.String() +} + +func newErrorApprovalStateRequiredException(v protocol.ResponseMetadata) error { + return &ApprovalStateRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApprovalStateRequiredException) Code() string { + return "ApprovalStateRequiredException" +} + +// Message returns the exception's message. +func (s ApprovalStateRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApprovalStateRequiredException) OrigErr() error { + return nil +} + +func (s ApprovalStateRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApprovalStateRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApprovalStateRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +type AssociateApprovalRuleTemplateWithRepositoryInput struct { + _ struct{} `type:"structure"` + + // The name for the approval rule template. + // + // ApprovalRuleTemplateName is a required field + ApprovalRuleTemplateName *string `locationName:"approvalRuleTemplateName" min:"1" type:"string" required:"true"` + + // The name of the repository that you want to associate with the template. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s AssociateApprovalRuleTemplateWithRepositoryInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateApprovalRuleTemplateWithRepositoryInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssociateApprovalRuleTemplateWithRepositoryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssociateApprovalRuleTemplateWithRepositoryInput"} + if s.ApprovalRuleTemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleTemplateName")) + } + if s.ApprovalRuleTemplateName != nil && len(*s.ApprovalRuleTemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApprovalRuleTemplateName", 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 +} + +// SetApprovalRuleTemplateName sets the ApprovalRuleTemplateName field's value. +func (s *AssociateApprovalRuleTemplateWithRepositoryInput) SetApprovalRuleTemplateName(v string) *AssociateApprovalRuleTemplateWithRepositoryInput { + s.ApprovalRuleTemplateName = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *AssociateApprovalRuleTemplateWithRepositoryInput) SetRepositoryName(v string) *AssociateApprovalRuleTemplateWithRepositoryInput { + s.RepositoryName = &v + return s +} + +type AssociateApprovalRuleTemplateWithRepositoryOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AssociateApprovalRuleTemplateWithRepositoryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateApprovalRuleTemplateWithRepositoryOutput) GoString() string { + return s.String() +} + +// The specified Amazon Resource Name (ARN) does not exist in the AWS account. +type AuthorDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AuthorDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AuthorDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorAuthorDoesNotExistException(v protocol.ResponseMetadata) error { + return &AuthorDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AuthorDoesNotExistException) Code() string { + return "AuthorDoesNotExistException" +} + +// Message returns the exception's message. +func (s AuthorDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AuthorDoesNotExistException) OrigErr() error { + return nil +} + +func (s AuthorDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AuthorDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AuthorDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returns information about errors in a BatchAssociateApprovalRuleTemplateWithRepositories +// operation. +type BatchAssociateApprovalRuleTemplateWithRepositoriesError struct { + _ struct{} `type:"structure"` + + // An error code that specifies whether the repository name was not valid or + // not found. + ErrorCode *string `locationName:"errorCode" type:"string"` + + // An error message that provides details about why the repository name was + // not found or not valid. + ErrorMessage *string `locationName:"errorMessage" type:"string"` + + // The name of the repository where the association was not made. + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` +} + +// String returns the string representation +func (s BatchAssociateApprovalRuleTemplateWithRepositoriesError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchAssociateApprovalRuleTemplateWithRepositoriesError) GoString() string { + return s.String() +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *BatchAssociateApprovalRuleTemplateWithRepositoriesError) SetErrorCode(v string) *BatchAssociateApprovalRuleTemplateWithRepositoriesError { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *BatchAssociateApprovalRuleTemplateWithRepositoriesError) SetErrorMessage(v string) *BatchAssociateApprovalRuleTemplateWithRepositoriesError { + s.ErrorMessage = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *BatchAssociateApprovalRuleTemplateWithRepositoriesError) SetRepositoryName(v string) *BatchAssociateApprovalRuleTemplateWithRepositoriesError { + s.RepositoryName = &v + return s +} + +type BatchAssociateApprovalRuleTemplateWithRepositoriesInput struct { + _ struct{} `type:"structure"` + + // The name of the template you want to associate with one or more repositories. + // + // ApprovalRuleTemplateName is a required field + ApprovalRuleTemplateName *string `locationName:"approvalRuleTemplateName" min:"1" type:"string" required:"true"` + + // The names of the repositories you want to associate with the template. + // + // The length constraint limit is for each string in the array. The array itself + // can be empty. + // + // RepositoryNames is a required field + RepositoryNames []*string `locationName:"repositoryNames" type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchAssociateApprovalRuleTemplateWithRepositoriesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchAssociateApprovalRuleTemplateWithRepositoriesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchAssociateApprovalRuleTemplateWithRepositoriesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchAssociateApprovalRuleTemplateWithRepositoriesInput"} + if s.ApprovalRuleTemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleTemplateName")) + } + if s.ApprovalRuleTemplateName != nil && len(*s.ApprovalRuleTemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApprovalRuleTemplateName", 1)) + } + if s.RepositoryNames == nil { + invalidParams.Add(request.NewErrParamRequired("RepositoryNames")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApprovalRuleTemplateName sets the ApprovalRuleTemplateName field's value. +func (s *BatchAssociateApprovalRuleTemplateWithRepositoriesInput) SetApprovalRuleTemplateName(v string) *BatchAssociateApprovalRuleTemplateWithRepositoriesInput { + s.ApprovalRuleTemplateName = &v + return s +} + +// SetRepositoryNames sets the RepositoryNames field's value. +func (s *BatchAssociateApprovalRuleTemplateWithRepositoriesInput) SetRepositoryNames(v []*string) *BatchAssociateApprovalRuleTemplateWithRepositoriesInput { + s.RepositoryNames = v + return s +} + +type BatchAssociateApprovalRuleTemplateWithRepositoriesOutput struct { + _ struct{} `type:"structure"` + + // A list of names of the repositories that have been associated with the template. + // + // AssociatedRepositoryNames is a required field + AssociatedRepositoryNames []*string `locationName:"associatedRepositoryNames" type:"list" required:"true"` + + // A list of any errors that might have occurred while attempting to create + // the association between the template and the repositories. + // + // Errors is a required field + Errors []*BatchAssociateApprovalRuleTemplateWithRepositoriesError `locationName:"errors" type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchAssociateApprovalRuleTemplateWithRepositoriesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchAssociateApprovalRuleTemplateWithRepositoriesOutput) GoString() string { + return s.String() +} + +// SetAssociatedRepositoryNames sets the AssociatedRepositoryNames field's value. +func (s *BatchAssociateApprovalRuleTemplateWithRepositoriesOutput) SetAssociatedRepositoryNames(v []*string) *BatchAssociateApprovalRuleTemplateWithRepositoriesOutput { + s.AssociatedRepositoryNames = v + return s +} + +// SetErrors sets the Errors field's value. +func (s *BatchAssociateApprovalRuleTemplateWithRepositoriesOutput) SetErrors(v []*BatchAssociateApprovalRuleTemplateWithRepositoriesError) *BatchAssociateApprovalRuleTemplateWithRepositoriesOutput { + s.Errors = v + return s +} + +// Returns information about errors in a BatchDescribeMergeConflicts operation. +type BatchDescribeMergeConflictsError struct { + _ struct{} `type:"structure"` + + // The name of the exception. + // + // ExceptionName is a required field + ExceptionName *string `locationName:"exceptionName" type:"string" required:"true"` + + // The path to the file. + // + // FilePath is a required field + FilePath *string `locationName:"filePath" type:"string" required:"true"` + + // The message provided by the exception. + // + // Message is a required field + Message *string `locationName:"message" type:"string" required:"true"` +} + +// String returns the string representation +func (s BatchDescribeMergeConflictsError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchDescribeMergeConflictsError) GoString() string { + return s.String() +} + +// SetExceptionName sets the ExceptionName field's value. +func (s *BatchDescribeMergeConflictsError) SetExceptionName(v string) *BatchDescribeMergeConflictsError { + s.ExceptionName = &v + return s +} + +// SetFilePath sets the FilePath field's value. +func (s *BatchDescribeMergeConflictsError) SetFilePath(v string) *BatchDescribeMergeConflictsError { + s.FilePath = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *BatchDescribeMergeConflictsError) SetMessage(v string) *BatchDescribeMergeConflictsError { + s.Message = &v + return s +} + +type BatchDescribeMergeConflictsInput struct { + _ struct{} `type:"structure"` + + // The level of conflict detail to use. If unspecified, the default FILE_LEVEL + // is used, which returns a not-mergeable result if the same file has differences + // in both branches. If LINE_LEVEL is specified, a conflict is considered not + // mergeable if the same file in both branches has differences on the same line. + ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` + + // Specifies which branch to use when resolving conflicts, or whether to attempt + // automatically merging two versions of a file. The default is NONE, which + // requires any conflicts to be resolved manually before the merge operation + // is successful. + ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` + + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). + // + // DestinationCommitSpecifier is a required field + DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` + + // The path of the target files used to describe the conflicts. If not specified, + // the default is all conflict files. + FilePaths []*string `locationName:"filePaths" type:"list"` + + // The maximum number of files to include in the output. + MaxConflictFiles *int64 `locationName:"maxConflictFiles" type:"integer"` + + // The maximum number of merge hunks to include in the output. + MaxMergeHunks *int64 `locationName:"maxMergeHunks" type:"integer"` + + // The merge option or strategy you want to use to merge the code. + // + // MergeOption is a required field + MergeOption *string `locationName:"mergeOption" type:"string" required:"true" enum:"MergeOptionTypeEnum"` + + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The name of the repository that contains the merge conflicts you want to + // review. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). + // + // SourceCommitSpecifier is a required field + SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` +} + +// String returns the string representation +func (s BatchDescribeMergeConflictsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchDescribeMergeConflictsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchDescribeMergeConflictsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchDescribeMergeConflictsInput"} + if s.DestinationCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) + } + if s.MergeOption == nil { + invalidParams.Add(request.NewErrParamRequired("MergeOption")) + } + 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.SourceCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConflictDetailLevel sets the ConflictDetailLevel field's value. +func (s *BatchDescribeMergeConflictsInput) SetConflictDetailLevel(v string) *BatchDescribeMergeConflictsInput { + s.ConflictDetailLevel = &v + return s +} + +// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. +func (s *BatchDescribeMergeConflictsInput) SetConflictResolutionStrategy(v string) *BatchDescribeMergeConflictsInput { + s.ConflictResolutionStrategy = &v + return s +} + +// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. +func (s *BatchDescribeMergeConflictsInput) SetDestinationCommitSpecifier(v string) *BatchDescribeMergeConflictsInput { + s.DestinationCommitSpecifier = &v + return s +} + +// SetFilePaths sets the FilePaths field's value. +func (s *BatchDescribeMergeConflictsInput) SetFilePaths(v []*string) *BatchDescribeMergeConflictsInput { + s.FilePaths = v + return s +} + +// SetMaxConflictFiles sets the MaxConflictFiles field's value. +func (s *BatchDescribeMergeConflictsInput) SetMaxConflictFiles(v int64) *BatchDescribeMergeConflictsInput { + s.MaxConflictFiles = &v + return s +} + +// SetMaxMergeHunks sets the MaxMergeHunks field's value. +func (s *BatchDescribeMergeConflictsInput) SetMaxMergeHunks(v int64) *BatchDescribeMergeConflictsInput { + s.MaxMergeHunks = &v + return s +} + +// SetMergeOption sets the MergeOption field's value. +func (s *BatchDescribeMergeConflictsInput) SetMergeOption(v string) *BatchDescribeMergeConflictsInput { + s.MergeOption = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *BatchDescribeMergeConflictsInput) SetNextToken(v string) *BatchDescribeMergeConflictsInput { + s.NextToken = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *BatchDescribeMergeConflictsInput) SetRepositoryName(v string) *BatchDescribeMergeConflictsInput { + s.RepositoryName = &v + return s +} + +// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. +func (s *BatchDescribeMergeConflictsInput) SetSourceCommitSpecifier(v string) *BatchDescribeMergeConflictsInput { + s.SourceCommitSpecifier = &v + return s +} + +type BatchDescribeMergeConflictsOutput struct { + _ struct{} `type:"structure"` + + // The commit ID of the merge base. + BaseCommitId *string `locationName:"baseCommitId" type:"string"` + + // A list of conflicts for each file, including the conflict metadata and the + // hunks of the differences between the files. + // + // Conflicts is a required field + Conflicts []*Conflict `locationName:"conflicts" type:"list" required:"true"` + + // The commit ID of the destination commit specifier that was used in the merge + // evaluation. + // + // DestinationCommitId is a required field + DestinationCommitId *string `locationName:"destinationCommitId" type:"string" required:"true"` + + // A list of any errors returned while describing the merge conflicts for each + // file. + Errors []*BatchDescribeMergeConflictsError `locationName:"errors" type:"list"` + + // An enumeration token that can be used in a request to return the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The commit ID of the source commit specifier that was used in the merge evaluation. + // + // SourceCommitId is a required field + SourceCommitId *string `locationName:"sourceCommitId" type:"string" required:"true"` +} + +// String returns the string representation +func (s BatchDescribeMergeConflictsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchDescribeMergeConflictsOutput) GoString() string { + return s.String() +} + +// SetBaseCommitId sets the BaseCommitId field's value. +func (s *BatchDescribeMergeConflictsOutput) SetBaseCommitId(v string) *BatchDescribeMergeConflictsOutput { + s.BaseCommitId = &v + return s +} + +// SetConflicts sets the Conflicts field's value. +func (s *BatchDescribeMergeConflictsOutput) SetConflicts(v []*Conflict) *BatchDescribeMergeConflictsOutput { + s.Conflicts = v + return s +} + +// SetDestinationCommitId sets the DestinationCommitId field's value. +func (s *BatchDescribeMergeConflictsOutput) SetDestinationCommitId(v string) *BatchDescribeMergeConflictsOutput { + s.DestinationCommitId = &v + return s +} + +// SetErrors sets the Errors field's value. +func (s *BatchDescribeMergeConflictsOutput) SetErrors(v []*BatchDescribeMergeConflictsError) *BatchDescribeMergeConflictsOutput { + s.Errors = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *BatchDescribeMergeConflictsOutput) SetNextToken(v string) *BatchDescribeMergeConflictsOutput { + s.NextToken = &v + return s +} + +// SetSourceCommitId sets the SourceCommitId field's value. +func (s *BatchDescribeMergeConflictsOutput) SetSourceCommitId(v string) *BatchDescribeMergeConflictsOutput { + s.SourceCommitId = &v + return s +} + +// Returns information about errors in a BatchDisassociateApprovalRuleTemplateFromRepositories +// operation. +type BatchDisassociateApprovalRuleTemplateFromRepositoriesError struct { + _ struct{} `type:"structure"` + + // An error code that specifies whether the repository name was not valid or + // not found. + ErrorCode *string `locationName:"errorCode" type:"string"` + + // An error message that provides details about why the repository name was + // either not found or not valid. + ErrorMessage *string `locationName:"errorMessage" type:"string"` + + // The name of the repository where the association with the template was not + // able to be removed. + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` +} + +// String returns the string representation +func (s BatchDisassociateApprovalRuleTemplateFromRepositoriesError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchDisassociateApprovalRuleTemplateFromRepositoriesError) GoString() string { + return s.String() +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *BatchDisassociateApprovalRuleTemplateFromRepositoriesError) SetErrorCode(v string) *BatchDisassociateApprovalRuleTemplateFromRepositoriesError { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *BatchDisassociateApprovalRuleTemplateFromRepositoriesError) SetErrorMessage(v string) *BatchDisassociateApprovalRuleTemplateFromRepositoriesError { + s.ErrorMessage = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *BatchDisassociateApprovalRuleTemplateFromRepositoriesError) SetRepositoryName(v string) *BatchDisassociateApprovalRuleTemplateFromRepositoriesError { + s.RepositoryName = &v + return s +} + +type BatchDisassociateApprovalRuleTemplateFromRepositoriesInput struct { + _ struct{} `type:"structure"` + + // The name of the template that you want to disassociate from one or more repositories. + // + // ApprovalRuleTemplateName is a required field + ApprovalRuleTemplateName *string `locationName:"approvalRuleTemplateName" min:"1" type:"string" required:"true"` + + // The repository names that you want to disassociate from the approval rule + // template. + // + // The length constraint limit is for each string in the array. The array itself + // can be empty. + // + // RepositoryNames is a required field + RepositoryNames []*string `locationName:"repositoryNames" type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchDisassociateApprovalRuleTemplateFromRepositoriesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchDisassociateApprovalRuleTemplateFromRepositoriesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchDisassociateApprovalRuleTemplateFromRepositoriesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchDisassociateApprovalRuleTemplateFromRepositoriesInput"} + if s.ApprovalRuleTemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleTemplateName")) + } + if s.ApprovalRuleTemplateName != nil && len(*s.ApprovalRuleTemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApprovalRuleTemplateName", 1)) + } + if s.RepositoryNames == nil { + invalidParams.Add(request.NewErrParamRequired("RepositoryNames")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApprovalRuleTemplateName sets the ApprovalRuleTemplateName field's value. +func (s *BatchDisassociateApprovalRuleTemplateFromRepositoriesInput) SetApprovalRuleTemplateName(v string) *BatchDisassociateApprovalRuleTemplateFromRepositoriesInput { + s.ApprovalRuleTemplateName = &v + return s +} + +// SetRepositoryNames sets the RepositoryNames field's value. +func (s *BatchDisassociateApprovalRuleTemplateFromRepositoriesInput) SetRepositoryNames(v []*string) *BatchDisassociateApprovalRuleTemplateFromRepositoriesInput { + s.RepositoryNames = v + return s +} + +type BatchDisassociateApprovalRuleTemplateFromRepositoriesOutput struct { + _ struct{} `type:"structure"` + + // A list of repository names that have had their association with the template + // removed. + // + // DisassociatedRepositoryNames is a required field + DisassociatedRepositoryNames []*string `locationName:"disassociatedRepositoryNames" type:"list" required:"true"` + + // A list of any errors that might have occurred while attempting to remove + // the association between the template and the repositories. + // + // Errors is a required field + Errors []*BatchDisassociateApprovalRuleTemplateFromRepositoriesError `locationName:"errors" type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchDisassociateApprovalRuleTemplateFromRepositoriesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchDisassociateApprovalRuleTemplateFromRepositoriesOutput) GoString() string { + return s.String() +} + +// SetDisassociatedRepositoryNames sets the DisassociatedRepositoryNames field's value. +func (s *BatchDisassociateApprovalRuleTemplateFromRepositoriesOutput) SetDisassociatedRepositoryNames(v []*string) *BatchDisassociateApprovalRuleTemplateFromRepositoriesOutput { + s.DisassociatedRepositoryNames = v + return s +} + +// SetErrors sets the Errors field's value. +func (s *BatchDisassociateApprovalRuleTemplateFromRepositoriesOutput) SetErrors(v []*BatchDisassociateApprovalRuleTemplateFromRepositoriesError) *BatchDisassociateApprovalRuleTemplateFromRepositoriesOutput { + s.Errors = v + return s +} + +// Returns information about errors in a BatchGetCommits operation. +type BatchGetCommitsError struct { + _ struct{} `type:"structure"` + + // A commit ID that either could not be found or was not in a valid format. + CommitId *string `locationName:"commitId" type:"string"` + + // An error code that specifies whether the commit ID was not valid or not found. + ErrorCode *string `locationName:"errorCode" type:"string"` + + // An error message that provides detail about why the commit ID either was + // not found or was not valid. + ErrorMessage *string `locationName:"errorMessage" type:"string"` +} + +// String returns the string representation +func (s BatchGetCommitsError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchGetCommitsError) GoString() string { + return s.String() +} + +// SetCommitId sets the CommitId field's value. +func (s *BatchGetCommitsError) SetCommitId(v string) *BatchGetCommitsError { + s.CommitId = &v + return s +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *BatchGetCommitsError) SetErrorCode(v string) *BatchGetCommitsError { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *BatchGetCommitsError) SetErrorMessage(v string) *BatchGetCommitsError { + s.ErrorMessage = &v + return s +} + +type BatchGetCommitsInput struct { + _ struct{} `type:"structure"` + + // The full commit IDs of the commits to get information about. + // + // You must supply the full SHA IDs of each commit. You cannot use shortened + // SHA IDs. + // + // CommitIds is a required field + CommitIds []*string `locationName:"commitIds" type:"list" required:"true"` + + // The name of the repository that contains the commits. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s BatchGetCommitsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchGetCommitsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchGetCommitsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchGetCommitsInput"} + if s.CommitIds == nil { + invalidParams.Add(request.NewErrParamRequired("CommitIds")) + } + 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 +} + +// SetCommitIds sets the CommitIds field's value. +func (s *BatchGetCommitsInput) SetCommitIds(v []*string) *BatchGetCommitsInput { + s.CommitIds = v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *BatchGetCommitsInput) SetRepositoryName(v string) *BatchGetCommitsInput { + s.RepositoryName = &v + return s +} + +type BatchGetCommitsOutput struct { + _ struct{} `type:"structure"` + + // An array of commit data type objects, each of which contains information + // about a specified commit. + Commits []*Commit `locationName:"commits" type:"list"` + + // Returns any commit IDs for which information could not be found. For example, + // if one of the commit IDs was a shortened SHA ID or that commit was not found + // in the specified repository, the ID returns an error object with more information. + Errors []*BatchGetCommitsError `locationName:"errors" type:"list"` +} + +// String returns the string representation +func (s BatchGetCommitsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchGetCommitsOutput) GoString() string { + return s.String() +} + +// SetCommits sets the Commits field's value. +func (s *BatchGetCommitsOutput) SetCommits(v []*Commit) *BatchGetCommitsOutput { + s.Commits = v + return s +} + +// SetErrors sets the Errors field's value. +func (s *BatchGetCommitsOutput) SetErrors(v []*BatchGetCommitsError) *BatchGetCommitsOutput { + s.Errors = v + return s +} + +// Represents the input of a batch get repositories operation. +type BatchGetRepositoriesInput struct { + _ struct{} `type:"structure"` + + // The names of the repositories to get information about. + // + // The length constraint limit is for each string in the array. The array itself + // can be empty. + // + // 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. +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 +} + +// The before commit ID and the after commit ID are the same, which is not valid. +// The before commit ID and the after commit ID must be different commit IDs. +type BeforeCommitIdAndAfterCommitIdAreSameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BeforeCommitIdAndAfterCommitIdAreSameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BeforeCommitIdAndAfterCommitIdAreSameException) GoString() string { + return s.String() +} + +func newErrorBeforeCommitIdAndAfterCommitIdAreSameException(v protocol.ResponseMetadata) error { + return &BeforeCommitIdAndAfterCommitIdAreSameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BeforeCommitIdAndAfterCommitIdAreSameException) Code() string { + return "BeforeCommitIdAndAfterCommitIdAreSameException" +} + +// Message returns the exception's message. +func (s BeforeCommitIdAndAfterCommitIdAreSameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BeforeCommitIdAndAfterCommitIdAreSameException) OrigErr() error { + return nil +} + +func (s BeforeCommitIdAndAfterCommitIdAreSameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BeforeCommitIdAndAfterCommitIdAreSameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BeforeCommitIdAndAfterCommitIdAreSameException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified blob does not exist. +type BlobIdDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BlobIdDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BlobIdDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorBlobIdDoesNotExistException(v protocol.ResponseMetadata) error { + return &BlobIdDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BlobIdDoesNotExistException) Code() string { + return "BlobIdDoesNotExistException" +} + +// Message returns the exception's message. +func (s BlobIdDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BlobIdDoesNotExistException) OrigErr() error { + return nil +} + +func (s BlobIdDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BlobIdDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BlobIdDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// A blob ID is required, but was not specified. +type BlobIdRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BlobIdRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BlobIdRequiredException) GoString() string { + return s.String() +} + +func newErrorBlobIdRequiredException(v protocol.ResponseMetadata) error { + return &BlobIdRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BlobIdRequiredException) Code() string { + return "BlobIdRequiredException" +} + +// Message returns the exception's message. +func (s BlobIdRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BlobIdRequiredException) OrigErr() error { + return nil +} + +func (s BlobIdRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BlobIdRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BlobIdRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returns information about a specific Git blob object. +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 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 +} + +// The specified branch does not exist. +type BranchDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BranchDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BranchDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorBranchDoesNotExistException(v protocol.ResponseMetadata) error { + return &BranchDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BranchDoesNotExistException) Code() string { + return "BranchDoesNotExistException" +} + +// Message returns the exception's message. +func (s BranchDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BranchDoesNotExistException) OrigErr() error { + return nil +} + +func (s BranchDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BranchDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BranchDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returns information about a branch. +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 +} + +// The specified branch name already exists. +type BranchNameExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BranchNameExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BranchNameExistsException) GoString() string { + return s.String() +} + +func newErrorBranchNameExistsException(v protocol.ResponseMetadata) error { + return &BranchNameExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BranchNameExistsException) Code() string { + return "BranchNameExistsException" +} + +// Message returns the exception's message. +func (s BranchNameExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BranchNameExistsException) OrigErr() error { + return nil +} + +func (s BranchNameExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BranchNameExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BranchNameExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified branch name is not valid because it is a tag name. Enter the +// name of a branch in the repository. For a list of valid branch names, use +// ListBranches. +type BranchNameIsTagNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BranchNameIsTagNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BranchNameIsTagNameException) GoString() string { + return s.String() +} + +func newErrorBranchNameIsTagNameException(v protocol.ResponseMetadata) error { + return &BranchNameIsTagNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BranchNameIsTagNameException) Code() string { + return "BranchNameIsTagNameException" +} + +// Message returns the exception's message. +func (s BranchNameIsTagNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BranchNameIsTagNameException) OrigErr() error { + return nil +} + +func (s BranchNameIsTagNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BranchNameIsTagNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BranchNameIsTagNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// A branch name is required, but was not specified. +type BranchNameRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BranchNameRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BranchNameRequiredException) GoString() string { + return s.String() +} + +func newErrorBranchNameRequiredException(v protocol.ResponseMetadata) error { + return &BranchNameRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BranchNameRequiredException) Code() string { + return "BranchNameRequiredException" +} + +// Message returns the exception's message. +func (s BranchNameRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BranchNameRequiredException) OrigErr() error { + return nil +} + +func (s BranchNameRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BranchNameRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BranchNameRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The approval rule cannot be deleted from the pull request because it was +// created by an approval rule template and applied to the pull request automatically. +type CannotDeleteApprovalRuleFromTemplateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CannotDeleteApprovalRuleFromTemplateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CannotDeleteApprovalRuleFromTemplateException) GoString() string { + return s.String() +} + +func newErrorCannotDeleteApprovalRuleFromTemplateException(v protocol.ResponseMetadata) error { + return &CannotDeleteApprovalRuleFromTemplateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CannotDeleteApprovalRuleFromTemplateException) Code() string { + return "CannotDeleteApprovalRuleFromTemplateException" +} + +// Message returns the exception's message. +func (s CannotDeleteApprovalRuleFromTemplateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CannotDeleteApprovalRuleFromTemplateException) OrigErr() error { + return nil +} + +func (s CannotDeleteApprovalRuleFromTemplateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CannotDeleteApprovalRuleFromTemplateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CannotDeleteApprovalRuleFromTemplateException) RequestID() string { + return s.respMetadata.RequestID +} + +// The approval rule cannot be modified for the pull request because it was +// created by an approval rule template and applied to the pull request automatically. +type CannotModifyApprovalRuleFromTemplateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CannotModifyApprovalRuleFromTemplateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CannotModifyApprovalRuleFromTemplateException) GoString() string { + return s.String() +} + +func newErrorCannotModifyApprovalRuleFromTemplateException(v protocol.ResponseMetadata) error { + return &CannotModifyApprovalRuleFromTemplateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CannotModifyApprovalRuleFromTemplateException) Code() string { + return "CannotModifyApprovalRuleFromTemplateException" +} + +// Message returns the exception's message. +func (s CannotModifyApprovalRuleFromTemplateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CannotModifyApprovalRuleFromTemplateException) OrigErr() error { + return nil +} + +func (s CannotModifyApprovalRuleFromTemplateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CannotModifyApprovalRuleFromTemplateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CannotModifyApprovalRuleFromTemplateException) RequestID() string { + return s.respMetadata.RequestID +} + +// A client request token is required. A client request token is an unique, +// client-generated idempotency token that, when provided in a request, ensures +// the request cannot be repeated with a changed parameter. If a request is +// received with the same parameters and a token is included, the request returns +// information about the initial request that used that token. +type ClientRequestTokenRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ClientRequestTokenRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClientRequestTokenRequiredException) GoString() string { + return s.String() +} + +func newErrorClientRequestTokenRequiredException(v protocol.ResponseMetadata) error { + return &ClientRequestTokenRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ClientRequestTokenRequiredException) Code() string { + return "ClientRequestTokenRequiredException" +} + +// Message returns the exception's message. +func (s ClientRequestTokenRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ClientRequestTokenRequiredException) OrigErr() error { + return nil +} + +func (s ClientRequestTokenRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ClientRequestTokenRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ClientRequestTokenRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returns information about a specific comment. +type Comment struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the person who posted the comment. + AuthorArn *string `locationName:"authorArn" type:"string"` + + // A unique, client-generated idempotency token that, when provided in a request, + // ensures the request cannot be repeated with a changed parameter. If a request + // is received with the same parameters and a token is included, the request + // returns information about the initial request that used that token. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string"` + + // The system-generated comment ID. + CommentId *string `locationName:"commentId" type:"string"` + + // The content of the comment. + Content *string `locationName:"content" type:"string"` + + // The date and time the comment was created, in timestamp format. + CreationDate *time.Time `locationName:"creationDate" type:"timestamp"` + + // A Boolean value indicating whether the comment has been deleted. + Deleted *bool `locationName:"deleted" type:"boolean"` + + // The ID of the comment for which this comment is a reply, if any. + InReplyTo *string `locationName:"inReplyTo" type:"string"` + + // The date and time the comment was most recently modified, in timestamp format. + LastModifiedDate *time.Time `locationName:"lastModifiedDate" type:"timestamp"` +} + +// String returns the string representation +func (s Comment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Comment) GoString() string { + return s.String() +} + +// SetAuthorArn sets the AuthorArn field's value. +func (s *Comment) SetAuthorArn(v string) *Comment { + s.AuthorArn = &v + return s +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *Comment) SetClientRequestToken(v string) *Comment { + s.ClientRequestToken = &v + return s +} + +// SetCommentId sets the CommentId field's value. +func (s *Comment) SetCommentId(v string) *Comment { + s.CommentId = &v + return s +} + +// SetContent sets the Content field's value. +func (s *Comment) SetContent(v string) *Comment { + s.Content = &v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *Comment) SetCreationDate(v time.Time) *Comment { + s.CreationDate = &v + return s +} + +// SetDeleted sets the Deleted field's value. +func (s *Comment) SetDeleted(v bool) *Comment { + s.Deleted = &v + return s +} + +// SetInReplyTo sets the InReplyTo field's value. +func (s *Comment) SetInReplyTo(v string) *Comment { + s.InReplyTo = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *Comment) SetLastModifiedDate(v time.Time) *Comment { + s.LastModifiedDate = &v + return s +} + +// The comment is empty. You must provide some content for a comment. The content +// cannot be null. +type CommentContentRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CommentContentRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommentContentRequiredException) GoString() string { + return s.String() +} + +func newErrorCommentContentRequiredException(v protocol.ResponseMetadata) error { + return &CommentContentRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CommentContentRequiredException) Code() string { + return "CommentContentRequiredException" +} + +// Message returns the exception's message. +func (s CommentContentRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CommentContentRequiredException) OrigErr() error { + return nil +} + +func (s CommentContentRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CommentContentRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CommentContentRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The comment is too large. Comments are limited to 1,000 characters. +type CommentContentSizeLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CommentContentSizeLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommentContentSizeLimitExceededException) GoString() string { + return s.String() +} + +func newErrorCommentContentSizeLimitExceededException(v protocol.ResponseMetadata) error { + return &CommentContentSizeLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CommentContentSizeLimitExceededException) Code() string { + return "CommentContentSizeLimitExceededException" +} + +// Message returns the exception's message. +func (s CommentContentSizeLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CommentContentSizeLimitExceededException) OrigErr() error { + return nil +} + +func (s CommentContentSizeLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CommentContentSizeLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CommentContentSizeLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// This comment has already been deleted. You cannot edit or delete a deleted +// comment. +type CommentDeletedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CommentDeletedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommentDeletedException) GoString() string { + return s.String() +} + +func newErrorCommentDeletedException(v protocol.ResponseMetadata) error { + return &CommentDeletedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CommentDeletedException) Code() string { + return "CommentDeletedException" +} + +// Message returns the exception's message. +func (s CommentDeletedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CommentDeletedException) OrigErr() error { + return nil +} + +func (s CommentDeletedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CommentDeletedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CommentDeletedException) RequestID() string { + return s.respMetadata.RequestID +} + +// No comment exists with the provided ID. Verify that you have used the correct +// ID, and then try again. +type CommentDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CommentDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommentDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorCommentDoesNotExistException(v protocol.ResponseMetadata) error { + return &CommentDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CommentDoesNotExistException) Code() string { + return "CommentDoesNotExistException" +} + +// Message returns the exception's message. +func (s CommentDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CommentDoesNotExistException) OrigErr() error { + return nil +} + +func (s CommentDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CommentDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CommentDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// The comment ID is missing or null. A comment ID is required. +type CommentIdRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CommentIdRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommentIdRequiredException) GoString() string { + return s.String() +} + +func newErrorCommentIdRequiredException(v protocol.ResponseMetadata) error { + return &CommentIdRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CommentIdRequiredException) Code() string { + return "CommentIdRequiredException" +} + +// Message returns the exception's message. +func (s CommentIdRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CommentIdRequiredException) OrigErr() error { + return nil +} + +func (s CommentIdRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CommentIdRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CommentIdRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// You cannot modify or delete this comment. Only comment authors can modify +// or delete their comments. +type CommentNotCreatedByCallerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CommentNotCreatedByCallerException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommentNotCreatedByCallerException) GoString() string { + return s.String() +} + +func newErrorCommentNotCreatedByCallerException(v protocol.ResponseMetadata) error { + return &CommentNotCreatedByCallerException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CommentNotCreatedByCallerException) Code() string { + return "CommentNotCreatedByCallerException" +} + +// Message returns the exception's message. +func (s CommentNotCreatedByCallerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CommentNotCreatedByCallerException) OrigErr() error { + return nil +} + +func (s CommentNotCreatedByCallerException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CommentNotCreatedByCallerException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CommentNotCreatedByCallerException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returns information about comments on the comparison between two commits. +type CommentsForComparedCommit struct { + _ struct{} `type:"structure"` + + // The full blob ID of the commit used to establish the after of the comparison. + AfterBlobId *string `locationName:"afterBlobId" type:"string"` + + // The full commit ID of the commit used to establish the after of the comparison. + AfterCommitId *string `locationName:"afterCommitId" type:"string"` + + // The full blob ID of the commit used to establish the before of the comparison. + BeforeBlobId *string `locationName:"beforeBlobId" type:"string"` + + // The full commit ID of the commit used to establish the before of the comparison. + BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` + + // An array of comment objects. Each comment object contains information about + // a comment on the comparison between commits. + Comments []*Comment `locationName:"comments" type:"list"` + + // Location information about the comment on the comparison, including the file + // name, line number, and whether the version of the file where the comment + // was made is BEFORE or AFTER. + Location *Location `locationName:"location" type:"structure"` + + // The name of the repository that contains the compared commits. + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` +} + +// String returns the string representation +func (s CommentsForComparedCommit) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommentsForComparedCommit) GoString() string { + return s.String() +} + +// SetAfterBlobId sets the AfterBlobId field's value. +func (s *CommentsForComparedCommit) SetAfterBlobId(v string) *CommentsForComparedCommit { + s.AfterBlobId = &v + return s +} + +// SetAfterCommitId sets the AfterCommitId field's value. +func (s *CommentsForComparedCommit) SetAfterCommitId(v string) *CommentsForComparedCommit { + s.AfterCommitId = &v + return s +} + +// SetBeforeBlobId sets the BeforeBlobId field's value. +func (s *CommentsForComparedCommit) SetBeforeBlobId(v string) *CommentsForComparedCommit { + s.BeforeBlobId = &v + return s +} + +// SetBeforeCommitId sets the BeforeCommitId field's value. +func (s *CommentsForComparedCommit) SetBeforeCommitId(v string) *CommentsForComparedCommit { + s.BeforeCommitId = &v + return s +} + +// SetComments sets the Comments field's value. +func (s *CommentsForComparedCommit) SetComments(v []*Comment) *CommentsForComparedCommit { + s.Comments = v + return s +} + +// SetLocation sets the Location field's value. +func (s *CommentsForComparedCommit) SetLocation(v *Location) *CommentsForComparedCommit { + s.Location = v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *CommentsForComparedCommit) SetRepositoryName(v string) *CommentsForComparedCommit { + s.RepositoryName = &v + return s +} + +// Returns information about comments on a pull request. +type CommentsForPullRequest struct { + _ struct{} `type:"structure"` + + // The full blob ID of the file on which you want to comment on the source commit. + AfterBlobId *string `locationName:"afterBlobId" type:"string"` + + // The full commit ID of the commit that was the tip of the source branch at + // the time the comment was made. + AfterCommitId *string `locationName:"afterCommitId" type:"string"` + + // The full blob ID of the file on which you want to comment on the destination + // commit. + BeforeBlobId *string `locationName:"beforeBlobId" type:"string"` + + // The full commit ID of the commit that was the tip of the destination branch + // when the pull request was created. This commit is superceded by the after + // commit in the source branch when and if you merge the source branch into + // the destination branch. + BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` + + // An array of comment objects. Each comment object contains information about + // a comment on the pull request. + Comments []*Comment `locationName:"comments" type:"list"` + + // Location information about the comment on the pull request, including the + // file name, line number, and whether the version of the file where the comment + // was made is BEFORE (destination branch) or AFTER (source branch). + Location *Location `locationName:"location" type:"structure"` + + // The system-generated ID of the pull request. + PullRequestId *string `locationName:"pullRequestId" type:"string"` + + // The name of the repository that contains the pull request. + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` +} + +// String returns the string representation +func (s CommentsForPullRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommentsForPullRequest) GoString() string { + return s.String() +} + +// SetAfterBlobId sets the AfterBlobId field's value. +func (s *CommentsForPullRequest) SetAfterBlobId(v string) *CommentsForPullRequest { + s.AfterBlobId = &v + return s +} + +// SetAfterCommitId sets the AfterCommitId field's value. +func (s *CommentsForPullRequest) SetAfterCommitId(v string) *CommentsForPullRequest { + s.AfterCommitId = &v + return s +} + +// SetBeforeBlobId sets the BeforeBlobId field's value. +func (s *CommentsForPullRequest) SetBeforeBlobId(v string) *CommentsForPullRequest { + s.BeforeBlobId = &v + return s +} + +// SetBeforeCommitId sets the BeforeCommitId field's value. +func (s *CommentsForPullRequest) SetBeforeCommitId(v string) *CommentsForPullRequest { + s.BeforeCommitId = &v + return s +} + +// SetComments sets the Comments field's value. +func (s *CommentsForPullRequest) SetComments(v []*Comment) *CommentsForPullRequest { + s.Comments = v + return s +} + +// SetLocation sets the Location field's value. +func (s *CommentsForPullRequest) SetLocation(v *Location) *CommentsForPullRequest { + s.Location = v + return s +} + +// SetPullRequestId sets the PullRequestId field's value. +func (s *CommentsForPullRequest) SetPullRequestId(v string) *CommentsForPullRequest { + s.PullRequestId = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *CommentsForPullRequest) SetRepositoryName(v string) *CommentsForPullRequest { + s.RepositoryName = &v + return s +} + +// Returns information about a specific commit. +type Commit struct { + _ struct{} `type:"structure"` + + // Any other 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"` + + // The full SHA ID of the specified commit. + CommitId *string `locationName:"commitId" type:"string"` + + // 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"` + + // A list of parent commits for the specified commit. Each parent commit ID + // is the full commit ID. + 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 +} + +// SetCommitId sets the CommitId field's value. +func (s *Commit) SetCommitId(v string) *Commit { + s.CommitId = &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 +} + +// The specified commit does not exist or no commit was specified, and the specified +// repository has no default branch. +type CommitDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CommitDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommitDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorCommitDoesNotExistException(v protocol.ResponseMetadata) error { + return &CommitDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CommitDoesNotExistException) Code() string { + return "CommitDoesNotExistException" +} + +// Message returns the exception's message. +func (s CommitDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CommitDoesNotExistException) OrigErr() error { + return nil +} + +func (s CommitDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CommitDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CommitDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified commit ID does not exist. +type CommitIdDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CommitIdDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommitIdDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorCommitIdDoesNotExistException(v protocol.ResponseMetadata) error { + return &CommitIdDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CommitIdDoesNotExistException) Code() string { + return "CommitIdDoesNotExistException" +} + +// Message returns the exception's message. +func (s CommitIdDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CommitIdDoesNotExistException) OrigErr() error { + return nil +} + +func (s CommitIdDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CommitIdDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CommitIdDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// A commit ID was not specified. +type CommitIdRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CommitIdRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommitIdRequiredException) GoString() string { + return s.String() +} + +func newErrorCommitIdRequiredException(v protocol.ResponseMetadata) error { + return &CommitIdRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CommitIdRequiredException) Code() string { + return "CommitIdRequiredException" +} + +// Message returns the exception's message. +func (s CommitIdRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CommitIdRequiredException) OrigErr() error { + return nil +} + +func (s CommitIdRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CommitIdRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CommitIdRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The maximum number of allowed commit IDs in a batch request is 100. Verify +// that your batch requests contains no more than 100 commit IDs, and then try +// again. +type CommitIdsLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CommitIdsLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommitIdsLimitExceededException) GoString() string { + return s.String() +} + +func newErrorCommitIdsLimitExceededException(v protocol.ResponseMetadata) error { + return &CommitIdsLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CommitIdsLimitExceededException) Code() string { + return "CommitIdsLimitExceededException" +} + +// Message returns the exception's message. +func (s CommitIdsLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CommitIdsLimitExceededException) OrigErr() error { + return nil +} + +func (s CommitIdsLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CommitIdsLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CommitIdsLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// A list of commit IDs is required, but was either not specified or the list +// was empty. +type CommitIdsListRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CommitIdsListRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommitIdsListRequiredException) GoString() string { + return s.String() +} + +func newErrorCommitIdsListRequiredException(v protocol.ResponseMetadata) error { + return &CommitIdsListRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CommitIdsListRequiredException) Code() string { + return "CommitIdsListRequiredException" +} + +// Message returns the exception's message. +func (s CommitIdsListRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CommitIdsListRequiredException) OrigErr() error { + return nil +} + +func (s CommitIdsListRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CommitIdsListRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CommitIdsListRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The commit message is too long. Provide a shorter string. +type CommitMessageLengthExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CommitMessageLengthExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommitMessageLengthExceededException) GoString() string { + return s.String() +} + +func newErrorCommitMessageLengthExceededException(v protocol.ResponseMetadata) error { + return &CommitMessageLengthExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CommitMessageLengthExceededException) Code() string { + return "CommitMessageLengthExceededException" +} + +// Message returns the exception's message. +func (s CommitMessageLengthExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CommitMessageLengthExceededException) OrigErr() error { + return nil +} + +func (s CommitMessageLengthExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CommitMessageLengthExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CommitMessageLengthExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// A commit was not specified. +type CommitRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CommitRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CommitRequiredException) GoString() string { + return s.String() +} + +func newErrorCommitRequiredException(v protocol.ResponseMetadata) error { + return &CommitRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CommitRequiredException) Code() string { + return "CommitRequiredException" +} + +// Message returns the exception's message. +func (s CommitRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CommitRequiredException) OrigErr() error { + return nil +} + +func (s CommitRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CommitRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CommitRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The merge cannot be completed because the target branch has been modified. +// Another user might have modified the target branch while the merge was in +// progress. Wait a few minutes, and then try again. +type ConcurrentReferenceUpdateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentReferenceUpdateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentReferenceUpdateException) GoString() string { + return s.String() +} + +func newErrorConcurrentReferenceUpdateException(v protocol.ResponseMetadata) error { + return &ConcurrentReferenceUpdateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentReferenceUpdateException) Code() string { + return "ConcurrentReferenceUpdateException" +} + +// Message returns the exception's message. +func (s ConcurrentReferenceUpdateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentReferenceUpdateException) OrigErr() error { + return nil +} + +func (s ConcurrentReferenceUpdateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentReferenceUpdateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentReferenceUpdateException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about conflicts in a merge operation. +type Conflict struct { + _ struct{} `type:"structure"` + + // Metadata about a conflict in a merge operation. + ConflictMetadata *ConflictMetadata `locationName:"conflictMetadata" type:"structure"` + + // A list of hunks that contain the differences between files or lines causing + // the conflict. + MergeHunks []*MergeHunk `locationName:"mergeHunks" type:"list"` +} + +// String returns the string representation +func (s Conflict) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Conflict) GoString() string { + return s.String() +} + +// SetConflictMetadata sets the ConflictMetadata field's value. +func (s *Conflict) SetConflictMetadata(v *ConflictMetadata) *Conflict { + s.ConflictMetadata = v + return s +} + +// SetMergeHunks sets the MergeHunks field's value. +func (s *Conflict) SetMergeHunks(v []*MergeHunk) *Conflict { + s.MergeHunks = v + return s +} + +// Information about the metadata for a conflict in a merge operation. +type ConflictMetadata struct { + _ struct{} `type:"structure"` + + // A boolean value indicating whether there are conflicts in the content of + // a file. + ContentConflict *bool `locationName:"contentConflict" type:"boolean"` + + // A boolean value indicating whether there are conflicts in the file mode of + // a file. + FileModeConflict *bool `locationName:"fileModeConflict" type:"boolean"` + + // The file modes of the file in the source, destination, and base of the merge. + FileModes *FileModes `locationName:"fileModes" type:"structure"` + + // The path of the file that contains conflicts. + FilePath *string `locationName:"filePath" type:"string"` + + // The file sizes of the file in the source, destination, and base of the merge. + FileSizes *FileSizes `locationName:"fileSizes" type:"structure"` + + // A boolean value (true or false) indicating whether the file is binary or + // textual in the source, destination, and base of the merge. + IsBinaryFile *IsBinaryFile `locationName:"isBinaryFile" type:"structure"` + + // Whether an add, modify, or delete operation caused the conflict between the + // source and destination of the merge. + MergeOperations *MergeOperations `locationName:"mergeOperations" type:"structure"` + + // The number of conflicts, including both hunk conflicts and metadata conflicts. + NumberOfConflicts *int64 `locationName:"numberOfConflicts" type:"integer"` + + // A boolean value (true or false) indicating whether there are conflicts between + // the branches in the object type of a file, folder, or submodule. + ObjectTypeConflict *bool `locationName:"objectTypeConflict" type:"boolean"` + + // Information about any object type conflicts in a merge operation. + ObjectTypes *ObjectTypes `locationName:"objectTypes" type:"structure"` +} + +// String returns the string representation +func (s ConflictMetadata) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictMetadata) GoString() string { + return s.String() +} + +// SetContentConflict sets the ContentConflict field's value. +func (s *ConflictMetadata) SetContentConflict(v bool) *ConflictMetadata { + s.ContentConflict = &v + return s +} + +// SetFileModeConflict sets the FileModeConflict field's value. +func (s *ConflictMetadata) SetFileModeConflict(v bool) *ConflictMetadata { + s.FileModeConflict = &v + return s +} + +// SetFileModes sets the FileModes field's value. +func (s *ConflictMetadata) SetFileModes(v *FileModes) *ConflictMetadata { + s.FileModes = v + return s +} + +// SetFilePath sets the FilePath field's value. +func (s *ConflictMetadata) SetFilePath(v string) *ConflictMetadata { + s.FilePath = &v + return s +} + +// SetFileSizes sets the FileSizes field's value. +func (s *ConflictMetadata) SetFileSizes(v *FileSizes) *ConflictMetadata { + s.FileSizes = v + return s +} + +// SetIsBinaryFile sets the IsBinaryFile field's value. +func (s *ConflictMetadata) SetIsBinaryFile(v *IsBinaryFile) *ConflictMetadata { + s.IsBinaryFile = v + return s +} + +// SetMergeOperations sets the MergeOperations field's value. +func (s *ConflictMetadata) SetMergeOperations(v *MergeOperations) *ConflictMetadata { + s.MergeOperations = v + return s +} + +// SetNumberOfConflicts sets the NumberOfConflicts field's value. +func (s *ConflictMetadata) SetNumberOfConflicts(v int64) *ConflictMetadata { + s.NumberOfConflicts = &v + return s +} + +// SetObjectTypeConflict sets the ObjectTypeConflict field's value. +func (s *ConflictMetadata) SetObjectTypeConflict(v bool) *ConflictMetadata { + s.ObjectTypeConflict = &v + return s +} + +// SetObjectTypes sets the ObjectTypes field's value. +func (s *ConflictMetadata) SetObjectTypes(v *ObjectTypes) *ConflictMetadata { + s.ObjectTypes = v + return s +} + +// If AUTOMERGE is the conflict resolution strategy, a list of inputs to use +// when resolving conflicts during a merge. +type ConflictResolution struct { + _ struct{} `type:"structure"` + + // Files to be deleted as part of the merge conflict resolution. + DeleteFiles []*DeleteFileEntry `locationName:"deleteFiles" type:"list"` + + // Files to have content replaced as part of the merge conflict resolution. + ReplaceContents []*ReplaceContentEntry `locationName:"replaceContents" type:"list"` + + // File modes that are set as part of the merge conflict resolution. + SetFileModes []*SetFileModeEntry `locationName:"setFileModes" type:"list"` +} + +// String returns the string representation +func (s ConflictResolution) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictResolution) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ConflictResolution) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConflictResolution"} + if s.DeleteFiles != nil { + for i, v := range s.DeleteFiles { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DeleteFiles", i), err.(request.ErrInvalidParams)) + } + } + } + if s.ReplaceContents != nil { + for i, v := range s.ReplaceContents { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ReplaceContents", i), err.(request.ErrInvalidParams)) + } + } + } + if s.SetFileModes != nil { + for i, v := range s.SetFileModes { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SetFileModes", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDeleteFiles sets the DeleteFiles field's value. +func (s *ConflictResolution) SetDeleteFiles(v []*DeleteFileEntry) *ConflictResolution { + s.DeleteFiles = v + return s +} + +// SetReplaceContents sets the ReplaceContents field's value. +func (s *ConflictResolution) SetReplaceContents(v []*ReplaceContentEntry) *ConflictResolution { + s.ReplaceContents = v + return s +} + +// SetSetFileModes sets the SetFileModes field's value. +func (s *ConflictResolution) SetSetFileModes(v []*SetFileModeEntry) *ConflictResolution { + s.SetFileModes = v + return s +} + +type CreateApprovalRuleTemplateInput struct { + _ struct{} `type:"structure"` + + // The content of the approval rule that is created on pull requests in associated + // repositories. If you specify one or more destination references (branches), + // approval rules are created in an associated repository only if their destination + // references (branches) match those specified in the template. + // + // When you create the content of the approval rule template, you can specify + // approvers in an approval pool in one of two ways: + // + // * CodeCommitApprovers: This option only requires an AWS account and a + // resource. It can be used for both IAM users and federated access users + // whose name matches the provided resource name. This is a very powerful + // option that offers a great deal of flexibility. For example, if you specify + // the AWS account 123456789012 and Mary_Major, all of the following are + // counted as approvals coming from that user: An IAM user in the account + // (arn:aws:iam::123456789012:user/Mary_Major) A federated user identified + // in IAM as Mary_Major (arn:aws:sts::123456789012:federated-user/Mary_Major) + // This option does not recognize an active session of someone assuming the + // role of CodeCommitReview with a role session name of Mary_Major (arn:aws:sts::123456789012:assumed-role/CodeCommitReview/Mary_Major) + // unless you include a wildcard (*Mary_Major). + // + // * Fully qualified ARN: This option allows you to specify the fully qualified + // Amazon Resource Name (ARN) of the IAM user or role. + // + // For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers + // (https://docs.aws.amazon.com/iam/latest/UserGuide/reference_identifiers.html) + // in the IAM User Guide. + // + // ApprovalRuleTemplateContent is a required field + ApprovalRuleTemplateContent *string `locationName:"approvalRuleTemplateContent" min:"1" type:"string" required:"true"` + + // The description of the approval rule template. Consider providing a description + // that explains what this template does and when it might be appropriate to + // associate it with repositories. + ApprovalRuleTemplateDescription *string `locationName:"approvalRuleTemplateDescription" type:"string"` + + // The name of the approval rule template. Provide descriptive names, because + // this name is applied to the approval rules created automatically in associated + // repositories. + // + // ApprovalRuleTemplateName is a required field + ApprovalRuleTemplateName *string `locationName:"approvalRuleTemplateName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateApprovalRuleTemplateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateApprovalRuleTemplateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateApprovalRuleTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateApprovalRuleTemplateInput"} + if s.ApprovalRuleTemplateContent == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleTemplateContent")) + } + if s.ApprovalRuleTemplateContent != nil && len(*s.ApprovalRuleTemplateContent) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApprovalRuleTemplateContent", 1)) + } + if s.ApprovalRuleTemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleTemplateName")) + } + if s.ApprovalRuleTemplateName != nil && len(*s.ApprovalRuleTemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApprovalRuleTemplateName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApprovalRuleTemplateContent sets the ApprovalRuleTemplateContent field's value. +func (s *CreateApprovalRuleTemplateInput) SetApprovalRuleTemplateContent(v string) *CreateApprovalRuleTemplateInput { + s.ApprovalRuleTemplateContent = &v + return s +} + +// SetApprovalRuleTemplateDescription sets the ApprovalRuleTemplateDescription field's value. +func (s *CreateApprovalRuleTemplateInput) SetApprovalRuleTemplateDescription(v string) *CreateApprovalRuleTemplateInput { + s.ApprovalRuleTemplateDescription = &v + return s +} + +// SetApprovalRuleTemplateName sets the ApprovalRuleTemplateName field's value. +func (s *CreateApprovalRuleTemplateInput) SetApprovalRuleTemplateName(v string) *CreateApprovalRuleTemplateInput { + s.ApprovalRuleTemplateName = &v + return s +} + +type CreateApprovalRuleTemplateOutput struct { + _ struct{} `type:"structure"` + + // The content and structure of the created approval rule template. + // + // ApprovalRuleTemplate is a required field + ApprovalRuleTemplate *ApprovalRuleTemplate `locationName:"approvalRuleTemplate" type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateApprovalRuleTemplateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateApprovalRuleTemplateOutput) GoString() string { + return s.String() +} + +// SetApprovalRuleTemplate sets the ApprovalRuleTemplate field's value. +func (s *CreateApprovalRuleTemplateOutput) SetApprovalRuleTemplate(v *ApprovalRuleTemplate) *CreateApprovalRuleTemplateOutput { + s.ApprovalRuleTemplate = v + return s +} + +// Represents the input of a create branch operation. +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 +} + +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() +} + +type CreateCommitInput struct { + _ struct{} `type:"structure"` + + // The name of the author who created the commit. This information is used as + // both the author and committer for the commit. + AuthorName *string `locationName:"authorName" type:"string"` + + // The name of the branch where you create the commit. + // + // BranchName is a required field + BranchName *string `locationName:"branchName" min:"1" type:"string" required:"true"` + + // The commit message you want to include in the commit. Commit messages are + // limited to 256 KB. If no message is specified, a default message is used. + CommitMessage *string `locationName:"commitMessage" type:"string"` + + // The files to delete in this commit. These files still exist in earlier commits. + DeleteFiles []*DeleteFileEntry `locationName:"deleteFiles" type:"list"` + + // The email address of the person who created the commit. + Email *string `locationName:"email" type:"string"` + + // If the commit contains deletions, whether to keep a folder or folder structure + // if the changes leave the folders empty. If true, a ..gitkeep file is created + // for empty folders. The default is false. + KeepEmptyFolders *bool `locationName:"keepEmptyFolders" type:"boolean"` + + // The ID of the commit that is the parent of the commit you create. Not required + // if this is an empty repository. + ParentCommitId *string `locationName:"parentCommitId" type:"string"` + + // The files to add or update in this commit. + PutFiles []*PutFileEntry `locationName:"putFiles" type:"list"` + + // The name of the repository where you create the commit. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + + // The file modes to update for files in this commit. + SetFileModes []*SetFileModeEntry `locationName:"setFileModes" type:"list"` +} + +// String returns the string representation +func (s CreateCommitInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCommitInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateCommitInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateCommitInput"} + 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.RepositoryName == nil { + invalidParams.Add(request.NewErrParamRequired("RepositoryName")) + } + if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) + } + if s.DeleteFiles != nil { + for i, v := range s.DeleteFiles { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DeleteFiles", i), err.(request.ErrInvalidParams)) + } + } + } + if s.PutFiles != nil { + for i, v := range s.PutFiles { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PutFiles", i), err.(request.ErrInvalidParams)) + } + } + } + if s.SetFileModes != nil { + for i, v := range s.SetFileModes { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SetFileModes", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuthorName sets the AuthorName field's value. +func (s *CreateCommitInput) SetAuthorName(v string) *CreateCommitInput { + s.AuthorName = &v + return s +} + +// SetBranchName sets the BranchName field's value. +func (s *CreateCommitInput) SetBranchName(v string) *CreateCommitInput { + s.BranchName = &v + return s +} + +// SetCommitMessage sets the CommitMessage field's value. +func (s *CreateCommitInput) SetCommitMessage(v string) *CreateCommitInput { + s.CommitMessage = &v + return s +} + +// SetDeleteFiles sets the DeleteFiles field's value. +func (s *CreateCommitInput) SetDeleteFiles(v []*DeleteFileEntry) *CreateCommitInput { + s.DeleteFiles = v + return s +} + +// SetEmail sets the Email field's value. +func (s *CreateCommitInput) SetEmail(v string) *CreateCommitInput { + s.Email = &v + return s +} + +// SetKeepEmptyFolders sets the KeepEmptyFolders field's value. +func (s *CreateCommitInput) SetKeepEmptyFolders(v bool) *CreateCommitInput { + s.KeepEmptyFolders = &v + return s +} + +// SetParentCommitId sets the ParentCommitId field's value. +func (s *CreateCommitInput) SetParentCommitId(v string) *CreateCommitInput { + s.ParentCommitId = &v + return s +} + +// SetPutFiles sets the PutFiles field's value. +func (s *CreateCommitInput) SetPutFiles(v []*PutFileEntry) *CreateCommitInput { + s.PutFiles = v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *CreateCommitInput) SetRepositoryName(v string) *CreateCommitInput { + s.RepositoryName = &v + return s +} + +// SetSetFileModes sets the SetFileModes field's value. +func (s *CreateCommitInput) SetSetFileModes(v []*SetFileModeEntry) *CreateCommitInput { + s.SetFileModes = v + return s +} + +type CreateCommitOutput struct { + _ struct{} `type:"structure"` + + // The full commit ID of the commit that contains your committed file changes. + CommitId *string `locationName:"commitId" type:"string"` + + // The files added as part of the committed file changes. + FilesAdded []*FileMetadata `locationName:"filesAdded" type:"list"` + + // The files deleted as part of the committed file changes. + FilesDeleted []*FileMetadata `locationName:"filesDeleted" type:"list"` + + // The files updated as part of the commited file changes. + FilesUpdated []*FileMetadata `locationName:"filesUpdated" type:"list"` + + // The full SHA-1 pointer of the tree information for the commit that contains + // the commited file changes. + TreeId *string `locationName:"treeId" type:"string"` +} + +// String returns the string representation +func (s CreateCommitOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCommitOutput) GoString() string { + return s.String() +} + +// SetCommitId sets the CommitId field's value. +func (s *CreateCommitOutput) SetCommitId(v string) *CreateCommitOutput { + s.CommitId = &v + return s +} + +// SetFilesAdded sets the FilesAdded field's value. +func (s *CreateCommitOutput) SetFilesAdded(v []*FileMetadata) *CreateCommitOutput { + s.FilesAdded = v + return s +} + +// SetFilesDeleted sets the FilesDeleted field's value. +func (s *CreateCommitOutput) SetFilesDeleted(v []*FileMetadata) *CreateCommitOutput { + s.FilesDeleted = v + return s +} + +// SetFilesUpdated sets the FilesUpdated field's value. +func (s *CreateCommitOutput) SetFilesUpdated(v []*FileMetadata) *CreateCommitOutput { + s.FilesUpdated = v + return s +} + +// SetTreeId sets the TreeId field's value. +func (s *CreateCommitOutput) SetTreeId(v string) *CreateCommitOutput { + s.TreeId = &v + return s +} + +type CreatePullRequestApprovalRuleInput struct { + _ struct{} `type:"structure"` + + // The content of the approval rule, including the number of approvals needed + // and the structure of an approval pool defined for approvals, if any. For + // more information about approval pools, see the AWS CodeCommit User Guide. + // + // When you create the content of the approval rule, you can specify approvers + // in an approval pool in one of two ways: + // + // * CodeCommitApprovers: This option only requires an AWS account and a + // resource. It can be used for both IAM users and federated access users + // whose name matches the provided resource name. This is a very powerful + // option that offers a great deal of flexibility. For example, if you specify + // the AWS account 123456789012 and Mary_Major, all of the following would + // be counted as approvals coming from that user: An IAM user in the account + // (arn:aws:iam::123456789012:user/Mary_Major) A federated user identified + // in IAM as Mary_Major (arn:aws:sts::123456789012:federated-user/Mary_Major) + // This option does not recognize an active session of someone assuming the + // role of CodeCommitReview with a role session name of Mary_Major (arn:aws:sts::123456789012:assumed-role/CodeCommitReview/Mary_Major) + // unless you include a wildcard (*Mary_Major). + // + // * Fully qualified ARN: This option allows you to specify the fully qualified + // Amazon Resource Name (ARN) of the IAM user or role. + // + // For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers + // (https://docs.aws.amazon.com/iam/latest/UserGuide/reference_identifiers.html) + // in the IAM User Guide. + // + // ApprovalRuleContent is a required field + ApprovalRuleContent *string `locationName:"approvalRuleContent" min:"1" type:"string" required:"true"` + + // The name for the approval rule. + // + // ApprovalRuleName is a required field + ApprovalRuleName *string `locationName:"approvalRuleName" min:"1" type:"string" required:"true"` + + // The system-generated ID of the pull request for which you want to create + // the approval rule. + // + // PullRequestId is a required field + PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreatePullRequestApprovalRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePullRequestApprovalRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreatePullRequestApprovalRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreatePullRequestApprovalRuleInput"} + if s.ApprovalRuleContent == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleContent")) + } + if s.ApprovalRuleContent != nil && len(*s.ApprovalRuleContent) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApprovalRuleContent", 1)) + } + if s.ApprovalRuleName == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleName")) + } + if s.ApprovalRuleName != nil && len(*s.ApprovalRuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApprovalRuleName", 1)) + } + if s.PullRequestId == nil { + invalidParams.Add(request.NewErrParamRequired("PullRequestId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApprovalRuleContent sets the ApprovalRuleContent field's value. +func (s *CreatePullRequestApprovalRuleInput) SetApprovalRuleContent(v string) *CreatePullRequestApprovalRuleInput { + s.ApprovalRuleContent = &v + return s +} + +// SetApprovalRuleName sets the ApprovalRuleName field's value. +func (s *CreatePullRequestApprovalRuleInput) SetApprovalRuleName(v string) *CreatePullRequestApprovalRuleInput { + s.ApprovalRuleName = &v + return s +} + +// SetPullRequestId sets the PullRequestId field's value. +func (s *CreatePullRequestApprovalRuleInput) SetPullRequestId(v string) *CreatePullRequestApprovalRuleInput { + s.PullRequestId = &v + return s +} + +type CreatePullRequestApprovalRuleOutput struct { + _ struct{} `type:"structure"` + + // Information about the created approval rule. + // + // ApprovalRule is a required field + ApprovalRule *ApprovalRule `locationName:"approvalRule" type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreatePullRequestApprovalRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePullRequestApprovalRuleOutput) GoString() string { + return s.String() +} + +// SetApprovalRule sets the ApprovalRule field's value. +func (s *CreatePullRequestApprovalRuleOutput) SetApprovalRule(v *ApprovalRule) *CreatePullRequestApprovalRuleOutput { + s.ApprovalRule = v + return s +} + +type CreatePullRequestInput struct { + _ struct{} `type:"structure"` + + // A unique, client-generated idempotency token that, when provided in a request, + // ensures the request cannot be repeated with a changed parameter. If a request + // is received with the same parameters and a token is included, the request + // returns information about the initial request that used that token. + // + // The AWS SDKs prepopulate client request tokens. If you are using an AWS SDK, + // an idempotency token is created for you. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` + + // A description of the pull request. + Description *string `locationName:"description" type:"string"` + + // The targets for the pull request, including the source of the code to be + // reviewed (the source branch) and the destination where the creator of the + // pull request intends the code to be merged after the pull request is closed + // (the destination branch). + // + // Targets is a required field + Targets []*Target `locationName:"targets" type:"list" required:"true"` + + // The title of the pull request. This title is used to identify the pull request + // to other users in the repository. + // + // Title is a required field + Title *string `locationName:"title" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreatePullRequestInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePullRequestInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreatePullRequestInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreatePullRequestInput"} + if s.Targets == nil { + invalidParams.Add(request.NewErrParamRequired("Targets")) + } + if s.Title == nil { + invalidParams.Add(request.NewErrParamRequired("Title")) + } + 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 +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *CreatePullRequestInput) SetClientRequestToken(v string) *CreatePullRequestInput { + s.ClientRequestToken = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreatePullRequestInput) SetDescription(v string) *CreatePullRequestInput { + s.Description = &v + return s +} + +// SetTargets sets the Targets field's value. +func (s *CreatePullRequestInput) SetTargets(v []*Target) *CreatePullRequestInput { + s.Targets = v + return s +} + +// SetTitle sets the Title field's value. +func (s *CreatePullRequestInput) SetTitle(v string) *CreatePullRequestInput { + s.Title = &v + return s +} + +type CreatePullRequestOutput struct { + _ struct{} `type:"structure"` + + // Information about the newly created pull request. + // + // PullRequest is a required field + PullRequest *PullRequest `locationName:"pullRequest" type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreatePullRequestOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePullRequestOutput) GoString() string { + return s.String() +} + +// SetPullRequest sets the PullRequest field's value. +func (s *CreatePullRequestOutput) SetPullRequest(v *PullRequest) *CreatePullRequestOutput { + s.PullRequest = v + return s +} + +// Represents the input of a create repository operation. +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 webpage can 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 webpage. + 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. Repository + // names are limited to 100 alphanumeric, dash, and underscore characters, and + // cannot include certain characters. For more information about the limits + // on repository names, see Limits (https://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"` + + // One or more tag key-value pairs to use when tagging this repository. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// 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 +} + +// SetTags sets the Tags field's value. +func (s *CreateRepositoryInput) SetTags(v map[string]*string) *CreateRepositoryInput { + s.Tags = v + return s +} + +// Represents the output of a create repository operation. +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 +} + +type CreateUnreferencedMergeCommitInput struct { + _ struct{} `type:"structure"` + + // The name of the author who created the unreferenced commit. This information + // is used as both the author and committer for the commit. + AuthorName *string `locationName:"authorName" type:"string"` + + // The commit message for the unreferenced commit. + CommitMessage *string `locationName:"commitMessage" type:"string"` + + // The level of conflict detail to use. If unspecified, the default FILE_LEVEL + // is used, which returns a not-mergeable result if the same file has differences + // in both branches. If LINE_LEVEL is specified, a conflict is considered not + // mergeable if the same file in both branches has differences on the same line. + ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` + + // If AUTOMERGE is the conflict resolution strategy, a list of inputs to use + // when resolving conflicts during a merge. + ConflictResolution *ConflictResolution `locationName:"conflictResolution" type:"structure"` + + // Specifies which branch to use when resolving conflicts, or whether to attempt + // automatically merging two versions of a file. The default is NONE, which + // requires any conflicts to be resolved manually before the merge operation + // is successful. + ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` + + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). + // + // DestinationCommitSpecifier is a required field + DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` + + // The email address for the person who created the unreferenced commit. + Email *string `locationName:"email" type:"string"` + + // If the commit contains deletions, whether to keep a folder or folder structure + // if the changes leave the folders empty. If this is specified as true, a .gitkeep + // file is created for empty folders. The default is false. + KeepEmptyFolders *bool `locationName:"keepEmptyFolders" type:"boolean"` + + // The merge option or strategy you want to use to merge the code. + // + // MergeOption is a required field + MergeOption *string `locationName:"mergeOption" type:"string" required:"true" enum:"MergeOptionTypeEnum"` + + // The name of the repository where you want to create the unreferenced merge + // commit. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). + // + // SourceCommitSpecifier is a required field + SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateUnreferencedMergeCommitInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateUnreferencedMergeCommitInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateUnreferencedMergeCommitInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateUnreferencedMergeCommitInput"} + if s.DestinationCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) + } + if s.MergeOption == nil { + invalidParams.Add(request.NewErrParamRequired("MergeOption")) + } + 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.SourceCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) + } + if s.ConflictResolution != nil { + if err := s.ConflictResolution.Validate(); err != nil { + invalidParams.AddNested("ConflictResolution", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuthorName sets the AuthorName field's value. +func (s *CreateUnreferencedMergeCommitInput) SetAuthorName(v string) *CreateUnreferencedMergeCommitInput { + s.AuthorName = &v + return s +} + +// SetCommitMessage sets the CommitMessage field's value. +func (s *CreateUnreferencedMergeCommitInput) SetCommitMessage(v string) *CreateUnreferencedMergeCommitInput { + s.CommitMessage = &v + return s +} + +// SetConflictDetailLevel sets the ConflictDetailLevel field's value. +func (s *CreateUnreferencedMergeCommitInput) SetConflictDetailLevel(v string) *CreateUnreferencedMergeCommitInput { + s.ConflictDetailLevel = &v + return s +} + +// SetConflictResolution sets the ConflictResolution field's value. +func (s *CreateUnreferencedMergeCommitInput) SetConflictResolution(v *ConflictResolution) *CreateUnreferencedMergeCommitInput { + s.ConflictResolution = v + return s +} + +// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. +func (s *CreateUnreferencedMergeCommitInput) SetConflictResolutionStrategy(v string) *CreateUnreferencedMergeCommitInput { + s.ConflictResolutionStrategy = &v + return s +} + +// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. +func (s *CreateUnreferencedMergeCommitInput) SetDestinationCommitSpecifier(v string) *CreateUnreferencedMergeCommitInput { + s.DestinationCommitSpecifier = &v + return s +} + +// SetEmail sets the Email field's value. +func (s *CreateUnreferencedMergeCommitInput) SetEmail(v string) *CreateUnreferencedMergeCommitInput { + s.Email = &v + return s +} + +// SetKeepEmptyFolders sets the KeepEmptyFolders field's value. +func (s *CreateUnreferencedMergeCommitInput) SetKeepEmptyFolders(v bool) *CreateUnreferencedMergeCommitInput { + s.KeepEmptyFolders = &v + return s +} + +// SetMergeOption sets the MergeOption field's value. +func (s *CreateUnreferencedMergeCommitInput) SetMergeOption(v string) *CreateUnreferencedMergeCommitInput { + s.MergeOption = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *CreateUnreferencedMergeCommitInput) SetRepositoryName(v string) *CreateUnreferencedMergeCommitInput { + s.RepositoryName = &v + return s +} + +// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. +func (s *CreateUnreferencedMergeCommitInput) SetSourceCommitSpecifier(v string) *CreateUnreferencedMergeCommitInput { + s.SourceCommitSpecifier = &v + return s +} + +type CreateUnreferencedMergeCommitOutput struct { + _ struct{} `type:"structure"` + + // The full commit ID of the commit that contains your merge results. + CommitId *string `locationName:"commitId" type:"string"` + + // The full SHA-1 pointer of the tree information for the commit that contains + // the merge results. + TreeId *string `locationName:"treeId" type:"string"` +} + +// String returns the string representation +func (s CreateUnreferencedMergeCommitOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateUnreferencedMergeCommitOutput) GoString() string { + return s.String() +} + +// SetCommitId sets the CommitId field's value. +func (s *CreateUnreferencedMergeCommitOutput) SetCommitId(v string) *CreateUnreferencedMergeCommitOutput { + s.CommitId = &v + return s +} + +// SetTreeId sets the TreeId field's value. +func (s *CreateUnreferencedMergeCommitOutput) SetTreeId(v string) *CreateUnreferencedMergeCommitOutput { + s.TreeId = &v + return s +} + +// The specified branch is the default branch for the repository, and cannot +// be deleted. To delete this branch, you must first set another branch as the +// default branch. +type DefaultBranchCannotBeDeletedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DefaultBranchCannotBeDeletedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DefaultBranchCannotBeDeletedException) GoString() string { + return s.String() +} + +func newErrorDefaultBranchCannotBeDeletedException(v protocol.ResponseMetadata) error { + return &DefaultBranchCannotBeDeletedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DefaultBranchCannotBeDeletedException) Code() string { + return "DefaultBranchCannotBeDeletedException" +} + +// Message returns the exception's message. +func (s DefaultBranchCannotBeDeletedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DefaultBranchCannotBeDeletedException) OrigErr() error { + return nil +} + +func (s DefaultBranchCannotBeDeletedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DefaultBranchCannotBeDeletedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DefaultBranchCannotBeDeletedException) RequestID() string { + return s.respMetadata.RequestID +} + +type DeleteApprovalRuleTemplateInput struct { + _ struct{} `type:"structure"` + + // The name of the approval rule template to delete. + // + // ApprovalRuleTemplateName is a required field + ApprovalRuleTemplateName *string `locationName:"approvalRuleTemplateName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteApprovalRuleTemplateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteApprovalRuleTemplateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteApprovalRuleTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteApprovalRuleTemplateInput"} + if s.ApprovalRuleTemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleTemplateName")) + } + if s.ApprovalRuleTemplateName != nil && len(*s.ApprovalRuleTemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApprovalRuleTemplateName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApprovalRuleTemplateName sets the ApprovalRuleTemplateName field's value. +func (s *DeleteApprovalRuleTemplateInput) SetApprovalRuleTemplateName(v string) *DeleteApprovalRuleTemplateInput { + s.ApprovalRuleTemplateName = &v + return s +} + +type DeleteApprovalRuleTemplateOutput struct { + _ struct{} `type:"structure"` + + // The system-generated ID of the deleted approval rule template. If the template + // has been previously deleted, the only response is a 200 OK. + // + // ApprovalRuleTemplateId is a required field + ApprovalRuleTemplateId *string `locationName:"approvalRuleTemplateId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteApprovalRuleTemplateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteApprovalRuleTemplateOutput) GoString() string { + return s.String() +} + +// SetApprovalRuleTemplateId sets the ApprovalRuleTemplateId field's value. +func (s *DeleteApprovalRuleTemplateOutput) SetApprovalRuleTemplateId(v string) *DeleteApprovalRuleTemplateOutput { + s.ApprovalRuleTemplateId = &v + return s +} + +// Represents the input of a delete branch operation. +type DeleteBranchInput struct { + _ struct{} `type:"structure"` + + // The name of the branch to delete. + // + // BranchName is a required field + BranchName *string `locationName:"branchName" min:"1" type:"string" required:"true"` + + // The name of the repository that contains the branch to be deleted. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteBranchInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBranchInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteBranchInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteBranchInput"} + 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.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 *DeleteBranchInput) SetBranchName(v string) *DeleteBranchInput { + s.BranchName = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *DeleteBranchInput) SetRepositoryName(v string) *DeleteBranchInput { + s.RepositoryName = &v + return s +} + +// Represents the output of a delete branch operation. +type DeleteBranchOutput struct { + _ struct{} `type:"structure"` + + // Information about the branch deleted by the operation, including the branch + // name and the commit ID that was the tip of the branch. + DeletedBranch *BranchInfo `locationName:"deletedBranch" type:"structure"` +} + +// String returns the string representation +func (s DeleteBranchOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteBranchOutput) GoString() string { + return s.String() +} + +// SetDeletedBranch sets the DeletedBranch field's value. +func (s *DeleteBranchOutput) SetDeletedBranch(v *BranchInfo) *DeleteBranchOutput { + s.DeletedBranch = v + return s +} + +type DeleteCommentContentInput struct { + _ struct{} `type:"structure"` + + // The unique, system-generated ID of the comment. To get this ID, use GetCommentsForComparedCommit + // or GetCommentsForPullRequest. + // + // CommentId is a required field + CommentId *string `locationName:"commentId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteCommentContentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCommentContentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteCommentContentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteCommentContentInput"} + if s.CommentId == nil { + invalidParams.Add(request.NewErrParamRequired("CommentId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCommentId sets the CommentId field's value. +func (s *DeleteCommentContentInput) SetCommentId(v string) *DeleteCommentContentInput { + s.CommentId = &v + return s +} + +type DeleteCommentContentOutput struct { + _ struct{} `type:"structure"` + + // Information about the comment you just deleted. + Comment *Comment `locationName:"comment" type:"structure"` +} + +// String returns the string representation +func (s DeleteCommentContentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCommentContentOutput) GoString() string { + return s.String() +} + +// SetComment sets the Comment field's value. +func (s *DeleteCommentContentOutput) SetComment(v *Comment) *DeleteCommentContentOutput { + s.Comment = v + return s +} + +// A file that is deleted as part of a commit. +type DeleteFileEntry struct { + _ struct{} `type:"structure"` + + // The full path of the file to be deleted, including the name of the file. + // + // FilePath is a required field + FilePath *string `locationName:"filePath" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteFileEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFileEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteFileEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteFileEntry"} + if s.FilePath == nil { + invalidParams.Add(request.NewErrParamRequired("FilePath")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFilePath sets the FilePath field's value. +func (s *DeleteFileEntry) SetFilePath(v string) *DeleteFileEntry { + s.FilePath = &v + return s +} + +type DeleteFileInput struct { + _ struct{} `type:"structure"` + + // The name of the branch where the commit that deletes the file is made. + // + // BranchName is a required field + BranchName *string `locationName:"branchName" min:"1" type:"string" required:"true"` + + // The commit message you want to include as part of deleting the file. Commit + // messages are limited to 256 KB. If no message is specified, a default message + // is used. + CommitMessage *string `locationName:"commitMessage" type:"string"` + + // The email address for the commit that deletes the file. If no email address + // is specified, the email address is left blank. + Email *string `locationName:"email" type:"string"` + + // The fully qualified path to the file that to be deleted, including the full + // name and extension of that file. For example, /examples/file.md is a fully + // qualified path to a file named file.md in a folder named examples. + // + // FilePath is a required field + FilePath *string `locationName:"filePath" type:"string" required:"true"` + + // If a file is the only object in the folder or directory, specifies whether + // to delete the folder or directory that contains the file. By default, empty + // folders are deleted. This includes empty folders that are part of the directory + // structure. For example, if the path to a file is dir1/dir2/dir3/dir4, and + // dir2 and dir3 are empty, deleting the last file in dir4 also deletes the + // empty folders dir4, dir3, and dir2. + KeepEmptyFolders *bool `locationName:"keepEmptyFolders" type:"boolean"` + + // The name of the author of the commit that deletes the file. If no name is + // specified, the user's ARN is used as the author name and committer name. + Name *string `locationName:"name" type:"string"` + + // The ID of the commit that is the tip of the branch where you want to create + // the commit that deletes the file. This must be the HEAD commit for the branch. + // The commit that deletes the file is created from this commit ID. + // + // ParentCommitId is a required field + ParentCommitId *string `locationName:"parentCommitId" type:"string" required:"true"` + + // The name of the repository that contains the file to delete. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteFileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteFileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteFileInput"} + 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.FilePath == nil { + invalidParams.Add(request.NewErrParamRequired("FilePath")) + } + if s.ParentCommitId == nil { + invalidParams.Add(request.NewErrParamRequired("ParentCommitId")) + } + 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 *DeleteFileInput) SetBranchName(v string) *DeleteFileInput { + s.BranchName = &v + return s +} + +// SetCommitMessage sets the CommitMessage field's value. +func (s *DeleteFileInput) SetCommitMessage(v string) *DeleteFileInput { + s.CommitMessage = &v + return s +} + +// SetEmail sets the Email field's value. +func (s *DeleteFileInput) SetEmail(v string) *DeleteFileInput { + s.Email = &v + return s +} + +// SetFilePath sets the FilePath field's value. +func (s *DeleteFileInput) SetFilePath(v string) *DeleteFileInput { + s.FilePath = &v + return s +} + +// SetKeepEmptyFolders sets the KeepEmptyFolders field's value. +func (s *DeleteFileInput) SetKeepEmptyFolders(v bool) *DeleteFileInput { + s.KeepEmptyFolders = &v + return s +} + +// SetName sets the Name field's value. +func (s *DeleteFileInput) SetName(v string) *DeleteFileInput { + s.Name = &v + return s +} + +// SetParentCommitId sets the ParentCommitId field's value. +func (s *DeleteFileInput) SetParentCommitId(v string) *DeleteFileInput { + s.ParentCommitId = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *DeleteFileInput) SetRepositoryName(v string) *DeleteFileInput { + s.RepositoryName = &v + return s +} + +type DeleteFileOutput struct { + _ struct{} `type:"structure"` + + // The blob ID removed from the tree as part of deleting the file. + // + // BlobId is a required field + BlobId *string `locationName:"blobId" type:"string" required:"true"` + + // The full commit ID of the commit that contains the change that deletes the + // file. + // + // CommitId is a required field + CommitId *string `locationName:"commitId" type:"string" required:"true"` + + // The fully qualified path to the file to be deleted, including the full name + // and extension of that file. + // + // FilePath is a required field + FilePath *string `locationName:"filePath" type:"string" required:"true"` + + // The full SHA-1 pointer of the tree information for the commit that contains + // the delete file change. + // + // TreeId is a required field + TreeId *string `locationName:"treeId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteFileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFileOutput) GoString() string { + return s.String() +} + +// SetBlobId sets the BlobId field's value. +func (s *DeleteFileOutput) SetBlobId(v string) *DeleteFileOutput { + s.BlobId = &v + return s +} + +// SetCommitId sets the CommitId field's value. +func (s *DeleteFileOutput) SetCommitId(v string) *DeleteFileOutput { + s.CommitId = &v + return s +} + +// SetFilePath sets the FilePath field's value. +func (s *DeleteFileOutput) SetFilePath(v string) *DeleteFileOutput { + s.FilePath = &v + return s +} + +// SetTreeId sets the TreeId field's value. +func (s *DeleteFileOutput) SetTreeId(v string) *DeleteFileOutput { + s.TreeId = &v + return s +} + +type DeletePullRequestApprovalRuleInput struct { + _ struct{} `type:"structure"` + + // The name of the approval rule you want to delete. + // + // ApprovalRuleName is a required field + ApprovalRuleName *string `locationName:"approvalRuleName" min:"1" type:"string" required:"true"` + + // The system-generated ID of the pull request that contains the approval rule + // you want to delete. + // + // PullRequestId is a required field + PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeletePullRequestApprovalRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePullRequestApprovalRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeletePullRequestApprovalRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeletePullRequestApprovalRuleInput"} + if s.ApprovalRuleName == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleName")) + } + if s.ApprovalRuleName != nil && len(*s.ApprovalRuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApprovalRuleName", 1)) + } + if s.PullRequestId == nil { + invalidParams.Add(request.NewErrParamRequired("PullRequestId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApprovalRuleName sets the ApprovalRuleName field's value. +func (s *DeletePullRequestApprovalRuleInput) SetApprovalRuleName(v string) *DeletePullRequestApprovalRuleInput { + s.ApprovalRuleName = &v + return s +} + +// SetPullRequestId sets the PullRequestId field's value. +func (s *DeletePullRequestApprovalRuleInput) SetPullRequestId(v string) *DeletePullRequestApprovalRuleInput { + s.PullRequestId = &v + return s +} + +type DeletePullRequestApprovalRuleOutput struct { + _ struct{} `type:"structure"` + + // The ID of the deleted approval rule. + // + // If the approval rule was deleted in an earlier API call, the response is + // 200 OK without content. + // + // ApprovalRuleId is a required field + ApprovalRuleId *string `locationName:"approvalRuleId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeletePullRequestApprovalRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePullRequestApprovalRuleOutput) GoString() string { + return s.String() +} + +// SetApprovalRuleId sets the ApprovalRuleId field's value. +func (s *DeletePullRequestApprovalRuleOutput) SetApprovalRuleId(v string) *DeletePullRequestApprovalRuleOutput { + s.ApprovalRuleId = &v + return s +} + +// Represents the input of a delete repository operation. +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. +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 +} + +type DescribeMergeConflictsInput struct { + _ struct{} `type:"structure"` + + // The level of conflict detail to use. If unspecified, the default FILE_LEVEL + // is used, which returns a not-mergeable result if the same file has differences + // in both branches. If LINE_LEVEL is specified, a conflict is considered not + // mergeable if the same file in both branches has differences on the same line. + ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` + + // Specifies which branch to use when resolving conflicts, or whether to attempt + // automatically merging two versions of a file. The default is NONE, which + // requires any conflicts to be resolved manually before the merge operation + // is successful. + ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` + + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). + // + // DestinationCommitSpecifier is a required field + DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` + + // The path of the target files used to describe the conflicts. + // + // FilePath is a required field + FilePath *string `locationName:"filePath" type:"string" required:"true"` + + // The maximum number of merge hunks to include in the output. + MaxMergeHunks *int64 `locationName:"maxMergeHunks" type:"integer"` + + // The merge option or strategy you want to use to merge the code. + // + // MergeOption is a required field + MergeOption *string `locationName:"mergeOption" type:"string" required:"true" enum:"MergeOptionTypeEnum"` + + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The name of the repository where you want to get information about a merge + // conflict. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). + // + // SourceCommitSpecifier is a required field + SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeMergeConflictsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeMergeConflictsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeMergeConflictsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeMergeConflictsInput"} + if s.DestinationCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) + } + if s.FilePath == nil { + invalidParams.Add(request.NewErrParamRequired("FilePath")) + } + if s.MergeOption == nil { + invalidParams.Add(request.NewErrParamRequired("MergeOption")) + } + 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.SourceCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConflictDetailLevel sets the ConflictDetailLevel field's value. +func (s *DescribeMergeConflictsInput) SetConflictDetailLevel(v string) *DescribeMergeConflictsInput { + s.ConflictDetailLevel = &v + return s +} + +// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. +func (s *DescribeMergeConflictsInput) SetConflictResolutionStrategy(v string) *DescribeMergeConflictsInput { + s.ConflictResolutionStrategy = &v + return s +} + +// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. +func (s *DescribeMergeConflictsInput) SetDestinationCommitSpecifier(v string) *DescribeMergeConflictsInput { + s.DestinationCommitSpecifier = &v + return s +} + +// SetFilePath sets the FilePath field's value. +func (s *DescribeMergeConflictsInput) SetFilePath(v string) *DescribeMergeConflictsInput { + s.FilePath = &v + return s +} + +// SetMaxMergeHunks sets the MaxMergeHunks field's value. +func (s *DescribeMergeConflictsInput) SetMaxMergeHunks(v int64) *DescribeMergeConflictsInput { + s.MaxMergeHunks = &v + return s +} + +// SetMergeOption sets the MergeOption field's value. +func (s *DescribeMergeConflictsInput) SetMergeOption(v string) *DescribeMergeConflictsInput { + s.MergeOption = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeMergeConflictsInput) SetNextToken(v string) *DescribeMergeConflictsInput { + s.NextToken = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *DescribeMergeConflictsInput) SetRepositoryName(v string) *DescribeMergeConflictsInput { + s.RepositoryName = &v + return s +} + +// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. +func (s *DescribeMergeConflictsInput) SetSourceCommitSpecifier(v string) *DescribeMergeConflictsInput { + s.SourceCommitSpecifier = &v + return s +} + +type DescribeMergeConflictsOutput struct { + _ struct{} `type:"structure"` + + // The commit ID of the merge base. + BaseCommitId *string `locationName:"baseCommitId" type:"string"` + + // Contains metadata about the conflicts found in the merge. + // + // ConflictMetadata is a required field + ConflictMetadata *ConflictMetadata `locationName:"conflictMetadata" type:"structure" required:"true"` + + // The commit ID of the destination commit specifier that was used in the merge + // evaluation. + // + // DestinationCommitId is a required field + DestinationCommitId *string `locationName:"destinationCommitId" type:"string" required:"true"` + + // A list of merge hunks of the differences between the files or lines. + // + // MergeHunks is a required field + MergeHunks []*MergeHunk `locationName:"mergeHunks" type:"list" required:"true"` + + // An enumeration token that can be used in a request to return the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The commit ID of the source commit specifier that was used in the merge evaluation. + // + // SourceCommitId is a required field + SourceCommitId *string `locationName:"sourceCommitId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeMergeConflictsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeMergeConflictsOutput) GoString() string { + return s.String() +} + +// SetBaseCommitId sets the BaseCommitId field's value. +func (s *DescribeMergeConflictsOutput) SetBaseCommitId(v string) *DescribeMergeConflictsOutput { + s.BaseCommitId = &v + return s +} + +// SetConflictMetadata sets the ConflictMetadata field's value. +func (s *DescribeMergeConflictsOutput) SetConflictMetadata(v *ConflictMetadata) *DescribeMergeConflictsOutput { + s.ConflictMetadata = v + return s +} + +// SetDestinationCommitId sets the DestinationCommitId field's value. +func (s *DescribeMergeConflictsOutput) SetDestinationCommitId(v string) *DescribeMergeConflictsOutput { + s.DestinationCommitId = &v + return s +} + +// SetMergeHunks sets the MergeHunks field's value. +func (s *DescribeMergeConflictsOutput) SetMergeHunks(v []*MergeHunk) *DescribeMergeConflictsOutput { + s.MergeHunks = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeMergeConflictsOutput) SetNextToken(v string) *DescribeMergeConflictsOutput { + s.NextToken = &v + return s +} + +// SetSourceCommitId sets the SourceCommitId field's value. +func (s *DescribeMergeConflictsOutput) SetSourceCommitId(v string) *DescribeMergeConflictsOutput { + s.SourceCommitId = &v + return s +} + +type DescribePullRequestEventsInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the user whose actions resulted in the + // event. Examples include updating the pull request with more commits or changing + // the status of a pull request. + ActorArn *string `locationName:"actorArn" type:"string"` + + // A non-zero, non-negative integer used to limit the number of returned results. + // The default is 100 events, which is also the maximum number of events that + // can be returned in a result. + MaxResults *int64 `locationName:"maxResults" type:"integer"` + + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` + + // Optional. The pull request event type about which you want to return information. + PullRequestEventType *string `locationName:"pullRequestEventType" type:"string" enum:"PullRequestEventType"` + + // The system-generated ID of the pull request. To get this ID, use ListPullRequests. + // + // PullRequestId is a required field + PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribePullRequestEventsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribePullRequestEventsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribePullRequestEventsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribePullRequestEventsInput"} + if s.PullRequestId == nil { + invalidParams.Add(request.NewErrParamRequired("PullRequestId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetActorArn sets the ActorArn field's value. +func (s *DescribePullRequestEventsInput) SetActorArn(v string) *DescribePullRequestEventsInput { + s.ActorArn = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribePullRequestEventsInput) SetMaxResults(v int64) *DescribePullRequestEventsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribePullRequestEventsInput) SetNextToken(v string) *DescribePullRequestEventsInput { + s.NextToken = &v + return s +} + +// SetPullRequestEventType sets the PullRequestEventType field's value. +func (s *DescribePullRequestEventsInput) SetPullRequestEventType(v string) *DescribePullRequestEventsInput { + s.PullRequestEventType = &v + return s +} + +// SetPullRequestId sets the PullRequestId field's value. +func (s *DescribePullRequestEventsInput) SetPullRequestId(v string) *DescribePullRequestEventsInput { + s.PullRequestId = &v + return s +} + +type DescribePullRequestEventsOutput struct { + _ struct{} `type:"structure"` + + // An enumeration token that can be used in a request to return the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` + + // Information about the pull request events. + // + // PullRequestEvents is a required field + PullRequestEvents []*PullRequestEvent `locationName:"pullRequestEvents" type:"list" required:"true"` +} + +// String returns the string representation +func (s DescribePullRequestEventsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribePullRequestEventsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribePullRequestEventsOutput) SetNextToken(v string) *DescribePullRequestEventsOutput { + s.NextToken = &v + return s +} + +// SetPullRequestEvents sets the PullRequestEvents field's value. +func (s *DescribePullRequestEventsOutput) SetPullRequestEvents(v []*PullRequestEvent) *DescribePullRequestEventsOutput { + s.PullRequestEvents = v + return s +} + +// Returns information about a set of differences for a commit specifier. +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 +} + +// A file cannot be added to the repository because the specified path name +// has the same name as a file that already exists in this repository. Either +// provide a different name for the file, or specify a different path for the +// file. +type DirectoryNameConflictsWithFileNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DirectoryNameConflictsWithFileNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DirectoryNameConflictsWithFileNameException) GoString() string { + return s.String() +} + +func newErrorDirectoryNameConflictsWithFileNameException(v protocol.ResponseMetadata) error { + return &DirectoryNameConflictsWithFileNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DirectoryNameConflictsWithFileNameException) Code() string { + return "DirectoryNameConflictsWithFileNameException" +} + +// Message returns the exception's message. +func (s DirectoryNameConflictsWithFileNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DirectoryNameConflictsWithFileNameException) OrigErr() error { + return nil +} + +func (s DirectoryNameConflictsWithFileNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DirectoryNameConflictsWithFileNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DirectoryNameConflictsWithFileNameException) RequestID() string { + return s.respMetadata.RequestID +} + +type DisassociateApprovalRuleTemplateFromRepositoryInput struct { + _ struct{} `type:"structure"` + + // The name of the approval rule template to disassociate from a specified repository. + // + // ApprovalRuleTemplateName is a required field + ApprovalRuleTemplateName *string `locationName:"approvalRuleTemplateName" min:"1" type:"string" required:"true"` + + // The name of the repository you want to disassociate from the template. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DisassociateApprovalRuleTemplateFromRepositoryInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateApprovalRuleTemplateFromRepositoryInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisassociateApprovalRuleTemplateFromRepositoryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisassociateApprovalRuleTemplateFromRepositoryInput"} + if s.ApprovalRuleTemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleTemplateName")) + } + if s.ApprovalRuleTemplateName != nil && len(*s.ApprovalRuleTemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApprovalRuleTemplateName", 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 +} + +// SetApprovalRuleTemplateName sets the ApprovalRuleTemplateName field's value. +func (s *DisassociateApprovalRuleTemplateFromRepositoryInput) SetApprovalRuleTemplateName(v string) *DisassociateApprovalRuleTemplateFromRepositoryInput { + s.ApprovalRuleTemplateName = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *DisassociateApprovalRuleTemplateFromRepositoryInput) SetRepositoryName(v string) *DisassociateApprovalRuleTemplateFromRepositoryInput { + s.RepositoryName = &v + return s +} + +type DisassociateApprovalRuleTemplateFromRepositoryOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DisassociateApprovalRuleTemplateFromRepositoryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateApprovalRuleTemplateFromRepositoryOutput) GoString() string { + return s.String() +} + +// An encryption integrity check failed. +type EncryptionIntegrityChecksFailedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s EncryptionIntegrityChecksFailedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EncryptionIntegrityChecksFailedException) GoString() string { + return s.String() +} + +func newErrorEncryptionIntegrityChecksFailedException(v protocol.ResponseMetadata) error { + return &EncryptionIntegrityChecksFailedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EncryptionIntegrityChecksFailedException) Code() string { + return "EncryptionIntegrityChecksFailedException" +} + +// Message returns the exception's message. +func (s EncryptionIntegrityChecksFailedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EncryptionIntegrityChecksFailedException) OrigErr() error { + return nil +} + +func (s EncryptionIntegrityChecksFailedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EncryptionIntegrityChecksFailedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EncryptionIntegrityChecksFailedException) RequestID() string { + return s.respMetadata.RequestID +} + +// An encryption key could not be accessed. +type EncryptionKeyAccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s EncryptionKeyAccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EncryptionKeyAccessDeniedException) GoString() string { + return s.String() +} + +func newErrorEncryptionKeyAccessDeniedException(v protocol.ResponseMetadata) error { + return &EncryptionKeyAccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EncryptionKeyAccessDeniedException) Code() string { + return "EncryptionKeyAccessDeniedException" +} + +// Message returns the exception's message. +func (s EncryptionKeyAccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EncryptionKeyAccessDeniedException) OrigErr() error { + return nil +} + +func (s EncryptionKeyAccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EncryptionKeyAccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EncryptionKeyAccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The encryption key is disabled. +type EncryptionKeyDisabledException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s EncryptionKeyDisabledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EncryptionKeyDisabledException) GoString() string { + return s.String() +} + +func newErrorEncryptionKeyDisabledException(v protocol.ResponseMetadata) error { + return &EncryptionKeyDisabledException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EncryptionKeyDisabledException) Code() string { + return "EncryptionKeyDisabledException" +} + +// Message returns the exception's message. +func (s EncryptionKeyDisabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EncryptionKeyDisabledException) OrigErr() error { + return nil +} + +func (s EncryptionKeyDisabledException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EncryptionKeyDisabledException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EncryptionKeyDisabledException) RequestID() string { + return s.respMetadata.RequestID +} + +// No encryption key was found. +type EncryptionKeyNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s EncryptionKeyNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EncryptionKeyNotFoundException) GoString() string { + return s.String() +} + +func newErrorEncryptionKeyNotFoundException(v protocol.ResponseMetadata) error { + return &EncryptionKeyNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EncryptionKeyNotFoundException) Code() string { + return "EncryptionKeyNotFoundException" +} + +// Message returns the exception's message. +func (s EncryptionKeyNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EncryptionKeyNotFoundException) OrigErr() error { + return nil +} + +func (s EncryptionKeyNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EncryptionKeyNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EncryptionKeyNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The encryption key is not available. +type EncryptionKeyUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s EncryptionKeyUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EncryptionKeyUnavailableException) GoString() string { + return s.String() +} + +func newErrorEncryptionKeyUnavailableException(v protocol.ResponseMetadata) error { + return &EncryptionKeyUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EncryptionKeyUnavailableException) Code() string { + return "EncryptionKeyUnavailableException" +} + +// Message returns the exception's message. +func (s EncryptionKeyUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EncryptionKeyUnavailableException) OrigErr() error { + return nil +} + +func (s EncryptionKeyUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EncryptionKeyUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EncryptionKeyUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + +type EvaluatePullRequestApprovalRulesInput struct { + _ struct{} `type:"structure"` + + // The system-generated ID of the pull request you want to evaluate. + // + // PullRequestId is a required field + PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` + + // The system-generated ID for the pull request revision. To retrieve the most + // recent revision ID for a pull request, use GetPullRequest. + // + // RevisionId is a required field + RevisionId *string `locationName:"revisionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s EvaluatePullRequestApprovalRulesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EvaluatePullRequestApprovalRulesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EvaluatePullRequestApprovalRulesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EvaluatePullRequestApprovalRulesInput"} + if s.PullRequestId == nil { + invalidParams.Add(request.NewErrParamRequired("PullRequestId")) + } + if s.RevisionId == nil { + invalidParams.Add(request.NewErrParamRequired("RevisionId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPullRequestId sets the PullRequestId field's value. +func (s *EvaluatePullRequestApprovalRulesInput) SetPullRequestId(v string) *EvaluatePullRequestApprovalRulesInput { + s.PullRequestId = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *EvaluatePullRequestApprovalRulesInput) SetRevisionId(v string) *EvaluatePullRequestApprovalRulesInput { + s.RevisionId = &v + return s +} + +type EvaluatePullRequestApprovalRulesOutput struct { + _ struct{} `type:"structure"` + + // The result of the evaluation, including the names of the rules whose conditions + // have been met (if any), the names of the rules whose conditions have not + // been met (if any), whether the pull request is in the approved state, and + // whether the pull request approval rule has been set aside by an override. + // + // Evaluation is a required field + Evaluation *Evaluation `locationName:"evaluation" type:"structure" required:"true"` +} + +// String returns the string representation +func (s EvaluatePullRequestApprovalRulesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EvaluatePullRequestApprovalRulesOutput) GoString() string { + return s.String() +} + +// SetEvaluation sets the Evaluation field's value. +func (s *EvaluatePullRequestApprovalRulesOutput) SetEvaluation(v *Evaluation) *EvaluatePullRequestApprovalRulesOutput { + s.Evaluation = v + return s +} + +// Returns information about the approval rules applied to a pull request and +// whether conditions have been met. +type Evaluation struct { + _ struct{} `type:"structure"` + + // The names of the approval rules that have not had their conditions met. + ApprovalRulesNotSatisfied []*string `locationName:"approvalRulesNotSatisfied" type:"list"` + + // The names of the approval rules that have had their conditions met. + ApprovalRulesSatisfied []*string `locationName:"approvalRulesSatisfied" type:"list"` + + // Whether the state of the pull request is approved. + Approved *bool `locationName:"approved" type:"boolean"` + + // Whether the approval rule requirements for the pull request have been overridden + // and no longer need to be met. + Overridden *bool `locationName:"overridden" type:"boolean"` +} + +// 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() +} + +// SetApprovalRulesNotSatisfied sets the ApprovalRulesNotSatisfied field's value. +func (s *Evaluation) SetApprovalRulesNotSatisfied(v []*string) *Evaluation { + s.ApprovalRulesNotSatisfied = v + return s +} + +// SetApprovalRulesSatisfied sets the ApprovalRulesSatisfied field's value. +func (s *Evaluation) SetApprovalRulesSatisfied(v []*string) *Evaluation { + s.ApprovalRulesSatisfied = v + return s +} + +// SetApproved sets the Approved field's value. +func (s *Evaluation) SetApproved(v bool) *Evaluation { + s.Approved = &v + return s +} + +// SetOverridden sets the Overridden field's value. +func (s *Evaluation) SetOverridden(v bool) *Evaluation { + s.Overridden = &v + return s +} + +// Returns information about a file in a repository. +type File struct { + _ struct{} `type:"structure"` + + // The fully qualified path to the file in the repository. + AbsolutePath *string `locationName:"absolutePath" type:"string"` + + // The blob ID that contains the file information. + BlobId *string `locationName:"blobId" type:"string"` + + // The extrapolated file mode permissions for the file. Valid values include + // EXECUTABLE and NORMAL. + FileMode *string `locationName:"fileMode" type:"string" enum:"FileModeTypeEnum"` + + // The relative path of the file from the folder where the query originated. + RelativePath *string `locationName:"relativePath" type:"string"` +} + +// String returns the string representation +func (s File) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s File) GoString() string { + return s.String() +} + +// SetAbsolutePath sets the AbsolutePath field's value. +func (s *File) SetAbsolutePath(v string) *File { + s.AbsolutePath = &v + return s +} + +// SetBlobId sets the BlobId field's value. +func (s *File) SetBlobId(v string) *File { + s.BlobId = &v + return s +} + +// SetFileMode sets the FileMode field's value. +func (s *File) SetFileMode(v string) *File { + s.FileMode = &v + return s +} + +// SetRelativePath sets the RelativePath field's value. +func (s *File) SetRelativePath(v string) *File { + s.RelativePath = &v + return s +} + +// The commit cannot be created because both a source file and file content +// have been specified for the same file. You cannot provide both. Either specify +// a source file or provide the file content directly. +type FileContentAndSourceFileSpecifiedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s FileContentAndSourceFileSpecifiedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileContentAndSourceFileSpecifiedException) GoString() string { + return s.String() +} + +func newErrorFileContentAndSourceFileSpecifiedException(v protocol.ResponseMetadata) error { + return &FileContentAndSourceFileSpecifiedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FileContentAndSourceFileSpecifiedException) Code() string { + return "FileContentAndSourceFileSpecifiedException" +} + +// Message returns the exception's message. +func (s FileContentAndSourceFileSpecifiedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FileContentAndSourceFileSpecifiedException) OrigErr() error { + return nil +} + +func (s FileContentAndSourceFileSpecifiedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FileContentAndSourceFileSpecifiedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FileContentAndSourceFileSpecifiedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The file cannot be added because it is empty. Empty files cannot be added +// to the repository with this API. +type FileContentRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s FileContentRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileContentRequiredException) GoString() string { + return s.String() +} + +func newErrorFileContentRequiredException(v protocol.ResponseMetadata) error { + return &FileContentRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FileContentRequiredException) Code() string { + return "FileContentRequiredException" +} + +// Message returns the exception's message. +func (s FileContentRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FileContentRequiredException) OrigErr() error { + return nil +} + +func (s FileContentRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FileContentRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FileContentRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The file cannot be added because it is too large. The maximum file size is +// 6 MB, and the combined file content change size is 7 MB. Consider making +// these changes using a Git client. +type FileContentSizeLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s FileContentSizeLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileContentSizeLimitExceededException) GoString() string { + return s.String() +} + +func newErrorFileContentSizeLimitExceededException(v protocol.ResponseMetadata) error { + return &FileContentSizeLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FileContentSizeLimitExceededException) Code() string { + return "FileContentSizeLimitExceededException" +} + +// Message returns the exception's message. +func (s FileContentSizeLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FileContentSizeLimitExceededException) OrigErr() error { + return nil +} + +func (s FileContentSizeLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FileContentSizeLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FileContentSizeLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified file does not exist. Verify that you have used the correct +// file name, full path, and extension. +type FileDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s FileDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorFileDoesNotExistException(v protocol.ResponseMetadata) error { + return &FileDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FileDoesNotExistException) Code() string { + return "FileDoesNotExistException" +} + +// Message returns the exception's message. +func (s FileDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FileDoesNotExistException) OrigErr() error { + return nil +} + +func (s FileDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FileDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FileDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// The commit cannot be created because no files have been specified as added, +// updated, or changed (PutFile or DeleteFile) for the commit. +type FileEntryRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s FileEntryRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileEntryRequiredException) GoString() string { + return s.String() +} + +func newErrorFileEntryRequiredException(v protocol.ResponseMetadata) error { + return &FileEntryRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FileEntryRequiredException) Code() string { + return "FileEntryRequiredException" +} + +// Message returns the exception's message. +func (s FileEntryRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FileEntryRequiredException) OrigErr() error { + return nil +} + +func (s FileEntryRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FileEntryRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FileEntryRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// A file to be added, updated, or deleted as part of a commit. +type FileMetadata struct { + _ struct{} `type:"structure"` + + // The full path to the file to be added or updated, including the name of the + // file. + AbsolutePath *string `locationName:"absolutePath" type:"string"` + + // The blob ID that contains the file information. + BlobId *string `locationName:"blobId" type:"string"` + + // The extrapolated file mode permissions for the file. Valid values include + // EXECUTABLE and NORMAL. + FileMode *string `locationName:"fileMode" type:"string" enum:"FileModeTypeEnum"` +} + +// String returns the string representation +func (s FileMetadata) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileMetadata) GoString() string { + return s.String() +} + +// SetAbsolutePath sets the AbsolutePath field's value. +func (s *FileMetadata) SetAbsolutePath(v string) *FileMetadata { + s.AbsolutePath = &v + return s +} + +// SetBlobId sets the BlobId field's value. +func (s *FileMetadata) SetBlobId(v string) *FileMetadata { + s.BlobId = &v + return s +} + +// SetFileMode sets the FileMode field's value. +func (s *FileMetadata) SetFileMode(v string) *FileMetadata { + s.FileMode = &v + return s +} + +// The commit cannot be created because no file mode has been specified. A file +// mode is required to update mode permissions for a file. +type FileModeRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s FileModeRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileModeRequiredException) GoString() string { + return s.String() +} + +func newErrorFileModeRequiredException(v protocol.ResponseMetadata) error { + return &FileModeRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FileModeRequiredException) Code() string { + return "FileModeRequiredException" +} + +// Message returns the exception's message. +func (s FileModeRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FileModeRequiredException) OrigErr() error { + return nil +} + +func (s FileModeRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FileModeRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FileModeRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about file modes in a merge or pull request. +type FileModes struct { + _ struct{} `type:"structure"` + + // The file mode of a file in the base of a merge or pull request. + Base *string `locationName:"base" type:"string" enum:"FileModeTypeEnum"` + + // The file mode of a file in the destination of a merge or pull request. + Destination *string `locationName:"destination" type:"string" enum:"FileModeTypeEnum"` + + // The file mode of a file in the source of a merge or pull request. + Source *string `locationName:"source" type:"string" enum:"FileModeTypeEnum"` +} + +// String returns the string representation +func (s FileModes) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileModes) GoString() string { + return s.String() +} + +// SetBase sets the Base field's value. +func (s *FileModes) SetBase(v string) *FileModes { + s.Base = &v + return s +} + +// SetDestination sets the Destination field's value. +func (s *FileModes) SetDestination(v string) *FileModes { + s.Destination = &v + return s +} + +// SetSource sets the Source field's value. +func (s *FileModes) SetSource(v string) *FileModes { + s.Source = &v + return s +} + +// A file cannot be added to the repository because the specified file name +// has the same name as a directory in this repository. Either provide another +// name for the file, or add the file in a directory that does not match the +// file name. +type FileNameConflictsWithDirectoryNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s FileNameConflictsWithDirectoryNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileNameConflictsWithDirectoryNameException) GoString() string { + return s.String() +} + +func newErrorFileNameConflictsWithDirectoryNameException(v protocol.ResponseMetadata) error { + return &FileNameConflictsWithDirectoryNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FileNameConflictsWithDirectoryNameException) Code() string { + return "FileNameConflictsWithDirectoryNameException" +} + +// Message returns the exception's message. +func (s FileNameConflictsWithDirectoryNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FileNameConflictsWithDirectoryNameException) OrigErr() error { + return nil +} + +func (s FileNameConflictsWithDirectoryNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FileNameConflictsWithDirectoryNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FileNameConflictsWithDirectoryNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// The commit cannot be created because a specified file path points to a submodule. +// Verify that the destination files have valid file paths that do not point +// to a submodule. +type FilePathConflictsWithSubmodulePathException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s FilePathConflictsWithSubmodulePathException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FilePathConflictsWithSubmodulePathException) GoString() string { + return s.String() +} + +func newErrorFilePathConflictsWithSubmodulePathException(v protocol.ResponseMetadata) error { + return &FilePathConflictsWithSubmodulePathException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FilePathConflictsWithSubmodulePathException) Code() string { + return "FilePathConflictsWithSubmodulePathException" +} + +// Message returns the exception's message. +func (s FilePathConflictsWithSubmodulePathException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FilePathConflictsWithSubmodulePathException) OrigErr() error { + return nil +} + +func (s FilePathConflictsWithSubmodulePathException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FilePathConflictsWithSubmodulePathException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FilePathConflictsWithSubmodulePathException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about the size of files in a merge or pull request. +type FileSizes struct { + _ struct{} `type:"structure"` + + // The size of a file in the base of a merge or pull request. + Base *int64 `locationName:"base" type:"long"` + + // The size of a file in the destination of a merge or pull request. + Destination *int64 `locationName:"destination" type:"long"` + + // The size of a file in the source of a merge or pull request. + Source *int64 `locationName:"source" type:"long"` +} + +// String returns the string representation +func (s FileSizes) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileSizes) GoString() string { + return s.String() +} + +// SetBase sets the Base field's value. +func (s *FileSizes) SetBase(v int64) *FileSizes { + s.Base = &v + return s +} + +// SetDestination sets the Destination field's value. +func (s *FileSizes) SetDestination(v int64) *FileSizes { + s.Destination = &v + return s +} + +// SetSource sets the Source field's value. +func (s *FileSizes) SetSource(v int64) *FileSizes { + s.Source = &v + return s +} + +// The specified file exceeds the file size limit for AWS CodeCommit. For more +// information about limits in AWS CodeCommit, see AWS CodeCommit User Guide +// (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). +type FileTooLargeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s FileTooLargeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileTooLargeException) GoString() string { + return s.String() +} + +func newErrorFileTooLargeException(v protocol.ResponseMetadata) error { + return &FileTooLargeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FileTooLargeException) Code() string { + return "FileTooLargeException" +} + +// Message returns the exception's message. +func (s FileTooLargeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FileTooLargeException) OrigErr() error { + return nil +} + +func (s FileTooLargeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FileTooLargeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FileTooLargeException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returns information about a folder in a repository. +type Folder struct { + _ struct{} `type:"structure"` + + // The fully qualified path of the folder in the repository. + AbsolutePath *string `locationName:"absolutePath" type:"string"` + + // The relative path of the specified folder from the folder where the query + // originated. + RelativePath *string `locationName:"relativePath" type:"string"` + + // The full SHA-1 pointer of the tree information for the commit that contains + // the folder. + TreeId *string `locationName:"treeId" type:"string"` +} + +// String returns the string representation +func (s Folder) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Folder) GoString() string { + return s.String() +} + +// SetAbsolutePath sets the AbsolutePath field's value. +func (s *Folder) SetAbsolutePath(v string) *Folder { + s.AbsolutePath = &v + return s +} + +// SetRelativePath sets the RelativePath field's value. +func (s *Folder) SetRelativePath(v string) *Folder { + s.RelativePath = &v + return s +} + +// SetTreeId sets the TreeId field's value. +func (s *Folder) SetTreeId(v string) *Folder { + s.TreeId = &v + return s +} + +// The commit cannot be created because at least one of the overall changes +// in the commit results in a folder whose contents exceed the limit of 6 MB. +// Either reduce the number and size of your changes, or split the changes across +// multiple folders. +type FolderContentSizeLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s FolderContentSizeLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FolderContentSizeLimitExceededException) GoString() string { + return s.String() +} + +func newErrorFolderContentSizeLimitExceededException(v protocol.ResponseMetadata) error { + return &FolderContentSizeLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FolderContentSizeLimitExceededException) Code() string { + return "FolderContentSizeLimitExceededException" +} + +// Message returns the exception's message. +func (s FolderContentSizeLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FolderContentSizeLimitExceededException) OrigErr() error { + return nil +} + +func (s FolderContentSizeLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FolderContentSizeLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FolderContentSizeLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified folder does not exist. Either the folder name is not correct, +// or you did not enter the full path to the folder. +type FolderDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s FolderDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FolderDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorFolderDoesNotExistException(v protocol.ResponseMetadata) error { + return &FolderDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FolderDoesNotExistException) Code() string { + return "FolderDoesNotExistException" +} + +// Message returns the exception's message. +func (s FolderDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FolderDoesNotExistException) OrigErr() error { + return nil +} + +func (s FolderDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FolderDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FolderDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +type GetApprovalRuleTemplateInput struct { + _ struct{} `type:"structure"` + + // The name of the approval rule template for which you want to get information. + // + // ApprovalRuleTemplateName is a required field + ApprovalRuleTemplateName *string `locationName:"approvalRuleTemplateName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetApprovalRuleTemplateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetApprovalRuleTemplateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetApprovalRuleTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetApprovalRuleTemplateInput"} + if s.ApprovalRuleTemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleTemplateName")) + } + if s.ApprovalRuleTemplateName != nil && len(*s.ApprovalRuleTemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApprovalRuleTemplateName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApprovalRuleTemplateName sets the ApprovalRuleTemplateName field's value. +func (s *GetApprovalRuleTemplateInput) SetApprovalRuleTemplateName(v string) *GetApprovalRuleTemplateInput { + s.ApprovalRuleTemplateName = &v + return s +} + +type GetApprovalRuleTemplateOutput struct { + _ struct{} `type:"structure"` + + // The content and structure of the approval rule template. + // + // ApprovalRuleTemplate is a required field + ApprovalRuleTemplate *ApprovalRuleTemplate `locationName:"approvalRuleTemplate" type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetApprovalRuleTemplateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetApprovalRuleTemplateOutput) GoString() string { + return s.String() +} + +// SetApprovalRuleTemplate sets the ApprovalRuleTemplate field's value. +func (s *GetApprovalRuleTemplateOutput) SetApprovalRuleTemplate(v *ApprovalRuleTemplate) *GetApprovalRuleTemplateOutput { + s.ApprovalRuleTemplate = v + return s +} + +// Represents the input of a get blob operation. +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. +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. +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. +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 +} + +type GetCommentInput struct { + _ struct{} `type:"structure"` + + // The unique, system-generated ID of the comment. To get this ID, use GetCommentsForComparedCommit + // or GetCommentsForPullRequest. + // + // CommentId is a required field + CommentId *string `locationName:"commentId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetCommentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCommentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetCommentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetCommentInput"} + if s.CommentId == nil { + invalidParams.Add(request.NewErrParamRequired("CommentId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCommentId sets the CommentId field's value. +func (s *GetCommentInput) SetCommentId(v string) *GetCommentInput { + s.CommentId = &v + return s +} + +type GetCommentOutput struct { + _ struct{} `type:"structure"` + + // The contents of the comment. + Comment *Comment `locationName:"comment" type:"structure"` +} + +// String returns the string representation +func (s GetCommentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCommentOutput) GoString() string { + return s.String() +} + +// SetComment sets the Comment field's value. +func (s *GetCommentOutput) SetComment(v *Comment) *GetCommentOutput { + s.Comment = v + return s +} + +type GetCommentsForComparedCommitInput struct { + _ struct{} `type:"structure"` + + // To establish the directionality of the comparison, the full commit ID of + // the after commit. + // + // AfterCommitId is a required field + AfterCommitId *string `locationName:"afterCommitId" type:"string" required:"true"` + + // To establish the directionality of the comparison, the full commit ID of + // the before commit. + BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` + + // A non-zero, non-negative integer used to limit the number of returned results. + // The default is 100 comments, but you can configure up to 500. + MaxResults *int64 `locationName:"maxResults" type:"integer"` + + // An enumeration token that when provided in a request, returns the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The name of the repository where you want to compare commits. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetCommentsForComparedCommitInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCommentsForComparedCommitInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetCommentsForComparedCommitInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetCommentsForComparedCommitInput"} + if s.AfterCommitId == nil { + invalidParams.Add(request.NewErrParamRequired("AfterCommitId")) + } + 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 +} + +// SetAfterCommitId sets the AfterCommitId field's value. +func (s *GetCommentsForComparedCommitInput) SetAfterCommitId(v string) *GetCommentsForComparedCommitInput { + s.AfterCommitId = &v + return s +} + +// SetBeforeCommitId sets the BeforeCommitId field's value. +func (s *GetCommentsForComparedCommitInput) SetBeforeCommitId(v string) *GetCommentsForComparedCommitInput { + s.BeforeCommitId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *GetCommentsForComparedCommitInput) SetMaxResults(v int64) *GetCommentsForComparedCommitInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetCommentsForComparedCommitInput) SetNextToken(v string) *GetCommentsForComparedCommitInput { + s.NextToken = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *GetCommentsForComparedCommitInput) SetRepositoryName(v string) *GetCommentsForComparedCommitInput { + s.RepositoryName = &v + return s +} + +type GetCommentsForComparedCommitOutput struct { + _ struct{} `type:"structure"` + + // A list of comment objects on the compared commit. + CommentsForComparedCommitData []*CommentsForComparedCommit `locationName:"commentsForComparedCommitData" type:"list"` + + // An enumeration token that can be used in a request to return the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s GetCommentsForComparedCommitOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCommentsForComparedCommitOutput) GoString() string { + return s.String() +} + +// SetCommentsForComparedCommitData sets the CommentsForComparedCommitData field's value. +func (s *GetCommentsForComparedCommitOutput) SetCommentsForComparedCommitData(v []*CommentsForComparedCommit) *GetCommentsForComparedCommitOutput { + s.CommentsForComparedCommitData = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetCommentsForComparedCommitOutput) SetNextToken(v string) *GetCommentsForComparedCommitOutput { + s.NextToken = &v + return s +} + +type GetCommentsForPullRequestInput struct { + _ struct{} `type:"structure"` + + // The full commit ID of the commit in the source branch that was the tip of + // the branch at the time the comment was made. + AfterCommitId *string `locationName:"afterCommitId" type:"string"` + + // The full commit ID of the commit in the destination branch that was the tip + // of the branch at the time the pull request was created. + BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` + + // A non-zero, non-negative integer used to limit the number of returned results. + // The default is 100 comments. You can return up to 500 comments with a single + // request. + MaxResults *int64 `locationName:"maxResults" type:"integer"` + + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The system-generated ID of the pull request. To get this ID, use ListPullRequests. + // + // PullRequestId is a required field + PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` + + // The name of the repository that contains the pull request. + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` +} + +// String returns the string representation +func (s GetCommentsForPullRequestInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCommentsForPullRequestInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetCommentsForPullRequestInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetCommentsForPullRequestInput"} + if s.PullRequestId == nil { + invalidParams.Add(request.NewErrParamRequired("PullRequestId")) + } + if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAfterCommitId sets the AfterCommitId field's value. +func (s *GetCommentsForPullRequestInput) SetAfterCommitId(v string) *GetCommentsForPullRequestInput { + s.AfterCommitId = &v + return s +} + +// SetBeforeCommitId sets the BeforeCommitId field's value. +func (s *GetCommentsForPullRequestInput) SetBeforeCommitId(v string) *GetCommentsForPullRequestInput { + s.BeforeCommitId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *GetCommentsForPullRequestInput) SetMaxResults(v int64) *GetCommentsForPullRequestInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetCommentsForPullRequestInput) SetNextToken(v string) *GetCommentsForPullRequestInput { + s.NextToken = &v + return s +} + +// SetPullRequestId sets the PullRequestId field's value. +func (s *GetCommentsForPullRequestInput) SetPullRequestId(v string) *GetCommentsForPullRequestInput { + s.PullRequestId = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *GetCommentsForPullRequestInput) SetRepositoryName(v string) *GetCommentsForPullRequestInput { + s.RepositoryName = &v + return s +} + +type GetCommentsForPullRequestOutput struct { + _ struct{} `type:"structure"` + + // An array of comment objects on the pull request. + CommentsForPullRequestData []*CommentsForPullRequest `locationName:"commentsForPullRequestData" type:"list"` + + // An enumeration token that can be used in a request to return the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s GetCommentsForPullRequestOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCommentsForPullRequestOutput) GoString() string { + return s.String() +} + +// SetCommentsForPullRequestData sets the CommentsForPullRequestData field's value. +func (s *GetCommentsForPullRequestOutput) SetCommentsForPullRequestData(v []*CommentsForPullRequest) *GetCommentsForPullRequestOutput { + s.CommentsForPullRequestData = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetCommentsForPullRequestOutput) SetNextToken(v string) *GetCommentsForPullRequestOutput { + s.NextToken = &v + return s +} + +// Represents the input of a get commit operation. +type GetCommitInput struct { + _ struct{} `type:"structure"` + + // The commit ID. Commit IDs are the full SHA ID of the commit. + // + // 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. +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 +} + +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 are 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 before the afterCommitSpecifier value are 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 are shown for + // all paths. + BeforePath *string `locationName:"beforePath" type:"string"` + + // A non-zero, 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 +} + +type GetDifferencesOutput struct { + _ struct{} `type:"structure"` + + // A 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 +} + +type GetFileInput struct { + _ struct{} `type:"structure"` + + // The fully quaified reference that identifies the commit that contains the + // file. For example, you can specify a full commit ID, a tag, a branch name, + // or a reference such as refs/heads/master. If none is provided, the head commit + // is used. + CommitSpecifier *string `locationName:"commitSpecifier" type:"string"` + + // The fully qualified path to the file, including the full name and extension + // of the file. For example, /examples/file.md is the fully qualified path to + // a file named file.md in a folder named examples. + // + // FilePath is a required field + FilePath *string `locationName:"filePath" type:"string" required:"true"` + + // The name of the repository that contains the file. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetFileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetFileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetFileInput"} + if s.FilePath == nil { + invalidParams.Add(request.NewErrParamRequired("FilePath")) + } + 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 +} + +// SetCommitSpecifier sets the CommitSpecifier field's value. +func (s *GetFileInput) SetCommitSpecifier(v string) *GetFileInput { + s.CommitSpecifier = &v + return s +} + +// SetFilePath sets the FilePath field's value. +func (s *GetFileInput) SetFilePath(v string) *GetFileInput { + s.FilePath = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *GetFileInput) SetRepositoryName(v string) *GetFileInput { + s.RepositoryName = &v + return s +} + +type GetFileOutput struct { + _ struct{} `type:"structure"` + + // The blob ID of the object that represents the file content. + // + // BlobId is a required field + BlobId *string `locationName:"blobId" type:"string" required:"true"` + + // The full commit ID of the commit that contains the content returned by GetFile. + // + // CommitId is a required field + CommitId *string `locationName:"commitId" type:"string" required:"true"` + + // The base-64 encoded binary data object that represents the content of the + // file. + // + // FileContent is automatically base64 encoded/decoded by the SDK. + // + // FileContent is a required field + FileContent []byte `locationName:"fileContent" type:"blob" required:"true"` + + // The extrapolated file mode permissions of the blob. Valid values include + // strings such as EXECUTABLE and not numeric values. + // + // The file mode permissions returned by this API are not the standard file + // mode permission values, such as 100644, but rather extrapolated values. See + // the supported return values. + // + // FileMode is a required field + FileMode *string `locationName:"fileMode" type:"string" required:"true" enum:"FileModeTypeEnum"` + + // The fully qualified path to the specified file. Returns the name and extension + // of the file. + // + // FilePath is a required field + FilePath *string `locationName:"filePath" type:"string" required:"true"` + + // The size of the contents of the file, in bytes. + // + // FileSize is a required field + FileSize *int64 `locationName:"fileSize" type:"long" required:"true"` +} + +// String returns the string representation +func (s GetFileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFileOutput) GoString() string { + return s.String() +} + +// SetBlobId sets the BlobId field's value. +func (s *GetFileOutput) SetBlobId(v string) *GetFileOutput { + s.BlobId = &v + return s +} + +// SetCommitId sets the CommitId field's value. +func (s *GetFileOutput) SetCommitId(v string) *GetFileOutput { + s.CommitId = &v + return s +} + +// SetFileContent sets the FileContent field's value. +func (s *GetFileOutput) SetFileContent(v []byte) *GetFileOutput { + s.FileContent = v + return s +} + +// SetFileMode sets the FileMode field's value. +func (s *GetFileOutput) SetFileMode(v string) *GetFileOutput { + s.FileMode = &v + return s +} + +// SetFilePath sets the FilePath field's value. +func (s *GetFileOutput) SetFilePath(v string) *GetFileOutput { + s.FilePath = &v + return s +} + +// SetFileSize sets the FileSize field's value. +func (s *GetFileOutput) SetFileSize(v int64) *GetFileOutput { + s.FileSize = &v + return s +} + +type GetFolderInput struct { + _ struct{} `type:"structure"` + + // A fully qualified reference used to identify a commit that contains the version + // of the folder's content to return. A fully qualified reference can be a commit + // ID, branch name, tag, or reference such as HEAD. If no specifier is provided, + // the folder content is returned as it exists in the HEAD commit. + CommitSpecifier *string `locationName:"commitSpecifier" type:"string"` + + // The fully qualified path to the folder whose contents are returned, including + // the folder name. For example, /examples is a fully-qualified path to a folder + // named examples that was created off of the root directory (/) of a repository. + // + // FolderPath is a required field + FolderPath *string `locationName:"folderPath" type:"string" required:"true"` + + // The name of the repository. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetFolderInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFolderInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetFolderInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetFolderInput"} + if s.FolderPath == nil { + invalidParams.Add(request.NewErrParamRequired("FolderPath")) + } + 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 +} + +// SetCommitSpecifier sets the CommitSpecifier field's value. +func (s *GetFolderInput) SetCommitSpecifier(v string) *GetFolderInput { + s.CommitSpecifier = &v + return s +} + +// SetFolderPath sets the FolderPath field's value. +func (s *GetFolderInput) SetFolderPath(v string) *GetFolderInput { + s.FolderPath = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *GetFolderInput) SetRepositoryName(v string) *GetFolderInput { + s.RepositoryName = &v + return s +} + +type GetFolderOutput struct { + _ struct{} `type:"structure"` + + // The full commit ID used as a reference for the returned version of the folder + // content. + // + // CommitId is a required field + CommitId *string `locationName:"commitId" type:"string" required:"true"` + + // The list of files in the specified folder, if any. + Files []*File `locationName:"files" type:"list"` + + // The fully qualified path of the folder whose contents are returned. + // + // FolderPath is a required field + FolderPath *string `locationName:"folderPath" type:"string" required:"true"` + + // The list of folders that exist under the specified folder, if any. + SubFolders []*Folder `locationName:"subFolders" type:"list"` + + // The list of submodules in the specified folder, if any. + SubModules []*SubModule `locationName:"subModules" type:"list"` + + // The list of symbolic links to other files and folders in the specified folder, + // if any. + SymbolicLinks []*SymbolicLink `locationName:"symbolicLinks" type:"list"` + + // The full SHA-1 pointer of the tree information for the commit that contains + // the folder. + TreeId *string `locationName:"treeId" type:"string"` +} + +// String returns the string representation +func (s GetFolderOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFolderOutput) GoString() string { + return s.String() +} + +// SetCommitId sets the CommitId field's value. +func (s *GetFolderOutput) SetCommitId(v string) *GetFolderOutput { + s.CommitId = &v + return s +} + +// SetFiles sets the Files field's value. +func (s *GetFolderOutput) SetFiles(v []*File) *GetFolderOutput { + s.Files = v + return s +} + +// SetFolderPath sets the FolderPath field's value. +func (s *GetFolderOutput) SetFolderPath(v string) *GetFolderOutput { + s.FolderPath = &v + return s +} + +// SetSubFolders sets the SubFolders field's value. +func (s *GetFolderOutput) SetSubFolders(v []*Folder) *GetFolderOutput { + s.SubFolders = v + return s +} + +// SetSubModules sets the SubModules field's value. +func (s *GetFolderOutput) SetSubModules(v []*SubModule) *GetFolderOutput { + s.SubModules = v + return s +} + +// SetSymbolicLinks sets the SymbolicLinks field's value. +func (s *GetFolderOutput) SetSymbolicLinks(v []*SymbolicLink) *GetFolderOutput { + s.SymbolicLinks = v + return s +} + +// SetTreeId sets the TreeId field's value. +func (s *GetFolderOutput) SetTreeId(v string) *GetFolderOutput { + s.TreeId = &v + return s +} + +type GetMergeCommitInput struct { + _ struct{} `type:"structure"` + + // The level of conflict detail to use. If unspecified, the default FILE_LEVEL + // is used, which returns a not-mergeable result if the same file has differences + // in both branches. If LINE_LEVEL is specified, a conflict is considered not + // mergeable if the same file in both branches has differences on the same line. + ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` + + // Specifies which branch to use when resolving conflicts, or whether to attempt + // automatically merging two versions of a file. The default is NONE, which + // requires any conflicts to be resolved manually before the merge operation + // is successful. + ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` + + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). + // + // DestinationCommitSpecifier is a required field + DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` + + // The name of the repository that contains the merge commit about which you + // want to get information. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). + // + // SourceCommitSpecifier is a required field + SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetMergeCommitInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetMergeCommitInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetMergeCommitInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetMergeCommitInput"} + if s.DestinationCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) + } + 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.SourceCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConflictDetailLevel sets the ConflictDetailLevel field's value. +func (s *GetMergeCommitInput) SetConflictDetailLevel(v string) *GetMergeCommitInput { + s.ConflictDetailLevel = &v + return s +} + +// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. +func (s *GetMergeCommitInput) SetConflictResolutionStrategy(v string) *GetMergeCommitInput { + s.ConflictResolutionStrategy = &v + return s +} + +// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. +func (s *GetMergeCommitInput) SetDestinationCommitSpecifier(v string) *GetMergeCommitInput { + s.DestinationCommitSpecifier = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *GetMergeCommitInput) SetRepositoryName(v string) *GetMergeCommitInput { + s.RepositoryName = &v + return s +} + +// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. +func (s *GetMergeCommitInput) SetSourceCommitSpecifier(v string) *GetMergeCommitInput { + s.SourceCommitSpecifier = &v + return s +} + +type GetMergeCommitOutput struct { + _ struct{} `type:"structure"` + + // The commit ID of the merge base. + BaseCommitId *string `locationName:"baseCommitId" type:"string"` + + // The commit ID of the destination commit specifier that was used in the merge + // evaluation. + DestinationCommitId *string `locationName:"destinationCommitId" type:"string"` + + // The commit ID for the merge commit created when the source branch was merged + // into the destination branch. If the fast-forward merge strategy was used, + // there is no merge commit. + MergedCommitId *string `locationName:"mergedCommitId" type:"string"` + + // The commit ID of the source commit specifier that was used in the merge evaluation. + SourceCommitId *string `locationName:"sourceCommitId" type:"string"` +} + +// String returns the string representation +func (s GetMergeCommitOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetMergeCommitOutput) GoString() string { + return s.String() +} + +// SetBaseCommitId sets the BaseCommitId field's value. +func (s *GetMergeCommitOutput) SetBaseCommitId(v string) *GetMergeCommitOutput { + s.BaseCommitId = &v + return s +} + +// SetDestinationCommitId sets the DestinationCommitId field's value. +func (s *GetMergeCommitOutput) SetDestinationCommitId(v string) *GetMergeCommitOutput { + s.DestinationCommitId = &v + return s +} + +// SetMergedCommitId sets the MergedCommitId field's value. +func (s *GetMergeCommitOutput) SetMergedCommitId(v string) *GetMergeCommitOutput { + s.MergedCommitId = &v + return s +} + +// SetSourceCommitId sets the SourceCommitId field's value. +func (s *GetMergeCommitOutput) SetSourceCommitId(v string) *GetMergeCommitOutput { + s.SourceCommitId = &v + return s +} + +type GetMergeConflictsInput struct { + _ struct{} `type:"structure"` + + // The level of conflict detail to use. If unspecified, the default FILE_LEVEL + // is used, which returns a not-mergeable result if the same file has differences + // in both branches. If LINE_LEVEL is specified, a conflict is considered not + // mergeable if the same file in both branches has differences on the same line. + ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` + + // Specifies which branch to use when resolving conflicts, or whether to attempt + // automatically merging two versions of a file. The default is NONE, which + // requires any conflicts to be resolved manually before the merge operation + // is successful. + ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` + + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). + // + // DestinationCommitSpecifier is a required field + DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` + + // The maximum number of files to include in the output. + MaxConflictFiles *int64 `locationName:"maxConflictFiles" type:"integer"` + + // The merge option or strategy you want to use to merge the code. + // + // MergeOption is a required field + MergeOption *string `locationName:"mergeOption" type:"string" required:"true" enum:"MergeOptionTypeEnum"` + + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The name of the repository where the pull request was created. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). + // + // SourceCommitSpecifier is a required field + SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetMergeConflictsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetMergeConflictsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetMergeConflictsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetMergeConflictsInput"} + if s.DestinationCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) + } + if s.MergeOption == nil { + invalidParams.Add(request.NewErrParamRequired("MergeOption")) + } + 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.SourceCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConflictDetailLevel sets the ConflictDetailLevel field's value. +func (s *GetMergeConflictsInput) SetConflictDetailLevel(v string) *GetMergeConflictsInput { + s.ConflictDetailLevel = &v + return s +} + +// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. +func (s *GetMergeConflictsInput) SetConflictResolutionStrategy(v string) *GetMergeConflictsInput { + s.ConflictResolutionStrategy = &v + return s +} + +// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. +func (s *GetMergeConflictsInput) SetDestinationCommitSpecifier(v string) *GetMergeConflictsInput { + s.DestinationCommitSpecifier = &v + return s +} + +// SetMaxConflictFiles sets the MaxConflictFiles field's value. +func (s *GetMergeConflictsInput) SetMaxConflictFiles(v int64) *GetMergeConflictsInput { + s.MaxConflictFiles = &v + return s +} + +// SetMergeOption sets the MergeOption field's value. +func (s *GetMergeConflictsInput) SetMergeOption(v string) *GetMergeConflictsInput { + s.MergeOption = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetMergeConflictsInput) SetNextToken(v string) *GetMergeConflictsInput { + s.NextToken = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *GetMergeConflictsInput) SetRepositoryName(v string) *GetMergeConflictsInput { + s.RepositoryName = &v + return s +} + +// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. +func (s *GetMergeConflictsInput) SetSourceCommitSpecifier(v string) *GetMergeConflictsInput { + s.SourceCommitSpecifier = &v + return s +} + +type GetMergeConflictsOutput struct { + _ struct{} `type:"structure"` + + // The commit ID of the merge base. + BaseCommitId *string `locationName:"baseCommitId" type:"string"` + + // A list of metadata for any conflicting files. If the specified merge strategy + // is FAST_FORWARD_MERGE, this list is always empty. + // + // ConflictMetadataList is a required field + ConflictMetadataList []*ConflictMetadata `locationName:"conflictMetadataList" type:"list" required:"true"` + + // The commit ID of the destination commit specifier that was used in the merge + // evaluation. + // + // DestinationCommitId is a required field + DestinationCommitId *string `locationName:"destinationCommitId" type:"string" required:"true"` + + // A Boolean value that indicates whether the code is mergeable by the specified + // merge option. + // + // Mergeable is a required field + Mergeable *bool `locationName:"mergeable" type:"boolean" required:"true"` + + // An enumeration token that can be used in a request to return the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The commit ID of the source commit specifier that was used in the merge evaluation. + // + // SourceCommitId is a required field + SourceCommitId *string `locationName:"sourceCommitId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetMergeConflictsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetMergeConflictsOutput) GoString() string { + return s.String() +} + +// SetBaseCommitId sets the BaseCommitId field's value. +func (s *GetMergeConflictsOutput) SetBaseCommitId(v string) *GetMergeConflictsOutput { + s.BaseCommitId = &v + return s +} + +// SetConflictMetadataList sets the ConflictMetadataList field's value. +func (s *GetMergeConflictsOutput) SetConflictMetadataList(v []*ConflictMetadata) *GetMergeConflictsOutput { + s.ConflictMetadataList = v + return s +} + +// SetDestinationCommitId sets the DestinationCommitId field's value. +func (s *GetMergeConflictsOutput) SetDestinationCommitId(v string) *GetMergeConflictsOutput { + s.DestinationCommitId = &v + return s +} + +// SetMergeable sets the Mergeable field's value. +func (s *GetMergeConflictsOutput) SetMergeable(v bool) *GetMergeConflictsOutput { + s.Mergeable = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetMergeConflictsOutput) SetNextToken(v string) *GetMergeConflictsOutput { + s.NextToken = &v + return s +} + +// SetSourceCommitId sets the SourceCommitId field's value. +func (s *GetMergeConflictsOutput) SetSourceCommitId(v string) *GetMergeConflictsOutput { + s.SourceCommitId = &v + return s +} + +type GetMergeOptionsInput struct { + _ struct{} `type:"structure"` + + // The level of conflict detail to use. If unspecified, the default FILE_LEVEL + // is used, which returns a not-mergeable result if the same file has differences + // in both branches. If LINE_LEVEL is specified, a conflict is considered not + // mergeable if the same file in both branches has differences on the same line. + ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` + + // Specifies which branch to use when resolving conflicts, or whether to attempt + // automatically merging two versions of a file. The default is NONE, which + // requires any conflicts to be resolved manually before the merge operation + // is successful. + ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` + + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). + // + // DestinationCommitSpecifier is a required field + DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` + + // The name of the repository that contains the commits about which you want + // to get merge options. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). + // + // SourceCommitSpecifier is a required field + SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetMergeOptionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetMergeOptionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetMergeOptionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetMergeOptionsInput"} + if s.DestinationCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) + } + 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.SourceCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConflictDetailLevel sets the ConflictDetailLevel field's value. +func (s *GetMergeOptionsInput) SetConflictDetailLevel(v string) *GetMergeOptionsInput { + s.ConflictDetailLevel = &v + return s +} + +// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. +func (s *GetMergeOptionsInput) SetConflictResolutionStrategy(v string) *GetMergeOptionsInput { + s.ConflictResolutionStrategy = &v + return s +} + +// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. +func (s *GetMergeOptionsInput) SetDestinationCommitSpecifier(v string) *GetMergeOptionsInput { + s.DestinationCommitSpecifier = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *GetMergeOptionsInput) SetRepositoryName(v string) *GetMergeOptionsInput { + s.RepositoryName = &v + return s +} + +// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. +func (s *GetMergeOptionsInput) SetSourceCommitSpecifier(v string) *GetMergeOptionsInput { + s.SourceCommitSpecifier = &v + return s +} + +type GetMergeOptionsOutput struct { + _ struct{} `type:"structure"` + + // The commit ID of the merge base. + // + // BaseCommitId is a required field + BaseCommitId *string `locationName:"baseCommitId" type:"string" required:"true"` + + // The commit ID of the destination commit specifier that was used in the merge + // evaluation. + // + // DestinationCommitId is a required field + DestinationCommitId *string `locationName:"destinationCommitId" type:"string" required:"true"` + + // The merge option or strategy used to merge the code. + // + // MergeOptions is a required field + MergeOptions []*string `locationName:"mergeOptions" type:"list" required:"true"` + + // The commit ID of the source commit specifier that was used in the merge evaluation. + // + // SourceCommitId is a required field + SourceCommitId *string `locationName:"sourceCommitId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetMergeOptionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetMergeOptionsOutput) GoString() string { + return s.String() +} + +// SetBaseCommitId sets the BaseCommitId field's value. +func (s *GetMergeOptionsOutput) SetBaseCommitId(v string) *GetMergeOptionsOutput { + s.BaseCommitId = &v + return s +} + +// SetDestinationCommitId sets the DestinationCommitId field's value. +func (s *GetMergeOptionsOutput) SetDestinationCommitId(v string) *GetMergeOptionsOutput { + s.DestinationCommitId = &v + return s +} + +// SetMergeOptions sets the MergeOptions field's value. +func (s *GetMergeOptionsOutput) SetMergeOptions(v []*string) *GetMergeOptionsOutput { + s.MergeOptions = v + return s +} + +// SetSourceCommitId sets the SourceCommitId field's value. +func (s *GetMergeOptionsOutput) SetSourceCommitId(v string) *GetMergeOptionsOutput { + s.SourceCommitId = &v + return s +} + +type GetPullRequestApprovalStatesInput struct { + _ struct{} `type:"structure"` + + // The system-generated ID for the pull request. + // + // PullRequestId is a required field + PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` + + // The system-generated ID for the pull request revision. + // + // RevisionId is a required field + RevisionId *string `locationName:"revisionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetPullRequestApprovalStatesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPullRequestApprovalStatesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetPullRequestApprovalStatesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetPullRequestApprovalStatesInput"} + if s.PullRequestId == nil { + invalidParams.Add(request.NewErrParamRequired("PullRequestId")) + } + if s.RevisionId == nil { + invalidParams.Add(request.NewErrParamRequired("RevisionId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPullRequestId sets the PullRequestId field's value. +func (s *GetPullRequestApprovalStatesInput) SetPullRequestId(v string) *GetPullRequestApprovalStatesInput { + s.PullRequestId = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *GetPullRequestApprovalStatesInput) SetRevisionId(v string) *GetPullRequestApprovalStatesInput { + s.RevisionId = &v + return s +} + +type GetPullRequestApprovalStatesOutput struct { + _ struct{} `type:"structure"` + + // Information about users who have approved the pull request. + Approvals []*Approval `locationName:"approvals" type:"list"` +} + +// String returns the string representation +func (s GetPullRequestApprovalStatesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPullRequestApprovalStatesOutput) GoString() string { + return s.String() +} + +// SetApprovals sets the Approvals field's value. +func (s *GetPullRequestApprovalStatesOutput) SetApprovals(v []*Approval) *GetPullRequestApprovalStatesOutput { + s.Approvals = v + return s +} + +type GetPullRequestInput struct { + _ struct{} `type:"structure"` + + // The system-generated ID of the pull request. To get this ID, use ListPullRequests. + // + // PullRequestId is a required field + PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetPullRequestInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPullRequestInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetPullRequestInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetPullRequestInput"} + if s.PullRequestId == nil { + invalidParams.Add(request.NewErrParamRequired("PullRequestId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPullRequestId sets the PullRequestId field's value. +func (s *GetPullRequestInput) SetPullRequestId(v string) *GetPullRequestInput { + s.PullRequestId = &v + return s +} + +type GetPullRequestOutput struct { + _ struct{} `type:"structure"` + + // Information about the specified pull request. + // + // PullRequest is a required field + PullRequest *PullRequest `locationName:"pullRequest" type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetPullRequestOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPullRequestOutput) GoString() string { + return s.String() +} + +// SetPullRequest sets the PullRequest field's value. +func (s *GetPullRequestOutput) SetPullRequest(v *PullRequest) *GetPullRequestOutput { + s.PullRequest = v + return s +} + +type GetPullRequestOverrideStateInput struct { + _ struct{} `type:"structure"` + + // The ID of the pull request for which you want to get information about whether + // approval rules have been set aside (overridden). + // + // PullRequestId is a required field + PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` + + // The system-generated ID of the revision for the pull request. To retrieve + // the most recent revision ID, use GetPullRequest. + // + // RevisionId is a required field + RevisionId *string `locationName:"revisionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetPullRequestOverrideStateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPullRequestOverrideStateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetPullRequestOverrideStateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetPullRequestOverrideStateInput"} + if s.PullRequestId == nil { + invalidParams.Add(request.NewErrParamRequired("PullRequestId")) + } + if s.RevisionId == nil { + invalidParams.Add(request.NewErrParamRequired("RevisionId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPullRequestId sets the PullRequestId field's value. +func (s *GetPullRequestOverrideStateInput) SetPullRequestId(v string) *GetPullRequestOverrideStateInput { + s.PullRequestId = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *GetPullRequestOverrideStateInput) SetRevisionId(v string) *GetPullRequestOverrideStateInput { + s.RevisionId = &v + return s +} + +type GetPullRequestOverrideStateOutput struct { + _ struct{} `type:"structure"` + + // A Boolean value that indicates whether a pull request has had its rules set + // aside (TRUE) or whether all approval rules still apply (FALSE). + Overridden *bool `locationName:"overridden" type:"boolean"` + + // The Amazon Resource Name (ARN) of the user or identity that overrode the + // rules and their requirements for the pull request. + Overrider *string `locationName:"overrider" type:"string"` +} + +// String returns the string representation +func (s GetPullRequestOverrideStateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPullRequestOverrideStateOutput) GoString() string { + return s.String() +} + +// SetOverridden sets the Overridden field's value. +func (s *GetPullRequestOverrideStateOutput) SetOverridden(v bool) *GetPullRequestOverrideStateOutput { + s.Overridden = &v + return s +} + +// SetOverrider sets the Overrider field's value. +func (s *GetPullRequestOverrideStateOutput) SetOverrider(v string) *GetPullRequestOverrideStateOutput { + s.Overrider = &v + return s +} + +// Represents the input of a get repository operation. +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. +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. +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. +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 +} + +// The client request token is not valid. Either the token is not in a valid +// format, or the token has been used in a previous request and cannot be reused. +type IdempotencyParameterMismatchException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s IdempotencyParameterMismatchException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IdempotencyParameterMismatchException) GoString() string { + return s.String() +} + +func newErrorIdempotencyParameterMismatchException(v protocol.ResponseMetadata) error { + return &IdempotencyParameterMismatchException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IdempotencyParameterMismatchException) Code() string { + return "IdempotencyParameterMismatchException" +} + +// Message returns the exception's message. +func (s IdempotencyParameterMismatchException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IdempotencyParameterMismatchException) OrigErr() error { + return nil +} + +func (s IdempotencyParameterMismatchException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IdempotencyParameterMismatchException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IdempotencyParameterMismatchException) RequestID() string { + return s.respMetadata.RequestID +} + +// The Amazon Resource Name (ARN) is not valid. Make sure that you have provided +// the full ARN for the user who initiated the change for the pull request, +// and then try again. +type InvalidActorArnException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidActorArnException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidActorArnException) GoString() string { + return s.String() +} + +func newErrorInvalidActorArnException(v protocol.ResponseMetadata) error { + return &InvalidActorArnException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidActorArnException) Code() string { + return "InvalidActorArnException" +} + +// Message returns the exception's message. +func (s InvalidActorArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidActorArnException) OrigErr() error { + return nil +} + +func (s InvalidActorArnException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidActorArnException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidActorArnException) RequestID() string { + return s.respMetadata.RequestID +} + +// The content for the approval rule is not valid. +type InvalidApprovalRuleContentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidApprovalRuleContentException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidApprovalRuleContentException) GoString() string { + return s.String() +} + +func newErrorInvalidApprovalRuleContentException(v protocol.ResponseMetadata) error { + return &InvalidApprovalRuleContentException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidApprovalRuleContentException) Code() string { + return "InvalidApprovalRuleContentException" +} + +// Message returns the exception's message. +func (s InvalidApprovalRuleContentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidApprovalRuleContentException) OrigErr() error { + return nil +} + +func (s InvalidApprovalRuleContentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidApprovalRuleContentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidApprovalRuleContentException) RequestID() string { + return s.respMetadata.RequestID +} + +// The name for the approval rule is not valid. +type InvalidApprovalRuleNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidApprovalRuleNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidApprovalRuleNameException) GoString() string { + return s.String() +} + +func newErrorInvalidApprovalRuleNameException(v protocol.ResponseMetadata) error { + return &InvalidApprovalRuleNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidApprovalRuleNameException) Code() string { + return "InvalidApprovalRuleNameException" +} + +// Message returns the exception's message. +func (s InvalidApprovalRuleNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidApprovalRuleNameException) OrigErr() error { + return nil +} + +func (s InvalidApprovalRuleNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidApprovalRuleNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidApprovalRuleNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// The content of the approval rule template is not valid. +type InvalidApprovalRuleTemplateContentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidApprovalRuleTemplateContentException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidApprovalRuleTemplateContentException) GoString() string { + return s.String() +} + +func newErrorInvalidApprovalRuleTemplateContentException(v protocol.ResponseMetadata) error { + return &InvalidApprovalRuleTemplateContentException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidApprovalRuleTemplateContentException) Code() string { + return "InvalidApprovalRuleTemplateContentException" +} + +// Message returns the exception's message. +func (s InvalidApprovalRuleTemplateContentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidApprovalRuleTemplateContentException) OrigErr() error { + return nil +} + +func (s InvalidApprovalRuleTemplateContentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidApprovalRuleTemplateContentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidApprovalRuleTemplateContentException) RequestID() string { + return s.respMetadata.RequestID +} + +// The description for the approval rule template is not valid because it exceeds +// the maximum characters allowed for a description. For more information about +// limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). +type InvalidApprovalRuleTemplateDescriptionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidApprovalRuleTemplateDescriptionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidApprovalRuleTemplateDescriptionException) GoString() string { + return s.String() +} + +func newErrorInvalidApprovalRuleTemplateDescriptionException(v protocol.ResponseMetadata) error { + return &InvalidApprovalRuleTemplateDescriptionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidApprovalRuleTemplateDescriptionException) Code() string { + return "InvalidApprovalRuleTemplateDescriptionException" +} + +// Message returns the exception's message. +func (s InvalidApprovalRuleTemplateDescriptionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidApprovalRuleTemplateDescriptionException) OrigErr() error { + return nil +} + +func (s InvalidApprovalRuleTemplateDescriptionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidApprovalRuleTemplateDescriptionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidApprovalRuleTemplateDescriptionException) RequestID() string { + return s.respMetadata.RequestID +} + +// The name of the approval rule template is not valid. Template names must +// be between 1 and 100 valid characters in length. For more information about +// limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). +type InvalidApprovalRuleTemplateNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidApprovalRuleTemplateNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidApprovalRuleTemplateNameException) GoString() string { + return s.String() +} + +func newErrorInvalidApprovalRuleTemplateNameException(v protocol.ResponseMetadata) error { + return &InvalidApprovalRuleTemplateNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidApprovalRuleTemplateNameException) Code() string { + return "InvalidApprovalRuleTemplateNameException" +} + +// Message returns the exception's message. +func (s InvalidApprovalRuleTemplateNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidApprovalRuleTemplateNameException) OrigErr() error { + return nil +} + +func (s InvalidApprovalRuleTemplateNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidApprovalRuleTemplateNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidApprovalRuleTemplateNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// The state for the approval is not valid. Valid values include APPROVE and +// REVOKE. +type InvalidApprovalStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidApprovalStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidApprovalStateException) GoString() string { + return s.String() +} + +func newErrorInvalidApprovalStateException(v protocol.ResponseMetadata) error { + return &InvalidApprovalStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidApprovalStateException) Code() string { + return "InvalidApprovalStateException" +} + +// Message returns the exception's message. +func (s InvalidApprovalStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidApprovalStateException) OrigErr() error { + return nil +} + +func (s InvalidApprovalStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidApprovalStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidApprovalStateException) RequestID() string { + return s.respMetadata.RequestID +} + +// The Amazon Resource Name (ARN) is not valid. Make sure that you have provided +// the full ARN for the author of the pull request, and then try again. +type InvalidAuthorArnException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidAuthorArnException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidAuthorArnException) GoString() string { + return s.String() +} + +func newErrorInvalidAuthorArnException(v protocol.ResponseMetadata) error { + return &InvalidAuthorArnException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidAuthorArnException) Code() string { + return "InvalidAuthorArnException" +} + +// Message returns the exception's message. +func (s InvalidAuthorArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAuthorArnException) OrigErr() error { + return nil +} + +func (s InvalidAuthorArnException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAuthorArnException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAuthorArnException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified blob is not valid. +type InvalidBlobIdException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidBlobIdException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidBlobIdException) GoString() string { + return s.String() +} + +func newErrorInvalidBlobIdException(v protocol.ResponseMetadata) error { + return &InvalidBlobIdException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidBlobIdException) Code() string { + return "InvalidBlobIdException" +} + +// Message returns the exception's message. +func (s InvalidBlobIdException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidBlobIdException) OrigErr() error { + return nil +} + +func (s InvalidBlobIdException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidBlobIdException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidBlobIdException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified reference name is not valid. +type InvalidBranchNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidBranchNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidBranchNameException) GoString() string { + return s.String() +} + +func newErrorInvalidBranchNameException(v protocol.ResponseMetadata) error { + return &InvalidBranchNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidBranchNameException) Code() string { + return "InvalidBranchNameException" +} + +// Message returns the exception's message. +func (s InvalidBranchNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidBranchNameException) OrigErr() error { + return nil +} + +func (s InvalidBranchNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidBranchNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidBranchNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// The client request token is not valid. +type InvalidClientRequestTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidClientRequestTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidClientRequestTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidClientRequestTokenException(v protocol.ResponseMetadata) error { + return &InvalidClientRequestTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidClientRequestTokenException) Code() string { + return "InvalidClientRequestTokenException" +} + +// Message returns the exception's message. +func (s InvalidClientRequestTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidClientRequestTokenException) OrigErr() error { + return nil +} + +func (s InvalidClientRequestTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidClientRequestTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidClientRequestTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// The comment ID is not in a valid format. Make sure that you have provided +// the full comment ID. +type InvalidCommentIdException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidCommentIdException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidCommentIdException) GoString() string { + return s.String() +} + +func newErrorInvalidCommentIdException(v protocol.ResponseMetadata) error { + return &InvalidCommentIdException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidCommentIdException) Code() string { + return "InvalidCommentIdException" +} + +// Message returns the exception's message. +func (s InvalidCommentIdException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidCommentIdException) OrigErr() error { + return nil +} + +func (s InvalidCommentIdException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidCommentIdException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidCommentIdException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified commit is not valid. +type InvalidCommitException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidCommitException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidCommitException) GoString() string { + return s.String() +} + +func newErrorInvalidCommitException(v protocol.ResponseMetadata) error { + return &InvalidCommitException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidCommitException) Code() string { + return "InvalidCommitException" +} + +// Message returns the exception's message. +func (s InvalidCommitException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidCommitException) OrigErr() error { + return nil +} + +func (s InvalidCommitException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidCommitException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidCommitException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified commit ID is not valid. +type InvalidCommitIdException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidCommitIdException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidCommitIdException) GoString() string { + return s.String() +} + +func newErrorInvalidCommitIdException(v protocol.ResponseMetadata) error { + return &InvalidCommitIdException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidCommitIdException) Code() string { + return "InvalidCommitIdException" +} + +// Message returns the exception's message. +func (s InvalidCommitIdException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidCommitIdException) OrigErr() error { + return nil +} + +func (s InvalidCommitIdException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidCommitIdException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidCommitIdException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified conflict detail level is not valid. +type InvalidConflictDetailLevelException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidConflictDetailLevelException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidConflictDetailLevelException) GoString() string { + return s.String() +} + +func newErrorInvalidConflictDetailLevelException(v protocol.ResponseMetadata) error { + return &InvalidConflictDetailLevelException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidConflictDetailLevelException) Code() string { + return "InvalidConflictDetailLevelException" +} + +// Message returns the exception's message. +func (s InvalidConflictDetailLevelException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidConflictDetailLevelException) OrigErr() error { + return nil +} + +func (s InvalidConflictDetailLevelException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidConflictDetailLevelException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidConflictDetailLevelException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified conflict resolution list is not valid. +type InvalidConflictResolutionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidConflictResolutionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidConflictResolutionException) GoString() string { + return s.String() +} + +func newErrorInvalidConflictResolutionException(v protocol.ResponseMetadata) error { + return &InvalidConflictResolutionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidConflictResolutionException) Code() string { + return "InvalidConflictResolutionException" +} + +// Message returns the exception's message. +func (s InvalidConflictResolutionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidConflictResolutionException) OrigErr() error { + return nil +} + +func (s InvalidConflictResolutionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidConflictResolutionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidConflictResolutionException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified conflict resolution strategy is not valid. +type InvalidConflictResolutionStrategyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidConflictResolutionStrategyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidConflictResolutionStrategyException) GoString() string { + return s.String() +} + +func newErrorInvalidConflictResolutionStrategyException(v protocol.ResponseMetadata) error { + return &InvalidConflictResolutionStrategyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidConflictResolutionStrategyException) Code() string { + return "InvalidConflictResolutionStrategyException" +} + +// Message returns the exception's message. +func (s InvalidConflictResolutionStrategyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidConflictResolutionStrategyException) OrigErr() error { + return nil +} + +func (s InvalidConflictResolutionStrategyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidConflictResolutionStrategyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidConflictResolutionStrategyException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified continuation token is not valid. +type InvalidContinuationTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidContinuationTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidContinuationTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidContinuationTokenException(v protocol.ResponseMetadata) error { + return &InvalidContinuationTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidContinuationTokenException) Code() string { + return "InvalidContinuationTokenException" +} + +// Message returns the exception's message. +func (s InvalidContinuationTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidContinuationTokenException) OrigErr() error { + return nil +} + +func (s InvalidContinuationTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidContinuationTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidContinuationTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified deletion parameter is not valid. +type InvalidDeletionParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidDeletionParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDeletionParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidDeletionParameterException(v protocol.ResponseMetadata) error { + return &InvalidDeletionParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDeletionParameterException) Code() string { + return "InvalidDeletionParameterException" +} + +// Message returns the exception's message. +func (s InvalidDeletionParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDeletionParameterException) OrigErr() error { + return nil +} + +func (s InvalidDeletionParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDeletionParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDeletionParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// The pull request description is not valid. Descriptions cannot be more than +// 1,000 characters. +type InvalidDescriptionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidDescriptionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDescriptionException) GoString() string { + return s.String() +} + +func newErrorInvalidDescriptionException(v protocol.ResponseMetadata) error { + return &InvalidDescriptionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDescriptionException) Code() string { + return "InvalidDescriptionException" +} + +// Message returns the exception's message. +func (s InvalidDescriptionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDescriptionException) OrigErr() error { + return nil +} + +func (s InvalidDescriptionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDescriptionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDescriptionException) RequestID() string { + return s.respMetadata.RequestID +} + +// The destination commit specifier is not valid. You must provide a valid branch +// name, tag, or full commit ID. +type InvalidDestinationCommitSpecifierException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidDestinationCommitSpecifierException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDestinationCommitSpecifierException) GoString() string { + return s.String() +} + +func newErrorInvalidDestinationCommitSpecifierException(v protocol.ResponseMetadata) error { + return &InvalidDestinationCommitSpecifierException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDestinationCommitSpecifierException) Code() string { + return "InvalidDestinationCommitSpecifierException" +} + +// Message returns the exception's message. +func (s InvalidDestinationCommitSpecifierException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDestinationCommitSpecifierException) OrigErr() error { + return nil +} + +func (s InvalidDestinationCommitSpecifierException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDestinationCommitSpecifierException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDestinationCommitSpecifierException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified email address either contains one or more characters that are +// not allowed, or it exceeds the maximum number of characters allowed for an +// email address. +type InvalidEmailException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidEmailException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidEmailException) GoString() string { + return s.String() +} + +func newErrorInvalidEmailException(v protocol.ResponseMetadata) error { + return &InvalidEmailException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidEmailException) Code() string { + return "InvalidEmailException" +} + +// Message returns the exception's message. +func (s InvalidEmailException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidEmailException) OrigErr() error { + return nil +} + +func (s InvalidEmailException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidEmailException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidEmailException) RequestID() string { + return s.respMetadata.RequestID +} + +// The location of the file is not valid. Make sure that you include the file +// name and extension. +type InvalidFileLocationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidFileLocationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidFileLocationException) GoString() string { + return s.String() +} + +func newErrorInvalidFileLocationException(v protocol.ResponseMetadata) error { + return &InvalidFileLocationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidFileLocationException) Code() string { + return "InvalidFileLocationException" +} + +// Message returns the exception's message. +func (s InvalidFileLocationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidFileLocationException) OrigErr() error { + return nil +} + +func (s InvalidFileLocationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidFileLocationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidFileLocationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified file mode permission is not valid. For a list of valid file +// mode permissions, see PutFile. +type InvalidFileModeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidFileModeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidFileModeException) GoString() string { + return s.String() +} + +func newErrorInvalidFileModeException(v protocol.ResponseMetadata) error { + return &InvalidFileModeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidFileModeException) Code() string { + return "InvalidFileModeException" +} + +// Message returns the exception's message. +func (s InvalidFileModeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidFileModeException) OrigErr() error { + return nil +} + +func (s InvalidFileModeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidFileModeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidFileModeException) RequestID() string { + return s.respMetadata.RequestID +} + +// The position is not valid. Make sure that the line number exists in the version +// of the file you want to comment on. +type InvalidFilePositionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidFilePositionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidFilePositionException) GoString() string { + return s.String() +} + +func newErrorInvalidFilePositionException(v protocol.ResponseMetadata) error { + return &InvalidFilePositionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidFilePositionException) Code() string { + return "InvalidFilePositionException" +} + +// Message returns the exception's message. +func (s InvalidFilePositionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidFilePositionException) OrigErr() error { + return nil +} + +func (s InvalidFilePositionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidFilePositionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidFilePositionException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified value for the number of conflict files to return is not valid. +type InvalidMaxConflictFilesException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidMaxConflictFilesException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidMaxConflictFilesException) GoString() string { + return s.String() +} + +func newErrorInvalidMaxConflictFilesException(v protocol.ResponseMetadata) error { + return &InvalidMaxConflictFilesException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidMaxConflictFilesException) Code() string { + return "InvalidMaxConflictFilesException" +} + +// Message returns the exception's message. +func (s InvalidMaxConflictFilesException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidMaxConflictFilesException) OrigErr() error { + return nil +} + +func (s InvalidMaxConflictFilesException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidMaxConflictFilesException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidMaxConflictFilesException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified value for the number of merge hunks to return is not valid. +type InvalidMaxMergeHunksException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidMaxMergeHunksException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidMaxMergeHunksException) GoString() string { + return s.String() +} + +func newErrorInvalidMaxMergeHunksException(v protocol.ResponseMetadata) error { + return &InvalidMaxMergeHunksException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidMaxMergeHunksException) Code() string { + return "InvalidMaxMergeHunksException" +} + +// Message returns the exception's message. +func (s InvalidMaxMergeHunksException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidMaxMergeHunksException) OrigErr() error { + return nil +} + +func (s InvalidMaxMergeHunksException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidMaxMergeHunksException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidMaxMergeHunksException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified number of maximum results is not valid. +type InvalidMaxResultsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidMaxResultsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidMaxResultsException) GoString() string { + return s.String() +} + +func newErrorInvalidMaxResultsException(v protocol.ResponseMetadata) error { + return &InvalidMaxResultsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidMaxResultsException) Code() string { + return "InvalidMaxResultsException" +} + +// Message returns the exception's message. +func (s InvalidMaxResultsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidMaxResultsException) OrigErr() error { + return nil +} + +func (s InvalidMaxResultsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidMaxResultsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidMaxResultsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified merge option is not valid for this operation. Not all merge +// strategies are supported for all operations. +type InvalidMergeOptionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidMergeOptionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidMergeOptionException) GoString() string { + return s.String() +} + +func newErrorInvalidMergeOptionException(v protocol.ResponseMetadata) error { + return &InvalidMergeOptionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidMergeOptionException) Code() string { + return "InvalidMergeOptionException" +} + +// Message returns the exception's message. +func (s InvalidMergeOptionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidMergeOptionException) OrigErr() error { + return nil +} + +func (s InvalidMergeOptionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidMergeOptionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidMergeOptionException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified sort order is not valid. +type InvalidOrderException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidOrderException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidOrderException) GoString() string { + return s.String() +} + +func newErrorInvalidOrderException(v protocol.ResponseMetadata) error { + return &InvalidOrderException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidOrderException) Code() string { + return "InvalidOrderException" +} + +// Message returns the exception's message. +func (s InvalidOrderException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidOrderException) OrigErr() error { + return nil +} + +func (s InvalidOrderException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidOrderException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidOrderException) RequestID() string { + return s.respMetadata.RequestID +} + +// The override status is not valid. Valid statuses are OVERRIDE and REVOKE. +type InvalidOverrideStatusException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidOverrideStatusException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidOverrideStatusException) GoString() string { + return s.String() +} + +func newErrorInvalidOverrideStatusException(v protocol.ResponseMetadata) error { + return &InvalidOverrideStatusException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidOverrideStatusException) Code() string { + return "InvalidOverrideStatusException" +} + +// Message returns the exception's message. +func (s InvalidOverrideStatusException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidOverrideStatusException) OrigErr() error { + return nil +} + +func (s InvalidOverrideStatusException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidOverrideStatusException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidOverrideStatusException) RequestID() string { + return s.respMetadata.RequestID +} + +// The parent commit ID is not valid. The commit ID cannot be empty, and must +// match the head commit ID for the branch of the repository where you want +// to add or update a file. +type InvalidParentCommitIdException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParentCommitIdException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParentCommitIdException) GoString() string { + return s.String() +} + +func newErrorInvalidParentCommitIdException(v protocol.ResponseMetadata) error { + return &InvalidParentCommitIdException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParentCommitIdException) Code() string { + return "InvalidParentCommitIdException" +} + +// Message returns the exception's message. +func (s InvalidParentCommitIdException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParentCommitIdException) OrigErr() error { + return nil +} + +func (s InvalidParentCommitIdException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParentCommitIdException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParentCommitIdException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified path is not valid. +type InvalidPathException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidPathException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPathException) GoString() string { + return s.String() +} + +func newErrorInvalidPathException(v protocol.ResponseMetadata) error { + return &InvalidPathException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPathException) Code() string { + return "InvalidPathException" +} + +// Message returns the exception's message. +func (s InvalidPathException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPathException) OrigErr() error { + return nil +} + +func (s InvalidPathException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPathException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPathException) RequestID() string { + return s.respMetadata.RequestID +} + +// The pull request event type is not valid. +type InvalidPullRequestEventTypeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidPullRequestEventTypeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPullRequestEventTypeException) GoString() string { + return s.String() +} + +func newErrorInvalidPullRequestEventTypeException(v protocol.ResponseMetadata) error { + return &InvalidPullRequestEventTypeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPullRequestEventTypeException) Code() string { + return "InvalidPullRequestEventTypeException" +} + +// Message returns the exception's message. +func (s InvalidPullRequestEventTypeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPullRequestEventTypeException) OrigErr() error { + return nil +} + +func (s InvalidPullRequestEventTypeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPullRequestEventTypeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPullRequestEventTypeException) RequestID() string { + return s.respMetadata.RequestID +} + +// The pull request ID is not valid. Make sure that you have provided the full +// ID and that the pull request is in the specified repository, and then try +// again. +type InvalidPullRequestIdException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidPullRequestIdException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPullRequestIdException) GoString() string { + return s.String() +} + +func newErrorInvalidPullRequestIdException(v protocol.ResponseMetadata) error { + return &InvalidPullRequestIdException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPullRequestIdException) Code() string { + return "InvalidPullRequestIdException" +} + +// Message returns the exception's message. +func (s InvalidPullRequestIdException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPullRequestIdException) OrigErr() error { + return nil +} + +func (s InvalidPullRequestIdException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPullRequestIdException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPullRequestIdException) RequestID() string { + return s.respMetadata.RequestID +} + +// The pull request status is not valid. The only valid values are OPEN and +// CLOSED. +type InvalidPullRequestStatusException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidPullRequestStatusException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPullRequestStatusException) GoString() string { + return s.String() +} + +func newErrorInvalidPullRequestStatusException(v protocol.ResponseMetadata) error { + return &InvalidPullRequestStatusException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPullRequestStatusException) Code() string { + return "InvalidPullRequestStatusException" +} + +// Message returns the exception's message. +func (s InvalidPullRequestStatusException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPullRequestStatusException) OrigErr() error { + return nil +} + +func (s InvalidPullRequestStatusException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPullRequestStatusException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPullRequestStatusException) RequestID() string { + return s.respMetadata.RequestID +} + +// The pull request status update is not valid. The only valid update is from +// OPEN to CLOSED. +type InvalidPullRequestStatusUpdateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidPullRequestStatusUpdateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPullRequestStatusUpdateException) GoString() string { + return s.String() +} + +func newErrorInvalidPullRequestStatusUpdateException(v protocol.ResponseMetadata) error { + return &InvalidPullRequestStatusUpdateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPullRequestStatusUpdateException) Code() string { + return "InvalidPullRequestStatusUpdateException" +} + +// Message returns the exception's message. +func (s InvalidPullRequestStatusUpdateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPullRequestStatusUpdateException) OrigErr() error { + return nil +} + +func (s InvalidPullRequestStatusUpdateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPullRequestStatusUpdateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPullRequestStatusUpdateException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified reference name format is not valid. Reference names must conform +// to the Git references format (for example, refs/heads/master). For more information, +// see Git Internals - Git References (https://git-scm.com/book/en/v2/Git-Internals-Git-References) +// or consult your Git documentation. +type InvalidReferenceNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidReferenceNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidReferenceNameException) GoString() string { + return s.String() +} + +func newErrorInvalidReferenceNameException(v protocol.ResponseMetadata) error { + return &InvalidReferenceNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidReferenceNameException) Code() string { + return "InvalidReferenceNameException" +} + +// Message returns the exception's message. +func (s InvalidReferenceNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidReferenceNameException) OrigErr() error { + return nil +} + +func (s InvalidReferenceNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidReferenceNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidReferenceNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// Either the enum is not in a valid format, or the specified file version enum +// is not valid in respect to the current file version. +type InvalidRelativeFileVersionEnumException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRelativeFileVersionEnumException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRelativeFileVersionEnumException) GoString() string { + return s.String() +} + +func newErrorInvalidRelativeFileVersionEnumException(v protocol.ResponseMetadata) error { + return &InvalidRelativeFileVersionEnumException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRelativeFileVersionEnumException) Code() string { + return "InvalidRelativeFileVersionEnumException" +} + +// Message returns the exception's message. +func (s InvalidRelativeFileVersionEnumException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRelativeFileVersionEnumException) OrigErr() error { + return nil +} + +func (s InvalidRelativeFileVersionEnumException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRelativeFileVersionEnumException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRelativeFileVersionEnumException) RequestID() string { + return s.respMetadata.RequestID +} + +// Automerge was specified for resolving the conflict, but the replacement type +// is not valid or content is missing. +type InvalidReplacementContentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidReplacementContentException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidReplacementContentException) GoString() string { + return s.String() +} + +func newErrorInvalidReplacementContentException(v protocol.ResponseMetadata) error { + return &InvalidReplacementContentException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidReplacementContentException) Code() string { + return "InvalidReplacementContentException" +} + +// Message returns the exception's message. +func (s InvalidReplacementContentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidReplacementContentException) OrigErr() error { + return nil +} + +func (s InvalidReplacementContentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidReplacementContentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidReplacementContentException) RequestID() string { + return s.respMetadata.RequestID +} + +// Automerge was specified for resolving the conflict, but the specified replacement +// type is not valid. +type InvalidReplacementTypeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidReplacementTypeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidReplacementTypeException) GoString() string { + return s.String() +} + +func newErrorInvalidReplacementTypeException(v protocol.ResponseMetadata) error { + return &InvalidReplacementTypeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidReplacementTypeException) Code() string { + return "InvalidReplacementTypeException" +} + +// Message returns the exception's message. +func (s InvalidReplacementTypeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidReplacementTypeException) OrigErr() error { + return nil +} + +func (s InvalidReplacementTypeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidReplacementTypeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidReplacementTypeException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified repository description is not valid. +type InvalidRepositoryDescriptionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRepositoryDescriptionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRepositoryDescriptionException) GoString() string { + return s.String() +} + +func newErrorInvalidRepositoryDescriptionException(v protocol.ResponseMetadata) error { + return &InvalidRepositoryDescriptionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRepositoryDescriptionException) Code() string { + return "InvalidRepositoryDescriptionException" +} + +// Message returns the exception's message. +func (s InvalidRepositoryDescriptionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRepositoryDescriptionException) OrigErr() error { + return nil +} + +func (s InvalidRepositoryDescriptionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRepositoryDescriptionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRepositoryDescriptionException) RequestID() string { + return s.respMetadata.RequestID +} + +// A specified repository name is not valid. +// +// This exception occurs only 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. +type InvalidRepositoryNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRepositoryNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRepositoryNameException) GoString() string { + return s.String() +} + +func newErrorInvalidRepositoryNameException(v protocol.ResponseMetadata) error { + return &InvalidRepositoryNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRepositoryNameException) Code() string { + return "InvalidRepositoryNameException" +} + +// Message returns the exception's message. +func (s InvalidRepositoryNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRepositoryNameException) OrigErr() error { + return nil +} + +func (s InvalidRepositoryNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRepositoryNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRepositoryNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more branch names specified for the trigger is not valid. +type InvalidRepositoryTriggerBranchNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRepositoryTriggerBranchNameException) String() string { + return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchDescribeMergeConflictsError) GoString() string { +func (s InvalidRepositoryTriggerBranchNameException) GoString() string { return s.String() } -// SetExceptionName sets the ExceptionName field's value. -func (s *BatchDescribeMergeConflictsError) SetExceptionName(v string) *BatchDescribeMergeConflictsError { - s.ExceptionName = &v - return s +func newErrorInvalidRepositoryTriggerBranchNameException(v protocol.ResponseMetadata) error { + return &InvalidRepositoryTriggerBranchNameException{ + respMetadata: v, + } } -// SetFilePath sets the FilePath field's value. -func (s *BatchDescribeMergeConflictsError) SetFilePath(v string) *BatchDescribeMergeConflictsError { - s.FilePath = &v - return s +// Code returns the exception type name. +func (s InvalidRepositoryTriggerBranchNameException) Code() string { + return "InvalidRepositoryTriggerBranchNameException" } -// SetMessage sets the Message field's value. -func (s *BatchDescribeMergeConflictsError) SetMessage(v string) *BatchDescribeMergeConflictsError { - s.Message = &v - return s +// Message returns the exception's message. +func (s InvalidRepositoryTriggerBranchNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type BatchDescribeMergeConflictsInput struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRepositoryTriggerBranchNameException) OrigErr() error { + return nil +} - // The level of conflict detail to use. If unspecified, the default FILE_LEVEL - // is used, which will return a not mergeable result if the same file has differences - // in both branches. If LINE_LEVEL is specified, a conflict will be considered - // not mergeable if the same file in both branches has differences on the same - // line. - ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` +func (s InvalidRepositoryTriggerBranchNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // Specifies which branch to use when resolving conflicts, or whether to attempt - // automatically merging two versions of a file. The default is NONE, which - // requires any conflicts to be resolved manually before the merge operation - // will be successful. - ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRepositoryTriggerBranchNameException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. - // - // DestinationCommitSpecifier is a required field - DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` +// RequestID returns the service's response RequestID for request. +func (s InvalidRepositoryTriggerBranchNameException) RequestID() string { + return s.respMetadata.RequestID +} - // The path of the target files used to describe the conflicts. If not specified, - // the default is all conflict files. - FilePaths []*string `locationName:"filePaths" type:"list"` +// The custom data provided for the trigger is not valid. +type InvalidRepositoryTriggerCustomDataException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The maximum number of files to include in the output. - MaxConflictFiles *int64 `locationName:"maxConflictFiles" type:"integer"` + Message_ *string `locationName:"message" type:"string"` +} - // The maximum number of merge hunks to include in the output. - MaxMergeHunks *int64 `locationName:"maxMergeHunks" type:"integer"` +// String returns the string representation +func (s InvalidRepositoryTriggerCustomDataException) String() string { + return awsutil.Prettify(s) +} - // The merge option or strategy you want to use to merge the code. - // - // MergeOption is a required field - MergeOption *string `locationName:"mergeOption" type:"string" required:"true" enum:"MergeOptionTypeEnum"` +// GoString returns the string representation +func (s InvalidRepositoryTriggerCustomDataException) GoString() string { + return s.String() +} - // An enumeration token that when provided in a request, returns the next batch - // of the results. - NextToken *string `locationName:"nextToken" type:"string"` +func newErrorInvalidRepositoryTriggerCustomDataException(v protocol.ResponseMetadata) error { + return &InvalidRepositoryTriggerCustomDataException{ + respMetadata: v, + } +} - // The name of the repository that contains the merge conflicts you want to - // review. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +// Code returns the exception type name. +func (s InvalidRepositoryTriggerCustomDataException) Code() string { + return "InvalidRepositoryTriggerCustomDataException" +} + +// Message returns the exception's message. +func (s InvalidRepositoryTriggerCustomDataException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRepositoryTriggerCustomDataException) OrigErr() error { + return nil +} + +func (s InvalidRepositoryTriggerCustomDataException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRepositoryTriggerCustomDataException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRepositoryTriggerCustomDataException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type InvalidRepositoryTriggerDestinationArnException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRepositoryTriggerDestinationArnException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRepositoryTriggerDestinationArnException) GoString() string { + return s.String() +} + +func newErrorInvalidRepositoryTriggerDestinationArnException(v protocol.ResponseMetadata) error { + return &InvalidRepositoryTriggerDestinationArnException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRepositoryTriggerDestinationArnException) Code() string { + return "InvalidRepositoryTriggerDestinationArnException" +} + +// Message returns the exception's message. +func (s InvalidRepositoryTriggerDestinationArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRepositoryTriggerDestinationArnException) OrigErr() error { + return nil +} + +func (s InvalidRepositoryTriggerDestinationArnException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRepositoryTriggerDestinationArnException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRepositoryTriggerDestinationArnException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type InvalidRepositoryTriggerEventsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRepositoryTriggerEventsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRepositoryTriggerEventsException) GoString() string { + return s.String() +} + +func newErrorInvalidRepositoryTriggerEventsException(v protocol.ResponseMetadata) error { + return &InvalidRepositoryTriggerEventsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRepositoryTriggerEventsException) Code() string { + return "InvalidRepositoryTriggerEventsException" +} + +// Message returns the exception's message. +func (s InvalidRepositoryTriggerEventsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRepositoryTriggerEventsException) OrigErr() error { + return nil +} + +func (s InvalidRepositoryTriggerEventsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRepositoryTriggerEventsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRepositoryTriggerEventsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The name of the trigger is not valid. +type InvalidRepositoryTriggerNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRepositoryTriggerNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRepositoryTriggerNameException) GoString() string { + return s.String() +} + +func newErrorInvalidRepositoryTriggerNameException(v protocol.ResponseMetadata) error { + return &InvalidRepositoryTriggerNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRepositoryTriggerNameException) Code() string { + return "InvalidRepositoryTriggerNameException" +} + +// Message returns the exception's message. +func (s InvalidRepositoryTriggerNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRepositoryTriggerNameException) OrigErr() error { + return nil +} + +func (s InvalidRepositoryTriggerNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRepositoryTriggerNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRepositoryTriggerNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// The AWS Region for the trigger target does not match the AWS Region for the +// repository. Triggers must be created in the same Region as the target for +// the trigger. +type InvalidRepositoryTriggerRegionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRepositoryTriggerRegionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRepositoryTriggerRegionException) GoString() string { + return s.String() +} + +func newErrorInvalidRepositoryTriggerRegionException(v protocol.ResponseMetadata) error { + return &InvalidRepositoryTriggerRegionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRepositoryTriggerRegionException) Code() string { + return "InvalidRepositoryTriggerRegionException" +} + +// Message returns the exception's message. +func (s InvalidRepositoryTriggerRegionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRepositoryTriggerRegionException) OrigErr() error { + return nil +} + +func (s InvalidRepositoryTriggerRegionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRepositoryTriggerRegionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRepositoryTriggerRegionException) RequestID() string { + return s.respMetadata.RequestID +} + +// The value for the resource ARN is not valid. For more information about resources +// in AWS CodeCommit, see CodeCommit Resources and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) +// in the AWS CodeCommit User Guide. +type InvalidResourceArnException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidResourceArnException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidResourceArnException) GoString() string { + return s.String() +} + +func newErrorInvalidResourceArnException(v protocol.ResponseMetadata) error { + return &InvalidResourceArnException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidResourceArnException) Code() string { + return "InvalidResourceArnException" +} + +// Message returns the exception's message. +func (s InvalidResourceArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidResourceArnException) OrigErr() error { + return nil +} + +func (s InvalidResourceArnException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidResourceArnException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidResourceArnException) RequestID() string { + return s.respMetadata.RequestID +} + +// The revision ID is not valid. Use GetPullRequest to determine the value. +type InvalidRevisionIdException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRevisionIdException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRevisionIdException) GoString() string { + return s.String() +} + +func newErrorInvalidRevisionIdException(v protocol.ResponseMetadata) error { + return &InvalidRevisionIdException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRevisionIdException) Code() string { + return "InvalidRevisionIdException" +} + +// Message returns the exception's message. +func (s InvalidRevisionIdException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRevisionIdException) OrigErr() error { + return nil +} + +func (s InvalidRevisionIdException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRevisionIdException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRevisionIdException) RequestID() string { + return s.respMetadata.RequestID +} - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. - // - // SourceCommitSpecifier is a required field - SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` +// The SHA-256 hash signature for the rule content is not valid. +type InvalidRuleContentSha256Exception struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s BatchDescribeMergeConflictsInput) String() string { +func (s InvalidRuleContentSha256Exception) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchDescribeMergeConflictsInput) GoString() string { +func (s InvalidRuleContentSha256Exception) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchDescribeMergeConflictsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchDescribeMergeConflictsInput"} - if s.DestinationCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) - } - if s.MergeOption == nil { - invalidParams.Add(request.NewErrParamRequired("MergeOption")) - } - 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.SourceCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) +func newErrorInvalidRuleContentSha256Exception(v protocol.ResponseMetadata) error { + return &InvalidRuleContentSha256Exception{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// Code returns the exception type name. +func (s InvalidRuleContentSha256Exception) Code() string { + return "InvalidRuleContentSha256Exception" } -// SetConflictDetailLevel sets the ConflictDetailLevel field's value. -func (s *BatchDescribeMergeConflictsInput) SetConflictDetailLevel(v string) *BatchDescribeMergeConflictsInput { - s.ConflictDetailLevel = &v - return s +// Message returns the exception's message. +func (s InvalidRuleContentSha256Exception) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. -func (s *BatchDescribeMergeConflictsInput) SetConflictResolutionStrategy(v string) *BatchDescribeMergeConflictsInput { - s.ConflictResolutionStrategy = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRuleContentSha256Exception) OrigErr() error { + return nil } -// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. -func (s *BatchDescribeMergeConflictsInput) SetDestinationCommitSpecifier(v string) *BatchDescribeMergeConflictsInput { - s.DestinationCommitSpecifier = &v - return s +func (s InvalidRuleContentSha256Exception) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetFilePaths sets the FilePaths field's value. -func (s *BatchDescribeMergeConflictsInput) SetFilePaths(v []*string) *BatchDescribeMergeConflictsInput { - s.FilePaths = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRuleContentSha256Exception) StatusCode() int { + return s.respMetadata.StatusCode } -// SetMaxConflictFiles sets the MaxConflictFiles field's value. -func (s *BatchDescribeMergeConflictsInput) SetMaxConflictFiles(v int64) *BatchDescribeMergeConflictsInput { - s.MaxConflictFiles = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidRuleContentSha256Exception) RequestID() string { + return s.respMetadata.RequestID } -// SetMaxMergeHunks sets the MaxMergeHunks field's value. -func (s *BatchDescribeMergeConflictsInput) SetMaxMergeHunks(v int64) *BatchDescribeMergeConflictsInput { - s.MaxMergeHunks = &v - return s +// The specified sort by value is not valid. +type InvalidSortByException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetMergeOption sets the MergeOption field's value. -func (s *BatchDescribeMergeConflictsInput) SetMergeOption(v string) *BatchDescribeMergeConflictsInput { - s.MergeOption = &v - return s +// String returns the string representation +func (s InvalidSortByException) String() string { + return awsutil.Prettify(s) } -// SetNextToken sets the NextToken field's value. -func (s *BatchDescribeMergeConflictsInput) SetNextToken(v string) *BatchDescribeMergeConflictsInput { - s.NextToken = &v - return s +// GoString returns the string representation +func (s InvalidSortByException) GoString() string { + return s.String() } -// SetRepositoryName sets the RepositoryName field's value. -func (s *BatchDescribeMergeConflictsInput) SetRepositoryName(v string) *BatchDescribeMergeConflictsInput { - s.RepositoryName = &v - return s +func newErrorInvalidSortByException(v protocol.ResponseMetadata) error { + return &InvalidSortByException{ + respMetadata: v, + } } -// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. -func (s *BatchDescribeMergeConflictsInput) SetSourceCommitSpecifier(v string) *BatchDescribeMergeConflictsInput { - s.SourceCommitSpecifier = &v - return s +// Code returns the exception type name. +func (s InvalidSortByException) Code() string { + return "InvalidSortByException" } -type BatchDescribeMergeConflictsOutput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidSortByException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The commit ID of the merge base. - BaseCommitId *string `locationName:"baseCommitId" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidSortByException) OrigErr() error { + return nil +} - // A list of conflicts for each file, including the conflict metadata and the - // hunks of the differences between the files. - // - // Conflicts is a required field - Conflicts []*Conflict `locationName:"conflicts" type:"list" required:"true"` +func (s InvalidSortByException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The commit ID of the destination commit specifier that was used in the merge - // evaluation. - // - // DestinationCommitId is a required field - DestinationCommitId *string `locationName:"destinationCommitId" type:"string" required:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidSortByException) StatusCode() int { + return s.respMetadata.StatusCode +} - // A list of any errors returned while describing the merge conflicts for each - // file. - Errors []*BatchDescribeMergeConflictsError `locationName:"errors" type:"list"` +// RequestID returns the service's response RequestID for request. +func (s InvalidSortByException) RequestID() string { + return s.respMetadata.RequestID +} - // An enumeration token that can be used in a request to return the next batch - // of the results. - NextToken *string `locationName:"nextToken" type:"string"` +// The source commit specifier is not valid. You must provide a valid branch +// name, tag, or full commit ID. +type InvalidSourceCommitSpecifierException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The commit ID of the source commit specifier that was used in the merge evaluation. - // - // SourceCommitId is a required field - SourceCommitId *string `locationName:"sourceCommitId" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s BatchDescribeMergeConflictsOutput) String() string { +func (s InvalidSourceCommitSpecifierException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchDescribeMergeConflictsOutput) GoString() string { +func (s InvalidSourceCommitSpecifierException) GoString() string { return s.String() } -// SetBaseCommitId sets the BaseCommitId field's value. -func (s *BatchDescribeMergeConflictsOutput) SetBaseCommitId(v string) *BatchDescribeMergeConflictsOutput { - s.BaseCommitId = &v - return s +func newErrorInvalidSourceCommitSpecifierException(v protocol.ResponseMetadata) error { + return &InvalidSourceCommitSpecifierException{ + respMetadata: v, + } } -// SetConflicts sets the Conflicts field's value. -func (s *BatchDescribeMergeConflictsOutput) SetConflicts(v []*Conflict) *BatchDescribeMergeConflictsOutput { - s.Conflicts = v - return s +// Code returns the exception type name. +func (s InvalidSourceCommitSpecifierException) Code() string { + return "InvalidSourceCommitSpecifierException" } -// SetDestinationCommitId sets the DestinationCommitId field's value. -func (s *BatchDescribeMergeConflictsOutput) SetDestinationCommitId(v string) *BatchDescribeMergeConflictsOutput { - s.DestinationCommitId = &v - return s +// Message returns the exception's message. +func (s InvalidSourceCommitSpecifierException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetErrors sets the Errors field's value. -func (s *BatchDescribeMergeConflictsOutput) SetErrors(v []*BatchDescribeMergeConflictsError) *BatchDescribeMergeConflictsOutput { - s.Errors = v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidSourceCommitSpecifierException) OrigErr() error { + return nil } -// SetNextToken sets the NextToken field's value. -func (s *BatchDescribeMergeConflictsOutput) SetNextToken(v string) *BatchDescribeMergeConflictsOutput { - s.NextToken = &v - return s +func (s InvalidSourceCommitSpecifierException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetSourceCommitId sets the SourceCommitId field's value. -func (s *BatchDescribeMergeConflictsOutput) SetSourceCommitId(v string) *BatchDescribeMergeConflictsOutput { - s.SourceCommitId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidSourceCommitSpecifierException) StatusCode() int { + return s.respMetadata.StatusCode } -// Returns information about errors in a BatchGetCommits operation. -type BatchGetCommitsError struct { - _ struct{} `type:"structure"` - - // A commit ID that either could not be found or was not in a valid format. - CommitId *string `locationName:"commitId" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s InvalidSourceCommitSpecifierException) RequestID() string { + return s.respMetadata.RequestID +} - // An error code that specifies whether the commit ID was not valid or not found. - ErrorCode *string `locationName:"errorCode" type:"string"` +// The specified tag is not valid. Key names cannot be prefixed with aws:. +type InvalidSystemTagUsageException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // An error message that provides detail about why the commit ID either was - // not found or was not valid. - ErrorMessage *string `locationName:"errorMessage" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s BatchGetCommitsError) String() string { +func (s InvalidSystemTagUsageException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchGetCommitsError) GoString() string { +func (s InvalidSystemTagUsageException) GoString() string { return s.String() } -// SetCommitId sets the CommitId field's value. -func (s *BatchGetCommitsError) SetCommitId(v string) *BatchGetCommitsError { - s.CommitId = &v - return s +func newErrorInvalidSystemTagUsageException(v protocol.ResponseMetadata) error { + return &InvalidSystemTagUsageException{ + respMetadata: v, + } } -// SetErrorCode sets the ErrorCode field's value. -func (s *BatchGetCommitsError) SetErrorCode(v string) *BatchGetCommitsError { - s.ErrorCode = &v - return s +// Code returns the exception type name. +func (s InvalidSystemTagUsageException) Code() string { + return "InvalidSystemTagUsageException" } -// SetErrorMessage sets the ErrorMessage field's value. -func (s *BatchGetCommitsError) SetErrorMessage(v string) *BatchGetCommitsError { - s.ErrorMessage = &v - return s +// Message returns the exception's message. +func (s InvalidSystemTagUsageException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type BatchGetCommitsInput struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidSystemTagUsageException) OrigErr() error { + return nil +} - // The full commit IDs of the commits to get information about. - // - // You must supply the full SHAs of each commit. You cannot use shortened SHAs. - // - // CommitIds is a required field - CommitIds []*string `locationName:"commitIds" type:"list" required:"true"` +func (s InvalidSystemTagUsageException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The name of the repository that contains the commits. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidSystemTagUsageException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidSystemTagUsageException) RequestID() string { + return s.respMetadata.RequestID +} + +// The list of tags is not valid. +type InvalidTagKeysListException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s BatchGetCommitsInput) String() string { +func (s InvalidTagKeysListException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchGetCommitsInput) GoString() string { +func (s InvalidTagKeysListException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetCommitsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetCommitsInput"} - if s.CommitIds == nil { - invalidParams.Add(request.NewErrParamRequired("CommitIds")) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) +func newErrorInvalidTagKeysListException(v protocol.ResponseMetadata) error { + return &InvalidTagKeysListException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidTagKeysListException) Code() string { + return "InvalidTagKeysListException" +} + +// Message returns the exception's message. +func (s InvalidTagKeysListException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTagKeysListException) OrigErr() error { return nil } -// SetCommitIds sets the CommitIds field's value. -func (s *BatchGetCommitsInput) SetCommitIds(v []*string) *BatchGetCommitsInput { - s.CommitIds = v - return s +func (s InvalidTagKeysListException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetRepositoryName sets the RepositoryName field's value. -func (s *BatchGetCommitsInput) SetRepositoryName(v string) *BatchGetCommitsInput { - s.RepositoryName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTagKeysListException) StatusCode() int { + return s.respMetadata.StatusCode } -type BatchGetCommitsOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidTagKeysListException) RequestID() string { + return s.respMetadata.RequestID +} - // An array of commit data type objects, each of which contains information - // about a specified commit. - Commits []*Commit `locationName:"commits" type:"list"` +// The map of tags is not valid. +type InvalidTagsMapException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Returns any commit IDs for which information could not be found. For example, - // if one of the commit IDs was a shortened SHA or that commit was not found - // in the specified repository, the ID will return an error object with additional - // information. - Errors []*BatchGetCommitsError `locationName:"errors" type:"list"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s BatchGetCommitsOutput) String() string { +func (s InvalidTagsMapException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchGetCommitsOutput) GoString() string { +func (s InvalidTagsMapException) GoString() string { return s.String() } -// SetCommits sets the Commits field's value. -func (s *BatchGetCommitsOutput) SetCommits(v []*Commit) *BatchGetCommitsOutput { - s.Commits = v - return s +func newErrorInvalidTagsMapException(v protocol.ResponseMetadata) error { + return &InvalidTagsMapException{ + respMetadata: v, + } } -// SetErrors sets the Errors field's value. -func (s *BatchGetCommitsOutput) SetErrors(v []*BatchGetCommitsError) *BatchGetCommitsOutput { - s.Errors = v - return s +// Code returns the exception type name. +func (s InvalidTagsMapException) Code() string { + return "InvalidTagsMapException" } -// Represents the input of a batch get repositories operation. -type BatchGetRepositoriesInput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidTagsMapException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The names of the repositories to get information about. - // - // RepositoryNames is a required field - RepositoryNames []*string `locationName:"repositoryNames" type:"list" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTagsMapException) OrigErr() error { + return nil +} + +func (s InvalidTagsMapException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTagsMapException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidTagsMapException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified target branch is not valid. +type InvalidTargetBranchException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s BatchGetRepositoriesInput) String() string { +func (s InvalidTargetBranchException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchGetRepositoriesInput) GoString() string { +func (s InvalidTargetBranchException) 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")) +func newErrorInvalidTargetBranchException(v protocol.ResponseMetadata) error { + return &InvalidTargetBranchException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidTargetBranchException) Code() string { + return "InvalidTargetBranchException" +} + +// Message returns the exception's message. +func (s InvalidTargetBranchException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} - if invalidParams.Len() > 0 { - return invalidParams - } +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTargetBranchException) OrigErr() error { return nil } -// SetRepositoryNames sets the RepositoryNames field's value. -func (s *BatchGetRepositoriesInput) SetRepositoryNames(v []*string) *BatchGetRepositoriesInput { - s.RepositoryNames = v - return s +func (s InvalidTargetBranchException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// Represents the output of a batch get repositories operation. -type BatchGetRepositoriesOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTargetBranchException) StatusCode() int { + return s.respMetadata.StatusCode +} - // A list of repositories returned by the batch get repositories operation. - Repositories []*RepositoryMetadata `locationName:"repositories" type:"list"` +// RequestID returns the service's response RequestID for request. +func (s InvalidTargetBranchException) RequestID() string { + return s.respMetadata.RequestID +} - // Returns a list of repository names for which information could not be found. - RepositoriesNotFound []*string `locationName:"repositoriesNotFound" type:"list"` +// The target for the pull request is not valid. A target must contain the full +// values for the repository name, source branch, and destination branch for +// the pull request. +type InvalidTargetException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s BatchGetRepositoriesOutput) String() string { +func (s InvalidTargetException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchGetRepositoriesOutput) GoString() string { +func (s InvalidTargetException) GoString() string { return s.String() } -// SetRepositories sets the Repositories field's value. -func (s *BatchGetRepositoriesOutput) SetRepositories(v []*RepositoryMetadata) *BatchGetRepositoriesOutput { - s.Repositories = v - return s +func newErrorInvalidTargetException(v protocol.ResponseMetadata) error { + return &InvalidTargetException{ + respMetadata: v, + } } -// SetRepositoriesNotFound sets the RepositoriesNotFound field's value. -func (s *BatchGetRepositoriesOutput) SetRepositoriesNotFound(v []*string) *BatchGetRepositoriesOutput { - s.RepositoriesNotFound = v - return s +// Code returns the exception type name. +func (s InvalidTargetException) Code() string { + return "InvalidTargetException" } -// Returns information about a specific Git blob object. -type BlobMetadata struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidTargetException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The full ID of the blob. - BlobId *string `locationName:"blobId" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTargetException) OrigErr() error { + return nil +} - // 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"` +func (s InvalidTargetException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The path to the blob and any associated file name, if any. - Path *string `locationName:"path" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTargetException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidTargetException) RequestID() string { + return s.respMetadata.RequestID +} + +// The targets for the pull request is not valid or not in a valid format. Targets +// are a list of target objects. Each target object must contain the full values +// for the repository name, source branch, and destination branch for a pull +// request. +type InvalidTargetsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s BlobMetadata) String() string { +func (s InvalidTargetsException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BlobMetadata) GoString() string { +func (s InvalidTargetsException) GoString() string { return s.String() } -// SetBlobId sets the BlobId field's value. -func (s *BlobMetadata) SetBlobId(v string) *BlobMetadata { - s.BlobId = &v - return s +func newErrorInvalidTargetsException(v protocol.ResponseMetadata) error { + return &InvalidTargetsException{ + respMetadata: v, + } } -// SetMode sets the Mode field's value. -func (s *BlobMetadata) SetMode(v string) *BlobMetadata { - s.Mode = &v - return s +// Code returns the exception type name. +func (s InvalidTargetsException) Code() string { + return "InvalidTargetsException" } -// SetPath sets the Path field's value. -func (s *BlobMetadata) SetPath(v string) *BlobMetadata { - s.Path = &v - return s +// Message returns the exception's message. +func (s InvalidTargetsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// Returns information about a branch. -type BranchInfo struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTargetsException) OrigErr() error { + return nil +} - // The name of the branch. - BranchName *string `locationName:"branchName" min:"1" type:"string"` +func (s InvalidTargetsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The ID of the last commit made to the branch. - CommitId *string `locationName:"commitId" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTargetsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidTargetsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The title of the pull request is not valid. Pull request titles cannot exceed +// 100 characters in length. +type InvalidTitleException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s BranchInfo) String() string { +func (s InvalidTitleException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BranchInfo) GoString() string { +func (s InvalidTitleException) GoString() string { return s.String() } -// SetBranchName sets the BranchName field's value. -func (s *BranchInfo) SetBranchName(v string) *BranchInfo { - s.BranchName = &v - return s +func newErrorInvalidTitleException(v protocol.ResponseMetadata) error { + return &InvalidTitleException{ + respMetadata: v, + } } -// SetCommitId sets the CommitId field's value. -func (s *BranchInfo) SetCommitId(v string) *BranchInfo { - s.CommitId = &v - return s +// Code returns the exception type name. +func (s InvalidTitleException) Code() string { + return "InvalidTitleException" } -// Returns information about a specific comment. -type Comment struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidTitleException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The Amazon Resource Name (ARN) of the person who posted the comment. - AuthorArn *string `locationName:"authorArn" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTitleException) OrigErr() error { + return nil +} - // A unique, client-generated idempotency token that when provided in a request, - // ensures the request cannot be repeated with a changed parameter. If a request - // is received with the same parameters and a token is included, the request - // will return information about the initial request that used that token. - ClientRequestToken *string `locationName:"clientRequestToken" type:"string"` +func (s InvalidTitleException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The system-generated comment ID. - CommentId *string `locationName:"commentId" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTitleException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The content of the comment. - Content *string `locationName:"content" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s InvalidTitleException) RequestID() string { + return s.respMetadata.RequestID +} - // The date and time the comment was created, in timestamp format. - CreationDate *time.Time `locationName:"creationDate" type:"timestamp"` +// Information about whether a file is binary or textual in a merge or pull +// request operation. +type IsBinaryFile struct { + _ struct{} `type:"structure"` - // A Boolean value indicating whether the comment has been deleted. - Deleted *bool `locationName:"deleted" type:"boolean"` + // The binary or non-binary status of a file in the base of a merge or pull + // request. + Base *bool `locationName:"base" type:"boolean"` - // The ID of the comment for which this comment is a reply, if any. - InReplyTo *string `locationName:"inReplyTo" type:"string"` + // The binary or non-binary status of a file in the destination of a merge or + // pull request. + Destination *bool `locationName:"destination" type:"boolean"` - // The date and time the comment was most recently modified, in timestamp format. - LastModifiedDate *time.Time `locationName:"lastModifiedDate" type:"timestamp"` + // The binary or non-binary status of file in the source of a merge or pull + // request. + Source *bool `locationName:"source" type:"boolean"` } // String returns the string representation -func (s Comment) String() string { +func (s IsBinaryFile) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Comment) GoString() string { +func (s IsBinaryFile) GoString() string { return s.String() } -// SetAuthorArn sets the AuthorArn field's value. -func (s *Comment) SetAuthorArn(v string) *Comment { - s.AuthorArn = &v +// SetBase sets the Base field's value. +func (s *IsBinaryFile) SetBase(v bool) *IsBinaryFile { + s.Base = &v return s } -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *Comment) SetClientRequestToken(v string) *Comment { - s.ClientRequestToken = &v +// SetDestination sets the Destination field's value. +func (s *IsBinaryFile) SetDestination(v bool) *IsBinaryFile { + s.Destination = &v return s } -// SetCommentId sets the CommentId field's value. -func (s *Comment) SetCommentId(v string) *Comment { - s.CommentId = &v +// SetSource sets the Source field's value. +func (s *IsBinaryFile) SetSource(v bool) *IsBinaryFile { + s.Source = &v return s } -// SetContent sets the Content field's value. -func (s *Comment) SetContent(v string) *Comment { - s.Content = &v - return s +type ListApprovalRuleTemplatesInput struct { + _ struct{} `type:"structure"` + + // A non-zero, non-negative integer used to limit the number of returned results. + MaxResults *int64 `locationName:"maxResults" type:"integer"` + + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` } -// SetCreationDate sets the CreationDate field's value. -func (s *Comment) SetCreationDate(v time.Time) *Comment { - s.CreationDate = &v - return s +// String returns the string representation +func (s ListApprovalRuleTemplatesInput) String() string { + return awsutil.Prettify(s) } -// SetDeleted sets the Deleted field's value. -func (s *Comment) SetDeleted(v bool) *Comment { - s.Deleted = &v - return s +// GoString returns the string representation +func (s ListApprovalRuleTemplatesInput) GoString() string { + return s.String() } -// SetInReplyTo sets the InReplyTo field's value. -func (s *Comment) SetInReplyTo(v string) *Comment { - s.InReplyTo = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListApprovalRuleTemplatesInput) SetMaxResults(v int64) *ListApprovalRuleTemplatesInput { + s.MaxResults = &v return s } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *Comment) SetLastModifiedDate(v time.Time) *Comment { - s.LastModifiedDate = &v +// SetNextToken sets the NextToken field's value. +func (s *ListApprovalRuleTemplatesInput) SetNextToken(v string) *ListApprovalRuleTemplatesInput { + s.NextToken = &v return s } -// Returns information about comments on the comparison between two commits. -type CommentsForComparedCommit struct { +type ListApprovalRuleTemplatesOutput struct { _ struct{} `type:"structure"` - // The full blob ID of the commit used to establish the 'after' of the comparison. - AfterBlobId *string `locationName:"afterBlobId" type:"string"` - - // The full commit ID of the commit used to establish the 'after' of the comparison. - AfterCommitId *string `locationName:"afterCommitId" type:"string"` - - // The full blob ID of the commit used to establish the 'before' of the comparison. - BeforeBlobId *string `locationName:"beforeBlobId" type:"string"` - - // The full commit ID of the commit used to establish the 'before' of the comparison. - BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` - - // An array of comment objects. Each comment object contains information about - // a comment on the comparison between commits. - Comments []*Comment `locationName:"comments" type:"list"` - - // Location information about the comment on the comparison, including the file - // name, line number, and whether the version of the file where the comment - // was made is 'BEFORE' or 'AFTER'. - Location *Location `locationName:"location" type:"structure"` + // The names of all the approval rule templates found in the AWS Region for + // your AWS account. + ApprovalRuleTemplateNames []*string `locationName:"approvalRuleTemplateNames" type:"list"` - // The name of the repository that contains the compared commits. - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` + // An enumeration token that allows the operation to batch the next results + // of the operation. + NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation -func (s CommentsForComparedCommit) String() string { +func (s ListApprovalRuleTemplatesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CommentsForComparedCommit) GoString() string { +func (s ListApprovalRuleTemplatesOutput) GoString() string { return s.String() } -// SetAfterBlobId sets the AfterBlobId field's value. -func (s *CommentsForComparedCommit) SetAfterBlobId(v string) *CommentsForComparedCommit { - s.AfterBlobId = &v +// SetApprovalRuleTemplateNames sets the ApprovalRuleTemplateNames field's value. +func (s *ListApprovalRuleTemplatesOutput) SetApprovalRuleTemplateNames(v []*string) *ListApprovalRuleTemplatesOutput { + s.ApprovalRuleTemplateNames = v return s } -// SetAfterCommitId sets the AfterCommitId field's value. -func (s *CommentsForComparedCommit) SetAfterCommitId(v string) *CommentsForComparedCommit { - s.AfterCommitId = &v +// SetNextToken sets the NextToken field's value. +func (s *ListApprovalRuleTemplatesOutput) SetNextToken(v string) *ListApprovalRuleTemplatesOutput { + s.NextToken = &v return s } -// SetBeforeBlobId sets the BeforeBlobId field's value. -func (s *CommentsForComparedCommit) SetBeforeBlobId(v string) *CommentsForComparedCommit { - s.BeforeBlobId = &v - return s +type ListAssociatedApprovalRuleTemplatesForRepositoryInput struct { + _ struct{} `type:"structure"` + + // A non-zero, non-negative integer used to limit the number of returned results. + MaxResults *int64 `locationName:"maxResults" type:"integer"` + + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The name of the repository for which you want to list all associated approval + // rule templates. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListAssociatedApprovalRuleTemplatesForRepositoryInput) String() string { + return awsutil.Prettify(s) } -// SetBeforeCommitId sets the BeforeCommitId field's value. -func (s *CommentsForComparedCommit) SetBeforeCommitId(v string) *CommentsForComparedCommit { - s.BeforeCommitId = &v - return s +// GoString returns the string representation +func (s ListAssociatedApprovalRuleTemplatesForRepositoryInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListAssociatedApprovalRuleTemplatesForRepositoryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAssociatedApprovalRuleTemplatesForRepositoryInput"} + 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 } -// SetComments sets the Comments field's value. -func (s *CommentsForComparedCommit) SetComments(v []*Comment) *CommentsForComparedCommit { - s.Comments = v +// SetMaxResults sets the MaxResults field's value. +func (s *ListAssociatedApprovalRuleTemplatesForRepositoryInput) SetMaxResults(v int64) *ListAssociatedApprovalRuleTemplatesForRepositoryInput { + s.MaxResults = &v return s } -// SetLocation sets the Location field's value. -func (s *CommentsForComparedCommit) SetLocation(v *Location) *CommentsForComparedCommit { - s.Location = v +// SetNextToken sets the NextToken field's value. +func (s *ListAssociatedApprovalRuleTemplatesForRepositoryInput) SetNextToken(v string) *ListAssociatedApprovalRuleTemplatesForRepositoryInput { + s.NextToken = &v return s } // SetRepositoryName sets the RepositoryName field's value. -func (s *CommentsForComparedCommit) SetRepositoryName(v string) *CommentsForComparedCommit { +func (s *ListAssociatedApprovalRuleTemplatesForRepositoryInput) SetRepositoryName(v string) *ListAssociatedApprovalRuleTemplatesForRepositoryInput { s.RepositoryName = &v return s } -// Returns information about comments on a pull request. -type CommentsForPullRequest struct { +type ListAssociatedApprovalRuleTemplatesForRepositoryOutput struct { _ struct{} `type:"structure"` - // The full blob ID of the file on which you want to comment on the source commit. - AfterBlobId *string `locationName:"afterBlobId" type:"string"` + // The names of all approval rule templates associated with the repository. + ApprovalRuleTemplateNames []*string `locationName:"approvalRuleTemplateNames" type:"list"` - // he full commit ID of the commit that was the tip of the source branch at - // the time the comment was made. - AfterCommitId *string `locationName:"afterCommitId" type:"string"` + // An enumeration token that allows the operation to batch the next results + // of the operation. + NextToken *string `locationName:"nextToken" type:"string"` +} - // The full blob ID of the file on which you want to comment on the destination - // commit. - BeforeBlobId *string `locationName:"beforeBlobId" type:"string"` +// String returns the string representation +func (s ListAssociatedApprovalRuleTemplatesForRepositoryOutput) String() string { + return awsutil.Prettify(s) +} - // The full commit ID of the commit that was the tip of the destination branch - // when the pull request was created. This commit will be superceded by the - // after commit in the source branch when and if you merge the source branch - // into the destination branch. - BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` +// GoString returns the string representation +func (s ListAssociatedApprovalRuleTemplatesForRepositoryOutput) GoString() string { + return s.String() +} - // An array of comment objects. Each comment object contains information about - // a comment on the pull request. - Comments []*Comment `locationName:"comments" type:"list"` +// SetApprovalRuleTemplateNames sets the ApprovalRuleTemplateNames field's value. +func (s *ListAssociatedApprovalRuleTemplatesForRepositoryOutput) SetApprovalRuleTemplateNames(v []*string) *ListAssociatedApprovalRuleTemplatesForRepositoryOutput { + s.ApprovalRuleTemplateNames = v + return s +} - // Location information about the comment on the pull request, including the - // file name, line number, and whether the version of the file where the comment - // was made is 'BEFORE' (destination branch) or 'AFTER' (source branch). - Location *Location `locationName:"location" type:"structure"` +// SetNextToken sets the NextToken field's value. +func (s *ListAssociatedApprovalRuleTemplatesForRepositoryOutput) SetNextToken(v string) *ListAssociatedApprovalRuleTemplatesForRepositoryOutput { + s.NextToken = &v + return s +} - // The system-generated ID of the pull request. - PullRequestId *string `locationName:"pullRequestId" type:"string"` +// Represents the input of a list branches operation. +type ListBranchesInput struct { + _ struct{} `type:"structure"` - // The name of the repository that contains the pull request. - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` + // 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 CommentsForPullRequest) String() string { +func (s ListBranchesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CommentsForPullRequest) GoString() string { +func (s ListBranchesInput) GoString() string { return s.String() } -// SetAfterBlobId sets the AfterBlobId field's value. -func (s *CommentsForPullRequest) SetAfterBlobId(v string) *CommentsForPullRequest { - s.AfterBlobId = &v - return s +// 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 } -// SetAfterCommitId sets the AfterCommitId field's value. -func (s *CommentsForPullRequest) SetAfterCommitId(v string) *CommentsForPullRequest { - s.AfterCommitId = &v +// SetNextToken sets the NextToken field's value. +func (s *ListBranchesInput) SetNextToken(v string) *ListBranchesInput { + s.NextToken = &v return s } -// SetBeforeBlobId sets the BeforeBlobId field's value. -func (s *CommentsForPullRequest) SetBeforeBlobId(v string) *CommentsForPullRequest { - s.BeforeBlobId = &v +// SetRepositoryName sets the RepositoryName field's value. +func (s *ListBranchesInput) SetRepositoryName(v string) *ListBranchesInput { + s.RepositoryName = &v return s } -// SetBeforeCommitId sets the BeforeCommitId field's value. -func (s *CommentsForPullRequest) SetBeforeCommitId(v string) *CommentsForPullRequest { - s.BeforeCommitId = &v - return s +// Represents the output of a list branches operation. +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"` } -// SetComments sets the Comments field's value. -func (s *CommentsForPullRequest) SetComments(v []*Comment) *CommentsForPullRequest { - s.Comments = v - return s +// String returns the string representation +func (s ListBranchesOutput) String() string { + return awsutil.Prettify(s) } -// SetLocation sets the Location field's value. -func (s *CommentsForPullRequest) SetLocation(v *Location) *CommentsForPullRequest { - s.Location = v - return s +// GoString returns the string representation +func (s ListBranchesOutput) GoString() string { + return s.String() } -// SetPullRequestId sets the PullRequestId field's value. -func (s *CommentsForPullRequest) SetPullRequestId(v string) *CommentsForPullRequest { - s.PullRequestId = &v +// SetBranches sets the Branches field's value. +func (s *ListBranchesOutput) SetBranches(v []*string) *ListBranchesOutput { + s.Branches = v return s } -// SetRepositoryName sets the RepositoryName field's value. -func (s *CommentsForPullRequest) SetRepositoryName(v string) *CommentsForPullRequest { - s.RepositoryName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListBranchesOutput) SetNextToken(v string) *ListBranchesOutput { + s.NextToken = &v return s } -// Returns information about a specific commit. -type Commit struct { +type ListPullRequestsInput 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"` - - // The full SHA of the specified commit. - CommitId *string `locationName:"commitId" type:"string"` + // Optional. The Amazon Resource Name (ARN) of the user who created the pull + // request. If used, this filters the results to pull requests created by that + // user. + AuthorArn *string `locationName:"authorArn" type:"string"` - // 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"` + // A non-zero, non-negative integer used to limit the number of returned results. + MaxResults *int64 `locationName:"maxResults" type:"integer"` - // The commit message associated with the specified commit. - Message *string `locationName:"message" type:"string"` + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` - // A list of parent commits for the specified commit. Each parent commit ID - // is the full commit ID. - Parents []*string `locationName:"parents" type:"list"` + // Optional. The status of the pull request. If used, this refines the results + // to the pull requests that match the specified status. + PullRequestStatus *string `locationName:"pullRequestStatus" type:"string" enum:"PullRequestStatusEnum"` - // Tree information for the specified commit. - TreeId *string `locationName:"treeId" type:"string"` + // The name of the repository for which you want to list pull requests. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` } // String returns the string representation -func (s Commit) String() string { +func (s ListPullRequestsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Commit) GoString() string { +func (s ListPullRequestsInput) GoString() string { return s.String() } -// SetAdditionalData sets the AdditionalData field's value. -func (s *Commit) SetAdditionalData(v string) *Commit { - s.AdditionalData = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListPullRequestsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListPullRequestsInput"} + 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 +} + +// SetAuthorArn sets the AuthorArn field's value. +func (s *ListPullRequestsInput) SetAuthorArn(v string) *ListPullRequestsInput { + s.AuthorArn = &v return s } -// SetAuthor sets the Author field's value. -func (s *Commit) SetAuthor(v *UserInfo) *Commit { - s.Author = v +// SetMaxResults sets the MaxResults field's value. +func (s *ListPullRequestsInput) SetMaxResults(v int64) *ListPullRequestsInput { + s.MaxResults = &v return s } -// SetCommitId sets the CommitId field's value. -func (s *Commit) SetCommitId(v string) *Commit { - s.CommitId = &v +// SetNextToken sets the NextToken field's value. +func (s *ListPullRequestsInput) SetNextToken(v string) *ListPullRequestsInput { + s.NextToken = &v return s } -// SetCommitter sets the Committer field's value. -func (s *Commit) SetCommitter(v *UserInfo) *Commit { - s.Committer = v +// SetPullRequestStatus sets the PullRequestStatus field's value. +func (s *ListPullRequestsInput) SetPullRequestStatus(v string) *ListPullRequestsInput { + s.PullRequestStatus = &v return s } -// SetMessage sets the Message field's value. -func (s *Commit) SetMessage(v string) *Commit { - s.Message = &v +// SetRepositoryName sets the RepositoryName field's value. +func (s *ListPullRequestsInput) SetRepositoryName(v string) *ListPullRequestsInput { + s.RepositoryName = &v return s } -// SetParents sets the Parents field's value. -func (s *Commit) SetParents(v []*string) *Commit { - s.Parents = v +type ListPullRequestsOutput struct { + _ struct{} `type:"structure"` + + // An enumeration token that allows the operation to batch the next results + // of the operation. + NextToken *string `locationName:"nextToken" type:"string"` + + // The system-generated IDs of the pull requests. + // + // PullRequestIds is a required field + PullRequestIds []*string `locationName:"pullRequestIds" type:"list" required:"true"` +} + +// String returns the string representation +func (s ListPullRequestsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPullRequestsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListPullRequestsOutput) SetNextToken(v string) *ListPullRequestsOutput { + s.NextToken = &v return s } -// SetTreeId sets the TreeId field's value. -func (s *Commit) SetTreeId(v string) *Commit { - s.TreeId = &v +// SetPullRequestIds sets the PullRequestIds field's value. +func (s *ListPullRequestsOutput) SetPullRequestIds(v []*string) *ListPullRequestsOutput { + s.PullRequestIds = v return s } -// Information about conflicts in a merge operation. -type Conflict struct { +type ListRepositoriesForApprovalRuleTemplateInput struct { _ struct{} `type:"structure"` - // Metadata about a conflict in a merge operation. - ConflictMetadata *ConflictMetadata `locationName:"conflictMetadata" type:"structure"` + // The name of the approval rule template for which you want to list repositories + // that are associated with that template. + // + // ApprovalRuleTemplateName is a required field + ApprovalRuleTemplateName *string `locationName:"approvalRuleTemplateName" min:"1" type:"string" required:"true"` - // A list of hunks that contain the differences between files or lines causing - // the conflict. - MergeHunks []*MergeHunk `locationName:"mergeHunks" type:"list"` + // A non-zero, non-negative integer used to limit the number of returned results. + MaxResults *int64 `locationName:"maxResults" type:"integer"` + + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation -func (s Conflict) String() string { +func (s ListRepositoriesForApprovalRuleTemplateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Conflict) GoString() string { +func (s ListRepositoriesForApprovalRuleTemplateInput) GoString() string { return s.String() } -// SetConflictMetadata sets the ConflictMetadata field's value. -func (s *Conflict) SetConflictMetadata(v *ConflictMetadata) *Conflict { - s.ConflictMetadata = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListRepositoriesForApprovalRuleTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListRepositoriesForApprovalRuleTemplateInput"} + if s.ApprovalRuleTemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleTemplateName")) + } + if s.ApprovalRuleTemplateName != nil && len(*s.ApprovalRuleTemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApprovalRuleTemplateName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetMergeHunks sets the MergeHunks field's value. -func (s *Conflict) SetMergeHunks(v []*MergeHunk) *Conflict { - s.MergeHunks = v +// SetApprovalRuleTemplateName sets the ApprovalRuleTemplateName field's value. +func (s *ListRepositoriesForApprovalRuleTemplateInput) SetApprovalRuleTemplateName(v string) *ListRepositoriesForApprovalRuleTemplateInput { + s.ApprovalRuleTemplateName = &v return s } -// Information about the metadata for a conflict in a merge operation. -type ConflictMetadata struct { - _ struct{} `type:"structure"` - - // A boolean value indicating whether there are conflicts in the content of - // a file. - ContentConflict *bool `locationName:"contentConflict" type:"boolean"` - - // A boolean value indicating whether there are conflicts in the file mode of - // a file. - FileModeConflict *bool `locationName:"fileModeConflict" type:"boolean"` - - // The file modes of the file in the source, destination, and base of the merge. - FileModes *FileModes `locationName:"fileModes" type:"structure"` - - // The path of the file that contains conflicts. - FilePath *string `locationName:"filePath" type:"string"` - - // The file sizes of the file in the source, destination, and base of the merge. - FileSizes *FileSizes `locationName:"fileSizes" type:"structure"` - - // A boolean value (true or false) indicating whether the file is binary or - // textual in the source, destination, and base of the merge. - IsBinaryFile *IsBinaryFile `locationName:"isBinaryFile" type:"structure"` +// SetMaxResults sets the MaxResults field's value. +func (s *ListRepositoriesForApprovalRuleTemplateInput) SetMaxResults(v int64) *ListRepositoriesForApprovalRuleTemplateInput { + s.MaxResults = &v + return s +} - // Whether an add, modify, or delete operation caused the conflict between the - // source and destination of the merge. - MergeOperations *MergeOperations `locationName:"mergeOperations" type:"structure"` +// SetNextToken sets the NextToken field's value. +func (s *ListRepositoriesForApprovalRuleTemplateInput) SetNextToken(v string) *ListRepositoriesForApprovalRuleTemplateInput { + s.NextToken = &v + return s +} - // The number of conflicts, including both hunk conflicts and metadata conflicts. - NumberOfConflicts *int64 `locationName:"numberOfConflicts" type:"integer"` +type ListRepositoriesForApprovalRuleTemplateOutput struct { + _ struct{} `type:"structure"` - // A boolean value (true or false) indicating whether there are conflicts between - // the branches in the object type of a file, folder, or submodule. - ObjectTypeConflict *bool `locationName:"objectTypeConflict" type:"boolean"` + // An enumeration token that allows the operation to batch the next results + // of the operation. + NextToken *string `locationName:"nextToken" type:"string"` - // Information about any object type conflicts in a merge operation. - ObjectTypes *ObjectTypes `locationName:"objectTypes" type:"structure"` + // A list of repository names that are associated with the specified approval + // rule template. + RepositoryNames []*string `locationName:"repositoryNames" type:"list"` } // String returns the string representation -func (s ConflictMetadata) String() string { +func (s ListRepositoriesForApprovalRuleTemplateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConflictMetadata) GoString() string { +func (s ListRepositoriesForApprovalRuleTemplateOutput) GoString() string { return s.String() } -// SetContentConflict sets the ContentConflict field's value. -func (s *ConflictMetadata) SetContentConflict(v bool) *ConflictMetadata { - s.ContentConflict = &v +// SetNextToken sets the NextToken field's value. +func (s *ListRepositoriesForApprovalRuleTemplateOutput) SetNextToken(v string) *ListRepositoriesForApprovalRuleTemplateOutput { + s.NextToken = &v return s } -// SetFileModeConflict sets the FileModeConflict field's value. -func (s *ConflictMetadata) SetFileModeConflict(v bool) *ConflictMetadata { - s.FileModeConflict = &v +// SetRepositoryNames sets the RepositoryNames field's value. +func (s *ListRepositoriesForApprovalRuleTemplateOutput) SetRepositoryNames(v []*string) *ListRepositoriesForApprovalRuleTemplateOutput { + s.RepositoryNames = v return s } -// SetFileModes sets the FileModes field's value. -func (s *ConflictMetadata) SetFileModes(v *FileModes) *ConflictMetadata { - s.FileModes = v - return s -} +// Represents the input of a list repositories operation. +type ListRepositoriesInput struct { + _ struct{} `type:"structure"` -// SetFilePath sets the FilePath field's value. -func (s *ConflictMetadata) SetFilePath(v string) *ConflictMetadata { - s.FilePath = &v - return s -} + // 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"` -// SetFileSizes sets the FileSizes field's value. -func (s *ConflictMetadata) SetFileSizes(v *FileSizes) *ConflictMetadata { - s.FileSizes = v - return s + // 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"` } -// SetIsBinaryFile sets the IsBinaryFile field's value. -func (s *ConflictMetadata) SetIsBinaryFile(v *IsBinaryFile) *ConflictMetadata { - s.IsBinaryFile = v - return s +// String returns the string representation +func (s ListRepositoriesInput) String() string { + return awsutil.Prettify(s) } -// SetMergeOperations sets the MergeOperations field's value. -func (s *ConflictMetadata) SetMergeOperations(v *MergeOperations) *ConflictMetadata { - s.MergeOperations = v - return s +// GoString returns the string representation +func (s ListRepositoriesInput) GoString() string { + return s.String() } -// SetNumberOfConflicts sets the NumberOfConflicts field's value. -func (s *ConflictMetadata) SetNumberOfConflicts(v int64) *ConflictMetadata { - s.NumberOfConflicts = &v +// SetNextToken sets the NextToken field's value. +func (s *ListRepositoriesInput) SetNextToken(v string) *ListRepositoriesInput { + s.NextToken = &v return s } -// SetObjectTypeConflict sets the ObjectTypeConflict field's value. -func (s *ConflictMetadata) SetObjectTypeConflict(v bool) *ConflictMetadata { - s.ObjectTypeConflict = &v +// SetOrder sets the Order field's value. +func (s *ListRepositoriesInput) SetOrder(v string) *ListRepositoriesInput { + s.Order = &v return s } -// SetObjectTypes sets the ObjectTypes field's value. -func (s *ConflictMetadata) SetObjectTypes(v *ObjectTypes) *ConflictMetadata { - s.ObjectTypes = v +// SetSortBy sets the SortBy field's value. +func (s *ListRepositoriesInput) SetSortBy(v string) *ListRepositoriesInput { + s.SortBy = &v return s } -// A list of inputs to use when resolving conflicts during a merge if AUTOMERGE -// is chosen as the conflict resolution strategy. -type ConflictResolution struct { +// Represents the output of a list repositories operation. +type ListRepositoriesOutput struct { _ struct{} `type:"structure"` - // Files that will be deleted as part of the merge conflict resolution. - DeleteFiles []*DeleteFileEntry `locationName:"deleteFiles" type:"list"` - - // Files that will have content replaced as part of the merge conflict resolution. - ReplaceContents []*ReplaceContentEntry `locationName:"replaceContents" type:"list"` + // 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"` - // File modes that will be set as part of the merge conflict resolution. - SetFileModes []*SetFileModeEntry `locationName:"setFileModes" type:"list"` + // Lists the repositories called by the list repositories operation. + Repositories []*RepositoryNameIdPair `locationName:"repositories" type:"list"` } // String returns the string representation -func (s ConflictResolution) String() string { +func (s ListRepositoriesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConflictResolution) GoString() string { +func (s ListRepositoriesOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConflictResolution) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConflictResolution"} - if s.DeleteFiles != nil { - for i, v := range s.DeleteFiles { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DeleteFiles", i), err.(request.ErrInvalidParams)) - } - } - } - if s.ReplaceContents != nil { - for i, v := range s.ReplaceContents { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ReplaceContents", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SetFileModes != nil { - for i, v := range s.SetFileModes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SetFileModes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeleteFiles sets the DeleteFiles field's value. -func (s *ConflictResolution) SetDeleteFiles(v []*DeleteFileEntry) *ConflictResolution { - s.DeleteFiles = v - return s -} - -// SetReplaceContents sets the ReplaceContents field's value. -func (s *ConflictResolution) SetReplaceContents(v []*ReplaceContentEntry) *ConflictResolution { - s.ReplaceContents = v +// SetNextToken sets the NextToken field's value. +func (s *ListRepositoriesOutput) SetNextToken(v string) *ListRepositoriesOutput { + s.NextToken = &v return s } -// SetSetFileModes sets the SetFileModes field's value. -func (s *ConflictResolution) SetSetFileModes(v []*SetFileModeEntry) *ConflictResolution { - s.SetFileModes = v +// SetRepositories sets the Repositories field's value. +func (s *ListRepositoriesOutput) SetRepositories(v []*RepositoryNameIdPair) *ListRepositoriesOutput { + s.Repositories = v return s } -// Represents the input of a create branch operation. -type CreateBranchInput struct { +type ListTagsForResourceInput 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"` + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + NextToken *string `locationName:"nextToken" type:"string"` - // The name of the repository in which you want to create the new branch. + // The Amazon Resource Name (ARN) of the resource for which you want to get + // information about tags, if any. // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + // ResourceArn is a required field + ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"` } // String returns the string representation -func (s CreateBranchInput) String() string { +func (s ListTagsForResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateBranchInput) GoString() string { +func (s ListTagsForResourceInput) 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)) +func (s *ListTagsForResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { @@ -9016,783 +23708,772 @@ func (s *CreateBranchInput) Validate() error { 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 +// SetNextToken sets the NextToken field's value. +func (s *ListTagsForResourceInput) SetNextToken(v string) *ListTagsForResourceInput { + s.NextToken = &v return s } -// SetRepositoryName sets the RepositoryName field's value. -func (s *CreateBranchInput) SetRepositoryName(v string) *CreateBranchInput { - s.RepositoryName = &v +// SetResourceArn sets the ResourceArn field's value. +func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { + s.ResourceArn = &v return s } -type CreateBranchOutput struct { +type ListTagsForResourceOutput struct { _ struct{} `type:"structure"` + + // An enumeration token that allows the operation to batch the next results + // of the operation. + NextToken *string `locationName:"nextToken" type:"string"` + + // A list of tag key and value pairs associated with the specified resource. + Tags map[string]*string `locationName:"tags" type:"map"` } // String returns the string representation -func (s CreateBranchOutput) String() string { +func (s ListTagsForResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateBranchOutput) GoString() string { +func (s ListTagsForResourceOutput) GoString() string { return s.String() } -type CreateCommitInput struct { - _ struct{} `type:"structure"` - - // The name of the author who created the commit. This information will be used - // as both the author and committer for the commit. - AuthorName *string `locationName:"authorName" type:"string"` - - // The name of the branch where you will create the commit. - // - // BranchName is a required field - BranchName *string `locationName:"branchName" min:"1" type:"string" required:"true"` - - // The commit message you want to include as part of creating the commit. Commit - // messages are limited to 256 KB. If no message is specified, a default message - // will be used. - CommitMessage *string `locationName:"commitMessage" type:"string"` - - // The files to delete in this commit. These files will still exist in prior - // commits. - DeleteFiles []*DeleteFileEntry `locationName:"deleteFiles" type:"list"` - - // The email address of the person who created the commit. - Email *string `locationName:"email" type:"string"` +// SetNextToken sets the NextToken field's value. +func (s *ListTagsForResourceOutput) SetNextToken(v string) *ListTagsForResourceOutput { + s.NextToken = &v + return s +} - // If the commit contains deletions, whether to keep a folder or folder structure - // if the changes leave the folders empty. If this is specified as true, a .gitkeep - // file will be created for empty folders. The default is false. - KeepEmptyFolders *bool `locationName:"keepEmptyFolders" type:"boolean"` +// SetTags sets the Tags field's value. +func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { + s.Tags = v + return s +} - // The ID of the commit that is the parent of the commit you will create. If - // this is an empty repository, this is not required. - ParentCommitId *string `locationName:"parentCommitId" type:"string"` +// Returns information about the location of a change or comment in the comparison +// between two commits or a pull request. +type Location struct { + _ struct{} `type:"structure"` - // The files to add or update in this commit. - PutFiles []*PutFileEntry `locationName:"putFiles" type:"list"` + // The name of the file being compared, including its extension and subdirectory, + // if any. + FilePath *string `locationName:"filePath" type:"string"` - // The name of the repository where you will create the commit. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + // The position of a change in a compared file, in line number format. + FilePosition *int64 `locationName:"filePosition" type:"long"` - // The file modes to update for files in this commit. - SetFileModes []*SetFileModeEntry `locationName:"setFileModes" type:"list"` + // In a comparison of commits or a pull request, whether the change is in the + // before or after of that comparison. + RelativeFileVersion *string `locationName:"relativeFileVersion" type:"string" enum:"RelativeFileVersionEnum"` } // String returns the string representation -func (s CreateCommitInput) String() string { +func (s Location) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateCommitInput) GoString() string { +func (s Location) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCommitInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCommitInput"} - 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.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) - } - if s.DeleteFiles != nil { - for i, v := range s.DeleteFiles { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DeleteFiles", i), err.(request.ErrInvalidParams)) - } - } - } - if s.PutFiles != nil { - for i, v := range s.PutFiles { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PutFiles", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SetFileModes != nil { - for i, v := range s.SetFileModes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SetFileModes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAuthorName sets the AuthorName field's value. -func (s *CreateCommitInput) SetAuthorName(v string) *CreateCommitInput { - s.AuthorName = &v +// SetFilePath sets the FilePath field's value. +func (s *Location) SetFilePath(v string) *Location { + s.FilePath = &v return s } -// SetBranchName sets the BranchName field's value. -func (s *CreateCommitInput) SetBranchName(v string) *CreateCommitInput { - s.BranchName = &v +// SetFilePosition sets the FilePosition field's value. +func (s *Location) SetFilePosition(v int64) *Location { + s.FilePosition = &v return s } -// SetCommitMessage sets the CommitMessage field's value. -func (s *CreateCommitInput) SetCommitMessage(v string) *CreateCommitInput { - s.CommitMessage = &v +// SetRelativeFileVersion sets the RelativeFileVersion field's value. +func (s *Location) SetRelativeFileVersion(v string) *Location { + s.RelativeFileVersion = &v return s } -// SetDeleteFiles sets the DeleteFiles field's value. -func (s *CreateCommitInput) SetDeleteFiles(v []*DeleteFileEntry) *CreateCommitInput { - s.DeleteFiles = v - return s -} +// The pull request cannot be merged automatically into the destination branch. +// You must manually merge the branches and resolve any conflicts. +type ManualMergeRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata -// SetEmail sets the Email field's value. -func (s *CreateCommitInput) SetEmail(v string) *CreateCommitInput { - s.Email = &v - return s + Message_ *string `locationName:"message" type:"string"` } -// SetKeepEmptyFolders sets the KeepEmptyFolders field's value. -func (s *CreateCommitInput) SetKeepEmptyFolders(v bool) *CreateCommitInput { - s.KeepEmptyFolders = &v - return s +// String returns the string representation +func (s ManualMergeRequiredException) String() string { + return awsutil.Prettify(s) } -// SetParentCommitId sets the ParentCommitId field's value. -func (s *CreateCommitInput) SetParentCommitId(v string) *CreateCommitInput { - s.ParentCommitId = &v - return s +// GoString returns the string representation +func (s ManualMergeRequiredException) GoString() string { + return s.String() } -// SetPutFiles sets the PutFiles field's value. -func (s *CreateCommitInput) SetPutFiles(v []*PutFileEntry) *CreateCommitInput { - s.PutFiles = v - return s +func newErrorManualMergeRequiredException(v protocol.ResponseMetadata) error { + return &ManualMergeRequiredException{ + respMetadata: v, + } } -// SetRepositoryName sets the RepositoryName field's value. -func (s *CreateCommitInput) SetRepositoryName(v string) *CreateCommitInput { - s.RepositoryName = &v - return s +// Code returns the exception type name. +func (s ManualMergeRequiredException) Code() string { + return "ManualMergeRequiredException" } -// SetSetFileModes sets the SetFileModes field's value. -func (s *CreateCommitInput) SetSetFileModes(v []*SetFileModeEntry) *CreateCommitInput { - s.SetFileModes = v - return s +// Message returns the exception's message. +func (s ManualMergeRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type CreateCommitOutput struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ManualMergeRequiredException) OrigErr() error { + return nil +} - // The full commit ID of the commit that contains your committed file changes. - CommitId *string `locationName:"commitId" type:"string"` +func (s ManualMergeRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The files added as part of the committed file changes. - FilesAdded []*FileMetadata `locationName:"filesAdded" type:"list"` +// Status code returns the HTTP status code for the request's response error. +func (s ManualMergeRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The files deleted as part of the committed file changes. - FilesDeleted []*FileMetadata `locationName:"filesDeleted" type:"list"` +// RequestID returns the service's response RequestID for request. +func (s ManualMergeRequiredException) RequestID() string { + return s.respMetadata.RequestID +} - // The files updated as part of the commited file changes. - FilesUpdated []*FileMetadata `locationName:"filesUpdated" type:"list"` +// The number of branches for the trigger was exceeded. +type MaximumBranchesExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The full SHA-1 pointer of the tree information for the commit that contains - // the commited file changes. - TreeId *string `locationName:"treeId" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s CreateCommitOutput) String() string { +func (s MaximumBranchesExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateCommitOutput) GoString() string { +func (s MaximumBranchesExceededException) GoString() string { return s.String() } -// SetCommitId sets the CommitId field's value. -func (s *CreateCommitOutput) SetCommitId(v string) *CreateCommitOutput { - s.CommitId = &v - return s -} - -// SetFilesAdded sets the FilesAdded field's value. -func (s *CreateCommitOutput) SetFilesAdded(v []*FileMetadata) *CreateCommitOutput { - s.FilesAdded = v - return s +func newErrorMaximumBranchesExceededException(v protocol.ResponseMetadata) error { + return &MaximumBranchesExceededException{ + respMetadata: v, + } } -// SetFilesDeleted sets the FilesDeleted field's value. -func (s *CreateCommitOutput) SetFilesDeleted(v []*FileMetadata) *CreateCommitOutput { - s.FilesDeleted = v - return s +// Code returns the exception type name. +func (s MaximumBranchesExceededException) Code() string { + return "MaximumBranchesExceededException" } -// SetFilesUpdated sets the FilesUpdated field's value. -func (s *CreateCommitOutput) SetFilesUpdated(v []*FileMetadata) *CreateCommitOutput { - s.FilesUpdated = v - return s +// Message returns the exception's message. +func (s MaximumBranchesExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetTreeId sets the TreeId field's value. -func (s *CreateCommitOutput) SetTreeId(v string) *CreateCommitOutput { - s.TreeId = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaximumBranchesExceededException) OrigErr() error { + return nil } -type CreatePullRequestInput struct { - _ struct{} `type:"structure"` +func (s MaximumBranchesExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // A unique, client-generated idempotency token that when provided in a request, - // ensures the request cannot be repeated with a changed parameter. If a request - // is received with the same parameters and a token is included, the request - // will return information about the initial request that used that token. - // - // The AWS SDKs prepopulate client request tokens. If using an AWS SDK, you - // do not have to generate an idempotency token, as this will be done for you. - ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s MaximumBranchesExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} - // A description of the pull request. - Description *string `locationName:"description" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s MaximumBranchesExceededException) RequestID() string { + return s.respMetadata.RequestID +} - // The targets for the pull request, including the source of the code to be - // reviewed (the source branch), and the destination where the creator of the - // pull request intends the code to be merged after the pull request is closed - // (the destination branch). - // - // Targets is a required field - Targets []*Target `locationName:"targets" type:"list" required:"true"` +// The number of allowed conflict resolution entries was exceeded. +type MaximumConflictResolutionEntriesExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The title of the pull request. This title will be used to identify the pull - // request to other users in the repository. - // - // Title is a required field - Title *string `locationName:"title" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s CreatePullRequestInput) String() string { +func (s MaximumConflictResolutionEntriesExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreatePullRequestInput) GoString() string { +func (s MaximumConflictResolutionEntriesExceededException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePullRequestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePullRequestInput"} - if s.Targets == nil { - invalidParams.Add(request.NewErrParamRequired("Targets")) - } - if s.Title == nil { - invalidParams.Add(request.NewErrParamRequired("Title")) - } - 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)) - } - } +func newErrorMaximumConflictResolutionEntriesExceededException(v protocol.ResponseMetadata) error { + return &MaximumConflictResolutionEntriesExceededException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s MaximumConflictResolutionEntriesExceededException) Code() string { + return "MaximumConflictResolutionEntriesExceededException" +} + +// Message returns the exception's message. +func (s MaximumConflictResolutionEntriesExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *CreatePullRequestInput) SetClientRequestToken(v string) *CreatePullRequestInput { - s.ClientRequestToken = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaximumConflictResolutionEntriesExceededException) OrigErr() error { + return nil } -// SetDescription sets the Description field's value. -func (s *CreatePullRequestInput) SetDescription(v string) *CreatePullRequestInput { - s.Description = &v - return s +func (s MaximumConflictResolutionEntriesExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetTargets sets the Targets field's value. -func (s *CreatePullRequestInput) SetTargets(v []*Target) *CreatePullRequestInput { - s.Targets = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s MaximumConflictResolutionEntriesExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetTitle sets the Title field's value. -func (s *CreatePullRequestInput) SetTitle(v string) *CreatePullRequestInput { - s.Title = &v - return s +// RequestID returns the service's response RequestID for request. +func (s MaximumConflictResolutionEntriesExceededException) RequestID() string { + return s.respMetadata.RequestID } -type CreatePullRequestOutput struct { - _ struct{} `type:"structure"` +// The number of files to load exceeds the allowed limit. +type MaximumFileContentToLoadExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Information about the newly created pull request. - // - // PullRequest is a required field - PullRequest *PullRequest `locationName:"pullRequest" type:"structure" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s CreatePullRequestOutput) String() string { +func (s MaximumFileContentToLoadExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreatePullRequestOutput) GoString() string { +func (s MaximumFileContentToLoadExceededException) GoString() string { return s.String() } -// SetPullRequest sets the PullRequest field's value. -func (s *CreatePullRequestOutput) SetPullRequest(v *PullRequest) *CreatePullRequestOutput { - s.PullRequest = v - return s +func newErrorMaximumFileContentToLoadExceededException(v protocol.ResponseMetadata) error { + return &MaximumFileContentToLoadExceededException{ + respMetadata: v, + } } -// Represents the input of a create repository operation. -type CreateRepositoryInput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s MaximumFileContentToLoadExceededException) Code() string { + return "MaximumFileContentToLoadExceededException" +} - // 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"` +// Message returns the exception's message. +func (s MaximumFileContentToLoadExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // 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 (https://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"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaximumFileContentToLoadExceededException) OrigErr() error { + return nil +} - // One or more tag key-value pairs to use when tagging this repository. - Tags map[string]*string `locationName:"tags" type:"map"` +func (s MaximumFileContentToLoadExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MaximumFileContentToLoadExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MaximumFileContentToLoadExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The number of specified files to change as part of this commit exceeds the +// maximum number of files that can be changed in a single commit. Consider +// using a Git client for these changes. +type MaximumFileEntriesExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s CreateRepositoryInput) String() string { +func (s MaximumFileEntriesExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateRepositoryInput) GoString() string { +func (s MaximumFileEntriesExceededException) 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)) +func newErrorMaximumFileEntriesExceededException(v protocol.ResponseMetadata) error { + return &MaximumFileEntriesExceededException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s MaximumFileEntriesExceededException) Code() string { + return "MaximumFileEntriesExceededException" +} + +// Message returns the exception's message. +func (s MaximumFileEntriesExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaximumFileEntriesExceededException) OrigErr() error { return nil } -// SetRepositoryDescription sets the RepositoryDescription field's value. -func (s *CreateRepositoryInput) SetRepositoryDescription(v string) *CreateRepositoryInput { - s.RepositoryDescription = &v - return s +func (s MaximumFileEntriesExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetRepositoryName sets the RepositoryName field's value. -func (s *CreateRepositoryInput) SetRepositoryName(v string) *CreateRepositoryInput { - s.RepositoryName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s MaximumFileEntriesExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetTags sets the Tags field's value. -func (s *CreateRepositoryInput) SetTags(v map[string]*string) *CreateRepositoryInput { - s.Tags = v - return s +// RequestID returns the service's response RequestID for request. +func (s MaximumFileEntriesExceededException) RequestID() string { + return s.respMetadata.RequestID } -// Represents the output of a create repository operation. -type CreateRepositoryOutput struct { - _ struct{} `type:"structure"` +// The number of items to compare between the source or destination branches +// and the merge base has exceeded the maximum allowed. +type MaximumItemsToCompareExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Information about the newly created repository. - RepositoryMetadata *RepositoryMetadata `locationName:"repositoryMetadata" type:"structure"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s CreateRepositoryOutput) String() string { +func (s MaximumItemsToCompareExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateRepositoryOutput) GoString() string { +func (s MaximumItemsToCompareExceededException) GoString() string { return s.String() } -// SetRepositoryMetadata sets the RepositoryMetadata field's value. -func (s *CreateRepositoryOutput) SetRepositoryMetadata(v *RepositoryMetadata) *CreateRepositoryOutput { - s.RepositoryMetadata = v - return s +func newErrorMaximumItemsToCompareExceededException(v protocol.ResponseMetadata) error { + return &MaximumItemsToCompareExceededException{ + respMetadata: v, + } } -type CreateUnreferencedMergeCommitInput struct { - _ struct{} `type:"structure"` - - // The name of the author who created the unreferenced commit. This information - // will be used as both the author and committer for the commit. - AuthorName *string `locationName:"authorName" type:"string"` - - // The commit message for the unreferenced commit. - CommitMessage *string `locationName:"commitMessage" type:"string"` - - // The level of conflict detail to use. If unspecified, the default FILE_LEVEL - // is used, which will return a not mergeable result if the same file has differences - // in both branches. If LINE_LEVEL is specified, a conflict will be considered - // not mergeable if the same file in both branches has differences on the same - // line. - ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` - - // A list of inputs to use when resolving conflicts during a merge if AUTOMERGE - // is chosen as the conflict resolution strategy. - ConflictResolution *ConflictResolution `locationName:"conflictResolution" type:"structure"` +// Code returns the exception type name. +func (s MaximumItemsToCompareExceededException) Code() string { + return "MaximumItemsToCompareExceededException" +} - // Specifies which branch to use when resolving conflicts, or whether to attempt - // automatically merging two versions of a file. The default is NONE, which - // requires any conflicts to be resolved manually before the merge operation - // will be successful. - ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` +// Message returns the exception's message. +func (s MaximumItemsToCompareExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. - // - // DestinationCommitSpecifier is a required field - DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaximumItemsToCompareExceededException) OrigErr() error { + return nil +} - // The email address for the person who created the unreferenced commit. - Email *string `locationName:"email" type:"string"` +func (s MaximumItemsToCompareExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // If the commit contains deletions, whether to keep a folder or folder structure - // if the changes leave the folders empty. If this is specified as true, a .gitkeep - // file will be created for empty folders. The default is false. - KeepEmptyFolders *bool `locationName:"keepEmptyFolders" type:"boolean"` +// Status code returns the HTTP status code for the request's response error. +func (s MaximumItemsToCompareExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The merge option or strategy you want to use to merge the code. - // - // MergeOption is a required field - MergeOption *string `locationName:"mergeOption" type:"string" required:"true" enum:"MergeOptionTypeEnum"` +// RequestID returns the service's response RequestID for request. +func (s MaximumItemsToCompareExceededException) RequestID() string { + return s.respMetadata.RequestID +} - // The name of the repository where you want to create the unreferenced merge - // commit. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +// The number of approvals required for the approval rule exceeds the maximum +// number allowed. +type MaximumNumberOfApprovalsExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. - // - // SourceCommitSpecifier is a required field - SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s CreateUnreferencedMergeCommitInput) String() string { +func (s MaximumNumberOfApprovalsExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateUnreferencedMergeCommitInput) GoString() string { +func (s MaximumNumberOfApprovalsExceededException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateUnreferencedMergeCommitInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateUnreferencedMergeCommitInput"} - if s.DestinationCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) - } - if s.MergeOption == nil { - invalidParams.Add(request.NewErrParamRequired("MergeOption")) - } - 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.SourceCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) - } - if s.ConflictResolution != nil { - if err := s.ConflictResolution.Validate(); err != nil { - invalidParams.AddNested("ConflictResolution", err.(request.ErrInvalidParams)) - } +func newErrorMaximumNumberOfApprovalsExceededException(v protocol.ResponseMetadata) error { + return &MaximumNumberOfApprovalsExceededException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s MaximumNumberOfApprovalsExceededException) Code() string { + return "MaximumNumberOfApprovalsExceededException" +} + +// Message returns the exception's message. +func (s MaximumNumberOfApprovalsExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaximumNumberOfApprovalsExceededException) OrigErr() error { return nil } -// SetAuthorName sets the AuthorName field's value. -func (s *CreateUnreferencedMergeCommitInput) SetAuthorName(v string) *CreateUnreferencedMergeCommitInput { - s.AuthorName = &v - return s +func (s MaximumNumberOfApprovalsExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetCommitMessage sets the CommitMessage field's value. -func (s *CreateUnreferencedMergeCommitInput) SetCommitMessage(v string) *CreateUnreferencedMergeCommitInput { - s.CommitMessage = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s MaximumNumberOfApprovalsExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetConflictDetailLevel sets the ConflictDetailLevel field's value. -func (s *CreateUnreferencedMergeCommitInput) SetConflictDetailLevel(v string) *CreateUnreferencedMergeCommitInput { - s.ConflictDetailLevel = &v - return s +// RequestID returns the service's response RequestID for request. +func (s MaximumNumberOfApprovalsExceededException) RequestID() string { + return s.respMetadata.RequestID } -// SetConflictResolution sets the ConflictResolution field's value. -func (s *CreateUnreferencedMergeCommitInput) SetConflictResolution(v *ConflictResolution) *CreateUnreferencedMergeCommitInput { - s.ConflictResolution = v - return s +// You cannot create the pull request because the repository has too many open +// pull requests. The maximum number of open pull requests for a repository +// is 1,000. Close one or more open pull requests, and then try again. +type MaximumOpenPullRequestsExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. -func (s *CreateUnreferencedMergeCommitInput) SetConflictResolutionStrategy(v string) *CreateUnreferencedMergeCommitInput { - s.ConflictResolutionStrategy = &v - return s +// String returns the string representation +func (s MaximumOpenPullRequestsExceededException) String() string { + return awsutil.Prettify(s) } -// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. -func (s *CreateUnreferencedMergeCommitInput) SetDestinationCommitSpecifier(v string) *CreateUnreferencedMergeCommitInput { - s.DestinationCommitSpecifier = &v - return s +// GoString returns the string representation +func (s MaximumOpenPullRequestsExceededException) GoString() string { + return s.String() +} + +func newErrorMaximumOpenPullRequestsExceededException(v protocol.ResponseMetadata) error { + return &MaximumOpenPullRequestsExceededException{ + respMetadata: v, + } } -// SetEmail sets the Email field's value. -func (s *CreateUnreferencedMergeCommitInput) SetEmail(v string) *CreateUnreferencedMergeCommitInput { - s.Email = &v - return s +// Code returns the exception type name. +func (s MaximumOpenPullRequestsExceededException) Code() string { + return "MaximumOpenPullRequestsExceededException" } -// SetKeepEmptyFolders sets the KeepEmptyFolders field's value. -func (s *CreateUnreferencedMergeCommitInput) SetKeepEmptyFolders(v bool) *CreateUnreferencedMergeCommitInput { - s.KeepEmptyFolders = &v - return s +// Message returns the exception's message. +func (s MaximumOpenPullRequestsExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetMergeOption sets the MergeOption field's value. -func (s *CreateUnreferencedMergeCommitInput) SetMergeOption(v string) *CreateUnreferencedMergeCommitInput { - s.MergeOption = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaximumOpenPullRequestsExceededException) OrigErr() error { + return nil } -// SetRepositoryName sets the RepositoryName field's value. -func (s *CreateUnreferencedMergeCommitInput) SetRepositoryName(v string) *CreateUnreferencedMergeCommitInput { - s.RepositoryName = &v - return s +func (s MaximumOpenPullRequestsExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. -func (s *CreateUnreferencedMergeCommitInput) SetSourceCommitSpecifier(v string) *CreateUnreferencedMergeCommitInput { - s.SourceCommitSpecifier = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s MaximumOpenPullRequestsExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -type CreateUnreferencedMergeCommitOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s MaximumOpenPullRequestsExceededException) RequestID() string { + return s.respMetadata.RequestID +} - // The full commit ID of the commit that contains your merge results. - CommitId *string `locationName:"commitId" type:"string"` +// The maximum number of allowed repository names was exceeded. Currently, this +// number is 100. +type MaximumRepositoryNamesExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The full SHA-1 pointer of the tree information for the commit that contains - // the merge results. - TreeId *string `locationName:"treeId" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s CreateUnreferencedMergeCommitOutput) String() string { +func (s MaximumRepositoryNamesExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateUnreferencedMergeCommitOutput) GoString() string { +func (s MaximumRepositoryNamesExceededException) GoString() string { return s.String() } -// SetCommitId sets the CommitId field's value. -func (s *CreateUnreferencedMergeCommitOutput) SetCommitId(v string) *CreateUnreferencedMergeCommitOutput { - s.CommitId = &v - return s +func newErrorMaximumRepositoryNamesExceededException(v protocol.ResponseMetadata) error { + return &MaximumRepositoryNamesExceededException{ + respMetadata: v, + } } -// SetTreeId sets the TreeId field's value. -func (s *CreateUnreferencedMergeCommitOutput) SetTreeId(v string) *CreateUnreferencedMergeCommitOutput { - s.TreeId = &v - return s +// Code returns the exception type name. +func (s MaximumRepositoryNamesExceededException) Code() string { + return "MaximumRepositoryNamesExceededException" } -// Represents the input of a delete branch operation. -type DeleteBranchInput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s MaximumRepositoryNamesExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The name of the branch to delete. - // - // BranchName is a required field - BranchName *string `locationName:"branchName" min:"1" type:"string" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaximumRepositoryNamesExceededException) OrigErr() error { + return nil +} - // The name of the repository that contains the branch to be deleted. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +func (s MaximumRepositoryNamesExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MaximumRepositoryNamesExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MaximumRepositoryNamesExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The number of triggers allowed for the repository was exceeded. +type MaximumRepositoryTriggersExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DeleteBranchInput) String() string { +func (s MaximumRepositoryTriggersExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteBranchInput) GoString() string { +func (s MaximumRepositoryTriggersExceededException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBranchInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBranchInput"} - 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.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) +func newErrorMaximumRepositoryTriggersExceededException(v protocol.ResponseMetadata) error { + return &MaximumRepositoryTriggersExceededException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s MaximumRepositoryTriggersExceededException) Code() string { + return "MaximumRepositoryTriggersExceededException" +} + +// Message returns the exception's message. +func (s MaximumRepositoryTriggersExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaximumRepositoryTriggersExceededException) OrigErr() error { return nil } -// SetBranchName sets the BranchName field's value. -func (s *DeleteBranchInput) SetBranchName(v string) *DeleteBranchInput { - s.BranchName = &v - return s +func (s MaximumRepositoryTriggersExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetRepositoryName sets the RepositoryName field's value. -func (s *DeleteBranchInput) SetRepositoryName(v string) *DeleteBranchInput { - s.RepositoryName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s MaximumRepositoryTriggersExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// Represents the output of a delete branch operation. -type DeleteBranchOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s MaximumRepositoryTriggersExceededException) RequestID() string { + return s.respMetadata.RequestID +} - // Information about the branch deleted by the operation, including the branch - // name and the commit ID that was the tip of the branch. - DeletedBranch *BranchInfo `locationName:"deletedBranch" type:"structure"` +// The maximum number of approval rule templates for a repository has been exceeded. +// You cannot associate more than 25 approval rule templates with a repository. +type MaximumRuleTemplatesAssociatedWithRepositoryException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DeleteBranchOutput) String() string { +func (s MaximumRuleTemplatesAssociatedWithRepositoryException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteBranchOutput) GoString() string { +func (s MaximumRuleTemplatesAssociatedWithRepositoryException) GoString() string { return s.String() } -// SetDeletedBranch sets the DeletedBranch field's value. -func (s *DeleteBranchOutput) SetDeletedBranch(v *BranchInfo) *DeleteBranchOutput { - s.DeletedBranch = v - return s +func newErrorMaximumRuleTemplatesAssociatedWithRepositoryException(v protocol.ResponseMetadata) error { + return &MaximumRuleTemplatesAssociatedWithRepositoryException{ + respMetadata: v, + } } -type DeleteCommentContentInput struct { +// Code returns the exception type name. +func (s MaximumRuleTemplatesAssociatedWithRepositoryException) Code() string { + return "MaximumRuleTemplatesAssociatedWithRepositoryException" +} + +// Message returns the exception's message. +func (s MaximumRuleTemplatesAssociatedWithRepositoryException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaximumRuleTemplatesAssociatedWithRepositoryException) OrigErr() error { + return nil +} + +func (s MaximumRuleTemplatesAssociatedWithRepositoryException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MaximumRuleTemplatesAssociatedWithRepositoryException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MaximumRuleTemplatesAssociatedWithRepositoryException) RequestID() string { + return s.respMetadata.RequestID +} + +type MergeBranchesByFastForwardInput struct { _ struct{} `type:"structure"` - // The unique, system-generated ID of the comment. To get this ID, use GetCommentsForComparedCommit - // or GetCommentsForPullRequest. + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). // - // CommentId is a required field - CommentId *string `locationName:"commentId" type:"string" required:"true"` + // DestinationCommitSpecifier is a required field + DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` + + // The name of the repository where you want to merge two branches. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). + // + // SourceCommitSpecifier is a required field + SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` + + // The branch where the merge is applied. + TargetBranch *string `locationName:"targetBranch" min:"1" type:"string"` } // String returns the string representation -func (s DeleteCommentContentInput) String() string { +func (s MergeBranchesByFastForwardInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteCommentContentInput) GoString() string { +func (s MergeBranchesByFastForwardInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCommentContentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCommentContentInput"} - if s.CommentId == nil { - invalidParams.Add(request.NewErrParamRequired("CommentId")) +func (s *MergeBranchesByFastForwardInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MergeBranchesByFastForwardInput"} + if s.DestinationCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) + } + 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.SourceCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) + } + if s.TargetBranch != nil && len(*s.TargetBranch) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TargetBranch", 1)) } if invalidParams.Len() > 0 { @@ -9801,149 +24482,133 @@ func (s *DeleteCommentContentInput) Validate() error { return nil } -// SetCommentId sets the CommentId field's value. -func (s *DeleteCommentContentInput) SetCommentId(v string) *DeleteCommentContentInput { - s.CommentId = &v +// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. +func (s *MergeBranchesByFastForwardInput) SetDestinationCommitSpecifier(v string) *MergeBranchesByFastForwardInput { + s.DestinationCommitSpecifier = &v return s } -type DeleteCommentContentOutput struct { - _ struct{} `type:"structure"` - - // Information about the comment you just deleted. - Comment *Comment `locationName:"comment" type:"structure"` -} - -// String returns the string representation -func (s DeleteCommentContentOutput) String() string { - return awsutil.Prettify(s) +// SetRepositoryName sets the RepositoryName field's value. +func (s *MergeBranchesByFastForwardInput) SetRepositoryName(v string) *MergeBranchesByFastForwardInput { + s.RepositoryName = &v + return s } -// GoString returns the string representation -func (s DeleteCommentContentOutput) GoString() string { - return s.String() +// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. +func (s *MergeBranchesByFastForwardInput) SetSourceCommitSpecifier(v string) *MergeBranchesByFastForwardInput { + s.SourceCommitSpecifier = &v + return s } -// SetComment sets the Comment field's value. -func (s *DeleteCommentContentOutput) SetComment(v *Comment) *DeleteCommentContentOutput { - s.Comment = v +// SetTargetBranch sets the TargetBranch field's value. +func (s *MergeBranchesByFastForwardInput) SetTargetBranch(v string) *MergeBranchesByFastForwardInput { + s.TargetBranch = &v return s } -// A file that will be deleted as part of a commit. -type DeleteFileEntry struct { +type MergeBranchesByFastForwardOutput struct { _ struct{} `type:"structure"` - // The full path of the file that will be deleted, including the name of the - // file. - // - // FilePath is a required field - FilePath *string `locationName:"filePath" type:"string" required:"true"` + // The commit ID of the merge in the destination or target branch. + CommitId *string `locationName:"commitId" type:"string"` + + // The tree ID of the merge in the destination or target branch. + TreeId *string `locationName:"treeId" type:"string"` } // String returns the string representation -func (s DeleteFileEntry) String() string { +func (s MergeBranchesByFastForwardOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteFileEntry) GoString() string { +func (s MergeBranchesByFastForwardOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteFileEntry) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteFileEntry"} - if s.FilePath == nil { - invalidParams.Add(request.NewErrParamRequired("FilePath")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCommitId sets the CommitId field's value. +func (s *MergeBranchesByFastForwardOutput) SetCommitId(v string) *MergeBranchesByFastForwardOutput { + s.CommitId = &v + return s } -// SetFilePath sets the FilePath field's value. -func (s *DeleteFileEntry) SetFilePath(v string) *DeleteFileEntry { - s.FilePath = &v +// SetTreeId sets the TreeId field's value. +func (s *MergeBranchesByFastForwardOutput) SetTreeId(v string) *MergeBranchesByFastForwardOutput { + s.TreeId = &v return s } -type DeleteFileInput struct { +type MergeBranchesBySquashInput struct { _ struct{} `type:"structure"` - // The name of the branch where the commit will be made deleting the file. - // - // BranchName is a required field - BranchName *string `locationName:"branchName" min:"1" type:"string" required:"true"` + // The name of the author who created the commit. This information is used as + // both the author and committer for the commit. + AuthorName *string `locationName:"authorName" type:"string"` - // The commit message you want to include as part of deleting the file. Commit - // messages are limited to 256 KB. If no message is specified, a default message - // will be used. + // The commit message for the merge. CommitMessage *string `locationName:"commitMessage" type:"string"` - // The email address for the commit that deletes the file. If no email address - // is specified, the email address will be left blank. - Email *string `locationName:"email" type:"string"` + // The level of conflict detail to use. If unspecified, the default FILE_LEVEL + // is used, which returns a not-mergeable result if the same file has differences + // in both branches. If LINE_LEVEL is specified, a conflict is considered not + // mergeable if the same file in both branches has differences on the same line. + ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` + + // If AUTOMERGE is the conflict resolution strategy, a list of inputs to use + // when resolving conflicts during a merge. + ConflictResolution *ConflictResolution `locationName:"conflictResolution" type:"structure"` + + // Specifies which branch to use when resolving conflicts, or whether to attempt + // automatically merging two versions of a file. The default is NONE, which + // requires any conflicts to be resolved manually before the merge operation + // is successful. + ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` - // The fully-qualified path to the file that will be deleted, including the - // full name and extension of that file. For example, /examples/file.md is a - // fully qualified path to a file named file.md in a folder named examples. + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). // - // FilePath is a required field - FilePath *string `locationName:"filePath" type:"string" required:"true"` - - // Specifies whether to delete the folder or directory that contains the file - // you want to delete if that file is the only object in the folder or directory. - // By default, empty folders will be deleted. This includes empty folders that - // are part of the directory structure. For example, if the path to a file is - // dir1/dir2/dir3/dir4, and dir2 and dir3 are empty, deleting the last file - // in dir4 will also delete the empty folders dir4, dir3, and dir2. - KeepEmptyFolders *bool `locationName:"keepEmptyFolders" type:"boolean"` + // DestinationCommitSpecifier is a required field + DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` - // The name of the author of the commit that deletes the file. If no name is - // specified, the user's ARN will be used as the author name and committer name. - Name *string `locationName:"name" type:"string"` + // The email address of the person merging the branches. This information is + // used in the commit information for the merge. + Email *string `locationName:"email" type:"string"` - // The ID of the commit that is the tip of the branch where you want to create - // the commit that will delete the file. This must be the HEAD commit for the - // branch. The commit that deletes the file will be created from this commit - // ID. - // - // ParentCommitId is a required field - ParentCommitId *string `locationName:"parentCommitId" type:"string" required:"true"` + // If the commit contains deletions, whether to keep a folder or folder structure + // if the changes leave the folders empty. If this is specified as true, a .gitkeep + // file is created for empty folders. The default is false. + KeepEmptyFolders *bool `locationName:"keepEmptyFolders" type:"boolean"` - // The name of the repository that contains the file to delete. + // The name of the repository where you want to merge two branches. // // RepositoryName is a required field RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + + // The branch, tag, HEAD, or other fully qualified reference used to identify + // a commit (for example, a branch name or a full commit ID). + // + // SourceCommitSpecifier is a required field + SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` + + // The branch where the merge is applied. + TargetBranch *string `locationName:"targetBranch" min:"1" type:"string"` } // String returns the string representation -func (s DeleteFileInput) String() string { +func (s MergeBranchesBySquashInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteFileInput) GoString() string { +func (s MergeBranchesBySquashInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteFileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteFileInput"} - 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.FilePath == nil { - invalidParams.Add(request.NewErrParamRequired("FilePath")) - } - if s.ParentCommitId == nil { - invalidParams.Add(request.NewErrParamRequired("ParentCommitId")) +func (s *MergeBranchesBySquashInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MergeBranchesBySquashInput"} + if s.DestinationCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) } if s.RepositoryName == nil { invalidParams.Add(request.NewErrParamRequired("RepositoryName")) @@ -9951,6 +24616,17 @@ func (s *DeleteFileInput) Validate() error { if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) } + if s.SourceCommitSpecifier == nil { + invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) + } + if s.TargetBranch != nil && len(*s.TargetBranch) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TargetBranch", 1)) + } + if s.ConflictResolution != nil { + if err := s.ConflictResolution.Validate(); err != nil { + invalidParams.AddNested("ConflictResolution", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -9958,255 +24634,176 @@ func (s *DeleteFileInput) Validate() error { return nil } -// SetBranchName sets the BranchName field's value. -func (s *DeleteFileInput) SetBranchName(v string) *DeleteFileInput { - s.BranchName = &v +// SetAuthorName sets the AuthorName field's value. +func (s *MergeBranchesBySquashInput) SetAuthorName(v string) *MergeBranchesBySquashInput { + s.AuthorName = &v return s } // SetCommitMessage sets the CommitMessage field's value. -func (s *DeleteFileInput) SetCommitMessage(v string) *DeleteFileInput { +func (s *MergeBranchesBySquashInput) SetCommitMessage(v string) *MergeBranchesBySquashInput { s.CommitMessage = &v return s } -// SetEmail sets the Email field's value. -func (s *DeleteFileInput) SetEmail(v string) *DeleteFileInput { - s.Email = &v - return s -} - -// SetFilePath sets the FilePath field's value. -func (s *DeleteFileInput) SetFilePath(v string) *DeleteFileInput { - s.FilePath = &v +// SetConflictDetailLevel sets the ConflictDetailLevel field's value. +func (s *MergeBranchesBySquashInput) SetConflictDetailLevel(v string) *MergeBranchesBySquashInput { + s.ConflictDetailLevel = &v return s } -// SetKeepEmptyFolders sets the KeepEmptyFolders field's value. -func (s *DeleteFileInput) SetKeepEmptyFolders(v bool) *DeleteFileInput { - s.KeepEmptyFolders = &v +// SetConflictResolution sets the ConflictResolution field's value. +func (s *MergeBranchesBySquashInput) SetConflictResolution(v *ConflictResolution) *MergeBranchesBySquashInput { + s.ConflictResolution = v return s } -// SetName sets the Name field's value. -func (s *DeleteFileInput) SetName(v string) *DeleteFileInput { - s.Name = &v +// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. +func (s *MergeBranchesBySquashInput) SetConflictResolutionStrategy(v string) *MergeBranchesBySquashInput { + s.ConflictResolutionStrategy = &v return s } -// SetParentCommitId sets the ParentCommitId field's value. -func (s *DeleteFileInput) SetParentCommitId(v string) *DeleteFileInput { - s.ParentCommitId = &v +// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. +func (s *MergeBranchesBySquashInput) SetDestinationCommitSpecifier(v string) *MergeBranchesBySquashInput { + s.DestinationCommitSpecifier = &v return s } -// SetRepositoryName sets the RepositoryName field's value. -func (s *DeleteFileInput) SetRepositoryName(v string) *DeleteFileInput { - s.RepositoryName = &v +// SetEmail sets the Email field's value. +func (s *MergeBranchesBySquashInput) SetEmail(v string) *MergeBranchesBySquashInput { + s.Email = &v return s } -type DeleteFileOutput struct { - _ struct{} `type:"structure"` - - // The blob ID removed from the tree as part of deleting the file. - // - // BlobId is a required field - BlobId *string `locationName:"blobId" type:"string" required:"true"` - - // The full commit ID of the commit that contains the change that deletes the - // file. - // - // CommitId is a required field - CommitId *string `locationName:"commitId" type:"string" required:"true"` - - // The fully-qualified path to the file that will be deleted, including the - // full name and extension of that file. - // - // FilePath is a required field - FilePath *string `locationName:"filePath" type:"string" required:"true"` - - // The full SHA-1 pointer of the tree information for the commit that contains - // the delete file change. - // - // TreeId is a required field - TreeId *string `locationName:"treeId" type:"string" required:"true"` -} - -// String returns the string representation -func (s DeleteFileOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFileOutput) GoString() string { - return s.String() -} - -// SetBlobId sets the BlobId field's value. -func (s *DeleteFileOutput) SetBlobId(v string) *DeleteFileOutput { - s.BlobId = &v +// SetKeepEmptyFolders sets the KeepEmptyFolders field's value. +func (s *MergeBranchesBySquashInput) SetKeepEmptyFolders(v bool) *MergeBranchesBySquashInput { + s.KeepEmptyFolders = &v return s } -// SetCommitId sets the CommitId field's value. -func (s *DeleteFileOutput) SetCommitId(v string) *DeleteFileOutput { - s.CommitId = &v +// SetRepositoryName sets the RepositoryName field's value. +func (s *MergeBranchesBySquashInput) SetRepositoryName(v string) *MergeBranchesBySquashInput { + s.RepositoryName = &v return s } -// SetFilePath sets the FilePath field's value. -func (s *DeleteFileOutput) SetFilePath(v string) *DeleteFileOutput { - s.FilePath = &v +// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. +func (s *MergeBranchesBySquashInput) SetSourceCommitSpecifier(v string) *MergeBranchesBySquashInput { + s.SourceCommitSpecifier = &v return s } -// SetTreeId sets the TreeId field's value. -func (s *DeleteFileOutput) SetTreeId(v string) *DeleteFileOutput { - s.TreeId = &v +// SetTargetBranch sets the TargetBranch field's value. +func (s *MergeBranchesBySquashInput) SetTargetBranch(v string) *MergeBranchesBySquashInput { + s.TargetBranch = &v return s } -// Represents the input of a delete repository operation. -type DeleteRepositoryInput struct { +type MergeBranchesBySquashOutput 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"` + // The commit ID of the merge in the destination or target branch. + CommitId *string `locationName:"commitId" type:"string"` + + // The tree ID of the merge in the destination or target branch. + TreeId *string `locationName:"treeId" type:"string"` } // String returns the string representation -func (s DeleteRepositoryInput) String() string { +func (s MergeBranchesBySquashOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteRepositoryInput) GoString() string { +func (s MergeBranchesBySquashOutput) 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 +// SetCommitId sets the CommitId field's value. +func (s *MergeBranchesBySquashOutput) SetCommitId(v string) *MergeBranchesBySquashOutput { + s.CommitId = &v + return s } -// SetRepositoryName sets the RepositoryName field's value. -func (s *DeleteRepositoryInput) SetRepositoryName(v string) *DeleteRepositoryInput { - s.RepositoryName = &v +// SetTreeId sets the TreeId field's value. +func (s *MergeBranchesBySquashOutput) SetTreeId(v string) *MergeBranchesBySquashOutput { + s.TreeId = &v return s } -// Represents the output of a delete repository operation. -type DeleteRepositoryOutput struct { +type MergeBranchesByThreeWayInput 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 -} + // The name of the author who created the commit. This information is used as + // both the author and committer for the commit. + AuthorName *string `locationName:"authorName" type:"string"` -type DescribeMergeConflictsInput struct { - _ struct{} `type:"structure"` + // The commit message to include in the commit information for the merge. + CommitMessage *string `locationName:"commitMessage" type:"string"` // The level of conflict detail to use. If unspecified, the default FILE_LEVEL - // is used, which will return a not mergeable result if the same file has differences - // in both branches. If LINE_LEVEL is specified, a conflict will be considered - // not mergeable if the same file in both branches has differences on the same - // line. + // is used, which returns a not-mergeable result if the same file has differences + // in both branches. If LINE_LEVEL is specified, a conflict is considered not + // mergeable if the same file in both branches has differences on the same line. ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` + // If AUTOMERGE is the conflict resolution strategy, a list of inputs to use + // when resolving conflicts during a merge. + ConflictResolution *ConflictResolution `locationName:"conflictResolution" type:"structure"` + // Specifies which branch to use when resolving conflicts, or whether to attempt // automatically merging two versions of a file. The default is NONE, which // requires any conflicts to be resolved manually before the merge operation - // will be successful. + // is successful. ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. + // a commit (for example, a branch name or a full commit ID). // // DestinationCommitSpecifier is a required field DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` - // The path of the target files used to describe the conflicts. - // - // FilePath is a required field - FilePath *string `locationName:"filePath" type:"string" required:"true"` - - // The maximum number of merge hunks to include in the output. - MaxMergeHunks *int64 `locationName:"maxMergeHunks" type:"integer"` - - // The merge option or strategy you want to use to merge the code. - // - // MergeOption is a required field - MergeOption *string `locationName:"mergeOption" type:"string" required:"true" enum:"MergeOptionTypeEnum"` + // The email address of the person merging the branches. This information is + // used in the commit information for the merge. + Email *string `locationName:"email" type:"string"` - // An enumeration token that when provided in a request, returns the next batch - // of the results. - NextToken *string `locationName:"nextToken" type:"string"` + // If the commit contains deletions, whether to keep a folder or folder structure + // if the changes leave the folders empty. If true, a .gitkeep file is created + // for empty folders. The default is false. + KeepEmptyFolders *bool `locationName:"keepEmptyFolders" type:"boolean"` - // The name of the repository where you want to get information about a merge - // conflict. + // The name of the repository where you want to merge two branches. // // RepositoryName is a required field RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. + // a commit (for example, a branch name or a full commit ID). // // SourceCommitSpecifier is a required field SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` + + // The branch where the merge is applied. + TargetBranch *string `locationName:"targetBranch" min:"1" type:"string"` } // String returns the string representation -func (s DescribeMergeConflictsInput) String() string { +func (s MergeBranchesByThreeWayInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeMergeConflictsInput) GoString() string { +func (s MergeBranchesByThreeWayInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeMergeConflictsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeMergeConflictsInput"} +func (s *MergeBranchesByThreeWayInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MergeBranchesByThreeWayInput"} if s.DestinationCommitSpecifier == nil { invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) } - if s.FilePath == nil { - invalidParams.Add(request.NewErrParamRequired("FilePath")) - } - if s.MergeOption == nil { - invalidParams.Add(request.NewErrParamRequired("MergeOption")) - } if s.RepositoryName == nil { invalidParams.Add(request.NewErrParamRequired("RepositoryName")) } @@ -10216,6 +24813,14 @@ func (s *DescribeMergeConflictsInput) Validate() error { if s.SourceCommitSpecifier == nil { invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) } + if s.TargetBranch != nil && len(*s.TargetBranch) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TargetBranch", 1)) + } + if s.ConflictResolution != nil { + if err := s.ConflictResolution.Validate(); err != nil { + invalidParams.AddNested("ConflictResolution", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -10223,551 +24828,669 @@ func (s *DescribeMergeConflictsInput) Validate() error { return nil } -// SetConflictDetailLevel sets the ConflictDetailLevel field's value. -func (s *DescribeMergeConflictsInput) SetConflictDetailLevel(v string) *DescribeMergeConflictsInput { - s.ConflictDetailLevel = &v +// SetAuthorName sets the AuthorName field's value. +func (s *MergeBranchesByThreeWayInput) SetAuthorName(v string) *MergeBranchesByThreeWayInput { + s.AuthorName = &v return s } -// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. -func (s *DescribeMergeConflictsInput) SetConflictResolutionStrategy(v string) *DescribeMergeConflictsInput { - s.ConflictResolutionStrategy = &v +// SetCommitMessage sets the CommitMessage field's value. +func (s *MergeBranchesByThreeWayInput) SetCommitMessage(v string) *MergeBranchesByThreeWayInput { + s.CommitMessage = &v return s } -// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. -func (s *DescribeMergeConflictsInput) SetDestinationCommitSpecifier(v string) *DescribeMergeConflictsInput { - s.DestinationCommitSpecifier = &v +// SetConflictDetailLevel sets the ConflictDetailLevel field's value. +func (s *MergeBranchesByThreeWayInput) SetConflictDetailLevel(v string) *MergeBranchesByThreeWayInput { + s.ConflictDetailLevel = &v return s } -// SetFilePath sets the FilePath field's value. -func (s *DescribeMergeConflictsInput) SetFilePath(v string) *DescribeMergeConflictsInput { - s.FilePath = &v +// SetConflictResolution sets the ConflictResolution field's value. +func (s *MergeBranchesByThreeWayInput) SetConflictResolution(v *ConflictResolution) *MergeBranchesByThreeWayInput { + s.ConflictResolution = v return s } -// SetMaxMergeHunks sets the MaxMergeHunks field's value. -func (s *DescribeMergeConflictsInput) SetMaxMergeHunks(v int64) *DescribeMergeConflictsInput { - s.MaxMergeHunks = &v +// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. +func (s *MergeBranchesByThreeWayInput) SetConflictResolutionStrategy(v string) *MergeBranchesByThreeWayInput { + s.ConflictResolutionStrategy = &v return s } -// SetMergeOption sets the MergeOption field's value. -func (s *DescribeMergeConflictsInput) SetMergeOption(v string) *DescribeMergeConflictsInput { - s.MergeOption = &v +// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. +func (s *MergeBranchesByThreeWayInput) SetDestinationCommitSpecifier(v string) *MergeBranchesByThreeWayInput { + s.DestinationCommitSpecifier = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeMergeConflictsInput) SetNextToken(v string) *DescribeMergeConflictsInput { - s.NextToken = &v +// SetEmail sets the Email field's value. +func (s *MergeBranchesByThreeWayInput) SetEmail(v string) *MergeBranchesByThreeWayInput { + s.Email = &v + return s +} + +// SetKeepEmptyFolders sets the KeepEmptyFolders field's value. +func (s *MergeBranchesByThreeWayInput) SetKeepEmptyFolders(v bool) *MergeBranchesByThreeWayInput { + s.KeepEmptyFolders = &v return s } // SetRepositoryName sets the RepositoryName field's value. -func (s *DescribeMergeConflictsInput) SetRepositoryName(v string) *DescribeMergeConflictsInput { +func (s *MergeBranchesByThreeWayInput) SetRepositoryName(v string) *MergeBranchesByThreeWayInput { s.RepositoryName = &v return s } // SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. -func (s *DescribeMergeConflictsInput) SetSourceCommitSpecifier(v string) *DescribeMergeConflictsInput { +func (s *MergeBranchesByThreeWayInput) SetSourceCommitSpecifier(v string) *MergeBranchesByThreeWayInput { s.SourceCommitSpecifier = &v return s } -type DescribeMergeConflictsOutput struct { - _ struct{} `type:"structure"` - - // The commit ID of the merge base. - BaseCommitId *string `locationName:"baseCommitId" type:"string"` - - // Contains metadata about the conflicts found in the merge. - // - // ConflictMetadata is a required field - ConflictMetadata *ConflictMetadata `locationName:"conflictMetadata" type:"structure" required:"true"` - - // The commit ID of the destination commit specifier that was used in the merge - // evaluation. - // - // DestinationCommitId is a required field - DestinationCommitId *string `locationName:"destinationCommitId" type:"string" required:"true"` +// SetTargetBranch sets the TargetBranch field's value. +func (s *MergeBranchesByThreeWayInput) SetTargetBranch(v string) *MergeBranchesByThreeWayInput { + s.TargetBranch = &v + return s +} - // A list of merge hunks of the differences between the files or lines. - // - // MergeHunks is a required field - MergeHunks []*MergeHunk `locationName:"mergeHunks" type:"list" required:"true"` +type MergeBranchesByThreeWayOutput struct { + _ struct{} `type:"structure"` - // An enumeration token that can be used in a request to return the next batch - // of the results. - NextToken *string `locationName:"nextToken" type:"string"` + // The commit ID of the merge in the destination or target branch. + CommitId *string `locationName:"commitId" type:"string"` - // The commit ID of the source commit specifier that was used in the merge evaluation. - // - // SourceCommitId is a required field - SourceCommitId *string `locationName:"sourceCommitId" type:"string" required:"true"` + // The tree ID of the merge in the destination or target branch. + TreeId *string `locationName:"treeId" type:"string"` } // String returns the string representation -func (s DescribeMergeConflictsOutput) String() string { +func (s MergeBranchesByThreeWayOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeMergeConflictsOutput) GoString() string { +func (s MergeBranchesByThreeWayOutput) GoString() string { return s.String() } -// SetBaseCommitId sets the BaseCommitId field's value. -func (s *DescribeMergeConflictsOutput) SetBaseCommitId(v string) *DescribeMergeConflictsOutput { - s.BaseCommitId = &v +// SetCommitId sets the CommitId field's value. +func (s *MergeBranchesByThreeWayOutput) SetCommitId(v string) *MergeBranchesByThreeWayOutput { + s.CommitId = &v return s } -// SetConflictMetadata sets the ConflictMetadata field's value. -func (s *DescribeMergeConflictsOutput) SetConflictMetadata(v *ConflictMetadata) *DescribeMergeConflictsOutput { - s.ConflictMetadata = v +// SetTreeId sets the TreeId field's value. +func (s *MergeBranchesByThreeWayOutput) SetTreeId(v string) *MergeBranchesByThreeWayOutput { + s.TreeId = &v return s } -// SetDestinationCommitId sets the DestinationCommitId field's value. -func (s *DescribeMergeConflictsOutput) SetDestinationCommitId(v string) *DescribeMergeConflictsOutput { - s.DestinationCommitId = &v +// Information about merge hunks in a merge or pull request operation. +type MergeHunk struct { + _ struct{} `type:"structure"` + + // Information about the merge hunk in the base of a merge or pull request. + Base *MergeHunkDetail `locationName:"base" type:"structure"` + + // Information about the merge hunk in the destination of a merge or pull request. + Destination *MergeHunkDetail `locationName:"destination" type:"structure"` + + // A Boolean value indicating whether a combination of hunks contains a conflict. + // Conflicts occur when the same file or the same lines in a file were modified + // in both the source and destination of a merge or pull request. Valid values + // include true, false, and null. True when the hunk represents a conflict and + // one or more files contains a line conflict. File mode conflicts in a merge + // do not set this to true. + IsConflict *bool `locationName:"isConflict" type:"boolean"` + + // Information about the merge hunk in the source of a merge or pull request. + Source *MergeHunkDetail `locationName:"source" type:"structure"` +} + +// String returns the string representation +func (s MergeHunk) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MergeHunk) GoString() string { + return s.String() +} + +// SetBase sets the Base field's value. +func (s *MergeHunk) SetBase(v *MergeHunkDetail) *MergeHunk { + s.Base = v return s } -// SetMergeHunks sets the MergeHunks field's value. -func (s *DescribeMergeConflictsOutput) SetMergeHunks(v []*MergeHunk) *DescribeMergeConflictsOutput { - s.MergeHunks = v +// SetDestination sets the Destination field's value. +func (s *MergeHunk) SetDestination(v *MergeHunkDetail) *MergeHunk { + s.Destination = v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeMergeConflictsOutput) SetNextToken(v string) *DescribeMergeConflictsOutput { - s.NextToken = &v +// SetIsConflict sets the IsConflict field's value. +func (s *MergeHunk) SetIsConflict(v bool) *MergeHunk { + s.IsConflict = &v return s } -// SetSourceCommitId sets the SourceCommitId field's value. -func (s *DescribeMergeConflictsOutput) SetSourceCommitId(v string) *DescribeMergeConflictsOutput { - s.SourceCommitId = &v +// SetSource sets the Source field's value. +func (s *MergeHunk) SetSource(v *MergeHunkDetail) *MergeHunk { + s.Source = v return s } -type DescribePullRequestEventsInput struct { +// Information about the details of a merge hunk that contains a conflict in +// a merge or pull request operation. +type MergeHunkDetail struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the user whose actions resulted in the - // event. Examples include updating the pull request with additional commits - // or changing the status of a pull request. - ActorArn *string `locationName:"actorArn" type:"string"` - - // A non-negative integer used to limit the number of returned results. The - // default is 100 events, which is also the maximum number of events that can - // be returned in a result. - MaxResults *int64 `locationName:"maxResults" type:"integer"` - - // An enumeration token that when provided in a request, returns the next batch - // of the results. - NextToken *string `locationName:"nextToken" type:"string"` + // The end position of the hunk in the merge result. + EndLine *int64 `locationName:"endLine" type:"integer"` - // Optional. The pull request event type about which you want to return information. - PullRequestEventType *string `locationName:"pullRequestEventType" type:"string" enum:"PullRequestEventType"` + // The base-64 encoded content of the hunk merged region that might contain + // a conflict. + HunkContent *string `locationName:"hunkContent" type:"string"` - // The system-generated ID of the pull request. To get this ID, use ListPullRequests. - // - // PullRequestId is a required field - PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` + // The start position of the hunk in the merge result. + StartLine *int64 `locationName:"startLine" type:"integer"` } // String returns the string representation -func (s DescribePullRequestEventsInput) String() string { +func (s MergeHunkDetail) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribePullRequestEventsInput) GoString() string { +func (s MergeHunkDetail) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribePullRequestEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribePullRequestEventsInput"} - if s.PullRequestId == nil { - invalidParams.Add(request.NewErrParamRequired("PullRequestId")) - } +// SetEndLine sets the EndLine field's value. +func (s *MergeHunkDetail) SetEndLine(v int64) *MergeHunkDetail { + s.EndLine = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetHunkContent sets the HunkContent field's value. +func (s *MergeHunkDetail) SetHunkContent(v string) *MergeHunkDetail { + s.HunkContent = &v + return s } -// SetActorArn sets the ActorArn field's value. -func (s *DescribePullRequestEventsInput) SetActorArn(v string) *DescribePullRequestEventsInput { - s.ActorArn = &v +// SetStartLine sets the StartLine field's value. +func (s *MergeHunkDetail) SetStartLine(v int64) *MergeHunkDetail { + s.StartLine = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *DescribePullRequestEventsInput) SetMaxResults(v int64) *DescribePullRequestEventsInput { - s.MaxResults = &v +// Returns information about a merge or potential merge between a source reference +// and a destination reference in a pull request. +type MergeMetadata struct { + _ struct{} `type:"structure"` + + // A Boolean value indicating whether the merge has been made. + IsMerged *bool `locationName:"isMerged" type:"boolean"` + + // The commit ID for the merge commit, if any. + MergeCommitId *string `locationName:"mergeCommitId" type:"string"` + + // The merge strategy used in the merge. + MergeOption *string `locationName:"mergeOption" type:"string" enum:"MergeOptionTypeEnum"` + + // The Amazon Resource Name (ARN) of the user who merged the branches. + MergedBy *string `locationName:"mergedBy" type:"string"` +} + +// String returns the string representation +func (s MergeMetadata) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MergeMetadata) GoString() string { + return s.String() +} + +// SetIsMerged sets the IsMerged field's value. +func (s *MergeMetadata) SetIsMerged(v bool) *MergeMetadata { + s.IsMerged = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribePullRequestEventsInput) SetNextToken(v string) *DescribePullRequestEventsInput { - s.NextToken = &v +// SetMergeCommitId sets the MergeCommitId field's value. +func (s *MergeMetadata) SetMergeCommitId(v string) *MergeMetadata { + s.MergeCommitId = &v return s } -// SetPullRequestEventType sets the PullRequestEventType field's value. -func (s *DescribePullRequestEventsInput) SetPullRequestEventType(v string) *DescribePullRequestEventsInput { - s.PullRequestEventType = &v +// SetMergeOption sets the MergeOption field's value. +func (s *MergeMetadata) SetMergeOption(v string) *MergeMetadata { + s.MergeOption = &v return s } -// SetPullRequestId sets the PullRequestId field's value. -func (s *DescribePullRequestEventsInput) SetPullRequestId(v string) *DescribePullRequestEventsInput { - s.PullRequestId = &v +// SetMergedBy sets the MergedBy field's value. +func (s *MergeMetadata) SetMergedBy(v string) *MergeMetadata { + s.MergedBy = &v return s } -type DescribePullRequestEventsOutput struct { +// Information about the file operation conflicts in a merge operation. +type MergeOperations struct { _ struct{} `type:"structure"` - // An enumeration token that can be used in a request to return the next batch - // of the results. - NextToken *string `locationName:"nextToken" type:"string"` + // The operation on a file in the destination of a merge or pull request. + Destination *string `locationName:"destination" type:"string" enum:"ChangeTypeEnum"` - // Information about the pull request events. - // - // PullRequestEvents is a required field - PullRequestEvents []*PullRequestEvent `locationName:"pullRequestEvents" type:"list" required:"true"` + // The operation (add, modify, or delete) on a file in the source of a merge + // or pull request. + Source *string `locationName:"source" type:"string" enum:"ChangeTypeEnum"` } // String returns the string representation -func (s DescribePullRequestEventsOutput) String() string { +func (s MergeOperations) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribePullRequestEventsOutput) GoString() string { +func (s MergeOperations) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribePullRequestEventsOutput) SetNextToken(v string) *DescribePullRequestEventsOutput { - s.NextToken = &v +// SetDestination sets the Destination field's value. +func (s *MergeOperations) SetDestination(v string) *MergeOperations { + s.Destination = &v return s } -// SetPullRequestEvents sets the PullRequestEvents field's value. -func (s *DescribePullRequestEventsOutput) SetPullRequestEvents(v []*PullRequestEvent) *DescribePullRequestEventsOutput { - s.PullRequestEvents = v +// SetSource sets the Source field's value. +func (s *MergeOperations) SetSource(v string) *MergeOperations { + s.Source = &v return s } -// Returns information about a set of differences for a commit specifier. -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"` +// A merge option or stategy is required, and none was provided. +type MergeOptionRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Whether the change type of the difference is an addition (A), deletion (D), - // or modification (M). - ChangeType *string `locationName:"changeType" type:"string" enum:"ChangeTypeEnum"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s Difference) String() string { +func (s MergeOptionRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Difference) GoString() string { +func (s MergeOptionRequiredException) GoString() string { return s.String() } -// SetAfterBlob sets the AfterBlob field's value. -func (s *Difference) SetAfterBlob(v *BlobMetadata) *Difference { - s.AfterBlob = v - return s +func newErrorMergeOptionRequiredException(v protocol.ResponseMetadata) error { + return &MergeOptionRequiredException{ + respMetadata: v, + } } -// SetBeforeBlob sets the BeforeBlob field's value. -func (s *Difference) SetBeforeBlob(v *BlobMetadata) *Difference { - s.BeforeBlob = v - return s +// Code returns the exception type name. +func (s MergeOptionRequiredException) Code() string { + return "MergeOptionRequiredException" } -// SetChangeType sets the ChangeType field's value. -func (s *Difference) SetChangeType(v string) *Difference { - s.ChangeType = &v - return s +// Message returns the exception's message. +func (s MergeOptionRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// Returns information about a file in a repository. -type File struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MergeOptionRequiredException) OrigErr() error { + return nil +} - // The fully-qualified path to the file in the repository. - AbsolutePath *string `locationName:"absolutePath" type:"string"` +func (s MergeOptionRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The blob ID that contains the file information. - BlobId *string `locationName:"blobId" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s MergeOptionRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The extrapolated file mode permissions for the file. Valid values include - // EXECUTABLE and NORMAL. - FileMode *string `locationName:"fileMode" type:"string" enum:"FileModeTypeEnum"` +// RequestID returns the service's response RequestID for request. +func (s MergeOptionRequiredException) RequestID() string { + return s.respMetadata.RequestID +} - // The relative path of the file from the folder where the query originated. - RelativePath *string `locationName:"relativePath" type:"string"` +type MergePullRequestByFastForwardInput struct { + _ struct{} `type:"structure"` + + // The system-generated ID of the pull request. To get this ID, use ListPullRequests. + // + // PullRequestId is a required field + PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` + + // The name of the repository where the pull request was created. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + + // The full commit ID of the original or updated commit in the pull request + // source branch. Pass this value if you want an exception thrown if the current + // commit ID of the tip of the source branch does not match this commit ID. + SourceCommitId *string `locationName:"sourceCommitId" type:"string"` } // String returns the string representation -func (s File) String() string { +func (s MergePullRequestByFastForwardInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s File) GoString() string { +func (s MergePullRequestByFastForwardInput) GoString() string { return s.String() } -// SetAbsolutePath sets the AbsolutePath field's value. -func (s *File) SetAbsolutePath(v string) *File { - s.AbsolutePath = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *MergePullRequestByFastForwardInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MergePullRequestByFastForwardInput"} + if s.PullRequestId == nil { + invalidParams.Add(request.NewErrParamRequired("PullRequestId")) + } + 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 +} + +// SetPullRequestId sets the PullRequestId field's value. +func (s *MergePullRequestByFastForwardInput) SetPullRequestId(v string) *MergePullRequestByFastForwardInput { + s.PullRequestId = &v return s } -// SetBlobId sets the BlobId field's value. -func (s *File) SetBlobId(v string) *File { - s.BlobId = &v +// SetRepositoryName sets the RepositoryName field's value. +func (s *MergePullRequestByFastForwardInput) SetRepositoryName(v string) *MergePullRequestByFastForwardInput { + s.RepositoryName = &v return s } -// SetFileMode sets the FileMode field's value. -func (s *File) SetFileMode(v string) *File { - s.FileMode = &v +// SetSourceCommitId sets the SourceCommitId field's value. +func (s *MergePullRequestByFastForwardInput) SetSourceCommitId(v string) *MergePullRequestByFastForwardInput { + s.SourceCommitId = &v return s } -// SetRelativePath sets the RelativePath field's value. -func (s *File) SetRelativePath(v string) *File { - s.RelativePath = &v +type MergePullRequestByFastForwardOutput struct { + _ struct{} `type:"structure"` + + // Information about the specified pull request, including the merge. + PullRequest *PullRequest `locationName:"pullRequest" type:"structure"` +} + +// String returns the string representation +func (s MergePullRequestByFastForwardOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MergePullRequestByFastForwardOutput) GoString() string { + return s.String() +} + +// SetPullRequest sets the PullRequest field's value. +func (s *MergePullRequestByFastForwardOutput) SetPullRequest(v *PullRequest) *MergePullRequestByFastForwardOutput { + s.PullRequest = v return s } -// A file that will be added, updated, or deleted as part of a commit. -type FileMetadata struct { +type MergePullRequestBySquashInput struct { _ struct{} `type:"structure"` - // The full path to the file that will be added or updated, including the name - // of the file. - AbsolutePath *string `locationName:"absolutePath" type:"string"` + // The name of the author who created the commit. This information is used as + // both the author and committer for the commit. + AuthorName *string `locationName:"authorName" type:"string"` - // The blob ID that contains the file information. - BlobId *string `locationName:"blobId" type:"string"` + // The commit message to include in the commit information for the merge. + CommitMessage *string `locationName:"commitMessage" type:"string"` - // The extrapolated file mode permissions for the file. Valid values include - // EXECUTABLE and NORMAL. - FileMode *string `locationName:"fileMode" type:"string" enum:"FileModeTypeEnum"` + // The level of conflict detail to use. If unspecified, the default FILE_LEVEL + // is used, which returns a not-mergeable result if the same file has differences + // in both branches. If LINE_LEVEL is specified, a conflict is considered not + // mergeable if the same file in both branches has differences on the same line. + ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` + + // If AUTOMERGE is the conflict resolution strategy, a list of inputs to use + // when resolving conflicts during a merge. + ConflictResolution *ConflictResolution `locationName:"conflictResolution" type:"structure"` + + // Specifies which branch to use when resolving conflicts, or whether to attempt + // automatically merging two versions of a file. The default is NONE, which + // requires any conflicts to be resolved manually before the merge operation + // is successful. + ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` + + // The email address of the person merging the branches. This information is + // used in the commit information for the merge. + Email *string `locationName:"email" type:"string"` + + // If the commit contains deletions, whether to keep a folder or folder structure + // if the changes leave the folders empty. If true, a .gitkeep file is created + // for empty folders. The default is false. + KeepEmptyFolders *bool `locationName:"keepEmptyFolders" type:"boolean"` + + // The system-generated ID of the pull request. To get this ID, use ListPullRequests. + // + // PullRequestId is a required field + PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` + + // The name of the repository where the pull request was created. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + + // The full commit ID of the original or updated commit in the pull request + // source branch. Pass this value if you want an exception thrown if the current + // commit ID of the tip of the source branch does not match this commit ID. + SourceCommitId *string `locationName:"sourceCommitId" type:"string"` } // String returns the string representation -func (s FileMetadata) String() string { +func (s MergePullRequestBySquashInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s FileMetadata) GoString() string { +func (s MergePullRequestBySquashInput) GoString() string { return s.String() } -// SetAbsolutePath sets the AbsolutePath field's value. -func (s *FileMetadata) SetAbsolutePath(v string) *FileMetadata { - s.AbsolutePath = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *MergePullRequestBySquashInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MergePullRequestBySquashInput"} + if s.PullRequestId == nil { + invalidParams.Add(request.NewErrParamRequired("PullRequestId")) + } + 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.ConflictResolution != nil { + if err := s.ConflictResolution.Validate(); err != nil { + invalidParams.AddNested("ConflictResolution", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuthorName sets the AuthorName field's value. +func (s *MergePullRequestBySquashInput) SetAuthorName(v string) *MergePullRequestBySquashInput { + s.AuthorName = &v return s } -// SetBlobId sets the BlobId field's value. -func (s *FileMetadata) SetBlobId(v string) *FileMetadata { - s.BlobId = &v +// SetCommitMessage sets the CommitMessage field's value. +func (s *MergePullRequestBySquashInput) SetCommitMessage(v string) *MergePullRequestBySquashInput { + s.CommitMessage = &v return s } -// SetFileMode sets the FileMode field's value. -func (s *FileMetadata) SetFileMode(v string) *FileMetadata { - s.FileMode = &v +// SetConflictDetailLevel sets the ConflictDetailLevel field's value. +func (s *MergePullRequestBySquashInput) SetConflictDetailLevel(v string) *MergePullRequestBySquashInput { + s.ConflictDetailLevel = &v return s } -// Information about file modes in a merge or pull request. -type FileModes struct { - _ struct{} `type:"structure"` - - // The file mode of a file in the base of a merge or pull request. - Base *string `locationName:"base" type:"string" enum:"FileModeTypeEnum"` - - // The file mode of a file in the destination of a merge or pull request. - Destination *string `locationName:"destination" type:"string" enum:"FileModeTypeEnum"` +// SetConflictResolution sets the ConflictResolution field's value. +func (s *MergePullRequestBySquashInput) SetConflictResolution(v *ConflictResolution) *MergePullRequestBySquashInput { + s.ConflictResolution = v + return s +} - // The file mode of a file in the source of a merge or pull request. - Source *string `locationName:"source" type:"string" enum:"FileModeTypeEnum"` +// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. +func (s *MergePullRequestBySquashInput) SetConflictResolutionStrategy(v string) *MergePullRequestBySquashInput { + s.ConflictResolutionStrategy = &v + return s } -// String returns the string representation -func (s FileModes) String() string { - return awsutil.Prettify(s) +// SetEmail sets the Email field's value. +func (s *MergePullRequestBySquashInput) SetEmail(v string) *MergePullRequestBySquashInput { + s.Email = &v + return s } -// GoString returns the string representation -func (s FileModes) GoString() string { - return s.String() +// SetKeepEmptyFolders sets the KeepEmptyFolders field's value. +func (s *MergePullRequestBySquashInput) SetKeepEmptyFolders(v bool) *MergePullRequestBySquashInput { + s.KeepEmptyFolders = &v + return s } -// SetBase sets the Base field's value. -func (s *FileModes) SetBase(v string) *FileModes { - s.Base = &v +// SetPullRequestId sets the PullRequestId field's value. +func (s *MergePullRequestBySquashInput) SetPullRequestId(v string) *MergePullRequestBySquashInput { + s.PullRequestId = &v return s } -// SetDestination sets the Destination field's value. -func (s *FileModes) SetDestination(v string) *FileModes { - s.Destination = &v +// SetRepositoryName sets the RepositoryName field's value. +func (s *MergePullRequestBySquashInput) SetRepositoryName(v string) *MergePullRequestBySquashInput { + s.RepositoryName = &v return s } -// SetSource sets the Source field's value. -func (s *FileModes) SetSource(v string) *FileModes { - s.Source = &v +// SetSourceCommitId sets the SourceCommitId field's value. +func (s *MergePullRequestBySquashInput) SetSourceCommitId(v string) *MergePullRequestBySquashInput { + s.SourceCommitId = &v return s } -// Information about the size of files in a merge or pull request. -type FileSizes struct { +type MergePullRequestBySquashOutput struct { _ struct{} `type:"structure"` - // The size of a file in the base of a merge or pull request. - Base *int64 `locationName:"base" type:"long"` - - // The size of a file in the destination of a merge or pull request. - Destination *int64 `locationName:"destination" type:"long"` - - // The size of a file in the source of a merge or pull request. - Source *int64 `locationName:"source" type:"long"` + // Returns information about a pull request. + PullRequest *PullRequest `locationName:"pullRequest" type:"structure"` } // String returns the string representation -func (s FileSizes) String() string { +func (s MergePullRequestBySquashOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s FileSizes) GoString() string { +func (s MergePullRequestBySquashOutput) GoString() string { return s.String() } -// SetBase sets the Base field's value. -func (s *FileSizes) SetBase(v int64) *FileSizes { - s.Base = &v - return s -} - -// SetDestination sets the Destination field's value. -func (s *FileSizes) SetDestination(v int64) *FileSizes { - s.Destination = &v - return s -} - -// SetSource sets the Source field's value. -func (s *FileSizes) SetSource(v int64) *FileSizes { - s.Source = &v +// SetPullRequest sets the PullRequest field's value. +func (s *MergePullRequestBySquashOutput) SetPullRequest(v *PullRequest) *MergePullRequestBySquashOutput { + s.PullRequest = v return s } -// Returns information about a folder in a repository. -type Folder struct { +type MergePullRequestByThreeWayInput struct { _ struct{} `type:"structure"` - // The fully-qualified path of the folder in the repository. - AbsolutePath *string `locationName:"absolutePath" type:"string"` - - // The relative path of the specified folder from the folder where the query - // originated. - RelativePath *string `locationName:"relativePath" type:"string"` - - // The full SHA-1 pointer of the tree information for the commit that contains - // the folder. - TreeId *string `locationName:"treeId" type:"string"` -} + // The name of the author who created the commit. This information is used as + // both the author and committer for the commit. + AuthorName *string `locationName:"authorName" type:"string"` -// String returns the string representation -func (s Folder) String() string { - return awsutil.Prettify(s) -} + // The commit message to include in the commit information for the merge. + CommitMessage *string `locationName:"commitMessage" type:"string"` -// GoString returns the string representation -func (s Folder) GoString() string { - return s.String() -} + // The level of conflict detail to use. If unspecified, the default FILE_LEVEL + // is used, which returns a not-mergeable result if the same file has differences + // in both branches. If LINE_LEVEL is specified, a conflict is considered not + // mergeable if the same file in both branches has differences on the same line. + ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` -// SetAbsolutePath sets the AbsolutePath field's value. -func (s *Folder) SetAbsolutePath(v string) *Folder { - s.AbsolutePath = &v - return s -} + // If AUTOMERGE is the conflict resolution strategy, a list of inputs to use + // when resolving conflicts during a merge. + ConflictResolution *ConflictResolution `locationName:"conflictResolution" type:"structure"` -// SetRelativePath sets the RelativePath field's value. -func (s *Folder) SetRelativePath(v string) *Folder { - s.RelativePath = &v - return s -} + // Specifies which branch to use when resolving conflicts, or whether to attempt + // automatically merging two versions of a file. The default is NONE, which + // requires any conflicts to be resolved manually before the merge operation + // is successful. + ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` -// SetTreeId sets the TreeId field's value. -func (s *Folder) SetTreeId(v string) *Folder { - s.TreeId = &v - return s -} + // The email address of the person merging the branches. This information is + // used in the commit information for the merge. + Email *string `locationName:"email" type:"string"` -// Represents the input of a get blob operation. -type GetBlobInput struct { - _ struct{} `type:"structure"` + // If the commit contains deletions, whether to keep a folder or folder structure + // if the changes leave the folders empty. If true, a .gitkeep file is created + // for empty folders. The default is false. + KeepEmptyFolders *bool `locationName:"keepEmptyFolders" type:"boolean"` - // The ID of the blob, which is its SHA-1 pointer. + // The system-generated ID of the pull request. To get this ID, use ListPullRequests. // - // BlobId is a required field - BlobId *string `locationName:"blobId" type:"string" required:"true"` + // PullRequestId is a required field + PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` - // The name of the repository that contains the blob. + // The name of the repository where the pull request was created. // // RepositoryName is a required field RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + + // The full commit ID of the original or updated commit in the pull request + // source branch. Pass this value if you want an exception thrown if the current + // commit ID of the tip of the source branch does not match this commit ID. + SourceCommitId *string `locationName:"sourceCommitId" type:"string"` } // String returns the string representation -func (s GetBlobInput) String() string { +func (s MergePullRequestByThreeWayInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetBlobInput) GoString() string { +func (s MergePullRequestByThreeWayInput) 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")) +func (s *MergePullRequestByThreeWayInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MergePullRequestByThreeWayInput"} + if s.PullRequestId == nil { + invalidParams.Add(request.NewErrParamRequired("PullRequestId")) } if s.RepositoryName == nil { invalidParams.Add(request.NewErrParamRequired("RepositoryName")) @@ -10775,6 +25498,11 @@ func (s *GetBlobInput) Validate() error { if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) } + if s.ConflictResolution != nil { + if err := s.ConflictResolution.Validate(); err != nil { + invalidParams.AddNested("ConflictResolution", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -10782,568 +25510,609 @@ func (s *GetBlobInput) Validate() error { return nil } -// SetBlobId sets the BlobId field's value. -func (s *GetBlobInput) SetBlobId(v string) *GetBlobInput { - s.BlobId = &v +// SetAuthorName sets the AuthorName field's value. +func (s *MergePullRequestByThreeWayInput) SetAuthorName(v string) *MergePullRequestByThreeWayInput { + s.AuthorName = &v + return s +} + +// SetCommitMessage sets the CommitMessage field's value. +func (s *MergePullRequestByThreeWayInput) SetCommitMessage(v string) *MergePullRequestByThreeWayInput { + s.CommitMessage = &v + return s +} + +// SetConflictDetailLevel sets the ConflictDetailLevel field's value. +func (s *MergePullRequestByThreeWayInput) SetConflictDetailLevel(v string) *MergePullRequestByThreeWayInput { + s.ConflictDetailLevel = &v + return s +} + +// SetConflictResolution sets the ConflictResolution field's value. +func (s *MergePullRequestByThreeWayInput) SetConflictResolution(v *ConflictResolution) *MergePullRequestByThreeWayInput { + s.ConflictResolution = v + return s +} + +// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. +func (s *MergePullRequestByThreeWayInput) SetConflictResolutionStrategy(v string) *MergePullRequestByThreeWayInput { + s.ConflictResolutionStrategy = &v + return s +} + +// SetEmail sets the Email field's value. +func (s *MergePullRequestByThreeWayInput) SetEmail(v string) *MergePullRequestByThreeWayInput { + s.Email = &v + return s +} + +// SetKeepEmptyFolders sets the KeepEmptyFolders field's value. +func (s *MergePullRequestByThreeWayInput) SetKeepEmptyFolders(v bool) *MergePullRequestByThreeWayInput { + s.KeepEmptyFolders = &v + return s +} + +// SetPullRequestId sets the PullRequestId field's value. +func (s *MergePullRequestByThreeWayInput) SetPullRequestId(v string) *MergePullRequestByThreeWayInput { + s.PullRequestId = &v return s } // SetRepositoryName sets the RepositoryName field's value. -func (s *GetBlobInput) SetRepositoryName(v string) *GetBlobInput { +func (s *MergePullRequestByThreeWayInput) SetRepositoryName(v string) *MergePullRequestByThreeWayInput { s.RepositoryName = &v return s } -// Represents the output of a get blob operation. -type GetBlobOutput struct { +// SetSourceCommitId sets the SourceCommitId field's value. +func (s *MergePullRequestByThreeWayInput) SetSourceCommitId(v string) *MergePullRequestByThreeWayInput { + s.SourceCommitId = &v + return s +} + +type MergePullRequestByThreeWayOutput 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"` + // Returns information about a pull request. + PullRequest *PullRequest `locationName:"pullRequest" type:"structure"` } // String returns the string representation -func (s GetBlobOutput) String() string { +func (s MergePullRequestByThreeWayOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetBlobOutput) GoString() string { +func (s MergePullRequestByThreeWayOutput) GoString() string { return s.String() } -// SetContent sets the Content field's value. -func (s *GetBlobOutput) SetContent(v []byte) *GetBlobOutput { - s.Content = v +// SetPullRequest sets the PullRequest field's value. +func (s *MergePullRequestByThreeWayOutput) SetPullRequest(v *PullRequest) *MergePullRequestByThreeWayOutput { + s.PullRequest = v return s } -// Represents the input of a get branch operation. -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"` +// More than one conflict resolution entries exists for the conflict. A conflict +// can have only one conflict resolution entry. +type MultipleConflictResolutionEntriesException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The name of the repository that contains the branch for which you want to - // retrieve information. - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetBranchInput) String() string { +func (s MultipleConflictResolutionEntriesException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetBranchInput) GoString() string { +func (s MultipleConflictResolutionEntriesException) 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 +func newErrorMultipleConflictResolutionEntriesException(v protocol.ResponseMetadata) error { + return &MultipleConflictResolutionEntriesException{ + respMetadata: v, } - return nil } -// SetBranchName sets the BranchName field's value. -func (s *GetBranchInput) SetBranchName(v string) *GetBranchInput { - s.BranchName = &v - return s +// Code returns the exception type name. +func (s MultipleConflictResolutionEntriesException) Code() string { + return "MultipleConflictResolutionEntriesException" } -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetBranchInput) SetRepositoryName(v string) *GetBranchInput { - s.RepositoryName = &v - return s +// Message returns the exception's message. +func (s MultipleConflictResolutionEntriesException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// Represents the output of a get branch operation. -type GetBranchOutput struct { - _ struct{} `type:"structure"` - - // The name of the branch. - Branch *BranchInfo `locationName:"branch" type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MultipleConflictResolutionEntriesException) OrigErr() error { + return nil } -// String returns the string representation -func (s GetBranchOutput) String() string { - return awsutil.Prettify(s) +func (s MultipleConflictResolutionEntriesException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// GoString returns the string representation -func (s GetBranchOutput) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s MultipleConflictResolutionEntriesException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetBranch sets the Branch field's value. -func (s *GetBranchOutput) SetBranch(v *BranchInfo) *GetBranchOutput { - s.Branch = v - return s +// RequestID returns the service's response RequestID for request. +func (s MultipleConflictResolutionEntriesException) RequestID() string { + return s.respMetadata.RequestID } -type GetCommentInput struct { - _ struct{} `type:"structure"` +// You cannot include more than one repository in a pull request. Make sure +// you have specified only one repository name in your request, and then try +// again. +type MultipleRepositoriesInPullRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The unique, system-generated ID of the comment. To get this ID, use GetCommentsForComparedCommit - // or GetCommentsForPullRequest. - // - // CommentId is a required field - CommentId *string `locationName:"commentId" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetCommentInput) String() string { +func (s MultipleRepositoriesInPullRequestException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetCommentInput) GoString() string { +func (s MultipleRepositoriesInPullRequestException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCommentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCommentInput"} - if s.CommentId == nil { - invalidParams.Add(request.NewErrParamRequired("CommentId")) +func newErrorMultipleRepositoriesInPullRequestException(v protocol.ResponseMetadata) error { + return &MultipleRepositoriesInPullRequestException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s MultipleRepositoriesInPullRequestException) Code() string { + return "MultipleRepositoriesInPullRequestException" +} + +// Message returns the exception's message. +func (s MultipleRepositoriesInPullRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MultipleRepositoriesInPullRequestException) OrigErr() error { return nil } -// SetCommentId sets the CommentId field's value. -func (s *GetCommentInput) SetCommentId(v string) *GetCommentInput { - s.CommentId = &v - return s +func (s MultipleRepositoriesInPullRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -type GetCommentOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s MultipleRepositoriesInPullRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The contents of the comment. - Comment *Comment `locationName:"comment" type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s MultipleRepositoriesInPullRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// The user name is not valid because it has exceeded the character limit for +// author names. +type NameLengthExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetCommentOutput) String() string { +func (s NameLengthExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetCommentOutput) GoString() string { +func (s NameLengthExceededException) GoString() string { return s.String() } -// SetComment sets the Comment field's value. -func (s *GetCommentOutput) SetComment(v *Comment) *GetCommentOutput { - s.Comment = v - return s +func newErrorNameLengthExceededException(v protocol.ResponseMetadata) error { + return &NameLengthExceededException{ + respMetadata: v, + } } -type GetCommentsForComparedCommitInput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s NameLengthExceededException) Code() string { + return "NameLengthExceededException" +} - // To establish the directionality of the comparison, the full commit ID of - // the 'after' commit. - // - // AfterCommitId is a required field - AfterCommitId *string `locationName:"afterCommitId" type:"string" required:"true"` +// Message returns the exception's message. +func (s NameLengthExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // To establish the directionality of the comparison, the full commit ID of - // the 'before' commit. - BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NameLengthExceededException) OrigErr() error { + return nil +} - // A non-negative integer used to limit the number of returned results. The - // default is 100 comments, and is configurable up to 500. - MaxResults *int64 `locationName:"maxResults" type:"integer"` +func (s NameLengthExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // An enumeration token that when provided in a request, returns the next batch - // of the results. - NextToken *string `locationName:"nextToken" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s NameLengthExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The name of the repository where you want to compare commits. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +// RequestID returns the service's response RequestID for request. +func (s NameLengthExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The commit cannot be created because no changes will be made to the repository +// as a result of this commit. A commit must contain at least one change. +type NoChangeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetCommentsForComparedCommitInput) String() string { +func (s NoChangeException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetCommentsForComparedCommitInput) GoString() string { +func (s NoChangeException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCommentsForComparedCommitInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCommentsForComparedCommitInput"} - if s.AfterCommitId == nil { - invalidParams.Add(request.NewErrParamRequired("AfterCommitId")) - } - 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 +func newErrorNoChangeException(v protocol.ResponseMetadata) error { + return &NoChangeException{ + respMetadata: v, } - return nil } -// SetAfterCommitId sets the AfterCommitId field's value. -func (s *GetCommentsForComparedCommitInput) SetAfterCommitId(v string) *GetCommentsForComparedCommitInput { - s.AfterCommitId = &v - return s +// Code returns the exception type name. +func (s NoChangeException) Code() string { + return "NoChangeException" } -// SetBeforeCommitId sets the BeforeCommitId field's value. -func (s *GetCommentsForComparedCommitInput) SetBeforeCommitId(v string) *GetCommentsForComparedCommitInput { - s.BeforeCommitId = &v - return s +// Message returns the exception's message. +func (s NoChangeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetMaxResults sets the MaxResults field's value. -func (s *GetCommentsForComparedCommitInput) SetMaxResults(v int64) *GetCommentsForComparedCommitInput { - s.MaxResults = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoChangeException) OrigErr() error { + return nil } -// SetNextToken sets the NextToken field's value. -func (s *GetCommentsForComparedCommitInput) SetNextToken(v string) *GetCommentsForComparedCommitInput { - s.NextToken = &v - return s +func (s NoChangeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetCommentsForComparedCommitInput) SetRepositoryName(v string) *GetCommentsForComparedCommitInput { - s.RepositoryName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s NoChangeException) StatusCode() int { + return s.respMetadata.StatusCode } -type GetCommentsForComparedCommitOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s NoChangeException) RequestID() string { + return s.respMetadata.RequestID +} - // A list of comment objects on the compared commit. - CommentsForComparedCommitData []*CommentsForComparedCommit `locationName:"commentsForComparedCommitData" type:"list"` +// The maximum number of approval rule templates has been exceeded for this +// AWS Region. +type NumberOfRuleTemplatesExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // An enumeration token that can be used in a request to return the next batch - // of the results. - NextToken *string `locationName:"nextToken" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetCommentsForComparedCommitOutput) String() string { +func (s NumberOfRuleTemplatesExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetCommentsForComparedCommitOutput) GoString() string { +func (s NumberOfRuleTemplatesExceededException) GoString() string { return s.String() } -// SetCommentsForComparedCommitData sets the CommentsForComparedCommitData field's value. -func (s *GetCommentsForComparedCommitOutput) SetCommentsForComparedCommitData(v []*CommentsForComparedCommit) *GetCommentsForComparedCommitOutput { - s.CommentsForComparedCommitData = v - return s +func newErrorNumberOfRuleTemplatesExceededException(v protocol.ResponseMetadata) error { + return &NumberOfRuleTemplatesExceededException{ + respMetadata: v, + } } -// SetNextToken sets the NextToken field's value. -func (s *GetCommentsForComparedCommitOutput) SetNextToken(v string) *GetCommentsForComparedCommitOutput { - s.NextToken = &v - return s +// Code returns the exception type name. +func (s NumberOfRuleTemplatesExceededException) Code() string { + return "NumberOfRuleTemplatesExceededException" } -type GetCommentsForPullRequestInput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s NumberOfRuleTemplatesExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The full commit ID of the commit in the source branch that was the tip of - // the branch at the time the comment was made. - AfterCommitId *string `locationName:"afterCommitId" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NumberOfRuleTemplatesExceededException) OrigErr() error { + return nil +} - // The full commit ID of the commit in the destination branch that was the tip - // of the branch at the time the pull request was created. - BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` +func (s NumberOfRuleTemplatesExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // A non-negative integer used to limit the number of returned results. The - // default is 100 comments. You can return up to 500 comments with a single - // request. - MaxResults *int64 `locationName:"maxResults" type:"integer"` +// Status code returns the HTTP status code for the request's response error. +func (s NumberOfRuleTemplatesExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} - // An enumeration token that when provided in a request, returns the next batch - // of the results. - NextToken *string `locationName:"nextToken" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s NumberOfRuleTemplatesExceededException) RequestID() string { + return s.respMetadata.RequestID +} - // The system-generated ID of the pull request. To get this ID, use ListPullRequests. - // - // PullRequestId is a required field - PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` +// The approval rule cannot be added. The pull request has the maximum number +// of approval rules associated with it. +type NumberOfRulesExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The name of the repository that contains the pull request. - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetCommentsForPullRequestInput) String() string { +func (s NumberOfRulesExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetCommentsForPullRequestInput) GoString() string { +func (s NumberOfRulesExceededException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCommentsForPullRequestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCommentsForPullRequestInput"} - if s.PullRequestId == nil { - invalidParams.Add(request.NewErrParamRequired("PullRequestId")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) +func newErrorNumberOfRulesExceededException(v protocol.ResponseMetadata) error { + return &NumberOfRulesExceededException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s NumberOfRulesExceededException) Code() string { + return "NumberOfRulesExceededException" +} + +// Message returns the exception's message. +func (s NumberOfRulesExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NumberOfRulesExceededException) OrigErr() error { return nil } -// SetAfterCommitId sets the AfterCommitId field's value. -func (s *GetCommentsForPullRequestInput) SetAfterCommitId(v string) *GetCommentsForPullRequestInput { - s.AfterCommitId = &v - return s +func (s NumberOfRulesExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetBeforeCommitId sets the BeforeCommitId field's value. -func (s *GetCommentsForPullRequestInput) SetBeforeCommitId(v string) *GetCommentsForPullRequestInput { - s.BeforeCommitId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s NumberOfRulesExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetMaxResults sets the MaxResults field's value. -func (s *GetCommentsForPullRequestInput) SetMaxResults(v int64) *GetCommentsForPullRequestInput { - s.MaxResults = &v - return s +// RequestID returns the service's response RequestID for request. +func (s NumberOfRulesExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about the type of an object in a merge operation. +type ObjectTypes struct { + _ struct{} `type:"structure"` + + // The type of the object in the base commit of the merge. + Base *string `locationName:"base" type:"string" enum:"ObjectTypeEnum"` + + // The type of the object in the destination branch. + Destination *string `locationName:"destination" type:"string" enum:"ObjectTypeEnum"` + + // The type of the object in the source branch. + Source *string `locationName:"source" type:"string" enum:"ObjectTypeEnum"` +} + +// String returns the string representation +func (s ObjectTypes) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ObjectTypes) GoString() string { + return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *GetCommentsForPullRequestInput) SetNextToken(v string) *GetCommentsForPullRequestInput { - s.NextToken = &v +// SetBase sets the Base field's value. +func (s *ObjectTypes) SetBase(v string) *ObjectTypes { + s.Base = &v return s } -// SetPullRequestId sets the PullRequestId field's value. -func (s *GetCommentsForPullRequestInput) SetPullRequestId(v string) *GetCommentsForPullRequestInput { - s.PullRequestId = &v +// SetDestination sets the Destination field's value. +func (s *ObjectTypes) SetDestination(v string) *ObjectTypes { + s.Destination = &v return s } -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetCommentsForPullRequestInput) SetRepositoryName(v string) *GetCommentsForPullRequestInput { - s.RepositoryName = &v +// SetSource sets the Source field's value. +func (s *ObjectTypes) SetSource(v string) *ObjectTypes { + s.Source = &v return s } -type GetCommentsForPullRequestOutput struct { +// Returns information about the template that created the approval rule for +// a pull request. +type OriginApprovalRuleTemplate struct { _ struct{} `type:"structure"` - // An array of comment objects on the pull request. - CommentsForPullRequestData []*CommentsForPullRequest `locationName:"commentsForPullRequestData" type:"list"` + // The ID of the template that created the approval rule. + ApprovalRuleTemplateId *string `locationName:"approvalRuleTemplateId" type:"string"` - // An enumeration token that can be used in a request to return the next batch - // of the results. - NextToken *string `locationName:"nextToken" type:"string"` + // The name of the template that created the approval rule. + ApprovalRuleTemplateName *string `locationName:"approvalRuleTemplateName" min:"1" type:"string"` } // String returns the string representation -func (s GetCommentsForPullRequestOutput) String() string { +func (s OriginApprovalRuleTemplate) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetCommentsForPullRequestOutput) GoString() string { +func (s OriginApprovalRuleTemplate) GoString() string { return s.String() } -// SetCommentsForPullRequestData sets the CommentsForPullRequestData field's value. -func (s *GetCommentsForPullRequestOutput) SetCommentsForPullRequestData(v []*CommentsForPullRequest) *GetCommentsForPullRequestOutput { - s.CommentsForPullRequestData = v +// SetApprovalRuleTemplateId sets the ApprovalRuleTemplateId field's value. +func (s *OriginApprovalRuleTemplate) SetApprovalRuleTemplateId(v string) *OriginApprovalRuleTemplate { + s.ApprovalRuleTemplateId = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *GetCommentsForPullRequestOutput) SetNextToken(v string) *GetCommentsForPullRequestOutput { - s.NextToken = &v +// SetApprovalRuleTemplateName sets the ApprovalRuleTemplateName field's value. +func (s *OriginApprovalRuleTemplate) SetApprovalRuleTemplateName(v string) *OriginApprovalRuleTemplate { + s.ApprovalRuleTemplateName = &v return s } -// Represents the input of a get commit operation. -type GetCommitInput struct { - _ struct{} `type:"structure"` - - // The commit ID. Commit IDs are the full SHA of the commit. - // - // CommitId is a required field - CommitId *string `locationName:"commitId" type:"string" required:"true"` +// The pull request has already had its approval rules set to override. +type OverrideAlreadySetException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetCommitInput) String() string { +func (s OverrideAlreadySetException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetCommitInput) GoString() string { +func (s OverrideAlreadySetException) 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 +func newErrorOverrideAlreadySetException(v protocol.ResponseMetadata) error { + return &OverrideAlreadySetException{ + respMetadata: v, } - return nil } -// SetCommitId sets the CommitId field's value. -func (s *GetCommitInput) SetCommitId(v string) *GetCommitInput { - s.CommitId = &v - return s +// Code returns the exception type name. +func (s OverrideAlreadySetException) Code() string { + return "OverrideAlreadySetException" } -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetCommitInput) SetRepositoryName(v string) *GetCommitInput { - s.RepositoryName = &v - return s +// Message returns the exception's message. +func (s OverrideAlreadySetException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// Represents the output of a get commit operation. -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"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OverrideAlreadySetException) OrigErr() error { + return nil } -// String returns the string representation -func (s GetCommitOutput) String() string { - return awsutil.Prettify(s) +func (s OverrideAlreadySetException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// GoString returns the string representation -func (s GetCommitOutput) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s OverrideAlreadySetException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetCommit sets the Commit field's value. -func (s *GetCommitOutput) SetCommit(v *Commit) *GetCommitOutput { - s.Commit = v - return s +// RequestID returns the service's response RequestID for request. +func (s OverrideAlreadySetException) RequestID() string { + return s.respMetadata.RequestID } -type GetDifferencesInput struct { +type OverridePullRequestApprovalRulesInput struct { _ struct{} `type:"structure"` - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. + // Whether you want to set aside approval rule requirements for the pull request + // (OVERRIDE) or revoke a previous override and apply approval rule requirements + // (REVOKE). REVOKE status is not stored. // - // 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"` + // OverrideStatus is a required field + OverrideStatus *string `locationName:"overrideStatus" type:"string" required:"true" enum:"OverrideStatus"` - // An enumeration token that when provided in a request, returns the next batch - // of the results. - NextToken *string `type:"string"` + // The system-generated ID of the pull request for which you want to override + // all approval rule requirements. To get this information, use GetPullRequest. + // + // PullRequestId is a required field + PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` - // The name of the repository where you want to get differences. + // The system-generated ID of the most recent revision of the pull request. + // You cannot override approval rules for anything but the most recent revision + // of a pull request. To get the revision ID, use GetPullRequest. // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + // RevisionId is a required field + RevisionId *string `locationName:"revisionId" type:"string" required:"true"` } // String returns the string representation -func (s GetDifferencesInput) String() string { +func (s OverridePullRequestApprovalRulesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDifferencesInput) GoString() string { +func (s OverridePullRequestApprovalRulesInput) 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")) +func (s *OverridePullRequestApprovalRulesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "OverridePullRequestApprovalRulesInput"} + if s.OverrideStatus == nil { + invalidParams.Add(request.NewErrParamRequired("OverrideStatus")) } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) + if s.PullRequestId == nil { + invalidParams.Add(request.NewErrParamRequired("PullRequestId")) } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) + if s.RevisionId == nil { + invalidParams.Add(request.NewErrParamRequired("RevisionId")) } if invalidParams.Len() > 0 { @@ -11352,443 +26121,433 @@ func (s *GetDifferencesInput) Validate() error { 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 +// SetOverrideStatus sets the OverrideStatus field's value. +func (s *OverridePullRequestApprovalRulesInput) SetOverrideStatus(v string) *OverridePullRequestApprovalRulesInput { + s.OverrideStatus = &v return s } -// SetBeforeCommitSpecifier sets the BeforeCommitSpecifier field's value. -func (s *GetDifferencesInput) SetBeforeCommitSpecifier(v string) *GetDifferencesInput { - s.BeforeCommitSpecifier = &v +// SetPullRequestId sets the PullRequestId field's value. +func (s *OverridePullRequestApprovalRulesInput) SetPullRequestId(v string) *OverridePullRequestApprovalRulesInput { + s.PullRequestId = &v return s } -// SetBeforePath sets the BeforePath field's value. -func (s *GetDifferencesInput) SetBeforePath(v string) *GetDifferencesInput { - s.BeforePath = &v +// SetRevisionId sets the RevisionId field's value. +func (s *OverridePullRequestApprovalRulesInput) SetRevisionId(v string) *OverridePullRequestApprovalRulesInput { + s.RevisionId = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *GetDifferencesInput) SetMaxResults(v int64) *GetDifferencesInput { - s.MaxResults = &v - return s +type OverridePullRequestApprovalRulesOutput struct { + _ struct{} `type:"structure"` } -// SetNextToken sets the NextToken field's value. -func (s *GetDifferencesInput) SetNextToken(v string) *GetDifferencesInput { - s.NextToken = &v - return s +// String returns the string representation +func (s OverridePullRequestApprovalRulesOutput) String() string { + return awsutil.Prettify(s) } -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetDifferencesInput) SetRepositoryName(v string) *GetDifferencesInput { - s.RepositoryName = &v - return s +// GoString returns the string representation +func (s OverridePullRequestApprovalRulesOutput) GoString() string { + return s.String() } -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 override status is required, but no value was provided. Valid values include +// OVERRIDE and REVOKE. +type OverrideStatusRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // An enumeration token that can be used in a request to return the next batch - // of the results. - NextToken *string `type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetDifferencesOutput) String() string { +func (s OverrideStatusRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDifferencesOutput) GoString() string { +func (s OverrideStatusRequiredException) GoString() string { return s.String() } -// SetDifferences sets the Differences field's value. -func (s *GetDifferencesOutput) SetDifferences(v []*Difference) *GetDifferencesOutput { - s.Differences = v - return s +func newErrorOverrideStatusRequiredException(v protocol.ResponseMetadata) error { + return &OverrideStatusRequiredException{ + respMetadata: v, + } } -// SetNextToken sets the NextToken field's value. -func (s *GetDifferencesOutput) SetNextToken(v string) *GetDifferencesOutput { - s.NextToken = &v - return s +// Code returns the exception type name. +func (s OverrideStatusRequiredException) Code() string { + return "OverrideStatusRequiredException" } -type GetFileInput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s OverrideStatusRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The fully-quaified reference that identifies the commit that contains the - // file. For example, you could specify a full commit ID, a tag, a branch name, - // or a reference such as refs/heads/master. If none is provided, then the head - // commit will be used. - CommitSpecifier *string `locationName:"commitSpecifier" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OverrideStatusRequiredException) OrigErr() error { + return nil +} - // The fully-qualified path to the file, including the full name and extension - // of the file. For example, /examples/file.md is the fully-qualified path to - // a file named file.md in a folder named examples. - // - // FilePath is a required field - FilePath *string `locationName:"filePath" type:"string" required:"true"` +func (s OverrideStatusRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The name of the repository that contains the file. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s OverrideStatusRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OverrideStatusRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The parent commit ID is not valid because it does not exist. The specified +// parent commit ID does not exist in the specified branch of the repository. +type ParentCommitDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetFileInput) String() string { +func (s ParentCommitDoesNotExistException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetFileInput) GoString() string { +func (s ParentCommitDoesNotExistException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetFileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetFileInput"} - if s.FilePath == nil { - invalidParams.Add(request.NewErrParamRequired("FilePath")) - } - 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 +func newErrorParentCommitDoesNotExistException(v protocol.ResponseMetadata) error { + return &ParentCommitDoesNotExistException{ + respMetadata: v, } - return nil -} - -// SetCommitSpecifier sets the CommitSpecifier field's value. -func (s *GetFileInput) SetCommitSpecifier(v string) *GetFileInput { - s.CommitSpecifier = &v - return s } -// SetFilePath sets the FilePath field's value. -func (s *GetFileInput) SetFilePath(v string) *GetFileInput { - s.FilePath = &v - return s +// Code returns the exception type name. +func (s ParentCommitDoesNotExistException) Code() string { + return "ParentCommitDoesNotExistException" } -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetFileInput) SetRepositoryName(v string) *GetFileInput { - s.RepositoryName = &v - return s +// Message returns the exception's message. +func (s ParentCommitDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type GetFileOutput struct { - _ struct{} `type:"structure"` - - // The blob ID of the object that represents the file content. - // - // BlobId is a required field - BlobId *string `locationName:"blobId" type:"string" required:"true"` - - // The full commit ID of the commit that contains the content returned by GetFile. - // - // CommitId is a required field - CommitId *string `locationName:"commitId" type:"string" required:"true"` - - // The base-64 encoded binary data object that represents the content of the - // file. - // - // FileContent is automatically base64 encoded/decoded by the SDK. - // - // FileContent is a required field - FileContent []byte `locationName:"fileContent" type:"blob" required:"true"` - - // The extrapolated file mode permissions of the blob. Valid values include - // strings such as EXECUTABLE and not numeric values. - // - // The file mode permissions returned by this API are not the standard file - // mode permission values, such as 100644, but rather extrapolated values. See - // below for a full list of supported return values. - // - // FileMode is a required field - FileMode *string `locationName:"fileMode" type:"string" required:"true" enum:"FileModeTypeEnum"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ParentCommitDoesNotExistException) OrigErr() error { + return nil +} - // The fully qualified path to the specified file. This returns the name and - // extension of the file. - // - // FilePath is a required field - FilePath *string `locationName:"filePath" type:"string" required:"true"` +func (s ParentCommitDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The size of the contents of the file, in bytes. - // - // FileSize is a required field - FileSize *int64 `locationName:"fileSize" type:"long" required:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s ParentCommitDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ParentCommitDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// The file could not be added because the provided parent commit ID is not +// the current tip of the specified branch. To view the full commit ID of the +// current head of the branch, use GetBranch. +type ParentCommitIdOutdatedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetFileOutput) String() string { +func (s ParentCommitIdOutdatedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetFileOutput) GoString() string { +func (s ParentCommitIdOutdatedException) GoString() string { return s.String() } -// SetBlobId sets the BlobId field's value. -func (s *GetFileOutput) SetBlobId(v string) *GetFileOutput { - s.BlobId = &v - return s +func newErrorParentCommitIdOutdatedException(v protocol.ResponseMetadata) error { + return &ParentCommitIdOutdatedException{ + respMetadata: v, + } } -// SetCommitId sets the CommitId field's value. -func (s *GetFileOutput) SetCommitId(v string) *GetFileOutput { - s.CommitId = &v - return s +// Code returns the exception type name. +func (s ParentCommitIdOutdatedException) Code() string { + return "ParentCommitIdOutdatedException" } -// SetFileContent sets the FileContent field's value. -func (s *GetFileOutput) SetFileContent(v []byte) *GetFileOutput { - s.FileContent = v - return s +// Message returns the exception's message. +func (s ParentCommitIdOutdatedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetFileMode sets the FileMode field's value. -func (s *GetFileOutput) SetFileMode(v string) *GetFileOutput { - s.FileMode = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ParentCommitIdOutdatedException) OrigErr() error { + return nil } -// SetFilePath sets the FilePath field's value. -func (s *GetFileOutput) SetFilePath(v string) *GetFileOutput { - s.FilePath = &v - return s +func (s ParentCommitIdOutdatedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetFileSize sets the FileSize field's value. -func (s *GetFileOutput) SetFileSize(v int64) *GetFileOutput { - s.FileSize = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ParentCommitIdOutdatedException) StatusCode() int { + return s.respMetadata.StatusCode } -type GetFolderInput struct { - _ struct{} `type:"structure"` - - // A fully-qualified reference used to identify a commit that contains the version - // of the folder's content to return. A fully-qualified reference can be a commit - // ID, branch name, tag, or reference such as HEAD. If no specifier is provided, - // the folder content will be returned as it exists in the HEAD commit. - CommitSpecifier *string `locationName:"commitSpecifier" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s ParentCommitIdOutdatedException) RequestID() string { + return s.respMetadata.RequestID +} - // The fully-qualified path to the folder whose contents will be returned, including - // the folder name. For example, /examples is a fully-qualified path to a folder - // named examples that was created off of the root directory (/) of a repository. - // - // FolderPath is a required field - FolderPath *string `locationName:"folderPath" type:"string" required:"true"` +// A parent commit ID is required. To view the full commit ID of a branch in +// a repository, use GetBranch or a Git command (for example, git pull or git +// log). +type ParentCommitIdRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The name of the repository. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetFolderInput) String() string { +func (s ParentCommitIdRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetFolderInput) GoString() string { +func (s ParentCommitIdRequiredException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetFolderInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetFolderInput"} - if s.FolderPath == nil { - invalidParams.Add(request.NewErrParamRequired("FolderPath")) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) +func newErrorParentCommitIdRequiredException(v protocol.ResponseMetadata) error { + return &ParentCommitIdRequiredException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s ParentCommitIdRequiredException) Code() string { + return "ParentCommitIdRequiredException" +} + +// Message returns the exception's message. +func (s ParentCommitIdRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ParentCommitIdRequiredException) OrigErr() error { return nil } -// SetCommitSpecifier sets the CommitSpecifier field's value. -func (s *GetFolderInput) SetCommitSpecifier(v string) *GetFolderInput { - s.CommitSpecifier = &v - return s +func (s ParentCommitIdRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetFolderPath sets the FolderPath field's value. -func (s *GetFolderInput) SetFolderPath(v string) *GetFolderInput { - s.FolderPath = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ParentCommitIdRequiredException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetFolderInput) SetRepositoryName(v string) *GetFolderInput { - s.RepositoryName = &v - return s +// RequestID returns the service's response RequestID for request. +func (s ParentCommitIdRequiredException) RequestID() string { + return s.respMetadata.RequestID } -type GetFolderOutput struct { - _ struct{} `type:"structure"` +// The specified path does not exist. +type PathDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The full commit ID used as a reference for which version of the folder content - // is returned. - // - // CommitId is a required field - CommitId *string `locationName:"commitId" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` +} - // The list of files that exist in the specified folder, if any. - Files []*File `locationName:"files" type:"list"` +// String returns the string representation +func (s PathDoesNotExistException) String() string { + return awsutil.Prettify(s) +} - // The fully-qualified path of the folder whose contents are returned. - // - // FolderPath is a required field - FolderPath *string `locationName:"folderPath" type:"string" required:"true"` +// GoString returns the string representation +func (s PathDoesNotExistException) GoString() string { + return s.String() +} - // The list of folders that exist beneath the specified folder, if any. - SubFolders []*Folder `locationName:"subFolders" type:"list"` +func newErrorPathDoesNotExistException(v protocol.ResponseMetadata) error { + return &PathDoesNotExistException{ + respMetadata: v, + } +} - // The list of submodules that exist in the specified folder, if any. - SubModules []*SubModule `locationName:"subModules" type:"list"` +// Code returns the exception type name. +func (s PathDoesNotExistException) Code() string { + return "PathDoesNotExistException" +} - // The list of symbolic links to other files and folders that exist in the specified - // folder, if any. - SymbolicLinks []*SymbolicLink `locationName:"symbolicLinks" type:"list"` +// Message returns the exception's message. +func (s PathDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The full SHA-1 pointer of the tree information for the commit that contains - // the folder. - TreeId *string `locationName:"treeId" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PathDoesNotExistException) OrigErr() error { + return nil +} + +func (s PathDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PathDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PathDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// The folderPath for a location cannot be null. +type PathRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetFolderOutput) String() string { +func (s PathRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetFolderOutput) GoString() string { +func (s PathRequiredException) GoString() string { return s.String() } -// SetCommitId sets the CommitId field's value. -func (s *GetFolderOutput) SetCommitId(v string) *GetFolderOutput { - s.CommitId = &v - return s +func newErrorPathRequiredException(v protocol.ResponseMetadata) error { + return &PathRequiredException{ + respMetadata: v, + } } -// SetFiles sets the Files field's value. -func (s *GetFolderOutput) SetFiles(v []*File) *GetFolderOutput { - s.Files = v - return s +// Code returns the exception type name. +func (s PathRequiredException) Code() string { + return "PathRequiredException" } -// SetFolderPath sets the FolderPath field's value. -func (s *GetFolderOutput) SetFolderPath(v string) *GetFolderOutput { - s.FolderPath = &v - return s +// Message returns the exception's message. +func (s PathRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetSubFolders sets the SubFolders field's value. -func (s *GetFolderOutput) SetSubFolders(v []*Folder) *GetFolderOutput { - s.SubFolders = v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PathRequiredException) OrigErr() error { + return nil } -// SetSubModules sets the SubModules field's value. -func (s *GetFolderOutput) SetSubModules(v []*SubModule) *GetFolderOutput { - s.SubModules = v - return s +func (s PathRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetSymbolicLinks sets the SymbolicLinks field's value. -func (s *GetFolderOutput) SetSymbolicLinks(v []*SymbolicLink) *GetFolderOutput { - s.SymbolicLinks = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s PathRequiredException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetTreeId sets the TreeId field's value. -func (s *GetFolderOutput) SetTreeId(v string) *GetFolderOutput { - s.TreeId = &v - return s +// RequestID returns the service's response RequestID for request. +func (s PathRequiredException) RequestID() string { + return s.respMetadata.RequestID } -type GetMergeCommitInput struct { +type PostCommentForComparedCommitInput struct { _ struct{} `type:"structure"` - // The level of conflict detail to use. If unspecified, the default FILE_LEVEL - // is used, which will return a not mergeable result if the same file has differences - // in both branches. If LINE_LEVEL is specified, a conflict will be considered - // not mergeable if the same file in both branches has differences on the same - // line. - ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` + // To establish the directionality of the comparison, the full commit ID of + // the after commit. + // + // AfterCommitId is a required field + AfterCommitId *string `locationName:"afterCommitId" type:"string" required:"true"` - // Specifies which branch to use when resolving conflicts, or whether to attempt - // automatically merging two versions of a file. The default is NONE, which - // requires any conflicts to be resolved manually before the merge operation - // will be successful. - ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` + // To establish the directionality of the comparison, the full commit ID of + // the before commit. Required for commenting on any commit unless that commit + // is the initial commit. + BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. + // A unique, client-generated idempotency token that, when provided in a request, + // ensures the request cannot be repeated with a changed parameter. If a request + // is received with the same parameters and a token is included, the request + // returns information about the initial request that used that token. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` + + // The content of the comment you want to make. // - // DestinationCommitSpecifier is a required field - DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` + // Content is a required field + Content *string `locationName:"content" type:"string" required:"true"` - // The name of the repository that contains the merge commit about which you - // want to get information. + // The location of the comparison where you want to comment. + Location *Location `locationName:"location" type:"structure"` + + // The name of the repository where you want to post a comment on the comparison + // between commits. // // RepositoryName is a required field RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` - - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. - // - // SourceCommitSpecifier is a required field - SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` } // String returns the string representation -func (s GetMergeCommitInput) String() string { +func (s PostCommentForComparedCommitInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetMergeCommitInput) GoString() string { +func (s PostCommentForComparedCommitInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetMergeCommitInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMergeCommitInput"} - if s.DestinationCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) +func (s *PostCommentForComparedCommitInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PostCommentForComparedCommitInput"} + if s.AfterCommitId == nil { + invalidParams.Add(request.NewErrParamRequired("AfterCommitId")) + } + if s.Content == nil { + invalidParams.Add(request.NewErrParamRequired("Content")) } if s.RepositoryName == nil { invalidParams.Add(request.NewErrParamRequired("RepositoryName")) @@ -11796,9 +26555,6 @@ func (s *GetMergeCommitInput) Validate() error { if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) } - if s.SourceCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) - } if invalidParams.Len() > 0 { return invalidParams @@ -11806,153 +26562,186 @@ func (s *GetMergeCommitInput) Validate() error { return nil } -// SetConflictDetailLevel sets the ConflictDetailLevel field's value. -func (s *GetMergeCommitInput) SetConflictDetailLevel(v string) *GetMergeCommitInput { - s.ConflictDetailLevel = &v +// SetAfterCommitId sets the AfterCommitId field's value. +func (s *PostCommentForComparedCommitInput) SetAfterCommitId(v string) *PostCommentForComparedCommitInput { + s.AfterCommitId = &v return s } -// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. -func (s *GetMergeCommitInput) SetConflictResolutionStrategy(v string) *GetMergeCommitInput { - s.ConflictResolutionStrategy = &v +// SetBeforeCommitId sets the BeforeCommitId field's value. +func (s *PostCommentForComparedCommitInput) SetBeforeCommitId(v string) *PostCommentForComparedCommitInput { + s.BeforeCommitId = &v return s } -// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. -func (s *GetMergeCommitInput) SetDestinationCommitSpecifier(v string) *GetMergeCommitInput { - s.DestinationCommitSpecifier = &v +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *PostCommentForComparedCommitInput) SetClientRequestToken(v string) *PostCommentForComparedCommitInput { + s.ClientRequestToken = &v return s } -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetMergeCommitInput) SetRepositoryName(v string) *GetMergeCommitInput { - s.RepositoryName = &v +// SetContent sets the Content field's value. +func (s *PostCommentForComparedCommitInput) SetContent(v string) *PostCommentForComparedCommitInput { + s.Content = &v return s } -// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. -func (s *GetMergeCommitInput) SetSourceCommitSpecifier(v string) *GetMergeCommitInput { - s.SourceCommitSpecifier = &v +// SetLocation sets the Location field's value. +func (s *PostCommentForComparedCommitInput) SetLocation(v *Location) *PostCommentForComparedCommitInput { + s.Location = v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *PostCommentForComparedCommitInput) SetRepositoryName(v string) *PostCommentForComparedCommitInput { + s.RepositoryName = &v return s } -type GetMergeCommitOutput struct { +type PostCommentForComparedCommitOutput struct { _ struct{} `type:"structure"` - // The commit ID of the merge base. - BaseCommitId *string `locationName:"baseCommitId" type:"string"` + // In the directionality you established, the blob ID of the after blob. + AfterBlobId *string `locationName:"afterBlobId" type:"string"` - // The commit ID of the destination commit specifier that was used in the merge - // evaluation. - DestinationCommitId *string `locationName:"destinationCommitId" type:"string"` + // In the directionality you established, the full commit ID of the after commit. + AfterCommitId *string `locationName:"afterCommitId" type:"string"` - // The commit ID for the merge commit created when the source branch was merged - // into the destination branch. If the fast-forward merge strategy was used, - // no merge commit exists. - MergedCommitId *string `locationName:"mergedCommitId" type:"string"` + // In the directionality you established, the blob ID of the before blob. + BeforeBlobId *string `locationName:"beforeBlobId" type:"string"` - // The commit ID of the source commit specifier that was used in the merge evaluation. - SourceCommitId *string `locationName:"sourceCommitId" type:"string"` + // In the directionality you established, the full commit ID of the before commit. + BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` + + // The content of the comment you posted. + Comment *Comment `locationName:"comment" type:"structure"` + + // The location of the comment in the comparison between the two commits. + Location *Location `locationName:"location" type:"structure"` + + // The name of the repository where you posted a comment on the comparison between + // commits. + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` } // String returns the string representation -func (s GetMergeCommitOutput) String() string { +func (s PostCommentForComparedCommitOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetMergeCommitOutput) GoString() string { +func (s PostCommentForComparedCommitOutput) GoString() string { return s.String() } -// SetBaseCommitId sets the BaseCommitId field's value. -func (s *GetMergeCommitOutput) SetBaseCommitId(v string) *GetMergeCommitOutput { - s.BaseCommitId = &v +// SetAfterBlobId sets the AfterBlobId field's value. +func (s *PostCommentForComparedCommitOutput) SetAfterBlobId(v string) *PostCommentForComparedCommitOutput { + s.AfterBlobId = &v return s } -// SetDestinationCommitId sets the DestinationCommitId field's value. -func (s *GetMergeCommitOutput) SetDestinationCommitId(v string) *GetMergeCommitOutput { - s.DestinationCommitId = &v +// SetAfterCommitId sets the AfterCommitId field's value. +func (s *PostCommentForComparedCommitOutput) SetAfterCommitId(v string) *PostCommentForComparedCommitOutput { + s.AfterCommitId = &v return s } -// SetMergedCommitId sets the MergedCommitId field's value. -func (s *GetMergeCommitOutput) SetMergedCommitId(v string) *GetMergeCommitOutput { - s.MergedCommitId = &v +// SetBeforeBlobId sets the BeforeBlobId field's value. +func (s *PostCommentForComparedCommitOutput) SetBeforeBlobId(v string) *PostCommentForComparedCommitOutput { + s.BeforeBlobId = &v return s } -// SetSourceCommitId sets the SourceCommitId field's value. -func (s *GetMergeCommitOutput) SetSourceCommitId(v string) *GetMergeCommitOutput { - s.SourceCommitId = &v +// SetBeforeCommitId sets the BeforeCommitId field's value. +func (s *PostCommentForComparedCommitOutput) SetBeforeCommitId(v string) *PostCommentForComparedCommitOutput { + s.BeforeCommitId = &v return s } -type GetMergeConflictsInput struct { - _ struct{} `type:"structure"` +// SetComment sets the Comment field's value. +func (s *PostCommentForComparedCommitOutput) SetComment(v *Comment) *PostCommentForComparedCommitOutput { + s.Comment = v + return s +} - // The level of conflict detail to use. If unspecified, the default FILE_LEVEL - // is used, which will return a not mergeable result if the same file has differences - // in both branches. If LINE_LEVEL is specified, a conflict will be considered - // not mergeable if the same file in both branches has differences on the same - // line. - ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` +// SetLocation sets the Location field's value. +func (s *PostCommentForComparedCommitOutput) SetLocation(v *Location) *PostCommentForComparedCommitOutput { + s.Location = v + return s +} - // Specifies which branch to use when resolving conflicts, or whether to attempt - // automatically merging two versions of a file. The default is NONE, which - // requires any conflicts to be resolved manually before the merge operation - // will be successful. - ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` +// SetRepositoryName sets the RepositoryName field's value. +func (s *PostCommentForComparedCommitOutput) SetRepositoryName(v string) *PostCommentForComparedCommitOutput { + s.RepositoryName = &v + return s +} - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. +type PostCommentForPullRequestInput struct { + _ struct{} `type:"structure"` + + // The full commit ID of the commit in the source branch that is the current + // tip of the branch for the pull request when you post the comment. // - // DestinationCommitSpecifier is a required field - DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` + // AfterCommitId is a required field + AfterCommitId *string `locationName:"afterCommitId" type:"string" required:"true"` - // The maximum number of files to include in the output. - MaxConflictFiles *int64 `locationName:"maxConflictFiles" type:"integer"` + // The full commit ID of the commit in the destination branch that was the tip + // of the branch at the time the pull request was created. + // + // BeforeCommitId is a required field + BeforeCommitId *string `locationName:"beforeCommitId" type:"string" required:"true"` - // The merge option or strategy you want to use to merge the code. + // A unique, client-generated idempotency token that, when provided in a request, + // ensures the request cannot be repeated with a changed parameter. If a request + // is received with the same parameters and a token is included, the request + // returns information about the initial request that used that token. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` + + // The content of your comment on the change. // - // MergeOption is a required field - MergeOption *string `locationName:"mergeOption" type:"string" required:"true" enum:"MergeOptionTypeEnum"` + // Content is a required field + Content *string `locationName:"content" type:"string" required:"true"` - // An enumeration token that when provided in a request, returns the next batch - // of the results. - NextToken *string `locationName:"nextToken" type:"string"` + // The location of the change where you want to post your comment. If no location + // is provided, the comment is posted as a general comment on the pull request + // difference between the before commit ID and the after commit ID. + Location *Location `locationName:"location" type:"structure"` - // The name of the repository where the pull request was created. + // The system-generated ID of the pull request. To get this ID, use ListPullRequests. // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + // PullRequestId is a required field + PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. + // The name of the repository where you want to post a comment on a pull request. // - // SourceCommitSpecifier is a required field - SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` } // String returns the string representation -func (s GetMergeConflictsInput) String() string { +func (s PostCommentForPullRequestInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetMergeConflictsInput) GoString() string { +func (s PostCommentForPullRequestInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetMergeConflictsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMergeConflictsInput"} - if s.DestinationCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) +func (s *PostCommentForPullRequestInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PostCommentForPullRequestInput"} + if s.AfterCommitId == nil { + invalidParams.Add(request.NewErrParamRequired("AfterCommitId")) } - if s.MergeOption == nil { - invalidParams.Add(request.NewErrParamRequired("MergeOption")) + if s.BeforeCommitId == nil { + invalidParams.Add(request.NewErrParamRequired("BeforeCommitId")) + } + if s.Content == nil { + invalidParams.Add(request.NewErrParamRequired("Content")) + } + if s.PullRequestId == nil { + invalidParams.Add(request.NewErrParamRequired("PullRequestId")) } if s.RepositoryName == nil { invalidParams.Add(request.NewErrParamRequired("RepositoryName")) @@ -11960,9 +26749,6 @@ func (s *GetMergeConflictsInput) Validate() error { if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) } - if s.SourceCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) - } if invalidParams.Len() > 0 { return invalidParams @@ -11970,193 +26756,176 @@ func (s *GetMergeConflictsInput) Validate() error { return nil } -// SetConflictDetailLevel sets the ConflictDetailLevel field's value. -func (s *GetMergeConflictsInput) SetConflictDetailLevel(v string) *GetMergeConflictsInput { - s.ConflictDetailLevel = &v +// SetAfterCommitId sets the AfterCommitId field's value. +func (s *PostCommentForPullRequestInput) SetAfterCommitId(v string) *PostCommentForPullRequestInput { + s.AfterCommitId = &v return s } -// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. -func (s *GetMergeConflictsInput) SetConflictResolutionStrategy(v string) *GetMergeConflictsInput { - s.ConflictResolutionStrategy = &v +// SetBeforeCommitId sets the BeforeCommitId field's value. +func (s *PostCommentForPullRequestInput) SetBeforeCommitId(v string) *PostCommentForPullRequestInput { + s.BeforeCommitId = &v return s } -// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. -func (s *GetMergeConflictsInput) SetDestinationCommitSpecifier(v string) *GetMergeConflictsInput { - s.DestinationCommitSpecifier = &v +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *PostCommentForPullRequestInput) SetClientRequestToken(v string) *PostCommentForPullRequestInput { + s.ClientRequestToken = &v return s } -// SetMaxConflictFiles sets the MaxConflictFiles field's value. -func (s *GetMergeConflictsInput) SetMaxConflictFiles(v int64) *GetMergeConflictsInput { - s.MaxConflictFiles = &v +// SetContent sets the Content field's value. +func (s *PostCommentForPullRequestInput) SetContent(v string) *PostCommentForPullRequestInput { + s.Content = &v return s } -// SetMergeOption sets the MergeOption field's value. -func (s *GetMergeConflictsInput) SetMergeOption(v string) *GetMergeConflictsInput { - s.MergeOption = &v +// SetLocation sets the Location field's value. +func (s *PostCommentForPullRequestInput) SetLocation(v *Location) *PostCommentForPullRequestInput { + s.Location = v return s } -// SetNextToken sets the NextToken field's value. -func (s *GetMergeConflictsInput) SetNextToken(v string) *GetMergeConflictsInput { - s.NextToken = &v +// SetPullRequestId sets the PullRequestId field's value. +func (s *PostCommentForPullRequestInput) SetPullRequestId(v string) *PostCommentForPullRequestInput { + s.PullRequestId = &v return s } // SetRepositoryName sets the RepositoryName field's value. -func (s *GetMergeConflictsInput) SetRepositoryName(v string) *GetMergeConflictsInput { +func (s *PostCommentForPullRequestInput) SetRepositoryName(v string) *PostCommentForPullRequestInput { s.RepositoryName = &v return s } -// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. -func (s *GetMergeConflictsInput) SetSourceCommitSpecifier(v string) *GetMergeConflictsInput { - s.SourceCommitSpecifier = &v - return s -} - -type GetMergeConflictsOutput struct { +type PostCommentForPullRequestOutput struct { _ struct{} `type:"structure"` - // The commit ID of the merge base. - BaseCommitId *string `locationName:"baseCommitId" type:"string"` + // In the directionality of the pull request, the blob ID of the after blob. + AfterBlobId *string `locationName:"afterBlobId" type:"string"` - // A list of metadata for any conflicting files. If the specified merge strategy - // is FAST_FORWARD_MERGE, this list will always be empty. - // - // ConflictMetadataList is a required field - ConflictMetadataList []*ConflictMetadata `locationName:"conflictMetadataList" type:"list" required:"true"` + // The full commit ID of the commit in the destination branch where the pull + // request is merged. + AfterCommitId *string `locationName:"afterCommitId" type:"string"` - // The commit ID of the destination commit specifier that was used in the merge - // evaluation. - // - // DestinationCommitId is a required field - DestinationCommitId *string `locationName:"destinationCommitId" type:"string" required:"true"` + // In the directionality of the pull request, the blob ID of the before blob. + BeforeBlobId *string `locationName:"beforeBlobId" type:"string"` - // A Boolean value that indicates whether the code is mergeable by the specified - // merge option. - // - // Mergeable is a required field - Mergeable *bool `locationName:"mergeable" type:"boolean" required:"true"` + // The full commit ID of the commit in the source branch used to create the + // pull request, or in the case of an updated pull request, the full commit + // ID of the commit used to update the pull request. + BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` - // An enumeration token that can be used in a request to return the next batch - // of the results. - NextToken *string `locationName:"nextToken" type:"string"` + // The content of the comment you posted. + Comment *Comment `locationName:"comment" type:"structure"` - // The commit ID of the source commit specifier that was used in the merge evaluation. - // - // SourceCommitId is a required field - SourceCommitId *string `locationName:"sourceCommitId" type:"string" required:"true"` + // The location of the change where you posted your comment. + Location *Location `locationName:"location" type:"structure"` + + // The system-generated ID of the pull request. + PullRequestId *string `locationName:"pullRequestId" type:"string"` + + // The name of the repository where you posted a comment on a pull request. + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` } // String returns the string representation -func (s GetMergeConflictsOutput) String() string { +func (s PostCommentForPullRequestOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetMergeConflictsOutput) GoString() string { +func (s PostCommentForPullRequestOutput) GoString() string { return s.String() } -// SetBaseCommitId sets the BaseCommitId field's value. -func (s *GetMergeConflictsOutput) SetBaseCommitId(v string) *GetMergeConflictsOutput { - s.BaseCommitId = &v +// SetAfterBlobId sets the AfterBlobId field's value. +func (s *PostCommentForPullRequestOutput) SetAfterBlobId(v string) *PostCommentForPullRequestOutput { + s.AfterBlobId = &v + return s +} + +// SetAfterCommitId sets the AfterCommitId field's value. +func (s *PostCommentForPullRequestOutput) SetAfterCommitId(v string) *PostCommentForPullRequestOutput { + s.AfterCommitId = &v + return s +} + +// SetBeforeBlobId sets the BeforeBlobId field's value. +func (s *PostCommentForPullRequestOutput) SetBeforeBlobId(v string) *PostCommentForPullRequestOutput { + s.BeforeBlobId = &v return s } -// SetConflictMetadataList sets the ConflictMetadataList field's value. -func (s *GetMergeConflictsOutput) SetConflictMetadataList(v []*ConflictMetadata) *GetMergeConflictsOutput { - s.ConflictMetadataList = v +// SetBeforeCommitId sets the BeforeCommitId field's value. +func (s *PostCommentForPullRequestOutput) SetBeforeCommitId(v string) *PostCommentForPullRequestOutput { + s.BeforeCommitId = &v return s } -// SetDestinationCommitId sets the DestinationCommitId field's value. -func (s *GetMergeConflictsOutput) SetDestinationCommitId(v string) *GetMergeConflictsOutput { - s.DestinationCommitId = &v +// SetComment sets the Comment field's value. +func (s *PostCommentForPullRequestOutput) SetComment(v *Comment) *PostCommentForPullRequestOutput { + s.Comment = v return s } -// SetMergeable sets the Mergeable field's value. -func (s *GetMergeConflictsOutput) SetMergeable(v bool) *GetMergeConflictsOutput { - s.Mergeable = &v +// SetLocation sets the Location field's value. +func (s *PostCommentForPullRequestOutput) SetLocation(v *Location) *PostCommentForPullRequestOutput { + s.Location = v return s } -// SetNextToken sets the NextToken field's value. -func (s *GetMergeConflictsOutput) SetNextToken(v string) *GetMergeConflictsOutput { - s.NextToken = &v +// SetPullRequestId sets the PullRequestId field's value. +func (s *PostCommentForPullRequestOutput) SetPullRequestId(v string) *PostCommentForPullRequestOutput { + s.PullRequestId = &v return s } -// SetSourceCommitId sets the SourceCommitId field's value. -func (s *GetMergeConflictsOutput) SetSourceCommitId(v string) *GetMergeConflictsOutput { - s.SourceCommitId = &v +// SetRepositoryName sets the RepositoryName field's value. +func (s *PostCommentForPullRequestOutput) SetRepositoryName(v string) *PostCommentForPullRequestOutput { + s.RepositoryName = &v return s } -type GetMergeOptionsInput struct { +type PostCommentReplyInput struct { _ struct{} `type:"structure"` - // The level of conflict detail to use. If unspecified, the default FILE_LEVEL - // is used, which will return a not mergeable result if the same file has differences - // in both branches. If LINE_LEVEL is specified, a conflict will be considered - // not mergeable if the same file in both branches has differences on the same - // line. - ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` - - // Specifies which branch to use when resolving conflicts, or whether to attempt - // automatically merging two versions of a file. The default is NONE, which - // requires any conflicts to be resolved manually before the merge operation - // will be successful. - ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` - - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. - // - // DestinationCommitSpecifier is a required field - DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` + // A unique, client-generated idempotency token that, when provided in a request, + // ensures the request cannot be repeated with a changed parameter. If a request + // is received with the same parameters and a token is included, the request + // returns information about the initial request that used that token. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` - // The name of the repository that contains the commits about which you want - // to get merge options. + // The contents of your reply to a comment. // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + // Content is a required field + Content *string `locationName:"content" type:"string" required:"true"` - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. + // The system-generated ID of the comment to which you want to reply. To get + // this ID, use GetCommentsForComparedCommit or GetCommentsForPullRequest. // - // SourceCommitSpecifier is a required field - SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` + // InReplyTo is a required field + InReplyTo *string `locationName:"inReplyTo" type:"string" required:"true"` } // String returns the string representation -func (s GetMergeOptionsInput) String() string { +func (s PostCommentReplyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetMergeOptionsInput) GoString() string { +func (s PostCommentReplyInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetMergeOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetMergeOptionsInput"} - if s.DestinationCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) +func (s *PostCommentReplyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PostCommentReplyInput"} + if s.Content == nil { + invalidParams.Add(request.NewErrParamRequired("Content")) } - if s.SourceCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) + if s.InReplyTo == nil { + invalidParams.Add(request.NewErrParamRequired("InReplyTo")) } if invalidParams.Len() > 0 { @@ -12165,804 +26934,930 @@ func (s *GetMergeOptionsInput) Validate() error { return nil } -// SetConflictDetailLevel sets the ConflictDetailLevel field's value. -func (s *GetMergeOptionsInput) SetConflictDetailLevel(v string) *GetMergeOptionsInput { - s.ConflictDetailLevel = &v +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *PostCommentReplyInput) SetClientRequestToken(v string) *PostCommentReplyInput { + s.ClientRequestToken = &v return s } -// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. -func (s *GetMergeOptionsInput) SetConflictResolutionStrategy(v string) *GetMergeOptionsInput { - s.ConflictResolutionStrategy = &v +// SetContent sets the Content field's value. +func (s *PostCommentReplyInput) SetContent(v string) *PostCommentReplyInput { + s.Content = &v return s } -// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. -func (s *GetMergeOptionsInput) SetDestinationCommitSpecifier(v string) *GetMergeOptionsInput { - s.DestinationCommitSpecifier = &v +// SetInReplyTo sets the InReplyTo field's value. +func (s *PostCommentReplyInput) SetInReplyTo(v string) *PostCommentReplyInput { + s.InReplyTo = &v return s } -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetMergeOptionsInput) SetRepositoryName(v string) *GetMergeOptionsInput { - s.RepositoryName = &v - return s +type PostCommentReplyOutput struct { + _ struct{} `type:"structure"` + + // Information about the reply to a comment. + Comment *Comment `locationName:"comment" type:"structure"` } -// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. -func (s *GetMergeOptionsInput) SetSourceCommitSpecifier(v string) *GetMergeOptionsInput { - s.SourceCommitSpecifier = &v +// String returns the string representation +func (s PostCommentReplyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PostCommentReplyOutput) GoString() string { + return s.String() +} + +// SetComment sets the Comment field's value. +func (s *PostCommentReplyOutput) SetComment(v *Comment) *PostCommentReplyOutput { + s.Comment = v return s } -type GetMergeOptionsOutput struct { +// Returns information about a pull request. +type PullRequest struct { _ struct{} `type:"structure"` - // The commit ID of the merge base. - // - // BaseCommitId is a required field - BaseCommitId *string `locationName:"baseCommitId" type:"string" required:"true"` + // The approval rules applied to the pull request. + ApprovalRules []*ApprovalRule `locationName:"approvalRules" type:"list"` - // The commit ID of the destination commit specifier that was used in the merge - // evaluation. - // - // DestinationCommitId is a required field - DestinationCommitId *string `locationName:"destinationCommitId" type:"string" required:"true"` + // The Amazon Resource Name (ARN) of the user who created the pull request. + AuthorArn *string `locationName:"authorArn" type:"string"` - // The merge option or strategy used to merge the code. - // - // MergeOptions is a required field - MergeOptions []*string `locationName:"mergeOptions" type:"list" required:"true"` + // A unique, client-generated idempotency token that, when provided in a request, + // ensures the request cannot be repeated with a changed parameter. If a request + // is received with the same parameters and a token is included, the request + // returns information about the initial request that used that token. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string"` - // The commit ID of the source commit specifier that was used in the merge evaluation. - // - // SourceCommitId is a required field - SourceCommitId *string `locationName:"sourceCommitId" type:"string" required:"true"` + // The date and time the pull request was originally created, in timestamp format. + CreationDate *time.Time `locationName:"creationDate" type:"timestamp"` + + // The user-defined description of the pull request. This description can be + // used to clarify what should be reviewed and other details of the request. + Description *string `locationName:"description" type:"string"` + + // The day and time of the last user or system activity on the pull request, + // in timestamp format. + LastActivityDate *time.Time `locationName:"lastActivityDate" type:"timestamp"` + + // The system-generated ID of the pull request. + PullRequestId *string `locationName:"pullRequestId" type:"string"` + + // The status of the pull request. Pull request status can only change from + // OPEN to CLOSED. + PullRequestStatus *string `locationName:"pullRequestStatus" type:"string" enum:"PullRequestStatusEnum"` + + // The targets of the pull request, including the source branch and destination + // branch for the pull request. + PullRequestTargets []*PullRequestTarget `locationName:"pullRequestTargets" type:"list"` + + // The system-generated revision ID for the pull request. + RevisionId *string `locationName:"revisionId" type:"string"` + + // The user-defined title of the pull request. This title is displayed in the + // list of pull requests to other repository users. + Title *string `locationName:"title" type:"string"` } // String returns the string representation -func (s GetMergeOptionsOutput) String() string { +func (s PullRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetMergeOptionsOutput) GoString() string { +func (s PullRequest) GoString() string { return s.String() } -// SetBaseCommitId sets the BaseCommitId field's value. -func (s *GetMergeOptionsOutput) SetBaseCommitId(v string) *GetMergeOptionsOutput { - s.BaseCommitId = &v +// SetApprovalRules sets the ApprovalRules field's value. +func (s *PullRequest) SetApprovalRules(v []*ApprovalRule) *PullRequest { + s.ApprovalRules = v return s } -// SetDestinationCommitId sets the DestinationCommitId field's value. -func (s *GetMergeOptionsOutput) SetDestinationCommitId(v string) *GetMergeOptionsOutput { - s.DestinationCommitId = &v +// SetAuthorArn sets the AuthorArn field's value. +func (s *PullRequest) SetAuthorArn(v string) *PullRequest { + s.AuthorArn = &v return s } -// SetMergeOptions sets the MergeOptions field's value. -func (s *GetMergeOptionsOutput) SetMergeOptions(v []*string) *GetMergeOptionsOutput { - s.MergeOptions = v +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *PullRequest) SetClientRequestToken(v string) *PullRequest { + s.ClientRequestToken = &v return s } -// SetSourceCommitId sets the SourceCommitId field's value. -func (s *GetMergeOptionsOutput) SetSourceCommitId(v string) *GetMergeOptionsOutput { - s.SourceCommitId = &v +// SetCreationDate sets the CreationDate field's value. +func (s *PullRequest) SetCreationDate(v time.Time) *PullRequest { + s.CreationDate = &v return s } -type GetPullRequestInput struct { - _ struct{} `type:"structure"` - - // The system-generated ID of the pull request. To get this ID, use ListPullRequests. - // - // PullRequestId is a required field - PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` -} - -// String returns the string representation -func (s GetPullRequestInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetPullRequestInput) GoString() string { - return s.String() +// SetDescription sets the Description field's value. +func (s *PullRequest) SetDescription(v string) *PullRequest { + s.Description = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPullRequestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPullRequestInput"} - if s.PullRequestId == nil { - invalidParams.Add(request.NewErrParamRequired("PullRequestId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetLastActivityDate sets the LastActivityDate field's value. +func (s *PullRequest) SetLastActivityDate(v time.Time) *PullRequest { + s.LastActivityDate = &v + return s } // SetPullRequestId sets the PullRequestId field's value. -func (s *GetPullRequestInput) SetPullRequestId(v string) *GetPullRequestInput { +func (s *PullRequest) SetPullRequestId(v string) *PullRequest { s.PullRequestId = &v return s } -type GetPullRequestOutput struct { - _ struct{} `type:"structure"` - - // Information about the specified pull request. - // - // PullRequest is a required field - PullRequest *PullRequest `locationName:"pullRequest" type:"structure" required:"true"` +// SetPullRequestStatus sets the PullRequestStatus field's value. +func (s *PullRequest) SetPullRequestStatus(v string) *PullRequest { + s.PullRequestStatus = &v + return s } - -// String returns the string representation -func (s GetPullRequestOutput) String() string { - return awsutil.Prettify(s) + +// SetPullRequestTargets sets the PullRequestTargets field's value. +func (s *PullRequest) SetPullRequestTargets(v []*PullRequestTarget) *PullRequest { + s.PullRequestTargets = v + return s } -// GoString returns the string representation -func (s GetPullRequestOutput) GoString() string { - return s.String() +// SetRevisionId sets the RevisionId field's value. +func (s *PullRequest) SetRevisionId(v string) *PullRequest { + s.RevisionId = &v + return s } -// SetPullRequest sets the PullRequest field's value. -func (s *GetPullRequestOutput) SetPullRequest(v *PullRequest) *GetPullRequestOutput { - s.PullRequest = v +// SetTitle sets the Title field's value. +func (s *PullRequest) SetTitle(v string) *PullRequest { + s.Title = &v return s } -// Represents the input of a get repository operation. -type GetRepositoryInput struct { - _ struct{} `type:"structure"` +// The pull request status cannot be updated because it is already closed. +type PullRequestAlreadyClosedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The name of the repository to get information about. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetRepositoryInput) String() string { +func (s PullRequestAlreadyClosedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetRepositoryInput) GoString() string { +func (s PullRequestAlreadyClosedException) 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 +func newErrorPullRequestAlreadyClosedException(v protocol.ResponseMetadata) error { + return &PullRequestAlreadyClosedException{ + respMetadata: v, } - return nil } -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetRepositoryInput) SetRepositoryName(v string) *GetRepositoryInput { - s.RepositoryName = &v - return s +// Code returns the exception type name. +func (s PullRequestAlreadyClosedException) Code() string { + return "PullRequestAlreadyClosedException" } -// Represents the output of a get repository operation. -type GetRepositoryOutput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s PullRequestAlreadyClosedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Information about the repository. - RepositoryMetadata *RepositoryMetadata `locationName:"repositoryMetadata" type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PullRequestAlreadyClosedException) OrigErr() error { + return nil } -// String returns the string representation -func (s GetRepositoryOutput) String() string { - return awsutil.Prettify(s) +func (s PullRequestAlreadyClosedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// GoString returns the string representation -func (s GetRepositoryOutput) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s PullRequestAlreadyClosedException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetRepositoryMetadata sets the RepositoryMetadata field's value. -func (s *GetRepositoryOutput) SetRepositoryMetadata(v *RepositoryMetadata) *GetRepositoryOutput { - s.RepositoryMetadata = v - return s +// RequestID returns the service's response RequestID for request. +func (s PullRequestAlreadyClosedException) RequestID() string { + return s.respMetadata.RequestID } -// Represents the input of a get repository triggers operation. -type GetRepositoryTriggersInput struct { - _ struct{} `type:"structure"` +// The pull request cannot be merged because one or more approval rules applied +// to the pull request have conditions that have not been met. +type PullRequestApprovalRulesNotSatisfiedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetRepositoryTriggersInput) String() string { +func (s PullRequestApprovalRulesNotSatisfiedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetRepositoryTriggersInput) GoString() string { +func (s PullRequestApprovalRulesNotSatisfiedException) 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)) +func newErrorPullRequestApprovalRulesNotSatisfiedException(v protocol.ResponseMetadata) error { + return &PullRequestApprovalRulesNotSatisfiedException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s PullRequestApprovalRulesNotSatisfiedException) Code() string { + return "PullRequestApprovalRulesNotSatisfiedException" +} + +// Message returns the exception's message. +func (s PullRequestApprovalRulesNotSatisfiedException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PullRequestApprovalRulesNotSatisfiedException) OrigErr() error { return nil } -// SetRepositoryName sets the RepositoryName field's value. -func (s *GetRepositoryTriggersInput) SetRepositoryName(v string) *GetRepositoryTriggersInput { - s.RepositoryName = &v - return s +func (s PullRequestApprovalRulesNotSatisfiedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// Represents the output of a get repository triggers operation. -type GetRepositoryTriggersOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s PullRequestApprovalRulesNotSatisfiedException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The system-generated unique ID for the trigger. - ConfigurationId *string `locationName:"configurationId" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s PullRequestApprovalRulesNotSatisfiedException) RequestID() string { + return s.respMetadata.RequestID +} - // The JSON block of configuration information for each trigger. - Triggers []*RepositoryTrigger `locationName:"triggers" type:"list"` +// The approval cannot be applied because the user approving the pull request +// matches the user who created the pull request. You cannot approve a pull +// request that you created. +type PullRequestCannotBeApprovedByAuthorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetRepositoryTriggersOutput) String() string { +func (s PullRequestCannotBeApprovedByAuthorException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetRepositoryTriggersOutput) GoString() string { +func (s PullRequestCannotBeApprovedByAuthorException) GoString() string { return s.String() } -// SetConfigurationId sets the ConfigurationId field's value. -func (s *GetRepositoryTriggersOutput) SetConfigurationId(v string) *GetRepositoryTriggersOutput { - s.ConfigurationId = &v - return s +func newErrorPullRequestCannotBeApprovedByAuthorException(v protocol.ResponseMetadata) error { + return &PullRequestCannotBeApprovedByAuthorException{ + respMetadata: v, + } } -// SetTriggers sets the Triggers field's value. -func (s *GetRepositoryTriggersOutput) SetTriggers(v []*RepositoryTrigger) *GetRepositoryTriggersOutput { - s.Triggers = v - return s +// Code returns the exception type name. +func (s PullRequestCannotBeApprovedByAuthorException) Code() string { + return "PullRequestCannotBeApprovedByAuthorException" } -// Information about whether a file is binary or textual in a merge or pull -// request operation. -type IsBinaryFile struct { +// Message returns the exception's message. +func (s PullRequestCannotBeApprovedByAuthorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PullRequestCannotBeApprovedByAuthorException) OrigErr() error { + return nil +} + +func (s PullRequestCannotBeApprovedByAuthorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PullRequestCannotBeApprovedByAuthorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PullRequestCannotBeApprovedByAuthorException) RequestID() string { + return s.respMetadata.RequestID +} + +// Metadata about the pull request that is used when comparing the pull request +// source with its destination. +type PullRequestCreatedEventMetadata struct { _ struct{} `type:"structure"` - // The binary or non-binary status of a file in the base of a merge or pull - // request. - Base *bool `locationName:"base" type:"boolean"` + // The commit ID of the tip of the branch specified as the destination branch + // when the pull request was created. + DestinationCommitId *string `locationName:"destinationCommitId" type:"string"` - // The binary or non-binary status of a file in the destination of a merge or - // pull request. - Destination *bool `locationName:"destination" type:"boolean"` + // The commit ID of the most recent commit that the source branch and the destination + // branch have in common. + MergeBase *string `locationName:"mergeBase" type:"string"` - // The binary or non-binary status of file in the source of a merge or pull - // request. - Source *bool `locationName:"source" type:"boolean"` + // The name of the repository where the pull request was created. + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` + + // The commit ID on the source branch used when the pull request was created. + SourceCommitId *string `locationName:"sourceCommitId" type:"string"` } // String returns the string representation -func (s IsBinaryFile) String() string { +func (s PullRequestCreatedEventMetadata) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s IsBinaryFile) GoString() string { +func (s PullRequestCreatedEventMetadata) GoString() string { return s.String() } -// SetBase sets the Base field's value. -func (s *IsBinaryFile) SetBase(v bool) *IsBinaryFile { - s.Base = &v +// SetDestinationCommitId sets the DestinationCommitId field's value. +func (s *PullRequestCreatedEventMetadata) SetDestinationCommitId(v string) *PullRequestCreatedEventMetadata { + s.DestinationCommitId = &v return s } -// SetDestination sets the Destination field's value. -func (s *IsBinaryFile) SetDestination(v bool) *IsBinaryFile { - s.Destination = &v +// SetMergeBase sets the MergeBase field's value. +func (s *PullRequestCreatedEventMetadata) SetMergeBase(v string) *PullRequestCreatedEventMetadata { + s.MergeBase = &v return s } -// SetSource sets the Source field's value. -func (s *IsBinaryFile) SetSource(v bool) *IsBinaryFile { - s.Source = &v +// SetRepositoryName sets the RepositoryName field's value. +func (s *PullRequestCreatedEventMetadata) SetRepositoryName(v string) *PullRequestCreatedEventMetadata { + s.RepositoryName = &v return s } -// Represents the input of a list branches operation. -type ListBranchesInput struct { - _ struct{} `type:"structure"` +// SetSourceCommitId sets the SourceCommitId field's value. +func (s *PullRequestCreatedEventMetadata) SetSourceCommitId(v string) *PullRequestCreatedEventMetadata { + s.SourceCommitId = &v + return s +} - // An enumeration token that allows the operation to batch the results. - NextToken *string `locationName:"nextToken" type:"string"` +// The pull request ID could not be found. Make sure that you have specified +// the correct repository name and pull request ID, and then try again. +type PullRequestDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The name of the repository that contains the branches. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListBranchesInput) String() string { +func (s PullRequestDoesNotExistException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListBranchesInput) GoString() string { +func (s PullRequestDoesNotExistException) 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)) +func newErrorPullRequestDoesNotExistException(v protocol.ResponseMetadata) error { + return &PullRequestDoesNotExistException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s PullRequestDoesNotExistException) Code() string { + return "PullRequestDoesNotExistException" +} + +// Message returns the exception's message. +func (s PullRequestDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PullRequestDoesNotExistException) OrigErr() error { return nil } -// SetNextToken sets the NextToken field's value. -func (s *ListBranchesInput) SetNextToken(v string) *ListBranchesInput { - s.NextToken = &v - return s +func (s PullRequestDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetRepositoryName sets the RepositoryName field's value. -func (s *ListBranchesInput) SetRepositoryName(v string) *ListBranchesInput { - s.RepositoryName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s PullRequestDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode } -// Represents the output of a list branches operation. -type ListBranchesOutput struct { +// RequestID returns the service's response RequestID for request. +func (s PullRequestDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returns information about a pull request event. +type PullRequestEvent struct { _ struct{} `type:"structure"` - // The list of branch names. - Branches []*string `locationName:"branches" type:"list"` + // The Amazon Resource Name (ARN) of the user whose actions resulted in the + // event. Examples include updating the pull request with more commits or changing + // the status of a pull request. + ActorArn *string `locationName:"actorArn" type:"string"` + + // Information about a pull request event. + ApprovalRuleEventMetadata *ApprovalRuleEventMetadata `locationName:"approvalRuleEventMetadata" type:"structure"` + + // Information about an approval rule override event for a pull request. + ApprovalRuleOverriddenEventMetadata *ApprovalRuleOverriddenEventMetadata `locationName:"approvalRuleOverriddenEventMetadata" type:"structure"` + + // Information about an approval state change for a pull request. + ApprovalStateChangedEventMetadata *ApprovalStateChangedEventMetadata `locationName:"approvalStateChangedEventMetadata" type:"structure"` + + // The day and time of the pull request event, in timestamp format. + EventDate *time.Time `locationName:"eventDate" type:"timestamp"` + + // Information about the source and destination branches for the pull request. + PullRequestCreatedEventMetadata *PullRequestCreatedEventMetadata `locationName:"pullRequestCreatedEventMetadata" type:"structure"` + + // The type of the pull request event (for example, a status change event (PULL_REQUEST_STATUS_CHANGED) + // or update event (PULL_REQUEST_SOURCE_REFERENCE_UPDATED)). + PullRequestEventType *string `locationName:"pullRequestEventType" type:"string" enum:"PullRequestEventType"` + + // The system-generated ID of the pull request. + PullRequestId *string `locationName:"pullRequestId" type:"string"` + + // Information about the change in mergability state for the pull request event. + PullRequestMergedStateChangedEventMetadata *PullRequestMergedStateChangedEventMetadata `locationName:"pullRequestMergedStateChangedEventMetadata" type:"structure"` + + // Information about the updated source branch for the pull request event. + PullRequestSourceReferenceUpdatedEventMetadata *PullRequestSourceReferenceUpdatedEventMetadata `locationName:"pullRequestSourceReferenceUpdatedEventMetadata" type:"structure"` + + // Information about the change in status for the pull request event. + PullRequestStatusChangedEventMetadata *PullRequestStatusChangedEventMetadata `locationName:"pullRequestStatusChangedEventMetadata" type:"structure"` +} + +// String returns the string representation +func (s PullRequestEvent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PullRequestEvent) GoString() string { + return s.String() +} + +// SetActorArn sets the ActorArn field's value. +func (s *PullRequestEvent) SetActorArn(v string) *PullRequestEvent { + s.ActorArn = &v + return s +} + +// SetApprovalRuleEventMetadata sets the ApprovalRuleEventMetadata field's value. +func (s *PullRequestEvent) SetApprovalRuleEventMetadata(v *ApprovalRuleEventMetadata) *PullRequestEvent { + s.ApprovalRuleEventMetadata = v + return s +} - // An enumeration token that returns the batch of the results. - NextToken *string `locationName:"nextToken" type:"string"` +// SetApprovalRuleOverriddenEventMetadata sets the ApprovalRuleOverriddenEventMetadata field's value. +func (s *PullRequestEvent) SetApprovalRuleOverriddenEventMetadata(v *ApprovalRuleOverriddenEventMetadata) *PullRequestEvent { + s.ApprovalRuleOverriddenEventMetadata = v + return s } -// String returns the string representation -func (s ListBranchesOutput) String() string { - return awsutil.Prettify(s) +// SetApprovalStateChangedEventMetadata sets the ApprovalStateChangedEventMetadata field's value. +func (s *PullRequestEvent) SetApprovalStateChangedEventMetadata(v *ApprovalStateChangedEventMetadata) *PullRequestEvent { + s.ApprovalStateChangedEventMetadata = v + return s } -// GoString returns the string representation -func (s ListBranchesOutput) GoString() string { - return s.String() +// SetEventDate sets the EventDate field's value. +func (s *PullRequestEvent) SetEventDate(v time.Time) *PullRequestEvent { + s.EventDate = &v + return s } -// SetBranches sets the Branches field's value. -func (s *ListBranchesOutput) SetBranches(v []*string) *ListBranchesOutput { - s.Branches = v +// SetPullRequestCreatedEventMetadata sets the PullRequestCreatedEventMetadata field's value. +func (s *PullRequestEvent) SetPullRequestCreatedEventMetadata(v *PullRequestCreatedEventMetadata) *PullRequestEvent { + s.PullRequestCreatedEventMetadata = v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListBranchesOutput) SetNextToken(v string) *ListBranchesOutput { - s.NextToken = &v +// SetPullRequestEventType sets the PullRequestEventType field's value. +func (s *PullRequestEvent) SetPullRequestEventType(v string) *PullRequestEvent { + s.PullRequestEventType = &v return s } -type ListPullRequestsInput struct { - _ struct{} `type:"structure"` +// SetPullRequestId sets the PullRequestId field's value. +func (s *PullRequestEvent) SetPullRequestId(v string) *PullRequestEvent { + s.PullRequestId = &v + return s +} - // Optional. The Amazon Resource Name (ARN) of the user who created the pull - // request. If used, this filters the results to pull requests created by that - // user. - AuthorArn *string `locationName:"authorArn" type:"string"` +// SetPullRequestMergedStateChangedEventMetadata sets the PullRequestMergedStateChangedEventMetadata field's value. +func (s *PullRequestEvent) SetPullRequestMergedStateChangedEventMetadata(v *PullRequestMergedStateChangedEventMetadata) *PullRequestEvent { + s.PullRequestMergedStateChangedEventMetadata = v + return s +} - // A non-negative integer used to limit the number of returned results. - MaxResults *int64 `locationName:"maxResults" type:"integer"` +// SetPullRequestSourceReferenceUpdatedEventMetadata sets the PullRequestSourceReferenceUpdatedEventMetadata field's value. +func (s *PullRequestEvent) SetPullRequestSourceReferenceUpdatedEventMetadata(v *PullRequestSourceReferenceUpdatedEventMetadata) *PullRequestEvent { + s.PullRequestSourceReferenceUpdatedEventMetadata = v + return s +} - // An enumeration token that when provided in a request, returns the next batch - // of the results. - NextToken *string `locationName:"nextToken" type:"string"` +// SetPullRequestStatusChangedEventMetadata sets the PullRequestStatusChangedEventMetadata field's value. +func (s *PullRequestEvent) SetPullRequestStatusChangedEventMetadata(v *PullRequestStatusChangedEventMetadata) *PullRequestEvent { + s.PullRequestStatusChangedEventMetadata = v + return s +} - // Optional. The status of the pull request. If used, this refines the results - // to the pull requests that match the specified status. - PullRequestStatus *string `locationName:"pullRequestStatus" type:"string" enum:"PullRequestStatusEnum"` +// A pull request ID is required, but none was provided. +type PullRequestIdRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The name of the repository for which you want to list pull requests. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListPullRequestsInput) String() string { +func (s PullRequestIdRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListPullRequestsInput) GoString() string { +func (s PullRequestIdRequiredException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPullRequestsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPullRequestsInput"} - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) +func newErrorPullRequestIdRequiredException(v protocol.ResponseMetadata) error { + return &PullRequestIdRequiredException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// Code returns the exception type name. +func (s PullRequestIdRequiredException) Code() string { + return "PullRequestIdRequiredException" } -// SetAuthorArn sets the AuthorArn field's value. -func (s *ListPullRequestsInput) SetAuthorArn(v string) *ListPullRequestsInput { - s.AuthorArn = &v - return s +// Message returns the exception's message. +func (s PullRequestIdRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetMaxResults sets the MaxResults field's value. -func (s *ListPullRequestsInput) SetMaxResults(v int64) *ListPullRequestsInput { - s.MaxResults = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PullRequestIdRequiredException) OrigErr() error { + return nil } -// SetNextToken sets the NextToken field's value. -func (s *ListPullRequestsInput) SetNextToken(v string) *ListPullRequestsInput { - s.NextToken = &v - return s +func (s PullRequestIdRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetPullRequestStatus sets the PullRequestStatus field's value. -func (s *ListPullRequestsInput) SetPullRequestStatus(v string) *ListPullRequestsInput { - s.PullRequestStatus = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s PullRequestIdRequiredException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetRepositoryName sets the RepositoryName field's value. -func (s *ListPullRequestsInput) SetRepositoryName(v string) *ListPullRequestsInput { - s.RepositoryName = &v - return s +// RequestID returns the service's response RequestID for request. +func (s PullRequestIdRequiredException) RequestID() string { + return s.respMetadata.RequestID } -type ListPullRequestsOutput struct { +// Returns information about the change in the merge state for a pull request +// event. +type PullRequestMergedStateChangedEventMetadata struct { _ struct{} `type:"structure"` - // An enumeration token that when provided in a request, returns the next batch - // of the results. - NextToken *string `locationName:"nextToken" type:"string"` + // The name of the branch that the pull request is merged into. + DestinationReference *string `locationName:"destinationReference" type:"string"` - // The system-generated IDs of the pull requests. - // - // PullRequestIds is a required field - PullRequestIds []*string `locationName:"pullRequestIds" type:"list" required:"true"` + // Information about the merge state change event. + MergeMetadata *MergeMetadata `locationName:"mergeMetadata" type:"structure"` + + // The name of the repository where the pull request was created. + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` } // String returns the string representation -func (s ListPullRequestsOutput) String() string { +func (s PullRequestMergedStateChangedEventMetadata) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListPullRequestsOutput) GoString() string { +func (s PullRequestMergedStateChangedEventMetadata) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListPullRequestsOutput) SetNextToken(v string) *ListPullRequestsOutput { - s.NextToken = &v +// SetDestinationReference sets the DestinationReference field's value. +func (s *PullRequestMergedStateChangedEventMetadata) SetDestinationReference(v string) *PullRequestMergedStateChangedEventMetadata { + s.DestinationReference = &v return s } -// SetPullRequestIds sets the PullRequestIds field's value. -func (s *ListPullRequestsOutput) SetPullRequestIds(v []*string) *ListPullRequestsOutput { - s.PullRequestIds = v +// SetMergeMetadata sets the MergeMetadata field's value. +func (s *PullRequestMergedStateChangedEventMetadata) SetMergeMetadata(v *MergeMetadata) *PullRequestMergedStateChangedEventMetadata { + s.MergeMetadata = v return s } -// Represents the input of a list repositories operation. -type ListRepositoriesInput struct { +// SetRepositoryName sets the RepositoryName field's value. +func (s *PullRequestMergedStateChangedEventMetadata) SetRepositoryName(v string) *PullRequestMergedStateChangedEventMetadata { + s.RepositoryName = &v + return s +} + +// Information about an update to the source branch of a pull request. +type PullRequestSourceReferenceUpdatedEventMetadata 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 full commit ID of the commit in the source branch that was the tip of + // the branch at the time the pull request was updated. + AfterCommitId *string `locationName:"afterCommitId" type:"string"` - // The order in which to sort the results of a list repositories operation. - Order *string `locationName:"order" type:"string" enum:"OrderEnum"` + // The full commit ID of the commit in the destination branch that was the tip + // of the branch at the time the pull request was updated. + BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` - // The criteria used to sort the results of a list repositories operation. - SortBy *string `locationName:"sortBy" type:"string" enum:"SortByEnum"` + // The commit ID of the most recent commit that the source branch and the destination + // branch have in common. + MergeBase *string `locationName:"mergeBase" type:"string"` + + // The name of the repository where the pull request was updated. + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` } // String returns the string representation -func (s ListRepositoriesInput) String() string { +func (s PullRequestSourceReferenceUpdatedEventMetadata) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListRepositoriesInput) GoString() string { +func (s PullRequestSourceReferenceUpdatedEventMetadata) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListRepositoriesInput) SetNextToken(v string) *ListRepositoriesInput { - s.NextToken = &v +// SetAfterCommitId sets the AfterCommitId field's value. +func (s *PullRequestSourceReferenceUpdatedEventMetadata) SetAfterCommitId(v string) *PullRequestSourceReferenceUpdatedEventMetadata { + s.AfterCommitId = &v return s } -// SetOrder sets the Order field's value. -func (s *ListRepositoriesInput) SetOrder(v string) *ListRepositoriesInput { - s.Order = &v +// SetBeforeCommitId sets the BeforeCommitId field's value. +func (s *PullRequestSourceReferenceUpdatedEventMetadata) SetBeforeCommitId(v string) *PullRequestSourceReferenceUpdatedEventMetadata { + s.BeforeCommitId = &v return s } -// SetSortBy sets the SortBy field's value. -func (s *ListRepositoriesInput) SetSortBy(v string) *ListRepositoriesInput { - s.SortBy = &v +// SetMergeBase sets the MergeBase field's value. +func (s *PullRequestSourceReferenceUpdatedEventMetadata) SetMergeBase(v string) *PullRequestSourceReferenceUpdatedEventMetadata { + s.MergeBase = &v return s } -// Represents the output of a list repositories operation. -type ListRepositoriesOutput struct { - _ struct{} `type:"structure"` +// SetRepositoryName sets the RepositoryName field's value. +func (s *PullRequestSourceReferenceUpdatedEventMetadata) SetRepositoryName(v string) *PullRequestSourceReferenceUpdatedEventMetadata { + s.RepositoryName = &v + return s +} - // 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"` +// Information about a change to the status of a pull request. +type PullRequestStatusChangedEventMetadata struct { + _ struct{} `type:"structure"` - // Lists the repositories called by the list repositories operation. - Repositories []*RepositoryNameIdPair `locationName:"repositories" type:"list"` + // The changed status of the pull request. + PullRequestStatus *string `locationName:"pullRequestStatus" type:"string" enum:"PullRequestStatusEnum"` } // String returns the string representation -func (s ListRepositoriesOutput) String() string { +func (s PullRequestStatusChangedEventMetadata) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListRepositoriesOutput) GoString() string { +func (s PullRequestStatusChangedEventMetadata) 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 +// SetPullRequestStatus sets the PullRequestStatus field's value. +func (s *PullRequestStatusChangedEventMetadata) SetPullRequestStatus(v string) *PullRequestStatusChangedEventMetadata { + s.PullRequestStatus = &v return s } -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // An enumeration token that when provided in a request, returns the next batch - // of the results. - NextToken *string `locationName:"nextToken" type:"string"` +// A pull request status is required, but none was provided. +type PullRequestStatusRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The Amazon Resource Name (ARN) of the resource for which you want to get - // information about tags, if any. - // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListTagsForResourceInput) String() string { +func (s PullRequestStatusRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsForResourceInput) GoString() string { +func (s PullRequestStatusRequiredException) 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")) +func newErrorPullRequestStatusRequiredException(v protocol.ResponseMetadata) error { + return &PullRequestStatusRequiredException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s PullRequestStatusRequiredException) Code() string { + return "PullRequestStatusRequiredException" +} + +// Message returns the exception's message. +func (s PullRequestStatusRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetNextToken sets the NextToken field's value. -func (s *ListTagsForResourceInput) SetNextToken(v string) *ListTagsForResourceInput { - s.NextToken = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PullRequestStatusRequiredException) OrigErr() error { + return nil +} + +func (s PullRequestStatusRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s PullRequestStatusRequiredException) StatusCode() int { + return s.respMetadata.StatusCode } -type ListTagsForResourceOutput struct { +// RequestID returns the service's response RequestID for request. +func (s PullRequestStatusRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returns information about a pull request target. +type PullRequestTarget struct { _ struct{} `type:"structure"` - // An enumeration token that allows the operation to batch the next results - // of the operation. - NextToken *string `locationName:"nextToken" type:"string"` + // The full commit ID that is the tip of the destination branch. This is the + // commit where the pull request was or will be merged. + DestinationCommit *string `locationName:"destinationCommit" type:"string"` - // A list of tag key and value pairs associated with the specified resource. - Tags map[string]*string `locationName:"tags" type:"map"` + // The branch of the repository where the pull request changes are merged. Also + // known as the destination branch. + DestinationReference *string `locationName:"destinationReference" type:"string"` + + // The commit ID of the most recent commit that the source branch and the destination + // branch have in common. + MergeBase *string `locationName:"mergeBase" type:"string"` + + // Returns metadata about the state of the merge, including whether the merge + // has been made. + MergeMetadata *MergeMetadata `locationName:"mergeMetadata" type:"structure"` + + // The name of the repository that contains the pull request source and destination + // branches. + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` + + // The full commit ID of the tip of the source branch used to create the pull + // request. If the pull request branch is updated by a push while the pull request + // is open, the commit ID changes to reflect the new tip of the branch. + SourceCommit *string `locationName:"sourceCommit" type:"string"` + + // The branch of the repository that contains the changes for the pull request. + // Also known as the source branch. + SourceReference *string `locationName:"sourceReference" type:"string"` } // String returns the string representation -func (s ListTagsForResourceOutput) String() string { +func (s PullRequestTarget) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsForResourceOutput) GoString() string { +func (s PullRequestTarget) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListTagsForResourceOutput) SetNextToken(v string) *ListTagsForResourceOutput { - s.NextToken = &v +// SetDestinationCommit sets the DestinationCommit field's value. +func (s *PullRequestTarget) SetDestinationCommit(v string) *PullRequestTarget { + s.DestinationCommit = &v return s } -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v +// SetDestinationReference sets the DestinationReference field's value. +func (s *PullRequestTarget) SetDestinationReference(v string) *PullRequestTarget { + s.DestinationReference = &v return s } -// Returns information about the location of a change or comment in the comparison -// between two commits or a pull request. -type Location struct { - _ struct{} `type:"structure"` - - // The name of the file being compared, including its extension and subdirectory, - // if any. - FilePath *string `locationName:"filePath" type:"string"` - - // The position of a change within a compared file, in line number format. - FilePosition *int64 `locationName:"filePosition" type:"long"` - - // In a comparison of commits or a pull request, whether the change is in the - // 'before' or 'after' of that comparison. - RelativeFileVersion *string `locationName:"relativeFileVersion" type:"string" enum:"RelativeFileVersionEnum"` -} - -// String returns the string representation -func (s Location) String() string { - return awsutil.Prettify(s) +// SetMergeBase sets the MergeBase field's value. +func (s *PullRequestTarget) SetMergeBase(v string) *PullRequestTarget { + s.MergeBase = &v + return s } -// GoString returns the string representation -func (s Location) GoString() string { - return s.String() +// SetMergeMetadata sets the MergeMetadata field's value. +func (s *PullRequestTarget) SetMergeMetadata(v *MergeMetadata) *PullRequestTarget { + s.MergeMetadata = v + return s } -// SetFilePath sets the FilePath field's value. -func (s *Location) SetFilePath(v string) *Location { - s.FilePath = &v +// SetRepositoryName sets the RepositoryName field's value. +func (s *PullRequestTarget) SetRepositoryName(v string) *PullRequestTarget { + s.RepositoryName = &v return s } -// SetFilePosition sets the FilePosition field's value. -func (s *Location) SetFilePosition(v int64) *Location { - s.FilePosition = &v +// SetSourceCommit sets the SourceCommit field's value. +func (s *PullRequestTarget) SetSourceCommit(v string) *PullRequestTarget { + s.SourceCommit = &v return s } -// SetRelativeFileVersion sets the RelativeFileVersion field's value. -func (s *Location) SetRelativeFileVersion(v string) *Location { - s.RelativeFileVersion = &v +// SetSourceReference sets the SourceReference field's value. +func (s *PullRequestTarget) SetSourceReference(v string) *PullRequestTarget { + s.SourceReference = &v return s } -type MergeBranchesByFastForwardInput struct { +// Information about a file added or updated as part of a commit. +type PutFileEntry struct { _ struct{} `type:"structure"` - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. + // The content of the file, if a source file is not specified. // - // DestinationCommitSpecifier is a required field - DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` + // FileContent is automatically base64 encoded/decoded by the SDK. + FileContent []byte `locationName:"fileContent" type:"blob"` - // The name of the repository where you want to merge two branches. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + // The extrapolated file mode permissions for the file. Valid values include + // EXECUTABLE and NORMAL. + FileMode *string `locationName:"fileMode" type:"string" enum:"FileModeTypeEnum"` - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. + // The full path to the file in the repository, including the name of the file. // - // SourceCommitSpecifier is a required field - SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` + // FilePath is a required field + FilePath *string `locationName:"filePath" type:"string" required:"true"` - // The branch where the merge will be applied. - TargetBranch *string `locationName:"targetBranch" min:"1" type:"string"` + // The name and full path of the file that contains the changes you want to + // make as part of the commit, if you are not providing the file content directly. + SourceFile *SourceFileSpecifier `locationName:"sourceFile" type:"structure"` } // String returns the string representation -func (s MergeBranchesByFastForwardInput) String() string { +func (s PutFileEntry) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MergeBranchesByFastForwardInput) GoString() string { +func (s PutFileEntry) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *MergeBranchesByFastForwardInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MergeBranchesByFastForwardInput"} - if s.DestinationCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) - } - 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.SourceCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) +func (s *PutFileEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutFileEntry"} + if s.FilePath == nil { + invalidParams.Add(request.NewErrParamRequired("FilePath")) } - if s.TargetBranch != nil && len(*s.TargetBranch) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetBranch", 1)) + if s.SourceFile != nil { + if err := s.SourceFile.Validate(); err != nil { + invalidParams.AddNested("SourceFile", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -12971,134 +27866,165 @@ func (s *MergeBranchesByFastForwardInput) Validate() error { return nil } -// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. -func (s *MergeBranchesByFastForwardInput) SetDestinationCommitSpecifier(v string) *MergeBranchesByFastForwardInput { - s.DestinationCommitSpecifier = &v +// SetFileContent sets the FileContent field's value. +func (s *PutFileEntry) SetFileContent(v []byte) *PutFileEntry { + s.FileContent = v return s } -// SetRepositoryName sets the RepositoryName field's value. -func (s *MergeBranchesByFastForwardInput) SetRepositoryName(v string) *MergeBranchesByFastForwardInput { - s.RepositoryName = &v +// SetFileMode sets the FileMode field's value. +func (s *PutFileEntry) SetFileMode(v string) *PutFileEntry { + s.FileMode = &v return s } -// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. -func (s *MergeBranchesByFastForwardInput) SetSourceCommitSpecifier(v string) *MergeBranchesByFastForwardInput { - s.SourceCommitSpecifier = &v +// SetFilePath sets the FilePath field's value. +func (s *PutFileEntry) SetFilePath(v string) *PutFileEntry { + s.FilePath = &v return s } -// SetTargetBranch sets the TargetBranch field's value. -func (s *MergeBranchesByFastForwardInput) SetTargetBranch(v string) *MergeBranchesByFastForwardInput { - s.TargetBranch = &v +// SetSourceFile sets the SourceFile field's value. +func (s *PutFileEntry) SetSourceFile(v *SourceFileSpecifier) *PutFileEntry { + s.SourceFile = v return s } -type MergeBranchesByFastForwardOutput struct { - _ struct{} `type:"structure"` - - // The commit ID of the merge in the destination or target branch. - CommitId *string `locationName:"commitId" type:"string"` +// The commit cannot be created because one or more files specified in the commit +// reference both a file and a folder. +type PutFileEntryConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The tree ID of the merge in the destination or target branch. - TreeId *string `locationName:"treeId" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s MergeBranchesByFastForwardOutput) String() string { +func (s PutFileEntryConflictException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MergeBranchesByFastForwardOutput) GoString() string { +func (s PutFileEntryConflictException) GoString() string { return s.String() } -// SetCommitId sets the CommitId field's value. -func (s *MergeBranchesByFastForwardOutput) SetCommitId(v string) *MergeBranchesByFastForwardOutput { - s.CommitId = &v - return s +func newErrorPutFileEntryConflictException(v protocol.ResponseMetadata) error { + return &PutFileEntryConflictException{ + respMetadata: v, + } } -// SetTreeId sets the TreeId field's value. -func (s *MergeBranchesByFastForwardOutput) SetTreeId(v string) *MergeBranchesByFastForwardOutput { - s.TreeId = &v - return s +// Code returns the exception type name. +func (s PutFileEntryConflictException) Code() string { + return "PutFileEntryConflictException" } -type MergeBranchesBySquashInput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s PutFileEntryConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The name of the author who created the commit. This information will be used - // as both the author and committer for the commit. - AuthorName *string `locationName:"authorName" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PutFileEntryConflictException) OrigErr() error { + return nil +} - // The commit message for the merge. - CommitMessage *string `locationName:"commitMessage" type:"string"` +func (s PutFileEntryConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The level of conflict detail to use. If unspecified, the default FILE_LEVEL - // is used, which will return a not mergeable result if the same file has differences - // in both branches. If LINE_LEVEL is specified, a conflict will be considered - // not mergeable if the same file in both branches has differences on the same - // line. - ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` +// Status code returns the HTTP status code for the request's response error. +func (s PutFileEntryConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} - // A list of inputs to use when resolving conflicts during a merge if AUTOMERGE - // is chosen as the conflict resolution strategy. - ConflictResolution *ConflictResolution `locationName:"conflictResolution" type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s PutFileEntryConflictException) RequestID() string { + return s.respMetadata.RequestID +} - // Specifies which branch to use when resolving conflicts, or whether to attempt - // automatically merging two versions of a file. The default is NONE, which - // requires any conflicts to be resolved manually before the merge operation - // will be successful. - ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` +type PutFileInput struct { + _ struct{} `type:"structure"` - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. + // The name of the branch where you want to add or update the file. If this + // is an empty repository, this branch is created. // - // DestinationCommitSpecifier is a required field - DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` + // BranchName is a required field + BranchName *string `locationName:"branchName" min:"1" type:"string" required:"true"` + + // A message about why this file was added or updated. Although it is optional, + // a message makes the commit history for your repository more useful. + CommitMessage *string `locationName:"commitMessage" type:"string"` - // The email address of the person merging the branches. This information will - // be used in the commit information for the merge. + // An email address for the person adding or updating the file. Email *string `locationName:"email" type:"string"` - // If the commit contains deletions, whether to keep a folder or folder structure - // if the changes leave the folders empty. If this is specified as true, a .gitkeep - // file will be created for empty folders. The default is false. - KeepEmptyFolders *bool `locationName:"keepEmptyFolders" type:"boolean"` + // The content of the file, in binary object format. + // + // FileContent is automatically base64 encoded/decoded by the SDK. + // + // FileContent is a required field + FileContent []byte `locationName:"fileContent" type:"blob" required:"true"` - // The name of the repository where you want to merge two branches. + // The file mode permissions of the blob. Valid file mode permissions are listed + // here. + FileMode *string `locationName:"fileMode" type:"string" enum:"FileModeTypeEnum"` + + // The name of the file you want to add or update, including the relative path + // to the file in the repository. // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + // If the path does not currently exist in the repository, the path is created + // as part of adding the file. + // + // FilePath is a required field + FilePath *string `locationName:"filePath" type:"string" required:"true"` - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. + // The name of the person adding or updating the file. Although it is optional, + // a name makes the commit history for your repository more useful. + Name *string `locationName:"name" type:"string"` + + // The full commit ID of the head commit in the branch where you want to add + // or update the file. If this is an empty repository, no commit ID is required. + // If this is not an empty repository, a commit ID is required. // - // SourceCommitSpecifier is a required field - SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` + // The commit ID must match the ID of the head commit at the time of the operation. + // Otherwise, an error occurs, and the file is not added or updated. + ParentCommitId *string `locationName:"parentCommitId" type:"string"` - // The branch where the merge will be applied. - TargetBranch *string `locationName:"targetBranch" min:"1" type:"string"` + // The name of the repository where you want to add or update the file. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` } // String returns the string representation -func (s MergeBranchesBySquashInput) String() string { +func (s PutFileInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MergeBranchesBySquashInput) GoString() string { +func (s PutFileInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *MergeBranchesBySquashInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MergeBranchesBySquashInput"} - if s.DestinationCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) +func (s *PutFileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutFileInput"} + 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.FileContent == nil { + invalidParams.Add(request.NewErrParamRequired("FileContent")) + } + if s.FilePath == nil { + invalidParams.Add(request.NewErrParamRequired("FilePath")) } if s.RepositoryName == nil { invalidParams.Add(request.NewErrParamRequired("RepositoryName")) @@ -13106,17 +28032,6 @@ func (s *MergeBranchesBySquashInput) Validate() error { if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) } - if s.SourceCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) - } - if s.TargetBranch != nil && len(*s.TargetBranch) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetBranch", 1)) - } - if s.ConflictResolution != nil { - if err := s.ConflictResolution.Validate(); err != nil { - invalidParams.AddNested("ConflictResolution", err.(request.ErrInvalidParams)) - } - } if invalidParams.Len() > 0 { return invalidParams @@ -13124,192 +28039,153 @@ func (s *MergeBranchesBySquashInput) Validate() error { return nil } -// SetAuthorName sets the AuthorName field's value. -func (s *MergeBranchesBySquashInput) SetAuthorName(v string) *MergeBranchesBySquashInput { - s.AuthorName = &v +// SetBranchName sets the BranchName field's value. +func (s *PutFileInput) SetBranchName(v string) *PutFileInput { + s.BranchName = &v return s } // SetCommitMessage sets the CommitMessage field's value. -func (s *MergeBranchesBySquashInput) SetCommitMessage(v string) *MergeBranchesBySquashInput { +func (s *PutFileInput) SetCommitMessage(v string) *PutFileInput { s.CommitMessage = &v return s } -// SetConflictDetailLevel sets the ConflictDetailLevel field's value. -func (s *MergeBranchesBySquashInput) SetConflictDetailLevel(v string) *MergeBranchesBySquashInput { - s.ConflictDetailLevel = &v +// SetEmail sets the Email field's value. +func (s *PutFileInput) SetEmail(v string) *PutFileInput { + s.Email = &v return s } -// SetConflictResolution sets the ConflictResolution field's value. -func (s *MergeBranchesBySquashInput) SetConflictResolution(v *ConflictResolution) *MergeBranchesBySquashInput { - s.ConflictResolution = v +// SetFileContent sets the FileContent field's value. +func (s *PutFileInput) SetFileContent(v []byte) *PutFileInput { + s.FileContent = v return s } -// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. -func (s *MergeBranchesBySquashInput) SetConflictResolutionStrategy(v string) *MergeBranchesBySquashInput { - s.ConflictResolutionStrategy = &v +// SetFileMode sets the FileMode field's value. +func (s *PutFileInput) SetFileMode(v string) *PutFileInput { + s.FileMode = &v return s } -// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. -func (s *MergeBranchesBySquashInput) SetDestinationCommitSpecifier(v string) *MergeBranchesBySquashInput { - s.DestinationCommitSpecifier = &v +// SetFilePath sets the FilePath field's value. +func (s *PutFileInput) SetFilePath(v string) *PutFileInput { + s.FilePath = &v return s } -// SetEmail sets the Email field's value. -func (s *MergeBranchesBySquashInput) SetEmail(v string) *MergeBranchesBySquashInput { - s.Email = &v +// SetName sets the Name field's value. +func (s *PutFileInput) SetName(v string) *PutFileInput { + s.Name = &v return s } -// SetKeepEmptyFolders sets the KeepEmptyFolders field's value. -func (s *MergeBranchesBySquashInput) SetKeepEmptyFolders(v bool) *MergeBranchesBySquashInput { - s.KeepEmptyFolders = &v +// SetParentCommitId sets the ParentCommitId field's value. +func (s *PutFileInput) SetParentCommitId(v string) *PutFileInput { + s.ParentCommitId = &v return s } // SetRepositoryName sets the RepositoryName field's value. -func (s *MergeBranchesBySquashInput) SetRepositoryName(v string) *MergeBranchesBySquashInput { +func (s *PutFileInput) SetRepositoryName(v string) *PutFileInput { s.RepositoryName = &v return s } -// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. -func (s *MergeBranchesBySquashInput) SetSourceCommitSpecifier(v string) *MergeBranchesBySquashInput { - s.SourceCommitSpecifier = &v - return s -} - -// SetTargetBranch sets the TargetBranch field's value. -func (s *MergeBranchesBySquashInput) SetTargetBranch(v string) *MergeBranchesBySquashInput { - s.TargetBranch = &v - return s -} - -type MergeBranchesBySquashOutput struct { +type PutFileOutput struct { _ struct{} `type:"structure"` - // The commit ID of the merge in the destination or target branch. - CommitId *string `locationName:"commitId" type:"string"` + // 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 tree ID of the merge in the destination or target branch. - TreeId *string `locationName:"treeId" type:"string"` + // The full SHA ID of the commit that contains this file change. + // + // CommitId is a required field + CommitId *string `locationName:"commitId" type:"string" required:"true"` + + // The full SHA-1 pointer of the tree information for the commit that contains + // this file change. + // + // TreeId is a required field + TreeId *string `locationName:"treeId" type:"string" required:"true"` } // String returns the string representation -func (s MergeBranchesBySquashOutput) String() string { +func (s PutFileOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MergeBranchesBySquashOutput) GoString() string { +func (s PutFileOutput) GoString() string { return s.String() } +// SetBlobId sets the BlobId field's value. +func (s *PutFileOutput) SetBlobId(v string) *PutFileOutput { + s.BlobId = &v + return s +} + // SetCommitId sets the CommitId field's value. -func (s *MergeBranchesBySquashOutput) SetCommitId(v string) *MergeBranchesBySquashOutput { +func (s *PutFileOutput) SetCommitId(v string) *PutFileOutput { s.CommitId = &v return s } // SetTreeId sets the TreeId field's value. -func (s *MergeBranchesBySquashOutput) SetTreeId(v string) *MergeBranchesBySquashOutput { +func (s *PutFileOutput) SetTreeId(v string) *PutFileOutput { s.TreeId = &v return s } -type MergeBranchesByThreeWayInput struct { +// Represents the input of a put repository triggers operation. +type PutRepositoryTriggersInput struct { _ struct{} `type:"structure"` - // The name of the author who created the commit. This information will be used - // as both the author and committer for the commit. - AuthorName *string `locationName:"authorName" type:"string"` - - // The commit message to include in the commit information for the merge. - CommitMessage *string `locationName:"commitMessage" type:"string"` - - // The level of conflict detail to use. If unspecified, the default FILE_LEVEL - // is used, which will return a not mergeable result if the same file has differences - // in both branches. If LINE_LEVEL is specified, a conflict will be considered - // not mergeable if the same file in both branches has differences on the same - // line. - ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` - - // A list of inputs to use when resolving conflicts during a merge if AUTOMERGE - // is chosen as the conflict resolution strategy. - ConflictResolution *ConflictResolution `locationName:"conflictResolution" type:"structure"` - - // Specifies which branch to use when resolving conflicts, or whether to attempt - // automatically merging two versions of a file. The default is NONE, which - // requires any conflicts to be resolved manually before the merge operation - // will be successful. - ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` - - // The branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. - // - // DestinationCommitSpecifier is a required field - DestinationCommitSpecifier *string `locationName:"destinationCommitSpecifier" type:"string" required:"true"` - - // The email address of the person merging the branches. This information will - // be used in the commit information for the merge. - Email *string `locationName:"email" type:"string"` - - // If the commit contains deletions, whether to keep a folder or folder structure - // if the changes leave the folders empty. If this is specified as true, a .gitkeep - // file will be created for empty folders. The default is false. - KeepEmptyFolders *bool `locationName:"keepEmptyFolders" type:"boolean"` - - // The name of the repository where you want to merge two branches. + // 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 branch, tag, HEAD, or other fully qualified reference used to identify - // a commit. For example, a branch name or a full commit ID. + // The JSON block of configuration information for each trigger. // - // SourceCommitSpecifier is a required field - SourceCommitSpecifier *string `locationName:"sourceCommitSpecifier" type:"string" required:"true"` - - // The branch where the merge will be applied. - TargetBranch *string `locationName:"targetBranch" min:"1" type:"string"` + // Triggers is a required field + Triggers []*RepositoryTrigger `locationName:"triggers" type:"list" required:"true"` } // String returns the string representation -func (s MergeBranchesByThreeWayInput) String() string { +func (s PutRepositoryTriggersInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MergeBranchesByThreeWayInput) GoString() string { +func (s PutRepositoryTriggersInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *MergeBranchesByThreeWayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MergeBranchesByThreeWayInput"} - if s.DestinationCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCommitSpecifier")) - } +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.SourceCommitSpecifier == nil { - invalidParams.Add(request.NewErrParamRequired("SourceCommitSpecifier")) - } - if s.TargetBranch != nil && len(*s.TargetBranch) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetBranch", 1)) + if s.Triggers == nil { + invalidParams.Add(request.NewErrParamRequired("Triggers")) } - if s.ConflictResolution != nil { - if err := s.ConflictResolution.Validate(); err != nil { - invalidParams.AddNested("ConflictResolution", err.(request.ErrInvalidParams)) + 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)) + } } } @@ -13319,330 +28195,252 @@ func (s *MergeBranchesByThreeWayInput) Validate() error { return nil } -// SetAuthorName sets the AuthorName field's value. -func (s *MergeBranchesByThreeWayInput) SetAuthorName(v string) *MergeBranchesByThreeWayInput { - s.AuthorName = &v - return s -} - -// SetCommitMessage sets the CommitMessage field's value. -func (s *MergeBranchesByThreeWayInput) SetCommitMessage(v string) *MergeBranchesByThreeWayInput { - s.CommitMessage = &v - return s -} - -// SetConflictDetailLevel sets the ConflictDetailLevel field's value. -func (s *MergeBranchesByThreeWayInput) SetConflictDetailLevel(v string) *MergeBranchesByThreeWayInput { - s.ConflictDetailLevel = &v - return s -} - -// SetConflictResolution sets the ConflictResolution field's value. -func (s *MergeBranchesByThreeWayInput) SetConflictResolution(v *ConflictResolution) *MergeBranchesByThreeWayInput { - s.ConflictResolution = v - return s -} - -// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. -func (s *MergeBranchesByThreeWayInput) SetConflictResolutionStrategy(v string) *MergeBranchesByThreeWayInput { - s.ConflictResolutionStrategy = &v - return s -} - -// SetDestinationCommitSpecifier sets the DestinationCommitSpecifier field's value. -func (s *MergeBranchesByThreeWayInput) SetDestinationCommitSpecifier(v string) *MergeBranchesByThreeWayInput { - s.DestinationCommitSpecifier = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *MergeBranchesByThreeWayInput) SetEmail(v string) *MergeBranchesByThreeWayInput { - s.Email = &v - return s -} - -// SetKeepEmptyFolders sets the KeepEmptyFolders field's value. -func (s *MergeBranchesByThreeWayInput) SetKeepEmptyFolders(v bool) *MergeBranchesByThreeWayInput { - s.KeepEmptyFolders = &v - return s -} - // SetRepositoryName sets the RepositoryName field's value. -func (s *MergeBranchesByThreeWayInput) SetRepositoryName(v string) *MergeBranchesByThreeWayInput { +func (s *PutRepositoryTriggersInput) SetRepositoryName(v string) *PutRepositoryTriggersInput { s.RepositoryName = &v return s } -// SetSourceCommitSpecifier sets the SourceCommitSpecifier field's value. -func (s *MergeBranchesByThreeWayInput) SetSourceCommitSpecifier(v string) *MergeBranchesByThreeWayInput { - s.SourceCommitSpecifier = &v - return s -} - -// SetTargetBranch sets the TargetBranch field's value. -func (s *MergeBranchesByThreeWayInput) SetTargetBranch(v string) *MergeBranchesByThreeWayInput { - s.TargetBranch = &v +// SetTriggers sets the Triggers field's value. +func (s *PutRepositoryTriggersInput) SetTriggers(v []*RepositoryTrigger) *PutRepositoryTriggersInput { + s.Triggers = v return s } -type MergeBranchesByThreeWayOutput struct { +// Represents the output of a put repository triggers operation. +type PutRepositoryTriggersOutput struct { _ struct{} `type:"structure"` - // The commit ID of the merge in the destination or target branch. - CommitId *string `locationName:"commitId" type:"string"` - - // The tree ID of the merge in the destination or target branch. - TreeId *string `locationName:"treeId" type:"string"` + // The system-generated unique ID for the create or update operation. + ConfigurationId *string `locationName:"configurationId" type:"string"` } // String returns the string representation -func (s MergeBranchesByThreeWayOutput) String() string { +func (s PutRepositoryTriggersOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MergeBranchesByThreeWayOutput) GoString() string { +func (s PutRepositoryTriggersOutput) GoString() string { return s.String() } -// SetCommitId sets the CommitId field's value. -func (s *MergeBranchesByThreeWayOutput) SetCommitId(v string) *MergeBranchesByThreeWayOutput { - s.CommitId = &v - return s -} - -// SetTreeId sets the TreeId field's value. -func (s *MergeBranchesByThreeWayOutput) SetTreeId(v string) *MergeBranchesByThreeWayOutput { - s.TreeId = &v +// SetConfigurationId sets the ConfigurationId field's value. +func (s *PutRepositoryTriggersOutput) SetConfigurationId(v string) *PutRepositoryTriggersOutput { + s.ConfigurationId = &v return s } -// Information about merge hunks in a merge or pull request operation. -type MergeHunk struct { - _ struct{} `type:"structure"` - - // Information about the merge hunk in the base of a merge or pull request. - Base *MergeHunkDetail `locationName:"base" type:"structure"` - - // Information about the merge hunk in the destination of a merge or pull request. - Destination *MergeHunkDetail `locationName:"destination" type:"structure"` - - // A Boolean value indicating whether a combination of hunks contains a conflict. - // Conflicts occur when the same file or the same lines in a file were modified - // in both the source and destination of a merge or pull request. Valid values - // include true, false, and null. This will be true when the hunk represents - // a conflict and one or more files contains a line conflict. File mode conflicts - // in a merge will not set this to be true. - IsConflict *bool `locationName:"isConflict" type:"boolean"` +// The specified reference does not exist. You must provide a full commit ID. +type ReferenceDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Information about the merge hunk in the source of a merge or pull request. - Source *MergeHunkDetail `locationName:"source" type:"structure"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s MergeHunk) String() string { +func (s ReferenceDoesNotExistException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MergeHunk) GoString() string { +func (s ReferenceDoesNotExistException) GoString() string { return s.String() } -// SetBase sets the Base field's value. -func (s *MergeHunk) SetBase(v *MergeHunkDetail) *MergeHunk { - s.Base = v - return s +func newErrorReferenceDoesNotExistException(v protocol.ResponseMetadata) error { + return &ReferenceDoesNotExistException{ + respMetadata: v, + } } -// SetDestination sets the Destination field's value. -func (s *MergeHunk) SetDestination(v *MergeHunkDetail) *MergeHunk { - s.Destination = v - return s +// Code returns the exception type name. +func (s ReferenceDoesNotExistException) Code() string { + return "ReferenceDoesNotExistException" } -// SetIsConflict sets the IsConflict field's value. -func (s *MergeHunk) SetIsConflict(v bool) *MergeHunk { - s.IsConflict = &v - return s +// Message returns the exception's message. +func (s ReferenceDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetSource sets the Source field's value. -func (s *MergeHunk) SetSource(v *MergeHunkDetail) *MergeHunk { - s.Source = v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ReferenceDoesNotExistException) OrigErr() error { + return nil } -// Information about the details of a merge hunk that contains a conflict in -// a merge or pull request operation. -type MergeHunkDetail struct { - _ struct{} `type:"structure"` +func (s ReferenceDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The end position of the hunk in the merge result. - EndLine *int64 `locationName:"endLine" type:"integer"` +// Status code returns the HTTP status code for the request's response error. +func (s ReferenceDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The base-64 encoded content of the hunk merged region that might or might - // not contain a conflict. - HunkContent *string `locationName:"hunkContent" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s ReferenceDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} - // The start position of the hunk in the merge result. - StartLine *int64 `locationName:"startLine" type:"integer"` +// A reference name is required, but none was provided. +type ReferenceNameRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s MergeHunkDetail) String() string { +func (s ReferenceNameRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MergeHunkDetail) GoString() string { +func (s ReferenceNameRequiredException) GoString() string { return s.String() } -// SetEndLine sets the EndLine field's value. -func (s *MergeHunkDetail) SetEndLine(v int64) *MergeHunkDetail { - s.EndLine = &v - return s +func newErrorReferenceNameRequiredException(v protocol.ResponseMetadata) error { + return &ReferenceNameRequiredException{ + respMetadata: v, + } } -// SetHunkContent sets the HunkContent field's value. -func (s *MergeHunkDetail) SetHunkContent(v string) *MergeHunkDetail { - s.HunkContent = &v - return s +// Code returns the exception type name. +func (s ReferenceNameRequiredException) Code() string { + return "ReferenceNameRequiredException" } -// SetStartLine sets the StartLine field's value. -func (s *MergeHunkDetail) SetStartLine(v int64) *MergeHunkDetail { - s.StartLine = &v - return s +// Message returns the exception's message. +func (s ReferenceNameRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// Returns information about a merge or potential merge between a source reference -// and a destination reference in a pull request. -type MergeMetadata struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ReferenceNameRequiredException) OrigErr() error { + return nil +} - // A Boolean value indicating whether the merge has been made. - IsMerged *bool `locationName:"isMerged" type:"boolean"` +func (s ReferenceNameRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The commit ID for the merge commit, if any. - MergeCommitId *string `locationName:"mergeCommitId" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s ReferenceNameRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The merge strategy used in the merge. - MergeOption *string `locationName:"mergeOption" type:"string" enum:"MergeOptionTypeEnum"` +// RequestID returns the service's response RequestID for request. +func (s ReferenceNameRequiredException) RequestID() string { + return s.respMetadata.RequestID +} - // The Amazon Resource Name (ARN) of the user who merged the branches. - MergedBy *string `locationName:"mergedBy" type:"string"` +// The specified reference is not a supported type. +type ReferenceTypeNotSupportedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s MergeMetadata) String() string { +func (s ReferenceTypeNotSupportedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MergeMetadata) GoString() string { +func (s ReferenceTypeNotSupportedException) GoString() string { return s.String() } -// SetIsMerged sets the IsMerged field's value. -func (s *MergeMetadata) SetIsMerged(v bool) *MergeMetadata { - s.IsMerged = &v - return s -} - -// SetMergeCommitId sets the MergeCommitId field's value. -func (s *MergeMetadata) SetMergeCommitId(v string) *MergeMetadata { - s.MergeCommitId = &v - return s -} - -// SetMergeOption sets the MergeOption field's value. -func (s *MergeMetadata) SetMergeOption(v string) *MergeMetadata { - s.MergeOption = &v - return s +func newErrorReferenceTypeNotSupportedException(v protocol.ResponseMetadata) error { + return &ReferenceTypeNotSupportedException{ + respMetadata: v, + } } -// SetMergedBy sets the MergedBy field's value. -func (s *MergeMetadata) SetMergedBy(v string) *MergeMetadata { - s.MergedBy = &v - return s +// Code returns the exception type name. +func (s ReferenceTypeNotSupportedException) Code() string { + return "ReferenceTypeNotSupportedException" } -// Information about the file operation conflicts in a merge operation. -type MergeOperations struct { - _ struct{} `type:"structure"` - - // The operation on a file in the destination of a merge or pull request. - Destination *string `locationName:"destination" type:"string" enum:"ChangeTypeEnum"` - - // The operation on a file (add, modify, or delete) of a file in the source - // of a merge or pull request. - Source *string `locationName:"source" type:"string" enum:"ChangeTypeEnum"` +// Message returns the exception's message. +func (s ReferenceTypeNotSupportedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s MergeOperations) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ReferenceTypeNotSupportedException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s MergeOperations) GoString() string { - return s.String() +func (s ReferenceTypeNotSupportedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetDestination sets the Destination field's value. -func (s *MergeOperations) SetDestination(v string) *MergeOperations { - s.Destination = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ReferenceTypeNotSupportedException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetSource sets the Source field's value. -func (s *MergeOperations) SetSource(v string) *MergeOperations { - s.Source = &v - return s +// RequestID returns the service's response RequestID for request. +func (s ReferenceTypeNotSupportedException) RequestID() string { + return s.respMetadata.RequestID } -type MergePullRequestByFastForwardInput struct { +// Information about a replacement content entry in the conflict of a merge +// or pull request operation. +type ReplaceContentEntry struct { _ struct{} `type:"structure"` - // The system-generated ID of the pull request. To get this ID, use ListPullRequests. + // The base-64 encoded content to use when the replacement type is USE_NEW_CONTENT. // - // PullRequestId is a required field - PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` + // Content is automatically base64 encoded/decoded by the SDK. + Content []byte `locationName:"content" type:"blob"` - // The name of the repository where the pull request was created. + // The file mode to apply during conflict resoltion. + FileMode *string `locationName:"fileMode" type:"string" enum:"FileModeTypeEnum"` + + // The path of the conflicting file. // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + // FilePath is a required field + FilePath *string `locationName:"filePath" type:"string" required:"true"` - // The full commit ID of the original or updated commit in the pull request - // source branch. Pass this value if you want an exception thrown if the current - // commit ID of the tip of the source branch does not match this commit ID. - SourceCommitId *string `locationName:"sourceCommitId" type:"string"` + // The replacement type to use when determining how to resolve the conflict. + // + // ReplacementType is a required field + ReplacementType *string `locationName:"replacementType" type:"string" required:"true" enum:"ReplacementTypeEnum"` } // String returns the string representation -func (s MergePullRequestByFastForwardInput) String() string { +func (s ReplaceContentEntry) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MergePullRequestByFastForwardInput) GoString() string { +func (s ReplaceContentEntry) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *MergePullRequestByFastForwardInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MergePullRequestByFastForwardInput"} - if s.PullRequestId == nil { - invalidParams.Add(request.NewErrParamRequired("PullRequestId")) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) +func (s *ReplaceContentEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplaceContentEntry"} + if s.FilePath == nil { + invalidParams.Add(request.NewErrParamRequired("FilePath")) } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) + if s.ReplacementType == nil { + invalidParams.Add(request.NewErrParamRequired("ReplacementType")) } if invalidParams.Len() > 0 { @@ -13651,1411 +28449,1569 @@ func (s *MergePullRequestByFastForwardInput) Validate() error { return nil } -// SetPullRequestId sets the PullRequestId field's value. -func (s *MergePullRequestByFastForwardInput) SetPullRequestId(v string) *MergePullRequestByFastForwardInput { - s.PullRequestId = &v +// SetContent sets the Content field's value. +func (s *ReplaceContentEntry) SetContent(v []byte) *ReplaceContentEntry { + s.Content = v return s } -// SetRepositoryName sets the RepositoryName field's value. -func (s *MergePullRequestByFastForwardInput) SetRepositoryName(v string) *MergePullRequestByFastForwardInput { - s.RepositoryName = &v +// SetFileMode sets the FileMode field's value. +func (s *ReplaceContentEntry) SetFileMode(v string) *ReplaceContentEntry { + s.FileMode = &v return s } -// SetSourceCommitId sets the SourceCommitId field's value. -func (s *MergePullRequestByFastForwardInput) SetSourceCommitId(v string) *MergePullRequestByFastForwardInput { - s.SourceCommitId = &v +// SetFilePath sets the FilePath field's value. +func (s *ReplaceContentEntry) SetFilePath(v string) *ReplaceContentEntry { + s.FilePath = &v return s } -type MergePullRequestByFastForwardOutput struct { - _ struct{} `type:"structure"` +// SetReplacementType sets the ReplacementType field's value. +func (s *ReplaceContentEntry) SetReplacementType(v string) *ReplaceContentEntry { + s.ReplacementType = &v + return s +} - // Information about the specified pull request, including information about - // the merge. - PullRequest *PullRequest `locationName:"pullRequest" type:"structure"` +// USE_NEW_CONTENT was specified, but no replacement content has been provided. +type ReplacementContentRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s MergePullRequestByFastForwardOutput) String() string { +func (s ReplacementContentRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MergePullRequestByFastForwardOutput) GoString() string { +func (s ReplacementContentRequiredException) GoString() string { return s.String() } -// SetPullRequest sets the PullRequest field's value. -func (s *MergePullRequestByFastForwardOutput) SetPullRequest(v *PullRequest) *MergePullRequestByFastForwardOutput { - s.PullRequest = v - return s +func newErrorReplacementContentRequiredException(v protocol.ResponseMetadata) error { + return &ReplacementContentRequiredException{ + respMetadata: v, + } } -type MergePullRequestBySquashInput struct { - _ struct{} `type:"structure"` - - // The name of the author who created the commit. This information will be used - // as both the author and committer for the commit. - AuthorName *string `locationName:"authorName" type:"string"` - - // The commit message to include in the commit information for the merge. - CommitMessage *string `locationName:"commitMessage" type:"string"` - - // The level of conflict detail to use. If unspecified, the default FILE_LEVEL - // is used, which will return a not mergeable result if the same file has differences - // in both branches. If LINE_LEVEL is specified, a conflict will be considered - // not mergeable if the same file in both branches has differences on the same - // line. - ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` - - // A list of inputs to use when resolving conflicts during a merge if AUTOMERGE - // is chosen as the conflict resolution strategy. - ConflictResolution *ConflictResolution `locationName:"conflictResolution" type:"structure"` +// Code returns the exception type name. +func (s ReplacementContentRequiredException) Code() string { + return "ReplacementContentRequiredException" +} - // Specifies which branch to use when resolving conflicts, or whether to attempt - // automatically merging two versions of a file. The default is NONE, which - // requires any conflicts to be resolved manually before the merge operation - // will be successful. - ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` +// Message returns the exception's message. +func (s ReplacementContentRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The email address of the person merging the branches. This information will - // be used in the commit information for the merge. - Email *string `locationName:"email" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ReplacementContentRequiredException) OrigErr() error { + return nil +} - // If the commit contains deletions, whether to keep a folder or folder structure - // if the changes leave the folders empty. If this is specified as true, a .gitkeep - // file will be created for empty folders. The default is false. - KeepEmptyFolders *bool `locationName:"keepEmptyFolders" type:"boolean"` +func (s ReplacementContentRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The system-generated ID of the pull request. To get this ID, use ListPullRequests. - // - // PullRequestId is a required field - PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s ReplacementContentRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The name of the repository where the pull request was created. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` +// RequestID returns the service's response RequestID for request. +func (s ReplacementContentRequiredException) RequestID() string { + return s.respMetadata.RequestID +} - // The full commit ID of the original or updated commit in the pull request - // source branch. Pass this value if you want an exception thrown if the current - // commit ID of the tip of the source branch does not match this commit ID. - SourceCommitId *string `locationName:"sourceCommitId" type:"string"` +// A replacement type is required. +type ReplacementTypeRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s MergePullRequestBySquashInput) String() string { +func (s ReplacementTypeRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MergePullRequestBySquashInput) GoString() string { +func (s ReplacementTypeRequiredException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *MergePullRequestBySquashInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MergePullRequestBySquashInput"} - if s.PullRequestId == nil { - invalidParams.Add(request.NewErrParamRequired("PullRequestId")) - } - 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.ConflictResolution != nil { - if err := s.ConflictResolution.Validate(); err != nil { - invalidParams.AddNested("ConflictResolution", err.(request.ErrInvalidParams)) - } +func newErrorReplacementTypeRequiredException(v protocol.ResponseMetadata) error { + return &ReplacementTypeRequiredException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s ReplacementTypeRequiredException) Code() string { + return "ReplacementTypeRequiredException" +} + +// Message returns the exception's message. +func (s ReplacementTypeRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ReplacementTypeRequiredException) OrigErr() error { return nil } -// SetAuthorName sets the AuthorName field's value. -func (s *MergePullRequestBySquashInput) SetAuthorName(v string) *MergePullRequestBySquashInput { - s.AuthorName = &v - return s +func (s ReplacementTypeRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetCommitMessage sets the CommitMessage field's value. -func (s *MergePullRequestBySquashInput) SetCommitMessage(v string) *MergePullRequestBySquashInput { - s.CommitMessage = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ReplacementTypeRequiredException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetConflictDetailLevel sets the ConflictDetailLevel field's value. -func (s *MergePullRequestBySquashInput) SetConflictDetailLevel(v string) *MergePullRequestBySquashInput { - s.ConflictDetailLevel = &v - return s +// RequestID returns the service's response RequestID for request. +func (s ReplacementTypeRequiredException) RequestID() string { + return s.respMetadata.RequestID } -// SetConflictResolution sets the ConflictResolution field's value. -func (s *MergePullRequestBySquashInput) SetConflictResolution(v *ConflictResolution) *MergePullRequestBySquashInput { - s.ConflictResolution = v - return s +// The specified repository does not exist. +type RepositoryDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. -func (s *MergePullRequestBySquashInput) SetConflictResolutionStrategy(v string) *MergePullRequestBySquashInput { - s.ConflictResolutionStrategy = &v - return s +// String returns the string representation +func (s RepositoryDoesNotExistException) String() string { + return awsutil.Prettify(s) } -// SetEmail sets the Email field's value. -func (s *MergePullRequestBySquashInput) SetEmail(v string) *MergePullRequestBySquashInput { - s.Email = &v - return s +// GoString returns the string representation +func (s RepositoryDoesNotExistException) GoString() string { + return s.String() } -// SetKeepEmptyFolders sets the KeepEmptyFolders field's value. -func (s *MergePullRequestBySquashInput) SetKeepEmptyFolders(v bool) *MergePullRequestBySquashInput { - s.KeepEmptyFolders = &v - return s +func newErrorRepositoryDoesNotExistException(v protocol.ResponseMetadata) error { + return &RepositoryDoesNotExistException{ + respMetadata: v, + } } -// SetPullRequestId sets the PullRequestId field's value. -func (s *MergePullRequestBySquashInput) SetPullRequestId(v string) *MergePullRequestBySquashInput { - s.PullRequestId = &v - return s +// Code returns the exception type name. +func (s RepositoryDoesNotExistException) Code() string { + return "RepositoryDoesNotExistException" } -// SetRepositoryName sets the RepositoryName field's value. -func (s *MergePullRequestBySquashInput) SetRepositoryName(v string) *MergePullRequestBySquashInput { - s.RepositoryName = &v - return s +// Message returns the exception's message. +func (s RepositoryDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetSourceCommitId sets the SourceCommitId field's value. -func (s *MergePullRequestBySquashInput) SetSourceCommitId(v string) *MergePullRequestBySquashInput { - s.SourceCommitId = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RepositoryDoesNotExistException) OrigErr() error { + return nil } -type MergePullRequestBySquashOutput struct { - _ struct{} `type:"structure"` +func (s RepositoryDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // Returns information about a pull request. - PullRequest *PullRequest `locationName:"pullRequest" type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s RepositoryDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RepositoryDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// A repository resource limit was exceeded. +type RepositoryLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s MergePullRequestBySquashOutput) String() string { +func (s RepositoryLimitExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MergePullRequestBySquashOutput) GoString() string { +func (s RepositoryLimitExceededException) GoString() string { return s.String() } -// SetPullRequest sets the PullRequest field's value. -func (s *MergePullRequestBySquashOutput) SetPullRequest(v *PullRequest) *MergePullRequestBySquashOutput { - s.PullRequest = v - return s +func newErrorRepositoryLimitExceededException(v protocol.ResponseMetadata) error { + return &RepositoryLimitExceededException{ + respMetadata: v, + } } -type MergePullRequestByThreeWayInput struct { +// Code returns the exception type name. +func (s RepositoryLimitExceededException) Code() string { + return "RepositoryLimitExceededException" +} + +// Message returns the exception's message. +func (s RepositoryLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RepositoryLimitExceededException) OrigErr() error { + return nil +} + +func (s RepositoryLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RepositoryLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RepositoryLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about a repository. +type RepositoryMetadata struct { _ struct{} `type:"structure"` - // The name of the author who created the commit. This information will be used - // as both the author and committer for the commit. - AuthorName *string `locationName:"authorName" type:"string"` + // The ID of the AWS account associated with the repository. + AccountId *string `locationName:"accountId" type:"string"` - // The commit message to include in the commit information for the merge. - CommitMessage *string `locationName:"commitMessage" type:"string"` + // The Amazon Resource Name (ARN) of the repository. + Arn *string `type:"string"` - // The level of conflict detail to use. If unspecified, the default FILE_LEVEL - // is used, which will return a not mergeable result if the same file has differences - // in both branches. If LINE_LEVEL is specified, a conflict will be considered - // not mergeable if the same file in both branches has differences on the same - // line. - ConflictDetailLevel *string `locationName:"conflictDetailLevel" type:"string" enum:"ConflictDetailLevelTypeEnum"` + // The URL to use for cloning the repository over HTTPS. + CloneUrlHttp *string `locationName:"cloneUrlHttp" type:"string"` - // A list of inputs to use when resolving conflicts during a merge if AUTOMERGE - // is chosen as the conflict resolution strategy. - ConflictResolution *ConflictResolution `locationName:"conflictResolution" type:"structure"` + // The URL to use for cloning the repository over SSH. + CloneUrlSsh *string `locationName:"cloneUrlSsh" type:"string"` - // Specifies which branch to use when resolving conflicts, or whether to attempt - // automatically merging two versions of a file. The default is NONE, which - // requires any conflicts to be resolved manually before the merge operation - // will be successful. - ConflictResolutionStrategy *string `locationName:"conflictResolutionStrategy" type:"string" enum:"ConflictResolutionStrategyTypeEnum"` + // The date and time the repository was created, in timestamp format. + CreationDate *time.Time `locationName:"creationDate" type:"timestamp"` - // The email address of the person merging the branches. This information will - // be used in the commit information for the merge. - Email *string `locationName:"email" type:"string"` + // The repository's default branch name. + DefaultBranch *string `locationName:"defaultBranch" min:"1" type:"string"` - // If the commit contains deletions, whether to keep a folder or folder structure - // if the changes leave the folders empty. If this is specified as true, a .gitkeep - // file will be created for empty folders. The default is false. - KeepEmptyFolders *bool `locationName:"keepEmptyFolders" type:"boolean"` + // The date and time the repository was last modified, in timestamp format. + LastModifiedDate *time.Time `locationName:"lastModifiedDate" type:"timestamp"` - // The system-generated ID of the pull request. To get this ID, use ListPullRequests. - // - // PullRequestId is a required field - PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` + // A comment or description about the repository. + RepositoryDescription *string `locationName:"repositoryDescription" type:"string"` - // The name of the repository where the pull request was created. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + // The ID of the repository. + RepositoryId *string `locationName:"repositoryId" type:"string"` - // The full commit ID of the original or updated commit in the pull request - // source branch. Pass this value if you want an exception thrown if the current - // commit ID of the tip of the source branch does not match this commit ID. - SourceCommitId *string `locationName:"sourceCommitId" type:"string"` + // The repository's name. + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` } // String returns the string representation -func (s MergePullRequestByThreeWayInput) String() string { +func (s RepositoryMetadata) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MergePullRequestByThreeWayInput) GoString() string { +func (s RepositoryMetadata) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *MergePullRequestByThreeWayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MergePullRequestByThreeWayInput"} - if s.PullRequestId == nil { - invalidParams.Add(request.NewErrParamRequired("PullRequestId")) - } - 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.ConflictResolution != nil { - if err := s.ConflictResolution.Validate(); err != nil { - invalidParams.AddNested("ConflictResolution", err.(request.ErrInvalidParams)) - } +// 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 +} + +// The specified repository name already exists. +type RepositoryNameExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RepositoryNameExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RepositoryNameExistsException) GoString() string { + return s.String() +} + +func newErrorRepositoryNameExistsException(v protocol.ResponseMetadata) error { + return &RepositoryNameExistsException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s RepositoryNameExistsException) Code() string { + return "RepositoryNameExistsException" +} + +// Message returns the exception's message. +func (s RepositoryNameExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetAuthorName sets the AuthorName field's value. -func (s *MergePullRequestByThreeWayInput) SetAuthorName(v string) *MergePullRequestByThreeWayInput { - s.AuthorName = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RepositoryNameExistsException) OrigErr() error { + return nil } -// SetCommitMessage sets the CommitMessage field's value. -func (s *MergePullRequestByThreeWayInput) SetCommitMessage(v string) *MergePullRequestByThreeWayInput { - s.CommitMessage = &v - return s +func (s RepositoryNameExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetConflictDetailLevel sets the ConflictDetailLevel field's value. -func (s *MergePullRequestByThreeWayInput) SetConflictDetailLevel(v string) *MergePullRequestByThreeWayInput { - s.ConflictDetailLevel = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s RepositoryNameExistsException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetConflictResolution sets the ConflictResolution field's value. -func (s *MergePullRequestByThreeWayInput) SetConflictResolution(v *ConflictResolution) *MergePullRequestByThreeWayInput { - s.ConflictResolution = v - return s +// RequestID returns the service's response RequestID for request. +func (s RepositoryNameExistsException) RequestID() string { + return s.respMetadata.RequestID } -// SetConflictResolutionStrategy sets the ConflictResolutionStrategy field's value. -func (s *MergePullRequestByThreeWayInput) SetConflictResolutionStrategy(v string) *MergePullRequestByThreeWayInput { - s.ConflictResolutionStrategy = &v - return s +// Information about a repository name and ID. +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"` } -// SetEmail sets the Email field's value. -func (s *MergePullRequestByThreeWayInput) SetEmail(v string) *MergePullRequestByThreeWayInput { - s.Email = &v - return s +// String returns the string representation +func (s RepositoryNameIdPair) String() string { + return awsutil.Prettify(s) } -// SetKeepEmptyFolders sets the KeepEmptyFolders field's value. -func (s *MergePullRequestByThreeWayInput) SetKeepEmptyFolders(v bool) *MergePullRequestByThreeWayInput { - s.KeepEmptyFolders = &v - return s +// GoString returns the string representation +func (s RepositoryNameIdPair) GoString() string { + return s.String() } -// SetPullRequestId sets the PullRequestId field's value. -func (s *MergePullRequestByThreeWayInput) SetPullRequestId(v string) *MergePullRequestByThreeWayInput { - s.PullRequestId = &v +// 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 *MergePullRequestByThreeWayInput) SetRepositoryName(v string) *MergePullRequestByThreeWayInput { +func (s *RepositoryNameIdPair) SetRepositoryName(v string) *RepositoryNameIdPair { s.RepositoryName = &v return s } -// SetSourceCommitId sets the SourceCommitId field's value. -func (s *MergePullRequestByThreeWayInput) SetSourceCommitId(v string) *MergePullRequestByThreeWayInput { - s.SourceCommitId = &v - return s -} - -type MergePullRequestByThreeWayOutput struct { - _ struct{} `type:"structure"` +// A repository name is required, but was not specified. +type RepositoryNameRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Returns information about a pull request. - PullRequest *PullRequest `locationName:"pullRequest" type:"structure"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s MergePullRequestByThreeWayOutput) String() string { +func (s RepositoryNameRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MergePullRequestByThreeWayOutput) GoString() string { +func (s RepositoryNameRequiredException) GoString() string { return s.String() } -// SetPullRequest sets the PullRequest field's value. -func (s *MergePullRequestByThreeWayOutput) SetPullRequest(v *PullRequest) *MergePullRequestByThreeWayOutput { - s.PullRequest = v - return s +func newErrorRepositoryNameRequiredException(v protocol.ResponseMetadata) error { + return &RepositoryNameRequiredException{ + respMetadata: v, + } } -// Information about the type of an object in a merge operation. -type ObjectTypes struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s RepositoryNameRequiredException) Code() string { + return "RepositoryNameRequiredException" +} - // The type of the object in the base commit of the merge. - Base *string `locationName:"base" type:"string" enum:"ObjectTypeEnum"` +// Message returns the exception's message. +func (s RepositoryNameRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The type of the object in the destination branch. - Destination *string `locationName:"destination" type:"string" enum:"ObjectTypeEnum"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RepositoryNameRequiredException) OrigErr() error { + return nil +} - // The type of the object in the source branch. - Source *string `locationName:"source" type:"string" enum:"ObjectTypeEnum"` +func (s RepositoryNameRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RepositoryNameRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RepositoryNameRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// At least one repository name object is required, but was not specified. +type RepositoryNamesRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ObjectTypes) String() string { +func (s RepositoryNamesRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ObjectTypes) GoString() string { +func (s RepositoryNamesRequiredException) GoString() string { return s.String() } -// SetBase sets the Base field's value. -func (s *ObjectTypes) SetBase(v string) *ObjectTypes { - s.Base = &v - return s +func newErrorRepositoryNamesRequiredException(v protocol.ResponseMetadata) error { + return &RepositoryNamesRequiredException{ + respMetadata: v, + } } -// SetDestination sets the Destination field's value. -func (s *ObjectTypes) SetDestination(v string) *ObjectTypes { - s.Destination = &v - return s +// Code returns the exception type name. +func (s RepositoryNamesRequiredException) Code() string { + return "RepositoryNamesRequiredException" } -// SetSource sets the Source field's value. -func (s *ObjectTypes) SetSource(v string) *ObjectTypes { - s.Source = &v - return s +// Message returns the exception's message. +func (s RepositoryNamesRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type PostCommentForComparedCommitInput struct { - _ struct{} `type:"structure"` - - // To establish the directionality of the comparison, the full commit ID of - // the 'after' commit. - // - // AfterCommitId is a required field - AfterCommitId *string `locationName:"afterCommitId" type:"string" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RepositoryNamesRequiredException) OrigErr() error { + return nil +} - // To establish the directionality of the comparison, the full commit ID of - // the 'before' commit. - // - // This is required for commenting on any commit unless that commit is the initial - // commit. - BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` +func (s RepositoryNamesRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // A unique, client-generated idempotency token that when provided in a request, - // ensures the request cannot be repeated with a changed parameter. If a request - // is received with the same parameters and a token is included, the request - // will return information about the initial request that used that token. - ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s RepositoryNamesRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The content of the comment you want to make. - // - // Content is a required field - Content *string `locationName:"content" type:"string" required:"true"` +// RequestID returns the service's response RequestID for request. +func (s RepositoryNamesRequiredException) RequestID() string { + return s.respMetadata.RequestID +} - // The location of the comparison where you want to comment. - Location *Location `locationName:"location" type:"structure"` +// The repository does not contain any pull requests with that pull request +// ID. Use GetPullRequest to verify the correct repository name for the pull +// request ID. +type RepositoryNotAssociatedWithPullRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The name of the repository where you want to post a comment on the comparison - // between commits. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s PostCommentForComparedCommitInput) String() string { +func (s RepositoryNotAssociatedWithPullRequestException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PostCommentForComparedCommitInput) GoString() string { +func (s RepositoryNotAssociatedWithPullRequestException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *PostCommentForComparedCommitInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PostCommentForComparedCommitInput"} - if s.AfterCommitId == nil { - invalidParams.Add(request.NewErrParamRequired("AfterCommitId")) - } - if s.Content == nil { - invalidParams.Add(request.NewErrParamRequired("Content")) - } - 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 +func newErrorRepositoryNotAssociatedWithPullRequestException(v protocol.ResponseMetadata) error { + return &RepositoryNotAssociatedWithPullRequestException{ + respMetadata: v, } - return nil } -// SetAfterCommitId sets the AfterCommitId field's value. -func (s *PostCommentForComparedCommitInput) SetAfterCommitId(v string) *PostCommentForComparedCommitInput { - s.AfterCommitId = &v - return s +// Code returns the exception type name. +func (s RepositoryNotAssociatedWithPullRequestException) Code() string { + return "RepositoryNotAssociatedWithPullRequestException" } -// SetBeforeCommitId sets the BeforeCommitId field's value. -func (s *PostCommentForComparedCommitInput) SetBeforeCommitId(v string) *PostCommentForComparedCommitInput { - s.BeforeCommitId = &v - return s +// Message returns the exception's message. +func (s RepositoryNotAssociatedWithPullRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *PostCommentForComparedCommitInput) SetClientRequestToken(v string) *PostCommentForComparedCommitInput { - s.ClientRequestToken = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RepositoryNotAssociatedWithPullRequestException) OrigErr() error { + return nil } -// SetContent sets the Content field's value. -func (s *PostCommentForComparedCommitInput) SetContent(v string) *PostCommentForComparedCommitInput { - s.Content = &v - return s +func (s RepositoryNotAssociatedWithPullRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetLocation sets the Location field's value. -func (s *PostCommentForComparedCommitInput) SetLocation(v *Location) *PostCommentForComparedCommitInput { - s.Location = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s RepositoryNotAssociatedWithPullRequestException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetRepositoryName sets the RepositoryName field's value. -func (s *PostCommentForComparedCommitInput) SetRepositoryName(v string) *PostCommentForComparedCommitInput { - s.RepositoryName = &v - return s +// RequestID returns the service's response RequestID for request. +func (s RepositoryNotAssociatedWithPullRequestException) RequestID() string { + return s.respMetadata.RequestID } -type PostCommentForComparedCommitOutput struct { +// Information about a trigger for a repository. +type RepositoryTrigger struct { _ struct{} `type:"structure"` - // In the directionality you established, the blob ID of the 'after' blob. - AfterBlobId *string `locationName:"afterBlobId" type:"string"` + // The branches to be included in the trigger configuration. If you specify + // an empty array, the trigger applies to all branches. + // + // Although no content is required in the array, you must include the array + // itself. + Branches []*string `locationName:"branches" type:"list"` - // In the directionality you established, the full commit ID of the 'after' - // commit. - AfterCommitId *string `locationName:"afterCommitId" type:"string"` + // Any custom data associated with the trigger to be included in the information + // sent to the target of the trigger. + CustomData *string `locationName:"customData" type:"string"` - // In the directionality you established, the blob ID of the 'before' blob. - BeforeBlobId *string `locationName:"beforeBlobId" type:"string"` + // The ARN of the resource that is the target for a trigger (for example, the + // ARN of a topic in Amazon SNS). + // + // DestinationArn is a required field + DestinationArn *string `locationName:"destinationArn" type:"string" required:"true"` - // In the directionality you established, the full commit ID of the 'before' - // commit. - BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` + // The repository events that cause the trigger to run actions in another service, + // such as sending a notification through Amazon 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 content of the comment you posted. - Comment *Comment `locationName:"comment" type:"structure"` + // The name of the trigger. + // + // Name is a required field + Name *string `locationName:"name" type:"string" required:"true"` +} - // The location of the comment in the comparison between the two commits. - Location *Location `locationName:"location" type:"structure"` +// String returns the string representation +func (s RepositoryTrigger) String() string { + return awsutil.Prettify(s) +} - // The name of the repository where you posted a comment on the comparison between - // commits. - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` +// 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 } -// String returns the string representation -func (s PostCommentForComparedCommitOutput) String() string { - return awsutil.Prettify(s) +// SetBranches sets the Branches field's value. +func (s *RepositoryTrigger) SetBranches(v []*string) *RepositoryTrigger { + s.Branches = v + return s } -// GoString returns the string representation -func (s PostCommentForComparedCommitOutput) GoString() string { - return s.String() +// SetCustomData sets the CustomData field's value. +func (s *RepositoryTrigger) SetCustomData(v string) *RepositoryTrigger { + s.CustomData = &v + return s } -// SetAfterBlobId sets the AfterBlobId field's value. -func (s *PostCommentForComparedCommitOutput) SetAfterBlobId(v string) *PostCommentForComparedCommitOutput { - s.AfterBlobId = &v +// SetDestinationArn sets the DestinationArn field's value. +func (s *RepositoryTrigger) SetDestinationArn(v string) *RepositoryTrigger { + s.DestinationArn = &v return s } -// SetAfterCommitId sets the AfterCommitId field's value. -func (s *PostCommentForComparedCommitOutput) SetAfterCommitId(v string) *PostCommentForComparedCommitOutput { - s.AfterCommitId = &v +// SetEvents sets the Events field's value. +func (s *RepositoryTrigger) SetEvents(v []*string) *RepositoryTrigger { + s.Events = v return s } -// SetBeforeBlobId sets the BeforeBlobId field's value. -func (s *PostCommentForComparedCommitOutput) SetBeforeBlobId(v string) *PostCommentForComparedCommitOutput { - s.BeforeBlobId = &v +// SetName sets the Name field's value. +func (s *RepositoryTrigger) SetName(v string) *RepositoryTrigger { + s.Name = &v return s } -// SetBeforeCommitId sets the BeforeCommitId field's value. -func (s *PostCommentForComparedCommitOutput) SetBeforeCommitId(v string) *PostCommentForComparedCommitOutput { - s.BeforeCommitId = &v - return s +// At least one branch name is required, but was not specified in the trigger +// configuration. +type RepositoryTriggerBranchNameListRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetComment sets the Comment field's value. -func (s *PostCommentForComparedCommitOutput) SetComment(v *Comment) *PostCommentForComparedCommitOutput { - s.Comment = v - return s +// String returns the string representation +func (s RepositoryTriggerBranchNameListRequiredException) String() string { + return awsutil.Prettify(s) } -// SetLocation sets the Location field's value. -func (s *PostCommentForComparedCommitOutput) SetLocation(v *Location) *PostCommentForComparedCommitOutput { - s.Location = v - return s +// GoString returns the string representation +func (s RepositoryTriggerBranchNameListRequiredException) GoString() string { + return s.String() } -// SetRepositoryName sets the RepositoryName field's value. -func (s *PostCommentForComparedCommitOutput) SetRepositoryName(v string) *PostCommentForComparedCommitOutput { - s.RepositoryName = &v - return s +func newErrorRepositoryTriggerBranchNameListRequiredException(v protocol.ResponseMetadata) error { + return &RepositoryTriggerBranchNameListRequiredException{ + respMetadata: v, + } } -type PostCommentForPullRequestInput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s RepositoryTriggerBranchNameListRequiredException) Code() string { + return "RepositoryTriggerBranchNameListRequiredException" +} - // The full commit ID of the commit in the source branch that is the current - // tip of the branch for the pull request when you post the comment. - // - // AfterCommitId is a required field - AfterCommitId *string `locationName:"afterCommitId" type:"string" required:"true"` +// Message returns the exception's message. +func (s RepositoryTriggerBranchNameListRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The full commit ID of the commit in the destination branch that was the tip - // of the branch at the time the pull request was created. - // - // BeforeCommitId is a required field - BeforeCommitId *string `locationName:"beforeCommitId" type:"string" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RepositoryTriggerBranchNameListRequiredException) OrigErr() error { + return nil +} - // A unique, client-generated idempotency token that when provided in a request, - // ensures the request cannot be repeated with a changed parameter. If a request - // is received with the same parameters and a token is included, the request - // will return information about the initial request that used that token. - ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` +func (s RepositoryTriggerBranchNameListRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The content of your comment on the change. - // - // Content is a required field - Content *string `locationName:"content" type:"string" required:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s RepositoryTriggerBranchNameListRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The location of the change where you want to post your comment. If no location - // is provided, the comment will be posted as a general comment on the pull - // request difference between the before commit ID and the after commit ID. - Location *Location `locationName:"location" type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s RepositoryTriggerBranchNameListRequiredException) RequestID() string { + return s.respMetadata.RequestID +} - // The system-generated ID of the pull request. To get this ID, use ListPullRequests. - // - // PullRequestId is a required field - PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` +// A destination ARN for the target service for the trigger is required, but +// was not specified. +type RepositoryTriggerDestinationArnRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The name of the repository where you want to post a comment on a pull request. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s PostCommentForPullRequestInput) String() string { +func (s RepositoryTriggerDestinationArnRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PostCommentForPullRequestInput) GoString() string { +func (s RepositoryTriggerDestinationArnRequiredException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *PostCommentForPullRequestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PostCommentForPullRequestInput"} - if s.AfterCommitId == nil { - invalidParams.Add(request.NewErrParamRequired("AfterCommitId")) - } - if s.BeforeCommitId == nil { - invalidParams.Add(request.NewErrParamRequired("BeforeCommitId")) - } - if s.Content == nil { - invalidParams.Add(request.NewErrParamRequired("Content")) - } - if s.PullRequestId == nil { - invalidParams.Add(request.NewErrParamRequired("PullRequestId")) - } - if s.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) - } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) +func newErrorRepositoryTriggerDestinationArnRequiredException(v protocol.ResponseMetadata) error { + return &RepositoryTriggerDestinationArnRequiredException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s RepositoryTriggerDestinationArnRequiredException) Code() string { + return "RepositoryTriggerDestinationArnRequiredException" +} + +// Message returns the exception's message. +func (s RepositoryTriggerDestinationArnRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RepositoryTriggerDestinationArnRequiredException) OrigErr() error { return nil } -// SetAfterCommitId sets the AfterCommitId field's value. -func (s *PostCommentForPullRequestInput) SetAfterCommitId(v string) *PostCommentForPullRequestInput { - s.AfterCommitId = &v - return s +func (s RepositoryTriggerDestinationArnRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetBeforeCommitId sets the BeforeCommitId field's value. -func (s *PostCommentForPullRequestInput) SetBeforeCommitId(v string) *PostCommentForPullRequestInput { - s.BeforeCommitId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s RepositoryTriggerDestinationArnRequiredException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *PostCommentForPullRequestInput) SetClientRequestToken(v string) *PostCommentForPullRequestInput { - s.ClientRequestToken = &v - return s +// RequestID returns the service's response RequestID for request. +func (s RepositoryTriggerDestinationArnRequiredException) RequestID() string { + return s.respMetadata.RequestID } -// SetContent sets the Content field's value. -func (s *PostCommentForPullRequestInput) SetContent(v string) *PostCommentForPullRequestInput { - s.Content = &v - return s +// At least one event for the trigger is required, but was not specified. +type RepositoryTriggerEventsListRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetLocation sets the Location field's value. -func (s *PostCommentForPullRequestInput) SetLocation(v *Location) *PostCommentForPullRequestInput { - s.Location = v - return s +// String returns the string representation +func (s RepositoryTriggerEventsListRequiredException) String() string { + return awsutil.Prettify(s) } -// SetPullRequestId sets the PullRequestId field's value. -func (s *PostCommentForPullRequestInput) SetPullRequestId(v string) *PostCommentForPullRequestInput { - s.PullRequestId = &v - return s +// GoString returns the string representation +func (s RepositoryTriggerEventsListRequiredException) GoString() string { + return s.String() } -// SetRepositoryName sets the RepositoryName field's value. -func (s *PostCommentForPullRequestInput) SetRepositoryName(v string) *PostCommentForPullRequestInput { - s.RepositoryName = &v - return s +func newErrorRepositoryTriggerEventsListRequiredException(v protocol.ResponseMetadata) error { + return &RepositoryTriggerEventsListRequiredException{ + respMetadata: v, + } } -type PostCommentForPullRequestOutput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s RepositoryTriggerEventsListRequiredException) Code() string { + return "RepositoryTriggerEventsListRequiredException" +} - // In the directionality of the pull request, the blob ID of the 'after' blob. - AfterBlobId *string `locationName:"afterBlobId" type:"string"` +// Message returns the exception's message. +func (s RepositoryTriggerEventsListRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The full commit ID of the commit in the destination branch where the pull - // request will be merged. - AfterCommitId *string `locationName:"afterCommitId" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RepositoryTriggerEventsListRequiredException) OrigErr() error { + return nil +} - // In the directionality of the pull request, the blob ID of the 'before' blob. - BeforeBlobId *string `locationName:"beforeBlobId" type:"string"` +func (s RepositoryTriggerEventsListRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The full commit ID of the commit in the source branch used to create the - // pull request, or in the case of an updated pull request, the full commit - // ID of the commit used to update the pull request. - BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s RepositoryTriggerEventsListRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The content of the comment you posted. - Comment *Comment `locationName:"comment" type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s RepositoryTriggerEventsListRequiredException) RequestID() string { + return s.respMetadata.RequestID +} - // The location of the change where you posted your comment. - Location *Location `locationName:"location" type:"structure"` +// A trigger failed to run. +type RepositoryTriggerExecutionFailure struct { + _ struct{} `type:"structure"` - // The system-generated ID of the pull request. - PullRequestId *string `locationName:"pullRequestId" type:"string"` + // Message information about the trigger that did not run. + FailureMessage *string `locationName:"failureMessage" type:"string"` - // The name of the repository where you posted a comment on a pull request. - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` + // The name of the trigger that did not run. + Trigger *string `locationName:"trigger" type:"string"` } // String returns the string representation -func (s PostCommentForPullRequestOutput) String() string { +func (s RepositoryTriggerExecutionFailure) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PostCommentForPullRequestOutput) GoString() string { +func (s RepositoryTriggerExecutionFailure) GoString() string { return s.String() } -// SetAfterBlobId sets the AfterBlobId field's value. -func (s *PostCommentForPullRequestOutput) SetAfterBlobId(v string) *PostCommentForPullRequestOutput { - s.AfterBlobId = &v +// SetFailureMessage sets the FailureMessage field's value. +func (s *RepositoryTriggerExecutionFailure) SetFailureMessage(v string) *RepositoryTriggerExecutionFailure { + s.FailureMessage = &v return s } -// SetAfterCommitId sets the AfterCommitId field's value. -func (s *PostCommentForPullRequestOutput) SetAfterCommitId(v string) *PostCommentForPullRequestOutput { - s.AfterCommitId = &v +// SetTrigger sets the Trigger field's value. +func (s *RepositoryTriggerExecutionFailure) SetTrigger(v string) *RepositoryTriggerExecutionFailure { + s.Trigger = &v return s } -// SetBeforeBlobId sets the BeforeBlobId field's value. -func (s *PostCommentForPullRequestOutput) SetBeforeBlobId(v string) *PostCommentForPullRequestOutput { - s.BeforeBlobId = &v - return s +// A name for the trigger is required, but was not specified. +type RepositoryTriggerNameRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetBeforeCommitId sets the BeforeCommitId field's value. -func (s *PostCommentForPullRequestOutput) SetBeforeCommitId(v string) *PostCommentForPullRequestOutput { - s.BeforeCommitId = &v - return s +// String returns the string representation +func (s RepositoryTriggerNameRequiredException) String() string { + return awsutil.Prettify(s) } -// SetComment sets the Comment field's value. -func (s *PostCommentForPullRequestOutput) SetComment(v *Comment) *PostCommentForPullRequestOutput { - s.Comment = v - return s +// GoString returns the string representation +func (s RepositoryTriggerNameRequiredException) GoString() string { + return s.String() } -// SetLocation sets the Location field's value. -func (s *PostCommentForPullRequestOutput) SetLocation(v *Location) *PostCommentForPullRequestOutput { - s.Location = v - return s +func newErrorRepositoryTriggerNameRequiredException(v protocol.ResponseMetadata) error { + return &RepositoryTriggerNameRequiredException{ + respMetadata: v, + } } -// SetPullRequestId sets the PullRequestId field's value. -func (s *PostCommentForPullRequestOutput) SetPullRequestId(v string) *PostCommentForPullRequestOutput { - s.PullRequestId = &v - return s +// Code returns the exception type name. +func (s RepositoryTriggerNameRequiredException) Code() string { + return "RepositoryTriggerNameRequiredException" } -// SetRepositoryName sets the RepositoryName field's value. -func (s *PostCommentForPullRequestOutput) SetRepositoryName(v string) *PostCommentForPullRequestOutput { - s.RepositoryName = &v - return s +// Message returns the exception's message. +func (s RepositoryTriggerNameRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type PostCommentReplyInput struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RepositoryTriggerNameRequiredException) OrigErr() error { + return nil +} - // A unique, client-generated idempotency token that when provided in a request, - // ensures the request cannot be repeated with a changed parameter. If a request - // is received with the same parameters and a token is included, the request - // will return information about the initial request that used that token. - ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` +func (s RepositoryTriggerNameRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The contents of your reply to a comment. - // - // Content is a required field - Content *string `locationName:"content" type:"string" required:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s RepositoryTriggerNameRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The system-generated ID of the comment to which you want to reply. To get - // this ID, use GetCommentsForComparedCommit or GetCommentsForPullRequest. - // - // InReplyTo is a required field - InReplyTo *string `locationName:"inReplyTo" type:"string" required:"true"` +// RequestID returns the service's response RequestID for request. +func (s RepositoryTriggerNameRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The list of triggers for the repository is required, but was not specified. +type RepositoryTriggersListRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s PostCommentReplyInput) String() string { +func (s RepositoryTriggersListRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PostCommentReplyInput) GoString() string { +func (s RepositoryTriggersListRequiredException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *PostCommentReplyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PostCommentReplyInput"} - if s.Content == nil { - invalidParams.Add(request.NewErrParamRequired("Content")) - } - if s.InReplyTo == nil { - invalidParams.Add(request.NewErrParamRequired("InReplyTo")) +func newErrorRepositoryTriggersListRequiredException(v protocol.ResponseMetadata) error { + return &RepositoryTriggersListRequiredException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s RepositoryTriggersListRequiredException) Code() string { + return "RepositoryTriggersListRequiredException" +} + +// Message returns the exception's message. +func (s RepositoryTriggersListRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RepositoryTriggersListRequiredException) OrigErr() error { return nil } -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *PostCommentReplyInput) SetClientRequestToken(v string) *PostCommentReplyInput { - s.ClientRequestToken = &v - return s +func (s RepositoryTriggersListRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetContent sets the Content field's value. -func (s *PostCommentReplyInput) SetContent(v string) *PostCommentReplyInput { - s.Content = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s RepositoryTriggersListRequiredException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetInReplyTo sets the InReplyTo field's value. -func (s *PostCommentReplyInput) SetInReplyTo(v string) *PostCommentReplyInput { - s.InReplyTo = &v - return s +// RequestID returns the service's response RequestID for request. +func (s RepositoryTriggersListRequiredException) RequestID() string { + return s.respMetadata.RequestID } -type PostCommentReplyOutput struct { - _ struct{} `type:"structure"` +// A valid Amazon Resource Name (ARN) for an AWS CodeCommit resource is required. +// For a list of valid resources in AWS CodeCommit, see CodeCommit Resources +// and Operations (https://docs.aws.amazon.com/codecommit/latest/userguide/auth-and-access-control-iam-access-control-identity-based.html#arn-formats) +// in the AWS CodeCommit User Guide. +type ResourceArnRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Information about the reply to a comment. - Comment *Comment `locationName:"comment" type:"structure"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s PostCommentReplyOutput) String() string { +func (s ResourceArnRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PostCommentReplyOutput) GoString() string { +func (s ResourceArnRequiredException) GoString() string { return s.String() } -// SetComment sets the Comment field's value. -func (s *PostCommentReplyOutput) SetComment(v *Comment) *PostCommentReplyOutput { - s.Comment = v - return s +func newErrorResourceArnRequiredException(v protocol.ResponseMetadata) error { + return &ResourceArnRequiredException{ + respMetadata: v, + } } -// Returns information about a pull request. -type PullRequest struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the user who created the pull request. - AuthorArn *string `locationName:"authorArn" type:"string"` - - // A unique, client-generated idempotency token that when provided in a request, - // ensures the request cannot be repeated with a changed parameter. If a request - // is received with the same parameters and a token is included, the request - // will return information about the initial request that used that token. - ClientRequestToken *string `locationName:"clientRequestToken" type:"string"` +// Code returns the exception type name. +func (s ResourceArnRequiredException) Code() string { + return "ResourceArnRequiredException" +} - // The date and time the pull request was originally created, in timestamp format. - CreationDate *time.Time `locationName:"creationDate" type:"timestamp"` +// Message returns the exception's message. +func (s ResourceArnRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The user-defined description of the pull request. This description can be - // used to clarify what should be reviewed and other details of the request. - Description *string `locationName:"description" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceArnRequiredException) OrigErr() error { + return nil +} - // The day and time of the last user or system activity on the pull request, - // in timestamp format. - LastActivityDate *time.Time `locationName:"lastActivityDate" type:"timestamp"` +func (s ResourceArnRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The system-generated ID of the pull request. - PullRequestId *string `locationName:"pullRequestId" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s ResourceArnRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The status of the pull request. Pull request status can only change from - // OPEN to CLOSED. - PullRequestStatus *string `locationName:"pullRequestStatus" type:"string" enum:"PullRequestStatusEnum"` +// RequestID returns the service's response RequestID for request. +func (s ResourceArnRequiredException) RequestID() string { + return s.respMetadata.RequestID +} - // The targets of the pull request, including the source branch and destination - // branch for the pull request. - PullRequestTargets []*PullRequestTarget `locationName:"pullRequestTargets" type:"list"` +// The commit cannot be created because one of the changes specifies copying +// or moving a .gitkeep file. +type RestrictedSourceFileException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The user-defined title of the pull request. This title is displayed in the - // list of pull requests to other users of the repository. - Title *string `locationName:"title" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s PullRequest) String() string { +func (s RestrictedSourceFileException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PullRequest) GoString() string { +func (s RestrictedSourceFileException) GoString() string { return s.String() } -// SetAuthorArn sets the AuthorArn field's value. -func (s *PullRequest) SetAuthorArn(v string) *PullRequest { - s.AuthorArn = &v - return s +func newErrorRestrictedSourceFileException(v protocol.ResponseMetadata) error { + return &RestrictedSourceFileException{ + respMetadata: v, + } } -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *PullRequest) SetClientRequestToken(v string) *PullRequest { - s.ClientRequestToken = &v - return s +// Code returns the exception type name. +func (s RestrictedSourceFileException) Code() string { + return "RestrictedSourceFileException" } -// SetCreationDate sets the CreationDate field's value. -func (s *PullRequest) SetCreationDate(v time.Time) *PullRequest { - s.CreationDate = &v - return s +// Message returns the exception's message. +func (s RestrictedSourceFileException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetDescription sets the Description field's value. -func (s *PullRequest) SetDescription(v string) *PullRequest { - s.Description = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RestrictedSourceFileException) OrigErr() error { + return nil } -// SetLastActivityDate sets the LastActivityDate field's value. -func (s *PullRequest) SetLastActivityDate(v time.Time) *PullRequest { - s.LastActivityDate = &v - return s +func (s RestrictedSourceFileException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetPullRequestId sets the PullRequestId field's value. -func (s *PullRequest) SetPullRequestId(v string) *PullRequest { - s.PullRequestId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s RestrictedSourceFileException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetPullRequestStatus sets the PullRequestStatus field's value. -func (s *PullRequest) SetPullRequestStatus(v string) *PullRequest { - s.PullRequestStatus = &v - return s +// RequestID returns the service's response RequestID for request. +func (s RestrictedSourceFileException) RequestID() string { + return s.respMetadata.RequestID } -// SetPullRequestTargets sets the PullRequestTargets field's value. -func (s *PullRequest) SetPullRequestTargets(v []*PullRequestTarget) *PullRequest { - s.PullRequestTargets = v - return s +// A revision ID is required, but was not provided. +type RevisionIdRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetTitle sets the Title field's value. -func (s *PullRequest) SetTitle(v string) *PullRequest { - s.Title = &v - return s +// String returns the string representation +func (s RevisionIdRequiredException) String() string { + return awsutil.Prettify(s) } -// Metadata about the pull request that is used when comparing the pull request -// source with its destination. -type PullRequestCreatedEventMetadata struct { - _ struct{} `type:"structure"` +// GoString returns the string representation +func (s RevisionIdRequiredException) GoString() string { + return s.String() +} - // The commit ID of the tip of the branch specified as the destination branch - // when the pull request was created. - DestinationCommitId *string `locationName:"destinationCommitId" type:"string"` +func newErrorRevisionIdRequiredException(v protocol.ResponseMetadata) error { + return &RevisionIdRequiredException{ + respMetadata: v, + } +} - // The commit ID of the most recent commit that the source branch and the destination - // branch have in common. - MergeBase *string `locationName:"mergeBase" type:"string"` +// Code returns the exception type name. +func (s RevisionIdRequiredException) Code() string { + return "RevisionIdRequiredException" +} - // The name of the repository where the pull request was created. - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` +// Message returns the exception's message. +func (s RevisionIdRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The commit ID on the source branch used when the pull request was created. - SourceCommitId *string `locationName:"sourceCommitId" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RevisionIdRequiredException) OrigErr() error { + return nil } -// String returns the string representation -func (s PullRequestCreatedEventMetadata) String() string { - return awsutil.Prettify(s) +func (s RevisionIdRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// GoString returns the string representation -func (s PullRequestCreatedEventMetadata) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s RevisionIdRequiredException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetDestinationCommitId sets the DestinationCommitId field's value. -func (s *PullRequestCreatedEventMetadata) SetDestinationCommitId(v string) *PullRequestCreatedEventMetadata { - s.DestinationCommitId = &v - return s +// RequestID returns the service's response RequestID for request. +func (s RevisionIdRequiredException) RequestID() string { + return s.respMetadata.RequestID } -// SetMergeBase sets the MergeBase field's value. -func (s *PullRequestCreatedEventMetadata) SetMergeBase(v string) *PullRequestCreatedEventMetadata { - s.MergeBase = &v - return s +// The revision ID provided in the request does not match the current revision +// ID. Use GetPullRequest to retrieve the current revision ID. +type RevisionNotCurrentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetRepositoryName sets the RepositoryName field's value. -func (s *PullRequestCreatedEventMetadata) SetRepositoryName(v string) *PullRequestCreatedEventMetadata { - s.RepositoryName = &v - return s +// String returns the string representation +func (s RevisionNotCurrentException) String() string { + return awsutil.Prettify(s) } -// SetSourceCommitId sets the SourceCommitId field's value. -func (s *PullRequestCreatedEventMetadata) SetSourceCommitId(v string) *PullRequestCreatedEventMetadata { - s.SourceCommitId = &v - return s +// GoString returns the string representation +func (s RevisionNotCurrentException) GoString() string { + return s.String() } -// Returns information about a pull request event. -type PullRequestEvent struct { - _ struct{} `type:"structure"` +func newErrorRevisionNotCurrentException(v protocol.ResponseMetadata) error { + return &RevisionNotCurrentException{ + respMetadata: v, + } +} - // The Amazon Resource Name (ARN) of the user whose actions resulted in the - // event. Examples include updating the pull request with additional commits - // or changing the status of a pull request. - ActorArn *string `locationName:"actorArn" type:"string"` +// Code returns the exception type name. +func (s RevisionNotCurrentException) Code() string { + return "RevisionNotCurrentException" +} - // The day and time of the pull request event, in timestamp format. - EventDate *time.Time `locationName:"eventDate" type:"timestamp"` +// Message returns the exception's message. +func (s RevisionNotCurrentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Information about the source and destination branches for the pull request. - PullRequestCreatedEventMetadata *PullRequestCreatedEventMetadata `locationName:"pullRequestCreatedEventMetadata" type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RevisionNotCurrentException) OrigErr() error { + return nil +} - // The type of the pull request event, for example a status change event (PULL_REQUEST_STATUS_CHANGED) - // or update event (PULL_REQUEST_SOURCE_REFERENCE_UPDATED). - PullRequestEventType *string `locationName:"pullRequestEventType" type:"string" enum:"PullRequestEventType"` +func (s RevisionNotCurrentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The system-generated ID of the pull request. - PullRequestId *string `locationName:"pullRequestId" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s RevisionNotCurrentException) StatusCode() int { + return s.respMetadata.StatusCode +} - // Information about the change in mergability state for the pull request event. - PullRequestMergedStateChangedEventMetadata *PullRequestMergedStateChangedEventMetadata `locationName:"pullRequestMergedStateChangedEventMetadata" type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s RevisionNotCurrentException) RequestID() string { + return s.respMetadata.RequestID +} - // Information about the updated source branch for the pull request event. - PullRequestSourceReferenceUpdatedEventMetadata *PullRequestSourceReferenceUpdatedEventMetadata `locationName:"pullRequestSourceReferenceUpdatedEventMetadata" type:"structure"` +// The file was not added or updated because the content of the file is exactly +// the same as the content of that file in the repository and branch that you +// specified. +type SameFileContentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Information about the change in status for the pull request event. - PullRequestStatusChangedEventMetadata *PullRequestStatusChangedEventMetadata `locationName:"pullRequestStatusChangedEventMetadata" type:"structure"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s PullRequestEvent) String() string { +func (s SameFileContentException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PullRequestEvent) GoString() string { +func (s SameFileContentException) GoString() string { return s.String() } -// SetActorArn sets the ActorArn field's value. -func (s *PullRequestEvent) SetActorArn(v string) *PullRequestEvent { - s.ActorArn = &v - return s +func newErrorSameFileContentException(v protocol.ResponseMetadata) error { + return &SameFileContentException{ + respMetadata: v, + } } -// SetEventDate sets the EventDate field's value. -func (s *PullRequestEvent) SetEventDate(v time.Time) *PullRequestEvent { - s.EventDate = &v - return s +// Code returns the exception type name. +func (s SameFileContentException) Code() string { + return "SameFileContentException" } -// SetPullRequestCreatedEventMetadata sets the PullRequestCreatedEventMetadata field's value. -func (s *PullRequestEvent) SetPullRequestCreatedEventMetadata(v *PullRequestCreatedEventMetadata) *PullRequestEvent { - s.PullRequestCreatedEventMetadata = v - return s +// Message returns the exception's message. +func (s SameFileContentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetPullRequestEventType sets the PullRequestEventType field's value. -func (s *PullRequestEvent) SetPullRequestEventType(v string) *PullRequestEvent { - s.PullRequestEventType = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SameFileContentException) OrigErr() error { + return nil } -// SetPullRequestId sets the PullRequestId field's value. -func (s *PullRequestEvent) SetPullRequestId(v string) *PullRequestEvent { - s.PullRequestId = &v - return s +func (s SameFileContentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetPullRequestMergedStateChangedEventMetadata sets the PullRequestMergedStateChangedEventMetadata field's value. -func (s *PullRequestEvent) SetPullRequestMergedStateChangedEventMetadata(v *PullRequestMergedStateChangedEventMetadata) *PullRequestEvent { - s.PullRequestMergedStateChangedEventMetadata = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s SameFileContentException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetPullRequestSourceReferenceUpdatedEventMetadata sets the PullRequestSourceReferenceUpdatedEventMetadata field's value. -func (s *PullRequestEvent) SetPullRequestSourceReferenceUpdatedEventMetadata(v *PullRequestSourceReferenceUpdatedEventMetadata) *PullRequestEvent { - s.PullRequestSourceReferenceUpdatedEventMetadata = v - return s +// RequestID returns the service's response RequestID for request. +func (s SameFileContentException) RequestID() string { + return s.respMetadata.RequestID } -// SetPullRequestStatusChangedEventMetadata sets the PullRequestStatusChangedEventMetadata field's value. -func (s *PullRequestEvent) SetPullRequestStatusChangedEventMetadata(v *PullRequestStatusChangedEventMetadata) *PullRequestEvent { - s.PullRequestStatusChangedEventMetadata = v - return s -} +// The commit cannot be created because one or more changes in this commit duplicate +// actions in the same file path. For example, you cannot make the same delete +// request to the same file in the same file path twice, or make a delete request +// and a move request to the same file as part of the same commit. +type SamePathRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata -// Returns information about the change in the merge state for a pull request -// event. -type PullRequestMergedStateChangedEventMetadata struct { - _ struct{} `type:"structure"` + Message_ *string `locationName:"message" type:"string"` +} - // The name of the branch that the pull request will be merged into. - DestinationReference *string `locationName:"destinationReference" type:"string"` +// String returns the string representation +func (s SamePathRequestException) String() string { + return awsutil.Prettify(s) +} - // Information about the merge state change event. - MergeMetadata *MergeMetadata `locationName:"mergeMetadata" type:"structure"` +// GoString returns the string representation +func (s SamePathRequestException) GoString() string { + return s.String() +} - // The name of the repository where the pull request was created. - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` +func newErrorSamePathRequestException(v protocol.ResponseMetadata) error { + return &SamePathRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SamePathRequestException) Code() string { + return "SamePathRequestException" } -// String returns the string representation -func (s PullRequestMergedStateChangedEventMetadata) String() string { - return awsutil.Prettify(s) +// Message returns the exception's message. +func (s SamePathRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// GoString returns the string representation -func (s PullRequestMergedStateChangedEventMetadata) GoString() string { - return s.String() +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SamePathRequestException) OrigErr() error { + return nil } -// SetDestinationReference sets the DestinationReference field's value. -func (s *PullRequestMergedStateChangedEventMetadata) SetDestinationReference(v string) *PullRequestMergedStateChangedEventMetadata { - s.DestinationReference = &v - return s +func (s SamePathRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetMergeMetadata sets the MergeMetadata field's value. -func (s *PullRequestMergedStateChangedEventMetadata) SetMergeMetadata(v *MergeMetadata) *PullRequestMergedStateChangedEventMetadata { - s.MergeMetadata = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s SamePathRequestException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetRepositoryName sets the RepositoryName field's value. -func (s *PullRequestMergedStateChangedEventMetadata) SetRepositoryName(v string) *PullRequestMergedStateChangedEventMetadata { - s.RepositoryName = &v - return s +// RequestID returns the service's response RequestID for request. +func (s SamePathRequestException) RequestID() string { + return s.respMetadata.RequestID } -// Information about an update to the source branch of a pull request. -type PullRequestSourceReferenceUpdatedEventMetadata struct { +// Information about the file mode changes. +type SetFileModeEntry struct { _ struct{} `type:"structure"` - // The full commit ID of the commit in the source branch that was the tip of - // the branch at the time the pull request was updated. - AfterCommitId *string `locationName:"afterCommitId" type:"string"` - - // The full commit ID of the commit in the destination branch that was the tip - // of the branch at the time the pull request was updated. - BeforeCommitId *string `locationName:"beforeCommitId" type:"string"` - - // The commit ID of the most recent commit that the source branch and the destination - // branch have in common. - MergeBase *string `locationName:"mergeBase" type:"string"` + // The file mode for the file. + // + // FileMode is a required field + FileMode *string `locationName:"fileMode" type:"string" required:"true" enum:"FileModeTypeEnum"` - // The name of the repository where the pull request was updated. - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` + // The full path to the file, including the name of the file. + // + // FilePath is a required field + FilePath *string `locationName:"filePath" type:"string" required:"true"` } // String returns the string representation -func (s PullRequestSourceReferenceUpdatedEventMetadata) String() string { +func (s SetFileModeEntry) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PullRequestSourceReferenceUpdatedEventMetadata) GoString() string { +func (s SetFileModeEntry) GoString() string { return s.String() } -// SetAfterCommitId sets the AfterCommitId field's value. -func (s *PullRequestSourceReferenceUpdatedEventMetadata) SetAfterCommitId(v string) *PullRequestSourceReferenceUpdatedEventMetadata { - s.AfterCommitId = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *SetFileModeEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SetFileModeEntry"} + if s.FileMode == nil { + invalidParams.Add(request.NewErrParamRequired("FileMode")) + } + if s.FilePath == nil { + invalidParams.Add(request.NewErrParamRequired("FilePath")) + } -// SetBeforeCommitId sets the BeforeCommitId field's value. -func (s *PullRequestSourceReferenceUpdatedEventMetadata) SetBeforeCommitId(v string) *PullRequestSourceReferenceUpdatedEventMetadata { - s.BeforeCommitId = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetMergeBase sets the MergeBase field's value. -func (s *PullRequestSourceReferenceUpdatedEventMetadata) SetMergeBase(v string) *PullRequestSourceReferenceUpdatedEventMetadata { - s.MergeBase = &v +// SetFileMode sets the FileMode field's value. +func (s *SetFileModeEntry) SetFileMode(v string) *SetFileModeEntry { + s.FileMode = &v return s } -// SetRepositoryName sets the RepositoryName field's value. -func (s *PullRequestSourceReferenceUpdatedEventMetadata) SetRepositoryName(v string) *PullRequestSourceReferenceUpdatedEventMetadata { - s.RepositoryName = &v +// SetFilePath sets the FilePath field's value. +func (s *SetFileModeEntry) SetFilePath(v string) *SetFileModeEntry { + s.FilePath = &v return s } -// Information about a change to the status of a pull request. -type PullRequestStatusChangedEventMetadata struct { - _ struct{} `type:"structure"` +// The source branch and destination branch for the pull request are the same. +// You must specify different branches for the source and destination. +type SourceAndDestinationAreSameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The changed status of the pull request. - PullRequestStatus *string `locationName:"pullRequestStatus" type:"string" enum:"PullRequestStatusEnum"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s PullRequestStatusChangedEventMetadata) String() string { +func (s SourceAndDestinationAreSameException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PullRequestStatusChangedEventMetadata) GoString() string { +func (s SourceAndDestinationAreSameException) GoString() string { return s.String() } -// SetPullRequestStatus sets the PullRequestStatus field's value. -func (s *PullRequestStatusChangedEventMetadata) SetPullRequestStatus(v string) *PullRequestStatusChangedEventMetadata { - s.PullRequestStatus = &v - return s +func newErrorSourceAndDestinationAreSameException(v protocol.ResponseMetadata) error { + return &SourceAndDestinationAreSameException{ + respMetadata: v, + } } -// Returns information about a pull request target. -type PullRequestTarget struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s SourceAndDestinationAreSameException) Code() string { + return "SourceAndDestinationAreSameException" +} - // The full commit ID that is the tip of the destination branch. This is the - // commit where the pull request was or will be merged. - DestinationCommit *string `locationName:"destinationCommit" type:"string"` +// Message returns the exception's message. +func (s SourceAndDestinationAreSameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The branch of the repository where the pull request changes will be merged - // into. Also known as the destination branch. - DestinationReference *string `locationName:"destinationReference" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SourceAndDestinationAreSameException) OrigErr() error { + return nil +} - // The commit ID of the most recent commit that the source branch and the destination - // branch have in common. - MergeBase *string `locationName:"mergeBase" type:"string"` +func (s SourceAndDestinationAreSameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // Returns metadata about the state of the merge, including whether the merge - // has been made. - MergeMetadata *MergeMetadata `locationName:"mergeMetadata" type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s SourceAndDestinationAreSameException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The name of the repository that contains the pull request source and destination - // branches. - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s SourceAndDestinationAreSameException) RequestID() string { + return s.respMetadata.RequestID +} - // The full commit ID of the tip of the source branch used to create the pull - // request. If the pull request branch is updated by a push while the pull request - // is open, the commit ID will change to reflect the new tip of the branch. - SourceCommit *string `locationName:"sourceCommit" type:"string"` +// The commit cannot be created because no source files or file content have +// been specified for the commit. +type SourceFileOrContentRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The branch of the repository that contains the changes for the pull request. - // Also known as the source branch. - SourceReference *string `locationName:"sourceReference" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s PullRequestTarget) String() string { +func (s SourceFileOrContentRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PullRequestTarget) GoString() string { +func (s SourceFileOrContentRequiredException) GoString() string { return s.String() } -// SetDestinationCommit sets the DestinationCommit field's value. -func (s *PullRequestTarget) SetDestinationCommit(v string) *PullRequestTarget { - s.DestinationCommit = &v - return s +func newErrorSourceFileOrContentRequiredException(v protocol.ResponseMetadata) error { + return &SourceFileOrContentRequiredException{ + respMetadata: v, + } } -// SetDestinationReference sets the DestinationReference field's value. -func (s *PullRequestTarget) SetDestinationReference(v string) *PullRequestTarget { - s.DestinationReference = &v - return s +// Code returns the exception type name. +func (s SourceFileOrContentRequiredException) Code() string { + return "SourceFileOrContentRequiredException" } -// SetMergeBase sets the MergeBase field's value. -func (s *PullRequestTarget) SetMergeBase(v string) *PullRequestTarget { - s.MergeBase = &v - return s +// Message returns the exception's message. +func (s SourceFileOrContentRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetMergeMetadata sets the MergeMetadata field's value. -func (s *PullRequestTarget) SetMergeMetadata(v *MergeMetadata) *PullRequestTarget { - s.MergeMetadata = v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SourceFileOrContentRequiredException) OrigErr() error { + return nil } -// SetRepositoryName sets the RepositoryName field's value. -func (s *PullRequestTarget) SetRepositoryName(v string) *PullRequestTarget { - s.RepositoryName = &v - return s +func (s SourceFileOrContentRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetSourceCommit sets the SourceCommit field's value. -func (s *PullRequestTarget) SetSourceCommit(v string) *PullRequestTarget { - s.SourceCommit = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s SourceFileOrContentRequiredException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetSourceReference sets the SourceReference field's value. -func (s *PullRequestTarget) SetSourceReference(v string) *PullRequestTarget { - s.SourceReference = &v - return s +// RequestID returns the service's response RequestID for request. +func (s SourceFileOrContentRequiredException) RequestID() string { + return s.respMetadata.RequestID } -// Information about a file that will be added or updated as part of a commit. -type PutFileEntry struct { +// Information about a source file that is part of changes made in a commit. +type SourceFileSpecifier struct { _ struct{} `type:"structure"` - // The content of the file, if a source file is not specified. - // - // FileContent is automatically base64 encoded/decoded by the SDK. - FileContent []byte `locationName:"fileContent" type:"blob"` - - // The extrapolated file mode permissions for the file. Valid values include - // EXECUTABLE and NORMAL. - FileMode *string `locationName:"fileMode" type:"string" enum:"FileModeTypeEnum"` - - // The full path to the file in the repository, including the name of the file. + // The full path to the file, including the name of the file. // // FilePath is a required field FilePath *string `locationName:"filePath" type:"string" required:"true"` - // The name and full path of the file that contains the changes you want to - // make as part of the commit, if you are not providing the file content directly. - SourceFile *SourceFileSpecifier `locationName:"sourceFile" type:"structure"` + // Whether to remove the source file from the parent commit. + IsMove *bool `locationName:"isMove" type:"boolean"` } // String returns the string representation -func (s PutFileEntry) String() string { +func (s SourceFileSpecifier) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutFileEntry) GoString() string { +func (s SourceFileSpecifier) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *PutFileEntry) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutFileEntry"} +func (s *SourceFileSpecifier) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SourceFileSpecifier"} if s.FilePath == nil { invalidParams.Add(request.NewErrParamRequired("FilePath")) } - if s.SourceFile != nil { - if err := s.SourceFile.Validate(); err != nil { - invalidParams.AddNested("SourceFile", err.(request.ErrInvalidParams)) - } - } if invalidParams.Len() > 0 { return invalidParams @@ -15063,272 +30019,258 @@ func (s *PutFileEntry) Validate() error { return nil } -// SetFileContent sets the FileContent field's value. -func (s *PutFileEntry) SetFileContent(v []byte) *PutFileEntry { - s.FileContent = v - return s -} - -// SetFileMode sets the FileMode field's value. -func (s *PutFileEntry) SetFileMode(v string) *PutFileEntry { - s.FileMode = &v - return s -} - // SetFilePath sets the FilePath field's value. -func (s *PutFileEntry) SetFilePath(v string) *PutFileEntry { +func (s *SourceFileSpecifier) SetFilePath(v string) *SourceFileSpecifier { s.FilePath = &v return s } -// SetSourceFile sets the SourceFile field's value. -func (s *PutFileEntry) SetSourceFile(v *SourceFileSpecifier) *PutFileEntry { - s.SourceFile = v +// SetIsMove sets the IsMove field's value. +func (s *SourceFileSpecifier) SetIsMove(v bool) *SourceFileSpecifier { + s.IsMove = &v return s } -type PutFileInput struct { +// Returns information about a submodule reference in a repository folder. +type SubModule struct { _ struct{} `type:"structure"` - // The name of the branch where you want to add or update the file. If this - // is an empty repository, this branch will be created. - // - // BranchName is a required field - BranchName *string `locationName:"branchName" min:"1" type:"string" required:"true"` - - // A message about why this file was added or updated. While optional, adding - // a message is strongly encouraged in order to provide a more useful commit - // history for your repository. - CommitMessage *string `locationName:"commitMessage" type:"string"` - - // An email address for the person adding or updating the file. - Email *string `locationName:"email" type:"string"` - - // The content of the file, in binary object format. - // - // FileContent is automatically base64 encoded/decoded by the SDK. - // - // FileContent is a required field - FileContent []byte `locationName:"fileContent" type:"blob" required:"true"` - - // The file mode permissions of the blob. Valid file mode permissions are listed - // below. - FileMode *string `locationName:"fileMode" type:"string" enum:"FileModeTypeEnum"` - - // The name of the file you want to add or update, including the relative path - // to the file in the repository. - // - // If the path does not currently exist in the repository, the path will be - // created as part of adding the file. - // - // FilePath is a required field - FilePath *string `locationName:"filePath" type:"string" required:"true"` - - // The name of the person adding or updating the file. While optional, adding - // a name is strongly encouraged in order to provide a more useful commit history - // for your repository. - Name *string `locationName:"name" type:"string"` + // The fully qualified path to the folder that contains the reference to the + // submodule. + AbsolutePath *string `locationName:"absolutePath" type:"string"` - // The full commit ID of the head commit in the branch where you want to add - // or update the file. If this is an empty repository, no commit ID is required. - // If this is not an empty repository, a commit ID is required. - // - // The commit ID must match the ID of the head commit at the time of the operation, - // or an error will occur, and the file will not be added or updated. - ParentCommitId *string `locationName:"parentCommitId" type:"string"` + // The commit ID that contains the reference to the submodule. + CommitId *string `locationName:"commitId" type:"string"` - // The name of the repository where you want to add or update the file. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + // The relative path of the submodule from the folder where the query originated. + RelativePath *string `locationName:"relativePath" type:"string"` } // String returns the string representation -func (s PutFileInput) String() string { +func (s SubModule) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutFileInput) GoString() string { +func (s SubModule) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutFileInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutFileInput"} - 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.FileContent == nil { - invalidParams.Add(request.NewErrParamRequired("FileContent")) - } - if s.FilePath == nil { - invalidParams.Add(request.NewErrParamRequired("FilePath")) - } - 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 +// SetAbsolutePath sets the AbsolutePath field's value. +func (s *SubModule) SetAbsolutePath(v string) *SubModule { + s.AbsolutePath = &v + return s } -// SetBranchName sets the BranchName field's value. -func (s *PutFileInput) SetBranchName(v string) *PutFileInput { - s.BranchName = &v +// SetCommitId sets the CommitId field's value. +func (s *SubModule) SetCommitId(v string) *SubModule { + s.CommitId = &v return s } -// SetCommitMessage sets the CommitMessage field's value. -func (s *PutFileInput) SetCommitMessage(v string) *PutFileInput { - s.CommitMessage = &v +// SetRelativePath sets the RelativePath field's value. +func (s *SubModule) SetRelativePath(v string) *SubModule { + s.RelativePath = &v return s } -// SetEmail sets the Email field's value. -func (s *PutFileInput) SetEmail(v string) *PutFileInput { - s.Email = &v +// Returns information about a symbolic link in a repository folder. +type SymbolicLink struct { + _ struct{} `type:"structure"` + + // The fully qualified path to the folder that contains the symbolic link. + AbsolutePath *string `locationName:"absolutePath" type:"string"` + + // The blob ID that contains the information about the symbolic link. + BlobId *string `locationName:"blobId" type:"string"` + + // The file mode permissions of the blob that cotains information about the + // symbolic link. + FileMode *string `locationName:"fileMode" type:"string" enum:"FileModeTypeEnum"` + + // The relative path of the symbolic link from the folder where the query originated. + RelativePath *string `locationName:"relativePath" type:"string"` +} + +// String returns the string representation +func (s SymbolicLink) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SymbolicLink) GoString() string { + return s.String() +} + +// SetAbsolutePath sets the AbsolutePath field's value. +func (s *SymbolicLink) SetAbsolutePath(v string) *SymbolicLink { + s.AbsolutePath = &v return s } -// SetFileContent sets the FileContent field's value. -func (s *PutFileInput) SetFileContent(v []byte) *PutFileInput { - s.FileContent = v +// SetBlobId sets the BlobId field's value. +func (s *SymbolicLink) SetBlobId(v string) *SymbolicLink { + s.BlobId = &v return s } // SetFileMode sets the FileMode field's value. -func (s *PutFileInput) SetFileMode(v string) *PutFileInput { +func (s *SymbolicLink) SetFileMode(v string) *SymbolicLink { s.FileMode = &v return s } -// SetFilePath sets the FilePath field's value. -func (s *PutFileInput) SetFilePath(v string) *PutFileInput { - s.FilePath = &v +// SetRelativePath sets the RelativePath field's value. +func (s *SymbolicLink) SetRelativePath(v string) *SymbolicLink { + s.RelativePath = &v return s } -// SetName sets the Name field's value. -func (s *PutFileInput) SetName(v string) *PutFileInput { - s.Name = &v - return s +// A list of tag keys is required. The list cannot be empty or null. +type TagKeysListRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetParentCommitId sets the ParentCommitId field's value. -func (s *PutFileInput) SetParentCommitId(v string) *PutFileInput { - s.ParentCommitId = &v - return s +// String returns the string representation +func (s TagKeysListRequiredException) String() string { + return awsutil.Prettify(s) } -// SetRepositoryName sets the RepositoryName field's value. -func (s *PutFileInput) SetRepositoryName(v string) *PutFileInput { - s.RepositoryName = &v - return s +// GoString returns the string representation +func (s TagKeysListRequiredException) GoString() string { + return s.String() } -type PutFileOutput struct { - _ struct{} `type:"structure"` +func newErrorTagKeysListRequiredException(v protocol.ResponseMetadata) error { + return &TagKeysListRequiredException{ + respMetadata: v, + } +} - // The ID of the blob, which is its SHA-1 pointer. - // - // BlobId is a required field - BlobId *string `locationName:"blobId" type:"string" required:"true"` +// Code returns the exception type name. +func (s TagKeysListRequiredException) Code() string { + return "TagKeysListRequiredException" +} - // The full SHA of the commit that contains this file change. - // - // CommitId is a required field - CommitId *string `locationName:"commitId" type:"string" required:"true"` +// Message returns the exception's message. +func (s TagKeysListRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The full SHA-1 pointer of the tree information for the commit that contains - // this file change. - // - // TreeId is a required field - TreeId *string `locationName:"treeId" type:"string" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagKeysListRequiredException) OrigErr() error { + return nil +} + +func (s TagKeysListRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagKeysListRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagKeysListRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The tag policy is not valid. +type TagPolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s PutFileOutput) String() string { +func (s TagPolicyException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutFileOutput) GoString() string { +func (s TagPolicyException) GoString() string { return s.String() } -// SetBlobId sets the BlobId field's value. -func (s *PutFileOutput) SetBlobId(v string) *PutFileOutput { - s.BlobId = &v - return s +func newErrorTagPolicyException(v protocol.ResponseMetadata) error { + return &TagPolicyException{ + respMetadata: v, + } } -// SetCommitId sets the CommitId field's value. -func (s *PutFileOutput) SetCommitId(v string) *PutFileOutput { - s.CommitId = &v - return s +// Code returns the exception type name. +func (s TagPolicyException) Code() string { + return "TagPolicyException" } -// SetTreeId sets the TreeId field's value. -func (s *PutFileOutput) SetTreeId(v string) *PutFileOutput { - s.TreeId = &v - return s +// Message returns the exception's message. +func (s TagPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// Represents the input ofa put repository triggers operation. -type PutRepositoryTriggersInput struct { +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagPolicyException) OrigErr() error { + return nil +} + +func (s TagPolicyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagPolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagPolicyException) RequestID() string { + return s.respMetadata.RequestID +} + +type TagResourceInput struct { _ struct{} `type:"structure"` - // The name of the repository where you want to create or update the trigger. + // The Amazon Resource Name (ARN) of the resource to which you want to add or + // update tags. // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + // ResourceArn is a required field + ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"` - // The JSON block of configuration information for each trigger. + // The key-value pair to use when tagging this repository. // - // Triggers is a required field - Triggers []*RepositoryTrigger `locationName:"triggers" type:"list" required:"true"` + // Tags is a required field + Tags map[string]*string `locationName:"tags" type:"map" required:"true"` } // String returns the string representation -func (s PutRepositoryTriggersInput) String() string { +func (s TagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutRepositoryTriggersInput) GoString() string { +func (s TagResourceInput) 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")) +func (s *TagResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) } - 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 s.Tags == nil { + invalidParams.Add(request.NewErrParamRequired("Tags")) } if invalidParams.Len() > 0 { @@ -15337,84 +30279,129 @@ func (s *PutRepositoryTriggersInput) Validate() error { return nil } -// SetRepositoryName sets the RepositoryName field's value. -func (s *PutRepositoryTriggersInput) SetRepositoryName(v string) *PutRepositoryTriggersInput { - s.RepositoryName = &v +// SetResourceArn sets the ResourceArn field's value. +func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { + s.ResourceArn = &v return s } -// SetTriggers sets the Triggers field's value. -func (s *PutRepositoryTriggersInput) SetTriggers(v []*RepositoryTrigger) *PutRepositoryTriggersInput { - s.Triggers = v +// SetTags sets the Tags field's value. +func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { + s.Tags = v return s } -// Represents the output of a put repository triggers operation. -type PutRepositoryTriggersOutput struct { +type TagResourceOutput 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 TagResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagResourceOutput) GoString() string { + return s.String() +} + +// A map of tags is required. +type TagsMapRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TagsMapRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagsMapRequiredException) GoString() string { + return s.String() +} + +func newErrorTagsMapRequiredException(v protocol.ResponseMetadata) error { + return &TagsMapRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagsMapRequiredException) Code() string { + return "TagsMapRequiredException" +} + +// Message returns the exception's message. +func (s TagsMapRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagsMapRequiredException) OrigErr() error { + return nil } -// String returns the string representation -func (s PutRepositoryTriggersOutput) String() string { - return awsutil.Prettify(s) +func (s TagsMapRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// GoString returns the string representation -func (s PutRepositoryTriggersOutput) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s TagsMapRequiredException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetConfigurationId sets the ConfigurationId field's value. -func (s *PutRepositoryTriggersOutput) SetConfigurationId(v string) *PutRepositoryTriggersOutput { - s.ConfigurationId = &v - return s +// RequestID returns the service's response RequestID for request. +func (s TagsMapRequiredException) RequestID() string { + return s.respMetadata.RequestID } -// Information about a replacement content entry in the conflict of a merge -// or pull request operation. -type ReplaceContentEntry struct { +// Returns information about a target for a pull request. +type Target struct { _ struct{} `type:"structure"` - // The base-64 encoded content to use when the replacement type is USE_NEW_CONTENT. - // - // Content is automatically base64 encoded/decoded by the SDK. - Content []byte `locationName:"content" type:"blob"` - - // The file mode to apply during conflict resoltion. - FileMode *string `locationName:"fileMode" type:"string" enum:"FileModeTypeEnum"` + // The branch of the repository where the pull request changes are merged. Also + // known as the destination branch. + DestinationReference *string `locationName:"destinationReference" type:"string"` - // The path of the conflicting file. + // The name of the repository that contains the pull request. // - // FilePath is a required field - FilePath *string `locationName:"filePath" type:"string" required:"true"` + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` - // The replacement type to use when determining how to resolve the conflict. + // The branch of the repository that contains the changes for the pull request. + // Also known as the source branch. // - // ReplacementType is a required field - ReplacementType *string `locationName:"replacementType" type:"string" required:"true" enum:"ReplacementTypeEnum"` + // SourceReference is a required field + SourceReference *string `locationName:"sourceReference" type:"string" required:"true"` } // String returns the string representation -func (s ReplaceContentEntry) String() string { +func (s Target) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ReplaceContentEntry) GoString() string { +func (s Target) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ReplaceContentEntry) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplaceContentEntry"} - if s.FilePath == nil { - invalidParams.Add(request.NewErrParamRequired("FilePath")) +func (s *Target) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Target"} + if s.RepositoryName == nil { + invalidParams.Add(request.NewErrParamRequired("RepositoryName")) } - if s.ReplacementType == nil { - invalidParams.Add(request.NewErrParamRequired("ReplacementType")) + if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) + } + if s.SourceReference == nil { + invalidParams.Add(request.NewErrParamRequired("SourceReference")) } if invalidParams.Len() > 0 { @@ -15423,524 +30410,500 @@ func (s *ReplaceContentEntry) Validate() error { return nil } -// SetContent sets the Content field's value. -func (s *ReplaceContentEntry) SetContent(v []byte) *ReplaceContentEntry { - s.Content = v - return s -} - -// SetFileMode sets the FileMode field's value. -func (s *ReplaceContentEntry) SetFileMode(v string) *ReplaceContentEntry { - s.FileMode = &v +// SetDestinationReference sets the DestinationReference field's value. +func (s *Target) SetDestinationReference(v string) *Target { + s.DestinationReference = &v return s } -// SetFilePath sets the FilePath field's value. -func (s *ReplaceContentEntry) SetFilePath(v string) *ReplaceContentEntry { - s.FilePath = &v +// SetRepositoryName sets the RepositoryName field's value. +func (s *Target) SetRepositoryName(v string) *Target { + s.RepositoryName = &v return s } -// SetReplacementType sets the ReplacementType field's value. -func (s *ReplaceContentEntry) SetReplacementType(v string) *ReplaceContentEntry { - s.ReplacementType = &v +// SetSourceReference sets the SourceReference field's value. +func (s *Target) SetSourceReference(v string) *Target { + s.SourceReference = &v return s } -// Information about a repository. -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"` - - // 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"` - - // A comment or description about the repository. - RepositoryDescription *string `locationName:"repositoryDescription" type:"string"` - - // The ID of the repository. - RepositoryId *string `locationName:"repositoryId" type:"string"` +// A pull request target is required. It cannot be empty or null. A pull request +// target must contain the full values for the repository name, source branch, +// and destination branch for the pull request. +type TargetRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The repository's name. - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s RepositoryMetadata) String() string { +func (s TargetRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RepositoryMetadata) GoString() string { +func (s TargetRequiredException) GoString() string { return s.String() } -// SetAccountId sets the AccountId field's value. -func (s *RepositoryMetadata) SetAccountId(v string) *RepositoryMetadata { - s.AccountId = &v - return s +func newErrorTargetRequiredException(v protocol.ResponseMetadata) error { + return &TargetRequiredException{ + respMetadata: v, + } } -// SetArn sets the Arn field's value. -func (s *RepositoryMetadata) SetArn(v string) *RepositoryMetadata { - s.Arn = &v - return s +// Code returns the exception type name. +func (s TargetRequiredException) Code() string { + return "TargetRequiredException" } -// SetCloneUrlHttp sets the CloneUrlHttp field's value. -func (s *RepositoryMetadata) SetCloneUrlHttp(v string) *RepositoryMetadata { - s.CloneUrlHttp = &v - return s +// Message returns the exception's message. +func (s TargetRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetCloneUrlSsh sets the CloneUrlSsh field's value. -func (s *RepositoryMetadata) SetCloneUrlSsh(v string) *RepositoryMetadata { - s.CloneUrlSsh = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TargetRequiredException) OrigErr() error { + return nil } -// SetCreationDate sets the CreationDate field's value. -func (s *RepositoryMetadata) SetCreationDate(v time.Time) *RepositoryMetadata { - s.CreationDate = &v - return s +func (s TargetRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetDefaultBranch sets the DefaultBranch field's value. -func (s *RepositoryMetadata) SetDefaultBranch(v string) *RepositoryMetadata { - s.DefaultBranch = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s TargetRequiredException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *RepositoryMetadata) SetLastModifiedDate(v time.Time) *RepositoryMetadata { - s.LastModifiedDate = &v - return s +// RequestID returns the service's response RequestID for request. +func (s TargetRequiredException) RequestID() string { + return s.respMetadata.RequestID } -// SetRepositoryDescription sets the RepositoryDescription field's value. -func (s *RepositoryMetadata) SetRepositoryDescription(v string) *RepositoryMetadata { - s.RepositoryDescription = &v - return s +// An array of target objects is required. It cannot be empty or null. +type TargetsRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetRepositoryId sets the RepositoryId field's value. -func (s *RepositoryMetadata) SetRepositoryId(v string) *RepositoryMetadata { - s.RepositoryId = &v - return s +// String returns the string representation +func (s TargetsRequiredException) String() string { + return awsutil.Prettify(s) } -// SetRepositoryName sets the RepositoryName field's value. -func (s *RepositoryMetadata) SetRepositoryName(v string) *RepositoryMetadata { - s.RepositoryName = &v - return s +// GoString returns the string representation +func (s TargetsRequiredException) GoString() string { + return s.String() } -// Information about a repository name and ID. -type RepositoryNameIdPair struct { - _ struct{} `type:"structure"` +func newErrorTargetsRequiredException(v protocol.ResponseMetadata) error { + return &TargetsRequiredException{ + respMetadata: v, + } +} - // The ID associated with the repository. - RepositoryId *string `locationName:"repositoryId" type:"string"` +// Code returns the exception type name. +func (s TargetsRequiredException) Code() string { + return "TargetsRequiredException" +} - // The name associated with the repository. - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string"` +// Message returns the exception's message. +func (s TargetsRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s RepositoryNameIdPair) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TargetsRequiredException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s RepositoryNameIdPair) GoString() string { - return s.String() +func (s TargetsRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetRepositoryId sets the RepositoryId field's value. -func (s *RepositoryNameIdPair) SetRepositoryId(v string) *RepositoryNameIdPair { - s.RepositoryId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s TargetsRequiredException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetRepositoryName sets the RepositoryName field's value. -func (s *RepositoryNameIdPair) SetRepositoryName(v string) *RepositoryNameIdPair { - s.RepositoryName = &v - return s +// RequestID returns the service's response RequestID for request. +func (s TargetsRequiredException) RequestID() string { + return s.respMetadata.RequestID } -// Information about a trigger for a repository. -type RepositoryTrigger struct { +// Represents the input of a test repository triggers operation. +type TestRepositoryTriggersInput struct { _ struct{} `type:"structure"` - // The branches that will be included in the trigger configuration. If you specify - // an empty array, the trigger will apply to all branches. - // - // Although no content is required in the array, you must include the array - // itself. - 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 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 SNS. - // - // The valid value "all" cannot be used with any other values. + // The name of the repository in which to test the triggers. // - // Events is a required field - Events []*string `locationName:"events" type:"list" required:"true"` + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` - // The name of the trigger. + // The list of triggers to test. // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` + // Triggers is a required field + Triggers []*RepositoryTrigger `locationName:"triggers" type:"list" required:"true"` } // String returns the string representation -func (s RepositoryTrigger) String() string { +func (s TestRepositoryTriggersInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RepositoryTrigger) GoString() string { +func (s TestRepositoryTriggersInput) 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")) +func (s *TestRepositoryTriggersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TestRepositoryTriggersInput"} + if s.RepositoryName == nil { + invalidParams.Add(request.NewErrParamRequired("RepositoryName")) } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) + if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) } - - if invalidParams.Len() > 0 { - return invalidParams + 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)) + } + } } - 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 + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetEvents sets the Events field's value. -func (s *RepositoryTrigger) SetEvents(v []*string) *RepositoryTrigger { - s.Events = v +// SetRepositoryName sets the RepositoryName field's value. +func (s *TestRepositoryTriggersInput) SetRepositoryName(v string) *TestRepositoryTriggersInput { + s.RepositoryName = &v return s } -// SetName sets the Name field's value. -func (s *RepositoryTrigger) SetName(v string) *RepositoryTrigger { - s.Name = &v +// SetTriggers sets the Triggers field's value. +func (s *TestRepositoryTriggersInput) SetTriggers(v []*RepositoryTrigger) *TestRepositoryTriggersInput { + s.Triggers = v return s } -// A trigger failed to run. -type RepositoryTriggerExecutionFailure struct { +// Represents the output of a test repository triggers operation. +type TestRepositoryTriggersOutput struct { _ struct{} `type:"structure"` - // Additional message information about the trigger that did not run. - FailureMessage *string `locationName:"failureMessage" type:"string"` + // The list of triggers that were not tested. This list provides the names of + // the triggers that could not be tested, separated by commas. + FailedExecutions []*RepositoryTriggerExecutionFailure `locationName:"failedExecutions" type:"list"` - // The name of the trigger that did not run. - Trigger *string `locationName:"trigger" type:"string"` + // 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 RepositoryTriggerExecutionFailure) String() string { +func (s TestRepositoryTriggersOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RepositoryTriggerExecutionFailure) GoString() string { +func (s TestRepositoryTriggersOutput) GoString() string { return s.String() } -// SetFailureMessage sets the FailureMessage field's value. -func (s *RepositoryTriggerExecutionFailure) SetFailureMessage(v string) *RepositoryTriggerExecutionFailure { - s.FailureMessage = &v +// SetFailedExecutions sets the FailedExecutions field's value. +func (s *TestRepositoryTriggersOutput) SetFailedExecutions(v []*RepositoryTriggerExecutionFailure) *TestRepositoryTriggersOutput { + s.FailedExecutions = v return s } -// SetTrigger sets the Trigger field's value. -func (s *RepositoryTriggerExecutionFailure) SetTrigger(v string) *RepositoryTriggerExecutionFailure { - s.Trigger = &v +// SetSuccessfulExecutions sets the SuccessfulExecutions field's value. +func (s *TestRepositoryTriggersOutput) SetSuccessfulExecutions(v []*string) *TestRepositoryTriggersOutput { + s.SuccessfulExecutions = v return s } -// Information about the file mode changes. -type SetFileModeEntry struct { - _ struct{} `type:"structure"` - - // The file mode for the file. - // - // FileMode is a required field - FileMode *string `locationName:"fileMode" type:"string" required:"true" enum:"FileModeTypeEnum"` +// The tip of the source branch in the destination repository does not match +// the tip of the source branch specified in your request. The pull request +// might have been updated. Make sure that you have the latest changes. +type TipOfSourceReferenceIsDifferentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The full path to the file, including the name of the file. - // - // FilePath is a required field - FilePath *string `locationName:"filePath" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s SetFileModeEntry) String() string { +func (s TipOfSourceReferenceIsDifferentException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SetFileModeEntry) GoString() string { +func (s TipOfSourceReferenceIsDifferentException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetFileModeEntry) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetFileModeEntry"} - if s.FileMode == nil { - invalidParams.Add(request.NewErrParamRequired("FileMode")) - } - if s.FilePath == nil { - invalidParams.Add(request.NewErrParamRequired("FilePath")) +func newErrorTipOfSourceReferenceIsDifferentException(v protocol.ResponseMetadata) error { + return &TipOfSourceReferenceIsDifferentException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s TipOfSourceReferenceIsDifferentException) Code() string { + return "TipOfSourceReferenceIsDifferentException" +} + +// Message returns the exception's message. +func (s TipOfSourceReferenceIsDifferentException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TipOfSourceReferenceIsDifferentException) OrigErr() error { return nil } -// SetFileMode sets the FileMode field's value. -func (s *SetFileModeEntry) SetFileMode(v string) *SetFileModeEntry { - s.FileMode = &v - return s +func (s TipOfSourceReferenceIsDifferentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetFilePath sets the FilePath field's value. -func (s *SetFileModeEntry) SetFilePath(v string) *SetFileModeEntry { - s.FilePath = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s TipOfSourceReferenceIsDifferentException) StatusCode() int { + return s.respMetadata.StatusCode } -// Information about a source file that is part of changes made in a commit. -type SourceFileSpecifier struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s TipOfSourceReferenceIsDifferentException) RequestID() string { + return s.respMetadata.RequestID +} - // The full path to the file, including the name of the file. - // - // FilePath is a required field - FilePath *string `locationName:"filePath" type:"string" required:"true"` +// The divergence between the tips of the provided commit specifiers is too +// great to determine whether there might be any merge conflicts. Locally compare +// the specifiers using git diff or a diff tool. +type TipsDivergenceExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Whether to remove the source file from the parent commit. - IsMove *bool `locationName:"isMove" type:"boolean"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s SourceFileSpecifier) String() string { +func (s TipsDivergenceExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SourceFileSpecifier) GoString() string { +func (s TipsDivergenceExceededException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *SourceFileSpecifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SourceFileSpecifier"} - if s.FilePath == nil { - invalidParams.Add(request.NewErrParamRequired("FilePath")) +func newErrorTipsDivergenceExceededException(v protocol.ResponseMetadata) error { + return &TipsDivergenceExceededException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s TipsDivergenceExceededException) Code() string { + return "TipsDivergenceExceededException" +} + +// Message returns the exception's message. +func (s TipsDivergenceExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetFilePath sets the FilePath field's value. -func (s *SourceFileSpecifier) SetFilePath(v string) *SourceFileSpecifier { - s.FilePath = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TipsDivergenceExceededException) OrigErr() error { + return nil } -// SetIsMove sets the IsMove field's value. -func (s *SourceFileSpecifier) SetIsMove(v bool) *SourceFileSpecifier { - s.IsMove = &v - return s +func (s TipsDivergenceExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// Returns information about a submodule reference in a repository folder. -type SubModule struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s TipsDivergenceExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The fully qualified path to the folder that contains the reference to the - // submodule. - AbsolutePath *string `locationName:"absolutePath" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s TipsDivergenceExceededException) RequestID() string { + return s.respMetadata.RequestID +} - // The commit ID that contains the reference to the submodule. - CommitId *string `locationName:"commitId" type:"string"` +// A pull request title is required. It cannot be empty or null. +type TitleRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The relative path of the submodule from the folder where the query originated. - RelativePath *string `locationName:"relativePath" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s SubModule) String() string { +func (s TitleRequiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SubModule) GoString() string { +func (s TitleRequiredException) GoString() string { return s.String() } -// SetAbsolutePath sets the AbsolutePath field's value. -func (s *SubModule) SetAbsolutePath(v string) *SubModule { - s.AbsolutePath = &v - return s +func newErrorTitleRequiredException(v protocol.ResponseMetadata) error { + return &TitleRequiredException{ + respMetadata: v, + } } -// SetCommitId sets the CommitId field's value. -func (s *SubModule) SetCommitId(v string) *SubModule { - s.CommitId = &v - return s +// Code returns the exception type name. +func (s TitleRequiredException) Code() string { + return "TitleRequiredException" } -// SetRelativePath sets the RelativePath field's value. -func (s *SubModule) SetRelativePath(v string) *SubModule { - s.RelativePath = &v - return s +// Message returns the exception's message. +func (s TitleRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// Returns information about a symbolic link in a repository folder. -type SymbolicLink struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TitleRequiredException) OrigErr() error { + return nil +} - // The fully-qualified path to the folder that contains the symbolic link. - AbsolutePath *string `locationName:"absolutePath" type:"string"` +func (s TitleRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The blob ID that contains the information about the symbolic link. - BlobId *string `locationName:"blobId" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s TitleRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The file mode permissions of the blob that cotains information about the - // symbolic link. - FileMode *string `locationName:"fileMode" type:"string" enum:"FileModeTypeEnum"` +// RequestID returns the service's response RequestID for request. +func (s TitleRequiredException) RequestID() string { + return s.respMetadata.RequestID +} - // The relative path of the symbolic link from the folder where the query originated. - RelativePath *string `locationName:"relativePath" type:"string"` +// The maximum number of tags for an AWS CodeCommit resource has been exceeded. +type TooManyTagsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s SymbolicLink) String() string { +func (s TooManyTagsException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SymbolicLink) GoString() string { +func (s TooManyTagsException) GoString() string { return s.String() } -// SetAbsolutePath sets the AbsolutePath field's value. -func (s *SymbolicLink) SetAbsolutePath(v string) *SymbolicLink { - s.AbsolutePath = &v - return s +func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { + return &TooManyTagsException{ + respMetadata: v, + } } -// SetBlobId sets the BlobId field's value. -func (s *SymbolicLink) SetBlobId(v string) *SymbolicLink { - s.BlobId = &v - return s +// Code returns the exception type name. +func (s TooManyTagsException) Code() string { + return "TooManyTagsException" } -// SetFileMode sets the FileMode field's value. -func (s *SymbolicLink) SetFileMode(v string) *SymbolicLink { - s.FileMode = &v - return s +// Message returns the exception's message. +func (s TooManyTagsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetRelativePath sets the RelativePath field's value. -func (s *SymbolicLink) SetRelativePath(v string) *SymbolicLink { - s.RelativePath = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTagsException) OrigErr() error { + return nil } -type TagResourceInput struct { +func (s TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTagsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyTagsException) RequestID() string { + return s.respMetadata.RequestID +} + +type UntagResourceInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the resource to which you want to add or - // update tags. + // The Amazon Resource Name (ARN) of the resource to which you want to remove + // tags. // // ResourceArn is a required field ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"` - // The key-value pair to use when tagging this repository. + // The tag key for each tag that you want to remove from the resource. // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" required:"true"` + // TagKeys is a required field + TagKeys []*string `locationName:"tagKeys" type:"list" required:"true"` } // String returns the string representation -func (s TagResourceInput) String() string { +func (s UntagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TagResourceInput) GoString() string { +func (s UntagResourceInput) 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"} +func (s *UntagResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} if s.ResourceArn == nil { invalidParams.Add(request.NewErrParamRequired("ResourceArn")) } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) + if s.TagKeys == nil { + invalidParams.Add(request.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { @@ -15950,72 +30913,75 @@ func (s *TagResourceInput) Validate() error { } // SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { +func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { s.ResourceArn = &v return s } -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v +// SetTagKeys sets the TagKeys field's value. +func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { + s.TagKeys = v return s } -type TagResourceOutput struct { +type UntagResourceOutput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s TagResourceOutput) String() string { +func (s UntagResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TagResourceOutput) GoString() string { +func (s UntagResourceOutput) GoString() string { return s.String() } -// Returns information about a target for a pull request. -type Target struct { +type UpdateApprovalRuleTemplateContentInput struct { _ struct{} `type:"structure"` - // The branch of the repository where the pull request changes will be merged - // into. Also known as the destination branch. - DestinationReference *string `locationName:"destinationReference" type:"string"` - - // The name of the repository that contains the pull request. + // The name of the approval rule template where you want to update the content + // of the rule. // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + // ApprovalRuleTemplateName is a required field + ApprovalRuleTemplateName *string `locationName:"approvalRuleTemplateName" min:"1" type:"string" required:"true"` - // The branch of the repository that contains the changes for the pull request. - // Also known as the source branch. + // The SHA-256 hash signature for the content of the approval rule. You can + // retrieve this information by using GetPullRequest. + ExistingRuleContentSha256 *string `locationName:"existingRuleContentSha256" type:"string"` + + // The content that replaces the existing content of the rule. Content statements + // must be complete. You cannot provide only the changes. // - // SourceReference is a required field - SourceReference *string `locationName:"sourceReference" type:"string" required:"true"` + // NewRuleContent is a required field + NewRuleContent *string `locationName:"newRuleContent" min:"1" type:"string" required:"true"` } // String returns the string representation -func (s Target) String() string { +func (s UpdateApprovalRuleTemplateContentInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Target) GoString() string { +func (s UpdateApprovalRuleTemplateContentInput) 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.RepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryName")) +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateApprovalRuleTemplateContentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateApprovalRuleTemplateContentInput"} + if s.ApprovalRuleTemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleTemplateName")) } - if s.RepositoryName != nil && len(*s.RepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RepositoryName", 1)) + if s.ApprovalRuleTemplateName != nil && len(*s.ApprovalRuleTemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApprovalRuleTemplateName", 1)) } - if s.SourceReference == nil { - invalidParams.Add(request.NewErrParamRequired("SourceReference")) + if s.NewRuleContent == nil { + invalidParams.Add(request.NewErrParamRequired("NewRuleContent")) + } + if s.NewRuleContent != nil && len(*s.NewRuleContent) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NewRuleContent", 1)) } if invalidParams.Len() > 0 { @@ -16024,70 +30990,84 @@ func (s *Target) Validate() error { return nil } -// SetDestinationReference sets the DestinationReference field's value. -func (s *Target) SetDestinationReference(v string) *Target { - s.DestinationReference = &v +// SetApprovalRuleTemplateName sets the ApprovalRuleTemplateName field's value. +func (s *UpdateApprovalRuleTemplateContentInput) SetApprovalRuleTemplateName(v string) *UpdateApprovalRuleTemplateContentInput { + s.ApprovalRuleTemplateName = &v return s } -// SetRepositoryName sets the RepositoryName field's value. -func (s *Target) SetRepositoryName(v string) *Target { - s.RepositoryName = &v +// SetExistingRuleContentSha256 sets the ExistingRuleContentSha256 field's value. +func (s *UpdateApprovalRuleTemplateContentInput) SetExistingRuleContentSha256(v string) *UpdateApprovalRuleTemplateContentInput { + s.ExistingRuleContentSha256 = &v return s } -// SetSourceReference sets the SourceReference field's value. -func (s *Target) SetSourceReference(v string) *Target { - s.SourceReference = &v +// SetNewRuleContent sets the NewRuleContent field's value. +func (s *UpdateApprovalRuleTemplateContentInput) SetNewRuleContent(v string) *UpdateApprovalRuleTemplateContentInput { + s.NewRuleContent = &v return s } -// Represents the input of a test repository triggers operation. -type TestRepositoryTriggersInput struct { +type UpdateApprovalRuleTemplateContentOutput struct { _ struct{} `type:"structure"` - // The name of the repository in which to test the triggers. + // Returns information about an approval rule template. // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"1" type:"string" required:"true"` + // ApprovalRuleTemplate is a required field + ApprovalRuleTemplate *ApprovalRuleTemplate `locationName:"approvalRuleTemplate" type:"structure" required:"true"` +} - // The list of triggers to test. +// String returns the string representation +func (s UpdateApprovalRuleTemplateContentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateApprovalRuleTemplateContentOutput) GoString() string { + return s.String() +} + +// SetApprovalRuleTemplate sets the ApprovalRuleTemplate field's value. +func (s *UpdateApprovalRuleTemplateContentOutput) SetApprovalRuleTemplate(v *ApprovalRuleTemplate) *UpdateApprovalRuleTemplateContentOutput { + s.ApprovalRuleTemplate = v + return s +} + +type UpdateApprovalRuleTemplateDescriptionInput struct { + _ struct{} `type:"structure"` + + // The updated description of the approval rule template. // - // Triggers is a required field - Triggers []*RepositoryTrigger `locationName:"triggers" type:"list" required:"true"` + // ApprovalRuleTemplateDescription is a required field + ApprovalRuleTemplateDescription *string `locationName:"approvalRuleTemplateDescription" type:"string" required:"true"` + + // The name of the template for which you want to update the description. + // + // ApprovalRuleTemplateName is a required field + ApprovalRuleTemplateName *string `locationName:"approvalRuleTemplateName" min:"1" type:"string" required:"true"` } // String returns the string representation -func (s TestRepositoryTriggersInput) String() string { +func (s UpdateApprovalRuleTemplateDescriptionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TestRepositoryTriggersInput) GoString() string { +func (s UpdateApprovalRuleTemplateDescriptionInput) 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)) +func (s *UpdateApprovalRuleTemplateDescriptionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateApprovalRuleTemplateDescriptionInput"} + if s.ApprovalRuleTemplateDescription == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleTemplateDescription")) } - if s.Triggers == nil { - invalidParams.Add(request.NewErrParamRequired("Triggers")) + if s.ApprovalRuleTemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleTemplateName")) } - 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 s.ApprovalRuleTemplateName != nil && len(*s.ApprovalRuleTemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApprovalRuleTemplateName", 1)) } if invalidParams.Len() > 0 { @@ -16096,86 +31076,81 @@ func (s *TestRepositoryTriggersInput) Validate() error { return nil } -// SetRepositoryName sets the RepositoryName field's value. -func (s *TestRepositoryTriggersInput) SetRepositoryName(v string) *TestRepositoryTriggersInput { - s.RepositoryName = &v +// SetApprovalRuleTemplateDescription sets the ApprovalRuleTemplateDescription field's value. +func (s *UpdateApprovalRuleTemplateDescriptionInput) SetApprovalRuleTemplateDescription(v string) *UpdateApprovalRuleTemplateDescriptionInput { + s.ApprovalRuleTemplateDescription = &v return s } -// SetTriggers sets the Triggers field's value. -func (s *TestRepositoryTriggersInput) SetTriggers(v []*RepositoryTrigger) *TestRepositoryTriggersInput { - s.Triggers = v +// SetApprovalRuleTemplateName sets the ApprovalRuleTemplateName field's value. +func (s *UpdateApprovalRuleTemplateDescriptionInput) SetApprovalRuleTemplateName(v string) *UpdateApprovalRuleTemplateDescriptionInput { + s.ApprovalRuleTemplateName = &v return s } -// Represents the output of a test repository triggers operation. -type TestRepositoryTriggersOutput struct { +type UpdateApprovalRuleTemplateDescriptionOutput 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"` + // The structure and content of the updated approval rule template. + // + // ApprovalRuleTemplate is a required field + ApprovalRuleTemplate *ApprovalRuleTemplate `locationName:"approvalRuleTemplate" type:"structure" required:"true"` } // String returns the string representation -func (s TestRepositoryTriggersOutput) String() string { +func (s UpdateApprovalRuleTemplateDescriptionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TestRepositoryTriggersOutput) GoString() string { +func (s UpdateApprovalRuleTemplateDescriptionOutput) 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 +// SetApprovalRuleTemplate sets the ApprovalRuleTemplate field's value. +func (s *UpdateApprovalRuleTemplateDescriptionOutput) SetApprovalRuleTemplate(v *ApprovalRuleTemplate) *UpdateApprovalRuleTemplateDescriptionOutput { + s.ApprovalRuleTemplate = v return s } -type UntagResourceInput struct { +type UpdateApprovalRuleTemplateNameInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the resource to which you want to remove - // tags. + // The new name you want to apply to the approval rule template. // - // ResourceArn is a required field - ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"` + // NewApprovalRuleTemplateName is a required field + NewApprovalRuleTemplateName *string `locationName:"newApprovalRuleTemplateName" min:"1" type:"string" required:"true"` - // The tag key for each tag that you want to remove from the resource. + // The current name of the approval rule template. // - // TagKeys is a required field - TagKeys []*string `locationName:"tagKeys" type:"list" required:"true"` + // OldApprovalRuleTemplateName is a required field + OldApprovalRuleTemplateName *string `locationName:"oldApprovalRuleTemplateName" min:"1" type:"string" required:"true"` } // String returns the string representation -func (s UntagResourceInput) String() string { +func (s UpdateApprovalRuleTemplateNameInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UntagResourceInput) GoString() string { +func (s UpdateApprovalRuleTemplateNameInput) 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")) +func (s *UpdateApprovalRuleTemplateNameInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateApprovalRuleTemplateNameInput"} + if s.NewApprovalRuleTemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("NewApprovalRuleTemplateName")) } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) + if s.NewApprovalRuleTemplateName != nil && len(*s.NewApprovalRuleTemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NewApprovalRuleTemplateName", 1)) + } + if s.OldApprovalRuleTemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("OldApprovalRuleTemplateName")) + } + if s.OldApprovalRuleTemplateName != nil && len(*s.OldApprovalRuleTemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OldApprovalRuleTemplateName", 1)) } if invalidParams.Len() > 0 { @@ -16184,32 +31159,43 @@ func (s *UntagResourceInput) Validate() error { return nil } -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v +// SetNewApprovalRuleTemplateName sets the NewApprovalRuleTemplateName field's value. +func (s *UpdateApprovalRuleTemplateNameInput) SetNewApprovalRuleTemplateName(v string) *UpdateApprovalRuleTemplateNameInput { + s.NewApprovalRuleTemplateName = &v return s } -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v +// SetOldApprovalRuleTemplateName sets the OldApprovalRuleTemplateName field's value. +func (s *UpdateApprovalRuleTemplateNameInput) SetOldApprovalRuleTemplateName(v string) *UpdateApprovalRuleTemplateNameInput { + s.OldApprovalRuleTemplateName = &v return s } -type UntagResourceOutput struct { +type UpdateApprovalRuleTemplateNameOutput struct { _ struct{} `type:"structure"` + + // The structure and content of the updated approval rule template. + // + // ApprovalRuleTemplate is a required field + ApprovalRuleTemplate *ApprovalRuleTemplate `locationName:"approvalRuleTemplate" type:"structure" required:"true"` } // String returns the string representation -func (s UntagResourceOutput) String() string { +func (s UpdateApprovalRuleTemplateNameOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UntagResourceOutput) GoString() string { +func (s UpdateApprovalRuleTemplateNameOutput) GoString() string { return s.String() } +// SetApprovalRuleTemplate sets the ApprovalRuleTemplate field's value. +func (s *UpdateApprovalRuleTemplateNameOutput) SetApprovalRuleTemplate(v *ApprovalRuleTemplate) *UpdateApprovalRuleTemplateNameOutput { + s.ApprovalRuleTemplate = v + return s +} + type UpdateCommentInput struct { _ struct{} `type:"structure"` @@ -16219,8 +31205,7 @@ type UpdateCommentInput struct { // CommentId is a required field CommentId *string `locationName:"commentId" type:"string" required:"true"` - // The updated content with which you want to replace the existing content of - // the comment. + // The updated content to replace the existing content of the comment. // // Content is a required field Content *string `locationName:"content" type:"string" required:"true"` @@ -16360,11 +31345,220 @@ func (s UpdateDefaultBranchOutput) GoString() string { return s.String() } +type UpdatePullRequestApprovalRuleContentInput struct { + _ struct{} `type:"structure"` + + // The name of the approval rule you want to update. + // + // ApprovalRuleName is a required field + ApprovalRuleName *string `locationName:"approvalRuleName" min:"1" type:"string" required:"true"` + + // The SHA-256 hash signature for the content of the approval rule. You can + // retrieve this information by using GetPullRequest. + ExistingRuleContentSha256 *string `locationName:"existingRuleContentSha256" type:"string"` + + // The updated content for the approval rule. + // + // When you update the content of the approval rule, you can specify approvers + // in an approval pool in one of two ways: + // + // * CodeCommitApprovers: This option only requires an AWS account and a + // resource. It can be used for both IAM users and federated access users + // whose name matches the provided resource name. This is a very powerful + // option that offers a great deal of flexibility. For example, if you specify + // the AWS account 123456789012 and Mary_Major, all of the following are + // counted as approvals coming from that user: An IAM user in the account + // (arn:aws:iam::123456789012:user/Mary_Major) A federated user identified + // in IAM as Mary_Major (arn:aws:sts::123456789012:federated-user/Mary_Major) + // This option does not recognize an active session of someone assuming the + // role of CodeCommitReview with a role session name of Mary_Major (arn:aws:sts::123456789012:assumed-role/CodeCommitReview/Mary_Major) + // unless you include a wildcard (*Mary_Major). + // + // * Fully qualified ARN: This option allows you to specify the fully qualified + // Amazon Resource Name (ARN) of the IAM user or role. + // + // For more information about IAM ARNs, wildcards, and formats, see IAM Identifiers + // (https://docs.aws.amazon.com/iam/latest/UserGuide/reference_identifiers.html) + // in the IAM User Guide. + // + // NewRuleContent is a required field + NewRuleContent *string `locationName:"newRuleContent" min:"1" type:"string" required:"true"` + + // The system-generated ID of the pull request. + // + // PullRequestId is a required field + PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdatePullRequestApprovalRuleContentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdatePullRequestApprovalRuleContentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdatePullRequestApprovalRuleContentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdatePullRequestApprovalRuleContentInput"} + if s.ApprovalRuleName == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalRuleName")) + } + if s.ApprovalRuleName != nil && len(*s.ApprovalRuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApprovalRuleName", 1)) + } + if s.NewRuleContent == nil { + invalidParams.Add(request.NewErrParamRequired("NewRuleContent")) + } + if s.NewRuleContent != nil && len(*s.NewRuleContent) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NewRuleContent", 1)) + } + if s.PullRequestId == nil { + invalidParams.Add(request.NewErrParamRequired("PullRequestId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApprovalRuleName sets the ApprovalRuleName field's value. +func (s *UpdatePullRequestApprovalRuleContentInput) SetApprovalRuleName(v string) *UpdatePullRequestApprovalRuleContentInput { + s.ApprovalRuleName = &v + return s +} + +// SetExistingRuleContentSha256 sets the ExistingRuleContentSha256 field's value. +func (s *UpdatePullRequestApprovalRuleContentInput) SetExistingRuleContentSha256(v string) *UpdatePullRequestApprovalRuleContentInput { + s.ExistingRuleContentSha256 = &v + return s +} + +// SetNewRuleContent sets the NewRuleContent field's value. +func (s *UpdatePullRequestApprovalRuleContentInput) SetNewRuleContent(v string) *UpdatePullRequestApprovalRuleContentInput { + s.NewRuleContent = &v + return s +} + +// SetPullRequestId sets the PullRequestId field's value. +func (s *UpdatePullRequestApprovalRuleContentInput) SetPullRequestId(v string) *UpdatePullRequestApprovalRuleContentInput { + s.PullRequestId = &v + return s +} + +type UpdatePullRequestApprovalRuleContentOutput struct { + _ struct{} `type:"structure"` + + // Information about the updated approval rule. + // + // ApprovalRule is a required field + ApprovalRule *ApprovalRule `locationName:"approvalRule" type:"structure" required:"true"` +} + +// String returns the string representation +func (s UpdatePullRequestApprovalRuleContentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdatePullRequestApprovalRuleContentOutput) GoString() string { + return s.String() +} + +// SetApprovalRule sets the ApprovalRule field's value. +func (s *UpdatePullRequestApprovalRuleContentOutput) SetApprovalRule(v *ApprovalRule) *UpdatePullRequestApprovalRuleContentOutput { + s.ApprovalRule = v + return s +} + +type UpdatePullRequestApprovalStateInput struct { + _ struct{} `type:"structure"` + + // The approval state to associate with the user on the pull request. + // + // ApprovalState is a required field + ApprovalState *string `locationName:"approvalState" type:"string" required:"true" enum:"ApprovalState"` + + // The system-generated ID of the pull request. + // + // PullRequestId is a required field + PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` + + // The system-generated ID of the revision. + // + // RevisionId is a required field + RevisionId *string `locationName:"revisionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdatePullRequestApprovalStateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdatePullRequestApprovalStateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdatePullRequestApprovalStateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdatePullRequestApprovalStateInput"} + if s.ApprovalState == nil { + invalidParams.Add(request.NewErrParamRequired("ApprovalState")) + } + if s.PullRequestId == nil { + invalidParams.Add(request.NewErrParamRequired("PullRequestId")) + } + if s.RevisionId == nil { + invalidParams.Add(request.NewErrParamRequired("RevisionId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApprovalState sets the ApprovalState field's value. +func (s *UpdatePullRequestApprovalStateInput) SetApprovalState(v string) *UpdatePullRequestApprovalStateInput { + s.ApprovalState = &v + return s +} + +// SetPullRequestId sets the PullRequestId field's value. +func (s *UpdatePullRequestApprovalStateInput) SetPullRequestId(v string) *UpdatePullRequestApprovalStateInput { + s.PullRequestId = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *UpdatePullRequestApprovalStateInput) SetRevisionId(v string) *UpdatePullRequestApprovalStateInput { + s.RevisionId = &v + return s +} + +type UpdatePullRequestApprovalStateOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdatePullRequestApprovalStateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdatePullRequestApprovalStateOutput) GoString() string { + return s.String() +} + type UpdatePullRequestDescriptionInput struct { _ struct{} `type:"structure"` // The updated content of the description for the pull request. This content - // will replace the existing description. + // replaces the existing description. // // Description is a required field Description *string `locationName:"description" type:"string" required:"true"` @@ -16447,7 +31641,7 @@ type UpdatePullRequestStatusInput struct { PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` // The status of the pull request. The only valid operations are to update the - // status from OPEN to OPEN, OPEN to CLOSED or from from CLOSED to CLOSED. + // status from OPEN to OPEN, OPEN to CLOSED or from CLOSED to CLOSED. // // PullRequestStatus is a required field PullRequestStatus *string `locationName:"pullRequestStatus" type:"string" required:"true" enum:"PullRequestStatusEnum"` @@ -16524,7 +31718,7 @@ type UpdatePullRequestTitleInput struct { // PullRequestId is a required field PullRequestId *string `locationName:"pullRequestId" type:"string" required:"true"` - // The updated title of the pull request. This will replace the existing title. + // The updated title of the pull request. This replaces the existing title. // // Title is a required field Title *string `locationName:"title" type:"string" required:"true"` @@ -16668,7 +31862,7 @@ type UpdateRepositoryNameInput struct { // NewName is a required field NewName *string `locationName:"newName" min:"1" type:"string" required:"true"` - // The existing name of the repository. + // The current name of the repository. // // OldName is a required field OldName *string `locationName:"oldName" min:"1" type:"string" required:"true"` @@ -16775,6 +31969,14 @@ func (s *UserInfo) SetName(v string) *UserInfo { return s } +const ( + // ApprovalStateApprove is a ApprovalState enum value + ApprovalStateApprove = "APPROVE" + + // ApprovalStateRevoke is a ApprovalState enum value + ApprovalStateRevoke = "REVOKE" +) + const ( // ChangeTypeEnumA is a ChangeTypeEnum enum value ChangeTypeEnumA = "A" @@ -16852,6 +32054,14 @@ const ( OrderEnumDescending = "descending" ) +const ( + // OverrideStatusOverride is a OverrideStatus enum value + OverrideStatusOverride = "OVERRIDE" + + // OverrideStatusRevoke is a OverrideStatus enum value + OverrideStatusRevoke = "REVOKE" +) + const ( // PullRequestEventTypePullRequestCreated is a PullRequestEventType enum value PullRequestEventTypePullRequestCreated = "PULL_REQUEST_CREATED" @@ -16864,6 +32074,21 @@ const ( // PullRequestEventTypePullRequestMergeStateChanged is a PullRequestEventType enum value PullRequestEventTypePullRequestMergeStateChanged = "PULL_REQUEST_MERGE_STATE_CHANGED" + + // PullRequestEventTypePullRequestApprovalRuleCreated is a PullRequestEventType enum value + PullRequestEventTypePullRequestApprovalRuleCreated = "PULL_REQUEST_APPROVAL_RULE_CREATED" + + // PullRequestEventTypePullRequestApprovalRuleUpdated is a PullRequestEventType enum value + PullRequestEventTypePullRequestApprovalRuleUpdated = "PULL_REQUEST_APPROVAL_RULE_UPDATED" + + // PullRequestEventTypePullRequestApprovalRuleDeleted is a PullRequestEventType enum value + PullRequestEventTypePullRequestApprovalRuleDeleted = "PULL_REQUEST_APPROVAL_RULE_DELETED" + + // PullRequestEventTypePullRequestApprovalRuleOverridden is a PullRequestEventType enum value + PullRequestEventTypePullRequestApprovalRuleOverridden = "PULL_REQUEST_APPROVAL_RULE_OVERRIDDEN" + + // PullRequestEventTypePullRequestApprovalStateChanged is a PullRequestEventType enum value + PullRequestEventTypePullRequestApprovalStateChanged = "PULL_REQUEST_APPROVAL_STATE_CHANGED" ) const ( diff --git a/vendor/github.com/aws/aws-sdk-go/service/codecommit/doc.go b/vendor/github.com/aws/aws-sdk-go/service/codecommit/doc.go index 9ee44edfbe4..2025f901bd5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codecommit/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codecommit/doc.go @@ -27,12 +27,12 @@ // 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. +// change the name of a repository, no other users of that repository can +// 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. +// * CreateBranch, which creates a branch in a specified repository. // // * DeleteBranch, which deletes the specified branch in a repository unless // it is the default branch. @@ -49,7 +49,7 @@ // branch. // // * GetBlob, which returns the base-64 encoded content of an individual -// Git blob object within a repository. +// Git blob object in a repository. // // * GetFile, which returns the base-64 encoded content of a specified file. // @@ -61,7 +61,7 @@ // Commits, by calling the following: // // * BatchGetCommits, which returns information about one or more commits -// in a repository +// in a repository. // // * CreateCommit, which creates a commit for changes to a repository. // @@ -69,7 +69,7 @@ // 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 +// valid commit specifier (such as a branch, tag, HEAD, commit ID, or other // fully qualified reference). // // Merges, by calling the following: @@ -107,14 +107,31 @@ // // * CreatePullRequest, which creates a pull request in a specified repository. // +// * CreatePullRequestApprovalRule, which creates an approval rule for a +// specified pull request. +// +// * DeletePullRequestApprovalRule, which deletes an approval rule for a +// specified pull request. +// // * DescribePullRequestEvents, which returns information about one or more // pull request events. // +// * EvaluatePullRequestApprovalRules, which evaluates whether a pull request +// has met all the conditions specified in its associated approval rules. +// // * GetCommentsForPullRequest, which returns information about comments // on a specified pull request. // // * GetPullRequest, which returns information about a specified pull request. // +// * GetPullRequestApprovalStates, which returns information about the approval +// states for a specified pull request. +// +// * GetPullRequestOverrideState, which returns information about whether +// approval rules have been set aside (overriden) for a pull request, and +// if so, the Amazon Resource Name (ARN) of the user or identity that overrode +// the rules and their requirements for the pull request. +// // * ListPullRequests, which lists all pull requests for a repository. // // * MergePullRequestByFastForward, which merges the source destination branch @@ -129,9 +146,18 @@ // of a pull request into the specified destination branch for that pull // request using the three-way merge option. // +// * OverridePullRequestApprovalRules, which sets aside all approval rule +// requirements for a pull request. +// // * PostCommentForPullRequest, which posts a comment to a pull request at // the specified line, file, or request. // +// * UpdatePullRequestApprovalRuleContent, which updates the structure of +// an approval rule for a pull request. +// +// * UpdatePullRequestApprovalState, which updates the state of an approval +// on a pull request. +// // * UpdatePullRequestDescription, which updates the description of a pull // request. // @@ -139,6 +165,58 @@ // // * UpdatePullRequestTitle, which updates the title of a pull request. // +// Approval rule templates, by calling the following: +// +// * AssociateApprovalRuleTemplateWithRepository, which associates a template +// with a specified repository. After the template is associated with a repository, +// AWS CodeCommit creates approval rules that match the template conditions +// on every pull request created in the specified repository. +// +// * BatchAssociateApprovalRuleTemplateWithRepositories, which associates +// a template with one or more specified repositories. After the template +// is associated with a repository, AWS CodeCommit creates approval rules +// that match the template conditions on every pull request created in the +// specified repositories. +// +// * BatchDisassociateApprovalRuleTemplateFromRepositories, which removes +// the association between a template and specified repositories so that +// approval rules based on the template are not automatically created when +// pull requests are created in those repositories. +// +// * CreateApprovalRuleTemplate, which creates a template for approval rules +// that can then be associated with one or more repositories in your AWS +// account. +// +// * DeleteApprovalRuleTemplate, which deletes the specified template. It +// does not remove approval rules on pull requests already created with the +// template. +// +// * DisassociateApprovalRuleTemplateFromRepository, which removes the association +// between a template and a repository so that approval rules based on the +// template are not automatically created when pull requests are created +// in the specified repository. +// +// * GetApprovalRuleTemplate, which returns information about an approval +// rule template. +// +// * ListApprovalRuleTemplates, which lists all approval rule templates in +// the AWS Region in your AWS account. +// +// * ListAssociatedApprovalRuleTemplatesForRepository, which lists all approval +// rule templates that are associated with a specified repository. +// +// * ListRepositoriesForApprovalRuleTemplate, which lists all repositories +// associated with the specified approval rule template. +// +// * UpdateApprovalRuleTemplateDescription, which updates the description +// of an approval rule template. +// +// * UpdateApprovalRuleTemplateName, which updates the name of an approval +// rule template. +// +// * UpdateApprovalRuleTemplateContent, which updates the content of an approval +// rule template. +// // Comments in a repository, by calling the following: // // * DeleteCommentContent, which deletes the content of a comment on a commit 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 index 210448016d7..030dd1c47bf 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codecommit/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codecommit/errors.go @@ -2,6 +2,10 @@ package codecommit +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeActorDoesNotExistException for service response error code @@ -10,6 +14,75 @@ const ( // The specified Amazon Resource Name (ARN) does not exist in the AWS account. ErrCodeActorDoesNotExistException = "ActorDoesNotExistException" + // ErrCodeApprovalRuleContentRequiredException for service response error code + // "ApprovalRuleContentRequiredException". + // + // The content for the approval rule is empty. You must provide some content + // for an approval rule. The content cannot be null. + ErrCodeApprovalRuleContentRequiredException = "ApprovalRuleContentRequiredException" + + // ErrCodeApprovalRuleDoesNotExistException for service response error code + // "ApprovalRuleDoesNotExistException". + // + // The specified approval rule does not exist. + ErrCodeApprovalRuleDoesNotExistException = "ApprovalRuleDoesNotExistException" + + // ErrCodeApprovalRuleNameAlreadyExistsException for service response error code + // "ApprovalRuleNameAlreadyExistsException". + // + // An approval rule with that name already exists. Approval rule names must + // be unique within the scope of a pull request. + ErrCodeApprovalRuleNameAlreadyExistsException = "ApprovalRuleNameAlreadyExistsException" + + // ErrCodeApprovalRuleNameRequiredException for service response error code + // "ApprovalRuleNameRequiredException". + // + // An approval rule name is required, but was not specified. + ErrCodeApprovalRuleNameRequiredException = "ApprovalRuleNameRequiredException" + + // ErrCodeApprovalRuleTemplateContentRequiredException for service response error code + // "ApprovalRuleTemplateContentRequiredException". + // + // The content for the approval rule template is empty. You must provide some + // content for an approval rule template. The content cannot be null. + ErrCodeApprovalRuleTemplateContentRequiredException = "ApprovalRuleTemplateContentRequiredException" + + // ErrCodeApprovalRuleTemplateDoesNotExistException for service response error code + // "ApprovalRuleTemplateDoesNotExistException". + // + // The specified approval rule template does not exist. Verify that the name + // is correct and that you are signed in to the AWS Region where the template + // was created, and then try again. + ErrCodeApprovalRuleTemplateDoesNotExistException = "ApprovalRuleTemplateDoesNotExistException" + + // ErrCodeApprovalRuleTemplateInUseException for service response error code + // "ApprovalRuleTemplateInUseException". + // + // The approval rule template is associated with one or more repositories. You + // cannot delete a template that is associated with a repository. Remove all + // associations, and then try again. + ErrCodeApprovalRuleTemplateInUseException = "ApprovalRuleTemplateInUseException" + + // ErrCodeApprovalRuleTemplateNameAlreadyExistsException for service response error code + // "ApprovalRuleTemplateNameAlreadyExistsException". + // + // You cannot create an approval rule template with that name because a template + // with that name already exists in this AWS Region for your AWS account. Approval + // rule template names must be unique. + ErrCodeApprovalRuleTemplateNameAlreadyExistsException = "ApprovalRuleTemplateNameAlreadyExistsException" + + // ErrCodeApprovalRuleTemplateNameRequiredException for service response error code + // "ApprovalRuleTemplateNameRequiredException". + // + // An approval rule template name is required, but was not specified. + ErrCodeApprovalRuleTemplateNameRequiredException = "ApprovalRuleTemplateNameRequiredException" + + // ErrCodeApprovalStateRequiredException for service response error code + // "ApprovalStateRequiredException". + // + // An approval state is required, but was not specified. + ErrCodeApprovalStateRequiredException = "ApprovalStateRequiredException" + // ErrCodeAuthorDoesNotExistException for service response error code // "AuthorDoesNotExistException". // @@ -32,7 +105,7 @@ const ( // ErrCodeBlobIdRequiredException for service response error code // "BlobIdRequiredException". // - // A blob ID is required but was not specified. + // A blob ID is required, but was not specified. ErrCodeBlobIdRequiredException = "BlobIdRequiredException" // ErrCodeBranchDoesNotExistException for service response error code @@ -50,25 +123,39 @@ const ( // ErrCodeBranchNameIsTagNameException for service response error code // "BranchNameIsTagNameException". // - // The specified branch name is not valid because it is a tag name. Type the - // name of a current branch in the repository. For a list of valid branch names, - // use ListBranches. + // The specified branch name is not valid because it is a tag name. Enter the + // name of a branch in the repository. For a list of valid branch names, use + // ListBranches. ErrCodeBranchNameIsTagNameException = "BranchNameIsTagNameException" // ErrCodeBranchNameRequiredException for service response error code // "BranchNameRequiredException". // - // A branch name is required but was not specified. + // A branch name is required, but was not specified. ErrCodeBranchNameRequiredException = "BranchNameRequiredException" + // ErrCodeCannotDeleteApprovalRuleFromTemplateException for service response error code + // "CannotDeleteApprovalRuleFromTemplateException". + // + // The approval rule cannot be deleted from the pull request because it was + // created by an approval rule template and applied to the pull request automatically. + ErrCodeCannotDeleteApprovalRuleFromTemplateException = "CannotDeleteApprovalRuleFromTemplateException" + + // ErrCodeCannotModifyApprovalRuleFromTemplateException for service response error code + // "CannotModifyApprovalRuleFromTemplateException". + // + // The approval rule cannot be modified for the pull request because it was + // created by an approval rule template and applied to the pull request automatically. + ErrCodeCannotModifyApprovalRuleFromTemplateException = "CannotModifyApprovalRuleFromTemplateException" + // ErrCodeClientRequestTokenRequiredException for service response error code // "ClientRequestTokenRequiredException". // // A client request token is required. A client request token is an unique, - // client-generated idempotency token that when provided in a request, ensures + // client-generated idempotency token that, when provided in a request, ensures // the request cannot be repeated with a changed parameter. If a request is - // received with the same parameters and a token is included, the request will - // return information about the initial request that used that token. + // received with the same parameters and a token is included, the request returns + // information about the initial request that used that token. ErrCodeClientRequestTokenRequiredException = "ClientRequestTokenRequiredException" // ErrCodeCommentContentRequiredException for service response error code @@ -94,8 +181,8 @@ const ( // ErrCodeCommentDoesNotExistException for service response error code // "CommentDoesNotExistException". // - // No comment exists with the provided ID. Verify that you have provided the - // correct ID, and then try again. + // No comment exists with the provided ID. Verify that you have used the correct + // ID, and then try again. ErrCodeCommentDoesNotExistException = "CommentDoesNotExistException" // ErrCodeCommentIdRequiredException for service response error code @@ -140,6 +227,9 @@ const ( // ErrCodeCommitIdsListRequiredException for service response error code // "CommitIdsListRequiredException". + // + // A list of commit IDs is required, but was either not specified or the list + // was empty. ErrCodeCommitIdsListRequiredException = "CommitIdsListRequiredException" // ErrCodeCommitMessageLengthExceededException for service response error code @@ -214,7 +304,7 @@ const ( // // The commit cannot be created because both a source file and file content // have been specified for the same file. You cannot provide both. Either specify - // a source file, or provide the file content directly. + // a source file or provide the file content directly. ErrCodeFileContentAndSourceFileSpecifiedException = "FileContentAndSourceFileSpecifiedException" // ErrCodeFileContentRequiredException for service response error code @@ -227,16 +317,16 @@ const ( // ErrCodeFileContentSizeLimitExceededException for service response error code // "FileContentSizeLimitExceededException". // - // The file cannot be added because it is too large. The maximum file size that - // can be added is 6 MB, and the combined file content change size is 7 MB. - // Consider making these changes using a Git client. + // The file cannot be added because it is too large. The maximum file size is + // 6 MB, and the combined file content change size is 7 MB. Consider making + // these changes using a Git client. ErrCodeFileContentSizeLimitExceededException = "FileContentSizeLimitExceededException" // ErrCodeFileDoesNotExistException for service response error code // "FileDoesNotExistException". // - // The specified file does not exist. Verify that you have provided the correct - // name of the file, including its full path and extension. + // The specified file does not exist. Verify that you have used the correct + // file name, full path, and extension. ErrCodeFileDoesNotExistException = "FileDoesNotExistException" // ErrCodeFileEntryRequiredException for service response error code @@ -249,8 +339,8 @@ const ( // ErrCodeFileModeRequiredException for service response error code // "FileModeRequiredException". // - // The commit cannot be created because a file mode is required to update mode - // permissions for an existing file, but no file mode has been specified. + // The commit cannot be created because no file mode has been specified. A file + // mode is required to update mode permissions for a file. ErrCodeFileModeRequiredException = "FileModeRequiredException" // ErrCodeFileNameConflictsWithDirectoryNameException for service response error code @@ -291,14 +381,14 @@ const ( // "FolderDoesNotExistException". // // The specified folder does not exist. Either the folder name is not correct, - // or you did not provide the full path to the folder. + // or you did not enter the full path to the folder. ErrCodeFolderDoesNotExistException = "FolderDoesNotExistException" // ErrCodeIdempotencyParameterMismatchException for service response error code // "IdempotencyParameterMismatchException". // // The client request token is not valid. Either the token is not in a valid - // format, or the token has been used in a previous request and cannot be re-used. + // format, or the token has been used in a previous request and cannot be reused. ErrCodeIdempotencyParameterMismatchException = "IdempotencyParameterMismatchException" // ErrCodeInvalidActorArnException for service response error code @@ -309,6 +399,47 @@ const ( // and then try again. ErrCodeInvalidActorArnException = "InvalidActorArnException" + // ErrCodeInvalidApprovalRuleContentException for service response error code + // "InvalidApprovalRuleContentException". + // + // The content for the approval rule is not valid. + ErrCodeInvalidApprovalRuleContentException = "InvalidApprovalRuleContentException" + + // ErrCodeInvalidApprovalRuleNameException for service response error code + // "InvalidApprovalRuleNameException". + // + // The name for the approval rule is not valid. + ErrCodeInvalidApprovalRuleNameException = "InvalidApprovalRuleNameException" + + // ErrCodeInvalidApprovalRuleTemplateContentException for service response error code + // "InvalidApprovalRuleTemplateContentException". + // + // The content of the approval rule template is not valid. + ErrCodeInvalidApprovalRuleTemplateContentException = "InvalidApprovalRuleTemplateContentException" + + // ErrCodeInvalidApprovalRuleTemplateDescriptionException for service response error code + // "InvalidApprovalRuleTemplateDescriptionException". + // + // The description for the approval rule template is not valid because it exceeds + // the maximum characters allowed for a description. For more information about + // limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). + ErrCodeInvalidApprovalRuleTemplateDescriptionException = "InvalidApprovalRuleTemplateDescriptionException" + + // ErrCodeInvalidApprovalRuleTemplateNameException for service response error code + // "InvalidApprovalRuleTemplateNameException". + // + // The name of the approval rule template is not valid. Template names must + // be between 1 and 100 valid characters in length. For more information about + // limits in AWS CodeCommit, see AWS CodeCommit User Guide (https://docs.aws.amazon.com/codecommit/latest/userguide/limits.html). + ErrCodeInvalidApprovalRuleTemplateNameException = "InvalidApprovalRuleTemplateNameException" + + // ErrCodeInvalidApprovalStateException for service response error code + // "InvalidApprovalStateException". + // + // The state for the approval is not valid. Valid values include APPROVE and + // REVOKE. + ErrCodeInvalidApprovalStateException = "InvalidApprovalStateException" + // ErrCodeInvalidAuthorArnException for service response error code // "InvalidAuthorArnException". // @@ -386,8 +517,8 @@ const ( // ErrCodeInvalidDescriptionException for service response error code // "InvalidDescriptionException". // - // The pull request description is not valid. Descriptions are limited to 1,000 - // characters in length. + // The pull request description is not valid. Descriptions cannot be more than + // 1,000 characters. ErrCodeInvalidDescriptionException = "InvalidDescriptionException" // ErrCodeInvalidDestinationCommitSpecifierException for service response error code @@ -408,8 +539,8 @@ const ( // ErrCodeInvalidFileLocationException for service response error code // "InvalidFileLocationException". // - // The location of the file is not valid. Make sure that you include the extension - // of the file as well as the file name. + // The location of the file is not valid. Make sure that you include the file + // name and extension. ErrCodeInvalidFileLocationException = "InvalidFileLocationException" // ErrCodeInvalidFileModeException for service response error code @@ -457,6 +588,12 @@ const ( // The specified sort order is not valid. ErrCodeInvalidOrderException = "InvalidOrderException" + // ErrCodeInvalidOverrideStatusException for service response error code + // "InvalidOverrideStatusException". + // + // The override status is not valid. Valid statuses are OVERRIDE and REVOKE. + ErrCodeInvalidOverrideStatusException = "InvalidOverrideStatusException" + // ErrCodeInvalidParentCommitIdException for service response error code // "InvalidParentCommitIdException". // @@ -503,7 +640,7 @@ const ( // "InvalidReferenceNameException". // // The specified reference name format is not valid. Reference names must conform - // to the Git references format, for example refs/heads/master. For more information, + // to the Git references format (for example, refs/heads/master). For more information, // see Git Internals - Git References (https://git-scm.com/book/en/v2/Git-Internals-Git-References) // or consult your Git documentation. ErrCodeInvalidReferenceNameException = "InvalidReferenceNameException" @@ -538,9 +675,9 @@ const ( // ErrCodeInvalidRepositoryNameException for service response error code // "InvalidRepositoryNameException". // - // At least one specified repository name is not valid. + // A specified repository name is not valid. // - // This exception only occurs when a specified repository name is not valid. + // This exception occurs only 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" @@ -581,8 +718,9 @@ const ( // 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. + // The AWS Region for the trigger target does not match the AWS Region for the + // repository. Triggers must be created in the same Region as the target for + // the trigger. ErrCodeInvalidRepositoryTriggerRegionException = "InvalidRepositoryTriggerRegionException" // ErrCodeInvalidResourceArnException for service response error code @@ -593,6 +731,18 @@ const ( // in the AWS CodeCommit User Guide. ErrCodeInvalidResourceArnException = "InvalidResourceArnException" + // ErrCodeInvalidRevisionIdException for service response error code + // "InvalidRevisionIdException". + // + // The revision ID is not valid. Use GetPullRequest to determine the value. + ErrCodeInvalidRevisionIdException = "InvalidRevisionIdException" + + // ErrCodeInvalidRuleContentSha256Exception for service response error code + // "InvalidRuleContentSha256Exception". + // + // The SHA-256 hash signature for the rule content is not valid. + ErrCodeInvalidRuleContentSha256Exception = "InvalidRuleContentSha256Exception" + // ErrCodeInvalidSortByException for service response error code // "InvalidSortByException". // @@ -690,10 +840,17 @@ const ( // ErrCodeMaximumItemsToCompareExceededException for service response error code // "MaximumItemsToCompareExceededException". // - // The maximum number of items to compare between the source or destination - // branches and the merge base has exceeded the maximum allowed. + // The number of items to compare between the source or destination branches + // and the merge base has exceeded the maximum allowed. ErrCodeMaximumItemsToCompareExceededException = "MaximumItemsToCompareExceededException" + // ErrCodeMaximumNumberOfApprovalsExceededException for service response error code + // "MaximumNumberOfApprovalsExceededException". + // + // The number of approvals required for the approval rule exceeds the maximum + // number allowed. + ErrCodeMaximumNumberOfApprovalsExceededException = "MaximumNumberOfApprovalsExceededException" + // ErrCodeMaximumOpenPullRequestsExceededException for service response error code // "MaximumOpenPullRequestsExceededException". // @@ -706,7 +863,7 @@ const ( // "MaximumRepositoryNamesExceededException". // // The maximum number of allowed repository names was exceeded. Currently, this - // number is 25. + // number is 100. ErrCodeMaximumRepositoryNamesExceededException = "MaximumRepositoryNamesExceededException" // ErrCodeMaximumRepositoryTriggersExceededException for service response error code @@ -715,6 +872,13 @@ const ( // The number of triggers allowed for the repository was exceeded. ErrCodeMaximumRepositoryTriggersExceededException = "MaximumRepositoryTriggersExceededException" + // ErrCodeMaximumRuleTemplatesAssociatedWithRepositoryException for service response error code + // "MaximumRuleTemplatesAssociatedWithRepositoryException". + // + // The maximum number of approval rule templates for a repository has been exceeded. + // You cannot associate more than 25 approval rule templates with a repository. + ErrCodeMaximumRuleTemplatesAssociatedWithRepositoryException = "MaximumRuleTemplatesAssociatedWithRepositoryException" + // ErrCodeMergeOptionRequiredException for service response error code // "MergeOptionRequiredException". // @@ -750,6 +914,33 @@ const ( // as a result of this commit. A commit must contain at least one change. ErrCodeNoChangeException = "NoChangeException" + // ErrCodeNumberOfRuleTemplatesExceededException for service response error code + // "NumberOfRuleTemplatesExceededException". + // + // The maximum number of approval rule templates has been exceeded for this + // AWS Region. + ErrCodeNumberOfRuleTemplatesExceededException = "NumberOfRuleTemplatesExceededException" + + // ErrCodeNumberOfRulesExceededException for service response error code + // "NumberOfRulesExceededException". + // + // The approval rule cannot be added. The pull request has the maximum number + // of approval rules associated with it. + ErrCodeNumberOfRulesExceededException = "NumberOfRulesExceededException" + + // ErrCodeOverrideAlreadySetException for service response error code + // "OverrideAlreadySetException". + // + // The pull request has already had its approval rules set to override. + ErrCodeOverrideAlreadySetException = "OverrideAlreadySetException" + + // ErrCodeOverrideStatusRequiredException for service response error code + // "OverrideStatusRequiredException". + // + // An override status is required, but no value was provided. Valid values include + // OVERRIDE and REVOKE. + ErrCodeOverrideStatusRequiredException = "OverrideStatusRequiredException" + // ErrCodeParentCommitDoesNotExistException for service response error code // "ParentCommitDoesNotExistException". // @@ -791,6 +982,21 @@ const ( // The pull request status cannot be updated because it is already closed. ErrCodePullRequestAlreadyClosedException = "PullRequestAlreadyClosedException" + // ErrCodePullRequestApprovalRulesNotSatisfiedException for service response error code + // "PullRequestApprovalRulesNotSatisfiedException". + // + // The pull request cannot be merged because one or more approval rules applied + // to the pull request have conditions that have not been met. + ErrCodePullRequestApprovalRulesNotSatisfiedException = "PullRequestApprovalRulesNotSatisfiedException" + + // ErrCodePullRequestCannotBeApprovedByAuthorException for service response error code + // "PullRequestCannotBeApprovedByAuthorException". + // + // The approval cannot be applied because the user approving the pull request + // matches the user who created the pull request. You cannot approve a pull + // request that you created. + ErrCodePullRequestCannotBeApprovedByAuthorException = "PullRequestCannotBeApprovedByAuthorException" + // ErrCodePullRequestDoesNotExistException for service response error code // "PullRequestDoesNotExistException". // @@ -838,7 +1044,7 @@ const ( // ErrCodeReplacementContentRequiredException for service response error code // "ReplacementContentRequiredException". // - // USE_NEW_CONTENT was specified but no replacement content has been provided. + // USE_NEW_CONTENT was specified, but no replacement content has been provided. ErrCodeReplacementContentRequiredException = "ReplacementContentRequiredException" // ErrCodeReplacementTypeRequiredException for service response error code @@ -868,13 +1074,13 @@ const ( // ErrCodeRepositoryNameRequiredException for service response error code // "RepositoryNameRequiredException". // - // A repository name is required but was not specified. + // 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. + // At least one repository name object is required, but was not specified. ErrCodeRepositoryNamesRequiredException = "RepositoryNamesRequiredException" // ErrCodeRepositoryNotAssociatedWithPullRequestException for service response error code @@ -888,33 +1094,33 @@ const ( // ErrCodeRepositoryTriggerBranchNameListRequiredException for service response error code // "RepositoryTriggerBranchNameListRequiredException". // - // At least one branch name is required but was not specified in the trigger + // 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 + // 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. + // 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. + // 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. + // The list of triggers for the repository is required, but was not specified. ErrCodeRepositoryTriggersListRequiredException = "RepositoryTriggersListRequiredException" // ErrCodeResourceArnRequiredException for service response error code @@ -933,6 +1139,19 @@ const ( // or moving a .gitkeep file. ErrCodeRestrictedSourceFileException = "RestrictedSourceFileException" + // ErrCodeRevisionIdRequiredException for service response error code + // "RevisionIdRequiredException". + // + // A revision ID is required, but was not provided. + ErrCodeRevisionIdRequiredException = "RevisionIdRequiredException" + + // ErrCodeRevisionNotCurrentException for service response error code + // "RevisionNotCurrentException". + // + // The revision ID provided in the request does not match the current revision + // ID. Use GetPullRequest to retrieve the current revision ID. + ErrCodeRevisionNotCurrentException = "RevisionNotCurrentException" + // ErrCodeSameFileContentException for service response error code // "SameFileContentException". // @@ -953,8 +1172,8 @@ const ( // ErrCodeSourceAndDestinationAreSameException for service response error code // "SourceAndDestinationAreSameException". // - // The source branch and the destination branch for the pull request are the - // same. You must specify different branches for the source and destination. + // The source branch and destination branch for the pull request are the same. + // You must specify different branches for the source and destination. ErrCodeSourceAndDestinationAreSameException = "SourceAndDestinationAreSameException" // ErrCodeSourceFileOrContentRequiredException for service response error code @@ -1024,3 +1243,187 @@ const ( // The maximum number of tags for an AWS CodeCommit resource has been exceeded. ErrCodeTooManyTagsException = "TooManyTagsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ActorDoesNotExistException": newErrorActorDoesNotExistException, + "ApprovalRuleContentRequiredException": newErrorApprovalRuleContentRequiredException, + "ApprovalRuleDoesNotExistException": newErrorApprovalRuleDoesNotExistException, + "ApprovalRuleNameAlreadyExistsException": newErrorApprovalRuleNameAlreadyExistsException, + "ApprovalRuleNameRequiredException": newErrorApprovalRuleNameRequiredException, + "ApprovalRuleTemplateContentRequiredException": newErrorApprovalRuleTemplateContentRequiredException, + "ApprovalRuleTemplateDoesNotExistException": newErrorApprovalRuleTemplateDoesNotExistException, + "ApprovalRuleTemplateInUseException": newErrorApprovalRuleTemplateInUseException, + "ApprovalRuleTemplateNameAlreadyExistsException": newErrorApprovalRuleTemplateNameAlreadyExistsException, + "ApprovalRuleTemplateNameRequiredException": newErrorApprovalRuleTemplateNameRequiredException, + "ApprovalStateRequiredException": newErrorApprovalStateRequiredException, + "AuthorDoesNotExistException": newErrorAuthorDoesNotExistException, + "BeforeCommitIdAndAfterCommitIdAreSameException": newErrorBeforeCommitIdAndAfterCommitIdAreSameException, + "BlobIdDoesNotExistException": newErrorBlobIdDoesNotExistException, + "BlobIdRequiredException": newErrorBlobIdRequiredException, + "BranchDoesNotExistException": newErrorBranchDoesNotExistException, + "BranchNameExistsException": newErrorBranchNameExistsException, + "BranchNameIsTagNameException": newErrorBranchNameIsTagNameException, + "BranchNameRequiredException": newErrorBranchNameRequiredException, + "CannotDeleteApprovalRuleFromTemplateException": newErrorCannotDeleteApprovalRuleFromTemplateException, + "CannotModifyApprovalRuleFromTemplateException": newErrorCannotModifyApprovalRuleFromTemplateException, + "ClientRequestTokenRequiredException": newErrorClientRequestTokenRequiredException, + "CommentContentRequiredException": newErrorCommentContentRequiredException, + "CommentContentSizeLimitExceededException": newErrorCommentContentSizeLimitExceededException, + "CommentDeletedException": newErrorCommentDeletedException, + "CommentDoesNotExistException": newErrorCommentDoesNotExistException, + "CommentIdRequiredException": newErrorCommentIdRequiredException, + "CommentNotCreatedByCallerException": newErrorCommentNotCreatedByCallerException, + "CommitDoesNotExistException": newErrorCommitDoesNotExistException, + "CommitIdDoesNotExistException": newErrorCommitIdDoesNotExistException, + "CommitIdRequiredException": newErrorCommitIdRequiredException, + "CommitIdsLimitExceededException": newErrorCommitIdsLimitExceededException, + "CommitIdsListRequiredException": newErrorCommitIdsListRequiredException, + "CommitMessageLengthExceededException": newErrorCommitMessageLengthExceededException, + "CommitRequiredException": newErrorCommitRequiredException, + "ConcurrentReferenceUpdateException": newErrorConcurrentReferenceUpdateException, + "DefaultBranchCannotBeDeletedException": newErrorDefaultBranchCannotBeDeletedException, + "DirectoryNameConflictsWithFileNameException": newErrorDirectoryNameConflictsWithFileNameException, + "EncryptionIntegrityChecksFailedException": newErrorEncryptionIntegrityChecksFailedException, + "EncryptionKeyAccessDeniedException": newErrorEncryptionKeyAccessDeniedException, + "EncryptionKeyDisabledException": newErrorEncryptionKeyDisabledException, + "EncryptionKeyNotFoundException": newErrorEncryptionKeyNotFoundException, + "EncryptionKeyUnavailableException": newErrorEncryptionKeyUnavailableException, + "FileContentAndSourceFileSpecifiedException": newErrorFileContentAndSourceFileSpecifiedException, + "FileContentRequiredException": newErrorFileContentRequiredException, + "FileContentSizeLimitExceededException": newErrorFileContentSizeLimitExceededException, + "FileDoesNotExistException": newErrorFileDoesNotExistException, + "FileEntryRequiredException": newErrorFileEntryRequiredException, + "FileModeRequiredException": newErrorFileModeRequiredException, + "FileNameConflictsWithDirectoryNameException": newErrorFileNameConflictsWithDirectoryNameException, + "FilePathConflictsWithSubmodulePathException": newErrorFilePathConflictsWithSubmodulePathException, + "FileTooLargeException": newErrorFileTooLargeException, + "FolderContentSizeLimitExceededException": newErrorFolderContentSizeLimitExceededException, + "FolderDoesNotExistException": newErrorFolderDoesNotExistException, + "IdempotencyParameterMismatchException": newErrorIdempotencyParameterMismatchException, + "InvalidActorArnException": newErrorInvalidActorArnException, + "InvalidApprovalRuleContentException": newErrorInvalidApprovalRuleContentException, + "InvalidApprovalRuleNameException": newErrorInvalidApprovalRuleNameException, + "InvalidApprovalRuleTemplateContentException": newErrorInvalidApprovalRuleTemplateContentException, + "InvalidApprovalRuleTemplateDescriptionException": newErrorInvalidApprovalRuleTemplateDescriptionException, + "InvalidApprovalRuleTemplateNameException": newErrorInvalidApprovalRuleTemplateNameException, + "InvalidApprovalStateException": newErrorInvalidApprovalStateException, + "InvalidAuthorArnException": newErrorInvalidAuthorArnException, + "InvalidBlobIdException": newErrorInvalidBlobIdException, + "InvalidBranchNameException": newErrorInvalidBranchNameException, + "InvalidClientRequestTokenException": newErrorInvalidClientRequestTokenException, + "InvalidCommentIdException": newErrorInvalidCommentIdException, + "InvalidCommitException": newErrorInvalidCommitException, + "InvalidCommitIdException": newErrorInvalidCommitIdException, + "InvalidConflictDetailLevelException": newErrorInvalidConflictDetailLevelException, + "InvalidConflictResolutionException": newErrorInvalidConflictResolutionException, + "InvalidConflictResolutionStrategyException": newErrorInvalidConflictResolutionStrategyException, + "InvalidContinuationTokenException": newErrorInvalidContinuationTokenException, + "InvalidDeletionParameterException": newErrorInvalidDeletionParameterException, + "InvalidDescriptionException": newErrorInvalidDescriptionException, + "InvalidDestinationCommitSpecifierException": newErrorInvalidDestinationCommitSpecifierException, + "InvalidEmailException": newErrorInvalidEmailException, + "InvalidFileLocationException": newErrorInvalidFileLocationException, + "InvalidFileModeException": newErrorInvalidFileModeException, + "InvalidFilePositionException": newErrorInvalidFilePositionException, + "InvalidMaxConflictFilesException": newErrorInvalidMaxConflictFilesException, + "InvalidMaxMergeHunksException": newErrorInvalidMaxMergeHunksException, + "InvalidMaxResultsException": newErrorInvalidMaxResultsException, + "InvalidMergeOptionException": newErrorInvalidMergeOptionException, + "InvalidOrderException": newErrorInvalidOrderException, + "InvalidOverrideStatusException": newErrorInvalidOverrideStatusException, + "InvalidParentCommitIdException": newErrorInvalidParentCommitIdException, + "InvalidPathException": newErrorInvalidPathException, + "InvalidPullRequestEventTypeException": newErrorInvalidPullRequestEventTypeException, + "InvalidPullRequestIdException": newErrorInvalidPullRequestIdException, + "InvalidPullRequestStatusException": newErrorInvalidPullRequestStatusException, + "InvalidPullRequestStatusUpdateException": newErrorInvalidPullRequestStatusUpdateException, + "InvalidReferenceNameException": newErrorInvalidReferenceNameException, + "InvalidRelativeFileVersionEnumException": newErrorInvalidRelativeFileVersionEnumException, + "InvalidReplacementContentException": newErrorInvalidReplacementContentException, + "InvalidReplacementTypeException": newErrorInvalidReplacementTypeException, + "InvalidRepositoryDescriptionException": newErrorInvalidRepositoryDescriptionException, + "InvalidRepositoryNameException": newErrorInvalidRepositoryNameException, + "InvalidRepositoryTriggerBranchNameException": newErrorInvalidRepositoryTriggerBranchNameException, + "InvalidRepositoryTriggerCustomDataException": newErrorInvalidRepositoryTriggerCustomDataException, + "InvalidRepositoryTriggerDestinationArnException": newErrorInvalidRepositoryTriggerDestinationArnException, + "InvalidRepositoryTriggerEventsException": newErrorInvalidRepositoryTriggerEventsException, + "InvalidRepositoryTriggerNameException": newErrorInvalidRepositoryTriggerNameException, + "InvalidRepositoryTriggerRegionException": newErrorInvalidRepositoryTriggerRegionException, + "InvalidResourceArnException": newErrorInvalidResourceArnException, + "InvalidRevisionIdException": newErrorInvalidRevisionIdException, + "InvalidRuleContentSha256Exception": newErrorInvalidRuleContentSha256Exception, + "InvalidSortByException": newErrorInvalidSortByException, + "InvalidSourceCommitSpecifierException": newErrorInvalidSourceCommitSpecifierException, + "InvalidSystemTagUsageException": newErrorInvalidSystemTagUsageException, + "InvalidTagKeysListException": newErrorInvalidTagKeysListException, + "InvalidTagsMapException": newErrorInvalidTagsMapException, + "InvalidTargetBranchException": newErrorInvalidTargetBranchException, + "InvalidTargetException": newErrorInvalidTargetException, + "InvalidTargetsException": newErrorInvalidTargetsException, + "InvalidTitleException": newErrorInvalidTitleException, + "ManualMergeRequiredException": newErrorManualMergeRequiredException, + "MaximumBranchesExceededException": newErrorMaximumBranchesExceededException, + "MaximumConflictResolutionEntriesExceededException": newErrorMaximumConflictResolutionEntriesExceededException, + "MaximumFileContentToLoadExceededException": newErrorMaximumFileContentToLoadExceededException, + "MaximumFileEntriesExceededException": newErrorMaximumFileEntriesExceededException, + "MaximumItemsToCompareExceededException": newErrorMaximumItemsToCompareExceededException, + "MaximumNumberOfApprovalsExceededException": newErrorMaximumNumberOfApprovalsExceededException, + "MaximumOpenPullRequestsExceededException": newErrorMaximumOpenPullRequestsExceededException, + "MaximumRepositoryNamesExceededException": newErrorMaximumRepositoryNamesExceededException, + "MaximumRepositoryTriggersExceededException": newErrorMaximumRepositoryTriggersExceededException, + "MaximumRuleTemplatesAssociatedWithRepositoryException": newErrorMaximumRuleTemplatesAssociatedWithRepositoryException, + "MergeOptionRequiredException": newErrorMergeOptionRequiredException, + "MultipleConflictResolutionEntriesException": newErrorMultipleConflictResolutionEntriesException, + "MultipleRepositoriesInPullRequestException": newErrorMultipleRepositoriesInPullRequestException, + "NameLengthExceededException": newErrorNameLengthExceededException, + "NoChangeException": newErrorNoChangeException, + "NumberOfRuleTemplatesExceededException": newErrorNumberOfRuleTemplatesExceededException, + "NumberOfRulesExceededException": newErrorNumberOfRulesExceededException, + "OverrideAlreadySetException": newErrorOverrideAlreadySetException, + "OverrideStatusRequiredException": newErrorOverrideStatusRequiredException, + "ParentCommitDoesNotExistException": newErrorParentCommitDoesNotExistException, + "ParentCommitIdOutdatedException": newErrorParentCommitIdOutdatedException, + "ParentCommitIdRequiredException": newErrorParentCommitIdRequiredException, + "PathDoesNotExistException": newErrorPathDoesNotExistException, + "PathRequiredException": newErrorPathRequiredException, + "PullRequestAlreadyClosedException": newErrorPullRequestAlreadyClosedException, + "PullRequestApprovalRulesNotSatisfiedException": newErrorPullRequestApprovalRulesNotSatisfiedException, + "PullRequestCannotBeApprovedByAuthorException": newErrorPullRequestCannotBeApprovedByAuthorException, + "PullRequestDoesNotExistException": newErrorPullRequestDoesNotExistException, + "PullRequestIdRequiredException": newErrorPullRequestIdRequiredException, + "PullRequestStatusRequiredException": newErrorPullRequestStatusRequiredException, + "PutFileEntryConflictException": newErrorPutFileEntryConflictException, + "ReferenceDoesNotExistException": newErrorReferenceDoesNotExistException, + "ReferenceNameRequiredException": newErrorReferenceNameRequiredException, + "ReferenceTypeNotSupportedException": newErrorReferenceTypeNotSupportedException, + "ReplacementContentRequiredException": newErrorReplacementContentRequiredException, + "ReplacementTypeRequiredException": newErrorReplacementTypeRequiredException, + "RepositoryDoesNotExistException": newErrorRepositoryDoesNotExistException, + "RepositoryLimitExceededException": newErrorRepositoryLimitExceededException, + "RepositoryNameExistsException": newErrorRepositoryNameExistsException, + "RepositoryNameRequiredException": newErrorRepositoryNameRequiredException, + "RepositoryNamesRequiredException": newErrorRepositoryNamesRequiredException, + "RepositoryNotAssociatedWithPullRequestException": newErrorRepositoryNotAssociatedWithPullRequestException, + "RepositoryTriggerBranchNameListRequiredException": newErrorRepositoryTriggerBranchNameListRequiredException, + "RepositoryTriggerDestinationArnRequiredException": newErrorRepositoryTriggerDestinationArnRequiredException, + "RepositoryTriggerEventsListRequiredException": newErrorRepositoryTriggerEventsListRequiredException, + "RepositoryTriggerNameRequiredException": newErrorRepositoryTriggerNameRequiredException, + "RepositoryTriggersListRequiredException": newErrorRepositoryTriggersListRequiredException, + "ResourceArnRequiredException": newErrorResourceArnRequiredException, + "RestrictedSourceFileException": newErrorRestrictedSourceFileException, + "RevisionIdRequiredException": newErrorRevisionIdRequiredException, + "RevisionNotCurrentException": newErrorRevisionNotCurrentException, + "SameFileContentException": newErrorSameFileContentException, + "SamePathRequestException": newErrorSamePathRequestException, + "SourceAndDestinationAreSameException": newErrorSourceAndDestinationAreSameException, + "SourceFileOrContentRequiredException": newErrorSourceFileOrContentRequiredException, + "TagKeysListRequiredException": newErrorTagKeysListRequiredException, + "TagPolicyException": newErrorTagPolicyException, + "TagsMapRequiredException": newErrorTagsMapRequiredException, + "TargetRequiredException": newErrorTargetRequiredException, + "TargetsRequiredException": newErrorTargetsRequiredException, + "TipOfSourceReferenceIsDifferentException": newErrorTipOfSourceReferenceIsDifferentException, + "TipsDivergenceExceededException": newErrorTipsDivergenceExceededException, + "TitleRequiredException": newErrorTitleRequiredException, + "TooManyTagsException": newErrorTooManyTagsException, +} 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 index c8cad394ab0..2cb50a48562 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codecommit/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codecommit/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "codecommit" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "CodeCommit" // ServiceID is a unique identifer of a specific service. + ServiceID = "CodeCommit" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CodeCommit client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CodeCommit client from just a session. // svc := codecommit.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CodeCommit { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CodeCommit { svc := &CodeCommit{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-04-13", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index de8c21179c7..16e57401deb 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/api.go @@ -3,6 +3,7 @@ package codedeploy import ( + "fmt" "time" "github.com/aws/aws-sdk-go/aws" @@ -66,27 +67,27 @@ func (c *CodeDeploy) AddTagsToOnPremisesInstancesRequest(input *AddTagsToOnPremi // See the AWS API reference guide for AWS CodeDeploy's // API operation AddTagsToOnPremisesInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeInstanceNameRequiredException "InstanceNameRequiredException" +// Returned Error Types: +// * InstanceNameRequiredException // An on-premises instance name was not specified. // -// * ErrCodeInvalidInstanceNameException "InvalidInstanceNameException" +// * InvalidInstanceNameException // The on-premises instance name was specified in an invalid format. // -// * ErrCodeTagRequiredException "TagRequiredException" +// * TagRequiredException // A tag was not specified. // -// * ErrCodeInvalidTagException "InvalidTagException" +// * InvalidTagException // The tag was specified in an invalid format. // -// * ErrCodeTagLimitExceededException "TagLimitExceededException" +// * TagLimitExceededException // The maximum allowed number of tags was exceeded. // -// * ErrCodeInstanceLimitExceededException "InstanceLimitExceededException" +// * InstanceLimitExceededException // The maximum number of allowed on-premises instances in a single call was // exceeded. // -// * ErrCodeInstanceNotRegisteredException "InstanceNotRegisteredException" +// * InstanceNotRegisteredException // The specified on-premises instance is not registered. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/AddTagsToOnPremisesInstances @@ -165,23 +166,23 @@ func (c *CodeDeploy) BatchGetApplicationRevisionsRequest(input *BatchGetApplicat // See the AWS API reference guide for AWS CodeDeploy's // API operation BatchGetApplicationRevisions for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// Returned Error Types: +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeRevisionRequiredException "RevisionRequiredException" +// * RevisionRequiredException // The revision ID was not specified. // -// * ErrCodeInvalidRevisionException "InvalidRevisionException" +// * InvalidRevisionException // The revision was specified in an invalid format. // -// * ErrCodeBatchLimitExceededException "BatchLimitExceededException" +// * BatchLimitExceededException // The maximum number of names or IDs allowed for this request (100) was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetApplicationRevisions @@ -260,17 +261,17 @@ func (c *CodeDeploy) BatchGetApplicationsRequest(input *BatchGetApplicationsInpu // See the AWS API reference guide for AWS CodeDeploy's // API operation BatchGetApplications for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// Returned Error Types: +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // -// * ErrCodeBatchLimitExceededException "BatchLimitExceededException" +// * BatchLimitExceededException // The maximum number of names or IDs allowed for this request (100) was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetApplications @@ -348,26 +349,26 @@ func (c *CodeDeploy) BatchGetDeploymentGroupsRequest(input *BatchGetDeploymentGr // See the AWS API reference guide for AWS CodeDeploy's // API operation BatchGetDeploymentGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// Returned Error Types: +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // -// * ErrCodeDeploymentGroupNameRequiredException "DeploymentGroupNameRequiredException" +// * DeploymentGroupNameRequiredException // The deployment group name was not specified. // -// * ErrCodeInvalidDeploymentGroupNameException "InvalidDeploymentGroupNameException" +// * InvalidDeploymentGroupNameException // The deployment group name was specified in an invalid format. // -// * ErrCodeBatchLimitExceededException "BatchLimitExceededException" +// * BatchLimitExceededException // The maximum number of names or IDs allowed for this request (100) was exceeded. // -// * ErrCodeDeploymentConfigDoesNotExistException "DeploymentConfigDoesNotExistException" +// * DeploymentConfigDoesNotExistException // The deployment configuration does not exist with the IAM user or AWS account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeploymentGroups @@ -456,26 +457,26 @@ func (c *CodeDeploy) BatchGetDeploymentInstancesRequest(input *BatchGetDeploymen // See the AWS API reference guide for AWS CodeDeploy's // API operation BatchGetDeploymentInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" +// Returned Error Types: +// * DeploymentIdRequiredException // At least one deployment ID must be specified. // -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" +// * DeploymentDoesNotExistException // The deployment with the IAM user or AWS account does not exist. // -// * ErrCodeInstanceIdRequiredException "InstanceIdRequiredException" +// * InstanceIdRequiredException // The instance ID was not specified. // -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" +// * InvalidDeploymentIdException // At least one of the deployment IDs was specified in an invalid format. // -// * ErrCodeInvalidInstanceNameException "InvalidInstanceNameException" +// * InvalidInstanceNameException // The on-premises instance name was specified in an invalid format. // -// * ErrCodeBatchLimitExceededException "BatchLimitExceededException" +// * BatchLimitExceededException // The maximum number of names or IDs allowed for this request (100) was exceeded. // -// * ErrCodeInvalidComputePlatformException "InvalidComputePlatformException" +// * InvalidComputePlatformException // The computePlatform is invalid. The computePlatform should be Lambda or Server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeploymentInstances @@ -568,29 +569,29 @@ func (c *CodeDeploy) BatchGetDeploymentTargetsRequest(input *BatchGetDeploymentT // See the AWS API reference guide for AWS CodeDeploy's // API operation BatchGetDeploymentTargets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" +// Returned Error Types: +// * InvalidDeploymentIdException // At least one of the deployment IDs was specified in an invalid format. // -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" +// * DeploymentIdRequiredException // At least one deployment ID must be specified. // -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" +// * DeploymentDoesNotExistException // The deployment with the IAM user or AWS account does not exist. // -// * ErrCodeDeploymentNotStartedException "DeploymentNotStartedException" +// * DeploymentNotStartedException // The specified deployment has not started. // -// * ErrCodeDeploymentTargetIdRequiredException "DeploymentTargetIdRequiredException" +// * DeploymentTargetIdRequiredException // A deployment target ID was not provided. // -// * ErrCodeInvalidDeploymentTargetIdException "InvalidDeploymentTargetIdException" +// * InvalidDeploymentTargetIdException // The target ID provided was not valid. // -// * ErrCodeDeploymentTargetDoesNotExistException "DeploymentTargetDoesNotExistException" +// * DeploymentTargetDoesNotExistException // The provided target ID does not belong to the attempted deployment. // -// * ErrCodeDeploymentTargetListSizeExceededException "DeploymentTargetListSizeExceededException" +// * DeploymentTargetListSizeExceededException // The maximum number of targets that can be associated with an Amazon ECS or // AWS Lambda deployment was exceeded. The target list of both types of deployments // must have exactly one item. This exception does not apply to EC2/On-premises @@ -672,14 +673,14 @@ func (c *CodeDeploy) BatchGetDeploymentsRequest(input *BatchGetDeploymentsInput) // See the AWS API reference guide for AWS CodeDeploy's // API operation BatchGetDeployments for usage and error information. // -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" +// Returned Error Types: +// * DeploymentIdRequiredException // At least one deployment ID must be specified. // -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" +// * InvalidDeploymentIdException // At least one of the deployment IDs was specified in an invalid format. // -// * ErrCodeBatchLimitExceededException "BatchLimitExceededException" +// * BatchLimitExceededException // The maximum number of names or IDs allowed for this request (100) was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetDeployments @@ -758,14 +759,14 @@ func (c *CodeDeploy) BatchGetOnPremisesInstancesRequest(input *BatchGetOnPremise // See the AWS API reference guide for AWS CodeDeploy's // API operation BatchGetOnPremisesInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeInstanceNameRequiredException "InstanceNameRequiredException" +// Returned Error Types: +// * InstanceNameRequiredException // An on-premises instance name was not specified. // -// * ErrCodeInvalidInstanceNameException "InvalidInstanceNameException" +// * InvalidInstanceNameException // The on-premises instance name was specified in an invalid format. // -// * ErrCodeBatchLimitExceededException "BatchLimitExceededException" +// * BatchLimitExceededException // The maximum number of names or IDs allowed for this request (100) was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/BatchGetOnPremisesInstances @@ -849,29 +850,29 @@ func (c *CodeDeploy) ContinueDeploymentRequest(input *ContinueDeploymentInput) ( // See the AWS API reference guide for AWS CodeDeploy's // API operation ContinueDeployment for usage and error information. // -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" +// Returned Error Types: +// * DeploymentIdRequiredException // At least one deployment ID must be specified. // -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" +// * DeploymentDoesNotExistException // The deployment with the IAM user or AWS account does not exist. // -// * ErrCodeDeploymentAlreadyCompletedException "DeploymentAlreadyCompletedException" +// * DeploymentAlreadyCompletedException // The deployment is already complete. // -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" +// * InvalidDeploymentIdException // At least one of the deployment IDs was specified in an invalid format. // -// * ErrCodeDeploymentIsNotInReadyStateException "DeploymentIsNotInReadyStateException" +// * DeploymentIsNotInReadyStateException // The deployment does not have a status of Ready and can't continue yet. // -// * ErrCodeUnsupportedActionForDeploymentTypeException "UnsupportedActionForDeploymentTypeException" +// * UnsupportedActionForDeploymentTypeException // A call was submitted that is not supported for the specified deployment type. // -// * ErrCodeInvalidDeploymentWaitTypeException "InvalidDeploymentWaitTypeException" +// * InvalidDeploymentWaitTypeException // The wait type is invalid. // -// * ErrCodeInvalidDeploymentStatusException "InvalidDeploymentStatusException" +// * InvalidDeploymentStatusException // The specified deployment status doesn't exist or cannot be determined. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ContinueDeployment @@ -949,24 +950,24 @@ func (c *CodeDeploy) CreateApplicationRequest(input *CreateApplicationInput) (re // See the AWS API reference guide for AWS CodeDeploy's // API operation CreateApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// Returned Error Types: +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeApplicationAlreadyExistsException "ApplicationAlreadyExistsException" +// * ApplicationAlreadyExistsException // An application with the specified name with the IAM user or AWS account already // exists. // -// * ErrCodeApplicationLimitExceededException "ApplicationLimitExceededException" +// * ApplicationLimitExceededException // More applications were attempted to be created than are allowed. // -// * ErrCodeInvalidComputePlatformException "InvalidComputePlatformException" +// * InvalidComputePlatformException // The computePlatform is invalid. The computePlatform should be Lambda or Server. // -// * ErrCodeInvalidTagsToAddException "InvalidTagsToAddException" +// * InvalidTagsToAddException // The specified tags are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateApplication @@ -1044,47 +1045,47 @@ func (c *CodeDeploy) CreateDeploymentRequest(input *CreateDeploymentInput) (req // See the AWS API reference guide for AWS CodeDeploy's // API operation CreateDeployment for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// Returned Error Types: +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // -// * ErrCodeDeploymentGroupNameRequiredException "DeploymentGroupNameRequiredException" +// * DeploymentGroupNameRequiredException // The deployment group name was not specified. // -// * ErrCodeInvalidDeploymentGroupNameException "InvalidDeploymentGroupNameException" +// * InvalidDeploymentGroupNameException // The deployment group name was specified in an invalid format. // -// * ErrCodeDeploymentGroupDoesNotExistException "DeploymentGroupDoesNotExistException" +// * DeploymentGroupDoesNotExistException // The named deployment group with the IAM user or AWS account does not exist. // -// * ErrCodeRevisionRequiredException "RevisionRequiredException" +// * RevisionRequiredException // The revision ID was not specified. // -// * ErrCodeRevisionDoesNotExistException "RevisionDoesNotExistException" +// * RevisionDoesNotExistException // The named revision does not exist with the IAM user or AWS account. // -// * ErrCodeInvalidRevisionException "InvalidRevisionException" +// * InvalidRevisionException // The revision was specified in an invalid format. // -// * ErrCodeInvalidDeploymentConfigNameException "InvalidDeploymentConfigNameException" +// * InvalidDeploymentConfigNameException // The deployment configuration name was specified in an invalid format. // -// * ErrCodeDeploymentConfigDoesNotExistException "DeploymentConfigDoesNotExistException" +// * DeploymentConfigDoesNotExistException // The deployment configuration does not exist with the IAM user or AWS account. // -// * ErrCodeDescriptionTooLongException "DescriptionTooLongException" +// * DescriptionTooLongException // The description is too long. // -// * ErrCodeDeploymentLimitExceededException "DeploymentLimitExceededException" +// * DeploymentLimitExceededException // The number of allowed deployments was exceeded. // -// * ErrCodeInvalidTargetInstancesException "InvalidTargetInstancesException" +// * InvalidTargetInstancesException // The target instance configuration is invalid. Possible causes include: // // * Configuration data for target instances was entered for an in-place @@ -1096,40 +1097,40 @@ func (c *CodeDeploy) CreateDeploymentRequest(input *CreateDeploymentInput) (req // // * A specified tag is not currently applied to any instances. // -// * ErrCodeInvalidAutoRollbackConfigException "InvalidAutoRollbackConfigException" +// * 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" +// * InvalidLoadBalancerInfoException // An invalid load balancer name, or no load balancer name, was specified. // -// * ErrCodeInvalidFileExistsBehaviorException "InvalidFileExistsBehaviorException" +// * InvalidFileExistsBehaviorException // An invalid fileExistsBehavior option was specified to determine how AWS CodeDeploy // handles files or directories that already exist in a deployment target location, // but weren't part of the previous successful deployment. Valid values include // "DISALLOW," "OVERWRITE," and "RETAIN." // -// * ErrCodeInvalidRoleException "InvalidRoleException" +// * 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 Amazon EC2 Auto Scaling. // -// * ErrCodeInvalidAutoScalingGroupException "InvalidAutoScalingGroupException" +// * InvalidAutoScalingGroupException // The Auto Scaling group was specified in an invalid format or does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // An API function was called too frequently. // -// * ErrCodeInvalidUpdateOutdatedInstancesOnlyValueException "InvalidUpdateOutdatedInstancesOnlyValueException" +// * InvalidUpdateOutdatedInstancesOnlyValueException // The UpdateOutdatedInstancesOnly value is invalid. For AWS Lambda deployments, // false is expected. For EC2/On-premises deployments, true or false is expected. // -// * ErrCodeInvalidIgnoreApplicationStopFailuresValueException "InvalidIgnoreApplicationStopFailuresValueException" +// * InvalidIgnoreApplicationStopFailuresValueException // The IgnoreApplicationStopFailures value is invalid. For AWS Lambda deployments, // false is expected. For EC2/On-premises deployments, true or false is expected. // -// * ErrCodeInvalidGitHubAccountTokenException "InvalidGitHubAccountTokenException" +// * InvalidGitHubAccountTokenException // The GitHub token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeployment @@ -1207,27 +1208,27 @@ func (c *CodeDeploy) CreateDeploymentConfigRequest(input *CreateDeploymentConfig // See the AWS API reference guide for AWS CodeDeploy's // API operation CreateDeploymentConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidDeploymentConfigNameException "InvalidDeploymentConfigNameException" +// Returned Error Types: +// * InvalidDeploymentConfigNameException // The deployment configuration name was specified in an invalid format. // -// * ErrCodeDeploymentConfigNameRequiredException "DeploymentConfigNameRequiredException" +// * DeploymentConfigNameRequiredException // The deployment configuration name was not specified. // -// * ErrCodeDeploymentConfigAlreadyExistsException "DeploymentConfigAlreadyExistsException" +// * DeploymentConfigAlreadyExistsException // A deployment configuration with the specified name with the IAM user or AWS // account already exists . // -// * ErrCodeInvalidMinimumHealthyHostValueException "InvalidMinimumHealthyHostValueException" +// * InvalidMinimumHealthyHostValueException // The minimum healthy instance value was specified in an invalid format. // -// * ErrCodeDeploymentConfigLimitExceededException "DeploymentConfigLimitExceededException" +// * DeploymentConfigLimitExceededException // The deployment configurations limit was exceeded. // -// * ErrCodeInvalidComputePlatformException "InvalidComputePlatformException" +// * InvalidComputePlatformException // The computePlatform is invalid. The computePlatform should be Lambda or Server. // -// * ErrCodeInvalidTrafficRoutingConfigurationException "InvalidTrafficRoutingConfigurationException" +// * InvalidTrafficRoutingConfigurationException // The configuration that specifies how traffic is routed during a deployment // is invalid. // @@ -1306,62 +1307,62 @@ func (c *CodeDeploy) CreateDeploymentGroupRequest(input *CreateDeploymentGroupIn // See the AWS API reference guide for AWS CodeDeploy's // API operation CreateDeploymentGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// Returned Error Types: +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // -// * ErrCodeDeploymentGroupNameRequiredException "DeploymentGroupNameRequiredException" +// * DeploymentGroupNameRequiredException // The deployment group name was not specified. // -// * ErrCodeInvalidDeploymentGroupNameException "InvalidDeploymentGroupNameException" +// * InvalidDeploymentGroupNameException // The deployment group name was specified in an invalid format. // -// * ErrCodeDeploymentGroupAlreadyExistsException "DeploymentGroupAlreadyExistsException" +// * DeploymentGroupAlreadyExistsException // A deployment group with the specified name with the IAM user or AWS account // already exists. // -// * ErrCodeInvalidEC2TagException "InvalidEC2TagException" +// * InvalidEC2TagException // The tag was specified in an invalid format. // -// * ErrCodeInvalidTagException "InvalidTagException" +// * InvalidTagException // The tag was specified in an invalid format. // -// * ErrCodeInvalidAutoScalingGroupException "InvalidAutoScalingGroupException" +// * InvalidAutoScalingGroupException // The Auto Scaling group was specified in an invalid format or does not exist. // -// * ErrCodeInvalidDeploymentConfigNameException "InvalidDeploymentConfigNameException" +// * InvalidDeploymentConfigNameException // The deployment configuration name was specified in an invalid format. // -// * ErrCodeDeploymentConfigDoesNotExistException "DeploymentConfigDoesNotExistException" +// * DeploymentConfigDoesNotExistException // The deployment configuration does not exist with the IAM user or AWS account. // -// * ErrCodeRoleRequiredException "RoleRequiredException" +// * RoleRequiredException // The role ID was not specified. // -// * ErrCodeInvalidRoleException "InvalidRoleException" +// * 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 Amazon EC2 Auto Scaling. // -// * ErrCodeDeploymentGroupLimitExceededException "DeploymentGroupLimitExceededException" +// * DeploymentGroupLimitExceededException // The deployment groups limit was exceeded. // -// * ErrCodeLifecycleHookLimitExceededException "LifecycleHookLimitExceededException" +// * LifecycleHookLimitExceededException // The limit for lifecycle hooks was exceeded. // -// * ErrCodeInvalidTriggerConfigException "InvalidTriggerConfigException" +// * InvalidTriggerConfigException // The trigger was specified in an invalid format. // -// * ErrCodeTriggerTargetsLimitExceededException "TriggerTargetsLimitExceededException" +// * TriggerTargetsLimitExceededException // The maximum allowed number of triggers was exceeded. // -// * ErrCodeInvalidAlarmConfigException "InvalidAlarmConfigException" +// * InvalidAlarmConfigException // The format of the alarm configuration is invalid. Possible causes include: // // * The alarm list is null. @@ -1374,56 +1375,56 @@ func (c *CodeDeploy) CreateDeploymentGroupRequest(input *CreateDeploymentGroupIn // // * The alarm configuration is enabled, but the alarm list is empty. // -// * ErrCodeAlarmsLimitExceededException "AlarmsLimitExceededException" +// * AlarmsLimitExceededException // The maximum number of alarms for a deployment group (10) was exceeded. // -// * ErrCodeInvalidAutoRollbackConfigException "InvalidAutoRollbackConfigException" +// * 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" +// * InvalidLoadBalancerInfoException // An invalid load balancer name, or no load balancer name, was specified. // -// * ErrCodeInvalidDeploymentStyleException "InvalidDeploymentStyleException" +// * InvalidDeploymentStyleException // An invalid deployment style was specified. Valid deployment types include // "IN_PLACE" and "BLUE_GREEN." Valid deployment options include "WITH_TRAFFIC_CONTROL" // and "WITHOUT_TRAFFIC_CONTROL." // -// * ErrCodeInvalidBlueGreenDeploymentConfigurationException "InvalidBlueGreenDeploymentConfigurationException" +// * InvalidBlueGreenDeploymentConfigurationException // The configuration for the blue/green deployment group was provided in an // invalid format. For information about deployment configuration format, see // CreateDeploymentConfig. // -// * ErrCodeInvalidEC2TagCombinationException "InvalidEC2TagCombinationException" +// * InvalidEC2TagCombinationException // A call was submitted that specified both Ec2TagFilters and Ec2TagSet, but // only one of these data types can be used in a single call. // -// * ErrCodeInvalidOnPremisesTagCombinationException "InvalidOnPremisesTagCombinationException" +// * InvalidOnPremisesTagCombinationException // A call was submitted that specified both OnPremisesTagFilters and OnPremisesTagSet, // but only one of these data types can be used in a single call. // -// * ErrCodeTagSetListLimitExceededException "TagSetListLimitExceededException" +// * TagSetListLimitExceededException // The number of tag groups included in the tag set list exceeded the maximum // allowed limit of 3. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input was specified in an invalid format. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // An API function was called too frequently. // -// * ErrCodeInvalidECSServiceException "InvalidECSServiceException" +// * InvalidECSServiceException // The Amazon ECS service identifier is not valid. // -// * ErrCodeInvalidTargetGroupPairException "InvalidTargetGroupPairException" +// * InvalidTargetGroupPairException // A target group pair associated with this deployment is not valid. // -// * ErrCodeECSServiceMappingLimitExceededException "ECSServiceMappingLimitExceededException" +// * ECSServiceMappingLimitExceededException // The Amazon ECS service is associated with more than one deployment groups. // An Amazon ECS service can be associated with only one deployment group. // -// * ErrCodeInvalidTagsToAddException "InvalidTagsToAddException" +// * InvalidTagsToAddException // The specified tags are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/CreateDeploymentGroup @@ -1502,14 +1503,14 @@ func (c *CodeDeploy) DeleteApplicationRequest(input *DeleteApplicationInput) (re // See the AWS API reference guide for AWS CodeDeploy's // API operation DeleteApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// Returned Error Types: +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeInvalidRoleException "InvalidRoleException" +// * 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 Amazon EC2 Auto Scaling. @@ -1593,17 +1594,17 @@ func (c *CodeDeploy) DeleteDeploymentConfigRequest(input *DeleteDeploymentConfig // See the AWS API reference guide for AWS CodeDeploy's // API operation DeleteDeploymentConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidDeploymentConfigNameException "InvalidDeploymentConfigNameException" +// Returned Error Types: +// * InvalidDeploymentConfigNameException // The deployment configuration name was specified in an invalid format. // -// * ErrCodeDeploymentConfigNameRequiredException "DeploymentConfigNameRequiredException" +// * DeploymentConfigNameRequiredException // The deployment configuration name was not specified. // -// * ErrCodeDeploymentConfigInUseException "DeploymentConfigInUseException" +// * DeploymentConfigInUseException // The deployment configuration is still in use. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // An invalid operation was detected. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteDeploymentConfig @@ -1681,20 +1682,20 @@ func (c *CodeDeploy) DeleteDeploymentGroupRequest(input *DeleteDeploymentGroupIn // See the AWS API reference guide for AWS CodeDeploy's // API operation DeleteDeploymentGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// Returned Error Types: +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeDeploymentGroupNameRequiredException "DeploymentGroupNameRequiredException" +// * DeploymentGroupNameRequiredException // The deployment group name was not specified. // -// * ErrCodeInvalidDeploymentGroupNameException "InvalidDeploymentGroupNameException" +// * InvalidDeploymentGroupNameException // The deployment group name was specified in an invalid format. // -// * ErrCodeInvalidRoleException "InvalidRoleException" +// * 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 Amazon EC2 Auto Scaling. @@ -1774,20 +1775,20 @@ func (c *CodeDeploy) DeleteGitHubAccountTokenRequest(input *DeleteGitHubAccountT // See the AWS API reference guide for AWS CodeDeploy's // API operation DeleteGitHubAccountToken for usage and error information. // -// Returned Error Codes: -// * ErrCodeGitHubAccountTokenNameRequiredException "GitHubAccountTokenNameRequiredException" +// Returned Error Types: +// * GitHubAccountTokenNameRequiredException // The call is missing a required GitHub account connection name. // -// * ErrCodeGitHubAccountTokenDoesNotExistException "GitHubAccountTokenDoesNotExistException" +// * GitHubAccountTokenDoesNotExistException // No GitHub account connection exists with the named specified in the call. // -// * ErrCodeInvalidGitHubAccountTokenNameException "InvalidGitHubAccountTokenNameException" +// * InvalidGitHubAccountTokenNameException // The format of the specified GitHub account connection name is invalid. // -// * ErrCodeResourceValidationException "ResourceValidationException" +// * ResourceValidationException // The specified resource could not be validated. // -// * ErrCodeOperationNotSupportedException "OperationNotSupportedException" +// * OperationNotSupportedException // The API used does not support the deployment. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeleteGitHubAccountToken @@ -1866,11 +1867,11 @@ func (c *CodeDeploy) DeregisterOnPremisesInstanceRequest(input *DeregisterOnPrem // See the AWS API reference guide for AWS CodeDeploy's // API operation DeregisterOnPremisesInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeInstanceNameRequiredException "InstanceNameRequiredException" +// Returned Error Types: +// * InstanceNameRequiredException // An on-premises instance name was not specified. // -// * ErrCodeInvalidInstanceNameException "InvalidInstanceNameException" +// * InvalidInstanceNameException // The on-premises instance name was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/DeregisterOnPremisesInstance @@ -1948,14 +1949,14 @@ func (c *CodeDeploy) GetApplicationRequest(input *GetApplicationInput) (req *req // See the AWS API reference guide for AWS CodeDeploy's // API operation GetApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// Returned Error Types: +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetApplication @@ -2033,23 +2034,23 @@ func (c *CodeDeploy) GetApplicationRevisionRequest(input *GetApplicationRevision // See the AWS API reference guide for AWS CodeDeploy's // API operation GetApplicationRevision for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// Returned Error Types: +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeRevisionDoesNotExistException "RevisionDoesNotExistException" +// * RevisionDoesNotExistException // The named revision does not exist with the IAM user or AWS account. // -// * ErrCodeRevisionRequiredException "RevisionRequiredException" +// * RevisionRequiredException // The revision ID was not specified. // -// * ErrCodeInvalidRevisionException "InvalidRevisionException" +// * InvalidRevisionException // The revision was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetApplicationRevision @@ -2132,14 +2133,14 @@ func (c *CodeDeploy) GetDeploymentRequest(input *GetDeploymentInput) (req *reque // See the AWS API reference guide for AWS CodeDeploy's // API operation GetDeployment for usage and error information. // -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" +// Returned Error Types: +// * DeploymentIdRequiredException // At least one deployment ID must be specified. // -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" +// * InvalidDeploymentIdException // At least one of the deployment IDs was specified in an invalid format. // -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" +// * DeploymentDoesNotExistException // The deployment with the IAM user or AWS account does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeployment @@ -2217,17 +2218,17 @@ func (c *CodeDeploy) GetDeploymentConfigRequest(input *GetDeploymentConfigInput) // See the AWS API reference guide for AWS CodeDeploy's // API operation GetDeploymentConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidDeploymentConfigNameException "InvalidDeploymentConfigNameException" +// Returned Error Types: +// * InvalidDeploymentConfigNameException // The deployment configuration name was specified in an invalid format. // -// * ErrCodeDeploymentConfigNameRequiredException "DeploymentConfigNameRequiredException" +// * DeploymentConfigNameRequiredException // The deployment configuration name was not specified. // -// * ErrCodeDeploymentConfigDoesNotExistException "DeploymentConfigDoesNotExistException" +// * DeploymentConfigDoesNotExistException // The deployment configuration does not exist with the IAM user or AWS account. // -// * ErrCodeInvalidComputePlatformException "InvalidComputePlatformException" +// * InvalidComputePlatformException // The computePlatform is invalid. The computePlatform should be Lambda or Server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentConfig @@ -2305,26 +2306,26 @@ func (c *CodeDeploy) GetDeploymentGroupRequest(input *GetDeploymentGroupInput) ( // See the AWS API reference guide for AWS CodeDeploy's // API operation GetDeploymentGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// Returned Error Types: +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // -// * ErrCodeDeploymentGroupNameRequiredException "DeploymentGroupNameRequiredException" +// * DeploymentGroupNameRequiredException // The deployment group name was not specified. // -// * ErrCodeInvalidDeploymentGroupNameException "InvalidDeploymentGroupNameException" +// * InvalidDeploymentGroupNameException // The deployment group name was specified in an invalid format. // -// * ErrCodeDeploymentGroupDoesNotExistException "DeploymentGroupDoesNotExistException" +// * DeploymentGroupDoesNotExistException // The named deployment group with the IAM user or AWS account does not exist. // -// * ErrCodeDeploymentConfigDoesNotExistException "DeploymentConfigDoesNotExistException" +// * DeploymentConfigDoesNotExistException // The deployment configuration does not exist with the IAM user or AWS account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentGroup @@ -2407,26 +2408,26 @@ func (c *CodeDeploy) GetDeploymentInstanceRequest(input *GetDeploymentInstanceIn // See the AWS API reference guide for AWS CodeDeploy's // API operation GetDeploymentInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" +// Returned Error Types: +// * DeploymentIdRequiredException // At least one deployment ID must be specified. // -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" +// * DeploymentDoesNotExistException // The deployment with the IAM user or AWS account does not exist. // -// * ErrCodeInstanceIdRequiredException "InstanceIdRequiredException" +// * InstanceIdRequiredException // The instance ID was not specified. // -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" +// * InvalidDeploymentIdException // At least one of the deployment IDs was specified in an invalid format. // -// * ErrCodeInstanceDoesNotExistException "InstanceDoesNotExistException" +// * InstanceDoesNotExistException // The specified instance does not exist in the deployment group. // -// * ErrCodeInvalidInstanceNameException "InvalidInstanceNameException" +// * InvalidInstanceNameException // The on-premises instance name was specified in an invalid format. // -// * ErrCodeInvalidComputePlatformException "InvalidComputePlatformException" +// * InvalidComputePlatformException // The computePlatform is invalid. The computePlatform should be Lambda or Server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentInstance @@ -2508,29 +2509,29 @@ func (c *CodeDeploy) GetDeploymentTargetRequest(input *GetDeploymentTargetInput) // See the AWS API reference guide for AWS CodeDeploy's // API operation GetDeploymentTarget for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" +// Returned Error Types: +// * InvalidDeploymentIdException // At least one of the deployment IDs was specified in an invalid format. // -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" +// * DeploymentIdRequiredException // At least one deployment ID must be specified. // -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" +// * DeploymentDoesNotExistException // The deployment with the IAM user or AWS account does not exist. // -// * ErrCodeDeploymentNotStartedException "DeploymentNotStartedException" +// * DeploymentNotStartedException // The specified deployment has not started. // -// * ErrCodeDeploymentTargetIdRequiredException "DeploymentTargetIdRequiredException" +// * DeploymentTargetIdRequiredException // A deployment target ID was not provided. // -// * ErrCodeInvalidDeploymentTargetIdException "InvalidDeploymentTargetIdException" +// * InvalidDeploymentTargetIdException // The target ID provided was not valid. // -// * ErrCodeDeploymentTargetDoesNotExistException "DeploymentTargetDoesNotExistException" +// * DeploymentTargetDoesNotExistException // The provided target ID does not belong to the attempted deployment. // -// * ErrCodeInvalidInstanceNameException "InvalidInstanceNameException" +// * InvalidInstanceNameException // The on-premises instance name was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetDeploymentTarget @@ -2608,14 +2609,14 @@ func (c *CodeDeploy) GetOnPremisesInstanceRequest(input *GetOnPremisesInstanceIn // See the AWS API reference guide for AWS CodeDeploy's // API operation GetOnPremisesInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeInstanceNameRequiredException "InstanceNameRequiredException" +// Returned Error Types: +// * InstanceNameRequiredException // An on-premises instance name was not specified. // -// * ErrCodeInstanceNotRegisteredException "InstanceNotRegisteredException" +// * InstanceNotRegisteredException // The specified on-premises instance is not registered. // -// * ErrCodeInvalidInstanceNameException "InvalidInstanceNameException" +// * InvalidInstanceNameException // The on-premises instance name was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/GetOnPremisesInstance @@ -2699,36 +2700,36 @@ func (c *CodeDeploy) ListApplicationRevisionsRequest(input *ListApplicationRevis // See the AWS API reference guide for AWS CodeDeploy's // API operation ListApplicationRevisions for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// Returned Error Types: +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeInvalidSortByException "InvalidSortByException" +// * InvalidSortByException // The column name to sort by is either not present or was specified in an invalid // format. // -// * ErrCodeInvalidSortOrderException "InvalidSortOrderException" +// * InvalidSortOrderException // The sort order was specified in an invalid format. // -// * ErrCodeInvalidBucketNameFilterException "InvalidBucketNameFilterException" +// * InvalidBucketNameFilterException // The bucket name either doesn't exist or was specified in an invalid format. // -// * ErrCodeInvalidKeyPrefixFilterException "InvalidKeyPrefixFilterException" +// * InvalidKeyPrefixFilterException // The specified key prefix filter was specified in an invalid format. // -// * ErrCodeBucketNameFilterRequiredException "BucketNameFilterRequiredException" +// * BucketNameFilterRequiredException // A bucket name is required, but was not provided. // -// * ErrCodeInvalidDeployedStateFilterException "InvalidDeployedStateFilterException" +// * InvalidDeployedStateFilterException // The deployed state filter was specified in an invalid format. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListApplicationRevisions @@ -2796,10 +2797,12 @@ func (c *CodeDeploy) ListApplicationRevisionsPagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListApplicationRevisionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListApplicationRevisionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2862,8 +2865,8 @@ func (c *CodeDeploy) ListApplicationsRequest(input *ListApplicationsInput) (req // See the AWS API reference guide for AWS CodeDeploy's // API operation ListApplications for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The next token was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListApplications @@ -2931,10 +2934,12 @@ func (c *CodeDeploy) ListApplicationsPagesWithContext(ctx aws.Context, input *Li }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListApplicationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListApplicationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2997,8 +3002,8 @@ func (c *CodeDeploy) ListDeploymentConfigsRequest(input *ListDeploymentConfigsIn // See the AWS API reference guide for AWS CodeDeploy's // API operation ListDeploymentConfigs for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The next token was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentConfigs @@ -3066,10 +3071,12 @@ func (c *CodeDeploy) ListDeploymentConfigsPagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDeploymentConfigsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDeploymentConfigsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3133,17 +3140,17 @@ func (c *CodeDeploy) ListDeploymentGroupsRequest(input *ListDeploymentGroupsInpu // See the AWS API reference guide for AWS CodeDeploy's // API operation ListDeploymentGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// Returned Error Types: +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentGroups @@ -3211,10 +3218,12 @@ func (c *CodeDeploy) ListDeploymentGroupsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDeploymentGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDeploymentGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3287,38 +3296,38 @@ func (c *CodeDeploy) ListDeploymentInstancesRequest(input *ListDeploymentInstanc // See the AWS API reference guide for AWS CodeDeploy's // API operation ListDeploymentInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" +// Returned Error Types: +// * DeploymentIdRequiredException // At least one deployment ID must be specified. // -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" +// * DeploymentDoesNotExistException // The deployment with the IAM user or AWS account does not exist. // -// * ErrCodeDeploymentNotStartedException "DeploymentNotStartedException" +// * DeploymentNotStartedException // The specified deployment has not started. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token was specified in an invalid format. // -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" +// * InvalidDeploymentIdException // At least one of the deployment IDs was specified in an invalid format. // -// * ErrCodeInvalidInstanceStatusException "InvalidInstanceStatusException" +// * InvalidInstanceStatusException // The specified instance status does not exist. // -// * ErrCodeInvalidInstanceTypeException "InvalidInstanceTypeException" +// * 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. // -// * ErrCodeInvalidDeploymentInstanceTypeException "InvalidDeploymentInstanceTypeException" +// * InvalidDeploymentInstanceTypeException // An instance type was specified for an in-place deployment. Instance types // are supported for blue/green deployments only. // -// * ErrCodeInvalidTargetFilterNameException "InvalidTargetFilterNameException" +// * InvalidTargetFilterNameException // The target filter name is invalid. // -// * ErrCodeInvalidComputePlatformException "InvalidComputePlatformException" +// * InvalidComputePlatformException // The computePlatform is invalid. The computePlatform should be Lambda or Server. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeploymentInstances @@ -3394,10 +3403,12 @@ func (c *CodeDeploy) ListDeploymentInstancesPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDeploymentInstancesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDeploymentInstancesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3454,31 +3465,31 @@ func (c *CodeDeploy) ListDeploymentTargetsRequest(input *ListDeploymentTargetsIn // See the AWS API reference guide for AWS CodeDeploy's // API operation ListDeploymentTargets for usage and error information. // -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" +// Returned Error Types: +// * DeploymentIdRequiredException // At least one deployment ID must be specified. // -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" +// * DeploymentDoesNotExistException // The deployment with the IAM user or AWS account does not exist. // -// * ErrCodeDeploymentNotStartedException "DeploymentNotStartedException" +// * DeploymentNotStartedException // The specified deployment has not started. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token was specified in an invalid format. // -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" +// * InvalidDeploymentIdException // At least one of the deployment IDs was specified in an invalid format. // -// * ErrCodeInvalidInstanceStatusException "InvalidInstanceStatusException" +// * InvalidInstanceStatusException // The specified instance status does not exist. // -// * ErrCodeInvalidInstanceTypeException "InvalidInstanceTypeException" +// * 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. // -// * ErrCodeInvalidDeploymentInstanceTypeException "InvalidDeploymentInstanceTypeException" +// * InvalidDeploymentInstanceTypeException // An instance type was specified for an in-place deployment. Instance types // are supported for blue/green deployments only. // @@ -3564,32 +3575,32 @@ func (c *CodeDeploy) ListDeploymentsRequest(input *ListDeploymentsInput) (req *r // See the AWS API reference guide for AWS CodeDeploy's // API operation ListDeployments for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// Returned Error Types: +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // -// * ErrCodeInvalidDeploymentGroupNameException "InvalidDeploymentGroupNameException" +// * InvalidDeploymentGroupNameException // The deployment group name was specified in an invalid format. // -// * ErrCodeDeploymentGroupDoesNotExistException "DeploymentGroupDoesNotExistException" +// * DeploymentGroupDoesNotExistException // The named deployment group with the IAM user or AWS account does not exist. // -// * ErrCodeDeploymentGroupNameRequiredException "DeploymentGroupNameRequiredException" +// * DeploymentGroupNameRequiredException // The deployment group name was not specified. // -// * ErrCodeInvalidTimeRangeException "InvalidTimeRangeException" +// * InvalidTimeRangeException // The specified time range was specified in an invalid format. // -// * ErrCodeInvalidDeploymentStatusException "InvalidDeploymentStatusException" +// * InvalidDeploymentStatusException // The specified deployment status doesn't exist or cannot be determined. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListDeployments @@ -3657,10 +3668,12 @@ func (c *CodeDeploy) ListDeploymentsPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDeploymentsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDeploymentsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3717,14 +3730,14 @@ func (c *CodeDeploy) ListGitHubAccountTokenNamesRequest(input *ListGitHubAccount // See the AWS API reference guide for AWS CodeDeploy's // API operation ListGitHubAccountTokenNames for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The next token was specified in an invalid format. // -// * ErrCodeResourceValidationException "ResourceValidationException" +// * ResourceValidationException // The specified resource could not be validated. // -// * ErrCodeOperationNotSupportedException "OperationNotSupportedException" +// * OperationNotSupportedException // The API used does not support the deployment. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListGitHubAccountTokenNames @@ -3806,14 +3819,14 @@ func (c *CodeDeploy) ListOnPremisesInstancesRequest(input *ListOnPremisesInstanc // See the AWS API reference guide for AWS CodeDeploy's // API operation ListOnPremisesInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRegistrationStatusException "InvalidRegistrationStatusException" +// Returned Error Types: +// * InvalidRegistrationStatusException // The registration status was specified in an invalid format. // -// * ErrCodeInvalidTagFilterException "InvalidTagFilterException" +// * InvalidTagFilterException // The tag filter was specified in an invalid format. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListOnPremisesInstances @@ -3892,15 +3905,15 @@ func (c *CodeDeploy) ListTagsForResourceRequest(input *ListTagsForResourceInput) // See the AWS API reference guide for AWS CodeDeploy's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeArnNotSupportedException "ArnNotSupportedException" +// Returned Error Types: +// * ArnNotSupportedException // The specified ARN is not supported. For example, it might be an ARN for a // resource that is not expected. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The specified ARN is not in a valid format. // -// * ErrCodeResourceArnRequiredException "ResourceArnRequiredException" +// * ResourceArnRequiredException // The ARN of a resource is required, but was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/ListTagsForResource @@ -3980,28 +3993,28 @@ func (c *CodeDeploy) PutLifecycleEventHookExecutionStatusRequest(input *PutLifec // See the AWS API reference guide for AWS CodeDeploy's // API operation PutLifecycleEventHookExecutionStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidLifecycleEventHookExecutionStatusException "InvalidLifecycleEventHookExecutionStatusException" +// Returned Error Types: +// * InvalidLifecycleEventHookExecutionStatusException // The result of a Lambda validation function that verifies a lifecycle event // is invalid. It should return Succeeded or Failed. // -// * ErrCodeInvalidLifecycleEventHookExecutionIdException "InvalidLifecycleEventHookExecutionIdException" +// * InvalidLifecycleEventHookExecutionIdException // A lifecycle event hook is invalid. Review the hooks section in your AppSpec // file to ensure the lifecycle events and hooks functions are valid. // -// * ErrCodeLifecycleEventAlreadyCompletedException "LifecycleEventAlreadyCompletedException" +// * LifecycleEventAlreadyCompletedException // An attempt to return the status of an already completed lifecycle event occurred. // -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" +// * DeploymentIdRequiredException // At least one deployment ID must be specified. // -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" +// * DeploymentDoesNotExistException // The deployment with the IAM user or AWS account does not exist. // -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" +// * InvalidDeploymentIdException // At least one of the deployment IDs was specified in an invalid format. // -// * ErrCodeUnsupportedActionForDeploymentTypeException "UnsupportedActionForDeploymentTypeException" +// * UnsupportedActionForDeploymentTypeException // A call was submitted that is not supported for the specified deployment type. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/PutLifecycleEventHookExecutionStatus @@ -4080,23 +4093,23 @@ func (c *CodeDeploy) RegisterApplicationRevisionRequest(input *RegisterApplicati // See the AWS API reference guide for AWS CodeDeploy's // API operation RegisterApplicationRevision for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// Returned Error Types: +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeDescriptionTooLongException "DescriptionTooLongException" +// * DescriptionTooLongException // The description is too long. // -// * ErrCodeRevisionRequiredException "RevisionRequiredException" +// * RevisionRequiredException // The revision ID was not specified. // -// * ErrCodeInvalidRevisionException "InvalidRevisionException" +// * InvalidRevisionException // The revision was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RegisterApplicationRevision @@ -4178,37 +4191,37 @@ func (c *CodeDeploy) RegisterOnPremisesInstanceRequest(input *RegisterOnPremises // See the AWS API reference guide for AWS CodeDeploy's // API operation RegisterOnPremisesInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeInstanceNameAlreadyRegisteredException "InstanceNameAlreadyRegisteredException" +// Returned Error Types: +// * InstanceNameAlreadyRegisteredException // The specified on-premises instance name is already registered. // -// * ErrCodeIamArnRequiredException "IamArnRequiredException" +// * 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" +// * IamSessionArnAlreadyRegisteredException // The request included an IAM session ARN that has already been used to register // a different instance. // -// * ErrCodeIamUserArnAlreadyRegisteredException "IamUserArnAlreadyRegisteredException" +// * IamUserArnAlreadyRegisteredException // The specified IAM user ARN is already registered with an on-premises instance. // -// * ErrCodeInstanceNameRequiredException "InstanceNameRequiredException" +// * InstanceNameRequiredException // An on-premises instance name was not specified. // -// * ErrCodeIamUserArnRequiredException "IamUserArnRequiredException" +// * IamUserArnRequiredException // An IAM user ARN was not specified. // -// * ErrCodeInvalidInstanceNameException "InvalidInstanceNameException" +// * InvalidInstanceNameException // The on-premises instance name was specified in an invalid format. // -// * ErrCodeInvalidIamSessionArnException "InvalidIamSessionArnException" +// * InvalidIamSessionArnException // The IAM session ARN was specified in an invalid format. // -// * ErrCodeInvalidIamUserArnException "InvalidIamUserArnException" +// * InvalidIamUserArnException // The IAM user ARN was specified in an invalid format. // -// * ErrCodeMultipleIamArnsProvidedException "MultipleIamArnsProvidedException" +// * MultipleIamArnsProvidedException // Both an IAM user ARN and an IAM session ARN were included in the request. // Use only one ARN type. // @@ -4288,27 +4301,27 @@ func (c *CodeDeploy) RemoveTagsFromOnPremisesInstancesRequest(input *RemoveTagsF // See the AWS API reference guide for AWS CodeDeploy's // API operation RemoveTagsFromOnPremisesInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeInstanceNameRequiredException "InstanceNameRequiredException" +// Returned Error Types: +// * InstanceNameRequiredException // An on-premises instance name was not specified. // -// * ErrCodeInvalidInstanceNameException "InvalidInstanceNameException" +// * InvalidInstanceNameException // The on-premises instance name was specified in an invalid format. // -// * ErrCodeTagRequiredException "TagRequiredException" +// * TagRequiredException // A tag was not specified. // -// * ErrCodeInvalidTagException "InvalidTagException" +// * InvalidTagException // The tag was specified in an invalid format. // -// * ErrCodeTagLimitExceededException "TagLimitExceededException" +// * TagLimitExceededException // The maximum allowed number of tags was exceeded. // -// * ErrCodeInstanceLimitExceededException "InstanceLimitExceededException" +// * InstanceLimitExceededException // The maximum number of allowed on-premises instances in a single call was // exceeded. // -// * ErrCodeInstanceNotRegisteredException "InstanceNotRegisteredException" +// * InstanceNotRegisteredException // The specified on-premises instance is not registered. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/RemoveTagsFromOnPremisesInstances @@ -4393,23 +4406,23 @@ func (c *CodeDeploy) SkipWaitTimeForInstanceTerminationRequest(input *SkipWaitTi // See the AWS API reference guide for AWS CodeDeploy's // API operation SkipWaitTimeForInstanceTermination for usage and error information. // -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" +// Returned Error Types: +// * DeploymentIdRequiredException // At least one deployment ID must be specified. // -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" +// * DeploymentDoesNotExistException // The deployment with the IAM user or AWS account does not exist. // -// * ErrCodeDeploymentAlreadyCompletedException "DeploymentAlreadyCompletedException" +// * DeploymentAlreadyCompletedException // The deployment is already complete. // -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" +// * InvalidDeploymentIdException // At least one of the deployment IDs was specified in an invalid format. // -// * ErrCodeDeploymentNotStartedException "DeploymentNotStartedException" +// * DeploymentNotStartedException // The specified deployment has not started. // -// * ErrCodeUnsupportedActionForDeploymentTypeException "UnsupportedActionForDeploymentTypeException" +// * UnsupportedActionForDeploymentTypeException // A call was submitted that is not supported for the specified deployment type. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/SkipWaitTimeForInstanceTermination @@ -4491,20 +4504,20 @@ func (c *CodeDeploy) StopDeploymentRequest(input *StopDeploymentInput) (req *req // See the AWS API reference guide for AWS CodeDeploy's // API operation StopDeployment for usage and error information. // -// Returned Error Codes: -// * ErrCodeDeploymentIdRequiredException "DeploymentIdRequiredException" +// Returned Error Types: +// * DeploymentIdRequiredException // At least one deployment ID must be specified. // -// * ErrCodeDeploymentDoesNotExistException "DeploymentDoesNotExistException" +// * DeploymentDoesNotExistException // The deployment with the IAM user or AWS account does not exist. // -// * ErrCodeDeploymentGroupDoesNotExistException "DeploymentGroupDoesNotExistException" +// * DeploymentGroupDoesNotExistException // The named deployment group with the IAM user or AWS account does not exist. // -// * ErrCodeDeploymentAlreadyCompletedException "DeploymentAlreadyCompletedException" +// * DeploymentAlreadyCompletedException // The deployment is already complete. // -// * ErrCodeInvalidDeploymentIdException "InvalidDeploymentIdException" +// * InvalidDeploymentIdException // At least one of the deployment IDs was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/StopDeployment @@ -4584,30 +4597,30 @@ func (c *CodeDeploy) TagResourceRequest(input *TagResourceInput) (req *request.R // See the AWS API reference guide for AWS CodeDeploy's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceArnRequiredException "ResourceArnRequiredException" +// Returned Error Types: +// * ResourceArnRequiredException // The ARN of a resource is required, but was not found. // -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // -// * ErrCodeDeploymentGroupDoesNotExistException "DeploymentGroupDoesNotExistException" +// * DeploymentGroupDoesNotExistException // The named deployment group with the IAM user or AWS account does not exist. // -// * ErrCodeDeploymentConfigDoesNotExistException "DeploymentConfigDoesNotExistException" +// * DeploymentConfigDoesNotExistException // The deployment configuration does not exist with the IAM user or AWS account. // -// * ErrCodeTagRequiredException "TagRequiredException" +// * TagRequiredException // A tag was not specified. // -// * ErrCodeInvalidTagsToAddException "InvalidTagsToAddException" +// * InvalidTagsToAddException // The specified tags are not valid. // -// * ErrCodeArnNotSupportedException "ArnNotSupportedException" +// * ArnNotSupportedException // The specified ARN is not supported. For example, it might be an ARN for a // resource that is not expected. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The specified ARN is not in a valid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/TagResource @@ -4688,30 +4701,30 @@ func (c *CodeDeploy) UntagResourceRequest(input *UntagResourceInput) (req *reque // See the AWS API reference guide for AWS CodeDeploy's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceArnRequiredException "ResourceArnRequiredException" +// Returned Error Types: +// * ResourceArnRequiredException // The ARN of a resource is required, but was not found. // -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // -// * ErrCodeDeploymentGroupDoesNotExistException "DeploymentGroupDoesNotExistException" +// * DeploymentGroupDoesNotExistException // The named deployment group with the IAM user or AWS account does not exist. // -// * ErrCodeDeploymentConfigDoesNotExistException "DeploymentConfigDoesNotExistException" +// * DeploymentConfigDoesNotExistException // The deployment configuration does not exist with the IAM user or AWS account. // -// * ErrCodeTagRequiredException "TagRequiredException" +// * TagRequiredException // A tag was not specified. // -// * ErrCodeInvalidTagsToAddException "InvalidTagsToAddException" +// * InvalidTagsToAddException // The specified tags are not valid. // -// * ErrCodeArnNotSupportedException "ArnNotSupportedException" +// * ArnNotSupportedException // The specified ARN is not supported. For example, it might be an ARN for a // resource that is not expected. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The specified ARN is not in a valid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/UntagResource @@ -4790,18 +4803,18 @@ func (c *CodeDeploy) UpdateApplicationRequest(input *UpdateApplicationInput) (re // See the AWS API reference guide for AWS CodeDeploy's // API operation UpdateApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// Returned Error Types: +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeApplicationAlreadyExistsException "ApplicationAlreadyExistsException" +// * ApplicationAlreadyExistsException // An application with the specified name with the IAM user or AWS account already // exists. // -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codedeploy-2014-10-06/UpdateApplication @@ -4879,59 +4892,59 @@ func (c *CodeDeploy) UpdateDeploymentGroupRequest(input *UpdateDeploymentGroupIn // See the AWS API reference guide for AWS CodeDeploy's // API operation UpdateDeploymentGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeApplicationNameRequiredException "ApplicationNameRequiredException" +// Returned Error Types: +// * ApplicationNameRequiredException // The minimum number of required application names was not specified. // -// * ErrCodeInvalidApplicationNameException "InvalidApplicationNameException" +// * InvalidApplicationNameException // The application name was specified in an invalid format. // -// * ErrCodeApplicationDoesNotExistException "ApplicationDoesNotExistException" +// * ApplicationDoesNotExistException // The application does not exist with the IAM user or AWS account. // -// * ErrCodeInvalidDeploymentGroupNameException "InvalidDeploymentGroupNameException" +// * InvalidDeploymentGroupNameException // The deployment group name was specified in an invalid format. // -// * ErrCodeDeploymentGroupAlreadyExistsException "DeploymentGroupAlreadyExistsException" +// * DeploymentGroupAlreadyExistsException // A deployment group with the specified name with the IAM user or AWS account // already exists. // -// * ErrCodeDeploymentGroupNameRequiredException "DeploymentGroupNameRequiredException" +// * DeploymentGroupNameRequiredException // The deployment group name was not specified. // -// * ErrCodeDeploymentGroupDoesNotExistException "DeploymentGroupDoesNotExistException" +// * DeploymentGroupDoesNotExistException // The named deployment group with the IAM user or AWS account does not exist. // -// * ErrCodeInvalidEC2TagException "InvalidEC2TagException" +// * InvalidEC2TagException // The tag was specified in an invalid format. // -// * ErrCodeInvalidTagException "InvalidTagException" +// * InvalidTagException // The tag was specified in an invalid format. // -// * ErrCodeInvalidAutoScalingGroupException "InvalidAutoScalingGroupException" +// * InvalidAutoScalingGroupException // The Auto Scaling group was specified in an invalid format or does not exist. // -// * ErrCodeInvalidDeploymentConfigNameException "InvalidDeploymentConfigNameException" +// * InvalidDeploymentConfigNameException // The deployment configuration name was specified in an invalid format. // -// * ErrCodeDeploymentConfigDoesNotExistException "DeploymentConfigDoesNotExistException" +// * DeploymentConfigDoesNotExistException // The deployment configuration does not exist with the IAM user or AWS account. // -// * ErrCodeInvalidRoleException "InvalidRoleException" +// * 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 Amazon EC2 Auto Scaling. // -// * ErrCodeLifecycleHookLimitExceededException "LifecycleHookLimitExceededException" +// * LifecycleHookLimitExceededException // The limit for lifecycle hooks was exceeded. // -// * ErrCodeInvalidTriggerConfigException "InvalidTriggerConfigException" +// * InvalidTriggerConfigException // The trigger was specified in an invalid format. // -// * ErrCodeTriggerTargetsLimitExceededException "TriggerTargetsLimitExceededException" +// * TriggerTargetsLimitExceededException // The maximum allowed number of triggers was exceeded. // -// * ErrCodeInvalidAlarmConfigException "InvalidAlarmConfigException" +// * InvalidAlarmConfigException // The format of the alarm configuration is invalid. Possible causes include: // // * The alarm list is null. @@ -4944,52 +4957,52 @@ func (c *CodeDeploy) UpdateDeploymentGroupRequest(input *UpdateDeploymentGroupIn // // * The alarm configuration is enabled, but the alarm list is empty. // -// * ErrCodeAlarmsLimitExceededException "AlarmsLimitExceededException" +// * AlarmsLimitExceededException // The maximum number of alarms for a deployment group (10) was exceeded. // -// * ErrCodeInvalidAutoRollbackConfigException "InvalidAutoRollbackConfigException" +// * 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" +// * InvalidLoadBalancerInfoException // An invalid load balancer name, or no load balancer name, was specified. // -// * ErrCodeInvalidDeploymentStyleException "InvalidDeploymentStyleException" +// * InvalidDeploymentStyleException // An invalid deployment style was specified. Valid deployment types include // "IN_PLACE" and "BLUE_GREEN." Valid deployment options include "WITH_TRAFFIC_CONTROL" // and "WITHOUT_TRAFFIC_CONTROL." // -// * ErrCodeInvalidBlueGreenDeploymentConfigurationException "InvalidBlueGreenDeploymentConfigurationException" +// * InvalidBlueGreenDeploymentConfigurationException // The configuration for the blue/green deployment group was provided in an // invalid format. For information about deployment configuration format, see // CreateDeploymentConfig. // -// * ErrCodeInvalidEC2TagCombinationException "InvalidEC2TagCombinationException" +// * InvalidEC2TagCombinationException // A call was submitted that specified both Ec2TagFilters and Ec2TagSet, but // only one of these data types can be used in a single call. // -// * ErrCodeInvalidOnPremisesTagCombinationException "InvalidOnPremisesTagCombinationException" +// * InvalidOnPremisesTagCombinationException // A call was submitted that specified both OnPremisesTagFilters and OnPremisesTagSet, // but only one of these data types can be used in a single call. // -// * ErrCodeTagSetListLimitExceededException "TagSetListLimitExceededException" +// * TagSetListLimitExceededException // The number of tag groups included in the tag set list exceeded the maximum // allowed limit of 3. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input was specified in an invalid format. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // An API function was called too frequently. // -// * ErrCodeInvalidECSServiceException "InvalidECSServiceException" +// * InvalidECSServiceException // The Amazon ECS service identifier is not valid. // -// * ErrCodeInvalidTargetGroupPairException "InvalidTargetGroupPairException" +// * InvalidTargetGroupPairException // A target group pair associated with this deployment is not valid. // -// * ErrCodeECSServiceMappingLimitExceededException "ECSServiceMappingLimitExceededException" +// * ECSServiceMappingLimitExceededException // The Amazon ECS service is associated with more than one deployment groups. // An Amazon ECS service can be associated with only one deployment group. // @@ -5161,6 +5174,62 @@ func (s *AlarmConfiguration) SetIgnorePollAlarmFailure(v bool) *AlarmConfigurati return s } +// The maximum number of alarms for a deployment group (10) was exceeded. +type AlarmsLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AlarmsLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AlarmsLimitExceededException) GoString() string { + return s.String() +} + +func newErrorAlarmsLimitExceededException(v protocol.ResponseMetadata) error { + return &AlarmsLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AlarmsLimitExceededException) Code() string { + return "AlarmsLimitExceededException" +} + +// Message returns the exception's message. +func (s AlarmsLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AlarmsLimitExceededException) OrigErr() error { + return nil +} + +func (s AlarmsLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AlarmsLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AlarmsLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // A revision for an AWS Lambda or Amazon ECS deployment that is a YAML-formatted // or JSON-formatted string. For AWS Lambda and Amazon ECS deployments, the // revision is the same as the AppSpec file. This method replaces the deprecated @@ -5208,6 +5277,119 @@ func (s *AppSpecContent) SetSha256(v string) *AppSpecContent { return s } +// An application with the specified name with the IAM user or AWS account already +// exists. +type ApplicationAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApplicationAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApplicationAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorApplicationAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ApplicationAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApplicationAlreadyExistsException) Code() string { + return "ApplicationAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ApplicationAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApplicationAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ApplicationAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApplicationAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApplicationAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The application does not exist with the IAM user or AWS account. +type ApplicationDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApplicationDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApplicationDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorApplicationDoesNotExistException(v protocol.ResponseMetadata) error { + return &ApplicationDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApplicationDoesNotExistException) Code() string { + return "ApplicationDoesNotExistException" +} + +// Message returns the exception's message. +func (s ApplicationDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApplicationDoesNotExistException) OrigErr() error { + return nil +} + +func (s ApplicationDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApplicationDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApplicationDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + // Information about an application. type ApplicationInfo struct { _ struct{} `type:"structure"` @@ -5279,6 +5461,175 @@ func (s *ApplicationInfo) SetLinkedToGitHub(v bool) *ApplicationInfo { return s } +// More applications were attempted to be created than are allowed. +type ApplicationLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApplicationLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApplicationLimitExceededException) GoString() string { + return s.String() +} + +func newErrorApplicationLimitExceededException(v protocol.ResponseMetadata) error { + return &ApplicationLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApplicationLimitExceededException) Code() string { + return "ApplicationLimitExceededException" +} + +// Message returns the exception's message. +func (s ApplicationLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApplicationLimitExceededException) OrigErr() error { + return nil +} + +func (s ApplicationLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApplicationLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApplicationLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The minimum number of required application names was not specified. +type ApplicationNameRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApplicationNameRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApplicationNameRequiredException) GoString() string { + return s.String() +} + +func newErrorApplicationNameRequiredException(v protocol.ResponseMetadata) error { + return &ApplicationNameRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApplicationNameRequiredException) Code() string { + return "ApplicationNameRequiredException" +} + +// Message returns the exception's message. +func (s ApplicationNameRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApplicationNameRequiredException) OrigErr() error { + return nil +} + +func (s ApplicationNameRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApplicationNameRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApplicationNameRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified ARN is not supported. For example, it might be an ARN for a +// resource that is not expected. +type ArnNotSupportedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ArnNotSupportedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ArnNotSupportedException) GoString() string { + return s.String() +} + +func newErrorArnNotSupportedException(v protocol.ResponseMetadata) error { + return &ArnNotSupportedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ArnNotSupportedException) Code() string { + return "ArnNotSupportedException" +} + +// Message returns the exception's message. +func (s ArnNotSupportedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ArnNotSupportedException) OrigErr() error { + return nil +} + +func (s ArnNotSupportedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ArnNotSupportedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ArnNotSupportedException) RequestID() string { + return s.respMetadata.RequestID +} + // Information about a configuration for automatically rolling back to a previous // version of an application revision when a deployment is not completed successfully. type AutoRollbackConfiguration struct { @@ -5892,6 +6243,62 @@ func (s *BatchGetOnPremisesInstancesOutput) SetInstanceInfos(v []*InstanceInfo) return s } +// The maximum number of names or IDs allowed for this request (100) was exceeded. +type BatchLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BatchLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchLimitExceededException) GoString() string { + return s.String() +} + +func newErrorBatchLimitExceededException(v protocol.ResponseMetadata) error { + return &BatchLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BatchLimitExceededException) Code() string { + return "BatchLimitExceededException" +} + +// Message returns the exception's message. +func (s BatchLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BatchLimitExceededException) OrigErr() error { + return nil +} + +func (s BatchLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BatchLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BatchLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Information about blue/green deployment options for a deployment group. type BlueGreenDeploymentConfiguration struct { _ struct{} `type:"structure"` @@ -5985,6 +6392,62 @@ func (s *BlueInstanceTerminationOption) SetTerminationWaitTimeInMinutes(v int64) return s } +// A bucket name is required, but was not provided. +type BucketNameFilterRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BucketNameFilterRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BucketNameFilterRequiredException) GoString() string { + return s.String() +} + +func newErrorBucketNameFilterRequiredException(v protocol.ResponseMetadata) error { + return &BucketNameFilterRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BucketNameFilterRequiredException) Code() string { + return "BucketNameFilterRequiredException" +} + +// Message returns the exception's message. +func (s BucketNameFilterRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BucketNameFilterRequiredException) OrigErr() error { + return nil +} + +func (s BucketNameFilterRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BucketNameFilterRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BucketNameFilterRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + type ContinueDeploymentInput struct { _ struct{} `type:"structure"` @@ -6937,2282 +7400,7096 @@ func (s *DeleteGitHubAccountTokenOutput) SetTokenName(v string) *DeleteGitHubAcc return s } -// Information about a deployment configuration. -type DeploymentConfigInfo struct { - _ struct{} `type:"structure"` - - // The destination platform type for the deployment (Lambda, Server, or ECS). - ComputePlatform *string `locationName:"computePlatform" type:"string" enum:"ComputePlatform"` - - // The time at which the deployment configuration was created. - CreateTime *time.Time `locationName:"createTime" type:"timestamp"` - - // 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"` +// The deployment is already complete. +type DeploymentAlreadyCompletedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The configuration that specifies how the deployment traffic is routed. Only - // deployments with a Lambda compute platform can specify this. - TrafficRoutingConfig *TrafficRoutingConfig `locationName:"trafficRoutingConfig" type:"structure"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DeploymentConfigInfo) String() string { +func (s DeploymentAlreadyCompletedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeploymentConfigInfo) GoString() string { +func (s DeploymentAlreadyCompletedException) GoString() string { return s.String() } -// SetComputePlatform sets the ComputePlatform field's value. -func (s *DeploymentConfigInfo) SetComputePlatform(v string) *DeploymentConfigInfo { - s.ComputePlatform = &v - return s +func newErrorDeploymentAlreadyCompletedException(v protocol.ResponseMetadata) error { + return &DeploymentAlreadyCompletedException{ + respMetadata: v, + } } -// SetCreateTime sets the CreateTime field's value. -func (s *DeploymentConfigInfo) SetCreateTime(v time.Time) *DeploymentConfigInfo { - s.CreateTime = &v - return s +// Code returns the exception type name. +func (s DeploymentAlreadyCompletedException) Code() string { + return "DeploymentAlreadyCompletedException" } -// SetDeploymentConfigId sets the DeploymentConfigId field's value. -func (s *DeploymentConfigInfo) SetDeploymentConfigId(v string) *DeploymentConfigInfo { - s.DeploymentConfigId = &v - return s +// Message returns the exception's message. +func (s DeploymentAlreadyCompletedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetDeploymentConfigName sets the DeploymentConfigName field's value. -func (s *DeploymentConfigInfo) SetDeploymentConfigName(v string) *DeploymentConfigInfo { - s.DeploymentConfigName = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentAlreadyCompletedException) OrigErr() error { + return nil } -// SetMinimumHealthyHosts sets the MinimumHealthyHosts field's value. -func (s *DeploymentConfigInfo) SetMinimumHealthyHosts(v *MinimumHealthyHosts) *DeploymentConfigInfo { - s.MinimumHealthyHosts = v - return s +func (s DeploymentAlreadyCompletedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetTrafficRoutingConfig sets the TrafficRoutingConfig field's value. -func (s *DeploymentConfigInfo) SetTrafficRoutingConfig(v *TrafficRoutingConfig) *DeploymentConfigInfo { - s.TrafficRoutingConfig = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentAlreadyCompletedException) StatusCode() int { + return s.respMetadata.StatusCode } -// Information about a deployment group. -type DeploymentGroupInfo struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s DeploymentAlreadyCompletedException) RequestID() string { + return s.respMetadata.RequestID +} - // A list of alarms associated with the deployment group. - AlarmConfiguration *AlarmConfiguration `locationName:"alarmConfiguration" type:"structure"` +// A deployment configuration with the specified name with the IAM user or AWS +// account already exists . +type DeploymentConfigAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The application name. - ApplicationName *string `locationName:"applicationName" min:"1" type:"string"` + Message_ *string `locationName:"message" type:"string"` +} - // Information about the automatic rollback configuration associated with the - // deployment group. - AutoRollbackConfiguration *AutoRollbackConfiguration `locationName:"autoRollbackConfiguration" type:"structure"` +// String returns the string representation +func (s DeploymentConfigAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} - // A list of associated Auto Scaling groups. - AutoScalingGroups []*AutoScalingGroup `locationName:"autoScalingGroups" type:"list"` +// GoString returns the string representation +func (s DeploymentConfigAlreadyExistsException) GoString() string { + return s.String() +} - // Information about blue/green deployment options for a deployment group. - BlueGreenDeploymentConfiguration *BlueGreenDeploymentConfiguration `locationName:"blueGreenDeploymentConfiguration" type:"structure"` +func newErrorDeploymentConfigAlreadyExistsException(v protocol.ResponseMetadata) error { + return &DeploymentConfigAlreadyExistsException{ + respMetadata: v, + } +} - // The destination platform type for the deployment (Lambda, Server, or ECS). - ComputePlatform *string `locationName:"computePlatform" type:"string" enum:"ComputePlatform"` +// Code returns the exception type name. +func (s DeploymentConfigAlreadyExistsException) Code() string { + return "DeploymentConfigAlreadyExistsException" +} - // The deployment configuration name. - DeploymentConfigName *string `locationName:"deploymentConfigName" min:"1" type:"string"` +// Message returns the exception's message. +func (s DeploymentConfigAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The deployment group ID. - DeploymentGroupId *string `locationName:"deploymentGroupId" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentConfigAlreadyExistsException) OrigErr() error { + return nil +} - // The deployment group name. - DeploymentGroupName *string `locationName:"deploymentGroupName" min:"1" type:"string"` +func (s DeploymentConfigAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // Information about the type of deployment, either in-place or blue/green, - // you want to run and whether to route deployment traffic behind a load balancer. - DeploymentStyle *DeploymentStyle `locationName:"deploymentStyle" type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentConfigAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The Amazon EC2 tags on which to filter. The deployment group includes EC2 - // instances with any of the specified tags. - Ec2TagFilters []*EC2TagFilter `locationName:"ec2TagFilters" type:"list"` +// RequestID returns the service's response RequestID for request. +func (s DeploymentConfigAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} - // Information about groups of tags applied to an EC2 instance. The deployment - // group includes only EC2 instances identified by all of the tag groups. Cannot - // be used in the same call as ec2TagFilters. - Ec2TagSet *EC2TagSet `locationName:"ec2TagSet" type:"structure"` +// The deployment configuration does not exist with the IAM user or AWS account. +type DeploymentConfigDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The target Amazon ECS services in the deployment group. This applies only - // to deployment groups that use the Amazon ECS compute platform. A target Amazon - // ECS service is specified as an Amazon ECS cluster and service name pair using - // the format :. - EcsServices []*ECSService `locationName:"ecsServices" type:"list"` + Message_ *string `locationName:"message" type:"string"` +} - // Information about the most recent attempted deployment to the deployment - // group. - LastAttemptedDeployment *LastDeploymentInfo `locationName:"lastAttemptedDeployment" type:"structure"` +// String returns the string representation +func (s DeploymentConfigDoesNotExistException) String() string { + return awsutil.Prettify(s) +} - // Information about the most recent successful deployment to the deployment - // group. - LastSuccessfulDeployment *LastDeploymentInfo `locationName:"lastSuccessfulDeployment" type:"structure"` +// GoString returns the string representation +func (s DeploymentConfigDoesNotExistException) GoString() string { + return s.String() +} - // Information about the load balancer to use in a deployment. - LoadBalancerInfo *LoadBalancerInfo `locationName:"loadBalancerInfo" type:"structure"` +func newErrorDeploymentConfigDoesNotExistException(v protocol.ResponseMetadata) error { + return &DeploymentConfigDoesNotExistException{ + respMetadata: v, + } +} - // The on-premises instance tags on which to filter. The deployment group includes - // on-premises instances with any of the specified tags. - OnPremisesInstanceTagFilters []*TagFilter `locationName:"onPremisesInstanceTagFilters" type:"list"` +// Code returns the exception type name. +func (s DeploymentConfigDoesNotExistException) Code() string { + return "DeploymentConfigDoesNotExistException" +} - // Information about groups of tags applied to an on-premises instance. The - // deployment group includes only on-premises instances identified by all the - // tag groups. Cannot be used in the same call as onPremisesInstanceTagFilters. - OnPremisesTagSet *OnPremisesTagSet `locationName:"onPremisesTagSet" type:"structure"` +// Message returns the exception's message. +func (s DeploymentConfigDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // A service role Amazon Resource Name (ARN) that grants CodeDeploy permission - // to make calls to AWS services on your behalf. For more information, see Create - // a Service Role for AWS CodeDeploy (https://docs.aws.amazon.com/codedeploy/latest/userguide/getting-started-create-service-role.html) - // in the AWS CodeDeploy User Guide. - ServiceRoleArn *string `locationName:"serviceRoleArn" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentConfigDoesNotExistException) OrigErr() error { + return nil +} - // Information about the deployment group's target revision, including type - // and location. - TargetRevision *RevisionLocation `locationName:"targetRevision" type:"structure"` +func (s DeploymentConfigDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // Information about triggers associated with the deployment group. - TriggerConfigurations []*TriggerConfig `locationName:"triggerConfigurations" type:"list"` +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentConfigDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DeploymentConfigDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// The deployment configuration is still in use. +type DeploymentConfigInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DeploymentGroupInfo) String() string { +func (s DeploymentConfigInUseException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeploymentGroupInfo) GoString() string { +func (s DeploymentConfigInUseException) GoString() string { return s.String() } -// SetAlarmConfiguration sets the AlarmConfiguration field's value. -func (s *DeploymentGroupInfo) SetAlarmConfiguration(v *AlarmConfiguration) *DeploymentGroupInfo { - s.AlarmConfiguration = v - return s +func newErrorDeploymentConfigInUseException(v protocol.ResponseMetadata) error { + return &DeploymentConfigInUseException{ + respMetadata: v, + } } -// SetApplicationName sets the ApplicationName field's value. -func (s *DeploymentGroupInfo) SetApplicationName(v string) *DeploymentGroupInfo { - s.ApplicationName = &v - return s +// Code returns the exception type name. +func (s DeploymentConfigInUseException) Code() string { + return "DeploymentConfigInUseException" } -// SetAutoRollbackConfiguration sets the AutoRollbackConfiguration field's value. -func (s *DeploymentGroupInfo) SetAutoRollbackConfiguration(v *AutoRollbackConfiguration) *DeploymentGroupInfo { - s.AutoRollbackConfiguration = v - return s +// Message returns the exception's message. +func (s DeploymentConfigInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetAutoScalingGroups sets the AutoScalingGroups field's value. -func (s *DeploymentGroupInfo) SetAutoScalingGroups(v []*AutoScalingGroup) *DeploymentGroupInfo { - s.AutoScalingGroups = v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentConfigInUseException) OrigErr() error { + return nil } -// SetBlueGreenDeploymentConfiguration sets the BlueGreenDeploymentConfiguration field's value. -func (s *DeploymentGroupInfo) SetBlueGreenDeploymentConfiguration(v *BlueGreenDeploymentConfiguration) *DeploymentGroupInfo { - s.BlueGreenDeploymentConfiguration = v - return s +func (s DeploymentConfigInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetComputePlatform sets the ComputePlatform field's value. -func (s *DeploymentGroupInfo) SetComputePlatform(v string) *DeploymentGroupInfo { - s.ComputePlatform = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentConfigInUseException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetDeploymentConfigName sets the DeploymentConfigName field's value. -func (s *DeploymentGroupInfo) SetDeploymentConfigName(v string) *DeploymentGroupInfo { - s.DeploymentConfigName = &v - return s +// RequestID returns the service's response RequestID for request. +func (s DeploymentConfigInUseException) RequestID() string { + return s.respMetadata.RequestID } -// SetDeploymentGroupId sets the DeploymentGroupId field's value. -func (s *DeploymentGroupInfo) SetDeploymentGroupId(v string) *DeploymentGroupInfo { - s.DeploymentGroupId = &v - return s +// Information about a deployment configuration. +type DeploymentConfigInfo struct { + _ struct{} `type:"structure"` + + // The destination platform type for the deployment (Lambda, Server, or ECS). + ComputePlatform *string `locationName:"computePlatform" type:"string" enum:"ComputePlatform"` + + // The time at which the deployment configuration was created. + CreateTime *time.Time `locationName:"createTime" type:"timestamp"` + + // 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"` + + // The configuration that specifies how the deployment traffic is routed. Only + // deployments with a Lambda compute platform can specify this. + TrafficRoutingConfig *TrafficRoutingConfig `locationName:"trafficRoutingConfig" type:"structure"` } -// SetDeploymentGroupName sets the DeploymentGroupName field's value. -func (s *DeploymentGroupInfo) SetDeploymentGroupName(v string) *DeploymentGroupInfo { - s.DeploymentGroupName = &v - return s +// String returns the string representation +func (s DeploymentConfigInfo) String() string { + return awsutil.Prettify(s) } -// SetDeploymentStyle sets the DeploymentStyle field's value. -func (s *DeploymentGroupInfo) SetDeploymentStyle(v *DeploymentStyle) *DeploymentGroupInfo { - s.DeploymentStyle = v - return s +// GoString returns the string representation +func (s DeploymentConfigInfo) GoString() string { + return s.String() } -// SetEc2TagFilters sets the Ec2TagFilters field's value. -func (s *DeploymentGroupInfo) SetEc2TagFilters(v []*EC2TagFilter) *DeploymentGroupInfo { - s.Ec2TagFilters = v +// SetComputePlatform sets the ComputePlatform field's value. +func (s *DeploymentConfigInfo) SetComputePlatform(v string) *DeploymentConfigInfo { + s.ComputePlatform = &v return s } -// SetEc2TagSet sets the Ec2TagSet field's value. -func (s *DeploymentGroupInfo) SetEc2TagSet(v *EC2TagSet) *DeploymentGroupInfo { - s.Ec2TagSet = v +// SetCreateTime sets the CreateTime field's value. +func (s *DeploymentConfigInfo) SetCreateTime(v time.Time) *DeploymentConfigInfo { + s.CreateTime = &v return s } -// SetEcsServices sets the EcsServices field's value. -func (s *DeploymentGroupInfo) SetEcsServices(v []*ECSService) *DeploymentGroupInfo { - s.EcsServices = v +// SetDeploymentConfigId sets the DeploymentConfigId field's value. +func (s *DeploymentConfigInfo) SetDeploymentConfigId(v string) *DeploymentConfigInfo { + s.DeploymentConfigId = &v return s } -// SetLastAttemptedDeployment sets the LastAttemptedDeployment field's value. -func (s *DeploymentGroupInfo) SetLastAttemptedDeployment(v *LastDeploymentInfo) *DeploymentGroupInfo { - s.LastAttemptedDeployment = v +// SetDeploymentConfigName sets the DeploymentConfigName field's value. +func (s *DeploymentConfigInfo) SetDeploymentConfigName(v string) *DeploymentConfigInfo { + s.DeploymentConfigName = &v return s } -// SetLastSuccessfulDeployment sets the LastSuccessfulDeployment field's value. -func (s *DeploymentGroupInfo) SetLastSuccessfulDeployment(v *LastDeploymentInfo) *DeploymentGroupInfo { - s.LastSuccessfulDeployment = v +// SetMinimumHealthyHosts sets the MinimumHealthyHosts field's value. +func (s *DeploymentConfigInfo) SetMinimumHealthyHosts(v *MinimumHealthyHosts) *DeploymentConfigInfo { + s.MinimumHealthyHosts = v return s } -// SetLoadBalancerInfo sets the LoadBalancerInfo field's value. -func (s *DeploymentGroupInfo) SetLoadBalancerInfo(v *LoadBalancerInfo) *DeploymentGroupInfo { - s.LoadBalancerInfo = v +// SetTrafficRoutingConfig sets the TrafficRoutingConfig field's value. +func (s *DeploymentConfigInfo) SetTrafficRoutingConfig(v *TrafficRoutingConfig) *DeploymentConfigInfo { + s.TrafficRoutingConfig = v return s } -// SetOnPremisesInstanceTagFilters sets the OnPremisesInstanceTagFilters field's value. -func (s *DeploymentGroupInfo) SetOnPremisesInstanceTagFilters(v []*TagFilter) *DeploymentGroupInfo { - s.OnPremisesInstanceTagFilters = v - return s +// The deployment configurations limit was exceeded. +type DeploymentConfigLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetOnPremisesTagSet sets the OnPremisesTagSet field's value. -func (s *DeploymentGroupInfo) SetOnPremisesTagSet(v *OnPremisesTagSet) *DeploymentGroupInfo { - s.OnPremisesTagSet = v - return s +// String returns the string representation +func (s DeploymentConfigLimitExceededException) String() string { + return awsutil.Prettify(s) } -// SetServiceRoleArn sets the ServiceRoleArn field's value. -func (s *DeploymentGroupInfo) SetServiceRoleArn(v string) *DeploymentGroupInfo { - s.ServiceRoleArn = &v - return s +// GoString returns the string representation +func (s DeploymentConfigLimitExceededException) GoString() string { + return s.String() } -// SetTargetRevision sets the TargetRevision field's value. -func (s *DeploymentGroupInfo) SetTargetRevision(v *RevisionLocation) *DeploymentGroupInfo { - s.TargetRevision = v - return s +func newErrorDeploymentConfigLimitExceededException(v protocol.ResponseMetadata) error { + return &DeploymentConfigLimitExceededException{ + respMetadata: v, + } } -// SetTriggerConfigurations sets the TriggerConfigurations field's value. -func (s *DeploymentGroupInfo) SetTriggerConfigurations(v []*TriggerConfig) *DeploymentGroupInfo { - s.TriggerConfigurations = v - return s +// Code returns the exception type name. +func (s DeploymentConfigLimitExceededException) Code() string { + return "DeploymentConfigLimitExceededException" } -// Information about a deployment. -type DeploymentInfo struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s DeploymentConfigLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // 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" deprecated:"true" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentConfigLimitExceededException) OrigErr() error { + return nil +} - // The application name. - ApplicationName *string `locationName:"applicationName" min:"1" type:"string"` +func (s DeploymentConfigLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // Information about the automatic rollback configuration associated with the - // deployment. - AutoRollbackConfiguration *AutoRollbackConfiguration `locationName:"autoRollbackConfiguration" type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentConfigLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} - // Information about blue/green deployment options for this deployment. - BlueGreenDeploymentConfiguration *BlueGreenDeploymentConfiguration `locationName:"blueGreenDeploymentConfiguration" type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s DeploymentConfigLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} - // A timestamp that indicates when the deployment was complete. - CompleteTime *time.Time `locationName:"completeTime" type:"timestamp"` +// The deployment configuration name was not specified. +type DeploymentConfigNameRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The destination platform type for the deployment (Lambda, Server, or ECS). - ComputePlatform *string `locationName:"computePlatform" type:"string" enum:"ComputePlatform"` + Message_ *string `locationName:"message" type:"string"` +} - // A timestamp that indicates when the deployment was created. - CreateTime *time.Time `locationName:"createTime" type:"timestamp"` +// String returns the string representation +func (s DeploymentConfigNameRequiredException) String() string { + return awsutil.Prettify(s) +} - // The means by which the deployment was created: - // - // * user: A user created the deployment. - // - // * autoscaling: Amazon EC2 Auto Scaling created the deployment. - // - // * codeDeployRollback: A rollback process created the deployment. - Creator *string `locationName:"creator" type:"string" enum:"DeploymentCreator"` +// GoString returns the string representation +func (s DeploymentConfigNameRequiredException) GoString() string { + return s.String() +} - // The deployment configuration name. - DeploymentConfigName *string `locationName:"deploymentConfigName" min:"1" type:"string"` +func newErrorDeploymentConfigNameRequiredException(v protocol.ResponseMetadata) error { + return &DeploymentConfigNameRequiredException{ + respMetadata: v, + } +} - // The deployment group name. - DeploymentGroupName *string `locationName:"deploymentGroupName" min:"1" type:"string"` +// Code returns the exception type name. +func (s DeploymentConfigNameRequiredException) Code() string { + return "DeploymentConfigNameRequiredException" +} - // The unique ID of a deployment. - DeploymentId *string `locationName:"deploymentId" type:"string"` +// Message returns the exception's message. +func (s DeploymentConfigNameRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // A summary of the deployment status of the instances in the deployment. - DeploymentOverview *DeploymentOverview `locationName:"deploymentOverview" type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentConfigNameRequiredException) OrigErr() error { + return nil +} - // Messages that contain information about the status of a deployment. - DeploymentStatusMessages []*string `locationName:"deploymentStatusMessages" type:"list"` +func (s DeploymentConfigNameRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // Information about the type of deployment, either in-place or blue/green, - // you want to run and whether to route deployment traffic behind a load balancer. - DeploymentStyle *DeploymentStyle `locationName:"deploymentStyle" type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentConfigNameRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} - // A comment about the deployment. - Description *string `locationName:"description" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s DeploymentConfigNameRequiredException) RequestID() string { + return s.respMetadata.RequestID +} - // Information about any error associated with this deployment. - ErrorInformation *ErrorInformation `locationName:"errorInformation" type:"structure"` +// The deployment with the IAM user or AWS account does not exist. +type DeploymentDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Information about how AWS CodeDeploy handles files that already exist in - // a deployment target location but weren't part of the previous successful - // deployment. - // - // * DISALLOW: The deployment fails. This is also the default behavior if - // no option is specified. - // - // * OVERWRITE: The version of the file from the application revision currently - // being deployed replaces the version already on the instance. - // - // * RETAIN: The version of the file already on the instance is kept and - // used as part of the new deployment. - FileExistsBehavior *string `locationName:"fileExistsBehavior" type:"string" enum:"FileExistsBehavior"` + Message_ *string `locationName:"message" type:"string"` +} - // If true, then if an ApplicationStop, BeforeBlockTraffic, or AfterBlockTraffic - // deployment lifecycle event to an instance fails, then the deployment continues - // to the next deployment lifecycle event. For example, if ApplicationStop fails, - // the deployment continues with DownloadBundle. If BeforeBlockTraffic fails, - // the deployment continues with BlockTraffic. If AfterBlockTraffic fails, the - // deployment continues with ApplicationStop. - // - // If false or not specified, then if a lifecycle event fails during a deployment - // to an instance, that deployment fails. If deployment to that instance is - // part of an overall deployment and the number of healthy hosts is not less - // than the minimum number of healthy hosts, then a deployment to the next instance - // is attempted. - // - // During a deployment, the AWS CodeDeploy agent runs the scripts specified - // for ApplicationStop, BeforeBlockTraffic, and AfterBlockTraffic in the AppSpec - // file from the previous successful deployment. (All other scripts are run - // from the AppSpec file in the current deployment.) If one of these scripts - // contains an error and does not run successfully, the deployment can fail. - // - // If the cause of the failure is a script from the last successful deployment - // that will never run successfully, create a new deployment and use ignoreApplicationStopFailures - // to specify that the ApplicationStop, BeforeBlockTraffic, and AfterBlockTraffic - // failures should be ignored. - IgnoreApplicationStopFailures *bool `locationName:"ignoreApplicationStopFailures" type:"boolean"` +// String returns the string representation +func (s DeploymentDoesNotExistException) String() string { + return awsutil.Prettify(s) +} - // 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"` +// GoString returns the string representation +func (s DeploymentDoesNotExistException) GoString() string { + return s.String() +} - // Information about the load balancer used in the deployment. - LoadBalancerInfo *LoadBalancerInfo `locationName:"loadBalancerInfo" type:"structure"` +func newErrorDeploymentDoesNotExistException(v protocol.ResponseMetadata) error { + return &DeploymentDoesNotExistException{ + respMetadata: v, + } +} - // Information about the application revision that was deployed to the deployment - // group before the most recent successful deployment. - PreviousRevision *RevisionLocation `locationName:"previousRevision" type:"structure"` +// Code returns the exception type name. +func (s DeploymentDoesNotExistException) Code() string { + return "DeploymentDoesNotExistException" +} - // Information about the location of stored application artifacts and the service - // from which to retrieve them. - Revision *RevisionLocation `locationName:"revision" type:"structure"` +// Message returns the exception's message. +func (s DeploymentDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Information about a deployment rollback. - RollbackInfo *RollbackInfo `locationName:"rollbackInfo" type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentDoesNotExistException) OrigErr() error { + return nil +} - // A timestamp that indicates when the deployment was deployed to the deployment - // group. - // - // In some cases, the reported value of the start time might be later than the - // complete time. This is due to differences in the clock settings of backend - // servers that participate in the deployment process. - StartTime *time.Time `locationName:"startTime" type:"timestamp"` +func (s DeploymentDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The current state of the deployment as a whole. - Status *string `locationName:"status" type:"string" enum:"DeploymentStatus"` +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} - // Information about the instances that belong to the replacement environment - // in a blue/green deployment. - TargetInstances *TargetInstances `locationName:"targetInstances" type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s DeploymentDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} - // Indicates whether only instances that are not running the latest application - // revision are to be deployed to. - UpdateOutdatedInstancesOnly *bool `locationName:"updateOutdatedInstancesOnly" type:"boolean"` +// A deployment group with the specified name with the IAM user or AWS account +// already exists. +type DeploymentGroupAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DeploymentInfo) String() string { +func (s DeploymentGroupAlreadyExistsException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeploymentInfo) GoString() string { +func (s DeploymentGroupAlreadyExistsException) GoString() string { return s.String() } -// SetAdditionalDeploymentStatusInfo sets the AdditionalDeploymentStatusInfo field's value. -func (s *DeploymentInfo) SetAdditionalDeploymentStatusInfo(v string) *DeploymentInfo { - s.AdditionalDeploymentStatusInfo = &v - return s +func newErrorDeploymentGroupAlreadyExistsException(v protocol.ResponseMetadata) error { + return &DeploymentGroupAlreadyExistsException{ + respMetadata: v, + } } -// SetApplicationName sets the ApplicationName field's value. -func (s *DeploymentInfo) SetApplicationName(v string) *DeploymentInfo { - s.ApplicationName = &v - return s +// Code returns the exception type name. +func (s DeploymentGroupAlreadyExistsException) Code() string { + return "DeploymentGroupAlreadyExistsException" } -// SetAutoRollbackConfiguration sets the AutoRollbackConfiguration field's value. -func (s *DeploymentInfo) SetAutoRollbackConfiguration(v *AutoRollbackConfiguration) *DeploymentInfo { - s.AutoRollbackConfiguration = v - return s +// Message returns the exception's message. +func (s DeploymentGroupAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetBlueGreenDeploymentConfiguration sets the BlueGreenDeploymentConfiguration field's value. -func (s *DeploymentInfo) SetBlueGreenDeploymentConfiguration(v *BlueGreenDeploymentConfiguration) *DeploymentInfo { - s.BlueGreenDeploymentConfiguration = v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentGroupAlreadyExistsException) OrigErr() error { + return nil } -// SetCompleteTime sets the CompleteTime field's value. -func (s *DeploymentInfo) SetCompleteTime(v time.Time) *DeploymentInfo { - s.CompleteTime = &v - return s +func (s DeploymentGroupAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetComputePlatform sets the ComputePlatform field's value. -func (s *DeploymentInfo) SetComputePlatform(v string) *DeploymentInfo { - s.ComputePlatform = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentGroupAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetCreateTime sets the CreateTime field's value. -func (s *DeploymentInfo) SetCreateTime(v time.Time) *DeploymentInfo { - s.CreateTime = &v - return s +// RequestID returns the service's response RequestID for request. +func (s DeploymentGroupAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID } -// SetCreator sets the Creator field's value. -func (s *DeploymentInfo) SetCreator(v string) *DeploymentInfo { - s.Creator = &v - return s -} +// The named deployment group with the IAM user or AWS account does not exist. +type DeploymentGroupDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata -// SetDeploymentConfigName sets the DeploymentConfigName field's value. -func (s *DeploymentInfo) SetDeploymentConfigName(v string) *DeploymentInfo { - s.DeploymentConfigName = &v - return s + Message_ *string `locationName:"message" type:"string"` } -// SetDeploymentGroupName sets the DeploymentGroupName field's value. -func (s *DeploymentInfo) SetDeploymentGroupName(v string) *DeploymentInfo { - s.DeploymentGroupName = &v - return s +// String returns the string representation +func (s DeploymentGroupDoesNotExistException) String() string { + return awsutil.Prettify(s) } -// SetDeploymentId sets the DeploymentId field's value. -func (s *DeploymentInfo) SetDeploymentId(v string) *DeploymentInfo { - s.DeploymentId = &v - return s +// GoString returns the string representation +func (s DeploymentGroupDoesNotExistException) GoString() string { + return s.String() } -// SetDeploymentOverview sets the DeploymentOverview field's value. -func (s *DeploymentInfo) SetDeploymentOverview(v *DeploymentOverview) *DeploymentInfo { - s.DeploymentOverview = v - return s +func newErrorDeploymentGroupDoesNotExistException(v protocol.ResponseMetadata) error { + return &DeploymentGroupDoesNotExistException{ + respMetadata: v, + } } -// SetDeploymentStatusMessages sets the DeploymentStatusMessages field's value. -func (s *DeploymentInfo) SetDeploymentStatusMessages(v []*string) *DeploymentInfo { - s.DeploymentStatusMessages = v - return s +// Code returns the exception type name. +func (s DeploymentGroupDoesNotExistException) Code() string { + return "DeploymentGroupDoesNotExistException" } -// SetDeploymentStyle sets the DeploymentStyle field's value. -func (s *DeploymentInfo) SetDeploymentStyle(v *DeploymentStyle) *DeploymentInfo { - s.DeploymentStyle = v - return s +// Message returns the exception's message. +func (s DeploymentGroupDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetDescription sets the Description field's value. -func (s *DeploymentInfo) SetDescription(v string) *DeploymentInfo { - s.Description = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentGroupDoesNotExistException) OrigErr() error { + return nil } -// SetErrorInformation sets the ErrorInformation field's value. -func (s *DeploymentInfo) SetErrorInformation(v *ErrorInformation) *DeploymentInfo { - s.ErrorInformation = v - return s +func (s DeploymentGroupDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetFileExistsBehavior sets the FileExistsBehavior field's value. -func (s *DeploymentInfo) SetFileExistsBehavior(v string) *DeploymentInfo { - s.FileExistsBehavior = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentGroupDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetIgnoreApplicationStopFailures sets the IgnoreApplicationStopFailures field's value. -func (s *DeploymentInfo) SetIgnoreApplicationStopFailures(v bool) *DeploymentInfo { - s.IgnoreApplicationStopFailures = &v - return s +// RequestID returns the service's response RequestID for request. +func (s DeploymentGroupDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID } -// SetInstanceTerminationWaitTimeStarted sets the InstanceTerminationWaitTimeStarted field's value. -func (s *DeploymentInfo) SetInstanceTerminationWaitTimeStarted(v bool) *DeploymentInfo { - s.InstanceTerminationWaitTimeStarted = &v - return s -} +// Information about a deployment group. +type DeploymentGroupInfo struct { + _ struct{} `type:"structure"` -// SetLoadBalancerInfo sets the LoadBalancerInfo field's value. -func (s *DeploymentInfo) SetLoadBalancerInfo(v *LoadBalancerInfo) *DeploymentInfo { - s.LoadBalancerInfo = v - return s -} + // A list of alarms associated with the deployment group. + AlarmConfiguration *AlarmConfiguration `locationName:"alarmConfiguration" type:"structure"` -// SetPreviousRevision sets the PreviousRevision field's value. -func (s *DeploymentInfo) SetPreviousRevision(v *RevisionLocation) *DeploymentInfo { - s.PreviousRevision = v + // 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 destination platform type for the deployment (Lambda, Server, or ECS). + ComputePlatform *string `locationName:"computePlatform" type:"string" enum:"ComputePlatform"` + + // 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 in-place 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. The deployment group includes EC2 + // instances with any of the specified tags. + Ec2TagFilters []*EC2TagFilter `locationName:"ec2TagFilters" type:"list"` + + // Information about groups of tags applied to an EC2 instance. The deployment + // group includes only EC2 instances identified by all of the tag groups. Cannot + // be used in the same call as ec2TagFilters. + Ec2TagSet *EC2TagSet `locationName:"ec2TagSet" type:"structure"` + + // The target Amazon ECS services in the deployment group. This applies only + // to deployment groups that use the Amazon ECS compute platform. A target Amazon + // ECS service is specified as an Amazon ECS cluster and service name pair using + // the format :. + EcsServices []*ECSService `locationName:"ecsServices" type:"list"` + + // Information about the most recent attempted deployment to the deployment + // group. + LastAttemptedDeployment *LastDeploymentInfo `locationName:"lastAttemptedDeployment" type:"structure"` + + // Information about the most recent successful deployment to the deployment + // group. + LastSuccessfulDeployment *LastDeploymentInfo `locationName:"lastSuccessfulDeployment" type:"structure"` + + // Information about the load balancer to use in a deployment. + LoadBalancerInfo *LoadBalancerInfo `locationName:"loadBalancerInfo" type:"structure"` + + // The on-premises instance tags on which to filter. The deployment group includes + // on-premises instances with any of the specified tags. + OnPremisesInstanceTagFilters []*TagFilter `locationName:"onPremisesInstanceTagFilters" type:"list"` + + // Information about groups of tags applied to an on-premises instance. The + // deployment group includes only on-premises instances identified by all the + // tag groups. Cannot be used in the same call as onPremisesInstanceTagFilters. + OnPremisesTagSet *OnPremisesTagSet `locationName:"onPremisesTagSet" type:"structure"` + + // A service role Amazon Resource Name (ARN) that grants CodeDeploy permission + // to make calls to AWS services on your behalf. For more information, see Create + // a Service Role for AWS CodeDeploy (https://docs.aws.amazon.com/codedeploy/latest/userguide/getting-started-create-service-role.html) + // in the AWS CodeDeploy User Guide. + 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 } -// SetRevision sets the Revision field's value. -func (s *DeploymentInfo) SetRevision(v *RevisionLocation) *DeploymentInfo { - s.Revision = v +// SetApplicationName sets the ApplicationName field's value. +func (s *DeploymentGroupInfo) SetApplicationName(v string) *DeploymentGroupInfo { + s.ApplicationName = &v return s } -// SetRollbackInfo sets the RollbackInfo field's value. -func (s *DeploymentInfo) SetRollbackInfo(v *RollbackInfo) *DeploymentInfo { - s.RollbackInfo = v +// 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 +} + +// SetComputePlatform sets the ComputePlatform field's value. +func (s *DeploymentGroupInfo) SetComputePlatform(v string) *DeploymentGroupInfo { + s.ComputePlatform = &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 +} + +// SetEc2TagSet sets the Ec2TagSet field's value. +func (s *DeploymentGroupInfo) SetEc2TagSet(v *EC2TagSet) *DeploymentGroupInfo { + s.Ec2TagSet = v + return s +} + +// SetEcsServices sets the EcsServices field's value. +func (s *DeploymentGroupInfo) SetEcsServices(v []*ECSService) *DeploymentGroupInfo { + s.EcsServices = v + return s +} + +// SetLastAttemptedDeployment sets the LastAttemptedDeployment field's value. +func (s *DeploymentGroupInfo) SetLastAttemptedDeployment(v *LastDeploymentInfo) *DeploymentGroupInfo { + s.LastAttemptedDeployment = v + return s +} + +// SetLastSuccessfulDeployment sets the LastSuccessfulDeployment field's value. +func (s *DeploymentGroupInfo) SetLastSuccessfulDeployment(v *LastDeploymentInfo) *DeploymentGroupInfo { + s.LastSuccessfulDeployment = 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 +} + +// SetOnPremisesTagSet sets the OnPremisesTagSet field's value. +func (s *DeploymentGroupInfo) SetOnPremisesTagSet(v *OnPremisesTagSet) *DeploymentGroupInfo { + s.OnPremisesTagSet = 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 } -// SetStartTime sets the StartTime field's value. -func (s *DeploymentInfo) SetStartTime(v time.Time) *DeploymentInfo { - s.StartTime = &v - return s +// SetTriggerConfigurations sets the TriggerConfigurations field's value. +func (s *DeploymentGroupInfo) SetTriggerConfigurations(v []*TriggerConfig) *DeploymentGroupInfo { + s.TriggerConfigurations = v + return s +} + +// The deployment groups limit was exceeded. +type DeploymentGroupLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DeploymentGroupLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeploymentGroupLimitExceededException) GoString() string { + return s.String() +} + +func newErrorDeploymentGroupLimitExceededException(v protocol.ResponseMetadata) error { + return &DeploymentGroupLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DeploymentGroupLimitExceededException) Code() string { + return "DeploymentGroupLimitExceededException" +} + +// Message returns the exception's message. +func (s DeploymentGroupLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentGroupLimitExceededException) OrigErr() error { + return nil +} + +func (s DeploymentGroupLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentGroupLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DeploymentGroupLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The deployment group name was not specified. +type DeploymentGroupNameRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DeploymentGroupNameRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeploymentGroupNameRequiredException) GoString() string { + return s.String() +} + +func newErrorDeploymentGroupNameRequiredException(v protocol.ResponseMetadata) error { + return &DeploymentGroupNameRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DeploymentGroupNameRequiredException) Code() string { + return "DeploymentGroupNameRequiredException" +} + +// Message returns the exception's message. +func (s DeploymentGroupNameRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentGroupNameRequiredException) OrigErr() error { + return nil +} + +func (s DeploymentGroupNameRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentGroupNameRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DeploymentGroupNameRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// At least one deployment ID must be specified. +type DeploymentIdRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DeploymentIdRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeploymentIdRequiredException) GoString() string { + return s.String() +} + +func newErrorDeploymentIdRequiredException(v protocol.ResponseMetadata) error { + return &DeploymentIdRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DeploymentIdRequiredException) Code() string { + return "DeploymentIdRequiredException" +} + +// Message returns the exception's message. +func (s DeploymentIdRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentIdRequiredException) OrigErr() error { + return nil +} + +func (s DeploymentIdRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentIdRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DeploymentIdRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about a deployment. +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" deprecated:"true" 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 that indicates when the deployment was complete. + CompleteTime *time.Time `locationName:"completeTime" type:"timestamp"` + + // The destination platform type for the deployment (Lambda, Server, or ECS). + ComputePlatform *string `locationName:"computePlatform" type:"string" enum:"ComputePlatform"` + + // A timestamp that indicates when the deployment was created. + CreateTime *time.Time `locationName:"createTime" type:"timestamp"` + + // The means by which the deployment was created: + // + // * user: A user created the deployment. + // + // * autoscaling: Amazon EC2 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 unique ID of a deployment. + DeploymentId *string `locationName:"deploymentId" type:"string"` + + // A summary of the deployment status of the instances in the deployment. + DeploymentOverview *DeploymentOverview `locationName:"deploymentOverview" type:"structure"` + + // Messages that contain information about the status of a deployment. + DeploymentStatusMessages []*string `locationName:"deploymentStatusMessages" type:"list"` + + // Information about the type of deployment, either in-place 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"` + + // Information about how AWS CodeDeploy handles files that already exist in + // a deployment target location but weren't part of the previous successful + // deployment. + // + // * DISALLOW: The deployment fails. This is also the default behavior if + // no option is specified. + // + // * OVERWRITE: The version of the file from the application revision currently + // being deployed replaces the version already on the instance. + // + // * RETAIN: The version of the file already on the instance is kept and + // used as part of the new deployment. + FileExistsBehavior *string `locationName:"fileExistsBehavior" type:"string" enum:"FileExistsBehavior"` + + // If true, then if an ApplicationStop, BeforeBlockTraffic, or AfterBlockTraffic + // deployment lifecycle event to an instance fails, then the deployment continues + // to the next deployment lifecycle event. For example, if ApplicationStop fails, + // the deployment continues with DownloadBundle. If BeforeBlockTraffic fails, + // the deployment continues with BlockTraffic. If AfterBlockTraffic fails, the + // deployment continues with ApplicationStop. + // + // If false or not specified, then if a lifecycle event fails during a deployment + // to an instance, that deployment fails. If deployment to that instance is + // part of an overall deployment and the number of healthy hosts is not less + // than the minimum number of healthy hosts, then a deployment to the next instance + // is attempted. + // + // During a deployment, the AWS CodeDeploy agent runs the scripts specified + // for ApplicationStop, BeforeBlockTraffic, and AfterBlockTraffic in the AppSpec + // file from the previous successful deployment. (All other scripts are run + // from the AppSpec file in the current deployment.) If one of these scripts + // contains an error and does not run successfully, the deployment can fail. + // + // If the cause of the failure is a script from the last successful deployment + // that will never run successfully, create a new deployment and use ignoreApplicationStopFailures + // to specify that the ApplicationStop, BeforeBlockTraffic, and AfterBlockTraffic + // failures should be ignored. + 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 the deployment. + LoadBalancerInfo *LoadBalancerInfo `locationName:"loadBalancerInfo" type:"structure"` + + // Information about the application revision that was deployed to the deployment + // group before the most recent successful deployment. + PreviousRevision *RevisionLocation `locationName:"previousRevision" 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 that indicates when the deployment was deployed to the deployment + // group. + // + // In some cases, the reported value of the start time might be later than the + // complete time. This is due to differences in the clock settings of backend + // servers that participate in the deployment process. + StartTime *time.Time `locationName:"startTime" type:"timestamp"` + + // 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 +} + +// SetComputePlatform sets the ComputePlatform field's value. +func (s *DeploymentInfo) SetComputePlatform(v string) *DeploymentInfo { + s.ComputePlatform = &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 +} + +// SetDeploymentStatusMessages sets the DeploymentStatusMessages field's value. +func (s *DeploymentInfo) SetDeploymentStatusMessages(v []*string) *DeploymentInfo { + s.DeploymentStatusMessages = 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 +} + +// SetFileExistsBehavior sets the FileExistsBehavior field's value. +func (s *DeploymentInfo) SetFileExistsBehavior(v string) *DeploymentInfo { + s.FileExistsBehavior = &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 +} + +// SetPreviousRevision sets the PreviousRevision field's value. +func (s *DeploymentInfo) SetPreviousRevision(v *RevisionLocation) *DeploymentInfo { + s.PreviousRevision = 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 +} + +// The deployment does not have a status of Ready and can't continue yet. +type DeploymentIsNotInReadyStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DeploymentIsNotInReadyStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeploymentIsNotInReadyStateException) GoString() string { + return s.String() +} + +func newErrorDeploymentIsNotInReadyStateException(v protocol.ResponseMetadata) error { + return &DeploymentIsNotInReadyStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DeploymentIsNotInReadyStateException) Code() string { + return "DeploymentIsNotInReadyStateException" +} + +// Message returns the exception's message. +func (s DeploymentIsNotInReadyStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentIsNotInReadyStateException) OrigErr() error { + return nil +} + +func (s DeploymentIsNotInReadyStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentIsNotInReadyStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DeploymentIsNotInReadyStateException) RequestID() string { + return s.respMetadata.RequestID +} + +// The number of allowed deployments was exceeded. +type DeploymentLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DeploymentLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeploymentLimitExceededException) GoString() string { + return s.String() +} + +func newErrorDeploymentLimitExceededException(v protocol.ResponseMetadata) error { + return &DeploymentLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DeploymentLimitExceededException) Code() string { + return "DeploymentLimitExceededException" +} + +// Message returns the exception's message. +func (s DeploymentLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentLimitExceededException) OrigErr() error { + return nil +} + +func (s DeploymentLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DeploymentLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified deployment has not started. +type DeploymentNotStartedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DeploymentNotStartedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeploymentNotStartedException) GoString() string { + return s.String() +} + +func newErrorDeploymentNotStartedException(v protocol.ResponseMetadata) error { + return &DeploymentNotStartedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DeploymentNotStartedException) Code() string { + return "DeploymentNotStartedException" +} + +// Message returns the exception's message. +func (s DeploymentNotStartedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentNotStartedException) OrigErr() error { + return nil +} + +func (s DeploymentNotStartedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentNotStartedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DeploymentNotStartedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about the deployment status of the instances in the deployment. +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. +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 a load balancer + // unless traffic rerouting is started using ContinueDeployment. If traffic + // rerouting is not started 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 + // is 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 in-place or blue/green, +// you want to run and whether to route deployment traffic behind a load balancer. +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 an in-place 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 +} + +// Information about the deployment target. +type DeploymentTarget struct { + _ struct{} `type:"structure"` + + // The deployment type that is specific to the deployment's compute platform. + DeploymentTargetType *string `locationName:"deploymentTargetType" type:"string" enum:"DeploymentTargetType"` + + // Information about the target for a deployment that uses the Amazon ECS compute + // platform. + EcsTarget *ECSTarget `locationName:"ecsTarget" type:"structure"` + + // Information about the target for a deployment that uses the EC2/On-premises + // compute platform. + InstanceTarget *InstanceTarget `locationName:"instanceTarget" type:"structure"` + + // Information about the target for a deployment that uses the AWS Lambda compute + // platform. + LambdaTarget *LambdaTarget `locationName:"lambdaTarget" type:"structure"` +} + +// String returns the string representation +func (s DeploymentTarget) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeploymentTarget) GoString() string { + return s.String() +} + +// SetDeploymentTargetType sets the DeploymentTargetType field's value. +func (s *DeploymentTarget) SetDeploymentTargetType(v string) *DeploymentTarget { + s.DeploymentTargetType = &v + return s +} + +// SetEcsTarget sets the EcsTarget field's value. +func (s *DeploymentTarget) SetEcsTarget(v *ECSTarget) *DeploymentTarget { + s.EcsTarget = v + return s +} + +// SetInstanceTarget sets the InstanceTarget field's value. +func (s *DeploymentTarget) SetInstanceTarget(v *InstanceTarget) *DeploymentTarget { + s.InstanceTarget = v + return s +} + +// SetLambdaTarget sets the LambdaTarget field's value. +func (s *DeploymentTarget) SetLambdaTarget(v *LambdaTarget) *DeploymentTarget { + s.LambdaTarget = v + return s +} + +// The provided target ID does not belong to the attempted deployment. +type DeploymentTargetDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DeploymentTargetDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeploymentTargetDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorDeploymentTargetDoesNotExistException(v protocol.ResponseMetadata) error { + return &DeploymentTargetDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DeploymentTargetDoesNotExistException) Code() string { + return "DeploymentTargetDoesNotExistException" +} + +// Message returns the exception's message. +func (s DeploymentTargetDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentTargetDoesNotExistException) OrigErr() error { + return nil +} + +func (s DeploymentTargetDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentTargetDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DeploymentTargetDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// A deployment target ID was not provided. +type DeploymentTargetIdRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DeploymentTargetIdRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeploymentTargetIdRequiredException) GoString() string { + return s.String() +} + +func newErrorDeploymentTargetIdRequiredException(v protocol.ResponseMetadata) error { + return &DeploymentTargetIdRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DeploymentTargetIdRequiredException) Code() string { + return "DeploymentTargetIdRequiredException" +} + +// Message returns the exception's message. +func (s DeploymentTargetIdRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentTargetIdRequiredException) OrigErr() error { + return nil +} + +func (s DeploymentTargetIdRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentTargetIdRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DeploymentTargetIdRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The maximum number of targets that can be associated with an Amazon ECS or +// AWS Lambda deployment was exceeded. The target list of both types of deployments +// must have exactly one item. This exception does not apply to EC2/On-premises +// deployments. +type DeploymentTargetListSizeExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DeploymentTargetListSizeExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeploymentTargetListSizeExceededException) GoString() string { + return s.String() +} + +func newErrorDeploymentTargetListSizeExceededException(v protocol.ResponseMetadata) error { + return &DeploymentTargetListSizeExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DeploymentTargetListSizeExceededException) Code() string { + return "DeploymentTargetListSizeExceededException" +} + +// Message returns the exception's message. +func (s DeploymentTargetListSizeExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeploymentTargetListSizeExceededException) OrigErr() error { + return nil +} + +func (s DeploymentTargetListSizeExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DeploymentTargetListSizeExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DeploymentTargetListSizeExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// Represents the input of a DeregisterOnPremisesInstance operation. +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 +} + +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() +} + +// The description is too long. +type DescriptionTooLongException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DescriptionTooLongException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescriptionTooLongException) GoString() string { + return s.String() +} + +func newErrorDescriptionTooLongException(v protocol.ResponseMetadata) error { + return &DescriptionTooLongException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DescriptionTooLongException) Code() string { + return "DescriptionTooLongException" +} + +// Message returns the exception's message. +func (s DescriptionTooLongException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DescriptionTooLongException) OrigErr() error { + return nil +} + +func (s DescriptionTooLongException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DescriptionTooLongException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DescriptionTooLongException) RequestID() string { + return s.respMetadata.RequestID +} + +// Diagnostic information about executable scripts that are part of a deployment. +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 an EC2 tag filter. +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 groups of EC2 instance tags. +type EC2TagSet struct { + _ struct{} `type:"structure"` + + // A list that contains other lists of EC2 instance tag groups. For an instance + // to be included in the deployment group, it must be identified by all of the + // tag groups in the list. + Ec2TagSetList [][]*EC2TagFilter `locationName:"ec2TagSetList" type:"list"` +} + +// String returns the string representation +func (s EC2TagSet) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EC2TagSet) GoString() string { + return s.String() +} + +// SetEc2TagSetList sets the Ec2TagSetList field's value. +func (s *EC2TagSet) SetEc2TagSetList(v [][]*EC2TagFilter) *EC2TagSet { + s.Ec2TagSetList = v + return s +} + +// Contains the service and cluster names used to identify an Amazon ECS deployment's +// target. +type ECSService struct { + _ struct{} `type:"structure"` + + // The name of the cluster that the Amazon ECS service is associated with. + ClusterName *string `locationName:"clusterName" type:"string"` + + // The name of the target Amazon ECS service. + ServiceName *string `locationName:"serviceName" type:"string"` +} + +// String returns the string representation +func (s ECSService) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ECSService) GoString() string { + return s.String() +} + +// SetClusterName sets the ClusterName field's value. +func (s *ECSService) SetClusterName(v string) *ECSService { + s.ClusterName = &v + return s +} + +// SetServiceName sets the ServiceName field's value. +func (s *ECSService) SetServiceName(v string) *ECSService { + s.ServiceName = &v + return s +} + +// The Amazon ECS service is associated with more than one deployment groups. +// An Amazon ECS service can be associated with only one deployment group. +type ECSServiceMappingLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ECSServiceMappingLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ECSServiceMappingLimitExceededException) GoString() string { + return s.String() +} + +func newErrorECSServiceMappingLimitExceededException(v protocol.ResponseMetadata) error { + return &ECSServiceMappingLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ECSServiceMappingLimitExceededException) Code() string { + return "ECSServiceMappingLimitExceededException" +} + +// Message returns the exception's message. +func (s ECSServiceMappingLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ECSServiceMappingLimitExceededException) OrigErr() error { + return nil +} + +func (s ECSServiceMappingLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ECSServiceMappingLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ECSServiceMappingLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about the target of an Amazon ECS deployment. +type ECSTarget struct { + _ struct{} `type:"structure"` + + // The unique ID of a deployment. + DeploymentId *string `locationName:"deploymentId" type:"string"` + + // The date and time when the target Amazon ECS application was updated by a + // deployment. + LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp"` + + // The lifecycle events of the deployment to this target Amazon ECS application. + LifecycleEvents []*LifecycleEvent `locationName:"lifecycleEvents" type:"list"` + + // The status an Amazon ECS deployment's target ECS application. + Status *string `locationName:"status" type:"string" enum:"TargetStatus"` + + // The ARN of the target. + TargetArn *string `locationName:"targetArn" type:"string"` + + // The unique ID of a deployment target that has a type of ecsTarget. + TargetId *string `locationName:"targetId" type:"string"` + + // The ECSTaskSet objects associated with the ECS target. + TaskSetsInfo []*ECSTaskSet `locationName:"taskSetsInfo" type:"list"` +} + +// String returns the string representation +func (s ECSTarget) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ECSTarget) GoString() string { + return s.String() +} + +// SetDeploymentId sets the DeploymentId field's value. +func (s *ECSTarget) SetDeploymentId(v string) *ECSTarget { + s.DeploymentId = &v + return s +} + +// SetLastUpdatedAt sets the LastUpdatedAt field's value. +func (s *ECSTarget) SetLastUpdatedAt(v time.Time) *ECSTarget { + s.LastUpdatedAt = &v + return s +} + +// SetLifecycleEvents sets the LifecycleEvents field's value. +func (s *ECSTarget) SetLifecycleEvents(v []*LifecycleEvent) *ECSTarget { + s.LifecycleEvents = v + return s +} + +// SetStatus sets the Status field's value. +func (s *ECSTarget) SetStatus(v string) *ECSTarget { + s.Status = &v + return s +} + +// SetTargetArn sets the TargetArn field's value. +func (s *ECSTarget) SetTargetArn(v string) *ECSTarget { + s.TargetArn = &v + return s +} + +// SetTargetId sets the TargetId field's value. +func (s *ECSTarget) SetTargetId(v string) *ECSTarget { + s.TargetId = &v + return s +} + +// SetTaskSetsInfo sets the TaskSetsInfo field's value. +func (s *ECSTarget) SetTaskSetsInfo(v []*ECSTaskSet) *ECSTarget { + s.TaskSetsInfo = v + return s +} + +// Information about a set of Amazon ECS tasks in an AWS CodeDeploy deployment. +// An Amazon ECS task set includes details such as the desired number of tasks, +// how many tasks are running, and whether the task set serves production traffic. +// An AWS CodeDeploy application that uses the Amazon ECS compute platform deploys +// a containerized application in an Amazon ECS service as a task set. +type ECSTaskSet struct { + _ struct{} `type:"structure"` + + // The number of tasks in a task set. During a deployment that uses the Amazon + // ECS compute type, CodeDeploy instructs Amazon ECS to create a new task set + // and uses this value to determine how many tasks to create. After the updated + // task set is created, CodeDeploy shifts traffic to the new task set. + DesiredCount *int64 `locationName:"desiredCount" type:"long"` + + // A unique ID of an ECSTaskSet. + Identifer *string `locationName:"identifer" type:"string"` + + // The number of tasks in the task set that are in the PENDING status during + // an Amazon ECS deployment. A task in the PENDING state is preparing to enter + // the RUNNING state. A task set enters the PENDING status when it launches + // for the first time, or when it is restarted after being in the STOPPED state. + PendingCount *int64 `locationName:"pendingCount" type:"long"` + + // The number of tasks in the task set that are in the RUNNING status during + // an Amazon ECS deployment. A task in the RUNNING state is running and ready + // for use. + RunningCount *int64 `locationName:"runningCount" type:"long"` + + // The status of the task set. There are three valid task set statuses: + // + // * PRIMARY: Indicates the task set is serving production traffic. + // + // * ACTIVE: Indicates the task set is not serving production traffic. + // + // * DRAINING: Indicates the tasks in the task set are being stopped and + // their corresponding targets are being deregistered from their target group. + Status *string `locationName:"status" type:"string"` + + // The target group associated with the task set. The target group is used by + // AWS CodeDeploy to manage traffic to a task set. + TargetGroup *TargetGroupInfo `locationName:"targetGroup" type:"structure"` + + // A label that identifies whether the ECS task set is an original target (BLUE) + // or a replacement target (GREEN). + TaskSetLabel *string `locationName:"taskSetLabel" type:"string" enum:"TargetLabel"` + + // The percentage of traffic served by this task set. + TrafficWeight *float64 `locationName:"trafficWeight" type:"double"` +} + +// String returns the string representation +func (s ECSTaskSet) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ECSTaskSet) GoString() string { + return s.String() +} + +// SetDesiredCount sets the DesiredCount field's value. +func (s *ECSTaskSet) SetDesiredCount(v int64) *ECSTaskSet { + s.DesiredCount = &v + return s +} + +// SetIdentifer sets the Identifer field's value. +func (s *ECSTaskSet) SetIdentifer(v string) *ECSTaskSet { + s.Identifer = &v + return s +} + +// SetPendingCount sets the PendingCount field's value. +func (s *ECSTaskSet) SetPendingCount(v int64) *ECSTaskSet { + s.PendingCount = &v + return s +} + +// SetRunningCount sets the RunningCount field's value. +func (s *ECSTaskSet) SetRunningCount(v int64) *ECSTaskSet { + s.RunningCount = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ECSTaskSet) SetStatus(v string) *ECSTaskSet { + s.Status = &v + return s +} + +// SetTargetGroup sets the TargetGroup field's value. +func (s *ECSTaskSet) SetTargetGroup(v *TargetGroupInfo) *ECSTaskSet { + s.TargetGroup = v + return s +} + +// SetTaskSetLabel sets the TaskSetLabel field's value. +func (s *ECSTaskSet) SetTaskSetLabel(v string) *ECSTaskSet { + s.TaskSetLabel = &v + return s +} + +// SetTrafficWeight sets the TrafficWeight field's value. +func (s *ECSTaskSet) SetTrafficWeight(v float64) *ECSTaskSet { + s.TrafficWeight = &v + return s +} + +// Information about a load balancer in Elastic Load Balancing to use in a deployment. +// Instances are registered directly with a load balancer, and traffic is routed +// to the load balancer. +type ELBInfo struct { + _ struct{} `type:"structure"` + + // For blue/green deployments, the name of the load balancer that is used to + // route traffic from original instances to replacement instances in a blue/green + // deployment. For in-place deployments, the name of the load balancer that + // instances are deregistered from so they are not serving traffic during a + // deployment, and then re-registered with after the deployment is complete. + 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. +type ErrorInformation struct { + _ struct{} `type:"structure"` + + // For more information, see Error Codes for AWS CodeDeploy (https://docs.aws.amazon.com/codedeploy/latest/userguide/error-codes.html) + // in the AWS CodeDeploy User Guide (https://docs.aws.amazon.com/codedeploy/latest/userguide). + // + // The error code: + // + // * APPLICATION_MISSING: The application was missing. This error code is + // most likely 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 is most likely 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 Amazon + // EC2. + // + // * NO_INSTANCES: No instances were specified, or no instances can be found. + // + // * OVER_MAX_INSTANCES: The maximum number of instances 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 is most + // likely 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. +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"` + + // When the revision was last used by AWS CodeDeploy. + LastUsedTime *time.Time `locationName:"lastUsedTime" type:"timestamp"` + + // When the revision was registered with AWS CodeDeploy. + RegisterTime *time.Time `locationName:"registerTime" type:"timestamp"` +} + +// 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 GetApplication operation. +type GetApplicationInput struct { + _ struct{} `type:"structure"` + + // The name of an AWS CodeDeploy application associated with the 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 GetApplication operation. +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 GetApplicationRevision operation. +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 GetApplicationRevision operation. +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 GetDeploymentConfig operation. +type GetDeploymentConfigInput struct { + _ struct{} `type:"structure"` + + // The name of a deployment configuration associated with the 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 GetDeploymentConfig operation. +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 GetDeploymentGroup operation. +type GetDeploymentGroupInput struct { + _ struct{} `type:"structure"` + + // The name of an AWS CodeDeploy application associated with the IAM user or + // AWS account. + // + // ApplicationName is a required field + ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` + + // The name of a 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 GetDeploymentGroup operation. +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 GetDeployment operation. +type GetDeploymentInput struct { + _ struct{} `type:"structure"` + + // The unique ID of a deployment associated with the 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 GetDeploymentInstance operation. +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 GetDeploymentInstance operation. +type GetDeploymentInstanceOutput struct { + _ struct{} `type:"structure"` + + // Information about the instance. + InstanceSummary *InstanceSummary `locationName:"instanceSummary" deprecated:"true" 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 GetDeployment operation. +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 +} + +type GetDeploymentTargetInput struct { + _ struct{} `type:"structure"` + + // The unique ID of a deployment. + DeploymentId *string `locationName:"deploymentId" type:"string"` + + // The unique ID of a deployment target. + TargetId *string `locationName:"targetId" type:"string"` +} + +// String returns the string representation +func (s GetDeploymentTargetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDeploymentTargetInput) GoString() string { + return s.String() +} + +// SetDeploymentId sets the DeploymentId field's value. +func (s *GetDeploymentTargetInput) SetDeploymentId(v string) *GetDeploymentTargetInput { + s.DeploymentId = &v + return s +} + +// SetTargetId sets the TargetId field's value. +func (s *GetDeploymentTargetInput) SetTargetId(v string) *GetDeploymentTargetInput { + s.TargetId = &v + return s +} + +type GetDeploymentTargetOutput struct { + _ struct{} `type:"structure"` + + // A deployment target that contains information about a deployment such as + // its status, lifecyle events, and when it was last updated. It also contains + // metadata about the deployment target. The deployment target metadata depends + // on the deployment target's type (instanceTarget, lambdaTarget, or ecsTarget). + DeploymentTarget *DeploymentTarget `locationName:"deploymentTarget" type:"structure"` +} + +// String returns the string representation +func (s GetDeploymentTargetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDeploymentTargetOutput) GoString() string { + return s.String() +} + +// SetDeploymentTarget sets the DeploymentTarget field's value. +func (s *GetDeploymentTargetOutput) SetDeploymentTarget(v *DeploymentTarget) *GetDeploymentTargetOutput { + s.DeploymentTarget = v + return s +} + +// Represents the input of a GetOnPremisesInstance operation. +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 GetOnPremisesInstance operation. +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 +} + +// No GitHub account connection exists with the named specified in the call. +type GitHubAccountTokenDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s GitHubAccountTokenDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GitHubAccountTokenDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorGitHubAccountTokenDoesNotExistException(v protocol.ResponseMetadata) error { + return &GitHubAccountTokenDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s GitHubAccountTokenDoesNotExistException) Code() string { + return "GitHubAccountTokenDoesNotExistException" +} + +// Message returns the exception's message. +func (s GitHubAccountTokenDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s GitHubAccountTokenDoesNotExistException) OrigErr() error { + return nil +} + +func (s GitHubAccountTokenDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s GitHubAccountTokenDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s GitHubAccountTokenDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// The call is missing a required GitHub account connection name. +type GitHubAccountTokenNameRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s GitHubAccountTokenNameRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GitHubAccountTokenNameRequiredException) GoString() string { + return s.String() +} + +func newErrorGitHubAccountTokenNameRequiredException(v protocol.ResponseMetadata) error { + return &GitHubAccountTokenNameRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s GitHubAccountTokenNameRequiredException) Code() string { + return "GitHubAccountTokenNameRequiredException" +} + +// Message returns the exception's message. +func (s GitHubAccountTokenNameRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s GitHubAccountTokenNameRequiredException) OrigErr() error { + return nil +} + +func (s GitHubAccountTokenNameRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s GitHubAccountTokenNameRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s GitHubAccountTokenNameRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about the location of application artifacts stored in GitHub. +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. +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 +} + +// No IAM ARN was included in the request. You must use an IAM session ARN or +// IAM user ARN in the request. +type IamArnRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s IamArnRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IamArnRequiredException) GoString() string { + return s.String() +} + +func newErrorIamArnRequiredException(v protocol.ResponseMetadata) error { + return &IamArnRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IamArnRequiredException) Code() string { + return "IamArnRequiredException" +} + +// Message returns the exception's message. +func (s IamArnRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IamArnRequiredException) OrigErr() error { + return nil +} + +func (s IamArnRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IamArnRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IamArnRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request included an IAM session ARN that has already been used to register +// a different instance. +type IamSessionArnAlreadyRegisteredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s IamSessionArnAlreadyRegisteredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IamSessionArnAlreadyRegisteredException) GoString() string { + return s.String() +} + +func newErrorIamSessionArnAlreadyRegisteredException(v protocol.ResponseMetadata) error { + return &IamSessionArnAlreadyRegisteredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IamSessionArnAlreadyRegisteredException) Code() string { + return "IamSessionArnAlreadyRegisteredException" +} + +// Message returns the exception's message. +func (s IamSessionArnAlreadyRegisteredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IamSessionArnAlreadyRegisteredException) OrigErr() error { + return nil +} + +func (s IamSessionArnAlreadyRegisteredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IamSessionArnAlreadyRegisteredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IamSessionArnAlreadyRegisteredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified IAM user ARN is already registered with an on-premises instance. +type IamUserArnAlreadyRegisteredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s IamUserArnAlreadyRegisteredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IamUserArnAlreadyRegisteredException) GoString() string { + return s.String() +} + +func newErrorIamUserArnAlreadyRegisteredException(v protocol.ResponseMetadata) error { + return &IamUserArnAlreadyRegisteredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IamUserArnAlreadyRegisteredException) Code() string { + return "IamUserArnAlreadyRegisteredException" +} + +// Message returns the exception's message. +func (s IamUserArnAlreadyRegisteredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IamUserArnAlreadyRegisteredException) OrigErr() error { + return nil +} + +func (s IamUserArnAlreadyRegisteredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IamUserArnAlreadyRegisteredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IamUserArnAlreadyRegisteredException) RequestID() string { + return s.respMetadata.RequestID +} + +// An IAM user ARN was not specified. +type IamUserArnRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s IamUserArnRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IamUserArnRequiredException) GoString() string { + return s.String() +} + +func newErrorIamUserArnRequiredException(v protocol.ResponseMetadata) error { + return &IamUserArnRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IamUserArnRequiredException) Code() string { + return "IamUserArnRequiredException" +} + +// Message returns the exception's message. +func (s IamUserArnRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IamUserArnRequiredException) OrigErr() error { + return nil +} + +func (s IamUserArnRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IamUserArnRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IamUserArnRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified instance does not exist in the deployment group. +// +// Deprecated: This exception is deprecated, use DeploymentTargetDoesNotExistException instead. +type InstanceDoesNotExistException struct { + _ struct{} `deprecated:"true" type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InstanceDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorInstanceDoesNotExistException(v protocol.ResponseMetadata) error { + return &InstanceDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InstanceDoesNotExistException) Code() string { + return "InstanceDoesNotExistException" +} + +// Message returns the exception's message. +func (s InstanceDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InstanceDoesNotExistException) OrigErr() error { + return nil +} + +func (s InstanceDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InstanceDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InstanceDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// The instance ID was not specified. +// +// Deprecated: This exception is deprecated, use DeploymentTargetIdRequiredException instead. +type InstanceIdRequiredException struct { + _ struct{} `deprecated:"true" type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InstanceIdRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceIdRequiredException) GoString() string { + return s.String() +} + +func newErrorInstanceIdRequiredException(v protocol.ResponseMetadata) error { + return &InstanceIdRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InstanceIdRequiredException) Code() string { + return "InstanceIdRequiredException" +} + +// Message returns the exception's message. +func (s InstanceIdRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InstanceIdRequiredException) OrigErr() error { + return nil +} + +func (s InstanceIdRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InstanceIdRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InstanceIdRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about an on-premises instance. +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"` + + // 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"` + + // 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 +} + +// The maximum number of allowed on-premises instances in a single call was +// exceeded. +type InstanceLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InstanceLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceLimitExceededException) GoString() string { + return s.String() +} + +func newErrorInstanceLimitExceededException(v protocol.ResponseMetadata) error { + return &InstanceLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InstanceLimitExceededException) Code() string { + return "InstanceLimitExceededException" +} + +// Message returns the exception's message. +func (s InstanceLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InstanceLimitExceededException) OrigErr() error { + return nil +} + +func (s InstanceLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InstanceLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InstanceLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified on-premises instance name is already registered. +type InstanceNameAlreadyRegisteredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InstanceNameAlreadyRegisteredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceNameAlreadyRegisteredException) GoString() string { + return s.String() +} + +func newErrorInstanceNameAlreadyRegisteredException(v protocol.ResponseMetadata) error { + return &InstanceNameAlreadyRegisteredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InstanceNameAlreadyRegisteredException) Code() string { + return "InstanceNameAlreadyRegisteredException" +} + +// Message returns the exception's message. +func (s InstanceNameAlreadyRegisteredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InstanceNameAlreadyRegisteredException) OrigErr() error { + return nil +} + +func (s InstanceNameAlreadyRegisteredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InstanceNameAlreadyRegisteredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InstanceNameAlreadyRegisteredException) RequestID() string { + return s.respMetadata.RequestID +} + +// An on-premises instance name was not specified. +type InstanceNameRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InstanceNameRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceNameRequiredException) GoString() string { + return s.String() +} + +func newErrorInstanceNameRequiredException(v protocol.ResponseMetadata) error { + return &InstanceNameRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InstanceNameRequiredException) Code() string { + return "InstanceNameRequiredException" +} + +// Message returns the exception's message. +func (s InstanceNameRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InstanceNameRequiredException) OrigErr() error { + return nil +} + +func (s InstanceNameRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InstanceNameRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InstanceNameRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified on-premises instance is not registered. +type InstanceNotRegisteredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InstanceNotRegisteredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceNotRegisteredException) GoString() string { + return s.String() +} + +func newErrorInstanceNotRegisteredException(v protocol.ResponseMetadata) error { + return &InstanceNotRegisteredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InstanceNotRegisteredException) Code() string { + return "InstanceNotRegisteredException" +} + +// Message returns the exception's message. +func (s InstanceNotRegisteredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InstanceNotRegisteredException) OrigErr() error { + return nil +} + +func (s InstanceNotRegisteredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InstanceNotRegisteredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InstanceNotRegisteredException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about an instance in a deployment. +// +// Deprecated: InstanceSummary is deprecated, use DeploymentTarget instead. +type InstanceSummary struct { + _ struct{} `deprecated:"true" type:"structure"` + + // The unique ID of a deployment. + 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 that indicaties when the instance information was last updated. + LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp"` + + // 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" deprecated:"true" 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 +} + +// A target Amazon EC2 or on-premises instance during a deployment that uses +// the EC2/On-premises compute platform. +type InstanceTarget struct { + _ struct{} `type:"structure"` + + // The unique ID of a deployment. + DeploymentId *string `locationName:"deploymentId" type:"string"` + + // A label that identifies whether the instance is an original target (BLUE) + // or a replacement target (GREEN). + InstanceLabel *string `locationName:"instanceLabel" type:"string" enum:"TargetLabel"` + + // The date and time when the target instance was updated by a deployment. + LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp"` + + // The lifecycle events of the deployment to this target instance. + LifecycleEvents []*LifecycleEvent `locationName:"lifecycleEvents" type:"list"` + + // The status an EC2/On-premises deployment's target instance. + Status *string `locationName:"status" type:"string" enum:"TargetStatus"` + + // The ARN of the target. + TargetArn *string `locationName:"targetArn" type:"string"` + + // The unique ID of a deployment target that has a type of instanceTarget. + TargetId *string `locationName:"targetId" type:"string"` +} + +// String returns the string representation +func (s InstanceTarget) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceTarget) GoString() string { + return s.String() +} + +// SetDeploymentId sets the DeploymentId field's value. +func (s *InstanceTarget) SetDeploymentId(v string) *InstanceTarget { + s.DeploymentId = &v + return s +} + +// SetInstanceLabel sets the InstanceLabel field's value. +func (s *InstanceTarget) SetInstanceLabel(v string) *InstanceTarget { + s.InstanceLabel = &v + return s +} + +// SetLastUpdatedAt sets the LastUpdatedAt field's value. +func (s *InstanceTarget) SetLastUpdatedAt(v time.Time) *InstanceTarget { + s.LastUpdatedAt = &v + return s +} + +// SetLifecycleEvents sets the LifecycleEvents field's value. +func (s *InstanceTarget) SetLifecycleEvents(v []*LifecycleEvent) *InstanceTarget { + s.LifecycleEvents = v + return s +} + +// SetStatus sets the Status field's value. +func (s *InstanceTarget) SetStatus(v string) *InstanceTarget { + s.Status = &v + return s +} + +// SetTargetArn sets the TargetArn field's value. +func (s *InstanceTarget) SetTargetArn(v string) *InstanceTarget { + s.TargetArn = &v + return s +} + +// SetTargetId sets the TargetId field's value. +func (s *InstanceTarget) SetTargetId(v string) *InstanceTarget { + s.TargetId = &v + return s +} + +// 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 limit of 255 characters. +// +// * Two alarms with the same name have been specified. +// +// * The alarm configuration is enabled, but the alarm list is empty. +type InvalidAlarmConfigException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidAlarmConfigException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidAlarmConfigException) GoString() string { + return s.String() +} + +func newErrorInvalidAlarmConfigException(v protocol.ResponseMetadata) error { + return &InvalidAlarmConfigException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidAlarmConfigException) Code() string { + return "InvalidAlarmConfigException" +} + +// Message returns the exception's message. +func (s InvalidAlarmConfigException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAlarmConfigException) OrigErr() error { + return nil +} + +func (s InvalidAlarmConfigException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAlarmConfigException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAlarmConfigException) RequestID() string { + return s.respMetadata.RequestID +} + +// The application name was specified in an invalid format. +type InvalidApplicationNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidApplicationNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidApplicationNameException) GoString() string { + return s.String() +} + +func newErrorInvalidApplicationNameException(v protocol.ResponseMetadata) error { + return &InvalidApplicationNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidApplicationNameException) Code() string { + return "InvalidApplicationNameException" +} + +// Message returns the exception's message. +func (s InvalidApplicationNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidApplicationNameException) OrigErr() error { + return nil +} + +func (s InvalidApplicationNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidApplicationNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidApplicationNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified ARN is not in a valid format. +type InvalidArnException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidArnException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidArnException) GoString() string { + return s.String() +} + +func newErrorInvalidArnException(v protocol.ResponseMetadata) error { + return &InvalidArnException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidArnException) Code() string { + return "InvalidArnException" +} + +// Message returns the exception's message. +func (s InvalidArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidArnException) OrigErr() error { + return nil +} + +func (s InvalidArnException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidArnException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidArnException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type InvalidAutoRollbackConfigException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidAutoRollbackConfigException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidAutoRollbackConfigException) GoString() string { + return s.String() +} + +func newErrorInvalidAutoRollbackConfigException(v protocol.ResponseMetadata) error { + return &InvalidAutoRollbackConfigException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidAutoRollbackConfigException) Code() string { + return "InvalidAutoRollbackConfigException" +} + +// Message returns the exception's message. +func (s InvalidAutoRollbackConfigException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAutoRollbackConfigException) OrigErr() error { + return nil +} + +func (s InvalidAutoRollbackConfigException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAutoRollbackConfigException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAutoRollbackConfigException) RequestID() string { + return s.respMetadata.RequestID +} + +// The Auto Scaling group was specified in an invalid format or does not exist. +type InvalidAutoScalingGroupException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidAutoScalingGroupException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidAutoScalingGroupException) GoString() string { + return s.String() +} + +func newErrorInvalidAutoScalingGroupException(v protocol.ResponseMetadata) error { + return &InvalidAutoScalingGroupException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidAutoScalingGroupException) Code() string { + return "InvalidAutoScalingGroupException" +} + +// Message returns the exception's message. +func (s InvalidAutoScalingGroupException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAutoScalingGroupException) OrigErr() error { + return nil +} + +func (s InvalidAutoScalingGroupException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAutoScalingGroupException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAutoScalingGroupException) RequestID() string { + return s.respMetadata.RequestID +} + +// The configuration for the blue/green deployment group was provided in an +// invalid format. For information about deployment configuration format, see +// CreateDeploymentConfig. +type InvalidBlueGreenDeploymentConfigurationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidBlueGreenDeploymentConfigurationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidBlueGreenDeploymentConfigurationException) GoString() string { + return s.String() +} + +func newErrorInvalidBlueGreenDeploymentConfigurationException(v protocol.ResponseMetadata) error { + return &InvalidBlueGreenDeploymentConfigurationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidBlueGreenDeploymentConfigurationException) Code() string { + return "InvalidBlueGreenDeploymentConfigurationException" +} + +// Message returns the exception's message. +func (s InvalidBlueGreenDeploymentConfigurationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidBlueGreenDeploymentConfigurationException) OrigErr() error { + return nil +} + +func (s InvalidBlueGreenDeploymentConfigurationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidBlueGreenDeploymentConfigurationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidBlueGreenDeploymentConfigurationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The bucket name either doesn't exist or was specified in an invalid format. +type InvalidBucketNameFilterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidBucketNameFilterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidBucketNameFilterException) GoString() string { + return s.String() +} + +func newErrorInvalidBucketNameFilterException(v protocol.ResponseMetadata) error { + return &InvalidBucketNameFilterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidBucketNameFilterException) Code() string { + return "InvalidBucketNameFilterException" +} + +// Message returns the exception's message. +func (s InvalidBucketNameFilterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidBucketNameFilterException) OrigErr() error { + return nil +} + +func (s InvalidBucketNameFilterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidBucketNameFilterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidBucketNameFilterException) RequestID() string { + return s.respMetadata.RequestID +} + +// The computePlatform is invalid. The computePlatform should be Lambda or Server. +type InvalidComputePlatformException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidComputePlatformException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidComputePlatformException) GoString() string { + return s.String() +} + +func newErrorInvalidComputePlatformException(v protocol.ResponseMetadata) error { + return &InvalidComputePlatformException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidComputePlatformException) Code() string { + return "InvalidComputePlatformException" +} + +// Message returns the exception's message. +func (s InvalidComputePlatformException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidComputePlatformException) OrigErr() error { + return nil +} + +func (s InvalidComputePlatformException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidComputePlatformException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidComputePlatformException) RequestID() string { + return s.respMetadata.RequestID +} + +// The deployed state filter was specified in an invalid format. +type InvalidDeployedStateFilterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidDeployedStateFilterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDeployedStateFilterException) GoString() string { + return s.String() +} + +func newErrorInvalidDeployedStateFilterException(v protocol.ResponseMetadata) error { + return &InvalidDeployedStateFilterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDeployedStateFilterException) Code() string { + return "InvalidDeployedStateFilterException" +} + +// Message returns the exception's message. +func (s InvalidDeployedStateFilterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDeployedStateFilterException) OrigErr() error { + return nil +} + +func (s InvalidDeployedStateFilterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDeployedStateFilterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDeployedStateFilterException) RequestID() string { + return s.respMetadata.RequestID +} + +// The deployment configuration name was specified in an invalid format. +type InvalidDeploymentConfigNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidDeploymentConfigNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDeploymentConfigNameException) GoString() string { + return s.String() +} + +func newErrorInvalidDeploymentConfigNameException(v protocol.ResponseMetadata) error { + return &InvalidDeploymentConfigNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDeploymentConfigNameException) Code() string { + return "InvalidDeploymentConfigNameException" +} + +// Message returns the exception's message. +func (s InvalidDeploymentConfigNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDeploymentConfigNameException) OrigErr() error { + return nil +} + +func (s InvalidDeploymentConfigNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDeploymentConfigNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDeploymentConfigNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// The deployment group name was specified in an invalid format. +type InvalidDeploymentGroupNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidDeploymentGroupNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDeploymentGroupNameException) GoString() string { + return s.String() +} + +func newErrorInvalidDeploymentGroupNameException(v protocol.ResponseMetadata) error { + return &InvalidDeploymentGroupNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDeploymentGroupNameException) Code() string { + return "InvalidDeploymentGroupNameException" +} + +// Message returns the exception's message. +func (s InvalidDeploymentGroupNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDeploymentGroupNameException) OrigErr() error { + return nil +} + +func (s InvalidDeploymentGroupNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDeploymentGroupNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDeploymentGroupNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// At least one of the deployment IDs was specified in an invalid format. +type InvalidDeploymentIdException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidDeploymentIdException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDeploymentIdException) GoString() string { + return s.String() +} + +func newErrorInvalidDeploymentIdException(v protocol.ResponseMetadata) error { + return &InvalidDeploymentIdException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDeploymentIdException) Code() string { + return "InvalidDeploymentIdException" +} + +// Message returns the exception's message. +func (s InvalidDeploymentIdException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDeploymentIdException) OrigErr() error { + return nil +} + +func (s InvalidDeploymentIdException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDeploymentIdException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDeploymentIdException) RequestID() string { + return s.respMetadata.RequestID +} + +// An instance type was specified for an in-place deployment. Instance types +// are supported for blue/green deployments only. +type InvalidDeploymentInstanceTypeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidDeploymentInstanceTypeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDeploymentInstanceTypeException) GoString() string { + return s.String() +} + +func newErrorInvalidDeploymentInstanceTypeException(v protocol.ResponseMetadata) error { + return &InvalidDeploymentInstanceTypeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDeploymentInstanceTypeException) Code() string { + return "InvalidDeploymentInstanceTypeException" +} + +// Message returns the exception's message. +func (s InvalidDeploymentInstanceTypeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDeploymentInstanceTypeException) OrigErr() error { + return nil +} + +func (s InvalidDeploymentInstanceTypeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDeploymentInstanceTypeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDeploymentInstanceTypeException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified deployment status doesn't exist or cannot be determined. +type InvalidDeploymentStatusException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidDeploymentStatusException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDeploymentStatusException) GoString() string { + return s.String() +} + +func newErrorInvalidDeploymentStatusException(v protocol.ResponseMetadata) error { + return &InvalidDeploymentStatusException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDeploymentStatusException) Code() string { + return "InvalidDeploymentStatusException" +} + +// Message returns the exception's message. +func (s InvalidDeploymentStatusException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDeploymentStatusException) OrigErr() error { + return nil +} + +func (s InvalidDeploymentStatusException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDeploymentStatusException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDeploymentStatusException) RequestID() string { + return s.respMetadata.RequestID +} + +// An invalid deployment style was specified. Valid deployment types include +// "IN_PLACE" and "BLUE_GREEN." Valid deployment options include "WITH_TRAFFIC_CONTROL" +// and "WITHOUT_TRAFFIC_CONTROL." +type InvalidDeploymentStyleException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidDeploymentStyleException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDeploymentStyleException) GoString() string { + return s.String() +} + +func newErrorInvalidDeploymentStyleException(v protocol.ResponseMetadata) error { + return &InvalidDeploymentStyleException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDeploymentStyleException) Code() string { + return "InvalidDeploymentStyleException" +} + +// Message returns the exception's message. +func (s InvalidDeploymentStyleException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDeploymentStyleException) OrigErr() error { + return nil +} + +func (s InvalidDeploymentStyleException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDeploymentStyleException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDeploymentStyleException) RequestID() string { + return s.respMetadata.RequestID +} + +// The target ID provided was not valid. +type InvalidDeploymentTargetIdException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidDeploymentTargetIdException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDeploymentTargetIdException) GoString() string { + return s.String() +} + +func newErrorInvalidDeploymentTargetIdException(v protocol.ResponseMetadata) error { + return &InvalidDeploymentTargetIdException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDeploymentTargetIdException) Code() string { + return "InvalidDeploymentTargetIdException" +} + +// Message returns the exception's message. +func (s InvalidDeploymentTargetIdException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDeploymentTargetIdException) OrigErr() error { + return nil +} + +func (s InvalidDeploymentTargetIdException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDeploymentTargetIdException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDeploymentTargetIdException) RequestID() string { + return s.respMetadata.RequestID +} + +// The wait type is invalid. +type InvalidDeploymentWaitTypeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidDeploymentWaitTypeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDeploymentWaitTypeException) GoString() string { + return s.String() +} + +func newErrorInvalidDeploymentWaitTypeException(v protocol.ResponseMetadata) error { + return &InvalidDeploymentWaitTypeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDeploymentWaitTypeException) Code() string { + return "InvalidDeploymentWaitTypeException" +} + +// Message returns the exception's message. +func (s InvalidDeploymentWaitTypeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDeploymentWaitTypeException) OrigErr() error { + return nil +} + +func (s InvalidDeploymentWaitTypeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDeploymentWaitTypeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDeploymentWaitTypeException) RequestID() string { + return s.respMetadata.RequestID +} + +// A call was submitted that specified both Ec2TagFilters and Ec2TagSet, but +// only one of these data types can be used in a single call. +type InvalidEC2TagCombinationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidEC2TagCombinationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidEC2TagCombinationException) GoString() string { + return s.String() +} + +func newErrorInvalidEC2TagCombinationException(v protocol.ResponseMetadata) error { + return &InvalidEC2TagCombinationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidEC2TagCombinationException) Code() string { + return "InvalidEC2TagCombinationException" +} + +// Message returns the exception's message. +func (s InvalidEC2TagCombinationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidEC2TagCombinationException) OrigErr() error { + return nil +} + +func (s InvalidEC2TagCombinationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidEC2TagCombinationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidEC2TagCombinationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The tag was specified in an invalid format. +type InvalidEC2TagException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidEC2TagException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidEC2TagException) GoString() string { + return s.String() +} + +func newErrorInvalidEC2TagException(v protocol.ResponseMetadata) error { + return &InvalidEC2TagException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidEC2TagException) Code() string { + return "InvalidEC2TagException" +} + +// Message returns the exception's message. +func (s InvalidEC2TagException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidEC2TagException) OrigErr() error { + return nil +} + +func (s InvalidEC2TagException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidEC2TagException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidEC2TagException) RequestID() string { + return s.respMetadata.RequestID +} + +// The Amazon ECS service identifier is not valid. +type InvalidECSServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidECSServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidECSServiceException) GoString() string { + return s.String() +} + +func newErrorInvalidECSServiceException(v protocol.ResponseMetadata) error { + return &InvalidECSServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidECSServiceException) Code() string { + return "InvalidECSServiceException" +} + +// Message returns the exception's message. +func (s InvalidECSServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidECSServiceException) OrigErr() error { + return nil +} + +func (s InvalidECSServiceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidECSServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidECSServiceException) RequestID() string { + return s.respMetadata.RequestID +} + +// An invalid fileExistsBehavior option was specified to determine how AWS CodeDeploy +// handles files or directories that already exist in a deployment target location, +// but weren't part of the previous successful deployment. Valid values include +// "DISALLOW," "OVERWRITE," and "RETAIN." +type InvalidFileExistsBehaviorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidFileExistsBehaviorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidFileExistsBehaviorException) GoString() string { + return s.String() } -// SetStatus sets the Status field's value. -func (s *DeploymentInfo) SetStatus(v string) *DeploymentInfo { - s.Status = &v - return s +func newErrorInvalidFileExistsBehaviorException(v protocol.ResponseMetadata) error { + return &InvalidFileExistsBehaviorException{ + respMetadata: v, + } } -// SetTargetInstances sets the TargetInstances field's value. -func (s *DeploymentInfo) SetTargetInstances(v *TargetInstances) *DeploymentInfo { - s.TargetInstances = v - return s +// Code returns the exception type name. +func (s InvalidFileExistsBehaviorException) Code() string { + return "InvalidFileExistsBehaviorException" } -// SetUpdateOutdatedInstancesOnly sets the UpdateOutdatedInstancesOnly field's value. -func (s *DeploymentInfo) SetUpdateOutdatedInstancesOnly(v bool) *DeploymentInfo { - s.UpdateOutdatedInstancesOnly = &v - return s +// Message returns the exception's message. +func (s InvalidFileExistsBehaviorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// Information about the deployment status of the instances in the deployment. -type DeploymentOverview struct { - _ struct{} `type:"structure"` - - // The number of instances in the deployment in a failed state. - Failed *int64 `type:"long"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidFileExistsBehaviorException) OrigErr() error { + return nil +} - // The number of instances in which the deployment is in progress. - InProgress *int64 `type:"long"` +func (s InvalidFileExistsBehaviorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The number of instances in the deployment in a pending state. - Pending *int64 `type:"long"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidFileExistsBehaviorException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The number of instances in a replacement environment ready to receive traffic - // in a blue/green deployment. - Ready *int64 `type:"long"` +// RequestID returns the service's response RequestID for request. +func (s InvalidFileExistsBehaviorException) RequestID() string { + return s.respMetadata.RequestID +} - // The number of instances in the deployment in a skipped state. - Skipped *int64 `type:"long"` +// The GitHub token is not valid. +type InvalidGitHubAccountTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The number of instances in the deployment to which revisions have been successfully - // deployed. - Succeeded *int64 `type:"long"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DeploymentOverview) String() string { +func (s InvalidGitHubAccountTokenException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeploymentOverview) GoString() string { +func (s InvalidGitHubAccountTokenException) GoString() string { return s.String() } -// SetFailed sets the Failed field's value. -func (s *DeploymentOverview) SetFailed(v int64) *DeploymentOverview { - s.Failed = &v - return s +func newErrorInvalidGitHubAccountTokenException(v protocol.ResponseMetadata) error { + return &InvalidGitHubAccountTokenException{ + respMetadata: v, + } } -// SetInProgress sets the InProgress field's value. -func (s *DeploymentOverview) SetInProgress(v int64) *DeploymentOverview { - s.InProgress = &v - return s +// Code returns the exception type name. +func (s InvalidGitHubAccountTokenException) Code() string { + return "InvalidGitHubAccountTokenException" } -// SetPending sets the Pending field's value. -func (s *DeploymentOverview) SetPending(v int64) *DeploymentOverview { - s.Pending = &v - return s +// Message returns the exception's message. +func (s InvalidGitHubAccountTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetReady sets the Ready field's value. -func (s *DeploymentOverview) SetReady(v int64) *DeploymentOverview { - s.Ready = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidGitHubAccountTokenException) OrigErr() error { + return nil } -// SetSkipped sets the Skipped field's value. -func (s *DeploymentOverview) SetSkipped(v int64) *DeploymentOverview { - s.Skipped = &v - return s +func (s InvalidGitHubAccountTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetSucceeded sets the Succeeded field's value. -func (s *DeploymentOverview) SetSucceeded(v int64) *DeploymentOverview { - s.Succeeded = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidGitHubAccountTokenException) StatusCode() int { + return s.respMetadata.StatusCode } -// Information about how traffic is rerouted to instances in a replacement environment -// in a blue/green deployment. -type DeploymentReadyOption struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidGitHubAccountTokenException) RequestID() string { + return s.respMetadata.RequestID +} - // 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 a load balancer - // unless traffic rerouting is started using ContinueDeployment. If traffic - // rerouting is not started before the end of the specified wait period, - // the deployment status is changed to Stopped. - ActionOnTimeout *string `locationName:"actionOnTimeout" type:"string" enum:"DeploymentReadyAction"` +// The format of the specified GitHub account connection name is invalid. +type InvalidGitHubAccountTokenNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The number of minutes to wait before the status of a blue/green deployment - // is changed to Stopped if rerouting is not started manually. Applies only - // to the STOP_DEPLOYMENT option for actionOnTimeout - WaitTimeInMinutes *int64 `locationName:"waitTimeInMinutes" type:"integer"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DeploymentReadyOption) String() string { +func (s InvalidGitHubAccountTokenNameException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeploymentReadyOption) GoString() string { +func (s InvalidGitHubAccountTokenNameException) GoString() string { return s.String() } -// SetActionOnTimeout sets the ActionOnTimeout field's value. -func (s *DeploymentReadyOption) SetActionOnTimeout(v string) *DeploymentReadyOption { - s.ActionOnTimeout = &v - return s +func newErrorInvalidGitHubAccountTokenNameException(v protocol.ResponseMetadata) error { + return &InvalidGitHubAccountTokenNameException{ + respMetadata: v, + } } -// SetWaitTimeInMinutes sets the WaitTimeInMinutes field's value. -func (s *DeploymentReadyOption) SetWaitTimeInMinutes(v int64) *DeploymentReadyOption { - s.WaitTimeInMinutes = &v - return s +// Code returns the exception type name. +func (s InvalidGitHubAccountTokenNameException) Code() string { + return "InvalidGitHubAccountTokenNameException" } -// Information about the type of deployment, either in-place or blue/green, -// you want to run and whether to route deployment traffic behind a load balancer. -type DeploymentStyle struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidGitHubAccountTokenNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Indicates whether to route deployment traffic behind a load balancer. - DeploymentOption *string `locationName:"deploymentOption" type:"string" enum:"DeploymentOption"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidGitHubAccountTokenNameException) OrigErr() error { + return nil +} - // Indicates whether to run an in-place deployment or a blue/green deployment. - DeploymentType *string `locationName:"deploymentType" type:"string" enum:"DeploymentType"` +func (s InvalidGitHubAccountTokenNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidGitHubAccountTokenNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidGitHubAccountTokenNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// The IAM session ARN was specified in an invalid format. +type InvalidIamSessionArnException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DeploymentStyle) String() string { +func (s InvalidIamSessionArnException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeploymentStyle) GoString() string { +func (s InvalidIamSessionArnException) GoString() string { return s.String() } -// SetDeploymentOption sets the DeploymentOption field's value. -func (s *DeploymentStyle) SetDeploymentOption(v string) *DeploymentStyle { - s.DeploymentOption = &v - return s +func newErrorInvalidIamSessionArnException(v protocol.ResponseMetadata) error { + return &InvalidIamSessionArnException{ + respMetadata: v, + } } -// SetDeploymentType sets the DeploymentType field's value. -func (s *DeploymentStyle) SetDeploymentType(v string) *DeploymentStyle { - s.DeploymentType = &v - return s +// Code returns the exception type name. +func (s InvalidIamSessionArnException) Code() string { + return "InvalidIamSessionArnException" } -// Information about the deployment target. -type DeploymentTarget struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidIamSessionArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The deployment type that is specific to the deployment's compute platform. - DeploymentTargetType *string `locationName:"deploymentTargetType" type:"string" enum:"DeploymentTargetType"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidIamSessionArnException) OrigErr() error { + return nil +} - // Information about the target for a deployment that uses the Amazon ECS compute - // platform. - EcsTarget *ECSTarget `locationName:"ecsTarget" type:"structure"` +func (s InvalidIamSessionArnException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // Information about the target for a deployment that uses the EC2/On-premises - // compute platform. - InstanceTarget *InstanceTarget `locationName:"instanceTarget" type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidIamSessionArnException) StatusCode() int { + return s.respMetadata.StatusCode +} - // Information about the target for a deployment that uses the AWS Lambda compute - // platform. - LambdaTarget *LambdaTarget `locationName:"lambdaTarget" type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidIamSessionArnException) RequestID() string { + return s.respMetadata.RequestID +} + +// The IAM user ARN was specified in an invalid format. +type InvalidIamUserArnException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DeploymentTarget) String() string { +func (s InvalidIamUserArnException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeploymentTarget) GoString() string { +func (s InvalidIamUserArnException) GoString() string { return s.String() } -// SetDeploymentTargetType sets the DeploymentTargetType field's value. -func (s *DeploymentTarget) SetDeploymentTargetType(v string) *DeploymentTarget { - s.DeploymentTargetType = &v - return s +func newErrorInvalidIamUserArnException(v protocol.ResponseMetadata) error { + return &InvalidIamUserArnException{ + respMetadata: v, + } } -// SetEcsTarget sets the EcsTarget field's value. -func (s *DeploymentTarget) SetEcsTarget(v *ECSTarget) *DeploymentTarget { - s.EcsTarget = v - return s +// Code returns the exception type name. +func (s InvalidIamUserArnException) Code() string { + return "InvalidIamUserArnException" } -// SetInstanceTarget sets the InstanceTarget field's value. -func (s *DeploymentTarget) SetInstanceTarget(v *InstanceTarget) *DeploymentTarget { - s.InstanceTarget = v - return s +// Message returns the exception's message. +func (s InvalidIamUserArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetLambdaTarget sets the LambdaTarget field's value. -func (s *DeploymentTarget) SetLambdaTarget(v *LambdaTarget) *DeploymentTarget { - s.LambdaTarget = v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidIamUserArnException) OrigErr() error { + return nil } -// Represents the input of a DeregisterOnPremisesInstance operation. -type DeregisterOnPremisesInstanceInput struct { - _ struct{} `type:"structure"` +func (s InvalidIamUserArnException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The name of the on-premises instance to deregister. - // - // InstanceName is a required field - InstanceName *string `locationName:"instanceName" type:"string" required:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidIamUserArnException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidIamUserArnException) RequestID() string { + return s.respMetadata.RequestID +} + +// The IgnoreApplicationStopFailures value is invalid. For AWS Lambda deployments, +// false is expected. For EC2/On-premises deployments, true or false is expected. +type InvalidIgnoreApplicationStopFailuresValueException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DeregisterOnPremisesInstanceInput) String() string { +func (s InvalidIgnoreApplicationStopFailuresValueException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeregisterOnPremisesInstanceInput) GoString() string { +func (s InvalidIgnoreApplicationStopFailuresValueException) 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")) +func newErrorInvalidIgnoreApplicationStopFailuresValueException(v protocol.ResponseMetadata) error { + return &InvalidIgnoreApplicationStopFailuresValueException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidIgnoreApplicationStopFailuresValueException) Code() string { + return "InvalidIgnoreApplicationStopFailuresValueException" +} + +// Message returns the exception's message. +func (s InvalidIgnoreApplicationStopFailuresValueException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidIgnoreApplicationStopFailuresValueException) OrigErr() error { return nil } -// SetInstanceName sets the InstanceName field's value. -func (s *DeregisterOnPremisesInstanceInput) SetInstanceName(v string) *DeregisterOnPremisesInstanceInput { - s.InstanceName = &v - return s +func (s InvalidIgnoreApplicationStopFailuresValueException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -type DeregisterOnPremisesInstanceOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidIgnoreApplicationStopFailuresValueException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidIgnoreApplicationStopFailuresValueException) RequestID() string { + return s.respMetadata.RequestID +} + +// The input was specified in an invalid format. +type InvalidInputException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DeregisterOnPremisesInstanceOutput) String() string { +func (s InvalidInputException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeregisterOnPremisesInstanceOutput) GoString() string { +func (s InvalidInputException) GoString() string { return s.String() } -// Diagnostic information about executable scripts that are part of a deployment. -type Diagnostics struct { - _ struct{} `type:"structure"` +func newErrorInvalidInputException(v protocol.ResponseMetadata) error { + return &InvalidInputException{ + respMetadata: v, + } +} - // 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"` +// Code returns the exception type name. +func (s InvalidInputException) Code() string { + return "InvalidInputException" +} - // 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"` +// Message returns the exception's message. +func (s InvalidInputException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInputException) OrigErr() error { + return nil +} + +func (s InvalidInputException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInputException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInputException) RequestID() string { + return s.respMetadata.RequestID +} - // The message associated with the error. - Message *string `locationName:"message" type:"string"` +// The on-premises instance name was specified in an invalid format. +type InvalidInstanceNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The name of the script. - ScriptName *string `locationName:"scriptName" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s Diagnostics) String() string { +func (s InvalidInstanceNameException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Diagnostics) GoString() string { +func (s InvalidInstanceNameException) GoString() string { return s.String() } -// SetErrorCode sets the ErrorCode field's value. -func (s *Diagnostics) SetErrorCode(v string) *Diagnostics { - s.ErrorCode = &v - return s +func newErrorInvalidInstanceNameException(v protocol.ResponseMetadata) error { + return &InvalidInstanceNameException{ + respMetadata: v, + } } -// SetLogTail sets the LogTail field's value. -func (s *Diagnostics) SetLogTail(v string) *Diagnostics { - s.LogTail = &v - return s +// Code returns the exception type name. +func (s InvalidInstanceNameException) Code() string { + return "InvalidInstanceNameException" } -// SetMessage sets the Message field's value. -func (s *Diagnostics) SetMessage(v string) *Diagnostics { - s.Message = &v - return s +// Message returns the exception's message. +func (s InvalidInstanceNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetScriptName sets the ScriptName field's value. -func (s *Diagnostics) SetScriptName(v string) *Diagnostics { - s.ScriptName = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInstanceNameException) OrigErr() error { + return nil } -// Information about an EC2 tag filter. -type EC2TagFilter struct { - _ struct{} `type:"structure"` +func (s InvalidInstanceNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The tag filter key. - Key *string `type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInstanceNameException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The tag filter type: - // - // * KEY_ONLY: Key only. - // - // * VALUE_ONLY: Value only. - // - // * KEY_AND_VALUE: Key and value. - Type *string `type:"string" enum:"EC2TagFilterType"` +// RequestID returns the service's response RequestID for request. +func (s InvalidInstanceNameException) RequestID() string { + return s.respMetadata.RequestID +} - // The tag filter value. - Value *string `type:"string"` +// The specified instance status does not exist. +type InvalidInstanceStatusException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s EC2TagFilter) String() string { +func (s InvalidInstanceStatusException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EC2TagFilter) GoString() string { +func (s InvalidInstanceStatusException) GoString() string { return s.String() } -// SetKey sets the Key field's value. -func (s *EC2TagFilter) SetKey(v string) *EC2TagFilter { - s.Key = &v - return s +func newErrorInvalidInstanceStatusException(v protocol.ResponseMetadata) error { + return &InvalidInstanceStatusException{ + respMetadata: v, + } } -// SetType sets the Type field's value. -func (s *EC2TagFilter) SetType(v string) *EC2TagFilter { - s.Type = &v - return s +// Code returns the exception type name. +func (s InvalidInstanceStatusException) Code() string { + return "InvalidInstanceStatusException" } -// SetValue sets the Value field's value. -func (s *EC2TagFilter) SetValue(v string) *EC2TagFilter { - s.Value = &v - return s +// Message returns the exception's message. +func (s InvalidInstanceStatusException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// Information about groups of EC2 instance tags. -type EC2TagSet struct { - _ struct{} `type:"structure"` - - // A list that contains other lists of EC2 instance tag groups. For an instance - // to be included in the deployment group, it must be identified by all of the - // tag groups in the list. - Ec2TagSetList [][]*EC2TagFilter `locationName:"ec2TagSetList" type:"list"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInstanceStatusException) OrigErr() error { + return nil } -// String returns the string representation -func (s EC2TagSet) String() string { - return awsutil.Prettify(s) +func (s InvalidInstanceStatusException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// GoString returns the string representation -func (s EC2TagSet) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInstanceStatusException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetEc2TagSetList sets the Ec2TagSetList field's value. -func (s *EC2TagSet) SetEc2TagSetList(v [][]*EC2TagFilter) *EC2TagSet { - s.Ec2TagSetList = v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidInstanceStatusException) RequestID() string { + return s.respMetadata.RequestID } -// Contains the service and cluster names used to identify an Amazon ECS deployment's -// target. -type ECSService struct { - _ struct{} `type:"structure"` - - // The name of the cluster that the Amazon ECS service is associated with. - ClusterName *string `locationName:"clusterName" type:"string"` +// 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. +type InvalidInstanceTypeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The name of the target Amazon ECS service. - ServiceName *string `locationName:"serviceName" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ECSService) String() string { +func (s InvalidInstanceTypeException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ECSService) GoString() string { +func (s InvalidInstanceTypeException) GoString() string { return s.String() } -// SetClusterName sets the ClusterName field's value. -func (s *ECSService) SetClusterName(v string) *ECSService { - s.ClusterName = &v - return s +func newErrorInvalidInstanceTypeException(v protocol.ResponseMetadata) error { + return &InvalidInstanceTypeException{ + respMetadata: v, + } } -// SetServiceName sets the ServiceName field's value. -func (s *ECSService) SetServiceName(v string) *ECSService { - s.ServiceName = &v - return s +// Code returns the exception type name. +func (s InvalidInstanceTypeException) Code() string { + return "InvalidInstanceTypeException" } -// Information about the target of an Amazon ECS deployment. -type ECSTarget struct { - _ struct{} `type:"structure"` - - // The unique ID of a deployment. - DeploymentId *string `locationName:"deploymentId" type:"string"` +// Message returns the exception's message. +func (s InvalidInstanceTypeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The date and time when the target Amazon ECS application was updated by a - // deployment. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInstanceTypeException) OrigErr() error { + return nil +} - // The lifecycle events of the deployment to this target Amazon ECS application. - LifecycleEvents []*LifecycleEvent `locationName:"lifecycleEvents" type:"list"` +func (s InvalidInstanceTypeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The status an Amazon ECS deployment's target ECS application. - Status *string `locationName:"status" type:"string" enum:"TargetStatus"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInstanceTypeException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The ARN of the target. - TargetArn *string `locationName:"targetArn" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s InvalidInstanceTypeException) RequestID() string { + return s.respMetadata.RequestID +} - // The unique ID of a deployment target that has a type of ecsTarget. - TargetId *string `locationName:"targetId" type:"string"` +// The specified key prefix filter was specified in an invalid format. +type InvalidKeyPrefixFilterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The ECSTaskSet objects associated with the ECS target. - TaskSetsInfo []*ECSTaskSet `locationName:"taskSetsInfo" type:"list"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ECSTarget) String() string { +func (s InvalidKeyPrefixFilterException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ECSTarget) GoString() string { +func (s InvalidKeyPrefixFilterException) GoString() string { return s.String() } -// SetDeploymentId sets the DeploymentId field's value. -func (s *ECSTarget) SetDeploymentId(v string) *ECSTarget { - s.DeploymentId = &v - return s +func newErrorInvalidKeyPrefixFilterException(v protocol.ResponseMetadata) error { + return &InvalidKeyPrefixFilterException{ + respMetadata: v, + } } -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *ECSTarget) SetLastUpdatedAt(v time.Time) *ECSTarget { - s.LastUpdatedAt = &v - return s +// Code returns the exception type name. +func (s InvalidKeyPrefixFilterException) Code() string { + return "InvalidKeyPrefixFilterException" } -// SetLifecycleEvents sets the LifecycleEvents field's value. -func (s *ECSTarget) SetLifecycleEvents(v []*LifecycleEvent) *ECSTarget { - s.LifecycleEvents = v - return s +// Message returns the exception's message. +func (s InvalidKeyPrefixFilterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetStatus sets the Status field's value. -func (s *ECSTarget) SetStatus(v string) *ECSTarget { - s.Status = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidKeyPrefixFilterException) OrigErr() error { + return nil } -// SetTargetArn sets the TargetArn field's value. -func (s *ECSTarget) SetTargetArn(v string) *ECSTarget { - s.TargetArn = &v - return s +func (s InvalidKeyPrefixFilterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetTargetId sets the TargetId field's value. -func (s *ECSTarget) SetTargetId(v string) *ECSTarget { - s.TargetId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidKeyPrefixFilterException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetTaskSetsInfo sets the TaskSetsInfo field's value. -func (s *ECSTarget) SetTaskSetsInfo(v []*ECSTaskSet) *ECSTarget { - s.TaskSetsInfo = v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidKeyPrefixFilterException) RequestID() string { + return s.respMetadata.RequestID } -// Information about a set of Amazon ECS tasks in an AWS CodeDeploy deployment. -// An Amazon ECS task set includes details such as the desired number of tasks, -// how many tasks are running, and whether the task set serves production traffic. -// An AWS CodeDeploy application that uses the Amazon ECS compute platform deploys -// a containerized application in an Amazon ECS service as a task set. -type ECSTaskSet struct { - _ struct{} `type:"structure"` - - // The number of tasks in a task set. During a deployment that uses the Amazon - // ECS compute type, CodeDeploy instructs Amazon ECS to create a new task set - // and uses this value to determine how many tasks to create. After the updated - // task set is created, CodeDeploy shifts traffic to the new task set. - DesiredCount *int64 `locationName:"desiredCount" type:"long"` - - // A unique ID of an ECSTaskSet. - Identifer *string `locationName:"identifer" type:"string"` - - // The number of tasks in the task set that are in the PENDING status during - // an Amazon ECS deployment. A task in the PENDING state is preparing to enter - // the RUNNING state. A task set enters the PENDING status when it launches - // for the first time, or when it is restarted after being in the STOPPED state. - PendingCount *int64 `locationName:"pendingCount" type:"long"` - - // The number of tasks in the task set that are in the RUNNING status during - // an Amazon ECS deployment. A task in the RUNNING state is running and ready - // for use. - RunningCount *int64 `locationName:"runningCount" type:"long"` - - // The status of the task set. There are three valid task set statuses: - // - // * PRIMARY: Indicates the task set is serving production traffic. - // - // * ACTIVE: Indicates the task set is not serving production traffic. - // - // * DRAINING: Indicates the tasks in the task set are being stopped and - // their corresponding targets are being deregistered from their target group. - Status *string `locationName:"status" type:"string"` - - // The target group associated with the task set. The target group is used by - // AWS CodeDeploy to manage traffic to a task set. - TargetGroup *TargetGroupInfo `locationName:"targetGroup" type:"structure"` - - // A label that identifies whether the ECS task set is an original target (BLUE) - // or a replacement target (GREEN). - TaskSetLabel *string `locationName:"taskSetLabel" type:"string" enum:"TargetLabel"` +// A lifecycle event hook is invalid. Review the hooks section in your AppSpec +// file to ensure the lifecycle events and hooks functions are valid. +type InvalidLifecycleEventHookExecutionIdException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The percentage of traffic served by this task set. - TrafficWeight *float64 `locationName:"trafficWeight" type:"double"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ECSTaskSet) String() string { +func (s InvalidLifecycleEventHookExecutionIdException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ECSTaskSet) GoString() string { +func (s InvalidLifecycleEventHookExecutionIdException) GoString() string { return s.String() } -// SetDesiredCount sets the DesiredCount field's value. -func (s *ECSTaskSet) SetDesiredCount(v int64) *ECSTaskSet { - s.DesiredCount = &v - return s -} - -// SetIdentifer sets the Identifer field's value. -func (s *ECSTaskSet) SetIdentifer(v string) *ECSTaskSet { - s.Identifer = &v - return s +func newErrorInvalidLifecycleEventHookExecutionIdException(v protocol.ResponseMetadata) error { + return &InvalidLifecycleEventHookExecutionIdException{ + respMetadata: v, + } } -// SetPendingCount sets the PendingCount field's value. -func (s *ECSTaskSet) SetPendingCount(v int64) *ECSTaskSet { - s.PendingCount = &v - return s +// Code returns the exception type name. +func (s InvalidLifecycleEventHookExecutionIdException) Code() string { + return "InvalidLifecycleEventHookExecutionIdException" } -// SetRunningCount sets the RunningCount field's value. -func (s *ECSTaskSet) SetRunningCount(v int64) *ECSTaskSet { - s.RunningCount = &v - return s +// Message returns the exception's message. +func (s InvalidLifecycleEventHookExecutionIdException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetStatus sets the Status field's value. -func (s *ECSTaskSet) SetStatus(v string) *ECSTaskSet { - s.Status = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidLifecycleEventHookExecutionIdException) OrigErr() error { + return nil } -// SetTargetGroup sets the TargetGroup field's value. -func (s *ECSTaskSet) SetTargetGroup(v *TargetGroupInfo) *ECSTaskSet { - s.TargetGroup = v - return s +func (s InvalidLifecycleEventHookExecutionIdException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetTaskSetLabel sets the TaskSetLabel field's value. -func (s *ECSTaskSet) SetTaskSetLabel(v string) *ECSTaskSet { - s.TaskSetLabel = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidLifecycleEventHookExecutionIdException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetTrafficWeight sets the TrafficWeight field's value. -func (s *ECSTaskSet) SetTrafficWeight(v float64) *ECSTaskSet { - s.TrafficWeight = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidLifecycleEventHookExecutionIdException) RequestID() string { + return s.respMetadata.RequestID } -// Information about a load balancer in Elastic Load Balancing to use in a deployment. -// Instances are registered directly with a load balancer, and traffic is routed -// to the load balancer. -type ELBInfo struct { - _ struct{} `type:"structure"` +// The result of a Lambda validation function that verifies a lifecycle event +// is invalid. It should return Succeeded or Failed. +type InvalidLifecycleEventHookExecutionStatusException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // For blue/green deployments, the name of the load balancer that is used to - // route traffic from original instances to replacement instances in a blue/green - // deployment. For in-place deployments, the name of the load balancer that - // instances are deregistered from so they are not serving traffic during a - // deployment, and then re-registered with after the deployment is complete. - Name *string `locationName:"name" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ELBInfo) String() string { +func (s InvalidLifecycleEventHookExecutionStatusException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ELBInfo) GoString() string { +func (s InvalidLifecycleEventHookExecutionStatusException) GoString() string { return s.String() } -// SetName sets the Name field's value. -func (s *ELBInfo) SetName(v string) *ELBInfo { - s.Name = &v - return s +func newErrorInvalidLifecycleEventHookExecutionStatusException(v protocol.ResponseMetadata) error { + return &InvalidLifecycleEventHookExecutionStatusException{ + respMetadata: v, + } } -// Information about a deployment error. -type ErrorInformation struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s InvalidLifecycleEventHookExecutionStatusException) Code() string { + return "InvalidLifecycleEventHookExecutionStatusException" +} - // For more information, see Error Codes for AWS CodeDeploy (https://docs.aws.amazon.com/codedeploy/latest/userguide/error-codes.html) - // in the AWS CodeDeploy User Guide (https://docs.aws.amazon.com/codedeploy/latest/userguide). - // - // The error code: - // - // * APPLICATION_MISSING: The application was missing. This error code is - // most likely 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 is most likely 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 Amazon - // EC2. - // - // * NO_INSTANCES: No instances were specified, or no instances can be found. - // - // * OVER_MAX_INSTANCES: The maximum number of instances 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 is most - // likely raised if the revision is deleted after the deployment is created, - // but before it is started. - Code *string `locationName:"code" type:"string" enum:"ErrorCode"` +// Message returns the exception's message. +func (s InvalidLifecycleEventHookExecutionStatusException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // An accompanying error message. - Message *string `locationName:"message" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidLifecycleEventHookExecutionStatusException) OrigErr() error { + return nil +} + +func (s InvalidLifecycleEventHookExecutionStatusException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidLifecycleEventHookExecutionStatusException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidLifecycleEventHookExecutionStatusException) RequestID() string { + return s.respMetadata.RequestID +} + +// An invalid load balancer name, or no load balancer name, was specified. +type InvalidLoadBalancerInfoException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ErrorInformation) String() string { +func (s InvalidLoadBalancerInfoException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ErrorInformation) GoString() string { +func (s InvalidLoadBalancerInfoException) GoString() string { return s.String() } -// SetCode sets the Code field's value. -func (s *ErrorInformation) SetCode(v string) *ErrorInformation { - s.Code = &v - return s +func newErrorInvalidLoadBalancerInfoException(v protocol.ResponseMetadata) error { + return &InvalidLoadBalancerInfoException{ + respMetadata: v, + } } -// SetMessage sets the Message field's value. -func (s *ErrorInformation) SetMessage(v string) *ErrorInformation { - s.Message = &v - return s +// Code returns the exception type name. +func (s InvalidLoadBalancerInfoException) Code() string { + return "InvalidLoadBalancerInfoException" } -// Information about an application revision. -type GenericRevisionInfo struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidLoadBalancerInfoException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The deployment groups for which this is the current target revision. - DeploymentGroups []*string `locationName:"deploymentGroups" type:"list"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidLoadBalancerInfoException) OrigErr() error { + return nil +} - // A comment about the revision. - Description *string `locationName:"description" type:"string"` +func (s InvalidLoadBalancerInfoException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // When the revision was first used by AWS CodeDeploy. - FirstUsedTime *time.Time `locationName:"firstUsedTime" type:"timestamp"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidLoadBalancerInfoException) StatusCode() int { + return s.respMetadata.StatusCode +} - // When the revision was last used by AWS CodeDeploy. - LastUsedTime *time.Time `locationName:"lastUsedTime" type:"timestamp"` +// RequestID returns the service's response RequestID for request. +func (s InvalidLoadBalancerInfoException) RequestID() string { + return s.respMetadata.RequestID +} - // When the revision was registered with AWS CodeDeploy. - RegisterTime *time.Time `locationName:"registerTime" type:"timestamp"` +// The minimum healthy instance value was specified in an invalid format. +type InvalidMinimumHealthyHostValueException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GenericRevisionInfo) String() string { +func (s InvalidMinimumHealthyHostValueException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GenericRevisionInfo) GoString() string { +func (s InvalidMinimumHealthyHostValueException) GoString() string { return s.String() } -// SetDeploymentGroups sets the DeploymentGroups field's value. -func (s *GenericRevisionInfo) SetDeploymentGroups(v []*string) *GenericRevisionInfo { - s.DeploymentGroups = v - return s +func newErrorInvalidMinimumHealthyHostValueException(v protocol.ResponseMetadata) error { + return &InvalidMinimumHealthyHostValueException{ + respMetadata: v, + } } -// SetDescription sets the Description field's value. -func (s *GenericRevisionInfo) SetDescription(v string) *GenericRevisionInfo { - s.Description = &v - return s +// Code returns the exception type name. +func (s InvalidMinimumHealthyHostValueException) Code() string { + return "InvalidMinimumHealthyHostValueException" } -// SetFirstUsedTime sets the FirstUsedTime field's value. -func (s *GenericRevisionInfo) SetFirstUsedTime(v time.Time) *GenericRevisionInfo { - s.FirstUsedTime = &v - return s +// Message returns the exception's message. +func (s InvalidMinimumHealthyHostValueException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetLastUsedTime sets the LastUsedTime field's value. -func (s *GenericRevisionInfo) SetLastUsedTime(v time.Time) *GenericRevisionInfo { - s.LastUsedTime = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidMinimumHealthyHostValueException) OrigErr() error { + return nil } -// SetRegisterTime sets the RegisterTime field's value. -func (s *GenericRevisionInfo) SetRegisterTime(v time.Time) *GenericRevisionInfo { - s.RegisterTime = &v - return s +func (s InvalidMinimumHealthyHostValueException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// Represents the input of a GetApplication operation. -type GetApplicationInput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidMinimumHealthyHostValueException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The name of an AWS CodeDeploy application associated with the IAM user or - // AWS account. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` +// RequestID returns the service's response RequestID for request. +func (s InvalidMinimumHealthyHostValueException) RequestID() string { + return s.respMetadata.RequestID +} + +// The next token was specified in an invalid format. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetApplicationInput) String() string { +func (s InvalidNextTokenException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApplicationInput) GoString() string { +func (s InvalidNextTokenException) 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)) +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { return nil } -// SetApplicationName sets the ApplicationName field's value. -func (s *GetApplicationInput) SetApplicationName(v string) *GetApplicationInput { - s.ApplicationName = &v - return s +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// Represents the output of a GetApplication operation. -type GetApplicationOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} - // Information about the application. - Application *ApplicationInfo `locationName:"application" type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// A call was submitted that specified both OnPremisesTagFilters and OnPremisesTagSet, +// but only one of these data types can be used in a single call. +type InvalidOnPremisesTagCombinationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetApplicationOutput) String() string { +func (s InvalidOnPremisesTagCombinationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApplicationOutput) GoString() string { +func (s InvalidOnPremisesTagCombinationException) GoString() string { return s.String() } -// SetApplication sets the Application field's value. -func (s *GetApplicationOutput) SetApplication(v *ApplicationInfo) *GetApplicationOutput { - s.Application = v - return s +func newErrorInvalidOnPremisesTagCombinationException(v protocol.ResponseMetadata) error { + return &InvalidOnPremisesTagCombinationException{ + respMetadata: v, + } } -// Represents the input of a GetApplicationRevision operation. -type GetApplicationRevisionInput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s InvalidOnPremisesTagCombinationException) Code() string { + return "InvalidOnPremisesTagCombinationException" +} - // 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"` +// Message returns the exception's message. +func (s InvalidOnPremisesTagCombinationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Information about the application revision to get, including type and location. - // - // Revision is a required field - Revision *RevisionLocation `locationName:"revision" type:"structure" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidOnPremisesTagCombinationException) OrigErr() error { + return nil +} + +func (s InvalidOnPremisesTagCombinationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidOnPremisesTagCombinationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidOnPremisesTagCombinationException) RequestID() string { + return s.respMetadata.RequestID +} + +// An invalid operation was detected. +type InvalidOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetApplicationRevisionInput) String() string { +func (s InvalidOperationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApplicationRevisionInput) GoString() string { +func (s InvalidOperationException) 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")) +func newErrorInvalidOperationException(v protocol.ResponseMetadata) error { + return &InvalidOperationException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidOperationException) Code() string { + return "InvalidOperationException" +} + +// Message returns the exception's message. +func (s InvalidOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetApplicationName sets the ApplicationName field's value. -func (s *GetApplicationRevisionInput) SetApplicationName(v string) *GetApplicationRevisionInput { - s.ApplicationName = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidOperationException) OrigErr() error { + return nil } -// SetRevision sets the Revision field's value. -func (s *GetApplicationRevisionInput) SetRevision(v *RevisionLocation) *GetApplicationRevisionInput { - s.Revision = v - return s +func (s InvalidOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// Represents the output of a GetApplicationRevision operation. -type GetApplicationRevisionOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The name of the application that corresponds to the revision. - ApplicationName *string `locationName:"applicationName" min:"1" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s InvalidOperationException) RequestID() string { + return s.respMetadata.RequestID +} - // Additional information about the revision, including type and location. - Revision *RevisionLocation `locationName:"revision" type:"structure"` +// The registration status was specified in an invalid format. +type InvalidRegistrationStatusException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // General information about the revision. - RevisionInfo *GenericRevisionInfo `locationName:"revisionInfo" type:"structure"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetApplicationRevisionOutput) String() string { +func (s InvalidRegistrationStatusException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApplicationRevisionOutput) GoString() string { +func (s InvalidRegistrationStatusException) GoString() string { return s.String() } -// SetApplicationName sets the ApplicationName field's value. -func (s *GetApplicationRevisionOutput) SetApplicationName(v string) *GetApplicationRevisionOutput { - s.ApplicationName = &v - return s +func newErrorInvalidRegistrationStatusException(v protocol.ResponseMetadata) error { + return &InvalidRegistrationStatusException{ + respMetadata: v, + } } -// SetRevision sets the Revision field's value. -func (s *GetApplicationRevisionOutput) SetRevision(v *RevisionLocation) *GetApplicationRevisionOutput { - s.Revision = v - return s +// Code returns the exception type name. +func (s InvalidRegistrationStatusException) Code() string { + return "InvalidRegistrationStatusException" } -// SetRevisionInfo sets the RevisionInfo field's value. -func (s *GetApplicationRevisionOutput) SetRevisionInfo(v *GenericRevisionInfo) *GetApplicationRevisionOutput { - s.RevisionInfo = v - return s +// Message returns the exception's message. +func (s InvalidRegistrationStatusException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRegistrationStatusException) OrigErr() error { + return nil +} + +func (s InvalidRegistrationStatusException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRegistrationStatusException) StatusCode() int { + return s.respMetadata.StatusCode } -// Represents the input of a GetDeploymentConfig operation. -type GetDeploymentConfigInput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidRegistrationStatusException) RequestID() string { + return s.respMetadata.RequestID +} - // The name of a deployment configuration associated with the IAM user or AWS - // account. - // - // DeploymentConfigName is a required field - DeploymentConfigName *string `locationName:"deploymentConfigName" min:"1" type:"string" required:"true"` +// The revision was specified in an invalid format. +type InvalidRevisionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetDeploymentConfigInput) String() string { +func (s InvalidRevisionException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDeploymentConfigInput) GoString() string { +func (s InvalidRevisionException) 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)) +func newErrorInvalidRevisionException(v protocol.ResponseMetadata) error { + return &InvalidRevisionException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidRevisionException) Code() string { + return "InvalidRevisionException" +} + +// Message returns the exception's message. +func (s InvalidRevisionException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRevisionException) OrigErr() error { return nil } -// SetDeploymentConfigName sets the DeploymentConfigName field's value. -func (s *GetDeploymentConfigInput) SetDeploymentConfigName(v string) *GetDeploymentConfigInput { - s.DeploymentConfigName = &v - return s +func (s InvalidRevisionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// Represents the output of a GetDeploymentConfig operation. -type GetDeploymentConfigOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRevisionException) StatusCode() int { + return s.respMetadata.StatusCode +} - // Information about the deployment configuration. - DeploymentConfigInfo *DeploymentConfigInfo `locationName:"deploymentConfigInfo" type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidRevisionException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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 Amazon EC2 Auto Scaling. +type InvalidRoleException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetDeploymentConfigOutput) String() string { +func (s InvalidRoleException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDeploymentConfigOutput) GoString() string { +func (s InvalidRoleException) GoString() string { return s.String() } -// SetDeploymentConfigInfo sets the DeploymentConfigInfo field's value. -func (s *GetDeploymentConfigOutput) SetDeploymentConfigInfo(v *DeploymentConfigInfo) *GetDeploymentConfigOutput { - s.DeploymentConfigInfo = v - return s +func newErrorInvalidRoleException(v protocol.ResponseMetadata) error { + return &InvalidRoleException{ + respMetadata: v, + } } -// Represents the input of a GetDeploymentGroup operation. -type GetDeploymentGroupInput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s InvalidRoleException) Code() string { + return "InvalidRoleException" +} - // The name of an AWS CodeDeploy application associated with the IAM user or - // AWS account. - // - // ApplicationName is a required field - ApplicationName *string `locationName:"applicationName" min:"1" type:"string" required:"true"` +// Message returns the exception's message. +func (s InvalidRoleException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The name of a deployment group for the specified application. - // - // DeploymentGroupName is a required field - DeploymentGroupName *string `locationName:"deploymentGroupName" min:"1" type:"string" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRoleException) OrigErr() error { + return nil +} + +func (s InvalidRoleException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRoleException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRoleException) RequestID() string { + return s.respMetadata.RequestID +} + +// The column name to sort by is either not present or was specified in an invalid +// format. +type InvalidSortByException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetDeploymentGroupInput) String() string { +func (s InvalidSortByException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDeploymentGroupInput) GoString() string { +func (s InvalidSortByException) 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)) +func newErrorInvalidSortByException(v protocol.ResponseMetadata) error { + return &InvalidSortByException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidSortByException) Code() string { + return "InvalidSortByException" +} + +// Message returns the exception's message. +func (s InvalidSortByException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidSortByException) OrigErr() error { return nil } -// SetApplicationName sets the ApplicationName field's value. -func (s *GetDeploymentGroupInput) SetApplicationName(v string) *GetDeploymentGroupInput { - s.ApplicationName = &v - return s +func (s InvalidSortByException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetDeploymentGroupName sets the DeploymentGroupName field's value. -func (s *GetDeploymentGroupInput) SetDeploymentGroupName(v string) *GetDeploymentGroupInput { - s.DeploymentGroupName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidSortByException) StatusCode() int { + return s.respMetadata.StatusCode } -// Represents the output of a GetDeploymentGroup operation. -type GetDeploymentGroupOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidSortByException) RequestID() string { + return s.respMetadata.RequestID +} - // Information about the deployment group. - DeploymentGroupInfo *DeploymentGroupInfo `locationName:"deploymentGroupInfo" type:"structure"` +// The sort order was specified in an invalid format. +type InvalidSortOrderException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetDeploymentGroupOutput) String() string { +func (s InvalidSortOrderException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDeploymentGroupOutput) GoString() string { +func (s InvalidSortOrderException) GoString() string { return s.String() } -// SetDeploymentGroupInfo sets the DeploymentGroupInfo field's value. -func (s *GetDeploymentGroupOutput) SetDeploymentGroupInfo(v *DeploymentGroupInfo) *GetDeploymentGroupOutput { - s.DeploymentGroupInfo = v - return s +func newErrorInvalidSortOrderException(v protocol.ResponseMetadata) error { + return &InvalidSortOrderException{ + respMetadata: v, + } } -// Represents the input of a GetDeployment operation. -type GetDeploymentInput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s InvalidSortOrderException) Code() string { + return "InvalidSortOrderException" +} - // The unique ID of a deployment associated with the IAM user or AWS account. - // - // DeploymentId is a required field - DeploymentId *string `locationName:"deploymentId" type:"string" required:"true"` +// Message returns the exception's message. +func (s InvalidSortOrderException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidSortOrderException) OrigErr() error { + return nil +} + +func (s InvalidSortOrderException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidSortOrderException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidSortOrderException) RequestID() string { + return s.respMetadata.RequestID +} + +// The tag was specified in an invalid format. +type InvalidTagException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetDeploymentInput) String() string { +func (s InvalidTagException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDeploymentInput) GoString() string { +func (s InvalidTagException) 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")) +func newErrorInvalidTagException(v protocol.ResponseMetadata) error { + return &InvalidTagException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidTagException) Code() string { + return "InvalidTagException" +} + +// Message returns the exception's message. +func (s InvalidTagException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTagException) OrigErr() error { return nil } -// SetDeploymentId sets the DeploymentId field's value. -func (s *GetDeploymentInput) SetDeploymentId(v string) *GetDeploymentInput { - s.DeploymentId = &v - return s +func (s InvalidTagException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// Represents the input of a GetDeploymentInstance operation. -type GetDeploymentInstanceInput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTagException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The unique ID of a deployment. - // - // DeploymentId is a required field - DeploymentId *string `locationName:"deploymentId" type:"string" required:"true"` +// RequestID returns the service's response RequestID for request. +func (s InvalidTagException) RequestID() string { + return s.respMetadata.RequestID +} - // The unique ID of an instance in the deployment group. - // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` +// The tag filter was specified in an invalid format. +type InvalidTagFilterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetDeploymentInstanceInput) String() string { +func (s InvalidTagFilterException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDeploymentInstanceInput) GoString() string { +func (s InvalidTagFilterException) 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")) +func newErrorInvalidTagFilterException(v protocol.ResponseMetadata) error { + return &InvalidTagFilterException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidTagFilterException) Code() string { + return "InvalidTagFilterException" +} + +// Message returns the exception's message. +func (s InvalidTagFilterException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTagFilterException) OrigErr() error { return nil } -// SetDeploymentId sets the DeploymentId field's value. -func (s *GetDeploymentInstanceInput) SetDeploymentId(v string) *GetDeploymentInstanceInput { - s.DeploymentId = &v - return s +func (s InvalidTagFilterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetInstanceId sets the InstanceId field's value. -func (s *GetDeploymentInstanceInput) SetInstanceId(v string) *GetDeploymentInstanceInput { - s.InstanceId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTagFilterException) StatusCode() int { + return s.respMetadata.StatusCode } -// Represents the output of a GetDeploymentInstance operation. -type GetDeploymentInstanceOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidTagFilterException) RequestID() string { + return s.respMetadata.RequestID +} - // Information about the instance. - InstanceSummary *InstanceSummary `locationName:"instanceSummary" deprecated:"true" type:"structure"` +// The specified tags are not valid. +type InvalidTagsToAddException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetDeploymentInstanceOutput) String() string { +func (s InvalidTagsToAddException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDeploymentInstanceOutput) GoString() string { +func (s InvalidTagsToAddException) GoString() string { return s.String() } -// SetInstanceSummary sets the InstanceSummary field's value. -func (s *GetDeploymentInstanceOutput) SetInstanceSummary(v *InstanceSummary) *GetDeploymentInstanceOutput { - s.InstanceSummary = v - return s +func newErrorInvalidTagsToAddException(v protocol.ResponseMetadata) error { + return &InvalidTagsToAddException{ + respMetadata: v, + } } -// Represents the output of a GetDeployment operation. -type GetDeploymentOutput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s InvalidTagsToAddException) Code() string { + return "InvalidTagsToAddException" +} - // Information about the deployment. - DeploymentInfo *DeploymentInfo `locationName:"deploymentInfo" type:"structure"` +// Message returns the exception's message. +func (s InvalidTagsToAddException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s GetDeploymentOutput) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTagsToAddException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s GetDeploymentOutput) GoString() string { - return s.String() +func (s InvalidTagsToAddException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetDeploymentInfo sets the DeploymentInfo field's value. -func (s *GetDeploymentOutput) SetDeploymentInfo(v *DeploymentInfo) *GetDeploymentOutput { - s.DeploymentInfo = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTagsToAddException) StatusCode() int { + return s.respMetadata.StatusCode } -type GetDeploymentTargetInput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidTagsToAddException) RequestID() string { + return s.respMetadata.RequestID +} - // The unique ID of a deployment. - DeploymentId *string `locationName:"deploymentId" type:"string"` +// The target filter name is invalid. +type InvalidTargetFilterNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The unique ID of a deployment target. - TargetId *string `locationName:"targetId" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetDeploymentTargetInput) String() string { +func (s InvalidTargetFilterNameException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDeploymentTargetInput) GoString() string { +func (s InvalidTargetFilterNameException) GoString() string { return s.String() } -// SetDeploymentId sets the DeploymentId field's value. -func (s *GetDeploymentTargetInput) SetDeploymentId(v string) *GetDeploymentTargetInput { - s.DeploymentId = &v - return s +func newErrorInvalidTargetFilterNameException(v protocol.ResponseMetadata) error { + return &InvalidTargetFilterNameException{ + respMetadata: v, + } } -// SetTargetId sets the TargetId field's value. -func (s *GetDeploymentTargetInput) SetTargetId(v string) *GetDeploymentTargetInput { - s.TargetId = &v - return s +// Code returns the exception type name. +func (s InvalidTargetFilterNameException) Code() string { + return "InvalidTargetFilterNameException" } -type GetDeploymentTargetOutput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidTargetFilterNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // A deployment target that contains information about a deployment such as - // its status, lifecyle events, and when it was last updated. It also contains - // metadata about the deployment target. The deployment target metadata depends - // on the deployment target's type (instanceTarget, lambdaTarget, or ecsTarget). - DeploymentTarget *DeploymentTarget `locationName:"deploymentTarget" type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTargetFilterNameException) OrigErr() error { + return nil } -// String returns the string representation -func (s GetDeploymentTargetOutput) String() string { - return awsutil.Prettify(s) +func (s InvalidTargetFilterNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// GoString returns the string representation -func (s GetDeploymentTargetOutput) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTargetFilterNameException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetDeploymentTarget sets the DeploymentTarget field's value. -func (s *GetDeploymentTargetOutput) SetDeploymentTarget(v *DeploymentTarget) *GetDeploymentTargetOutput { - s.DeploymentTarget = v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidTargetFilterNameException) RequestID() string { + return s.respMetadata.RequestID } -// Represents the input of a GetOnPremisesInstance operation. -type GetOnPremisesInstanceInput struct { - _ struct{} `type:"structure"` +// A target group pair associated with this deployment is not valid. +type InvalidTargetGroupPairException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetOnPremisesInstanceInput) String() string { +func (s InvalidTargetGroupPairException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetOnPremisesInstanceInput) GoString() string { +func (s InvalidTargetGroupPairException) 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")) +func newErrorInvalidTargetGroupPairException(v protocol.ResponseMetadata) error { + return &InvalidTargetGroupPairException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidTargetGroupPairException) Code() string { + return "InvalidTargetGroupPairException" +} + +// Message returns the exception's message. +func (s InvalidTargetGroupPairException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTargetGroupPairException) OrigErr() error { return nil } -// SetInstanceName sets the InstanceName field's value. -func (s *GetOnPremisesInstanceInput) SetInstanceName(v string) *GetOnPremisesInstanceInput { - s.InstanceName = &v - return s +func (s InvalidTargetGroupPairException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// Represents the output of a GetOnPremisesInstance operation. -type GetOnPremisesInstanceOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTargetGroupPairException) StatusCode() int { + return s.respMetadata.StatusCode +} - // Information about the on-premises instance. - InstanceInfo *InstanceInfo `locationName:"instanceInfo" type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidTargetGroupPairException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type InvalidTargetInstancesException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetOnPremisesInstanceOutput) String() string { +func (s InvalidTargetInstancesException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetOnPremisesInstanceOutput) GoString() string { +func (s InvalidTargetInstancesException) GoString() string { return s.String() } -// SetInstanceInfo sets the InstanceInfo field's value. -func (s *GetOnPremisesInstanceOutput) SetInstanceInfo(v *InstanceInfo) *GetOnPremisesInstanceOutput { - s.InstanceInfo = v - return s +func newErrorInvalidTargetInstancesException(v protocol.ResponseMetadata) error { + return &InvalidTargetInstancesException{ + respMetadata: v, + } } -// Information about the location of application artifacts stored in GitHub. -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"` +// Code returns the exception type name. +func (s InvalidTargetInstancesException) Code() string { + return "InvalidTargetInstancesException" +} - // 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"` +// Message returns the exception's message. +func (s InvalidTargetInstancesException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s GitHubLocation) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTargetInstancesException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s GitHubLocation) GoString() string { - return s.String() +func (s InvalidTargetInstancesException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetCommitId sets the CommitId field's value. -func (s *GitHubLocation) SetCommitId(v string) *GitHubLocation { - s.CommitId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTargetInstancesException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetRepository sets the Repository field's value. -func (s *GitHubLocation) SetRepository(v string) *GitHubLocation { - s.Repository = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidTargetInstancesException) RequestID() string { + return s.respMetadata.RequestID } -// Information about the instances that belong to the replacement environment -// in a blue/green deployment. -type GreenFleetProvisioningOption struct { - _ struct{} `type:"structure"` +// The specified time range was specified in an invalid format. +type InvalidTimeRangeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GreenFleetProvisioningOption) String() string { +func (s InvalidTimeRangeException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GreenFleetProvisioningOption) GoString() string { +func (s InvalidTimeRangeException) GoString() string { return s.String() } -// SetAction sets the Action field's value. -func (s *GreenFleetProvisioningOption) SetAction(v string) *GreenFleetProvisioningOption { - s.Action = &v - return s +func newErrorInvalidTimeRangeException(v protocol.ResponseMetadata) error { + return &InvalidTimeRangeException{ + respMetadata: v, + } } -// Information about an on-premises instance. -type InstanceInfo struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s InvalidTimeRangeException) Code() string { + return "InvalidTimeRangeException" +} - // If the on-premises instance was deregistered, the time at which the on-premises - // instance was deregistered. - DeregisterTime *time.Time `locationName:"deregisterTime" type:"timestamp"` +// Message returns the exception's message. +func (s InvalidTimeRangeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The ARN of the IAM session associated with the on-premises instance. - IamSessionArn *string `locationName:"iamSessionArn" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTimeRangeException) OrigErr() error { + return nil +} - // The IAM user ARN associated with the on-premises instance. - IamUserArn *string `locationName:"iamUserArn" type:"string"` +func (s InvalidTimeRangeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The ARN of the on-premises instance. - InstanceArn *string `locationName:"instanceArn" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTimeRangeException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The name of the on-premises instance. - InstanceName *string `locationName:"instanceName" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s InvalidTimeRangeException) RequestID() string { + return s.respMetadata.RequestID +} - // The time at which the on-premises instance was registered. - RegisterTime *time.Time `locationName:"registerTime" type:"timestamp"` +// The configuration that specifies how traffic is routed during a deployment +// is invalid. +type InvalidTrafficRoutingConfigurationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The tags currently associated with the on-premises instance. - Tags []*Tag `locationName:"tags" type:"list"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s InstanceInfo) String() string { +func (s InvalidTrafficRoutingConfigurationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InstanceInfo) GoString() string { +func (s InvalidTrafficRoutingConfigurationException) 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 +func newErrorInvalidTrafficRoutingConfigurationException(v protocol.ResponseMetadata) error { + return &InvalidTrafficRoutingConfigurationException{ + respMetadata: v, + } } -// SetIamSessionArn sets the IamSessionArn field's value. -func (s *InstanceInfo) SetIamSessionArn(v string) *InstanceInfo { - s.IamSessionArn = &v - return s +// Code returns the exception type name. +func (s InvalidTrafficRoutingConfigurationException) Code() string { + return "InvalidTrafficRoutingConfigurationException" } -// SetIamUserArn sets the IamUserArn field's value. -func (s *InstanceInfo) SetIamUserArn(v string) *InstanceInfo { - s.IamUserArn = &v - return s +// Message returns the exception's message. +func (s InvalidTrafficRoutingConfigurationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetInstanceArn sets the InstanceArn field's value. -func (s *InstanceInfo) SetInstanceArn(v string) *InstanceInfo { - s.InstanceArn = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTrafficRoutingConfigurationException) OrigErr() error { + return nil } -// SetInstanceName sets the InstanceName field's value. -func (s *InstanceInfo) SetInstanceName(v string) *InstanceInfo { - s.InstanceName = &v - return s +func (s InvalidTrafficRoutingConfigurationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetRegisterTime sets the RegisterTime field's value. -func (s *InstanceInfo) SetRegisterTime(v time.Time) *InstanceInfo { - s.RegisterTime = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTrafficRoutingConfigurationException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetTags sets the Tags field's value. -func (s *InstanceInfo) SetTags(v []*Tag) *InstanceInfo { - s.Tags = v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidTrafficRoutingConfigurationException) RequestID() string { + return s.respMetadata.RequestID } -// Information about an instance in a deployment. -// -// Deprecated: InstanceSummary is deprecated, use DeploymentTarget instead. -type InstanceSummary struct { - _ struct{} `deprecated:"true" type:"structure"` - - // The unique ID of a deployment. - 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 that indicaties when the instance information was last updated. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp"` - - // A list of lifecycle events for this instance. - LifecycleEvents []*LifecycleEvent `locationName:"lifecycleEvents" type:"list"` +// The trigger was specified in an invalid format. +type InvalidTriggerConfigException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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" deprecated:"true" type:"string" enum:"InstanceStatus"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s InstanceSummary) String() string { +func (s InvalidTriggerConfigException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InstanceSummary) GoString() string { +func (s InvalidTriggerConfigException) GoString() string { return s.String() } -// SetDeploymentId sets the DeploymentId field's value. -func (s *InstanceSummary) SetDeploymentId(v string) *InstanceSummary { - s.DeploymentId = &v - return s +func newErrorInvalidTriggerConfigException(v protocol.ResponseMetadata) error { + return &InvalidTriggerConfigException{ + respMetadata: v, + } } -// SetInstanceId sets the InstanceId field's value. -func (s *InstanceSummary) SetInstanceId(v string) *InstanceSummary { - s.InstanceId = &v - return s +// Code returns the exception type name. +func (s InvalidTriggerConfigException) Code() string { + return "InvalidTriggerConfigException" } -// SetInstanceType sets the InstanceType field's value. -func (s *InstanceSummary) SetInstanceType(v string) *InstanceSummary { - s.InstanceType = &v - return s +// Message returns the exception's message. +func (s InvalidTriggerConfigException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *InstanceSummary) SetLastUpdatedAt(v time.Time) *InstanceSummary { - s.LastUpdatedAt = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTriggerConfigException) OrigErr() error { + return nil } -// SetLifecycleEvents sets the LifecycleEvents field's value. -func (s *InstanceSummary) SetLifecycleEvents(v []*LifecycleEvent) *InstanceSummary { - s.LifecycleEvents = v - return s +func (s InvalidTriggerConfigException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetStatus sets the Status field's value. -func (s *InstanceSummary) SetStatus(v string) *InstanceSummary { - s.Status = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTriggerConfigException) StatusCode() int { + return s.respMetadata.StatusCode } -// A target Amazon EC2 or on-premises instance during a deployment that uses -// the EC2/On-premises compute platform. -type InstanceTarget struct { - _ struct{} `type:"structure"` - - // The unique ID of a deployment. - DeploymentId *string `locationName:"deploymentId" type:"string"` - - // A label that identifies whether the instance is an original target (BLUE) - // or a replacement target (GREEN). - InstanceLabel *string `locationName:"instanceLabel" type:"string" enum:"TargetLabel"` - - // The date and time when the target instance was updated by a deployment. - LastUpdatedAt *time.Time `locationName:"lastUpdatedAt" type:"timestamp"` - - // The lifecycle events of the deployment to this target instance. - LifecycleEvents []*LifecycleEvent `locationName:"lifecycleEvents" type:"list"` - - // The status an EC2/On-premises deployment's target instance. - Status *string `locationName:"status" type:"string" enum:"TargetStatus"` - - // The ARN of the target. - TargetArn *string `locationName:"targetArn" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s InvalidTriggerConfigException) RequestID() string { + return s.respMetadata.RequestID +} - // The unique ID of a deployment target that has a type of instanceTarget. - TargetId *string `locationName:"targetId" type:"string"` +// The UpdateOutdatedInstancesOnly value is invalid. For AWS Lambda deployments, +// false is expected. For EC2/On-premises deployments, true or false is expected. +type InvalidUpdateOutdatedInstancesOnlyValueException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s InstanceTarget) String() string { +func (s InvalidUpdateOutdatedInstancesOnlyValueException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InstanceTarget) GoString() string { +func (s InvalidUpdateOutdatedInstancesOnlyValueException) GoString() string { return s.String() } -// SetDeploymentId sets the DeploymentId field's value. -func (s *InstanceTarget) SetDeploymentId(v string) *InstanceTarget { - s.DeploymentId = &v - return s +func newErrorInvalidUpdateOutdatedInstancesOnlyValueException(v protocol.ResponseMetadata) error { + return &InvalidUpdateOutdatedInstancesOnlyValueException{ + respMetadata: v, + } } -// SetInstanceLabel sets the InstanceLabel field's value. -func (s *InstanceTarget) SetInstanceLabel(v string) *InstanceTarget { - s.InstanceLabel = &v - return s +// Code returns the exception type name. +func (s InvalidUpdateOutdatedInstancesOnlyValueException) Code() string { + return "InvalidUpdateOutdatedInstancesOnlyValueException" } -// SetLastUpdatedAt sets the LastUpdatedAt field's value. -func (s *InstanceTarget) SetLastUpdatedAt(v time.Time) *InstanceTarget { - s.LastUpdatedAt = &v - return s +// Message returns the exception's message. +func (s InvalidUpdateOutdatedInstancesOnlyValueException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetLifecycleEvents sets the LifecycleEvents field's value. -func (s *InstanceTarget) SetLifecycleEvents(v []*LifecycleEvent) *InstanceTarget { - s.LifecycleEvents = v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidUpdateOutdatedInstancesOnlyValueException) OrigErr() error { + return nil } -// SetStatus sets the Status field's value. -func (s *InstanceTarget) SetStatus(v string) *InstanceTarget { - s.Status = &v - return s +func (s InvalidUpdateOutdatedInstancesOnlyValueException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetTargetArn sets the TargetArn field's value. -func (s *InstanceTarget) SetTargetArn(v string) *InstanceTarget { - s.TargetArn = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidUpdateOutdatedInstancesOnlyValueException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetTargetId sets the TargetId field's value. -func (s *InstanceTarget) SetTargetId(v string) *InstanceTarget { - s.TargetId = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidUpdateOutdatedInstancesOnlyValueException) RequestID() string { + return s.respMetadata.RequestID } // Information about a Lambda function specified in a deployment. @@ -9483,6 +14760,118 @@ func (s *LifecycleEvent) SetStatus(v string) *LifecycleEvent { return s } +// An attempt to return the status of an already completed lifecycle event occurred. +type LifecycleEventAlreadyCompletedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LifecycleEventAlreadyCompletedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecycleEventAlreadyCompletedException) GoString() string { + return s.String() +} + +func newErrorLifecycleEventAlreadyCompletedException(v protocol.ResponseMetadata) error { + return &LifecycleEventAlreadyCompletedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LifecycleEventAlreadyCompletedException) Code() string { + return "LifecycleEventAlreadyCompletedException" +} + +// Message returns the exception's message. +func (s LifecycleEventAlreadyCompletedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LifecycleEventAlreadyCompletedException) OrigErr() error { + return nil +} + +func (s LifecycleEventAlreadyCompletedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LifecycleEventAlreadyCompletedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LifecycleEventAlreadyCompletedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The limit for lifecycle hooks was exceeded. +type LifecycleHookLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LifecycleHookLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecycleHookLimitExceededException) GoString() string { + return s.String() +} + +func newErrorLifecycleHookLimitExceededException(v protocol.ResponseMetadata) error { + return &LifecycleHookLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LifecycleHookLimitExceededException) Code() string { + return "LifecycleHookLimitExceededException" +} + +// Message returns the exception's message. +func (s LifecycleHookLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LifecycleHookLimitExceededException) OrigErr() error { + return nil +} + +func (s LifecycleHookLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LifecycleHookLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LifecycleHookLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents the input of a ListApplicationRevisions operation. type ListApplicationRevisionsInput struct { _ struct{} `type:"structure"` @@ -10533,6 +15922,63 @@ func (s *MinimumHealthyHosts) SetValue(v int64) *MinimumHealthyHosts { return s } +// Both an IAM user ARN and an IAM session ARN were included in the request. +// Use only one ARN type. +type MultipleIamArnsProvidedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s MultipleIamArnsProvidedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MultipleIamArnsProvidedException) GoString() string { + return s.String() +} + +func newErrorMultipleIamArnsProvidedException(v protocol.ResponseMetadata) error { + return &MultipleIamArnsProvidedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MultipleIamArnsProvidedException) Code() string { + return "MultipleIamArnsProvidedException" +} + +// Message returns the exception's message. +func (s MultipleIamArnsProvidedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MultipleIamArnsProvidedException) OrigErr() error { + return nil +} + +func (s MultipleIamArnsProvidedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MultipleIamArnsProvidedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MultipleIamArnsProvidedException) RequestID() string { + return s.respMetadata.RequestID +} + // Information about groups of on-premises instance tags. type OnPremisesTagSet struct { _ struct{} `type:"structure"` @@ -10559,6 +16005,62 @@ func (s *OnPremisesTagSet) SetOnPremisesTagSetList(v [][]*TagFilter) *OnPremises return s } +// The API used does not support the deployment. +type OperationNotSupportedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s OperationNotSupportedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OperationNotSupportedException) GoString() string { + return s.String() +} + +func newErrorOperationNotSupportedException(v protocol.ResponseMetadata) error { + return &OperationNotSupportedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OperationNotSupportedException) Code() string { + return "OperationNotSupportedException" +} + +// Message returns the exception's message. +func (s OperationNotSupportedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OperationNotSupportedException) OrigErr() error { + return nil +} + +func (s OperationNotSupportedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OperationNotSupportedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OperationNotSupportedException) RequestID() string { + return s.respMetadata.RequestID +} + type PutLifecycleEventHookExecutionStatusInput struct { _ struct{} `type:"structure"` @@ -10839,50 +16341,218 @@ func (s RemoveTagsFromOnPremisesInstancesInput) String() string { } // GoString returns the string representation -func (s RemoveTagsFromOnPremisesInstancesInput) GoString() string { +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 +} + +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() +} + +// The ARN of a resource is required, but was not found. +type ResourceArnRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceArnRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceArnRequiredException) GoString() string { + return s.String() +} + +func newErrorResourceArnRequiredException(v protocol.ResponseMetadata) error { + return &ResourceArnRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceArnRequiredException) Code() string { + return "ResourceArnRequiredException" +} + +// Message returns the exception's message. +func (s ResourceArnRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceArnRequiredException) OrigErr() error { + return nil +} + +func (s ResourceArnRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceArnRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceArnRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource could not be validated. +type ResourceValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceValidationException) GoString() string { + return s.String() +} + +func newErrorResourceValidationException(v protocol.ResponseMetadata) error { + return &ResourceValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceValidationException) Code() string { + return "ResourceValidationException" +} + +// Message returns the exception's message. +func (s ResourceValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceValidationException) OrigErr() error { + return nil +} + +func (s ResourceValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceValidationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The named revision does not exist with the IAM user or AWS account. +type RevisionDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RevisionDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RevisionDoesNotExistException) 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")) +func newErrorRevisionDoesNotExistException(v protocol.ResponseMetadata) error { + return &RevisionDoesNotExistException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// Code returns the exception type name. +func (s RevisionDoesNotExistException) Code() string { + return "RevisionDoesNotExistException" } -// SetInstanceNames sets the InstanceNames field's value. -func (s *RemoveTagsFromOnPremisesInstancesInput) SetInstanceNames(v []*string) *RemoveTagsFromOnPremisesInstancesInput { - s.InstanceNames = v - return s +// Message returns the exception's message. +func (s RevisionDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetTags sets the Tags field's value. -func (s *RemoveTagsFromOnPremisesInstancesInput) SetTags(v []*Tag) *RemoveTagsFromOnPremisesInstancesInput { - s.Tags = v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RevisionDoesNotExistException) OrigErr() error { + return nil } -type RemoveTagsFromOnPremisesInstancesOutput struct { - _ struct{} `type:"structure"` +func (s RevisionDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// String returns the string representation -func (s RemoveTagsFromOnPremisesInstancesOutput) String() string { - return awsutil.Prettify(s) +// Status code returns the HTTP status code for the request's response error. +func (s RevisionDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode } -// GoString returns the string representation -func (s RemoveTagsFromOnPremisesInstancesOutput) GoString() string { - return s.String() +// RequestID returns the service's response RequestID for request. +func (s RevisionDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID } // Information about an application revision. @@ -10989,6 +16659,118 @@ func (s *RevisionLocation) SetString_(v *RawString) *RevisionLocation { return s } +// The revision ID was not specified. +type RevisionRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RevisionRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RevisionRequiredException) GoString() string { + return s.String() +} + +func newErrorRevisionRequiredException(v protocol.ResponseMetadata) error { + return &RevisionRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RevisionRequiredException) Code() string { + return "RevisionRequiredException" +} + +// Message returns the exception's message. +func (s RevisionRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RevisionRequiredException) OrigErr() error { + return nil +} + +func (s RevisionRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RevisionRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RevisionRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The role ID was not specified. +type RoleRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RoleRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RoleRequiredException) GoString() string { + return s.String() +} + +func newErrorRoleRequiredException(v protocol.ResponseMetadata) error { + return &RoleRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RoleRequiredException) Code() string { + return "RoleRequiredException" +} + +// Message returns the exception's message. +func (s RoleRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RoleRequiredException) OrigErr() error { + return nil +} + +func (s RoleRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RoleRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RoleRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + // Information about a deployment rollback. type RollbackInfo struct { _ struct{} `type:"structure"` @@ -11315,6 +17097,118 @@ func (s *TagFilter) SetValue(v string) *TagFilter { return s } +// The maximum allowed number of tags was exceeded. +type TagLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TagLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagLimitExceededException) GoString() string { + return s.String() +} + +func newErrorTagLimitExceededException(v protocol.ResponseMetadata) error { + return &TagLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagLimitExceededException) Code() string { + return "TagLimitExceededException" +} + +// Message returns the exception's message. +func (s TagLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagLimitExceededException) OrigErr() error { + return nil +} + +func (s TagLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// A tag was not specified. +type TagRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TagRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagRequiredException) GoString() string { + return s.String() +} + +func newErrorTagRequiredException(v protocol.ResponseMetadata) error { + return &TagRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagRequiredException) Code() string { + return "TagRequiredException" +} + +// Message returns the exception's message. +func (s TagRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagRequiredException) OrigErr() error { + return nil +} + +func (s TagRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + type TagResourceInput struct { _ struct{} `type:"structure"` @@ -11385,6 +17279,63 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// The number of tag groups included in the tag set list exceeded the maximum +// allowed limit of 3. +type TagSetListLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TagSetListLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagSetListLimitExceededException) GoString() string { + return s.String() +} + +func newErrorTagSetListLimitExceededException(v protocol.ResponseMetadata) error { + return &TagSetListLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagSetListLimitExceededException) Code() string { + return "TagSetListLimitExceededException" +} + +// Message returns the exception's message. +func (s TagSetListLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagSetListLimitExceededException) OrigErr() error { + return nil +} + +func (s TagSetListLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagSetListLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagSetListLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Information about a target group in Elastic Load Balancing to use in a deployment. // Instances are registered as targets in a target group, and traffic is routed // to the target group. @@ -11512,6 +17463,62 @@ func (s *TargetInstances) SetTagFilters(v []*EC2TagFilter) *TargetInstances { return s } +// An API function was called too frequently. +type ThrottlingException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ThrottlingException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ThrottlingException) GoString() string { + return s.String() +} + +func newErrorThrottlingException(v protocol.ResponseMetadata) error { + return &ThrottlingException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ThrottlingException) Code() string { + return "ThrottlingException" +} + +// Message returns the exception's message. +func (s ThrottlingException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ThrottlingException) OrigErr() error { + return nil +} + +func (s ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ThrottlingException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ThrottlingException) RequestID() string { + return s.respMetadata.RequestID +} + // A configuration that shifts traffic from one version of a Lambda function // to another in two increments. The original and target Lambda function versions // are specified in the deployment's AppSpec file. @@ -11743,6 +17750,118 @@ func (s *TriggerConfig) SetTriggerTargetArn(v string) *TriggerConfig { return s } +// The maximum allowed number of triggers was exceeded. +type TriggerTargetsLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TriggerTargetsLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TriggerTargetsLimitExceededException) GoString() string { + return s.String() +} + +func newErrorTriggerTargetsLimitExceededException(v protocol.ResponseMetadata) error { + return &TriggerTargetsLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TriggerTargetsLimitExceededException) Code() string { + return "TriggerTargetsLimitExceededException" +} + +// Message returns the exception's message. +func (s TriggerTargetsLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TriggerTargetsLimitExceededException) OrigErr() error { + return nil +} + +func (s TriggerTargetsLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TriggerTargetsLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TriggerTargetsLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// A call was submitted that is not supported for the specified deployment type. +type UnsupportedActionForDeploymentTypeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedActionForDeploymentTypeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedActionForDeploymentTypeException) GoString() string { + return s.String() +} + +func newErrorUnsupportedActionForDeploymentTypeException(v protocol.ResponseMetadata) error { + return &UnsupportedActionForDeploymentTypeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedActionForDeploymentTypeException) Code() string { + return "UnsupportedActionForDeploymentTypeException" +} + +// Message returns the exception's message. +func (s UnsupportedActionForDeploymentTypeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedActionForDeploymentTypeException) OrigErr() error { + return nil +} + +func (s UnsupportedActionForDeploymentTypeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedActionForDeploymentTypeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedActionForDeploymentTypeException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` 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 index 2d4a5150740..89a7dac6881 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/errors.go @@ -2,6 +2,10 @@ package codedeploy +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAlarmsLimitExceededException for service response error code @@ -706,3 +710,114 @@ const ( // A call was submitted that is not supported for the specified deployment type. ErrCodeUnsupportedActionForDeploymentTypeException = "UnsupportedActionForDeploymentTypeException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AlarmsLimitExceededException": newErrorAlarmsLimitExceededException, + "ApplicationAlreadyExistsException": newErrorApplicationAlreadyExistsException, + "ApplicationDoesNotExistException": newErrorApplicationDoesNotExistException, + "ApplicationLimitExceededException": newErrorApplicationLimitExceededException, + "ApplicationNameRequiredException": newErrorApplicationNameRequiredException, + "ArnNotSupportedException": newErrorArnNotSupportedException, + "BatchLimitExceededException": newErrorBatchLimitExceededException, + "BucketNameFilterRequiredException": newErrorBucketNameFilterRequiredException, + "DeploymentAlreadyCompletedException": newErrorDeploymentAlreadyCompletedException, + "DeploymentConfigAlreadyExistsException": newErrorDeploymentConfigAlreadyExistsException, + "DeploymentConfigDoesNotExistException": newErrorDeploymentConfigDoesNotExistException, + "DeploymentConfigInUseException": newErrorDeploymentConfigInUseException, + "DeploymentConfigLimitExceededException": newErrorDeploymentConfigLimitExceededException, + "DeploymentConfigNameRequiredException": newErrorDeploymentConfigNameRequiredException, + "DeploymentDoesNotExistException": newErrorDeploymentDoesNotExistException, + "DeploymentGroupAlreadyExistsException": newErrorDeploymentGroupAlreadyExistsException, + "DeploymentGroupDoesNotExistException": newErrorDeploymentGroupDoesNotExistException, + "DeploymentGroupLimitExceededException": newErrorDeploymentGroupLimitExceededException, + "DeploymentGroupNameRequiredException": newErrorDeploymentGroupNameRequiredException, + "DeploymentIdRequiredException": newErrorDeploymentIdRequiredException, + "DeploymentIsNotInReadyStateException": newErrorDeploymentIsNotInReadyStateException, + "DeploymentLimitExceededException": newErrorDeploymentLimitExceededException, + "DeploymentNotStartedException": newErrorDeploymentNotStartedException, + "DeploymentTargetDoesNotExistException": newErrorDeploymentTargetDoesNotExistException, + "DeploymentTargetIdRequiredException": newErrorDeploymentTargetIdRequiredException, + "DeploymentTargetListSizeExceededException": newErrorDeploymentTargetListSizeExceededException, + "DescriptionTooLongException": newErrorDescriptionTooLongException, + "ECSServiceMappingLimitExceededException": newErrorECSServiceMappingLimitExceededException, + "GitHubAccountTokenDoesNotExistException": newErrorGitHubAccountTokenDoesNotExistException, + "GitHubAccountTokenNameRequiredException": newErrorGitHubAccountTokenNameRequiredException, + "IamArnRequiredException": newErrorIamArnRequiredException, + "IamSessionArnAlreadyRegisteredException": newErrorIamSessionArnAlreadyRegisteredException, + "IamUserArnAlreadyRegisteredException": newErrorIamUserArnAlreadyRegisteredException, + "IamUserArnRequiredException": newErrorIamUserArnRequiredException, + "InstanceDoesNotExistException": newErrorInstanceDoesNotExistException, + "InstanceIdRequiredException": newErrorInstanceIdRequiredException, + "InstanceLimitExceededException": newErrorInstanceLimitExceededException, + "InstanceNameAlreadyRegisteredException": newErrorInstanceNameAlreadyRegisteredException, + "InstanceNameRequiredException": newErrorInstanceNameRequiredException, + "InstanceNotRegisteredException": newErrorInstanceNotRegisteredException, + "InvalidAlarmConfigException": newErrorInvalidAlarmConfigException, + "InvalidApplicationNameException": newErrorInvalidApplicationNameException, + "InvalidArnException": newErrorInvalidArnException, + "InvalidAutoRollbackConfigException": newErrorInvalidAutoRollbackConfigException, + "InvalidAutoScalingGroupException": newErrorInvalidAutoScalingGroupException, + "InvalidBlueGreenDeploymentConfigurationException": newErrorInvalidBlueGreenDeploymentConfigurationException, + "InvalidBucketNameFilterException": newErrorInvalidBucketNameFilterException, + "InvalidComputePlatformException": newErrorInvalidComputePlatformException, + "InvalidDeployedStateFilterException": newErrorInvalidDeployedStateFilterException, + "InvalidDeploymentConfigNameException": newErrorInvalidDeploymentConfigNameException, + "InvalidDeploymentGroupNameException": newErrorInvalidDeploymentGroupNameException, + "InvalidDeploymentIdException": newErrorInvalidDeploymentIdException, + "InvalidDeploymentInstanceTypeException": newErrorInvalidDeploymentInstanceTypeException, + "InvalidDeploymentStatusException": newErrorInvalidDeploymentStatusException, + "InvalidDeploymentStyleException": newErrorInvalidDeploymentStyleException, + "InvalidDeploymentTargetIdException": newErrorInvalidDeploymentTargetIdException, + "InvalidDeploymentWaitTypeException": newErrorInvalidDeploymentWaitTypeException, + "InvalidEC2TagCombinationException": newErrorInvalidEC2TagCombinationException, + "InvalidEC2TagException": newErrorInvalidEC2TagException, + "InvalidECSServiceException": newErrorInvalidECSServiceException, + "InvalidFileExistsBehaviorException": newErrorInvalidFileExistsBehaviorException, + "InvalidGitHubAccountTokenException": newErrorInvalidGitHubAccountTokenException, + "InvalidGitHubAccountTokenNameException": newErrorInvalidGitHubAccountTokenNameException, + "InvalidIamSessionArnException": newErrorInvalidIamSessionArnException, + "InvalidIamUserArnException": newErrorInvalidIamUserArnException, + "InvalidIgnoreApplicationStopFailuresValueException": newErrorInvalidIgnoreApplicationStopFailuresValueException, + "InvalidInputException": newErrorInvalidInputException, + "InvalidInstanceNameException": newErrorInvalidInstanceNameException, + "InvalidInstanceStatusException": newErrorInvalidInstanceStatusException, + "InvalidInstanceTypeException": newErrorInvalidInstanceTypeException, + "InvalidKeyPrefixFilterException": newErrorInvalidKeyPrefixFilterException, + "InvalidLifecycleEventHookExecutionIdException": newErrorInvalidLifecycleEventHookExecutionIdException, + "InvalidLifecycleEventHookExecutionStatusException": newErrorInvalidLifecycleEventHookExecutionStatusException, + "InvalidLoadBalancerInfoException": newErrorInvalidLoadBalancerInfoException, + "InvalidMinimumHealthyHostValueException": newErrorInvalidMinimumHealthyHostValueException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "InvalidOnPremisesTagCombinationException": newErrorInvalidOnPremisesTagCombinationException, + "InvalidOperationException": newErrorInvalidOperationException, + "InvalidRegistrationStatusException": newErrorInvalidRegistrationStatusException, + "InvalidRevisionException": newErrorInvalidRevisionException, + "InvalidRoleException": newErrorInvalidRoleException, + "InvalidSortByException": newErrorInvalidSortByException, + "InvalidSortOrderException": newErrorInvalidSortOrderException, + "InvalidTagException": newErrorInvalidTagException, + "InvalidTagFilterException": newErrorInvalidTagFilterException, + "InvalidTagsToAddException": newErrorInvalidTagsToAddException, + "InvalidTargetFilterNameException": newErrorInvalidTargetFilterNameException, + "InvalidTargetGroupPairException": newErrorInvalidTargetGroupPairException, + "InvalidTargetInstancesException": newErrorInvalidTargetInstancesException, + "InvalidTimeRangeException": newErrorInvalidTimeRangeException, + "InvalidTrafficRoutingConfigurationException": newErrorInvalidTrafficRoutingConfigurationException, + "InvalidTriggerConfigException": newErrorInvalidTriggerConfigException, + "InvalidUpdateOutdatedInstancesOnlyValueException": newErrorInvalidUpdateOutdatedInstancesOnlyValueException, + "LifecycleEventAlreadyCompletedException": newErrorLifecycleEventAlreadyCompletedException, + "LifecycleHookLimitExceededException": newErrorLifecycleHookLimitExceededException, + "MultipleIamArnsProvidedException": newErrorMultipleIamArnsProvidedException, + "OperationNotSupportedException": newErrorOperationNotSupportedException, + "ResourceArnRequiredException": newErrorResourceArnRequiredException, + "ResourceValidationException": newErrorResourceValidationException, + "RevisionDoesNotExistException": newErrorRevisionDoesNotExistException, + "RevisionRequiredException": newErrorRevisionRequiredException, + "RoleRequiredException": newErrorRoleRequiredException, + "TagLimitExceededException": newErrorTagLimitExceededException, + "TagRequiredException": newErrorTagRequiredException, + "TagSetListLimitExceededException": newErrorTagSetListLimitExceededException, + "ThrottlingException": newErrorThrottlingException, + "TriggerTargetsLimitExceededException": newErrorTriggerTargetsLimitExceededException, + "UnsupportedActionForDeploymentTypeException": newErrorUnsupportedActionForDeploymentTypeException, +} 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 index dd1eaf41355..3e34be1be99 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codedeploy/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codedeploy/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "codedeploy" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "CodeDeploy" // ServiceID is a unique identifer of a specific service. + ServiceID = "CodeDeploy" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CodeDeploy client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CodeDeploy client from just a session. // svc := codedeploy.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CodeDeploy { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CodeDeploy { svc := &CodeDeploy{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2014-10-06", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 9838d3012c8..49b9395f614 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codepipeline/api.go @@ -67,14 +67,14 @@ func (c *CodePipeline) AcknowledgeJobRequest(input *AcknowledgeJobInput) (req *r // See the AWS API reference guide for AWS CodePipeline's // API operation AcknowledgeJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeInvalidNonceException "InvalidNonceException" +// * InvalidNonceException // The nonce was specified in an invalid format. // -// * ErrCodeJobNotFoundException "JobNotFoundException" +// * JobNotFoundException // The job was specified in an invalid format or cannot be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/AcknowledgeJob @@ -153,17 +153,17 @@ func (c *CodePipeline) AcknowledgeThirdPartyJobRequest(input *AcknowledgeThirdPa // See the AWS API reference guide for AWS CodePipeline's // API operation AcknowledgeThirdPartyJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeInvalidNonceException "InvalidNonceException" +// * InvalidNonceException // The nonce was specified in an invalid format. // -// * ErrCodeJobNotFoundException "JobNotFoundException" +// * JobNotFoundException // The job was specified in an invalid format or cannot be found. // -// * ErrCodeInvalidClientTokenException "InvalidClientTokenException" +// * InvalidClientTokenException // The client token was specified in an invalid format // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/AcknowledgeThirdPartyJob @@ -242,21 +242,21 @@ func (c *CodePipeline) CreateCustomActionTypeRequest(input *CreateCustomActionTy // See the AWS API reference guide for AWS CodePipeline's // API operation CreateCustomActionType for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The number of pipelines associated with the AWS account has exceeded the // limit allowed for the account. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // The tags limit for a resource has been exceeded. // -// * ErrCodeInvalidTagsException "InvalidTagsException" +// * InvalidTagsException // The specified resource tags are invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Unable to modify the tag due to a simultaneous update request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/CreateCustomActionType @@ -338,36 +338,36 @@ func (c *CodePipeline) CreatePipelineRequest(input *CreatePipelineInput) (req *r // See the AWS API reference guide for AWS CodePipeline's // API operation CreatePipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodePipelineNameInUseException "PipelineNameInUseException" +// * PipelineNameInUseException // The specified pipeline name is already in use. // -// * ErrCodeInvalidStageDeclarationException "InvalidStageDeclarationException" +// * InvalidStageDeclarationException // The stage declaration was specified in an invalid format. // -// * ErrCodeInvalidActionDeclarationException "InvalidActionDeclarationException" +// * InvalidActionDeclarationException // The action declaration was specified in an invalid format. // -// * ErrCodeInvalidBlockerDeclarationException "InvalidBlockerDeclarationException" +// * InvalidBlockerDeclarationException // Reserved for future use. // -// * ErrCodeInvalidStructureException "InvalidStructureException" +// * InvalidStructureException // The structure was specified in an invalid format. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The number of pipelines associated with the AWS account has exceeded the // limit allowed for the account. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // The tags limit for a resource has been exceeded. // -// * ErrCodeInvalidTagsException "InvalidTagsException" +// * InvalidTagsException // The specified resource tags are invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Unable to modify the tag due to a simultaneous update request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/CreatePipeline @@ -453,11 +453,11 @@ func (c *CodePipeline) DeleteCustomActionTypeRequest(input *DeleteCustomActionTy // See the AWS API reference guide for AWS CodePipeline's // API operation DeleteCustomActionType for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Unable to modify the tag due to a simultaneous update request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DeleteCustomActionType @@ -536,11 +536,11 @@ func (c *CodePipeline) DeletePipelineRequest(input *DeletePipelineInput) (req *r // See the AWS API reference guide for AWS CodePipeline's // API operation DeletePipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Unable to modify the tag due to a simultaneous update request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DeletePipeline @@ -623,11 +623,11 @@ func (c *CodePipeline) DeleteWebhookRequest(input *DeleteWebhookInput) (req *req // See the AWS API reference guide for AWS CodePipeline's // API operation DeleteWebhook for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Unable to modify the tag due to a simultaneous update request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DeleteWebhook @@ -708,11 +708,11 @@ func (c *CodePipeline) DeregisterWebhookWithThirdPartyRequest(input *DeregisterW // See the AWS API reference guide for AWS CodePipeline's // API operation DeregisterWebhookWithThirdParty for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeWebhookNotFoundException "WebhookNotFoundException" +// * WebhookNotFoundException // The specified webhook was entered in an invalid format or cannot be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DeregisterWebhookWithThirdParty @@ -792,14 +792,14 @@ func (c *CodePipeline) DisableStageTransitionRequest(input *DisableStageTransiti // See the AWS API reference guide for AWS CodePipeline's // API operation DisableStageTransition for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The pipeline was specified in an invalid format or cannot be found. // -// * ErrCodeStageNotFoundException "StageNotFoundException" +// * StageNotFoundException // The stage was specified in an invalid format or cannot be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/DisableStageTransition @@ -878,14 +878,14 @@ func (c *CodePipeline) EnableStageTransitionRequest(input *EnableStageTransition // See the AWS API reference guide for AWS CodePipeline's // API operation EnableStageTransition for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The pipeline was specified in an invalid format or cannot be found. // -// * ErrCodeStageNotFoundException "StageNotFoundException" +// * StageNotFoundException // The stage was specified in an invalid format or cannot be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/EnableStageTransition @@ -957,9 +957,9 @@ func (c *CodePipeline) GetJobDetailsRequest(input *GetJobDetailsInput) (req *req // Returns information about a job. Used for custom actions only. // // 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. This -// API also returns any secret values defined for the action. +// the S3 bucket used to store artifacts for the pipeline, if the action requires +// access to that S3 bucket for input or output artifacts. This API also 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 @@ -968,11 +968,11 @@ func (c *CodePipeline) GetJobDetailsRequest(input *GetJobDetailsInput) (req *req // See the AWS API reference guide for AWS CodePipeline's // API operation GetJobDetails for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeJobNotFoundException "JobNotFoundException" +// * JobNotFoundException // The job was specified in an invalid format or cannot be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetJobDetails @@ -1052,14 +1052,14 @@ func (c *CodePipeline) GetPipelineRequest(input *GetPipelineInput) (req *request // See the AWS API reference guide for AWS CodePipeline's // API operation GetPipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The pipeline was specified in an invalid format or cannot be found. // -// * ErrCodePipelineVersionNotFoundException "PipelineVersionNotFoundException" +// * PipelineVersionNotFoundException // The pipeline version was specified in an invalid format or cannot be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipeline @@ -1139,14 +1139,14 @@ func (c *CodePipeline) GetPipelineExecutionRequest(input *GetPipelineExecutionIn // See the AWS API reference guide for AWS CodePipeline's // API operation GetPipelineExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The pipeline was specified in an invalid format or cannot be found. // -// * ErrCodePipelineExecutionNotFoundException "PipelineExecutionNotFoundException" +// * 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. // @@ -1229,11 +1229,11 @@ func (c *CodePipeline) GetPipelineStateRequest(input *GetPipelineStateInput) (re // See the AWS API reference guide for AWS CodePipeline's // API operation GetPipelineState for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The pipeline was specified in an invalid format or cannot be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetPipelineState @@ -1306,9 +1306,9 @@ func (c *CodePipeline) GetThirdPartyJobDetailsRequest(input *GetThirdPartyJobDet // actions only. // // 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. This -// API also returns any secret values defined for the action. +// the S3 bucket used to store artifacts for the pipeline, if the action requires +// access to that S3 bucket for input or output artifacts. This API also 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 @@ -1317,17 +1317,17 @@ func (c *CodePipeline) GetThirdPartyJobDetailsRequest(input *GetThirdPartyJobDet // See the AWS API reference guide for AWS CodePipeline's // API operation GetThirdPartyJobDetails for usage and error information. // -// Returned Error Codes: -// * ErrCodeJobNotFoundException "JobNotFoundException" +// Returned Error Types: +// * JobNotFoundException // The job was specified in an invalid format or cannot be found. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeInvalidClientTokenException "InvalidClientTokenException" +// * InvalidClientTokenException // The client token was specified in an invalid format // -// * ErrCodeInvalidJobException "InvalidJobException" +// * InvalidJobException // The job was specified in an invalid format or cannot be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/GetThirdPartyJobDetails @@ -1411,18 +1411,18 @@ func (c *CodePipeline) ListActionExecutionsRequest(input *ListActionExecutionsIn // See the AWS API reference guide for AWS CodePipeline's // API operation ListActionExecutions for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The pipeline was specified in an invalid format or cannot be found. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token was specified in an invalid format. Make sure that the next // token you provide is the token returned by a previous call. // -// * ErrCodePipelineExecutionNotFoundException "PipelineExecutionNotFoundException" +// * 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. // @@ -1491,10 +1491,12 @@ func (c *CodePipeline) ListActionExecutionsPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListActionExecutionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListActionExecutionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1558,11 +1560,11 @@ func (c *CodePipeline) ListActionTypesRequest(input *ListActionTypesInput) (req // See the AWS API reference guide for AWS CodePipeline's // API operation ListActionTypes for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token was specified in an invalid format. Make sure that the next // token you provide is the token returned by a previous call. // @@ -1631,10 +1633,12 @@ func (c *CodePipeline) ListActionTypesPagesWithContext(ctx aws.Context, input *L }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListActionTypesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListActionTypesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1697,14 +1701,14 @@ func (c *CodePipeline) ListPipelineExecutionsRequest(input *ListPipelineExecutio // See the AWS API reference guide for AWS CodePipeline's // API operation ListPipelineExecutions for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The pipeline was specified in an invalid format or cannot be found. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token was specified in an invalid format. Make sure that the next // token you provide is the token returned by a previous call. // @@ -1773,10 +1777,12 @@ func (c *CodePipeline) ListPipelineExecutionsPagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPipelineExecutionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPipelineExecutionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1839,11 +1845,11 @@ func (c *CodePipeline) ListPipelinesRequest(input *ListPipelinesInput) (req *req // See the AWS API reference guide for AWS CodePipeline's // API operation ListPipelines for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token was specified in an invalid format. Make sure that the next // token you provide is the token returned by a previous call. // @@ -1912,10 +1918,12 @@ func (c *CodePipeline) ListPipelinesPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPipelinesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPipelinesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1978,18 +1986,18 @@ func (c *CodePipeline) ListTagsForResourceRequest(input *ListTagsForResourceInpu // See the AWS API reference guide for AWS CodePipeline's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource was specified in an invalid format. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token was specified in an invalid format. Make sure that the next // token you provide is the token returned by a previous call. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The specified resource ARN is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListTagsForResource @@ -2057,10 +2065,12 @@ func (c *CodePipeline) ListTagsForResourcePagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2125,11 +2135,11 @@ func (c *CodePipeline) ListWebhooksRequest(input *ListWebhooksInput) (req *reque // See the AWS API reference guide for AWS CodePipeline's // API operation ListWebhooks for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The next token was specified in an invalid format. Make sure that the next // token you provide is the token returned by a previous call. // @@ -2198,10 +2208,12 @@ func (c *CodePipeline) ListWebhooksPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListWebhooksOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListWebhooksOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2255,9 +2267,9 @@ func (c *CodePipeline) PollForJobsRequest(input *PollForJobsInput) (req *request // returns an error. // // 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. This -// API also returns any secret values defined for the action. +// the S3 bucket used to store artifacts for the pipeline, if the action requires +// access to that S3 bucket for input or output artifacts. This API also 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 @@ -2266,11 +2278,11 @@ func (c *CodePipeline) PollForJobsRequest(input *PollForJobsInput) (req *request // See the AWS API reference guide for AWS CodePipeline's // API operation PollForJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeActionTypeNotFoundException "ActionTypeNotFoundException" +// * ActionTypeNotFoundException // The specified action type cannot be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PollForJobs @@ -2343,8 +2355,8 @@ func (c *CodePipeline) PollForThirdPartyJobsRequest(input *PollForThirdPartyJobs // on. Used for partner actions only. // // 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. +// the S3 bucket used to store artifacts for the pipeline, if the action requires +// access to that 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 @@ -2353,11 +2365,11 @@ func (c *CodePipeline) PollForThirdPartyJobsRequest(input *PollForThirdPartyJobs // See the AWS API reference guide for AWS CodePipeline's // API operation PollForThirdPartyJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeActionTypeNotFoundException "ActionTypeNotFoundException" +// Returned Error Types: +// * ActionTypeNotFoundException // The specified action type cannot be found. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The validation was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PollForThirdPartyJobs @@ -2435,17 +2447,17 @@ func (c *CodePipeline) PutActionRevisionRequest(input *PutActionRevisionInput) ( // See the AWS API reference guide for AWS CodePipeline's // API operation PutActionRevision for usage and error information. // -// Returned Error Codes: -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// Returned Error Types: +// * PipelineNotFoundException // The pipeline was specified in an invalid format or cannot be found. // -// * ErrCodeStageNotFoundException "StageNotFoundException" +// * StageNotFoundException // The stage was specified in an invalid format or cannot be found. // -// * ErrCodeActionNotFoundException "ActionNotFoundException" +// * ActionNotFoundException // The specified action cannot be found. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The validation was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutActionRevision @@ -2524,23 +2536,23 @@ func (c *CodePipeline) PutApprovalResultRequest(input *PutApprovalResultInput) ( // See the AWS API reference guide for AWS CodePipeline's // API operation PutApprovalResult for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidApprovalTokenException "InvalidApprovalTokenException" +// Returned Error Types: +// * InvalidApprovalTokenException // The approval request already received a response or has expired. // -// * ErrCodeApprovalAlreadyCompletedException "ApprovalAlreadyCompletedException" +// * ApprovalAlreadyCompletedException // The approval action has already been approved or rejected. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The pipeline was specified in an invalid format or cannot be found. // -// * ErrCodeStageNotFoundException "StageNotFoundException" +// * StageNotFoundException // The stage was specified in an invalid format or cannot be found. // -// * ErrCodeActionNotFoundException "ActionNotFoundException" +// * ActionNotFoundException // The specified action cannot be found. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The validation was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutApprovalResult @@ -2620,14 +2632,14 @@ func (c *CodePipeline) PutJobFailureResultRequest(input *PutJobFailureResultInpu // See the AWS API reference guide for AWS CodePipeline's // API operation PutJobFailureResult for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeJobNotFoundException "JobNotFoundException" +// * JobNotFoundException // The job was specified in an invalid format or cannot be found. // -// * ErrCodeInvalidJobStateException "InvalidJobStateException" +// * InvalidJobStateException // The job state was specified in an invalid format. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutJobFailureResult @@ -2707,16 +2719,19 @@ func (c *CodePipeline) PutJobSuccessResultRequest(input *PutJobSuccessResultInpu // See the AWS API reference guide for AWS CodePipeline's // API operation PutJobSuccessResult for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeJobNotFoundException "JobNotFoundException" +// * JobNotFoundException // The job was specified in an invalid format or cannot be found. // -// * ErrCodeInvalidJobStateException "InvalidJobStateException" +// * InvalidJobStateException // The job state was specified in an invalid format. // +// * OutputVariablesSizeExceededException +// Exceeded the total size limit for all variables in the pipeline. +// // See also, 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) @@ -2794,17 +2809,17 @@ func (c *CodePipeline) PutThirdPartyJobFailureResultRequest(input *PutThirdParty // See the AWS API reference guide for AWS CodePipeline's // API operation PutThirdPartyJobFailureResult for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeJobNotFoundException "JobNotFoundException" +// * JobNotFoundException // The job was specified in an invalid format or cannot be found. // -// * ErrCodeInvalidJobStateException "InvalidJobStateException" +// * InvalidJobStateException // The job state was specified in an invalid format. // -// * ErrCodeInvalidClientTokenException "InvalidClientTokenException" +// * InvalidClientTokenException // The client token was specified in an invalid format // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutThirdPartyJobFailureResult @@ -2884,17 +2899,17 @@ func (c *CodePipeline) PutThirdPartyJobSuccessResultRequest(input *PutThirdParty // See the AWS API reference guide for AWS CodePipeline's // API operation PutThirdPartyJobSuccessResult for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeJobNotFoundException "JobNotFoundException" +// * JobNotFoundException // The job was specified in an invalid format or cannot be found. // -// * ErrCodeInvalidJobStateException "InvalidJobStateException" +// * InvalidJobStateException // The job state was specified in an invalid format. // -// * ErrCodeInvalidClientTokenException "InvalidClientTokenException" +// * InvalidClientTokenException // The client token was specified in an invalid format // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutThirdPartyJobSuccessResult @@ -2979,30 +2994,30 @@ func (c *CodePipeline) PutWebhookRequest(input *PutWebhookInput) (req *request.R // See the AWS API reference guide for AWS CodePipeline's // API operation PutWebhook for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The number of pipelines associated with the AWS account has exceeded the // limit allowed for the account. // -// * ErrCodeInvalidWebhookFilterPatternException "InvalidWebhookFilterPatternException" +// * InvalidWebhookFilterPatternException // The specified event filter rule is in an invalid format. // -// * ErrCodeInvalidWebhookAuthenticationParametersException "InvalidWebhookAuthenticationParametersException" +// * InvalidWebhookAuthenticationParametersException // The specified authentication type is in an invalid format. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The pipeline was specified in an invalid format or cannot be found. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // The tags limit for a resource has been exceeded. // -// * ErrCodeInvalidTagsException "InvalidTagsException" +// * InvalidTagsException // The specified resource tags are invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Unable to modify the tag due to a simultaneous update request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/PutWebhook @@ -3082,11 +3097,11 @@ func (c *CodePipeline) RegisterWebhookWithThirdPartyRequest(input *RegisterWebho // See the AWS API reference guide for AWS CodePipeline's // API operation RegisterWebhookWithThirdParty for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeWebhookNotFoundException "WebhookNotFoundException" +// * WebhookNotFoundException // The specified webhook was entered in an invalid format or cannot be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/RegisterWebhookWithThirdParty @@ -3167,21 +3182,21 @@ func (c *CodePipeline) RetryStageExecutionRequest(input *RetryStageExecutionInpu // See the AWS API reference guide for AWS CodePipeline's // API operation RetryStageExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The pipeline was specified in an invalid format or cannot be found. // -// * ErrCodeStageNotFoundException "StageNotFoundException" +// * StageNotFoundException // The stage was specified in an invalid format or cannot be found. // -// * ErrCodeStageNotRetryableException "StageNotRetryableException" +// * StageNotRetryableException // Unable to retry. The pipeline structure or stage state might have changed // while actions awaited retry, or the stage contains no failed actions. // -// * ErrCodeNotLatestPipelineExecutionException "NotLatestPipelineExecutionException" +// * NotLatestPipelineExecutionException // The stage has failed in a later run of the pipeline and the pipelineExecutionId // associated with the request is out of date. // @@ -3261,11 +3276,11 @@ func (c *CodePipeline) StartPipelineExecutionRequest(input *StartPipelineExecuti // See the AWS API reference guide for AWS CodePipeline's // API operation StartPipelineExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The pipeline was specified in an invalid format or cannot be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/StartPipelineExecution @@ -3290,6 +3305,104 @@ func (c *CodePipeline) StartPipelineExecutionWithContext(ctx aws.Context, input return out, req.Send() } +const opStopPipelineExecution = "StopPipelineExecution" + +// StopPipelineExecutionRequest generates a "aws/request.Request" representing the +// client's request for the StopPipelineExecution operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopPipelineExecution for more information on using the StopPipelineExecution +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopPipelineExecutionRequest method. +// req, resp := client.StopPipelineExecutionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/StopPipelineExecution +func (c *CodePipeline) StopPipelineExecutionRequest(input *StopPipelineExecutionInput) (req *request.Request, output *StopPipelineExecutionOutput) { + op := &request.Operation{ + Name: opStopPipelineExecution, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StopPipelineExecutionInput{} + } + + output = &StopPipelineExecutionOutput{} + req = c.newRequest(op, input, output) + return +} + +// StopPipelineExecution API operation for AWS CodePipeline. +// +// Stops the specified pipeline execution. You choose to either stop the pipeline +// execution by completing in-progress actions without starting subsequent actions, +// or by abandoning in-progress actions. While completing or abandoning in-progress +// actions, the pipeline execution is in a Stopping state. After all in-progress +// actions are completed or abandoned, the pipeline execution is in a Stopped +// 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 CodePipeline's +// API operation StopPipelineExecution for usage and error information. +// +// Returned Error Types: +// * ValidationException +// The validation was specified in an invalid format. +// +// * PipelineNotFoundException +// The pipeline was specified in an invalid format or cannot be found. +// +// * PipelineExecutionNotStoppableException +// Unable to stop the pipeline execution. The execution might already be in +// a Stopped state, or it might no longer be in progress. +// +// * DuplicatedStopRequestException +// The pipeline execution is already in a Stopping state. If you already chose +// to stop and wait, you cannot make that request again. You can choose to stop +// and abandon now, but be aware that this option can lead to failed tasks or +// out of sequence tasks. If you already chose to stop and abandon, you cannot +// make that request again. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/StopPipelineExecution +func (c *CodePipeline) StopPipelineExecution(input *StopPipelineExecutionInput) (*StopPipelineExecutionOutput, error) { + req, out := c.StopPipelineExecutionRequest(input) + return out, req.Send() +} + +// StopPipelineExecutionWithContext is the same as StopPipelineExecution with the addition of +// the ability to pass a context and additional request options. +// +// See StopPipelineExecution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodePipeline) StopPipelineExecutionWithContext(ctx aws.Context, input *StopPipelineExecutionInput, opts ...request.Option) (*StopPipelineExecutionOutput, error) { + req, out := c.StopPipelineExecutionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opTagResource = "TagResource" // TagResourceRequest generates a "aws/request.Request" representing the @@ -3345,23 +3458,23 @@ func (c *CodePipeline) TagResourceRequest(input *TagResourceInput) (req *request // See the AWS API reference guide for AWS CodePipeline's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource was specified in an invalid format. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The specified resource ARN is invalid. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // The tags limit for a resource has been exceeded. // -// * ErrCodeInvalidTagsException "InvalidTagsException" +// * InvalidTagsException // The specified resource tags are invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Unable to modify the tag due to a simultaneous update request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/TagResource @@ -3440,20 +3553,20 @@ func (c *CodePipeline) UntagResourceRequest(input *UntagResourceInput) (req *req // See the AWS API reference guide for AWS CodePipeline's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource was specified in an invalid format. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The specified resource ARN is invalid. // -// * ErrCodeInvalidTagsException "InvalidTagsException" +// * InvalidTagsException // The specified resource tags are invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Unable to modify the tag due to a simultaneous update request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/UntagResource @@ -3534,23 +3647,23 @@ func (c *CodePipeline) UpdatePipelineRequest(input *UpdatePipelineInput) (req *r // See the AWS API reference guide for AWS CodePipeline's // API operation UpdatePipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The validation was specified in an invalid format. // -// * ErrCodeInvalidStageDeclarationException "InvalidStageDeclarationException" +// * InvalidStageDeclarationException // The stage declaration was specified in an invalid format. // -// * ErrCodeInvalidActionDeclarationException "InvalidActionDeclarationException" +// * InvalidActionDeclarationException // The action declaration was specified in an invalid format. // -// * ErrCodeInvalidBlockerDeclarationException "InvalidBlockerDeclarationException" +// * InvalidBlockerDeclarationException // Reserved for future use. // -// * ErrCodeInvalidStructureException "InvalidStructureException" +// * InvalidStructureException // The structure was specified in an invalid format. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The number of pipelines associated with the AWS account has exceeded the // limit allowed for the account. // @@ -3578,8 +3691,8 @@ func (c *CodePipeline) UpdatePipelineWithContext(ctx aws.Context, input *UpdateP // 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. +// used to access input and output artifacts in the S3 bucket used to store +// artifact for the pipeline in AWS CodePipeline. type AWSSessionCredentials struct { _ struct{} `type:"structure" sensitive:"true"` @@ -4032,6 +4145,10 @@ type ActionDeclaration struct { // Name is a required field Name *string `locationName:"name" min:"1" type:"string" required:"true"` + // The variable namespace associated with the action. All variables produced + // as output by this action fall under this namespace. + Namespace *string `locationName:"namespace" min:"1" type:"string"` + // The name or ID of the result of the action declaration, such as a test or // build artifact. OutputArtifacts []*OutputArtifact `locationName:"outputArtifacts" type:"list"` @@ -4069,6 +4186,9 @@ func (s *ActionDeclaration) Validate() error { if s.Name != nil && len(*s.Name) < 1 { invalidParams.Add(request.NewErrParamMinLen("Name", 1)) } + if s.Namespace != nil && len(*s.Namespace) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + } if s.Region != nil && len(*s.Region) < 4 { invalidParams.Add(request.NewErrParamMinLen("Region", 4)) } @@ -4131,6 +4251,12 @@ func (s *ActionDeclaration) SetName(v string) *ActionDeclaration { return s } +// SetNamespace sets the Namespace field's value. +func (s *ActionDeclaration) SetNamespace(v string) *ActionDeclaration { + s.Namespace = &v + return s +} + // SetOutputArtifacts sets the OutputArtifacts field's value. func (s *ActionDeclaration) SetOutputArtifacts(v []*OutputArtifact) *ActionDeclaration { s.OutputArtifacts = v @@ -4401,9 +4527,17 @@ type ActionExecutionInput struct { // Details of input artifacts of the action that correspond to the action execution. InputArtifacts []*ArtifactDetail `locationName:"inputArtifacts" type:"list"` + // The variable namespace associated with the action. All variables produced + // as output by this action fall under this namespace. + Namespace *string `locationName:"namespace" min:"1" type:"string"` + // The AWS Region for the action, such as us-east-1. Region *string `locationName:"region" min:"4" type:"string"` + // Configuration data for an action execution with all variable references replaced + // with their real values for the execution. + ResolvedConfiguration map[string]*string `locationName:"resolvedConfiguration" type:"map"` + // The ARN of the IAM service role that performs the declared action. This is // assumed through the roleArn for the pipeline. RoleArn *string `locationName:"roleArn" type:"string"` @@ -4437,12 +4571,24 @@ func (s *ActionExecutionInput) SetInputArtifacts(v []*ArtifactDetail) *ActionExe return s } +// SetNamespace sets the Namespace field's value. +func (s *ActionExecutionInput) SetNamespace(v string) *ActionExecutionInput { + s.Namespace = &v + return s +} + // SetRegion sets the Region field's value. func (s *ActionExecutionInput) SetRegion(v string) *ActionExecutionInput { s.Region = &v return s } +// SetResolvedConfiguration sets the ResolvedConfiguration field's value. +func (s *ActionExecutionInput) SetResolvedConfiguration(v map[string]*string) *ActionExecutionInput { + s.ResolvedConfiguration = v + return s +} + // SetRoleArn sets the RoleArn field's value. func (s *ActionExecutionInput) SetRoleArn(v string) *ActionExecutionInput { s.RoleArn = &v @@ -4459,6 +4605,10 @@ type ActionExecutionOutput struct { // Details of output artifacts of the action that correspond to the action execution. OutputArtifacts []*ArtifactDetail `locationName:"outputArtifacts" type:"list"` + + // The outputVariables field shows the key-value pairs that were output as part + // of that execution. + OutputVariables map[string]*string `locationName:"outputVariables" type:"map"` } // String returns the string representation @@ -4483,6 +4633,12 @@ func (s *ActionExecutionOutput) SetOutputArtifacts(v []*ArtifactDetail) *ActionE return s } +// SetOutputVariables sets the OutputVariables field's value. +func (s *ActionExecutionOutput) SetOutputVariables(v map[string]*string) *ActionExecutionOutput { + s.OutputVariables = v + return s +} + // Execution result information, such as the external execution ID. type ActionExecutionResult struct { _ struct{} `type:"structure"` @@ -4526,6 +4682,62 @@ func (s *ActionExecutionResult) SetExternalExecutionUrl(v string) *ActionExecuti return s } +// The specified action cannot be found. +type ActionNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ActionNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ActionNotFoundException) GoString() string { + return s.String() +} + +func newErrorActionNotFoundException(v protocol.ResponseMetadata) error { + return &ActionNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ActionNotFoundException) Code() string { + return "ActionNotFoundException" +} + +// Message returns the exception's message. +func (s ActionNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ActionNotFoundException) OrigErr() error { + return nil +} + +func (s ActionNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ActionNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ActionNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents information about the version (or revision) of an action. type ActionRevision struct { _ struct{} `type:"structure"` @@ -4823,6 +5035,62 @@ func (s *ActionTypeId) SetVersion(v string) *ActionTypeId { return s } +// The specified action type cannot be found. +type ActionTypeNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ActionTypeNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ActionTypeNotFoundException) GoString() string { + return s.String() +} + +func newErrorActionTypeNotFoundException(v protocol.ResponseMetadata) error { + return &ActionTypeNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ActionTypeNotFoundException) Code() string { + return "ActionTypeNotFoundException" +} + +// Message returns the exception's message. +func (s ActionTypeNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ActionTypeNotFoundException) OrigErr() error { + return nil +} + +func (s ActionTypeNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ActionTypeNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ActionTypeNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Returns information about the settings for an action type. type ActionTypeSettings struct { _ struct{} `type:"structure"` @@ -4906,6 +5174,62 @@ func (s *ActionTypeSettings) SetThirdPartyConfigurationUrl(v string) *ActionType return s } +// The approval action has already been approved or rejected. +type ApprovalAlreadyCompletedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ApprovalAlreadyCompletedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApprovalAlreadyCompletedException) GoString() string { + return s.String() +} + +func newErrorApprovalAlreadyCompletedException(v protocol.ResponseMetadata) error { + return &ApprovalAlreadyCompletedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ApprovalAlreadyCompletedException) Code() string { + return "ApprovalAlreadyCompletedException" +} + +// Message returns the exception's message. +func (s ApprovalAlreadyCompletedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ApprovalAlreadyCompletedException) OrigErr() error { + return nil +} + +func (s ApprovalAlreadyCompletedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ApprovalAlreadyCompletedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ApprovalAlreadyCompletedException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents information about the result of an approval request. type ApprovalResult struct { _ struct{} `type:"structure"` @@ -5093,7 +5417,7 @@ func (s *ArtifactDetails) SetMinimumCount(v int64) *ArtifactDetails { type ArtifactLocation struct { _ struct{} `type:"structure"` - // The Amazon S3 bucket that contains the artifact. + // The S3 bucket that contains the artifact. S3Location *S3ArtifactLocation `locationName:"s3Location" type:"structure"` // The type of artifact in the location. @@ -5199,7 +5523,7 @@ func (s *ArtifactRevision) SetRevisionUrl(v string) *ArtifactRevision { return s } -// The Amazon S3 bucket where artifacts for the pipeline are stored. +// The S3 bucket where artifacts for the pipeline are stored. // // You must include either artifactStore or artifactStores in your pipeline, // but you cannot use both. If you create a cross-region action in your pipeline, @@ -5212,11 +5536,11 @@ type ArtifactStore struct { // key for Amazon S3 is used. EncryptionKey *EncryptionKey `locationName:"encryptionKey" type:"structure"` - // The Amazon S3 bucket used for storing the artifacts for a pipeline. You can - // specify the name of an S3 bucket but not a folder in the bucket. A folder - // to contain the pipeline artifacts is created for you based on the name of - // the pipeline. You can use any Amazon S3 bucket in the same AWS Region as - // the pipeline to store your pipeline artifacts. + // The S3 bucket used for storing the artifacts for a pipeline. You can specify + // the name of an S3 bucket but not a folder in the bucket. A folder to contain + // the pipeline artifacts is created for you based on the name of the pipeline. + // You can use any S3 bucket in the same AWS Region as the pipeline to store + // your pipeline artifacts. // // Location is a required field Location *string `locationName:"location" min:"3" type:"string" required:"true"` @@ -5335,6 +5659,62 @@ func (s *BlockerDeclaration) SetType(v string) *BlockerDeclaration { return s } +// Unable to modify the tag due to a simultaneous update request. +type ConcurrentModificationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" min:"1" type:"string"` +} + +// String returns the string representation +func (s ConcurrentModificationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentModificationException) GoString() string { + return s.String() +} + +func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { + return &ConcurrentModificationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentModificationException) Code() string { + return "ConcurrentModificationException" +} + +// Message returns the exception's message. +func (s ConcurrentModificationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentModificationException) OrigErr() error { + return nil +} + +func (s ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentModificationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentModificationException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents the input of a CreateCustomActionType operation. type CreateCustomActionTypeInput struct { _ struct{} `type:"structure"` @@ -6079,6 +6459,66 @@ func (s DisableStageTransitionOutput) GoString() string { return s.String() } +// The pipeline execution is already in a Stopping state. If you already chose +// to stop and wait, you cannot make that request again. You can choose to stop +// and abandon now, but be aware that this option can lead to failed tasks or +// out of sequence tasks. If you already chose to stop and abandon, you cannot +// make that request again. +type DuplicatedStopRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" min:"1" type:"string"` +} + +// String returns the string representation +func (s DuplicatedStopRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DuplicatedStopRequestException) GoString() string { + return s.String() +} + +func newErrorDuplicatedStopRequestException(v protocol.ResponseMetadata) error { + return &DuplicatedStopRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DuplicatedStopRequestException) Code() string { + return "DuplicatedStopRequestException" +} + +// Message returns the exception's message. +func (s DuplicatedStopRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DuplicatedStopRequestException) OrigErr() error { + return nil +} + +func (s DuplicatedStopRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DuplicatedStopRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DuplicatedStopRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents the input of an EnableStageTransition action. type EnableStageTransitionInput struct { _ struct{} `type:"structure"` @@ -6905,44 +7345,829 @@ func (s *InputArtifact) SetName(v string) *InputArtifact { return s } -// Represents information about a 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"` - - // Other data about a job. - Data *JobData `locationName:"data" type:"structure"` - - // The unique system-generated ID of the job. - Id *string `locationName:"id" type:"string"` +// The action declaration was specified in an invalid format. +type InvalidActionDeclarationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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" min:"1" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s Job) String() string { +func (s InvalidActionDeclarationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Job) GoString() string { +func (s InvalidActionDeclarationException) GoString() string { return s.String() } -// SetAccountId sets the AccountId field's value. -func (s *Job) SetAccountId(v string) *Job { - s.AccountId = &v - return s +func newErrorInvalidActionDeclarationException(v protocol.ResponseMetadata) error { + return &InvalidActionDeclarationException{ + respMetadata: v, + } } -// SetData sets the Data field's value. -func (s *Job) SetData(v *JobData) *Job { - s.Data = v +// Code returns the exception type name. +func (s InvalidActionDeclarationException) Code() string { + return "InvalidActionDeclarationException" +} + +// Message returns the exception's message. +func (s InvalidActionDeclarationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidActionDeclarationException) OrigErr() error { + return nil +} + +func (s InvalidActionDeclarationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidActionDeclarationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidActionDeclarationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The approval request already received a response or has expired. +type InvalidApprovalTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidApprovalTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidApprovalTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidApprovalTokenException(v protocol.ResponseMetadata) error { + return &InvalidApprovalTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidApprovalTokenException) Code() string { + return "InvalidApprovalTokenException" +} + +// Message returns the exception's message. +func (s InvalidApprovalTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidApprovalTokenException) OrigErr() error { + return nil +} + +func (s InvalidApprovalTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidApprovalTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidApprovalTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource ARN is invalid. +type InvalidArnException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" min:"1" type:"string"` +} + +// String returns the string representation +func (s InvalidArnException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidArnException) GoString() string { + return s.String() +} + +func newErrorInvalidArnException(v protocol.ResponseMetadata) error { + return &InvalidArnException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidArnException) Code() string { + return "InvalidArnException" +} + +// Message returns the exception's message. +func (s InvalidArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidArnException) OrigErr() error { + return nil +} + +func (s InvalidArnException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidArnException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidArnException) RequestID() string { + return s.respMetadata.RequestID +} + +// Reserved for future use. +type InvalidBlockerDeclarationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidBlockerDeclarationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidBlockerDeclarationException) GoString() string { + return s.String() +} + +func newErrorInvalidBlockerDeclarationException(v protocol.ResponseMetadata) error { + return &InvalidBlockerDeclarationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidBlockerDeclarationException) Code() string { + return "InvalidBlockerDeclarationException" +} + +// Message returns the exception's message. +func (s InvalidBlockerDeclarationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidBlockerDeclarationException) OrigErr() error { + return nil +} + +func (s InvalidBlockerDeclarationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidBlockerDeclarationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidBlockerDeclarationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The client token was specified in an invalid format +type InvalidClientTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidClientTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidClientTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidClientTokenException(v protocol.ResponseMetadata) error { + return &InvalidClientTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidClientTokenException) Code() string { + return "InvalidClientTokenException" +} + +// Message returns the exception's message. +func (s InvalidClientTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidClientTokenException) OrigErr() error { + return nil +} + +func (s InvalidClientTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidClientTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidClientTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// The job was specified in an invalid format or cannot be found. +type InvalidJobException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidJobException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidJobException) GoString() string { + return s.String() +} + +func newErrorInvalidJobException(v protocol.ResponseMetadata) error { + return &InvalidJobException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidJobException) Code() string { + return "InvalidJobException" +} + +// Message returns the exception's message. +func (s InvalidJobException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidJobException) OrigErr() error { + return nil +} + +func (s InvalidJobException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidJobException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidJobException) RequestID() string { + return s.respMetadata.RequestID +} + +// The job state was specified in an invalid format. +type InvalidJobStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidJobStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidJobStateException) GoString() string { + return s.String() +} + +func newErrorInvalidJobStateException(v protocol.ResponseMetadata) error { + return &InvalidJobStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidJobStateException) Code() string { + return "InvalidJobStateException" +} + +// Message returns the exception's message. +func (s InvalidJobStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidJobStateException) OrigErr() error { + return nil +} + +func (s InvalidJobStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidJobStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidJobStateException) RequestID() string { + return s.respMetadata.RequestID +} + +// The next token was specified in an invalid format. Make sure that the next +// token you provide is the token returned by a previous call. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNextTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// The nonce was specified in an invalid format. +type InvalidNonceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidNonceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNonceException) GoString() string { + return s.String() +} + +func newErrorInvalidNonceException(v protocol.ResponseMetadata) error { + return &InvalidNonceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNonceException) Code() string { + return "InvalidNonceException" +} + +// Message returns the exception's message. +func (s InvalidNonceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNonceException) OrigErr() error { + return nil +} + +func (s InvalidNonceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNonceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNonceException) RequestID() string { + return s.respMetadata.RequestID +} + +// The stage declaration was specified in an invalid format. +type InvalidStageDeclarationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidStageDeclarationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidStageDeclarationException) GoString() string { + return s.String() +} + +func newErrorInvalidStageDeclarationException(v protocol.ResponseMetadata) error { + return &InvalidStageDeclarationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidStageDeclarationException) Code() string { + return "InvalidStageDeclarationException" +} + +// Message returns the exception's message. +func (s InvalidStageDeclarationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidStageDeclarationException) OrigErr() error { + return nil +} + +func (s InvalidStageDeclarationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidStageDeclarationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidStageDeclarationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The structure was specified in an invalid format. +type InvalidStructureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidStructureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidStructureException) GoString() string { + return s.String() +} + +func newErrorInvalidStructureException(v protocol.ResponseMetadata) error { + return &InvalidStructureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidStructureException) Code() string { + return "InvalidStructureException" +} + +// Message returns the exception's message. +func (s InvalidStructureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidStructureException) OrigErr() error { + return nil +} + +func (s InvalidStructureException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidStructureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidStructureException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource tags are invalid. +type InvalidTagsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" min:"1" type:"string"` +} + +// String returns the string representation +func (s InvalidTagsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidTagsException) GoString() string { + return s.String() +} + +func newErrorInvalidTagsException(v protocol.ResponseMetadata) error { + return &InvalidTagsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidTagsException) Code() string { + return "InvalidTagsException" +} + +// Message returns the exception's message. +func (s InvalidTagsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTagsException) OrigErr() error { + return nil +} + +func (s InvalidTagsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTagsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidTagsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified authentication type is in an invalid format. +type InvalidWebhookAuthenticationParametersException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidWebhookAuthenticationParametersException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidWebhookAuthenticationParametersException) GoString() string { + return s.String() +} + +func newErrorInvalidWebhookAuthenticationParametersException(v protocol.ResponseMetadata) error { + return &InvalidWebhookAuthenticationParametersException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidWebhookAuthenticationParametersException) Code() string { + return "InvalidWebhookAuthenticationParametersException" +} + +// Message returns the exception's message. +func (s InvalidWebhookAuthenticationParametersException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidWebhookAuthenticationParametersException) OrigErr() error { + return nil +} + +func (s InvalidWebhookAuthenticationParametersException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidWebhookAuthenticationParametersException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidWebhookAuthenticationParametersException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified event filter rule is in an invalid format. +type InvalidWebhookFilterPatternException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidWebhookFilterPatternException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidWebhookFilterPatternException) GoString() string { + return s.String() +} + +func newErrorInvalidWebhookFilterPatternException(v protocol.ResponseMetadata) error { + return &InvalidWebhookFilterPatternException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidWebhookFilterPatternException) Code() string { + return "InvalidWebhookFilterPatternException" +} + +// Message returns the exception's message. +func (s InvalidWebhookFilterPatternException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidWebhookFilterPatternException) OrigErr() error { + return nil +} + +func (s InvalidWebhookFilterPatternException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidWebhookFilterPatternException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidWebhookFilterPatternException) RequestID() string { + return s.respMetadata.RequestID +} + +// Represents information about a 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"` + + // Other 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" min:"1" 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 } @@ -6971,8 +8196,8 @@ type JobData struct { // 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 artifacts for the pipeline in AWS CodePipeline. + // used to access input and output artifacts in the S3 bucket used to store + // artifacts for the pipeline in AWS CodePipeline. ArtifactCredentials *AWSSessionCredentials `locationName:"artifactCredentials" type:"structure" sensitive:"true"` // A system-generated token, such as a AWS CodeDeploy deployment ID, required @@ -7084,16 +8309,129 @@ func (s *JobDetails) SetAccountId(v string) *JobDetails { return s } -// SetData sets the Data field's value. -func (s *JobDetails) SetData(v *JobData) *JobDetails { - s.Data = 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 +} + +// The job was specified in an invalid format or cannot be found. +type JobNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s JobNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s JobNotFoundException) GoString() string { + return s.String() +} + +func newErrorJobNotFoundException(v protocol.ResponseMetadata) error { + return &JobNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s JobNotFoundException) Code() string { + return "JobNotFoundException" +} + +// Message returns the exception's message. +func (s JobNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s JobNotFoundException) OrigErr() error { + return nil +} + +func (s JobNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s JobNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s JobNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The number of pipelines associated with the AWS account has exceeded the +// limit allowed for the account. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetId sets the Id field's value. -func (s *JobDetails) SetId(v string) *JobDetails { - s.Id = &v - return s +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID } type ListActionExecutionsInput struct { @@ -7745,6 +9083,63 @@ func (s *ListWebhooksOutput) SetWebhooks(v []*ListWebhookItem) *ListWebhooksOutp return s } +// The stage has failed in a later run of the pipeline and the pipelineExecutionId +// associated with the request is out of date. +type NotLatestPipelineExecutionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotLatestPipelineExecutionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotLatestPipelineExecutionException) GoString() string { + return s.String() +} + +func newErrorNotLatestPipelineExecutionException(v protocol.ResponseMetadata) error { + return &NotLatestPipelineExecutionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotLatestPipelineExecutionException) Code() string { + return "NotLatestPipelineExecutionException" +} + +// Message returns the exception's message. +func (s NotLatestPipelineExecutionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotLatestPipelineExecutionException) OrigErr() error { + return nil +} + +func (s NotLatestPipelineExecutionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotLatestPipelineExecutionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotLatestPipelineExecutionException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents information about the output of an action. type OutputArtifact struct { _ struct{} `type:"structure"` @@ -7795,6 +9190,62 @@ func (s *OutputArtifact) SetName(v string) *OutputArtifact { return s } +// Exceeded the total size limit for all variables in the pipeline. +type OutputVariablesSizeExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" min:"1" type:"string"` +} + +// String returns the string representation +func (s OutputVariablesSizeExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OutputVariablesSizeExceededException) GoString() string { + return s.String() +} + +func newErrorOutputVariablesSizeExceededException(v protocol.ResponseMetadata) error { + return &OutputVariablesSizeExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OutputVariablesSizeExceededException) Code() string { + return "OutputVariablesSizeExceededException" +} + +// Message returns the exception's message. +func (s OutputVariablesSizeExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OutputVariablesSizeExceededException) OrigErr() error { + return nil +} + +func (s OutputVariablesSizeExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OutputVariablesSizeExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OutputVariablesSizeExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents information about a pipeline to a job worker. // // PipelineContext contains pipelineArn and pipelineExecutionId for custom action @@ -7864,8 +9315,8 @@ func (s *PipelineContext) SetStage(v *StageContext) *PipelineContext { type PipelineDeclaration struct { _ struct{} `type:"structure"` - // Represents information about the Amazon S3 bucket where artifacts are stored - // for the pipeline. + // Represents information about the S3 bucket where artifacts are stored for + // the pipeline. // // You must include either artifactStore or artifactStores in your pipeline, // but you cannot use both. If you create a cross-region action in your pipeline, @@ -8009,21 +9460,30 @@ type PipelineExecution struct { // The ID of the pipeline execution. PipelineExecutionId *string `locationName:"pipelineExecutionId" type:"string"` - // The name of the pipeline that was executed. + // The name of the pipeline with the specified pipeline execution. PipelineName *string `locationName:"pipelineName" min:"1" type:"string"` - // The version number of the pipeline that was executed. + // The version number of the pipeline with the specified pipeline execution. PipelineVersion *int64 `locationName:"pipelineVersion" min:"1" type:"integer"` // The status of the pipeline execution. // // * InProgress: The pipeline execution is currently running. // + // * Stopped: The pipeline execution was manually stopped. For more information, + // see Stopped Executions (https://docs.aws.amazon.com/codepipeline/latest/userguide/concepts.html#concepts-executions-stopped). + // + // * Stopping: The pipeline execution received a request to be manually stopped. + // Depending on the selected stop mode, the execution is either completing + // or abandoning in-progress actions. For more information, see Stopped Executions + // (https://docs.aws.amazon.com/codepipeline/latest/userguide/concepts.html#concepts-executions-stopped). + // // * Succeeded: The pipeline execution was completed successfully. // // * Superseded: While this pipeline execution was waiting for the next stage // to be completed, a newer pipeline execution advanced and continued through - // the pipeline instead. + // the pipeline instead. For more information, see Superseded Executions + // (https://docs.aws.amazon.com/codepipeline/latest/userguide/concepts.html#concepts-superseded). // // * Failed: The pipeline execution was not completed successfully. Status *string `locationName:"status" type:"string" enum:"PipelineExecutionStatus"` @@ -8069,6 +9529,120 @@ func (s *PipelineExecution) SetStatus(v string) *PipelineExecution { return s } +// The pipeline execution was specified in an invalid format or cannot be found, +// or an execution ID does not belong to the specified pipeline. +type PipelineExecutionNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PipelineExecutionNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PipelineExecutionNotFoundException) GoString() string { + return s.String() +} + +func newErrorPipelineExecutionNotFoundException(v protocol.ResponseMetadata) error { + return &PipelineExecutionNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PipelineExecutionNotFoundException) Code() string { + return "PipelineExecutionNotFoundException" +} + +// Message returns the exception's message. +func (s PipelineExecutionNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PipelineExecutionNotFoundException) OrigErr() error { + return nil +} + +func (s PipelineExecutionNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PipelineExecutionNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PipelineExecutionNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Unable to stop the pipeline execution. The execution might already be in +// a Stopped state, or it might no longer be in progress. +type PipelineExecutionNotStoppableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" min:"1" type:"string"` +} + +// String returns the string representation +func (s PipelineExecutionNotStoppableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PipelineExecutionNotStoppableException) GoString() string { + return s.String() +} + +func newErrorPipelineExecutionNotStoppableException(v protocol.ResponseMetadata) error { + return &PipelineExecutionNotStoppableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PipelineExecutionNotStoppableException) Code() string { + return "PipelineExecutionNotStoppableException" +} + +// Message returns the exception's message. +func (s PipelineExecutionNotStoppableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PipelineExecutionNotStoppableException) OrigErr() error { + return nil +} + +func (s PipelineExecutionNotStoppableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PipelineExecutionNotStoppableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PipelineExecutionNotStoppableException) RequestID() string { + return s.respMetadata.RequestID +} + // Summary information about a pipeline execution. type PipelineExecutionSummary struct { _ struct{} `type:"structure"` @@ -8090,15 +9664,27 @@ type PipelineExecutionSummary struct { // // * InProgress: The pipeline execution is currently running. // + // * Stopped: The pipeline execution was manually stopped. For more information, + // see Stopped Executions (https://docs.aws.amazon.com/codepipeline/latest/userguide/concepts.html#concepts-executions-stopped). + // + // * Stopping: The pipeline execution received a request to be manually stopped. + // Depending on the selected stop mode, the execution is either completing + // or abandoning in-progress actions. For more information, see Stopped Executions + // (https://docs.aws.amazon.com/codepipeline/latest/userguide/concepts.html#concepts-executions-stopped). + // // * Succeeded: The pipeline execution was completed successfully. // // * Superseded: While this pipeline execution was waiting for the next stage // to be completed, a newer pipeline execution advanced and continued through - // the pipeline instead. + // the pipeline instead. For more information, see Superseded Executions + // (https://docs.aws.amazon.com/codepipeline/latest/userguide/concepts.html#concepts-superseded). // // * Failed: The pipeline execution was not completed successfully. Status *string `locationName:"status" type:"string" enum:"PipelineExecutionStatus"` + // The interaction that stopped a pipeline execution. + StopTrigger *StopExecutionTrigger `locationName:"stopTrigger" type:"structure"` + // The interaction or event that started a pipeline execution, such as automated // change detection or a StartPipelineExecution API call. Trigger *ExecutionTrigger `locationName:"trigger" type:"structure"` @@ -8144,6 +9730,12 @@ func (s *PipelineExecutionSummary) SetStatus(v string) *PipelineExecutionSummary return s } +// SetStopTrigger sets the StopTrigger field's value. +func (s *PipelineExecutionSummary) SetStopTrigger(v *StopExecutionTrigger) *PipelineExecutionSummary { + s.StopTrigger = v + return s +} + // SetTrigger sets the Trigger field's value. func (s *PipelineExecutionSummary) SetTrigger(v *ExecutionTrigger) *PipelineExecutionSummary { s.Trigger = v @@ -8192,6 +9784,118 @@ func (s *PipelineMetadata) SetUpdated(v time.Time) *PipelineMetadata { return s } +// The specified pipeline name is already in use. +type PipelineNameInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PipelineNameInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PipelineNameInUseException) GoString() string { + return s.String() +} + +func newErrorPipelineNameInUseException(v protocol.ResponseMetadata) error { + return &PipelineNameInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PipelineNameInUseException) Code() string { + return "PipelineNameInUseException" +} + +// Message returns the exception's message. +func (s PipelineNameInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PipelineNameInUseException) OrigErr() error { + return nil +} + +func (s PipelineNameInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PipelineNameInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PipelineNameInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The pipeline was specified in an invalid format or cannot be found. +type PipelineNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PipelineNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PipelineNotFoundException) GoString() string { + return s.String() +} + +func newErrorPipelineNotFoundException(v protocol.ResponseMetadata) error { + return &PipelineNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PipelineNotFoundException) Code() string { + return "PipelineNotFoundException" +} + +// Message returns the exception's message. +func (s PipelineNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PipelineNotFoundException) OrigErr() error { + return nil +} + +func (s PipelineNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PipelineNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PipelineNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Returns a summary of a pipeline. type PipelineSummary struct { _ struct{} `type:"structure"` @@ -8243,6 +9947,62 @@ func (s *PipelineSummary) SetVersion(v int64) *PipelineSummary { return s } +// The pipeline version was specified in an invalid format or cannot be found. +type PipelineVersionNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PipelineVersionNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PipelineVersionNotFoundException) GoString() string { + return s.String() +} + +func newErrorPipelineVersionNotFoundException(v protocol.ResponseMetadata) error { + return &PipelineVersionNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PipelineVersionNotFoundException) Code() string { + return "PipelineVersionNotFoundException" +} + +// Message returns the exception's message. +func (s PipelineVersionNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PipelineVersionNotFoundException) OrigErr() error { + return nil +} + +func (s PipelineVersionNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PipelineVersionNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PipelineVersionNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents the input of a PollForJobs action. type PollForJobsInput struct { _ struct{} `type:"structure"` @@ -8777,6 +10537,11 @@ type PutJobSuccessResultInput struct { // // JobId is a required field JobId *string `locationName:"jobId" type:"string" required:"true"` + + // Key-value pairs produced as output by a job worker that can be made available + // to a downstream action configuration. outputVariables can be included only + // when there is no continuation token on the request. + OutputVariables map[string]*string `locationName:"outputVariables" type:"map"` } // String returns the string representation @@ -8839,6 +10604,12 @@ func (s *PutJobSuccessResultInput) SetJobId(v string) *PutJobSuccessResultInput return s } +// SetOutputVariables sets the OutputVariables field's value. +func (s *PutJobSuccessResultInput) SetOutputVariables(v map[string]*string) *PutJobSuccessResultInput { + s.OutputVariables = v + return s +} + type PutJobSuccessResultOutput struct { _ struct{} `type:"structure"` } @@ -9181,30 +10952,86 @@ func (s *RegisterWebhookWithThirdPartyInput) Validate() error { invalidParams.Add(request.NewErrParamMinLen("WebhookName", 1)) } - if invalidParams.Len() > 0 { - return invalidParams + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetWebhookName sets the WebhookName field's value. +func (s *RegisterWebhookWithThirdPartyInput) SetWebhookName(v string) *RegisterWebhookWithThirdPartyInput { + s.WebhookName = &v + return s +} + +type RegisterWebhookWithThirdPartyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RegisterWebhookWithThirdPartyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterWebhookWithThirdPartyOutput) GoString() string { + return s.String() +} + +// The resource was specified in an invalid format. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetWebhookName sets the WebhookName field's value. -func (s *RegisterWebhookWithThirdPartyInput) SetWebhookName(v string) *RegisterWebhookWithThirdPartyInput { - s.WebhookName = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil } -type RegisterWebhookWithThirdPartyOutput struct { - _ struct{} `type:"structure"` +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// String returns the string representation -func (s RegisterWebhookWithThirdPartyOutput) String() string { - return awsutil.Prettify(s) +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode } -// GoString returns the string representation -func (s RegisterWebhookWithThirdPartyOutput) GoString() string { - return s.String() +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID } // Represents the input of a RetryStageExecution action. @@ -9320,17 +11147,17 @@ func (s *RetryStageExecutionOutput) SetPipelineExecutionId(v string) *RetryStage return s } -// The location of the Amazon S3 bucket that contains a revision. +// The location of the S3 bucket that contains a revision. type S3ArtifactLocation struct { _ struct{} `type:"structure"` - // The name of the Amazon S3 bucket. + // The name of the 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. + // The key of the object in the S3 bucket, which uniquely identifies the object + // in the bucket. // // ObjectKey is a required field ObjectKey *string `locationName:"objectKey" type:"string" required:"true"` @@ -9598,6 +11425,119 @@ func (s *StageExecution) SetStatus(v string) *StageExecution { return s } +// The stage was specified in an invalid format or cannot be found. +type StageNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s StageNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StageNotFoundException) GoString() string { + return s.String() +} + +func newErrorStageNotFoundException(v protocol.ResponseMetadata) error { + return &StageNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s StageNotFoundException) Code() string { + return "StageNotFoundException" +} + +// Message returns the exception's message. +func (s StageNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s StageNotFoundException) OrigErr() error { + return nil +} + +func (s StageNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s StageNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s StageNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Unable to retry. The pipeline structure or stage state might have changed +// while actions awaited retry, or the stage contains no failed actions. +type StageNotRetryableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s StageNotRetryableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StageNotRetryableException) GoString() string { + return s.String() +} + +func newErrorStageNotRetryableException(v protocol.ResponseMetadata) error { + return &StageNotRetryableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s StageNotRetryableException) Code() string { + return "StageNotRetryableException" +} + +// Message returns the exception's message. +func (s StageNotRetryableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s StageNotRetryableException) OrigErr() error { + return nil +} + +func (s StageNotRetryableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s StageNotRetryableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s StageNotRetryableException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents information about the state of the stage. type StageState struct { _ struct{} `type:"structure"` @@ -9728,6 +11668,130 @@ func (s *StartPipelineExecutionOutput) SetPipelineExecutionId(v string) *StartPi return s } +// The interaction that stopped a pipeline execution. +type StopExecutionTrigger struct { + _ struct{} `type:"structure"` + + // The user-specified reason the pipeline was stopped. + Reason *string `locationName:"reason" type:"string"` +} + +// String returns the string representation +func (s StopExecutionTrigger) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopExecutionTrigger) GoString() string { + return s.String() +} + +// SetReason sets the Reason field's value. +func (s *StopExecutionTrigger) SetReason(v string) *StopExecutionTrigger { + s.Reason = &v + return s +} + +type StopPipelineExecutionInput struct { + _ struct{} `type:"structure"` + + // Use this option to stop the pipeline execution by abandoning, rather than + // finishing, in-progress actions. + // + // This option can lead to failed or out-of-sequence tasks. + Abandon *bool `locationName:"abandon" type:"boolean"` + + // The ID of the pipeline execution to be stopped in the current stage. Use + // the GetPipelineState action to retrieve the current pipelineExecutionId. + // + // PipelineExecutionId is a required field + PipelineExecutionId *string `locationName:"pipelineExecutionId" type:"string" required:"true"` + + // The name of the pipeline to stop. + // + // PipelineName is a required field + PipelineName *string `locationName:"pipelineName" min:"1" type:"string" required:"true"` + + // Use this option to enter comments, such as the reason the pipeline was stopped. + Reason *string `locationName:"reason" type:"string"` +} + +// String returns the string representation +func (s StopPipelineExecutionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopPipelineExecutionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StopPipelineExecutionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopPipelineExecutionInput"} + 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 +} + +// SetAbandon sets the Abandon field's value. +func (s *StopPipelineExecutionInput) SetAbandon(v bool) *StopPipelineExecutionInput { + s.Abandon = &v + return s +} + +// SetPipelineExecutionId sets the PipelineExecutionId field's value. +func (s *StopPipelineExecutionInput) SetPipelineExecutionId(v string) *StopPipelineExecutionInput { + s.PipelineExecutionId = &v + return s +} + +// SetPipelineName sets the PipelineName field's value. +func (s *StopPipelineExecutionInput) SetPipelineName(v string) *StopPipelineExecutionInput { + s.PipelineName = &v + return s +} + +// SetReason sets the Reason field's value. +func (s *StopPipelineExecutionInput) SetReason(v string) *StopPipelineExecutionInput { + s.Reason = &v + return s +} + +type StopPipelineExecutionOutput struct { + _ struct{} `type:"structure"` + + // The unique system-generated ID of the pipeline execution that was stopped. + PipelineExecutionId *string `locationName:"pipelineExecutionId" type:"string"` +} + +// String returns the string representation +func (s StopPipelineExecutionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopPipelineExecutionOutput) GoString() string { + return s.String() +} + +// SetPipelineExecutionId sets the PipelineExecutionId field's value. +func (s *StopPipelineExecutionOutput) SetPipelineExecutionId(v string) *StopPipelineExecutionOutput { + s.PipelineExecutionId = &v + return s +} + // A tag is a key-value pair that is used to manage the resource. type Tag struct { _ struct{} `type:"structure"` @@ -9907,8 +11971,8 @@ type ThirdPartyJobData struct { // 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. + // used to access input and output artifacts in the S3 bucket used to store + // artifact for the pipeline in AWS CodePipeline. ArtifactCredentials *AWSSessionCredentials `locationName:"artifactCredentials" type:"structure" sensitive:"true"` // A system-generated token, such as a AWS CodeDeploy deployment ID, that a @@ -10040,6 +12104,62 @@ func (s *ThirdPartyJobDetails) SetNonce(v string) *ThirdPartyJobDetails { return s } +// The tags limit for a resource has been exceeded. +type TooManyTagsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" min:"1" type:"string"` +} + +// String returns the string representation +func (s TooManyTagsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyTagsException) GoString() string { + return s.String() +} + +func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { + return &TooManyTagsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyTagsException) Code() string { + return "TooManyTagsException" +} + +// Message returns the exception's message. +func (s TooManyTagsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTagsException) OrigErr() error { + return nil +} + +func (s TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTagsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyTagsException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents information about the state of transitions between one stage and // another stage. type TransitionState struct { @@ -10227,6 +12347,62 @@ func (s *UpdatePipelineOutput) SetPipeline(v *PipelineDeclaration) *UpdatePipeli return s } +// The validation was specified in an invalid format. +type ValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationException) GoString() string { + return s.String() +} + +func newErrorValidationException(v protocol.ResponseMetadata) error { + return &ValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ValidationException) Code() string { + return "ValidationException" +} + +// Message returns the exception's message. +func (s ValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ValidationException) OrigErr() error { + return nil +} + +func (s ValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ValidationException) RequestID() string { + return s.respMetadata.RequestID +} + // The authentication applied to incoming webhook trigger requests. type WebhookAuthConfiguration struct { _ struct{} `type:"structure"` @@ -10495,6 +12671,62 @@ func (s *WebhookFilterRule) SetMatchEquals(v string) *WebhookFilterRule { return s } +// The specified webhook was entered in an invalid format or cannot be found. +type WebhookNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WebhookNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WebhookNotFoundException) GoString() string { + return s.String() +} + +func newErrorWebhookNotFoundException(v protocol.ResponseMetadata) error { + return &WebhookNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WebhookNotFoundException) Code() string { + return "WebhookNotFoundException" +} + +// Message returns the exception's message. +func (s WebhookNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WebhookNotFoundException) OrigErr() error { + return nil +} + +func (s WebhookNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WebhookNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WebhookNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + const ( // ActionCategorySource is a ActionCategory enum value ActionCategorySource = "Source" @@ -10530,6 +12762,9 @@ const ( // ActionExecutionStatusInProgress is a ActionExecutionStatus enum value ActionExecutionStatusInProgress = "InProgress" + // ActionExecutionStatusAbandoned is a ActionExecutionStatus enum value + ActionExecutionStatusAbandoned = "Abandoned" + // ActionExecutionStatusSucceeded is a ActionExecutionStatus enum value ActionExecutionStatusSucceeded = "Succeeded" @@ -10623,6 +12858,12 @@ const ( // PipelineExecutionStatusInProgress is a PipelineExecutionStatus enum value PipelineExecutionStatusInProgress = "InProgress" + // PipelineExecutionStatusStopped is a PipelineExecutionStatus enum value + PipelineExecutionStatusStopped = "Stopped" + + // PipelineExecutionStatusStopping is a PipelineExecutionStatus enum value + PipelineExecutionStatusStopping = "Stopping" + // PipelineExecutionStatusSucceeded is a PipelineExecutionStatus enum value PipelineExecutionStatusSucceeded = "Succeeded" @@ -10640,6 +12881,12 @@ const ( // StageExecutionStatusFailed is a StageExecutionStatus enum value StageExecutionStatusFailed = "Failed" + // StageExecutionStatusStopped is a StageExecutionStatus enum value + StageExecutionStatusStopped = "Stopped" + + // StageExecutionStatusStopping is a StageExecutionStatus enum value + StageExecutionStatusStopping = "Stopping" + // StageExecutionStatusSucceeded is a StageExecutionStatus enum value StageExecutionStatusSucceeded = "Succeeded" ) diff --git a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/doc.go b/vendor/github.com/aws/aws-sdk-go/service/codepipeline/doc.go index 45d248b2b85..74a1cccc79a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codepipeline/doc.go @@ -45,6 +45,9 @@ // * StartPipelineExecution, which runs the most recent revision of an artifact // through the pipeline. // +// * StopPipelineExecution, which stops the specified pipeline execution +// from continuing through the pipeline. +// // * UpdatePipeline, which updates a pipeline with edits or changes to the // structure of the pipeline. // 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 index ebe75cea769..bae10b65317 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codepipeline/errors.go @@ -2,6 +2,10 @@ package codepipeline +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeActionNotFoundException for service response error code @@ -28,6 +32,16 @@ const ( // Unable to modify the tag due to a simultaneous update request. ErrCodeConcurrentModificationException = "ConcurrentModificationException" + // ErrCodeDuplicatedStopRequestException for service response error code + // "DuplicatedStopRequestException". + // + // The pipeline execution is already in a Stopping state. If you already chose + // to stop and wait, you cannot make that request again. You can choose to stop + // and abandon now, but be aware that this option can lead to failed tasks or + // out of sequence tasks. If you already chose to stop and abandon, you cannot + // make that request again. + ErrCodeDuplicatedStopRequestException = "DuplicatedStopRequestException" + // ErrCodeInvalidActionDeclarationException for service response error code // "InvalidActionDeclarationException". // @@ -133,6 +147,12 @@ const ( // associated with the request is out of date. ErrCodeNotLatestPipelineExecutionException = "NotLatestPipelineExecutionException" + // ErrCodeOutputVariablesSizeExceededException for service response error code + // "OutputVariablesSizeExceededException". + // + // Exceeded the total size limit for all variables in the pipeline. + ErrCodeOutputVariablesSizeExceededException = "OutputVariablesSizeExceededException" + // ErrCodePipelineExecutionNotFoundException for service response error code // "PipelineExecutionNotFoundException". // @@ -140,6 +160,13 @@ const ( // or an execution ID does not belong to the specified pipeline. ErrCodePipelineExecutionNotFoundException = "PipelineExecutionNotFoundException" + // ErrCodePipelineExecutionNotStoppableException for service response error code + // "PipelineExecutionNotStoppableException". + // + // Unable to stop the pipeline execution. The execution might already be in + // a Stopped state, or it might no longer be in progress. + ErrCodePipelineExecutionNotStoppableException = "PipelineExecutionNotStoppableException" + // ErrCodePipelineNameInUseException for service response error code // "PipelineNameInUseException". // @@ -195,3 +222,40 @@ const ( // The specified webhook was entered in an invalid format or cannot be found. ErrCodeWebhookNotFoundException = "WebhookNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ActionNotFoundException": newErrorActionNotFoundException, + "ActionTypeNotFoundException": newErrorActionTypeNotFoundException, + "ApprovalAlreadyCompletedException": newErrorApprovalAlreadyCompletedException, + "ConcurrentModificationException": newErrorConcurrentModificationException, + "DuplicatedStopRequestException": newErrorDuplicatedStopRequestException, + "InvalidActionDeclarationException": newErrorInvalidActionDeclarationException, + "InvalidApprovalTokenException": newErrorInvalidApprovalTokenException, + "InvalidArnException": newErrorInvalidArnException, + "InvalidBlockerDeclarationException": newErrorInvalidBlockerDeclarationException, + "InvalidClientTokenException": newErrorInvalidClientTokenException, + "InvalidJobException": newErrorInvalidJobException, + "InvalidJobStateException": newErrorInvalidJobStateException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "InvalidNonceException": newErrorInvalidNonceException, + "InvalidStageDeclarationException": newErrorInvalidStageDeclarationException, + "InvalidStructureException": newErrorInvalidStructureException, + "InvalidTagsException": newErrorInvalidTagsException, + "InvalidWebhookAuthenticationParametersException": newErrorInvalidWebhookAuthenticationParametersException, + "InvalidWebhookFilterPatternException": newErrorInvalidWebhookFilterPatternException, + "JobNotFoundException": newErrorJobNotFoundException, + "LimitExceededException": newErrorLimitExceededException, + "NotLatestPipelineExecutionException": newErrorNotLatestPipelineExecutionException, + "OutputVariablesSizeExceededException": newErrorOutputVariablesSizeExceededException, + "PipelineExecutionNotFoundException": newErrorPipelineExecutionNotFoundException, + "PipelineExecutionNotStoppableException": newErrorPipelineExecutionNotStoppableException, + "PipelineNameInUseException": newErrorPipelineNameInUseException, + "PipelineNotFoundException": newErrorPipelineNotFoundException, + "PipelineVersionNotFoundException": newErrorPipelineVersionNotFoundException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "StageNotFoundException": newErrorStageNotFoundException, + "StageNotRetryableException": newErrorStageNotRetryableException, + "TooManyTagsException": newErrorTooManyTagsException, + "ValidationException": newErrorValidationException, + "WebhookNotFoundException": newErrorWebhookNotFoundException, +} 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 index 397a00f9eb2..d144c32f84c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/codepipeline/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/codepipeline/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "codepipeline" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "CodePipeline" // ServiceID is a unique identifer of a specific service. + ServiceID = "CodePipeline" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CodePipeline client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CodePipeline client from just a session. // svc := codepipeline.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CodePipeline { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CodePipeline { svc := &CodePipeline{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-07-09", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/codestarnotifications/api.go b/vendor/github.com/aws/aws-sdk-go/service/codestarnotifications/api.go new file mode 100644 index 00000000000..c69e76f54dc --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/codestarnotifications/api.go @@ -0,0 +1,3433 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package codestarnotifications + +import ( + "fmt" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/restjson" +) + +const opCreateNotificationRule = "CreateNotificationRule" + +// CreateNotificationRuleRequest generates a "aws/request.Request" representing the +// client's request for the CreateNotificationRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateNotificationRule for more information on using the CreateNotificationRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateNotificationRuleRequest method. +// req, resp := client.CreateNotificationRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/CreateNotificationRule +func (c *CodeStarNotifications) CreateNotificationRuleRequest(input *CreateNotificationRuleInput) (req *request.Request, output *CreateNotificationRuleOutput) { + op := &request.Operation{ + Name: opCreateNotificationRule, + HTTPMethod: "POST", + HTTPPath: "/createNotificationRule", + } + + if input == nil { + input = &CreateNotificationRuleInput{} + } + + output = &CreateNotificationRuleOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateNotificationRule API operation for AWS CodeStar Notifications. +// +// Creates a notification rule for a resource. The rule specifies the events +// you want notifications about and the targets (such as SNS topics) where you +// want to receive 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 AWS CodeStar Notifications's +// API operation CreateNotificationRule for usage and error information. +// +// Returned Error Types: +// * ResourceAlreadyExistsException +// A resource with the same name or ID already exists. Notification rule names +// must be unique in your AWS account. +// +// * ValidationException +// One or more parameter values are not valid. +// +// * LimitExceededException +// One of the AWS CodeStar Notifications limits has been exceeded. Limits apply +// to accounts, notification rules, notifications, resources, and targets. For +// more information, see Limits. +// +// * ConfigurationException +// Some or all of the configuration is incomplete, missing, or not valid. +// +// * ConcurrentModificationException +// AWS CodeStar Notifications can't complete the request because the resource +// is being modified by another process. Wait a few minutes and try again. +// +// * AccessDeniedException +// AWS CodeStar Notifications can't create the notification rule because you +// do not have sufficient permissions. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/CreateNotificationRule +func (c *CodeStarNotifications) CreateNotificationRule(input *CreateNotificationRuleInput) (*CreateNotificationRuleOutput, error) { + req, out := c.CreateNotificationRuleRequest(input) + return out, req.Send() +} + +// CreateNotificationRuleWithContext is the same as CreateNotificationRule with the addition of +// the ability to pass a context and additional request options. +// +// See CreateNotificationRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeStarNotifications) CreateNotificationRuleWithContext(ctx aws.Context, input *CreateNotificationRuleInput, opts ...request.Option) (*CreateNotificationRuleOutput, error) { + req, out := c.CreateNotificationRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteNotificationRule = "DeleteNotificationRule" + +// DeleteNotificationRuleRequest generates a "aws/request.Request" representing the +// client's request for the DeleteNotificationRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteNotificationRule for more information on using the DeleteNotificationRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteNotificationRuleRequest method. +// req, resp := client.DeleteNotificationRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/DeleteNotificationRule +func (c *CodeStarNotifications) DeleteNotificationRuleRequest(input *DeleteNotificationRuleInput) (req *request.Request, output *DeleteNotificationRuleOutput) { + op := &request.Operation{ + Name: opDeleteNotificationRule, + HTTPMethod: "POST", + HTTPPath: "/deleteNotificationRule", + } + + if input == nil { + input = &DeleteNotificationRuleInput{} + } + + output = &DeleteNotificationRuleOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteNotificationRule API operation for AWS CodeStar Notifications. +// +// Deletes a notification rule for 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 AWS CodeStar Notifications's +// API operation DeleteNotificationRule for usage and error information. +// +// Returned Error Types: +// * ValidationException +// One or more parameter values are not valid. +// +// * LimitExceededException +// One of the AWS CodeStar Notifications limits has been exceeded. Limits apply +// to accounts, notification rules, notifications, resources, and targets. For +// more information, see Limits. +// +// * ConcurrentModificationException +// AWS CodeStar Notifications can't complete the request because the resource +// is being modified by another process. Wait a few minutes and try again. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/DeleteNotificationRule +func (c *CodeStarNotifications) DeleteNotificationRule(input *DeleteNotificationRuleInput) (*DeleteNotificationRuleOutput, error) { + req, out := c.DeleteNotificationRuleRequest(input) + return out, req.Send() +} + +// DeleteNotificationRuleWithContext is the same as DeleteNotificationRule with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteNotificationRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeStarNotifications) DeleteNotificationRuleWithContext(ctx aws.Context, input *DeleteNotificationRuleInput, opts ...request.Option) (*DeleteNotificationRuleOutput, error) { + req, out := c.DeleteNotificationRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteTarget = "DeleteTarget" + +// DeleteTargetRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTarget operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteTarget for more information on using the DeleteTarget +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteTargetRequest method. +// req, resp := client.DeleteTargetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/DeleteTarget +func (c *CodeStarNotifications) DeleteTargetRequest(input *DeleteTargetInput) (req *request.Request, output *DeleteTargetOutput) { + op := &request.Operation{ + Name: opDeleteTarget, + HTTPMethod: "POST", + HTTPPath: "/deleteTarget", + } + + if input == nil { + input = &DeleteTargetInput{} + } + + output = &DeleteTargetOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteTarget API operation for AWS CodeStar Notifications. +// +// Deletes a specified target for notifications. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS CodeStar Notifications's +// API operation DeleteTarget for usage and error information. +// +// Returned Error Types: +// * ValidationException +// One or more parameter values are not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/DeleteTarget +func (c *CodeStarNotifications) DeleteTarget(input *DeleteTargetInput) (*DeleteTargetOutput, error) { + req, out := c.DeleteTargetRequest(input) + return out, req.Send() +} + +// DeleteTargetWithContext is the same as DeleteTarget with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTarget for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeStarNotifications) DeleteTargetWithContext(ctx aws.Context, input *DeleteTargetInput, opts ...request.Option) (*DeleteTargetOutput, error) { + req, out := c.DeleteTargetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeNotificationRule = "DescribeNotificationRule" + +// DescribeNotificationRuleRequest generates a "aws/request.Request" representing the +// client's request for the DescribeNotificationRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeNotificationRule for more information on using the DescribeNotificationRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeNotificationRuleRequest method. +// req, resp := client.DescribeNotificationRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/DescribeNotificationRule +func (c *CodeStarNotifications) DescribeNotificationRuleRequest(input *DescribeNotificationRuleInput) (req *request.Request, output *DescribeNotificationRuleOutput) { + op := &request.Operation{ + Name: opDescribeNotificationRule, + HTTPMethod: "POST", + HTTPPath: "/describeNotificationRule", + } + + if input == nil { + input = &DescribeNotificationRuleInput{} + } + + output = &DescribeNotificationRuleOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeNotificationRule API operation for AWS CodeStar Notifications. +// +// Returns information about a specified notification 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 CodeStar Notifications's +// API operation DescribeNotificationRule for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// AWS CodeStar Notifications can't find a resource that matches the provided +// ARN. +// +// * ValidationException +// One or more parameter values are not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/DescribeNotificationRule +func (c *CodeStarNotifications) DescribeNotificationRule(input *DescribeNotificationRuleInput) (*DescribeNotificationRuleOutput, error) { + req, out := c.DescribeNotificationRuleRequest(input) + return out, req.Send() +} + +// DescribeNotificationRuleWithContext is the same as DescribeNotificationRule with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeNotificationRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeStarNotifications) DescribeNotificationRuleWithContext(ctx aws.Context, input *DescribeNotificationRuleInput, opts ...request.Option) (*DescribeNotificationRuleOutput, error) { + req, out := c.DescribeNotificationRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListEventTypes = "ListEventTypes" + +// ListEventTypesRequest generates a "aws/request.Request" representing the +// client's request for the ListEventTypes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListEventTypes for more information on using the ListEventTypes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListEventTypesRequest method. +// req, resp := client.ListEventTypesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/ListEventTypes +func (c *CodeStarNotifications) ListEventTypesRequest(input *ListEventTypesInput) (req *request.Request, output *ListEventTypesOutput) { + op := &request.Operation{ + Name: opListEventTypes, + HTTPMethod: "POST", + HTTPPath: "/listEventTypes", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListEventTypesInput{} + } + + output = &ListEventTypesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListEventTypes API operation for AWS CodeStar Notifications. +// +// Returns information about the event types available for configuring notifications. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS CodeStar Notifications's +// API operation ListEventTypes for usage and error information. +// +// Returned Error Types: +// * InvalidNextTokenException +// The value for the enumeration token used in the request to return the next +// batch of the results is not valid. +// +// * ValidationException +// One or more parameter values are not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/ListEventTypes +func (c *CodeStarNotifications) ListEventTypes(input *ListEventTypesInput) (*ListEventTypesOutput, error) { + req, out := c.ListEventTypesRequest(input) + return out, req.Send() +} + +// ListEventTypesWithContext is the same as ListEventTypes with the addition of +// the ability to pass a context and additional request options. +// +// See ListEventTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeStarNotifications) ListEventTypesWithContext(ctx aws.Context, input *ListEventTypesInput, opts ...request.Option) (*ListEventTypesOutput, error) { + req, out := c.ListEventTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListEventTypesPages iterates over the pages of a ListEventTypes operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListEventTypes 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 ListEventTypes operation. +// pageNum := 0 +// err := client.ListEventTypesPages(params, +// func(page *codestarnotifications.ListEventTypesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CodeStarNotifications) ListEventTypesPages(input *ListEventTypesInput, fn func(*ListEventTypesOutput, bool) bool) error { + return c.ListEventTypesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListEventTypesPagesWithContext same as ListEventTypesPages 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 *CodeStarNotifications) ListEventTypesPagesWithContext(ctx aws.Context, input *ListEventTypesInput, fn func(*ListEventTypesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListEventTypesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListEventTypesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListEventTypesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListNotificationRules = "ListNotificationRules" + +// ListNotificationRulesRequest generates a "aws/request.Request" representing the +// client's request for the ListNotificationRules operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListNotificationRules for more information on using the ListNotificationRules +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListNotificationRulesRequest method. +// req, resp := client.ListNotificationRulesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/ListNotificationRules +func (c *CodeStarNotifications) ListNotificationRulesRequest(input *ListNotificationRulesInput) (req *request.Request, output *ListNotificationRulesOutput) { + op := &request.Operation{ + Name: opListNotificationRules, + HTTPMethod: "POST", + HTTPPath: "/listNotificationRules", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListNotificationRulesInput{} + } + + output = &ListNotificationRulesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListNotificationRules API operation for AWS CodeStar Notifications. +// +// Returns a list of the notification rules 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 AWS CodeStar Notifications's +// API operation ListNotificationRules for usage and error information. +// +// Returned Error Types: +// * InvalidNextTokenException +// The value for the enumeration token used in the request to return the next +// batch of the results is not valid. +// +// * ValidationException +// One or more parameter values are not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/ListNotificationRules +func (c *CodeStarNotifications) ListNotificationRules(input *ListNotificationRulesInput) (*ListNotificationRulesOutput, error) { + req, out := c.ListNotificationRulesRequest(input) + return out, req.Send() +} + +// ListNotificationRulesWithContext is the same as ListNotificationRules with the addition of +// the ability to pass a context and additional request options. +// +// See ListNotificationRules for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeStarNotifications) ListNotificationRulesWithContext(ctx aws.Context, input *ListNotificationRulesInput, opts ...request.Option) (*ListNotificationRulesOutput, error) { + req, out := c.ListNotificationRulesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListNotificationRulesPages iterates over the pages of a ListNotificationRules operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListNotificationRules 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 ListNotificationRules operation. +// pageNum := 0 +// err := client.ListNotificationRulesPages(params, +// func(page *codestarnotifications.ListNotificationRulesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CodeStarNotifications) ListNotificationRulesPages(input *ListNotificationRulesInput, fn func(*ListNotificationRulesOutput, bool) bool) error { + return c.ListNotificationRulesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListNotificationRulesPagesWithContext same as ListNotificationRulesPages 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 *CodeStarNotifications) ListNotificationRulesPagesWithContext(ctx aws.Context, input *ListNotificationRulesInput, fn func(*ListNotificationRulesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListNotificationRulesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListNotificationRulesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListNotificationRulesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/ListTagsForResource +func (c *CodeStarNotifications) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { + op := &request.Operation{ + Name: opListTagsForResource, + HTTPMethod: "POST", + HTTPPath: "/listTagsForResource", + } + + if input == nil { + input = &ListTagsForResourceInput{} + } + + output = &ListTagsForResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTagsForResource API operation for AWS CodeStar Notifications. +// +// Returns a list of the tags associated with a notification 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 CodeStar Notifications's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// AWS CodeStar Notifications can't find a resource that matches the provided +// ARN. +// +// * ValidationException +// One or more parameter values are not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/ListTagsForResource +func (c *CodeStarNotifications) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeStarNotifications) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListTargets = "ListTargets" + +// ListTargetsRequest generates a "aws/request.Request" representing the +// client's request for the ListTargets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTargets for more information on using the ListTargets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTargetsRequest method. +// req, resp := client.ListTargetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/ListTargets +func (c *CodeStarNotifications) ListTargetsRequest(input *ListTargetsInput) (req *request.Request, output *ListTargetsOutput) { + op := &request.Operation{ + Name: opListTargets, + HTTPMethod: "POST", + HTTPPath: "/listTargets", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListTargetsInput{} + } + + output = &ListTargetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTargets API operation for AWS CodeStar Notifications. +// +// Returns a list of the notification rule targets 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 AWS CodeStar Notifications's +// API operation ListTargets for usage and error information. +// +// Returned Error Types: +// * InvalidNextTokenException +// The value for the enumeration token used in the request to return the next +// batch of the results is not valid. +// +// * ValidationException +// One or more parameter values are not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/ListTargets +func (c *CodeStarNotifications) ListTargets(input *ListTargetsInput) (*ListTargetsOutput, error) { + req, out := c.ListTargetsRequest(input) + return out, req.Send() +} + +// ListTargetsWithContext is the same as ListTargets with the addition of +// the ability to pass a context and additional request options. +// +// See ListTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeStarNotifications) ListTargetsWithContext(ctx aws.Context, input *ListTargetsInput, opts ...request.Option) (*ListTargetsOutput, error) { + req, out := c.ListTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListTargetsPages iterates over the pages of a ListTargets operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTargets 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 ListTargets operation. +// pageNum := 0 +// err := client.ListTargetsPages(params, +// func(page *codestarnotifications.ListTargetsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CodeStarNotifications) ListTargetsPages(input *ListTargetsInput, fn func(*ListTargetsOutput, bool) bool) error { + return c.ListTargetsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListTargetsPagesWithContext same as ListTargetsPages 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 *CodeStarNotifications) ListTargetsPagesWithContext(ctx aws.Context, input *ListTargetsInput, fn func(*ListTargetsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTargetsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTargetsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTargetsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opSubscribe = "Subscribe" + +// SubscribeRequest generates a "aws/request.Request" representing the +// client's request for the Subscribe operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See Subscribe for more information on using the Subscribe +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SubscribeRequest method. +// req, resp := client.SubscribeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/Subscribe +func (c *CodeStarNotifications) SubscribeRequest(input *SubscribeInput) (req *request.Request, output *SubscribeOutput) { + op := &request.Operation{ + Name: opSubscribe, + HTTPMethod: "POST", + HTTPPath: "/subscribe", + } + + if input == nil { + input = &SubscribeInput{} + } + + output = &SubscribeOutput{} + req = c.newRequest(op, input, output) + return +} + +// Subscribe API operation for AWS CodeStar Notifications. +// +// Creates an association between a notification rule and an SNS topic so that +// the associated target can receive notifications when the events described +// in the rule are triggered. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS CodeStar Notifications's +// API operation Subscribe for usage and error information. +// +// Returned Error Types: +// * ValidationException +// One or more parameter values are not valid. +// +// * ResourceNotFoundException +// AWS CodeStar Notifications can't find a resource that matches the provided +// ARN. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/Subscribe +func (c *CodeStarNotifications) Subscribe(input *SubscribeInput) (*SubscribeOutput, error) { + req, out := c.SubscribeRequest(input) + return out, req.Send() +} + +// SubscribeWithContext is the same as Subscribe with the addition of +// the ability to pass a context and additional request options. +// +// See Subscribe for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeStarNotifications) SubscribeWithContext(ctx aws.Context, input *SubscribeInput, opts ...request.Option) (*SubscribeOutput, error) { + req, out := c.SubscribeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/TagResource +func (c *CodeStarNotifications) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { + op := &request.Operation{ + Name: opTagResource, + HTTPMethod: "POST", + HTTPPath: "/tagResource", + } + + if input == nil { + input = &TagResourceInput{} + } + + output = &TagResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// TagResource API operation for AWS CodeStar Notifications. +// +// Associates a set of provided tags with a notification 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 CodeStar Notifications's +// API operation TagResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// AWS CodeStar Notifications can't find a resource that matches the provided +// ARN. +// +// * ValidationException +// One or more parameter values are not valid. +// +// * ConcurrentModificationException +// AWS CodeStar Notifications can't complete the request because the resource +// is being modified by another process. Wait a few minutes and try again. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/TagResource +func (c *CodeStarNotifications) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeStarNotifications) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUnsubscribe = "Unsubscribe" + +// UnsubscribeRequest generates a "aws/request.Request" representing the +// client's request for the Unsubscribe operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See Unsubscribe for more information on using the Unsubscribe +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UnsubscribeRequest method. +// req, resp := client.UnsubscribeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/Unsubscribe +func (c *CodeStarNotifications) UnsubscribeRequest(input *UnsubscribeInput) (req *request.Request, output *UnsubscribeOutput) { + op := &request.Operation{ + Name: opUnsubscribe, + HTTPMethod: "POST", + HTTPPath: "/unsubscribe", + } + + if input == nil { + input = &UnsubscribeInput{} + } + + output = &UnsubscribeOutput{} + req = c.newRequest(op, input, output) + return +} + +// Unsubscribe API operation for AWS CodeStar Notifications. +// +// Removes an association between a notification rule and an Amazon SNS topic +// so that subscribers to that topic stop receiving notifications when the events +// described in the rule are triggered. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS CodeStar Notifications's +// API operation Unsubscribe for usage and error information. +// +// Returned Error Types: +// * ValidationException +// One or more parameter values are not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/Unsubscribe +func (c *CodeStarNotifications) Unsubscribe(input *UnsubscribeInput) (*UnsubscribeOutput, error) { + req, out := c.UnsubscribeRequest(input) + return out, req.Send() +} + +// UnsubscribeWithContext is the same as Unsubscribe with the addition of +// the ability to pass a context and additional request options. +// +// See Unsubscribe for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeStarNotifications) UnsubscribeWithContext(ctx aws.Context, input *UnsubscribeInput, opts ...request.Option) (*UnsubscribeOutput, error) { + req, out := c.UnsubscribeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/UntagResource +func (c *CodeStarNotifications) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { + op := &request.Operation{ + Name: opUntagResource, + HTTPMethod: "POST", + HTTPPath: "/untagResource", + } + + if input == nil { + input = &UntagResourceInput{} + } + + output = &UntagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for AWS CodeStar Notifications. +// +// Removes the association between one or more provided tags and a notification +// 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 CodeStar Notifications's +// API operation UntagResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// AWS CodeStar Notifications can't find a resource that matches the provided +// ARN. +// +// * ValidationException +// One or more parameter values are not valid. +// +// * ConcurrentModificationException +// AWS CodeStar Notifications can't complete the request because the resource +// is being modified by another process. Wait a few minutes and try again. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/UntagResource +func (c *CodeStarNotifications) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeStarNotifications) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateNotificationRule = "UpdateNotificationRule" + +// UpdateNotificationRuleRequest generates a "aws/request.Request" representing the +// client's request for the UpdateNotificationRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateNotificationRule for more information on using the UpdateNotificationRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateNotificationRuleRequest method. +// req, resp := client.UpdateNotificationRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/UpdateNotificationRule +func (c *CodeStarNotifications) UpdateNotificationRuleRequest(input *UpdateNotificationRuleInput) (req *request.Request, output *UpdateNotificationRuleOutput) { + op := &request.Operation{ + Name: opUpdateNotificationRule, + HTTPMethod: "POST", + HTTPPath: "/updateNotificationRule", + } + + if input == nil { + input = &UpdateNotificationRuleInput{} + } + + output = &UpdateNotificationRuleOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateNotificationRule API operation for AWS CodeStar Notifications. +// +// Updates a notification rule for a resource. You can change the events that +// trigger the notification rule, the status of the rule, and the targets that +// receive the notifications. +// +// To add or remove tags for a notification rule, you must use TagResource and +// UntagResource. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS CodeStar Notifications's +// API operation UpdateNotificationRule for usage and error information. +// +// Returned Error Types: +// * ValidationException +// One or more parameter values are not valid. +// +// * ResourceNotFoundException +// AWS CodeStar Notifications can't find a resource that matches the provided +// ARN. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15/UpdateNotificationRule +func (c *CodeStarNotifications) UpdateNotificationRule(input *UpdateNotificationRuleInput) (*UpdateNotificationRuleOutput, error) { + req, out := c.UpdateNotificationRuleRequest(input) + return out, req.Send() +} + +// UpdateNotificationRuleWithContext is the same as UpdateNotificationRule with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateNotificationRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *CodeStarNotifications) UpdateNotificationRuleWithContext(ctx aws.Context, input *UpdateNotificationRuleInput, opts ...request.Option) (*UpdateNotificationRuleOutput, error) { + req, out := c.UpdateNotificationRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// AWS CodeStar Notifications can't create the notification rule because you +// do not have sufficient permissions. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS CodeStar Notifications can't complete the request because the resource +// is being modified by another process. Wait a few minutes and try again. +type ConcurrentModificationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s ConcurrentModificationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentModificationException) GoString() string { + return s.String() +} + +func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { + return &ConcurrentModificationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentModificationException) Code() string { + return "ConcurrentModificationException" +} + +// Message returns the exception's message. +func (s ConcurrentModificationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentModificationException) OrigErr() error { + return nil +} + +func (s ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentModificationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentModificationException) RequestID() string { + return s.respMetadata.RequestID +} + +// Some or all of the configuration is incomplete, missing, or not valid. +type ConfigurationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s ConfigurationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConfigurationException) GoString() string { + return s.String() +} + +func newErrorConfigurationException(v protocol.ResponseMetadata) error { + return &ConfigurationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConfigurationException) Code() string { + return "ConfigurationException" +} + +// Message returns the exception's message. +func (s ConfigurationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConfigurationException) OrigErr() error { + return nil +} + +func (s ConfigurationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConfigurationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConfigurationException) RequestID() string { + return s.respMetadata.RequestID +} + +type CreateNotificationRuleInput struct { + _ struct{} `type:"structure"` + + // A unique, client-generated idempotency token that, when provided in a request, + // ensures the request cannot be repeated with a changed parameter. If a request + // with the same parameters is received and a token is included, the request + // returns information about the initial request that used that token. + // + // The AWS SDKs prepopulate client request tokens. If you are using an AWS SDK, + // an idempotency token is created for you. + ClientRequestToken *string `min:"1" type:"string" idempotencyToken:"true"` + + // The level of detail to include in the notifications for this resource. BASIC + // will include only the contents of the event as it would appear in AWS CloudWatch. + // FULL will include any supplemental information provided by AWS CodeStar Notifications + // and/or the service for the resource for which the notification is created. + // + // DetailType is a required field + DetailType *string `type:"string" required:"true" enum:"DetailType"` + + // A list of event types associated with this notification rule. For a list + // of allowed events, see EventTypeSummary. + // + // EventTypeIds is a required field + EventTypeIds []*string `type:"list" required:"true"` + + // The name for the notification rule. Notifictaion rule names must be unique + // in your AWS account. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true" sensitive:"true"` + + // The Amazon Resource Name (ARN) of the resource to associate with the notification + // rule. Supported resources include pipelines in AWS CodePipeline, repositories + // in AWS CodeCommit, and build projects in AWS CodeBuild. + // + // Resource is a required field + Resource *string `type:"string" required:"true"` + + // The status of the notification rule. The default value is ENABLED. If the + // status is set to DISABLED, notifications aren't sent for the notification + // rule. + Status *string `type:"string" enum:"NotificationRuleStatus"` + + // A list of tags to apply to this notification rule. Key names cannot start + // with "aws". + Tags map[string]*string `type:"map"` + + // A list of Amazon Resource Names (ARNs) of SNS topics to associate with the + // notification rule. + // + // Targets is a required field + Targets []*Target `type:"list" required:"true"` +} + +// String returns the string representation +func (s CreateNotificationRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNotificationRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateNotificationRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateNotificationRuleInput"} + if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) + } + if s.DetailType == nil { + invalidParams.Add(request.NewErrParamRequired("DetailType")) + } + if s.EventTypeIds == nil { + invalidParams.Add(request.NewErrParamRequired("EventTypeIds")) + } + 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.Resource == nil { + invalidParams.Add(request.NewErrParamRequired("Resource")) + } + 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 +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *CreateNotificationRuleInput) SetClientRequestToken(v string) *CreateNotificationRuleInput { + s.ClientRequestToken = &v + return s +} + +// SetDetailType sets the DetailType field's value. +func (s *CreateNotificationRuleInput) SetDetailType(v string) *CreateNotificationRuleInput { + s.DetailType = &v + return s +} + +// SetEventTypeIds sets the EventTypeIds field's value. +func (s *CreateNotificationRuleInput) SetEventTypeIds(v []*string) *CreateNotificationRuleInput { + s.EventTypeIds = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateNotificationRuleInput) SetName(v string) *CreateNotificationRuleInput { + s.Name = &v + return s +} + +// SetResource sets the Resource field's value. +func (s *CreateNotificationRuleInput) SetResource(v string) *CreateNotificationRuleInput { + s.Resource = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CreateNotificationRuleInput) SetStatus(v string) *CreateNotificationRuleInput { + s.Status = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateNotificationRuleInput) SetTags(v map[string]*string) *CreateNotificationRuleInput { + s.Tags = v + return s +} + +// SetTargets sets the Targets field's value. +func (s *CreateNotificationRuleInput) SetTargets(v []*Target) *CreateNotificationRuleInput { + s.Targets = v + return s +} + +type CreateNotificationRuleOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the notification rule. + Arn *string `type:"string"` +} + +// String returns the string representation +func (s CreateNotificationRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNotificationRuleOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateNotificationRuleOutput) SetArn(v string) *CreateNotificationRuleOutput { + s.Arn = &v + return s +} + +type DeleteNotificationRuleInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the notification rule you want to delete. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteNotificationRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNotificationRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteNotificationRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteNotificationRuleInput"} + 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 *DeleteNotificationRuleInput) SetArn(v string) *DeleteNotificationRuleInput { + s.Arn = &v + return s +} + +type DeleteNotificationRuleOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the deleted notification rule. + Arn *string `type:"string"` +} + +// String returns the string representation +func (s DeleteNotificationRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNotificationRuleOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DeleteNotificationRuleOutput) SetArn(v string) *DeleteNotificationRuleOutput { + s.Arn = &v + return s +} + +type DeleteTargetInput struct { + _ struct{} `type:"structure"` + + // A Boolean value that can be used to delete all associations with this SNS + // topic. The default value is FALSE. If set to TRUE, all associations between + // that target and every notification rule in your AWS account are deleted. + ForceUnsubscribeAll *bool `type:"boolean"` + + // The Amazon Resource Name (ARN) of the SNS topic to delete. + // + // TargetAddress is a required field + TargetAddress *string `min:"1" type:"string" required:"true" sensitive:"true"` +} + +// String returns the string representation +func (s DeleteTargetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTargetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteTargetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTargetInput"} + if s.TargetAddress == nil { + invalidParams.Add(request.NewErrParamRequired("TargetAddress")) + } + if s.TargetAddress != nil && len(*s.TargetAddress) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TargetAddress", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetForceUnsubscribeAll sets the ForceUnsubscribeAll field's value. +func (s *DeleteTargetInput) SetForceUnsubscribeAll(v bool) *DeleteTargetInput { + s.ForceUnsubscribeAll = &v + return s +} + +// SetTargetAddress sets the TargetAddress field's value. +func (s *DeleteTargetInput) SetTargetAddress(v string) *DeleteTargetInput { + s.TargetAddress = &v + return s +} + +type DeleteTargetOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteTargetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTargetOutput) GoString() string { + return s.String() +} + +type DescribeNotificationRuleInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the notification rule. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeNotificationRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNotificationRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeNotificationRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeNotificationRuleInput"} + 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 *DescribeNotificationRuleInput) SetArn(v string) *DescribeNotificationRuleInput { + s.Arn = &v + return s +} + +type DescribeNotificationRuleOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the notification rule. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // The name or email alias of the person who created the notification rule. + CreatedBy *string `min:"1" type:"string"` + + // The date and time the notification rule was created, in timestamp format. + CreatedTimestamp *time.Time `type:"timestamp"` + + // The level of detail included in the notifications for this resource. BASIC + // will include only the contents of the event as it would appear in AWS CloudWatch. + // FULL will include any supplemental information provided by AWS CodeStar Notifications + // and/or the service for the resource for which the notification is created. + DetailType *string `type:"string" enum:"DetailType"` + + // A list of the event types associated with the notification rule. + EventTypes []*EventTypeSummary `type:"list"` + + // The date and time the notification rule was most recently updated, in timestamp + // format. + LastModifiedTimestamp *time.Time `type:"timestamp"` + + // The name of the notification rule. + Name *string `min:"1" type:"string" sensitive:"true"` + + // The Amazon Resource Name (ARN) of the resource associated with the notification + // rule. + Resource *string `type:"string"` + + // The status of the notification rule. Valid statuses are on (sending notifications) + // or off (not sending notifications). + Status *string `type:"string" enum:"NotificationRuleStatus"` + + // The tags associated with the notification rule. + Tags map[string]*string `type:"map"` + + // A list of the SNS topics associated with the notification rule. + Targets []*TargetSummary `type:"list"` +} + +// String returns the string representation +func (s DescribeNotificationRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNotificationRuleOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DescribeNotificationRuleOutput) SetArn(v string) *DescribeNotificationRuleOutput { + s.Arn = &v + return s +} + +// SetCreatedBy sets the CreatedBy field's value. +func (s *DescribeNotificationRuleOutput) SetCreatedBy(v string) *DescribeNotificationRuleOutput { + s.CreatedBy = &v + return s +} + +// SetCreatedTimestamp sets the CreatedTimestamp field's value. +func (s *DescribeNotificationRuleOutput) SetCreatedTimestamp(v time.Time) *DescribeNotificationRuleOutput { + s.CreatedTimestamp = &v + return s +} + +// SetDetailType sets the DetailType field's value. +func (s *DescribeNotificationRuleOutput) SetDetailType(v string) *DescribeNotificationRuleOutput { + s.DetailType = &v + return s +} + +// SetEventTypes sets the EventTypes field's value. +func (s *DescribeNotificationRuleOutput) SetEventTypes(v []*EventTypeSummary) *DescribeNotificationRuleOutput { + s.EventTypes = v + return s +} + +// SetLastModifiedTimestamp sets the LastModifiedTimestamp field's value. +func (s *DescribeNotificationRuleOutput) SetLastModifiedTimestamp(v time.Time) *DescribeNotificationRuleOutput { + s.LastModifiedTimestamp = &v + return s +} + +// SetName sets the Name field's value. +func (s *DescribeNotificationRuleOutput) SetName(v string) *DescribeNotificationRuleOutput { + s.Name = &v + return s +} + +// SetResource sets the Resource field's value. +func (s *DescribeNotificationRuleOutput) SetResource(v string) *DescribeNotificationRuleOutput { + s.Resource = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeNotificationRuleOutput) SetStatus(v string) *DescribeNotificationRuleOutput { + s.Status = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *DescribeNotificationRuleOutput) SetTags(v map[string]*string) *DescribeNotificationRuleOutput { + s.Tags = v + return s +} + +// SetTargets sets the Targets field's value. +func (s *DescribeNotificationRuleOutput) SetTargets(v []*TargetSummary) *DescribeNotificationRuleOutput { + s.Targets = v + return s +} + +// Returns information about an event that has triggered a notification rule. +type EventTypeSummary struct { + _ struct{} `type:"structure"` + + // The system-generated ID of the event. + EventTypeId *string `min:"1" type:"string"` + + // The name of the event. + EventTypeName *string `type:"string"` + + // The resource type of the event. + ResourceType *string `min:"1" type:"string"` + + // The name of the service for which the event applies. + ServiceName *string `type:"string"` +} + +// String returns the string representation +func (s EventTypeSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EventTypeSummary) GoString() string { + return s.String() +} + +// SetEventTypeId sets the EventTypeId field's value. +func (s *EventTypeSummary) SetEventTypeId(v string) *EventTypeSummary { + s.EventTypeId = &v + return s +} + +// SetEventTypeName sets the EventTypeName field's value. +func (s *EventTypeSummary) SetEventTypeName(v string) *EventTypeSummary { + s.EventTypeName = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *EventTypeSummary) SetResourceType(v string) *EventTypeSummary { + s.ResourceType = &v + return s +} + +// SetServiceName sets the ServiceName field's value. +func (s *EventTypeSummary) SetServiceName(v string) *EventTypeSummary { + s.ServiceName = &v + return s +} + +// The value for the enumeration token used in the request to return the next +// batch of the results is not valid. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s InvalidNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNextTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// One of the AWS CodeStar Notifications limits has been exceeded. Limits apply +// to accounts, notification rules, notifications, resources, and targets. For +// more information, see Limits. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about a filter to apply to the list of returned event types. +// You can filter by resource type or service name. +type ListEventTypesFilter struct { + _ struct{} `type:"structure"` + + // The system-generated name of the filter type you want to filter by. + // + // Name is a required field + Name *string `type:"string" required:"true" enum:"ListEventTypesFilterName"` + + // The name of the resource type (for example, pipeline) or service name (for + // example, CodePipeline) that you want to filter by. + // + // Value is a required field + Value *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ListEventTypesFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListEventTypesFilter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListEventTypesFilter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListEventTypesFilter"} + 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 *ListEventTypesFilter) SetName(v string) *ListEventTypesFilter { + s.Name = &v + return s +} + +// SetValue sets the Value field's value. +func (s *ListEventTypesFilter) SetValue(v string) *ListEventTypesFilter { + s.Value = &v + return s +} + +type ListEventTypesInput struct { + _ struct{} `type:"structure"` + + // The filters to use to return information by service or resource type. + Filters []*ListEventTypesFilter `type:"list"` + + // A non-negative integer used to limit the number of returned results. The + // default number is 50. The maximum number of results that can be returned + // is 100. + MaxResults *int64 `min:"1" type:"integer"` + + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListEventTypesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListEventTypesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListEventTypesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListEventTypesInput"} + 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 *ListEventTypesInput) SetFilters(v []*ListEventTypesFilter) *ListEventTypesInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListEventTypesInput) SetMaxResults(v int64) *ListEventTypesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListEventTypesInput) SetNextToken(v string) *ListEventTypesInput { + s.NextToken = &v + return s +} + +type ListEventTypesOutput struct { + _ struct{} `type:"structure"` + + // Information about each event, including service name, resource type, event + // ID, and event name. + EventTypes []*EventTypeSummary `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 ListEventTypesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListEventTypesOutput) GoString() string { + return s.String() +} + +// SetEventTypes sets the EventTypes field's value. +func (s *ListEventTypesOutput) SetEventTypes(v []*EventTypeSummary) *ListEventTypesOutput { + s.EventTypes = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListEventTypesOutput) SetNextToken(v string) *ListEventTypesOutput { + s.NextToken = &v + return s +} + +// Information about a filter to apply to the list of returned notification +// rules. You can filter by event type, owner, resource, or target. +type ListNotificationRulesFilter struct { + _ struct{} `type:"structure"` + + // The name of the attribute you want to use to filter the returned notification + // rules. + // + // Name is a required field + Name *string `type:"string" required:"true" enum:"ListNotificationRulesFilterName"` + + // The value of the attribute you want to use to filter the returned notification + // rules. For example, if you specify filtering by RESOURCE in Name, you might + // specify the ARN of a pipeline in AWS CodePipeline for the value. + // + // Value is a required field + Value *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ListNotificationRulesFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListNotificationRulesFilter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListNotificationRulesFilter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListNotificationRulesFilter"} + 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 *ListNotificationRulesFilter) SetName(v string) *ListNotificationRulesFilter { + s.Name = &v + return s +} + +// SetValue sets the Value field's value. +func (s *ListNotificationRulesFilter) SetValue(v string) *ListNotificationRulesFilter { + s.Value = &v + return s +} + +type ListNotificationRulesInput struct { + _ struct{} `type:"structure"` + + // The filters to use to return information by service or resource type. For + // valid values, see ListNotificationRulesFilter. + // + // A filter with the same name can appear more than once when used with OR statements. + // Filters with different names should be applied with AND statements. + Filters []*ListNotificationRulesFilter `type:"list"` + + // A non-negative integer used to limit the number of returned results. The + // maximum number of results that can be returned is 100. + MaxResults *int64 `min:"1" type:"integer"` + + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListNotificationRulesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListNotificationRulesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListNotificationRulesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListNotificationRulesInput"} + 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 *ListNotificationRulesInput) SetFilters(v []*ListNotificationRulesFilter) *ListNotificationRulesInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListNotificationRulesInput) SetMaxResults(v int64) *ListNotificationRulesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListNotificationRulesInput) SetNextToken(v string) *ListNotificationRulesInput { + s.NextToken = &v + return s +} + +type ListNotificationRulesOutput struct { + _ struct{} `type:"structure"` + + // An enumeration token that can be used in a request to return the next batch + // of the results. + NextToken *string `type:"string"` + + // The list of notification rules for the AWS account, by Amazon Resource Name + // (ARN) and ID. + NotificationRules []*NotificationRuleSummary `type:"list"` +} + +// String returns the string representation +func (s ListNotificationRulesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListNotificationRulesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListNotificationRulesOutput) SetNextToken(v string) *ListNotificationRulesOutput { + s.NextToken = &v + return s +} + +// SetNotificationRules sets the NotificationRules field's value. +func (s *ListNotificationRulesOutput) SetNotificationRules(v []*NotificationRuleSummary) *ListNotificationRulesOutput { + s.NotificationRules = v + return s +} + +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) for the notification rule. + // + // Arn is a required field + Arn *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.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *ListTagsForResourceInput) SetArn(v string) *ListTagsForResourceInput { + s.Arn = &v + return s +} + +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // The tags associated with the notification rule. + Tags map[string]*string `type:"map"` +} + +// 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 map[string]*string) *ListTagsForResourceOutput { + s.Tags = v + return s +} + +// Information about a filter to apply to the list of returned targets. You +// can filter by target type, address, or status. For example, to filter results +// to notification rules that have active Amazon SNS topics as targets, you +// could specify a ListTargetsFilter Name as TargetType and a Value of SNS, +// and a Name of TARGET_STATUS and a Value of ACTIVE. +type ListTargetsFilter struct { + _ struct{} `type:"structure"` + + // The name of the attribute you want to use to filter the returned targets. + // + // Name is a required field + Name *string `type:"string" required:"true" enum:"ListTargetsFilterName"` + + // The value of the attribute you want to use to filter the returned targets. + // For example, if you specify SNS for the Target type, you could specify an + // Amazon Resource Name (ARN) for a topic as the value. + // + // Value is a required field + Value *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ListTargetsFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTargetsFilter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTargetsFilter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTargetsFilter"} + 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 *ListTargetsFilter) SetName(v string) *ListTargetsFilter { + s.Name = &v + return s +} + +// SetValue sets the Value field's value. +func (s *ListTargetsFilter) SetValue(v string) *ListTargetsFilter { + s.Value = &v + return s +} + +type ListTargetsInput struct { + _ struct{} `type:"structure"` + + // The filters to use to return information by service or resource type. Valid + // filters include target type, target address, and target status. + // + // A filter with the same name can appear more than once when used with OR statements. + // Filters with different names should be applied with AND statements. + Filters []*ListTargetsFilter `type:"list"` + + // A non-negative integer used to limit the number of returned results. The + // maximum number of results that can be returned is 100. + MaxResults *int64 `min:"1" type:"integer"` + + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListTargetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTargetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTargetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTargetsInput"} + 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 *ListTargetsInput) SetFilters(v []*ListTargetsFilter) *ListTargetsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListTargetsInput) SetMaxResults(v int64) *ListTargetsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTargetsInput) SetNextToken(v string) *ListTargetsInput { + s.NextToken = &v + return s +} + +type ListTargetsOutput struct { + _ struct{} `type:"structure"` + + // An enumeration token that can be used in a request to return the next batch + // of results. + NextToken *string `type:"string"` + + // The list of notification rule targets. + Targets []*TargetSummary `type:"list"` +} + +// String returns the string representation +func (s ListTargetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTargetsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTargetsOutput) SetNextToken(v string) *ListTargetsOutput { + s.NextToken = &v + return s +} + +// SetTargets sets the Targets field's value. +func (s *ListTargetsOutput) SetTargets(v []*TargetSummary) *ListTargetsOutput { + s.Targets = v + return s +} + +// Information about a specified notification rule. +type NotificationRuleSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the notification rule. + Arn *string `type:"string"` + + // The unique ID of the notification rule. + Id *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s NotificationRuleSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotificationRuleSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *NotificationRuleSummary) SetArn(v string) *NotificationRuleSummary { + s.Arn = &v + return s +} + +// SetId sets the Id field's value. +func (s *NotificationRuleSummary) SetId(v string) *NotificationRuleSummary { + s.Id = &v + return s +} + +// A resource with the same name or ID already exists. Notification rule names +// must be unique in your AWS account. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS CodeStar Notifications can't find a resource that matches the provided +// ARN. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +type SubscribeInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the notification rule for which you want + // to create the association. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // An enumeration token that, when provided in a request, returns the next batch + // of the results. + ClientRequestToken *string `min:"1" type:"string"` + + // Information about the SNS topics associated with a notification rule. + // + // Target is a required field + Target *Target `type:"structure" 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.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) + } + if s.Target == nil { + invalidParams.Add(request.NewErrParamRequired("Target")) + } + if s.Target != nil { + if err := s.Target.Validate(); err != nil { + invalidParams.AddNested("Target", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *SubscribeInput) SetArn(v string) *SubscribeInput { + s.Arn = &v + return s +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *SubscribeInput) SetClientRequestToken(v string) *SubscribeInput { + s.ClientRequestToken = &v + return s +} + +// SetTarget sets the Target field's value. +func (s *SubscribeInput) SetTarget(v *Target) *SubscribeInput { + s.Target = v + return s +} + +type SubscribeOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the notification rule for which you have + // created assocations. + Arn *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() +} + +// SetArn sets the Arn field's value. +func (s *SubscribeOutput) SetArn(v string) *SubscribeOutput { + s.Arn = &v + return s +} + +type TagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the notification rule to tag. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // The list of tags to associate with the resource. Tag key names cannot start + // with "aws". + // + // Tags is a required field + Tags map[string]*string `type:"map" 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.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.Tags == nil { + invalidParams.Add(request.NewErrParamRequired("Tags")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *TagResourceInput) SetArn(v string) *TagResourceInput { + s.Arn = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { + s.Tags = v + return s +} + +type TagResourceOutput struct { + _ struct{} `type:"structure"` + + // The list of tags associated with the resource. + Tags map[string]*string `type:"map"` +} + +// 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() +} + +// SetTags sets the Tags field's value. +func (s *TagResourceOutput) SetTags(v map[string]*string) *TagResourceOutput { + s.Tags = v + return s +} + +// Information about the SNS topics associated with a notification rule. +type Target struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the SNS topic. + TargetAddress *string `min:"1" type:"string" sensitive:"true"` + + // The target type. Can be an Amazon SNS topic. + TargetType *string `type:"string"` +} + +// 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.TargetAddress != nil && len(*s.TargetAddress) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TargetAddress", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTargetAddress sets the TargetAddress field's value. +func (s *Target) SetTargetAddress(v string) *Target { + s.TargetAddress = &v + return s +} + +// SetTargetType sets the TargetType field's value. +func (s *Target) SetTargetType(v string) *Target { + s.TargetType = &v + return s +} + +// Information about the targets specified for a notification rule. +type TargetSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the SNS topic. + TargetAddress *string `min:"1" type:"string" sensitive:"true"` + + // The status of the target. + TargetStatus *string `type:"string" enum:"TargetStatus"` + + // The type of the target (for example, SNS). + TargetType *string `type:"string"` +} + +// String returns the string representation +func (s TargetSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TargetSummary) GoString() string { + return s.String() +} + +// SetTargetAddress sets the TargetAddress field's value. +func (s *TargetSummary) SetTargetAddress(v string) *TargetSummary { + s.TargetAddress = &v + return s +} + +// SetTargetStatus sets the TargetStatus field's value. +func (s *TargetSummary) SetTargetStatus(v string) *TargetSummary { + s.TargetStatus = &v + return s +} + +// SetTargetType sets the TargetType field's value. +func (s *TargetSummary) SetTargetType(v string) *TargetSummary { + s.TargetType = &v + return s +} + +type UnsubscribeInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the notification rule. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // The ARN of the SNS topic to unsubscribe from the notification rule. + // + // TargetAddress is a required field + TargetAddress *string `min:"1" type:"string" required:"true" sensitive:"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.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.TargetAddress == nil { + invalidParams.Add(request.NewErrParamRequired("TargetAddress")) + } + if s.TargetAddress != nil && len(*s.TargetAddress) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TargetAddress", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *UnsubscribeInput) SetArn(v string) *UnsubscribeInput { + s.Arn = &v + return s +} + +// SetTargetAddress sets the TargetAddress field's value. +func (s *UnsubscribeInput) SetTargetAddress(v string) *UnsubscribeInput { + s.TargetAddress = &v + return s +} + +type UnsubscribeOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the the notification rule from which you + // have removed a subscription. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` +} + +// 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() +} + +// SetArn sets the Arn field's value. +func (s *UnsubscribeOutput) SetArn(v string) *UnsubscribeOutput { + s.Arn = &v + return s +} + +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the notification rule from which to remove + // the tags. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // The key names of the tags to remove. + // + // 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.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 *UntagResourceInput) SetArn(v string) *UntagResourceInput { + s.Arn = &v + return s +} + +// SetTagKeys sets the TagKeys field's value. +func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { + s.TagKeys = v + return s +} + +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() +} + +type UpdateNotificationRuleInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the notification rule. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // The level of detail to include in the notifications for this resource. BASIC + // will include only the contents of the event as it would appear in AWS CloudWatch. + // FULL will include any supplemental information provided by AWS CodeStar Notifications + // and/or the service for the resource for which the notification is created. + DetailType *string `type:"string" enum:"DetailType"` + + // A list of event types associated with this notification rule. + EventTypeIds []*string `type:"list"` + + // The name of the notification rule. + Name *string `min:"1" type:"string" sensitive:"true"` + + // The status of the notification rule. Valid statuses include enabled (sending + // notifications) or disabled (not sending notifications). + Status *string `type:"string" enum:"NotificationRuleStatus"` + + // The address and type of the targets to receive notifications from this notification + // rule. + Targets []*Target `type:"list"` +} + +// String returns the string representation +func (s UpdateNotificationRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateNotificationRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateNotificationRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateNotificationRuleInput"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 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 +} + +// SetArn sets the Arn field's value. +func (s *UpdateNotificationRuleInput) SetArn(v string) *UpdateNotificationRuleInput { + s.Arn = &v + return s +} + +// SetDetailType sets the DetailType field's value. +func (s *UpdateNotificationRuleInput) SetDetailType(v string) *UpdateNotificationRuleInput { + s.DetailType = &v + return s +} + +// SetEventTypeIds sets the EventTypeIds field's value. +func (s *UpdateNotificationRuleInput) SetEventTypeIds(v []*string) *UpdateNotificationRuleInput { + s.EventTypeIds = v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateNotificationRuleInput) SetName(v string) *UpdateNotificationRuleInput { + s.Name = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *UpdateNotificationRuleInput) SetStatus(v string) *UpdateNotificationRuleInput { + s.Status = &v + return s +} + +// SetTargets sets the Targets field's value. +func (s *UpdateNotificationRuleInput) SetTargets(v []*Target) *UpdateNotificationRuleInput { + s.Targets = v + return s +} + +type UpdateNotificationRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateNotificationRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateNotificationRuleOutput) GoString() string { + return s.String() +} + +// One or more parameter values are not valid. +type ValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s ValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationException) GoString() string { + return s.String() +} + +func newErrorValidationException(v protocol.ResponseMetadata) error { + return &ValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ValidationException) Code() string { + return "ValidationException" +} + +// Message returns the exception's message. +func (s ValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ValidationException) OrigErr() error { + return nil +} + +func (s ValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ValidationException) RequestID() string { + return s.respMetadata.RequestID +} + +const ( + // DetailTypeBasic is a DetailType enum value + DetailTypeBasic = "BASIC" + + // DetailTypeFull is a DetailType enum value + DetailTypeFull = "FULL" +) + +const ( + // ListEventTypesFilterNameResourceType is a ListEventTypesFilterName enum value + ListEventTypesFilterNameResourceType = "RESOURCE_TYPE" + + // ListEventTypesFilterNameServiceName is a ListEventTypesFilterName enum value + ListEventTypesFilterNameServiceName = "SERVICE_NAME" +) + +const ( + // ListNotificationRulesFilterNameEventTypeId is a ListNotificationRulesFilterName enum value + ListNotificationRulesFilterNameEventTypeId = "EVENT_TYPE_ID" + + // ListNotificationRulesFilterNameCreatedBy is a ListNotificationRulesFilterName enum value + ListNotificationRulesFilterNameCreatedBy = "CREATED_BY" + + // ListNotificationRulesFilterNameResource is a ListNotificationRulesFilterName enum value + ListNotificationRulesFilterNameResource = "RESOURCE" + + // ListNotificationRulesFilterNameTargetAddress is a ListNotificationRulesFilterName enum value + ListNotificationRulesFilterNameTargetAddress = "TARGET_ADDRESS" +) + +const ( + // ListTargetsFilterNameTargetType is a ListTargetsFilterName enum value + ListTargetsFilterNameTargetType = "TARGET_TYPE" + + // ListTargetsFilterNameTargetAddress is a ListTargetsFilterName enum value + ListTargetsFilterNameTargetAddress = "TARGET_ADDRESS" + + // ListTargetsFilterNameTargetStatus is a ListTargetsFilterName enum value + ListTargetsFilterNameTargetStatus = "TARGET_STATUS" +) + +const ( + // NotificationRuleStatusEnabled is a NotificationRuleStatus enum value + NotificationRuleStatusEnabled = "ENABLED" + + // NotificationRuleStatusDisabled is a NotificationRuleStatus enum value + NotificationRuleStatusDisabled = "DISABLED" +) + +const ( + // TargetStatusPending is a TargetStatus enum value + TargetStatusPending = "PENDING" + + // TargetStatusActive is a TargetStatus enum value + TargetStatusActive = "ACTIVE" + + // TargetStatusUnreachable is a TargetStatus enum value + TargetStatusUnreachable = "UNREACHABLE" + + // TargetStatusInactive is a TargetStatus enum value + TargetStatusInactive = "INACTIVE" + + // TargetStatusDeactivated is a TargetStatus enum value + TargetStatusDeactivated = "DEACTIVATED" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/codestarnotifications/doc.go b/vendor/github.com/aws/aws-sdk-go/service/codestarnotifications/doc.go new file mode 100644 index 00000000000..8181f322d8d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/codestarnotifications/doc.go @@ -0,0 +1,78 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package codestarnotifications provides the client and types for making API +// requests to AWS CodeStar Notifications. +// +// This AWS CodeStar Notifications API Reference provides descriptions and usage +// examples of the operations and data types for the AWS CodeStar Notifications +// API. You can use the AWS CodeStar Notifications API to work with the following +// objects: +// +// Notification rules, by calling the following: +// +// * CreateNotificationRule, which creates a notification rule for a resource +// in your account. +// +// * DeleteNotificationRule, which deletes a notification rule. +// +// * DescribeNotificationRule, which provides information about a notification +// rule. +// +// * ListNotificationRules, which lists the notification rules associated +// with your account. +// +// * UpdateNotificationRule, which changes the name, events, or targets associated +// with a notification rule. +// +// * Subscribe, which subscribes a target to a notification rule. +// +// * Unsubscribe, which removes a target from a notification rule. +// +// Targets, by calling the following: +// +// * DeleteTarget, which removes a notification rule target (SNS topic) from +// a notification rule. +// +// * ListTargets, which lists the targets associated with a notification +// rule. +// +// Events, by calling the following: +// +// * ListEventTypes, which lists the event types you can include in a notification +// rule. +// +// Tags, by calling the following: +// +// * ListTagsForResource, which lists the tags already associated with a +// notification rule in your account. +// +// * TagResource, which associates a tag you provide with a notification +// rule in your account. +// +// * UntagResource, which removes a tag from a notification rule in your +// account. +// +// For information about how to use AWS CodeStar Notifications, see link in +// the CodeStarNotifications User Guide. +// +// See https://docs.aws.amazon.com/goto/WebAPI/codestar-notifications-2019-10-15 for more information on this service. +// +// See codestarnotifications package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/codestarnotifications/ +// +// Using the Client +// +// To contact AWS CodeStar Notifications 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 CodeStar Notifications client CodeStarNotifications for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/codestarnotifications/#New +package codestarnotifications diff --git a/vendor/github.com/aws/aws-sdk-go/service/codestarnotifications/errors.go b/vendor/github.com/aws/aws-sdk-go/service/codestarnotifications/errors.go new file mode 100644 index 00000000000..7f2e0520c62 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/codestarnotifications/errors.go @@ -0,0 +1,76 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package codestarnotifications + +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + +const ( + + // ErrCodeAccessDeniedException for service response error code + // "AccessDeniedException". + // + // AWS CodeStar Notifications can't create the notification rule because you + // do not have sufficient permissions. + ErrCodeAccessDeniedException = "AccessDeniedException" + + // ErrCodeConcurrentModificationException for service response error code + // "ConcurrentModificationException". + // + // AWS CodeStar Notifications can't complete the request because the resource + // is being modified by another process. Wait a few minutes and try again. + ErrCodeConcurrentModificationException = "ConcurrentModificationException" + + // ErrCodeConfigurationException for service response error code + // "ConfigurationException". + // + // Some or all of the configuration is incomplete, missing, or not valid. + ErrCodeConfigurationException = "ConfigurationException" + + // ErrCodeInvalidNextTokenException for service response error code + // "InvalidNextTokenException". + // + // The value for the enumeration token used in the request to return the next + // batch of the results is not valid. + ErrCodeInvalidNextTokenException = "InvalidNextTokenException" + + // ErrCodeLimitExceededException for service response error code + // "LimitExceededException". + // + // One of the AWS CodeStar Notifications limits has been exceeded. Limits apply + // to accounts, notification rules, notifications, resources, and targets. For + // more information, see Limits. + ErrCodeLimitExceededException = "LimitExceededException" + + // ErrCodeResourceAlreadyExistsException for service response error code + // "ResourceAlreadyExistsException". + // + // A resource with the same name or ID already exists. Notification rule names + // must be unique in your AWS account. + ErrCodeResourceAlreadyExistsException = "ResourceAlreadyExistsException" + + // ErrCodeResourceNotFoundException for service response error code + // "ResourceNotFoundException". + // + // AWS CodeStar Notifications can't find a resource that matches the provided + // ARN. + ErrCodeResourceNotFoundException = "ResourceNotFoundException" + + // ErrCodeValidationException for service response error code + // "ValidationException". + // + // One or more parameter values are not valid. + ErrCodeValidationException = "ValidationException" +) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "ConcurrentModificationException": newErrorConcurrentModificationException, + "ConfigurationException": newErrorConfigurationException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "LimitExceededException": newErrorLimitExceededException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ValidationException": newErrorValidationException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/codestarnotifications/service.go b/vendor/github.com/aws/aws-sdk-go/service/codestarnotifications/service.go new file mode 100644 index 00000000000..c80a47fc139 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/codestarnotifications/service.go @@ -0,0 +1,104 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package codestarnotifications + +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" + "github.com/aws/aws-sdk-go/private/protocol/restjson" +) + +// CodeStarNotifications provides the API operation methods for making requests to +// AWS CodeStar Notifications. See this package's package overview docs +// for details on the service. +// +// CodeStarNotifications methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type CodeStarNotifications 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 = "codestar notifications" // Name of service. + EndpointsID = "codestar-notifications" // ID to lookup a service endpoint with. + ServiceID = "codestar notifications" // ServiceID is a unique identifier of a specific service. +) + +// New creates a new instance of the CodeStarNotifications client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// mySession := session.Must(session.NewSession()) +// +// // Create a CodeStarNotifications client from just a session. +// svc := codestarnotifications.New(mySession) +// +// // Create a CodeStarNotifications client with additional configuration +// svc := codestarnotifications.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *CodeStarNotifications { + c := p.ClientConfig(EndpointsID, cfgs...) + if c.SigningNameDerived || len(c.SigningName) == 0 { + c.SigningName = "codestar-notifications" + } + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CodeStarNotifications { + svc := &CodeStarNotifications{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + PartitionID: partitionID, + Endpoint: endpoint, + APIVersion: "2019-10-15", + }, + 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( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a CodeStarNotifications operation and runs any +// custom request initialization. +func (c *CodeStarNotifications) 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/cognitoidentity/api.go b/vendor/github.com/aws/aws-sdk-go/service/cognitoidentity/api.go index bd6f3f98398..6b104b41f68 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cognitoidentity/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cognitoidentity/api.go @@ -59,8 +59,8 @@ func (c *CognitoIdentity) CreateIdentityPoolRequest(input *CreateIdentityPoolInp // CreateIdentityPool API operation for Amazon Cognito Identity. // // Creates a new identity pool. The identity pool is a store of user identity -// information that is specific to your AWS account. The limit on identity pools -// is 60 per account. The keys for SupportedLoginProviders are as follows: +// information that is specific to your AWS account. The keys for SupportedLoginProviders +// are as follows: // // * Facebook: graph.facebook.com // @@ -81,24 +81,24 @@ func (c *CognitoIdentity) CreateIdentityPoolRequest(input *CreateIdentityPoolInp // See the AWS API reference guide for Amazon Cognito Identity's // API operation CreateIdentityPool for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // Thrown when a user tries to use a login which is already linked to another // account. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Thrown when the total number of user pools has exceeded a preset limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/CreateIdentityPool @@ -179,14 +179,14 @@ func (c *CognitoIdentity) DeleteIdentitiesRequest(input *DeleteIdentitiesInput) // See the AWS API reference guide for Amazon Cognito Identity's // API operation DeleteIdentities for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/DeleteIdentities @@ -268,21 +268,21 @@ func (c *CognitoIdentity) DeleteIdentityPoolRequest(input *DeleteIdentityPoolInp // See the AWS API reference guide for Amazon Cognito Identity's // API operation DeleteIdentityPool for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/DeleteIdentityPool @@ -363,21 +363,21 @@ func (c *CognitoIdentity) DescribeIdentityRequest(input *DescribeIdentityInput) // See the AWS API reference guide for Amazon Cognito Identity's // API operation DescribeIdentity for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/DescribeIdentity @@ -458,21 +458,21 @@ func (c *CognitoIdentity) DescribeIdentityPoolRequest(input *DescribeIdentityPoo // See the AWS API reference guide for Amazon Cognito Identity's // API operation DescribeIdentityPool for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/DescribeIdentityPool @@ -556,32 +556,32 @@ func (c *CognitoIdentity) GetCredentialsForIdentityRequest(input *GetCredentials // See the AWS API reference guide for Amazon Cognito Identity's // API operation GetCredentialsForIdentity for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // Thrown when a user tries to use a login which is already linked to another // account. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInvalidIdentityPoolConfigurationException "InvalidIdentityPoolConfigurationException" +// * InvalidIdentityPoolConfigurationException // Thrown if the identity pool has no role associated for the given auth type // (auth/unauth) or if the AssumeRole fails. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // -// * ErrCodeExternalServiceException "ExternalServiceException" +// * ExternalServiceException // An exception thrown when a dependent service such as Facebook or Twitter // is not responding // @@ -664,31 +664,31 @@ func (c *CognitoIdentity) GetIdRequest(input *GetIdInput) (req *request.Request, // See the AWS API reference guide for Amazon Cognito Identity's // API operation GetId for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // Thrown when a user tries to use a login which is already linked to another // account. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Thrown when the total number of user pools has exceeded a preset limit. // -// * ErrCodeExternalServiceException "ExternalServiceException" +// * ExternalServiceException // An exception thrown when a dependent service such as Facebook or Twitter // is not responding // @@ -769,25 +769,25 @@ func (c *CognitoIdentity) GetIdentityPoolRolesRequest(input *GetIdentityPoolRole // See the AWS API reference guide for Amazon Cognito Identity's // API operation GetIdentityPoolRoles for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // Thrown when a user tries to use a login which is already linked to another // account. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/GetIdentityPoolRoles @@ -872,28 +872,28 @@ func (c *CognitoIdentity) GetOpenIdTokenRequest(input *GetOpenIdTokenInput) (req // See the AWS API reference guide for Amazon Cognito Identity's // API operation GetOpenIdToken for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // Thrown when a user tries to use a login which is already linked to another // account. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // -// * ErrCodeExternalServiceException "ExternalServiceException" +// * ExternalServiceException // An exception thrown when a dependent service such as Facebook or Twitter // is not responding // @@ -987,28 +987,28 @@ func (c *CognitoIdentity) GetOpenIdTokenForDeveloperIdentityRequest(input *GetOp // See the AWS API reference guide for Amazon Cognito Identity's // API operation GetOpenIdTokenForDeveloperIdentity for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // Thrown when a user tries to use a login which is already linked to another // account. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // -// * ErrCodeDeveloperUserAlreadyRegisteredException "DeveloperUserAlreadyRegisteredException" +// * DeveloperUserAlreadyRegisteredException // The provided developer user identifier is already registered with Cognito // under a different identity ID. // @@ -1089,21 +1089,21 @@ func (c *CognitoIdentity) ListIdentitiesRequest(input *ListIdentitiesInput) (req // See the AWS API reference guide for Amazon Cognito Identity's // API operation ListIdentities for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/ListIdentities @@ -1183,21 +1183,21 @@ func (c *CognitoIdentity) ListIdentityPoolsRequest(input *ListIdentityPoolsInput // See the AWS API reference guide for Amazon Cognito Identity's // API operation ListIdentityPools for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/ListIdentityPools @@ -1281,21 +1281,21 @@ func (c *CognitoIdentity) ListTagsForResourceRequest(input *ListTagsForResourceI // See the AWS API reference guide for Amazon Cognito Identity's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/ListTagsForResource @@ -1389,25 +1389,25 @@ func (c *CognitoIdentity) LookupDeveloperIdentityRequest(input *LookupDeveloperI // See the AWS API reference guide for Amazon Cognito Identity's // API operation LookupDeveloperIdentity for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // Thrown when a user tries to use a login which is already linked to another // account. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/LookupDeveloperIdentity @@ -1497,25 +1497,25 @@ func (c *CognitoIdentity) MergeDeveloperIdentitiesRequest(input *MergeDeveloperI // See the AWS API reference guide for Amazon Cognito Identity's // API operation MergeDeveloperIdentities for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // Thrown when a user tries to use a login which is already linked to another // account. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/MergeDeveloperIdentities @@ -1597,28 +1597,28 @@ func (c *CognitoIdentity) SetIdentityPoolRolesRequest(input *SetIdentityPoolRole // See the AWS API reference guide for Amazon Cognito Identity's // API operation SetIdentityPoolRoles for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // Thrown when a user tries to use a login which is already linked to another // account. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Thrown if there are parallel requests to modify a resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/SetIdentityPoolRoles @@ -1714,21 +1714,21 @@ func (c *CognitoIdentity) TagResourceRequest(input *TagResourceInput) (req *requ // See the AWS API reference guide for Amazon Cognito Identity's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/TagResource @@ -1812,25 +1812,25 @@ func (c *CognitoIdentity) UnlinkDeveloperIdentityRequest(input *UnlinkDeveloperI // See the AWS API reference guide for Amazon Cognito Identity's // API operation UnlinkDeveloperIdentity for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // Thrown when a user tries to use a login which is already linked to another // account. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/UnlinkDeveloperIdentity @@ -1914,28 +1914,28 @@ func (c *CognitoIdentity) UnlinkIdentityRequest(input *UnlinkIdentityInput) (req // See the AWS API reference guide for Amazon Cognito Identity's // API operation UnlinkIdentity for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // Thrown when a user tries to use a login which is already linked to another // account. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // -// * ErrCodeExternalServiceException "ExternalServiceException" +// * ExternalServiceException // An exception thrown when a dependent service such as Facebook or Twitter // is not responding // @@ -2016,21 +2016,21 @@ func (c *CognitoIdentity) UntagResourceRequest(input *UntagResourceInput) (req * // See the AWS API reference guide for Amazon Cognito Identity's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/UntagResource @@ -2110,31 +2110,31 @@ func (c *CognitoIdentity) UpdateIdentityPoolRequest(input *IdentityPool) (req *r // See the AWS API reference guide for Amazon Cognito Identity's // API operation UpdateIdentityPool for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // Thrown for missing or bad input parameter(s). // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Thrown when the requested resource (for example, a dataset or record) does // not exist. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // Thrown when a user is not authorized to access the requested resource. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // Thrown when a user tries to use a login which is already linked to another // account. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Thrown when a request is throttled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // Thrown when the service encounters an error during processing the request. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Thrown if there are parallel requests to modify a resource. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Thrown when the total number of user pools has exceeded a preset limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-identity-2014-06-30/UpdateIdentityPool @@ -2159,10 +2159,72 @@ func (c *CognitoIdentity) UpdateIdentityPoolWithContext(ctx aws.Context, input * return out, req.Send() } +// Thrown if there are parallel requests to modify a resource. +type ConcurrentModificationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned by a ConcurrentModificationException. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentModificationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentModificationException) GoString() string { + return s.String() +} + +func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { + return &ConcurrentModificationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentModificationException) Code() string { + return "ConcurrentModificationException" +} + +// Message returns the exception's message. +func (s ConcurrentModificationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentModificationException) OrigErr() error { + return nil +} + +func (s ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentModificationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentModificationException) RequestID() string { + return s.respMetadata.RequestID +} + // Input to the CreateIdentityPool action. type CreateIdentityPoolInput struct { _ struct{} `type:"structure"` + // Enables or disables the Basic (Classic) authentication flow. For more information, + // see Identity Pools (Federated Identities) Authentication Flow (https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html) + // in the Amazon Cognito Developer Guide. + AllowClassicFlow *bool `type:"boolean"` + // TRUE if the identity pool supports unauthenticated logins. // // AllowUnauthenticatedIdentities is a required field @@ -2243,6 +2305,12 @@ func (s *CreateIdentityPoolInput) Validate() error { return nil } +// SetAllowClassicFlow sets the AllowClassicFlow field's value. +func (s *CreateIdentityPoolInput) SetAllowClassicFlow(v bool) *CreateIdentityPoolInput { + s.AllowClassicFlow = &v + return s +} + // SetAllowUnauthenticatedIdentities sets the AllowUnauthenticatedIdentities field's value. func (s *CreateIdentityPoolInput) SetAllowUnauthenticatedIdentities(v bool) *CreateIdentityPoolInput { s.AllowUnauthenticatedIdentities = &v @@ -2549,6 +2617,122 @@ func (s *DescribeIdentityPoolInput) SetIdentityPoolId(v string) *DescribeIdentit return s } +// The provided developer user identifier is already registered with Cognito +// under a different identity ID. +type DeveloperUserAlreadyRegisteredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // This developer user identifier is already registered with Cognito. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DeveloperUserAlreadyRegisteredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeveloperUserAlreadyRegisteredException) GoString() string { + return s.String() +} + +func newErrorDeveloperUserAlreadyRegisteredException(v protocol.ResponseMetadata) error { + return &DeveloperUserAlreadyRegisteredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DeveloperUserAlreadyRegisteredException) Code() string { + return "DeveloperUserAlreadyRegisteredException" +} + +// Message returns the exception's message. +func (s DeveloperUserAlreadyRegisteredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeveloperUserAlreadyRegisteredException) OrigErr() error { + return nil +} + +func (s DeveloperUserAlreadyRegisteredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DeveloperUserAlreadyRegisteredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DeveloperUserAlreadyRegisteredException) RequestID() string { + return s.respMetadata.RequestID +} + +// An exception thrown when a dependent service such as Facebook or Twitter +// is not responding +type ExternalServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned by an ExternalServiceException + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ExternalServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExternalServiceException) GoString() string { + return s.String() +} + +func newErrorExternalServiceException(v protocol.ResponseMetadata) error { + return &ExternalServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ExternalServiceException) Code() string { + return "ExternalServiceException" +} + +// Message returns the exception's message. +func (s ExternalServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ExternalServiceException) OrigErr() error { + return nil +} + +func (s ExternalServiceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ExternalServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ExternalServiceException) RequestID() string { + return s.respMetadata.RequestID +} + // Input to the GetCredentialsForIdentity action. type GetCredentialsForIdentityInput struct { _ struct{} `type:"structure"` @@ -2878,6 +3062,9 @@ type GetOpenIdTokenForDeveloperIdentityInput struct { // take care in setting the expiration time for a token, as there are significant // security implications: an attacker could use a leaked token to access your // AWS resources for the token's duration. + // + // Please provide for a small grace period, usually no more than 5 minutes, + // to account for clock skew. TokenDuration *int64 `min:"1" type:"long"` } @@ -3117,6 +3304,11 @@ func (s *IdentityDescription) SetLogins(v []*string) *IdentityDescription { type IdentityPool struct { _ struct{} `type:"structure"` + // Enables or disables the Basic (Classic) authentication flow. For more information, + // see Identity Pools (Federated Identities) Authentication Flow (https://docs.aws.amazon.com/cognito/latest/developerguide/authentication-flow.html) + // in the Amazon Cognito Developer Guide. + AllowClassicFlow *bool `type:"boolean"` + // TRUE if the identity pool supports unauthenticated logins. // // AllowUnauthenticatedIdentities is a required field @@ -3202,6 +3394,12 @@ func (s *IdentityPool) Validate() error { return nil } +// SetAllowClassicFlow sets the AllowClassicFlow field's value. +func (s *IdentityPool) SetAllowClassicFlow(v bool) *IdentityPool { + s.AllowClassicFlow = &v + return s +} + // SetAllowUnauthenticatedIdentities sets the AllowUnauthenticatedIdentities field's value. func (s *IdentityPool) SetAllowUnauthenticatedIdentities(v bool) *IdentityPool { s.AllowUnauthenticatedIdentities = &v @@ -3289,6 +3487,235 @@ func (s *IdentityPoolShortDescription) SetIdentityPoolName(v string) *IdentityPo return s } +// Thrown when the service encounters an error during processing the request. +type InternalErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned by an InternalErrorException. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalErrorException) GoString() string { + return s.String() +} + +func newErrorInternalErrorException(v protocol.ResponseMetadata) error { + return &InternalErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalErrorException) Code() string { + return "InternalErrorException" +} + +// Message returns the exception's message. +func (s InternalErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalErrorException) OrigErr() error { + return nil +} + +func (s InternalErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// Thrown if the identity pool has no role associated for the given auth type +// (auth/unauth) or if the AssumeRole fails. +type InvalidIdentityPoolConfigurationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned for an InvalidIdentityPoolConfigurationException + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidIdentityPoolConfigurationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidIdentityPoolConfigurationException) GoString() string { + return s.String() +} + +func newErrorInvalidIdentityPoolConfigurationException(v protocol.ResponseMetadata) error { + return &InvalidIdentityPoolConfigurationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidIdentityPoolConfigurationException) Code() string { + return "InvalidIdentityPoolConfigurationException" +} + +// Message returns the exception's message. +func (s InvalidIdentityPoolConfigurationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidIdentityPoolConfigurationException) OrigErr() error { + return nil +} + +func (s InvalidIdentityPoolConfigurationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidIdentityPoolConfigurationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidIdentityPoolConfigurationException) RequestID() string { + return s.respMetadata.RequestID +} + +// Thrown for missing or bad input parameter(s). +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned by an InvalidParameterException. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} + +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// Thrown when the total number of user pools has exceeded a preset limit. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned by a LimitExceededException. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Input to the ListIdentities action. type ListIdentitiesInput struct { _ struct{} `type:"structure"` @@ -3925,6 +4352,63 @@ func (s *MergeDeveloperIdentitiesOutput) SetIdentityId(v string) *MergeDeveloper return s } +// Thrown when a user is not authorized to access the requested resource. +type NotAuthorizedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned by a NotAuthorizedException + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotAuthorizedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotAuthorizedException) GoString() string { + return s.String() +} + +func newErrorNotAuthorizedException(v protocol.ResponseMetadata) error { + return &NotAuthorizedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotAuthorizedException) Code() string { + return "NotAuthorizedException" +} + +// Message returns the exception's message. +func (s NotAuthorizedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotAuthorizedException) OrigErr() error { + return nil +} + +func (s NotAuthorizedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotAuthorizedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotAuthorizedException) RequestID() string { + return s.respMetadata.RequestID +} + // A provider representing an Amazon Cognito user pool and its client ID. type Provider struct { _ struct{} `type:"structure"` @@ -3992,6 +4476,122 @@ func (s *Provider) SetServerSideTokenCheck(v bool) *Provider { return s } +// Thrown when a user tries to use a login which is already linked to another +// account. +type ResourceConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned by a ResourceConflictException. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceConflictException) GoString() string { + return s.String() +} + +func newErrorResourceConflictException(v protocol.ResponseMetadata) error { + return &ResourceConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceConflictException) Code() string { + return "ResourceConflictException" +} + +// Message returns the exception's message. +func (s ResourceConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceConflictException) OrigErr() error { + return nil +} + +func (s ResourceConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceConflictException) RequestID() string { + return s.respMetadata.RequestID +} + +// Thrown when the requested resource (for example, a dataset or record) does +// not exist. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned by a ResourceNotFoundException. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // A role mapping. type RoleMapping struct { _ struct{} `type:"structure"` @@ -4220,7 +4820,9 @@ type TagResourceInput struct { ResourceArn *string `min:"20" type:"string" required:"true"` // The tags to assign to the identity pool. - Tags map[string]*string `type:"map"` + // + // Tags is a required field + Tags map[string]*string `type:"map" required:"true"` } // String returns the string representation @@ -4242,6 +4844,9 @@ func (s *TagResourceInput) Validate() error { if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) } + if s.Tags == nil { + invalidParams.Add(request.NewErrParamRequired("Tags")) + } if invalidParams.Len() > 0 { return invalidParams @@ -4275,6 +4880,63 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// Thrown when a request is throttled. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Message returned by a TooManyRequestsException + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + // Input to the UnlinkDeveloperIdentity action. type UnlinkDeveloperIdentityInput struct { _ struct{} `type:"structure"` @@ -4510,7 +5172,9 @@ type UntagResourceInput struct { ResourceArn *string `min:"20" type:"string" required:"true"` // The keys of the tags to remove from the user pool. - TagKeys []*string `type:"list"` + // + // TagKeys is a required field + TagKeys []*string `type:"list" required:"true"` } // String returns the string representation @@ -4532,6 +5196,9 @@ func (s *UntagResourceInput) Validate() error { if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) } + if s.TagKeys == nil { + invalidParams.Add(request.NewErrParamRequired("TagKeys")) + } if invalidParams.Len() > 0 { return invalidParams diff --git a/vendor/github.com/aws/aws-sdk-go/service/cognitoidentity/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cognitoidentity/errors.go index 9094d135b12..6f48e21052b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cognitoidentity/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cognitoidentity/errors.go @@ -2,6 +2,10 @@ package cognitoidentity +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeConcurrentModificationException for service response error code @@ -75,3 +79,17 @@ const ( // Thrown when a request is throttled. ErrCodeTooManyRequestsException = "TooManyRequestsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ConcurrentModificationException": newErrorConcurrentModificationException, + "DeveloperUserAlreadyRegisteredException": newErrorDeveloperUserAlreadyRegisteredException, + "ExternalServiceException": newErrorExternalServiceException, + "InternalErrorException": newErrorInternalErrorException, + "InvalidIdentityPoolConfigurationException": newErrorInvalidIdentityPoolConfigurationException, + "InvalidParameterException": newErrorInvalidParameterException, + "LimitExceededException": newErrorLimitExceededException, + "NotAuthorizedException": newErrorNotAuthorizedException, + "ResourceConflictException": newErrorResourceConflictException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "TooManyRequestsException": newErrorTooManyRequestsException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cognitoidentity/service.go b/vendor/github.com/aws/aws-sdk-go/service/cognitoidentity/service.go index 9ebae103f36..54811ae4a57 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cognitoidentity/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cognitoidentity/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "cognito-identity" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Cognito Identity" // ServiceID is a unique identifer of a specific service. + ServiceID = "Cognito Identity" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CognitoIdentity client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CognitoIdentity client from just a session. // svc := cognitoidentity.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := cognitoidentity.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *CognitoIdentity { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CognitoIdentity { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CognitoIdentity { svc := &CognitoIdentity{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2014-06-30", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/cognitoidentityprovider/api.go b/vendor/github.com/aws/aws-sdk-go/service/cognitoidentityprovider/api.go index f958a361833..8fd262b54ff 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cognitoidentityprovider/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cognitoidentityprovider/api.go @@ -68,27 +68,27 @@ func (c *CognitoIdentityProvider) AddCustomAttributesRequest(input *AddCustomAtt // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AddCustomAttributes for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserImportInProgressException "UserImportInProgressException" +// * UserImportInProgressException // This exception is thrown when you are trying to modify a user pool while // a user import job is in progress for that pool. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AddCustomAttributes @@ -160,7 +160,7 @@ func (c *CognitoIdentityProvider) AdminAddUserToGroupRequest(input *AdminAddUser // // Adds the specified user to the specified group. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -169,26 +169,26 @@ func (c *CognitoIdentityProvider) AdminAddUserToGroupRequest(input *AdminAddUser // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminAddUserToGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminAddUserToGroup @@ -261,7 +261,7 @@ func (c *CognitoIdentityProvider) AdminConfirmSignUpRequest(input *AdminConfirmS // Confirms user registration as an admin without using a confirmation code. // Works on any user. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -270,46 +270,46 @@ func (c *CognitoIdentityProvider) AdminConfirmSignUpRequest(input *AdminConfirmS // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminConfirmSignUp for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException" +// * UnexpectedLambdaException // This exception is thrown when the Amazon Cognito service encounters an unexpected // exception with the AWS Lambda service. // -// * ErrCodeUserLambdaValidationException "UserLambdaValidationException" +// * UserLambdaValidationException // This exception is thrown when the Amazon Cognito service encounters a user // validation exception with the AWS Lambda service. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyFailedAttemptsException "TooManyFailedAttemptsException" +// * TooManyFailedAttemptsException // This exception is thrown when the user has made too many failed attempts // for a given action (e.g., sign in). // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminConfirmSignUp @@ -402,65 +402,65 @@ func (c *CognitoIdentityProvider) AdminCreateUserRequest(input *AdminCreateUserI // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminCreateUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUsernameExistsException "UsernameExistsException" +// * UsernameExistsException // This exception is thrown when Amazon Cognito encounters a user name that // already exists in the user pool. // -// * ErrCodeInvalidPasswordException "InvalidPasswordException" +// * InvalidPasswordException // This exception is thrown when the Amazon Cognito service encounters an invalid // password. // -// * ErrCodeCodeDeliveryFailureException "CodeDeliveryFailureException" +// * CodeDeliveryFailureException // This exception is thrown when a verification code fails to deliver successfully. // -// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException" +// * UnexpectedLambdaException // This exception is thrown when the Amazon Cognito service encounters an unexpected // exception with the AWS Lambda service. // -// * ErrCodeUserLambdaValidationException "UserLambdaValidationException" +// * UserLambdaValidationException // This exception is thrown when the Amazon Cognito service encounters a user // validation exception with the AWS Lambda service. // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" +// * PreconditionNotMetException // This exception is thrown when a precondition is not met. // -// * ErrCodeInvalidSmsRoleAccessPolicyException "InvalidSmsRoleAccessPolicyException" +// * InvalidSmsRoleAccessPolicyException // This exception is returned when the role provided for SMS configuration does // not have permission to publish using Amazon SNS. // -// * ErrCodeInvalidSmsRoleTrustRelationshipException "InvalidSmsRoleTrustRelationshipException" +// * InvalidSmsRoleTrustRelationshipException // This exception is thrown when the trust relationship is invalid for the role // provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com // or the external ID provided in the role does not match what is provided in // the SMS configuration for the user pool. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUnsupportedUserStateException "UnsupportedUserStateException" +// * UnsupportedUserStateException // The request failed because the user is in an unsupported state. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminCreateUser @@ -532,7 +532,7 @@ func (c *CognitoIdentityProvider) AdminDeleteUserRequest(input *AdminDeleteUserI // // Deletes a user as an administrator. Works on any user. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -541,26 +541,26 @@ func (c *CognitoIdentityProvider) AdminDeleteUserRequest(input *AdminDeleteUserI // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminDeleteUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDeleteUser @@ -633,7 +633,7 @@ func (c *CognitoIdentityProvider) AdminDeleteUserAttributesRequest(input *AdminD // Deletes the user attributes in a user pool as an administrator. Works on // any user. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -642,26 +642,26 @@ func (c *CognitoIdentityProvider) AdminDeleteUserAttributesRequest(input *AdminD // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminDeleteUserAttributes for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDeleteUserAttributes @@ -768,32 +768,32 @@ func (c *CognitoIdentityProvider) AdminDisableProviderForUserRequest(input *Admi // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminDisableProviderForUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeAliasExistsException "AliasExistsException" +// * AliasExistsException // This exception is thrown when a user tries to confirm the account with an // email or phone number that has already been supplied as an alias from a different // account. This exception tells user that an account with this email or phone // already exists. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDisableProviderForUser @@ -863,9 +863,9 @@ func (c *CognitoIdentityProvider) AdminDisableUserRequest(input *AdminDisableUse // AdminDisableUser API operation for Amazon Cognito Identity Provider. // -// Disables the specified user as an administrator. Works on any user. +// Disables the specified user. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -874,26 +874,26 @@ func (c *CognitoIdentityProvider) AdminDisableUserRequest(input *AdminDisableUse // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminDisableUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminDisableUser @@ -965,7 +965,7 @@ func (c *CognitoIdentityProvider) AdminEnableUserRequest(input *AdminEnableUserI // // Enables the specified user as an administrator. Works on any user. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -974,26 +974,26 @@ func (c *CognitoIdentityProvider) AdminEnableUserRequest(input *AdminEnableUserI // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminEnableUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminEnableUser @@ -1065,7 +1065,7 @@ func (c *CognitoIdentityProvider) AdminForgetDeviceRequest(input *AdminForgetDev // // Forgets the device, as an administrator. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1074,29 +1074,29 @@ func (c *CognitoIdentityProvider) AdminForgetDeviceRequest(input *AdminForgetDev // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminForgetDevice for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeInvalidUserPoolConfigurationException "InvalidUserPoolConfigurationException" +// * InvalidUserPoolConfigurationException // This exception is thrown when the user pool configuration is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminForgetDevice @@ -1167,7 +1167,7 @@ func (c *CognitoIdentityProvider) AdminGetDeviceRequest(input *AdminGetDeviceInp // // Gets the device, as an administrator. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1176,26 +1176,26 @@ func (c *CognitoIdentityProvider) AdminGetDeviceRequest(input *AdminGetDeviceInp // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminGetDevice for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeInvalidUserPoolConfigurationException "InvalidUserPoolConfigurationException" +// * InvalidUserPoolConfigurationException // This exception is thrown when the user pool configuration is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminGetDevice @@ -1267,7 +1267,7 @@ func (c *CognitoIdentityProvider) AdminGetUserRequest(input *AdminGetUserInput) // Gets the specified user by user name in a user pool as an administrator. // Works on any user. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1276,26 +1276,26 @@ func (c *CognitoIdentityProvider) AdminGetUserRequest(input *AdminGetUserInput) // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminGetUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminGetUser @@ -1366,7 +1366,7 @@ func (c *CognitoIdentityProvider) AdminInitiateAuthRequest(input *AdminInitiateA // // Initiates the authentication flow, as an administrator. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1375,61 +1375,61 @@ func (c *CognitoIdentityProvider) AdminInitiateAuthRequest(input *AdminInitiateA // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminInitiateAuth for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // -// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException" +// * UnexpectedLambdaException // This exception is thrown when the Amazon Cognito service encounters an unexpected // exception with the AWS Lambda service. // -// * ErrCodeInvalidUserPoolConfigurationException "InvalidUserPoolConfigurationException" +// * InvalidUserPoolConfigurationException // This exception is thrown when the user pool configuration is invalid. // -// * ErrCodeUserLambdaValidationException "UserLambdaValidationException" +// * UserLambdaValidationException // This exception is thrown when the Amazon Cognito service encounters a user // validation exception with the AWS Lambda service. // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodeMFAMethodNotFoundException "MFAMethodNotFoundException" +// * MFAMethodNotFoundException // This exception is thrown when Amazon Cognito cannot find a multi-factor authentication // (MFA) method. // -// * ErrCodeInvalidSmsRoleAccessPolicyException "InvalidSmsRoleAccessPolicyException" +// * InvalidSmsRoleAccessPolicyException // This exception is returned when the role provided for SMS configuration does // not have permission to publish using Amazon SNS. // -// * ErrCodeInvalidSmsRoleTrustRelationshipException "InvalidSmsRoleTrustRelationshipException" +// * InvalidSmsRoleTrustRelationshipException // This exception is thrown when the trust relationship is invalid for the role // provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com // or the external ID provided in the role does not match what is provided in // the SMS configuration for the user pool. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminInitiateAuth @@ -1526,32 +1526,32 @@ func (c *CognitoIdentityProvider) AdminLinkProviderForUserRequest(input *AdminLi // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminLinkProviderForUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeAliasExistsException "AliasExistsException" +// * AliasExistsException // This exception is thrown when a user tries to confirm the account with an // email or phone number that has already been supplied as an alias from a different // account. This exception tells user that an account with this email or phone // already exists. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminLinkProviderForUser @@ -1622,7 +1622,7 @@ func (c *CognitoIdentityProvider) AdminListDevicesRequest(input *AdminListDevice // // Lists devices, as an administrator. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1631,26 +1631,26 @@ func (c *CognitoIdentityProvider) AdminListDevicesRequest(input *AdminListDevice // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminListDevices for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidUserPoolConfigurationException "InvalidUserPoolConfigurationException" +// * InvalidUserPoolConfigurationException // This exception is thrown when the user pool configuration is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminListDevices @@ -1727,7 +1727,7 @@ func (c *CognitoIdentityProvider) AdminListGroupsForUserRequest(input *AdminList // // Lists the groups that the user belongs to. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1736,26 +1736,26 @@ func (c *CognitoIdentityProvider) AdminListGroupsForUserRequest(input *AdminList // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminListGroupsForUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminListGroupsForUser @@ -1823,10 +1823,12 @@ func (c *CognitoIdentityProvider) AdminListGroupsForUserPagesWithContext(ctx aws }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*AdminListGroupsForUserOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*AdminListGroupsForUserOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1890,29 +1892,29 @@ func (c *CognitoIdentityProvider) AdminListUserAuthEventsRequest(input *AdminLis // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminListUserAuthEvents for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserPoolAddOnNotEnabledException "UserPoolAddOnNotEnabledException" +// * UserPoolAddOnNotEnabledException // This exception is thrown when user pool add-ons are not enabled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminListUserAuthEvents @@ -1980,10 +1982,12 @@ func (c *CognitoIdentityProvider) AdminListUserAuthEventsPagesWithContext(ctx aw }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*AdminListUserAuthEventsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*AdminListUserAuthEventsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2034,7 +2038,7 @@ func (c *CognitoIdentityProvider) AdminRemoveUserFromGroupRequest(input *AdminRe // // Removes the specified user from the specified group. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2043,26 +2047,26 @@ func (c *CognitoIdentityProvider) AdminRemoveUserFromGroupRequest(input *AdminRe // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminRemoveUserFromGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminRemoveUserFromGroup @@ -2145,7 +2149,7 @@ func (c *CognitoIdentityProvider) AdminResetUserPasswordRequest(input *AdminRese // also result in sending a message to the end user with the code to change // their password. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2154,56 +2158,56 @@ func (c *CognitoIdentityProvider) AdminResetUserPasswordRequest(input *AdminRese // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminResetUserPassword for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException" +// * UnexpectedLambdaException // This exception is thrown when the Amazon Cognito service encounters an unexpected // exception with the AWS Lambda service. // -// * ErrCodeUserLambdaValidationException "UserLambdaValidationException" +// * UserLambdaValidationException // This exception is thrown when the Amazon Cognito service encounters a user // validation exception with the AWS Lambda service. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInvalidSmsRoleAccessPolicyException "InvalidSmsRoleAccessPolicyException" +// * InvalidSmsRoleAccessPolicyException // This exception is returned when the role provided for SMS configuration does // not have permission to publish using Amazon SNS. // -// * ErrCodeInvalidEmailRoleAccessPolicyException "InvalidEmailRoleAccessPolicyException" +// * InvalidEmailRoleAccessPolicyException // This exception is thrown when Amazon Cognito is not allowed to use your email // identity. HTTP status code: 400. // -// * ErrCodeInvalidSmsRoleTrustRelationshipException "InvalidSmsRoleTrustRelationshipException" +// * InvalidSmsRoleTrustRelationshipException // This exception is thrown when the trust relationship is invalid for the role // provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com // or the external ID provided in the role does not match what is provided in // the SMS configuration for the user pool. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminResetUserPassword @@ -2274,7 +2278,7 @@ func (c *CognitoIdentityProvider) AdminRespondToAuthChallengeRequest(input *Admi // // Responds to an authentication challenge, as an administrator. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2283,81 +2287,81 @@ func (c *CognitoIdentityProvider) AdminRespondToAuthChallengeRequest(input *Admi // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminRespondToAuthChallenge for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeCodeMismatchException "CodeMismatchException" +// * CodeMismatchException // This exception is thrown if the provided code does not match what the server // was expecting. // -// * ErrCodeExpiredCodeException "ExpiredCodeException" +// * ExpiredCodeException // This exception is thrown if a code has expired. // -// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException" +// * UnexpectedLambdaException // This exception is thrown when the Amazon Cognito service encounters an unexpected // exception with the AWS Lambda service. // -// * ErrCodeInvalidPasswordException "InvalidPasswordException" +// * InvalidPasswordException // This exception is thrown when the Amazon Cognito service encounters an invalid // password. // -// * ErrCodeUserLambdaValidationException "UserLambdaValidationException" +// * UserLambdaValidationException // This exception is thrown when the Amazon Cognito service encounters a user // validation exception with the AWS Lambda service. // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInvalidUserPoolConfigurationException "InvalidUserPoolConfigurationException" +// * InvalidUserPoolConfigurationException // This exception is thrown when the user pool configuration is invalid. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // -// * ErrCodeMFAMethodNotFoundException "MFAMethodNotFoundException" +// * MFAMethodNotFoundException // This exception is thrown when Amazon Cognito cannot find a multi-factor authentication // (MFA) method. // -// * ErrCodeInvalidSmsRoleAccessPolicyException "InvalidSmsRoleAccessPolicyException" +// * InvalidSmsRoleAccessPolicyException // This exception is returned when the role provided for SMS configuration does // not have permission to publish using Amazon SNS. // -// * ErrCodeInvalidSmsRoleTrustRelationshipException "InvalidSmsRoleTrustRelationshipException" +// * InvalidSmsRoleTrustRelationshipException // This exception is thrown when the trust relationship is invalid for the role // provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com // or the external ID provided in the role does not match what is provided in // the SMS configuration for the user pool. // -// * ErrCodeAliasExistsException "AliasExistsException" +// * AliasExistsException // This exception is thrown when a user tries to confirm the account with an // email or phone number that has already been supplied as an alias from a different // account. This exception tells user that an account with this email or phone // already exists. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeSoftwareTokenMFANotFoundException "SoftwareTokenMFANotFoundException" +// * SoftwareTokenMFANotFoundException // This exception is thrown when the software token TOTP multi-factor authentication // (MFA) is not enabled for the user pool. // @@ -2428,7 +2432,12 @@ func (c *CognitoIdentityProvider) AdminSetUserMFAPreferenceRequest(input *AdminS // AdminSetUserMFAPreference API operation for Amazon Cognito Identity Provider. // -// Sets the user's multi-factor authentication (MFA) preference. +// Sets the user's multi-factor authentication (MFA) preference, including which +// MFA options are enabled and if any are preferred. Only one factor can be +// set as preferred. The preferred MFA factor will be used to authenticate a +// user if multiple factors are enabled. If multiple options are enabled and +// no preference is set, a challenge to choose an MFA option will be returned +// during sign in. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2437,28 +2446,28 @@ func (c *CognitoIdentityProvider) AdminSetUserMFAPreferenceRequest(input *AdminS // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminSetUserMFAPreference for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminSetUserMFAPreference @@ -2528,6 +2537,19 @@ func (c *CognitoIdentityProvider) AdminSetUserPasswordRequest(input *AdminSetUse // AdminSetUserPassword API operation for Amazon Cognito Identity Provider. // +// Sets the specified user's password in a user pool as an administrator. Works +// on any user. +// +// The password can be temporary or permanent. If it is temporary, the user +// status will be placed into the FORCE_CHANGE_PASSWORD state. When the user +// next tries to sign in, the InitiateAuth/AdminInitiateAuth response will contain +// the NEW_PASSWORD_REQUIRED challenge. If the user does not sign in before +// it expires, the user will not be able to sign in and their password will +// need to be reset by an administrator. +// +// Once the user has set a new password, or the password is permanent, the user +// status will be set to Confirmed. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2535,29 +2557,29 @@ func (c *CognitoIdentityProvider) AdminSetUserPasswordRequest(input *AdminSetUse // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminSetUserPassword for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeInvalidPasswordException "InvalidPasswordException" +// * InvalidPasswordException // This exception is thrown when the Amazon Cognito service encounters an invalid // password. // @@ -2628,9 +2650,9 @@ func (c *CognitoIdentityProvider) AdminSetUserSettingsRequest(input *AdminSetUse // AdminSetUserSettings API operation for Amazon Cognito Identity Provider. // -// Sets all the user settings for a specified user name. Works on any user. -// -// Requires developer credentials. +// This action is no longer supported. You can use it to configure only SMS +// MFA. You can't use it to configure TOTP software token MFA. To configure +// either type of MFA, use the AdminSetUserMFAPreference action 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 @@ -2639,22 +2661,22 @@ func (c *CognitoIdentityProvider) AdminSetUserSettingsRequest(input *AdminSetUse // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminSetUserSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminSetUserSettings @@ -2735,29 +2757,29 @@ func (c *CognitoIdentityProvider) AdminUpdateAuthEventFeedbackRequest(input *Adm // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminUpdateAuthEventFeedback for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserPoolAddOnNotEnabledException "UserPoolAddOnNotEnabledException" +// * UserPoolAddOnNotEnabledException // This exception is thrown when user pool add-ons are not enabled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminUpdateAuthEventFeedback @@ -2829,7 +2851,7 @@ func (c *CognitoIdentityProvider) AdminUpdateDeviceStatusRequest(input *AdminUpd // // Updates the device status as an administrator. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2838,29 +2860,29 @@ func (c *CognitoIdentityProvider) AdminUpdateDeviceStatusRequest(input *AdminUpd // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminUpdateDeviceStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidUserPoolConfigurationException "InvalidUserPoolConfigurationException" +// * InvalidUserPoolConfigurationException // This exception is thrown when the user pool configuration is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminUpdateDeviceStatus @@ -2939,7 +2961,7 @@ func (c *CognitoIdentityProvider) AdminUpdateUserAttributesRequest(input *AdminU // In addition to updating user attributes, this API can also be used to mark // phone and email as verified. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2948,55 +2970,55 @@ func (c *CognitoIdentityProvider) AdminUpdateUserAttributesRequest(input *AdminU // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminUpdateUserAttributes for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException" +// * UnexpectedLambdaException // This exception is thrown when the Amazon Cognito service encounters an unexpected // exception with the AWS Lambda service. // -// * ErrCodeUserLambdaValidationException "UserLambdaValidationException" +// * UserLambdaValidationException // This exception is thrown when the Amazon Cognito service encounters a user // validation exception with the AWS Lambda service. // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodeAliasExistsException "AliasExistsException" +// * AliasExistsException // This exception is thrown when a user tries to confirm the account with an // email or phone number that has already been supplied as an alias from a different // account. This exception tells user that an account with this email or phone // already exists. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // -// * ErrCodeInvalidSmsRoleAccessPolicyException "InvalidSmsRoleAccessPolicyException" +// * InvalidSmsRoleAccessPolicyException // This exception is returned when the role provided for SMS configuration does // not have permission to publish using Amazon SNS. // -// * ErrCodeInvalidEmailRoleAccessPolicyException "InvalidEmailRoleAccessPolicyException" +// * InvalidEmailRoleAccessPolicyException // This exception is thrown when Amazon Cognito is not allowed to use your email // identity. HTTP status code: 400. // -// * ErrCodeInvalidSmsRoleTrustRelationshipException "InvalidSmsRoleTrustRelationshipException" +// * InvalidSmsRoleTrustRelationshipException // This exception is thrown when the trust relationship is invalid for the role // provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com // or the external ID provided in the role does not match what is provided in @@ -3069,9 +3091,12 @@ func (c *CognitoIdentityProvider) AdminUserGlobalSignOutRequest(input *AdminUser // AdminUserGlobalSignOut API operation for Amazon Cognito Identity Provider. // -// Signs out users from all devices, as an administrator. +// Signs out users from all devices, as an administrator. It also invalidates +// all refresh tokens issued to a user. The user's current access and Id tokens +// remain valid until their expiry. Access and Id tokens expire one hour after +// they are issued. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3080,26 +3105,26 @@ func (c *CognitoIdentityProvider) AdminUserGlobalSignOutRequest(input *AdminUser // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AdminUserGlobalSignOut for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/AdminUserGlobalSignOut @@ -3178,22 +3203,22 @@ func (c *CognitoIdentityProvider) AssociateSoftwareTokenRequest(input *Associate // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation AssociateSoftwareToken for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // -// * ErrCodeSoftwareTokenMFANotFoundException "SoftwareTokenMFANotFoundException" +// * SoftwareTokenMFANotFoundException // This exception is thrown when the software token TOTP multi-factor authentication // (MFA) is not enabled for the user pool. // @@ -3274,40 +3299,40 @@ func (c *CognitoIdentityProvider) ChangePasswordRequest(input *ChangePasswordInp // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ChangePassword for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeInvalidPasswordException "InvalidPasswordException" +// * InvalidPasswordException // This exception is thrown when the Amazon Cognito service encounters an invalid // password. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ChangePassword @@ -3386,47 +3411,47 @@ func (c *CognitoIdentityProvider) ConfirmDeviceRequest(input *ConfirmDeviceInput // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ConfirmDevice for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInvalidPasswordException "InvalidPasswordException" +// * InvalidPasswordException // This exception is thrown when the Amazon Cognito service encounters an invalid // password. // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodeUsernameExistsException "UsernameExistsException" +// * UsernameExistsException // This exception is thrown when Amazon Cognito encounters a user name that // already exists in the user pool. // -// * ErrCodeInvalidUserPoolConfigurationException "InvalidUserPoolConfigurationException" +// * InvalidUserPoolConfigurationException // This exception is thrown when the user pool configuration is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ConfirmDevice @@ -3506,60 +3531,60 @@ func (c *CognitoIdentityProvider) ConfirmForgotPasswordRequest(input *ConfirmFor // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ConfirmForgotPassword for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException" +// * UnexpectedLambdaException // This exception is thrown when the Amazon Cognito service encounters an unexpected // exception with the AWS Lambda service. // -// * ErrCodeUserLambdaValidationException "UserLambdaValidationException" +// * UserLambdaValidationException // This exception is thrown when the Amazon Cognito service encounters a user // validation exception with the AWS Lambda service. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeInvalidPasswordException "InvalidPasswordException" +// * InvalidPasswordException // This exception is thrown when the Amazon Cognito service encounters an invalid // password. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeCodeMismatchException "CodeMismatchException" +// * CodeMismatchException // This exception is thrown if the provided code does not match what the server // was expecting. // -// * ErrCodeExpiredCodeException "ExpiredCodeException" +// * ExpiredCodeException // This exception is thrown if a code has expired. // -// * ErrCodeTooManyFailedAttemptsException "TooManyFailedAttemptsException" +// * TooManyFailedAttemptsException // This exception is thrown when the user has made too many failed attempts // for a given action (e.g., sign in). // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ConfirmForgotPassword @@ -3640,59 +3665,59 @@ func (c *CognitoIdentityProvider) ConfirmSignUpRequest(input *ConfirmSignUpInput // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ConfirmSignUp for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException" +// * UnexpectedLambdaException // This exception is thrown when the Amazon Cognito service encounters an unexpected // exception with the AWS Lambda service. // -// * ErrCodeUserLambdaValidationException "UserLambdaValidationException" +// * UserLambdaValidationException // This exception is thrown when the Amazon Cognito service encounters a user // validation exception with the AWS Lambda service. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyFailedAttemptsException "TooManyFailedAttemptsException" +// * TooManyFailedAttemptsException // This exception is thrown when the user has made too many failed attempts // for a given action (e.g., sign in). // -// * ErrCodeCodeMismatchException "CodeMismatchException" +// * CodeMismatchException // This exception is thrown if the provided code does not match what the server // was expecting. // -// * ErrCodeExpiredCodeException "ExpiredCodeException" +// * ExpiredCodeException // This exception is thrown if a code has expired. // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodeAliasExistsException "AliasExistsException" +// * AliasExistsException // This exception is thrown when a user tries to confirm the account with an // email or phone number that has already been supplied as an alias from a different // account. This exception tells user that an account with this email or phone // already exists. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ConfirmSignUp @@ -3763,7 +3788,7 @@ func (c *CognitoIdentityProvider) CreateGroupRequest(input *CreateGroupInput) (r // // Creates a new group in the specified user pool. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3772,31 +3797,31 @@ func (c *CognitoIdentityProvider) CreateGroupRequest(input *CreateGroupInput) (r // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation CreateGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeGroupExistsException "GroupExistsException" +// * GroupExistsException // This exception is thrown when Amazon Cognito encounters a group that already // exists in the user pool. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateGroup @@ -3874,31 +3899,31 @@ func (c *CognitoIdentityProvider) CreateIdentityProviderRequest(input *CreateIde // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation CreateIdentityProvider for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeDuplicateProviderException "DuplicateProviderException" +// * DuplicateProviderException // This exception is thrown when the provider is already supported by the user // pool. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateIdentityProvider @@ -3976,27 +4001,27 @@ func (c *CognitoIdentityProvider) CreateResourceServerRequest(input *CreateResou // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation CreateResourceServer for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateResourceServer @@ -4074,30 +4099,30 @@ func (c *CognitoIdentityProvider) CreateUserImportJobRequest(input *CreateUserIm // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation CreateUserImportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" +// * PreconditionNotMetException // This exception is thrown when a precondition is not met. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserImportJob @@ -4176,40 +4201,40 @@ func (c *CognitoIdentityProvider) CreateUserPoolRequest(input *CreateUserPoolInp // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation CreateUserPool for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodeInvalidSmsRoleAccessPolicyException "InvalidSmsRoleAccessPolicyException" +// * InvalidSmsRoleAccessPolicyException // This exception is returned when the role provided for SMS configuration does // not have permission to publish using Amazon SNS. // -// * ErrCodeInvalidSmsRoleTrustRelationshipException "InvalidSmsRoleTrustRelationshipException" +// * InvalidSmsRoleTrustRelationshipException // This exception is thrown when the trust relationship is invalid for the role // provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com // or the external ID provided in the role does not match what is provided in // the SMS configuration for the user pool. // -// * ErrCodeInvalidEmailRoleAccessPolicyException "InvalidEmailRoleAccessPolicyException" +// * InvalidEmailRoleAccessPolicyException // This exception is thrown when Amazon Cognito is not allowed to use your email // identity. HTTP status code: 400. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserPoolTaggingException "UserPoolTaggingException" +// * UserPoolTaggingException // This exception is thrown when a user pool tag cannot be set or updated. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserPool @@ -4287,33 +4312,33 @@ func (c *CognitoIdentityProvider) CreateUserPoolClientRequest(input *CreateUserP // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation CreateUserPoolClient for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeScopeDoesNotExistException "ScopeDoesNotExistException" +// * ScopeDoesNotExistException // This exception is thrown when the specified scope does not exist. // -// * ErrCodeInvalidOAuthFlowException "InvalidOAuthFlowException" +// * InvalidOAuthFlowException // This exception is thrown when the specified OAuth flow is invalid. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserPoolClient @@ -4391,23 +4416,23 @@ func (c *CognitoIdentityProvider) CreateUserPoolDomainRequest(input *CreateUserP // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation CreateUserPoolDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/CreateUserPoolDomain @@ -4479,7 +4504,7 @@ func (c *CognitoIdentityProvider) DeleteGroupRequest(input *DeleteGroupInput) (r // // Deletes a group. Currently only groups with no members can be deleted. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4488,23 +4513,23 @@ func (c *CognitoIdentityProvider) DeleteGroupRequest(input *DeleteGroupInput) (r // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation DeleteGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteGroup @@ -4583,26 +4608,26 @@ func (c *CognitoIdentityProvider) DeleteIdentityProviderRequest(input *DeleteIde // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation DeleteIdentityProvider for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeUnsupportedIdentityProviderException "UnsupportedIdentityProviderException" +// * UnsupportedIdentityProviderException // This exception is thrown when the specified identifier is not supported. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteIdentityProvider @@ -4681,23 +4706,23 @@ func (c *CognitoIdentityProvider) DeleteResourceServerRequest(input *DeleteResou // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation DeleteResourceServer for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteResourceServer @@ -4777,32 +4802,32 @@ func (c *CognitoIdentityProvider) DeleteUserRequest(input *DeleteUserInput) (req // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation DeleteUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUser @@ -4882,32 +4907,32 @@ func (c *CognitoIdentityProvider) DeleteUserAttributesRequest(input *DeleteUserA // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation DeleteUserAttributes for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserAttributes @@ -4986,27 +5011,27 @@ func (c *CognitoIdentityProvider) DeleteUserPoolRequest(input *DeleteUserPoolInp // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation DeleteUserPool for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserImportInProgressException "UserImportInProgressException" +// * UserImportInProgressException // This exception is thrown when you are trying to modify a user pool while // a user import job is in progress for that pool. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserPool @@ -5085,23 +5110,23 @@ func (c *CognitoIdentityProvider) DeleteUserPoolClientRequest(input *DeleteUserP // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation DeleteUserPoolClient for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserPoolClient @@ -5180,19 +5205,19 @@ func (c *CognitoIdentityProvider) DeleteUserPoolDomainRequest(input *DeleteUserP // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation DeleteUserPoolDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// Returned Error Types: +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DeleteUserPoolDomain @@ -5270,23 +5295,23 @@ func (c *CognitoIdentityProvider) DescribeIdentityProviderRequest(input *Describ // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation DescribeIdentityProvider for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeIdentityProvider @@ -5364,23 +5389,23 @@ func (c *CognitoIdentityProvider) DescribeResourceServerRequest(input *DescribeR // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation DescribeResourceServer for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeResourceServer @@ -5458,26 +5483,26 @@ func (c *CognitoIdentityProvider) DescribeRiskConfigurationRequest(input *Descri // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation DescribeRiskConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserPoolAddOnNotEnabledException "UserPoolAddOnNotEnabledException" +// * UserPoolAddOnNotEnabledException // This exception is thrown when user pool add-ons are not enabled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeRiskConfiguration @@ -5555,23 +5580,23 @@ func (c *CognitoIdentityProvider) DescribeUserImportJobRequest(input *DescribeUs // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation DescribeUserImportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserImportJob @@ -5650,26 +5675,26 @@ func (c *CognitoIdentityProvider) DescribeUserPoolRequest(input *DescribeUserPoo // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation DescribeUserPool for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserPoolTaggingException "UserPoolTaggingException" +// * UserPoolTaggingException // This exception is thrown when a user pool tag cannot be set or updated. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserPool @@ -5748,23 +5773,23 @@ func (c *CognitoIdentityProvider) DescribeUserPoolClientRequest(input *DescribeU // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation DescribeUserPoolClient for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserPoolClient @@ -5842,19 +5867,19 @@ func (c *CognitoIdentityProvider) DescribeUserPoolDomainRequest(input *DescribeU // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation DescribeUserPoolDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// Returned Error Types: +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/DescribeUserPoolDomain @@ -5933,35 +5958,35 @@ func (c *CognitoIdentityProvider) ForgetDeviceRequest(input *ForgetDeviceInput) // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ForgetDevice for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInvalidUserPoolConfigurationException "InvalidUserPoolConfigurationException" +// * InvalidUserPoolConfigurationException // This exception is thrown when the user pool configuration is invalid. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ForgetDevice @@ -6046,62 +6071,62 @@ func (c *CognitoIdentityProvider) ForgotPasswordRequest(input *ForgotPasswordInp // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ForgotPassword for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException" +// * UnexpectedLambdaException // This exception is thrown when the Amazon Cognito service encounters an unexpected // exception with the AWS Lambda service. // -// * ErrCodeUserLambdaValidationException "UserLambdaValidationException" +// * UserLambdaValidationException // This exception is thrown when the Amazon Cognito service encounters a user // validation exception with the AWS Lambda service. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodeInvalidSmsRoleAccessPolicyException "InvalidSmsRoleAccessPolicyException" +// * InvalidSmsRoleAccessPolicyException // This exception is returned when the role provided for SMS configuration does // not have permission to publish using Amazon SNS. // -// * ErrCodeInvalidSmsRoleTrustRelationshipException "InvalidSmsRoleTrustRelationshipException" +// * InvalidSmsRoleTrustRelationshipException // This exception is thrown when the trust relationship is invalid for the role // provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com // or the external ID provided in the role does not match what is provided in // the SMS configuration for the user pool. // -// * ErrCodeInvalidEmailRoleAccessPolicyException "InvalidEmailRoleAccessPolicyException" +// * InvalidEmailRoleAccessPolicyException // This exception is thrown when Amazon Cognito is not allowed to use your email // identity. HTTP status code: 400. // -// * ErrCodeCodeDeliveryFailureException "CodeDeliveryFailureException" +// * CodeDeliveryFailureException // This exception is thrown when a verification code fails to deliver successfully. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ForgotPassword @@ -6180,23 +6205,23 @@ func (c *CognitoIdentityProvider) GetCSVHeaderRequest(input *GetCSVHeaderInput) // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation GetCSVHeader for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetCSVHeader @@ -6274,35 +6299,35 @@ func (c *CognitoIdentityProvider) GetDeviceRequest(input *GetDeviceInput) (req * // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation GetDevice for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeInvalidUserPoolConfigurationException "InvalidUserPoolConfigurationException" +// * InvalidUserPoolConfigurationException // This exception is thrown when the user pool configuration is invalid. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetDevice @@ -6373,7 +6398,7 @@ func (c *CognitoIdentityProvider) GetGroupRequest(input *GetGroupInput) (req *re // // Gets a group. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6382,23 +6407,23 @@ func (c *CognitoIdentityProvider) GetGroupRequest(input *GetGroupInput) (req *re // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation GetGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetGroup @@ -6476,23 +6501,23 @@ func (c *CognitoIdentityProvider) GetIdentityProviderByIdentifierRequest(input * // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation GetIdentityProviderByIdentifier for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetIdentityProviderByIdentifier @@ -6570,11 +6595,15 @@ func (c *CognitoIdentityProvider) GetSigningCertificateRequest(input *GetSigning // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation GetSigningCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * InvalidParameterException +// This exception is thrown when the Amazon Cognito service encounters an invalid +// parameter. +// +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // @@ -6656,23 +6685,23 @@ func (c *CognitoIdentityProvider) GetUICustomizationRequest(input *GetUICustomiz // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation GetUICustomization for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUICustomization @@ -6751,32 +6780,32 @@ func (c *CognitoIdentityProvider) GetUserRequest(input *GetUserInput) (req *requ // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation GetUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUser @@ -6855,65 +6884,65 @@ func (c *CognitoIdentityProvider) GetUserAttributeVerificationCodeRequest(input // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation GetUserAttributeVerificationCode for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException" +// * UnexpectedLambdaException // This exception is thrown when the Amazon Cognito service encounters an unexpected // exception with the AWS Lambda service. // -// * ErrCodeUserLambdaValidationException "UserLambdaValidationException" +// * UserLambdaValidationException // This exception is thrown when the Amazon Cognito service encounters a user // validation exception with the AWS Lambda service. // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodeInvalidSmsRoleAccessPolicyException "InvalidSmsRoleAccessPolicyException" +// * InvalidSmsRoleAccessPolicyException // This exception is returned when the role provided for SMS configuration does // not have permission to publish using Amazon SNS. // -// * ErrCodeInvalidSmsRoleTrustRelationshipException "InvalidSmsRoleTrustRelationshipException" +// * InvalidSmsRoleTrustRelationshipException // This exception is thrown when the trust relationship is invalid for the role // provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com // or the external ID provided in the role does not match what is provided in // the SMS configuration for the user pool. // -// * ErrCodeInvalidEmailRoleAccessPolicyException "InvalidEmailRoleAccessPolicyException" +// * InvalidEmailRoleAccessPolicyException // This exception is thrown when Amazon Cognito is not allowed to use your email // identity. HTTP status code: 400. // -// * ErrCodeCodeDeliveryFailureException "CodeDeliveryFailureException" +// * CodeDeliveryFailureException // This exception is thrown when a verification code fails to deliver successfully. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUserAttributeVerificationCode @@ -6991,23 +7020,23 @@ func (c *CognitoIdentityProvider) GetUserPoolMfaConfigRequest(input *GetUserPool // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation GetUserPoolMfaConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GetUserPoolMfaConfig @@ -7077,7 +7106,9 @@ func (c *CognitoIdentityProvider) GlobalSignOutRequest(input *GlobalSignOutInput // GlobalSignOut API operation for Amazon Cognito Identity Provider. // -// Signs out users from all devices. +// Signs out users from all devices. It also invalidates all refresh tokens +// issued to a user. The user's current access and Id tokens remain valid until +// their expiry. Access and Id tokens expire one hour after they are issued. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -7086,29 +7117,29 @@ func (c *CognitoIdentityProvider) GlobalSignOutRequest(input *GlobalSignOutInput // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation GlobalSignOut for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/GlobalSignOut @@ -7186,49 +7217,59 @@ func (c *CognitoIdentityProvider) InitiateAuthRequest(input *InitiateAuthInput) // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation InitiateAuth for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException" +// * UnexpectedLambdaException // This exception is thrown when the Amazon Cognito service encounters an unexpected // exception with the AWS Lambda service. // -// * ErrCodeInvalidUserPoolConfigurationException "InvalidUserPoolConfigurationException" +// * InvalidUserPoolConfigurationException // This exception is thrown when the user pool configuration is invalid. // -// * ErrCodeUserLambdaValidationException "UserLambdaValidationException" +// * UserLambdaValidationException // This exception is thrown when the Amazon Cognito service encounters a user // validation exception with the AWS Lambda service. // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // +// * InvalidSmsRoleAccessPolicyException +// This exception is returned when the role provided for SMS configuration does +// not have permission to publish using Amazon SNS. +// +// * InvalidSmsRoleTrustRelationshipException +// This exception is thrown when the trust relationship is invalid for the role +// provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com +// or the external ID provided in the role does not match what is provided in +// the SMS configuration for the user pool. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/InitiateAuth func (c *CognitoIdentityProvider) InitiateAuth(input *InitiateAuthInput) (*InitiateAuthOutput, error) { req, out := c.InitiateAuthRequest(input) @@ -7304,35 +7345,35 @@ func (c *CognitoIdentityProvider) ListDevicesRequest(input *ListDevicesInput) (r // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ListDevices for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInvalidUserPoolConfigurationException "InvalidUserPoolConfigurationException" +// * InvalidUserPoolConfigurationException // This exception is thrown when the user pool configuration is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListDevices @@ -7409,7 +7450,7 @@ func (c *CognitoIdentityProvider) ListGroupsRequest(input *ListGroupsInput) (req // // Lists the groups associated with a user pool. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -7418,23 +7459,23 @@ func (c *CognitoIdentityProvider) ListGroupsRequest(input *ListGroupsInput) (req // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ListGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListGroups @@ -7502,10 +7543,12 @@ func (c *CognitoIdentityProvider) ListGroupsPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7568,23 +7611,23 @@ func (c *CognitoIdentityProvider) ListIdentityProvidersRequest(input *ListIdenti // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ListIdentityProviders for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListIdentityProviders @@ -7652,10 +7695,12 @@ func (c *CognitoIdentityProvider) ListIdentityProvidersPagesWithContext(ctx aws. }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListIdentityProvidersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListIdentityProvidersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7718,23 +7763,23 @@ func (c *CognitoIdentityProvider) ListResourceServersRequest(input *ListResource // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ListResourceServers for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListResourceServers @@ -7802,10 +7847,12 @@ func (c *CognitoIdentityProvider) ListResourceServersPagesWithContext(ctx aws.Co }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListResourceServersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListResourceServersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7868,23 +7915,23 @@ func (c *CognitoIdentityProvider) ListTagsForResourceRequest(input *ListTagsForR // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListTagsForResource @@ -7962,23 +8009,23 @@ func (c *CognitoIdentityProvider) ListUserImportJobsRequest(input *ListUserImpor // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ListUserImportJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUserImportJobs @@ -8062,23 +8109,23 @@ func (c *CognitoIdentityProvider) ListUserPoolClientsRequest(input *ListUserPool // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ListUserPoolClients for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUserPoolClients @@ -8146,10 +8193,12 @@ func (c *CognitoIdentityProvider) ListUserPoolClientsPagesWithContext(ctx aws.Co }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListUserPoolClientsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListUserPoolClientsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8212,19 +8261,19 @@ func (c *CognitoIdentityProvider) ListUserPoolsRequest(input *ListUserPoolsInput // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ListUserPools for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUserPools @@ -8292,10 +8341,12 @@ func (c *CognitoIdentityProvider) ListUserPoolsPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListUserPoolsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListUserPoolsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8330,6 +8381,12 @@ func (c *CognitoIdentityProvider) ListUsersRequest(input *ListUsersInput) (req * Name: opListUsers, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"PaginationToken"}, + OutputTokens: []string{"PaginationToken"}, + LimitToken: "Limit", + TruncationToken: "", + }, } if input == nil { @@ -8352,23 +8409,23 @@ func (c *CognitoIdentityProvider) ListUsersRequest(input *ListUsersInput) (req * // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ListUsers for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUsers @@ -8393,6 +8450,58 @@ func (c *CognitoIdentityProvider) ListUsersWithContext(ctx aws.Context, input *L return out, req.Send() } +// 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 *cognitoidentityprovider.ListUsersOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *CognitoIdentityProvider) ListUsersPages(input *ListUsersInput, fn func(*ListUsersOutput, bool) bool) error { + return c.ListUsersPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListUsersPagesWithContext same as ListUsersPages 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 *CognitoIdentityProvider) ListUsersPagesWithContext(ctx aws.Context, input *ListUsersInput, fn func(*ListUsersOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListUsersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListUsersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListUsersOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opListUsersInGroup = "ListUsersInGroup" // ListUsersInGroupRequest generates a "aws/request.Request" representing the @@ -8445,7 +8554,7 @@ func (c *CognitoIdentityProvider) ListUsersInGroupRequest(input *ListUsersInGrou // // Lists the users in the specified group. // -// Requires developer credentials. +// Calling this action requires developer credentials. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -8454,23 +8563,23 @@ func (c *CognitoIdentityProvider) ListUsersInGroupRequest(input *ListUsersInGrou // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ListUsersInGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ListUsersInGroup @@ -8538,10 +8647,12 @@ func (c *CognitoIdentityProvider) ListUsersInGroupPagesWithContext(ctx aws.Conte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListUsersInGroupOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListUsersInGroupOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8600,59 +8711,59 @@ func (c *CognitoIdentityProvider) ResendConfirmationCodeRequest(input *ResendCon // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation ResendConfirmationCode for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException" +// * UnexpectedLambdaException // This exception is thrown when the Amazon Cognito service encounters an unexpected // exception with the AWS Lambda service. // -// * ErrCodeUserLambdaValidationException "UserLambdaValidationException" +// * UserLambdaValidationException // This exception is thrown when the Amazon Cognito service encounters a user // validation exception with the AWS Lambda service. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodeInvalidSmsRoleAccessPolicyException "InvalidSmsRoleAccessPolicyException" +// * InvalidSmsRoleAccessPolicyException // This exception is returned when the role provided for SMS configuration does // not have permission to publish using Amazon SNS. // -// * ErrCodeInvalidSmsRoleTrustRelationshipException "InvalidSmsRoleTrustRelationshipException" +// * InvalidSmsRoleTrustRelationshipException // This exception is thrown when the trust relationship is invalid for the role // provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com // or the external ID provided in the role does not match what is provided in // the SMS configuration for the user pool. // -// * ErrCodeInvalidEmailRoleAccessPolicyException "InvalidEmailRoleAccessPolicyException" +// * InvalidEmailRoleAccessPolicyException // This exception is thrown when Amazon Cognito is not allowed to use your email // identity. HTTP status code: 400. // -// * ErrCodeCodeDeliveryFailureException "CodeDeliveryFailureException" +// * CodeDeliveryFailureException // This exception is thrown when a verification code fails to deliver successfully. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/ResendConfirmationCode @@ -8730,81 +8841,81 @@ func (c *CognitoIdentityProvider) RespondToAuthChallengeRequest(input *RespondTo // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation RespondToAuthChallenge for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeCodeMismatchException "CodeMismatchException" +// * CodeMismatchException // This exception is thrown if the provided code does not match what the server // was expecting. // -// * ErrCodeExpiredCodeException "ExpiredCodeException" +// * ExpiredCodeException // This exception is thrown if a code has expired. // -// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException" +// * UnexpectedLambdaException // This exception is thrown when the Amazon Cognito service encounters an unexpected // exception with the AWS Lambda service. // -// * ErrCodeUserLambdaValidationException "UserLambdaValidationException" +// * UserLambdaValidationException // This exception is thrown when the Amazon Cognito service encounters a user // validation exception with the AWS Lambda service. // -// * ErrCodeInvalidPasswordException "InvalidPasswordException" +// * InvalidPasswordException // This exception is thrown when the Amazon Cognito service encounters an invalid // password. // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInvalidUserPoolConfigurationException "InvalidUserPoolConfigurationException" +// * InvalidUserPoolConfigurationException // This exception is thrown when the user pool configuration is invalid. // -// * ErrCodeMFAMethodNotFoundException "MFAMethodNotFoundException" +// * MFAMethodNotFoundException // This exception is thrown when Amazon Cognito cannot find a multi-factor authentication // (MFA) method. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInvalidSmsRoleAccessPolicyException "InvalidSmsRoleAccessPolicyException" +// * InvalidSmsRoleAccessPolicyException // This exception is returned when the role provided for SMS configuration does // not have permission to publish using Amazon SNS. // -// * ErrCodeInvalidSmsRoleTrustRelationshipException "InvalidSmsRoleTrustRelationshipException" +// * InvalidSmsRoleTrustRelationshipException // This exception is thrown when the trust relationship is invalid for the role // provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com // or the external ID provided in the role does not match what is provided in // the SMS configuration for the user pool. // -// * ErrCodeAliasExistsException "AliasExistsException" +// * AliasExistsException // This exception is thrown when a user tries to confirm the account with an // email or phone number that has already been supplied as an alias from a different // account. This exception tells user that an account with this email or phone // already exists. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // -// * ErrCodeSoftwareTokenMFANotFoundException "SoftwareTokenMFANotFoundException" +// * SoftwareTokenMFANotFoundException // This exception is thrown when the software token TOTP multi-factor authentication // (MFA) is not enabled for the user pool. // @@ -8889,33 +9000,33 @@ func (c *CognitoIdentityProvider) SetRiskConfigurationRequest(input *SetRiskConf // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation SetRiskConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserPoolAddOnNotEnabledException "UserPoolAddOnNotEnabledException" +// * UserPoolAddOnNotEnabledException // This exception is thrown when user pool add-ons are not enabled. // -// * ErrCodeCodeDeliveryFailureException "CodeDeliveryFailureException" +// * CodeDeliveryFailureException // This exception is thrown when a verification code fails to deliver successfully. // -// * ErrCodeInvalidEmailRoleAccessPolicyException "InvalidEmailRoleAccessPolicyException" +// * InvalidEmailRoleAccessPolicyException // This exception is thrown when Amazon Cognito is not allowed to use your email // identity. HTTP status code: 400. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetRiskConfiguration @@ -9004,23 +9115,23 @@ func (c *CognitoIdentityProvider) SetUICustomizationRequest(input *SetUICustomiz // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation SetUICustomization for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUICustomization @@ -9090,7 +9201,12 @@ func (c *CognitoIdentityProvider) SetUserMFAPreferenceRequest(input *SetUserMFAP // SetUserMFAPreference API operation for Amazon Cognito Identity Provider. // -// Set the user's multi-factor authentication (MFA) method preference. +// Set the user's multi-factor authentication (MFA) method preference, including +// which MFA factors are enabled and if any are preferred. Only one factor can +// be set as preferred. The preferred MFA factor will be used to authenticate +// a user if multiple factors are enabled. If multiple options are enabled and +// no preference is set, a challenge to choose an MFA option will be returned +// during sign in. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -9099,28 +9215,28 @@ func (c *CognitoIdentityProvider) SetUserMFAPreferenceRequest(input *SetUserMFAP // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation SetUserMFAPreference for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUserMFAPreference @@ -9189,7 +9305,7 @@ func (c *CognitoIdentityProvider) SetUserPoolMfaConfigRequest(input *SetUserPool // SetUserPoolMfaConfig API operation for Amazon Cognito Identity Provider. // -// Set the user pool MFA configuration. +// Set the user pool multi-factor authentication (MFA) 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 @@ -9198,33 +9314,33 @@ func (c *CognitoIdentityProvider) SetUserPoolMfaConfigRequest(input *SetUserPool // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation SetUserPoolMfaConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidSmsRoleAccessPolicyException "InvalidSmsRoleAccessPolicyException" +// * InvalidSmsRoleAccessPolicyException // This exception is returned when the role provided for SMS configuration does // not have permission to publish using Amazon SNS. // -// * ErrCodeInvalidSmsRoleTrustRelationshipException "InvalidSmsRoleTrustRelationshipException" +// * InvalidSmsRoleTrustRelationshipException // This exception is thrown when the trust relationship is invalid for the role // provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com // or the external ID provided in the role does not match what is provided in // the SMS configuration for the user pool. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUserPoolMfaConfig @@ -9295,9 +9411,9 @@ func (c *CognitoIdentityProvider) SetUserSettingsRequest(input *SetUserSettingsI // SetUserSettings API operation for Amazon Cognito Identity Provider. // -// Sets the user settings like multi-factor authentication (MFA). If MFA is -// to be removed for a particular attribute pass the attribute with code delivery -// as null. If null list is passed, all MFA options are removed. +// This action is no longer supported. You can use it to configure only SMS +// MFA. You can't use it to configure TOTP software token MFA. To configure +// either type of MFA, use the SetUserMFAPreference action 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 @@ -9306,28 +9422,28 @@ func (c *CognitoIdentityProvider) SetUserSettingsRequest(input *SetUserSettingsI // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation SetUserSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SetUserSettings @@ -9407,60 +9523,60 @@ func (c *CognitoIdentityProvider) SignUpRequest(input *SignUpInput) (req *reques // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation SignUp for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException" +// * UnexpectedLambdaException // This exception is thrown when the Amazon Cognito service encounters an unexpected // exception with the AWS Lambda service. // -// * ErrCodeUserLambdaValidationException "UserLambdaValidationException" +// * UserLambdaValidationException // This exception is thrown when the Amazon Cognito service encounters a user // validation exception with the AWS Lambda service. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInvalidPasswordException "InvalidPasswordException" +// * InvalidPasswordException // This exception is thrown when the Amazon Cognito service encounters an invalid // password. // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodeUsernameExistsException "UsernameExistsException" +// * UsernameExistsException // This exception is thrown when Amazon Cognito encounters a user name that // already exists in the user pool. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // -// * ErrCodeInvalidSmsRoleAccessPolicyException "InvalidSmsRoleAccessPolicyException" +// * InvalidSmsRoleAccessPolicyException // This exception is returned when the role provided for SMS configuration does // not have permission to publish using Amazon SNS. // -// * ErrCodeInvalidSmsRoleTrustRelationshipException "InvalidSmsRoleTrustRelationshipException" +// * InvalidSmsRoleTrustRelationshipException // This exception is thrown when the trust relationship is invalid for the role // provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com // or the external ID provided in the role does not match what is provided in // the SMS configuration for the user pool. // -// * ErrCodeInvalidEmailRoleAccessPolicyException "InvalidEmailRoleAccessPolicyException" +// * InvalidEmailRoleAccessPolicyException // This exception is thrown when Amazon Cognito is not allowed to use your email // identity. HTTP status code: 400. // -// * ErrCodeCodeDeliveryFailureException "CodeDeliveryFailureException" +// * CodeDeliveryFailureException // This exception is thrown when a verification code fails to deliver successfully. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/SignUp @@ -9538,26 +9654,26 @@ func (c *CognitoIdentityProvider) StartUserImportJobRequest(input *StartUserImpo // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation StartUserImportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" +// * PreconditionNotMetException // This exception is thrown when a precondition is not met. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/StartUserImportJob @@ -9635,26 +9751,26 @@ func (c *CognitoIdentityProvider) StopUserImportJobRequest(input *StopUserImport // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation StopUserImportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" +// * PreconditionNotMetException // This exception is thrown when a precondition is not met. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/StopUserImportJob @@ -9750,23 +9866,23 @@ func (c *CognitoIdentityProvider) TagResourceRequest(input *TagResourceInput) (r // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/TagResource @@ -9846,23 +9962,23 @@ func (c *CognitoIdentityProvider) UntagResourceRequest(input *UntagResourceInput // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UntagResource @@ -9943,29 +10059,29 @@ func (c *CognitoIdentityProvider) UpdateAuthEventFeedbackRequest(input *UpdateAu // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation UpdateAuthEventFeedback for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserPoolAddOnNotEnabledException "UserPoolAddOnNotEnabledException" +// * UserPoolAddOnNotEnabledException // This exception is thrown when user pool add-ons are not enabled. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateAuthEventFeedback @@ -10044,35 +10160,35 @@ func (c *CognitoIdentityProvider) UpdateDeviceStatusRequest(input *UpdateDeviceS // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation UpdateDeviceStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInvalidUserPoolConfigurationException "InvalidUserPoolConfigurationException" +// * InvalidUserPoolConfigurationException // This exception is thrown when the user pool configuration is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateDeviceStatus @@ -10143,7 +10259,10 @@ func (c *CognitoIdentityProvider) UpdateGroupRequest(input *UpdateGroupInput) (r // // Updates the specified group with the specified attributes. // -// Requires developer credentials. +// Calling this action requires developer credentials. +// +// If you don't provide a value for an attribute, it will be set to the default +// 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 @@ -10152,23 +10271,23 @@ func (c *CognitoIdentityProvider) UpdateGroupRequest(input *UpdateGroupInput) (r // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation UpdateGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateGroup @@ -10246,26 +10365,26 @@ func (c *CognitoIdentityProvider) UpdateIdentityProviderRequest(input *UpdateIde // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation UpdateIdentityProvider for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeUnsupportedIdentityProviderException "UnsupportedIdentityProviderException" +// * UnsupportedIdentityProviderException // This exception is thrown when the specified identifier is not supported. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateIdentityProvider @@ -10336,6 +10455,9 @@ func (c *CognitoIdentityProvider) UpdateResourceServerRequest(input *UpdateResou // // Updates the name and scopes of resource server. All other fields are read-only. // +// If you don't provide a value for an attribute, it will be set to the default +// 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. @@ -10343,23 +10465,23 @@ func (c *CognitoIdentityProvider) UpdateResourceServerRequest(input *UpdateResou // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation UpdateResourceServer for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateResourceServer @@ -10438,74 +10560,74 @@ func (c *CognitoIdentityProvider) UpdateUserAttributesRequest(input *UpdateUserA // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation UpdateUserAttributes for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeCodeMismatchException "CodeMismatchException" +// * CodeMismatchException // This exception is thrown if the provided code does not match what the server // was expecting. // -// * ErrCodeExpiredCodeException "ExpiredCodeException" +// * ExpiredCodeException // This exception is thrown if a code has expired. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUnexpectedLambdaException "UnexpectedLambdaException" +// * UnexpectedLambdaException // This exception is thrown when the Amazon Cognito service encounters an unexpected // exception with the AWS Lambda service. // -// * ErrCodeUserLambdaValidationException "UserLambdaValidationException" +// * UserLambdaValidationException // This exception is thrown when the Amazon Cognito service encounters a user // validation exception with the AWS Lambda service. // -// * ErrCodeInvalidLambdaResponseException "InvalidLambdaResponseException" +// * InvalidLambdaResponseException // This exception is thrown when the Amazon Cognito service encounters an invalid // AWS Lambda response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeAliasExistsException "AliasExistsException" +// * AliasExistsException // This exception is thrown when a user tries to confirm the account with an // email or phone number that has already been supplied as an alias from a different // account. This exception tells user that an account with this email or phone // already exists. // -// * ErrCodeInvalidSmsRoleAccessPolicyException "InvalidSmsRoleAccessPolicyException" +// * InvalidSmsRoleAccessPolicyException // This exception is returned when the role provided for SMS configuration does // not have permission to publish using Amazon SNS. // -// * ErrCodeInvalidSmsRoleTrustRelationshipException "InvalidSmsRoleTrustRelationshipException" +// * InvalidSmsRoleTrustRelationshipException // This exception is thrown when the trust relationship is invalid for the role // provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com // or the external ID provided in the role does not match what is provided in // the SMS configuration for the user pool. // -// * ErrCodeInvalidEmailRoleAccessPolicyException "InvalidEmailRoleAccessPolicyException" +// * InvalidEmailRoleAccessPolicyException // This exception is thrown when Amazon Cognito is not allowed to use your email // identity. HTTP status code: 400. // -// * ErrCodeCodeDeliveryFailureException "CodeDeliveryFailureException" +// * CodeDeliveryFailureException // This exception is thrown when a verification code fails to deliver successfully. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateUserAttributes @@ -10575,9 +10697,11 @@ func (c *CognitoIdentityProvider) UpdateUserPoolRequest(input *UpdateUserPoolInp // UpdateUserPool API operation for Amazon Cognito Identity Provider. // -// Updates the specified user pool with the specified attributes. If you don't -// provide a value for an attribute, it will be set to the default value. You -// can get a list of the current user pool settings with . +// Updates the specified user pool with the specified attributes. You can get +// a list of the current user pool settings with . +// +// If you don't provide a value for an attribute, it will be set to the default +// 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 @@ -10586,46 +10710,46 @@ func (c *CognitoIdentityProvider) UpdateUserPoolRequest(input *UpdateUserPoolInp // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation UpdateUserPool for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // This exception is thrown if two or more modifications are happening concurrently. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeUserImportInProgressException "UserImportInProgressException" +// * UserImportInProgressException // This exception is thrown when you are trying to modify a user pool while // a user import job is in progress for that pool. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // -// * ErrCodeInvalidSmsRoleAccessPolicyException "InvalidSmsRoleAccessPolicyException" +// * InvalidSmsRoleAccessPolicyException // This exception is returned when the role provided for SMS configuration does // not have permission to publish using Amazon SNS. // -// * ErrCodeInvalidSmsRoleTrustRelationshipException "InvalidSmsRoleTrustRelationshipException" +// * InvalidSmsRoleTrustRelationshipException // This exception is thrown when the trust relationship is invalid for the role // provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com // or the external ID provided in the role does not match what is provided in // the SMS configuration for the user pool. // -// * ErrCodeUserPoolTaggingException "UserPoolTaggingException" +// * UserPoolTaggingException // This exception is thrown when a user pool tag cannot be set or updated. // -// * ErrCodeInvalidEmailRoleAccessPolicyException "InvalidEmailRoleAccessPolicyException" +// * InvalidEmailRoleAccessPolicyException // This exception is thrown when Amazon Cognito is not allowed to use your email // identity. HTTP status code: 400. // @@ -10696,8 +10820,10 @@ func (c *CognitoIdentityProvider) UpdateUserPoolClientRequest(input *UpdateUserP // UpdateUserPoolClient API operation for Amazon Cognito Identity Provider. // // Updates the specified user pool app client with the specified attributes. +// You can get a list of the current user pool app client settings with . +// // If you don't provide a value for an attribute, it will be set to the default -// value. You can get a list of the current user pool app client settings with . +// 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 @@ -10706,32 +10832,32 @@ func (c *CognitoIdentityProvider) UpdateUserPoolClientRequest(input *UpdateUserP // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation UpdateUserPoolClient for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // This exception is thrown if two or more modifications are happening concurrently. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeScopeDoesNotExistException "ScopeDoesNotExistException" +// * ScopeDoesNotExistException // This exception is thrown when the specified scope does not exist. // -// * ErrCodeInvalidOAuthFlowException "InvalidOAuthFlowException" +// * InvalidOAuthFlowException // This exception is thrown when the specified OAuth flow is invalid. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateUserPoolClient @@ -10837,23 +10963,23 @@ func (c *CognitoIdentityProvider) UpdateUserPoolDomainRequest(input *UpdateUserP // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation UpdateUserPoolDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/UpdateUserPoolDomain @@ -10933,49 +11059,49 @@ func (c *CognitoIdentityProvider) VerifySoftwareTokenRequest(input *VerifySoftwa // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation VerifySoftwareToken for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidUserPoolConfigurationException "InvalidUserPoolConfigurationException" +// * InvalidUserPoolConfigurationException // This exception is thrown when the user pool configuration is invalid. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // -// * ErrCodeEnableSoftwareTokenMFAException "EnableSoftwareTokenMFAException" +// * EnableSoftwareTokenMFAException // This exception is thrown when there is a code mismatch and the service fails // to configure the software token TOTP multi-factor authentication (MFA). // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeSoftwareTokenMFANotFoundException "SoftwareTokenMFANotFoundException" +// * SoftwareTokenMFANotFoundException // This exception is thrown when the software token TOTP multi-factor authentication // (MFA) is not enabled for the user pool. // -// * ErrCodeCodeMismatchException "CodeMismatchException" +// * CodeMismatchException // This exception is thrown if the provided code does not match what the server // was expecting. // @@ -11056,43 +11182,43 @@ func (c *CognitoIdentityProvider) VerifyUserAttributeRequest(input *VerifyUserAt // See the AWS API reference guide for Amazon Cognito Identity Provider's // API operation VerifyUserAttribute for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // This exception is thrown when the Amazon Cognito service cannot find the // requested resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // This exception is thrown when the Amazon Cognito service encounters an invalid // parameter. // -// * ErrCodeCodeMismatchException "CodeMismatchException" +// * CodeMismatchException // This exception is thrown if the provided code does not match what the server // was expecting. // -// * ErrCodeExpiredCodeException "ExpiredCodeException" +// * ExpiredCodeException // This exception is thrown if a code has expired. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // This exception is thrown when a user is not authorized. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // This exception is thrown when the user has made too many requests for a given // operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // This exception is thrown when a user exceeds the limit for a requested AWS // resource. // -// * ErrCodePasswordResetRequiredException "PasswordResetRequiredException" +// * PasswordResetRequiredException // This exception is thrown when a password reset is required. // -// * ErrCodeUserNotFoundException "UserNotFoundException" +// * UserNotFoundException // This exception is thrown when a user is not found. // -// * ErrCodeUserNotConfirmedException "UserNotConfirmedException" +// * UserNotConfirmedException // This exception is thrown when a user is not confirmed successfully. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // This exception is thrown when Amazon Cognito encounters an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cognito-idp-2016-04-18/VerifyUserAttribute @@ -11117,6 +11243,53 @@ func (c *CognitoIdentityProvider) VerifyUserAttributeWithContext(ctx aws.Context return out, req.Send() } +// The data type for AccountRecoverySetting. +type AccountRecoverySettingType struct { + _ struct{} `type:"structure"` + + // The list of RecoveryOptionTypes. + RecoveryMechanisms []*RecoveryOptionType `min:"1" type:"list"` +} + +// String returns the string representation +func (s AccountRecoverySettingType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountRecoverySettingType) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AccountRecoverySettingType) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AccountRecoverySettingType"} + if s.RecoveryMechanisms != nil && len(s.RecoveryMechanisms) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RecoveryMechanisms", 1)) + } + if s.RecoveryMechanisms != nil { + for i, v := range s.RecoveryMechanisms { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RecoveryMechanisms", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRecoveryMechanisms sets the RecoveryMechanisms field's value. +func (s *AccountRecoverySettingType) SetRecoveryMechanisms(v []*RecoveryOptionType) *AccountRecoverySettingType { + s.RecoveryMechanisms = v + return s +} + // Account takeover action type. type AccountTakeoverActionType struct { _ struct{} `type:"structure"` @@ -11483,6 +11656,36 @@ func (s AdminAddUserToGroupOutput) GoString() string { type AdminConfirmSignUpInput struct { _ struct{} `type:"structure"` + // A map of custom key-value pairs that you can provide as input for any custom + // workflows that this action triggers. + // + // If your user pool configuration includes triggers, the AdminConfirmSignUp + // API action invokes the AWS Lambda function that is specified for the post + // confirmation trigger. When Amazon Cognito invokes this function, it passes + // a JSON payload, which the function receives as input. In this payload, the + // clientMetadata attribute provides the data that you assigned to the ClientMetadata + // parameter in your AdminConfirmSignUp request. In your function code in AWS + // Lambda, you can process the ClientMetadata value to enhance your workflow + // for your specific needs. + // + // For more information, see Customizing User Pool Workflows with Lambda Triggers + // (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html) + // in the Amazon Cognito Developer Guide. + // + // Take the following limitations into consideration when you use the ClientMetadata + // parameter: + // + // * Amazon Cognito does not store the ClientMetadata value. This data is + // available only to AWS Lambda triggers that are assigned to a user pool + // to support custom workflows. If your user pool configuration does not + // include triggers, the ClientMetadata parameter serves no purpose. + // + // * Amazon Cognito does not validate the ClientMetadata value. + // + // * Amazon Cognito does not encrypt the the ClientMetadata value, so don't + // use it to provide sensitive information. + ClientMetadata map[string]*string `type:"map"` + // The user pool ID for which you want to confirm user registration. // // UserPoolId is a required field @@ -11526,6 +11729,12 @@ func (s *AdminConfirmSignUpInput) Validate() error { return nil } +// SetClientMetadata sets the ClientMetadata field's value. +func (s *AdminConfirmSignUpInput) SetClientMetadata(v map[string]*string) *AdminConfirmSignUpInput { + s.ClientMetadata = v + return s +} + // SetUserPoolId sets the UserPoolId field's value. func (s *AdminConfirmSignUpInput) SetUserPoolId(v string) *AdminConfirmSignUpInput { s.UserPoolId = &v @@ -11563,7 +11772,7 @@ type AdminCreateUserConfigType struct { // The message template to be used for the welcome message to new users. // - // See also Customizing User Invitation Messages (http://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-message-customizations.html#cognito-user-pool-settings-user-invitation-message-customization). + // See also Customizing User Invitation Messages (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pool-settings-message-customizations.html#cognito-user-pool-settings-user-invitation-message-customization). InviteMessageTemplate *MessageTemplateType `type:"structure"` // The user account expiration limit, in days, after which the account is no @@ -11624,6 +11833,36 @@ func (s *AdminCreateUserConfigType) SetUnusedAccountValidityDays(v int64) *Admin type AdminCreateUserInput struct { _ struct{} `type:"structure"` + // A map of custom key-value pairs that you can provide as input for any custom + // workflows that this action triggers. + // + // You create custom workflows by assigning AWS Lambda functions to user pool + // triggers. When you use the AdminCreateUser API action, Amazon Cognito invokes + // the function that is assigned to the pre sign-up trigger. When Amazon Cognito + // invokes this function, it passes a JSON payload, which the function receives + // as input. This payload contains a clientMetadata attribute, which provides + // the data that you assigned to the ClientMetadata parameter in your AdminCreateUser + // request. In your function code in AWS Lambda, you can process the clientMetadata + // value to enhance your workflow for your specific needs. + // + // For more information, see Customizing User Pool Workflows with Lambda Triggers + // (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html) + // in the Amazon Cognito Developer Guide. + // + // Take the following limitations into consideration when you use the ClientMetadata + // parameter: + // + // * Amazon Cognito does not store the ClientMetadata value. This data is + // available only to AWS Lambda triggers that are assigned to a user pool + // to support custom workflows. If your user pool configuration does not + // include triggers, the ClientMetadata parameter serves no purpose. + // + // * Amazon Cognito does not validate the ClientMetadata value. + // + // * Amazon Cognito does not encrypt the the ClientMetadata value, so don't + // use it to provide sensitive information. + ClientMetadata map[string]*string `type:"map"` + // Specify "EMAIL" if email will be used to send the welcome message. Specify // "SMS" if the phone number will be used. The default value is "SMS". More // than one value can be specified. @@ -11775,6 +12014,12 @@ func (s *AdminCreateUserInput) Validate() error { return nil } +// SetClientMetadata sets the ClientMetadata field's value. +func (s *AdminCreateUserInput) SetClientMetadata(v map[string]*string) *AdminCreateUserInput { + s.ClientMetadata = v + return s +} + // SetDesiredDeliveryMediums sets the DesiredDeliveryMediums field's value. func (s *AdminCreateUserInput) SetDesiredDeliveryMediums(v []*string) *AdminCreateUserInput { s.DesiredDeliveryMediums = v @@ -12493,7 +12738,10 @@ type AdminGetUserOutput struct { // Indicates that the status is enabled. Enabled *bool `type:"boolean"` - // Specifies the options for MFA (e.g., email or phone number). + // This response parameter is no longer supported. It provides information only + // about SMS MFA configurations. It doesn't provide information about TOTP software + // token MFA configurations. To look up information about either type of MFA + // configuration, use the AdminGetUserResponse$UserMFASettingList response instead. MFAOptions []*MFAOptionType `type:"list"` // The user's preferred MFA setting. @@ -12508,7 +12756,8 @@ type AdminGetUserOutput struct { // The date the user was last modified. UserLastModifiedDate *time.Time `type:"timestamp"` - // The list of the user's MFA settings. + // The MFA options that are enabled for the user. The possible values in this + // list are SMS_MFA and SOFTWARE_TOKEN_MFA. UserMFASettingList []*string `type:"list"` // The user status. Can be one of the following: @@ -12640,6 +12889,11 @@ type AdminInitiateAuthInput struct { // will invoke the user migration Lambda if the USERNAME is not found in // the user pool. // + // * ADMIN_USER_PASSWORD_AUTH: Admin-based user password authentication. + // This replaces the ADMIN_NO_SRP_AUTH authentication flow. In this flow, + // Cognito receives the password in the request instead of using the SRP + // process to verify passwords. + // // AuthFlow is a required field AuthFlow *string `type:"string" required:"true" enum:"AuthFlowType"` @@ -12664,9 +12918,59 @@ type AdminInitiateAuthInput struct { // ClientId is a required field ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"` - // This is a random key-value pair map which can contain any key and will be - // passed to your PreAuthentication Lambda trigger as-is. It can be used to - // implement additional validations around authentication. + // A map of custom key-value pairs that you can provide as input for certain + // custom workflows that this action triggers. + // + // You create custom workflows by assigning AWS Lambda functions to user pool + // triggers. When you use the AdminInitiateAuth API action, Amazon Cognito invokes + // the AWS Lambda functions that are specified for various triggers. The ClientMetadata + // value is passed as input to the functions for only the following triggers: + // + // * Pre signup + // + // * Pre authentication + // + // * User migration + // + // When Amazon Cognito invokes the functions for these triggers, it passes a + // JSON payload, which the function receives as input. This payload contains + // a validationData attribute, which provides the data that you assigned to + // the ClientMetadata parameter in your AdminInitiateAuth request. In your function + // code in AWS Lambda, you can process the validationData value to enhance your + // workflow for your specific needs. + // + // When you use the AdminInitiateAuth API action, Amazon Cognito also invokes + // the functions for the following triggers, but it does not provide the ClientMetadata + // value as input: + // + // * Post authentication + // + // * Custom message + // + // * Pre token generation + // + // * Create auth challenge + // + // * Define auth challenge + // + // * Verify auth challenge + // + // For more information, see Customizing User Pool Workflows with Lambda Triggers + // (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html) + // in the Amazon Cognito Developer Guide. + // + // Take the following limitations into consideration when you use the ClientMetadata + // parameter: + // + // * Amazon Cognito does not store the ClientMetadata value. This data is + // available only to AWS Lambda triggers that are assigned to a user pool + // to support custom workflows. If your user pool configuration does not + // include triggers, the ClientMetadata parameter serves no purpose. + // + // * Amazon Cognito does not validate the ClientMetadata value. + // + // * Amazon Cognito does not encrypt the the ClientMetadata value, so don't + // use it to provide sensitive information. ClientMetadata map[string]*string `type:"map"` // Contextual data such as the user's device fingerprint, IP address, or location @@ -13414,6 +13718,37 @@ func (s AdminRemoveUserFromGroupOutput) GoString() string { type AdminResetUserPasswordInput struct { _ struct{} `type:"structure"` + // A map of custom key-value pairs that you can provide as input for any custom + // workflows that this action triggers. + // + // You create custom workflows by assigning AWS Lambda functions to user pool + // triggers. When you use the AdminResetUserPassword API action, Amazon Cognito + // invokes the function that is assigned to the custom message trigger. When + // Amazon Cognito invokes this function, it passes a JSON payload, which the + // function receives as input. This payload contains a clientMetadata attribute, + // which provides the data that you assigned to the ClientMetadata parameter + // in your AdminResetUserPassword request. In your function code in AWS Lambda, + // you can process the clientMetadata value to enhance your workflow for your + // specific needs. + // + // For more information, see Customizing User Pool Workflows with Lambda Triggers + // (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html) + // in the Amazon Cognito Developer Guide. + // + // Take the following limitations into consideration when you use the ClientMetadata + // parameter: + // + // * Amazon Cognito does not store the ClientMetadata value. This data is + // available only to AWS Lambda triggers that are assigned to a user pool + // to support custom workflows. If your user pool configuration does not + // include triggers, the ClientMetadata parameter serves no purpose. + // + // * Amazon Cognito does not validate the ClientMetadata value. + // + // * Amazon Cognito does not encrypt the the ClientMetadata value, so don't + // use it to provide sensitive information. + ClientMetadata map[string]*string `type:"map"` + // The user pool ID for the user pool where you want to reset the user's password. // // UserPoolId is a required field @@ -13457,6 +13792,12 @@ func (s *AdminResetUserPasswordInput) Validate() error { return nil } +// SetClientMetadata sets the ClientMetadata field's value. +func (s *AdminResetUserPasswordInput) SetClientMetadata(v map[string]*string) *AdminResetUserPasswordInput { + s.ClientMetadata = v + return s +} + // SetUserPoolId sets the UserPoolId field's value. func (s *AdminResetUserPasswordInput) SetUserPoolId(v string) *AdminResetUserPasswordInput { s.UserPoolId = &v @@ -13524,6 +13865,39 @@ type AdminRespondToAuthChallengeInput struct { // ClientId is a required field ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"` + // A map of custom key-value pairs that you can provide as input for any custom + // workflows that this action triggers. + // + // You create custom workflows by assigning AWS Lambda functions to user pool + // triggers. When you use the AdminRespondToAuthChallenge API action, Amazon + // Cognito invokes any functions that are assigned to the following triggers: + // pre sign-up, custom message, post authentication, user migration, pre token + // generation, define auth challenge, create auth challenge, and verify auth + // challenge response. When Amazon Cognito invokes any of these functions, it + // passes a JSON payload, which the function receives as input. This payload + // contains a clientMetadata attribute, which provides the data that you assigned + // to the ClientMetadata parameter in your AdminRespondToAuthChallenge request. + // In your function code in AWS Lambda, you can process the clientMetadata value + // to enhance your workflow for your specific needs. + // + // For more information, see Customizing User Pool Workflows with Lambda Triggers + // (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html) + // in the Amazon Cognito Developer Guide. + // + // Take the following limitations into consideration when you use the ClientMetadata + // parameter: + // + // * Amazon Cognito does not store the ClientMetadata value. This data is + // available only to AWS Lambda triggers that are assigned to a user pool + // to support custom workflows. If your user pool configuration does not + // include triggers, the ClientMetadata parameter serves no purpose. + // + // * Amazon Cognito does not validate the ClientMetadata value. + // + // * Amazon Cognito does not encrypt the the ClientMetadata value, so don't + // use it to provide sensitive information. + ClientMetadata map[string]*string `type:"map"` + // Contextual data such as the user's device fingerprint, IP address, or location // used for evaluating the risk of an unexpected event by Amazon Cognito advanced // security. @@ -13609,6 +13983,12 @@ func (s *AdminRespondToAuthChallengeInput) SetClientId(v string) *AdminRespondTo return s } +// SetClientMetadata sets the ClientMetadata field's value. +func (s *AdminRespondToAuthChallengeInput) SetClientMetadata(v map[string]*string) *AdminRespondToAuthChallengeInput { + s.ClientMetadata = v + return s +} + // SetContextData sets the ContextData field's value. func (s *AdminRespondToAuthChallengeInput) SetContextData(v *ContextDataType) *AdminRespondToAuthChallengeInput { s.ContextData = v @@ -13775,14 +14155,21 @@ func (s AdminSetUserMFAPreferenceOutput) GoString() string { type AdminSetUserPasswordInput struct { _ struct{} `type:"structure"` + // The password for the user. + // // Password is a required field Password *string `min:"6" type:"string" required:"true" sensitive:"true"` + // True if the password is permanent, False if it is temporary. Permanent *bool `type:"boolean"` + // The user pool ID for the user pool where you want to set the user's password. + // // UserPoolId is a required field UserPoolId *string `min:"1" type:"string" required:"true"` + // The user name of the user whose password you wish to set. + // // Username is a required field Username *string `min:"1" type:"string" required:"true" sensitive:"true"` } @@ -13863,22 +14250,24 @@ func (s AdminSetUserPasswordOutput) GoString() string { return s.String() } -// Represents the request to set user settings as an administrator. +// You can use this parameter to set an MFA configuration that uses the SMS +// delivery medium. type AdminSetUserSettingsInput struct { _ struct{} `type:"structure"` - // Specifies the options for MFA (e.g., email or phone number). + // You can use this parameter only to set an SMS configuration that uses SMS + // for delivery. // // MFAOptions is a required field MFAOptions []*MFAOptionType `type:"list" required:"true"` - // The user pool ID for the user pool where you want to set the user's settings, - // such as MFA options. + // The ID of the user pool that contains the user that you are setting options + // for. // // UserPoolId is a required field UserPoolId *string `min:"1" type:"string" required:"true"` - // The user name of the user for whom you wish to set user settings. + // The user name of the user that you are setting options for. // // Username is a required field Username *string `min:"1" type:"string" required:"true" sensitive:"true"` @@ -14169,6 +14558,37 @@ func (s AdminUpdateDeviceStatusOutput) GoString() string { type AdminUpdateUserAttributesInput struct { _ struct{} `type:"structure"` + // A map of custom key-value pairs that you can provide as input for any custom + // workflows that this action triggers. + // + // You create custom workflows by assigning AWS Lambda functions to user pool + // triggers. When you use the AdminUpdateUserAttributes API action, Amazon Cognito + // invokes the function that is assigned to the custom message trigger. When + // Amazon Cognito invokes this function, it passes a JSON payload, which the + // function receives as input. This payload contains a clientMetadata attribute, + // which provides the data that you assigned to the ClientMetadata parameter + // in your AdminUpdateUserAttributes request. In your function code in AWS Lambda, + // you can process the clientMetadata value to enhance your workflow for your + // specific needs. + // + // For more information, see Customizing User Pool Workflows with Lambda Triggers + // (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html) + // in the Amazon Cognito Developer Guide. + // + // Take the following limitations into consideration when you use the ClientMetadata + // parameter: + // + // * Amazon Cognito does not store the ClientMetadata value. This data is + // available only to AWS Lambda triggers that are assigned to a user pool + // to support custom workflows. If your user pool configuration does not + // include triggers, the ClientMetadata parameter serves no purpose. + // + // * Amazon Cognito does not validate the ClientMetadata value. + // + // * Amazon Cognito does not encrypt the the ClientMetadata value, so don't + // use it to provide sensitive information. + ClientMetadata map[string]*string `type:"map"` + // An array of name-value pairs representing user attributes. // // For custom attributes, you must prepend the custom: prefix to the attribute @@ -14233,6 +14653,12 @@ func (s *AdminUpdateUserAttributesInput) Validate() error { return nil } +// SetClientMetadata sets the ClientMetadata field's value. +func (s *AdminUpdateUserAttributesInput) SetClientMetadata(v map[string]*string) *AdminUpdateUserAttributesInput { + s.ClientMetadata = v + return s +} + // SetUserAttributes sets the UserAttributes field's value. func (s *AdminUpdateUserAttributesInput) SetUserAttributes(v []*AttributeType) *AdminUpdateUserAttributesInput { s.UserAttributes = v @@ -14341,6 +14767,66 @@ func (s AdminUserGlobalSignOutOutput) GoString() string { return s.String() } +// This exception is thrown when a user tries to confirm the account with an +// email or phone number that has already been supplied as an alias from a different +// account. This exception tells user that an account with this email or phone +// already exists. +type AliasExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message sent to the user when an alias exists. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AliasExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AliasExistsException) GoString() string { + return s.String() +} + +func newErrorAliasExistsException(v protocol.ResponseMetadata) error { + return &AliasExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AliasExistsException) Code() string { + return "AliasExistsException" +} + +// Message returns the exception's message. +func (s AliasExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AliasExistsException) OrigErr() error { + return nil +} + +func (s AliasExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AliasExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AliasExistsException) RequestID() string { + return s.respMetadata.RequestID +} + // The Amazon Pinpoint analytics configuration for collecting metrics for a // user pool. type AnalyticsConfigurationType struct { @@ -14904,47 +15390,162 @@ func (s *CodeDeliveryDetailsType) SetDestination(v string) *CodeDeliveryDetailsT return s } -// The compromised credentials actions type -type CompromisedCredentialsActionsType struct { - _ struct{} `type:"structure"` +// This exception is thrown when a verification code fails to deliver successfully. +type CodeDeliveryFailureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The event action. - // - // EventAction is a required field - EventAction *string `type:"string" required:"true" enum:"CompromisedCredentialsEventActionType"` + // The message sent when a verification code fails to deliver successfully. + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s CompromisedCredentialsActionsType) String() string { +func (s CodeDeliveryFailureException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CompromisedCredentialsActionsType) GoString() string { +func (s CodeDeliveryFailureException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CompromisedCredentialsActionsType) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CompromisedCredentialsActionsType"} - if s.EventAction == nil { - invalidParams.Add(request.NewErrParamRequired("EventAction")) +func newErrorCodeDeliveryFailureException(v protocol.ResponseMetadata) error { + return &CodeDeliveryFailureException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s CodeDeliveryFailureException) Code() string { + return "CodeDeliveryFailureException" +} + +// Message returns the exception's message. +func (s CodeDeliveryFailureException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CodeDeliveryFailureException) OrigErr() error { return nil } -// SetEventAction sets the EventAction field's value. -func (s *CompromisedCredentialsActionsType) SetEventAction(v string) *CompromisedCredentialsActionsType { - s.EventAction = &v - return s +func (s CodeDeliveryFailureException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// The compromised credentials risk configuration type. -type CompromisedCredentialsRiskConfigurationType struct { +// Status code returns the HTTP status code for the request's response error. +func (s CodeDeliveryFailureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CodeDeliveryFailureException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown if the provided code does not match what the server +// was expecting. +type CodeMismatchException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message provided when the code mismatch exception is thrown. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CodeMismatchException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CodeMismatchException) GoString() string { + return s.String() +} + +func newErrorCodeMismatchException(v protocol.ResponseMetadata) error { + return &CodeMismatchException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CodeMismatchException) Code() string { + return "CodeMismatchException" +} + +// Message returns the exception's message. +func (s CodeMismatchException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CodeMismatchException) OrigErr() error { + return nil +} + +func (s CodeMismatchException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CodeMismatchException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CodeMismatchException) RequestID() string { + return s.respMetadata.RequestID +} + +// The compromised credentials actions type +type CompromisedCredentialsActionsType struct { + _ struct{} `type:"structure"` + + // The event action. + // + // EventAction is a required field + EventAction *string `type:"string" required:"true" enum:"CompromisedCredentialsEventActionType"` +} + +// String returns the string representation +func (s CompromisedCredentialsActionsType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CompromisedCredentialsActionsType) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CompromisedCredentialsActionsType) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CompromisedCredentialsActionsType"} + if s.EventAction == nil { + invalidParams.Add(request.NewErrParamRequired("EventAction")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventAction sets the EventAction field's value. +func (s *CompromisedCredentialsActionsType) SetEventAction(v string) *CompromisedCredentialsActionsType { + s.EventAction = &v + return s +} + +// The compromised credentials risk configuration type. +type CompromisedCredentialsRiskConfigurationType struct { _ struct{} `type:"structure"` // The compromised credentials risk configuration actions. @@ -14997,6 +15598,63 @@ func (s *CompromisedCredentialsRiskConfigurationType) SetEventFilter(v []*string return s } +// This exception is thrown if two or more modifications are happening concurrently. +type ConcurrentModificationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message provided when the concurrent exception is thrown. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentModificationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentModificationException) GoString() string { + return s.String() +} + +func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { + return &ConcurrentModificationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentModificationException) Code() string { + return "ConcurrentModificationException" +} + +// Message returns the exception's message. +func (s ConcurrentModificationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentModificationException) OrigErr() error { + return nil +} + +func (s ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentModificationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentModificationException) RequestID() string { + return s.respMetadata.RequestID +} + // Confirms the device request. type ConfirmDeviceInput struct { _ struct{} `type:"structure"` @@ -15112,6 +15770,37 @@ type ConfirmForgotPasswordInput struct { // ClientId is a required field ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"` + // A map of custom key-value pairs that you can provide as input for any custom + // workflows that this action triggers. + // + // You create custom workflows by assigning AWS Lambda functions to user pool + // triggers. When you use the ConfirmForgotPassword API action, Amazon Cognito + // invokes the function that is assigned to the post confirmation trigger. When + // Amazon Cognito invokes this function, it passes a JSON payload, which the + // function receives as input. This payload contains a clientMetadata attribute, + // which provides the data that you assigned to the ClientMetadata parameter + // in your ConfirmForgotPassword request. In your function code in AWS Lambda, + // you can process the clientMetadata value to enhance your workflow for your + // specific needs. + // + // For more information, see Customizing User Pool Workflows with Lambda Triggers + // (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html) + // in the Amazon Cognito Developer Guide. + // + // Take the following limitations into consideration when you use the ClientMetadata + // parameter: + // + // * Amazon Cognito does not store the ClientMetadata value. This data is + // available only to AWS Lambda triggers that are assigned to a user pool + // to support custom workflows. If your user pool configuration does not + // include triggers, the ClientMetadata parameter serves no purpose. + // + // * Amazon Cognito does not validate the ClientMetadata value. + // + // * Amazon Cognito does not encrypt the the ClientMetadata value, so don't + // use it to provide sensitive information. + ClientMetadata map[string]*string `type:"map"` + // The confirmation code sent by a user's request to retrieve a forgotten password. // For more information, see // @@ -15198,6 +15887,12 @@ func (s *ConfirmForgotPasswordInput) SetClientId(v string) *ConfirmForgotPasswor return s } +// SetClientMetadata sets the ClientMetadata field's value. +func (s *ConfirmForgotPasswordInput) SetClientMetadata(v map[string]*string) *ConfirmForgotPasswordInput { + s.ClientMetadata = v + return s +} + // SetConfirmationCode sets the ConfirmationCode field's value. func (s *ConfirmForgotPasswordInput) SetConfirmationCode(v string) *ConfirmForgotPasswordInput { s.ConfirmationCode = &v @@ -15257,6 +15952,36 @@ type ConfirmSignUpInput struct { // ClientId is a required field ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"` + // A map of custom key-value pairs that you can provide as input for any custom + // workflows that this action triggers. + // + // You create custom workflows by assigning AWS Lambda functions to user pool + // triggers. When you use the ConfirmSignUp API action, Amazon Cognito invokes + // the function that is assigned to the post confirmation trigger. When Amazon + // Cognito invokes this function, it passes a JSON payload, which the function + // receives as input. This payload contains a clientMetadata attribute, which + // provides the data that you assigned to the ClientMetadata parameter in your + // ConfirmSignUp request. In your function code in AWS Lambda, you can process + // the clientMetadata value to enhance your workflow for your specific needs. + // + // For more information, see Customizing User Pool Workflows with Lambda Triggers + // (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html) + // in the Amazon Cognito Developer Guide. + // + // Take the following limitations into consideration when you use the ClientMetadata + // parameter: + // + // * Amazon Cognito does not store the ClientMetadata value. This data is + // available only to AWS Lambda triggers that are assigned to a user pool + // to support custom workflows. If your user pool configuration does not + // include triggers, the ClientMetadata parameter serves no purpose. + // + // * Amazon Cognito does not validate the ClientMetadata value. + // + // * Amazon Cognito does not encrypt the the ClientMetadata value, so don't + // use it to provide sensitive information. + ClientMetadata map[string]*string `type:"map"` + // The confirmation code sent by a user's request to confirm registration. // // ConfirmationCode is a required field @@ -15338,6 +16063,12 @@ func (s *ConfirmSignUpInput) SetClientId(v string) *ConfirmSignUpInput { return s } +// SetClientMetadata sets the ClientMetadata field's value. +func (s *ConfirmSignUpInput) SetClientMetadata(v map[string]*string) *ConfirmSignUpInput { + s.ClientMetadata = v + return s +} + // SetConfirmationCode sets the ConfirmationCode field's value. func (s *ConfirmSignUpInput) SetConfirmationCode(v string) *ConfirmSignUpInput { s.ConfirmationCode = &v @@ -15610,7 +16341,22 @@ type CreateIdentityProviderInput struct { // A list of identity provider identifiers. IdpIdentifiers []*string `type:"list"` - // The identity provider details, such as MetadataURL and MetadataFile. + // The identity provider details. The following list describes the provider + // detail keys for each identity provider type. + // + // * For Google, Facebook and Login with Amazon: client_id client_secret + // authorize_scopes + // + // * For Sign in with Apple: client_id team_id key_id private_key authorize_scopes + // + // * For OIDC providers: client_id client_secret attributes_request_method + // oidc_issuer authorize_scopes authorize_url if not available from discovery + // URL specified by oidc_issuer key token_url if not available from discovery + // URL specified by oidc_issuer key attributes_url if not available from + // discovery URL specified by oidc_issuer key jwks_uri if not available from + // discovery URL specified by oidc_issuer key authorize_scopes + // + // * For SAML providers: MetadataFile OR MetadataURL IDPSignOut optional // // ProviderDetails is a required field ProviderDetails map[string]*string `type:"map" required:"true"` @@ -15955,20 +16701,27 @@ func (s *CreateUserImportJobOutput) SetUserImportJob(v *UserImportJobType) *Crea type CreateUserPoolClientInput struct { _ struct{} `type:"structure"` + // The allowed OAuth flows. + // // Set to code to initiate a code grant flow, which provides an authorization // code as the response. This code can be exchanged for access tokens with the // token endpoint. // - // Set to token to specify that the client should get the access token (and, + // Set to implicit to specify that the client should get the access token (and, // optionally, ID token, based on scopes) directly. + // + // Set to client_credentials to specify that the client should get the access + // token (and, optionally, ID token, based on scopes) from the token endpoint + // using a combination of client and client_secret. AllowedOAuthFlows []*string `type:"list"` - // Set to True if the client is allowed to follow the OAuth protocol when interacting + // Set to true if the client is allowed to follow the OAuth protocol when interacting // with Cognito user pools. AllowedOAuthFlowsUserPoolClient *bool `type:"boolean"` - // A list of allowed OAuth scopes. Currently supported values are "phone", "email", - // "openid", and "Cognito". + // The allowed OAuth scopes. Possible values provided by OAuth are: phone, email, + // openid, and profile. Possible values provided by AWS are: aws.cognito.signin.user.admin. + // Custom scopes created in Resource Servers are also supported. AllowedOAuthScopes []*string `type:"list"` // The Amazon Pinpoint analytics configuration for collecting metrics for this @@ -16016,7 +16769,28 @@ type CreateUserPoolClientInput struct { // App callback URLs such as myapp://example are also supported. DefaultRedirectURI *string `min:"1" type:"string"` - // The explicit authentication flows. + // The authentication flows that are supported by the user pool clients. Flow + // names without the ALLOW_ prefix are deprecated in favor of new names with + // the ALLOW_ prefix. Note that values with ALLOW_ prefix cannot be used along + // with values without ALLOW_ prefix. + // + // Valid values include: + // + // * ALLOW_ADMIN_USER_PASSWORD_AUTH: Enable admin based user password authentication + // flow ADMIN_USER_PASSWORD_AUTH. This setting replaces the ADMIN_NO_SRP_AUTH + // setting. With this authentication flow, Cognito receives the password + // in the request instead of using the SRP (Secure Remote Password protocol) + // protocol to verify passwords. + // + // * ALLOW_CUSTOM_AUTH: Enable Lambda trigger based authentication. + // + // * ALLOW_USER_PASSWORD_AUTH: Enable user password-based authentication. + // In this flow, Cognito receives the password in the request instead of + // using the SRP protocol to verify passwords. + // + // * ALLOW_USER_SRP_AUTH: Enable SRP based authentication. + // + // * ALLOW_REFRESH_TOKEN_AUTH: Enable authflow to refresh tokens. ExplicitAuthFlows []*string `type:"list"` // Boolean to specify whether you want to generate a secret for the user pool @@ -16026,6 +16800,44 @@ type CreateUserPoolClientInput struct { // A list of allowed logout URLs for the identity providers. LogoutURLs []*string `type:"list"` + // Use this setting to choose which errors and responses are returned by Cognito + // APIs during authentication, account confirmation, and password recovery when + // the user does not exist in the user pool. When set to ENABLED and the user + // does not exist, authentication returns an error indicating either the username + // or password was incorrect, and account confirmation and password recovery + // return a response indicating a code was sent to a simulated destination. + // When set to LEGACY, those APIs will return a UserNotFoundException exception + // if the user does not exist in the user pool. + // + // Valid values include: + // + // * ENABLED - This prevents user existence-related errors. + // + // * LEGACY - This represents the old behavior of Cognito where user existence + // related errors are not prevented. + // + // This setting affects the behavior of following APIs: + // + // * AdminInitiateAuth + // + // * AdminRespondToAuthChallenge + // + // * InitiateAuth + // + // * RespondToAuthChallenge + // + // * ForgotPassword + // + // * ConfirmForgotPassword + // + // * ConfirmSignUp + // + // * ResendConfirmationCode + // + // After February 15th 2020, the value of PreventUserExistenceErrors will default + // to ENABLED for newly created user pool clients if no value is provided. + PreventUserExistenceErrors *string `type:"string" enum:"PreventUserExistenceErrorTypes"` + // The read attributes. ReadAttributes []*string `type:"list"` @@ -16154,6 +16966,12 @@ func (s *CreateUserPoolClientInput) SetLogoutURLs(v []*string) *CreateUserPoolCl return s } +// SetPreventUserExistenceErrors sets the PreventUserExistenceErrors field's value. +func (s *CreateUserPoolClientInput) SetPreventUserExistenceErrors(v string) *CreateUserPoolClientInput { + s.PreventUserExistenceErrors = &v + return s +} + // SetReadAttributes sets the ReadAttributes field's value. func (s *CreateUserPoolClientInput) SetReadAttributes(v []*string) *CreateUserPoolClientInput { s.ReadAttributes = v @@ -16316,6 +17134,19 @@ func (s *CreateUserPoolDomainOutput) SetCloudFrontDomain(v string) *CreateUserPo type CreateUserPoolInput struct { _ struct{} `type:"structure"` + // Use this setting to define which verified available method a user can use + // to recover their password when they call ForgotPassword. It allows you to + // define a preferred method when a user has more than one method available. + // With this setting, SMS does not qualify for a valid password recovery mechanism + // if the user also has SMS MFA enabled. In the absence of this setting, Cognito + // uses the legacy behavior to determine the recovery method where SMS is preferred + // over email. + // + // Starting February 1, 2020, the value of AccountRecoverySetting will default + // to verified_email first and verified_phone_number as the second option for + // newly created user pools if no value is provided. + AccountRecoverySetting *AccountRecoverySettingType `type:"structure"` + // The configuration for AdminCreateUser requests. AdminCreateUserConfig *AdminCreateUserConfigType `type:"structure"` @@ -16387,6 +17218,12 @@ type CreateUserPoolInput struct { // when a user signs up. UsernameAttributes []*string `type:"list"` + // You can choose to set case sensitivity on the username input for the selected + // sign-in option. For example, when this is set to False, users will be able + // to sign in using either "username" or "Username". This configuration is immutable + // once it has been set. For more information, see . + UsernameConfiguration *UsernameConfigurationType `type:"structure"` + // The template for the verification message that the user sees when the app // requests permission to access the user's information. VerificationMessageTemplate *VerificationMessageTemplateType `type:"structure"` @@ -16426,6 +17263,11 @@ func (s *CreateUserPoolInput) Validate() error { if s.SmsVerificationMessage != nil && len(*s.SmsVerificationMessage) < 6 { invalidParams.Add(request.NewErrParamMinLen("SmsVerificationMessage", 6)) } + if s.AccountRecoverySetting != nil { + if err := s.AccountRecoverySetting.Validate(); err != nil { + invalidParams.AddNested("AccountRecoverySetting", err.(request.ErrInvalidParams)) + } + } if s.AdminCreateUserConfig != nil { if err := s.AdminCreateUserConfig.Validate(); err != nil { invalidParams.AddNested("AdminCreateUserConfig", err.(request.ErrInvalidParams)) @@ -16466,6 +17308,11 @@ func (s *CreateUserPoolInput) Validate() error { invalidParams.AddNested("UserPoolAddOns", err.(request.ErrInvalidParams)) } } + if s.UsernameConfiguration != nil { + if err := s.UsernameConfiguration.Validate(); err != nil { + invalidParams.AddNested("UsernameConfiguration", err.(request.ErrInvalidParams)) + } + } if s.VerificationMessageTemplate != nil { if err := s.VerificationMessageTemplate.Validate(); err != nil { invalidParams.AddNested("VerificationMessageTemplate", err.(request.ErrInvalidParams)) @@ -16478,6 +17325,12 @@ func (s *CreateUserPoolInput) Validate() error { return nil } +// SetAccountRecoverySetting sets the AccountRecoverySetting field's value. +func (s *CreateUserPoolInput) SetAccountRecoverySetting(v *AccountRecoverySettingType) *CreateUserPoolInput { + s.AccountRecoverySetting = v + return s +} + // SetAdminCreateUserConfig sets the AdminCreateUserConfig field's value. func (s *CreateUserPoolInput) SetAdminCreateUserConfig(v *AdminCreateUserConfigType) *CreateUserPoolInput { s.AdminCreateUserConfig = v @@ -16586,6 +17439,12 @@ func (s *CreateUserPoolInput) SetUsernameAttributes(v []*string) *CreateUserPool return s } +// SetUsernameConfiguration sets the UsernameConfiguration field's value. +func (s *CreateUserPoolInput) SetUsernameConfiguration(v *UsernameConfigurationType) *CreateUserPoolInput { + s.UsernameConfiguration = v + return s +} + // SetVerificationMessageTemplate sets the VerificationMessageTemplate field's value. func (s *CreateUserPoolInput) SetVerificationMessageTemplate(v *VerificationMessageTemplateType) *CreateUserPoolInput { s.VerificationMessageTemplate = v @@ -17959,10 +18818,83 @@ func (s *DomainDescriptionType) SetVersion(v string) *DomainDescriptionType { return s } +// This exception is thrown when the provider is already supported by the user +// pool. +type DuplicateProviderException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DuplicateProviderException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DuplicateProviderException) GoString() string { + return s.String() +} + +func newErrorDuplicateProviderException(v protocol.ResponseMetadata) error { + return &DuplicateProviderException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DuplicateProviderException) Code() string { + return "DuplicateProviderException" +} + +// Message returns the exception's message. +func (s DuplicateProviderException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DuplicateProviderException) OrigErr() error { + return nil +} + +func (s DuplicateProviderException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DuplicateProviderException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DuplicateProviderException) RequestID() string { + return s.respMetadata.RequestID +} + // The email configuration type. type EmailConfigurationType struct { _ struct{} `type:"structure"` + // The set of configuration rules that can be applied to emails sent using Amazon + // SES. A configuration set is applied to an email by including a reference + // to the configuration set in the headers of the email. Once applied, all of + // the rules in that configuration set are applied to the email. Configuration + // sets can be used to apply the following types of rules to emails: + // + // * Event publishing – Amazon SES can track the number of send, delivery, + // open, click, bounce, and complaint events for each email sent. Use event + // publishing to send information about these events to other AWS services + // such as SNS and CloudWatch. + // + // * IP pool management – When leasing dedicated IP addresses with Amazon + // SES, you can create groups of IP addresses, called dedicated IP pools. + // You can then associate the dedicated IP pools with configuration sets. + ConfigurationSet *string `min:"1" type:"string"` + // Specifies whether Amazon Cognito emails your users by using its built-in // email functionality or your Amazon SES email configuration. Specify one of // the following values: @@ -18005,6 +18937,11 @@ type EmailConfigurationType struct { // in the Amazon Cognito Developer Guide. EmailSendingAccount *string `type:"string" enum:"EmailSendingAccountType"` + // Identifies either the sender’s email address or the sender’s name with + // their email address. For example, testuser@example.com or Test User . + // This address will appear before the body of the email. + From *string `type:"string"` + // The destination to which the receiver of the email should reply to. ReplyToEmailAddress *string `type:"string"` @@ -18034,6 +18971,9 @@ func (s EmailConfigurationType) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *EmailConfigurationType) Validate() error { invalidParams := request.ErrInvalidParams{Context: "EmailConfigurationType"} + if s.ConfigurationSet != nil && len(*s.ConfigurationSet) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigurationSet", 1)) + } if s.SourceArn != nil && len(*s.SourceArn) < 20 { invalidParams.Add(request.NewErrParamMinLen("SourceArn", 20)) } @@ -18044,12 +18984,24 @@ func (s *EmailConfigurationType) Validate() error { return nil } +// SetConfigurationSet sets the ConfigurationSet field's value. +func (s *EmailConfigurationType) SetConfigurationSet(v string) *EmailConfigurationType { + s.ConfigurationSet = &v + return s +} + // SetEmailSendingAccount sets the EmailSendingAccount field's value. func (s *EmailConfigurationType) SetEmailSendingAccount(v string) *EmailConfigurationType { s.EmailSendingAccount = &v return s } +// SetFrom sets the From field's value. +func (s *EmailConfigurationType) SetFrom(v string) *EmailConfigurationType { + s.From = &v + return s +} + // SetReplyToEmailAddress sets the ReplyToEmailAddress field's value. func (s *EmailConfigurationType) SetReplyToEmailAddress(v string) *EmailConfigurationType { s.ReplyToEmailAddress = &v @@ -18062,6 +19014,63 @@ func (s *EmailConfigurationType) SetSourceArn(v string) *EmailConfigurationType return s } +// This exception is thrown when there is a code mismatch and the service fails +// to configure the software token TOTP multi-factor authentication (MFA). +type EnableSoftwareTokenMFAException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s EnableSoftwareTokenMFAException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableSoftwareTokenMFAException) GoString() string { + return s.String() +} + +func newErrorEnableSoftwareTokenMFAException(v protocol.ResponseMetadata) error { + return &EnableSoftwareTokenMFAException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EnableSoftwareTokenMFAException) Code() string { + return "EnableSoftwareTokenMFAException" +} + +// Message returns the exception's message. +func (s EnableSoftwareTokenMFAException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EnableSoftwareTokenMFAException) OrigErr() error { + return nil +} + +func (s EnableSoftwareTokenMFAException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EnableSoftwareTokenMFAException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EnableSoftwareTokenMFAException) RequestID() string { + return s.respMetadata.RequestID +} + // Specifies the user context data captured at the time of an event request. type EventContextDataType struct { _ struct{} `type:"structure"` @@ -18201,31 +19210,88 @@ func (s *EventRiskType) SetRiskLevel(v string) *EventRiskType { return s } -// Represents the request to forget the device. -type ForgetDeviceInput struct { - _ struct{} `type:"structure"` - - // The access token for the forgotten device request. - AccessToken *string `type:"string" sensitive:"true"` +// This exception is thrown if a code has expired. +type ExpiredCodeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The device key. - // - // DeviceKey is a required field - DeviceKey *string `min:"1" type:"string" required:"true"` + // The message returned when the expired code exception is thrown. + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ForgetDeviceInput) String() string { +func (s ExpiredCodeException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ForgetDeviceInput) GoString() string { +func (s ExpiredCodeException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ForgetDeviceInput) Validate() error { +func newErrorExpiredCodeException(v protocol.ResponseMetadata) error { + return &ExpiredCodeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ExpiredCodeException) Code() string { + return "ExpiredCodeException" +} + +// Message returns the exception's message. +func (s ExpiredCodeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ExpiredCodeException) OrigErr() error { + return nil +} + +func (s ExpiredCodeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ExpiredCodeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ExpiredCodeException) RequestID() string { + return s.respMetadata.RequestID +} + +// Represents the request to forget the device. +type ForgetDeviceInput struct { + _ struct{} `type:"structure"` + + // The access token for the forgotten device request. + AccessToken *string `type:"string" sensitive:"true"` + + // The device key. + // + // DeviceKey is a required field + DeviceKey *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ForgetDeviceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ForgetDeviceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ForgetDeviceInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ForgetDeviceInput"} if s.DeviceKey == nil { invalidParams.Add(request.NewErrParamRequired("DeviceKey")) @@ -18279,6 +19345,37 @@ type ForgotPasswordInput struct { // ClientId is a required field ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"` + // A map of custom key-value pairs that you can provide as input for any custom + // workflows that this action triggers. + // + // You create custom workflows by assigning AWS Lambda functions to user pool + // triggers. When you use the ForgotPassword API action, Amazon Cognito invokes + // any functions that are assigned to the following triggers: pre sign-up, custom + // message, and user migration. When Amazon Cognito invokes any of these functions, + // it passes a JSON payload, which the function receives as input. This payload + // contains a clientMetadata attribute, which provides the data that you assigned + // to the ClientMetadata parameter in your ForgotPassword request. In your function + // code in AWS Lambda, you can process the clientMetadata value to enhance your + // workflow for your specific needs. + // + // For more information, see Customizing User Pool Workflows with Lambda Triggers + // (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html) + // in the Amazon Cognito Developer Guide. + // + // Take the following limitations into consideration when you use the ClientMetadata + // parameter: + // + // * Amazon Cognito does not store the ClientMetadata value. This data is + // available only to AWS Lambda triggers that are assigned to a user pool + // to support custom workflows. If your user pool configuration does not + // include triggers, the ClientMetadata parameter serves no purpose. + // + // * Amazon Cognito does not validate the ClientMetadata value. + // + // * Amazon Cognito does not encrypt the the ClientMetadata value, so don't + // use it to provide sensitive information. + ClientMetadata map[string]*string `type:"map"` + // A keyed-hash message authentication code (HMAC) calculated using the secret // key of a user pool client and username plus the client ID in the message. SecretHash *string `min:"1" type:"string" sensitive:"true"` @@ -18342,6 +19439,12 @@ func (s *ForgotPasswordInput) SetClientId(v string) *ForgotPasswordInput { return s } +// SetClientMetadata sets the ClientMetadata field's value. +func (s *ForgotPasswordInput) SetClientMetadata(v map[string]*string) *ForgotPasswordInput { + s.ClientMetadata = v + return s +} + // SetSecretHash sets the SecretHash field's value. func (s *ForgotPasswordInput) SetSecretHash(v string) *ForgotPasswordInput { s.SecretHash = &v @@ -18863,6 +19966,37 @@ type GetUserAttributeVerificationCodeInput struct { // // AttributeName is a required field AttributeName *string `min:"1" type:"string" required:"true"` + + // A map of custom key-value pairs that you can provide as input for any custom + // workflows that this action triggers. + // + // You create custom workflows by assigning AWS Lambda functions to user pool + // triggers. When you use the GetUserAttributeVerificationCode API action, Amazon + // Cognito invokes the function that is assigned to the custom message trigger. + // When Amazon Cognito invokes this function, it passes a JSON payload, which + // the function receives as input. This payload contains a clientMetadata attribute, + // which provides the data that you assigned to the ClientMetadata parameter + // in your GetUserAttributeVerificationCode request. In your function code in + // AWS Lambda, you can process the clientMetadata value to enhance your workflow + // for your specific needs. + // + // For more information, see Customizing User Pool Workflows with Lambda Triggers + // (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html) + // in the Amazon Cognito Developer Guide. + // + // Take the following limitations into consideration when you use the ClientMetadata + // parameter: + // + // * Amazon Cognito does not store the ClientMetadata value. This data is + // available only to AWS Lambda triggers that are assigned to a user pool + // to support custom workflows. If your user pool configuration does not + // include triggers, the ClientMetadata parameter serves no purpose. + // + // * Amazon Cognito does not validate the ClientMetadata value. + // + // * Amazon Cognito does not encrypt the the ClientMetadata value, so don't + // use it to provide sensitive information. + ClientMetadata map[string]*string `type:"map"` } // String returns the string representation @@ -18906,6 +20040,12 @@ func (s *GetUserAttributeVerificationCodeInput) SetAttributeName(v string) *GetU return s } +// SetClientMetadata sets the ClientMetadata field's value. +func (s *GetUserAttributeVerificationCodeInput) SetClientMetadata(v map[string]*string) *GetUserAttributeVerificationCodeInput { + s.ClientMetadata = v + return s +} + // The verification code response returned by the server response to get the // user attribute verification code. type GetUserAttributeVerificationCodeOutput struct { @@ -18977,7 +20117,11 @@ func (s *GetUserInput) SetAccessToken(v string) *GetUserInput { type GetUserOutput struct { _ struct{} `type:"structure"` - // Specifies the options for MFA (e.g., email or phone number). + // This response parameter is no longer supported. It provides information only + // about SMS MFA configurations. It doesn't provide information about TOTP software + // token MFA configurations. To look up information about either type of MFA + // configuration, use the use the GetUserResponse$UserMFASettingList response + // instead. MFAOptions []*MFAOptionType `type:"list"` // The user's preferred MFA setting. @@ -18991,7 +20135,8 @@ type GetUserOutput struct { // UserAttributes is a required field UserAttributes []*AttributeType `type:"list" required:"true"` - // The list of the user's MFA settings. + // The MFA options that are enabled for the user. The possible values in this + // list are SMS_MFA and SOFTWARE_TOKEN_MFA. UserMFASettingList []*string `type:"list"` // The user name of the user you wish to retrieve from the get user request. @@ -19084,7 +20229,14 @@ func (s *GetUserPoolMfaConfigInput) SetUserPoolId(v string) *GetUserPoolMfaConfi type GetUserPoolMfaConfigOutput struct { _ struct{} `type:"structure"` - // The multi-factor (MFA) configuration. + // The multi-factor (MFA) configuration. Valid values include: + // + // * OFF MFA will not be used for any users. + // + // * ON MFA is required for all users to sign in. + // + // * OPTIONAL MFA will be required only for individual users who have an + // MFA factor enabled. MfaConfiguration *string `type:"string" enum:"UserPoolMfaType"` // The SMS text message multi-factor (MFA) configuration. @@ -19176,6 +20328,63 @@ func (s GlobalSignOutOutput) GoString() string { return s.String() } +// This exception is thrown when Amazon Cognito encounters a group that already +// exists in the user pool. +type GroupExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s GroupExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GroupExistsException) GoString() string { + return s.String() +} + +func newErrorGroupExistsException(v protocol.ResponseMetadata) error { + return &GroupExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s GroupExistsException) Code() string { + return "GroupExistsException" +} + +// Message returns the exception's message. +func (s GroupExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s GroupExistsException) OrigErr() error { + return nil +} + +func (s GroupExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s GroupExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s GroupExistsException) RequestID() string { + return s.respMetadata.RequestID +} + // The group type. type GroupType struct { _ struct{} `type:"structure"` @@ -19317,7 +20526,22 @@ type IdentityProviderType struct { // The date the identity provider was last modified. LastModifiedDate *time.Time `type:"timestamp"` - // The identity provider details, such as MetadataURL and MetadataFile. + // The identity provider details. The following list describes the provider + // detail keys for each identity provider type. + // + // * For Google, Facebook and Login with Amazon: client_id client_secret + // authorize_scopes + // + // * For Sign in with Apple: client_id team_id key_id private_key authorize_scopes + // + // * For OIDC providers: client_id client_secret attributes_request_method + // oidc_issuer authorize_scopes authorize_url if not available from discovery + // URL specified by oidc_issuer key token_url if not available from discovery + // URL specified by oidc_issuer key attributes_url if not available from + // discovery URL specified by oidc_issuer key jwks_uri if not available from + // discovery URL specified by oidc_issuer key authorize_scopes + // + // * For SAML providers: MetadataFile OR MetadataURL IDPSignOut optional ProviderDetails map[string]*string `type:"map"` // The identity provider name. @@ -19423,6 +20647,11 @@ type InitiateAuthInput struct { // will invoke the user migration Lambda if the USERNAME is not found in // the user pool. // + // * ADMIN_USER_PASSWORD_AUTH: Admin-based user password authentication. + // This replaces the ADMIN_NO_SRP_AUTH authentication flow. In this flow, + // Cognito receives the password in the request instead of using the SRP + // process to verify passwords. + // // ADMIN_NO_SRP_AUTH is not a valid value. // // AuthFlow is a required field @@ -19446,9 +20675,59 @@ type InitiateAuthInput struct { // ClientId is a required field ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"` - // This is a random key-value pair map which can contain any key and will be - // passed to your PreAuthentication Lambda trigger as-is. It can be used to - // implement additional validations around authentication. + // A map of custom key-value pairs that you can provide as input for certain + // custom workflows that this action triggers. + // + // You create custom workflows by assigning AWS Lambda functions to user pool + // triggers. When you use the InitiateAuth API action, Amazon Cognito invokes + // the AWS Lambda functions that are specified for various triggers. The ClientMetadata + // value is passed as input to the functions for only the following triggers: + // + // * Pre signup + // + // * Pre authentication + // + // * User migration + // + // When Amazon Cognito invokes the functions for these triggers, it passes a + // JSON payload, which the function receives as input. This payload contains + // a validationData attribute, which provides the data that you assigned to + // the ClientMetadata parameter in your InitiateAuth request. In your function + // code in AWS Lambda, you can process the validationData value to enhance your + // workflow for your specific needs. + // + // When you use the InitiateAuth API action, Amazon Cognito also invokes the + // functions for the following triggers, but it does not provide the ClientMetadata + // value as input: + // + // * Post authentication + // + // * Custom message + // + // * Pre token generation + // + // * Create auth challenge + // + // * Define auth challenge + // + // * Verify auth challenge + // + // For more information, see Customizing User Pool Workflows with Lambda Triggers + // (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html) + // in the Amazon Cognito Developer Guide. + // + // Take the following limitations into consideration when you use the ClientMetadata + // parameter: + // + // * Amazon Cognito does not store the ClientMetadata value. This data is + // available only to AWS Lambda triggers that are assigned to a user pool + // to support custom workflows. If your user pool configuration does not + // include triggers, the ClientMetadata parameter serves no purpose. + // + // * Amazon Cognito does not validate the ClientMetadata value. + // + // * Amazon Cognito does not encrypt the the ClientMetadata value, so don't + // use it to provide sensitive information. ClientMetadata map[string]*string `type:"map"` // Contextual data such as the user's device fingerprint, IP address, or location @@ -19610,6 +20889,532 @@ func (s *InitiateAuthOutput) SetSession(v string) *InitiateAuthOutput { return s } +// This exception is thrown when Amazon Cognito encounters an internal error. +type InternalErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when Amazon Cognito throws an internal error exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalErrorException) GoString() string { + return s.String() +} + +func newErrorInternalErrorException(v protocol.ResponseMetadata) error { + return &InternalErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalErrorException) Code() string { + return "InternalErrorException" +} + +// Message returns the exception's message. +func (s InternalErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalErrorException) OrigErr() error { + return nil +} + +func (s InternalErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when Amazon Cognito is not allowed to use your email +// identity. HTTP status code: 400. +type InvalidEmailRoleAccessPolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when you have an unverified email address or the identity + // policy is not set on an email address that Amazon Cognito can access. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidEmailRoleAccessPolicyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidEmailRoleAccessPolicyException) GoString() string { + return s.String() +} + +func newErrorInvalidEmailRoleAccessPolicyException(v protocol.ResponseMetadata) error { + return &InvalidEmailRoleAccessPolicyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidEmailRoleAccessPolicyException) Code() string { + return "InvalidEmailRoleAccessPolicyException" +} + +// Message returns the exception's message. +func (s InvalidEmailRoleAccessPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidEmailRoleAccessPolicyException) OrigErr() error { + return nil +} + +func (s InvalidEmailRoleAccessPolicyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidEmailRoleAccessPolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidEmailRoleAccessPolicyException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the Amazon Cognito service encounters an invalid +// AWS Lambda response. +type InvalidLambdaResponseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when the Amazon Cognito service throws an invalid AWS + // Lambda response exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidLambdaResponseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidLambdaResponseException) GoString() string { + return s.String() +} + +func newErrorInvalidLambdaResponseException(v protocol.ResponseMetadata) error { + return &InvalidLambdaResponseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidLambdaResponseException) Code() string { + return "InvalidLambdaResponseException" +} + +// Message returns the exception's message. +func (s InvalidLambdaResponseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidLambdaResponseException) OrigErr() error { + return nil +} + +func (s InvalidLambdaResponseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidLambdaResponseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidLambdaResponseException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the specified OAuth flow is invalid. +type InvalidOAuthFlowException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidOAuthFlowException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidOAuthFlowException) GoString() string { + return s.String() +} + +func newErrorInvalidOAuthFlowException(v protocol.ResponseMetadata) error { + return &InvalidOAuthFlowException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidOAuthFlowException) Code() string { + return "InvalidOAuthFlowException" +} + +// Message returns the exception's message. +func (s InvalidOAuthFlowException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidOAuthFlowException) OrigErr() error { + return nil +} + +func (s InvalidOAuthFlowException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidOAuthFlowException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidOAuthFlowException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the Amazon Cognito service encounters an invalid +// parameter. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when the Amazon Cognito service throws an invalid parameter + // exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} + +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the Amazon Cognito service encounters an invalid +// password. +type InvalidPasswordException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when the Amazon Cognito service throws an invalid user + // password exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidPasswordException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPasswordException) GoString() string { + return s.String() +} + +func newErrorInvalidPasswordException(v protocol.ResponseMetadata) error { + return &InvalidPasswordException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPasswordException) Code() string { + return "InvalidPasswordException" +} + +// Message returns the exception's message. +func (s InvalidPasswordException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPasswordException) OrigErr() error { + return nil +} + +func (s InvalidPasswordException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPasswordException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPasswordException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is returned when the role provided for SMS configuration does +// not have permission to publish using Amazon SNS. +type InvalidSmsRoleAccessPolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message retuned when the invalid SMS role access policy exception is + // thrown. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidSmsRoleAccessPolicyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidSmsRoleAccessPolicyException) GoString() string { + return s.String() +} + +func newErrorInvalidSmsRoleAccessPolicyException(v protocol.ResponseMetadata) error { + return &InvalidSmsRoleAccessPolicyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidSmsRoleAccessPolicyException) Code() string { + return "InvalidSmsRoleAccessPolicyException" +} + +// Message returns the exception's message. +func (s InvalidSmsRoleAccessPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidSmsRoleAccessPolicyException) OrigErr() error { + return nil +} + +func (s InvalidSmsRoleAccessPolicyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidSmsRoleAccessPolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidSmsRoleAccessPolicyException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the trust relationship is invalid for the role +// provided for SMS configuration. This can happen if you do not trust cognito-idp.amazonaws.com +// or the external ID provided in the role does not match what is provided in +// the SMS configuration for the user pool. +type InvalidSmsRoleTrustRelationshipException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when the role trust relationship for the SMS message + // is invalid. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidSmsRoleTrustRelationshipException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidSmsRoleTrustRelationshipException) GoString() string { + return s.String() +} + +func newErrorInvalidSmsRoleTrustRelationshipException(v protocol.ResponseMetadata) error { + return &InvalidSmsRoleTrustRelationshipException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidSmsRoleTrustRelationshipException) Code() string { + return "InvalidSmsRoleTrustRelationshipException" +} + +// Message returns the exception's message. +func (s InvalidSmsRoleTrustRelationshipException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidSmsRoleTrustRelationshipException) OrigErr() error { + return nil +} + +func (s InvalidSmsRoleTrustRelationshipException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidSmsRoleTrustRelationshipException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidSmsRoleTrustRelationshipException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the user pool configuration is invalid. +type InvalidUserPoolConfigurationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when the user pool configuration is invalid. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidUserPoolConfigurationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidUserPoolConfigurationException) GoString() string { + return s.String() +} + +func newErrorInvalidUserPoolConfigurationException(v protocol.ResponseMetadata) error { + return &InvalidUserPoolConfigurationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidUserPoolConfigurationException) Code() string { + return "InvalidUserPoolConfigurationException" +} + +// Message returns the exception's message. +func (s InvalidUserPoolConfigurationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidUserPoolConfigurationException) OrigErr() error { + return nil +} + +func (s InvalidUserPoolConfigurationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidUserPoolConfigurationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidUserPoolConfigurationException) RequestID() string { + return s.respMetadata.RequestID +} + // Specifies the configuration for AWS Lambda triggers. type LambdaConfigType struct { _ struct{} `type:"structure"` @@ -19755,6 +21560,64 @@ func (s *LambdaConfigType) SetVerifyAuthChallengeResponse(v string) *LambdaConfi return s } +// This exception is thrown when a user exceeds the limit for a requested AWS +// resource. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when Amazon Cognito throws a limit exceeded exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents the request to list the devices. type ListDevicesInput struct { _ struct{} `type:"structure"` @@ -20664,8 +22527,8 @@ type ListUsersInput struct { // // Custom attributes are not searchable. // - // For more information, see Searching for Users Using the ListUsers API (http://docs.aws.amazon.com/cognito/latest/developerguide/how-to-manage-user-accounts.html#cognito-user-pools-searching-for-users-using-listusers-api) - // and Examples of Using the ListUsers API (http://docs.aws.amazon.com/cognito/latest/developerguide/how-to-manage-user-accounts.html#cognito-user-pools-searching-for-users-listusers-api-examples) + // For more information, see Searching for Users Using the ListUsers API (https://docs.aws.amazon.com/cognito/latest/developerguide/how-to-manage-user-accounts.html#cognito-user-pools-searching-for-users-using-listusers-api) + // and Examples of Using the ListUsers API (https://docs.aws.amazon.com/cognito/latest/developerguide/how-to-manage-user-accounts.html#cognito-user-pools-searching-for-users-listusers-api-examples) // in the Amazon Cognito Developer Guide. Filter *string `type:"string"` @@ -20745,44 +22608,110 @@ func (s *ListUsersInput) SetUserPoolId(v string) *ListUsersInput { type ListUsersOutput struct { _ struct{} `type:"structure"` - // An identifier that was returned from the previous call to this operation, - // which can be used to return the next set of items in the list. - PaginationToken *string `min:"1" type:"string"` + // An identifier that was returned from the previous call to this operation, + // which can be used to return the next set of items in the list. + PaginationToken *string `min:"1" type:"string"` + + // The users returned in the request to list users. + Users []*UserType `type:"list"` +} + +// 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() +} + +// SetPaginationToken sets the PaginationToken field's value. +func (s *ListUsersOutput) SetPaginationToken(v string) *ListUsersOutput { + s.PaginationToken = &v + return s +} + +// SetUsers sets the Users field's value. +func (s *ListUsersOutput) SetUsers(v []*UserType) *ListUsersOutput { + s.Users = v + return s +} + +// This exception is thrown when Amazon Cognito cannot find a multi-factor authentication +// (MFA) method. +type MFAMethodNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when Amazon Cognito throws an MFA method not found exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s MFAMethodNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MFAMethodNotFoundException) GoString() string { + return s.String() +} + +func newErrorMFAMethodNotFoundException(v protocol.ResponseMetadata) error { + return &MFAMethodNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MFAMethodNotFoundException) Code() string { + return "MFAMethodNotFoundException" +} - // The users returned in the request to list users. - Users []*UserType `type:"list"` +// Message returns the exception's message. +func (s MFAMethodNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s ListUsersOutput) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MFAMethodNotFoundException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s ListUsersOutput) GoString() string { - return s.String() +func (s MFAMethodNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetPaginationToken sets the PaginationToken field's value. -func (s *ListUsersOutput) SetPaginationToken(v string) *ListUsersOutput { - s.PaginationToken = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s MFAMethodNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetUsers sets the Users field's value. -func (s *ListUsersOutput) SetUsers(v []*UserType) *ListUsersOutput { - s.Users = v - return s +// RequestID returns the service's response RequestID for request. +func (s MFAMethodNotFoundException) RequestID() string { + return s.respMetadata.RequestID } -// Specifies the different settings for multi-factor authentication (MFA). +// This data type is no longer supported. You can use it only for SMS MFA configurations. +// You can't use it for TOTP software token MFA configurations. +// +// To set either type of MFA configuration, use the AdminSetUserMFAPreference +// or SetUserMFAPreference actions. +// +// To look up information about either type of MFA configuration, use the AdminGetUserResponse$UserMFASettingList +// or GetUserResponse$UserMFASettingList responses. type MFAOptionType struct { _ struct{} `type:"structure"` - // The attribute name of the MFA option type. + // The attribute name of the MFA option type. The only valid value is phone_number. AttributeName *string `min:"1" type:"string"` - // The delivery medium (email message or SMS message) to send the MFA code. + // The delivery medium to send the MFA code. You can use this parameter to set + // only the SMS delivery medium value. DeliveryMedium *string `type:"string" enum:"DeliveryMediumType"` } @@ -20915,6 +22844,64 @@ func (s *NewDeviceMetadataType) SetDeviceKey(v string) *NewDeviceMetadataType { return s } +// This exception is thrown when a user is not authorized. +type NotAuthorizedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when the Amazon Cognito service returns a not authorized + // exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotAuthorizedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotAuthorizedException) GoString() string { + return s.String() +} + +func newErrorNotAuthorizedException(v protocol.ResponseMetadata) error { + return &NotAuthorizedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotAuthorizedException) Code() string { + return "NotAuthorizedException" +} + +// Message returns the exception's message. +func (s NotAuthorizedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotAuthorizedException) OrigErr() error { + return nil +} + +func (s NotAuthorizedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotAuthorizedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotAuthorizedException) RequestID() string { + return s.respMetadata.RequestID +} + // The notify configuration type. type NotifyConfigurationType struct { _ struct{} `type:"structure"` @@ -21146,6 +23133,13 @@ type PasswordPolicyType struct { // users to use at least one uppercase letter in their password. RequireUppercase *bool `type:"boolean"` + // In the password policy you have set, refers to the number of days a temporary + // password is valid. If the user does not sign-in during this time, their password + // will need to be reset by an administrator. + // + // When you set TemporaryPasswordValidityDays for a user pool, you will no longer + // be able to set the deprecated UnusedAccountValidityDays value for that user + // pool. TemporaryPasswordValidityDays *int64 `type:"integer"` } @@ -21208,6 +23202,120 @@ func (s *PasswordPolicyType) SetTemporaryPasswordValidityDays(v int64) *Password return s } +// This exception is thrown when a password reset is required. +type PasswordResetRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when a password reset is required. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PasswordResetRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PasswordResetRequiredException) GoString() string { + return s.String() +} + +func newErrorPasswordResetRequiredException(v protocol.ResponseMetadata) error { + return &PasswordResetRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PasswordResetRequiredException) Code() string { + return "PasswordResetRequiredException" +} + +// Message returns the exception's message. +func (s PasswordResetRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PasswordResetRequiredException) OrigErr() error { + return nil +} + +func (s PasswordResetRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PasswordResetRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PasswordResetRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when a precondition is not met. +type PreconditionNotMetException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when a precondition is not met. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PreconditionNotMetException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PreconditionNotMetException) GoString() string { + return s.String() +} + +func newErrorPreconditionNotMetException(v protocol.ResponseMetadata) error { + return &PreconditionNotMetException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PreconditionNotMetException) Code() string { + return "PreconditionNotMetException" +} + +// Message returns the exception's message. +func (s PreconditionNotMetException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PreconditionNotMetException) OrigErr() error { + return nil +} + +func (s PreconditionNotMetException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PreconditionNotMetException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PreconditionNotMetException) RequestID() string { + return s.respMetadata.RequestID +} + // A container for identity provider details. type ProviderDescription struct { _ struct{} `type:"structure"` @@ -21314,6 +23422,63 @@ func (s *ProviderUserIdentifierType) SetProviderName(v string) *ProviderUserIden return s } +// A map containing a priority as a key, and recovery method name as a value. +type RecoveryOptionType struct { + _ struct{} `type:"structure"` + + // Specifies the recovery method for a user. + // + // Name is a required field + Name *string `type:"string" required:"true" enum:"RecoveryOptionNameType"` + + // A positive integer specifying priority of a method with 1 being the highest + // priority. + // + // Priority is a required field + Priority *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s RecoveryOptionType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RecoveryOptionType) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RecoveryOptionType) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RecoveryOptionType"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Priority == nil { + invalidParams.Add(request.NewErrParamRequired("Priority")) + } + if s.Priority != nil && *s.Priority < 1 { + invalidParams.Add(request.NewErrParamMinValue("Priority", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *RecoveryOptionType) SetName(v string) *RecoveryOptionType { + s.Name = &v + return s +} + +// SetPriority sets the Priority field's value. +func (s *RecoveryOptionType) SetPriority(v int64) *RecoveryOptionType { + s.Priority = &v + return s +} + // Represents the request to resend the confirmation code. type ResendConfirmationCodeInput struct { _ struct{} `type:"structure"` @@ -21327,6 +23492,37 @@ type ResendConfirmationCodeInput struct { // ClientId is a required field ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"` + // A map of custom key-value pairs that you can provide as input for any custom + // workflows that this action triggers. + // + // You create custom workflows by assigning AWS Lambda functions to user pool + // triggers. When you use the ResendConfirmationCode API action, Amazon Cognito + // invokes the function that is assigned to the custom message trigger. When + // Amazon Cognito invokes this function, it passes a JSON payload, which the + // function receives as input. This payload contains a clientMetadata attribute, + // which provides the data that you assigned to the ClientMetadata parameter + // in your ResendConfirmationCode request. In your function code in AWS Lambda, + // you can process the clientMetadata value to enhance your workflow for your + // specific needs. + // + // For more information, see Customizing User Pool Workflows with Lambda Triggers + // (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html) + // in the Amazon Cognito Developer Guide. + // + // Take the following limitations into consideration when you use the ClientMetadata + // parameter: + // + // * Amazon Cognito does not store the ClientMetadata value. This data is + // available only to AWS Lambda triggers that are assigned to a user pool + // to support custom workflows. If your user pool configuration does not + // include triggers, the ClientMetadata parameter serves no purpose. + // + // * Amazon Cognito does not validate the ClientMetadata value. + // + // * Amazon Cognito does not encrypt the the ClientMetadata value, so don't + // use it to provide sensitive information. + ClientMetadata map[string]*string `type:"map"` + // A keyed-hash message authentication code (HMAC) calculated using the secret // key of a user pool client and username plus the client ID in the message. SecretHash *string `min:"1" type:"string" sensitive:"true"` @@ -21389,6 +23585,12 @@ func (s *ResendConfirmationCodeInput) SetClientId(v string) *ResendConfirmationC return s } +// SetClientMetadata sets the ClientMetadata field's value. +func (s *ResendConfirmationCodeInput) SetClientMetadata(v map[string]*string) *ResendConfirmationCodeInput { + s.ClientMetadata = v + return s +} + // SetSecretHash sets the SecretHash field's value. func (s *ResendConfirmationCodeInput) SetSecretHash(v string) *ResendConfirmationCodeInput { s.SecretHash = &v @@ -21433,6 +23635,65 @@ func (s *ResendConfirmationCodeOutput) SetCodeDeliveryDetails(v *CodeDeliveryDet return s } +// This exception is thrown when the Amazon Cognito service cannot find the +// requested resource. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when the Amazon Cognito service returns a resource not + // found exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // A resource server scope. type ResourceServerScopeType struct { _ struct{} `type:"structure"` @@ -21561,15 +23822,24 @@ type RespondToAuthChallengeInput struct { // The challenge responses. These are inputs corresponding to the value of ChallengeName, // for example: // - // * SMS_MFA: SMS_MFA_CODE, USERNAME, SECRET_HASH (if app client is configured - // with client secret). + // SECRET_HASH (if app client is configured with client secret) applies to all + // inputs below (including SOFTWARE_TOKEN_MFA). + // + // * SMS_MFA: SMS_MFA_CODE, USERNAME. // // * PASSWORD_VERIFIER: PASSWORD_CLAIM_SIGNATURE, PASSWORD_CLAIM_SECRET_BLOCK, - // TIMESTAMP, USERNAME, SECRET_HASH (if app client is configured with client - // secret). + // TIMESTAMP, USERNAME. // // * NEW_PASSWORD_REQUIRED: NEW_PASSWORD, any other required attributes, - // USERNAME, SECRET_HASH (if app client is configured with client secret). + // USERNAME. + // + // * SOFTWARE_TOKEN_MFA: USERNAME and SOFTWARE_TOKEN_MFA_CODE are required + // attributes. + // + // * DEVICE_SRP_AUTH requires USERNAME, DEVICE_KEY, SRP_A (and SECRET_HASH). + // + // * DEVICE_PASSWORD_VERIFIER requires everything that PASSWORD_VERIFIER + // requires plus DEVICE_KEY. ChallengeResponses map[string]*string `type:"map"` // The app client ID. @@ -21577,6 +23847,38 @@ type RespondToAuthChallengeInput struct { // ClientId is a required field ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"` + // A map of custom key-value pairs that you can provide as input for any custom + // workflows that this action triggers. + // + // You create custom workflows by assigning AWS Lambda functions to user pool + // triggers. When you use the RespondToAuthChallenge API action, Amazon Cognito + // invokes any functions that are assigned to the following triggers: post authentication, + // pre token generation, define auth challenge, create auth challenge, and verify + // auth challenge. When Amazon Cognito invokes any of these functions, it passes + // a JSON payload, which the function receives as input. This payload contains + // a clientMetadata attribute, which provides the data that you assigned to + // the ClientMetadata parameter in your RespondToAuthChallenge request. In your + // function code in AWS Lambda, you can process the clientMetadata value to + // enhance your workflow for your specific needs. + // + // For more information, see Customizing User Pool Workflows with Lambda Triggers + // (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html) + // in the Amazon Cognito Developer Guide. + // + // Take the following limitations into consideration when you use the ClientMetadata + // parameter: + // + // * Amazon Cognito does not store the ClientMetadata value. This data is + // available only to AWS Lambda triggers that are assigned to a user pool + // to support custom workflows. If your user pool configuration does not + // include triggers, the ClientMetadata parameter serves no purpose. + // + // * Amazon Cognito does not validate the ClientMetadata value. + // + // * Amazon Cognito does not encrypt the the ClientMetadata value, so don't + // use it to provide sensitive information. + ClientMetadata map[string]*string `type:"map"` + // The session which should be passed both ways in challenge-response calls // to the service. If InitiateAuth or RespondToAuthChallenge API call determines // that the caller needs to go through another challenge, they return a session @@ -21646,6 +23948,12 @@ func (s *RespondToAuthChallengeInput) SetClientId(v string) *RespondToAuthChalle return s } +// SetClientMetadata sets the ClientMetadata field's value. +func (s *RespondToAuthChallengeInput) SetClientMetadata(v map[string]*string) *RespondToAuthChallengeInput { + s.ClientMetadata = v + return s +} + // SetSession sets the Session field's value. func (s *RespondToAuthChallengeInput) SetSession(v string) *RespondToAuthChallengeInput { s.Session = &v @@ -21821,14 +24129,14 @@ func (s *RiskExceptionConfigurationType) SetSkippedIPRangeList(v []*string) *Ris return s } -// The SMS multi-factor authentication (MFA) settings type. +// The type used for enabling SMS MFA at the user level. type SMSMfaSettingsType struct { _ struct{} `type:"structure"` // Specifies whether SMS text message MFA is enabled. Enabled *bool `type:"boolean"` - // The preferred MFA method. + // Specifies whether SMS is the preferred MFA method. PreferredMfa *bool `type:"boolean"` } @@ -21861,7 +24169,15 @@ type SchemaAttributeType struct { // The attribute data type. AttributeDataType *string `type:"string" enum:"AttributeDataType"` - // Specifies whether the attribute type is developer only. + // + // We recommend that you use WriteAttributes (https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_UserPoolClientType.html#CognitoUserPools-Type-UserPoolClientType-WriteAttributes) + // in the user pool client to control how attributes can be mutated for new + // use cases instead of using DeveloperOnlyAttribute. + // + // Specifies whether the attribute type is developer only. This attribute can + // only be modified by an administrator. Users will not be able to modify this + // attribute using their access token. For example, DeveloperOnlyAttribute can + // be modified using the API but cannot be updated using the API. DeveloperOnlyAttribute *bool `type:"boolean"` // Specifies whether the value of the attribute can be changed. @@ -21954,6 +24270,62 @@ func (s *SchemaAttributeType) SetStringAttributeConstraints(v *StringAttributeCo return s } +// This exception is thrown when the specified scope does not exist. +type ScopeDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ScopeDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ScopeDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorScopeDoesNotExistException(v protocol.ResponseMetadata) error { + return &ScopeDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ScopeDoesNotExistException) Code() string { + return "ScopeDoesNotExistException" +} + +// Message returns the exception's message. +func (s ScopeDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ScopeDoesNotExistException) OrigErr() error { + return nil +} + +func (s ScopeDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ScopeDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ScopeDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + type SetRiskConfigurationInput struct { _ struct{} `type:"structure"` @@ -22176,7 +24548,7 @@ func (s *SetUICustomizationOutput) SetUICustomization(v *UICustomizationType) *S type SetUserMFAPreferenceInput struct { _ struct{} `type:"structure"` - // The access token. + // The access token for the user. // // AccessToken is a required field AccessToken *string `type:"string" required:"true" sensitive:"true"` @@ -22246,7 +24618,14 @@ func (s SetUserMFAPreferenceOutput) GoString() string { type SetUserPoolMfaConfigInput struct { _ struct{} `type:"structure"` - // The MFA configuration. + // The MFA configuration. Valid values include: + // + // * OFF MFA will not be used for any users. + // + // * ON MFA is required for all users to sign in. + // + // * OPTIONAL MFA will be required only for individual users who have an + // MFA factor enabled. MfaConfiguration *string `type:"string" enum:"UserPoolMfaType"` // The SMS text message MFA configuration. @@ -22319,7 +24698,14 @@ func (s *SetUserPoolMfaConfigInput) SetUserPoolId(v string) *SetUserPoolMfaConfi type SetUserPoolMfaConfigOutput struct { _ struct{} `type:"structure"` - // The MFA configuration. + // The MFA configuration. Valid values include: + // + // * OFF MFA will not be used for any users. + // + // * ON MFA is required for all users to sign in. + // + // * OPTIONAL MFA will be required only for individual users who have an + // MFA factor enabled. MfaConfiguration *string `type:"string" enum:"UserPoolMfaType"` // The SMS text message MFA configuration. @@ -22366,7 +24752,8 @@ type SetUserSettingsInput struct { // AccessToken is a required field AccessToken *string `type:"string" required:"true" sensitive:"true"` - // Specifies the options for MFA (e.g., email or phone number). + // You can use this parameter only to set an SMS configuration that uses SMS + // for delivery. // // MFAOptions is a required field MFAOptions []*MFAOptionType `type:"list" required:"true"` @@ -22448,6 +24835,37 @@ type SignUpInput struct { // ClientId is a required field ClientId *string `min:"1" type:"string" required:"true" sensitive:"true"` + // A map of custom key-value pairs that you can provide as input for any custom + // workflows that this action triggers. + // + // You create custom workflows by assigning AWS Lambda functions to user pool + // triggers. When you use the SignUp API action, Amazon Cognito invokes any + // functions that are assigned to the following triggers: pre sign-up, custom + // message, and post confirmation. When Amazon Cognito invokes any of these + // functions, it passes a JSON payload, which the function receives as input. + // This payload contains a clientMetadata attribute, which provides the data + // that you assigned to the ClientMetadata parameter in your SignUp request. + // In your function code in AWS Lambda, you can process the clientMetadata value + // to enhance your workflow for your specific needs. + // + // For more information, see Customizing User Pool Workflows with Lambda Triggers + // (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html) + // in the Amazon Cognito Developer Guide. + // + // Take the following limitations into consideration when you use the ClientMetadata + // parameter: + // + // * Amazon Cognito does not store the ClientMetadata value. This data is + // available only to AWS Lambda triggers that are assigned to a user pool + // to support custom workflows. If your user pool configuration does not + // include triggers, the ClientMetadata parameter serves no purpose. + // + // * Amazon Cognito does not validate the ClientMetadata value. + // + // * Amazon Cognito does not encrypt the the ClientMetadata value, so don't + // use it to provide sensitive information. + ClientMetadata map[string]*string `type:"map"` + // The password of the user you wish to register. // // Password is a required field @@ -22550,6 +24968,12 @@ func (s *SignUpInput) SetClientId(v string) *SignUpInput { return s } +// SetClientMetadata sets the ClientMetadata field's value. +func (s *SignUpInput) SetClientMetadata(v map[string]*string) *SignUpInput { + s.ClientMetadata = v + return s +} + // SetPassword sets the Password field's value. func (s *SignUpInput) SetPassword(v string) *SignUpInput { s.Password = &v @@ -22633,15 +25057,25 @@ func (s *SignUpOutput) SetUserSub(v string) *SignUpOutput { return s } -// The SMS configuration type. +// The SMS configuration type that includes the settings the Cognito User Pool +// needs to call for the Amazon SNS service to send an SMS message from your +// AWS account. The Cognito User Pool makes the request to the Amazon SNS Service +// by using an AWS IAM role that you provide for your AWS account. type SmsConfigurationType struct { _ struct{} `type:"structure"` - // The external ID. + // The external ID is a value that we recommend you use to add security to your + // IAM role which is used to call Amazon SNS to send SMS messages for your user + // pool. If you provide an ExternalId, the Cognito User Pool will include it + // when attempting to assume your IAM role, so that you can set your roles trust + // policy to require the ExternalID. If you use the Cognito Management Console + // to create a role for SMS MFA, Cognito will create a role with the required + // permissions and a trust policy that demonstrates use of the ExternalId. ExternalId *string `type:"string"` // The Amazon Resource Name (ARN) of the Amazon Simple Notification Service - // (SNS) caller. + // (SNS) caller. This is the ARN of the IAM role in your AWS account which Cognito + // will use to send SMS messages. // // SnsCallerArn is a required field SnsCallerArn *string `min:"20" type:"string" required:"true"` @@ -22689,7 +25123,10 @@ func (s *SmsConfigurationType) SetSnsCallerArn(v string) *SmsConfigurationType { type SmsMfaConfigType struct { _ struct{} `type:"structure"` - // The SMS authentication message. + // The SMS authentication message that will be sent to users with the code they + // need to sign in. The message must contain the ‘{####}’ placeholder, which + // will be replaced with the code. If the message is not included, and default + // message will be used. SmsAuthenticationMessage *string `min:"6" type:"string"` // The SMS configuration. @@ -22736,6 +25173,63 @@ func (s *SmsMfaConfigType) SetSmsConfiguration(v *SmsConfigurationType) *SmsMfaC return s } +// This exception is thrown when the software token TOTP multi-factor authentication +// (MFA) is not enabled for the user pool. +type SoftwareTokenMFANotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s SoftwareTokenMFANotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SoftwareTokenMFANotFoundException) GoString() string { + return s.String() +} + +func newErrorSoftwareTokenMFANotFoundException(v protocol.ResponseMetadata) error { + return &SoftwareTokenMFANotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SoftwareTokenMFANotFoundException) Code() string { + return "SoftwareTokenMFANotFoundException" +} + +// Message returns the exception's message. +func (s SoftwareTokenMFANotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SoftwareTokenMFANotFoundException) OrigErr() error { + return nil +} + +func (s SoftwareTokenMFANotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SoftwareTokenMFANotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SoftwareTokenMFANotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // The type used for enabling software token MFA at the user pool level. type SoftwareTokenMfaConfigType struct { _ struct{} `type:"structure"` @@ -22767,7 +25261,7 @@ type SoftwareTokenMfaSettingsType struct { // Specifies whether software token MFA is enabled. Enabled *bool `type:"boolean"` - // The preferred MFA method. + // Specifies whether software token MFA is the preferred MFA method. PreferredMfa *bool `type:"boolean"` } @@ -23003,7 +25497,9 @@ type TagResourceInput struct { ResourceArn *string `min:"20" type:"string" required:"true"` // The tags to assign to the user pool. - Tags map[string]*string `type:"map"` + // + // Tags is a required field + Tags map[string]*string `type:"map" required:"true"` } // String returns the string representation @@ -23025,6 +25521,9 @@ func (s *TagResourceInput) Validate() error { if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) } + if s.Tags == nil { + invalidParams.Add(request.NewErrParamRequired("Tags")) + } if invalidParams.Len() > 0 { return invalidParams @@ -23058,6 +25557,124 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// This exception is thrown when the user has made too many failed attempts +// for a given action (e.g., sign in). +type TooManyFailedAttemptsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when the Amazon Cognito service returns a too many failed + // attempts exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyFailedAttemptsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyFailedAttemptsException) GoString() string { + return s.String() +} + +func newErrorTooManyFailedAttemptsException(v protocol.ResponseMetadata) error { + return &TooManyFailedAttemptsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyFailedAttemptsException) Code() string { + return "TooManyFailedAttemptsException" +} + +// Message returns the exception's message. +func (s TooManyFailedAttemptsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyFailedAttemptsException) OrigErr() error { + return nil +} + +func (s TooManyFailedAttemptsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyFailedAttemptsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyFailedAttemptsException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the user has made too many requests for a given +// operation. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when the Amazon Cognito service returns a too many requests + // exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + // A container for the UI customization information for a user pool's built-in // app UI. type UICustomizationType struct { @@ -23137,6 +25754,178 @@ func (s *UICustomizationType) SetUserPoolId(v string) *UICustomizationType { return s } +// This exception is thrown when the Amazon Cognito service encounters an unexpected +// exception with the AWS Lambda service. +type UnexpectedLambdaException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when the Amazon Cognito service returns an unexpected + // AWS Lambda exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnexpectedLambdaException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnexpectedLambdaException) GoString() string { + return s.String() +} + +func newErrorUnexpectedLambdaException(v protocol.ResponseMetadata) error { + return &UnexpectedLambdaException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnexpectedLambdaException) Code() string { + return "UnexpectedLambdaException" +} + +// Message returns the exception's message. +func (s UnexpectedLambdaException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnexpectedLambdaException) OrigErr() error { + return nil +} + +func (s UnexpectedLambdaException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnexpectedLambdaException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnexpectedLambdaException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the specified identifier is not supported. +type UnsupportedIdentityProviderException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedIdentityProviderException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedIdentityProviderException) GoString() string { + return s.String() +} + +func newErrorUnsupportedIdentityProviderException(v protocol.ResponseMetadata) error { + return &UnsupportedIdentityProviderException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedIdentityProviderException) Code() string { + return "UnsupportedIdentityProviderException" +} + +// Message returns the exception's message. +func (s UnsupportedIdentityProviderException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedIdentityProviderException) OrigErr() error { + return nil +} + +func (s UnsupportedIdentityProviderException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedIdentityProviderException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedIdentityProviderException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request failed because the user is in an unsupported state. +type UnsupportedUserStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when the user is in an unsupported state. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedUserStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedUserStateException) GoString() string { + return s.String() +} + +func newErrorUnsupportedUserStateException(v protocol.ResponseMetadata) error { + return &UnsupportedUserStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedUserStateException) Code() string { + return "UnsupportedUserStateException" +} + +// Message returns the exception's message. +func (s UnsupportedUserStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedUserStateException) OrigErr() error { + return nil +} + +func (s UnsupportedUserStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedUserStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedUserStateException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -23147,7 +25936,9 @@ type UntagResourceInput struct { ResourceArn *string `min:"20" type:"string" required:"true"` // The keys of the tags to remove from the user pool. - TagKeys []*string `type:"list"` + // + // TagKeys is a required field + TagKeys []*string `type:"list" required:"true"` } // String returns the string representation @@ -23169,6 +25960,9 @@ func (s *UntagResourceInput) Validate() error { if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) } + if s.TagKeys == nil { + invalidParams.Add(request.NewErrParamRequired("TagKeys")) + } if invalidParams.Len() > 0 { return invalidParams @@ -23750,6 +26544,37 @@ type UpdateUserAttributesInput struct { // AccessToken is a required field AccessToken *string `type:"string" required:"true" sensitive:"true"` + // A map of custom key-value pairs that you can provide as input for any custom + // workflows that this action triggers. + // + // You create custom workflows by assigning AWS Lambda functions to user pool + // triggers. When you use the UpdateUserAttributes API action, Amazon Cognito + // invokes the function that is assigned to the custom message trigger. When + // Amazon Cognito invokes this function, it passes a JSON payload, which the + // function receives as input. This payload contains a clientMetadata attribute, + // which provides the data that you assigned to the ClientMetadata parameter + // in your UpdateUserAttributes request. In your function code in AWS Lambda, + // you can process the clientMetadata value to enhance your workflow for your + // specific needs. + // + // For more information, see Customizing User Pool Workflows with Lambda Triggers + // (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools-working-with-aws-lambda-triggers.html) + // in the Amazon Cognito Developer Guide. + // + // Take the following limitations into consideration when you use the ClientMetadata + // parameter: + // + // * Amazon Cognito does not store the ClientMetadata value. This data is + // available only to AWS Lambda triggers that are assigned to a user pool + // to support custom workflows. If your user pool configuration does not + // include triggers, the ClientMetadata parameter serves no purpose. + // + // * Amazon Cognito does not validate the ClientMetadata value. + // + // * Amazon Cognito does not encrypt the the ClientMetadata value, so don't + // use it to provide sensitive information. + ClientMetadata map[string]*string `type:"map"` + // An array of name-value pairs representing user attributes. // // For custom attributes, you must prepend the custom: prefix to the attribute @@ -23801,6 +26626,12 @@ func (s *UpdateUserAttributesInput) SetAccessToken(v string) *UpdateUserAttribut return s } +// SetClientMetadata sets the ClientMetadata field's value. +func (s *UpdateUserAttributesInput) SetClientMetadata(v map[string]*string) *UpdateUserAttributesInput { + s.ClientMetadata = v + return s +} + // SetUserAttributes sets the UserAttributes field's value. func (s *UpdateUserAttributesInput) SetUserAttributes(v []*AttributeType) *UpdateUserAttributesInput { s.UserAttributes = v @@ -23836,17 +26667,27 @@ func (s *UpdateUserAttributesOutput) SetCodeDeliveryDetailsList(v []*CodeDeliver type UpdateUserPoolClientInput struct { _ struct{} `type:"structure"` + // The allowed OAuth flows. + // // Set to code to initiate a code grant flow, which provides an authorization // code as the response. This code can be exchanged for access tokens with the // token endpoint. + // + // Set to implicit to specify that the client should get the access token (and, + // optionally, ID token, based on scopes) directly. + // + // Set to client_credentials to specify that the client should get the access + // token (and, optionally, ID token, based on scopes) from the token endpoint + // using a combination of client and client_secret. AllowedOAuthFlows []*string `type:"list"` - // Set to TRUE if the client is allowed to follow the OAuth protocol when interacting + // Set to true if the client is allowed to follow the OAuth protocol when interacting // with Cognito user pools. AllowedOAuthFlowsUserPoolClient *bool `type:"boolean"` - // A list of allowed OAuth scopes. Currently supported values are "phone", "email", - // "openid", and "Cognito". + // The allowed OAuth scopes. Possible values provided by OAuth are: phone, email, + // openid, and profile. Possible values provided by AWS are: aws.cognito.signin.user.admin. + // Custom scopes created in Resource Servers are also supported. AllowedOAuthScopes []*string `type:"list"` // The Amazon Pinpoint analytics configuration for collecting metrics for this @@ -23897,12 +26738,71 @@ type UpdateUserPoolClientInput struct { // App callback URLs such as myapp://example are also supported. DefaultRedirectURI *string `min:"1" type:"string"` - // Explicit authentication flows. + // The authentication flows that are supported by the user pool clients. Flow + // names without the ALLOW_ prefix are deprecated in favor of new names with + // the ALLOW_ prefix. Note that values with ALLOW_ prefix cannot be used along + // with values without ALLOW_ prefix. + // + // Valid values include: + // + // * ALLOW_ADMIN_USER_PASSWORD_AUTH: Enable admin based user password authentication + // flow ADMIN_USER_PASSWORD_AUTH. This setting replaces the ADMIN_NO_SRP_AUTH + // setting. With this authentication flow, Cognito receives the password + // in the request instead of using the SRP (Secure Remote Password protocol) + // protocol to verify passwords. + // + // * ALLOW_CUSTOM_AUTH: Enable Lambda trigger based authentication. + // + // * ALLOW_USER_PASSWORD_AUTH: Enable user password-based authentication. + // In this flow, Cognito receives the password in the request instead of + // using the SRP protocol to verify passwords. + // + // * ALLOW_USER_SRP_AUTH: Enable SRP based authentication. + // + // * ALLOW_REFRESH_TOKEN_AUTH: Enable authflow to refresh tokens. ExplicitAuthFlows []*string `type:"list"` // A list of allowed logout URLs for the identity providers. LogoutURLs []*string `type:"list"` + // Use this setting to choose which errors and responses are returned by Cognito + // APIs during authentication, account confirmation, and password recovery when + // the user does not exist in the user pool. When set to ENABLED and the user + // does not exist, authentication returns an error indicating either the username + // or password was incorrect, and account confirmation and password recovery + // return a response indicating a code was sent to a simulated destination. + // When set to LEGACY, those APIs will return a UserNotFoundException exception + // if the user does not exist in the user pool. + // + // Valid values include: + // + // * ENABLED - This prevents user existence-related errors. + // + // * LEGACY - This represents the old behavior of Cognito where user existence + // related errors are not prevented. + // + // This setting affects the behavior of following APIs: + // + // * AdminInitiateAuth + // + // * AdminRespondToAuthChallenge + // + // * InitiateAuth + // + // * RespondToAuthChallenge + // + // * ForgotPassword + // + // * ConfirmForgotPassword + // + // * ConfirmSignUp + // + // * ResendConfirmationCode + // + // After February 15th 2020, the value of PreventUserExistenceErrors will default + // to ENABLED for newly created user pool clients if no value is provided. + PreventUserExistenceErrors *string `type:"string" enum:"PreventUserExistenceErrorTypes"` + // The read-only attributes of the user pool. ReadAttributes []*string `type:"list"` @@ -24027,6 +26927,12 @@ func (s *UpdateUserPoolClientInput) SetLogoutURLs(v []*string) *UpdateUserPoolCl return s } +// SetPreventUserExistenceErrors sets the PreventUserExistenceErrors field's value. +func (s *UpdateUserPoolClientInput) SetPreventUserExistenceErrors(v string) *UpdateUserPoolClientInput { + s.PreventUserExistenceErrors = &v + return s +} + // SetReadAttributes sets the ReadAttributes field's value. func (s *UpdateUserPoolClientInput) SetReadAttributes(v []*string) *UpdateUserPoolClientInput { s.ReadAttributes = v @@ -24198,6 +27104,15 @@ func (s *UpdateUserPoolDomainOutput) SetCloudFrontDomain(v string) *UpdateUserPo type UpdateUserPoolInput struct { _ struct{} `type:"structure"` + // Use this setting to define which verified available method a user can use + // to recover their password when they call ForgotPassword. It allows you to + // define a preferred method when a user has more than one method available. + // With this setting, SMS does not qualify for a valid password recovery mechanism + // if the user also has SMS MFA enabled. In the absence of this setting, Cognito + // uses the legacy behavior to determine the recovery method where SMS is preferred + // over email. + AccountRecoverySetting *AccountRecoverySettingType `type:"structure"` + // The configuration for AdminCreateUser requests. AdminCreateUserConfig *AdminCreateUserConfigType `type:"structure"` @@ -24293,6 +27208,11 @@ func (s *UpdateUserPoolInput) Validate() error { if s.UserPoolId != nil && len(*s.UserPoolId) < 1 { invalidParams.Add(request.NewErrParamMinLen("UserPoolId", 1)) } + if s.AccountRecoverySetting != nil { + if err := s.AccountRecoverySetting.Validate(); err != nil { + invalidParams.AddNested("AccountRecoverySetting", err.(request.ErrInvalidParams)) + } + } if s.AdminCreateUserConfig != nil { if err := s.AdminCreateUserConfig.Validate(); err != nil { invalidParams.AddNested("AdminCreateUserConfig", err.(request.ErrInvalidParams)) @@ -24335,6 +27255,12 @@ func (s *UpdateUserPoolInput) Validate() error { return nil } +// SetAccountRecoverySetting sets the AccountRecoverySetting field's value. +func (s *UpdateUserPoolInput) SetAccountRecoverySetting(v *AccountRecoverySettingType) *UpdateUserPoolInput { + s.AccountRecoverySetting = v + return s +} + // SetAdminCreateUserConfig sets the AdminCreateUserConfig field's value. func (s *UpdateUserPoolInput) SetAdminCreateUserConfig(v *AdminCreateUserConfigType) *UpdateUserPoolInput { s.AdminCreateUserConfig = v @@ -24464,15 +27390,73 @@ func (s UserContextDataType) String() string { return awsutil.Prettify(s) } -// GoString returns the string representation -func (s UserContextDataType) GoString() string { - return s.String() +// GoString returns the string representation +func (s UserContextDataType) GoString() string { + return s.String() +} + +// SetEncodedData sets the EncodedData field's value. +func (s *UserContextDataType) SetEncodedData(v string) *UserContextDataType { + s.EncodedData = &v + return s +} + +// This exception is thrown when you are trying to modify a user pool while +// a user import job is in progress for that pool. +type UserImportInProgressException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when the user pool has an import job running. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UserImportInProgressException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserImportInProgressException) GoString() string { + return s.String() +} + +func newErrorUserImportInProgressException(v protocol.ResponseMetadata) error { + return &UserImportInProgressException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UserImportInProgressException) Code() string { + return "UserImportInProgressException" +} + +// Message returns the exception's message. +func (s UserImportInProgressException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UserImportInProgressException) OrigErr() error { + return nil +} + +func (s UserImportInProgressException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UserImportInProgressException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetEncodedData sets the EncodedData field's value. -func (s *UserContextDataType) SetEncodedData(v string) *UserContextDataType { - s.EncodedData = &v - return s +// RequestID returns the service's response RequestID for request. +func (s UserImportInProgressException) RequestID() string { + return s.respMetadata.RequestID } // The user import job type. @@ -24630,6 +27614,235 @@ func (s *UserImportJobType) SetUserPoolId(v string) *UserImportJobType { return s } +// This exception is thrown when the Amazon Cognito service encounters a user +// validation exception with the AWS Lambda service. +type UserLambdaValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when the Amazon Cognito service returns a user validation + // exception with the AWS Lambda service. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UserLambdaValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserLambdaValidationException) GoString() string { + return s.String() +} + +func newErrorUserLambdaValidationException(v protocol.ResponseMetadata) error { + return &UserLambdaValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UserLambdaValidationException) Code() string { + return "UserLambdaValidationException" +} + +// Message returns the exception's message. +func (s UserLambdaValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UserLambdaValidationException) OrigErr() error { + return nil +} + +func (s UserLambdaValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UserLambdaValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UserLambdaValidationException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when a user is not confirmed successfully. +type UserNotConfirmedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when a user is not confirmed successfully. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UserNotConfirmedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserNotConfirmedException) GoString() string { + return s.String() +} + +func newErrorUserNotConfirmedException(v protocol.ResponseMetadata) error { + return &UserNotConfirmedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UserNotConfirmedException) Code() string { + return "UserNotConfirmedException" +} + +// Message returns the exception's message. +func (s UserNotConfirmedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UserNotConfirmedException) OrigErr() error { + return nil +} + +func (s UserNotConfirmedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UserNotConfirmedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UserNotConfirmedException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when a user is not found. +type UserNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when a user is not found. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UserNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserNotFoundException) GoString() string { + return s.String() +} + +func newErrorUserNotFoundException(v protocol.ResponseMetadata) error { + return &UserNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UserNotFoundException) Code() string { + return "UserNotFoundException" +} + +// Message returns the exception's message. +func (s UserNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UserNotFoundException) OrigErr() error { + return nil +} + +func (s UserNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UserNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UserNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when user pool add-ons are not enabled. +type UserPoolAddOnNotEnabledException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UserPoolAddOnNotEnabledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserPoolAddOnNotEnabledException) GoString() string { + return s.String() +} + +func newErrorUserPoolAddOnNotEnabledException(v protocol.ResponseMetadata) error { + return &UserPoolAddOnNotEnabledException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UserPoolAddOnNotEnabledException) Code() string { + return "UserPoolAddOnNotEnabledException" +} + +// Message returns the exception's message. +func (s UserPoolAddOnNotEnabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UserPoolAddOnNotEnabledException) OrigErr() error { + return nil +} + +func (s UserPoolAddOnNotEnabledException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UserPoolAddOnNotEnabledException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UserPoolAddOnNotEnabledException) RequestID() string { + return s.respMetadata.RequestID +} + // The user pool add-ons type. type UserPoolAddOnsType struct { _ struct{} `type:"structure"` @@ -24716,20 +27929,27 @@ func (s *UserPoolClientDescription) SetUserPoolId(v string) *UserPoolClientDescr type UserPoolClientType struct { _ struct{} `type:"structure"` + // The allowed OAuth flows. + // // Set to code to initiate a code grant flow, which provides an authorization // code as the response. This code can be exchanged for access tokens with the // token endpoint. // - // Set to token to specify that the client should get the access token (and, + // Set to implicit to specify that the client should get the access token (and, // optionally, ID token, based on scopes) directly. + // + // Set to client_credentials to specify that the client should get the access + // token (and, optionally, ID token, based on scopes) from the token endpoint + // using a combination of client and client_secret. AllowedOAuthFlows []*string `type:"list"` - // Set to TRUE if the client is allowed to follow the OAuth protocol when interacting + // Set to true if the client is allowed to follow the OAuth protocol when interacting // with Cognito user pools. AllowedOAuthFlowsUserPoolClient *bool `type:"boolean"` - // A list of allowed OAuth scopes. Currently supported values are "phone", "email", - // "openid", and "Cognito". + // The allowed OAuth scopes. Possible values provided by OAuth are: phone, email, + // openid, and profile. Possible values provided by AWS are: aws.cognito.signin.user.admin. + // Custom scopes created in Resource Servers are also supported. AllowedOAuthScopes []*string `type:"list"` // The Amazon Pinpoint analytics configuration for the user pool client. @@ -24783,7 +28003,28 @@ type UserPoolClientType struct { // App callback URLs such as myapp://example are also supported. DefaultRedirectURI *string `min:"1" type:"string"` - // The explicit authentication flows. + // The authentication flows that are supported by the user pool clients. Flow + // names without the ALLOW_ prefix are deprecated in favor of new names with + // the ALLOW_ prefix. Note that values with ALLOW_ prefix cannot be used along + // with values without ALLOW_ prefix. + // + // Valid values include: + // + // * ALLOW_ADMIN_USER_PASSWORD_AUTH: Enable admin based user password authentication + // flow ADMIN_USER_PASSWORD_AUTH. This setting replaces the ADMIN_NO_SRP_AUTH + // setting. With this authentication flow, Cognito receives the password + // in the request instead of using the SRP (Secure Remote Password protocol) + // protocol to verify passwords. + // + // * ALLOW_CUSTOM_AUTH: Enable Lambda trigger based authentication. + // + // * ALLOW_USER_PASSWORD_AUTH: Enable user password-based authentication. + // In this flow, Cognito receives the password in the request instead of + // using the SRP protocol to verify passwords. + // + // * ALLOW_USER_SRP_AUTH: Enable SRP based authentication. + // + // * ALLOW_REFRESH_TOKEN_AUTH: Enable authflow to refresh tokens. ExplicitAuthFlows []*string `type:"list"` // The date the user pool client was last modified. @@ -24792,6 +28033,44 @@ type UserPoolClientType struct { // A list of allowed logout URLs for the identity providers. LogoutURLs []*string `type:"list"` + // Use this setting to choose which errors and responses are returned by Cognito + // APIs during authentication, account confirmation, and password recovery when + // the user does not exist in the user pool. When set to ENABLED and the user + // does not exist, authentication returns an error indicating either the username + // or password was incorrect, and account confirmation and password recovery + // return a response indicating a code was sent to a simulated destination. + // When set to LEGACY, those APIs will return a UserNotFoundException exception + // if the user does not exist in the user pool. + // + // Valid values include: + // + // * ENABLED - This prevents user existence-related errors. + // + // * LEGACY - This represents the old behavior of Cognito where user existence + // related errors are not prevented. + // + // This setting affects the behavior of following APIs: + // + // * AdminInitiateAuth + // + // * AdminRespondToAuthChallenge + // + // * InitiateAuth + // + // * RespondToAuthChallenge + // + // * ForgotPassword + // + // * ConfirmForgotPassword + // + // * ConfirmSignUp + // + // * ResendConfirmationCode + // + // After February 15th 2020, the value of PreventUserExistenceErrors will default + // to ENABLED for newly created user pool clients if no value is provided. + PreventUserExistenceErrors *string `type:"string" enum:"PreventUserExistenceErrorTypes"` + // The Read-only attributes. ReadAttributes []*string `type:"list"` @@ -24898,6 +28177,12 @@ func (s *UserPoolClientType) SetLogoutURLs(v []*string) *UserPoolClientType { return s } +// SetPreventUserExistenceErrors sets the PreventUserExistenceErrors field's value. +func (s *UserPoolClientType) SetPreventUserExistenceErrors(v string) *UserPoolClientType { + s.PreventUserExistenceErrors = &v + return s +} + // SetReadAttributes sets the ReadAttributes field's value. func (s *UserPoolClientType) SetReadAttributes(v []*string) *UserPoolClientType { s.ReadAttributes = v @@ -25036,10 +28321,75 @@ func (s *UserPoolPolicyType) SetPasswordPolicy(v *PasswordPolicyType) *UserPoolP return s } +// This exception is thrown when a user pool tag cannot be set or updated. +type UserPoolTaggingException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UserPoolTaggingException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserPoolTaggingException) GoString() string { + return s.String() +} + +func newErrorUserPoolTaggingException(v protocol.ResponseMetadata) error { + return &UserPoolTaggingException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UserPoolTaggingException) Code() string { + return "UserPoolTaggingException" +} + +// Message returns the exception's message. +func (s UserPoolTaggingException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UserPoolTaggingException) OrigErr() error { + return nil +} + +func (s UserPoolTaggingException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UserPoolTaggingException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UserPoolTaggingException) RequestID() string { + return s.respMetadata.RequestID +} + // A container for information about the user pool. type UserPoolType struct { _ struct{} `type:"structure"` + // Use this setting to define which verified available method a user can use + // to recover their password when they call ForgotPassword. It allows you to + // define a preferred method when a user has more than one method available. + // With this setting, SMS does not qualify for a valid password recovery mechanism + // if the user also has SMS MFA enabled. In the absence of this setting, Cognito + // uses the legacy behavior to determine the recovery method where SMS is preferred + // over email. + AccountRecoverySetting *AccountRecoverySettingType `type:"structure"` + // The configuration for AdminCreateUser requests. AdminCreateUserConfig *AdminCreateUserConfigType `type:"structure"` @@ -25140,6 +28490,12 @@ type UserPoolType struct { // when a user signs up. UsernameAttributes []*string `type:"list"` + // You can choose to enable case sensitivity on the username input for the selected + // sign-in option. For example, when this is set to False, users will be able + // to sign in using either "username" or "Username". This configuration is immutable + // once it has been set. For more information, see . + UsernameConfiguration *UsernameConfigurationType `type:"structure"` + // The template for verification messages. VerificationMessageTemplate *VerificationMessageTemplateType `type:"structure"` } @@ -25154,6 +28510,12 @@ func (s UserPoolType) GoString() string { return s.String() } +// SetAccountRecoverySetting sets the AccountRecoverySetting field's value. +func (s *UserPoolType) SetAccountRecoverySetting(v *AccountRecoverySettingType) *UserPoolType { + s.AccountRecoverySetting = v + return s +} + // SetAdminCreateUserConfig sets the AdminCreateUserConfig field's value. func (s *UserPoolType) SetAdminCreateUserConfig(v *AdminCreateUserConfigType) *UserPoolType { s.AdminCreateUserConfig = v @@ -25322,6 +28684,12 @@ func (s *UserPoolType) SetUsernameAttributes(v []*string) *UserPoolType { return s } +// SetUsernameConfiguration sets the UsernameConfiguration field's value. +func (s *UserPoolType) SetUsernameConfiguration(v *UsernameConfigurationType) *UserPoolType { + s.UsernameConfiguration = v + return s +} + // SetVerificationMessageTemplate sets the VerificationMessageTemplate field's value. func (s *UserPoolType) SetVerificationMessageTemplate(v *VerificationMessageTemplateType) *UserPoolType { s.VerificationMessageTemplate = v @@ -25423,6 +28791,115 @@ func (s *UserType) SetUsername(v string) *UserType { return s } +// The username configuration type. +type UsernameConfigurationType struct { + _ struct{} `type:"structure"` + + // Specifies whether username case sensitivity will be applied for all users + // in the user pool through Cognito APIs. + // + // Valid values include: + // + // * True : Enables case sensitivity for all username input. When this option + // is set to True, users must sign in using the exact capitalization of their + // given username. For example, “UserName”. This is the default value. + // + // * False : Enables case insensitivity for all username input. For example, + // when this option is set to False, users will be able to sign in using + // either "username" or "Username". This option also enables both preferred_username + // and email alias to be case insensitive, in addition to the username attribute. + // + // CaseSensitive is a required field + CaseSensitive *bool `type:"boolean" required:"true"` +} + +// String returns the string representation +func (s UsernameConfigurationType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UsernameConfigurationType) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UsernameConfigurationType) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UsernameConfigurationType"} + if s.CaseSensitive == nil { + invalidParams.Add(request.NewErrParamRequired("CaseSensitive")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCaseSensitive sets the CaseSensitive field's value. +func (s *UsernameConfigurationType) SetCaseSensitive(v bool) *UsernameConfigurationType { + s.CaseSensitive = &v + return s +} + +// This exception is thrown when Amazon Cognito encounters a user name that +// already exists in the user pool. +type UsernameExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message returned when Amazon Cognito throws a user name exists exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UsernameExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UsernameExistsException) GoString() string { + return s.String() +} + +func newErrorUsernameExistsException(v protocol.ResponseMetadata) error { + return &UsernameExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UsernameExistsException) Code() string { + return "UsernameExistsException" +} + +// Message returns the exception's message. +func (s UsernameExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UsernameExistsException) OrigErr() error { + return nil +} + +func (s UsernameExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UsernameExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UsernameExistsException) RequestID() string { + return s.respMetadata.RequestID +} + // The template for verification messages. type VerificationMessageTemplateType struct { _ struct{} `type:"structure"` @@ -25780,6 +29257,9 @@ const ( // AuthFlowTypeUserPasswordAuth is a AuthFlowType enum value AuthFlowTypeUserPasswordAuth = "USER_PASSWORD_AUTH" + + // AuthFlowTypeAdminUserPasswordAuth is a AuthFlowType enum value + AuthFlowTypeAdminUserPasswordAuth = "ADMIN_USER_PASSWORD_AUTH" ) const ( @@ -25926,6 +29406,21 @@ const ( // ExplicitAuthFlowsTypeUserPasswordAuth is a ExplicitAuthFlowsType enum value ExplicitAuthFlowsTypeUserPasswordAuth = "USER_PASSWORD_AUTH" + + // ExplicitAuthFlowsTypeAllowAdminUserPasswordAuth is a ExplicitAuthFlowsType enum value + ExplicitAuthFlowsTypeAllowAdminUserPasswordAuth = "ALLOW_ADMIN_USER_PASSWORD_AUTH" + + // ExplicitAuthFlowsTypeAllowCustomAuth is a ExplicitAuthFlowsType enum value + ExplicitAuthFlowsTypeAllowCustomAuth = "ALLOW_CUSTOM_AUTH" + + // ExplicitAuthFlowsTypeAllowUserPasswordAuth is a ExplicitAuthFlowsType enum value + ExplicitAuthFlowsTypeAllowUserPasswordAuth = "ALLOW_USER_PASSWORD_AUTH" + + // ExplicitAuthFlowsTypeAllowUserSrpAuth is a ExplicitAuthFlowsType enum value + ExplicitAuthFlowsTypeAllowUserSrpAuth = "ALLOW_USER_SRP_AUTH" + + // ExplicitAuthFlowsTypeAllowRefreshTokenAuth is a ExplicitAuthFlowsType enum value + ExplicitAuthFlowsTypeAllowRefreshTokenAuth = "ALLOW_REFRESH_TOKEN_AUTH" ) const ( @@ -25949,6 +29444,9 @@ const ( // IdentityProviderTypeTypeLoginWithAmazon is a IdentityProviderTypeType enum value IdentityProviderTypeTypeLoginWithAmazon = "LoginWithAmazon" + // IdentityProviderTypeTypeSignInWithApple is a IdentityProviderTypeType enum value + IdentityProviderTypeTypeSignInWithApple = "SignInWithApple" + // IdentityProviderTypeTypeOidc is a IdentityProviderTypeType enum value IdentityProviderTypeTypeOidc = "OIDC" ) @@ -25972,6 +29470,25 @@ const ( OAuthFlowTypeClientCredentials = "client_credentials" ) +const ( + // PreventUserExistenceErrorTypesLegacy is a PreventUserExistenceErrorTypes enum value + PreventUserExistenceErrorTypesLegacy = "LEGACY" + + // PreventUserExistenceErrorTypesEnabled is a PreventUserExistenceErrorTypes enum value + PreventUserExistenceErrorTypesEnabled = "ENABLED" +) + +const ( + // RecoveryOptionNameTypeVerifiedEmail is a RecoveryOptionNameType enum value + RecoveryOptionNameTypeVerifiedEmail = "verified_email" + + // RecoveryOptionNameTypeVerifiedPhoneNumber is a RecoveryOptionNameType enum value + RecoveryOptionNameTypeVerifiedPhoneNumber = "verified_phone_number" + + // RecoveryOptionNameTypeAdminOnly is a RecoveryOptionNameType enum value + RecoveryOptionNameTypeAdminOnly = "admin_only" +) + const ( // RiskDecisionTypeNoRisk is a RiskDecisionType enum value RiskDecisionTypeNoRisk = "NoRisk" diff --git a/vendor/github.com/aws/aws-sdk-go/service/cognitoidentityprovider/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cognitoidentityprovider/errors.go index 302ec049a87..42bc57477aa 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cognitoidentityprovider/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cognitoidentityprovider/errors.go @@ -2,6 +2,10 @@ package cognitoidentityprovider +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAliasExistsException for service response error code @@ -251,3 +255,43 @@ const ( // already exists in the user pool. ErrCodeUsernameExistsException = "UsernameExistsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AliasExistsException": newErrorAliasExistsException, + "CodeDeliveryFailureException": newErrorCodeDeliveryFailureException, + "CodeMismatchException": newErrorCodeMismatchException, + "ConcurrentModificationException": newErrorConcurrentModificationException, + "DuplicateProviderException": newErrorDuplicateProviderException, + "EnableSoftwareTokenMFAException": newErrorEnableSoftwareTokenMFAException, + "ExpiredCodeException": newErrorExpiredCodeException, + "GroupExistsException": newErrorGroupExistsException, + "InternalErrorException": newErrorInternalErrorException, + "InvalidEmailRoleAccessPolicyException": newErrorInvalidEmailRoleAccessPolicyException, + "InvalidLambdaResponseException": newErrorInvalidLambdaResponseException, + "InvalidOAuthFlowException": newErrorInvalidOAuthFlowException, + "InvalidParameterException": newErrorInvalidParameterException, + "InvalidPasswordException": newErrorInvalidPasswordException, + "InvalidSmsRoleAccessPolicyException": newErrorInvalidSmsRoleAccessPolicyException, + "InvalidSmsRoleTrustRelationshipException": newErrorInvalidSmsRoleTrustRelationshipException, + "InvalidUserPoolConfigurationException": newErrorInvalidUserPoolConfigurationException, + "LimitExceededException": newErrorLimitExceededException, + "MFAMethodNotFoundException": newErrorMFAMethodNotFoundException, + "NotAuthorizedException": newErrorNotAuthorizedException, + "PasswordResetRequiredException": newErrorPasswordResetRequiredException, + "PreconditionNotMetException": newErrorPreconditionNotMetException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ScopeDoesNotExistException": newErrorScopeDoesNotExistException, + "SoftwareTokenMFANotFoundException": newErrorSoftwareTokenMFANotFoundException, + "TooManyFailedAttemptsException": newErrorTooManyFailedAttemptsException, + "TooManyRequestsException": newErrorTooManyRequestsException, + "UnexpectedLambdaException": newErrorUnexpectedLambdaException, + "UnsupportedIdentityProviderException": newErrorUnsupportedIdentityProviderException, + "UnsupportedUserStateException": newErrorUnsupportedUserStateException, + "UserImportInProgressException": newErrorUserImportInProgressException, + "UserLambdaValidationException": newErrorUserLambdaValidationException, + "UserNotConfirmedException": newErrorUserNotConfirmedException, + "UserNotFoundException": newErrorUserNotFoundException, + "UserPoolAddOnNotEnabledException": newErrorUserPoolAddOnNotEnabledException, + "UserPoolTaggingException": newErrorUserPoolTaggingException, + "UsernameExistsException": newErrorUsernameExistsException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cognitoidentityprovider/service.go b/vendor/github.com/aws/aws-sdk-go/service/cognitoidentityprovider/service.go index 68efbd80b6e..142666df445 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/cognitoidentityprovider/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/cognitoidentityprovider/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "cognito-idp" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Cognito Identity Provider" // ServiceID is a unique identifer of a specific service. + ServiceID = "Cognito Identity Provider" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CognitoIdentityProvider client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CognitoIdentityProvider client from just a session. // svc := cognitoidentityprovider.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := cognitoidentityprovider.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *CognitoIdentityProvider { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CognitoIdentityProvider { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CognitoIdentityProvider { svc := &CognitoIdentityProvider{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-04-18", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index f901df62789..42c7282c8c1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/configservice/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/configservice/api.go @@ -74,11 +74,11 @@ func (c *ConfigService) BatchGetAggregateResourceConfigRequest(input *BatchGetAg // See the AWS API reference guide for AWS Config's // API operation BatchGetAggregateResourceConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The requested action is not valid. // -// * ErrCodeNoSuchConfigurationAggregatorException "NoSuchConfigurationAggregatorException" +// * NoSuchConfigurationAggregatorException // You have specified a configuration aggregator that does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/BatchGetAggregateResourceConfig @@ -164,11 +164,11 @@ func (c *ConfigService) BatchGetResourceConfigRequest(input *BatchGetResourceCon // See the AWS API reference guide for AWS Config's // API operation BatchGetResourceConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The requested action is not valid. // -// * ErrCodeNoAvailableConfigurationRecorderException "NoAvailableConfigurationRecorderException" +// * NoAvailableConfigurationRecorderException // There are no configuration recorders available to provide the role needed // to describe your resources. Create a configuration recorder. // @@ -249,8 +249,8 @@ func (c *ConfigService) DeleteAggregationAuthorizationRequest(input *DeleteAggre // See the AWS API reference guide for AWS Config's // API operation DeleteAggregationAuthorization for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // @@ -336,22 +336,22 @@ func (c *ConfigService) DeleteConfigRuleRequest(input *DeleteConfigRuleInput) (r // See the AWS API reference guide for AWS Config's // API operation DeleteConfigRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchConfigRuleException "NoSuchConfigRuleException" +// Returned Error Types: +// * NoSuchConfigRuleException // One or more AWS Config rules in the request are invalid. Verify that the // rule names are correct and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // You see this exception in the following cases: // -// * For DeleteConfigRule API, AWS Config is deleting this rule. Try your -// request again later. +// * For DeleteConfigRule, AWS Config is deleting this rule. Try your request +// again later. // -// * For DeleteConfigRule API, the rule is deleting your evaluation results. +// * For DeleteConfigRule, the rule is deleting your evaluation results. // Try your request again later. // -// * For DeleteConfigRule API, a remediation action is associated with the -// rule and AWS Config cannot delete this rule. Delete the remediation action +// * For DeleteConfigRule, a remediation action is associated with the rule +// and AWS Config cannot delete this rule. Delete the remediation action // associated with the rule before deleting the rule and try your request // again later. // @@ -361,6 +361,13 @@ func (c *ConfigService) DeleteConfigRuleRequest(input *DeleteConfigRuleInput) (r // * For DeleteOrganizationConfigRule, organization config rule creation // is in progress. Try your request again later. // +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack creation, update, and deletion is in progress. Try your request again +// later. +// +// * For DeleteConformancePack, a conformance pack creation, update, and +// deletion is in progress. Try your request again later. +// // See also, 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) @@ -438,8 +445,8 @@ func (c *ConfigService) DeleteConfigurationAggregatorRequest(input *DeleteConfig // See the AWS API reference guide for AWS Config's // API operation DeleteConfigurationAggregator for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchConfigurationAggregatorException "NoSuchConfigurationAggregatorException" +// Returned Error Types: +// * NoSuchConfigurationAggregatorException // You have specified a configuration aggregator that does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteConfigurationAggregator @@ -527,8 +534,8 @@ func (c *ConfigService) DeleteConfigurationRecorderRequest(input *DeleteConfigur // See the AWS API reference guide for AWS Config's // API operation DeleteConfigurationRecorder for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchConfigurationRecorderException "NoSuchConfigurationRecorderException" +// Returned Error Types: +// * NoSuchConfigurationRecorderException // You have specified a configuration recorder that does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteConfigurationRecorder @@ -553,6 +560,117 @@ func (c *ConfigService) DeleteConfigurationRecorderWithContext(ctx aws.Context, return out, req.Send() } +const opDeleteConformancePack = "DeleteConformancePack" + +// DeleteConformancePackRequest generates a "aws/request.Request" representing the +// client's request for the DeleteConformancePack operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteConformancePack for more information on using the DeleteConformancePack +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteConformancePackRequest method. +// req, resp := client.DeleteConformancePackRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteConformancePack +func (c *ConfigService) DeleteConformancePackRequest(input *DeleteConformancePackInput) (req *request.Request, output *DeleteConformancePackOutput) { + op := &request.Operation{ + Name: opDeleteConformancePack, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteConformancePackInput{} + } + + output = &DeleteConformancePackOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteConformancePack API operation for AWS Config. +// +// Deletes the specified conformance pack and all the AWS Config rules, remediation +// actions, and all evaluation results within that conformance pack. +// +// AWS Config sets the conformance pack to DELETE_IN_PROGRESS until the deletion +// is complete. You cannot update a conformance pack while it is in this 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 Config's +// API operation DeleteConformancePack for usage and error information. +// +// Returned Error Types: +// * NoSuchConformancePackException +// You specified one or more conformance packs that do not exist. +// +// * ResourceInUseException +// You see this exception in the following cases: +// +// * For DeleteConfigRule, AWS Config is deleting this rule. Try your request +// again later. +// +// * For DeleteConfigRule, the rule is deleting your evaluation results. +// Try your request again later. +// +// * For DeleteConfigRule, a remediation action is associated with the rule +// and AWS Config cannot delete this rule. Delete the remediation action +// associated with the rule before deleting the rule and try your request +// again later. +// +// * For PutConfigOrganizationRule, organization config rule deletion is +// in progress. Try your request again later. +// +// * For DeleteOrganizationConfigRule, organization config rule creation +// is in progress. Try your request again later. +// +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack creation, update, and deletion is in progress. Try your request again +// later. +// +// * For DeleteConformancePack, a conformance pack creation, update, and +// deletion is in progress. Try your request again later. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteConformancePack +func (c *ConfigService) DeleteConformancePack(input *DeleteConformancePackInput) (*DeleteConformancePackOutput, error) { + req, out := c.DeleteConformancePackRequest(input) + return out, req.Send() +} + +// DeleteConformancePackWithContext is the same as DeleteConformancePack with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteConformancePack for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) DeleteConformancePackWithContext(ctx aws.Context, input *DeleteConformancePackInput, opts ...request.Option) (*DeleteConformancePackOutput, error) { + req, out := c.DeleteConformancePackRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteDeliveryChannel = "DeleteDeliveryChannel" // DeleteDeliveryChannelRequest generates a "aws/request.Request" representing the @@ -610,11 +728,11 @@ func (c *ConfigService) DeleteDeliveryChannelRequest(input *DeleteDeliveryChanne // See the AWS API reference guide for AWS Config's // API operation DeleteDeliveryChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchDeliveryChannelException "NoSuchDeliveryChannelException" +// Returned Error Types: +// * NoSuchDeliveryChannelException // You have specified a delivery channel that does not exist. // -// * ErrCodeLastDeliveryChannelDeleteFailedException "LastDeliveryChannelDeleteFailedException" +// * LastDeliveryChannelDeleteFailedException // You cannot delete the delivery channel you specified because the configuration // recorder is running. // @@ -697,22 +815,22 @@ func (c *ConfigService) DeleteEvaluationResultsRequest(input *DeleteEvaluationRe // See the AWS API reference guide for AWS Config's // API operation DeleteEvaluationResults for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchConfigRuleException "NoSuchConfigRuleException" +// Returned Error Types: +// * NoSuchConfigRuleException // One or more AWS Config rules in the request are invalid. Verify that the // rule names are correct and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // You see this exception in the following cases: // -// * For DeleteConfigRule API, AWS Config is deleting this rule. Try your -// request again later. +// * For DeleteConfigRule, AWS Config is deleting this rule. Try your request +// again later. // -// * For DeleteConfigRule API, the rule is deleting your evaluation results. +// * For DeleteConfigRule, the rule is deleting your evaluation results. // Try your request again later. // -// * For DeleteConfigRule API, a remediation action is associated with the -// rule and AWS Config cannot delete this rule. Delete the remediation action +// * For DeleteConfigRule, a remediation action is associated with the rule +// and AWS Config cannot delete this rule. Delete the remediation action // associated with the rule before deleting the rule and try your request // again later. // @@ -722,6 +840,13 @@ func (c *ConfigService) DeleteEvaluationResultsRequest(input *DeleteEvaluationRe // * For DeleteOrganizationConfigRule, organization config rule creation // is in progress. Try your request again later. // +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack creation, update, and deletion is in progress. Try your request again +// later. +// +// * For DeleteConformancePack, a conformance pack creation, update, and +// deletion is in progress. Try your request again later. +// // See also, 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) @@ -803,21 +928,21 @@ func (c *ConfigService) DeleteOrganizationConfigRuleRequest(input *DeleteOrganiz // See the AWS API reference guide for AWS Config's // API operation DeleteOrganizationConfigRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchOrganizationConfigRuleException "NoSuchOrganizationConfigRuleException" +// Returned Error Types: +// * NoSuchOrganizationConfigRuleException // You specified one or more organization config rules that do not exist. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // You see this exception in the following cases: // -// * For DeleteConfigRule API, AWS Config is deleting this rule. Try your -// request again later. +// * For DeleteConfigRule, AWS Config is deleting this rule. Try your request +// again later. // -// * For DeleteConfigRule API, the rule is deleting your evaluation results. +// * For DeleteConfigRule, the rule is deleting your evaluation results. // Try your request again later. // -// * For DeleteConfigRule API, a remediation action is associated with the -// rule and AWS Config cannot delete this rule. Delete the remediation action +// * For DeleteConfigRule, a remediation action is associated with the rule +// and AWS Config cannot delete this rule. Delete the remediation action // associated with the rule before deleting the rule and try your request // again later. // @@ -827,13 +952,20 @@ func (c *ConfigService) DeleteOrganizationConfigRuleRequest(input *DeleteOrganiz // * For DeleteOrganizationConfigRule, organization config rule creation // is in progress. Try your request again later. // -// * ErrCodeOrganizationAccessDeniedException "OrganizationAccessDeniedException" +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack creation, update, and deletion is in progress. Try your request again +// later. +// +// * For DeleteConformancePack, a conformance pack creation, update, and +// deletion is in progress. Try your request again later. +// +// * OrganizationAccessDeniedException // For PutConfigAggregator API, no permission to call EnableAWSServiceAccess // API. // -// For all OrganizationConfigRule APIs, AWS Config throws an exception if APIs -// are called from member accounts. All APIs must be called from organization -// master account. +// For all OrganizationConfigRule and OrganizationConformancePack APIs, AWS +// Config throws an exception if APIs are called from member accounts. All APIs +// must be called from organization master account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteOrganizationConfigRule func (c *ConfigService) DeleteOrganizationConfigRule(input *DeleteOrganizationConfigRuleInput) (*DeleteOrganizationConfigRuleOutput, error) { @@ -857,6 +989,131 @@ func (c *ConfigService) DeleteOrganizationConfigRuleWithContext(ctx aws.Context, return out, req.Send() } +const opDeleteOrganizationConformancePack = "DeleteOrganizationConformancePack" + +// DeleteOrganizationConformancePackRequest generates a "aws/request.Request" representing the +// client's request for the DeleteOrganizationConformancePack operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteOrganizationConformancePack for more information on using the DeleteOrganizationConformancePack +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteOrganizationConformancePackRequest method. +// req, resp := client.DeleteOrganizationConformancePackRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteOrganizationConformancePack +func (c *ConfigService) DeleteOrganizationConformancePackRequest(input *DeleteOrganizationConformancePackInput) (req *request.Request, output *DeleteOrganizationConformancePackOutput) { + op := &request.Operation{ + Name: opDeleteOrganizationConformancePack, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteOrganizationConformancePackInput{} + } + + output = &DeleteOrganizationConformancePackOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteOrganizationConformancePack API operation for AWS Config. +// +// Deletes the specified organization conformance pack and all of the config +// rules and remediation actions from all member accounts in that organization. +// Only a master account can delete an organization conformance pack. +// +// AWS Config sets the state of a conformance pack to DELETE_IN_PROGRESS until +// the deletion is complete. You cannot update a conformance pack while it is +// in this 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 Config's +// API operation DeleteOrganizationConformancePack for usage and error information. +// +// Returned Error Types: +// * NoSuchOrganizationConformancePackException +// AWS Config organization conformance pack that you passed in the filter does +// not exist. +// +// For DeleteOrganizationConformancePack, you tried to delete an organization +// conformance pack that does not exist. +// +// * ResourceInUseException +// You see this exception in the following cases: +// +// * For DeleteConfigRule, AWS Config is deleting this rule. Try your request +// again later. +// +// * For DeleteConfigRule, the rule is deleting your evaluation results. +// Try your request again later. +// +// * For DeleteConfigRule, a remediation action is associated with the rule +// and AWS Config cannot delete this rule. Delete the remediation action +// associated with the rule before deleting the rule and try your request +// again later. +// +// * For PutConfigOrganizationRule, organization config rule deletion is +// in progress. Try your request again later. +// +// * For DeleteOrganizationConfigRule, organization config rule creation +// is in progress. Try your request again later. +// +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack creation, update, and deletion is in progress. Try your request again +// later. +// +// * For DeleteConformancePack, a conformance pack creation, update, and +// deletion is in progress. Try your request again later. +// +// * OrganizationAccessDeniedException +// For PutConfigAggregator API, no permission to call EnableAWSServiceAccess +// API. +// +// For all OrganizationConfigRule and OrganizationConformancePack APIs, AWS +// Config throws an exception if APIs are called from member accounts. All APIs +// must be called from organization master account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteOrganizationConformancePack +func (c *ConfigService) DeleteOrganizationConformancePack(input *DeleteOrganizationConformancePackInput) (*DeleteOrganizationConformancePackOutput, error) { + req, out := c.DeleteOrganizationConformancePackRequest(input) + return out, req.Send() +} + +// DeleteOrganizationConformancePackWithContext is the same as DeleteOrganizationConformancePack with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteOrganizationConformancePack for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) DeleteOrganizationConformancePackWithContext(ctx aws.Context, input *DeleteOrganizationConformancePackInput, opts ...request.Option) (*DeleteOrganizationConformancePackOutput, error) { + req, out := c.DeleteOrganizationConformancePackRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeletePendingAggregationRequest = "DeletePendingAggregationRequest" // DeletePendingAggregationRequestRequest generates a "aws/request.Request" representing the @@ -912,8 +1169,8 @@ func (c *ConfigService) DeletePendingAggregationRequestRequest(input *DeletePend // See the AWS API reference guide for AWS Config's // API operation DeletePendingAggregationRequest for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // @@ -993,14 +1250,31 @@ func (c *ConfigService) DeleteRemediationConfigurationRequest(input *DeleteRemed // See the AWS API reference guide for AWS Config's // API operation DeleteRemediationConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchRemediationConfigurationException "NoSuchRemediationConfigurationException" +// Returned Error Types: +// * NoSuchRemediationConfigurationException // You specified an AWS Config rule without a remediation configuration. // -// * ErrCodeRemediationInProgressException "RemediationInProgressException" +// * RemediationInProgressException // Remediation action is in progress. You can either cancel execution in AWS // Systems Manager or wait and try again later. // +// * InsufficientPermissionsException +// Indicates one of the following errors: +// +// * For PutConfigRule, the rule cannot be created because the IAM role assigned +// to AWS Config lacks permissions to perform the config:Put* action. +// +// * For PutConfigRule, the AWS Lambda function cannot be invoked. Check +// the function ARN, and check the function's permissions. +// +// * For PutOrganizationConfigRule, organization config rule cannot be created +// because you do not have permissions to call IAM GetRole action or create +// a service linked role. +// +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack cannot be created because you do not have permissions: To call IAM +// GetRole action or create a service linked role. To read Amazon S3 bucket. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteRemediationConfiguration func (c *ConfigService) DeleteRemediationConfiguration(input *DeleteRemediationConfigurationInput) (*DeleteRemediationConfigurationOutput, error) { req, out := c.DeleteRemediationConfigurationRequest(input) @@ -1076,8 +1350,8 @@ func (c *ConfigService) DeleteRemediationExceptionsRequest(input *DeleteRemediat // See the AWS API reference guide for AWS Config's // API operation DeleteRemediationExceptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchRemediationExceptionException "NoSuchRemediationExceptionException" +// Returned Error Types: +// * NoSuchRemediationExceptionException // You tried to delete a remediation exception that does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteRemediationExceptions @@ -1102,6 +1376,92 @@ func (c *ConfigService) DeleteRemediationExceptionsWithContext(ctx aws.Context, return out, req.Send() } +const opDeleteResourceConfig = "DeleteResourceConfig" + +// DeleteResourceConfigRequest generates a "aws/request.Request" representing the +// client's request for the DeleteResourceConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteResourceConfig for more information on using the DeleteResourceConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteResourceConfigRequest method. +// req, resp := client.DeleteResourceConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteResourceConfig +func (c *ConfigService) DeleteResourceConfigRequest(input *DeleteResourceConfigInput) (req *request.Request, output *DeleteResourceConfigOutput) { + op := &request.Operation{ + Name: opDeleteResourceConfig, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteResourceConfigInput{} + } + + output = &DeleteResourceConfigOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteResourceConfig API operation for AWS Config. +// +// Records the configuration state for a custom resource that has been deleted. +// This API records a new ConfigurationItem with a ResourceDeleted status. You +// can retrieve the ConfigurationItems recorded for this resource in your AWS +// Config History. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 DeleteResourceConfig for usage and error information. +// +// Returned Error Types: +// * ValidationException +// The requested action is not valid. +// +// * NoRunningConfigurationRecorderException +// There is no configuration recorder running. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteResourceConfig +func (c *ConfigService) DeleteResourceConfig(input *DeleteResourceConfigInput) (*DeleteResourceConfigOutput, error) { + req, out := c.DeleteResourceConfigRequest(input) + return out, req.Send() +} + +// DeleteResourceConfigWithContext is the same as DeleteResourceConfig with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteResourceConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) DeleteResourceConfigWithContext(ctx aws.Context, input *DeleteResourceConfigInput, opts ...request.Option) (*DeleteResourceConfigOutput, error) { + req, out := c.DeleteResourceConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteRetentionConfiguration = "DeleteRetentionConfiguration" // DeleteRetentionConfigurationRequest generates a "aws/request.Request" representing the @@ -1156,12 +1516,12 @@ func (c *ConfigService) DeleteRetentionConfigurationRequest(input *DeleteRetenti // See the AWS API reference guide for AWS Config's // API operation DeleteRetentionConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // -// * ErrCodeNoSuchRetentionConfigurationException "NoSuchRetentionConfigurationException" +// * NoSuchRetentionConfigurationException // You have specified a retention configuration that does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeleteRetentionConfiguration @@ -1249,15 +1609,15 @@ func (c *ConfigService) DeliverConfigSnapshotRequest(input *DeliverConfigSnapsho // See the AWS API reference guide for AWS Config's // API operation DeliverConfigSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchDeliveryChannelException "NoSuchDeliveryChannelException" +// Returned Error Types: +// * NoSuchDeliveryChannelException // You have specified a delivery channel that does not exist. // -// * ErrCodeNoAvailableConfigurationRecorderException "NoAvailableConfigurationRecorderException" +// * NoAvailableConfigurationRecorderException // There are no configuration recorders available to provide the role needed // to describe your resources. Create a configuration recorder. // -// * ErrCodeNoRunningConfigurationRecorderException "NoRunningConfigurationRecorderException" +// * NoRunningConfigurationRecorderException // There is no configuration recorder running. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DeliverConfigSnapshot @@ -1339,18 +1699,18 @@ func (c *ConfigService) DescribeAggregateComplianceByConfigRulesRequest(input *D // See the AWS API reference guide for AWS Config's // API operation DescribeAggregateComplianceByConfigRules for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The requested action is not valid. // -// * ErrCodeInvalidLimitException "InvalidLimitException" +// * InvalidLimitException // The specified limit is outside the allowable range. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // -// * ErrCodeNoSuchConfigurationAggregatorException "NoSuchConfigurationAggregatorException" +// * NoSuchConfigurationAggregatorException // You have specified a configuration aggregator that does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeAggregateComplianceByConfigRules @@ -1429,16 +1789,16 @@ func (c *ConfigService) DescribeAggregationAuthorizationsRequest(input *Describe // See the AWS API reference guide for AWS Config's // API operation DescribeAggregationAuthorizations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // -// * ErrCodeInvalidLimitException "InvalidLimitException" +// * InvalidLimitException // The specified limit is outside the allowable range. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeAggregationAuthorizations @@ -1538,16 +1898,16 @@ func (c *ConfigService) DescribeComplianceByConfigRuleRequest(input *DescribeCom // See the AWS API reference guide for AWS Config's // API operation DescribeComplianceByConfigRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // -// * ErrCodeNoSuchConfigRuleException "NoSuchConfigRuleException" +// * NoSuchConfigRuleException // One or more AWS Config rules in the request are invalid. Verify that the // rule names are correct and try again. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // @@ -1650,12 +2010,12 @@ func (c *ConfigService) DescribeComplianceByResourceRequest(input *DescribeCompl // See the AWS API reference guide for AWS Config's // API operation DescribeComplianceByResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // @@ -1737,16 +2097,16 @@ func (c *ConfigService) DescribeConfigRuleEvaluationStatusRequest(input *Describ // See the AWS API reference guide for AWS Config's // API operation DescribeConfigRuleEvaluationStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchConfigRuleException "NoSuchConfigRuleException" +// Returned Error Types: +// * NoSuchConfigRuleException // One or more AWS Config rules in the request are invalid. Verify that the // rule names are correct and try again. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // @@ -1825,12 +2185,12 @@ func (c *ConfigService) DescribeConfigRulesRequest(input *DescribeConfigRulesInp // See the AWS API reference guide for AWS Config's // API operation DescribeConfigRules for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchConfigRuleException "NoSuchConfigRuleException" +// Returned Error Types: +// * NoSuchConfigRuleException // One or more AWS Config rules in the request are invalid. Verify that the // rule names are correct and try again. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // @@ -1912,19 +2272,19 @@ func (c *ConfigService) DescribeConfigurationAggregatorSourcesStatusRequest(inpu // See the AWS API reference guide for AWS Config's // API operation DescribeConfigurationAggregatorSourcesStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // -// * ErrCodeNoSuchConfigurationAggregatorException "NoSuchConfigurationAggregatorException" +// * NoSuchConfigurationAggregatorException // You have specified a configuration aggregator that does not exist. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // -// * ErrCodeInvalidLimitException "InvalidLimitException" +// * InvalidLimitException // The specified limit is outside the allowable range. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigurationAggregatorSourcesStatus @@ -2004,19 +2364,19 @@ func (c *ConfigService) DescribeConfigurationAggregatorsRequest(input *DescribeC // See the AWS API reference guide for AWS Config's // API operation DescribeConfigurationAggregators for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // -// * ErrCodeNoSuchConfigurationAggregatorException "NoSuchConfigurationAggregatorException" +// * NoSuchConfigurationAggregatorException // You have specified a configuration aggregator that does not exist. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // -// * ErrCodeInvalidLimitException "InvalidLimitException" +// * InvalidLimitException // The specified limit is outside the allowable range. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigurationAggregators @@ -2099,8 +2459,8 @@ func (c *ConfigService) DescribeConfigurationRecorderStatusRequest(input *Descri // See the AWS API reference guide for AWS Config's // API operation DescribeConfigurationRecorderStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchConfigurationRecorderException "NoSuchConfigurationRecorderException" +// Returned Error Types: +// * NoSuchConfigurationRecorderException // You have specified a configuration recorder that does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigurationRecorderStatus @@ -2183,8 +2543,8 @@ func (c *ConfigService) DescribeConfigurationRecordersRequest(input *DescribeCon // See the AWS API reference guide for AWS Config's // API operation DescribeConfigurationRecorders for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchConfigurationRecorderException "NoSuchConfigurationRecorderException" +// Returned Error Types: +// * NoSuchConfigurationRecorderException // You have specified a configuration recorder that does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConfigurationRecorders @@ -2209,72 +2569,338 @@ func (c *ConfigService) DescribeConfigurationRecordersWithContext(ctx aws.Contex return out, req.Send() } -const opDescribeDeliveryChannelStatus = "DescribeDeliveryChannelStatus" +const opDescribeConformancePackCompliance = "DescribeConformancePackCompliance" -// DescribeDeliveryChannelStatusRequest generates a "aws/request.Request" representing the -// client's request for the DescribeDeliveryChannelStatus operation. The "output" return +// DescribeConformancePackComplianceRequest generates a "aws/request.Request" representing the +// client's request for the DescribeConformancePackCompliance operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeDeliveryChannelStatus for more information on using the DescribeDeliveryChannelStatus +// See DescribeConformancePackCompliance for more information on using the DescribeConformancePackCompliance // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeDeliveryChannelStatusRequest method. -// req, resp := client.DescribeDeliveryChannelStatusRequest(params) +// // Example sending a request using the DescribeConformancePackComplianceRequest method. +// req, resp := client.DescribeConformancePackComplianceRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeDeliveryChannelStatus -func (c *ConfigService) DescribeDeliveryChannelStatusRequest(input *DescribeDeliveryChannelStatusInput) (req *request.Request, output *DescribeDeliveryChannelStatusOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConformancePackCompliance +func (c *ConfigService) DescribeConformancePackComplianceRequest(input *DescribeConformancePackComplianceInput) (req *request.Request, output *DescribeConformancePackComplianceOutput) { op := &request.Operation{ - Name: opDescribeDeliveryChannelStatus, + Name: opDescribeConformancePackCompliance, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeDeliveryChannelStatusInput{} + input = &DescribeConformancePackComplianceInput{} } - output = &DescribeDeliveryChannelStatusOutput{} + output = &DescribeConformancePackComplianceOutput{} req = c.newRequest(op, input, output) return } -// DescribeDeliveryChannelStatus API operation for AWS Config. +// DescribeConformancePackCompliance 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. +// Returns compliance details for each rule in that conformance pack. // -// Currently, you can specify only one delivery channel per region in your account. +// You must provide exact 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 AWS Config's -// API operation DescribeDeliveryChannelStatus for usage and error information. +// API operation DescribeConformancePackCompliance for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchDeliveryChannelException "NoSuchDeliveryChannelException" -// You have specified a delivery channel that does not exist. +// Returned Error Types: +// * InvalidLimitException +// The specified limit is outside the allowable range. // -// See also, 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) - return out, req.Send() -} +// * 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. +// +// * InvalidParameterValueException +// One or more of the specified parameters are invalid. Verify that your parameters +// are valid and try again. +// +// * NoSuchConfigRuleInConformancePackException +// AWS Config rule that you passed in the filter does not exist. +// +// * NoSuchConformancePackException +// You specified one or more conformance packs that do not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConformancePackCompliance +func (c *ConfigService) DescribeConformancePackCompliance(input *DescribeConformancePackComplianceInput) (*DescribeConformancePackComplianceOutput, error) { + req, out := c.DescribeConformancePackComplianceRequest(input) + return out, req.Send() +} + +// DescribeConformancePackComplianceWithContext is the same as DescribeConformancePackCompliance with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeConformancePackCompliance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) DescribeConformancePackComplianceWithContext(ctx aws.Context, input *DescribeConformancePackComplianceInput, opts ...request.Option) (*DescribeConformancePackComplianceOutput, error) { + req, out := c.DescribeConformancePackComplianceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeConformancePackStatus = "DescribeConformancePackStatus" + +// DescribeConformancePackStatusRequest generates a "aws/request.Request" representing the +// client's request for the DescribeConformancePackStatus operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeConformancePackStatus for more information on using the DescribeConformancePackStatus +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeConformancePackStatusRequest method. +// req, resp := client.DescribeConformancePackStatusRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConformancePackStatus +func (c *ConfigService) DescribeConformancePackStatusRequest(input *DescribeConformancePackStatusInput) (req *request.Request, output *DescribeConformancePackStatusOutput) { + op := &request.Operation{ + Name: opDescribeConformancePackStatus, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeConformancePackStatusInput{} + } + + output = &DescribeConformancePackStatusOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeConformancePackStatus API operation for AWS Config. +// +// Provides one or more conformance packs deployment status. +// +// If there are no conformance packs then you will see an empty result. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 DescribeConformancePackStatus for usage and error information. +// +// Returned Error Types: +// * InvalidLimitException +// The specified limit is outside the allowable range. +// +// * 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. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConformancePackStatus +func (c *ConfigService) DescribeConformancePackStatus(input *DescribeConformancePackStatusInput) (*DescribeConformancePackStatusOutput, error) { + req, out := c.DescribeConformancePackStatusRequest(input) + return out, req.Send() +} + +// DescribeConformancePackStatusWithContext is the same as DescribeConformancePackStatus with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeConformancePackStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) DescribeConformancePackStatusWithContext(ctx aws.Context, input *DescribeConformancePackStatusInput, opts ...request.Option) (*DescribeConformancePackStatusOutput, error) { + req, out := c.DescribeConformancePackStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeConformancePacks = "DescribeConformancePacks" + +// DescribeConformancePacksRequest generates a "aws/request.Request" representing the +// client's request for the DescribeConformancePacks operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeConformancePacks for more information on using the DescribeConformancePacks +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeConformancePacksRequest method. +// req, resp := client.DescribeConformancePacksRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConformancePacks +func (c *ConfigService) DescribeConformancePacksRequest(input *DescribeConformancePacksInput) (req *request.Request, output *DescribeConformancePacksOutput) { + op := &request.Operation{ + Name: opDescribeConformancePacks, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeConformancePacksInput{} + } + + output = &DescribeConformancePacksOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeConformancePacks API operation for AWS Config. +// +// Returns a list of one or more conformance packs. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 DescribeConformancePacks for usage and error information. +// +// Returned Error Types: +// * NoSuchConformancePackException +// You specified one or more conformance packs that do not exist. +// +// * InvalidLimitException +// The specified limit is outside the allowable range. +// +// * 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. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeConformancePacks +func (c *ConfigService) DescribeConformancePacks(input *DescribeConformancePacksInput) (*DescribeConformancePacksOutput, error) { + req, out := c.DescribeConformancePacksRequest(input) + return out, req.Send() +} + +// DescribeConformancePacksWithContext is the same as DescribeConformancePacks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeConformancePacks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) DescribeConformancePacksWithContext(ctx aws.Context, input *DescribeConformancePacksInput, opts ...request.Option) (*DescribeConformancePacksOutput, error) { + req, out := c.DescribeConformancePacksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeDeliveryChannelStatus = "DescribeDeliveryChannelStatus" + +// DescribeDeliveryChannelStatusRequest generates a "aws/request.Request" representing the +// client's request for the DescribeDeliveryChannelStatus operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeDeliveryChannelStatus for more information on using the DescribeDeliveryChannelStatus +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeDeliveryChannelStatusRequest method. +// req, resp := client.DescribeDeliveryChannelStatusRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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 Types: +// * NoSuchDeliveryChannelException +// You have specified a delivery channel that does not exist. +// +// See also, 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) + return out, req.Send() +} // DescribeDeliveryChannelStatusWithContext is the same as DescribeDeliveryChannelStatus with the addition of // the ability to pass a context and additional request options. @@ -2349,8 +2975,8 @@ func (c *ConfigService) DescribeDeliveryChannelsRequest(input *DescribeDeliveryC // See the AWS API reference guide for AWS Config's // API operation DescribeDeliveryChannels for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchDeliveryChannelException "NoSuchDeliveryChannelException" +// Returned Error Types: +// * NoSuchDeliveryChannelException // You have specified a delivery channel that does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeDeliveryChannels @@ -2439,24 +3065,24 @@ func (c *ConfigService) DescribeOrganizationConfigRuleStatusesRequest(input *Des // See the AWS API reference guide for AWS Config's // API operation DescribeOrganizationConfigRuleStatuses for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchOrganizationConfigRuleException "NoSuchOrganizationConfigRuleException" +// Returned Error Types: +// * NoSuchOrganizationConfigRuleException // You specified one or more organization config rules that do not exist. // -// * ErrCodeInvalidLimitException "InvalidLimitException" +// * InvalidLimitException // The specified limit is outside the allowable range. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // -// * ErrCodeOrganizationAccessDeniedException "OrganizationAccessDeniedException" +// * OrganizationAccessDeniedException // For PutConfigAggregator API, no permission to call EnableAWSServiceAccess // API. // -// For all OrganizationConfigRule APIs, AWS Config throws an exception if APIs -// are called from member accounts. All APIs must be called from organization -// master account. +// For all OrganizationConfigRule and OrganizationConformancePack APIs, AWS +// Config throws an exception if APIs are called from member accounts. All APIs +// must be called from organization master account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeOrganizationConfigRuleStatuses func (c *ConfigService) DescribeOrganizationConfigRuleStatuses(input *DescribeOrganizationConfigRuleStatusesInput) (*DescribeOrganizationConfigRuleStatusesOutput, error) { @@ -2540,24 +3166,24 @@ func (c *ConfigService) DescribeOrganizationConfigRulesRequest(input *DescribeOr // See the AWS API reference guide for AWS Config's // API operation DescribeOrganizationConfigRules for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchOrganizationConfigRuleException "NoSuchOrganizationConfigRuleException" +// Returned Error Types: +// * NoSuchOrganizationConfigRuleException // You specified one or more organization config rules that do not exist. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // -// * ErrCodeInvalidLimitException "InvalidLimitException" +// * InvalidLimitException // The specified limit is outside the allowable range. // -// * ErrCodeOrganizationAccessDeniedException "OrganizationAccessDeniedException" +// * OrganizationAccessDeniedException // For PutConfigAggregator API, no permission to call EnableAWSServiceAccess // API. // -// For all OrganizationConfigRule APIs, AWS Config throws an exception if APIs -// are called from member accounts. All APIs must be called from organization -// master account. +// For all OrganizationConfigRule and OrganizationConformancePack APIs, AWS +// Config throws an exception if APIs are called from member accounts. All APIs +// must be called from organization master account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeOrganizationConfigRules func (c *ConfigService) DescribeOrganizationConfigRules(input *DescribeOrganizationConfigRulesInput) (*DescribeOrganizationConfigRulesOutput, error) { @@ -2581,140 +3207,355 @@ func (c *ConfigService) DescribeOrganizationConfigRulesWithContext(ctx aws.Conte return out, req.Send() } -const opDescribePendingAggregationRequests = "DescribePendingAggregationRequests" +const opDescribeOrganizationConformancePackStatuses = "DescribeOrganizationConformancePackStatuses" -// DescribePendingAggregationRequestsRequest generates a "aws/request.Request" representing the -// client's request for the DescribePendingAggregationRequests operation. The "output" return +// DescribeOrganizationConformancePackStatusesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeOrganizationConformancePackStatuses operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribePendingAggregationRequests for more information on using the DescribePendingAggregationRequests +// See DescribeOrganizationConformancePackStatuses for more information on using the DescribeOrganizationConformancePackStatuses // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribePendingAggregationRequestsRequest method. -// req, resp := client.DescribePendingAggregationRequestsRequest(params) +// // Example sending a request using the DescribeOrganizationConformancePackStatusesRequest method. +// req, resp := client.DescribeOrganizationConformancePackStatusesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribePendingAggregationRequests -func (c *ConfigService) DescribePendingAggregationRequestsRequest(input *DescribePendingAggregationRequestsInput) (req *request.Request, output *DescribePendingAggregationRequestsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeOrganizationConformancePackStatuses +func (c *ConfigService) DescribeOrganizationConformancePackStatusesRequest(input *DescribeOrganizationConformancePackStatusesInput) (req *request.Request, output *DescribeOrganizationConformancePackStatusesOutput) { op := &request.Operation{ - Name: opDescribePendingAggregationRequests, + Name: opDescribeOrganizationConformancePackStatuses, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribePendingAggregationRequestsInput{} + input = &DescribeOrganizationConformancePackStatusesInput{} } - output = &DescribePendingAggregationRequestsOutput{} + output = &DescribeOrganizationConformancePackStatusesOutput{} req = c.newRequest(op, input, output) return } -// DescribePendingAggregationRequests API operation for AWS Config. +// DescribeOrganizationConformancePackStatuses API operation for AWS Config. // -// Returns a list of all pending aggregation requests. +// Provides organization conformance pack deployment status for an organization. +// +// The status is not considered successful until organization conformance pack +// is successfully deployed in all the member accounts with an exception of +// excluded accounts. +// +// When you specify the limit and the next token, you receive a paginated response. +// Limit and next token are not applicable if you specify organization conformance +// pack names. They are only applicable, when you request all the organization +// conformance packs. +// +// Only a master account can call 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 Config's -// API operation DescribePendingAggregationRequests for usage and error information. +// API operation DescribeOrganizationConformancePackStatuses 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. +// Returned Error Types: +// * NoSuchOrganizationConformancePackException +// AWS Config organization conformance pack that you passed in the filter does +// not exist. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// For DeleteOrganizationConformancePack, you tried to delete an organization +// conformance pack that does not exist. +// +// * InvalidLimitException +// The specified limit is outside the allowable range. +// +// * 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. // -// * ErrCodeInvalidLimitException "InvalidLimitException" -// The specified limit is outside the allowable range. +// * OrganizationAccessDeniedException +// For PutConfigAggregator API, no permission to call EnableAWSServiceAccess +// API. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribePendingAggregationRequests -func (c *ConfigService) DescribePendingAggregationRequests(input *DescribePendingAggregationRequestsInput) (*DescribePendingAggregationRequestsOutput, error) { - req, out := c.DescribePendingAggregationRequestsRequest(input) +// For all OrganizationConfigRule and OrganizationConformancePack APIs, AWS +// Config throws an exception if APIs are called from member accounts. All APIs +// must be called from organization master account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeOrganizationConformancePackStatuses +func (c *ConfigService) DescribeOrganizationConformancePackStatuses(input *DescribeOrganizationConformancePackStatusesInput) (*DescribeOrganizationConformancePackStatusesOutput, error) { + req, out := c.DescribeOrganizationConformancePackStatusesRequest(input) return out, req.Send() } -// DescribePendingAggregationRequestsWithContext is the same as DescribePendingAggregationRequests with the addition of +// DescribeOrganizationConformancePackStatusesWithContext is the same as DescribeOrganizationConformancePackStatuses with the addition of // the ability to pass a context and additional request options. // -// See DescribePendingAggregationRequests for details on how to use this API operation. +// See DescribeOrganizationConformancePackStatuses for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) DescribePendingAggregationRequestsWithContext(ctx aws.Context, input *DescribePendingAggregationRequestsInput, opts ...request.Option) (*DescribePendingAggregationRequestsOutput, error) { - req, out := c.DescribePendingAggregationRequestsRequest(input) +func (c *ConfigService) DescribeOrganizationConformancePackStatusesWithContext(ctx aws.Context, input *DescribeOrganizationConformancePackStatusesInput, opts ...request.Option) (*DescribeOrganizationConformancePackStatusesOutput, error) { + req, out := c.DescribeOrganizationConformancePackStatusesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeRemediationConfigurations = "DescribeRemediationConfigurations" +const opDescribeOrganizationConformancePacks = "DescribeOrganizationConformancePacks" -// DescribeRemediationConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeRemediationConfigurations operation. The "output" return +// DescribeOrganizationConformancePacksRequest generates a "aws/request.Request" representing the +// client's request for the DescribeOrganizationConformancePacks operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeRemediationConfigurations for more information on using the DescribeRemediationConfigurations +// See DescribeOrganizationConformancePacks for more information on using the DescribeOrganizationConformancePacks // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeRemediationConfigurationsRequest method. -// req, resp := client.DescribeRemediationConfigurationsRequest(params) +// // Example sending a request using the DescribeOrganizationConformancePacksRequest method. +// req, resp := client.DescribeOrganizationConformancePacksRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeRemediationConfigurations -func (c *ConfigService) DescribeRemediationConfigurationsRequest(input *DescribeRemediationConfigurationsInput) (req *request.Request, output *DescribeRemediationConfigurationsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeOrganizationConformancePacks +func (c *ConfigService) DescribeOrganizationConformancePacksRequest(input *DescribeOrganizationConformancePacksInput) (req *request.Request, output *DescribeOrganizationConformancePacksOutput) { op := &request.Operation{ - Name: opDescribeRemediationConfigurations, + Name: opDescribeOrganizationConformancePacks, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeRemediationConfigurationsInput{} + input = &DescribeOrganizationConformancePacksInput{} } - output = &DescribeRemediationConfigurationsOutput{} + output = &DescribeOrganizationConformancePacksOutput{} req = c.newRequest(op, input, output) return } -// DescribeRemediationConfigurations API operation for AWS Config. +// DescribeOrganizationConformancePacks API operation for AWS Config. // -// Returns the details of one or more remediation configurations. +// Returns a list of organization conformance packs. // -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// When you specify the limit and the next token, you receive a paginated response. +// +// Limit and next token are not applicable if you specify organization conformance +// packs names. They are only applicable, when you request all the organization +// conformance packs. +// +// Only a master account can call 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 Config's +// API operation DescribeOrganizationConformancePacks for usage and error information. +// +// Returned Error Types: +// * NoSuchOrganizationConformancePackException +// AWS Config organization conformance pack that you passed in the filter does +// not exist. +// +// For DeleteOrganizationConformancePack, you tried to delete an organization +// conformance pack that does not exist. +// +// * 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. +// +// * InvalidLimitException +// The specified limit is outside the allowable range. +// +// * OrganizationAccessDeniedException +// For PutConfigAggregator API, no permission to call EnableAWSServiceAccess +// API. +// +// For all OrganizationConfigRule and OrganizationConformancePack APIs, AWS +// Config throws an exception if APIs are called from member accounts. All APIs +// must be called from organization master account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeOrganizationConformancePacks +func (c *ConfigService) DescribeOrganizationConformancePacks(input *DescribeOrganizationConformancePacksInput) (*DescribeOrganizationConformancePacksOutput, error) { + req, out := c.DescribeOrganizationConformancePacksRequest(input) + return out, req.Send() +} + +// DescribeOrganizationConformancePacksWithContext is the same as DescribeOrganizationConformancePacks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeOrganizationConformancePacks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) DescribeOrganizationConformancePacksWithContext(ctx aws.Context, input *DescribeOrganizationConformancePacksInput, opts ...request.Option) (*DescribeOrganizationConformancePacksOutput, error) { + req, out := c.DescribeOrganizationConformancePacksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribePendingAggregationRequests = "DescribePendingAggregationRequests" + +// DescribePendingAggregationRequestsRequest generates a "aws/request.Request" representing the +// client's request for the DescribePendingAggregationRequests operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribePendingAggregationRequests for more information on using the DescribePendingAggregationRequests +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribePendingAggregationRequestsRequest method. +// req, resp := client.DescribePendingAggregationRequestsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribePendingAggregationRequests +func (c *ConfigService) DescribePendingAggregationRequestsRequest(input *DescribePendingAggregationRequestsInput) (req *request.Request, output *DescribePendingAggregationRequestsOutput) { + op := &request.Operation{ + Name: opDescribePendingAggregationRequests, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribePendingAggregationRequestsInput{} + } + + output = &DescribePendingAggregationRequestsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribePendingAggregationRequests API operation for AWS Config. +// +// Returns a list of all pending aggregation 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 AWS Config's +// API operation DescribePendingAggregationRequests for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValueException +// One or more of the specified parameters are invalid. Verify that your parameters +// are valid and try again. +// +// * 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. +// +// * InvalidLimitException +// The specified limit is outside the allowable range. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribePendingAggregationRequests +func (c *ConfigService) DescribePendingAggregationRequests(input *DescribePendingAggregationRequestsInput) (*DescribePendingAggregationRequestsOutput, error) { + req, out := c.DescribePendingAggregationRequestsRequest(input) + return out, req.Send() +} + +// DescribePendingAggregationRequestsWithContext is the same as DescribePendingAggregationRequests with the addition of +// the ability to pass a context and additional request options. +// +// See DescribePendingAggregationRequests for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) DescribePendingAggregationRequestsWithContext(ctx aws.Context, input *DescribePendingAggregationRequestsInput, opts ...request.Option) (*DescribePendingAggregationRequestsOutput, error) { + req, out := c.DescribePendingAggregationRequestsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeRemediationConfigurations = "DescribeRemediationConfigurations" + +// DescribeRemediationConfigurationsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeRemediationConfigurations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeRemediationConfigurations for more information on using the DescribeRemediationConfigurations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeRemediationConfigurationsRequest method. +// req, resp := client.DescribeRemediationConfigurationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/DescribeRemediationConfigurations +func (c *ConfigService) DescribeRemediationConfigurationsRequest(input *DescribeRemediationConfigurationsInput) (req *request.Request, output *DescribeRemediationConfigurationsOutput) { + op := &request.Operation{ + Name: opDescribeRemediationConfigurations, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeRemediationConfigurationsInput{} + } + + output = &DescribeRemediationConfigurationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeRemediationConfigurations API operation for AWS Config. +// +// Returns the details of one or more remediation 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. // @@ -2809,12 +3650,12 @@ func (c *ConfigService) DescribeRemediationExceptionsRequest(input *DescribeReme // See the AWS API reference guide for AWS Config's // API operation DescribeRemediationExceptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * 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. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // @@ -2883,10 +3724,12 @@ func (c *ConfigService) DescribeRemediationExceptionsPagesWithContext(ctx aws.Co }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeRemediationExceptionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeRemediationExceptionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2952,11 +3795,11 @@ func (c *ConfigService) DescribeRemediationExecutionStatusRequest(input *Describ // See the AWS API reference guide for AWS Config's // API operation DescribeRemediationExecutionStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchRemediationConfigurationException "NoSuchRemediationConfigurationException" +// Returned Error Types: +// * NoSuchRemediationConfigurationException // You specified an AWS Config rule without a remediation configuration. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // @@ -3025,10 +3868,12 @@ func (c *ConfigService) DescribeRemediationExecutionStatusPagesWithContext(ctx a }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeRemediationExecutionStatusOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeRemediationExecutionStatusOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3090,15 +3935,15 @@ func (c *ConfigService) DescribeRetentionConfigurationsRequest(input *DescribeRe // See the AWS API reference guide for AWS Config's // API operation DescribeRetentionConfigurations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // -// * ErrCodeNoSuchRetentionConfigurationException "NoSuchRetentionConfigurationException" +// * NoSuchRetentionConfigurationException // You have specified a retention configuration that does not exist. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // @@ -3183,18 +4028,18 @@ func (c *ConfigService) GetAggregateComplianceDetailsByConfigRuleRequest(input * // See the AWS API reference guide for AWS Config's // API operation GetAggregateComplianceDetailsByConfigRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The requested action is not valid. // -// * ErrCodeInvalidLimitException "InvalidLimitException" +// * InvalidLimitException // The specified limit is outside the allowable range. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // -// * ErrCodeNoSuchConfigurationAggregatorException "NoSuchConfigurationAggregatorException" +// * NoSuchConfigurationAggregatorException // You have specified a configuration aggregator that does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetAggregateComplianceDetailsByConfigRule @@ -3276,18 +4121,18 @@ func (c *ConfigService) GetAggregateConfigRuleComplianceSummaryRequest(input *Ge // See the AWS API reference guide for AWS Config's // API operation GetAggregateConfigRuleComplianceSummary for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The requested action is not valid. // -// * ErrCodeInvalidLimitException "InvalidLimitException" +// * InvalidLimitException // The specified limit is outside the allowable range. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // -// * ErrCodeNoSuchConfigurationAggregatorException "NoSuchConfigurationAggregatorException" +// * NoSuchConfigurationAggregatorException // You have specified a configuration aggregator that does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetAggregateConfigRuleComplianceSummary @@ -3373,18 +4218,18 @@ func (c *ConfigService) GetAggregateDiscoveredResourceCountsRequest(input *GetAg // See the AWS API reference guide for AWS Config's // API operation GetAggregateDiscoveredResourceCounts for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The requested action is not valid. // -// * ErrCodeInvalidLimitException "InvalidLimitException" +// * InvalidLimitException // The specified limit is outside the allowable range. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // -// * ErrCodeNoSuchConfigurationAggregatorException "NoSuchConfigurationAggregatorException" +// * NoSuchConfigurationAggregatorException // You have specified a configuration aggregator that does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetAggregateDiscoveredResourceCounts @@ -3463,17 +4308,17 @@ func (c *ConfigService) GetAggregateResourceConfigRequest(input *GetAggregateRes // See the AWS API reference guide for AWS Config's // API operation GetAggregateResourceConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The requested action is not valid. // -// * ErrCodeNoSuchConfigurationAggregatorException "NoSuchConfigurationAggregatorException" +// * NoSuchConfigurationAggregatorException // You have specified a configuration aggregator that does not exist. // -// * ErrCodeOversizedConfigurationItemException "OversizedConfigurationItemException" +// * OversizedConfigurationItemException // The configuration item size is outside the allowable range. // -// * ErrCodeResourceNotDiscoveredException "ResourceNotDiscoveredException" +// * ResourceNotDiscoveredException // You have specified a resource that is either unknown or has not been discovered. // // See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetAggregateResourceConfig @@ -3553,16 +4398,16 @@ func (c *ConfigService) GetComplianceDetailsByConfigRuleRequest(input *GetCompli // See the AWS API reference guide for AWS Config's // API operation GetComplianceDetailsByConfigRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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" +// * NoSuchConfigRuleException // One or more AWS Config rules in the request are invalid. Verify that the // rule names are correct and try again. // @@ -3643,8 +4488,8 @@ func (c *ConfigService) GetComplianceDetailsByResourceRequest(input *GetComplian // See the AWS API reference guide for AWS Config's // API operation GetComplianceDetailsByResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // @@ -3800,8 +4645,8 @@ func (c *ConfigService) GetComplianceSummaryByResourceTypeRequest(input *GetComp // See the AWS API reference guide for AWS Config's // API operation GetComplianceSummaryByResourceType for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // @@ -3827,1548 +4672,1493 @@ func (c *ConfigService) GetComplianceSummaryByResourceTypeWithContext(ctx aws.Co return out, req.Send() } -const opGetDiscoveredResourceCounts = "GetDiscoveredResourceCounts" +const opGetConformancePackComplianceDetails = "GetConformancePackComplianceDetails" -// GetDiscoveredResourceCountsRequest generates a "aws/request.Request" representing the -// client's request for the GetDiscoveredResourceCounts operation. The "output" return +// GetConformancePackComplianceDetailsRequest generates a "aws/request.Request" representing the +// client's request for the GetConformancePackComplianceDetails operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetDiscoveredResourceCounts for more information on using the GetDiscoveredResourceCounts +// See GetConformancePackComplianceDetails for more information on using the GetConformancePackComplianceDetails // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetDiscoveredResourceCountsRequest method. -// req, resp := client.GetDiscoveredResourceCountsRequest(params) +// // Example sending a request using the GetConformancePackComplianceDetailsRequest method. +// req, resp := client.GetConformancePackComplianceDetailsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetDiscoveredResourceCounts -func (c *ConfigService) GetDiscoveredResourceCountsRequest(input *GetDiscoveredResourceCountsInput) (req *request.Request, output *GetDiscoveredResourceCountsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetConformancePackComplianceDetails +func (c *ConfigService) GetConformancePackComplianceDetailsRequest(input *GetConformancePackComplianceDetailsInput) (req *request.Request, output *GetConformancePackComplianceDetailsOutput) { op := &request.Operation{ - Name: opGetDiscoveredResourceCounts, + Name: opGetConformancePackComplianceDetails, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetDiscoveredResourceCountsInput{} + input = &GetConformancePackComplianceDetailsInput{} } - output = &GetDiscoveredResourceCountsOutput{} + output = &GetConformancePackComplianceDetailsOutput{} req = c.newRequest(op, input, output) return } -// GetDiscoveredResourceCounts API operation for AWS Config. -// -// Returns the resource types, the number of each resource type, and the total -// number of resources that AWS Config is recording in this region for your -// AWS account. -// -// Example -// -// AWS Config is recording three resource types in the US East (Ohio) Region -// for your account: 25 EC2 instances, 20 IAM users, and 15 S3 buckets. +// GetConformancePackComplianceDetails API operation for AWS Config. // -// You make a call to the GetDiscoveredResourceCounts action and specify that -// you want all resource types. -// -// AWS Config returns the following: -// -// * The resource types (EC2 instances, IAM users, and S3 buckets). -// -// * The number of each resource type (25, 20, and 15). -// -// * The total number of all resources (60). -// -// The response is paginated. By default, AWS Config lists 100 ResourceCount -// objects on each page. You can customize this number with the limit parameter. -// The response includes a nextToken string. To get the next page of results, -// run the request again and specify the string for the nextToken parameter. -// -// If you make a call to the GetDiscoveredResourceCounts action, you might not -// immediately receive resource counts in the following situations: -// -// * You are a new AWS Config customer. -// -// * You just enabled resource recording. -// -// It might take a few minutes for AWS Config to record and count your resources. -// Wait a few minutes and then retry the GetDiscoveredResourceCounts action. +// Returns compliance details of a conformance pack for all AWS resources that +// are monitered by conformance pack. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 GetDiscoveredResourceCounts for usage and error information. -// -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The requested action is not valid. +// API operation GetConformancePackComplianceDetails for usage and error information. // -// * ErrCodeInvalidLimitException "InvalidLimitException" +// Returned Error Types: +// * InvalidLimitException // The specified limit is outside the allowable range. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetDiscoveredResourceCounts -func (c *ConfigService) GetDiscoveredResourceCounts(input *GetDiscoveredResourceCountsInput) (*GetDiscoveredResourceCountsOutput, error) { - req, out := c.GetDiscoveredResourceCountsRequest(input) +// * NoSuchConformancePackException +// You specified one or more conformance packs that do not exist. +// +// * NoSuchConfigRuleInConformancePackException +// AWS Config rule that you passed in the filter does not exist. +// +// * InvalidParameterValueException +// One or more of the specified parameters are invalid. Verify that your parameters +// are valid and try again. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetConformancePackComplianceDetails +func (c *ConfigService) GetConformancePackComplianceDetails(input *GetConformancePackComplianceDetailsInput) (*GetConformancePackComplianceDetailsOutput, error) { + req, out := c.GetConformancePackComplianceDetailsRequest(input) return out, req.Send() } -// GetDiscoveredResourceCountsWithContext is the same as GetDiscoveredResourceCounts with the addition of +// GetConformancePackComplianceDetailsWithContext is the same as GetConformancePackComplianceDetails with the addition of // the ability to pass a context and additional request options. // -// See GetDiscoveredResourceCounts for details on how to use this API operation. +// See GetConformancePackComplianceDetails for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) GetDiscoveredResourceCountsWithContext(ctx aws.Context, input *GetDiscoveredResourceCountsInput, opts ...request.Option) (*GetDiscoveredResourceCountsOutput, error) { - req, out := c.GetDiscoveredResourceCountsRequest(input) +func (c *ConfigService) GetConformancePackComplianceDetailsWithContext(ctx aws.Context, input *GetConformancePackComplianceDetailsInput, opts ...request.Option) (*GetConformancePackComplianceDetailsOutput, error) { + req, out := c.GetConformancePackComplianceDetailsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetOrganizationConfigRuleDetailedStatus = "GetOrganizationConfigRuleDetailedStatus" +const opGetConformancePackComplianceSummary = "GetConformancePackComplianceSummary" -// GetOrganizationConfigRuleDetailedStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetOrganizationConfigRuleDetailedStatus operation. The "output" return +// GetConformancePackComplianceSummaryRequest generates a "aws/request.Request" representing the +// client's request for the GetConformancePackComplianceSummary operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetOrganizationConfigRuleDetailedStatus for more information on using the GetOrganizationConfigRuleDetailedStatus +// See GetConformancePackComplianceSummary for more information on using the GetConformancePackComplianceSummary // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetOrganizationConfigRuleDetailedStatusRequest method. -// req, resp := client.GetOrganizationConfigRuleDetailedStatusRequest(params) +// // Example sending a request using the GetConformancePackComplianceSummaryRequest method. +// req, resp := client.GetConformancePackComplianceSummaryRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetOrganizationConfigRuleDetailedStatus -func (c *ConfigService) GetOrganizationConfigRuleDetailedStatusRequest(input *GetOrganizationConfigRuleDetailedStatusInput) (req *request.Request, output *GetOrganizationConfigRuleDetailedStatusOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetConformancePackComplianceSummary +func (c *ConfigService) GetConformancePackComplianceSummaryRequest(input *GetConformancePackComplianceSummaryInput) (req *request.Request, output *GetConformancePackComplianceSummaryOutput) { op := &request.Operation{ - Name: opGetOrganizationConfigRuleDetailedStatus, + Name: opGetConformancePackComplianceSummary, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetOrganizationConfigRuleDetailedStatusInput{} + input = &GetConformancePackComplianceSummaryInput{} } - output = &GetOrganizationConfigRuleDetailedStatusOutput{} + output = &GetConformancePackComplianceSummaryOutput{} req = c.newRequest(op, input, output) return } -// GetOrganizationConfigRuleDetailedStatus API operation for AWS Config. +// GetConformancePackComplianceSummary API operation for AWS Config. // -// Returns detailed status for each member account within an organization for -// a given organization config rule. -// -// Only a master account can call this API. +// Returns compliance details for the conformance pack based on the cumulative +// compliance results of all the rules in that conformance pack. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 GetOrganizationConfigRuleDetailedStatus for usage and error information. +// API operation GetConformancePackComplianceSummary for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchOrganizationConfigRuleException "NoSuchOrganizationConfigRuleException" -// You specified one or more organization config rules that do not exist. +// Returned Error Types: +// * NoSuchConformancePackException +// You specified one or more conformance packs that do not exist. // -// * ErrCodeInvalidLimitException "InvalidLimitException" +// * InvalidLimitException // The specified limit is outside the allowable range. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // -// * ErrCodeOrganizationAccessDeniedException "OrganizationAccessDeniedException" -// For PutConfigAggregator API, no permission to call EnableAWSServiceAccess -// API. +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetConformancePackComplianceSummary +func (c *ConfigService) GetConformancePackComplianceSummary(input *GetConformancePackComplianceSummaryInput) (*GetConformancePackComplianceSummaryOutput, error) { + req, out := c.GetConformancePackComplianceSummaryRequest(input) + return out, req.Send() +} + +// GetConformancePackComplianceSummaryWithContext is the same as GetConformancePackComplianceSummary with the addition of +// the ability to pass a context and additional request options. // -// For all OrganizationConfigRule APIs, AWS Config throws an exception if APIs -// are called from member accounts. All APIs must be called from organization -// master account. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetOrganizationConfigRuleDetailedStatus -func (c *ConfigService) GetOrganizationConfigRuleDetailedStatus(input *GetOrganizationConfigRuleDetailedStatusInput) (*GetOrganizationConfigRuleDetailedStatusOutput, error) { - req, out := c.GetOrganizationConfigRuleDetailedStatusRequest(input) - return out, req.Send() -} - -// GetOrganizationConfigRuleDetailedStatusWithContext is the same as GetOrganizationConfigRuleDetailedStatus with the addition of -// the ability to pass a context and additional request options. -// -// See GetOrganizationConfigRuleDetailedStatus for details on how to use this API operation. +// See GetConformancePackComplianceSummary for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) GetOrganizationConfigRuleDetailedStatusWithContext(ctx aws.Context, input *GetOrganizationConfigRuleDetailedStatusInput, opts ...request.Option) (*GetOrganizationConfigRuleDetailedStatusOutput, error) { - req, out := c.GetOrganizationConfigRuleDetailedStatusRequest(input) +func (c *ConfigService) GetConformancePackComplianceSummaryWithContext(ctx aws.Context, input *GetConformancePackComplianceSummaryInput, opts ...request.Option) (*GetConformancePackComplianceSummaryOutput, error) { + req, out := c.GetConformancePackComplianceSummaryRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetResourceConfigHistory = "GetResourceConfigHistory" +const opGetDiscoveredResourceCounts = "GetDiscoveredResourceCounts" -// GetResourceConfigHistoryRequest generates a "aws/request.Request" representing the -// client's request for the GetResourceConfigHistory operation. The "output" return +// GetDiscoveredResourceCountsRequest generates a "aws/request.Request" representing the +// client's request for the GetDiscoveredResourceCounts operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetResourceConfigHistory for more information on using the GetResourceConfigHistory +// See GetDiscoveredResourceCounts for more information on using the GetDiscoveredResourceCounts // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetResourceConfigHistoryRequest method. -// req, resp := client.GetResourceConfigHistoryRequest(params) +// // Example sending a request using the GetDiscoveredResourceCountsRequest method. +// req, resp := client.GetDiscoveredResourceCountsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetResourceConfigHistory -func (c *ConfigService) GetResourceConfigHistoryRequest(input *GetResourceConfigHistoryInput) (req *request.Request, output *GetResourceConfigHistoryOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetDiscoveredResourceCounts +func (c *ConfigService) GetDiscoveredResourceCountsRequest(input *GetDiscoveredResourceCountsInput) (req *request.Request, output *GetDiscoveredResourceCountsOutput) { op := &request.Operation{ - Name: opGetResourceConfigHistory, + Name: opGetDiscoveredResourceCounts, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "limit", - TruncationToken: "", - }, } if input == nil { - input = &GetResourceConfigHistoryInput{} + input = &GetDiscoveredResourceCountsInput{} } - output = &GetResourceConfigHistoryOutput{} + output = &GetDiscoveredResourceCountsOutput{} req = c.newRequest(op, input, output) return } -// GetResourceConfigHistory API operation for AWS Config. +// GetDiscoveredResourceCounts 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. If you specified a retention period to retain your ConfigurationItems -// between a minimum of 30 days and a maximum of 7 years (2557 days), AWS Config -// returns the ConfigurationItems for the specified retention period. +// Returns the resource types, the number of each resource type, and the total +// number of resources that AWS Config is recording in this region for your +// AWS account. // -// The response is paginated. 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. To get the next page of results, run -// the request again and specify the string for the nextToken parameter. +// Example // -// 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. +// AWS Config is recording three resource types in the US East (Ohio) Region +// for your account: 25 EC2 instances, 20 IAM users, and 15 S3 buckets. +// +// You make a call to the GetDiscoveredResourceCounts action and specify that +// you want all resource types. +// +// AWS Config returns the following: +// +// * The resource types (EC2 instances, IAM users, and S3 buckets). +// +// * The number of each resource type (25, 20, and 15). +// +// * The total number of all resources (60). +// +// The response is paginated. By default, AWS Config lists 100 ResourceCount +// objects on each page. You can customize this number with the limit parameter. +// The response includes a nextToken string. To get the next page of results, +// run the request again and specify the string for the nextToken parameter. +// +// If you make a call to the GetDiscoveredResourceCounts action, you might not +// immediately receive resource counts in the following situations: +// +// * You are a new AWS Config customer. +// +// * You just enabled resource recording. +// +// It might take a few minutes for AWS Config to record and count your resources. +// Wait a few minutes and then retry the GetDiscoveredResourceCounts 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 GetResourceConfigHistory for usage and error information. +// API operation GetDiscoveredResourceCounts for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * 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" +// * InvalidLimitException // The specified limit is outside the allowable range. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. -// -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetDiscoveredResourceCounts +func (c *ConfigService) GetDiscoveredResourceCounts(input *GetDiscoveredResourceCountsInput) (*GetDiscoveredResourceCountsOutput, error) { + req, out := c.GetDiscoveredResourceCountsRequest(input) return out, req.Send() } -// GetResourceConfigHistoryWithContext is the same as GetResourceConfigHistory with the addition of +// GetDiscoveredResourceCountsWithContext is the same as GetDiscoveredResourceCounts with the addition of // the ability to pass a context and additional request options. // -// See GetResourceConfigHistory for details on how to use this API operation. +// See GetDiscoveredResourceCounts for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) GetResourceConfigHistoryWithContext(ctx aws.Context, input *GetResourceConfigHistoryInput, opts ...request.Option) (*GetResourceConfigHistoryOutput, error) { - req, out := c.GetResourceConfigHistoryRequest(input) +func (c *ConfigService) GetDiscoveredResourceCountsWithContext(ctx aws.Context, input *GetDiscoveredResourceCountsInput, opts ...request.Option) (*GetDiscoveredResourceCountsOutput, error) { + req, out := c.GetDiscoveredResourceCountsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// 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 *configservice.GetResourceConfigHistoryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *ConfigService) GetResourceConfigHistoryPages(input *GetResourceConfigHistoryInput, fn func(*GetResourceConfigHistoryOutput, bool) bool) error { - return c.GetResourceConfigHistoryPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetResourceConfigHistoryPagesWithContext same as GetResourceConfigHistoryPages 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 *ConfigService) GetResourceConfigHistoryPagesWithContext(ctx aws.Context, input *GetResourceConfigHistoryInput, fn func(*GetResourceConfigHistoryOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetResourceConfigHistoryInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetResourceConfigHistoryRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetResourceConfigHistoryOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListAggregateDiscoveredResources = "ListAggregateDiscoveredResources" +const opGetOrganizationConfigRuleDetailedStatus = "GetOrganizationConfigRuleDetailedStatus" -// ListAggregateDiscoveredResourcesRequest generates a "aws/request.Request" representing the -// client's request for the ListAggregateDiscoveredResources operation. The "output" return +// GetOrganizationConfigRuleDetailedStatusRequest generates a "aws/request.Request" representing the +// client's request for the GetOrganizationConfigRuleDetailedStatus operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListAggregateDiscoveredResources for more information on using the ListAggregateDiscoveredResources +// See GetOrganizationConfigRuleDetailedStatus for more information on using the GetOrganizationConfigRuleDetailedStatus // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListAggregateDiscoveredResourcesRequest method. -// req, resp := client.ListAggregateDiscoveredResourcesRequest(params) +// // Example sending a request using the GetOrganizationConfigRuleDetailedStatusRequest method. +// req, resp := client.GetOrganizationConfigRuleDetailedStatusRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ListAggregateDiscoveredResources -func (c *ConfigService) ListAggregateDiscoveredResourcesRequest(input *ListAggregateDiscoveredResourcesInput) (req *request.Request, output *ListAggregateDiscoveredResourcesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetOrganizationConfigRuleDetailedStatus +func (c *ConfigService) GetOrganizationConfigRuleDetailedStatusRequest(input *GetOrganizationConfigRuleDetailedStatusInput) (req *request.Request, output *GetOrganizationConfigRuleDetailedStatusOutput) { op := &request.Operation{ - Name: opListAggregateDiscoveredResources, + Name: opGetOrganizationConfigRuleDetailedStatus, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ListAggregateDiscoveredResourcesInput{} + input = &GetOrganizationConfigRuleDetailedStatusInput{} } - output = &ListAggregateDiscoveredResourcesOutput{} + output = &GetOrganizationConfigRuleDetailedStatusOutput{} req = c.newRequest(op, input, output) return } -// ListAggregateDiscoveredResources API operation for AWS Config. +// GetOrganizationConfigRuleDetailedStatus API operation for AWS Config. // -// Accepts a resource type and returns a list of resource identifiers that are -// aggregated for a specific resource type across accounts and regions. A resource -// identifier includes the resource type, ID, (if available) the custom resource -// name, source account, and source region. You can narrow the results to include -// only resources that have specific resource IDs, or a resource name, or source -// account ID, or source region. +// Returns detailed status for each member account within an organization for +// a given organization config rule. // -// For example, if the input consists of accountID 12345678910 and the region -// is us-east-1 for resource type AWS::EC2::Instance then the API returns all -// the EC2 instance identifiers of accountID 12345678910 and region us-east-1. +// Only a master account can call 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 Config's -// API operation ListAggregateDiscoveredResources for usage and error information. +// API operation GetOrganizationConfigRuleDetailedStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The requested action is not valid. +// Returned Error Types: +// * NoSuchOrganizationConfigRuleException +// You specified one or more organization config rules that do not exist. // -// * ErrCodeInvalidLimitException "InvalidLimitException" +// * InvalidLimitException // The specified limit is outside the allowable range. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // -// * ErrCodeNoSuchConfigurationAggregatorException "NoSuchConfigurationAggregatorException" -// You have specified a configuration aggregator that does not exist. +// * OrganizationAccessDeniedException +// For PutConfigAggregator API, no permission to call EnableAWSServiceAccess +// API. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ListAggregateDiscoveredResources -func (c *ConfigService) ListAggregateDiscoveredResources(input *ListAggregateDiscoveredResourcesInput) (*ListAggregateDiscoveredResourcesOutput, error) { - req, out := c.ListAggregateDiscoveredResourcesRequest(input) +// For all OrganizationConfigRule and OrganizationConformancePack APIs, AWS +// Config throws an exception if APIs are called from member accounts. All APIs +// must be called from organization master account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetOrganizationConfigRuleDetailedStatus +func (c *ConfigService) GetOrganizationConfigRuleDetailedStatus(input *GetOrganizationConfigRuleDetailedStatusInput) (*GetOrganizationConfigRuleDetailedStatusOutput, error) { + req, out := c.GetOrganizationConfigRuleDetailedStatusRequest(input) return out, req.Send() } -// ListAggregateDiscoveredResourcesWithContext is the same as ListAggregateDiscoveredResources with the addition of +// GetOrganizationConfigRuleDetailedStatusWithContext is the same as GetOrganizationConfigRuleDetailedStatus with the addition of // the ability to pass a context and additional request options. // -// See ListAggregateDiscoveredResources for details on how to use this API operation. +// See GetOrganizationConfigRuleDetailedStatus for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) ListAggregateDiscoveredResourcesWithContext(ctx aws.Context, input *ListAggregateDiscoveredResourcesInput, opts ...request.Option) (*ListAggregateDiscoveredResourcesOutput, error) { - req, out := c.ListAggregateDiscoveredResourcesRequest(input) +func (c *ConfigService) GetOrganizationConfigRuleDetailedStatusWithContext(ctx aws.Context, input *GetOrganizationConfigRuleDetailedStatusInput, opts ...request.Option) (*GetOrganizationConfigRuleDetailedStatusOutput, error) { + req, out := c.GetOrganizationConfigRuleDetailedStatusRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListDiscoveredResources = "ListDiscoveredResources" +const opGetOrganizationConformancePackDetailedStatus = "GetOrganizationConformancePackDetailedStatus" -// ListDiscoveredResourcesRequest generates a "aws/request.Request" representing the -// client's request for the ListDiscoveredResources operation. The "output" return +// GetOrganizationConformancePackDetailedStatusRequest generates a "aws/request.Request" representing the +// client's request for the GetOrganizationConformancePackDetailedStatus operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListDiscoveredResources for more information on using the ListDiscoveredResources +// See GetOrganizationConformancePackDetailedStatus for more information on using the GetOrganizationConformancePackDetailedStatus // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListDiscoveredResourcesRequest method. -// req, resp := client.ListDiscoveredResourcesRequest(params) +// // Example sending a request using the GetOrganizationConformancePackDetailedStatusRequest method. +// req, resp := client.GetOrganizationConformancePackDetailedStatusRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ListDiscoveredResources -func (c *ConfigService) ListDiscoveredResourcesRequest(input *ListDiscoveredResourcesInput) (req *request.Request, output *ListDiscoveredResourcesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetOrganizationConformancePackDetailedStatus +func (c *ConfigService) GetOrganizationConformancePackDetailedStatusRequest(input *GetOrganizationConformancePackDetailedStatusInput) (req *request.Request, output *GetOrganizationConformancePackDetailedStatusOutput) { op := &request.Operation{ - Name: opListDiscoveredResources, + Name: opGetOrganizationConformancePackDetailedStatus, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ListDiscoveredResourcesInput{} + input = &GetOrganizationConformancePackDetailedStatusInput{} } - output = &ListDiscoveredResourcesOutput{} + output = &GetOrganizationConformancePackDetailedStatusOutput{} 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. +// GetOrganizationConformancePackDetailedStatus API operation for AWS Config. // -// You can specify either resource IDs or a resource name, but not both, in -// the same request. +// Returns detailed status for each member account within an organization for +// a given organization conformance pack. // -// The response is paginated. 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. To get the next page of results, run -// the request again and specify the string for the nextToken parameter. +// Only a master account can call 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 Config's -// API operation ListDiscoveredResources for usage and error information. +// API operation GetOrganizationConformancePackDetailedStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The requested action is not valid. +// Returned Error Types: +// * NoSuchOrganizationConformancePackException +// AWS Config organization conformance pack that you passed in the filter does +// not exist. +// +// For DeleteOrganizationConformancePack, you tried to delete an organization +// conformance pack that does not exist. // -// * ErrCodeInvalidLimitException "InvalidLimitException" +// * InvalidLimitException // The specified limit is outside the allowable range. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. +// * OrganizationAccessDeniedException +// For PutConfigAggregator API, no permission to call EnableAWSServiceAccess +// API. // -// See also, 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) +// For all OrganizationConfigRule and OrganizationConformancePack APIs, AWS +// Config throws an exception if APIs are called from member accounts. All APIs +// must be called from organization master account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/GetOrganizationConformancePackDetailedStatus +func (c *ConfigService) GetOrganizationConformancePackDetailedStatus(input *GetOrganizationConformancePackDetailedStatusInput) (*GetOrganizationConformancePackDetailedStatusOutput, error) { + req, out := c.GetOrganizationConformancePackDetailedStatusRequest(input) return out, req.Send() } -// ListDiscoveredResourcesWithContext is the same as ListDiscoveredResources with the addition of +// GetOrganizationConformancePackDetailedStatusWithContext is the same as GetOrganizationConformancePackDetailedStatus with the addition of // the ability to pass a context and additional request options. // -// See ListDiscoveredResources for details on how to use this API operation. +// See GetOrganizationConformancePackDetailedStatus for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) ListDiscoveredResourcesWithContext(ctx aws.Context, input *ListDiscoveredResourcesInput, opts ...request.Option) (*ListDiscoveredResourcesOutput, error) { - req, out := c.ListDiscoveredResourcesRequest(input) +func (c *ConfigService) GetOrganizationConformancePackDetailedStatusWithContext(ctx aws.Context, input *GetOrganizationConformancePackDetailedStatusInput, opts ...request.Option) (*GetOrganizationConformancePackDetailedStatusOutput, error) { + req, out := c.GetOrganizationConformancePackDetailedStatusRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListTagsForResource = "ListTagsForResource" +const opGetResourceConfigHistory = "GetResourceConfigHistory" -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource operation. The "output" return +// GetResourceConfigHistoryRequest generates a "aws/request.Request" representing the +// client's request for the GetResourceConfigHistory operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListTagsForResource for more information on using the ListTagsForResource +// See GetResourceConfigHistory for more information on using the GetResourceConfigHistory // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ListTagsForResource -func (c *ConfigService) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { +// See also, 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: opListTagsForResource, + Name: opGetResourceConfigHistory, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "limit", + TruncationToken: "", + }, } if input == nil { - input = &ListTagsForResourceInput{} + input = &GetResourceConfigHistoryInput{} } - output = &ListTagsForResourceOutput{} + output = &GetResourceConfigHistoryOutput{} req = c.newRequest(op, input, output) return } -// ListTagsForResource API operation for AWS Config. +// GetResourceConfigHistory API operation for AWS Config. // -// List the tags for AWS Config resource. +// 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. If you specified a retention period to retain your ConfigurationItems +// between a minimum of 30 days and a maximum of 7 years (2557 days), AWS Config +// returns the ConfigurationItems for the specified retention period. +// +// The response is paginated. 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. To get the next page of results, run +// the request again and specify the 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 ListTagsForResource for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// You have specified a resource that does not exist. +// API operation GetResourceConfigHistory for usage and error information. // -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The requested action is not valid. // -// * ErrCodeInvalidLimitException "InvalidLimitException" +// * InvalidTimeRangeException +// The specified time range is not valid. The earlier time is not chronologically +// before the later time. +// +// * InvalidLimitException // The specified limit is outside the allowable range. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * 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. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ListTagsForResource -func (c *ConfigService) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) +// * NoAvailableConfigurationRecorderException +// There are no configuration recorders available to provide the role needed +// to describe your resources. Create a configuration recorder. +// +// * ResourceNotDiscoveredException +// You have specified a resource that is either unknown or has not been discovered. +// +// See also, 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) return out, req.Send() } -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// GetResourceConfigHistoryWithContext is the same as GetResourceConfigHistory with the addition of // the ability to pass a context and additional request options. // -// See ListTagsForResource for details on how to use this API operation. +// See GetResourceConfigHistory for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) +func (c *ConfigService) GetResourceConfigHistoryWithContext(ctx aws.Context, input *GetResourceConfigHistoryInput, opts ...request.Option) (*GetResourceConfigHistoryOutput, error) { + req, out := c.GetResourceConfigHistoryRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPutAggregationAuthorization = "PutAggregationAuthorization" +// 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 *configservice.GetResourceConfigHistoryOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *ConfigService) GetResourceConfigHistoryPages(input *GetResourceConfigHistoryInput, fn func(*GetResourceConfigHistoryOutput, bool) bool) error { + return c.GetResourceConfigHistoryPagesWithContext(aws.BackgroundContext(), input, fn) +} -// PutAggregationAuthorizationRequest generates a "aws/request.Request" representing the -// client's request for the PutAggregationAuthorization operation. The "output" return +// GetResourceConfigHistoryPagesWithContext same as GetResourceConfigHistoryPages 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 *ConfigService) GetResourceConfigHistoryPagesWithContext(ctx aws.Context, input *GetResourceConfigHistoryInput, fn func(*GetResourceConfigHistoryOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetResourceConfigHistoryInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetResourceConfigHistoryRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*GetResourceConfigHistoryOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListAggregateDiscoveredResources = "ListAggregateDiscoveredResources" + +// ListAggregateDiscoveredResourcesRequest generates a "aws/request.Request" representing the +// client's request for the ListAggregateDiscoveredResources operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutAggregationAuthorization for more information on using the PutAggregationAuthorization +// See ListAggregateDiscoveredResources for more information on using the ListAggregateDiscoveredResources // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutAggregationAuthorizationRequest method. -// req, resp := client.PutAggregationAuthorizationRequest(params) +// // Example sending a request using the ListAggregateDiscoveredResourcesRequest method. +// req, resp := client.ListAggregateDiscoveredResourcesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutAggregationAuthorization -func (c *ConfigService) PutAggregationAuthorizationRequest(input *PutAggregationAuthorizationInput) (req *request.Request, output *PutAggregationAuthorizationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ListAggregateDiscoveredResources +func (c *ConfigService) ListAggregateDiscoveredResourcesRequest(input *ListAggregateDiscoveredResourcesInput) (req *request.Request, output *ListAggregateDiscoveredResourcesOutput) { op := &request.Operation{ - Name: opPutAggregationAuthorization, + Name: opListAggregateDiscoveredResources, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PutAggregationAuthorizationInput{} + input = &ListAggregateDiscoveredResourcesInput{} } - output = &PutAggregationAuthorizationOutput{} + output = &ListAggregateDiscoveredResourcesOutput{} req = c.newRequest(op, input, output) return } -// PutAggregationAuthorization API operation for AWS Config. +// ListAggregateDiscoveredResources API operation for AWS Config. // -// Authorizes the aggregator account and region to collect data from the source -// account and region. +// Accepts a resource type and returns a list of resource identifiers that are +// aggregated for a specific resource type across accounts and regions. A resource +// identifier includes the resource type, ID, (if available) the custom resource +// name, source account, and source region. You can narrow the results to include +// only resources that have specific resource IDs, or a resource name, or source +// account ID, or source region. +// +// For example, if the input consists of accountID 12345678910 and the region +// is us-east-1 for resource type AWS::EC2::Instance then the API returns all +// the EC2 instance identifiers of accountID 12345678910 and region us-east-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 Config's -// API operation PutAggregationAuthorization for usage and error information. +// API operation ListAggregateDiscoveredResources 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. +// Returned Error Types: +// * ValidationException +// The requested action is not valid. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutAggregationAuthorization -func (c *ConfigService) PutAggregationAuthorization(input *PutAggregationAuthorizationInput) (*PutAggregationAuthorizationOutput, error) { - req, out := c.PutAggregationAuthorizationRequest(input) +// * InvalidLimitException +// The specified limit is outside the allowable range. +// +// * 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. +// +// * NoSuchConfigurationAggregatorException +// You have specified a configuration aggregator that does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ListAggregateDiscoveredResources +func (c *ConfigService) ListAggregateDiscoveredResources(input *ListAggregateDiscoveredResourcesInput) (*ListAggregateDiscoveredResourcesOutput, error) { + req, out := c.ListAggregateDiscoveredResourcesRequest(input) return out, req.Send() } -// PutAggregationAuthorizationWithContext is the same as PutAggregationAuthorization with the addition of +// ListAggregateDiscoveredResourcesWithContext is the same as ListAggregateDiscoveredResources with the addition of // the ability to pass a context and additional request options. // -// See PutAggregationAuthorization for details on how to use this API operation. +// See ListAggregateDiscoveredResources for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) PutAggregationAuthorizationWithContext(ctx aws.Context, input *PutAggregationAuthorizationInput, opts ...request.Option) (*PutAggregationAuthorizationOutput, error) { - req, out := c.PutAggregationAuthorizationRequest(input) +func (c *ConfigService) ListAggregateDiscoveredResourcesWithContext(ctx aws.Context, input *ListAggregateDiscoveredResourcesInput, opts ...request.Option) (*ListAggregateDiscoveredResourcesOutput, error) { + req, out := c.ListAggregateDiscoveredResourcesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPutConfigRule = "PutConfigRule" +const opListDiscoveredResources = "ListDiscoveredResources" -// PutConfigRuleRequest generates a "aws/request.Request" representing the -// client's request for the PutConfigRule operation. The "output" return +// ListDiscoveredResourcesRequest generates a "aws/request.Request" representing the +// client's request for the ListDiscoveredResources operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutConfigRule for more information on using the PutConfigRule +// See ListDiscoveredResources for more information on using the ListDiscoveredResources // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutConfigRuleRequest method. -// req, resp := client.PutConfigRuleRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigRule -func (c *ConfigService) PutConfigRuleRequest(input *PutConfigRuleInput) (req *request.Request, output *PutConfigRuleOutput) { +// See also, 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: opPutConfigRule, + Name: opListDiscoveredResources, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PutConfigRuleInput{} + input = &ListDiscoveredResourcesInput{} } - output = &PutConfigRuleOutput{} + output = &ListDiscoveredResourcesOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, 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 AWS Config rules and AWS managed Config -// rules. A custom AWS 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 AWS 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 an AWS managed Config rule, specify the rule's identifier -// for the SourceIdentifier key. To reference AWS managed Config rule identifiers, -// see About AWS Managed Config Rules (https://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. +// ListDiscoveredResources API operation for AWS Config. // -// The maximum number of rules that AWS Config supports is 150. +// 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. // -// For 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. +// You can specify either resource IDs or a resource name, but not both, in +// the same request. // -// For more information about developing and using AWS Config rules, see Evaluating -// AWS Resource Configurations with AWS Config (https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config.html) -// in the AWS Config Developer Guide. +// The response is paginated. 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. To get the next page of results, run +// the request again and specify the 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 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 150 rules. Consider deleting any deactivated rules before -// you add new rules. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// You see this exception in the following cases: -// -// * For DeleteConfigRule API, AWS Config is deleting this rule. Try your -// request again later. -// -// * For DeleteConfigRule API, the rule is deleting your evaluation results. -// Try your request again later. -// -// * For DeleteConfigRule API, a remediation action is associated with the -// rule and AWS Config cannot delete this rule. Delete the remediation action -// associated with the rule before deleting the rule and try your request -// again later. -// -// * For PutConfigOrganizationRule, organization config rule deletion is -// in progress. Try your request again later. -// -// * For DeleteOrganizationConfigRule, organization config rule creation -// is in progress. Try your request again later. -// -// * ErrCodeInsufficientPermissionsException "InsufficientPermissionsException" -// Indicates one of the following errors: +// API operation ListDiscoveredResources for usage and error information. // -// * For PutConfigRule, the rule cannot be created because the IAM role assigned -// to AWS Config lacks permissions to perform the config:Put* action. +// Returned Error Types: +// * ValidationException +// The requested action is not valid. // -// * For PutConfigRule, the AWS Lambda function cannot be invoked. Check -// the function ARN, and check the function's permissions. +// * InvalidLimitException +// The specified limit is outside the allowable range. // -// * For OrganizationConfigRule, organization config rule cannot be created -// because you do not have permissions to call IAM GetRole action or create -// service linked role. +// * 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" +// * NoAvailableConfigurationRecorderException // There are no configuration recorders available to provide the role needed // to describe your resources. Create a configuration recorder. // -// See also, 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) +// See also, 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) return out, req.Send() } -// PutConfigRuleWithContext is the same as PutConfigRule with the addition of +// ListDiscoveredResourcesWithContext is the same as ListDiscoveredResources with the addition of // the ability to pass a context and additional request options. // -// See PutConfigRule for details on how to use this API operation. +// See ListDiscoveredResources for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) PutConfigRuleWithContext(ctx aws.Context, input *PutConfigRuleInput, opts ...request.Option) (*PutConfigRuleOutput, error) { - req, out := c.PutConfigRuleRequest(input) +func (c *ConfigService) ListDiscoveredResourcesWithContext(ctx aws.Context, input *ListDiscoveredResourcesInput, opts ...request.Option) (*ListDiscoveredResourcesOutput, error) { + req, out := c.ListDiscoveredResourcesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPutConfigurationAggregator = "PutConfigurationAggregator" +const opListTagsForResource = "ListTagsForResource" -// PutConfigurationAggregatorRequest generates a "aws/request.Request" representing the -// client's request for the PutConfigurationAggregator operation. The "output" return +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutConfigurationAggregator for more information on using the PutConfigurationAggregator +// See ListTagsForResource for more information on using the ListTagsForResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutConfigurationAggregatorRequest method. -// req, resp := client.PutConfigurationAggregatorRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigurationAggregator -func (c *ConfigService) PutConfigurationAggregatorRequest(input *PutConfigurationAggregatorInput) (req *request.Request, output *PutConfigurationAggregatorOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ListTagsForResource +func (c *ConfigService) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { op := &request.Operation{ - Name: opPutConfigurationAggregator, + Name: opListTagsForResource, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PutConfigurationAggregatorInput{} + input = &ListTagsForResourceInput{} } - output = &PutConfigurationAggregatorOutput{} + output = &ListTagsForResourceOutput{} req = c.newRequest(op, input, output) return } -// PutConfigurationAggregator API operation for AWS Config. -// -// Creates and updates the configuration aggregator with the selected source -// accounts and regions. The source account can be individual account(s) or -// an organization. -// -// AWS Config should be enabled in source accounts and regions you want to aggregate. +// ListTagsForResource API operation for AWS Config. // -// If your source type is an organization, you must be signed in to the master -// account and all features must be enabled in your organization. AWS Config -// calls EnableAwsServiceAccess API to enable integration between AWS Config -// and AWS Organizations. +// List the tags for AWS Config 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 Config's -// API operation PutConfigurationAggregator 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. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// For StartConfigRulesEvaluation API, this exception is thrown if an evaluation -// is in progress or if you call the StartConfigRulesEvaluation API more than -// once per minute. -// -// For PutConfigurationAggregator API, this exception is thrown if the number -// of accounts and aggregators exceeds the limit. -// -// * ErrCodeInvalidRoleException "InvalidRoleException" -// You have provided a null or empty role ARN. +// API operation ListTagsForResource for usage and error information. // -// * ErrCodeOrganizationAccessDeniedException "OrganizationAccessDeniedException" -// For PutConfigAggregator API, no permission to call EnableAWSServiceAccess -// API. +// Returned Error Types: +// * ResourceNotFoundException +// You have specified a resource that does not exist. // -// For all OrganizationConfigRule APIs, AWS Config throws an exception if APIs -// are called from member accounts. All APIs must be called from organization -// master account. +// * ValidationException +// The requested action is not valid. // -// * ErrCodeNoAvailableOrganizationException "NoAvailableOrganizationException" -// Organization is no longer available. +// * InvalidLimitException +// The specified limit is outside the allowable range. // -// * ErrCodeOrganizationAllFeaturesNotEnabledException "OrganizationAllFeaturesNotEnabledException" -// AWS Config resource cannot be created because your organization does not -// have all features enabled. +// * 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. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigurationAggregator -func (c *ConfigService) PutConfigurationAggregator(input *PutConfigurationAggregatorInput) (*PutConfigurationAggregatorOutput, error) { - req, out := c.PutConfigurationAggregatorRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/ListTagsForResource +func (c *ConfigService) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) return out, req.Send() } -// PutConfigurationAggregatorWithContext is the same as PutConfigurationAggregator with the addition of +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of // the ability to pass a context and additional request options. // -// See PutConfigurationAggregator for details on how to use this API operation. +// See ListTagsForResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) PutConfigurationAggregatorWithContext(ctx aws.Context, input *PutConfigurationAggregatorInput, opts ...request.Option) (*PutConfigurationAggregatorOutput, error) { - req, out := c.PutConfigurationAggregatorRequest(input) +func (c *ConfigService) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPutConfigurationRecorder = "PutConfigurationRecorder" +const opPutAggregationAuthorization = "PutAggregationAuthorization" -// PutConfigurationRecorderRequest generates a "aws/request.Request" representing the -// client's request for the PutConfigurationRecorder operation. The "output" return +// PutAggregationAuthorizationRequest generates a "aws/request.Request" representing the +// client's request for the PutAggregationAuthorization operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutConfigurationRecorder for more information on using the PutConfigurationRecorder +// See PutAggregationAuthorization for more information on using the PutAggregationAuthorization // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutConfigurationRecorderRequest method. -// req, resp := client.PutConfigurationRecorderRequest(params) +// // Example sending a request using the PutAggregationAuthorizationRequest method. +// req, resp := client.PutAggregationAuthorizationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigurationRecorder -func (c *ConfigService) PutConfigurationRecorderRequest(input *PutConfigurationRecorderInput) (req *request.Request, output *PutConfigurationRecorderOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutAggregationAuthorization +func (c *ConfigService) PutAggregationAuthorizationRequest(input *PutAggregationAuthorizationInput) (req *request.Request, output *PutAggregationAuthorizationOutput) { op := &request.Operation{ - Name: opPutConfigurationRecorder, + Name: opPutAggregationAuthorization, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PutConfigurationRecorderInput{} + input = &PutAggregationAuthorizationInput{} } - output = &PutConfigurationRecorderOutput{} + output = &PutAggregationAuthorizationOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, 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 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. +// PutAggregationAuthorization API operation for AWS Config. // -// If ConfigurationRecorder does not have the recordingGroup parameter specified, -// the default is to record all supported resource types. +// Authorizes the aggregator account and region to collect data from the source +// account and 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 Config's -// API operation PutConfigurationRecorder for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMaxNumberOfConfigurationRecordersExceededException "MaxNumberOfConfigurationRecordersExceededException" -// You have reached the limit of 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. +// API operation PutAggregationAuthorization for usage and error information. // -// * ErrCodeInvalidRecordingGroupException "InvalidRecordingGroupException" -// AWS Config throws an exception if the recording group does not contain a -// valid list of resource types. Invalid values might also be incorrectly formatted. +// Returned Error Types: +// * InvalidParameterValueException +// One or more of the specified parameters are invalid. Verify that your parameters +// are valid and try again. // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutAggregationAuthorization +func (c *ConfigService) PutAggregationAuthorization(input *PutAggregationAuthorizationInput) (*PutAggregationAuthorizationOutput, error) { + req, out := c.PutAggregationAuthorizationRequest(input) return out, req.Send() } -// PutConfigurationRecorderWithContext is the same as PutConfigurationRecorder with the addition of +// PutAggregationAuthorizationWithContext is the same as PutAggregationAuthorization with the addition of // the ability to pass a context and additional request options. // -// See PutConfigurationRecorder for details on how to use this API operation. +// See PutAggregationAuthorization for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) PutConfigurationRecorderWithContext(ctx aws.Context, input *PutConfigurationRecorderInput, opts ...request.Option) (*PutConfigurationRecorderOutput, error) { - req, out := c.PutConfigurationRecorderRequest(input) +func (c *ConfigService) PutAggregationAuthorizationWithContext(ctx aws.Context, input *PutAggregationAuthorizationInput, opts ...request.Option) (*PutAggregationAuthorizationOutput, error) { + req, out := c.PutAggregationAuthorizationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPutDeliveryChannel = "PutDeliveryChannel" +const opPutConfigRule = "PutConfigRule" -// PutDeliveryChannelRequest generates a "aws/request.Request" representing the -// client's request for the PutDeliveryChannel operation. The "output" return +// PutConfigRuleRequest generates a "aws/request.Request" representing the +// client's request for the PutConfigRule operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutDeliveryChannel for more information on using the PutDeliveryChannel +// See PutConfigRule for more information on using the PutConfigRule // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutDeliveryChannelRequest method. -// req, resp := client.PutDeliveryChannelRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutDeliveryChannel -func (c *ConfigService) PutDeliveryChannelRequest(input *PutDeliveryChannelInput) (req *request.Request, output *PutDeliveryChannelOutput) { +// See also, 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: opPutDeliveryChannel, + Name: opPutConfigRule, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PutDeliveryChannelInput{} + input = &PutConfigRuleInput{} } - output = &PutDeliveryChannelOutput{} + output = &PutConfigRuleOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// PutDeliveryChannel API operation for AWS Config. +// PutConfigRule API operation for AWS Config. // -// Creates a delivery channel object to deliver configuration information to -// an Amazon S3 bucket and Amazon SNS topic. +// Adds or updates an AWS Config rule for evaluating whether your AWS resources +// comply with your desired configurations. // -// Before you can create a delivery channel, you must create a configuration -// recorder. +// You can use this action for custom AWS Config rules and AWS managed Config +// rules. A custom AWS Config rule is a rule that you develop and maintain. +// An AWS managed Config rule is a customizable, predefined rule that AWS Config +// provides. // -// 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. +// If you are adding a new custom AWS 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. // -// You can have only one delivery channel per region in your account. +// If you are adding an AWS managed Config rule, specify the rule's identifier +// for the SourceIdentifier key. To reference AWS managed Config rule identifiers, +// see About AWS Managed Config Rules (https://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 150. +// +// For 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 (https://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 PutDeliveryChannel for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMaxNumberOfDeliveryChannelsExceededException "MaxNumberOfDeliveryChannelsExceededException" -// You have reached the limit of the number of delivery channels you can create. +// API operation PutConfigRule for usage and error information. // -// * ErrCodeNoAvailableConfigurationRecorderException "NoAvailableConfigurationRecorderException" -// There are no configuration recorders available to provide the role needed -// to describe your resources. Create a configuration recorder. +// Returned Error Types: +// * InvalidParameterValueException +// One or more of the specified parameters are invalid. Verify that your parameters +// are valid and try again. // -// * ErrCodeInvalidDeliveryChannelNameException "InvalidDeliveryChannelNameException" -// The specified delivery channel name is not valid. +// * MaxNumberOfConfigRulesExceededException +// Failed to add the AWS Config rule because the account already contains the +// maximum number of 150 rules. Consider deleting any deactivated rules before +// you add new rules. // -// * ErrCodeNoSuchBucketException "NoSuchBucketException" -// The specified Amazon S3 bucket does not exist. +// * ResourceInUseException +// You see this exception in the following cases: // -// * ErrCodeInvalidS3KeyPrefixException "InvalidS3KeyPrefixException" -// The specified Amazon S3 key prefix is not valid. +// * For DeleteConfigRule, AWS Config is deleting this rule. Try your request +// again later. // -// * ErrCodeInvalidSNSTopicARNException "InvalidSNSTopicARNException" -// The specified Amazon SNS topic does not exist. +// * For DeleteConfigRule, the rule is deleting your evaluation results. +// Try your request again later. // -// * ErrCodeInsufficientDeliveryPolicyException "InsufficientDeliveryPolicyException" -// Your Amazon S3 bucket policy does not permit AWS Config to write to it. +// * For DeleteConfigRule, a remediation action is associated with the rule +// and AWS Config cannot delete this rule. Delete the remediation action +// associated with the rule before deleting the rule and try your request +// again later. // -// See also, 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) +// * For PutConfigOrganizationRule, organization config rule deletion is +// in progress. Try your request again later. +// +// * For DeleteOrganizationConfigRule, organization config rule creation +// is in progress. Try your request again later. +// +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack creation, update, and deletion is in progress. Try your request again +// later. +// +// * For DeleteConformancePack, a conformance pack creation, update, and +// deletion is in progress. Try your request again later. +// +// * InsufficientPermissionsException +// Indicates one of the following errors: +// +// * For PutConfigRule, the rule cannot be created because the IAM role assigned +// to AWS Config lacks permissions to perform the config:Put* action. +// +// * For PutConfigRule, the AWS Lambda function cannot be invoked. Check +// the function ARN, and check the function's permissions. +// +// * For PutOrganizationConfigRule, organization config rule cannot be created +// because you do not have permissions to call IAM GetRole action or create +// a service linked role. +// +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack cannot be created because you do not have permissions: To call IAM +// GetRole action or create a service linked role. To read Amazon S3 bucket. +// +// * NoAvailableConfigurationRecorderException +// There are no configuration recorders available to provide the role needed +// to describe your resources. Create a configuration recorder. +// +// See also, 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) return out, req.Send() } -// PutDeliveryChannelWithContext is the same as PutDeliveryChannel with the addition of +// PutConfigRuleWithContext is the same as PutConfigRule with the addition of // the ability to pass a context and additional request options. // -// See PutDeliveryChannel for details on how to use this API operation. +// See PutConfigRule for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) PutDeliveryChannelWithContext(ctx aws.Context, input *PutDeliveryChannelInput, opts ...request.Option) (*PutDeliveryChannelOutput, error) { - req, out := c.PutDeliveryChannelRequest(input) +func (c *ConfigService) PutConfigRuleWithContext(ctx aws.Context, input *PutConfigRuleInput, opts ...request.Option) (*PutConfigRuleOutput, error) { + req, out := c.PutConfigRuleRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPutEvaluations = "PutEvaluations" +const opPutConfigurationAggregator = "PutConfigurationAggregator" -// PutEvaluationsRequest generates a "aws/request.Request" representing the -// client's request for the PutEvaluations operation. The "output" return +// PutConfigurationAggregatorRequest generates a "aws/request.Request" representing the +// client's request for the PutConfigurationAggregator operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutEvaluations for more information on using the PutEvaluations +// See PutConfigurationAggregator for more information on using the PutConfigurationAggregator // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutEvaluationsRequest method. -// req, resp := client.PutEvaluationsRequest(params) +// // Example sending a request using the PutConfigurationAggregatorRequest method. +// req, resp := client.PutConfigurationAggregatorRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutEvaluations -func (c *ConfigService) PutEvaluationsRequest(input *PutEvaluationsInput) (req *request.Request, output *PutEvaluationsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigurationAggregator +func (c *ConfigService) PutConfigurationAggregatorRequest(input *PutConfigurationAggregatorInput) (req *request.Request, output *PutConfigurationAggregatorOutput) { op := &request.Operation{ - Name: opPutEvaluations, + Name: opPutConfigurationAggregator, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PutEvaluationsInput{} + input = &PutConfigurationAggregatorInput{} } - output = &PutEvaluationsOutput{} + output = &PutConfigurationAggregatorOutput{} req = c.newRequest(op, input, output) return } -// PutEvaluations API operation for AWS Config. +// PutConfigurationAggregator 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. +// Creates and updates the configuration aggregator with the selected source +// accounts and regions. The source account can be individual account(s) or +// an organization. +// +// AWS Config should be enabled in source accounts and regions you want to aggregate. +// +// If your source type is an organization, you must be signed in to the master +// account and all features must be enabled in your organization. AWS Config +// calls EnableAwsServiceAccess API to enable integration between AWS Config +// and AWS Organizations. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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. +// API operation PutConfigurationAggregator for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * 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. +// * LimitExceededException +// For StartConfigRulesEvaluation API, this exception is thrown if an evaluation +// is in progress or if you call the StartConfigRulesEvaluation API more than +// once per minute. // -// * ErrCodeNoSuchConfigRuleException "NoSuchConfigRuleException" -// One or more AWS Config rules in the request are invalid. Verify that the -// rule names are correct and try again. +// For PutConfigurationAggregator API, this exception is thrown if the number +// of accounts and aggregators exceeds the limit. // -// See also, 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) +// * InvalidRoleException +// You have provided a null or empty role ARN. +// +// * OrganizationAccessDeniedException +// For PutConfigAggregator API, no permission to call EnableAWSServiceAccess +// API. +// +// For all OrganizationConfigRule and OrganizationConformancePack APIs, AWS +// Config throws an exception if APIs are called from member accounts. All APIs +// must be called from organization master account. +// +// * NoAvailableOrganizationException +// Organization is no longer available. +// +// * OrganizationAllFeaturesNotEnabledException +// AWS Config resource cannot be created because your organization does not +// have all features enabled. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConfigurationAggregator +func (c *ConfigService) PutConfigurationAggregator(input *PutConfigurationAggregatorInput) (*PutConfigurationAggregatorOutput, error) { + req, out := c.PutConfigurationAggregatorRequest(input) return out, req.Send() } -// PutEvaluationsWithContext is the same as PutEvaluations with the addition of +// PutConfigurationAggregatorWithContext is the same as PutConfigurationAggregator with the addition of // the ability to pass a context and additional request options. // -// See PutEvaluations for details on how to use this API operation. +// See PutConfigurationAggregator for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) PutEvaluationsWithContext(ctx aws.Context, input *PutEvaluationsInput, opts ...request.Option) (*PutEvaluationsOutput, error) { - req, out := c.PutEvaluationsRequest(input) +func (c *ConfigService) PutConfigurationAggregatorWithContext(ctx aws.Context, input *PutConfigurationAggregatorInput, opts ...request.Option) (*PutConfigurationAggregatorOutput, error) { + req, out := c.PutConfigurationAggregatorRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPutOrganizationConfigRule = "PutOrganizationConfigRule" +const opPutConfigurationRecorder = "PutConfigurationRecorder" -// PutOrganizationConfigRuleRequest generates a "aws/request.Request" representing the -// client's request for the PutOrganizationConfigRule operation. The "output" return +// PutConfigurationRecorderRequest generates a "aws/request.Request" representing the +// client's request for the PutConfigurationRecorder operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutOrganizationConfigRule for more information on using the PutOrganizationConfigRule +// See PutConfigurationRecorder for more information on using the PutConfigurationRecorder // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutOrganizationConfigRuleRequest method. -// req, resp := client.PutOrganizationConfigRuleRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutOrganizationConfigRule -func (c *ConfigService) PutOrganizationConfigRuleRequest(input *PutOrganizationConfigRuleInput) (req *request.Request, output *PutOrganizationConfigRuleOutput) { +// See also, 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: opPutOrganizationConfigRule, + Name: opPutConfigurationRecorder, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PutOrganizationConfigRuleInput{} + input = &PutConfigurationRecorderInput{} } - output = &PutOrganizationConfigRuleOutput{} + output = &PutConfigurationRecorderOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// PutOrganizationConfigRule API operation for AWS Config. -// -// Adds or updates organization config rule for your entire organization evaluating -// whether your AWS resources comply with your desired configurations. Only -// a master account can create or update an organization config rule. +// PutConfigurationRecorder API operation for AWS Config. // -// This API enables organization service access through the EnableAWSServiceAccess -// action and creates a service linked role AWSServiceRoleForConfigMultiAccountSetup -// in the master account of your organization. The service linked role is created -// only when the role does not exist in the master account. AWS Config verifies -// the existence of role with GetRole action. +// Creates a new configuration recorder to record the selected resource configurations. // -// You can use this action to create both custom AWS Config rules and AWS managed -// Config rules. If you are adding a new custom AWS Config rule, you must first -// create AWS Lambda function in the master account that the rule invokes to -// evaluate your resources. When you use the PutOrganizationConfigRule action -// to add the rule to AWS Config, you must specify the Amazon Resource Name -// (ARN) that AWS Lambda assigns to the function. If you are adding an AWS managed -// Config rule, specify the rule's identifier for the RuleIdentifier key. +// You can use this action to change the role roleARN or the recordingGroup +// of an existing recorder. To change the role, call the action on the existing +// configuration recorder and specify a role. // -// The maximum number of organization config rules that AWS Config supports -// is 150. +// Currently, you can specify only one configuration recorder per region in +// your account. // -// Specify either OrganizationCustomRuleMetadata or OrganizationManagedRuleMetadata. +// 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 PutOrganizationConfigRule for usage and error information. -// -// Returned Error Codes: -// * ErrCodeMaxNumberOfOrganizationConfigRulesExceededException "MaxNumberOfOrganizationConfigRulesExceededException" -// You have reached the limit of the number of organization config rules you -// can create. -// -// * ErrCodeResourceInUseException "ResourceInUseException" -// You see this exception in the following cases: -// -// * For DeleteConfigRule API, AWS Config is deleting this rule. Try your -// request again later. -// -// * For DeleteConfigRule API, the rule is deleting your evaluation results. -// Try your request again later. -// -// * For DeleteConfigRule API, a remediation action is associated with the -// rule and AWS Config cannot delete this rule. Delete the remediation action -// associated with the rule before deleting the rule and try your request -// again later. -// -// * For PutConfigOrganizationRule, organization config rule deletion is -// in progress. Try your request again later. -// -// * For DeleteOrganizationConfigRule, organization config rule creation -// is in progress. 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. -// -// * ErrCodeValidationException "ValidationException" -// The requested action is not valid. -// -// * ErrCodeOrganizationAccessDeniedException "OrganizationAccessDeniedException" -// For PutConfigAggregator API, no permission to call EnableAWSServiceAccess -// API. -// -// For all OrganizationConfigRule APIs, AWS Config throws an exception if APIs -// are called from member accounts. All APIs must be called from organization -// master account. -// -// * ErrCodeNoAvailableOrganizationException "NoAvailableOrganizationException" -// Organization is no longer available. -// -// * ErrCodeOrganizationAllFeaturesNotEnabledException "OrganizationAllFeaturesNotEnabledException" -// AWS Config resource cannot be created because your organization does not -// have all features enabled. +// API operation PutConfigurationRecorder for usage and error information. // -// * ErrCodeInsufficientPermissionsException "InsufficientPermissionsException" -// Indicates one of the following errors: +// Returned Error Types: +// * MaxNumberOfConfigurationRecordersExceededException +// You have reached the limit of the number of recorders you can create. // -// * For PutConfigRule, the rule cannot be created because the IAM role assigned -// to AWS Config lacks permissions to perform the config:Put* action. +// * InvalidConfigurationRecorderNameException +// You have provided a configuration recorder name that is not valid. // -// * For PutConfigRule, the AWS Lambda function cannot be invoked. Check -// the function ARN, and check the function's permissions. +// * InvalidRoleException +// You have provided a null or empty role ARN. // -// * For OrganizationConfigRule, organization config rule cannot be created -// because you do not have permissions to call IAM GetRole action or create -// service linked role. +// * InvalidRecordingGroupException +// AWS Config throws an exception if the recording group does not contain a +// valid list of resource types. Invalid values might also be incorrectly formatted. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutOrganizationConfigRule -func (c *ConfigService) PutOrganizationConfigRule(input *PutOrganizationConfigRuleInput) (*PutOrganizationConfigRuleOutput, error) { - req, out := c.PutOrganizationConfigRuleRequest(input) +// See also, 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) return out, req.Send() } -// PutOrganizationConfigRuleWithContext is the same as PutOrganizationConfigRule with the addition of +// PutConfigurationRecorderWithContext is the same as PutConfigurationRecorder with the addition of // the ability to pass a context and additional request options. // -// See PutOrganizationConfigRule for details on how to use this API operation. +// See PutConfigurationRecorder for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) PutOrganizationConfigRuleWithContext(ctx aws.Context, input *PutOrganizationConfigRuleInput, opts ...request.Option) (*PutOrganizationConfigRuleOutput, error) { - req, out := c.PutOrganizationConfigRuleRequest(input) +func (c *ConfigService) PutConfigurationRecorderWithContext(ctx aws.Context, input *PutConfigurationRecorderInput, opts ...request.Option) (*PutConfigurationRecorderOutput, error) { + req, out := c.PutConfigurationRecorderRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPutRemediationConfigurations = "PutRemediationConfigurations" +const opPutConformancePack = "PutConformancePack" -// PutRemediationConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the PutRemediationConfigurations operation. The "output" return +// PutConformancePackRequest generates a "aws/request.Request" representing the +// client's request for the PutConformancePack operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutRemediationConfigurations for more information on using the PutRemediationConfigurations +// See PutConformancePack for more information on using the PutConformancePack // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutRemediationConfigurationsRequest method. -// req, resp := client.PutRemediationConfigurationsRequest(params) +// // Example sending a request using the PutConformancePackRequest method. +// req, resp := client.PutConformancePackRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutRemediationConfigurations -func (c *ConfigService) PutRemediationConfigurationsRequest(input *PutRemediationConfigurationsInput) (req *request.Request, output *PutRemediationConfigurationsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConformancePack +func (c *ConfigService) PutConformancePackRequest(input *PutConformancePackInput) (req *request.Request, output *PutConformancePackOutput) { op := &request.Operation{ - Name: opPutRemediationConfigurations, + Name: opPutConformancePack, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PutRemediationConfigurationsInput{} + input = &PutConformancePackInput{} } - output = &PutRemediationConfigurationsOutput{} + output = &PutConformancePackOutput{} req = c.newRequest(op, input, output) return } -// PutRemediationConfigurations API operation for AWS Config. +// PutConformancePack API operation for AWS Config. // -// Adds or updates the remediation configuration with a specific AWS Config -// rule with the selected target or action. The API creates the RemediationConfiguration -// object for the AWS Config rule. The AWS Config rule must already exist for -// you to add a remediation configuration. The target (SSM document) must exist -// and have permissions to use the target. +// Creates or updates a conformance pack. A conformance pack is a collection +// of AWS Config rules that can be easily deployed in an account and a region +// and across AWS Organization. +// +// This API creates a service linked role AWSServiceRoleForConfigConforms in +// your account. The service linked role is created only when the role does +// not exist in your account. AWS Config verifies the existence of role with +// GetRole action. +// +// You must specify either the TemplateS3Uri or the TemplateBody parameter, +// but not both. If you provide both AWS Config uses the TemplateS3Uri parameter +// and ignores the TemplateBody 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 PutRemediationConfigurations for usage and error information. +// API operation PutConformancePack for usage and error information. // -// Returned Error Codes: -// * ErrCodeInsufficientPermissionsException "InsufficientPermissionsException" +// Returned Error Types: +// * InsufficientPermissionsException // Indicates one of the following errors: // // * For PutConfigRule, the rule cannot be created because the IAM role assigned @@ -5377,593 +6167,663 @@ func (c *ConfigService) PutRemediationConfigurationsRequest(input *PutRemediatio // * For PutConfigRule, the AWS Lambda function cannot be invoked. Check // the function ARN, and check the function's permissions. // -// * For OrganizationConfigRule, organization config rule cannot be created +// * For PutOrganizationConfigRule, organization config rule cannot be created // because you do not have permissions to call IAM GetRole action or create -// service linked role. +// a service linked role. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more of the specified parameters are invalid. Verify that your parameters +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack cannot be created because you do not have permissions: To call IAM +// GetRole action or create a service linked role. To read Amazon S3 bucket. +// +// * ConformancePackTemplateValidationException +// You have specified a template that is not valid or supported. +// +// * ResourceInUseException +// You see this exception in the following cases: +// +// * For DeleteConfigRule, AWS Config is deleting this rule. Try your request +// again later. +// +// * For DeleteConfigRule, the rule is deleting your evaluation results. +// Try your request again later. +// +// * For DeleteConfigRule, a remediation action is associated with the rule +// and AWS Config cannot delete this rule. Delete the remediation action +// associated with the rule before deleting the rule and try your request +// again later. +// +// * For PutConfigOrganizationRule, organization config rule deletion is +// in progress. Try your request again later. +// +// * For DeleteOrganizationConfigRule, organization config rule creation +// is in progress. Try your request again later. +// +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack creation, update, and deletion is in progress. Try your request again +// later. +// +// * For DeleteConformancePack, a conformance pack creation, update, and +// deletion is in progress. Try your request again later. +// +// * InvalidParameterValueException +// One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutRemediationConfigurations -func (c *ConfigService) PutRemediationConfigurations(input *PutRemediationConfigurationsInput) (*PutRemediationConfigurationsOutput, error) { - req, out := c.PutRemediationConfigurationsRequest(input) +// * MaxNumberOfConformancePacksExceededException +// You have reached the limit (6) of the number of conformance packs in an account +// (6 conformance pack with 25 AWS Config rules per pack). +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutConformancePack +func (c *ConfigService) PutConformancePack(input *PutConformancePackInput) (*PutConformancePackOutput, error) { + req, out := c.PutConformancePackRequest(input) return out, req.Send() } -// PutRemediationConfigurationsWithContext is the same as PutRemediationConfigurations with the addition of +// PutConformancePackWithContext is the same as PutConformancePack with the addition of // the ability to pass a context and additional request options. // -// See PutRemediationConfigurations for details on how to use this API operation. +// See PutConformancePack for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) PutRemediationConfigurationsWithContext(ctx aws.Context, input *PutRemediationConfigurationsInput, opts ...request.Option) (*PutRemediationConfigurationsOutput, error) { - req, out := c.PutRemediationConfigurationsRequest(input) +func (c *ConfigService) PutConformancePackWithContext(ctx aws.Context, input *PutConformancePackInput, opts ...request.Option) (*PutConformancePackOutput, error) { + req, out := c.PutConformancePackRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPutRemediationExceptions = "PutRemediationExceptions" +const opPutDeliveryChannel = "PutDeliveryChannel" -// PutRemediationExceptionsRequest generates a "aws/request.Request" representing the -// client's request for the PutRemediationExceptions operation. The "output" return +// PutDeliveryChannelRequest generates a "aws/request.Request" representing the +// client's request for the PutDeliveryChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutRemediationExceptions for more information on using the PutRemediationExceptions +// See PutDeliveryChannel for more information on using the PutDeliveryChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutRemediationExceptionsRequest method. -// req, resp := client.PutRemediationExceptionsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutRemediationExceptions -func (c *ConfigService) PutRemediationExceptionsRequest(input *PutRemediationExceptionsInput) (req *request.Request, output *PutRemediationExceptionsOutput) { +// See also, 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: opPutRemediationExceptions, + Name: opPutDeliveryChannel, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PutRemediationExceptionsInput{} + input = &PutDeliveryChannelInput{} } - output = &PutRemediationExceptionsOutput{} + output = &PutDeliveryChannelOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// PutRemediationExceptions API operation for AWS Config. +// PutDeliveryChannel API operation for AWS Config. // -// A remediation exception is when a specific resource is no longer considered -// for auto-remediation. This API adds a new exception or updates an exisiting -// exception for a specific resource with a specific AWS Config rule. +// 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 PutRemediationExceptions for usage and error information. +// API operation PutDeliveryChannel 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. +// Returned Error Types: +// * MaxNumberOfDeliveryChannelsExceededException +// You have reached the limit of the number of delivery channels you can create. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutRemediationExceptions -func (c *ConfigService) PutRemediationExceptions(input *PutRemediationExceptionsInput) (*PutRemediationExceptionsOutput, error) { - req, out := c.PutRemediationExceptionsRequest(input) +// * NoAvailableConfigurationRecorderException +// There are no configuration recorders available to provide the role needed +// to describe your resources. Create a configuration recorder. +// +// * InvalidDeliveryChannelNameException +// The specified delivery channel name is not valid. +// +// * NoSuchBucketException +// The specified Amazon S3 bucket does not exist. +// +// * InvalidS3KeyPrefixException +// The specified Amazon S3 key prefix is not valid. +// +// * InvalidSNSTopicARNException +// The specified Amazon SNS topic does not exist. +// +// * InsufficientDeliveryPolicyException +// Your Amazon S3 bucket policy does not permit AWS Config to write to it. +// +// See also, 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) return out, req.Send() } -// PutRemediationExceptionsWithContext is the same as PutRemediationExceptions with the addition of +// PutDeliveryChannelWithContext is the same as PutDeliveryChannel with the addition of // the ability to pass a context and additional request options. // -// See PutRemediationExceptions for details on how to use this API operation. +// See PutDeliveryChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) PutRemediationExceptionsWithContext(ctx aws.Context, input *PutRemediationExceptionsInput, opts ...request.Option) (*PutRemediationExceptionsOutput, error) { - req, out := c.PutRemediationExceptionsRequest(input) +func (c *ConfigService) PutDeliveryChannelWithContext(ctx aws.Context, input *PutDeliveryChannelInput, opts ...request.Option) (*PutDeliveryChannelOutput, error) { + req, out := c.PutDeliveryChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPutRetentionConfiguration = "PutRetentionConfiguration" +const opPutEvaluations = "PutEvaluations" -// PutRetentionConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutRetentionConfiguration operation. The "output" return +// PutEvaluationsRequest generates a "aws/request.Request" representing the +// client's request for the PutEvaluations operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutRetentionConfiguration for more information on using the PutRetentionConfiguration +// See PutEvaluations for more information on using the PutEvaluations // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutRetentionConfigurationRequest method. -// req, resp := client.PutRetentionConfigurationRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutRetentionConfiguration -func (c *ConfigService) PutRetentionConfigurationRequest(input *PutRetentionConfigurationInput) (req *request.Request, output *PutRetentionConfigurationOutput) { +// See also, 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: opPutRetentionConfiguration, + Name: opPutEvaluations, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PutRetentionConfigurationInput{} + input = &PutEvaluationsInput{} } - output = &PutRetentionConfigurationOutput{} + output = &PutEvaluationsOutput{} req = c.newRequest(op, input, output) return } -// PutRetentionConfiguration API operation for AWS Config. -// -// Creates and updates the retention configuration with details about retention -// period (number of days) that AWS Config stores your historical information. -// The API creates the RetentionConfiguration object and names the object as -// default. When you have a RetentionConfiguration object named default, calling -// the API modifies the default object. +// PutEvaluations API operation for AWS Config. // -// Currently, AWS Config supports only one retention configuration per region -// in your account. +// 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 PutRetentionConfiguration for usage and error information. +// API operation PutEvaluations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more of the specified parameters are invalid. Verify that your parameters // are valid and try again. // -// * ErrCodeMaxNumberOfRetentionConfigurationsExceededException "MaxNumberOfRetentionConfigurationsExceededException" -// Failed to add the retention configuration because a retention configuration -// with that name already exists. +// * InvalidResultTokenException +// The specified ResultToken is invalid. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutRetentionConfiguration -func (c *ConfigService) PutRetentionConfiguration(input *PutRetentionConfigurationInput) (*PutRetentionConfigurationOutput, error) { - req, out := c.PutRetentionConfigurationRequest(input) +// * NoSuchConfigRuleException +// One or more AWS Config rules in the request are invalid. Verify that the +// rule names are correct and try again. +// +// See also, 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) return out, req.Send() } -// PutRetentionConfigurationWithContext is the same as PutRetentionConfiguration with the addition of +// PutEvaluationsWithContext is the same as PutEvaluations with the addition of // the ability to pass a context and additional request options. // -// See PutRetentionConfiguration for details on how to use this API operation. +// See PutEvaluations for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) PutRetentionConfigurationWithContext(ctx aws.Context, input *PutRetentionConfigurationInput, opts ...request.Option) (*PutRetentionConfigurationOutput, error) { - req, out := c.PutRetentionConfigurationRequest(input) +func (c *ConfigService) PutEvaluationsWithContext(ctx aws.Context, input *PutEvaluationsInput, opts ...request.Option) (*PutEvaluationsOutput, error) { + req, out := c.PutEvaluationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opSelectResourceConfig = "SelectResourceConfig" +const opPutOrganizationConfigRule = "PutOrganizationConfigRule" -// SelectResourceConfigRequest generates a "aws/request.Request" representing the -// client's request for the SelectResourceConfig operation. The "output" return +// PutOrganizationConfigRuleRequest generates a "aws/request.Request" representing the +// client's request for the PutOrganizationConfigRule operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See SelectResourceConfig for more information on using the SelectResourceConfig +// See PutOrganizationConfigRule for more information on using the PutOrganizationConfigRule // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the SelectResourceConfigRequest method. -// req, resp := client.SelectResourceConfigRequest(params) +// // Example sending a request using the PutOrganizationConfigRuleRequest method. +// req, resp := client.PutOrganizationConfigRuleRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/SelectResourceConfig -func (c *ConfigService) SelectResourceConfigRequest(input *SelectResourceConfigInput) (req *request.Request, output *SelectResourceConfigOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutOrganizationConfigRule +func (c *ConfigService) PutOrganizationConfigRuleRequest(input *PutOrganizationConfigRuleInput) (req *request.Request, output *PutOrganizationConfigRuleOutput) { op := &request.Operation{ - Name: opSelectResourceConfig, + Name: opPutOrganizationConfigRule, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &SelectResourceConfigInput{} + input = &PutOrganizationConfigRuleInput{} } - output = &SelectResourceConfigOutput{} + output = &PutOrganizationConfigRuleOutput{} req = c.newRequest(op, input, output) return } -// SelectResourceConfig API operation for AWS Config. +// PutOrganizationConfigRule API operation for AWS Config. // -// Accepts a structured query language (SQL) SELECT command, performs the corresponding -// search, and returns resource configurations matching the properties. +// Adds or updates organization config rule for your entire organization evaluating +// whether your AWS resources comply with your desired configurations. Only +// a master account can create or update an organization config rule. // -// For more information about query components, see the Query Components (https://docs.aws.amazon.com/config/latest/developerguide/query-components.html) -// section in the AWS Config Developer Guide. +// This API enables organization service access through the EnableAWSServiceAccess +// action and creates a service linked role AWSServiceRoleForConfigMultiAccountSetup +// in the master account of your organization. The service linked role is created +// only when the role does not exist in the master account. AWS Config verifies +// the existence of role with GetRole action. +// +// You can use this action to create both custom AWS Config rules and AWS managed +// Config rules. If you are adding a new custom AWS Config rule, you must first +// create AWS Lambda function in the master account that the rule invokes to +// evaluate your resources. When you use the PutOrganizationConfigRule action +// to add the rule to AWS Config, you must specify the Amazon Resource Name +// (ARN) that AWS Lambda assigns to the function. If you are adding an AWS managed +// Config rule, specify the rule's identifier for the RuleIdentifier key. +// +// The maximum number of organization config rules that AWS Config supports +// is 150. +// +// Specify either OrganizationCustomRuleMetadata or OrganizationManagedRuleMetadata. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 SelectResourceConfig for usage and error information. +// API operation PutOrganizationConfigRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidExpressionException "InvalidExpressionException" -// The syntax of the query is incorrect. +// Returned Error Types: +// * MaxNumberOfOrganizationConfigRulesExceededException +// You have reached the limit of the number of organization config rules you +// can create. // -// * ErrCodeInvalidLimitException "InvalidLimitException" -// The specified limit is outside the allowable range. +// * ResourceInUseException +// You see this exception in the following cases: // -// * 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. +// * For DeleteConfigRule, AWS Config is deleting this rule. Try your request +// again later. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/SelectResourceConfig -func (c *ConfigService) SelectResourceConfig(input *SelectResourceConfigInput) (*SelectResourceConfigOutput, error) { - req, out := c.SelectResourceConfigRequest(input) - return out, req.Send() -} - -// SelectResourceConfigWithContext is the same as SelectResourceConfig with the addition of -// the ability to pass a context and additional request options. +// * For DeleteConfigRule, the rule is deleting your evaluation results. +// Try your request again later. // -// See SelectResourceConfig for details on how to use this API operation. +// * For DeleteConfigRule, a remediation action is associated with the rule +// and AWS Config cannot delete this rule. Delete the remediation action +// associated with the rule before deleting the rule and try your request +// again later. // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ConfigService) SelectResourceConfigWithContext(ctx aws.Context, input *SelectResourceConfigInput, opts ...request.Option) (*SelectResourceConfigOutput, error) { - req, out := c.SelectResourceConfigRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartConfigRulesEvaluation = "StartConfigRulesEvaluation" - -// StartConfigRulesEvaluationRequest generates a "aws/request.Request" representing the -// client's request for the StartConfigRulesEvaluation operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. +// * For PutConfigOrganizationRule, organization config rule deletion is +// in progress. Try your request again later. // -// 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. +// * For DeleteOrganizationConfigRule, organization config rule creation +// is in progress. Try your request again later. // -// See StartConfigRulesEvaluation for more information on using the StartConfigRulesEvaluation -// API call, and error handling. +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack creation, update, and deletion is in progress. Try your request again +// later. // -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the StartConfigRulesEvaluationRequest method. -// req, resp := client.StartConfigRulesEvaluationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, 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) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StartConfigRulesEvaluation API operation for AWS Config. -// -// Runs an on-demand evaluation for the specified AWS Config rules against the -// last known configuration state of the resources. Use StartConfigRulesEvaluation -// when you want to test that a rule 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 AWS Config rules per request. -// -// An existing StartConfigRulesEvaluation call for the specified rules must -// complete 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 rule, AWS Config evaluates your resources -// against the rule automatically. -// -// 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. +// * For DeleteConformancePack, a conformance pack creation, update, and +// deletion is in progress. Try your request again later. // -// See the AWS API reference guide for AWS Config's -// API operation StartConfigRulesEvaluation for usage and error information. +// * InvalidParameterValueException +// One or more of the specified parameters are invalid. Verify that your parameters +// are valid and try again. // -// 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. +// * ValidationException +// The requested action is not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" -// For StartConfigRulesEvaluation API, this exception is thrown if an evaluation -// is in progress or if you call the StartConfigRulesEvaluation API more than -// once per minute. +// * OrganizationAccessDeniedException +// For PutConfigAggregator API, no permission to call EnableAWSServiceAccess +// API. // -// For PutConfigurationAggregator API, this exception is thrown if the number -// of accounts and aggregators exceeds the limit. +// For all OrganizationConfigRule and OrganizationConformancePack APIs, AWS +// Config throws an exception if APIs are called from member accounts. All APIs +// must be called from organization master account. // -// * ErrCodeResourceInUseException "ResourceInUseException" -// You see this exception in the following cases: +// * NoAvailableOrganizationException +// Organization is no longer available. // -// * For DeleteConfigRule API, AWS Config is deleting this rule. Try your -// request again later. +// * OrganizationAllFeaturesNotEnabledException +// AWS Config resource cannot be created because your organization does not +// have all features enabled. // -// * For DeleteConfigRule API, the rule is deleting your evaluation results. -// Try your request again later. +// * InsufficientPermissionsException +// Indicates one of the following errors: // -// * For DeleteConfigRule API, a remediation action is associated with the -// rule and AWS Config cannot delete this rule. Delete the remediation action -// associated with the rule before deleting the rule and try your request -// again later. +// * For PutConfigRule, the rule cannot be created because the IAM role assigned +// to AWS Config lacks permissions to perform the config:Put* action. // -// * For PutConfigOrganizationRule, organization config rule deletion is -// in progress. Try your request again later. +// * For PutConfigRule, the AWS Lambda function cannot be invoked. Check +// the function ARN, and check the function's permissions. // -// * For DeleteOrganizationConfigRule, organization config rule creation -// is in progress. Try your request again later. +// * For PutOrganizationConfigRule, organization config rule cannot be created +// because you do not have permissions to call IAM GetRole action or create +// a service linked role. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more of the specified parameters are invalid. Verify that your parameters -// are valid and try again. +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack cannot be created because you do not have permissions: To call IAM +// GetRole action or create a service linked role. To read Amazon S3 bucket. // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutOrganizationConfigRule +func (c *ConfigService) PutOrganizationConfigRule(input *PutOrganizationConfigRuleInput) (*PutOrganizationConfigRuleOutput, error) { + req, out := c.PutOrganizationConfigRuleRequest(input) return out, req.Send() } -// StartConfigRulesEvaluationWithContext is the same as StartConfigRulesEvaluation with the addition of +// PutOrganizationConfigRuleWithContext is the same as PutOrganizationConfigRule with the addition of // the ability to pass a context and additional request options. // -// See StartConfigRulesEvaluation for details on how to use this API operation. +// See PutOrganizationConfigRule for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) StartConfigRulesEvaluationWithContext(ctx aws.Context, input *StartConfigRulesEvaluationInput, opts ...request.Option) (*StartConfigRulesEvaluationOutput, error) { - req, out := c.StartConfigRulesEvaluationRequest(input) +func (c *ConfigService) PutOrganizationConfigRuleWithContext(ctx aws.Context, input *PutOrganizationConfigRuleInput, opts ...request.Option) (*PutOrganizationConfigRuleOutput, error) { + req, out := c.PutOrganizationConfigRuleRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStartConfigurationRecorder = "StartConfigurationRecorder" +const opPutOrganizationConformancePack = "PutOrganizationConformancePack" -// StartConfigurationRecorderRequest generates a "aws/request.Request" representing the -// client's request for the StartConfigurationRecorder operation. The "output" return +// PutOrganizationConformancePackRequest generates a "aws/request.Request" representing the +// client's request for the PutOrganizationConformancePack operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StartConfigurationRecorder for more information on using the StartConfigurationRecorder +// See PutOrganizationConformancePack for more information on using the PutOrganizationConformancePack // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StartConfigurationRecorderRequest method. -// req, resp := client.StartConfigurationRecorderRequest(params) +// // Example sending a request using the PutOrganizationConformancePackRequest method. +// req, resp := client.PutOrganizationConformancePackRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StartConfigurationRecorder -func (c *ConfigService) StartConfigurationRecorderRequest(input *StartConfigurationRecorderInput) (req *request.Request, output *StartConfigurationRecorderOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutOrganizationConformancePack +func (c *ConfigService) PutOrganizationConformancePackRequest(input *PutOrganizationConformancePackInput) (req *request.Request, output *PutOrganizationConformancePackOutput) { op := &request.Operation{ - Name: opStartConfigurationRecorder, + Name: opPutOrganizationConformancePack, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StartConfigurationRecorderInput{} + input = &PutOrganizationConformancePackInput{} } - output = &StartConfigurationRecorderOutput{} + output = &PutOrganizationConformancePackOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// StartConfigurationRecorder API operation for AWS Config. +// PutOrganizationConformancePack API operation for AWS Config. // -// Starts recording configurations of the AWS resources you have selected to -// record in your AWS account. +// Deploys conformance packs across member accounts in an AWS Organization. // -// You must have created at least one delivery channel to successfully start -// the configuration recorder. +// This API enables organization service access for config-multiaccountsetup.amazonaws.com +// through the EnableAWSServiceAccess action and creates a service linked role +// AWSServiceRoleForConfigMultiAccountSetup in the master account of your organization. +// The service linked role is created only when the role does not exist in the +// master account. AWS Config verifies the existence of role with GetRole action. +// +// You must specify either the TemplateS3Uri or the TemplateBody parameter, +// but not both. If you provide both AWS Config uses the TemplateS3Uri parameter +// and ignores the TemplateBody parameter. +// +// AWS Config sets the state of a conformance pack to CREATE_IN_PROGRESS and +// UPDATE_IN_PROGRESS until the confomance pack is created or updated. You cannot +// update a conformance pack while it is in this state. +// +// You can create 6 conformance packs with 25 AWS Config rules in each pack. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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. +// API operation PutOrganizationConformancePack for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchConfigurationRecorderException "NoSuchConfigurationRecorderException" -// You have specified a configuration recorder that does not exist. +// Returned Error Types: +// * MaxNumberOfOrganizationConformancePacksExceededException +// You have reached the limit (6) of the number of organization conformance +// packs in an account (6 conformance pack with 25 AWS Config rules per pack +// per account). // -// * ErrCodeNoAvailableDeliveryChannelException "NoAvailableDeliveryChannelException" -// There is no delivery channel available to record configurations. +// * ResourceInUseException +// You see this exception in the following cases: // -// See also, 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) +// * For DeleteConfigRule, AWS Config is deleting this rule. Try your request +// again later. +// +// * For DeleteConfigRule, the rule is deleting your evaluation results. +// Try your request again later. +// +// * For DeleteConfigRule, a remediation action is associated with the rule +// and AWS Config cannot delete this rule. Delete the remediation action +// associated with the rule before deleting the rule and try your request +// again later. +// +// * For PutConfigOrganizationRule, organization config rule deletion is +// in progress. Try your request again later. +// +// * For DeleteOrganizationConfigRule, organization config rule creation +// is in progress. Try your request again later. +// +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack creation, update, and deletion is in progress. Try your request again +// later. +// +// * For DeleteConformancePack, a conformance pack creation, update, and +// deletion is in progress. Try your request again later. +// +// * ValidationException +// The requested action is not valid. +// +// * OrganizationAccessDeniedException +// For PutConfigAggregator API, no permission to call EnableAWSServiceAccess +// API. +// +// For all OrganizationConfigRule and OrganizationConformancePack APIs, AWS +// Config throws an exception if APIs are called from member accounts. All APIs +// must be called from organization master account. +// +// * InsufficientPermissionsException +// Indicates one of the following errors: +// +// * For PutConfigRule, the rule cannot be created because the IAM role assigned +// to AWS Config lacks permissions to perform the config:Put* action. +// +// * For PutConfigRule, the AWS Lambda function cannot be invoked. Check +// the function ARN, and check the function's permissions. +// +// * For PutOrganizationConfigRule, organization config rule cannot be created +// because you do not have permissions to call IAM GetRole action or create +// a service linked role. +// +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack cannot be created because you do not have permissions: To call IAM +// GetRole action or create a service linked role. To read Amazon S3 bucket. +// +// * OrganizationConformancePackTemplateValidationException +// You have specified a template that is not valid or supported. +// +// * OrganizationAllFeaturesNotEnabledException +// AWS Config resource cannot be created because your organization does not +// have all features enabled. +// +// * NoAvailableOrganizationException +// Organization is no longer available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutOrganizationConformancePack +func (c *ConfigService) PutOrganizationConformancePack(input *PutOrganizationConformancePackInput) (*PutOrganizationConformancePackOutput, error) { + req, out := c.PutOrganizationConformancePackRequest(input) return out, req.Send() } -// StartConfigurationRecorderWithContext is the same as StartConfigurationRecorder with the addition of +// PutOrganizationConformancePackWithContext is the same as PutOrganizationConformancePack with the addition of // the ability to pass a context and additional request options. // -// See StartConfigurationRecorder for details on how to use this API operation. +// See PutOrganizationConformancePack for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) StartConfigurationRecorderWithContext(ctx aws.Context, input *StartConfigurationRecorderInput, opts ...request.Option) (*StartConfigurationRecorderOutput, error) { - req, out := c.StartConfigurationRecorderRequest(input) +func (c *ConfigService) PutOrganizationConformancePackWithContext(ctx aws.Context, input *PutOrganizationConformancePackInput, opts ...request.Option) (*PutOrganizationConformancePackOutput, error) { + req, out := c.PutOrganizationConformancePackRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStartRemediationExecution = "StartRemediationExecution" +const opPutRemediationConfigurations = "PutRemediationConfigurations" -// StartRemediationExecutionRequest generates a "aws/request.Request" representing the -// client's request for the StartRemediationExecution operation. The "output" return +// PutRemediationConfigurationsRequest generates a "aws/request.Request" representing the +// client's request for the PutRemediationConfigurations operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StartRemediationExecution for more information on using the StartRemediationExecution +// See PutRemediationConfigurations for more information on using the PutRemediationConfigurations // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StartRemediationExecutionRequest method. -// req, resp := client.StartRemediationExecutionRequest(params) +// // Example sending a request using the PutRemediationConfigurationsRequest method. +// req, resp := client.PutRemediationConfigurationsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StartRemediationExecution -func (c *ConfigService) StartRemediationExecutionRequest(input *StartRemediationExecutionInput) (req *request.Request, output *StartRemediationExecutionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutRemediationConfigurations +func (c *ConfigService) PutRemediationConfigurationsRequest(input *PutRemediationConfigurationsInput) (req *request.Request, output *PutRemediationConfigurationsOutput) { op := &request.Operation{ - Name: opStartRemediationExecution, + Name: opPutRemediationConfigurations, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StartRemediationExecutionInput{} + input = &PutRemediationConfigurationsInput{} } - output = &StartRemediationExecutionOutput{} + output = &PutRemediationConfigurationsOutput{} req = c.newRequest(op, input, output) return } -// StartRemediationExecution API operation for AWS Config. -// -// Runs an on-demand remediation for the specified AWS Config rules against -// the last known remediation configuration. It runs an execution against the -// current state of your resources. Remediation execution is asynchronous. +// PutRemediationConfigurations API operation for AWS Config. // -// You can specify up to 100 resource keys per request. An existing StartRemediationExecution -// call for the specified resource keys must complete before you can call the -// API again. +// Adds or updates the remediation configuration with a specific AWS Config +// rule with the selected target or action. The API creates the RemediationConfiguration +// object for the AWS Config rule. The AWS Config rule must already exist for +// you to add a remediation configuration. The target (SSM document) must exist +// and have permissions to use the 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 AWS Config's -// API operation StartRemediationExecution 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. +// API operation PutRemediationConfigurations for usage and error information. // -// * ErrCodeInsufficientPermissionsException "InsufficientPermissionsException" +// Returned Error Types: +// * InsufficientPermissionsException // Indicates one of the following errors: // // * For PutConfigRule, the rule cannot be created because the IAM role assigned @@ -5972,332 +6832,1210 @@ func (c *ConfigService) StartRemediationExecutionRequest(input *StartRemediation // * For PutConfigRule, the AWS Lambda function cannot be invoked. Check // the function ARN, and check the function's permissions. // -// * For OrganizationConfigRule, organization config rule cannot be created +// * For PutOrganizationConfigRule, organization config rule cannot be created // because you do not have permissions to call IAM GetRole action or create -// service linked role. +// a service linked role. // -// * ErrCodeNoSuchRemediationConfigurationException "NoSuchRemediationConfigurationException" -// You specified an AWS Config rule without a remediation configuration. +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack cannot be created because you do not have permissions: To call IAM +// GetRole action or create a service linked role. To read Amazon S3 bucket. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StartRemediationExecution -func (c *ConfigService) StartRemediationExecution(input *StartRemediationExecutionInput) (*StartRemediationExecutionOutput, error) { - req, out := c.StartRemediationExecutionRequest(input) +// * InvalidParameterValueException +// One or more of the specified parameters are invalid. Verify that your parameters +// are valid and try again. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutRemediationConfigurations +func (c *ConfigService) PutRemediationConfigurations(input *PutRemediationConfigurationsInput) (*PutRemediationConfigurationsOutput, error) { + req, out := c.PutRemediationConfigurationsRequest(input) return out, req.Send() } -// StartRemediationExecutionWithContext is the same as StartRemediationExecution with the addition of +// PutRemediationConfigurationsWithContext is the same as PutRemediationConfigurations with the addition of // the ability to pass a context and additional request options. // -// See StartRemediationExecution for details on how to use this API operation. +// See PutRemediationConfigurations for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) StartRemediationExecutionWithContext(ctx aws.Context, input *StartRemediationExecutionInput, opts ...request.Option) (*StartRemediationExecutionOutput, error) { - req, out := c.StartRemediationExecutionRequest(input) +func (c *ConfigService) PutRemediationConfigurationsWithContext(ctx aws.Context, input *PutRemediationConfigurationsInput, opts ...request.Option) (*PutRemediationConfigurationsOutput, error) { + req, out := c.PutRemediationConfigurationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopConfigurationRecorder = "StopConfigurationRecorder" +const opPutRemediationExceptions = "PutRemediationExceptions" -// StopConfigurationRecorderRequest generates a "aws/request.Request" representing the -// client's request for the StopConfigurationRecorder operation. The "output" return +// PutRemediationExceptionsRequest generates a "aws/request.Request" representing the +// client's request for the PutRemediationExceptions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopConfigurationRecorder for more information on using the StopConfigurationRecorder +// See PutRemediationExceptions for more information on using the PutRemediationExceptions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopConfigurationRecorderRequest method. -// req, resp := client.StopConfigurationRecorderRequest(params) +// // Example sending a request using the PutRemediationExceptionsRequest method. +// req, resp := client.PutRemediationExceptionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StopConfigurationRecorder -func (c *ConfigService) StopConfigurationRecorderRequest(input *StopConfigurationRecorderInput) (req *request.Request, output *StopConfigurationRecorderOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutRemediationExceptions +func (c *ConfigService) PutRemediationExceptionsRequest(input *PutRemediationExceptionsInput) (req *request.Request, output *PutRemediationExceptionsOutput) { op := &request.Operation{ - Name: opStopConfigurationRecorder, + Name: opPutRemediationExceptions, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StopConfigurationRecorderInput{} + input = &PutRemediationExceptionsInput{} } - output = &StopConfigurationRecorderOutput{} + output = &PutRemediationExceptionsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// StopConfigurationRecorder API operation for AWS Config. +// PutRemediationExceptions API operation for AWS Config. // -// Stops recording configurations of the AWS resources you have selected to -// record in your AWS account. +// A remediation exception is when a specific resource is no longer considered +// for auto-remediation. This API adds a new exception or updates an exisiting +// exception for a specific resource with a specific 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 StopConfigurationRecorder for usage and error information. +// API operation PutRemediationExceptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeNoSuchConfigurationRecorderException "NoSuchConfigurationRecorderException" -// You have specified a configuration recorder that does not exist. +// Returned Error Types: +// * InvalidParameterValueException +// One or more of the specified parameters are invalid. Verify that your parameters +// are valid and try again. // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutRemediationExceptions +func (c *ConfigService) PutRemediationExceptions(input *PutRemediationExceptionsInput) (*PutRemediationExceptionsOutput, error) { + req, out := c.PutRemediationExceptionsRequest(input) return out, req.Send() } -// StopConfigurationRecorderWithContext is the same as StopConfigurationRecorder with the addition of +// PutRemediationExceptionsWithContext is the same as PutRemediationExceptions with the addition of // the ability to pass a context and additional request options. // -// See StopConfigurationRecorder for details on how to use this API operation. +// See PutRemediationExceptions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) StopConfigurationRecorderWithContext(ctx aws.Context, input *StopConfigurationRecorderInput, opts ...request.Option) (*StopConfigurationRecorderOutput, error) { - req, out := c.StopConfigurationRecorderRequest(input) +func (c *ConfigService) PutRemediationExceptionsWithContext(ctx aws.Context, input *PutRemediationExceptionsInput, opts ...request.Option) (*PutRemediationExceptionsOutput, error) { + req, out := c.PutRemediationExceptionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opTagResource = "TagResource" +const opPutResourceConfig = "PutResourceConfig" -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource operation. The "output" return +// PutResourceConfigRequest generates a "aws/request.Request" representing the +// client's request for the PutResourceConfig operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See TagResource for more information on using the TagResource +// See PutResourceConfig for more information on using the PutResourceConfig // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) +// // Example sending a request using the PutResourceConfigRequest method. +// req, resp := client.PutResourceConfigRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/TagResource -func (c *ConfigService) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutResourceConfig +func (c *ConfigService) PutResourceConfigRequest(input *PutResourceConfigInput) (req *request.Request, output *PutResourceConfigOutput) { op := &request.Operation{ - Name: opTagResource, + Name: opPutResourceConfig, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &TagResourceInput{} + input = &PutResourceConfigInput{} } - output = &TagResourceOutput{} + output = &PutResourceConfigOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// TagResource API operation for AWS Config. +// PutResourceConfig API operation for AWS Config. // -// Associates the specified tags to a resource with the specified resourceArn. -// If existing tags on a resource are not specified in the request parameters, -// they are not changed. When a resource is deleted, the tags associated with -// that resource are deleted as well. +// Records the configuration state for the resource provided in the request. +// The configuration state of a resource is represented in AWS Config as Configuration +// Items. Once this API records the configuration item, you can retrieve the +// list of configuration items for the custom resource type using existing AWS +// Config APIs. +// +// The custom resource type must be registered with AWS CloudFormation. This +// API accepts the configuration item registered with AWS CloudFormation. +// +// When you call this API, AWS Config only stores configuration state of the +// resource provided in the request. This API does not change or remediate the +// configuration of the 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 Config's -// API operation TagResource for usage and error information. +// API operation PutResourceConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // The requested action is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// You have specified a resource that does not exist. +// * InsufficientPermissionsException +// Indicates one of the following errors: // -// * ErrCodeTooManyTagsException "TooManyTagsException" -// You have reached the limit of the number of tags you can use. You have more -// than 50 tags. +// * For PutConfigRule, the rule cannot be created because the IAM role assigned +// to AWS Config lacks permissions to perform the config:Put* action. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/TagResource -func (c *ConfigService) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) +// * For PutConfigRule, the AWS Lambda function cannot be invoked. Check +// the function ARN, and check the function's permissions. +// +// * For PutOrganizationConfigRule, organization config rule cannot be created +// because you do not have permissions to call IAM GetRole action or create +// a service linked role. +// +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack cannot be created because you do not have permissions: To call IAM +// GetRole action or create a service linked role. To read Amazon S3 bucket. +// +// * NoRunningConfigurationRecorderException +// There is no configuration recorder running. +// +// * MaxActiveResourcesExceededException +// You have reached the limit (100,000) of active custom resource types in your +// account. Delete unused resources using DeleteResourceConfig. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutResourceConfig +func (c *ConfigService) PutResourceConfig(input *PutResourceConfigInput) (*PutResourceConfigOutput, error) { + req, out := c.PutResourceConfigRequest(input) return out, req.Send() } -// TagResourceWithContext is the same as TagResource with the addition of +// PutResourceConfigWithContext is the same as PutResourceConfig with the addition of // the ability to pass a context and additional request options. // -// See TagResource for details on how to use this API operation. +// See PutResourceConfig for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) +func (c *ConfigService) PutResourceConfigWithContext(ctx aws.Context, input *PutResourceConfigInput, opts ...request.Option) (*PutResourceConfigOutput, error) { + req, out := c.PutResourceConfigRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUntagResource = "UntagResource" +const opPutRetentionConfiguration = "PutRetentionConfiguration" -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource operation. The "output" return +// PutRetentionConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the PutRetentionConfiguration operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UntagResource for more information on using the UntagResource +// See PutRetentionConfiguration for more information on using the PutRetentionConfiguration // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) +// // Example sending a request using the PutRetentionConfigurationRequest method. +// req, resp := client.PutRetentionConfigurationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/UntagResource -func (c *ConfigService) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutRetentionConfiguration +func (c *ConfigService) PutRetentionConfigurationRequest(input *PutRetentionConfigurationInput) (req *request.Request, output *PutRetentionConfigurationOutput) { op := &request.Operation{ - Name: opUntagResource, + Name: opPutRetentionConfiguration, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UntagResourceInput{} + input = &PutRetentionConfigurationInput{} } - output = &UntagResourceOutput{} + output = &PutRetentionConfigurationOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UntagResource API operation for AWS Config. +// PutRetentionConfiguration API operation for AWS Config. // -// Deletes specified tags from a resource. +// Creates and updates the retention configuration with details about retention +// period (number of days) that AWS Config stores your historical information. +// The API creates the RetentionConfiguration object and names the object as +// default. When you have a RetentionConfiguration object named default, calling +// the API modifies the default object. +// +// Currently, AWS Config supports only one retention configuration 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 UntagResource for usage and error information. +// API operation PutRetentionConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" -// The requested action is not valid. +// Returned Error Types: +// * InvalidParameterValueException +// One or more of the specified parameters are invalid. Verify that your parameters +// are valid and try again. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// You have specified a resource that does not exist. +// * MaxNumberOfRetentionConfigurationsExceededException +// Failed to add the retention configuration because a retention configuration +// with that name already exists. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/UntagResource -func (c *ConfigService) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/PutRetentionConfiguration +func (c *ConfigService) PutRetentionConfiguration(input *PutRetentionConfigurationInput) (*PutRetentionConfigurationOutput, error) { + req, out := c.PutRetentionConfigurationRequest(input) return out, req.Send() } -// UntagResourceWithContext is the same as UntagResource with the addition of +// PutRetentionConfigurationWithContext is the same as PutRetentionConfiguration with the addition of // the ability to pass a context and additional request options. // -// See UntagResource for details on how to use this API operation. +// See PutRetentionConfiguration for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *ConfigService) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) +func (c *ConfigService) PutRetentionConfigurationWithContext(ctx aws.Context, input *PutRetentionConfigurationInput, opts ...request.Option) (*PutRetentionConfigurationOutput, error) { + req, out := c.PutRetentionConfigurationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// A collection of accounts and regions. -type AccountAggregationSource struct { - _ struct{} `type:"structure"` +const opSelectAggregateResourceConfig = "SelectAggregateResourceConfig" - // The 12-digit account ID of the account being aggregated. - // - // AccountIds is a required field - AccountIds []*string `min:"1" type:"list" required:"true"` +// SelectAggregateResourceConfigRequest generates a "aws/request.Request" representing the +// client's request for the SelectAggregateResourceConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SelectAggregateResourceConfig for more information on using the SelectAggregateResourceConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SelectAggregateResourceConfigRequest method. +// req, resp := client.SelectAggregateResourceConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/SelectAggregateResourceConfig +func (c *ConfigService) SelectAggregateResourceConfigRequest(input *SelectAggregateResourceConfigInput) (req *request.Request, output *SelectAggregateResourceConfigOutput) { + op := &request.Operation{ + Name: opSelectAggregateResourceConfig, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } - // If true, aggregate existing AWS Config regions and future regions. - AllAwsRegions *bool `type:"boolean"` + if input == nil { + input = &SelectAggregateResourceConfigInput{} + } - // The source regions being aggregated. - AwsRegions []*string `min:"1" type:"list"` + output = &SelectAggregateResourceConfigOutput{} + req = c.newRequest(op, input, output) + return } -// String returns the string representation -func (s AccountAggregationSource) String() string { - return awsutil.Prettify(s) +// SelectAggregateResourceConfig API operation for AWS Config. +// +// Accepts a structured query language (SQL) SELECT command and an aggregator +// to query configuration state of AWS resources across multiple accounts and +// regions, performs the corresponding search, and returns resource configurations +// matching the properties. +// +// For more information about query components, see the Query Components (https://docs.aws.amazon.com/config/latest/developerguide/query-components.html) +// section 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 SelectAggregateResourceConfig for usage and error information. +// +// Returned Error Types: +// * InvalidExpressionException +// The syntax of the query is incorrect. +// +// * NoSuchConfigurationAggregatorException +// You have specified a configuration aggregator that does not exist. +// +// * InvalidLimitException +// The specified limit is outside the allowable range. +// +// * 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. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/SelectAggregateResourceConfig +func (c *ConfigService) SelectAggregateResourceConfig(input *SelectAggregateResourceConfigInput) (*SelectAggregateResourceConfigOutput, error) { + req, out := c.SelectAggregateResourceConfigRequest(input) + return out, req.Send() } -// GoString returns the string representation -func (s AccountAggregationSource) GoString() string { - return s.String() +// SelectAggregateResourceConfigWithContext is the same as SelectAggregateResourceConfig with the addition of +// the ability to pass a context and additional request options. +// +// See SelectAggregateResourceConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) SelectAggregateResourceConfigWithContext(ctx aws.Context, input *SelectAggregateResourceConfigInput, opts ...request.Option) (*SelectAggregateResourceConfigOutput, error) { + req, out := c.SelectAggregateResourceConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AccountAggregationSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AccountAggregationSource"} - if s.AccountIds == nil { - invalidParams.Add(request.NewErrParamRequired("AccountIds")) - } - if s.AccountIds != nil && len(s.AccountIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AccountIds", 1)) - } - if s.AwsRegions != nil && len(s.AwsRegions) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AwsRegions", 1)) +// SelectAggregateResourceConfigPages iterates over the pages of a SelectAggregateResourceConfig operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See SelectAggregateResourceConfig 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 SelectAggregateResourceConfig operation. +// pageNum := 0 +// err := client.SelectAggregateResourceConfigPages(params, +// func(page *configservice.SelectAggregateResourceConfigOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *ConfigService) SelectAggregateResourceConfigPages(input *SelectAggregateResourceConfigInput, fn func(*SelectAggregateResourceConfigOutput, bool) bool) error { + return c.SelectAggregateResourceConfigPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// SelectAggregateResourceConfigPagesWithContext same as SelectAggregateResourceConfigPages 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 *ConfigService) SelectAggregateResourceConfigPagesWithContext(ctx aws.Context, input *SelectAggregateResourceConfigInput, fn func(*SelectAggregateResourceConfigOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *SelectAggregateResourceConfigInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.SelectAggregateResourceConfigRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } - if invalidParams.Len() > 0 { - return invalidParams + for p.Next() { + if !fn(p.Page().(*SelectAggregateResourceConfigOutput), !p.HasNextPage()) { + break + } } - return nil + + return p.Err() +} + +const opSelectResourceConfig = "SelectResourceConfig" + +// SelectResourceConfigRequest generates a "aws/request.Request" representing the +// client's request for the SelectResourceConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SelectResourceConfig for more information on using the SelectResourceConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SelectResourceConfigRequest method. +// req, resp := client.SelectResourceConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/SelectResourceConfig +func (c *ConfigService) SelectResourceConfigRequest(input *SelectResourceConfigInput) (req *request.Request, output *SelectResourceConfigOutput) { + op := &request.Operation{ + Name: opSelectResourceConfig, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SelectResourceConfigInput{} + } + + output = &SelectResourceConfigOutput{} + req = c.newRequest(op, input, output) + return +} + +// SelectResourceConfig API operation for AWS Config. +// +// Accepts a structured query language (SQL) SELECT command, performs the corresponding +// search, and returns resource configurations matching the properties. +// +// For more information about query components, see the Query Components (https://docs.aws.amazon.com/config/latest/developerguide/query-components.html) +// section 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 SelectResourceConfig for usage and error information. +// +// Returned Error Types: +// * InvalidExpressionException +// The syntax of the query is incorrect. +// +// * InvalidLimitException +// The specified limit is outside the allowable range. +// +// * 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. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/SelectResourceConfig +func (c *ConfigService) SelectResourceConfig(input *SelectResourceConfigInput) (*SelectResourceConfigOutput, error) { + req, out := c.SelectResourceConfigRequest(input) + return out, req.Send() +} + +// SelectResourceConfigWithContext is the same as SelectResourceConfig with the addition of +// the ability to pass a context and additional request options. +// +// See SelectResourceConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) SelectResourceConfigWithContext(ctx aws.Context, input *SelectResourceConfigInput, opts ...request.Option) (*SelectResourceConfigOutput, error) { + req, out := c.SelectResourceConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartConfigRulesEvaluation = "StartConfigRulesEvaluation" + +// StartConfigRulesEvaluationRequest generates a "aws/request.Request" representing the +// client's request for the StartConfigRulesEvaluation operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartConfigRulesEvaluation for more information on using the StartConfigRulesEvaluation +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartConfigRulesEvaluationRequest method. +// req, resp := client.StartConfigRulesEvaluationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StartConfigRulesEvaluation API operation for AWS Config. +// +// Runs an on-demand evaluation for the specified AWS Config rules against the +// last known configuration state of the resources. Use StartConfigRulesEvaluation +// when you want to test that a rule 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 AWS Config rules per request. +// +// An existing StartConfigRulesEvaluation call for the specified rules must +// complete 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 rule, AWS Config evaluates your resources +// against the rule automatically. +// +// 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 Types: +// * NoSuchConfigRuleException +// One or more AWS Config rules in the request are invalid. Verify that the +// rule names are correct and try again. +// +// * LimitExceededException +// For StartConfigRulesEvaluation API, this exception is thrown if an evaluation +// is in progress or if you call the StartConfigRulesEvaluation API more than +// once per minute. +// +// For PutConfigurationAggregator API, this exception is thrown if the number +// of accounts and aggregators exceeds the limit. +// +// * ResourceInUseException +// You see this exception in the following cases: +// +// * For DeleteConfigRule, AWS Config is deleting this rule. Try your request +// again later. +// +// * For DeleteConfigRule, the rule is deleting your evaluation results. +// Try your request again later. +// +// * For DeleteConfigRule, a remediation action is associated with the rule +// and AWS Config cannot delete this rule. Delete the remediation action +// associated with the rule before deleting the rule and try your request +// again later. +// +// * For PutConfigOrganizationRule, organization config rule deletion is +// in progress. Try your request again later. +// +// * For DeleteOrganizationConfigRule, organization config rule creation +// is in progress. Try your request again later. +// +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack creation, update, and deletion is in progress. Try your request again +// later. +// +// * For DeleteConformancePack, a conformance pack creation, update, and +// deletion is in progress. Try your request again later. +// +// * InvalidParameterValueException +// One or more of the specified parameters are invalid. Verify that your parameters +// are valid and try again. +// +// See also, 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) + return out, req.Send() +} + +// StartConfigRulesEvaluationWithContext is the same as StartConfigRulesEvaluation with the addition of +// the ability to pass a context and additional request options. +// +// See StartConfigRulesEvaluation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) StartConfigRulesEvaluationWithContext(ctx aws.Context, input *StartConfigRulesEvaluationInput, opts ...request.Option) (*StartConfigRulesEvaluationOutput, error) { + req, out := c.StartConfigRulesEvaluationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartConfigurationRecorder = "StartConfigurationRecorder" + +// StartConfigurationRecorderRequest generates a "aws/request.Request" representing the +// client's request for the StartConfigurationRecorder operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartConfigurationRecorder for more information on using the StartConfigurationRecorder +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartConfigurationRecorderRequest method. +// req, resp := client.StartConfigurationRecorderRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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.Swap(jsonrpc.UnmarshalHandler.Name, 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 Types: +// * NoSuchConfigurationRecorderException +// You have specified a configuration recorder that does not exist. +// +// * NoAvailableDeliveryChannelException +// There is no delivery channel available to record configurations. +// +// See also, 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) + return out, req.Send() +} + +// StartConfigurationRecorderWithContext is the same as StartConfigurationRecorder with the addition of +// the ability to pass a context and additional request options. +// +// See StartConfigurationRecorder for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) StartConfigurationRecorderWithContext(ctx aws.Context, input *StartConfigurationRecorderInput, opts ...request.Option) (*StartConfigurationRecorderOutput, error) { + req, out := c.StartConfigurationRecorderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartRemediationExecution = "StartRemediationExecution" + +// StartRemediationExecutionRequest generates a "aws/request.Request" representing the +// client's request for the StartRemediationExecution operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartRemediationExecution for more information on using the StartRemediationExecution +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartRemediationExecutionRequest method. +// req, resp := client.StartRemediationExecutionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StartRemediationExecution +func (c *ConfigService) StartRemediationExecutionRequest(input *StartRemediationExecutionInput) (req *request.Request, output *StartRemediationExecutionOutput) { + op := &request.Operation{ + Name: opStartRemediationExecution, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StartRemediationExecutionInput{} + } + + output = &StartRemediationExecutionOutput{} + req = c.newRequest(op, input, output) + return +} + +// StartRemediationExecution API operation for AWS Config. +// +// Runs an on-demand remediation for the specified AWS Config rules against +// the last known remediation configuration. It runs an execution against the +// current state of your resources. Remediation execution is asynchronous. +// +// You can specify up to 100 resource keys per request. An existing StartRemediationExecution +// call for the specified resource keys must complete before you can call the +// API 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 AWS Config's +// API operation StartRemediationExecution for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValueException +// One or more of the specified parameters are invalid. Verify that your parameters +// are valid and try again. +// +// * InsufficientPermissionsException +// Indicates one of the following errors: +// +// * For PutConfigRule, the rule cannot be created because the IAM role assigned +// to AWS Config lacks permissions to perform the config:Put* action. +// +// * For PutConfigRule, the AWS Lambda function cannot be invoked. Check +// the function ARN, and check the function's permissions. +// +// * For PutOrganizationConfigRule, organization config rule cannot be created +// because you do not have permissions to call IAM GetRole action or create +// a service linked role. +// +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack cannot be created because you do not have permissions: To call IAM +// GetRole action or create a service linked role. To read Amazon S3 bucket. +// +// * NoSuchRemediationConfigurationException +// You specified an AWS Config rule without a remediation configuration. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/StartRemediationExecution +func (c *ConfigService) StartRemediationExecution(input *StartRemediationExecutionInput) (*StartRemediationExecutionOutput, error) { + req, out := c.StartRemediationExecutionRequest(input) + return out, req.Send() +} + +// StartRemediationExecutionWithContext is the same as StartRemediationExecution with the addition of +// the ability to pass a context and additional request options. +// +// See StartRemediationExecution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) StartRemediationExecutionWithContext(ctx aws.Context, input *StartRemediationExecutionInput, opts ...request.Option) (*StartRemediationExecutionOutput, error) { + req, out := c.StartRemediationExecutionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopConfigurationRecorder = "StopConfigurationRecorder" + +// StopConfigurationRecorderRequest generates a "aws/request.Request" representing the +// client's request for the StopConfigurationRecorder operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopConfigurationRecorder for more information on using the StopConfigurationRecorder +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopConfigurationRecorderRequest method. +// req, resp := client.StopConfigurationRecorderRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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.Swap(jsonrpc.UnmarshalHandler.Name, 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 Types: +// * NoSuchConfigurationRecorderException +// You have specified a configuration recorder that does not exist. +// +// See also, 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) + return out, req.Send() +} + +// StopConfigurationRecorderWithContext is the same as StopConfigurationRecorder with the addition of +// the ability to pass a context and additional request options. +// +// See StopConfigurationRecorder for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) StopConfigurationRecorderWithContext(ctx aws.Context, input *StopConfigurationRecorderInput, opts ...request.Option) (*StopConfigurationRecorderOutput, error) { + req, out := c.StopConfigurationRecorderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/TagResource +func (c *ConfigService) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for AWS Config. +// +// Associates the specified tags to a resource with the specified resourceArn. +// If existing tags on a resource are not specified in the request parameters, +// they are not changed. When a resource is deleted, the tags associated with +// that resource are deleted as well. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 TagResource for usage and error information. +// +// Returned Error Types: +// * ValidationException +// The requested action is not valid. +// +// * ResourceNotFoundException +// You have specified a resource that does not exist. +// +// * TooManyTagsException +// You have reached the limit of the number of tags you can use. You have more +// than 50 tags. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/TagResource +func (c *ConfigService) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/UntagResource +func (c *ConfigService) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for AWS Config. +// +// Deletes specified tags from 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 AWS Config's +// API operation UntagResource for usage and error information. +// +// Returned Error Types: +// * ValidationException +// The requested action is not valid. +// +// * ResourceNotFoundException +// You have specified a resource that does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/config-2014-11-12/UntagResource +func (c *ConfigService) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ConfigService) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// A collection of accounts and regions. +type AccountAggregationSource struct { + _ struct{} `type:"structure"` + + // The 12-digit account ID of the account being aggregated. + // + // AccountIds is a required field + AccountIds []*string `min:"1" type:"list" required:"true"` + + // If true, aggregate existing AWS Config regions and future regions. + AllAwsRegions *bool `type:"boolean"` + + // The source regions being aggregated. + AwsRegions []*string `min:"1" type:"list"` +} + +// String returns the string representation +func (s AccountAggregationSource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountAggregationSource) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AccountAggregationSource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AccountAggregationSource"} + if s.AccountIds == nil { + invalidParams.Add(request.NewErrParamRequired("AccountIds")) + } + if s.AccountIds != nil && len(s.AccountIds) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AccountIds", 1)) + } + if s.AwsRegions != nil && len(s.AwsRegions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AwsRegions", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } // SetAccountIds sets the AccountIds field's value. @@ -6306,253 +8044,3107 @@ func (s *AccountAggregationSource) SetAccountIds(v []*string) *AccountAggregatio return s } -// SetAllAwsRegions sets the AllAwsRegions field's value. -func (s *AccountAggregationSource) SetAllAwsRegions(v bool) *AccountAggregationSource { - s.AllAwsRegions = &v +// SetAllAwsRegions sets the AllAwsRegions field's value. +func (s *AccountAggregationSource) SetAllAwsRegions(v bool) *AccountAggregationSource { + s.AllAwsRegions = &v + return s +} + +// SetAwsRegions sets the AwsRegions field's value. +func (s *AccountAggregationSource) SetAwsRegions(v []*string) *AccountAggregationSource { + s.AwsRegions = v + return s +} + +// Indicates whether an AWS Config rule is compliant based on account ID, region, +// compliance, and rule name. +// +// A rule is compliant if all of the resources that the rule evaluated comply +// with it. It is noncompliant if any of these resources do not comply. +type AggregateComplianceByConfigRule struct { + _ struct{} `type:"structure"` + + // The 12-digit account ID of the source account. + AccountId *string `type:"string"` + + // The source region from where the data is aggregated. + AwsRegion *string `min:"1" type:"string"` + + // Indicates whether an AWS resource or AWS Config rule is compliant and provides + // the number of contributors that affect the compliance. + Compliance *Compliance `type:"structure"` + + // The name of the AWS Config rule. + ConfigRuleName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s AggregateComplianceByConfigRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AggregateComplianceByConfigRule) GoString() string { + return s.String() +} + +// SetAccountId sets the AccountId field's value. +func (s *AggregateComplianceByConfigRule) SetAccountId(v string) *AggregateComplianceByConfigRule { + s.AccountId = &v + return s +} + +// SetAwsRegion sets the AwsRegion field's value. +func (s *AggregateComplianceByConfigRule) SetAwsRegion(v string) *AggregateComplianceByConfigRule { + s.AwsRegion = &v + return s +} + +// SetCompliance sets the Compliance field's value. +func (s *AggregateComplianceByConfigRule) SetCompliance(v *Compliance) *AggregateComplianceByConfigRule { + s.Compliance = v + return s +} + +// SetConfigRuleName sets the ConfigRuleName field's value. +func (s *AggregateComplianceByConfigRule) SetConfigRuleName(v string) *AggregateComplianceByConfigRule { + s.ConfigRuleName = &v + return s +} + +// Returns the number of compliant and noncompliant rules for one or more accounts +// and regions in an aggregator. +type AggregateComplianceCount struct { + _ struct{} `type:"structure"` + + // The number of compliant and noncompliant AWS Config rules. + ComplianceSummary *ComplianceSummary `type:"structure"` + + // The 12-digit account ID or region based on the GroupByKey value. + GroupName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s AggregateComplianceCount) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AggregateComplianceCount) GoString() string { + return s.String() +} + +// SetComplianceSummary sets the ComplianceSummary field's value. +func (s *AggregateComplianceCount) SetComplianceSummary(v *ComplianceSummary) *AggregateComplianceCount { + s.ComplianceSummary = v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *AggregateComplianceCount) SetGroupName(v string) *AggregateComplianceCount { + s.GroupName = &v + return s +} + +// The details of an AWS Config evaluation for an account ID and region in an +// aggregator. Provides the AWS resource that was evaluated, the compliance +// of the resource, related time stamps, and supplementary information. +type AggregateEvaluationResult struct { + _ struct{} `type:"structure"` + + // The 12-digit account ID of the source account. + AccountId *string `type:"string"` + + // Supplementary information about how the agrregate evaluation determined the + // compliance. + Annotation *string `min:"1" type:"string"` + + // The source region from where the data is aggregated. + AwsRegion *string `min:"1" type:"string"` + + // The resource compliance status. + // + // For the AggregationEvaluationResult data type, AWS Config supports only the + // COMPLIANT and NON_COMPLIANT. AWS Config does not support the NOT_APPLICABLE + // and INSUFFICIENT_DATA value. + ComplianceType *string `type:"string" enum:"ComplianceType"` + + // The time when the AWS Config rule evaluated the AWS resource. + ConfigRuleInvokedTime *time.Time `type:"timestamp"` + + // Uniquely identifies the evaluation result. + EvaluationResultIdentifier *EvaluationResultIdentifier `type:"structure"` + + // The time when AWS Config recorded the aggregate evaluation result. + ResultRecordedTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s AggregateEvaluationResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AggregateEvaluationResult) GoString() string { + return s.String() +} + +// SetAccountId sets the AccountId field's value. +func (s *AggregateEvaluationResult) SetAccountId(v string) *AggregateEvaluationResult { + s.AccountId = &v + return s +} + +// SetAnnotation sets the Annotation field's value. +func (s *AggregateEvaluationResult) SetAnnotation(v string) *AggregateEvaluationResult { + s.Annotation = &v + return s +} + +// SetAwsRegion sets the AwsRegion field's value. +func (s *AggregateEvaluationResult) SetAwsRegion(v string) *AggregateEvaluationResult { + s.AwsRegion = &v + return s +} + +// SetComplianceType sets the ComplianceType field's value. +func (s *AggregateEvaluationResult) SetComplianceType(v string) *AggregateEvaluationResult { + s.ComplianceType = &v + return s +} + +// SetConfigRuleInvokedTime sets the ConfigRuleInvokedTime field's value. +func (s *AggregateEvaluationResult) SetConfigRuleInvokedTime(v time.Time) *AggregateEvaluationResult { + s.ConfigRuleInvokedTime = &v + return s +} + +// SetEvaluationResultIdentifier sets the EvaluationResultIdentifier field's value. +func (s *AggregateEvaluationResult) SetEvaluationResultIdentifier(v *EvaluationResultIdentifier) *AggregateEvaluationResult { + s.EvaluationResultIdentifier = v + return s +} + +// SetResultRecordedTime sets the ResultRecordedTime field's value. +func (s *AggregateEvaluationResult) SetResultRecordedTime(v time.Time) *AggregateEvaluationResult { + s.ResultRecordedTime = &v + return s +} + +// The details that identify a resource that is collected by AWS Config aggregator, +// including the resource type, ID, (if available) the custom resource name, +// the source account, and source region. +type AggregateResourceIdentifier struct { + _ struct{} `type:"structure"` + + // The ID of the AWS resource. + // + // ResourceId is a required field + ResourceId *string `min:"1" type:"string" required:"true"` + + // The name of the AWS resource. + ResourceName *string `type:"string"` + + // The type of the AWS resource. + // + // ResourceType is a required field + ResourceType *string `type:"string" required:"true" enum:"ResourceType"` + + // The 12-digit account ID of the source account. + // + // SourceAccountId is a required field + SourceAccountId *string `type:"string" required:"true"` + + // The source region where data is aggregated. + // + // SourceRegion is a required field + SourceRegion *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s AggregateResourceIdentifier) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AggregateResourceIdentifier) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AggregateResourceIdentifier) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AggregateResourceIdentifier"} + 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.SourceAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("SourceAccountId")) + } + if s.SourceRegion == nil { + invalidParams.Add(request.NewErrParamRequired("SourceRegion")) + } + if s.SourceRegion != nil && len(*s.SourceRegion) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SourceRegion", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceId sets the ResourceId field's value. +func (s *AggregateResourceIdentifier) SetResourceId(v string) *AggregateResourceIdentifier { + s.ResourceId = &v + return s +} + +// SetResourceName sets the ResourceName field's value. +func (s *AggregateResourceIdentifier) SetResourceName(v string) *AggregateResourceIdentifier { + s.ResourceName = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *AggregateResourceIdentifier) SetResourceType(v string) *AggregateResourceIdentifier { + s.ResourceType = &v + return s +} + +// SetSourceAccountId sets the SourceAccountId field's value. +func (s *AggregateResourceIdentifier) SetSourceAccountId(v string) *AggregateResourceIdentifier { + s.SourceAccountId = &v + return s +} + +// SetSourceRegion sets the SourceRegion field's value. +func (s *AggregateResourceIdentifier) SetSourceRegion(v string) *AggregateResourceIdentifier { + s.SourceRegion = &v + return s +} + +// The current sync status between the source and the aggregator account. +type AggregatedSourceStatus struct { + _ struct{} `type:"structure"` + + // The region authorized to collect aggregated data. + AwsRegion *string `min:"1" type:"string"` + + // The error code that AWS Config returned when the source account aggregation + // last failed. + LastErrorCode *string `type:"string"` + + // The message indicating that the source account aggregation failed due to + // an error. + LastErrorMessage *string `type:"string"` + + // Filters the last updated status type. + // + // * Valid value FAILED indicates errors while moving data. + // + // * Valid value SUCCEEDED indicates the data was successfully moved. + // + // * Valid value OUTDATED indicates the data is not the most recent. + LastUpdateStatus *string `type:"string" enum:"AggregatedSourceStatusType"` + + // The time of the last update. + LastUpdateTime *time.Time `type:"timestamp"` + + // The source account ID or an organization. + SourceId *string `type:"string"` + + // The source account or an organization. + SourceType *string `type:"string" enum:"AggregatedSourceType"` +} + +// String returns the string representation +func (s AggregatedSourceStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AggregatedSourceStatus) GoString() string { + return s.String() +} + +// SetAwsRegion sets the AwsRegion field's value. +func (s *AggregatedSourceStatus) SetAwsRegion(v string) *AggregatedSourceStatus { + s.AwsRegion = &v + return s +} + +// SetLastErrorCode sets the LastErrorCode field's value. +func (s *AggregatedSourceStatus) SetLastErrorCode(v string) *AggregatedSourceStatus { + s.LastErrorCode = &v + return s +} + +// SetLastErrorMessage sets the LastErrorMessage field's value. +func (s *AggregatedSourceStatus) SetLastErrorMessage(v string) *AggregatedSourceStatus { + s.LastErrorMessage = &v + return s +} + +// SetLastUpdateStatus sets the LastUpdateStatus field's value. +func (s *AggregatedSourceStatus) SetLastUpdateStatus(v string) *AggregatedSourceStatus { + s.LastUpdateStatus = &v + return s +} + +// SetLastUpdateTime sets the LastUpdateTime field's value. +func (s *AggregatedSourceStatus) SetLastUpdateTime(v time.Time) *AggregatedSourceStatus { + s.LastUpdateTime = &v + return s +} + +// SetSourceId sets the SourceId field's value. +func (s *AggregatedSourceStatus) SetSourceId(v string) *AggregatedSourceStatus { + s.SourceId = &v + return s +} + +// SetSourceType sets the SourceType field's value. +func (s *AggregatedSourceStatus) SetSourceType(v string) *AggregatedSourceStatus { + s.SourceType = &v + return s +} + +// An object that represents the authorizations granted to aggregator accounts +// and regions. +type AggregationAuthorization struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the aggregation object. + AggregationAuthorizationArn *string `type:"string"` + + // The 12-digit account ID of the account authorized to aggregate data. + AuthorizedAccountId *string `type:"string"` + + // The region authorized to collect aggregated data. + AuthorizedAwsRegion *string `min:"1" type:"string"` + + // The time stamp when the aggregation authorization was created. + CreationTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s AggregationAuthorization) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AggregationAuthorization) GoString() string { + return s.String() +} + +// SetAggregationAuthorizationArn sets the AggregationAuthorizationArn field's value. +func (s *AggregationAuthorization) SetAggregationAuthorizationArn(v string) *AggregationAuthorization { + s.AggregationAuthorizationArn = &v + return s +} + +// SetAuthorizedAccountId sets the AuthorizedAccountId field's value. +func (s *AggregationAuthorization) SetAuthorizedAccountId(v string) *AggregationAuthorization { + s.AuthorizedAccountId = &v + return s +} + +// SetAuthorizedAwsRegion sets the AuthorizedAwsRegion field's value. +func (s *AggregationAuthorization) SetAuthorizedAwsRegion(v string) *AggregationAuthorization { + s.AuthorizedAwsRegion = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *AggregationAuthorization) SetCreationTime(v time.Time) *AggregationAuthorization { + s.CreationTime = &v + return s +} + +// The detailed configuration of a specified resource. +type BaseConfigurationItem 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" min:"1" 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"` + + // 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"` + + // The time stamp when the resource was created. + ResourceCreationTime *time.Time `locationName:"resourceCreationTime" type:"timestamp"` + + // The ID of the resource (for example., sg-xxxxxx). + ResourceId *string `locationName:"resourceId" min:"1" 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"` + + // The version number of the resource configuration. + Version *string `locationName:"version" type:"string"` +} + +// String returns the string representation +func (s BaseConfigurationItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BaseConfigurationItem) GoString() string { + return s.String() +} + +// SetAccountId sets the AccountId field's value. +func (s *BaseConfigurationItem) SetAccountId(v string) *BaseConfigurationItem { + s.AccountId = &v + return s +} + +// SetArn sets the Arn field's value. +func (s *BaseConfigurationItem) SetArn(v string) *BaseConfigurationItem { + s.Arn = &v + return s +} + +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *BaseConfigurationItem) SetAvailabilityZone(v string) *BaseConfigurationItem { + s.AvailabilityZone = &v + return s +} + +// SetAwsRegion sets the AwsRegion field's value. +func (s *BaseConfigurationItem) SetAwsRegion(v string) *BaseConfigurationItem { + s.AwsRegion = &v + return s +} + +// SetConfiguration sets the Configuration field's value. +func (s *BaseConfigurationItem) SetConfiguration(v string) *BaseConfigurationItem { + s.Configuration = &v + return s +} + +// SetConfigurationItemCaptureTime sets the ConfigurationItemCaptureTime field's value. +func (s *BaseConfigurationItem) SetConfigurationItemCaptureTime(v time.Time) *BaseConfigurationItem { + s.ConfigurationItemCaptureTime = &v + return s +} + +// SetConfigurationItemStatus sets the ConfigurationItemStatus field's value. +func (s *BaseConfigurationItem) SetConfigurationItemStatus(v string) *BaseConfigurationItem { + s.ConfigurationItemStatus = &v + return s +} + +// SetConfigurationStateId sets the ConfigurationStateId field's value. +func (s *BaseConfigurationItem) SetConfigurationStateId(v string) *BaseConfigurationItem { + s.ConfigurationStateId = &v + return s +} + +// SetResourceCreationTime sets the ResourceCreationTime field's value. +func (s *BaseConfigurationItem) SetResourceCreationTime(v time.Time) *BaseConfigurationItem { + s.ResourceCreationTime = &v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *BaseConfigurationItem) SetResourceId(v string) *BaseConfigurationItem { + s.ResourceId = &v + return s +} + +// SetResourceName sets the ResourceName field's value. +func (s *BaseConfigurationItem) SetResourceName(v string) *BaseConfigurationItem { + s.ResourceName = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *BaseConfigurationItem) SetResourceType(v string) *BaseConfigurationItem { + s.ResourceType = &v + return s +} + +// SetSupplementaryConfiguration sets the SupplementaryConfiguration field's value. +func (s *BaseConfigurationItem) SetSupplementaryConfiguration(v map[string]*string) *BaseConfigurationItem { + s.SupplementaryConfiguration = v + return s +} + +// SetVersion sets the Version field's value. +func (s *BaseConfigurationItem) SetVersion(v string) *BaseConfigurationItem { + s.Version = &v + return s +} + +type BatchGetAggregateResourceConfigInput struct { + _ struct{} `type:"structure"` + + // The name of the configuration aggregator. + // + // ConfigurationAggregatorName is a required field + ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` + + // A list of aggregate ResourceIdentifiers objects. + // + // ResourceIdentifiers is a required field + ResourceIdentifiers []*AggregateResourceIdentifier `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchGetAggregateResourceConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchGetAggregateResourceConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchGetAggregateResourceConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchGetAggregateResourceConfigInput"} + if s.ConfigurationAggregatorName == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) + } + if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) + } + if s.ResourceIdentifiers == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceIdentifiers")) + } + if s.ResourceIdentifiers != nil && len(s.ResourceIdentifiers) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceIdentifiers", 1)) + } + if s.ResourceIdentifiers != nil { + for i, v := range s.ResourceIdentifiers { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceIdentifiers", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. +func (s *BatchGetAggregateResourceConfigInput) SetConfigurationAggregatorName(v string) *BatchGetAggregateResourceConfigInput { + s.ConfigurationAggregatorName = &v + return s +} + +// SetResourceIdentifiers sets the ResourceIdentifiers field's value. +func (s *BatchGetAggregateResourceConfigInput) SetResourceIdentifiers(v []*AggregateResourceIdentifier) *BatchGetAggregateResourceConfigInput { + s.ResourceIdentifiers = v + return s +} + +type BatchGetAggregateResourceConfigOutput struct { + _ struct{} `type:"structure"` + + // A list that contains the current configuration of one or more resources. + BaseConfigurationItems []*BaseConfigurationItem `type:"list"` + + // A list of resource identifiers that were not processed with current scope. + // The list is empty if all the resources are processed. + UnprocessedResourceIdentifiers []*AggregateResourceIdentifier `type:"list"` +} + +// String returns the string representation +func (s BatchGetAggregateResourceConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchGetAggregateResourceConfigOutput) GoString() string { + return s.String() +} + +// SetBaseConfigurationItems sets the BaseConfigurationItems field's value. +func (s *BatchGetAggregateResourceConfigOutput) SetBaseConfigurationItems(v []*BaseConfigurationItem) *BatchGetAggregateResourceConfigOutput { + s.BaseConfigurationItems = v + return s +} + +// SetUnprocessedResourceIdentifiers sets the UnprocessedResourceIdentifiers field's value. +func (s *BatchGetAggregateResourceConfigOutput) SetUnprocessedResourceIdentifiers(v []*AggregateResourceIdentifier) *BatchGetAggregateResourceConfigOutput { + s.UnprocessedResourceIdentifiers = v + return s +} + +type BatchGetResourceConfigInput struct { + _ struct{} `type:"structure"` + + // A list of resource keys to be processed with the current request. Each element + // in the list consists of the resource type and resource ID. + // + // ResourceKeys is a required field + ResourceKeys []*ResourceKey `locationName:"resourceKeys" min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchGetResourceConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchGetResourceConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchGetResourceConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchGetResourceConfigInput"} + if s.ResourceKeys == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceKeys")) + } + if s.ResourceKeys != nil && len(s.ResourceKeys) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceKeys", 1)) + } + if s.ResourceKeys != nil { + for i, v := range s.ResourceKeys { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceKeys", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceKeys sets the ResourceKeys field's value. +func (s *BatchGetResourceConfigInput) SetResourceKeys(v []*ResourceKey) *BatchGetResourceConfigInput { + s.ResourceKeys = v + return s +} + +type BatchGetResourceConfigOutput struct { + _ struct{} `type:"structure"` + + // A list that contains the current configuration of one or more resources. + BaseConfigurationItems []*BaseConfigurationItem `locationName:"baseConfigurationItems" type:"list"` + + // A list of resource keys that were not processed with the current response. + // The unprocessesResourceKeys value is in the same form as ResourceKeys, so + // the value can be directly provided to a subsequent BatchGetResourceConfig + // operation. If there are no unprocessed resource keys, the response contains + // an empty unprocessedResourceKeys list. + UnprocessedResourceKeys []*ResourceKey `locationName:"unprocessedResourceKeys" min:"1" type:"list"` +} + +// String returns the string representation +func (s BatchGetResourceConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchGetResourceConfigOutput) GoString() string { + return s.String() +} + +// SetBaseConfigurationItems sets the BaseConfigurationItems field's value. +func (s *BatchGetResourceConfigOutput) SetBaseConfigurationItems(v []*BaseConfigurationItem) *BatchGetResourceConfigOutput { + s.BaseConfigurationItems = v + return s +} + +// SetUnprocessedResourceKeys sets the UnprocessedResourceKeys field's value. +func (s *BatchGetResourceConfigOutput) SetUnprocessedResourceKeys(v []*ResourceKey) *BatchGetResourceConfigOutput { + s.UnprocessedResourceKeys = v + return s +} + +// Indicates whether an AWS resource or AWS Config rule is compliant and provides +// the number of contributors that affect the 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. A resource 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. A rule 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 AWS 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. A rule is noncompliant +// if any of these resources do not comply. +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. A resource is noncompliant if it does +// not comply with one or more of these rules. +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. +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. +type ComplianceSummary struct { + _ struct{} `type:"structure"` + + // The time that AWS Config created the compliance summary. + ComplianceSummaryTimestamp *time.Time `type:"timestamp"` + + // 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. +type ComplianceSummaryByResourceType struct { + _ struct{} `type:"structure"` + + // The number of AWS resources that are compliant or noncompliant, up to a maximum + // of 100 for each. + 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 +} + +// Provides status of the delivery of the snapshot or the configuration history +// to the specified Amazon S3 bucket. Also provides the status of notifications +// about the Amazon S3 delivery to the specified Amazon SNS topic. +type ConfigExportDeliveryInfo struct { + _ struct{} `type:"structure"` + + // The time of the last attempted delivery. + LastAttemptTime *time.Time `locationName:"lastAttemptTime" type:"timestamp"` + + // 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"` + + // The time that the next delivery occurs. + NextDeliveryTime *time.Time `locationName:"nextDeliveryTime" type:"timestamp"` +} + +// 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 (https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config.html) +// in the AWS Config Developer Guide. +type ConfigRule struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the AWS Config rule. + ConfigRuleArn *string `min:"1" type:"string"` + + // The ID of the AWS Config rule. + ConfigRuleId *string `min:"1" 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 AWS 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 AWS 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 AWS Config rule. + // + // AWS Config temporarily sets the state of a rule to DELETING 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"` + + // Service principal name of the service that created the rule. + // + // The field is populated only if the service linked rule is created by a service. + // The field is empty if you create your own rule. + CreatedBy *string `min:"1" type:"string"` + + // 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. + // + // By default, rules with a periodic trigger are evaluated every 24 hours. To + // change the frequency, specify a valid value for the MaximumExecutionFrequency + // parameter. + 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.ConfigRuleArn != nil && len(*s.ConfigRuleArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigRuleArn", 1)) + } + if s.ConfigRuleId != nil && len(*s.ConfigRuleId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigRuleId", 1)) + } + if s.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) + } + if s.CreatedBy != nil && len(*s.CreatedBy) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CreatedBy", 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 +} + +// SetCreatedBy sets the CreatedBy field's value. +func (s *ConfigRule) SetCreatedBy(v string) *ConfigRule { + s.CreatedBy = &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 +} + +// Filters the compliance results based on account ID, region, compliance type, +// and rule name. +type ConfigRuleComplianceFilters struct { + _ struct{} `type:"structure"` + + // The 12-digit account ID of the source account. + AccountId *string `type:"string"` + + // The source region where the data is aggregated. + AwsRegion *string `min:"1" type:"string"` + + // The rule compliance status. + // + // For the ConfigRuleComplianceFilters data type, AWS Config supports only COMPLIANT + // and NON_COMPLIANT. AWS Config does not support the NOT_APPLICABLE and the + // INSUFFICIENT_DATA values. + ComplianceType *string `type:"string" enum:"ComplianceType"` + + // The name of the AWS Config rule. + ConfigRuleName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ConfigRuleComplianceFilters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConfigRuleComplianceFilters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ConfigRuleComplianceFilters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConfigRuleComplianceFilters"} + if s.AwsRegion != nil && len(*s.AwsRegion) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AwsRegion", 1)) + } + if s.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccountId sets the AccountId field's value. +func (s *ConfigRuleComplianceFilters) SetAccountId(v string) *ConfigRuleComplianceFilters { + s.AccountId = &v + return s +} + +// SetAwsRegion sets the AwsRegion field's value. +func (s *ConfigRuleComplianceFilters) SetAwsRegion(v string) *ConfigRuleComplianceFilters { + s.AwsRegion = &v + return s +} + +// SetComplianceType sets the ComplianceType field's value. +func (s *ConfigRuleComplianceFilters) SetComplianceType(v string) *ConfigRuleComplianceFilters { + s.ComplianceType = &v + return s +} + +// SetConfigRuleName sets the ConfigRuleName field's value. +func (s *ConfigRuleComplianceFilters) SetConfigRuleName(v string) *ConfigRuleComplianceFilters { + s.ConfigRuleName = &v + return s +} + +// Filters the results based on the account IDs and regions. +type ConfigRuleComplianceSummaryFilters struct { + _ struct{} `type:"structure"` + + // The 12-digit account ID of the source account. + AccountId *string `type:"string"` + + // The source region where the data is aggregated. + AwsRegion *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ConfigRuleComplianceSummaryFilters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConfigRuleComplianceSummaryFilters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ConfigRuleComplianceSummaryFilters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConfigRuleComplianceSummaryFilters"} + if s.AwsRegion != nil && len(*s.AwsRegion) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AwsRegion", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccountId sets the AccountId field's value. +func (s *ConfigRuleComplianceSummaryFilters) SetAccountId(v string) *ConfigRuleComplianceSummaryFilters { + s.AccountId = &v + return s +} + +// SetAwsRegion sets the AwsRegion field's value. +func (s *ConfigRuleComplianceSummaryFilters) SetAwsRegion(v string) *ConfigRuleComplianceSummaryFilters { + s.AwsRegion = &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 AWS Config rules. +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"` + + // 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"` + + LastDeactivatedTime *time.Time `type:"timestamp"` + + // 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"` + + // The time that AWS Config last failed to invoke the AWS Config rule to evaluate + // your AWS resources. + LastFailedInvocationTime *time.Time `type:"timestamp"` + + // The time that AWS Config last successfully evaluated your AWS resources against + // the rule. + LastSuccessfulEvaluationTime *time.Time `type:"timestamp"` + + // The time that AWS Config last successfully invoked the AWS Config rule to + // evaluate your AWS resources. + LastSuccessfulInvocationTime *time.Time `type:"timestamp"` +} + +// 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 +} + +// SetLastDeactivatedTime sets the LastDeactivatedTime field's value. +func (s *ConfigRuleEvaluationStatus) SetLastDeactivatedTime(v time.Time) *ConfigRuleEvaluationStatus { + s.LastDeactivatedTime = &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. +// +// 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 AWS 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. +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. +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 (https://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"` +} + +// 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 +} + +// The details about the configuration aggregator, including information about +// source accounts, regions, and metadata of the aggregator. +type ConfigurationAggregator struct { + _ struct{} `type:"structure"` + + // Provides a list of source accounts and regions to be aggregated. + AccountAggregationSources []*AccountAggregationSource `type:"list"` + + // The Amazon Resource Name (ARN) of the aggregator. + ConfigurationAggregatorArn *string `type:"string"` + + // The name of the aggregator. + ConfigurationAggregatorName *string `min:"1" type:"string"` + + // The time stamp when the configuration aggregator was created. + CreationTime *time.Time `type:"timestamp"` + + // The time of the last update. + LastUpdatedTime *time.Time `type:"timestamp"` + + // Provides an organization and list of regions to be aggregated. + OrganizationAggregationSource *OrganizationAggregationSource `type:"structure"` +} + +// String returns the string representation +func (s ConfigurationAggregator) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConfigurationAggregator) GoString() string { + return s.String() +} + +// SetAccountAggregationSources sets the AccountAggregationSources field's value. +func (s *ConfigurationAggregator) SetAccountAggregationSources(v []*AccountAggregationSource) *ConfigurationAggregator { + s.AccountAggregationSources = v + return s +} + +// SetConfigurationAggregatorArn sets the ConfigurationAggregatorArn field's value. +func (s *ConfigurationAggregator) SetConfigurationAggregatorArn(v string) *ConfigurationAggregator { + s.ConfigurationAggregatorArn = &v + return s +} + +// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. +func (s *ConfigurationAggregator) SetConfigurationAggregatorName(v string) *ConfigurationAggregator { + s.ConfigurationAggregatorName = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *ConfigurationAggregator) SetCreationTime(v time.Time) *ConfigurationAggregator { + s.CreationTime = &v + return s +} + +// SetLastUpdatedTime sets the LastUpdatedTime field's value. +func (s *ConfigurationAggregator) SetLastUpdatedTime(v time.Time) *ConfigurationAggregator { + s.LastUpdatedTime = &v + return s +} + +// SetOrganizationAggregationSource sets the OrganizationAggregationSource field's value. +func (s *ConfigurationAggregator) SetOrganizationAggregationSource(v *OrganizationAggregationSource) *ConfigurationAggregator { + s.OrganizationAggregationSource = v + return s +} + +// A list that contains detailed configurations of a specified resource. +type ConfigurationItem struct { + _ struct{} `type:"structure"` + + // The 12-digit AWS account ID associated with the resource. + AccountId *string `locationName:"accountId" type:"string"` + + // accoun + 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" min:"1" 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"` + + // 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 (https://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. As of Version 1.3, the relatedEvents field is empty. You can + // access the LookupEvents API (https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_LookupEvents.html) + // in the AWS CloudTrail API Reference to retrieve the events for the resource. + 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"` + + // The ID of the resource (for example, sg-xxxxxx). + ResourceId *string `locationName:"resourceId" min:"1" 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. +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 resources 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. +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"` + + // 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"` + + // The time the recorder was last stopped. + LastStopTime *time.Time `locationName:"lastStopTime" type:"timestamp"` + + // The name of the configuration recorder. + Name *string `locationName:"name" type:"string"` + + // Specifies whether or not the recorder is currently recording. + 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 +} + +// Filters the conformance pack by compliance types and AWS Config rule names. +type ConformancePackComplianceFilters struct { + _ struct{} `type:"structure"` + + // Filters the results by compliance. + // + // The allowed values are COMPLIANT and NON_COMPLIANT. + ComplianceType *string `type:"string" enum:"ConformancePackComplianceType"` + + // Filters the results by AWS Config rule names. + ConfigRuleNames []*string `type:"list"` +} + +// String returns the string representation +func (s ConformancePackComplianceFilters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConformancePackComplianceFilters) GoString() string { + return s.String() +} + +// SetComplianceType sets the ComplianceType field's value. +func (s *ConformancePackComplianceFilters) SetComplianceType(v string) *ConformancePackComplianceFilters { + s.ComplianceType = &v + return s +} + +// SetConfigRuleNames sets the ConfigRuleNames field's value. +func (s *ConformancePackComplianceFilters) SetConfigRuleNames(v []*string) *ConformancePackComplianceFilters { + s.ConfigRuleNames = v + return s +} + +// Summary includes the name and status of the conformance pack. +type ConformancePackComplianceSummary struct { + _ struct{} `type:"structure"` + + // The status of the conformance pack. The allowed values are COMPLIANT and + // NON_COMPLIANT. + // + // ConformancePackComplianceStatus is a required field + ConformancePackComplianceStatus *string `type:"string" required:"true" enum:"ConformancePackComplianceType"` + + // The name of the conformance pack name. + // + // ConformancePackName is a required field + ConformancePackName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ConformancePackComplianceSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConformancePackComplianceSummary) GoString() string { + return s.String() +} + +// SetConformancePackComplianceStatus sets the ConformancePackComplianceStatus field's value. +func (s *ConformancePackComplianceSummary) SetConformancePackComplianceStatus(v string) *ConformancePackComplianceSummary { + s.ConformancePackComplianceStatus = &v + return s +} + +// SetConformancePackName sets the ConformancePackName field's value. +func (s *ConformancePackComplianceSummary) SetConformancePackName(v string) *ConformancePackComplianceSummary { + s.ConformancePackName = &v + return s +} + +// Returns details of a conformance pack. A conformance pack is a collection +// of AWS Config rules and remediation actions that can be easily deployed in +// an account and a region. +type ConformancePackDetail struct { + _ struct{} `type:"structure"` + + // Amazon Resource Name (ARN) of the conformance pack. + // + // ConformancePackArn is a required field + ConformancePackArn *string `min:"1" type:"string" required:"true"` + + // ID of the conformance pack. + // + // ConformancePackId is a required field + ConformancePackId *string `min:"1" type:"string" required:"true"` + + // A list of ConformancePackInputParameter objects. + ConformancePackInputParameters []*ConformancePackInputParameter `type:"list"` + + // Name of the conformance pack. + // + // ConformancePackName is a required field + ConformancePackName *string `min:"1" type:"string" required:"true"` + + // AWS service that created the conformance pack. + CreatedBy *string `min:"1" type:"string"` + + // Conformance pack template that is used to create a pack. The delivery bucket + // name should start with awsconfigconforms. For example: "Resource": "arn:aws:s3:::your_bucket_name/*". + // + // DeliveryS3Bucket is a required field + DeliveryS3Bucket *string `min:"3" type:"string" required:"true"` + + // The prefix for the Amazon S3 bucket. + DeliveryS3KeyPrefix *string `min:"1" type:"string"` + + // Last time when conformation pack update was requested. + LastUpdateRequestedTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s ConformancePackDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConformancePackDetail) GoString() string { + return s.String() +} + +// SetConformancePackArn sets the ConformancePackArn field's value. +func (s *ConformancePackDetail) SetConformancePackArn(v string) *ConformancePackDetail { + s.ConformancePackArn = &v + return s +} + +// SetConformancePackId sets the ConformancePackId field's value. +func (s *ConformancePackDetail) SetConformancePackId(v string) *ConformancePackDetail { + s.ConformancePackId = &v + return s +} + +// SetConformancePackInputParameters sets the ConformancePackInputParameters field's value. +func (s *ConformancePackDetail) SetConformancePackInputParameters(v []*ConformancePackInputParameter) *ConformancePackDetail { + s.ConformancePackInputParameters = v + return s +} + +// SetConformancePackName sets the ConformancePackName field's value. +func (s *ConformancePackDetail) SetConformancePackName(v string) *ConformancePackDetail { + s.ConformancePackName = &v + return s +} + +// SetCreatedBy sets the CreatedBy field's value. +func (s *ConformancePackDetail) SetCreatedBy(v string) *ConformancePackDetail { + s.CreatedBy = &v + return s +} + +// SetDeliveryS3Bucket sets the DeliveryS3Bucket field's value. +func (s *ConformancePackDetail) SetDeliveryS3Bucket(v string) *ConformancePackDetail { + s.DeliveryS3Bucket = &v + return s +} + +// SetDeliveryS3KeyPrefix sets the DeliveryS3KeyPrefix field's value. +func (s *ConformancePackDetail) SetDeliveryS3KeyPrefix(v string) *ConformancePackDetail { + s.DeliveryS3KeyPrefix = &v + return s +} + +// SetLastUpdateRequestedTime sets the LastUpdateRequestedTime field's value. +func (s *ConformancePackDetail) SetLastUpdateRequestedTime(v time.Time) *ConformancePackDetail { + s.LastUpdateRequestedTime = &v + return s +} + +// Filters a conformance pack by AWS Config rule names, compliance types, AWS +// resource types, and resource IDs. +type ConformancePackEvaluationFilters struct { + _ struct{} `type:"structure"` + + // Filters the results by compliance. + // + // The allowed values are COMPLIANT and NON_COMPLIANT. + ComplianceType *string `type:"string" enum:"ConformancePackComplianceType"` + + // Filters the results by AWS Config rule names. + ConfigRuleNames []*string `type:"list"` + + // Filters the results by resource IDs. + // + // This is valid only when you provide resource type. If there is no resource + // type, you will see an error. + ResourceIds []*string `type:"list"` + + // Filters the results by the resource type (for example, "AWS::EC2::Instance"). + ResourceType *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ConformancePackEvaluationFilters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConformancePackEvaluationFilters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ConformancePackEvaluationFilters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConformancePackEvaluationFilters"} + if s.ResourceType != nil && len(*s.ResourceType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceType", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComplianceType sets the ComplianceType field's value. +func (s *ConformancePackEvaluationFilters) SetComplianceType(v string) *ConformancePackEvaluationFilters { + s.ComplianceType = &v + return s +} + +// SetConfigRuleNames sets the ConfigRuleNames field's value. +func (s *ConformancePackEvaluationFilters) SetConfigRuleNames(v []*string) *ConformancePackEvaluationFilters { + s.ConfigRuleNames = v + return s +} + +// SetResourceIds sets the ResourceIds field's value. +func (s *ConformancePackEvaluationFilters) SetResourceIds(v []*string) *ConformancePackEvaluationFilters { + s.ResourceIds = v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ConformancePackEvaluationFilters) SetResourceType(v string) *ConformancePackEvaluationFilters { + s.ResourceType = &v + return s +} + +// The details of a conformance pack evaluation. Provides AWS Config rule and +// AWS resource type that was evaluated, the compliance of the conformance pack, +// related time stamps, and supplementary information. +type ConformancePackEvaluationResult struct { + _ struct{} `type:"structure"` + + // Supplementary information about how the evaluation determined the compliance. + Annotation *string `type:"string"` + + // The compliance type. The allowed values are COMPLIANT and NON_COMPLIANT. + // + // ComplianceType is a required field + ComplianceType *string `type:"string" required:"true" enum:"ConformancePackComplianceType"` + + // The time when AWS Config rule evaluated AWS resource. + // + // ConfigRuleInvokedTime is a required field + ConfigRuleInvokedTime *time.Time `type:"timestamp" required:"true"` + + // Uniquely identifies an evaluation result. + // + // EvaluationResultIdentifier is a required field + EvaluationResultIdentifier *EvaluationResultIdentifier `type:"structure" required:"true"` + + // The time when AWS Config recorded the evaluation result. + // + // ResultRecordedTime is a required field + ResultRecordedTime *time.Time `type:"timestamp" required:"true"` +} + +// String returns the string representation +func (s ConformancePackEvaluationResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConformancePackEvaluationResult) GoString() string { + return s.String() +} + +// SetAnnotation sets the Annotation field's value. +func (s *ConformancePackEvaluationResult) SetAnnotation(v string) *ConformancePackEvaluationResult { + s.Annotation = &v + return s +} + +// SetComplianceType sets the ComplianceType field's value. +func (s *ConformancePackEvaluationResult) SetComplianceType(v string) *ConformancePackEvaluationResult { + s.ComplianceType = &v + return s +} + +// SetConfigRuleInvokedTime sets the ConfigRuleInvokedTime field's value. +func (s *ConformancePackEvaluationResult) SetConfigRuleInvokedTime(v time.Time) *ConformancePackEvaluationResult { + s.ConfigRuleInvokedTime = &v + return s +} + +// SetEvaluationResultIdentifier sets the EvaluationResultIdentifier field's value. +func (s *ConformancePackEvaluationResult) SetEvaluationResultIdentifier(v *EvaluationResultIdentifier) *ConformancePackEvaluationResult { + s.EvaluationResultIdentifier = v + return s +} + +// SetResultRecordedTime sets the ResultRecordedTime field's value. +func (s *ConformancePackEvaluationResult) SetResultRecordedTime(v time.Time) *ConformancePackEvaluationResult { + s.ResultRecordedTime = &v + return s +} + +// Input parameters in the form of key-value pairs for the conformance pack, +// both of which you define. Keys can have a maximum character length of 128 +// characters, and values can have a maximum length of 256 characters. +type ConformancePackInputParameter struct { + _ struct{} `type:"structure"` + + // One part of a key-value pair. + // + // ParameterName is a required field + ParameterName *string `type:"string" required:"true"` + + // Another part of the key-value pair. + // + // ParameterValue is a required field + ParameterValue *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ConformancePackInputParameter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConformancePackInputParameter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ConformancePackInputParameter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConformancePackInputParameter"} + if s.ParameterName == nil { + invalidParams.Add(request.NewErrParamRequired("ParameterName")) + } + if s.ParameterValue == nil { + invalidParams.Add(request.NewErrParamRequired("ParameterValue")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetParameterName sets the ParameterName field's value. +func (s *ConformancePackInputParameter) SetParameterName(v string) *ConformancePackInputParameter { + s.ParameterName = &v + return s +} + +// SetParameterValue sets the ParameterValue field's value. +func (s *ConformancePackInputParameter) SetParameterValue(v string) *ConformancePackInputParameter { + s.ParameterValue = &v + return s +} + +// Compliance information of one or more AWS Config rules within a conformance +// pack. You can filter using AWS Config rule names and compliance types. +type ConformancePackRuleCompliance struct { + _ struct{} `type:"structure"` + + // Compliance of the AWS Config rule + // + // The allowed values are COMPLIANT and NON_COMPLIANT. + ComplianceType *string `type:"string" enum:"ConformancePackComplianceType"` + + // Name of the config rule. + ConfigRuleName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ConformancePackRuleCompliance) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConformancePackRuleCompliance) GoString() string { + return s.String() +} + +// SetComplianceType sets the ComplianceType field's value. +func (s *ConformancePackRuleCompliance) SetComplianceType(v string) *ConformancePackRuleCompliance { + s.ComplianceType = &v + return s +} + +// SetConfigRuleName sets the ConfigRuleName field's value. +func (s *ConformancePackRuleCompliance) SetConfigRuleName(v string) *ConformancePackRuleCompliance { + s.ConfigRuleName = &v + return s +} + +// Status details of a conformance pack. +type ConformancePackStatusDetail struct { + _ struct{} `type:"structure"` + + // Amazon Resource Name (ARN) of comformance pack. + // + // ConformancePackArn is a required field + ConformancePackArn *string `min:"1" type:"string" required:"true"` + + // ID of the conformance pack. + // + // ConformancePackId is a required field + ConformancePackId *string `min:"1" type:"string" required:"true"` + + // Name of the conformance pack. + // + // ConformancePackName is a required field + ConformancePackName *string `min:"1" type:"string" required:"true"` + + // Indicates deployment status of conformance pack. + // + // AWS Config sets the state of the conformance pack to: + // + // * CREATE_IN_PROGRESS when a conformance pack creation is in progress for + // an account. + // + // * CREATE_COMPLETE when a conformance pack has been successfully created + // in your account. + // + // * CREATE_FAILED when a conformance pack creation failed in your account. + // + // * DELETE_IN_PROGRESS when a conformance pack deletion is in progress. + // + // * DELETE_FAILED when a conformance pack deletion failed in your account. + // + // ConformancePackState is a required field + ConformancePackState *string `type:"string" required:"true" enum:"ConformancePackState"` + + // The reason of conformance pack creation failure. + ConformancePackStatusReason *string `type:"string"` + + // Last time when conformation pack creation and update was successful. + LastUpdateCompletedTime *time.Time `type:"timestamp"` + + // Last time when conformation pack creation and update was requested. + // + // LastUpdateRequestedTime is a required field + LastUpdateRequestedTime *time.Time `type:"timestamp" required:"true"` + + // Amazon Resource Name (ARN) of AWS CloudFormation stack. + // + // StackArn is a required field + StackArn *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ConformancePackStatusDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConformancePackStatusDetail) GoString() string { + return s.String() +} + +// SetConformancePackArn sets the ConformancePackArn field's value. +func (s *ConformancePackStatusDetail) SetConformancePackArn(v string) *ConformancePackStatusDetail { + s.ConformancePackArn = &v + return s +} + +// SetConformancePackId sets the ConformancePackId field's value. +func (s *ConformancePackStatusDetail) SetConformancePackId(v string) *ConformancePackStatusDetail { + s.ConformancePackId = &v + return s +} + +// SetConformancePackName sets the ConformancePackName field's value. +func (s *ConformancePackStatusDetail) SetConformancePackName(v string) *ConformancePackStatusDetail { + s.ConformancePackName = &v + return s +} + +// SetConformancePackState sets the ConformancePackState field's value. +func (s *ConformancePackStatusDetail) SetConformancePackState(v string) *ConformancePackStatusDetail { + s.ConformancePackState = &v + return s +} + +// SetConformancePackStatusReason sets the ConformancePackStatusReason field's value. +func (s *ConformancePackStatusDetail) SetConformancePackStatusReason(v string) *ConformancePackStatusDetail { + s.ConformancePackStatusReason = &v + return s +} + +// SetLastUpdateCompletedTime sets the LastUpdateCompletedTime field's value. +func (s *ConformancePackStatusDetail) SetLastUpdateCompletedTime(v time.Time) *ConformancePackStatusDetail { + s.LastUpdateCompletedTime = &v return s } -// SetAwsRegions sets the AwsRegions field's value. -func (s *AccountAggregationSource) SetAwsRegions(v []*string) *AccountAggregationSource { - s.AwsRegions = v +// SetLastUpdateRequestedTime sets the LastUpdateRequestedTime field's value. +func (s *ConformancePackStatusDetail) SetLastUpdateRequestedTime(v time.Time) *ConformancePackStatusDetail { + s.LastUpdateRequestedTime = &v + return s +} + +// SetStackArn sets the StackArn field's value. +func (s *ConformancePackStatusDetail) SetStackArn(v string) *ConformancePackStatusDetail { + s.StackArn = &v + return s +} + +// You have specified a template that is not valid or supported. +type ConformancePackTemplateValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConformancePackTemplateValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConformancePackTemplateValidationException) GoString() string { + return s.String() +} + +func newErrorConformancePackTemplateValidationException(v protocol.ResponseMetadata) error { + return &ConformancePackTemplateValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConformancePackTemplateValidationException) Code() string { + return "ConformancePackTemplateValidationException" +} + +// Message returns the exception's message. +func (s ConformancePackTemplateValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConformancePackTemplateValidationException) OrigErr() error { + return nil +} + +func (s ConformancePackTemplateValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConformancePackTemplateValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConformancePackTemplateValidationException) RequestID() string { + return s.respMetadata.RequestID +} + +type DeleteAggregationAuthorizationInput struct { + _ struct{} `type:"structure"` + + // The 12-digit account ID of the account authorized to aggregate data. + // + // AuthorizedAccountId is a required field + AuthorizedAccountId *string `type:"string" required:"true"` + + // The region authorized to collect aggregated data. + // + // AuthorizedAwsRegion is a required field + AuthorizedAwsRegion *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteAggregationAuthorizationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAggregationAuthorizationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteAggregationAuthorizationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteAggregationAuthorizationInput"} + if s.AuthorizedAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AuthorizedAccountId")) + } + if s.AuthorizedAwsRegion == nil { + invalidParams.Add(request.NewErrParamRequired("AuthorizedAwsRegion")) + } + if s.AuthorizedAwsRegion != nil && len(*s.AuthorizedAwsRegion) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AuthorizedAwsRegion", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuthorizedAccountId sets the AuthorizedAccountId field's value. +func (s *DeleteAggregationAuthorizationInput) SetAuthorizedAccountId(v string) *DeleteAggregationAuthorizationInput { + s.AuthorizedAccountId = &v + return s +} + +// SetAuthorizedAwsRegion sets the AuthorizedAwsRegion field's value. +func (s *DeleteAggregationAuthorizationInput) SetAuthorizedAwsRegion(v string) *DeleteAggregationAuthorizationInput { + s.AuthorizedAwsRegion = &v + return s +} + +type DeleteAggregationAuthorizationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteAggregationAuthorizationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAggregationAuthorizationOutput) GoString() string { + return s.String() +} + +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 +} + +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() +} + +type DeleteConfigurationAggregatorInput struct { + _ struct{} `type:"structure"` + + // The name of the configuration aggregator. + // + // ConfigurationAggregatorName is a required field + ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteConfigurationAggregatorInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteConfigurationAggregatorInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteConfigurationAggregatorInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteConfigurationAggregatorInput"} + if s.ConfigurationAggregatorName == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) + } + if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. +func (s *DeleteConfigurationAggregatorInput) SetConfigurationAggregatorName(v string) *DeleteConfigurationAggregatorInput { + s.ConfigurationAggregatorName = &v + return s +} + +type DeleteConfigurationAggregatorOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteConfigurationAggregatorOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteConfigurationAggregatorOutput) GoString() string { + return s.String() +} + +// The request object for the DeleteConfigurationRecorder action. +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 } -// Indicates whether an AWS Config rule is compliant based on account ID, region, -// compliance, and rule name. -// -// A rule is compliant if all of the resources that the rule evaluated comply -// with it. It is noncompliant if any of these resources do not comply. -type AggregateComplianceByConfigRule struct { +type DeleteConfigurationRecorderOutput struct { _ struct{} `type:"structure"` +} - // The 12-digit account ID of the source account. - AccountId *string `type:"string"` +// String returns the string representation +func (s DeleteConfigurationRecorderOutput) String() string { + return awsutil.Prettify(s) +} - // The source region from where the data is aggregated. - AwsRegion *string `min:"1" type:"string"` +// GoString returns the string representation +func (s DeleteConfigurationRecorderOutput) GoString() string { + return s.String() +} - // Indicates whether an AWS resource or AWS Config rule is compliant and provides - // the number of contributors that affect the compliance. - Compliance *Compliance `type:"structure"` +type DeleteConformancePackInput struct { + _ struct{} `type:"structure"` - // The name of the AWS Config rule. - ConfigRuleName *string `min:"1" type:"string"` + // Name of the conformance pack you want to delete. + // + // ConformancePackName is a required field + ConformancePackName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s AggregateComplianceByConfigRule) String() string { +func (s DeleteConformancePackInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AggregateComplianceByConfigRule) GoString() string { +func (s DeleteConformancePackInput) GoString() string { return s.String() } -// SetAccountId sets the AccountId field's value. -func (s *AggregateComplianceByConfigRule) SetAccountId(v string) *AggregateComplianceByConfigRule { - s.AccountId = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteConformancePackInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteConformancePackInput"} + if s.ConformancePackName == nil { + invalidParams.Add(request.NewErrParamRequired("ConformancePackName")) + } + if s.ConformancePackName != nil && len(*s.ConformancePackName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConformancePackName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetAwsRegion sets the AwsRegion field's value. -func (s *AggregateComplianceByConfigRule) SetAwsRegion(v string) *AggregateComplianceByConfigRule { - s.AwsRegion = &v +// SetConformancePackName sets the ConformancePackName field's value. +func (s *DeleteConformancePackInput) SetConformancePackName(v string) *DeleteConformancePackInput { + s.ConformancePackName = &v return s } -// SetCompliance sets the Compliance field's value. -func (s *AggregateComplianceByConfigRule) SetCompliance(v *Compliance) *AggregateComplianceByConfigRule { - s.Compliance = v - return s +type DeleteConformancePackOutput struct { + _ struct{} `type:"structure"` } -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *AggregateComplianceByConfigRule) SetConfigRuleName(v string) *AggregateComplianceByConfigRule { - s.ConfigRuleName = &v - return s +// String returns the string representation +func (s DeleteConformancePackOutput) String() string { + return awsutil.Prettify(s) } -// Returns the number of compliant and noncompliant rules for one or more accounts -// and regions in an aggregator. -type AggregateComplianceCount struct { - _ struct{} `type:"structure"` +// GoString returns the string representation +func (s DeleteConformancePackOutput) GoString() string { + return s.String() +} - // The number of compliant and noncompliant AWS Config rules. - ComplianceSummary *ComplianceSummary `type:"structure"` +// The input for the DeleteDeliveryChannel action. The action accepts the following +// data, in JSON format. +type DeleteDeliveryChannelInput struct { + _ struct{} `type:"structure"` - // The 12-digit account ID or region based on the GroupByKey value. - GroupName *string `min:"1" type:"string"` + // 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 AggregateComplianceCount) String() string { +func (s DeleteDeliveryChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AggregateComplianceCount) GoString() string { +func (s DeleteDeliveryChannelInput) GoString() string { return s.String() } -// SetComplianceSummary sets the ComplianceSummary field's value. -func (s *AggregateComplianceCount) SetComplianceSummary(v *ComplianceSummary) *AggregateComplianceCount { - s.ComplianceSummary = v - return s +// 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 } -// SetGroupName sets the GroupName field's value. -func (s *AggregateComplianceCount) SetGroupName(v string) *AggregateComplianceCount { - s.GroupName = &v +// SetDeliveryChannelName sets the DeliveryChannelName field's value. +func (s *DeleteDeliveryChannelInput) SetDeliveryChannelName(v string) *DeleteDeliveryChannelInput { + s.DeliveryChannelName = &v return s } -// The details of an AWS Config evaluation for an account ID and region in an -// aggregator. Provides the AWS resource that was evaluated, the compliance -// of the resource, related time stamps, and supplementary information. -type AggregateEvaluationResult struct { +type DeleteDeliveryChannelOutput struct { _ struct{} `type:"structure"` +} - // The 12-digit account ID of the source account. - AccountId *string `type:"string"` +// String returns the string representation +func (s DeleteDeliveryChannelOutput) String() string { + return awsutil.Prettify(s) +} - // Supplementary information about how the agrregate evaluation determined the - // compliance. - Annotation *string `min:"1" type:"string"` +// GoString returns the string representation +func (s DeleteDeliveryChannelOutput) GoString() string { + return s.String() +} - // The source region from where the data is aggregated. - AwsRegion *string `min:"1" type:"string"` +type DeleteEvaluationResultsInput struct { + _ struct{} `type:"structure"` - // The resource compliance status. + // The name of the AWS Config rule for which you want to delete the evaluation + // results. // - // For the AggregationEvaluationResult data type, AWS Config supports only the - // COMPLIANT and NON_COMPLIANT. AWS Config does not support the NOT_APPLICABLE - // and INSUFFICIENT_DATA value. - ComplianceType *string `type:"string" enum:"ComplianceType"` - - // The time when the AWS Config rule evaluated the AWS resource. - ConfigRuleInvokedTime *time.Time `type:"timestamp"` - - // Uniquely identifies the evaluation result. - EvaluationResultIdentifier *EvaluationResultIdentifier `type:"structure"` - - // The time when AWS Config recorded the aggregate evaluation result. - ResultRecordedTime *time.Time `type:"timestamp"` + // ConfigRuleName is a required field + ConfigRuleName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s AggregateEvaluationResult) String() string { +func (s DeleteEvaluationResultsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AggregateEvaluationResult) GoString() string { +func (s DeleteEvaluationResultsInput) GoString() string { return s.String() } -// SetAccountId sets the AccountId field's value. -func (s *AggregateEvaluationResult) SetAccountId(v string) *AggregateEvaluationResult { - s.AccountId = &v - return s +// 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 } -// SetAnnotation sets the Annotation field's value. -func (s *AggregateEvaluationResult) SetAnnotation(v string) *AggregateEvaluationResult { - s.Annotation = &v +// SetConfigRuleName sets the ConfigRuleName field's value. +func (s *DeleteEvaluationResultsInput) SetConfigRuleName(v string) *DeleteEvaluationResultsInput { + s.ConfigRuleName = &v return s } -// SetAwsRegion sets the AwsRegion field's value. -func (s *AggregateEvaluationResult) SetAwsRegion(v string) *AggregateEvaluationResult { - s.AwsRegion = &v - return s +// The output when you delete the evaluation results for the specified AWS Config +// rule. +type DeleteEvaluationResultsOutput struct { + _ struct{} `type:"structure"` } -// SetComplianceType sets the ComplianceType field's value. -func (s *AggregateEvaluationResult) SetComplianceType(v string) *AggregateEvaluationResult { - s.ComplianceType = &v - return s +// String returns the string representation +func (s DeleteEvaluationResultsOutput) String() string { + return awsutil.Prettify(s) } -// SetConfigRuleInvokedTime sets the ConfigRuleInvokedTime field's value. -func (s *AggregateEvaluationResult) SetConfigRuleInvokedTime(v time.Time) *AggregateEvaluationResult { - s.ConfigRuleInvokedTime = &v - return s +// GoString returns the string representation +func (s DeleteEvaluationResultsOutput) GoString() string { + return s.String() } -// SetEvaluationResultIdentifier sets the EvaluationResultIdentifier field's value. -func (s *AggregateEvaluationResult) SetEvaluationResultIdentifier(v *EvaluationResultIdentifier) *AggregateEvaluationResult { - s.EvaluationResultIdentifier = v - return s +type DeleteOrganizationConfigRuleInput struct { + _ struct{} `type:"structure"` + + // The name of organization config rule that you want to delete. + // + // OrganizationConfigRuleName is a required field + OrganizationConfigRuleName *string `min:"1" type:"string" required:"true"` } -// SetResultRecordedTime sets the ResultRecordedTime field's value. -func (s *AggregateEvaluationResult) SetResultRecordedTime(v time.Time) *AggregateEvaluationResult { - s.ResultRecordedTime = &v +// String returns the string representation +func (s DeleteOrganizationConfigRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteOrganizationConfigRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteOrganizationConfigRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteOrganizationConfigRuleInput"} + if s.OrganizationConfigRuleName == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationConfigRuleName")) + } + if s.OrganizationConfigRuleName != nil && len(*s.OrganizationConfigRuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OrganizationConfigRuleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOrganizationConfigRuleName sets the OrganizationConfigRuleName field's value. +func (s *DeleteOrganizationConfigRuleInput) SetOrganizationConfigRuleName(v string) *DeleteOrganizationConfigRuleInput { + s.OrganizationConfigRuleName = &v return s } -// The details that identify a resource that is collected by AWS Config aggregator, -// including the resource type, ID, (if available) the custom resource name, -// the source account, and source region. -type AggregateResourceIdentifier struct { +type DeleteOrganizationConfigRuleOutput struct { _ struct{} `type:"structure"` +} - // The ID of the AWS resource. - // - // ResourceId is a required field - ResourceId *string `min:"1" type:"string" required:"true"` - - // The name of the AWS resource. - ResourceName *string `type:"string"` +// String returns the string representation +func (s DeleteOrganizationConfigRuleOutput) String() string { + return awsutil.Prettify(s) +} - // The type of the AWS resource. - // - // ResourceType is a required field - ResourceType *string `type:"string" required:"true" enum:"ResourceType"` +// GoString returns the string representation +func (s DeleteOrganizationConfigRuleOutput) GoString() string { + return s.String() +} - // The 12-digit account ID of the source account. - // - // SourceAccountId is a required field - SourceAccountId *string `type:"string" required:"true"` +type DeleteOrganizationConformancePackInput struct { + _ struct{} `type:"structure"` - // The source region where data is aggregated. + // The name of organization conformance pack that you want to delete. // - // SourceRegion is a required field - SourceRegion *string `min:"1" type:"string" required:"true"` + // OrganizationConformancePackName is a required field + OrganizationConformancePackName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s AggregateResourceIdentifier) String() string { +func (s DeleteOrganizationConformancePackInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AggregateResourceIdentifier) GoString() string { +func (s DeleteOrganizationConformancePackInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *AggregateResourceIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AggregateResourceIdentifier"} - 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.SourceAccountId == nil { - invalidParams.Add(request.NewErrParamRequired("SourceAccountId")) +func (s *DeleteOrganizationConformancePackInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteOrganizationConformancePackInput"} + if s.OrganizationConformancePackName == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationConformancePackName")) } - if s.SourceRegion == nil { - invalidParams.Add(request.NewErrParamRequired("SourceRegion")) - } - if s.SourceRegion != nil && len(*s.SourceRegion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SourceRegion", 1)) + if s.OrganizationConformancePackName != nil && len(*s.OrganizationConformancePackName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OrganizationConformancePackName", 1)) } if invalidParams.Len() > 0 { @@ -6561,365 +11153,293 @@ func (s *AggregateResourceIdentifier) Validate() error { return nil } -// SetResourceId sets the ResourceId field's value. -func (s *AggregateResourceIdentifier) SetResourceId(v string) *AggregateResourceIdentifier { - s.ResourceId = &v - return s -} - -// SetResourceName sets the ResourceName field's value. -func (s *AggregateResourceIdentifier) SetResourceName(v string) *AggregateResourceIdentifier { - s.ResourceName = &v +// SetOrganizationConformancePackName sets the OrganizationConformancePackName field's value. +func (s *DeleteOrganizationConformancePackInput) SetOrganizationConformancePackName(v string) *DeleteOrganizationConformancePackInput { + s.OrganizationConformancePackName = &v return s } -// SetResourceType sets the ResourceType field's value. -func (s *AggregateResourceIdentifier) SetResourceType(v string) *AggregateResourceIdentifier { - s.ResourceType = &v - return s +type DeleteOrganizationConformancePackOutput struct { + _ struct{} `type:"structure"` } -// SetSourceAccountId sets the SourceAccountId field's value. -func (s *AggregateResourceIdentifier) SetSourceAccountId(v string) *AggregateResourceIdentifier { - s.SourceAccountId = &v - return s +// String returns the string representation +func (s DeleteOrganizationConformancePackOutput) String() string { + return awsutil.Prettify(s) } -// SetSourceRegion sets the SourceRegion field's value. -func (s *AggregateResourceIdentifier) SetSourceRegion(v string) *AggregateResourceIdentifier { - s.SourceRegion = &v - return s +// GoString returns the string representation +func (s DeleteOrganizationConformancePackOutput) GoString() string { + return s.String() } -// The current sync status between the source and the aggregator account. -type AggregatedSourceStatus struct { +type DeletePendingAggregationRequestInput struct { _ struct{} `type:"structure"` - // The region authorized to collect aggregated data. - AwsRegion *string `min:"1" type:"string"` - - // The error code that AWS Config returned when the source account aggregation - // last failed. - LastErrorCode *string `type:"string"` - - // The message indicating that the source account aggregation failed due to - // an error. - LastErrorMessage *string `type:"string"` - - // Filters the last updated status type. - // - // * Valid value FAILED indicates errors while moving data. - // - // * Valid value SUCCEEDED indicates the data was successfully moved. + // The 12-digit account ID of the account requesting to aggregate data. // - // * Valid value OUTDATED indicates the data is not the most recent. - LastUpdateStatus *string `type:"string" enum:"AggregatedSourceStatusType"` - - // The time of the last update. - LastUpdateTime *time.Time `type:"timestamp"` - - // The source account ID or an organization. - SourceId *string `type:"string"` + // RequesterAccountId is a required field + RequesterAccountId *string `type:"string" required:"true"` - // The source account or an organization. - SourceType *string `type:"string" enum:"AggregatedSourceType"` + // The region requesting to aggregate data. + // + // RequesterAwsRegion is a required field + RequesterAwsRegion *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s AggregatedSourceStatus) String() string { +func (s DeletePendingAggregationRequestInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AggregatedSourceStatus) GoString() string { +func (s DeletePendingAggregationRequestInput) GoString() string { return s.String() } -// SetAwsRegion sets the AwsRegion field's value. -func (s *AggregatedSourceStatus) SetAwsRegion(v string) *AggregatedSourceStatus { - s.AwsRegion = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeletePendingAggregationRequestInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeletePendingAggregationRequestInput"} + if s.RequesterAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("RequesterAccountId")) + } + if s.RequesterAwsRegion == nil { + invalidParams.Add(request.NewErrParamRequired("RequesterAwsRegion")) + } + if s.RequesterAwsRegion != nil && len(*s.RequesterAwsRegion) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RequesterAwsRegion", 1)) + } -// SetLastErrorCode sets the LastErrorCode field's value. -func (s *AggregatedSourceStatus) SetLastErrorCode(v string) *AggregatedSourceStatus { - s.LastErrorCode = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetLastErrorMessage sets the LastErrorMessage field's value. -func (s *AggregatedSourceStatus) SetLastErrorMessage(v string) *AggregatedSourceStatus { - s.LastErrorMessage = &v +// SetRequesterAccountId sets the RequesterAccountId field's value. +func (s *DeletePendingAggregationRequestInput) SetRequesterAccountId(v string) *DeletePendingAggregationRequestInput { + s.RequesterAccountId = &v return s } -// SetLastUpdateStatus sets the LastUpdateStatus field's value. -func (s *AggregatedSourceStatus) SetLastUpdateStatus(v string) *AggregatedSourceStatus { - s.LastUpdateStatus = &v +// SetRequesterAwsRegion sets the RequesterAwsRegion field's value. +func (s *DeletePendingAggregationRequestInput) SetRequesterAwsRegion(v string) *DeletePendingAggregationRequestInput { + s.RequesterAwsRegion = &v return s } -// SetLastUpdateTime sets the LastUpdateTime field's value. -func (s *AggregatedSourceStatus) SetLastUpdateTime(v time.Time) *AggregatedSourceStatus { - s.LastUpdateTime = &v - return s +type DeletePendingAggregationRequestOutput struct { + _ struct{} `type:"structure"` } -// SetSourceId sets the SourceId field's value. -func (s *AggregatedSourceStatus) SetSourceId(v string) *AggregatedSourceStatus { - s.SourceId = &v - return s +// String returns the string representation +func (s DeletePendingAggregationRequestOutput) String() string { + return awsutil.Prettify(s) } -// SetSourceType sets the SourceType field's value. -func (s *AggregatedSourceStatus) SetSourceType(v string) *AggregatedSourceStatus { - s.SourceType = &v - return s +// GoString returns the string representation +func (s DeletePendingAggregationRequestOutput) GoString() string { + return s.String() } -// An object that represents the authorizations granted to aggregator accounts -// and regions. -type AggregationAuthorization struct { +type DeleteRemediationConfigurationInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the aggregation object. - AggregationAuthorizationArn *string `type:"string"` - - // The 12-digit account ID of the account authorized to aggregate data. - AuthorizedAccountId *string `type:"string"` - - // The region authorized to collect aggregated data. - AuthorizedAwsRegion *string `min:"1" type:"string"` + // The name of the AWS Config rule for which you want to delete remediation + // configuration. + // + // ConfigRuleName is a required field + ConfigRuleName *string `min:"1" type:"string" required:"true"` - // The time stamp when the aggregation authorization was created. - CreationTime *time.Time `type:"timestamp"` + // The type of a resource. + ResourceType *string `type:"string"` } // String returns the string representation -func (s AggregationAuthorization) String() string { +func (s DeleteRemediationConfigurationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AggregationAuthorization) GoString() string { +func (s DeleteRemediationConfigurationInput) GoString() string { return s.String() } -// SetAggregationAuthorizationArn sets the AggregationAuthorizationArn field's value. -func (s *AggregationAuthorization) SetAggregationAuthorizationArn(v string) *AggregationAuthorization { - s.AggregationAuthorizationArn = &v - return s -} - -// SetAuthorizedAccountId sets the AuthorizedAccountId field's value. -func (s *AggregationAuthorization) SetAuthorizedAccountId(v string) *AggregationAuthorization { - s.AuthorizedAccountId = &v - return s -} - -// SetAuthorizedAwsRegion sets the AuthorizedAwsRegion field's value. -func (s *AggregationAuthorization) SetAuthorizedAwsRegion(v string) *AggregationAuthorization { - s.AuthorizedAwsRegion = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *AggregationAuthorization) SetCreationTime(v time.Time) *AggregationAuthorization { - s.CreationTime = &v - return s -} - -// The detailed configuration of a specified resource. -type BaseConfigurationItem 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" min:"1" 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"` - - // 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"` - - // The time stamp when the resource was created. - ResourceCreationTime *time.Time `locationName:"resourceCreationTime" type:"timestamp"` - - // The ID of the resource (for example., sg-xxxxxx). - ResourceId *string `locationName:"resourceId" min:"1" type:"string"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteRemediationConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteRemediationConfigurationInput"} + if s.ConfigRuleName == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigRuleName")) + } + if s.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) + } - // The custom name of the resource, if available. - ResourceName *string `locationName:"resourceName" type:"string"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // The type of AWS resource. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` +// SetConfigRuleName sets the ConfigRuleName field's value. +func (s *DeleteRemediationConfigurationInput) SetConfigRuleName(v string) *DeleteRemediationConfigurationInput { + s.ConfigRuleName = &v + return s +} - // 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"` +// SetResourceType sets the ResourceType field's value. +func (s *DeleteRemediationConfigurationInput) SetResourceType(v string) *DeleteRemediationConfigurationInput { + s.ResourceType = &v + return s +} - // The version number of the resource configuration. - Version *string `locationName:"version" type:"string"` +type DeleteRemediationConfigurationOutput struct { + _ struct{} `type:"structure"` } // String returns the string representation -func (s BaseConfigurationItem) String() string { +func (s DeleteRemediationConfigurationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BaseConfigurationItem) GoString() string { +func (s DeleteRemediationConfigurationOutput) GoString() string { return s.String() } -// SetAccountId sets the AccountId field's value. -func (s *BaseConfigurationItem) SetAccountId(v string) *BaseConfigurationItem { - s.AccountId = &v - return s -} +type DeleteRemediationExceptionsInput struct { + _ struct{} `type:"structure"` -// SetArn sets the Arn field's value. -func (s *BaseConfigurationItem) SetArn(v string) *BaseConfigurationItem { - s.Arn = &v - return s -} + // The name of the AWS Config rule for which you want to delete remediation + // exception configuration. + // + // ConfigRuleName is a required field + ConfigRuleName *string `min:"1" type:"string" required:"true"` -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *BaseConfigurationItem) SetAvailabilityZone(v string) *BaseConfigurationItem { - s.AvailabilityZone = &v - return s + // An exception list of resource exception keys to be processed with the current + // request. AWS Config adds exception for each resource key. For example, AWS + // Config adds 3 exceptions for 3 resource keys. + // + // ResourceKeys is a required field + ResourceKeys []*RemediationExceptionResourceKey `min:"1" type:"list" required:"true"` } -// SetAwsRegion sets the AwsRegion field's value. -func (s *BaseConfigurationItem) SetAwsRegion(v string) *BaseConfigurationItem { - s.AwsRegion = &v - return s +// String returns the string representation +func (s DeleteRemediationExceptionsInput) String() string { + return awsutil.Prettify(s) } -// SetConfiguration sets the Configuration field's value. -func (s *BaseConfigurationItem) SetConfiguration(v string) *BaseConfigurationItem { - s.Configuration = &v - return s +// GoString returns the string representation +func (s DeleteRemediationExceptionsInput) GoString() string { + return s.String() } -// SetConfigurationItemCaptureTime sets the ConfigurationItemCaptureTime field's value. -func (s *BaseConfigurationItem) SetConfigurationItemCaptureTime(v time.Time) *BaseConfigurationItem { - s.ConfigurationItemCaptureTime = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteRemediationExceptionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteRemediationExceptionsInput"} + if s.ConfigRuleName == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigRuleName")) + } + if s.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) + } + if s.ResourceKeys == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceKeys")) + } + if s.ResourceKeys != nil && len(s.ResourceKeys) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceKeys", 1)) + } + if s.ResourceKeys != nil { + for i, v := range s.ResourceKeys { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceKeys", i), err.(request.ErrInvalidParams)) + } + } + } -// SetConfigurationItemStatus sets the ConfigurationItemStatus field's value. -func (s *BaseConfigurationItem) SetConfigurationItemStatus(v string) *BaseConfigurationItem { - s.ConfigurationItemStatus = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetConfigurationStateId sets the ConfigurationStateId field's value. -func (s *BaseConfigurationItem) SetConfigurationStateId(v string) *BaseConfigurationItem { - s.ConfigurationStateId = &v +// SetConfigRuleName sets the ConfigRuleName field's value. +func (s *DeleteRemediationExceptionsInput) SetConfigRuleName(v string) *DeleteRemediationExceptionsInput { + s.ConfigRuleName = &v return s } -// SetResourceCreationTime sets the ResourceCreationTime field's value. -func (s *BaseConfigurationItem) SetResourceCreationTime(v time.Time) *BaseConfigurationItem { - s.ResourceCreationTime = &v +// SetResourceKeys sets the ResourceKeys field's value. +func (s *DeleteRemediationExceptionsInput) SetResourceKeys(v []*RemediationExceptionResourceKey) *DeleteRemediationExceptionsInput { + s.ResourceKeys = v return s } -// SetResourceId sets the ResourceId field's value. -func (s *BaseConfigurationItem) SetResourceId(v string) *BaseConfigurationItem { - s.ResourceId = &v - return s -} +type DeleteRemediationExceptionsOutput struct { + _ struct{} `type:"structure"` -// SetResourceName sets the ResourceName field's value. -func (s *BaseConfigurationItem) SetResourceName(v string) *BaseConfigurationItem { - s.ResourceName = &v - return s + // Returns a list of failed delete remediation exceptions batch objects. Each + // object in the batch consists of a list of failed items and failure messages. + FailedBatches []*FailedDeleteRemediationExceptionsBatch `type:"list"` } -// SetResourceType sets the ResourceType field's value. -func (s *BaseConfigurationItem) SetResourceType(v string) *BaseConfigurationItem { - s.ResourceType = &v - return s +// String returns the string representation +func (s DeleteRemediationExceptionsOutput) String() string { + return awsutil.Prettify(s) } -// SetSupplementaryConfiguration sets the SupplementaryConfiguration field's value. -func (s *BaseConfigurationItem) SetSupplementaryConfiguration(v map[string]*string) *BaseConfigurationItem { - s.SupplementaryConfiguration = v - return s +// GoString returns the string representation +func (s DeleteRemediationExceptionsOutput) GoString() string { + return s.String() } -// SetVersion sets the Version field's value. -func (s *BaseConfigurationItem) SetVersion(v string) *BaseConfigurationItem { - s.Version = &v +// SetFailedBatches sets the FailedBatches field's value. +func (s *DeleteRemediationExceptionsOutput) SetFailedBatches(v []*FailedDeleteRemediationExceptionsBatch) *DeleteRemediationExceptionsOutput { + s.FailedBatches = v return s } -type BatchGetAggregateResourceConfigInput struct { +type DeleteResourceConfigInput struct { _ struct{} `type:"structure"` - // The name of the configuration aggregator. + // Unique identifier of the resource. // - // ConfigurationAggregatorName is a required field - ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` + // ResourceId is a required field + ResourceId *string `min:"1" type:"string" required:"true"` - // A list of aggregate ResourceIdentifiers objects. + // The type of the resource. // - // ResourceIdentifiers is a required field - ResourceIdentifiers []*AggregateResourceIdentifier `min:"1" type:"list" required:"true"` + // ResourceType is a required field + ResourceType *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s BatchGetAggregateResourceConfigInput) String() string { +func (s DeleteResourceConfigInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchGetAggregateResourceConfigInput) GoString() string { +func (s DeleteResourceConfigInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetAggregateResourceConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetAggregateResourceConfigInput"} - if s.ConfigurationAggregatorName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) - } - if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) +func (s *DeleteResourceConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteResourceConfigInput"} + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) } - if s.ResourceIdentifiers == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIdentifiers")) + if s.ResourceId != nil && len(*s.ResourceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) } - if s.ResourceIdentifiers != nil && len(s.ResourceIdentifiers) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceIdentifiers", 1)) + if s.ResourceType == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceType")) } - if s.ResourceIdentifiers != nil { - for i, v := range s.ResourceIdentifiers { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceIdentifiers", i), err.(request.ErrInvalidParams)) - } - } + if s.ResourceType != nil && len(*s.ResourceType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceType", 1)) } if invalidParams.Len() > 0 { @@ -6928,89 +11448,115 @@ func (s *BatchGetAggregateResourceConfigInput) Validate() error { return nil } -// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. -func (s *BatchGetAggregateResourceConfigInput) SetConfigurationAggregatorName(v string) *BatchGetAggregateResourceConfigInput { - s.ConfigurationAggregatorName = &v +// SetResourceId sets the ResourceId field's value. +func (s *DeleteResourceConfigInput) SetResourceId(v string) *DeleteResourceConfigInput { + s.ResourceId = &v return s } -// SetResourceIdentifiers sets the ResourceIdentifiers field's value. -func (s *BatchGetAggregateResourceConfigInput) SetResourceIdentifiers(v []*AggregateResourceIdentifier) *BatchGetAggregateResourceConfigInput { - s.ResourceIdentifiers = v +// SetResourceType sets the ResourceType field's value. +func (s *DeleteResourceConfigInput) SetResourceType(v string) *DeleteResourceConfigInput { + s.ResourceType = &v return s } -type BatchGetAggregateResourceConfigOutput struct { +type DeleteResourceConfigOutput struct { _ struct{} `type:"structure"` +} - // A list that contains the current configuration of one or more resources. - BaseConfigurationItems []*BaseConfigurationItem `type:"list"` +// String returns the string representation +func (s DeleteResourceConfigOutput) String() string { + return awsutil.Prettify(s) +} - // A list of resource identifiers that were not processed with current scope. - // The list is empty if all the resources are processed. - UnprocessedResourceIdentifiers []*AggregateResourceIdentifier `type:"list"` +// GoString returns the string representation +func (s DeleteResourceConfigOutput) GoString() string { + return s.String() +} + +type DeleteRetentionConfigurationInput struct { + _ struct{} `type:"structure"` + + // The name of the retention configuration to delete. + // + // RetentionConfigurationName is a required field + RetentionConfigurationName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s BatchGetAggregateResourceConfigOutput) String() string { +func (s DeleteRetentionConfigurationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchGetAggregateResourceConfigOutput) GoString() string { +func (s DeleteRetentionConfigurationInput) GoString() string { return s.String() } -// SetBaseConfigurationItems sets the BaseConfigurationItems field's value. -func (s *BatchGetAggregateResourceConfigOutput) SetBaseConfigurationItems(v []*BaseConfigurationItem) *BatchGetAggregateResourceConfigOutput { - s.BaseConfigurationItems = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteRetentionConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteRetentionConfigurationInput"} + if s.RetentionConfigurationName == nil { + invalidParams.Add(request.NewErrParamRequired("RetentionConfigurationName")) + } + if s.RetentionConfigurationName != nil && len(*s.RetentionConfigurationName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RetentionConfigurationName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRetentionConfigurationName sets the RetentionConfigurationName field's value. +func (s *DeleteRetentionConfigurationInput) SetRetentionConfigurationName(v string) *DeleteRetentionConfigurationInput { + s.RetentionConfigurationName = &v return s } -// SetUnprocessedResourceIdentifiers sets the UnprocessedResourceIdentifiers field's value. -func (s *BatchGetAggregateResourceConfigOutput) SetUnprocessedResourceIdentifiers(v []*AggregateResourceIdentifier) *BatchGetAggregateResourceConfigOutput { - s.UnprocessedResourceIdentifiers = v - return s +type DeleteRetentionConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteRetentionConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRetentionConfigurationOutput) GoString() string { + return s.String() } -type BatchGetResourceConfigInput struct { +// The input for the DeliverConfigSnapshot action. +type DeliverConfigSnapshotInput struct { _ struct{} `type:"structure"` - // A list of resource keys to be processed with the current request. Each element - // in the list consists of the resource type and resource ID. + // The name of the delivery channel through which the snapshot is delivered. // - // ResourceKeys is a required field - ResourceKeys []*ResourceKey `locationName:"resourceKeys" min:"1" type:"list" required:"true"` + // DeliveryChannelName is a required field + DeliveryChannelName *string `locationName:"deliveryChannelName" min:"1" type:"string" required:"true"` } // String returns the string representation -func (s BatchGetResourceConfigInput) String() string { +func (s DeliverConfigSnapshotInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchGetResourceConfigInput) GoString() string { +func (s DeliverConfigSnapshotInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *BatchGetResourceConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchGetResourceConfigInput"} - if s.ResourceKeys == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceKeys")) - } - if s.ResourceKeys != nil && len(s.ResourceKeys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceKeys", 1)) +func (s *DeliverConfigSnapshotInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeliverConfigSnapshotInput"} + if s.DeliveryChannelName == nil { + invalidParams.Add(request.NewErrParamRequired("DeliveryChannelName")) } - if s.ResourceKeys != nil { - for i, v := range s.ResourceKeys { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceKeys", i), err.(request.ErrInvalidParams)) - } - } + if s.DeliveryChannelName != nil && len(*s.DeliveryChannelName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DeliveryChannelName", 1)) } if invalidParams.Len() > 0 { @@ -7019,482 +11565,482 @@ func (s *BatchGetResourceConfigInput) Validate() error { return nil } -// SetResourceKeys sets the ResourceKeys field's value. -func (s *BatchGetResourceConfigInput) SetResourceKeys(v []*ResourceKey) *BatchGetResourceConfigInput { - s.ResourceKeys = v +// SetDeliveryChannelName sets the DeliveryChannelName field's value. +func (s *DeliverConfigSnapshotInput) SetDeliveryChannelName(v string) *DeliverConfigSnapshotInput { + s.DeliveryChannelName = &v return s } -type BatchGetResourceConfigOutput struct { +// The output for the DeliverConfigSnapshot action, in JSON format. +type DeliverConfigSnapshotOutput struct { _ struct{} `type:"structure"` - // A list that contains the current configuration of one or more resources. - BaseConfigurationItems []*BaseConfigurationItem `locationName:"baseConfigurationItems" type:"list"` - - // A list of resource keys that were not processed with the current response. - // The unprocessesResourceKeys value is in the same form as ResourceKeys, so - // the value can be directly provided to a subsequent BatchGetResourceConfig - // operation. If there are no unprocessed resource keys, the response contains - // an empty unprocessedResourceKeys list. - UnprocessedResourceKeys []*ResourceKey `locationName:"unprocessedResourceKeys" min:"1" type:"list"` + // The ID of the snapshot that is being created. + ConfigSnapshotId *string `locationName:"configSnapshotId" type:"string"` } // String returns the string representation -func (s BatchGetResourceConfigOutput) String() string { +func (s DeliverConfigSnapshotOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchGetResourceConfigOutput) GoString() string { +func (s DeliverConfigSnapshotOutput) GoString() string { return s.String() } -// SetBaseConfigurationItems sets the BaseConfigurationItems field's value. -func (s *BatchGetResourceConfigOutput) SetBaseConfigurationItems(v []*BaseConfigurationItem) *BatchGetResourceConfigOutput { - s.BaseConfigurationItems = v - return s -} - -// SetUnprocessedResourceKeys sets the UnprocessedResourceKeys field's value. -func (s *BatchGetResourceConfigOutput) SetUnprocessedResourceKeys(v []*ResourceKey) *BatchGetResourceConfigOutput { - s.UnprocessedResourceKeys = v +// SetConfigSnapshotId sets the ConfigSnapshotId field's value. +func (s *DeliverConfigSnapshotOutput) SetConfigSnapshotId(v string) *DeliverConfigSnapshotOutput { + s.ConfigSnapshotId = &v return s } -// Indicates whether an AWS resource or AWS Config rule is compliant and provides -// the number of contributors that affect the compliance. -type Compliance struct { +// The channel through which AWS Config delivers notifications and updated configuration +// states. +type DeliveryChannel 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"` + // The options for how often AWS Config delivers configuration snapshots to + // the Amazon S3 bucket. + ConfigSnapshotDeliveryProperties *ConfigSnapshotDeliveryProperties `locationName:"configSnapshotDeliveryProperties" 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. A resource 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. A rule is noncompliant if any of these resources do not comply. + // 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. // - // AWS Config returns the INSUFFICIENT_DATA value when no evaluation results - // are available for the AWS resource or AWS Config rule. + // 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 (https://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. // - // 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"` + // 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 (https://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 Compliance) String() string { +func (s DeliveryChannel) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Compliance) GoString() string { +func (s DeliveryChannel) GoString() string { return s.String() } -// SetComplianceContributorCount sets the ComplianceContributorCount field's value. -func (s *Compliance) SetComplianceContributorCount(v *ComplianceContributorCount) *Compliance { - s.ComplianceContributorCount = v +// 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 } -// SetComplianceType sets the ComplianceType field's value. -func (s *Compliance) SetComplianceType(v string) *Compliance { - s.ComplianceType = &v +// SetName sets the Name field's value. +func (s *DeliveryChannel) SetName(v string) *DeliveryChannel { + s.Name = &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. A rule is noncompliant -// if any of these resources do not comply. -type ComplianceByConfigRule struct { +// 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 +type DeliveryChannelStatus struct { _ struct{} `type:"structure"` - // Indicates whether the AWS Config rule is compliant. - Compliance *Compliance `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"` - // The name of the AWS Config rule. - ConfigRuleName *string `min:"1" type:"string"` + // 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 ComplianceByConfigRule) String() string { +func (s DeliveryChannelStatus) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ComplianceByConfigRule) GoString() string { +func (s DeliveryChannelStatus) GoString() string { return s.String() } -// SetCompliance sets the Compliance field's value. -func (s *ComplianceByConfigRule) SetCompliance(v *Compliance) *ComplianceByConfigRule { - s.Compliance = v +// SetConfigHistoryDeliveryInfo sets the ConfigHistoryDeliveryInfo field's value. +func (s *DeliveryChannelStatus) SetConfigHistoryDeliveryInfo(v *ConfigExportDeliveryInfo) *DeliveryChannelStatus { + s.ConfigHistoryDeliveryInfo = v return s } -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *ComplianceByConfigRule) SetConfigRuleName(v string) *ComplianceByConfigRule { - s.ConfigRuleName = &v +// SetConfigSnapshotDeliveryInfo sets the ConfigSnapshotDeliveryInfo field's value. +func (s *DeliveryChannelStatus) SetConfigSnapshotDeliveryInfo(v *ConfigExportDeliveryInfo) *DeliveryChannelStatus { + s.ConfigSnapshotDeliveryInfo = 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. A resource is noncompliant if it does -// not comply with one or more of these rules. -type ComplianceByResource struct { +// 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 +} + +type DescribeAggregateComplianceByConfigRulesInput 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 name of the configuration aggregator. + // + // ConfigurationAggregatorName is a required field + ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` - // The ID of the AWS resource that was evaluated. - ResourceId *string `min:"1" type:"string"` + // Filters the results by ConfigRuleComplianceFilters object. + Filters *ConfigRuleComplianceFilters `type:"structure"` - // The type of the AWS resource that was evaluated. - ResourceType *string `min:"1" type:"string"` + // The maximum number of evaluation results returned on each page. The default + // is maximum. 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 ComplianceByResource) String() string { +func (s DescribeAggregateComplianceByConfigRulesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ComplianceByResource) GoString() string { +func (s DescribeAggregateComplianceByConfigRulesInput) GoString() string { return s.String() } -// SetCompliance sets the Compliance field's value. -func (s *ComplianceByResource) SetCompliance(v *Compliance) *ComplianceByResource { - s.Compliance = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeAggregateComplianceByConfigRulesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeAggregateComplianceByConfigRulesInput"} + if s.ConfigurationAggregatorName == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) + } + if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) + } + if s.Filters != nil { + if err := s.Filters.Validate(); err != nil { + invalidParams.AddNested("Filters", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. +func (s *DescribeAggregateComplianceByConfigRulesInput) SetConfigurationAggregatorName(v string) *DescribeAggregateComplianceByConfigRulesInput { + s.ConfigurationAggregatorName = &v return s } -// SetResourceId sets the ResourceId field's value. -func (s *ComplianceByResource) SetResourceId(v string) *ComplianceByResource { - s.ResourceId = &v +// SetFilters sets the Filters field's value. +func (s *DescribeAggregateComplianceByConfigRulesInput) SetFilters(v *ConfigRuleComplianceFilters) *DescribeAggregateComplianceByConfigRulesInput { + s.Filters = v return s } -// SetResourceType sets the ResourceType field's value. -func (s *ComplianceByResource) SetResourceType(v string) *ComplianceByResource { - s.ResourceType = &v +// SetLimit sets the Limit field's value. +func (s *DescribeAggregateComplianceByConfigRulesInput) SetLimit(v int64) *DescribeAggregateComplianceByConfigRulesInput { + s.Limit = &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. -type ComplianceContributorCount struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeAggregateComplianceByConfigRulesInput) SetNextToken(v string) *DescribeAggregateComplianceByConfigRulesInput { + s.NextToken = &v + return s +} + +type DescribeAggregateComplianceByConfigRulesOutput struct { _ struct{} `type:"structure"` - // Indicates whether the maximum count is reached. - CapExceeded *bool `type:"boolean"` + // Returns a list of AggregateComplianceByConfigRule object. + AggregateComplianceByConfigRules []*AggregateComplianceByConfigRule `type:"list"` - // The number of AWS resources or AWS Config rules responsible for the current - // compliance of the item. - CappedCount *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 ComplianceContributorCount) String() string { +func (s DescribeAggregateComplianceByConfigRulesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ComplianceContributorCount) GoString() string { +func (s DescribeAggregateComplianceByConfigRulesOutput) GoString() string { return s.String() } -// SetCapExceeded sets the CapExceeded field's value. -func (s *ComplianceContributorCount) SetCapExceeded(v bool) *ComplianceContributorCount { - s.CapExceeded = &v +// SetAggregateComplianceByConfigRules sets the AggregateComplianceByConfigRules field's value. +func (s *DescribeAggregateComplianceByConfigRulesOutput) SetAggregateComplianceByConfigRules(v []*AggregateComplianceByConfigRule) *DescribeAggregateComplianceByConfigRulesOutput { + s.AggregateComplianceByConfigRules = v return s } -// SetCappedCount sets the CappedCount field's value. -func (s *ComplianceContributorCount) SetCappedCount(v int64) *ComplianceContributorCount { - s.CappedCount = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeAggregateComplianceByConfigRulesOutput) SetNextToken(v string) *DescribeAggregateComplianceByConfigRulesOutput { + s.NextToken = &v return s } -// The number of AWS Config rules or AWS resources that are compliant and noncompliant. -type ComplianceSummary struct { +type DescribeAggregationAuthorizationsInput struct { _ struct{} `type:"structure"` - // The time that AWS Config created the compliance summary. - ComplianceSummaryTimestamp *time.Time `type:"timestamp"` - - // 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 maximum number of AggregationAuthorizations returned on each page. The + // default is maximum. If you specify 0, AWS Config uses the default. + Limit *int64 `type:"integer"` - // 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"` + // 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 ComplianceSummary) String() string { +func (s DescribeAggregationAuthorizationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ComplianceSummary) GoString() string { +func (s DescribeAggregationAuthorizationsInput) 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 +// SetLimit sets the Limit field's value. +func (s *DescribeAggregationAuthorizationsInput) SetLimit(v int64) *DescribeAggregationAuthorizationsInput { + s.Limit = &v return s } -// SetNonCompliantResourceCount sets the NonCompliantResourceCount field's value. -func (s *ComplianceSummary) SetNonCompliantResourceCount(v *ComplianceContributorCount) *ComplianceSummary { - s.NonCompliantResourceCount = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeAggregationAuthorizationsInput) SetNextToken(v string) *DescribeAggregationAuthorizationsInput { + s.NextToken = &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. -type ComplianceSummaryByResourceType struct { +type DescribeAggregationAuthorizationsOutput struct { _ struct{} `type:"structure"` - // The number of AWS resources that are compliant or noncompliant, up to a maximum - // of 100 for each. - ComplianceSummary *ComplianceSummary `type:"structure"` + // Returns a list of authorizations granted to various aggregator accounts and + // regions. + AggregationAuthorizations []*AggregationAuthorization `type:"list"` - // The type of AWS resource. - ResourceType *string `min:"1" type:"string"` + // 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 ComplianceSummaryByResourceType) String() string { +func (s DescribeAggregationAuthorizationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ComplianceSummaryByResourceType) GoString() string { +func (s DescribeAggregationAuthorizationsOutput) GoString() string { return s.String() } -// SetComplianceSummary sets the ComplianceSummary field's value. -func (s *ComplianceSummaryByResourceType) SetComplianceSummary(v *ComplianceSummary) *ComplianceSummaryByResourceType { - s.ComplianceSummary = v +// SetAggregationAuthorizations sets the AggregationAuthorizations field's value. +func (s *DescribeAggregationAuthorizationsOutput) SetAggregationAuthorizations(v []*AggregationAuthorization) *DescribeAggregationAuthorizationsOutput { + s.AggregationAuthorizations = v return s } -// SetResourceType sets the ResourceType field's value. -func (s *ComplianceSummaryByResourceType) SetResourceType(v string) *ComplianceSummaryByResourceType { - s.ResourceType = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeAggregationAuthorizationsOutput) SetNextToken(v string) *DescribeAggregationAuthorizationsOutput { + s.NextToken = &v return s } -// Provides status of the delivery of the snapshot or the configuration history -// to the specified Amazon S3 bucket. Also provides the status of notifications -// about the Amazon S3 delivery to the specified Amazon SNS topic. -type ConfigExportDeliveryInfo struct { +type DescribeComplianceByConfigRuleInput struct { _ struct{} `type:"structure"` - // The time of the last attempted delivery. - LastAttemptTime *time.Time `locationName:"lastAttemptTime" type:"timestamp"` - - // 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"` + // Filters the results by compliance. + // + // The allowed values are COMPLIANT and NON_COMPLIANT. + ComplianceTypes []*string `type:"list"` - // The time of the last successful delivery. - LastSuccessfulTime *time.Time `locationName:"lastSuccessfulTime" type:"timestamp"` + // Specify one or more AWS Config rule names to filter the results by rule. + ConfigRuleNames []*string `type:"list"` - // The time that the next delivery occurs. - NextDeliveryTime *time.Time `locationName:"nextDeliveryTime" type:"timestamp"` + // 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 ConfigExportDeliveryInfo) String() string { +func (s DescribeComplianceByConfigRuleInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConfigExportDeliveryInfo) GoString() string { +func (s DescribeComplianceByConfigRuleInput) GoString() string { return s.String() } -// SetLastAttemptTime sets the LastAttemptTime field's value. -func (s *ConfigExportDeliveryInfo) SetLastAttemptTime(v time.Time) *ConfigExportDeliveryInfo { - s.LastAttemptTime = &v +// SetComplianceTypes sets the ComplianceTypes field's value. +func (s *DescribeComplianceByConfigRuleInput) SetComplianceTypes(v []*string) *DescribeComplianceByConfigRuleInput { + s.ComplianceTypes = v return s } -// SetLastErrorCode sets the LastErrorCode field's value. -func (s *ConfigExportDeliveryInfo) SetLastErrorCode(v string) *ConfigExportDeliveryInfo { - s.LastErrorCode = &v +// SetConfigRuleNames sets the ConfigRuleNames field's value. +func (s *DescribeComplianceByConfigRuleInput) SetConfigRuleNames(v []*string) *DescribeComplianceByConfigRuleInput { + s.ConfigRuleNames = v return s } -// SetLastErrorMessage sets the LastErrorMessage field's value. -func (s *ConfigExportDeliveryInfo) SetLastErrorMessage(v string) *ConfigExportDeliveryInfo { - s.LastErrorMessage = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeComplianceByConfigRuleInput) SetNextToken(v string) *DescribeComplianceByConfigRuleInput { + s.NextToken = &v return s } -// SetLastStatus sets the LastStatus field's value. -func (s *ConfigExportDeliveryInfo) SetLastStatus(v string) *ConfigExportDeliveryInfo { - s.LastStatus = &v - return s -} +type DescribeComplianceByConfigRuleOutput struct { + _ struct{} `type:"structure"` -// SetLastSuccessfulTime sets the LastSuccessfulTime field's value. -func (s *ConfigExportDeliveryInfo) SetLastSuccessfulTime(v time.Time) *ConfigExportDeliveryInfo { - s.LastSuccessfulTime = &v - return s -} + // Indicates whether each of the specified AWS Config rules is compliant. + ComplianceByConfigRules []*ComplianceByConfigRule `type:"list"` -// SetNextDeliveryTime sets the NextDeliveryTime field's value. -func (s *ConfigExportDeliveryInfo) SetNextDeliveryTime(v time.Time) *ConfigExportDeliveryInfo { - s.NextDeliveryTime = &v - return s + // The string that you use in a subsequent request to get the next page of results + // in a paginated response. + NextToken *string `type:"string"` } -// 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 (https://docs.aws.amazon.com/config/latest/developerguide/evaluate-config.html) -// in the AWS Config Developer Guide. -type ConfigRule struct { - _ struct{} `type:"structure"` +// String returns the string representation +func (s DescribeComplianceByConfigRuleOutput) String() string { + return awsutil.Prettify(s) +} - // The Amazon Resource Name (ARN) of the AWS Config rule. - ConfigRuleArn *string `type:"string"` +// GoString returns the string representation +func (s DescribeComplianceByConfigRuleOutput) GoString() string { + return s.String() +} - // The ID of the AWS Config rule. - ConfigRuleId *string `type:"string"` +// SetComplianceByConfigRules sets the ComplianceByConfigRules field's value. +func (s *DescribeComplianceByConfigRuleOutput) SetComplianceByConfigRules(v []*ComplianceByConfigRule) *DescribeComplianceByConfigRuleOutput { + s.ComplianceByConfigRules = v + return s +} - // 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"` +// SetNextToken sets the NextToken field's value. +func (s *DescribeComplianceByConfigRuleOutput) SetNextToken(v string) *DescribeComplianceByConfigRuleOutput { + s.NextToken = &v + return s +} - // 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 AWS 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 AWS 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 AWS Config rule. - // - // AWS Config temporarily sets the state of a rule to DELETING 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"` +type DescribeComplianceByResourceInput struct { + _ struct{} `type:"structure"` - // Service principal name of the service that created the rule. + // Filters the results by compliance. // - // The field is populated only if the service linked rule is created by a service. - // The field is empty if you create your own rule. - CreatedBy *string `min:"1" type:"string"` - - // The description that you provide for the AWS Config rule. - Description *string `type:"string"` + // The allowed values are COMPLIANT, NON_COMPLIANT, and INSUFFICIENT_DATA. + ComplianceTypes []*string `type:"list"` - // A string, in JSON format, that is passed to the AWS Config rule Lambda function. - InputParameters *string `min:"1" type:"string"` + // The maximum number of evaluation results returned on each page. The default + // is 10. You cannot specify a number greater than 100. If you specify 0, AWS + // Config uses the default. + Limit *int64 `type:"integer"` - // 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. - // - // By default, rules with a periodic trigger are evaluated every 24 hours. To - // change the frequency, specify a valid value for the MaximumExecutionFrequency - // parameter. - MaximumExecutionFrequency *string `type:"string" enum:"MaximumExecutionFrequency"` + // 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"` - // 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"` + // 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"` - // 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"` + // 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 ConfigRule) String() string { +func (s DescribeComplianceByResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConfigRule) GoString() string { +func (s DescribeComplianceByResourceInput) 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.CreatedBy != nil && len(*s.CreatedBy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CreatedBy", 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)) - } +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.Source != nil { - if err := s.Source.Validate(); err != nil { - invalidParams.AddNested("Source", err.(request.ErrInvalidParams)) - } + if s.ResourceType != nil && len(*s.ResourceType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceType", 1)) } if invalidParams.Len() > 0 { @@ -7503,1156 +12049,1275 @@ func (s *ConfigRule) Validate() error { return nil } -// SetConfigRuleArn sets the ConfigRuleArn field's value. -func (s *ConfigRule) SetConfigRuleArn(v string) *ConfigRule { - s.ConfigRuleArn = &v +// SetComplianceTypes sets the ComplianceTypes field's value. +func (s *DescribeComplianceByResourceInput) SetComplianceTypes(v []*string) *DescribeComplianceByResourceInput { + s.ComplianceTypes = v return s } -// SetConfigRuleId sets the ConfigRuleId field's value. -func (s *ConfigRule) SetConfigRuleId(v string) *ConfigRule { - s.ConfigRuleId = &v +// SetLimit sets the Limit field's value. +func (s *DescribeComplianceByResourceInput) SetLimit(v int64) *DescribeComplianceByResourceInput { + s.Limit = &v return s } -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *ConfigRule) SetConfigRuleName(v string) *ConfigRule { - s.ConfigRuleName = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeComplianceByResourceInput) SetNextToken(v string) *DescribeComplianceByResourceInput { + s.NextToken = &v return s } -// SetConfigRuleState sets the ConfigRuleState field's value. -func (s *ConfigRule) SetConfigRuleState(v string) *ConfigRule { - s.ConfigRuleState = &v +// SetResourceId sets the ResourceId field's value. +func (s *DescribeComplianceByResourceInput) SetResourceId(v string) *DescribeComplianceByResourceInput { + s.ResourceId = &v return s } -// SetCreatedBy sets the CreatedBy field's value. -func (s *ConfigRule) SetCreatedBy(v string) *ConfigRule { - s.CreatedBy = &v +// SetResourceType sets the ResourceType field's value. +func (s *DescribeComplianceByResourceInput) SetResourceType(v string) *DescribeComplianceByResourceInput { + s.ResourceType = &v return s } -// SetDescription sets the Description field's value. -func (s *ConfigRule) SetDescription(v string) *ConfigRule { - s.Description = &v - return s +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"` } -// SetInputParameters sets the InputParameters field's value. -func (s *ConfigRule) SetInputParameters(v string) *ConfigRule { - s.InputParameters = &v - return s +// String returns the string representation +func (s DescribeComplianceByResourceOutput) String() string { + return awsutil.Prettify(s) } -// SetMaximumExecutionFrequency sets the MaximumExecutionFrequency field's value. -func (s *ConfigRule) SetMaximumExecutionFrequency(v string) *ConfigRule { - s.MaximumExecutionFrequency = &v - return s +// GoString returns the string representation +func (s DescribeComplianceByResourceOutput) GoString() string { + return s.String() } -// SetScope sets the Scope field's value. -func (s *ConfigRule) SetScope(v *Scope) *ConfigRule { - s.Scope = v +// SetComplianceByResources sets the ComplianceByResources field's value. +func (s *DescribeComplianceByResourceOutput) SetComplianceByResources(v []*ComplianceByResource) *DescribeComplianceByResourceOutput { + s.ComplianceByResources = v return s } -// SetSource sets the Source field's value. -func (s *ConfigRule) SetSource(v *Source) *ConfigRule { - s.Source = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeComplianceByResourceOutput) SetNextToken(v string) *DescribeComplianceByResourceOutput { + s.NextToken = &v return s } -// Filters the compliance results based on account ID, region, compliance type, -// and rule name. -type ConfigRuleComplianceFilters struct { +type DescribeConfigRuleEvaluationStatusInput struct { _ struct{} `type:"structure"` - // The 12-digit account ID of the source account. - AccountId *string `type:"string"` - - // The source region where the data is aggregated. - AwsRegion *string `min:"1" type:"string"` + // 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 rule compliance status. + // The number of rule evaluation results that you want returned. // - // For the ConfigRuleComplianceFilters data type, AWS Config supports only COMPLIANT - // and NON_COMPLIANT. AWS Config does not support the NOT_APPLICABLE and the - // INSUFFICIENT_DATA values. - ComplianceType *string `type:"string" enum:"ComplianceType"` + // This parameter is required if the rule limit for your account is more than + // the default of 150 rules. + // + // For 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 name of the AWS Config rule. - ConfigRuleName *string `min:"1" type:"string"` + // 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 ConfigRuleComplianceFilters) String() string { +func (s DescribeConfigRuleEvaluationStatusInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConfigRuleComplianceFilters) GoString() string { +func (s DescribeConfigRuleEvaluationStatusInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConfigRuleComplianceFilters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConfigRuleComplianceFilters"} - if s.AwsRegion != nil && len(*s.AwsRegion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AwsRegion", 1)) - } - if s.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *ConfigRuleComplianceFilters) SetAccountId(v string) *ConfigRuleComplianceFilters { - s.AccountId = &v - return s -} - -// SetAwsRegion sets the AwsRegion field's value. -func (s *ConfigRuleComplianceFilters) SetAwsRegion(v string) *ConfigRuleComplianceFilters { - s.AwsRegion = &v +// SetConfigRuleNames sets the ConfigRuleNames field's value. +func (s *DescribeConfigRuleEvaluationStatusInput) SetConfigRuleNames(v []*string) *DescribeConfigRuleEvaluationStatusInput { + s.ConfigRuleNames = v return s } -// SetComplianceType sets the ComplianceType field's value. -func (s *ConfigRuleComplianceFilters) SetComplianceType(v string) *ConfigRuleComplianceFilters { - s.ComplianceType = &v +// SetLimit sets the Limit field's value. +func (s *DescribeConfigRuleEvaluationStatusInput) SetLimit(v int64) *DescribeConfigRuleEvaluationStatusInput { + s.Limit = &v return s } -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *ConfigRuleComplianceFilters) SetConfigRuleName(v string) *ConfigRuleComplianceFilters { - s.ConfigRuleName = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeConfigRuleEvaluationStatusInput) SetNextToken(v string) *DescribeConfigRuleEvaluationStatusInput { + s.NextToken = &v return s } -// Filters the results based on the account IDs and regions. -type ConfigRuleComplianceSummaryFilters struct { +type DescribeConfigRuleEvaluationStatusOutput struct { _ struct{} `type:"structure"` - // The 12-digit account ID of the source account. - AccountId *string `type:"string"` + // Status information about your AWS managed Config rules. + ConfigRulesEvaluationStatus []*ConfigRuleEvaluationStatus `type:"list"` - // The source region where the data is aggregated. - AwsRegion *string `min:"1" type:"string"` + // 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 ConfigRuleComplianceSummaryFilters) String() string { +func (s DescribeConfigRuleEvaluationStatusOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConfigRuleComplianceSummaryFilters) GoString() string { +func (s DescribeConfigRuleEvaluationStatusOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConfigRuleComplianceSummaryFilters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConfigRuleComplianceSummaryFilters"} - if s.AwsRegion != nil && len(*s.AwsRegion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AwsRegion", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *ConfigRuleComplianceSummaryFilters) SetAccountId(v string) *ConfigRuleComplianceSummaryFilters { - s.AccountId = &v +// SetConfigRulesEvaluationStatus sets the ConfigRulesEvaluationStatus field's value. +func (s *DescribeConfigRuleEvaluationStatusOutput) SetConfigRulesEvaluationStatus(v []*ConfigRuleEvaluationStatus) *DescribeConfigRuleEvaluationStatusOutput { + s.ConfigRulesEvaluationStatus = v return s } -// SetAwsRegion sets the AwsRegion field's value. -func (s *ConfigRuleComplianceSummaryFilters) SetAwsRegion(v string) *ConfigRuleComplianceSummaryFilters { - s.AwsRegion = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeConfigRuleEvaluationStatusOutput) SetNextToken(v string) *DescribeConfigRuleEvaluationStatusOutput { + s.NextToken = &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 AWS Config rules. -type ConfigRuleEvaluationStatus struct { +type DescribeConfigRulesInput 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 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 time that you first activated the AWS Config rule. - FirstActivatedTime *time.Time `type:"timestamp"` + // 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"` +} - // 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"` +// String returns the string representation +func (s DescribeConfigRulesInput) String() string { + return awsutil.Prettify(s) +} - // The error code that AWS Config returned when the rule last failed. - LastErrorCode *string `type:"string"` +// GoString returns the string representation +func (s DescribeConfigRulesInput) GoString() string { + return s.String() +} - // The error message that AWS Config returned when the rule last failed. - LastErrorMessage *string `type:"string"` +// SetConfigRuleNames sets the ConfigRuleNames field's value. +func (s *DescribeConfigRulesInput) SetConfigRuleNames(v []*string) *DescribeConfigRulesInput { + s.ConfigRuleNames = v + return s +} - // The time that AWS Config last failed to evaluate your AWS resources against - // the rule. - LastFailedEvaluationTime *time.Time `type:"timestamp"` +// SetNextToken sets the NextToken field's value. +func (s *DescribeConfigRulesInput) SetNextToken(v string) *DescribeConfigRulesInput { + s.NextToken = &v + return s +} - // The time that AWS Config last failed to invoke the AWS Config rule to evaluate - // your AWS resources. - LastFailedInvocationTime *time.Time `type:"timestamp"` +type DescribeConfigRulesOutput struct { + _ struct{} `type:"structure"` - // The time that AWS Config last successfully evaluated your AWS resources against - // the rule. - LastSuccessfulEvaluationTime *time.Time `type:"timestamp"` + // The details about your AWS Config rules. + ConfigRules []*ConfigRule `type:"list"` - // The time that AWS Config last successfully invoked the AWS Config rule to - // evaluate your AWS resources. - LastSuccessfulInvocationTime *time.Time `type:"timestamp"` + // 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 ConfigRuleEvaluationStatus) String() string { +func (s DescribeConfigRulesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConfigRuleEvaluationStatus) GoString() string { +func (s DescribeConfigRulesOutput) GoString() string { return s.String() } -// SetConfigRuleArn sets the ConfigRuleArn field's value. -func (s *ConfigRuleEvaluationStatus) SetConfigRuleArn(v string) *ConfigRuleEvaluationStatus { - s.ConfigRuleArn = &v +// SetConfigRules sets the ConfigRules field's value. +func (s *DescribeConfigRulesOutput) SetConfigRules(v []*ConfigRule) *DescribeConfigRulesOutput { + s.ConfigRules = v return s } -// SetConfigRuleId sets the ConfigRuleId field's value. -func (s *ConfigRuleEvaluationStatus) SetConfigRuleId(v string) *ConfigRuleEvaluationStatus { - s.ConfigRuleId = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeConfigRulesOutput) SetNextToken(v string) *DescribeConfigRulesOutput { + s.NextToken = &v return s } -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *ConfigRuleEvaluationStatus) SetConfigRuleName(v string) *ConfigRuleEvaluationStatus { - s.ConfigRuleName = &v - return s -} +type DescribeConfigurationAggregatorSourcesStatusInput struct { + _ struct{} `type:"structure"` -// SetFirstActivatedTime sets the FirstActivatedTime field's value. -func (s *ConfigRuleEvaluationStatus) SetFirstActivatedTime(v time.Time) *ConfigRuleEvaluationStatus { - s.FirstActivatedTime = &v - return s -} + // The name of the configuration aggregator. + // + // ConfigurationAggregatorName is a required field + ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` -// SetFirstEvaluationStarted sets the FirstEvaluationStarted field's value. -func (s *ConfigRuleEvaluationStatus) SetFirstEvaluationStarted(v bool) *ConfigRuleEvaluationStatus { - s.FirstEvaluationStarted = &v - return s -} + // The maximum number of AggregatorSourceStatus returned on each page. The default + // is maximum. If you specify 0, AWS Config uses the default. + Limit *int64 `type:"integer"` -// SetLastErrorCode sets the LastErrorCode field's value. -func (s *ConfigRuleEvaluationStatus) SetLastErrorCode(v string) *ConfigRuleEvaluationStatus { - s.LastErrorCode = &v - return s + // 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"` + + // Filters the status type. + // + // * Valid value FAILED indicates errors while moving data. + // + // * Valid value SUCCEEDED indicates the data was successfully moved. + // + // * Valid value OUTDATED indicates the data is not the most recent. + UpdateStatus []*string `min:"1" type:"list"` } -// SetLastErrorMessage sets the LastErrorMessage field's value. -func (s *ConfigRuleEvaluationStatus) SetLastErrorMessage(v string) *ConfigRuleEvaluationStatus { - s.LastErrorMessage = &v - return s +// String returns the string representation +func (s DescribeConfigurationAggregatorSourcesStatusInput) String() string { + return awsutil.Prettify(s) } -// SetLastFailedEvaluationTime sets the LastFailedEvaluationTime field's value. -func (s *ConfigRuleEvaluationStatus) SetLastFailedEvaluationTime(v time.Time) *ConfigRuleEvaluationStatus { - s.LastFailedEvaluationTime = &v - return s +// GoString returns the string representation +func (s DescribeConfigurationAggregatorSourcesStatusInput) GoString() string { + return s.String() } -// SetLastFailedInvocationTime sets the LastFailedInvocationTime field's value. -func (s *ConfigRuleEvaluationStatus) SetLastFailedInvocationTime(v time.Time) *ConfigRuleEvaluationStatus { - s.LastFailedInvocationTime = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeConfigurationAggregatorSourcesStatusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeConfigurationAggregatorSourcesStatusInput"} + if s.ConfigurationAggregatorName == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) + } + if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) + } + if s.UpdateStatus != nil && len(s.UpdateStatus) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UpdateStatus", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetLastSuccessfulEvaluationTime sets the LastSuccessfulEvaluationTime field's value. -func (s *ConfigRuleEvaluationStatus) SetLastSuccessfulEvaluationTime(v time.Time) *ConfigRuleEvaluationStatus { - s.LastSuccessfulEvaluationTime = &v +// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. +func (s *DescribeConfigurationAggregatorSourcesStatusInput) SetConfigurationAggregatorName(v string) *DescribeConfigurationAggregatorSourcesStatusInput { + s.ConfigurationAggregatorName = &v return s } -// SetLastSuccessfulInvocationTime sets the LastSuccessfulInvocationTime field's value. -func (s *ConfigRuleEvaluationStatus) SetLastSuccessfulInvocationTime(v time.Time) *ConfigRuleEvaluationStatus { - s.LastSuccessfulInvocationTime = &v +// SetLimit sets the Limit field's value. +func (s *DescribeConfigurationAggregatorSourcesStatusInput) SetLimit(v int64) *DescribeConfigurationAggregatorSourcesStatusInput { + s.Limit = &v return s } - -// Provides options for how often AWS Config delivers configuration snapshots -// to the Amazon S3 bucket in your delivery channel. -// -// 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 AWS 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. -type ConfigSnapshotDeliveryProperties struct { + +// SetNextToken sets the NextToken field's value. +func (s *DescribeConfigurationAggregatorSourcesStatusInput) SetNextToken(v string) *DescribeConfigurationAggregatorSourcesStatusInput { + s.NextToken = &v + return s +} + +// SetUpdateStatus sets the UpdateStatus field's value. +func (s *DescribeConfigurationAggregatorSourcesStatusInput) SetUpdateStatus(v []*string) *DescribeConfigurationAggregatorSourcesStatusInput { + s.UpdateStatus = v + return s +} + +type DescribeConfigurationAggregatorSourcesStatusOutput struct { _ struct{} `type:"structure"` - // The frequency with which AWS Config delivers configuration snapshots. - DeliveryFrequency *string `locationName:"deliveryFrequency" type:"string" enum:"MaximumExecutionFrequency"` + // Returns an AggregatedSourceStatus object. + AggregatedSourceStatusList []*AggregatedSourceStatus `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 ConfigSnapshotDeliveryProperties) String() string { +func (s DescribeConfigurationAggregatorSourcesStatusOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConfigSnapshotDeliveryProperties) GoString() string { +func (s DescribeConfigurationAggregatorSourcesStatusOutput) GoString() string { return s.String() } -// SetDeliveryFrequency sets the DeliveryFrequency field's value. -func (s *ConfigSnapshotDeliveryProperties) SetDeliveryFrequency(v string) *ConfigSnapshotDeliveryProperties { - s.DeliveryFrequency = &v +// SetAggregatedSourceStatusList sets the AggregatedSourceStatusList field's value. +func (s *DescribeConfigurationAggregatorSourcesStatusOutput) SetAggregatedSourceStatusList(v []*AggregatedSourceStatus) *DescribeConfigurationAggregatorSourcesStatusOutput { + s.AggregatedSourceStatusList = v return s } -// A list that contains the status of the delivery of the configuration stream -// notification to the Amazon SNS topic. -type ConfigStreamDeliveryInfo struct { - _ struct{} `type:"structure"` +// SetNextToken sets the NextToken field's value. +func (s *DescribeConfigurationAggregatorSourcesStatusOutput) SetNextToken(v string) *DescribeConfigurationAggregatorSourcesStatusOutput { + s.NextToken = &v + return s +} - // The error code from the last attempted delivery. - LastErrorCode *string `locationName:"lastErrorCode" type:"string"` +type DescribeConfigurationAggregatorsInput struct { + _ struct{} `type:"structure"` - // The error message from the last attempted delivery. - LastErrorMessage *string `locationName:"lastErrorMessage" type:"string"` + // The name of the configuration aggregators. + ConfigurationAggregatorNames []*string `type:"list"` - // Status of the last attempted delivery. - // - // Note Providing an SNS topic on a DeliveryChannel (https://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 maximum number of configuration aggregators returned on each page. The + // default is maximum. If you specify 0, AWS Config uses the default. + Limit *int64 `type:"integer"` - // The time from the last status change. - LastStatusChangeTime *time.Time `locationName:"lastStatusChangeTime" type:"timestamp"` + // 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 ConfigStreamDeliveryInfo) String() string { +func (s DescribeConfigurationAggregatorsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConfigStreamDeliveryInfo) GoString() string { +func (s DescribeConfigurationAggregatorsInput) 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 +// SetConfigurationAggregatorNames sets the ConfigurationAggregatorNames field's value. +func (s *DescribeConfigurationAggregatorsInput) SetConfigurationAggregatorNames(v []*string) *DescribeConfigurationAggregatorsInput { + s.ConfigurationAggregatorNames = v return s } -// SetLastStatus sets the LastStatus field's value. -func (s *ConfigStreamDeliveryInfo) SetLastStatus(v string) *ConfigStreamDeliveryInfo { - s.LastStatus = &v +// SetLimit sets the Limit field's value. +func (s *DescribeConfigurationAggregatorsInput) SetLimit(v int64) *DescribeConfigurationAggregatorsInput { + s.Limit = &v return s } -// SetLastStatusChangeTime sets the LastStatusChangeTime field's value. -func (s *ConfigStreamDeliveryInfo) SetLastStatusChangeTime(v time.Time) *ConfigStreamDeliveryInfo { - s.LastStatusChangeTime = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeConfigurationAggregatorsInput) SetNextToken(v string) *DescribeConfigurationAggregatorsInput { + s.NextToken = &v return s } -// The details about the configuration aggregator, including information about -// source accounts, regions, and metadata of the aggregator. -type ConfigurationAggregator struct { +type DescribeConfigurationAggregatorsOutput struct { _ struct{} `type:"structure"` - // Provides a list of source accounts and regions to be aggregated. - AccountAggregationSources []*AccountAggregationSource `type:"list"` - - // The Amazon Resource Name (ARN) of the aggregator. - ConfigurationAggregatorArn *string `type:"string"` - - // The name of the aggregator. - ConfigurationAggregatorName *string `min:"1" type:"string"` - - // The time stamp when the configuration aggregator was created. - CreationTime *time.Time `type:"timestamp"` - - // The time of the last update. - LastUpdatedTime *time.Time `type:"timestamp"` + // Returns a ConfigurationAggregators object. + ConfigurationAggregators []*ConfigurationAggregator `type:"list"` - // Provides an organization and list of regions to be aggregated. - OrganizationAggregationSource *OrganizationAggregationSource `type:"structure"` + // 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 ConfigurationAggregator) String() string { +func (s DescribeConfigurationAggregatorsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConfigurationAggregator) GoString() string { +func (s DescribeConfigurationAggregatorsOutput) GoString() string { return s.String() } -// SetAccountAggregationSources sets the AccountAggregationSources field's value. -func (s *ConfigurationAggregator) SetAccountAggregationSources(v []*AccountAggregationSource) *ConfigurationAggregator { - s.AccountAggregationSources = v +// SetConfigurationAggregators sets the ConfigurationAggregators field's value. +func (s *DescribeConfigurationAggregatorsOutput) SetConfigurationAggregators(v []*ConfigurationAggregator) *DescribeConfigurationAggregatorsOutput { + s.ConfigurationAggregators = v return s } -// SetConfigurationAggregatorArn sets the ConfigurationAggregatorArn field's value. -func (s *ConfigurationAggregator) SetConfigurationAggregatorArn(v string) *ConfigurationAggregator { - s.ConfigurationAggregatorArn = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeConfigurationAggregatorsOutput) SetNextToken(v string) *DescribeConfigurationAggregatorsOutput { + s.NextToken = &v return s } -// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. -func (s *ConfigurationAggregator) SetConfigurationAggregatorName(v string) *ConfigurationAggregator { - s.ConfigurationAggregatorName = &v - return s +// The input for the DescribeConfigurationRecorderStatus action. +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"` } -// SetCreationTime sets the CreationTime field's value. -func (s *ConfigurationAggregator) SetCreationTime(v time.Time) *ConfigurationAggregator { - s.CreationTime = &v - return s +// String returns the string representation +func (s DescribeConfigurationRecorderStatusInput) String() string { + return awsutil.Prettify(s) } -// SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *ConfigurationAggregator) SetLastUpdatedTime(v time.Time) *ConfigurationAggregator { - s.LastUpdatedTime = &v - return s +// GoString returns the string representation +func (s DescribeConfigurationRecorderStatusInput) GoString() string { + return s.String() } -// SetOrganizationAggregationSource sets the OrganizationAggregationSource field's value. -func (s *ConfigurationAggregator) SetOrganizationAggregationSource(v *OrganizationAggregationSource) *ConfigurationAggregator { - s.OrganizationAggregationSource = v +// SetConfigurationRecorderNames sets the ConfigurationRecorderNames field's value. +func (s *DescribeConfigurationRecorderStatusInput) SetConfigurationRecorderNames(v []*string) *DescribeConfigurationRecorderStatusInput { + s.ConfigurationRecorderNames = v return s } -// A list that contains detailed configurations of a specified resource. -type ConfigurationItem struct { +// The output for the DescribeConfigurationRecorderStatus action, in JSON format. +type DescribeConfigurationRecorderStatusOutput struct { _ struct{} `type:"structure"` - // The 12-digit AWS account ID associated with the resource. - AccountId *string `locationName:"accountId" type:"string"` + // A list that contains status of the specified recorders. + ConfigurationRecordersStatus []*ConfigurationRecorderStatus `type:"list"` +} - // accoun - Arn *string `locationName:"arn" type:"string"` +// String returns the string representation +func (s DescribeConfigurationRecorderStatusOutput) String() string { + return awsutil.Prettify(s) +} - // The Availability Zone associated with the resource. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` +// GoString returns the string representation +func (s DescribeConfigurationRecorderStatusOutput) GoString() string { + return s.String() +} - // The region where the resource resides. - AwsRegion *string `locationName:"awsRegion" min:"1" type:"string"` +// SetConfigurationRecordersStatus sets the ConfigurationRecordersStatus field's value. +func (s *DescribeConfigurationRecorderStatusOutput) SetConfigurationRecordersStatus(v []*ConfigurationRecorderStatus) *DescribeConfigurationRecorderStatusOutput { + s.ConfigurationRecordersStatus = v + return s +} - // The description of the resource configuration. - Configuration *string `locationName:"configuration" type:"string"` +// The input for the DescribeConfigurationRecorders action. +type DescribeConfigurationRecordersInput struct { + _ struct{} `type:"structure"` - // The time when the configuration recording was initiated. - ConfigurationItemCaptureTime *time.Time `locationName:"configurationItemCaptureTime" type:"timestamp"` + // A list of configuration recorder names. + ConfigurationRecorderNames []*string `type:"list"` +} - // 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"` +// String returns the string representation +func (s DescribeConfigurationRecordersInput) String() string { + return awsutil.Prettify(s) +} - // The configuration item status. - ConfigurationItemStatus *string `locationName:"configurationItemStatus" type:"string" enum:"ConfigurationItemStatus"` +// GoString returns the string representation +func (s DescribeConfigurationRecordersInput) GoString() string { + return s.String() +} - // An identifier that indicates the ordering of the configuration items of a - // resource. - ConfigurationStateId *string `locationName:"configurationStateId" type:"string"` +// SetConfigurationRecorderNames sets the ConfigurationRecorderNames field's value. +func (s *DescribeConfigurationRecordersInput) SetConfigurationRecorderNames(v []*string) *DescribeConfigurationRecordersInput { + s.ConfigurationRecorderNames = v + return s +} - // 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 (https://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"` +// The output for the DescribeConfigurationRecorders action. +type DescribeConfigurationRecordersOutput struct { + _ struct{} `type:"structure"` - // A list of related AWS resources. - Relationships []*Relationship `locationName:"relationships" type:"list"` + // A list that contains the descriptions of the specified configuration recorders. + ConfigurationRecorders []*ConfigurationRecorder `type:"list"` +} - // The time stamp when the resource was created. - ResourceCreationTime *time.Time `locationName:"resourceCreationTime" type:"timestamp"` +// String returns the string representation +func (s DescribeConfigurationRecordersOutput) String() string { + return awsutil.Prettify(s) +} - // The ID of the resource (for example, sg-xxxxxx). - ResourceId *string `locationName:"resourceId" min:"1" type:"string"` +// 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 custom name of the resource, if available. - ResourceName *string `locationName:"resourceName" type:"string"` +type DescribeConformancePackComplianceInput struct { + _ struct{} `type:"structure"` - // The type of AWS resource. - ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` + // Name of the conformance pack. + // + // ConformancePackName is a required field + ConformancePackName *string `min:"1" type:"string" required:"true"` - // 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 ConformancePackComplianceFilters object. + Filters *ConformancePackComplianceFilters `type:"structure"` - // A mapping of key value tags associated with the resource. - Tags map[string]*string `locationName:"tags" type:"map"` + // The maximum number of AWS Config rules within a conformance pack are returned + // on each page. + Limit *int64 `type:"integer"` - // The version number of the resource configuration. - Version *string `locationName:"version" type:"string"` + // The nextToken string returned in a previous request that you use to request + // the next page of results in a paginated response. + NextToken *string `type:"string"` } // String returns the string representation -func (s ConfigurationItem) String() string { +func (s DescribeConformancePackComplianceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConfigurationItem) GoString() string { +func (s DescribeConformancePackComplianceInput) GoString() string { return s.String() } -// SetAccountId sets the AccountId field's value. -func (s *ConfigurationItem) SetAccountId(v string) *ConfigurationItem { - s.AccountId = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeConformancePackComplianceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeConformancePackComplianceInput"} + if s.ConformancePackName == nil { + invalidParams.Add(request.NewErrParamRequired("ConformancePackName")) + } + if s.ConformancePackName != nil && len(*s.ConformancePackName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConformancePackName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetArn sets the Arn field's value. -func (s *ConfigurationItem) SetArn(v string) *ConfigurationItem { - s.Arn = &v +// SetConformancePackName sets the ConformancePackName field's value. +func (s *DescribeConformancePackComplianceInput) SetConformancePackName(v string) *DescribeConformancePackComplianceInput { + s.ConformancePackName = &v return s } -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *ConfigurationItem) SetAvailabilityZone(v string) *ConfigurationItem { - s.AvailabilityZone = &v +// SetFilters sets the Filters field's value. +func (s *DescribeConformancePackComplianceInput) SetFilters(v *ConformancePackComplianceFilters) *DescribeConformancePackComplianceInput { + s.Filters = v return s } -// SetAwsRegion sets the AwsRegion field's value. -func (s *ConfigurationItem) SetAwsRegion(v string) *ConfigurationItem { - s.AwsRegion = &v +// SetLimit sets the Limit field's value. +func (s *DescribeConformancePackComplianceInput) SetLimit(v int64) *DescribeConformancePackComplianceInput { + s.Limit = &v return s } -// SetConfiguration sets the Configuration field's value. -func (s *ConfigurationItem) SetConfiguration(v string) *ConfigurationItem { - s.Configuration = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeConformancePackComplianceInput) SetNextToken(v string) *DescribeConformancePackComplianceInput { + s.NextToken = &v return s } -// SetConfigurationItemCaptureTime sets the ConfigurationItemCaptureTime field's value. -func (s *ConfigurationItem) SetConfigurationItemCaptureTime(v time.Time) *ConfigurationItem { - s.ConfigurationItemCaptureTime = &v - return s +type DescribeConformancePackComplianceOutput struct { + _ struct{} `type:"structure"` + + // Name of the conformance pack. + // + // ConformancePackName is a required field + ConformancePackName *string `min:"1" type:"string" required:"true"` + + // Returns a list of ConformancePackRuleCompliance objects. + // + // ConformancePackRuleComplianceList is a required field + ConformancePackRuleComplianceList []*ConformancePackRuleCompliance `type:"list" required:"true"` + + // The nextToken string returned in a previous request that you use to request + // the next page of results in a paginated response. + NextToken *string `type:"string"` } -// SetConfigurationItemMD5Hash sets the ConfigurationItemMD5Hash field's value. -func (s *ConfigurationItem) SetConfigurationItemMD5Hash(v string) *ConfigurationItem { - s.ConfigurationItemMD5Hash = &v - return s +// String returns the string representation +func (s DescribeConformancePackComplianceOutput) String() string { + return awsutil.Prettify(s) } -// SetConfigurationItemStatus sets the ConfigurationItemStatus field's value. -func (s *ConfigurationItem) SetConfigurationItemStatus(v string) *ConfigurationItem { - s.ConfigurationItemStatus = &v - return s +// GoString returns the string representation +func (s DescribeConformancePackComplianceOutput) GoString() string { + return s.String() } -// SetConfigurationStateId sets the ConfigurationStateId field's value. -func (s *ConfigurationItem) SetConfigurationStateId(v string) *ConfigurationItem { - s.ConfigurationStateId = &v +// SetConformancePackName sets the ConformancePackName field's value. +func (s *DescribeConformancePackComplianceOutput) SetConformancePackName(v string) *DescribeConformancePackComplianceOutput { + s.ConformancePackName = &v return s } -// SetRelatedEvents sets the RelatedEvents field's value. -func (s *ConfigurationItem) SetRelatedEvents(v []*string) *ConfigurationItem { - s.RelatedEvents = v +// SetConformancePackRuleComplianceList sets the ConformancePackRuleComplianceList field's value. +func (s *DescribeConformancePackComplianceOutput) SetConformancePackRuleComplianceList(v []*ConformancePackRuleCompliance) *DescribeConformancePackComplianceOutput { + s.ConformancePackRuleComplianceList = v return s } -// SetRelationships sets the Relationships field's value. -func (s *ConfigurationItem) SetRelationships(v []*Relationship) *ConfigurationItem { - s.Relationships = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeConformancePackComplianceOutput) SetNextToken(v string) *DescribeConformancePackComplianceOutput { + s.NextToken = &v return s } -// SetResourceCreationTime sets the ResourceCreationTime field's value. -func (s *ConfigurationItem) SetResourceCreationTime(v time.Time) *ConfigurationItem { - s.ResourceCreationTime = &v - return s +type DescribeConformancePackStatusInput struct { + _ struct{} `type:"structure"` + + // Comma-separated list of conformance pack names. + ConformancePackNames []*string `type:"list"` + + // The maximum number of conformance packs status returned on each page. + Limit *int64 `type:"integer"` + + // The nextToken string returned in a previous request that you use to request + // the next page of results in a paginated response. + NextToken *string `type:"string"` } -// SetResourceId sets the ResourceId field's value. -func (s *ConfigurationItem) SetResourceId(v string) *ConfigurationItem { - s.ResourceId = &v - return s +// String returns the string representation +func (s DescribeConformancePackStatusInput) String() string { + return awsutil.Prettify(s) } -// SetResourceName sets the ResourceName field's value. -func (s *ConfigurationItem) SetResourceName(v string) *ConfigurationItem { - s.ResourceName = &v +// GoString returns the string representation +func (s DescribeConformancePackStatusInput) GoString() string { + return s.String() +} + +// SetConformancePackNames sets the ConformancePackNames field's value. +func (s *DescribeConformancePackStatusInput) SetConformancePackNames(v []*string) *DescribeConformancePackStatusInput { + s.ConformancePackNames = v return s } -// SetResourceType sets the ResourceType field's value. -func (s *ConfigurationItem) SetResourceType(v string) *ConfigurationItem { - s.ResourceType = &v +// SetLimit sets the Limit field's value. +func (s *DescribeConformancePackStatusInput) SetLimit(v int64) *DescribeConformancePackStatusInput { + s.Limit = &v return s } -// SetSupplementaryConfiguration sets the SupplementaryConfiguration field's value. -func (s *ConfigurationItem) SetSupplementaryConfiguration(v map[string]*string) *ConfigurationItem { - s.SupplementaryConfiguration = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeConformancePackStatusInput) SetNextToken(v string) *DescribeConformancePackStatusInput { + s.NextToken = &v return s } -// SetTags sets the Tags field's value. -func (s *ConfigurationItem) SetTags(v map[string]*string) *ConfigurationItem { - s.Tags = v +type DescribeConformancePackStatusOutput struct { + _ struct{} `type:"structure"` + + // A list of ConformancePackStatusDetail objects. + ConformancePackStatusDetails []*ConformancePackStatusDetail `type:"list"` + + // The nextToken string returned in a previous request that you use to request + // the next page of results in a paginated response. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeConformancePackStatusOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeConformancePackStatusOutput) GoString() string { + return s.String() +} + +// SetConformancePackStatusDetails sets the ConformancePackStatusDetails field's value. +func (s *DescribeConformancePackStatusOutput) SetConformancePackStatusDetails(v []*ConformancePackStatusDetail) *DescribeConformancePackStatusOutput { + s.ConformancePackStatusDetails = v return s } -// SetVersion sets the Version field's value. -func (s *ConfigurationItem) SetVersion(v string) *ConfigurationItem { - s.Version = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeConformancePackStatusOutput) SetNextToken(v string) *DescribeConformancePackStatusOutput { + s.NextToken = &v return s } -// An object that represents the recording of configuration changes of an AWS -// resource. -type ConfigurationRecorder struct { +type DescribeConformancePacksInput 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"` + // Comma-separated list of conformance pack names for which you want details. + // If you do not specify any names, AWS Config returns details for all your + // conformance packs. + ConformancePackNames []*string `type:"list"` - // Specifies the types of AWS resources for which AWS Config records configuration - // changes. - RecordingGroup *RecordingGroup `locationName:"recordingGroup" type:"structure"` + // The maximum number of conformance packs returned on each page. + Limit *int64 `type:"integer"` - // Amazon Resource Name (ARN) of the IAM role used to describe the AWS resources - // associated with the account. - RoleARN *string `locationName:"roleARN" type:"string"` + // The nextToken string returned in a previous request that you use to request + // the next page of results in a paginated response. + NextToken *string `type:"string"` } // String returns the string representation -func (s ConfigurationRecorder) String() string { +func (s DescribeConformancePacksInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConfigurationRecorder) GoString() string { +func (s DescribeConformancePacksInput) 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)) - } +// SetConformancePackNames sets the ConformancePackNames field's value. +func (s *DescribeConformancePacksInput) SetConformancePackNames(v []*string) *DescribeConformancePacksInput { + s.ConformancePackNames = v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetLimit sets the Limit field's value. +func (s *DescribeConformancePacksInput) SetLimit(v int64) *DescribeConformancePacksInput { + s.Limit = &v + return s } -// SetName sets the Name field's value. -func (s *ConfigurationRecorder) SetName(v string) *ConfigurationRecorder { - s.Name = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeConformancePacksInput) SetNextToken(v string) *DescribeConformancePacksInput { + s.NextToken = &v return s } -// SetRecordingGroup sets the RecordingGroup field's value. -func (s *ConfigurationRecorder) SetRecordingGroup(v *RecordingGroup) *ConfigurationRecorder { - s.RecordingGroup = v +type DescribeConformancePacksOutput struct { + _ struct{} `type:"structure"` + + // Returns a list of ConformancePackDetail objects. + ConformancePackDetails []*ConformancePackDetail `type:"list"` + + // The nextToken string returned in a previous request that you use to request + // the next page of results in a paginated response. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeConformancePacksOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeConformancePacksOutput) GoString() string { + return s.String() +} + +// SetConformancePackDetails sets the ConformancePackDetails field's value. +func (s *DescribeConformancePacksOutput) SetConformancePackDetails(v []*ConformancePackDetail) *DescribeConformancePacksOutput { + s.ConformancePackDetails = v return s } -// SetRoleARN sets the RoleARN field's value. -func (s *ConfigurationRecorder) SetRoleARN(v string) *ConfigurationRecorder { - s.RoleARN = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeConformancePacksOutput) SetNextToken(v string) *DescribeConformancePacksOutput { + s.NextToken = &v return s } -// The current status of the configuration recorder. -type ConfigurationRecorderStatus struct { +// The input for the DeliveryChannelStatus action. +type DescribeDeliveryChannelStatusInput 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"` + // A list of delivery channel names. + DeliveryChannelNames []*string `type:"list"` +} - // The last (previous) status of the recorder. - LastStatus *string `locationName:"lastStatus" type:"string" enum:"RecorderStatus"` +// String returns the string representation +func (s DescribeDeliveryChannelStatusInput) String() string { + return awsutil.Prettify(s) +} - // The time when the status was last changed. - LastStatusChangeTime *time.Time `locationName:"lastStatusChangeTime" type:"timestamp"` +// GoString returns the string representation +func (s DescribeDeliveryChannelStatusInput) GoString() string { + return s.String() +} - // The time the recorder was last stopped. - LastStopTime *time.Time `locationName:"lastStopTime" type:"timestamp"` +// SetDeliveryChannelNames sets the DeliveryChannelNames field's value. +func (s *DescribeDeliveryChannelStatusInput) SetDeliveryChannelNames(v []*string) *DescribeDeliveryChannelStatusInput { + s.DeliveryChannelNames = v + return s +} - // The name of the configuration recorder. - Name *string `locationName:"name" type:"string"` +// The output for the DescribeDeliveryChannelStatus action. +type DescribeDeliveryChannelStatusOutput struct { + _ struct{} `type:"structure"` - // Specifies whether or not the recorder is currently recording. - Recording *bool `locationName:"recording" type:"boolean"` + // A list that contains the status of a specified delivery channel. + DeliveryChannelsStatus []*DeliveryChannelStatus `type:"list"` } // String returns the string representation -func (s ConfigurationRecorderStatus) String() string { +func (s DescribeDeliveryChannelStatusOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConfigurationRecorderStatus) GoString() string { +func (s DescribeDeliveryChannelStatusOutput) GoString() string { return s.String() } -// SetLastErrorCode sets the LastErrorCode field's value. -func (s *ConfigurationRecorderStatus) SetLastErrorCode(v string) *ConfigurationRecorderStatus { - s.LastErrorCode = &v +// SetDeliveryChannelsStatus sets the DeliveryChannelsStatus field's value. +func (s *DescribeDeliveryChannelStatusOutput) SetDeliveryChannelsStatus(v []*DeliveryChannelStatus) *DescribeDeliveryChannelStatusOutput { + s.DeliveryChannelsStatus = v return s } -// SetLastErrorMessage sets the LastErrorMessage field's value. -func (s *ConfigurationRecorderStatus) SetLastErrorMessage(v string) *ConfigurationRecorderStatus { - s.LastErrorMessage = &v - return s +// The input for the DescribeDeliveryChannels action. +type DescribeDeliveryChannelsInput struct { + _ struct{} `type:"structure"` + + // A list of delivery channel names. + DeliveryChannelNames []*string `type:"list"` } -// SetLastStartTime sets the LastStartTime field's value. -func (s *ConfigurationRecorderStatus) SetLastStartTime(v time.Time) *ConfigurationRecorderStatus { - s.LastStartTime = &v - return s +// String returns the string representation +func (s DescribeDeliveryChannelsInput) String() string { + return awsutil.Prettify(s) } -// SetLastStatus sets the LastStatus field's value. -func (s *ConfigurationRecorderStatus) SetLastStatus(v string) *ConfigurationRecorderStatus { - s.LastStatus = &v - return s +// GoString returns the string representation +func (s DescribeDeliveryChannelsInput) GoString() string { + return s.String() } -// SetLastStatusChangeTime sets the LastStatusChangeTime field's value. -func (s *ConfigurationRecorderStatus) SetLastStatusChangeTime(v time.Time) *ConfigurationRecorderStatus { - s.LastStatusChangeTime = &v +// SetDeliveryChannelNames sets the DeliveryChannelNames field's value. +func (s *DescribeDeliveryChannelsInput) SetDeliveryChannelNames(v []*string) *DescribeDeliveryChannelsInput { + s.DeliveryChannelNames = v return s } -// SetLastStopTime sets the LastStopTime field's value. -func (s *ConfigurationRecorderStatus) SetLastStopTime(v time.Time) *ConfigurationRecorderStatus { - s.LastStopTime = &v - return s +// The output for the DescribeDeliveryChannels action. +type DescribeDeliveryChannelsOutput struct { + _ struct{} `type:"structure"` + + // A list that contains the descriptions of the specified delivery channel. + DeliveryChannels []*DeliveryChannel `type:"list"` } -// SetName sets the Name field's value. -func (s *ConfigurationRecorderStatus) SetName(v string) *ConfigurationRecorderStatus { - s.Name = &v - return s +// String returns the string representation +func (s DescribeDeliveryChannelsOutput) String() string { + return awsutil.Prettify(s) } -// SetRecording sets the Recording field's value. -func (s *ConfigurationRecorderStatus) SetRecording(v bool) *ConfigurationRecorderStatus { - s.Recording = &v +// 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 } -type DeleteAggregationAuthorizationInput struct { +type DescribeOrganizationConfigRuleStatusesInput struct { _ struct{} `type:"structure"` - // The 12-digit account ID of the account authorized to aggregate data. - // - // AuthorizedAccountId is a required field - AuthorizedAccountId *string `type:"string" required:"true"` + // The maximum number of OrganizationConfigRuleStatuses returned on each page. + // If you do no specify a number, AWS Config uses the default. The default is + // 100. + Limit *int64 `type:"integer"` - // The region authorized to collect aggregated data. - // - // AuthorizedAwsRegion is a required field - AuthorizedAwsRegion *string `min:"1" type:"string" required:"true"` + // 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 names of organization config rules for which you want status details. + // If you do not specify any names, AWS Config returns details for all your + // organization AWS Confg rules. + OrganizationConfigRuleNames []*string `type:"list"` } // String returns the string representation -func (s DeleteAggregationAuthorizationInput) String() string { +func (s DescribeOrganizationConfigRuleStatusesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteAggregationAuthorizationInput) GoString() string { +func (s DescribeOrganizationConfigRuleStatusesInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAggregationAuthorizationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAggregationAuthorizationInput"} - if s.AuthorizedAccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AuthorizedAccountId")) - } - if s.AuthorizedAwsRegion == nil { - invalidParams.Add(request.NewErrParamRequired("AuthorizedAwsRegion")) - } - if s.AuthorizedAwsRegion != nil && len(*s.AuthorizedAwsRegion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AuthorizedAwsRegion", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetLimit sets the Limit field's value. +func (s *DescribeOrganizationConfigRuleStatusesInput) SetLimit(v int64) *DescribeOrganizationConfigRuleStatusesInput { + s.Limit = &v + return s } -// SetAuthorizedAccountId sets the AuthorizedAccountId field's value. -func (s *DeleteAggregationAuthorizationInput) SetAuthorizedAccountId(v string) *DeleteAggregationAuthorizationInput { - s.AuthorizedAccountId = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeOrganizationConfigRuleStatusesInput) SetNextToken(v string) *DescribeOrganizationConfigRuleStatusesInput { + s.NextToken = &v return s } -// SetAuthorizedAwsRegion sets the AuthorizedAwsRegion field's value. -func (s *DeleteAggregationAuthorizationInput) SetAuthorizedAwsRegion(v string) *DeleteAggregationAuthorizationInput { - s.AuthorizedAwsRegion = &v +// SetOrganizationConfigRuleNames sets the OrganizationConfigRuleNames field's value. +func (s *DescribeOrganizationConfigRuleStatusesInput) SetOrganizationConfigRuleNames(v []*string) *DescribeOrganizationConfigRuleStatusesInput { + s.OrganizationConfigRuleNames = v return s } -type DeleteAggregationAuthorizationOutput struct { +type DescribeOrganizationConfigRuleStatusesOutput struct { _ struct{} `type:"structure"` + + // 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"` + + // A list of OrganizationConfigRuleStatus objects. + OrganizationConfigRuleStatuses []*OrganizationConfigRuleStatus `type:"list"` } // String returns the string representation -func (s DeleteAggregationAuthorizationOutput) String() string { +func (s DescribeOrganizationConfigRuleStatusesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteAggregationAuthorizationOutput) GoString() string { +func (s DescribeOrganizationConfigRuleStatusesOutput) GoString() string { return s.String() } -type DeleteConfigRuleInput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeOrganizationConfigRuleStatusesOutput) SetNextToken(v string) *DescribeOrganizationConfigRuleStatusesOutput { + s.NextToken = &v + return s +} + +// SetOrganizationConfigRuleStatuses sets the OrganizationConfigRuleStatuses field's value. +func (s *DescribeOrganizationConfigRuleStatusesOutput) SetOrganizationConfigRuleStatuses(v []*OrganizationConfigRuleStatus) *DescribeOrganizationConfigRuleStatusesOutput { + s.OrganizationConfigRuleStatuses = v + return s +} + +type DescribeOrganizationConfigRulesInput 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"` + // The maximum number of organization config rules returned on each page. If + // you do no specify a number, AWS Config uses the default. The default is 100. + 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 names of organization config rules for which you want details. If you + // do not specify any names, AWS Config returns details for all your organization + // config rules. + OrganizationConfigRuleNames []*string `type:"list"` } // String returns the string representation -func (s DeleteConfigRuleInput) String() string { +func (s DescribeOrganizationConfigRulesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteConfigRuleInput) GoString() string { +func (s DescribeOrganizationConfigRulesInput) 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)) - } +// SetLimit sets the Limit field's value. +func (s *DescribeOrganizationConfigRulesInput) SetLimit(v int64) *DescribeOrganizationConfigRulesInput { + s.Limit = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetNextToken sets the NextToken field's value. +func (s *DescribeOrganizationConfigRulesInput) SetNextToken(v string) *DescribeOrganizationConfigRulesInput { + s.NextToken = &v + return s } -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *DeleteConfigRuleInput) SetConfigRuleName(v string) *DeleteConfigRuleInput { - s.ConfigRuleName = &v +// SetOrganizationConfigRuleNames sets the OrganizationConfigRuleNames field's value. +func (s *DescribeOrganizationConfigRulesInput) SetOrganizationConfigRuleNames(v []*string) *DescribeOrganizationConfigRulesInput { + s.OrganizationConfigRuleNames = v return s } -type DeleteConfigRuleOutput struct { +type DescribeOrganizationConfigRulesOutput struct { _ struct{} `type:"structure"` + + // 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"` + + // Returns a list of OrganizationConfigRule objects. + OrganizationConfigRules []*OrganizationConfigRule `type:"list"` } // String returns the string representation -func (s DeleteConfigRuleOutput) String() string { +func (s DescribeOrganizationConfigRulesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteConfigRuleOutput) GoString() string { +func (s DescribeOrganizationConfigRulesOutput) GoString() string { return s.String() } -type DeleteConfigurationAggregatorInput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeOrganizationConfigRulesOutput) SetNextToken(v string) *DescribeOrganizationConfigRulesOutput { + s.NextToken = &v + return s +} + +// SetOrganizationConfigRules sets the OrganizationConfigRules field's value. +func (s *DescribeOrganizationConfigRulesOutput) SetOrganizationConfigRules(v []*OrganizationConfigRule) *DescribeOrganizationConfigRulesOutput { + s.OrganizationConfigRules = v + return s +} + +type DescribeOrganizationConformancePackStatusesInput struct { _ struct{} `type:"structure"` - // The name of the configuration aggregator. - // - // ConfigurationAggregatorName is a required field - ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` + // The maximum number of OrganizationConformancePackStatuses returned on each + // page. If you do no specify a number, AWS Config uses the default. The default + // is 100. + 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 names of organization conformance packs for which you want status details. + // If you do not specify any names, AWS Config returns details for all your + // organization conformance packs. + OrganizationConformancePackNames []*string `type:"list"` } // String returns the string representation -func (s DeleteConfigurationAggregatorInput) String() string { +func (s DescribeOrganizationConformancePackStatusesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteConfigurationAggregatorInput) GoString() string { +func (s DescribeOrganizationConformancePackStatusesInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteConfigurationAggregatorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteConfigurationAggregatorInput"} - if s.ConfigurationAggregatorName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) - } - if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) - } +// SetLimit sets the Limit field's value. +func (s *DescribeOrganizationConformancePackStatusesInput) SetLimit(v int64) *DescribeOrganizationConformancePackStatusesInput { + s.Limit = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetNextToken sets the NextToken field's value. +func (s *DescribeOrganizationConformancePackStatusesInput) SetNextToken(v string) *DescribeOrganizationConformancePackStatusesInput { + s.NextToken = &v + return s } -// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. -func (s *DeleteConfigurationAggregatorInput) SetConfigurationAggregatorName(v string) *DeleteConfigurationAggregatorInput { - s.ConfigurationAggregatorName = &v +// SetOrganizationConformancePackNames sets the OrganizationConformancePackNames field's value. +func (s *DescribeOrganizationConformancePackStatusesInput) SetOrganizationConformancePackNames(v []*string) *DescribeOrganizationConformancePackStatusesInput { + s.OrganizationConformancePackNames = v return s } -type DeleteConfigurationAggregatorOutput struct { +type DescribeOrganizationConformancePackStatusesOutput struct { _ struct{} `type:"structure"` + + // 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"` + + // A list of OrganizationConformancePackStatus objects. + OrganizationConformancePackStatuses []*OrganizationConformancePackStatus `type:"list"` } // String returns the string representation -func (s DeleteConfigurationAggregatorOutput) String() string { +func (s DescribeOrganizationConformancePackStatusesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteConfigurationAggregatorOutput) GoString() string { +func (s DescribeOrganizationConformancePackStatusesOutput) GoString() string { return s.String() } -// The request object for the DeleteConfigurationRecorder action. -type DeleteConfigurationRecorderInput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeOrganizationConformancePackStatusesOutput) SetNextToken(v string) *DescribeOrganizationConformancePackStatusesOutput { + s.NextToken = &v + return s +} + +// SetOrganizationConformancePackStatuses sets the OrganizationConformancePackStatuses field's value. +func (s *DescribeOrganizationConformancePackStatusesOutput) SetOrganizationConformancePackStatuses(v []*OrganizationConformancePackStatus) *DescribeOrganizationConformancePackStatusesOutput { + s.OrganizationConformancePackStatuses = v + return s +} + +type DescribeOrganizationConformancePacksInput 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"` + // The maximum number of organization config packs returned on each page. If + // you do no specify a number, AWS Config uses the default. The default is 100. + 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 name that you assign to an organization conformance pack. + OrganizationConformancePackNames []*string `type:"list"` } // String returns the string representation -func (s DeleteConfigurationRecorderInput) String() string { +func (s DescribeOrganizationConformancePacksInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteConfigurationRecorderInput) GoString() string { +func (s DescribeOrganizationConformancePacksInput) 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)) - } +// SetLimit sets the Limit field's value. +func (s *DescribeOrganizationConformancePacksInput) SetLimit(v int64) *DescribeOrganizationConformancePacksInput { + s.Limit = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetNextToken sets the NextToken field's value. +func (s *DescribeOrganizationConformancePacksInput) SetNextToken(v string) *DescribeOrganizationConformancePacksInput { + s.NextToken = &v + return s } -// SetConfigurationRecorderName sets the ConfigurationRecorderName field's value. -func (s *DeleteConfigurationRecorderInput) SetConfigurationRecorderName(v string) *DeleteConfigurationRecorderInput { - s.ConfigurationRecorderName = &v +// SetOrganizationConformancePackNames sets the OrganizationConformancePackNames field's value. +func (s *DescribeOrganizationConformancePacksInput) SetOrganizationConformancePackNames(v []*string) *DescribeOrganizationConformancePacksInput { + s.OrganizationConformancePackNames = v return s } -type DeleteConfigurationRecorderOutput struct { +type DescribeOrganizationConformancePacksOutput struct { _ struct{} `type:"structure"` + + // 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"` + + // Returns a list of OrganizationConformancePacks objects. + OrganizationConformancePacks []*OrganizationConformancePack `type:"list"` } // String returns the string representation -func (s DeleteConfigurationRecorderOutput) String() string { +func (s DescribeOrganizationConformancePacksOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteConfigurationRecorderOutput) GoString() string { +func (s DescribeOrganizationConformancePacksOutput) GoString() string { return s.String() } -// The input for the DeleteDeliveryChannel action. The action accepts the following -// data, in JSON format. -type DeleteDeliveryChannelInput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeOrganizationConformancePacksOutput) SetNextToken(v string) *DescribeOrganizationConformancePacksOutput { + s.NextToken = &v + return s +} + +// SetOrganizationConformancePacks sets the OrganizationConformancePacks field's value. +func (s *DescribeOrganizationConformancePacksOutput) SetOrganizationConformancePacks(v []*OrganizationConformancePack) *DescribeOrganizationConformancePacksOutput { + s.OrganizationConformancePacks = v + return s +} + +type DescribePendingAggregationRequestsInput 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"` + // The maximum number of evaluation results returned on each page. The default + // is maximum. 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 DeleteDeliveryChannelInput) String() string { +func (s DescribePendingAggregationRequestsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteDeliveryChannelInput) GoString() string { +func (s DescribePendingAggregationRequestsInput) 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 +// SetLimit sets the Limit field's value. +func (s *DescribePendingAggregationRequestsInput) SetLimit(v int64) *DescribePendingAggregationRequestsInput { + s.Limit = &v + return s } -// SetDeliveryChannelName sets the DeliveryChannelName field's value. -func (s *DeleteDeliveryChannelInput) SetDeliveryChannelName(v string) *DeleteDeliveryChannelInput { - s.DeliveryChannelName = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribePendingAggregationRequestsInput) SetNextToken(v string) *DescribePendingAggregationRequestsInput { + s.NextToken = &v return s } -type DeleteDeliveryChannelOutput struct { +type DescribePendingAggregationRequestsOutput struct { _ struct{} `type:"structure"` + + // 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"` + + // Returns a PendingAggregationRequests object. + PendingAggregationRequests []*PendingAggregationRequest `type:"list"` } // String returns the string representation -func (s DeleteDeliveryChannelOutput) String() string { +func (s DescribePendingAggregationRequestsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteDeliveryChannelOutput) GoString() string { +func (s DescribePendingAggregationRequestsOutput) GoString() string { return s.String() } -type DeleteEvaluationResultsInput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribePendingAggregationRequestsOutput) SetNextToken(v string) *DescribePendingAggregationRequestsOutput { + s.NextToken = &v + return s +} + +// SetPendingAggregationRequests sets the PendingAggregationRequests field's value. +func (s *DescribePendingAggregationRequestsOutput) SetPendingAggregationRequests(v []*PendingAggregationRequest) *DescribePendingAggregationRequestsOutput { + s.PendingAggregationRequests = v + return s +} + +type DescribeRemediationConfigurationsInput struct { _ struct{} `type:"structure"` - // The name of the AWS Config rule for which you want to delete the evaluation - // results. + // A list of AWS Config rule names of remediation configurations for which you + // want details. // - // ConfigRuleName is a required field - ConfigRuleName *string `min:"1" type:"string" required:"true"` + // ConfigRuleNames is a required field + ConfigRuleNames []*string `type:"list" required:"true"` } // String returns the string representation -func (s DeleteEvaluationResultsInput) String() string { +func (s DescribeRemediationConfigurationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteEvaluationResultsInput) GoString() string { +func (s DescribeRemediationConfigurationsInput) 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)) +func (s *DescribeRemediationConfigurationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeRemediationConfigurationsInput"} + if s.ConfigRuleNames == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigRuleNames")) } if invalidParams.Len() > 0 { @@ -8661,55 +13326,88 @@ func (s *DeleteEvaluationResultsInput) Validate() error { return nil } -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *DeleteEvaluationResultsInput) SetConfigRuleName(v string) *DeleteEvaluationResultsInput { - s.ConfigRuleName = &v +// SetConfigRuleNames sets the ConfigRuleNames field's value. +func (s *DescribeRemediationConfigurationsInput) SetConfigRuleNames(v []*string) *DescribeRemediationConfigurationsInput { + s.ConfigRuleNames = v return s } -// The output when you delete the evaluation results for the specified AWS Config -// rule. -type DeleteEvaluationResultsOutput struct { +type DescribeRemediationConfigurationsOutput struct { _ struct{} `type:"structure"` + + // Returns a remediation configuration object. + RemediationConfigurations []*RemediationConfiguration `type:"list"` } // String returns the string representation -func (s DeleteEvaluationResultsOutput) String() string { +func (s DescribeRemediationConfigurationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteEvaluationResultsOutput) GoString() string { +func (s DescribeRemediationConfigurationsOutput) GoString() string { return s.String() } -type DeleteOrganizationConfigRuleInput struct { +// SetRemediationConfigurations sets the RemediationConfigurations field's value. +func (s *DescribeRemediationConfigurationsOutput) SetRemediationConfigurations(v []*RemediationConfiguration) *DescribeRemediationConfigurationsOutput { + s.RemediationConfigurations = v + return s +} + +type DescribeRemediationExceptionsInput struct { _ struct{} `type:"structure"` - // The name of organization config rule that you want to delete. + // The name of the AWS Config rule. // - // OrganizationConfigRuleName is a required field - OrganizationConfigRuleName *string `min:"1" type:"string" required:"true"` + // ConfigRuleName is a required field + ConfigRuleName *string `min:"1" type:"string" required:"true"` + + // The maximum number of RemediationExceptionResourceKey returned on each page. + // The default is 25. If you specify 0, AWS Config uses the default. + Limit *int64 `type:"integer"` + + // The nextToken string returned in a previous request that you use to request + // the next page of results in a paginated response. + NextToken *string `type:"string"` + + // An exception list of resource exception keys to be processed with the current + // request. AWS Config adds exception for each resource key. For example, AWS + // Config adds 3 exceptions for 3 resource keys. + ResourceKeys []*RemediationExceptionResourceKey `min:"1" type:"list"` } // String returns the string representation -func (s DeleteOrganizationConfigRuleInput) String() string { +func (s DescribeRemediationExceptionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteOrganizationConfigRuleInput) GoString() string { +func (s DescribeRemediationExceptionsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteOrganizationConfigRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteOrganizationConfigRuleInput"} - if s.OrganizationConfigRuleName == nil { - invalidParams.Add(request.NewErrParamRequired("OrganizationConfigRuleName")) +func (s *DescribeRemediationExceptionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeRemediationExceptionsInput"} + if s.ConfigRuleName == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigRuleName")) } - if s.OrganizationConfigRuleName != nil && len(*s.OrganizationConfigRuleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OrganizationConfigRuleName", 1)) + if s.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) + } + if s.ResourceKeys != nil && len(s.ResourceKeys) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceKeys", 1)) + } + if s.ResourceKeys != nil { + for i, v := range s.ResourceKeys { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceKeys", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -8718,61 +13416,115 @@ func (s *DeleteOrganizationConfigRuleInput) Validate() error { return nil } -// SetOrganizationConfigRuleName sets the OrganizationConfigRuleName field's value. -func (s *DeleteOrganizationConfigRuleInput) SetOrganizationConfigRuleName(v string) *DeleteOrganizationConfigRuleInput { - s.OrganizationConfigRuleName = &v +// SetConfigRuleName sets the ConfigRuleName field's value. +func (s *DescribeRemediationExceptionsInput) SetConfigRuleName(v string) *DescribeRemediationExceptionsInput { + s.ConfigRuleName = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *DescribeRemediationExceptionsInput) SetLimit(v int64) *DescribeRemediationExceptionsInput { + s.Limit = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeRemediationExceptionsInput) SetNextToken(v string) *DescribeRemediationExceptionsInput { + s.NextToken = &v return s } -type DeleteOrganizationConfigRuleOutput struct { +// SetResourceKeys sets the ResourceKeys field's value. +func (s *DescribeRemediationExceptionsInput) SetResourceKeys(v []*RemediationExceptionResourceKey) *DescribeRemediationExceptionsInput { + s.ResourceKeys = v + return s +} + +type DescribeRemediationExceptionsOutput struct { _ struct{} `type:"structure"` + + // The nextToken string returned in a previous request that you use to request + // the next page of results in a paginated response. + NextToken *string `type:"string"` + + // Returns a list of remediation exception objects. + RemediationExceptions []*RemediationException `type:"list"` } // String returns the string representation -func (s DeleteOrganizationConfigRuleOutput) String() string { +func (s DescribeRemediationExceptionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteOrganizationConfigRuleOutput) GoString() string { +func (s DescribeRemediationExceptionsOutput) GoString() string { return s.String() } -type DeletePendingAggregationRequestInput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeRemediationExceptionsOutput) SetNextToken(v string) *DescribeRemediationExceptionsOutput { + s.NextToken = &v + return s +} + +// SetRemediationExceptions sets the RemediationExceptions field's value. +func (s *DescribeRemediationExceptionsOutput) SetRemediationExceptions(v []*RemediationException) *DescribeRemediationExceptionsOutput { + s.RemediationExceptions = v + return s +} + +type DescribeRemediationExecutionStatusInput struct { _ struct{} `type:"structure"` - // The 12-digit account ID of the account requesting to aggregate data. + // A list of AWS Config rule names. // - // RequesterAccountId is a required field - RequesterAccountId *string `type:"string" required:"true"` + // ConfigRuleName is a required field + ConfigRuleName *string `min:"1" type:"string" required:"true"` - // The region requesting to aggregate data. - // - // RequesterAwsRegion is a required field - RequesterAwsRegion *string `min:"1" type:"string" required:"true"` + // The maximum number of RemediationExecutionStatuses returned on each page. + // The default is maximum. 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"` + + // A list of resource keys to be processed with the current request. Each element + // in the list consists of the resource type and resource ID. + ResourceKeys []*ResourceKey `min:"1" type:"list"` } // String returns the string representation -func (s DeletePendingAggregationRequestInput) String() string { +func (s DescribeRemediationExecutionStatusInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeletePendingAggregationRequestInput) GoString() string { +func (s DescribeRemediationExecutionStatusInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePendingAggregationRequestInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePendingAggregationRequestInput"} - if s.RequesterAccountId == nil { - invalidParams.Add(request.NewErrParamRequired("RequesterAccountId")) +func (s *DescribeRemediationExecutionStatusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeRemediationExecutionStatusInput"} + if s.ConfigRuleName == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigRuleName")) } - if s.RequesterAwsRegion == nil { - invalidParams.Add(request.NewErrParamRequired("RequesterAwsRegion")) + if s.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) } - if s.RequesterAwsRegion != nil && len(*s.RequesterAwsRegion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RequesterAwsRegion", 1)) + if s.ResourceKeys != nil && len(s.ResourceKeys) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceKeys", 1)) + } + if s.ResourceKeys != nil { + for i, v := range s.ResourceKeys { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceKeys", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -8781,148 +13533,210 @@ func (s *DeletePendingAggregationRequestInput) Validate() error { return nil } -// SetRequesterAccountId sets the RequesterAccountId field's value. -func (s *DeletePendingAggregationRequestInput) SetRequesterAccountId(v string) *DeletePendingAggregationRequestInput { - s.RequesterAccountId = &v +// SetConfigRuleName sets the ConfigRuleName field's value. +func (s *DescribeRemediationExecutionStatusInput) SetConfigRuleName(v string) *DescribeRemediationExecutionStatusInput { + s.ConfigRuleName = &v return s } -// SetRequesterAwsRegion sets the RequesterAwsRegion field's value. -func (s *DeletePendingAggregationRequestInput) SetRequesterAwsRegion(v string) *DeletePendingAggregationRequestInput { - s.RequesterAwsRegion = &v +// SetLimit sets the Limit field's value. +func (s *DescribeRemediationExecutionStatusInput) SetLimit(v int64) *DescribeRemediationExecutionStatusInput { + s.Limit = &v return s } -type DeletePendingAggregationRequestOutput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeRemediationExecutionStatusInput) SetNextToken(v string) *DescribeRemediationExecutionStatusInput { + s.NextToken = &v + return s +} + +// SetResourceKeys sets the ResourceKeys field's value. +func (s *DescribeRemediationExecutionStatusInput) SetResourceKeys(v []*ResourceKey) *DescribeRemediationExecutionStatusInput { + s.ResourceKeys = v + return s +} + +type DescribeRemediationExecutionStatusOutput struct { _ struct{} `type:"structure"` + + // 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"` + + // Returns a list of remediation execution statuses objects. + RemediationExecutionStatuses []*RemediationExecutionStatus `type:"list"` } // String returns the string representation -func (s DeletePendingAggregationRequestOutput) String() string { +func (s DescribeRemediationExecutionStatusOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeletePendingAggregationRequestOutput) GoString() string { +func (s DescribeRemediationExecutionStatusOutput) GoString() string { return s.String() } -type DeleteRemediationConfigurationInput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeRemediationExecutionStatusOutput) SetNextToken(v string) *DescribeRemediationExecutionStatusOutput { + s.NextToken = &v + return s +} + +// SetRemediationExecutionStatuses sets the RemediationExecutionStatuses field's value. +func (s *DescribeRemediationExecutionStatusOutput) SetRemediationExecutionStatuses(v []*RemediationExecutionStatus) *DescribeRemediationExecutionStatusOutput { + s.RemediationExecutionStatuses = v + return s +} + +type DescribeRetentionConfigurationsInput struct { _ struct{} `type:"structure"` - // The name of the AWS Config rule for which you want to delete remediation - // configuration. - // - // ConfigRuleName is a required field - ConfigRuleName *string `min:"1" type:"string" required:"true"` + // 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 type of a resource. - ResourceType *string `type:"string"` + // A list of names of retention configurations for which you want details. If + // you do not specify a name, AWS Config returns details for all the retention + // configurations for that account. + // + // Currently, AWS Config supports only one retention configuration per region + // in your account. + RetentionConfigurationNames []*string `type:"list"` } // String returns the string representation -func (s DeleteRemediationConfigurationInput) String() string { +func (s DescribeRetentionConfigurationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteRemediationConfigurationInput) GoString() string { +func (s DescribeRetentionConfigurationsInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRemediationConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRemediationConfigurationInput"} - 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 *DeleteRemediationConfigurationInput) SetConfigRuleName(v string) *DeleteRemediationConfigurationInput { - s.ConfigRuleName = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeRetentionConfigurationsInput) SetNextToken(v string) *DescribeRetentionConfigurationsInput { + s.NextToken = &v return s } -// SetResourceType sets the ResourceType field's value. -func (s *DeleteRemediationConfigurationInput) SetResourceType(v string) *DeleteRemediationConfigurationInput { - s.ResourceType = &v +// SetRetentionConfigurationNames sets the RetentionConfigurationNames field's value. +func (s *DescribeRetentionConfigurationsInput) SetRetentionConfigurationNames(v []*string) *DescribeRetentionConfigurationsInput { + s.RetentionConfigurationNames = v return s } -type DeleteRemediationConfigurationOutput struct { +type DescribeRetentionConfigurationsOutput struct { _ struct{} `type:"structure"` + + // 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"` + + // Returns a retention configuration object. + RetentionConfigurations []*RetentionConfiguration `type:"list"` } // String returns the string representation -func (s DeleteRemediationConfigurationOutput) String() string { +func (s DescribeRetentionConfigurationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteRemediationConfigurationOutput) GoString() string { +func (s DescribeRetentionConfigurationsOutput) GoString() string { return s.String() } -type DeleteRemediationExceptionsInput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeRetentionConfigurationsOutput) SetNextToken(v string) *DescribeRetentionConfigurationsOutput { + s.NextToken = &v + return s +} + +// SetRetentionConfigurations sets the RetentionConfigurations field's value. +func (s *DescribeRetentionConfigurationsOutput) SetRetentionConfigurations(v []*RetentionConfiguration) *DescribeRetentionConfigurationsOutput { + s.RetentionConfigurations = v + return s +} + +// Identifies an AWS resource and indicates whether it complies with the AWS +// Config rule that it was evaluated against. +type Evaluation struct { _ struct{} `type:"structure"` - // The name of the AWS Config rule for which you want to delete remediation - // exception configuration. + // Supplementary information about how the evaluation determined the compliance. + Annotation *string `min:"1" type:"string"` + + // The ID of the AWS resource that was evaluated. // - // ConfigRuleName is a required field - ConfigRuleName *string `min:"1" type:"string" required:"true"` + // ComplianceResourceId is a required field + ComplianceResourceId *string `min:"1" type:"string" required:"true"` - // An exception list of resource exception keys to be processed with the current - // request. AWS Config adds exception for each resource key. For example, AWS - // Config adds 3 exceptions for 3 resource keys. + // 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 AWS 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). // - // ResourceKeys is a required field - ResourceKeys []*RemediationExceptionResourceKey `min:"1" type:"list" required:"true"` + // OrderingTimestamp is a required field + OrderingTimestamp *time.Time `type:"timestamp" required:"true"` } // String returns the string representation -func (s DeleteRemediationExceptionsInput) String() string { +func (s Evaluation) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteRemediationExceptionsInput) GoString() string { +func (s Evaluation) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRemediationExceptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRemediationExceptionsInput"} - if s.ConfigRuleName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigRuleName")) +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.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) + if s.ComplianceResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ComplianceResourceId")) } - if s.ResourceKeys == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceKeys")) + if s.ComplianceResourceId != nil && len(*s.ComplianceResourceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ComplianceResourceId", 1)) } - if s.ResourceKeys != nil && len(s.ResourceKeys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceKeys", 1)) + if s.ComplianceResourceType == nil { + invalidParams.Add(request.NewErrParamRequired("ComplianceResourceType")) } - if s.ResourceKeys != nil { - for i, v := range s.ResourceKeys { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceKeys", i), err.(request.ErrInvalidParams)) - } - } + 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 { @@ -8931,216 +13745,219 @@ func (s *DeleteRemediationExceptionsInput) Validate() error { return nil } -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *DeleteRemediationExceptionsInput) SetConfigRuleName(v string) *DeleteRemediationExceptionsInput { - s.ConfigRuleName = &v +// SetAnnotation sets the Annotation field's value. +func (s *Evaluation) SetAnnotation(v string) *Evaluation { + s.Annotation = &v return s } -// SetResourceKeys sets the ResourceKeys field's value. -func (s *DeleteRemediationExceptionsInput) SetResourceKeys(v []*RemediationExceptionResourceKey) *DeleteRemediationExceptionsInput { - s.ResourceKeys = v +// SetComplianceResourceId sets the ComplianceResourceId field's value. +func (s *Evaluation) SetComplianceResourceId(v string) *Evaluation { + s.ComplianceResourceId = &v return s } -type DeleteRemediationExceptionsOutput struct { - _ struct{} `type:"structure"` - - // Returns a list of failed delete remediation exceptions batch objects. Each - // object in the batch consists of a list of failed items and failure messages. - FailedBatches []*FailedDeleteRemediationExceptionsBatch `type:"list"` -} - -// String returns the string representation -func (s DeleteRemediationExceptionsOutput) String() string { - return awsutil.Prettify(s) +// SetComplianceResourceType sets the ComplianceResourceType field's value. +func (s *Evaluation) SetComplianceResourceType(v string) *Evaluation { + s.ComplianceResourceType = &v + return s } -// GoString returns the string representation -func (s DeleteRemediationExceptionsOutput) GoString() string { - return s.String() +// SetComplianceType sets the ComplianceType field's value. +func (s *Evaluation) SetComplianceType(v string) *Evaluation { + s.ComplianceType = &v + return s } -// SetFailedBatches sets the FailedBatches field's value. -func (s *DeleteRemediationExceptionsOutput) SetFailedBatches(v []*FailedDeleteRemediationExceptionsBatch) *DeleteRemediationExceptionsOutput { - s.FailedBatches = v +// SetOrderingTimestamp sets the OrderingTimestamp field's value. +func (s *Evaluation) SetOrderingTimestamp(v time.Time) *Evaluation { + s.OrderingTimestamp = &v return s } -type DeleteRetentionConfigurationInput struct { +// The details of an AWS Config evaluation. Provides the AWS resource that was +// evaluated, the compliance of the resource, related time stamps, and supplementary +// information. +type EvaluationResult struct { _ struct{} `type:"structure"` - // The name of the retention configuration to delete. + // 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. // - // RetentionConfigurationName is a required field - RetentionConfigurationName *string `min:"1" type:"string" required:"true"` + // 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"` + + // Uniquely identifies the evaluation result. + EvaluationResultIdentifier *EvaluationResultIdentifier `type:"structure"` + + // The time when AWS Config recorded the evaluation result. + ResultRecordedTime *time.Time `type:"timestamp"` + + // 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 DeleteRetentionConfigurationInput) String() string { +func (s EvaluationResult) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteRetentionConfigurationInput) GoString() string { +func (s EvaluationResult) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRetentionConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRetentionConfigurationInput"} - if s.RetentionConfigurationName == nil { - invalidParams.Add(request.NewErrParamRequired("RetentionConfigurationName")) - } - if s.RetentionConfigurationName != nil && len(*s.RetentionConfigurationName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RetentionConfigurationName", 1)) - } +// SetAnnotation sets the Annotation field's value. +func (s *EvaluationResult) SetAnnotation(v string) *EvaluationResult { + s.Annotation = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetComplianceType sets the ComplianceType field's value. +func (s *EvaluationResult) SetComplianceType(v string) *EvaluationResult { + s.ComplianceType = &v + return s } -// SetRetentionConfigurationName sets the RetentionConfigurationName field's value. -func (s *DeleteRetentionConfigurationInput) SetRetentionConfigurationName(v string) *DeleteRetentionConfigurationInput { - s.RetentionConfigurationName = &v +// SetConfigRuleInvokedTime sets the ConfigRuleInvokedTime field's value. +func (s *EvaluationResult) SetConfigRuleInvokedTime(v time.Time) *EvaluationResult { + s.ConfigRuleInvokedTime = &v return s } -type DeleteRetentionConfigurationOutput struct { - _ struct{} `type:"structure"` +// SetEvaluationResultIdentifier sets the EvaluationResultIdentifier field's value. +func (s *EvaluationResult) SetEvaluationResultIdentifier(v *EvaluationResultIdentifier) *EvaluationResult { + s.EvaluationResultIdentifier = v + return s } -// String returns the string representation -func (s DeleteRetentionConfigurationOutput) String() string { - return awsutil.Prettify(s) +// SetResultRecordedTime sets the ResultRecordedTime field's value. +func (s *EvaluationResult) SetResultRecordedTime(v time.Time) *EvaluationResult { + s.ResultRecordedTime = &v + return s } -// GoString returns the string representation -func (s DeleteRetentionConfigurationOutput) GoString() string { - return s.String() +// SetResultToken sets the ResultToken field's value. +func (s *EvaluationResult) SetResultToken(v string) *EvaluationResult { + s.ResultToken = &v + return s } -// The input for the DeliverConfigSnapshot action. -type DeliverConfigSnapshotInput struct { +// Uniquely identifies an evaluation result. +type EvaluationResultIdentifier 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"` + // 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"` } // String returns the string representation -func (s DeliverConfigSnapshotInput) String() string { +func (s EvaluationResultIdentifier) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeliverConfigSnapshotInput) GoString() string { +func (s EvaluationResultIdentifier) 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 +// SetEvaluationResultQualifier sets the EvaluationResultQualifier field's value. +func (s *EvaluationResultIdentifier) SetEvaluationResultQualifier(v *EvaluationResultQualifier) *EvaluationResultIdentifier { + s.EvaluationResultQualifier = v + return s } -// SetDeliveryChannelName sets the DeliveryChannelName field's value. -func (s *DeliverConfigSnapshotInput) SetDeliveryChannelName(v string) *DeliverConfigSnapshotInput { - s.DeliveryChannelName = &v +// SetOrderingTimestamp sets the OrderingTimestamp field's value. +func (s *EvaluationResultIdentifier) SetOrderingTimestamp(v time.Time) *EvaluationResultIdentifier { + s.OrderingTimestamp = &v return s } -// The output for the DeliverConfigSnapshot action, in JSON format. -type DeliverConfigSnapshotOutput struct { +// Identifies an AWS Config rule that evaluated an AWS resource, and provides +// the type and ID of the resource that the rule evaluated. +type EvaluationResultQualifier struct { _ struct{} `type:"structure"` - // The ID of the snapshot that is being created. - ConfigSnapshotId *string `locationName:"configSnapshotId" type:"string"` + // 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 DeliverConfigSnapshotOutput) String() string { +func (s EvaluationResultQualifier) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeliverConfigSnapshotOutput) GoString() string { +func (s EvaluationResultQualifier) GoString() string { return s.String() } -// SetConfigSnapshotId sets the ConfigSnapshotId field's value. -func (s *DeliverConfigSnapshotOutput) SetConfigSnapshotId(v string) *DeliverConfigSnapshotOutput { - s.ConfigSnapshotId = &v +// SetConfigRuleName sets the ConfigRuleName field's value. +func (s *EvaluationResultQualifier) SetConfigRuleName(v string) *EvaluationResultQualifier { + s.ConfigRuleName = &v return s } -// The channel through which AWS Config delivers notifications and updated configuration -// states. -type DeliveryChannel struct { - _ struct{} `type:"structure"` - - // The options for how often AWS Config delivers configuration snapshots to - // the Amazon S3 bucket. - 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"` +// SetResourceId sets the ResourceId field's value. +func (s *EvaluationResultQualifier) SetResourceId(v string) *EvaluationResultQualifier { + s.ResourceId = &v + return s +} - // 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 (https://docs.aws.amazon.com/config/latest/developerguide/s3-bucket-policy.html) - // in the AWS Config Developer Guide. - S3BucketName *string `locationName:"s3BucketName" type:"string"` +// SetResourceType sets the ResourceType field's value. +func (s *EvaluationResultQualifier) SetResourceType(v string) *EvaluationResultQualifier { + s.ResourceType = &v + return s +} - // The prefix for the specified Amazon S3 bucket. - S3KeyPrefix *string `locationName:"s3KeyPrefix" type:"string"` +// The controls that AWS Config uses for executing remediations. +type ExecutionControls struct { + _ struct{} `type:"structure"` - // 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 (https://docs.aws.amazon.com/config/latest/developerguide/sns-topic-policy.html) - // in the AWS Config Developer Guide. - SnsTopicARN *string `locationName:"snsTopicARN" type:"string"` + // A SsmControls object. + SsmControls *SsmControls `type:"structure"` } // String returns the string representation -func (s DeliveryChannel) String() string { +func (s ExecutionControls) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeliveryChannel) GoString() string { +func (s ExecutionControls) 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)) +func (s *ExecutionControls) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ExecutionControls"} + if s.SsmControls != nil { + if err := s.SsmControls.Validate(); err != nil { + invalidParams.AddNested("SsmControls", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -9149,172 +13966,170 @@ func (s *DeliveryChannel) Validate() error { return nil } -// SetConfigSnapshotDeliveryProperties sets the ConfigSnapshotDeliveryProperties field's value. -func (s *DeliveryChannel) SetConfigSnapshotDeliveryProperties(v *ConfigSnapshotDeliveryProperties) *DeliveryChannel { - s.ConfigSnapshotDeliveryProperties = v +// SetSsmControls sets the SsmControls field's value. +func (s *ExecutionControls) SetSsmControls(v *SsmControls) *ExecutionControls { + s.SsmControls = v return s } -// SetName sets the Name field's value. -func (s *DeliveryChannel) SetName(v string) *DeliveryChannel { - s.Name = &v - return s +// List of each of the failed delete remediation exceptions with specific reasons. +type FailedDeleteRemediationExceptionsBatch struct { + _ struct{} `type:"structure"` + + // Returns remediation exception resource key object of the failed items. + FailedItems []*RemediationExceptionResourceKey `min:"1" type:"list"` + + // Returns a failure message for delete remediation exception. For example, + // AWS Config creates an exception due to an internal error. + FailureMessage *string `type:"string"` } -// SetS3BucketName sets the S3BucketName field's value. -func (s *DeliveryChannel) SetS3BucketName(v string) *DeliveryChannel { - s.S3BucketName = &v - return s +// String returns the string representation +func (s FailedDeleteRemediationExceptionsBatch) String() string { + return awsutil.Prettify(s) } -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *DeliveryChannel) SetS3KeyPrefix(v string) *DeliveryChannel { - s.S3KeyPrefix = &v +// GoString returns the string representation +func (s FailedDeleteRemediationExceptionsBatch) GoString() string { + return s.String() +} + +// SetFailedItems sets the FailedItems field's value. +func (s *FailedDeleteRemediationExceptionsBatch) SetFailedItems(v []*RemediationExceptionResourceKey) *FailedDeleteRemediationExceptionsBatch { + s.FailedItems = v return s } -// SetSnsTopicARN sets the SnsTopicARN field's value. -func (s *DeliveryChannel) SetSnsTopicARN(v string) *DeliveryChannel { - s.SnsTopicARN = &v +// SetFailureMessage sets the FailureMessage field's value. +func (s *FailedDeleteRemediationExceptionsBatch) SetFailureMessage(v string) *FailedDeleteRemediationExceptionsBatch { + s.FailureMessage = &v return s } -// The status of a specified delivery channel. -// -// Valid values: Success | Failure -type DeliveryChannelStatus struct { +// List of each of the failed remediations with specific reasons. +type FailedRemediationBatch 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"` + // Returns remediation configurations of the failed items. + FailedItems []*RemediationConfiguration `type:"list"` - // The name of the delivery channel. - Name *string `locationName:"name" type:"string"` + // Returns a failure message. For example, the resource is already compliant. + FailureMessage *string `type:"string"` } // String returns the string representation -func (s DeliveryChannelStatus) String() string { +func (s FailedRemediationBatch) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeliveryChannelStatus) GoString() string { +func (s FailedRemediationBatch) 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 +// SetFailedItems sets the FailedItems field's value. +func (s *FailedRemediationBatch) SetFailedItems(v []*RemediationConfiguration) *FailedRemediationBatch { + s.FailedItems = v return s } -// SetName sets the Name field's value. -func (s *DeliveryChannelStatus) SetName(v string) *DeliveryChannelStatus { - s.Name = &v +// SetFailureMessage sets the FailureMessage field's value. +func (s *FailedRemediationBatch) SetFailureMessage(v string) *FailedRemediationBatch { + s.FailureMessage = &v return s } -type DescribeAggregateComplianceByConfigRulesInput struct { +// List of each of the failed remediation exceptions with specific reasons. +type FailedRemediationExceptionBatch struct { _ struct{} `type:"structure"` - // The name of the configuration aggregator. - // - // ConfigurationAggregatorName is a required field - ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` - - // Filters the results by ConfigRuleComplianceFilters object. - Filters *ConfigRuleComplianceFilters `type:"structure"` - - // The maximum number of evaluation results returned on each page. The default - // is maximum. If you specify 0, AWS Config uses the default. - Limit *int64 `type:"integer"` + // Returns remediation exception resource key object of the failed items. + FailedItems []*RemediationException `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"` + // Returns a failure message. For example, the auto-remediation has failed. + FailureMessage *string `type:"string"` } // String returns the string representation -func (s DescribeAggregateComplianceByConfigRulesInput) String() string { +func (s FailedRemediationExceptionBatch) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAggregateComplianceByConfigRulesInput) GoString() string { +func (s FailedRemediationExceptionBatch) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAggregateComplianceByConfigRulesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAggregateComplianceByConfigRulesInput"} - if s.ConfigurationAggregatorName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) - } - if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) - } - if s.Filters != nil { - if err := s.Filters.Validate(); err != nil { - invalidParams.AddNested("Filters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetFailedItems sets the FailedItems field's value. +func (s *FailedRemediationExceptionBatch) SetFailedItems(v []*RemediationException) *FailedRemediationExceptionBatch { + s.FailedItems = v + return s } -// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. -func (s *DescribeAggregateComplianceByConfigRulesInput) SetConfigurationAggregatorName(v string) *DescribeAggregateComplianceByConfigRulesInput { - s.ConfigurationAggregatorName = &v +// SetFailureMessage sets the FailureMessage field's value. +func (s *FailedRemediationExceptionBatch) SetFailureMessage(v string) *FailedRemediationExceptionBatch { + s.FailureMessage = &v return s } -// SetFilters sets the Filters field's value. -func (s *DescribeAggregateComplianceByConfigRulesInput) SetFilters(v *ConfigRuleComplianceFilters) *DescribeAggregateComplianceByConfigRulesInput { - s.Filters = v - return s +// Details about the fields such as name of the field. +type FieldInfo struct { + _ struct{} `type:"structure"` + + // Name of the field. + Name *string `type:"string"` } -// SetLimit sets the Limit field's value. -func (s *DescribeAggregateComplianceByConfigRulesInput) SetLimit(v int64) *DescribeAggregateComplianceByConfigRulesInput { - s.Limit = &v - return s +// String returns the string representation +func (s FieldInfo) String() string { + return awsutil.Prettify(s) } -// SetNextToken sets the NextToken field's value. -func (s *DescribeAggregateComplianceByConfigRulesInput) SetNextToken(v string) *DescribeAggregateComplianceByConfigRulesInput { - s.NextToken = &v +// GoString returns the string representation +func (s FieldInfo) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *FieldInfo) SetName(v string) *FieldInfo { + s.Name = &v return s } -type DescribeAggregateComplianceByConfigRulesOutput struct { +type GetAggregateComplianceDetailsByConfigRuleInput struct { _ struct{} `type:"structure"` - // Returns a list of AggregateComplianceByConfigRule object. - AggregateComplianceByConfigRules []*AggregateComplianceByConfigRule `type:"list"` + // The 12-digit account ID of the source account. + // + // AccountId is a required field + AccountId *string `type:"string" required:"true"` + + // The source region from where the data is aggregated. + // + // AwsRegion is a required field + AwsRegion *string `min:"1" type:"string" required:"true"` + + // The resource compliance status. + // + // For the GetAggregateComplianceDetailsByConfigRuleRequest data type, AWS Config + // supports only the COMPLIANT and NON_COMPLIANT. AWS Config does not support + // the NOT_APPLICABLE and INSUFFICIENT_DATA values. + ComplianceType *string `type:"string" enum:"ComplianceType"` + + // 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 name of the configuration aggregator. + // + // ConfigurationAggregatorName is a required field + ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` + + // The maximum number of evaluation results returned on each page. The default + // is 50. You cannot specify a number 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. @@ -9322,67 +14137,93 @@ type DescribeAggregateComplianceByConfigRulesOutput struct { } // String returns the string representation -func (s DescribeAggregateComplianceByConfigRulesOutput) String() string { +func (s GetAggregateComplianceDetailsByConfigRuleInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAggregateComplianceByConfigRulesOutput) GoString() string { +func (s GetAggregateComplianceDetailsByConfigRuleInput) GoString() string { return s.String() } -// SetAggregateComplianceByConfigRules sets the AggregateComplianceByConfigRules field's value. -func (s *DescribeAggregateComplianceByConfigRulesOutput) SetAggregateComplianceByConfigRules(v []*AggregateComplianceByConfigRule) *DescribeAggregateComplianceByConfigRulesOutput { - s.AggregateComplianceByConfigRules = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAggregateComplianceDetailsByConfigRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAggregateComplianceDetailsByConfigRuleInput"} + if s.AccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AccountId")) + } + if s.AwsRegion == nil { + invalidParams.Add(request.NewErrParamRequired("AwsRegion")) + } + if s.AwsRegion != nil && len(*s.AwsRegion) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AwsRegion", 1)) + } + if s.ConfigRuleName == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigRuleName")) + } + if s.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) + } + if s.ConfigurationAggregatorName == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) + } + if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetNextToken sets the NextToken field's value. -func (s *DescribeAggregateComplianceByConfigRulesOutput) SetNextToken(v string) *DescribeAggregateComplianceByConfigRulesOutput { - s.NextToken = &v +// SetAccountId sets the AccountId field's value. +func (s *GetAggregateComplianceDetailsByConfigRuleInput) SetAccountId(v string) *GetAggregateComplianceDetailsByConfigRuleInput { + s.AccountId = &v return s } -type DescribeAggregationAuthorizationsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of AggregationAuthorizations returned on each page. The - // default is maximum. If you specify 0, AWS Config uses the default. - Limit *int64 `type:"integer"` +// SetAwsRegion sets the AwsRegion field's value. +func (s *GetAggregateComplianceDetailsByConfigRuleInput) SetAwsRegion(v string) *GetAggregateComplianceDetailsByConfigRuleInput { + s.AwsRegion = &v + return s +} - // 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"` +// SetComplianceType sets the ComplianceType field's value. +func (s *GetAggregateComplianceDetailsByConfigRuleInput) SetComplianceType(v string) *GetAggregateComplianceDetailsByConfigRuleInput { + s.ComplianceType = &v + return s } -// String returns the string representation -func (s DescribeAggregationAuthorizationsInput) String() string { - return awsutil.Prettify(s) +// SetConfigRuleName sets the ConfigRuleName field's value. +func (s *GetAggregateComplianceDetailsByConfigRuleInput) SetConfigRuleName(v string) *GetAggregateComplianceDetailsByConfigRuleInput { + s.ConfigRuleName = &v + return s } -// GoString returns the string representation -func (s DescribeAggregationAuthorizationsInput) GoString() string { - return s.String() +// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. +func (s *GetAggregateComplianceDetailsByConfigRuleInput) SetConfigurationAggregatorName(v string) *GetAggregateComplianceDetailsByConfigRuleInput { + s.ConfigurationAggregatorName = &v + return s } // SetLimit sets the Limit field's value. -func (s *DescribeAggregationAuthorizationsInput) SetLimit(v int64) *DescribeAggregationAuthorizationsInput { +func (s *GetAggregateComplianceDetailsByConfigRuleInput) SetLimit(v int64) *GetAggregateComplianceDetailsByConfigRuleInput { s.Limit = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeAggregationAuthorizationsInput) SetNextToken(v string) *DescribeAggregationAuthorizationsInput { +func (s *GetAggregateComplianceDetailsByConfigRuleInput) SetNextToken(v string) *GetAggregateComplianceDetailsByConfigRuleInput { s.NextToken = &v return s } -type DescribeAggregationAuthorizationsOutput struct { +type GetAggregateComplianceDetailsByConfigRuleOutput struct { _ struct{} `type:"structure"` - // Returns a list of authorizations granted to various aggregator accounts and - // regions. - AggregationAuthorizations []*AggregationAuthorization `type:"list"` + // Returns an AggregateEvaluationResults object. + AggregateEvaluationResults []*AggregateEvaluationResult `type:"list"` // The nextToken string returned on a previous page that you use to get the // next page of results in a paginated response. @@ -9390,37 +14231,45 @@ type DescribeAggregationAuthorizationsOutput struct { } // String returns the string representation -func (s DescribeAggregationAuthorizationsOutput) String() string { +func (s GetAggregateComplianceDetailsByConfigRuleOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAggregationAuthorizationsOutput) GoString() string { +func (s GetAggregateComplianceDetailsByConfigRuleOutput) GoString() string { return s.String() } -// SetAggregationAuthorizations sets the AggregationAuthorizations field's value. -func (s *DescribeAggregationAuthorizationsOutput) SetAggregationAuthorizations(v []*AggregationAuthorization) *DescribeAggregationAuthorizationsOutput { - s.AggregationAuthorizations = v +// SetAggregateEvaluationResults sets the AggregateEvaluationResults field's value. +func (s *GetAggregateComplianceDetailsByConfigRuleOutput) SetAggregateEvaluationResults(v []*AggregateEvaluationResult) *GetAggregateComplianceDetailsByConfigRuleOutput { + s.AggregateEvaluationResults = v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeAggregationAuthorizationsOutput) SetNextToken(v string) *DescribeAggregationAuthorizationsOutput { +func (s *GetAggregateComplianceDetailsByConfigRuleOutput) SetNextToken(v string) *GetAggregateComplianceDetailsByConfigRuleOutput { s.NextToken = &v return s } -type DescribeComplianceByConfigRuleInput struct { +type GetAggregateConfigRuleComplianceSummaryInput struct { _ struct{} `type:"structure"` - // Filters the results by compliance. + // The name of the configuration aggregator. // - // The allowed values are COMPLIANT and NON_COMPLIANT. - ComplianceTypes []*string `type:"list"` + // ConfigurationAggregatorName is a required field + ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` - // Specify one or more AWS Config rule names to filter the results by rule. - ConfigRuleNames []*string `type:"list"` + // Filters the results based on the ConfigRuleComplianceSummaryFilters object. + Filters *ConfigRuleComplianceSummaryFilters `type:"structure"` + + // Groups the result based on ACCOUNT_ID or AWS_REGION. + GroupByKey *string `type:"string" enum:"ConfigRuleComplianceSummaryGroupKey"` + + // The maximum number of evaluation results returned on each page. The default + // is 1000. You cannot specify a number greater than 1000. 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. @@ -9428,112 +14277,155 @@ type DescribeComplianceByConfigRuleInput struct { } // String returns the string representation -func (s DescribeComplianceByConfigRuleInput) String() string { +func (s GetAggregateConfigRuleComplianceSummaryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeComplianceByConfigRuleInput) GoString() string { +func (s GetAggregateConfigRuleComplianceSummaryInput) GoString() string { return s.String() } -// SetComplianceTypes sets the ComplianceTypes field's value. -func (s *DescribeComplianceByConfigRuleInput) SetComplianceTypes(v []*string) *DescribeComplianceByConfigRuleInput { - s.ComplianceTypes = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAggregateConfigRuleComplianceSummaryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAggregateConfigRuleComplianceSummaryInput"} + if s.ConfigurationAggregatorName == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) + } + if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) + } + if s.Filters != nil { + if err := s.Filters.Validate(); err != nil { + invalidParams.AddNested("Filters", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. +func (s *GetAggregateConfigRuleComplianceSummaryInput) SetConfigurationAggregatorName(v string) *GetAggregateConfigRuleComplianceSummaryInput { + s.ConfigurationAggregatorName = &v return s } -// SetConfigRuleNames sets the ConfigRuleNames field's value. -func (s *DescribeComplianceByConfigRuleInput) SetConfigRuleNames(v []*string) *DescribeComplianceByConfigRuleInput { - s.ConfigRuleNames = v +// SetFilters sets the Filters field's value. +func (s *GetAggregateConfigRuleComplianceSummaryInput) SetFilters(v *ConfigRuleComplianceSummaryFilters) *GetAggregateConfigRuleComplianceSummaryInput { + s.Filters = v + return s +} + +// SetGroupByKey sets the GroupByKey field's value. +func (s *GetAggregateConfigRuleComplianceSummaryInput) SetGroupByKey(v string) *GetAggregateConfigRuleComplianceSummaryInput { + s.GroupByKey = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *GetAggregateConfigRuleComplianceSummaryInput) SetLimit(v int64) *GetAggregateConfigRuleComplianceSummaryInput { + s.Limit = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeComplianceByConfigRuleInput) SetNextToken(v string) *DescribeComplianceByConfigRuleInput { +func (s *GetAggregateConfigRuleComplianceSummaryInput) SetNextToken(v string) *GetAggregateConfigRuleComplianceSummaryInput { s.NextToken = &v return s } -type DescribeComplianceByConfigRuleOutput struct { +type GetAggregateConfigRuleComplianceSummaryOutput struct { _ struct{} `type:"structure"` - // Indicates whether each of the specified AWS Config rules is compliant. - ComplianceByConfigRules []*ComplianceByConfigRule `type:"list"` + // Returns a list of AggregateComplianceCounts object. + AggregateComplianceCounts []*AggregateComplianceCount `type:"list"` - // The string that you use in a subsequent request to get the next page of results - // in a paginated response. + // Groups the result based on ACCOUNT_ID or AWS_REGION. + GroupByKey *string `min:"1" type:"string"` + + // 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 DescribeComplianceByConfigRuleOutput) String() string { +func (s GetAggregateConfigRuleComplianceSummaryOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeComplianceByConfigRuleOutput) GoString() string { +func (s GetAggregateConfigRuleComplianceSummaryOutput) GoString() string { return s.String() } -// SetComplianceByConfigRules sets the ComplianceByConfigRules field's value. -func (s *DescribeComplianceByConfigRuleOutput) SetComplianceByConfigRules(v []*ComplianceByConfigRule) *DescribeComplianceByConfigRuleOutput { - s.ComplianceByConfigRules = v +// SetAggregateComplianceCounts sets the AggregateComplianceCounts field's value. +func (s *GetAggregateConfigRuleComplianceSummaryOutput) SetAggregateComplianceCounts(v []*AggregateComplianceCount) *GetAggregateConfigRuleComplianceSummaryOutput { + s.AggregateComplianceCounts = v + return s +} + +// SetGroupByKey sets the GroupByKey field's value. +func (s *GetAggregateConfigRuleComplianceSummaryOutput) SetGroupByKey(v string) *GetAggregateConfigRuleComplianceSummaryOutput { + s.GroupByKey = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeComplianceByConfigRuleOutput) SetNextToken(v string) *DescribeComplianceByConfigRuleOutput { +func (s *GetAggregateConfigRuleComplianceSummaryOutput) SetNextToken(v string) *GetAggregateConfigRuleComplianceSummaryOutput { s.NextToken = &v return s } -type DescribeComplianceByResourceInput struct { +type GetAggregateDiscoveredResourceCountsInput struct { _ struct{} `type:"structure"` - // Filters the results by compliance. + // The name of the configuration aggregator. // - // The allowed values are COMPLIANT, NON_COMPLIANT, and INSUFFICIENT_DATA. - ComplianceTypes []*string `type:"list"` + // ConfigurationAggregatorName is a required field + ConfigurationAggregatorName *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 number greater than 100. If you specify 0, AWS - // Config uses the default. + // Filters the results based on the ResourceCountFilters object. + Filters *ResourceCountFilters `type:"structure"` + + // The key to group the resource counts. + GroupByKey *string `type:"string" enum:"ResourceCountGroupKey"` + + // The maximum number of GroupedResourceCount objects returned on each page. + // The default is 1000. You cannot specify a number greater than 1000. 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 { +func (s GetAggregateDiscoveredResourceCountsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeComplianceByResourceInput) GoString() string { +func (s GetAggregateDiscoveredResourceCountsInput) 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)) +func (s *GetAggregateDiscoveredResourceCountsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAggregateDiscoveredResourceCountsInput"} + if s.ConfigurationAggregatorName == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) } - if s.ResourceType != nil && len(*s.ResourceType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceType", 1)) + if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) + } + if s.Filters != nil { + if err := s.Filters.Validate(); err != nil { + invalidParams.AddNested("Filters", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -9541,161 +14433,192 @@ func (s *DescribeComplianceByResourceInput) Validate() error { } return nil } - -// SetComplianceTypes sets the ComplianceTypes field's value. -func (s *DescribeComplianceByResourceInput) SetComplianceTypes(v []*string) *DescribeComplianceByResourceInput { - s.ComplianceTypes = v + +// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. +func (s *GetAggregateDiscoveredResourceCountsInput) SetConfigurationAggregatorName(v string) *GetAggregateDiscoveredResourceCountsInput { + s.ConfigurationAggregatorName = &v return s } -// SetLimit sets the Limit field's value. -func (s *DescribeComplianceByResourceInput) SetLimit(v int64) *DescribeComplianceByResourceInput { - s.Limit = &v +// SetFilters sets the Filters field's value. +func (s *GetAggregateDiscoveredResourceCountsInput) SetFilters(v *ResourceCountFilters) *GetAggregateDiscoveredResourceCountsInput { + s.Filters = v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeComplianceByResourceInput) SetNextToken(v string) *DescribeComplianceByResourceInput { - s.NextToken = &v +// SetGroupByKey sets the GroupByKey field's value. +func (s *GetAggregateDiscoveredResourceCountsInput) SetGroupByKey(v string) *GetAggregateDiscoveredResourceCountsInput { + s.GroupByKey = &v return s } -// SetResourceId sets the ResourceId field's value. -func (s *DescribeComplianceByResourceInput) SetResourceId(v string) *DescribeComplianceByResourceInput { - s.ResourceId = &v +// SetLimit sets the Limit field's value. +func (s *GetAggregateDiscoveredResourceCountsInput) SetLimit(v int64) *GetAggregateDiscoveredResourceCountsInput { + s.Limit = &v return s } -// SetResourceType sets the ResourceType field's value. -func (s *DescribeComplianceByResourceInput) SetResourceType(v string) *DescribeComplianceByResourceInput { - s.ResourceType = &v +// SetNextToken sets the NextToken field's value. +func (s *GetAggregateDiscoveredResourceCountsInput) SetNextToken(v string) *GetAggregateDiscoveredResourceCountsInput { + s.NextToken = &v return s } -type DescribeComplianceByResourceOutput struct { +type GetAggregateDiscoveredResourceCountsOutput 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 key passed into the request object. If GroupByKey is not provided, the + // result will be empty. + GroupByKey *string `min:"1" type:"string"` - // The string that you use in a subsequent request to get the next page of results - // in a paginated response. + // Returns a list of GroupedResourceCount objects. + GroupedResourceCounts []*GroupedResourceCount `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 total number of resources that are present in an aggregator with the + // filters that you provide. + // + // TotalDiscoveredResources is a required field + TotalDiscoveredResources *int64 `type:"long" required:"true"` } // String returns the string representation -func (s DescribeComplianceByResourceOutput) String() string { +func (s GetAggregateDiscoveredResourceCountsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeComplianceByResourceOutput) GoString() string { +func (s GetAggregateDiscoveredResourceCountsOutput) GoString() string { return s.String() } -// SetComplianceByResources sets the ComplianceByResources field's value. -func (s *DescribeComplianceByResourceOutput) SetComplianceByResources(v []*ComplianceByResource) *DescribeComplianceByResourceOutput { - s.ComplianceByResources = v +// SetGroupByKey sets the GroupByKey field's value. +func (s *GetAggregateDiscoveredResourceCountsOutput) SetGroupByKey(v string) *GetAggregateDiscoveredResourceCountsOutput { + s.GroupByKey = &v + return s +} + +// SetGroupedResourceCounts sets the GroupedResourceCounts field's value. +func (s *GetAggregateDiscoveredResourceCountsOutput) SetGroupedResourceCounts(v []*GroupedResourceCount) *GetAggregateDiscoveredResourceCountsOutput { + s.GroupedResourceCounts = v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeComplianceByResourceOutput) SetNextToken(v string) *DescribeComplianceByResourceOutput { +func (s *GetAggregateDiscoveredResourceCountsOutput) SetNextToken(v string) *GetAggregateDiscoveredResourceCountsOutput { s.NextToken = &v return s } -type DescribeConfigRuleEvaluationStatusInput struct { - _ struct{} `type:"structure"` +// SetTotalDiscoveredResources sets the TotalDiscoveredResources field's value. +func (s *GetAggregateDiscoveredResourceCountsOutput) SetTotalDiscoveredResources(v int64) *GetAggregateDiscoveredResourceCountsOutput { + s.TotalDiscoveredResources = &v + return s +} - // 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"` +type GetAggregateResourceConfigInput struct { + _ struct{} `type:"structure"` - // 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 150 rules. + // The name of the configuration aggregator. // - // For 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"` + // ConfigurationAggregatorName is a required field + ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` - // 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"` + // An object that identifies aggregate resource. + // + // ResourceIdentifier is a required field + ResourceIdentifier *AggregateResourceIdentifier `type:"structure" required:"true"` } // String returns the string representation -func (s DescribeConfigRuleEvaluationStatusInput) String() string { +func (s GetAggregateResourceConfigInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeConfigRuleEvaluationStatusInput) GoString() string { +func (s GetAggregateResourceConfigInput) GoString() string { return s.String() } -// SetConfigRuleNames sets the ConfigRuleNames field's value. -func (s *DescribeConfigRuleEvaluationStatusInput) SetConfigRuleNames(v []*string) *DescribeConfigRuleEvaluationStatusInput { - s.ConfigRuleNames = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAggregateResourceConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAggregateResourceConfigInput"} + if s.ConfigurationAggregatorName == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) + } + if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) + } + if s.ResourceIdentifier == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceIdentifier")) + } + if s.ResourceIdentifier != nil { + if err := s.ResourceIdentifier.Validate(); err != nil { + invalidParams.AddNested("ResourceIdentifier", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetLimit sets the Limit field's value. -func (s *DescribeConfigRuleEvaluationStatusInput) SetLimit(v int64) *DescribeConfigRuleEvaluationStatusInput { - s.Limit = &v +// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. +func (s *GetAggregateResourceConfigInput) SetConfigurationAggregatorName(v string) *GetAggregateResourceConfigInput { + s.ConfigurationAggregatorName = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeConfigRuleEvaluationStatusInput) SetNextToken(v string) *DescribeConfigRuleEvaluationStatusInput { - s.NextToken = &v +// SetResourceIdentifier sets the ResourceIdentifier field's value. +func (s *GetAggregateResourceConfigInput) SetResourceIdentifier(v *AggregateResourceIdentifier) *GetAggregateResourceConfigInput { + s.ResourceIdentifier = v return s } -type DescribeConfigRuleEvaluationStatusOutput struct { +type GetAggregateResourceConfigOutput 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"` + // Returns a ConfigurationItem object. + ConfigurationItem *ConfigurationItem `type:"structure"` } // String returns the string representation -func (s DescribeConfigRuleEvaluationStatusOutput) String() string { +func (s GetAggregateResourceConfigOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeConfigRuleEvaluationStatusOutput) GoString() string { +func (s GetAggregateResourceConfigOutput) 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 +// SetConfigurationItem sets the ConfigurationItem field's value. +func (s *GetAggregateResourceConfigOutput) SetConfigurationItem(v *ConfigurationItem) *GetAggregateResourceConfigOutput { + s.ConfigurationItem = v return s } -type DescribeConfigRulesInput struct { +type GetComplianceDetailsByConfigRuleInput 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"` + // 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 number 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. @@ -9703,32 +14626,61 @@ type DescribeConfigRulesInput struct { } // String returns the string representation -func (s DescribeConfigRulesInput) String() string { +func (s GetComplianceDetailsByConfigRuleInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeConfigRulesInput) GoString() string { +func (s GetComplianceDetailsByConfigRuleInput) GoString() string { return s.String() } -// SetConfigRuleNames sets the ConfigRuleNames field's value. -func (s *DescribeConfigRulesInput) SetConfigRuleNames(v []*string) *DescribeConfigRulesInput { - s.ConfigRuleNames = v +// 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 *DescribeConfigRulesInput) SetNextToken(v string) *DescribeConfigRulesInput { +func (s *GetComplianceDetailsByConfigRuleInput) SetNextToken(v string) *GetComplianceDetailsByConfigRuleInput { s.NextToken = &v return s } -type DescribeConfigRulesOutput struct { +type GetComplianceDetailsByConfigRuleOutput struct { _ struct{} `type:"structure"` - // The details about your AWS Config rules. - ConfigRules []*ConfigRule `type:"list"` + // 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. @@ -9736,74 +14688,74 @@ type DescribeConfigRulesOutput struct { } // String returns the string representation -func (s DescribeConfigRulesOutput) String() string { +func (s GetComplianceDetailsByConfigRuleOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeConfigRulesOutput) GoString() string { +func (s GetComplianceDetailsByConfigRuleOutput) GoString() string { return s.String() } -// SetConfigRules sets the ConfigRules field's value. -func (s *DescribeConfigRulesOutput) SetConfigRules(v []*ConfigRule) *DescribeConfigRulesOutput { - s.ConfigRules = v +// 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 *DescribeConfigRulesOutput) SetNextToken(v string) *DescribeConfigRulesOutput { +func (s *GetComplianceDetailsByConfigRuleOutput) SetNextToken(v string) *GetComplianceDetailsByConfigRuleOutput { s.NextToken = &v return s } -type DescribeConfigurationAggregatorSourcesStatusInput struct { - _ struct{} `type:"structure"` - - // The name of the configuration aggregator. - // - // ConfigurationAggregatorName is a required field - ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` - - // The maximum number of AggregatorSourceStatus returned on each page. The default - // is maximum. If you specify 0, AWS Config uses the default. - Limit *int64 `type:"integer"` +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"` - // Filters the status type. - // - // * Valid value FAILED indicates errors while moving data. + // The ID of the AWS resource for which you want compliance information. // - // * Valid value SUCCEEDED indicates the data was successfully moved. + // 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. // - // * Valid value OUTDATED indicates the data is not the most recent. - UpdateStatus []*string `min:"1" type:"list"` + // ResourceType is a required field + ResourceType *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s DescribeConfigurationAggregatorSourcesStatusInput) String() string { +func (s GetComplianceDetailsByResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeConfigurationAggregatorSourcesStatusInput) GoString() string { +func (s GetComplianceDetailsByResourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeConfigurationAggregatorSourcesStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeConfigurationAggregatorSourcesStatusInput"} - if s.ConfigurationAggregatorName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) +func (s *GetComplianceDetailsByResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetComplianceDetailsByResourceInput"} + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) } - if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) + if s.ResourceId != nil && len(*s.ResourceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) } - if s.UpdateStatus != nil && len(s.UpdateStatus) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UpdateStatus", 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 { @@ -9812,1434 +14764,1837 @@ func (s *DescribeConfigurationAggregatorSourcesStatusInput) Validate() error { return nil } -// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. -func (s *DescribeConfigurationAggregatorSourcesStatusInput) SetConfigurationAggregatorName(v string) *DescribeConfigurationAggregatorSourcesStatusInput { - s.ConfigurationAggregatorName = &v +// SetComplianceTypes sets the ComplianceTypes field's value. +func (s *GetComplianceDetailsByResourceInput) SetComplianceTypes(v []*string) *GetComplianceDetailsByResourceInput { + s.ComplianceTypes = v return s } -// SetLimit sets the Limit field's value. -func (s *DescribeConfigurationAggregatorSourcesStatusInput) SetLimit(v int64) *DescribeConfigurationAggregatorSourcesStatusInput { - s.Limit = &v +// SetNextToken sets the NextToken field's value. +func (s *GetComplianceDetailsByResourceInput) SetNextToken(v string) *GetComplianceDetailsByResourceInput { + s.NextToken = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeConfigurationAggregatorSourcesStatusInput) SetNextToken(v string) *DescribeConfigurationAggregatorSourcesStatusInput { - s.NextToken = &v +// SetResourceId sets the ResourceId field's value. +func (s *GetComplianceDetailsByResourceInput) SetResourceId(v string) *GetComplianceDetailsByResourceInput { + s.ResourceId = &v return s } -// SetUpdateStatus sets the UpdateStatus field's value. -func (s *DescribeConfigurationAggregatorSourcesStatusInput) SetUpdateStatus(v []*string) *DescribeConfigurationAggregatorSourcesStatusInput { - s.UpdateStatus = v +// SetResourceType sets the ResourceType field's value. +func (s *GetComplianceDetailsByResourceInput) SetResourceType(v string) *GetComplianceDetailsByResourceInput { + s.ResourceType = &v return s } -type DescribeConfigurationAggregatorSourcesStatusOutput struct { +type GetComplianceDetailsByResourceOutput struct { _ struct{} `type:"structure"` - // Returns an AggregatedSourceStatus object. - AggregatedSourceStatusList []*AggregatedSourceStatus `type:"list"` + // Indicates whether the specified AWS resource complies each AWS Config rule. + EvaluationResults []*EvaluationResult `type:"list"` - // The nextToken string returned on a previous page that you use to get the - // next page of results in a paginated response. + // 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 DescribeConfigurationAggregatorSourcesStatusOutput) String() string { +func (s GetComplianceDetailsByResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeConfigurationAggregatorSourcesStatusOutput) GoString() string { +func (s GetComplianceDetailsByResourceOutput) GoString() string { return s.String() } -// SetAggregatedSourceStatusList sets the AggregatedSourceStatusList field's value. -func (s *DescribeConfigurationAggregatorSourcesStatusOutput) SetAggregatedSourceStatusList(v []*AggregatedSourceStatus) *DescribeConfigurationAggregatorSourcesStatusOutput { - s.AggregatedSourceStatusList = v +// 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 *DescribeConfigurationAggregatorSourcesStatusOutput) SetNextToken(v string) *DescribeConfigurationAggregatorSourcesStatusOutput { +func (s *GetComplianceDetailsByResourceOutput) SetNextToken(v string) *GetComplianceDetailsByResourceOutput { s.NextToken = &v return s } -type DescribeConfigurationAggregatorsInput struct { +type GetComplianceSummaryByConfigRuleInput struct { _ struct{} `type:"structure"` - - // The name of the configuration aggregators. - ConfigurationAggregatorNames []*string `type:"list"` - - // The maximum number of configuration aggregators returned on each page. The - // default is maximum. 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 DescribeConfigurationAggregatorsInput) String() string { +func (s GetComplianceSummaryByConfigRuleInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeConfigurationAggregatorsInput) GoString() string { +func (s GetComplianceSummaryByConfigRuleInput) GoString() string { return s.String() } -// SetConfigurationAggregatorNames sets the ConfigurationAggregatorNames field's value. -func (s *DescribeConfigurationAggregatorsInput) SetConfigurationAggregatorNames(v []*string) *DescribeConfigurationAggregatorsInput { - s.ConfigurationAggregatorNames = v - return s +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"` } -// SetLimit sets the Limit field's value. -func (s *DescribeConfigurationAggregatorsInput) SetLimit(v int64) *DescribeConfigurationAggregatorsInput { - s.Limit = &v - return s +// String returns the string representation +func (s GetComplianceSummaryByConfigRuleOutput) String() string { + return awsutil.Prettify(s) } -// SetNextToken sets the NextToken field's value. -func (s *DescribeConfigurationAggregatorsInput) SetNextToken(v string) *DescribeConfigurationAggregatorsInput { - s.NextToken = &v +// 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 } -type DescribeConfigurationAggregatorsOutput struct { +type GetComplianceSummaryByResourceTypeInput struct { _ struct{} `type:"structure"` - // Returns a ConfigurationAggregators object. - ConfigurationAggregators []*ConfigurationAggregator `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"` + // 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. + // 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 DescribeConfigurationAggregatorsOutput) String() string { +func (s GetComplianceSummaryByResourceTypeInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeConfigurationAggregatorsOutput) GoString() string { +func (s GetComplianceSummaryByResourceTypeInput) GoString() string { return s.String() } -// SetConfigurationAggregators sets the ConfigurationAggregators field's value. -func (s *DescribeConfigurationAggregatorsOutput) SetConfigurationAggregators(v []*ConfigurationAggregator) *DescribeConfigurationAggregatorsOutput { - s.ConfigurationAggregators = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeConfigurationAggregatorsOutput) SetNextToken(v string) *DescribeConfigurationAggregatorsOutput { - s.NextToken = &v +// SetResourceTypes sets the ResourceTypes field's value. +func (s *GetComplianceSummaryByResourceTypeInput) SetResourceTypes(v []*string) *GetComplianceSummaryByResourceTypeInput { + s.ResourceTypes = v return s } -// The input for the DescribeConfigurationRecorderStatus action. -type DescribeConfigurationRecorderStatusInput struct { +type GetComplianceSummaryByResourceTypeOutput 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"` + // 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 DescribeConfigurationRecorderStatusInput) String() string { +func (s GetComplianceSummaryByResourceTypeOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeConfigurationRecorderStatusInput) GoString() string { +func (s GetComplianceSummaryByResourceTypeOutput) GoString() string { return s.String() } -// SetConfigurationRecorderNames sets the ConfigurationRecorderNames field's value. -func (s *DescribeConfigurationRecorderStatusInput) SetConfigurationRecorderNames(v []*string) *DescribeConfigurationRecorderStatusInput { - s.ConfigurationRecorderNames = v +// SetComplianceSummariesByResourceType sets the ComplianceSummariesByResourceType field's value. +func (s *GetComplianceSummaryByResourceTypeOutput) SetComplianceSummariesByResourceType(v []*ComplianceSummaryByResourceType) *GetComplianceSummaryByResourceTypeOutput { + s.ComplianceSummariesByResourceType = v return s } -// The output for the DescribeConfigurationRecorderStatus action, in JSON format. -type DescribeConfigurationRecorderStatusOutput struct { +type GetConformancePackComplianceDetailsInput struct { _ struct{} `type:"structure"` - // A list that contains status of the specified recorders. - ConfigurationRecordersStatus []*ConfigurationRecorderStatus `type:"list"` + // Name of the conformance pack. + // + // ConformancePackName is a required field + ConformancePackName *string `min:"1" type:"string" required:"true"` + + // A ConformancePackEvaluationFilters object. + Filters *ConformancePackEvaluationFilters `type:"structure"` + + // The maximum number of evaluation results returned on each page. If you do + // no specify a number, AWS Config uses the default. The default is 100. + Limit *int64 `type:"integer"` + + // The nextToken string returned in a previous request that you use to request + // the next page of results in a paginated response. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeConfigurationRecorderStatusOutput) String() string { +func (s GetConformancePackComplianceDetailsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeConfigurationRecorderStatusOutput) GoString() string { +func (s GetConformancePackComplianceDetailsInput) GoString() string { return s.String() } -// SetConfigurationRecordersStatus sets the ConfigurationRecordersStatus field's value. -func (s *DescribeConfigurationRecorderStatusOutput) SetConfigurationRecordersStatus(v []*ConfigurationRecorderStatus) *DescribeConfigurationRecorderStatusOutput { - s.ConfigurationRecordersStatus = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetConformancePackComplianceDetailsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetConformancePackComplianceDetailsInput"} + if s.ConformancePackName == nil { + invalidParams.Add(request.NewErrParamRequired("ConformancePackName")) + } + if s.ConformancePackName != nil && len(*s.ConformancePackName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConformancePackName", 1)) + } + if s.Filters != nil { + if err := s.Filters.Validate(); err != nil { + invalidParams.AddNested("Filters", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConformancePackName sets the ConformancePackName field's value. +func (s *GetConformancePackComplianceDetailsInput) SetConformancePackName(v string) *GetConformancePackComplianceDetailsInput { + s.ConformancePackName = &v return s } -// The input for the DescribeConfigurationRecorders action. -type DescribeConfigurationRecordersInput struct { +// SetFilters sets the Filters field's value. +func (s *GetConformancePackComplianceDetailsInput) SetFilters(v *ConformancePackEvaluationFilters) *GetConformancePackComplianceDetailsInput { + s.Filters = v + return s +} + +// SetLimit sets the Limit field's value. +func (s *GetConformancePackComplianceDetailsInput) SetLimit(v int64) *GetConformancePackComplianceDetailsInput { + s.Limit = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetConformancePackComplianceDetailsInput) SetNextToken(v string) *GetConformancePackComplianceDetailsInput { + s.NextToken = &v + return s +} + +type GetConformancePackComplianceDetailsOutput struct { _ struct{} `type:"structure"` - // A list of configuration recorder names. - ConfigurationRecorderNames []*string `type:"list"` + // Name of the conformance pack. + // + // ConformancePackName is a required field + ConformancePackName *string `min:"1" type:"string" required:"true"` + + // Returns a list of ConformancePackEvaluationResult objects. + ConformancePackRuleEvaluationResults []*ConformancePackEvaluationResult `type:"list"` + + // The nextToken string returned in a previous request that you use to request + // the next page of results in a paginated response. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeConfigurationRecordersInput) String() string { +func (s GetConformancePackComplianceDetailsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeConfigurationRecordersInput) GoString() string { +func (s GetConformancePackComplianceDetailsOutput) GoString() string { return s.String() } -// SetConfigurationRecorderNames sets the ConfigurationRecorderNames field's value. -func (s *DescribeConfigurationRecordersInput) SetConfigurationRecorderNames(v []*string) *DescribeConfigurationRecordersInput { - s.ConfigurationRecorderNames = v +// SetConformancePackName sets the ConformancePackName field's value. +func (s *GetConformancePackComplianceDetailsOutput) SetConformancePackName(v string) *GetConformancePackComplianceDetailsOutput { + s.ConformancePackName = &v return s } -// The output for the DescribeConfigurationRecorders action. -type DescribeConfigurationRecordersOutput struct { +// SetConformancePackRuleEvaluationResults sets the ConformancePackRuleEvaluationResults field's value. +func (s *GetConformancePackComplianceDetailsOutput) SetConformancePackRuleEvaluationResults(v []*ConformancePackEvaluationResult) *GetConformancePackComplianceDetailsOutput { + s.ConformancePackRuleEvaluationResults = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetConformancePackComplianceDetailsOutput) SetNextToken(v string) *GetConformancePackComplianceDetailsOutput { + s.NextToken = &v + return s +} + +type GetConformancePackComplianceSummaryInput struct { _ struct{} `type:"structure"` - // A list that contains the descriptions of the specified configuration recorders. - ConfigurationRecorders []*ConfigurationRecorder `type:"list"` + // Names of conformance packs. + // + // ConformancePackNames is a required field + ConformancePackNames []*string `min:"1" type:"list" required:"true"` + + // The maximum number of conformance packs returned on each page. + 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 DescribeConfigurationRecordersOutput) String() string { +func (s GetConformancePackComplianceSummaryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeConfigurationRecordersOutput) GoString() string { +func (s GetConformancePackComplianceSummaryInput) 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. -type DescribeDeliveryChannelStatusInput struct { - _ struct{} `type:"structure"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetConformancePackComplianceSummaryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetConformancePackComplianceSummaryInput"} + if s.ConformancePackNames == nil { + invalidParams.Add(request.NewErrParamRequired("ConformancePackNames")) + } + if s.ConformancePackNames != nil && len(s.ConformancePackNames) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConformancePackNames", 1)) + } - // A list of delivery channel names. - DeliveryChannelNames []*string `type:"list"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// String returns the string representation -func (s DescribeDeliveryChannelStatusInput) String() string { - return awsutil.Prettify(s) +// SetConformancePackNames sets the ConformancePackNames field's value. +func (s *GetConformancePackComplianceSummaryInput) SetConformancePackNames(v []*string) *GetConformancePackComplianceSummaryInput { + s.ConformancePackNames = v + return s } -// GoString returns the string representation -func (s DescribeDeliveryChannelStatusInput) GoString() string { - return s.String() +// SetLimit sets the Limit field's value. +func (s *GetConformancePackComplianceSummaryInput) SetLimit(v int64) *GetConformancePackComplianceSummaryInput { + s.Limit = &v + return s } -// SetDeliveryChannelNames sets the DeliveryChannelNames field's value. -func (s *DescribeDeliveryChannelStatusInput) SetDeliveryChannelNames(v []*string) *DescribeDeliveryChannelStatusInput { - s.DeliveryChannelNames = v +// SetNextToken sets the NextToken field's value. +func (s *GetConformancePackComplianceSummaryInput) SetNextToken(v string) *GetConformancePackComplianceSummaryInput { + s.NextToken = &v return s } -// The output for the DescribeDeliveryChannelStatus action. -type DescribeDeliveryChannelStatusOutput struct { +type GetConformancePackComplianceSummaryOutput struct { _ struct{} `type:"structure"` - // A list that contains the status of a specified delivery channel. - DeliveryChannelsStatus []*DeliveryChannelStatus `type:"list"` + // A list of ConformancePackComplianceSummary objects. + ConformancePackComplianceSummaryList []*ConformancePackComplianceSummary `min:"1" 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 DescribeDeliveryChannelStatusOutput) String() string { +func (s GetConformancePackComplianceSummaryOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeDeliveryChannelStatusOutput) GoString() string { +func (s GetConformancePackComplianceSummaryOutput) GoString() string { return s.String() } -// SetDeliveryChannelsStatus sets the DeliveryChannelsStatus field's value. -func (s *DescribeDeliveryChannelStatusOutput) SetDeliveryChannelsStatus(v []*DeliveryChannelStatus) *DescribeDeliveryChannelStatusOutput { - s.DeliveryChannelsStatus = v +// SetConformancePackComplianceSummaryList sets the ConformancePackComplianceSummaryList field's value. +func (s *GetConformancePackComplianceSummaryOutput) SetConformancePackComplianceSummaryList(v []*ConformancePackComplianceSummary) *GetConformancePackComplianceSummaryOutput { + s.ConformancePackComplianceSummaryList = v return s } -// The input for the DescribeDeliveryChannels action. -type DescribeDeliveryChannelsInput struct { +// SetNextToken sets the NextToken field's value. +func (s *GetConformancePackComplianceSummaryOutput) SetNextToken(v string) *GetConformancePackComplianceSummaryOutput { + s.NextToken = &v + return s +} + +type GetDiscoveredResourceCountsInput struct { _ struct{} `type:"structure"` - // A list of delivery channel names. - DeliveryChannelNames []*string `type:"list"` + // The maximum number of ResourceCount objects returned on each page. The default + // is 100. You cannot specify a number 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 comma-separated list that specifies the resource types that you want + // AWS Config to return (for example, "AWS::EC2::Instance", "AWS::IAM::User"). + // + // If a value for resourceTypes is not specified, AWS Config returns all resource + // types that AWS Config is recording in the region for your account. + // + // If the configuration recorder is turned off, AWS Config returns an empty + // list of ResourceCount objects. If the configuration recorder is not recording + // a specific resource type (for example, S3 buckets), that resource type is + // not returned in the list of ResourceCount objects. + ResourceTypes []*string `locationName:"resourceTypes" type:"list"` } // String returns the string representation -func (s DescribeDeliveryChannelsInput) String() string { +func (s GetDiscoveredResourceCountsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeDeliveryChannelsInput) GoString() string { +func (s GetDiscoveredResourceCountsInput) GoString() string { return s.String() } -// SetDeliveryChannelNames sets the DeliveryChannelNames field's value. -func (s *DescribeDeliveryChannelsInput) SetDeliveryChannelNames(v []*string) *DescribeDeliveryChannelsInput { - s.DeliveryChannelNames = v +// SetLimit sets the Limit field's value. +func (s *GetDiscoveredResourceCountsInput) SetLimit(v int64) *GetDiscoveredResourceCountsInput { + s.Limit = &v return s } -// The output for the DescribeDeliveryChannels action. -type DescribeDeliveryChannelsOutput struct { +// SetNextToken sets the NextToken field's value. +func (s *GetDiscoveredResourceCountsInput) SetNextToken(v string) *GetDiscoveredResourceCountsInput { + s.NextToken = &v + return s +} + +// SetResourceTypes sets the ResourceTypes field's value. +func (s *GetDiscoveredResourceCountsInput) SetResourceTypes(v []*string) *GetDiscoveredResourceCountsInput { + s.ResourceTypes = v + return s +} + +type GetDiscoveredResourceCountsOutput struct { _ struct{} `type:"structure"` - // A list that contains the descriptions of the specified delivery channel. - DeliveryChannels []*DeliveryChannel `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"` + + // The list of ResourceCount objects. Each object is listed in descending order + // by the number of resources. + ResourceCounts []*ResourceCount `locationName:"resourceCounts" type:"list"` + + // The total number of resources that AWS Config is recording in the region + // for your account. If you specify resource types in the request, AWS Config + // returns only the total number of resources for those resource types. + // + // Example + // + // AWS Config is recording three resource types in the US East (Ohio) Region + // for your account: 25 EC2 instances, 20 IAM users, and 15 S3 buckets, for + // a total of 60 resources. + // + // You make a call to the GetDiscoveredResourceCounts action and specify the + // resource type, "AWS::EC2::Instances", in the request. + // + // AWS Config returns 25 for totalDiscoveredResources. + TotalDiscoveredResources *int64 `locationName:"totalDiscoveredResources" type:"long"` } // String returns the string representation -func (s DescribeDeliveryChannelsOutput) String() string { +func (s GetDiscoveredResourceCountsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeDeliveryChannelsOutput) GoString() string { +func (s GetDiscoveredResourceCountsOutput) GoString() string { return s.String() } -// SetDeliveryChannels sets the DeliveryChannels field's value. -func (s *DescribeDeliveryChannelsOutput) SetDeliveryChannels(v []*DeliveryChannel) *DescribeDeliveryChannelsOutput { - s.DeliveryChannels = v +// SetNextToken sets the NextToken field's value. +func (s *GetDiscoveredResourceCountsOutput) SetNextToken(v string) *GetDiscoveredResourceCountsOutput { + s.NextToken = &v return s } -type DescribeOrganizationConfigRuleStatusesInput struct { +// SetResourceCounts sets the ResourceCounts field's value. +func (s *GetDiscoveredResourceCountsOutput) SetResourceCounts(v []*ResourceCount) *GetDiscoveredResourceCountsOutput { + s.ResourceCounts = v + return s +} + +// SetTotalDiscoveredResources sets the TotalDiscoveredResources field's value. +func (s *GetDiscoveredResourceCountsOutput) SetTotalDiscoveredResources(v int64) *GetDiscoveredResourceCountsOutput { + s.TotalDiscoveredResources = &v + return s +} + +type GetOrganizationConfigRuleDetailedStatusInput struct { _ struct{} `type:"structure"` - // The maximum number of OrganizationConfigRuleStatuses returned on each page. - // If you do no specify a number, AWS Config uses the default. The default is - // 100. + // A StatusDetailFilters object. + Filters *StatusDetailFilters `type:"structure"` + + // The maximum number of OrganizationConfigRuleDetailedStatus returned on each + // page. If you do not specify a number, AWS Config uses the default. The default + // is 100. 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 names of organization config rules for which you want status details. - // If you do not specify any names, AWS Config returns details for all your - // organization AWS Confg rules. - OrganizationConfigRuleNames []*string `type:"list"` + // The name of organization config rule for which you want status details for + // member accounts. + // + // OrganizationConfigRuleName is a required field + OrganizationConfigRuleName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s DescribeOrganizationConfigRuleStatusesInput) String() string { +func (s GetOrganizationConfigRuleDetailedStatusInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeOrganizationConfigRuleStatusesInput) GoString() string { +func (s GetOrganizationConfigRuleDetailedStatusInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetOrganizationConfigRuleDetailedStatusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetOrganizationConfigRuleDetailedStatusInput"} + if s.OrganizationConfigRuleName == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationConfigRuleName")) + } + if s.OrganizationConfigRuleName != nil && len(*s.OrganizationConfigRuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OrganizationConfigRuleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFilters sets the Filters field's value. +func (s *GetOrganizationConfigRuleDetailedStatusInput) SetFilters(v *StatusDetailFilters) *GetOrganizationConfigRuleDetailedStatusInput { + s.Filters = v + return s +} + // SetLimit sets the Limit field's value. -func (s *DescribeOrganizationConfigRuleStatusesInput) SetLimit(v int64) *DescribeOrganizationConfigRuleStatusesInput { +func (s *GetOrganizationConfigRuleDetailedStatusInput) SetLimit(v int64) *GetOrganizationConfigRuleDetailedStatusInput { s.Limit = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeOrganizationConfigRuleStatusesInput) SetNextToken(v string) *DescribeOrganizationConfigRuleStatusesInput { +func (s *GetOrganizationConfigRuleDetailedStatusInput) SetNextToken(v string) *GetOrganizationConfigRuleDetailedStatusInput { s.NextToken = &v return s } -// SetOrganizationConfigRuleNames sets the OrganizationConfigRuleNames field's value. -func (s *DescribeOrganizationConfigRuleStatusesInput) SetOrganizationConfigRuleNames(v []*string) *DescribeOrganizationConfigRuleStatusesInput { - s.OrganizationConfigRuleNames = v +// SetOrganizationConfigRuleName sets the OrganizationConfigRuleName field's value. +func (s *GetOrganizationConfigRuleDetailedStatusInput) SetOrganizationConfigRuleName(v string) *GetOrganizationConfigRuleDetailedStatusInput { + s.OrganizationConfigRuleName = &v return s } -type DescribeOrganizationConfigRuleStatusesOutput struct { +type GetOrganizationConfigRuleDetailedStatusOutput struct { _ struct{} `type:"structure"` // 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"` - // A list of OrganizationConfigRuleStatus objects. - OrganizationConfigRuleStatuses []*OrganizationConfigRuleStatus `type:"list"` + // A list of MemberAccountStatus objects. + OrganizationConfigRuleDetailedStatus []*MemberAccountStatus `type:"list"` } // String returns the string representation -func (s DescribeOrganizationConfigRuleStatusesOutput) String() string { +func (s GetOrganizationConfigRuleDetailedStatusOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeOrganizationConfigRuleStatusesOutput) GoString() string { +func (s GetOrganizationConfigRuleDetailedStatusOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *DescribeOrganizationConfigRuleStatusesOutput) SetNextToken(v string) *DescribeOrganizationConfigRuleStatusesOutput { +func (s *GetOrganizationConfigRuleDetailedStatusOutput) SetNextToken(v string) *GetOrganizationConfigRuleDetailedStatusOutput { s.NextToken = &v return s } -// SetOrganizationConfigRuleStatuses sets the OrganizationConfigRuleStatuses field's value. -func (s *DescribeOrganizationConfigRuleStatusesOutput) SetOrganizationConfigRuleStatuses(v []*OrganizationConfigRuleStatus) *DescribeOrganizationConfigRuleStatusesOutput { - s.OrganizationConfigRuleStatuses = v +// SetOrganizationConfigRuleDetailedStatus sets the OrganizationConfigRuleDetailedStatus field's value. +func (s *GetOrganizationConfigRuleDetailedStatusOutput) SetOrganizationConfigRuleDetailedStatus(v []*MemberAccountStatus) *GetOrganizationConfigRuleDetailedStatusOutput { + s.OrganizationConfigRuleDetailedStatus = v return s } -type DescribeOrganizationConfigRulesInput struct { +type GetOrganizationConformancePackDetailedStatusInput struct { _ struct{} `type:"structure"` - // The maximum number of organization config rules returned on each page. If - // you do no specify a number, AWS Config uses the default. The default is 100. + // An OrganizationResourceDetailedStatusFilters object. + Filters *OrganizationResourceDetailedStatusFilters `type:"structure"` + + // The maximum number of OrganizationConformancePackDetailedStatuses returned + // on each page. If you do not specify a number, AWS Config uses the default. + // The default is 100. 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 names of organization config rules for which you want details. If you - // do not specify any names, AWS Config returns details for all your organization - // config rules. - OrganizationConfigRuleNames []*string `type:"list"` + // The name of organization conformance pack for which you want status details + // for member accounts. + // + // OrganizationConformancePackName is a required field + OrganizationConformancePackName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s DescribeOrganizationConfigRulesInput) String() string { +func (s GetOrganizationConformancePackDetailedStatusInput) String() string { return awsutil.Prettify(s) } -// GoString returns the string representation -func (s DescribeOrganizationConfigRulesInput) GoString() string { - return s.String() +// GoString returns the string representation +func (s GetOrganizationConformancePackDetailedStatusInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetOrganizationConformancePackDetailedStatusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetOrganizationConformancePackDetailedStatusInput"} + if s.OrganizationConformancePackName == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationConformancePackName")) + } + if s.OrganizationConformancePackName != nil && len(*s.OrganizationConformancePackName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OrganizationConformancePackName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFilters sets the Filters field's value. +func (s *GetOrganizationConformancePackDetailedStatusInput) SetFilters(v *OrganizationResourceDetailedStatusFilters) *GetOrganizationConformancePackDetailedStatusInput { + s.Filters = v + return s } // SetLimit sets the Limit field's value. -func (s *DescribeOrganizationConfigRulesInput) SetLimit(v int64) *DescribeOrganizationConfigRulesInput { +func (s *GetOrganizationConformancePackDetailedStatusInput) SetLimit(v int64) *GetOrganizationConformancePackDetailedStatusInput { s.Limit = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeOrganizationConfigRulesInput) SetNextToken(v string) *DescribeOrganizationConfigRulesInput { +func (s *GetOrganizationConformancePackDetailedStatusInput) SetNextToken(v string) *GetOrganizationConformancePackDetailedStatusInput { s.NextToken = &v return s } -// SetOrganizationConfigRuleNames sets the OrganizationConfigRuleNames field's value. -func (s *DescribeOrganizationConfigRulesInput) SetOrganizationConfigRuleNames(v []*string) *DescribeOrganizationConfigRulesInput { - s.OrganizationConfigRuleNames = v +// SetOrganizationConformancePackName sets the OrganizationConformancePackName field's value. +func (s *GetOrganizationConformancePackDetailedStatusInput) SetOrganizationConformancePackName(v string) *GetOrganizationConformancePackDetailedStatusInput { + s.OrganizationConformancePackName = &v return s } -type DescribeOrganizationConfigRulesOutput struct { +type GetOrganizationConformancePackDetailedStatusOutput struct { _ struct{} `type:"structure"` // 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"` - // Retuns a list OrganizationConfigRule objects. - OrganizationConfigRules []*OrganizationConfigRule `type:"list"` + // A list of OrganizationConformancePackDetailedStatus objects. + OrganizationConformancePackDetailedStatuses []*OrganizationConformancePackDetailedStatus `type:"list"` } // String returns the string representation -func (s DescribeOrganizationConfigRulesOutput) String() string { +func (s GetOrganizationConformancePackDetailedStatusOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeOrganizationConfigRulesOutput) GoString() string { +func (s GetOrganizationConformancePackDetailedStatusOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *DescribeOrganizationConfigRulesOutput) SetNextToken(v string) *DescribeOrganizationConfigRulesOutput { +func (s *GetOrganizationConformancePackDetailedStatusOutput) SetNextToken(v string) *GetOrganizationConformancePackDetailedStatusOutput { s.NextToken = &v return s } -// SetOrganizationConfigRules sets the OrganizationConfigRules field's value. -func (s *DescribeOrganizationConfigRulesOutput) SetOrganizationConfigRules(v []*OrganizationConfigRule) *DescribeOrganizationConfigRulesOutput { - s.OrganizationConfigRules = v +// SetOrganizationConformancePackDetailedStatuses sets the OrganizationConformancePackDetailedStatuses field's value. +func (s *GetOrganizationConformancePackDetailedStatusOutput) SetOrganizationConformancePackDetailedStatuses(v []*OrganizationConformancePackDetailedStatus) *GetOrganizationConformancePackDetailedStatusOutput { + s.OrganizationConformancePackDetailedStatuses = v return s } -type DescribePendingAggregationRequestsInput struct { +// The input for the GetResourceConfigHistory action. +type GetResourceConfigHistoryInput struct { _ struct{} `type:"structure"` - // The maximum number of evaluation results returned on each page. The default - // is maximum. If you specify 0, AWS Config uses the default. - Limit *int64 `type:"integer"` + // 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 when + // the first configuration item was recorded. + EarlierTime *time.Time `locationName:"earlierTime" type:"timestamp"` + + // The time stamp that indicates a later time. If not specified, current time + // is taken. + LaterTime *time.Time `locationName:"laterTime" type:"timestamp"` + + // The maximum number of configuration items returned on each page. The default + // is 10. You cannot specify a number 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 `type:"string"` + NextToken *string `locationName:"nextToken" type:"string"` + + // The ID of the resource (for example., sg-xxxxxx). + // + // ResourceId is a required field + ResourceId *string `locationName:"resourceId" min:"1" 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 DescribePendingAggregationRequestsInput) String() string { +func (s GetResourceConfigHistoryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribePendingAggregationRequestsInput) GoString() string { +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.ResourceId != nil && len(*s.ResourceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) + } + 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 *DescribePendingAggregationRequestsInput) SetLimit(v int64) *DescribePendingAggregationRequestsInput { +func (s *GetResourceConfigHistoryInput) SetLimit(v int64) *GetResourceConfigHistoryInput { s.Limit = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribePendingAggregationRequestsInput) SetNextToken(v string) *DescribePendingAggregationRequestsInput { +func (s *GetResourceConfigHistoryInput) SetNextToken(v string) *GetResourceConfigHistoryInput { s.NextToken = &v return s } -type DescribePendingAggregationRequestsOutput struct { +// 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. +type GetResourceConfigHistoryOutput struct { _ struct{} `type:"structure"` - // 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"` + // A list that contains the configuration history of one or more resources. + ConfigurationItems []*ConfigurationItem `locationName:"configurationItems" type:"list"` - // Returns a PendingAggregationRequests object. - PendingAggregationRequests []*PendingAggregationRequest `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 DescribePendingAggregationRequestsOutput) String() string { +func (s GetResourceConfigHistoryOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribePendingAggregationRequestsOutput) GoString() string { +func (s GetResourceConfigHistoryOutput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribePendingAggregationRequestsOutput) SetNextToken(v string) *DescribePendingAggregationRequestsOutput { - s.NextToken = &v +// SetConfigurationItems sets the ConfigurationItems field's value. +func (s *GetResourceConfigHistoryOutput) SetConfigurationItems(v []*ConfigurationItem) *GetResourceConfigHistoryOutput { + s.ConfigurationItems = v return s } -// SetPendingAggregationRequests sets the PendingAggregationRequests field's value. -func (s *DescribePendingAggregationRequestsOutput) SetPendingAggregationRequests(v []*PendingAggregationRequest) *DescribePendingAggregationRequestsOutput { - s.PendingAggregationRequests = v +// SetNextToken sets the NextToken field's value. +func (s *GetResourceConfigHistoryOutput) SetNextToken(v string) *GetResourceConfigHistoryOutput { + s.NextToken = &v return s } -type DescribeRemediationConfigurationsInput struct { +// The count of resources that are grouped by the group name. +type GroupedResourceCount struct { _ struct{} `type:"structure"` - // A list of AWS Config rule names of remediation configurations for which you - // want details. + // The name of the group that can be region, account ID, or resource type. For + // example, region1, region2 if the region was chosen as GroupByKey. // - // ConfigRuleNames is a required field - ConfigRuleNames []*string `type:"list" required:"true"` + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // The number of resources in the group. + // + // ResourceCount is a required field + ResourceCount *int64 `type:"long" required:"true"` } // String returns the string representation -func (s DescribeRemediationConfigurationsInput) String() string { +func (s GroupedResourceCount) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeRemediationConfigurationsInput) GoString() string { +func (s GroupedResourceCount) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeRemediationConfigurationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeRemediationConfigurationsInput"} - if s.ConfigRuleNames == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigRuleNames")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetGroupName sets the GroupName field's value. +func (s *GroupedResourceCount) SetGroupName(v string) *GroupedResourceCount { + s.GroupName = &v + return s } -// SetConfigRuleNames sets the ConfigRuleNames field's value. -func (s *DescribeRemediationConfigurationsInput) SetConfigRuleNames(v []*string) *DescribeRemediationConfigurationsInput { - s.ConfigRuleNames = v +// SetResourceCount sets the ResourceCount field's value. +func (s *GroupedResourceCount) SetResourceCount(v int64) *GroupedResourceCount { + s.ResourceCount = &v return s } -type DescribeRemediationConfigurationsOutput struct { - _ struct{} `type:"structure"` +// Your Amazon S3 bucket policy does not permit AWS Config to write to it. +type InsufficientDeliveryPolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Returns a remediation configuration object. - RemediationConfigurations []*RemediationConfiguration `type:"list"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DescribeRemediationConfigurationsOutput) String() string { +func (s InsufficientDeliveryPolicyException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeRemediationConfigurationsOutput) GoString() string { +func (s InsufficientDeliveryPolicyException) GoString() string { return s.String() } -// SetRemediationConfigurations sets the RemediationConfigurations field's value. -func (s *DescribeRemediationConfigurationsOutput) SetRemediationConfigurations(v []*RemediationConfiguration) *DescribeRemediationConfigurationsOutput { - s.RemediationConfigurations = v - return s +func newErrorInsufficientDeliveryPolicyException(v protocol.ResponseMetadata) error { + return &InsufficientDeliveryPolicyException{ + respMetadata: v, + } } -type DescribeRemediationExceptionsInput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s InsufficientDeliveryPolicyException) Code() string { + return "InsufficientDeliveryPolicyException" +} - // The name of the AWS Config rule. - // - // ConfigRuleName is a required field - ConfigRuleName *string `min:"1" type:"string" required:"true"` +// Message returns the exception's message. +func (s InsufficientDeliveryPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The maximum number of RemediationExceptionResourceKey returned on each page. - // The default is 25. If you specify 0, AWS Config uses the default. - Limit *int64 `type:"integer"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InsufficientDeliveryPolicyException) OrigErr() error { + return nil +} - // The nextToken string returned in a previous request that you use to request - // the next page of results in a paginated response. - NextToken *string `type:"string"` +func (s InsufficientDeliveryPolicyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // An exception list of resource exception keys to be processed with the current - // request. AWS Config adds exception for each resource key. For example, AWS - // Config adds 3 exceptions for 3 resource keys. - ResourceKeys []*RemediationExceptionResourceKey `min:"1" type:"list"` +// Status code returns the HTTP status code for the request's response error. +func (s InsufficientDeliveryPolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InsufficientDeliveryPolicyException) RequestID() string { + return s.respMetadata.RequestID +} + +// Indicates one of the following errors: +// +// * For PutConfigRule, the rule cannot be created because the IAM role assigned +// to AWS Config lacks permissions to perform the config:Put* action. +// +// * For PutConfigRule, the AWS Lambda function cannot be invoked. Check +// the function ARN, and check the function's permissions. +// +// * For PutOrganizationConfigRule, organization config rule cannot be created +// because you do not have permissions to call IAM GetRole action or create +// a service linked role. +// +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack cannot be created because you do not have permissions: To call IAM +// GetRole action or create a service linked role. To read Amazon S3 bucket. +type InsufficientPermissionsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DescribeRemediationExceptionsInput) String() string { +func (s InsufficientPermissionsException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeRemediationExceptionsInput) GoString() string { +func (s InsufficientPermissionsException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeRemediationExceptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeRemediationExceptionsInput"} - if s.ConfigRuleName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigRuleName")) - } - if s.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) - } - if s.ResourceKeys != nil && len(s.ResourceKeys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceKeys", 1)) - } - if s.ResourceKeys != nil { - for i, v := range s.ResourceKeys { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceKeys", i), err.(request.ErrInvalidParams)) - } - } +func newErrorInsufficientPermissionsException(v protocol.ResponseMetadata) error { + return &InsufficientPermissionsException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// Code returns the exception type name. +func (s InsufficientPermissionsException) Code() string { + return "InsufficientPermissionsException" } -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *DescribeRemediationExceptionsInput) SetConfigRuleName(v string) *DescribeRemediationExceptionsInput { - s.ConfigRuleName = &v - return s +// Message returns the exception's message. +func (s InsufficientPermissionsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetLimit sets the Limit field's value. -func (s *DescribeRemediationExceptionsInput) SetLimit(v int64) *DescribeRemediationExceptionsInput { - s.Limit = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InsufficientPermissionsException) OrigErr() error { + return nil } -// SetNextToken sets the NextToken field's value. -func (s *DescribeRemediationExceptionsInput) SetNextToken(v string) *DescribeRemediationExceptionsInput { - s.NextToken = &v - return s +func (s InsufficientPermissionsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetResourceKeys sets the ResourceKeys field's value. -func (s *DescribeRemediationExceptionsInput) SetResourceKeys(v []*RemediationExceptionResourceKey) *DescribeRemediationExceptionsInput { - s.ResourceKeys = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InsufficientPermissionsException) StatusCode() int { + return s.respMetadata.StatusCode } -type DescribeRemediationExceptionsOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InsufficientPermissionsException) RequestID() string { + return s.respMetadata.RequestID +} - // The nextToken string returned in a previous request that you use to request - // the next page of results in a paginated response. - NextToken *string `type:"string"` +// You have provided a configuration recorder name that is not valid. +type InvalidConfigurationRecorderNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Returns a list of remediation exception objects. - RemediationExceptions []*RemediationException `type:"list"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DescribeRemediationExceptionsOutput) String() string { +func (s InvalidConfigurationRecorderNameException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeRemediationExceptionsOutput) GoString() string { +func (s InvalidConfigurationRecorderNameException) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribeRemediationExceptionsOutput) SetNextToken(v string) *DescribeRemediationExceptionsOutput { - s.NextToken = &v - return s +func newErrorInvalidConfigurationRecorderNameException(v protocol.ResponseMetadata) error { + return &InvalidConfigurationRecorderNameException{ + respMetadata: v, + } } -// SetRemediationExceptions sets the RemediationExceptions field's value. -func (s *DescribeRemediationExceptionsOutput) SetRemediationExceptions(v []*RemediationException) *DescribeRemediationExceptionsOutput { - s.RemediationExceptions = v - return s +// Code returns the exception type name. +func (s InvalidConfigurationRecorderNameException) Code() string { + return "InvalidConfigurationRecorderNameException" } -type DescribeRemediationExecutionStatusInput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidConfigurationRecorderNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // A list of AWS Config rule names. - // - // ConfigRuleName is a required field - ConfigRuleName *string `min:"1" type:"string" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidConfigurationRecorderNameException) OrigErr() error { + return nil +} - // The maximum number of RemediationExecutionStatuses returned on each page. - // The default is maximum. If you specify 0, AWS Config uses the default. - Limit *int64 `type:"integer"` +func (s InvalidConfigurationRecorderNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // 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"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidConfigurationRecorderNameException) StatusCode() int { + return s.respMetadata.StatusCode +} - // A list of resource keys to be processed with the current request. Each element - // in the list consists of the resource type and resource ID. - ResourceKeys []*ResourceKey `min:"1" type:"list"` +// RequestID returns the service's response RequestID for request. +func (s InvalidConfigurationRecorderNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified delivery channel name is not valid. +type InvalidDeliveryChannelNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DescribeRemediationExecutionStatusInput) String() string { +func (s InvalidDeliveryChannelNameException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeRemediationExecutionStatusInput) GoString() string { +func (s InvalidDeliveryChannelNameException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeRemediationExecutionStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeRemediationExecutionStatusInput"} - if s.ConfigRuleName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigRuleName")) - } - if s.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) - } - if s.ResourceKeys != nil && len(s.ResourceKeys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceKeys", 1)) - } - if s.ResourceKeys != nil { - for i, v := range s.ResourceKeys { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceKeys", i), err.(request.ErrInvalidParams)) - } - } +func newErrorInvalidDeliveryChannelNameException(v protocol.ResponseMetadata) error { + return &InvalidDeliveryChannelNameException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// Code returns the exception type name. +func (s InvalidDeliveryChannelNameException) Code() string { + return "InvalidDeliveryChannelNameException" } -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *DescribeRemediationExecutionStatusInput) SetConfigRuleName(v string) *DescribeRemediationExecutionStatusInput { - s.ConfigRuleName = &v - return s +// Message returns the exception's message. +func (s InvalidDeliveryChannelNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetLimit sets the Limit field's value. -func (s *DescribeRemediationExecutionStatusInput) SetLimit(v int64) *DescribeRemediationExecutionStatusInput { - s.Limit = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDeliveryChannelNameException) OrigErr() error { + return nil } -// SetNextToken sets the NextToken field's value. -func (s *DescribeRemediationExecutionStatusInput) SetNextToken(v string) *DescribeRemediationExecutionStatusInput { - s.NextToken = &v - return s +func (s InvalidDeliveryChannelNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetResourceKeys sets the ResourceKeys field's value. -func (s *DescribeRemediationExecutionStatusInput) SetResourceKeys(v []*ResourceKey) *DescribeRemediationExecutionStatusInput { - s.ResourceKeys = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDeliveryChannelNameException) StatusCode() int { + return s.respMetadata.StatusCode } -type DescribeRemediationExecutionStatusOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidDeliveryChannelNameException) RequestID() string { + return s.respMetadata.RequestID +} - // 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 syntax of the query is incorrect. +type InvalidExpressionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Returns a list of remediation execution statuses objects. - RemediationExecutionStatuses []*RemediationExecutionStatus `type:"list"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DescribeRemediationExecutionStatusOutput) String() string { +func (s InvalidExpressionException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeRemediationExecutionStatusOutput) GoString() string { +func (s InvalidExpressionException) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribeRemediationExecutionStatusOutput) SetNextToken(v string) *DescribeRemediationExecutionStatusOutput { - s.NextToken = &v - return s +func newErrorInvalidExpressionException(v protocol.ResponseMetadata) error { + return &InvalidExpressionException{ + respMetadata: v, + } } -// SetRemediationExecutionStatuses sets the RemediationExecutionStatuses field's value. -func (s *DescribeRemediationExecutionStatusOutput) SetRemediationExecutionStatuses(v []*RemediationExecutionStatus) *DescribeRemediationExecutionStatusOutput { - s.RemediationExecutionStatuses = v - return s +// Code returns the exception type name. +func (s InvalidExpressionException) Code() string { + return "InvalidExpressionException" } -type DescribeRetentionConfigurationsInput struct { - _ struct{} `type:"structure"` - - // 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"` - - // A list of names of retention configurations for which you want details. If - // you do not specify a name, AWS Config returns details for all the retention - // configurations for that account. - // - // Currently, AWS Config supports only one retention configuration per region - // in your account. - RetentionConfigurationNames []*string `type:"list"` +// Message returns the exception's message. +func (s InvalidExpressionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s DescribeRetentionConfigurationsInput) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidExpressionException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s DescribeRetentionConfigurationsInput) GoString() string { - return s.String() +func (s InvalidExpressionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetNextToken sets the NextToken field's value. -func (s *DescribeRetentionConfigurationsInput) SetNextToken(v string) *DescribeRetentionConfigurationsInput { - s.NextToken = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidExpressionException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetRetentionConfigurationNames sets the RetentionConfigurationNames field's value. -func (s *DescribeRetentionConfigurationsInput) SetRetentionConfigurationNames(v []*string) *DescribeRetentionConfigurationsInput { - s.RetentionConfigurationNames = v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidExpressionException) RequestID() string { + return s.respMetadata.RequestID } -type DescribeRetentionConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // 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 specified limit is outside the allowable range. +type InvalidLimitException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Returns a retention configuration object. - RetentionConfigurations []*RetentionConfiguration `type:"list"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DescribeRetentionConfigurationsOutput) String() string { +func (s InvalidLimitException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeRetentionConfigurationsOutput) GoString() string { +func (s InvalidLimitException) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribeRetentionConfigurationsOutput) SetNextToken(v string) *DescribeRetentionConfigurationsOutput { - s.NextToken = &v - return s +func newErrorInvalidLimitException(v protocol.ResponseMetadata) error { + return &InvalidLimitException{ + respMetadata: v, + } } -// SetRetentionConfigurations sets the RetentionConfigurations field's value. -func (s *DescribeRetentionConfigurationsOutput) SetRetentionConfigurations(v []*RetentionConfiguration) *DescribeRetentionConfigurationsOutput { - s.RetentionConfigurations = v - return s +// Code returns the exception type name. +func (s InvalidLimitException) Code() string { + return "InvalidLimitException" } -// Identifies an AWS resource and indicates whether it complies with the AWS -// Config rule that it was evaluated against. -type Evaluation struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidLimitException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Supplementary information about how the evaluation determined the compliance. - Annotation *string `min:"1" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidLimitException) OrigErr() error { + return nil +} - // The ID of the AWS resource that was evaluated. - // - // ComplianceResourceId is a required field - ComplianceResourceId *string `min:"1" type:"string" required:"true"` +func (s InvalidLimitException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The type of AWS resource that was evaluated. - // - // ComplianceResourceType is a required field - ComplianceResourceType *string `min:"1" type:"string" required:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidLimitException) StatusCode() int { + return s.respMetadata.StatusCode +} - // 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 AWS Config rule cannot pass an INSUFFICIENT_DATA value - // to AWS Config. - // - // ComplianceType is a required field - ComplianceType *string `type:"string" required:"true" enum:"ComplianceType"` +// RequestID returns the service's response RequestID for request. +func (s InvalidLimitException) RequestID() string { + return s.respMetadata.RequestID +} - // 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" required:"true"` +// The specified next token is invalid. Specify the nextToken string that was +// returned in the previous response to get the next page of results. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s Evaluation) String() string { +func (s InvalidNextTokenException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Evaluation) GoString() string { +func (s InvalidNextTokenException) 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)) +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, } - if s.ComplianceType == nil { - invalidParams.Add(request.NewErrParamRequired("ComplianceType")) +} + +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - if s.OrderingTimestamp == nil { - invalidParams.Add(request.NewErrParamRequired("OrderingTimestamp")) + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more of the specified parameters are invalid. Verify that your parameters +// are valid and try again. +type InvalidParameterValueException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterValueException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterValueException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterValueException(v protocol.ResponseMetadata) error { + return &InvalidParameterValueException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidParameterValueException) Code() string { + return "InvalidParameterValueException" +} + +// Message returns the exception's message. +func (s InvalidParameterValueException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterValueException) OrigErr() error { return nil } -// SetAnnotation sets the Annotation field's value. -func (s *Evaluation) SetAnnotation(v string) *Evaluation { - s.Annotation = &v - return s +func (s InvalidParameterValueException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetComplianceResourceId sets the ComplianceResourceId field's value. -func (s *Evaluation) SetComplianceResourceId(v string) *Evaluation { - s.ComplianceResourceId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterValueException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetComplianceResourceType sets the ComplianceResourceType field's value. -func (s *Evaluation) SetComplianceResourceType(v string) *Evaluation { - s.ComplianceResourceType = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterValueException) RequestID() string { + return s.respMetadata.RequestID } -// SetComplianceType sets the ComplianceType field's value. -func (s *Evaluation) SetComplianceType(v string) *Evaluation { - s.ComplianceType = &v - return s +// AWS Config throws an exception if the recording group does not contain a +// valid list of resource types. Invalid values might also be incorrectly formatted. +type InvalidRecordingGroupException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetOrderingTimestamp sets the OrderingTimestamp field's value. -func (s *Evaluation) SetOrderingTimestamp(v time.Time) *Evaluation { - s.OrderingTimestamp = &v - return s +// String returns the string representation +func (s InvalidRecordingGroupException) String() string { + return awsutil.Prettify(s) } -// The details of an AWS Config evaluation. Provides the AWS resource that was -// evaluated, the compliance of the resource, related time stamps, and supplementary -// information. -type EvaluationResult struct { - _ struct{} `type:"structure"` +// GoString returns the string representation +func (s InvalidRecordingGroupException) GoString() string { + return s.String() +} - // Supplementary information about how the evaluation determined the compliance. - Annotation *string `min:"1" type:"string"` +func newErrorInvalidRecordingGroupException(v protocol.ResponseMetadata) error { + return &InvalidRecordingGroupException{ + respMetadata: v, + } +} - // 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"` +// Code returns the exception type name. +func (s InvalidRecordingGroupException) Code() string { + return "InvalidRecordingGroupException" +} - // The time when the AWS Config rule evaluated the AWS resource. - ConfigRuleInvokedTime *time.Time `type:"timestamp"` +// Message returns the exception's message. +func (s InvalidRecordingGroupException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Uniquely identifies the evaluation result. - EvaluationResultIdentifier *EvaluationResultIdentifier `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRecordingGroupException) OrigErr() error { + return nil +} - // The time when AWS Config recorded the evaluation result. - ResultRecordedTime *time.Time `type:"timestamp"` +func (s InvalidRecordingGroupException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // 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"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRecordingGroupException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRecordingGroupException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified ResultToken is invalid. +type InvalidResultTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s EvaluationResult) String() string { +func (s InvalidResultTokenException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EvaluationResult) GoString() string { +func (s InvalidResultTokenException) GoString() string { return s.String() } -// SetAnnotation sets the Annotation field's value. -func (s *EvaluationResult) SetAnnotation(v string) *EvaluationResult { - s.Annotation = &v - return s +func newErrorInvalidResultTokenException(v protocol.ResponseMetadata) error { + return &InvalidResultTokenException{ + respMetadata: v, + } } -// SetComplianceType sets the ComplianceType field's value. -func (s *EvaluationResult) SetComplianceType(v string) *EvaluationResult { - s.ComplianceType = &v - return s +// Code returns the exception type name. +func (s InvalidResultTokenException) Code() string { + return "InvalidResultTokenException" } -// SetConfigRuleInvokedTime sets the ConfigRuleInvokedTime field's value. -func (s *EvaluationResult) SetConfigRuleInvokedTime(v time.Time) *EvaluationResult { - s.ConfigRuleInvokedTime = &v - return s +// Message returns the exception's message. +func (s InvalidResultTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetEvaluationResultIdentifier sets the EvaluationResultIdentifier field's value. -func (s *EvaluationResult) SetEvaluationResultIdentifier(v *EvaluationResultIdentifier) *EvaluationResult { - s.EvaluationResultIdentifier = v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidResultTokenException) OrigErr() error { + return nil } -// SetResultRecordedTime sets the ResultRecordedTime field's value. -func (s *EvaluationResult) SetResultRecordedTime(v time.Time) *EvaluationResult { - s.ResultRecordedTime = &v - return s +func (s InvalidResultTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetResultToken sets the ResultToken field's value. -func (s *EvaluationResult) SetResultToken(v string) *EvaluationResult { - s.ResultToken = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidResultTokenException) StatusCode() int { + return s.respMetadata.StatusCode } -// Uniquely identifies an evaluation result. -type EvaluationResultIdentifier struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidResultTokenException) RequestID() string { + return s.respMetadata.RequestID +} - // 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"` +// You have provided a null or empty role ARN. +type InvalidRoleException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s EvaluationResultIdentifier) String() string { +func (s InvalidRoleException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EvaluationResultIdentifier) GoString() string { +func (s InvalidRoleException) GoString() string { return s.String() } -// SetEvaluationResultQualifier sets the EvaluationResultQualifier field's value. -func (s *EvaluationResultIdentifier) SetEvaluationResultQualifier(v *EvaluationResultQualifier) *EvaluationResultIdentifier { - s.EvaluationResultQualifier = v - return s +func newErrorInvalidRoleException(v protocol.ResponseMetadata) error { + return &InvalidRoleException{ + respMetadata: v, + } } -// SetOrderingTimestamp sets the OrderingTimestamp field's value. -func (s *EvaluationResultIdentifier) SetOrderingTimestamp(v time.Time) *EvaluationResultIdentifier { - s.OrderingTimestamp = &v - return s +// Code returns the exception type name. +func (s InvalidRoleException) Code() string { + return "InvalidRoleException" } -// Identifies an AWS Config rule that evaluated an AWS resource, and provides -// the type and ID of the resource that the rule evaluated. -type EvaluationResultQualifier struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidRoleException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The name of the AWS Config rule that was used in the evaluation. - ConfigRuleName *string `min:"1" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRoleException) OrigErr() error { + return nil +} - // The ID of the evaluated AWS resource. - ResourceId *string `min:"1" type:"string"` +func (s InvalidRoleException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The type of AWS resource that was evaluated. - ResourceType *string `min:"1" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRoleException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRoleException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified Amazon S3 key prefix is not valid. +type InvalidS3KeyPrefixException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s EvaluationResultQualifier) String() string { +func (s InvalidS3KeyPrefixException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EvaluationResultQualifier) GoString() string { +func (s InvalidS3KeyPrefixException) GoString() string { return s.String() } -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *EvaluationResultQualifier) SetConfigRuleName(v string) *EvaluationResultQualifier { - s.ConfigRuleName = &v - return s +func newErrorInvalidS3KeyPrefixException(v protocol.ResponseMetadata) error { + return &InvalidS3KeyPrefixException{ + respMetadata: v, + } } -// SetResourceId sets the ResourceId field's value. -func (s *EvaluationResultQualifier) SetResourceId(v string) *EvaluationResultQualifier { - s.ResourceId = &v - return s +// Code returns the exception type name. +func (s InvalidS3KeyPrefixException) Code() string { + return "InvalidS3KeyPrefixException" } -// SetResourceType sets the ResourceType field's value. -func (s *EvaluationResultQualifier) SetResourceType(v string) *EvaluationResultQualifier { - s.ResourceType = &v - return s +// Message returns the exception's message. +func (s InvalidS3KeyPrefixException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// The controls that AWS Config uses for executing remediations. -type ExecutionControls struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidS3KeyPrefixException) OrigErr() error { + return nil +} - // A SsmControls object. - SsmControls *SsmControls `type:"structure"` +func (s InvalidS3KeyPrefixException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidS3KeyPrefixException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidS3KeyPrefixException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified Amazon SNS topic does not exist. +type InvalidSNSTopicARNException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ExecutionControls) String() string { +func (s InvalidSNSTopicARNException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ExecutionControls) GoString() string { +func (s InvalidSNSTopicARNException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExecutionControls) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExecutionControls"} - if s.SsmControls != nil { - if err := s.SsmControls.Validate(); err != nil { - invalidParams.AddNested("SsmControls", err.(request.ErrInvalidParams)) - } +func newErrorInvalidSNSTopicARNException(v protocol.ResponseMetadata) error { + return &InvalidSNSTopicARNException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidSNSTopicARNException) Code() string { + return "InvalidSNSTopicARNException" +} + +// Message returns the exception's message. +func (s InvalidSNSTopicARNException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidSNSTopicARNException) OrigErr() error { return nil } -// SetSsmControls sets the SsmControls field's value. -func (s *ExecutionControls) SetSsmControls(v *SsmControls) *ExecutionControls { - s.SsmControls = v - return s +func (s InvalidSNSTopicARNException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// List of each of the failed delete remediation exceptions with specific reasons. -type FailedDeleteRemediationExceptionsBatch struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidSNSTopicARNException) StatusCode() int { + return s.respMetadata.StatusCode +} - // Returns remediation exception resource key object of the failed items. - FailedItems []*RemediationExceptionResourceKey `min:"1" type:"list"` +// RequestID returns the service's response RequestID for request. +func (s InvalidSNSTopicARNException) RequestID() string { + return s.respMetadata.RequestID +} - // Returns a failure message for delete remediation exception. For example, - // AWS Config creates an exception due to an internal error. - FailureMessage *string `type:"string"` +// The specified time range is not valid. The earlier time is not chronologically +// before the later time. +type InvalidTimeRangeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s FailedDeleteRemediationExceptionsBatch) String() string { +func (s InvalidTimeRangeException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s FailedDeleteRemediationExceptionsBatch) GoString() string { +func (s InvalidTimeRangeException) GoString() string { return s.String() } -// SetFailedItems sets the FailedItems field's value. -func (s *FailedDeleteRemediationExceptionsBatch) SetFailedItems(v []*RemediationExceptionResourceKey) *FailedDeleteRemediationExceptionsBatch { - s.FailedItems = v - return s +func newErrorInvalidTimeRangeException(v protocol.ResponseMetadata) error { + return &InvalidTimeRangeException{ + respMetadata: v, + } } -// SetFailureMessage sets the FailureMessage field's value. -func (s *FailedDeleteRemediationExceptionsBatch) SetFailureMessage(v string) *FailedDeleteRemediationExceptionsBatch { - s.FailureMessage = &v - return s +// Code returns the exception type name. +func (s InvalidTimeRangeException) Code() string { + return "InvalidTimeRangeException" } -// List of each of the failed remediations with specific reasons. -type FailedRemediationBatch struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidTimeRangeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Returns remediation configurations of the failed items. - FailedItems []*RemediationConfiguration `type:"list"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTimeRangeException) OrigErr() error { + return nil +} - // Returns a failure message. For example, the resource is already compliant. - FailureMessage *string `type:"string"` +func (s InvalidTimeRangeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTimeRangeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidTimeRangeException) RequestID() string { + return s.respMetadata.RequestID +} + +// You cannot delete the delivery channel you specified because the configuration +// recorder is running. +type LastDeliveryChannelDeleteFailedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s FailedRemediationBatch) String() string { +func (s LastDeliveryChannelDeleteFailedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s FailedRemediationBatch) GoString() string { +func (s LastDeliveryChannelDeleteFailedException) GoString() string { return s.String() } -// SetFailedItems sets the FailedItems field's value. -func (s *FailedRemediationBatch) SetFailedItems(v []*RemediationConfiguration) *FailedRemediationBatch { - s.FailedItems = v - return s +func newErrorLastDeliveryChannelDeleteFailedException(v protocol.ResponseMetadata) error { + return &LastDeliveryChannelDeleteFailedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LastDeliveryChannelDeleteFailedException) Code() string { + return "LastDeliveryChannelDeleteFailedException" +} + +// Message returns the exception's message. +func (s LastDeliveryChannelDeleteFailedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LastDeliveryChannelDeleteFailedException) OrigErr() error { + return nil +} + +func (s LastDeliveryChannelDeleteFailedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetFailureMessage sets the FailureMessage field's value. -func (s *FailedRemediationBatch) SetFailureMessage(v string) *FailedRemediationBatch { - s.FailureMessage = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s LastDeliveryChannelDeleteFailedException) StatusCode() int { + return s.respMetadata.StatusCode } -// List of each of the failed remediation exceptions with specific reasons. -type FailedRemediationExceptionBatch struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s LastDeliveryChannelDeleteFailedException) RequestID() string { + return s.respMetadata.RequestID +} - // Returns remediation exception resource key object of the failed items. - FailedItems []*RemediationException `type:"list"` +// For StartConfigRulesEvaluation API, this exception is thrown if an evaluation +// is in progress or if you call the StartConfigRulesEvaluation API more than +// once per minute. +// +// For PutConfigurationAggregator API, this exception is thrown if the number +// of accounts and aggregators exceeds the limit. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Returns a failure message. For example, the auto-remediation has failed. - FailureMessage *string `type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s FailedRemediationExceptionBatch) String() string { +func (s LimitExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s FailedRemediationExceptionBatch) GoString() string { +func (s LimitExceededException) GoString() string { return s.String() } -// SetFailedItems sets the FailedItems field's value. -func (s *FailedRemediationExceptionBatch) SetFailedItems(v []*RemediationException) *FailedRemediationExceptionBatch { - s.FailedItems = v - return s +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } } -// SetFailureMessage sets the FailureMessage field's value. -func (s *FailedRemediationExceptionBatch) SetFailureMessage(v string) *FailedRemediationExceptionBatch { - s.FailureMessage = &v - return s +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" } -// Details about the fields such as name of the field. -type FieldInfo struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Name of the field. - Name *string `type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil } -// String returns the string representation -func (s FieldInfo) String() string { - return awsutil.Prettify(s) +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// GoString returns the string representation -func (s FieldInfo) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetName sets the Name field's value. -func (s *FieldInfo) SetName(v string) *FieldInfo { - s.Name = &v - return s +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID } -type GetAggregateComplianceDetailsByConfigRuleInput struct { +type ListAggregateDiscoveredResourcesInput struct { _ struct{} `type:"structure"` - // The 12-digit account ID of the source account. - // - // AccountId is a required field - AccountId *string `type:"string" required:"true"` - - // The source region from where the data is aggregated. - // - // AwsRegion is a required field - AwsRegion *string `min:"1" type:"string" required:"true"` - - // The resource compliance status. - // - // For the GetAggregateComplianceDetailsByConfigRuleRequest data type, AWS Config - // supports only the COMPLIANT and NON_COMPLIANT. AWS Config does not support - // the NOT_APPLICABLE and INSUFFICIENT_DATA values. - ComplianceType *string `type:"string" enum:"ComplianceType"` - - // 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 name of the configuration aggregator. // // ConfigurationAggregatorName is a required field ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` - // The maximum number of evaluation results returned on each page. The default - // is 50. You cannot specify a number greater than 100. If you specify 0, AWS + // Filters the results based on the ResourceFilters object. + Filters *ResourceFilters `type:"structure"` + + // The maximum number of resource identifiers returned on each page. The default + // is 100. You cannot specify a number 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 type of resources that you want AWS Config to list in the response. + // + // ResourceType is a required field + ResourceType *string `type:"string" required:"true" enum:"ResourceType"` } // String returns the string representation -func (s GetAggregateComplianceDetailsByConfigRuleInput) String() string { +func (s ListAggregateDiscoveredResourcesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetAggregateComplianceDetailsByConfigRuleInput) GoString() string { +func (s ListAggregateDiscoveredResourcesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetAggregateComplianceDetailsByConfigRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAggregateComplianceDetailsByConfigRuleInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.AwsRegion == nil { - invalidParams.Add(request.NewErrParamRequired("AwsRegion")) - } - if s.AwsRegion != nil && len(*s.AwsRegion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AwsRegion", 1)) - } - if s.ConfigRuleName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigRuleName")) - } - if s.ConfigRuleName != nil && len(*s.ConfigRuleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigRuleName", 1)) - } +func (s *ListAggregateDiscoveredResourcesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAggregateDiscoveredResourcesInput"} if s.ConfigurationAggregatorName == nil { invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) } if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) } + if s.ResourceType == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceType")) + } + if s.Filters != nil { + if err := s.Filters.Validate(); err != nil { + invalidParams.AddNested("Filters", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -11247,128 +16602,232 @@ func (s *GetAggregateComplianceDetailsByConfigRuleInput) Validate() error { return nil } -// SetAccountId sets the AccountId field's value. -func (s *GetAggregateComplianceDetailsByConfigRuleInput) SetAccountId(v string) *GetAggregateComplianceDetailsByConfigRuleInput { - s.AccountId = &v +// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. +func (s *ListAggregateDiscoveredResourcesInput) SetConfigurationAggregatorName(v string) *ListAggregateDiscoveredResourcesInput { + s.ConfigurationAggregatorName = &v return s } -// SetAwsRegion sets the AwsRegion field's value. -func (s *GetAggregateComplianceDetailsByConfigRuleInput) SetAwsRegion(v string) *GetAggregateComplianceDetailsByConfigRuleInput { - s.AwsRegion = &v +// SetFilters sets the Filters field's value. +func (s *ListAggregateDiscoveredResourcesInput) SetFilters(v *ResourceFilters) *ListAggregateDiscoveredResourcesInput { + s.Filters = v return s } -// SetComplianceType sets the ComplianceType field's value. -func (s *GetAggregateComplianceDetailsByConfigRuleInput) SetComplianceType(v string) *GetAggregateComplianceDetailsByConfigRuleInput { - s.ComplianceType = &v +// SetLimit sets the Limit field's value. +func (s *ListAggregateDiscoveredResourcesInput) SetLimit(v int64) *ListAggregateDiscoveredResourcesInput { + s.Limit = &v return s } -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *GetAggregateComplianceDetailsByConfigRuleInput) SetConfigRuleName(v string) *GetAggregateComplianceDetailsByConfigRuleInput { - s.ConfigRuleName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListAggregateDiscoveredResourcesInput) SetNextToken(v string) *ListAggregateDiscoveredResourcesInput { + s.NextToken = &v return s } -// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. -func (s *GetAggregateComplianceDetailsByConfigRuleInput) SetConfigurationAggregatorName(v string) *GetAggregateComplianceDetailsByConfigRuleInput { - s.ConfigurationAggregatorName = &v +// SetResourceType sets the ResourceType field's value. +func (s *ListAggregateDiscoveredResourcesInput) SetResourceType(v string) *ListAggregateDiscoveredResourcesInput { + s.ResourceType = &v + return s +} + +type ListAggregateDiscoveredResourcesOutput struct { + _ struct{} `type:"structure"` + + // 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"` + + // Returns a list of ResourceIdentifiers objects. + ResourceIdentifiers []*AggregateResourceIdentifier `type:"list"` +} + +// String returns the string representation +func (s ListAggregateDiscoveredResourcesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAggregateDiscoveredResourcesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListAggregateDiscoveredResourcesOutput) SetNextToken(v string) *ListAggregateDiscoveredResourcesOutput { + s.NextToken = &v + return s +} + +// SetResourceIdentifiers sets the ResourceIdentifiers field's value. +func (s *ListAggregateDiscoveredResourcesOutput) SetResourceIdentifiers(v []*AggregateResourceIdentifier) *ListAggregateDiscoveredResourcesOutput { + s.ResourceIdentifiers = v + return s +} + +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 number 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 *GetAggregateComplianceDetailsByConfigRuleInput) SetLimit(v int64) *GetAggregateComplianceDetailsByConfigRuleInput { +func (s *ListDiscoveredResourcesInput) SetLimit(v int64) *ListDiscoveredResourcesInput { s.Limit = &v return s } // SetNextToken sets the NextToken field's value. -func (s *GetAggregateComplianceDetailsByConfigRuleInput) SetNextToken(v string) *GetAggregateComplianceDetailsByConfigRuleInput { +func (s *ListDiscoveredResourcesInput) SetNextToken(v string) *ListDiscoveredResourcesInput { s.NextToken = &v return s } -type GetAggregateComplianceDetailsByConfigRuleOutput struct { +// 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 +} + +type ListDiscoveredResourcesOutput struct { _ struct{} `type:"structure"` - // Returns an AggregateEvaluationResults object. - AggregateEvaluationResults []*AggregateEvaluationResult `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"` - // 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 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 GetAggregateComplianceDetailsByConfigRuleOutput) String() string { +func (s ListDiscoveredResourcesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetAggregateComplianceDetailsByConfigRuleOutput) GoString() string { +func (s ListDiscoveredResourcesOutput) GoString() string { return s.String() } -// SetAggregateEvaluationResults sets the AggregateEvaluationResults field's value. -func (s *GetAggregateComplianceDetailsByConfigRuleOutput) SetAggregateEvaluationResults(v []*AggregateEvaluationResult) *GetAggregateComplianceDetailsByConfigRuleOutput { - s.AggregateEvaluationResults = v +// SetNextToken sets the NextToken field's value. +func (s *ListDiscoveredResourcesOutput) SetNextToken(v string) *ListDiscoveredResourcesOutput { + s.NextToken = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *GetAggregateComplianceDetailsByConfigRuleOutput) SetNextToken(v string) *GetAggregateComplianceDetailsByConfigRuleOutput { - s.NextToken = &v +// SetResourceIdentifiers sets the ResourceIdentifiers field's value. +func (s *ListDiscoveredResourcesOutput) SetResourceIdentifiers(v []*ResourceIdentifier) *ListDiscoveredResourcesOutput { + s.ResourceIdentifiers = v return s } -type GetAggregateConfigRuleComplianceSummaryInput struct { +type ListTagsForResourceInput struct { _ struct{} `type:"structure"` - // The name of the configuration aggregator. - // - // ConfigurationAggregatorName is a required field - ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` - - // Filters the results based on the ConfigRuleComplianceSummaryFilters object. - Filters *ConfigRuleComplianceSummaryFilters `type:"structure"` - - // Groups the result based on ACCOUNT_ID or AWS_REGION. - GroupByKey *string `type:"string" enum:"ConfigRuleComplianceSummaryGroupKey"` - - // The maximum number of evaluation results returned on each page. The default - // is 1000. You cannot specify a number greater than 1000. If you specify 0, - // AWS Config uses the default. + // The maximum number of tags returned on each page. The limit maximum is 50. + // You cannot specify a number greater than 50. 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 Amazon Resource Name (ARN) that identifies the resource for which to + // list the tags. Currently, the supported resources are ConfigRule, ConfigurationAggregator + // and AggregatorAuthorization. + // + // ResourceArn is a required field + ResourceArn *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s GetAggregateConfigRuleComplianceSummaryInput) String() string { +func (s ListTagsForResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetAggregateConfigRuleComplianceSummaryInput) GoString() string { +func (s ListTagsForResourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetAggregateConfigRuleComplianceSummaryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAggregateConfigRuleComplianceSummaryInput"} - if s.ConfigurationAggregatorName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) - } - if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) +func (s *ListTagsForResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) } - if s.Filters != nil { - if err := s.Filters.Validate(); err != nil { - invalidParams.AddNested("Filters", err.(request.ErrInvalidParams)) - } + if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) } if invalidParams.Len() > 0 { @@ -11377,1451 +16836,1578 @@ func (s *GetAggregateConfigRuleComplianceSummaryInput) Validate() error { return nil } -// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. -func (s *GetAggregateConfigRuleComplianceSummaryInput) SetConfigurationAggregatorName(v string) *GetAggregateConfigRuleComplianceSummaryInput { - s.ConfigurationAggregatorName = &v +// SetLimit sets the Limit field's value. +func (s *ListTagsForResourceInput) SetLimit(v int64) *ListTagsForResourceInput { + s.Limit = &v return s } -// SetFilters sets the Filters field's value. -func (s *GetAggregateConfigRuleComplianceSummaryInput) SetFilters(v *ConfigRuleComplianceSummaryFilters) *GetAggregateConfigRuleComplianceSummaryInput { - s.Filters = v +// SetNextToken sets the NextToken field's value. +func (s *ListTagsForResourceInput) SetNextToken(v string) *ListTagsForResourceInput { + s.NextToken = &v return s } -// SetGroupByKey sets the GroupByKey field's value. -func (s *GetAggregateConfigRuleComplianceSummaryInput) SetGroupByKey(v string) *GetAggregateConfigRuleComplianceSummaryInput { - s.GroupByKey = &v +// SetResourceArn sets the ResourceArn field's value. +func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { + s.ResourceArn = &v return s } -// SetLimit sets the Limit field's value. -func (s *GetAggregateConfigRuleComplianceSummaryInput) SetLimit(v int64) *GetAggregateConfigRuleComplianceSummaryInput { - s.Limit = &v - return s +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // 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 tags for the resource. + Tags []*Tag `min:"1" 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 *GetAggregateConfigRuleComplianceSummaryInput) SetNextToken(v string) *GetAggregateConfigRuleComplianceSummaryInput { +func (s *ListTagsForResourceOutput) SetNextToken(v string) *ListTagsForResourceOutput { s.NextToken = &v return s } -type GetAggregateConfigRuleComplianceSummaryOutput struct { - _ struct{} `type:"structure"` - - // Returns a list of AggregateComplianceCounts object. - AggregateComplianceCounts []*AggregateComplianceCount `type:"list"` +// SetTags sets the Tags field's value. +func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { + s.Tags = v + return s +} - // Groups the result based on ACCOUNT_ID or AWS_REGION. - GroupByKey *string `min:"1" type:"string"` +// You have reached the limit (100,000) of active custom resource types in your +// account. Delete unused resources using DeleteResourceConfig. +type MaxActiveResourcesExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetAggregateConfigRuleComplianceSummaryOutput) String() string { +func (s MaxActiveResourcesExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetAggregateConfigRuleComplianceSummaryOutput) GoString() string { +func (s MaxActiveResourcesExceededException) GoString() string { return s.String() } -// SetAggregateComplianceCounts sets the AggregateComplianceCounts field's value. -func (s *GetAggregateConfigRuleComplianceSummaryOutput) SetAggregateComplianceCounts(v []*AggregateComplianceCount) *GetAggregateConfigRuleComplianceSummaryOutput { - s.AggregateComplianceCounts = v - return s +func newErrorMaxActiveResourcesExceededException(v protocol.ResponseMetadata) error { + return &MaxActiveResourcesExceededException{ + respMetadata: v, + } } -// SetGroupByKey sets the GroupByKey field's value. -func (s *GetAggregateConfigRuleComplianceSummaryOutput) SetGroupByKey(v string) *GetAggregateConfigRuleComplianceSummaryOutput { - s.GroupByKey = &v - return s +// Code returns the exception type name. +func (s MaxActiveResourcesExceededException) Code() string { + return "MaxActiveResourcesExceededException" } -// SetNextToken sets the NextToken field's value. -func (s *GetAggregateConfigRuleComplianceSummaryOutput) SetNextToken(v string) *GetAggregateConfigRuleComplianceSummaryOutput { - s.NextToken = &v - return s +// Message returns the exception's message. +func (s MaxActiveResourcesExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type GetAggregateDiscoveredResourceCountsInput struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaxActiveResourcesExceededException) OrigErr() error { + return nil +} - // The name of the configuration aggregator. - // - // ConfigurationAggregatorName is a required field - ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` +func (s MaxActiveResourcesExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // Filters the results based on the ResourceCountFilters object. - Filters *ResourceCountFilters `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s MaxActiveResourcesExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The key to group the resource counts. - GroupByKey *string `type:"string" enum:"ResourceCountGroupKey"` +// RequestID returns the service's response RequestID for request. +func (s MaxActiveResourcesExceededException) RequestID() string { + return s.respMetadata.RequestID +} - // The maximum number of GroupedResourceCount objects returned on each page. - // The default is 1000. You cannot specify a number greater than 1000. If you - // specify 0, AWS Config uses the default. - Limit *int64 `type:"integer"` +// Failed to add the AWS Config rule because the account already contains the +// maximum number of 150 rules. Consider deleting any deactivated rules before +// you add new rules. +type MaxNumberOfConfigRulesExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetAggregateDiscoveredResourceCountsInput) String() string { +func (s MaxNumberOfConfigRulesExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetAggregateDiscoveredResourceCountsInput) GoString() string { +func (s MaxNumberOfConfigRulesExceededException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAggregateDiscoveredResourceCountsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAggregateDiscoveredResourceCountsInput"} - if s.ConfigurationAggregatorName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) - } - if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) - } - if s.Filters != nil { - if err := s.Filters.Validate(); err != nil { - invalidParams.AddNested("Filters", err.(request.ErrInvalidParams)) - } +func newErrorMaxNumberOfConfigRulesExceededException(v protocol.ResponseMetadata) error { + return &MaxNumberOfConfigRulesExceededException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s MaxNumberOfConfigRulesExceededException) Code() string { + return "MaxNumberOfConfigRulesExceededException" +} + +// Message returns the exception's message. +func (s MaxNumberOfConfigRulesExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaxNumberOfConfigRulesExceededException) OrigErr() error { return nil } -// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. -func (s *GetAggregateDiscoveredResourceCountsInput) SetConfigurationAggregatorName(v string) *GetAggregateDiscoveredResourceCountsInput { - s.ConfigurationAggregatorName = &v - return s +func (s MaxNumberOfConfigRulesExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetFilters sets the Filters field's value. -func (s *GetAggregateDiscoveredResourceCountsInput) SetFilters(v *ResourceCountFilters) *GetAggregateDiscoveredResourceCountsInput { - s.Filters = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s MaxNumberOfConfigRulesExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetGroupByKey sets the GroupByKey field's value. -func (s *GetAggregateDiscoveredResourceCountsInput) SetGroupByKey(v string) *GetAggregateDiscoveredResourceCountsInput { - s.GroupByKey = &v - return s +// RequestID returns the service's response RequestID for request. +func (s MaxNumberOfConfigRulesExceededException) RequestID() string { + return s.respMetadata.RequestID } -// SetLimit sets the Limit field's value. -func (s *GetAggregateDiscoveredResourceCountsInput) SetLimit(v int64) *GetAggregateDiscoveredResourceCountsInput { - s.Limit = &v - return s +// You have reached the limit of the number of recorders you can create. +type MaxNumberOfConfigurationRecordersExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetNextToken sets the NextToken field's value. -func (s *GetAggregateDiscoveredResourceCountsInput) SetNextToken(v string) *GetAggregateDiscoveredResourceCountsInput { - s.NextToken = &v - return s +// String returns the string representation +func (s MaxNumberOfConfigurationRecordersExceededException) String() string { + return awsutil.Prettify(s) } -type GetAggregateDiscoveredResourceCountsOutput struct { - _ struct{} `type:"structure"` +// GoString returns the string representation +func (s MaxNumberOfConfigurationRecordersExceededException) GoString() string { + return s.String() +} - // The key passed into the request object. If GroupByKey is not provided, the - // result will be empty. - GroupByKey *string `min:"1" type:"string"` +func newErrorMaxNumberOfConfigurationRecordersExceededException(v protocol.ResponseMetadata) error { + return &MaxNumberOfConfigurationRecordersExceededException{ + respMetadata: v, + } +} - // Returns a list of GroupedResourceCount objects. - GroupedResourceCounts []*GroupedResourceCount `type:"list"` +// Code returns the exception type name. +func (s MaxNumberOfConfigurationRecordersExceededException) Code() string { + return "MaxNumberOfConfigurationRecordersExceededException" +} - // 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"` +// Message returns the exception's message. +func (s MaxNumberOfConfigurationRecordersExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The total number of resources that are present in an aggregator with the - // filters that you provide. - // - // TotalDiscoveredResources is a required field - TotalDiscoveredResources *int64 `type:"long" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaxNumberOfConfigurationRecordersExceededException) OrigErr() error { + return nil +} + +func (s MaxNumberOfConfigurationRecordersExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MaxNumberOfConfigurationRecordersExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MaxNumberOfConfigurationRecordersExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// You have reached the limit (6) of the number of conformance packs in an account +// (6 conformance pack with 25 AWS Config rules per pack). +type MaxNumberOfConformancePacksExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetAggregateDiscoveredResourceCountsOutput) String() string { +func (s MaxNumberOfConformancePacksExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetAggregateDiscoveredResourceCountsOutput) GoString() string { +func (s MaxNumberOfConformancePacksExceededException) GoString() string { return s.String() } -// SetGroupByKey sets the GroupByKey field's value. -func (s *GetAggregateDiscoveredResourceCountsOutput) SetGroupByKey(v string) *GetAggregateDiscoveredResourceCountsOutput { - s.GroupByKey = &v - return s +func newErrorMaxNumberOfConformancePacksExceededException(v protocol.ResponseMetadata) error { + return &MaxNumberOfConformancePacksExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MaxNumberOfConformancePacksExceededException) Code() string { + return "MaxNumberOfConformancePacksExceededException" +} + +// Message returns the exception's message. +func (s MaxNumberOfConformancePacksExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetGroupedResourceCounts sets the GroupedResourceCounts field's value. -func (s *GetAggregateDiscoveredResourceCountsOutput) SetGroupedResourceCounts(v []*GroupedResourceCount) *GetAggregateDiscoveredResourceCountsOutput { - s.GroupedResourceCounts = v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaxNumberOfConformancePacksExceededException) OrigErr() error { + return nil } -// SetNextToken sets the NextToken field's value. -func (s *GetAggregateDiscoveredResourceCountsOutput) SetNextToken(v string) *GetAggregateDiscoveredResourceCountsOutput { - s.NextToken = &v - return s +func (s MaxNumberOfConformancePacksExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetTotalDiscoveredResources sets the TotalDiscoveredResources field's value. -func (s *GetAggregateDiscoveredResourceCountsOutput) SetTotalDiscoveredResources(v int64) *GetAggregateDiscoveredResourceCountsOutput { - s.TotalDiscoveredResources = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s MaxNumberOfConformancePacksExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -type GetAggregateResourceConfigInput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s MaxNumberOfConformancePacksExceededException) RequestID() string { + return s.respMetadata.RequestID +} - // The name of the configuration aggregator. - // - // ConfigurationAggregatorName is a required field - ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` +// You have reached the limit of the number of delivery channels you can create. +type MaxNumberOfDeliveryChannelsExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // An object that identifies aggregate resource. - // - // ResourceIdentifier is a required field - ResourceIdentifier *AggregateResourceIdentifier `type:"structure" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetAggregateResourceConfigInput) String() string { +func (s MaxNumberOfDeliveryChannelsExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetAggregateResourceConfigInput) GoString() string { +func (s MaxNumberOfDeliveryChannelsExceededException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetAggregateResourceConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAggregateResourceConfigInput"} - if s.ConfigurationAggregatorName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) - } - if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) - } - if s.ResourceIdentifier == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIdentifier")) - } - if s.ResourceIdentifier != nil { - if err := s.ResourceIdentifier.Validate(); err != nil { - invalidParams.AddNested("ResourceIdentifier", err.(request.ErrInvalidParams)) - } +func newErrorMaxNumberOfDeliveryChannelsExceededException(v protocol.ResponseMetadata) error { + return &MaxNumberOfDeliveryChannelsExceededException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s MaxNumberOfDeliveryChannelsExceededException) Code() string { + return "MaxNumberOfDeliveryChannelsExceededException" +} + +// Message returns the exception's message. +func (s MaxNumberOfDeliveryChannelsExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaxNumberOfDeliveryChannelsExceededException) OrigErr() error { return nil } -// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. -func (s *GetAggregateResourceConfigInput) SetConfigurationAggregatorName(v string) *GetAggregateResourceConfigInput { - s.ConfigurationAggregatorName = &v - return s +func (s MaxNumberOfDeliveryChannelsExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetResourceIdentifier sets the ResourceIdentifier field's value. -func (s *GetAggregateResourceConfigInput) SetResourceIdentifier(v *AggregateResourceIdentifier) *GetAggregateResourceConfigInput { - s.ResourceIdentifier = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s MaxNumberOfDeliveryChannelsExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -type GetAggregateResourceConfigOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s MaxNumberOfDeliveryChannelsExceededException) RequestID() string { + return s.respMetadata.RequestID +} - // Returns a ConfigurationItem object. - ConfigurationItem *ConfigurationItem `type:"structure"` +// You have reached the limit of the number of organization config rules you +// can create. +type MaxNumberOfOrganizationConfigRulesExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetAggregateResourceConfigOutput) String() string { +func (s MaxNumberOfOrganizationConfigRulesExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetAggregateResourceConfigOutput) GoString() string { +func (s MaxNumberOfOrganizationConfigRulesExceededException) GoString() string { return s.String() } -// SetConfigurationItem sets the ConfigurationItem field's value. -func (s *GetAggregateResourceConfigOutput) SetConfigurationItem(v *ConfigurationItem) *GetAggregateResourceConfigOutput { - s.ConfigurationItem = v - return s +func newErrorMaxNumberOfOrganizationConfigRulesExceededException(v protocol.ResponseMetadata) error { + return &MaxNumberOfOrganizationConfigRulesExceededException{ + respMetadata: v, + } } -type GetComplianceDetailsByConfigRuleInput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s MaxNumberOfOrganizationConfigRulesExceededException) Code() string { + return "MaxNumberOfOrganizationConfigRulesExceededException" +} - // Filters the results by compliance. - // - // The allowed values are COMPLIANT, NON_COMPLIANT, and NOT_APPLICABLE. - ComplianceTypes []*string `type:"list"` +// Message returns the exception's message. +func (s MaxNumberOfOrganizationConfigRulesExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // 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"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaxNumberOfOrganizationConfigRulesExceededException) OrigErr() error { + return nil +} - // The maximum number of evaluation results returned on each page. The default - // is 10. You cannot specify a number greater than 100. If you specify 0, AWS - // Config uses the default. - Limit *int64 `type:"integer"` +func (s MaxNumberOfOrganizationConfigRulesExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // 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"` +// Status code returns the HTTP status code for the request's response error. +func (s MaxNumberOfOrganizationConfigRulesExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MaxNumberOfOrganizationConfigRulesExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// You have reached the limit (6) of the number of organization conformance +// packs in an account (6 conformance pack with 25 AWS Config rules per pack +// per account). +type MaxNumberOfOrganizationConformancePacksExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetComplianceDetailsByConfigRuleInput) String() string { +func (s MaxNumberOfOrganizationConformancePacksExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetComplianceDetailsByConfigRuleInput) GoString() string { +func (s MaxNumberOfOrganizationConformancePacksExceededException) 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)) +func newErrorMaxNumberOfOrganizationConformancePacksExceededException(v protocol.ResponseMetadata) error { + return &MaxNumberOfOrganizationConformancePacksExceededException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// Code returns the exception type name. +func (s MaxNumberOfOrganizationConformancePacksExceededException) Code() string { + return "MaxNumberOfOrganizationConformancePacksExceededException" } -// SetComplianceTypes sets the ComplianceTypes field's value. -func (s *GetComplianceDetailsByConfigRuleInput) SetComplianceTypes(v []*string) *GetComplianceDetailsByConfigRuleInput { - s.ComplianceTypes = v - return s +// Message returns the exception's message. +func (s MaxNumberOfOrganizationConformancePacksExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *GetComplianceDetailsByConfigRuleInput) SetConfigRuleName(v string) *GetComplianceDetailsByConfigRuleInput { - s.ConfigRuleName = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaxNumberOfOrganizationConformancePacksExceededException) OrigErr() error { + return nil } -// SetLimit sets the Limit field's value. -func (s *GetComplianceDetailsByConfigRuleInput) SetLimit(v int64) *GetComplianceDetailsByConfigRuleInput { - s.Limit = &v - return s +func (s MaxNumberOfOrganizationConformancePacksExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetNextToken sets the NextToken field's value. -func (s *GetComplianceDetailsByConfigRuleInput) SetNextToken(v string) *GetComplianceDetailsByConfigRuleInput { - s.NextToken = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s MaxNumberOfOrganizationConformancePacksExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -type GetComplianceDetailsByConfigRuleOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s MaxNumberOfOrganizationConformancePacksExceededException) RequestID() string { + return s.respMetadata.RequestID +} - // Indicates whether the AWS resource complies with the specified AWS Config - // rule. - EvaluationResults []*EvaluationResult `type:"list"` +// Failed to add the retention configuration because a retention configuration +// with that name already exists. +type MaxNumberOfRetentionConfigurationsExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The string that you use in a subsequent request to get the next page of results - // in a paginated response. - NextToken *string `type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetComplianceDetailsByConfigRuleOutput) String() string { +func (s MaxNumberOfRetentionConfigurationsExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetComplianceDetailsByConfigRuleOutput) GoString() string { +func (s MaxNumberOfRetentionConfigurationsExceededException) GoString() string { return s.String() } -// SetEvaluationResults sets the EvaluationResults field's value. -func (s *GetComplianceDetailsByConfigRuleOutput) SetEvaluationResults(v []*EvaluationResult) *GetComplianceDetailsByConfigRuleOutput { - s.EvaluationResults = v - return s +func newErrorMaxNumberOfRetentionConfigurationsExceededException(v protocol.ResponseMetadata) error { + return &MaxNumberOfRetentionConfigurationsExceededException{ + respMetadata: v, + } } -// SetNextToken sets the NextToken field's value. -func (s *GetComplianceDetailsByConfigRuleOutput) SetNextToken(v string) *GetComplianceDetailsByConfigRuleOutput { - s.NextToken = &v - return s +// Code returns the exception type name. +func (s MaxNumberOfRetentionConfigurationsExceededException) Code() string { + return "MaxNumberOfRetentionConfigurationsExceededException" } -type GetComplianceDetailsByResourceInput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s MaxNumberOfRetentionConfigurationsExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Filters the results by compliance. - // - // The allowed values are COMPLIANT, NON_COMPLIANT, and NOT_APPLICABLE. - ComplianceTypes []*string `type:"list"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaxNumberOfRetentionConfigurationsExceededException) OrigErr() error { + return nil +} - // 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"` +func (s MaxNumberOfRetentionConfigurationsExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The ID of the AWS resource for which you want compliance information. +// Status code returns the HTTP status code for the request's response error. +func (s MaxNumberOfRetentionConfigurationsExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MaxNumberOfRetentionConfigurationsExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// Organization config rule creation or deletion status in each member account. +// This includes the name of the rule, the status, error code and error message +// when the rule creation or deletion failed. +type MemberAccountStatus struct { + _ struct{} `type:"structure"` + + // The 12-digit account ID of a member account. // - // ResourceId is a required field - ResourceId *string `min:"1" type:"string" required:"true"` + // AccountId is a required field + AccountId *string `type:"string" required:"true"` - // The type of the AWS resource for which you want compliance information. + // The name of config rule deployed in the member account. // - // ResourceType is a required field - ResourceType *string `min:"1" type:"string" required:"true"` -} + // ConfigRuleName is a required field + ConfigRuleName *string `min:"1" type:"string" required:"true"` -// String returns the string representation -func (s GetComplianceDetailsByResourceInput) String() string { - return awsutil.Prettify(s) -} + // An error code that is returned when config rule creation or deletion failed + // in the member account. + ErrorCode *string `type:"string"` -// GoString returns the string representation -func (s GetComplianceDetailsByResourceInput) GoString() string { - return s.String() + // An error message indicating that config rule account creation or deletion + // has failed due to an error in the member account. + ErrorMessage *string `type:"string"` + + // The timestamp of the last status update. + LastUpdateTime *time.Time `type:"timestamp"` + + // Indicates deployment status for config rule in the member account. When master + // account calls PutOrganizationConfigRule action for the first time, config + // rule status is created in the member account. When master account calls PutOrganizationConfigRule + // action for the second time, config rule status is updated in the member account. + // Config rule status is deleted when the master account deletes OrganizationConfigRule + // and disables service access for config-multiaccountsetup.amazonaws.com. + // + // AWS Config sets the state of the rule to: + // + // * CREATE_SUCCESSFUL when config rule has been created in the member account. + // + // * CREATE_IN_PROGRESS when config rule is being created in the member account. + // + // * CREATE_FAILED when config rule creation has failed in the member account. + // + // * DELETE_FAILED when config rule deletion has failed in the member account. + // + // * DELETE_IN_PROGRESS when config rule is being deleted in the member account. + // + // * DELETE_SUCCESSFUL when config rule has been deleted in the member account. + // + // * UPDATE_SUCCESSFUL when config rule has been updated in the member account. + // + // * UPDATE_IN_PROGRESS when config rule is being updated in the member account. + // + // * UPDATE_FAILED when config rule deletion has failed in the member account. + // + // MemberAccountRuleStatus is a required field + MemberAccountRuleStatus *string `type:"string" required:"true" enum:"MemberAccountRuleStatus"` } -// 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)) - } +// String returns the string representation +func (s MemberAccountStatus) String() string { + return awsutil.Prettify(s) +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// GoString returns the string representation +func (s MemberAccountStatus) GoString() string { + return s.String() } -// SetComplianceTypes sets the ComplianceTypes field's value. -func (s *GetComplianceDetailsByResourceInput) SetComplianceTypes(v []*string) *GetComplianceDetailsByResourceInput { - s.ComplianceTypes = v +// SetAccountId sets the AccountId field's value. +func (s *MemberAccountStatus) SetAccountId(v string) *MemberAccountStatus { + s.AccountId = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *GetComplianceDetailsByResourceInput) SetNextToken(v string) *GetComplianceDetailsByResourceInput { - s.NextToken = &v +// SetConfigRuleName sets the ConfigRuleName field's value. +func (s *MemberAccountStatus) SetConfigRuleName(v string) *MemberAccountStatus { + s.ConfigRuleName = &v return s } -// SetResourceId sets the ResourceId field's value. -func (s *GetComplianceDetailsByResourceInput) SetResourceId(v string) *GetComplianceDetailsByResourceInput { - s.ResourceId = &v +// SetErrorCode sets the ErrorCode field's value. +func (s *MemberAccountStatus) SetErrorCode(v string) *MemberAccountStatus { + s.ErrorCode = &v return s } -// SetResourceType sets the ResourceType field's value. -func (s *GetComplianceDetailsByResourceInput) SetResourceType(v string) *GetComplianceDetailsByResourceInput { - s.ResourceType = &v +// SetErrorMessage sets the ErrorMessage field's value. +func (s *MemberAccountStatus) SetErrorMessage(v string) *MemberAccountStatus { + s.ErrorMessage = &v return s } -type GetComplianceDetailsByResourceOutput struct { - _ struct{} `type:"structure"` +// SetLastUpdateTime sets the LastUpdateTime field's value. +func (s *MemberAccountStatus) SetLastUpdateTime(v time.Time) *MemberAccountStatus { + s.LastUpdateTime = &v + return s +} - // Indicates whether the specified AWS resource complies each AWS Config rule. - EvaluationResults []*EvaluationResult `type:"list"` +// SetMemberAccountRuleStatus sets the MemberAccountRuleStatus field's value. +func (s *MemberAccountStatus) SetMemberAccountRuleStatus(v string) *MemberAccountStatus { + s.MemberAccountRuleStatus = &v + return s +} - // The string that you use in a subsequent request to get the next page of results - // in a paginated response. - NextToken *string `type:"string"` +// There are no configuration recorders available to provide the role needed +// to describe your resources. Create a configuration recorder. +type NoAvailableConfigurationRecorderException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetComplianceDetailsByResourceOutput) String() string { +func (s NoAvailableConfigurationRecorderException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetComplianceDetailsByResourceOutput) GoString() string { +func (s NoAvailableConfigurationRecorderException) GoString() string { return s.String() } -// SetEvaluationResults sets the EvaluationResults field's value. -func (s *GetComplianceDetailsByResourceOutput) SetEvaluationResults(v []*EvaluationResult) *GetComplianceDetailsByResourceOutput { - s.EvaluationResults = v - return s +func newErrorNoAvailableConfigurationRecorderException(v protocol.ResponseMetadata) error { + return &NoAvailableConfigurationRecorderException{ + respMetadata: v, + } } -// SetNextToken sets the NextToken field's value. -func (s *GetComplianceDetailsByResourceOutput) SetNextToken(v string) *GetComplianceDetailsByResourceOutput { - s.NextToken = &v - return s +// Code returns the exception type name. +func (s NoAvailableConfigurationRecorderException) Code() string { + return "NoAvailableConfigurationRecorderException" } -type GetComplianceSummaryByConfigRuleInput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s NoAvailableConfigurationRecorderException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s GetComplianceSummaryByConfigRuleInput) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoAvailableConfigurationRecorderException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s GetComplianceSummaryByConfigRuleInput) GoString() string { - return s.String() +func (s NoAvailableConfigurationRecorderException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -type GetComplianceSummaryByConfigRuleOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s NoAvailableConfigurationRecorderException) StatusCode() int { + return s.respMetadata.StatusCode +} - // 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"` +// RequestID returns the service's response RequestID for request. +func (s NoAvailableConfigurationRecorderException) RequestID() string { + return s.respMetadata.RequestID +} + +// There is no delivery channel available to record configurations. +type NoAvailableDeliveryChannelException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetComplianceSummaryByConfigRuleOutput) String() string { +func (s NoAvailableDeliveryChannelException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetComplianceSummaryByConfigRuleOutput) GoString() string { +func (s NoAvailableDeliveryChannelException) GoString() string { return s.String() } -// SetComplianceSummary sets the ComplianceSummary field's value. -func (s *GetComplianceSummaryByConfigRuleOutput) SetComplianceSummary(v *ComplianceSummary) *GetComplianceSummaryByConfigRuleOutput { - s.ComplianceSummary = v - return s +func newErrorNoAvailableDeliveryChannelException(v protocol.ResponseMetadata) error { + return &NoAvailableDeliveryChannelException{ + respMetadata: v, + } } -type GetComplianceSummaryByResourceTypeInput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s NoAvailableDeliveryChannelException) Code() string { + return "NoAvailableDeliveryChannelException" +} - // 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. - // You can specify that the resource type is an AWS account by specifying AWS::::Account. - ResourceTypes []*string `type:"list"` +// Message returns the exception's message. +func (s NoAvailableDeliveryChannelException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s GetComplianceSummaryByResourceTypeInput) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoAvailableDeliveryChannelException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s GetComplianceSummaryByResourceTypeInput) GoString() string { - return s.String() +func (s NoAvailableDeliveryChannelException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetResourceTypes sets the ResourceTypes field's value. -func (s *GetComplianceSummaryByResourceTypeInput) SetResourceTypes(v []*string) *GetComplianceSummaryByResourceTypeInput { - s.ResourceTypes = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s NoAvailableDeliveryChannelException) StatusCode() int { + return s.respMetadata.StatusCode } -type GetComplianceSummaryByResourceTypeOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s NoAvailableDeliveryChannelException) RequestID() string { + return s.respMetadata.RequestID +} - // 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"` +// Organization is no longer available. +type NoAvailableOrganizationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetComplianceSummaryByResourceTypeOutput) String() string { +func (s NoAvailableOrganizationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetComplianceSummaryByResourceTypeOutput) GoString() string { +func (s NoAvailableOrganizationException) GoString() string { return s.String() } -// SetComplianceSummariesByResourceType sets the ComplianceSummariesByResourceType field's value. -func (s *GetComplianceSummaryByResourceTypeOutput) SetComplianceSummariesByResourceType(v []*ComplianceSummaryByResourceType) *GetComplianceSummaryByResourceTypeOutput { - s.ComplianceSummariesByResourceType = v - return s +func newErrorNoAvailableOrganizationException(v protocol.ResponseMetadata) error { + return &NoAvailableOrganizationException{ + respMetadata: v, + } } -type GetDiscoveredResourceCountsInput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s NoAvailableOrganizationException) Code() string { + return "NoAvailableOrganizationException" +} - // The maximum number of ResourceCount objects returned on each page. The default - // is 100. You cannot specify a number greater than 100. If you specify 0, AWS - // Config uses the default. - Limit *int64 `locationName:"limit" type:"integer"` +// Message returns the exception's message. +func (s NoAvailableOrganizationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // 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"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoAvailableOrganizationException) OrigErr() error { + return nil +} - // The comma-separated list that specifies the resource types that you want - // AWS Config to return (for example, "AWS::EC2::Instance", "AWS::IAM::User"). - // - // If a value for resourceTypes is not specified, AWS Config returns all resource - // types that AWS Config is recording in the region for your account. - // - // If the configuration recorder is turned off, AWS Config returns an empty - // list of ResourceCount objects. If the configuration recorder is not recording - // a specific resource type (for example, S3 buckets), that resource type is - // not returned in the list of ResourceCount objects. - ResourceTypes []*string `locationName:"resourceTypes" type:"list"` +func (s NoAvailableOrganizationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NoAvailableOrganizationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NoAvailableOrganizationException) RequestID() string { + return s.respMetadata.RequestID +} + +// There is no configuration recorder running. +type NoRunningConfigurationRecorderException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetDiscoveredResourceCountsInput) String() string { +func (s NoRunningConfigurationRecorderException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDiscoveredResourceCountsInput) GoString() string { +func (s NoRunningConfigurationRecorderException) GoString() string { return s.String() } -// SetLimit sets the Limit field's value. -func (s *GetDiscoveredResourceCountsInput) SetLimit(v int64) *GetDiscoveredResourceCountsInput { - s.Limit = &v - return s +func newErrorNoRunningConfigurationRecorderException(v protocol.ResponseMetadata) error { + return &NoRunningConfigurationRecorderException{ + respMetadata: v, + } } -// SetNextToken sets the NextToken field's value. -func (s *GetDiscoveredResourceCountsInput) SetNextToken(v string) *GetDiscoveredResourceCountsInput { - s.NextToken = &v - return s +// Code returns the exception type name. +func (s NoRunningConfigurationRecorderException) Code() string { + return "NoRunningConfigurationRecorderException" } -// SetResourceTypes sets the ResourceTypes field's value. -func (s *GetDiscoveredResourceCountsInput) SetResourceTypes(v []*string) *GetDiscoveredResourceCountsInput { - s.ResourceTypes = v - return s +// Message returns the exception's message. +func (s NoRunningConfigurationRecorderException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type GetDiscoveredResourceCountsOutput struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoRunningConfigurationRecorderException) OrigErr() error { + return nil +} - // 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"` +func (s NoRunningConfigurationRecorderException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The list of ResourceCount objects. Each object is listed in descending order - // by the number of resources. - ResourceCounts []*ResourceCount `locationName:"resourceCounts" type:"list"` +// Status code returns the HTTP status code for the request's response error. +func (s NoRunningConfigurationRecorderException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The total number of resources that AWS Config is recording in the region - // for your account. If you specify resource types in the request, AWS Config - // returns only the total number of resources for those resource types. - // - // Example - // - // AWS Config is recording three resource types in the US East (Ohio) Region - // for your account: 25 EC2 instances, 20 IAM users, and 15 S3 buckets, for - // a total of 60 resources. - // - // You make a call to the GetDiscoveredResourceCounts action and specify the - // resource type, "AWS::EC2::Instances", in the request. - // - // AWS Config returns 25 for totalDiscoveredResources. - TotalDiscoveredResources *int64 `locationName:"totalDiscoveredResources" type:"long"` +// RequestID returns the service's response RequestID for request. +func (s NoRunningConfigurationRecorderException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified Amazon S3 bucket does not exist. +type NoSuchBucketException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetDiscoveredResourceCountsOutput) String() string { +func (s NoSuchBucketException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDiscoveredResourceCountsOutput) GoString() string { +func (s NoSuchBucketException) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *GetDiscoveredResourceCountsOutput) SetNextToken(v string) *GetDiscoveredResourceCountsOutput { - s.NextToken = &v - return s +func newErrorNoSuchBucketException(v protocol.ResponseMetadata) error { + return &NoSuchBucketException{ + respMetadata: v, + } } -// SetResourceCounts sets the ResourceCounts field's value. -func (s *GetDiscoveredResourceCountsOutput) SetResourceCounts(v []*ResourceCount) *GetDiscoveredResourceCountsOutput { - s.ResourceCounts = v - return s +// Code returns the exception type name. +func (s NoSuchBucketException) Code() string { + return "NoSuchBucketException" } -// SetTotalDiscoveredResources sets the TotalDiscoveredResources field's value. -func (s *GetDiscoveredResourceCountsOutput) SetTotalDiscoveredResources(v int64) *GetDiscoveredResourceCountsOutput { - s.TotalDiscoveredResources = &v - return s +// Message returns the exception's message. +func (s NoSuchBucketException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type GetOrganizationConfigRuleDetailedStatusInput struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoSuchBucketException) OrigErr() error { + return nil +} - // A StatusDetailFilters object. - Filters *StatusDetailFilters `type:"structure"` +func (s NoSuchBucketException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The maximum number of OrganizationConfigRuleDetailedStatus returned on each - // page. If you do not specify a number, AWS Config uses the default. The default - // is 100. - Limit *int64 `type:"integer"` +// Status code returns the HTTP status code for the request's response error. +func (s NoSuchBucketException) StatusCode() int { + return s.respMetadata.StatusCode +} - // 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"` +// RequestID returns the service's response RequestID for request. +func (s NoSuchBucketException) RequestID() string { + return s.respMetadata.RequestID +} - // The name of organization config rule for which you want status details for - // member accounts. - // - // OrganizationConfigRuleName is a required field - OrganizationConfigRuleName *string `min:"1" type:"string" required:"true"` +// One or more AWS Config rules in the request are invalid. Verify that the +// rule names are correct and try again. +type NoSuchConfigRuleException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetOrganizationConfigRuleDetailedStatusInput) String() string { +func (s NoSuchConfigRuleException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetOrganizationConfigRuleDetailedStatusInput) GoString() string { +func (s NoSuchConfigRuleException) GoString() string { return s.String() } - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetOrganizationConfigRuleDetailedStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetOrganizationConfigRuleDetailedStatusInput"} - if s.OrganizationConfigRuleName == nil { - invalidParams.Add(request.NewErrParamRequired("OrganizationConfigRuleName")) - } - if s.OrganizationConfigRuleName != nil && len(*s.OrganizationConfigRuleName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OrganizationConfigRuleName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams + +func newErrorNoSuchConfigRuleException(v protocol.ResponseMetadata) error { + return &NoSuchConfigRuleException{ + respMetadata: v, } - return nil } -// SetFilters sets the Filters field's value. -func (s *GetOrganizationConfigRuleDetailedStatusInput) SetFilters(v *StatusDetailFilters) *GetOrganizationConfigRuleDetailedStatusInput { - s.Filters = v - return s +// Code returns the exception type name. +func (s NoSuchConfigRuleException) Code() string { + return "NoSuchConfigRuleException" } -// SetLimit sets the Limit field's value. -func (s *GetOrganizationConfigRuleDetailedStatusInput) SetLimit(v int64) *GetOrganizationConfigRuleDetailedStatusInput { - s.Limit = &v - return s +// Message returns the exception's message. +func (s NoSuchConfigRuleException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetNextToken sets the NextToken field's value. -func (s *GetOrganizationConfigRuleDetailedStatusInput) SetNextToken(v string) *GetOrganizationConfigRuleDetailedStatusInput { - s.NextToken = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoSuchConfigRuleException) OrigErr() error { + return nil } -// SetOrganizationConfigRuleName sets the OrganizationConfigRuleName field's value. -func (s *GetOrganizationConfigRuleDetailedStatusInput) SetOrganizationConfigRuleName(v string) *GetOrganizationConfigRuleDetailedStatusInput { - s.OrganizationConfigRuleName = &v - return s +func (s NoSuchConfigRuleException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -type GetOrganizationConfigRuleDetailedStatusOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s NoSuchConfigRuleException) StatusCode() int { + return s.respMetadata.StatusCode +} - // 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"` +// RequestID returns the service's response RequestID for request. +func (s NoSuchConfigRuleException) RequestID() string { + return s.respMetadata.RequestID +} - // A list of MemberAccountStatus objects. - OrganizationConfigRuleDetailedStatus []*MemberAccountStatus `type:"list"` +// AWS Config rule that you passed in the filter does not exist. +type NoSuchConfigRuleInConformancePackException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetOrganizationConfigRuleDetailedStatusOutput) String() string { +func (s NoSuchConfigRuleInConformancePackException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetOrganizationConfigRuleDetailedStatusOutput) GoString() string { +func (s NoSuchConfigRuleInConformancePackException) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *GetOrganizationConfigRuleDetailedStatusOutput) SetNextToken(v string) *GetOrganizationConfigRuleDetailedStatusOutput { - s.NextToken = &v - return s +func newErrorNoSuchConfigRuleInConformancePackException(v protocol.ResponseMetadata) error { + return &NoSuchConfigRuleInConformancePackException{ + respMetadata: v, + } } -// SetOrganizationConfigRuleDetailedStatus sets the OrganizationConfigRuleDetailedStatus field's value. -func (s *GetOrganizationConfigRuleDetailedStatusOutput) SetOrganizationConfigRuleDetailedStatus(v []*MemberAccountStatus) *GetOrganizationConfigRuleDetailedStatusOutput { - s.OrganizationConfigRuleDetailedStatus = v - return s +// Code returns the exception type name. +func (s NoSuchConfigRuleInConformancePackException) Code() string { + return "NoSuchConfigRuleInConformancePackException" } -// The input for the GetResourceConfigHistory action. -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"` +// Message returns the exception's message. +func (s NoSuchConfigRuleInConformancePackException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The time stamp that indicates an earlier time. If not specified, the action - // returns paginated results that contain configuration items that start when - // the first configuration item was recorded. - EarlierTime *time.Time `locationName:"earlierTime" type:"timestamp"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoSuchConfigRuleInConformancePackException) OrigErr() error { + return nil +} - // The time stamp that indicates a later time. If not specified, current time - // is taken. - LaterTime *time.Time `locationName:"laterTime" type:"timestamp"` +func (s NoSuchConfigRuleInConformancePackException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The maximum number of configuration items returned on each page. The default - // is 10. You cannot specify a number greater than 100. If you specify 0, AWS - // Config uses the default. - Limit *int64 `locationName:"limit" type:"integer"` +// Status code returns the HTTP status code for the request's response error. +func (s NoSuchConfigRuleInConformancePackException) StatusCode() int { + return s.respMetadata.StatusCode +} - // 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"` +// RequestID returns the service's response RequestID for request. +func (s NoSuchConfigRuleInConformancePackException) RequestID() string { + return s.respMetadata.RequestID +} - // The ID of the resource (for example., sg-xxxxxx). - // - // ResourceId is a required field - ResourceId *string `locationName:"resourceId" min:"1" type:"string" required:"true"` +// You have specified a configuration aggregator that does not exist. +type NoSuchConfigurationAggregatorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The resource type. - // - // ResourceType is a required field - ResourceType *string `locationName:"resourceType" type:"string" required:"true" enum:"ResourceType"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetResourceConfigHistoryInput) String() string { +func (s NoSuchConfigurationAggregatorException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetResourceConfigHistoryInput) GoString() string { +func (s NoSuchConfigurationAggregatorException) 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.ResourceId != nil && len(*s.ResourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) - } - if s.ResourceType == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceType")) - } - - if invalidParams.Len() > 0 { - return invalidParams +func newErrorNoSuchConfigurationAggregatorException(v protocol.ResponseMetadata) error { + return &NoSuchConfigurationAggregatorException{ + respMetadata: v, } - 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 +// Code returns the exception type name. +func (s NoSuchConfigurationAggregatorException) Code() string { + return "NoSuchConfigurationAggregatorException" } -// SetLaterTime sets the LaterTime field's value. -func (s *GetResourceConfigHistoryInput) SetLaterTime(v time.Time) *GetResourceConfigHistoryInput { - s.LaterTime = &v - return s +// Message returns the exception's message. +func (s NoSuchConfigurationAggregatorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetLimit sets the Limit field's value. -func (s *GetResourceConfigHistoryInput) SetLimit(v int64) *GetResourceConfigHistoryInput { - s.Limit = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoSuchConfigurationAggregatorException) OrigErr() error { + return nil } -// SetNextToken sets the NextToken field's value. -func (s *GetResourceConfigHistoryInput) SetNextToken(v string) *GetResourceConfigHistoryInput { - s.NextToken = &v - return s +func (s NoSuchConfigurationAggregatorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetResourceId sets the ResourceId field's value. -func (s *GetResourceConfigHistoryInput) SetResourceId(v string) *GetResourceConfigHistoryInput { - s.ResourceId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s NoSuchConfigurationAggregatorException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetResourceType sets the ResourceType field's value. -func (s *GetResourceConfigHistoryInput) SetResourceType(v string) *GetResourceConfigHistoryInput { - s.ResourceType = &v - return s +// RequestID returns the service's response RequestID for request. +func (s NoSuchConfigurationAggregatorException) RequestID() string { + return s.respMetadata.RequestID } -// The output for the GetResourceConfigHistory action. -type GetResourceConfigHistoryOutput struct { - _ struct{} `type:"structure"` - - // A list that contains the configuration history of one or more resources. - ConfigurationItems []*ConfigurationItem `locationName:"configurationItems" type:"list"` +// You have specified a configuration recorder that does not exist. +type NoSuchConfigurationRecorderException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetResourceConfigHistoryOutput) String() string { +func (s NoSuchConfigurationRecorderException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetResourceConfigHistoryOutput) GoString() string { +func (s NoSuchConfigurationRecorderException) GoString() string { return s.String() } -// SetConfigurationItems sets the ConfigurationItems field's value. -func (s *GetResourceConfigHistoryOutput) SetConfigurationItems(v []*ConfigurationItem) *GetResourceConfigHistoryOutput { - s.ConfigurationItems = v - return s +func newErrorNoSuchConfigurationRecorderException(v protocol.ResponseMetadata) error { + return &NoSuchConfigurationRecorderException{ + respMetadata: v, + } } -// SetNextToken sets the NextToken field's value. -func (s *GetResourceConfigHistoryOutput) SetNextToken(v string) *GetResourceConfigHistoryOutput { - s.NextToken = &v - return s +// Code returns the exception type name. +func (s NoSuchConfigurationRecorderException) Code() string { + return "NoSuchConfigurationRecorderException" } -// The count of resources that are grouped by the group name. -type GroupedResourceCount struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s NoSuchConfigurationRecorderException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The name of the group that can be region, account ID, or resource type. For - // example, region1, region2 if the region was chosen as GroupByKey. - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoSuchConfigurationRecorderException) OrigErr() error { + return nil +} - // The number of resources in the group. - // - // ResourceCount is a required field - ResourceCount *int64 `type:"long" required:"true"` +func (s NoSuchConfigurationRecorderException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NoSuchConfigurationRecorderException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NoSuchConfigurationRecorderException) RequestID() string { + return s.respMetadata.RequestID +} + +// You specified one or more conformance packs that do not exist. +type NoSuchConformancePackException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GroupedResourceCount) String() string { +func (s NoSuchConformancePackException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GroupedResourceCount) GoString() string { +func (s NoSuchConformancePackException) GoString() string { return s.String() } -// SetGroupName sets the GroupName field's value. -func (s *GroupedResourceCount) SetGroupName(v string) *GroupedResourceCount { - s.GroupName = &v - return s +func newErrorNoSuchConformancePackException(v protocol.ResponseMetadata) error { + return &NoSuchConformancePackException{ + respMetadata: v, + } } -// SetResourceCount sets the ResourceCount field's value. -func (s *GroupedResourceCount) SetResourceCount(v int64) *GroupedResourceCount { - s.ResourceCount = &v - return s +// Code returns the exception type name. +func (s NoSuchConformancePackException) Code() string { + return "NoSuchConformancePackException" } -type ListAggregateDiscoveredResourcesInput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s NoSuchConformancePackException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The name of the configuration aggregator. - // - // ConfigurationAggregatorName is a required field - ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoSuchConformancePackException) OrigErr() error { + return nil +} - // Filters the results based on the ResourceFilters object. - Filters *ResourceFilters `type:"structure"` +func (s NoSuchConformancePackException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The maximum number of resource identifiers returned on each page. The default - // is 100. You cannot specify a number greater than 100. If you specify 0, AWS - // Config uses the default. - Limit *int64 `type:"integer"` +// Status code returns the HTTP status code for the request's response error. +func (s NoSuchConformancePackException) StatusCode() int { + return s.respMetadata.StatusCode +} - // 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"` +// RequestID returns the service's response RequestID for request. +func (s NoSuchConformancePackException) RequestID() string { + return s.respMetadata.RequestID +} - // The type of resources that you want AWS Config to list in the response. - // - // ResourceType is a required field - ResourceType *string `type:"string" required:"true" enum:"ResourceType"` +// You have specified a delivery channel that does not exist. +type NoSuchDeliveryChannelException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListAggregateDiscoveredResourcesInput) String() string { +func (s NoSuchDeliveryChannelException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListAggregateDiscoveredResourcesInput) GoString() string { +func (s NoSuchDeliveryChannelException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAggregateDiscoveredResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAggregateDiscoveredResourcesInput"} - if s.ConfigurationAggregatorName == nil { - invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) - } - if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) - } - if s.ResourceType == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceType")) - } - if s.Filters != nil { - if err := s.Filters.Validate(); err != nil { - invalidParams.AddNested("Filters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams +func newErrorNoSuchDeliveryChannelException(v protocol.ResponseMetadata) error { + return &NoSuchDeliveryChannelException{ + respMetadata: v, } - return nil } -// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. -func (s *ListAggregateDiscoveredResourcesInput) SetConfigurationAggregatorName(v string) *ListAggregateDiscoveredResourcesInput { - s.ConfigurationAggregatorName = &v - return s +// Code returns the exception type name. +func (s NoSuchDeliveryChannelException) Code() string { + return "NoSuchDeliveryChannelException" } -// SetFilters sets the Filters field's value. -func (s *ListAggregateDiscoveredResourcesInput) SetFilters(v *ResourceFilters) *ListAggregateDiscoveredResourcesInput { - s.Filters = v - return s +// Message returns the exception's message. +func (s NoSuchDeliveryChannelException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetLimit sets the Limit field's value. -func (s *ListAggregateDiscoveredResourcesInput) SetLimit(v int64) *ListAggregateDiscoveredResourcesInput { - s.Limit = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoSuchDeliveryChannelException) OrigErr() error { + return nil } -// SetNextToken sets the NextToken field's value. -func (s *ListAggregateDiscoveredResourcesInput) SetNextToken(v string) *ListAggregateDiscoveredResourcesInput { - s.NextToken = &v - return s +func (s NoSuchDeliveryChannelException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetResourceType sets the ResourceType field's value. -func (s *ListAggregateDiscoveredResourcesInput) SetResourceType(v string) *ListAggregateDiscoveredResourcesInput { - s.ResourceType = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s NoSuchDeliveryChannelException) StatusCode() int { + return s.respMetadata.StatusCode } -type ListAggregateDiscoveredResourcesOutput struct { - _ struct{} `type:"structure"` - - // 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"` +// RequestID returns the service's response RequestID for request. +func (s NoSuchDeliveryChannelException) RequestID() string { + return s.respMetadata.RequestID +} - // Returns a list of ResourceIdentifiers objects. - ResourceIdentifiers []*AggregateResourceIdentifier `type:"list"` +// You specified one or more organization config rules that do not exist. +type NoSuchOrganizationConfigRuleException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListAggregateDiscoveredResourcesOutput) String() string { +func (s NoSuchOrganizationConfigRuleException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListAggregateDiscoveredResourcesOutput) GoString() string { +func (s NoSuchOrganizationConfigRuleException) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListAggregateDiscoveredResourcesOutput) SetNextToken(v string) *ListAggregateDiscoveredResourcesOutput { - s.NextToken = &v - return s +func newErrorNoSuchOrganizationConfigRuleException(v protocol.ResponseMetadata) error { + return &NoSuchOrganizationConfigRuleException{ + respMetadata: v, + } } -// SetResourceIdentifiers sets the ResourceIdentifiers field's value. -func (s *ListAggregateDiscoveredResourcesOutput) SetResourceIdentifiers(v []*AggregateResourceIdentifier) *ListAggregateDiscoveredResourcesOutput { - s.ResourceIdentifiers = v - return s +// Code returns the exception type name. +func (s NoSuchOrganizationConfigRuleException) Code() string { + return "NoSuchOrganizationConfigRuleException" } -type ListDiscoveredResourcesInput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s NoSuchOrganizationConfigRuleException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Specifies whether AWS Config includes deleted resources in the results. By - // default, deleted resources are not included. - IncludeDeletedResources *bool `locationName:"includeDeletedResources" type:"boolean"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoSuchOrganizationConfigRuleException) OrigErr() error { + return nil +} - // The maximum number of resource identifiers returned on each page. The default - // is 100. You cannot specify a number greater than 100. If you specify 0, AWS - // Config uses the default. - Limit *int64 `locationName:"limit" type:"integer"` +func (s NoSuchOrganizationConfigRuleException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // 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"` +// Status code returns the HTTP status code for the request's response error. +func (s NoSuchOrganizationConfigRuleException) StatusCode() int { + return s.respMetadata.StatusCode +} - // 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"` +// RequestID returns the service's response RequestID for request. +func (s NoSuchOrganizationConfigRuleException) RequestID() string { + return s.respMetadata.RequestID +} - // 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"` +// AWS Config organization conformance pack that you passed in the filter does +// not exist. +// +// For DeleteOrganizationConformancePack, you tried to delete an organization +// conformance pack that does not exist. +type NoSuchOrganizationConformancePackException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListDiscoveredResourcesInput) String() string { +func (s NoSuchOrganizationConformancePackException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListDiscoveredResourcesInput) GoString() string { +func (s NoSuchOrganizationConformancePackException) 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 +func newErrorNoSuchOrganizationConformancePackException(v protocol.ResponseMetadata) error { + return &NoSuchOrganizationConformancePackException{ + respMetadata: v, } - return nil } -// SetIncludeDeletedResources sets the IncludeDeletedResources field's value. -func (s *ListDiscoveredResourcesInput) SetIncludeDeletedResources(v bool) *ListDiscoveredResourcesInput { - s.IncludeDeletedResources = &v - return s +// Code returns the exception type name. +func (s NoSuchOrganizationConformancePackException) Code() string { + return "NoSuchOrganizationConformancePackException" } -// SetLimit sets the Limit field's value. -func (s *ListDiscoveredResourcesInput) SetLimit(v int64) *ListDiscoveredResourcesInput { - s.Limit = &v - return s +// Message returns the exception's message. +func (s NoSuchOrganizationConformancePackException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetNextToken sets the NextToken field's value. -func (s *ListDiscoveredResourcesInput) SetNextToken(v string) *ListDiscoveredResourcesInput { - s.NextToken = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoSuchOrganizationConformancePackException) OrigErr() error { + return nil } -// SetResourceIds sets the ResourceIds field's value. -func (s *ListDiscoveredResourcesInput) SetResourceIds(v []*string) *ListDiscoveredResourcesInput { - s.ResourceIds = v - return s +func (s NoSuchOrganizationConformancePackException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetResourceName sets the ResourceName field's value. -func (s *ListDiscoveredResourcesInput) SetResourceName(v string) *ListDiscoveredResourcesInput { - s.ResourceName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s NoSuchOrganizationConformancePackException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetResourceType sets the ResourceType field's value. -func (s *ListDiscoveredResourcesInput) SetResourceType(v string) *ListDiscoveredResourcesInput { - s.ResourceType = &v - return s +// RequestID returns the service's response RequestID for request. +func (s NoSuchOrganizationConformancePackException) RequestID() string { + return s.respMetadata.RequestID } -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"` +// You specified an AWS Config rule without a remediation configuration. +type NoSuchRemediationConfigurationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListDiscoveredResourcesOutput) String() string { +func (s NoSuchRemediationConfigurationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListDiscoveredResourcesOutput) GoString() string { +func (s NoSuchRemediationConfigurationException) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListDiscoveredResourcesOutput) SetNextToken(v string) *ListDiscoveredResourcesOutput { - s.NextToken = &v - return s +func newErrorNoSuchRemediationConfigurationException(v protocol.ResponseMetadata) error { + return &NoSuchRemediationConfigurationException{ + respMetadata: v, + } } -// SetResourceIdentifiers sets the ResourceIdentifiers field's value. -func (s *ListDiscoveredResourcesOutput) SetResourceIdentifiers(v []*ResourceIdentifier) *ListDiscoveredResourcesOutput { - s.ResourceIdentifiers = v - return s +// Code returns the exception type name. +func (s NoSuchRemediationConfigurationException) Code() string { + return "NoSuchRemediationConfigurationException" } -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s NoSuchRemediationConfigurationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The maximum number of tags returned on each page. The limit maximum is 50. - // You cannot specify a number greater than 50. If you specify 0, AWS Config - // uses the default. - Limit *int64 `type:"integer"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoSuchRemediationConfigurationException) OrigErr() error { + return nil +} - // 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"` +func (s NoSuchRemediationConfigurationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The Amazon Resource Name (ARN) that identifies the resource for which to - // list the tags. Currently, the supported resources are ConfigRule, ConfigurationAggregator - // and AggregatorAuthorization. - // - // ResourceArn is a required field - ResourceArn *string `min:"1" type:"string" required:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s NoSuchRemediationConfigurationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NoSuchRemediationConfigurationException) RequestID() string { + return s.respMetadata.RequestID +} + +// You tried to delete a remediation exception that does not exist. +type NoSuchRemediationExceptionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListTagsForResourceInput) String() string { +func (s NoSuchRemediationExceptionException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsForResourceInput) GoString() string { +func (s NoSuchRemediationExceptionException) 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)) +func newErrorNoSuchRemediationExceptionException(v protocol.ResponseMetadata) error { + return &NoSuchRemediationExceptionException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s NoSuchRemediationExceptionException) Code() string { + return "NoSuchRemediationExceptionException" +} + +// Message returns the exception's message. +func (s NoSuchRemediationExceptionException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetLimit sets the Limit field's value. -func (s *ListTagsForResourceInput) SetLimit(v int64) *ListTagsForResourceInput { - s.Limit = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoSuchRemediationExceptionException) OrigErr() error { + return nil } -// SetNextToken sets the NextToken field's value. -func (s *ListTagsForResourceInput) SetNextToken(v string) *ListTagsForResourceInput { - s.NextToken = &v - return s +func (s NoSuchRemediationExceptionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s NoSuchRemediationExceptionException) StatusCode() int { + return s.respMetadata.StatusCode } -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s NoSuchRemediationExceptionException) RequestID() string { + return s.respMetadata.RequestID +} - // 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"` +// You have specified a retention configuration that does not exist. +type NoSuchRetentionConfigurationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The tags for the resource. - Tags []*Tag `min:"1" type:"list"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListTagsForResourceOutput) String() string { +func (s NoSuchRetentionConfigurationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsForResourceOutput) GoString() string { +func (s NoSuchRetentionConfigurationException) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListTagsForResourceOutput) SetNextToken(v string) *ListTagsForResourceOutput { - s.NextToken = &v - return s +func newErrorNoSuchRetentionConfigurationException(v protocol.ResponseMetadata) error { + return &NoSuchRetentionConfigurationException{ + respMetadata: v, + } } -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s +// Code returns the exception type name. +func (s NoSuchRetentionConfigurationException) Code() string { + return "NoSuchRetentionConfigurationException" } -// Organization config rule creation or deletion status in each member account. -// This includes the name of the rule, the status, error code and error message -// when the rule creation or deletion failed. -type MemberAccountStatus struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s NoSuchRetentionConfigurationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The 12-digit account ID of a member account. - // - // AccountId is a required field - AccountId *string `type:"string" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoSuchRetentionConfigurationException) OrigErr() error { + return nil +} - // The name of config rule deployed in the member account. - // - // ConfigRuleName is a required field - ConfigRuleName *string `min:"1" type:"string" required:"true"` +func (s NoSuchRetentionConfigurationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // An error code that is returned when config rule creation or deletion failed - // in the member account. - ErrorCode *string `type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s NoSuchRetentionConfigurationException) StatusCode() int { + return s.respMetadata.StatusCode +} - // An error message indicating that config rule account creation or deletion - // has failed due to an error in the member account. - ErrorMessage *string `type:"string"` +// RequestID returns the service's response RequestID for request. +func (s NoSuchRetentionConfigurationException) RequestID() string { + return s.respMetadata.RequestID +} - // The timestamp of the last status update. - LastUpdateTime *time.Time `type:"timestamp"` +// For PutConfigAggregator API, no permission to call EnableAWSServiceAccess +// API. +// +// For all OrganizationConfigRule and OrganizationConformancePack APIs, AWS +// Config throws an exception if APIs are called from member accounts. All APIs +// must be called from organization master account. +type OrganizationAccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Indicates deployment status for config rule in the member account. When master - // account calls PutOrganizationConfigRule action for the first time, config - // rule status is created in the member account. When master account calls PutOrganizationConfigRule - // action for the second time, config rule status is updated in the member account. - // Config rule status is deleted when the master account deletes OrganizationConfigRule - // and disables service access for config-multiaccountsetup.amazonaws.com. - // - // AWS Config sets the state of the rule to: - // - // * CREATE_SUCCESSFUL when config rule has been created in the member account. - // - // * CREATE_IN_PROGRESS when config rule is being created in the member account. - // - // * CREATE_FAILED when config rule creation has failed in the member account. - // - // * DELETE_FAILED when config rule deletion has failed in the member account. - // - // * DELETE_IN_PROGRESS when config rule is being deleted in the member account. - // - // * DELETE_SUCCESSFUL when config rule has been deleted in the member account. - // - // * UPDATE_SUCCESSFUL when config rule has been updated in the member account. - // - // * UPDATE_IN_PROGRESS when config rule is being updated in the member account. - // - // * UPDATE_FAILED when config rule deletion has failed in the member account. - // - // MemberAccountRuleStatus is a required field - MemberAccountRuleStatus *string `type:"string" required:"true" enum:"MemberAccountRuleStatus"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s MemberAccountStatus) String() string { +func (s OrganizationAccessDeniedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MemberAccountStatus) GoString() string { +func (s OrganizationAccessDeniedException) GoString() string { return s.String() } -// SetAccountId sets the AccountId field's value. -func (s *MemberAccountStatus) SetAccountId(v string) *MemberAccountStatus { - s.AccountId = &v - return s +func newErrorOrganizationAccessDeniedException(v protocol.ResponseMetadata) error { + return &OrganizationAccessDeniedException{ + respMetadata: v, + } } -// SetConfigRuleName sets the ConfigRuleName field's value. -func (s *MemberAccountStatus) SetConfigRuleName(v string) *MemberAccountStatus { - s.ConfigRuleName = &v - return s +// Code returns the exception type name. +func (s OrganizationAccessDeniedException) Code() string { + return "OrganizationAccessDeniedException" } -// SetErrorCode sets the ErrorCode field's value. -func (s *MemberAccountStatus) SetErrorCode(v string) *MemberAccountStatus { - s.ErrorCode = &v - return s +// Message returns the exception's message. +func (s OrganizationAccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetErrorMessage sets the ErrorMessage field's value. -func (s *MemberAccountStatus) SetErrorMessage(v string) *MemberAccountStatus { - s.ErrorMessage = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OrganizationAccessDeniedException) OrigErr() error { + return nil } -// SetLastUpdateTime sets the LastUpdateTime field's value. -func (s *MemberAccountStatus) SetLastUpdateTime(v time.Time) *MemberAccountStatus { - s.LastUpdateTime = &v - return s +func (s OrganizationAccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetMemberAccountRuleStatus sets the MemberAccountRuleStatus field's value. -func (s *MemberAccountStatus) SetMemberAccountRuleStatus(v string) *MemberAccountStatus { - s.MemberAccountRuleStatus = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s OrganizationAccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OrganizationAccessDeniedException) RequestID() string { + return s.respMetadata.RequestID } // This object contains regions to set up the aggregator and an IAM role to @@ -12886,6 +18472,63 @@ func (s *OrganizationAggregationSource) SetRoleArn(v string) *OrganizationAggreg return s } +// AWS Config resource cannot be created because your organization does not +// have all features enabled. +type OrganizationAllFeaturesNotEnabledException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s OrganizationAllFeaturesNotEnabledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationAllFeaturesNotEnabledException) GoString() string { + return s.String() +} + +func newErrorOrganizationAllFeaturesNotEnabledException(v protocol.ResponseMetadata) error { + return &OrganizationAllFeaturesNotEnabledException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OrganizationAllFeaturesNotEnabledException) Code() string { + return "OrganizationAllFeaturesNotEnabledException" +} + +// Message returns the exception's message. +func (s OrganizationAllFeaturesNotEnabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OrganizationAllFeaturesNotEnabledException) OrigErr() error { + return nil +} + +func (s OrganizationAllFeaturesNotEnabledException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OrganizationAllFeaturesNotEnabledException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OrganizationAllFeaturesNotEnabledException) RequestID() string { + return s.respMetadata.RequestID +} + // An organization config rule that has information about config rules that // AWS Config creates in member accounts. type OrganizationConfigRule struct { @@ -12897,7 +18540,7 @@ type OrganizationConfigRule struct { // The timestamp of the last update. LastUpdateTime *time.Time `type:"timestamp"` - // The Amazon Resource Name (ARN) of organization config rule. + // Amazon Resource Name (ARN) of organization config rule. // // OrganizationConfigRuleArn is a required field OrganizationConfigRuleArn *string `min:"1" type:"string" required:"true"` @@ -13029,34 +18672,395 @@ func (s OrganizationConfigRuleStatus) GoString() string { return s.String() } -// SetErrorCode sets the ErrorCode field's value. -func (s *OrganizationConfigRuleStatus) SetErrorCode(v string) *OrganizationConfigRuleStatus { - s.ErrorCode = &v - return s +// SetErrorCode sets the ErrorCode field's value. +func (s *OrganizationConfigRuleStatus) SetErrorCode(v string) *OrganizationConfigRuleStatus { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *OrganizationConfigRuleStatus) SetErrorMessage(v string) *OrganizationConfigRuleStatus { + s.ErrorMessage = &v + return s +} + +// SetLastUpdateTime sets the LastUpdateTime field's value. +func (s *OrganizationConfigRuleStatus) SetLastUpdateTime(v time.Time) *OrganizationConfigRuleStatus { + s.LastUpdateTime = &v + return s +} + +// SetOrganizationConfigRuleName sets the OrganizationConfigRuleName field's value. +func (s *OrganizationConfigRuleStatus) SetOrganizationConfigRuleName(v string) *OrganizationConfigRuleStatus { + s.OrganizationConfigRuleName = &v + return s +} + +// SetOrganizationRuleStatus sets the OrganizationRuleStatus field's value. +func (s *OrganizationConfigRuleStatus) SetOrganizationRuleStatus(v string) *OrganizationConfigRuleStatus { + s.OrganizationRuleStatus = &v + return s +} + +// An organization conformance pack that has information about conformance packs +// that AWS Config creates in member accounts. +type OrganizationConformancePack struct { + _ struct{} `type:"structure"` + + // A list of ConformancePackInputParameter objects. + ConformancePackInputParameters []*ConformancePackInputParameter `type:"list"` + + // Location of an Amazon S3 bucket where AWS Config can deliver evaluation results + // and conformance pack template that is used to create a pack. + // + // DeliveryS3Bucket is a required field + DeliveryS3Bucket *string `min:"3" type:"string" required:"true"` + + // Any folder structure you want to add to an Amazon S3 bucket. + DeliveryS3KeyPrefix *string `min:"1" type:"string"` + + // A comma-separated list of accounts excluded from organization conformance + // pack. + ExcludedAccounts []*string `type:"list"` + + // Last time when organization conformation pack was updated. + // + // LastUpdateTime is a required field + LastUpdateTime *time.Time `type:"timestamp" required:"true"` + + // Amazon Resource Name (ARN) of organization conformance pack. + // + // OrganizationConformancePackArn is a required field + OrganizationConformancePackArn *string `min:"1" type:"string" required:"true"` + + // The name you assign to an organization conformance pack. + // + // OrganizationConformancePackName is a required field + OrganizationConformancePackName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s OrganizationConformancePack) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationConformancePack) GoString() string { + return s.String() +} + +// SetConformancePackInputParameters sets the ConformancePackInputParameters field's value. +func (s *OrganizationConformancePack) SetConformancePackInputParameters(v []*ConformancePackInputParameter) *OrganizationConformancePack { + s.ConformancePackInputParameters = v + return s +} + +// SetDeliveryS3Bucket sets the DeliveryS3Bucket field's value. +func (s *OrganizationConformancePack) SetDeliveryS3Bucket(v string) *OrganizationConformancePack { + s.DeliveryS3Bucket = &v + return s +} + +// SetDeliveryS3KeyPrefix sets the DeliveryS3KeyPrefix field's value. +func (s *OrganizationConformancePack) SetDeliveryS3KeyPrefix(v string) *OrganizationConformancePack { + s.DeliveryS3KeyPrefix = &v + return s +} + +// SetExcludedAccounts sets the ExcludedAccounts field's value. +func (s *OrganizationConformancePack) SetExcludedAccounts(v []*string) *OrganizationConformancePack { + s.ExcludedAccounts = v + return s +} + +// SetLastUpdateTime sets the LastUpdateTime field's value. +func (s *OrganizationConformancePack) SetLastUpdateTime(v time.Time) *OrganizationConformancePack { + s.LastUpdateTime = &v + return s +} + +// SetOrganizationConformancePackArn sets the OrganizationConformancePackArn field's value. +func (s *OrganizationConformancePack) SetOrganizationConformancePackArn(v string) *OrganizationConformancePack { + s.OrganizationConformancePackArn = &v + return s +} + +// SetOrganizationConformancePackName sets the OrganizationConformancePackName field's value. +func (s *OrganizationConformancePack) SetOrganizationConformancePackName(v string) *OrganizationConformancePack { + s.OrganizationConformancePackName = &v + return s +} + +// Organization conformance pack creation or deletion status in each member +// account. This includes the name of the conformance pack, the status, error +// code and error message when the conformance pack creation or deletion failed. +type OrganizationConformancePackDetailedStatus struct { + _ struct{} `type:"structure"` + + // The 12-digit account ID of a member account. + // + // AccountId is a required field + AccountId *string `type:"string" required:"true"` + + // The name of conformance pack deployed in the member account. + // + // ConformancePackName is a required field + ConformancePackName *string `min:"1" type:"string" required:"true"` + + // An error code that is returned when conformance pack creation or deletion + // failed in the member account. + ErrorCode *string `type:"string"` + + // An error message indicating that conformance pack account creation or deletion + // has failed due to an error in the member account. + ErrorMessage *string `type:"string"` + + // The timestamp of the last status update. + LastUpdateTime *time.Time `type:"timestamp"` + + // Indicates deployment status for conformance pack in a member account. When + // master account calls PutOrganizationConformancePack action for the first + // time, conformance pack status is created in the member account. When master + // account calls PutOrganizationConformancePack action for the second time, + // conformance pack status is updated in the member account. Conformance pack + // status is deleted when the master account deletes OrganizationConformancePack + // and disables service access for config-multiaccountsetup.amazonaws.com. + // + // AWS Config sets the state of the conformance pack to: + // + // * CREATE_SUCCESSFUL when conformance pack has been created in the member + // account. + // + // * CREATE_IN_PROGRESS when conformance pack is being created in the member + // account. + // + // * CREATE_FAILED when conformance pack creation has failed in the member + // account. + // + // * DELETE_FAILED when conformance pack deletion has failed in the member + // account. + // + // * DELETE_IN_PROGRESS when conformance pack is being deleted in the member + // account. + // + // * DELETE_SUCCESSFUL when conformance pack has been deleted in the member + // account. + // + // * UPDATE_SUCCESSFUL when conformance pack has been updated in the member + // account. + // + // * UPDATE_IN_PROGRESS when conformance pack is being updated in the member + // account. + // + // * UPDATE_FAILED when conformance pack deletion has failed in the member + // account. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"OrganizationResourceDetailedStatus"` +} + +// String returns the string representation +func (s OrganizationConformancePackDetailedStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationConformancePackDetailedStatus) GoString() string { + return s.String() +} + +// SetAccountId sets the AccountId field's value. +func (s *OrganizationConformancePackDetailedStatus) SetAccountId(v string) *OrganizationConformancePackDetailedStatus { + s.AccountId = &v + return s +} + +// SetConformancePackName sets the ConformancePackName field's value. +func (s *OrganizationConformancePackDetailedStatus) SetConformancePackName(v string) *OrganizationConformancePackDetailedStatus { + s.ConformancePackName = &v + return s +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *OrganizationConformancePackDetailedStatus) SetErrorCode(v string) *OrganizationConformancePackDetailedStatus { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *OrganizationConformancePackDetailedStatus) SetErrorMessage(v string) *OrganizationConformancePackDetailedStatus { + s.ErrorMessage = &v + return s +} + +// SetLastUpdateTime sets the LastUpdateTime field's value. +func (s *OrganizationConformancePackDetailedStatus) SetLastUpdateTime(v time.Time) *OrganizationConformancePackDetailedStatus { + s.LastUpdateTime = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *OrganizationConformancePackDetailedStatus) SetStatus(v string) *OrganizationConformancePackDetailedStatus { + s.Status = &v + return s +} + +// Returns the status for an organization conformance pack in an organization. +type OrganizationConformancePackStatus struct { + _ struct{} `type:"structure"` + + // An error code that is returned when organization conformance pack creation + // or deletion has failed in a member account. + ErrorCode *string `type:"string"` + + // An error message indicating that organization conformance pack creation or + // deletion failed due to an error. + ErrorMessage *string `type:"string"` + + // The timestamp of the last update. + LastUpdateTime *time.Time `type:"timestamp"` + + // The name that you assign to organization conformance pack. + // + // OrganizationConformancePackName is a required field + OrganizationConformancePackName *string `min:"1" type:"string" required:"true"` + + // Indicates deployment status of an organization conformance pack. When master + // account calls PutOrganizationConformancePack for the first time, conformance + // pack status is created in all the member accounts. When master account calls + // PutOrganizationConformancePack for the second time, conformance pack status + // is updated in all the member accounts. Additionally, conformance pack status + // is updated when one or more member accounts join or leave an organization. + // Conformance pack status is deleted when the master account deletes OrganizationConformancePack + // in all the member accounts and disables service access for config-multiaccountsetup.amazonaws.com. + // + // AWS Config sets the state of the conformance pack to: + // + // * CREATE_SUCCESSFUL when an organization conformance pack has been successfully + // created in all the member accounts. + // + // * CREATE_IN_PROGRESS when an organization conformance pack creation is + // in progress. + // + // * CREATE_FAILED when an organization conformance pack creation failed + // in one or more member accounts within that organization. + // + // * DELETE_FAILED when an organization conformance pack deletion failed + // in one or more member accounts within that organization. + // + // * DELETE_IN_PROGRESS when an organization conformance pack deletion is + // in progress. + // + // * DELETE_SUCCESSFUL when an organization conformance pack has been successfully + // deleted from all the member accounts. + // + // * UPDATE_SUCCESSFUL when an organization conformance pack has been successfully + // updated in all the member accounts. + // + // * UPDATE_IN_PROGRESS when an organization conformance pack update is in + // progress. + // + // * UPDATE_FAILED when an organization conformance pack update failed in + // one or more member accounts within that organization. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"OrganizationResourceStatus"` +} + +// String returns the string representation +func (s OrganizationConformancePackStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationConformancePackStatus) GoString() string { + return s.String() +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *OrganizationConformancePackStatus) SetErrorCode(v string) *OrganizationConformancePackStatus { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *OrganizationConformancePackStatus) SetErrorMessage(v string) *OrganizationConformancePackStatus { + s.ErrorMessage = &v + return s +} + +// SetLastUpdateTime sets the LastUpdateTime field's value. +func (s *OrganizationConformancePackStatus) SetLastUpdateTime(v time.Time) *OrganizationConformancePackStatus { + s.LastUpdateTime = &v + return s +} + +// SetOrganizationConformancePackName sets the OrganizationConformancePackName field's value. +func (s *OrganizationConformancePackStatus) SetOrganizationConformancePackName(v string) *OrganizationConformancePackStatus { + s.OrganizationConformancePackName = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *OrganizationConformancePackStatus) SetStatus(v string) *OrganizationConformancePackStatus { + s.Status = &v + return s +} + +// You have specified a template that is not valid or supported. +type OrganizationConformancePackTemplateValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s OrganizationConformancePackTemplateValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationConformancePackTemplateValidationException) GoString() string { + return s.String() +} + +func newErrorOrganizationConformancePackTemplateValidationException(v protocol.ResponseMetadata) error { + return &OrganizationConformancePackTemplateValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OrganizationConformancePackTemplateValidationException) Code() string { + return "OrganizationConformancePackTemplateValidationException" +} + +// Message returns the exception's message. +func (s OrganizationConformancePackTemplateValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetErrorMessage sets the ErrorMessage field's value. -func (s *OrganizationConfigRuleStatus) SetErrorMessage(v string) *OrganizationConfigRuleStatus { - s.ErrorMessage = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OrganizationConformancePackTemplateValidationException) OrigErr() error { + return nil } -// SetLastUpdateTime sets the LastUpdateTime field's value. -func (s *OrganizationConfigRuleStatus) SetLastUpdateTime(v time.Time) *OrganizationConfigRuleStatus { - s.LastUpdateTime = &v - return s +func (s OrganizationConformancePackTemplateValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetOrganizationConfigRuleName sets the OrganizationConfigRuleName field's value. -func (s *OrganizationConfigRuleStatus) SetOrganizationConfigRuleName(v string) *OrganizationConfigRuleStatus { - s.OrganizationConfigRuleName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s OrganizationConformancePackTemplateValidationException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetOrganizationRuleStatus sets the OrganizationRuleStatus field's value. -func (s *OrganizationConfigRuleStatus) SetOrganizationRuleStatus(v string) *OrganizationConfigRuleStatus { - s.OrganizationRuleStatus = &v - return s +// RequestID returns the service's response RequestID for request. +func (s OrganizationConformancePackTemplateValidationException) RequestID() string { + return s.respMetadata.RequestID } // An object that specifies organization custom rule metadata such as resource @@ -13345,6 +19349,131 @@ func (s *OrganizationManagedRuleMetadata) SetTagValueScope(v string) *Organizati return s } +// Status filter object to filter results based on specific member account ID +// or status type for an organization conformance pack. +type OrganizationResourceDetailedStatusFilters struct { + _ struct{} `type:"structure"` + + // The 12-digit account ID of the member account within an organization. + AccountId *string `type:"string"` + + // Indicates deployment status for conformance pack in a member account. When + // master account calls PutOrganizationConformancePack action for the first + // time, conformance pack status is created in the member account. When master + // account calls PutOrganizationConformancePack action for the second time, + // conformance pack status is updated in the member account. Conformance pack + // status is deleted when the master account deletes OrganizationConformancePack + // and disables service access for config-multiaccountsetup.amazonaws.com. + // + // AWS Config sets the state of the conformance pack to: + // + // * CREATE_SUCCESSFUL when conformance pack has been created in the member + // account. + // + // * CREATE_IN_PROGRESS when conformance pack is being created in the member + // account. + // + // * CREATE_FAILED when conformance pack creation has failed in the member + // account. + // + // * DELETE_FAILED when conformance pack deletion has failed in the member + // account. + // + // * DELETE_IN_PROGRESS when conformance pack is being deleted in the member + // account. + // + // * DELETE_SUCCESSFUL when conformance pack has been deleted in the member + // account. + // + // * UPDATE_SUCCESSFUL when conformance pack has been updated in the member + // account. + // + // * UPDATE_IN_PROGRESS when conformance pack is being updated in the member + // account. + // + // * UPDATE_FAILED when conformance pack deletion has failed in the member + // account. + Status *string `type:"string" enum:"OrganizationResourceDetailedStatus"` +} + +// String returns the string representation +func (s OrganizationResourceDetailedStatusFilters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationResourceDetailedStatusFilters) GoString() string { + return s.String() +} + +// SetAccountId sets the AccountId field's value. +func (s *OrganizationResourceDetailedStatusFilters) SetAccountId(v string) *OrganizationResourceDetailedStatusFilters { + s.AccountId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *OrganizationResourceDetailedStatusFilters) SetStatus(v string) *OrganizationResourceDetailedStatusFilters { + s.Status = &v + return s +} + +// The configuration item size is outside the allowable range. +type OversizedConfigurationItemException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s OversizedConfigurationItemException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OversizedConfigurationItemException) GoString() string { + return s.String() +} + +func newErrorOversizedConfigurationItemException(v protocol.ResponseMetadata) error { + return &OversizedConfigurationItemException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OversizedConfigurationItemException) Code() string { + return "OversizedConfigurationItemException" +} + +// Message returns the exception's message. +func (s OversizedConfigurationItemException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OversizedConfigurationItemException) OrigErr() error { + return nil +} + +func (s OversizedConfigurationItemException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OversizedConfigurationItemException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OversizedConfigurationItemException) RequestID() string { + return s.respMetadata.RequestID +} + // An object that represents the account ID and region of an aggregator account // that is requesting authorization but is not yet authorized. type PendingAggregationRequest struct { @@ -13727,6 +19856,151 @@ func (s PutConfigurationRecorderOutput) GoString() string { return s.String() } +type PutConformancePackInput struct { + _ struct{} `type:"structure"` + + // A list of ConformancePackInputParameter objects. + ConformancePackInputParameters []*ConformancePackInputParameter `type:"list"` + + // Name of the conformance pack you want to create. + // + // ConformancePackName is a required field + ConformancePackName *string `min:"1" type:"string" required:"true"` + + // AWS Config stores intermediate files while processing conformance pack template. + // + // DeliveryS3Bucket is a required field + DeliveryS3Bucket *string `min:"3" type:"string" required:"true"` + + // The prefix for the Amazon S3 bucket. + DeliveryS3KeyPrefix *string `min:"1" type:"string"` + + // A string containing full conformance pack template body. Structure containing + // the template body with a minimum length of 1 byte and a maximum length of + // 51,200 bytes. + // + // You can only use a YAML template with one resource type, that is, config + // rule and a remediation action. + TemplateBody *string `min:"1" type:"string"` + + // Location of file containing the template body (s3://bucketname/prefix). The + // uri must point to the conformance pack template (max size: 300 KB) that is + // located in an Amazon S3 bucket in the same region as the conformance pack. + // + // You must have access to read Amazon S3 bucket. + TemplateS3Uri *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PutConformancePackInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutConformancePackInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutConformancePackInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutConformancePackInput"} + if s.ConformancePackName == nil { + invalidParams.Add(request.NewErrParamRequired("ConformancePackName")) + } + if s.ConformancePackName != nil && len(*s.ConformancePackName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConformancePackName", 1)) + } + if s.DeliveryS3Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("DeliveryS3Bucket")) + } + if s.DeliveryS3Bucket != nil && len(*s.DeliveryS3Bucket) < 3 { + invalidParams.Add(request.NewErrParamMinLen("DeliveryS3Bucket", 3)) + } + if s.DeliveryS3KeyPrefix != nil && len(*s.DeliveryS3KeyPrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DeliveryS3KeyPrefix", 1)) + } + if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) + } + if s.TemplateS3Uri != nil && len(*s.TemplateS3Uri) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateS3Uri", 1)) + } + if s.ConformancePackInputParameters != nil { + for i, v := range s.ConformancePackInputParameters { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ConformancePackInputParameters", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConformancePackInputParameters sets the ConformancePackInputParameters field's value. +func (s *PutConformancePackInput) SetConformancePackInputParameters(v []*ConformancePackInputParameter) *PutConformancePackInput { + s.ConformancePackInputParameters = v + return s +} + +// SetConformancePackName sets the ConformancePackName field's value. +func (s *PutConformancePackInput) SetConformancePackName(v string) *PutConformancePackInput { + s.ConformancePackName = &v + return s +} + +// SetDeliveryS3Bucket sets the DeliveryS3Bucket field's value. +func (s *PutConformancePackInput) SetDeliveryS3Bucket(v string) *PutConformancePackInput { + s.DeliveryS3Bucket = &v + return s +} + +// SetDeliveryS3KeyPrefix sets the DeliveryS3KeyPrefix field's value. +func (s *PutConformancePackInput) SetDeliveryS3KeyPrefix(v string) *PutConformancePackInput { + s.DeliveryS3KeyPrefix = &v + return s +} + +// SetTemplateBody sets the TemplateBody field's value. +func (s *PutConformancePackInput) SetTemplateBody(v string) *PutConformancePackInput { + s.TemplateBody = &v + return s +} + +// SetTemplateS3Uri sets the TemplateS3Uri field's value. +func (s *PutConformancePackInput) SetTemplateS3Uri(v string) *PutConformancePackInput { + s.TemplateS3Uri = &v + return s +} + +type PutConformancePackOutput struct { + _ struct{} `type:"structure"` + + // ARN of the conformance pack. + ConformancePackArn *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PutConformancePackOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutConformancePackOutput) GoString() string { + return s.String() +} + +// SetConformancePackArn sets the ConformancePackArn field's value. +func (s *PutConformancePackOutput) SetConformancePackArn(v string) *PutConformancePackOutput { + s.ConformancePackArn = &v + return s +} + // The input for the PutDeliveryChannel action. type PutDeliveryChannelInput struct { _ struct{} `type:"structure"` @@ -13922,14 +20196,152 @@ func (s *PutOrganizationConfigRuleInput) Validate() error { if s.OrganizationConfigRuleName != nil && len(*s.OrganizationConfigRuleName) < 1 { invalidParams.Add(request.NewErrParamMinLen("OrganizationConfigRuleName", 1)) } - if s.OrganizationCustomRuleMetadata != nil { - if err := s.OrganizationCustomRuleMetadata.Validate(); err != nil { - invalidParams.AddNested("OrganizationCustomRuleMetadata", err.(request.ErrInvalidParams)) - } + if s.OrganizationCustomRuleMetadata != nil { + if err := s.OrganizationCustomRuleMetadata.Validate(); err != nil { + invalidParams.AddNested("OrganizationCustomRuleMetadata", err.(request.ErrInvalidParams)) + } + } + if s.OrganizationManagedRuleMetadata != nil { + if err := s.OrganizationManagedRuleMetadata.Validate(); err != nil { + invalidParams.AddNested("OrganizationManagedRuleMetadata", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetExcludedAccounts sets the ExcludedAccounts field's value. +func (s *PutOrganizationConfigRuleInput) SetExcludedAccounts(v []*string) *PutOrganizationConfigRuleInput { + s.ExcludedAccounts = v + return s +} + +// SetOrganizationConfigRuleName sets the OrganizationConfigRuleName field's value. +func (s *PutOrganizationConfigRuleInput) SetOrganizationConfigRuleName(v string) *PutOrganizationConfigRuleInput { + s.OrganizationConfigRuleName = &v + return s +} + +// SetOrganizationCustomRuleMetadata sets the OrganizationCustomRuleMetadata field's value. +func (s *PutOrganizationConfigRuleInput) SetOrganizationCustomRuleMetadata(v *OrganizationCustomRuleMetadata) *PutOrganizationConfigRuleInput { + s.OrganizationCustomRuleMetadata = v + return s +} + +// SetOrganizationManagedRuleMetadata sets the OrganizationManagedRuleMetadata field's value. +func (s *PutOrganizationConfigRuleInput) SetOrganizationManagedRuleMetadata(v *OrganizationManagedRuleMetadata) *PutOrganizationConfigRuleInput { + s.OrganizationManagedRuleMetadata = v + return s +} + +type PutOrganizationConfigRuleOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of an organization config rule. + OrganizationConfigRuleArn *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PutOrganizationConfigRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutOrganizationConfigRuleOutput) GoString() string { + return s.String() +} + +// SetOrganizationConfigRuleArn sets the OrganizationConfigRuleArn field's value. +func (s *PutOrganizationConfigRuleOutput) SetOrganizationConfigRuleArn(v string) *PutOrganizationConfigRuleOutput { + s.OrganizationConfigRuleArn = &v + return s +} + +type PutOrganizationConformancePackInput struct { + _ struct{} `type:"structure"` + + // A list of ConformancePackInputParameter objects. + ConformancePackInputParameters []*ConformancePackInputParameter `type:"list"` + + // Location of an Amazon S3 bucket where AWS Config can deliver evaluation results. + // AWS Config stores intermediate files while processing conformance pack template. + // + // The delivery bucket name should start with awsconfigconforms. For example: + // "Resource": "arn:aws:s3:::your_bucket_name/*". For more information, see + // Permissions for cross account bucket access (https://docs.aws.amazon.com/config/latest/developerguide/conformance-pack-organization-apis.html). + // + // DeliveryS3Bucket is a required field + DeliveryS3Bucket *string `min:"3" type:"string" required:"true"` + + // The prefix for the Amazon S3 bucket. + DeliveryS3KeyPrefix *string `min:"1" type:"string"` + + // A list of AWS accounts to be excluded from an organization conformance pack + // while deploying a conformance pack. + ExcludedAccounts []*string `type:"list"` + + // Name of the organization conformance pack you want to create. + // + // OrganizationConformancePackName is a required field + OrganizationConformancePackName *string `min:"1" type:"string" required:"true"` + + // A string containing full conformance pack template body. Structure containing + // the template body with a minimum length of 1 byte and a maximum length of + // 51,200 bytes. + TemplateBody *string `min:"1" type:"string"` + + // Location of file containing the template body. The uri must point to the + // conformance pack template (max size: 300 KB). + // + // You must have access to read Amazon S3 bucket. + TemplateS3Uri *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s PutOrganizationConformancePackInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutOrganizationConformancePackInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutOrganizationConformancePackInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutOrganizationConformancePackInput"} + if s.DeliveryS3Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("DeliveryS3Bucket")) + } + if s.DeliveryS3Bucket != nil && len(*s.DeliveryS3Bucket) < 3 { + invalidParams.Add(request.NewErrParamMinLen("DeliveryS3Bucket", 3)) + } + if s.DeliveryS3KeyPrefix != nil && len(*s.DeliveryS3KeyPrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DeliveryS3KeyPrefix", 1)) + } + if s.OrganizationConformancePackName == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationConformancePackName")) + } + if s.OrganizationConformancePackName != nil && len(*s.OrganizationConformancePackName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OrganizationConformancePackName", 1)) + } + if s.TemplateBody != nil && len(*s.TemplateBody) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateBody", 1)) + } + if s.TemplateS3Uri != nil && len(*s.TemplateS3Uri) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateS3Uri", 1)) } - if s.OrganizationManagedRuleMetadata != nil { - if err := s.OrganizationManagedRuleMetadata.Validate(); err != nil { - invalidParams.AddNested("OrganizationManagedRuleMetadata", err.(request.ErrInvalidParams)) + if s.ConformancePackInputParameters != nil { + for i, v := range s.ConformancePackInputParameters { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ConformancePackInputParameters", i), err.(request.ErrInvalidParams)) + } } } @@ -13939,50 +20351,68 @@ func (s *PutOrganizationConfigRuleInput) Validate() error { return nil } +// SetConformancePackInputParameters sets the ConformancePackInputParameters field's value. +func (s *PutOrganizationConformancePackInput) SetConformancePackInputParameters(v []*ConformancePackInputParameter) *PutOrganizationConformancePackInput { + s.ConformancePackInputParameters = v + return s +} + +// SetDeliveryS3Bucket sets the DeliveryS3Bucket field's value. +func (s *PutOrganizationConformancePackInput) SetDeliveryS3Bucket(v string) *PutOrganizationConformancePackInput { + s.DeliveryS3Bucket = &v + return s +} + +// SetDeliveryS3KeyPrefix sets the DeliveryS3KeyPrefix field's value. +func (s *PutOrganizationConformancePackInput) SetDeliveryS3KeyPrefix(v string) *PutOrganizationConformancePackInput { + s.DeliveryS3KeyPrefix = &v + return s +} + // SetExcludedAccounts sets the ExcludedAccounts field's value. -func (s *PutOrganizationConfigRuleInput) SetExcludedAccounts(v []*string) *PutOrganizationConfigRuleInput { +func (s *PutOrganizationConformancePackInput) SetExcludedAccounts(v []*string) *PutOrganizationConformancePackInput { s.ExcludedAccounts = v return s } -// SetOrganizationConfigRuleName sets the OrganizationConfigRuleName field's value. -func (s *PutOrganizationConfigRuleInput) SetOrganizationConfigRuleName(v string) *PutOrganizationConfigRuleInput { - s.OrganizationConfigRuleName = &v +// SetOrganizationConformancePackName sets the OrganizationConformancePackName field's value. +func (s *PutOrganizationConformancePackInput) SetOrganizationConformancePackName(v string) *PutOrganizationConformancePackInput { + s.OrganizationConformancePackName = &v return s } -// SetOrganizationCustomRuleMetadata sets the OrganizationCustomRuleMetadata field's value. -func (s *PutOrganizationConfigRuleInput) SetOrganizationCustomRuleMetadata(v *OrganizationCustomRuleMetadata) *PutOrganizationConfigRuleInput { - s.OrganizationCustomRuleMetadata = v +// SetTemplateBody sets the TemplateBody field's value. +func (s *PutOrganizationConformancePackInput) SetTemplateBody(v string) *PutOrganizationConformancePackInput { + s.TemplateBody = &v return s } -// SetOrganizationManagedRuleMetadata sets the OrganizationManagedRuleMetadata field's value. -func (s *PutOrganizationConfigRuleInput) SetOrganizationManagedRuleMetadata(v *OrganizationManagedRuleMetadata) *PutOrganizationConfigRuleInput { - s.OrganizationManagedRuleMetadata = v +// SetTemplateS3Uri sets the TemplateS3Uri field's value. +func (s *PutOrganizationConformancePackInput) SetTemplateS3Uri(v string) *PutOrganizationConformancePackInput { + s.TemplateS3Uri = &v return s } -type PutOrganizationConfigRuleOutput struct { +type PutOrganizationConformancePackOutput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of an organization config rule. - OrganizationConfigRuleArn *string `min:"1" type:"string"` + // ARN of the organization conformance pack. + OrganizationConformancePackArn *string `min:"1" type:"string"` } // String returns the string representation -func (s PutOrganizationConfigRuleOutput) String() string { +func (s PutOrganizationConformancePackOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutOrganizationConfigRuleOutput) GoString() string { +func (s PutOrganizationConformancePackOutput) GoString() string { return s.String() } -// SetOrganizationConfigRuleArn sets the OrganizationConfigRuleArn field's value. -func (s *PutOrganizationConfigRuleOutput) SetOrganizationConfigRuleArn(v string) *PutOrganizationConfigRuleOutput { - s.OrganizationConfigRuleArn = &v +// SetOrganizationConformancePackArn sets the OrganizationConformancePackArn field's value. +func (s *PutOrganizationConformancePackOutput) SetOrganizationConformancePackArn(v string) *PutOrganizationConformancePackOutput { + s.OrganizationConformancePackArn = &v return s } @@ -14173,6 +20603,135 @@ func (s *PutRemediationExceptionsOutput) SetFailedBatches(v []*FailedRemediation return s } +type PutResourceConfigInput struct { + _ struct{} `type:"structure"` + + // The configuration object of the resource in valid JSON format. It must match + // the schema registered with AWS CloudFormation. + // + // The configuration JSON must not exceed 64 KB. + // + // Configuration is a required field + Configuration *string `type:"string" required:"true"` + + // Unique identifier of the resource. + // + // ResourceId is a required field + ResourceId *string `min:"1" type:"string" required:"true"` + + // Name of the resource. + ResourceName *string `type:"string"` + + // The type of the resource. The custom resource type must be registered with + // AWS CloudFormation. + // + // You cannot use the organization names “aws”, “amzn”, “amazon”, + // “alexa”, “custom” with custom resource types. It is the first part + // of the ResourceType up to the first ::. + // + // ResourceType is a required field + ResourceType *string `min:"1" type:"string" required:"true"` + + // Version of the schema registered for the ResourceType in AWS CloudFormation. + // + // SchemaVersionId is a required field + SchemaVersionId *string `min:"1" type:"string" required:"true"` + + // Tags associated with the resource. + Tags map[string]*string `type:"map"` +} + +// String returns the string representation +func (s PutResourceConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutResourceConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutResourceConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutResourceConfigInput"} + if s.Configuration == nil { + invalidParams.Add(request.NewErrParamRequired("Configuration")) + } + 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 s.SchemaVersionId == nil { + invalidParams.Add(request.NewErrParamRequired("SchemaVersionId")) + } + if s.SchemaVersionId != nil && len(*s.SchemaVersionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SchemaVersionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConfiguration sets the Configuration field's value. +func (s *PutResourceConfigInput) SetConfiguration(v string) *PutResourceConfigInput { + s.Configuration = &v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *PutResourceConfigInput) SetResourceId(v string) *PutResourceConfigInput { + s.ResourceId = &v + return s +} + +// SetResourceName sets the ResourceName field's value. +func (s *PutResourceConfigInput) SetResourceName(v string) *PutResourceConfigInput { + s.ResourceName = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *PutResourceConfigInput) SetResourceType(v string) *PutResourceConfigInput { + s.ResourceType = &v + return s +} + +// SetSchemaVersionId sets the SchemaVersionId field's value. +func (s *PutResourceConfigInput) SetSchemaVersionId(v string) *PutResourceConfigInput { + s.SchemaVersionId = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *PutResourceConfigInput) SetTags(v map[string]*string) *PutResourceConfigInput { + s.Tags = v + return s +} + +type PutResourceConfigOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutResourceConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutResourceConfigOutput) GoString() string { + return s.String() +} + type PutRetentionConfigurationInput struct { _ struct{} `type:"structure"` @@ -14847,6 +21406,63 @@ func (s *RemediationExecutionStep) SetStopTime(v time.Time) *RemediationExecutio return s } +// Remediation action is in progress. You can either cancel execution in AWS +// Systems Manager or wait and try again later. +type RemediationInProgressException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RemediationInProgressException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RemediationInProgressException) GoString() string { + return s.String() +} + +func newErrorRemediationInProgressException(v protocol.ResponseMetadata) error { + return &RemediationInProgressException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RemediationInProgressException) Code() string { + return "RemediationInProgressException" +} + +// Message returns the exception's message. +func (s RemediationInProgressException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RemediationInProgressException) OrigErr() error { + return nil +} + +func (s RemediationInProgressException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RemediationInProgressException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RemediationInProgressException) RequestID() string { + return s.respMetadata.RequestID +} + // The value is either a dynamic (resource) value or a static value. You must // select either a dynamic value or a static value. type RemediationParameterValue struct { @@ -15109,6 +21725,86 @@ func (s *ResourceIdentifier) SetResourceType(v string) *ResourceIdentifier { return s } +// You see this exception in the following cases: +// +// * For DeleteConfigRule, AWS Config is deleting this rule. Try your request +// again later. +// +// * For DeleteConfigRule, the rule is deleting your evaluation results. +// Try your request again later. +// +// * For DeleteConfigRule, a remediation action is associated with the rule +// and AWS Config cannot delete this rule. Delete the remediation action +// associated with the rule before deleting the rule and try your request +// again later. +// +// * For PutConfigOrganizationRule, organization config rule deletion is +// in progress. Try your request again later. +// +// * For DeleteOrganizationConfigRule, organization config rule creation +// is in progress. Try your request again later. +// +// * For PutConformancePack and PutOrganizationConformancePack, a conformance +// pack creation, update, and deletion is in progress. Try your request again +// later. +// +// * For DeleteConformancePack, a conformance pack creation, update, and +// deletion is in progress. Try your request again later. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + // The details that identify a resource within AWS Config, including the resource // type and resource ID. type ResourceKey struct { @@ -15154,16 +21850,128 @@ func (s *ResourceKey) Validate() error { return nil } -// SetResourceId sets the ResourceId field's value. -func (s *ResourceKey) SetResourceId(v string) *ResourceKey { - s.ResourceId = &v - return s +// SetResourceId sets the ResourceId field's value. +func (s *ResourceKey) SetResourceId(v string) *ResourceKey { + s.ResourceId = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ResourceKey) SetResourceType(v string) *ResourceKey { + s.ResourceType = &v + return s +} + +// You have specified a resource that is either unknown or has not been discovered. +type ResourceNotDiscoveredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotDiscoveredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotDiscoveredException) GoString() string { + return s.String() +} + +func newErrorResourceNotDiscoveredException(v protocol.ResponseMetadata) error { + return &ResourceNotDiscoveredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotDiscoveredException) Code() string { + return "ResourceNotDiscoveredException" +} + +// Message returns the exception's message. +func (s ResourceNotDiscoveredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotDiscoveredException) OrigErr() error { + return nil +} + +func (s ResourceNotDiscoveredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotDiscoveredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotDiscoveredException) RequestID() string { + return s.respMetadata.RequestID +} + +// You have specified a resource that does not exist. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetResourceType sets the ResourceType field's value. -func (s *ResourceKey) SetResourceType(v string) *ResourceKey { - s.ResourceType = &v - return s +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID } // The dynamic value of the resource. @@ -15328,6 +22136,133 @@ func (s *Scope) SetTagValue(v string) *Scope { return s } +type SelectAggregateResourceConfigInput struct { + _ struct{} `type:"structure"` + + // The name of the configuration aggregator. + // + // ConfigurationAggregatorName is a required field + ConfigurationAggregatorName *string `min:"1" type:"string" required:"true"` + + // The SQL query SELECT command. + // + // Expression is a required field + Expression *string `min:"1" type:"string" required:"true"` + + // The maximum number of query results returned on each page. + Limit *int64 `type:"integer"` + + MaxResults *int64 `type:"integer"` + + // The nextToken string returned in a previous request that you use to request + // the next page of results in a paginated response. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s SelectAggregateResourceConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SelectAggregateResourceConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SelectAggregateResourceConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SelectAggregateResourceConfigInput"} + if s.ConfigurationAggregatorName == nil { + invalidParams.Add(request.NewErrParamRequired("ConfigurationAggregatorName")) + } + if s.ConfigurationAggregatorName != nil && len(*s.ConfigurationAggregatorName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigurationAggregatorName", 1)) + } + if s.Expression == nil { + invalidParams.Add(request.NewErrParamRequired("Expression")) + } + if s.Expression != nil && len(*s.Expression) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Expression", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConfigurationAggregatorName sets the ConfigurationAggregatorName field's value. +func (s *SelectAggregateResourceConfigInput) SetConfigurationAggregatorName(v string) *SelectAggregateResourceConfigInput { + s.ConfigurationAggregatorName = &v + return s +} + +// SetExpression sets the Expression field's value. +func (s *SelectAggregateResourceConfigInput) SetExpression(v string) *SelectAggregateResourceConfigInput { + s.Expression = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *SelectAggregateResourceConfigInput) SetLimit(v int64) *SelectAggregateResourceConfigInput { + s.Limit = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *SelectAggregateResourceConfigInput) SetMaxResults(v int64) *SelectAggregateResourceConfigInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *SelectAggregateResourceConfigInput) SetNextToken(v string) *SelectAggregateResourceConfigInput { + s.NextToken = &v + return s +} + +type SelectAggregateResourceConfigOutput struct { + _ struct{} `type:"structure"` + + // The nextToken string returned in a previous request that you use to request + // the next page of results in a paginated response. + NextToken *string `type:"string"` + + // Details about the query. + QueryInfo *QueryInfo `type:"structure"` + + // Returns the results for the SQL query. + Results []*string `type:"list"` +} + +// String returns the string representation +func (s SelectAggregateResourceConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SelectAggregateResourceConfigOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *SelectAggregateResourceConfigOutput) SetNextToken(v string) *SelectAggregateResourceConfigOutput { + s.NextToken = &v + return s +} + +// SetQueryInfo sets the QueryInfo field's value. +func (s *SelectAggregateResourceConfigOutput) SetQueryInfo(v *QueryInfo) *SelectAggregateResourceConfigOutput { + s.QueryInfo = v + return s +} + +// SetResults sets the Results field's value. +func (s *SelectAggregateResourceConfigOutput) SetResults(v []*string) *SelectAggregateResourceConfigOutput { + s.Results = v + return s +} + type SelectResourceConfigInput struct { _ struct{} `type:"structure"` @@ -16136,6 +23071,63 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// You have reached the limit of the number of tags you can use. You have more +// than 50 tags. +type TooManyTagsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyTagsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyTagsException) GoString() string { + return s.String() +} + +func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { + return &TooManyTagsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyTagsException) Code() string { + return "TooManyTagsException" +} + +// Message returns the exception's message. +func (s TooManyTagsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTagsException) OrigErr() error { + return nil +} + +func (s TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTagsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyTagsException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -16210,6 +23202,62 @@ func (s UntagResourceOutput) GoString() string { return s.String() } +// The requested action is not valid. +type ValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationException) GoString() string { + return s.String() +} + +func newErrorValidationException(v protocol.ResponseMetadata) error { + return &ValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ValidationException) Code() string { + return "ValidationException" +} + +// Message returns the exception's message. +func (s ValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ValidationException) OrigErr() error { + return nil +} + +func (s ValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ValidationException) RequestID() string { + return s.respMetadata.RequestID +} + const ( // AggregatedSourceStatusTypeFailed is a AggregatedSourceStatusType enum value AggregatedSourceStatusTypeFailed = "FAILED" @@ -16290,6 +23338,31 @@ const ( ConfigurationItemStatusResourceDeletedNotRecorded = "ResourceDeletedNotRecorded" ) +const ( + // ConformancePackComplianceTypeCompliant is a ConformancePackComplianceType enum value + ConformancePackComplianceTypeCompliant = "COMPLIANT" + + // ConformancePackComplianceTypeNonCompliant is a ConformancePackComplianceType enum value + ConformancePackComplianceTypeNonCompliant = "NON_COMPLIANT" +) + +const ( + // ConformancePackStateCreateInProgress is a ConformancePackState enum value + ConformancePackStateCreateInProgress = "CREATE_IN_PROGRESS" + + // ConformancePackStateCreateComplete is a ConformancePackState enum value + ConformancePackStateCreateComplete = "CREATE_COMPLETE" + + // ConformancePackStateCreateFailed is a ConformancePackState enum value + ConformancePackStateCreateFailed = "CREATE_FAILED" + + // ConformancePackStateDeleteInProgress is a ConformancePackState enum value + ConformancePackStateDeleteInProgress = "DELETE_IN_PROGRESS" + + // ConformancePackStateDeleteFailed is a ConformancePackState enum value + ConformancePackStateDeleteFailed = "DELETE_FAILED" +) + const ( // DeliveryStatusSuccess is a DeliveryStatus enum value DeliveryStatusSuccess = "Success" @@ -16333,15 +23406,6 @@ const ( // MemberAccountRuleStatusCreateFailed is a MemberAccountRuleStatus enum value MemberAccountRuleStatusCreateFailed = "CREATE_FAILED" - // MemberAccountRuleStatusUpdateSuccessful is a MemberAccountRuleStatus enum value - MemberAccountRuleStatusUpdateSuccessful = "UPDATE_SUCCESSFUL" - - // MemberAccountRuleStatusUpdateFailed is a MemberAccountRuleStatus enum value - MemberAccountRuleStatusUpdateFailed = "UPDATE_FAILED" - - // MemberAccountRuleStatusUpdateInProgress is a MemberAccountRuleStatus enum value - MemberAccountRuleStatusUpdateInProgress = "UPDATE_IN_PROGRESS" - // MemberAccountRuleStatusDeleteSuccessful is a MemberAccountRuleStatus enum value MemberAccountRuleStatusDeleteSuccessful = "DELETE_SUCCESSFUL" @@ -16350,6 +23414,15 @@ const ( // MemberAccountRuleStatusDeleteInProgress is a MemberAccountRuleStatus enum value MemberAccountRuleStatusDeleteInProgress = "DELETE_IN_PROGRESS" + + // MemberAccountRuleStatusUpdateSuccessful is a MemberAccountRuleStatus enum value + MemberAccountRuleStatusUpdateSuccessful = "UPDATE_SUCCESSFUL" + + // MemberAccountRuleStatusUpdateInProgress is a MemberAccountRuleStatus enum value + MemberAccountRuleStatusUpdateInProgress = "UPDATE_IN_PROGRESS" + + // MemberAccountRuleStatusUpdateFailed is a MemberAccountRuleStatus enum value + MemberAccountRuleStatusUpdateFailed = "UPDATE_FAILED" ) const ( @@ -16377,6 +23450,64 @@ const ( OrganizationConfigRuleTriggerTypeScheduledNotification = "ScheduledNotification" ) +const ( + // OrganizationResourceDetailedStatusCreateSuccessful is a OrganizationResourceDetailedStatus enum value + OrganizationResourceDetailedStatusCreateSuccessful = "CREATE_SUCCESSFUL" + + // OrganizationResourceDetailedStatusCreateInProgress is a OrganizationResourceDetailedStatus enum value + OrganizationResourceDetailedStatusCreateInProgress = "CREATE_IN_PROGRESS" + + // OrganizationResourceDetailedStatusCreateFailed is a OrganizationResourceDetailedStatus enum value + OrganizationResourceDetailedStatusCreateFailed = "CREATE_FAILED" + + // OrganizationResourceDetailedStatusDeleteSuccessful is a OrganizationResourceDetailedStatus enum value + OrganizationResourceDetailedStatusDeleteSuccessful = "DELETE_SUCCESSFUL" + + // OrganizationResourceDetailedStatusDeleteFailed is a OrganizationResourceDetailedStatus enum value + OrganizationResourceDetailedStatusDeleteFailed = "DELETE_FAILED" + + // OrganizationResourceDetailedStatusDeleteInProgress is a OrganizationResourceDetailedStatus enum value + OrganizationResourceDetailedStatusDeleteInProgress = "DELETE_IN_PROGRESS" + + // OrganizationResourceDetailedStatusUpdateSuccessful is a OrganizationResourceDetailedStatus enum value + OrganizationResourceDetailedStatusUpdateSuccessful = "UPDATE_SUCCESSFUL" + + // OrganizationResourceDetailedStatusUpdateInProgress is a OrganizationResourceDetailedStatus enum value + OrganizationResourceDetailedStatusUpdateInProgress = "UPDATE_IN_PROGRESS" + + // OrganizationResourceDetailedStatusUpdateFailed is a OrganizationResourceDetailedStatus enum value + OrganizationResourceDetailedStatusUpdateFailed = "UPDATE_FAILED" +) + +const ( + // OrganizationResourceStatusCreateSuccessful is a OrganizationResourceStatus enum value + OrganizationResourceStatusCreateSuccessful = "CREATE_SUCCESSFUL" + + // OrganizationResourceStatusCreateInProgress is a OrganizationResourceStatus enum value + OrganizationResourceStatusCreateInProgress = "CREATE_IN_PROGRESS" + + // OrganizationResourceStatusCreateFailed is a OrganizationResourceStatus enum value + OrganizationResourceStatusCreateFailed = "CREATE_FAILED" + + // OrganizationResourceStatusDeleteSuccessful is a OrganizationResourceStatus enum value + OrganizationResourceStatusDeleteSuccessful = "DELETE_SUCCESSFUL" + + // OrganizationResourceStatusDeleteFailed is a OrganizationResourceStatus enum value + OrganizationResourceStatusDeleteFailed = "DELETE_FAILED" + + // OrganizationResourceStatusDeleteInProgress is a OrganizationResourceStatus enum value + OrganizationResourceStatusDeleteInProgress = "DELETE_IN_PROGRESS" + + // OrganizationResourceStatusUpdateSuccessful is a OrganizationResourceStatus enum value + OrganizationResourceStatusUpdateSuccessful = "UPDATE_SUCCESSFUL" + + // OrganizationResourceStatusUpdateInProgress is a OrganizationResourceStatus enum value + OrganizationResourceStatusUpdateInProgress = "UPDATE_IN_PROGRESS" + + // OrganizationResourceStatusUpdateFailed is a OrganizationResourceStatus enum value + OrganizationResourceStatusUpdateFailed = "UPDATE_FAILED" +) + const ( // OrganizationRuleStatusCreateSuccessful is a OrganizationRuleStatus enum value OrganizationRuleStatusCreateSuccessful = "CREATE_SUCCESSFUL" @@ -16387,15 +23518,6 @@ const ( // OrganizationRuleStatusCreateFailed is a OrganizationRuleStatus enum value OrganizationRuleStatusCreateFailed = "CREATE_FAILED" - // OrganizationRuleStatusUpdateSuccessful is a OrganizationRuleStatus enum value - OrganizationRuleStatusUpdateSuccessful = "UPDATE_SUCCESSFUL" - - // OrganizationRuleStatusUpdateFailed is a OrganizationRuleStatus enum value - OrganizationRuleStatusUpdateFailed = "UPDATE_FAILED" - - // OrganizationRuleStatusUpdateInProgress is a OrganizationRuleStatus enum value - OrganizationRuleStatusUpdateInProgress = "UPDATE_IN_PROGRESS" - // OrganizationRuleStatusDeleteSuccessful is a OrganizationRuleStatus enum value OrganizationRuleStatusDeleteSuccessful = "DELETE_SUCCESSFUL" @@ -16404,6 +23526,15 @@ const ( // OrganizationRuleStatusDeleteInProgress is a OrganizationRuleStatus enum value OrganizationRuleStatusDeleteInProgress = "DELETE_IN_PROGRESS" + + // OrganizationRuleStatusUpdateSuccessful is a OrganizationRuleStatus enum value + OrganizationRuleStatusUpdateSuccessful = "UPDATE_SUCCESSFUL" + + // OrganizationRuleStatusUpdateInProgress is a OrganizationRuleStatus enum value + OrganizationRuleStatusUpdateInProgress = "UPDATE_IN_PROGRESS" + + // OrganizationRuleStatusUpdateFailed is a OrganizationRuleStatus enum value + OrganizationRuleStatusUpdateFailed = "UPDATE_FAILED" ) const ( @@ -16533,6 +23664,9 @@ const ( // ResourceTypeAwsEc2VpcpeeringConnection is a ResourceType enum value ResourceTypeAwsEc2VpcpeeringConnection = "AWS::EC2::VPCPeeringConnection" + // ResourceTypeAwsElasticsearchDomain is a ResourceType enum value + ResourceTypeAwsElasticsearchDomain = "AWS::Elasticsearch::Domain" + // ResourceTypeAwsIamGroup is a ResourceType enum value ResourceTypeAwsIamGroup = "AWS::IAM::Group" @@ -16554,12 +23688,6 @@ const ( // ResourceTypeAwsRdsDbinstance is a ResourceType enum value ResourceTypeAwsRdsDbinstance = "AWS::RDS::DBInstance" - // ResourceTypeAwsRdsDbparameterGroup is a ResourceType enum value - ResourceTypeAwsRdsDbparameterGroup = "AWS::RDS::DBParameterGroup" - - // ResourceTypeAwsRdsDboptionGroup is a ResourceType enum value - ResourceTypeAwsRdsDboptionGroup = "AWS::RDS::DBOptionGroup" - // ResourceTypeAwsRdsDbsubnetGroup is a ResourceType enum value ResourceTypeAwsRdsDbsubnetGroup = "AWS::RDS::DBSubnetGroup" @@ -16572,9 +23700,6 @@ const ( // ResourceTypeAwsRdsDbcluster is a ResourceType enum value ResourceTypeAwsRdsDbcluster = "AWS::RDS::DBCluster" - // ResourceTypeAwsRdsDbclusterParameterGroup is a ResourceType enum value - ResourceTypeAwsRdsDbclusterParameterGroup = "AWS::RDS::DBClusterParameterGroup" - // ResourceTypeAwsRdsDbclusterSnapshot is a ResourceType enum value ResourceTypeAwsRdsDbclusterSnapshot = "AWS::RDS::DBClusterSnapshot" @@ -16665,9 +23790,6 @@ const ( // ResourceTypeAwsCloudFrontStreamingDistribution is a ResourceType enum value ResourceTypeAwsCloudFrontStreamingDistribution = "AWS::CloudFront::StreamingDistribution" - // ResourceTypeAwsLambdaAlias is a ResourceType enum value - ResourceTypeAwsLambdaAlias = "AWS::Lambda::Alias" - // ResourceTypeAwsLambdaFunction is a ResourceType enum value ResourceTypeAwsLambdaFunction = "AWS::Lambda::Function" @@ -16680,8 +23802,20 @@ const ( // ResourceTypeAwsElasticBeanstalkEnvironment is a ResourceType enum value ResourceTypeAwsElasticBeanstalkEnvironment = "AWS::ElasticBeanstalk::Environment" - // ResourceTypeAwsMobileHubProject is a ResourceType enum value - ResourceTypeAwsMobileHubProject = "AWS::MobileHub::Project" + // ResourceTypeAwsWafv2WebAcl is a ResourceType enum value + ResourceTypeAwsWafv2WebAcl = "AWS::WAFv2::WebACL" + + // ResourceTypeAwsWafv2RuleGroup is a ResourceType enum value + ResourceTypeAwsWafv2RuleGroup = "AWS::WAFv2::RuleGroup" + + // ResourceTypeAwsWafv2Ipset is a ResourceType enum value + ResourceTypeAwsWafv2Ipset = "AWS::WAFv2::IPSet" + + // ResourceTypeAwsWafv2RegexPatternSet is a ResourceType enum value + ResourceTypeAwsWafv2RegexPatternSet = "AWS::WAFv2::RegexPatternSet" + + // ResourceTypeAwsWafv2ManagedRuleSet is a ResourceType enum value + ResourceTypeAwsWafv2ManagedRuleSet = "AWS::WAFv2::ManagedRuleSet" // ResourceTypeAwsXrayEncryptionConfig is a ResourceType enum value ResourceTypeAwsXrayEncryptionConfig = "AWS::XRay::EncryptionConfig" @@ -16701,24 +23835,12 @@ const ( // ResourceTypeAwsConfigResourceCompliance is a ResourceType enum value ResourceTypeAwsConfigResourceCompliance = "AWS::Config::ResourceCompliance" - // ResourceTypeAwsLicenseManagerLicenseConfiguration is a ResourceType enum value - ResourceTypeAwsLicenseManagerLicenseConfiguration = "AWS::LicenseManager::LicenseConfiguration" - - // ResourceTypeAwsApiGatewayDomainName is a ResourceType enum value - ResourceTypeAwsApiGatewayDomainName = "AWS::ApiGateway::DomainName" - - // ResourceTypeAwsApiGatewayMethod is a ResourceType enum value - ResourceTypeAwsApiGatewayMethod = "AWS::ApiGateway::Method" - // ResourceTypeAwsApiGatewayStage is a ResourceType enum value ResourceTypeAwsApiGatewayStage = "AWS::ApiGateway::Stage" // ResourceTypeAwsApiGatewayRestApi is a ResourceType enum value ResourceTypeAwsApiGatewayRestApi = "AWS::ApiGateway::RestApi" - // ResourceTypeAwsApiGatewayV2DomainName is a ResourceType enum value - ResourceTypeAwsApiGatewayV2DomainName = "AWS::ApiGatewayV2::DomainName" - // ResourceTypeAwsApiGatewayV2Stage is a ResourceType enum value ResourceTypeAwsApiGatewayV2Stage = "AWS::ApiGatewayV2::Stage" @@ -16736,6 +23858,15 @@ const ( // ResourceTypeAwsServiceCatalogPortfolio is a ResourceType enum value ResourceTypeAwsServiceCatalogPortfolio = "AWS::ServiceCatalog::Portfolio" + + // ResourceTypeAwsSqsQueue is a ResourceType enum value + ResourceTypeAwsSqsQueue = "AWS::SQS::Queue" + + // ResourceTypeAwsKmsKey is a ResourceType enum value + ResourceTypeAwsKmsKey = "AWS::KMS::Key" + + // ResourceTypeAwsQldbLedger is a ResourceType enum value + ResourceTypeAwsQldbLedger = "AWS::QLDB::Ledger" ) const ( 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 index 7ecd56b1bd9..2a43fb4db19 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/configservice/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/configservice/errors.go @@ -2,8 +2,18 @@ package configservice +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( + // ErrCodeConformancePackTemplateValidationException for service response error code + // "ConformancePackTemplateValidationException". + // + // You have specified a template that is not valid or supported. + ErrCodeConformancePackTemplateValidationException = "ConformancePackTemplateValidationException" + // ErrCodeInsufficientDeliveryPolicyException for service response error code // "InsufficientDeliveryPolicyException". // @@ -21,9 +31,13 @@ const ( // * For PutConfigRule, the AWS Lambda function cannot be invoked. Check // the function ARN, and check the function's permissions. // - // * For OrganizationConfigRule, organization config rule cannot be created + // * For PutOrganizationConfigRule, organization config rule cannot be created // because you do not have permissions to call IAM GetRole action or create - // service linked role. + // a service linked role. + // + // * For PutConformancePack and PutOrganizationConformancePack, a conformance + // pack cannot be created because you do not have permissions: To call IAM + // GetRole action or create a service linked role. To read Amazon S3 bucket. ErrCodeInsufficientPermissionsException = "InsufficientPermissionsException" // ErrCodeInvalidConfigurationRecorderNameException for service response error code @@ -120,6 +134,13 @@ const ( // of accounts and aggregators exceeds the limit. ErrCodeLimitExceededException = "LimitExceededException" + // ErrCodeMaxActiveResourcesExceededException for service response error code + // "MaxActiveResourcesExceededException". + // + // You have reached the limit (100,000) of active custom resource types in your + // account. Delete unused resources using DeleteResourceConfig. + ErrCodeMaxActiveResourcesExceededException = "MaxActiveResourcesExceededException" + // ErrCodeMaxNumberOfConfigRulesExceededException for service response error code // "MaxNumberOfConfigRulesExceededException". // @@ -134,6 +155,13 @@ const ( // You have reached the limit of the number of recorders you can create. ErrCodeMaxNumberOfConfigurationRecordersExceededException = "MaxNumberOfConfigurationRecordersExceededException" + // ErrCodeMaxNumberOfConformancePacksExceededException for service response error code + // "MaxNumberOfConformancePacksExceededException". + // + // You have reached the limit (6) of the number of conformance packs in an account + // (6 conformance pack with 25 AWS Config rules per pack). + ErrCodeMaxNumberOfConformancePacksExceededException = "MaxNumberOfConformancePacksExceededException" + // ErrCodeMaxNumberOfDeliveryChannelsExceededException for service response error code // "MaxNumberOfDeliveryChannelsExceededException". // @@ -147,6 +175,14 @@ const ( // can create. ErrCodeMaxNumberOfOrganizationConfigRulesExceededException = "MaxNumberOfOrganizationConfigRulesExceededException" + // ErrCodeMaxNumberOfOrganizationConformancePacksExceededException for service response error code + // "MaxNumberOfOrganizationConformancePacksExceededException". + // + // You have reached the limit (6) of the number of organization conformance + // packs in an account (6 conformance pack with 25 AWS Config rules per pack + // per account). + ErrCodeMaxNumberOfOrganizationConformancePacksExceededException = "MaxNumberOfOrganizationConformancePacksExceededException" + // ErrCodeMaxNumberOfRetentionConfigurationsExceededException for service response error code // "MaxNumberOfRetentionConfigurationsExceededException". // @@ -192,6 +228,12 @@ const ( // rule names are correct and try again. ErrCodeNoSuchConfigRuleException = "NoSuchConfigRuleException" + // ErrCodeNoSuchConfigRuleInConformancePackException for service response error code + // "NoSuchConfigRuleInConformancePackException". + // + // AWS Config rule that you passed in the filter does not exist. + ErrCodeNoSuchConfigRuleInConformancePackException = "NoSuchConfigRuleInConformancePackException" + // ErrCodeNoSuchConfigurationAggregatorException for service response error code // "NoSuchConfigurationAggregatorException". // @@ -204,6 +246,12 @@ const ( // You have specified a configuration recorder that does not exist. ErrCodeNoSuchConfigurationRecorderException = "NoSuchConfigurationRecorderException" + // ErrCodeNoSuchConformancePackException for service response error code + // "NoSuchConformancePackException". + // + // You specified one or more conformance packs that do not exist. + ErrCodeNoSuchConformancePackException = "NoSuchConformancePackException" + // ErrCodeNoSuchDeliveryChannelException for service response error code // "NoSuchDeliveryChannelException". // @@ -216,6 +264,16 @@ const ( // You specified one or more organization config rules that do not exist. ErrCodeNoSuchOrganizationConfigRuleException = "NoSuchOrganizationConfigRuleException" + // ErrCodeNoSuchOrganizationConformancePackException for service response error code + // "NoSuchOrganizationConformancePackException". + // + // AWS Config organization conformance pack that you passed in the filter does + // not exist. + // + // For DeleteOrganizationConformancePack, you tried to delete an organization + // conformance pack that does not exist. + ErrCodeNoSuchOrganizationConformancePackException = "NoSuchOrganizationConformancePackException" + // ErrCodeNoSuchRemediationConfigurationException for service response error code // "NoSuchRemediationConfigurationException". // @@ -240,9 +298,9 @@ const ( // For PutConfigAggregator API, no permission to call EnableAWSServiceAccess // API. // - // For all OrganizationConfigRule APIs, AWS Config throws an exception if APIs - // are called from member accounts. All APIs must be called from organization - // master account. + // For all OrganizationConfigRule and OrganizationConformancePack APIs, AWS + // Config throws an exception if APIs are called from member accounts. All APIs + // must be called from organization master account. ErrCodeOrganizationAccessDeniedException = "OrganizationAccessDeniedException" // ErrCodeOrganizationAllFeaturesNotEnabledException for service response error code @@ -252,6 +310,12 @@ const ( // have all features enabled. ErrCodeOrganizationAllFeaturesNotEnabledException = "OrganizationAllFeaturesNotEnabledException" + // ErrCodeOrganizationConformancePackTemplateValidationException for service response error code + // "OrganizationConformancePackTemplateValidationException". + // + // You have specified a template that is not valid or supported. + ErrCodeOrganizationConformancePackTemplateValidationException = "OrganizationConformancePackTemplateValidationException" + // ErrCodeOversizedConfigurationItemException for service response error code // "OversizedConfigurationItemException". // @@ -270,14 +334,14 @@ const ( // // You see this exception in the following cases: // - // * For DeleteConfigRule API, AWS Config is deleting this rule. Try your - // request again later. + // * For DeleteConfigRule, AWS Config is deleting this rule. Try your request + // again later. // - // * For DeleteConfigRule API, the rule is deleting your evaluation results. + // * For DeleteConfigRule, the rule is deleting your evaluation results. // Try your request again later. // - // * For DeleteConfigRule API, a remediation action is associated with the - // rule and AWS Config cannot delete this rule. Delete the remediation action + // * For DeleteConfigRule, a remediation action is associated with the rule + // and AWS Config cannot delete this rule. Delete the remediation action // associated with the rule before deleting the rule and try your request // again later. // @@ -286,6 +350,13 @@ const ( // // * For DeleteOrganizationConfigRule, organization config rule creation // is in progress. Try your request again later. + // + // * For PutConformancePack and PutOrganizationConformancePack, a conformance + // pack creation, update, and deletion is in progress. Try your request again + // later. + // + // * For DeleteConformancePack, a conformance pack creation, update, and + // deletion is in progress. Try your request again later. ErrCodeResourceInUseException = "ResourceInUseException" // ErrCodeResourceNotDiscoveredException for service response error code @@ -313,3 +384,57 @@ const ( // The requested action is not valid. ErrCodeValidationException = "ValidationException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ConformancePackTemplateValidationException": newErrorConformancePackTemplateValidationException, + "InsufficientDeliveryPolicyException": newErrorInsufficientDeliveryPolicyException, + "InsufficientPermissionsException": newErrorInsufficientPermissionsException, + "InvalidConfigurationRecorderNameException": newErrorInvalidConfigurationRecorderNameException, + "InvalidDeliveryChannelNameException": newErrorInvalidDeliveryChannelNameException, + "InvalidExpressionException": newErrorInvalidExpressionException, + "InvalidLimitException": newErrorInvalidLimitException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "InvalidParameterValueException": newErrorInvalidParameterValueException, + "InvalidRecordingGroupException": newErrorInvalidRecordingGroupException, + "InvalidResultTokenException": newErrorInvalidResultTokenException, + "InvalidRoleException": newErrorInvalidRoleException, + "InvalidS3KeyPrefixException": newErrorInvalidS3KeyPrefixException, + "InvalidSNSTopicARNException": newErrorInvalidSNSTopicARNException, + "InvalidTimeRangeException": newErrorInvalidTimeRangeException, + "LastDeliveryChannelDeleteFailedException": newErrorLastDeliveryChannelDeleteFailedException, + "LimitExceededException": newErrorLimitExceededException, + "MaxActiveResourcesExceededException": newErrorMaxActiveResourcesExceededException, + "MaxNumberOfConfigRulesExceededException": newErrorMaxNumberOfConfigRulesExceededException, + "MaxNumberOfConfigurationRecordersExceededException": newErrorMaxNumberOfConfigurationRecordersExceededException, + "MaxNumberOfConformancePacksExceededException": newErrorMaxNumberOfConformancePacksExceededException, + "MaxNumberOfDeliveryChannelsExceededException": newErrorMaxNumberOfDeliveryChannelsExceededException, + "MaxNumberOfOrganizationConfigRulesExceededException": newErrorMaxNumberOfOrganizationConfigRulesExceededException, + "MaxNumberOfOrganizationConformancePacksExceededException": newErrorMaxNumberOfOrganizationConformancePacksExceededException, + "MaxNumberOfRetentionConfigurationsExceededException": newErrorMaxNumberOfRetentionConfigurationsExceededException, + "NoAvailableConfigurationRecorderException": newErrorNoAvailableConfigurationRecorderException, + "NoAvailableDeliveryChannelException": newErrorNoAvailableDeliveryChannelException, + "NoAvailableOrganizationException": newErrorNoAvailableOrganizationException, + "NoRunningConfigurationRecorderException": newErrorNoRunningConfigurationRecorderException, + "NoSuchBucketException": newErrorNoSuchBucketException, + "NoSuchConfigRuleException": newErrorNoSuchConfigRuleException, + "NoSuchConfigRuleInConformancePackException": newErrorNoSuchConfigRuleInConformancePackException, + "NoSuchConfigurationAggregatorException": newErrorNoSuchConfigurationAggregatorException, + "NoSuchConfigurationRecorderException": newErrorNoSuchConfigurationRecorderException, + "NoSuchConformancePackException": newErrorNoSuchConformancePackException, + "NoSuchDeliveryChannelException": newErrorNoSuchDeliveryChannelException, + "NoSuchOrganizationConfigRuleException": newErrorNoSuchOrganizationConfigRuleException, + "NoSuchOrganizationConformancePackException": newErrorNoSuchOrganizationConformancePackException, + "NoSuchRemediationConfigurationException": newErrorNoSuchRemediationConfigurationException, + "NoSuchRemediationExceptionException": newErrorNoSuchRemediationExceptionException, + "NoSuchRetentionConfigurationException": newErrorNoSuchRetentionConfigurationException, + "OrganizationAccessDeniedException": newErrorOrganizationAccessDeniedException, + "OrganizationAllFeaturesNotEnabledException": newErrorOrganizationAllFeaturesNotEnabledException, + "OrganizationConformancePackTemplateValidationException": newErrorOrganizationConformancePackTemplateValidationException, + "OversizedConfigurationItemException": newErrorOversizedConfigurationItemException, + "RemediationInProgressException": newErrorRemediationInProgressException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotDiscoveredException": newErrorResourceNotDiscoveredException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "TooManyTagsException": newErrorTooManyTagsException, + "ValidationException": newErrorValidationException, +} 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 index 2fdea95561f..94347635d98 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/configservice/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/configservice/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "config" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Config Service" // ServiceID is a unique identifer of a specific service. + ServiceID = "Config Service" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ConfigService client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ConfigService client from just a session. // svc := configservice.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ConfigService { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ConfigService { svc := &ConfigService{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2014-11-12", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/costandusagereportservice/api.go b/vendor/github.com/aws/aws-sdk-go/service/costandusagereportservice/api.go index 46efb54c1a5..b29c73560f7 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/costandusagereportservice/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/costandusagereportservice/api.go @@ -3,6 +3,8 @@ package costandusagereportservice import ( + "fmt" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" @@ -63,12 +65,12 @@ func (c *CostandUsageReportService) DeleteReportDefinitionRequest(input *DeleteR // See the AWS API reference guide for AWS Cost and Usage Report Service's // API operation DeleteReportDefinition for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The input fails to satisfy the constraints specified by an AWS service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cur-2017-01-06/DeleteReportDefinition @@ -152,8 +154,8 @@ func (c *CostandUsageReportService) DescribeReportDefinitionsRequest(input *Desc // See the AWS API reference guide for AWS Cost and Usage Report Service's // API operation DescribeReportDefinitions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // @@ -222,10 +224,12 @@ func (c *CostandUsageReportService) DescribeReportDefinitionsPagesWithContext(ct }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReportDefinitionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReportDefinitionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -283,12 +287,12 @@ func (c *CostandUsageReportService) ModifyReportDefinitionRequest(input *ModifyR // See the AWS API reference guide for AWS Cost and Usage Report Service's // API operation ModifyReportDefinition for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The input fails to satisfy the constraints specified by an AWS service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cur-2017-01-06/ModifyReportDefinition @@ -367,20 +371,20 @@ func (c *CostandUsageReportService) PutReportDefinitionRequest(input *PutReportD // See the AWS API reference guide for AWS Cost and Usage Report Service's // API operation PutReportDefinition for usage and error information. // -// Returned Error Codes: -// * ErrCodeDuplicateReportNameException "DuplicateReportNameException" +// Returned Error Types: +// * DuplicateReportNameException // A report with the specified name already exists in the account. Specify a // different report name. // -// * ErrCodeReportLimitReachedException "ReportLimitReachedException" +// * ReportLimitReachedException // This account already has five reports defined. To define a new report, you // must delete an existing report. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // The input fails to satisfy the constraints specified by an AWS service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/cur-2017-01-06/PutReportDefinition @@ -533,6 +537,122 @@ func (s *DescribeReportDefinitionsOutput) SetReportDefinitions(v []*ReportDefini return s } +// A report with the specified name already exists in the account. Specify a +// different report name. +type DuplicateReportNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message to show the detail of the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DuplicateReportNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DuplicateReportNameException) GoString() string { + return s.String() +} + +func newErrorDuplicateReportNameException(v protocol.ResponseMetadata) error { + return &DuplicateReportNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DuplicateReportNameException) Code() string { + return "DuplicateReportNameException" +} + +// Message returns the exception's message. +func (s DuplicateReportNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DuplicateReportNameException) OrigErr() error { + return nil +} + +func (s DuplicateReportNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DuplicateReportNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DuplicateReportNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// An error on the server occurred during the processing of your request. Try +// again later. +type InternalErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message to show the detail of the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalErrorException) GoString() string { + return s.String() +} + +func newErrorInternalErrorException(v protocol.ResponseMetadata) error { + return &InternalErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalErrorException) Code() string { + return "InternalErrorException" +} + +// Message returns the exception's message. +func (s InternalErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalErrorException) OrigErr() error { + return nil +} + +func (s InternalErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalErrorException) RequestID() string { + return s.respMetadata.RequestID +} + type ModifyReportDefinitionInput struct { _ struct{} `type:"structure"` @@ -841,6 +961,121 @@ func (s *ReportDefinition) SetTimeUnit(v string) *ReportDefinition { return s } +// This account already has five reports defined. To define a new report, you +// must delete an existing report. +type ReportLimitReachedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message to show the detail of the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ReportLimitReachedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReportLimitReachedException) GoString() string { + return s.String() +} + +func newErrorReportLimitReachedException(v protocol.ResponseMetadata) error { + return &ReportLimitReachedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ReportLimitReachedException) Code() string { + return "ReportLimitReachedException" +} + +// Message returns the exception's message. +func (s ReportLimitReachedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ReportLimitReachedException) OrigErr() error { + return nil +} + +func (s ReportLimitReachedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ReportLimitReachedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ReportLimitReachedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The input fails to satisfy the constraints specified by an AWS service. +type ValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message to show the detail of the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationException) GoString() string { + return s.String() +} + +func newErrorValidationException(v protocol.ResponseMetadata) error { + return &ValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ValidationException) Code() string { + return "ValidationException" +} + +// Message returns the exception's message. +func (s ValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ValidationException) OrigErr() error { + return nil +} + +func (s ValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ValidationException) RequestID() string { + return s.respMetadata.RequestID +} + // The region of the S3 bucket that AWS delivers the report into. const ( // AWSRegionUsEast1 is a AWSRegion enum value diff --git a/vendor/github.com/aws/aws-sdk-go/service/costandusagereportservice/errors.go b/vendor/github.com/aws/aws-sdk-go/service/costandusagereportservice/errors.go index 0602538036c..8ce7a64bd25 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/costandusagereportservice/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/costandusagereportservice/errors.go @@ -2,6 +2,10 @@ package costandusagereportservice +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeDuplicateReportNameException for service response error code @@ -31,3 +35,10 @@ const ( // The input fails to satisfy the constraints specified by an AWS service. ErrCodeValidationException = "ValidationException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "DuplicateReportNameException": newErrorDuplicateReportNameException, + "InternalErrorException": newErrorInternalErrorException, + "ReportLimitReachedException": newErrorReportLimitReachedException, + "ValidationException": newErrorValidationException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/costandusagereportservice/service.go b/vendor/github.com/aws/aws-sdk-go/service/costandusagereportservice/service.go index 39e3cedfeae..060ccd01257 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/costandusagereportservice/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/costandusagereportservice/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "cur" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Cost and Usage Report Service" // ServiceID is a unique identifer of a specific service. + ServiceID = "Cost and Usage Report Service" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the CostandUsageReportService client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a CostandUsageReportService client from just a session. // svc := costandusagereportservice.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *CostandUsageReportServic if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "cur" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *CostandUsageReportService { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *CostandUsageReportService { svc := &CostandUsageReportService{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-01-06", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index ca10a582512..7bcdf0d814b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/api.go @@ -70,8 +70,8 @@ func (c *DatabaseMigrationService) AddTagsToResourceRequest(input *AddTagsToReso // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/AddTagsToResource @@ -150,8 +150,8 @@ func (c *DatabaseMigrationService) ApplyPendingMaintenanceActionRequest(input *A // See the AWS API reference guide for AWS Database Migration Service's // API operation ApplyPendingMaintenanceAction for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ApplyPendingMaintenanceAction @@ -229,24 +229,24 @@ func (c *DatabaseMigrationService) CreateEndpointRequest(input *CreateEndpointIn // 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" +// Returned Error Types: +// * KMSKeyNotAccessibleFault // AWS DMS cannot access the AWS KMS key. // -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" +// * ResourceAlreadyExistsFault // The resource you are attempting to create already exists. // -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" +// * ResourceQuotaExceededFault // The quota for this resource quota has been exceeded. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeAccessDeniedFault "AccessDeniedFault" +// * AccessDeniedFault // AWS DMS was denied access to the endpoint. Check that the role is correctly // configured. // @@ -341,36 +341,36 @@ func (c *DatabaseMigrationService) CreateEventSubscriptionRequest(input *CreateE // See the AWS API reference guide for AWS Database Migration Service's // API operation CreateEventSubscription for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" +// Returned Error Types: +// * ResourceQuotaExceededFault // The quota for this resource quota has been exceeded. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" +// * ResourceAlreadyExistsFault // The resource you are attempting to create already exists. // -// * ErrCodeSNSInvalidTopicFault "SNSInvalidTopicFault" +// * SNSInvalidTopicFault // The SNS topic is invalid. // -// * ErrCodeSNSNoAuthorizationFault "SNSNoAuthorizationFault" +// * SNSNoAuthorizationFault // You are not authorized for the SNS subscription. // -// * ErrCodeKMSAccessDeniedFault "KMSAccessDeniedFault" +// * KMSAccessDeniedFault // The ciphertext references a key that doesn't exist or that the DMS account // doesn't have access to. // -// * ErrCodeKMSDisabledFault "KMSDisabledFault" +// * KMSDisabledFault // The specified master key (CMK) isn't enabled. // -// * ErrCodeKMSInvalidStateFault "KMSInvalidStateFault" +// * KMSInvalidStateFault // The state of the specified AWS KMS resource isn't valid for this request. // -// * ErrCodeKMSNotFoundFault "KMSNotFoundFault" +// * KMSNotFoundFault // The specified AWS KMS entity or resource can't be found. // -// * ErrCodeKMSThrottlingFault "KMSThrottlingFault" +// * KMSThrottlingFault // This request triggered AWS KMS request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateEventSubscription @@ -441,6 +441,13 @@ func (c *DatabaseMigrationService) CreateReplicationInstanceRequest(input *Creat // // Creates the replication instance using the specified parameters. // +// AWS DMS requires that your account have certain roles with appropriate permissions +// before you can create a replication instance. For information on the required +// roles, see Creating the IAM Roles to Use With the AWS CLI and AWS DMS API +// (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.APIRole.html). +// For information on the required permissions, see IAM Permissions Needed to +// Use AWS DMS (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.IAMPermissions.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. @@ -448,38 +455,38 @@ func (c *DatabaseMigrationService) CreateReplicationInstanceRequest(input *Creat // 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" +// Returned Error Types: +// * AccessDeniedFault // AWS DMS was denied access to the endpoint. Check that the role is correctly // configured. // -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" +// * ResourceAlreadyExistsFault // The resource you are attempting to create already exists. // -// * ErrCodeInsufficientResourceCapacityFault "InsufficientResourceCapacityFault" +// * InsufficientResourceCapacityFault // There are not enough resources allocated to the database migration. // -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" +// * ResourceQuotaExceededFault // The quota for this resource quota has been exceeded. // -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceededFault" +// * StorageQuotaExceededFault // The storage quota has been exceeded. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeReplicationSubnetGroupDoesNotCoverEnoughAZs "ReplicationSubnetGroupDoesNotCoverEnoughAZs" +// * ReplicationSubnetGroupDoesNotCoverEnoughAZs // The replication subnet group does not cover enough Availability Zones (AZs). // Edit the replication subnet group and add more AZs. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // -// * ErrCodeInvalidSubnet "InvalidSubnet" +// * InvalidSubnet // The subnet provided is invalid. // -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" +// * KMSKeyNotAccessibleFault // AWS DMS cannot access the AWS KMS key. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationInstance @@ -557,25 +564,25 @@ func (c *DatabaseMigrationService) CreateReplicationSubnetGroupRequest(input *Cr // 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" +// Returned Error Types: +// * AccessDeniedFault // AWS DMS was denied access to the endpoint. Check that the role is correctly // configured. // -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" +// * ResourceAlreadyExistsFault // The resource you are attempting to create already exists. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" +// * ResourceQuotaExceededFault // The quota for this resource quota has been exceeded. // -// * ErrCodeReplicationSubnetGroupDoesNotCoverEnoughAZs "ReplicationSubnetGroupDoesNotCoverEnoughAZs" +// * ReplicationSubnetGroupDoesNotCoverEnoughAZs // The replication subnet group does not cover enough Availability Zones (AZs). // Edit the replication subnet group and add more AZs. // -// * ErrCodeInvalidSubnet "InvalidSubnet" +// * InvalidSubnet // The subnet provided is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationSubnetGroup @@ -653,25 +660,25 @@ func (c *DatabaseMigrationService) CreateReplicationTaskRequest(input *CreateRep // See the AWS API reference guide for AWS Database Migration Service's // API operation CreateReplicationTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedFault "AccessDeniedFault" +// Returned Error Types: +// * AccessDeniedFault // AWS DMS was denied access to the endpoint. Check that the role is correctly // configured. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" +// * ResourceAlreadyExistsFault // The resource you are attempting to create already exists. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" +// * KMSKeyNotAccessibleFault // AWS DMS cannot access the AWS KMS key. // -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" +// * ResourceQuotaExceededFault // The quota for this resource quota has been exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/CreateReplicationTask @@ -749,11 +756,11 @@ func (c *DatabaseMigrationService) DeleteCertificateRequest(input *DeleteCertifi // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // @@ -832,15 +839,15 @@ func (c *DatabaseMigrationService) DeleteConnectionRequest(input *DeleteConnecti // See the AWS API reference guide for AWS Database Migration Service's // API operation DeleteConnection for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedFault "AccessDeniedFault" +// Returned Error Types: +// * AccessDeniedFault // AWS DMS was denied access to the endpoint. Check that the role is correctly // configured. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // @@ -922,11 +929,11 @@ func (c *DatabaseMigrationService) DeleteEndpointRequest(input *DeleteEndpointIn // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // @@ -1005,11 +1012,11 @@ func (c *DatabaseMigrationService) DeleteEventSubscriptionRequest(input *DeleteE // See the AWS API reference guide for AWS Database Migration Service's // API operation DeleteEventSubscription for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // @@ -1091,12 +1098,12 @@ func (c *DatabaseMigrationService) DeleteReplicationInstanceRequest(input *Delet // 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" +// Returned Error Types: +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationInstance @@ -1175,12 +1182,12 @@ func (c *DatabaseMigrationService) DeleteReplicationSubnetGroupRequest(input *De // 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" +// Returned Error Types: +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DeleteReplicationSubnetGroup @@ -1258,11 +1265,11 @@ func (c *DatabaseMigrationService) DeleteReplicationTaskRequest(input *DeleteRep // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // @@ -1429,8 +1436,8 @@ func (c *DatabaseMigrationService) DescribeCertificatesRequest(input *DescribeCe // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeCertificates @@ -1498,10 +1505,12 @@ func (c *DatabaseMigrationService) DescribeCertificatesPagesWithContext(ctx aws. }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCertificatesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeCertificatesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1565,8 +1574,8 @@ func (c *DatabaseMigrationService) DescribeConnectionsRequest(input *DescribeCon // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeConnections @@ -1634,10 +1643,12 @@ func (c *DatabaseMigrationService) DescribeConnectionsPagesWithContext(ctx aws.C }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeConnectionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeConnectionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1764,10 +1775,12 @@ func (c *DatabaseMigrationService) DescribeEndpointTypesPagesWithContext(ctx aws }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEndpointTypesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEndpointTypesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1830,8 +1843,8 @@ func (c *DatabaseMigrationService) DescribeEndpointsRequest(input *DescribeEndpo // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeEndpoints @@ -1899,10 +1912,12 @@ func (c *DatabaseMigrationService) DescribeEndpointsPagesWithContext(ctx aws.Con }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEndpointsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEndpointsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2047,8 +2062,8 @@ func (c *DatabaseMigrationService) DescribeEventSubscriptionsRequest(input *Desc // See the AWS API reference guide for AWS Database Migration Service's // API operation DescribeEventSubscriptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeEventSubscriptions @@ -2116,10 +2131,12 @@ func (c *DatabaseMigrationService) DescribeEventSubscriptionsPagesWithContext(ct }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventSubscriptionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEventSubscriptionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2249,10 +2266,12 @@ func (c *DatabaseMigrationService) DescribeEventsPagesWithContext(ctx aws.Contex }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2380,10 +2399,12 @@ func (c *DatabaseMigrationService) DescribeOrderableReplicationInstancesPagesWit }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeOrderableReplicationInstancesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeOrderableReplicationInstancesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2446,8 +2467,8 @@ func (c *DatabaseMigrationService) DescribePendingMaintenanceActionsRequest(inpu // See the AWS API reference guide for AWS Database Migration Service's // API operation DescribePendingMaintenanceActions for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribePendingMaintenanceActions @@ -2515,10 +2536,12 @@ func (c *DatabaseMigrationService) DescribePendingMaintenanceActionsPagesWithCon }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribePendingMaintenanceActionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribePendingMaintenanceActionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2575,12 +2598,12 @@ func (c *DatabaseMigrationService) DescribeRefreshSchemasStatusRequest(input *De // 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" +// Returned Error Types: +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeRefreshSchemasStatus @@ -2664,11 +2687,11 @@ func (c *DatabaseMigrationService) DescribeReplicationInstanceTaskLogsRequest(in // See the AWS API reference guide for AWS Database Migration Service's // API operation DescribeReplicationInstanceTaskLogs for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // @@ -2737,10 +2760,12 @@ func (c *DatabaseMigrationService) DescribeReplicationInstanceTaskLogsPagesWithC }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReplicationInstanceTaskLogsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReplicationInstanceTaskLogsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2804,8 +2829,8 @@ func (c *DatabaseMigrationService) DescribeReplicationInstancesRequest(input *De // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationInstances @@ -2873,10 +2898,12 @@ func (c *DatabaseMigrationService) DescribeReplicationInstancesPagesWithContext( }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReplicationInstancesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReplicationInstancesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2939,8 +2966,8 @@ func (c *DatabaseMigrationService) DescribeReplicationSubnetGroupsRequest(input // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationSubnetGroups @@ -3008,10 +3035,12 @@ func (c *DatabaseMigrationService) DescribeReplicationSubnetGroupsPagesWithConte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReplicationSubnetGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReplicationSubnetGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3075,8 +3104,8 @@ func (c *DatabaseMigrationService) DescribeReplicationTaskAssessmentResultsReque // See the AWS API reference guide for AWS Database Migration Service's // API operation DescribeReplicationTaskAssessmentResults for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationTaskAssessmentResults @@ -3144,10 +3173,12 @@ func (c *DatabaseMigrationService) DescribeReplicationTaskAssessmentResultsPages }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReplicationTaskAssessmentResultsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReplicationTaskAssessmentResultsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3211,8 +3242,8 @@ func (c *DatabaseMigrationService) DescribeReplicationTasksRequest(input *Descri // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeReplicationTasks @@ -3280,10 +3311,12 @@ func (c *DatabaseMigrationService) DescribeReplicationTasksPagesWithContext(ctx }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReplicationTasksOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReplicationTasksOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3346,12 +3379,12 @@ func (c *DatabaseMigrationService) DescribeSchemasRequest(input *DescribeSchemas // 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" +// Returned Error Types: +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/DescribeSchemas @@ -3419,10 +3452,12 @@ func (c *DatabaseMigrationService) DescribeSchemasPagesWithContext(ctx aws.Conte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSchemasOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeSchemasOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3490,11 +3525,11 @@ func (c *DatabaseMigrationService) DescribeTableStatisticsRequest(input *Describ // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // @@ -3563,10 +3598,12 @@ func (c *DatabaseMigrationService) DescribeTableStatisticsPagesWithContext(ctx a }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTableStatisticsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeTableStatisticsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3623,14 +3660,14 @@ func (c *DatabaseMigrationService) ImportCertificateRequest(input *ImportCertifi // 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" +// Returned Error Types: +// * ResourceAlreadyExistsFault // The resource you are attempting to create already exists. // -// * ErrCodeInvalidCertificateFault "InvalidCertificateFault" +// * InvalidCertificateFault // The certificate was not valid. // -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" +// * ResourceQuotaExceededFault // The quota for this resource quota has been exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ImportCertificate @@ -3708,8 +3745,8 @@ func (c *DatabaseMigrationService) ListTagsForResourceRequest(input *ListTagsFor // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ListTagsForResource @@ -3787,21 +3824,21 @@ func (c *DatabaseMigrationService) ModifyEndpointRequest(input *ModifyEndpointIn // 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" +// Returned Error Types: +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" +// * ResourceAlreadyExistsFault // The resource you are attempting to create already exists. // -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" +// * KMSKeyNotAccessibleFault // AWS DMS cannot access the AWS KMS key. // -// * ErrCodeAccessDeniedFault "AccessDeniedFault" +// * AccessDeniedFault // AWS DMS was denied access to the endpoint. Check that the role is correctly // configured. // @@ -3880,33 +3917,33 @@ func (c *DatabaseMigrationService) ModifyEventSubscriptionRequest(input *ModifyE // See the AWS API reference guide for AWS Database Migration Service's // API operation ModifyEventSubscription for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" +// Returned Error Types: +// * ResourceQuotaExceededFault // The quota for this resource quota has been exceeded. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeSNSInvalidTopicFault "SNSInvalidTopicFault" +// * SNSInvalidTopicFault // The SNS topic is invalid. // -// * ErrCodeSNSNoAuthorizationFault "SNSNoAuthorizationFault" +// * SNSNoAuthorizationFault // You are not authorized for the SNS subscription. // -// * ErrCodeKMSAccessDeniedFault "KMSAccessDeniedFault" +// * KMSAccessDeniedFault // The ciphertext references a key that doesn't exist or that the DMS account // doesn't have access to. // -// * ErrCodeKMSDisabledFault "KMSDisabledFault" +// * KMSDisabledFault // The specified master key (CMK) isn't enabled. // -// * ErrCodeKMSInvalidStateFault "KMSInvalidStateFault" +// * KMSInvalidStateFault // The state of the specified AWS KMS resource isn't valid for this request. // -// * ErrCodeKMSNotFoundFault "KMSNotFoundFault" +// * KMSNotFoundFault // The specified AWS KMS entity or resource can't be found. // -// * ErrCodeKMSThrottlingFault "KMSThrottlingFault" +// * KMSThrottlingFault // This request triggered AWS KMS request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyEventSubscription @@ -3988,28 +4025,28 @@ func (c *DatabaseMigrationService) ModifyReplicationInstanceRequest(input *Modif // See the AWS API reference guide for AWS Database Migration Service's // API operation ModifyReplicationInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedFault "AccessDeniedFault" +// Returned Error Types: +// * AccessDeniedFault // AWS DMS was denied access to the endpoint. Check that the role is correctly // configured. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" +// * ResourceAlreadyExistsFault // The resource you are attempting to create already exists. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeInsufficientResourceCapacityFault "InsufficientResourceCapacityFault" +// * InsufficientResourceCapacityFault // There are not enough resources allocated to the database migration. // -// * ErrCodeStorageQuotaExceededFault "StorageQuotaExceededFault" +// * StorageQuotaExceededFault // The storage quota has been exceeded. // -// * ErrCodeUpgradeDependencyFailureFault "UpgradeDependencyFailureFault" +// * UpgradeDependencyFailureFault // An upgrade dependency is preventing the database migration. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationInstance @@ -4087,25 +4124,25 @@ func (c *DatabaseMigrationService) ModifyReplicationSubnetGroupRequest(input *Mo // 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" +// Returned Error Types: +// * AccessDeniedFault // AWS DMS was denied access to the endpoint. Check that the role is correctly // configured. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" +// * ResourceQuotaExceededFault // The quota for this resource quota has been exceeded. // -// * ErrCodeSubnetAlreadyInUse "SubnetAlreadyInUse" +// * SubnetAlreadyInUse // The specified subnet is already in use. // -// * ErrCodeReplicationSubnetGroupDoesNotCoverEnoughAZs "ReplicationSubnetGroupDoesNotCoverEnoughAZs" +// * ReplicationSubnetGroupDoesNotCoverEnoughAZs // The replication subnet group does not cover enough Availability Zones (AZs). // Edit the replication subnet group and add more AZs. // -// * ErrCodeInvalidSubnet "InvalidSubnet" +// * InvalidSubnet // The subnet provided is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationSubnetGroup @@ -4190,18 +4227,18 @@ func (c *DatabaseMigrationService) ModifyReplicationTaskRequest(input *ModifyRep // 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" +// Returned Error Types: +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeResourceAlreadyExistsFault "ResourceAlreadyExistsFault" +// * ResourceAlreadyExistsFault // The resource you are attempting to create already exists. // -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" +// * KMSKeyNotAccessibleFault // AWS DMS cannot access the AWS KMS key. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/ModifyReplicationTask @@ -4280,11 +4317,11 @@ func (c *DatabaseMigrationService) RebootReplicationInstanceRequest(input *Reboo // See the AWS API reference guide for AWS Database Migration Service's // API operation RebootReplicationInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // @@ -4365,18 +4402,18 @@ func (c *DatabaseMigrationService) RefreshSchemasRequest(input *RefreshSchemasIn // 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" +// Returned Error Types: +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" +// * KMSKeyNotAccessibleFault // AWS DMS cannot access the AWS KMS key. // -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" +// * ResourceQuotaExceededFault // The quota for this resource quota has been exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/RefreshSchemas @@ -4454,11 +4491,11 @@ func (c *DatabaseMigrationService) ReloadTablesRequest(input *ReloadTablesInput) // See the AWS API reference guide for AWS Database Migration Service's // API operation ReloadTables for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // @@ -4538,8 +4575,8 @@ func (c *DatabaseMigrationService) RemoveTagsFromResourceRequest(input *RemoveTa // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/RemoveTagsFromResource @@ -4621,15 +4658,15 @@ func (c *DatabaseMigrationService) StartReplicationTaskRequest(input *StartRepli // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // -// * ErrCodeAccessDeniedFault "AccessDeniedFault" +// * AccessDeniedFault // AWS DMS was denied access to the endpoint. Check that the role is correctly // configured. // @@ -4709,12 +4746,12 @@ func (c *DatabaseMigrationService) StartReplicationTaskAssessmentRequest(input * // See the AWS API reference guide for AWS Database Migration Service's // API operation StartReplicationTaskAssessment for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// Returned Error Types: +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // -// * ErrCodeResourceNotFoundFault "ResourceNotFoundFault" +// * ResourceNotFoundFault // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/StartReplicationTaskAssessment @@ -4792,11 +4829,11 @@ func (c *DatabaseMigrationService) StopReplicationTaskRequest(input *StopReplica // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // @@ -4875,18 +4912,18 @@ func (c *DatabaseMigrationService) TestConnectionRequest(input *TestConnectionIn // 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" +// Returned Error Types: +// * ResourceNotFoundFault // The resource could not be found. // -// * ErrCodeInvalidResourceStateFault "InvalidResourceStateFault" +// * InvalidResourceStateFault // The resource is in a state that prevents it from being used for database // migration. // -// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" +// * KMSKeyNotAccessibleFault // AWS DMS cannot access the AWS KMS key. // -// * ErrCodeResourceQuotaExceededFault "ResourceQuotaExceededFault" +// * ResourceQuotaExceededFault // The quota for this resource quota has been exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dms-2016-01-01/TestConnection @@ -4911,6 +4948,63 @@ func (c *DatabaseMigrationService) TestConnectionWithContext(ctx aws.Context, in return out, req.Send() } +// AWS DMS was denied access to the endpoint. Check that the role is correctly +// configured. +type AccessDeniedFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedFault) GoString() string { + return s.String() +} + +func newErrorAccessDeniedFault(v protocol.ResponseMetadata) error { + return &AccessDeniedFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedFault) Code() string { + return "AccessDeniedFault" +} + +// Message returns the exception's message. +func (s AccessDeniedFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedFault) OrigErr() error { + return nil +} + +func (s AccessDeniedFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedFault) RequestID() string { + return s.respMetadata.RequestID +} + // Describes a quota for an AWS account, for example, the number of replication // instances allowed. type AccountQuota struct { @@ -6131,6 +6225,12 @@ type CreateReplicationTaskInput struct { // Checkpoint Example: --cdc-start-position "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93" // // LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373” + // + // When you use this task setting with a source PostgreSQL database, a logical + // replication slot should already be created and associated with the source + // endpoint. You can verify this by setting the slotName extra connection attribute + // to the name of this logical replication slot. For more information, see Extra + // Connection Attributes When Using PostgreSQL as a Source for AWS DMS (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html#CHAP_Source.PostgreSQL.ConnectionAttrib). CdcStartPosition *string `type:"string"` // Indicates the start time for a change data capture (CDC) operation. Use either @@ -9333,233 +9433,795 @@ func (s *ImportCertificateOutput) SetCertificate(v *Certificate) *ImportCertific return s } -type KinesisSettings struct { - _ struct{} `type:"structure"` - - // The output format for the records created on the endpoint. The message format - // is JSON. - MessageFormat *string `type:"string" enum:"MessageFormatValue"` - - // The Amazon Resource Name (ARN) for the IAM role that DMS uses to write to - // the Amazon Kinesis data stream. - ServiceAccessRoleArn *string `type:"string"` +// There are not enough resources allocated to the database migration. +type InsufficientResourceCapacityFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The Amazon Resource Name (ARN) for the Amazon Kinesis Data Streams endpoint. - StreamArn *string `type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s KinesisSettings) String() string { +func (s InsufficientResourceCapacityFault) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s KinesisSettings) GoString() string { +func (s InsufficientResourceCapacityFault) GoString() string { return s.String() } -// SetMessageFormat sets the MessageFormat field's value. -func (s *KinesisSettings) SetMessageFormat(v string) *KinesisSettings { - s.MessageFormat = &v - return s +func newErrorInsufficientResourceCapacityFault(v protocol.ResponseMetadata) error { + return &InsufficientResourceCapacityFault{ + respMetadata: v, + } } -// SetServiceAccessRoleArn sets the ServiceAccessRoleArn field's value. -func (s *KinesisSettings) SetServiceAccessRoleArn(v string) *KinesisSettings { - s.ServiceAccessRoleArn = &v - return s +// Code returns the exception type name. +func (s InsufficientResourceCapacityFault) Code() string { + return "InsufficientResourceCapacityFault" } -// SetStreamArn sets the StreamArn field's value. -func (s *KinesisSettings) SetStreamArn(v string) *KinesisSettings { - s.StreamArn = &v - return s +// Message returns the exception's message. +func (s InsufficientResourceCapacityFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InsufficientResourceCapacityFault) OrigErr() error { + return nil +} - // The Amazon Resource Name (ARN) string that uniquely identifies the AWS DMS - // resource. - // - // ResourceArn is a required field - ResourceArn *string `type:"string" required:"true"` +func (s InsufficientResourceCapacityFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InsufficientResourceCapacityFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InsufficientResourceCapacityFault) RequestID() string { + return s.respMetadata.RequestID +} + +// The certificate was not valid. +type InvalidCertificateFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListTagsForResourceInput) String() string { +func (s InvalidCertificateFault) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsForResourceInput) GoString() string { +func (s InvalidCertificateFault) 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")) +func newErrorInvalidCertificateFault(v protocol.ResponseMetadata) error { + return &InvalidCertificateFault{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidCertificateFault) Code() string { + return "InvalidCertificateFault" +} + +// Message returns the exception's message. +func (s InvalidCertificateFault) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidCertificateFault) OrigErr() error { return nil } -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s +func (s InvalidCertificateFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidCertificateFault) StatusCode() int { + return s.respMetadata.StatusCode +} - // A list of tags for the resource. - TagList []*Tag `type:"list"` +// RequestID returns the service's response RequestID for request. +func (s InvalidCertificateFault) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource is in a state that prevents it from being used for database +// migration. +type InvalidResourceStateFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListTagsForResourceOutput) String() string { +func (s InvalidResourceStateFault) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsForResourceOutput) GoString() string { +func (s InvalidResourceStateFault) GoString() string { return s.String() } -// SetTagList sets the TagList field's value. -func (s *ListTagsForResourceOutput) SetTagList(v []*Tag) *ListTagsForResourceOutput { - s.TagList = v - return s +func newErrorInvalidResourceStateFault(v protocol.ResponseMetadata) error { + return &InvalidResourceStateFault{ + respMetadata: v, + } } -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 settings in JSON format for the DMS transfer type of source endpoint. - // - // Attributes include the following: - // - // * serviceAccessRoleArn - The IAM role that has permission to access the - // Amazon S3 bucket. - // - // * BucketName - The name of the S3 bucket to use. - // - // * compressionType - An optional parameter to use GZIP to compress the - // target files. Set to NONE (the default) or do not use to leave the files - // uncompressed. - // - // Shorthand syntax: ServiceAccessRoleArn=string ,BucketName=string,CompressionType=string - // - // JSON syntax: - // - // { "ServiceAccessRoleArn": "string", "BucketName": "string", "CompressionType": - // "none"|"gzip" } - DmsTransferSettings *DmsTransferSettings `type:"structure"` +// Code returns the exception type name. +func (s InvalidResourceStateFault) Code() string { + return "InvalidResourceStateFault" +} - // Settings in JSON format for the target Amazon DynamoDB endpoint. For more - // information about the available settings, see Using Object Mapping to Migrate - // Data to DynamoDB (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.DynamoDB.html) - // in the AWS Database Migration Service User Guide. - DynamoDbSettings *DynamoDbSettings `type:"structure"` +// Message returns the exception's message. +func (s InvalidResourceStateFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Settings in JSON format for the target Elasticsearch endpoint. For more information - // about the available settings, see Extra Connection Attributes When Using - // Elasticsearch as a Target for AWS DMS (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Elasticsearch.html#CHAP_Target.Elasticsearch.Configuration) - // in the AWS Database Migration User Guide. - ElasticsearchSettings *ElasticsearchSettings `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidResourceStateFault) OrigErr() error { + return nil +} - // The Amazon Resource Name (ARN) string that uniquely identifies the endpoint. - // - // EndpointArn is a required field - EndpointArn *string `type:"string" required:"true"` +func (s InvalidResourceStateFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // 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"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidResourceStateFault) StatusCode() int { + return s.respMetadata.StatusCode +} - // The type of endpoint. Valid values are source and target. - EndpointType *string `type:"string" enum:"ReplicationEndpointTypeValue"` +// RequestID returns the service's response RequestID for request. +func (s InvalidResourceStateFault) RequestID() string { + return s.respMetadata.RequestID +} - // The type of engine for the endpoint. Valid values, depending on the EndpointType, - // include mysql, oracle, postgres, mariadb, aurora, aurora-postgresql, redshift, - // s3, db2, azuredb, sybase, dynamodb, mongodb, and sqlserver. - EngineName *string `type:"string"` +// The subnet provided is invalid. +type InvalidSubnet struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The external table definition. - ExternalTableDefinition *string `type:"string"` + Message_ *string `locationName:"message" type:"string"` +} - // Additional attributes associated with the connection. To reset this parameter, - // pass the empty string ("") as an argument. - ExtraConnectionAttributes *string `type:"string"` +// String returns the string representation +func (s InvalidSubnet) String() string { + return awsutil.Prettify(s) +} - // Settings in JSON format for the target Amazon Kinesis Data Streams endpoint. - // For more information about the available settings, see Using Object Mapping - // to Migrate Data to a Kinesis Data Stream (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Kinesis.html#CHAP_Target.Kinesis.ObjectMapping) - // in the AWS Database Migration User Guide. - KinesisSettings *KinesisSettings `type:"structure"` +// GoString returns the string representation +func (s InvalidSubnet) GoString() string { + return s.String() +} - // Settings in JSON format for the source MongoDB endpoint. For more information - // about the available settings, see the configuration properties section in - // Using MongoDB as a Target for AWS Database Migration Service (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.MongoDB.html) - // in the AWS Database Migration Service User Guide. - MongoDbSettings *MongoDbSettings `type:"structure"` +func newErrorInvalidSubnet(v protocol.ResponseMetadata) error { + return &InvalidSubnet{ + respMetadata: v, + } +} - // The password to be used to login to the endpoint database. - Password *string `type:"string" sensitive:"true"` +// Code returns the exception type name. +func (s InvalidSubnet) Code() string { + return "InvalidSubnet" +} - // The port used by the endpoint database. - Port *int64 `type:"integer"` +// Message returns the exception's message. +func (s InvalidSubnet) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - RedshiftSettings *RedshiftSettings `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidSubnet) OrigErr() error { + return nil +} - // Settings in JSON format for the target Amazon S3 endpoint. For more information - // about the available settings, see Extra Connection Attributes When Using - // Amazon S3 as a Target for AWS DMS (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.S3.html#CHAP_Target.S3.Configuring) - // in the AWS Database Migration Service User Guide. - S3Settings *S3Settings `type:"structure"` +func (s InvalidSubnet) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The name of the server where the endpoint database resides. - ServerName *string `type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidSubnet) StatusCode() int { + return s.respMetadata.StatusCode +} - // The Amazon Resource Name (ARN) for the service access role you want to use - // to modify the endpoint. - ServiceAccessRoleArn *string `type:"string"` +// RequestID returns the service's response RequestID for request. +func (s InvalidSubnet) RequestID() string { + return s.respMetadata.RequestID +} - // The SSL mode used to connect to the endpoint. The default value is none. - SslMode *string `type:"string" enum:"DmsSslModeValue"` +// The ciphertext references a key that doesn't exist or that the DMS account +// doesn't have access to. +type KMSAccessDeniedFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The user name to be used to login to the endpoint database. - Username *string `type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ModifyEndpointInput) String() string { +func (s KMSAccessDeniedFault) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModifyEndpointInput) GoString() string { +func (s KMSAccessDeniedFault) 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")) +func newErrorKMSAccessDeniedFault(v protocol.ResponseMetadata) error { + return &KMSAccessDeniedFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s KMSAccessDeniedFault) Code() string { + return "KMSAccessDeniedFault" +} + +// Message returns the exception's message. +func (s KMSAccessDeniedFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s KMSAccessDeniedFault) OrigErr() error { + return nil +} + +func (s KMSAccessDeniedFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s KMSAccessDeniedFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSAccessDeniedFault) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified master key (CMK) isn't enabled. +type KMSDisabledFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s KMSDisabledFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KMSDisabledFault) GoString() string { + return s.String() +} + +func newErrorKMSDisabledFault(v protocol.ResponseMetadata) error { + return &KMSDisabledFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s KMSDisabledFault) Code() string { + return "KMSDisabledFault" +} + +// Message returns the exception's message. +func (s KMSDisabledFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s KMSDisabledFault) OrigErr() error { + return nil +} + +func (s KMSDisabledFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s KMSDisabledFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSDisabledFault) RequestID() string { + return s.respMetadata.RequestID +} + +// The state of the specified AWS KMS resource isn't valid for this request. +type KMSInvalidStateFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s KMSInvalidStateFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KMSInvalidStateFault) GoString() string { + return s.String() +} + +func newErrorKMSInvalidStateFault(v protocol.ResponseMetadata) error { + return &KMSInvalidStateFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s KMSInvalidStateFault) Code() string { + return "KMSInvalidStateFault" +} + +// Message returns the exception's message. +func (s KMSInvalidStateFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s KMSInvalidStateFault) OrigErr() error { + return nil +} + +func (s KMSInvalidStateFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s KMSInvalidStateFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSInvalidStateFault) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS DMS cannot access the AWS KMS key. +type KMSKeyNotAccessibleFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s KMSKeyNotAccessibleFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KMSKeyNotAccessibleFault) GoString() string { + return s.String() +} + +func newErrorKMSKeyNotAccessibleFault(v protocol.ResponseMetadata) error { + return &KMSKeyNotAccessibleFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s KMSKeyNotAccessibleFault) Code() string { + return "KMSKeyNotAccessibleFault" +} + +// Message returns the exception's message. +func (s KMSKeyNotAccessibleFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s KMSKeyNotAccessibleFault) OrigErr() error { + return nil +} + +func (s KMSKeyNotAccessibleFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s KMSKeyNotAccessibleFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSKeyNotAccessibleFault) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified AWS KMS entity or resource can't be found. +type KMSNotFoundFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s KMSNotFoundFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KMSNotFoundFault) GoString() string { + return s.String() +} + +func newErrorKMSNotFoundFault(v protocol.ResponseMetadata) error { + return &KMSNotFoundFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s KMSNotFoundFault) Code() string { + return "KMSNotFoundFault" +} + +// Message returns the exception's message. +func (s KMSNotFoundFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s KMSNotFoundFault) OrigErr() error { + return nil +} + +func (s KMSNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s KMSNotFoundFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSNotFoundFault) RequestID() string { + return s.respMetadata.RequestID +} + +// This request triggered AWS KMS request throttling. +type KMSThrottlingFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s KMSThrottlingFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KMSThrottlingFault) GoString() string { + return s.String() +} + +func newErrorKMSThrottlingFault(v protocol.ResponseMetadata) error { + return &KMSThrottlingFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s KMSThrottlingFault) Code() string { + return "KMSThrottlingFault" +} + +// Message returns the exception's message. +func (s KMSThrottlingFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s KMSThrottlingFault) OrigErr() error { + return nil +} + +func (s KMSThrottlingFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s KMSThrottlingFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSThrottlingFault) RequestID() string { + return s.respMetadata.RequestID +} + +type KinesisSettings struct { + _ struct{} `type:"structure"` + + // The output format for the records created on the endpoint. The message format + // is JSON. + MessageFormat *string `type:"string" enum:"MessageFormatValue"` + + // The Amazon Resource Name (ARN) for the IAM role that DMS uses to write to + // the Amazon Kinesis data stream. + ServiceAccessRoleArn *string `type:"string"` + + // The Amazon Resource Name (ARN) for the Amazon Kinesis Data Streams endpoint. + StreamArn *string `type:"string"` +} + +// String returns the string representation +func (s KinesisSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KinesisSettings) GoString() string { + return s.String() +} + +// SetMessageFormat sets the MessageFormat field's value. +func (s *KinesisSettings) SetMessageFormat(v string) *KinesisSettings { + s.MessageFormat = &v + return s +} + +// SetServiceAccessRoleArn sets the ServiceAccessRoleArn field's value. +func (s *KinesisSettings) SetServiceAccessRoleArn(v string) *KinesisSettings { + s.ServiceAccessRoleArn = &v + return s +} + +// SetStreamArn sets the StreamArn field's value. +func (s *KinesisSettings) SetStreamArn(v string) *KinesisSettings { + s.StreamArn = &v + return s +} + +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 +} + +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // A list of tags for the resource. + 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 +} + +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 settings in JSON format for the DMS transfer type of source endpoint. + // + // Attributes include the following: + // + // * serviceAccessRoleArn - The IAM role that has permission to access the + // Amazon S3 bucket. + // + // * BucketName - The name of the S3 bucket to use. + // + // * compressionType - An optional parameter to use GZIP to compress the + // target files. Set to NONE (the default) or do not use to leave the files + // uncompressed. + // + // Shorthand syntax: ServiceAccessRoleArn=string ,BucketName=string,CompressionType=string + // + // JSON syntax: + // + // { "ServiceAccessRoleArn": "string", "BucketName": "string", "CompressionType": + // "none"|"gzip" } + DmsTransferSettings *DmsTransferSettings `type:"structure"` + + // Settings in JSON format for the target Amazon DynamoDB endpoint. For more + // information about the available settings, see Using Object Mapping to Migrate + // Data to DynamoDB (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.DynamoDB.html) + // in the AWS Database Migration Service User Guide. + DynamoDbSettings *DynamoDbSettings `type:"structure"` + + // Settings in JSON format for the target Elasticsearch endpoint. For more information + // about the available settings, see Extra Connection Attributes When Using + // Elasticsearch as a Target for AWS DMS (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Elasticsearch.html#CHAP_Target.Elasticsearch.Configuration) + // in the AWS Database Migration User Guide. + ElasticsearchSettings *ElasticsearchSettings `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 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. Valid values are source and target. + EndpointType *string `type:"string" enum:"ReplicationEndpointTypeValue"` + + // The type of engine for the endpoint. Valid values, depending on the EndpointType, + // include mysql, oracle, postgres, mariadb, aurora, aurora-postgresql, redshift, + // s3, db2, azuredb, sybase, dynamodb, mongodb, and sqlserver. + EngineName *string `type:"string"` + + // The external table definition. + ExternalTableDefinition *string `type:"string"` + + // Additional attributes associated with the connection. To reset this parameter, + // pass the empty string ("") as an argument. + ExtraConnectionAttributes *string `type:"string"` + + // Settings in JSON format for the target Amazon Kinesis Data Streams endpoint. + // For more information about the available settings, see Using Object Mapping + // to Migrate Data to a Kinesis Data Stream (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.Kinesis.html#CHAP_Target.Kinesis.ObjectMapping) + // in the AWS Database Migration User Guide. + KinesisSettings *KinesisSettings `type:"structure"` + + // Settings in JSON format for the source MongoDB endpoint. For more information + // about the available settings, see the configuration properties section in + // Using MongoDB as a Target for AWS Database Migration Service (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.MongoDB.html) + // in the AWS Database Migration Service User Guide. + MongoDbSettings *MongoDbSettings `type:"structure"` + + // The password to be used to login to the endpoint database. + Password *string `type:"string" sensitive:"true"` + + // The port used by the endpoint database. + Port *int64 `type:"integer"` + + RedshiftSettings *RedshiftSettings `type:"structure"` + + // Settings in JSON format for the target Amazon S3 endpoint. For more information + // about the available settings, see Extra Connection Attributes When Using + // Amazon S3 as a Target for AWS DMS (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.S3.html#CHAP_Target.S3.Configuring) + // in the AWS Database Migration Service User Guide. + S3Settings *S3Settings `type:"structure"` + + // The name of the server where the endpoint database resides. + ServerName *string `type:"string"` + + // The Amazon Resource Name (ARN) for the service access role you want to use + // to modify the endpoint. + ServiceAccessRoleArn *string `type:"string"` + + // The SSL mode used to connect to the endpoint. 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 s.DynamoDbSettings != nil { if err := s.DynamoDbSettings.Validate(); err != nil { @@ -10114,6 +10776,12 @@ type ModifyReplicationTaskInput struct { // Checkpoint Example: --cdc-start-position "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93" // // LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373” + // + // When you use this task setting with a source PostgreSQL database, a logical + // replication slot should already be created and associated with the source + // endpoint. You can verify this by setting the slotName extra connection attribute + // to the name of this logical replication slot. For more information, see Extra + // Connection Attributes When Using PostgreSQL as a Source for AWS DMS (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html#CHAP_Source.PostgreSQL.ConnectionAttrib). CdcStartPosition *string `type:"string"` // Indicates the start time for a change data capture (CDC) operation. Use either @@ -11634,16 +12302,73 @@ func (s *ReplicationSubnetGroup) SetSubnetGroupStatus(v string) *ReplicationSubn return s } -// SetSubnets sets the Subnets field's value. -func (s *ReplicationSubnetGroup) SetSubnets(v []*Subnet) *ReplicationSubnetGroup { - s.Subnets = 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 +} + +// The replication subnet group does not cover enough Availability Zones (AZs). +// Edit the replication subnet group and add more AZs. +type ReplicationSubnetGroupDoesNotCoverEnoughAZs struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ReplicationSubnetGroupDoesNotCoverEnoughAZs) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplicationSubnetGroupDoesNotCoverEnoughAZs) GoString() string { + return s.String() +} + +func newErrorReplicationSubnetGroupDoesNotCoverEnoughAZs(v protocol.ResponseMetadata) error { + return &ReplicationSubnetGroupDoesNotCoverEnoughAZs{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ReplicationSubnetGroupDoesNotCoverEnoughAZs) Code() string { + return "ReplicationSubnetGroupDoesNotCoverEnoughAZs" +} + +// Message returns the exception's message. +func (s ReplicationSubnetGroupDoesNotCoverEnoughAZs) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ReplicationSubnetGroupDoesNotCoverEnoughAZs) OrigErr() error { + return nil +} + +func (s ReplicationSubnetGroupDoesNotCoverEnoughAZs) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetVpcId sets the VpcId field's value. -func (s *ReplicationSubnetGroup) SetVpcId(v string) *ReplicationSubnetGroup { - s.VpcId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ReplicationSubnetGroupDoesNotCoverEnoughAZs) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ReplicationSubnetGroupDoesNotCoverEnoughAZs) RequestID() string { + return s.respMetadata.RequestID } type ReplicationTask struct { @@ -11925,9 +12650,26 @@ type ReplicationTaskStats struct { // The elapsed time of the task, in milliseconds. ElapsedTimeMillis *int64 `type:"long"` + // The date the replication task was started either with a fresh start or a + // target reload. + FreshStartDate *time.Time `type:"timestamp"` + + // The date the replication task full load was completed. + FullLoadFinishDate *time.Time `type:"timestamp"` + // The percent complete for the full load migration task. FullLoadProgressPercent *int64 `type:"integer"` + // The date the the replication task full load was started. + FullLoadStartDate *time.Time `type:"timestamp"` + + // The date the replication task was started either with a fresh start or a + // resume. For more information, see StartReplicationTaskType (https://docs.aws.amazon.com/dms/latest/APIReference/API_StartReplicationTask.html#DMS-StartReplicationTask-request-StartReplicationTaskType). + StartDate *time.Time `type:"timestamp"` + + // The date the replication task was stopped. + StopDate *time.Time `type:"timestamp"` + // The number of errors that have occurred during this task. TablesErrored *int64 `type:"integer"` @@ -11957,12 +12699,42 @@ func (s *ReplicationTaskStats) SetElapsedTimeMillis(v int64) *ReplicationTaskSta return s } +// SetFreshStartDate sets the FreshStartDate field's value. +func (s *ReplicationTaskStats) SetFreshStartDate(v time.Time) *ReplicationTaskStats { + s.FreshStartDate = &v + return s +} + +// SetFullLoadFinishDate sets the FullLoadFinishDate field's value. +func (s *ReplicationTaskStats) SetFullLoadFinishDate(v time.Time) *ReplicationTaskStats { + s.FullLoadFinishDate = &v + return s +} + // SetFullLoadProgressPercent sets the FullLoadProgressPercent field's value. func (s *ReplicationTaskStats) SetFullLoadProgressPercent(v int64) *ReplicationTaskStats { s.FullLoadProgressPercent = &v return s } +// SetFullLoadStartDate sets the FullLoadStartDate field's value. +func (s *ReplicationTaskStats) SetFullLoadStartDate(v time.Time) *ReplicationTaskStats { + s.FullLoadStartDate = &v + return s +} + +// SetStartDate sets the StartDate field's value. +func (s *ReplicationTaskStats) SetStartDate(v time.Time) *ReplicationTaskStats { + s.StartDate = &v + return s +} + +// SetStopDate sets the StopDate field's value. +func (s *ReplicationTaskStats) SetStopDate(v time.Time) *ReplicationTaskStats { + s.StopDate = &v + return s +} + // SetTablesErrored sets the TablesErrored field's value. func (s *ReplicationTaskStats) SetTablesErrored(v int64) *ReplicationTaskStats { s.TablesErrored = &v @@ -11987,6 +12759,120 @@ func (s *ReplicationTaskStats) SetTablesQueued(v int64) *ReplicationTaskStats { return s } +// The resource you are attempting to create already exists. +type ResourceAlreadyExistsFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + ResourceArn *string `locationName:"resourceArn" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsFault) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsFault(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsFault) Code() string { + return "ResourceAlreadyExistsFault" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsFault) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsFault) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource could not be found. +type ResourceNotFoundFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundFault) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundFault(v protocol.ResponseMetadata) error { + return &ResourceNotFoundFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundFault) Code() string { + return "ResourceNotFoundFault" +} + +// Message returns the exception's message. +func (s ResourceNotFoundFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundFault) OrigErr() error { + return nil +} + +func (s ResourceNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundFault) RequestID() string { + return s.respMetadata.RequestID +} + type ResourcePendingMaintenanceActions struct { _ struct{} `type:"structure"` @@ -12022,6 +12908,62 @@ func (s *ResourcePendingMaintenanceActions) SetResourceIdentifier(v string) *Res return s } +// The quota for this resource quota has been exceeded. +type ResourceQuotaExceededFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceQuotaExceededFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceQuotaExceededFault) GoString() string { + return s.String() +} + +func newErrorResourceQuotaExceededFault(v protocol.ResponseMetadata) error { + return &ResourceQuotaExceededFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceQuotaExceededFault) Code() string { + return "ResourceQuotaExceededFault" +} + +// Message returns the exception's message. +func (s ResourceQuotaExceededFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceQuotaExceededFault) OrigErr() error { + return nil +} + +func (s ResourceQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceQuotaExceededFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceQuotaExceededFault) RequestID() string { + return s.respMetadata.RequestID +} + // Settings for exporting data to Amazon S3. type S3Settings struct { _ struct{} `type:"structure"` @@ -12360,6 +13302,118 @@ func (s *S3Settings) SetTimestampColumnName(v string) *S3Settings { return s } +// The SNS topic is invalid. +type SNSInvalidTopicFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s SNSInvalidTopicFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SNSInvalidTopicFault) GoString() string { + return s.String() +} + +func newErrorSNSInvalidTopicFault(v protocol.ResponseMetadata) error { + return &SNSInvalidTopicFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SNSInvalidTopicFault) Code() string { + return "SNSInvalidTopicFault" +} + +// Message returns the exception's message. +func (s SNSInvalidTopicFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SNSInvalidTopicFault) OrigErr() error { + return nil +} + +func (s SNSInvalidTopicFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SNSInvalidTopicFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SNSInvalidTopicFault) RequestID() string { + return s.respMetadata.RequestID +} + +// You are not authorized for the SNS subscription. +type SNSNoAuthorizationFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s SNSNoAuthorizationFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SNSNoAuthorizationFault) GoString() string { + return s.String() +} + +func newErrorSNSNoAuthorizationFault(v protocol.ResponseMetadata) error { + return &SNSNoAuthorizationFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SNSNoAuthorizationFault) Code() string { + return "SNSNoAuthorizationFault" +} + +// Message returns the exception's message. +func (s SNSNoAuthorizationFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SNSNoAuthorizationFault) OrigErr() error { + return nil +} + +func (s SNSNoAuthorizationFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SNSNoAuthorizationFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SNSNoAuthorizationFault) RequestID() string { + return s.respMetadata.RequestID +} + type StartReplicationTaskAssessmentInput struct { _ struct{} `type:"structure"` @@ -12435,6 +13489,12 @@ type StartReplicationTaskInput struct { // Checkpoint Example: --cdc-start-position "checkpoint:V1#27#mysql-bin-changelog.157832:1975:-1:2002:677883278264080:mysql-bin-changelog.157832:1876#0#0#*#0#93" // // LSN Example: --cdc-start-position “mysql-bin-changelog.000024:373” + // + // When you use this task setting with a source PostgreSQL database, a logical + // replication slot should already be created and associated with the source + // endpoint. You can verify this by setting the slotName extra connection attribute + // to the name of this logical replication slot. For more information, see Extra + // Connection Attributes When Using PostgreSQL as a Source for AWS DMS (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Source.PostgreSQL.html#CHAP_Source.PostgreSQL.ConnectionAttrib). CdcStartPosition *string `type:"string"` // Indicates the start time for a change data capture (CDC) operation. Use either @@ -12604,6 +13664,62 @@ func (s *StopReplicationTaskOutput) SetReplicationTask(v *ReplicationTask) *Stop return s } +// The storage quota has been exceeded. +type StorageQuotaExceededFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s StorageQuotaExceededFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StorageQuotaExceededFault) GoString() string { + return s.String() +} + +func newErrorStorageQuotaExceededFault(v protocol.ResponseMetadata) error { + return &StorageQuotaExceededFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s StorageQuotaExceededFault) Code() string { + return "StorageQuotaExceededFault" +} + +// Message returns the exception's message. +func (s StorageQuotaExceededFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s StorageQuotaExceededFault) OrigErr() error { + return nil +} + +func (s StorageQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s StorageQuotaExceededFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s StorageQuotaExceededFault) RequestID() string { + return s.respMetadata.RequestID +} + type Subnet struct { _ struct{} `type:"structure"` @@ -12645,6 +13761,62 @@ func (s *Subnet) SetSubnetStatus(v string) *Subnet { return s } +// The specified subnet is already in use. +type SubnetAlreadyInUse struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s SubnetAlreadyInUse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SubnetAlreadyInUse) GoString() string { + return s.String() +} + +func newErrorSubnetAlreadyInUse(v protocol.ResponseMetadata) error { + return &SubnetAlreadyInUse{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SubnetAlreadyInUse) Code() string { + return "SubnetAlreadyInUse" +} + +// Message returns the exception's message. +func (s SubnetAlreadyInUse) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SubnetAlreadyInUse) OrigErr() error { + return nil +} + +func (s SubnetAlreadyInUse) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SubnetAlreadyInUse) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SubnetAlreadyInUse) RequestID() string { + return s.respMetadata.RequestID +} + type SupportedEndpointType struct { _ struct{} `type:"structure"` @@ -13031,6 +14203,62 @@ func (s *TestConnectionOutput) SetConnection(v *Connection) *TestConnectionOutpu return s } +// An upgrade dependency is preventing the database migration. +type UpgradeDependencyFailureFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UpgradeDependencyFailureFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpgradeDependencyFailureFault) GoString() string { + return s.String() +} + +func newErrorUpgradeDependencyFailureFault(v protocol.ResponseMetadata) error { + return &UpgradeDependencyFailureFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UpgradeDependencyFailureFault) Code() string { + return "UpgradeDependencyFailureFault" +} + +// Message returns the exception's message. +func (s UpgradeDependencyFailureFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UpgradeDependencyFailureFault) OrigErr() error { + return nil +} + +func (s UpgradeDependencyFailureFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UpgradeDependencyFailureFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UpgradeDependencyFailureFault) RequestID() string { + return s.respMetadata.RequestID +} + type VpcSecurityGroupMembership struct { _ struct{} `type:"structure"` 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 index 35ed259eb45..e2e32caf6f0 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/errors.go @@ -2,6 +2,10 @@ package databasemigrationservice +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccessDeniedFault for service response error code @@ -128,3 +132,26 @@ const ( // An upgrade dependency is preventing the database migration. ErrCodeUpgradeDependencyFailureFault = "UpgradeDependencyFailureFault" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedFault": newErrorAccessDeniedFault, + "InsufficientResourceCapacityFault": newErrorInsufficientResourceCapacityFault, + "InvalidCertificateFault": newErrorInvalidCertificateFault, + "InvalidResourceStateFault": newErrorInvalidResourceStateFault, + "InvalidSubnet": newErrorInvalidSubnet, + "KMSAccessDeniedFault": newErrorKMSAccessDeniedFault, + "KMSDisabledFault": newErrorKMSDisabledFault, + "KMSInvalidStateFault": newErrorKMSInvalidStateFault, + "KMSKeyNotAccessibleFault": newErrorKMSKeyNotAccessibleFault, + "KMSNotFoundFault": newErrorKMSNotFoundFault, + "KMSThrottlingFault": newErrorKMSThrottlingFault, + "ReplicationSubnetGroupDoesNotCoverEnoughAZs": newErrorReplicationSubnetGroupDoesNotCoverEnoughAZs, + "ResourceAlreadyExistsFault": newErrorResourceAlreadyExistsFault, + "ResourceNotFoundFault": newErrorResourceNotFoundFault, + "ResourceQuotaExceededFault": newErrorResourceQuotaExceededFault, + "SNSInvalidTopicFault": newErrorSNSInvalidTopicFault, + "SNSNoAuthorizationFault": newErrorSNSNoAuthorizationFault, + "StorageQuotaExceededFault": newErrorStorageQuotaExceededFault, + "SubnetAlreadyInUse": newErrorSubnetAlreadyInUse, + "UpgradeDependencyFailureFault": newErrorUpgradeDependencyFailureFault, +} 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 index 8ee775e03ca..fbb9d0055d0 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/databasemigrationservice/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "dms" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Database Migration Service" // ServiceID is a unique identifer of a specific service. + ServiceID = "Database Migration Service" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the DatabaseMigrationService client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a DatabaseMigrationService client from just a session. // svc := databasemigrationservice.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *DatabaseMigrationService { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *DatabaseMigrationService { svc := &DatabaseMigrationService{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-01-01", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/dataexchange/api.go b/vendor/github.com/aws/aws-sdk-go/service/dataexchange/api.go new file mode 100644 index 00000000000..c95c96bec5d --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/dataexchange/api.go @@ -0,0 +1,6725 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package dataexchange + +import ( + "fmt" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/restjson" +) + +const opCancelJob = "CancelJob" + +// CancelJobRequest generates a "aws/request.Request" representing the +// client's request for the CancelJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CancelJob for more information on using the CancelJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CancelJobRequest method. +// req, resp := client.CancelJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/CancelJob +func (c *DataExchange) CancelJobRequest(input *CancelJobInput) (req *request.Request, output *CancelJobOutput) { + op := &request.Operation{ + Name: opCancelJob, + HTTPMethod: "DELETE", + HTTPPath: "/v1/jobs/{JobId}", + } + + if input == nil { + input = &CancelJobInput{} + } + + output = &CancelJobOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// CancelJob API operation for AWS Data Exchange. +// +// This operation cancels a job. Jobs can be cancelled only when they are in +// the WAITING 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 Data Exchange's +// API operation CancelJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// * ConflictException +// The request couldn't be completed because it conflicted with the current +// state of the resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/CancelJob +func (c *DataExchange) CancelJob(input *CancelJobInput) (*CancelJobOutput, error) { + req, out := c.CancelJobRequest(input) + return out, req.Send() +} + +// CancelJobWithContext is the same as CancelJob with the addition of +// the ability to pass a context and additional request options. +// +// See CancelJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) CancelJobWithContext(ctx aws.Context, input *CancelJobInput, opts ...request.Option) (*CancelJobOutput, error) { + req, out := c.CancelJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateDataSet = "CreateDataSet" + +// CreateDataSetRequest generates a "aws/request.Request" representing the +// client's request for the CreateDataSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateDataSet for more information on using the CreateDataSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateDataSetRequest method. +// req, resp := client.CreateDataSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/CreateDataSet +func (c *DataExchange) CreateDataSetRequest(input *CreateDataSetInput) (req *request.Request, output *CreateDataSetOutput) { + op := &request.Operation{ + Name: opCreateDataSet, + HTTPMethod: "POST", + HTTPPath: "/v1/data-sets", + } + + if input == nil { + input = &CreateDataSetInput{} + } + + output = &CreateDataSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateDataSet API operation for AWS Data Exchange. +// +// This operation creates a data 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 Data Exchange's +// API operation CreateDataSet for usage and error information. +// +// Returned Error Types: +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// * ServiceLimitExceededException +// The request has exceeded the quotas imposed by the service. +// +// * AccessDeniedException +// Access to the resource is denied. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/CreateDataSet +func (c *DataExchange) CreateDataSet(input *CreateDataSetInput) (*CreateDataSetOutput, error) { + req, out := c.CreateDataSetRequest(input) + return out, req.Send() +} + +// CreateDataSetWithContext is the same as CreateDataSet with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDataSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) CreateDataSetWithContext(ctx aws.Context, input *CreateDataSetInput, opts ...request.Option) (*CreateDataSetOutput, error) { + req, out := c.CreateDataSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateJob = "CreateJob" + +// CreateJobRequest generates a "aws/request.Request" representing the +// client's request for the CreateJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateJob for more information on using the CreateJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateJobRequest method. +// req, resp := client.CreateJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/CreateJob +func (c *DataExchange) CreateJobRequest(input *CreateJobInput) (req *request.Request, output *CreateJobOutput) { + op := &request.Operation{ + Name: opCreateJob, + HTTPMethod: "POST", + HTTPPath: "/v1/jobs", + } + + if input == nil { + input = &CreateJobInput{} + } + + output = &CreateJobOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateJob API operation for AWS Data Exchange. +// +// This operation creates 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 AWS Data Exchange's +// API operation CreateJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// * AccessDeniedException +// Access to the resource is denied. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/CreateJob +func (c *DataExchange) CreateJob(input *CreateJobInput) (*CreateJobOutput, error) { + req, out := c.CreateJobRequest(input) + return out, req.Send() +} + +// CreateJobWithContext is the same as CreateJob with the addition of +// the ability to pass a context and additional request options. +// +// See CreateJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) CreateJobWithContext(ctx aws.Context, input *CreateJobInput, opts ...request.Option) (*CreateJobOutput, error) { + req, out := c.CreateJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateRevision = "CreateRevision" + +// CreateRevisionRequest generates a "aws/request.Request" representing the +// client's request for the CreateRevision operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateRevision for more information on using the CreateRevision +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateRevisionRequest method. +// req, resp := client.CreateRevisionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/CreateRevision +func (c *DataExchange) CreateRevisionRequest(input *CreateRevisionInput) (req *request.Request, output *CreateRevisionOutput) { + op := &request.Operation{ + Name: opCreateRevision, + HTTPMethod: "POST", + HTTPPath: "/v1/data-sets/{DataSetId}/revisions", + } + + if input == nil { + input = &CreateRevisionInput{} + } + + output = &CreateRevisionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateRevision API operation for AWS Data Exchange. +// +// This operation creates a revision for a data 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 Data Exchange's +// API operation CreateRevision for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// * AccessDeniedException +// Access to the resource is denied. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/CreateRevision +func (c *DataExchange) CreateRevision(input *CreateRevisionInput) (*CreateRevisionOutput, error) { + req, out := c.CreateRevisionRequest(input) + return out, req.Send() +} + +// CreateRevisionWithContext is the same as CreateRevision with the addition of +// the ability to pass a context and additional request options. +// +// See CreateRevision for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) CreateRevisionWithContext(ctx aws.Context, input *CreateRevisionInput, opts ...request.Option) (*CreateRevisionOutput, error) { + req, out := c.CreateRevisionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteAsset = "DeleteAsset" + +// DeleteAssetRequest generates a "aws/request.Request" representing the +// client's request for the DeleteAsset operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteAsset for more information on using the DeleteAsset +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteAssetRequest method. +// req, resp := client.DeleteAssetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/DeleteAsset +func (c *DataExchange) DeleteAssetRequest(input *DeleteAssetInput) (req *request.Request, output *DeleteAssetOutput) { + op := &request.Operation{ + Name: opDeleteAsset, + HTTPMethod: "DELETE", + HTTPPath: "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets/{AssetId}", + } + + if input == nil { + input = &DeleteAssetInput{} + } + + output = &DeleteAssetOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteAsset API operation for AWS Data Exchange. +// +// This operation deletes an asset. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Data Exchange's +// API operation DeleteAsset for usage and error information. +// +// Returned Error Types: +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// * AccessDeniedException +// Access to the resource is denied. +// +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ConflictException +// The request couldn't be completed because it conflicted with the current +// state of the resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/DeleteAsset +func (c *DataExchange) DeleteAsset(input *DeleteAssetInput) (*DeleteAssetOutput, error) { + req, out := c.DeleteAssetRequest(input) + return out, req.Send() +} + +// DeleteAssetWithContext is the same as DeleteAsset with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAsset for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) DeleteAssetWithContext(ctx aws.Context, input *DeleteAssetInput, opts ...request.Option) (*DeleteAssetOutput, error) { + req, out := c.DeleteAssetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteDataSet = "DeleteDataSet" + +// DeleteDataSetRequest generates a "aws/request.Request" representing the +// client's request for the DeleteDataSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteDataSet for more information on using the DeleteDataSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteDataSetRequest method. +// req, resp := client.DeleteDataSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/DeleteDataSet +func (c *DataExchange) DeleteDataSetRequest(input *DeleteDataSetInput) (req *request.Request, output *DeleteDataSetOutput) { + op := &request.Operation{ + Name: opDeleteDataSet, + HTTPMethod: "DELETE", + HTTPPath: "/v1/data-sets/{DataSetId}", + } + + if input == nil { + input = &DeleteDataSetInput{} + } + + output = &DeleteDataSetOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteDataSet API operation for AWS Data Exchange. +// +// This operation deletes a data 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 Data Exchange's +// API operation DeleteDataSet for usage and error information. +// +// Returned Error Types: +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// * AccessDeniedException +// Access to the resource is denied. +// +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ConflictException +// The request couldn't be completed because it conflicted with the current +// state of the resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/DeleteDataSet +func (c *DataExchange) DeleteDataSet(input *DeleteDataSetInput) (*DeleteDataSetOutput, error) { + req, out := c.DeleteDataSetRequest(input) + return out, req.Send() +} + +// DeleteDataSetWithContext is the same as DeleteDataSet with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDataSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) DeleteDataSetWithContext(ctx aws.Context, input *DeleteDataSetInput, opts ...request.Option) (*DeleteDataSetOutput, error) { + req, out := c.DeleteDataSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteRevision = "DeleteRevision" + +// DeleteRevisionRequest generates a "aws/request.Request" representing the +// client's request for the DeleteRevision operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteRevision for more information on using the DeleteRevision +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteRevisionRequest method. +// req, resp := client.DeleteRevisionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/DeleteRevision +func (c *DataExchange) DeleteRevisionRequest(input *DeleteRevisionInput) (req *request.Request, output *DeleteRevisionOutput) { + op := &request.Operation{ + Name: opDeleteRevision, + HTTPMethod: "DELETE", + HTTPPath: "/v1/data-sets/{DataSetId}/revisions/{RevisionId}", + } + + if input == nil { + input = &DeleteRevisionInput{} + } + + output = &DeleteRevisionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteRevision API operation for AWS Data Exchange. +// +// This operation deletes a 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 Data Exchange's +// API operation DeleteRevision for usage and error information. +// +// Returned Error Types: +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// * AccessDeniedException +// Access to the resource is denied. +// +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ConflictException +// The request couldn't be completed because it conflicted with the current +// state of the resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/DeleteRevision +func (c *DataExchange) DeleteRevision(input *DeleteRevisionInput) (*DeleteRevisionOutput, error) { + req, out := c.DeleteRevisionRequest(input) + return out, req.Send() +} + +// DeleteRevisionWithContext is the same as DeleteRevision with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRevision for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) DeleteRevisionWithContext(ctx aws.Context, input *DeleteRevisionInput, opts ...request.Option) (*DeleteRevisionOutput, error) { + req, out := c.DeleteRevisionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetAsset = "GetAsset" + +// GetAssetRequest generates a "aws/request.Request" representing the +// client's request for the GetAsset operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetAsset for more information on using the GetAsset +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetAssetRequest method. +// req, resp := client.GetAssetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/GetAsset +func (c *DataExchange) GetAssetRequest(input *GetAssetInput) (req *request.Request, output *GetAssetOutput) { + op := &request.Operation{ + Name: opGetAsset, + HTTPMethod: "GET", + HTTPPath: "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets/{AssetId}", + } + + if input == nil { + input = &GetAssetInput{} + } + + output = &GetAssetOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetAsset API operation for AWS Data Exchange. +// +// This operation returns information about an asset. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Data Exchange's +// API operation GetAsset for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/GetAsset +func (c *DataExchange) GetAsset(input *GetAssetInput) (*GetAssetOutput, error) { + req, out := c.GetAssetRequest(input) + return out, req.Send() +} + +// GetAssetWithContext is the same as GetAsset with the addition of +// the ability to pass a context and additional request options. +// +// See GetAsset for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) GetAssetWithContext(ctx aws.Context, input *GetAssetInput, opts ...request.Option) (*GetAssetOutput, error) { + req, out := c.GetAssetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetDataSet = "GetDataSet" + +// GetDataSetRequest generates a "aws/request.Request" representing the +// client's request for the GetDataSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetDataSet for more information on using the GetDataSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetDataSetRequest method. +// req, resp := client.GetDataSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/GetDataSet +func (c *DataExchange) GetDataSetRequest(input *GetDataSetInput) (req *request.Request, output *GetDataSetOutput) { + op := &request.Operation{ + Name: opGetDataSet, + HTTPMethod: "GET", + HTTPPath: "/v1/data-sets/{DataSetId}", + } + + if input == nil { + input = &GetDataSetInput{} + } + + output = &GetDataSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetDataSet API operation for AWS Data Exchange. +// +// This operation returns information about a data 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 Data Exchange's +// API operation GetDataSet for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/GetDataSet +func (c *DataExchange) GetDataSet(input *GetDataSetInput) (*GetDataSetOutput, error) { + req, out := c.GetDataSetRequest(input) + return out, req.Send() +} + +// GetDataSetWithContext is the same as GetDataSet with the addition of +// the ability to pass a context and additional request options. +// +// See GetDataSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) GetDataSetWithContext(ctx aws.Context, input *GetDataSetInput, opts ...request.Option) (*GetDataSetOutput, error) { + req, out := c.GetDataSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetJob = "GetJob" + +// GetJobRequest generates a "aws/request.Request" representing the +// client's request for the GetJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetJob for more information on using the GetJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetJobRequest method. +// req, resp := client.GetJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/GetJob +func (c *DataExchange) GetJobRequest(input *GetJobInput) (req *request.Request, output *GetJobOutput) { + op := &request.Operation{ + Name: opGetJob, + HTTPMethod: "GET", + HTTPPath: "/v1/jobs/{JobId}", + } + + if input == nil { + input = &GetJobInput{} + } + + output = &GetJobOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetJob API operation for AWS Data Exchange. +// +// This operation returns 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 AWS Data Exchange's +// API operation GetJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/GetJob +func (c *DataExchange) GetJob(input *GetJobInput) (*GetJobOutput, error) { + req, out := c.GetJobRequest(input) + return out, req.Send() +} + +// GetJobWithContext is the same as GetJob with the addition of +// the ability to pass a context and additional request options. +// +// See GetJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) GetJobWithContext(ctx aws.Context, input *GetJobInput, opts ...request.Option) (*GetJobOutput, error) { + req, out := c.GetJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetRevision = "GetRevision" + +// GetRevisionRequest generates a "aws/request.Request" representing the +// client's request for the GetRevision operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetRevision for more information on using the GetRevision +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetRevisionRequest method. +// req, resp := client.GetRevisionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/GetRevision +func (c *DataExchange) GetRevisionRequest(input *GetRevisionInput) (req *request.Request, output *GetRevisionOutput) { + op := &request.Operation{ + Name: opGetRevision, + HTTPMethod: "GET", + HTTPPath: "/v1/data-sets/{DataSetId}/revisions/{RevisionId}", + } + + if input == nil { + input = &GetRevisionInput{} + } + + output = &GetRevisionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetRevision API operation for AWS Data Exchange. +// +// This operation returns information about a 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 Data Exchange's +// API operation GetRevision for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/GetRevision +func (c *DataExchange) GetRevision(input *GetRevisionInput) (*GetRevisionOutput, error) { + req, out := c.GetRevisionRequest(input) + return out, req.Send() +} + +// GetRevisionWithContext is the same as GetRevision with the addition of +// the ability to pass a context and additional request options. +// +// See GetRevision for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) GetRevisionWithContext(ctx aws.Context, input *GetRevisionInput, opts ...request.Option) (*GetRevisionOutput, error) { + req, out := c.GetRevisionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListDataSetRevisions = "ListDataSetRevisions" + +// ListDataSetRevisionsRequest generates a "aws/request.Request" representing the +// client's request for the ListDataSetRevisions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListDataSetRevisions for more information on using the ListDataSetRevisions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListDataSetRevisionsRequest method. +// req, resp := client.ListDataSetRevisionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/ListDataSetRevisions +func (c *DataExchange) ListDataSetRevisionsRequest(input *ListDataSetRevisionsInput) (req *request.Request, output *ListDataSetRevisionsOutput) { + op := &request.Operation{ + Name: opListDataSetRevisions, + HTTPMethod: "GET", + HTTPPath: "/v1/data-sets/{DataSetId}/revisions", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListDataSetRevisionsInput{} + } + + output = &ListDataSetRevisionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListDataSetRevisions API operation for AWS Data Exchange. +// +// This operation lists a data set's revisions sorted by CreatedAt in descending +// 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 Data Exchange's +// API operation ListDataSetRevisions for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/ListDataSetRevisions +func (c *DataExchange) ListDataSetRevisions(input *ListDataSetRevisionsInput) (*ListDataSetRevisionsOutput, error) { + req, out := c.ListDataSetRevisionsRequest(input) + return out, req.Send() +} + +// ListDataSetRevisionsWithContext is the same as ListDataSetRevisions with the addition of +// the ability to pass a context and additional request options. +// +// See ListDataSetRevisions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) ListDataSetRevisionsWithContext(ctx aws.Context, input *ListDataSetRevisionsInput, opts ...request.Option) (*ListDataSetRevisionsOutput, error) { + req, out := c.ListDataSetRevisionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListDataSetRevisionsPages iterates over the pages of a ListDataSetRevisions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListDataSetRevisions 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 ListDataSetRevisions operation. +// pageNum := 0 +// err := client.ListDataSetRevisionsPages(params, +// func(page *dataexchange.ListDataSetRevisionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *DataExchange) ListDataSetRevisionsPages(input *ListDataSetRevisionsInput, fn func(*ListDataSetRevisionsOutput, bool) bool) error { + return c.ListDataSetRevisionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListDataSetRevisionsPagesWithContext same as ListDataSetRevisionsPages 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 *DataExchange) ListDataSetRevisionsPagesWithContext(ctx aws.Context, input *ListDataSetRevisionsInput, fn func(*ListDataSetRevisionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDataSetRevisionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDataSetRevisionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListDataSetRevisionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListDataSets = "ListDataSets" + +// ListDataSetsRequest generates a "aws/request.Request" representing the +// client's request for the ListDataSets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListDataSets for more information on using the ListDataSets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListDataSetsRequest method. +// req, resp := client.ListDataSetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/ListDataSets +func (c *DataExchange) ListDataSetsRequest(input *ListDataSetsInput) (req *request.Request, output *ListDataSetsOutput) { + op := &request.Operation{ + Name: opListDataSets, + HTTPMethod: "GET", + HTTPPath: "/v1/data-sets", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListDataSetsInput{} + } + + output = &ListDataSetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListDataSets API operation for AWS Data Exchange. +// +// This operation lists your data sets. When listing by origin OWNED, results +// are sorted by CreatedAt in descending order. When listing by origin ENTITLED, +// there is no order and the maxResults parameter 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 AWS Data Exchange's +// API operation ListDataSets for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/ListDataSets +func (c *DataExchange) ListDataSets(input *ListDataSetsInput) (*ListDataSetsOutput, error) { + req, out := c.ListDataSetsRequest(input) + return out, req.Send() +} + +// ListDataSetsWithContext is the same as ListDataSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListDataSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) ListDataSetsWithContext(ctx aws.Context, input *ListDataSetsInput, opts ...request.Option) (*ListDataSetsOutput, error) { + req, out := c.ListDataSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListDataSetsPages iterates over the pages of a ListDataSets operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListDataSets 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 ListDataSets operation. +// pageNum := 0 +// err := client.ListDataSetsPages(params, +// func(page *dataexchange.ListDataSetsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *DataExchange) ListDataSetsPages(input *ListDataSetsInput, fn func(*ListDataSetsOutput, bool) bool) error { + return c.ListDataSetsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListDataSetsPagesWithContext same as ListDataSetsPages 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 *DataExchange) ListDataSetsPagesWithContext(ctx aws.Context, input *ListDataSetsInput, fn func(*ListDataSetsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDataSetsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDataSetsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListDataSetsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListJobs = "ListJobs" + +// ListJobsRequest generates a "aws/request.Request" representing the +// client's request for the ListJobs operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListJobs for more information on using the ListJobs +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListJobsRequest method. +// req, resp := client.ListJobsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/ListJobs +func (c *DataExchange) ListJobsRequest(input *ListJobsInput) (req *request.Request, output *ListJobsOutput) { + op := &request.Operation{ + Name: opListJobs, + HTTPMethod: "GET", + HTTPPath: "/v1/jobs", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListJobsInput{} + } + + output = &ListJobsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListJobs API operation for AWS Data Exchange. +// +// This operation lists your jobs sorted by CreatedAt in descending 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 Data Exchange's +// API operation ListJobs for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/ListJobs +func (c *DataExchange) ListJobs(input *ListJobsInput) (*ListJobsOutput, error) { + req, out := c.ListJobsRequest(input) + return out, req.Send() +} + +// ListJobsWithContext is the same as ListJobs with the addition of +// the ability to pass a context and additional request options. +// +// See ListJobs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) ListJobsWithContext(ctx aws.Context, input *ListJobsInput, opts ...request.Option) (*ListJobsOutput, error) { + req, out := c.ListJobsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// 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 *dataexchange.ListJobsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *DataExchange) ListJobsPages(input *ListJobsInput, fn func(*ListJobsOutput, bool) bool) error { + return c.ListJobsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListJobsPagesWithContext same as ListJobsPages 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 *DataExchange) ListJobsPagesWithContext(ctx aws.Context, input *ListJobsInput, fn func(*ListJobsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListJobsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListJobsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListRevisionAssets = "ListRevisionAssets" + +// ListRevisionAssetsRequest generates a "aws/request.Request" representing the +// client's request for the ListRevisionAssets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListRevisionAssets for more information on using the ListRevisionAssets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListRevisionAssetsRequest method. +// req, resp := client.ListRevisionAssetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/ListRevisionAssets +func (c *DataExchange) ListRevisionAssetsRequest(input *ListRevisionAssetsInput) (req *request.Request, output *ListRevisionAssetsOutput) { + op := &request.Operation{ + Name: opListRevisionAssets, + HTTPMethod: "GET", + HTTPPath: "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListRevisionAssetsInput{} + } + + output = &ListRevisionAssetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListRevisionAssets API operation for AWS Data Exchange. +// +// This operation lists a revision's assets sorted alphabetically in descending +// 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 Data Exchange's +// API operation ListRevisionAssets for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/ListRevisionAssets +func (c *DataExchange) ListRevisionAssets(input *ListRevisionAssetsInput) (*ListRevisionAssetsOutput, error) { + req, out := c.ListRevisionAssetsRequest(input) + return out, req.Send() +} + +// ListRevisionAssetsWithContext is the same as ListRevisionAssets with the addition of +// the ability to pass a context and additional request options. +// +// See ListRevisionAssets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) ListRevisionAssetsWithContext(ctx aws.Context, input *ListRevisionAssetsInput, opts ...request.Option) (*ListRevisionAssetsOutput, error) { + req, out := c.ListRevisionAssetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListRevisionAssetsPages iterates over the pages of a ListRevisionAssets operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListRevisionAssets 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 ListRevisionAssets operation. +// pageNum := 0 +// err := client.ListRevisionAssetsPages(params, +// func(page *dataexchange.ListRevisionAssetsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *DataExchange) ListRevisionAssetsPages(input *ListRevisionAssetsInput, fn func(*ListRevisionAssetsOutput, bool) bool) error { + return c.ListRevisionAssetsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListRevisionAssetsPagesWithContext same as ListRevisionAssetsPages 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 *DataExchange) ListRevisionAssetsPagesWithContext(ctx aws.Context, input *ListRevisionAssetsInput, fn func(*ListRevisionAssetsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListRevisionAssetsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListRevisionAssetsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListRevisionAssetsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/ListTagsForResource +func (c *DataExchange) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { + op := &request.Operation{ + Name: opListTagsForResource, + HTTPMethod: "GET", + HTTPPath: "/tags/{resource-arn}", + } + + if input == nil { + input = &ListTagsForResourceInput{} + } + + output = &ListTagsForResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTagsForResource API operation for AWS Data Exchange. +// +// This operation lists the tags on the 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 Data Exchange's +// API operation ListTagsForResource for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/ListTagsForResource +func (c *DataExchange) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartJob = "StartJob" + +// StartJobRequest generates a "aws/request.Request" representing the +// client's request for the StartJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartJob for more information on using the StartJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartJobRequest method. +// req, resp := client.StartJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/StartJob +func (c *DataExchange) StartJobRequest(input *StartJobInput) (req *request.Request, output *StartJobOutput) { + op := &request.Operation{ + Name: opStartJob, + HTTPMethod: "PATCH", + HTTPPath: "/v1/jobs/{JobId}", + } + + if input == nil { + input = &StartJobInput{} + } + + output = &StartJobOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StartJob API operation for AWS Data Exchange. +// +// This operation starts 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 AWS Data Exchange's +// API operation StartJob for usage and error information. +// +// Returned Error Types: +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// * AccessDeniedException +// Access to the resource is denied. +// +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ConflictException +// The request couldn't be completed because it conflicted with the current +// state of the resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/StartJob +func (c *DataExchange) StartJob(input *StartJobInput) (*StartJobOutput, error) { + req, out := c.StartJobRequest(input) + return out, req.Send() +} + +// StartJobWithContext is the same as StartJob with the addition of +// the ability to pass a context and additional request options. +// +// See StartJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) StartJobWithContext(ctx aws.Context, input *StartJobInput, opts ...request.Option) (*StartJobOutput, error) { + req, out := c.StartJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/TagResource +func (c *DataExchange) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { + op := &request.Operation{ + Name: opTagResource, + HTTPMethod: "POST", + HTTPPath: "/tags/{resource-arn}", + } + + if input == nil { + input = &TagResourceInput{} + } + + output = &TagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for AWS Data Exchange. +// +// This operation tags 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 AWS Data Exchange's +// API operation TagResource for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/TagResource +func (c *DataExchange) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/UntagResource +func (c *DataExchange) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { + op := &request.Operation{ + Name: opUntagResource, + HTTPMethod: "DELETE", + HTTPPath: "/tags/{resource-arn}", + } + + if input == nil { + input = &UntagResourceInput{} + } + + output = &UntagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for AWS Data Exchange. +// +// This operation removes one or more tags from 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 AWS Data Exchange's +// API operation UntagResource for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/UntagResource +func (c *DataExchange) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateAsset = "UpdateAsset" + +// UpdateAssetRequest generates a "aws/request.Request" representing the +// client's request for the UpdateAsset operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateAsset for more information on using the UpdateAsset +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateAssetRequest method. +// req, resp := client.UpdateAssetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/UpdateAsset +func (c *DataExchange) UpdateAssetRequest(input *UpdateAssetInput) (req *request.Request, output *UpdateAssetOutput) { + op := &request.Operation{ + Name: opUpdateAsset, + HTTPMethod: "PATCH", + HTTPPath: "/v1/data-sets/{DataSetId}/revisions/{RevisionId}/assets/{AssetId}", + } + + if input == nil { + input = &UpdateAssetInput{} + } + + output = &UpdateAssetOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateAsset API operation for AWS Data Exchange. +// +// This operation updates an asset. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Data Exchange's +// API operation UpdateAsset for usage and error information. +// +// Returned Error Types: +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// * AccessDeniedException +// Access to the resource is denied. +// +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ConflictException +// The request couldn't be completed because it conflicted with the current +// state of the resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/UpdateAsset +func (c *DataExchange) UpdateAsset(input *UpdateAssetInput) (*UpdateAssetOutput, error) { + req, out := c.UpdateAssetRequest(input) + return out, req.Send() +} + +// UpdateAssetWithContext is the same as UpdateAsset with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAsset for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) UpdateAssetWithContext(ctx aws.Context, input *UpdateAssetInput, opts ...request.Option) (*UpdateAssetOutput, error) { + req, out := c.UpdateAssetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateDataSet = "UpdateDataSet" + +// UpdateDataSetRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDataSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateDataSet for more information on using the UpdateDataSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateDataSetRequest method. +// req, resp := client.UpdateDataSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/UpdateDataSet +func (c *DataExchange) UpdateDataSetRequest(input *UpdateDataSetInput) (req *request.Request, output *UpdateDataSetOutput) { + op := &request.Operation{ + Name: opUpdateDataSet, + HTTPMethod: "PATCH", + HTTPPath: "/v1/data-sets/{DataSetId}", + } + + if input == nil { + input = &UpdateDataSetInput{} + } + + output = &UpdateDataSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateDataSet API operation for AWS Data Exchange. +// +// This operation updates a data 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 Data Exchange's +// API operation UpdateDataSet for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// * AccessDeniedException +// Access to the resource is denied. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/UpdateDataSet +func (c *DataExchange) UpdateDataSet(input *UpdateDataSetInput) (*UpdateDataSetOutput, error) { + req, out := c.UpdateDataSetRequest(input) + return out, req.Send() +} + +// UpdateDataSetWithContext is the same as UpdateDataSet with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDataSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) UpdateDataSetWithContext(ctx aws.Context, input *UpdateDataSetInput, opts ...request.Option) (*UpdateDataSetOutput, error) { + req, out := c.UpdateDataSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateRevision = "UpdateRevision" + +// UpdateRevisionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateRevision operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateRevision for more information on using the UpdateRevision +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateRevisionRequest method. +// req, resp := client.UpdateRevisionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/UpdateRevision +func (c *DataExchange) UpdateRevisionRequest(input *UpdateRevisionInput) (req *request.Request, output *UpdateRevisionOutput) { + op := &request.Operation{ + Name: opUpdateRevision, + HTTPMethod: "PATCH", + HTTPPath: "/v1/data-sets/{DataSetId}/revisions/{RevisionId}", + } + + if input == nil { + input = &UpdateRevisionInput{} + } + + output = &UpdateRevisionOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateRevision API operation for AWS Data Exchange. +// +// This operation updates a 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 Data Exchange's +// API operation UpdateRevision for usage and error information. +// +// Returned Error Types: +// * ValidationException +// The request was invalid. +// +// * InternalServerException +// An exception occurred with the service. +// +// * AccessDeniedException +// Access to the resource is denied. +// +// * ResourceNotFoundException +// The resource couldn't be found. +// +// * ThrottlingException +// The limit on the number of requests per second was exceeded. +// +// * ConflictException +// The request couldn't be completed because it conflicted with the current +// state of the resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25/UpdateRevision +func (c *DataExchange) UpdateRevision(input *UpdateRevisionInput) (*UpdateRevisionOutput, error) { + req, out := c.UpdateRevisionRequest(input) + return out, req.Send() +} + +// UpdateRevisionWithContext is the same as UpdateRevision with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateRevision for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataExchange) UpdateRevisionWithContext(ctx aws.Context, input *UpdateRevisionInput, opts ...request.Option) (*UpdateRevisionOutput, error) { + req, out := c.UpdateRevisionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Access to the resource is denied. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Access to the resource is denied. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The destination for the asset. +type AssetDestinationEntry struct { + _ struct{} `type:"structure"` + + // The unique identifier for the asset. + // + // AssetId is a required field + AssetId *string `type:"string" required:"true"` + + // The S3 bucket that is the destination for the asset. + // + // Bucket is a required field + Bucket *string `type:"string" required:"true"` + + // The name of the object in Amazon S3 for the asset. + Key *string `type:"string"` +} + +// String returns the string representation +func (s AssetDestinationEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssetDestinationEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssetDestinationEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssetDestinationEntry"} + if s.AssetId == nil { + invalidParams.Add(request.NewErrParamRequired("AssetId")) + } + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssetId sets the AssetId field's value. +func (s *AssetDestinationEntry) SetAssetId(v string) *AssetDestinationEntry { + s.AssetId = &v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *AssetDestinationEntry) SetBucket(v string) *AssetDestinationEntry { + s.Bucket = &v + return s +} + +// SetKey sets the Key field's value. +func (s *AssetDestinationEntry) SetKey(v string) *AssetDestinationEntry { + s.Key = &v + return s +} + +type AssetDetails struct { + _ struct{} `type:"structure"` + + // The S3 object that is the asset. + S3SnapshotAsset *S3SnapshotAsset `type:"structure"` +} + +// String returns the string representation +func (s AssetDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssetDetails) GoString() string { + return s.String() +} + +// SetS3SnapshotAsset sets the S3SnapshotAsset field's value. +func (s *AssetDetails) SetS3SnapshotAsset(v *S3SnapshotAsset) *AssetDetails { + s.S3SnapshotAsset = v + return s +} + +// An asset in AWS Data Exchange is a piece of data that can be stored as an +// S3 object. The asset can be a structured data file, an image file, or some +// other data file. When you create an import job for your files, you create +// an asset in AWS Data Exchange for each of those files. +type AssetEntry struct { + _ struct{} `type:"structure"` + + // The ARN for the asset. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // Information about the asset, including its size. + // + // AssetDetails is a required field + AssetDetails *AssetDetails `type:"structure" required:"true"` + + // The type of file your data is stored in. Currently, the supported asset type + // is S3_SNAPSHOT. + // + // AssetType is a required field + AssetType *string `type:"string" required:"true" enum:"AssetType"` + + // The date and time that the asset was created, in ISO 8601 format. + // + // CreatedAt is a required field + CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // The unique identifier for the data set associated with this asset. + // + // DataSetId is a required field + DataSetId *string `type:"string" required:"true"` + + // The unique identifier for the asset. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // The name of the asset. When importing from Amazon S3, the S3 object key is + // used as the asset name. When exporting to Amazon S3, the asset name is used + // as default target S3 object key. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // The unique identifier for the revision associated with this asset. + // + // RevisionId is a required field + RevisionId *string `type:"string" required:"true"` + + // The asset ID of the owned asset corresponding to the entitled asset being + // viewed. This parameter is returned when an asset owner is viewing the entitled + // copy of its owned asset. + SourceId *string `type:"string"` + + // The date and time that the asset was last updated, in ISO 8601 format. + // + // UpdatedAt is a required field + UpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` +} + +// String returns the string representation +func (s AssetEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssetEntry) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *AssetEntry) SetArn(v string) *AssetEntry { + s.Arn = &v + return s +} + +// SetAssetDetails sets the AssetDetails field's value. +func (s *AssetEntry) SetAssetDetails(v *AssetDetails) *AssetEntry { + s.AssetDetails = v + return s +} + +// SetAssetType sets the AssetType field's value. +func (s *AssetEntry) SetAssetType(v string) *AssetEntry { + s.AssetType = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *AssetEntry) SetCreatedAt(v time.Time) *AssetEntry { + s.CreatedAt = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *AssetEntry) SetDataSetId(v string) *AssetEntry { + s.DataSetId = &v + return s +} + +// SetId sets the Id field's value. +func (s *AssetEntry) SetId(v string) *AssetEntry { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *AssetEntry) SetName(v string) *AssetEntry { + s.Name = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *AssetEntry) SetRevisionId(v string) *AssetEntry { + s.RevisionId = &v + return s +} + +// SetSourceId sets the SourceId field's value. +func (s *AssetEntry) SetSourceId(v string) *AssetEntry { + s.SourceId = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *AssetEntry) SetUpdatedAt(v time.Time) *AssetEntry { + s.UpdatedAt = &v + return s +} + +// The source of the assets. +type AssetSourceEntry struct { + _ struct{} `type:"structure"` + + // The S3 bucket that's part of the source of the asset. + // + // Bucket is a required field + Bucket *string `type:"string" required:"true"` + + // The name of the object in Amazon S3 for the asset. + // + // Key is a required field + Key *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AssetSourceEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssetSourceEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssetSourceEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssetSourceEntry"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *AssetSourceEntry) SetBucket(v string) *AssetSourceEntry { + s.Bucket = &v + return s +} + +// SetKey sets the Key field's value. +func (s *AssetSourceEntry) SetKey(v string) *AssetSourceEntry { + s.Key = &v + return s +} + +type CancelJobInput struct { + _ struct{} `type:"structure"` + + // JobId is a required field + JobId *string `location:"uri" locationName:"JobId" 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.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 +} + +// SetJobId sets the JobId field's value. +func (s *CancelJobInput) SetJobId(v string) *CancelJobInput { + s.JobId = &v + return s +} + +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 request couldn't be completed because it conflicted with the current +// state of the resource. +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The request couldn't be completed because it conflicted with the current + // state of the resource. + Message_ *string `locationName:"Message" type:"string"` + + // The unique identifier for the resource with the conflict. + ResourceId *string `type:"string"` + + // The type of the resource with the conflict. + ResourceType *string `type:"string" enum:"ResourceType"` +} + +// String returns the string representation +func (s ConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictException) GoString() string { + return s.String() +} + +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" +} + +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil +} + +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID +} + +// A request to create a data set that contains one or more revisions. +type CreateDataSetInput struct { + _ struct{} `type:"structure"` + + // The type of file your data is stored in. Currently, the supported asset type + // is S3_SNAPSHOT. + // + // AssetType is a required field + AssetType *string `type:"string" required:"true" enum:"AssetType"` + + // A description for the data set. This value can be up to 16,348 characters + // long. + // + // Description is a required field + Description *string `type:"string" required:"true"` + + // The name of the data set. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // A data set tag is an optional label that you can assign to a data set when + // you create it. Each tag consists of a key and an optional value, both of + // which you define. When you use tagging, you can also use tag-based access + // control in IAM policies to control access to these data sets and revisions. + Tags map[string]*string `type:"map"` +} + +// String returns the string representation +func (s CreateDataSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDataSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateDataSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateDataSetInput"} + if s.AssetType == nil { + invalidParams.Add(request.NewErrParamRequired("AssetType")) + } + if s.Description == nil { + invalidParams.Add(request.NewErrParamRequired("Description")) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssetType sets the AssetType field's value. +func (s *CreateDataSetInput) SetAssetType(v string) *CreateDataSetInput { + s.AssetType = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateDataSetInput) SetDescription(v string) *CreateDataSetInput { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateDataSetInput) SetName(v string) *CreateDataSetInput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateDataSetInput) SetTags(v map[string]*string) *CreateDataSetInput { + s.Tags = v + return s +} + +type CreateDataSetOutput struct { + _ struct{} `type:"structure"` + + // An Amazon Resource Name (ARN) that uniquely identifies an AWS resource. + Arn *string `type:"string"` + + // The type of file your data is stored in. Currently, the supported asset type + // is S3_SNAPSHOT. + AssetType *string `type:"string" enum:"AssetType"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + // A description of a resource. + Description *string `type:"string"` + + // A unique identifier. + Id *string `type:"string"` + + // The name of the model. + Name *string `type:"string"` + + // A property that defines the data set as OWNED by the account (for providers) + // or ENTITLED to the account (for subscribers). When an owned data set is published + // in a product, AWS Data Exchange creates a copy of the data set. Subscribers + // can access that copy of the data set as an entitled data set. + Origin *string `type:"string" enum:"Origin"` + + OriginDetails *OriginDetails `type:"structure"` + + // A unique identifier. + SourceId *string `type:"string"` + + Tags map[string]*string `type:"map"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + UpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` +} + +// String returns the string representation +func (s CreateDataSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDataSetOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateDataSetOutput) SetArn(v string) *CreateDataSetOutput { + s.Arn = &v + return s +} + +// SetAssetType sets the AssetType field's value. +func (s *CreateDataSetOutput) SetAssetType(v string) *CreateDataSetOutput { + s.AssetType = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *CreateDataSetOutput) SetCreatedAt(v time.Time) *CreateDataSetOutput { + s.CreatedAt = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateDataSetOutput) SetDescription(v string) *CreateDataSetOutput { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateDataSetOutput) SetId(v string) *CreateDataSetOutput { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateDataSetOutput) SetName(v string) *CreateDataSetOutput { + s.Name = &v + return s +} + +// SetOrigin sets the Origin field's value. +func (s *CreateDataSetOutput) SetOrigin(v string) *CreateDataSetOutput { + s.Origin = &v + return s +} + +// SetOriginDetails sets the OriginDetails field's value. +func (s *CreateDataSetOutput) SetOriginDetails(v *OriginDetails) *CreateDataSetOutput { + s.OriginDetails = v + return s +} + +// SetSourceId sets the SourceId field's value. +func (s *CreateDataSetOutput) SetSourceId(v string) *CreateDataSetOutput { + s.SourceId = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateDataSetOutput) SetTags(v map[string]*string) *CreateDataSetOutput { + s.Tags = v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *CreateDataSetOutput) SetUpdatedAt(v time.Time) *CreateDataSetOutput { + s.UpdatedAt = &v + return s +} + +// The CreateJob request. AWS Data Exchange Jobs are asynchronous import or +// export operations used to create or copy assets. A data set owner can both +// import and export as they see fit. Someone with an entitlement to a data +// set can only export. Jobs are deleted 90 days after they are created. Created +// jobs must be started with the StartJob operation. +type CreateJobInput struct { + _ struct{} `type:"structure"` + + // The details for the CreateJob request. + // + // Details is a required field + Details *RequestDetails `type:"structure" required:"true"` + + // The type of job to be created. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"Type"` +} + +// 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.Details == nil { + invalidParams.Add(request.NewErrParamRequired("Details")) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + if s.Details != nil { + if err := s.Details.Validate(); err != nil { + invalidParams.AddNested("Details", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDetails sets the Details field's value. +func (s *CreateJobInput) SetDetails(v *RequestDetails) *CreateJobInput { + s.Details = v + return s +} + +// SetType sets the Type field's value. +func (s *CreateJobInput) SetType(v string) *CreateJobInput { + s.Type = &v + return s +} + +type CreateJobOutput struct { + _ struct{} `type:"structure"` + + // An Amazon Resource Name (ARN) that uniquely identifies an AWS resource. + Arn *string `type:"string"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + // Details for the response. + Details *ResponseDetails `type:"structure"` + + Errors []*JobError `type:"list"` + + // A unique identifier. + Id *string `type:"string"` + + State *string `type:"string" enum:"State"` + + Type *string `type:"string" enum:"Type"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + UpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` +} + +// 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() +} + +// SetArn sets the Arn field's value. +func (s *CreateJobOutput) SetArn(v string) *CreateJobOutput { + s.Arn = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *CreateJobOutput) SetCreatedAt(v time.Time) *CreateJobOutput { + s.CreatedAt = &v + return s +} + +// SetDetails sets the Details field's value. +func (s *CreateJobOutput) SetDetails(v *ResponseDetails) *CreateJobOutput { + s.Details = v + return s +} + +// SetErrors sets the Errors field's value. +func (s *CreateJobOutput) SetErrors(v []*JobError) *CreateJobOutput { + s.Errors = v + return s +} + +// SetId sets the Id field's value. +func (s *CreateJobOutput) SetId(v string) *CreateJobOutput { + s.Id = &v + return s +} + +// SetState sets the State field's value. +func (s *CreateJobOutput) SetState(v string) *CreateJobOutput { + s.State = &v + return s +} + +// SetType sets the Type field's value. +func (s *CreateJobOutput) SetType(v string) *CreateJobOutput { + s.Type = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *CreateJobOutput) SetUpdatedAt(v time.Time) *CreateJobOutput { + s.UpdatedAt = &v + return s +} + +// Creates a revision for a data set. When they're created, revisions are not +// published to products, and therefore are not available to subscribers. To +// publish a revision to a data set in a product, the revision must first be +// finalized. +type CreateRevisionInput struct { + _ struct{} `type:"structure"` + + // An optional comment about the revision. + Comment *string `type:"string"` + + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` + + // A revision tag is an optional label that you can assign to a revision when + // you create it. Each tag consists of a key and an optional value, both of + // which you define. When you use tagging, you can also use tag-based access + // control in IAM policies to control access to these data sets and revisions. + Tags map[string]*string `type:"map"` +} + +// String returns the string representation +func (s CreateRevisionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateRevisionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateRevisionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateRevisionInput"} + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComment sets the Comment field's value. +func (s *CreateRevisionInput) SetComment(v string) *CreateRevisionInput { + s.Comment = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *CreateRevisionInput) SetDataSetId(v string) *CreateRevisionInput { + s.DataSetId = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateRevisionInput) SetTags(v map[string]*string) *CreateRevisionInput { + s.Tags = v + return s +} + +type CreateRevisionOutput struct { + _ struct{} `type:"structure"` + + // An Amazon Resource Name (ARN) that uniquely identifies an AWS resource. + Arn *string `type:"string"` + + Comment *string `type:"string"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + // A unique identifier. + DataSetId *string `type:"string"` + + Finalized *bool `type:"boolean"` + + // A unique identifier. + Id *string `type:"string"` + + // A unique identifier. + SourceId *string `type:"string"` + + Tags map[string]*string `type:"map"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + UpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` +} + +// String returns the string representation +func (s CreateRevisionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateRevisionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateRevisionOutput) SetArn(v string) *CreateRevisionOutput { + s.Arn = &v + return s +} + +// SetComment sets the Comment field's value. +func (s *CreateRevisionOutput) SetComment(v string) *CreateRevisionOutput { + s.Comment = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *CreateRevisionOutput) SetCreatedAt(v time.Time) *CreateRevisionOutput { + s.CreatedAt = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *CreateRevisionOutput) SetDataSetId(v string) *CreateRevisionOutput { + s.DataSetId = &v + return s +} + +// SetFinalized sets the Finalized field's value. +func (s *CreateRevisionOutput) SetFinalized(v bool) *CreateRevisionOutput { + s.Finalized = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateRevisionOutput) SetId(v string) *CreateRevisionOutput { + s.Id = &v + return s +} + +// SetSourceId sets the SourceId field's value. +func (s *CreateRevisionOutput) SetSourceId(v string) *CreateRevisionOutput { + s.SourceId = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateRevisionOutput) SetTags(v map[string]*string) *CreateRevisionOutput { + s.Tags = v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *CreateRevisionOutput) SetUpdatedAt(v time.Time) *CreateRevisionOutput { + s.UpdatedAt = &v + return s +} + +// A data set is an AWS resource with one or more revisions. +type DataSetEntry struct { + _ struct{} `type:"structure"` + + // The ARN for the data set. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // The type of file your data is stored in. Currently, the supported asset type + // is S3_SNAPSHOT. + // + // AssetType is a required field + AssetType *string `type:"string" required:"true" enum:"AssetType"` + + // The date and time that the data set was created, in ISO 8601 format. + // + // CreatedAt is a required field + CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // The description for the data set. + // + // Description is a required field + Description *string `type:"string" required:"true"` + + // The unique identifier for the data set. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // The name of the data set. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // A property that defines the data set as OWNED by the account (for providers) + // or ENTITLED to the account (for subscribers). + // + // Origin is a required field + Origin *string `type:"string" required:"true" enum:"Origin"` + + // If the origin of this data set is ENTITLED, includes the details for the + // product on AWS Marketplace. + OriginDetails *OriginDetails `type:"structure"` + + // The data set ID of the owned data set corresponding to the entitled data + // set being viewed. This parameter is returned when a data set owner is viewing + // the entitled copy of its owned data set. + SourceId *string `type:"string"` + + // The date and time that the data set was last updated, in ISO 8601 format. + // + // UpdatedAt is a required field + UpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` +} + +// String returns the string representation +func (s DataSetEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataSetEntry) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DataSetEntry) SetArn(v string) *DataSetEntry { + s.Arn = &v + return s +} + +// SetAssetType sets the AssetType field's value. +func (s *DataSetEntry) SetAssetType(v string) *DataSetEntry { + s.AssetType = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *DataSetEntry) SetCreatedAt(v time.Time) *DataSetEntry { + s.CreatedAt = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *DataSetEntry) SetDescription(v string) *DataSetEntry { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *DataSetEntry) SetId(v string) *DataSetEntry { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *DataSetEntry) SetName(v string) *DataSetEntry { + s.Name = &v + return s +} + +// SetOrigin sets the Origin field's value. +func (s *DataSetEntry) SetOrigin(v string) *DataSetEntry { + s.Origin = &v + return s +} + +// SetOriginDetails sets the OriginDetails field's value. +func (s *DataSetEntry) SetOriginDetails(v *OriginDetails) *DataSetEntry { + s.OriginDetails = v + return s +} + +// SetSourceId sets the SourceId field's value. +func (s *DataSetEntry) SetSourceId(v string) *DataSetEntry { + s.SourceId = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *DataSetEntry) SetUpdatedAt(v time.Time) *DataSetEntry { + s.UpdatedAt = &v + return s +} + +type DeleteAssetInput struct { + _ struct{} `type:"structure"` + + // AssetId is a required field + AssetId *string `location:"uri" locationName:"AssetId" type:"string" required:"true"` + + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` + + // RevisionId is a required field + RevisionId *string `location:"uri" locationName:"RevisionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteAssetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAssetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteAssetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteAssetInput"} + if s.AssetId == nil { + invalidParams.Add(request.NewErrParamRequired("AssetId")) + } + if s.AssetId != nil && len(*s.AssetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AssetId", 1)) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 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 +} + +// SetAssetId sets the AssetId field's value. +func (s *DeleteAssetInput) SetAssetId(v string) *DeleteAssetInput { + s.AssetId = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *DeleteAssetInput) SetDataSetId(v string) *DeleteAssetInput { + s.DataSetId = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *DeleteAssetInput) SetRevisionId(v string) *DeleteAssetInput { + s.RevisionId = &v + return s +} + +type DeleteAssetOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteAssetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAssetOutput) GoString() string { + return s.String() +} + +type DeleteDataSetInput struct { + _ struct{} `type:"structure"` + + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteDataSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDataSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteDataSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteDataSetInput"} + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDataSetId sets the DataSetId field's value. +func (s *DeleteDataSetInput) SetDataSetId(v string) *DeleteDataSetInput { + s.DataSetId = &v + return s +} + +type DeleteDataSetOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteDataSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDataSetOutput) GoString() string { + return s.String() +} + +type DeleteRevisionInput struct { + _ struct{} `type:"structure"` + + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` + + // RevisionId is a required field + RevisionId *string `location:"uri" locationName:"RevisionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteRevisionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRevisionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteRevisionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteRevisionInput"} + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 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 +} + +// SetDataSetId sets the DataSetId field's value. +func (s *DeleteRevisionInput) SetDataSetId(v string) *DeleteRevisionInput { + s.DataSetId = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *DeleteRevisionInput) SetRevisionId(v string) *DeleteRevisionInput { + s.RevisionId = &v + return s +} + +type DeleteRevisionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteRevisionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRevisionOutput) GoString() string { + return s.String() +} + +type Details struct { + _ struct{} `type:"structure"` + + ImportAssetFromSignedUrlJobErrorDetails *ImportAssetFromSignedUrlJobErrorDetails `type:"structure"` + + // The list of sources for the assets. + ImportAssetsFromS3JobErrorDetails []*AssetSourceEntry `type:"list"` +} + +// String returns the string representation +func (s Details) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Details) GoString() string { + return s.String() +} + +// SetImportAssetFromSignedUrlJobErrorDetails sets the ImportAssetFromSignedUrlJobErrorDetails field's value. +func (s *Details) SetImportAssetFromSignedUrlJobErrorDetails(v *ImportAssetFromSignedUrlJobErrorDetails) *Details { + s.ImportAssetFromSignedUrlJobErrorDetails = v + return s +} + +// SetImportAssetsFromS3JobErrorDetails sets the ImportAssetsFromS3JobErrorDetails field's value. +func (s *Details) SetImportAssetsFromS3JobErrorDetails(v []*AssetSourceEntry) *Details { + s.ImportAssetsFromS3JobErrorDetails = v + return s +} + +// Details of the operation to be performed by the job. +type ExportAssetToSignedUrlRequestDetails struct { + _ struct{} `type:"structure"` + + // The unique identifier for the asset that is exported to a signed URL. + // + // AssetId is a required field + AssetId *string `type:"string" required:"true"` + + // The unique identifier for the data set associated with this export job. + // + // DataSetId is a required field + DataSetId *string `type:"string" required:"true"` + + // The unique identifier for the revision associated with this export request. + // + // RevisionId is a required field + RevisionId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ExportAssetToSignedUrlRequestDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExportAssetToSignedUrlRequestDetails) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ExportAssetToSignedUrlRequestDetails) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ExportAssetToSignedUrlRequestDetails"} + if s.AssetId == nil { + invalidParams.Add(request.NewErrParamRequired("AssetId")) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.RevisionId == nil { + invalidParams.Add(request.NewErrParamRequired("RevisionId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssetId sets the AssetId field's value. +func (s *ExportAssetToSignedUrlRequestDetails) SetAssetId(v string) *ExportAssetToSignedUrlRequestDetails { + s.AssetId = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *ExportAssetToSignedUrlRequestDetails) SetDataSetId(v string) *ExportAssetToSignedUrlRequestDetails { + s.DataSetId = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *ExportAssetToSignedUrlRequestDetails) SetRevisionId(v string) *ExportAssetToSignedUrlRequestDetails { + s.RevisionId = &v + return s +} + +// The details of the export to signed URL response. +type ExportAssetToSignedUrlResponseDetails struct { + _ struct{} `type:"structure"` + + // The unique identifier for the asset associated with this export job. + // + // AssetId is a required field + AssetId *string `type:"string" required:"true"` + + // The unique identifier for the data set associated with this export job. + // + // DataSetId is a required field + DataSetId *string `type:"string" required:"true"` + + // The unique identifier for the revision associated with this export response. + // + // RevisionId is a required field + RevisionId *string `type:"string" required:"true"` + + // The signed URL for the export request. + SignedUrl *string `type:"string"` + + // The date and time that the signed URL expires, in ISO 8601 format. + SignedUrlExpiresAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` +} + +// String returns the string representation +func (s ExportAssetToSignedUrlResponseDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExportAssetToSignedUrlResponseDetails) GoString() string { + return s.String() +} + +// SetAssetId sets the AssetId field's value. +func (s *ExportAssetToSignedUrlResponseDetails) SetAssetId(v string) *ExportAssetToSignedUrlResponseDetails { + s.AssetId = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *ExportAssetToSignedUrlResponseDetails) SetDataSetId(v string) *ExportAssetToSignedUrlResponseDetails { + s.DataSetId = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *ExportAssetToSignedUrlResponseDetails) SetRevisionId(v string) *ExportAssetToSignedUrlResponseDetails { + s.RevisionId = &v + return s +} + +// SetSignedUrl sets the SignedUrl field's value. +func (s *ExportAssetToSignedUrlResponseDetails) SetSignedUrl(v string) *ExportAssetToSignedUrlResponseDetails { + s.SignedUrl = &v + return s +} + +// SetSignedUrlExpiresAt sets the SignedUrlExpiresAt field's value. +func (s *ExportAssetToSignedUrlResponseDetails) SetSignedUrlExpiresAt(v time.Time) *ExportAssetToSignedUrlResponseDetails { + s.SignedUrlExpiresAt = &v + return s +} + +// Details of the operation to be performed by the job. +type ExportAssetsToS3RequestDetails struct { + _ struct{} `type:"structure"` + + // The destination for the asset. + // + // AssetDestinations is a required field + AssetDestinations []*AssetDestinationEntry `type:"list" required:"true"` + + // The unique identifier for the data set associated with this export job. + // + // DataSetId is a required field + DataSetId *string `type:"string" required:"true"` + + // The unique identifier for the revision associated with this export request. + // + // RevisionId is a required field + RevisionId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ExportAssetsToS3RequestDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExportAssetsToS3RequestDetails) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ExportAssetsToS3RequestDetails) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ExportAssetsToS3RequestDetails"} + if s.AssetDestinations == nil { + invalidParams.Add(request.NewErrParamRequired("AssetDestinations")) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.RevisionId == nil { + invalidParams.Add(request.NewErrParamRequired("RevisionId")) + } + if s.AssetDestinations != nil { + for i, v := range s.AssetDestinations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AssetDestinations", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssetDestinations sets the AssetDestinations field's value. +func (s *ExportAssetsToS3RequestDetails) SetAssetDestinations(v []*AssetDestinationEntry) *ExportAssetsToS3RequestDetails { + s.AssetDestinations = v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *ExportAssetsToS3RequestDetails) SetDataSetId(v string) *ExportAssetsToS3RequestDetails { + s.DataSetId = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *ExportAssetsToS3RequestDetails) SetRevisionId(v string) *ExportAssetsToS3RequestDetails { + s.RevisionId = &v + return s +} + +// Details about the export to Amazon S3 response. +type ExportAssetsToS3ResponseDetails struct { + _ struct{} `type:"structure"` + + // The destination in Amazon S3 where the asset is exported. + // + // AssetDestinations is a required field + AssetDestinations []*AssetDestinationEntry `type:"list" required:"true"` + + // The unique identifier for the data set associated with this export job. + // + // DataSetId is a required field + DataSetId *string `type:"string" required:"true"` + + // The unique identifier for the revision associated with this export response. + // + // RevisionId is a required field + RevisionId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ExportAssetsToS3ResponseDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExportAssetsToS3ResponseDetails) GoString() string { + return s.String() +} + +// SetAssetDestinations sets the AssetDestinations field's value. +func (s *ExportAssetsToS3ResponseDetails) SetAssetDestinations(v []*AssetDestinationEntry) *ExportAssetsToS3ResponseDetails { + s.AssetDestinations = v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *ExportAssetsToS3ResponseDetails) SetDataSetId(v string) *ExportAssetsToS3ResponseDetails { + s.DataSetId = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *ExportAssetsToS3ResponseDetails) SetRevisionId(v string) *ExportAssetsToS3ResponseDetails { + s.RevisionId = &v + return s +} + +type GetAssetInput struct { + _ struct{} `type:"structure"` + + // AssetId is a required field + AssetId *string `location:"uri" locationName:"AssetId" type:"string" required:"true"` + + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` + + // RevisionId is a required field + RevisionId *string `location:"uri" locationName:"RevisionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetAssetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAssetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAssetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAssetInput"} + if s.AssetId == nil { + invalidParams.Add(request.NewErrParamRequired("AssetId")) + } + if s.AssetId != nil && len(*s.AssetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AssetId", 1)) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 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 +} + +// SetAssetId sets the AssetId field's value. +func (s *GetAssetInput) SetAssetId(v string) *GetAssetInput { + s.AssetId = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *GetAssetInput) SetDataSetId(v string) *GetAssetInput { + s.DataSetId = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *GetAssetInput) SetRevisionId(v string) *GetAssetInput { + s.RevisionId = &v + return s +} + +type GetAssetOutput struct { + _ struct{} `type:"structure"` + + // An Amazon Resource Name (ARN) that uniquely identifies an AWS resource. + Arn *string `type:"string"` + + AssetDetails *AssetDetails `type:"structure"` + + // The type of file your data is stored in. Currently, the supported asset type + // is S3_SNAPSHOT. + AssetType *string `type:"string" enum:"AssetType"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + // A unique identifier. + DataSetId *string `type:"string"` + + // A unique identifier. + Id *string `type:"string"` + + // The name of the asset. When importing from Amazon S3, the S3 object key is + // used as the asset name. When exporting to Amazon S3, the asset name is used + // as default target S3 object key. + Name *string `type:"string"` + + // A unique identifier. + RevisionId *string `type:"string"` + + // A unique identifier. + SourceId *string `type:"string"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + UpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` +} + +// String returns the string representation +func (s GetAssetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAssetOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetAssetOutput) SetArn(v string) *GetAssetOutput { + s.Arn = &v + return s +} + +// SetAssetDetails sets the AssetDetails field's value. +func (s *GetAssetOutput) SetAssetDetails(v *AssetDetails) *GetAssetOutput { + s.AssetDetails = v + return s +} + +// SetAssetType sets the AssetType field's value. +func (s *GetAssetOutput) SetAssetType(v string) *GetAssetOutput { + s.AssetType = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *GetAssetOutput) SetCreatedAt(v time.Time) *GetAssetOutput { + s.CreatedAt = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *GetAssetOutput) SetDataSetId(v string) *GetAssetOutput { + s.DataSetId = &v + return s +} + +// SetId sets the Id field's value. +func (s *GetAssetOutput) SetId(v string) *GetAssetOutput { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *GetAssetOutput) SetName(v string) *GetAssetOutput { + s.Name = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *GetAssetOutput) SetRevisionId(v string) *GetAssetOutput { + s.RevisionId = &v + return s +} + +// SetSourceId sets the SourceId field's value. +func (s *GetAssetOutput) SetSourceId(v string) *GetAssetOutput { + s.SourceId = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *GetAssetOutput) SetUpdatedAt(v time.Time) *GetAssetOutput { + s.UpdatedAt = &v + return s +} + +type GetDataSetInput struct { + _ struct{} `type:"structure"` + + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetDataSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDataSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetDataSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetDataSetInput"} + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDataSetId sets the DataSetId field's value. +func (s *GetDataSetInput) SetDataSetId(v string) *GetDataSetInput { + s.DataSetId = &v + return s +} + +type GetDataSetOutput struct { + _ struct{} `type:"structure"` + + // An Amazon Resource Name (ARN) that uniquely identifies an AWS resource. + Arn *string `type:"string"` + + // The type of file your data is stored in. Currently, the supported asset type + // is S3_SNAPSHOT. + AssetType *string `type:"string" enum:"AssetType"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + // A description of a resource. + Description *string `type:"string"` + + // A unique identifier. + Id *string `type:"string"` + + // The name of the model. + Name *string `type:"string"` + + // A property that defines the data set as OWNED by the account (for providers) + // or ENTITLED to the account (for subscribers). When an owned data set is published + // in a product, AWS Data Exchange creates a copy of the data set. Subscribers + // can access that copy of the data set as an entitled data set. + Origin *string `type:"string" enum:"Origin"` + + OriginDetails *OriginDetails `type:"structure"` + + // A unique identifier. + SourceId *string `type:"string"` + + Tags map[string]*string `type:"map"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + UpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` +} + +// String returns the string representation +func (s GetDataSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDataSetOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetDataSetOutput) SetArn(v string) *GetDataSetOutput { + s.Arn = &v + return s +} + +// SetAssetType sets the AssetType field's value. +func (s *GetDataSetOutput) SetAssetType(v string) *GetDataSetOutput { + s.AssetType = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *GetDataSetOutput) SetCreatedAt(v time.Time) *GetDataSetOutput { + s.CreatedAt = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *GetDataSetOutput) SetDescription(v string) *GetDataSetOutput { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *GetDataSetOutput) SetId(v string) *GetDataSetOutput { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *GetDataSetOutput) SetName(v string) *GetDataSetOutput { + s.Name = &v + return s +} + +// SetOrigin sets the Origin field's value. +func (s *GetDataSetOutput) SetOrigin(v string) *GetDataSetOutput { + s.Origin = &v + return s +} + +// SetOriginDetails sets the OriginDetails field's value. +func (s *GetDataSetOutput) SetOriginDetails(v *OriginDetails) *GetDataSetOutput { + s.OriginDetails = v + return s +} + +// SetSourceId sets the SourceId field's value. +func (s *GetDataSetOutput) SetSourceId(v string) *GetDataSetOutput { + s.SourceId = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *GetDataSetOutput) SetTags(v map[string]*string) *GetDataSetOutput { + s.Tags = v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *GetDataSetOutput) SetUpdatedAt(v time.Time) *GetDataSetOutput { + s.UpdatedAt = &v + return s +} + +type GetJobInput struct { + _ struct{} `type:"structure"` + + // JobId is a required field + JobId *string `location:"uri" locationName:"JobId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetJobInput"} + 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 +} + +// SetJobId sets the JobId field's value. +func (s *GetJobInput) SetJobId(v string) *GetJobInput { + s.JobId = &v + return s +} + +type GetJobOutput struct { + _ struct{} `type:"structure"` + + // An Amazon Resource Name (ARN) that uniquely identifies an AWS resource. + Arn *string `type:"string"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + // Details for the response. + Details *ResponseDetails `type:"structure"` + + Errors []*JobError `type:"list"` + + // A unique identifier. + Id *string `type:"string"` + + State *string `type:"string" enum:"State"` + + Type *string `type:"string" enum:"Type"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + UpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` +} + +// String returns the string representation +func (s GetJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetJobOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetJobOutput) SetArn(v string) *GetJobOutput { + s.Arn = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *GetJobOutput) SetCreatedAt(v time.Time) *GetJobOutput { + s.CreatedAt = &v + return s +} + +// SetDetails sets the Details field's value. +func (s *GetJobOutput) SetDetails(v *ResponseDetails) *GetJobOutput { + s.Details = v + return s +} + +// SetErrors sets the Errors field's value. +func (s *GetJobOutput) SetErrors(v []*JobError) *GetJobOutput { + s.Errors = v + return s +} + +// SetId sets the Id field's value. +func (s *GetJobOutput) SetId(v string) *GetJobOutput { + s.Id = &v + return s +} + +// SetState sets the State field's value. +func (s *GetJobOutput) SetState(v string) *GetJobOutput { + s.State = &v + return s +} + +// SetType sets the Type field's value. +func (s *GetJobOutput) SetType(v string) *GetJobOutput { + s.Type = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *GetJobOutput) SetUpdatedAt(v time.Time) *GetJobOutput { + s.UpdatedAt = &v + return s +} + +type GetRevisionInput struct { + _ struct{} `type:"structure"` + + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` + + // RevisionId is a required field + RevisionId *string `location:"uri" locationName:"RevisionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetRevisionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRevisionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetRevisionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetRevisionInput"} + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 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 +} + +// SetDataSetId sets the DataSetId field's value. +func (s *GetRevisionInput) SetDataSetId(v string) *GetRevisionInput { + s.DataSetId = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *GetRevisionInput) SetRevisionId(v string) *GetRevisionInput { + s.RevisionId = &v + return s +} + +type GetRevisionOutput struct { + _ struct{} `type:"structure"` + + // An Amazon Resource Name (ARN) that uniquely identifies an AWS resource. + Arn *string `type:"string"` + + Comment *string `type:"string"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + // A unique identifier. + DataSetId *string `type:"string"` + + Finalized *bool `type:"boolean"` + + // A unique identifier. + Id *string `type:"string"` + + // A unique identifier. + SourceId *string `type:"string"` + + Tags map[string]*string `type:"map"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + UpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` +} + +// String returns the string representation +func (s GetRevisionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRevisionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetRevisionOutput) SetArn(v string) *GetRevisionOutput { + s.Arn = &v + return s +} + +// SetComment sets the Comment field's value. +func (s *GetRevisionOutput) SetComment(v string) *GetRevisionOutput { + s.Comment = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *GetRevisionOutput) SetCreatedAt(v time.Time) *GetRevisionOutput { + s.CreatedAt = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *GetRevisionOutput) SetDataSetId(v string) *GetRevisionOutput { + s.DataSetId = &v + return s +} + +// SetFinalized sets the Finalized field's value. +func (s *GetRevisionOutput) SetFinalized(v bool) *GetRevisionOutput { + s.Finalized = &v + return s +} + +// SetId sets the Id field's value. +func (s *GetRevisionOutput) SetId(v string) *GetRevisionOutput { + s.Id = &v + return s +} + +// SetSourceId sets the SourceId field's value. +func (s *GetRevisionOutput) SetSourceId(v string) *GetRevisionOutput { + s.SourceId = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *GetRevisionOutput) SetTags(v map[string]*string) *GetRevisionOutput { + s.Tags = v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *GetRevisionOutput) SetUpdatedAt(v time.Time) *GetRevisionOutput { + s.UpdatedAt = &v + return s +} + +type ImportAssetFromSignedUrlJobErrorDetails struct { + _ struct{} `type:"structure"` + + // The name of the asset. When importing from Amazon S3, the S3 object key is + // used as the asset name. When exporting to Amazon S3, the asset name is used + // as default target S3 object key. + // + // AssetName is a required field + AssetName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ImportAssetFromSignedUrlJobErrorDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportAssetFromSignedUrlJobErrorDetails) GoString() string { + return s.String() +} + +// SetAssetName sets the AssetName field's value. +func (s *ImportAssetFromSignedUrlJobErrorDetails) SetAssetName(v string) *ImportAssetFromSignedUrlJobErrorDetails { + s.AssetName = &v + return s +} + +// Details of the operation to be performed by the job. +type ImportAssetFromSignedUrlRequestDetails struct { + _ struct{} `type:"structure"` + + // The name of the asset. When importing from Amazon S3, the S3 object key is + // used as the asset name. + // + // AssetName is a required field + AssetName *string `type:"string" required:"true"` + + // The unique identifier for the data set associated with this import job. + // + // DataSetId is a required field + DataSetId *string `type:"string" required:"true"` + + // The Base64-encoded Md5 hash for the asset, used to ensure the integrity of + // the file at that location. + // + // Md5Hash is a required field + Md5Hash *string `min:"24" type:"string" required:"true"` + + // The unique identifier for the revision associated with this import request. + // + // RevisionId is a required field + RevisionId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ImportAssetFromSignedUrlRequestDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportAssetFromSignedUrlRequestDetails) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ImportAssetFromSignedUrlRequestDetails) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ImportAssetFromSignedUrlRequestDetails"} + if s.AssetName == nil { + invalidParams.Add(request.NewErrParamRequired("AssetName")) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.Md5Hash == nil { + invalidParams.Add(request.NewErrParamRequired("Md5Hash")) + } + if s.Md5Hash != nil && len(*s.Md5Hash) < 24 { + invalidParams.Add(request.NewErrParamMinLen("Md5Hash", 24)) + } + if s.RevisionId == nil { + invalidParams.Add(request.NewErrParamRequired("RevisionId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssetName sets the AssetName field's value. +func (s *ImportAssetFromSignedUrlRequestDetails) SetAssetName(v string) *ImportAssetFromSignedUrlRequestDetails { + s.AssetName = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *ImportAssetFromSignedUrlRequestDetails) SetDataSetId(v string) *ImportAssetFromSignedUrlRequestDetails { + s.DataSetId = &v + return s +} + +// SetMd5Hash sets the Md5Hash field's value. +func (s *ImportAssetFromSignedUrlRequestDetails) SetMd5Hash(v string) *ImportAssetFromSignedUrlRequestDetails { + s.Md5Hash = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *ImportAssetFromSignedUrlRequestDetails) SetRevisionId(v string) *ImportAssetFromSignedUrlRequestDetails { + s.RevisionId = &v + return s +} + +// The details in the response for an import request, including the signed URL +// and other information. +type ImportAssetFromSignedUrlResponseDetails struct { + _ struct{} `type:"structure"` + + // The name for the asset associated with this import response. + // + // AssetName is a required field + AssetName *string `type:"string" required:"true"` + + // The unique identifier for the data set associated with this import job. + // + // DataSetId is a required field + DataSetId *string `type:"string" required:"true"` + + // The Base64-encoded Md5 hash for the asset, used to ensure the integrity of + // the file at that location. + Md5Hash *string `min:"24" type:"string"` + + // The unique identifier for the revision associated with this import response. + // + // RevisionId is a required field + RevisionId *string `type:"string" required:"true"` + + // The signed URL. + SignedUrl *string `type:"string"` + + // The time and date at which the signed URL expires, in ISO 8601 format. + SignedUrlExpiresAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` +} + +// String returns the string representation +func (s ImportAssetFromSignedUrlResponseDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportAssetFromSignedUrlResponseDetails) GoString() string { + return s.String() +} + +// SetAssetName sets the AssetName field's value. +func (s *ImportAssetFromSignedUrlResponseDetails) SetAssetName(v string) *ImportAssetFromSignedUrlResponseDetails { + s.AssetName = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *ImportAssetFromSignedUrlResponseDetails) SetDataSetId(v string) *ImportAssetFromSignedUrlResponseDetails { + s.DataSetId = &v + return s +} + +// SetMd5Hash sets the Md5Hash field's value. +func (s *ImportAssetFromSignedUrlResponseDetails) SetMd5Hash(v string) *ImportAssetFromSignedUrlResponseDetails { + s.Md5Hash = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *ImportAssetFromSignedUrlResponseDetails) SetRevisionId(v string) *ImportAssetFromSignedUrlResponseDetails { + s.RevisionId = &v + return s +} + +// SetSignedUrl sets the SignedUrl field's value. +func (s *ImportAssetFromSignedUrlResponseDetails) SetSignedUrl(v string) *ImportAssetFromSignedUrlResponseDetails { + s.SignedUrl = &v + return s +} + +// SetSignedUrlExpiresAt sets the SignedUrlExpiresAt field's value. +func (s *ImportAssetFromSignedUrlResponseDetails) SetSignedUrlExpiresAt(v time.Time) *ImportAssetFromSignedUrlResponseDetails { + s.SignedUrlExpiresAt = &v + return s +} + +// Details of the operation to be performed by the job. +type ImportAssetsFromS3RequestDetails struct { + _ struct{} `type:"structure"` + + // Is a list of S3 bucket and object key pairs. + // + // AssetSources is a required field + AssetSources []*AssetSourceEntry `type:"list" required:"true"` + + // The unique identifier for the data set associated with this import job. + // + // DataSetId is a required field + DataSetId *string `type:"string" required:"true"` + + // The unique identifier for the revision associated with this import request. + // + // RevisionId is a required field + RevisionId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ImportAssetsFromS3RequestDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportAssetsFromS3RequestDetails) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ImportAssetsFromS3RequestDetails) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ImportAssetsFromS3RequestDetails"} + if s.AssetSources == nil { + invalidParams.Add(request.NewErrParamRequired("AssetSources")) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.RevisionId == nil { + invalidParams.Add(request.NewErrParamRequired("RevisionId")) + } + if s.AssetSources != nil { + for i, v := range s.AssetSources { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AssetSources", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssetSources sets the AssetSources field's value. +func (s *ImportAssetsFromS3RequestDetails) SetAssetSources(v []*AssetSourceEntry) *ImportAssetsFromS3RequestDetails { + s.AssetSources = v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *ImportAssetsFromS3RequestDetails) SetDataSetId(v string) *ImportAssetsFromS3RequestDetails { + s.DataSetId = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *ImportAssetsFromS3RequestDetails) SetRevisionId(v string) *ImportAssetsFromS3RequestDetails { + s.RevisionId = &v + return s +} + +// Details from an import from Amazon S3 response. +type ImportAssetsFromS3ResponseDetails struct { + _ struct{} `type:"structure"` + + // Is a list of Amazon S3 bucket and object key pairs. + // + // AssetSources is a required field + AssetSources []*AssetSourceEntry `type:"list" required:"true"` + + // The unique identifier for the data set associated with this import job. + // + // DataSetId is a required field + DataSetId *string `type:"string" required:"true"` + + // The unique identifier for the revision associated with this import response. + // + // RevisionId is a required field + RevisionId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ImportAssetsFromS3ResponseDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportAssetsFromS3ResponseDetails) GoString() string { + return s.String() +} + +// SetAssetSources sets the AssetSources field's value. +func (s *ImportAssetsFromS3ResponseDetails) SetAssetSources(v []*AssetSourceEntry) *ImportAssetsFromS3ResponseDetails { + s.AssetSources = v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *ImportAssetsFromS3ResponseDetails) SetDataSetId(v string) *ImportAssetsFromS3ResponseDetails { + s.DataSetId = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *ImportAssetsFromS3ResponseDetails) SetRevisionId(v string) *ImportAssetsFromS3ResponseDetails { + s.RevisionId = &v + return s +} + +// An exception occurred with the service. +type InternalServerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message identifying the service exception that occurred. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalServerException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerException) GoString() string { + return s.String() +} + +func newErrorInternalServerException(v protocol.ResponseMetadata) error { + return &InternalServerException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerException) Code() string { + return "InternalServerException" +} + +// Message returns the exception's message. +func (s InternalServerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerException) OrigErr() error { + return nil +} + +func (s InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS Data Exchange Jobs are asynchronous import or export operations used +// to create or copy assets. A data set owner can both import and export as +// they see fit. Someone with an entitlement to a data set can only export. +// Jobs are deleted 90 days after they are created. +type JobEntry struct { + _ struct{} `type:"structure"` + + // The ARN for the job. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // The date and time that the job was created, in ISO 8601 format. + // + // CreatedAt is a required field + CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // Details of the operation to be performed by the job, such as export destination + // details or import source details. + // + // Details is a required field + Details *ResponseDetails `type:"structure" required:"true"` + + // Errors for jobs. + Errors []*JobError `type:"list"` + + // The unique identifier for the job. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // The state of the job. + // + // State is a required field + State *string `type:"string" required:"true" enum:"State"` + + // The job type. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"Type"` + + // The date and time that the job was last updated, in ISO 8601 format. + // + // UpdatedAt is a required field + UpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` +} + +// String returns the string representation +func (s JobEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s JobEntry) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *JobEntry) SetArn(v string) *JobEntry { + s.Arn = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *JobEntry) SetCreatedAt(v time.Time) *JobEntry { + s.CreatedAt = &v + return s +} + +// SetDetails sets the Details field's value. +func (s *JobEntry) SetDetails(v *ResponseDetails) *JobEntry { + s.Details = v + return s +} + +// SetErrors sets the Errors field's value. +func (s *JobEntry) SetErrors(v []*JobError) *JobEntry { + s.Errors = v + return s +} + +// SetId sets the Id field's value. +func (s *JobEntry) SetId(v string) *JobEntry { + s.Id = &v + return s +} + +// SetState sets the State field's value. +func (s *JobEntry) SetState(v string) *JobEntry { + s.State = &v + return s +} + +// SetType sets the Type field's value. +func (s *JobEntry) SetType(v string) *JobEntry { + s.Type = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *JobEntry) SetUpdatedAt(v time.Time) *JobEntry { + s.UpdatedAt = &v + return s +} + +// An error that occurred with the job request. +type JobError struct { + _ struct{} `type:"structure"` + + // The code for the job error. + // + // Code is a required field + Code *string `type:"string" required:"true" enum:"Code"` + + Details *Details `type:"structure"` + + // The name of the limit that was reached. + LimitName *string `type:"string" enum:"JobErrorLimitName"` + + // The value of the exceeded limit. + LimitValue *float64 `type:"double"` + + // The message related to the job error. + // + // Message is a required field + Message *string `type:"string" required:"true"` + + // The unqiue identifier for the resource related to the error. + ResourceId *string `type:"string"` + + // The type of resource related to the error. + ResourceType *string `type:"string" enum:"JobErrorResourceTypes"` +} + +// String returns the string representation +func (s JobError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s JobError) GoString() string { + return s.String() +} + +// SetCode sets the Code field's value. +func (s *JobError) SetCode(v string) *JobError { + s.Code = &v + return s +} + +// SetDetails sets the Details field's value. +func (s *JobError) SetDetails(v *Details) *JobError { + s.Details = v + return s +} + +// SetLimitName sets the LimitName field's value. +func (s *JobError) SetLimitName(v string) *JobError { + s.LimitName = &v + return s +} + +// SetLimitValue sets the LimitValue field's value. +func (s *JobError) SetLimitValue(v float64) *JobError { + s.LimitValue = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *JobError) SetMessage(v string) *JobError { + s.Message = &v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *JobError) SetResourceId(v string) *JobError { + s.ResourceId = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *JobError) SetResourceType(v string) *JobError { + s.ResourceType = &v + return s +} + +type ListDataSetRevisionsInput struct { + _ struct{} `type:"structure"` + + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` + + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListDataSetRevisionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDataSetRevisionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListDataSetRevisionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListDataSetRevisionsInput"} + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDataSetId sets the DataSetId field's value. +func (s *ListDataSetRevisionsInput) SetDataSetId(v string) *ListDataSetRevisionsInput { + s.DataSetId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListDataSetRevisionsInput) SetMaxResults(v int64) *ListDataSetRevisionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDataSetRevisionsInput) SetNextToken(v string) *ListDataSetRevisionsInput { + s.NextToken = &v + return s +} + +type ListDataSetRevisionsOutput struct { + _ struct{} `type:"structure"` + + // The token value retrieved from a previous call to access the next page of + // results. + NextToken *string `type:"string"` + + Revisions []*RevisionEntry `type:"list"` +} + +// String returns the string representation +func (s ListDataSetRevisionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDataSetRevisionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDataSetRevisionsOutput) SetNextToken(v string) *ListDataSetRevisionsOutput { + s.NextToken = &v + return s +} + +// SetRevisions sets the Revisions field's value. +func (s *ListDataSetRevisionsOutput) SetRevisions(v []*RevisionEntry) *ListDataSetRevisionsOutput { + s.Revisions = v + return s +} + +type ListDataSetsInput struct { + _ struct{} `type:"structure"` + + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + + Origin *string `location:"querystring" locationName:"origin" type:"string"` +} + +// String returns the string representation +func (s ListDataSetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDataSetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListDataSetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListDataSetsInput"} + 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 *ListDataSetsInput) SetMaxResults(v int64) *ListDataSetsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDataSetsInput) SetNextToken(v string) *ListDataSetsInput { + s.NextToken = &v + return s +} + +// SetOrigin sets the Origin field's value. +func (s *ListDataSetsInput) SetOrigin(v string) *ListDataSetsInput { + s.Origin = &v + return s +} + +type ListDataSetsOutput struct { + _ struct{} `type:"structure"` + + DataSets []*DataSetEntry `type:"list"` + + // The token value retrieved from a previous call to access the next page of + // results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListDataSetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDataSetsOutput) GoString() string { + return s.String() +} + +// SetDataSets sets the DataSets field's value. +func (s *ListDataSetsOutput) SetDataSets(v []*DataSetEntry) *ListDataSetsOutput { + s.DataSets = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDataSetsOutput) SetNextToken(v string) *ListDataSetsOutput { + s.NextToken = &v + return s +} + +type ListJobsInput struct { + _ struct{} `type:"structure"` + + DataSetId *string `location:"querystring" locationName:"dataSetId" type:"string"` + + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + + RevisionId *string `location:"querystring" locationName:"revisionId" type:"string"` +} + +// 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.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDataSetId sets the DataSetId field's value. +func (s *ListJobsInput) SetDataSetId(v string) *ListJobsInput { + s.DataSetId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListJobsInput) SetMaxResults(v int64) *ListJobsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListJobsInput) SetNextToken(v string) *ListJobsInput { + s.NextToken = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *ListJobsInput) SetRevisionId(v string) *ListJobsInput { + s.RevisionId = &v + return s +} + +type ListJobsOutput struct { + _ struct{} `type:"structure"` + + Jobs []*JobEntry `type:"list"` + + // The token value retrieved from a previous call to access the next page of + // results. + NextToken *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() +} + +// SetJobs sets the Jobs field's value. +func (s *ListJobsOutput) SetJobs(v []*JobEntry) *ListJobsOutput { + s.Jobs = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListJobsOutput) SetNextToken(v string) *ListJobsOutput { + s.NextToken = &v + return s +} + +type ListRevisionAssetsInput struct { + _ struct{} `type:"structure"` + + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` + + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + + // RevisionId is a required field + RevisionId *string `location:"uri" locationName:"RevisionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListRevisionAssetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListRevisionAssetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListRevisionAssetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListRevisionAssetsInput"} + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 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 +} + +// SetDataSetId sets the DataSetId field's value. +func (s *ListRevisionAssetsInput) SetDataSetId(v string) *ListRevisionAssetsInput { + s.DataSetId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListRevisionAssetsInput) SetMaxResults(v int64) *ListRevisionAssetsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListRevisionAssetsInput) SetNextToken(v string) *ListRevisionAssetsInput { + s.NextToken = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *ListRevisionAssetsInput) SetRevisionId(v string) *ListRevisionAssetsInput { + s.RevisionId = &v + return s +} + +type ListRevisionAssetsOutput struct { + _ struct{} `type:"structure"` + + Assets []*AssetEntry `type:"list"` + + // The token value retrieved from a previous call to access the next page of + // results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListRevisionAssetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListRevisionAssetsOutput) GoString() string { + return s.String() +} + +// SetAssets sets the Assets field's value. +func (s *ListRevisionAssetsOutput) SetAssets(v []*AssetEntry) *ListRevisionAssetsOutput { + s.Assets = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListRevisionAssetsOutput) SetNextToken(v string) *ListRevisionAssetsOutput { + s.NextToken = &v + return s +} + +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resource-arn" 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 +} + +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// 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 map[string]*string) *ListTagsForResourceOutput { + s.Tags = v + return s +} + +type OriginDetails struct { + _ struct{} `type:"structure"` + + // ProductId is a required field + ProductId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s OriginDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OriginDetails) GoString() string { + return s.String() +} + +// SetProductId sets the ProductId field's value. +func (s *OriginDetails) SetProductId(v string) *OriginDetails { + s.ProductId = &v + return s +} + +// The details for the request. +type RequestDetails struct { + _ struct{} `type:"structure"` + + // Details about the export to signed URL request. + ExportAssetToSignedUrl *ExportAssetToSignedUrlRequestDetails `type:"structure"` + + // Details about the export to Amazon S3 request. + ExportAssetsToS3 *ExportAssetsToS3RequestDetails `type:"structure"` + + // Details about the import from signed URL request. + ImportAssetFromSignedUrl *ImportAssetFromSignedUrlRequestDetails `type:"structure"` + + // Details about the import from Amazon S3 request. + ImportAssetsFromS3 *ImportAssetsFromS3RequestDetails `type:"structure"` +} + +// String returns the string representation +func (s RequestDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestDetails) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RequestDetails) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RequestDetails"} + if s.ExportAssetToSignedUrl != nil { + if err := s.ExportAssetToSignedUrl.Validate(); err != nil { + invalidParams.AddNested("ExportAssetToSignedUrl", err.(request.ErrInvalidParams)) + } + } + if s.ExportAssetsToS3 != nil { + if err := s.ExportAssetsToS3.Validate(); err != nil { + invalidParams.AddNested("ExportAssetsToS3", err.(request.ErrInvalidParams)) + } + } + if s.ImportAssetFromSignedUrl != nil { + if err := s.ImportAssetFromSignedUrl.Validate(); err != nil { + invalidParams.AddNested("ImportAssetFromSignedUrl", err.(request.ErrInvalidParams)) + } + } + if s.ImportAssetsFromS3 != nil { + if err := s.ImportAssetsFromS3.Validate(); err != nil { + invalidParams.AddNested("ImportAssetsFromS3", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetExportAssetToSignedUrl sets the ExportAssetToSignedUrl field's value. +func (s *RequestDetails) SetExportAssetToSignedUrl(v *ExportAssetToSignedUrlRequestDetails) *RequestDetails { + s.ExportAssetToSignedUrl = v + return s +} + +// SetExportAssetsToS3 sets the ExportAssetsToS3 field's value. +func (s *RequestDetails) SetExportAssetsToS3(v *ExportAssetsToS3RequestDetails) *RequestDetails { + s.ExportAssetsToS3 = v + return s +} + +// SetImportAssetFromSignedUrl sets the ImportAssetFromSignedUrl field's value. +func (s *RequestDetails) SetImportAssetFromSignedUrl(v *ImportAssetFromSignedUrlRequestDetails) *RequestDetails { + s.ImportAssetFromSignedUrl = v + return s +} + +// SetImportAssetsFromS3 sets the ImportAssetsFromS3 field's value. +func (s *RequestDetails) SetImportAssetsFromS3(v *ImportAssetsFromS3RequestDetails) *RequestDetails { + s.ImportAssetsFromS3 = v + return s +} + +// The resource couldn't be found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The resource couldn't be found. + Message_ *string `locationName:"Message" type:"string"` + + // The unique identifier for the resource that couldn't be found. + ResourceId *string `type:"string"` + + // The type of resource that couldn't be found. + ResourceType *string `type:"string" enum:"ResourceType"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Details for the response. +type ResponseDetails struct { + _ struct{} `type:"structure"` + + // Details for the export to signed URL response. + ExportAssetToSignedUrl *ExportAssetToSignedUrlResponseDetails `type:"structure"` + + // Details for the export to Amazon S3 response. + ExportAssetsToS3 *ExportAssetsToS3ResponseDetails `type:"structure"` + + // Details for the import from signed URL response. + ImportAssetFromSignedUrl *ImportAssetFromSignedUrlResponseDetails `type:"structure"` + + // Details for the import from Amazon S3 response. + ImportAssetsFromS3 *ImportAssetsFromS3ResponseDetails `type:"structure"` +} + +// String returns the string representation +func (s ResponseDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResponseDetails) GoString() string { + return s.String() +} + +// SetExportAssetToSignedUrl sets the ExportAssetToSignedUrl field's value. +func (s *ResponseDetails) SetExportAssetToSignedUrl(v *ExportAssetToSignedUrlResponseDetails) *ResponseDetails { + s.ExportAssetToSignedUrl = v + return s +} + +// SetExportAssetsToS3 sets the ExportAssetsToS3 field's value. +func (s *ResponseDetails) SetExportAssetsToS3(v *ExportAssetsToS3ResponseDetails) *ResponseDetails { + s.ExportAssetsToS3 = v + return s +} + +// SetImportAssetFromSignedUrl sets the ImportAssetFromSignedUrl field's value. +func (s *ResponseDetails) SetImportAssetFromSignedUrl(v *ImportAssetFromSignedUrlResponseDetails) *ResponseDetails { + s.ImportAssetFromSignedUrl = v + return s +} + +// SetImportAssetsFromS3 sets the ImportAssetsFromS3 field's value. +func (s *ResponseDetails) SetImportAssetsFromS3(v *ImportAssetsFromS3ResponseDetails) *ResponseDetails { + s.ImportAssetsFromS3 = v + return s +} + +// A revision is a container for one or more assets. +type RevisionEntry struct { + _ struct{} `type:"structure"` + + // The ARN for the revision. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // An optional comment about the revision. + Comment *string `type:"string"` + + // The date and time that the revision was created, in ISO 8601 format. + // + // CreatedAt is a required field + CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // The unique identifier for the data set associated with this revision. + // + // DataSetId is a required field + DataSetId *string `type:"string" required:"true"` + + // To publish a revision to a data set in a product, the revision must first + // be finalized. Finalizing a revision tells AWS Data Exchange that your changes + // to the assets in the revision are complete. After it's in this read-only + // state, you can publish the revision to your products. + // + // Finalized revisions can be published through the AWS Data Exchange console + // or the AWS Marketplace Catalog API, using the StartChangeSet AWS Marketplace + // Catalog API action. When using the API, revisions are uniquely identified + // by their ARN. + Finalized *bool `type:"boolean"` + + // The unique identifier for the revision. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // The revision ID of the owned revision corresponding to the entitled revision + // being viewed. This parameter is returned when a revision owner is viewing + // the entitled copy of its owned revision. + SourceId *string `type:"string"` + + // The date and time that the revision was last updated, in ISO 8601 format. + // + // UpdatedAt is a required field + UpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` +} + +// String returns the string representation +func (s RevisionEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RevisionEntry) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *RevisionEntry) SetArn(v string) *RevisionEntry { + s.Arn = &v + return s +} + +// SetComment sets the Comment field's value. +func (s *RevisionEntry) SetComment(v string) *RevisionEntry { + s.Comment = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *RevisionEntry) SetCreatedAt(v time.Time) *RevisionEntry { + s.CreatedAt = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *RevisionEntry) SetDataSetId(v string) *RevisionEntry { + s.DataSetId = &v + return s +} + +// SetFinalized sets the Finalized field's value. +func (s *RevisionEntry) SetFinalized(v bool) *RevisionEntry { + s.Finalized = &v + return s +} + +// SetId sets the Id field's value. +func (s *RevisionEntry) SetId(v string) *RevisionEntry { + s.Id = &v + return s +} + +// SetSourceId sets the SourceId field's value. +func (s *RevisionEntry) SetSourceId(v string) *RevisionEntry { + s.SourceId = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *RevisionEntry) SetUpdatedAt(v time.Time) *RevisionEntry { + s.UpdatedAt = &v + return s +} + +// The S3 object that is the asset. +type S3SnapshotAsset struct { + _ struct{} `type:"structure"` + + // The size of the S3 object that is the object. + // + // Size is a required field + Size *float64 `type:"double" required:"true"` +} + +// String returns the string representation +func (s S3SnapshotAsset) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s S3SnapshotAsset) GoString() string { + return s.String() +} + +// SetSize sets the Size field's value. +func (s *S3SnapshotAsset) SetSize(v float64) *S3SnapshotAsset { + s.Size = &v + return s +} + +// The request has exceeded the quotas imposed by the service. +type ServiceLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + LimitName *string `type:"string" enum:"LimitName"` + + LimitValue *float64 `type:"double"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ServiceLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceLimitExceededException) GoString() string { + return s.String() +} + +func newErrorServiceLimitExceededException(v protocol.ResponseMetadata) error { + return &ServiceLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceLimitExceededException) Code() string { + return "ServiceLimitExceededException" +} + +// Message returns the exception's message. +func (s ServiceLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceLimitExceededException) OrigErr() error { + return nil +} + +func (s ServiceLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +type StartJobInput struct { + _ struct{} `type:"structure"` + + // JobId is a required field + JobId *string `location:"uri" locationName:"JobId" type:"string" required:"true"` +} + +// String returns the string representation +func (s StartJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartJobInput"} + 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 +} + +// SetJobId sets the JobId field's value. +func (s *StartJobInput) SetJobId(v string) *StartJobInput { + s.JobId = &v + return s +} + +type StartJobOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s StartJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartJobOutput) GoString() string { + return s.String() +} + +type TagResourceInput struct { + _ struct{} `type:"structure"` + + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` + + // Tags is a required field + Tags map[string]*string `locationName:"tags" type:"map" 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 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 map[string]*string) *TagResourceInput { + s.Tags = v + return s +} + +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 limit on the number of requests per second was exceeded. +type ThrottlingException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The limit on the number of requests per second was exceeded. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ThrottlingException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ThrottlingException) GoString() string { + return s.String() +} + +func newErrorThrottlingException(v protocol.ResponseMetadata) error { + return &ThrottlingException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ThrottlingException) Code() string { + return "ThrottlingException" +} + +// Message returns the exception's message. +func (s ThrottlingException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ThrottlingException) OrigErr() error { + return nil +} + +func (s ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ThrottlingException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ThrottlingException) RequestID() string { + return s.respMetadata.RequestID +} + +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` + + // TagKeys is a required field + TagKeys []*string `location:"querystring" locationName:"tagKeys" 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 +} + +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 asset. +type UpdateAssetInput struct { + _ struct{} `type:"structure"` + + // AssetId is a required field + AssetId *string `location:"uri" locationName:"AssetId" type:"string" required:"true"` + + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` + + // The name of the asset. When importing from Amazon S3, the S3 object key is + // used as the asset name. When exporting to Amazon S3, the asset name is used + // as default target S3 object key. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // RevisionId is a required field + RevisionId *string `location:"uri" locationName:"RevisionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateAssetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateAssetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateAssetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateAssetInput"} + if s.AssetId == nil { + invalidParams.Add(request.NewErrParamRequired("AssetId")) + } + if s.AssetId != nil && len(*s.AssetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AssetId", 1)) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + 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 +} + +// SetAssetId sets the AssetId field's value. +func (s *UpdateAssetInput) SetAssetId(v string) *UpdateAssetInput { + s.AssetId = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *UpdateAssetInput) SetDataSetId(v string) *UpdateAssetInput { + s.DataSetId = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateAssetInput) SetName(v string) *UpdateAssetInput { + s.Name = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *UpdateAssetInput) SetRevisionId(v string) *UpdateAssetInput { + s.RevisionId = &v + return s +} + +type UpdateAssetOutput struct { + _ struct{} `type:"structure"` + + // An Amazon Resource Name (ARN) that uniquely identifies an AWS resource. + Arn *string `type:"string"` + + AssetDetails *AssetDetails `type:"structure"` + + // The type of file your data is stored in. Currently, the supported asset type + // is S3_SNAPSHOT. + AssetType *string `type:"string" enum:"AssetType"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + // A unique identifier. + DataSetId *string `type:"string"` + + // A unique identifier. + Id *string `type:"string"` + + // The name of the asset. When importing from Amazon S3, the S3 object key is + // used as the asset name. When exporting to Amazon S3, the asset name is used + // as default target S3 object key. + Name *string `type:"string"` + + // A unique identifier. + RevisionId *string `type:"string"` + + // A unique identifier. + SourceId *string `type:"string"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + UpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` +} + +// String returns the string representation +func (s UpdateAssetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateAssetOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *UpdateAssetOutput) SetArn(v string) *UpdateAssetOutput { + s.Arn = &v + return s +} + +// SetAssetDetails sets the AssetDetails field's value. +func (s *UpdateAssetOutput) SetAssetDetails(v *AssetDetails) *UpdateAssetOutput { + s.AssetDetails = v + return s +} + +// SetAssetType sets the AssetType field's value. +func (s *UpdateAssetOutput) SetAssetType(v string) *UpdateAssetOutput { + s.AssetType = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *UpdateAssetOutput) SetCreatedAt(v time.Time) *UpdateAssetOutput { + s.CreatedAt = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *UpdateAssetOutput) SetDataSetId(v string) *UpdateAssetOutput { + s.DataSetId = &v + return s +} + +// SetId sets the Id field's value. +func (s *UpdateAssetOutput) SetId(v string) *UpdateAssetOutput { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateAssetOutput) SetName(v string) *UpdateAssetOutput { + s.Name = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *UpdateAssetOutput) SetRevisionId(v string) *UpdateAssetOutput { + s.RevisionId = &v + return s +} + +// SetSourceId sets the SourceId field's value. +func (s *UpdateAssetOutput) SetSourceId(v string) *UpdateAssetOutput { + s.SourceId = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *UpdateAssetOutput) SetUpdatedAt(v time.Time) *UpdateAssetOutput { + s.UpdatedAt = &v + return s +} + +// The request to update a data set. +type UpdateDataSetInput struct { + _ struct{} `type:"structure"` + + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` + + // The description for the data set. + Description *string `type:"string"` + + // The name of the data set. + Name *string `type:"string"` +} + +// String returns the string representation +func (s UpdateDataSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateDataSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateDataSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateDataSetInput"} + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDataSetId sets the DataSetId field's value. +func (s *UpdateDataSetInput) SetDataSetId(v string) *UpdateDataSetInput { + s.DataSetId = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *UpdateDataSetInput) SetDescription(v string) *UpdateDataSetInput { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateDataSetInput) SetName(v string) *UpdateDataSetInput { + s.Name = &v + return s +} + +type UpdateDataSetOutput struct { + _ struct{} `type:"structure"` + + // An Amazon Resource Name (ARN) that uniquely identifies an AWS resource. + Arn *string `type:"string"` + + // The type of file your data is stored in. Currently, the supported asset type + // is S3_SNAPSHOT. + AssetType *string `type:"string" enum:"AssetType"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + // A description of a resource. + Description *string `type:"string"` + + // A unique identifier. + Id *string `type:"string"` + + // The name of the model. + Name *string `type:"string"` + + // A property that defines the data set as OWNED by the account (for providers) + // or ENTITLED to the account (for subscribers). When an owned data set is published + // in a product, AWS Data Exchange creates a copy of the data set. Subscribers + // can access that copy of the data set as an entitled data set. + Origin *string `type:"string" enum:"Origin"` + + OriginDetails *OriginDetails `type:"structure"` + + // A unique identifier. + SourceId *string `type:"string"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + UpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` +} + +// String returns the string representation +func (s UpdateDataSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateDataSetOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *UpdateDataSetOutput) SetArn(v string) *UpdateDataSetOutput { + s.Arn = &v + return s +} + +// SetAssetType sets the AssetType field's value. +func (s *UpdateDataSetOutput) SetAssetType(v string) *UpdateDataSetOutput { + s.AssetType = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *UpdateDataSetOutput) SetCreatedAt(v time.Time) *UpdateDataSetOutput { + s.CreatedAt = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *UpdateDataSetOutput) SetDescription(v string) *UpdateDataSetOutput { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *UpdateDataSetOutput) SetId(v string) *UpdateDataSetOutput { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateDataSetOutput) SetName(v string) *UpdateDataSetOutput { + s.Name = &v + return s +} + +// SetOrigin sets the Origin field's value. +func (s *UpdateDataSetOutput) SetOrigin(v string) *UpdateDataSetOutput { + s.Origin = &v + return s +} + +// SetOriginDetails sets the OriginDetails field's value. +func (s *UpdateDataSetOutput) SetOriginDetails(v *OriginDetails) *UpdateDataSetOutput { + s.OriginDetails = v + return s +} + +// SetSourceId sets the SourceId field's value. +func (s *UpdateDataSetOutput) SetSourceId(v string) *UpdateDataSetOutput { + s.SourceId = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *UpdateDataSetOutput) SetUpdatedAt(v time.Time) *UpdateDataSetOutput { + s.UpdatedAt = &v + return s +} + +// The request to update a revision. +type UpdateRevisionInput struct { + _ struct{} `type:"structure"` + + // An optional comment about the revision. + Comment *string `type:"string"` + + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` + + // Finalizing a revision tells AWS Data Exchange that your changes to the assets + // in the revision are complete. After it's in this read-only state, you can + // publish the revision to your products. + Finalized *bool `type:"boolean"` + + // RevisionId is a required field + RevisionId *string `location:"uri" locationName:"RevisionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateRevisionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateRevisionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateRevisionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateRevisionInput"} + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 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 +} + +// SetComment sets the Comment field's value. +func (s *UpdateRevisionInput) SetComment(v string) *UpdateRevisionInput { + s.Comment = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *UpdateRevisionInput) SetDataSetId(v string) *UpdateRevisionInput { + s.DataSetId = &v + return s +} + +// SetFinalized sets the Finalized field's value. +func (s *UpdateRevisionInput) SetFinalized(v bool) *UpdateRevisionInput { + s.Finalized = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *UpdateRevisionInput) SetRevisionId(v string) *UpdateRevisionInput { + s.RevisionId = &v + return s +} + +type UpdateRevisionOutput struct { + _ struct{} `type:"structure"` + + // An Amazon Resource Name (ARN) that uniquely identifies an AWS resource. + Arn *string `type:"string"` + + Comment *string `type:"string"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + CreatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + // A unique identifier. + DataSetId *string `type:"string"` + + Finalized *bool `type:"boolean"` + + // A unique identifier. + Id *string `type:"string"` + + // A unique identifier. + SourceId *string `type:"string"` + + // Dates and times in AWS Data Exchange are recorded in ISO 8601 format. + UpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` +} + +// String returns the string representation +func (s UpdateRevisionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateRevisionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *UpdateRevisionOutput) SetArn(v string) *UpdateRevisionOutput { + s.Arn = &v + return s +} + +// SetComment sets the Comment field's value. +func (s *UpdateRevisionOutput) SetComment(v string) *UpdateRevisionOutput { + s.Comment = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *UpdateRevisionOutput) SetCreatedAt(v time.Time) *UpdateRevisionOutput { + s.CreatedAt = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *UpdateRevisionOutput) SetDataSetId(v string) *UpdateRevisionOutput { + s.DataSetId = &v + return s +} + +// SetFinalized sets the Finalized field's value. +func (s *UpdateRevisionOutput) SetFinalized(v bool) *UpdateRevisionOutput { + s.Finalized = &v + return s +} + +// SetId sets the Id field's value. +func (s *UpdateRevisionOutput) SetId(v string) *UpdateRevisionOutput { + s.Id = &v + return s +} + +// SetSourceId sets the SourceId field's value. +func (s *UpdateRevisionOutput) SetSourceId(v string) *UpdateRevisionOutput { + s.SourceId = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *UpdateRevisionOutput) SetUpdatedAt(v time.Time) *UpdateRevisionOutput { + s.UpdatedAt = &v + return s +} + +// The request was invalid. +type ValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message that informs you about what was invalid about the request. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationException) GoString() string { + return s.String() +} + +func newErrorValidationException(v protocol.ResponseMetadata) error { + return &ValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ValidationException) Code() string { + return "ValidationException" +} + +// Message returns the exception's message. +func (s ValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ValidationException) OrigErr() error { + return nil +} + +func (s ValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ValidationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The type of file your data is stored in. Currently, the supported asset type +// is S3_SNAPSHOT. +const ( + // AssetTypeS3Snapshot is a AssetType enum value + AssetTypeS3Snapshot = "S3_SNAPSHOT" +) + +const ( + // CodeAccessDeniedException is a Code enum value + CodeAccessDeniedException = "ACCESS_DENIED_EXCEPTION" + + // CodeInternalServerException is a Code enum value + CodeInternalServerException = "INTERNAL_SERVER_EXCEPTION" + + // CodeMalwareDetected is a Code enum value + CodeMalwareDetected = "MALWARE_DETECTED" + + // CodeResourceNotFoundException is a Code enum value + CodeResourceNotFoundException = "RESOURCE_NOT_FOUND_EXCEPTION" + + // CodeServiceQuotaExceededException is a Code enum value + CodeServiceQuotaExceededException = "SERVICE_QUOTA_EXCEEDED_EXCEPTION" + + // CodeValidationException is a Code enum value + CodeValidationException = "VALIDATION_EXCEPTION" + + // CodeMalwareScanEncryptedFile is a Code enum value + CodeMalwareScanEncryptedFile = "MALWARE_SCAN_ENCRYPTED_FILE" +) + +// The name of the limit that was reached. +const ( + // JobErrorLimitNameAssetsperrevision is a JobErrorLimitName enum value + JobErrorLimitNameAssetsperrevision = "Assets per revision" + + // JobErrorLimitNameAssetsizeinGb is a JobErrorLimitName enum value + JobErrorLimitNameAssetsizeinGb = "Asset size in GB" +) + +// The types of resource which the job error can apply to. +const ( + // JobErrorResourceTypesRevision is a JobErrorResourceTypes enum value + JobErrorResourceTypesRevision = "REVISION" + + // JobErrorResourceTypesAsset is a JobErrorResourceTypes enum value + JobErrorResourceTypesAsset = "ASSET" +) + +const ( + // LimitNameProductsperaccount is a LimitName enum value + LimitNameProductsperaccount = "Products per account" + + // LimitNameDatasetsperaccount is a LimitName enum value + LimitNameDatasetsperaccount = "Data sets per account" + + // LimitNameDatasetsperproduct is a LimitName enum value + LimitNameDatasetsperproduct = "Data sets per product" + + // LimitNameRevisionsperdataset is a LimitName enum value + LimitNameRevisionsperdataset = "Revisions per data set" + + // LimitNameAssetsperrevision is a LimitName enum value + LimitNameAssetsperrevision = "Assets per revision" + + // LimitNameAssetsperimportjobfromAmazonS3 is a LimitName enum value + LimitNameAssetsperimportjobfromAmazonS3 = "Assets per import job from Amazon S3" + + // LimitNameAssetperexportjobfromAmazonS3 is a LimitName enum value + LimitNameAssetperexportjobfromAmazonS3 = "Asset per export job from Amazon S3" + + // LimitNameAssetsizeinGb is a LimitName enum value + LimitNameAssetsizeinGb = "Asset size in GB" + + // LimitNameConcurrentinprogressjobstoimportassetsfromAmazonS3 is a LimitName enum value + LimitNameConcurrentinprogressjobstoimportassetsfromAmazonS3 = "Concurrent in progress jobs to import assets from Amazon S3" + + // LimitNameConcurrentinprogressjobstoimportassetsfromasignedUrl is a LimitName enum value + LimitNameConcurrentinprogressjobstoimportassetsfromasignedUrl = "Concurrent in progress jobs to import assets from a signed URL" + + // LimitNameConcurrentinprogressjobstoexportassetstoAmazonS3 is a LimitName enum value + LimitNameConcurrentinprogressjobstoexportassetstoAmazonS3 = "Concurrent in progress jobs to export assets to Amazon S3" + + // LimitNameConcurrentinprogressjobstoexportassetstoasignedUrl is a LimitName enum value + LimitNameConcurrentinprogressjobstoexportassetstoasignedUrl = "Concurrent in progress jobs to export assets to a signed URL" +) + +// A property that defines the data set as OWNED by the account (for providers) +// or ENTITLED to the account (for subscribers). When an owned data set is published +// in a product, AWS Data Exchange creates a copy of the data set. Subscribers +// can access that copy of the data set as an entitled data set. +const ( + // OriginOwned is a Origin enum value + OriginOwned = "OWNED" + + // OriginEntitled is a Origin enum value + OriginEntitled = "ENTITLED" +) + +const ( + // ResourceTypeDataSet is a ResourceType enum value + ResourceTypeDataSet = "DATA_SET" + + // ResourceTypeRevision is a ResourceType enum value + ResourceTypeRevision = "REVISION" + + // ResourceTypeAsset is a ResourceType enum value + ResourceTypeAsset = "ASSET" + + // ResourceTypeJob is a ResourceType enum value + ResourceTypeJob = "JOB" +) + +const ( + // StateWaiting is a State enum value + StateWaiting = "WAITING" + + // StateInProgress is a State enum value + StateInProgress = "IN_PROGRESS" + + // StateError is a State enum value + StateError = "ERROR" + + // StateCompleted is a State enum value + StateCompleted = "COMPLETED" + + // StateCancelled is a State enum value + StateCancelled = "CANCELLED" + + // StateTimedOut is a State enum value + StateTimedOut = "TIMED_OUT" +) + +const ( + // TypeImportAssetsFromS3 is a Type enum value + TypeImportAssetsFromS3 = "IMPORT_ASSETS_FROM_S3" + + // TypeImportAssetFromSignedUrl is a Type enum value + TypeImportAssetFromSignedUrl = "IMPORT_ASSET_FROM_SIGNED_URL" + + // TypeExportAssetsToS3 is a Type enum value + TypeExportAssetsToS3 = "EXPORT_ASSETS_TO_S3" + + // TypeExportAssetToSignedUrl is a Type enum value + TypeExportAssetToSignedUrl = "EXPORT_ASSET_TO_SIGNED_URL" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/dataexchange/doc.go b/vendor/github.com/aws/aws-sdk-go/service/dataexchange/doc.go new file mode 100644 index 00000000000..a1486a7f5bd --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/dataexchange/doc.go @@ -0,0 +1,28 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package dataexchange provides the client and types for making API +// requests to AWS Data Exchange. +// +// This is the API reference for AWS Data Exchange. +// +// See https://docs.aws.amazon.com/goto/WebAPI/dataexchange-2017-07-25 for more information on this service. +// +// See dataexchange package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/dataexchange/ +// +// Using the Client +// +// To contact AWS Data Exchange 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 Data Exchange client DataExchange for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/dataexchange/#New +package dataexchange diff --git a/vendor/github.com/aws/aws-sdk-go/service/dataexchange/errors.go b/vendor/github.com/aws/aws-sdk-go/service/dataexchange/errors.go new file mode 100644 index 00000000000..7211a5637c6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/dataexchange/errors.go @@ -0,0 +1,63 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package dataexchange + +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + +const ( + + // ErrCodeAccessDeniedException for service response error code + // "AccessDeniedException". + // + // Access to the resource is denied. + ErrCodeAccessDeniedException = "AccessDeniedException" + + // ErrCodeConflictException for service response error code + // "ConflictException". + // + // The request couldn't be completed because it conflicted with the current + // state of the resource. + ErrCodeConflictException = "ConflictException" + + // ErrCodeInternalServerException for service response error code + // "InternalServerException". + // + // An exception occurred with the service. + ErrCodeInternalServerException = "InternalServerException" + + // ErrCodeResourceNotFoundException for service response error code + // "ResourceNotFoundException". + // + // The resource couldn't be found. + ErrCodeResourceNotFoundException = "ResourceNotFoundException" + + // ErrCodeServiceLimitExceededException for service response error code + // "ServiceLimitExceededException". + // + // The request has exceeded the quotas imposed by the service. + ErrCodeServiceLimitExceededException = "ServiceLimitExceededException" + + // ErrCodeThrottlingException for service response error code + // "ThrottlingException". + // + // The limit on the number of requests per second was exceeded. + ErrCodeThrottlingException = "ThrottlingException" + + // ErrCodeValidationException for service response error code + // "ValidationException". + // + // The request was invalid. + ErrCodeValidationException = "ValidationException" +) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "ConflictException": newErrorConflictException, + "InternalServerException": newErrorInternalServerException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ServiceLimitExceededException": newErrorServiceLimitExceededException, + "ThrottlingException": newErrorThrottlingException, + "ValidationException": newErrorValidationException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dataexchange/service.go b/vendor/github.com/aws/aws-sdk-go/service/dataexchange/service.go new file mode 100644 index 00000000000..ccf045d612a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/dataexchange/service.go @@ -0,0 +1,104 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package dataexchange + +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" + "github.com/aws/aws-sdk-go/private/protocol/restjson" +) + +// DataExchange provides the API operation methods for making requests to +// AWS Data Exchange. See this package's package overview docs +// for details on the service. +// +// DataExchange methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type DataExchange 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 = "DataExchange" // Name of service. + EndpointsID = "dataexchange" // ID to lookup a service endpoint with. + ServiceID = "DataExchange" // ServiceID is a unique identifier of a specific service. +) + +// New creates a new instance of the DataExchange client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// mySession := session.Must(session.NewSession()) +// +// // Create a DataExchange client from just a session. +// svc := dataexchange.New(mySession) +// +// // Create a DataExchange client with additional configuration +// svc := dataexchange.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *DataExchange { + c := p.ClientConfig(EndpointsID, cfgs...) + if c.SigningNameDerived || len(c.SigningName) == 0 { + c.SigningName = "dataexchange" + } + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *DataExchange { + svc := &DataExchange{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + PartitionID: partitionID, + Endpoint: endpoint, + APIVersion: "2017-07-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( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a DataExchange operation and runs any +// custom request initialization. +func (c *DataExchange) 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/datapipeline/api.go b/vendor/github.com/aws/aws-sdk-go/service/datapipeline/api.go index 12299e88b4d..196fab8abbf 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/datapipeline/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/datapipeline/api.go @@ -74,18 +74,18 @@ func (c *DataPipeline) ActivatePipelineRequest(input *ActivatePipelineInput) (re // See the AWS API reference guide for AWS Data Pipeline's // API operation ActivatePipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// Returned Error Types: +// * PipelineNotFoundException // The specified pipeline was not found. Verify that you used the correct user // and account identifiers. // -// * ErrCodePipelineDeletedException "PipelineDeletedException" +// * PipelineDeletedException // The specified pipeline has been deleted. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. @@ -166,20 +166,20 @@ func (c *DataPipeline) AddTagsRequest(input *AddTagsInput) (req *request.Request // See the AWS API reference guide for AWS Data Pipeline's // API operation AddTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceError "InternalServiceError" +// Returned Error Types: +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The specified pipeline was not found. Verify that you used the correct user // and account identifiers. // -// * ErrCodePipelineDeletedException "PipelineDeletedException" +// * PipelineDeletedException // The specified pipeline has been deleted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datapipeline-2012-10-29/AddTags @@ -258,11 +258,11 @@ func (c *DataPipeline) CreatePipelineRequest(input *CreatePipelineInput) (req *r // See the AWS API reference guide for AWS Data Pipeline's // API operation CreatePipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceError "InternalServiceError" +// Returned Error Types: +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. @@ -348,18 +348,18 @@ func (c *DataPipeline) DeactivatePipelineRequest(input *DeactivatePipelineInput) // See the AWS API reference guide for AWS Data Pipeline's // API operation DeactivatePipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// Returned Error Types: +// * PipelineNotFoundException // The specified pipeline was not found. Verify that you used the correct user // and account identifiers. // -// * ErrCodePipelineDeletedException "PipelineDeletedException" +// * PipelineDeletedException // The specified pipeline has been deleted. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. @@ -447,15 +447,15 @@ func (c *DataPipeline) DeletePipelineRequest(input *DeletePipelineInput) (req *r // See the AWS API reference guide for AWS Data Pipeline's // API operation DeletePipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// Returned Error Types: +// * PipelineNotFoundException // The specified pipeline was not found. Verify that you used the correct user // and account identifiers. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. @@ -543,20 +543,20 @@ func (c *DataPipeline) DescribeObjectsRequest(input *DescribeObjectsInput) (req // See the AWS API reference guide for AWS Data Pipeline's // API operation DescribeObjects for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceError "InternalServiceError" +// Returned Error Types: +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The specified pipeline was not found. Verify that you used the correct user // and account identifiers. // -// * ErrCodePipelineDeletedException "PipelineDeletedException" +// * PipelineDeletedException // The specified pipeline has been deleted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datapipeline-2012-10-29/DescribeObjects @@ -624,10 +624,12 @@ func (c *DataPipeline) DescribeObjectsPagesWithContext(ctx aws.Context, input *D }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeObjectsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeObjectsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -692,18 +694,18 @@ func (c *DataPipeline) DescribePipelinesRequest(input *DescribePipelinesInput) ( // See the AWS API reference guide for AWS Data Pipeline's // API operation DescribePipelines for usage and error information. // -// Returned Error Codes: -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// Returned Error Types: +// * PipelineNotFoundException // The specified pipeline was not found. Verify that you used the correct user // and account identifiers. // -// * ErrCodePipelineDeletedException "PipelineDeletedException" +// * PipelineDeletedException // The specified pipeline has been deleted. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. @@ -785,23 +787,23 @@ func (c *DataPipeline) EvaluateExpressionRequest(input *EvaluateExpressionInput) // See the AWS API reference guide for AWS Data Pipeline's // API operation EvaluateExpression for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceError "InternalServiceError" +// Returned Error Types: +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeTaskNotFoundException "TaskNotFoundException" +// * TaskNotFoundException // The specified task was not found. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The specified pipeline was not found. Verify that you used the correct user // and account identifiers. // -// * ErrCodePipelineDeletedException "PipelineDeletedException" +// * PipelineDeletedException // The specified pipeline has been deleted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datapipeline-2012-10-29/EvaluateExpression @@ -880,20 +882,20 @@ func (c *DataPipeline) GetPipelineDefinitionRequest(input *GetPipelineDefinition // See the AWS API reference guide for AWS Data Pipeline's // API operation GetPipelineDefinition for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceError "InternalServiceError" +// Returned Error Types: +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The specified pipeline was not found. Verify that you used the correct user // and account identifiers. // -// * ErrCodePipelineDeletedException "PipelineDeletedException" +// * PipelineDeletedException // The specified pipeline has been deleted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datapipeline-2012-10-29/GetPipelineDefinition @@ -978,11 +980,11 @@ func (c *DataPipeline) ListPipelinesRequest(input *ListPipelinesInput) (req *req // See the AWS API reference guide for AWS Data Pipeline's // API operation ListPipelines for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceError "InternalServiceError" +// Returned Error Types: +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. @@ -1052,10 +1054,12 @@ func (c *DataPipeline) ListPipelinesPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPipelinesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPipelinesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1125,16 +1129,16 @@ func (c *DataPipeline) PollForTaskRequest(input *PollForTaskInput) (req *request // See the AWS API reference guide for AWS Data Pipeline's // API operation PollForTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceError "InternalServiceError" +// Returned Error Types: +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. // -// * ErrCodeTaskNotFoundException "TaskNotFoundException" +// * TaskNotFoundException // The specified task was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datapipeline-2012-10-29/PollForTask @@ -1222,20 +1226,20 @@ func (c *DataPipeline) PutPipelineDefinitionRequest(input *PutPipelineDefinition // See the AWS API reference guide for AWS Data Pipeline's // API operation PutPipelineDefinition for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceError "InternalServiceError" +// Returned Error Types: +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The specified pipeline was not found. Verify that you used the correct user // and account identifiers. // -// * ErrCodePipelineDeletedException "PipelineDeletedException" +// * PipelineDeletedException // The specified pipeline has been deleted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datapipeline-2012-10-29/PutPipelineDefinition @@ -1320,18 +1324,18 @@ func (c *DataPipeline) QueryObjectsRequest(input *QueryObjectsInput) (req *reque // See the AWS API reference guide for AWS Data Pipeline's // API operation QueryObjects for usage and error information. // -// Returned Error Codes: -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// Returned Error Types: +// * PipelineNotFoundException // The specified pipeline was not found. Verify that you used the correct user // and account identifiers. // -// * ErrCodePipelineDeletedException "PipelineDeletedException" +// * PipelineDeletedException // The specified pipeline has been deleted. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. @@ -1401,10 +1405,12 @@ func (c *DataPipeline) QueryObjectsPagesWithContext(ctx aws.Context, input *Quer }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*QueryObjectsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*QueryObjectsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1462,20 +1468,20 @@ func (c *DataPipeline) RemoveTagsRequest(input *RemoveTagsInput) (req *request.R // See the AWS API reference guide for AWS Data Pipeline's // API operation RemoveTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceError "InternalServiceError" +// Returned Error Types: +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The specified pipeline was not found. Verify that you used the correct user // and account identifiers. // -// * ErrCodePipelineDeletedException "PipelineDeletedException" +// * PipelineDeletedException // The specified pipeline has been deleted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datapipeline-2012-10-29/RemoveTags @@ -1564,23 +1570,23 @@ func (c *DataPipeline) ReportTaskProgressRequest(input *ReportTaskProgressInput) // See the AWS API reference guide for AWS Data Pipeline's // API operation ReportTaskProgress for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceError "InternalServiceError" +// Returned Error Types: +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. // -// * ErrCodeTaskNotFoundException "TaskNotFoundException" +// * TaskNotFoundException // The specified task was not found. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The specified pipeline was not found. Verify that you used the correct user // and account identifiers. // -// * ErrCodePipelineDeletedException "PipelineDeletedException" +// * PipelineDeletedException // The specified pipeline has been deleted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datapipeline-2012-10-29/ReportTaskProgress @@ -1662,11 +1668,11 @@ func (c *DataPipeline) ReportTaskRunnerHeartbeatRequest(input *ReportTaskRunnerH // See the AWS API reference guide for AWS Data Pipeline's // API operation ReportTaskRunnerHeartbeat for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceError "InternalServiceError" +// Returned Error Types: +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. @@ -1751,18 +1757,18 @@ func (c *DataPipeline) SetStatusRequest(input *SetStatusInput) (req *request.Req // See the AWS API reference guide for AWS Data Pipeline's // API operation SetStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// Returned Error Types: +// * PipelineNotFoundException // The specified pipeline was not found. Verify that you used the correct user // and account identifiers. // -// * ErrCodePipelineDeletedException "PipelineDeletedException" +// * PipelineDeletedException // The specified pipeline has been deleted. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. @@ -1847,23 +1853,23 @@ func (c *DataPipeline) SetTaskStatusRequest(input *SetTaskStatusInput) (req *req // See the AWS API reference guide for AWS Data Pipeline's // API operation SetTaskStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceError "InternalServiceError" +// Returned Error Types: +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeTaskNotFoundException "TaskNotFoundException" +// * TaskNotFoundException // The specified task was not found. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The specified pipeline was not found. Verify that you used the correct user // and account identifiers. // -// * ErrCodePipelineDeletedException "PipelineDeletedException" +// * PipelineDeletedException // The specified pipeline has been deleted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datapipeline-2012-10-29/SetTaskStatus @@ -1942,20 +1948,20 @@ func (c *DataPipeline) ValidatePipelineDefinitionRequest(input *ValidatePipeline // See the AWS API reference guide for AWS Data Pipeline's // API operation ValidatePipelineDefinition for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceError "InternalServiceError" +// Returned Error Types: +// * InternalServiceError // An internal service error occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. Verify that your request was properly formatted, // that the signature was generated with the correct credentials, and that you // haven't exceeded any of the service limits for your account. // -// * ErrCodePipelineNotFoundException "PipelineNotFoundException" +// * PipelineNotFoundException // The specified pipeline was not found. Verify that you used the correct user // and account identifiers. // -// * ErrCodePipelineDeletedException "PipelineDeletedException" +// * PipelineDeletedException // The specified pipeline has been deleted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datapipeline-2012-10-29/ValidatePipelineDefinition @@ -2891,6 +2897,122 @@ func (s *InstanceIdentity) SetSignature(v string) *InstanceIdentity { return s } +// An internal service error occurred. +type InternalServiceError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Description of the error message. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalServiceError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServiceError) GoString() string { + return s.String() +} + +func newErrorInternalServiceError(v protocol.ResponseMetadata) error { + return &InternalServiceError{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServiceError) Code() string { + return "InternalServiceError" +} + +// Message returns the exception's message. +func (s InternalServiceError) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServiceError) OrigErr() error { + return nil +} + +func (s InternalServiceError) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServiceError) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServiceError) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was not valid. Verify that your request was properly formatted, +// that the signature was generated with the correct credentials, and that you +// haven't exceeded any of the service limits for your account. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Description of the error message. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains the parameters for ListPipelines. type ListPipelinesInput struct { _ struct{} `type:"structure"` @@ -3220,6 +3342,63 @@ func (s *ParameterValue) SetStringValue(v string) *ParameterValue { return s } +// The specified pipeline has been deleted. +type PipelineDeletedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Description of the error message. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PipelineDeletedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PipelineDeletedException) GoString() string { + return s.String() +} + +func newErrorPipelineDeletedException(v protocol.ResponseMetadata) error { + return &PipelineDeletedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PipelineDeletedException) Code() string { + return "PipelineDeletedException" +} + +// Message returns the exception's message. +func (s PipelineDeletedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PipelineDeletedException) OrigErr() error { + return nil +} + +func (s PipelineDeletedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PipelineDeletedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PipelineDeletedException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains pipeline metadata. type PipelineDescription struct { _ struct{} `type:"structure"` @@ -3325,6 +3504,64 @@ func (s *PipelineIdName) SetName(v string) *PipelineIdName { return s } +// The specified pipeline was not found. Verify that you used the correct user +// and account identifiers. +type PipelineNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Description of the error message. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PipelineNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PipelineNotFoundException) GoString() string { + return s.String() +} + +func newErrorPipelineNotFoundException(v protocol.ResponseMetadata) error { + return &PipelineNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PipelineNotFoundException) Code() string { + return "PipelineNotFoundException" +} + +// Message returns the exception's message. +func (s PipelineNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PipelineNotFoundException) OrigErr() error { + return nil +} + +func (s PipelineNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PipelineNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PipelineNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains information about a pipeline object. This can be a logical, physical, // or physical attempt pipeline object. The complete set of components of a // pipeline defines the pipeline. @@ -4373,6 +4610,63 @@ func (s *Tag) SetValue(v string) *Tag { return s } +// The specified task was not found. +type TaskNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Description of the error message. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TaskNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TaskNotFoundException) GoString() string { + return s.String() +} + +func newErrorTaskNotFoundException(v protocol.ResponseMetadata) error { + return &TaskNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TaskNotFoundException) Code() string { + return "TaskNotFoundException" +} + +// Message returns the exception's message. +func (s TaskNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TaskNotFoundException) OrigErr() error { + return nil +} + +func (s TaskNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TaskNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TaskNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains information about a pipeline task that is assigned to a task runner. type TaskObject struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/datapipeline/errors.go b/vendor/github.com/aws/aws-sdk-go/service/datapipeline/errors.go index f60b7da9f17..872ff496372 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/datapipeline/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/datapipeline/errors.go @@ -2,6 +2,10 @@ package datapipeline +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInternalServiceError for service response error code @@ -37,3 +41,11 @@ const ( // The specified task was not found. ErrCodeTaskNotFoundException = "TaskNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InternalServiceError": newErrorInternalServiceError, + "InvalidRequestException": newErrorInvalidRequestException, + "PipelineDeletedException": newErrorPipelineDeletedException, + "PipelineNotFoundException": newErrorPipelineNotFoundException, + "TaskNotFoundException": newErrorTaskNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/datapipeline/service.go b/vendor/github.com/aws/aws-sdk-go/service/datapipeline/service.go index ebd5c29b2fc..560d0e31e4a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/datapipeline/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/datapipeline/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "datapipeline" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Data Pipeline" // ServiceID is a unique identifer of a specific service. + ServiceID = "Data Pipeline" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the DataPipeline client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a DataPipeline client from just a session. // svc := datapipeline.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := datapipeline.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *DataPipeline { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *DataPipeline { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *DataPipeline { svc := &DataPipeline{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2012-10-29", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/datasync/api.go b/vendor/github.com/aws/aws-sdk-go/service/datasync/api.go index e4c6d62fd69..affac0d7d75 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/datasync/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/datasync/api.go @@ -76,11 +76,11 @@ func (c *DataSync) CancelTaskExecutionRequest(input *CancelTaskExecutionInput) ( // See the AWS API reference guide for AWS DataSync's // API operation CancelTaskExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CancelTaskExecution @@ -175,11 +175,11 @@ func (c *DataSync) CreateAgentRequest(input *CreateAgentInput) (req *request.Req // See the AWS API reference guide for AWS DataSync's // API operation CreateAgent for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CreateAgent @@ -257,11 +257,11 @@ func (c *DataSync) CreateLocationEfsRequest(input *CreateLocationEfsInput) (req // See the AWS API reference guide for AWS DataSync's // API operation CreateLocationEfs for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CreateLocationEfs @@ -286,6 +286,88 @@ func (c *DataSync) CreateLocationEfsWithContext(ctx aws.Context, input *CreateLo return out, req.Send() } +const opCreateLocationFsxWindows = "CreateLocationFsxWindows" + +// CreateLocationFsxWindowsRequest generates a "aws/request.Request" representing the +// client's request for the CreateLocationFsxWindows operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateLocationFsxWindows for more information on using the CreateLocationFsxWindows +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateLocationFsxWindowsRequest method. +// req, resp := client.CreateLocationFsxWindowsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CreateLocationFsxWindows +func (c *DataSync) CreateLocationFsxWindowsRequest(input *CreateLocationFsxWindowsInput) (req *request.Request, output *CreateLocationFsxWindowsOutput) { + op := &request.Operation{ + Name: opCreateLocationFsxWindows, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateLocationFsxWindowsInput{} + } + + output = &CreateLocationFsxWindowsOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateLocationFsxWindows API operation for AWS DataSync. +// +// Creates an endpoint for an Amazon FSx for Windows file 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 AWS DataSync's +// API operation CreateLocationFsxWindows for usage and error information. +// +// Returned Error Types: +// * InvalidRequestException +// This exception is thrown when the client submits a malformed request. +// +// * InternalException +// This exception is thrown when an error occurs in the AWS DataSync service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CreateLocationFsxWindows +func (c *DataSync) CreateLocationFsxWindows(input *CreateLocationFsxWindowsInput) (*CreateLocationFsxWindowsOutput, error) { + req, out := c.CreateLocationFsxWindowsRequest(input) + return out, req.Send() +} + +// CreateLocationFsxWindowsWithContext is the same as CreateLocationFsxWindows with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLocationFsxWindows for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataSync) CreateLocationFsxWindowsWithContext(ctx aws.Context, input *CreateLocationFsxWindowsInput, opts ...request.Option) (*CreateLocationFsxWindowsOutput, error) { + req, out := c.CreateLocationFsxWindowsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateLocationNfs = "CreateLocationNfs" // CreateLocationNfsRequest generates a "aws/request.Request" representing the @@ -330,7 +412,8 @@ func (c *DataSync) CreateLocationNfsRequest(input *CreateLocationNfsInput) (req // CreateLocationNfs API operation for AWS DataSync. // -// Creates an endpoint for a Network File System (NFS) file system. +// Defines a file system on a Network File System (NFS) server that can be read +// from or written to // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -339,11 +422,11 @@ func (c *DataSync) CreateLocationNfsRequest(input *CreateLocationNfsInput) (req // See the AWS API reference guide for AWS DataSync's // API operation CreateLocationNfs for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CreateLocationNfs @@ -430,11 +513,11 @@ func (c *DataSync) CreateLocationS3Request(input *CreateLocationS3Input) (req *r // See the AWS API reference guide for AWS DataSync's // API operation CreateLocationS3 for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CreateLocationS3 @@ -503,7 +586,8 @@ func (c *DataSync) CreateLocationSmbRequest(input *CreateLocationSmbInput) (req // CreateLocationSmb API operation for AWS DataSync. // -// Creates an endpoint for a Server Message Block (SMB) file system. +// Defines a file system on an Server Message Block (SMB) server that can be +// read from or written to. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -512,11 +596,11 @@ func (c *DataSync) CreateLocationSmbRequest(input *CreateLocationSmbInput) (req // See the AWS API reference guide for AWS DataSync's // API operation CreateLocationSmb for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CreateLocationSmb @@ -610,11 +694,11 @@ func (c *DataSync) CreateTaskRequest(input *CreateTaskInput) (req *request.Reque // See the AWS API reference guide for AWS DataSync's // API operation CreateTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/CreateTask @@ -696,11 +780,11 @@ func (c *DataSync) DeleteAgentRequest(input *DeleteAgentInput) (req *request.Req // See the AWS API reference guide for AWS DataSync's // API operation DeleteAgent for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DeleteAgent @@ -779,11 +863,11 @@ func (c *DataSync) DeleteLocationRequest(input *DeleteLocationInput) (req *reque // See the AWS API reference guide for AWS DataSync's // API operation DeleteLocation for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DeleteLocation @@ -862,11 +946,11 @@ func (c *DataSync) DeleteTaskRequest(input *DeleteTaskInput) (req *request.Reque // See the AWS API reference guide for AWS DataSync's // API operation DeleteTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DeleteTask @@ -947,11 +1031,11 @@ func (c *DataSync) DescribeAgentRequest(input *DescribeAgentInput) (req *request // See the AWS API reference guide for AWS DataSync's // API operation DescribeAgent for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DescribeAgent @@ -1029,11 +1113,11 @@ func (c *DataSync) DescribeLocationEfsRequest(input *DescribeLocationEfsInput) ( // See the AWS API reference guide for AWS DataSync's // API operation DescribeLocationEfs for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DescribeLocationEfs @@ -1058,6 +1142,89 @@ func (c *DataSync) DescribeLocationEfsWithContext(ctx aws.Context, input *Descri return out, req.Send() } +const opDescribeLocationFsxWindows = "DescribeLocationFsxWindows" + +// DescribeLocationFsxWindowsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLocationFsxWindows operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeLocationFsxWindows for more information on using the DescribeLocationFsxWindows +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeLocationFsxWindowsRequest method. +// req, resp := client.DescribeLocationFsxWindowsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DescribeLocationFsxWindows +func (c *DataSync) DescribeLocationFsxWindowsRequest(input *DescribeLocationFsxWindowsInput) (req *request.Request, output *DescribeLocationFsxWindowsOutput) { + op := &request.Operation{ + Name: opDescribeLocationFsxWindows, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeLocationFsxWindowsInput{} + } + + output = &DescribeLocationFsxWindowsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeLocationFsxWindows API operation for AWS DataSync. +// +// Returns metadata, such as the path information about an Amazon FSx for Windows +// location. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS DataSync's +// API operation DescribeLocationFsxWindows for usage and error information. +// +// Returned Error Types: +// * InvalidRequestException +// This exception is thrown when the client submits a malformed request. +// +// * InternalException +// This exception is thrown when an error occurs in the AWS DataSync service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DescribeLocationFsxWindows +func (c *DataSync) DescribeLocationFsxWindows(input *DescribeLocationFsxWindowsInput) (*DescribeLocationFsxWindowsOutput, error) { + req, out := c.DescribeLocationFsxWindowsRequest(input) + return out, req.Send() +} + +// DescribeLocationFsxWindowsWithContext is the same as DescribeLocationFsxWindows with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLocationFsxWindows for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DataSync) DescribeLocationFsxWindowsWithContext(ctx aws.Context, input *DescribeLocationFsxWindowsInput, opts ...request.Option) (*DescribeLocationFsxWindowsOutput, error) { + req, out := c.DescribeLocationFsxWindowsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeLocationNfs = "DescribeLocationNfs" // DescribeLocationNfsRequest generates a "aws/request.Request" representing the @@ -1111,11 +1278,11 @@ func (c *DataSync) DescribeLocationNfsRequest(input *DescribeLocationNfsInput) ( // See the AWS API reference guide for AWS DataSync's // API operation DescribeLocationNfs for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DescribeLocationNfs @@ -1193,11 +1360,11 @@ func (c *DataSync) DescribeLocationS3Request(input *DescribeLocationS3Input) (re // See the AWS API reference guide for AWS DataSync's // API operation DescribeLocationS3 for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DescribeLocationS3 @@ -1275,11 +1442,11 @@ func (c *DataSync) DescribeLocationSmbRequest(input *DescribeLocationSmbInput) ( // See the AWS API reference guide for AWS DataSync's // API operation DescribeLocationSmb for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DescribeLocationSmb @@ -1357,11 +1524,11 @@ func (c *DataSync) DescribeTaskRequest(input *DescribeTaskInput) (req *request.R // See the AWS API reference guide for AWS DataSync's // API operation DescribeTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DescribeTask @@ -1439,11 +1606,11 @@ func (c *DataSync) DescribeTaskExecutionRequest(input *DescribeTaskExecutionInpu // See the AWS API reference guide for AWS DataSync's // API operation DescribeTaskExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/DescribeTaskExecution @@ -1537,11 +1704,11 @@ func (c *DataSync) ListAgentsRequest(input *ListAgentsInput) (req *request.Reque // See the AWS API reference guide for AWS DataSync's // API operation ListAgents for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/ListAgents @@ -1609,10 +1776,12 @@ func (c *DataSync) ListAgentsPagesWithContext(ctx aws.Context, input *ListAgents }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAgentsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAgentsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1680,11 +1849,11 @@ func (c *DataSync) ListLocationsRequest(input *ListLocationsInput) (req *request // See the AWS API reference guide for AWS DataSync's // API operation ListLocations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/ListLocations @@ -1752,10 +1921,12 @@ func (c *DataSync) ListLocationsPagesWithContext(ctx aws.Context, input *ListLoc }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListLocationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListLocationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1818,11 +1989,11 @@ func (c *DataSync) ListTagsForResourceRequest(input *ListTagsForResourceInput) ( // See the AWS API reference guide for AWS DataSync's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/ListTagsForResource @@ -1890,10 +2061,12 @@ func (c *DataSync) ListTagsForResourcePagesWithContext(ctx aws.Context, input *L }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1956,11 +2129,11 @@ func (c *DataSync) ListTaskExecutionsRequest(input *ListTaskExecutionsInput) (re // See the AWS API reference guide for AWS DataSync's // API operation ListTaskExecutions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/ListTaskExecutions @@ -2028,10 +2201,12 @@ func (c *DataSync) ListTaskExecutionsPagesWithContext(ctx aws.Context, input *Li }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTaskExecutionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTaskExecutionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2094,11 +2269,11 @@ func (c *DataSync) ListTasksRequest(input *ListTasksInput) (req *request.Request // See the AWS API reference guide for AWS DataSync's // API operation ListTasks for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/ListTasks @@ -2166,10 +2341,12 @@ func (c *DataSync) ListTasksPagesWithContext(ctx aws.Context, input *ListTasksIn }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTasksOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTasksOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2234,11 +2411,11 @@ func (c *DataSync) StartTaskExecutionRequest(input *StartTaskExecutionInput) (re // See the AWS API reference guide for AWS DataSync's // API operation StartTaskExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/StartTaskExecution @@ -2317,11 +2494,11 @@ func (c *DataSync) TagResourceRequest(input *TagResourceInput) (req *request.Req // See the AWS API reference guide for AWS DataSync's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/TagResource @@ -2400,11 +2577,11 @@ func (c *DataSync) UntagResourceRequest(input *UntagResourceInput) (req *request // See the AWS API reference guide for AWS DataSync's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/UntagResource @@ -2483,11 +2660,11 @@ func (c *DataSync) UpdateAgentRequest(input *UpdateAgentInput) (req *request.Req // See the AWS API reference guide for AWS DataSync's // API operation UpdateAgent for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/UpdateAgent @@ -2566,11 +2743,11 @@ func (c *DataSync) UpdateTaskRequest(input *UpdateTaskInput) (req *request.Reque // See the AWS API reference guide for AWS DataSync's // API operation UpdateTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeInternalException "InternalException" +// * InternalException // This exception is thrown when an error occurs in the AWS DataSync service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/datasync-2018-11-09/UpdateTask @@ -2883,6 +3060,8 @@ type CreateLocationEfsInput struct { // A subdirectory in the location’s path. This subdirectory in the EFS file // system is used to read data from the EFS source location or write data to // the EFS destination. By default, AWS DataSync uses the root directory. + // + // Subdirectory must be specified with forward slashes. For example /path/to/folder. Subdirectory *string `type:"string"` // The key-value pair that represents a tag that you want to add to the resource. @@ -2982,6 +3161,158 @@ func (s *CreateLocationEfsOutput) SetLocationArn(v string) *CreateLocationEfsOut return s } +type CreateLocationFsxWindowsInput struct { + _ struct{} `type:"structure"` + + // The name of the Windows domain that the FSx for Windows server belongs to. + Domain *string `type:"string"` + + // The Amazon Resource Name (ARN) for the FSx for Windows file system. + // + // FsxFilesystemArn is a required field + FsxFilesystemArn *string `type:"string" required:"true"` + + // The password of the user who has the permissions to access files and folders + // in the FSx for Windows file system. + // + // Password is a required field + Password *string `type:"string" required:"true" sensitive:"true"` + + // The Amazon Resource Names (ARNs) of the security groups that are to use to + // configure the FSx for Windows file system. + // + // SecurityGroupArns is a required field + SecurityGroupArns []*string `min:"1" type:"list" required:"true"` + + // A subdirectory in the location’s path. This subdirectory in the Amazon + // FSx for Windows file system is used to read data from the Amazon FSx for + // Windows source location or write data to the FSx for Windows destination. + Subdirectory *string `type:"string"` + + // The key-value pair that represents a tag that you want to add to the resource. + // The value can be an empty string. This value helps you manage, filter, and + // search for your resources. We recommend that you create a name tag for your + // location. + Tags []*TagListEntry `type:"list"` + + // The user who has the permissions to access files and folders in the FSx for + // Windows file system. + // + // User is a required field + User *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateLocationFsxWindowsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLocationFsxWindowsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateLocationFsxWindowsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLocationFsxWindowsInput"} + if s.FsxFilesystemArn == nil { + invalidParams.Add(request.NewErrParamRequired("FsxFilesystemArn")) + } + if s.Password == nil { + invalidParams.Add(request.NewErrParamRequired("Password")) + } + if s.SecurityGroupArns == nil { + invalidParams.Add(request.NewErrParamRequired("SecurityGroupArns")) + } + if s.SecurityGroupArns != nil && len(s.SecurityGroupArns) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SecurityGroupArns", 1)) + } + if s.User == nil { + invalidParams.Add(request.NewErrParamRequired("User")) + } + 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 +} + +// SetDomain sets the Domain field's value. +func (s *CreateLocationFsxWindowsInput) SetDomain(v string) *CreateLocationFsxWindowsInput { + s.Domain = &v + return s +} + +// SetFsxFilesystemArn sets the FsxFilesystemArn field's value. +func (s *CreateLocationFsxWindowsInput) SetFsxFilesystemArn(v string) *CreateLocationFsxWindowsInput { + s.FsxFilesystemArn = &v + return s +} + +// SetPassword sets the Password field's value. +func (s *CreateLocationFsxWindowsInput) SetPassword(v string) *CreateLocationFsxWindowsInput { + s.Password = &v + return s +} + +// SetSecurityGroupArns sets the SecurityGroupArns field's value. +func (s *CreateLocationFsxWindowsInput) SetSecurityGroupArns(v []*string) *CreateLocationFsxWindowsInput { + s.SecurityGroupArns = v + return s +} + +// SetSubdirectory sets the Subdirectory field's value. +func (s *CreateLocationFsxWindowsInput) SetSubdirectory(v string) *CreateLocationFsxWindowsInput { + s.Subdirectory = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateLocationFsxWindowsInput) SetTags(v []*TagListEntry) *CreateLocationFsxWindowsInput { + s.Tags = v + return s +} + +// SetUser sets the User field's value. +func (s *CreateLocationFsxWindowsInput) SetUser(v string) *CreateLocationFsxWindowsInput { + s.User = &v + return s +} + +type CreateLocationFsxWindowsOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the FSx for Windows file system location + // that is created. + LocationArn *string `type:"string"` +} + +// String returns the string representation +func (s CreateLocationFsxWindowsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLocationFsxWindowsOutput) GoString() string { + return s.String() +} + +// SetLocationArn sets the LocationArn field's value. +func (s *CreateLocationFsxWindowsOutput) SetLocationArn(v string) *CreateLocationFsxWindowsOutput { + s.LocationArn = &v + return s +} + // CreateLocationNfsRequest type CreateLocationNfsInput struct { _ struct{} `type:"structure"` @@ -3284,7 +3615,7 @@ type CreateLocationSmbInput struct { // access files and folders in the SMB share. // // Password is a required field - Password *string `type:"string" required:"true"` + Password *string `type:"string" required:"true" sensitive:"true"` // The name of the SMB server. This value is the IP address or Domain Name Service // (DNS) name of the SMB server. An agent that is installed on-premises uses @@ -3302,6 +3633,8 @@ type CreateLocationSmbInput struct { // The path should be such that it can be mounted by other SMB clients in your // network. // + // Subdirectory must be specified with forward slashes. For example /path/to/folder. + // // To transfer all the data in the folder you specified, DataSync needs to have // permissions to mount the SMB share, as well as to access all the data in // that share. To ensure this, either ensure that the user/password specified @@ -3485,6 +3818,11 @@ type CreateTaskInput struct { // see the operation. Options *Options `type:"structure"` + // Specifies a schedule used to periodically transfer files from a source to + // a destination location. The schedule should be specified in UTC time. For + // more information, see task-scheduling. + Schedule *TaskSchedule `type:"structure"` + // The Amazon Resource Name (ARN) of the source location for the task. // // SourceLocationArn is a required field @@ -3522,6 +3860,11 @@ func (s *CreateTaskInput) Validate() error { invalidParams.AddNested("Options", err.(request.ErrInvalidParams)) } } + if s.Schedule != nil { + if err := s.Schedule.Validate(); err != nil { + invalidParams.AddNested("Schedule", err.(request.ErrInvalidParams)) + } + } if s.Tags != nil { for i, v := range s.Tags { if v == nil { @@ -3569,6 +3912,12 @@ func (s *CreateTaskInput) SetOptions(v *Options) *CreateTaskInput { return s } +// SetSchedule sets the Schedule field's value. +func (s *CreateTaskInput) SetSchedule(v *TaskSchedule) *CreateTaskInput { + s.Schedule = v + return s +} + // SetSourceLocationArn sets the SourceLocationArn field's value. func (s *CreateTaskInput) SetSourceLocationArn(v string) *CreateTaskInput { s.SourceLocationArn = &v @@ -3980,6 +4329,114 @@ func (s *DescribeLocationEfsOutput) SetLocationUri(v string) *DescribeLocationEf return s } +type DescribeLocationFsxWindowsInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the FSx for Windows location to describe. + // + // LocationArn is a required field + LocationArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeLocationFsxWindowsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLocationFsxWindowsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLocationFsxWindowsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLocationFsxWindowsInput"} + if s.LocationArn == nil { + invalidParams.Add(request.NewErrParamRequired("LocationArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLocationArn sets the LocationArn field's value. +func (s *DescribeLocationFsxWindowsInput) SetLocationArn(v string) *DescribeLocationFsxWindowsInput { + s.LocationArn = &v + return s +} + +type DescribeLocationFsxWindowsOutput struct { + _ struct{} `type:"structure"` + + // The time that the FSx for Windows location was created. + CreationTime *time.Time `type:"timestamp"` + + // The name of the Windows domain that the FSx for Windows server belongs to. + Domain *string `type:"string"` + + // The Amazon resource Name (ARN) of the FSx for Windows location that was described. + LocationArn *string `type:"string"` + + // The URL of the FSx for Windows location that was described. + LocationUri *string `type:"string"` + + // The Amazon Resource Names (ARNs) of the security groups that are configured + // for the for the FSx for Windows file system. + SecurityGroupArns []*string `min:"1" type:"list"` + + // The user who has the permissions to access files and folders in the FSx for + // Windows file system. + User *string `type:"string"` +} + +// String returns the string representation +func (s DescribeLocationFsxWindowsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLocationFsxWindowsOutput) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeLocationFsxWindowsOutput) SetCreationTime(v time.Time) *DescribeLocationFsxWindowsOutput { + s.CreationTime = &v + return s +} + +// SetDomain sets the Domain field's value. +func (s *DescribeLocationFsxWindowsOutput) SetDomain(v string) *DescribeLocationFsxWindowsOutput { + s.Domain = &v + return s +} + +// SetLocationArn sets the LocationArn field's value. +func (s *DescribeLocationFsxWindowsOutput) SetLocationArn(v string) *DescribeLocationFsxWindowsOutput { + s.LocationArn = &v + return s +} + +// SetLocationUri sets the LocationUri field's value. +func (s *DescribeLocationFsxWindowsOutput) SetLocationUri(v string) *DescribeLocationFsxWindowsOutput { + s.LocationUri = &v + return s +} + +// SetSecurityGroupArns sets the SecurityGroupArns field's value. +func (s *DescribeLocationFsxWindowsOutput) SetSecurityGroupArns(v []*string) *DescribeLocationFsxWindowsOutput { + s.SecurityGroupArns = v + return s +} + +// SetUser sets the User field's value. +func (s *DescribeLocationFsxWindowsOutput) SetUser(v string) *DescribeLocationFsxWindowsOutput { + s.User = &v + return s +} + // DescribeLocationNfsRequest type DescribeLocationNfsInput struct { _ struct{} `type:"structure"` @@ -4595,6 +5052,10 @@ type DescribeTaskOutput struct { // the overriding OverrideOptions value to operation. Options *Options `type:"structure"` + // The schedule used to periodically transfer files from a source to a destination + // location. + Schedule *TaskSchedule `type:"structure"` + // The Amazon Resource Name (ARN) of the source file system's location. SourceLocationArn *string `type:"string"` @@ -4682,6 +5143,12 @@ func (s *DescribeTaskOutput) SetOptions(v *Options) *DescribeTaskOutput { return s } +// SetSchedule sets the Schedule field's value. +func (s *DescribeTaskOutput) SetSchedule(v *TaskSchedule) *DescribeTaskOutput { + s.Schedule = v + return s +} + // SetSourceLocationArn sets the SourceLocationArn field's value. func (s *DescribeTaskOutput) SetSourceLocationArn(v string) *DescribeTaskOutput { s.SourceLocationArn = &v @@ -4803,6 +5270,122 @@ func (s *FilterRule) SetValue(v string) *FilterRule { return s } +// This exception is thrown when an error occurs in the AWS DataSync service. +type InternalException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + ErrorCode *string `locationName:"errorCode" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalException) GoString() string { + return s.String() +} + +func newErrorInternalException(v protocol.ResponseMetadata) error { + return &InternalException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalException) Code() string { + return "InternalException" +} + +// Message returns the exception's message. +func (s InternalException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalException) OrigErr() error { + return nil +} + +func (s InternalException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the client submits a malformed request. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + ErrorCode *string `locationName:"errorCode" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // ListAgentsRequest type ListAgentsInput struct { _ struct{} `type:"structure"` @@ -5355,6 +5938,12 @@ type Options struct { // NONE: Ignore UID and GID. Gid *string `type:"string" enum:"Gid"` + // A value that determines the type of logs DataSync will deliver to your AWS + // CloudWatch Logs file. If set to OFF, no logs will be delivered. BASIC will + // deliver a few logs per transfer operation and TRANSFER will deliver a verbose + // log that contains logs for every file that is transferred. + LogLevel *string `type:"string" enum:"LogLevel"` + // A value that indicates the last time that a file was modified (that is, a // file was written to) before the PREPARING phase. // @@ -5420,6 +6009,13 @@ type Options struct { // currently supported for Amazon EFS. PreserveDevices *string `type:"string" enum:"PreserveDevices"` + // A value that determines whether tasks should be queued before executing the + // tasks. If set to ENABLED, the tasks will be queued. The default is ENABLED. + // + // If you use the same agent to run multiple tasks you can enable the tasks + // to run in series. For more information see queue-task-execution. + TaskQueueing *string `type:"string" enum:"TaskQueueing"` + // The user ID (UID) of the file's owner. // // Default value: INT_VALUE. This preserves the integer value of the ID. @@ -5483,6 +6079,12 @@ func (s *Options) SetGid(v string) *Options { return s } +// SetLogLevel sets the LogLevel field's value. +func (s *Options) SetLogLevel(v string) *Options { + s.LogLevel = &v + return s +} + // SetMtime sets the Mtime field's value. func (s *Options) SetMtime(v string) *Options { s.Mtime = &v @@ -5513,6 +6115,12 @@ func (s *Options) SetPreserveDevices(v string) *Options { return s } +// SetTaskQueueing sets the TaskQueueing field's value. +func (s *Options) SetTaskQueueing(v string) *Options { + s.TaskQueueing = &v + return s +} + // SetUid sets the Uid field's value. func (s *Options) SetUid(v string) *Options { s.Uid = &v @@ -5942,6 +6550,10 @@ type TaskExecutionResultDetail struct { // The status of the PREPARING phase. PrepareStatus *string `type:"string" enum:"PhaseStatus"` + // The total time in milliseconds that AWS DataSync took to transfer the file + // from the source to the destination location. + TotalDuration *int64 `type:"long"` + // The total time in milliseconds that AWS DataSync spent in the TRANSFERRING // phase. TransferDuration *int64 `type:"long"` @@ -5990,6 +6602,12 @@ func (s *TaskExecutionResultDetail) SetPrepareStatus(v string) *TaskExecutionRes return s } +// SetTotalDuration sets the TotalDuration field's value. +func (s *TaskExecutionResultDetail) SetTotalDuration(v int64) *TaskExecutionResultDetail { + s.TotalDuration = &v + return s +} + // SetTransferDuration sets the TransferDuration field's value. func (s *TaskExecutionResultDetail) SetTransferDuration(v int64) *TaskExecutionResultDetail { s.TransferDuration = &v @@ -6059,6 +6677,47 @@ func (s *TaskListEntry) SetTaskArn(v string) *TaskListEntry { return s } +// Specifies the schedule you want your task to use for repeated executions. +// For more information, see Schedule Expressions for Rules (https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html). +type TaskSchedule struct { + _ struct{} `type:"structure"` + + // A cron expression that specifies when AWS DataSync initiates a scheduled + // transfer from a source to a destination location. + // + // ScheduleExpression is a required field + ScheduleExpression *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s TaskSchedule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TaskSchedule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TaskSchedule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TaskSchedule"} + if s.ScheduleExpression == nil { + invalidParams.Add(request.NewErrParamRequired("ScheduleExpression")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetScheduleExpression sets the ScheduleExpression field's value. +func (s *TaskSchedule) SetScheduleExpression(v string) *TaskSchedule { + s.ScheduleExpression = &v + return s +} + // UntagResourceRequest type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -6221,6 +6880,13 @@ type UpdateTaskInput struct { // value to StartTaskExecution. Options *Options `type:"structure"` + // Specifies a schedule used to periodically transfer files from a source to + // a destination location. You can configure your task to execute hourly, daily, + // weekly or on specific days of the week. You control when in the day or hour + // you want the task to execute. The time you specify is UTC time. For more + // information, see task-scheduling. + Schedule *TaskSchedule `type:"structure"` + // The Amazon Resource Name (ARN) of the resource name of the task to update. // // TaskArn is a required field @@ -6251,6 +6917,11 @@ func (s *UpdateTaskInput) Validate() error { invalidParams.AddNested("Options", err.(request.ErrInvalidParams)) } } + if s.Schedule != nil { + if err := s.Schedule.Validate(); err != nil { + invalidParams.AddNested("Schedule", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -6282,6 +6953,12 @@ func (s *UpdateTaskInput) SetOptions(v *Options) *UpdateTaskInput { return s } +// SetSchedule sets the Schedule field's value. +func (s *UpdateTaskInput) SetSchedule(v *TaskSchedule) *UpdateTaskInput { + s.Schedule = v + return s +} + // SetTaskArn sets the TaskArn field's value. func (s *UpdateTaskInput) SetTaskArn(v string) *UpdateTaskInput { s.TaskArn = &v @@ -6324,6 +7001,9 @@ const ( // EndpointTypePrivateLink is a EndpointType enum value EndpointTypePrivateLink = "PRIVATE_LINK" + + // EndpointTypeFips is a EndpointType enum value + EndpointTypeFips = "FIPS" ) const ( @@ -6345,6 +7025,17 @@ const ( GidBoth = "BOTH" ) +const ( + // LogLevelOff is a LogLevel enum value + LogLevelOff = "OFF" + + // LogLevelBasic is a LogLevel enum value + LogLevelBasic = "BASIC" + + // LogLevelTransfer is a LogLevel enum value + LogLevelTransfer = "TRANSFER" +) + const ( // MtimeNone is a Mtime enum value MtimeNone = "NONE" @@ -6390,9 +7081,6 @@ const ( // PosixPermissionsNone is a PosixPermissions enum value PosixPermissionsNone = "NONE" - // PosixPermissionsBestEffort is a PosixPermissions enum value - PosixPermissionsBestEffort = "BEST_EFFORT" - // PosixPermissionsPreserve is a PosixPermissions enum value PosixPermissionsPreserve = "PRESERVE" ) @@ -6445,6 +7133,9 @@ const ( ) const ( + // TaskExecutionStatusQueued is a TaskExecutionStatus enum value + TaskExecutionStatusQueued = "QUEUED" + // TaskExecutionStatusLaunching is a TaskExecutionStatus enum value TaskExecutionStatusLaunching = "LAUNCHING" @@ -6464,6 +7155,14 @@ const ( TaskExecutionStatusError = "ERROR" ) +const ( + // TaskQueueingEnabled is a TaskQueueing enum value + TaskQueueingEnabled = "ENABLED" + + // TaskQueueingDisabled is a TaskQueueing enum value + TaskQueueingDisabled = "DISABLED" +) + const ( // TaskStatusAvailable is a TaskStatus enum value TaskStatusAvailable = "AVAILABLE" @@ -6471,6 +7170,9 @@ const ( // TaskStatusCreating is a TaskStatus enum value TaskStatusCreating = "CREATING" + // TaskStatusQueued is a TaskStatus enum value + TaskStatusQueued = "QUEUED" + // TaskStatusRunning is a TaskStatus enum value TaskStatusRunning = "RUNNING" diff --git a/vendor/github.com/aws/aws-sdk-go/service/datasync/errors.go b/vendor/github.com/aws/aws-sdk-go/service/datasync/errors.go index 0d709f459e5..af152d2d168 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/datasync/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/datasync/errors.go @@ -2,6 +2,10 @@ package datasync +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInternalException for service response error code @@ -16,3 +20,8 @@ const ( // This exception is thrown when the client submits a malformed request. ErrCodeInvalidRequestException = "InvalidRequestException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InternalException": newErrorInternalException, + "InvalidRequestException": newErrorInvalidRequestException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/datasync/service.go b/vendor/github.com/aws/aws-sdk-go/service/datasync/service.go index 22d8ddcb90c..aa64e77bcde 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/datasync/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/datasync/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "DataSync" // Name of service. EndpointsID = "datasync" // ID to lookup a service endpoint with. - ServiceID = "DataSync" // ServiceID is a unique identifer of a specific service. + ServiceID = "DataSync" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the DataSync client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a DataSync client from just a session. // svc := datasync.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *DataSync { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "datasync" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *DataSync { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *DataSync { svc := &DataSync{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-11-09", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/dax/api.go b/vendor/github.com/aws/aws-sdk-go/service/dax/api.go index 4b836d462bd..b9c5343888f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dax/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dax/api.go @@ -3,11 +3,13 @@ package dax import ( + "fmt" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" ) const opCreateCluster = "CreateCluster" @@ -64,48 +66,49 @@ func (c *DAX) CreateClusterRequest(input *CreateClusterInput) (req *request.Requ // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation CreateCluster for usage and error information. // -// Returned Error Codes: -// * ErrCodeClusterAlreadyExistsFault "ClusterAlreadyExistsFault" +// Returned Error Types: +// * ClusterAlreadyExistsFault // You already have a DAX cluster with the given identifier. // -// * ErrCodeInvalidClusterStateFault "InvalidClusterStateFault" +// * InvalidClusterStateFault // The requested DAX cluster is not in the available state. // -// * ErrCodeInsufficientClusterCapacityFault "InsufficientClusterCapacityFault" +// * InsufficientClusterCapacityFault // There are not enough system resources to create the cluster you requested // (or to resize an already-existing cluster). // -// * ErrCodeSubnetGroupNotFoundFault "SubnetGroupNotFoundFault" +// * SubnetGroupNotFoundFault // The requested subnet group name does not refer to an existing subnet group. // -// * ErrCodeInvalidParameterGroupStateFault "InvalidParameterGroupStateFault" +// * InvalidParameterGroupStateFault // One or more parameters in a parameter group are in an invalid state. // -// * ErrCodeParameterGroupNotFoundFault "ParameterGroupNotFoundFault" +// * ParameterGroupNotFoundFault // The specified parameter group does not exist. // -// * ErrCodeClusterQuotaForCustomerExceededFault "ClusterQuotaForCustomerExceededFault" +// * ClusterQuotaForCustomerExceededFault // You have attempted to exceed the maximum number of DAX clusters for your // AWS account. // -// * ErrCodeNodeQuotaForClusterExceededFault "NodeQuotaForClusterExceededFault" +// * NodeQuotaForClusterExceededFault // You have attempted to exceed the maximum number of nodes for a DAX cluster. // -// * ErrCodeNodeQuotaForCustomerExceededFault "NodeQuotaForCustomerExceededFault" +// * NodeQuotaForCustomerExceededFault // You have attempted to exceed the maximum number of nodes for your AWS account. // -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" +// * InvalidVPCNetworkStateFault // The VPC network is in an invalid state. // -// * ErrCodeTagQuotaPerResourceExceeded "TagQuotaPerResourceExceeded" +// * TagQuotaPerResourceExceeded // You have exceeded the maximum number of tags for this DAX cluster. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/CreateCluster @@ -184,22 +187,23 @@ func (c *DAX) CreateParameterGroupRequest(input *CreateParameterGroupInput) (req // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation CreateParameterGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeParameterGroupQuotaExceededFault "ParameterGroupQuotaExceededFault" +// Returned Error Types: +// * ParameterGroupQuotaExceededFault // You have attempted to exceed the maximum number of parameter groups. // -// * ErrCodeParameterGroupAlreadyExistsFault "ParameterGroupAlreadyExistsFault" +// * ParameterGroupAlreadyExistsFault // The specified parameter group already exists. // -// * ErrCodeInvalidParameterGroupStateFault "InvalidParameterGroupStateFault" +// * InvalidParameterGroupStateFault // One or more parameters in a parameter group are in an invalid state. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/CreateParameterGroup @@ -277,22 +281,23 @@ func (c *DAX) CreateSubnetGroupRequest(input *CreateSubnetGroupInput) (req *requ // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation CreateSubnetGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeSubnetGroupAlreadyExistsFault "SubnetGroupAlreadyExistsFault" +// Returned Error Types: +// * SubnetGroupAlreadyExistsFault // The specified subnet group already exists. // -// * ErrCodeSubnetGroupQuotaExceededFault "SubnetGroupQuotaExceededFault" +// * SubnetGroupQuotaExceededFault // The request cannot be processed because it would exceed the allowed number // of subnets in a subnet group. // -// * ErrCodeSubnetQuotaExceededFault "SubnetQuotaExceededFault" +// * SubnetQuotaExceededFault // The request cannot be processed because it would exceed the allowed number // of subnets in a subnet group. // -// * ErrCodeInvalidSubnet "InvalidSubnet" +// * InvalidSubnet // An invalid subnet identifier was specified. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/CreateSubnetGroup func (c *DAX) CreateSubnetGroup(input *CreateSubnetGroupInput) (*CreateSubnetGroupOutput, error) { @@ -372,22 +377,23 @@ func (c *DAX) DecreaseReplicationFactorRequest(input *DecreaseReplicationFactorI // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation DecreaseReplicationFactor for usage and error information. // -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFoundFault" +// Returned Error Types: +// * ClusterNotFoundFault // The requested cluster ID does not refer to an existing DAX cluster. // -// * ErrCodeNodeNotFoundFault "NodeNotFoundFault" +// * NodeNotFoundFault // None of the nodes in the cluster have the given node ID. // -// * ErrCodeInvalidClusterStateFault "InvalidClusterStateFault" +// * InvalidClusterStateFault // The requested DAX cluster is not in the available state. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/DecreaseReplicationFactor @@ -468,19 +474,20 @@ func (c *DAX) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Requ // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation DeleteCluster for usage and error information. // -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFoundFault" +// Returned Error Types: +// * ClusterNotFoundFault // The requested cluster ID does not refer to an existing DAX cluster. // -// * ErrCodeInvalidClusterStateFault "InvalidClusterStateFault" +// * InvalidClusterStateFault // The requested DAX cluster is not in the available state. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/DeleteCluster @@ -559,19 +566,20 @@ func (c *DAX) DeleteParameterGroupRequest(input *DeleteParameterGroupInput) (req // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation DeleteParameterGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterGroupStateFault "InvalidParameterGroupStateFault" +// Returned Error Types: +// * InvalidParameterGroupStateFault // One or more parameters in a parameter group are in an invalid state. // -// * ErrCodeParameterGroupNotFoundFault "ParameterGroupNotFoundFault" +// * ParameterGroupNotFoundFault // The specified parameter group does not exist. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/DeleteParameterGroup @@ -651,14 +659,15 @@ func (c *DAX) DeleteSubnetGroupRequest(input *DeleteSubnetGroupInput) (req *requ // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation DeleteSubnetGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeSubnetGroupInUseFault "SubnetGroupInUseFault" +// Returned Error Types: +// * SubnetGroupInUseFault // The specified subnet group is currently in use. // -// * ErrCodeSubnetGroupNotFoundFault "SubnetGroupNotFoundFault" +// * SubnetGroupNotFoundFault // The requested subnet group name does not refer to an existing subnet group. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/DeleteSubnetGroup func (c *DAX) DeleteSubnetGroup(input *DeleteSubnetGroupInput) (*DeleteSubnetGroupOutput, error) { @@ -751,16 +760,17 @@ func (c *DAX) DescribeClustersRequest(input *DescribeClustersInput) (req *reques // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation DescribeClusters for usage and error information. // -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFoundFault" +// Returned Error Types: +// * ClusterNotFoundFault // The requested cluster ID does not refer to an existing DAX cluster. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/DescribeClusters @@ -838,13 +848,14 @@ func (c *DAX) DescribeDefaultParametersRequest(input *DescribeDefaultParametersI // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation DescribeDefaultParameters for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// Returned Error Types: +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/DescribeDefaultParameters @@ -917,7 +928,7 @@ func (c *DAX) DescribeEventsRequest(input *DescribeEventsInput) (req *request.Re // events specific to a particular DAX cluster or parameter group by providing // the name as a parameter. // -// By default, only the events occurring within the last hour are returned; +// By default, only the events occurring within the last 24 hours 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 @@ -927,13 +938,14 @@ func (c *DAX) DescribeEventsRequest(input *DescribeEventsInput) (req *request.Re // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation DescribeEvents for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// Returned Error Types: +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/DescribeEvents @@ -1012,16 +1024,17 @@ func (c *DAX) DescribeParameterGroupsRequest(input *DescribeParameterGroupsInput // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation DescribeParameterGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeParameterGroupNotFoundFault "ParameterGroupNotFoundFault" +// Returned Error Types: +// * ParameterGroupNotFoundFault // The specified parameter group does not exist. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/DescribeParameterGroups @@ -1099,16 +1112,17 @@ func (c *DAX) DescribeParametersRequest(input *DescribeParametersInput) (req *re // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation DescribeParameters for usage and error information. // -// Returned Error Codes: -// * ErrCodeParameterGroupNotFoundFault "ParameterGroupNotFoundFault" +// Returned Error Types: +// * ParameterGroupNotFoundFault // The specified parameter group does not exist. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/DescribeParameters @@ -1187,11 +1201,12 @@ func (c *DAX) DescribeSubnetGroupsRequest(input *DescribeSubnetGroupsInput) (req // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation DescribeSubnetGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeSubnetGroupNotFoundFault "SubnetGroupNotFoundFault" +// Returned Error Types: +// * SubnetGroupNotFoundFault // The requested subnet group name does not refer to an existing subnet group. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/DescribeSubnetGroups func (c *DAX) DescribeSubnetGroups(input *DescribeSubnetGroupsInput) (*DescribeSubnetGroupsOutput, error) { @@ -1268,32 +1283,33 @@ func (c *DAX) IncreaseReplicationFactorRequest(input *IncreaseReplicationFactorI // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation IncreaseReplicationFactor for usage and error information. // -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFoundFault" +// Returned Error Types: +// * ClusterNotFoundFault // The requested cluster ID does not refer to an existing DAX cluster. // -// * ErrCodeInvalidClusterStateFault "InvalidClusterStateFault" +// * InvalidClusterStateFault // The requested DAX cluster is not in the available state. // -// * ErrCodeInsufficientClusterCapacityFault "InsufficientClusterCapacityFault" +// * InsufficientClusterCapacityFault // There are not enough system resources to create the cluster you requested // (or to resize an already-existing cluster). // -// * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" +// * InvalidVPCNetworkStateFault // The VPC network is in an invalid state. // -// * ErrCodeNodeQuotaForClusterExceededFault "NodeQuotaForClusterExceededFault" +// * NodeQuotaForClusterExceededFault // You have attempted to exceed the maximum number of nodes for a DAX cluster. // -// * ErrCodeNodeQuotaForCustomerExceededFault "NodeQuotaForCustomerExceededFault" +// * NodeQuotaForCustomerExceededFault // You have attempted to exceed the maximum number of nodes for your AWS account. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/IncreaseReplicationFactor @@ -1372,22 +1388,23 @@ func (c *DAX) ListTagsRequest(input *ListTagsInput) (req *request.Request, outpu // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation ListTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFoundFault" +// Returned Error Types: +// * ClusterNotFoundFault // The requested cluster ID does not refer to an existing DAX cluster. // -// * ErrCodeInvalidARNFault "InvalidARNFault" +// * InvalidARNFault // The Amazon Resource Name (ARN) supplied in the request is not valid. // -// * ErrCodeInvalidClusterStateFault "InvalidClusterStateFault" +// * InvalidClusterStateFault // The requested DAX cluster is not in the available state. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/ListTags @@ -1459,6 +1476,9 @@ func (c *DAX) RebootNodeRequest(input *RebootNodeInput) (req *request.Request, o // Reboots a single node of a DAX cluster. The reboot action takes place as // soon as possible. During the reboot, the node status is set to REBOOTING. // +// RebootNode restarts the DAX engine process and does not remove the contents +// of the 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. @@ -1466,22 +1486,23 @@ func (c *DAX) RebootNodeRequest(input *RebootNodeInput) (req *request.Request, o // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation RebootNode for usage and error information. // -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFoundFault" +// Returned Error Types: +// * ClusterNotFoundFault // The requested cluster ID does not refer to an existing DAX cluster. // -// * ErrCodeNodeNotFoundFault "NodeNotFoundFault" +// * NodeNotFoundFault // None of the nodes in the cluster have the given node ID. // -// * ErrCodeInvalidClusterStateFault "InvalidClusterStateFault" +// * InvalidClusterStateFault // The requested DAX cluster is not in the available state. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/RebootNode @@ -1560,25 +1581,26 @@ func (c *DAX) TagResourceRequest(input *TagResourceInput) (req *request.Request, // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFoundFault" +// Returned Error Types: +// * ClusterNotFoundFault // The requested cluster ID does not refer to an existing DAX cluster. // -// * ErrCodeTagQuotaPerResourceExceeded "TagQuotaPerResourceExceeded" +// * TagQuotaPerResourceExceeded // You have exceeded the maximum number of tags for this DAX cluster. // -// * ErrCodeInvalidARNFault "InvalidARNFault" +// * InvalidARNFault // The Amazon Resource Name (ARN) supplied in the request is not valid. // -// * ErrCodeInvalidClusterStateFault "InvalidClusterStateFault" +// * InvalidClusterStateFault // The requested DAX cluster is not in the available state. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/TagResource @@ -1657,25 +1679,26 @@ func (c *DAX) UntagResourceRequest(input *UntagResourceInput) (req *request.Requ // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeClusterNotFoundFault "ClusterNotFoundFault" +// Returned Error Types: +// * ClusterNotFoundFault // The requested cluster ID does not refer to an existing DAX cluster. // -// * ErrCodeInvalidARNFault "InvalidARNFault" +// * InvalidARNFault // The Amazon Resource Name (ARN) supplied in the request is not valid. // -// * ErrCodeTagNotFoundFault "TagNotFoundFault" +// * TagNotFoundFault // The tag does not exist. // -// * ErrCodeInvalidClusterStateFault "InvalidClusterStateFault" +// * InvalidClusterStateFault // The requested DAX cluster is not in the available state. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/UntagResource @@ -1755,25 +1778,26 @@ func (c *DAX) UpdateClusterRequest(input *UpdateClusterInput) (req *request.Requ // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation UpdateCluster for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidClusterStateFault "InvalidClusterStateFault" +// Returned Error Types: +// * InvalidClusterStateFault // The requested DAX cluster is not in the available state. // -// * ErrCodeClusterNotFoundFault "ClusterNotFoundFault" +// * ClusterNotFoundFault // The requested cluster ID does not refer to an existing DAX cluster. // -// * ErrCodeInvalidParameterGroupStateFault "InvalidParameterGroupStateFault" +// * InvalidParameterGroupStateFault // One or more parameters in a parameter group are in an invalid state. // -// * ErrCodeParameterGroupNotFoundFault "ParameterGroupNotFoundFault" +// * ParameterGroupNotFoundFault // The specified parameter group does not exist. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/UpdateCluster @@ -1852,19 +1876,20 @@ func (c *DAX) UpdateParameterGroupRequest(input *UpdateParameterGroupInput) (req // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation UpdateParameterGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterGroupStateFault "InvalidParameterGroupStateFault" +// Returned Error Types: +// * InvalidParameterGroupStateFault // One or more parameters in a parameter group are in an invalid state. // -// * ErrCodeParameterGroupNotFoundFault "ParameterGroupNotFoundFault" +// * ParameterGroupNotFoundFault // The specified parameter group does not exist. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // The value for a parameter is invalid. // -// * ErrCodeInvalidParameterCombinationException "InvalidParameterCombinationException" +// * InvalidParameterCombinationException // Two or more incompatible parameters were specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/UpdateParameterGroup @@ -1942,21 +1967,22 @@ func (c *DAX) UpdateSubnetGroupRequest(input *UpdateSubnetGroupInput) (req *requ // See the AWS API reference guide for Amazon DynamoDB Accelerator (DAX)'s // API operation UpdateSubnetGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeSubnetGroupNotFoundFault "SubnetGroupNotFoundFault" +// Returned Error Types: +// * SubnetGroupNotFoundFault // The requested subnet group name does not refer to an existing subnet group. // -// * ErrCodeSubnetQuotaExceededFault "SubnetQuotaExceededFault" +// * SubnetQuotaExceededFault // The request cannot be processed because it would exceed the allowed number // of subnets in a subnet group. // -// * ErrCodeSubnetInUse "SubnetInUse" +// * SubnetInUse // The requested subnet is being used by another subnet group. // -// * ErrCodeInvalidSubnet "InvalidSubnet" +// * InvalidSubnet // An invalid subnet identifier was specified. // -// * ErrCodeServiceLinkedRoleNotFoundFault "ServiceLinkedRoleNotFoundFault" +// * ServiceLinkedRoleNotFoundFault +// The specified service linked role (SLR) was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dax-2017-04-19/UpdateSubnetGroup func (c *DAX) UpdateSubnetGroup(input *UpdateSubnetGroupInput) (*UpdateSubnetGroupOutput, error) { @@ -2160,12 +2186,182 @@ func (s *Cluster) SetTotalNodes(v int64) *Cluster { return s } +// You already have a DAX cluster with the given identifier. +type ClusterAlreadyExistsFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ClusterAlreadyExistsFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClusterAlreadyExistsFault) GoString() string { + return s.String() +} + +func newErrorClusterAlreadyExistsFault(v protocol.ResponseMetadata) error { + return &ClusterAlreadyExistsFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ClusterAlreadyExistsFault) Code() string { + return "ClusterAlreadyExistsFault" +} + +// Message returns the exception's message. +func (s ClusterAlreadyExistsFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ClusterAlreadyExistsFault) OrigErr() error { + return nil +} + +func (s ClusterAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ClusterAlreadyExistsFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ClusterAlreadyExistsFault) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested cluster ID does not refer to an existing DAX cluster. +type ClusterNotFoundFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ClusterNotFoundFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClusterNotFoundFault) GoString() string { + return s.String() +} + +func newErrorClusterNotFoundFault(v protocol.ResponseMetadata) error { + return &ClusterNotFoundFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ClusterNotFoundFault) Code() string { + return "ClusterNotFoundFault" +} + +// Message returns the exception's message. +func (s ClusterNotFoundFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ClusterNotFoundFault) OrigErr() error { + return nil +} + +func (s ClusterNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ClusterNotFoundFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ClusterNotFoundFault) RequestID() string { + return s.respMetadata.RequestID +} + +// You have attempted to exceed the maximum number of DAX clusters for your +// AWS account. +type ClusterQuotaForCustomerExceededFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ClusterQuotaForCustomerExceededFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClusterQuotaForCustomerExceededFault) GoString() string { + return s.String() +} + +func newErrorClusterQuotaForCustomerExceededFault(v protocol.ResponseMetadata) error { + return &ClusterQuotaForCustomerExceededFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ClusterQuotaForCustomerExceededFault) Code() string { + return "ClusterQuotaForCustomerExceededFault" +} + +// Message returns the exception's message. +func (s ClusterQuotaForCustomerExceededFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ClusterQuotaForCustomerExceededFault) OrigErr() error { + return nil +} + +func (s ClusterQuotaForCustomerExceededFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ClusterQuotaForCustomerExceededFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ClusterQuotaForCustomerExceededFault) RequestID() string { + return s.respMetadata.RequestID +} + type CreateClusterInput struct { _ struct{} `type:"structure"` - // The Availability Zones (AZs) in which the cluster nodes will be created. - // All nodes belonging to the cluster are placed in these Availability Zones. - // Use this parameter if you want to distribute the nodes across multiple AZs. + // The Availability Zones (AZs) in which the cluster nodes will reside after + // the cluster has been created or updated. If provided, the length of this + // list must equal the ReplicationFactor parameter. If you omit this parameter, + // DAX will spread the nodes across Availability Zones for the highest availability. AvailabilityZones []*string `type:"list"` // The cluster identifier. This parameter is stored as a lowercase string. @@ -2234,7 +2430,9 @@ type CreateClusterInput struct { // The number of nodes in the DAX cluster. A replication factor of 1 will create // a single-node cluster, without any read replicas. For additional fault tolerance, // you can create a multiple node cluster with one or more read replicas. To - // do this, set ReplicationFactor to 2 or more. + // do this, set ReplicationFactor to a number between 3 (one primary and two + // read replicas) and 10 (one primary and nine read replicas). If the AvailabilityZones + // parameter is provided, its length must equal the ReplicationFactor. // // AWS recommends that you have at least two read replicas per cluster. // @@ -3543,238 +3741,855 @@ func (s *IncreaseReplicationFactorOutput) SetCluster(v *Cluster) *IncreaseReplic return s } -type ListTagsInput struct { - _ struct{} `type:"structure"` - - // An optional token returned from a prior request. Use this token for pagination - // of results from this action. If this parameter is specified, the response - // includes only results beyond the token. - NextToken *string `type:"string"` +// There are not enough system resources to create the cluster you requested +// (or to resize an already-existing cluster). +type InsufficientClusterCapacityFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The name of the DAX resource to which the tags belong. - // - // ResourceName is a required field - ResourceName *string `type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListTagsInput) String() string { +func (s InsufficientClusterCapacityFault) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsInput) GoString() string { +func (s InsufficientClusterCapacityFault) 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.ResourceName == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceName")) +func newErrorInsufficientClusterCapacityFault(v protocol.ResponseMetadata) error { + return &InsufficientClusterCapacityFault{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InsufficientClusterCapacityFault) Code() string { + return "InsufficientClusterCapacityFault" +} + +// Message returns the exception's message. +func (s InsufficientClusterCapacityFault) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InsufficientClusterCapacityFault) OrigErr() error { return nil } -// SetNextToken sets the NextToken field's value. -func (s *ListTagsInput) SetNextToken(v string) *ListTagsInput { - s.NextToken = &v - return s +func (s InsufficientClusterCapacityFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetResourceName sets the ResourceName field's value. -func (s *ListTagsInput) SetResourceName(v string) *ListTagsInput { - s.ResourceName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InsufficientClusterCapacityFault) StatusCode() int { + return s.respMetadata.StatusCode } -type ListTagsOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InsufficientClusterCapacityFault) RequestID() string { + return s.respMetadata.RequestID +} - // If this value is present, there are additional results to be displayed. To - // retrieve them, call ListTags again, with NextToken set to this value. - NextToken *string `type:"string"` +// The Amazon Resource Name (ARN) supplied in the request is not valid. +type InvalidARNFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // A list of tags currently associated with the DAX cluster. - Tags []*Tag `type:"list"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListTagsOutput) String() string { +func (s InvalidARNFault) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsOutput) GoString() string { +func (s InvalidARNFault) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListTagsOutput) SetNextToken(v string) *ListTagsOutput { - s.NextToken = &v - return s +func newErrorInvalidARNFault(v protocol.ResponseMetadata) error { + return &InvalidARNFault{ + respMetadata: v, + } } -// SetTags sets the Tags field's value. -func (s *ListTagsOutput) SetTags(v []*Tag) *ListTagsOutput { - s.Tags = v - return s +// Code returns the exception type name. +func (s InvalidARNFault) Code() string { + return "InvalidARNFault" } -// Represents an individual node within a DAX cluster. -type Node struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidARNFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The Availability Zone (AZ) in which the node has been deployed. - AvailabilityZone *string `type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidARNFault) OrigErr() error { + return nil +} - // The endpoint for the node, consisting of a DNS name and a port number. Client - // applications can connect directly to a node endpoint, if desired (as an alternative - // to allowing DAX client software to intelligently route requests and responses - // to nodes in the DAX cluster. - Endpoint *Endpoint `type:"structure"` +func (s InvalidARNFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The date and time (in UNIX epoch format) when the node was launched. - NodeCreateTime *time.Time `type:"timestamp"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidARNFault) StatusCode() int { + return s.respMetadata.StatusCode +} - // A system-generated identifier for the node. - NodeId *string `type:"string"` +// RequestID returns the service's response RequestID for request. +func (s InvalidARNFault) RequestID() string { + return s.respMetadata.RequestID +} - // The current status of the node. For example: available. - NodeStatus *string `type:"string"` +// The requested DAX cluster is not in the available state. +type InvalidClusterStateFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The status of the parameter group associated with this node. For example, - // in-sync. - ParameterGroupStatus *string `type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s Node) String() string { +func (s InvalidClusterStateFault) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Node) GoString() string { +func (s InvalidClusterStateFault) GoString() string { return s.String() } -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *Node) SetAvailabilityZone(v string) *Node { - s.AvailabilityZone = &v - return s +func newErrorInvalidClusterStateFault(v protocol.ResponseMetadata) error { + return &InvalidClusterStateFault{ + respMetadata: v, + } } -// SetEndpoint sets the Endpoint field's value. -func (s *Node) SetEndpoint(v *Endpoint) *Node { - s.Endpoint = v - return s +// Code returns the exception type name. +func (s InvalidClusterStateFault) Code() string { + return "InvalidClusterStateFault" } -// SetNodeCreateTime sets the NodeCreateTime field's value. -func (s *Node) SetNodeCreateTime(v time.Time) *Node { - s.NodeCreateTime = &v - return s +// Message returns the exception's message. +func (s InvalidClusterStateFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetNodeId sets the NodeId field's value. -func (s *Node) SetNodeId(v string) *Node { - s.NodeId = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidClusterStateFault) OrigErr() error { + return nil } -// SetNodeStatus sets the NodeStatus field's value. -func (s *Node) SetNodeStatus(v string) *Node { - s.NodeStatus = &v - return s +func (s InvalidClusterStateFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetParameterGroupStatus sets the ParameterGroupStatus field's value. -func (s *Node) SetParameterGroupStatus(v string) *Node { - s.ParameterGroupStatus = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidClusterStateFault) StatusCode() int { + return s.respMetadata.StatusCode } -// Represents a parameter value that is applicable to a particular node type. -type NodeTypeSpecificValue struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidClusterStateFault) RequestID() string { + return s.respMetadata.RequestID +} - // A node type to which the parameter value applies. - NodeType *string `type:"string"` +// Two or more incompatible parameters were specified. +type InvalidParameterCombinationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The parameter value for this node type. - Value *string `type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s NodeTypeSpecificValue) String() string { +func (s InvalidParameterCombinationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s NodeTypeSpecificValue) GoString() string { +func (s InvalidParameterCombinationException) GoString() string { return s.String() } -// SetNodeType sets the NodeType field's value. -func (s *NodeTypeSpecificValue) SetNodeType(v string) *NodeTypeSpecificValue { - s.NodeType = &v - return s +func newErrorInvalidParameterCombinationException(v protocol.ResponseMetadata) error { + return &InvalidParameterCombinationException{ + respMetadata: v, + } } -// SetValue sets the Value field's value. -func (s *NodeTypeSpecificValue) SetValue(v string) *NodeTypeSpecificValue { - s.Value = &v - return s +// Code returns the exception type name. +func (s InvalidParameterCombinationException) Code() string { + return "InvalidParameterCombinationException" } -// Describes a notification topic and its status. Notification topics are used -// for publishing DAX events to subscribers using Amazon Simple Notification -// Service (SNS). -type NotificationConfiguration struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidParameterCombinationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The Amazon Resource Name (ARN) that identifies the topic. - TopicArn *string `type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterCombinationException) OrigErr() error { + return nil +} - // The current state of the topic. - TopicStatus *string `type:"string"` +func (s InvalidParameterCombinationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterCombinationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterCombinationException) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more parameters in a parameter group are in an invalid state. +type InvalidParameterGroupStateFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s NotificationConfiguration) String() string { +func (s InvalidParameterGroupStateFault) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s NotificationConfiguration) GoString() string { +func (s InvalidParameterGroupStateFault) GoString() string { return s.String() } -// SetTopicArn sets the TopicArn field's value. -func (s *NotificationConfiguration) SetTopicArn(v string) *NotificationConfiguration { - s.TopicArn = &v - return s +func newErrorInvalidParameterGroupStateFault(v protocol.ResponseMetadata) error { + return &InvalidParameterGroupStateFault{ + respMetadata: v, + } } -// SetTopicStatus sets the TopicStatus field's value. -func (s *NotificationConfiguration) SetTopicStatus(v string) *NotificationConfiguration { - s.TopicStatus = &v - return s +// Code returns the exception type name. +func (s InvalidParameterGroupStateFault) Code() string { + return "InvalidParameterGroupStateFault" } -// Describes an individual setting that controls some aspect of DAX behavior. -type Parameter struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidParameterGroupStateFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // A range of values within which the parameter can be set. - AllowedValues *string `type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterGroupStateFault) OrigErr() error { + return nil +} - // The conditions under which changes to this parameter can be applied. For - // example, requires-reboot indicates that a new value for this parameter will +func (s InvalidParameterGroupStateFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterGroupStateFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterGroupStateFault) RequestID() string { + return s.respMetadata.RequestID +} + +// The value for a parameter is invalid. +type InvalidParameterValueException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterValueException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterValueException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterValueException(v protocol.ResponseMetadata) error { + return &InvalidParameterValueException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterValueException) Code() string { + return "InvalidParameterValueException" +} + +// Message returns the exception's message. +func (s InvalidParameterValueException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterValueException) OrigErr() error { + return nil +} + +func (s InvalidParameterValueException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterValueException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterValueException) RequestID() string { + return s.respMetadata.RequestID +} + +// An invalid subnet identifier was specified. +type InvalidSubnet struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidSubnet) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidSubnet) GoString() string { + return s.String() +} + +func newErrorInvalidSubnet(v protocol.ResponseMetadata) error { + return &InvalidSubnet{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidSubnet) Code() string { + return "InvalidSubnet" +} + +// Message returns the exception's message. +func (s InvalidSubnet) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidSubnet) OrigErr() error { + return nil +} + +func (s InvalidSubnet) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidSubnet) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidSubnet) RequestID() string { + return s.respMetadata.RequestID +} + +// The VPC network is in an invalid state. +type InvalidVPCNetworkStateFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidVPCNetworkStateFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidVPCNetworkStateFault) GoString() string { + return s.String() +} + +func newErrorInvalidVPCNetworkStateFault(v protocol.ResponseMetadata) error { + return &InvalidVPCNetworkStateFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidVPCNetworkStateFault) Code() string { + return "InvalidVPCNetworkStateFault" +} + +// Message returns the exception's message. +func (s InvalidVPCNetworkStateFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidVPCNetworkStateFault) OrigErr() error { + return nil +} + +func (s InvalidVPCNetworkStateFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidVPCNetworkStateFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidVPCNetworkStateFault) RequestID() string { + return s.respMetadata.RequestID +} + +type ListTagsInput struct { + _ struct{} `type:"structure"` + + // An optional token returned from a prior request. Use this token for pagination + // of results from this action. If this parameter is specified, the response + // includes only results beyond the token. + NextToken *string `type:"string"` + + // The name of the DAX resource to which the tags belong. + // + // ResourceName is a required field + ResourceName *string `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.ResourceName == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceName")) + } + + 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 +} + +// SetResourceName sets the ResourceName field's value. +func (s *ListTagsInput) SetResourceName(v string) *ListTagsInput { + s.ResourceName = &v + return s +} + +type ListTagsOutput struct { + _ struct{} `type:"structure"` + + // If this value is present, there are additional results to be displayed. To + // retrieve them, call ListTags again, with NextToken set to this value. + NextToken *string `type:"string"` + + // A list of tags currently associated with the DAX cluster. + Tags []*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() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTagsOutput) SetNextToken(v string) *ListTagsOutput { + s.NextToken = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *ListTagsOutput) SetTags(v []*Tag) *ListTagsOutput { + s.Tags = v + return s +} + +// Represents an individual node within a DAX cluster. +type Node struct { + _ struct{} `type:"structure"` + + // The Availability Zone (AZ) in which the node has been deployed. + AvailabilityZone *string `type:"string"` + + // The endpoint for the node, consisting of a DNS name and a port number. Client + // applications can connect directly to a node endpoint, if desired (as an alternative + // to allowing DAX client software to intelligently route requests and responses + // to nodes in the DAX cluster. + Endpoint *Endpoint `type:"structure"` + + // The date and time (in UNIX epoch format) when the node was launched. + NodeCreateTime *time.Time `type:"timestamp"` + + // A system-generated identifier for the node. + NodeId *string `type:"string"` + + // The current status of the node. For example: available. + NodeStatus *string `type:"string"` + + // The status of the parameter group associated with this node. For example, + // in-sync. + ParameterGroupStatus *string `type:"string"` +} + +// String returns the string representation +func (s Node) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Node) GoString() string { + return s.String() +} + +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *Node) SetAvailabilityZone(v string) *Node { + s.AvailabilityZone = &v + return s +} + +// SetEndpoint sets the Endpoint field's value. +func (s *Node) SetEndpoint(v *Endpoint) *Node { + s.Endpoint = v + return s +} + +// SetNodeCreateTime sets the NodeCreateTime field's value. +func (s *Node) SetNodeCreateTime(v time.Time) *Node { + s.NodeCreateTime = &v + return s +} + +// SetNodeId sets the NodeId field's value. +func (s *Node) SetNodeId(v string) *Node { + s.NodeId = &v + return s +} + +// SetNodeStatus sets the NodeStatus field's value. +func (s *Node) SetNodeStatus(v string) *Node { + s.NodeStatus = &v + return s +} + +// SetParameterGroupStatus sets the ParameterGroupStatus field's value. +func (s *Node) SetParameterGroupStatus(v string) *Node { + s.ParameterGroupStatus = &v + return s +} + +// None of the nodes in the cluster have the given node ID. +type NodeNotFoundFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NodeNotFoundFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NodeNotFoundFault) GoString() string { + return s.String() +} + +func newErrorNodeNotFoundFault(v protocol.ResponseMetadata) error { + return &NodeNotFoundFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NodeNotFoundFault) Code() string { + return "NodeNotFoundFault" +} + +// Message returns the exception's message. +func (s NodeNotFoundFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NodeNotFoundFault) OrigErr() error { + return nil +} + +func (s NodeNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NodeNotFoundFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NodeNotFoundFault) RequestID() string { + return s.respMetadata.RequestID +} + +// You have attempted to exceed the maximum number of nodes for a DAX cluster. +type NodeQuotaForClusterExceededFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NodeQuotaForClusterExceededFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NodeQuotaForClusterExceededFault) GoString() string { + return s.String() +} + +func newErrorNodeQuotaForClusterExceededFault(v protocol.ResponseMetadata) error { + return &NodeQuotaForClusterExceededFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NodeQuotaForClusterExceededFault) Code() string { + return "NodeQuotaForClusterExceededFault" +} + +// Message returns the exception's message. +func (s NodeQuotaForClusterExceededFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NodeQuotaForClusterExceededFault) OrigErr() error { + return nil +} + +func (s NodeQuotaForClusterExceededFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NodeQuotaForClusterExceededFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NodeQuotaForClusterExceededFault) RequestID() string { + return s.respMetadata.RequestID +} + +// You have attempted to exceed the maximum number of nodes for your AWS account. +type NodeQuotaForCustomerExceededFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NodeQuotaForCustomerExceededFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NodeQuotaForCustomerExceededFault) GoString() string { + return s.String() +} + +func newErrorNodeQuotaForCustomerExceededFault(v protocol.ResponseMetadata) error { + return &NodeQuotaForCustomerExceededFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NodeQuotaForCustomerExceededFault) Code() string { + return "NodeQuotaForCustomerExceededFault" +} + +// Message returns the exception's message. +func (s NodeQuotaForCustomerExceededFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NodeQuotaForCustomerExceededFault) OrigErr() error { + return nil +} + +func (s NodeQuotaForCustomerExceededFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NodeQuotaForCustomerExceededFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NodeQuotaForCustomerExceededFault) RequestID() string { + return s.respMetadata.RequestID +} + +// Represents a parameter value that is applicable to a particular node type. +type NodeTypeSpecificValue struct { + _ struct{} `type:"structure"` + + // A node type to which the parameter value applies. + NodeType *string `type:"string"` + + // The parameter value for this node type. + Value *string `type:"string"` +} + +// String returns the string representation +func (s NodeTypeSpecificValue) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NodeTypeSpecificValue) GoString() string { + return s.String() +} + +// SetNodeType sets the NodeType field's value. +func (s *NodeTypeSpecificValue) SetNodeType(v string) *NodeTypeSpecificValue { + s.NodeType = &v + return s +} + +// SetValue sets the Value field's value. +func (s *NodeTypeSpecificValue) SetValue(v string) *NodeTypeSpecificValue { + s.Value = &v + return s +} + +// Describes a notification topic and its status. Notification topics are used +// for publishing DAX events to subscribers using Amazon Simple Notification +// Service (SNS). +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 DAX behavior. +type Parameter struct { + _ struct{} `type:"structure"` + + // A range of values within which the parameter can be set. + AllowedValues *string `type:"string"` + + // The conditions under which changes to this parameter can be applied. For + // example, requires-reboot indicates that a new value for this parameter will // only take effect if a node is rebooted. ChangeType *string `type:"string" enum:"ChangeType"` @@ -3902,10 +4717,178 @@ func (s *ParameterGroup) SetDescription(v string) *ParameterGroup { return s } -// SetParameterGroupName sets the ParameterGroupName field's value. -func (s *ParameterGroup) SetParameterGroupName(v string) *ParameterGroup { - s.ParameterGroupName = &v - return s +// SetParameterGroupName sets the ParameterGroupName field's value. +func (s *ParameterGroup) SetParameterGroupName(v string) *ParameterGroup { + s.ParameterGroupName = &v + return s +} + +// The specified parameter group already exists. +type ParameterGroupAlreadyExistsFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ParameterGroupAlreadyExistsFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ParameterGroupAlreadyExistsFault) GoString() string { + return s.String() +} + +func newErrorParameterGroupAlreadyExistsFault(v protocol.ResponseMetadata) error { + return &ParameterGroupAlreadyExistsFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ParameterGroupAlreadyExistsFault) Code() string { + return "ParameterGroupAlreadyExistsFault" +} + +// Message returns the exception's message. +func (s ParameterGroupAlreadyExistsFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ParameterGroupAlreadyExistsFault) OrigErr() error { + return nil +} + +func (s ParameterGroupAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ParameterGroupAlreadyExistsFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ParameterGroupAlreadyExistsFault) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified parameter group does not exist. +type ParameterGroupNotFoundFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ParameterGroupNotFoundFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ParameterGroupNotFoundFault) GoString() string { + return s.String() +} + +func newErrorParameterGroupNotFoundFault(v protocol.ResponseMetadata) error { + return &ParameterGroupNotFoundFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ParameterGroupNotFoundFault) Code() string { + return "ParameterGroupNotFoundFault" +} + +// Message returns the exception's message. +func (s ParameterGroupNotFoundFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ParameterGroupNotFoundFault) OrigErr() error { + return nil +} + +func (s ParameterGroupNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ParameterGroupNotFoundFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ParameterGroupNotFoundFault) RequestID() string { + return s.respMetadata.RequestID +} + +// You have attempted to exceed the maximum number of parameter groups. +type ParameterGroupQuotaExceededFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ParameterGroupQuotaExceededFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ParameterGroupQuotaExceededFault) GoString() string { + return s.String() +} + +func newErrorParameterGroupQuotaExceededFault(v protocol.ResponseMetadata) error { + return &ParameterGroupQuotaExceededFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ParameterGroupQuotaExceededFault) Code() string { + return "ParameterGroupQuotaExceededFault" +} + +// Message returns the exception's message. +func (s ParameterGroupQuotaExceededFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ParameterGroupQuotaExceededFault) OrigErr() error { + return nil +} + +func (s ParameterGroupQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ParameterGroupQuotaExceededFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ParameterGroupQuotaExceededFault) RequestID() string { + return s.respMetadata.RequestID } // The status of a parameter group. @@ -4164,13 +5147,69 @@ func (s *SecurityGroupMembership) SetStatus(v string) *SecurityGroupMembership { return s } +// The specified service linked role (SLR) was not found. +type ServiceLinkedRoleNotFoundFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceLinkedRoleNotFoundFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceLinkedRoleNotFoundFault) GoString() string { + return s.String() +} + +func newErrorServiceLinkedRoleNotFoundFault(v protocol.ResponseMetadata) error { + return &ServiceLinkedRoleNotFoundFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceLinkedRoleNotFoundFault) Code() string { + return "ServiceLinkedRoleNotFoundFault" +} + +// Message returns the exception's message. +func (s ServiceLinkedRoleNotFoundFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceLinkedRoleNotFoundFault) OrigErr() error { + return nil +} + +func (s ServiceLinkedRoleNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceLinkedRoleNotFoundFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceLinkedRoleNotFoundFault) RequestID() string { + return s.respMetadata.RequestID +} + // Represents the subnet associated with a DAX cluster. This parameter refers // to subnets defined in Amazon Virtual Private Cloud (Amazon VPC) and used // with DAX. type Subnet struct { _ struct{} `type:"structure"` - // The Availability Zone (AZ) for subnet subnet. + // The Availability Zone (AZ) for the subnet. SubnetAvailabilityZone *string `type:"string"` // The system-assigned identifier for the subnet. @@ -4254,6 +5293,344 @@ func (s *SubnetGroup) SetVpcId(v string) *SubnetGroup { return s } +// The specified subnet group already exists. +type SubnetGroupAlreadyExistsFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s SubnetGroupAlreadyExistsFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SubnetGroupAlreadyExistsFault) GoString() string { + return s.String() +} + +func newErrorSubnetGroupAlreadyExistsFault(v protocol.ResponseMetadata) error { + return &SubnetGroupAlreadyExistsFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SubnetGroupAlreadyExistsFault) Code() string { + return "SubnetGroupAlreadyExistsFault" +} + +// Message returns the exception's message. +func (s SubnetGroupAlreadyExistsFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SubnetGroupAlreadyExistsFault) OrigErr() error { + return nil +} + +func (s SubnetGroupAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SubnetGroupAlreadyExistsFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SubnetGroupAlreadyExistsFault) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified subnet group is currently in use. +type SubnetGroupInUseFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s SubnetGroupInUseFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SubnetGroupInUseFault) GoString() string { + return s.String() +} + +func newErrorSubnetGroupInUseFault(v protocol.ResponseMetadata) error { + return &SubnetGroupInUseFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SubnetGroupInUseFault) Code() string { + return "SubnetGroupInUseFault" +} + +// Message returns the exception's message. +func (s SubnetGroupInUseFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SubnetGroupInUseFault) OrigErr() error { + return nil +} + +func (s SubnetGroupInUseFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SubnetGroupInUseFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SubnetGroupInUseFault) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested subnet group name does not refer to an existing subnet group. +type SubnetGroupNotFoundFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s SubnetGroupNotFoundFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SubnetGroupNotFoundFault) GoString() string { + return s.String() +} + +func newErrorSubnetGroupNotFoundFault(v protocol.ResponseMetadata) error { + return &SubnetGroupNotFoundFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SubnetGroupNotFoundFault) Code() string { + return "SubnetGroupNotFoundFault" +} + +// Message returns the exception's message. +func (s SubnetGroupNotFoundFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SubnetGroupNotFoundFault) OrigErr() error { + return nil +} + +func (s SubnetGroupNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SubnetGroupNotFoundFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SubnetGroupNotFoundFault) RequestID() string { + return s.respMetadata.RequestID +} + +// The request cannot be processed because it would exceed the allowed number +// of subnets in a subnet group. +type SubnetGroupQuotaExceededFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s SubnetGroupQuotaExceededFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SubnetGroupQuotaExceededFault) GoString() string { + return s.String() +} + +func newErrorSubnetGroupQuotaExceededFault(v protocol.ResponseMetadata) error { + return &SubnetGroupQuotaExceededFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SubnetGroupQuotaExceededFault) Code() string { + return "SubnetGroupQuotaExceededFault" +} + +// Message returns the exception's message. +func (s SubnetGroupQuotaExceededFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SubnetGroupQuotaExceededFault) OrigErr() error { + return nil +} + +func (s SubnetGroupQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SubnetGroupQuotaExceededFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SubnetGroupQuotaExceededFault) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested subnet is being used by another subnet group. +type SubnetInUse struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s SubnetInUse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SubnetInUse) GoString() string { + return s.String() +} + +func newErrorSubnetInUse(v protocol.ResponseMetadata) error { + return &SubnetInUse{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SubnetInUse) Code() string { + return "SubnetInUse" +} + +// Message returns the exception's message. +func (s SubnetInUse) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SubnetInUse) OrigErr() error { + return nil +} + +func (s SubnetInUse) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SubnetInUse) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SubnetInUse) RequestID() string { + return s.respMetadata.RequestID +} + +// The request cannot be processed because it would exceed the allowed number +// of subnets in a subnet group. +type SubnetQuotaExceededFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s SubnetQuotaExceededFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SubnetQuotaExceededFault) GoString() string { + return s.String() +} + +func newErrorSubnetQuotaExceededFault(v protocol.ResponseMetadata) error { + return &SubnetQuotaExceededFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SubnetQuotaExceededFault) Code() string { + return "SubnetQuotaExceededFault" +} + +// Message returns the exception's message. +func (s SubnetQuotaExceededFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SubnetQuotaExceededFault) OrigErr() error { + return nil +} + +func (s SubnetQuotaExceededFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SubnetQuotaExceededFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SubnetQuotaExceededFault) RequestID() string { + return s.respMetadata.RequestID +} + // A description of a tag. Every tag is a key-value pair. You can add up to // 50 tags to a single DAX cluster. // @@ -4296,6 +5673,118 @@ func (s *Tag) SetValue(v string) *Tag { return s } +// The tag does not exist. +type TagNotFoundFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TagNotFoundFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagNotFoundFault) GoString() string { + return s.String() +} + +func newErrorTagNotFoundFault(v protocol.ResponseMetadata) error { + return &TagNotFoundFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagNotFoundFault) Code() string { + return "TagNotFoundFault" +} + +// Message returns the exception's message. +func (s TagNotFoundFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagNotFoundFault) OrigErr() error { + return nil +} + +func (s TagNotFoundFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagNotFoundFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagNotFoundFault) RequestID() string { + return s.respMetadata.RequestID +} + +// You have exceeded the maximum number of tags for this DAX cluster. +type TagQuotaPerResourceExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TagQuotaPerResourceExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagQuotaPerResourceExceeded) GoString() string { + return s.String() +} + +func newErrorTagQuotaPerResourceExceeded(v protocol.ResponseMetadata) error { + return &TagQuotaPerResourceExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagQuotaPerResourceExceeded) Code() string { + return "TagQuotaPerResourceExceeded" +} + +// Message returns the exception's message. +func (s TagQuotaPerResourceExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagQuotaPerResourceExceeded) OrigErr() error { + return nil +} + +func (s TagQuotaPerResourceExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagQuotaPerResourceExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagQuotaPerResourceExceeded) RequestID() string { + return s.respMetadata.RequestID +} + type TagResourceInput struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/dax/errors.go b/vendor/github.com/aws/aws-sdk-go/service/dax/errors.go index f5ef87e87a0..c42b6b81713 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dax/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dax/errors.go @@ -2,6 +2,10 @@ package dax +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeClusterAlreadyExistsFault for service response error code @@ -110,6 +114,8 @@ const ( // ErrCodeServiceLinkedRoleNotFoundFault for service response error code // "ServiceLinkedRoleNotFoundFault". + // + // The specified service linked role (SLR) was not found. ErrCodeServiceLinkedRoleNotFoundFault = "ServiceLinkedRoleNotFoundFault" // ErrCodeSubnetGroupAlreadyExistsFault for service response error code @@ -162,3 +168,32 @@ const ( // You have exceeded the maximum number of tags for this DAX cluster. ErrCodeTagQuotaPerResourceExceeded = "TagQuotaPerResourceExceeded" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ClusterAlreadyExistsFault": newErrorClusterAlreadyExistsFault, + "ClusterNotFoundFault": newErrorClusterNotFoundFault, + "ClusterQuotaForCustomerExceededFault": newErrorClusterQuotaForCustomerExceededFault, + "InsufficientClusterCapacityFault": newErrorInsufficientClusterCapacityFault, + "InvalidARNFault": newErrorInvalidARNFault, + "InvalidClusterStateFault": newErrorInvalidClusterStateFault, + "InvalidParameterCombinationException": newErrorInvalidParameterCombinationException, + "InvalidParameterGroupStateFault": newErrorInvalidParameterGroupStateFault, + "InvalidParameterValueException": newErrorInvalidParameterValueException, + "InvalidSubnet": newErrorInvalidSubnet, + "InvalidVPCNetworkStateFault": newErrorInvalidVPCNetworkStateFault, + "NodeNotFoundFault": newErrorNodeNotFoundFault, + "NodeQuotaForClusterExceededFault": newErrorNodeQuotaForClusterExceededFault, + "NodeQuotaForCustomerExceededFault": newErrorNodeQuotaForCustomerExceededFault, + "ParameterGroupAlreadyExistsFault": newErrorParameterGroupAlreadyExistsFault, + "ParameterGroupNotFoundFault": newErrorParameterGroupNotFoundFault, + "ParameterGroupQuotaExceededFault": newErrorParameterGroupQuotaExceededFault, + "ServiceLinkedRoleNotFoundFault": newErrorServiceLinkedRoleNotFoundFault, + "SubnetGroupAlreadyExistsFault": newErrorSubnetGroupAlreadyExistsFault, + "SubnetGroupInUseFault": newErrorSubnetGroupInUseFault, + "SubnetGroupNotFoundFault": newErrorSubnetGroupNotFoundFault, + "SubnetGroupQuotaExceededFault": newErrorSubnetGroupQuotaExceededFault, + "SubnetInUse": newErrorSubnetInUse, + "SubnetQuotaExceededFault": newErrorSubnetQuotaExceededFault, + "TagNotFoundFault": newErrorTagNotFoundFault, + "TagQuotaPerResourceExceeded": newErrorTagQuotaPerResourceExceeded, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dax/service.go b/vendor/github.com/aws/aws-sdk-go/service/dax/service.go index 545ea0312c3..36cad4f0c4f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dax/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dax/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "dax" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "DAX" // ServiceID is a unique identifer of a specific service. + ServiceID = "DAX" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the DAX client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a DAX client from just a session. // svc := dax.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := dax.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *DAX { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *DAX { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *DAX { svc := &DAX{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-04-19", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/devicefarm/api.go b/vendor/github.com/aws/aws-sdk-go/service/devicefarm/api.go index 967f9a29bb7..a458895b251 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/devicefarm/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/devicefarm/api.go @@ -66,17 +66,17 @@ func (c *DeviceFarm) CreateDevicePoolRequest(input *CreateDevicePoolInput) (req // See the AWS API reference guide for AWS Device Farm's // API operation CreateDevicePool for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/CreateDevicePool @@ -155,17 +155,17 @@ func (c *DeviceFarm) CreateInstanceProfileRequest(input *CreateInstanceProfileIn // See the AWS API reference guide for AWS Device Farm's // API operation CreateInstanceProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/CreateInstanceProfile @@ -243,17 +243,17 @@ func (c *DeviceFarm) CreateNetworkProfileRequest(input *CreateNetworkProfileInpu // See the AWS API reference guide for AWS Device Farm's // API operation CreateNetworkProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/CreateNetworkProfile @@ -322,7 +322,7 @@ func (c *DeviceFarm) CreateProjectRequest(input *CreateProjectInput) (req *reque // CreateProject API operation for AWS Device Farm. // -// Creates a new project. +// Creates a 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 @@ -331,20 +331,20 @@ func (c *DeviceFarm) CreateProjectRequest(input *CreateProjectInput) (req *reque // See the AWS API reference guide for AWS Device Farm's // API operation CreateProject for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // -// * ErrCodeTagOperationException "TagOperationException" +// * TagOperationException // The operation was not successful. Try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/CreateProject @@ -422,17 +422,17 @@ func (c *DeviceFarm) CreateRemoteAccessSessionRequest(input *CreateRemoteAccessS // See the AWS API reference guide for AWS Device Farm's // API operation CreateRemoteAccessSession for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/CreateRemoteAccessSession @@ -457,6 +457,174 @@ func (c *DeviceFarm) CreateRemoteAccessSessionWithContext(ctx aws.Context, input return out, req.Send() } +const opCreateTestGridProject = "CreateTestGridProject" + +// CreateTestGridProjectRequest generates a "aws/request.Request" representing the +// client's request for the CreateTestGridProject operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateTestGridProject for more information on using the CreateTestGridProject +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateTestGridProjectRequest method. +// req, resp := client.CreateTestGridProjectRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/CreateTestGridProject +func (c *DeviceFarm) CreateTestGridProjectRequest(input *CreateTestGridProjectInput) (req *request.Request, output *CreateTestGridProjectOutput) { + op := &request.Operation{ + Name: opCreateTestGridProject, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateTestGridProjectInput{} + } + + output = &CreateTestGridProjectOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateTestGridProject API operation for AWS Device Farm. +// +// Creates a Selenium testing project. Projects are used to track TestGridSession +// 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 Device Farm's +// API operation CreateTestGridProject for usage and error information. +// +// Returned Error Types: +// * InternalServiceException +// An internal exception was raised in the service. Contact aws-devicefarm-support@amazon.com +// (mailto:aws-devicefarm-support@amazon.com) if you see this error. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/CreateTestGridProject +func (c *DeviceFarm) CreateTestGridProject(input *CreateTestGridProjectInput) (*CreateTestGridProjectOutput, error) { + req, out := c.CreateTestGridProjectRequest(input) + return out, req.Send() +} + +// CreateTestGridProjectWithContext is the same as CreateTestGridProject with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTestGridProject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DeviceFarm) CreateTestGridProjectWithContext(ctx aws.Context, input *CreateTestGridProjectInput, opts ...request.Option) (*CreateTestGridProjectOutput, error) { + req, out := c.CreateTestGridProjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateTestGridUrl = "CreateTestGridUrl" + +// CreateTestGridUrlRequest generates a "aws/request.Request" representing the +// client's request for the CreateTestGridUrl operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateTestGridUrl for more information on using the CreateTestGridUrl +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateTestGridUrlRequest method. +// req, resp := client.CreateTestGridUrlRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/CreateTestGridUrl +func (c *DeviceFarm) CreateTestGridUrlRequest(input *CreateTestGridUrlInput) (req *request.Request, output *CreateTestGridUrlOutput) { + op := &request.Operation{ + Name: opCreateTestGridUrl, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateTestGridUrlInput{} + } + + output = &CreateTestGridUrlOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateTestGridUrl API operation for AWS Device Farm. +// +// Creates a signed, short-term URL that can be passed to a Selenium RemoteWebDriver +// constructor. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Device Farm's +// API operation CreateTestGridUrl for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// The specified entity was not found. +// +// * ArgumentException +// An invalid argument was specified. +// +// * InternalServiceException +// An internal exception was raised in the service. Contact aws-devicefarm-support@amazon.com +// (mailto:aws-devicefarm-support@amazon.com) if you see this error. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/CreateTestGridUrl +func (c *DeviceFarm) CreateTestGridUrl(input *CreateTestGridUrlInput) (*CreateTestGridUrlOutput, error) { + req, out := c.CreateTestGridUrlRequest(input) + return out, req.Send() +} + +// CreateTestGridUrlWithContext is the same as CreateTestGridUrl with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTestGridUrl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DeviceFarm) CreateTestGridUrlWithContext(ctx aws.Context, input *CreateTestGridUrlInput, opts ...request.Option) (*CreateTestGridUrlOutput, error) { + req, out := c.CreateTestGridUrlRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateUpload = "CreateUpload" // CreateUploadRequest generates a "aws/request.Request" representing the @@ -510,17 +678,17 @@ func (c *DeviceFarm) CreateUploadRequest(input *CreateUploadInput) (req *request // See the AWS API reference guide for AWS Device Farm's // API operation CreateUpload for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/CreateUpload @@ -599,14 +767,14 @@ func (c *DeviceFarm) CreateVPCEConfigurationRequest(input *CreateVPCEConfigurati // See the AWS API reference guide for AWS Device Farm's // API operation CreateVPCEConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/CreateVPCEConfiguration @@ -686,17 +854,17 @@ func (c *DeviceFarm) DeleteDevicePoolRequest(input *DeleteDevicePoolInput) (req // See the AWS API reference guide for AWS Device Farm's // API operation DeleteDevicePool for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/DeleteDevicePool @@ -775,17 +943,17 @@ func (c *DeviceFarm) DeleteInstanceProfileRequest(input *DeleteInstanceProfileIn // See the AWS API reference guide for AWS Device Farm's // API operation DeleteInstanceProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/DeleteInstanceProfile @@ -864,17 +1032,17 @@ func (c *DeviceFarm) DeleteNetworkProfileRequest(input *DeleteNetworkProfileInpu // See the AWS API reference guide for AWS Device Farm's // API operation DeleteNetworkProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/DeleteNetworkProfile @@ -946,7 +1114,7 @@ func (c *DeviceFarm) DeleteProjectRequest(input *DeleteProjectInput) (req *reque // // Deletes an AWS Device Farm project, given the project ARN. // -// Note Deleting this resource does not stop an in-progress run. +// Deleting this resource does not stop an in-progress 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 @@ -955,17 +1123,17 @@ func (c *DeviceFarm) DeleteProjectRequest(input *DeleteProjectInput) (req *reque // See the AWS API reference guide for AWS Device Farm's // API operation DeleteProject for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/DeleteProject @@ -1044,17 +1212,17 @@ func (c *DeviceFarm) DeleteRemoteAccessSessionRequest(input *DeleteRemoteAccessS // See the AWS API reference guide for AWS Device Farm's // API operation DeleteRemoteAccessSession for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/DeleteRemoteAccessSession @@ -1126,7 +1294,7 @@ func (c *DeviceFarm) DeleteRunRequest(input *DeleteRunInput) (req *request.Reque // // Deletes the run, given the run ARN. // -// Note Deleting this resource does not stop an in-progress run. +// Deleting this resource does not stop an in-progress 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 @@ -1135,17 +1303,17 @@ func (c *DeviceFarm) DeleteRunRequest(input *DeleteRunInput) (req *request.Reque // See the AWS API reference guide for AWS Device Farm's // API operation DeleteRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/DeleteRun @@ -1170,6 +1338,100 @@ func (c *DeviceFarm) DeleteRunWithContext(ctx aws.Context, input *DeleteRunInput return out, req.Send() } +const opDeleteTestGridProject = "DeleteTestGridProject" + +// DeleteTestGridProjectRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTestGridProject operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteTestGridProject for more information on using the DeleteTestGridProject +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteTestGridProjectRequest method. +// req, resp := client.DeleteTestGridProjectRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/DeleteTestGridProject +func (c *DeviceFarm) DeleteTestGridProjectRequest(input *DeleteTestGridProjectInput) (req *request.Request, output *DeleteTestGridProjectOutput) { + op := &request.Operation{ + Name: opDeleteTestGridProject, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteTestGridProjectInput{} + } + + output = &DeleteTestGridProjectOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteTestGridProject API operation for AWS Device Farm. +// +// Deletes a Selenium testing project and all content generated under it. +// +// You cannot undo this operation. +// +// You cannot delete a project if it has active sessions. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Device Farm's +// API operation DeleteTestGridProject for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// The specified entity was not found. +// +// * ArgumentException +// An invalid argument was specified. +// +// * CannotDeleteException +// The requested object could not be deleted. +// +// * InternalServiceException +// An internal exception was raised in the service. Contact aws-devicefarm-support@amazon.com +// (mailto:aws-devicefarm-support@amazon.com) if you see this error. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/DeleteTestGridProject +func (c *DeviceFarm) DeleteTestGridProject(input *DeleteTestGridProjectInput) (*DeleteTestGridProjectOutput, error) { + req, out := c.DeleteTestGridProjectRequest(input) + return out, req.Send() +} + +// DeleteTestGridProjectWithContext is the same as DeleteTestGridProject with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTestGridProject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DeviceFarm) DeleteTestGridProjectWithContext(ctx aws.Context, input *DeleteTestGridProjectInput, opts ...request.Option) (*DeleteTestGridProjectOutput, error) { + req, out := c.DeleteTestGridProjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteUpload = "DeleteUpload" // DeleteUploadRequest generates a "aws/request.Request" representing the @@ -1224,17 +1486,17 @@ func (c *DeviceFarm) DeleteUploadRequest(input *DeleteUploadInput) (req *request // See the AWS API reference guide for AWS Device Farm's // API operation DeleteUpload for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/DeleteUpload @@ -1313,17 +1575,17 @@ func (c *DeviceFarm) DeleteVPCEConfigurationRequest(input *DeleteVPCEConfigurati // See the AWS API reference guide for AWS Device Farm's // API operation DeleteVPCEConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // There was an error with the update request, or you do not have sufficient // permissions to update this VPC endpoint configuration. // @@ -1393,8 +1655,8 @@ func (c *DeviceFarm) GetAccountSettingsRequest(input *GetAccountSettingsInput) ( // GetAccountSettings API operation for AWS Device Farm. // -// Returns the number of unmetered iOS and/or unmetered Android devices that -// have been purchased by the account. +// Returns the number of unmetered iOS or unmetered Android devices that have +// been purchased by 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 @@ -1403,17 +1665,17 @@ func (c *DeviceFarm) GetAccountSettingsRequest(input *GetAccountSettingsInput) ( // See the AWS API reference guide for AWS Device Farm's // API operation GetAccountSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetAccountSettings @@ -1491,17 +1753,17 @@ func (c *DeviceFarm) GetDeviceRequest(input *GetDeviceInput) (req *request.Reque // See the AWS API reference guide for AWS Device Farm's // API operation GetDevice for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetDevice @@ -1570,7 +1832,7 @@ func (c *DeviceFarm) GetDeviceInstanceRequest(input *GetDeviceInstanceInput) (re // GetDeviceInstance API operation for AWS Device Farm. // -// Returns information about a device instance belonging to a private device +// Returns information about a device instance that belongs to a private device // fleet. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1580,17 +1842,17 @@ func (c *DeviceFarm) GetDeviceInstanceRequest(input *GetDeviceInstanceInput) (re // See the AWS API reference guide for AWS Device Farm's // API operation GetDeviceInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetDeviceInstance @@ -1668,17 +1930,17 @@ func (c *DeviceFarm) GetDevicePoolRequest(input *GetDevicePoolInput) (req *reque // See the AWS API reference guide for AWS Device Farm's // API operation GetDevicePool for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetDevicePool @@ -1756,17 +2018,17 @@ func (c *DeviceFarm) GetDevicePoolCompatibilityRequest(input *GetDevicePoolCompa // See the AWS API reference guide for AWS Device Farm's // API operation GetDevicePoolCompatibility for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetDevicePoolCompatibility @@ -1844,17 +2106,17 @@ func (c *DeviceFarm) GetInstanceProfileRequest(input *GetInstanceProfileInput) ( // See the AWS API reference guide for AWS Device Farm's // API operation GetInstanceProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetInstanceProfile @@ -1932,17 +2194,17 @@ func (c *DeviceFarm) GetJobRequest(input *GetJobInput) (req *request.Request, ou // See the AWS API reference guide for AWS Device Farm's // API operation GetJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetJob @@ -2020,17 +2282,17 @@ func (c *DeviceFarm) GetNetworkProfileRequest(input *GetNetworkProfileInput) (re // See the AWS API reference guide for AWS Device Farm's // API operation GetNetworkProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetNetworkProfile @@ -2109,8 +2371,8 @@ func (c *DeviceFarm) GetOfferingStatusRequest(input *GetOfferingStatusInput) (re // AWS account. The response indicates how many offerings are currently available // and the offerings that will be available in the next period. The API returns // a NotEligible error if the user is not permitted to invoke the operation. -// Please contact aws-devicefarm-support@amazon.com (mailto:aws-devicefarm-support@amazon.com) -// if you believe that you should be able to invoke this operation. +// If you must be able to invoke this operation, contact aws-devicefarm-support@amazon.com +// (mailto:aws-devicefarm-support@amazon.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 @@ -2119,21 +2381,21 @@ func (c *DeviceFarm) GetOfferingStatusRequest(input *GetOfferingStatusInput) (re // See the AWS API reference guide for AWS Device Farm's // API operation GetOfferingStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeNotEligibleException "NotEligibleException" +// * NotEligibleException // Exception gets thrown when a user is not eligible to perform the specified // transaction. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetOfferingStatus @@ -2201,10 +2463,12 @@ func (c *DeviceFarm) GetOfferingStatusPagesWithContext(ctx aws.Context, input *G }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetOfferingStatusOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetOfferingStatusOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2261,17 +2525,17 @@ func (c *DeviceFarm) GetProjectRequest(input *GetProjectInput) (req *request.Req // See the AWS API reference guide for AWS Device Farm's // API operation GetProject for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetProject @@ -2349,17 +2613,17 @@ func (c *DeviceFarm) GetRemoteAccessSessionRequest(input *GetRemoteAccessSession // See the AWS API reference guide for AWS Device Farm's // API operation GetRemoteAccessSession for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetRemoteAccessSession @@ -2437,17 +2701,17 @@ func (c *DeviceFarm) GetRunRequest(input *GetRunInput) (req *request.Request, ou // See the AWS API reference guide for AWS Device Farm's // API operation GetRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetRun @@ -2525,17 +2789,17 @@ func (c *DeviceFarm) GetSuiteRequest(input *GetSuiteInput) (req *request.Request // See the AWS API reference guide for AWS Device Farm's // API operation GetSuite for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetSuite @@ -2613,17 +2877,17 @@ func (c *DeviceFarm) GetTestRequest(input *GetTestInput) (req *request.Request, // See the AWS API reference guide for AWS Device Farm's // API operation GetTest for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetTest @@ -2648,218 +2912,397 @@ func (c *DeviceFarm) GetTestWithContext(ctx aws.Context, input *GetTestInput, op return out, req.Send() } -const opGetUpload = "GetUpload" +const opGetTestGridProject = "GetTestGridProject" -// GetUploadRequest generates a "aws/request.Request" representing the -// client's request for the GetUpload operation. The "output" return +// GetTestGridProjectRequest generates a "aws/request.Request" representing the +// client's request for the GetTestGridProject operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetUpload for more information on using the GetUpload +// See GetTestGridProject for more information on using the GetTestGridProject // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetUploadRequest method. -// req, resp := client.GetUploadRequest(params) +// // Example sending a request using the GetTestGridProjectRequest method. +// req, resp := client.GetTestGridProjectRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetUpload -func (c *DeviceFarm) GetUploadRequest(input *GetUploadInput) (req *request.Request, output *GetUploadOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetTestGridProject +func (c *DeviceFarm) GetTestGridProjectRequest(input *GetTestGridProjectInput) (req *request.Request, output *GetTestGridProjectOutput) { op := &request.Operation{ - Name: opGetUpload, + Name: opGetTestGridProject, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetUploadInput{} + input = &GetTestGridProjectInput{} } - output = &GetUploadOutput{} + output = &GetTestGridProjectOutput{} req = c.newRequest(op, input, output) return } -// GetUpload API operation for AWS Device Farm. +// GetTestGridProject API operation for AWS Device Farm. // -// Gets information about an upload. +// Retrieves information about a Selenium testing 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 Device Farm's -// API operation GetUpload for usage and error information. -// -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" -// An invalid argument was specified. +// API operation GetTestGridProject for usage and error information. // -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" -// A limit was exceeded. +// * ArgumentException +// An invalid argument was specified. // -// * ErrCodeServiceAccountException "ServiceAccountException" -// There was a problem with the service account. +// * InternalServiceException +// An internal exception was raised in the service. Contact aws-devicefarm-support@amazon.com +// (mailto:aws-devicefarm-support@amazon.com) if you see this error. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetUpload -func (c *DeviceFarm) GetUpload(input *GetUploadInput) (*GetUploadOutput, error) { - req, out := c.GetUploadRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetTestGridProject +func (c *DeviceFarm) GetTestGridProject(input *GetTestGridProjectInput) (*GetTestGridProjectOutput, error) { + req, out := c.GetTestGridProjectRequest(input) return out, req.Send() } -// GetUploadWithContext is the same as GetUpload with the addition of +// GetTestGridProjectWithContext is the same as GetTestGridProject with the addition of // the ability to pass a context and additional request options. // -// See GetUpload for details on how to use this API operation. +// See GetTestGridProject for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) GetUploadWithContext(ctx aws.Context, input *GetUploadInput, opts ...request.Option) (*GetUploadOutput, error) { - req, out := c.GetUploadRequest(input) +func (c *DeviceFarm) GetTestGridProjectWithContext(ctx aws.Context, input *GetTestGridProjectInput, opts ...request.Option) (*GetTestGridProjectOutput, error) { + req, out := c.GetTestGridProjectRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetVPCEConfiguration = "GetVPCEConfiguration" +const opGetTestGridSession = "GetTestGridSession" -// GetVPCEConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetVPCEConfiguration operation. The "output" return +// GetTestGridSessionRequest generates a "aws/request.Request" representing the +// client's request for the GetTestGridSession operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetVPCEConfiguration for more information on using the GetVPCEConfiguration +// See GetTestGridSession for more information on using the GetTestGridSession // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetVPCEConfigurationRequest method. -// req, resp := client.GetVPCEConfigurationRequest(params) +// // Example sending a request using the GetTestGridSessionRequest method. +// req, resp := client.GetTestGridSessionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetVPCEConfiguration -func (c *DeviceFarm) GetVPCEConfigurationRequest(input *GetVPCEConfigurationInput) (req *request.Request, output *GetVPCEConfigurationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetTestGridSession +func (c *DeviceFarm) GetTestGridSessionRequest(input *GetTestGridSessionInput) (req *request.Request, output *GetTestGridSessionOutput) { op := &request.Operation{ - Name: opGetVPCEConfiguration, + Name: opGetTestGridSession, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetVPCEConfigurationInput{} + input = &GetTestGridSessionInput{} } - output = &GetVPCEConfigurationOutput{} + output = &GetTestGridSessionOutput{} req = c.newRequest(op, input, output) return } -// GetVPCEConfiguration API operation for AWS Device Farm. +// GetTestGridSession API operation for AWS Device Farm. // -// Returns information about the configuration settings for your Amazon Virtual -// Private Cloud (VPC) endpoint. +// A session is an instance of a browser created through a RemoteWebDriver with +// the URL from CreateTestGridUrlResult$url. You can use the following to look +// up sessions: +// +// * The session ARN (GetTestGridSessionRequest$sessionArn). +// +// * The project ARN and a session ID (GetTestGridSessionRequest$projectArn +// and GetTestGridSessionRequest$sessionId). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Device Farm's -// API operation GetVPCEConfiguration for usage and error information. -// -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" -// An invalid argument was specified. +// API operation GetTestGridSession for usage and error information. // -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The specified entity was not found. // -// * ErrCodeServiceAccountException "ServiceAccountException" -// There was a problem with the service account. +// * ArgumentException +// An invalid argument was specified. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetVPCEConfiguration -func (c *DeviceFarm) GetVPCEConfiguration(input *GetVPCEConfigurationInput) (*GetVPCEConfigurationOutput, error) { - req, out := c.GetVPCEConfigurationRequest(input) +// * InternalServiceException +// An internal exception was raised in the service. Contact aws-devicefarm-support@amazon.com +// (mailto:aws-devicefarm-support@amazon.com) if you see this error. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetTestGridSession +func (c *DeviceFarm) GetTestGridSession(input *GetTestGridSessionInput) (*GetTestGridSessionOutput, error) { + req, out := c.GetTestGridSessionRequest(input) return out, req.Send() } -// GetVPCEConfigurationWithContext is the same as GetVPCEConfiguration with the addition of +// GetTestGridSessionWithContext is the same as GetTestGridSession with the addition of // the ability to pass a context and additional request options. // -// See GetVPCEConfiguration for details on how to use this API operation. +// See GetTestGridSession for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) GetVPCEConfigurationWithContext(ctx aws.Context, input *GetVPCEConfigurationInput, opts ...request.Option) (*GetVPCEConfigurationOutput, error) { - req, out := c.GetVPCEConfigurationRequest(input) +func (c *DeviceFarm) GetTestGridSessionWithContext(ctx aws.Context, input *GetTestGridSessionInput, opts ...request.Option) (*GetTestGridSessionOutput, error) { + req, out := c.GetTestGridSessionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opInstallToRemoteAccessSession = "InstallToRemoteAccessSession" +const opGetUpload = "GetUpload" -// InstallToRemoteAccessSessionRequest generates a "aws/request.Request" representing the -// client's request for the InstallToRemoteAccessSession operation. The "output" return +// GetUploadRequest generates a "aws/request.Request" representing the +// client's request for the GetUpload operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See InstallToRemoteAccessSession for more information on using the InstallToRemoteAccessSession +// See GetUpload for more information on using the GetUpload // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the InstallToRemoteAccessSessionRequest method. -// req, resp := client.InstallToRemoteAccessSessionRequest(params) +// // Example sending a request using the GetUploadRequest method. +// req, resp := client.GetUploadRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/InstallToRemoteAccessSession -func (c *DeviceFarm) InstallToRemoteAccessSessionRequest(input *InstallToRemoteAccessSessionInput) (req *request.Request, output *InstallToRemoteAccessSessionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetUpload +func (c *DeviceFarm) GetUploadRequest(input *GetUploadInput) (req *request.Request, output *GetUploadOutput) { op := &request.Operation{ - Name: opInstallToRemoteAccessSession, + Name: opGetUpload, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &InstallToRemoteAccessSessionInput{} + input = &GetUploadInput{} } - output = &InstallToRemoteAccessSessionOutput{} + output = &GetUploadOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetUpload API operation for AWS Device Farm. +// +// Gets information about an upload. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Device Farm's +// API operation GetUpload for usage and error information. +// +// Returned Error Types: +// * ArgumentException +// An invalid argument was specified. +// +// * NotFoundException +// The specified entity was not found. +// +// * LimitExceededException +// A limit was exceeded. +// +// * ServiceAccountException +// There was a problem with the service account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetUpload +func (c *DeviceFarm) GetUpload(input *GetUploadInput) (*GetUploadOutput, error) { + req, out := c.GetUploadRequest(input) + return out, req.Send() +} + +// GetUploadWithContext is the same as GetUpload with the addition of +// the ability to pass a context and additional request options. +// +// See GetUpload for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DeviceFarm) GetUploadWithContext(ctx aws.Context, input *GetUploadInput, opts ...request.Option) (*GetUploadOutput, error) { + req, out := c.GetUploadRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetVPCEConfiguration = "GetVPCEConfiguration" + +// GetVPCEConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the GetVPCEConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetVPCEConfiguration for more information on using the GetVPCEConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetVPCEConfigurationRequest method. +// req, resp := client.GetVPCEConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetVPCEConfiguration +func (c *DeviceFarm) GetVPCEConfigurationRequest(input *GetVPCEConfigurationInput) (req *request.Request, output *GetVPCEConfigurationOutput) { + op := &request.Operation{ + Name: opGetVPCEConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetVPCEConfigurationInput{} + } + + output = &GetVPCEConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetVPCEConfiguration API operation for AWS Device Farm. +// +// Returns information about the configuration settings for your Amazon Virtual +// Private Cloud (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 AWS Device Farm's +// API operation GetVPCEConfiguration for usage and error information. +// +// Returned Error Types: +// * ArgumentException +// An invalid argument was specified. +// +// * NotFoundException +// The specified entity was not found. +// +// * ServiceAccountException +// There was a problem with the service account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/GetVPCEConfiguration +func (c *DeviceFarm) GetVPCEConfiguration(input *GetVPCEConfigurationInput) (*GetVPCEConfigurationOutput, error) { + req, out := c.GetVPCEConfigurationRequest(input) + return out, req.Send() +} + +// GetVPCEConfigurationWithContext is the same as GetVPCEConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetVPCEConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DeviceFarm) GetVPCEConfigurationWithContext(ctx aws.Context, input *GetVPCEConfigurationInput, opts ...request.Option) (*GetVPCEConfigurationOutput, error) { + req, out := c.GetVPCEConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opInstallToRemoteAccessSession = "InstallToRemoteAccessSession" + +// InstallToRemoteAccessSessionRequest generates a "aws/request.Request" representing the +// client's request for the InstallToRemoteAccessSession operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See InstallToRemoteAccessSession for more information on using the InstallToRemoteAccessSession +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the InstallToRemoteAccessSessionRequest method. +// req, resp := client.InstallToRemoteAccessSessionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/InstallToRemoteAccessSession +func (c *DeviceFarm) InstallToRemoteAccessSessionRequest(input *InstallToRemoteAccessSessionInput) (req *request.Request, output *InstallToRemoteAccessSessionOutput) { + op := &request.Operation{ + Name: opInstallToRemoteAccessSession, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &InstallToRemoteAccessSessionInput{} + } + + output = &InstallToRemoteAccessSessionOutput{} req = c.newRequest(op, input, output) return } @@ -2877,17 +3320,17 @@ func (c *DeviceFarm) InstallToRemoteAccessSessionRequest(input *InstallToRemoteA // See the AWS API reference guide for AWS Device Farm's // API operation InstallToRemoteAccessSession for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/InstallToRemoteAccessSession @@ -2971,17 +3414,17 @@ func (c *DeviceFarm) ListArtifactsRequest(input *ListArtifactsInput) (req *reque // See the AWS API reference guide for AWS Device Farm's // API operation ListArtifacts for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListArtifacts @@ -3049,10 +3492,12 @@ func (c *DeviceFarm) ListArtifactsPagesWithContext(ctx aws.Context, input *ListA }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListArtifactsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListArtifactsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3110,17 +3555,17 @@ func (c *DeviceFarm) ListDeviceInstancesRequest(input *ListDeviceInstancesInput) // See the AWS API reference guide for AWS Device Farm's // API operation ListDeviceInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListDeviceInstances @@ -3204,17 +3649,17 @@ func (c *DeviceFarm) ListDevicePoolsRequest(input *ListDevicePoolsInput) (req *r // See the AWS API reference guide for AWS Device Farm's // API operation ListDevicePools for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListDevicePools @@ -3282,10 +3727,12 @@ func (c *DeviceFarm) ListDevicePoolsPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDevicePoolsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDevicePoolsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3348,17 +3795,17 @@ func (c *DeviceFarm) ListDevicesRequest(input *ListDevicesInput) (req *request.R // See the AWS API reference guide for AWS Device Farm's // API operation ListDevices for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListDevices @@ -3426,10 +3873,12 @@ func (c *DeviceFarm) ListDevicesPagesWithContext(ctx aws.Context, input *ListDev }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDevicesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDevicesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3486,17 +3935,17 @@ func (c *DeviceFarm) ListInstanceProfilesRequest(input *ListInstanceProfilesInpu // See the AWS API reference guide for AWS Device Farm's // API operation ListInstanceProfiles for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListInstanceProfiles @@ -3580,17 +4029,17 @@ func (c *DeviceFarm) ListJobsRequest(input *ListJobsInput) (req *request.Request // See the AWS API reference guide for AWS Device Farm's // API operation ListJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListJobs @@ -3658,10 +4107,12 @@ func (c *DeviceFarm) ListJobsPagesWithContext(ctx aws.Context, input *ListJobsIn }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3718,17 +4169,17 @@ func (c *DeviceFarm) ListNetworkProfilesRequest(input *ListNetworkProfilesInput) // See the AWS API reference guide for AWS Device Farm's // API operation ListNetworkProfiles for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListNetworkProfiles @@ -3800,8 +4251,8 @@ func (c *DeviceFarm) ListOfferingPromotionsRequest(input *ListOfferingPromotions // Returns a list of offering promotions. Each offering promotion record contains // the ID and description of the promotion. The API returns a NotEligible error // if the caller is not permitted to invoke the operation. Contact aws-devicefarm-support@amazon.com -// (mailto:aws-devicefarm-support@amazon.com) if you believe that you should -// be able to invoke this operation. +// (mailto:aws-devicefarm-support@amazon.com) if you must be able to invoke +// 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 @@ -3810,21 +4261,21 @@ func (c *DeviceFarm) ListOfferingPromotionsRequest(input *ListOfferingPromotions // See the AWS API reference guide for AWS Device Farm's // API operation ListOfferingPromotions for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeNotEligibleException "NotEligibleException" +// * NotEligibleException // Exception gets thrown when a user is not eligible to perform the specified // transaction. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListOfferingPromotions @@ -3902,9 +4353,9 @@ func (c *DeviceFarm) ListOfferingTransactionsRequest(input *ListOfferingTransact // Returns a list of all historical purchases, renewals, and system renewal // transactions for an AWS account. The list is paginated and ordered by a descending // timestamp (most recent transactions are first). The API returns a NotEligible -// error if the user is not permitted to invoke the operation. Please contact -// aws-devicefarm-support@amazon.com (mailto:aws-devicefarm-support@amazon.com) -// if you believe that you should be able to invoke this operation. +// error if the user is not permitted to invoke the operation. If you must be +// able to invoke this operation, contact aws-devicefarm-support@amazon.com +// (mailto:aws-devicefarm-support@amazon.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 @@ -3913,21 +4364,21 @@ func (c *DeviceFarm) ListOfferingTransactionsRequest(input *ListOfferingTransact // See the AWS API reference guide for AWS Device Farm's // API operation ListOfferingTransactions for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeNotEligibleException "NotEligibleException" +// * NotEligibleException // Exception gets thrown when a user is not eligible to perform the specified // transaction. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListOfferingTransactions @@ -3995,10 +4446,12 @@ func (c *DeviceFarm) ListOfferingTransactionsPagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOfferingTransactionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListOfferingTransactionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4055,9 +4508,8 @@ func (c *DeviceFarm) ListOfferingsRequest(input *ListOfferingsInput) (req *reque // Returns a list of products or offerings that the user can manage through // the API. Each offering record indicates the recurring price per unit and // the frequency for that offering. The API returns a NotEligible error if the -// user is not permitted to invoke the operation. Please contact aws-devicefarm-support@amazon.com -// (mailto:aws-devicefarm-support@amazon.com) if you believe that you should -// be able to invoke this operation. +// user is not permitted to invoke the operation. If you must be able to invoke +// this operation, contact aws-devicefarm-support@amazon.com (mailto:aws-devicefarm-support@amazon.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 @@ -4066,21 +4518,21 @@ func (c *DeviceFarm) ListOfferingsRequest(input *ListOfferingsInput) (req *reque // See the AWS API reference guide for AWS Device Farm's // API operation ListOfferings for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeNotEligibleException "NotEligibleException" +// * NotEligibleException // Exception gets thrown when a user is not eligible to perform the specified // transaction. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListOfferings @@ -4148,10 +4600,12 @@ func (c *DeviceFarm) ListOfferingsPagesWithContext(ctx aws.Context, input *ListO }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOfferingsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListOfferingsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4214,17 +4668,17 @@ func (c *DeviceFarm) ListProjectsRequest(input *ListProjectsInput) (req *request // See the AWS API reference guide for AWS Device Farm's // API operation ListProjects for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListProjects @@ -4292,10 +4746,12 @@ func (c *DeviceFarm) ListProjectsPagesWithContext(ctx aws.Context, input *ListPr }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListProjectsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListProjectsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4352,17 +4808,17 @@ func (c *DeviceFarm) ListRemoteAccessSessionsRequest(input *ListRemoteAccessSess // See the AWS API reference guide for AWS Device Farm's // API operation ListRemoteAccessSessions for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListRemoteAccessSessions @@ -4446,17 +4902,17 @@ func (c *DeviceFarm) ListRunsRequest(input *ListRunsInput) (req *request.Request // See the AWS API reference guide for AWS Device Farm's // API operation ListRuns for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListRuns @@ -4524,10 +4980,12 @@ func (c *DeviceFarm) ListRunsPagesWithContext(ctx aws.Context, input *ListRunsIn }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRunsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListRunsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4590,17 +5048,17 @@ func (c *DeviceFarm) ListSamplesRequest(input *ListSamplesInput) (req *request.R // See the AWS API reference guide for AWS Device Farm's // API operation ListSamples for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListSamples @@ -4668,10 +5126,12 @@ func (c *DeviceFarm) ListSamplesPagesWithContext(ctx aws.Context, input *ListSam }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSamplesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListSamplesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4734,17 +5194,17 @@ func (c *DeviceFarm) ListSuitesRequest(input *ListSuitesInput) (req *request.Req // See the AWS API reference guide for AWS Device Farm's // API operation ListSuites for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListSuites @@ -4812,10 +5272,12 @@ func (c *DeviceFarm) ListSuitesPagesWithContext(ctx aws.Context, input *ListSuit }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSuitesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListSuitesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4872,11 +5334,14 @@ func (c *DeviceFarm) ListTagsForResourceRequest(input *ListTagsForResourceInput) // See the AWS API reference guide for AWS Device Farm's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * ArgumentException +// An invalid argument was specified. +// +// * NotFoundException // The specified entity was not found. // -// * ErrCodeTagOperationException "TagOperationException" +// * TagOperationException // The operation was not successful. Try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListTagsForResource @@ -4901,1900 +5366,2572 @@ func (c *DeviceFarm) ListTagsForResourceWithContext(ctx aws.Context, input *List return out, req.Send() } -const opListTests = "ListTests" +const opListTestGridProjects = "ListTestGridProjects" -// ListTestsRequest generates a "aws/request.Request" representing the -// client's request for the ListTests operation. The "output" return +// ListTestGridProjectsRequest generates a "aws/request.Request" representing the +// client's request for the ListTestGridProjects operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListTests for more information on using the ListTests +// See ListTestGridProjects for more information on using the ListTestGridProjects // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListTestsRequest method. -// req, resp := client.ListTestsRequest(params) +// // Example sending a request using the ListTestGridProjectsRequest method. +// req, resp := client.ListTestGridProjectsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListTests -func (c *DeviceFarm) ListTestsRequest(input *ListTestsInput) (req *request.Request, output *ListTestsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListTestGridProjects +func (c *DeviceFarm) ListTestGridProjectsRequest(input *ListTestGridProjectsInput) (req *request.Request, output *ListTestGridProjectsOutput) { op := &request.Operation{ - Name: opListTests, + Name: opListTestGridProjects, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ InputTokens: []string{"nextToken"}, OutputTokens: []string{"nextToken"}, - LimitToken: "", + LimitToken: "maxResult", TruncationToken: "", }, } if input == nil { - input = &ListTestsInput{} + input = &ListTestGridProjectsInput{} } - output = &ListTestsOutput{} + output = &ListTestGridProjectsOutput{} req = c.newRequest(op, input, output) return } -// ListTests API operation for AWS Device Farm. +// ListTestGridProjects API operation for AWS Device Farm. // -// Gets information about tests in a given test suite. +// Gets a list of all Selenium testing projects 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 Device Farm's -// API operation ListTests for usage and error information. +// API operation ListTestGridProjects for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" -// The specified entity was not found. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// A limit was exceeded. -// -// * ErrCodeServiceAccountException "ServiceAccountException" -// There was a problem with the service account. +// * InternalServiceException +// An internal exception was raised in the service. Contact aws-devicefarm-support@amazon.com +// (mailto:aws-devicefarm-support@amazon.com) if you see this error. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListTests -func (c *DeviceFarm) ListTests(input *ListTestsInput) (*ListTestsOutput, error) { - req, out := c.ListTestsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListTestGridProjects +func (c *DeviceFarm) ListTestGridProjects(input *ListTestGridProjectsInput) (*ListTestGridProjectsOutput, error) { + req, out := c.ListTestGridProjectsRequest(input) return out, req.Send() } -// ListTestsWithContext is the same as ListTests with the addition of +// ListTestGridProjectsWithContext is the same as ListTestGridProjects with the addition of // the ability to pass a context and additional request options. // -// See ListTests for details on how to use this API operation. +// See ListTestGridProjects for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) ListTestsWithContext(ctx aws.Context, input *ListTestsInput, opts ...request.Option) (*ListTestsOutput, error) { - req, out := c.ListTestsRequest(input) +func (c *DeviceFarm) ListTestGridProjectsWithContext(ctx aws.Context, input *ListTestGridProjectsInput, opts ...request.Option) (*ListTestGridProjectsOutput, error) { + req, out := c.ListTestGridProjectsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListTestsPages iterates over the pages of a ListTests operation, +// ListTestGridProjectsPages iterates over the pages of a ListTestGridProjects operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See ListTests method for more information on how to use this operation. +// See ListTestGridProjects 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 ListTests operation. +// // Example iterating over at most 3 pages of a ListTestGridProjects operation. // pageNum := 0 -// err := client.ListTestsPages(params, -// func(page *devicefarm.ListTestsOutput, lastPage bool) bool { +// err := client.ListTestGridProjectsPages(params, +// func(page *devicefarm.ListTestGridProjectsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *DeviceFarm) ListTestsPages(input *ListTestsInput, fn func(*ListTestsOutput, bool) bool) error { - return c.ListTestsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *DeviceFarm) ListTestGridProjectsPages(input *ListTestGridProjectsInput, fn func(*ListTestGridProjectsOutput, bool) bool) error { + return c.ListTestGridProjectsPagesWithContext(aws.BackgroundContext(), input, fn) } -// ListTestsPagesWithContext same as ListTestsPages except +// ListTestGridProjectsPagesWithContext same as ListTestGridProjectsPages 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 *DeviceFarm) ListTestsPagesWithContext(ctx aws.Context, input *ListTestsInput, fn func(*ListTestsOutput, bool) bool, opts ...request.Option) error { +func (c *DeviceFarm) ListTestGridProjectsPagesWithContext(ctx aws.Context, input *ListTestGridProjectsInput, fn func(*ListTestGridProjectsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *ListTestsInput + var inCpy *ListTestGridProjectsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.ListTestsRequest(inCpy) + req, _ := c.ListTestGridProjectsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTestsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTestGridProjectsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opListUniqueProblems = "ListUniqueProblems" +const opListTestGridSessionActions = "ListTestGridSessionActions" -// ListUniqueProblemsRequest generates a "aws/request.Request" representing the -// client's request for the ListUniqueProblems operation. The "output" return +// ListTestGridSessionActionsRequest generates a "aws/request.Request" representing the +// client's request for the ListTestGridSessionActions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListUniqueProblems for more information on using the ListUniqueProblems +// See ListTestGridSessionActions for more information on using the ListTestGridSessionActions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListUniqueProblemsRequest method. -// req, resp := client.ListUniqueProblemsRequest(params) +// // Example sending a request using the ListTestGridSessionActionsRequest method. +// req, resp := client.ListTestGridSessionActionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListUniqueProblems -func (c *DeviceFarm) ListUniqueProblemsRequest(input *ListUniqueProblemsInput) (req *request.Request, output *ListUniqueProblemsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListTestGridSessionActions +func (c *DeviceFarm) ListTestGridSessionActionsRequest(input *ListTestGridSessionActionsInput) (req *request.Request, output *ListTestGridSessionActionsOutput) { op := &request.Operation{ - Name: opListUniqueProblems, + Name: opListTestGridSessionActions, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ InputTokens: []string{"nextToken"}, OutputTokens: []string{"nextToken"}, - LimitToken: "", + LimitToken: "maxResult", TruncationToken: "", }, } if input == nil { - input = &ListUniqueProblemsInput{} + input = &ListTestGridSessionActionsInput{} } - output = &ListUniqueProblemsOutput{} + output = &ListTestGridSessionActionsOutput{} req = c.newRequest(op, input, output) return } -// ListUniqueProblems API operation for AWS Device Farm. +// ListTestGridSessionActions API operation for AWS Device Farm. // -// Gets information about unique problems. +// Returns a list of the actions taken in a TestGridSession. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Device Farm's -// API operation ListUniqueProblems for usage and error information. -// -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" -// An invalid argument was specified. +// API operation ListTestGridSessionActions for usage and error information. // -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" -// A limit was exceeded. +// * ArgumentException +// An invalid argument was specified. // -// * ErrCodeServiceAccountException "ServiceAccountException" -// There was a problem with the service account. +// * InternalServiceException +// An internal exception was raised in the service. Contact aws-devicefarm-support@amazon.com +// (mailto:aws-devicefarm-support@amazon.com) if you see this error. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListUniqueProblems -func (c *DeviceFarm) ListUniqueProblems(input *ListUniqueProblemsInput) (*ListUniqueProblemsOutput, error) { - req, out := c.ListUniqueProblemsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListTestGridSessionActions +func (c *DeviceFarm) ListTestGridSessionActions(input *ListTestGridSessionActionsInput) (*ListTestGridSessionActionsOutput, error) { + req, out := c.ListTestGridSessionActionsRequest(input) return out, req.Send() } -// ListUniqueProblemsWithContext is the same as ListUniqueProblems with the addition of +// ListTestGridSessionActionsWithContext is the same as ListTestGridSessionActions with the addition of // the ability to pass a context and additional request options. // -// See ListUniqueProblems for details on how to use this API operation. +// See ListTestGridSessionActions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) ListUniqueProblemsWithContext(ctx aws.Context, input *ListUniqueProblemsInput, opts ...request.Option) (*ListUniqueProblemsOutput, error) { - req, out := c.ListUniqueProblemsRequest(input) +func (c *DeviceFarm) ListTestGridSessionActionsWithContext(ctx aws.Context, input *ListTestGridSessionActionsInput, opts ...request.Option) (*ListTestGridSessionActionsOutput, error) { + req, out := c.ListTestGridSessionActionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListUniqueProblemsPages iterates over the pages of a ListUniqueProblems operation, +// ListTestGridSessionActionsPages iterates over the pages of a ListTestGridSessionActions operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See ListUniqueProblems method for more information on how to use this operation. +// See ListTestGridSessionActions 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 ListUniqueProblems operation. +// // Example iterating over at most 3 pages of a ListTestGridSessionActions operation. // pageNum := 0 -// err := client.ListUniqueProblemsPages(params, -// func(page *devicefarm.ListUniqueProblemsOutput, lastPage bool) bool { +// err := client.ListTestGridSessionActionsPages(params, +// func(page *devicefarm.ListTestGridSessionActionsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *DeviceFarm) ListUniqueProblemsPages(input *ListUniqueProblemsInput, fn func(*ListUniqueProblemsOutput, bool) bool) error { - return c.ListUniqueProblemsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *DeviceFarm) ListTestGridSessionActionsPages(input *ListTestGridSessionActionsInput, fn func(*ListTestGridSessionActionsOutput, bool) bool) error { + return c.ListTestGridSessionActionsPagesWithContext(aws.BackgroundContext(), input, fn) } -// ListUniqueProblemsPagesWithContext same as ListUniqueProblemsPages except +// ListTestGridSessionActionsPagesWithContext same as ListTestGridSessionActionsPages 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 *DeviceFarm) ListUniqueProblemsPagesWithContext(ctx aws.Context, input *ListUniqueProblemsInput, fn func(*ListUniqueProblemsOutput, bool) bool, opts ...request.Option) error { +func (c *DeviceFarm) ListTestGridSessionActionsPagesWithContext(ctx aws.Context, input *ListTestGridSessionActionsInput, fn func(*ListTestGridSessionActionsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *ListUniqueProblemsInput + var inCpy *ListTestGridSessionActionsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.ListUniqueProblemsRequest(inCpy) + req, _ := c.ListTestGridSessionActionsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListUniqueProblemsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTestGridSessionActionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opListUploads = "ListUploads" +const opListTestGridSessionArtifacts = "ListTestGridSessionArtifacts" -// ListUploadsRequest generates a "aws/request.Request" representing the -// client's request for the ListUploads operation. The "output" return +// ListTestGridSessionArtifactsRequest generates a "aws/request.Request" representing the +// client's request for the ListTestGridSessionArtifacts operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListUploads for more information on using the ListUploads +// See ListTestGridSessionArtifacts for more information on using the ListTestGridSessionArtifacts // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListUploadsRequest method. -// req, resp := client.ListUploadsRequest(params) +// // Example sending a request using the ListTestGridSessionArtifactsRequest method. +// req, resp := client.ListTestGridSessionArtifactsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListUploads -func (c *DeviceFarm) ListUploadsRequest(input *ListUploadsInput) (req *request.Request, output *ListUploadsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListTestGridSessionArtifacts +func (c *DeviceFarm) ListTestGridSessionArtifactsRequest(input *ListTestGridSessionArtifactsInput) (req *request.Request, output *ListTestGridSessionArtifactsOutput) { op := &request.Operation{ - Name: opListUploads, + Name: opListTestGridSessionArtifacts, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ InputTokens: []string{"nextToken"}, OutputTokens: []string{"nextToken"}, - LimitToken: "", + LimitToken: "maxResult", TruncationToken: "", }, } if input == nil { - input = &ListUploadsInput{} + input = &ListTestGridSessionArtifactsInput{} } - output = &ListUploadsOutput{} + output = &ListTestGridSessionArtifactsOutput{} req = c.newRequest(op, input, output) return } -// ListUploads API operation for AWS Device Farm. +// ListTestGridSessionArtifacts API operation for AWS Device Farm. // -// Gets information about uploads, given an AWS Device Farm project ARN. +// Retrieves a list of artifacts created during the session. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Device Farm's -// API operation ListUploads for usage and error information. -// -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" -// An invalid argument was specified. +// API operation ListTestGridSessionArtifacts for usage and error information. // -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" -// A limit was exceeded. +// * ArgumentException +// An invalid argument was specified. // -// * ErrCodeServiceAccountException "ServiceAccountException" -// There was a problem with the service account. +// * InternalServiceException +// An internal exception was raised in the service. Contact aws-devicefarm-support@amazon.com +// (mailto:aws-devicefarm-support@amazon.com) if you see this error. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListUploads -func (c *DeviceFarm) ListUploads(input *ListUploadsInput) (*ListUploadsOutput, error) { - req, out := c.ListUploadsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListTestGridSessionArtifacts +func (c *DeviceFarm) ListTestGridSessionArtifacts(input *ListTestGridSessionArtifactsInput) (*ListTestGridSessionArtifactsOutput, error) { + req, out := c.ListTestGridSessionArtifactsRequest(input) return out, req.Send() } -// ListUploadsWithContext is the same as ListUploads with the addition of +// ListTestGridSessionArtifactsWithContext is the same as ListTestGridSessionArtifacts with the addition of // the ability to pass a context and additional request options. // -// See ListUploads for details on how to use this API operation. +// See ListTestGridSessionArtifacts for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) ListUploadsWithContext(ctx aws.Context, input *ListUploadsInput, opts ...request.Option) (*ListUploadsOutput, error) { - req, out := c.ListUploadsRequest(input) +func (c *DeviceFarm) ListTestGridSessionArtifactsWithContext(ctx aws.Context, input *ListTestGridSessionArtifactsInput, opts ...request.Option) (*ListTestGridSessionArtifactsOutput, error) { + req, out := c.ListTestGridSessionArtifactsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListUploadsPages iterates over the pages of a ListUploads operation, +// ListTestGridSessionArtifactsPages iterates over the pages of a ListTestGridSessionArtifacts operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See ListUploads method for more information on how to use this operation. +// See ListTestGridSessionArtifacts 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 ListUploads operation. +// // Example iterating over at most 3 pages of a ListTestGridSessionArtifacts operation. // pageNum := 0 -// err := client.ListUploadsPages(params, -// func(page *devicefarm.ListUploadsOutput, lastPage bool) bool { +// err := client.ListTestGridSessionArtifactsPages(params, +// func(page *devicefarm.ListTestGridSessionArtifactsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *DeviceFarm) ListUploadsPages(input *ListUploadsInput, fn func(*ListUploadsOutput, bool) bool) error { - return c.ListUploadsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *DeviceFarm) ListTestGridSessionArtifactsPages(input *ListTestGridSessionArtifactsInput, fn func(*ListTestGridSessionArtifactsOutput, bool) bool) error { + return c.ListTestGridSessionArtifactsPagesWithContext(aws.BackgroundContext(), input, fn) } -// ListUploadsPagesWithContext same as ListUploadsPages except +// ListTestGridSessionArtifactsPagesWithContext same as ListTestGridSessionArtifactsPages 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 *DeviceFarm) ListUploadsPagesWithContext(ctx aws.Context, input *ListUploadsInput, fn func(*ListUploadsOutput, bool) bool, opts ...request.Option) error { +func (c *DeviceFarm) ListTestGridSessionArtifactsPagesWithContext(ctx aws.Context, input *ListTestGridSessionArtifactsInput, fn func(*ListTestGridSessionArtifactsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *ListUploadsInput + var inCpy *ListTestGridSessionArtifactsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.ListUploadsRequest(inCpy) + req, _ := c.ListTestGridSessionArtifactsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListUploadsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTestGridSessionArtifactsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opListVPCEConfigurations = "ListVPCEConfigurations" +const opListTestGridSessions = "ListTestGridSessions" -// ListVPCEConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the ListVPCEConfigurations operation. The "output" return +// ListTestGridSessionsRequest generates a "aws/request.Request" representing the +// client's request for the ListTestGridSessions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListVPCEConfigurations for more information on using the ListVPCEConfigurations +// See ListTestGridSessions for more information on using the ListTestGridSessions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListVPCEConfigurationsRequest method. -// req, resp := client.ListVPCEConfigurationsRequest(params) +// // Example sending a request using the ListTestGridSessionsRequest method. +// req, resp := client.ListTestGridSessionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListVPCEConfigurations -func (c *DeviceFarm) ListVPCEConfigurationsRequest(input *ListVPCEConfigurationsInput) (req *request.Request, output *ListVPCEConfigurationsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListTestGridSessions +func (c *DeviceFarm) ListTestGridSessionsRequest(input *ListTestGridSessionsInput) (req *request.Request, output *ListTestGridSessionsOutput) { op := &request.Operation{ - Name: opListVPCEConfigurations, + Name: opListTestGridSessions, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResult", + TruncationToken: "", + }, } if input == nil { - input = &ListVPCEConfigurationsInput{} + input = &ListTestGridSessionsInput{} } - output = &ListVPCEConfigurationsOutput{} + output = &ListTestGridSessionsOutput{} req = c.newRequest(op, input, output) return } -// ListVPCEConfigurations API operation for AWS Device Farm. +// ListTestGridSessions API operation for AWS Device Farm. // -// Returns information about all Amazon Virtual Private Cloud (VPC) endpoint -// configurations in the AWS account. +// Retrieves a list of sessions for a TestGridProject. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Device Farm's -// API operation ListVPCEConfigurations for usage and error information. +// API operation ListTestGridSessions for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// The specified entity was not found. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeServiceAccountException "ServiceAccountException" -// There was a problem with the service account. +// * InternalServiceException +// An internal exception was raised in the service. Contact aws-devicefarm-support@amazon.com +// (mailto:aws-devicefarm-support@amazon.com) if you see this error. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListVPCEConfigurations -func (c *DeviceFarm) ListVPCEConfigurations(input *ListVPCEConfigurationsInput) (*ListVPCEConfigurationsOutput, error) { - req, out := c.ListVPCEConfigurationsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListTestGridSessions +func (c *DeviceFarm) ListTestGridSessions(input *ListTestGridSessionsInput) (*ListTestGridSessionsOutput, error) { + req, out := c.ListTestGridSessionsRequest(input) return out, req.Send() } -// ListVPCEConfigurationsWithContext is the same as ListVPCEConfigurations with the addition of +// ListTestGridSessionsWithContext is the same as ListTestGridSessions with the addition of // the ability to pass a context and additional request options. // -// See ListVPCEConfigurations for details on how to use this API operation. +// See ListTestGridSessions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) ListVPCEConfigurationsWithContext(ctx aws.Context, input *ListVPCEConfigurationsInput, opts ...request.Option) (*ListVPCEConfigurationsOutput, error) { - req, out := c.ListVPCEConfigurationsRequest(input) +func (c *DeviceFarm) ListTestGridSessionsWithContext(ctx aws.Context, input *ListTestGridSessionsInput, opts ...request.Option) (*ListTestGridSessionsOutput, error) { + req, out := c.ListTestGridSessionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPurchaseOffering = "PurchaseOffering" +// ListTestGridSessionsPages iterates over the pages of a ListTestGridSessions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTestGridSessions 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 ListTestGridSessions operation. +// pageNum := 0 +// err := client.ListTestGridSessionsPages(params, +// func(page *devicefarm.ListTestGridSessionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *DeviceFarm) ListTestGridSessionsPages(input *ListTestGridSessionsInput, fn func(*ListTestGridSessionsOutput, bool) bool) error { + return c.ListTestGridSessionsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// PurchaseOfferingRequest generates a "aws/request.Request" representing the -// client's request for the PurchaseOffering operation. The "output" return +// ListTestGridSessionsPagesWithContext same as ListTestGridSessionsPages 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 *DeviceFarm) ListTestGridSessionsPagesWithContext(ctx aws.Context, input *ListTestGridSessionsInput, fn func(*ListTestGridSessionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTestGridSessionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTestGridSessionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTestGridSessionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTests = "ListTests" + +// ListTestsRequest generates a "aws/request.Request" representing the +// client's request for the ListTests operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PurchaseOffering for more information on using the PurchaseOffering +// See ListTests for more information on using the ListTests // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PurchaseOfferingRequest method. -// req, resp := client.PurchaseOfferingRequest(params) +// // Example sending a request using the ListTestsRequest method. +// req, resp := client.ListTestsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/PurchaseOffering -func (c *DeviceFarm) PurchaseOfferingRequest(input *PurchaseOfferingInput) (req *request.Request, output *PurchaseOfferingOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListTests +func (c *DeviceFarm) ListTestsRequest(input *ListTestsInput) (req *request.Request, output *ListTestsOutput) { op := &request.Operation{ - Name: opPurchaseOffering, + Name: opListTests, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "", + TruncationToken: "", + }, } if input == nil { - input = &PurchaseOfferingInput{} + input = &ListTestsInput{} } - output = &PurchaseOfferingOutput{} + output = &ListTestsOutput{} req = c.newRequest(op, input, output) return } -// PurchaseOffering API operation for AWS Device Farm. +// ListTests API operation for AWS Device Farm. // -// Immediately purchases offerings for an AWS account. Offerings renew with -// the latest total purchased quantity for an offering, unless the renewal was -// overridden. The API returns a NotEligible error if the user is not permitted -// to invoke the operation. Please contact aws-devicefarm-support@amazon.com -// (mailto:aws-devicefarm-support@amazon.com) if you believe that you should -// be able to invoke this operation. +// Gets information about tests in a given test suite. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Device Farm's -// API operation PurchaseOffering for usage and error information. +// API operation ListTests for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeNotEligibleException "NotEligibleException" -// Exception gets thrown when a user is not eligible to perform the specified -// transaction. -// -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/PurchaseOffering -func (c *DeviceFarm) PurchaseOffering(input *PurchaseOfferingInput) (*PurchaseOfferingOutput, error) { - req, out := c.PurchaseOfferingRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListTests +func (c *DeviceFarm) ListTests(input *ListTestsInput) (*ListTestsOutput, error) { + req, out := c.ListTestsRequest(input) return out, req.Send() } -// PurchaseOfferingWithContext is the same as PurchaseOffering with the addition of +// ListTestsWithContext is the same as ListTests with the addition of // the ability to pass a context and additional request options. // -// See PurchaseOffering for details on how to use this API operation. +// See ListTests for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) PurchaseOfferingWithContext(ctx aws.Context, input *PurchaseOfferingInput, opts ...request.Option) (*PurchaseOfferingOutput, error) { - req, out := c.PurchaseOfferingRequest(input) +func (c *DeviceFarm) ListTestsWithContext(ctx aws.Context, input *ListTestsInput, opts ...request.Option) (*ListTestsOutput, error) { + req, out := c.ListTestsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRenewOffering = "RenewOffering" +// ListTestsPages iterates over the pages of a ListTests operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTests 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 ListTests operation. +// pageNum := 0 +// err := client.ListTestsPages(params, +// func(page *devicefarm.ListTestsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *DeviceFarm) ListTestsPages(input *ListTestsInput, fn func(*ListTestsOutput, bool) bool) error { + return c.ListTestsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// RenewOfferingRequest generates a "aws/request.Request" representing the -// client's request for the RenewOffering operation. The "output" return +// ListTestsPagesWithContext same as ListTestsPages 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 *DeviceFarm) ListTestsPagesWithContext(ctx aws.Context, input *ListTestsInput, fn func(*ListTestsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTestsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTestsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTestsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListUniqueProblems = "ListUniqueProblems" + +// ListUniqueProblemsRequest generates a "aws/request.Request" representing the +// client's request for the ListUniqueProblems operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RenewOffering for more information on using the RenewOffering +// See ListUniqueProblems for more information on using the ListUniqueProblems // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RenewOfferingRequest method. -// req, resp := client.RenewOfferingRequest(params) +// // Example sending a request using the ListUniqueProblemsRequest method. +// req, resp := client.ListUniqueProblemsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/RenewOffering -func (c *DeviceFarm) RenewOfferingRequest(input *RenewOfferingInput) (req *request.Request, output *RenewOfferingOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListUniqueProblems +func (c *DeviceFarm) ListUniqueProblemsRequest(input *ListUniqueProblemsInput) (req *request.Request, output *ListUniqueProblemsOutput) { op := &request.Operation{ - Name: opRenewOffering, + Name: opListUniqueProblems, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "", + TruncationToken: "", + }, } if input == nil { - input = &RenewOfferingInput{} + input = &ListUniqueProblemsInput{} } - output = &RenewOfferingOutput{} + output = &ListUniqueProblemsOutput{} req = c.newRequest(op, input, output) return } -// RenewOffering API operation for AWS Device Farm. +// ListUniqueProblems API operation for AWS Device Farm. // -// Explicitly sets the quantity of devices to renew for an offering, starting -// from the effectiveDate of the next period. The API returns a NotEligible -// error if the user is not permitted to invoke the operation. Please contact -// aws-devicefarm-support@amazon.com (mailto:aws-devicefarm-support@amazon.com) -// if you believe that you should be able to invoke this operation. +// Gets information about unique problems, such as exceptions or crashes. +// +// Unique problems are defined as a single instance of an error across a run, +// job, or suite. For example, if a call in your application consistently raises +// an exception (OutOfBoundsException in MyActivity.java:386), ListUniqueProblems +// returns a single entry instead of many individual entries for that 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 AWS Device Farm's -// API operation RenewOffering for usage and error information. +// API operation ListUniqueProblems for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeNotEligibleException "NotEligibleException" -// Exception gets thrown when a user is not eligible to perform the specified -// transaction. -// -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/RenewOffering -func (c *DeviceFarm) RenewOffering(input *RenewOfferingInput) (*RenewOfferingOutput, error) { - req, out := c.RenewOfferingRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListUniqueProblems +func (c *DeviceFarm) ListUniqueProblems(input *ListUniqueProblemsInput) (*ListUniqueProblemsOutput, error) { + req, out := c.ListUniqueProblemsRequest(input) return out, req.Send() } -// RenewOfferingWithContext is the same as RenewOffering with the addition of +// ListUniqueProblemsWithContext is the same as ListUniqueProblems with the addition of // the ability to pass a context and additional request options. // -// See RenewOffering for details on how to use this API operation. +// See ListUniqueProblems for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) RenewOfferingWithContext(ctx aws.Context, input *RenewOfferingInput, opts ...request.Option) (*RenewOfferingOutput, error) { - req, out := c.RenewOfferingRequest(input) +func (c *DeviceFarm) ListUniqueProblemsWithContext(ctx aws.Context, input *ListUniqueProblemsInput, opts ...request.Option) (*ListUniqueProblemsOutput, error) { + req, out := c.ListUniqueProblemsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opScheduleRun = "ScheduleRun" +// ListUniqueProblemsPages iterates over the pages of a ListUniqueProblems operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListUniqueProblems 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 ListUniqueProblems operation. +// pageNum := 0 +// err := client.ListUniqueProblemsPages(params, +// func(page *devicefarm.ListUniqueProblemsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *DeviceFarm) ListUniqueProblemsPages(input *ListUniqueProblemsInput, fn func(*ListUniqueProblemsOutput, bool) bool) error { + return c.ListUniqueProblemsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// ScheduleRunRequest generates a "aws/request.Request" representing the -// client's request for the ScheduleRun operation. The "output" return +// ListUniqueProblemsPagesWithContext same as ListUniqueProblemsPages 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 *DeviceFarm) ListUniqueProblemsPagesWithContext(ctx aws.Context, input *ListUniqueProblemsInput, fn func(*ListUniqueProblemsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListUniqueProblemsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListUniqueProblemsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListUniqueProblemsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListUploads = "ListUploads" + +// ListUploadsRequest generates a "aws/request.Request" representing the +// client's request for the ListUploads operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ScheduleRun for more information on using the ScheduleRun +// See ListUploads for more information on using the ListUploads // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ScheduleRunRequest method. -// req, resp := client.ScheduleRunRequest(params) +// // Example sending a request using the ListUploadsRequest method. +// req, resp := client.ListUploadsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ScheduleRun -func (c *DeviceFarm) ScheduleRunRequest(input *ScheduleRunInput) (req *request.Request, output *ScheduleRunOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListUploads +func (c *DeviceFarm) ListUploadsRequest(input *ListUploadsInput) (req *request.Request, output *ListUploadsOutput) { op := &request.Operation{ - Name: opScheduleRun, + Name: opListUploads, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "", + TruncationToken: "", + }, } if input == nil { - input = &ScheduleRunInput{} + input = &ListUploadsInput{} } - output = &ScheduleRunOutput{} + output = &ListUploadsOutput{} req = c.newRequest(op, input, output) return } -// ScheduleRun API operation for AWS Device Farm. +// ListUploads API operation for AWS Device Farm. // -// Schedules a run. +// Gets information about uploads, given an AWS Device Farm project 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 AWS Device Farm's -// API operation ScheduleRun for usage and error information. +// API operation ListUploads for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeIdempotencyException "IdempotencyException" -// An entity with the same name already exists. -// -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ScheduleRun -func (c *DeviceFarm) ScheduleRun(input *ScheduleRunInput) (*ScheduleRunOutput, error) { - req, out := c.ScheduleRunRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListUploads +func (c *DeviceFarm) ListUploads(input *ListUploadsInput) (*ListUploadsOutput, error) { + req, out := c.ListUploadsRequest(input) return out, req.Send() } -// ScheduleRunWithContext is the same as ScheduleRun with the addition of +// ListUploadsWithContext is the same as ListUploads with the addition of // the ability to pass a context and additional request options. // -// See ScheduleRun for details on how to use this API operation. +// See ListUploads for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) ScheduleRunWithContext(ctx aws.Context, input *ScheduleRunInput, opts ...request.Option) (*ScheduleRunOutput, error) { - req, out := c.ScheduleRunRequest(input) +func (c *DeviceFarm) ListUploadsWithContext(ctx aws.Context, input *ListUploadsInput, opts ...request.Option) (*ListUploadsOutput, error) { + req, out := c.ListUploadsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopJob = "StopJob" +// ListUploadsPages iterates over the pages of a ListUploads operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListUploads 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 ListUploads operation. +// pageNum := 0 +// err := client.ListUploadsPages(params, +// func(page *devicefarm.ListUploadsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *DeviceFarm) ListUploadsPages(input *ListUploadsInput, fn func(*ListUploadsOutput, bool) bool) error { + return c.ListUploadsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// StopJobRequest generates a "aws/request.Request" representing the -// client's request for the StopJob operation. The "output" return +// ListUploadsPagesWithContext same as ListUploadsPages 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 *DeviceFarm) ListUploadsPagesWithContext(ctx aws.Context, input *ListUploadsInput, fn func(*ListUploadsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListUploadsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListUploadsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListUploadsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListVPCEConfigurations = "ListVPCEConfigurations" + +// ListVPCEConfigurationsRequest generates a "aws/request.Request" representing the +// client's request for the ListVPCEConfigurations operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopJob for more information on using the StopJob +// See ListVPCEConfigurations for more information on using the ListVPCEConfigurations // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopJobRequest method. -// req, resp := client.StopJobRequest(params) +// // Example sending a request using the ListVPCEConfigurationsRequest method. +// req, resp := client.ListVPCEConfigurationsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/StopJob -func (c *DeviceFarm) StopJobRequest(input *StopJobInput) (req *request.Request, output *StopJobOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListVPCEConfigurations +func (c *DeviceFarm) ListVPCEConfigurationsRequest(input *ListVPCEConfigurationsInput) (req *request.Request, output *ListVPCEConfigurationsOutput) { op := &request.Operation{ - Name: opStopJob, + Name: opListVPCEConfigurations, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StopJobInput{} + input = &ListVPCEConfigurationsInput{} } - output = &StopJobOutput{} + output = &ListVPCEConfigurationsOutput{} req = c.newRequest(op, input, output) return } -// StopJob API operation for AWS Device Farm. +// ListVPCEConfigurations API operation for AWS Device Farm. // -// Initiates a stop request for the current job. AWS Device Farm will immediately -// stop the job on the device where tests have not started executing, and you -// will not be billed for this device. On the device where tests have started -// executing, Setup Suite and Teardown Suite tests will run to completion before -// stopping execution on the device. You will be billed for Setup, Teardown, -// and any tests that were in progress or already completed. +// Returns information about all Amazon Virtual Private Cloud (VPC) endpoint +// configurations 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 Device Farm's -// API operation StopJob for usage and error information. +// API operation ListVPCEConfigurations for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" -// The specified entity was not found. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// A limit was exceeded. -// -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/StopJob -func (c *DeviceFarm) StopJob(input *StopJobInput) (*StopJobOutput, error) { - req, out := c.StopJobRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ListVPCEConfigurations +func (c *DeviceFarm) ListVPCEConfigurations(input *ListVPCEConfigurationsInput) (*ListVPCEConfigurationsOutput, error) { + req, out := c.ListVPCEConfigurationsRequest(input) return out, req.Send() } -// StopJobWithContext is the same as StopJob with the addition of +// ListVPCEConfigurationsWithContext is the same as ListVPCEConfigurations with the addition of // the ability to pass a context and additional request options. // -// See StopJob for details on how to use this API operation. +// See ListVPCEConfigurations for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) StopJobWithContext(ctx aws.Context, input *StopJobInput, opts ...request.Option) (*StopJobOutput, error) { - req, out := c.StopJobRequest(input) +func (c *DeviceFarm) ListVPCEConfigurationsWithContext(ctx aws.Context, input *ListVPCEConfigurationsInput, opts ...request.Option) (*ListVPCEConfigurationsOutput, error) { + req, out := c.ListVPCEConfigurationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopRemoteAccessSession = "StopRemoteAccessSession" +const opPurchaseOffering = "PurchaseOffering" -// StopRemoteAccessSessionRequest generates a "aws/request.Request" representing the -// client's request for the StopRemoteAccessSession operation. The "output" return +// PurchaseOfferingRequest generates a "aws/request.Request" representing the +// client's request for the PurchaseOffering operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopRemoteAccessSession for more information on using the StopRemoteAccessSession +// See PurchaseOffering for more information on using the PurchaseOffering // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopRemoteAccessSessionRequest method. -// req, resp := client.StopRemoteAccessSessionRequest(params) +// // Example sending a request using the PurchaseOfferingRequest method. +// req, resp := client.PurchaseOfferingRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/StopRemoteAccessSession -func (c *DeviceFarm) StopRemoteAccessSessionRequest(input *StopRemoteAccessSessionInput) (req *request.Request, output *StopRemoteAccessSessionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/PurchaseOffering +func (c *DeviceFarm) PurchaseOfferingRequest(input *PurchaseOfferingInput) (req *request.Request, output *PurchaseOfferingOutput) { op := &request.Operation{ - Name: opStopRemoteAccessSession, + Name: opPurchaseOffering, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StopRemoteAccessSessionInput{} + input = &PurchaseOfferingInput{} } - output = &StopRemoteAccessSessionOutput{} + output = &PurchaseOfferingOutput{} req = c.newRequest(op, input, output) return } -// StopRemoteAccessSession API operation for AWS Device Farm. +// PurchaseOffering API operation for AWS Device Farm. // -// Ends a specified remote access session. +// Immediately purchases offerings for an AWS account. Offerings renew with +// the latest total purchased quantity for an offering, unless the renewal was +// overridden. The API returns a NotEligible error if the user is not permitted +// to invoke the operation. If you must be able to invoke this operation, contact +// aws-devicefarm-support@amazon.com (mailto:aws-devicefarm-support@amazon.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 AWS Device Farm's -// API operation StopRemoteAccessSession for usage and error information. +// API operation PurchaseOffering for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * NotEligibleException +// Exception gets thrown when a user is not eligible to perform the specified +// transaction. +// +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/StopRemoteAccessSession -func (c *DeviceFarm) StopRemoteAccessSession(input *StopRemoteAccessSessionInput) (*StopRemoteAccessSessionOutput, error) { - req, out := c.StopRemoteAccessSessionRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/PurchaseOffering +func (c *DeviceFarm) PurchaseOffering(input *PurchaseOfferingInput) (*PurchaseOfferingOutput, error) { + req, out := c.PurchaseOfferingRequest(input) return out, req.Send() } -// StopRemoteAccessSessionWithContext is the same as StopRemoteAccessSession with the addition of +// PurchaseOfferingWithContext is the same as PurchaseOffering with the addition of // the ability to pass a context and additional request options. // -// See StopRemoteAccessSession for details on how to use this API operation. +// See PurchaseOffering for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) StopRemoteAccessSessionWithContext(ctx aws.Context, input *StopRemoteAccessSessionInput, opts ...request.Option) (*StopRemoteAccessSessionOutput, error) { - req, out := c.StopRemoteAccessSessionRequest(input) +func (c *DeviceFarm) PurchaseOfferingWithContext(ctx aws.Context, input *PurchaseOfferingInput, opts ...request.Option) (*PurchaseOfferingOutput, error) { + req, out := c.PurchaseOfferingRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopRun = "StopRun" +const opRenewOffering = "RenewOffering" -// StopRunRequest generates a "aws/request.Request" representing the -// client's request for the StopRun operation. The "output" return +// RenewOfferingRequest generates a "aws/request.Request" representing the +// client's request for the RenewOffering operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopRun for more information on using the StopRun +// See RenewOffering for more information on using the RenewOffering // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopRunRequest method. -// req, resp := client.StopRunRequest(params) +// // Example sending a request using the RenewOfferingRequest method. +// req, resp := client.RenewOfferingRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/StopRun -func (c *DeviceFarm) StopRunRequest(input *StopRunInput) (req *request.Request, output *StopRunOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/RenewOffering +func (c *DeviceFarm) RenewOfferingRequest(input *RenewOfferingInput) (req *request.Request, output *RenewOfferingOutput) { op := &request.Operation{ - Name: opStopRun, + Name: opRenewOffering, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StopRunInput{} + input = &RenewOfferingInput{} } - output = &StopRunOutput{} + output = &RenewOfferingOutput{} req = c.newRequest(op, input, output) return } -// StopRun API operation for AWS Device Farm. +// RenewOffering API operation for AWS Device Farm. // -// Initiates a stop request for the current test run. AWS Device Farm will immediately -// stop the run on devices where tests have not started executing, and you will -// not be billed for these devices. On devices where tests have started executing, -// Setup Suite and Teardown Suite tests will run to completion before stopping -// execution on those devices. You will be billed for Setup, Teardown, and any -// tests that were in progress or already completed. +// Explicitly sets the quantity of devices to renew for an offering, starting +// from the effectiveDate of the next period. The API returns a NotEligible +// error if the user is not permitted to invoke the operation. If you must be +// able to invoke this operation, contact aws-devicefarm-support@amazon.com +// (mailto:aws-devicefarm-support@amazon.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 AWS Device Farm's -// API operation StopRun for usage and error information. +// API operation RenewOffering for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * NotEligibleException +// Exception gets thrown when a user is not eligible to perform the specified +// transaction. +// +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/StopRun -func (c *DeviceFarm) StopRun(input *StopRunInput) (*StopRunOutput, error) { - req, out := c.StopRunRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/RenewOffering +func (c *DeviceFarm) RenewOffering(input *RenewOfferingInput) (*RenewOfferingOutput, error) { + req, out := c.RenewOfferingRequest(input) return out, req.Send() } -// StopRunWithContext is the same as StopRun with the addition of +// RenewOfferingWithContext is the same as RenewOffering with the addition of // the ability to pass a context and additional request options. // -// See StopRun for details on how to use this API operation. +// See RenewOffering for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) StopRunWithContext(ctx aws.Context, input *StopRunInput, opts ...request.Option) (*StopRunOutput, error) { - req, out := c.StopRunRequest(input) +func (c *DeviceFarm) RenewOfferingWithContext(ctx aws.Context, input *RenewOfferingInput, opts ...request.Option) (*RenewOfferingOutput, error) { + req, out := c.RenewOfferingRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opTagResource = "TagResource" +const opScheduleRun = "ScheduleRun" -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource operation. The "output" return +// ScheduleRunRequest generates a "aws/request.Request" representing the +// client's request for the ScheduleRun operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See TagResource for more information on using the TagResource +// See ScheduleRun for more information on using the ScheduleRun // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) +// // Example sending a request using the ScheduleRunRequest method. +// req, resp := client.ScheduleRunRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/TagResource -func (c *DeviceFarm) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ScheduleRun +func (c *DeviceFarm) ScheduleRunRequest(input *ScheduleRunInput) (req *request.Request, output *ScheduleRunOutput) { op := &request.Operation{ - Name: opTagResource, + Name: opScheduleRun, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &TagResourceInput{} + input = &ScheduleRunInput{} } - output = &TagResourceOutput{} + output = &ScheduleRunOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// TagResource API operation for AWS Device Farm. +// ScheduleRun API operation for AWS Device Farm. // -// Associates the specified tags to a resource with the specified resourceArn. -// If existing tags on a resource are not specified in the request parameters, -// they are not changed. When a resource is deleted, the tags associated with -// that resource are deleted as well. +// Schedules a 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 AWS Device Farm's -// API operation TagResource for usage and error information. +// API operation ScheduleRun for usage and error information. +// +// Returned Error Types: +// * ArgumentException +// An invalid argument was specified. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeTagOperationException "TagOperationException" -// The operation was not successful. Try again. +// * LimitExceededException +// A limit was exceeded. // -// * ErrCodeTooManyTagsException "TooManyTagsException" -// The list of tags on the repository is over the limit. The maximum number -// of tags that can be applied to a repository is 50. +// * IdempotencyException +// An entity with the same name already exists. // -// * ErrCodeTagPolicyException "TagPolicyException" -// The request doesn't comply with the AWS Identity and Access Management (IAM) -// tag policy. Correct your request and then retry it. +// * ServiceAccountException +// There was a problem with the service account. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/TagResource -func (c *DeviceFarm) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/ScheduleRun +func (c *DeviceFarm) ScheduleRun(input *ScheduleRunInput) (*ScheduleRunOutput, error) { + req, out := c.ScheduleRunRequest(input) return out, req.Send() } -// TagResourceWithContext is the same as TagResource with the addition of +// ScheduleRunWithContext is the same as ScheduleRun with the addition of // the ability to pass a context and additional request options. // -// See TagResource for details on how to use this API operation. +// See ScheduleRun for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) +func (c *DeviceFarm) ScheduleRunWithContext(ctx aws.Context, input *ScheduleRunInput, opts ...request.Option) (*ScheduleRunOutput, error) { + req, out := c.ScheduleRunRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUntagResource = "UntagResource" +const opStopJob = "StopJob" -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource operation. The "output" return +// StopJobRequest generates a "aws/request.Request" representing the +// client's request for the StopJob operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UntagResource for more information on using the UntagResource +// See StopJob for more information on using the StopJob // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) +// // Example sending a request using the StopJobRequest method. +// req, resp := client.StopJobRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UntagResource -func (c *DeviceFarm) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/StopJob +func (c *DeviceFarm) StopJobRequest(input *StopJobInput) (req *request.Request, output *StopJobOutput) { op := &request.Operation{ - Name: opUntagResource, + Name: opStopJob, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UntagResourceInput{} + input = &StopJobInput{} } - output = &UntagResourceOutput{} + output = &StopJobOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UntagResource API operation for AWS Device Farm. +// StopJob API operation for AWS Device Farm. // -// Deletes the specified tags from a resource. +// Initiates a stop request for the current job. AWS Device Farm immediately +// stops the job on the device where tests have not started. You are not billed +// for this device. On the device where tests have started, setup suite and +// teardown suite tests run to completion on the device. You are billed for +// setup, teardown, and any tests that were in progress or already 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 Device Farm's -// API operation UntagResource for usage and error information. +// API operation StopJob for usage and error information. +// +// Returned Error Types: +// * ArgumentException +// An invalid argument was specified. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeTagOperationException "TagOperationException" -// The operation was not successful. Try again. +// * LimitExceededException +// A limit was exceeded. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UntagResource -func (c *DeviceFarm) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) +// * ServiceAccountException +// There was a problem with the service account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/StopJob +func (c *DeviceFarm) StopJob(input *StopJobInput) (*StopJobOutput, error) { + req, out := c.StopJobRequest(input) return out, req.Send() } -// UntagResourceWithContext is the same as UntagResource with the addition of +// StopJobWithContext is the same as StopJob with the addition of // the ability to pass a context and additional request options. // -// See UntagResource for details on how to use this API operation. +// See StopJob for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) +func (c *DeviceFarm) StopJobWithContext(ctx aws.Context, input *StopJobInput, opts ...request.Option) (*StopJobOutput, error) { + req, out := c.StopJobRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateDeviceInstance = "UpdateDeviceInstance" +const opStopRemoteAccessSession = "StopRemoteAccessSession" -// UpdateDeviceInstanceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDeviceInstance operation. The "output" return +// StopRemoteAccessSessionRequest generates a "aws/request.Request" representing the +// client's request for the StopRemoteAccessSession operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateDeviceInstance for more information on using the UpdateDeviceInstance +// See StopRemoteAccessSession for more information on using the StopRemoteAccessSession // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateDeviceInstanceRequest method. -// req, resp := client.UpdateDeviceInstanceRequest(params) +// // Example sending a request using the StopRemoteAccessSessionRequest method. +// req, resp := client.StopRemoteAccessSessionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateDeviceInstance -func (c *DeviceFarm) UpdateDeviceInstanceRequest(input *UpdateDeviceInstanceInput) (req *request.Request, output *UpdateDeviceInstanceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/StopRemoteAccessSession +func (c *DeviceFarm) StopRemoteAccessSessionRequest(input *StopRemoteAccessSessionInput) (req *request.Request, output *StopRemoteAccessSessionOutput) { op := &request.Operation{ - Name: opUpdateDeviceInstance, + Name: opStopRemoteAccessSession, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateDeviceInstanceInput{} + input = &StopRemoteAccessSessionInput{} } - output = &UpdateDeviceInstanceOutput{} + output = &StopRemoteAccessSessionOutput{} req = c.newRequest(op, input, output) return } -// UpdateDeviceInstance API operation for AWS Device Farm. +// StopRemoteAccessSession API operation for AWS Device Farm. // -// Updates information about an existing private device instance. +// Ends a specified remote access session. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Device Farm's -// API operation UpdateDeviceInstance for usage and error information. +// API operation StopRemoteAccessSession for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateDeviceInstance -func (c *DeviceFarm) UpdateDeviceInstance(input *UpdateDeviceInstanceInput) (*UpdateDeviceInstanceOutput, error) { - req, out := c.UpdateDeviceInstanceRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/StopRemoteAccessSession +func (c *DeviceFarm) StopRemoteAccessSession(input *StopRemoteAccessSessionInput) (*StopRemoteAccessSessionOutput, error) { + req, out := c.StopRemoteAccessSessionRequest(input) return out, req.Send() } -// UpdateDeviceInstanceWithContext is the same as UpdateDeviceInstance with the addition of +// StopRemoteAccessSessionWithContext is the same as StopRemoteAccessSession with the addition of // the ability to pass a context and additional request options. // -// See UpdateDeviceInstance for details on how to use this API operation. +// See StopRemoteAccessSession for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) UpdateDeviceInstanceWithContext(ctx aws.Context, input *UpdateDeviceInstanceInput, opts ...request.Option) (*UpdateDeviceInstanceOutput, error) { - req, out := c.UpdateDeviceInstanceRequest(input) +func (c *DeviceFarm) StopRemoteAccessSessionWithContext(ctx aws.Context, input *StopRemoteAccessSessionInput, opts ...request.Option) (*StopRemoteAccessSessionOutput, error) { + req, out := c.StopRemoteAccessSessionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateDevicePool = "UpdateDevicePool" +const opStopRun = "StopRun" -// UpdateDevicePoolRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDevicePool operation. The "output" return +// StopRunRequest generates a "aws/request.Request" representing the +// client's request for the StopRun operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateDevicePool for more information on using the UpdateDevicePool +// See StopRun for more information on using the StopRun // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateDevicePoolRequest method. -// req, resp := client.UpdateDevicePoolRequest(params) +// // Example sending a request using the StopRunRequest method. +// req, resp := client.StopRunRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateDevicePool -func (c *DeviceFarm) UpdateDevicePoolRequest(input *UpdateDevicePoolInput) (req *request.Request, output *UpdateDevicePoolOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/StopRun +func (c *DeviceFarm) StopRunRequest(input *StopRunInput) (req *request.Request, output *StopRunOutput) { op := &request.Operation{ - Name: opUpdateDevicePool, + Name: opStopRun, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateDevicePoolInput{} + input = &StopRunInput{} } - output = &UpdateDevicePoolOutput{} + output = &StopRunOutput{} req = c.newRequest(op, input, output) return } -// UpdateDevicePool API operation for AWS Device Farm. +// StopRun API operation for AWS Device Farm. // -// Modifies the name, description, and rules in a device pool given the attributes -// and the pool ARN. Rule updates are all-or-nothing, meaning they can only -// be updated as a whole (or not at all). +// Initiates a stop request for the current test run. AWS Device Farm immediately +// stops the run on devices where tests have not started. You are not billed +// for these devices. On devices where tests have started executing, setup suite +// and teardown suite tests run to completion on those devices. You are billed +// for setup, teardown, and any tests that were in progress or already 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 Device Farm's -// API operation UpdateDevicePool for usage and error information. +// API operation StopRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateDevicePool -func (c *DeviceFarm) UpdateDevicePool(input *UpdateDevicePoolInput) (*UpdateDevicePoolOutput, error) { - req, out := c.UpdateDevicePoolRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/StopRun +func (c *DeviceFarm) StopRun(input *StopRunInput) (*StopRunOutput, error) { + req, out := c.StopRunRequest(input) return out, req.Send() } -// UpdateDevicePoolWithContext is the same as UpdateDevicePool with the addition of +// StopRunWithContext is the same as StopRun with the addition of // the ability to pass a context and additional request options. // -// See UpdateDevicePool for details on how to use this API operation. +// See StopRun for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) UpdateDevicePoolWithContext(ctx aws.Context, input *UpdateDevicePoolInput, opts ...request.Option) (*UpdateDevicePoolOutput, error) { - req, out := c.UpdateDevicePoolRequest(input) +func (c *DeviceFarm) StopRunWithContext(ctx aws.Context, input *StopRunInput, opts ...request.Option) (*StopRunOutput, error) { + req, out := c.StopRunRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateInstanceProfile = "UpdateInstanceProfile" +const opTagResource = "TagResource" -// UpdateInstanceProfileRequest generates a "aws/request.Request" representing the -// client's request for the UpdateInstanceProfile operation. The "output" return +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateInstanceProfile for more information on using the UpdateInstanceProfile +// See TagResource for more information on using the TagResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateInstanceProfileRequest method. -// req, resp := client.UpdateInstanceProfileRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateInstanceProfile -func (c *DeviceFarm) UpdateInstanceProfileRequest(input *UpdateInstanceProfileInput) (req *request.Request, output *UpdateInstanceProfileOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/TagResource +func (c *DeviceFarm) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { op := &request.Operation{ - Name: opUpdateInstanceProfile, + Name: opTagResource, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateInstanceProfileInput{} + input = &TagResourceInput{} } - output = &UpdateInstanceProfileOutput{} + output = &TagResourceOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateInstanceProfile API operation for AWS Device Farm. +// TagResource API operation for AWS Device Farm. // -// Updates information about an existing private device instance profile. +// Associates the specified tags to a resource with the specified resourceArn. +// If existing tags on a resource are not specified in the request parameters, +// they are not changed. When a resource is deleted, the tags associated with +// that resource are also 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 Device Farm's -// API operation UpdateInstanceProfile for usage and error information. +// API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" -// A limit was exceeded. +// * TagOperationException +// The operation was not successful. Try again. // -// * ErrCodeServiceAccountException "ServiceAccountException" -// There was a problem with the service account. +// * TooManyTagsException +// The list of tags on the repository is over the limit. The maximum number +// of tags that can be applied to a repository is 50. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateInstanceProfile -func (c *DeviceFarm) UpdateInstanceProfile(input *UpdateInstanceProfileInput) (*UpdateInstanceProfileOutput, error) { - req, out := c.UpdateInstanceProfileRequest(input) +// * TagPolicyException +// The request doesn't comply with the AWS Identity and Access Management (IAM) +// tag policy. Correct your request and then retry it. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/TagResource +func (c *DeviceFarm) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) return out, req.Send() } -// UpdateInstanceProfileWithContext is the same as UpdateInstanceProfile with the addition of +// TagResourceWithContext is the same as TagResource with the addition of // the ability to pass a context and additional request options. // -// See UpdateInstanceProfile for details on how to use this API operation. +// See TagResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) UpdateInstanceProfileWithContext(ctx aws.Context, input *UpdateInstanceProfileInput, opts ...request.Option) (*UpdateInstanceProfileOutput, error) { - req, out := c.UpdateInstanceProfileRequest(input) +func (c *DeviceFarm) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateNetworkProfile = "UpdateNetworkProfile" +const opUntagResource = "UntagResource" -// UpdateNetworkProfileRequest generates a "aws/request.Request" representing the -// client's request for the UpdateNetworkProfile operation. The "output" return +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateNetworkProfile for more information on using the UpdateNetworkProfile +// See UntagResource for more information on using the UntagResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateNetworkProfileRequest method. -// req, resp := client.UpdateNetworkProfileRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateNetworkProfile -func (c *DeviceFarm) UpdateNetworkProfileRequest(input *UpdateNetworkProfileInput) (req *request.Request, output *UpdateNetworkProfileOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UntagResource +func (c *DeviceFarm) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { op := &request.Operation{ - Name: opUpdateNetworkProfile, + Name: opUntagResource, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateNetworkProfileInput{} + input = &UntagResourceInput{} } - output = &UpdateNetworkProfileOutput{} + output = &UntagResourceOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateNetworkProfile API operation for AWS Device Farm. +// UntagResource API operation for AWS Device Farm. // -// Updates the network profile with specific settings. +// Deletes the specified tags from 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 AWS Device Farm's -// API operation UpdateNetworkProfile for usage and error information. +// API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" -// A limit was exceeded. -// -// * ErrCodeServiceAccountException "ServiceAccountException" -// There was a problem with the service account. +// * TagOperationException +// The operation was not successful. Try again. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateNetworkProfile -func (c *DeviceFarm) UpdateNetworkProfile(input *UpdateNetworkProfileInput) (*UpdateNetworkProfileOutput, error) { - req, out := c.UpdateNetworkProfileRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UntagResource +func (c *DeviceFarm) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) return out, req.Send() } -// UpdateNetworkProfileWithContext is the same as UpdateNetworkProfile with the addition of +// UntagResourceWithContext is the same as UntagResource with the addition of // the ability to pass a context and additional request options. // -// See UpdateNetworkProfile for details on how to use this API operation. +// See UntagResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) UpdateNetworkProfileWithContext(ctx aws.Context, input *UpdateNetworkProfileInput, opts ...request.Option) (*UpdateNetworkProfileOutput, error) { - req, out := c.UpdateNetworkProfileRequest(input) +func (c *DeviceFarm) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateProject = "UpdateProject" +const opUpdateDeviceInstance = "UpdateDeviceInstance" -// UpdateProjectRequest generates a "aws/request.Request" representing the -// client's request for the UpdateProject operation. The "output" return +// UpdateDeviceInstanceRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDeviceInstance operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateProject for more information on using the UpdateProject +// See UpdateDeviceInstance for more information on using the UpdateDeviceInstance // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateProjectRequest method. -// req, resp := client.UpdateProjectRequest(params) +// // Example sending a request using the UpdateDeviceInstanceRequest method. +// req, resp := client.UpdateDeviceInstanceRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateProject -func (c *DeviceFarm) UpdateProjectRequest(input *UpdateProjectInput) (req *request.Request, output *UpdateProjectOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateDeviceInstance +func (c *DeviceFarm) UpdateDeviceInstanceRequest(input *UpdateDeviceInstanceInput) (req *request.Request, output *UpdateDeviceInstanceOutput) { op := &request.Operation{ - Name: opUpdateProject, + Name: opUpdateDeviceInstance, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateProjectInput{} + input = &UpdateDeviceInstanceInput{} } - output = &UpdateProjectOutput{} + output = &UpdateDeviceInstanceOutput{} req = c.newRequest(op, input, output) return } -// UpdateProject API operation for AWS Device Farm. +// UpdateDeviceInstance API operation for AWS Device Farm. // -// Modifies the specified project name, given the project ARN and a new name. +// Updates information about a private device 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 Device Farm's -// API operation UpdateProject for usage and error information. +// API operation UpdateDeviceInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateProject -func (c *DeviceFarm) UpdateProject(input *UpdateProjectInput) (*UpdateProjectOutput, error) { - req, out := c.UpdateProjectRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateDeviceInstance +func (c *DeviceFarm) UpdateDeviceInstance(input *UpdateDeviceInstanceInput) (*UpdateDeviceInstanceOutput, error) { + req, out := c.UpdateDeviceInstanceRequest(input) return out, req.Send() } -// UpdateProjectWithContext is the same as UpdateProject with the addition of +// UpdateDeviceInstanceWithContext is the same as UpdateDeviceInstance with the addition of // the ability to pass a context and additional request options. // -// See UpdateProject for details on how to use this API operation. +// See UpdateDeviceInstance for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) UpdateProjectWithContext(ctx aws.Context, input *UpdateProjectInput, opts ...request.Option) (*UpdateProjectOutput, error) { - req, out := c.UpdateProjectRequest(input) +func (c *DeviceFarm) UpdateDeviceInstanceWithContext(ctx aws.Context, input *UpdateDeviceInstanceInput, opts ...request.Option) (*UpdateDeviceInstanceOutput, error) { + req, out := c.UpdateDeviceInstanceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateUpload = "UpdateUpload" +const opUpdateDevicePool = "UpdateDevicePool" -// UpdateUploadRequest generates a "aws/request.Request" representing the -// client's request for the UpdateUpload operation. The "output" return +// UpdateDevicePoolRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDevicePool operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateUpload for more information on using the UpdateUpload +// See UpdateDevicePool for more information on using the UpdateDevicePool // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateUploadRequest method. -// req, resp := client.UpdateUploadRequest(params) +// // Example sending a request using the UpdateDevicePoolRequest method. +// req, resp := client.UpdateDevicePoolRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateUpload -func (c *DeviceFarm) UpdateUploadRequest(input *UpdateUploadInput) (req *request.Request, output *UpdateUploadOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateDevicePool +func (c *DeviceFarm) UpdateDevicePoolRequest(input *UpdateDevicePoolInput) (req *request.Request, output *UpdateDevicePoolOutput) { op := &request.Operation{ - Name: opUpdateUpload, + Name: opUpdateDevicePool, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateUploadInput{} + input = &UpdateDevicePoolInput{} } - output = &UpdateUploadOutput{} + output = &UpdateDevicePoolOutput{} req = c.newRequest(op, input, output) return } -// UpdateUpload API operation for AWS Device Farm. +// UpdateDevicePool API operation for AWS Device Farm. // -// Update an uploaded test specification (test spec). +// Modifies the name, description, and rules in a device pool given the attributes +// and the pool ARN. Rule updates are all-or-nothing, meaning they can only +// be updated as a whole (or not at 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 AWS Device Farm's -// API operation UpdateUpload for usage and error information. +// API operation UpdateDevicePool for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeServiceAccountException "ServiceAccountException" +// * ServiceAccountException // There was a problem with the service account. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateUpload -func (c *DeviceFarm) UpdateUpload(input *UpdateUploadInput) (*UpdateUploadOutput, error) { - req, out := c.UpdateUploadRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateDevicePool +func (c *DeviceFarm) UpdateDevicePool(input *UpdateDevicePoolInput) (*UpdateDevicePoolOutput, error) { + req, out := c.UpdateDevicePoolRequest(input) return out, req.Send() } -// UpdateUploadWithContext is the same as UpdateUpload with the addition of +// UpdateDevicePoolWithContext is the same as UpdateDevicePool with the addition of // the ability to pass a context and additional request options. // -// See UpdateUpload for details on how to use this API operation. +// See UpdateDevicePool for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) UpdateUploadWithContext(ctx aws.Context, input *UpdateUploadInput, opts ...request.Option) (*UpdateUploadOutput, error) { - req, out := c.UpdateUploadRequest(input) +func (c *DeviceFarm) UpdateDevicePoolWithContext(ctx aws.Context, input *UpdateDevicePoolInput, opts ...request.Option) (*UpdateDevicePoolOutput, error) { + req, out := c.UpdateDevicePoolRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateVPCEConfiguration = "UpdateVPCEConfiguration" +const opUpdateInstanceProfile = "UpdateInstanceProfile" -// UpdateVPCEConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateVPCEConfiguration operation. The "output" return +// UpdateInstanceProfileRequest generates a "aws/request.Request" representing the +// client's request for the UpdateInstanceProfile operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateVPCEConfiguration for more information on using the UpdateVPCEConfiguration +// See UpdateInstanceProfile for more information on using the UpdateInstanceProfile // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateVPCEConfigurationRequest method. -// req, resp := client.UpdateVPCEConfigurationRequest(params) +// // Example sending a request using the UpdateInstanceProfileRequest method. +// req, resp := client.UpdateInstanceProfileRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateVPCEConfiguration -func (c *DeviceFarm) UpdateVPCEConfigurationRequest(input *UpdateVPCEConfigurationInput) (req *request.Request, output *UpdateVPCEConfigurationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateInstanceProfile +func (c *DeviceFarm) UpdateInstanceProfileRequest(input *UpdateInstanceProfileInput) (req *request.Request, output *UpdateInstanceProfileOutput) { op := &request.Operation{ - Name: opUpdateVPCEConfiguration, + Name: opUpdateInstanceProfile, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateVPCEConfigurationInput{} + input = &UpdateInstanceProfileInput{} } - output = &UpdateVPCEConfigurationOutput{} + output = &UpdateInstanceProfileOutput{} req = c.newRequest(op, input, output) return } -// UpdateVPCEConfiguration API operation for AWS Device Farm. +// UpdateInstanceProfile API operation for AWS Device Farm. // -// Updates information about an existing Amazon Virtual Private Cloud (VPC) -// endpoint configuration. +// Updates information about an existing private device instance profile. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Device Farm's -// API operation UpdateVPCEConfiguration for usage and error information. +// API operation UpdateInstanceProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeArgumentException "ArgumentException" +// Returned Error Types: +// * ArgumentException // An invalid argument was specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The specified entity was not found. // -// * ErrCodeServiceAccountException "ServiceAccountException" -// There was a problem with the service account. +// * LimitExceededException +// A limit was exceeded. // -// * ErrCodeInvalidOperationException "InvalidOperationException" -// There was an error with the update request, or you do not have sufficient -// permissions to update this VPC endpoint configuration. +// * ServiceAccountException +// There was a problem with the service account. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateVPCEConfiguration -func (c *DeviceFarm) UpdateVPCEConfiguration(input *UpdateVPCEConfigurationInput) (*UpdateVPCEConfigurationOutput, error) { - req, out := c.UpdateVPCEConfigurationRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateInstanceProfile +func (c *DeviceFarm) UpdateInstanceProfile(input *UpdateInstanceProfileInput) (*UpdateInstanceProfileOutput, error) { + req, out := c.UpdateInstanceProfileRequest(input) return out, req.Send() } -// UpdateVPCEConfigurationWithContext is the same as UpdateVPCEConfiguration with the addition of +// UpdateInstanceProfileWithContext is the same as UpdateInstanceProfile with the addition of // the ability to pass a context and additional request options. // -// See UpdateVPCEConfiguration for details on how to use this API operation. +// See UpdateInstanceProfile for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DeviceFarm) UpdateVPCEConfigurationWithContext(ctx aws.Context, input *UpdateVPCEConfigurationInput, opts ...request.Option) (*UpdateVPCEConfigurationOutput, error) { - req, out := c.UpdateVPCEConfigurationRequest(input) +func (c *DeviceFarm) UpdateInstanceProfileWithContext(ctx aws.Context, input *UpdateInstanceProfileInput, opts ...request.Option) (*UpdateInstanceProfileOutput, error) { + req, out := c.UpdateInstanceProfileRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// A container for account-level settings within AWS Device Farm. -type AccountSettings struct { - _ struct{} `type:"structure"` +const opUpdateNetworkProfile = "UpdateNetworkProfile" - // The AWS account number specified in the AccountSettings container. - AwsAccountNumber *string `locationName:"awsAccountNumber" min:"2" type:"string"` +// UpdateNetworkProfileRequest generates a "aws/request.Request" representing the +// client's request for the UpdateNetworkProfile operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateNetworkProfile for more information on using the UpdateNetworkProfile +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateNetworkProfileRequest method. +// req, resp := client.UpdateNetworkProfileRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateNetworkProfile +func (c *DeviceFarm) UpdateNetworkProfileRequest(input *UpdateNetworkProfileInput) (req *request.Request, output *UpdateNetworkProfileOutput) { + op := &request.Operation{ + Name: opUpdateNetworkProfile, + HTTPMethod: "POST", + HTTPPath: "/", + } - // The default number of minutes (at the account level) a test run will execute - // before it times out. The default value is 150 minutes. - DefaultJobTimeoutMinutes *int64 `locationName:"defaultJobTimeoutMinutes" type:"integer"` + if input == nil { + input = &UpdateNetworkProfileInput{} + } - // The maximum number of minutes a test run will execute before it times out. - MaxJobTimeoutMinutes *int64 `locationName:"maxJobTimeoutMinutes" type:"integer"` + output = &UpdateNetworkProfileOutput{} + req = c.newRequest(op, input, output) + return +} - // The maximum number of device slots that the AWS account can purchase. Each - // maximum is expressed as an offering-id:number pair, where the offering-id - // represents one of the IDs returned by the ListOfferings command. - MaxSlots map[string]*int64 `locationName:"maxSlots" type:"map"` +// UpdateNetworkProfile API operation for AWS Device Farm. +// +// Updates the network profile. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Device Farm's +// API operation UpdateNetworkProfile for usage and error information. +// +// Returned Error Types: +// * ArgumentException +// An invalid argument was specified. +// +// * NotFoundException +// The specified entity was not found. +// +// * LimitExceededException +// A limit was exceeded. +// +// * ServiceAccountException +// There was a problem with the service account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateNetworkProfile +func (c *DeviceFarm) UpdateNetworkProfile(input *UpdateNetworkProfileInput) (*UpdateNetworkProfileOutput, error) { + req, out := c.UpdateNetworkProfileRequest(input) + return out, req.Send() +} + +// UpdateNetworkProfileWithContext is the same as UpdateNetworkProfile with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateNetworkProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DeviceFarm) UpdateNetworkProfileWithContext(ctx aws.Context, input *UpdateNetworkProfileInput, opts ...request.Option) (*UpdateNetworkProfileOutput, error) { + req, out := c.UpdateNetworkProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateProject = "UpdateProject" + +// UpdateProjectRequest generates a "aws/request.Request" representing the +// client's request for the UpdateProject operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateProject for more information on using the UpdateProject +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateProjectRequest method. +// req, resp := client.UpdateProjectRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateProject +func (c *DeviceFarm) 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 Device Farm. +// +// Modifies the specified project name, given the project ARN and a new 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 AWS Device Farm's +// API operation UpdateProject for usage and error information. +// +// Returned Error Types: +// * ArgumentException +// An invalid argument was specified. +// +// * NotFoundException +// The specified entity was not found. +// +// * LimitExceededException +// A limit was exceeded. +// +// * ServiceAccountException +// There was a problem with the service account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateProject +func (c *DeviceFarm) UpdateProject(input *UpdateProjectInput) (*UpdateProjectOutput, error) { + req, out := c.UpdateProjectRequest(input) + return out, req.Send() +} + +// UpdateProjectWithContext is the same as UpdateProject with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateProject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DeviceFarm) UpdateProjectWithContext(ctx aws.Context, input *UpdateProjectInput, opts ...request.Option) (*UpdateProjectOutput, error) { + req, out := c.UpdateProjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateTestGridProject = "UpdateTestGridProject" + +// UpdateTestGridProjectRequest generates a "aws/request.Request" representing the +// client's request for the UpdateTestGridProject operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateTestGridProject for more information on using the UpdateTestGridProject +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateTestGridProjectRequest method. +// req, resp := client.UpdateTestGridProjectRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateTestGridProject +func (c *DeviceFarm) UpdateTestGridProjectRequest(input *UpdateTestGridProjectInput) (req *request.Request, output *UpdateTestGridProjectOutput) { + op := &request.Operation{ + Name: opUpdateTestGridProject, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateTestGridProjectInput{} + } + + output = &UpdateTestGridProjectOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateTestGridProject API operation for AWS Device Farm. +// +// Change details of a 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 Device Farm's +// API operation UpdateTestGridProject for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// The specified entity was not found. +// +// * ArgumentException +// An invalid argument was specified. +// +// * InternalServiceException +// An internal exception was raised in the service. Contact aws-devicefarm-support@amazon.com +// (mailto:aws-devicefarm-support@amazon.com) if you see this error. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateTestGridProject +func (c *DeviceFarm) UpdateTestGridProject(input *UpdateTestGridProjectInput) (*UpdateTestGridProjectOutput, error) { + req, out := c.UpdateTestGridProjectRequest(input) + return out, req.Send() +} + +// UpdateTestGridProjectWithContext is the same as UpdateTestGridProject with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTestGridProject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DeviceFarm) UpdateTestGridProjectWithContext(ctx aws.Context, input *UpdateTestGridProjectInput, opts ...request.Option) (*UpdateTestGridProjectOutput, error) { + req, out := c.UpdateTestGridProjectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateUpload = "UpdateUpload" + +// UpdateUploadRequest generates a "aws/request.Request" representing the +// client's request for the UpdateUpload operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateUpload for more information on using the UpdateUpload +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateUploadRequest method. +// req, resp := client.UpdateUploadRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateUpload +func (c *DeviceFarm) UpdateUploadRequest(input *UpdateUploadInput) (req *request.Request, output *UpdateUploadOutput) { + op := &request.Operation{ + Name: opUpdateUpload, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateUploadInput{} + } + + output = &UpdateUploadOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateUpload API operation for AWS Device Farm. +// +// Updates an uploaded test spec. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Device Farm's +// API operation UpdateUpload for usage and error information. +// +// Returned Error Types: +// * ArgumentException +// An invalid argument was specified. +// +// * NotFoundException +// The specified entity was not found. +// +// * LimitExceededException +// A limit was exceeded. +// +// * ServiceAccountException +// There was a problem with the service account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateUpload +func (c *DeviceFarm) UpdateUpload(input *UpdateUploadInput) (*UpdateUploadOutput, error) { + req, out := c.UpdateUploadRequest(input) + return out, req.Send() +} + +// UpdateUploadWithContext is the same as UpdateUpload with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateUpload for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DeviceFarm) UpdateUploadWithContext(ctx aws.Context, input *UpdateUploadInput, opts ...request.Option) (*UpdateUploadOutput, error) { + req, out := c.UpdateUploadRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateVPCEConfiguration = "UpdateVPCEConfiguration" + +// UpdateVPCEConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the UpdateVPCEConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateVPCEConfiguration for more information on using the UpdateVPCEConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateVPCEConfigurationRequest method. +// req, resp := client.UpdateVPCEConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateVPCEConfiguration +func (c *DeviceFarm) UpdateVPCEConfigurationRequest(input *UpdateVPCEConfigurationInput) (req *request.Request, output *UpdateVPCEConfigurationOutput) { + op := &request.Operation{ + Name: opUpdateVPCEConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateVPCEConfigurationInput{} + } + + output = &UpdateVPCEConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateVPCEConfiguration API operation for AWS Device Farm. +// +// Updates information about an Amazon Virtual Private Cloud (VPC) endpoint +// 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 Device Farm's +// API operation UpdateVPCEConfiguration for usage and error information. +// +// Returned Error Types: +// * ArgumentException +// An invalid argument was specified. +// +// * NotFoundException +// The specified entity was not found. +// +// * ServiceAccountException +// There was a problem with the service account. +// +// * InvalidOperationException +// There was an error with the update request, or you do not have sufficient +// permissions to update this VPC endpoint configuration. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23/UpdateVPCEConfiguration +func (c *DeviceFarm) UpdateVPCEConfiguration(input *UpdateVPCEConfigurationInput) (*UpdateVPCEConfigurationOutput, error) { + req, out := c.UpdateVPCEConfigurationRequest(input) + return out, req.Send() +} + +// UpdateVPCEConfigurationWithContext is the same as UpdateVPCEConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateVPCEConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DeviceFarm) UpdateVPCEConfigurationWithContext(ctx aws.Context, input *UpdateVPCEConfigurationInput, opts ...request.Option) (*UpdateVPCEConfigurationOutput, error) { + req, out := c.UpdateVPCEConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} - // When set to true, for private devices, Device Farm will not sign your app - // again. For public devices, Device Farm always signs your apps again and this - // parameter has no effect. +// A container for account-level settings in AWS Device Farm. +type AccountSettings struct { + _ struct{} `type:"structure"` + + // The AWS account number specified in the AccountSettings container. + AwsAccountNumber *string `locationName:"awsAccountNumber" min:"2" type:"string"` + + // The default number of minutes (at the account level) a test run executes + // before it times out. The default value is 150 minutes. + DefaultJobTimeoutMinutes *int64 `locationName:"defaultJobTimeoutMinutes" type:"integer"` + + // The maximum number of minutes a test run executes before it times out. + MaxJobTimeoutMinutes *int64 `locationName:"maxJobTimeoutMinutes" type:"integer"` + + // The maximum number of device slots that the AWS account can purchase. Each + // maximum is expressed as an offering-id:number pair, where the offering-id + // represents one of the IDs returned by the ListOfferings command. + MaxSlots map[string]*int64 `locationName:"maxSlots" type:"map"` + + // When set to true, for private devices, Device Farm does not sign your app + // again. For public devices, Device Farm always signs your apps again. // - // For more information about how Device Farm re-signs your app(s), see Do you + // For more information about how Device Farm re-signs your apps, see Do you // modify my app? (https://aws.amazon.com/device-farm/faq/) in the AWS Device // Farm FAQs. SkipAppResign *bool `locationName:"skipAppResign" type:"boolean"` @@ -6868,6 +8005,63 @@ func (s *AccountSettings) SetUnmeteredRemoteAccessDevices(v map[string]*int64) * return s } +// An invalid argument was specified. +type ArgumentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Any additional information about the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ArgumentException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ArgumentException) GoString() string { + return s.String() +} + +func newErrorArgumentException(v protocol.ResponseMetadata) error { + return &ArgumentException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ArgumentException) Code() string { + return "ArgumentException" +} + +// Message returns the exception's message. +func (s ArgumentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ArgumentException) OrigErr() error { + return nil +} + +func (s ArgumentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ArgumentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ArgumentException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents the output of a test. Examples of artifacts include logs and screenshots. type Artifact struct { _ struct{} `type:"structure"` @@ -6885,66 +8079,66 @@ type Artifact struct { // // Allowed values include the following: // - // * UNKNOWN: An unknown type. + // * UNKNOWN // - // * SCREENSHOT: The screenshot type. + // * SCREENSHOT // - // * DEVICE_LOG: The device log type. + // * DEVICE_LOG // - // * MESSAGE_LOG: The message log type. + // * MESSAGE_LOG // - // * VIDEO_LOG: The video log type. + // * VIDEO_LOG // - // * RESULT_LOG: The result log type. + // * RESULT_LOG // - // * SERVICE_LOG: The service log type. + // * SERVICE_LOG // - // * WEBKIT_LOG: The web kit log type. + // * WEBKIT_LOG // - // * INSTRUMENTATION_OUTPUT: The instrumentation type. + // * INSTRUMENTATION_OUTPUT // - // * EXERCISER_MONKEY_OUTPUT: For Android, the artifact (log) generated by - // an Android fuzz test. + // * EXERCISER_MONKEY_OUTPUT: the artifact (log) generated by an Android + // fuzz test. // - // * CALABASH_JSON_OUTPUT: The Calabash JSON output type. + // * CALABASH_JSON_OUTPUT // - // * CALABASH_PRETTY_OUTPUT: The Calabash pretty output type. + // * CALABASH_PRETTY_OUTPUT // - // * CALABASH_STANDARD_OUTPUT: The Calabash standard output type. + // * CALABASH_STANDARD_OUTPUT // - // * CALABASH_JAVA_XML_OUTPUT: The Calabash Java XML output type. + // * CALABASH_JAVA_XML_OUTPUT // - // * AUTOMATION_OUTPUT: The automation output type. + // * AUTOMATION_OUTPUT // - // * APPIUM_SERVER_OUTPUT: The Appium server output type. + // * APPIUM_SERVER_OUTPUT // - // * APPIUM_JAVA_OUTPUT: The Appium Java output type. + // * APPIUM_JAVA_OUTPUT // - // * APPIUM_JAVA_XML_OUTPUT: The Appium Java XML output type. + // * APPIUM_JAVA_XML_OUTPUT // - // * APPIUM_PYTHON_OUTPUT: The Appium Python output type. + // * APPIUM_PYTHON_OUTPUT // - // * APPIUM_PYTHON_XML_OUTPUT: The Appium Python XML output type. + // * APPIUM_PYTHON_XML_OUTPUT // - // * EXPLORER_EVENT_LOG: The Explorer event log output type. + // * EXPLORER_EVENT_LOG // - // * EXPLORER_SUMMARY_LOG: The Explorer summary log output type. + // * EXPLORER_SUMMARY_LOG // - // * APPLICATION_CRASH_REPORT: The application crash report output type. + // * APPLICATION_CRASH_REPORT // - // * XCTEST_LOG: The Xcode test output type. + // * XCTEST_LOG // - // * VIDEO: The Video output type. + // * VIDEO // - // * CUSTOMER_ARTIFACT:The Customer Artifact output type. + // * CUSTOMER_ARTIFACT // - // * CUSTOMER_ARTIFACT_LOG: The Customer Artifact Log output type. + // * CUSTOMER_ARTIFACT_LOG // - // * TESTSPEC_OUTPUT: The Test Spec Output type. + // * TESTSPEC_OUTPUT Type *string `locationName:"type" type:"string" enum:"ArtifactType"` - // The pre-signed Amazon S3 URL that can be used with a corresponding GET request - // to download the artifact's file. + // The presigned Amazon S3 URL that can be used with a GET request to download + // the artifact's file. Url *string `locationName:"url" type:"string"` } @@ -6988,13 +8182,12 @@ func (s *Artifact) SetUrl(v string) *Artifact { return s } -// Represents the amount of CPU that an app is using on a physical device. -// -// Note that this does not represent system-wide CPU usage. +// Represents the amount of CPU that an app is using on a physical device. Does +// not represent system-wide CPU usage. type CPU struct { _ struct{} `type:"structure"` - // The CPU's architecture, for example x86 or ARM. + // The CPU's architecture (for example, x86 or ARM). Architecture *string `locationName:"architecture" type:"string"` // The clock speed of the device's CPU, expressed in hertz (Hz). For example, @@ -7033,6 +8226,62 @@ func (s *CPU) SetFrequency(v string) *CPU { return s } +// The requested object could not be deleted. +type CannotDeleteException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CannotDeleteException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CannotDeleteException) GoString() string { + return s.String() +} + +func newErrorCannotDeleteException(v protocol.ResponseMetadata) error { + return &CannotDeleteException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CannotDeleteException) Code() string { + return "CannotDeleteException" +} + +// Message returns the exception's message. +func (s CannotDeleteException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CannotDeleteException) OrigErr() error { + return nil +} + +func (s CannotDeleteException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CannotDeleteException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CannotDeleteException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents entity counters. type Counters struct { _ struct{} `type:"structure"` @@ -7119,10 +8368,9 @@ type CreateDevicePoolInput struct { Description *string `locationName:"description" type:"string"` // The number of devices that Device Farm can add to your device pool. Device - // Farm adds devices that are available and that meet the criteria that you - // assign for the rules parameter. Depending on how many devices meet these - // constraints, your device pool might contain fewer devices than the value - // for this parameter. + // Farm adds devices that are available and meet the criteria that you assign + // for the rules parameter. Depending on how many devices meet these constraints, + // your device pool might contain fewer devices than the value for this parameter. // // By specifying the maximum number of devices, you can control the costs that // you incur by running tests. @@ -7236,10 +8484,10 @@ type CreateInstanceProfileInput struct { // The description of your instance profile. Description *string `locationName:"description" type:"string"` - // An array of strings specifying the list of app packages that should not be - // cleaned up from the device after a test run is over. + // An array of strings that specifies the list of app packages that should not + // be cleaned up from the device after a test run. // - // The list of packages is only considered if you set packageCleanup to true. + // The list of packages is considered only if you set packageCleanup to true. ExcludeAppPackagesFromCleanup []*string `locationName:"excludeAppPackagesFromCleanup" type:"list"` // The name of your instance profile. @@ -7247,12 +8495,12 @@ type CreateInstanceProfileInput struct { // Name is a required field Name *string `locationName:"name" type:"string" required:"true"` - // When set to true, Device Farm will remove app packages after a test run. - // The default value is false for private devices. + // When set to true, Device Farm removes app packages after a test run. The + // default value is false for private devices. PackageCleanup *bool `locationName:"packageCleanup" type:"boolean"` - // When set to true, Device Farm will reboot the instance after a test run. - // The default value is true. + // When set to true, Device Farm reboots the instance after a test run. The + // default value is true. RebootAfterUse *bool `locationName:"rebootAfterUse" type:"boolean"` } @@ -7312,7 +8560,7 @@ func (s *CreateInstanceProfileInput) SetRebootAfterUse(v bool) *CreateInstancePr type CreateInstanceProfileOutput struct { _ struct{} `type:"structure"` - // An object containing information about your instance profile. + // An object that contains information about your instance profile. InstanceProfile *InstanceProfile `locationName:"instanceProfile" type:"structure"` } @@ -7352,7 +8600,7 @@ type CreateNetworkProfileInput struct { // Proportion of received packets that fail to arrive from 0 to 100 percent. DownlinkLossPercent *int64 `locationName:"downlinkLossPercent" type:"integer"` - // The name you wish to specify for the new network profile. + // The name for the new network profile. // // Name is a required field Name *string `locationName:"name" type:"string" required:"true"` @@ -7363,7 +8611,7 @@ type CreateNetworkProfileInput struct { // ProjectArn is a required field ProjectArn *string `locationName:"projectArn" min:"32" type:"string" required:"true"` - // The type of network profile you wish to create. Valid values are listed below. + // The type of network profile to create. Valid values are listed here. Type *string `locationName:"type" type:"string" enum:"NetworkProfileType"` // The data throughput rate in bits per second, as an integer from 0 to 104857600. @@ -7510,7 +8758,7 @@ type CreateProjectInput struct { _ struct{} `type:"structure"` // Sets the execution timeout value (in minutes) for a project. All test runs - // in this project will use the specified execution timeout value unless overridden + // in this project use the specified execution timeout value unless overridden // when scheduling a run. DefaultJobTimeoutMinutes *int64 `locationName:"defaultJobTimeoutMinutes" type:"integer"` @@ -7586,7 +8834,7 @@ type CreateRemoteAccessSessionConfiguration struct { // The billing method for the remote access session. BillingMethod *string `locationName:"billingMethod" type:"string" enum:"BillingMethod"` - // An array of Amazon Resource Names (ARNs) included in the VPC endpoint configuration. + // An array of ARNs included in the VPC endpoint configuration. VpceConfigurationArns []*string `locationName:"vpceConfigurationArns" type:"list"` } @@ -7618,15 +8866,16 @@ type CreateRemoteAccessSessionInput struct { // Unique identifier for the client. If you want access to multiple devices // on the same client, you should pass the same clientId value in each call - // to CreateRemoteAccessSession. This is required only if remoteDebugEnabled + // to CreateRemoteAccessSession. This identifier is required only if remoteDebugEnabled // is set to true. + // + // Remote debugging is no longer supported (https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html). ClientId *string `locationName:"clientId" type:"string"` // The configuration information for the remote access session request. Configuration *CreateRemoteAccessSessionConfiguration `locationName:"configuration" type:"structure"` - // The Amazon Resource Name (ARN) of the device for which you want to create - // a remote access session. + // The ARN of the device for which you want to create a remote access session. // // DeviceArn is a required field DeviceArn *string `locationName:"deviceArn" min:"32" type:"string" required:"true"` @@ -7641,15 +8890,16 @@ type CreateRemoteAccessSessionInput struct { // and rotating the screen. You cannot run XCUITest framework-based tests // in this mode. // - // * NO_VIDEO: You are connected to the device but cannot interact with it - // or view the screen. This mode has the fastest test execution speed. You - // can run XCUITest framework-based tests in this mode. + // * NO_VIDEO: You are connected to the device, but cannot interact with + // it or view the screen. This mode has the fastest test execution speed. + // You can run XCUITest framework-based tests in this mode. // - // * VIDEO_ONLY: You can view the screen but cannot touch or rotate it. You - // can run XCUITest framework-based tests and watch the screen in this mode. + // * VIDEO_ONLY: You can view the screen, but cannot touch or rotate it. + // You can run XCUITest framework-based tests and watch the screen in this + // mode. InteractionMode *string `locationName:"interactionMode" type:"string" enum:"InteractionMode"` - // The name of the remote access session that you wish to create. + // The name of the remote access session to create. Name *string `locationName:"name" type:"string"` // The Amazon Resource Name (ARN) of the project for which you want to create @@ -7660,6 +8910,8 @@ type CreateRemoteAccessSessionInput struct { // Set to true if you want to access devices remotely for debugging in your // remote access session. + // + // Remote debugging is no longer supported (https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html). RemoteDebugEnabled *bool `locationName:"remoteDebugEnabled" type:"boolean"` // The Amazon Resource Name (ARN) for the app to be recorded in the remote access @@ -7669,18 +8921,18 @@ type CreateRemoteAccessSessionInput struct { // Set to true to enable remote recording for the remote access session. RemoteRecordEnabled *bool `locationName:"remoteRecordEnabled" type:"boolean"` - // When set to true, for private devices, Device Farm will not sign your app - // again. For public devices, Device Farm always signs your apps again and this - // parameter has no effect. + // When set to true, for private devices, Device Farm does not sign your app + // again. For public devices, Device Farm always signs your apps again. // - // For more information about how Device Farm re-signs your app(s), see Do you - // modify my app? (https://aws.amazon.com/device-farm/faq/) in the AWS Device - // Farm FAQs. + // For more information on how Device Farm modifies your uploads during tests, + // see Do you modify my app? (https://aws.amazon.com/device-farm/faq/) SkipAppResign *bool `locationName:"skipAppResign" type:"boolean"` - // The public key of the ssh key pair you want to use for connecting to remote - // devices in your remote debugging session. This is only required if remoteDebugEnabled - // is set to true. + // Ignored. The public key of the ssh key pair you want to use for connecting + // to remote devices in your remote debugging session. This key is required + // only if remoteDebugEnabled is set to true. + // + // Remote debugging is no longer supported (https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html). SshPublicKey *string `locationName:"sshPublicKey" type:"string"` } @@ -7819,17 +9071,185 @@ func (s *CreateRemoteAccessSessionOutput) SetRemoteAccessSession(v *RemoteAccess return s } +type CreateTestGridProjectInput struct { + _ struct{} `type:"structure"` + + // Human-readable description of the project. + Description *string `locationName:"description" min:"1" type:"string"` + + // Human-readable name of the Selenium testing project. + // + // Name is a required field + Name *string `locationName:"name" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateTestGridProjectInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTestGridProjectInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTestGridProjectInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTestGridProjectInput"} + 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) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDescription sets the Description field's value. +func (s *CreateTestGridProjectInput) SetDescription(v string) *CreateTestGridProjectInput { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateTestGridProjectInput) SetName(v string) *CreateTestGridProjectInput { + s.Name = &v + return s +} + +type CreateTestGridProjectOutput struct { + _ struct{} `type:"structure"` + + // ARN of the Selenium testing project that was created. + TestGridProject *TestGridProject `locationName:"testGridProject" type:"structure"` +} + +// String returns the string representation +func (s CreateTestGridProjectOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTestGridProjectOutput) GoString() string { + return s.String() +} + +// SetTestGridProject sets the TestGridProject field's value. +func (s *CreateTestGridProjectOutput) SetTestGridProject(v *TestGridProject) *CreateTestGridProjectOutput { + s.TestGridProject = v + return s +} + +type CreateTestGridUrlInput struct { + _ struct{} `type:"structure"` + + // Lifetime, in seconds, of the URL. + // + // ExpiresInSeconds is a required field + ExpiresInSeconds *int64 `locationName:"expiresInSeconds" min:"60" type:"integer" required:"true"` + + // ARN (from CreateTestGridProject or ListTestGridProjects) to associate with + // the short-term URL. + // + // ProjectArn is a required field + ProjectArn *string `locationName:"projectArn" min:"32" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateTestGridUrlInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTestGridUrlInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTestGridUrlInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTestGridUrlInput"} + if s.ExpiresInSeconds == nil { + invalidParams.Add(request.NewErrParamRequired("ExpiresInSeconds")) + } + if s.ExpiresInSeconds != nil && *s.ExpiresInSeconds < 60 { + invalidParams.Add(request.NewErrParamMinValue("ExpiresInSeconds", 60)) + } + if s.ProjectArn == nil { + invalidParams.Add(request.NewErrParamRequired("ProjectArn")) + } + if s.ProjectArn != nil && len(*s.ProjectArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("ProjectArn", 32)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetExpiresInSeconds sets the ExpiresInSeconds field's value. +func (s *CreateTestGridUrlInput) SetExpiresInSeconds(v int64) *CreateTestGridUrlInput { + s.ExpiresInSeconds = &v + return s +} + +// SetProjectArn sets the ProjectArn field's value. +func (s *CreateTestGridUrlInput) SetProjectArn(v string) *CreateTestGridUrlInput { + s.ProjectArn = &v + return s +} + +type CreateTestGridUrlOutput struct { + _ struct{} `type:"structure"` + + // The number of seconds the URL from CreateTestGridUrlResult$url stays active. + Expires *time.Time `locationName:"expires" type:"timestamp"` + + // A signed URL, expiring in CreateTestGridUrlRequest$expiresInSeconds seconds, + // to be passed to a RemoteWebDriver. + Url *string `locationName:"url" type:"string"` +} + +// String returns the string representation +func (s CreateTestGridUrlOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTestGridUrlOutput) GoString() string { + return s.String() +} + +// SetExpires sets the Expires field's value. +func (s *CreateTestGridUrlOutput) SetExpires(v time.Time) *CreateTestGridUrlOutput { + s.Expires = &v + return s +} + +// SetUrl sets the Url field's value. +func (s *CreateTestGridUrlOutput) SetUrl(v string) *CreateTestGridUrlOutput { + s.Url = &v + return s +} + // Represents a request to the create upload operation. type CreateUploadInput struct { _ struct{} `type:"structure"` - // The upload's content type (for example, "application/octet-stream"). + // The upload's content type (for example, application/octet-stream). ContentType *string `locationName:"contentType" type:"string"` - // The upload's file name. The name should not contain the '/' character. If - // uploading an iOS app, the file name needs to end with the .ipa extension. - // If uploading an Android app, the file name needs to end with the .apk extension. - // For all others, the file name must end with the .zip file extension. + // The upload's file name. The name should not contain any forward slashes (/). + // If you are uploading an iOS app, the file name must end with the .ipa extension. + // If you are uploading an Android app, the file name must end with the .apk + // extension. For all others, the file name must end with the .zip file extension. // // Name is a required field Name *string `locationName:"name" type:"string" required:"true"` @@ -7843,83 +9263,72 @@ type CreateUploadInput struct { // // Must be one of the following values: // - // * ANDROID_APP: An Android upload. + // * ANDROID_APP // - // * IOS_APP: An iOS upload. + // * IOS_APP // - // * WEB_APP: A web application upload. + // * WEB_APP // - // * EXTERNAL_DATA: An external data upload. + // * EXTERNAL_DATA // - // * APPIUM_JAVA_JUNIT_TEST_PACKAGE: An Appium Java JUnit test package upload. + // * APPIUM_JAVA_JUNIT_TEST_PACKAGE // - // * APPIUM_JAVA_TESTNG_TEST_PACKAGE: An Appium Java TestNG test package - // upload. + // * APPIUM_JAVA_TESTNG_TEST_PACKAGE // - // * APPIUM_PYTHON_TEST_PACKAGE: An Appium Python test package upload. + // * APPIUM_PYTHON_TEST_PACKAGE // - // * APPIUM_NODE_TEST_PACKAGE: An Appium Node.js test package upload. + // * APPIUM_NODE_TEST_PACKAGE // - // * APPIUM_RUBY_TEST_PACKAGE: An Appium Ruby test package upload. + // * APPIUM_RUBY_TEST_PACKAGE // - // * APPIUM_WEB_JAVA_JUNIT_TEST_PACKAGE: An Appium Java JUnit test package - // upload for a web app. + // * APPIUM_WEB_JAVA_JUNIT_TEST_PACKAGE // - // * APPIUM_WEB_JAVA_TESTNG_TEST_PACKAGE: An Appium Java TestNG test package - // upload for a web app. + // * APPIUM_WEB_JAVA_TESTNG_TEST_PACKAGE // - // * APPIUM_WEB_PYTHON_TEST_PACKAGE: An Appium Python test package upload - // for a web app. + // * APPIUM_WEB_PYTHON_TEST_PACKAGE // - // * APPIUM_WEB_NODE_TEST_PACKAGE: An Appium Node.js test package upload - // for a web app. + // * APPIUM_WEB_NODE_TEST_PACKAGE // - // * APPIUM_WEB_RUBY_TEST_PACKAGE: An Appium Ruby test package upload for - // a web app. + // * APPIUM_WEB_RUBY_TEST_PACKAGE // - // * CALABASH_TEST_PACKAGE: A Calabash test package upload. + // * CALABASH_TEST_PACKAGE // - // * INSTRUMENTATION_TEST_PACKAGE: An instrumentation upload. + // * INSTRUMENTATION_TEST_PACKAGE // - // * UIAUTOMATION_TEST_PACKAGE: A uiautomation test package upload. + // * UIAUTOMATION_TEST_PACKAGE // - // * UIAUTOMATOR_TEST_PACKAGE: A uiautomator test package upload. + // * UIAUTOMATOR_TEST_PACKAGE // - // * XCTEST_TEST_PACKAGE: An Xcode test package upload. + // * XCTEST_TEST_PACKAGE // - // * XCTEST_UI_TEST_PACKAGE: An Xcode UI test package upload. + // * XCTEST_UI_TEST_PACKAGE // - // * APPIUM_JAVA_JUNIT_TEST_SPEC: An Appium Java JUnit test spec upload. + // * APPIUM_JAVA_JUNIT_TEST_SPEC // - // * APPIUM_JAVA_TESTNG_TEST_SPEC: An Appium Java TestNG test spec upload. + // * APPIUM_JAVA_TESTNG_TEST_SPEC // - // * APPIUM_PYTHON_TEST_SPEC: An Appium Python test spec upload. + // * APPIUM_PYTHON_TEST_SPEC // - // * APPIUM_NODE_TEST_SPEC: An Appium Node.js test spec upload. + // * APPIUM_NODE_TEST_SPEC // - // * APPIUM_RUBY_TEST_SPEC: An Appium Ruby test spec upload. + // * APPIUM_RUBY_TEST_SPEC // - // * APPIUM_WEB_JAVA_JUNIT_TEST_SPEC: An Appium Java JUnit test spec upload - // for a web app. + // * APPIUM_WEB_JAVA_JUNIT_TEST_SPEC // - // * APPIUM_WEB_JAVA_TESTNG_TEST_SPEC: An Appium Java TestNG test spec upload - // for a web app. + // * APPIUM_WEB_JAVA_TESTNG_TEST_SPEC // - // * APPIUM_WEB_PYTHON_TEST_SPEC: An Appium Python test spec upload for a - // web app. + // * APPIUM_WEB_PYTHON_TEST_SPEC // - // * APPIUM_WEB_NODE_TEST_SPEC: An Appium Node.js test spec upload for a - // web app. + // * APPIUM_WEB_NODE_TEST_SPEC // - // * APPIUM_WEB_RUBY_TEST_SPEC: An Appium Ruby test spec upload for a web - // app. + // * APPIUM_WEB_RUBY_TEST_SPEC // - // * INSTRUMENTATION_TEST_SPEC: An instrumentation test spec upload. + // * INSTRUMENTATION_TEST_SPEC // - // * XCTEST_UI_TEST_SPEC: An Xcode UI test spec upload. + // * XCTEST_UI_TEST_SPEC // - // Note If you call CreateUpload with WEB_APP specified, AWS Device Farm throws - // an ArgumentException error. + // If you call CreateUpload with WEB_APP specified, AWS Device Farm throws an + // ArgumentException error. // // Type is a required field Type *string `locationName:"type" type:"string" required:"true" enum:"UploadType"` @@ -8014,7 +9423,7 @@ type CreateVPCEConfigurationInput struct { // ServiceDnsName is a required field ServiceDnsName *string `locationName:"serviceDnsName" type:"string" required:"true"` - // An optional description, providing more details about your VPC endpoint configuration. + // An optional description that provides details about your VPC endpoint configuration. VpceConfigurationDescription *string `locationName:"vpceConfigurationDescription" type:"string"` // The friendly name you give to your VPC endpoint configuration, to manage @@ -8023,8 +9432,8 @@ type CreateVPCEConfigurationInput struct { // VpceConfigurationName is a required field VpceConfigurationName *string `locationName:"vpceConfigurationName" type:"string" required:"true"` - // The name of the VPC endpoint service running inside your AWS account that - // you want Device Farm to test. + // The name of the VPC endpoint service running in your AWS account that you + // want Device Farm to test. // // VpceServiceName is a required field VpceServiceName *string `locationName:"vpceServiceName" type:"string" required:"true"` @@ -8086,7 +9495,7 @@ func (s *CreateVPCEConfigurationInput) SetVpceServiceName(v string) *CreateVPCEC type CreateVPCEConfigurationOutput struct { _ struct{} `type:"structure"` - // An object containing information about your VPC endpoint configuration. + // An object that contains information about your VPC endpoint configuration. VpceConfiguration *VPCEConfiguration `locationName:"vpceConfiguration" type:"structure"` } @@ -8106,8 +9515,8 @@ func (s *CreateVPCEConfigurationOutput) SetVpceConfiguration(v *VPCEConfiguratio return s } -// A JSON object specifying the paths where the artifacts generated by the customer's -// tests, on the device or in the test environment, will be pulled from. +// A JSON object that specifies the paths where the artifacts generated by the +// customer's tests, on the device or in the test environment, are pulled from. // // Specify deviceHostPaths and optionally specify either iosPaths or androidPaths. // @@ -8116,15 +9525,15 @@ type CustomerArtifactPaths struct { _ struct{} `type:"structure"` // Comma-separated list of paths on the Android device where the artifacts generated - // by the customer's tests will be pulled from. + // by the customer's tests are pulled from. AndroidPaths []*string `locationName:"androidPaths" type:"list"` // Comma-separated list of paths in the test execution environment where the - // artifacts generated by the customer's tests will be pulled from. + // artifacts generated by the customer's tests are pulled from. DeviceHostPaths []*string `locationName:"deviceHostPaths" type:"list"` // Comma-separated list of paths on the iOS device where the artifacts generated - // by the customer's tests will be pulled from. + // by the customer's tests are pulled from. IosPaths []*string `locationName:"iosPaths" type:"list"` } @@ -8161,7 +9570,7 @@ type DeleteDevicePoolInput struct { _ struct{} `type:"structure"` // Represents the Amazon Resource Name (ARN) of the Device Farm device pool - // you wish to delete. + // to delete. // // Arn is a required field Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` @@ -8273,7 +9682,7 @@ func (s DeleteInstanceProfileOutput) GoString() string { type DeleteNetworkProfileInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the network profile you want to delete. + // The ARN of the network profile to delete. // // Arn is a required field Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` @@ -8329,8 +9738,7 @@ func (s DeleteNetworkProfileOutput) GoString() string { type DeleteProjectInput struct { _ struct{} `type:"structure"` - // Represents the Amazon Resource Name (ARN) of the Device Farm project you - // wish to delete. + // Represents the Amazon Resource Name (ARN) of the Device Farm project to delete. // // Arn is a required field Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` @@ -8446,30 +9854,86 @@ func (s DeleteRemoteAccessSessionOutput) GoString() string { type DeleteRunInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) for the run you wish to delete. + // The Amazon Resource Name (ARN) for the run to delete. // // Arn is a required field Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` } // String returns the string representation -func (s DeleteRunInput) String() string { +func (s DeleteRunInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRunInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteRunInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteRunInput"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.Arn != nil && len(*s.Arn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 32)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *DeleteRunInput) SetArn(v string) *DeleteRunInput { + s.Arn = &v + return s +} + +// Represents the result of a delete run request. +type DeleteRunOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteRunOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRunOutput) GoString() string { + return s.String() +} + +type DeleteTestGridProjectInput struct { + _ struct{} `type:"structure"` + + // The ARN of the project to delete, from CreateTestGridProject or ListTestGridProjects. + // + // ProjectArn is a required field + ProjectArn *string `locationName:"projectArn" min:"32" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteTestGridProjectInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteRunInput) GoString() string { +func (s DeleteTestGridProjectInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRunInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRunInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) +func (s *DeleteTestGridProjectInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTestGridProjectInput"} + if s.ProjectArn == nil { + invalidParams.Add(request.NewErrParamRequired("ProjectArn")) } - if s.Arn != nil && len(*s.Arn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 32)) + if s.ProjectArn != nil && len(*s.ProjectArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("ProjectArn", 32)) } if invalidParams.Len() > 0 { @@ -8478,24 +9942,23 @@ func (s *DeleteRunInput) Validate() error { return nil } -// SetArn sets the Arn field's value. -func (s *DeleteRunInput) SetArn(v string) *DeleteRunInput { - s.Arn = &v +// SetProjectArn sets the ProjectArn field's value. +func (s *DeleteTestGridProjectInput) SetProjectArn(v string) *DeleteTestGridProjectInput { + s.ProjectArn = &v return s } -// Represents the result of a delete run request. -type DeleteRunOutput struct { +type DeleteTestGridProjectOutput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s DeleteRunOutput) String() string { +func (s DeleteTestGridProjectOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteRunOutput) GoString() string { +func (s DeleteTestGridProjectOutput) GoString() string { return s.String() } @@ -8503,8 +9966,7 @@ func (s DeleteRunOutput) GoString() string { type DeleteUploadInput struct { _ struct{} `type:"structure"` - // Represents the Amazon Resource Name (ARN) of the Device Farm upload you wish - // to delete. + // Represents the Amazon Resource Name (ARN) of the Device Farm upload to delete. // // Arn is a required field Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` @@ -8620,8 +10082,8 @@ type Device struct { // The device's ARN. Arn *string `locationName:"arn" min:"32" type:"string"` - // Reflects how likely a device will be available for a test run. It is currently - // available in the ListDevices and GetDevice API methods. + // Indicates how likely a device is available for a test run. Currently available + // in the ListDevices and GetDevice API methods. Availability *string `locationName:"availability" type:"string" enum:"DeviceAvailability"` // The device's carrier. @@ -8633,17 +10095,17 @@ type Device struct { // The name of the fleet to which this device belongs. FleetName *string `locationName:"fleetName" type:"string"` - // The type of fleet to which this device belongs. Possible values for fleet - // type are PRIVATE and PUBLIC. + // The type of fleet to which this device belongs. Possible values are PRIVATE + // and PUBLIC. FleetType *string `locationName:"fleetType" type:"string"` // The device's form factor. // // Allowed values include: // - // * PHONE: The phone form factor. + // * PHONE // - // * TABLET: The tablet form factor. + // * TABLET FormFactor *string `locationName:"formFactor" type:"string" enum:"DeviceFormFactor"` // The device's heap size, expressed in bytes. @@ -8652,7 +10114,7 @@ type Device struct { // The device's image name. Image *string `locationName:"image" type:"string"` - // The instances belonging to this device. + // The instances that belong to this device. Instances []*DeviceInstance `locationName:"instances" type:"list"` // The device's manufacturer name. @@ -8677,9 +10139,9 @@ type Device struct { // // Allowed values include: // - // * ANDROID: The Android platform. + // * ANDROID // - // * IOS: The iOS platform. + // * IOS Platform *string `locationName:"platform" type:"string" enum:"DevicePlatform"` // The device's radio. @@ -8689,6 +10151,8 @@ type Device struct { RemoteAccessEnabled *bool `locationName:"remoteAccessEnabled" type:"boolean"` // This flag is set to true if remote debugging is enabled for the device. + // + // Remote debugging is no longer supported (https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html). RemoteDebugEnabled *bool `locationName:"remoteDebugEnabled" type:"boolean"` // The resolution of the device. @@ -8849,62 +10313,65 @@ type DeviceFilter struct { // // ARN // - // The Amazon Resource Name (ARN) of the device. For example, "arn:aws:devicefarm:us-west-2::device:12345Example". + // The Amazon Resource Name (ARN) of the device (for example, arn:aws:devicefarm:us-west-2::device:12345Example). // // Supported operators: EQUALS, IN, NOT_IN // // PLATFORM // - // The device platform. Valid values are "ANDROID" or "IOS". + // The device platform. Valid values are ANDROID or IOS. // // Supported operators: EQUALS // // OS_VERSION // - // The operating system version. For example, "10.3.2". + // The operating system version (for example, 10.3.2). // // Supported operators: EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUALS, IN, LESS_THAN, // LESS_THAN_OR_EQUALS, NOT_IN // // MODEL // - // The device model. For example, "iPad 5th Gen". + // The device model (for example, iPad 5th Gen). // // Supported operators: CONTAINS, EQUALS, IN, NOT_IN // // AVAILABILITY // - // The current availability of the device. Valid values are "AVAILABLE", "HIGHLY_AVAILABLE", - // "BUSY", or "TEMPORARY_NOT_AVAILABLE". + // The current availability of the device. Valid values are AVAILABLE, HIGHLY_AVAILABLE, + // BUSY, or TEMPORARY_NOT_AVAILABLE. // // Supported operators: EQUALS // // FORM_FACTOR // - // The device form factor. Valid values are "PHONE" or "TABLET". + // The device form factor. Valid values are PHONE or TABLET. // // Supported operators: EQUALS // // MANUFACTURER // - // The device manufacturer. For example, "Apple". + // The device manufacturer (for example, Apple). // // Supported operators: EQUALS, IN, NOT_IN // // REMOTE_ACCESS_ENABLED // - // Whether the device is enabled for remote access. Valid values are "TRUE" - // or "FALSE". + // Whether the device is enabled for remote access. Valid values are TRUE or + // FALSE. // // Supported operators: EQUALS // // REMOTE_DEBUG_ENABLED // - // Whether the device is enabled for remote debugging. Valid values are "TRUE" - // or "FALSE". + // Whether the device is enabled for remote debugging. Valid values are TRUE + // or FALSE. // // Supported operators: EQUALS // + // Because remote debugging is no longer supported (https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html), + // this filter is ignored. + // // INSTANCE_ARN // // The Amazon Resource Name (ARN) of the device instance. @@ -8919,13 +10386,13 @@ type DeviceFilter struct { // // FLEET_TYPE // - // The fleet type. Valid values are "PUBLIC" or "PRIVATE". + // The fleet type. Valid values are PUBLIC or PRIVATE. // // Supported operators: EQUALS Attribute *string `locationName:"attribute" type:"string" enum:"DeviceFilterAttribute"` - // Specifies how Device Farm compares the filter's attribute to the value. For - // the operators that are supported by each attribute, see the attribute descriptions. + // Specifies how Device Farm compares the filter's attribute to the value. See + // the attribute descriptions. Operator *string `locationName:"operator" type:"string" enum:"RuleOperator"` // An array of one or more filter values used in a device filter. @@ -8939,14 +10406,14 @@ type DeviceFilter struct { // // Attribute Values // - // * The PLATFORM attribute can be set to "ANDROID" or "IOS". + // * The PLATFORM attribute can be set to ANDROID or IOS. // - // * The AVAILABILITY attribute can be set to "AVAILABLE", "HIGHLY_AVAILABLE", - // "BUSY", or "TEMPORARY_NOT_AVAILABLE". + // * The AVAILABILITY attribute can be set to AVAILABLE, HIGHLY_AVAILABLE, + // BUSY, or TEMPORARY_NOT_AVAILABLE. // - // * The FORM_FACTOR attribute can be set to "PHONE" or "TABLET". + // * The FORM_FACTOR attribute can be set to PHONE or TABLET. // - // * The FLEET_TYPE attribute can be set to "PUBLIC" or "PRIVATE". + // * The FLEET_TYPE attribute can be set to PUBLIC or PRIVATE. Values []*string `locationName:"values" type:"list"` } @@ -8985,16 +10452,16 @@ type DeviceInstance struct { // The Amazon Resource Name (ARN) of the device instance. Arn *string `locationName:"arn" min:"32" type:"string"` - // The Amazon Resource Name (ARN) of the device. + // The ARN of the device. DeviceArn *string `locationName:"deviceArn" min:"32" type:"string"` - // A object containing information about the instance profile. + // A object that contains information about the instance profile. InstanceProfile *InstanceProfile `locationName:"instanceProfile" type:"structure"` - // An array of strings describing the device instance. + // An array of strings that describe the device instance. Labels []*string `locationName:"labels" type:"list"` - // The status of the device instance. Valid values are listed below. + // The status of the device instance. Valid values are listed here. Status *string `locationName:"status" type:"string" enum:"InstanceStatus"` // Unique device identifier for the device instance. @@ -9104,10 +10571,9 @@ type DevicePool struct { Description *string `locationName:"description" type:"string"` // The number of devices that Device Farm can add to your device pool. Device - // Farm adds devices that are available and that meet the criteria that you - // assign for the rules parameter. Depending on how many devices meet these - // constraints, your device pool might contain fewer devices than the value - // for this parameter. + // Farm adds devices that are available and meet the criteria that you assign + // for the rules parameter. Depending on how many devices meet these constraints, + // your device pool might contain fewer devices than the value for this parameter. // // By specifying the maximum number of devices, you can control the costs that // you incur by running tests. @@ -9183,7 +10649,7 @@ type DevicePoolCompatibilityResult struct { // Whether the result was compatible with the device pool. Compatible *bool `locationName:"compatible" type:"boolean"` - // The device (phone or tablet) that you wish to return information about. + // The device (phone or tablet) to return information about. Device *Device `locationName:"device" type:"structure"` // Information about the compatibility. @@ -9218,8 +10684,8 @@ func (s *DevicePoolCompatibilityResult) SetIncompatibilityMessages(v []*Incompat return s } -// Represents the device filters used in a test run as well as the maximum number -// of devices to be included in the run. It is passed in as the deviceSelectionConfiguration +// Represents the device filters used in a test run and the maximum number of +// devices to be included in the run. It is passed in as the deviceSelectionConfiguration // request parameter in ScheduleRun. type DeviceSelectionConfiguration struct { _ struct{} `type:"structure"` @@ -9229,19 +10695,20 @@ type DeviceSelectionConfiguration struct { // // * Attribute The aspect of a device such as platform or model used as the // selection criteria in a device filter. Allowed values include: ARN: The - // Amazon Resource Name (ARN) of the device. For example, "arn:aws:devicefarm:us-west-2::device:12345Example". - // PLATFORM: The device platform. Valid values are "ANDROID" or "IOS". OS_VERSION: - // The operating system version. For example, "10.3.2". MODEL: The device - // model. For example, "iPad 5th Gen". AVAILABILITY: The current availability - // of the device. Valid values are "AVAILABLE", "HIGHLY_AVAILABLE", "BUSY", - // or "TEMPORARY_NOT_AVAILABLE". FORM_FACTOR: The device form factor. Valid - // values are "PHONE" or "TABLET". MANUFACTURER: The device manufacturer. - // For example, "Apple". REMOTE_ACCESS_ENABLED: Whether the device is enabled - // for remote access. Valid values are "TRUE" or "FALSE". REMOTE_DEBUG_ENABLED: - // Whether the device is enabled for remote debugging. Valid values are "TRUE" - // or "FALSE". INSTANCE_ARN: The Amazon Resource Name (ARN) of the device - // instance. INSTANCE_LABELS: The label of the device instance. FLEET_TYPE: - // The fleet type. Valid values are "PUBLIC" or "PRIVATE". + // Amazon Resource Name (ARN) of the device (for example, arn:aws:devicefarm:us-west-2::device:12345Example). + // PLATFORM: The device platform. Valid values are ANDROID or IOS. OS_VERSION: + // The operating system version (for example, 10.3.2). MODEL: The device + // model (for example, iPad 5th Gen). AVAILABILITY: The current availability + // of the device. Valid values are AVAILABLE, HIGHLY_AVAILABLE, BUSY, or + // TEMPORARY_NOT_AVAILABLE. FORM_FACTOR: The device form factor. Valid values + // are PHONE or TABLET. MANUFACTURER: The device manufacturer (for example, + // Apple). REMOTE_ACCESS_ENABLED: Whether the device is enabled for remote + // access. Valid values are TRUE or FALSE. REMOTE_DEBUG_ENABLED: Whether + // the device is enabled for remote debugging. Valid values are TRUE or FALSE. + // Because remote debugging is no longer supported (https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html), + // this filter is ignored. INSTANCE_ARN: The Amazon Resource Name (ARN) of + // the device instance. INSTANCE_LABELS: The label of the device instance. + // FLEET_TYPE: The fleet type. Valid values are PUBLIC or PRIVATE. // // * Operator The filter operator. The EQUALS operator is available for every // attribute except INSTANCE_LABELS. The CONTAINS operator is available for @@ -9253,10 +10720,10 @@ type DeviceSelectionConfiguration struct { // * Values An array of one or more filter values. Operator Values The IN // and NOT_IN operators can take a values array that has more than one element. // The other operators require an array with a single element. Attribute - // Values The PLATFORM attribute can be set to "ANDROID" or "IOS". The AVAILABILITY - // attribute can be set to "AVAILABLE", "HIGHLY_AVAILABLE", "BUSY", or "TEMPORARY_NOT_AVAILABLE". - // The FORM_FACTOR attribute can be set to "PHONE" or "TABLET". The FLEET_TYPE - // attribute can be set to "PUBLIC" or "PRIVATE". + // Values The PLATFORM attribute can be set to ANDROID or IOS. The AVAILABILITY + // attribute can be set to AVAILABLE, HIGHLY_AVAILABLE, BUSY, or TEMPORARY_NOT_AVAILABLE. + // The FORM_FACTOR attribute can be set to PHONE or TABLET. The FLEET_TYPE + // attribute can be set to PUBLIC or PRIVATE. // // Filters is a required field Filters []*DeviceFilter `locationName:"filters" type:"list" required:"true"` @@ -9306,8 +10773,8 @@ func (s *DeviceSelectionConfiguration) SetMaxDevices(v int64) *DeviceSelectionCo } // Contains the run results requested by the device selection configuration -// as well as how many devices were returned. For an example of the JSON response -// syntax, see ScheduleRun. +// and how many devices were returned. For an example of the JSON response syntax, +// see ScheduleRun. type DeviceSelectionResult struct { _ struct{} `type:"structure"` @@ -9355,27 +10822,26 @@ func (s *DeviceSelectionResult) SetMaxDevices(v int64) *DeviceSelectionResult { type ExecutionConfiguration struct { _ struct{} `type:"structure"` - // True if account cleanup is enabled at the beginning of the test; otherwise, + // True if account cleanup is enabled at the beginning of the test. Otherwise, // false. AccountsCleanup *bool `locationName:"accountsCleanup" type:"boolean"` - // True if app package cleanup is enabled at the beginning of the test; otherwise, + // True if app package cleanup is enabled at the beginning of the test. Otherwise, // false. AppPackagesCleanup *bool `locationName:"appPackagesCleanup" type:"boolean"` - // The number of minutes a test run will execute before it times out. + // The number of minutes a test run executes before it times out. JobTimeoutMinutes *int64 `locationName:"jobTimeoutMinutes" type:"integer"` - // When set to true, for private devices, Device Farm will not sign your app - // again. For public devices, Device Farm always signs your apps again and this - // parameter has no effect. + // When set to true, for private devices, Device Farm does not sign your app + // again. For public devices, Device Farm always signs your apps again. // - // For more information about how Device Farm re-signs your app(s), see Do you + // For more information about how Device Farm re-signs your apps, see Do you // modify my app? (https://aws.amazon.com/device-farm/faq/) in the AWS Device // Farm FAQs. SkipAppResign *bool `locationName:"skipAppResign" type:"boolean"` - // Set to true to enable video capture; otherwise, set to false. The default + // Set to true to enable video capture. Otherwise, set to false. The default // is true. VideoCapture *bool `locationName:"videoCapture" type:"boolean"` } @@ -9547,7 +11013,7 @@ func (s *GetDeviceInstanceInput) SetArn(v string) *GetDeviceInstanceInput { type GetDeviceInstanceOutput struct { _ struct{} `type:"structure"` - // An object containing information about your device instance. + // An object that contains information about your device instance. DeviceInstance *DeviceInstance `locationName:"deviceInstance" type:"structure"` } @@ -9571,7 +11037,7 @@ func (s *GetDeviceInstanceOutput) SetDeviceInstance(v *DeviceInstance) *GetDevic type GetDeviceOutput struct { _ struct{} `type:"structure"` - // An object containing information about the requested device. + // An object that contains information about the requested device. Device *Device `locationName:"device" type:"structure"` } @@ -9598,7 +11064,7 @@ type GetDevicePoolCompatibilityInput struct { // The ARN of the app that is associated with the specified device pool. AppArn *string `locationName:"appArn" min:"32" type:"string"` - // An object containing information about the settings for a run. + // An object that contains information about the settings for a run. Configuration *ScheduleRunConfiguration `locationName:"configuration" type:"structure"` // The device pool's ARN. @@ -9613,43 +11079,42 @@ type GetDevicePoolCompatibilityInput struct { // // Allowed values include the following: // - // * BUILTIN_FUZZ: The built-in fuzz type. + // * BUILTIN_FUZZ. // - // * BUILTIN_EXPLORER: For Android, an app explorer that will traverse an - // Android app, interacting with it and capturing screenshots at the same - // time. + // * BUILTIN_EXPLORER. For Android, an app explorer that traverses an Android + // app, interacting with it and capturing screenshots at the same time. // - // * APPIUM_JAVA_JUNIT: The Appium Java JUnit type. + // * APPIUM_JAVA_JUNIT. // - // * APPIUM_JAVA_TESTNG: The Appium Java TestNG type. + // * APPIUM_JAVA_TESTNG. // - // * APPIUM_PYTHON: The Appium Python type. + // * APPIUM_PYTHON. // - // * APPIUM_NODE: The Appium Node.js type. + // * APPIUM_NODE. // - // * APPIUM_RUBY: The Appium Ruby type. + // * APPIUM_RUBY. // - // * APPIUM_WEB_JAVA_JUNIT: The Appium Java JUnit type for web apps. + // * APPIUM_WEB_JAVA_JUNIT. // - // * APPIUM_WEB_JAVA_TESTNG: The Appium Java TestNG type for web apps. + // * APPIUM_WEB_JAVA_TESTNG. // - // * APPIUM_WEB_PYTHON: The Appium Python type for web apps. + // * APPIUM_WEB_PYTHON. // - // * APPIUM_WEB_NODE: The Appium Node.js type for web apps. + // * APPIUM_WEB_NODE. // - // * APPIUM_WEB_RUBY: The Appium Ruby type for web apps. + // * APPIUM_WEB_RUBY. // - // * CALABASH: The Calabash type. + // * CALABASH. // - // * INSTRUMENTATION: The Instrumentation type. + // * INSTRUMENTATION. // - // * UIAUTOMATION: The uiautomation type. + // * UIAUTOMATION. // - // * UIAUTOMATOR: The uiautomator type. + // * UIAUTOMATOR. // - // * XCTEST: The Xcode test type. + // * XCTEST. // - // * XCTEST_UI: The Xcode UI test type. + // * XCTEST_UI. TestType *string `locationName:"testType" type:"string" enum:"TestType"` } @@ -9801,7 +11266,7 @@ func (s *GetDevicePoolInput) SetArn(v string) *GetDevicePoolInput { type GetDevicePoolOutput struct { _ struct{} `type:"structure"` - // An object containing information about the requested device pool. + // An object that contains information about the requested device pool. DevicePool *DevicePool `locationName:"devicePool" type:"structure"` } @@ -9824,7 +11289,7 @@ func (s *GetDevicePoolOutput) SetDevicePool(v *DevicePool) *GetDevicePoolOutput type GetInstanceProfileInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of your instance profile. + // The Amazon Resource Name (ARN) of an instance profile. // // Arn is a required field Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` @@ -9865,7 +11330,7 @@ func (s *GetInstanceProfileInput) SetArn(v string) *GetInstanceProfileInput { type GetInstanceProfileOutput struct { _ struct{} `type:"structure"` - // An object containing information about your instance profile. + // An object that contains information about an instance profile. InstanceProfile *InstanceProfile `locationName:"instanceProfile" type:"structure"` } @@ -9931,7 +11396,7 @@ func (s *GetJobInput) SetArn(v string) *GetJobInput { type GetJobOutput struct { _ struct{} `type:"structure"` - // An object containing information about the requested job. + // An object that contains information about the requested job. Job *Job `locationName:"job" type:"structure"` } @@ -9954,8 +11419,7 @@ func (s *GetJobOutput) SetJob(v *Job) *GetJobOutput { type GetNetworkProfileInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the network profile you want to return - // information about. + // The ARN of the network profile to return information about. // // Arn is a required field Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` @@ -10144,7 +11608,7 @@ func (s *GetProjectInput) SetArn(v string) *GetProjectInput { type GetProjectOutput struct { _ struct{} `type:"structure"` - // The project you wish to get information about. + // The project to get information about. Project *Project `locationName:"project" type:"structure"` } @@ -10279,7 +11743,7 @@ func (s *GetRunInput) SetArn(v string) *GetRunInput { type GetRunOutput struct { _ struct{} `type:"structure"` - // The run you wish to get results from. + // The run to get results from. Run *Run `locationName:"run" type:"structure"` } @@ -10365,6 +11829,155 @@ func (s *GetSuiteOutput) SetSuite(v *Suite) *GetSuiteOutput { return s } +type GetTestGridProjectInput struct { + _ struct{} `type:"structure"` + + // The ARN of the Selenium testing project, from either CreateTestGridProject + // or ListTestGridProjects. + // + // ProjectArn is a required field + ProjectArn *string `locationName:"projectArn" min:"32" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetTestGridProjectInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTestGridProjectInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetTestGridProjectInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetTestGridProjectInput"} + if s.ProjectArn == nil { + invalidParams.Add(request.NewErrParamRequired("ProjectArn")) + } + if s.ProjectArn != nil && len(*s.ProjectArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("ProjectArn", 32)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetProjectArn sets the ProjectArn field's value. +func (s *GetTestGridProjectInput) SetProjectArn(v string) *GetTestGridProjectInput { + s.ProjectArn = &v + return s +} + +type GetTestGridProjectOutput struct { + _ struct{} `type:"structure"` + + // A TestGridProject. + TestGridProject *TestGridProject `locationName:"testGridProject" type:"structure"` +} + +// String returns the string representation +func (s GetTestGridProjectOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTestGridProjectOutput) GoString() string { + return s.String() +} + +// SetTestGridProject sets the TestGridProject field's value. +func (s *GetTestGridProjectOutput) SetTestGridProject(v *TestGridProject) *GetTestGridProjectOutput { + s.TestGridProject = v + return s +} + +type GetTestGridSessionInput struct { + _ struct{} `type:"structure"` + + // The ARN for the project that this session belongs to. See CreateTestGridProject + // and ListTestGridProjects. + ProjectArn *string `locationName:"projectArn" min:"32" type:"string"` + + // An ARN that uniquely identifies a TestGridSession. + SessionArn *string `locationName:"sessionArn" min:"32" type:"string"` + + // An ID associated with this session. + SessionId *string `locationName:"sessionId" min:"1" type:"string"` +} + +// String returns the string representation +func (s GetTestGridSessionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTestGridSessionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetTestGridSessionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetTestGridSessionInput"} + if s.ProjectArn != nil && len(*s.ProjectArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("ProjectArn", 32)) + } + if s.SessionArn != nil && len(*s.SessionArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("SessionArn", 32)) + } + if s.SessionId != nil && len(*s.SessionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SessionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetProjectArn sets the ProjectArn field's value. +func (s *GetTestGridSessionInput) SetProjectArn(v string) *GetTestGridSessionInput { + s.ProjectArn = &v + return s +} + +// SetSessionArn sets the SessionArn field's value. +func (s *GetTestGridSessionInput) SetSessionArn(v string) *GetTestGridSessionInput { + s.SessionArn = &v + return s +} + +// SetSessionId sets the SessionId field's value. +func (s *GetTestGridSessionInput) SetSessionId(v string) *GetTestGridSessionInput { + s.SessionId = &v + return s +} + +type GetTestGridSessionOutput struct { + _ struct{} `type:"structure"` + + // The TestGridSession that was requested. + TestGridSession *TestGridSession `locationName:"testGridSession" type:"structure"` +} + +// String returns the string representation +func (s GetTestGridSessionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTestGridSessionOutput) GoString() string { + return s.String() +} + +// SetTestGridSession sets the TestGridSession field's value. +func (s *GetTestGridSessionOutput) SetTestGridSession(v *TestGridSession) *GetTestGridSessionOutput { + s.TestGridSession = v + return s +} + // Represents a request to the get test operation. type GetTestInput struct { _ struct{} `type:"structure"` @@ -10542,7 +12155,7 @@ func (s *GetVPCEConfigurationInput) SetArn(v string) *GetVPCEConfigurationInput type GetVPCEConfigurationOutput struct { _ struct{} `type:"structure"` - // An object containing information about your VPC endpoint configuration. + // An object that contains information about your VPC endpoint configuration. VpceConfiguration *VPCEConfiguration `locationName:"vpceConfiguration" type:"structure"` } @@ -10562,6 +12175,63 @@ func (s *GetVPCEConfigurationOutput) SetVpceConfiguration(v *VPCEConfiguration) return s } +// An entity with the same name already exists. +type IdempotencyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Any additional information about the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s IdempotencyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IdempotencyException) GoString() string { + return s.String() +} + +func newErrorIdempotencyException(v protocol.ResponseMetadata) error { + return &IdempotencyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IdempotencyException) Code() string { + return "IdempotencyException" +} + +// Message returns the exception's message. +func (s IdempotencyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IdempotencyException) OrigErr() error { + return nil +} + +func (s IdempotencyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IdempotencyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IdempotencyException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents information about incompatibility. type IncompatibilityMessage struct { _ struct{} `type:"structure"` @@ -10573,17 +12243,17 @@ type IncompatibilityMessage struct { // // Allowed values include: // - // * ARN: The ARN. + // * ARN // - // * FORM_FACTOR: The form factor (for example, phone or tablet). + // * FORM_FACTOR (for example, phone or tablet) // - // * MANUFACTURER: The manufacturer. + // * MANUFACTURER // - // * PLATFORM: The platform (for example, Android or iOS). + // * PLATFORM (for example, Android or iOS) // - // * REMOTE_ACCESS_ENABLED: Whether the device is enabled for remote access. + // * REMOTE_ACCESS_ENABLED // - // * APPIUM_VERSION: The Appium version for the test. + // * APPIUM_VERSION Type *string `locationName:"type" type:"string" enum:"DeviceAttribute"` } @@ -10614,8 +12284,7 @@ func (s *IncompatibilityMessage) SetType(v string) *IncompatibilityMessage { type InstallToRemoteAccessSessionInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the app about which you are requesting - // information. + // The ARN of the app about which you are requesting information. // // AppArn is a required field AppArn *string `locationName:"appArn" min:"32" type:"string" required:"true"` @@ -10706,21 +12375,21 @@ type InstanceProfile struct { // The description of the instance profile. Description *string `locationName:"description" type:"string"` - // An array of strings specifying the list of app packages that should not be - // cleaned up from the device after a test run is over. + // An array of strings containing the list of app packages that should not be + // cleaned up from the device after a test run completes. // - // The list of packages is only considered if you set packageCleanup to true. + // The list of packages is considered only if you set packageCleanup to true. ExcludeAppPackagesFromCleanup []*string `locationName:"excludeAppPackagesFromCleanup" type:"list"` // The name of the instance profile. Name *string `locationName:"name" type:"string"` - // When set to true, Device Farm will remove app packages after a test run. - // The default value is false for private devices. + // When set to true, Device Farm removes app packages after a test run. The + // default value is false for private devices. PackageCleanup *bool `locationName:"packageCleanup" type:"boolean"` - // When set to true, Device Farm will reboot the instance after a test run. - // The default value is true. + // When set to true, Device Farm reboots the instance after a test run. The + // default value is true. RebootAfterUse *bool `locationName:"rebootAfterUse" type:"boolean"` } @@ -10770,6 +12439,120 @@ func (s *InstanceProfile) SetRebootAfterUse(v bool) *InstanceProfile { return s } +// An internal exception was raised in the service. Contact aws-devicefarm-support@amazon.com +// (mailto:aws-devicefarm-support@amazon.com) if you see this error. +type InternalServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServiceException) GoString() string { + return s.String() +} + +func newErrorInternalServiceException(v protocol.ResponseMetadata) error { + return &InternalServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServiceException) Code() string { + return "InternalServiceException" +} + +// Message returns the exception's message. +func (s InternalServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServiceException) OrigErr() error { + return nil +} + +func (s InternalServiceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServiceException) RequestID() string { + return s.respMetadata.RequestID +} + +// There was an error with the update request, or you do not have sufficient +// permissions to update this VPC endpoint configuration. +type InvalidOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidOperationException) GoString() string { + return s.String() +} + +func newErrorInvalidOperationException(v protocol.ResponseMetadata) error { + return &InvalidOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidOperationException) Code() string { + return "InvalidOperationException" +} + +// Message returns the exception's message. +func (s InvalidOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidOperationException) OrigErr() error { + return nil +} + +func (s InvalidOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidOperationException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents a device. type Job struct { _ struct{} `type:"structure"` @@ -10789,7 +12572,7 @@ type Job struct { // Represents the total (metered or unmetered) minutes used by the job. DeviceMinutes *DeviceMinutes `locationName:"deviceMinutes" type:"structure"` - // The Amazon Resource Name (ARN) of the instance. + // The ARN of the instance. InstanceArn *string `locationName:"instanceArn" min:"32" type:"string"` // A message about the job's result. @@ -10802,19 +12585,19 @@ type Job struct { // // Allowed values include: // - // * PENDING: A pending condition. + // * PENDING // - // * PASSED: A passing condition. + // * PASSED // - // * WARNED: A warning condition. + // * WARNED // - // * FAILED: A failed condition. + // * FAILED // - // * SKIPPED: A skipped condition. + // * SKIPPED // - // * ERRORED: An error condition. + // * ERRORED // - // * STOPPED: A stopped condition. + // * STOPPED Result *string `locationName:"result" type:"string" enum:"ExecutionResult"` // The job's start time. @@ -10824,23 +12607,23 @@ type Job struct { // // Allowed values include: // - // * PENDING: A pending status. + // * PENDING // - // * PENDING_CONCURRENCY: A pending concurrency status. + // * PENDING_CONCURRENCY // - // * PENDING_DEVICE: A pending device status. + // * PENDING_DEVICE // - // * PROCESSING: A processing status. + // * PROCESSING // - // * SCHEDULING: A scheduling status. + // * SCHEDULING // - // * PREPARING: A preparing status. + // * PREPARING // - // * RUNNING: A running status. + // * RUNNING // - // * COMPLETED: A completed status. + // * COMPLETED // - // * STOPPING: A stopping status. + // * STOPPING Status *string `locationName:"status" type:"string" enum:"ExecutionStatus"` // The job's stop time. @@ -10850,46 +12633,45 @@ type Job struct { // // Allowed values include the following: // - // * BUILTIN_FUZZ: The built-in fuzz type. + // * BUILTIN_FUZZ // - // * BUILTIN_EXPLORER: For Android, an app explorer that will traverse an - // Android app, interacting with it and capturing screenshots at the same - // time. + // * BUILTIN_EXPLORER. For Android, an app explorer that traverses an Android + // app, interacting with it and capturing screenshots at the same time. // - // * APPIUM_JAVA_JUNIT: The Appium Java JUnit type. + // * APPIUM_JAVA_JUNIT // - // * APPIUM_JAVA_TESTNG: The Appium Java TestNG type. + // * APPIUM_JAVA_TESTNG // - // * APPIUM_PYTHON: The Appium Python type. + // * APPIUM_PYTHON // - // * APPIUM_NODE: The Appium Node.js type. + // * APPIUM_NODE // - // * APPIUM_RUBY: The Appium Ruby type. + // * APPIUM_RUBY // - // * APPIUM_WEB_JAVA_JUNIT: The Appium Java JUnit type for web apps. + // * APPIUM_WEB_JAVA_JUNIT // - // * APPIUM_WEB_JAVA_TESTNG: The Appium Java TestNG type for web apps. + // * APPIUM_WEB_JAVA_TESTNG // - // * APPIUM_WEB_PYTHON: The Appium Python type for web apps. + // * APPIUM_WEB_PYTHON // - // * APPIUM_WEB_NODE: The Appium Node.js type for web apps. + // * APPIUM_WEB_NODE // - // * APPIUM_WEB_RUBY: The Appium Ruby test type for web apps. + // * APPIUM_WEB_RUBY // - // * CALABASH: The Calabash type. + // * CALABASH // - // * INSTRUMENTATION: The Instrumentation type. + // * INSTRUMENTATION // - // * UIAUTOMATION: The uiautomation type. + // * UIAUTOMATION // - // * UIAUTOMATOR: The uiautomator type. + // * UIAUTOMATOR // - // * XCTEST: The Xcode test type. + // * XCTEST // - // * XCTEST_UI: The Xcode UI test type. + // * XCTEST_UI Type *string `locationName:"type" type:"string" enum:"TestType"` - // This value is set to true if video capture is enabled; otherwise, it is set + // This value is set to true if video capture is enabled. Otherwise, it is set // to false. VideoCapture *bool `locationName:"videoCapture" type:"boolean"` @@ -10985,23 +12767,80 @@ func (s *Job) SetType(v string) *Job { return s } -// SetVideoCapture sets the VideoCapture field's value. -func (s *Job) SetVideoCapture(v bool) *Job { - s.VideoCapture = &v - return s +// SetVideoCapture sets the VideoCapture field's value. +func (s *Job) SetVideoCapture(v bool) *Job { + s.VideoCapture = &v + return s +} + +// SetVideoEndpoint sets the VideoEndpoint field's value. +func (s *Job) SetVideoEndpoint(v string) *Job { + s.VideoEndpoint = &v + return s +} + +// A limit was exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Any additional information about the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetVideoEndpoint sets the VideoEndpoint field's value. -func (s *Job) SetVideoEndpoint(v string) *Job { - s.VideoEndpoint = &v - return s +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID } // Represents a request to the list artifacts operation. type ListArtifactsInput struct { _ struct{} `type:"structure"` - // The Run, Job, Suite, or Test ARN. + // The run, job, suite, or test ARN. // // Arn is a required field Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` @@ -11014,11 +12853,11 @@ type ListArtifactsInput struct { // // Allowed values include: // - // * FILE: The artifacts are files. + // * FILE // - // * LOG: The artifacts are logs. + // * LOG // - // * SCREENSHOT: The artifacts are screenshots. + // * SCREENSHOT // // Type is a required field Type *string `locationName:"type" type:"string" required:"true" enum:"ArtifactCategory"` @@ -11082,7 +12921,7 @@ type ListArtifactsOutput struct { Artifacts []*Artifact `locationName:"artifacts" type:"list"` // If the number of items that are returned is significantly large, this is - // an identifier that is also returned, which can be used in a subsequent call + // an identifier that is also returned. It can be used in a subsequent call // to this operation to return the next set of items in the list. NextToken *string `locationName:"nextToken" min:"4" type:"string"` } @@ -11112,8 +12951,8 @@ func (s *ListArtifactsOutput) SetNextToken(v string) *ListArtifactsOutput { type ListDeviceInstancesInput struct { _ struct{} `type:"structure"` - // An integer specifying the maximum number of items you want to return in the - // API response. + // An integer that specifies the maximum number of items you want to return + // in the API response. MaxResults *int64 `locationName:"maxResults" type:"integer"` // An identifier that was returned from the previous call to this operation, @@ -11159,7 +12998,7 @@ func (s *ListDeviceInstancesInput) SetNextToken(v string) *ListDeviceInstancesIn type ListDeviceInstancesOutput struct { _ struct{} `type:"structure"` - // An object containing information about your device instances. + // An object that contains information about your device instances. DeviceInstances []*DeviceInstance `locationName:"deviceInstances" type:"list"` // An identifier that can be used in the next call to this operation to return @@ -11268,7 +13107,7 @@ type ListDevicePoolsOutput struct { DevicePools []*DevicePool `locationName:"devicePools" type:"list"` // If the number of items that are returned is significantly large, this is - // an identifier that is also returned, which can be used in a subsequent call + // an identifier that is also returned. It can be used in a subsequent call // to this operation to return the next set of items in the list. NextToken *string `locationName:"nextToken" min:"4" type:"string"` } @@ -11307,19 +13146,20 @@ type ListDevicesInput struct { // // * Attribute: The aspect of a device such as platform or model used as // the selection criteria in a device filter. Allowed values include: ARN: - // The Amazon Resource Name (ARN) of the device. For example, "arn:aws:devicefarm:us-west-2::device:12345Example". - // PLATFORM: The device platform. Valid values are "ANDROID" or "IOS". OS_VERSION: - // The operating system version. For example, "10.3.2". MODEL: The device - // model. For example, "iPad 5th Gen". AVAILABILITY: The current availability - // of the device. Valid values are "AVAILABLE", "HIGHLY_AVAILABLE", "BUSY", - // or "TEMPORARY_NOT_AVAILABLE". FORM_FACTOR: The device form factor. Valid - // values are "PHONE" or "TABLET". MANUFACTURER: The device manufacturer. - // For example, "Apple". REMOTE_ACCESS_ENABLED: Whether the device is enabled - // for remote access. Valid values are "TRUE" or "FALSE". REMOTE_DEBUG_ENABLED: - // Whether the device is enabled for remote debugging. Valid values are "TRUE" - // or "FALSE". INSTANCE_ARN: The Amazon Resource Name (ARN) of the device - // instance. INSTANCE_LABELS: The label of the device instance. FLEET_TYPE: - // The fleet type. Valid values are "PUBLIC" or "PRIVATE". + // The Amazon Resource Name (ARN) of the device (for example, arn:aws:devicefarm:us-west-2::device:12345Example). + // PLATFORM: The device platform. Valid values are ANDROID or IOS. OS_VERSION: + // The operating system version (for example, 10.3.2). MODEL: The device + // model (for example, iPad 5th Gen). AVAILABILITY: The current availability + // of the device. Valid values are AVAILABLE, HIGHLY_AVAILABLE, BUSY, or + // TEMPORARY_NOT_AVAILABLE. FORM_FACTOR: The device form factor. Valid values + // are PHONE or TABLET. MANUFACTURER: The device manufacturer (for example, + // Apple). REMOTE_ACCESS_ENABLED: Whether the device is enabled for remote + // access. Valid values are TRUE or FALSE. REMOTE_DEBUG_ENABLED: Whether + // the device is enabled for remote debugging. Valid values are TRUE or FALSE. + // Because remote debugging is no longer supported (https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html), + // this attribute is ignored. INSTANCE_ARN: The Amazon Resource Name (ARN) + // of the device instance. INSTANCE_LABELS: The label of the device instance. + // FLEET_TYPE: The fleet type. Valid values are PUBLIC or PRIVATE. // // * Operator: The filter operator. The EQUALS operator is available for // every attribute except INSTANCE_LABELS. The CONTAINS operator is available @@ -11331,8 +13171,8 @@ type ListDevicesInput struct { // * Values: An array of one or more filter values. The IN and NOT_IN operators // take a values array that has one or more elements. The other operators // require an array with a single element. In a request, the AVAILABILITY - // attribute takes "AVAILABLE", "HIGHLY_AVAILABLE", "BUSY", or "TEMPORARY_NOT_AVAILABLE" - // as values. + // attribute takes the following values: AVAILABLE, HIGHLY_AVAILABLE, BUSY, + // or TEMPORARY_NOT_AVAILABLE. Filters []*DeviceFilter `locationName:"filters" type:"list"` // An identifier that was returned from the previous call to this operation, @@ -11392,7 +13232,7 @@ type ListDevicesOutput struct { Devices []*Device `locationName:"devices" type:"list"` // If the number of items that are returned is significantly large, this is - // an identifier that is also returned, which can be used in a subsequent call + // an identifier that is also returned. It can be used in a subsequent call // to this operation to return the next set of items in the list. NextToken *string `locationName:"nextToken" min:"4" type:"string"` } @@ -11422,8 +13262,8 @@ func (s *ListDevicesOutput) SetNextToken(v string) *ListDevicesOutput { type ListInstanceProfilesInput struct { _ struct{} `type:"structure"` - // An integer specifying the maximum number of items you want to return in the - // API response. + // An integer that specifies the maximum number of items you want to return + // in the API response. MaxResults *int64 `locationName:"maxResults" type:"integer"` // An identifier that was returned from the previous call to this operation, @@ -11469,7 +13309,7 @@ func (s *ListInstanceProfilesInput) SetNextToken(v string) *ListInstanceProfiles type ListInstanceProfilesOutput struct { _ struct{} `type:"structure"` - // An object containing information about your instance profiles. + // An object that contains information about your instance profiles. InstanceProfiles []*InstanceProfile `locationName:"instanceProfiles" type:"list"` // An identifier that can be used in the next call to this operation to return @@ -11562,7 +13402,7 @@ type ListJobsOutput struct { Jobs []*Job `locationName:"jobs" type:"list"` // If the number of items that are returned is significantly large, this is - // an identifier that is also returned, which can be used in a subsequent call + // an identifier that is also returned. It can be used in a subsequent call // to this operation to return the next set of items in the list. NextToken *string `locationName:"nextToken" min:"4" type:"string"` } @@ -11602,8 +13442,8 @@ type ListNetworkProfilesInput struct { // which can be used to return the next set of items in the list. NextToken *string `locationName:"nextToken" min:"4" type:"string"` - // The type of network profile you wish to return information about. Valid values - // are listed below. + // The type of network profile to return information about. Valid values are + // listed here. Type *string `locationName:"type" type:"string" enum:"NetworkProfileType"` } @@ -11790,68 +13630,331 @@ func (s *ListOfferingTransactionsInput) Validate() error { } // SetNextToken sets the NextToken field's value. -func (s *ListOfferingTransactionsInput) SetNextToken(v string) *ListOfferingTransactionsInput { +func (s *ListOfferingTransactionsInput) SetNextToken(v string) *ListOfferingTransactionsInput { + s.NextToken = &v + return s +} + +// Returns the transaction log of the specified offerings. +type ListOfferingTransactionsOutput struct { + _ struct{} `type:"structure"` + + // An identifier that was returned from the previous call to this operation, + // which can be used to return the next set of items in the list. + NextToken *string `locationName:"nextToken" min:"4" type:"string"` + + // The audit log of subscriptions you have purchased and modified through AWS + // Device Farm. + OfferingTransactions []*OfferingTransaction `locationName:"offeringTransactions" type:"list"` +} + +// String returns the string representation +func (s ListOfferingTransactionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListOfferingTransactionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListOfferingTransactionsOutput) SetNextToken(v string) *ListOfferingTransactionsOutput { + s.NextToken = &v + return s +} + +// SetOfferingTransactions sets the OfferingTransactions field's value. +func (s *ListOfferingTransactionsOutput) SetOfferingTransactions(v []*OfferingTransaction) *ListOfferingTransactionsOutput { + s.OfferingTransactions = v + return s +} + +// Represents the request to list all offerings. +type ListOfferingsInput struct { + _ struct{} `type:"structure"` + + // An identifier that was returned from the previous call to this operation, + // which can be used to return the next set of items in the list. + NextToken *string `locationName:"nextToken" min:"4" type:"string"` +} + +// String returns the string representation +func (s ListOfferingsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListOfferingsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListOfferingsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListOfferingsInput"} + if s.NextToken != nil && len(*s.NextToken) < 4 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNextToken sets the NextToken field's value. +func (s *ListOfferingsInput) SetNextToken(v string) *ListOfferingsInput { + s.NextToken = &v + return s +} + +// Represents the return values of the list of offerings. +type ListOfferingsOutput struct { + _ struct{} `type:"structure"` + + // An identifier that was returned from the previous call to this operation, + // which can be used to return the next set of items in the list. + NextToken *string `locationName:"nextToken" min:"4" type:"string"` + + // A value that represents the list offering results. + Offerings []*Offering `locationName:"offerings" type:"list"` +} + +// String returns the string representation +func (s ListOfferingsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListOfferingsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListOfferingsOutput) SetNextToken(v string) *ListOfferingsOutput { + s.NextToken = &v + return s +} + +// SetOfferings sets the Offerings field's value. +func (s *ListOfferingsOutput) SetOfferings(v []*Offering) *ListOfferingsOutput { + s.Offerings = v + return s +} + +// Represents a request to the list projects operation. +type ListProjectsInput struct { + _ struct{} `type:"structure"` + + // Optional. If no Amazon Resource Name (ARN) is specified, then AWS Device + // Farm returns a list of all projects for the AWS account. You can also specify + // a project ARN. + Arn *string `locationName:"arn" min:"32" type:"string"` + + // An identifier that was returned from the previous call to this operation, + // which can be used to return the next set of items in the list. + NextToken *string `locationName:"nextToken" min:"4" type:"string"` +} + +// 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.Arn != nil && len(*s.Arn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 32)) + } + if s.NextToken != nil && len(*s.NextToken) < 4 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *ListProjectsInput) SetArn(v string) *ListProjectsInput { + s.Arn = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListProjectsInput) SetNextToken(v string) *ListProjectsInput { + s.NextToken = &v + return s +} + +// Represents the result of a list projects request. +type ListProjectsOutput struct { + _ struct{} `type:"structure"` + + // If the number of items that are returned is significantly large, this is + // an identifier that is also returned. It can be used in a subsequent call + // to this operation to return the next set of items in the list. + NextToken *string `locationName:"nextToken" min:"4" type:"string"` + + // Information about the projects. + Projects []*Project `locationName:"projects" 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 []*Project) *ListProjectsOutput { + s.Projects = v + return s +} + +// Represents the request to return information about the remote access session. +type ListRemoteAccessSessionsInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the project about which you are requesting + // information. + // + // Arn is a required field + Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` + + // An identifier that was returned from the previous call to this operation, + // which can be used to return the next set of items in the list. + NextToken *string `locationName:"nextToken" min:"4" type:"string"` +} + +// String returns the string representation +func (s ListRemoteAccessSessionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListRemoteAccessSessionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListRemoteAccessSessionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListRemoteAccessSessionsInput"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.Arn != nil && len(*s.Arn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 32)) + } + if s.NextToken != nil && len(*s.NextToken) < 4 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *ListRemoteAccessSessionsInput) SetArn(v string) *ListRemoteAccessSessionsInput { + s.Arn = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListRemoteAccessSessionsInput) SetNextToken(v string) *ListRemoteAccessSessionsInput { s.NextToken = &v return s } -// Returns the transaction log of the specified offerings. -type ListOfferingTransactionsOutput struct { +// Represents the response from the server after AWS Device Farm makes a request +// to return information about the remote access session. +type ListRemoteAccessSessionsOutput struct { _ struct{} `type:"structure"` // An identifier that was returned from the previous call to this operation, // which can be used to return the next set of items in the list. NextToken *string `locationName:"nextToken" min:"4" type:"string"` - // The audit log of subscriptions you have purchased and modified through AWS - // Device Farm. - OfferingTransactions []*OfferingTransaction `locationName:"offeringTransactions" type:"list"` + // A container that represents the metadata from the service about each remote + // access session you are requesting. + RemoteAccessSessions []*RemoteAccessSession `locationName:"remoteAccessSessions" type:"list"` } // String returns the string representation -func (s ListOfferingTransactionsOutput) String() string { +func (s ListRemoteAccessSessionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListOfferingTransactionsOutput) GoString() string { +func (s ListRemoteAccessSessionsOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListOfferingTransactionsOutput) SetNextToken(v string) *ListOfferingTransactionsOutput { +func (s *ListRemoteAccessSessionsOutput) SetNextToken(v string) *ListRemoteAccessSessionsOutput { s.NextToken = &v return s } -// SetOfferingTransactions sets the OfferingTransactions field's value. -func (s *ListOfferingTransactionsOutput) SetOfferingTransactions(v []*OfferingTransaction) *ListOfferingTransactionsOutput { - s.OfferingTransactions = v +// SetRemoteAccessSessions sets the RemoteAccessSessions field's value. +func (s *ListRemoteAccessSessionsOutput) SetRemoteAccessSessions(v []*RemoteAccessSession) *ListRemoteAccessSessionsOutput { + s.RemoteAccessSessions = v return s } -// Represents the request to list all offerings. -type ListOfferingsInput struct { +// Represents a request to the list runs operation. +type ListRunsInput struct { _ struct{} `type:"structure"` + // The Amazon Resource Name (ARN) of the project for which you want to list + // runs. + // + // Arn is a required field + Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` + // An identifier that was returned from the previous call to this operation, // which can be used to return the next set of items in the list. NextToken *string `locationName:"nextToken" min:"4" type:"string"` } // String returns the string representation -func (s ListOfferingsInput) String() string { +func (s ListRunsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListOfferingsInput) GoString() string { +func (s ListRunsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListOfferingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListOfferingsInput"} +func (s *ListRunsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListRunsInput"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.Arn != nil && len(*s.Arn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 32)) + } if s.NextToken != nil && len(*s.NextToken) < 4 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) } @@ -11862,54 +13965,61 @@ func (s *ListOfferingsInput) Validate() error { return nil } +// SetArn sets the Arn field's value. +func (s *ListRunsInput) SetArn(v string) *ListRunsInput { + s.Arn = &v + return s +} + // SetNextToken sets the NextToken field's value. -func (s *ListOfferingsInput) SetNextToken(v string) *ListOfferingsInput { +func (s *ListRunsInput) SetNextToken(v string) *ListRunsInput { s.NextToken = &v return s } -// Represents the return values of the list of offerings. -type ListOfferingsOutput struct { +// Represents the result of a list runs request. +type ListRunsOutput struct { _ struct{} `type:"structure"` - // An identifier that was returned from the previous call to this operation, - // which can be used to return the next set of items in the list. + // If the number of items that are returned is significantly large, this is + // an identifier that is also returned. It can be used in a subsequent call + // to this operation to return the next set of items in the list. NextToken *string `locationName:"nextToken" min:"4" type:"string"` - // A value representing the list offering results. - Offerings []*Offering `locationName:"offerings" type:"list"` + // Information about the runs. + Runs []*Run `locationName:"runs" type:"list"` } // String returns the string representation -func (s ListOfferingsOutput) String() string { +func (s ListRunsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListOfferingsOutput) GoString() string { +func (s ListRunsOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListOfferingsOutput) SetNextToken(v string) *ListOfferingsOutput { +func (s *ListRunsOutput) SetNextToken(v string) *ListRunsOutput { s.NextToken = &v return s } -// SetOfferings sets the Offerings field's value. -func (s *ListOfferingsOutput) SetOfferings(v []*Offering) *ListOfferingsOutput { - s.Offerings = v +// SetRuns sets the Runs field's value. +func (s *ListRunsOutput) SetRuns(v []*Run) *ListRunsOutput { + s.Runs = v return s } -// Represents a request to the list projects operation. -type ListProjectsInput struct { +// Represents a request to the list samples operation. +type ListSamplesInput struct { _ struct{} `type:"structure"` - // Optional. If no Amazon Resource Name (ARN) is specified, then AWS Device - // Farm returns a list of all projects for the AWS account. You can also specify - // a project ARN. - Arn *string `locationName:"arn" min:"32" type:"string"` + // The Amazon Resource Name (ARN) of the job used to list samples. + // + // Arn is a required field + Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` // An identifier that was returned from the previous call to this operation, // which can be used to return the next set of items in the list. @@ -11917,18 +14027,21 @@ type ListProjectsInput struct { } // String returns the string representation -func (s ListProjectsInput) String() string { +func (s ListSamplesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListProjectsInput) GoString() string { +func (s ListSamplesInput) 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"} +func (s *ListSamplesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListSamplesInput"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } if s.Arn != nil && len(*s.Arn) < 32 { invalidParams.Add(request.NewErrParamMinLen("Arn", 32)) } @@ -11943,58 +14056,57 @@ func (s *ListProjectsInput) Validate() error { } // SetArn sets the Arn field's value. -func (s *ListProjectsInput) SetArn(v string) *ListProjectsInput { +func (s *ListSamplesInput) SetArn(v string) *ListSamplesInput { s.Arn = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListProjectsInput) SetNextToken(v string) *ListProjectsInput { +func (s *ListSamplesInput) SetNextToken(v string) *ListSamplesInput { s.NextToken = &v return s } -// Represents the result of a list projects request. -type ListProjectsOutput struct { +// Represents the result of a list samples request. +type ListSamplesOutput struct { _ struct{} `type:"structure"` // If the number of items that are returned is significantly large, this is - // an identifier that is also returned, which can be used in a subsequent call + // an identifier that is also returned. It can be used in a subsequent call // to this operation to return the next set of items in the list. NextToken *string `locationName:"nextToken" min:"4" type:"string"` - // Information about the projects. - Projects []*Project `locationName:"projects" type:"list"` + // Information about the samples. + Samples []*Sample `locationName:"samples" type:"list"` } // String returns the string representation -func (s ListProjectsOutput) String() string { +func (s ListSamplesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListProjectsOutput) GoString() string { +func (s ListSamplesOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListProjectsOutput) SetNextToken(v string) *ListProjectsOutput { +func (s *ListSamplesOutput) SetNextToken(v string) *ListSamplesOutput { s.NextToken = &v return s } -// SetProjects sets the Projects field's value. -func (s *ListProjectsOutput) SetProjects(v []*Project) *ListProjectsOutput { - s.Projects = v +// SetSamples sets the Samples field's value. +func (s *ListSamplesOutput) SetSamples(v []*Sample) *ListSamplesOutput { + s.Samples = v return s } -// Represents the request to return information about the remote access session. -type ListRemoteAccessSessionsInput struct { +// Represents a request to the list suites operation. +type ListSuitesInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the remote access session about which you - // are requesting information. + // The job's Amazon Resource Name (ARN). // // Arn is a required field Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` @@ -12005,18 +14117,18 @@ type ListRemoteAccessSessionsInput struct { } // String returns the string representation -func (s ListRemoteAccessSessionsInput) String() string { +func (s ListSuitesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListRemoteAccessSessionsInput) GoString() string { +func (s ListSuitesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListRemoteAccessSessionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRemoteAccessSessionsInput"} +func (s *ListSuitesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListSuitesInput"} if s.Arn == nil { invalidParams.Add(request.NewErrParamRequired("Arn")) } @@ -12034,86 +14146,146 @@ func (s *ListRemoteAccessSessionsInput) Validate() error { } // SetArn sets the Arn field's value. -func (s *ListRemoteAccessSessionsInput) SetArn(v string) *ListRemoteAccessSessionsInput { +func (s *ListSuitesInput) SetArn(v string) *ListSuitesInput { s.Arn = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListRemoteAccessSessionsInput) SetNextToken(v string) *ListRemoteAccessSessionsInput { +func (s *ListSuitesInput) SetNextToken(v string) *ListSuitesInput { s.NextToken = &v return s } -// Represents the response from the server after AWS Device Farm makes a request -// to return information about the remote access session. -type ListRemoteAccessSessionsOutput struct { +// Represents the result of a list suites request. +type ListSuitesOutput struct { _ struct{} `type:"structure"` - // An identifier that was returned from the previous call to this operation, - // which can be used to return the next set of items in the list. + // If the number of items that are returned is significantly large, this is + // an identifier that is also returned. It can be used in a subsequent call + // to this operation to return the next set of items in the list. NextToken *string `locationName:"nextToken" min:"4" type:"string"` - // A container representing the metadata from the service about each remote - // access session you are requesting. - RemoteAccessSessions []*RemoteAccessSession `locationName:"remoteAccessSessions" type:"list"` + // Information about the suites. + Suites []*Suite `locationName:"suites" type:"list"` } // String returns the string representation -func (s ListRemoteAccessSessionsOutput) String() string { +func (s ListSuitesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListRemoteAccessSessionsOutput) GoString() string { +func (s ListSuitesOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListRemoteAccessSessionsOutput) SetNextToken(v string) *ListRemoteAccessSessionsOutput { +func (s *ListSuitesOutput) SetNextToken(v string) *ListSuitesOutput { s.NextToken = &v return s } -// SetRemoteAccessSessions sets the RemoteAccessSessions field's value. -func (s *ListRemoteAccessSessionsOutput) SetRemoteAccessSessions(v []*RemoteAccessSession) *ListRemoteAccessSessionsOutput { - s.RemoteAccessSessions = v +// SetSuites sets the Suites field's value. +func (s *ListSuitesOutput) SetSuites(v []*Suite) *ListSuitesOutput { + s.Suites = v return s } -// Represents a request to the list runs operation. -type ListRunsInput struct { +type ListTagsForResourceInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the project for which you want to list - // runs. + // The Amazon Resource Name (ARN) of the resource or resources for which to + // list tags. You can associate tags with the following Device Farm resources: + // PROJECT, RUN, NETWORK_PROFILE, INSTANCE_PROFILE, DEVICE_INSTANCE, SESSION, + // DEVICE_POOL, DEVICE, and VPCE_CONFIGURATION. // - // Arn is a required field - Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` + // ResourceARN is a required field + ResourceARN *string `min:"32" type:"string" required:"true"` +} - // An identifier that was returned from the previous call to this operation, - // which can be used to return the next set of items in the list. +// 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) < 32 { + invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 32)) + } + + 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 +} + +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // The tags to add to the resource. A tag is an array of key-value pairs. Tag + // keys can have a maximum character length of 128 characters. Tag values can + // have a maximum length of 256 characters. + 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() +} + +// SetTags sets the Tags field's value. +func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { + s.Tags = v + return s +} + +type ListTestGridProjectsInput struct { + _ struct{} `type:"structure"` + + // Return no more than this number of results. + MaxResult *int64 `locationName:"maxResult" min:"1" type:"integer"` + + // From a response, used to continue a paginated listing. NextToken *string `locationName:"nextToken" min:"4" type:"string"` } // String returns the string representation -func (s ListRunsInput) String() string { +func (s ListTestGridProjectsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListRunsInput) GoString() string { +func (s ListTestGridProjectsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListRunsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRunsInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 32)) +func (s *ListTestGridProjectsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTestGridProjectsInput"} + if s.MaxResult != nil && *s.MaxResult < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResult", 1)) } if s.NextToken != nil && len(*s.NextToken) < 4 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) @@ -12125,89 +14297,91 @@ func (s *ListRunsInput) Validate() error { return nil } -// SetArn sets the Arn field's value. -func (s *ListRunsInput) SetArn(v string) *ListRunsInput { - s.Arn = &v +// SetMaxResult sets the MaxResult field's value. +func (s *ListTestGridProjectsInput) SetMaxResult(v int64) *ListTestGridProjectsInput { + s.MaxResult = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListRunsInput) SetNextToken(v string) *ListRunsInput { +func (s *ListTestGridProjectsInput) SetNextToken(v string) *ListTestGridProjectsInput { s.NextToken = &v return s } - -// Represents the result of a list runs request. -type ListRunsOutput struct { + +type ListTestGridProjectsOutput struct { _ struct{} `type:"structure"` - // If the number of items that are returned is significantly large, this is - // an identifier that is also returned, which can be used in a subsequent call - // to this operation to return the next set of items in the list. + // Used for pagination. Pass into ListTestGridProjects to get more results in + // a paginated request. NextToken *string `locationName:"nextToken" min:"4" type:"string"` - // Information about the runs. - Runs []*Run `locationName:"runs" type:"list"` + // The list of TestGridProjects, based on a ListTestGridProjectsRequest. + TestGridProjects []*TestGridProject `locationName:"testGridProjects" type:"list"` } // String returns the string representation -func (s ListRunsOutput) String() string { +func (s ListTestGridProjectsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListRunsOutput) GoString() string { +func (s ListTestGridProjectsOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListRunsOutput) SetNextToken(v string) *ListRunsOutput { +func (s *ListTestGridProjectsOutput) SetNextToken(v string) *ListTestGridProjectsOutput { s.NextToken = &v return s } -// SetRuns sets the Runs field's value. -func (s *ListRunsOutput) SetRuns(v []*Run) *ListRunsOutput { - s.Runs = v +// SetTestGridProjects sets the TestGridProjects field's value. +func (s *ListTestGridProjectsOutput) SetTestGridProjects(v []*TestGridProject) *ListTestGridProjectsOutput { + s.TestGridProjects = v return s } -// Represents a request to the list samples operation. -type ListSamplesInput struct { +type ListTestGridSessionActionsInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the job used to list samples. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` + // The maximum number of sessions to return per response. + MaxResult *int64 `locationName:"maxResult" min:"1" type:"integer"` - // An identifier that was returned from the previous call to this operation, - // which can be used to return the next set of items in the list. + // Pagination token. NextToken *string `locationName:"nextToken" min:"4" type:"string"` + + // The ARN of the session to retrieve. + // + // SessionArn is a required field + SessionArn *string `locationName:"sessionArn" min:"32" type:"string" required:"true"` } // String returns the string representation -func (s ListSamplesInput) String() string { +func (s ListTestGridSessionActionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListSamplesInput) GoString() string { +func (s ListTestGridSessionActionsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListSamplesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSamplesInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 32)) +func (s *ListTestGridSessionActionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTestGridSessionActionsInput"} + if s.MaxResult != nil && *s.MaxResult < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResult", 1)) } if s.NextToken != nil && len(*s.NextToken) < 4 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) } + if s.SessionArn == nil { + invalidParams.Add(request.NewErrParamRequired("SessionArn")) + } + if s.SessionArn != nil && len(*s.SessionArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("SessionArn", 32)) + } if invalidParams.Len() > 0 { return invalidParams @@ -12215,89 +14389,99 @@ func (s *ListSamplesInput) Validate() error { return nil } -// SetArn sets the Arn field's value. -func (s *ListSamplesInput) SetArn(v string) *ListSamplesInput { - s.Arn = &v +// SetMaxResult sets the MaxResult field's value. +func (s *ListTestGridSessionActionsInput) SetMaxResult(v int64) *ListTestGridSessionActionsInput { + s.MaxResult = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListSamplesInput) SetNextToken(v string) *ListSamplesInput { +func (s *ListTestGridSessionActionsInput) SetNextToken(v string) *ListTestGridSessionActionsInput { s.NextToken = &v return s } -// Represents the result of a list samples request. -type ListSamplesOutput struct { +// SetSessionArn sets the SessionArn field's value. +func (s *ListTestGridSessionActionsInput) SetSessionArn(v string) *ListTestGridSessionActionsInput { + s.SessionArn = &v + return s +} + +type ListTestGridSessionActionsOutput struct { _ struct{} `type:"structure"` - // If the number of items that are returned is significantly large, this is - // an identifier that is also returned, which can be used in a subsequent call - // to this operation to return the next set of items in the list. - NextToken *string `locationName:"nextToken" min:"4" type:"string"` + // The action taken by the session. + Actions []*TestGridSessionAction `locationName:"actions" type:"list"` - // Information about the samples. - Samples []*Sample `locationName:"samples" type:"list"` + // Pagination token. + NextToken *string `locationName:"nextToken" min:"4" type:"string"` } // String returns the string representation -func (s ListSamplesOutput) String() string { +func (s ListTestGridSessionActionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListSamplesOutput) GoString() string { +func (s ListTestGridSessionActionsOutput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListSamplesOutput) SetNextToken(v string) *ListSamplesOutput { - s.NextToken = &v +// SetActions sets the Actions field's value. +func (s *ListTestGridSessionActionsOutput) SetActions(v []*TestGridSessionAction) *ListTestGridSessionActionsOutput { + s.Actions = v return s } -// SetSamples sets the Samples field's value. -func (s *ListSamplesOutput) SetSamples(v []*Sample) *ListSamplesOutput { - s.Samples = v +// SetNextToken sets the NextToken field's value. +func (s *ListTestGridSessionActionsOutput) SetNextToken(v string) *ListTestGridSessionActionsOutput { + s.NextToken = &v return s } -// Represents a request to the list suites operation. -type ListSuitesInput struct { +type ListTestGridSessionArtifactsInput struct { _ struct{} `type:"structure"` - // The job's Amazon Resource Name (ARN). - // - // Arn is a required field - Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` + // The maximum number of results to be returned by a request. + MaxResult *int64 `locationName:"maxResult" min:"1" type:"integer"` - // An identifier that was returned from the previous call to this operation, - // which can be used to return the next set of items in the list. + // Pagination token. NextToken *string `locationName:"nextToken" min:"4" type:"string"` + + // The ARN of a TestGridSession. + // + // SessionArn is a required field + SessionArn *string `locationName:"sessionArn" min:"32" type:"string" required:"true"` + + // Limit results to a specified type of artifact. + Type *string `locationName:"type" type:"string" enum:"TestGridSessionArtifactCategory"` } // String returns the string representation -func (s ListSuitesInput) String() string { +func (s ListTestGridSessionArtifactsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListSuitesInput) GoString() string { +func (s ListTestGridSessionArtifactsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListSuitesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSuitesInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 32)) +func (s *ListTestGridSessionArtifactsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTestGridSessionArtifactsInput"} + if s.MaxResult != nil && *s.MaxResult < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResult", 1)) } if s.NextToken != nil && len(*s.NextToken) < 4 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) } + if s.SessionArn == nil { + invalidParams.Add(request.NewErrParamRequired("SessionArn")) + } + if s.SessionArn != nil && len(*s.SessionArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("SessionArn", 32)) + } if invalidParams.Len() > 0 { return invalidParams @@ -12305,83 +14489,116 @@ func (s *ListSuitesInput) Validate() error { return nil } -// SetArn sets the Arn field's value. -func (s *ListSuitesInput) SetArn(v string) *ListSuitesInput { - s.Arn = &v +// SetMaxResult sets the MaxResult field's value. +func (s *ListTestGridSessionArtifactsInput) SetMaxResult(v int64) *ListTestGridSessionArtifactsInput { + s.MaxResult = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListSuitesInput) SetNextToken(v string) *ListSuitesInput { +func (s *ListTestGridSessionArtifactsInput) SetNextToken(v string) *ListTestGridSessionArtifactsInput { s.NextToken = &v return s } -// Represents the result of a list suites request. -type ListSuitesOutput struct { +// SetSessionArn sets the SessionArn field's value. +func (s *ListTestGridSessionArtifactsInput) SetSessionArn(v string) *ListTestGridSessionArtifactsInput { + s.SessionArn = &v + return s +} + +// SetType sets the Type field's value. +func (s *ListTestGridSessionArtifactsInput) SetType(v string) *ListTestGridSessionArtifactsInput { + s.Type = &v + return s +} + +type ListTestGridSessionArtifactsOutput struct { _ struct{} `type:"structure"` - // If the number of items that are returned is significantly large, this is - // an identifier that is also returned, which can be used in a subsequent call - // to this operation to return the next set of items in the list. - NextToken *string `locationName:"nextToken" min:"4" type:"string"` + // A list of test grid session artifacts for a TestGridSession. + Artifacts []*TestGridSessionArtifact `locationName:"artifacts" type:"list"` - // Information about the suites. - Suites []*Suite `locationName:"suites" type:"list"` + // Pagination token. + NextToken *string `locationName:"nextToken" min:"4" type:"string"` } // String returns the string representation -func (s ListSuitesOutput) String() string { +func (s ListTestGridSessionArtifactsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListSuitesOutput) GoString() string { +func (s ListTestGridSessionArtifactsOutput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListSuitesOutput) SetNextToken(v string) *ListSuitesOutput { - s.NextToken = &v +// SetArtifacts sets the Artifacts field's value. +func (s *ListTestGridSessionArtifactsOutput) SetArtifacts(v []*TestGridSessionArtifact) *ListTestGridSessionArtifactsOutput { + s.Artifacts = v return s } -// SetSuites sets the Suites field's value. -func (s *ListSuitesOutput) SetSuites(v []*Suite) *ListSuitesOutput { - s.Suites = v +// SetNextToken sets the NextToken field's value. +func (s *ListTestGridSessionArtifactsOutput) SetNextToken(v string) *ListTestGridSessionArtifactsOutput { + s.NextToken = &v return s } -type ListTagsForResourceInput struct { +type ListTestGridSessionsInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the resource(s) for which to list tags. - // You can associate tags with the following Device Farm resources: PROJECT, - // RUN, NETWORK_PROFILE, INSTANCE_PROFILE, DEVICE_INSTANCE, SESSION, DEVICE_POOL, - // DEVICE, and VPCE_CONFIGURATION. + // Return only sessions created after this time. + CreationTimeAfter *time.Time `locationName:"creationTimeAfter" type:"timestamp"` + + // Return only sessions created before this time. + CreationTimeBefore *time.Time `locationName:"creationTimeBefore" type:"timestamp"` + + // Return only sessions that ended after this time. + EndTimeAfter *time.Time `locationName:"endTimeAfter" type:"timestamp"` + + // Return only sessions that ended before this time. + EndTimeBefore *time.Time `locationName:"endTimeBefore" type:"timestamp"` + + // Return only this many results at a time. + MaxResult *int64 `locationName:"maxResult" min:"1" type:"integer"` + + // Pagination token. + NextToken *string `locationName:"nextToken" min:"4" type:"string"` + + // ARN of a TestGridProject. // - // ResourceARN is a required field - ResourceARN *string `min:"32" type:"string" required:"true"` + // ProjectArn is a required field + ProjectArn *string `locationName:"projectArn" min:"32" type:"string" required:"true"` + + // Return only sessions in this state. + Status *string `locationName:"status" type:"string" enum:"TestGridSessionStatus"` } // String returns the string representation -func (s ListTagsForResourceInput) String() string { +func (s ListTestGridSessionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsForResourceInput) GoString() string { +func (s ListTestGridSessionsInput) 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")) +func (s *ListTestGridSessionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTestGridSessionsInput"} + if s.MaxResult != nil && *s.MaxResult < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResult", 1)) } - if s.ResourceARN != nil && len(*s.ResourceARN) < 32 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 32)) + if s.NextToken != nil && len(*s.NextToken) < 4 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) + } + if s.ProjectArn == nil { + invalidParams.Add(request.NewErrParamRequired("ProjectArn")) + } + if s.ProjectArn != nil && len(*s.ProjectArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("ProjectArn", 32)) } if invalidParams.Len() > 0 { @@ -12390,34 +14607,83 @@ func (s *ListTagsForResourceInput) Validate() error { return nil } -// SetResourceARN sets the ResourceARN field's value. -func (s *ListTagsForResourceInput) SetResourceARN(v string) *ListTagsForResourceInput { - s.ResourceARN = &v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListTestGridSessionsInput) SetCreationTimeAfter(v time.Time) *ListTestGridSessionsInput { + s.CreationTimeAfter = &v return s } -type ListTagsForResourceOutput struct { +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListTestGridSessionsInput) SetCreationTimeBefore(v time.Time) *ListTestGridSessionsInput { + s.CreationTimeBefore = &v + return s +} + +// SetEndTimeAfter sets the EndTimeAfter field's value. +func (s *ListTestGridSessionsInput) SetEndTimeAfter(v time.Time) *ListTestGridSessionsInput { + s.EndTimeAfter = &v + return s +} + +// SetEndTimeBefore sets the EndTimeBefore field's value. +func (s *ListTestGridSessionsInput) SetEndTimeBefore(v time.Time) *ListTestGridSessionsInput { + s.EndTimeBefore = &v + return s +} + +// SetMaxResult sets the MaxResult field's value. +func (s *ListTestGridSessionsInput) SetMaxResult(v int64) *ListTestGridSessionsInput { + s.MaxResult = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTestGridSessionsInput) SetNextToken(v string) *ListTestGridSessionsInput { + s.NextToken = &v + return s +} + +// SetProjectArn sets the ProjectArn field's value. +func (s *ListTestGridSessionsInput) SetProjectArn(v string) *ListTestGridSessionsInput { + s.ProjectArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListTestGridSessionsInput) SetStatus(v string) *ListTestGridSessionsInput { + s.Status = &v + return s +} + +type ListTestGridSessionsOutput struct { _ struct{} `type:"structure"` - // The tags to add to the resource. A tag is an array of key-value pairs. Tag - // keys can have a maximum character length of 128 characters, and tag values - // can have a maximum length of 256 characters. - Tags []*Tag `type:"list"` + // Pagination token. + NextToken *string `locationName:"nextToken" min:"4" type:"string"` + + // The sessions that match the criteria in a ListTestGridSessionsRequest. + TestGridSessions []*TestGridSession `locationName:"testGridSessions" type:"list"` } // String returns the string representation -func (s ListTagsForResourceOutput) String() string { +func (s ListTestGridSessionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsForResourceOutput) GoString() string { +func (s ListTestGridSessionsOutput) GoString() string { return s.String() } -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v +// SetNextToken sets the NextToken field's value. +func (s *ListTestGridSessionsOutput) SetNextToken(v string) *ListTestGridSessionsOutput { + s.NextToken = &v + return s +} + +// SetTestGridSessions sets the TestGridSessions field's value. +func (s *ListTestGridSessionsOutput) SetTestGridSessions(v []*TestGridSession) *ListTestGridSessionsOutput { + s.TestGridSessions = v return s } @@ -12481,7 +14747,7 @@ type ListTestsOutput struct { _ struct{} `type:"structure"` // If the number of items that are returned is significantly large, this is - // an identifier that is also returned, which can be used in a subsequent call + // an identifier that is also returned. It can be used in a subsequent call // to this operation to return the next set of items in the list. NextToken *string `locationName:"nextToken" min:"4" type:"string"` @@ -12571,7 +14837,7 @@ type ListUniqueProblemsOutput struct { _ struct{} `type:"structure"` // If the number of items that are returned is significantly large, this is - // an identifier that is also returned, which can be used in a subsequent call + // an identifier that is also returned. It can be used in a subsequent call // to this operation to return the next set of items in the list. NextToken *string `locationName:"nextToken" min:"4" type:"string"` @@ -12579,19 +14845,19 @@ type ListUniqueProblemsOutput struct { // // Allowed values include: // - // * PENDING: A pending condition. + // * PENDING // - // * PASSED: A passing condition. + // * PASSED // - // * WARNED: A warning condition. + // * WARNED // - // * FAILED: A failed condition. + // * FAILED // - // * SKIPPED: A skipped condition. + // * SKIPPED // - // * ERRORED: An error condition. + // * ERRORED // - // * STOPPED: A stopped condition. + // * STOPPED UniqueProblems map[string][]*UniqueProblem `locationName:"uniqueProblems" type:"map"` } @@ -12635,80 +14901,69 @@ type ListUploadsInput struct { // // Must be one of the following values: // - // * ANDROID_APP: An Android upload. + // * ANDROID_APP // - // * IOS_APP: An iOS upload. + // * IOS_APP // - // * WEB_APP: A web application upload. + // * WEB_APP // - // * EXTERNAL_DATA: An external data upload. + // * EXTERNAL_DATA // - // * APPIUM_JAVA_JUNIT_TEST_PACKAGE: An Appium Java JUnit test package upload. + // * APPIUM_JAVA_JUNIT_TEST_PACKAGE // - // * APPIUM_JAVA_TESTNG_TEST_PACKAGE: An Appium Java TestNG test package - // upload. + // * APPIUM_JAVA_TESTNG_TEST_PACKAGE // - // * APPIUM_PYTHON_TEST_PACKAGE: An Appium Python test package upload. + // * APPIUM_PYTHON_TEST_PACKAGE // - // * APPIUM_NODE_TEST_PACKAGE: An Appium Node.js test package upload. + // * APPIUM_NODE_TEST_PACKAGE // - // * APPIUM_RUBY_TEST_PACKAGE: An Appium Ruby test package upload. + // * APPIUM_RUBY_TEST_PACKAGE // - // * APPIUM_WEB_JAVA_JUNIT_TEST_PACKAGE: An Appium Java JUnit test package - // upload for a web app. + // * APPIUM_WEB_JAVA_JUNIT_TEST_PACKAGE // - // * APPIUM_WEB_JAVA_TESTNG_TEST_PACKAGE: An Appium Java TestNG test package - // upload for a web app. + // * APPIUM_WEB_JAVA_TESTNG_TEST_PACKAGE // - // * APPIUM_WEB_PYTHON_TEST_PACKAGE: An Appium Python test package upload - // for a web app. + // * APPIUM_WEB_PYTHON_TEST_PACKAGE // - // * APPIUM_WEB_NODE_TEST_PACKAGE: An Appium Node.js test package upload - // for a web app. + // * APPIUM_WEB_NODE_TEST_PACKAGE // - // * APPIUM_WEB_RUBY_TEST_PACKAGE: An Appium Ruby test package upload for - // a web app. + // * APPIUM_WEB_RUBY_TEST_PACKAGE // - // * CALABASH_TEST_PACKAGE: A Calabash test package upload. + // * CALABASH_TEST_PACKAGE // - // * INSTRUMENTATION_TEST_PACKAGE: An instrumentation upload. + // * INSTRUMENTATION_TEST_PACKAGE // - // * UIAUTOMATION_TEST_PACKAGE: A uiautomation test package upload. + // * UIAUTOMATION_TEST_PACKAGE // - // * UIAUTOMATOR_TEST_PACKAGE: A uiautomator test package upload. + // * UIAUTOMATOR_TEST_PACKAGE // - // * XCTEST_TEST_PACKAGE: An Xcode test package upload. + // * XCTEST_TEST_PACKAGE // - // * XCTEST_UI_TEST_PACKAGE: An Xcode UI test package upload. + // * XCTEST_UI_TEST_PACKAGE // - // * APPIUM_JAVA_JUNIT_TEST_SPEC: An Appium Java JUnit test spec upload. + // * APPIUM_JAVA_JUNIT_TEST_SPEC // - // * APPIUM_JAVA_TESTNG_TEST_SPEC: An Appium Java TestNG test spec upload. + // * APPIUM_JAVA_TESTNG_TEST_SPEC // - // * APPIUM_PYTHON_TEST_SPEC: An Appium Python test spec upload. + // * APPIUM_PYTHON_TEST_SPEC // - // * APPIUM_NODE_TEST_SPEC: An Appium Node.js test spec upload. + // * APPIUM_NODE_TEST_SPEC // - // * APPIUM_RUBY_TEST_SPEC: An Appium Ruby test spec upload. + // * APPIUM_RUBY_TEST_SPEC // - // * APPIUM_WEB_JAVA_JUNIT_TEST_SPEC: An Appium Java JUnit test spec upload - // for a web app. + // * APPIUM_WEB_JAVA_JUNIT_TEST_SPEC // - // * APPIUM_WEB_JAVA_TESTNG_TEST_SPEC: An Appium Java TestNG test spec upload - // for a web app. + // * APPIUM_WEB_JAVA_TESTNG_TEST_SPEC // - // * APPIUM_WEB_PYTHON_TEST_SPEC: An Appium Python test spec upload for a - // web app. + // * APPIUM_WEB_PYTHON_TEST_SPEC // - // * APPIUM_WEB_NODE_TEST_SPEC: An Appium Node.js test spec upload for a - // web app. + // * APPIUM_WEB_NODE_TEST_SPEC // - // * APPIUM_WEB_RUBY_TEST_SPEC: An Appium Ruby test spec upload for a web - // app. + // * APPIUM_WEB_RUBY_TEST_SPEC // - // * INSTRUMENTATION_TEST_SPEC: An instrumentation test spec upload. + // * INSTRUMENTATION_TEST_SPEC // - // * XCTEST_UI_TEST_SPEC: An Xcode UI test spec upload. + // * XCTEST_UI_TEST_SPEC Type *string `locationName:"type" type:"string" enum:"UploadType"` } @@ -12764,7 +15019,7 @@ type ListUploadsOutput struct { _ struct{} `type:"structure"` // If the number of items that are returned is significantly large, this is - // an identifier that is also returned, which can be used in a subsequent call + // an identifier that is also returned. It can be used in a subsequent call // to this operation to return the next set of items in the list. NextToken *string `locationName:"nextToken" min:"4" type:"string"` @@ -12797,8 +15052,8 @@ func (s *ListUploadsOutput) SetUploads(v []*Upload) *ListUploadsOutput { type ListVPCEConfigurationsInput struct { _ struct{} `type:"structure"` - // An integer specifying the maximum number of items you want to return in the - // API response. + // An integer that specifies the maximum number of items you want to return + // in the API response. MaxResults *int64 `locationName:"maxResults" type:"integer"` // An identifier that was returned from the previous call to this operation, @@ -12848,8 +15103,8 @@ type ListVPCEConfigurationsOutput struct { // which can be used to return the next set of items in the list. NextToken *string `locationName:"nextToken" min:"4" type:"string"` - // An array of VPCEConfiguration objects containing information about your VPC - // endpoint configuration. + // An array of VPCEConfiguration objects that contain information about your + // VPC endpoint configuration. VpceConfigurations []*VPCEConfiguration `locationName:"vpceConfigurations" type:"list"` } @@ -12876,7 +15131,7 @@ func (s *ListVPCEConfigurationsOutput) SetVpceConfigurations(v []*VPCEConfigurat } // Represents a latitude and longitude pair, expressed in geographic coordinate -// system degrees (for example 47.6204, -122.3491). +// system degrees (for example, 47.6204, -122.3491). // // Elevation is currently not supported. type Location struct { @@ -12931,14 +15186,14 @@ func (s *Location) SetLongitude(v float64) *Location { return s } -// A number representing the monetary amount for an offering or transaction. +// A number that represents the monetary amount for an offering or transaction. type MonetaryAmount struct { _ struct{} `type:"structure"` // The numerical amount of an offering or transaction. Amount *float64 `locationName:"amount" type:"double"` - // The currency code of a monetary amount. For example, USD means "U.S. dollars." + // The currency code of a monetary amount. For example, USD means U.S. dollars. CurrencyCode *string `locationName:"currencyCode" type:"string" enum:"CurrencyCode"` } @@ -12991,7 +15246,7 @@ type NetworkProfile struct { // The name of the network profile. Name *string `locationName:"name" type:"string"` - // The type of network profile. Valid values are listed below. + // The type of network profile. Valid values are listed here. Type *string `locationName:"type" type:"string" enum:"NetworkProfileType"` // The data throughput rate in bits per second, as an integer from 0 to 104857600. @@ -13067,47 +15322,162 @@ func (s *NetworkProfile) SetType(v string) *NetworkProfile { return s } -// SetUplinkBandwidthBits sets the UplinkBandwidthBits field's value. -func (s *NetworkProfile) SetUplinkBandwidthBits(v int64) *NetworkProfile { - s.UplinkBandwidthBits = &v - return s +// SetUplinkBandwidthBits sets the UplinkBandwidthBits field's value. +func (s *NetworkProfile) SetUplinkBandwidthBits(v int64) *NetworkProfile { + s.UplinkBandwidthBits = &v + return s +} + +// SetUplinkDelayMs sets the UplinkDelayMs field's value. +func (s *NetworkProfile) SetUplinkDelayMs(v int64) *NetworkProfile { + s.UplinkDelayMs = &v + return s +} + +// SetUplinkJitterMs sets the UplinkJitterMs field's value. +func (s *NetworkProfile) SetUplinkJitterMs(v int64) *NetworkProfile { + s.UplinkJitterMs = &v + return s +} + +// SetUplinkLossPercent sets the UplinkLossPercent field's value. +func (s *NetworkProfile) SetUplinkLossPercent(v int64) *NetworkProfile { + s.UplinkLossPercent = &v + return s +} + +// Exception gets thrown when a user is not eligible to perform the specified +// transaction. +type NotEligibleException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The HTTP response code of a Not Eligible exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotEligibleException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotEligibleException) GoString() string { + return s.String() +} + +func newErrorNotEligibleException(v protocol.ResponseMetadata) error { + return &NotEligibleException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotEligibleException) Code() string { + return "NotEligibleException" +} + +// Message returns the exception's message. +func (s NotEligibleException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotEligibleException) OrigErr() error { + return nil +} + +func (s NotEligibleException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotEligibleException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotEligibleException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified entity was not found. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Any additional information about the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil } -// SetUplinkDelayMs sets the UplinkDelayMs field's value. -func (s *NetworkProfile) SetUplinkDelayMs(v int64) *NetworkProfile { - s.UplinkDelayMs = &v - return s +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetUplinkJitterMs sets the UplinkJitterMs field's value. -func (s *NetworkProfile) SetUplinkJitterMs(v int64) *NetworkProfile { - s.UplinkJitterMs = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetUplinkLossPercent sets the UplinkLossPercent field's value. -func (s *NetworkProfile) SetUplinkLossPercent(v int64) *NetworkProfile { - s.UplinkLossPercent = &v - return s +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID } // Represents the metadata of a device offering. type Offering struct { _ struct{} `type:"structure"` - // A string describing the offering. + // A string that describes the offering. Description *string `locationName:"description" type:"string"` // The ID that corresponds to a device offering. Id *string `locationName:"id" min:"32" type:"string"` - // The platform of the device (e.g., ANDROID or IOS). + // The platform of the device (for example, ANDROID or IOS). Platform *string `locationName:"platform" type:"string" enum:"DevicePlatform"` // Specifies whether there are recurring charges for the offering. RecurringCharges []*RecurringCharge `locationName:"recurringCharges" type:"list"` - // The type of offering (e.g., "RECURRING") for a device. + // The type of offering (for example, RECURRING) for a device. Type *string `locationName:"type" type:"string" enum:"OfferingType"` } @@ -13155,7 +15525,7 @@ func (s *Offering) SetType(v string) *Offering { type OfferingPromotion struct { _ struct{} `type:"structure"` - // A string describing the offering promotion. + // A string that describes the offering promotion. Description *string `locationName:"description" type:"string"` // The ID of the offering promotion. @@ -13312,19 +15682,19 @@ type Problem struct { // // Allowed values include: // - // * PENDING: A pending condition. + // * PENDING // - // * PASSED: A passing condition. + // * PASSED // - // * WARNED: A warning condition. + // * WARNED // - // * FAILED: A failed condition. + // * FAILED // - // * SKIPPED: A skipped condition. + // * SKIPPED // - // * ERRORED: An error condition. + // * ERRORED // - // * STOPPED: A stopped condition. + // * STOPPED Result *string `locationName:"result" type:"string" enum:"ExecutionResult"` // Information about the associated run. @@ -13433,7 +15803,7 @@ type Project struct { // When the project was created. Created *time.Time `locationName:"created" type:"timestamp"` - // The default number of minutes (at the project level) a test run will execute + // The default number of minutes (at the project level) a test run executes // before it times out. The default value is 150 minutes. DefaultJobTimeoutMinutes *int64 `locationName:"defaultJobTimeoutMinutes" type:"integer"` @@ -13485,7 +15855,7 @@ type PurchaseOfferingInput struct { // The ID of the offering promotion to be applied to the purchase. OfferingPromotionId *string `locationName:"offeringPromotionId" min:"4" type:"string"` - // The number of device slots you wish to purchase in an offering request. + // The number of device slots to purchase in an offering request. Quantity *int64 `locationName:"quantity" type:"integer"` } @@ -13533,7 +15903,7 @@ func (s *PurchaseOfferingInput) SetQuantity(v int64) *PurchaseOfferingInput { return s } -// The result of the purchase offering (e.g., success or failure). +// The result of the purchase offering (for example, success or failure). type PurchaseOfferingOutput struct { _ struct{} `type:"structure"` @@ -13562,16 +15932,16 @@ func (s *PurchaseOfferingOutput) SetOfferingTransaction(v *OfferingTransaction) type Radios struct { _ struct{} `type:"structure"` - // True if Bluetooth is enabled at the beginning of the test; otherwise, false. + // True if Bluetooth is enabled at the beginning of the test. Otherwise, false. Bluetooth *bool `locationName:"bluetooth" type:"boolean"` - // True if GPS is enabled at the beginning of the test; otherwise, false. + // True if GPS is enabled at the beginning of the test. Otherwise, false. Gps *bool `locationName:"gps" type:"boolean"` - // True if NFC is enabled at the beginning of the test; otherwise, false. + // True if NFC is enabled at the beginning of the test. Otherwise, false. Nfc *bool `locationName:"nfc" type:"boolean"` - // True if Wi-Fi is enabled at the beginning of the test; otherwise, false. + // True if Wi-Fi is enabled at the beginning of the test. Otherwise, false. Wifi *bool `locationName:"wifi" type:"boolean"` } @@ -13609,14 +15979,14 @@ func (s *Radios) SetWifi(v bool) *Radios { return s } -// Specifies whether charges for devices will be recurring. +// Specifies whether charges for devices are recurring. type RecurringCharge struct { _ struct{} `type:"structure"` // The cost of the recurring charge. Cost *MonetaryAmount `locationName:"cost" type:"structure"` - // The frequency in which charges will recur. + // The frequency in which charges recur. Frequency *string `locationName:"frequency" type:"string" enum:"RecurringChargeFrequency"` } @@ -13651,11 +16021,13 @@ type RemoteAccessSession struct { // The billing method of the remote access session. Possible values include // METERED or UNMETERED. For more information about metered devices, see AWS - // Device Farm terminology (https://docs.aws.amazon.com/devicefarm/latest/developerguide/welcome.html#welcome-terminology)." + // Device Farm terminology (https://docs.aws.amazon.com/devicefarm/latest/developerguide/welcome.html#welcome-terminology). BillingMethod *string `locationName:"billingMethod" type:"string" enum:"BillingMethod"` // Unique identifier of your client for the remote access session. Only returned // if remote debugging is enabled for the remote access session. + // + // Remote debugging is no longer supported (https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html). ClientId *string `locationName:"clientId" type:"string"` // The date and time the remote access session was created. @@ -13670,6 +16042,8 @@ type RemoteAccessSession struct { // Unique device identifier for the remote device. Only returned if remote debugging // is enabled for the remote access session. + // + // Remote debugging is no longer supported (https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html). DeviceUdid *string `locationName:"deviceUdid" type:"string"` // The endpoint for the remote access sesssion. @@ -13677,9 +16051,11 @@ type RemoteAccessSession struct { // IP address of the EC2 host where you need to connect to remotely debug devices. // Only returned if remote debugging is enabled for the remote access session. + // + // Remote debugging is no longer supported (https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html). HostAddress *string `locationName:"hostAddress" type:"string"` - // The Amazon Resource Name (ARN) of the instance. + // The ARN of the instance. InstanceArn *string `locationName:"instanceArn" min:"32" type:"string"` // The interaction mode of the remote access session. Valid values are: @@ -13688,12 +16064,13 @@ type RemoteAccessSession struct { // and rotating the screen. You cannot run XCUITest framework-based tests // in this mode. // - // * NO_VIDEO: You are connected to the device but cannot interact with it - // or view the screen. This mode has the fastest test execution speed. You - // can run XCUITest framework-based tests in this mode. + // * NO_VIDEO: You are connected to the device, but cannot interact with + // it or view the screen. This mode has the fastest test execution speed. + // You can run XCUITest framework-based tests in this mode. // - // * VIDEO_ONLY: You can view the screen but cannot touch or rotate it. You - // can run XCUITest framework-based tests and watch the screen in this mode. + // * VIDEO_ONLY: You can view the screen, but cannot touch or rotate it. + // You can run XCUITest framework-based tests and watch the screen in this + // mode. InteractionMode *string `locationName:"interactionMode" type:"string" enum:"InteractionMode"` // A message about the remote access session. @@ -13704,10 +16081,11 @@ type RemoteAccessSession struct { // This flag is set to true if remote debugging is enabled for the remote access // session. + // + // Remote debugging is no longer supported (https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html). RemoteDebugEnabled *bool `locationName:"remoteDebugEnabled" type:"boolean"` - // The Amazon Resource Name (ARN) for the app to be recorded in the remote access - // session. + // The ARN for the app to be recorded in the remote access session. RemoteRecordAppArn *string `locationName:"remoteRecordAppArn" min:"32" type:"string"` // This flag is set to true if remote recording is enabled for the remote access @@ -13716,26 +16094,25 @@ type RemoteAccessSession struct { // The result of the remote access session. Can be any of the following: // - // * PENDING: A pending condition. + // * PENDING. // - // * PASSED: A passing condition. + // * PASSED. // - // * WARNED: A warning condition. + // * WARNED. // - // * FAILED: A failed condition. + // * FAILED. // - // * SKIPPED: A skipped condition. + // * SKIPPED. // - // * ERRORED: An error condition. + // * ERRORED. // - // * STOPPED: A stopped condition. + // * STOPPED. Result *string `locationName:"result" type:"string" enum:"ExecutionResult"` - // When set to true, for private devices, Device Farm will not sign your app - // again. For public devices, Device Farm always signs your apps again and this - // parameter has no effect. + // When set to true, for private devices, Device Farm does not sign your app + // again. For public devices, Device Farm always signs your apps again. // - // For more information about how Device Farm re-signs your app(s), see Do you + // For more information about how Device Farm re-signs your apps, see Do you // modify my app? (https://aws.amazon.com/device-farm/faq/) in the AWS Device // Farm FAQs. SkipAppResign *bool `locationName:"skipAppResign" type:"boolean"` @@ -13745,23 +16122,23 @@ type RemoteAccessSession struct { // The status of the remote access session. Can be any of the following: // - // * PENDING: A pending status. + // * PENDING. // - // * PENDING_CONCURRENCY: A pending concurrency status. + // * PENDING_CONCURRENCY. // - // * PENDING_DEVICE: A pending device status. + // * PENDING_DEVICE. // - // * PROCESSING: A processing status. + // * PROCESSING. // - // * SCHEDULING: A scheduling status. + // * SCHEDULING. // - // * PREPARING: A preparing status. + // * PREPARING. // - // * RUNNING: A running status. + // * RUNNING. // - // * COMPLETED: A completed status. + // * COMPLETED. // - // * STOPPING: A stopping status. + // * STOPPING. Status *string `locationName:"status" type:"string" enum:"ExecutionStatus"` // The date and time the remote access session was stopped. @@ -13904,7 +16281,7 @@ func (s *RemoteAccessSession) SetStopped(v time.Time) *RemoteAccessSession { return s } -// A request representing an offering renewal. +// A request that represents an offering renewal. type RenewOfferingInput struct { _ struct{} `type:"structure"` @@ -14025,26 +16402,26 @@ type Rule struct { // // ARN // - // The Amazon Resource Name (ARN) of the device. For example, "arn:aws:devicefarm:us-west-2::device:12345Example". + // The Amazon Resource Name (ARN) of the device (for example, arn:aws:devicefarm:us-west-2::device:12345Example. // // Supported operators: EQUALS, IN, NOT_IN // // AVAILABILITY // - // The current availability of the device. Valid values are "AVAILABLE", "HIGHLY_AVAILABLE", - // "BUSY", or "TEMPORARY_NOT_AVAILABLE". + // The current availability of the device. Valid values are AVAILABLE, HIGHLY_AVAILABLE, + // BUSY, or TEMPORARY_NOT_AVAILABLE. // // Supported operators: EQUALS // // FLEET_TYPE // - // The fleet type. Valid values are "PUBLIC" or "PRIVATE". + // The fleet type. Valid values are PUBLIC or PRIVATE. // // Supported operators: EQUALS // // FORM_FACTOR // - // The device form factor. Valid values are "PHONE" or "TABLET". + // The device form factor. Valid values are PHONE or TABLET. // // Supported operators: EQUALS, IN, NOT_IN // @@ -14062,42 +16439,45 @@ type Rule struct { // // MANUFACTURER // - // The device manufacturer. For example, "Apple". + // The device manufacturer (for example, Apple). // // Supported operators: EQUALS, IN, NOT_IN // // MODEL // - // The device model, such as "Apple iPad Air 2" or "Google Pixel". + // The device model, such as Apple iPad Air 2 or Google Pixel. // // Supported operators: CONTAINS, EQUALS, IN, NOT_IN // // OS_VERSION // - // The operating system version. For example, "10.3.2". + // The operating system version (for example, 10.3.2). // // Supported operators: EQUALS, GREATER_THAN, GREATER_THAN_OR_EQUALS, IN, LESS_THAN, // LESS_THAN_OR_EQUALS, NOT_IN // // PLATFORM // - // The device platform. Valid values are "ANDROID" or "IOS". + // The device platform. Valid values are ANDROID or IOS. // // Supported operators: EQUALS, IN, NOT_IN // // REMOTE_ACCESS_ENABLED // - // Whether the device is enabled for remote access. Valid values are "TRUE" - // or "FALSE". + // Whether the device is enabled for remote access. Valid values are TRUE or + // FALSE. // // Supported operators: EQUALS // // REMOTE_DEBUG_ENABLED // - // Whether the device is enabled for remote debugging. Valid values are "TRUE" - // or "FALSE". + // Whether the device is enabled for remote debugging. Valid values are TRUE + // or FALSE. // // Supported operators: EQUALS + // + // Because remote debugging is no longer supported (https://docs.aws.amazon.com/devicefarm/latest/developerguide/history.html), + // this filter is ignored. Attribute *string `locationName:"attribute" type:"string" enum:"DeviceAttribute"` // Specifies how Device Farm compares the rule's attribute to the value. For @@ -14137,7 +16517,7 @@ func (s *Rule) SetValue(v string) *Rule { } // Represents a test run on a set of devices with a given app package, test -// parameters, etc. +// parameters, and so on. type Run struct { _ struct{} `type:"structure"` @@ -14149,6 +16529,9 @@ type Run struct { // Specifies the billing method for a test run: metered or unmetered. If the // parameter is not specified, the default value is metered. + // + // If you have unmetered device slots, you must set this to unmetered to use + // them. Otherwise, the run is counted toward metered device minutes. BillingMethod *string `locationName:"billingMethod" type:"string" enum:"BillingMethod"` // The total number of completed jobs. @@ -14176,7 +16559,7 @@ type Run struct { // UI fuzz test should perform. EventCount *int64 `locationName:"eventCount" type:"integer"` - // The number of minutes the job will execute before it times out. + // The number of minutes the job executes before it times out. JobTimeoutMinutes *int64 `locationName:"jobTimeoutMinutes" type:"integer"` // Information about the locale that is used for the run. @@ -14194,18 +16577,18 @@ type Run struct { // The network profile being used for a test run. NetworkProfile *NetworkProfile `locationName:"networkProfile" type:"structure"` - // Read-only URL for an object in S3 bucket where you can get the parsing results - // of the test package. If the test package doesn't parse, the reason why it - // doesn't parse appears in the file that this URL points to. + // Read-only URL for an object in an S3 bucket where you can get the parsing + // results of the test package. If the test package doesn't parse, the reason + // why it doesn't parse appears in the file that this URL points to. ParsingResultUrl *string `locationName:"parsingResultUrl" type:"string"` // The run's platform. // // Allowed values include: // - // * ANDROID: The Android platform. + // * ANDROID // - // * IOS: The iOS platform. + // * IOS Platform *string `locationName:"platform" type:"string" enum:"DevicePlatform"` // Information about the radio states for the run. @@ -14215,19 +16598,19 @@ type Run struct { // // Allowed values include: // - // * PENDING: A pending condition. + // * PENDING // - // * PASSED: A passing condition. + // * PASSED // - // * WARNED: A warning condition. + // * WARNED // - // * FAILED: A failed condition. + // * FAILED // - // * SKIPPED: A skipped condition. + // * SKIPPED // - // * ERRORED: An error condition. + // * ERRORED // - // * STOPPED: A stopped condition. + // * STOPPED Result *string `locationName:"result" type:"string" enum:"ExecutionResult"` // Supporting field for the result field. Set only if result is SKIPPED. PARSING_FAILED @@ -14238,11 +16621,10 @@ type Run struct { // the same seed value between tests ensures identical event sequences. Seed *int64 `locationName:"seed" type:"integer"` - // When set to true, for private devices, Device Farm will not sign your app - // again. For public devices, Device Farm always signs your apps again and this - // parameter has no effect. + // When set to true, for private devices, Device Farm does not sign your app + // again. For public devices, Device Farm always signs your apps again. // - // For more information about how Device Farm re-signs your app(s), see Do you + // For more information about how Device Farm re-signs your apps, see Do you // modify my app? (https://aws.amazon.com/device-farm/faq/) in the AWS Device // Farm FAQs. SkipAppResign *bool `locationName:"skipAppResign" type:"boolean"` @@ -14254,23 +16636,23 @@ type Run struct { // // Allowed values include: // - // * PENDING: A pending status. + // * PENDING // - // * PENDING_CONCURRENCY: A pending concurrency status. + // * PENDING_CONCURRENCY // - // * PENDING_DEVICE: A pending device status. + // * PENDING_DEVICE // - // * PROCESSING: A processing status. + // * PROCESSING // - // * SCHEDULING: A scheduling status. + // * SCHEDULING // - // * PREPARING: A preparing status. + // * PREPARING // - // * RUNNING: A running status. + // * RUNNING // - // * COMPLETED: A completed status. + // * COMPLETED // - // * STOPPING: A stopping status. + // * STOPPING Status *string `locationName:"status" type:"string" enum:"ExecutionStatus"` // The run's stop time. @@ -14279,536 +16661,949 @@ type Run struct { // The ARN of the YAML-formatted test specification for the run. TestSpecArn *string `locationName:"testSpecArn" min:"32" type:"string"` - // The total number of jobs for the run. - TotalJobs *int64 `locationName:"totalJobs" type:"integer"` + // The total number of jobs for the run. + TotalJobs *int64 `locationName:"totalJobs" type:"integer"` + + // The run's type. + // + // Must be one of the following values: + // + // * BUILTIN_FUZZ + // + // * BUILTIN_EXPLORER For Android, an app explorer that traverses an Android + // app, interacting with it and capturing screenshots at the same time. + // + // * APPIUM_JAVA_JUNIT + // + // * APPIUM_JAVA_TESTNG + // + // * APPIUM_PYTHON + // + // * APPIUM_NODE + // + // * APPIUM_RUBY + // + // * APPIUM_WEB_JAVA_JUNIT + // + // * APPIUM_WEB_JAVA_TESTNG + // + // * APPIUM_WEB_PYTHON + // + // * APPIUM_WEB_NODE + // + // * APPIUM_WEB_RUBY + // + // * CALABASH + // + // * INSTRUMENTATION + // + // * UIAUTOMATION + // + // * UIAUTOMATOR + // + // * XCTEST + // + // * XCTEST_UI + Type *string `locationName:"type" type:"string" enum:"TestType"` + + // The Device Farm console URL for the recording of the run. + WebUrl *string `locationName:"webUrl" type:"string"` +} + +// String returns the string representation +func (s Run) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Run) GoString() string { + return s.String() +} + +// SetAppUpload sets the AppUpload field's value. +func (s *Run) SetAppUpload(v string) *Run { + s.AppUpload = &v + return s +} + +// SetArn sets the Arn field's value. +func (s *Run) SetArn(v string) *Run { + s.Arn = &v + return s +} + +// SetBillingMethod sets the BillingMethod field's value. +func (s *Run) SetBillingMethod(v string) *Run { + s.BillingMethod = &v + return s +} + +// SetCompletedJobs sets the CompletedJobs field's value. +func (s *Run) SetCompletedJobs(v int64) *Run { + s.CompletedJobs = &v + return s +} + +// SetCounters sets the Counters field's value. +func (s *Run) SetCounters(v *Counters) *Run { + s.Counters = v + return s +} + +// SetCreated sets the Created field's value. +func (s *Run) SetCreated(v time.Time) *Run { + s.Created = &v + return s +} + +// SetCustomerArtifactPaths sets the CustomerArtifactPaths field's value. +func (s *Run) SetCustomerArtifactPaths(v *CustomerArtifactPaths) *Run { + s.CustomerArtifactPaths = v + return s +} + +// SetDeviceMinutes sets the DeviceMinutes field's value. +func (s *Run) SetDeviceMinutes(v *DeviceMinutes) *Run { + s.DeviceMinutes = v + return s +} + +// SetDevicePoolArn sets the DevicePoolArn field's value. +func (s *Run) SetDevicePoolArn(v string) *Run { + s.DevicePoolArn = &v + return s +} + +// SetDeviceSelectionResult sets the DeviceSelectionResult field's value. +func (s *Run) SetDeviceSelectionResult(v *DeviceSelectionResult) *Run { + s.DeviceSelectionResult = v + return s +} + +// SetEventCount sets the EventCount field's value. +func (s *Run) SetEventCount(v int64) *Run { + s.EventCount = &v + return s +} + +// SetJobTimeoutMinutes sets the JobTimeoutMinutes field's value. +func (s *Run) SetJobTimeoutMinutes(v int64) *Run { + s.JobTimeoutMinutes = &v + return s +} + +// SetLocale sets the Locale field's value. +func (s *Run) SetLocale(v string) *Run { + s.Locale = &v + return s +} + +// SetLocation sets the Location field's value. +func (s *Run) SetLocation(v *Location) *Run { + s.Location = v + return s +} + +// SetMessage sets the Message field's value. +func (s *Run) SetMessage(v string) *Run { + s.Message = &v + return s +} + +// SetName sets the Name field's value. +func (s *Run) SetName(v string) *Run { + s.Name = &v + return s +} + +// SetNetworkProfile sets the NetworkProfile field's value. +func (s *Run) SetNetworkProfile(v *NetworkProfile) *Run { + s.NetworkProfile = v + return s +} + +// SetParsingResultUrl sets the ParsingResultUrl field's value. +func (s *Run) SetParsingResultUrl(v string) *Run { + s.ParsingResultUrl = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *Run) SetPlatform(v string) *Run { + s.Platform = &v + return s +} + +// SetRadios sets the Radios field's value. +func (s *Run) SetRadios(v *Radios) *Run { + s.Radios = v + return s +} + +// SetResult sets the Result field's value. +func (s *Run) SetResult(v string) *Run { + s.Result = &v + return s +} + +// SetResultCode sets the ResultCode field's value. +func (s *Run) SetResultCode(v string) *Run { + s.ResultCode = &v + return s +} + +// SetSeed sets the Seed field's value. +func (s *Run) SetSeed(v int64) *Run { + s.Seed = &v + return s +} + +// SetSkipAppResign sets the SkipAppResign field's value. +func (s *Run) SetSkipAppResign(v bool) *Run { + s.SkipAppResign = &v + return s +} + +// SetStarted sets the Started field's value. +func (s *Run) SetStarted(v time.Time) *Run { + s.Started = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *Run) SetStatus(v string) *Run { + s.Status = &v + return s +} + +// SetStopped sets the Stopped field's value. +func (s *Run) SetStopped(v time.Time) *Run { + s.Stopped = &v + return s +} + +// SetTestSpecArn sets the TestSpecArn field's value. +func (s *Run) SetTestSpecArn(v string) *Run { + s.TestSpecArn = &v + return s +} + +// SetTotalJobs sets the TotalJobs field's value. +func (s *Run) SetTotalJobs(v int64) *Run { + s.TotalJobs = &v + return s +} + +// SetType sets the Type field's value. +func (s *Run) SetType(v string) *Run { + s.Type = &v + return s +} + +// SetWebUrl sets the WebUrl field's value. +func (s *Run) SetWebUrl(v string) *Run { + s.WebUrl = &v + return s +} + +// Represents a sample of performance data. +type Sample struct { + _ struct{} `type:"structure"` + + // The sample's ARN. + Arn *string `locationName:"arn" min:"32" type:"string"` - // The run's type. + // The sample's type. // // Must be one of the following values: // - // * BUILTIN_FUZZ: The built-in fuzz type. - // - // * BUILTIN_EXPLORER: For Android, an app explorer that will traverse an - // Android app, interacting with it and capturing screenshots at the same - // time. + // * CPU: A CPU sample type. This is expressed as the app processing CPU + // time (including child processes) as reported by process, as a percentage. // - // * APPIUM_JAVA_JUNIT: The Appium Java JUnit type. + // * MEMORY: A memory usage sample type. This is expressed as the total proportional + // set size of an app process, in kilobytes. // - // * APPIUM_JAVA_TESTNG: The Appium Java TestNG type. + // * NATIVE_AVG_DRAWTIME // - // * APPIUM_PYTHON: The Appium Python type. + // * NATIVE_FPS // - // * APPIUM_NODE: The Appium Node.js type. + // * NATIVE_FRAMES // - // * APPIUM_RUBY: The Appium Ruby type. + // * NATIVE_MAX_DRAWTIME // - // * APPIUM_WEB_JAVA_JUNIT: The Appium Java JUnit type for web apps. + // * NATIVE_MIN_DRAWTIME // - // * APPIUM_WEB_JAVA_TESTNG: The Appium Java TestNG type for web apps. + // * OPENGL_AVG_DRAWTIME // - // * APPIUM_WEB_PYTHON: The Appium Python type for web apps. + // * OPENGL_FPS // - // * APPIUM_WEB_NODE: The Appium Node.js type for web apps. + // * OPENGL_FRAMES // - // * APPIUM_WEB_RUBY: The Appium Ruby type for web apps. + // * OPENGL_MAX_DRAWTIME // - // * CALABASH: The Calabash type. + // * OPENGL_MIN_DRAWTIME // - // * INSTRUMENTATION: The Instrumentation type. + // * RX // - // * UIAUTOMATION: The uiautomation type. + // * RX_RATE: The total number of bytes per second (TCP and UDP) that are + // sent, by app process. // - // * UIAUTOMATOR: The uiautomator type. + // * THREADS: A threads sample type. This is expressed as the total number + // of threads per app process. // - // * XCTEST: The Xcode test type. + // * TX // - // * XCTEST_UI: The Xcode UI test type. - Type *string `locationName:"type" type:"string" enum:"TestType"` + // * TX_RATE: The total number of bytes per second (TCP and UDP) that are + // received, by app process. + Type *string `locationName:"type" type:"string" enum:"SampleType"` - // The Device Farm console URL for the recording of the run. - WebUrl *string `locationName:"webUrl" type:"string"` + // The presigned Amazon S3 URL that can be used with a GET request to download + // the sample's file. + Url *string `locationName:"url" type:"string"` } // String returns the string representation -func (s Run) String() string { +func (s Sample) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Run) GoString() string { +func (s Sample) GoString() string { return s.String() } -// SetAppUpload sets the AppUpload field's value. -func (s *Run) SetAppUpload(v string) *Run { - s.AppUpload = &v - return s -} - // SetArn sets the Arn field's value. -func (s *Run) SetArn(v string) *Run { +func (s *Sample) SetArn(v string) *Sample { s.Arn = &v return s } -// SetBillingMethod sets the BillingMethod field's value. -func (s *Run) SetBillingMethod(v string) *Run { - s.BillingMethod = &v +// SetType sets the Type field's value. +func (s *Sample) SetType(v string) *Sample { + s.Type = &v return s } -// SetCompletedJobs sets the CompletedJobs field's value. -func (s *Run) SetCompletedJobs(v int64) *Run { - s.CompletedJobs = &v +// SetUrl sets the Url field's value. +func (s *Sample) SetUrl(v string) *Sample { + s.Url = &v return s } -// SetCounters sets the Counters field's value. -func (s *Run) SetCounters(v *Counters) *Run { - s.Counters = v - return s +// Represents the settings for a run. Includes things like location, radio states, +// auxiliary apps, and network profiles. +type ScheduleRunConfiguration struct { + _ struct{} `type:"structure"` + + // A list of upload ARNs for app packages to be installed with your app. + AuxiliaryApps []*string `locationName:"auxiliaryApps" type:"list"` + + // Specifies the billing method for a test run: metered or unmetered. If the + // parameter is not specified, the default value is metered. + // + // If you have purchased unmetered device slots, you must set this parameter + // to unmetered to make use of them. Otherwise, your run counts against your + // metered time. + BillingMethod *string `locationName:"billingMethod" type:"string" enum:"BillingMethod"` + + // Input CustomerArtifactPaths object for the scheduled run configuration. + CustomerArtifactPaths *CustomerArtifactPaths `locationName:"customerArtifactPaths" type:"structure"` + + // The ARN of the extra data for the run. The extra data is a .zip file that + // AWS Device Farm extracts to external data for Android or the app's sandbox + // for iOS. + ExtraDataPackageArn *string `locationName:"extraDataPackageArn" min:"32" type:"string"` + + // Information about the locale that is used for the run. + Locale *string `locationName:"locale" type:"string"` + + // Information about the location that is used for the run. + Location *Location `locationName:"location" type:"structure"` + + // Reserved for internal use. + NetworkProfileArn *string `locationName:"networkProfileArn" min:"32" type:"string"` + + // Information about the radio states for the run. + Radios *Radios `locationName:"radios" type:"structure"` + + // An array of ARNs for your VPC endpoint configurations. + VpceConfigurationArns []*string `locationName:"vpceConfigurationArns" type:"list"` } -// SetCreated sets the Created field's value. -func (s *Run) SetCreated(v time.Time) *Run { - s.Created = &v - return s +// String returns the string representation +func (s ScheduleRunConfiguration) String() string { + return awsutil.Prettify(s) } -// SetCustomerArtifactPaths sets the CustomerArtifactPaths field's value. -func (s *Run) SetCustomerArtifactPaths(v *CustomerArtifactPaths) *Run { - s.CustomerArtifactPaths = v - return s +// GoString returns the string representation +func (s ScheduleRunConfiguration) GoString() string { + return s.String() } -// SetDeviceMinutes sets the DeviceMinutes field's value. -func (s *Run) SetDeviceMinutes(v *DeviceMinutes) *Run { - s.DeviceMinutes = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ScheduleRunConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ScheduleRunConfiguration"} + if s.ExtraDataPackageArn != nil && len(*s.ExtraDataPackageArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("ExtraDataPackageArn", 32)) + } + if s.NetworkProfileArn != nil && len(*s.NetworkProfileArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("NetworkProfileArn", 32)) + } + 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 } -// SetDevicePoolArn sets the DevicePoolArn field's value. -func (s *Run) SetDevicePoolArn(v string) *Run { - s.DevicePoolArn = &v +// SetAuxiliaryApps sets the AuxiliaryApps field's value. +func (s *ScheduleRunConfiguration) SetAuxiliaryApps(v []*string) *ScheduleRunConfiguration { + s.AuxiliaryApps = v return s } -// SetDeviceSelectionResult sets the DeviceSelectionResult field's value. -func (s *Run) SetDeviceSelectionResult(v *DeviceSelectionResult) *Run { - s.DeviceSelectionResult = v +// SetBillingMethod sets the BillingMethod field's value. +func (s *ScheduleRunConfiguration) SetBillingMethod(v string) *ScheduleRunConfiguration { + s.BillingMethod = &v return s } -// SetEventCount sets the EventCount field's value. -func (s *Run) SetEventCount(v int64) *Run { - s.EventCount = &v +// SetCustomerArtifactPaths sets the CustomerArtifactPaths field's value. +func (s *ScheduleRunConfiguration) SetCustomerArtifactPaths(v *CustomerArtifactPaths) *ScheduleRunConfiguration { + s.CustomerArtifactPaths = v return s } -// SetJobTimeoutMinutes sets the JobTimeoutMinutes field's value. -func (s *Run) SetJobTimeoutMinutes(v int64) *Run { - s.JobTimeoutMinutes = &v +// SetExtraDataPackageArn sets the ExtraDataPackageArn field's value. +func (s *ScheduleRunConfiguration) SetExtraDataPackageArn(v string) *ScheduleRunConfiguration { + s.ExtraDataPackageArn = &v return s } // SetLocale sets the Locale field's value. -func (s *Run) SetLocale(v string) *Run { +func (s *ScheduleRunConfiguration) SetLocale(v string) *ScheduleRunConfiguration { s.Locale = &v return s } // SetLocation sets the Location field's value. -func (s *Run) SetLocation(v *Location) *Run { +func (s *ScheduleRunConfiguration) SetLocation(v *Location) *ScheduleRunConfiguration { s.Location = v return s } -// SetMessage sets the Message field's value. -func (s *Run) SetMessage(v string) *Run { - s.Message = &v +// SetNetworkProfileArn sets the NetworkProfileArn field's value. +func (s *ScheduleRunConfiguration) SetNetworkProfileArn(v string) *ScheduleRunConfiguration { + s.NetworkProfileArn = &v + return s +} + +// SetRadios sets the Radios field's value. +func (s *ScheduleRunConfiguration) SetRadios(v *Radios) *ScheduleRunConfiguration { + s.Radios = v + return s +} + +// SetVpceConfigurationArns sets the VpceConfigurationArns field's value. +func (s *ScheduleRunConfiguration) SetVpceConfigurationArns(v []*string) *ScheduleRunConfiguration { + s.VpceConfigurationArns = v return s } -// SetName sets the Name field's value. -func (s *Run) SetName(v string) *Run { - s.Name = &v - return s +// Represents a request to the schedule run operation. +type ScheduleRunInput struct { + _ struct{} `type:"structure"` + + // The ARN of an application package to run tests against, created with CreateUpload. + // See ListUploads. + AppArn *string `locationName:"appArn" min:"32" type:"string"` + + // Information about the settings for the run to be scheduled. + Configuration *ScheduleRunConfiguration `locationName:"configuration" type:"structure"` + + // The ARN of the device pool for the run to be scheduled. + DevicePoolArn *string `locationName:"devicePoolArn" min:"32" type:"string"` + + // The filter criteria used to dynamically select a set of devices for a test + // run and the maximum number of devices to be included in the run. + // + // Either devicePoolArn or deviceSelectionConfiguration is required in a request. + DeviceSelectionConfiguration *DeviceSelectionConfiguration `locationName:"deviceSelectionConfiguration" type:"structure"` + + // Specifies configuration information about a test run, such as the execution + // timeout (in minutes). + ExecutionConfiguration *ExecutionConfiguration `locationName:"executionConfiguration" type:"structure"` + + // The name for the run to be scheduled. + Name *string `locationName:"name" type:"string"` + + // The ARN of the project for the run to be scheduled. + // + // ProjectArn is a required field + ProjectArn *string `locationName:"projectArn" min:"32" type:"string" required:"true"` + + // Information about the test for the run to be scheduled. + // + // Test is a required field + Test *ScheduleRunTest `locationName:"test" type:"structure" required:"true"` +} + +// String returns the string representation +func (s ScheduleRunInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ScheduleRunInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ScheduleRunInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ScheduleRunInput"} + if s.AppArn != nil && len(*s.AppArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("AppArn", 32)) + } + if s.DevicePoolArn != nil && len(*s.DevicePoolArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("DevicePoolArn", 32)) + } + if s.ProjectArn == nil { + invalidParams.Add(request.NewErrParamRequired("ProjectArn")) + } + if s.ProjectArn != nil && len(*s.ProjectArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("ProjectArn", 32)) + } + if s.Test == nil { + invalidParams.Add(request.NewErrParamRequired("Test")) + } + if s.Configuration != nil { + if err := s.Configuration.Validate(); err != nil { + invalidParams.AddNested("Configuration", err.(request.ErrInvalidParams)) + } + } + if s.DeviceSelectionConfiguration != nil { + if err := s.DeviceSelectionConfiguration.Validate(); err != nil { + invalidParams.AddNested("DeviceSelectionConfiguration", err.(request.ErrInvalidParams)) + } + } + if s.Test != nil { + if err := s.Test.Validate(); err != nil { + invalidParams.AddNested("Test", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetNetworkProfile sets the NetworkProfile field's value. -func (s *Run) SetNetworkProfile(v *NetworkProfile) *Run { - s.NetworkProfile = v +// SetAppArn sets the AppArn field's value. +func (s *ScheduleRunInput) SetAppArn(v string) *ScheduleRunInput { + s.AppArn = &v return s } -// SetParsingResultUrl sets the ParsingResultUrl field's value. -func (s *Run) SetParsingResultUrl(v string) *Run { - s.ParsingResultUrl = &v +// SetConfiguration sets the Configuration field's value. +func (s *ScheduleRunInput) SetConfiguration(v *ScheduleRunConfiguration) *ScheduleRunInput { + s.Configuration = v return s } -// SetPlatform sets the Platform field's value. -func (s *Run) SetPlatform(v string) *Run { - s.Platform = &v +// SetDevicePoolArn sets the DevicePoolArn field's value. +func (s *ScheduleRunInput) SetDevicePoolArn(v string) *ScheduleRunInput { + s.DevicePoolArn = &v return s } -// SetRadios sets the Radios field's value. -func (s *Run) SetRadios(v *Radios) *Run { - s.Radios = v +// SetDeviceSelectionConfiguration sets the DeviceSelectionConfiguration field's value. +func (s *ScheduleRunInput) SetDeviceSelectionConfiguration(v *DeviceSelectionConfiguration) *ScheduleRunInput { + s.DeviceSelectionConfiguration = v return s } -// SetResult sets the Result field's value. -func (s *Run) SetResult(v string) *Run { - s.Result = &v +// SetExecutionConfiguration sets the ExecutionConfiguration field's value. +func (s *ScheduleRunInput) SetExecutionConfiguration(v *ExecutionConfiguration) *ScheduleRunInput { + s.ExecutionConfiguration = v return s } -// SetResultCode sets the ResultCode field's value. -func (s *Run) SetResultCode(v string) *Run { - s.ResultCode = &v +// SetName sets the Name field's value. +func (s *ScheduleRunInput) SetName(v string) *ScheduleRunInput { + s.Name = &v return s } -// SetSeed sets the Seed field's value. -func (s *Run) SetSeed(v int64) *Run { - s.Seed = &v +// SetProjectArn sets the ProjectArn field's value. +func (s *ScheduleRunInput) SetProjectArn(v string) *ScheduleRunInput { + s.ProjectArn = &v return s } -// SetSkipAppResign sets the SkipAppResign field's value. -func (s *Run) SetSkipAppResign(v bool) *Run { - s.SkipAppResign = &v +// SetTest sets the Test field's value. +func (s *ScheduleRunInput) SetTest(v *ScheduleRunTest) *ScheduleRunInput { + s.Test = v return s } -// SetStarted sets the Started field's value. -func (s *Run) SetStarted(v time.Time) *Run { - s.Started = &v - return s -} +// Represents the result of a schedule run request. +type ScheduleRunOutput struct { + _ struct{} `type:"structure"` -// SetStatus sets the Status field's value. -func (s *Run) SetStatus(v string) *Run { - s.Status = &v - return s + // Information about the scheduled run. + Run *Run `locationName:"run" type:"structure"` } -// SetStopped sets the Stopped field's value. -func (s *Run) SetStopped(v time.Time) *Run { - s.Stopped = &v - return s +// String returns the string representation +func (s ScheduleRunOutput) String() string { + return awsutil.Prettify(s) } -// SetTestSpecArn sets the TestSpecArn field's value. -func (s *Run) SetTestSpecArn(v string) *Run { - s.TestSpecArn = &v - return s +// GoString returns the string representation +func (s ScheduleRunOutput) GoString() string { + return s.String() } -// SetTotalJobs sets the TotalJobs field's value. -func (s *Run) SetTotalJobs(v int64) *Run { - s.TotalJobs = &v +// SetRun sets the Run field's value. +func (s *ScheduleRunOutput) SetRun(v *Run) *ScheduleRunOutput { + s.Run = v return s } -// SetType sets the Type field's value. -func (s *Run) SetType(v string) *Run { - s.Type = &v - return s -} +// Represents test settings. This data structure is passed in as the test parameter +// to ScheduleRun. For an example of the JSON request syntax, see ScheduleRun. +type ScheduleRunTest struct { + _ struct{} `type:"structure"` -// SetWebUrl sets the WebUrl field's value. -func (s *Run) SetWebUrl(v string) *Run { - s.WebUrl = &v - return s -} + // The test's filter. + Filter *string `locationName:"filter" type:"string"` -// Represents a sample of performance data. -type Sample struct { - _ struct{} `type:"structure"` + // The test's parameters, such as test framework parameters and fixture settings. + // Parameters are represented by name-value pairs of strings. + // + // For all tests: + // + // * app_performance_monitoring: Performance monitoring is enabled by default. + // Set this parameter to false to disable it. + // + // For Calabash tests: + // + // * profile: A cucumber profile (for example, my_profile_name). + // + // * tags: You can limit execution to features or scenarios that have (or + // don't have) certain tags (for example, @smoke or @smoke,~@wip). + // + // For Appium tests (all types): + // + // * appium_version: The Appium version. Currently supported values are 1.6.5 + // (and later), latest, and default. latest runs the latest Appium version + // supported by Device Farm (1.9.1). For default, Device Farm selects a compatible + // version of Appium for the device. The current behavior is to run 1.7.2 + // on Android devices and iOS 9 and earlier and 1.7.2 for iOS 10 and later. + // This behavior is subject to change. + // + // For fuzz tests (Android only): + // + // * event_count: The number of events, between 1 and 10000, that the UI + // fuzz test should perform. + // + // * throttle: The time, in ms, between 0 and 1000, that the UI fuzz test + // should wait between events. + // + // * seed: A seed to use for randomizing the UI fuzz test. Using the same + // seed value between tests ensures identical event sequences. + // + // For Explorer tests: + // + // * username: A user name to use if the Explorer encounters a login form. + // If not supplied, no user name is inserted. + // + // * password: A password to use if the Explorer encounters a login form. + // If not supplied, no password is inserted. + // + // For Instrumentation: + // + // * filter: A test filter string. Examples: Running a single test case: + // com.android.abc.Test1 Running a single test: com.android.abc.Test1#smoke + // Running multiple tests: com.android.abc.Test1,com.android.abc.Test2 + // + // For XCTest and XCTestUI: + // + // * filter: A test filter string. Examples: Running a single test class: + // LoginTests Running a multiple test classes: LoginTests,SmokeTests Running + // a single test: LoginTests/testValid Running multiple tests: LoginTests/testValid,LoginTests/testInvalid + // + // For UIAutomator: + // + // * filter: A test filter string. Examples: Running a single test case: + // com.android.abc.Test1 Running a single test: com.android.abc.Test1#smoke + // Running multiple tests: com.android.abc.Test1,com.android.abc.Test2 + Parameters map[string]*string `locationName:"parameters" type:"map"` - // The sample's ARN. - Arn *string `locationName:"arn" min:"32" type:"string"` + // The ARN of the uploaded test to be run. + TestPackageArn *string `locationName:"testPackageArn" min:"32" type:"string"` - // The sample's type. + // The ARN of the YAML-formatted test specification. + TestSpecArn *string `locationName:"testSpecArn" min:"32" type:"string"` + + // The test's type. // // Must be one of the following values: // - // * CPU: A CPU sample type. This is expressed as the app processing CPU - // time (including child processes) as reported by process, as a percentage. + // * BUILTIN_FUZZ // - // * MEMORY: A memory usage sample type. This is expressed as the total proportional - // set size of an app process, in kilobytes. + // * BUILTIN_EXPLORER. For Android, an app explorer that traverses an Android + // app, interacting with it and capturing screenshots at the same time. // - // * NATIVE_AVG_DRAWTIME + // * APPIUM_JAVA_JUNIT // - // * NATIVE_FPS + // * APPIUM_JAVA_TESTNG // - // * NATIVE_FRAMES + // * APPIUM_PYTHON // - // * NATIVE_MAX_DRAWTIME + // * APPIUM_NODE // - // * NATIVE_MIN_DRAWTIME + // * APPIUM_RUBY // - // * OPENGL_AVG_DRAWTIME + // * APPIUM_WEB_JAVA_JUNIT // - // * OPENGL_FPS + // * APPIUM_WEB_JAVA_TESTNG // - // * OPENGL_FRAMES + // * APPIUM_WEB_PYTHON // - // * OPENGL_MAX_DRAWTIME + // * APPIUM_WEB_NODE // - // * OPENGL_MIN_DRAWTIME + // * APPIUM_WEB_RUBY // - // * RX + // * CALABASH // - // * RX_RATE: The total number of bytes per second (TCP and UDP) that are - // sent, by app process. + // * INSTRUMENTATION // - // * THREADS: A threads sample type. This is expressed as the total number - // of threads per app process. + // * UIAUTOMATION // - // * TX + // * UIAUTOMATOR // - // * TX_RATE: The total number of bytes per second (TCP and UDP) that are - // received, by app process. - Type *string `locationName:"type" type:"string" enum:"SampleType"` - - // The pre-signed Amazon S3 URL that can be used with a corresponding GET request - // to download the sample's file. - Url *string `locationName:"url" type:"string"` + // * XCTEST + // + // * XCTEST_UI + // + // Type is a required field + Type *string `locationName:"type" type:"string" required:"true" enum:"TestType"` } // String returns the string representation -func (s Sample) String() string { +func (s ScheduleRunTest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Sample) GoString() string { +func (s ScheduleRunTest) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *Sample) SetArn(v string) *Sample { - s.Arn = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ScheduleRunTest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ScheduleRunTest"} + if s.TestPackageArn != nil && len(*s.TestPackageArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("TestPackageArn", 32)) + } + if s.TestSpecArn != nil && len(*s.TestSpecArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("TestSpecArn", 32)) + } + 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 *Sample) SetType(v string) *Sample { - s.Type = &v +// SetFilter sets the Filter field's value. +func (s *ScheduleRunTest) SetFilter(v string) *ScheduleRunTest { + s.Filter = &v return s } -// SetUrl sets the Url field's value. -func (s *Sample) SetUrl(v string) *Sample { - s.Url = &v +// SetParameters sets the Parameters field's value. +func (s *ScheduleRunTest) SetParameters(v map[string]*string) *ScheduleRunTest { + s.Parameters = v return s } -// Represents the settings for a run. Includes things like location, radio states, -// auxiliary apps, and network profiles. -type ScheduleRunConfiguration struct { - _ struct{} `type:"structure"` - - // A list of auxiliary apps for the run. - AuxiliaryApps []*string `locationName:"auxiliaryApps" type:"list"` - - // Specifies the billing method for a test run: metered or unmetered. If the - // parameter is not specified, the default value is metered. - BillingMethod *string `locationName:"billingMethod" type:"string" enum:"BillingMethod"` - - // Input CustomerArtifactPaths object for the scheduled run configuration. - CustomerArtifactPaths *CustomerArtifactPaths `locationName:"customerArtifactPaths" type:"structure"` - - // The ARN of the extra data for the run. The extra data is a .zip file that - // AWS Device Farm will extract to external data for Android or the app's sandbox - // for iOS. - ExtraDataPackageArn *string `locationName:"extraDataPackageArn" min:"32" type:"string"` - - // Information about the locale that is used for the run. - Locale *string `locationName:"locale" type:"string"` +// SetTestPackageArn sets the TestPackageArn field's value. +func (s *ScheduleRunTest) SetTestPackageArn(v string) *ScheduleRunTest { + s.TestPackageArn = &v + return s +} - // Information about the location that is used for the run. - Location *Location `locationName:"location" type:"structure"` +// SetTestSpecArn sets the TestSpecArn field's value. +func (s *ScheduleRunTest) SetTestSpecArn(v string) *ScheduleRunTest { + s.TestSpecArn = &v + return s +} - // Reserved for internal use. - NetworkProfileArn *string `locationName:"networkProfileArn" min:"32" type:"string"` +// SetType sets the Type field's value. +func (s *ScheduleRunTest) SetType(v string) *ScheduleRunTest { + s.Type = &v + return s +} - // Information about the radio states for the run. - Radios *Radios `locationName:"radios" type:"structure"` +// There was a problem with the service account. +type ServiceAccountException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // An array of Amazon Resource Names (ARNs) for your VPC endpoint configurations. - VpceConfigurationArns []*string `locationName:"vpceConfigurationArns" type:"list"` + // Any additional information about the exception. + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ScheduleRunConfiguration) String() string { +func (s ServiceAccountException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ScheduleRunConfiguration) GoString() string { +func (s ServiceAccountException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ScheduleRunConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScheduleRunConfiguration"} - if s.ExtraDataPackageArn != nil && len(*s.ExtraDataPackageArn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("ExtraDataPackageArn", 32)) - } - if s.NetworkProfileArn != nil && len(*s.NetworkProfileArn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("NetworkProfileArn", 32)) - } - if s.Location != nil { - if err := s.Location.Validate(); err != nil { - invalidParams.AddNested("Location", err.(request.ErrInvalidParams)) - } +func newErrorServiceAccountException(v protocol.ResponseMetadata) error { + return &ServiceAccountException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s ServiceAccountException) Code() string { + return "ServiceAccountException" +} + +// Message returns the exception's message. +func (s ServiceAccountException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetAuxiliaryApps sets the AuxiliaryApps field's value. -func (s *ScheduleRunConfiguration) SetAuxiliaryApps(v []*string) *ScheduleRunConfiguration { - s.AuxiliaryApps = v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceAccountException) OrigErr() error { + return nil } -// SetBillingMethod sets the BillingMethod field's value. -func (s *ScheduleRunConfiguration) SetBillingMethod(v string) *ScheduleRunConfiguration { - s.BillingMethod = &v - return s +func (s ServiceAccountException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetCustomerArtifactPaths sets the CustomerArtifactPaths field's value. -func (s *ScheduleRunConfiguration) SetCustomerArtifactPaths(v *CustomerArtifactPaths) *ScheduleRunConfiguration { - s.CustomerArtifactPaths = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ServiceAccountException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetExtraDataPackageArn sets the ExtraDataPackageArn field's value. -func (s *ScheduleRunConfiguration) SetExtraDataPackageArn(v string) *ScheduleRunConfiguration { - s.ExtraDataPackageArn = &v - return s +// RequestID returns the service's response RequestID for request. +func (s ServiceAccountException) RequestID() string { + return s.respMetadata.RequestID } -// SetLocale sets the Locale field's value. -func (s *ScheduleRunConfiguration) SetLocale(v string) *ScheduleRunConfiguration { - s.Locale = &v - return s +type StopJobInput struct { + _ struct{} `type:"structure"` + + // Represents the Amazon Resource Name (ARN) of the Device Farm job to stop. + // + // Arn is a required field + Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` } -// SetLocation sets the Location field's value. -func (s *ScheduleRunConfiguration) SetLocation(v *Location) *ScheduleRunConfiguration { - s.Location = v - return s +// String returns the string representation +func (s StopJobInput) String() string { + return awsutil.Prettify(s) } -// SetNetworkProfileArn sets the NetworkProfileArn field's value. -func (s *ScheduleRunConfiguration) SetNetworkProfileArn(v string) *ScheduleRunConfiguration { - s.NetworkProfileArn = &v - return s +// GoString returns the string representation +func (s StopJobInput) GoString() string { + return s.String() } -// SetRadios sets the Radios field's value. -func (s *ScheduleRunConfiguration) SetRadios(v *Radios) *ScheduleRunConfiguration { - s.Radios = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *StopJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopJobInput"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.Arn != nil && len(*s.Arn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 32)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetVpceConfigurationArns sets the VpceConfigurationArns field's value. -func (s *ScheduleRunConfiguration) SetVpceConfigurationArns(v []*string) *ScheduleRunConfiguration { - s.VpceConfigurationArns = v +// SetArn sets the Arn field's value. +func (s *StopJobInput) SetArn(v string) *StopJobInput { + s.Arn = &v return s } -// Represents a request to the schedule run operation. -type ScheduleRunInput struct { +type StopJobOutput struct { _ struct{} `type:"structure"` - // The ARN of the app to schedule a run. - AppArn *string `locationName:"appArn" min:"32" type:"string"` - - // Information about the settings for the run to be scheduled. - Configuration *ScheduleRunConfiguration `locationName:"configuration" type:"structure"` - - // The ARN of the device pool for the run to be scheduled. - DevicePoolArn *string `locationName:"devicePoolArn" min:"32" type:"string"` + // The job that was stopped. + Job *Job `locationName:"job" type:"structure"` +} - // The filter criteria used to dynamically select a set of devices for a test - // run, as well as the maximum number of devices to be included in the run. - // - // Either devicePoolArn or deviceSelectionConfiguration is required in a request. - DeviceSelectionConfiguration *DeviceSelectionConfiguration `locationName:"deviceSelectionConfiguration" type:"structure"` +// String returns the string representation +func (s StopJobOutput) String() string { + return awsutil.Prettify(s) +} - // Specifies configuration information about a test run, such as the execution - // timeout (in minutes). - ExecutionConfiguration *ExecutionConfiguration `locationName:"executionConfiguration" type:"structure"` +// GoString returns the string representation +func (s StopJobOutput) GoString() string { + return s.String() +} - // The name for the run to be scheduled. - Name *string `locationName:"name" type:"string"` +// SetJob sets the Job field's value. +func (s *StopJobOutput) SetJob(v *Job) *StopJobOutput { + s.Job = v + return s +} - // The ARN of the project for the run to be scheduled. - // - // ProjectArn is a required field - ProjectArn *string `locationName:"projectArn" min:"32" type:"string" required:"true"` +// Represents the request to stop the remote access session. +type StopRemoteAccessSessionInput struct { + _ struct{} `type:"structure"` - // Information about the test for the run to be scheduled. + // The Amazon Resource Name (ARN) of the remote access session to stop. // - // Test is a required field - Test *ScheduleRunTest `locationName:"test" type:"structure" required:"true"` + // Arn is a required field + Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` } // String returns the string representation -func (s ScheduleRunInput) String() string { +func (s StopRemoteAccessSessionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ScheduleRunInput) GoString() string { +func (s StopRemoteAccessSessionInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ScheduleRunInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScheduleRunInput"} - if s.AppArn != nil && len(*s.AppArn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("AppArn", 32)) - } - if s.DevicePoolArn != nil && len(*s.DevicePoolArn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("DevicePoolArn", 32)) - } - if s.ProjectArn == nil { - invalidParams.Add(request.NewErrParamRequired("ProjectArn")) - } - if s.ProjectArn != nil && len(*s.ProjectArn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("ProjectArn", 32)) - } - if s.Test == nil { - invalidParams.Add(request.NewErrParamRequired("Test")) - } - if s.Configuration != nil { - if err := s.Configuration.Validate(); err != nil { - invalidParams.AddNested("Configuration", err.(request.ErrInvalidParams)) - } - } - if s.DeviceSelectionConfiguration != nil { - if err := s.DeviceSelectionConfiguration.Validate(); err != nil { - invalidParams.AddNested("DeviceSelectionConfiguration", err.(request.ErrInvalidParams)) - } +func (s *StopRemoteAccessSessionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopRemoteAccessSessionInput"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) } - if s.Test != nil { - if err := s.Test.Validate(); err != nil { - invalidParams.AddNested("Test", err.(request.ErrInvalidParams)) - } + if s.Arn != nil && len(*s.Arn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 32)) } if invalidParams.Len() > 0 { @@ -14817,289 +17612,335 @@ func (s *ScheduleRunInput) Validate() error { return nil } -// SetAppArn sets the AppArn field's value. -func (s *ScheduleRunInput) SetAppArn(v string) *ScheduleRunInput { - s.AppArn = &v +// SetArn sets the Arn field's value. +func (s *StopRemoteAccessSessionInput) SetArn(v string) *StopRemoteAccessSessionInput { + s.Arn = &v return s } -// SetConfiguration sets the Configuration field's value. -func (s *ScheduleRunInput) SetConfiguration(v *ScheduleRunConfiguration) *ScheduleRunInput { - s.Configuration = v - return s +// Represents the response from the server that describes the remote access +// session when AWS Device Farm stops the session. +type StopRemoteAccessSessionOutput struct { + _ struct{} `type:"structure"` + + // A container that represents the metadata from the service about the remote + // access session you are stopping. + RemoteAccessSession *RemoteAccessSession `locationName:"remoteAccessSession" type:"structure"` } -// SetDevicePoolArn sets the DevicePoolArn field's value. -func (s *ScheduleRunInput) SetDevicePoolArn(v string) *ScheduleRunInput { - s.DevicePoolArn = &v - return s +// String returns the string representation +func (s StopRemoteAccessSessionOutput) String() string { + return awsutil.Prettify(s) } -// SetDeviceSelectionConfiguration sets the DeviceSelectionConfiguration field's value. -func (s *ScheduleRunInput) SetDeviceSelectionConfiguration(v *DeviceSelectionConfiguration) *ScheduleRunInput { - s.DeviceSelectionConfiguration = v - return s +// GoString returns the string representation +func (s StopRemoteAccessSessionOutput) GoString() string { + return s.String() } -// SetExecutionConfiguration sets the ExecutionConfiguration field's value. -func (s *ScheduleRunInput) SetExecutionConfiguration(v *ExecutionConfiguration) *ScheduleRunInput { - s.ExecutionConfiguration = v +// SetRemoteAccessSession sets the RemoteAccessSession field's value. +func (s *StopRemoteAccessSessionOutput) SetRemoteAccessSession(v *RemoteAccessSession) *StopRemoteAccessSessionOutput { + s.RemoteAccessSession = v return s } -// SetName sets the Name field's value. -func (s *ScheduleRunInput) SetName(v string) *ScheduleRunInput { - s.Name = &v - return s +// Represents the request to stop a specific run. +type StopRunInput struct { + _ struct{} `type:"structure"` + + // Represents the Amazon Resource Name (ARN) of the Device Farm run to stop. + // + // Arn is a required field + Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` } -// SetProjectArn sets the ProjectArn field's value. -func (s *ScheduleRunInput) SetProjectArn(v string) *ScheduleRunInput { - s.ProjectArn = &v - return s +// String returns the string representation +func (s StopRunInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopRunInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StopRunInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopRunInput"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.Arn != nil && len(*s.Arn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 32)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetTest sets the Test field's value. -func (s *ScheduleRunInput) SetTest(v *ScheduleRunTest) *ScheduleRunInput { - s.Test = v +// SetArn sets the Arn field's value. +func (s *StopRunInput) SetArn(v string) *StopRunInput { + s.Arn = &v return s } -// Represents the result of a schedule run request. -type ScheduleRunOutput struct { +// Represents the results of your stop run attempt. +type StopRunOutput struct { _ struct{} `type:"structure"` - // Information about the scheduled run. + // The run that was stopped. Run *Run `locationName:"run" type:"structure"` } // String returns the string representation -func (s ScheduleRunOutput) String() string { +func (s StopRunOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ScheduleRunOutput) GoString() string { +func (s StopRunOutput) GoString() string { return s.String() } // SetRun sets the Run field's value. -func (s *ScheduleRunOutput) SetRun(v *Run) *ScheduleRunOutput { +func (s *StopRunOutput) SetRun(v *Run) *StopRunOutput { s.Run = v return s } -// Represents test settings. This data structure is passed in as the "test" -// parameter to ScheduleRun. For an example of the JSON request syntax, see -// ScheduleRun. -type ScheduleRunTest struct { +// Represents a collection of one or more tests. +type Suite struct { _ struct{} `type:"structure"` - // The test's filter. - Filter *string `locationName:"filter" type:"string"` + // The suite's ARN. + Arn *string `locationName:"arn" min:"32" type:"string"` - // The test's parameters, such as test framework parameters and fixture settings. - // Parameters are represented by name-value pairs of strings. - // - // For all tests: - // - // * app_performance_monitoring: Performance monitoring is enabled by default. - // Set this parameter to "false" to disable it. + // The suite's result counters. + Counters *Counters `locationName:"counters" type:"structure"` + + // When the suite was created. + Created *time.Time `locationName:"created" type:"timestamp"` + + // Represents the total (metered or unmetered) minutes used by the test suite. + DeviceMinutes *DeviceMinutes `locationName:"deviceMinutes" type:"structure"` + + // A message about the suite's result. + Message *string `locationName:"message" type:"string"` + + // The suite's name. + Name *string `locationName:"name" type:"string"` + + // The suite's result. // - // For Calabash tests: + // Allowed values include: // - // * profile: A cucumber profile, for example, "my_profile_name". + // * PENDING // - // * tags: You can limit execution to features or scenarios that have (or - // don't have) certain tags, for example, "@smoke" or "@smoke,~@wip". + // * PASSED // - // For Appium tests (all types): + // * WARNED // - // * appium_version: The Appium version. Currently supported values are "1.6.5" - // (and higher), "latest", and "default". “latest” will run the latest - // Appium version supported by Device Farm (1.9.1). For “default”, Device - // Farm will choose a compatible version of Appium for the device. The current - // behavior is to run 1.7.2 on Android devices and iOS 9 and earlier, 1.7.2 - // for iOS 10 and later. This behavior is subject to change. + // * FAILED // - // For Fuzz tests (Android only): + // * SKIPPED // - // * event_count: The number of events, between 1 and 10000, that the UI - // fuzz test should perform. + // * ERRORED // - // * throttle: The time, in ms, between 0 and 1000, that the UI fuzz test - // should wait between events. + // * STOPPED + Result *string `locationName:"result" type:"string" enum:"ExecutionResult"` + + // The suite's start time. + Started *time.Time `locationName:"started" type:"timestamp"` + + // The suite's status. // - // * seed: A seed to use for randomizing the UI fuzz test. Using the same - // seed value between tests ensures identical event sequences. + // Allowed values include: // - // For Explorer tests: + // * PENDING // - // * username: A username to use if the Explorer encounters a login form. - // If not supplied, no username will be inserted. + // * PENDING_CONCURRENCY // - // * password: A password to use if the Explorer encounters a login form. - // If not supplied, no password will be inserted. + // * PENDING_DEVICE // - // For Instrumentation: + // * PROCESSING // - // * filter: A test filter string. Examples: Running a single test case: - // "com.android.abc.Test1" Running a single test: "com.android.abc.Test1#smoke" - // Running multiple tests: "com.android.abc.Test1,com.android.abc.Test2" + // * SCHEDULING // - // For XCTest and XCTestUI: + // * PREPARING // - // * filter: A test filter string. Examples: Running a single test class: - // "LoginTests" Running a multiple test classes: "LoginTests,SmokeTests" - // Running a single test: "LoginTests/testValid" Running multiple tests: - // "LoginTests/testValid,LoginTests/testInvalid" + // * RUNNING // - // For UIAutomator: + // * COMPLETED // - // * filter: A test filter string. Examples: Running a single test case: - // "com.android.abc.Test1" Running a single test: "com.android.abc.Test1#smoke" - // Running multiple tests: "com.android.abc.Test1,com.android.abc.Test2" - Parameters map[string]*string `locationName:"parameters" type:"map"` - - // The ARN of the uploaded test that will be run. - TestPackageArn *string `locationName:"testPackageArn" min:"32" type:"string"` + // * STOPPING + Status *string `locationName:"status" type:"string" enum:"ExecutionStatus"` - // The ARN of the YAML-formatted test specification. - TestSpecArn *string `locationName:"testSpecArn" min:"32" type:"string"` + // The suite's stop time. + Stopped *time.Time `locationName:"stopped" type:"timestamp"` - // The test's type. + // The suite's type. // // Must be one of the following values: // - // * BUILTIN_FUZZ: The built-in fuzz type. + // * BUILTIN_FUZZ // - // * BUILTIN_EXPLORER: For Android, an app explorer that will traverse an - // Android app, interacting with it and capturing screenshots at the same + // * BUILTIN_EXPLORER Only available for Android; an app explorer that traverses + // an Android app, interacting with it and capturing screenshots at the same // time. // - // * APPIUM_JAVA_JUNIT: The Appium Java JUnit type. - // - // * APPIUM_JAVA_TESTNG: The Appium Java TestNG type. + // * APPIUM_JAVA_JUNIT // - // * APPIUM_PYTHON: The Appium Python type. + // * APPIUM_JAVA_TESTNG // - // * APPIUM_NODE: The Appium Node.js type. + // * APPIUM_PYTHON // - // * APPIUM_RUBY: The Appium Ruby type. + // * APPIUM_NODE // - // * APPIUM_WEB_JAVA_JUNIT: The Appium Java JUnit type for web apps. + // * APPIUM_RUBY // - // * APPIUM_WEB_JAVA_TESTNG: The Appium Java TestNG type for web apps. + // * APPIUM_WEB_JAVA_JUNIT // - // * APPIUM_WEB_PYTHON: The Appium Python type for web apps. + // * APPIUM_WEB_JAVA_TESTNG // - // * APPIUM_WEB_NODE: The Appium Node.js type for web apps. + // * APPIUM_WEB_PYTHON // - // * APPIUM_WEB_RUBY: The Appium Ruby type for web apps. + // * APPIUM_WEB_NODE // - // * CALABASH: The Calabash type. + // * APPIUM_WEB_RUBY // - // * INSTRUMENTATION: The Instrumentation type. + // * CALABASH // - // * UIAUTOMATION: The uiautomation type. + // * INSTRUMENTATION // - // * UIAUTOMATOR: The uiautomator type. + // * UIAUTOMATION // - // * XCTEST: The Xcode test type. + // * UIAUTOMATOR // - // * XCTEST_UI: The Xcode UI test type. + // * XCTEST // - // Type is a required field - Type *string `locationName:"type" type:"string" required:"true" enum:"TestType"` + // * XCTEST_UI + Type *string `locationName:"type" type:"string" enum:"TestType"` } // String returns the string representation -func (s ScheduleRunTest) String() string { +func (s Suite) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ScheduleRunTest) GoString() string { +func (s Suite) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ScheduleRunTest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ScheduleRunTest"} - if s.TestPackageArn != nil && len(*s.TestPackageArn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("TestPackageArn", 32)) - } - if s.TestSpecArn != nil && len(*s.TestSpecArn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("TestSpecArn", 32)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } +// SetArn sets the Arn field's value. +func (s *Suite) SetArn(v string) *Suite { + s.Arn = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCounters sets the Counters field's value. +func (s *Suite) SetCounters(v *Counters) *Suite { + s.Counters = v + return s } -// SetFilter sets the Filter field's value. -func (s *ScheduleRunTest) SetFilter(v string) *ScheduleRunTest { - s.Filter = &v +// SetCreated sets the Created field's value. +func (s *Suite) SetCreated(v time.Time) *Suite { + s.Created = &v return s } -// SetParameters sets the Parameters field's value. -func (s *ScheduleRunTest) SetParameters(v map[string]*string) *ScheduleRunTest { - s.Parameters = v +// SetDeviceMinutes sets the DeviceMinutes field's value. +func (s *Suite) SetDeviceMinutes(v *DeviceMinutes) *Suite { + s.DeviceMinutes = v return s } -// SetTestPackageArn sets the TestPackageArn field's value. -func (s *ScheduleRunTest) SetTestPackageArn(v string) *ScheduleRunTest { - s.TestPackageArn = &v +// SetMessage sets the Message field's value. +func (s *Suite) SetMessage(v string) *Suite { + s.Message = &v return s } -// SetTestSpecArn sets the TestSpecArn field's value. -func (s *ScheduleRunTest) SetTestSpecArn(v string) *ScheduleRunTest { - s.TestSpecArn = &v +// SetName sets the Name field's value. +func (s *Suite) SetName(v string) *Suite { + s.Name = &v + return s +} + +// SetResult sets the Result field's value. +func (s *Suite) SetResult(v string) *Suite { + s.Result = &v + return s +} + +// SetStarted sets the Started field's value. +func (s *Suite) SetStarted(v time.Time) *Suite { + s.Started = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *Suite) SetStatus(v string) *Suite { + s.Status = &v + return s +} + +// SetStopped sets the Stopped field's value. +func (s *Suite) SetStopped(v time.Time) *Suite { + s.Stopped = &v return s } // SetType sets the Type field's value. -func (s *ScheduleRunTest) SetType(v string) *ScheduleRunTest { +func (s *Suite) SetType(v string) *Suite { s.Type = &v return s } -type StopJobInput struct { +// The metadata that you apply to a resource to help you categorize and organize +// it. Each tag consists of a key and an optional value, both of which you define. +// Tag keys can have a maximum character length of 128 characters. Tag values +// can have a maximum length of 256 characters. +type Tag struct { _ struct{} `type:"structure"` - // Represents the Amazon Resource Name (ARN) of the Device Farm job you wish - // to stop. + // One part of a key-value pair that makes up a tag. A key is a general label + // that acts like a category for more specific tag values. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // The optional part of a key-value pair that makes up a tag. A value acts as + // a descriptor in a tag category (key). // - // Arn is a required field - Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` + // Value is a required field + Value *string `type:"string" required:"true"` } // String returns the string representation -func (s StopJobInput) String() string { +func (s Tag) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s StopJobInput) GoString() string { +func (s Tag) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *StopJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopJobInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) +func (s *Tag) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Tag"} + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) } - if s.Arn != nil && len(*s.Arn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 32)) + 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 { @@ -15108,132 +17949,185 @@ func (s *StopJobInput) Validate() error { return nil } -// SetArn sets the Arn field's value. -func (s *StopJobInput) SetArn(v string) *StopJobInput { - s.Arn = &v +// SetKey sets the Key field's value. +func (s *Tag) SetKey(v string) *Tag { + s.Key = &v return s } -type StopJobOutput struct { - _ struct{} `type:"structure"` - - // The job that was stopped. - Job *Job `locationName:"job" type:"structure"` -} - -// String returns the string representation -func (s StopJobOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s StopJobOutput) GoString() string { - return s.String() -} - -// SetJob sets the Job field's value. -func (s *StopJobOutput) SetJob(v *Job) *StopJobOutput { - s.Job = v +// SetValue sets the Value field's value. +func (s *Tag) SetValue(v string) *Tag { + s.Value = &v return s } -// Represents the request to stop the remote access session. -type StopRemoteAccessSessionInput struct { - _ struct{} `type:"structure"` +// The operation was not successful. Try again. +type TagOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The Amazon Resource Name (ARN) of the remote access session you wish to stop. - // - // Arn is a required field - Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` + + ResourceName *string `locationName:"resourceName" min:"32" type:"string"` } // String returns the string representation -func (s StopRemoteAccessSessionInput) String() string { +func (s TagOperationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s StopRemoteAccessSessionInput) GoString() string { +func (s TagOperationException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopRemoteAccessSessionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopRemoteAccessSessionInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) - } - if s.Arn != nil && len(*s.Arn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 32)) +func newErrorTagOperationException(v protocol.ResponseMetadata) error { + return &TagOperationException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s TagOperationException) Code() string { + return "TagOperationException" +} + +// Message returns the exception's message. +func (s TagOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagOperationException) OrigErr() error { return nil } -// SetArn sets the Arn field's value. -func (s *StopRemoteAccessSessionInput) SetArn(v string) *StopRemoteAccessSessionInput { - s.Arn = &v - return s +func (s TagOperationException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// Represents the response from the server that describes the remote access -// session when AWS Device Farm stops the session. -type StopRemoteAccessSessionOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s TagOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} - // A container representing the metadata from the service about the remote access - // session you are stopping. - RemoteAccessSession *RemoteAccessSession `locationName:"remoteAccessSession" type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s TagOperationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request doesn't comply with the AWS Identity and Access Management (IAM) +// tag policy. Correct your request and then retry it. +type TagPolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + ResourceName *string `locationName:"resourceName" min:"32" type:"string"` } // String returns the string representation -func (s StopRemoteAccessSessionOutput) String() string { +func (s TagPolicyException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s StopRemoteAccessSessionOutput) GoString() string { +func (s TagPolicyException) GoString() string { return s.String() } -// SetRemoteAccessSession sets the RemoteAccessSession field's value. -func (s *StopRemoteAccessSessionOutput) SetRemoteAccessSession(v *RemoteAccessSession) *StopRemoteAccessSessionOutput { - s.RemoteAccessSession = v - return s +func newErrorTagPolicyException(v protocol.ResponseMetadata) error { + return &TagPolicyException{ + respMetadata: v, + } } -// Represents the request to stop a specific run. -type StopRunInput struct { +// Code returns the exception type name. +func (s TagPolicyException) Code() string { + return "TagPolicyException" +} + +// Message returns the exception's message. +func (s TagPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagPolicyException) OrigErr() error { + return nil +} + +func (s TagPolicyException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagPolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagPolicyException) RequestID() string { + return s.respMetadata.RequestID +} + +type TagResourceInput struct { _ struct{} `type:"structure"` - // Represents the Amazon Resource Name (ARN) of the Device Farm run you wish - // to stop. + // The Amazon Resource Name (ARN) of the resource or resources to which to add + // tags. You can associate tags with the following Device Farm resources: PROJECT, + // RUN, NETWORK_PROFILE, INSTANCE_PROFILE, DEVICE_INSTANCE, SESSION, DEVICE_POOL, + // DEVICE, and VPCE_CONFIGURATION. + // + // ResourceARN is a required field + ResourceARN *string `min:"32" type:"string" required:"true"` + + // The tags to add to the resource. A tag is an array of key-value pairs. Tag + // keys can have a maximum character length of 128 characters. Tag values can + // have a maximum length of 256 characters. // - // Arn is a required field - Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` + // Tags is a required field + Tags []*Tag `type:"list" required:"true"` } // String returns the string representation -func (s StopRunInput) String() string { +func (s TagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s StopRunInput) GoString() string { +func (s TagResourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *StopRunInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopRunInput"} - if s.Arn == nil { - invalidParams.Add(request.NewErrParamRequired("Arn")) +func (s *TagResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} + if s.ResourceARN == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceARN")) } - if s.Arn != nil && len(*s.Arn) < 32 { - invalidParams.Add(request.NewErrParamMinLen("Arn", 32)) + if s.ResourceARN != nil && len(*s.ResourceARN) < 32 { + invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 32)) + } + 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 { @@ -15242,559 +18136,505 @@ func (s *StopRunInput) Validate() error { return nil } -// SetArn sets the Arn field's value. -func (s *StopRunInput) SetArn(v string) *StopRunInput { - s.Arn = &v +// SetResourceARN sets the ResourceARN field's value. +func (s *TagResourceInput) SetResourceARN(v string) *TagResourceInput { + s.ResourceARN = &v return s } -// Represents the results of your stop run attempt. -type StopRunOutput struct { - _ struct{} `type:"structure"` +// SetTags sets the Tags field's value. +func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { + s.Tags = v + return s +} - // The run that was stopped. - Run *Run `locationName:"run" type:"structure"` +type TagResourceOutput struct { + _ struct{} `type:"structure"` } // String returns the string representation -func (s StopRunOutput) String() string { +func (s TagResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s StopRunOutput) GoString() string { +func (s TagResourceOutput) GoString() string { return s.String() } -// SetRun sets the Run field's value. -func (s *StopRunOutput) SetRun(v *Run) *StopRunOutput { - s.Run = v - return s -} - -// Represents a collection of one or more tests. -type Suite struct { +// Represents a condition that is evaluated. +type Test struct { _ struct{} `type:"structure"` - // The suite's ARN. + // The test's ARN. Arn *string `locationName:"arn" min:"32" type:"string"` - // The suite's result counters. + // The test's result counters. Counters *Counters `locationName:"counters" type:"structure"` - // When the suite was created. + // When the test was created. Created *time.Time `locationName:"created" type:"timestamp"` - // Represents the total (metered or unmetered) minutes used by the test suite. + // Represents the total (metered or unmetered) minutes used by the test. DeviceMinutes *DeviceMinutes `locationName:"deviceMinutes" type:"structure"` - // A message about the suite's result. + // A message about the test's result. Message *string `locationName:"message" type:"string"` - // The suite's name. + // The test's name. Name *string `locationName:"name" type:"string"` - // The suite's result. + // The test's result. // // Allowed values include: // - // * PENDING: A pending condition. + // * PENDING // - // * PASSED: A passing condition. + // * PASSED // - // * WARNED: A warning condition. + // * WARNED // - // * FAILED: A failed condition. + // * FAILED // - // * SKIPPED: A skipped condition. + // * SKIPPED // - // * ERRORED: An error condition. + // * ERRORED // - // * STOPPED: A stopped condition. + // * STOPPED Result *string `locationName:"result" type:"string" enum:"ExecutionResult"` - // The suite's start time. + // The test's start time. Started *time.Time `locationName:"started" type:"timestamp"` - // The suite's status. + // The test's status. // // Allowed values include: // - // * PENDING: A pending status. + // * PENDING // - // * PENDING_CONCURRENCY: A pending concurrency status. + // * PENDING_CONCURRENCY // - // * PENDING_DEVICE: A pending device status. + // * PENDING_DEVICE // - // * PROCESSING: A processing status. + // * PROCESSING // - // * SCHEDULING: A scheduling status. + // * SCHEDULING // - // * PREPARING: A preparing status. + // * PREPARING // - // * RUNNING: A running status. + // * RUNNING // - // * COMPLETED: A completed status. + // * COMPLETED // - // * STOPPING: A stopping status. + // * STOPPING Status *string `locationName:"status" type:"string" enum:"ExecutionStatus"` - // The suite's stop time. + // The test's stop time. Stopped *time.Time `locationName:"stopped" type:"timestamp"` - // The suite's type. + // The test's type. // // Must be one of the following values: // - // * BUILTIN_FUZZ: The built-in fuzz type. + // * BUILTIN_FUZZ // - // * BUILTIN_EXPLORER: For Android, an app explorer that will traverse an - // Android app, interacting with it and capturing screenshots at the same - // time. + // * BUILTIN_EXPLORER For Android, an app explorer that traverses an Android + // app, interacting with it and capturing screenshots at the same time. // - // * APPIUM_JAVA_JUNIT: The Appium Java JUnit type. + // * APPIUM_JAVA_JUNIT // - // * APPIUM_JAVA_TESTNG: The Appium Java TestNG type. + // * APPIUM_JAVA_TESTNG // - // * APPIUM_PYTHON: The Appium Python type. + // * APPIUM_PYTHON // - // * APPIUM_NODE: The Appium Node.js type. + // * APPIUM_NODE // - // * APPIUM_RUBY: The Appium Ruby type. + // * APPIUM_RUBY // - // * APPIUM_WEB_JAVA_JUNIT: The Appium Java JUnit type for web apps. + // * APPIUM_WEB_JAVA_JUNIT // - // * APPIUM_WEB_JAVA_TESTNG: The Appium Java TestNG type for web apps. + // * APPIUM_WEB_JAVA_TESTNG // - // * APPIUM_WEB_PYTHON: The Appium Python type for web apps. + // * APPIUM_WEB_PYTHON // - // * APPIUM_WEB_NODE: The Appium Node.js type for web apps. + // * APPIUM_WEB_NODE // - // * APPIUM_WEB_RUBY: The Appium Ruby type for web apps. + // * APPIUM_WEB_RUBY // - // * CALABASH: The Calabash type. + // * CALABASH // - // * INSTRUMENTATION: The Instrumentation type. + // * INSTRUMENTATION // - // * UIAUTOMATION: The uiautomation type. + // * UIAUTOMATION // - // * UIAUTOMATOR: The uiautomator type. + // * UIAUTOMATOR // - // * XCTEST: The Xcode test type. + // * XCTEST // - // * XCTEST_UI: The Xcode UI test type. + // * XCTEST_UI Type *string `locationName:"type" type:"string" enum:"TestType"` } // String returns the string representation -func (s Suite) String() string { +func (s Test) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Suite) GoString() string { +func (s Test) GoString() string { return s.String() } // SetArn sets the Arn field's value. -func (s *Suite) SetArn(v string) *Suite { +func (s *Test) SetArn(v string) *Test { s.Arn = &v return s } // SetCounters sets the Counters field's value. -func (s *Suite) SetCounters(v *Counters) *Suite { +func (s *Test) SetCounters(v *Counters) *Test { s.Counters = v return s } // SetCreated sets the Created field's value. -func (s *Suite) SetCreated(v time.Time) *Suite { +func (s *Test) SetCreated(v time.Time) *Test { s.Created = &v return s } // SetDeviceMinutes sets the DeviceMinutes field's value. -func (s *Suite) SetDeviceMinutes(v *DeviceMinutes) *Suite { +func (s *Test) SetDeviceMinutes(v *DeviceMinutes) *Test { s.DeviceMinutes = v return s } // SetMessage sets the Message field's value. -func (s *Suite) SetMessage(v string) *Suite { +func (s *Test) SetMessage(v string) *Test { s.Message = &v return s } // SetName sets the Name field's value. -func (s *Suite) SetName(v string) *Suite { +func (s *Test) SetName(v string) *Test { s.Name = &v return s } // SetResult sets the Result field's value. -func (s *Suite) SetResult(v string) *Suite { +func (s *Test) SetResult(v string) *Test { s.Result = &v return s } // SetStarted sets the Started field's value. -func (s *Suite) SetStarted(v time.Time) *Suite { +func (s *Test) SetStarted(v time.Time) *Test { s.Started = &v return s } // SetStatus sets the Status field's value. -func (s *Suite) SetStatus(v string) *Suite { +func (s *Test) SetStatus(v string) *Test { s.Status = &v return s } // SetStopped sets the Stopped field's value. -func (s *Suite) SetStopped(v time.Time) *Suite { +func (s *Test) SetStopped(v time.Time) *Test { s.Stopped = &v return s } // SetType sets the Type field's value. -func (s *Suite) SetType(v string) *Suite { +func (s *Test) SetType(v string) *Test { s.Type = &v return s } -// The metadata that you apply to a resource to help you categorize and organize -// it. Each tag consists of a key and an optional value, both of which you define. -// Tag keys can have a maximum character length of 128 characters, and tag values -// can have a maximum length of 256 characters. -type Tag struct { +// A Selenium testing project. Projects are used to collect and collate sessions. +type TestGridProject struct { _ struct{} `type:"structure"` - // One part of a key-value pair that make up a tag. A key is a general label - // that acts like a category for more specific tag values. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` + // The ARN for the project. + Arn *string `locationName:"arn" min:"32" type:"string"` - // The optional part of a key-value pair that make up a tag. A value acts as - // a descriptor within a tag category (key). - // - // Value is a required field - Value *string `type:"string" required:"true"` + // When the project was created. + Created *time.Time `locationName:"created" type:"timestamp"` + + // A human-readable description for the project. + Description *string `locationName:"description" type:"string"` + + // A human-readable name for the project. + Name *string `locationName:"name" type:"string"` } // String returns the string representation -func (s Tag) String() string { +func (s TestGridProject) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Tag) GoString() string { +func (s TestGridProject) 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")) - } +// SetArn sets the Arn field's value. +func (s *TestGridProject) SetArn(v string) *TestGridProject { + s.Arn = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCreated sets the Created field's value. +func (s *TestGridProject) SetCreated(v time.Time) *TestGridProject { + s.Created = &v + return s } -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v +// SetDescription sets the Description field's value. +func (s *TestGridProject) SetDescription(v string) *TestGridProject { + s.Description = &v return s } -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v +// SetName sets the Name field's value. +func (s *TestGridProject) SetName(v string) *TestGridProject { + s.Name = &v return s } -type TagResourceInput struct { +// A TestGridSession is a single instance of a browser launched from the URL +// provided by a call to CreateTestGridUrl. +type TestGridSession struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the resource(s) to which to add tags. You - // can associate tags with the following Device Farm resources: PROJECT, RUN, - // NETWORK_PROFILE, INSTANCE_PROFILE, DEVICE_INSTANCE, SESSION, DEVICE_POOL, - // DEVICE, and VPCE_CONFIGURATION. - // - // ResourceARN is a required field - ResourceARN *string `min:"32" type:"string" required:"true"` + // The ARN of the session. + Arn *string `locationName:"arn" min:"32" type:"string"` - // The tags to add to the resource. A tag is an array of key-value pairs. Tag - // keys can have a maximum character length of 128 characters, and tag values - // can have a maximum length of 256 characters. - // - // Tags is a required field - Tags []*Tag `type:"list" required:"true"` + // The number of billed minutes that were used for this session. + BillingMinutes *float64 `locationName:"billingMinutes" type:"double"` + + // The time that the session was started. + Created *time.Time `locationName:"created" type:"timestamp"` + + // The time the session ended. + Ended *time.Time `locationName:"ended" type:"timestamp"` + + // A JSON object of options and parameters passed to the Selenium WebDriver. + SeleniumProperties *string `locationName:"seleniumProperties" type:"string"` + + // The state of the session. + Status *string `locationName:"status" type:"string" enum:"TestGridSessionStatus"` } // String returns the string representation -func (s TagResourceInput) String() string { +func (s TestGridSession) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TagResourceInput) GoString() string { +func (s TestGridSession) 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) < 32 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 32)) - } - 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)) - } - } - } +// SetArn sets the Arn field's value. +func (s *TestGridSession) SetArn(v string) *TestGridSession { + s.Arn = &v + return s +} + +// SetBillingMinutes sets the BillingMinutes field's value. +func (s *TestGridSession) SetBillingMinutes(v float64) *TestGridSession { + s.BillingMinutes = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCreated sets the Created field's value. +func (s *TestGridSession) SetCreated(v time.Time) *TestGridSession { + s.Created = &v + return s } -// SetResourceARN sets the ResourceARN field's value. -func (s *TagResourceInput) SetResourceARN(v string) *TagResourceInput { - s.ResourceARN = &v +// SetEnded sets the Ended field's value. +func (s *TestGridSession) SetEnded(v time.Time) *TestGridSession { + s.Ended = &v return s } -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v +// SetSeleniumProperties sets the SeleniumProperties field's value. +func (s *TestGridSession) SetSeleniumProperties(v string) *TestGridSession { + s.SeleniumProperties = &v return s } -type TagResourceOutput struct { +// SetStatus sets the Status field's value. +func (s *TestGridSession) SetStatus(v string) *TestGridSession { + s.Status = &v + return s +} + +// An action taken by a TestGridSession browser instance. +type TestGridSessionAction struct { _ struct{} `type:"structure"` + + // The action taken by the session. + Action *string `locationName:"action" type:"string"` + + // The time, in milliseconds, that the action took to complete in the browser. + Duration *int64 `locationName:"duration" type:"long"` + + // HTTP method that the browser used to make the request. + RequestMethod *string `locationName:"requestMethod" type:"string"` + + // The time that the session invoked the action. + Started *time.Time `locationName:"started" type:"timestamp"` + + // HTTP status code returned to the browser when the action was taken. + StatusCode *string `locationName:"statusCode" type:"string"` } // String returns the string representation -func (s TagResourceOutput) String() string { +func (s TestGridSessionAction) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TagResourceOutput) GoString() string { +func (s TestGridSessionAction) GoString() string { return s.String() } -// Represents a condition that is evaluated. -type Test struct { - _ struct{} `type:"structure"` - - // The test's ARN. - Arn *string `locationName:"arn" min:"32" type:"string"` - - // The test's result counters. - Counters *Counters `locationName:"counters" type:"structure"` - - // When the test was created. - Created *time.Time `locationName:"created" type:"timestamp"` +// SetAction sets the Action field's value. +func (s *TestGridSessionAction) SetAction(v string) *TestGridSessionAction { + s.Action = &v + return s +} - // Represents the total (metered or unmetered) minutes used by the test. - DeviceMinutes *DeviceMinutes `locationName:"deviceMinutes" type:"structure"` +// SetDuration sets the Duration field's value. +func (s *TestGridSessionAction) SetDuration(v int64) *TestGridSessionAction { + s.Duration = &v + return s +} - // A message about the test's result. - Message *string `locationName:"message" type:"string"` +// SetRequestMethod sets the RequestMethod field's value. +func (s *TestGridSessionAction) SetRequestMethod(v string) *TestGridSessionAction { + s.RequestMethod = &v + return s +} - // The test's name. - Name *string `locationName:"name" type:"string"` +// SetStarted sets the Started field's value. +func (s *TestGridSessionAction) SetStarted(v time.Time) *TestGridSessionAction { + s.Started = &v + return s +} - // The test's result. - // - // Allowed values include: - // - // * PENDING: A pending condition. - // - // * PASSED: A passing condition. - // - // * WARNED: A warning condition. - // - // * FAILED: A failed condition. - // - // * SKIPPED: A skipped condition. - // - // * ERRORED: An error condition. - // - // * STOPPED: A stopped condition. - Result *string `locationName:"result" type:"string" enum:"ExecutionResult"` +// SetStatusCode sets the StatusCode field's value. +func (s *TestGridSessionAction) SetStatusCode(v string) *TestGridSessionAction { + s.StatusCode = &v + return s +} - // The test's start time. - Started *time.Time `locationName:"started" type:"timestamp"` +// Artifacts are video and other files that are produced in the process of running +// a browser in an automated context. +// +// Video elements might be broken up into multiple artifacts as they grow in +// size during creation. +type TestGridSessionArtifact struct { + _ struct{} `type:"structure"` - // The test's status. - // - // Allowed values include: - // - // * PENDING: A pending status. - // - // * PENDING_CONCURRENCY: A pending concurrency status. - // - // * PENDING_DEVICE: A pending device status. - // - // * PROCESSING: A processing status. - // - // * SCHEDULING: A scheduling status. - // - // * PREPARING: A preparing status. - // - // * RUNNING: A running status. - // - // * COMPLETED: A completed status. - // - // * STOPPING: A stopping status. - Status *string `locationName:"status" type:"string" enum:"ExecutionStatus"` + // The file name of the artifact. + Filename *string `locationName:"filename" type:"string"` - // The test's stop time. - Stopped *time.Time `locationName:"stopped" type:"timestamp"` + // The kind of artifact. + Type *string `locationName:"type" type:"string" enum:"TestGridSessionArtifactType"` - // The test's type. - // - // Must be one of the following values: - // - // * BUILTIN_FUZZ: The built-in fuzz type. - // - // * BUILTIN_EXPLORER: For Android, an app explorer that will traverse an - // Android app, interacting with it and capturing screenshots at the same - // time. - // - // * APPIUM_JAVA_JUNIT: The Appium Java JUnit type. - // - // * APPIUM_JAVA_TESTNG: The Appium Java TestNG type. - // - // * APPIUM_PYTHON: The Appium Python type. - // - // * APPIUM_NODE: The Appium Node.js type. - // - // * APPIUM_RUBY: The Appium Ruby type. - // - // * APPIUM_WEB_JAVA_JUNIT: The Appium Java JUnit type for web apps. - // - // * APPIUM_WEB_JAVA_TESTNG: The Appium Java TestNG type for web apps. - // - // * APPIUM_WEB_PYTHON: The Appium Python type for web apps. - // - // * APPIUM_WEB_NODE: The Appium Node.js type for web apps. - // - // * APPIUM_WEB_RUBY: The Appium Ruby type for web apps. - // - // * CALABASH: The Calabash type. - // - // * INSTRUMENTATION: The Instrumentation type. - // - // * UIAUTOMATION: The uiautomation type. - // - // * UIAUTOMATOR: The uiautomator type. - // - // * XCTEST: The Xcode test type. - // - // * XCTEST_UI: The Xcode UI test type. - Type *string `locationName:"type" type:"string" enum:"TestType"` + // A semi-stable URL to the content of the object. + Url *string `locationName:"url" type:"string"` } // String returns the string representation -func (s Test) String() string { +func (s TestGridSessionArtifact) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Test) GoString() string { +func (s TestGridSessionArtifact) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *Test) SetArn(v string) *Test { - s.Arn = &v +// SetFilename sets the Filename field's value. +func (s *TestGridSessionArtifact) SetFilename(v string) *TestGridSessionArtifact { + s.Filename = &v return s } -// SetCounters sets the Counters field's value. -func (s *Test) SetCounters(v *Counters) *Test { - s.Counters = v +// SetType sets the Type field's value. +func (s *TestGridSessionArtifact) SetType(v string) *TestGridSessionArtifact { + s.Type = &v return s } -// SetCreated sets the Created field's value. -func (s *Test) SetCreated(v time.Time) *Test { - s.Created = &v +// SetUrl sets the Url field's value. +func (s *TestGridSessionArtifact) SetUrl(v string) *TestGridSessionArtifact { + s.Url = &v return s } -// SetDeviceMinutes sets the DeviceMinutes field's value. -func (s *Test) SetDeviceMinutes(v *DeviceMinutes) *Test { - s.DeviceMinutes = v - return s +// The list of tags on the repository is over the limit. The maximum number +// of tags that can be applied to a repository is 50. +type TooManyTagsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + ResourceName *string `locationName:"resourceName" min:"32" type:"string"` } -// SetMessage sets the Message field's value. -func (s *Test) SetMessage(v string) *Test { - s.Message = &v - return s +// String returns the string representation +func (s TooManyTagsException) String() string { + return awsutil.Prettify(s) } -// SetName sets the Name field's value. -func (s *Test) SetName(v string) *Test { - s.Name = &v - return s +// GoString returns the string representation +func (s TooManyTagsException) GoString() string { + return s.String() } -// SetResult sets the Result field's value. -func (s *Test) SetResult(v string) *Test { - s.Result = &v - return s +func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { + return &TooManyTagsException{ + respMetadata: v, + } } -// SetStarted sets the Started field's value. -func (s *Test) SetStarted(v time.Time) *Test { - s.Started = &v - return s +// Code returns the exception type name. +func (s TooManyTagsException) Code() string { + return "TooManyTagsException" } -// SetStatus sets the Status field's value. -func (s *Test) SetStatus(v string) *Test { - s.Status = &v - return s +// Message returns the exception's message. +func (s TooManyTagsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetStopped sets the Stopped field's value. -func (s *Test) SetStopped(v time.Time) *Test { - s.Stopped = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTagsException) OrigErr() error { + return nil } -// SetType sets the Type field's value. -func (s *Test) SetType(v string) *Test { - s.Type = &v - return s +func (s TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTagsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyTagsException) RequestID() string { + return s.respMetadata.RequestID } // Represents information about free trial device minutes for an AWS account. @@ -15866,10 +18706,10 @@ func (s *UniqueProblem) SetProblems(v []*Problem) *UniqueProblem { type UntagResourceInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the resource(s) from which to delete tags. - // You can associate tags with the following Device Farm resources: PROJECT, - // RUN, NETWORK_PROFILE, INSTANCE_PROFILE, DEVICE_INSTANCE, SESSION, DEVICE_POOL, - // DEVICE, and VPCE_CONFIGURATION. + // The Amazon Resource Name (ARN) of the resource or resources from which to + // delete tags. You can associate tags with the following Device Farm resources: + // PROJECT, RUN, NETWORK_PROFILE, INSTANCE_PROFILE, DEVICE_INSTANCE, SESSION, + // DEVICE_POOL, DEVICE, and VPCE_CONFIGURATION. // // ResourceARN is a required field ResourceARN *string `min:"32" type:"string" required:"true"` @@ -15946,8 +18786,7 @@ type UpdateDeviceInstanceInput struct { // An array of strings that you want to associate with the device instance. Labels []*string `locationName:"labels" type:"list"` - // The Amazon Resource Name (ARN) of the profile that you want to associate - // with the device instance. + // The ARN of the profile that you want to associate with the device instance. ProfileArn *string `locationName:"profileArn" min:"32" type:"string"` } @@ -16001,7 +18840,7 @@ func (s *UpdateDeviceInstanceInput) SetProfileArn(v string) *UpdateDeviceInstanc type UpdateDeviceInstanceOutput struct { _ struct{} `type:"structure"` - // An object containing information about your device instance. + // An object that contains information about your device instance. DeviceInstance *DeviceInstance `locationName:"deviceInstance" type:"structure"` } @@ -16025,8 +18864,7 @@ func (s *UpdateDeviceInstanceOutput) SetDeviceInstance(v *DeviceInstance) *Updat type UpdateDevicePoolInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the Device Farm device pool you wish to - // update. + // The Amazon Resource Name (ARN) of the Device Farm device pool to update. // // Arn is a required field Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` @@ -16035,13 +18873,13 @@ type UpdateDevicePoolInput struct { // set this parameter to true, the maxDevices parameter does not apply, and // Device Farm does not limit the number of devices that it adds to your device // pool. In this case, Device Farm adds all available devices that meet the - // criteria that are specified for the rules parameter. + // criteria specified in the rules parameter. // // If you use this parameter in your request, you cannot use the maxDevices // parameter in the same request. ClearMaxDevices *bool `locationName:"clearMaxDevices" type:"boolean"` - // A description of the device pool you wish to update. + // A description of the device pool to update. Description *string `locationName:"description" type:"string"` // The number of devices that Device Farm can add to your device pool. Device @@ -16057,12 +18895,11 @@ type UpdateDevicePoolInput struct { // parameter in the same request. MaxDevices *int64 `locationName:"maxDevices" type:"integer"` - // A string representing the name of the device pool you wish to update. + // A string that represents the name of the device pool to update. Name *string `locationName:"name" type:"string"` - // Represents the rules you wish to modify for the device pool. Updating rules - // is optional; however, if you choose to update rules for your request, the - // update will replace the existing rules. + // Represents the rules to modify for the device pool. Updating rules is optional. + // If you update rules for your request, the update replaces the existing rules. Rules []*Rule `locationName:"rules" type:"list"` } @@ -16163,8 +19000,8 @@ type UpdateInstanceProfileInput struct { // The updated description for your instance profile. Description *string `locationName:"description" type:"string"` - // An array of strings specifying the list of app packages that should not be - // cleaned up from the device after a test run is over. + // An array of strings that specifies the list of app packages that should not + // be cleaned up from the device after a test run is over. // // The list of packages is only considered if you set packageCleanup to true. ExcludeAppPackagesFromCleanup []*string `locationName:"excludeAppPackagesFromCleanup" type:"list"` @@ -16246,7 +19083,7 @@ func (s *UpdateInstanceProfileInput) SetRebootAfterUse(v bool) *UpdateInstancePr type UpdateInstanceProfileOutput struct { _ struct{} `type:"structure"` - // An object containing information about your instance profile. + // An object that contains information about your instance profile. InstanceProfile *InstanceProfile `locationName:"instanceProfile" type:"structure"` } @@ -16295,8 +19132,8 @@ type UpdateNetworkProfileInput struct { // The name of the network profile about which you are returning information. Name *string `locationName:"name" type:"string"` - // The type of network profile you wish to return information about. Valid values - // are listed below. + // The type of network profile to return information about. Valid values are + // listed here. Type *string `locationName:"type" type:"string" enum:"NetworkProfileType"` // The data throughput rate in bits per second, as an integer from 0 to 104857600. @@ -16439,16 +19276,16 @@ func (s *UpdateNetworkProfileOutput) SetNetworkProfile(v *NetworkProfile) *Updat type UpdateProjectInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the project whose name you wish to update. + // The Amazon Resource Name (ARN) of the project whose name to update. // // Arn is a required field Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` - // The number of minutes a test run in the project will execute before it times + // The number of minutes a test run in the project executes before it times // out. DefaultJobTimeoutMinutes *int64 `locationName:"defaultJobTimeoutMinutes" type:"integer"` - // A string representing the new name of the project that you are updating. + // A string that represents the new name of the project that you are updating. Name *string `locationName:"name" type:"string"` } @@ -16500,7 +19337,7 @@ func (s *UpdateProjectInput) SetName(v string) *UpdateProjectInput { type UpdateProjectOutput struct { _ struct{} `type:"structure"` - // The project you wish to update. + // The project to update. Project *Project `locationName:"project" type:"structure"` } @@ -16520,6 +19357,94 @@ func (s *UpdateProjectOutput) SetProject(v *Project) *UpdateProjectOutput { return s } +type UpdateTestGridProjectInput struct { + _ struct{} `type:"structure"` + + // Human-readable description for the project. + Description *string `locationName:"description" min:"1" type:"string"` + + // Human-readable name for the project. + Name *string `locationName:"name" min:"1" type:"string"` + + // ARN of the project to update. + // + // ProjectArn is a required field + ProjectArn *string `locationName:"projectArn" min:"32" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateTestGridProjectInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTestGridProjectInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateTestGridProjectInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateTestGridProjectInput"} + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 1)) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.ProjectArn == nil { + invalidParams.Add(request.NewErrParamRequired("ProjectArn")) + } + if s.ProjectArn != nil && len(*s.ProjectArn) < 32 { + invalidParams.Add(request.NewErrParamMinLen("ProjectArn", 32)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDescription sets the Description field's value. +func (s *UpdateTestGridProjectInput) SetDescription(v string) *UpdateTestGridProjectInput { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateTestGridProjectInput) SetName(v string) *UpdateTestGridProjectInput { + s.Name = &v + return s +} + +// SetProjectArn sets the ProjectArn field's value. +func (s *UpdateTestGridProjectInput) SetProjectArn(v string) *UpdateTestGridProjectInput { + s.ProjectArn = &v + return s +} + +type UpdateTestGridProjectOutput struct { + _ struct{} `type:"structure"` + + // The project, including updated information. + TestGridProject *TestGridProject `locationName:"testGridProject" type:"structure"` +} + +// String returns the string representation +func (s UpdateTestGridProjectOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTestGridProjectOutput) GoString() string { + return s.String() +} + +// SetTestGridProject sets the TestGridProject field's value. +func (s *UpdateTestGridProjectOutput) SetTestGridProject(v *TestGridProject) *UpdateTestGridProjectOutput { + s.TestGridProject = v + return s +} + type UpdateUploadInput struct { _ struct{} `type:"structure"` @@ -16528,15 +19453,15 @@ type UpdateUploadInput struct { // Arn is a required field Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` - // The upload's content type (for example, "application/x-yaml"). + // The upload's content type (for example, application/x-yaml). ContentType *string `locationName:"contentType" type:"string"` - // Set to true if the YAML file has changed and needs to be updated; otherwise, + // Set to true if the YAML file has changed and must be updated. Otherwise, // set to false. EditContent *bool `locationName:"editContent" type:"boolean"` - // The upload's test spec file name. The name should not contain the '/' character. - // The test spec file name must end with the .yaml or .yml file extension. + // The upload's test spec file name. The name must not contain any forward slashes + // (/). The test spec file name must end with the .yaml or .yml file extension. Name *string `locationName:"name" type:"string"` } @@ -16622,19 +19547,19 @@ type UpdateVPCEConfigurationInput struct { // Arn is a required field Arn *string `locationName:"arn" min:"32" type:"string" required:"true"` - // The DNS (domain) name used to connect to your private service in your Amazon - // VPC. The DNS name must not already be in use on the Internet. + // The DNS (domain) name used to connect to your private service in your VPC. + // The DNS name must not already be in use on the internet. ServiceDnsName *string `locationName:"serviceDnsName" type:"string"` - // An optional description, providing more details about your VPC endpoint configuration. + // An optional description that provides details about your VPC endpoint configuration. VpceConfigurationDescription *string `locationName:"vpceConfigurationDescription" type:"string"` - // The friendly name you give to your VPC endpoint configuration, to manage - // your configurations more easily. + // The friendly name you give to your VPC endpoint configuration to manage your + // configurations more easily. VpceConfigurationName *string `locationName:"vpceConfigurationName" type:"string"` - // The name of the VPC endpoint service running inside your AWS account that - // you want Device Farm to test. + // The name of the VPC endpoint service running in your AWS account that you + // want Device Farm to test. VpceServiceName *string `locationName:"vpceServiceName" type:"string"` } @@ -16697,7 +19622,7 @@ func (s *UpdateVPCEConfigurationInput) SetVpceServiceName(v string) *UpdateVPCEC type UpdateVPCEConfigurationOutput struct { _ struct{} `type:"structure"` - // An object containing information about your VPC endpoint configuration. + // An object that contains information about your VPC endpoint configuration. VpceConfiguration *VPCEConfiguration `locationName:"vpceConfiguration" type:"structure"` } @@ -16731,7 +19656,7 @@ type Upload struct { // * PRIVATE: An upload managed by the AWS Device Farm customer. Category *string `locationName:"category" type:"string" enum:"UploadCategory"` - // The upload's content type (for example, "application/octet-stream"). + // The upload's content type (for example, application/octet-stream). ContentType *string `locationName:"contentType" type:"string"` // When the upload was created. @@ -16752,97 +19677,85 @@ type Upload struct { // // Must be one of the following values: // - // * FAILED: A failed status. + // * FAILED // - // * INITIALIZED: An initialized status. + // * INITIALIZED // - // * PROCESSING: A processing status. + // * PROCESSING // - // * SUCCEEDED: A succeeded status. + // * SUCCEEDED Status *string `locationName:"status" type:"string" enum:"UploadStatus"` // The upload's type. // // Must be one of the following values: // - // * ANDROID_APP: An Android upload. + // * ANDROID_APP // - // * IOS_APP: An iOS upload. + // * IOS_APP // - // * WEB_APP: A web application upload. + // * WEB_APP // - // * EXTERNAL_DATA: An external data upload. + // * EXTERNAL_DATA // - // * APPIUM_JAVA_JUNIT_TEST_PACKAGE: An Appium Java JUnit test package upload. + // * APPIUM_JAVA_JUNIT_TEST_PACKAGE // - // * APPIUM_JAVA_TESTNG_TEST_PACKAGE: An Appium Java TestNG test package - // upload. + // * APPIUM_JAVA_TESTNG_TEST_PACKAGE // - // * APPIUM_PYTHON_TEST_PACKAGE: An Appium Python test package upload. + // * APPIUM_PYTHON_TEST_PACKAGE // - // * APPIUM_NODE_TEST_PACKAGE: An Appium Node.js test package upload. + // * APPIUM_NODE_TEST_PACKAGE // - // * APPIUM_RUBY_TEST_PACKAGE: An Appium Ruby test package upload. + // * APPIUM_RUBY_TEST_PACKAGE // - // * APPIUM_WEB_JAVA_JUNIT_TEST_PACKAGE: An Appium Java JUnit test package - // upload for web apps. + // * APPIUM_WEB_JAVA_JUNIT_TEST_PACKAGE // - // * APPIUM_WEB_JAVA_TESTNG_TEST_PACKAGE: An Appium Java TestNG test package - // upload for web apps. + // * APPIUM_WEB_JAVA_TESTNG_TEST_PACKAGE // - // * APPIUM_WEB_PYTHON_TEST_PACKAGE: An Appium Python test package upload - // for web apps. + // * APPIUM_WEB_PYTHON_TEST_PACKAGE // - // * APPIUM_WEB_NODE_TEST_PACKAGE: An Appium Node.js test package upload - // for web apps. + // * APPIUM_WEB_NODE_TEST_PACKAGE // - // * APPIUM_WEB_RUBY_TEST_PACKAGE: An Appium Ruby test package upload for - // web apps. + // * APPIUM_WEB_RUBY_TEST_PACKAGE // - // * CALABASH_TEST_PACKAGE: A Calabash test package upload. + // * CALABASH_TEST_PACKAGE // - // * INSTRUMENTATION_TEST_PACKAGE: An instrumentation upload. + // * INSTRUMENTATION_TEST_PACKAGE // - // * UIAUTOMATION_TEST_PACKAGE: A uiautomation test package upload. + // * UIAUTOMATION_TEST_PACKAGE // - // * UIAUTOMATOR_TEST_PACKAGE: A uiautomator test package upload. + // * UIAUTOMATOR_TEST_PACKAGE // - // * XCTEST_TEST_PACKAGE: An Xcode test package upload. + // * XCTEST_TEST_PACKAGE // - // * XCTEST_UI_TEST_PACKAGE: An Xcode UI test package upload. + // * XCTEST_UI_TEST_PACKAGE // - // * APPIUM_JAVA_JUNIT_TEST_SPEC: An Appium Java JUnit test spec upload. + // * APPIUM_JAVA_JUNIT_TEST_SPEC // - // * APPIUM_JAVA_TESTNG_TEST_SPEC: An Appium Java TestNG test spec upload. + // * APPIUM_JAVA_TESTNG_TEST_SPEC // - // * APPIUM_PYTHON_TEST_SPEC: An Appium Python test spec upload. + // * APPIUM_PYTHON_TEST_SPEC // - // * APPIUM_NODE_TEST_SPEC: An Appium Node.js test spec upload. + // * APPIUM_NODE_TEST_SPEC // - // * APPIUM_RUBY_TEST_SPEC: An Appium Ruby test spec upload. + // * APPIUM_RUBY_TEST_SPEC // - // * APPIUM_WEB_JAVA_JUNIT_TEST_SPEC: An Appium Java JUnit test spec upload - // for a web app. + // * APPIUM_WEB_JAVA_JUNIT_TEST_SPEC // - // * APPIUM_WEB_JAVA_TESTNG_TEST_SPEC: An Appium Java TestNG test spec upload - // for a web app. + // * APPIUM_WEB_JAVA_TESTNG_TEST_SPEC // - // * APPIUM_WEB_PYTHON_TEST_SPEC: An Appium Python test spec upload for a - // web app. + // * APPIUM_WEB_PYTHON_TEST_SPEC // - // * APPIUM_WEB_NODE_TEST_SPEC: An Appium Node.js test spec upload for a - // web app. + // * APPIUM_WEB_NODE_TEST_SPEC // - // * APPIUM_WEB_RUBY_TEST_SPEC: An Appium Ruby test spec upload for a web - // app. + // * APPIUM_WEB_RUBY_TEST_SPEC // - // * INSTRUMENTATION_TEST_SPEC: An instrumentation test spec upload. + // * INSTRUMENTATION_TEST_SPEC // - // * XCTEST_UI_TEST_SPEC: An Xcode UI test spec upload. + // * XCTEST_UI_TEST_SPEC Type *string `locationName:"type" type:"string" enum:"UploadType"` - // The pre-signed Amazon S3 URL that was used to store a file through a corresponding - // PUT request. + // The presigned Amazon S3 URL that was used to store a file using a PUT request. Url *string `locationName:"url" type:"string"` } @@ -16927,15 +19840,15 @@ type VPCEConfiguration struct { // to access. ServiceDnsName *string `locationName:"serviceDnsName" type:"string"` - // An optional description, providing more details about your VPC endpoint configuration. + // An optional description that provides details about your VPC endpoint configuration. VpceConfigurationDescription *string `locationName:"vpceConfigurationDescription" type:"string"` - // The friendly name you give to your VPC endpoint configuration, to manage - // your configurations more easily. + // The friendly name you give to your VPC endpoint configuration to manage your + // configurations more easily. VpceConfigurationName *string `locationName:"vpceConfigurationName" type:"string"` - // The name of the VPC endpoint service running inside your AWS account that - // you want Device Farm to test. + // The name of the VPC endpoint service running in your AWS account that you + // want Device Farm to test. VpceServiceName *string `locationName:"vpceServiceName" type:"string"` } @@ -17399,6 +20312,36 @@ const ( SampleTypeOpenglMaxDrawtime = "OPENGL_MAX_DRAWTIME" ) +const ( + // TestGridSessionArtifactCategoryVideo is a TestGridSessionArtifactCategory enum value + TestGridSessionArtifactCategoryVideo = "VIDEO" + + // TestGridSessionArtifactCategoryLog is a TestGridSessionArtifactCategory enum value + TestGridSessionArtifactCategoryLog = "LOG" +) + +const ( + // TestGridSessionArtifactTypeUnknown is a TestGridSessionArtifactType enum value + TestGridSessionArtifactTypeUnknown = "UNKNOWN" + + // TestGridSessionArtifactTypeVideo is a TestGridSessionArtifactType enum value + TestGridSessionArtifactTypeVideo = "VIDEO" + + // TestGridSessionArtifactTypeSeleniumLog is a TestGridSessionArtifactType enum value + TestGridSessionArtifactTypeSeleniumLog = "SELENIUM_LOG" +) + +const ( + // TestGridSessionStatusActive is a TestGridSessionStatus enum value + TestGridSessionStatusActive = "ACTIVE" + + // TestGridSessionStatusClosed is a TestGridSessionStatus enum value + TestGridSessionStatusClosed = "CLOSED" + + // TestGridSessionStatusErrored is a TestGridSessionStatus enum value + TestGridSessionStatusErrored = "ERRORED" +) + const ( // TestTypeBuiltinFuzz is a TestType enum value TestTypeBuiltinFuzz = "BUILTIN_FUZZ" diff --git a/vendor/github.com/aws/aws-sdk-go/service/devicefarm/doc.go b/vendor/github.com/aws/aws-sdk-go/service/devicefarm/doc.go index 35e8d6e4d4d..3c3881342d1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/devicefarm/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/devicefarm/doc.go @@ -3,9 +3,17 @@ // Package devicefarm provides the client and types for making API // requests to AWS Device Farm. // -// AWS Device Farm is a service that enables mobile app developers to test Android, -// iOS, and Fire OS apps on physical phones, tablets, and other devices in the -// cloud. +// Welcome to the AWS Device Farm API documentation, which contains APIs for: +// +// * Testing on desktop browsers Device Farm makes it possible for you to +// test your web applications on desktop browsers using Selenium. The APIs +// for desktop browser testing contain TestGrid in their names. For more +// information, see Testing Web Applications on Selenium with Device Farm +// (https://docs.aws.amazon.com/devicefarm/latest/testgrid/). +// +// * Testing on real mobile devices Device Farm makes it possible for you +// to test apps on physical phones, tablets, and other devices in the cloud. +// For more information, see the Device Farm Developer Guide (https://docs.aws.amazon.com/devicefarm/latest/developerguide/). // // See https://docs.aws.amazon.com/goto/WebAPI/devicefarm-2015-06-23 for more information on this service. // diff --git a/vendor/github.com/aws/aws-sdk-go/service/devicefarm/errors.go b/vendor/github.com/aws/aws-sdk-go/service/devicefarm/errors.go index 4a479520cbe..b56f95d69a1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/devicefarm/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/devicefarm/errors.go @@ -2,6 +2,10 @@ package devicefarm +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeArgumentException for service response error code @@ -10,12 +14,25 @@ const ( // An invalid argument was specified. ErrCodeArgumentException = "ArgumentException" + // ErrCodeCannotDeleteException for service response error code + // "CannotDeleteException". + // + // The requested object could not be deleted. + ErrCodeCannotDeleteException = "CannotDeleteException" + // ErrCodeIdempotencyException for service response error code // "IdempotencyException". // // An entity with the same name already exists. ErrCodeIdempotencyException = "IdempotencyException" + // ErrCodeInternalServiceException for service response error code + // "InternalServiceException". + // + // An internal exception was raised in the service. Contact aws-devicefarm-support@amazon.com + // (mailto:aws-devicefarm-support@amazon.com) if you see this error. + ErrCodeInternalServiceException = "InternalServiceException" + // ErrCodeInvalidOperationException for service response error code // "InvalidOperationException". // @@ -68,3 +85,18 @@ const ( // of tags that can be applied to a repository is 50. ErrCodeTooManyTagsException = "TooManyTagsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ArgumentException": newErrorArgumentException, + "CannotDeleteException": newErrorCannotDeleteException, + "IdempotencyException": newErrorIdempotencyException, + "InternalServiceException": newErrorInternalServiceException, + "InvalidOperationException": newErrorInvalidOperationException, + "LimitExceededException": newErrorLimitExceededException, + "NotEligibleException": newErrorNotEligibleException, + "NotFoundException": newErrorNotFoundException, + "ServiceAccountException": newErrorServiceAccountException, + "TagOperationException": newErrorTagOperationException, + "TagPolicyException": newErrorTagPolicyException, + "TooManyTagsException": newErrorTooManyTagsException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/devicefarm/service.go b/vendor/github.com/aws/aws-sdk-go/service/devicefarm/service.go index 0f2354a4e1c..ded494a33f0 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/devicefarm/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/devicefarm/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "devicefarm" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Device Farm" // ServiceID is a unique identifer of a specific service. + ServiceID = "Device Farm" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the DeviceFarm client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a DeviceFarm client from just a session. // svc := devicefarm.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := devicefarm.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *DeviceFarm { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *DeviceFarm { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *DeviceFarm { svc := &DeviceFarm{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-06-23", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/directconnect/api.go b/vendor/github.com/aws/aws-sdk-go/service/directconnect/api.go index 96c0a66b4fa..4cd291e1480 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/directconnect/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/directconnect/api.go @@ -67,11 +67,11 @@ func (c *DirectConnect) AcceptDirectConnectGatewayAssociationProposalRequest(inp // See the AWS API reference guide for AWS Direct Connect's // API operation AcceptDirectConnectGatewayAssociationProposal for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/AcceptDirectConnectGatewayAssociationProposal @@ -161,11 +161,11 @@ func (c *DirectConnect) AllocateConnectionOnInterconnectRequest(input *AllocateC // See the AWS API reference guide for AWS Direct Connect's // API operation AllocateConnectionOnInterconnect for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/AllocateConnectionOnInterconnect @@ -256,17 +256,17 @@ func (c *DirectConnect) AllocateHostedConnectionRequest(input *AllocateHostedCon // See the AWS API reference guide for AWS Direct Connect's // API operation AllocateHostedConnection for usage and error information. // -// Returned Error Codes: -// * ErrCodeDuplicateTagKeysException "DuplicateTagKeysException" +// Returned Error Types: +// * DuplicateTagKeysException // A tag key was specified more than once. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // You have reached the limit on the number of tags that can be assigned. // -// * ErrCodeServerException "DirectConnectServerException" +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/AllocateHostedConnection @@ -348,17 +348,17 @@ func (c *DirectConnect) AllocatePrivateVirtualInterfaceRequest(input *AllocatePr // See the AWS API reference guide for AWS Direct Connect's // API operation AllocatePrivateVirtualInterface for usage and error information. // -// Returned Error Codes: -// * ErrCodeDuplicateTagKeysException "DuplicateTagKeysException" +// Returned Error Types: +// * DuplicateTagKeysException // A tag key was specified more than once. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // You have reached the limit on the number of tags that can be assigned. // -// * ErrCodeServerException "DirectConnectServerException" +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/AllocatePrivateVirtualInterface @@ -448,17 +448,17 @@ func (c *DirectConnect) AllocatePublicVirtualInterfaceRequest(input *AllocatePub // See the AWS API reference guide for AWS Direct Connect's // API operation AllocatePublicVirtualInterface for usage and error information. // -// Returned Error Codes: -// * ErrCodeDuplicateTagKeysException "DuplicateTagKeysException" +// Returned Error Types: +// * DuplicateTagKeysException // A tag key was specified more than once. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // You have reached the limit on the number of tags that can be assigned. // -// * ErrCodeServerException "DirectConnectServerException" +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/AllocatePublicVirtualInterface @@ -546,17 +546,17 @@ func (c *DirectConnect) AllocateTransitVirtualInterfaceRequest(input *AllocateTr // See the AWS API reference guide for AWS Direct Connect's // API operation AllocateTransitVirtualInterface for usage and error information. // -// Returned Error Codes: -// * ErrCodeDuplicateTagKeysException "DuplicateTagKeysException" +// Returned Error Types: +// * DuplicateTagKeysException // A tag key was specified more than once. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // You have reached the limit on the number of tags that can be assigned. // -// * ErrCodeServerException "DirectConnectServerException" +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/AllocateTransitVirtualInterface @@ -650,11 +650,11 @@ func (c *DirectConnect) AssociateConnectionWithLagRequest(input *AssociateConnec // See the AWS API reference guide for AWS Direct Connect's // API operation AssociateConnectionWithLag for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/AssociateConnectionWithLag @@ -738,11 +738,11 @@ func (c *DirectConnect) AssociateHostedConnectionRequest(input *AssociateHostedC // See the AWS API reference guide for AWS Direct Connect's // API operation AssociateHostedConnection for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/AssociateHostedConnection @@ -833,11 +833,11 @@ func (c *DirectConnect) AssociateVirtualInterfaceRequest(input *AssociateVirtual // See the AWS API reference guide for AWS Direct Connect's // API operation AssociateVirtualInterface for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/AssociateVirtualInterface @@ -919,11 +919,11 @@ func (c *DirectConnect) ConfirmConnectionRequest(input *ConfirmConnectionInput) // See the AWS API reference guide for AWS Direct Connect's // API operation ConfirmConnection for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/ConfirmConnection @@ -1005,11 +1005,11 @@ func (c *DirectConnect) ConfirmPrivateVirtualInterfaceRequest(input *ConfirmPriv // See the AWS API reference guide for AWS Direct Connect's // API operation ConfirmPrivateVirtualInterface for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/ConfirmPrivateVirtualInterface @@ -1090,11 +1090,11 @@ func (c *DirectConnect) ConfirmPublicVirtualInterfaceRequest(input *ConfirmPubli // See the AWS API reference guide for AWS Direct Connect's // API operation ConfirmPublicVirtualInterface for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/ConfirmPublicVirtualInterface @@ -1175,11 +1175,11 @@ func (c *DirectConnect) ConfirmTransitVirtualInterfaceRequest(input *ConfirmTran // See the AWS API reference guide for AWS Direct Connect's // API operation ConfirmTransitVirtualInterface for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/ConfirmTransitVirtualInterface @@ -1271,11 +1271,11 @@ func (c *DirectConnect) CreateBGPPeerRequest(input *CreateBGPPeerInput) (req *re // See the AWS API reference guide for AWS Direct Connect's // API operation CreateBGPPeer for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/CreateBGPPeer @@ -1366,17 +1366,17 @@ func (c *DirectConnect) CreateConnectionRequest(input *CreateConnectionInput) (r // See the AWS API reference guide for AWS Direct Connect's // API operation CreateConnection for usage and error information. // -// Returned Error Codes: -// * ErrCodeDuplicateTagKeysException "DuplicateTagKeysException" +// Returned Error Types: +// * DuplicateTagKeysException // A tag key was specified more than once. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // You have reached the limit on the number of tags that can be assigned. // -// * ErrCodeServerException "DirectConnectServerException" +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/CreateConnection @@ -1460,11 +1460,11 @@ func (c *DirectConnect) CreateDirectConnectGatewayRequest(input *CreateDirectCon // See the AWS API reference guide for AWS Direct Connect's // API operation CreateDirectConnectGateway for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/CreateDirectConnectGateway @@ -1544,11 +1544,11 @@ func (c *DirectConnect) CreateDirectConnectGatewayAssociationRequest(input *Crea // See the AWS API reference guide for AWS Direct Connect's // API operation CreateDirectConnectGatewayAssociation for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/CreateDirectConnectGatewayAssociation @@ -1632,11 +1632,11 @@ func (c *DirectConnect) CreateDirectConnectGatewayAssociationProposalRequest(inp // See the AWS API reference guide for AWS Direct Connect's // API operation CreateDirectConnectGatewayAssociationProposal for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/CreateDirectConnectGatewayAssociationProposal @@ -1736,17 +1736,17 @@ func (c *DirectConnect) CreateInterconnectRequest(input *CreateInterconnectInput // See the AWS API reference guide for AWS Direct Connect's // API operation CreateInterconnect for usage and error information. // -// Returned Error Codes: -// * ErrCodeDuplicateTagKeysException "DuplicateTagKeysException" +// Returned Error Types: +// * DuplicateTagKeysException // A tag key was specified more than once. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // You have reached the limit on the number of tags that can be assigned. // -// * ErrCodeServerException "DirectConnectServerException" +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/CreateInterconnect @@ -1848,17 +1848,17 @@ func (c *DirectConnect) CreateLagRequest(input *CreateLagInput) (req *request.Re // See the AWS API reference guide for AWS Direct Connect's // API operation CreateLag for usage and error information. // -// Returned Error Codes: -// * ErrCodeDuplicateTagKeysException "DuplicateTagKeysException" +// Returned Error Types: +// * DuplicateTagKeysException // A tag key was specified more than once. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // You have reached the limit on the number of tags that can be assigned. // -// * ErrCodeServerException "DirectConnectServerException" +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/CreateLag @@ -1942,17 +1942,17 @@ func (c *DirectConnect) CreatePrivateVirtualInterfaceRequest(input *CreatePrivat // See the AWS API reference guide for AWS Direct Connect's // API operation CreatePrivateVirtualInterface for usage and error information. // -// Returned Error Codes: -// * ErrCodeDuplicateTagKeysException "DuplicateTagKeysException" +// Returned Error Types: +// * DuplicateTagKeysException // A tag key was specified more than once. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // You have reached the limit on the number of tags that can be assigned. // -// * ErrCodeServerException "DirectConnectServerException" +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/CreatePrivateVirtualInterface @@ -2036,17 +2036,17 @@ func (c *DirectConnect) CreatePublicVirtualInterfaceRequest(input *CreatePublicV // See the AWS API reference guide for AWS Direct Connect's // API operation CreatePublicVirtualInterface for usage and error information. // -// Returned Error Codes: -// * ErrCodeDuplicateTagKeysException "DuplicateTagKeysException" +// Returned Error Types: +// * DuplicateTagKeysException // A tag key was specified more than once. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // You have reached the limit on the number of tags that can be assigned. // -// * ErrCodeServerException "DirectConnectServerException" +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/CreatePublicVirtualInterface @@ -2133,17 +2133,17 @@ func (c *DirectConnect) CreateTransitVirtualInterfaceRequest(input *CreateTransi // See the AWS API reference guide for AWS Direct Connect's // API operation CreateTransitVirtualInterface for usage and error information. // -// Returned Error Codes: -// * ErrCodeDuplicateTagKeysException "DuplicateTagKeysException" +// Returned Error Types: +// * DuplicateTagKeysException // A tag key was specified more than once. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // You have reached the limit on the number of tags that can be assigned. // -// * ErrCodeServerException "DirectConnectServerException" +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/CreateTransitVirtualInterface @@ -2224,11 +2224,11 @@ func (c *DirectConnect) DeleteBGPPeerRequest(input *DeleteBGPPeerInput) (req *re // See the AWS API reference guide for AWS Direct Connect's // API operation DeleteBGPPeer for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DeleteBGPPeer @@ -2311,11 +2311,11 @@ func (c *DirectConnect) DeleteConnectionRequest(input *DeleteConnectionInput) (r // See the AWS API reference guide for AWS Direct Connect's // API operation DeleteConnection for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DeleteConnection @@ -2386,8 +2386,7 @@ func (c *DirectConnect) DeleteDirectConnectGatewayRequest(input *DeleteDirectCon // // Deletes the specified Direct Connect gateway. You must first delete all virtual // interfaces that are attached to the Direct Connect gateway and disassociate -// all virtual private gateways that are associated with the Direct Connect -// gateway. +// all virtual private gateways associated with the Direct Connect 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 @@ -2396,11 +2395,11 @@ func (c *DirectConnect) DeleteDirectConnectGatewayRequest(input *DeleteDirectCon // See the AWS API reference guide for AWS Direct Connect's // API operation DeleteDirectConnectGateway for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DeleteDirectConnectGateway @@ -2472,6 +2471,11 @@ func (c *DirectConnect) DeleteDirectConnectGatewayAssociationRequest(input *Dele // Deletes the association between the specified Direct Connect gateway and // virtual private gateway. // +// We recommend that you specify the associationID to delete the association. +// Alternatively, if you own virtual gateway and a Direct Connect gateway association, +// you can specify the virtualGatewayId and directConnectGatewayId to delete +// 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. @@ -2479,11 +2483,11 @@ func (c *DirectConnect) DeleteDirectConnectGatewayAssociationRequest(input *Dele // See the AWS API reference guide for AWS Direct Connect's // API operation DeleteDirectConnectGatewayAssociation for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DeleteDirectConnectGatewayAssociation @@ -2562,11 +2566,11 @@ func (c *DirectConnect) DeleteDirectConnectGatewayAssociationProposalRequest(inp // See the AWS API reference guide for AWS Direct Connect's // API operation DeleteDirectConnectGatewayAssociationProposal for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DeleteDirectConnectGatewayAssociationProposal @@ -2646,11 +2650,11 @@ func (c *DirectConnect) DeleteInterconnectRequest(input *DeleteInterconnectInput // See the AWS API reference guide for AWS Direct Connect's // API operation DeleteInterconnect for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DeleteInterconnect @@ -2729,11 +2733,11 @@ func (c *DirectConnect) DeleteLagRequest(input *DeleteLagInput) (req *request.Re // See the AWS API reference guide for AWS Direct Connect's // API operation DeleteLag for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DeleteLag @@ -2811,11 +2815,11 @@ func (c *DirectConnect) DeleteVirtualInterfaceRequest(input *DeleteVirtualInterf // See the AWS API reference guide for AWS Direct Connect's // API operation DeleteVirtualInterface for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DeleteVirtualInterface @@ -2906,11 +2910,11 @@ func (c *DirectConnect) DescribeConnectionLoaRequest(input *DescribeConnectionLo // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeConnectionLoa for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeConnectionLoa @@ -2992,11 +2996,11 @@ func (c *DirectConnect) DescribeConnectionsRequest(input *DescribeConnectionsInp // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeConnections for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeConnections @@ -3083,11 +3087,11 @@ func (c *DirectConnect) DescribeConnectionsOnInterconnectRequest(input *Describe // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeConnectionsOnInterconnect for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeConnectionsOnInterconnect @@ -3170,11 +3174,11 @@ func (c *DirectConnect) DescribeDirectConnectGatewayAssociationProposalsRequest( // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeDirectConnectGatewayAssociationProposals for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeDirectConnectGatewayAssociationProposals @@ -3259,11 +3263,11 @@ func (c *DirectConnect) DescribeDirectConnectGatewayAssociationsRequest(input *D // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeDirectConnectGatewayAssociations for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeDirectConnectGatewayAssociations @@ -3347,11 +3351,11 @@ func (c *DirectConnect) DescribeDirectConnectGatewayAttachmentsRequest(input *De // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeDirectConnectGatewayAttachments for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeDirectConnectGatewayAttachments @@ -3430,11 +3434,11 @@ func (c *DirectConnect) DescribeDirectConnectGatewaysRequest(input *DescribeDire // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeDirectConnectGateways for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeDirectConnectGateways @@ -3515,11 +3519,11 @@ func (c *DirectConnect) DescribeHostedConnectionsRequest(input *DescribeHostedCo // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeHostedConnections for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeHostedConnections @@ -3610,11 +3614,11 @@ func (c *DirectConnect) DescribeInterconnectLoaRequest(input *DescribeInterconne // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeInterconnectLoa for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeInterconnectLoa @@ -3696,11 +3700,11 @@ func (c *DirectConnect) DescribeInterconnectsRequest(input *DescribeInterconnect // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeInterconnects for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeInterconnects @@ -3778,11 +3782,11 @@ func (c *DirectConnect) DescribeLagsRequest(input *DescribeLagsInput) (req *requ // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeLags for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeLags @@ -3867,11 +3871,11 @@ func (c *DirectConnect) DescribeLoaRequest(input *DescribeLoaInput) (req *reques // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeLoa for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeLoa @@ -3950,11 +3954,11 @@ func (c *DirectConnect) DescribeLocationsRequest(input *DescribeLocationsInput) // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeLocations for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeLocations @@ -4032,11 +4036,11 @@ func (c *DirectConnect) DescribeTagsRequest(input *DescribeTagsInput) (req *requ // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeTags @@ -4117,11 +4121,11 @@ func (c *DirectConnect) DescribeVirtualGatewaysRequest(input *DescribeVirtualGat // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeVirtualGateways for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeVirtualGateways @@ -4206,11 +4210,11 @@ func (c *DirectConnect) DescribeVirtualInterfacesRequest(input *DescribeVirtualI // See the AWS API reference guide for AWS Direct Connect's // API operation DescribeVirtualInterfaces for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DescribeVirtualInterfaces @@ -4298,11 +4302,11 @@ func (c *DirectConnect) DisassociateConnectionFromLagRequest(input *Disassociate // See the AWS API reference guide for AWS Direct Connect's // API operation DisassociateConnectionFromLag for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/DisassociateConnectionFromLag @@ -4385,17 +4389,17 @@ func (c *DirectConnect) TagResourceRequest(input *TagResourceInput) (req *reques // See the AWS API reference guide for AWS Direct Connect's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeDuplicateTagKeysException "DuplicateTagKeysException" +// Returned Error Types: +// * DuplicateTagKeysException // A tag key was specified more than once. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // You have reached the limit on the number of tags that can be assigned. // -// * ErrCodeServerException "DirectConnectServerException" +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/TagResource @@ -4474,11 +4478,11 @@ func (c *DirectConnect) UntagResourceRequest(input *UntagResourceInput) (req *re // See the AWS API reference guide for AWS Direct Connect's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/UntagResource @@ -4558,11 +4562,11 @@ func (c *DirectConnect) UpdateDirectConnectGatewayAssociationRequest(input *Upda // See the AWS API reference guide for AWS Direct Connect's // API operation UpdateDirectConnectGatewayAssociation for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/UpdateDirectConnectGatewayAssociation @@ -4654,11 +4658,11 @@ func (c *DirectConnect) UpdateLagRequest(input *UpdateLagInput) (req *request.Re // See the AWS API reference guide for AWS Direct Connect's // API operation UpdateLag for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/UpdateLag @@ -4743,11 +4747,11 @@ func (c *DirectConnect) UpdateVirtualInterfaceAttributesRequest(input *UpdateVir // See the AWS API reference guide for AWS Direct Connect's // API operation UpdateVirtualInterfaceAttributes for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "DirectConnectServerException" +// Returned Error Types: +// * ServerException // A server-side error occurred. // -// * ErrCodeClientException "DirectConnectClientException" +// * ClientException // One or more parameters are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/directconnect-2012-10-25/UpdateVirtualInterfaceAttributes @@ -4999,7 +5003,7 @@ type AllocateHostedConnectionInput struct { // OwnerAccount is a required field OwnerAccount *string `locationName:"ownerAccount" type:"string" required:"true"` - // The tags to assign to the hosted connection. + // The tags associated with the connection. Tags []*Tag `locationName:"tags" min:"1" type:"list"` // The dedicated VLAN provisioned to the hosted connection. @@ -5654,6 +5658,62 @@ func (s *BGPPeer) SetCustomerAddress(v string) *BGPPeer { return s } +// One or more parameters are not valid. +type ClientException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ClientException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClientException) GoString() string { + return s.String() +} + +func newErrorClientException(v protocol.ResponseMetadata) error { + return &ClientException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ClientException) Code() string { + return "DirectConnectClientException" +} + +// Message returns the exception's message. +func (s ClientException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ClientException) OrigErr() error { + return nil +} + +func (s ClientException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ClientException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ClientException) RequestID() string { + return s.respMetadata.RequestID +} + type ConfirmConnectionInput struct { _ struct{} `type:"structure"` @@ -5745,7 +5805,7 @@ type ConfirmPrivateVirtualInterfaceInput struct { DirectConnectGatewayId *string `locationName:"directConnectGatewayId" type:"string"` // The ID of the virtual private gateway. - VirtualGatewayId *string `locationName:"virtualGatewayId" deprecated:"true" type:"string"` + VirtualGatewayId *string `locationName:"virtualGatewayId" type:"string"` // The ID of the virtual interface. // @@ -6107,10 +6167,13 @@ type Connection struct { // The name of the AWS Direct Connect service provider associated with the connection. PartnerName *string `locationName:"partnerName" type:"string"` + // The name of the service provider associated with the connection. + ProviderName *string `locationName:"providerName" type:"string"` + // The AWS Region where the connection is located. Region *string `locationName:"region" type:"string"` - // Any tags assigned to the connection. + // The tags associated with the connection. Tags []*Tag `locationName:"tags" min:"1" type:"list"` // The ID of the VLAN. @@ -6205,6 +6268,12 @@ func (s *Connection) SetPartnerName(v string) *Connection { return s } +// SetProviderName sets the ProviderName field's value. +func (s *Connection) SetProviderName(v string) *Connection { + s.ProviderName = &v + return s +} + // SetRegion sets the Region field's value. func (s *Connection) SetRegion(v string) *Connection { s.Region = &v @@ -6322,7 +6391,10 @@ type CreateConnectionInput struct { // Location is a required field Location *string `locationName:"location" type:"string" required:"true"` - // The tags to assign to the connection. + // The name of the service provider associated with the requested connection. + ProviderName *string `locationName:"providerName" type:"string"` + + // The tags to associate with the lag. Tags []*Tag `locationName:"tags" min:"1" type:"list"` } @@ -6392,6 +6464,12 @@ func (s *CreateConnectionInput) SetLocation(v string) *CreateConnectionInput { return s } +// SetProviderName sets the ProviderName field's value. +func (s *CreateConnectionInput) SetProviderName(v string) *CreateConnectionInput { + s.ProviderName = &v + return s +} + // SetTags sets the Tags field's value. func (s *CreateConnectionInput) SetTags(v []*Tag) *CreateConnectionInput { s.Tags = v @@ -6403,6 +6481,8 @@ type CreateDirectConnectGatewayAssociationInput struct { // The Amazon VPC prefixes to advertise to the Direct Connect gateway // + // This parameter is required when you create an association to a transit gateway. + // // For information about how to set the prefixes, see Allowed Prefixes (https://docs.aws.amazon.com/directconnect/latest/UserGuide/multi-account-associate-vgw.html#allowed-prefixes) // in the AWS Direct Connect User Guide. AddAllowedPrefixesToDirectConnectGateway []*RouteFilterPrefix `locationName:"addAllowedPrefixesToDirectConnectGateway" type:"list"` @@ -6416,7 +6496,7 @@ type CreateDirectConnectGatewayAssociationInput struct { GatewayId *string `locationName:"gatewayId" type:"string"` // The ID of the virtual private gateway. - VirtualGatewayId *string `locationName:"virtualGatewayId" deprecated:"true" type:"string"` + VirtualGatewayId *string `locationName:"virtualGatewayId" type:"string"` } // String returns the string representation @@ -6690,7 +6770,10 @@ type CreateInterconnectInput struct { // Location is a required field Location *string `locationName:"location" type:"string" required:"true"` - // The tags to assign to the interconnect, + // The name of the service provider associated with the interconnect. + ProviderName *string `locationName:"providerName" type:"string"` + + // The tags to associate with the interconnect. Tags []*Tag `locationName:"tags" min:"1" type:"list"` } @@ -6760,6 +6843,12 @@ func (s *CreateInterconnectInput) SetLocation(v string) *CreateInterconnectInput return s } +// SetProviderName sets the ProviderName field's value. +func (s *CreateInterconnectInput) SetProviderName(v string) *CreateInterconnectInput { + s.ProviderName = &v + return s +} + // SetTags sets the Tags field's value. func (s *CreateInterconnectInput) SetTags(v []*Tag) *CreateInterconnectInput { s.Tags = v @@ -6769,11 +6858,7 @@ func (s *CreateInterconnectInput) SetTags(v []*Tag) *CreateInterconnectInput { type CreateLagInput struct { _ struct{} `type:"structure"` - // The tags to assign to the child connections of the LAG. Only newly created - // child connections as the result of creating a LAG connection are assigned - // the provided tags. The tags are not assigned to an existing connection that - // is provided via the “connectionId” parameter that will be migrated to - // the LAG. + // The tags to associate with the automtically created LAGs. ChildConnectionTags []*Tag `locationName:"childConnectionTags" min:"1" type:"list"` // The ID of an existing connection to migrate to the LAG. @@ -6802,7 +6887,10 @@ type CreateLagInput struct { // NumberOfConnections is a required field NumberOfConnections *int64 `locationName:"numberOfConnections" type:"integer" required:"true"` - // The tags to assign to the link aggregation group (LAG). + // The name of the service provider associated with the LAG. + ProviderName *string `locationName:"providerName" type:"string"` + + // The tags to associate with the LAG. Tags []*Tag `locationName:"tags" min:"1" type:"list"` } @@ -6900,6 +6988,12 @@ func (s *CreateLagInput) SetNumberOfConnections(v int64) *CreateLagInput { return s } +// SetProviderName sets the ProviderName field's value. +func (s *CreateLagInput) SetProviderName(v string) *CreateLagInput { + s.ProviderName = &v + return s +} + // SetTags sets the Tags field's value. func (s *CreateLagInput) SetTags(v []*Tag) *CreateLagInput { s.Tags = v @@ -7221,7 +7315,7 @@ type DeleteDirectConnectGatewayAssociationInput struct { DirectConnectGatewayId *string `locationName:"directConnectGatewayId" type:"string"` // The ID of the virtual private gateway. - VirtualGatewayId *string `locationName:"virtualGatewayId" deprecated:"true" type:"string"` + VirtualGatewayId *string `locationName:"virtualGatewayId" type:"string"` } // String returns the string representation @@ -7863,7 +7957,7 @@ type DescribeDirectConnectGatewayAssociationsInput struct { NextToken *string `locationName:"nextToken" type:"string"` // The ID of the virtual private gateway. - VirtualGatewayId *string `locationName:"virtualGatewayId" deprecated:"true" type:"string"` + VirtualGatewayId *string `locationName:"virtualGatewayId" type:"string"` } // String returns the string representation @@ -8618,6 +8712,62 @@ func (s *DisassociateConnectionFromLagInput) SetLagId(v string) *DisassociateCon return s } +// A tag key was specified more than once. +type DuplicateTagKeysException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DuplicateTagKeysException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DuplicateTagKeysException) GoString() string { + return s.String() +} + +func newErrorDuplicateTagKeysException(v protocol.ResponseMetadata) error { + return &DuplicateTagKeysException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DuplicateTagKeysException) Code() string { + return "DuplicateTagKeysException" +} + +// Message returns the exception's message. +func (s DuplicateTagKeysException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DuplicateTagKeysException) OrigErr() error { + return nil +} + +func (s DuplicateTagKeysException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DuplicateTagKeysException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DuplicateTagKeysException) RequestID() string { + return s.respMetadata.RequestID +} + // Information about a Direct Connect gateway, which enables you to connect // virtual interfaces and virtual private gateway or transit gateways. type Gateway struct { @@ -8734,7 +8884,7 @@ type GatewayAssociation struct { StateChangeError *string `locationName:"stateChangeError" type:"string"` // The ID of the virtual private gateway. Applies only to private virtual interfaces. - VirtualGatewayId *string `locationName:"virtualGatewayId" deprecated:"true" type:"string"` + VirtualGatewayId *string `locationName:"virtualGatewayId" type:"string"` // The ID of the AWS account that owns the virtual private gateway. VirtualGatewayOwnerAccount *string `locationName:"virtualGatewayOwnerAccount" type:"string"` @@ -8921,7 +9071,7 @@ type GatewayAttachment struct { // is stopped. AttachmentState *string `locationName:"attachmentState" type:"string" enum:"GatewayAttachmentState"` - // The interface type. + // The type of attachment. AttachmentType *string `locationName:"attachmentType" type:"string" enum:"GatewayAttachmentType"` // The ID of the Direct Connect gateway. @@ -9047,10 +9197,13 @@ type Interconnect struct { // The location of the connection. Location *string `locationName:"location" type:"string"` + // The name of the service provider associated with the interconnect. + ProviderName *string `locationName:"providerName" type:"string"` + // The AWS Region where the connection is located. Region *string `locationName:"region" type:"string"` - // Any tags assigned to the interconnect. + // The tags associated with the interconnect. Tags []*Tag `locationName:"tags" min:"1" type:"list"` } @@ -9130,6 +9283,12 @@ func (s *Interconnect) SetLocation(v string) *Interconnect { return s } +// SetProviderName sets the ProviderName field's value. +func (s *Interconnect) SetProviderName(v string) *Interconnect { + s.ProviderName = &v + return s +} + // SetRegion sets the Region field's value. func (s *Interconnect) SetRegion(v string) *Interconnect { s.Region = &v @@ -9208,10 +9367,13 @@ type Lag struct { // The ID of the AWS account that owns the LAG. OwnerAccount *string `locationName:"ownerAccount" type:"string"` + // The name of the service provider associated with the LAG. + ProviderName *string `locationName:"providerName" type:"string"` + // The AWS Region where the connection is located. Region *string `locationName:"region" type:"string"` - // Any tags assigned to link aggregation group (LAG). + // The tags associated with the LAG. Tags []*Tag `locationName:"tags" min:"1" type:"list"` } @@ -9309,6 +9471,12 @@ func (s *Lag) SetOwnerAccount(v string) *Lag { return s } +// SetProviderName sets the ProviderName field's value. +func (s *Lag) SetProviderName(v string) *Lag { + s.ProviderName = &v + return s +} + // SetRegion sets the Region field's value. func (s *Lag) SetRegion(v string) *Lag { s.Region = &v @@ -9365,6 +9533,9 @@ type Location struct { // The available port speeds for the location. AvailablePortSpeeds []*string `locationName:"availablePortSpeeds" type:"list"` + // The name of the service provider for the location. + AvailableProviders []*string `locationName:"availableProviders" type:"list"` + // The code for the location. LocationCode *string `locationName:"locationCode" type:"string"` @@ -9392,6 +9563,12 @@ func (s *Location) SetAvailablePortSpeeds(v []*string) *Location { return s } +// SetAvailableProviders sets the AvailableProviders field's value. +func (s *Location) SetAvailableProviders(v []*string) *Location { + s.AvailableProviders = v + return s +} + // SetLocationCode sets the LocationCode field's value. func (s *Location) SetLocationCode(v string) *Location { s.LocationCode = &v @@ -9483,6 +9660,8 @@ type NewPrivateVirtualInterface struct { // The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration. // + // The valid values are 1-2147483647. + // // Asn is a required field Asn *int64 `locationName:"asn" type:"integer" required:"true"` @@ -9500,11 +9679,11 @@ type NewPrivateVirtualInterface struct { // and 9001. The default value is 1500. Mtu *int64 `locationName:"mtu" type:"integer"` - // Any tags assigned to the private virtual interface. + // The tags associated with the private virtual interface. Tags []*Tag `locationName:"tags" min:"1" type:"list"` // The ID of the virtual private gateway. - VirtualGatewayId *string `locationName:"virtualGatewayId" deprecated:"true" type:"string"` + VirtualGatewayId *string `locationName:"virtualGatewayId" type:"string"` // The name of the virtual interface assigned by the customer network. // @@ -9637,6 +9816,8 @@ type NewPrivateVirtualInterfaceAllocation struct { // The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration. // + // The valid values are 1-2147483647. + // // Asn is a required field Asn *int64 `locationName:"asn" type:"integer" required:"true"` @@ -9651,8 +9832,7 @@ type NewPrivateVirtualInterfaceAllocation struct { // and 9001. The default value is 1500. Mtu *int64 `locationName:"mtu" type:"integer"` - // Any tags assigned to the private virtual interface to be provisioned on a - // connection. + // The tags associated with the private virtual interface. Tags []*Tag `locationName:"tags" min:"1" type:"list"` // The name of the virtual interface assigned by the customer network. @@ -9774,6 +9954,8 @@ type NewPublicVirtualInterface struct { // The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration. // + // The valid values are 1-2147483647. + // // Asn is a required field Asn *int64 `locationName:"asn" type:"integer" required:"true"` @@ -9788,7 +9970,7 @@ type NewPublicVirtualInterface struct { // public virtual interfaces. RouteFilterPrefixes []*RouteFilterPrefix `locationName:"routeFilterPrefixes" type:"list"` - // Any tags assigned to the public virtual interface. + // The tags associated with the public virtual interface. Tags []*Tag `locationName:"tags" min:"1" type:"list"` // The name of the virtual interface assigned by the customer network. @@ -9910,6 +10092,8 @@ type NewPublicVirtualInterfaceAllocation struct { // The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration. // + // The valid values are 1-2147483647. + // // Asn is a required field Asn *int64 `locationName:"asn" type:"integer" required:"true"` @@ -9924,8 +10108,7 @@ type NewPublicVirtualInterfaceAllocation struct { // public virtual interfaces. RouteFilterPrefixes []*RouteFilterPrefix `locationName:"routeFilterPrefixes" type:"list"` - // Any tags assigned to the public virtual interface to be provisioned on a - // connection. + // The tags associated with the public virtual interface. Tags []*Tag `locationName:"tags" min:"1" type:"list"` // The name of the virtual interface assigned by the customer network. @@ -10035,7 +10218,7 @@ func (s *NewPublicVirtualInterfaceAllocation) SetVlan(v int64) *NewPublicVirtual return s } -// Information about the transit virtual interface. +// Information about a transit virtual interface. type NewTransitVirtualInterface struct { _ struct{} `type:"structure"` @@ -10046,9 +10229,12 @@ type NewTransitVirtualInterface struct { AmazonAddress *string `locationName:"amazonAddress" type:"string"` // The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration. + // + // The valid values are 1-2147483647. Asn *int64 `locationName:"asn" type:"integer"` - // The authentication key for BGP configuration. + // The authentication key for BGP configuration. This string has a minimum length + // of 6 characters and and a maximun lenth of 80 characters. AuthKey *string `locationName:"authKey" type:"string"` // The IP address assigned to the customer interface. @@ -10058,10 +10244,10 @@ type NewTransitVirtualInterface struct { DirectConnectGatewayId *string `locationName:"directConnectGatewayId" type:"string"` // The maximum transmission unit (MTU), in bytes. The supported values are 1500 - // and 8500. The default value is 1500. + // and 9001. The default value is 1500. Mtu *int64 `locationName:"mtu" type:"integer"` - // Any tags assigned to the transit virtual interface. + // The tags associated with the transitive virtual interface. Tags []*Tag `locationName:"tags" min:"1" type:"list"` // The name of the virtual interface assigned by the customer network. @@ -10164,7 +10350,7 @@ func (s *NewTransitVirtualInterface) SetVlan(v int64) *NewTransitVirtualInterfac return s } -// Information about a transit virtual interface. +// Information about a transit virtual interface to be provisioned on a connection. type NewTransitVirtualInterfaceAllocation struct { _ struct{} `type:"structure"` @@ -10175,19 +10361,22 @@ type NewTransitVirtualInterfaceAllocation struct { AmazonAddress *string `locationName:"amazonAddress" type:"string"` // The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration. + // + // The valid values are 1-2147483647. Asn *int64 `locationName:"asn" type:"integer"` - // The authentication key for BGP configuration. + // The authentication key for BGP configuration. This string has a minimum length + // of 6 characters and and a maximun lenth of 80 characters. AuthKey *string `locationName:"authKey" type:"string"` // The IP address assigned to the customer interface. CustomerAddress *string `locationName:"customerAddress" type:"string"` // The maximum transmission unit (MTU), in bytes. The supported values are 1500 - // and 8500. The default value is 1500. + // and 9001. The default value is 1500. Mtu *int64 `locationName:"mtu" type:"integer"` - // Any tags assigned to the transit virtual interface. + // The tags associated with the transitive virtual interface. Tags []*Tag `locationName:"tags" min:"1" type:"list"` // The name of the virtual interface assigned by the customer network. @@ -10343,6 +10532,62 @@ func (s *RouteFilterPrefix) SetCidr(v string) *RouteFilterPrefix { return s } +// A server-side error occurred. +type ServerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServerException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServerException) GoString() string { + return s.String() +} + +func newErrorServerException(v protocol.ResponseMetadata) error { + return &ServerException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServerException) Code() string { + return "DirectConnectServerException" +} + +// Message returns the exception's message. +func (s ServerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServerException) OrigErr() error { + return nil +} + +func (s ServerException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServerException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServerException) RequestID() string { + return s.respMetadata.RequestID +} + // Information about a tag. type Tag struct { _ struct{} `type:"structure"` @@ -10402,7 +10647,7 @@ type TagResourceInput struct { // ResourceArn is a required field ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"` - // The tags to assign. + // The tags to add. // // Tags is a required field Tags []*Tag `locationName:"tags" min:"1" type:"list" required:"true"` @@ -10473,6 +10718,62 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// You have reached the limit on the number of tags that can be assigned. +type TooManyTagsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyTagsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyTagsException) GoString() string { + return s.String() +} + +func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { + return &TooManyTagsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyTagsException) Code() string { + return "TooManyTagsException" +} + +// Message returns the exception's message. +func (s TooManyTagsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTagsException) OrigErr() error { + return nil +} + +func (s TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTagsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyTagsException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -10723,6 +11024,8 @@ type UpdateVirtualInterfaceAttributesOutput struct { AmazonSideAsn *int64 `locationName:"amazonSideAsn" type:"long"` // The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration. + // + // The valid values are 1-2147483647. Asn *int64 `locationName:"asn" type:"integer"` // The authentication key for BGP configuration. This string has a minimum length @@ -10767,11 +11070,11 @@ type UpdateVirtualInterfaceAttributesOutput struct { // public virtual interfaces. RouteFilterPrefixes []*RouteFilterPrefix `locationName:"routeFilterPrefixes" type:"list"` - // Any tags assigned to the virtual interface. + // The tags associated with the virtual interface. Tags []*Tag `locationName:"tags" min:"1" type:"list"` // The ID of the virtual private gateway. Applies only to private virtual interfaces. - VirtualGatewayId *string `locationName:"virtualGatewayId" deprecated:"true" type:"string"` + VirtualGatewayId *string `locationName:"virtualGatewayId" type:"string"` // The ID of the virtual interface. VirtualInterfaceId *string `locationName:"virtualInterfaceId" type:"string"` @@ -10977,7 +11280,7 @@ type VirtualGateway struct { _ struct{} `type:"structure"` // The ID of the virtual private gateway. - VirtualGatewayId *string `locationName:"virtualGatewayId" deprecated:"true" type:"string"` + VirtualGatewayId *string `locationName:"virtualGatewayId" type:"string"` // The state of the virtual private gateway. The following are the possible // values: @@ -11029,6 +11332,8 @@ type VirtualInterface struct { AmazonSideAsn *int64 `locationName:"amazonSideAsn" type:"long"` // The autonomous system (AS) number for Border Gateway Protocol (BGP) configuration. + // + // The valid values are 1-2147483647. Asn *int64 `locationName:"asn" type:"integer"` // The authentication key for BGP configuration. This string has a minimum length @@ -11073,11 +11378,11 @@ type VirtualInterface struct { // public virtual interfaces. RouteFilterPrefixes []*RouteFilterPrefix `locationName:"routeFilterPrefixes" type:"list"` - // Any tags assigned to the virtual interface. + // The tags associated with the virtual interface. Tags []*Tag `locationName:"tags" min:"1" type:"list"` // The ID of the virtual private gateway. Applies only to private virtual interfaces. - VirtualGatewayId *string `locationName:"virtualGatewayId" deprecated:"true" type:"string"` + VirtualGatewayId *string `locationName:"virtualGatewayId" type:"string"` // The ID of the virtual interface. VirtualInterfaceId *string `locationName:"virtualInterfaceId" type:"string"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/directconnect/errors.go b/vendor/github.com/aws/aws-sdk-go/service/directconnect/errors.go index 9d6f810311e..98915589ad9 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/directconnect/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/directconnect/errors.go @@ -2,6 +2,10 @@ package directconnect +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeClientException for service response error code @@ -28,3 +32,10 @@ const ( // You have reached the limit on the number of tags that can be assigned. ErrCodeTooManyTagsException = "TooManyTagsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "DirectConnectClientException": newErrorClientException, + "DuplicateTagKeysException": newErrorDuplicateTagKeysException, + "DirectConnectServerException": newErrorServerException, + "TooManyTagsException": newErrorTooManyTagsException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/directconnect/service.go b/vendor/github.com/aws/aws-sdk-go/service/directconnect/service.go index bb182821c59..1ed5cd0debd 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/directconnect/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/directconnect/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "directconnect" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Direct Connect" // ServiceID is a unique identifer of a specific service. + ServiceID = "Direct Connect" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the DirectConnect client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a DirectConnect client from just a session. // svc := directconnect.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := directconnect.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *DirectConnect { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *DirectConnect { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *DirectConnect { svc := &DirectConnect{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2012-10-25", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 8b62a2664aa..ce66195e46f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/directoryservice/api.go @@ -67,20 +67,20 @@ func (c *DirectoryService) AcceptSharedDirectoryRequest(input *AcceptSharedDirec // See the AWS API reference guide for AWS Directory Service's // API operation AcceptSharedDirectory for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeDirectoryAlreadySharedException "DirectoryAlreadySharedException" +// * DirectoryAlreadySharedException // The specified directory has already been shared with this AWS account. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AcceptSharedDirectory @@ -168,27 +168,27 @@ func (c *DirectoryService) AddIpRoutesRequest(input *AddIpRoutesInput) (req *req // See the AWS API reference guide for AWS Directory Service's // API operation AddIpRoutes for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExistsException" +// * EntityAlreadyExistsException // The specified entity already exists. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" +// * DirectoryUnavailableException // The specified directory is unavailable or could not be found. // -// * ErrCodeIpRouteLimitExceededException "IpRouteLimitExceededException" +// * IpRouteLimitExceededException // The maximum allowed number of IP addresses was exceeded. The default limit // is 100 IP address blocks. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AddIpRoutes @@ -269,20 +269,20 @@ func (c *DirectoryService) AddTagsToResourceRequest(input *AddTagsToResourceInpu // See the AWS API reference guide for AWS Directory Service's // API operation AddTagsToResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeTagLimitExceededException "TagLimitExceededException" +// * TagLimitExceededException // The maximum allowed number of tags was exceeded. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/AddTagsToResource @@ -364,14 +364,14 @@ func (c *DirectoryService) CancelSchemaExtensionRequest(input *CancelSchemaExten // See the AWS API reference guide for AWS Directory Service's // API operation CancelSchemaExtension for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CancelSchemaExtension @@ -454,19 +454,19 @@ func (c *DirectoryService) ConnectDirectoryRequest(input *ConnectDirectoryInput) // See the AWS API reference guide for AWS Directory Service's // API operation ConnectDirectory for usage and error information. // -// Returned Error Codes: -// * ErrCodeDirectoryLimitExceededException "DirectoryLimitExceededException" +// Returned Error Types: +// * 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" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ConnectDirectory @@ -549,20 +549,20 @@ func (c *DirectoryService) CreateAliasRequest(input *CreateAliasInput) (req *req // See the AWS API reference guide for AWS Directory Service's // API operation CreateAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExistsException" +// Returned Error Types: +// * EntityAlreadyExistsException // The specified entity already exists. // -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateAlias @@ -641,29 +641,29 @@ func (c *DirectoryService) CreateComputerRequest(input *CreateComputerInput) (re // See the AWS API reference guide for AWS Directory Service's // API operation CreateComputer for usage and error information. // -// Returned Error Codes: -// * ErrCodeAuthenticationFailedException "AuthenticationFailedException" +// Returned Error Types: +// * AuthenticationFailedException // An authentication error occurred. // -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" +// * DirectoryUnavailableException // The specified directory is unavailable or could not be found. // -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExistsException" +// * EntityAlreadyExistsException // The specified entity already exists. // -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateComputer @@ -744,26 +744,26 @@ func (c *DirectoryService) CreateConditionalForwarderRequest(input *CreateCondit // See the AWS API reference guide for AWS Directory Service's // API operation CreateConditionalForwarder for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExistsException" +// Returned Error Types: +// * EntityAlreadyExistsException // The specified entity already exists. // -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" +// * DirectoryUnavailableException // The specified directory is unavailable or could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateConditionalForwarder @@ -832,7 +832,9 @@ func (c *DirectoryService) CreateDirectoryRequest(input *CreateDirectoryInput) ( // CreateDirectory API operation for AWS Directory Service. // -// Creates a Simple AD directory. +// Creates a Simple AD directory. For more information, see Simple Active Directory +// (https://docs.aws.amazon.com/directoryservice/latest/admin-guide/directory_simple_ad.html) +// in the AWS Directory Service Admin Guide. // // Before you call CreateDirectory, ensure that all of the required permissions // have been explicitly granted through a policy. For details about what permissions @@ -846,19 +848,19 @@ func (c *DirectoryService) CreateDirectoryRequest(input *CreateDirectoryInput) ( // See the AWS API reference guide for AWS Directory Service's // API operation CreateDirectory for usage and error information. // -// Returned Error Codes: -// * ErrCodeDirectoryLimitExceededException "DirectoryLimitExceededException" +// Returned Error Types: +// * 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" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateDirectory @@ -928,8 +930,8 @@ func (c *DirectoryService) CreateLogSubscriptionRequest(input *CreateLogSubscrip // CreateLogSubscription API operation for AWS Directory Service. // -// Creates a subscription to forward real time Directory Service domain controller -// security logs to the specified CloudWatch log group in your AWS account. +// Creates a subscription to forward real-time Directory Service domain controller +// security logs to the specified Amazon CloudWatch log group 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 @@ -938,23 +940,23 @@ func (c *DirectoryService) CreateLogSubscriptionRequest(input *CreateLogSubscrip // See the AWS API reference guide for AWS Directory Service's // API operation CreateLogSubscription for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExistsException" +// Returned Error Types: +// * EntityAlreadyExistsException // The specified entity already exists. // -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // -// * ErrCodeInsufficientPermissionsException "InsufficientPermissionsException" +// * InsufficientPermissionsException // The account does not have sufficient permission to perform the operation. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateLogSubscription @@ -1023,7 +1025,9 @@ func (c *DirectoryService) CreateMicrosoftADRequest(input *CreateMicrosoftADInpu // CreateMicrosoftAD API operation for AWS Directory Service. // -// Creates an AWS Managed Microsoft AD directory. +// Creates a Microsoft AD directory in the AWS Cloud. For more information, +// see AWS Managed Microsoft AD (https://docs.aws.amazon.com/directoryservice/latest/admin-guide/directory_microsoft_ad.html) +// in the AWS Directory Service Admin Guide. // // Before you call CreateMicrosoftAD, ensure that all of the required permissions // have been explicitly granted through a policy. For details about what permissions @@ -1037,22 +1041,22 @@ func (c *DirectoryService) CreateMicrosoftADRequest(input *CreateMicrosoftADInpu // See the AWS API reference guide for AWS Directory Service's // API operation CreateMicrosoftAD for usage and error information. // -// Returned Error Codes: -// * ErrCodeDirectoryLimitExceededException "DirectoryLimitExceededException" +// Returned Error Types: +// * 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" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateMicrosoftAD @@ -1132,22 +1136,22 @@ func (c *DirectoryService) CreateSnapshotRequest(input *CreateSnapshotInput) (re // See the AWS API reference guide for AWS Directory Service's // API operation CreateSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeSnapshotLimitExceededException "SnapshotLimitExceededException" +// * 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" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateSnapshot @@ -1233,23 +1237,23 @@ func (c *DirectoryService) CreateTrustRequest(input *CreateTrustInput) (req *req // See the AWS API reference guide for AWS Directory Service's // API operation CreateTrust for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExistsException" +// Returned Error Types: +// * EntityAlreadyExistsException // The specified entity already exists. // -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/CreateTrust @@ -1328,23 +1332,23 @@ func (c *DirectoryService) DeleteConditionalForwarderRequest(input *DeleteCondit // See the AWS API reference guide for AWS Directory Service's // API operation DeleteConditionalForwarder for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" +// * DirectoryUnavailableException // The specified directory is unavailable or could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteConditionalForwarder @@ -1427,14 +1431,14 @@ func (c *DirectoryService) DeleteDirectoryRequest(input *DeleteDirectoryInput) ( // See the AWS API reference guide for AWS Directory Service's // API operation DeleteDirectory for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteDirectory @@ -1513,17 +1517,17 @@ func (c *DirectoryService) DeleteLogSubscriptionRequest(input *DeleteLogSubscrip // See the AWS API reference guide for AWS Directory Service's // API operation DeleteLogSubscription for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteLogSubscription @@ -1601,17 +1605,17 @@ func (c *DirectoryService) DeleteSnapshotRequest(input *DeleteSnapshotInput) (re // See the AWS API reference guide for AWS Directory Service's // API operation DeleteSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteSnapshot @@ -1690,20 +1694,20 @@ func (c *DirectoryService) DeleteTrustRequest(input *DeleteTrustInput) (req *req // See the AWS API reference guide for AWS Directory Service's // API operation DeleteTrust for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeleteTrust @@ -1728,6 +1732,109 @@ func (c *DirectoryService) DeleteTrustWithContext(ctx aws.Context, input *Delete return out, req.Send() } +const opDeregisterCertificate = "DeregisterCertificate" + +// DeregisterCertificateRequest generates a "aws/request.Request" representing the +// client's request for the DeregisterCertificate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeregisterCertificate for more information on using the DeregisterCertificate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeregisterCertificateRequest method. +// req, resp := client.DeregisterCertificateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeregisterCertificate +func (c *DirectoryService) DeregisterCertificateRequest(input *DeregisterCertificateInput) (req *request.Request, output *DeregisterCertificateOutput) { + op := &request.Operation{ + Name: opDeregisterCertificate, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeregisterCertificateInput{} + } + + output = &DeregisterCertificateOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeregisterCertificate API operation for AWS Directory Service. +// +// Deletes from the system the certificate that was registered for a secured +// LDAP connection. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 DeregisterCertificate for usage and error information. +// +// Returned Error Types: +// * DirectoryUnavailableException +// The specified directory is unavailable or could not be found. +// +// * DirectoryDoesNotExistException +// The specified directory does not exist in the system. +// +// * CertificateDoesNotExistException +// The certificate is not present in the system for describe or deregister activities. +// +// * CertificateInUseException +// The certificate is being used for the LDAP security connection and cannot +// be removed without disabling LDAP security. +// +// * UnsupportedOperationException +// The operation is not supported. +// +// * InvalidParameterException +// One or more parameters are not valid. +// +// * ClientException +// A client exception has occurred. +// +// * ServiceException +// An exception has occurred in AWS Directory Service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeregisterCertificate +func (c *DirectoryService) DeregisterCertificate(input *DeregisterCertificateInput) (*DeregisterCertificateOutput, error) { + req, out := c.DeregisterCertificateRequest(input) + return out, req.Send() +} + +// DeregisterCertificateWithContext is the same as DeregisterCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DirectoryService) DeregisterCertificateWithContext(ctx aws.Context, input *DeregisterCertificateInput, opts ...request.Option) (*DeregisterCertificateOutput, error) { + req, out := c.DeregisterCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeregisterEventTopic = "DeregisterEventTopic" // DeregisterEventTopicRequest generates a "aws/request.Request" representing the @@ -1782,17 +1889,17 @@ func (c *DirectoryService) DeregisterEventTopicRequest(input *DeregisterEventTop // See the AWS API reference guide for AWS Directory Service's // API operation DeregisterEventTopic for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DeregisterEventTopic @@ -1817,6 +1924,101 @@ func (c *DirectoryService) DeregisterEventTopicWithContext(ctx aws.Context, inpu return out, req.Send() } +const opDescribeCertificate = "DescribeCertificate" + +// DescribeCertificateRequest generates a "aws/request.Request" representing the +// client's request for the DescribeCertificate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeCertificate for more information on using the DescribeCertificate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeCertificateRequest method. +// req, resp := client.DescribeCertificateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeCertificate +func (c *DirectoryService) 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 Directory Service. +// +// Displays information about the certificate registered for a secured LDAP +// connection. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 DescribeCertificate for usage and error information. +// +// Returned Error Types: +// * DirectoryDoesNotExistException +// The specified directory does not exist in the system. +// +// * UnsupportedOperationException +// The operation is not supported. +// +// * CertificateDoesNotExistException +// The certificate is not present in the system for describe or deregister activities. +// +// * InvalidParameterException +// One or more parameters are not valid. +// +// * ClientException +// A client exception has occurred. +// +// * ServiceException +// An exception has occurred in AWS Directory Service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeCertificate +func (c *DirectoryService) DescribeCertificate(input *DescribeCertificateInput) (*DescribeCertificateOutput, error) { + req, out := c.DescribeCertificateRequest(input) + return out, req.Send() +} + +// DescribeCertificateWithContext is the same as DescribeCertificate with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCertificate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DirectoryService) DescribeCertificateWithContext(ctx aws.Context, input *DescribeCertificateInput, opts ...request.Option) (*DescribeCertificateOutput, error) { + req, out := c.DescribeCertificateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeConditionalForwarders = "DescribeConditionalForwarders" // DescribeConditionalForwardersRequest generates a "aws/request.Request" representing the @@ -1873,23 +2075,23 @@ func (c *DirectoryService) DescribeConditionalForwardersRequest(input *DescribeC // See the AWS API reference guide for AWS Directory Service's // API operation DescribeConditionalForwarders for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" +// * DirectoryUnavailableException // The specified directory is unavailable or could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeConditionalForwarders @@ -1978,20 +2180,20 @@ func (c *DirectoryService) DescribeDirectoriesRequest(input *DescribeDirectories // See the AWS API reference guide for AWS Directory Service's // API operation DescribeDirectories for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The NextToken value is not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeDirectories @@ -2075,23 +2277,23 @@ func (c *DirectoryService) DescribeDomainControllersRequest(input *DescribeDomai // See the AWS API reference guide for AWS Directory Service's // API operation DescribeDomainControllers for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The NextToken value is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeDomainControllers @@ -2159,10 +2361,12 @@ func (c *DirectoryService) DescribeDomainControllersPagesWithContext(ctx aws.Con }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDomainControllersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDomainControllersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2223,17 +2427,17 @@ func (c *DirectoryService) DescribeEventTopicsRequest(input *DescribeEventTopics // See the AWS API reference guide for AWS Directory Service's // API operation DescribeEventTopics for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeEventTopics @@ -2258,6 +2462,100 @@ func (c *DirectoryService) DescribeEventTopicsWithContext(ctx aws.Context, input return out, req.Send() } +const opDescribeLDAPSSettings = "DescribeLDAPSSettings" + +// DescribeLDAPSSettingsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLDAPSSettings operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeLDAPSSettings for more information on using the DescribeLDAPSSettings +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeLDAPSSettingsRequest method. +// req, resp := client.DescribeLDAPSSettingsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeLDAPSSettings +func (c *DirectoryService) DescribeLDAPSSettingsRequest(input *DescribeLDAPSSettingsInput) (req *request.Request, output *DescribeLDAPSSettingsOutput) { + op := &request.Operation{ + Name: opDescribeLDAPSSettings, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeLDAPSSettingsInput{} + } + + output = &DescribeLDAPSSettingsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeLDAPSSettings API operation for AWS Directory Service. +// +// Describes the status of LDAP security for the specified 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 DescribeLDAPSSettings for usage and error information. +// +// Returned Error Types: +// * DirectoryDoesNotExistException +// The specified directory does not exist in the system. +// +// * UnsupportedOperationException +// The operation is not supported. +// +// * InvalidNextTokenException +// The NextToken value is not valid. +// +// * InvalidParameterException +// One or more parameters are not valid. +// +// * ClientException +// A client exception has occurred. +// +// * ServiceException +// An exception has occurred in AWS Directory Service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeLDAPSSettings +func (c *DirectoryService) DescribeLDAPSSettings(input *DescribeLDAPSSettingsInput) (*DescribeLDAPSSettingsOutput, error) { + req, out := c.DescribeLDAPSSettingsRequest(input) + return out, req.Send() +} + +// DescribeLDAPSSettingsWithContext is the same as DescribeLDAPSSettings with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeLDAPSSettings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DirectoryService) DescribeLDAPSSettingsWithContext(ctx aws.Context, input *DescribeLDAPSSettingsInput, opts ...request.Option) (*DescribeLDAPSSettingsOutput, error) { + req, out := c.DescribeLDAPSSettingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeSharedDirectories = "DescribeSharedDirectories" // DescribeSharedDirectoriesRequest generates a "aws/request.Request" representing the @@ -2311,23 +2609,23 @@ func (c *DirectoryService) DescribeSharedDirectoriesRequest(input *DescribeShare // See the AWS API reference guide for AWS Directory Service's // API operation DescribeSharedDirectories for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The NextToken value is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeSharedDirectories @@ -2412,20 +2710,20 @@ func (c *DirectoryService) DescribeSnapshotsRequest(input *DescribeSnapshotsInpu // See the AWS API reference guide for AWS Directory Service's // API operation DescribeSnapshots for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The NextToken value is not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeSnapshots @@ -2506,23 +2804,23 @@ func (c *DirectoryService) DescribeTrustsRequest(input *DescribeTrustsInput) (re // See the AWS API reference guide for AWS Directory Service's // API operation DescribeTrusts for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The NextToken value is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DescribeTrusts @@ -2547,140 +2845,239 @@ func (c *DirectoryService) DescribeTrustsWithContext(ctx aws.Context, input *Des return out, req.Send() } -const opDisableRadius = "DisableRadius" +const opDisableLDAPS = "DisableLDAPS" -// DisableRadiusRequest generates a "aws/request.Request" representing the -// client's request for the DisableRadius operation. The "output" return +// DisableLDAPSRequest generates a "aws/request.Request" representing the +// client's request for the DisableLDAPS operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DisableRadius for more information on using the DisableRadius +// See DisableLDAPS for more information on using the DisableLDAPS // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DisableRadiusRequest method. -// req, resp := client.DisableRadiusRequest(params) +// // Example sending a request using the DisableLDAPSRequest method. +// req, resp := client.DisableLDAPSRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DisableRadius -func (c *DirectoryService) DisableRadiusRequest(input *DisableRadiusInput) (req *request.Request, output *DisableRadiusOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DisableLDAPS +func (c *DirectoryService) DisableLDAPSRequest(input *DisableLDAPSInput) (req *request.Request, output *DisableLDAPSOutput) { op := &request.Operation{ - Name: opDisableRadius, + Name: opDisableLDAPS, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DisableRadiusInput{} + input = &DisableLDAPSInput{} } - output = &DisableRadiusOutput{} + output = &DisableLDAPSOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DisableRadius API operation for AWS Directory Service. +// DisableLDAPS 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 or Microsoft AD -// directory. +// Deactivates LDAP secure calls for the specified 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. +// API operation DisableLDAPS for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. +// Returned Error Types: +// * DirectoryUnavailableException +// The specified directory is unavailable or could not be found. +// +// * DirectoryDoesNotExistException +// The specified directory does not exist in the system. +// +// * InvalidLDAPSStatusException +// The LDAP activities could not be performed because they are limited by the +// LDAPS status. +// +// * UnsupportedOperationException +// The operation is not supported. +// +// * InvalidParameterException +// One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DisableLDAPS +func (c *DirectoryService) DisableLDAPS(input *DisableLDAPSInput) (*DisableLDAPSOutput, error) { + req, out := c.DisableLDAPSRequest(input) return out, req.Send() } -// DisableRadiusWithContext is the same as DisableRadius with the addition of +// DisableLDAPSWithContext is the same as DisableLDAPS with the addition of // the ability to pass a context and additional request options. // -// See DisableRadius for details on how to use this API operation. +// See DisableLDAPS for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DirectoryService) DisableRadiusWithContext(ctx aws.Context, input *DisableRadiusInput, opts ...request.Option) (*DisableRadiusOutput, error) { - req, out := c.DisableRadiusRequest(input) +func (c *DirectoryService) DisableLDAPSWithContext(ctx aws.Context, input *DisableLDAPSInput, opts ...request.Option) (*DisableLDAPSOutput, error) { + req, out := c.DisableLDAPSRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDisableSso = "DisableSso" +const opDisableRadius = "DisableRadius" -// DisableSsoRequest generates a "aws/request.Request" representing the -// client's request for the DisableSso operation. The "output" return +// DisableRadiusRequest generates a "aws/request.Request" representing the +// client's request for the DisableRadius operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DisableSso for more information on using the DisableSso +// See DisableRadius for more information on using the DisableRadius // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DisableSsoRequest method. -// req, resp := client.DisableSsoRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DisableSso -func (c *DirectoryService) DisableSsoRequest(input *DisableSsoInput) (req *request.Request, output *DisableSsoOutput) { +// See also, 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: opDisableSso, + Name: opDisableRadius, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DisableSsoInput{} + input = &DisableRadiusInput{} } - output = &DisableSsoOutput{} + output = &DisableRadiusOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DisableSso API operation for AWS Directory Service. +// DisableRadius API operation for AWS Directory Service. // -// Disables single-sign on for a directory. +// Disables multi-factor authentication (MFA) with the Remote Authentication +// Dial In User Service (RADIUS) server for an AD Connector or 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 DisableRadius for usage and error information. +// +// Returned Error Types: +// * EntityDoesNotExistException +// The specified entity could not be found. +// +// * ClientException +// A client exception has occurred. +// +// * ServiceException +// An exception has occurred in AWS Directory Service. +// +// See also, 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) + return out, req.Send() +} + +// DisableRadiusWithContext is the same as DisableRadius with the addition of +// the ability to pass a context and additional request options. +// +// See DisableRadius for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DirectoryService) DisableRadiusWithContext(ctx aws.Context, input *DisableRadiusInput, opts ...request.Option) (*DisableRadiusOutput, error) { + req, out := c.DisableRadiusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDisableSso = "DisableSso" + +// DisableSsoRequest generates a "aws/request.Request" representing the +// client's request for the DisableSso operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DisableSso for more information on using the DisableSso +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DisableSsoRequest method. +// req, resp := client.DisableSsoRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + 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 @@ -2689,20 +3086,20 @@ func (c *DirectoryService) DisableSsoRequest(input *DisableSsoInput) (req *reque // See the AWS API reference guide for AWS Directory Service's // API operation DisableSso for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInsufficientPermissionsException "InsufficientPermissionsException" +// * InsufficientPermissionsException // The account does not have sufficient permission to perform the operation. // -// * ErrCodeAuthenticationFailedException "AuthenticationFailedException" +// * AuthenticationFailedException // An authentication error occurred. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/DisableSso @@ -2727,6 +3124,110 @@ func (c *DirectoryService) DisableSsoWithContext(ctx aws.Context, input *Disable return out, req.Send() } +const opEnableLDAPS = "EnableLDAPS" + +// EnableLDAPSRequest generates a "aws/request.Request" representing the +// client's request for the EnableLDAPS operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See EnableLDAPS for more information on using the EnableLDAPS +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the EnableLDAPSRequest method. +// req, resp := client.EnableLDAPSRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EnableLDAPS +func (c *DirectoryService) EnableLDAPSRequest(input *EnableLDAPSInput) (req *request.Request, output *EnableLDAPSOutput) { + op := &request.Operation{ + Name: opEnableLDAPS, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &EnableLDAPSInput{} + } + + output = &EnableLDAPSOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// EnableLDAPS API operation for AWS Directory Service. +// +// Activates the switch for the specific directory to always use LDAP secure +// 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 AWS Directory Service's +// API operation EnableLDAPS for usage and error information. +// +// Returned Error Types: +// * DirectoryUnavailableException +// The specified directory is unavailable or could not be found. +// +// * DirectoryDoesNotExistException +// The specified directory does not exist in the system. +// +// * NoAvailableCertificateException +// The LDAP activities could not be performed because at least one valid certificate +// must be registered with the system. +// +// * InvalidLDAPSStatusException +// The LDAP activities could not be performed because they are limited by the +// LDAPS status. +// +// * UnsupportedOperationException +// The operation is not supported. +// +// * InvalidParameterException +// One or more parameters are not valid. +// +// * ClientException +// A client exception has occurred. +// +// * ServiceException +// An exception has occurred in AWS Directory Service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EnableLDAPS +func (c *DirectoryService) EnableLDAPS(input *EnableLDAPSInput) (*EnableLDAPSOutput, error) { + req, out := c.EnableLDAPSRequest(input) + return out, req.Send() +} + +// EnableLDAPSWithContext is the same as EnableLDAPS with the addition of +// the ability to pass a context and additional request options. +// +// See EnableLDAPS for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DirectoryService) EnableLDAPSWithContext(ctx aws.Context, input *EnableLDAPSInput, opts ...request.Option) (*EnableLDAPSOutput, error) { + req, out := c.EnableLDAPSRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opEnableRadius = "EnableRadius" // EnableRadiusRequest generates a "aws/request.Request" representing the @@ -2783,20 +3284,20 @@ func (c *DirectoryService) EnableRadiusRequest(input *EnableRadiusInput) (req *r // See the AWS API reference guide for AWS Directory Service's // API operation EnableRadius for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeEntityAlreadyExistsException "EntityAlreadyExistsException" +// * EntityAlreadyExistsException // The specified entity already exists. // -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EnableRadius @@ -2866,7 +3367,9 @@ func (c *DirectoryService) EnableSsoRequest(input *EnableSsoInput) (req *request // EnableSso API operation for AWS Directory Service. // -// Enables single sign-on for a directory. +// Enables single sign-on for a directory. Single sign-on allows users in your +// directory to access certain AWS services from a computer joined to the directory +// without having to enter their credentials separately. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2875,20 +3378,20 @@ func (c *DirectoryService) EnableSsoRequest(input *EnableSsoInput) (req *request // See the AWS API reference guide for AWS Directory Service's // API operation EnableSso for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInsufficientPermissionsException "InsufficientPermissionsException" +// * InsufficientPermissionsException // The account does not have sufficient permission to perform the operation. // -// * ErrCodeAuthenticationFailedException "AuthenticationFailedException" +// * AuthenticationFailedException // An authentication error occurred. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/EnableSso @@ -2957,7 +3460,7 @@ func (c *DirectoryService) GetDirectoryLimitsRequest(input *GetDirectoryLimitsIn // GetDirectoryLimits API operation for AWS Directory Service. // -// Obtains directory limit information for the current region. +// 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 @@ -2966,14 +3469,14 @@ func (c *DirectoryService) GetDirectoryLimitsRequest(input *GetDirectoryLimitsIn // See the AWS API reference guide for AWS Directory Service's // API operation GetDirectoryLimits for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/GetDirectoryLimits @@ -3051,14 +3554,14 @@ func (c *DirectoryService) GetSnapshotLimitsRequest(input *GetSnapshotLimitsInpu // See the AWS API reference guide for AWS Directory Service's // API operation GetSnapshotLimits for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/GetSnapshotLimits @@ -3083,6 +3586,101 @@ func (c *DirectoryService) GetSnapshotLimitsWithContext(ctx aws.Context, input * return out, req.Send() } +const opListCertificates = "ListCertificates" + +// ListCertificatesRequest generates a "aws/request.Request" representing the +// client's request for the ListCertificates operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListCertificates for more information on using the ListCertificates +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListCertificatesRequest method. +// req, resp := client.ListCertificatesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListCertificates +func (c *DirectoryService) ListCertificatesRequest(input *ListCertificatesInput) (req *request.Request, output *ListCertificatesOutput) { + op := &request.Operation{ + Name: opListCertificates, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListCertificatesInput{} + } + + output = &ListCertificatesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListCertificates API operation for AWS Directory Service. +// +// For the specified directory, lists all the certificates registered for a +// secured LDAP connection. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 ListCertificates for usage and error information. +// +// Returned Error Types: +// * DirectoryDoesNotExistException +// The specified directory does not exist in the system. +// +// * UnsupportedOperationException +// The operation is not supported. +// +// * InvalidParameterException +// One or more parameters are not valid. +// +// * InvalidNextTokenException +// The NextToken value is not valid. +// +// * ClientException +// A client exception has occurred. +// +// * ServiceException +// An exception has occurred in AWS Directory Service. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListCertificates +func (c *DirectoryService) ListCertificates(input *ListCertificatesInput) (*ListCertificatesOutput, error) { + req, out := c.ListCertificatesRequest(input) + return out, req.Send() +} + +// ListCertificatesWithContext is the same as ListCertificates with the addition of +// the ability to pass a context and additional request options. +// +// See ListCertificates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DirectoryService) ListCertificatesWithContext(ctx aws.Context, input *ListCertificatesInput, opts ...request.Option) (*ListCertificatesOutput, error) { + req, out := c.ListCertificatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opListIpRoutes = "ListIpRoutes" // ListIpRoutesRequest generates a "aws/request.Request" representing the @@ -3136,20 +3734,20 @@ func (c *DirectoryService) ListIpRoutesRequest(input *ListIpRoutesInput) (req *r // See the AWS API reference guide for AWS Directory Service's // API operation ListIpRoutes for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The NextToken value is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListIpRoutes @@ -3227,17 +3825,17 @@ func (c *DirectoryService) ListLogSubscriptionsRequest(input *ListLogSubscriptio // See the AWS API reference guide for AWS Directory Service's // API operation ListLogSubscriptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The NextToken value is not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListLogSubscriptions @@ -3315,17 +3913,17 @@ func (c *DirectoryService) ListSchemaExtensionsRequest(input *ListSchemaExtensio // See the AWS API reference guide for AWS Directory Service's // API operation ListSchemaExtensions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The NextToken value is not valid. // -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListSchemaExtensions @@ -3403,20 +4001,20 @@ func (c *DirectoryService) ListTagsForResourceRequest(input *ListTagsForResource // See the AWS API reference guide for AWS Directory Service's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The NextToken value is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ListTagsForResource @@ -3441,103 +4039,207 @@ func (c *DirectoryService) ListTagsForResourceWithContext(ctx aws.Context, input return out, req.Send() } -const opRegisterEventTopic = "RegisterEventTopic" +const opRegisterCertificate = "RegisterCertificate" -// RegisterEventTopicRequest generates a "aws/request.Request" representing the -// client's request for the RegisterEventTopic operation. The "output" return +// RegisterCertificateRequest generates a "aws/request.Request" representing the +// client's request for the RegisterCertificate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RegisterEventTopic for more information on using the RegisterEventTopic +// See RegisterCertificate for more information on using the RegisterCertificate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RegisterEventTopicRequest method. -// req, resp := client.RegisterEventTopicRequest(params) +// // Example sending a request using the RegisterCertificateRequest method. +// req, resp := client.RegisterCertificateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RegisterEventTopic -func (c *DirectoryService) RegisterEventTopicRequest(input *RegisterEventTopicInput) (req *request.Request, output *RegisterEventTopicOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RegisterCertificate +func (c *DirectoryService) RegisterCertificateRequest(input *RegisterCertificateInput) (req *request.Request, output *RegisterCertificateOutput) { op := &request.Operation{ - Name: opRegisterEventTopic, + Name: opRegisterCertificate, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RegisterEventTopicInput{} + input = &RegisterCertificateInput{} } - output = &RegisterEventTopicOutput{} + output = &RegisterCertificateOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// RegisterEventTopic API operation for AWS Directory Service. +// RegisterCertificate 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. +// Registers a certificate for secured LDAP connection. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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. +// API operation RegisterCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" -// The specified entity could not be found. +// Returned Error Types: +// * DirectoryUnavailableException +// The specified directory is unavailable or could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * DirectoryDoesNotExistException +// The specified directory does not exist in the system. +// +// * InvalidCertificateException +// The certificate PEM that was provided has incorrect encoding. +// +// * CertificateLimitExceededException +// The certificate could not be added because the certificate limit has been +// reached. +// +// * CertificateAlreadyExistsException +// The certificate has already been registered into the system. +// +// * UnsupportedOperationException +// The operation is not supported. +// +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RegisterCertificate +func (c *DirectoryService) RegisterCertificate(input *RegisterCertificateInput) (*RegisterCertificateOutput, error) { + req, out := c.RegisterCertificateRequest(input) return out, req.Send() } -// RegisterEventTopicWithContext is the same as RegisterEventTopic with the addition of +// RegisterCertificateWithContext is the same as RegisterCertificate with the addition of // the ability to pass a context and additional request options. // -// See RegisterEventTopic for details on how to use this API operation. +// See RegisterCertificate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *DirectoryService) RegisterEventTopicWithContext(ctx aws.Context, input *RegisterEventTopicInput, opts ...request.Option) (*RegisterEventTopicOutput, error) { - req, out := c.RegisterEventTopicRequest(input) +func (c *DirectoryService) RegisterCertificateWithContext(ctx aws.Context, input *RegisterCertificateInput, opts ...request.Option) (*RegisterCertificateOutput, error) { + req, out := c.RegisterCertificateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRejectSharedDirectory = "RejectSharedDirectory" +const opRegisterEventTopic = "RegisterEventTopic" -// RejectSharedDirectoryRequest generates a "aws/request.Request" representing the +// RegisterEventTopicRequest generates a "aws/request.Request" representing the +// client's request for the RegisterEventTopic operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RegisterEventTopic for more information on using the RegisterEventTopic +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RegisterEventTopicRequest method. +// req, resp := client.RegisterEventTopicRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + 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 Types: +// * EntityDoesNotExistException +// The specified entity could not be found. +// +// * InvalidParameterException +// One or more parameters are not valid. +// +// * ClientException +// A client exception has occurred. +// +// * ServiceException +// An exception has occurred in AWS Directory Service. +// +// See also, 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) + return out, req.Send() +} + +// RegisterEventTopicWithContext is the same as RegisterEventTopic with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterEventTopic for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DirectoryService) RegisterEventTopicWithContext(ctx aws.Context, input *RegisterEventTopicInput, opts ...request.Option) (*RegisterEventTopicOutput, error) { + req, out := c.RegisterEventTopicRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRejectSharedDirectory = "RejectSharedDirectory" + +// RejectSharedDirectoryRequest generates a "aws/request.Request" representing the // client's request for the RejectSharedDirectory operation. The "output" return // value will be populated with the request's response once the request completes // successfully. @@ -3589,20 +4291,20 @@ func (c *DirectoryService) RejectSharedDirectoryRequest(input *RejectSharedDirec // See the AWS API reference guide for AWS Directory Service's // API operation RejectSharedDirectory for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeDirectoryAlreadySharedException "DirectoryAlreadySharedException" +// * DirectoryAlreadySharedException // The specified directory has already been shared with this AWS account. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RejectSharedDirectory @@ -3681,20 +4383,20 @@ func (c *DirectoryService) RemoveIpRoutesRequest(input *RemoveIpRoutesInput) (re // See the AWS API reference guide for AWS Directory Service's // API operation RemoveIpRoutes for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" +// * DirectoryUnavailableException // The specified directory is unavailable or could not be found. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RemoveIpRoutes @@ -3773,17 +4475,17 @@ func (c *DirectoryService) RemoveTagsFromResourceRequest(input *RemoveTagsFromRe // See the AWS API reference guide for AWS Directory Service's // API operation RemoveTagsFromResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RemoveTagsFromResource @@ -3856,6 +4558,20 @@ func (c *DirectoryService) ResetUserPasswordRequest(input *ResetUserPasswordInpu // Resets the password for any user in your AWS Managed Microsoft AD or Simple // AD directory. // +// You can reset the password for any user in your directory with the following +// exceptions: +// +// * For Simple AD, you cannot reset the password for any user that is a +// member of either the Domain Admins or Enterprise Admins group except for +// the administrator user. +// +// * For AWS Managed Microsoft AD, you can only reset the password for a +// user that is in an OU based off of the NetBIOS name that you typed when +// you created your directory. For example, you cannot reset the password +// for a user in the AWS Reserved OU. For more information about the OU structure +// for an AWS Managed Microsoft AD directory, see What Gets Created (https://docs.aws.amazon.com/directoryservice/latest/admin-guide/ms_ad_getting_started_what_gets_created.html) +// in the AWS Directory Service Administration Guide. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -3863,27 +4579,27 @@ func (c *DirectoryService) ResetUserPasswordRequest(input *ResetUserPasswordInpu // See the AWS API reference guide for AWS Directory Service's // API operation ResetUserPassword for usage and error information. // -// Returned Error Codes: -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" +// Returned Error Types: +// * DirectoryUnavailableException // The specified directory is unavailable or could not be found. // -// * ErrCodeUserDoesNotExistException "UserDoesNotExistException" +// * UserDoesNotExistException // The user provided a username that does not exist in your directory. // -// * ErrCodeInvalidPasswordException "InvalidPasswordException" +// * InvalidPasswordException // The new password provided by the user does not meet the password complexity // requirements defined in your directory. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ResetUserPassword @@ -3970,17 +4686,17 @@ func (c *DirectoryService) RestoreFromSnapshotRequest(input *RestoreFromSnapshot // See the AWS API reference guide for AWS Directory Service's // API operation RestoreFromSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/RestoreFromSnapshot @@ -4075,36 +4791,36 @@ func (c *DirectoryService) ShareDirectoryRequest(input *ShareDirectoryInput) (re // See the AWS API reference guide for AWS Directory Service's // API operation ShareDirectory for usage and error information. // -// Returned Error Codes: -// * ErrCodeDirectoryAlreadySharedException "DirectoryAlreadySharedException" +// Returned Error Types: +// * DirectoryAlreadySharedException // The specified directory has already been shared with this AWS account. // -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidTargetException "InvalidTargetException" +// * InvalidTargetException // The specified shared target is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeShareLimitExceededException "ShareLimitExceededException" +// * ShareLimitExceededException // The maximum number of AWS accounts that you can share with this directory // has been reached. // -// * ErrCodeOrganizationsException "OrganizationsException" +// * OrganizationsException // Exception encountered while trying to access your AWS organization. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/ShareDirectory @@ -4182,25 +4898,25 @@ func (c *DirectoryService) StartSchemaExtensionRequest(input *StartSchemaExtensi // See the AWS API reference guide for AWS Directory Service's // API operation StartSchemaExtension for usage and error information. // -// Returned Error Codes: -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" +// Returned Error Types: +// * DirectoryUnavailableException // The specified directory is unavailable or could not be found. // -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeSnapshotLimitExceededException "SnapshotLimitExceededException" +// * 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" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/StartSchemaExtension @@ -4278,20 +4994,20 @@ func (c *DirectoryService) UnshareDirectoryRequest(input *UnshareDirectoryInput) // See the AWS API reference guide for AWS Directory Service's // API operation UnshareDirectory for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidTargetException "InvalidTargetException" +// * InvalidTargetException // The specified shared target is not valid. // -// * ErrCodeDirectoryNotSharedException "DirectoryNotSharedException" +// * DirectoryNotSharedException // The specified directory has not been shared with this AWS account. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UnshareDirectory @@ -4370,23 +5086,23 @@ func (c *DirectoryService) UpdateConditionalForwarderRequest(input *UpdateCondit // See the AWS API reference guide for AWS Directory Service's // API operation UpdateConditionalForwarder for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" +// * DirectoryUnavailableException // The specified directory is unavailable or could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateConditionalForwarder @@ -4470,27 +5186,27 @@ func (c *DirectoryService) UpdateNumberOfDomainControllersRequest(input *UpdateN // See the AWS API reference guide for AWS Directory Service's // API operation UpdateNumberOfDomainControllers for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeDirectoryUnavailableException "DirectoryUnavailableException" +// * DirectoryUnavailableException // The specified directory is unavailable or could not be found. // -// * ErrCodeDomainControllerLimitExceededException "DomainControllerLimitExceededException" +// * DomainControllerLimitExceededException // The maximum allowed number of domain controllers per directory was exceeded. // The default limit per directory is 20 domain controllers. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateNumberOfDomainControllers @@ -4570,17 +5286,17 @@ func (c *DirectoryService) UpdateRadiusRequest(input *UpdateRadiusInput) (req *r // See the AWS API reference guide for AWS Directory Service's // API operation UpdateRadius for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateRadius @@ -4659,17 +5375,17 @@ func (c *DirectoryService) UpdateTrustRequest(input *UpdateTrustInput) (req *req // See the AWS API reference guide for AWS Directory Service's // API operation UpdateTrust for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/UpdateTrust @@ -4751,20 +5467,20 @@ func (c *DirectoryService) VerifyTrustRequest(input *VerifyTrustInput) (req *req // See the AWS API reference guide for AWS Directory Service's // API operation VerifyTrust for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityDoesNotExistException "EntityDoesNotExistException" +// Returned Error Types: +// * EntityDoesNotExistException // The specified entity could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters are not valid. // -// * ErrCodeClientException "ClientException" +// * ClientException // A client exception has occurred. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // An exception has occurred in AWS Directory Service. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The operation is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ds-2015-04-16/VerifyTrust @@ -4851,6 +5567,66 @@ func (s *AcceptSharedDirectoryOutput) SetSharedDirectory(v *SharedDirectory) *Ac return s } +// You do not have sufficient access to perform this action. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + type AddIpRoutesInput struct { _ struct{} `type:"structure"` @@ -5094,6 +5870,66 @@ func (s *Attribute) SetValue(v string) *Attribute { return s } +// An authentication error occurred. +type AuthenticationFailedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The textual message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The identifier of the request that caused the exception. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s AuthenticationFailedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AuthenticationFailedException) GoString() string { + return s.String() +} + +func newErrorAuthenticationFailedException(v protocol.ResponseMetadata) error { + return &AuthenticationFailedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AuthenticationFailedException) Code() string { + return "AuthenticationFailedException" +} + +// Message returns the exception's message. +func (s AuthenticationFailedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AuthenticationFailedException) OrigErr() error { + return nil +} + +func (s AuthenticationFailedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AuthenticationFailedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AuthenticationFailedException) RequestID() string { + return s.respMetadata.RequestID +} + type CancelSchemaExtensionInput struct { _ struct{} `type:"structure"` @@ -5160,578 +5996,544 @@ func (s CancelSchemaExtensionOutput) GoString() string { return s.String() } -// Contains information about a computer account in a directory. -type Computer struct { +// Information about the certificate. +type Certificate 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 certificate. + CertificateId *string `type:"string"` - // The identifier of the computer. - ComputerId *string `min:"1" type:"string"` + // The common name for the certificate. + CommonName *string `type:"string"` - // The computer name. - ComputerName *string `min:"1" type:"string"` + // The date and time when the certificate will expire. + ExpiryDateTime *time.Time `type:"timestamp"` + + // The date and time that the certificate was registered. + RegisteredDateTime *time.Time `type:"timestamp"` + + // The state of the certificate. + State *string `type:"string" enum:"CertificateState"` + + // Describes a state change for the certificate. + StateReason *string `type:"string"` } // String returns the string representation -func (s Computer) String() string { +func (s Certificate) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Computer) GoString() string { +func (s Certificate) GoString() string { return s.String() } -// SetComputerAttributes sets the ComputerAttributes field's value. -func (s *Computer) SetComputerAttributes(v []*Attribute) *Computer { - s.ComputerAttributes = v +// SetCertificateId sets the CertificateId field's value. +func (s *Certificate) SetCertificateId(v string) *Certificate { + s.CertificateId = &v return s } -// SetComputerId sets the ComputerId field's value. -func (s *Computer) SetComputerId(v string) *Computer { - s.ComputerId = &v +// SetCommonName sets the CommonName field's value. +func (s *Certificate) SetCommonName(v string) *Certificate { + s.CommonName = &v return s } -// SetComputerName sets the ComputerName field's value. -func (s *Computer) SetComputerName(v string) *Computer { - s.ComputerName = &v +// SetExpiryDateTime sets the ExpiryDateTime field's value. +func (s *Certificate) SetExpiryDateTime(v time.Time) *Certificate { + s.ExpiryDateTime = &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. -type ConditionalForwarder struct { - _ struct{} `type:"structure"` +// SetRegisteredDateTime sets the RegisteredDateTime field's value. +func (s *Certificate) SetRegisteredDateTime(v time.Time) *Certificate { + s.RegisteredDateTime = &v + return s +} - // 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"` +// SetState sets the State field's value. +func (s *Certificate) SetState(v string) *Certificate { + s.State = &v + return s +} - // The fully qualified domain name (FQDN) of the remote domains pointed to by - // the conditional forwarder. - RemoteDomainName *string `type:"string"` +// SetStateReason sets the StateReason field's value. +func (s *Certificate) SetStateReason(v string) *Certificate { + s.StateReason = &v + return s +} - // 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"` +// The certificate has already been registered into the system. +type CertificateAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` } // String returns the string representation -func (s ConditionalForwarder) String() string { +func (s CertificateAlreadyExistsException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConditionalForwarder) GoString() string { +func (s CertificateAlreadyExistsException) GoString() string { return s.String() } -// SetDnsIpAddrs sets the DnsIpAddrs field's value. -func (s *ConditionalForwarder) SetDnsIpAddrs(v []*string) *ConditionalForwarder { - s.DnsIpAddrs = v - return s +func newErrorCertificateAlreadyExistsException(v protocol.ResponseMetadata) error { + return &CertificateAlreadyExistsException{ + respMetadata: v, + } } -// SetRemoteDomainName sets the RemoteDomainName field's value. -func (s *ConditionalForwarder) SetRemoteDomainName(v string) *ConditionalForwarder { - s.RemoteDomainName = &v - return s +// Code returns the exception type name. +func (s CertificateAlreadyExistsException) Code() string { + return "CertificateAlreadyExistsException" } -// SetReplicationScope sets the ReplicationScope field's value. -func (s *ConditionalForwarder) SetReplicationScope(v string) *ConditionalForwarder { - s.ReplicationScope = &v - return s +// Message returns the exception's message. +func (s CertificateAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// Contains the inputs for the ConnectDirectory operation. -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"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CertificateAlreadyExistsException) OrigErr() error { + return nil +} - // A textual description for the directory. - Description *string `type:"string"` +func (s CertificateAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.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"` +// Status code returns the HTTP status code for the request's response error. +func (s CertificateAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The password for the on-premises user account. - // - // Password is a required field - Password *string `min:"1" type:"string" required:"true" sensitive:"true"` +// RequestID returns the service's response RequestID for request. +func (s CertificateAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} - // The NetBIOS name of the on-premises directory, such as CORP. - ShortName *string `type:"string"` +// The certificate is not present in the system for describe or deregister activities. +type CertificateDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The size of the directory. - // - // Size is a required field - Size *string `type:"string" required:"true" enum:"DirectorySize"` + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` - // The tags to be assigned to AD Connector. - Tags []*Tag `type:"list"` + // The AWS request identifier. + RequestId *string `type:"string"` } // String returns the string representation -func (s ConnectDirectoryInput) String() string { +func (s CertificateDoesNotExistException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConnectDirectoryInput) GoString() string { +func (s CertificateDoesNotExistException) 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 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 +func newErrorCertificateDoesNotExistException(v protocol.ResponseMetadata) error { + return &CertificateDoesNotExistException{ + respMetadata: v, } - return nil } -// SetConnectSettings sets the ConnectSettings field's value. -func (s *ConnectDirectoryInput) SetConnectSettings(v *DirectoryConnectSettings) *ConnectDirectoryInput { - s.ConnectSettings = v - return s +// Code returns the exception type name. +func (s CertificateDoesNotExistException) Code() string { + return "CertificateDoesNotExistException" } -// SetDescription sets the Description field's value. -func (s *ConnectDirectoryInput) SetDescription(v string) *ConnectDirectoryInput { - s.Description = &v - return s +// Message returns the exception's message. +func (s CertificateDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetName sets the Name field's value. -func (s *ConnectDirectoryInput) SetName(v string) *ConnectDirectoryInput { - s.Name = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CertificateDoesNotExistException) OrigErr() error { + return nil } -// SetPassword sets the Password field's value. -func (s *ConnectDirectoryInput) SetPassword(v string) *ConnectDirectoryInput { - s.Password = &v - return s +func (s CertificateDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetShortName sets the ShortName field's value. -func (s *ConnectDirectoryInput) SetShortName(v string) *ConnectDirectoryInput { - s.ShortName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s CertificateDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetSize sets the Size field's value. -func (s *ConnectDirectoryInput) SetSize(v string) *ConnectDirectoryInput { - s.Size = &v - return s +// RequestID returns the service's response RequestID for request. +func (s CertificateDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID } -// SetTags sets the Tags field's value. -func (s *ConnectDirectoryInput) SetTags(v []*Tag) *ConnectDirectoryInput { - s.Tags = v - return s -} +// The certificate is being used for the LDAP security connection and cannot +// be removed without disabling LDAP security. +type CertificateInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata -// Contains the results of the ConnectDirectory operation. -type ConnectDirectoryOutput struct { - _ struct{} `type:"structure"` + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` - // The identifier of the new directory. - DirectoryId *string `type:"string"` + // The AWS request identifier. + RequestId *string `type:"string"` } // String returns the string representation -func (s ConnectDirectoryOutput) String() string { +func (s CertificateInUseException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConnectDirectoryOutput) GoString() string { +func (s CertificateInUseException) GoString() string { return s.String() } -// SetDirectoryId sets the DirectoryId field's value. -func (s *ConnectDirectoryOutput) SetDirectoryId(v string) *ConnectDirectoryOutput { - s.DirectoryId = &v - return s +func newErrorCertificateInUseException(v protocol.ResponseMetadata) error { + return &CertificateInUseException{ + respMetadata: v, + } } -// Contains the inputs for the CreateAlias operation. -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"` +// Code returns the exception type name. +func (s CertificateInUseException) Code() string { + return "CertificateInUseException" } -// String returns the string representation -func (s CreateAliasInput) String() string { - return awsutil.Prettify(s) +// Message returns the exception's message. +func (s CertificateInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// GoString returns the string representation -func (s CreateAliasInput) GoString() string { - return s.String() +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CertificateInUseException) OrigErr() error { + return nil } -// 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 +func (s CertificateInUseException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetAlias sets the Alias field's value. -func (s *CreateAliasInput) SetAlias(v string) *CreateAliasInput { - s.Alias = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s CertificateInUseException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateAliasInput) SetDirectoryId(v string) *CreateAliasInput { - s.DirectoryId = &v - return s +// RequestID returns the service's response RequestID for request. +func (s CertificateInUseException) RequestID() string { + return s.respMetadata.RequestID } -// Contains the results of the CreateAlias operation. -type CreateAliasOutput struct { +// Contains general information about a certificate. +type CertificateInfo struct { _ struct{} `type:"structure"` - // The alias for the directory. - Alias *string `min:"1" type:"string"` + // The identifier of the certificate. + CertificateId *string `type:"string"` - // The identifier of the directory. - DirectoryId *string `type:"string"` + // The common name for the certificate. + CommonName *string `type:"string"` + + // The date and time when the certificate will expire. + ExpiryDateTime *time.Time `type:"timestamp"` + + // The state of the certificate. + State *string `type:"string" enum:"CertificateState"` } // String returns the string representation -func (s CreateAliasOutput) String() string { +func (s CertificateInfo) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateAliasOutput) GoString() string { +func (s CertificateInfo) GoString() string { return s.String() } -// SetAlias sets the Alias field's value. -func (s *CreateAliasOutput) SetAlias(v string) *CreateAliasOutput { - s.Alias = &v +// SetCertificateId sets the CertificateId field's value. +func (s *CertificateInfo) SetCertificateId(v string) *CertificateInfo { + s.CertificateId = &v return s } -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateAliasOutput) SetDirectoryId(v string) *CreateAliasOutput { - s.DirectoryId = &v +// SetCommonName sets the CommonName field's value. +func (s *CertificateInfo) SetCommonName(v string) *CertificateInfo { + s.CommonName = &v return s } -// Contains the inputs for the CreateComputer operation. -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"` +// SetExpiryDateTime sets the ExpiryDateTime field's value. +func (s *CertificateInfo) SetExpiryDateTime(v time.Time) *CertificateInfo { + s.ExpiryDateTime = &v + return s +} - // The name of the computer account. - // - // ComputerName is a required field - ComputerName *string `min:"1" type:"string" required:"true"` +// SetState sets the State field's value. +func (s *CertificateInfo) SetState(v string) *CertificateInfo { + s.State = &v + return s +} - // The identifier of the directory in which to create the computer account. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` +// The certificate could not be added because the certificate limit has been +// reached. +type CertificateLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The fully-qualified distinguished name of the organizational unit to place - // the computer account in. - OrganizationalUnitDistinguishedName *string `min:"1" type:"string"` + // The descriptive message for the exception. + Message_ *string `locationName:"Message" 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" sensitive:"true"` + // The AWS request identifier. + RequestId *string `type:"string"` } // String returns the string representation -func (s CreateComputerInput) String() string { +func (s CertificateLimitExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateComputerInput) GoString() string { +func (s CertificateLimitExceededException) 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)) - } - } +func newErrorCertificateLimitExceededException(v protocol.ResponseMetadata) error { + return &CertificateLimitExceededException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// Code returns the exception type name. +func (s CertificateLimitExceededException) Code() string { + return "CertificateLimitExceededException" } -// SetComputerAttributes sets the ComputerAttributes field's value. -func (s *CreateComputerInput) SetComputerAttributes(v []*Attribute) *CreateComputerInput { - s.ComputerAttributes = v - return s +// Message returns the exception's message. +func (s CertificateLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetComputerName sets the ComputerName field's value. -func (s *CreateComputerInput) SetComputerName(v string) *CreateComputerInput { - s.ComputerName = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CertificateLimitExceededException) OrigErr() error { + return nil } -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateComputerInput) SetDirectoryId(v string) *CreateComputerInput { - s.DirectoryId = &v - return s +func (s CertificateLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetOrganizationalUnitDistinguishedName sets the OrganizationalUnitDistinguishedName field's value. -func (s *CreateComputerInput) SetOrganizationalUnitDistinguishedName(v string) *CreateComputerInput { - s.OrganizationalUnitDistinguishedName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s CertificateLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetPassword sets the Password field's value. -func (s *CreateComputerInput) SetPassword(v string) *CreateComputerInput { - s.Password = &v - return s +// RequestID returns the service's response RequestID for request. +func (s CertificateLimitExceededException) RequestID() string { + return s.respMetadata.RequestID } -// Contains the results for the CreateComputer operation. -type CreateComputerOutput struct { - _ struct{} `type:"structure"` +// A client exception has occurred. +type ClientException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // A Computer object that represents the computer account. - Computer *Computer `type:"structure"` + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` } // String returns the string representation -func (s CreateComputerOutput) String() string { +func (s ClientException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateComputerOutput) GoString() string { +func (s ClientException) GoString() string { return s.String() } -// SetComputer sets the Computer field's value. -func (s *CreateComputerOutput) SetComputer(v *Computer) *CreateComputerOutput { - s.Computer = v - return s +func newErrorClientException(v protocol.ResponseMetadata) error { + return &ClientException{ + respMetadata: v, + } } -// 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. -type CreateConditionalForwarderInput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s ClientException) Code() string { + return "ClientException" +} - // 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"` +// Message returns the exception's message. +func (s ClientException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The IP addresses of the remote DNS server associated with RemoteDomainName. - // - // DnsIpAddrs is a required field - DnsIpAddrs []*string `type:"list" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ClientException) OrigErr() error { + return nil +} - // 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"` +func (s ClientException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ClientException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ClientException) RequestID() string { + return s.respMetadata.RequestID +} + +// Contains information about a computer account in a directory. +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 CreateConditionalForwarderInput) String() string { +func (s Computer) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateConditionalForwarderInput) GoString() string { +func (s Computer) 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 +// SetComputerAttributes sets the ComputerAttributes field's value. +func (s *Computer) SetComputerAttributes(v []*Attribute) *Computer { + s.ComputerAttributes = v return s } -// SetDnsIpAddrs sets the DnsIpAddrs field's value. -func (s *CreateConditionalForwarderInput) SetDnsIpAddrs(v []*string) *CreateConditionalForwarderInput { - s.DnsIpAddrs = v +// SetComputerId sets the ComputerId field's value. +func (s *Computer) SetComputerId(v string) *Computer { + s.ComputerId = &v return s } -// SetRemoteDomainName sets the RemoteDomainName field's value. -func (s *CreateConditionalForwarderInput) SetRemoteDomainName(v string) *CreateConditionalForwarderInput { - s.RemoteDomainName = &v +// SetComputerName sets the ComputerName field's value. +func (s *Computer) SetComputerName(v string) *Computer { + s.ComputerName = &v return s } -// The result of a CreateConditinalForwarder request. -type CreateConditionalForwarderOutput struct { +// 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. +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 CreateConditionalForwarderOutput) String() string { +func (s ConditionalForwarder) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateConditionalForwarderOutput) GoString() string { +func (s ConditionalForwarder) GoString() string { return s.String() } -// Contains the inputs for the CreateDirectory operation. -type CreateDirectoryInput struct { +// 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. +type ConnectDirectoryInput struct { _ struct{} `type:"structure"` - // A textual description for the directory. + // A DirectoryConnectSettings object that contains additional information for + // the operation. + // + // ConnectSettings is a required field + ConnectSettings *DirectoryConnectSettings `type:"structure" required:"true"` + + // A description for the directory. Description *string `type:"string"` - // The fully qualified name for the directory, such as corp.example.com. + // 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 directory administrator. The directory creation process - // creates a directory administrator account with the user name Administrator - // and this password. + // The password for the on-premises user account. // // Password is a required field - Password *string `type:"string" required:"true" sensitive:"true"` + Password *string `min:"1" type:"string" required:"true" sensitive:"true"` - // The short name of the directory, such as CORP. + // The NetBIOS name of the on-premises directory, such as CORP. ShortName *string `type:"string"` // The size of the directory. @@ -5739,36 +6541,43 @@ type CreateDirectoryInput struct { // Size is a required field Size *string `type:"string" required:"true" enum:"DirectorySize"` - // The tags to be assigned to the Simple AD directory. + // The tags to be assigned to AD Connector. Tags []*Tag `type:"list"` - - // A DirectoryVpcSettings object that contains additional information for the - // operation. - VpcSettings *DirectoryVpcSettings `type:"structure"` } // String returns the string representation -func (s CreateDirectoryInput) String() string { +func (s ConnectDirectoryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateDirectoryInput) GoString() string { +func (s ConnectDirectoryInput) 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"} +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 s.Tags != nil { for i, v := range s.Tags { if v == nil { @@ -5779,11 +6588,6 @@ func (s *CreateDirectoryInput) Validate() error { } } } - if s.VpcSettings != nil { - if err := s.VpcSettings.Validate(); err != nil { - invalidParams.AddNested("VpcSettings", err.(request.ErrInvalidParams)) - } - } if invalidParams.Len() > 0 { return invalidParams @@ -5791,109 +6595,111 @@ func (s *CreateDirectoryInput) Validate() error { 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 *CreateDirectoryInput) SetDescription(v string) *CreateDirectoryInput { +func (s *ConnectDirectoryInput) SetDescription(v string) *ConnectDirectoryInput { s.Description = &v return s } // SetName sets the Name field's value. -func (s *CreateDirectoryInput) SetName(v string) *CreateDirectoryInput { +func (s *ConnectDirectoryInput) SetName(v string) *ConnectDirectoryInput { s.Name = &v return s } // SetPassword sets the Password field's value. -func (s *CreateDirectoryInput) SetPassword(v string) *CreateDirectoryInput { +func (s *ConnectDirectoryInput) SetPassword(v string) *ConnectDirectoryInput { s.Password = &v return s } // SetShortName sets the ShortName field's value. -func (s *CreateDirectoryInput) SetShortName(v string) *CreateDirectoryInput { +func (s *ConnectDirectoryInput) SetShortName(v string) *ConnectDirectoryInput { s.ShortName = &v return s } // SetSize sets the Size field's value. -func (s *CreateDirectoryInput) SetSize(v string) *CreateDirectoryInput { +func (s *ConnectDirectoryInput) SetSize(v string) *ConnectDirectoryInput { s.Size = &v return s } // SetTags sets the Tags field's value. -func (s *CreateDirectoryInput) SetTags(v []*Tag) *CreateDirectoryInput { +func (s *ConnectDirectoryInput) SetTags(v []*Tag) *ConnectDirectoryInput { s.Tags = 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. -type CreateDirectoryOutput struct { +// Contains the results of the ConnectDirectory operation. +type ConnectDirectoryOutput struct { _ struct{} `type:"structure"` - // The identifier of the directory that was created. + // The identifier of the new directory. DirectoryId *string `type:"string"` } // String returns the string representation -func (s CreateDirectoryOutput) String() string { +func (s ConnectDirectoryOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateDirectoryOutput) GoString() string { +func (s ConnectDirectoryOutput) GoString() string { return s.String() } // SetDirectoryId sets the DirectoryId field's value. -func (s *CreateDirectoryOutput) SetDirectoryId(v string) *CreateDirectoryOutput { +func (s *ConnectDirectoryOutput) SetDirectoryId(v string) *ConnectDirectoryOutput { s.DirectoryId = &v return s } -type CreateLogSubscriptionInput struct { +// Contains the inputs for the CreateAlias operation. +type CreateAliasInput struct { _ struct{} `type:"structure"` - // Identifier (ID) of the directory to which you want to subscribe and receive - // real-time logs to your specified CloudWatch log group. + // The requested alias. // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` + // 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 name of the CloudWatch log group where the real-time domain controller - // logs are forwarded. + // The identifier of the directory for which to create the alias. // - // LogGroupName is a required field - LogGroupName *string `min:"1" type:"string" required:"true"` + // DirectoryId is a required field + DirectoryId *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateLogSubscriptionInput) String() string { +func (s CreateAliasInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateLogSubscriptionInput) GoString() string { +func (s CreateAliasInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLogSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLogSubscriptionInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) +func (s *CreateAliasInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateAliasInput"} + if s.Alias == nil { + invalidParams.Add(request.NewErrParamRequired("Alias")) } - if s.LogGroupName == nil { - invalidParams.Add(request.NewErrParamRequired("LogGroupName")) + if s.Alias != nil && len(*s.Alias) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Alias", 1)) } - if s.LogGroupName != nil && len(*s.LogGroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogGroupName", 1)) + if s.DirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryId")) } if invalidParams.Len() > 0 { @@ -5902,107 +6708,121 @@ func (s *CreateLogSubscriptionInput) Validate() error { return nil } -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateLogSubscriptionInput) SetDirectoryId(v string) *CreateLogSubscriptionInput { - s.DirectoryId = &v +// SetAlias sets the Alias field's value. +func (s *CreateAliasInput) SetAlias(v string) *CreateAliasInput { + s.Alias = &v return s } -// SetLogGroupName sets the LogGroupName field's value. -func (s *CreateLogSubscriptionInput) SetLogGroupName(v string) *CreateLogSubscriptionInput { - s.LogGroupName = &v +// SetDirectoryId sets the DirectoryId field's value. +func (s *CreateAliasInput) SetDirectoryId(v string) *CreateAliasInput { + s.DirectoryId = &v return s } -type CreateLogSubscriptionOutput struct { +// Contains the results of the CreateAlias operation. +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 CreateLogSubscriptionOutput) String() string { +func (s CreateAliasOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateLogSubscriptionOutput) GoString() string { +func (s CreateAliasOutput) GoString() string { return s.String() } -// Creates an AWS Managed Microsoft AD directory. -type CreateMicrosoftADInput struct { - _ struct{} `type:"structure"` +// SetAlias sets the Alias field's value. +func (s *CreateAliasOutput) SetAlias(v string) *CreateAliasOutput { + s.Alias = &v + return s +} - // 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"` +// SetDirectoryId sets the DirectoryId field's value. +func (s *CreateAliasOutput) SetDirectoryId(v string) *CreateAliasOutput { + s.DirectoryId = &v + return s +} - // AWS Managed Microsoft AD is available in two editions: Standard and Enterprise. - // Enterprise is the default. - Edition *string `type:"string" enum:"DirectoryEdition"` +// Contains the inputs for the CreateComputer operation. +type CreateComputerInput struct { + _ struct{} `type:"structure"` - // 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"` + // An array of Attribute objects that contain any LDAP attributes to apply to + // the computer account. + ComputerAttributes []*Attribute `type:"list"` - // The password for the default administrative user named Admin. + // The name of the computer account. // - // Password is a required field - Password *string `type:"string" required:"true" sensitive:"true"` + // ComputerName is a required field + ComputerName *string `min:"1" 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"` + // The identifier of the directory in which to create the computer account. + // + // DirectoryId is a required field + DirectoryId *string `type:"string" required:"true"` - // The tags to be assigned to the AWS Managed Microsoft AD directory. - Tags []*Tag `type:"list"` + // The fully-qualified distinguished name of the organizational unit to place + // the computer account in. + OrganizationalUnitDistinguishedName *string `min:"1" type:"string"` - // Contains VPC information for the CreateDirectory or CreateMicrosoftAD operation. + // 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. // - // VpcSettings is a required field - VpcSettings *DirectoryVpcSettings `type:"structure" required:"true"` + // Password is a required field + Password *string `min:"8" type:"string" required:"true" sensitive:"true"` } // String returns the string representation -func (s CreateMicrosoftADInput) String() string { +func (s CreateComputerInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateMicrosoftADInput) GoString() string { +func (s CreateComputerInput) 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")) +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.VpcSettings == nil { - invalidParams.Add(request.NewErrParamRequired("VpcSettings")) + if s.Password != nil && len(*s.Password) < 8 { + invalidParams.Add(request.NewErrParamMinLen("Password", 8)) } - if s.Tags != nil { - for i, v := range s.Tags { + 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]", "Tags", i), err.(request.ErrInvalidParams)) + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ComputerAttributes", i), err.(request.ErrInvalidParams)) } } } - if s.VpcSettings != nil { - if err := s.VpcSettings.Validate(); err != nil { - invalidParams.AddNested("VpcSettings", err.(request.ErrInvalidParams)) - } - } if invalidParams.Len() > 0 { return invalidParams @@ -6010,101 +6830,106 @@ func (s *CreateMicrosoftADInput) Validate() error { return nil } -// SetDescription sets the Description field's value. -func (s *CreateMicrosoftADInput) SetDescription(v string) *CreateMicrosoftADInput { - s.Description = &v - return s -} - -// SetEdition sets the Edition field's value. -func (s *CreateMicrosoftADInput) SetEdition(v string) *CreateMicrosoftADInput { - s.Edition = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateMicrosoftADInput) SetName(v string) *CreateMicrosoftADInput { - s.Name = &v +// SetComputerAttributes sets the ComputerAttributes field's value. +func (s *CreateComputerInput) SetComputerAttributes(v []*Attribute) *CreateComputerInput { + s.ComputerAttributes = v return s } -// SetPassword sets the Password field's value. -func (s *CreateMicrosoftADInput) SetPassword(v string) *CreateMicrosoftADInput { - s.Password = &v +// SetComputerName sets the ComputerName field's value. +func (s *CreateComputerInput) SetComputerName(v string) *CreateComputerInput { + s.ComputerName = &v return s } -// SetShortName sets the ShortName field's value. -func (s *CreateMicrosoftADInput) SetShortName(v string) *CreateMicrosoftADInput { - s.ShortName = &v +// SetDirectoryId sets the DirectoryId field's value. +func (s *CreateComputerInput) SetDirectoryId(v string) *CreateComputerInput { + s.DirectoryId = &v return s } -// SetTags sets the Tags field's value. -func (s *CreateMicrosoftADInput) SetTags(v []*Tag) *CreateMicrosoftADInput { - s.Tags = v +// SetOrganizationalUnitDistinguishedName sets the OrganizationalUnitDistinguishedName field's value. +func (s *CreateComputerInput) SetOrganizationalUnitDistinguishedName(v string) *CreateComputerInput { + s.OrganizationalUnitDistinguishedName = &v return s } -// SetVpcSettings sets the VpcSettings field's value. -func (s *CreateMicrosoftADInput) SetVpcSettings(v *DirectoryVpcSettings) *CreateMicrosoftADInput { - s.VpcSettings = v +// SetPassword sets the Password field's value. +func (s *CreateComputerInput) SetPassword(v string) *CreateComputerInput { + s.Password = &v return s } -// Result of a CreateMicrosoftAD request. -type CreateMicrosoftADOutput struct { +// Contains the results for the CreateComputer operation. +type CreateComputerOutput struct { _ struct{} `type:"structure"` - // The identifier of the directory that was created. - DirectoryId *string `type:"string"` + // A Computer object that represents the computer account. + Computer *Computer `type:"structure"` } // String returns the string representation -func (s CreateMicrosoftADOutput) String() string { +func (s CreateComputerOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateMicrosoftADOutput) GoString() string { +func (s CreateComputerOutput) GoString() string { return s.String() } -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateMicrosoftADOutput) SetDirectoryId(v string) *CreateMicrosoftADOutput { - s.DirectoryId = &v +// SetComputer sets the Computer field's value. +func (s *CreateComputerOutput) SetComputer(v *Computer) *CreateComputerOutput { + s.Computer = v return s } -// Contains the inputs for the CreateSnapshot operation. -type CreateSnapshotInput struct { +// 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. +type CreateConditionalForwarderInput struct { _ struct{} `type:"structure"` - // The identifier of the directory of which to take a snapshot. + // 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 descriptive name to apply to the snapshot. - Name *string `type:"string"` + // 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 CreateSnapshotInput) String() string { +func (s CreateConditionalForwarderInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateSnapshotInput) GoString() string { +func (s CreateConditionalForwarderInput) 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"} +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 @@ -6113,112 +6938,112 @@ func (s *CreateSnapshotInput) Validate() error { } // SetDirectoryId sets the DirectoryId field's value. -func (s *CreateSnapshotInput) SetDirectoryId(v string) *CreateSnapshotInput { +func (s *CreateConditionalForwarderInput) SetDirectoryId(v string) *CreateConditionalForwarderInput { s.DirectoryId = &v return s } -// SetName sets the Name field's value. -func (s *CreateSnapshotInput) SetName(v string) *CreateSnapshotInput { - s.Name = &v +// SetDnsIpAddrs sets the DnsIpAddrs field's value. +func (s *CreateConditionalForwarderInput) SetDnsIpAddrs(v []*string) *CreateConditionalForwarderInput { + s.DnsIpAddrs = v return s } -// Contains the results of the CreateSnapshot operation. -type CreateSnapshotOutput struct { - _ struct{} `type:"structure"` +// SetRemoteDomainName sets the RemoteDomainName field's value. +func (s *CreateConditionalForwarderInput) SetRemoteDomainName(v string) *CreateConditionalForwarderInput { + s.RemoteDomainName = &v + return s +} - // The identifier of the snapshot that was created. - SnapshotId *string `type:"string"` +// The result of a CreateConditinalForwarder request. +type CreateConditionalForwarderOutput struct { + _ struct{} `type:"structure"` } // String returns the string representation -func (s CreateSnapshotOutput) String() string { +func (s CreateConditionalForwarderOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateSnapshotOutput) GoString() string { +func (s CreateConditionalForwarderOutput) 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 -// AWS Managed Microsoft AD directory, 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 an AWS Managed Microsoft AD directory and an external domain. -type CreateTrustInput struct { +// Contains the inputs for the CreateDirectory operation. +type CreateDirectoryInput struct { _ struct{} `type:"structure"` - // The IP addresses of the remote DNS server associated with RemoteDomainName. - ConditionalForwarderIpAddrs []*string `type:"list"` + // A description for the directory. + Description *string `type:"string"` - // The Directory ID of the AWS Managed Microsoft AD directory for which to establish - // the trust relationship. + // The fully qualified name for the directory, such as corp.example.com. // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` + // Name is a required field + Name *string `type:"string" required:"true"` - // The Fully Qualified Domain Name (FQDN) of the external domain for which to - // create the trust relationship. + // The password for the directory administrator. The directory creation process + // creates a directory administrator account with the user name Administrator + // and this password. // - // RemoteDomainName is a required field - RemoteDomainName *string `type:"string" required:"true"` + // If you need to change the password for the administrator account, you can + // use the ResetUserPassword API call. + // + // Password is a required field + Password *string `type:"string" required:"true" sensitive:"true"` - // Optional parameter to enable selective authentication for the trust. - SelectiveAuth *string `type:"string" enum:"SelectiveAuth"` + // The NetBIOS name of the directory, such as CORP. + ShortName *string `type:"string"` - // The direction of the trust relationship. + // The size of the directory. // - // TrustDirection is a required field - TrustDirection *string `type:"string" required:"true" enum:"TrustDirection"` + // Size is a required field + Size *string `type:"string" required:"true" enum:"DirectorySize"` - // 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" sensitive:"true"` + // The tags to be assigned to the Simple AD directory. + Tags []*Tag `type:"list"` - // The trust relationship type. Forest is the default. - TrustType *string `type:"string" enum:"TrustType"` + // A DirectoryVpcSettings object that contains additional information for the + // operation. + VpcSettings *DirectoryVpcSettings `type:"structure"` } // String returns the string representation -func (s CreateTrustInput) String() string { +func (s CreateDirectoryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTrustInput) GoString() string { +func (s CreateDirectoryInput) 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")) +func (s *CreateDirectoryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateDirectoryInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) } - if s.RemoteDomainName == nil { - invalidParams.Add(request.NewErrParamRequired("RemoteDomainName")) + if s.Password == nil { + invalidParams.Add(request.NewErrParamRequired("Password")) } - if s.TrustDirection == nil { - invalidParams.Add(request.NewErrParamRequired("TrustDirection")) + if s.Size == nil { + invalidParams.Add(request.NewErrParamRequired("Size")) } - if s.TrustPassword == nil { - invalidParams.Add(request.NewErrParamRequired("TrustPassword")) + 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 s.TrustPassword != nil && len(*s.TrustPassword) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TrustPassword", 1)) + if s.VpcSettings != nil { + if err := s.VpcSettings.Validate(); err != nil { + invalidParams.AddNested("VpcSettings", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -6227,106 +7052,109 @@ func (s *CreateTrustInput) Validate() error { return nil } -// SetConditionalForwarderIpAddrs sets the ConditionalForwarderIpAddrs field's value. -func (s *CreateTrustInput) SetConditionalForwarderIpAddrs(v []*string) *CreateTrustInput { - s.ConditionalForwarderIpAddrs = v +// SetDescription sets the Description field's value. +func (s *CreateDirectoryInput) SetDescription(v string) *CreateDirectoryInput { + s.Description = &v return s } -// SetDirectoryId sets the DirectoryId field's value. -func (s *CreateTrustInput) SetDirectoryId(v string) *CreateTrustInput { - s.DirectoryId = &v +// SetName sets the Name field's value. +func (s *CreateDirectoryInput) SetName(v string) *CreateDirectoryInput { + s.Name = &v return s } -// SetRemoteDomainName sets the RemoteDomainName field's value. -func (s *CreateTrustInput) SetRemoteDomainName(v string) *CreateTrustInput { - s.RemoteDomainName = &v +// SetPassword sets the Password field's value. +func (s *CreateDirectoryInput) SetPassword(v string) *CreateDirectoryInput { + s.Password = &v return s } -// SetSelectiveAuth sets the SelectiveAuth field's value. -func (s *CreateTrustInput) SetSelectiveAuth(v string) *CreateTrustInput { - s.SelectiveAuth = &v +// SetShortName sets the ShortName field's value. +func (s *CreateDirectoryInput) SetShortName(v string) *CreateDirectoryInput { + s.ShortName = &v return s } -// SetTrustDirection sets the TrustDirection field's value. -func (s *CreateTrustInput) SetTrustDirection(v string) *CreateTrustInput { - s.TrustDirection = &v +// SetSize sets the Size field's value. +func (s *CreateDirectoryInput) SetSize(v string) *CreateDirectoryInput { + s.Size = &v return s } -// SetTrustPassword sets the TrustPassword field's value. -func (s *CreateTrustInput) SetTrustPassword(v string) *CreateTrustInput { - s.TrustPassword = &v +// SetTags sets the Tags field's value. +func (s *CreateDirectoryInput) SetTags(v []*Tag) *CreateDirectoryInput { + s.Tags = v return s } -// SetTrustType sets the TrustType field's value. -func (s *CreateTrustInput) SetTrustType(v string) *CreateTrustInput { - s.TrustType = &v +// SetVpcSettings sets the VpcSettings field's value. +func (s *CreateDirectoryInput) SetVpcSettings(v *DirectoryVpcSettings) *CreateDirectoryInput { + s.VpcSettings = v return s } -// The result of a CreateTrust request. -type CreateTrustOutput struct { +// Contains the results of the CreateDirectory operation. +type CreateDirectoryOutput struct { _ struct{} `type:"structure"` - // A unique identifier for the trust relationship that was created. - TrustId *string `type:"string"` + // The identifier of the directory that was created. + DirectoryId *string `type:"string"` } // String returns the string representation -func (s CreateTrustOutput) String() string { +func (s CreateDirectoryOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTrustOutput) GoString() string { +func (s CreateDirectoryOutput) GoString() string { return s.String() } -// SetTrustId sets the TrustId field's value. -func (s *CreateTrustOutput) SetTrustId(v string) *CreateTrustOutput { - s.TrustId = &v +// SetDirectoryId sets the DirectoryId field's value. +func (s *CreateDirectoryOutput) SetDirectoryId(v string) *CreateDirectoryOutput { + s.DirectoryId = &v return s } -// Deletes a conditional forwarder. -type DeleteConditionalForwarderInput struct { +type CreateLogSubscriptionInput struct { _ struct{} `type:"structure"` - // The directory ID for which you are deleting the conditional forwarder. + // Identifier of the directory to which you want to subscribe and receive real-time + // logs to your specified CloudWatch log group. // // 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. + // The name of the CloudWatch log group where the real-time domain controller + // logs are forwarded. // - // RemoteDomainName is a required field - RemoteDomainName *string `type:"string" required:"true"` + // LogGroupName is a required field + LogGroupName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s DeleteConditionalForwarderInput) String() string { +func (s CreateLogSubscriptionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteConditionalForwarderInput) GoString() string { +func (s CreateLogSubscriptionInput) 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"} +func (s *CreateLogSubscriptionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLogSubscriptionInput"} if s.DirectoryId == nil { invalidParams.Add(request.NewErrParamRequired("DirectoryId")) } - if s.RemoteDomainName == nil { - invalidParams.Add(request.NewErrParamRequired("RemoteDomainName")) + 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 { @@ -6336,57 +7164,108 @@ func (s *DeleteConditionalForwarderInput) Validate() error { } // SetDirectoryId sets the DirectoryId field's value. -func (s *DeleteConditionalForwarderInput) SetDirectoryId(v string) *DeleteConditionalForwarderInput { +func (s *CreateLogSubscriptionInput) SetDirectoryId(v string) *CreateLogSubscriptionInput { s.DirectoryId = &v return s } -// SetRemoteDomainName sets the RemoteDomainName field's value. -func (s *DeleteConditionalForwarderInput) SetRemoteDomainName(v string) *DeleteConditionalForwarderInput { - s.RemoteDomainName = &v +// SetLogGroupName sets the LogGroupName field's value. +func (s *CreateLogSubscriptionInput) SetLogGroupName(v string) *CreateLogSubscriptionInput { + s.LogGroupName = &v return s } -// The result of a DeleteConditionalForwarder request. -type DeleteConditionalForwarderOutput struct { +type CreateLogSubscriptionOutput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s DeleteConditionalForwarderOutput) String() string { +func (s CreateLogSubscriptionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteConditionalForwarderOutput) GoString() string { +func (s CreateLogSubscriptionOutput) GoString() string { return s.String() } -// Contains the inputs for the DeleteDirectory operation. -type DeleteDirectoryInput struct { +// Creates an AWS Managed Microsoft AD directory. +type CreateMicrosoftADInput struct { _ struct{} `type:"structure"` - // The identifier of the directory to delete. + // A description for the directory. This label will appear on the AWS console + // Directory Details page after the directory is created. + Description *string `type:"string"` + + // AWS Managed Microsoft AD is available in two editions: Standard and Enterprise. + // Enterprise is the default. + Edition *string `type:"string" enum:"DirectoryEdition"` + + // The fully qualified domain name for the AWS Managed Microsoft AD directory, + // such as corp.example.com. This name will resolve inside your VPC only. It + // does not need to be publicly resolvable. // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` + // Name is a required field + Name *string `type:"string" required:"true"` + + // The password for the default administrative user named Admin. + // + // If you need to change the password for the administrator account, you can + // use the ResetUserPassword API call. + // + // Password is a required field + Password *string `type:"string" required:"true" sensitive:"true"` + + // The NetBIOS name 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"` + + // The tags to be assigned to the AWS Managed Microsoft AD directory. + Tags []*Tag `type:"list"` + + // 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 DeleteDirectoryInput) String() string { +func (s CreateMicrosoftADInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteDirectoryInput) GoString() string { +func (s CreateMicrosoftADInput) 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")) +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.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 s.VpcSettings != nil { + if err := s.VpcSettings.Validate(); err != nil { + invalidParams.AddNested("VpcSettings", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -6395,113 +7274,100 @@ func (s *DeleteDirectoryInput) Validate() error { return nil } -// SetDirectoryId sets the DirectoryId field's value. -func (s *DeleteDirectoryInput) SetDirectoryId(v string) *DeleteDirectoryInput { - s.DirectoryId = &v +// SetDescription sets the Description field's value. +func (s *CreateMicrosoftADInput) SetDescription(v string) *CreateMicrosoftADInput { + s.Description = &v return s } -// Contains the results of the DeleteDirectory operation. -type DeleteDirectoryOutput struct { - _ struct{} `type:"structure"` - - // The directory identifier. - DirectoryId *string `type:"string"` +// SetEdition sets the Edition field's value. +func (s *CreateMicrosoftADInput) SetEdition(v string) *CreateMicrosoftADInput { + s.Edition = &v + return s } -// String returns the string representation -func (s DeleteDirectoryOutput) String() string { - return awsutil.Prettify(s) +// SetName sets the Name field's value. +func (s *CreateMicrosoftADInput) SetName(v string) *CreateMicrosoftADInput { + s.Name = &v + return s } -// GoString returns the string representation -func (s DeleteDirectoryOutput) GoString() string { - return s.String() +// SetPassword sets the Password field's value. +func (s *CreateMicrosoftADInput) SetPassword(v string) *CreateMicrosoftADInput { + s.Password = &v + return s } -// SetDirectoryId sets the DirectoryId field's value. -func (s *DeleteDirectoryOutput) SetDirectoryId(v string) *DeleteDirectoryOutput { - s.DirectoryId = &v +// SetShortName sets the ShortName field's value. +func (s *CreateMicrosoftADInput) SetShortName(v string) *CreateMicrosoftADInput { + s.ShortName = &v return s } -type DeleteLogSubscriptionInput struct { +// SetTags sets the Tags field's value. +func (s *CreateMicrosoftADInput) SetTags(v []*Tag) *CreateMicrosoftADInput { + s.Tags = 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. +type CreateMicrosoftADOutput struct { _ struct{} `type:"structure"` - // Identifier (ID) of the directory whose log subscription you want to delete. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` + // The identifier of the directory that was created. + DirectoryId *string `type:"string"` } // String returns the string representation -func (s DeleteLogSubscriptionInput) String() string { +func (s CreateMicrosoftADOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteLogSubscriptionInput) GoString() string { +func (s CreateMicrosoftADOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLogSubscriptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLogSubscriptionInput"} - 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 *DeleteLogSubscriptionInput) SetDirectoryId(v string) *DeleteLogSubscriptionInput { +func (s *CreateMicrosoftADOutput) SetDirectoryId(v string) *CreateMicrosoftADOutput { s.DirectoryId = &v return s } -type DeleteLogSubscriptionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteLogSubscriptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteLogSubscriptionOutput) GoString() string { - return s.String() -} - -// Contains the inputs for the DeleteSnapshot operation. -type DeleteSnapshotInput struct { +// Contains the inputs for the CreateSnapshot operation. +type CreateSnapshotInput struct { _ struct{} `type:"structure"` - // The identifier of the directory snapshot to be deleted. + // The identifier of the directory of which to take a snapshot. // - // SnapshotId is a required field - SnapshotId *string `type:"string" required:"true"` + // 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 DeleteSnapshotInput) String() string { +func (s CreateSnapshotInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSnapshotInput) GoString() string { +func (s CreateSnapshotInput) 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")) +func (s *CreateSnapshotInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateSnapshotInput"} + if s.DirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryId")) } if invalidParams.Len() > 0 { @@ -6510,65 +7376,113 @@ func (s *DeleteSnapshotInput) Validate() error { return nil } -// SetSnapshotId sets the SnapshotId field's value. -func (s *DeleteSnapshotInput) SetSnapshotId(v string) *DeleteSnapshotInput { - s.SnapshotId = &v +// SetDirectoryId sets the DirectoryId field's value. +func (s *CreateSnapshotInput) SetDirectoryId(v string) *CreateSnapshotInput { + s.DirectoryId = &v return s } -// Contains the results of the DeleteSnapshot operation. -type DeleteSnapshotOutput struct { +// 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. +type CreateSnapshotOutput struct { _ struct{} `type:"structure"` - // The identifier of the directory snapshot that was deleted. + // The identifier of the snapshot that was created. SnapshotId *string `type:"string"` } // String returns the string representation -func (s DeleteSnapshotOutput) String() string { +func (s CreateSnapshotOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSnapshotOutput) GoString() string { +func (s CreateSnapshotOutput) GoString() string { return s.String() } // SetSnapshotId sets the SnapshotId field's value. -func (s *DeleteSnapshotOutput) SetSnapshotId(v string) *DeleteSnapshotOutput { +func (s *CreateSnapshotOutput) SetSnapshotId(v string) *CreateSnapshotOutput { s.SnapshotId = &v return s } -// Deletes the local side of an existing trust relationship between the AWS -// Managed Microsoft AD directory and the external domain. -type DeleteTrustInput struct { +// AWS Directory Service for Microsoft Active Directory allows you to configure +// trust relationships. For example, you can establish a trust between your +// AWS Managed Microsoft AD directory, 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 an AWS Managed Microsoft AD directory and an external domain. +type CreateTrustInput struct { _ struct{} `type:"structure"` - // Delete a conditional forwarder as part of a DeleteTrustRequest. - DeleteAssociatedConditionalForwarder *bool `type:"boolean"` + // The IP addresses of the remote DNS server associated with RemoteDomainName. + ConditionalForwarderIpAddrs []*string `type:"list"` - // The Trust ID of the trust relationship to be deleted. + // The Directory ID of the AWS Managed Microsoft AD directory for which to establish + // the trust relationship. // - // TrustId is a required field - TrustId *string `type:"string" required:"true"` + // 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"` + + // Optional parameter to enable selective authentication for the trust. + SelectiveAuth *string `type:"string" enum:"SelectiveAuth"` + + // 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" sensitive:"true"` + + // The trust relationship type. Forest is the default. + TrustType *string `type:"string" enum:"TrustType"` } // String returns the string representation -func (s DeleteTrustInput) String() string { +func (s CreateTrustInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTrustInput) GoString() string { +func (s CreateTrustInput) 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")) +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 { @@ -6577,79 +7491,106 @@ func (s *DeleteTrustInput) Validate() error { return nil } -// SetDeleteAssociatedConditionalForwarder sets the DeleteAssociatedConditionalForwarder field's value. -func (s *DeleteTrustInput) SetDeleteAssociatedConditionalForwarder(v bool) *DeleteTrustInput { - s.DeleteAssociatedConditionalForwarder = &v +// SetConditionalForwarderIpAddrs sets the ConditionalForwarderIpAddrs field's value. +func (s *CreateTrustInput) SetConditionalForwarderIpAddrs(v []*string) *CreateTrustInput { + s.ConditionalForwarderIpAddrs = v return s } -// SetTrustId sets the TrustId field's value. -func (s *DeleteTrustInput) SetTrustId(v string) *DeleteTrustInput { - s.TrustId = &v +// SetDirectoryId sets the DirectoryId field's value. +func (s *CreateTrustInput) SetDirectoryId(v string) *CreateTrustInput { + s.DirectoryId = &v return s } -// The result of a DeleteTrust request. -type DeleteTrustOutput struct { +// SetRemoteDomainName sets the RemoteDomainName field's value. +func (s *CreateTrustInput) SetRemoteDomainName(v string) *CreateTrustInput { + s.RemoteDomainName = &v + return s +} + +// SetSelectiveAuth sets the SelectiveAuth field's value. +func (s *CreateTrustInput) SetSelectiveAuth(v string) *CreateTrustInput { + s.SelectiveAuth = &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. +type CreateTrustOutput struct { _ struct{} `type:"structure"` - // The Trust ID of the trust relationship that was deleted. + // A unique identifier for the trust relationship that was created. TrustId *string `type:"string"` } // String returns the string representation -func (s DeleteTrustOutput) String() string { +func (s CreateTrustOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTrustOutput) GoString() string { +func (s CreateTrustOutput) GoString() string { return s.String() } // SetTrustId sets the TrustId field's value. -func (s *DeleteTrustOutput) SetTrustId(v string) *DeleteTrustOutput { +func (s *CreateTrustOutput) SetTrustId(v string) *CreateTrustOutput { s.TrustId = &v return s } -// Removes the specified directory as a publisher to the specified SNS topic. -type DeregisterEventTopicInput struct { +// Deletes a conditional forwarder. +type DeleteConditionalForwarderInput struct { _ struct{} `type:"structure"` - // The Directory ID to remove as a publisher. This directory will no longer - // send messages to the specified SNS topic. + // The directory ID for which you are deleting the conditional forwarder. // // 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. + // The fully qualified domain name (FQDN) of the remote domain with which you + // are deleting the conditional forwarder. // - // TopicName is a required field - TopicName *string `min:"1" type:"string" required:"true"` + // RemoteDomainName is a required field + RemoteDomainName *string `type:"string" required:"true"` } // String returns the string representation -func (s DeregisterEventTopicInput) String() string { +func (s DeleteConditionalForwarderInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeregisterEventTopicInput) GoString() string { +func (s DeleteConditionalForwarderInput) 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"} +func (s *DeleteConditionalForwarderInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteConditionalForwarderInput"} 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 s.RemoteDomainName == nil { + invalidParams.Add(request.NewErrParamRequired("RemoteDomainName")) } if invalidParams.Len() > 0 { @@ -6659,60 +7600,55 @@ func (s *DeregisterEventTopicInput) Validate() error { } // SetDirectoryId sets the DirectoryId field's value. -func (s *DeregisterEventTopicInput) SetDirectoryId(v string) *DeregisterEventTopicInput { +func (s *DeleteConditionalForwarderInput) SetDirectoryId(v string) *DeleteConditionalForwarderInput { s.DirectoryId = &v return s } -// SetTopicName sets the TopicName field's value. -func (s *DeregisterEventTopicInput) SetTopicName(v string) *DeregisterEventTopicInput { - s.TopicName = &v +// SetRemoteDomainName sets the RemoteDomainName field's value. +func (s *DeleteConditionalForwarderInput) SetRemoteDomainName(v string) *DeleteConditionalForwarderInput { + s.RemoteDomainName = &v return s } -// The result of a DeregisterEventTopic request. -type DeregisterEventTopicOutput struct { +// The result of a DeleteConditionalForwarder request. +type DeleteConditionalForwarderOutput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s DeregisterEventTopicOutput) String() string { +func (s DeleteConditionalForwarderOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeregisterEventTopicOutput) GoString() string { +func (s DeleteConditionalForwarderOutput) GoString() string { return s.String() } -// Describes a conditional forwarder. -type DescribeConditionalForwardersInput struct { +// Contains the inputs for the DeleteDirectory operation. +type DeleteDirectoryInput struct { _ struct{} `type:"structure"` - // The directory ID for which to get the list of associated conditional forwarders. + // The identifier of the directory to delete. // // 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 { +func (s DeleteDirectoryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeConditionalForwardersInput) GoString() string { +func (s DeleteDirectoryInput) 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"} +func (s *DeleteDirectoryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteDirectoryInput"} if s.DirectoryId == nil { invalidParams.Add(request.NewErrParamRequired("DirectoryId")) } @@ -6724,164 +7660,112 @@ func (s *DescribeConditionalForwardersInput) Validate() error { } // SetDirectoryId sets the DirectoryId field's value. -func (s *DescribeConditionalForwardersInput) SetDirectoryId(v string) *DescribeConditionalForwardersInput { +func (s *DeleteDirectoryInput) SetDirectoryId(v string) *DeleteDirectoryInput { 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. -type DescribeConditionalForwardersOutput struct { +// Contains the results of the DeleteDirectory operation. +type DeleteDirectoryOutput struct { _ struct{} `type:"structure"` - // The list of conditional forwarders that have been created. - ConditionalForwarders []*ConditionalForwarder `type:"list"` + // The directory identifier. + DirectoryId *string `type:"string"` } // String returns the string representation -func (s DescribeConditionalForwardersOutput) String() string { +func (s DeleteDirectoryOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeConditionalForwardersOutput) GoString() string { +func (s DeleteDirectoryOutput) GoString() string { return s.String() } -// SetConditionalForwarders sets the ConditionalForwarders field's value. -func (s *DescribeConditionalForwardersOutput) SetConditionalForwarders(v []*ConditionalForwarder) *DescribeConditionalForwardersOutput { - s.ConditionalForwarders = v +// SetDirectoryId sets the DirectoryId field's value. +func (s *DeleteDirectoryOutput) SetDirectoryId(v string) *DeleteDirectoryOutput { + s.DirectoryId = &v return s } -// Contains the inputs for the DescribeDirectories operation. -type DescribeDirectoriesInput struct { +type DeleteLogSubscriptionInput 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. + // Identifier of the directory whose log subscription you want to delete. // - // 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"` + // DirectoryId is a required field + DirectoryId *string `type:"string" required:"true"` } // String returns the string representation -func (s DescribeDirectoriesInput) String() string { +func (s DeleteLogSubscriptionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeDirectoriesInput) GoString() string { +func (s DeleteLogSubscriptionInput) GoString() string { return s.String() } -// SetDirectoryIds sets the DirectoryIds field's value. -func (s *DescribeDirectoriesInput) SetDirectoryIds(v []*string) *DescribeDirectoriesInput { - s.DirectoryIds = v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteLogSubscriptionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteLogSubscriptionInput"} + if s.DirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryId")) + } -// SetLimit sets the Limit field's value. -func (s *DescribeDirectoriesInput) SetLimit(v int64) *DescribeDirectoriesInput { - s.Limit = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetNextToken sets the NextToken field's value. -func (s *DescribeDirectoriesInput) SetNextToken(v string) *DescribeDirectoriesInput { - s.NextToken = &v +// SetDirectoryId sets the DirectoryId field's value. +func (s *DeleteLogSubscriptionInput) SetDirectoryId(v string) *DeleteLogSubscriptionInput { + s.DirectoryId = &v return s } -// Contains the results of the DescribeDirectories operation. -type DescribeDirectoriesOutput struct { +type DeleteLogSubscriptionOutput 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 { +func (s DeleteLogSubscriptionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeDirectoriesOutput) GoString() string { +func (s DeleteLogSubscriptionOutput) 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 -} - -type DescribeDomainControllersInput struct { +// Contains the inputs for the DeleteSnapshot operation. +type DeleteSnapshotInput struct { _ struct{} `type:"structure"` - // Identifier of the directory for which to retrieve the domain controller information. + // The identifier of the directory snapshot to be deleted. // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` - - // A list of identifiers for the domain controllers whose information will be - // provided. - DomainControllerIds []*string `type:"list"` - - // The maximum number of items to return. - Limit *int64 `type:"integer"` - - // The DescribeDomainControllers.NextToken value from a previous call to DescribeDomainControllers. - // Pass null if this is the first call. - NextToken *string `type:"string"` + // SnapshotId is a required field + SnapshotId *string `type:"string" required:"true"` } // String returns the string representation -func (s DescribeDomainControllersInput) String() string { +func (s DeleteSnapshotInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeDomainControllersInput) GoString() string { +func (s DeleteSnapshotInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDomainControllersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDomainControllersInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) +func (s *DeleteSnapshotInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteSnapshotInput"} + if s.SnapshotId == nil { + invalidParams.Add(request.NewErrParamRequired("SnapshotId")) } if invalidParams.Len() > 0 { @@ -6890,160 +7774,141 @@ func (s *DescribeDomainControllersInput) Validate() error { return nil } -// SetDirectoryId sets the DirectoryId field's value. -func (s *DescribeDomainControllersInput) SetDirectoryId(v string) *DescribeDomainControllersInput { - s.DirectoryId = &v - return s -} - -// SetDomainControllerIds sets the DomainControllerIds field's value. -func (s *DescribeDomainControllersInput) SetDomainControllerIds(v []*string) *DescribeDomainControllersInput { - s.DomainControllerIds = v - return s -} - -// SetLimit sets the Limit field's value. -func (s *DescribeDomainControllersInput) SetLimit(v int64) *DescribeDomainControllersInput { - s.Limit = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeDomainControllersInput) SetNextToken(v string) *DescribeDomainControllersInput { - s.NextToken = &v +// SetSnapshotId sets the SnapshotId field's value. +func (s *DeleteSnapshotInput) SetSnapshotId(v string) *DeleteSnapshotInput { + s.SnapshotId = &v return s } -type DescribeDomainControllersOutput struct { +// Contains the results of the DeleteSnapshot operation. +type DeleteSnapshotOutput struct { _ struct{} `type:"structure"` - // List of the DomainController objects that were retrieved. - DomainControllers []*DomainController `type:"list"` - - // If not null, more results are available. Pass this value for the NextToken - // parameter in a subsequent call to DescribeDomainControllers retrieve the - // next set of items. - NextToken *string `type:"string"` + // The identifier of the directory snapshot that was deleted. + SnapshotId *string `type:"string"` } // String returns the string representation -func (s DescribeDomainControllersOutput) String() string { +func (s DeleteSnapshotOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeDomainControllersOutput) GoString() string { +func (s DeleteSnapshotOutput) GoString() string { return s.String() } -// SetDomainControllers sets the DomainControllers field's value. -func (s *DescribeDomainControllersOutput) SetDomainControllers(v []*DomainController) *DescribeDomainControllersOutput { - s.DomainControllers = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeDomainControllersOutput) SetNextToken(v string) *DescribeDomainControllersOutput { - s.NextToken = &v +// SetSnapshotId sets the SnapshotId field's value. +func (s *DeleteSnapshotOutput) SetSnapshotId(v string) *DeleteSnapshotOutput { + s.SnapshotId = &v return s } -// Describes event topics. -type DescribeEventTopicsInput struct { +// Deletes the local side of an existing trust relationship between the AWS +// Managed Microsoft AD directory and the external domain. +type DeleteTrustInput 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"` + // Delete a conditional forwarder as part of a DeleteTrustRequest. + DeleteAssociatedConditionalForwarder *bool `type:"boolean"` - // 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. + // The Trust ID of the trust relationship to be deleted. // - // An empty list results in an InvalidParameterException being thrown. - TopicNames []*string `type:"list"` + // TrustId is a required field + TrustId *string `type:"string" required:"true"` } // String returns the string representation -func (s DescribeEventTopicsInput) String() string { +func (s DeleteTrustInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeEventTopicsInput) GoString() string { +func (s DeleteTrustInput) GoString() string { return s.String() } -// SetDirectoryId sets the DirectoryId field's value. -func (s *DescribeEventTopicsInput) SetDirectoryId(v string) *DescribeEventTopicsInput { - s.DirectoryId = &v - return s -} +// 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")) + } -// SetTopicNames sets the TopicNames field's value. -func (s *DescribeEventTopicsInput) SetTopicNames(v []*string) *DescribeEventTopicsInput { - s.TopicNames = v + 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 } -// The result of a DescribeEventTopic request. -type DescribeEventTopicsOutput struct { +// 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. +type DeleteTrustOutput struct { _ struct{} `type:"structure"` - // A list of SNS topic names that receive status messages from the specified - // Directory ID. - EventTopics []*EventTopic `type:"list"` + // The Trust ID of the trust relationship that was deleted. + TrustId *string `type:"string"` } // String returns the string representation -func (s DescribeEventTopicsOutput) String() string { +func (s DeleteTrustOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeEventTopicsOutput) GoString() string { +func (s DeleteTrustOutput) GoString() string { return s.String() } -// SetEventTopics sets the EventTopics field's value. -func (s *DescribeEventTopicsOutput) SetEventTopics(v []*EventTopic) *DescribeEventTopicsOutput { - s.EventTopics = v +// SetTrustId sets the TrustId field's value. +func (s *DeleteTrustOutput) SetTrustId(v string) *DeleteTrustOutput { + s.TrustId = &v return s } -type DescribeSharedDirectoriesInput struct { +type DeregisterCertificateInput struct { _ struct{} `type:"structure"` - // The number of shared directories to return in the response object. - Limit *int64 `type:"integer"` - - // The DescribeSharedDirectoriesResult.NextToken value from a previous call - // to DescribeSharedDirectories. Pass null if this is the first call. - NextToken *string `type:"string"` - - // Returns the identifier of the directory in the directory owner account. + // The identifier of the certificate. // - // OwnerDirectoryId is a required field - OwnerDirectoryId *string `type:"string" required:"true"` + // CertificateId is a required field + CertificateId *string `type:"string" required:"true"` - // A list of identifiers of all shared directories in your account. - SharedDirectoryIds []*string `type:"list"` + // The identifier of the directory. + // + // DirectoryId is a required field + DirectoryId *string `type:"string" required:"true"` } // String returns the string representation -func (s DescribeSharedDirectoriesInput) String() string { +func (s DeregisterCertificateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeSharedDirectoriesInput) GoString() string { +func (s DeregisterCertificateInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSharedDirectoriesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSharedDirectoriesInput"} - if s.OwnerDirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("OwnerDirectoryId")) +func (s *DeregisterCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeregisterCertificateInput"} + if s.CertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateId")) + } + if s.DirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryId")) } if invalidParams.Len() > 0 { @@ -7052,317 +7917,378 @@ func (s *DescribeSharedDirectoriesInput) Validate() error { return nil } -// SetLimit sets the Limit field's value. -func (s *DescribeSharedDirectoriesInput) SetLimit(v int64) *DescribeSharedDirectoriesInput { - s.Limit = &v +// SetCertificateId sets the CertificateId field's value. +func (s *DeregisterCertificateInput) SetCertificateId(v string) *DeregisterCertificateInput { + s.CertificateId = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeSharedDirectoriesInput) SetNextToken(v string) *DescribeSharedDirectoriesInput { - s.NextToken = &v +// SetDirectoryId sets the DirectoryId field's value. +func (s *DeregisterCertificateInput) SetDirectoryId(v string) *DeregisterCertificateInput { + s.DirectoryId = &v return s } -// SetOwnerDirectoryId sets the OwnerDirectoryId field's value. -func (s *DescribeSharedDirectoriesInput) SetOwnerDirectoryId(v string) *DescribeSharedDirectoriesInput { - s.OwnerDirectoryId = &v - return s +type DeregisterCertificateOutput struct { + _ struct{} `type:"structure"` } -// SetSharedDirectoryIds sets the SharedDirectoryIds field's value. -func (s *DescribeSharedDirectoriesInput) SetSharedDirectoryIds(v []*string) *DescribeSharedDirectoriesInput { - s.SharedDirectoryIds = v - return s +// String returns the string representation +func (s DeregisterCertificateOutput) String() string { + return awsutil.Prettify(s) } -type DescribeSharedDirectoriesOutput struct { +// GoString returns the string representation +func (s DeregisterCertificateOutput) GoString() string { + return s.String() +} + +// Removes the specified directory as a publisher to the specified SNS topic. +type DeregisterEventTopicInput struct { _ struct{} `type:"structure"` - // If not null, token that indicates that more results are available. Pass this - // value for the NextToken parameter in a subsequent call to DescribeSharedDirectories - // to retrieve the next set of items. - NextToken *string `type:"string"` + // 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"` - // A list of all shared directories in your account. - SharedDirectories []*SharedDirectory `type:"list"` + // 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 DescribeSharedDirectoriesOutput) String() string { +func (s DeregisterEventTopicInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeSharedDirectoriesOutput) GoString() string { +func (s DeregisterEventTopicInput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribeSharedDirectoriesOutput) SetNextToken(v string) *DescribeSharedDirectoriesOutput { - s.NextToken = &v +// 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 } -// SetSharedDirectories sets the SharedDirectories field's value. -func (s *DescribeSharedDirectoriesOutput) SetSharedDirectories(v []*SharedDirectory) *DescribeSharedDirectoriesOutput { - s.SharedDirectories = v +// SetTopicName sets the TopicName field's value. +func (s *DeregisterEventTopicInput) SetTopicName(v string) *DeregisterEventTopicInput { + s.TopicName = &v return s } -// Contains the inputs for the DescribeSnapshots operation. -type DescribeSnapshotsInput struct { +// The result of a DeregisterEventTopic request. +type DeregisterEventTopicOutput struct { _ struct{} `type:"structure"` +} - // The identifier of the directory for which to retrieve snapshot information. - DirectoryId *string `type:"string"` +// String returns the string representation +func (s DeregisterEventTopicOutput) String() string { + return awsutil.Prettify(s) +} - // The maximum number of objects to return. - Limit *int64 `type:"integer"` +// GoString returns the string representation +func (s DeregisterEventTopicOutput) GoString() string { + return s.String() +} - // The DescribeSnapshotsResult.NextToken value from a previous call to DescribeSnapshots. - // Pass null if this is the first call. - NextToken *string `type:"string"` +type DescribeCertificateInput struct { + _ struct{} `type:"structure"` - // 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"` + // The identifier of the certificate. + // + // CertificateId is a required field + CertificateId *string `type:"string" required:"true"` + + // The identifier of the directory. + // + // DirectoryId is a required field + DirectoryId *string `type:"string" required:"true"` } // String returns the string representation -func (s DescribeSnapshotsInput) String() string { +func (s DescribeCertificateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeSnapshotsInput) GoString() string { +func (s DescribeCertificateInput) GoString() string { return s.String() } -// SetDirectoryId sets the DirectoryId field's value. -func (s *DescribeSnapshotsInput) SetDirectoryId(v string) *DescribeSnapshotsInput { - s.DirectoryId = &v - return s -} +// 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.CertificateId == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateId")) + } + if s.DirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryId")) + } -// SetLimit sets the Limit field's value. -func (s *DescribeSnapshotsInput) SetLimit(v int64) *DescribeSnapshotsInput { - s.Limit = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetNextToken sets the NextToken field's value. -func (s *DescribeSnapshotsInput) SetNextToken(v string) *DescribeSnapshotsInput { - s.NextToken = &v +// SetCertificateId sets the CertificateId field's value. +func (s *DescribeCertificateInput) SetCertificateId(v string) *DescribeCertificateInput { + s.CertificateId = &v return s } -// SetSnapshotIds sets the SnapshotIds field's value. -func (s *DescribeSnapshotsInput) SetSnapshotIds(v []*string) *DescribeSnapshotsInput { - s.SnapshotIds = v +// SetDirectoryId sets the DirectoryId field's value. +func (s *DescribeCertificateInput) SetDirectoryId(v string) *DescribeCertificateInput { + s.DirectoryId = &v return s } -// Contains the results of the DescribeSnapshots operation. -type DescribeSnapshotsOutput struct { +type DescribeCertificateOutput 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"` + // Information about the certificate, including registered date time, certificate + // state, the reason for the state, expiration date time, and certificate common + // name. + Certificate *Certificate `type:"structure"` } // String returns the string representation -func (s DescribeSnapshotsOutput) String() string { +func (s DescribeCertificateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeSnapshotsOutput) GoString() string { +func (s DescribeCertificateOutput) 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 +// SetCertificate sets the Certificate field's value. +func (s *DescribeCertificateOutput) SetCertificate(v *Certificate) *DescribeCertificateOutput { + s.Certificate = v return s } -// Describes the trust relationships for a particular AWS Managed Microsoft -// AD directory. If no input parameters are are provided, such as directory -// ID or trust ID, this request describes all the trust relationships. -type DescribeTrustsInput struct { +// Describes a conditional forwarder. +type DescribeConditionalForwardersInput 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. + // The directory ID for which to get the list of associated conditional forwarders. // - // An empty list results in an InvalidParameterException being thrown. - TrustIds []*string `type:"list"` + // 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 DescribeTrustsInput) String() string { +func (s DescribeConditionalForwardersInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeTrustsInput) GoString() string { +func (s DescribeConditionalForwardersInput) GoString() string { return s.String() } -// SetDirectoryId sets the DirectoryId field's value. -func (s *DescribeTrustsInput) SetDirectoryId(v string) *DescribeTrustsInput { +// 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 } -// SetLimit sets the Limit field's value. -func (s *DescribeTrustsInput) SetLimit(v int64) *DescribeTrustsInput { - s.Limit = &v +// SetRemoteDomainNames sets the RemoteDomainNames field's value. +func (s *DescribeConditionalForwardersInput) SetRemoteDomainNames(v []*string) *DescribeConditionalForwardersInput { + s.RemoteDomainNames = v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeTrustsInput) SetNextToken(v string) *DescribeTrustsInput { - s.NextToken = &v - return s +// The result of a DescribeConditionalForwarder request. +type DescribeConditionalForwardersOutput struct { + _ struct{} `type:"structure"` + + // The list of conditional forwarders that have been created. + ConditionalForwarders []*ConditionalForwarder `type:"list"` } -// SetTrustIds sets the TrustIds field's value. -func (s *DescribeTrustsInput) SetTrustIds(v []*string) *DescribeTrustsInput { - s.TrustIds = v +// 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 } -// The result of a DescribeTrust request. -type DescribeTrustsOutput struct { +// Contains the inputs for the DescribeDirectories operation. +type DescribeDirectoriesInput 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. + // 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"` +} - // The list of Trust objects that were retrieved. +// 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. +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. - Trusts []*Trust `type:"list"` + 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 DescribeTrustsOutput) String() string { +func (s DescribeDirectoriesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeTrustsOutput) GoString() string { +func (s DescribeDirectoriesOutput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribeTrustsOutput) SetNextToken(v string) *DescribeTrustsOutput { - s.NextToken = &v +// SetDirectoryDescriptions sets the DirectoryDescriptions field's value. +func (s *DescribeDirectoriesOutput) SetDirectoryDescriptions(v []*DirectoryDescription) *DescribeDirectoriesOutput { + s.DirectoryDescriptions = v return s } -// SetTrusts sets the Trusts field's value. -func (s *DescribeTrustsOutput) SetTrusts(v []*Trust) *DescribeTrustsOutput { - s.Trusts = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeDirectoriesOutput) SetNextToken(v string) *DescribeDirectoriesOutput { + s.NextToken = &v return s } -// Contains information for the ConnectDirectory operation when an AD Connector -// directory is being created. -type DirectoryConnectSettings struct { +type DescribeDomainControllersInput struct { _ struct{} `type:"structure"` - // A list of one or more IP addresses of DNS servers or domain controllers in - // the on-premises directory. + // Identifier of the directory for which to retrieve the domain controller information. // - // CustomerDnsIps is a required field - CustomerDnsIps []*string `type:"list" required:"true"` + // DirectoryId is a required field + DirectoryId *string `type:"string" required:"true"` - // The user name of an account in the on-premises directory that is used to - // connect to the directory. This account must have the following permissions: - // - // * 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 identifiers for the domain controllers whose information will be + // provided. + DomainControllerIds []*string `type:"list"` - // 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 maximum number of items to return. + Limit *int64 `type:"integer"` - // The identifier of the VPC in which the AD Connector is created. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` + // The DescribeDomainControllers.NextToken value from a previous call to DescribeDomainControllers. + // Pass null if this is the first call. + NextToken *string `type:"string"` } // String returns the string representation -func (s DirectoryConnectSettings) String() string { +func (s DescribeDomainControllersInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DirectoryConnectSettings) GoString() string { +func (s DescribeDomainControllersInput) 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")) +func (s *DescribeDomainControllersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeDomainControllersInput"} + if s.DirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryId")) } if invalidParams.Len() > 0 { @@ -7371,267 +8297,910 @@ func (s *DirectoryConnectSettings) Validate() error { return nil } -// SetCustomerDnsIps sets the CustomerDnsIps field's value. -func (s *DirectoryConnectSettings) SetCustomerDnsIps(v []*string) *DirectoryConnectSettings { - s.CustomerDnsIps = v +// SetDirectoryId sets the DirectoryId field's value. +func (s *DescribeDomainControllersInput) SetDirectoryId(v string) *DescribeDomainControllersInput { + s.DirectoryId = &v return s } -// SetCustomerUserName sets the CustomerUserName field's value. -func (s *DirectoryConnectSettings) SetCustomerUserName(v string) *DirectoryConnectSettings { - s.CustomerUserName = &v +// SetDomainControllerIds sets the DomainControllerIds field's value. +func (s *DescribeDomainControllersInput) SetDomainControllerIds(v []*string) *DescribeDomainControllersInput { + s.DomainControllerIds = v return s } -// SetSubnetIds sets the SubnetIds field's value. -func (s *DirectoryConnectSettings) SetSubnetIds(v []*string) *DirectoryConnectSettings { - s.SubnetIds = v +// SetLimit sets the Limit field's value. +func (s *DescribeDomainControllersInput) SetLimit(v int64) *DescribeDomainControllersInput { + s.Limit = &v return s } -// SetVpcId sets the VpcId field's value. -func (s *DirectoryConnectSettings) SetVpcId(v string) *DirectoryConnectSettings { - s.VpcId = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeDomainControllersInput) SetNextToken(v string) *DescribeDomainControllersInput { + s.NextToken = &v return s } -// Contains information about an AD Connector directory. -type DirectoryConnectSettingsDescription struct { +type DescribeDomainControllersOutput 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 user name 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"` + // List of the DomainController objects that were retrieved. + DomainControllers []*DomainController `type:"list"` - // The identifier of the VPC that the AD Connector is in. - VpcId *string `type:"string"` + // If not null, more results are available. Pass this value for the NextToken + // parameter in a subsequent call to DescribeDomainControllers retrieve the + // next set of items. + NextToken *string `type:"string"` } // String returns the string representation -func (s DirectoryConnectSettingsDescription) String() string { +func (s DescribeDomainControllersOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DirectoryConnectSettingsDescription) GoString() string { +func (s DescribeDomainControllersOutput) GoString() string { return s.String() } -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *DirectoryConnectSettingsDescription) SetAvailabilityZones(v []*string) *DirectoryConnectSettingsDescription { - s.AvailabilityZones = v +// SetDomainControllers sets the DomainControllers field's value. +func (s *DescribeDomainControllersOutput) SetDomainControllers(v []*DomainController) *DescribeDomainControllersOutput { + s.DomainControllers = v return s } -// SetConnectIps sets the ConnectIps field's value. -func (s *DirectoryConnectSettingsDescription) SetConnectIps(v []*string) *DirectoryConnectSettingsDescription { - s.ConnectIps = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeDomainControllersOutput) SetNextToken(v string) *DescribeDomainControllersOutput { + s.NextToken = &v return s } -// SetCustomerUserName sets the CustomerUserName field's value. -func (s *DirectoryConnectSettingsDescription) SetCustomerUserName(v string) *DirectoryConnectSettingsDescription { - s.CustomerUserName = &v - return s +// Describes event topics. +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"` } -// SetSecurityGroupId sets the SecurityGroupId field's value. -func (s *DirectoryConnectSettingsDescription) SetSecurityGroupId(v string) *DirectoryConnectSettingsDescription { - s.SecurityGroupId = &v - return s +// String returns the string representation +func (s DescribeEventTopicsInput) String() string { + return awsutil.Prettify(s) } -// SetSubnetIds sets the SubnetIds field's value. -func (s *DirectoryConnectSettingsDescription) SetSubnetIds(v []*string) *DirectoryConnectSettingsDescription { - s.SubnetIds = v +// 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 } -// SetVpcId sets the VpcId field's value. -func (s *DirectoryConnectSettingsDescription) SetVpcId(v string) *DirectoryConnectSettingsDescription { - s.VpcId = &v +// SetTopicNames sets the TopicNames field's value. +func (s *DescribeEventTopicsInput) SetTopicNames(v []*string) *DescribeEventTopicsInput { + s.TopicNames = v return s } -// Contains information about an AWS Directory Service directory. -type DirectoryDescription struct { +// The result of a DescribeEventTopic request. +type DescribeEventTopicsOutput 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 desired number of domain controllers in the directory if the directory - // is Microsoft AD. - DesiredNumberOfDomainControllers *int64 `min:"2" type:"integer"` + // A list of SNS topic names that receive status messages from the specified + // Directory ID. + EventTopics []*EventTopic `type:"list"` +} - // The directory identifier. - DirectoryId *string `type:"string"` +// String returns the string representation +func (s DescribeEventTopicsOutput) String() string { + return awsutil.Prettify(s) +} - // 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"` +// GoString returns the string representation +func (s DescribeEventTopicsOutput) GoString() string { + return s.String() +} - // The edition associated with this directory. - Edition *string `type:"string" enum:"DirectoryEdition"` +// SetEventTopics sets the EventTopics field's value. +func (s *DescribeEventTopicsOutput) SetEventTopics(v []*EventTopic) *DescribeEventTopicsOutput { + s.EventTopics = v + return s +} - // Specifies when the directory was created. - LaunchTime *time.Time `type:"timestamp"` +type DescribeLDAPSSettingsInput struct { + _ struct{} `type:"structure"` - // The fully qualified name of the directory. - Name *string `type:"string"` + // The identifier of the directory. + // + // DirectoryId is a required field + DirectoryId *string `type:"string" required:"true"` - // Describes the AWS Managed Microsoft AD directory in the directory owner account. - OwnerDirectoryDescription *OwnerDirectoryDescription `type:"structure"` + // Specifies the number of items that should be displayed on one page. + Limit *int64 `min:"1" type:"integer"` - // A RadiusSettings object that contains information about the RADIUS server - // configured for this directory. - RadiusSettings *RadiusSettings `type:"structure"` + // The type of next token used for pagination. + NextToken *string `type:"string"` - // The status of the RADIUS MFA server connection. - RadiusStatus *string `type:"string" enum:"RadiusStatus"` + // The type of LDAP security to enable. Currently only the value Client is supported. + Type *string `type:"string" enum:"LDAPSType"` +} - // The method used when sharing a directory to determine whether the directory - // should be shared within your AWS organization (ORGANIZATIONS) or with any - // AWS account by sending a shared directory request (HANDSHAKE). - ShareMethod *string `type:"string" enum:"ShareMethod"` +// String returns the string representation +func (s DescribeLDAPSSettingsInput) String() string { + return awsutil.Prettify(s) +} - // A directory share request that is sent by the directory owner to the directory - // consumer. The request includes a typed message to help the directory consumer - // administrator determine whether to approve or reject the share invitation. - ShareNotes *string `type:"string" sensitive:"true"` +// GoString returns the string representation +func (s DescribeLDAPSSettingsInput) GoString() string { + return s.String() +} - // Current directory status of the shared AWS Managed Microsoft AD directory. - ShareStatus *string `type:"string" enum:"ShareStatus"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLDAPSSettingsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLDAPSSettingsInput"} + if s.DirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryId")) + } + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } - // The short name of the directory. - ShortName *string `type:"string"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // The directory size. - Size *string `type:"string" enum:"DirectorySize"` +// SetDirectoryId sets the DirectoryId field's value. +func (s *DescribeLDAPSSettingsInput) SetDirectoryId(v string) *DescribeLDAPSSettingsInput { + s.DirectoryId = &v + return s +} - // Indicates if single sign-on is enabled for the directory. For more information, - // see EnableSso and DisableSso. - SsoEnabled *bool `type:"boolean"` +// SetLimit sets the Limit field's value. +func (s *DescribeLDAPSSettingsInput) SetLimit(v int64) *DescribeLDAPSSettingsInput { + s.Limit = &v + return s +} - // The current stage of the directory. - Stage *string `type:"string" enum:"DirectoryStage"` +// SetNextToken sets the NextToken field's value. +func (s *DescribeLDAPSSettingsInput) SetNextToken(v string) *DescribeLDAPSSettingsInput { + s.NextToken = &v + return s +} - // The date and time that the stage was last updated. - StageLastUpdatedDateTime *time.Time `type:"timestamp"` +// SetType sets the Type field's value. +func (s *DescribeLDAPSSettingsInput) SetType(v string) *DescribeLDAPSSettingsInput { + s.Type = &v + return s +} - // Additional information about the directory stage. - StageReason *string `type:"string"` +type DescribeLDAPSSettingsOutput struct { + _ struct{} `type:"structure"` - // The directory size. - Type *string `type:"string" enum:"DirectoryType"` + // Information about LDAP security for the specified directory, including status + // of enablement, state last updated date time, and the reason for the state. + LDAPSSettingsInfo []*LDAPSSettingInfo `type:"list"` - // 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"` + // The next token used to retrieve the LDAPS settings if the number of setting + // types exceeds page limit and there is another page. + NextToken *string `type:"string"` } // String returns the string representation -func (s DirectoryDescription) String() string { +func (s DescribeLDAPSSettingsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DirectoryDescription) GoString() string { +func (s DescribeLDAPSSettingsOutput) GoString() string { return s.String() } -// SetAccessUrl sets the AccessUrl field's value. -func (s *DirectoryDescription) SetAccessUrl(v string) *DirectoryDescription { - s.AccessUrl = &v +// SetLDAPSSettingsInfo sets the LDAPSSettingsInfo field's value. +func (s *DescribeLDAPSSettingsOutput) SetLDAPSSettingsInfo(v []*LDAPSSettingInfo) *DescribeLDAPSSettingsOutput { + s.LDAPSSettingsInfo = v return s } -// SetAlias sets the Alias field's value. -func (s *DirectoryDescription) SetAlias(v string) *DirectoryDescription { - s.Alias = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeLDAPSSettingsOutput) SetNextToken(v string) *DescribeLDAPSSettingsOutput { + s.NextToken = &v return s } -// SetConnectSettings sets the ConnectSettings field's value. -func (s *DirectoryDescription) SetConnectSettings(v *DirectoryConnectSettingsDescription) *DirectoryDescription { - s.ConnectSettings = v - return s -} +type DescribeSharedDirectoriesInput struct { + _ struct{} `type:"structure"` -// SetDescription sets the Description field's value. -func (s *DirectoryDescription) SetDescription(v string) *DirectoryDescription { - s.Description = &v - return s + // The number of shared directories to return in the response object. + Limit *int64 `type:"integer"` + + // The DescribeSharedDirectoriesResult.NextToken value from a previous call + // to DescribeSharedDirectories. Pass null if this is the first call. + NextToken *string `type:"string"` + + // Returns the identifier of the directory in the directory owner account. + // + // OwnerDirectoryId is a required field + OwnerDirectoryId *string `type:"string" required:"true"` + + // A list of identifiers of all shared directories in your account. + SharedDirectoryIds []*string `type:"list"` } -// SetDesiredNumberOfDomainControllers sets the DesiredNumberOfDomainControllers field's value. -func (s *DirectoryDescription) SetDesiredNumberOfDomainControllers(v int64) *DirectoryDescription { - s.DesiredNumberOfDomainControllers = &v - return s +// String returns the string representation +func (s DescribeSharedDirectoriesInput) String() string { + return awsutil.Prettify(s) } -// SetDirectoryId sets the DirectoryId field's value. -func (s *DirectoryDescription) SetDirectoryId(v string) *DirectoryDescription { - s.DirectoryId = &v - return s +// GoString returns the string representation +func (s DescribeSharedDirectoriesInput) GoString() string { + return s.String() } -// SetDnsIpAddrs sets the DnsIpAddrs field's value. -func (s *DirectoryDescription) SetDnsIpAddrs(v []*string) *DirectoryDescription { - s.DnsIpAddrs = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeSharedDirectoriesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeSharedDirectoriesInput"} + if s.OwnerDirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("OwnerDirectoryId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetEdition sets the Edition field's value. -func (s *DirectoryDescription) SetEdition(v string) *DirectoryDescription { - s.Edition = &v +// SetLimit sets the Limit field's value. +func (s *DescribeSharedDirectoriesInput) SetLimit(v int64) *DescribeSharedDirectoriesInput { + s.Limit = &v return s } -// SetLaunchTime sets the LaunchTime field's value. -func (s *DirectoryDescription) SetLaunchTime(v time.Time) *DirectoryDescription { - s.LaunchTime = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeSharedDirectoriesInput) SetNextToken(v string) *DescribeSharedDirectoriesInput { + s.NextToken = &v return s } -// SetName sets the Name field's value. -func (s *DirectoryDescription) SetName(v string) *DirectoryDescription { - s.Name = &v +// SetOwnerDirectoryId sets the OwnerDirectoryId field's value. +func (s *DescribeSharedDirectoriesInput) SetOwnerDirectoryId(v string) *DescribeSharedDirectoriesInput { + s.OwnerDirectoryId = &v return s } -// SetOwnerDirectoryDescription sets the OwnerDirectoryDescription field's value. -func (s *DirectoryDescription) SetOwnerDirectoryDescription(v *OwnerDirectoryDescription) *DirectoryDescription { - s.OwnerDirectoryDescription = v +// SetSharedDirectoryIds sets the SharedDirectoryIds field's value. +func (s *DescribeSharedDirectoriesInput) SetSharedDirectoryIds(v []*string) *DescribeSharedDirectoriesInput { + s.SharedDirectoryIds = v + return s +} + +type DescribeSharedDirectoriesOutput struct { + _ struct{} `type:"structure"` + + // If not null, token that indicates that more results are available. Pass this + // value for the NextToken parameter in a subsequent call to DescribeSharedDirectories + // to retrieve the next set of items. + NextToken *string `type:"string"` + + // A list of all shared directories in your account. + SharedDirectories []*SharedDirectory `type:"list"` +} + +// String returns the string representation +func (s DescribeSharedDirectoriesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSharedDirectoriesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeSharedDirectoriesOutput) SetNextToken(v string) *DescribeSharedDirectoriesOutput { + s.NextToken = &v + return s +} + +// SetSharedDirectories sets the SharedDirectories field's value. +func (s *DescribeSharedDirectoriesOutput) SetSharedDirectories(v []*SharedDirectory) *DescribeSharedDirectoriesOutput { + s.SharedDirectories = v + return s +} + +// Contains the inputs for the DescribeSnapshots operation. +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. +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 AWS Managed Microsoft +// AD directory. If no input parameters are are provided, such as directory +// ID or trust ID, this request describes all the trust relationships. +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. +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 +} + +// The specified directory has already been shared with this AWS account. +type DirectoryAlreadySharedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s DirectoryAlreadySharedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DirectoryAlreadySharedException) GoString() string { + return s.String() +} + +func newErrorDirectoryAlreadySharedException(v protocol.ResponseMetadata) error { + return &DirectoryAlreadySharedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DirectoryAlreadySharedException) Code() string { + return "DirectoryAlreadySharedException" +} + +// Message returns the exception's message. +func (s DirectoryAlreadySharedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DirectoryAlreadySharedException) OrigErr() error { + return nil +} + +func (s DirectoryAlreadySharedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DirectoryAlreadySharedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DirectoryAlreadySharedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Contains information for the ConnectDirectory operation when an AD Connector +// directory is being created. +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 user name of an account in the on-premises directory that is used to + // connect to the directory. This account must have the following permissions: + // + // * 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. +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 user name 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. +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 description for the directory. + Description *string `type:"string"` + + // The desired number of domain controllers in the directory if the directory + // is Microsoft AD. + DesiredNumberOfDomainControllers *int64 `min:"2" type:"integer"` + + // 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"` + + // The edition associated with this directory. + Edition *string `type:"string" enum:"DirectoryEdition"` + + // Specifies when the directory was created. + LaunchTime *time.Time `type:"timestamp"` + + // The fully qualified name of the directory. + Name *string `type:"string"` + + // Describes the AWS Managed Microsoft AD directory in the directory owner account. + OwnerDirectoryDescription *OwnerDirectoryDescription `type:"structure"` + + // 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 method used when sharing a directory to determine whether the directory + // should be shared within your AWS organization (ORGANIZATIONS) or with any + // AWS account by sending a shared directory request (HANDSHAKE). + ShareMethod *string `type:"string" enum:"ShareMethod"` + + // A directory share request that is sent by the directory owner to the directory + // consumer. The request includes a typed message to help the directory consumer + // administrator determine whether to approve or reject the share invitation. + ShareNotes *string `type:"string" sensitive:"true"` + + // Current directory status of the shared AWS Managed Microsoft AD directory. + ShareStatus *string `type:"string" enum:"ShareStatus"` + + // 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"` + + // 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 +} + +// SetDesiredNumberOfDomainControllers sets the DesiredNumberOfDomainControllers field's value. +func (s *DirectoryDescription) SetDesiredNumberOfDomainControllers(v int64) *DirectoryDescription { + s.DesiredNumberOfDomainControllers = &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 +} + +// SetEdition sets the Edition field's value. +func (s *DirectoryDescription) SetEdition(v string) *DirectoryDescription { + s.Edition = &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 +} + +// SetOwnerDirectoryDescription sets the OwnerDirectoryDescription field's value. +func (s *DirectoryDescription) SetOwnerDirectoryDescription(v *OwnerDirectoryDescription) *DirectoryDescription { + s.OwnerDirectoryDescription = v return s } @@ -7641,304 +9210,1368 @@ func (s *DirectoryDescription) SetRadiusSettings(v *RadiusSettings) *DirectoryDe return s } -// SetRadiusStatus sets the RadiusStatus field's value. -func (s *DirectoryDescription) SetRadiusStatus(v string) *DirectoryDescription { - s.RadiusStatus = &v +// SetRadiusStatus sets the RadiusStatus field's value. +func (s *DirectoryDescription) SetRadiusStatus(v string) *DirectoryDescription { + s.RadiusStatus = &v + return s +} + +// SetShareMethod sets the ShareMethod field's value. +func (s *DirectoryDescription) SetShareMethod(v string) *DirectoryDescription { + s.ShareMethod = &v + return s +} + +// SetShareNotes sets the ShareNotes field's value. +func (s *DirectoryDescription) SetShareNotes(v string) *DirectoryDescription { + s.ShareNotes = &v + return s +} + +// SetShareStatus sets the ShareStatus field's value. +func (s *DirectoryDescription) SetShareStatus(v string) *DirectoryDescription { + s.ShareStatus = &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 +} + +// The specified directory does not exist in the system. +type DirectoryDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s DirectoryDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DirectoryDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorDirectoryDoesNotExistException(v protocol.ResponseMetadata) error { + return &DirectoryDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DirectoryDoesNotExistException) Code() string { + return "DirectoryDoesNotExistException" +} + +// Message returns the exception's message. +func (s DirectoryDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DirectoryDoesNotExistException) OrigErr() error { + return nil +} + +func (s DirectoryDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DirectoryDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DirectoryDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type DirectoryLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s DirectoryLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DirectoryLimitExceededException) GoString() string { + return s.String() +} + +func newErrorDirectoryLimitExceededException(v protocol.ResponseMetadata) error { + return &DirectoryLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DirectoryLimitExceededException) Code() string { + return "DirectoryLimitExceededException" +} + +// Message returns the exception's message. +func (s DirectoryLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DirectoryLimitExceededException) OrigErr() error { + return nil +} + +func (s DirectoryLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DirectoryLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DirectoryLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// Contains directory limit information for a Region. +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 AWS Managed Microsoft AD directories in the region. + CloudOnlyMicrosoftADCurrentCount *int64 `type:"integer"` + + // The maximum number of AWS Managed Microsoft AD directories allowed in the + // region. + CloudOnlyMicrosoftADLimit *int64 `type:"integer"` + + // Indicates if the AWS Managed 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 +} + +// The specified directory has not been shared with this AWS account. +type DirectoryNotSharedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s DirectoryNotSharedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DirectoryNotSharedException) GoString() string { + return s.String() +} + +func newErrorDirectoryNotSharedException(v protocol.ResponseMetadata) error { + return &DirectoryNotSharedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DirectoryNotSharedException) Code() string { + return "DirectoryNotSharedException" +} + +// Message returns the exception's message. +func (s DirectoryNotSharedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DirectoryNotSharedException) OrigErr() error { + return nil +} + +func (s DirectoryNotSharedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DirectoryNotSharedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DirectoryNotSharedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified directory is unavailable or could not be found. +type DirectoryUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s DirectoryUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DirectoryUnavailableException) GoString() string { + return s.String() +} + +func newErrorDirectoryUnavailableException(v protocol.ResponseMetadata) error { + return &DirectoryUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DirectoryUnavailableException) Code() string { + return "DirectoryUnavailableException" +} + +// Message returns the exception's message. +func (s DirectoryUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DirectoryUnavailableException) OrigErr() error { + return nil +} + +func (s DirectoryUnavailableException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DirectoryUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DirectoryUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + +// Contains VPC information for the CreateDirectory or CreateMicrosoftAD operation. +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. +type DirectoryVpcSettingsDescription struct { + _ struct{} `type:"structure"` + + // The list of Availability Zones that the directory is in. + AvailabilityZones []*string `type:"list"` + + // The domain controller security group identifier for the directory. + 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 +} + +type DisableLDAPSInput struct { + _ struct{} `type:"structure"` + + // The identifier of the directory. + // + // DirectoryId is a required field + DirectoryId *string `type:"string" required:"true"` + + // The type of LDAP security to enable. Currently only the value Client is supported. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"LDAPSType"` +} + +// String returns the string representation +func (s DisableLDAPSInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableLDAPSInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisableLDAPSInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisableLDAPSInput"} + if s.DirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryId")) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDirectoryId sets the DirectoryId field's value. +func (s *DisableLDAPSInput) SetDirectoryId(v string) *DisableLDAPSInput { + s.DirectoryId = &v + return s +} + +// SetType sets the Type field's value. +func (s *DisableLDAPSInput) SetType(v string) *DisableLDAPSInput { + s.Type = &v + return s +} + +type DisableLDAPSOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DisableLDAPSOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableLDAPSOutput) GoString() string { + return s.String() +} + +// Contains the inputs for the DisableRadius operation. +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. +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. +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" sensitive:"true"` + + // 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. +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 information about the domain controllers for a specified directory. +type DomainController struct { + _ struct{} `type:"structure"` + + // The Availability Zone where the domain controller is located. + AvailabilityZone *string `type:"string"` + + // Identifier of the directory where the domain controller resides. + DirectoryId *string `type:"string"` + + // The IP address of the domain controller. + DnsIpAddr *string `type:"string"` + + // Identifies a specific domain controller in the directory. + DomainControllerId *string `type:"string"` + + // Specifies when the domain controller was created. + LaunchTime *time.Time `type:"timestamp"` + + // The status of the domain controller. + Status *string `type:"string" enum:"DomainControllerStatus"` + + // The date and time that the status was last updated. + StatusLastUpdatedDateTime *time.Time `type:"timestamp"` + + // A description of the domain controller state. + StatusReason *string `type:"string"` + + // Identifier of the subnet in the VPC that contains the domain controller. + SubnetId *string `type:"string"` + + // The identifier of the VPC that contains the domain controller. + VpcId *string `type:"string"` +} + +// String returns the string representation +func (s DomainController) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DomainController) GoString() string { + return s.String() +} + +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *DomainController) SetAvailabilityZone(v string) *DomainController { + s.AvailabilityZone = &v + return s +} + +// SetDirectoryId sets the DirectoryId field's value. +func (s *DomainController) SetDirectoryId(v string) *DomainController { + s.DirectoryId = &v + return s +} + +// SetDnsIpAddr sets the DnsIpAddr field's value. +func (s *DomainController) SetDnsIpAddr(v string) *DomainController { + s.DnsIpAddr = &v + return s +} + +// SetDomainControllerId sets the DomainControllerId field's value. +func (s *DomainController) SetDomainControllerId(v string) *DomainController { + s.DomainControllerId = &v return s } -// SetShareMethod sets the ShareMethod field's value. -func (s *DirectoryDescription) SetShareMethod(v string) *DirectoryDescription { - s.ShareMethod = &v +// SetLaunchTime sets the LaunchTime field's value. +func (s *DomainController) SetLaunchTime(v time.Time) *DomainController { + s.LaunchTime = &v return s } -// SetShareNotes sets the ShareNotes field's value. -func (s *DirectoryDescription) SetShareNotes(v string) *DirectoryDescription { - s.ShareNotes = &v +// SetStatus sets the Status field's value. +func (s *DomainController) SetStatus(v string) *DomainController { + s.Status = &v + return s +} + +// SetStatusLastUpdatedDateTime sets the StatusLastUpdatedDateTime field's value. +func (s *DomainController) SetStatusLastUpdatedDateTime(v time.Time) *DomainController { + s.StatusLastUpdatedDateTime = &v + return s +} + +// SetStatusReason sets the StatusReason field's value. +func (s *DomainController) SetStatusReason(v string) *DomainController { + s.StatusReason = &v + return s +} + +// SetSubnetId sets the SubnetId field's value. +func (s *DomainController) SetSubnetId(v string) *DomainController { + s.SubnetId = &v + return s +} + +// SetVpcId sets the VpcId field's value. +func (s *DomainController) SetVpcId(v string) *DomainController { + s.VpcId = &v + return s +} + +// The maximum allowed number of domain controllers per directory was exceeded. +// The default limit per directory is 20 domain controllers. +type DomainControllerLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s DomainControllerLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DomainControllerLimitExceededException) GoString() string { + return s.String() +} + +func newErrorDomainControllerLimitExceededException(v protocol.ResponseMetadata) error { + return &DomainControllerLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DomainControllerLimitExceededException) Code() string { + return "DomainControllerLimitExceededException" +} + +// Message returns the exception's message. +func (s DomainControllerLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DomainControllerLimitExceededException) OrigErr() error { + return nil +} + +func (s DomainControllerLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DomainControllerLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DomainControllerLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +type EnableLDAPSInput struct { + _ struct{} `type:"structure"` + + // The identifier of the directory. + // + // DirectoryId is a required field + DirectoryId *string `type:"string" required:"true"` + + // The type of LDAP security to enable. Currently only the value Client is supported. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"LDAPSType"` +} + +// String returns the string representation +func (s EnableLDAPSInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableLDAPSInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EnableLDAPSInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EnableLDAPSInput"} + if s.DirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryId")) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDirectoryId sets the DirectoryId field's value. +func (s *EnableLDAPSInput) SetDirectoryId(v string) *EnableLDAPSInput { + s.DirectoryId = &v + return s +} + +// SetType sets the Type field's value. +func (s *EnableLDAPSInput) SetType(v string) *EnableLDAPSInput { + s.Type = &v + return s +} + +type EnableLDAPSOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s EnableLDAPSOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableLDAPSOutput) GoString() string { + return s.String() +} + +// Contains the inputs for the EnableRadius operation. +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 } -// SetShareStatus sets the ShareStatus field's value. -func (s *DirectoryDescription) SetShareStatus(v string) *DirectoryDescription { - s.ShareStatus = &v +// Contains the results of the EnableRadius operation. +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. +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" sensitive:"true"` + + // 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 } -// SetShortName sets the ShortName field's value. -func (s *DirectoryDescription) SetShortName(v string) *DirectoryDescription { - s.ShortName = &v +// SetPassword sets the Password field's value. +func (s *EnableSsoInput) SetPassword(v string) *EnableSsoInput { + s.Password = &v return s } -// SetSize sets the Size field's value. -func (s *DirectoryDescription) SetSize(v string) *DirectoryDescription { - s.Size = &v +// SetUserName sets the UserName field's value. +func (s *EnableSsoInput) SetUserName(v string) *EnableSsoInput { + s.UserName = &v return s } -// SetSsoEnabled sets the SsoEnabled field's value. -func (s *DirectoryDescription) SetSsoEnabled(v bool) *DirectoryDescription { - s.SsoEnabled = &v - return s +// Contains the results of the EnableSso operation. +type EnableSsoOutput struct { + _ struct{} `type:"structure"` } -// SetStage sets the Stage field's value. -func (s *DirectoryDescription) SetStage(v string) *DirectoryDescription { - s.Stage = &v - return s +// String returns the string representation +func (s EnableSsoOutput) String() string { + return awsutil.Prettify(s) } -// SetStageLastUpdatedDateTime sets the StageLastUpdatedDateTime field's value. -func (s *DirectoryDescription) SetStageLastUpdatedDateTime(v time.Time) *DirectoryDescription { - s.StageLastUpdatedDateTime = &v - return s +// GoString returns the string representation +func (s EnableSsoOutput) GoString() string { + return s.String() } -// SetStageReason sets the StageReason field's value. -func (s *DirectoryDescription) SetStageReason(v string) *DirectoryDescription { - s.StageReason = &v - return s +// The specified entity already exists. +type EntityAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` } -// SetType sets the Type field's value. -func (s *DirectoryDescription) SetType(v string) *DirectoryDescription { - s.Type = &v - return s +// String returns the string representation +func (s EntityAlreadyExistsException) String() string { + return awsutil.Prettify(s) } -// SetVpcSettings sets the VpcSettings field's value. -func (s *DirectoryDescription) SetVpcSettings(v *DirectoryVpcSettingsDescription) *DirectoryDescription { - s.VpcSettings = v - return s +// GoString returns the string representation +func (s EntityAlreadyExistsException) GoString() string { + return s.String() } -// Contains directory limit information for a region. -type DirectoryLimits struct { - _ struct{} `type:"structure"` +func newErrorEntityAlreadyExistsException(v protocol.ResponseMetadata) error { + return &EntityAlreadyExistsException{ + respMetadata: v, + } +} - // The current number of cloud directories in the region. - CloudOnlyDirectoriesCurrentCount *int64 `type:"integer"` +// Code returns the exception type name. +func (s EntityAlreadyExistsException) Code() string { + return "EntityAlreadyExistsException" +} - // The maximum number of cloud directories allowed in the region. - CloudOnlyDirectoriesLimit *int64 `type:"integer"` +// Message returns the exception's message. +func (s EntityAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Indicates if the cloud directory limit has been reached. - CloudOnlyDirectoriesLimitReached *bool `type:"boolean"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EntityAlreadyExistsException) OrigErr() error { + return nil +} - // The current number of AWS Managed Microsoft AD directories in the region. - CloudOnlyMicrosoftADCurrentCount *int64 `type:"integer"` +func (s EntityAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} - // The maximum number of AWS Managed Microsoft AD directories allowed in the - // region. - CloudOnlyMicrosoftADLimit *int64 `type:"integer"` +// Status code returns the HTTP status code for the request's response error. +func (s EntityAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} - // Indicates if the AWS Managed Microsoft AD directory limit has been reached. - CloudOnlyMicrosoftADLimitReached *bool `type:"boolean"` +// RequestID returns the service's response RequestID for request. +func (s EntityAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} - // The current number of connected directories in the region. - ConnectedDirectoriesCurrentCount *int64 `type:"integer"` +// The specified entity could not be found. +type EntityDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The maximum number of connected directories allowed in the region. - ConnectedDirectoriesLimit *int64 `type:"integer"` + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` - // Indicates if the connected directory limit has been reached. - ConnectedDirectoriesLimitReached *bool `type:"boolean"` + // The AWS request identifier. + RequestId *string `type:"string"` } // String returns the string representation -func (s DirectoryLimits) String() string { +func (s EntityDoesNotExistException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DirectoryLimits) GoString() string { +func (s EntityDoesNotExistException) GoString() string { return s.String() } -// SetCloudOnlyDirectoriesCurrentCount sets the CloudOnlyDirectoriesCurrentCount field's value. -func (s *DirectoryLimits) SetCloudOnlyDirectoriesCurrentCount(v int64) *DirectoryLimits { - s.CloudOnlyDirectoriesCurrentCount = &v - return s +func newErrorEntityDoesNotExistException(v protocol.ResponseMetadata) error { + return &EntityDoesNotExistException{ + respMetadata: v, + } } -// SetCloudOnlyDirectoriesLimit sets the CloudOnlyDirectoriesLimit field's value. -func (s *DirectoryLimits) SetCloudOnlyDirectoriesLimit(v int64) *DirectoryLimits { - s.CloudOnlyDirectoriesLimit = &v - return s +// Code returns the exception type name. +func (s EntityDoesNotExistException) Code() string { + return "EntityDoesNotExistException" } -// SetCloudOnlyDirectoriesLimitReached sets the CloudOnlyDirectoriesLimitReached field's value. -func (s *DirectoryLimits) SetCloudOnlyDirectoriesLimitReached(v bool) *DirectoryLimits { - s.CloudOnlyDirectoriesLimitReached = &v - return s +// Message returns the exception's message. +func (s EntityDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetCloudOnlyMicrosoftADCurrentCount sets the CloudOnlyMicrosoftADCurrentCount field's value. -func (s *DirectoryLimits) SetCloudOnlyMicrosoftADCurrentCount(v int64) *DirectoryLimits { - s.CloudOnlyMicrosoftADCurrentCount = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EntityDoesNotExistException) OrigErr() error { + return nil } -// SetCloudOnlyMicrosoftADLimit sets the CloudOnlyMicrosoftADLimit field's value. -func (s *DirectoryLimits) SetCloudOnlyMicrosoftADLimit(v int64) *DirectoryLimits { - s.CloudOnlyMicrosoftADLimit = &v - return s +func (s EntityDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetCloudOnlyMicrosoftADLimitReached sets the CloudOnlyMicrosoftADLimitReached field's value. -func (s *DirectoryLimits) SetCloudOnlyMicrosoftADLimitReached(v bool) *DirectoryLimits { - s.CloudOnlyMicrosoftADLimitReached = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s EntityDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetConnectedDirectoriesCurrentCount sets the ConnectedDirectoriesCurrentCount field's value. -func (s *DirectoryLimits) SetConnectedDirectoriesCurrentCount(v int64) *DirectoryLimits { - s.ConnectedDirectoriesCurrentCount = &v - return s +// RequestID returns the service's response RequestID for request. +func (s EntityDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID } -// SetConnectedDirectoriesLimit sets the ConnectedDirectoriesLimit field's value. -func (s *DirectoryLimits) SetConnectedDirectoriesLimit(v int64) *DirectoryLimits { - s.ConnectedDirectoriesLimit = &v - return s -} +// Information about SNS topic and AWS Directory Service directory associations. +type EventTopic struct { + _ struct{} `type:"structure"` -// SetConnectedDirectoriesLimitReached sets the ConnectedDirectoriesLimitReached field's value. -func (s *DirectoryLimits) SetConnectedDirectoriesLimitReached(v bool) *DirectoryLimits { - s.ConnectedDirectoriesLimitReached = &v - return s -} + // The date and time of when you associated your directory with the SNS topic. + CreatedDateTime *time.Time `type:"timestamp"` -// Contains VPC information for the CreateDirectory or CreateMicrosoftAD operation. -type DirectoryVpcSettings struct { - _ struct{} `type:"structure"` + // The Directory ID of an AWS Directory Service directory that will publish + // status messages to an SNS topic. + DirectoryId *string `type:"string"` - // 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 topic registration status. + Status *string `type:"string" enum:"TopicStatus"` - // The identifier of the VPC in which to create the directory. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` + // 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 DirectoryVpcSettings) String() string { +func (s EventTopic) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DirectoryVpcSettings) GoString() string { +func (s EventTopic) 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 +// SetCreatedDateTime sets the CreatedDateTime field's value. +func (s *EventTopic) SetCreatedDateTime(v time.Time) *EventTopic { + s.CreatedDateTime = &v + return s } -// SetSubnetIds sets the SubnetIds field's value. -func (s *DirectoryVpcSettings) SetSubnetIds(v []*string) *DirectoryVpcSettings { - s.SubnetIds = v +// SetDirectoryId sets the DirectoryId field's value. +func (s *EventTopic) SetDirectoryId(v string) *EventTopic { + s.DirectoryId = &v return s } -// SetVpcId sets the VpcId field's value. -func (s *DirectoryVpcSettings) SetVpcId(v string) *DirectoryVpcSettings { - s.VpcId = &v +// SetStatus sets the Status field's value. +func (s *EventTopic) SetStatus(v string) *EventTopic { + s.Status = &v return s } -// Contains information about the directory. -type DirectoryVpcSettingsDescription struct { - _ struct{} `type:"structure"` - - // The list of Availability Zones that the directory is in. - AvailabilityZones []*string `type:"list"` - - // The domain controller security group identifier for the directory. - SecurityGroupId *string `type:"string"` +// SetTopicArn sets the TopicArn field's value. +func (s *EventTopic) SetTopicArn(v string) *EventTopic { + s.TopicArn = &v + return s +} - // The identifiers of the subnets for the directory servers. - SubnetIds []*string `type:"list"` +// SetTopicName sets the TopicName field's value. +func (s *EventTopic) SetTopicName(v string) *EventTopic { + s.TopicName = &v + return s +} - // The identifier of the VPC that the directory is in. - VpcId *string `type:"string"` +// Contains the inputs for the GetDirectoryLimits operation. +type GetDirectoryLimitsInput struct { + _ struct{} `type:"structure"` } // String returns the string representation -func (s DirectoryVpcSettingsDescription) String() string { +func (s GetDirectoryLimitsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DirectoryVpcSettingsDescription) GoString() string { +func (s GetDirectoryLimitsInput) GoString() string { return s.String() } -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *DirectoryVpcSettingsDescription) SetAvailabilityZones(v []*string) *DirectoryVpcSettingsDescription { - s.AvailabilityZones = v - return s +// Contains the results of the GetDirectoryLimits operation. +type GetDirectoryLimitsOutput struct { + _ struct{} `type:"structure"` + + // A DirectoryLimits object that contains the directory limits for the current + // rRegion. + DirectoryLimits *DirectoryLimits `type:"structure"` } -// SetSecurityGroupId sets the SecurityGroupId field's value. -func (s *DirectoryVpcSettingsDescription) SetSecurityGroupId(v string) *DirectoryVpcSettingsDescription { - s.SecurityGroupId = &v - return s +// String returns the string representation +func (s GetDirectoryLimitsOutput) String() string { + return awsutil.Prettify(s) } -// SetSubnetIds sets the SubnetIds field's value. -func (s *DirectoryVpcSettingsDescription) SetSubnetIds(v []*string) *DirectoryVpcSettingsDescription { - s.SubnetIds = v - return s +// GoString returns the string representation +func (s GetDirectoryLimitsOutput) GoString() string { + return s.String() } -// SetVpcId sets the VpcId field's value. -func (s *DirectoryVpcSettingsDescription) SetVpcId(v string) *DirectoryVpcSettingsDescription { - s.VpcId = &v +// SetDirectoryLimits sets the DirectoryLimits field's value. +func (s *GetDirectoryLimitsOutput) SetDirectoryLimits(v *DirectoryLimits) *GetDirectoryLimitsOutput { + s.DirectoryLimits = v return s } -// Contains the inputs for the DisableRadius operation. -type DisableRadiusInput struct { +// Contains the inputs for the GetSnapshotLimits operation. +type GetSnapshotLimitsInput struct { _ struct{} `type:"structure"` - // The identifier of the directory for which to disable MFA. + // 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 DisableRadiusInput) String() string { +func (s GetSnapshotLimitsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DisableRadiusInput) GoString() string { +func (s GetSnapshotLimitsInput) 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"} +func (s *GetSnapshotLimitsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSnapshotLimitsInput"} if s.DirectoryId == nil { invalidParams.Add(request.NewErrParamRequired("DirectoryId")) } @@ -7950,647 +10583,759 @@ func (s *DisableRadiusInput) Validate() error { } // SetDirectoryId sets the DirectoryId field's value. -func (s *DisableRadiusInput) SetDirectoryId(v string) *DisableRadiusInput { +func (s *GetSnapshotLimitsInput) SetDirectoryId(v string) *GetSnapshotLimitsInput { s.DirectoryId = &v return s } -// Contains the results of the DisableRadius operation. -type DisableRadiusOutput struct { +// Contains the results of the GetSnapshotLimits operation. +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 DisableRadiusOutput) String() string { +func (s GetSnapshotLimitsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DisableRadiusOutput) GoString() string { +func (s GetSnapshotLimitsOutput) GoString() string { return s.String() } -// Contains the inputs for the DisableSso operation. -type DisableSsoInput struct { - _ struct{} `type:"structure"` +// SetSnapshotLimits sets the SnapshotLimits field's value. +func (s *GetSnapshotLimitsOutput) SetSnapshotLimits(v *SnapshotLimits) *GetSnapshotLimitsOutput { + s.SnapshotLimits = v + return s +} - // The identifier of the directory for which to disable single-sign on. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` +// The account does not have sufficient permission to perform the operation. +type InsufficientPermissionsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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" sensitive:"true"` + // The descriptive message for the exception. + Message_ *string `locationName:"Message" 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"` + // The AWS request identifier. + RequestId *string `type:"string"` } // String returns the string representation -func (s DisableSsoInput) String() string { +func (s InsufficientPermissionsException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DisableSsoInput) GoString() string { +func (s InsufficientPermissionsException) 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 +func newErrorInsufficientPermissionsException(v protocol.ResponseMetadata) error { + return &InsufficientPermissionsException{ + respMetadata: v, } - return nil } -// SetDirectoryId sets the DirectoryId field's value. -func (s *DisableSsoInput) SetDirectoryId(v string) *DisableSsoInput { - s.DirectoryId = &v - return s +// Code returns the exception type name. +func (s InsufficientPermissionsException) Code() string { + return "InsufficientPermissionsException" } -// SetPassword sets the Password field's value. -func (s *DisableSsoInput) SetPassword(v string) *DisableSsoInput { - s.Password = &v - return s +// Message returns the exception's message. +func (s InsufficientPermissionsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetUserName sets the UserName field's value. -func (s *DisableSsoInput) SetUserName(v string) *DisableSsoInput { - s.UserName = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InsufficientPermissionsException) OrigErr() error { + return nil } -// Contains the results of the DisableSso operation. -type DisableSsoOutput struct { - _ struct{} `type:"structure"` +func (s InsufficientPermissionsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// String returns the string representation -func (s DisableSsoOutput) String() string { - return awsutil.Prettify(s) +// Status code returns the HTTP status code for the request's response error. +func (s InsufficientPermissionsException) StatusCode() int { + return s.respMetadata.StatusCode } -// GoString returns the string representation -func (s DisableSsoOutput) GoString() string { - return s.String() +// RequestID returns the service's response RequestID for request. +func (s InsufficientPermissionsException) RequestID() string { + return s.respMetadata.RequestID } -// Contains information about the domain controllers for a specified directory. -type DomainController struct { - _ struct{} `type:"structure"` - - // The Availability Zone where the domain controller is located. - AvailabilityZone *string `type:"string"` - - // Identifier of the directory where the domain controller resides. - DirectoryId *string `type:"string"` - - // The IP address of the domain controller. - DnsIpAddr *string `type:"string"` - - // Identifies a specific domain controller in the directory. - DomainControllerId *string `type:"string"` - - // Specifies when the domain controller was created. - LaunchTime *time.Time `type:"timestamp"` - - // The status of the domain controller. - Status *string `type:"string" enum:"DomainControllerStatus"` - - // The date and time that the status was last updated. - StatusLastUpdatedDateTime *time.Time `type:"timestamp"` - - // A description of the domain controller state. - StatusReason *string `type:"string"` +// The certificate PEM that was provided has incorrect encoding. +type InvalidCertificateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Identifier of the subnet in the VPC that contains the domain controller. - SubnetId *string `type:"string"` + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` - // The identifier of the VPC that contains the domain controller. - VpcId *string `type:"string"` + // The AWS request identifier. + RequestId *string `type:"string"` } // String returns the string representation -func (s DomainController) String() string { +func (s InvalidCertificateException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DomainController) GoString() string { +func (s InvalidCertificateException) GoString() string { return s.String() } -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *DomainController) SetAvailabilityZone(v string) *DomainController { - s.AvailabilityZone = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *DomainController) SetDirectoryId(v string) *DomainController { - s.DirectoryId = &v - return s -} - -// SetDnsIpAddr sets the DnsIpAddr field's value. -func (s *DomainController) SetDnsIpAddr(v string) *DomainController { - s.DnsIpAddr = &v - return s -} - -// SetDomainControllerId sets the DomainControllerId field's value. -func (s *DomainController) SetDomainControllerId(v string) *DomainController { - s.DomainControllerId = &v - return s +func newErrorInvalidCertificateException(v protocol.ResponseMetadata) error { + return &InvalidCertificateException{ + respMetadata: v, + } } -// SetLaunchTime sets the LaunchTime field's value. -func (s *DomainController) SetLaunchTime(v time.Time) *DomainController { - s.LaunchTime = &v - return s +// Code returns the exception type name. +func (s InvalidCertificateException) Code() string { + return "InvalidCertificateException" } -// SetStatus sets the Status field's value. -func (s *DomainController) SetStatus(v string) *DomainController { - s.Status = &v - return s +// Message returns the exception's message. +func (s InvalidCertificateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetStatusLastUpdatedDateTime sets the StatusLastUpdatedDateTime field's value. -func (s *DomainController) SetStatusLastUpdatedDateTime(v time.Time) *DomainController { - s.StatusLastUpdatedDateTime = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidCertificateException) OrigErr() error { + return nil } -// SetStatusReason sets the StatusReason field's value. -func (s *DomainController) SetStatusReason(v string) *DomainController { - s.StatusReason = &v - return s +func (s InvalidCertificateException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetSubnetId sets the SubnetId field's value. -func (s *DomainController) SetSubnetId(v string) *DomainController { - s.SubnetId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidCertificateException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetVpcId sets the VpcId field's value. -func (s *DomainController) SetVpcId(v string) *DomainController { - s.VpcId = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidCertificateException) RequestID() string { + return s.respMetadata.RequestID } -// Contains the inputs for the EnableRadius operation. -type EnableRadiusInput struct { - _ struct{} `type:"structure"` +// The LDAP activities could not be performed because they are limited by the +// LDAPS status. +type InvalidLDAPSStatusException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The identifier of the directory for which to enable MFA. - // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` - // A RadiusSettings object that contains information about the RADIUS server. - // - // RadiusSettings is a required field - RadiusSettings *RadiusSettings `type:"structure" required:"true"` + // The AWS request identifier. + RequestId *string `type:"string"` } // String returns the string representation -func (s EnableRadiusInput) String() string { +func (s InvalidLDAPSStatusException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EnableRadiusInput) GoString() string { +func (s InvalidLDAPSStatusException) 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 +func newErrorInvalidLDAPSStatusException(v protocol.ResponseMetadata) error { + return &InvalidLDAPSStatusException{ + respMetadata: v, } - return nil } -// SetDirectoryId sets the DirectoryId field's value. -func (s *EnableRadiusInput) SetDirectoryId(v string) *EnableRadiusInput { - s.DirectoryId = &v - return s +// Code returns the exception type name. +func (s InvalidLDAPSStatusException) Code() string { + return "InvalidLDAPSStatusException" } -// SetRadiusSettings sets the RadiusSettings field's value. -func (s *EnableRadiusInput) SetRadiusSettings(v *RadiusSettings) *EnableRadiusInput { - s.RadiusSettings = v - return s +// Message returns the exception's message. +func (s InvalidLDAPSStatusException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// Contains the results of the EnableRadius operation. -type EnableRadiusOutput struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidLDAPSStatusException) OrigErr() error { + return nil } -// String returns the string representation -func (s EnableRadiusOutput) String() string { - return awsutil.Prettify(s) +func (s InvalidLDAPSStatusException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// GoString returns the string representation -func (s EnableRadiusOutput) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s InvalidLDAPSStatusException) StatusCode() int { + return s.respMetadata.StatusCode } - -// Contains the inputs for the EnableSso operation. -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" sensitive:"true"` - - // 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"` + +// RequestID returns the service's response RequestID for request. +func (s InvalidLDAPSStatusException) RequestID() string { + return s.respMetadata.RequestID +} + +// The NextToken value is not valid. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` } // String returns the string representation -func (s EnableSsoInput) String() string { +func (s InvalidNextTokenException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EnableSsoInput) GoString() string { +func (s InvalidNextTokenException) 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)) +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { return nil } -// SetDirectoryId sets the DirectoryId field's value. -func (s *EnableSsoInput) SetDirectoryId(v string) *EnableSsoInput { - s.DirectoryId = &v - return s +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetPassword sets the Password field's value. -func (s *EnableSsoInput) SetPassword(v string) *EnableSsoInput { - s.Password = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetUserName sets the UserName field's value. -func (s *EnableSsoInput) SetUserName(v string) *EnableSsoInput { - s.UserName = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID } -// Contains the results of the EnableSso operation. -type EnableSsoOutput struct { - _ struct{} `type:"structure"` +// One or more parameters are not valid. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` } // String returns the string representation -func (s EnableSsoOutput) String() string { +func (s InvalidParameterException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EnableSsoOutput) GoString() string { +func (s InvalidParameterException) GoString() string { return s.String() } -// Information about SNS topic and AWS Directory Service directory associations. -type EventTopic struct { - _ struct{} `type:"structure"` +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} - // The date and time of when you associated your directory with the SNS topic. - CreatedDateTime *time.Time `type:"timestamp"` +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} - // The Directory ID of an AWS Directory Service directory that will publish - // status messages to an SNS topic. - DirectoryId *string `type:"string"` +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The topic registration status. - Status *string `type:"string" enum:"TopicStatus"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} - // The SNS topic ARN (Amazon Resource Name). - TopicArn *string `type:"string"` +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} - // The name of an AWS SNS topic the receives status messages from the directory. - TopicName *string `min:"1" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// The new password provided by the user does not meet the password complexity +// requirements defined in your directory. +type InvalidPasswordException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` } // String returns the string representation -func (s EventTopic) String() string { +func (s InvalidPasswordException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EventTopic) GoString() string { +func (s InvalidPasswordException) 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 +func newErrorInvalidPasswordException(v protocol.ResponseMetadata) error { + return &InvalidPasswordException{ + respMetadata: v, + } } -// SetDirectoryId sets the DirectoryId field's value. -func (s *EventTopic) SetDirectoryId(v string) *EventTopic { - s.DirectoryId = &v - return s +// Code returns the exception type name. +func (s InvalidPasswordException) Code() string { + return "InvalidPasswordException" } -// SetStatus sets the Status field's value. -func (s *EventTopic) SetStatus(v string) *EventTopic { - s.Status = &v - return s +// Message returns the exception's message. +func (s InvalidPasswordException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetTopicArn sets the TopicArn field's value. -func (s *EventTopic) SetTopicArn(v string) *EventTopic { - s.TopicArn = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPasswordException) OrigErr() error { + return nil } -// SetTopicName sets the TopicName field's value. -func (s *EventTopic) SetTopicName(v string) *EventTopic { - s.TopicName = &v - return s +func (s InvalidPasswordException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// Contains the inputs for the GetDirectoryLimits operation. -type GetDirectoryLimitsInput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPasswordException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPasswordException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified shared target is not valid. +type InvalidTargetException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` } // String returns the string representation -func (s GetDirectoryLimitsInput) String() string { +func (s InvalidTargetException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDirectoryLimitsInput) GoString() string { +func (s InvalidTargetException) GoString() string { return s.String() } -// Contains the results of the GetDirectoryLimits operation. -type GetDirectoryLimitsOutput struct { +func newErrorInvalidTargetException(v protocol.ResponseMetadata) error { + return &InvalidTargetException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidTargetException) Code() string { + return "InvalidTargetException" +} + +// Message returns the exception's message. +func (s InvalidTargetException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTargetException) OrigErr() error { + return nil +} + +func (s InvalidTargetException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTargetException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidTargetException) RequestID() string { + return s.respMetadata.RequestID +} + +// IP address block. This is often the address block of the DNS server used +// for your on-premises domain. +type IpRoute struct { _ struct{} `type:"structure"` - // A DirectoryLimits object that contains the directory limits for the current - // region. - DirectoryLimits *DirectoryLimits `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 GetDirectoryLimitsOutput) String() string { +func (s IpRoute) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDirectoryLimitsOutput) GoString() string { +func (s IpRoute) GoString() string { return s.String() } -// SetDirectoryLimits sets the DirectoryLimits field's value. -func (s *GetDirectoryLimitsOutput) SetDirectoryLimits(v *DirectoryLimits) *GetDirectoryLimitsOutput { - s.DirectoryLimits = v +// SetCidrIp sets the CidrIp field's value. +func (s *IpRoute) SetCidrIp(v string) *IpRoute { + s.CidrIp = &v return s } -// Contains the inputs for the GetSnapshotLimits operation. -type GetSnapshotLimitsInput struct { +// 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. +type IpRouteInfo 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"` + // The date and time the address block was added to the directory. + AddedDateTime *time.Time `type:"timestamp"` + + // 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 GetSnapshotLimitsInput) String() string { +func (s IpRouteInfo) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetSnapshotLimitsInput) GoString() string { +func (s IpRouteInfo) 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")) - } +// SetAddedDateTime sets the AddedDateTime field's value. +func (s *IpRouteInfo) SetAddedDateTime(v time.Time) *IpRouteInfo { + s.AddedDateTime = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// 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 *GetSnapshotLimitsInput) SetDirectoryId(v string) *GetSnapshotLimitsInput { +func (s *IpRouteInfo) SetDirectoryId(v string) *IpRouteInfo { s.DirectoryId = &v return s } -// Contains the results of the GetSnapshotLimits operation. -type GetSnapshotLimitsOutput struct { - _ struct{} `type:"structure"` +// SetIpRouteStatusMsg sets the IpRouteStatusMsg field's value. +func (s *IpRouteInfo) SetIpRouteStatusMsg(v string) *IpRouteInfo { + s.IpRouteStatusMsg = &v + return s +} - // A SnapshotLimits object that contains the manual snapshot limits for the - // specified directory. - SnapshotLimits *SnapshotLimits `type:"structure"` +// SetIpRouteStatusReason sets the IpRouteStatusReason field's value. +func (s *IpRouteInfo) SetIpRouteStatusReason(v string) *IpRouteInfo { + s.IpRouteStatusReason = &v + return s +} + +// The maximum allowed number of IP addresses was exceeded. The default limit +// is 100 IP address blocks. +type IpRouteLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` } // String returns the string representation -func (s GetSnapshotLimitsOutput) String() string { +func (s IpRouteLimitExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetSnapshotLimitsOutput) GoString() string { +func (s IpRouteLimitExceededException) GoString() string { return s.String() } -// SetSnapshotLimits sets the SnapshotLimits field's value. -func (s *GetSnapshotLimitsOutput) SetSnapshotLimits(v *SnapshotLimits) *GetSnapshotLimitsOutput { - s.SnapshotLimits = v - return s +func newErrorIpRouteLimitExceededException(v protocol.ResponseMetadata) error { + return &IpRouteLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IpRouteLimitExceededException) Code() string { + return "IpRouteLimitExceededException" +} + +// Message returns the exception's message. +func (s IpRouteLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IpRouteLimitExceededException) OrigErr() error { + return nil +} + +func (s IpRouteLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IpRouteLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// IP address block. This is often the address block of the DNS server used -// for your on-premises domain. -type IpRoute struct { +// RequestID returns the service's response RequestID for request. +func (s IpRouteLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// Contains general information about the LDAPS settings. +type LDAPSSettingInfo 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"` + // The state of the LDAPS settings. + LDAPSStatus *string `type:"string" enum:"LDAPSStatus"` - // Description of the address block. - Description *string `type:"string"` + // Describes a state change for LDAPS. + LDAPSStatusReason *string `type:"string"` + + // The date and time when the LDAPS settings were last updated. + LastUpdatedDateTime *time.Time `type:"timestamp"` } // String returns the string representation -func (s IpRoute) String() string { +func (s LDAPSSettingInfo) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s IpRoute) GoString() string { +func (s LDAPSSettingInfo) GoString() string { return s.String() } -// SetCidrIp sets the CidrIp field's value. -func (s *IpRoute) SetCidrIp(v string) *IpRoute { - s.CidrIp = &v +// SetLDAPSStatus sets the LDAPSStatus field's value. +func (s *LDAPSSettingInfo) SetLDAPSStatus(v string) *LDAPSSettingInfo { + s.LDAPSStatus = &v return s } -// SetDescription sets the Description field's value. -func (s *IpRoute) SetDescription(v string) *IpRoute { - s.Description = &v +// SetLDAPSStatusReason sets the LDAPSStatusReason field's value. +func (s *LDAPSSettingInfo) SetLDAPSStatusReason(v string) *LDAPSSettingInfo { + s.LDAPSStatusReason = &v return s } -// Information about one or more IP address blocks. -type IpRouteInfo struct { - _ struct{} `type:"structure"` - - // The date and time the address block was added to the directory. - AddedDateTime *time.Time `type:"timestamp"` - - // IP address block in the IpRoute. - CidrIp *string `type:"string"` +// SetLastUpdatedDateTime sets the LastUpdatedDateTime field's value. +func (s *LDAPSSettingInfo) SetLastUpdatedDateTime(v time.Time) *LDAPSSettingInfo { + s.LastUpdatedDateTime = &v + return s +} - // Description of the IpRouteInfo. - Description *string `type:"string"` +type ListCertificatesInput struct { + _ struct{} `type:"structure"` - // Identifier (ID) of the directory associated with the IP addresses. - DirectoryId *string `type:"string"` + // The identifier of the directory. + // + // DirectoryId is a required field + DirectoryId *string `type:"string" required:"true"` - // The status of the IP address block. - IpRouteStatusMsg *string `type:"string" enum:"IpRouteStatusMsg"` + // The number of items that should show up on one page + Limit *int64 `min:"1" type:"integer"` - // The reason for the IpRouteStatusMsg. - IpRouteStatusReason *string `type:"string"` + // A token for requesting another page of certificates if the NextToken response + // element indicates that more certificates are available. Use the value of + // the returned NextToken element in your request until the token comes back + // as null. Pass null if this is the first call. + NextToken *string `type:"string"` } // String returns the string representation -func (s IpRouteInfo) String() string { +func (s ListCertificatesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s IpRouteInfo) GoString() string { +func (s ListCertificatesInput) 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 +// 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.DirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryId")) + } + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetCidrIp sets the CidrIp field's value. -func (s *IpRouteInfo) SetCidrIp(v string) *IpRouteInfo { - s.CidrIp = &v +// SetDirectoryId sets the DirectoryId field's value. +func (s *ListCertificatesInput) SetDirectoryId(v string) *ListCertificatesInput { + s.DirectoryId = &v return s } -// SetDescription sets the Description field's value. -func (s *IpRouteInfo) SetDescription(v string) *IpRouteInfo { - s.Description = &v +// SetLimit sets the Limit field's value. +func (s *ListCertificatesInput) SetLimit(v int64) *ListCertificatesInput { + s.Limit = &v return s } -// SetDirectoryId sets the DirectoryId field's value. -func (s *IpRouteInfo) SetDirectoryId(v string) *IpRouteInfo { - s.DirectoryId = &v +// SetNextToken sets the NextToken field's value. +func (s *ListCertificatesInput) SetNextToken(v string) *ListCertificatesInput { + s.NextToken = &v return s } -// SetIpRouteStatusMsg sets the IpRouteStatusMsg field's value. -func (s *IpRouteInfo) SetIpRouteStatusMsg(v string) *IpRouteInfo { - s.IpRouteStatusMsg = &v +type ListCertificatesOutput struct { + _ struct{} `type:"structure"` + + // A list of certificates with basic details including certificate ID, certificate + // common name, certificate state. + CertificatesInfo []*CertificateInfo `type:"list"` + + // Indicates whether another page of certificates is available when the number + // of available certificates exceeds the page limit. + NextToken *string `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() +} + +// SetCertificatesInfo sets the CertificatesInfo field's value. +func (s *ListCertificatesOutput) SetCertificatesInfo(v []*CertificateInfo) *ListCertificatesOutput { + s.CertificatesInfo = v return s } -// SetIpRouteStatusReason sets the IpRouteStatusReason field's value. -func (s *IpRouteInfo) SetIpRouteStatusReason(v string) *IpRouteInfo { - s.IpRouteStatusReason = &v +// SetNextToken sets the NextToken field's value. +func (s *ListCertificatesOutput) SetNextToken(v string) *ListCertificatesOutput { + s.NextToken = &v return s } @@ -8986,6 +11731,127 @@ func (s *LogSubscription) SetSubscriptionCreatedDateTime(v time.Time) *LogSubscr return s } +// The LDAP activities could not be performed because at least one valid certificate +// must be registered with the system. +type NoAvailableCertificateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s NoAvailableCertificateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NoAvailableCertificateException) GoString() string { + return s.String() +} + +func newErrorNoAvailableCertificateException(v protocol.ResponseMetadata) error { + return &NoAvailableCertificateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NoAvailableCertificateException) Code() string { + return "NoAvailableCertificateException" +} + +// Message returns the exception's message. +func (s NoAvailableCertificateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoAvailableCertificateException) OrigErr() error { + return nil +} + +func (s NoAvailableCertificateException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NoAvailableCertificateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NoAvailableCertificateException) RequestID() string { + return s.respMetadata.RequestID +} + +// Exception encountered while trying to access your AWS organization. +type OrganizationsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s OrganizationsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationsException) GoString() string { + return s.String() +} + +func newErrorOrganizationsException(v protocol.ResponseMetadata) error { + return &OrganizationsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OrganizationsException) Code() string { + return "OrganizationsException" +} + +// Message returns the exception's message. +func (s OrganizationsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OrganizationsException) OrigErr() error { + return nil +} + +func (s OrganizationsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OrganizationsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OrganizationsException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes the directory owner account details that have been shared to the // directory consumer account. type OwnerDirectoryDescription struct { @@ -9097,24 +11963,115 @@ func (s RadiusSettings) String() string { } // GoString returns the string representation -func (s RadiusSettings) GoString() string { +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 +} + +type RegisterCertificateInput struct { + _ struct{} `type:"structure"` + + // The certificate PEM string that needs to be registered. + // + // CertificateData is a required field + CertificateData *string `min:"1" type:"string" required:"true"` + + // The identifier of the directory. + // + // DirectoryId is a required field + DirectoryId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s RegisterCertificateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterCertificateInput) 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)) +func (s *RegisterCertificateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RegisterCertificateInput"} + if s.CertificateData == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateData")) } - if s.RadiusTimeout != nil && *s.RadiusTimeout < 1 { - invalidParams.Add(request.NewErrParamMinValue("RadiusTimeout", 1)) + if s.CertificateData != nil && len(*s.CertificateData) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CertificateData", 1)) } - if s.SharedSecret != nil && len(*s.SharedSecret) < 8 { - invalidParams.Add(request.NewErrParamMinLen("SharedSecret", 8)) + if s.DirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryId")) } if invalidParams.Len() > 0 { @@ -9123,51 +12080,38 @@ func (s *RadiusSettings) Validate() error { 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 +// SetCertificateData sets the CertificateData field's value. +func (s *RegisterCertificateInput) SetCertificateData(v string) *RegisterCertificateInput { + s.CertificateData = &v return s } -// SetRadiusPort sets the RadiusPort field's value. -func (s *RadiusSettings) SetRadiusPort(v int64) *RadiusSettings { - s.RadiusPort = &v +// SetDirectoryId sets the DirectoryId field's value. +func (s *RegisterCertificateInput) SetDirectoryId(v string) *RegisterCertificateInput { + s.DirectoryId = &v return s } -// SetRadiusRetries sets the RadiusRetries field's value. -func (s *RadiusSettings) SetRadiusRetries(v int64) *RadiusSettings { - s.RadiusRetries = &v - return s -} +type RegisterCertificateOutput struct { + _ struct{} `type:"structure"` -// SetRadiusServers sets the RadiusServers field's value. -func (s *RadiusSettings) SetRadiusServers(v []*string) *RadiusSettings { - s.RadiusServers = v - return s + // The identifier of the certificate. + CertificateId *string `type:"string"` } -// SetRadiusTimeout sets the RadiusTimeout field's value. -func (s *RadiusSettings) SetRadiusTimeout(v int64) *RadiusSettings { - s.RadiusTimeout = &v - return s +// String returns the string representation +func (s RegisterCertificateOutput) String() string { + return awsutil.Prettify(s) } -// SetSharedSecret sets the SharedSecret field's value. -func (s *RadiusSettings) SetSharedSecret(v string) *RadiusSettings { - s.SharedSecret = &v - return s +// GoString returns the string representation +func (s RegisterCertificateOutput) GoString() string { + return s.String() } -// SetUseSameUsername sets the UseSameUsername field's value. -func (s *RadiusSettings) SetUseSameUsername(v bool) *RadiusSettings { - s.UseSameUsername = &v +// SetCertificateId sets the CertificateId field's value. +func (s *RegisterCertificateOutput) SetCertificateId(v string) *RegisterCertificateOutput { + s.CertificateId = &v return s } @@ -9657,6 +12601,66 @@ func (s *SchemaExtensionInfo) SetStartDateTime(v time.Time) *SchemaExtensionInfo return s } +// An exception has occurred in AWS Directory Service. +type ServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s ServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceException) GoString() string { + return s.String() +} + +func newErrorServiceException(v protocol.ResponseMetadata) error { + return &ServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceException) Code() string { + return "ServiceException" +} + +// Message returns the exception's message. +func (s ServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceException) OrigErr() error { + return nil +} + +func (s ServiceException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceException) RequestID() string { + return s.respMetadata.RequestID +} + type ShareDirectoryInput struct { _ struct{} `type:"structure"` @@ -9767,6 +12771,67 @@ func (s *ShareDirectoryOutput) SetSharedDirectoryId(v string) *ShareDirectoryOut return s } +// The maximum number of AWS accounts that you can share with this directory +// has been reached. +type ShareLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s ShareLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ShareLimitExceededException) GoString() string { + return s.String() +} + +func newErrorShareLimitExceededException(v protocol.ResponseMetadata) error { + return &ShareLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ShareLimitExceededException) Code() string { + return "ShareLimitExceededException" +} + +// Message returns the exception's message. +func (s ShareLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ShareLimitExceededException) OrigErr() error { + return nil +} + +func (s ShareLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ShareLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ShareLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Identifier that contains details about the directory consumer account. type ShareTarget struct { _ struct{} `type:"structure"` @@ -9996,6 +13061,68 @@ func (s *Snapshot) SetType(v string) *Snapshot { return s } +// 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. +type SnapshotLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s SnapshotLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SnapshotLimitExceededException) GoString() string { + return s.String() +} + +func newErrorSnapshotLimitExceededException(v protocol.ResponseMetadata) error { + return &SnapshotLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SnapshotLimitExceededException) Code() string { + return "SnapshotLimitExceededException" +} + +// Message returns the exception's message. +func (s SnapshotLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SnapshotLimitExceededException) OrigErr() error { + return nil +} + +func (s SnapshotLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SnapshotLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SnapshotLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains manual snapshot limit information for a directory. type SnapshotLimits struct { _ struct{} `type:"structure"` @@ -10208,6 +13335,66 @@ func (s *Tag) SetValue(v string) *Tag { return s } +// The maximum allowed number of tags was exceeded. +type TagLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s TagLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagLimitExceededException) GoString() string { + return s.String() +} + +func newErrorTagLimitExceededException(v protocol.ResponseMetadata) error { + return &TagLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagLimitExceededException) Code() string { + return "TagLimitExceededException" +} + +// Message returns the exception's message. +func (s TagLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagLimitExceededException) OrigErr() error { + return nil +} + +func (s TagLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes a trust relationship between an AWS Managed Microsoft AD directory // and an external domain. type Trust struct { @@ -10464,6 +13651,66 @@ func (s *UnshareTarget) SetType(v string) *UnshareTarget { return s } +// The operation is not supported. +type UnsupportedOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s UnsupportedOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedOperationException) GoString() string { + return s.String() +} + +func newErrorUnsupportedOperationException(v protocol.ResponseMetadata) error { + return &UnsupportedOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedOperationException) Code() string { + return "UnsupportedOperationException" +} + +// Message returns the exception's message. +func (s UnsupportedOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedOperationException) OrigErr() error { + return nil +} + +func (s UnsupportedOperationException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedOperationException) RequestID() string { + return s.respMetadata.RequestID +} + // Updates a conditional forwarder. type UpdateConditionalForwarderInput struct { _ struct{} `type:"structure"` @@ -10771,6 +14018,66 @@ func (s *UpdateTrustOutput) SetTrustId(v string) *UpdateTrustOutput { return s } +// The user provided a username that does not exist in your directory. +type UserDoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The descriptive message for the exception. + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request identifier. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s UserDoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserDoesNotExistException) GoString() string { + return s.String() +} + +func newErrorUserDoesNotExistException(v protocol.ResponseMetadata) error { + return &UserDoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UserDoesNotExistException) Code() string { + return "UserDoesNotExistException" +} + +// Message returns the exception's message. +func (s UserDoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UserDoesNotExistException) OrigErr() error { + return nil +} + +func (s UserDoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UserDoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UserDoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + // Initiates the verification of an existing trust relationship between an AWS // Managed Microsoft AD directory and an external domain. type VerifyTrustInput struct { @@ -10835,6 +14142,26 @@ func (s *VerifyTrustOutput) SetTrustId(v string) *VerifyTrustOutput { return s } +const ( + // CertificateStateRegistering is a CertificateState enum value + CertificateStateRegistering = "Registering" + + // CertificateStateRegistered is a CertificateState enum value + CertificateStateRegistered = "Registered" + + // CertificateStateRegisterFailed is a CertificateState enum value + CertificateStateRegisterFailed = "RegisterFailed" + + // CertificateStateDeregistering is a CertificateState enum value + CertificateStateDeregistering = "Deregistering" + + // CertificateStateDeregistered is a CertificateState enum value + CertificateStateDeregistered = "Deregistered" + + // CertificateStateDeregisterFailed is a CertificateState enum value + CertificateStateDeregisterFailed = "DeregisterFailed" +) + const ( // DirectoryEditionEnterprise is a DirectoryEdition enum value DirectoryEditionEnterprise = "Enterprise" @@ -10943,6 +14270,25 @@ const ( IpRouteStatusMsgRemoveFailed = "RemoveFailed" ) +const ( + // LDAPSStatusEnabling is a LDAPSStatus enum value + LDAPSStatusEnabling = "Enabling" + + // LDAPSStatusEnabled is a LDAPSStatus enum value + LDAPSStatusEnabled = "Enabled" + + // LDAPSStatusEnableFailed is a LDAPSStatus enum value + LDAPSStatusEnableFailed = "EnableFailed" + + // LDAPSStatusDisabled is a LDAPSStatus enum value + LDAPSStatusDisabled = "Disabled" +) + +const ( + // LDAPSTypeClient is a LDAPSType enum value + LDAPSTypeClient = "Client" +) + const ( // RadiusAuthenticationProtocolPap is a RadiusAuthenticationProtocol enum value RadiusAuthenticationProtocolPap = "PAP" 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 index b5bdd25a10f..c33562c88e4 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/directoryservice/errors.go @@ -2,6 +2,10 @@ package directoryservice +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccessDeniedException for service response error code @@ -16,6 +20,32 @@ const ( // An authentication error occurred. ErrCodeAuthenticationFailedException = "AuthenticationFailedException" + // ErrCodeCertificateAlreadyExistsException for service response error code + // "CertificateAlreadyExistsException". + // + // The certificate has already been registered into the system. + ErrCodeCertificateAlreadyExistsException = "CertificateAlreadyExistsException" + + // ErrCodeCertificateDoesNotExistException for service response error code + // "CertificateDoesNotExistException". + // + // The certificate is not present in the system for describe or deregister activities. + ErrCodeCertificateDoesNotExistException = "CertificateDoesNotExistException" + + // ErrCodeCertificateInUseException for service response error code + // "CertificateInUseException". + // + // The certificate is being used for the LDAP security connection and cannot + // be removed without disabling LDAP security. + ErrCodeCertificateInUseException = "CertificateInUseException" + + // ErrCodeCertificateLimitExceededException for service response error code + // "CertificateLimitExceededException". + // + // The certificate could not be added because the certificate limit has been + // reached. + ErrCodeCertificateLimitExceededException = "CertificateLimitExceededException" + // ErrCodeClientException for service response error code // "ClientException". // @@ -28,6 +58,12 @@ const ( // The specified directory has already been shared with this AWS account. ErrCodeDirectoryAlreadySharedException = "DirectoryAlreadySharedException" + // ErrCodeDirectoryDoesNotExistException for service response error code + // "DirectoryDoesNotExistException". + // + // The specified directory does not exist in the system. + ErrCodeDirectoryDoesNotExistException = "DirectoryDoesNotExistException" + // ErrCodeDirectoryLimitExceededException for service response error code // "DirectoryLimitExceededException". // @@ -73,6 +109,19 @@ const ( // The account does not have sufficient permission to perform the operation. ErrCodeInsufficientPermissionsException = "InsufficientPermissionsException" + // ErrCodeInvalidCertificateException for service response error code + // "InvalidCertificateException". + // + // The certificate PEM that was provided has incorrect encoding. + ErrCodeInvalidCertificateException = "InvalidCertificateException" + + // ErrCodeInvalidLDAPSStatusException for service response error code + // "InvalidLDAPSStatusException". + // + // The LDAP activities could not be performed because they are limited by the + // LDAPS status. + ErrCodeInvalidLDAPSStatusException = "InvalidLDAPSStatusException" + // ErrCodeInvalidNextTokenException for service response error code // "InvalidNextTokenException". // @@ -105,6 +154,13 @@ const ( // is 100 IP address blocks. ErrCodeIpRouteLimitExceededException = "IpRouteLimitExceededException" + // ErrCodeNoAvailableCertificateException for service response error code + // "NoAvailableCertificateException". + // + // The LDAP activities could not be performed because at least one valid certificate + // must be registered with the system. + ErrCodeNoAvailableCertificateException = "NoAvailableCertificateException" + // ErrCodeOrganizationsException for service response error code // "OrganizationsException". // @@ -150,3 +206,37 @@ const ( // The user provided a username that does not exist in your directory. ErrCodeUserDoesNotExistException = "UserDoesNotExistException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "AuthenticationFailedException": newErrorAuthenticationFailedException, + "CertificateAlreadyExistsException": newErrorCertificateAlreadyExistsException, + "CertificateDoesNotExistException": newErrorCertificateDoesNotExistException, + "CertificateInUseException": newErrorCertificateInUseException, + "CertificateLimitExceededException": newErrorCertificateLimitExceededException, + "ClientException": newErrorClientException, + "DirectoryAlreadySharedException": newErrorDirectoryAlreadySharedException, + "DirectoryDoesNotExistException": newErrorDirectoryDoesNotExistException, + "DirectoryLimitExceededException": newErrorDirectoryLimitExceededException, + "DirectoryNotSharedException": newErrorDirectoryNotSharedException, + "DirectoryUnavailableException": newErrorDirectoryUnavailableException, + "DomainControllerLimitExceededException": newErrorDomainControllerLimitExceededException, + "EntityAlreadyExistsException": newErrorEntityAlreadyExistsException, + "EntityDoesNotExistException": newErrorEntityDoesNotExistException, + "InsufficientPermissionsException": newErrorInsufficientPermissionsException, + "InvalidCertificateException": newErrorInvalidCertificateException, + "InvalidLDAPSStatusException": newErrorInvalidLDAPSStatusException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "InvalidParameterException": newErrorInvalidParameterException, + "InvalidPasswordException": newErrorInvalidPasswordException, + "InvalidTargetException": newErrorInvalidTargetException, + "IpRouteLimitExceededException": newErrorIpRouteLimitExceededException, + "NoAvailableCertificateException": newErrorNoAvailableCertificateException, + "OrganizationsException": newErrorOrganizationsException, + "ServiceException": newErrorServiceException, + "ShareLimitExceededException": newErrorShareLimitExceededException, + "SnapshotLimitExceededException": newErrorSnapshotLimitExceededException, + "TagLimitExceededException": newErrorTagLimitExceededException, + "UnsupportedOperationException": newErrorUnsupportedOperationException, + "UserDoesNotExistException": newErrorUserDoesNotExistException, +} 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 index 0743c9632ca..9d44741af41 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/directoryservice/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/directoryservice/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "ds" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Directory Service" // ServiceID is a unique identifer of a specific service. + ServiceID = "Directory Service" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the DirectoryService client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a DirectoryService client from just a session. // svc := directoryservice.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *DirectoryService { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *DirectoryService { svc := &DirectoryService{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-04-16", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/dlm/api.go b/vendor/github.com/aws/aws-sdk-go/service/dlm/api.go index 6f6e1bb03ff..6182bf173f9 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dlm/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dlm/api.go @@ -67,14 +67,14 @@ func (c *DLM) CreateLifecyclePolicyRequest(input *CreateLifecyclePolicyInput) (r // See the AWS API reference guide for Amazon Data Lifecycle Manager's // API operation CreateLifecyclePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // Bad request. The request is missing required parameters or has invalid parameters. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request failed because a limit was exceeded. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The service failed in an unexpected way. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/CreateLifecyclePolicy @@ -154,14 +154,14 @@ func (c *DLM) DeleteLifecyclePolicyRequest(input *DeleteLifecyclePolicyInput) (r // See the AWS API reference guide for Amazon Data Lifecycle Manager's // API operation DeleteLifecyclePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A requested resource was not found. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The service failed in an unexpected way. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request failed because a limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/DeleteLifecyclePolicy @@ -241,17 +241,17 @@ func (c *DLM) GetLifecyclePoliciesRequest(input *GetLifecyclePoliciesInput) (req // See the AWS API reference guide for Amazon Data Lifecycle Manager's // API operation GetLifecyclePolicies for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A requested resource was not found. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Bad request. The request is missing required parameters or has invalid parameters. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The service failed in an unexpected way. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request failed because a limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/GetLifecyclePolicies @@ -329,14 +329,14 @@ func (c *DLM) GetLifecyclePolicyRequest(input *GetLifecyclePolicyInput) (req *re // See the AWS API reference guide for Amazon Data Lifecycle Manager's // API operation GetLifecyclePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A requested resource was not found. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The service failed in an unexpected way. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request failed because a limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/GetLifecyclePolicy @@ -361,6 +361,263 @@ func (c *DLM) GetLifecyclePolicyWithContext(ctx aws.Context, input *GetLifecycle return out, req.Send() } +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/ListTagsForResource +func (c *DLM) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { + op := &request.Operation{ + Name: opListTagsForResource, + HTTPMethod: "GET", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &ListTagsForResourceInput{} + } + + output = &ListTagsForResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTagsForResource API operation for Amazon Data Lifecycle Manager. +// +// Lists the tags for 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 Data Lifecycle Manager's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * InternalServerException +// The service failed in an unexpected way. +// +// * InvalidRequestException +// Bad request. The request is missing required parameters or has invalid parameters. +// +// * ResourceNotFoundException +// A requested resource was not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/ListTagsForResource +func (c *DLM) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DLM) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/TagResource +func (c *DLM) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { + op := &request.Operation{ + Name: opTagResource, + HTTPMethod: "POST", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &TagResourceInput{} + } + + output = &TagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for Amazon Data Lifecycle Manager. +// +// Adds the specified tags 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 Data Lifecycle Manager's +// API operation TagResource for usage and error information. +// +// Returned Error Types: +// * InternalServerException +// The service failed in an unexpected way. +// +// * InvalidRequestException +// Bad request. The request is missing required parameters or has invalid parameters. +// +// * ResourceNotFoundException +// A requested resource was not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/TagResource +func (c *DLM) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DLM) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/UntagResource +func (c *DLM) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { + op := &request.Operation{ + Name: opUntagResource, + HTTPMethod: "DELETE", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &UntagResourceInput{} + } + + output = &UntagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for Amazon Data Lifecycle Manager. +// +// Removes the specified 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 Data Lifecycle Manager's +// API operation UntagResource for usage and error information. +// +// Returned Error Types: +// * InternalServerException +// The service failed in an unexpected way. +// +// * InvalidRequestException +// Bad request. The request is missing required parameters or has invalid parameters. +// +// * ResourceNotFoundException +// A requested resource was not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/UntagResource +func (c *DLM) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DLM) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opUpdateLifecyclePolicy = "UpdateLifecyclePolicy" // UpdateLifecyclePolicyRequest generates a "aws/request.Request" representing the @@ -415,17 +672,17 @@ func (c *DLM) UpdateLifecyclePolicyRequest(input *UpdateLifecyclePolicyInput) (r // See the AWS API reference guide for Amazon Data Lifecycle Manager's // API operation UpdateLifecyclePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A requested resource was not found. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // Bad request. The request is missing required parameters or has invalid parameters. // -// * ErrCodeInternalServerException "InternalServerException" +// * InternalServerException // The service failed in an unexpected way. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request failed because a limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dlm-2018-01-12/UpdateLifecyclePolicy @@ -467,8 +724,6 @@ type CreateLifecyclePolicyInput struct { // The configuration details of the lifecycle policy. // - // Target tags cannot be re-used across lifecycle policies. - // // PolicyDetails is a required field PolicyDetails *PolicyDetails `type:"structure" required:"true"` @@ -476,6 +731,9 @@ type CreateLifecyclePolicyInput struct { // // State is a required field State *string `type:"string" required:"true" enum:"SettablePolicyStateValues"` + + // The tags to apply to the lifecycle policy during creation. + Tags map[string]*string `min:"1" type:"map"` } // String returns the string representation @@ -503,6 +761,9 @@ func (s *CreateLifecyclePolicyInput) Validate() error { if s.State == nil { invalidParams.Add(request.NewErrParamRequired("State")) } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } if s.PolicyDetails != nil { if err := s.PolicyDetails.Validate(); err != nil { invalidParams.AddNested("PolicyDetails", err.(request.ErrInvalidParams)) @@ -539,6 +800,12 @@ func (s *CreateLifecyclePolicyInput) SetState(v string) *CreateLifecyclePolicyIn return s } +// SetTags sets the Tags field's value. +func (s *CreateLifecyclePolicyInput) SetTags(v map[string]*string) *CreateLifecyclePolicyInput { + s.Tags = v + return s +} + type CreateLifecyclePolicyOutput struct { _ struct{} `type:"structure"` @@ -630,6 +897,143 @@ func (s *CreateRule) SetTimes(v []*string) *CreateRule { return s } +// Specifies the retention rule for cross-Region snapshot copies. +type CrossRegionCopyRetainRule struct { + _ struct{} `type:"structure"` + + // The amount of time to retain each snapshot. The maximum is 100 years. This + // is equivalent to 1200 months, 5200 weeks, or 36500 days. + Interval *int64 `min:"1" type:"integer"` + + // The unit of time for time-based retention. + IntervalUnit *string `type:"string" enum:"RetentionIntervalUnitValues"` +} + +// String returns the string representation +func (s CrossRegionCopyRetainRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CrossRegionCopyRetainRule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CrossRegionCopyRetainRule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CrossRegionCopyRetainRule"} + if s.Interval != nil && *s.Interval < 1 { + invalidParams.Add(request.NewErrParamMinValue("Interval", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInterval sets the Interval field's value. +func (s *CrossRegionCopyRetainRule) SetInterval(v int64) *CrossRegionCopyRetainRule { + s.Interval = &v + return s +} + +// SetIntervalUnit sets the IntervalUnit field's value. +func (s *CrossRegionCopyRetainRule) SetIntervalUnit(v string) *CrossRegionCopyRetainRule { + s.IntervalUnit = &v + return s +} + +// Specifies a rule for cross-Region snapshot copies. +type CrossRegionCopyRule struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the AWS KMS customer master key (CMK) to + // use for EBS encryption. If this parameter is not specified, your AWS managed + // CMK for EBS is used. + CmkArn *string `type:"string"` + + // Copy all user-defined tags from the source snapshot to the copied snapshot. + CopyTags *bool `type:"boolean"` + + // To encrypt a copy of an unencrypted snapshot if encryption by default is + // not enabled, enable encryption using this parameter. Copies of encrypted + // snapshots are encrypted, even if this parameter is false or if encryption + // by default is not enabled. + // + // Encrypted is a required field + Encrypted *bool `type:"boolean" required:"true"` + + // The retention rule. + RetainRule *CrossRegionCopyRetainRule `type:"structure"` + + // The target Region. + // + // TargetRegion is a required field + TargetRegion *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CrossRegionCopyRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CrossRegionCopyRule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CrossRegionCopyRule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CrossRegionCopyRule"} + if s.Encrypted == nil { + invalidParams.Add(request.NewErrParamRequired("Encrypted")) + } + if s.TargetRegion == nil { + invalidParams.Add(request.NewErrParamRequired("TargetRegion")) + } + if s.RetainRule != nil { + if err := s.RetainRule.Validate(); err != nil { + invalidParams.AddNested("RetainRule", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCmkArn sets the CmkArn field's value. +func (s *CrossRegionCopyRule) SetCmkArn(v string) *CrossRegionCopyRule { + s.CmkArn = &v + return s +} + +// SetCopyTags sets the CopyTags field's value. +func (s *CrossRegionCopyRule) SetCopyTags(v bool) *CrossRegionCopyRule { + s.CopyTags = &v + return s +} + +// SetEncrypted sets the Encrypted field's value. +func (s *CrossRegionCopyRule) SetEncrypted(v bool) *CrossRegionCopyRule { + s.Encrypted = &v + return s +} + +// SetRetainRule sets the RetainRule field's value. +func (s *CrossRegionCopyRule) SetRetainRule(v *CrossRegionCopyRetainRule) *CrossRegionCopyRule { + s.RetainRule = v + return s +} + +// SetTargetRegion sets the TargetRegion field's value. +func (s *CrossRegionCopyRule) SetTargetRegion(v string) *CrossRegionCopyRule { + s.TargetRegion = &v + return s +} + type DeleteLifecyclePolicyInput struct { _ struct{} `type:"structure"` @@ -685,6 +1089,83 @@ func (s DeleteLifecyclePolicyOutput) GoString() string { return s.String() } +// Specifies a rule for enabling fast snapshot restore. You can enable fast +// snapshot restore based on either a count or a time interval. +type FastRestoreRule struct { + _ struct{} `type:"structure"` + + // The Availability Zones in which to enable fast snapshot restore. + // + // AvailabilityZones is a required field + AvailabilityZones []*string `min:"1" type:"list" required:"true"` + + // The number of snapshots to be enabled with fast snapshot restore. + Count *int64 `min:"1" type:"integer"` + + // The amount of time to enable fast snapshot restore. The maximum is 100 years. + // This is equivalent to 1200 months, 5200 weeks, or 36500 days. + Interval *int64 `min:"1" type:"integer"` + + // The unit of time for enabling fast snapshot restore. + IntervalUnit *string `type:"string" enum:"RetentionIntervalUnitValues"` +} + +// String returns the string representation +func (s FastRestoreRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FastRestoreRule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *FastRestoreRule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "FastRestoreRule"} + if s.AvailabilityZones == nil { + invalidParams.Add(request.NewErrParamRequired("AvailabilityZones")) + } + if s.AvailabilityZones != nil && len(s.AvailabilityZones) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AvailabilityZones", 1)) + } + if s.Count != nil && *s.Count < 1 { + invalidParams.Add(request.NewErrParamMinValue("Count", 1)) + } + if s.Interval != nil && *s.Interval < 1 { + invalidParams.Add(request.NewErrParamMinValue("Interval", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *FastRestoreRule) SetAvailabilityZones(v []*string) *FastRestoreRule { + s.AvailabilityZones = v + return s +} + +// SetCount sets the Count field's value. +func (s *FastRestoreRule) SetCount(v int64) *FastRestoreRule { + s.Count = &v + return s +} + +// SetInterval sets the Interval field's value. +func (s *FastRestoreRule) SetInterval(v int64) *FastRestoreRule { + s.Interval = &v + return s +} + +// SetIntervalUnit sets the IntervalUnit field's value. +func (s *FastRestoreRule) SetIntervalUnit(v string) *FastRestoreRule { + s.IntervalUnit = &v + return s +} + type GetLifecyclePoliciesInput struct { _ struct{} `type:"structure"` @@ -843,15 +1324,137 @@ func (s GetLifecyclePolicyOutput) String() string { return awsutil.Prettify(s) } -// GoString returns the string representation -func (s GetLifecyclePolicyOutput) GoString() string { - return s.String() +// GoString returns the string representation +func (s GetLifecyclePolicyOutput) GoString() string { + return s.String() +} + +// SetPolicy sets the Policy field's value. +func (s *GetLifecyclePolicyOutput) SetPolicy(v *LifecyclePolicy) *GetLifecyclePolicyOutput { + s.Policy = v + return s +} + +// The service failed in an unexpected way. +type InternalServerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalServerException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerException) GoString() string { + return s.String() +} + +func newErrorInternalServerException(v protocol.ResponseMetadata) error { + return &InternalServerException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerException) Code() string { + return "InternalServerException" +} + +// Message returns the exception's message. +func (s InternalServerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerException) OrigErr() error { + return nil +} + +func (s InternalServerException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerException) RequestID() string { + return s.respMetadata.RequestID +} + +// Bad request. The request is missing required parameters or has invalid parameters. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Message_ *string `locationName:"Message" type:"string"` + + // The request included parameters that cannot be provided together. + MutuallyExclusiveParameters []*string `type:"list"` + + // The request omitted one or more required parameters. + RequiredParameters []*string `type:"list"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetPolicy sets the Policy field's value. -func (s *GetLifecyclePolicyOutput) SetPolicy(v *LifecyclePolicy) *GetLifecyclePolicyOutput { - s.Policy = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID } // Detailed information about a lifecycle policy. @@ -871,6 +1474,9 @@ type LifecyclePolicy struct { // specified by the lifecycle policy. ExecutionRoleArn *string `type:"string"` + // The Amazon Resource Name (ARN) of the policy. + PolicyArn *string `type:"string"` + // The configuration of the lifecycle policy PolicyDetails *PolicyDetails `type:"structure"` @@ -879,6 +1485,12 @@ type LifecyclePolicy struct { // The activation state of the lifecycle policy. State *string `type:"string" enum:"GettablePolicyStateValues"` + + // The description of the status. + StatusMessage *string `type:"string"` + + // The tags. + Tags map[string]*string `min:"1" type:"map"` } // String returns the string representation @@ -915,6 +1527,12 @@ func (s *LifecyclePolicy) SetExecutionRoleArn(v string) *LifecyclePolicy { return s } +// SetPolicyArn sets the PolicyArn field's value. +func (s *LifecyclePolicy) SetPolicyArn(v string) *LifecyclePolicy { + s.PolicyArn = &v + return s +} + // SetPolicyDetails sets the PolicyDetails field's value. func (s *LifecyclePolicy) SetPolicyDetails(v *PolicyDetails) *LifecyclePolicy { s.PolicyDetails = v @@ -933,6 +1551,18 @@ func (s *LifecyclePolicy) SetState(v string) *LifecyclePolicy { return s } +// SetStatusMessage sets the StatusMessage field's value. +func (s *LifecyclePolicy) SetStatusMessage(v string) *LifecyclePolicy { + s.StatusMessage = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *LifecyclePolicy) SetTags(v map[string]*string) *LifecyclePolicy { + s.Tags = v + return s +} + // Summary information about a lifecycle policy. type LifecyclePolicySummary struct { _ struct{} `type:"structure"` @@ -945,6 +1575,9 @@ type LifecyclePolicySummary struct { // The activation state of the lifecycle policy. State *string `type:"string" enum:"GettablePolicyStateValues"` + + // The tags. + Tags map[string]*string `min:"1" type:"map"` } // String returns the string representation @@ -975,14 +1608,145 @@ func (s *LifecyclePolicySummary) SetState(v string) *LifecyclePolicySummary { return s } -// Optional parameters that can be added to the policy. The set of valid parameters -// depends on the combination of policyType and resourceType values. +// SetTags sets the Tags field's value. +func (s *LifecyclePolicySummary) SetTags(v map[string]*string) *LifecyclePolicySummary { + s.Tags = v + return s +} + +// The request failed because a limit was exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Message_ *string `locationName:"Message" type:"string"` + + // Value is the type of resource for which a limit was exceeded. + ResourceType *string `type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + // + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resourceArn" 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 +} + +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // Information about the tags. + Tags map[string]*string `min:"1" type:"map"` +} + +// 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 map[string]*string) *ListTagsForResourceOutput { + s.Tags = v + return s +} + +// Specifies optional parameters to add to a policy. The set of valid parameters +// depends on the combination of policy type and resource type. type Parameters struct { _ struct{} `type:"structure"` - // When executing an EBS Snapshot Management – Instance policy, execute all - // CreateSnapshots calls with the excludeBootVolume set to the supplied field. - // Defaults to false. Only valid for EBS Snapshot Management – Instance policies. + // [EBS Snapshot Management – Instance policies only] Indicates whether to + // exclude the root volume from snapshots created using CreateSnapshots (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateSnapshots.html). + // The default is false. ExcludeBootVolume *bool `type:"boolean"` } @@ -1006,11 +1770,11 @@ func (s *Parameters) SetExcludeBootVolume(v bool) *Parameters { type PolicyDetails struct { _ struct{} `type:"structure"` - // A set of optional parameters that can be provided by the policy. + // A set of optional parameters for the policy. Parameters *Parameters `type:"structure"` - // This field determines the valid target resource types and actions a policy - // can manage. This field defaults to EBS_SNAPSHOT_MANAGEMENT if not present. + // The valid target resource types and actions a policy can manage. The default + // is EBS_SNAPSHOT_MANAGEMENT. PolicyType *string `type:"string" enum:"PolicyTypeValues"` // The resource type. @@ -1102,14 +1866,84 @@ func (s *PolicyDetails) SetTargetTags(v []*Tag) *PolicyDetails { return s } -// Specifies the number of snapshots to keep for each EBS volume. +// A requested resource was not found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Message_ *string `locationName:"Message" type:"string"` + + // Value is a list of resource IDs that were not found. + ResourceIds []*string `type:"list"` + + // Value is the type of resource that was not found. + ResourceType *string `type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Specifies the retention rule for a lifecycle policy. You can retain snapshots +// based on either a count or a time interval. type RetainRule struct { _ struct{} `type:"structure"` - // The number of snapshots to keep for each volume, up to a maximum of 1000. - // - // Count is a required field - Count *int64 `min:"1" type:"integer" required:"true"` + // The number of snapshots to retain for each volume, up to a maximum of 1000. + Count *int64 `min:"1" type:"integer"` + + // The amount of time to retain each snapshot. The maximum is 100 years. This + // is equivalent to 1200 months, 5200 weeks, or 36500 days. + Interval *int64 `min:"1" type:"integer"` + + // The unit of time for time-based retention. + IntervalUnit *string `type:"string" enum:"RetentionIntervalUnitValues"` } // String returns the string representation @@ -1125,12 +1959,12 @@ func (s RetainRule) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *RetainRule) Validate() error { invalidParams := request.ErrInvalidParams{Context: "RetainRule"} - if s.Count == nil { - invalidParams.Add(request.NewErrParamRequired("Count")) - } if s.Count != nil && *s.Count < 1 { invalidParams.Add(request.NewErrParamMinValue("Count", 1)) } + if s.Interval != nil && *s.Interval < 1 { + invalidParams.Add(request.NewErrParamMinValue("Interval", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -1144,7 +1978,19 @@ func (s *RetainRule) SetCount(v int64) *RetainRule { return s } -// Specifies a schedule. +// SetInterval sets the Interval field's value. +func (s *RetainRule) SetInterval(v int64) *RetainRule { + s.Interval = &v + return s +} + +// SetIntervalUnit sets the IntervalUnit field's value. +func (s *RetainRule) SetIntervalUnit(v string) *RetainRule { + s.IntervalUnit = &v + return s +} + +// Specifies a backup schedule. type Schedule struct { _ struct{} `type:"structure"` @@ -1152,13 +1998,19 @@ type Schedule struct { // created by this policy. CopyTags *bool `type:"boolean"` - // The create rule. + // The creation rule. CreateRule *CreateRule `type:"structure"` + // The rule for cross-Region snapshot copies. + CrossRegionCopyRules []*CrossRegionCopyRule `type:"list"` + + // The rule for enabling fast snapshot restore. + FastRestoreRule *FastRestoreRule `type:"structure"` + // The name of the schedule. Name *string `type:"string"` - // The retain rule. + // The retention rule. RetainRule *RetainRule `type:"structure"` // The tags to apply to policy-created resources. These user-defined tags are @@ -1190,6 +2042,21 @@ func (s *Schedule) Validate() error { invalidParams.AddNested("CreateRule", err.(request.ErrInvalidParams)) } } + if s.CrossRegionCopyRules != nil { + for i, v := range s.CrossRegionCopyRules { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CrossRegionCopyRules", i), err.(request.ErrInvalidParams)) + } + } + } + if s.FastRestoreRule != nil { + if err := s.FastRestoreRule.Validate(); err != nil { + invalidParams.AddNested("FastRestoreRule", err.(request.ErrInvalidParams)) + } + } if s.RetainRule != nil { if err := s.RetainRule.Validate(); err != nil { invalidParams.AddNested("RetainRule", err.(request.ErrInvalidParams)) @@ -1234,6 +2101,18 @@ func (s *Schedule) SetCreateRule(v *CreateRule) *Schedule { return s } +// SetCrossRegionCopyRules sets the CrossRegionCopyRules field's value. +func (s *Schedule) SetCrossRegionCopyRules(v []*CrossRegionCopyRule) *Schedule { + s.CrossRegionCopyRules = v + return s +} + +// SetFastRestoreRule sets the FastRestoreRule field's value. +func (s *Schedule) SetFastRestoreRule(v *FastRestoreRule) *Schedule { + s.FastRestoreRule = v + return s +} + // SetName sets the Name field's value. func (s *Schedule) SetName(v string) *Schedule { s.Name = &v @@ -1311,6 +2190,150 @@ func (s *Tag) SetValue(v string) *Tag { return s } +type TagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + // + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` + + // One or more tags. + // + // Tags is a required field + Tags map[string]*string `min:"1" type:"map" 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 && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + + 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 map[string]*string) *TagResourceInput { + s.Tags = v + return s +} + +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() +} + +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + // + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` + + // The tag keys. + // + // TagKeys is a required field + TagKeys []*string `location:"querystring" locationName:"tagKeys" min:"1" 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 s.TagKeys != nil && len(s.TagKeys) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TagKeys", 1)) + } + + 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 +} + +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() +} + type UpdateLifecyclePolicyInput struct { _ struct{} `type:"structure"` @@ -1321,9 +2344,8 @@ type UpdateLifecyclePolicyInput struct { // specified by the lifecycle policy. ExecutionRoleArn *string `type:"string"` - // The configuration of the lifecycle policy. - // - // Target tags cannot be re-used across policies. + // The configuration of the lifecycle policy. You cannot update the policy type + // or the resource type. PolicyDetails *PolicyDetails `type:"structure"` // The identifier of the lifecycle policy. @@ -1439,6 +2461,20 @@ const ( ResourceTypeValuesInstance = "INSTANCE" ) +const ( + // RetentionIntervalUnitValuesDays is a RetentionIntervalUnitValues enum value + RetentionIntervalUnitValuesDays = "DAYS" + + // RetentionIntervalUnitValuesWeeks is a RetentionIntervalUnitValues enum value + RetentionIntervalUnitValuesWeeks = "WEEKS" + + // RetentionIntervalUnitValuesMonths is a RetentionIntervalUnitValues enum value + RetentionIntervalUnitValuesMonths = "MONTHS" + + // RetentionIntervalUnitValuesYears is a RetentionIntervalUnitValues enum value + RetentionIntervalUnitValuesYears = "YEARS" +) + const ( // SettablePolicyStateValuesEnabled is a SettablePolicyStateValues enum value SettablePolicyStateValuesEnabled = "ENABLED" diff --git a/vendor/github.com/aws/aws-sdk-go/service/dlm/errors.go b/vendor/github.com/aws/aws-sdk-go/service/dlm/errors.go index f2f7e4b92bb..ea4d3e590df 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dlm/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dlm/errors.go @@ -2,6 +2,10 @@ package dlm +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInternalServerException for service response error code @@ -28,3 +32,10 @@ const ( // A requested resource was not found. ErrCodeResourceNotFoundException = "ResourceNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InternalServerException": newErrorInternalServerException, + "InvalidRequestException": newErrorInvalidRequestException, + "LimitExceededException": newErrorLimitExceededException, + "ResourceNotFoundException": newErrorResourceNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/dlm/service.go b/vendor/github.com/aws/aws-sdk-go/service/dlm/service.go index b062fe30d63..31c39ef3716 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dlm/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dlm/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "DLM" // Name of service. EndpointsID = "dlm" // ID to lookup a service endpoint with. - ServiceID = "DLM" // ServiceID is a unique identifer of a specific service. + ServiceID = "DLM" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the DLM client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a DLM client from just a session. // svc := dlm.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *DLM { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "dlm" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *DLM { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *DLM { svc := &DLM{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-01-12", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/docdb/api.go b/vendor/github.com/aws/aws-sdk-go/service/docdb/api.go index a6b0b62f23a..c95a1db72a9 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/docdb/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/docdb/api.go @@ -72,13 +72,13 @@ func (c *DocDB) AddTagsToResourceRequest(input *AddTagsToResourceInput) (req *re // // Returned Error Codes: // * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier doesn't refer to an existing DB instance. +// DBInstanceIdentifier doesn't refer to an existing instance. // // * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" -// DBSnapshotIdentifier doesn't refer to an existing DB snapshot. +// DBSnapshotIdentifier doesn't refer to an existing snapshot. // // * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier doesn't refer to an existing DB cluster. +// DBClusterIdentifier doesn't refer to an existing cluster. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/AddTagsToResource func (c *DocDB) AddTagsToResource(input *AddTagsToResourceInput) (*AddTagsToResourceOutput, error) { @@ -161,10 +161,10 @@ func (c *DocDB) ApplyPendingMaintenanceActionRequest(input *ApplyPendingMaintena // The specified resource ID was not found. // // * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster isn't in a valid state. +// The cluster isn't in a valid state. // // * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance isn't in the available state. +// The specified instance isn't in the available state. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/ApplyPendingMaintenanceAction func (c *DocDB) ApplyPendingMaintenanceAction(input *ApplyPendingMaintenanceActionInput) (*ApplyPendingMaintenanceActionOutput, error) { @@ -232,7 +232,7 @@ func (c *DocDB) CopyDBClusterParameterGroupRequest(input *CopyDBClusterParameter // CopyDBClusterParameterGroup API operation for Amazon DocumentDB with MongoDB compatibility. // -// Copies the specified DB cluster parameter group. +// Copies the specified 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 @@ -243,14 +243,13 @@ func (c *DocDB) CopyDBClusterParameterGroupRequest(input *CopyDBClusterParameter // // Returned Error Codes: // * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName doesn't refer to an existing DB parameter group. +// DBParameterGroupName doesn't refer to an existing parameter group. // // * ErrCodeDBParameterGroupQuotaExceededFault "DBParameterGroupQuotaExceeded" -// This request would cause you to exceed the allowed number of DB parameter -// groups. +// This request would cause you to exceed the allowed number of parameter groups. // // * ErrCodeDBParameterGroupAlreadyExistsFault "DBParameterGroupAlreadyExists" -// A DB parameter group with the same name already exists. +// A parameter group with the same name already exists. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/CopyDBClusterParameterGroup func (c *DocDB) CopyDBClusterParameterGroup(input *CopyDBClusterParameterGroupInput) (*CopyDBClusterParameterGroupOutput, error) { @@ -318,14 +317,14 @@ func (c *DocDB) CopyDBClusterSnapshotRequest(input *CopyDBClusterSnapshotInput) // CopyDBClusterSnapshot API operation for Amazon DocumentDB with MongoDB compatibility. // -// Copies a snapshot of a DB cluster. +// Copies a snapshot of a 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. +// To copy a cluster snapshot from a shared manual cluster snapshot, SourceDBClusterSnapshotIdentifier +// must be the Amazon Resource Name (ARN) of the shared cluster snapshot. // -// To cancel the copy operation after it is in progress, delete the target DB -// cluster snapshot identified by TargetDBClusterSnapshotIdentifier while that -// DB cluster snapshot is in the copying status. +// To cancel the copy operation after it is in progress, delete the target cluster +// snapshot identified by TargetDBClusterSnapshotIdentifier while that DB cluster +// snapshot is in the copying 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 @@ -336,19 +335,19 @@ func (c *DocDB) CopyDBClusterSnapshotRequest(input *CopyDBClusterSnapshotInput) // // Returned Error Codes: // * ErrCodeDBClusterSnapshotAlreadyExistsFault "DBClusterSnapshotAlreadyExistsFault" -// You already have a DB cluster snapshot with the given identifier. +// You already have a cluster snapshot with the given identifier. // // * ErrCodeDBClusterSnapshotNotFoundFault "DBClusterSnapshotNotFoundFault" -// DBClusterSnapshotIdentifier doesn't refer to an existing DB cluster snapshot. +// DBClusterSnapshotIdentifier doesn't refer to an existing cluster snapshot. // // * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster isn't in a valid state. +// The cluster isn't in a valid state. // // * ErrCodeInvalidDBClusterSnapshotStateFault "InvalidDBClusterSnapshotStateFault" -// The provided value isn't a valid DB cluster snapshot state. +// The provided value isn't a valid cluster snapshot state. // // * ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceeded" -// The request would cause you to exceed the allowed number of DB snapshots. +// The request would cause you to exceed the allowed number of snapshots. // // * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" // An error occurred when accessing an AWS KMS key. @@ -419,7 +418,7 @@ func (c *DocDB) CreateDBClusterRequest(input *CreateDBClusterInput) (req *reques // CreateDBCluster API operation for Amazon DocumentDB with MongoDB compatibility. // -// Creates a new Amazon DocumentDB DB cluster. +// Creates a new Amazon DocumentDB 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 @@ -430,7 +429,7 @@ func (c *DocDB) CreateDBClusterRequest(input *CreateDBClusterInput) (req *reques // // Returned Error Codes: // * ErrCodeDBClusterAlreadyExistsFault "DBClusterAlreadyExistsFault" -// You already have a DB cluster with the given identifier. +// You already have a cluster with the given identifier. // // * ErrCodeInsufficientStorageClusterCapacityFault "InsufficientStorageClusterCapacity" // There is not enough storage available for the current action. You might be @@ -438,48 +437,48 @@ func (c *DocDB) CreateDBClusterRequest(input *CreateDBClusterInput) (req *reques // Availability Zones that have more storage available. // // * ErrCodeDBClusterQuotaExceededFault "DBClusterQuotaExceededFault" -// The DB cluster can't be created because you have reached the maximum allowed -// quota of DB clusters. +// The cluster can't be created because you have reached the maximum allowed +// quota of clusters. // // * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" // The request would cause you to exceed the allowed amount of storage available -// across all DB instances. +// across all instances. // // * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName doesn't refer to an existing DB subnet group. +// DBSubnetGroupName doesn't refer to an existing subnet group. // // * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// The DB subnet group doesn't cover all Availability Zones after it is created +// The subnet group doesn't cover all Availability Zones after it is created // because of changes that were made. // // * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster isn't in a valid state. +// The cluster isn't in a valid state. // // * ErrCodeInvalidDBSubnetGroupStateFault "InvalidDBSubnetGroupStateFault" -// The DB subnet group can't be deleted because it's in use. +// The subnet group can't be deleted because it's in use. // // * ErrCodeInvalidSubnet "InvalidSubnet" // The requested subnet is not valid, or multiple subnets were requested that // are not all in a common virtual private cloud (VPC). // // * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance isn't in the available state. +// The specified instance isn't in the available state. // // * ErrCodeDBClusterParameterGroupNotFoundFault "DBClusterParameterGroupNotFound" -// DBClusterParameterGroupName doesn't refer to an existing DB cluster parameter +// DBClusterParameterGroupName doesn't refer to an existing cluster parameter // group. // // * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" // An error occurred when accessing an AWS KMS key. // // * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier doesn't refer to an existing DB cluster. +// DBClusterIdentifier doesn't refer to an existing cluster. // // * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier doesn't refer to an existing DB instance. +// DBInstanceIdentifier doesn't refer to an existing instance. // // * ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs "DBSubnetGroupDoesNotCoverEnoughAZs" -// Subnets in the DB subnet group should cover at least two Availability Zones +// Subnets in the subnet group should cover at least two Availability Zones // unless there is only one Availability Zone. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/CreateDBCluster @@ -548,27 +547,27 @@ func (c *DocDB) CreateDBClusterParameterGroupRequest(input *CreateDBClusterParam // CreateDBClusterParameterGroup API operation for Amazon DocumentDB with MongoDB compatibility. // -// Creates a new DB cluster parameter group. +// Creates a new cluster parameter group. // -// Parameters in a DB cluster parameter group apply to all of the instances -// in a DB cluster. +// Parameters in a 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 +// A cluster parameter group is initially created with the default parameters +// for the database engine used by instances in the cluster. To provide custom // values for any of the parameters, you must modify the group after you create // it. After you create a DB cluster parameter group, you must associate it -// with your DB cluster. For the new DB cluster parameter group and associated -// settings to take effect, you must then reboot the DB instances in the DB -// cluster without failover. -// -// 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 DocumentDB to fully -// complete the create action before the DB cluster parameter group is used -// as the default for a new DB cluster. This step 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. +// with your cluster. For the new DB cluster parameter group and associated +// settings to take effect, you must then reboot the instances in the cluster +// without failover. +// +// After you create a cluster parameter group, you should wait at least 5 minutes +// before creating your first cluster that uses that cluster parameter group +// as the default parameter group. This allows Amazon DocumentDB to fully complete +// the create action before the cluster parameter group is used as the default +// for a new cluster. This step is especially important for parameters that +// are critical when creating the default database for a cluster, such as the +// character set for the default database defined by the character_set_database +// 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 @@ -579,11 +578,10 @@ func (c *DocDB) CreateDBClusterParameterGroupRequest(input *CreateDBClusterParam // // Returned Error Codes: // * ErrCodeDBParameterGroupQuotaExceededFault "DBParameterGroupQuotaExceeded" -// This request would cause you to exceed the allowed number of DB parameter -// groups. +// This request would cause you to exceed the allowed number of parameter groups. // // * ErrCodeDBParameterGroupAlreadyExistsFault "DBParameterGroupAlreadyExists" -// A DB parameter group with the same name already exists. +// A parameter group with the same name already exists. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/CreateDBClusterParameterGroup func (c *DocDB) CreateDBClusterParameterGroup(input *CreateDBClusterParameterGroupInput) (*CreateDBClusterParameterGroupOutput, error) { @@ -651,7 +649,7 @@ func (c *DocDB) CreateDBClusterSnapshotRequest(input *CreateDBClusterSnapshotInp // CreateDBClusterSnapshot API operation for Amazon DocumentDB with MongoDB compatibility. // -// Creates a snapshot of a DB cluster. +// Creates a snapshot of 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 @@ -662,19 +660,19 @@ func (c *DocDB) CreateDBClusterSnapshotRequest(input *CreateDBClusterSnapshotInp // // Returned Error Codes: // * ErrCodeDBClusterSnapshotAlreadyExistsFault "DBClusterSnapshotAlreadyExistsFault" -// You already have a DB cluster snapshot with the given identifier. +// You already have a cluster snapshot with the given identifier. // // * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster isn't in a valid state. +// The cluster isn't in a valid state. // // * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier doesn't refer to an existing DB cluster. +// DBClusterIdentifier doesn't refer to an existing cluster. // // * ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceeded" -// The request would cause you to exceed the allowed number of DB snapshots. +// The request would cause you to exceed the allowed number of snapshots. // // * ErrCodeInvalidDBClusterSnapshotStateFault "InvalidDBClusterSnapshotStateFault" -// The provided value isn't a valid DB cluster snapshot state. +// The provided value isn't a valid cluster snapshot state. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/CreateDBClusterSnapshot func (c *DocDB) CreateDBClusterSnapshot(input *CreateDBClusterSnapshotInput) (*CreateDBClusterSnapshotOutput, error) { @@ -742,7 +740,7 @@ func (c *DocDB) CreateDBInstanceRequest(input *CreateDBInstanceInput) (req *requ // CreateDBInstance API operation for Amazon DocumentDB with MongoDB compatibility. // -// Creates a new DB instance. +// Creates a new 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 @@ -753,52 +751,52 @@ func (c *DocDB) CreateDBInstanceRequest(input *CreateDBInstanceInput) (req *requ // // Returned Error Codes: // * ErrCodeDBInstanceAlreadyExistsFault "DBInstanceAlreadyExists" -// You already have a DB instance with the given identifier. +// You already have a instance with the given identifier. // // * ErrCodeInsufficientDBInstanceCapacityFault "InsufficientDBInstanceCapacity" -// The specified DB instance class isn't available in the specified Availability +// The specified instance class isn't available in the specified Availability // Zone. // // * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName doesn't refer to an existing DB parameter group. +// DBParameterGroupName doesn't refer to an existing parameter group. // // * ErrCodeDBSecurityGroupNotFoundFault "DBSecurityGroupNotFound" -// DBSecurityGroupName doesn't refer to an existing DB security group. +// DBSecurityGroupName doesn't refer to an existing security group. // // * ErrCodeInstanceQuotaExceededFault "InstanceQuotaExceeded" -// The request would cause you to exceed the allowed number of DB instances. +// The request would cause you to exceed the allowed number of instances. // // * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" // The request would cause you to exceed the allowed amount of storage available -// across all DB instances. +// across all instances. // // * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName doesn't refer to an existing DB subnet group. +// DBSubnetGroupName doesn't refer to an existing subnet group. // // * ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs "DBSubnetGroupDoesNotCoverEnoughAZs" -// Subnets in the DB subnet group should cover at least two Availability Zones +// Subnets in the subnet group should cover at least two Availability Zones // unless there is only one Availability Zone. // // * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster isn't in a valid state. +// The cluster isn't in a valid state. // // * ErrCodeInvalidSubnet "InvalidSubnet" // The requested subnet is not valid, or multiple subnets were requested that // are not all in a common virtual private cloud (VPC). // // * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// The DB subnet group doesn't cover all Availability Zones after it is created +// The subnet group doesn't cover all Availability Zones after it is created // because of changes that were made. // // * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier doesn't refer to an existing DB cluster. +// DBClusterIdentifier doesn't refer to an existing cluster. // // * ErrCodeStorageTypeNotSupportedFault "StorageTypeNotSupported" // Storage of the specified StorageType can't be associated with the DB instance. // // * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" // The specified CIDR IP or Amazon EC2 security group isn't authorized for the -// specified DB security group. +// specified security group. // // Amazon DocumentDB also might not be authorized to perform necessary actions // on your behalf using IAM. @@ -872,8 +870,8 @@ func (c *DocDB) CreateDBSubnetGroupRequest(input *CreateDBSubnetGroupInput) (req // CreateDBSubnetGroup API operation for Amazon DocumentDB with MongoDB compatibility. // -// Creates a new DB subnet group. DB subnet groups must contain at least one -// subnet in at least two Availability Zones in the AWS Region. +// Creates a new subnet group. subnet groups must contain at least one subnet +// in at least two Availability Zones in the 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 @@ -884,17 +882,17 @@ func (c *DocDB) CreateDBSubnetGroupRequest(input *CreateDBSubnetGroupInput) (req // // Returned Error Codes: // * ErrCodeDBSubnetGroupAlreadyExistsFault "DBSubnetGroupAlreadyExists" -// DBSubnetGroupName is already being used by an existing DB subnet group. +// DBSubnetGroupName is already being used by an existing subnet group. // // * ErrCodeDBSubnetGroupQuotaExceededFault "DBSubnetGroupQuotaExceeded" -// The request would cause you to exceed the allowed number of DB subnet groups. +// The request would cause you to exceed the allowed number of subnet groups. // // * ErrCodeDBSubnetQuotaExceededFault "DBSubnetQuotaExceededFault" // The request would cause you to exceed the allowed number of subnets in a -// DB subnet group. +// subnet group. // // * ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs "DBSubnetGroupDoesNotCoverEnoughAZs" -// Subnets in the DB subnet group should cover at least two Availability Zones +// Subnets in the subnet group should cover at least two Availability Zones // unless there is only one Availability Zone. // // * ErrCodeInvalidSubnet "InvalidSubnet" @@ -967,9 +965,9 @@ func (c *DocDB) DeleteDBClusterRequest(input *DeleteDBClusterInput) (req *reques // DeleteDBCluster API operation for Amazon DocumentDB with MongoDB compatibility. // -// Deletes a previously provisioned DB cluster. When you delete a DB cluster, -// all automated backups for that DB cluster are deleted and can't be recovered. -// Manual DB cluster snapshots of the specified DB cluster are not deleted. +// Deletes a previously provisioned cluster. When you delete a cluster, all +// automated backups for that cluster are deleted and can't be recovered. Manual +// DB cluster snapshots of the specified cluster are 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 @@ -980,19 +978,19 @@ func (c *DocDB) DeleteDBClusterRequest(input *DeleteDBClusterInput) (req *reques // // Returned Error Codes: // * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier doesn't refer to an existing DB cluster. +// DBClusterIdentifier doesn't refer to an existing cluster. // // * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster isn't in a valid state. +// The cluster isn't in a valid state. // // * ErrCodeDBClusterSnapshotAlreadyExistsFault "DBClusterSnapshotAlreadyExistsFault" -// You already have a DB cluster snapshot with the given identifier. +// You already have a cluster snapshot with the given identifier. // // * ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceeded" -// The request would cause you to exceed the allowed number of DB snapshots. +// The request would cause you to exceed the allowed number of snapshots. // // * ErrCodeInvalidDBClusterSnapshotStateFault "InvalidDBClusterSnapshotStateFault" -// The provided value isn't a valid DB cluster snapshot state. +// The provided value isn't a valid cluster snapshot state. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/DeleteDBCluster func (c *DocDB) DeleteDBCluster(input *DeleteDBClusterInput) (*DeleteDBClusterOutput, error) { @@ -1061,8 +1059,8 @@ func (c *DocDB) DeleteDBClusterParameterGroupRequest(input *DeleteDBClusterParam // DeleteDBClusterParameterGroup API operation for Amazon DocumentDB with MongoDB compatibility. // -// Deletes a specified DB cluster parameter group. The DB cluster parameter -// group to be deleted can't be associated with any DB clusters. +// Deletes a specified cluster parameter group. The cluster parameter group +// to be deleted can't be associated with any 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 @@ -1073,12 +1071,12 @@ func (c *DocDB) DeleteDBClusterParameterGroupRequest(input *DeleteDBClusterParam // // Returned Error Codes: // * ErrCodeInvalidDBParameterGroupStateFault "InvalidDBParameterGroupState" -// The DB parameter group is in use, or it is in a state that is not valid. -// If you are trying to delete the parameter group, you can't delete it when -// the parameter group is in this state. +// The parameter group is in use, or it is in a state that is not valid. If +// you are trying to delete the parameter group, you can't delete it when the +// parameter group is in this state. // // * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName doesn't refer to an existing DB parameter group. +// DBParameterGroupName doesn't refer to an existing parameter group. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/DeleteDBClusterParameterGroup func (c *DocDB) DeleteDBClusterParameterGroup(input *DeleteDBClusterParameterGroupInput) (*DeleteDBClusterParameterGroupOutput, error) { @@ -1146,10 +1144,10 @@ func (c *DocDB) DeleteDBClusterSnapshotRequest(input *DeleteDBClusterSnapshotInp // DeleteDBClusterSnapshot API operation for Amazon DocumentDB with MongoDB compatibility. // -// Deletes a DB cluster snapshot. If the snapshot is being copied, the copy -// operation is terminated. +// Deletes a 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. +// The cluster snapshot 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 @@ -1160,10 +1158,10 @@ func (c *DocDB) DeleteDBClusterSnapshotRequest(input *DeleteDBClusterSnapshotInp // // Returned Error Codes: // * ErrCodeInvalidDBClusterSnapshotStateFault "InvalidDBClusterSnapshotStateFault" -// The provided value isn't a valid DB cluster snapshot state. +// The provided value isn't a valid cluster snapshot state. // // * ErrCodeDBClusterSnapshotNotFoundFault "DBClusterSnapshotNotFoundFault" -// DBClusterSnapshotIdentifier doesn't refer to an existing DB cluster snapshot. +// DBClusterSnapshotIdentifier doesn't refer to an existing cluster snapshot. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/DeleteDBClusterSnapshot func (c *DocDB) DeleteDBClusterSnapshot(input *DeleteDBClusterSnapshotInput) (*DeleteDBClusterSnapshotOutput, error) { @@ -1231,7 +1229,7 @@ func (c *DocDB) DeleteDBInstanceRequest(input *DeleteDBInstanceInput) (req *requ // DeleteDBInstance API operation for Amazon DocumentDB with MongoDB compatibility. // -// Deletes a previously provisioned DB instance. +// Deletes a previously provisioned 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 @@ -1242,19 +1240,19 @@ func (c *DocDB) DeleteDBInstanceRequest(input *DeleteDBInstanceInput) (req *requ // // Returned Error Codes: // * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier doesn't refer to an existing DB instance. +// DBInstanceIdentifier doesn't refer to an existing instance. // // * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance isn't in the available state. +// The specified instance isn't in the available state. // // * ErrCodeDBSnapshotAlreadyExistsFault "DBSnapshotAlreadyExists" // DBSnapshotIdentifier is already being used by an existing snapshot. // // * ErrCodeSnapshotQuotaExceededFault "SnapshotQuotaExceeded" -// The request would cause you to exceed the allowed number of DB snapshots. +// The request would cause you to exceed the allowed number of snapshots. // // * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster isn't in a valid state. +// The cluster isn't in a valid state. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/DeleteDBInstance func (c *DocDB) DeleteDBInstance(input *DeleteDBInstanceInput) (*DeleteDBInstanceOutput, error) { @@ -1323,7 +1321,7 @@ func (c *DocDB) DeleteDBSubnetGroupRequest(input *DeleteDBSubnetGroupInput) (req // DeleteDBSubnetGroup API operation for Amazon DocumentDB with MongoDB compatibility. // -// Deletes a DB subnet group. +// Deletes a subnet group. // // The specified database subnet group must not be associated with any DB instances. // @@ -1336,13 +1334,13 @@ func (c *DocDB) DeleteDBSubnetGroupRequest(input *DeleteDBSubnetGroupInput) (req // // Returned Error Codes: // * ErrCodeInvalidDBSubnetGroupStateFault "InvalidDBSubnetGroupStateFault" -// The DB subnet group can't be deleted because it's in use. +// The subnet group can't be deleted because it's in use. // // * ErrCodeInvalidDBSubnetStateFault "InvalidDBSubnetStateFault" -// The DB subnet isn't in the available state. +// The subnet isn't in the available state. // // * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName doesn't refer to an existing DB subnet group. +// DBSubnetGroupName doesn't refer to an existing subnet group. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/DeleteDBSubnetGroup func (c *DocDB) DeleteDBSubnetGroup(input *DeleteDBSubnetGroupInput) (*DeleteDBSubnetGroupOutput, error) { @@ -1411,7 +1409,7 @@ func (c *DocDB) DescribeCertificatesRequest(input *DescribeCertificatesInput) (r // DescribeCertificates API operation for Amazon DocumentDB with MongoDB compatibility. // // Returns a list of certificate authority (CA) certificates provided by Amazon -// RDS for this AWS account. +// DocumentDB 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 @@ -1492,7 +1490,7 @@ func (c *DocDB) DescribeDBClusterParameterGroupsRequest(input *DescribeDBCluster // // Returns a list of DBClusterParameterGroup descriptions. If a DBClusterParameterGroupName // parameter is specified, the list contains only the description of the specified -// DB cluster parameter group. +// 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 @@ -1503,7 +1501,7 @@ func (c *DocDB) DescribeDBClusterParameterGroupsRequest(input *DescribeDBCluster // // Returned Error Codes: // * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName doesn't refer to an existing DB parameter group. +// DBParameterGroupName doesn't refer to an existing parameter group. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/DescribeDBClusterParameterGroups func (c *DocDB) DescribeDBClusterParameterGroups(input *DescribeDBClusterParameterGroupsInput) (*DescribeDBClusterParameterGroupsOutput, error) { @@ -1571,8 +1569,7 @@ func (c *DocDB) DescribeDBClusterParametersRequest(input *DescribeDBClusterParam // DescribeDBClusterParameters API operation for Amazon DocumentDB with MongoDB compatibility. // -// Returns the detailed parameter list for a particular DB cluster parameter -// group. +// Returns the detailed parameter list for a particular 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 @@ -1583,7 +1580,7 @@ func (c *DocDB) DescribeDBClusterParametersRequest(input *DescribeDBClusterParam // // Returned Error Codes: // * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName doesn't refer to an existing DB parameter group. +// DBParameterGroupName doesn't refer to an existing parameter group. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/DescribeDBClusterParameters func (c *DocDB) DescribeDBClusterParameters(input *DescribeDBClusterParametersInput) (*DescribeDBClusterParametersOutput, error) { @@ -1651,14 +1648,14 @@ func (c *DocDB) DescribeDBClusterSnapshotAttributesRequest(input *DescribeDBClus // DescribeDBClusterSnapshotAttributes API operation for Amazon DocumentDB with MongoDB compatibility. // -// Returns a list of DB cluster snapshot attribute names and values for a manual +// Returns a list of cluster snapshot attribute names and values for a manual // DB cluster snapshot. // // When you share 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. +// are authorized to copy or restore the manual cluster snapshot. If all is +// included in the list of values for the restore attribute, then the manual +// cluster snapshot is public and can be copied or restored by all AWS 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 @@ -1669,7 +1666,7 @@ func (c *DocDB) DescribeDBClusterSnapshotAttributesRequest(input *DescribeDBClus // // Returned Error Codes: // * ErrCodeDBClusterSnapshotNotFoundFault "DBClusterSnapshotNotFoundFault" -// DBClusterSnapshotIdentifier doesn't refer to an existing DB cluster snapshot. +// DBClusterSnapshotIdentifier doesn't refer to an existing cluster snapshot. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/DescribeDBClusterSnapshotAttributes func (c *DocDB) DescribeDBClusterSnapshotAttributes(input *DescribeDBClusterSnapshotAttributesInput) (*DescribeDBClusterSnapshotAttributesOutput, error) { @@ -1737,7 +1734,7 @@ func (c *DocDB) DescribeDBClusterSnapshotsRequest(input *DescribeDBClusterSnapsh // DescribeDBClusterSnapshots API operation for Amazon DocumentDB with MongoDB compatibility. // -// Returns information about DB cluster snapshots. This API operation supports +// Returns information about cluster snapshots. This API operation supports // pagination. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1749,7 +1746,7 @@ func (c *DocDB) DescribeDBClusterSnapshotsRequest(input *DescribeDBClusterSnapsh // // Returned Error Codes: // * ErrCodeDBClusterSnapshotNotFoundFault "DBClusterSnapshotNotFoundFault" -// DBClusterSnapshotIdentifier doesn't refer to an existing DB cluster snapshot. +// DBClusterSnapshotIdentifier doesn't refer to an existing cluster snapshot. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/DescribeDBClusterSnapshots func (c *DocDB) DescribeDBClusterSnapshots(input *DescribeDBClusterSnapshotsInput) (*DescribeDBClusterSnapshotsOutput, error) { @@ -1823,8 +1820,11 @@ func (c *DocDB) DescribeDBClustersRequest(input *DescribeDBClustersInput) (req * // DescribeDBClusters API operation for Amazon DocumentDB with MongoDB compatibility. // -// Returns information about provisioned Amazon DocumentDB DB clusters. This -// API operation supports pagination. +// Returns information about provisioned Amazon DocumentDB clusters. This API +// operation supports pagination. For certain management features such as cluster +// and instance lifecycle management, Amazon DocumentDB leverages operational +// technology that is shared with Amazon RDS and Amazon Neptune. Use the filterName=engine,Values=docdb +// filter parameter to return only Amazon DocumentDB 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 @@ -1835,7 +1835,7 @@ func (c *DocDB) DescribeDBClustersRequest(input *DescribeDBClustersInput) (req * // // Returned Error Codes: // * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier doesn't refer to an existing DB cluster. +// DBClusterIdentifier doesn't refer to an existing cluster. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/DescribeDBClusters func (c *DocDB) DescribeDBClusters(input *DescribeDBClustersInput) (*DescribeDBClustersOutput, error) { @@ -1902,10 +1902,12 @@ func (c *DocDB) DescribeDBClustersPagesWithContext(ctx aws.Context, input *Descr }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBClustersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBClustersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1959,7 +1961,7 @@ func (c *DocDB) DescribeDBEngineVersionsRequest(input *DescribeDBEngineVersionsI // DescribeDBEngineVersions API operation for Amazon DocumentDB with MongoDB compatibility. // -// Returns a list of the available DB engines. +// Returns a list of the available 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 @@ -2032,10 +2034,12 @@ func (c *DocDB) DescribeDBEngineVersionsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBEngineVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBEngineVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2101,7 +2105,7 @@ func (c *DocDB) DescribeDBInstancesRequest(input *DescribeDBInstancesInput) (req // // Returned Error Codes: // * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier doesn't refer to an existing DB instance. +// DBInstanceIdentifier doesn't refer to an existing instance. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/DescribeDBInstances func (c *DocDB) DescribeDBInstances(input *DescribeDBInstancesInput) (*DescribeDBInstancesOutput, error) { @@ -2168,10 +2172,12 @@ func (c *DocDB) DescribeDBInstancesPagesWithContext(ctx aws.Context, input *Desc }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBInstancesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBInstancesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2237,7 +2243,7 @@ func (c *DocDB) DescribeDBSubnetGroupsRequest(input *DescribeDBSubnetGroupsInput // // Returned Error Codes: // * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName doesn't refer to an existing DB subnet group. +// DBSubnetGroupName doesn't refer to an existing subnet group. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/DescribeDBSubnetGroups func (c *DocDB) DescribeDBSubnetGroups(input *DescribeDBSubnetGroupsInput) (*DescribeDBSubnetGroupsOutput, error) { @@ -2304,10 +2310,12 @@ func (c *DocDB) DescribeDBSubnetGroupsPagesWithContext(ctx aws.Context, input *D }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBSubnetGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBSubnetGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2511,11 +2519,10 @@ func (c *DocDB) DescribeEventsRequest(input *DescribeEventsInput) (req *request. // DescribeEvents API operation for Amazon DocumentDB with MongoDB compatibility. // -// Returns events related to DB instances, DB security groups, DB snapshots, -// and DB parameter groups for the past 14 days. You can obtain events specific -// to a particular DB instance, DB security group, DB snapshot, or DB parameter -// group by providing the name as a parameter. By default, the events of the -// past hour are returned. +// Returns events related to instances, security groups, snapshots, and DB parameter +// groups for the past 14 days. You can obtain events specific to a particular +// DB instance, security group, snapshot, or parameter group by providing the +// name as a parameter. By default, the events of the past hour 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 @@ -2588,10 +2595,12 @@ func (c *DocDB) DescribeEventsPagesWithContext(ctx aws.Context, input *DescribeE }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2645,7 +2654,7 @@ func (c *DocDB) DescribeOrderableDBInstanceOptionsRequest(input *DescribeOrderab // DescribeOrderableDBInstanceOptions API operation for Amazon DocumentDB with MongoDB compatibility. // -// Returns a list of orderable DB instance options for the specified engine. +// Returns a list of orderable 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 @@ -2718,10 +2727,12 @@ func (c *DocDB) DescribeOrderableDBInstanceOptionsPagesWithContext(ctx aws.Conte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeOrderableDBInstanceOptionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeOrderableDBInstanceOptionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2769,8 +2780,8 @@ func (c *DocDB) DescribePendingMaintenanceActionsRequest(input *DescribePendingM // DescribePendingMaintenanceActions API operation for Amazon DocumentDB with MongoDB compatibility. // -// Returns a list of resources (for example, DB instances) that have at least -// one pending maintenance action. +// Returns a list of resources (for example, 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 @@ -2849,11 +2860,10 @@ func (c *DocDB) FailoverDBClusterRequest(input *FailoverDBClusterInput) (req *re // FailoverDBCluster API operation for Amazon DocumentDB with MongoDB compatibility. // -// Forces a failover for a DB cluster. +// Forces a failover for a cluster. // -// A failover for a DB cluster promotes one of the Amazon DocumentDB replicas -// (read-only instances) in the DB cluster to be the primary instance (the cluster -// writer). +// A failover for a cluster promotes one of the Amazon DocumentDB replicas (read-only +// instances) in the cluster to be the primary instance (the cluster writer). // // If the primary instance fails, Amazon DocumentDB automatically fails over // to an Amazon DocumentDB replica, if one exists. You can force a failover @@ -2868,13 +2878,13 @@ func (c *DocDB) FailoverDBClusterRequest(input *FailoverDBClusterInput) (req *re // // Returned Error Codes: // * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier doesn't refer to an existing DB cluster. +// DBClusterIdentifier doesn't refer to an existing cluster. // // * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster isn't in a valid state. +// The cluster isn't in a valid state. // // * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance isn't in the available state. +// The specified instance isn't in the available state. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/FailoverDBCluster func (c *DocDB) FailoverDBCluster(input *FailoverDBClusterInput) (*FailoverDBClusterOutput, error) { @@ -2953,13 +2963,13 @@ func (c *DocDB) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req // // Returned Error Codes: // * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier doesn't refer to an existing DB instance. +// DBInstanceIdentifier doesn't refer to an existing instance. // // * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" -// DBSnapshotIdentifier doesn't refer to an existing DB snapshot. +// DBSnapshotIdentifier doesn't refer to an existing snapshot. // // * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier doesn't refer to an existing DB cluster. +// DBClusterIdentifier doesn't refer to an existing cluster. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/ListTagsForResource func (c *DocDB) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { @@ -3027,9 +3037,9 @@ func (c *DocDB) ModifyDBClusterRequest(input *ModifyDBClusterInput) (req *reques // ModifyDBCluster API operation for Amazon DocumentDB with MongoDB compatibility. // -// Modifies a setting for an Amazon DocumentDB DB cluster. You can change one -// or more database configuration parameters by specifying these parameters -// and the new values in the request. +// Modifies a setting for an Amazon DocumentDB cluster. 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 @@ -3040,41 +3050,41 @@ func (c *DocDB) ModifyDBClusterRequest(input *ModifyDBClusterInput) (req *reques // // Returned Error Codes: // * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier doesn't refer to an existing DB cluster. +// DBClusterIdentifier doesn't refer to an existing cluster. // // * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster isn't in a valid state. +// The cluster isn't in a valid state. // // * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" // The request would cause you to exceed the allowed amount of storage available -// across all DB instances. +// across all instances. // // * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName doesn't refer to an existing DB subnet group. +// DBSubnetGroupName doesn't refer to an existing subnet group. // // * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// The DB subnet group doesn't cover all Availability Zones after it is created +// The subnet group doesn't cover all Availability Zones after it is created // because of changes that were made. // // * ErrCodeInvalidDBSubnetGroupStateFault "InvalidDBSubnetGroupStateFault" -// The DB subnet group can't be deleted because it's in use. +// The subnet group can't be deleted because it's in use. // // * ErrCodeInvalidSubnet "InvalidSubnet" // The requested subnet is not valid, or multiple subnets were requested that // are not all in a common virtual private cloud (VPC). // // * ErrCodeDBClusterParameterGroupNotFoundFault "DBClusterParameterGroupNotFound" -// DBClusterParameterGroupName doesn't refer to an existing DB cluster parameter +// DBClusterParameterGroupName doesn't refer to an existing cluster parameter // group. // // * ErrCodeInvalidDBSecurityGroupStateFault "InvalidDBSecurityGroupState" -// The state of the DB security group doesn't allow deletion. +// The state of the security group doesn't allow deletion. // // * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance isn't in the available state. +// The specified instance isn't in the available state. // // * ErrCodeDBClusterAlreadyExistsFault "DBClusterAlreadyExistsFault" -// You already have a DB cluster with the given identifier. +// You already have a cluster with the given identifier. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/ModifyDBCluster func (c *DocDB) ModifyDBCluster(input *ModifyDBClusterInput) (*ModifyDBClusterOutput, error) { @@ -3142,7 +3152,7 @@ func (c *DocDB) ModifyDBClusterParameterGroupRequest(input *ModifyDBClusterParam // ModifyDBClusterParameterGroup API operation for Amazon DocumentDB with MongoDB compatibility. // -// Modifies the parameters of a DB cluster parameter group. To modify more than +// Modifies the parameters of a 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. // @@ -3150,14 +3160,13 @@ func (c *DocDB) ModifyDBClusterParameterGroupRequest(input *ModifyDBClusterParam // parameters require a reboot or maintenance window 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 DocumentDB to fully -// complete the create action before the parameter group is used as the default -// for a new DB cluster. This step 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. +// After you create a cluster parameter group, you should wait at least 5 minutes +// before creating your first cluster that uses that cluster parameter group +// as the default parameter group. This allows Amazon DocumentDB to fully complete +// the create action before the parameter group is used as the default for a +// new cluster. This step is especially important for parameters that are critical +// when creating the default database for a cluster, such as the character set +// for the default database defined by the character_set_database 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 @@ -3168,12 +3177,12 @@ func (c *DocDB) ModifyDBClusterParameterGroupRequest(input *ModifyDBClusterParam // // Returned Error Codes: // * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName doesn't refer to an existing DB parameter group. +// DBParameterGroupName doesn't refer to an existing parameter group. // // * ErrCodeInvalidDBParameterGroupStateFault "InvalidDBParameterGroupState" -// The DB parameter group is in use, or it is in a state that is not valid. -// If you are trying to delete the parameter group, you can't delete it when -// the parameter group is in this state. +// The parameter group is in use, or it is in a state that is not valid. If +// you are trying to delete the parameter group, you can't delete it when the +// parameter group is in this state. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/ModifyDBClusterParameterGroup func (c *DocDB) ModifyDBClusterParameterGroup(input *ModifyDBClusterParameterGroupInput) (*ModifyDBClusterParameterGroupOutput, error) { @@ -3244,16 +3253,16 @@ func (c *DocDB) ModifyDBClusterSnapshotAttributeRequest(input *ModifyDBClusterSn // 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 +// To share a manual 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. If a manual -// DB cluster snapshot is encrypted, it can be shared, but only by specifying -// a list of authorized AWS account IDs for the ValuesToAdd parameter. You can't -// use all as a value for that parameter in this case. +// IDs of the AWS accounts that are authorized to restore the manual cluster +// snapshot. Use the value all to make the manual 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. If a manual cluster snapshot +// is encrypted, it can be shared, but only by specifying a list of authorized +// AWS account IDs for the ValuesToAdd parameter. You can't use all as a value +// for that parameter in this case. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3264,10 +3273,10 @@ func (c *DocDB) ModifyDBClusterSnapshotAttributeRequest(input *ModifyDBClusterSn // // Returned Error Codes: // * ErrCodeDBClusterSnapshotNotFoundFault "DBClusterSnapshotNotFoundFault" -// DBClusterSnapshotIdentifier doesn't refer to an existing DB cluster snapshot. +// DBClusterSnapshotIdentifier doesn't refer to an existing cluster snapshot. // // * ErrCodeInvalidDBClusterSnapshotStateFault "InvalidDBClusterSnapshotStateFault" -// The provided value isn't a valid DB cluster snapshot state. +// The provided value isn't a valid cluster snapshot state. // // * ErrCodeSharedSnapshotQuotaExceededFault "SharedSnapshotQuotaExceeded" // You have exceeded the maximum number of accounts that you can share a manual @@ -3339,9 +3348,8 @@ func (c *DocDB) ModifyDBInstanceRequest(input *ModifyDBInstanceInput) (req *requ // ModifyDBInstance API operation for Amazon DocumentDB with MongoDB compatibility. // -// 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. +// Modifies settings for an 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 @@ -3352,45 +3360,44 @@ func (c *DocDB) ModifyDBInstanceRequest(input *ModifyDBInstanceInput) (req *requ // // Returned Error Codes: // * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance isn't in the available state. +// The specified instance isn't in the available state. // // * ErrCodeInvalidDBSecurityGroupStateFault "InvalidDBSecurityGroupState" -// The state of the DB security group doesn't allow deletion. +// The state of the security group doesn't allow deletion. // // * ErrCodeDBInstanceAlreadyExistsFault "DBInstanceAlreadyExists" -// You already have a DB instance with the given identifier. +// You already have a instance with the given identifier. // // * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier doesn't refer to an existing DB instance. +// DBInstanceIdentifier doesn't refer to an existing instance. // // * ErrCodeDBSecurityGroupNotFoundFault "DBSecurityGroupNotFound" -// DBSecurityGroupName doesn't refer to an existing DB security group. +// DBSecurityGroupName doesn't refer to an existing security group. // // * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName doesn't refer to an existing DB parameter group. +// DBParameterGroupName doesn't refer to an existing parameter group. // // * ErrCodeInsufficientDBInstanceCapacityFault "InsufficientDBInstanceCapacity" -// The specified DB instance class isn't available in the specified Availability +// The specified instance class isn't available in the specified Availability // Zone. // // * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" // The request would cause you to exceed the allowed amount of storage available -// across all DB instances. +// across all instances. // // * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// The DB subnet group doesn't cover all Availability Zones after it is created +// The subnet group doesn't cover all Availability Zones after it is created // because of changes that were made. // // * ErrCodeDBUpgradeDependencyFailureFault "DBUpgradeDependencyFailure" -// The DB upgrade failed because a resource that the DB depends on can't be -// modified. +// The upgrade failed because a resource that the depends on can't be modified. // // * ErrCodeStorageTypeNotSupportedFault "StorageTypeNotSupported" // Storage of the specified StorageType can't be associated with the DB instance. // // * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" // The specified CIDR IP or Amazon EC2 security group isn't authorized for the -// specified DB security group. +// specified security group. // // Amazon DocumentDB also might not be authorized to perform necessary actions // on your behalf using IAM. @@ -3464,8 +3471,8 @@ func (c *DocDB) ModifyDBSubnetGroupRequest(input *ModifyDBSubnetGroupInput) (req // ModifyDBSubnetGroup API operation for Amazon DocumentDB with MongoDB compatibility. // -// Modifies an existing DB subnet group. DB subnet groups must contain at least -// one subnet in at least two Availability Zones in the AWS Region. +// Modifies an existing subnet group. subnet groups must contain at least one +// subnet in at least two Availability Zones in the 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 @@ -3476,17 +3483,17 @@ func (c *DocDB) ModifyDBSubnetGroupRequest(input *ModifyDBSubnetGroupInput) (req // // Returned Error Codes: // * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName doesn't refer to an existing DB subnet group. +// DBSubnetGroupName doesn't refer to an existing subnet group. // // * ErrCodeDBSubnetQuotaExceededFault "DBSubnetQuotaExceededFault" // The request would cause you to exceed the allowed number of subnets in a -// DB subnet group. +// subnet group. // // * ErrCodeSubnetAlreadyInUse "SubnetAlreadyInUse" -// The DB subnet is already in use in the Availability Zone. +// The subnet is already in use in the Availability Zone. // // * ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs "DBSubnetGroupDoesNotCoverEnoughAZs" -// Subnets in the DB subnet group should cover at least two Availability Zones +// Subnets in the subnet group should cover at least two Availability Zones // unless there is only one Availability Zone. // // * ErrCodeInvalidSubnet "InvalidSubnet" @@ -3559,13 +3566,13 @@ func (c *DocDB) RebootDBInstanceRequest(input *RebootDBInstanceInput) (req *requ // RebootDBInstance API operation for Amazon DocumentDB with MongoDB compatibility. // -// You might need to reboot your DB instance, usually for maintenance reasons. -// For example, if you make certain changes, or if you change the DB cluster -// parameter group that is associated with the DB instance, you must reboot -// the instance for the changes to take effect. +// You might need to reboot your instance, usually for maintenance reasons. +// For example, if you make certain changes, or if you change the cluster parameter +// group that is associated with the instance, you must reboot the instance +// for the changes to take effect. // -// Rebooting a DB instance restarts the database engine service. Rebooting a -// DB instance results in a momentary outage, during which the DB instance status +// Rebooting an instance restarts the database engine service. Rebooting an +// instance results in a momentary outage, during which the instance status // is set to rebooting. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -3577,10 +3584,10 @@ func (c *DocDB) RebootDBInstanceRequest(input *RebootDBInstanceInput) (req *requ // // Returned Error Codes: // * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance isn't in the available state. +// The specified instance isn't in the available state. // // * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier doesn't refer to an existing DB instance. +// DBInstanceIdentifier doesn't refer to an existing instance. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/RebootDBInstance func (c *DocDB) RebootDBInstance(input *RebootDBInstanceInput) (*RebootDBInstanceOutput, error) { @@ -3660,13 +3667,13 @@ func (c *DocDB) RemoveTagsFromResourceRequest(input *RemoveTagsFromResourceInput // // Returned Error Codes: // * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" -// DBInstanceIdentifier doesn't refer to an existing DB instance. +// DBInstanceIdentifier doesn't refer to an existing instance. // // * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" -// DBSnapshotIdentifier doesn't refer to an existing DB snapshot. +// DBSnapshotIdentifier doesn't refer to an existing snapshot. // // * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier doesn't refer to an existing DB cluster. +// DBClusterIdentifier doesn't refer to an existing cluster. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/RemoveTagsFromResource func (c *DocDB) RemoveTagsFromResource(input *RemoveTagsFromResourceInput) (*RemoveTagsFromResourceOutput, error) { @@ -3734,10 +3741,10 @@ func (c *DocDB) ResetDBClusterParameterGroupRequest(input *ResetDBClusterParamet // ResetDBClusterParameterGroup API operation for Amazon DocumentDB with MongoDB compatibility. // -// Modifies the parameters of a DB cluster parameter group to the default value. +// Modifies the parameters of a 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. +// and ApplyMethod. To reset the entire cluster parameter group, specify the +// DBClusterParameterGroupName and ResetAllParameters parameters. // // When you reset the entire group, dynamic parameters are updated immediately // and static parameters are set to pending-reboot to take effect on the next @@ -3752,12 +3759,12 @@ func (c *DocDB) ResetDBClusterParameterGroupRequest(input *ResetDBClusterParamet // // Returned Error Codes: // * ErrCodeInvalidDBParameterGroupStateFault "InvalidDBParameterGroupState" -// The DB parameter group is in use, or it is in a state that is not valid. -// If you are trying to delete the parameter group, you can't delete it when -// the parameter group is in this state. +// The parameter group is in use, or it is in a state that is not valid. If +// you are trying to delete the parameter group, you can't delete it when the +// parameter group is in this state. // // * ErrCodeDBParameterGroupNotFoundFault "DBParameterGroupNotFound" -// DBParameterGroupName doesn't refer to an existing DB parameter group. +// DBParameterGroupName doesn't refer to an existing parameter group. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/ResetDBClusterParameterGroup func (c *DocDB) ResetDBClusterParameterGroup(input *ResetDBClusterParameterGroupInput) (*ResetDBClusterParameterGroupOutput, error) { @@ -3825,14 +3832,14 @@ func (c *DocDB) RestoreDBClusterFromSnapshotRequest(input *RestoreDBClusterFromS // RestoreDBClusterFromSnapshot API operation for Amazon DocumentDB with MongoDB compatibility. // -// Creates a new DB cluster from a DB snapshot or DB cluster snapshot. +// Creates a new cluster from a snapshot or cluster snapshot. // -// If a DB snapshot is specified, the target DB cluster is created from the -// source DB snapshot with a default configuration and default security group. +// If a snapshot is specified, the target cluster is created from the source +// DB snapshot with a default configuration and default security group. // -// If a DB cluster snapshot is specified, 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 +// If a cluster snapshot is specified, the target cluster is created from the +// source cluster restore point with the same configuration as the original +// source DB cluster, except that the new cluster is created with the default // security group. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -3844,27 +3851,27 @@ func (c *DocDB) RestoreDBClusterFromSnapshotRequest(input *RestoreDBClusterFromS // // Returned Error Codes: // * ErrCodeDBClusterAlreadyExistsFault "DBClusterAlreadyExistsFault" -// You already have a DB cluster with the given identifier. +// You already have a cluster with the given identifier. // // * ErrCodeDBClusterQuotaExceededFault "DBClusterQuotaExceededFault" -// The DB cluster can't be created because you have reached the maximum allowed -// quota of DB clusters. +// The cluster can't be created because you have reached the maximum allowed +// quota of clusters. // // * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" // The request would cause you to exceed the allowed amount of storage available -// across all DB instances. +// across all instances. // // * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName doesn't refer to an existing DB subnet group. +// DBSubnetGroupName doesn't refer to an existing subnet group. // // * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" -// DBSnapshotIdentifier doesn't refer to an existing DB snapshot. +// DBSnapshotIdentifier doesn't refer to an existing snapshot. // // * ErrCodeDBClusterSnapshotNotFoundFault "DBClusterSnapshotNotFoundFault" -// DBClusterSnapshotIdentifier doesn't refer to an existing DB cluster snapshot. +// DBClusterSnapshotIdentifier doesn't refer to an existing cluster snapshot. // // * ErrCodeInsufficientDBClusterCapacityFault "InsufficientDBClusterCapacityFault" -// The DB cluster doesn't have enough capacity for the current operation. +// The cluster doesn't have enough capacity for the current operation. // // * ErrCodeInsufficientStorageClusterCapacityFault "InsufficientStorageClusterCapacity" // There is not enough storage available for the current action. You might be @@ -3872,17 +3879,17 @@ func (c *DocDB) RestoreDBClusterFromSnapshotRequest(input *RestoreDBClusterFromS // Availability Zones that have more storage available. // // * ErrCodeInvalidDBSnapshotStateFault "InvalidDBSnapshotState" -// The state of the DB snapshot doesn't allow deletion. +// The state of the snapshot doesn't allow deletion. // // * ErrCodeInvalidDBClusterSnapshotStateFault "InvalidDBClusterSnapshotStateFault" -// The provided value isn't a valid DB cluster snapshot state. +// The provided value isn't a valid cluster snapshot state. // // * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" // The request would cause you to exceed the allowed amount of storage available -// across all DB instances. +// across all instances. // // * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// The DB subnet group doesn't cover all Availability Zones after it is created +// The subnet group doesn't cover all Availability Zones after it is created // because of changes that were made. // // * ErrCodeInvalidRestoreFault "InvalidRestoreFault" @@ -3890,7 +3897,7 @@ func (c *DocDB) RestoreDBClusterFromSnapshotRequest(input *RestoreDBClusterFromS // DB instance. // // * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName doesn't refer to an existing DB subnet group. +// DBSubnetGroupName doesn't refer to an existing subnet group. // // * ErrCodeInvalidSubnet "InvalidSubnet" // The requested subnet is not valid, or multiple subnets were requested that @@ -3965,11 +3972,11 @@ func (c *DocDB) RestoreDBClusterToPointInTimeRequest(input *RestoreDBClusterToPo // RestoreDBClusterToPointInTime API operation for Amazon DocumentDB with MongoDB compatibility. // -// 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. +// Restores a cluster to an arbitrary point in time. Users can restore to any +// point in time before LatestRestorableTime for up to BackupRetentionPeriod +// days. The target cluster is created from the source cluster with the same +// configuration as the original cluster, except that the new cluster is created +// with the default 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 @@ -3980,23 +3987,23 @@ func (c *DocDB) RestoreDBClusterToPointInTimeRequest(input *RestoreDBClusterToPo // // Returned Error Codes: // * ErrCodeDBClusterAlreadyExistsFault "DBClusterAlreadyExistsFault" -// You already have a DB cluster with the given identifier. +// You already have a cluster with the given identifier. // // * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier doesn't refer to an existing DB cluster. +// DBClusterIdentifier doesn't refer to an existing cluster. // // * ErrCodeDBClusterQuotaExceededFault "DBClusterQuotaExceededFault" -// The DB cluster can't be created because you have reached the maximum allowed -// quota of DB clusters. +// The cluster can't be created because you have reached the maximum allowed +// quota of clusters. // // * ErrCodeDBClusterSnapshotNotFoundFault "DBClusterSnapshotNotFoundFault" -// DBClusterSnapshotIdentifier doesn't refer to an existing DB cluster snapshot. +// DBClusterSnapshotIdentifier doesn't refer to an existing cluster snapshot. // // * ErrCodeDBSubnetGroupNotFoundFault "DBSubnetGroupNotFoundFault" -// DBSubnetGroupName doesn't refer to an existing DB subnet group. +// DBSubnetGroupName doesn't refer to an existing subnet group. // // * ErrCodeInsufficientDBClusterCapacityFault "InsufficientDBClusterCapacityFault" -// The DB cluster doesn't have enough capacity for the current operation. +// The cluster doesn't have enough capacity for the current operation. // // * ErrCodeInsufficientStorageClusterCapacityFault "InsufficientStorageClusterCapacity" // There is not enough storage available for the current action. You might be @@ -4004,13 +4011,13 @@ func (c *DocDB) RestoreDBClusterToPointInTimeRequest(input *RestoreDBClusterToPo // Availability Zones that have more storage available. // // * ErrCodeInvalidDBClusterSnapshotStateFault "InvalidDBClusterSnapshotStateFault" -// The provided value isn't a valid DB cluster snapshot state. +// The provided value isn't a valid cluster snapshot state. // // * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster isn't in a valid state. +// The cluster isn't in a valid state. // // * ErrCodeInvalidDBSnapshotStateFault "InvalidDBSnapshotState" -// The state of the DB snapshot doesn't allow deletion. +// The state of the snapshot doesn't allow deletion. // // * ErrCodeInvalidRestoreFault "InvalidRestoreFault" // You cannot restore from a virtual private cloud (VPC) backup to a non-VPC @@ -4021,7 +4028,7 @@ func (c *DocDB) RestoreDBClusterToPointInTimeRequest(input *RestoreDBClusterToPo // are not all in a common virtual private cloud (VPC). // // * ErrCodeInvalidVPCNetworkStateFault "InvalidVPCNetworkStateFault" -// The DB subnet group doesn't cover all Availability Zones after it is created +// The subnet group doesn't cover all Availability Zones after it is created // because of changes that were made. // // * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" @@ -4029,7 +4036,7 @@ func (c *DocDB) RestoreDBClusterToPointInTimeRequest(input *RestoreDBClusterToPo // // * ErrCodeStorageQuotaExceededFault "StorageQuotaExceeded" // The request would cause you to exceed the allowed amount of storage available -// across all DB instances. +// across all instances. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/RestoreDBClusterToPointInTime func (c *DocDB) RestoreDBClusterToPointInTime(input *RestoreDBClusterToPointInTimeInput) (*RestoreDBClusterToPointInTimeOutput, error) { @@ -4110,13 +4117,13 @@ func (c *DocDB) StartDBClusterRequest(input *StartDBClusterInput) (req *request. // // Returned Error Codes: // * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier doesn't refer to an existing DB cluster. +// DBClusterIdentifier doesn't refer to an existing cluster. // // * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster isn't in a valid state. +// The cluster isn't in a valid state. // // * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance isn't in the available state. +// The specified instance isn't in the available state. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/StartDBCluster func (c *DocDB) StartDBCluster(input *StartDBClusterInput) (*StartDBClusterOutput, error) { @@ -4197,13 +4204,13 @@ func (c *DocDB) StopDBClusterRequest(input *StopDBClusterInput) (req *request.Re // // Returned Error Codes: // * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" -// DBClusterIdentifier doesn't refer to an existing DB cluster. +// DBClusterIdentifier doesn't refer to an existing cluster. // // * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" -// The DB cluster isn't in a valid state. +// The cluster isn't in a valid state. // // * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" -// The specified DB instance isn't in the available state. +// The specified instance isn't in the available state. // // See also, https://docs.aws.amazon.com/goto/WebAPI/docdb-2014-10-31/StopDBCluster func (c *DocDB) StopDBCluster(input *StopDBClusterInput) (*StopDBClusterOutput, error) { @@ -4502,11 +4509,11 @@ func (s *Certificate) SetValidTill(v time.Time) *Certificate { } // The configuration setting for the log types to be enabled for export to Amazon -// CloudWatch Logs for a specific DB instance or DB cluster. +// CloudWatch Logs for a specific instance or cluster. // // The EnableLogTypes and DisableLogTypes arrays determine which logs are exported // (or not exported) to CloudWatch Logs. The values within these arrays depend -// on the DB engine that is being used. +// on the engine that is being used. type CloudwatchLogsExportConfiguration struct { _ struct{} `type:"structure"` @@ -4543,19 +4550,19 @@ func (s *CloudwatchLogsExportConfiguration) SetEnableLogTypes(v []*string) *Clou type CopyDBClusterParameterGroupInput struct { _ struct{} `type:"structure"` - // The identifier or Amazon Resource Name (ARN) for the source DB cluster parameter + // The identifier or Amazon Resource Name (ARN) for the source cluster parameter // group. // // Constraints: // - // * Must specify a valid DB cluster parameter group. + // * Must specify a valid cluster parameter group. // - // * If the source DB cluster parameter group is in the same AWS 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 cluster parameter group is in the same AWS Region as the + // copy, specify a valid parameter group identifier; for example, my-db-cluster-param-group, + // or a valid ARN. // - // * If the source DB parameter group is in a different AWS 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. + // * If the source parameter group is in a different AWS Region than the + // copy, specify a valid 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"` @@ -4563,12 +4570,12 @@ type CopyDBClusterParameterGroupInput struct { // The tags that are to be assigned to the parameter group. Tags []*Tag `locationNameList:"Tag" type:"list"` - // A description for the copied DB cluster parameter group. + // A description for the copied cluster parameter group. // // TargetDBClusterParameterGroupDescription is a required field TargetDBClusterParameterGroupDescription *string `type:"string" required:"true"` - // The identifier for the copied DB cluster parameter group. + // The identifier for the copied cluster parameter group. // // Constraints: // @@ -4642,7 +4649,7 @@ func (s *CopyDBClusterParameterGroupInput) SetTargetDBClusterParameterGroupIdent type CopyDBClusterParameterGroupOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB cluster parameter group. + // Detailed information about a cluster parameter group. DBClusterParameterGroup *DBClusterParameterGroup `type:"structure"` } @@ -4666,37 +4673,36 @@ func (s *CopyDBClusterParameterGroupOutput) SetDBClusterParameterGroup(v *DBClus type CopyDBClusterSnapshotInput struct { _ struct{} `type:"structure"` - // Set to true to copy all tags from the source DB cluster snapshot to the target - // DB cluster snapshot, and otherwise false. The default is false. + // Set to true to copy all tags from the source cluster snapshot to the target + // cluster snapshot, and otherwise false. The default is false. CopyTags *bool `type:"boolean"` - // The AWS KMS key ID for an encrypted DB cluster snapshot. The AWS KMS key - // ID is the Amazon Resource Name (ARN), AWS KMS key identifier, or the AWS - // KMS key alias for the AWS KMS encryption key. + // The AWS KMS key ID for an encrypted cluster snapshot. The AWS KMS key ID + // is the Amazon Resource Name (ARN), AWS KMS key identifier, or the AWS KMS + // key alias for the AWS KMS encryption key. // - // If you copy an encrypted DB cluster snapshot from your AWS account, you can + // If you copy an encrypted cluster snapshot from your AWS account, you can // specify a value for KmsKeyId to encrypt the copy with a new AWS 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 AWS KMS key as the source DB cluster - // snapshot. + // key. If you don't specify a value for KmsKeyId, then the copy of the cluster + // snapshot is encrypted with the same AWS KMS key as the source 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. + // If you copy an encrypted 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 AWS Region, set KmsKeyId - // to the AWS KMS key ID that you want to use to encrypt the copy of the DB - // cluster snapshot in the destination Region. AWS KMS encryption keys are specific + // To copy an encrypted cluster snapshot to another AWS Region, set KmsKeyId + // to the AWS KMS key ID that you want to use to encrypt the copy of the cluster + // snapshot in the destination Region. AWS KMS encryption keys are specific // to the AWS Region that they are created in, and you can't use encryption // keys from one Region in another Region. // - // If you copy an unencrypted DB cluster snapshot and specify a value for the - // KmsKeyId parameter, an error is returned. + // If you copy an unencrypted cluster snapshot and specify a value for the KmsKeyId + // parameter, an error is returned. 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. You must use the PreSignedUrl parameter when copying an encrypted - // DB cluster snapshot from another AWS Region. + // API action in the AWS Region that contains the source cluster snapshot to + // copy. You must use the PreSignedUrl parameter when copying an encrypted cluster + // snapshot from another AWS Region. // // The presigned URL must be a valid request for the CopyDBSClusterSnapshot // API action that can be executed in the source AWS Region that contains the @@ -4704,26 +4710,26 @@ type CopyDBClusterSnapshotInput struct { // contain the following parameter values: // // * KmsKeyId - The AWS KMS key identifier for the key to use to encrypt - // the copy of the DB cluster snapshot in the destination AWS Region. This - // is the same identifier for both the CopyDBClusterSnapshot action that - // is called in the destination AWS Region, and the action contained in the + // the copy of the cluster snapshot in the destination AWS Region. This is + // the same identifier for both the CopyDBClusterSnapshot action that is + // called in the destination AWS Region, and the action contained in the // presigned URL. // // * DestinationRegion - The name of the AWS 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 + // * SourceDBClusterSnapshotIdentifier - The cluster snapshot identifier + // for the encrypted cluster snapshot to be copied. This identifier must // be in the Amazon Resource Name (ARN) format for the source AWS Region. - // For example, if you are copying an encrypted DB cluster snapshot from - // the us-west-2 AWS Region, then your SourceDBClusterSnapshotIdentifier - // looks like the following example: arn:aws:rds:us-west-2:123456789012:cluster-snapshot:my-cluster-snapshot-20161115. + // For example, if you are copying an encrypted cluster snapshot from the + // us-west-2 AWS Region, then your SourceDBClusterSnapshotIdentifier looks + // like the following example: arn:aws:rds:us-west-2:123456789012:cluster-snapshot:my-cluster-snapshot-20161115. PreSignedUrl *string `type:"string"` - // The identifier of the DB cluster snapshot to copy. This parameter is not - // case sensitive. + // The identifier of the cluster snapshot to copy. This parameter is not case + // sensitive. // - // You can't copy an encrypted, shared DB cluster snapshot from one AWS Region + // You can't copy an encrypted, shared cluster snapshot from one AWS Region // to another. // // Constraints: @@ -4731,21 +4737,21 @@ type CopyDBClusterSnapshotInput struct { // * Must specify a valid system snapshot in the "available" state. // // * If the source snapshot is in the same AWS Region as the copy, specify - // a valid DB snapshot identifier. + // a valid snapshot identifier. // // * If the source snapshot is in a different AWS Region than the copy, specify - // a valid DB cluster snapshot ARN. + // a valid cluster snapshot ARN. // // Example: my-cluster-snapshot1 // // SourceDBClusterSnapshotIdentifier is a required field SourceDBClusterSnapshotIdentifier *string `type:"string" required:"true"` - // The tags to be assigned to the DB cluster snapshot. + // The tags to be assigned to the cluster snapshot. 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. + // The identifier of the new cluster snapshot to create from the source cluster + // snapshot. This parameter is not case sensitive. // // Constraints: // @@ -4826,7 +4832,7 @@ func (s *CopyDBClusterSnapshotInput) SetTargetDBClusterSnapshotIdentifier(v stri type CopyDBClusterSnapshotOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB cluster snapshot. + // Detailed information about a cluster snapshot. DBClusterSnapshot *DBClusterSnapshot `type:"structure"` } @@ -4850,8 +4856,8 @@ func (s *CopyDBClusterSnapshotOutput) SetDBClusterSnapshot(v *DBClusterSnapshot) type CreateDBClusterInput struct { _ struct{} `type:"structure"` - // A list of Amazon EC2 Availability Zones that instances in the DB cluster - // can be created in. + // A list of Amazon EC2 Availability Zones that instances in the cluster can + // be created in. AvailabilityZones []*string `locationNameList:"AvailabilityZone" type:"list"` // The number of days for which automated backups are retained. You must specify @@ -4864,7 +4870,7 @@ type CreateDBClusterInput struct { // * Must be a value from 1 to 35. BackupRetentionPeriod *int64 `type:"integer"` - // The DB cluster identifier. This parameter is stored as a lowercase string. + // The cluster identifier. This parameter is stored as a lowercase string. // // Constraints: // @@ -4879,10 +4885,10 @@ type CreateDBClusterInput struct { // 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. + // The name of the cluster parameter group to associate with this cluster. DBClusterParameterGroupName *string `type:"string"` - // A DB subnet group to associate with this DB cluster. + // A subnet group to associate with this cluster. // // Constraints: Must match the name of an existing DBSubnetGroup. Must not be // default. @@ -4900,7 +4906,7 @@ type CreateDBClusterInput struct { // Logs. EnableCloudwatchLogsExports []*string `type:"list"` - // The name of the database engine to be used for this DB cluster. + // The name of the database engine to be used for this cluster. // // Valid values: docdb // @@ -4910,11 +4916,11 @@ type CreateDBClusterInput struct { // The version number of the database engine to use. EngineVersion *string `type:"string"` - // The AWS KMS key identifier for an encrypted DB cluster. + // The AWS KMS key identifier for an encrypted cluster. // // The AWS KMS key identifier is the Amazon Resource Name (ARN) for the AWS - // KMS encryption key. If you are creating a DB cluster using the same AWS account - // that owns the AWS KMS encryption key that is used to encrypt the new DB cluster, + // KMS encryption key. If you are creating a cluster using the same AWS account + // that owns the AWS KMS encryption key that is used to encrypt the new cluster, // you can use the AWS KMS key alias instead of the ARN for the AWS KMS encryption // key. // @@ -4930,9 +4936,9 @@ type CreateDBClusterInput struct { // 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 replica of an encrypted DB cluster in another AWS Region, - // you must set KmsKeyId to a KMS key ID that is valid in the destination AWS - // Region. This key is used to encrypt the replica in that AWS Region. + // If you create a replica of an encrypted cluster in another AWS Region, you + // must set KmsKeyId to a KMS key ID that is valid in the destination AWS Region. + // This key is used to encrypt the replica in that AWS Region. KmsKeyId *string `type:"string"` // The password for the master database user. This password can contain any @@ -4944,7 +4950,7 @@ type CreateDBClusterInput struct { // MasterUserPassword is a required field MasterUserPassword *string `type:"string" required:"true"` - // The name of the master user for the DB cluster. + // The name of the master user for the cluster. // // Constraints: // @@ -4957,7 +4963,7 @@ type CreateDBClusterInput struct { // MasterUsername is a required field MasterUsername *string `type:"string" required:"true"` - // The port number on which the instances in the DB cluster accept connections. + // The port number on which the instances in the cluster accept connections. Port *int64 `type:"integer"` // The daily time range during which automated backups are created if automated @@ -4990,13 +4996,13 @@ type CreateDBClusterInput struct { // Constraints: Minimum 30-minute window. PreferredMaintenanceWindow *string `type:"string"` - // Specifies whether the DB cluster is encrypted. + // Specifies whether the cluster is encrypted. StorageEncrypted *bool `type:"boolean"` - // The tags to be assigned to the DB cluster. + // The tags to be assigned to the cluster. Tags []*Tag `locationNameList:"Tag" type:"list"` - // A list of EC2 VPC security groups to associate with this DB cluster. + // A list of EC2 VPC security groups to associate with this cluster. VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` } @@ -5143,7 +5149,7 @@ func (s *CreateDBClusterInput) SetVpcSecurityGroupIds(v []*string) *CreateDBClus type CreateDBClusterOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB cluster. + // Detailed information about a cluster. DBCluster *DBCluster `type:"structure"` } @@ -5167,28 +5173,28 @@ func (s *CreateDBClusterOutput) SetDBCluster(v *DBCluster) *CreateDBClusterOutpu type CreateDBClusterParameterGroupInput struct { _ struct{} `type:"structure"` - // The name of the DB cluster parameter group. + // The name of the cluster parameter group. // // Constraints: // - // * Must match the name of an existing DBClusterParameterGroup. + // * Must not match the name of an existing DBClusterParameterGroup. // // 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. + // The cluster parameter group family name. // // DBParameterGroupFamily is a required field DBParameterGroupFamily *string `type:"string" required:"true"` - // The description for the DB cluster parameter group. + // The description for the cluster parameter group. // // Description is a required field Description *string `type:"string" required:"true"` - // The tags to be assigned to the DB cluster parameter group. + // The tags to be assigned to the cluster parameter group. Tags []*Tag `locationNameList:"Tag" type:"list"` } @@ -5248,7 +5254,7 @@ func (s *CreateDBClusterParameterGroupInput) SetTags(v []*Tag) *CreateDBClusterP type CreateDBClusterParameterGroupOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB cluster parameter group. + // Detailed information about a cluster parameter group. DBClusterParameterGroup *DBClusterParameterGroup `type:"structure"` } @@ -5272,8 +5278,8 @@ func (s *CreateDBClusterParameterGroupOutput) SetDBClusterParameterGroup(v *DBCl type CreateDBClusterSnapshotInput struct { _ struct{} `type:"structure"` - // The identifier of the DB cluster to create a snapshot for. This parameter - // is not case sensitive. + // The identifier of the cluster to create a snapshot for. This parameter is + // not case sensitive. // // Constraints: // @@ -5284,8 +5290,8 @@ type CreateDBClusterSnapshotInput struct { // 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. + // The identifier of the cluster snapshot. This parameter is stored as a lowercase + // string. // // Constraints: // @@ -5300,7 +5306,7 @@ type CreateDBClusterSnapshotInput struct { // DBClusterSnapshotIdentifier is a required field DBClusterSnapshotIdentifier *string `type:"string" required:"true"` - // The tags to be assigned to the DB cluster snapshot. + // The tags to be assigned to the cluster snapshot. Tags []*Tag `locationNameList:"Tag" type:"list"` } @@ -5351,7 +5357,7 @@ func (s *CreateDBClusterSnapshotInput) SetTags(v []*Tag) *CreateDBClusterSnapsho type CreateDBClusterSnapshotOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB cluster snapshot. + // Detailed information about a cluster snapshot. DBClusterSnapshot *DBClusterSnapshot `type:"structure"` } @@ -5375,13 +5381,13 @@ func (s *CreateDBClusterSnapshotOutput) SetDBClusterSnapshot(v *DBClusterSnapsho type CreateDBInstanceInput struct { _ struct{} `type:"structure"` - // Indicates that minor engine upgrades are applied automatically to the DB - // instance during the maintenance window. + // Indicates that minor engine upgrades are applied automatically to the instance + // during the maintenance window. // // Default: true AutoMinorVersionUpgrade *bool `type:"boolean"` - // The Amazon EC2 Availability Zone that the DB instance is created in. + // The Amazon EC2 Availability Zone that the instance is created in. // // Default: A random, system-chosen Availability Zone in the endpoint's AWS // Region. @@ -5393,17 +5399,17 @@ type CreateDBInstanceInput struct { // same AWS Region as the current endpoint. AvailabilityZone *string `type:"string"` - // The identifier of the DB cluster that the instance will belong to. + // The identifier of the cluster that the instance will belong to. // // DBClusterIdentifier is a required field DBClusterIdentifier *string `type:"string" required:"true"` - // The compute and memory capacity of the DB instance; for example, db.r5.large. + // The compute and memory capacity of the instance; for example, db.r5.large. // // DBInstanceClass is a required field DBInstanceClass *string `type:"string" required:"true"` - // The DB instance identifier. This parameter is stored as a lowercase string. + // The instance identifier. This parameter is stored as a lowercase string. // // Constraints: // @@ -5447,8 +5453,8 @@ type CreateDBInstanceInput struct { // Valid values: 0-15 PromotionTier *int64 `type:"integer"` - // The tags to be assigned to the DB instance. You can assign up to 10 tags - // to an instance. + // The tags to be assigned to the instance. You can assign up to 10 tags to + // an instance. Tags []*Tag `locationNameList:"Tag" type:"list"` } @@ -5541,7 +5547,7 @@ func (s *CreateDBInstanceInput) SetTags(v []*Tag) *CreateDBInstanceInput { type CreateDBInstanceOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB instance. + // Detailed information about an instance. DBInstance *DBInstance `type:"structure"` } @@ -5565,12 +5571,12 @@ func (s *CreateDBInstanceOutput) SetDBInstance(v *DBInstance) *CreateDBInstanceO type CreateDBSubnetGroupInput struct { _ struct{} `type:"structure"` - // The description for the DB subnet group. + // The description for the 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. + // The name for the subnet group. This value is stored as a lowercase string. // // Constraints: Must contain no more than 255 letters, numbers, periods, underscores, // spaces, or hyphens. Must not be default. @@ -5580,12 +5586,12 @@ type CreateDBSubnetGroupInput struct { // DBSubnetGroupName is a required field DBSubnetGroupName *string `type:"string" required:"true"` - // The Amazon EC2 subnet IDs for the DB subnet group. + // The Amazon EC2 subnet IDs for the subnet group. // // SubnetIds is a required field SubnetIds []*string `locationNameList:"SubnetIdentifier" type:"list" required:"true"` - // The tags to be assigned to the DB subnet group. + // The tags to be assigned to the subnet group. Tags []*Tag `locationNameList:"Tag" type:"list"` } @@ -5645,7 +5651,7 @@ func (s *CreateDBSubnetGroupInput) SetTags(v []*Tag) *CreateDBSubnetGroupInput { type CreateDBSubnetGroupOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB subnet group. + // Detailed information about a subnet group. DBSubnetGroup *DBSubnetGroup `type:"structure"` } @@ -5665,47 +5671,46 @@ func (s *CreateDBSubnetGroupOutput) SetDBSubnetGroup(v *DBSubnetGroup) *CreateDB return s } -// Detailed information about a DB cluster. +// Detailed information about a cluster. type DBCluster struct { _ struct{} `type:"structure"` // 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. + // are associated with the cluster. IAM roles that are associated with a cluster + // grant permission for the cluster to access other AWS services on your behalf. AssociatedRoles []*DBClusterRole `locationNameList:"DBClusterRole" type:"list"` // Provides the list of Amazon EC2 Availability Zones that instances in the - // DB cluster can be created in. + // cluster can be created in. AvailabilityZones []*string `locationNameList:"AvailabilityZone" type:"list"` - // Specifies the number of days for which automatic DB snapshots are retained. + // Specifies the number of days for which automatic snapshots are retained. BackupRetentionPeriod *int64 `type:"integer"` - // Specifies the time when the DB cluster was created, in Universal Coordinated + // Specifies the time when the cluster was created, in Universal Coordinated // Time (UTC). ClusterCreateTime *time.Time `type:"timestamp"` - // The Amazon Resource Name (ARN) for the DB cluster. + // The Amazon Resource Name (ARN) for the cluster. DBClusterArn *string `type:"string"` - // Contains a user-supplied DB cluster identifier. This identifier is the unique - // key that identifies a DB cluster. + // Contains a user-supplied cluster identifier. This identifier is the unique + // key that identifies a cluster. DBClusterIdentifier *string `type:"string"` - // Provides the list of instances that make up the DB cluster. + // Provides the list of instances that make up the cluster. DBClusterMembers []*DBClusterMember `locationNameList:"DBClusterMember" type:"list"` - // Specifies the name of the DB cluster parameter group for the DB cluster. + // Specifies the name of the cluster parameter group for the cluster. DBClusterParameterGroup *string `type:"string"` - // Specifies information on the subnet group that is associated with the DB - // cluster, including the name, description, and subnets in the subnet group. + // Specifies information on the subnet group that is associated with the cluster, + // including the name, description, and subnets in the subnet group. DBSubnetGroup *string `type:"string"` - // The AWS Region-unique, immutable identifier for the DB cluster. This identifier - // is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB - // cluster is accessed. + // The AWS Region-unique, immutable identifier for the cluster. This identifier + // is found in AWS CloudTrail log entries whenever the AWS KMS key for the cluster + // is accessed. DbClusterResourceId *string `type:"string"` // Specifies whether this cluster can be deleted. If DeletionProtection is enabled, @@ -5718,14 +5723,14 @@ type DBCluster struct { // restore. EarliestRestorableTime *time.Time `type:"timestamp"` - // A list of log types that this DB cluster is configured to export to Amazon - // CloudWatch Logs. + // A list of log types that this cluster is configured to export to Amazon CloudWatch + // Logs. EnabledCloudwatchLogsExports []*string `type:"list"` - // Specifies the connection endpoint for the primary instance of the DB cluster. + // Specifies the connection endpoint for the primary instance of the cluster. Endpoint *string `type:"string"` - // Provides the name of the database engine to be used for this DB cluster. + // Provides the name of the database engine to be used for this cluster. Engine *string `type:"string"` // Indicates the database engine version. @@ -5735,17 +5740,17 @@ type DBCluster struct { HostedZoneId *string `type:"string"` // If StorageEncrypted is true, the AWS KMS key identifier for the encrypted - // DB cluster. + // 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"` - // Contains the master user name for the DB cluster. + // Contains the master user name for the cluster. MasterUsername *string `type:"string"` - // Specifies whether the DB cluster has instances in multiple Availability Zones. + // Specifies whether the cluster has instances in multiple Availability Zones. MultiAZ *bool `type:"boolean"` // Specifies the progress of the operation as a percentage. @@ -5762,13 +5767,12 @@ type DBCluster struct { // in Universal Coordinated Time (UTC). PreferredMaintenanceWindow *string `type:"string"` - // The reader endpoint for the DB cluster. The reader endpoint for a DB cluster - // load balances connections across the Amazon DocumentDB replicas that are - // available in a DB cluster. As clients request new connections to the reader - // endpoint, Amazon DocumentDB distributes the connection requests among the - // Amazon DocumentDB replicas in the DB cluster. This functionality can help - // balance your read workload across multiple Amazon DocumentDB replicas in - // your DB cluster. + // The reader endpoint for the cluster. The reader endpoint for a cluster load + // balances connections across the Amazon DocumentDB replicas that are available + // in a cluster. As clients request new connections to the reader endpoint, + // Amazon DocumentDB distributes the connection requests among the Amazon DocumentDB + // replicas in the cluster. This functionality can help balance your read workload + // across multiple Amazon DocumentDB replicas in your cluster. // // If a failover occurs, and the Amazon DocumentDB replica that you are connected // to is promoted to be the primary instance, your connection is dropped. To @@ -5776,14 +5780,14 @@ type DBCluster struct { // the cluster, you can then reconnect to the reader endpoint. ReaderEndpoint *string `type:"string"` - // Specifies the current state of this DB cluster. + // Specifies the current state of this cluster. Status *string `type:"string"` - // Specifies whether the DB cluster is encrypted. + // Specifies whether the cluster is encrypted. StorageEncrypted *bool `type:"boolean"` - // Provides a list of virtual private cloud (VPC) security groups that the DB - // cluster belongs to. + // Provides a list of virtual private cloud (VPC) security groups that the cluster + // belongs to. VpcSecurityGroups []*VpcSecurityGroupMembership `locationNameList:"VpcSecurityGroupMembership" type:"list"` } @@ -5971,19 +5975,19 @@ func (s *DBCluster) SetVpcSecurityGroups(v []*VpcSecurityGroupMembership) *DBClu return s } -// Contains information about an instance that is part of a DB cluster. +// Contains information about an instance that is part of a cluster. type DBClusterMember struct { _ struct{} `type:"structure"` - // Specifies the status of the DB cluster parameter group for this member of - // the DB cluster. + // Specifies the status of the 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. + // Specifies the instance identifier for this member of the cluster. DBInstanceIdentifier *string `type:"string"` // A value that is true if the cluster member is the primary instance for the - // DB cluster and false otherwise. + // cluster and false otherwise. IsClusterWriter *bool `type:"boolean"` // A value that specifies the order in which an Amazon DocumentDB replica is @@ -6026,22 +6030,21 @@ func (s *DBClusterMember) SetPromotionTier(v int64) *DBClusterMember { return s } -// Detailed information about a DB cluster parameter group. +// Detailed information about a cluster parameter group. type DBClusterParameterGroup struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) for the DB cluster parameter group. + // The Amazon Resource Name (ARN) for the cluster parameter group. DBClusterParameterGroupArn *string `type:"string"` - // Provides the name of the DB cluster parameter group. + // Provides the name of the cluster parameter group. DBClusterParameterGroupName *string `type:"string"` - // Provides the name of the DB parameter group family that this DB cluster parameter + // Provides the name of the parameter group family that this cluster parameter // group is compatible with. DBParameterGroupFamily *string `type:"string"` - // Provides the customer-specified description for this DB cluster parameter - // group. + // Provides the customer-specified description for this cluster parameter group. Description *string `type:"string"` } @@ -6080,7 +6083,7 @@ func (s *DBClusterParameterGroup) SetDescription(v string) *DBClusterParameterGr } // Describes an AWS Identity and Access Management (IAM) role that is associated -// with a DB cluster. +// with a cluster. type DBClusterRole struct { _ struct{} `type:"structure"` @@ -6088,17 +6091,16 @@ type DBClusterRole struct { // DB cluster. RoleArn *string `type:"string"` - // Describes the state of association between the IAM role and the DB cluster. + // Describes the state of association between the IAM role and the 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. + // * ACTIVE - The IAM role ARN is associated with the 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 cannot assume the IAM role to access other AWS services on - // your behalf. + // * INVALID - The IAM role ARN is associated with the cluster, but the cluster + // cannot assume the IAM role to access other AWS services on your behalf. Status *string `type:"string"` } @@ -6124,66 +6126,65 @@ func (s *DBClusterRole) SetStatus(v string) *DBClusterRole { return s } -// Detailed information about a DB cluster snapshot. +// Detailed information about a cluster snapshot. type DBClusterSnapshot struct { _ struct{} `type:"structure"` // Provides the list of Amazon EC2 Availability Zones that instances in the - // DB cluster snapshot can be restored in. + // cluster snapshot can be restored in. AvailabilityZones []*string `locationNameList:"AvailabilityZone" type:"list"` - // Specifies the time when the DB cluster was created, in Universal Coordinated + // Specifies the time when the cluster was created, in Universal Coordinated // Time (UTC). ClusterCreateTime *time.Time `type:"timestamp"` - // Specifies the DB cluster identifier of the DB cluster that this DB cluster - // snapshot was created from. + // Specifies the cluster identifier of the cluster that this cluster snapshot + // was created from. DBClusterIdentifier *string `type:"string"` - // The Amazon Resource Name (ARN) for the DB cluster snapshot. + // The Amazon Resource Name (ARN) for the cluster snapshot. DBClusterSnapshotArn *string `type:"string"` - // Specifies the identifier for the DB cluster snapshot. + // Specifies the identifier for the 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. + // Provides the version of the database engine for this cluster snapshot. EngineVersion *string `type:"string"` // If StorageEncrypted is true, the AWS KMS key identifier for the encrypted - // DB cluster snapshot. + // cluster snapshot. KmsKeyId *string `type:"string"` - // Provides the master user name for the DB cluster snapshot. + // Provides the master user name for the 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. + // Specifies the port that the cluster was listening on at the time of the snapshot. Port *int64 `type:"integer"` // Provides the time when the snapshot was taken, in UTC. SnapshotCreateTime *time.Time `type:"timestamp"` - // Provides the type of the DB cluster snapshot. + // Provides the type of the cluster snapshot. SnapshotType *string `type:"string"` - // If the DB cluster snapshot was copied from a source DB cluster snapshot, - // the ARN for the source DB cluster snapshot; otherwise, a null value. + // If the cluster snapshot was copied from a source cluster snapshot, the ARN + // for the source cluster snapshot; otherwise, a null value. SourceDBClusterSnapshotArn *string `type:"string"` - // Specifies the status of this DB cluster snapshot. + // Specifies the status of this cluster snapshot. Status *string `type:"string"` - // Specifies whether the DB cluster snapshot is encrypted. + // Specifies whether the cluster snapshot is encrypted. StorageEncrypted *bool `type:"boolean"` - // Provides the virtual private cloud (VPC) ID that is associated with the DB - // cluster snapshot. + // Provides the virtual private cloud (VPC) ID that is associated with the cluster + // snapshot. VpcId *string `type:"string"` } @@ -6299,26 +6300,25 @@ func (s *DBClusterSnapshot) SetVpcId(v string) *DBClusterSnapshot { return s } -// Contains the name and values of a manual DB cluster snapshot attribute. +// Contains the name and values of a manual cluster snapshot attribute. // -// Manual DB cluster snapshot attributes are used to authorize other AWS accounts -// to restore a manual DB cluster snapshot. +// Manual cluster snapshot attributes are used to authorize other AWS accounts +// to restore a manual cluster snapshot. type DBClusterSnapshotAttribute struct { _ struct{} `type:"structure"` - // The name of the manual DB cluster snapshot attribute. + // The name of the manual 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. + // permission to copy or restore the manual cluster snapshot. AttributeName *string `type:"string"` - // The values for the manual DB cluster snapshot attribute. + // The values for the manual 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. + // manual cluster snapshot. If a value of all is in the list, then the manual + // cluster snapshot is public and available for any AWS account to copy or restore. AttributeValues []*string `locationNameList:"AttributeValue" type:"list"` } @@ -6344,15 +6344,15 @@ func (s *DBClusterSnapshotAttribute) SetAttributeValues(v []*string) *DBClusterS return s } -// Detailed information about the attributes that are associated with a DB cluster +// Detailed information about the attributes that are associated with a cluster // snapshot. type DBClusterSnapshotAttributesResult struct { _ struct{} `type:"structure"` - // The list of attributes and values for the DB cluster snapshot. + // The list of attributes and values for the cluster snapshot. DBClusterSnapshotAttributes []*DBClusterSnapshotAttribute `locationNameList:"DBClusterSnapshotAttribute" type:"list"` - // The identifier of the DB cluster snapshot that the attributes apply to. + // The identifier of the cluster snapshot that the attributes apply to. DBClusterSnapshotIdentifier *string `type:"string"` } @@ -6378,7 +6378,7 @@ func (s *DBClusterSnapshotAttributesResult) SetDBClusterSnapshotIdentifier(v str return s } -// Detailed information about a DB engine version. +// Detailed information about an engine version. type DBEngineVersion struct { _ struct{} `type:"structure"` @@ -6388,7 +6388,7 @@ type DBEngineVersion struct { // The description of the database engine version. DBEngineVersionDescription *string `type:"string"` - // The name of the DB parameter group family for the database engine. + // The name of the parameter group family for the database engine. DBParameterGroupFamily *string `type:"string"` // The name of the database engine. @@ -6468,74 +6468,74 @@ func (s *DBEngineVersion) SetValidUpgradeTarget(v []*UpgradeTarget) *DBEngineVer return s } -// Detailed information about a DB instance. +// Detailed information about an instance. type DBInstance struct { _ struct{} `type:"structure"` // Indicates that minor version patches are applied automatically. AutoMinorVersionUpgrade *bool `type:"boolean"` - // Specifies the name of the Availability Zone that the DB instance is located + // Specifies the name of the Availability Zone that the instance is located // in. AvailabilityZone *string `type:"string"` - // Specifies the number of days for which automatic DB snapshots are retained. + // Specifies the number of days for which automatic snapshots are retained. BackupRetentionPeriod *int64 `type:"integer"` // The identifier of the CA certificate for this DB instance. CACertificateIdentifier *string `type:"string"` - // Contains the name of the DB cluster that the DB instance is a member of if - // the DB instance is a member of a DB cluster. + // Contains the name of the cluster that the instance is a member of if the + // instance is a member of a cluster. DBClusterIdentifier *string `type:"string"` - // The Amazon Resource Name (ARN) for the DB instance. + // The Amazon Resource Name (ARN) for the instance. DBInstanceArn *string `type:"string"` - // Contains the name of the compute and memory capacity class of the DB instance. + // Contains the name of the compute and memory capacity class of the instance. DBInstanceClass *string `type:"string"` // Contains a user-provided database identifier. This identifier is the unique - // key that identifies a DB instance. + // key that identifies an instance. DBInstanceIdentifier *string `type:"string"` // Specifies the current state of this database. DBInstanceStatus *string `type:"string"` - // Specifies information on the subnet group that is associated with the DB - // instance, including the name, description, and subnets in the subnet group. + // Specifies information on the subnet group that is associated with the instance, + // including the name, description, and subnets in the subnet group. DBSubnetGroup *DBSubnetGroup `type:"structure"` - // The AWS Region-unique, immutable identifier for the DB instance. This identifier - // is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB - // instance is accessed. + // The AWS Region-unique, immutable identifier for the instance. This identifier + // is found in AWS CloudTrail log entries whenever the AWS KMS key for the instance + // is accessed. DbiResourceId *string `type:"string"` - // A list of log types that this DB instance is configured to export to Amazon + // A list of log types that this instance is configured to export to Amazon // CloudWatch Logs. EnabledCloudwatchLogsExports []*string `type:"list"` // Specifies the connection endpoint. Endpoint *Endpoint `type:"structure"` - // Provides the name of the database engine to be used for this DB instance. + // Provides the name of the database engine to be used for this instance. Engine *string `type:"string"` // Indicates the database engine version. EngineVersion *string `type:"string"` - // Provides the date and time that the DB instance was created. + // Provides the date and time that the instance was created. InstanceCreateTime *time.Time `type:"timestamp"` // If StorageEncrypted is true, the AWS KMS key identifier for the encrypted - // DB instance. + // 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"` - // Specifies that changes to the DB instance are pending. This element is included + // Specifies that changes to the instance are pending. This element is included // only when changes are pending. Specific changes are identified by subelements. PendingModifiedValues *PendingModifiedValues `type:"structure"` @@ -6560,10 +6560,10 @@ type DBInstance struct { // is blank. StatusInfos []*DBInstanceStatusInfo `locationNameList:"DBInstanceStatusInfo" type:"list"` - // Specifies whether or not the DB instance is encrypted. + // Specifies whether or not the instance is encrypted. StorageEncrypted *bool `type:"boolean"` - // Provides a list of VPC security group elements that the DB instance belongs + // Provides a list of VPC security group elements that the instance belongs // to. VpcSecurityGroups []*VpcSecurityGroupMembership `locationNameList:"VpcSecurityGroupMembership" type:"list"` } @@ -6734,7 +6734,7 @@ func (s *DBInstance) SetVpcSecurityGroups(v []*VpcSecurityGroupMembership) *DBIn return s } -// Provides a list of status information for a DB instance. +// Provides a list of status information for an instance. type DBInstanceStatusInfo struct { _ struct{} `type:"structure"` @@ -6746,7 +6746,7 @@ type DBInstanceStatusInfo struct { // 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 + // Status of the instance. For a StatusType of read replica, the values can // be replicating, error, stopped, or terminated. Status *string `type:"string"` @@ -6788,26 +6788,26 @@ func (s *DBInstanceStatusInfo) SetStatusType(v string) *DBInstanceStatusInfo { return s } -// Detailed information about a DB subnet group. +// Detailed information about a subnet group. 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. + // Provides the description of the subnet group. DBSubnetGroupDescription *string `type:"string"` - // The name of the DB subnet group. + // The name of the subnet group. DBSubnetGroupName *string `type:"string"` - // Provides the status of the DB subnet group. + // Provides the status of the subnet group. SubnetGroupStatus *string `type:"string"` - // Detailed information about one or more subnets within a DB subnet group. + // Detailed information about one or more subnets within a subnet group. Subnets []*Subnet `locationNameList:"Subnet" type:"list"` - // Provides the virtual private cloud (VPC) ID of the DB subnet group. + // Provides the virtual private cloud (VPC) ID of the subnet group. VpcId *string `type:"string"` } @@ -6861,8 +6861,8 @@ func (s *DBSubnetGroup) SetVpcId(v string) *DBSubnetGroup { type DeleteDBClusterInput struct { _ struct{} `type:"structure"` - // The DB cluster identifier for the DB cluster to be deleted. This parameter - // isn't case sensitive. + // The cluster identifier for the cluster to be deleted. This parameter isn't + // case sensitive. // // Constraints: // @@ -6871,8 +6871,8 @@ type DeleteDBClusterInput struct { // 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. + // The cluster snapshot identifier of the new cluster snapshot created when + // SkipFinalSnapshot is set to false. // // Specifying this parameter and also setting the SkipFinalShapshot parameter // to true results in an error. @@ -6886,9 +6886,9 @@ type DeleteDBClusterInput struct { // * 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. + // Determines whether a final cluster snapshot is created before the cluster + // is deleted. If true is specified, no cluster snapshot is created. If false + // is specified, a cluster snapshot is created before the DB cluster is deleted. // // If SkipFinalSnapshot is false, you must specify a FinalDBSnapshotIdentifier // parameter. @@ -6941,7 +6941,7 @@ func (s *DeleteDBClusterInput) SetSkipFinalSnapshot(v bool) *DeleteDBClusterInpu type DeleteDBClusterOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB cluster. + // Detailed information about a cluster. DBCluster *DBCluster `type:"structure"` } @@ -6965,15 +6965,15 @@ func (s *DeleteDBClusterOutput) SetDBCluster(v *DBCluster) *DeleteDBClusterOutpu type DeleteDBClusterParameterGroupInput struct { _ struct{} `type:"structure"` - // The name of the DB cluster parameter group. + // The name of the cluster parameter group. // // Constraints: // - // * Must be the name of an existing DB cluster parameter group. + // * Must be the name of an existing cluster parameter group. // - // * You can't delete a default DB cluster parameter group. + // * You can't delete a default cluster parameter group. // - // * Cannot be associated with any DB clusters. + // * Cannot be associated with any clusters. // // DBClusterParameterGroupName is a required field DBClusterParameterGroupName *string `type:"string" required:"true"` @@ -7026,9 +7026,9 @@ func (s DeleteDBClusterParameterGroupOutput) GoString() string { type DeleteDBClusterSnapshotInput struct { _ struct{} `type:"structure"` - // The identifier of the DB cluster snapshot to delete. + // The identifier of the cluster snapshot to delete. // - // Constraints: Must be the name of an existing DB cluster snapshot in the available + // Constraints: Must be the name of an existing cluster snapshot in the available // state. // // DBClusterSnapshotIdentifier is a required field @@ -7067,7 +7067,7 @@ func (s *DeleteDBClusterSnapshotInput) SetDBClusterSnapshotIdentifier(v string) type DeleteDBClusterSnapshotOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB cluster snapshot. + // Detailed information about a cluster snapshot. DBClusterSnapshot *DBClusterSnapshot `type:"structure"` } @@ -7091,12 +7091,12 @@ func (s *DeleteDBClusterSnapshotOutput) SetDBClusterSnapshot(v *DBClusterSnapsho type DeleteDBInstanceInput struct { _ struct{} `type:"structure"` - // The DB instance identifier for the DB instance to be deleted. This parameter - // isn't case sensitive. + // The instance identifier for the instance to be deleted. This parameter isn't + // case sensitive. // // Constraints: // - // * Must match the name of an existing DB instance. + // * Must match the name of an existing instance. // // DBInstanceIdentifier is a required field DBInstanceIdentifier *string `type:"string" required:"true"` @@ -7134,7 +7134,7 @@ func (s *DeleteDBInstanceInput) SetDBInstanceIdentifier(v string) *DeleteDBInsta type DeleteDBInstanceOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB instance. + // Detailed information about an instance. DBInstance *DBInstance `type:"structure"` } @@ -7343,7 +7343,7 @@ func (s *DescribeCertificatesOutput) SetMarker(v string) *DescribeCertificatesOu type DescribeDBClusterParameterGroupsInput struct { _ struct{} `type:"structure"` - // The name of a specific DB cluster parameter group to return details for. + // The name of a specific cluster parameter group to return details for. // // Constraints: // @@ -7426,7 +7426,7 @@ func (s *DescribeDBClusterParameterGroupsInput) SetMaxRecords(v int64) *Describe type DescribeDBClusterParameterGroupsOutput struct { _ struct{} `type:"structure"` - // A list of DB cluster parameter groups. + // A list of cluster parameter groups. DBClusterParameterGroups []*DBClusterParameterGroup `locationNameList:"DBClusterParameterGroup" type:"list"` // An optional pagination token provided by a previous request. If this parameter @@ -7461,7 +7461,7 @@ func (s *DescribeDBClusterParameterGroupsOutput) SetMarker(v string) *DescribeDB type DescribeDBClusterParametersInput struct { _ struct{} `type:"structure"` - // The name of a specific DB cluster parameter group to return parameter details + // The name of a specific cluster parameter group to return parameter details // for. // // Constraints: @@ -7565,7 +7565,7 @@ type DescribeDBClusterParametersOutput struct { // the value specified by MaxRecords. Marker *string `type:"string"` - // Provides a list of parameters for the DB cluster parameter group. + // Provides a list of parameters for the cluster parameter group. Parameters []*Parameter `locationNameList:"Parameter" type:"list"` } @@ -7595,7 +7595,7 @@ func (s *DescribeDBClusterParametersOutput) SetParameters(v []*Parameter) *Descr type DescribeDBClusterSnapshotAttributesInput struct { _ struct{} `type:"structure"` - // The identifier for the DB cluster snapshot to describe the attributes for. + // The identifier for the cluster snapshot to describe the attributes for. // // DBClusterSnapshotIdentifier is a required field DBClusterSnapshotIdentifier *string `type:"string" required:"true"` @@ -7633,7 +7633,7 @@ func (s *DescribeDBClusterSnapshotAttributesInput) SetDBClusterSnapshotIdentifie type DescribeDBClusterSnapshotAttributesOutput struct { _ struct{} `type:"structure"` - // Detailed information about the attributes that are associated with a DB cluster + // Detailed information about the attributes that are associated with a cluster // snapshot. DBClusterSnapshotAttributesResult *DBClusterSnapshotAttributesResult `type:"structure"` } @@ -7658,16 +7658,16 @@ func (s *DescribeDBClusterSnapshotAttributesOutput) SetDBClusterSnapshotAttribut type DescribeDBClusterSnapshotsInput struct { _ struct{} `type:"structure"` - // The ID of the DB cluster to retrieve the list of DB cluster snapshots for. - // This parameter can't be used with the DBClusterSnapshotIdentifier parameter. - // This parameter is not case sensitive. + // The ID of the cluster to retrieve the list of cluster snapshots for. This + // parameter can't be used with the DBClusterSnapshotIdentifier parameter. This + // parameter is not case sensitive. // // Constraints: // // * If provided, must match the identifier of an existing DBCluster. DBClusterIdentifier *string `type:"string"` - // A specific DB cluster snapshot identifier to describe. This parameter can't + // A specific cluster snapshot identifier to describe. This parameter can't // be used with the DBClusterIdentifier parameter. This value is stored as a // lowercase string. // @@ -7682,14 +7682,14 @@ type DescribeDBClusterSnapshotsInput struct { // This parameter is not currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` - // Set to true to include manual DB cluster snapshots that are public and can - // be copied or restored by any AWS account, and otherwise false. The default - // is false. + // Set to true to include manual cluster snapshots that are public and can be + // copied or restored by any AWS account, and otherwise false. The default is + // false. IncludePublic *bool `type:"boolean"` - // Set 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, - // and otherwise false. The default is false. + // Set to true to include shared manual cluster snapshots from other AWS accounts + // that this AWS account has been given permission to copy or restore, and otherwise + // false. The default is false. IncludeShared *bool `type:"boolean"` // An optional pagination token provided by a previous request. If this parameter @@ -7706,24 +7706,24 @@ type DescribeDBClusterSnapshotsInput struct { // Constraints: Minimum 20, maximum 100. MaxRecords *int64 `type:"integer"` - // The type of DB cluster snapshots to be returned. You can specify one of the + // The type of cluster snapshots to be returned. You can specify one of the // following values: // - // * automated - Return all DB cluster snapshots that Amazon DocumentDB has + // * automated - Return all cluster snapshots that Amazon DocumentDB has // automatically created for your AWS account. // - // * manual - Return all DB cluster snapshots that you have manually created + // * manual - Return all cluster snapshots that you have manually created // for your AWS account. // - // * shared - Return all manual DB cluster snapshots that have been shared - // to your AWS account. + // * shared - Return all manual cluster snapshots that have been shared to + // your AWS account. // - // * public - Return all DB cluster snapshots that have been marked as public. + // * public - Return all 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 + // cluster snapshots are returned. You can include shared 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 + // include public cluster snapshots with these results by setting the IncludePublic // parameter to true. // // The IncludeShared and IncludePublic parameters don't apply for SnapshotType @@ -7815,7 +7815,7 @@ func (s *DescribeDBClusterSnapshotsInput) SetSnapshotType(v string) *DescribeDBC type DescribeDBClusterSnapshotsOutput struct { _ struct{} `type:"structure"` - // Provides a list of DB cluster snapshots. + // Provides a list of cluster snapshots. DBClusterSnapshots []*DBClusterSnapshot `locationNameList:"DBClusterSnapshot" type:"list"` // An optional pagination token provided by a previous request. If this parameter @@ -7850,22 +7850,21 @@ func (s *DescribeDBClusterSnapshotsOutput) SetMarker(v string) *DescribeDBCluste type DescribeDBClustersInput struct { _ struct{} `type:"structure"` - // The user-provided DB cluster identifier. If this parameter is specified, - // information from only the specific DB cluster is returned. This parameter - // isn't case sensitive. + // The user-provided cluster identifier. If this parameter is specified, information + // from only the specific cluster is returned. This parameter isn't case sensitive. // // Constraints: // // * If provided, must match an existing DBClusterIdentifier. DBClusterIdentifier *string `type:"string"` - // A filter that specifies one or more DB clusters to describe. + // A filter that specifies one or more clusters to describe. // // Supported filters: // - // * db-cluster-id - Accepts DB cluster identifiers and DB cluster Amazon - // Resource Names (ARNs). The results list only includes information about - // the DB clusters identified by these ARNs. + // * db-cluster-id - Accepts cluster identifiers and cluster Amazon Resource + // Names (ARNs). The results list only includes information about the clusters + // identified by these ARNs. Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous request. If this parameter @@ -7941,7 +7940,7 @@ func (s *DescribeDBClustersInput) SetMaxRecords(v int64) *DescribeDBClustersInpu type DescribeDBClustersOutput struct { _ struct{} `type:"structure"` - // A list of DB clusters. + // A list of clusters. DBClusters []*DBCluster `locationNameList:"DBCluster" type:"list"` // An optional pagination token provided by a previous request. If this parameter @@ -7976,7 +7975,7 @@ func (s *DescribeDBClustersOutput) SetMarker(v string) *DescribeDBClustersOutput type DescribeDBEngineVersionsInput struct { _ struct{} `type:"structure"` - // The name of a specific DB parameter group family to return details for. + // The name of a specific parameter group family to return details for. // // Constraints: // @@ -8111,7 +8110,7 @@ func (s *DescribeDBEngineVersionsInput) SetMaxRecords(v int64) *DescribeDBEngine type DescribeDBEngineVersionsOutput struct { _ struct{} `type:"structure"` - // Detailed information about one or more DB engine versions. + // Detailed information about one or more engine versions. DBEngineVersions []*DBEngineVersion `locationNameList:"DBEngineVersion" type:"list"` // An optional pagination token provided by a previous request. If this parameter @@ -8147,26 +8146,25 @@ type DescribeDBInstancesInput struct { _ struct{} `type:"structure"` // The user-provided instance identifier. If this parameter is specified, information - // from only the specific DB instance is returned. This parameter isn't case - // sensitive. + // from only the specific instance is returned. This parameter isn't case sensitive. // // Constraints: // // * If provided, must match the identifier of an existing DBInstance. DBInstanceIdentifier *string `type:"string"` - // A filter that specifies one or more DB instances to describe. + // A filter that specifies one or more instances to describe. // // Supported filters: // - // * db-cluster-id - Accepts DB cluster identifiers and DB cluster Amazon - // Resource Names (ARNs). The results list includes only the information - // about the DB instances that are associated with the DB clusters that are - // identified by these ARNs. + // * db-cluster-id - Accepts cluster identifiers and cluster Amazon Resource + // Names (ARNs). The results list includes only the information about the + // instances that are associated with the clusters that are identified by + // these ARNs. // - // * db-instance-id - Accepts DB instance identifiers and DB instance ARNs. - // The results list includes only the information about the DB instances - // that are identified by these ARNs. + // * db-instance-id - Accepts instance identifiers and instance ARNs. The + // results list includes only the information about the instances that are + // identified by these ARNs. Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous request. If this parameter @@ -8242,7 +8240,7 @@ func (s *DescribeDBInstancesInput) SetMaxRecords(v int64) *DescribeDBInstancesIn type DescribeDBInstancesOutput struct { _ struct{} `type:"structure"` - // Detailed information about one or more DB instances. + // Detailed information about one or more instances. DBInstances []*DBInstance `locationNameList:"DBInstance" type:"list"` // An optional pagination token provided by a previous request. If this parameter @@ -8277,7 +8275,7 @@ func (s *DescribeDBInstancesOutput) SetMarker(v string) *DescribeDBInstancesOutp type DescribeDBSubnetGroupsInput struct { _ struct{} `type:"structure"` - // The name of the DB subnet group to return details for. + // The name of the subnet group to return details for. DBSubnetGroupName *string `type:"string"` // This parameter is not currently supported. @@ -8356,7 +8354,7 @@ func (s *DescribeDBSubnetGroupsInput) SetMaxRecords(v int64) *DescribeDBSubnetGr type DescribeDBSubnetGroupsOutput struct { _ struct{} `type:"structure"` - // Detailed information about one or more DB subnet groups. + // Detailed information about one or more subnet groups. DBSubnetGroups []*DBSubnetGroup `locationNameList:"DBSubnetGroup" type:"list"` // An optional pagination token provided by a previous request. If this parameter @@ -8391,7 +8389,7 @@ func (s *DescribeDBSubnetGroupsOutput) SetMarker(v string) *DescribeDBSubnetGrou type DescribeEngineDefaultClusterParametersInput struct { _ struct{} `type:"structure"` - // The name of the DB cluster parameter group family to return the engine parameter + // The name of the cluster parameter group family to return the engine parameter // information for. // // DBParameterGroupFamily is a required field @@ -8765,11 +8763,11 @@ func (s *DescribeEventsOutput) SetMarker(v string) *DescribeEventsOutput { type DescribeOrderableDBInstanceOptionsInput struct { _ struct{} `type:"structure"` - // The DB instance class filter value. Specify this parameter to show only the - // available offerings that match the specified DB instance class. + // The instance class filter value. Specify this parameter to show only the + // available offerings that match the specified instance class. DBInstanceClass *string `type:"string"` - // The name of the engine to retrieve DB instance options for. + // The name of the engine to retrieve instance options for. // // Engine is a required field Engine *string `type:"string" required:"true"` @@ -8894,7 +8892,7 @@ type DescribeOrderableDBInstanceOptionsOutput struct { // the value specified by MaxRecords. Marker *string `type:"string"` - // The options that are available for a particular orderable DB instance. + // The options that are available for a particular orderable instance. OrderableDBInstanceOptions []*OrderableDBInstanceOption `locationNameList:"OrderableDBInstanceOption" type:"list"` } @@ -8929,13 +8927,13 @@ type DescribePendingMaintenanceActionsInput struct { // // Supported filters: // - // * db-cluster-id - Accepts DB cluster identifiers and DB cluster Amazon - // Resource Names (ARNs). The results list includes only pending maintenance - // actions for the DB clusters identified by these ARNs. + // * db-cluster-id - Accepts cluster identifiers and cluster Amazon Resource + // Names (ARNs). The results list includes only pending maintenance actions + // for the clusters identified by these ARNs. // - // * db-instance-id - Accepts DB instance identifiers and DB instance ARNs. - // The results list includes only pending maintenance actions for the DB - // instances identified by these ARNs. + // * db-instance-id - Accepts instance identifiers and instance ARNs. The + // results list includes only 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 request. If this parameter @@ -9045,12 +9043,12 @@ func (s *DescribePendingMaintenanceActionsOutput) SetPendingMaintenanceActions(v return s } -// Network information for accessing a DB cluster or DB instance. Client programs +// Network information for accessing a cluster or instance. Client programs // must specify a valid endpoint to access these Amazon DocumentDB resources. type Endpoint struct { _ struct{} `type:"structure"` - // Specifies the DNS address of the DB instance. + // Specifies the DNS address of the instance. Address *string `type:"string"` // Specifies the ID that Amazon Route 53 assigns when you create a hosted zone. @@ -9093,7 +9091,7 @@ func (s *Endpoint) SetPort(v int64) *Endpoint { type EngineDefaults struct { _ struct{} `type:"structure"` - // The name of the DB cluster parameter group family to return the engine parameter + // The name of the cluster parameter group family to return the engine parameter // information for. DBParameterGroupFamily *string `type:"string"` @@ -9102,7 +9100,7 @@ type EngineDefaults struct { // the value specified by MaxRecords. Marker *string `type:"string"` - // The parameters of a particular DB cluster parameter group family. + // The parameters of a particular cluster parameter group family. Parameters []*Parameter `locationNameList:"Parameter" type:"list"` } @@ -9240,7 +9238,7 @@ func (s *EventCategoriesMap) SetSourceType(v string) *EventCategoriesMap { type FailoverDBClusterInput struct { _ struct{} `type:"structure"` - // A DB cluster identifier to force a failover for. This parameter is not case + // A cluster identifier to force a failover for. This parameter is not case // sensitive. // // Constraints: @@ -9251,7 +9249,7 @@ type FailoverDBClusterInput struct { // The name of the instance to promote to the primary instance. // // You must specify the instance identifier for an Amazon DocumentDB replica - // in the DB cluster. For example, mydbcluster-replica1. + // in the cluster. For example, mydbcluster-replica1. TargetDBInstanceIdentifier *string `type:"string"` } @@ -9280,7 +9278,7 @@ func (s *FailoverDBClusterInput) SetTargetDBInstanceIdentifier(v string) *Failov type FailoverDBClusterOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB cluster. + // Detailed information about a cluster. DBCluster *DBCluster `type:"structure"` } @@ -9446,8 +9444,8 @@ type ModifyDBClusterInput struct { // A value that specifies whether the changes in this request and any pending // changes 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 + // PreferredMaintenanceWindow setting for the cluster. If this parameter is + // set to false, changes to the cluster are applied during the next maintenance // window. // // The ApplyImmediately parameter affects only the NewDBClusterIdentifier and @@ -9470,12 +9468,12 @@ type ModifyDBClusterInput struct { BackupRetentionPeriod *int64 `type:"integer"` // The configuration setting for the log types to be enabled for export to Amazon - // CloudWatch Logs for a specific DB instance or DB cluster. The EnableLogTypes - // and DisableLogTypes arrays determine which logs are exported (or not exported) + // CloudWatch Logs for a specific instance or cluster. The EnableLogTypes and + // DisableLogTypes arrays determine which logs are exported (or not exported) // to CloudWatch Logs. CloudwatchLogsExportConfiguration *CloudwatchLogsExportConfiguration `type:"structure"` - // The DB cluster identifier for the cluster that is being modified. This parameter + // The cluster identifier for the cluster that is being modified. This parameter // is not case sensitive. // // Constraints: @@ -9485,7 +9483,7 @@ type ModifyDBClusterInput struct { // 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. + // The name of the cluster parameter group to use for the cluster. DBClusterParameterGroupName *string `type:"string"` // Specifies whether this cluster can be deleted. If DeletionProtection is enabled, @@ -9506,8 +9504,8 @@ type ModifyDBClusterInput struct { // Constraints: Must contain from 8 to 100 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. + // The new cluster identifier for the cluster when renaming a cluster. This + // value is stored as a lowercase string. // // Constraints: // @@ -9520,11 +9518,11 @@ type ModifyDBClusterInput struct { // Example: my-cluster2 NewDBClusterIdentifier *string `type:"string"` - // The port number on which the DB cluster accepts connections. + // The port number on which the cluster accepts connections. // // Constraints: Must be a value from 1150 to 65535. // - // Default: The same port as the original DB cluster. + // Default: The same port as the original cluster. Port *int64 `type:"integer"` // The daily time range during which automated backups are created if automated @@ -9557,8 +9555,8 @@ type ModifyDBClusterInput struct { // Constraints: Minimum 30-minute window. PreferredMaintenanceWindow *string `type:"string"` - // A list of virtual private cloud (VPC) security groups that the DB cluster - // will belong to. + // A list of virtual private cloud (VPC) security groups that the cluster will + // belong to. VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` } @@ -9666,7 +9664,7 @@ func (s *ModifyDBClusterInput) SetVpcSecurityGroupIds(v []*string) *ModifyDBClus type ModifyDBClusterOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB cluster. + // Detailed information about a cluster. DBCluster *DBCluster `type:"structure"` } @@ -9690,12 +9688,12 @@ func (s *ModifyDBClusterOutput) SetDBCluster(v *DBCluster) *ModifyDBClusterOutpu type ModifyDBClusterParameterGroupInput struct { _ struct{} `type:"structure"` - // The name of the DB cluster parameter group to modify. + // The name of the 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. + // A list of parameters in the cluster parameter group to modify. // // Parameters is a required field Parameters []*Parameter `locationNameList:"Parameter" type:"list" required:"true"` @@ -9739,11 +9737,11 @@ func (s *ModifyDBClusterParameterGroupInput) SetParameters(v []*Parameter) *Modi return s } -// Contains the name of a DB cluster parameter group. +// Contains the name of a cluster parameter group. type ModifyDBClusterParameterGroupOutput struct { _ struct{} `type:"structure"` - // The name of a DB cluster parameter group. + // The name of a cluster parameter group. // // Constraints: // @@ -9777,38 +9775,38 @@ func (s *ModifyDBClusterParameterGroupOutput) SetDBClusterParameterGroupName(v s type ModifyDBClusterSnapshotAttributeInput struct { _ struct{} `type:"structure"` - // The name of the DB cluster snapshot attribute to modify. + // The name of the 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. + // 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. + // The identifier for the 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. + // A list of 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, + // To authorize other AWS accounts to copy or restore a manual cluster snapshot, // set this list to include one or more AWS account IDs. To make the manual - // DB cluster snapshot restorable by any AWS account, set it to all. Do not - // add the all value for any manual DB cluster snapshots that contain private - // information that you don't want to be available to all AWS accounts. + // cluster snapshot restorable by any AWS account, set it to all. Do not add + // the all value for any manual cluster snapshots that contain private information + // that you don't want to be available to all AWS accounts. ValuesToAdd []*string `locationNameList:"AttributeValue" type:"list"` - // A list of DB cluster snapshot attributes to remove from the attribute specified + // A list of 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. - // To remove authorization for any AWS account to copy or restore the DB cluster + // cluster snapshot, set this list to include one or more AWS account identifiers. + // To remove authorization for any AWS account to copy or restore the cluster // snapshot, set it to all . 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. + // a manual cluster snapshot. ValuesToRemove []*string `locationNameList:"AttributeValue" type:"list"` } @@ -9865,7 +9863,7 @@ func (s *ModifyDBClusterSnapshotAttributeInput) SetValuesToRemove(v []*string) * type ModifyDBClusterSnapshotAttributeOutput struct { _ struct{} `type:"structure"` - // Detailed information about the attributes that are associated with a DB cluster + // Detailed information about the attributes that are associated with a cluster // snapshot. DBClusterSnapshotAttributesResult *DBClusterSnapshotAttributesResult `type:"structure"` } @@ -9892,18 +9890,18 @@ type ModifyDBInstanceInput struct { // 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. + // setting for the 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 are applied on the next reboot. + // If this parameter is set to false, changes to the instance are applied during + // the next maintenance window. Some parameter changes can cause an outage and + // are applied on the next reboot. // // Default: false ApplyImmediately *bool `type:"boolean"` - // Indicates that minor version upgrades are applied automatically to the DB - // instance during the maintenance window. Changing this parameter doesn't result - // in an outage except in the following case, and the change is asynchronously + // Indicates that minor version upgrades are applied automatically to the instance + // during the maintenance window. Changing this parameter doesn't result in + // an outage except in the following case, and the change is asynchronously // applied as soon as possible. An outage results if this parameter is set to // true during the maintenance window, and a newer minor version is available, // and Amazon DocumentDB has enabled automatic patching for that engine version. @@ -9912,17 +9910,17 @@ type ModifyDBInstanceInput struct { // Indicates the certificate that needs to be associated with the instance. CACertificateIdentifier *string `type:"string"` - // The new compute and memory capacity of the DB instance; for example, db.r5.large. - // Not all DB instance classes are available in all AWS Regions. + // The new compute and memory capacity of the instance; for example, db.r5.large. + // Not all instance classes are available in all AWS Regions. // - // If you modify the DB instance class, an outage occurs during the change. - // The change is applied during the next maintenance window, unless ApplyImmediately + // If you modify the instance class, an outage occurs during the change. The + // change is applied during the next maintenance window, unless ApplyImmediately // is specified as true for this request. // // Default: Uses existing setting. DBInstanceClass *string `type:"string"` - // The DB instance identifier. This value is stored as a lowercase string. + // The instance identifier. This value is stored as a lowercase string. // // Constraints: // @@ -9931,8 +9929,8 @@ type ModifyDBInstanceInput struct { // DBInstanceIdentifier is a required field DBInstanceIdentifier *string `type:"string" required:"true"` - // The new DB instance identifier for the DB instance when renaming a DB instance. - // When you change the DB instance identifier, an instance reboot occurs immediately + // The new instance identifier for the instance when renaming an instance. When + // you change the instance identifier, an instance reboot occurs immediately // if you set Apply Immediately to true. It occurs during the next maintenance // window if you set Apply Immediately to false. This value is stored as a lowercase // string. @@ -9953,9 +9951,9 @@ type ModifyDBInstanceInput struct { // 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, changing - // this parameter causes a reboot of the DB instance. If you are 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 that pending changes are applied. + // this parameter causes a reboot of the instance. If you are 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 that pending changes are applied. // // Default: Uses existing setting. // @@ -10050,7 +10048,7 @@ func (s *ModifyDBInstanceInput) SetPromotionTier(v int64) *ModifyDBInstanceInput type ModifyDBInstanceOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB instance. + // Detailed information about an instance. DBInstance *DBInstance `type:"structure"` } @@ -10074,10 +10072,10 @@ func (s *ModifyDBInstanceOutput) SetDBInstance(v *DBInstance) *ModifyDBInstanceO type ModifyDBSubnetGroupInput struct { _ struct{} `type:"structure"` - // The description for the DB subnet group. + // The description for the subnet group. DBSubnetGroupDescription *string `type:"string"` - // The name for the DB subnet group. This value is stored as a lowercase string. + // The name for the subnet group. This value is stored as a lowercase string. // You can't modify the default subnet group. // // Constraints: Must match the name of an existing DBSubnetGroup. Must not be @@ -10088,7 +10086,7 @@ type ModifyDBSubnetGroupInput struct { // DBSubnetGroupName is a required field DBSubnetGroupName *string `type:"string" required:"true"` - // The Amazon EC2 subnet IDs for the DB subnet group. + // The Amazon EC2 subnet IDs for the subnet group. // // SubnetIds is a required field SubnetIds []*string `locationNameList:"SubnetIdentifier" type:"list" required:"true"` @@ -10141,7 +10139,7 @@ func (s *ModifyDBSubnetGroupInput) SetSubnetIds(v []*string) *ModifyDBSubnetGrou type ModifyDBSubnetGroupOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB subnet group. + // Detailed information about a subnet group. DBSubnetGroup *DBSubnetGroup `type:"structure"` } @@ -10161,26 +10159,26 @@ func (s *ModifyDBSubnetGroupOutput) SetDBSubnetGroup(v *DBSubnetGroup) *ModifyDB return s } -// The options that are available for a DB instance. +// The options that are available for an instance. type OrderableDBInstanceOption struct { _ struct{} `type:"structure"` - // A list of Availability Zones for a DB instance. + // A list of Availability Zones for an instance. AvailabilityZones []*AvailabilityZone `locationNameList:"AvailabilityZone" type:"list"` - // The DB instance class for a DB instance. + // The instance class for an instance. DBInstanceClass *string `type:"string"` - // The engine type of a DB instance. + // The engine type of an instance. Engine *string `type:"string"` - // The engine version of a DB instance. + // The engine version of an instance. EngineVersion *string `type:"string"` - // The license model for a DB instance. + // The license model for an instance. LicenseModel *string `type:"string"` - // Indicates whether a DB instance is in a virtual private cloud (VPC). + // Indicates whether an instance is in a virtual private cloud (VPC). Vpc *bool `type:"boolean"` } @@ -10449,12 +10447,12 @@ func (s *PendingMaintenanceAction) SetOptInStatus(v string) *PendingMaintenanceA return s } -// One or more modified settings for a DB instance. These modified settings -// have been requested, but haven't been applied yet. +// One or more modified settings for an instance. These modified settings have +// been requested, but haven't been applied yet. type PendingModifiedValues struct { _ struct{} `type:"structure"` - // Contains the new AllocatedStorage size for the DB instance that will be applied + // Contains the new AllocatedStorage size for then instance that will be applied // or is currently being applied. AllocatedStorage *int64 `type:"integer"` @@ -10465,44 +10463,44 @@ type PendingModifiedValues struct { // the DB instance. CACertificateIdentifier *string `type:"string"` - // Contains the new DBInstanceClass for the DB instance that will be applied - // or is currently being applied. + // Contains the new DBInstanceClass for the instance that will be applied or + // is currently being applied. DBInstanceClass *string `type:"string"` - // Contains the new DBInstanceIdentifier for the DB instance that will be applied + // Contains the new DBInstanceIdentifier for the instance that will be applied // or is currently being applied. DBInstanceIdentifier *string `type:"string"` - // The new DB subnet group for the DB instance. + // The new subnet group for the 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 currently being applied. + // Specifies the new Provisioned IOPS value for the instance that will be applied + // or is currently being applied. Iops *int64 `type:"integer"` - // The license model for the DB instance. + // The license model for the instance. // // Valid values: license-included, bring-your-own-license, general-public-license LicenseModel *string `type:"string"` // Contains the pending or currently in-progress change of the master credentials - // for the DB instance. + // for the instance. MasterUserPassword *string `type:"string"` - // Indicates that the Single-AZ DB instance is to change to a Multi-AZ deployment. + // Indicates that the Single-AZ instance is to change to a Multi-AZ deployment. MultiAZ *bool `type:"boolean"` // A list of the log types whose configuration is still pending. These log types // are in the process of being activated or deactivated. PendingCloudwatchLogsExports *PendingCloudwatchLogsExports `type:"structure"` - // Specifies the pending port for the DB instance. + // Specifies the pending port for the instance. Port *int64 `type:"integer"` - // Specifies the storage type to be associated with the DB instance. + // Specifies the storage type to be associated with the instance. StorageType *string `type:"string"` } @@ -10604,7 +10602,7 @@ func (s *PendingModifiedValues) SetStorageType(v string) *PendingModifiedValues type RebootDBInstanceInput struct { _ struct{} `type:"structure"` - // The DB instance identifier. This parameter is stored as a lowercase string. + // The instance identifier. This parameter is stored as a lowercase string. // // Constraints: // @@ -10658,7 +10656,7 @@ func (s *RebootDBInstanceInput) SetForceFailover(v bool) *RebootDBInstanceInput type RebootDBInstanceOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB instance. + // Detailed information about an instance. DBInstance *DBInstance `type:"structure"` } @@ -10750,17 +10748,17 @@ func (s RemoveTagsFromResourceOutput) GoString() string { type ResetDBClusterParameterGroupInput struct { _ struct{} `type:"structure"` - // The name of the DB cluster parameter group to reset. + // The name of the 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 + // A list of parameter names in the cluster parameter group to reset to the // default values. You can't 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 + // A value that is set to true to reset all parameters in the cluster parameter // group to their default values, and false otherwise. You can't use this parameter // if there is a list of parameter names specified for the Parameters parameter. ResetAllParameters *bool `type:"boolean"` @@ -10807,11 +10805,11 @@ func (s *ResetDBClusterParameterGroupInput) SetResetAllParameters(v bool) *Reset return s } -// Contains the name of a DB cluster parameter group. +// Contains the name of a cluster parameter group. type ResetDBClusterParameterGroupOutput struct { _ struct{} `type:"structure"` - // The name of a DB cluster parameter group. + // The name of a cluster parameter group. // // Constraints: // @@ -10884,7 +10882,7 @@ type RestoreDBClusterFromSnapshotInput struct { // restored DB cluster can be created in. AvailabilityZones []*string `locationNameList:"AvailabilityZone" type:"list"` - // The name of the DB cluster to create from the DB snapshot or DB cluster snapshot. + // The name of the cluster to create from the snapshot or cluster snapshot. // This parameter isn't case sensitive. // // Constraints: @@ -10900,7 +10898,7 @@ type RestoreDBClusterFromSnapshotInput struct { // 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. + // The name of the subnet group to use for the new cluster. // // Constraints: If provided, must match the name of an existing DBSubnetGroup. // @@ -10917,7 +10915,7 @@ type RestoreDBClusterFromSnapshotInput struct { // Logs. EnableCloudwatchLogsExports []*string `type:"list"` - // The database engine to use for the new DB cluster. + // The database engine to use for the new cluster. // // Default: The same as source. // @@ -10926,41 +10924,40 @@ type RestoreDBClusterFromSnapshotInput struct { // Engine is a required field Engine *string `type:"string" required:"true"` - // The version of the database engine to use for the new DB cluster. + // The version of the database engine to use for the new cluster. EngineVersion *string `type:"string"` - // The AWS KMS key identifier to use when restoring an encrypted DB cluster - // from a DB snapshot or DB cluster snapshot. + // The AWS KMS key identifier to use when restoring an encrypted cluster from + // a DB snapshot or cluster snapshot. // // The AWS KMS key identifier is the Amazon Resource Name (ARN) for the AWS - // KMS encryption key. If you are restoring a DB cluster with the same AWS account - // that owns the AWS KMS encryption key used to encrypt the new DB cluster, - // then you can use the AWS KMS key alias instead of the ARN for the AWS KMS - // encryption key. + // KMS encryption key. If you are restoring a cluster with the same AWS account + // that owns the AWS KMS encryption key used to encrypt the new cluster, then + // you can use the AWS KMS key alias instead of the ARN for the AWS KMS encryption + // key. // // If you do not specify a value for the KmsKeyId parameter, then the following // occurs: // - // * If the DB snapshot or DB cluster snapshot in SnapshotIdentifier is encrypted, - // then the restored DB cluster is encrypted using the AWS KMS key that was - // used to encrypt the DB snapshot or the DB cluster snapshot. + // * If the snapshot or cluster snapshot in SnapshotIdentifier is encrypted, + // then the restored cluster is encrypted using the AWS KMS key that was + // used to encrypt the snapshot or the cluster snapshot. // - // * If the DB snapshot or the DB cluster snapshot in SnapshotIdentifier - // is not encrypted, then the restored DB cluster is not encrypted. + // * If the snapshot or the cluster snapshot in SnapshotIdentifier is not + // encrypted, then the restored DB cluster is not encrypted. KmsKeyId *string `type:"string"` - // The port number on which the new DB cluster accepts connections. + // The port number on which the new cluster accepts connections. // // Constraints: Must be a value from 1150 to 65535. // - // Default: The same port as the original DB cluster. + // Default: The same port as the original cluster. Port *int64 `type:"integer"` - // The identifier for the DB snapshot or DB cluster snapshot to restore from. + // The identifier for the snapshot or cluster snapshot to restore from. // // You can use either the name or the Amazon Resource Name (ARN) to specify - // a DB cluster snapshot. However, you can use only the ARN to specify a DB - // snapshot. + // a cluster snapshot. However, you can use only the ARN to specify a snapshot. // // Constraints: // @@ -10969,10 +10966,10 @@ type RestoreDBClusterFromSnapshotInput struct { // SnapshotIdentifier is a required field SnapshotIdentifier *string `type:"string" required:"true"` - // The tags to be assigned to the restored DB cluster. + // The tags to be assigned to the restored cluster. Tags []*Tag `locationNameList:"Tag" type:"list"` - // A list of virtual private cloud (VPC) security groups that the new DB cluster + // A list of virtual private cloud (VPC) security groups that the new cluster // will belong to. VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` } @@ -11081,7 +11078,7 @@ func (s *RestoreDBClusterFromSnapshotInput) SetVpcSecurityGroupIds(v []*string) type RestoreDBClusterFromSnapshotOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB cluster. + // Detailed information about a cluster. DBCluster *DBCluster `type:"structure"` } @@ -11105,7 +11102,7 @@ func (s *RestoreDBClusterFromSnapshotOutput) SetDBCluster(v *DBCluster) *Restore type RestoreDBClusterToPointInTimeInput struct { _ struct{} `type:"structure"` - // The name of the new DB cluster to be created. + // The name of the new cluster to be created. // // Constraints: // @@ -11118,7 +11115,7 @@ type RestoreDBClusterToPointInTimeInput struct { // DBClusterIdentifier is a required field DBClusterIdentifier *string `type:"string" required:"true"` - // The DB subnet group name to use for the new DB cluster. + // The subnet group name to use for the new cluster. // // Constraints: If provided, must match the name of an existing DBSubnetGroup. // @@ -11135,47 +11132,46 @@ type RestoreDBClusterToPointInTimeInput struct { // Logs. EnableCloudwatchLogsExports []*string `type:"list"` - // The AWS KMS key identifier to use when restoring an encrypted DB cluster - // from an encrypted DB cluster. + // The AWS KMS key identifier to use when restoring an encrypted cluster from + // an encrypted cluster. // // The AWS KMS key identifier is the Amazon Resource Name (ARN) for the AWS - // KMS encryption key. If you are restoring a DB cluster with the same AWS account - // that owns the AWS KMS encryption key used to encrypt the new DB cluster, - // then you can use the AWS KMS key alias instead of the ARN for the AWS KMS - // encryption key. - // - // You can restore to a new DB cluster and encrypt the new DB cluster with an - // AWS KMS key that is different from the AWS KMS key used to encrypt the source - // DB cluster. The new DB cluster is encrypted with the AWS KMS key identified + // KMS encryption key. If you are restoring a cluster with the same AWS account + // that owns the AWS KMS encryption key used to encrypt the new cluster, then + // you can use the AWS KMS key alias instead of the ARN for the AWS KMS encryption + // key. + // + // You can restore to a new cluster and encrypt the new cluster with an AWS + // KMS key that is different from the AWS KMS key used to encrypt the source + // cluster. The new DB cluster is encrypted with the AWS KMS key identified // by the KmsKeyId parameter. // // If you do not specify a value for the KmsKeyId parameter, then the following // occurs: // - // * If the DB cluster is encrypted, then the restored DB cluster is encrypted - // using the AWS KMS key that was used to encrypt the source DB cluster. + // * If the cluster is encrypted, then the restored cluster is encrypted + // using the AWS KMS key that was used to encrypt the source cluster. // - // * If the DB cluster is not encrypted, then the restored DB cluster is - // not encrypted. + // * If the cluster is not encrypted, then the restored cluster is not encrypted. // - // If DBClusterIdentifier refers to a DB cluster that is not encrypted, then - // the restore request is rejected. + // If DBClusterIdentifier refers to a cluster that is not encrypted, then the + // restore request is rejected. KmsKeyId *string `type:"string"` - // The port number on which the new DB cluster accepts connections. + // The port number on which the new cluster accepts connections. // // Constraints: Must be a value from 1150 to 65535. // // Default: The default port for the engine. Port *int64 `type:"integer"` - // The date and time to restore the DB cluster to. + // The date and time to restore the cluster to. // // Valid values: A time in Universal Coordinated Time (UTC) format. // // Constraints: // - // * Must be before the latest restorable time for the DB instance. + // * Must be before the latest restorable time for the instance. // // * Must be specified if the UseLatestRestorableTime parameter is not provided. // @@ -11186,7 +11182,7 @@ type RestoreDBClusterToPointInTimeInput struct { // Example: 2015-03-07T23:45:00Z RestoreToTime *time.Time `type:"timestamp"` - // The identifier of the source DB cluster from which to restore. + // The identifier of the source cluster from which to restore. // // Constraints: // @@ -11195,10 +11191,10 @@ type RestoreDBClusterToPointInTimeInput struct { // SourceDBClusterIdentifier is a required field SourceDBClusterIdentifier *string `type:"string" required:"true"` - // The tags to be assigned to the restored DB cluster. + // The tags to be assigned to the restored cluster. Tags []*Tag `locationNameList:"Tag" type:"list"` - // A value that is set to true to restore the DB cluster to the latest restorable + // A value that is set to true to restore the cluster to the latest restorable // backup time, and false otherwise. // // Default: false @@ -11206,7 +11202,7 @@ type RestoreDBClusterToPointInTimeInput struct { // Constraints: Cannot be specified if the RestoreToTime parameter is provided. UseLatestRestorableTime *bool `type:"boolean"` - // A list of VPC security groups that the new DB cluster belongs to. + // A list of VPC security groups that the new cluster belongs to. VpcSecurityGroupIds []*string `locationNameList:"VpcSecurityGroupId" type:"list"` } @@ -11305,7 +11301,7 @@ func (s *RestoreDBClusterToPointInTimeInput) SetVpcSecurityGroupIds(v []*string) type RestoreDBClusterToPointInTimeOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB cluster. + // Detailed information about a cluster. DBCluster *DBCluster `type:"structure"` } @@ -11366,7 +11362,7 @@ func (s *StartDBClusterInput) SetDBClusterIdentifier(v string) *StartDBClusterIn type StartDBClusterOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB cluster. + // Detailed information about a cluster. DBCluster *DBCluster `type:"structure"` } @@ -11427,7 +11423,7 @@ func (s *StopDBClusterInput) SetDBClusterIdentifier(v string) *StopDBClusterInpu type StopDBClusterOutput struct { _ struct{} `type:"structure"` - // Detailed information about a DB cluster. + // Detailed information about a cluster. DBCluster *DBCluster `type:"structure"` } @@ -11529,7 +11525,7 @@ func (s *Tag) SetValue(v string) *Tag { return s } -// The version of the database engine that a DB instance can be upgraded to. +// The version of the database engine that an instance can be upgraded to. type UpgradeTarget struct { _ struct{} `type:"structure"` @@ -11537,7 +11533,7 @@ type UpgradeTarget struct { // 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. + // The version of the database engine that an instance can be upgraded to. Description *string `type:"string"` // The name of the upgrade target database engine. diff --git a/vendor/github.com/aws/aws-sdk-go/service/docdb/errors.go b/vendor/github.com/aws/aws-sdk-go/service/docdb/errors.go index cbce0b232e4..98309f9a33e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/docdb/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/docdb/errors.go @@ -8,7 +8,7 @@ const ( // "AuthorizationNotFound". // // The specified CIDR IP or Amazon EC2 security group isn't authorized for the - // specified DB security group. + // specified security group. // // Amazon DocumentDB also might not be authorized to perform necessary actions // on your behalf using IAM. @@ -23,76 +23,75 @@ const ( // ErrCodeDBClusterAlreadyExistsFault for service response error code // "DBClusterAlreadyExistsFault". // - // You already have a DB cluster with the given identifier. + // You already have a cluster with the given identifier. ErrCodeDBClusterAlreadyExistsFault = "DBClusterAlreadyExistsFault" // ErrCodeDBClusterNotFoundFault for service response error code // "DBClusterNotFoundFault". // - // DBClusterIdentifier doesn't refer to an existing DB cluster. + // DBClusterIdentifier doesn't refer to an existing cluster. ErrCodeDBClusterNotFoundFault = "DBClusterNotFoundFault" // ErrCodeDBClusterParameterGroupNotFoundFault for service response error code // "DBClusterParameterGroupNotFound". // - // DBClusterParameterGroupName doesn't refer to an existing DB cluster parameter + // DBClusterParameterGroupName doesn't refer to an existing cluster parameter // group. ErrCodeDBClusterParameterGroupNotFoundFault = "DBClusterParameterGroupNotFound" // ErrCodeDBClusterQuotaExceededFault for service response error code // "DBClusterQuotaExceededFault". // - // The DB cluster can't be created because you have reached the maximum allowed - // quota of DB clusters. + // The cluster can't be created because you have reached the maximum allowed + // quota of clusters. ErrCodeDBClusterQuotaExceededFault = "DBClusterQuotaExceededFault" // ErrCodeDBClusterSnapshotAlreadyExistsFault for service response error code // "DBClusterSnapshotAlreadyExistsFault". // - // You already have a DB cluster snapshot with the given identifier. + // You already have a cluster snapshot with the given identifier. ErrCodeDBClusterSnapshotAlreadyExistsFault = "DBClusterSnapshotAlreadyExistsFault" // ErrCodeDBClusterSnapshotNotFoundFault for service response error code // "DBClusterSnapshotNotFoundFault". // - // DBClusterSnapshotIdentifier doesn't refer to an existing DB cluster snapshot. + // DBClusterSnapshotIdentifier doesn't refer to an existing cluster snapshot. ErrCodeDBClusterSnapshotNotFoundFault = "DBClusterSnapshotNotFoundFault" // ErrCodeDBInstanceAlreadyExistsFault for service response error code // "DBInstanceAlreadyExists". // - // You already have a DB instance with the given identifier. + // You already have a instance with the given identifier. ErrCodeDBInstanceAlreadyExistsFault = "DBInstanceAlreadyExists" // ErrCodeDBInstanceNotFoundFault for service response error code // "DBInstanceNotFound". // - // DBInstanceIdentifier doesn't refer to an existing DB instance. + // DBInstanceIdentifier doesn't refer to an existing instance. ErrCodeDBInstanceNotFoundFault = "DBInstanceNotFound" // ErrCodeDBParameterGroupAlreadyExistsFault for service response error code // "DBParameterGroupAlreadyExists". // - // A DB parameter group with the same name already exists. + // A parameter group with the same name already exists. ErrCodeDBParameterGroupAlreadyExistsFault = "DBParameterGroupAlreadyExists" // ErrCodeDBParameterGroupNotFoundFault for service response error code // "DBParameterGroupNotFound". // - // DBParameterGroupName doesn't refer to an existing DB parameter group. + // DBParameterGroupName doesn't refer to an existing parameter group. ErrCodeDBParameterGroupNotFoundFault = "DBParameterGroupNotFound" // ErrCodeDBParameterGroupQuotaExceededFault for service response error code // "DBParameterGroupQuotaExceeded". // - // This request would cause you to exceed the allowed number of DB parameter - // groups. + // This request would cause you to exceed the allowed number of parameter groups. ErrCodeDBParameterGroupQuotaExceededFault = "DBParameterGroupQuotaExceeded" // ErrCodeDBSecurityGroupNotFoundFault for service response error code // "DBSecurityGroupNotFound". // - // DBSecurityGroupName doesn't refer to an existing DB security group. + // DBSecurityGroupName doesn't refer to an existing security group. ErrCodeDBSecurityGroupNotFoundFault = "DBSecurityGroupNotFound" // ErrCodeDBSnapshotAlreadyExistsFault for service response error code @@ -104,64 +103,63 @@ const ( // ErrCodeDBSnapshotNotFoundFault for service response error code // "DBSnapshotNotFound". // - // DBSnapshotIdentifier doesn't refer to an existing DB snapshot. + // DBSnapshotIdentifier doesn't refer to an existing snapshot. ErrCodeDBSnapshotNotFoundFault = "DBSnapshotNotFound" // ErrCodeDBSubnetGroupAlreadyExistsFault for service response error code // "DBSubnetGroupAlreadyExists". // - // DBSubnetGroupName is already being used by an existing DB subnet group. + // DBSubnetGroupName is already being used by an existing subnet group. ErrCodeDBSubnetGroupAlreadyExistsFault = "DBSubnetGroupAlreadyExists" // ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs for service response error code // "DBSubnetGroupDoesNotCoverEnoughAZs". // - // Subnets in the DB subnet group should cover at least two Availability Zones + // Subnets in the subnet group should cover at least two Availability Zones // unless there is only one Availability Zone. ErrCodeDBSubnetGroupDoesNotCoverEnoughAZs = "DBSubnetGroupDoesNotCoverEnoughAZs" // ErrCodeDBSubnetGroupNotFoundFault for service response error code // "DBSubnetGroupNotFoundFault". // - // DBSubnetGroupName doesn't refer to an existing DB subnet group. + // DBSubnetGroupName doesn't refer to an existing subnet group. ErrCodeDBSubnetGroupNotFoundFault = "DBSubnetGroupNotFoundFault" // ErrCodeDBSubnetGroupQuotaExceededFault for service response error code // "DBSubnetGroupQuotaExceeded". // - // The request would cause you to exceed the allowed number of DB subnet groups. + // The request would cause you to exceed the allowed number of subnet groups. ErrCodeDBSubnetGroupQuotaExceededFault = "DBSubnetGroupQuotaExceeded" // ErrCodeDBSubnetQuotaExceededFault for service response error code // "DBSubnetQuotaExceededFault". // // The request would cause you to exceed the allowed number of subnets in a - // DB subnet group. + // subnet group. ErrCodeDBSubnetQuotaExceededFault = "DBSubnetQuotaExceededFault" // ErrCodeDBUpgradeDependencyFailureFault for service response error code // "DBUpgradeDependencyFailure". // - // The DB upgrade failed because a resource that the DB depends on can't be - // modified. + // The upgrade failed because a resource that the depends on can't be modified. ErrCodeDBUpgradeDependencyFailureFault = "DBUpgradeDependencyFailure" // ErrCodeInstanceQuotaExceededFault for service response error code // "InstanceQuotaExceeded". // - // The request would cause you to exceed the allowed number of DB instances. + // The request would cause you to exceed the allowed number of instances. ErrCodeInstanceQuotaExceededFault = "InstanceQuotaExceeded" // ErrCodeInsufficientDBClusterCapacityFault for service response error code // "InsufficientDBClusterCapacityFault". // - // The DB cluster doesn't have enough capacity for the current operation. + // The cluster doesn't have enough capacity for the current operation. ErrCodeInsufficientDBClusterCapacityFault = "InsufficientDBClusterCapacityFault" // ErrCodeInsufficientDBInstanceCapacityFault for service response error code // "InsufficientDBInstanceCapacity". // - // The specified DB instance class isn't available in the specified Availability + // The specified instance class isn't available in the specified Availability // Zone. ErrCodeInsufficientDBInstanceCapacityFault = "InsufficientDBInstanceCapacity" @@ -176,51 +174,51 @@ const ( // ErrCodeInvalidDBClusterSnapshotStateFault for service response error code // "InvalidDBClusterSnapshotStateFault". // - // The provided value isn't a valid DB cluster snapshot state. + // The provided value isn't a valid cluster snapshot state. ErrCodeInvalidDBClusterSnapshotStateFault = "InvalidDBClusterSnapshotStateFault" // ErrCodeInvalidDBClusterStateFault for service response error code // "InvalidDBClusterStateFault". // - // The DB cluster isn't in a valid state. + // The cluster isn't in a valid state. ErrCodeInvalidDBClusterStateFault = "InvalidDBClusterStateFault" // ErrCodeInvalidDBInstanceStateFault for service response error code // "InvalidDBInstanceState". // - // The specified DB instance isn't in the available state. + // The specified instance isn't in the available state. ErrCodeInvalidDBInstanceStateFault = "InvalidDBInstanceState" // ErrCodeInvalidDBParameterGroupStateFault for service response error code // "InvalidDBParameterGroupState". // - // The DB parameter group is in use, or it is in a state that is not valid. - // If you are trying to delete the parameter group, you can't delete it when - // the parameter group is in this state. + // The parameter group is in use, or it is in a state that is not valid. If + // you are trying to delete the parameter group, you can't delete it when the + // parameter group is in this state. ErrCodeInvalidDBParameterGroupStateFault = "InvalidDBParameterGroupState" // ErrCodeInvalidDBSecurityGroupStateFault for service response error code // "InvalidDBSecurityGroupState". // - // The state of the DB security group doesn't allow deletion. + // The state of the security group doesn't allow deletion. ErrCodeInvalidDBSecurityGroupStateFault = "InvalidDBSecurityGroupState" // ErrCodeInvalidDBSnapshotStateFault for service response error code // "InvalidDBSnapshotState". // - // The state of the DB snapshot doesn't allow deletion. + // The state of the snapshot doesn't allow deletion. ErrCodeInvalidDBSnapshotStateFault = "InvalidDBSnapshotState" // ErrCodeInvalidDBSubnetGroupStateFault for service response error code // "InvalidDBSubnetGroupStateFault". // - // The DB subnet group can't be deleted because it's in use. + // The subnet group can't be deleted because it's in use. ErrCodeInvalidDBSubnetGroupStateFault = "InvalidDBSubnetGroupStateFault" // ErrCodeInvalidDBSubnetStateFault for service response error code // "InvalidDBSubnetStateFault". // - // The DB subnet isn't in the available state. + // The subnet isn't in the available state. ErrCodeInvalidDBSubnetStateFault = "InvalidDBSubnetStateFault" // ErrCodeInvalidRestoreFault for service response error code @@ -240,7 +238,7 @@ const ( // ErrCodeInvalidVPCNetworkStateFault for service response error code // "InvalidVPCNetworkStateFault". // - // The DB subnet group doesn't cover all Availability Zones after it is created + // The subnet group doesn't cover all Availability Zones after it is created // because of changes that were made. ErrCodeInvalidVPCNetworkStateFault = "InvalidVPCNetworkStateFault" @@ -266,14 +264,14 @@ const ( // ErrCodeSnapshotQuotaExceededFault for service response error code // "SnapshotQuotaExceeded". // - // The request would cause you to exceed the allowed number of DB snapshots. + // The request would cause you to exceed the allowed number of snapshots. ErrCodeSnapshotQuotaExceededFault = "SnapshotQuotaExceeded" // ErrCodeStorageQuotaExceededFault for service response error code // "StorageQuotaExceeded". // // The request would cause you to exceed the allowed amount of storage available - // across all DB instances. + // across all instances. ErrCodeStorageQuotaExceededFault = "StorageQuotaExceeded" // ErrCodeStorageTypeNotSupportedFault for service response error code @@ -285,6 +283,6 @@ const ( // ErrCodeSubnetAlreadyInUse for service response error code // "SubnetAlreadyInUse". // - // The DB subnet is already in use in the Availability Zone. + // The subnet is already in use in the Availability Zone. ErrCodeSubnetAlreadyInUse = "SubnetAlreadyInUse" ) diff --git a/vendor/github.com/aws/aws-sdk-go/service/docdb/service.go b/vendor/github.com/aws/aws-sdk-go/service/docdb/service.go index cd0f3d91dc5..acd5ea47544 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/docdb/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/docdb/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "DocDB" // Name of service. EndpointsID = "rds" // ID to lookup a service endpoint with. - ServiceID = "DocDB" // ServiceID is a unique identifer of a specific service. + ServiceID = "DocDB" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the DocDB client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a DocDB client from just a session. // svc := docdb.New(mySession) // @@ -49,11 +51,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *DocDB { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "rds" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *DocDB { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *DocDB { svc := &DocDB{ Client: client.New( cfg, @@ -62,6 +64,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2014-10-31", }, 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 index 8c889ff3455..4378008b1f7 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/api.go @@ -5,6 +5,7 @@ package dynamodb import ( "fmt" "net/url" + "strings" "time" "github.com/aws/aws-sdk-go/aws" @@ -143,8 +144,8 @@ func (c *DynamoDB) BatchGetItemRequest(input *BatchGetItemInput) (req *request.R // See the AWS API reference guide for Amazon DynamoDB's // API operation BatchGetItem for usage and error information. // -// Returned Error Codes: -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" +// Returned Error Types: +// * 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 @@ -152,16 +153,16 @@ func (c *DynamoDB) BatchGetItemRequest(input *BatchGetItemInput) (req *request.R // Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) // in the Amazon DynamoDB Developer Guide. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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. // -// * ErrCodeRequestLimitExceeded "RequestLimitExceeded" +// * RequestLimitExceeded // Throughput exceeds the current throughput limit for your account. Please // contact AWS Support at AWS Support (https://aws.amazon.com/support) to request // a limit increase. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchGetItem @@ -229,10 +230,12 @@ func (c *DynamoDB) BatchGetItemPagesWithContext(ctx aws.Context, input *BatchGet }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*BatchGetItemOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*BatchGetItemOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -379,8 +382,8 @@ func (c *DynamoDB) BatchWriteItemRequest(input *BatchWriteItemInput) (req *reque // See the AWS API reference guide for Amazon DynamoDB's // API operation BatchWriteItem for usage and error information. // -// Returned Error Codes: -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" +// Returned Error Types: +// * 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 @@ -388,20 +391,20 @@ func (c *DynamoDB) BatchWriteItemRequest(input *BatchWriteItemInput) (req *reque // Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) // in the Amazon DynamoDB Developer Guide. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * ItemCollectionSizeLimitExceededException // An item collection is too large. This exception is only returned for tables // that have one or more local secondary indexes. // -// * ErrCodeRequestLimitExceeded "RequestLimitExceeded" +// * RequestLimitExceeded // Throughput exceeds the current throughput limit for your account. Please // contact AWS Support at AWS Support (https://aws.amazon.com/support) to request // a limit increase. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/BatchWriteItem @@ -528,22 +531,22 @@ func (c *DynamoDB) CreateBackupRequest(input *CreateBackupInput) (req *request.R // See the AWS API reference guide for Amazon DynamoDB's // API operation CreateBackup for usage and error information. // -// Returned Error Codes: -// * ErrCodeTableNotFoundException "TableNotFoundException" +// Returned Error Types: +// * TableNotFoundException // A source table with the name TableName does not currently exist within the // subscriber's account. // -// * ErrCodeTableInUseException "TableInUseException" +// * TableInUseException // A target table with the specified name is either being created or deleted. // -// * ErrCodeContinuousBackupsUnavailableException "ContinuousBackupsUnavailableException" +// * ContinuousBackupsUnavailableException // Backups have not yet been enabled for this table. // -// * ErrCodeBackupInUseException "BackupInUseException" +// * BackupInUseException // There is another ongoing conflicting backup control plane operation on the // table. The backup is either being created, deleted or restored to a table. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // There is no limit to the number of daily on-demand backups that can be taken. // // Up to 50 simultaneous table operations are allowed per account. These operations @@ -557,7 +560,7 @@ func (c *DynamoDB) CreateBackupRequest(input *CreateBackupInput) (req *request.R // // There is a soft account limit of 256 tables. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateBackup @@ -651,6 +654,9 @@ func (c *DynamoDB) CreateGlobalTableRequest(input *CreateGlobalTableInput) (req // relationship between two or more DynamoDB tables with the same table name // in the provided Regions. // +// This method only applies to Version 2017.11.29 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V1.html) +// of global tables. +// // If you want to add a new replica table to a global table, each of the following // conditions must be true: // @@ -688,8 +694,8 @@ func (c *DynamoDB) CreateGlobalTableRequest(input *CreateGlobalTableInput) (req // See the AWS API reference guide for Amazon DynamoDB's // API operation CreateGlobalTable for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // There is no limit to the number of daily on-demand backups that can be taken. // // Up to 50 simultaneous table operations are allowed per account. These operations @@ -703,13 +709,13 @@ func (c *DynamoDB) CreateGlobalTableRequest(input *CreateGlobalTableInput) (req // // There is a soft account limit of 256 tables. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeGlobalTableAlreadyExistsException "GlobalTableAlreadyExistsException" +// * GlobalTableAlreadyExistsException // The specified global table already exists. // -// * ErrCodeTableNotFoundException "TableNotFoundException" +// * TableNotFoundException // A source table with the name TableName does not currently exist within the // subscriber's account. // @@ -823,13 +829,13 @@ func (c *DynamoDB) CreateTableRequest(input *CreateTableInput) (req *request.Req // See the AWS API reference guide for Amazon DynamoDB's // API operation CreateTable for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * 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" +// * LimitExceededException // There is no limit to the number of daily on-demand backups that can be taken. // // Up to 50 simultaneous table operations are allowed per account. These operations @@ -843,7 +849,7 @@ func (c *DynamoDB) CreateTableRequest(input *CreateTableInput) (req *request.Req // // There is a soft account limit of 256 tables. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/CreateTable @@ -944,15 +950,15 @@ func (c *DynamoDB) DeleteBackupRequest(input *DeleteBackupInput) (req *request.R // See the AWS API reference guide for Amazon DynamoDB's // API operation DeleteBackup for usage and error information. // -// Returned Error Codes: -// * ErrCodeBackupNotFoundException "BackupNotFoundException" +// Returned Error Types: +// * BackupNotFoundException // Backup not found for the given BackupARN. // -// * ErrCodeBackupInUseException "BackupInUseException" +// * BackupInUseException // There is another ongoing conflicting backup control plane operation on the // table. The backup is either being created, deleted or restored to a table. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // There is no limit to the number of daily on-demand backups that can be taken. // // Up to 50 simultaneous table operations are allowed per account. These operations @@ -966,7 +972,7 @@ func (c *DynamoDB) DeleteBackupRequest(input *DeleteBackupInput) (req *request.R // // There is a soft account limit of 256 tables. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteBackup @@ -1078,11 +1084,11 @@ func (c *DynamoDB) DeleteItemRequest(input *DeleteItemInput) (req *request.Reque // See the AWS API reference guide for Amazon DynamoDB's // API operation DeleteItem for usage and error information. // -// Returned Error Codes: -// * ErrCodeConditionalCheckFailedException "ConditionalCheckFailedException" +// Returned Error Types: +// * ConditionalCheckFailedException // A condition specified in the operation could not be evaluated. // -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" +// * 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 @@ -1090,23 +1096,23 @@ func (c *DynamoDB) DeleteItemRequest(input *DeleteItemInput) (req *request.Reque // Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) // in the Amazon DynamoDB Developer Guide. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * ItemCollectionSizeLimitExceededException // An item collection is too large. This exception is only returned for tables // that have one or more local secondary indexes. // -// * ErrCodeTransactionConflictException "TransactionConflictException" +// * TransactionConflictException // Operation was rejected because there is an ongoing transaction for the item. // -// * ErrCodeRequestLimitExceeded "RequestLimitExceeded" +// * RequestLimitExceeded // Throughput exceeds the current throughput limit for your account. Please // contact AWS Support at AWS Support (https://aws.amazon.com/support) to request // a limit increase. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteItem @@ -1222,17 +1228,17 @@ func (c *DynamoDB) DeleteTableRequest(input *DeleteTableInput) (req *request.Req // See the AWS API reference guide for Amazon DynamoDB's // API operation DeleteTable for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * 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" +// * 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" +// * LimitExceededException // There is no limit to the number of daily on-demand backups that can be taken. // // Up to 50 simultaneous table operations are allowed per account. These operations @@ -1246,7 +1252,7 @@ func (c *DynamoDB) DeleteTableRequest(input *DeleteTableInput) (req *request.Req // // There is a soft account limit of 256 tables. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DeleteTable @@ -1347,11 +1353,11 @@ func (c *DynamoDB) DescribeBackupRequest(input *DescribeBackupInput) (req *reque // See the AWS API reference guide for Amazon DynamoDB's // API operation DescribeBackup for usage and error information. // -// Returned Error Codes: -// * ErrCodeBackupNotFoundException "BackupNotFoundException" +// Returned Error Types: +// * BackupNotFoundException // Backup not found for the given BackupARN. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeBackup @@ -1462,12 +1468,12 @@ func (c *DynamoDB) DescribeContinuousBackupsRequest(input *DescribeContinuousBac // See the AWS API reference guide for Amazon DynamoDB's // API operation DescribeContinuousBackups for usage and error information. // -// Returned Error Codes: -// * ErrCodeTableNotFoundException "TableNotFoundException" +// Returned Error Types: +// * TableNotFoundException // A source table with the name TableName does not currently exist within the // subscriber's account. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeContinuousBackups @@ -1492,6 +1498,90 @@ func (c *DynamoDB) DescribeContinuousBackupsWithContext(ctx aws.Context, input * return out, req.Send() } +const opDescribeContributorInsights = "DescribeContributorInsights" + +// DescribeContributorInsightsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeContributorInsights operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeContributorInsights for more information on using the DescribeContributorInsights +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeContributorInsightsRequest method. +// req, resp := client.DescribeContributorInsightsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeContributorInsights +func (c *DynamoDB) DescribeContributorInsightsRequest(input *DescribeContributorInsightsInput) (req *request.Request, output *DescribeContributorInsightsOutput) { + op := &request.Operation{ + Name: opDescribeContributorInsights, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeContributorInsightsInput{} + } + + output = &DescribeContributorInsightsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeContributorInsights API operation for Amazon DynamoDB. +// +// Returns information about contributor insights, for a given table or 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 DescribeContributorInsights for usage and error information. +// +// Returned Error Types: +// * 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. +// +// * InternalServerError +// An error occurred on the server side. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeContributorInsights +func (c *DynamoDB) DescribeContributorInsights(input *DescribeContributorInsightsInput) (*DescribeContributorInsightsOutput, error) { + req, out := c.DescribeContributorInsightsRequest(input) + return out, req.Send() +} + +// DescribeContributorInsightsWithContext is the same as DescribeContributorInsights with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeContributorInsights for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DynamoDB) DescribeContributorInsightsWithContext(ctx aws.Context, input *DescribeContributorInsightsInput, opts ...request.Option) (*DescribeContributorInsightsOutput, error) { + req, out := c.DescribeContributorInsightsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeEndpoints = "DescribeEndpoints" // DescribeEndpointsRequest generates a "aws/request.Request" representing the @@ -1572,6 +1662,7 @@ type discovererDescribeEndpoints struct { EndpointCache *crr.EndpointCache Params map[string]*string Key string + req *request.Request } func (d *discovererDescribeEndpoints) Discover() (crr.Endpoint, error) { @@ -1591,8 +1682,19 @@ func (d *discovererDescribeEndpoints) Discover() (crr.Endpoint, error) { continue } + address := *e.Address + + var scheme string + if idx := strings.Index(address, "://"); idx != -1 { + scheme = address[:idx] + } + + if len(scheme) == 0 { + address = fmt.Sprintf("%s://%s", d.req.HTTPRequest.URL.Scheme, address) + } + cachedInMinutes := aws.Int64Value(e.CachePeriodInMinutes) - u, err := url.Parse(*e.Address) + u, err := url.Parse(address) if err != nil { continue } @@ -1613,6 +1715,7 @@ func (d *discovererDescribeEndpoints) Discover() (crr.Endpoint, error) { func (d *discovererDescribeEndpoints) Handler(r *request.Request) { endpointKey := crr.BuildEndpointKey(d.Params) d.Key = endpointKey + d.req = r endpoint, err := d.EndpointCache.Get(d, endpointKey, d.Required) if err != nil { @@ -1692,6 +1795,9 @@ func (c *DynamoDB) DescribeGlobalTableRequest(input *DescribeGlobalTableInput) ( // // Returns information about the specified global table. // +// This method only applies to Version 2017.11.29 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V1.html) +// of global 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. @@ -1699,11 +1805,11 @@ func (c *DynamoDB) DescribeGlobalTableRequest(input *DescribeGlobalTableInput) ( // See the AWS API reference guide for Amazon DynamoDB's // API operation DescribeGlobalTable for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeGlobalTableNotFoundException "GlobalTableNotFoundException" +// * GlobalTableNotFoundException // The specified global table does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeGlobalTable @@ -1795,6 +1901,9 @@ func (c *DynamoDB) DescribeGlobalTableSettingsRequest(input *DescribeGlobalTable // // Describes Region-specific settings for a global table. // +// This method only applies to Version 2017.11.29 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V1.html) +// of global 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. @@ -1802,11 +1911,11 @@ func (c *DynamoDB) DescribeGlobalTableSettingsRequest(input *DescribeGlobalTable // See the AWS API reference guide for Amazon DynamoDB's // API operation DescribeGlobalTableSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeGlobalTableNotFoundException "GlobalTableNotFoundException" +// Returned Error Types: +// * GlobalTableNotFoundException // The specified global table does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeGlobalTableSettings @@ -1962,8 +2071,8 @@ func (c *DynamoDB) DescribeLimitsRequest(input *DescribeLimitsInput) (req *reque // See the AWS API reference guide for Amazon DynamoDB's // API operation DescribeLimits for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeLimits @@ -2070,12 +2179,12 @@ func (c *DynamoDB) DescribeTableRequest(input *DescribeTableInput) (req *request // See the AWS API reference guide for Amazon DynamoDB's // API operation DescribeTable for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * 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" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTable @@ -2100,6 +2209,92 @@ func (c *DynamoDB) DescribeTableWithContext(ctx aws.Context, input *DescribeTabl return out, req.Send() } +const opDescribeTableReplicaAutoScaling = "DescribeTableReplicaAutoScaling" + +// DescribeTableReplicaAutoScalingRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTableReplicaAutoScaling operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeTableReplicaAutoScaling for more information on using the DescribeTableReplicaAutoScaling +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeTableReplicaAutoScalingRequest method. +// req, resp := client.DescribeTableReplicaAutoScalingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTableReplicaAutoScaling +func (c *DynamoDB) DescribeTableReplicaAutoScalingRequest(input *DescribeTableReplicaAutoScalingInput) (req *request.Request, output *DescribeTableReplicaAutoScalingOutput) { + op := &request.Operation{ + Name: opDescribeTableReplicaAutoScaling, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeTableReplicaAutoScalingInput{} + } + + output = &DescribeTableReplicaAutoScalingOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeTableReplicaAutoScaling API operation for Amazon DynamoDB. +// +// Describes auto scaling settings across replicas of the global table at once. +// +// This method only applies to Version 2019.11.21 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V2.html) +// of global 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 DynamoDB's +// API operation DescribeTableReplicaAutoScaling for usage and error information. +// +// Returned Error Types: +// * 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. +// +// * InternalServerError +// An error occurred on the server side. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTableReplicaAutoScaling +func (c *DynamoDB) DescribeTableReplicaAutoScaling(input *DescribeTableReplicaAutoScalingInput) (*DescribeTableReplicaAutoScalingOutput, error) { + req, out := c.DescribeTableReplicaAutoScalingRequest(input) + return out, req.Send() +} + +// DescribeTableReplicaAutoScalingWithContext is the same as DescribeTableReplicaAutoScaling with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTableReplicaAutoScaling for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DynamoDB) DescribeTableReplicaAutoScalingWithContext(ctx aws.Context, input *DescribeTableReplicaAutoScalingInput, opts ...request.Option) (*DescribeTableReplicaAutoScalingOutput, error) { + req, out := c.DescribeTableReplicaAutoScalingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeTimeToLive = "DescribeTimeToLive" // DescribeTimeToLiveRequest generates a "aws/request.Request" representing the @@ -2174,12 +2369,12 @@ func (c *DynamoDB) DescribeTimeToLiveRequest(input *DescribeTimeToLiveInput) (re // See the AWS API reference guide for Amazon DynamoDB's // API operation DescribeTimeToLive for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * 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" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/DescribeTimeToLive @@ -2285,8 +2480,8 @@ func (c *DynamoDB) GetItemRequest(input *GetItemInput) (req *request.Request, ou // See the AWS API reference guide for Amazon DynamoDB's // API operation GetItem for usage and error information. // -// Returned Error Codes: -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" +// Returned Error Types: +// * 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 @@ -2294,16 +2489,16 @@ func (c *DynamoDB) GetItemRequest(input *GetItemInput) (req *request.Request, ou // Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) // in the Amazon DynamoDB Developer Guide. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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. // -// * ErrCodeRequestLimitExceeded "RequestLimitExceeded" +// * RequestLimitExceeded // Throughput exceeds the current throughput limit for your account. Please // contact AWS Support at AWS Support (https://aws.amazon.com/support) to request // a limit increase. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/GetItem @@ -2410,8 +2605,8 @@ func (c *DynamoDB) ListBackupsRequest(input *ListBackupsInput) (req *request.Req // See the AWS API reference guide for Amazon DynamoDB's // API operation ListBackups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListBackups @@ -2436,6 +2631,148 @@ func (c *DynamoDB) ListBackupsWithContext(ctx aws.Context, input *ListBackupsInp return out, req.Send() } +const opListContributorInsights = "ListContributorInsights" + +// ListContributorInsightsRequest generates a "aws/request.Request" representing the +// client's request for the ListContributorInsights operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListContributorInsights for more information on using the ListContributorInsights +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListContributorInsightsRequest method. +// req, resp := client.ListContributorInsightsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListContributorInsights +func (c *DynamoDB) ListContributorInsightsRequest(input *ListContributorInsightsInput) (req *request.Request, output *ListContributorInsightsOutput) { + op := &request.Operation{ + Name: opListContributorInsights, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListContributorInsightsInput{} + } + + output = &ListContributorInsightsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListContributorInsights API operation for Amazon DynamoDB. +// +// Returns a list of ContributorInsightsSummary for a table and all its global +// secondary indexes. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 ListContributorInsights for usage and error information. +// +// Returned Error Types: +// * 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. +// +// * InternalServerError +// An error occurred on the server side. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListContributorInsights +func (c *DynamoDB) ListContributorInsights(input *ListContributorInsightsInput) (*ListContributorInsightsOutput, error) { + req, out := c.ListContributorInsightsRequest(input) + return out, req.Send() +} + +// ListContributorInsightsWithContext is the same as ListContributorInsights with the addition of +// the ability to pass a context and additional request options. +// +// See ListContributorInsights for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DynamoDB) ListContributorInsightsWithContext(ctx aws.Context, input *ListContributorInsightsInput, opts ...request.Option) (*ListContributorInsightsOutput, error) { + req, out := c.ListContributorInsightsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListContributorInsightsPages iterates over the pages of a ListContributorInsights operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListContributorInsights 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 ListContributorInsights operation. +// pageNum := 0 +// err := client.ListContributorInsightsPages(params, +// func(page *dynamodb.ListContributorInsightsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *DynamoDB) ListContributorInsightsPages(input *ListContributorInsightsInput, fn func(*ListContributorInsightsOutput, bool) bool) error { + return c.ListContributorInsightsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListContributorInsightsPagesWithContext same as ListContributorInsightsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DynamoDB) ListContributorInsightsPagesWithContext(ctx aws.Context, input *ListContributorInsightsInput, fn func(*ListContributorInsightsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListContributorInsightsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListContributorInsightsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListContributorInsightsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opListGlobalTables = "ListGlobalTables" // ListGlobalTablesRequest generates a "aws/request.Request" representing the @@ -2503,6 +2840,9 @@ func (c *DynamoDB) ListGlobalTablesRequest(input *ListGlobalTablesInput) (req *r // // Lists all global tables that have a replica in the specified Region. // +// This method only applies to Version 2017.11.29 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V1.html) +// of global 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. @@ -2510,8 +2850,8 @@ func (c *DynamoDB) ListGlobalTablesRequest(input *ListGlobalTablesInput) (req *r // See the AWS API reference guide for Amazon DynamoDB's // API operation ListGlobalTables for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListGlobalTables @@ -2618,8 +2958,8 @@ func (c *DynamoDB) ListTablesRequest(input *ListTablesInput) (req *request.Reque // See the AWS API reference guide for Amazon DynamoDB's // API operation ListTables for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTables @@ -2687,10 +3027,12 @@ func (c *DynamoDB) ListTablesPagesWithContext(ctx aws.Context, input *ListTables }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTablesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTablesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2772,12 +3114,12 @@ func (c *DynamoDB) ListTagsOfResourceRequest(input *ListTagsOfResourceInput) (re // See the AWS API reference guide for Amazon DynamoDB's // API operation ListTagsOfResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * 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" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/ListTagsOfResource @@ -2919,11 +3261,11 @@ func (c *DynamoDB) PutItemRequest(input *PutItemInput) (req *request.Request, ou // See the AWS API reference guide for Amazon DynamoDB's // API operation PutItem for usage and error information. // -// Returned Error Codes: -// * ErrCodeConditionalCheckFailedException "ConditionalCheckFailedException" +// Returned Error Types: +// * ConditionalCheckFailedException // A condition specified in the operation could not be evaluated. // -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" +// * 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 @@ -2931,23 +3273,23 @@ func (c *DynamoDB) PutItemRequest(input *PutItemInput) (req *request.Request, ou // Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) // in the Amazon DynamoDB Developer Guide. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * ItemCollectionSizeLimitExceededException // An item collection is too large. This exception is only returned for tables // that have one or more local secondary indexes. // -// * ErrCodeTransactionConflictException "TransactionConflictException" +// * TransactionConflictException // Operation was rejected because there is an ongoing transaction for the item. // -// * ErrCodeRequestLimitExceeded "RequestLimitExceeded" +// * RequestLimitExceeded // Throughput exceeds the current throughput limit for your account. Please // contact AWS Support at AWS Support (https://aws.amazon.com/support) to request // a limit increase. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/PutItem @@ -3099,8 +3441,8 @@ func (c *DynamoDB) QueryRequest(input *QueryInput) (req *request.Request, output // See the AWS API reference guide for Amazon DynamoDB's // API operation Query for usage and error information. // -// Returned Error Codes: -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" +// Returned Error Types: +// * 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 @@ -3108,16 +3450,16 @@ func (c *DynamoDB) QueryRequest(input *QueryInput) (req *request.Request, output // Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) // in the Amazon DynamoDB Developer Guide. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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. // -// * ErrCodeRequestLimitExceeded "RequestLimitExceeded" +// * RequestLimitExceeded // Throughput exceeds the current throughput limit for your account. Please // contact AWS Support at AWS Support (https://aws.amazon.com/support) to request // a limit increase. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Query @@ -3185,10 +3527,12 @@ func (c *DynamoDB) QueryPagesWithContext(ctx aws.Context, input *QueryInput, fn }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*QueryOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*QueryOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3283,21 +3627,21 @@ func (c *DynamoDB) RestoreTableFromBackupRequest(input *RestoreTableFromBackupIn // See the AWS API reference guide for Amazon DynamoDB's // API operation RestoreTableFromBackup for usage and error information. // -// Returned Error Codes: -// * ErrCodeTableAlreadyExistsException "TableAlreadyExistsException" +// Returned Error Types: +// * TableAlreadyExistsException // A target table with the specified name already exists. // -// * ErrCodeTableInUseException "TableInUseException" +// * TableInUseException // A target table with the specified name is either being created or deleted. // -// * ErrCodeBackupNotFoundException "BackupNotFoundException" +// * BackupNotFoundException // Backup not found for the given BackupARN. // -// * ErrCodeBackupInUseException "BackupInUseException" +// * BackupInUseException // There is another ongoing conflicting backup control plane operation on the // table. The backup is either being created, deleted or restored to a table. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // There is no limit to the number of daily on-demand backups that can be taken. // // Up to 50 simultaneous table operations are allowed per account. These operations @@ -3311,7 +3655,7 @@ func (c *DynamoDB) RestoreTableFromBackupRequest(input *RestoreTableFromBackupIn // // There is a soft account limit of 256 tables. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/RestoreTableFromBackup @@ -3445,18 +3789,18 @@ func (c *DynamoDB) RestoreTableToPointInTimeRequest(input *RestoreTableToPointIn // See the AWS API reference guide for Amazon DynamoDB's // API operation RestoreTableToPointInTime for usage and error information. // -// Returned Error Codes: -// * ErrCodeTableAlreadyExistsException "TableAlreadyExistsException" +// Returned Error Types: +// * TableAlreadyExistsException // A target table with the specified name already exists. // -// * ErrCodeTableNotFoundException "TableNotFoundException" +// * TableNotFoundException // A source table with the name TableName does not currently exist within the // subscriber's account. // -// * ErrCodeTableInUseException "TableInUseException" +// * TableInUseException // A target table with the specified name is either being created or deleted. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // There is no limit to the number of daily on-demand backups that can be taken. // // Up to 50 simultaneous table operations are allowed per account. These operations @@ -3470,14 +3814,14 @@ func (c *DynamoDB) RestoreTableToPointInTimeRequest(input *RestoreTableToPointIn // // There is a soft account limit of 256 tables. // -// * ErrCodeInvalidRestoreTimeException "InvalidRestoreTimeException" +// * InvalidRestoreTimeException // An invalid restore time was specified. RestoreDateTime must be between EarliestRestorableDateTime // and LatestRestorableDateTime. // -// * ErrCodePointInTimeRecoveryUnavailableException "PointInTimeRecoveryUnavailableException" +// * PointInTimeRecoveryUnavailableException // Point in time recovery has not yet been enabled for this source table. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/RestoreTableToPointInTime @@ -3609,8 +3953,8 @@ func (c *DynamoDB) ScanRequest(input *ScanInput) (req *request.Request, output * // See the AWS API reference guide for Amazon DynamoDB's // API operation Scan for usage and error information. // -// Returned Error Codes: -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" +// Returned Error Types: +// * 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 @@ -3618,16 +3962,16 @@ func (c *DynamoDB) ScanRequest(input *ScanInput) (req *request.Request, output * // Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) // in the Amazon DynamoDB Developer Guide. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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. // -// * ErrCodeRequestLimitExceeded "RequestLimitExceeded" +// * RequestLimitExceeded // Throughput exceeds the current throughput limit for your account. Please // contact AWS Support at AWS Support (https://aws.amazon.com/support) to request // a limit increase. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/Scan @@ -3695,10 +4039,12 @@ func (c *DynamoDB) ScanPagesWithContext(ctx aws.Context, input *ScanInput, fn fu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ScanOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ScanOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3783,8 +4129,8 @@ func (c *DynamoDB) TagResourceRequest(input *TagResourceInput) (req *request.Req // See the AWS API reference guide for Amazon DynamoDB's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // There is no limit to the number of daily on-demand backups that can be taken. // // Up to 50 simultaneous table operations are allowed per account. These operations @@ -3798,14 +4144,14 @@ func (c *DynamoDB) TagResourceRequest(input *TagResourceInput) (req *request.Req // // There is a soft account limit of 256 tables. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * 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. @@ -3905,16 +4251,6 @@ func (c *DynamoDB) TransactGetItemsRequest(input *TransactGetItemsInput) (req *r // cannot retrieve items from tables in more than one AWS account or Region. // The aggregate size of the items in the transaction cannot exceed 4 MB. // -// All AWS Regions and AWS GovCloud (US) support up to 25 items per transaction -// with up to 4 MB of data, except the following AWS Regions: -// -// * China (Beijing) -// -// * China (Ningxia) -// -// The China (Beijing) and China (Ningxia) Regions support up to 10 items per -// transaction with up to 4 MB of data. -// // DynamoDB rejects the entire TransactGetItems request if any of the following // is true: // @@ -3935,12 +4271,12 @@ func (c *DynamoDB) TransactGetItemsRequest(input *TransactGetItemsInput) (req *r // See the AWS API reference guide for Amazon DynamoDB's // API operation TransactGetItems for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * 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. // -// * ErrCodeTransactionCanceledException "TransactionCanceledException" +// * TransactionCanceledException // The entire transaction request was canceled. // // DynamoDB cancels a TransactWriteItems request under the following circumstances: @@ -3960,8 +4296,6 @@ func (c *DynamoDB) TransactGetItemsRequest(input *TransactGetItemsInput) (req *r // index (LSI) becomes too large, or a similar validation error occurs because // of changes made by the transaction. // -// * The aggregate size of the items in the transaction exceeds 4 MBs. -// // * There is a user error, such as an invalid data format. // // DynamoDB cancels a TransactGetItems request under the following circumstances: @@ -3976,8 +4310,6 @@ func (c *DynamoDB) TransactGetItemsRequest(input *TransactGetItemsInput) (req *r // * There is insufficient provisioned capacity for the transaction to be // completed. // -// * The aggregate size of the items in the transaction exceeds 4 MBs. -// // * There is a user error, such as an invalid data format. // // If using Java, DynamoDB lists the cancellation reasons on the CancellationReasons @@ -4031,7 +4363,7 @@ func (c *DynamoDB) TransactGetItemsRequest(input *TransactGetItemsInput) (req *r // The provided expression refers to an attribute that does not exist in // the item. // -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" +// * 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 @@ -4039,7 +4371,12 @@ func (c *DynamoDB) TransactGetItemsRequest(input *TransactGetItemsInput) (req *r // Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) // in the Amazon DynamoDB Developer Guide. // -// * ErrCodeInternalServerError "InternalServerError" +// * RequestLimitExceeded +// Throughput exceeds the current throughput limit for your account. Please +// contact AWS Support at AWS Support (https://aws.amazon.com/support) to request +// a limit increase. +// +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TransactGetItems @@ -4136,16 +4473,6 @@ func (c *DynamoDB) TransactWriteItemsRequest(input *TransactWriteItemsInput) (re // item. The aggregate size of the items in the transaction cannot exceed 4 // MB. // -// All AWS Regions and AWS GovCloud (US) support up to 25 items per transaction -// with up to 4 MB of data, except the following AWS Regions: -// -// * China (Beijing) -// -// * China (Ningxia) -// -// The China (Beijing) and China (Ningxia) Regions support up to 10 items per -// transaction with up to 4 MB of data. -// // The actions are completed atomically so that either all of them succeed, // or all of them fail. They are defined by the following objects: // @@ -4201,12 +4528,12 @@ func (c *DynamoDB) TransactWriteItemsRequest(input *TransactWriteItemsInput) (re // See the AWS API reference guide for Amazon DynamoDB's // API operation TransactWriteItems for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * 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. // -// * ErrCodeTransactionCanceledException "TransactionCanceledException" +// * TransactionCanceledException // The entire transaction request was canceled. // // DynamoDB cancels a TransactWriteItems request under the following circumstances: @@ -4226,8 +4553,6 @@ func (c *DynamoDB) TransactWriteItemsRequest(input *TransactWriteItemsInput) (re // index (LSI) becomes too large, or a similar validation error occurs because // of changes made by the transaction. // -// * The aggregate size of the items in the transaction exceeds 4 MBs. -// // * There is a user error, such as an invalid data format. // // DynamoDB cancels a TransactGetItems request under the following circumstances: @@ -4242,8 +4567,6 @@ func (c *DynamoDB) TransactWriteItemsRequest(input *TransactWriteItemsInput) (re // * There is insufficient provisioned capacity for the transaction to be // completed. // -// * The aggregate size of the items in the transaction exceeds 4 MBs. -// // * There is a user error, such as an invalid data format. // // If using Java, DynamoDB lists the cancellation reasons on the CancellationReasons @@ -4297,14 +4620,14 @@ func (c *DynamoDB) TransactWriteItemsRequest(input *TransactWriteItemsInput) (re // The provided expression refers to an attribute that does not exist in // the item. // -// * ErrCodeTransactionInProgressException "TransactionInProgressException" +// * TransactionInProgressException // The transaction with the given request token is already in progress. // -// * ErrCodeIdempotentParameterMismatchException "IdempotentParameterMismatchException" +// * IdempotentParameterMismatchException // DynamoDB rejected the request because you retried a request with a different // payload but with an idempotent token that was already used. // -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" +// * 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 @@ -4312,9 +4635,14 @@ func (c *DynamoDB) TransactWriteItemsRequest(input *TransactWriteItemsInput) (re // Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) // in the Amazon DynamoDB Developer Guide. // -// * ErrCodeInternalServerError "InternalServerError" -// An error occurred on the server side. -// +// * RequestLimitExceeded +// Throughput exceeds the current throughput limit for your account. Please +// contact AWS Support at AWS Support (https://aws.amazon.com/support) to request +// a limit increase. +// +// * InternalServerError +// An error occurred on the server side. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/TransactWriteItems func (c *DynamoDB) TransactWriteItems(input *TransactWriteItemsInput) (*TransactWriteItemsOutput, error) { req, out := c.TransactWriteItemsRequest(input) @@ -4416,8 +4744,8 @@ func (c *DynamoDB) UntagResourceRequest(input *UntagResourceInput) (req *request // See the AWS API reference guide for Amazon DynamoDB's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // There is no limit to the number of daily on-demand backups that can be taken. // // Up to 50 simultaneous table operations are allowed per account. These operations @@ -4431,14 +4759,14 @@ func (c *DynamoDB) UntagResourceRequest(input *UntagResourceInput) (req *request // // There is a soft account limit of 256 tables. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * 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. @@ -4549,15 +4877,15 @@ func (c *DynamoDB) UpdateContinuousBackupsRequest(input *UpdateContinuousBackups // See the AWS API reference guide for Amazon DynamoDB's // API operation UpdateContinuousBackups for usage and error information. // -// Returned Error Codes: -// * ErrCodeTableNotFoundException "TableNotFoundException" +// Returned Error Types: +// * TableNotFoundException // A source table with the name TableName does not currently exist within the // subscriber's account. // -// * ErrCodeContinuousBackupsUnavailableException "ContinuousBackupsUnavailableException" +// * ContinuousBackupsUnavailableException // Backups have not yet been enabled for this table. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateContinuousBackups @@ -4582,6 +4910,89 @@ func (c *DynamoDB) UpdateContinuousBackupsWithContext(ctx aws.Context, input *Up return out, req.Send() } +const opUpdateContributorInsights = "UpdateContributorInsights" + +// UpdateContributorInsightsRequest generates a "aws/request.Request" representing the +// client's request for the UpdateContributorInsights operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateContributorInsights for more information on using the UpdateContributorInsights +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateContributorInsightsRequest method. +// req, resp := client.UpdateContributorInsightsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateContributorInsights +func (c *DynamoDB) UpdateContributorInsightsRequest(input *UpdateContributorInsightsInput) (req *request.Request, output *UpdateContributorInsightsOutput) { + op := &request.Operation{ + Name: opUpdateContributorInsights, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateContributorInsightsInput{} + } + + output = &UpdateContributorInsightsOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateContributorInsights API operation for Amazon DynamoDB. +// +// Updates the status for contributor insights for a specific table or 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 UpdateContributorInsights for usage and error information. +// +// Returned Error Types: +// * 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. +// +// * InternalServerError +// An error occurred on the server side. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateContributorInsights +func (c *DynamoDB) UpdateContributorInsights(input *UpdateContributorInsightsInput) (*UpdateContributorInsightsOutput, error) { + req, out := c.UpdateContributorInsightsRequest(input) + return out, req.Send() +} + +// UpdateContributorInsightsWithContext is the same as UpdateContributorInsights with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateContributorInsights for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DynamoDB) UpdateContributorInsightsWithContext(ctx aws.Context, input *UpdateContributorInsightsInput, opts ...request.Option) (*UpdateContributorInsightsOutput, error) { + req, out := c.UpdateContributorInsightsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opUpdateGlobalTable = "UpdateGlobalTable" // UpdateGlobalTableRequest generates a "aws/request.Request" representing the @@ -4675,20 +5086,20 @@ func (c *DynamoDB) UpdateGlobalTableRequest(input *UpdateGlobalTableInput) (req // See the AWS API reference guide for Amazon DynamoDB's // API operation UpdateGlobalTable for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeGlobalTableNotFoundException "GlobalTableNotFoundException" +// * GlobalTableNotFoundException // The specified global table does not exist. // -// * ErrCodeReplicaAlreadyExistsException "ReplicaAlreadyExistsException" +// * ReplicaAlreadyExistsException // The specified replica is already part of the global table. // -// * ErrCodeReplicaNotFoundException "ReplicaNotFoundException" +// * ReplicaNotFoundException // The specified replica is no longer part of the global table. // -// * ErrCodeTableNotFoundException "TableNotFoundException" +// * TableNotFoundException // A source table with the name TableName does not currently exist within the // subscriber's account. // @@ -4788,17 +5199,17 @@ func (c *DynamoDB) UpdateGlobalTableSettingsRequest(input *UpdateGlobalTableSett // See the AWS API reference guide for Amazon DynamoDB's // API operation UpdateGlobalTableSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeGlobalTableNotFoundException "GlobalTableNotFoundException" +// Returned Error Types: +// * GlobalTableNotFoundException // The specified global table does not exist. // -// * ErrCodeReplicaNotFoundException "ReplicaNotFoundException" +// * ReplicaNotFoundException // The specified replica is no longer part of the global table. // -// * ErrCodeIndexNotFoundException "IndexNotFoundException" +// * IndexNotFoundException // The operation tried to access a nonexistent index. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // There is no limit to the number of daily on-demand backups that can be taken. // // Up to 50 simultaneous table operations are allowed per account. These operations @@ -4812,12 +5223,12 @@ func (c *DynamoDB) UpdateGlobalTableSettingsRequest(input *UpdateGlobalTableSett // // There is a soft account limit of 256 tables. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * 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. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateGlobalTableSettings @@ -4923,11 +5334,11 @@ func (c *DynamoDB) UpdateItemRequest(input *UpdateItemInput) (req *request.Reque // See the AWS API reference guide for Amazon DynamoDB's // API operation UpdateItem for usage and error information. // -// Returned Error Codes: -// * ErrCodeConditionalCheckFailedException "ConditionalCheckFailedException" +// Returned Error Types: +// * ConditionalCheckFailedException // A condition specified in the operation could not be evaluated. // -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" +// * 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 @@ -4935,23 +5346,23 @@ func (c *DynamoDB) UpdateItemRequest(input *UpdateItemInput) (req *request.Reque // Exponential Backoff (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) // in the Amazon DynamoDB Developer Guide. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * ItemCollectionSizeLimitExceededException // An item collection is too large. This exception is only returned for tables // that have one or more local secondary indexes. // -// * ErrCodeTransactionConflictException "TransactionConflictException" +// * TransactionConflictException // Operation was rejected because there is an ongoing transaction for the item. // -// * ErrCodeRequestLimitExceeded "RequestLimitExceeded" +// * RequestLimitExceeded // Throughput exceeds the current throughput limit for your account. Please // contact AWS Support at AWS Support (https://aws.amazon.com/support) to request // a limit increase. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateItem @@ -5067,17 +5478,17 @@ func (c *DynamoDB) UpdateTableRequest(input *UpdateTableInput) (req *request.Req // See the AWS API reference guide for Amazon DynamoDB's // API operation UpdateTable for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * 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" +// * 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" +// * LimitExceededException // There is no limit to the number of daily on-demand backups that can be taken. // // Up to 50 simultaneous table operations are allowed per account. These operations @@ -5091,7 +5502,7 @@ func (c *DynamoDB) UpdateTableRequest(input *UpdateTableInput) (req *request.Req // // There is a soft account limit of 256 tables. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTable @@ -5116,6 +5527,111 @@ func (c *DynamoDB) UpdateTableWithContext(ctx aws.Context, input *UpdateTableInp return out, req.Send() } +const opUpdateTableReplicaAutoScaling = "UpdateTableReplicaAutoScaling" + +// UpdateTableReplicaAutoScalingRequest generates a "aws/request.Request" representing the +// client's request for the UpdateTableReplicaAutoScaling operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateTableReplicaAutoScaling for more information on using the UpdateTableReplicaAutoScaling +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateTableReplicaAutoScalingRequest method. +// req, resp := client.UpdateTableReplicaAutoScalingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTableReplicaAutoScaling +func (c *DynamoDB) UpdateTableReplicaAutoScalingRequest(input *UpdateTableReplicaAutoScalingInput) (req *request.Request, output *UpdateTableReplicaAutoScalingOutput) { + op := &request.Operation{ + Name: opUpdateTableReplicaAutoScaling, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateTableReplicaAutoScalingInput{} + } + + output = &UpdateTableReplicaAutoScalingOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateTableReplicaAutoScaling API operation for Amazon DynamoDB. +// +// Updates auto scaling settings on your global tables at once. +// +// This method only applies to Version 2019.11.21 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V2.html) +// of global 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 DynamoDB's +// API operation UpdateTableReplicaAutoScaling for usage and error information. +// +// Returned Error Types: +// * 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. +// +// * 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. +// +// * LimitExceededException +// There is no limit to the number of daily on-demand backups that can be taken. +// +// Up to 50 simultaneous table operations are allowed per account. These operations +// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, +// and RestoreTableToPointInTime. +// +// The only exception is when you are creating a table with one or more secondary +// indexes. You can have up to 25 such requests running at a time; however, +// if the table or index specifications are complex, DynamoDB might temporarily +// reduce the number of concurrent operations. +// +// There is a soft account limit of 256 tables. +// +// * InternalServerError +// An error occurred on the server side. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTableReplicaAutoScaling +func (c *DynamoDB) UpdateTableReplicaAutoScaling(input *UpdateTableReplicaAutoScalingInput) (*UpdateTableReplicaAutoScalingOutput, error) { + req, out := c.UpdateTableReplicaAutoScalingRequest(input) + return out, req.Send() +} + +// UpdateTableReplicaAutoScalingWithContext is the same as UpdateTableReplicaAutoScaling with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTableReplicaAutoScaling for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *DynamoDB) UpdateTableReplicaAutoScalingWithContext(ctx aws.Context, input *UpdateTableReplicaAutoScalingInput, opts ...request.Option) (*UpdateTableReplicaAutoScalingOutput, error) { + req, out := c.UpdateTableReplicaAutoScalingRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opUpdateTimeToLive = "UpdateTimeToLive" // UpdateTimeToLiveRequest generates a "aws/request.Request" representing the @@ -5217,17 +5733,17 @@ func (c *DynamoDB) UpdateTimeToLiveRequest(input *UpdateTimeToLiveInput) (req *r // See the AWS API reference guide for Amazon DynamoDB's // API operation UpdateTimeToLive for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * 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" +// * 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" +// * LimitExceededException // There is no limit to the number of daily on-demand backups that can be taken. // // Up to 50 simultaneous table operations are allowed per account. These operations @@ -5241,7 +5757,7 @@ func (c *DynamoDB) UpdateTimeToLiveRequest(input *UpdateTimeToLiveInput) (req *r // // There is a soft account limit of 256 tables. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/dynamodb-2012-08-10/UpdateTimeToLive @@ -5266,6 +5782,56 @@ func (c *DynamoDB) UpdateTimeToLiveWithContext(ctx aws.Context, input *UpdateTim return out, req.Send() } +// Contains details of a table archival operation. +type ArchivalSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the backup the table was archived to, when + // applicable in the archival reason. If you wish to restore this backup to + // the same table name, you will need to delete the original table. + ArchivalBackupArn *string `min:"37" type:"string"` + + // The date and time when table archival was initiated by DynamoDB, in UNIX + // epoch time format. + ArchivalDateTime *time.Time `type:"timestamp"` + + // The reason DynamoDB archived the table. Currently, the only possible value + // is: + // + // * INACCESSIBLE_ENCRYPTION_CREDENTIALS - The table was archived due to + // the table's AWS KMS key being inaccessible for more than seven days. An + // On-Demand backup was created at the archival time. + ArchivalReason *string `type:"string"` +} + +// String returns the string representation +func (s ArchivalSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ArchivalSummary) GoString() string { + return s.String() +} + +// SetArchivalBackupArn sets the ArchivalBackupArn field's value. +func (s *ArchivalSummary) SetArchivalBackupArn(v string) *ArchivalSummary { + s.ArchivalBackupArn = &v + return s +} + +// SetArchivalDateTime sets the ArchivalDateTime field's value. +func (s *ArchivalSummary) SetArchivalDateTime(v time.Time) *ArchivalSummary { + s.ArchivalDateTime = &v + return s +} + +// SetArchivalReason sets the ArchivalReason field's value. +func (s *ArchivalSummary) SetArchivalReason(v string) *ArchivalSummary { + s.ArchivalReason = &v + return s +} + // Represents an attribute for describing the key schema for the table and indexes. type AttributeDefinition struct { _ struct{} `type:"structure"` @@ -5603,7 +6169,7 @@ func (s *AutoScalingPolicyDescription) SetTargetTrackingScalingPolicyConfigurati return s } -// Represents the autoscaling policy to be modified. +// Represents the auto scaling policy to be modified. type AutoScalingPolicyUpdate struct { _ struct{} `type:"structure"` @@ -5659,15 +6225,15 @@ func (s *AutoScalingPolicyUpdate) SetTargetTrackingScalingPolicyConfiguration(v return s } -// Represents the autoscaling settings for a global table or global secondary +// Represents the auto scaling settings for a global table or global secondary // index. type AutoScalingSettingsDescription struct { _ struct{} `type:"structure"` - // Disabled autoscaling for this global table or global secondary index. + // Disabled auto scaling for this global table or global secondary index. AutoScalingDisabled *bool `type:"boolean"` - // Role ARN used for configuring autoScaling policy. + // Role ARN used for configuring the auto scaling policy. AutoScalingRoleArn *string `type:"string"` // The maximum capacity units that a global table or global secondary index @@ -5722,15 +6288,15 @@ func (s *AutoScalingSettingsDescription) SetScalingPolicies(v []*AutoScalingPoli return s } -// Represents the autoscaling settings to be modified for a global table or +// Represents the auto scaling settings to be modified for a global table or // global secondary index. type AutoScalingSettingsUpdate struct { _ struct{} `type:"structure"` - // Disabled autoscaling for this global table or global secondary index. + // Disabled auto scaling for this global table or global secondary index. AutoScalingDisabled *bool `type:"boolean"` - // Role ARN used for configuring autoscaling policy. + // Role ARN used for configuring auto scaling policy. AutoScalingRoleArn *string `min:"1" type:"string"` // The maximum capacity units that a global table or global secondary index @@ -5826,7 +6392,7 @@ type AutoScalingTargetTrackingScalingPolicyConfigurationDescription struct { // subsequent scale in requests until it has expired. You should 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 - // autoscaling scales out your scalable target immediately. + // auto scaling scales out your scalable target immediately. ScaleInCooldown *int64 `type:"integer"` // The amount of time, in seconds, after a scale out activity completes before @@ -5894,7 +6460,7 @@ type AutoScalingTargetTrackingScalingPolicyConfigurationUpdate struct { // subsequent scale in requests until it has expired. You should 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 - // autoscaling scales out your scalable target immediately. + // auto scaling scales out your scalable target immediately. ScaleInCooldown *int64 `type:"integer"` // The amount of time, in seconds, after a scale out activity completes before @@ -6099,6 +6665,119 @@ func (s *BackupDetails) SetBackupType(v string) *BackupDetails { return s } +// There is another ongoing conflicting backup control plane operation on the +// table. The backup is either being created, deleted or restored to a table. +type BackupInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BackupInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BackupInUseException) GoString() string { + return s.String() +} + +func newErrorBackupInUseException(v protocol.ResponseMetadata) error { + return &BackupInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BackupInUseException) Code() string { + return "BackupInUseException" +} + +// Message returns the exception's message. +func (s BackupInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BackupInUseException) OrigErr() error { + return nil +} + +func (s BackupInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BackupInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BackupInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// Backup not found for the given BackupARN. +type BackupNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BackupNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BackupNotFoundException) GoString() string { + return s.String() +} + +func newErrorBackupNotFoundException(v protocol.ResponseMetadata) error { + return &BackupNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BackupNotFoundException) Code() string { + return "BackupNotFoundException" +} + +// Message returns the exception's message. +func (s BackupNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BackupNotFoundException) OrigErr() error { + return nil +} + +func (s BackupNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BackupNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BackupNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains details for the backup. type BackupSummary struct { _ struct{} `type:"structure"` @@ -6897,7 +7576,7 @@ func (s *Condition) SetComparisonOperator(v string) *Condition { } // Represents a request to perform a check that an item exists or to check the -// condition of specific attributes of the item.. +// condition of specific attributes of the item. type ConditionCheck struct { _ struct{} `type:"structure"` @@ -6997,6 +7676,63 @@ func (s *ConditionCheck) SetTableName(v string) *ConditionCheck { return s } +// A condition specified in the operation could not be evaluated. +type ConditionalCheckFailedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The conditional request failed. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConditionalCheckFailedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConditionalCheckFailedException) GoString() string { + return s.String() +} + +func newErrorConditionalCheckFailedException(v protocol.ResponseMetadata) error { + return &ConditionalCheckFailedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConditionalCheckFailedException) Code() string { + return "ConditionalCheckFailedException" +} + +// Message returns the exception's message. +func (s ConditionalCheckFailedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConditionalCheckFailedException) OrigErr() error { + return nil +} + +func (s ConditionalCheckFailedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConditionalCheckFailedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConditionalCheckFailedException) RequestID() string { + return s.respMetadata.RequestID +} + // 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 @@ -7116,13 +7852,112 @@ func (s *ContinuousBackupsDescription) SetPointInTimeRecoveryDescription(v *Poin return s } -type CreateBackupInput struct { - _ struct{} `type:"structure"` +// Backups have not yet been enabled for this table. +type ContinuousBackupsUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Specified name for the backup. - // - // BackupName is a required field - BackupName *string `min:"3" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ContinuousBackupsUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ContinuousBackupsUnavailableException) GoString() string { + return s.String() +} + +func newErrorContinuousBackupsUnavailableException(v protocol.ResponseMetadata) error { + return &ContinuousBackupsUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ContinuousBackupsUnavailableException) Code() string { + return "ContinuousBackupsUnavailableException" +} + +// Message returns the exception's message. +func (s ContinuousBackupsUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ContinuousBackupsUnavailableException) OrigErr() error { + return nil +} + +func (s ContinuousBackupsUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ContinuousBackupsUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ContinuousBackupsUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + +// Represents a Contributor Insights summary entry.. +type ContributorInsightsSummary struct { + _ struct{} `type:"structure"` + + // Describes the current status for contributor insights for the given table + // and index, if applicable. + ContributorInsightsStatus *string `type:"string" enum:"ContributorInsightsStatus"` + + // Name of the index associated with the summary, if any. + IndexName *string `min:"3" type:"string"` + + // Name of the table associated with the summary. + TableName *string `min:"3" type:"string"` +} + +// String returns the string representation +func (s ContributorInsightsSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ContributorInsightsSummary) GoString() string { + return s.String() +} + +// SetContributorInsightsStatus sets the ContributorInsightsStatus field's value. +func (s *ContributorInsightsSummary) SetContributorInsightsStatus(v string) *ContributorInsightsSummary { + s.ContributorInsightsStatus = &v + return s +} + +// SetIndexName sets the IndexName field's value. +func (s *ContributorInsightsSummary) SetIndexName(v string) *ContributorInsightsSummary { + s.IndexName = &v + return s +} + +// SetTableName sets the TableName field's value. +func (s *ContributorInsightsSummary) SetTableName(v string) *ContributorInsightsSummary { + s.TableName = &v + return s +} + +type CreateBackupInput struct { + _ struct{} `type:"structure"` + + // Specified name for the backup. + // + // BackupName is a required field + BackupName *string `min:"3" type:"string" required:"true"` // The name of the table. // @@ -7388,7 +8223,7 @@ func (s *CreateGlobalTableOutput) SetGlobalTableDescription(v *GlobalTableDescri type CreateReplicaAction struct { _ struct{} `type:"structure"` - // The region of the replica to be added. + // The Region of the replica to be added. // // RegionName is a required field RegionName *string `type:"string" required:"true"` @@ -7423,6 +8258,94 @@ func (s *CreateReplicaAction) SetRegionName(v string) *CreateReplicaAction { return s } +// Represents a replica to be created. +type CreateReplicationGroupMemberAction struct { + _ struct{} `type:"structure"` + + // Replica-specific global secondary index settings. + GlobalSecondaryIndexes []*ReplicaGlobalSecondaryIndex `min:"1" type:"list"` + + // The AWS KMS customer master key (CMK) that should be used for AWS KMS encryption + // in the new replica. To specify a CMK, use its key ID, Amazon Resource Name + // (ARN), alias name, or alias ARN. Note that you should only provide this parameter + // if the key is different from the default DynamoDB KMS master key alias/aws/dynamodb. + KMSMasterKeyId *string `type:"string"` + + // Replica-specific provisioned throughput. If not specified, uses the source + // table's provisioned throughput settings. + ProvisionedThroughputOverride *ProvisionedThroughputOverride `type:"structure"` + + // The Region where the new replica will be created. + // + // RegionName is a required field + RegionName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateReplicationGroupMemberAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateReplicationGroupMemberAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateReplicationGroupMemberAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateReplicationGroupMemberAction"} + if s.GlobalSecondaryIndexes != nil && len(s.GlobalSecondaryIndexes) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GlobalSecondaryIndexes", 1)) + } + if s.RegionName == nil { + invalidParams.Add(request.NewErrParamRequired("RegionName")) + } + 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.ProvisionedThroughputOverride != nil { + if err := s.ProvisionedThroughputOverride.Validate(); err != nil { + invalidParams.AddNested("ProvisionedThroughputOverride", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGlobalSecondaryIndexes sets the GlobalSecondaryIndexes field's value. +func (s *CreateReplicationGroupMemberAction) SetGlobalSecondaryIndexes(v []*ReplicaGlobalSecondaryIndex) *CreateReplicationGroupMemberAction { + s.GlobalSecondaryIndexes = v + return s +} + +// SetKMSMasterKeyId sets the KMSMasterKeyId field's value. +func (s *CreateReplicationGroupMemberAction) SetKMSMasterKeyId(v string) *CreateReplicationGroupMemberAction { + s.KMSMasterKeyId = &v + return s +} + +// SetProvisionedThroughputOverride sets the ProvisionedThroughputOverride field's value. +func (s *CreateReplicationGroupMemberAction) SetProvisionedThroughputOverride(v *ProvisionedThroughputOverride) *CreateReplicationGroupMemberAction { + s.ProvisionedThroughputOverride = v + return s +} + +// SetRegionName sets the RegionName field's value. +func (s *CreateReplicationGroupMemberAction) SetRegionName(v string) *CreateReplicationGroupMemberAction { + s.RegionName = &v + return s +} + // Represents the input of a CreateTable operation. type CreateTableInput struct { _ struct{} `type:"structure"` @@ -7435,11 +8358,11 @@ type CreateTableInput struct { // Controls how you are charged for read and write throughput and how you manage // capacity. This setting can be changed later. // - // * PROVISIONED - Sets the billing mode to PROVISIONED. We recommend using - // PROVISIONED for predictable workloads. + // * PROVISIONED - We recommend using PROVISIONED for predictable workloads. + // PROVISIONED sets the billing mode to Provisioned Mode (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.ProvisionedThroughput.Manual). // - // * PAY_PER_REQUEST - Sets the billing mode to PAY_PER_REQUEST. We recommend - // using PAY_PER_REQUEST for unpredictable workloads. + // * PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable + // workloads. PAY_PER_REQUEST sets the billing mode to On-Demand Mode (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.OnDemand). BillingMode *string `type:"string" enum:"BillingMode"` // One or more global secondary indexes (the maximum is 20) to be created on @@ -7642,6 +8565,11 @@ func (s *CreateTableInput) Validate() error { invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams)) } } + if s.StreamSpecification != nil { + if err := s.StreamSpecification.Validate(); err != nil { + invalidParams.AddNested("StreamSpecification", err.(request.ErrInvalidParams)) + } + } if s.Tags != nil { for i, v := range s.Tags { if v == nil { @@ -8243,7 +9171,7 @@ func (s *DeleteItemOutput) SetItemCollectionMetrics(v *ItemCollectionMetrics) *D type DeleteReplicaAction struct { _ struct{} `type:"structure"` - // The region of the replica to be removed. + // The Region of the replica to be removed. // // RegionName is a required field RegionName *string `type:"string" required:"true"` @@ -8278,6 +9206,45 @@ func (s *DeleteReplicaAction) SetRegionName(v string) *DeleteReplicaAction { return s } +// Represents a replica to be deleted. +type DeleteReplicationGroupMemberAction struct { + _ struct{} `type:"structure"` + + // The Region where the replica exists. + // + // RegionName is a required field + RegionName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteReplicationGroupMemberAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteReplicationGroupMemberAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteReplicationGroupMemberAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteReplicationGroupMemberAction"} + if s.RegionName == nil { + invalidParams.Add(request.NewErrParamRequired("RegionName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRegionName sets the RegionName field's value. +func (s *DeleteReplicationGroupMemberAction) SetRegionName(v string) *DeleteReplicationGroupMemberAction { + s.RegionName = &v + return s +} + // Represents a request to perform a DeleteItem operation on an item. type DeleteRequest struct { _ struct{} `type:"structure"` @@ -8502,6 +9469,142 @@ func (s *DescribeContinuousBackupsOutput) SetContinuousBackupsDescription(v *Con return s } +type DescribeContributorInsightsInput struct { + _ struct{} `type:"structure"` + + // The name of the global secondary index to describe, if applicable. + IndexName *string `min:"3" type:"string"` + + // 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 DescribeContributorInsightsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeContributorInsightsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeContributorInsightsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeContributorInsightsInput"} + if s.IndexName != nil && len(*s.IndexName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) + } + 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 +} + +// SetIndexName sets the IndexName field's value. +func (s *DescribeContributorInsightsInput) SetIndexName(v string) *DescribeContributorInsightsInput { + s.IndexName = &v + return s +} + +// SetTableName sets the TableName field's value. +func (s *DescribeContributorInsightsInput) SetTableName(v string) *DescribeContributorInsightsInput { + s.TableName = &v + return s +} + +type DescribeContributorInsightsOutput struct { + _ struct{} `type:"structure"` + + // List of names of the associated Alpine rules. + ContributorInsightsRuleList []*string `type:"list"` + + // Current Status contributor insights. + ContributorInsightsStatus *string `type:"string" enum:"ContributorInsightsStatus"` + + // Returns information about the last failure that encountered. + // + // The most common exceptions for a FAILED status are: + // + // * LimitExceededException - Per-account Amazon CloudWatch Contributor Insights + // rule limit reached. Please disable Contributor Insights for other tables/indexes + // OR disable Contributor Insights rules before retrying. + // + // * AccessDeniedException - Amazon CloudWatch Contributor Insights rules + // cannot be modified due to insufficient permissions. + // + // * AccessDeniedException - Failed to create service-linked role for Contributor + // Insights due to insufficient permissions. + // + // * InternalServerError - Failed to create Amazon CloudWatch Contributor + // Insights rules. Please retry request. + FailureException *FailureException `type:"structure"` + + // The name of the global secondary index being described. + IndexName *string `min:"3" type:"string"` + + // Timestamp of the last time the status was changed. + LastUpdateDateTime *time.Time `type:"timestamp"` + + // The name of the table being described. + TableName *string `min:"3" type:"string"` +} + +// String returns the string representation +func (s DescribeContributorInsightsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeContributorInsightsOutput) GoString() string { + return s.String() +} + +// SetContributorInsightsRuleList sets the ContributorInsightsRuleList field's value. +func (s *DescribeContributorInsightsOutput) SetContributorInsightsRuleList(v []*string) *DescribeContributorInsightsOutput { + s.ContributorInsightsRuleList = v + return s +} + +// SetContributorInsightsStatus sets the ContributorInsightsStatus field's value. +func (s *DescribeContributorInsightsOutput) SetContributorInsightsStatus(v string) *DescribeContributorInsightsOutput { + s.ContributorInsightsStatus = &v + return s +} + +// SetFailureException sets the FailureException field's value. +func (s *DescribeContributorInsightsOutput) SetFailureException(v *FailureException) *DescribeContributorInsightsOutput { + s.FailureException = v + return s +} + +// SetIndexName sets the IndexName field's value. +func (s *DescribeContributorInsightsOutput) SetIndexName(v string) *DescribeContributorInsightsOutput { + s.IndexName = &v + return s +} + +// SetLastUpdateDateTime sets the LastUpdateDateTime field's value. +func (s *DescribeContributorInsightsOutput) SetLastUpdateDateTime(v time.Time) *DescribeContributorInsightsOutput { + s.LastUpdateDateTime = &v + return s +} + +// SetTableName sets the TableName field's value. +func (s *DescribeContributorInsightsOutput) SetTableName(v string) *DescribeContributorInsightsOutput { + s.TableName = &v + return s +} + type DescribeEndpointsInput struct { _ struct{} `type:"structure"` } @@ -8816,28 +9919,28 @@ func (s *DescribeTableOutput) SetTable(v *TableDescription) *DescribeTableOutput return s } -type DescribeTimeToLiveInput struct { +type DescribeTableReplicaAutoScalingInput struct { _ struct{} `type:"structure"` - // The name of the table to be described. + // The name of the table. // // TableName is a required field TableName *string `min:"3" type:"string" required:"true"` } // String returns the string representation -func (s DescribeTimeToLiveInput) String() string { +func (s DescribeTableReplicaAutoScalingInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeTimeToLiveInput) GoString() string { +func (s DescribeTableReplicaAutoScalingInput) 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"} +func (s *DescribeTableReplicaAutoScalingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTableReplicaAutoScalingInput"} if s.TableName == nil { invalidParams.Add(request.NewErrParamRequired("TableName")) } @@ -8852,7 +9955,71 @@ func (s *DescribeTimeToLiveInput) Validate() error { } // SetTableName sets the TableName field's value. -func (s *DescribeTimeToLiveInput) SetTableName(v string) *DescribeTimeToLiveInput { +func (s *DescribeTableReplicaAutoScalingInput) SetTableName(v string) *DescribeTableReplicaAutoScalingInput { + s.TableName = &v + return s +} + +type DescribeTableReplicaAutoScalingOutput struct { + _ struct{} `type:"structure"` + + // Represents the auto scaling properties of the table. + TableAutoScalingDescription *TableAutoScalingDescription `type:"structure"` +} + +// String returns the string representation +func (s DescribeTableReplicaAutoScalingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTableReplicaAutoScalingOutput) GoString() string { + return s.String() +} + +// SetTableAutoScalingDescription sets the TableAutoScalingDescription field's value. +func (s *DescribeTableReplicaAutoScalingOutput) SetTableAutoScalingDescription(v *TableAutoScalingDescription) *DescribeTableReplicaAutoScalingOutput { + s.TableAutoScalingDescription = v + return s +} + +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 } @@ -8918,7 +10085,7 @@ func (s *Endpoint) SetCachePeriodInMinutes(v int64) *Endpoint { } // Represents a condition to be compared with an attribute value. This condition -// can be used with DeleteItem, PutItem or UpdateItem operations; if the comparison +// 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: // @@ -9137,6 +10304,39 @@ func (s *ExpectedAttributeValue) SetValue(v *AttributeValue) *ExpectedAttributeV return s } +// Represents a failure a contributor insights operation. +type FailureException struct { + _ struct{} `type:"structure"` + + // Description of the failure. + ExceptionDescription *string `type:"string"` + + // Exception name. + ExceptionName *string `type:"string"` +} + +// String returns the string representation +func (s FailureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FailureException) GoString() string { + return s.String() +} + +// SetExceptionDescription sets the ExceptionDescription field's value. +func (s *FailureException) SetExceptionDescription(v string) *FailureException { + s.ExceptionDescription = &v + return s +} + +// SetExceptionName sets the ExceptionName field's value. +func (s *FailureException) SetExceptionName(v string) *FailureException { + s.ExceptionName = &v + return s +} + // Specifies an item and related attribute values to retrieve in a TransactGetItem // object. type Get struct { @@ -9443,7 +10643,7 @@ type GlobalSecondaryIndex struct { // * 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 + // "hash attribute" derives from DynamoDB's usage of an internal hash function // to evenly distribute data items across partitions, based on their partition // key values. // @@ -9549,6 +10749,59 @@ func (s *GlobalSecondaryIndex) SetProvisionedThroughput(v *ProvisionedThroughput return s } +// Represents the auto scaling settings of a global secondary index for a global +// table that will be modified. +type GlobalSecondaryIndexAutoScalingUpdate struct { + _ struct{} `type:"structure"` + + // The name of the global secondary index. + IndexName *string `min:"3" type:"string"` + + // Represents the auto scaling settings to be modified for a global table or + // global secondary index. + ProvisionedWriteCapacityAutoScalingUpdate *AutoScalingSettingsUpdate `type:"structure"` +} + +// String returns the string representation +func (s GlobalSecondaryIndexAutoScalingUpdate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GlobalSecondaryIndexAutoScalingUpdate) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GlobalSecondaryIndexAutoScalingUpdate) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GlobalSecondaryIndexAutoScalingUpdate"} + if s.IndexName != nil && len(*s.IndexName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) + } + if s.ProvisionedWriteCapacityAutoScalingUpdate != nil { + if err := s.ProvisionedWriteCapacityAutoScalingUpdate.Validate(); err != nil { + invalidParams.AddNested("ProvisionedWriteCapacityAutoScalingUpdate", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetIndexName sets the IndexName field's value. +func (s *GlobalSecondaryIndexAutoScalingUpdate) SetIndexName(v string) *GlobalSecondaryIndexAutoScalingUpdate { + s.IndexName = &v + return s +} + +// SetProvisionedWriteCapacityAutoScalingUpdate sets the ProvisionedWriteCapacityAutoScalingUpdate field's value. +func (s *GlobalSecondaryIndexAutoScalingUpdate) SetProvisionedWriteCapacityAutoScalingUpdate(v *AutoScalingSettingsUpdate) *GlobalSecondaryIndexAutoScalingUpdate { + s.ProvisionedWriteCapacityAutoScalingUpdate = v + return s +} + // Represents the properties of a global secondary index. type GlobalSecondaryIndexDescription struct { _ struct{} `type:"structure"` @@ -9560,6 +10813,11 @@ type GlobalSecondaryIndexDescription struct { // DynamoDB will do so. After all items have been processed, the backfilling // operation is complete and Backfilling is false. // + // You can delete an index that is being created during the Backfilling phase + // when IndexStatus is set to CREATING and Backfilling is true. You can't delete + // the index that is being created when IndexStatus is set to CREATING 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"` @@ -9598,7 +10856,7 @@ type GlobalSecondaryIndexDescription struct { // * 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 + // "hash attribute" derives from DynamoDB's usage of an internal hash function // to evenly distribute data items across partitions, based on their partition // key values. // @@ -9701,7 +10959,7 @@ type GlobalSecondaryIndexInfo struct { // * 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 + // "hash attribute" derives from DynamoDB's usage of an internal hash function // to evenly distribute data items across partitions, based on their partition // key values. // @@ -9847,7 +11105,7 @@ type GlobalTable struct { // The global table name. GlobalTableName *string `min:"3" type:"string"` - // The regions where the global table has replicas. + // The Regions where the global table has replicas. ReplicationGroup []*Replica `type:"list"` } @@ -9873,6 +11131,62 @@ func (s *GlobalTable) SetReplicationGroup(v []*Replica) *GlobalTable { return s } +// The specified global table already exists. +type GlobalTableAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s GlobalTableAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GlobalTableAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorGlobalTableAlreadyExistsException(v protocol.ResponseMetadata) error { + return &GlobalTableAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s GlobalTableAlreadyExistsException) Code() string { + return "GlobalTableAlreadyExistsException" +} + +// Message returns the exception's message. +func (s GlobalTableAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s GlobalTableAlreadyExistsException) OrigErr() error { + return nil +} + +func (s GlobalTableAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s GlobalTableAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s GlobalTableAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains details about the global table. type GlobalTableDescription struct { _ struct{} `type:"structure"` @@ -9897,7 +11211,7 @@ type GlobalTableDescription struct { // * ACTIVE - The global table is ready for use. GlobalTableStatus *string `type:"string" enum:"GlobalTableStatus"` - // The regions where the global table has replicas. + // The Regions where the global table has replicas. ReplicationGroup []*ReplicaDescription `type:"list"` } @@ -9952,7 +11266,7 @@ type GlobalTableGlobalSecondaryIndexSettingsUpdate struct { // IndexName is a required field IndexName *string `min:"3" type:"string" required:"true"` - // AutoScaling settings for managing a global secondary index's write capacity + // Auto scaling settings for managing a global secondary index's write capacity // units. ProvisionedWriteCapacityAutoScalingSettingsUpdate *AutoScalingSettingsUpdate `type:"structure"` @@ -10013,550 +11327,476 @@ func (s *GlobalTableGlobalSecondaryIndexSettingsUpdate) SetProvisionedWriteCapac 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. -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"` +// The specified global table does not exist. +type GlobalTableNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ItemCollectionMetrics) String() string { +func (s GlobalTableNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ItemCollectionMetrics) GoString() string { +func (s GlobalTableNotFoundException) 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 +func newErrorGlobalTableNotFoundException(v protocol.ResponseMetadata) error { + return &GlobalTableNotFoundException{ + respMetadata: v, + } } -// SetSizeEstimateRangeGB sets the SizeEstimateRangeGB field's value. -func (s *ItemCollectionMetrics) SetSizeEstimateRangeGB(v []*float64) *ItemCollectionMetrics { - s.SizeEstimateRangeGB = v - return s +// Code returns the exception type name. +func (s GlobalTableNotFoundException) Code() string { + return "GlobalTableNotFoundException" } -// Details for the requested item. -type ItemResponse struct { - _ struct{} `type:"structure"` - - // Map of attribute data consisting of the data type and attribute value. - Item map[string]*AttributeValue `type:"map"` +// Message returns the exception's message. +func (s GlobalTableNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s ItemResponse) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s GlobalTableNotFoundException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s ItemResponse) GoString() string { - return s.String() +func (s GlobalTableNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetItem sets the Item field's value. -func (s *ItemResponse) SetItem(v map[string]*AttributeValue) *ItemResponse { - s.Item = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s GlobalTableNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode } -// 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. -type KeySchemaElement struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s GlobalTableNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} - // The name of a key attribute. - // - // AttributeName is a required field - AttributeName *string `min:"1" type:"string" required:"true"` +// DynamoDB rejected the request because you retried a request with a different +// payload but with an idempotent token that was already used. +type IdempotentParameterMismatchException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s KeySchemaElement) String() string { +func (s IdempotentParameterMismatchException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s KeySchemaElement) GoString() string { +func (s IdempotentParameterMismatchException) 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")) +func newErrorIdempotentParameterMismatchException(v protocol.ResponseMetadata) error { + return &IdempotentParameterMismatchException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s IdempotentParameterMismatchException) Code() string { + return "IdempotentParameterMismatchException" +} + +// Message returns the exception's message. +func (s IdempotentParameterMismatchException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IdempotentParameterMismatchException) OrigErr() error { return nil } -// SetAttributeName sets the AttributeName field's value. -func (s *KeySchemaElement) SetAttributeName(v string) *KeySchemaElement { - s.AttributeName = &v - return s +func (s IdempotentParameterMismatchException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetKeyType sets the KeyType field's value. -func (s *KeySchemaElement) SetKeyType(v string) *KeySchemaElement { - s.KeyType = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s IdempotentParameterMismatchException) StatusCode() int { + return s.respMetadata.StatusCode } -// 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. -type KeysAndAttributes struct { - _ struct{} `type:"structure"` - - // This is a legacy parameter. Use ProjectionExpression instead. For more information, - // see Legacy Conditional Parameters (https://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 (https://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 - // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` +// RequestID returns the service's response RequestID for request. +func (s IdempotentParameterMismatchException) RequestID() string { + return s.respMetadata.RequestID +} - // 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"` +// The operation tried to access a nonexistent index. +type IndexNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ProjectionExpression *string `type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s KeysAndAttributes) String() string { +func (s IndexNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s KeysAndAttributes) GoString() string { +func (s IndexNotFoundException) 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)) +func newErrorIndexNotFoundException(v protocol.ResponseMetadata) error { + return &IndexNotFoundException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s IndexNotFoundException) Code() string { + return "IndexNotFoundException" +} + +// Message returns the exception's message. +func (s IndexNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IndexNotFoundException) OrigErr() error { return nil } -// SetAttributesToGet sets the AttributesToGet field's value. -func (s *KeysAndAttributes) SetAttributesToGet(v []*string) *KeysAndAttributes { - s.AttributesToGet = v - return s +func (s IndexNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetConsistentRead sets the ConsistentRead field's value. -func (s *KeysAndAttributes) SetConsistentRead(v bool) *KeysAndAttributes { - s.ConsistentRead = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s IndexNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *KeysAndAttributes) SetExpressionAttributeNames(v map[string]*string) *KeysAndAttributes { - s.ExpressionAttributeNames = v - return s +// RequestID returns the service's response RequestID for request. +func (s IndexNotFoundException) RequestID() string { + return s.respMetadata.RequestID } -// SetKeys sets the Keys field's value. -func (s *KeysAndAttributes) SetKeys(v []map[string]*AttributeValue) *KeysAndAttributes { - s.Keys = v - return s +// An error occurred on the server side. +type InternalServerError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The server encountered an internal error trying to fulfill the request. + Message_ *string `locationName:"message" type:"string"` } -// SetProjectionExpression sets the ProjectionExpression field's value. -func (s *KeysAndAttributes) SetProjectionExpression(v string) *KeysAndAttributes { - s.ProjectionExpression = &v - return s +// String returns the string representation +func (s InternalServerError) String() string { + return awsutil.Prettify(s) } -type ListBackupsInput struct { - _ struct{} `type:"structure"` +// GoString returns the string representation +func (s InternalServerError) GoString() string { + return s.String() +} - // The backups from the table specified by BackupType are listed. - // - // Where BackupType can be: - // - // * USER - On-demand backup created by you. - // - // * SYSTEM - On-demand backup automatically created by DynamoDB. - // - // * ALL - All types of on-demand backups (USER and SYSTEM). - BackupType *string `type:"string" enum:"BackupTypeFilter"` +func newErrorInternalServerError(v protocol.ResponseMetadata) error { + return &InternalServerError{ + respMetadata: v, + } +} - // LastEvaluatedBackupArn is the Amazon Resource Name (ARN) of the backup last - // evaluated when the current page of results was returned, inclusive of the - // current page of results. This value may be specified as the ExclusiveStartBackupArn - // of a new ListBackups operation in order to fetch the next page of results. - ExclusiveStartBackupArn *string `min:"37" type:"string"` +// Code returns the exception type name. +func (s InternalServerError) Code() string { + return "InternalServerError" +} - // Maximum number of backups to return at once. - Limit *int64 `min:"1" type:"integer"` +// Message returns the exception's message. +func (s InternalServerError) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The backups from the table specified by TableName are listed. - TableName *string `min:"3" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerError) OrigErr() error { + return nil +} - // Only backups created after this time are listed. TimeRangeLowerBound is inclusive. - TimeRangeLowerBound *time.Time `type:"timestamp"` +func (s InternalServerError) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // Only backups created before this time are listed. TimeRangeUpperBound is - // exclusive. - TimeRangeUpperBound *time.Time `type:"timestamp"` +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerError) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerError) RequestID() string { + return s.respMetadata.RequestID +} + +// An invalid restore time was specified. RestoreDateTime must be between EarliestRestorableDateTime +// and LatestRestorableDateTime. +type InvalidRestoreTimeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListBackupsInput) String() string { +func (s InvalidRestoreTimeException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListBackupsInput) GoString() string { +func (s InvalidRestoreTimeException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListBackupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListBackupsInput"} - if s.ExclusiveStartBackupArn != nil && len(*s.ExclusiveStartBackupArn) < 37 { - invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartBackupArn", 37)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) - } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams +func newErrorInvalidRestoreTimeException(v protocol.ResponseMetadata) error { + return &InvalidRestoreTimeException{ + respMetadata: v, } - return nil } -// SetBackupType sets the BackupType field's value. -func (s *ListBackupsInput) SetBackupType(v string) *ListBackupsInput { - s.BackupType = &v - return s +// Code returns the exception type name. +func (s InvalidRestoreTimeException) Code() string { + return "InvalidRestoreTimeException" } -// SetExclusiveStartBackupArn sets the ExclusiveStartBackupArn field's value. -func (s *ListBackupsInput) SetExclusiveStartBackupArn(v string) *ListBackupsInput { - s.ExclusiveStartBackupArn = &v - return s +// Message returns the exception's message. +func (s InvalidRestoreTimeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetLimit sets the Limit field's value. -func (s *ListBackupsInput) SetLimit(v int64) *ListBackupsInput { - s.Limit = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRestoreTimeException) OrigErr() error { + return nil } -// SetTableName sets the TableName field's value. -func (s *ListBackupsInput) SetTableName(v string) *ListBackupsInput { - s.TableName = &v - return s +func (s InvalidRestoreTimeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetTimeRangeLowerBound sets the TimeRangeLowerBound field's value. -func (s *ListBackupsInput) SetTimeRangeLowerBound(v time.Time) *ListBackupsInput { - s.TimeRangeLowerBound = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRestoreTimeException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetTimeRangeUpperBound sets the TimeRangeUpperBound field's value. -func (s *ListBackupsInput) SetTimeRangeUpperBound(v time.Time) *ListBackupsInput { - s.TimeRangeUpperBound = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidRestoreTimeException) RequestID() string { + return s.respMetadata.RequestID } -type ListBackupsOutput struct { +// 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. +type ItemCollectionMetrics struct { _ struct{} `type:"structure"` - // List of BackupSummary objects. - BackupSummaries []*BackupSummary `type:"list"` + // 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"` - // The ARN of the backup last evaluated when the current page of results was - // returned, inclusive of the current page of results. This value may be specified - // as the ExclusiveStartBackupArn of a new ListBackups operation in order to - // fetch the next page of results. - // - // If LastEvaluatedBackupArn is empty, then the last page of results has been - // processed and there are no more results to be retrieved. + // 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. // - // If LastEvaluatedBackupArn is not empty, this may or may not indicate that - // there is more data to be returned. All results are guaranteed to have been - // returned if and only if no value for LastEvaluatedBackupArn is returned. - LastEvaluatedBackupArn *string `min:"37" type:"string"` + // 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 ListBackupsOutput) String() string { +func (s ItemCollectionMetrics) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListBackupsOutput) GoString() string { +func (s ItemCollectionMetrics) GoString() string { return s.String() } -// SetBackupSummaries sets the BackupSummaries field's value. -func (s *ListBackupsOutput) SetBackupSummaries(v []*BackupSummary) *ListBackupsOutput { - s.BackupSummaries = v +// SetItemCollectionKey sets the ItemCollectionKey field's value. +func (s *ItemCollectionMetrics) SetItemCollectionKey(v map[string]*AttributeValue) *ItemCollectionMetrics { + s.ItemCollectionKey = v return s } -// SetLastEvaluatedBackupArn sets the LastEvaluatedBackupArn field's value. -func (s *ListBackupsOutput) SetLastEvaluatedBackupArn(v string) *ListBackupsOutput { - s.LastEvaluatedBackupArn = &v +// SetSizeEstimateRangeGB sets the SizeEstimateRangeGB field's value. +func (s *ItemCollectionMetrics) SetSizeEstimateRangeGB(v []*float64) *ItemCollectionMetrics { + s.SizeEstimateRangeGB = v return s } -type ListGlobalTablesInput struct { - _ struct{} `type:"structure"` - - // The first global table name that this operation will evaluate. - ExclusiveStartGlobalTableName *string `min:"3" type:"string"` - - // The maximum number of table names to return. - Limit *int64 `min:"1" type:"integer"` +// An item collection is too large. This exception is only returned for tables +// that have one or more local secondary indexes. +type ItemCollectionSizeLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Lists the global tables in a specific Region. - RegionName *string `type:"string"` + // The total size of an item collection has exceeded the maximum limit of 10 + // gigabytes. + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListGlobalTablesInput) String() string { +func (s ItemCollectionSizeLimitExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListGlobalTablesInput) GoString() string { +func (s ItemCollectionSizeLimitExceededException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListGlobalTablesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListGlobalTablesInput"} - if s.ExclusiveStartGlobalTableName != nil && len(*s.ExclusiveStartGlobalTableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartGlobalTableName", 3)) - } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) +func newErrorItemCollectionSizeLimitExceededException(v protocol.ResponseMetadata) error { + return &ItemCollectionSizeLimitExceededException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s ItemCollectionSizeLimitExceededException) Code() string { + return "ItemCollectionSizeLimitExceededException" +} + +// Message returns the exception's message. +func (s ItemCollectionSizeLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ItemCollectionSizeLimitExceededException) OrigErr() error { return nil } -// SetExclusiveStartGlobalTableName sets the ExclusiveStartGlobalTableName field's value. -func (s *ListGlobalTablesInput) SetExclusiveStartGlobalTableName(v string) *ListGlobalTablesInput { - s.ExclusiveStartGlobalTableName = &v - return s +func (s ItemCollectionSizeLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetLimit sets the Limit field's value. -func (s *ListGlobalTablesInput) SetLimit(v int64) *ListGlobalTablesInput { - s.Limit = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ItemCollectionSizeLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetRegionName sets the RegionName field's value. -func (s *ListGlobalTablesInput) SetRegionName(v string) *ListGlobalTablesInput { - s.RegionName = &v - return s +// RequestID returns the service's response RequestID for request. +func (s ItemCollectionSizeLimitExceededException) RequestID() string { + return s.respMetadata.RequestID } -type ListGlobalTablesOutput struct { +// Details for the requested item. +type ItemResponse struct { _ struct{} `type:"structure"` - // List of global table names. - GlobalTables []*GlobalTable `type:"list"` - - // Last evaluated global table name. - LastEvaluatedGlobalTableName *string `min:"3" type:"string"` + // Map of attribute data consisting of the data type and attribute value. + Item map[string]*AttributeValue `type:"map"` } // String returns the string representation -func (s ListGlobalTablesOutput) String() string { +func (s ItemResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListGlobalTablesOutput) GoString() string { +func (s ItemResponse) GoString() string { return s.String() } -// SetGlobalTables sets the GlobalTables field's value. -func (s *ListGlobalTablesOutput) SetGlobalTables(v []*GlobalTable) *ListGlobalTablesOutput { - s.GlobalTables = v - return s -} - -// SetLastEvaluatedGlobalTableName sets the LastEvaluatedGlobalTableName field's value. -func (s *ListGlobalTablesOutput) SetLastEvaluatedGlobalTableName(v string) *ListGlobalTablesOutput { - s.LastEvaluatedGlobalTableName = &v +// SetItem sets the Item field's value. +func (s *ItemResponse) SetItem(v map[string]*AttributeValue) *ItemResponse { + s.Item = v return s } -// Represents the input of a ListTables operation. -type ListTablesInput struct { +// 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. +type KeySchemaElement 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"` + // The name of a key attribute. + // + // AttributeName is a required field + AttributeName *string `min:"1" type:"string" required:"true"` - // A maximum number of table names to return. If this parameter is not specified, - // the limit is 100. - Limit *int64 `min:"1" type:"integer"` + // 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's 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 ListTablesInput) String() string { +func (s KeySchemaElement) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTablesInput) GoString() string { +func (s KeySchemaElement) 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)) +func (s *KeySchemaElement) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "KeySchemaElement"} + if s.AttributeName == nil { + invalidParams.Add(request.NewErrParamRequired("AttributeName")) } - if s.Limit != nil && *s.Limit < 1 { - invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + 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 { @@ -10565,227 +11805,275 @@ func (s *ListTablesInput) Validate() error { return nil } -// SetExclusiveStartTableName sets the ExclusiveStartTableName field's value. -func (s *ListTablesInput) SetExclusiveStartTableName(v string) *ListTablesInput { - s.ExclusiveStartTableName = &v +// SetAttributeName sets the AttributeName field's value. +func (s *KeySchemaElement) SetAttributeName(v string) *KeySchemaElement { + s.AttributeName = &v return s } -// SetLimit sets the Limit field's value. -func (s *ListTablesInput) SetLimit(v int64) *ListTablesInput { - s.Limit = &v +// SetKeyType sets the KeyType field's value. +func (s *KeySchemaElement) SetKeyType(v string) *KeySchemaElement { + s.KeyType = &v return s } -// Represents the output of a ListTables operation. -type ListTablesOutput struct { +// 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. +type KeysAndAttributes 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. + // This is a legacy parameter. Use ProjectionExpression instead. For more information, + // see Legacy Conditional Parameters (https://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: // - // 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"` + // * 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 (https://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 + // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) + // in the Amazon DynamoDB Developer Guide. + ExpressionAttributeNames map[string]*string `type:"map"` - // The names of the tables associated with the current account at the current - // endpoint. The maximum size of this array is 100. + // The primary key attribute values that define the items and the attributes + // associated with the items. // - // 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"` + // 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 (https://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 ListTablesOutput) String() string { +func (s KeysAndAttributes) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTablesOutput) GoString() string { +func (s KeysAndAttributes) GoString() string { return s.String() } -// SetLastEvaluatedTableName sets the LastEvaluatedTableName field's value. -func (s *ListTablesOutput) SetLastEvaluatedTableName(v string) *ListTablesOutput { - s.LastEvaluatedTableName = &v +// 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 } -// SetTableNames sets the TableNames field's value. -func (s *ListTablesOutput) SetTableNames(v []*string) *ListTablesOutput { - s.TableNames = v +// SetConsistentRead sets the ConsistentRead field's value. +func (s *KeysAndAttributes) SetConsistentRead(v bool) *KeysAndAttributes { + s.ConsistentRead = &v return s } -type ListTagsOfResourceInput struct { - _ struct{} `type:"structure"` +// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. +func (s *KeysAndAttributes) SetExpressionAttributeNames(v map[string]*string) *KeysAndAttributes { + s.ExpressionAttributeNames = v + return s +} - // 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"` +// SetKeys sets the Keys field's value. +func (s *KeysAndAttributes) SetKeys(v []map[string]*AttributeValue) *KeysAndAttributes { + s.Keys = v + return s +} - // 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"` +// SetProjectionExpression sets the ProjectionExpression field's value. +func (s *KeysAndAttributes) SetProjectionExpression(v string) *KeysAndAttributes { + s.ProjectionExpression = &v + return s +} + +// There is no limit to the number of daily on-demand backups that can be taken. +// +// Up to 50 simultaneous table operations are allowed per account. These operations +// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, +// and RestoreTableToPointInTime. +// +// The only exception is when you are creating a table with one or more secondary +// indexes. You can have up to 25 such requests running at a time; however, +// if the table or index specifications are complex, DynamoDB might temporarily +// reduce the number of concurrent operations. +// +// There is a soft account limit of 256 tables. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Too many operations for a given subscriber. + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListTagsOfResourceInput) String() string { +func (s LimitExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsOfResourceInput) GoString() string { +func (s LimitExceededException) 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 +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, } - 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 +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" } -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"` +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s ListTagsOfResourceOutput) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s ListTagsOfResourceOutput) GoString() string { - return s.String() +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetNextToken sets the NextToken field's value. -func (s *ListTagsOfResourceOutput) SetNextToken(v string) *ListTagsOfResourceOutput { - s.NextToken = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetTags sets the Tags field's value. -func (s *ListTagsOfResourceOutput) SetTags(v []*Tag) *ListTagsOfResourceOutput { - s.Tags = v - return s +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID } -// Represents the properties of a local secondary index. -type LocalSecondaryIndex struct { +type ListBackupsInput 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 + // The backups from the table specified by BackupType are listed. // - // * RANGE - sort key + // Where BackupType can be: // - // 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. + // * USER - On-demand backup created by you. // - // 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. + // * SYSTEM - On-demand backup automatically created by DynamoDB. // - // KeySchema is a required field - KeySchema []*KeySchemaElement `min:"1" type:"list" required:"true"` + // * ALL - All types of on-demand backups (USER and SYSTEM). + BackupType *string `type:"string" enum:"BackupTypeFilter"` - // 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"` + // LastEvaluatedBackupArn is the Amazon Resource Name (ARN) of the backup last + // evaluated when the current page of results was returned, inclusive of the + // current page of results. This value may be specified as the ExclusiveStartBackupArn + // of a new ListBackups operation in order to fetch the next page of results. + ExclusiveStartBackupArn *string `min:"37" type:"string"` + + // Maximum number of backups to return at once. + Limit *int64 `min:"1" type:"integer"` + + // The backups from the table specified by TableName are listed. + TableName *string `min:"3" type:"string"` + + // Only backups created after this time are listed. TimeRangeLowerBound is inclusive. + TimeRangeLowerBound *time.Time `type:"timestamp"` + + // Only backups created before this time are listed. TimeRangeUpperBound is + // exclusive. + TimeRangeUpperBound *time.Time `type:"timestamp"` } // String returns the string representation -func (s LocalSecondaryIndex) String() string { +func (s ListBackupsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LocalSecondaryIndex) GoString() string { +func (s ListBackupsInput) 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")) +func (s *ListBackupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListBackupsInput"} + if s.ExclusiveStartBackupArn != nil && len(*s.ExclusiveStartBackupArn) < 37 { + invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartBackupArn", 37)) } - 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.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) } - if s.Projection != nil { - if err := s.Projection.Validate(); err != nil { - invalidParams.AddNested("Projection", err.(request.ErrInvalidParams)) - } + if s.TableName != nil && len(*s.TableName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) } if invalidParams.Len() > 0 { @@ -10794,246 +12082,207 @@ func (s *LocalSecondaryIndex) Validate() error { return nil } -// SetIndexName sets the IndexName field's value. -func (s *LocalSecondaryIndex) SetIndexName(v string) *LocalSecondaryIndex { - s.IndexName = &v +// SetBackupType sets the BackupType field's value. +func (s *ListBackupsInput) SetBackupType(v string) *ListBackupsInput { + s.BackupType = &v return s } -// SetKeySchema sets the KeySchema field's value. -func (s *LocalSecondaryIndex) SetKeySchema(v []*KeySchemaElement) *LocalSecondaryIndex { - s.KeySchema = v +// SetExclusiveStartBackupArn sets the ExclusiveStartBackupArn field's value. +func (s *ListBackupsInput) SetExclusiveStartBackupArn(v string) *ListBackupsInput { + s.ExclusiveStartBackupArn = &v return s } -// SetProjection sets the Projection field's value. -func (s *LocalSecondaryIndex) SetProjection(v *Projection) *LocalSecondaryIndex { - s.Projection = v +// SetLimit sets the Limit field's value. +func (s *ListBackupsInput) SetLimit(v int64) *ListBackupsInput { + s.Limit = &v return s } -// Represents the properties of a local secondary index. -type LocalSecondaryIndexDescription struct { - _ struct{} `type:"structure"` +// SetTableName sets the TableName field's value. +func (s *ListBackupsInput) SetTableName(v string) *ListBackupsInput { + s.TableName = &v + return s +} - // The Amazon Resource Name (ARN) that uniquely identifies the index. - IndexArn *string `type:"string"` +// SetTimeRangeLowerBound sets the TimeRangeLowerBound field's value. +func (s *ListBackupsInput) SetTimeRangeLowerBound(v time.Time) *ListBackupsInput { + s.TimeRangeLowerBound = &v + return s +} - // Represents the name of the local secondary index. - IndexName *string `min:"3" type:"string"` +// SetTimeRangeUpperBound sets the TimeRangeUpperBound field's value. +func (s *ListBackupsInput) SetTimeRangeUpperBound(v time.Time) *ListBackupsInput { + s.TimeRangeUpperBound = &v + return s +} - // 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"` +type ListBackupsOutput struct { + _ struct{} `type:"structure"` - // 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"` + // List of BackupSummary objects. + BackupSummaries []*BackupSummary `type:"list"` - // 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 ARN of the backup last evaluated when the current page of results was + // returned, inclusive of the current page of results. This value may be specified + // as the ExclusiveStartBackupArn of a new ListBackups operation in order to + // fetch the next page of results. // - // 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. + // If LastEvaluatedBackupArn is empty, then the last page of results has been + // processed and there are no more results to be retrieved. // - // 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"` + // If LastEvaluatedBackupArn is not empty, this may or may not indicate that + // there is more data to be returned. All results are guaranteed to have been + // returned if and only if no value for LastEvaluatedBackupArn is returned. + LastEvaluatedBackupArn *string `min:"37" type:"string"` } // String returns the string representation -func (s LocalSecondaryIndexDescription) String() string { +func (s ListBackupsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LocalSecondaryIndexDescription) GoString() string { +func (s ListBackupsOutput) GoString() string { return s.String() } -// SetIndexArn sets the IndexArn field's value. -func (s *LocalSecondaryIndexDescription) SetIndexArn(v string) *LocalSecondaryIndexDescription { - s.IndexArn = &v +// SetBackupSummaries sets the BackupSummaries field's value. +func (s *ListBackupsOutput) SetBackupSummaries(v []*BackupSummary) *ListBackupsOutput { + s.BackupSummaries = v return s } -// SetIndexName sets the IndexName field's value. -func (s *LocalSecondaryIndexDescription) SetIndexName(v string) *LocalSecondaryIndexDescription { - s.IndexName = &v +// SetLastEvaluatedBackupArn sets the LastEvaluatedBackupArn field's value. +func (s *ListBackupsOutput) SetLastEvaluatedBackupArn(v string) *ListBackupsOutput { + s.LastEvaluatedBackupArn = &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 the properties of a local secondary index for the table when the -// backup was created. -type LocalSecondaryIndexInfo struct { +type ListContributorInsightsInput struct { _ struct{} `type:"structure"` - // Represents the name of the local secondary index. - IndexName *string `min:"3" type:"string"` + // Maximum number of results to return per page. + MaxResults *int64 `type:"integer"` - // The complete key schema for a local 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"` + // A token to for the desired page, if there is one. + NextToken *string `type:"string"` - // 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"` + // The name of the table. + TableName *string `min:"3" type:"string"` } // String returns the string representation -func (s LocalSecondaryIndexInfo) String() string { +func (s ListContributorInsightsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LocalSecondaryIndexInfo) GoString() string { +func (s ListContributorInsightsInput) GoString() string { return s.String() } -// SetIndexName sets the IndexName field's value. -func (s *LocalSecondaryIndexInfo) SetIndexName(v string) *LocalSecondaryIndexInfo { - s.IndexName = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListContributorInsightsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListContributorInsightsInput"} + if s.TableName != nil && len(*s.TableName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListContributorInsightsInput) SetMaxResults(v int64) *ListContributorInsightsInput { + s.MaxResults = &v return s } -// SetKeySchema sets the KeySchema field's value. -func (s *LocalSecondaryIndexInfo) SetKeySchema(v []*KeySchemaElement) *LocalSecondaryIndexInfo { - s.KeySchema = v +// SetNextToken sets the NextToken field's value. +func (s *ListContributorInsightsInput) SetNextToken(v string) *ListContributorInsightsInput { + s.NextToken = &v return s } -// SetProjection sets the Projection field's value. -func (s *LocalSecondaryIndexInfo) SetProjection(v *Projection) *LocalSecondaryIndexInfo { - s.Projection = v +// SetTableName sets the TableName field's value. +func (s *ListContributorInsightsInput) SetTableName(v string) *ListContributorInsightsInput { + s.TableName = &v return s } -// The description of the point in time settings applied to the table. -type PointInTimeRecoveryDescription struct { +type ListContributorInsightsOutput struct { _ struct{} `type:"structure"` - // Specifies the earliest point in time you can restore your table to. It You - // can restore your table to any point in time during the last 35 days. - EarliestRestorableDateTime *time.Time `type:"timestamp"` - - // LatestRestorableDateTime is typically 5 minutes before the current time. - LatestRestorableDateTime *time.Time `type:"timestamp"` + // A list of ContributorInsightsSummary. + ContributorInsightsSummaries []*ContributorInsightsSummary `type:"list"` - // The current state of point in time recovery: - // - // * ENABLING - Point in time recovery is being enabled. - // - // * ENABLED - Point in time recovery is enabled. - // - // * DISABLED - Point in time recovery is disabled. - PointInTimeRecoveryStatus *string `type:"string" enum:"PointInTimeRecoveryStatus"` + // A token to go to the next page if there is one. + NextToken *string `type:"string"` } // String returns the string representation -func (s PointInTimeRecoveryDescription) String() string { +func (s ListContributorInsightsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PointInTimeRecoveryDescription) GoString() string { +func (s ListContributorInsightsOutput) GoString() string { return s.String() } -// SetEarliestRestorableDateTime sets the EarliestRestorableDateTime field's value. -func (s *PointInTimeRecoveryDescription) SetEarliestRestorableDateTime(v time.Time) *PointInTimeRecoveryDescription { - s.EarliestRestorableDateTime = &v - return s -} - -// SetLatestRestorableDateTime sets the LatestRestorableDateTime field's value. -func (s *PointInTimeRecoveryDescription) SetLatestRestorableDateTime(v time.Time) *PointInTimeRecoveryDescription { - s.LatestRestorableDateTime = &v +// SetContributorInsightsSummaries sets the ContributorInsightsSummaries field's value. +func (s *ListContributorInsightsOutput) SetContributorInsightsSummaries(v []*ContributorInsightsSummary) *ListContributorInsightsOutput { + s.ContributorInsightsSummaries = v return s } -// SetPointInTimeRecoveryStatus sets the PointInTimeRecoveryStatus field's value. -func (s *PointInTimeRecoveryDescription) SetPointInTimeRecoveryStatus(v string) *PointInTimeRecoveryDescription { - s.PointInTimeRecoveryStatus = &v +// SetNextToken sets the NextToken field's value. +func (s *ListContributorInsightsOutput) SetNextToken(v string) *ListContributorInsightsOutput { + s.NextToken = &v return s } -// Represents the settings used to enable point in time recovery. -type PointInTimeRecoverySpecification struct { +type ListGlobalTablesInput struct { _ struct{} `type:"structure"` - // Indicates whether point in time recovery is enabled (true) or disabled (false) - // on the table. + // The first global table name that this operation will evaluate. + ExclusiveStartGlobalTableName *string `min:"3" type:"string"` + + // The maximum number of table names to return, if the parameter is not specified + // DynamoDB defaults to 100. // - // PointInTimeRecoveryEnabled is a required field - PointInTimeRecoveryEnabled *bool `type:"boolean" required:"true"` + // If the number of global tables DynamoDB finds reaches this limit, it stops + // the operation and returns the table names collected up to that point, with + // a table name in the LastEvaluatedGlobalTableName to apply in a subsequent + // operation to the ExclusiveStartGlobalTableName parameter. + Limit *int64 `min:"1" type:"integer"` + + // Lists the global tables in a specific Region. + RegionName *string `type:"string"` } // String returns the string representation -func (s PointInTimeRecoverySpecification) String() string { +func (s ListGlobalTablesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PointInTimeRecoverySpecification) GoString() string { +func (s ListGlobalTablesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *PointInTimeRecoverySpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PointInTimeRecoverySpecification"} - if s.PointInTimeRecoveryEnabled == nil { - invalidParams.Add(request.NewErrParamRequired("PointInTimeRecoveryEnabled")) +func (s *ListGlobalTablesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListGlobalTablesInput"} + if s.ExclusiveStartGlobalTableName != nil && len(*s.ExclusiveStartGlobalTableName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("ExclusiveStartGlobalTableName", 3)) + } + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) } if invalidParams.Len() > 0 { @@ -11042,126 +12291,88 @@ func (s *PointInTimeRecoverySpecification) Validate() error { return nil } -// SetPointInTimeRecoveryEnabled sets the PointInTimeRecoveryEnabled field's value. -func (s *PointInTimeRecoverySpecification) SetPointInTimeRecoveryEnabled(v bool) *PointInTimeRecoverySpecification { - s.PointInTimeRecoveryEnabled = &v +// SetExclusiveStartGlobalTableName sets the ExclusiveStartGlobalTableName field's value. +func (s *ListGlobalTablesInput) SetExclusiveStartGlobalTableName(v string) *ListGlobalTablesInput { + s.ExclusiveStartGlobalTableName = &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. -type Projection struct { +// SetLimit sets the Limit field's value. +func (s *ListGlobalTablesInput) SetLimit(v int64) *ListGlobalTablesInput { + s.Limit = &v + return s +} + +// SetRegionName sets the RegionName field's value. +func (s *ListGlobalTablesInput) SetRegionName(v string) *ListGlobalTablesInput { + s.RegionName = &v + return s +} + +type ListGlobalTablesOutput 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"` + // List of global table names. + GlobalTables []*GlobalTable `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"` + // Last evaluated global table name. + LastEvaluatedGlobalTableName *string `min:"3" type:"string"` } // String returns the string representation -func (s Projection) String() string { +func (s ListGlobalTablesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Projection) GoString() string { +func (s ListGlobalTablesOutput) 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 +// SetGlobalTables sets the GlobalTables field's value. +func (s *ListGlobalTablesOutput) SetGlobalTables(v []*GlobalTable) *ListGlobalTablesOutput { + s.GlobalTables = v return s } -// SetProjectionType sets the ProjectionType field's value. -func (s *Projection) SetProjectionType(v string) *Projection { - s.ProjectionType = &v +// SetLastEvaluatedGlobalTableName sets the LastEvaluatedGlobalTableName field's value. +func (s *ListGlobalTablesOutput) SetLastEvaluatedGlobalTableName(v string) *ListGlobalTablesOutput { + s.LastEvaluatedGlobalTableName = &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 -// (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) -// in the Amazon DynamoDB Developer Guide. -type ProvisionedThroughput struct { +// Represents the input of a ListTables operation. +type ListTablesInput 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 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) - // in the Amazon DynamoDB Developer Guide. - // - // If read/write capacity mode is PAY_PER_REQUEST the value is set to 0. - // - // ReadCapacityUnits is a required field - ReadCapacityUnits *int64 `min:"1" type:"long" required:"true"` + // 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"` - // The maximum number of writes consumed per second before DynamoDB returns - // a ThrottlingException. For more information, see Specifying Read and Write - // Requirements (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) - // in the Amazon DynamoDB Developer Guide. - // - // If read/write capacity mode is PAY_PER_REQUEST the value is set to 0. - // - // WriteCapacityUnits is a required field - WriteCapacityUnits *int64 `min:"1" type:"long" required:"true"` + // 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 ProvisionedThroughput) String() string { +func (s ListTablesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ProvisionedThroughput) GoString() string { +func (s ListTablesInput) 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")) +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.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 s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) } if invalidParams.Len() > 0 { @@ -11170,140 +12381,94 @@ func (s *ProvisionedThroughput) Validate() error { return nil } -// SetReadCapacityUnits sets the ReadCapacityUnits field's value. -func (s *ProvisionedThroughput) SetReadCapacityUnits(v int64) *ProvisionedThroughput { - s.ReadCapacityUnits = &v +// SetExclusiveStartTableName sets the ExclusiveStartTableName field's value. +func (s *ListTablesInput) SetExclusiveStartTableName(v string) *ListTablesInput { + s.ExclusiveStartTableName = &v return s } -// SetWriteCapacityUnits sets the WriteCapacityUnits field's value. -func (s *ProvisionedThroughput) SetWriteCapacityUnits(v int64) *ProvisionedThroughput { - s.WriteCapacityUnits = &v +// SetLimit sets the Limit field's value. +func (s *ListTablesInput) SetLimit(v int64) *ListTablesInput { + s.Limit = &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. -type ProvisionedThroughputDescription struct { +// Represents the output of a ListTables operation. +type ListTablesOutput struct { _ struct{} `type:"structure"` - // The date and time of the last provisioned throughput decrease for this table. - LastDecreaseDateTime *time.Time `type:"timestamp"` - - // The date and time of the last provisioned throughput increase for this table. - LastIncreaseDateTime *time.Time `type:"timestamp"` - - // The number of provisioned throughput decreases for this table during this - // UTC calendar day. For current maximums on provisioned throughput decreases, - // see Limits (https://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 `type:"long"` + // 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 maximum number of writes consumed per second before DynamoDB returns - // a ThrottlingException. - WriteCapacityUnits *int64 `type:"long"` + // 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 ProvisionedThroughputDescription) String() string { +func (s ListTablesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ProvisionedThroughputDescription) GoString() string { +func (s ListTablesOutput) 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 +// SetLastEvaluatedTableName sets the LastEvaluatedTableName field's value. +func (s *ListTablesOutput) SetLastEvaluatedTableName(v string) *ListTablesOutput { + s.LastEvaluatedTableName = &v return s } -// SetWriteCapacityUnits sets the WriteCapacityUnits field's value. -func (s *ProvisionedThroughputDescription) SetWriteCapacityUnits(v int64) *ProvisionedThroughputDescription { - s.WriteCapacityUnits = &v +// SetTableNames sets the TableNames field's value. +func (s *ListTablesOutput) SetTableNames(v []*string) *ListTablesOutput { + s.TableNames = v return s } -// Represents a request to perform a PutItem operation. -type Put struct { +type ListTagsOfResourceInput struct { _ struct{} `type:"structure"` - // A condition that must be satisfied in order for a conditional update to succeed. - ConditionExpression *string `type:"string"` - - // One or more substitution tokens for attribute names in an expression. - ExpressionAttributeNames map[string]*string `type:"map"` - - // One or more values that can be substituted in an expression. - ExpressionAttributeValues map[string]*AttributeValue `type:"map"` - - // A map of attribute name to attribute values, representing the primary key - // of the item to be written 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 that 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"` - - // Use ReturnValuesOnConditionCheckFailure to get the item attributes if the - // Put condition fails. For ReturnValuesOnConditionCheckFailure, the valid values - // are: NONE and ALL_OLD. - ReturnValuesOnConditionCheckFailure *string `type:"string" enum:"ReturnValuesOnConditionCheckFailure"` + // 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"` - // Name of the table in which to write the item. + // The Amazon DynamoDB resource with tags to be listed. This value is an Amazon + // Resource Name (ARN). // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` + // ResourceArn is a required field + ResourceArn *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s Put) String() string { +func (s ListTagsOfResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Put) GoString() string { +func (s ListTagsOfResourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *Put) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Put"} - if s.Item == nil { - invalidParams.Add(request.NewErrParamRequired("Item")) - } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) +func (s *ListTagsOfResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTagsOfResourceInput"} + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) + if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) } if invalidParams.Len() > 0 { @@ -11312,215 +12477,131 @@ func (s *Put) Validate() error { return nil } -// SetConditionExpression sets the ConditionExpression field's value. -func (s *Put) SetConditionExpression(v string) *Put { - s.ConditionExpression = &v +// SetNextToken sets the NextToken field's value. +func (s *ListTagsOfResourceInput) SetNextToken(v string) *ListTagsOfResourceInput { + s.NextToken = &v return s } -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *Put) SetExpressionAttributeNames(v map[string]*string) *Put { - s.ExpressionAttributeNames = v +// SetResourceArn sets the ResourceArn field's value. +func (s *ListTagsOfResourceInput) SetResourceArn(v string) *ListTagsOfResourceInput { + s.ResourceArn = &v return s } -// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value. -func (s *Put) SetExpressionAttributeValues(v map[string]*AttributeValue) *Put { - s.ExpressionAttributeValues = v - return s +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"` } -// SetItem sets the Item field's value. -func (s *Put) SetItem(v map[string]*AttributeValue) *Put { - s.Item = v - return s +// String returns the string representation +func (s ListTagsOfResourceOutput) String() string { + return awsutil.Prettify(s) } -// SetReturnValuesOnConditionCheckFailure sets the ReturnValuesOnConditionCheckFailure field's value. -func (s *Put) SetReturnValuesOnConditionCheckFailure(v string) *Put { - s.ReturnValuesOnConditionCheckFailure = &v +// 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 } -// SetTableName sets the TableName field's value. -func (s *Put) SetTableName(v string) *Put { - s.TableName = &v +// SetTags sets the Tags field's value. +func (s *ListTagsOfResourceOutput) SetTags(v []*Tag) *ListTagsOfResourceOutput { + s.Tags = v return s } -// Represents the input of a PutItem operation. -type PutItemInput struct { +// Represents the properties of a local secondary index. +type LocalSecondaryIndex 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 + // The name of the local secondary index. The name must be unique among all + // other indexes on this table. // - // For more information on condition expressions, see Condition Expressions - // (https://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 (https://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 ConditionExpression instead. For more information, - // see Expected (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.Expected.html) - // in the Amazon DynamoDB Developer Guide. - Expected map[string]*ExpectedAttributeValue `type:"map"` + // IndexName is a required field + IndexName *string `min:"3" type:"string" required:"true"` - // One or more substitution tokens for attribute names in an expression. The - // following are some use cases for using ExpressionAttributeNames: + // The complete key schema for the local secondary index, consisting of one + // or more pairs of attribute names and key types: // - // * To access an attribute whose name conflicts with a DynamoDB reserved - // word. + // * HASH - partition key // - // * To create a placeholder for repeating occurrences of an attribute name - // in an expression. + // * RANGE - sort key // - // * To prevent special characters in an attribute name from being misinterpreted - // in an expression. + // The partition key of an item is also known as its hash attribute. The term + // "hash attribute" derives from DynamoDB's usage of an internal hash function + // to evenly distribute data items across partitions, based on their partition + // key values. // - // Use the # character in an expression to dereference an attribute name. For - // example, consider the following attribute name: + // 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. // - // * Percentile + // 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. // - // 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 (https://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 Specifying Item Attributes - // (https://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 Condition Expressions - // (https://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 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.PrimaryKey) - // 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"` + // Projection is a required field + Projection *Projection `type:"structure" required:"true"` } // String returns the string representation -func (s PutItemInput) String() string { +func (s LocalSecondaryIndex) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutItemInput) GoString() string { +func (s LocalSecondaryIndex) 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")) +func (s *LocalSecondaryIndex) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LocalSecondaryIndex"} + if s.IndexName == nil { + invalidParams.Add(request.NewErrParamRequired("IndexName")) } - if s.TableName == nil { - invalidParams.Add(request.NewErrParamRequired("TableName")) + if s.IndexName != nil && len(*s.IndexName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) } - if s.TableName != nil && len(*s.TableName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("TableName", 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 { @@ -11529,232 +12610,1124 @@ func (s *PutItemInput) Validate() error { return nil } -// SetConditionExpression sets the ConditionExpression field's value. -func (s *PutItemInput) SetConditionExpression(v string) *PutItemInput { - s.ConditionExpression = &v +// SetIndexName sets the IndexName field's value. +func (s *LocalSecondaryIndex) SetIndexName(v string) *LocalSecondaryIndex { + s.IndexName = &v return s } -// SetConditionalOperator sets the ConditionalOperator field's value. -func (s *PutItemInput) SetConditionalOperator(v string) *PutItemInput { - s.ConditionalOperator = &v +// SetKeySchema sets the KeySchema field's value. +func (s *LocalSecondaryIndex) SetKeySchema(v []*KeySchemaElement) *LocalSecondaryIndex { + s.KeySchema = v return s } -// SetExpected sets the Expected field's value. -func (s *PutItemInput) SetExpected(v map[string]*ExpectedAttributeValue) *PutItemInput { - s.Expected = v +// SetProjection sets the Projection field's value. +func (s *LocalSecondaryIndex) SetProjection(v *Projection) *LocalSecondaryIndex { + s.Projection = v return s } -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *PutItemInput) SetExpressionAttributeNames(v map[string]*string) *PutItemInput { - s.ExpressionAttributeNames = v - return s +// Represents the properties of a local secondary index. +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's 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"` } -// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value. -func (s *PutItemInput) SetExpressionAttributeValues(v map[string]*AttributeValue) *PutItemInput { - s.ExpressionAttributeValues = v - return s +// String returns the string representation +func (s LocalSecondaryIndexDescription) String() string { + return awsutil.Prettify(s) } -// SetItem sets the Item field's value. -func (s *PutItemInput) SetItem(v map[string]*AttributeValue) *PutItemInput { - s.Item = v +// 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 } -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *PutItemInput) SetReturnConsumedCapacity(v string) *PutItemInput { - s.ReturnConsumedCapacity = &v +// SetIndexName sets the IndexName field's value. +func (s *LocalSecondaryIndexDescription) SetIndexName(v string) *LocalSecondaryIndexDescription { + s.IndexName = &v return s } -// SetReturnItemCollectionMetrics sets the ReturnItemCollectionMetrics field's value. -func (s *PutItemInput) SetReturnItemCollectionMetrics(v string) *PutItemInput { - s.ReturnItemCollectionMetrics = &v +// SetIndexSizeBytes sets the IndexSizeBytes field's value. +func (s *LocalSecondaryIndexDescription) SetIndexSizeBytes(v int64) *LocalSecondaryIndexDescription { + s.IndexSizeBytes = &v return s } -// SetReturnValues sets the ReturnValues field's value. -func (s *PutItemInput) SetReturnValues(v string) *PutItemInput { - s.ReturnValues = &v +// SetItemCount sets the ItemCount field's value. +func (s *LocalSecondaryIndexDescription) SetItemCount(v int64) *LocalSecondaryIndexDescription { + s.ItemCount = &v return s } -// SetTableName sets the TableName field's value. -func (s *PutItemInput) SetTableName(v string) *PutItemInput { - s.TableName = &v +// SetKeySchema sets the KeySchema field's value. +func (s *LocalSecondaryIndexDescription) SetKeySchema(v []*KeySchemaElement) *LocalSecondaryIndexDescription { + s.KeySchema = v return s } -// Represents the output of a PutItem operation. -type PutItemOutput struct { - _ struct{} `type:"structure"` +// SetProjection sets the Projection field's value. +func (s *LocalSecondaryIndexDescription) SetProjection(v *Projection) *LocalSecondaryIndexDescription { + s.Projection = v + return s +} - // 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"` +// Represents the properties of a local secondary index for the table when the +// backup was created. +type LocalSecondaryIndexInfo struct { + _ struct{} `type:"structure"` - // 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 Read/Write Capacity Mode (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) - // in the Amazon DynamoDB Developer Guide. - ConsumedCapacity *ConsumedCapacity `type:"structure"` + // Represents the name of the local secondary index. + IndexName *string `min:"3" type:"string"` - // 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. + // The complete key schema for a local secondary index, which consists of one + // or more pairs of attribute names and key types: // - // Each ItemCollectionMetrics element consists of: + // * HASH - partition key // - // * ItemCollectionKey - The partition key value of the item collection. - // This is the same as the partition key value of the item itself. + // * RANGE - sort key // - // * SizeEstimateRangeGB - 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"` + // The partition key of an item is also known as its hash attribute. The term + // "hash attribute" derives from DynamoDB's 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 PutItemOutput) String() string { +func (s LocalSecondaryIndexInfo) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutItemOutput) GoString() string { +func (s LocalSecondaryIndexInfo) GoString() string { return s.String() } -// SetAttributes sets the Attributes field's value. -func (s *PutItemOutput) SetAttributes(v map[string]*AttributeValue) *PutItemOutput { - s.Attributes = v +// SetIndexName sets the IndexName field's value. +func (s *LocalSecondaryIndexInfo) SetIndexName(v string) *LocalSecondaryIndexInfo { + s.IndexName = &v return s } -// SetConsumedCapacity sets the ConsumedCapacity field's value. -func (s *PutItemOutput) SetConsumedCapacity(v *ConsumedCapacity) *PutItemOutput { - s.ConsumedCapacity = v +// SetKeySchema sets the KeySchema field's value. +func (s *LocalSecondaryIndexInfo) SetKeySchema(v []*KeySchemaElement) *LocalSecondaryIndexInfo { + s.KeySchema = v return s } -// SetItemCollectionMetrics sets the ItemCollectionMetrics field's value. -func (s *PutItemOutput) SetItemCollectionMetrics(v *ItemCollectionMetrics) *PutItemOutput { - s.ItemCollectionMetrics = v +// SetProjection sets the Projection field's value. +func (s *LocalSecondaryIndexInfo) SetProjection(v *Projection) *LocalSecondaryIndexInfo { + s.Projection = v return s } -// Represents a request to perform a PutItem operation on an item. -type PutRequest struct { +// The description of the point in time settings applied to the table. +type PointInTimeRecoveryDescription 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. + // Specifies the earliest point in time you can restore your table to. You can + // restore your table to any point in time during the last 35 days. + EarliestRestorableDateTime *time.Time `type:"timestamp"` + + // LatestRestorableDateTime is typically 5 minutes before the current time. + LatestRestorableDateTime *time.Time `type:"timestamp"` + + // The current state of point in time recovery: // - // Item is a required field - Item map[string]*AttributeValue `type:"map" required:"true"` + // * ENABLING - Point in time recovery is being enabled. + // + // * ENABLED - Point in time recovery is enabled. + // + // * DISABLED - Point in time recovery is disabled. + PointInTimeRecoveryStatus *string `type:"string" enum:"PointInTimeRecoveryStatus"` } // String returns the string representation -func (s PutRequest) String() string { +func (s PointInTimeRecoveryDescription) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutRequest) GoString() string { +func (s PointInTimeRecoveryDescription) GoString() string { return s.String() } -// SetItem sets the Item field's value. -func (s *PutRequest) SetItem(v map[string]*AttributeValue) *PutRequest { - s.Item = v +// SetEarliestRestorableDateTime sets the EarliestRestorableDateTime field's value. +func (s *PointInTimeRecoveryDescription) SetEarliestRestorableDateTime(v time.Time) *PointInTimeRecoveryDescription { + s.EarliestRestorableDateTime = &v return s } -// Represents the input of a Query operation. -type QueryInput struct { - _ struct{} `type:"structure"` +// SetLatestRestorableDateTime sets the LatestRestorableDateTime field's value. +func (s *PointInTimeRecoveryDescription) SetLatestRestorableDateTime(v time.Time) *PointInTimeRecoveryDescription { + s.LatestRestorableDateTime = &v + return s +} - // This is a legacy parameter. Use ProjectionExpression instead. For more information, - // see AttributesToGet (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.AttributesToGet.html) - // in the Amazon DynamoDB Developer Guide. - AttributesToGet []*string `min:"1" type:"list"` +// SetPointInTimeRecoveryStatus sets the PointInTimeRecoveryStatus field's value. +func (s *PointInTimeRecoveryDescription) SetPointInTimeRecoveryStatus(v string) *PointInTimeRecoveryDescription { + s.PointInTimeRecoveryStatus = &v + return s +} - // This is a legacy parameter. Use FilterExpression instead. For more information, - // see ConditionalOperator (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.ConditionalOperator.html) - // in the Amazon DynamoDB Developer Guide. - ConditionalOperator *string `type:"string" enum:"ConditionalOperator"` +// Represents the settings used to enable point in time recovery. +type PointInTimeRecoverySpecification struct { + _ struct{} `type:"structure"` - // Determines the read consistency model: If set to true, then the operation - // uses strongly consistent reads; otherwise, the operation uses eventually - // consistent reads. + // Indicates whether point in time recovery is enabled (true) or disabled (false) + // on the table. // - // 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"` + // PointInTimeRecoveryEnabled is a required field + PointInTimeRecoveryEnabled *bool `type:"boolean" required:"true"` +} - // 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"` +// String returns the string representation +func (s PointInTimeRecoverySpecification) String() string { + return awsutil.Prettify(s) +} - // 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 (https://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"} +// GoString returns the string representation +func (s PointInTimeRecoverySpecification) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PointInTimeRecoverySpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PointInTimeRecoverySpecification"} + if s.PointInTimeRecoveryEnabled == nil { + invalidParams.Add(request.NewErrParamRequired("PointInTimeRecoveryEnabled")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPointInTimeRecoveryEnabled sets the PointInTimeRecoveryEnabled field's value. +func (s *PointInTimeRecoverySpecification) SetPointInTimeRecoveryEnabled(v bool) *PointInTimeRecoverySpecification { + s.PointInTimeRecoveryEnabled = &v + return s +} + +// Point in time recovery has not yet been enabled for this source table. +type PointInTimeRecoveryUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PointInTimeRecoveryUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PointInTimeRecoveryUnavailableException) GoString() string { + return s.String() +} + +func newErrorPointInTimeRecoveryUnavailableException(v protocol.ResponseMetadata) error { + return &PointInTimeRecoveryUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PointInTimeRecoveryUnavailableException) Code() string { + return "PointInTimeRecoveryUnavailableException" +} + +// Message returns the exception's message. +func (s PointInTimeRecoveryUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PointInTimeRecoveryUnavailableException) OrigErr() error { + return nil +} + +func (s PointInTimeRecoveryUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PointInTimeRecoveryUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PointInTimeRecoveryUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type Projection struct { + _ struct{} `type:"structure"` + + // Represents the non-key attribute names which will be projected into the index. // - // You could then use this substitution in an expression, as in this example: + // 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: // - // * #P = :val + // * KEYS_ONLY - Only the index and primary keys are projected into the index. // - // Tokens that begin with the : character are expression attribute values, which - // are placeholders for the actual value at runtime. + // * INCLUDE - Only the specified table attributes are projected into the + // index. The list of projected attributes is in NonKeyAttributes. // - // For more information on expression attribute names, see Specifying Item Attributes - // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ExpressionAttributeNames map[string]*string `type:"map"` + // * ALL - All of the table attributes are projected into the index. + ProjectionType *string `type:"string" enum:"ProjectionType"` +} - // One or more values that can be substituted in an expression. - // - // Use the : (colon) character in an expression to dereference an attribute +// 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 +// (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Limits.html) +// in the Amazon DynamoDB Developer Guide. +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 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) + // in the Amazon DynamoDB Developer Guide. + // + // If read/write capacity mode is PAY_PER_REQUEST the value is set to 0. + // + // 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 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithTables.html#ProvisionedThroughput) + // in the Amazon DynamoDB Developer Guide. + // + // If read/write capacity mode is PAY_PER_REQUEST the value is set to 0. + // + // 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. +type ProvisionedThroughputDescription struct { + _ struct{} `type:"structure"` + + // The date and time of the last provisioned throughput decrease for this table. + LastDecreaseDateTime *time.Time `type:"timestamp"` + + // The date and time of the last provisioned throughput increase for this table. + LastIncreaseDateTime *time.Time `type:"timestamp"` + + // The number of provisioned throughput decreases for this table during this + // UTC calendar day. For current maximums on provisioned throughput decreases, + // see Limits (https://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 `type:"long"` + + // The maximum number of writes consumed per second before DynamoDB returns + // a ThrottlingException. + WriteCapacityUnits *int64 `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 +} + +// 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 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Programming.Errors.html#Programming.Errors.RetryAndBackoff) +// in the Amazon DynamoDB Developer Guide. +type ProvisionedThroughputExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // You exceeded your maximum allowed provisioned throughput. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ProvisionedThroughputExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ProvisionedThroughputExceededException) GoString() string { + return s.String() +} + +func newErrorProvisionedThroughputExceededException(v protocol.ResponseMetadata) error { + return &ProvisionedThroughputExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ProvisionedThroughputExceededException) Code() string { + return "ProvisionedThroughputExceededException" +} + +// Message returns the exception's message. +func (s ProvisionedThroughputExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ProvisionedThroughputExceededException) OrigErr() error { + return nil +} + +func (s ProvisionedThroughputExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ProvisionedThroughputExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ProvisionedThroughputExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// Replica-specific provisioned throughput settings. If not specified, uses +// the source table's provisioned throughput settings. +type ProvisionedThroughputOverride struct { + _ struct{} `type:"structure"` + + // Replica-specific read capacity units. If not specified, uses the source table's + // read capacity settings. + ReadCapacityUnits *int64 `min:"1" type:"long"` +} + +// String returns the string representation +func (s ProvisionedThroughputOverride) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ProvisionedThroughputOverride) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ProvisionedThroughputOverride) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProvisionedThroughputOverride"} + if s.ReadCapacityUnits != nil && *s.ReadCapacityUnits < 1 { + invalidParams.Add(request.NewErrParamMinValue("ReadCapacityUnits", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetReadCapacityUnits sets the ReadCapacityUnits field's value. +func (s *ProvisionedThroughputOverride) SetReadCapacityUnits(v int64) *ProvisionedThroughputOverride { + s.ReadCapacityUnits = &v + return s +} + +// Represents a request to perform a PutItem operation. +type Put struct { + _ struct{} `type:"structure"` + + // A condition that must be satisfied in order for a conditional update to succeed. + ConditionExpression *string `type:"string"` + + // One or more substitution tokens for attribute names in an expression. + ExpressionAttributeNames map[string]*string `type:"map"` + + // One or more values that can be substituted in an expression. + ExpressionAttributeValues map[string]*AttributeValue `type:"map"` + + // A map of attribute name to attribute values, representing the primary key + // of the item to be written 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 that 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"` + + // Use ReturnValuesOnConditionCheckFailure to get the item attributes if the + // Put condition fails. For ReturnValuesOnConditionCheckFailure, the valid values + // are: NONE and ALL_OLD. + ReturnValuesOnConditionCheckFailure *string `type:"string" enum:"ReturnValuesOnConditionCheckFailure"` + + // Name of the table in which to write the item. + // + // TableName is a required field + TableName *string `min:"3" type:"string" required:"true"` +} + +// String returns the string representation +func (s Put) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Put) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Put) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Put"} + 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 *Put) SetConditionExpression(v string) *Put { + s.ConditionExpression = &v + return s +} + +// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. +func (s *Put) SetExpressionAttributeNames(v map[string]*string) *Put { + s.ExpressionAttributeNames = v + return s +} + +// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value. +func (s *Put) SetExpressionAttributeValues(v map[string]*AttributeValue) *Put { + s.ExpressionAttributeValues = v + return s +} + +// SetItem sets the Item field's value. +func (s *Put) SetItem(v map[string]*AttributeValue) *Put { + s.Item = v + return s +} + +// SetReturnValuesOnConditionCheckFailure sets the ReturnValuesOnConditionCheckFailure field's value. +func (s *Put) SetReturnValuesOnConditionCheckFailure(v string) *Put { + s.ReturnValuesOnConditionCheckFailure = &v + return s +} + +// SetTableName sets the TableName field's value. +func (s *Put) SetTableName(v string) *Put { + s.TableName = &v + return s +} + +// Represents the input of a PutItem operation. +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 Condition Expressions + // (https://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 (https://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 ConditionExpression instead. For more information, + // see Expected (https://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 (https://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 Specifying Item Attributes + // (https://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 Condition Expressions + // (https://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 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.CoreComponents.html#HowItWorks.CoreComponents.PrimaryKey) + // 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. +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 Read/Write Capacity Mode (https://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. + // + // * SizeEstimateRangeGB - 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. +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 that 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. +type QueryInput struct { + _ struct{} `type:"structure"` + + // This is a legacy parameter. Use ProjectionExpression instead. For more information, + // see AttributesToGet (https://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 (https://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 (https://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 Specifying Item Attributes + // (https://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: // @@ -11863,165 +13836,561 @@ type QueryInput struct { // in the Amazon DynamoDB Developer Guide. KeyConditionExpression *string `type:"string"` - // This is a legacy parameter. Use KeyConditionExpression instead. For more - // information, see KeyConditions (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.KeyConditions.html) - // in the Amazon DynamoDB Developer Guide. - KeyConditions map[string]*Condition `type:"map"` + // This is a legacy parameter. Use KeyConditionExpression instead. For more + // information, see KeyConditions (https://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 dataset + // 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 (https://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 (https://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 (https://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 UTF-8 bytes. 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 fetches 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 fetches 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 +} - // 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 dataset - // 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 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html) - // in the Amazon DynamoDB Developer Guide. - Limit *int64 `min:"1" type:"integer"` +// SetScanIndexForward sets the ScanIndexForward field's value. +func (s *QueryInput) SetScanIndexForward(v bool) *QueryInput { + s.ScanIndexForward = &v + return s +} - // 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 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.AccessingItemAttributes.html) - // in the Amazon DynamoDB Developer Guide. - ProjectionExpression *string `type:"string"` +// SetSelect sets the Select field's value. +func (s *QueryInput) SetSelect(v string) *QueryInput { + s.Select = &v + return s +} - // This is a legacy parameter. Use FilterExpression instead. For more information, - // see QueryFilter (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/LegacyConditionalParameters.QueryFilter.html) +// 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. +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 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) // in the Amazon DynamoDB Developer Guide. - QueryFilter map[string]*Condition `type:"map"` + ConsumedCapacity *ConsumedCapacity `type:"structure"` - // 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). + // The number of items in the response. // - // * TOTAL - The response includes only the aggregate ConsumedCapacity for - // the operation. + // 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. // - // * NONE - No ConsumedCapacity details are included in the response. - ReturnConsumedCapacity *string `type:"string" enum:"ReturnConsumedCapacity"` + // If you did not use a filter in the request, then Count and ScannedCount are + // the same. + Count *int64 `type:"integer"` - // 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. + // 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. // - // 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 UTF-8 bytes. For - // type Binary, DynamoDB treats each byte of the binary data as unsigned. + // If LastEvaluatedKey is empty, then the "last page" of results has been processed + // and there is no more data to be retrieved. // - // 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"` + // 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 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 fetches 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. + // 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 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/QueryAndScan.html#Count) + // in the Amazon DynamoDB Developer Guide. // - // * 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. + // 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 properties of a replica. +type Replica struct { + _ struct{} `type:"structure"` + + // The Region where the replica needs to be created. + RegionName *string `type:"string"` +} + +// String returns the string representation +func (s Replica) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Replica) GoString() string { + return s.String() +} + +// SetRegionName sets the RegionName field's value. +func (s *Replica) SetRegionName(v string) *Replica { + s.RegionName = &v + return s +} + +// The specified replica is already part of the global table. +type ReplicaAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ReplicaAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplicaAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorReplicaAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ReplicaAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ReplicaAlreadyExistsException) Code() string { + return "ReplicaAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ReplicaAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ReplicaAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ReplicaAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ReplicaAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ReplicaAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// Represents the auto scaling settings of the replica. +type ReplicaAutoScalingDescription struct { + _ struct{} `type:"structure"` + + // Replica-specific global secondary index auto scaling settings. + GlobalSecondaryIndexes []*ReplicaGlobalSecondaryIndexAutoScalingDescription `type:"list"` + + // The Region where the replica exists. + RegionName *string `type:"string"` + + // Represents the auto scaling settings for a global table or global secondary + // index. + ReplicaProvisionedReadCapacityAutoScalingSettings *AutoScalingSettingsDescription `type:"structure"` + + // Represents the auto scaling settings for a global table or global secondary + // index. + ReplicaProvisionedWriteCapacityAutoScalingSettings *AutoScalingSettingsDescription `type:"structure"` + + // The current state of the replica: // - // * COUNT - Returns the number of matching items, rather than the matching - // items themselves. + // * CREATING - The replica is being created. // - // * 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 fetches 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. + // * UPDATING - The replica is being updated. // - // 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.) + // * DELETING - The replica is being deleted. // - // 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"` + // * ACTIVE - The replica is ready for use. + ReplicaStatus *string `type:"string" enum:"ReplicaStatus"` +} + +// String returns the string representation +func (s ReplicaAutoScalingDescription) String() string { + return awsutil.Prettify(s) +} - // The name of the table containing the requested items. +// GoString returns the string representation +func (s ReplicaAutoScalingDescription) GoString() string { + return s.String() +} + +// SetGlobalSecondaryIndexes sets the GlobalSecondaryIndexes field's value. +func (s *ReplicaAutoScalingDescription) SetGlobalSecondaryIndexes(v []*ReplicaGlobalSecondaryIndexAutoScalingDescription) *ReplicaAutoScalingDescription { + s.GlobalSecondaryIndexes = v + return s +} + +// SetRegionName sets the RegionName field's value. +func (s *ReplicaAutoScalingDescription) SetRegionName(v string) *ReplicaAutoScalingDescription { + s.RegionName = &v + return s +} + +// SetReplicaProvisionedReadCapacityAutoScalingSettings sets the ReplicaProvisionedReadCapacityAutoScalingSettings field's value. +func (s *ReplicaAutoScalingDescription) SetReplicaProvisionedReadCapacityAutoScalingSettings(v *AutoScalingSettingsDescription) *ReplicaAutoScalingDescription { + s.ReplicaProvisionedReadCapacityAutoScalingSettings = v + return s +} + +// SetReplicaProvisionedWriteCapacityAutoScalingSettings sets the ReplicaProvisionedWriteCapacityAutoScalingSettings field's value. +func (s *ReplicaAutoScalingDescription) SetReplicaProvisionedWriteCapacityAutoScalingSettings(v *AutoScalingSettingsDescription) *ReplicaAutoScalingDescription { + s.ReplicaProvisionedWriteCapacityAutoScalingSettings = v + return s +} + +// SetReplicaStatus sets the ReplicaStatus field's value. +func (s *ReplicaAutoScalingDescription) SetReplicaStatus(v string) *ReplicaAutoScalingDescription { + s.ReplicaStatus = &v + return s +} + +// Represents the auto scaling settings of a replica that will be modified. +type ReplicaAutoScalingUpdate struct { + _ struct{} `type:"structure"` + + // The Region where the replica exists. // - // TableName is a required field - TableName *string `min:"3" type:"string" required:"true"` + // RegionName is a required field + RegionName *string `type:"string" required:"true"` + + // Represents the auto scaling settings of global secondary indexes that will + // be modified. + ReplicaGlobalSecondaryIndexUpdates []*ReplicaGlobalSecondaryIndexAutoScalingUpdate `type:"list"` + + // Represents the auto scaling settings to be modified for a global table or + // global secondary index. + ReplicaProvisionedReadCapacityAutoScalingUpdate *AutoScalingSettingsUpdate `type:"structure"` } // String returns the string representation -func (s QueryInput) String() string { +func (s ReplicaAutoScalingUpdate) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s QueryInput) GoString() string { +func (s ReplicaAutoScalingUpdate) 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)) +func (s *ReplicaAutoScalingUpdate) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplicaAutoScalingUpdate"} + if s.RegionName == nil { + invalidParams.Add(request.NewErrParamRequired("RegionName")) } - if s.KeyConditions != nil { - for i, v := range s.KeyConditions { + if s.ReplicaGlobalSecondaryIndexUpdates != nil { + for i, v := range s.ReplicaGlobalSecondaryIndexUpdates { if v == nil { continue } if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "KeyConditions", i), err.(request.ErrInvalidParams)) + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ReplicaGlobalSecondaryIndexUpdates", 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 s.ReplicaProvisionedReadCapacityAutoScalingUpdate != nil { + if err := s.ReplicaProvisionedReadCapacityAutoScalingUpdate.Validate(); err != nil { + invalidParams.AddNested("ReplicaProvisionedReadCapacityAutoScalingUpdate", err.(request.ErrInvalidParams)) } } @@ -12031,241 +14400,315 @@ func (s *QueryInput) Validate() error { return nil } -// SetAttributesToGet sets the AttributesToGet field's value. -func (s *QueryInput) SetAttributesToGet(v []*string) *QueryInput { - s.AttributesToGet = v +// SetRegionName sets the RegionName field's value. +func (s *ReplicaAutoScalingUpdate) SetRegionName(v string) *ReplicaAutoScalingUpdate { + s.RegionName = &v return s } -// SetConditionalOperator sets the ConditionalOperator field's value. -func (s *QueryInput) SetConditionalOperator(v string) *QueryInput { - s.ConditionalOperator = &v +// SetReplicaGlobalSecondaryIndexUpdates sets the ReplicaGlobalSecondaryIndexUpdates field's value. +func (s *ReplicaAutoScalingUpdate) SetReplicaGlobalSecondaryIndexUpdates(v []*ReplicaGlobalSecondaryIndexAutoScalingUpdate) *ReplicaAutoScalingUpdate { + s.ReplicaGlobalSecondaryIndexUpdates = v return s } -// SetConsistentRead sets the ConsistentRead field's value. -func (s *QueryInput) SetConsistentRead(v bool) *QueryInput { - s.ConsistentRead = &v +// SetReplicaProvisionedReadCapacityAutoScalingUpdate sets the ReplicaProvisionedReadCapacityAutoScalingUpdate field's value. +func (s *ReplicaAutoScalingUpdate) SetReplicaProvisionedReadCapacityAutoScalingUpdate(v *AutoScalingSettingsUpdate) *ReplicaAutoScalingUpdate { + s.ReplicaProvisionedReadCapacityAutoScalingUpdate = v return s } -// SetExclusiveStartKey sets the ExclusiveStartKey field's value. -func (s *QueryInput) SetExclusiveStartKey(v map[string]*AttributeValue) *QueryInput { - s.ExclusiveStartKey = v - return s +// Contains the details of the replica. +type ReplicaDescription struct { + _ struct{} `type:"structure"` + + // Replica-specific global secondary index settings. + GlobalSecondaryIndexes []*ReplicaGlobalSecondaryIndexDescription `type:"list"` + + // The AWS KMS customer master key (CMK) of the replica that will be used for + // AWS KMS encryption. + KMSMasterKeyId *string `type:"string"` + + // Replica-specific provisioned throughput. If not described, uses the source + // table's provisioned throughput settings. + ProvisionedThroughputOverride *ProvisionedThroughputOverride `type:"structure"` + + // The name of the Region. + RegionName *string `type:"string"` + + // The current state of the replica: + // + // * CREATING - The replica is being created. + // + // * UPDATING - The replica is being updated. + // + // * DELETING - The replica is being deleted. + // + // * ACTIVE - The replica is ready for use. + ReplicaStatus *string `type:"string" enum:"ReplicaStatus"` + + // Detailed information about the replica status. + ReplicaStatusDescription *string `type:"string"` + + // Specifies the progress of a Create, Update, or Delete action on the replica + // as a percentage. + ReplicaStatusPercentProgress *string `type:"string"` } -// SetExpressionAttributeNames sets the ExpressionAttributeNames field's value. -func (s *QueryInput) SetExpressionAttributeNames(v map[string]*string) *QueryInput { - s.ExpressionAttributeNames = v - return s +// String returns the string representation +func (s ReplicaDescription) String() string { + return awsutil.Prettify(s) } -// SetExpressionAttributeValues sets the ExpressionAttributeValues field's value. -func (s *QueryInput) SetExpressionAttributeValues(v map[string]*AttributeValue) *QueryInput { - s.ExpressionAttributeValues = v - return s +// GoString returns the string representation +func (s ReplicaDescription) GoString() string { + return s.String() } -// SetFilterExpression sets the FilterExpression field's value. -func (s *QueryInput) SetFilterExpression(v string) *QueryInput { - s.FilterExpression = &v +// SetGlobalSecondaryIndexes sets the GlobalSecondaryIndexes field's value. +func (s *ReplicaDescription) SetGlobalSecondaryIndexes(v []*ReplicaGlobalSecondaryIndexDescription) *ReplicaDescription { + s.GlobalSecondaryIndexes = v return s } -// SetIndexName sets the IndexName field's value. -func (s *QueryInput) SetIndexName(v string) *QueryInput { - s.IndexName = &v +// SetKMSMasterKeyId sets the KMSMasterKeyId field's value. +func (s *ReplicaDescription) SetKMSMasterKeyId(v string) *ReplicaDescription { + s.KMSMasterKeyId = &v return s } -// SetKeyConditionExpression sets the KeyConditionExpression field's value. -func (s *QueryInput) SetKeyConditionExpression(v string) *QueryInput { - s.KeyConditionExpression = &v +// SetProvisionedThroughputOverride sets the ProvisionedThroughputOverride field's value. +func (s *ReplicaDescription) SetProvisionedThroughputOverride(v *ProvisionedThroughputOverride) *ReplicaDescription { + s.ProvisionedThroughputOverride = v return s } -// SetKeyConditions sets the KeyConditions field's value. -func (s *QueryInput) SetKeyConditions(v map[string]*Condition) *QueryInput { - s.KeyConditions = v +// SetRegionName sets the RegionName field's value. +func (s *ReplicaDescription) SetRegionName(v string) *ReplicaDescription { + s.RegionName = &v return s } -// SetLimit sets the Limit field's value. -func (s *QueryInput) SetLimit(v int64) *QueryInput { - s.Limit = &v +// SetReplicaStatus sets the ReplicaStatus field's value. +func (s *ReplicaDescription) SetReplicaStatus(v string) *ReplicaDescription { + s.ReplicaStatus = &v return s } -// SetProjectionExpression sets the ProjectionExpression field's value. -func (s *QueryInput) SetProjectionExpression(v string) *QueryInput { - s.ProjectionExpression = &v +// SetReplicaStatusDescription sets the ReplicaStatusDescription field's value. +func (s *ReplicaDescription) SetReplicaStatusDescription(v string) *ReplicaDescription { + s.ReplicaStatusDescription = &v return s } -// SetQueryFilter sets the QueryFilter field's value. -func (s *QueryInput) SetQueryFilter(v map[string]*Condition) *QueryInput { - s.QueryFilter = v +// SetReplicaStatusPercentProgress sets the ReplicaStatusPercentProgress field's value. +func (s *ReplicaDescription) SetReplicaStatusPercentProgress(v string) *ReplicaDescription { + s.ReplicaStatusPercentProgress = &v return s } -// SetReturnConsumedCapacity sets the ReturnConsumedCapacity field's value. -func (s *QueryInput) SetReturnConsumedCapacity(v string) *QueryInput { - s.ReturnConsumedCapacity = &v - return s +// Represents the properties of a replica global secondary index. +type ReplicaGlobalSecondaryIndex struct { + _ struct{} `type:"structure"` + + // The name of the global secondary index. + // + // IndexName is a required field + IndexName *string `min:"3" type:"string" required:"true"` + + // Replica table GSI-specific provisioned throughput. If not specified, uses + // the source table GSI's read capacity settings. + ProvisionedThroughputOverride *ProvisionedThroughputOverride `type:"structure"` } -// SetScanIndexForward sets the ScanIndexForward field's value. -func (s *QueryInput) SetScanIndexForward(v bool) *QueryInput { - s.ScanIndexForward = &v - return s +// String returns the string representation +func (s ReplicaGlobalSecondaryIndex) String() string { + return awsutil.Prettify(s) } -// SetSelect sets the Select field's value. -func (s *QueryInput) SetSelect(v string) *QueryInput { - s.Select = &v +// GoString returns the string representation +func (s ReplicaGlobalSecondaryIndex) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReplicaGlobalSecondaryIndex) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplicaGlobalSecondaryIndex"} + 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.ProvisionedThroughputOverride != nil { + if err := s.ProvisionedThroughputOverride.Validate(); err != nil { + invalidParams.AddNested("ProvisionedThroughputOverride", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetIndexName sets the IndexName field's value. +func (s *ReplicaGlobalSecondaryIndex) SetIndexName(v string) *ReplicaGlobalSecondaryIndex { + s.IndexName = &v return s } -// SetTableName sets the TableName field's value. -func (s *QueryInput) SetTableName(v string) *QueryInput { - s.TableName = &v +// SetProvisionedThroughputOverride sets the ProvisionedThroughputOverride field's value. +func (s *ReplicaGlobalSecondaryIndex) SetProvisionedThroughputOverride(v *ProvisionedThroughputOverride) *ReplicaGlobalSecondaryIndex { + s.ProvisionedThroughputOverride = v return s } -// Represents the output of a Query operation. -type QueryOutput struct { +// Represents the auto scaling configuration for a replica global secondary +// index. +type ReplicaGlobalSecondaryIndexAutoScalingDescription 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 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/ProvisionedThroughputIntro.html) - // in the Amazon DynamoDB Developer Guide. - ConsumedCapacity *ConsumedCapacity `type:"structure"` + // The name of the global secondary index. + IndexName *string `min:"3" type:"string"` - // The number of items in the response. + // The current state of the replica global secondary index: // - // 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. + // * CREATING - The index is being created. // - // 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. + // * UPDATING - The index is being updated. // - // If LastEvaluatedKey is empty, then the "last page" of results has been processed - // and there is no more data to be retrieved. + // * DELETING - The index is being deleted. // - // 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"` + // * ACTIVE - The index is ready for use. + IndexStatus *string `type:"string" enum:"IndexStatus"` - // 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 (https://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"` + // Represents the auto scaling settings for a global table or global secondary + // index. + ProvisionedReadCapacityAutoScalingSettings *AutoScalingSettingsDescription `type:"structure"` + + // Represents the auto scaling settings for a global table or global secondary + // index. + ProvisionedWriteCapacityAutoScalingSettings *AutoScalingSettingsDescription `type:"structure"` } // String returns the string representation -func (s QueryOutput) String() string { +func (s ReplicaGlobalSecondaryIndexAutoScalingDescription) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s QueryOutput) GoString() string { +func (s ReplicaGlobalSecondaryIndexAutoScalingDescription) 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 +// SetIndexName sets the IndexName field's value. +func (s *ReplicaGlobalSecondaryIndexAutoScalingDescription) SetIndexName(v string) *ReplicaGlobalSecondaryIndexAutoScalingDescription { + s.IndexName = &v return s } -// SetItems sets the Items field's value. -func (s *QueryOutput) SetItems(v []map[string]*AttributeValue) *QueryOutput { - s.Items = v +// SetIndexStatus sets the IndexStatus field's value. +func (s *ReplicaGlobalSecondaryIndexAutoScalingDescription) SetIndexStatus(v string) *ReplicaGlobalSecondaryIndexAutoScalingDescription { + s.IndexStatus = &v return s } -// SetLastEvaluatedKey sets the LastEvaluatedKey field's value. -func (s *QueryOutput) SetLastEvaluatedKey(v map[string]*AttributeValue) *QueryOutput { - s.LastEvaluatedKey = v +// SetProvisionedReadCapacityAutoScalingSettings sets the ProvisionedReadCapacityAutoScalingSettings field's value. +func (s *ReplicaGlobalSecondaryIndexAutoScalingDescription) SetProvisionedReadCapacityAutoScalingSettings(v *AutoScalingSettingsDescription) *ReplicaGlobalSecondaryIndexAutoScalingDescription { + s.ProvisionedReadCapacityAutoScalingSettings = v return s } -// SetScannedCount sets the ScannedCount field's value. -func (s *QueryOutput) SetScannedCount(v int64) *QueryOutput { - s.ScannedCount = &v +// SetProvisionedWriteCapacityAutoScalingSettings sets the ProvisionedWriteCapacityAutoScalingSettings field's value. +func (s *ReplicaGlobalSecondaryIndexAutoScalingDescription) SetProvisionedWriteCapacityAutoScalingSettings(v *AutoScalingSettingsDescription) *ReplicaGlobalSecondaryIndexAutoScalingDescription { + s.ProvisionedWriteCapacityAutoScalingSettings = v return s } -// Represents the properties of a replica. -type Replica struct { +// Represents the auto scaling settings of a global secondary index for a replica +// that will be modified. +type ReplicaGlobalSecondaryIndexAutoScalingUpdate struct { _ struct{} `type:"structure"` - // The region where the replica needs to be created. - RegionName *string `type:"string"` + // The name of the global secondary index. + IndexName *string `min:"3" type:"string"` + + // Represents the auto scaling settings to be modified for a global table or + // global secondary index. + ProvisionedReadCapacityAutoScalingUpdate *AutoScalingSettingsUpdate `type:"structure"` } // String returns the string representation -func (s Replica) String() string { +func (s ReplicaGlobalSecondaryIndexAutoScalingUpdate) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Replica) GoString() string { +func (s ReplicaGlobalSecondaryIndexAutoScalingUpdate) GoString() string { return s.String() } -// SetRegionName sets the RegionName field's value. -func (s *Replica) SetRegionName(v string) *Replica { - s.RegionName = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReplicaGlobalSecondaryIndexAutoScalingUpdate) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplicaGlobalSecondaryIndexAutoScalingUpdate"} + if s.IndexName != nil && len(*s.IndexName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) + } + if s.ProvisionedReadCapacityAutoScalingUpdate != nil { + if err := s.ProvisionedReadCapacityAutoScalingUpdate.Validate(); err != nil { + invalidParams.AddNested("ProvisionedReadCapacityAutoScalingUpdate", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetIndexName sets the IndexName field's value. +func (s *ReplicaGlobalSecondaryIndexAutoScalingUpdate) SetIndexName(v string) *ReplicaGlobalSecondaryIndexAutoScalingUpdate { + s.IndexName = &v return s } -// Contains the details of the replica. -type ReplicaDescription struct { +// SetProvisionedReadCapacityAutoScalingUpdate sets the ProvisionedReadCapacityAutoScalingUpdate field's value. +func (s *ReplicaGlobalSecondaryIndexAutoScalingUpdate) SetProvisionedReadCapacityAutoScalingUpdate(v *AutoScalingSettingsUpdate) *ReplicaGlobalSecondaryIndexAutoScalingUpdate { + s.ProvisionedReadCapacityAutoScalingUpdate = v + return s +} + +// Represents the properties of a replica global secondary index. +type ReplicaGlobalSecondaryIndexDescription struct { _ struct{} `type:"structure"` - // The name of the region. - RegionName *string `type:"string"` + // The name of the global secondary index. + IndexName *string `min:"3" type:"string"` + + // If not described, uses the source table GSI's read capacity settings. + ProvisionedThroughputOverride *ProvisionedThroughputOverride `type:"structure"` } // String returns the string representation -func (s ReplicaDescription) String() string { +func (s ReplicaGlobalSecondaryIndexDescription) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ReplicaDescription) GoString() string { +func (s ReplicaGlobalSecondaryIndexDescription) GoString() string { return s.String() } -// SetRegionName sets the RegionName field's value. -func (s *ReplicaDescription) SetRegionName(v string) *ReplicaDescription { - s.RegionName = &v +// SetIndexName sets the IndexName field's value. +func (s *ReplicaGlobalSecondaryIndexDescription) SetIndexName(v string) *ReplicaGlobalSecondaryIndexDescription { + s.IndexName = &v + return s +} + +// SetProvisionedThroughputOverride sets the ProvisionedThroughputOverride field's value. +func (s *ReplicaGlobalSecondaryIndexDescription) SetProvisionedThroughputOverride(v *ProvisionedThroughputOverride) *ReplicaGlobalSecondaryIndexDescription { + s.ProvisionedThroughputOverride = v return s } @@ -12290,7 +14733,7 @@ type ReplicaGlobalSecondaryIndexSettingsDescription struct { // * ACTIVE - The global secondary index is ready for use. IndexStatus *string `type:"string" enum:"IndexStatus"` - // Autoscaling settings for a global secondary index replica's read capacity + // Auto scaling settings for a global secondary index replica's read capacity // units. ProvisionedReadCapacityAutoScalingSettings *AutoScalingSettingsDescription `type:"structure"` @@ -12298,7 +14741,7 @@ type ReplicaGlobalSecondaryIndexSettingsDescription struct { // DynamoDB returns a ThrottlingException. ProvisionedReadCapacityUnits *int64 `min:"1" type:"long"` - // AutoScaling settings for a global secondary index replica's write capacity + // Auto scaling settings for a global secondary index replica's write capacity // units. ProvisionedWriteCapacityAutoScalingSettings *AutoScalingSettingsDescription `type:"structure"` @@ -12364,7 +14807,7 @@ type ReplicaGlobalSecondaryIndexSettingsUpdate struct { // IndexName is a required field IndexName *string `min:"3" type:"string" required:"true"` - // Autoscaling settings for managing a global secondary index replica's read + // Auto scaling settings for managing a global secondary index replica's read // capacity units. ProvisionedReadCapacityAutoScalingSettingsUpdate *AutoScalingSettingsUpdate `type:"structure"` @@ -12425,11 +14868,67 @@ func (s *ReplicaGlobalSecondaryIndexSettingsUpdate) SetProvisionedReadCapacityUn return s } +// The specified replica is no longer part of the global table. +type ReplicaNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ReplicaNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplicaNotFoundException) GoString() string { + return s.String() +} + +func newErrorReplicaNotFoundException(v protocol.ResponseMetadata) error { + return &ReplicaNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ReplicaNotFoundException) Code() string { + return "ReplicaNotFoundException" +} + +// Message returns the exception's message. +func (s ReplicaNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ReplicaNotFoundException) OrigErr() error { + return nil +} + +func (s ReplicaNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ReplicaNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ReplicaNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents the properties of a replica. type ReplicaSettingsDescription struct { _ struct{} `type:"structure"` - // The region name of the replica. + // The Region name of the replica. // // RegionName is a required field RegionName *string `type:"string" required:"true"` @@ -12440,7 +14939,7 @@ type ReplicaSettingsDescription struct { // Replica global secondary index settings for the global table. ReplicaGlobalSecondaryIndexSettings []*ReplicaGlobalSecondaryIndexSettingsDescription `type:"list"` - // Autoscaling settings for a global table replica's read capacity units. + // Auto scaling settings for a global table replica's read capacity units. ReplicaProvisionedReadCapacityAutoScalingSettings *AutoScalingSettingsDescription `type:"structure"` // The maximum number of strongly consistent reads consumed per second before @@ -12449,7 +14948,7 @@ type ReplicaSettingsDescription struct { // in the Amazon DynamoDB Developer Guide. ReplicaProvisionedReadCapacityUnits *int64 `type:"long"` - // AutoScaling settings for a global table replica's write capacity units. + // Auto scaling settings for a global table replica's write capacity units. ReplicaProvisionedWriteCapacityAutoScalingSettings *AutoScalingSettingsDescription `type:"structure"` // The maximum number of writes consumed per second before DynamoDB returns @@ -12458,15 +14957,15 @@ type ReplicaSettingsDescription struct { // in the Amazon DynamoDB Developer Guide. ReplicaProvisionedWriteCapacityUnits *int64 `type:"long"` - // The current state of the region: + // The current state of the Region: // - // * CREATING - The region is being created. + // * CREATING - The Region is being created. // - // * UPDATING - The region is being updated. + // * UPDATING - The Region is being updated. // - // * DELETING - The region is being deleted. + // * DELETING - The Region is being deleted. // - // * ACTIVE - The region is ready for use. + // * ACTIVE - The Region is ready for use. ReplicaStatus *string `type:"string" enum:"ReplicaStatus"` } @@ -12528,11 +15027,11 @@ func (s *ReplicaSettingsDescription) SetReplicaStatus(v string) *ReplicaSettings return s } -// Represents the settings for a global table in a region that will be modified. +// Represents the settings for a global table in a Region that will be modified. type ReplicaSettingsUpdate struct { _ struct{} `type:"structure"` - // The region of the replica to be added. + // The Region of the replica to be added. // // RegionName is a required field RegionName *string `type:"string" required:"true"` @@ -12541,7 +15040,7 @@ type ReplicaSettingsUpdate struct { // will be modified. ReplicaGlobalSecondaryIndexSettingsUpdate []*ReplicaGlobalSecondaryIndexSettingsUpdate `min:"1" type:"list"` - // Autoscaling settings for managing a global table replica's read capacity + // Auto scaling settings for managing a global table replica's read capacity // units. ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate *AutoScalingSettingsUpdate `type:"structure"` @@ -12590,93 +15089,346 @@ func (s *ReplicaSettingsUpdate) Validate() error { } } - if invalidParams.Len() > 0 { - return invalidParams + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRegionName sets the RegionName field's value. +func (s *ReplicaSettingsUpdate) SetRegionName(v string) *ReplicaSettingsUpdate { + s.RegionName = &v + return s +} + +// SetReplicaGlobalSecondaryIndexSettingsUpdate sets the ReplicaGlobalSecondaryIndexSettingsUpdate field's value. +func (s *ReplicaSettingsUpdate) SetReplicaGlobalSecondaryIndexSettingsUpdate(v []*ReplicaGlobalSecondaryIndexSettingsUpdate) *ReplicaSettingsUpdate { + s.ReplicaGlobalSecondaryIndexSettingsUpdate = v + return s +} + +// SetReplicaProvisionedReadCapacityAutoScalingSettingsUpdate sets the ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate field's value. +func (s *ReplicaSettingsUpdate) SetReplicaProvisionedReadCapacityAutoScalingSettingsUpdate(v *AutoScalingSettingsUpdate) *ReplicaSettingsUpdate { + s.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate = v + return s +} + +// SetReplicaProvisionedReadCapacityUnits sets the ReplicaProvisionedReadCapacityUnits field's value. +func (s *ReplicaSettingsUpdate) SetReplicaProvisionedReadCapacityUnits(v int64) *ReplicaSettingsUpdate { + s.ReplicaProvisionedReadCapacityUnits = &v + return s +} + +// Represents one of the following: +// +// * A new replica to be added to an existing global table. +// +// * New parameters for an existing replica. +// +// * An existing replica to be removed from an existing global table. +type ReplicaUpdate struct { + _ struct{} `type:"structure"` + + // The parameters required for creating a replica on an existing global table. + Create *CreateReplicaAction `type:"structure"` + + // The name of the existing replica to be removed. + Delete *DeleteReplicaAction `type:"structure"` +} + +// String returns the string representation +func (s ReplicaUpdate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplicaUpdate) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReplicaUpdate) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplicaUpdate"} + 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 invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCreate sets the Create field's value. +func (s *ReplicaUpdate) SetCreate(v *CreateReplicaAction) *ReplicaUpdate { + s.Create = v + return s +} + +// SetDelete sets the Delete field's value. +func (s *ReplicaUpdate) SetDelete(v *DeleteReplicaAction) *ReplicaUpdate { + s.Delete = v + return s +} + +// Represents one of the following: +// +// * A new replica to be added to an existing regional table or global table. +// This request invokes the CreateTableReplica action in the destination +// Region. +// +// * New parameters for an existing replica. This request invokes the UpdateTable +// action in the destination Region. +// +// * An existing replica to be deleted. The request invokes the DeleteTableReplica +// action in the destination Region, deleting the replica and all if its +// items in the destination Region. +type ReplicationGroupUpdate struct { + _ struct{} `type:"structure"` + + // The parameters required for creating a replica for the table. + Create *CreateReplicationGroupMemberAction `type:"structure"` + + // The parameters required for deleting a replica for the table. + Delete *DeleteReplicationGroupMemberAction `type:"structure"` + + // The parameters required for updating a replica for the table. + Update *UpdateReplicationGroupMemberAction `type:"structure"` +} + +// String returns the string representation +func (s ReplicationGroupUpdate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplicationGroupUpdate) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReplicationGroupUpdate) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplicationGroupUpdate"} + 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 *ReplicationGroupUpdate) SetCreate(v *CreateReplicationGroupMemberAction) *ReplicationGroupUpdate { + s.Create = v + return s +} + +// SetDelete sets the Delete field's value. +func (s *ReplicationGroupUpdate) SetDelete(v *DeleteReplicationGroupMemberAction) *ReplicationGroupUpdate { + s.Delete = v + return s +} + +// SetUpdate sets the Update field's value. +func (s *ReplicationGroupUpdate) SetUpdate(v *UpdateReplicationGroupMemberAction) *ReplicationGroupUpdate { + s.Update = v + return s +} + +// Throughput exceeds the current throughput limit for your account. Please +// contact AWS Support at AWS Support (https://aws.amazon.com/support) to request +// a limit increase. +type RequestLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RequestLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestLimitExceeded) GoString() string { + return s.String() +} + +func newErrorRequestLimitExceeded(v protocol.ResponseMetadata) error { + return &RequestLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RequestLimitExceeded) Code() string { + return "RequestLimitExceeded" +} + +// Message returns the exception's message. +func (s RequestLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RequestLimitExceeded) OrigErr() error { + return nil +} + +func (s RequestLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RequestLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RequestLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The resource which is being attempted to be changed is in use. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, } - return nil } -// SetRegionName sets the RegionName field's value. -func (s *ReplicaSettingsUpdate) SetRegionName(v string) *ReplicaSettingsUpdate { - s.RegionName = &v - return s +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" } -// SetReplicaGlobalSecondaryIndexSettingsUpdate sets the ReplicaGlobalSecondaryIndexSettingsUpdate field's value. -func (s *ReplicaSettingsUpdate) SetReplicaGlobalSecondaryIndexSettingsUpdate(v []*ReplicaGlobalSecondaryIndexSettingsUpdate) *ReplicaSettingsUpdate { - s.ReplicaGlobalSecondaryIndexSettingsUpdate = v - return s +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetReplicaProvisionedReadCapacityAutoScalingSettingsUpdate sets the ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate field's value. -func (s *ReplicaSettingsUpdate) SetReplicaProvisionedReadCapacityAutoScalingSettingsUpdate(v *AutoScalingSettingsUpdate) *ReplicaSettingsUpdate { - s.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate = v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil } -// SetReplicaProvisionedReadCapacityUnits sets the ReplicaProvisionedReadCapacityUnits field's value. -func (s *ReplicaSettingsUpdate) SetReplicaProvisionedReadCapacityUnits(v int64) *ReplicaSettingsUpdate { - s.ReplicaProvisionedReadCapacityUnits = &v - return s +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// Represents one of the following: -// -// * A new replica to be added to an existing global table. -// -// * New parameters for an existing replica. -// -// * An existing replica to be removed from an existing global table. -type ReplicaUpdate struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The parameters required for creating a replica on an existing global table. - Create *CreateReplicaAction `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} - // The name of the existing replica to be removed. - Delete *DeleteReplicaAction `type:"structure"` +// The operation tried to access a nonexistent table or index. The resource +// might not be specified correctly, or its status might not be ACTIVE. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The resource which is being requested does not exist. + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ReplicaUpdate) String() string { +func (s ResourceNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ReplicaUpdate) GoString() string { +func (s ResourceNotFoundException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplicaUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplicaUpdate"} - 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)) - } +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { return nil } -// SetCreate sets the Create field's value. -func (s *ReplicaUpdate) SetCreate(v *CreateReplicaAction) *ReplicaUpdate { - s.Create = v - return s +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetDelete sets the Delete field's value. -func (s *ReplicaUpdate) SetDelete(v *DeleteReplicaAction) *ReplicaUpdate { - s.Delete = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID } // Contains details for the restore. @@ -12693,10 +15445,10 @@ type RestoreSummary struct { // RestoreInProgress is a required field RestoreInProgress *bool `type:"boolean" required:"true"` - // ARN of the backup from which the table was restored. + // The Amazon Resource Name (ARN) of the backup from which the table was restored. SourceBackupArn *string `min:"37" type:"string"` - // ARN of the source table of the backup that is being restored. + // The ARN of the source table of the backup that is being restored. SourceTableArn *string `type:"string"` } @@ -12742,6 +15494,25 @@ type RestoreTableFromBackupInput struct { // BackupArn is a required field BackupArn *string `min:"37" type:"string" required:"true"` + // The billing mode of the restored table. + BillingModeOverride *string `type:"string" enum:"BillingMode"` + + // List of global secondary indexes for the restored table. The indexes provided + // should match existing secondary indexes. You can choose to exclude some or + // all of the indexes at the time of restore. + GlobalSecondaryIndexOverride []*GlobalSecondaryIndex `type:"list"` + + // List of local secondary indexes for the restored table. The indexes provided + // should match existing secondary indexes. You can choose to exclude some or + // all of the indexes at the time of restore. + LocalSecondaryIndexOverride []*LocalSecondaryIndex `type:"list"` + + // Provisioned throughput settings for the restored table. + ProvisionedThroughputOverride *ProvisionedThroughput `type:"structure"` + + // The new server-side encryption settings for the restored table. + SSESpecificationOverride *SSESpecification `type:"structure"` + // The name of the new table to which the backup must be restored. // // TargetTableName is a required field @@ -12773,6 +15544,31 @@ func (s *RestoreTableFromBackupInput) Validate() error { if s.TargetTableName != nil && len(*s.TargetTableName) < 3 { invalidParams.Add(request.NewErrParamMinLen("TargetTableName", 3)) } + if s.GlobalSecondaryIndexOverride != nil { + for i, v := range s.GlobalSecondaryIndexOverride { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GlobalSecondaryIndexOverride", i), err.(request.ErrInvalidParams)) + } + } + } + if s.LocalSecondaryIndexOverride != nil { + for i, v := range s.LocalSecondaryIndexOverride { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LocalSecondaryIndexOverride", i), err.(request.ErrInvalidParams)) + } + } + } + if s.ProvisionedThroughputOverride != nil { + if err := s.ProvisionedThroughputOverride.Validate(); err != nil { + invalidParams.AddNested("ProvisionedThroughputOverride", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -12786,6 +15582,36 @@ func (s *RestoreTableFromBackupInput) SetBackupArn(v string) *RestoreTableFromBa return s } +// SetBillingModeOverride sets the BillingModeOverride field's value. +func (s *RestoreTableFromBackupInput) SetBillingModeOverride(v string) *RestoreTableFromBackupInput { + s.BillingModeOverride = &v + return s +} + +// SetGlobalSecondaryIndexOverride sets the GlobalSecondaryIndexOverride field's value. +func (s *RestoreTableFromBackupInput) SetGlobalSecondaryIndexOverride(v []*GlobalSecondaryIndex) *RestoreTableFromBackupInput { + s.GlobalSecondaryIndexOverride = v + return s +} + +// SetLocalSecondaryIndexOverride sets the LocalSecondaryIndexOverride field's value. +func (s *RestoreTableFromBackupInput) SetLocalSecondaryIndexOverride(v []*LocalSecondaryIndex) *RestoreTableFromBackupInput { + s.LocalSecondaryIndexOverride = v + return s +} + +// SetProvisionedThroughputOverride sets the ProvisionedThroughputOverride field's value. +func (s *RestoreTableFromBackupInput) SetProvisionedThroughputOverride(v *ProvisionedThroughput) *RestoreTableFromBackupInput { + s.ProvisionedThroughputOverride = v + return s +} + +// SetSSESpecificationOverride sets the SSESpecificationOverride field's value. +func (s *RestoreTableFromBackupInput) SetSSESpecificationOverride(v *SSESpecification) *RestoreTableFromBackupInput { + s.SSESpecificationOverride = v + return s +} + // SetTargetTableName sets the TargetTableName field's value. func (s *RestoreTableFromBackupInput) SetTargetTableName(v string) *RestoreTableFromBackupInput { s.TargetTableName = &v @@ -12818,13 +15644,34 @@ func (s *RestoreTableFromBackupOutput) SetTableDescription(v *TableDescription) type RestoreTableToPointInTimeInput struct { _ struct{} `type:"structure"` + // The billing mode of the restored table. + BillingModeOverride *string `type:"string" enum:"BillingMode"` + + // List of global secondary indexes for the restored table. The indexes provided + // should match existing secondary indexes. You can choose to exclude some or + // all of the indexes at the time of restore. + GlobalSecondaryIndexOverride []*GlobalSecondaryIndex `type:"list"` + + // List of local secondary indexes for the restored table. The indexes provided + // should match existing secondary indexes. You can choose to exclude some or + // all of the indexes at the time of restore. + LocalSecondaryIndexOverride []*LocalSecondaryIndex `type:"list"` + + // Provisioned throughput settings for the restored table. + ProvisionedThroughputOverride *ProvisionedThroughput `type:"structure"` + // Time in the past to restore the table to. RestoreDateTime *time.Time `type:"timestamp"` + // The new server-side encryption settings for the restored table. + SSESpecificationOverride *SSESpecification `type:"structure"` + + // The DynamoDB table that will be restored. This value is an Amazon Resource + // Name (ARN). + SourceTableArn *string `type:"string"` + // Name of the source table that is being restored. - // - // SourceTableName is a required field - SourceTableName *string `min:"3" type:"string" required:"true"` + SourceTableName *string `min:"3" type:"string"` // The name of the new table to which it must be restored to. // @@ -12849,9 +15696,6 @@ func (s RestoreTableToPointInTimeInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *RestoreTableToPointInTimeInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "RestoreTableToPointInTimeInput"} - if s.SourceTableName == nil { - invalidParams.Add(request.NewErrParamRequired("SourceTableName")) - } if s.SourceTableName != nil && len(*s.SourceTableName) < 3 { invalidParams.Add(request.NewErrParamMinLen("SourceTableName", 3)) } @@ -12861,6 +15705,31 @@ func (s *RestoreTableToPointInTimeInput) Validate() error { if s.TargetTableName != nil && len(*s.TargetTableName) < 3 { invalidParams.Add(request.NewErrParamMinLen("TargetTableName", 3)) } + if s.GlobalSecondaryIndexOverride != nil { + for i, v := range s.GlobalSecondaryIndexOverride { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GlobalSecondaryIndexOverride", i), err.(request.ErrInvalidParams)) + } + } + } + if s.LocalSecondaryIndexOverride != nil { + for i, v := range s.LocalSecondaryIndexOverride { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LocalSecondaryIndexOverride", i), err.(request.ErrInvalidParams)) + } + } + } + if s.ProvisionedThroughputOverride != nil { + if err := s.ProvisionedThroughputOverride.Validate(); err != nil { + invalidParams.AddNested("ProvisionedThroughputOverride", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -12868,12 +15737,48 @@ func (s *RestoreTableToPointInTimeInput) Validate() error { return nil } +// SetBillingModeOverride sets the BillingModeOverride field's value. +func (s *RestoreTableToPointInTimeInput) SetBillingModeOverride(v string) *RestoreTableToPointInTimeInput { + s.BillingModeOverride = &v + return s +} + +// SetGlobalSecondaryIndexOverride sets the GlobalSecondaryIndexOverride field's value. +func (s *RestoreTableToPointInTimeInput) SetGlobalSecondaryIndexOverride(v []*GlobalSecondaryIndex) *RestoreTableToPointInTimeInput { + s.GlobalSecondaryIndexOverride = v + return s +} + +// SetLocalSecondaryIndexOverride sets the LocalSecondaryIndexOverride field's value. +func (s *RestoreTableToPointInTimeInput) SetLocalSecondaryIndexOverride(v []*LocalSecondaryIndex) *RestoreTableToPointInTimeInput { + s.LocalSecondaryIndexOverride = v + return s +} + +// SetProvisionedThroughputOverride sets the ProvisionedThroughputOverride field's value. +func (s *RestoreTableToPointInTimeInput) SetProvisionedThroughputOverride(v *ProvisionedThroughput) *RestoreTableToPointInTimeInput { + s.ProvisionedThroughputOverride = v + return s +} + // SetRestoreDateTime sets the RestoreDateTime field's value. func (s *RestoreTableToPointInTimeInput) SetRestoreDateTime(v time.Time) *RestoreTableToPointInTimeInput { s.RestoreDateTime = &v return s } +// SetSSESpecificationOverride sets the SSESpecificationOverride field's value. +func (s *RestoreTableToPointInTimeInput) SetSSESpecificationOverride(v *SSESpecification) *RestoreTableToPointInTimeInput { + s.SSESpecificationOverride = v + return s +} + +// SetSourceTableArn sets the SourceTableArn field's value. +func (s *RestoreTableToPointInTimeInput) SetSourceTableArn(v string) *RestoreTableToPointInTimeInput { + s.SourceTableArn = &v + return s +} + // SetSourceTableName sets the SourceTableName field's value. func (s *RestoreTableToPointInTimeInput) SetSourceTableName(v string) *RestoreTableToPointInTimeInput { s.SourceTableName = &v @@ -12919,13 +15824,21 @@ func (s *RestoreTableToPointInTimeOutput) SetTableDescription(v *TableDescriptio type SSEDescription struct { _ struct{} `type:"structure"` - // The KMS customer master key (CMK) ARN used for the KMS encryption. + // Indicates the time, in UNIX epoch date format, when DynamoDB detected that + // the table's AWS KMS key was inaccessible. This attribute will automatically + // be cleared when DynamoDB detects that the table's AWS KMS key is accessible + // again. DynamoDB will initiate the table archival process when table's AWS + // KMS key remains inaccessible for more than seven days from this date. + InaccessibleEncryptionDateTime *time.Time `type:"timestamp"` + + // The AWS KMS customer master key (CMK) ARN used for the AWS KMS encryption. KMSMasterKeyArn *string `type:"string"` // Server-side encryption type. The only supported value is: // - // * KMS - Server-side encryption which uses AWS Key Management Service. - // Key is stored in your account and is managed by AWS KMS (KMS charges apply). + // * KMS - Server-side encryption that uses AWS Key Management Service. The + // key is stored in your account and is managed by AWS KMS (AWS KMS charges + // apply). SSEType *string `type:"string" enum:"SSEType"` // Represents the current state of server-side encryption. The only supported @@ -12947,6 +15860,12 @@ func (s SSEDescription) GoString() string { return s.String() } +// SetInaccessibleEncryptionDateTime sets the InaccessibleEncryptionDateTime field's value. +func (s *SSEDescription) SetInaccessibleEncryptionDateTime(v time.Time) *SSEDescription { + s.InaccessibleEncryptionDateTime = &v + return s +} + // SetKMSMasterKeyArn sets the KMSMasterKeyArn field's value. func (s *SSEDescription) SetKMSMasterKeyArn(v string) *SSEDescription { s.KMSMasterKeyArn = &v @@ -12975,16 +15894,17 @@ type SSESpecification struct { // (false) or not specified, server-side encryption is set to AWS owned CMK. Enabled *bool `type:"boolean"` - // The KMS Customer Master Key (CMK) which should be used for the KMS encryption. - // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, - // or alias ARN. Note that you should only provide this parameter if the key - // is different from the default DynamoDB Customer Master Key alias/aws/dynamodb. + // The AWS KMS customer master key (CMK) that should be used for the AWS KMS + // encryption. To specify a CMK, use its key ID, Amazon Resource Name (ARN), + // alias name, or alias ARN. Note that you should only provide this parameter + // if the key is different from the default DynamoDB customer master key alias/aws/dynamodb. KMSMasterKeyId *string `type:"string"` // Server-side encryption type. The only supported value is: // - // * KMS - Server-side encryption which uses AWS Key Management Service. - // Key is stored in your account and is managed by AWS KMS (KMS charges apply). + // * KMS - Server-side encryption that uses AWS Key Management Service. The + // key is stored in your account and is managed by AWS KMS (AWS KMS charges + // apply). SSEType *string `type:"string" enum:"SSEType"` } @@ -13502,7 +16422,7 @@ type SourceTableDetails struct { // We recommend using PAY_PER_REQUEST for unpredictable workloads. BillingMode *string `type:"string" enum:"BillingMode"` - // Number of items in the table. Please note this is an approximate value. + // Number of items in the table. Note that this is an approximate value. ItemCount *int64 `type:"long"` // Schema of the table. @@ -13533,7 +16453,7 @@ type SourceTableDetails struct { // TableName is a required field TableName *string `min:"3" type:"string" required:"true"` - // Size of the table in bytes. Please note this is an approximate value. + // Size of the table in bytes. Note that this is an approximate value. TableSizeBytes *int64 `type:"long"` } @@ -13607,7 +16527,7 @@ type SourceTableFeatureDetails struct { _ struct{} `type:"structure"` // Represents the GSI properties for the table when the backup was created. - // It includes the IndexName, KeySchema, Projection and ProvisionedThroughput + // It includes the IndexName, KeySchema, Projection, and ProvisionedThroughput // for the GSIs on the table at the time of backup. GlobalSecondaryIndexes []*GlobalSecondaryIndexInfo `type:"list"` @@ -13673,7 +16593,9 @@ type StreamSpecification struct { // Indicates whether DynamoDB Streams is enabled (true) or disabled (false) // on the table. - StreamEnabled *bool `type:"boolean"` + // + // StreamEnabled is a required field + StreamEnabled *bool `type:"boolean" required:"true"` // When an item in the table is modified, StreamViewType determines what information // is written to the stream for this table. Valid values for StreamViewType @@ -13703,6 +16625,19 @@ func (s StreamSpecification) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *StreamSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StreamSpecification"} + if s.StreamEnabled == nil { + invalidParams.Add(request.NewErrParamRequired("StreamEnabled")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetStreamEnabled sets the StreamEnabled field's value. func (s *StreamSpecification) SetStreamEnabled(v bool) *StreamSpecification { s.StreamEnabled = &v @@ -13715,10 +16650,119 @@ func (s *StreamSpecification) SetStreamViewType(v string) *StreamSpecification { return s } +// A target table with the specified name already exists. +type TableAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TableAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TableAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorTableAlreadyExistsException(v protocol.ResponseMetadata) error { + return &TableAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TableAlreadyExistsException) Code() string { + return "TableAlreadyExistsException" +} + +// Message returns the exception's message. +func (s TableAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TableAlreadyExistsException) OrigErr() error { + return nil +} + +func (s TableAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TableAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TableAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// Represents the auto scaling configuration for a global table. +type TableAutoScalingDescription struct { + _ struct{} `type:"structure"` + + // Represents replicas of the global table. + Replicas []*ReplicaAutoScalingDescription `type:"list"` + + // The name of the table. + TableName *string `min:"3" type:"string"` + + // 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 TableAutoScalingDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TableAutoScalingDescription) GoString() string { + return s.String() +} + +// SetReplicas sets the Replicas field's value. +func (s *TableAutoScalingDescription) SetReplicas(v []*ReplicaAutoScalingDescription) *TableAutoScalingDescription { + s.Replicas = v + return s +} + +// SetTableName sets the TableName field's value. +func (s *TableAutoScalingDescription) SetTableName(v string) *TableAutoScalingDescription { + s.TableName = &v + return s +} + +// SetTableStatus sets the TableStatus field's value. +func (s *TableAutoScalingDescription) SetTableStatus(v string) *TableAutoScalingDescription { + s.TableStatus = &v + return s +} + // Represents the properties of a table. type TableDescription struct { _ struct{} `type:"structure"` + // Contains information about the table archive. + ArchivalSummary *ArchivalSummary `type:"structure"` + // An array of AttributeDefinition objects. Each of these objects describes // one attribute in the table and index key schema. // @@ -13741,9 +16785,14 @@ type TableDescription struct { // // * 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 + // 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.) + // that were created during a CreateTable operation.) You can delete an index + // that is being created during the Backfilling phase when IndexStatus is + // set to CREATING and Backfilling is true. You can't delete the index that + // is being created when IndexStatus is set to CREATING and Backfilling is + // false. (This attribute does not appear for indexes that were created during + // a CreateTable operation.) // // * IndexName - The name of the global secondary index. // @@ -13769,7 +16818,7 @@ type TableDescription struct { // 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 + // list of projected attributes is 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 @@ -13785,6 +16834,10 @@ type TableDescription struct { // be returned. GlobalSecondaryIndexes []*GlobalSecondaryIndexDescription `type:"list"` + // Represents the version of global tables (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GlobalTables.html) + // in use, if the table is replicated across AWS Regions. + GlobalTableVersion *string `type:"string"` + // 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"` @@ -13817,11 +16870,11 @@ type TableDescription struct { // However, the combination of the following three elements is guaranteed to // be unique: // - // * the AWS customer ID. + // * AWS customer ID // - // * the table name. + // * Table name // - // * the StreamLabel. + // * StreamLabel LatestStreamLabel *string `type:"string"` // Represents one or more local secondary indexes on the table. Each index is @@ -13842,7 +16895,7 @@ type TableDescription struct { // 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 + // list of projected attributes is 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 @@ -13866,6 +16919,9 @@ type TableDescription struct { // write capacity units, along with data about increases and decreases. ProvisionedThroughput *ProvisionedThroughputDescription `type:"structure"` + // Represents replicas of the table. + Replicas []*ReplicaDescription `type:"list"` + // Contains details for the restore. RestoreSummary *RestoreSummary `type:"structure"` @@ -13895,9 +16951,20 @@ type TableDescription struct { // // * UPDATING - The table is being updated. // - // * DELETING - The table is being deleted. + // * DELETING - The table is being deleted. + // + // * ACTIVE - The table is ready for use. + // + // * INACCESSIBLE_ENCRYPTION_CREDENTIALS - The AWS KMS key used to encrypt + // the table in inaccessible. Table operations may fail due to failure to + // use the AWS KMS key. DynamoDB will initiate the table archival process + // when a table's AWS KMS key remains inaccessible for more than seven days. + // + // * ARCHIVING - The table is being archived. Operations are not allowed + // until archival is complete. // - // * ACTIVE - The table is ready for use. + // * ARCHIVED - The table has been archived. See the ArchivalReason for more + // information. TableStatus *string `type:"string" enum:"TableStatus"` } @@ -13911,6 +16978,12 @@ func (s TableDescription) GoString() string { return s.String() } +// SetArchivalSummary sets the ArchivalSummary field's value. +func (s *TableDescription) SetArchivalSummary(v *ArchivalSummary) *TableDescription { + s.ArchivalSummary = v + return s +} + // SetAttributeDefinitions sets the AttributeDefinitions field's value. func (s *TableDescription) SetAttributeDefinitions(v []*AttributeDefinition) *TableDescription { s.AttributeDefinitions = v @@ -13935,6 +17008,12 @@ func (s *TableDescription) SetGlobalSecondaryIndexes(v []*GlobalSecondaryIndexDe return s } +// SetGlobalTableVersion sets the GlobalTableVersion field's value. +func (s *TableDescription) SetGlobalTableVersion(v string) *TableDescription { + s.GlobalTableVersion = &v + return s +} + // SetItemCount sets the ItemCount field's value. func (s *TableDescription) SetItemCount(v int64) *TableDescription { s.ItemCount = &v @@ -13971,6 +17050,12 @@ func (s *TableDescription) SetProvisionedThroughput(v *ProvisionedThroughputDesc return s } +// SetReplicas sets the Replicas field's value. +func (s *TableDescription) SetReplicas(v []*ReplicaDescription) *TableDescription { + s.Replicas = v + return s +} + // SetRestoreSummary sets the RestoreSummary field's value. func (s *TableDescription) SetRestoreSummary(v *RestoreSummary) *TableDescription { s.RestoreSummary = v @@ -14019,6 +17104,119 @@ func (s *TableDescription) SetTableStatus(v string) *TableDescription { return s } +// A target table with the specified name is either being created or deleted. +type TableInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TableInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TableInUseException) GoString() string { + return s.String() +} + +func newErrorTableInUseException(v protocol.ResponseMetadata) error { + return &TableInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TableInUseException) Code() string { + return "TableInUseException" +} + +// Message returns the exception's message. +func (s TableInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TableInUseException) OrigErr() error { + return nil +} + +func (s TableInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TableInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TableInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// A source table with the name TableName does not currently exist within the +// subscriber's account. +type TableNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TableNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TableNotFoundException) GoString() string { + return s.String() +} + +func newErrorTableNotFoundException(v protocol.ResponseMetadata) error { + return &TableNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TableNotFoundException) Code() string { + return "TableNotFoundException" +} + +// Message returns the exception's message. +func (s TableNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TableNotFoundException) OrigErr() error { + return nil +} + +func (s TableNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TableNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TableNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes a tag. A tag is a key-value pair. You can add up to 50 tags to // a single DynamoDB table. // @@ -14646,6 +17844,261 @@ func (s *TransactWriteItemsOutput) SetItemCollectionMetrics(v map[string][]*Item return s } +// The entire transaction request was canceled. +// +// DynamoDB cancels a TransactWriteItems request under the following circumstances: +// +// * A condition in one of the condition expressions is not met. +// +// * A table in the TransactWriteItems request is in a different account +// or region. +// +// * More than one action in the TransactWriteItems operation targets the +// same item. +// +// * There is insufficient provisioned capacity for the transaction to be +// completed. +// +// * An item size becomes too large (larger than 400 KB), or a local secondary +// index (LSI) becomes too large, or a similar validation error occurs because +// of changes made by the transaction. +// +// * There is a user error, such as an invalid data format. +// +// DynamoDB cancels a TransactGetItems request under the following circumstances: +// +// * There is an ongoing TransactGetItems operation that conflicts with a +// concurrent PutItem, UpdateItem, DeleteItem or TransactWriteItems request. +// In this case the TransactGetItems operation fails with a TransactionCanceledException. +// +// * A table in the TransactGetItems request is in a different account or +// region. +// +// * There is insufficient provisioned capacity for the transaction to be +// completed. +// +// * There is a user error, such as an invalid data format. +// +// If using Java, DynamoDB lists the cancellation reasons on the CancellationReasons +// property. This property is not set for other languages. Transaction cancellation +// reasons are ordered in the order of requested items, if an item has no error +// it will have NONE code and Null message. +// +// Cancellation reason codes and possible error messages: +// +// * No Errors: Code: NONE Message: null +// +// * Conditional Check Failed: Code: ConditionalCheckFailed Message: The +// conditional request failed. +// +// * Item Collection Size Limit Exceeded: Code: ItemCollectionSizeLimitExceeded +// Message: Collection size exceeded. +// +// * Transaction Conflict: Code: TransactionConflict Message: Transaction +// is ongoing for the item. +// +// * Provisioned Throughput Exceeded: Code: ProvisionedThroughputExceeded +// Messages: The level of configured provisioned throughput for the table +// was exceeded. Consider increasing your provisioning level with the UpdateTable +// API. This Message is received when provisioned throughput is exceeded +// is on a provisioned DynamoDB table. The level of configured provisioned +// throughput for one or more global secondary indexes of the table was exceeded. +// Consider increasing your provisioning level for the under-provisioned +// global secondary indexes with the UpdateTable API. This message is returned +// when provisioned throughput is exceeded is on a provisioned GSI. +// +// * Throttling Error: Code: ThrottlingError Messages: Throughput exceeds +// the current capacity of your table or index. DynamoDB is automatically +// scaling your table or index so please try again shortly. If exceptions +// persist, check if you have a hot key: https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/bp-partition-key-design.html. +// This message is returned when writes get throttled on an On-Demand table +// as DynamoDB is automatically scaling the table. Throughput exceeds the +// current capacity for one or more global secondary indexes. DynamoDB is +// automatically scaling your index so please try again shortly. This message +// is returned when when writes get throttled on an On-Demand GSI as DynamoDB +// is automatically scaling the GSI. +// +// * Validation Error: Code: ValidationError Messages: One or more parameter +// values were invalid. The update expression attempted to update the secondary +// index key beyond allowed size limits. The update expression attempted +// to update the secondary index key to unsupported type. An operand in the +// update expression has an incorrect data type. Item size to update has +// exceeded the maximum allowed size. Number overflow. Attempting to store +// a number with magnitude larger than supported range. Type mismatch for +// attribute to update. Nesting Levels have exceeded supported limits. The +// document path provided in the update expression is invalid for update. +// The provided expression refers to an attribute that does not exist in +// the item. +type TransactionCanceledException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A list of cancellation reasons. + CancellationReasons []*CancellationReason `min:"1" type:"list"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s TransactionCanceledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransactionCanceledException) GoString() string { + return s.String() +} + +func newErrorTransactionCanceledException(v protocol.ResponseMetadata) error { + return &TransactionCanceledException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TransactionCanceledException) Code() string { + return "TransactionCanceledException" +} + +// Message returns the exception's message. +func (s TransactionCanceledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TransactionCanceledException) OrigErr() error { + return nil +} + +func (s TransactionCanceledException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TransactionCanceledException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TransactionCanceledException) RequestID() string { + return s.respMetadata.RequestID +} + +// Operation was rejected because there is an ongoing transaction for the item. +type TransactionConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TransactionConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransactionConflictException) GoString() string { + return s.String() +} + +func newErrorTransactionConflictException(v protocol.ResponseMetadata) error { + return &TransactionConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TransactionConflictException) Code() string { + return "TransactionConflictException" +} + +// Message returns the exception's message. +func (s TransactionConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TransactionConflictException) OrigErr() error { + return nil +} + +func (s TransactionConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TransactionConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TransactionConflictException) RequestID() string { + return s.respMetadata.RequestID +} + +// The transaction with the given request token is already in progress. +type TransactionInProgressException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s TransactionInProgressException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransactionInProgressException) GoString() string { + return s.String() +} + +func newErrorTransactionInProgressException(v protocol.ResponseMetadata) error { + return &TransactionInProgressException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TransactionInProgressException) Code() string { + return "TransactionInProgressException" +} + +// Message returns the exception's message. +func (s TransactionInProgressException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TransactionInProgressException) OrigErr() error { + return nil +} + +func (s TransactionInProgressException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TransactionInProgressException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TransactionInProgressException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -14815,25 +18268,112 @@ func (s *Update) SetReturnValuesOnConditionCheckFailure(v string) *Update { return s } -// SetTableName sets the TableName field's value. -func (s *Update) SetTableName(v string) *Update { - s.TableName = &v - return s +// SetTableName sets the TableName field's value. +func (s *Update) SetTableName(v string) *Update { + s.TableName = &v + return s +} + +// SetUpdateExpression sets the UpdateExpression field's value. +func (s *Update) SetUpdateExpression(v string) *Update { + s.UpdateExpression = &v + return s +} + +type UpdateContinuousBackupsInput struct { + _ struct{} `type:"structure"` + + // Represents the settings used to enable point in time recovery. + // + // PointInTimeRecoverySpecification is a required field + PointInTimeRecoverySpecification *PointInTimeRecoverySpecification `type:"structure" required:"true"` + + // The name of the table. + // + // TableName is a required field + TableName *string `min:"3" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateContinuousBackupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateContinuousBackupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateContinuousBackupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateContinuousBackupsInput"} + if s.PointInTimeRecoverySpecification == nil { + invalidParams.Add(request.NewErrParamRequired("PointInTimeRecoverySpecification")) + } + 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.PointInTimeRecoverySpecification != nil { + if err := s.PointInTimeRecoverySpecification.Validate(); err != nil { + invalidParams.AddNested("PointInTimeRecoverySpecification", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPointInTimeRecoverySpecification sets the PointInTimeRecoverySpecification field's value. +func (s *UpdateContinuousBackupsInput) SetPointInTimeRecoverySpecification(v *PointInTimeRecoverySpecification) *UpdateContinuousBackupsInput { + s.PointInTimeRecoverySpecification = v + return s +} + +// SetTableName sets the TableName field's value. +func (s *UpdateContinuousBackupsInput) SetTableName(v string) *UpdateContinuousBackupsInput { + s.TableName = &v + return s +} + +type UpdateContinuousBackupsOutput struct { + _ struct{} `type:"structure"` + + // Represents the continuous backups and point in time recovery settings on + // the table. + ContinuousBackupsDescription *ContinuousBackupsDescription `type:"structure"` +} + +// String returns the string representation +func (s UpdateContinuousBackupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateContinuousBackupsOutput) GoString() string { + return s.String() } -// SetUpdateExpression sets the UpdateExpression field's value. -func (s *Update) SetUpdateExpression(v string) *Update { - s.UpdateExpression = &v +// SetContinuousBackupsDescription sets the ContinuousBackupsDescription field's value. +func (s *UpdateContinuousBackupsOutput) SetContinuousBackupsDescription(v *ContinuousBackupsDescription) *UpdateContinuousBackupsOutput { + s.ContinuousBackupsDescription = v return s } -type UpdateContinuousBackupsInput struct { +type UpdateContributorInsightsInput struct { _ struct{} `type:"structure"` - // Represents the settings used to enable point in time recovery. + // Represents the contributor insights action. // - // PointInTimeRecoverySpecification is a required field - PointInTimeRecoverySpecification *PointInTimeRecoverySpecification `type:"structure" required:"true"` + // ContributorInsightsAction is a required field + ContributorInsightsAction *string `type:"string" required:"true" enum:"ContributorInsightsAction"` + + // The global secondary index name, if applicable. + IndexName *string `min:"3" type:"string"` // The name of the table. // @@ -14842,20 +18382,23 @@ type UpdateContinuousBackupsInput struct { } // String returns the string representation -func (s UpdateContinuousBackupsInput) String() string { +func (s UpdateContributorInsightsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateContinuousBackupsInput) GoString() string { +func (s UpdateContributorInsightsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateContinuousBackupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateContinuousBackupsInput"} - if s.PointInTimeRecoverySpecification == nil { - invalidParams.Add(request.NewErrParamRequired("PointInTimeRecoverySpecification")) +func (s *UpdateContributorInsightsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateContributorInsightsInput"} + if s.ContributorInsightsAction == nil { + invalidParams.Add(request.NewErrParamRequired("ContributorInsightsAction")) + } + if s.IndexName != nil && len(*s.IndexName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("IndexName", 3)) } if s.TableName == nil { invalidParams.Add(request.NewErrParamRequired("TableName")) @@ -14863,11 +18406,6 @@ func (s *UpdateContinuousBackupsInput) Validate() error { if s.TableName != nil && len(*s.TableName) < 3 { invalidParams.Add(request.NewErrParamMinLen("TableName", 3)) } - if s.PointInTimeRecoverySpecification != nil { - if err := s.PointInTimeRecoverySpecification.Validate(); err != nil { - invalidParams.AddNested("PointInTimeRecoverySpecification", err.(request.ErrInvalidParams)) - } - } if invalidParams.Len() > 0 { return invalidParams @@ -14875,39 +18413,62 @@ func (s *UpdateContinuousBackupsInput) Validate() error { return nil } -// SetPointInTimeRecoverySpecification sets the PointInTimeRecoverySpecification field's value. -func (s *UpdateContinuousBackupsInput) SetPointInTimeRecoverySpecification(v *PointInTimeRecoverySpecification) *UpdateContinuousBackupsInput { - s.PointInTimeRecoverySpecification = v +// SetContributorInsightsAction sets the ContributorInsightsAction field's value. +func (s *UpdateContributorInsightsInput) SetContributorInsightsAction(v string) *UpdateContributorInsightsInput { + s.ContributorInsightsAction = &v + return s +} + +// SetIndexName sets the IndexName field's value. +func (s *UpdateContributorInsightsInput) SetIndexName(v string) *UpdateContributorInsightsInput { + s.IndexName = &v return s } // SetTableName sets the TableName field's value. -func (s *UpdateContinuousBackupsInput) SetTableName(v string) *UpdateContinuousBackupsInput { +func (s *UpdateContributorInsightsInput) SetTableName(v string) *UpdateContributorInsightsInput { s.TableName = &v return s } -type UpdateContinuousBackupsOutput struct { +type UpdateContributorInsightsOutput struct { _ struct{} `type:"structure"` - // Represents the continuous backups and point in time recovery settings on - // the table. - ContinuousBackupsDescription *ContinuousBackupsDescription `type:"structure"` + // The status of contributor insights + ContributorInsightsStatus *string `type:"string" enum:"ContributorInsightsStatus"` + + // The name of the global secondary index, if applicable. + IndexName *string `min:"3" type:"string"` + + // The name of the table. + TableName *string `min:"3" type:"string"` } // String returns the string representation -func (s UpdateContinuousBackupsOutput) String() string { +func (s UpdateContributorInsightsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateContinuousBackupsOutput) GoString() string { +func (s UpdateContributorInsightsOutput) GoString() string { return s.String() } -// SetContinuousBackupsDescription sets the ContinuousBackupsDescription field's value. -func (s *UpdateContinuousBackupsOutput) SetContinuousBackupsDescription(v *ContinuousBackupsDescription) *UpdateContinuousBackupsOutput { - s.ContinuousBackupsDescription = v +// SetContributorInsightsStatus sets the ContributorInsightsStatus field's value. +func (s *UpdateContributorInsightsOutput) SetContributorInsightsStatus(v string) *UpdateContributorInsightsOutput { + s.ContributorInsightsStatus = &v + return s +} + +// SetIndexName sets the IndexName field's value. +func (s *UpdateContributorInsightsOutput) SetIndexName(v string) *UpdateContributorInsightsOutput { + s.IndexName = &v + return s +} + +// SetTableName sets the TableName field's value. +func (s *UpdateContributorInsightsOutput) SetTableName(v string) *UpdateContributorInsightsOutput { + s.TableName = &v return s } @@ -15071,6 +18632,12 @@ type UpdateGlobalTableSettingsInput struct { // The billing mode of the global table. If GlobalTableBillingMode is not specified, // the global table defaults to PROVISIONED capacity billing mode. + // + // * PROVISIONED - We recommend using PROVISIONED for predictable workloads. + // PROVISIONED sets the billing mode to Provisioned Mode (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.ProvisionedThroughput.Manual). + // + // * PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable + // workloads. PAY_PER_REQUEST sets the billing mode to On-Demand Mode (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.OnDemand). GlobalTableBillingMode *string `type:"string" enum:"BillingMode"` // Represents the settings of a global secondary index for a global table that @@ -15607,6 +19174,95 @@ func (s *UpdateItemOutput) SetItemCollectionMetrics(v *ItemCollectionMetrics) *U return s } +// Represents a replica to be modified. +type UpdateReplicationGroupMemberAction struct { + _ struct{} `type:"structure"` + + // Replica-specific global secondary index settings. + GlobalSecondaryIndexes []*ReplicaGlobalSecondaryIndex `min:"1" type:"list"` + + // The AWS KMS customer master key (CMK) of the replica that should be used + // for AWS KMS encryption. To specify a CMK, use its key ID, Amazon Resource + // Name (ARN), alias name, or alias ARN. Note that you should only provide this + // parameter if the key is different from the default DynamoDB KMS master key + // alias/aws/dynamodb. + KMSMasterKeyId *string `type:"string"` + + // Replica-specific provisioned throughput. If not specified, uses the source + // table's provisioned throughput settings. + ProvisionedThroughputOverride *ProvisionedThroughputOverride `type:"structure"` + + // The Region where the replica exists. + // + // RegionName is a required field + RegionName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateReplicationGroupMemberAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateReplicationGroupMemberAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateReplicationGroupMemberAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateReplicationGroupMemberAction"} + if s.GlobalSecondaryIndexes != nil && len(s.GlobalSecondaryIndexes) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GlobalSecondaryIndexes", 1)) + } + if s.RegionName == nil { + invalidParams.Add(request.NewErrParamRequired("RegionName")) + } + 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.ProvisionedThroughputOverride != nil { + if err := s.ProvisionedThroughputOverride.Validate(); err != nil { + invalidParams.AddNested("ProvisionedThroughputOverride", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGlobalSecondaryIndexes sets the GlobalSecondaryIndexes field's value. +func (s *UpdateReplicationGroupMemberAction) SetGlobalSecondaryIndexes(v []*ReplicaGlobalSecondaryIndex) *UpdateReplicationGroupMemberAction { + s.GlobalSecondaryIndexes = v + return s +} + +// SetKMSMasterKeyId sets the KMSMasterKeyId field's value. +func (s *UpdateReplicationGroupMemberAction) SetKMSMasterKeyId(v string) *UpdateReplicationGroupMemberAction { + s.KMSMasterKeyId = &v + return s +} + +// SetProvisionedThroughputOverride sets the ProvisionedThroughputOverride field's value. +func (s *UpdateReplicationGroupMemberAction) SetProvisionedThroughputOverride(v *ProvisionedThroughputOverride) *UpdateReplicationGroupMemberAction { + s.ProvisionedThroughputOverride = v + return s +} + +// SetRegionName sets the RegionName field's value. +func (s *UpdateReplicationGroupMemberAction) SetRegionName(v string) *UpdateReplicationGroupMemberAction { + s.RegionName = &v + return s +} + // Represents the input of an UpdateTable operation. type UpdateTableInput struct { _ struct{} `type:"structure"` @@ -15622,11 +19278,11 @@ type UpdateTableInput struct { // values are estimated based on the consumed read and write capacity of your // table and global secondary indexes over the past 30 minutes. // - // * PROVISIONED - Sets the billing mode to PROVISIONED. We recommend using - // PROVISIONED for predictable workloads. + // * PROVISIONED - We recommend using PROVISIONED for predictable workloads. + // PROVISIONED sets the billing mode to Provisioned Mode (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.ProvisionedThroughput.Manual). // - // * PAY_PER_REQUEST - Sets the billing mode to PAY_PER_REQUEST. We recommend - // using PAY_PER_REQUEST for unpredictable workloads. + // * PAY_PER_REQUEST - We recommend using PAY_PER_REQUEST for unpredictable + // workloads. PAY_PER_REQUEST sets the billing mode to On-Demand Mode (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html#HowItWorks.OnDemand). BillingMode *string `type:"string" enum:"BillingMode"` // An array of one or more global secondary indexes for the table. For each @@ -15639,6 +19295,9 @@ type UpdateTableInput struct { // // * Delete - remove a global secondary index from the table. // + // You can create or delete only one global secondary index per UpdateTable + // operation. + // // For more information, see Managing Global Secondary Indexes (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.OnlineOps.html) // in the Amazon DynamoDB Developer Guide. GlobalSecondaryIndexUpdates []*GlobalSecondaryIndexUpdate `type:"list"` @@ -15646,6 +19305,12 @@ type UpdateTableInput struct { // The new provisioned throughput settings for the specified table or index. ProvisionedThroughput *ProvisionedThroughput `type:"structure"` + // A list of replica update actions (create, delete, or update) for the table. + // + // This property only applies to Version 2019.11.21 (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/globaltables.V2.html) + // of global tables. + ReplicaUpdates []*ReplicationGroupUpdate `min:"1" type:"list"` + // The new server-side encryption settings for the specified table. SSESpecification *SSESpecification `type:"structure"` @@ -15675,6 +19340,9 @@ func (s UpdateTableInput) GoString() 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.ReplicaUpdates != nil && len(s.ReplicaUpdates) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ReplicaUpdates", 1)) + } if s.TableName == nil { invalidParams.Add(request.NewErrParamRequired("TableName")) } @@ -15706,6 +19374,21 @@ func (s *UpdateTableInput) Validate() error { invalidParams.AddNested("ProvisionedThroughput", err.(request.ErrInvalidParams)) } } + if s.ReplicaUpdates != nil { + for i, v := range s.ReplicaUpdates { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ReplicaUpdates", i), err.(request.ErrInvalidParams)) + } + } + } + if s.StreamSpecification != nil { + if err := s.StreamSpecification.Validate(); err != nil { + invalidParams.AddNested("StreamSpecification", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -15737,6 +19420,12 @@ func (s *UpdateTableInput) SetProvisionedThroughput(v *ProvisionedThroughput) *U return s } +// SetReplicaUpdates sets the ReplicaUpdates field's value. +func (s *UpdateTableInput) SetReplicaUpdates(v []*ReplicationGroupUpdate) *UpdateTableInput { + s.ReplicaUpdates = v + return s +} + // SetSSESpecification sets the SSESpecification field's value. func (s *UpdateTableInput) SetSSESpecification(v *SSESpecification) *UpdateTableInput { s.SSESpecification = v @@ -15779,6 +19468,131 @@ func (s *UpdateTableOutput) SetTableDescription(v *TableDescription) *UpdateTabl return s } +type UpdateTableReplicaAutoScalingInput struct { + _ struct{} `type:"structure"` + + // Represents the auto scaling settings of the global secondary indexes of the + // replica to be updated. + GlobalSecondaryIndexUpdates []*GlobalSecondaryIndexAutoScalingUpdate `min:"1" type:"list"` + + // Represents the auto scaling settings to be modified for a global table or + // global secondary index. + ProvisionedWriteCapacityAutoScalingUpdate *AutoScalingSettingsUpdate `type:"structure"` + + // Represents the auto scaling settings of replicas of the table that will be + // modified. + ReplicaUpdates []*ReplicaAutoScalingUpdate `min:"1" type:"list"` + + // The name of the global table to be updated. + // + // TableName is a required field + TableName *string `min:"3" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateTableReplicaAutoScalingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTableReplicaAutoScalingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateTableReplicaAutoScalingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateTableReplicaAutoScalingInput"} + if s.GlobalSecondaryIndexUpdates != nil && len(s.GlobalSecondaryIndexUpdates) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GlobalSecondaryIndexUpdates", 1)) + } + if s.ReplicaUpdates != nil && len(s.ReplicaUpdates) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ReplicaUpdates", 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.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.ProvisionedWriteCapacityAutoScalingUpdate != nil { + if err := s.ProvisionedWriteCapacityAutoScalingUpdate.Validate(); err != nil { + invalidParams.AddNested("ProvisionedWriteCapacityAutoScalingUpdate", err.(request.ErrInvalidParams)) + } + } + if s.ReplicaUpdates != nil { + for i, v := range s.ReplicaUpdates { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ReplicaUpdates", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGlobalSecondaryIndexUpdates sets the GlobalSecondaryIndexUpdates field's value. +func (s *UpdateTableReplicaAutoScalingInput) SetGlobalSecondaryIndexUpdates(v []*GlobalSecondaryIndexAutoScalingUpdate) *UpdateTableReplicaAutoScalingInput { + s.GlobalSecondaryIndexUpdates = v + return s +} + +// SetProvisionedWriteCapacityAutoScalingUpdate sets the ProvisionedWriteCapacityAutoScalingUpdate field's value. +func (s *UpdateTableReplicaAutoScalingInput) SetProvisionedWriteCapacityAutoScalingUpdate(v *AutoScalingSettingsUpdate) *UpdateTableReplicaAutoScalingInput { + s.ProvisionedWriteCapacityAutoScalingUpdate = v + return s +} + +// SetReplicaUpdates sets the ReplicaUpdates field's value. +func (s *UpdateTableReplicaAutoScalingInput) SetReplicaUpdates(v []*ReplicaAutoScalingUpdate) *UpdateTableReplicaAutoScalingInput { + s.ReplicaUpdates = v + return s +} + +// SetTableName sets the TableName field's value. +func (s *UpdateTableReplicaAutoScalingInput) SetTableName(v string) *UpdateTableReplicaAutoScalingInput { + s.TableName = &v + return s +} + +type UpdateTableReplicaAutoScalingOutput struct { + _ struct{} `type:"structure"` + + // Returns information about the auto scaling settings of a table with replicas. + TableAutoScalingDescription *TableAutoScalingDescription `type:"structure"` +} + +// String returns the string representation +func (s UpdateTableReplicaAutoScalingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTableReplicaAutoScalingOutput) GoString() string { + return s.String() +} + +// SetTableAutoScalingDescription sets the TableAutoScalingDescription field's value. +func (s *UpdateTableReplicaAutoScalingOutput) SetTableAutoScalingDescription(v *TableAutoScalingDescription) *UpdateTableReplicaAutoScalingOutput { + s.TableAutoScalingDescription = v + return s +} + // Represents the input of an UpdateTimeToLive operation. type UpdateTimeToLiveInput struct { _ struct{} `type:"structure"` @@ -15866,8 +19680,8 @@ func (s *UpdateTimeToLiveOutput) SetTimeToLiveSpecification(v *TimeToLiveSpecifi // 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. +// If you do need to perform both of these operations, you need to provide two +// separate WriteRequest objects. type WriteRequest struct { _ struct{} `type:"structure"` @@ -16012,6 +19826,31 @@ const ( ContinuousBackupsStatusDisabled = "DISABLED" ) +const ( + // ContributorInsightsActionEnable is a ContributorInsightsAction enum value + ContributorInsightsActionEnable = "ENABLE" + + // ContributorInsightsActionDisable is a ContributorInsightsAction enum value + ContributorInsightsActionDisable = "DISABLE" +) + +const ( + // ContributorInsightsStatusEnabling is a ContributorInsightsStatus enum value + ContributorInsightsStatusEnabling = "ENABLING" + + // ContributorInsightsStatusEnabled is a ContributorInsightsStatus enum value + ContributorInsightsStatusEnabled = "ENABLED" + + // ContributorInsightsStatusDisabling is a ContributorInsightsStatus enum value + ContributorInsightsStatusDisabling = "DISABLING" + + // ContributorInsightsStatusDisabled is a ContributorInsightsStatus enum value + ContributorInsightsStatusDisabled = "DISABLED" + + // ContributorInsightsStatusFailed is a ContributorInsightsStatus enum value + ContributorInsightsStatusFailed = "FAILED" +) + const ( // GlobalTableStatusCreating is a GlobalTableStatus enum value GlobalTableStatusCreating = "CREATING" @@ -16071,6 +19910,9 @@ const ( // ReplicaStatusCreating is a ReplicaStatus enum value ReplicaStatusCreating = "CREATING" + // ReplicaStatusCreationFailed is a ReplicaStatus enum value + ReplicaStatusCreationFailed = "CREATION_FAILED" + // ReplicaStatusUpdating is a ReplicaStatus enum value ReplicaStatusUpdating = "UPDATING" @@ -16214,6 +20056,15 @@ const ( // TableStatusActive is a TableStatus enum value TableStatusActive = "ACTIVE" + + // TableStatusInaccessibleEncryptionCredentials is a TableStatus enum value + TableStatusInaccessibleEncryptionCredentials = "INACCESSIBLE_ENCRYPTION_CREDENTIALS" + + // TableStatusArchiving is a TableStatus enum value + TableStatusArchiving = "ARCHIVING" + + // TableStatusArchived is a TableStatus enum value + TableStatusArchived = "ARCHIVED" ) const ( 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 index 71f3e7d3d53..0cead118519 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/errors.go @@ -2,6 +2,10 @@ package dynamodb +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBackupInUseException for service response error code @@ -184,8 +188,6 @@ const ( // index (LSI) becomes too large, or a similar validation error occurs because // of changes made by the transaction. // - // * The aggregate size of the items in the transaction exceeds 4 MBs. - // // * There is a user error, such as an invalid data format. // // DynamoDB cancels a TransactGetItems request under the following circumstances: @@ -200,8 +202,6 @@ const ( // * There is insufficient provisioned capacity for the transaction to be // completed. // - // * The aggregate size of the items in the transaction exceeds 4 MBs. - // // * There is a user error, such as an invalid data format. // // If using Java, DynamoDB lists the cancellation reasons on the CancellationReasons @@ -268,3 +268,31 @@ const ( // The transaction with the given request token is already in progress. ErrCodeTransactionInProgressException = "TransactionInProgressException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BackupInUseException": newErrorBackupInUseException, + "BackupNotFoundException": newErrorBackupNotFoundException, + "ConditionalCheckFailedException": newErrorConditionalCheckFailedException, + "ContinuousBackupsUnavailableException": newErrorContinuousBackupsUnavailableException, + "GlobalTableAlreadyExistsException": newErrorGlobalTableAlreadyExistsException, + "GlobalTableNotFoundException": newErrorGlobalTableNotFoundException, + "IdempotentParameterMismatchException": newErrorIdempotentParameterMismatchException, + "IndexNotFoundException": newErrorIndexNotFoundException, + "InternalServerError": newErrorInternalServerError, + "InvalidRestoreTimeException": newErrorInvalidRestoreTimeException, + "ItemCollectionSizeLimitExceededException": newErrorItemCollectionSizeLimitExceededException, + "LimitExceededException": newErrorLimitExceededException, + "PointInTimeRecoveryUnavailableException": newErrorPointInTimeRecoveryUnavailableException, + "ProvisionedThroughputExceededException": newErrorProvisionedThroughputExceededException, + "ReplicaAlreadyExistsException": newErrorReplicaAlreadyExistsException, + "ReplicaNotFoundException": newErrorReplicaNotFoundException, + "RequestLimitExceeded": newErrorRequestLimitExceeded, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "TableAlreadyExistsException": newErrorTableAlreadyExistsException, + "TableInUseException": newErrorTableInUseException, + "TableNotFoundException": newErrorTableNotFoundException, + "TransactionCanceledException": newErrorTransactionCanceledException, + "TransactionConflictException": newErrorTransactionConflictException, + "TransactionInProgressException": newErrorTransactionInProgressException, +} 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 index edcb5b8598e..8bae9d23659 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/dynamodb/service.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go/aws/crr" "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -33,7 +34,7 @@ var initRequest func(*request.Request) const ( ServiceName = "dynamodb" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "DynamoDB" // ServiceID is a unique identifer of a specific service. + ServiceID = "DynamoDB" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the DynamoDB client with a session. @@ -41,6 +42,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a DynamoDB client from just a session. // svc := dynamodb.New(mySession) // @@ -48,11 +51,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *DynamoDB { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *DynamoDB { svc := &DynamoDB{ Client: client.New( cfg, @@ -61,6 +64,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2012-08-10", JSONVersion: "1.0", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index ea5b933514a..1eabbf82bc7 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/api.go @@ -88,6 +88,81 @@ func (c *EC2) AcceptReservedInstancesExchangeQuoteWithContext(ctx aws.Context, i return out, req.Send() } +const opAcceptTransitGatewayPeeringAttachment = "AcceptTransitGatewayPeeringAttachment" + +// AcceptTransitGatewayPeeringAttachmentRequest generates a "aws/request.Request" representing the +// client's request for the AcceptTransitGatewayPeeringAttachment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AcceptTransitGatewayPeeringAttachment for more information on using the AcceptTransitGatewayPeeringAttachment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AcceptTransitGatewayPeeringAttachmentRequest method. +// req, resp := client.AcceptTransitGatewayPeeringAttachmentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptTransitGatewayPeeringAttachment +func (c *EC2) AcceptTransitGatewayPeeringAttachmentRequest(input *AcceptTransitGatewayPeeringAttachmentInput) (req *request.Request, output *AcceptTransitGatewayPeeringAttachmentOutput) { + op := &request.Operation{ + Name: opAcceptTransitGatewayPeeringAttachment, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AcceptTransitGatewayPeeringAttachmentInput{} + } + + output = &AcceptTransitGatewayPeeringAttachmentOutput{} + req = c.newRequest(op, input, output) + return +} + +// AcceptTransitGatewayPeeringAttachment API operation for Amazon Elastic Compute Cloud. +// +// Accepts a transit gateway peering attachment request. The peering attachment +// must be in the pendingAcceptance 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 AcceptTransitGatewayPeeringAttachment for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AcceptTransitGatewayPeeringAttachment +func (c *EC2) AcceptTransitGatewayPeeringAttachment(input *AcceptTransitGatewayPeeringAttachmentInput) (*AcceptTransitGatewayPeeringAttachmentOutput, error) { + req, out := c.AcceptTransitGatewayPeeringAttachmentRequest(input) + return out, req.Send() +} + +// AcceptTransitGatewayPeeringAttachmentWithContext is the same as AcceptTransitGatewayPeeringAttachment with the addition of +// the ability to pass a context and additional request options. +// +// See AcceptTransitGatewayPeeringAttachment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) AcceptTransitGatewayPeeringAttachmentWithContext(ctx aws.Context, input *AcceptTransitGatewayPeeringAttachmentInput, opts ...request.Option) (*AcceptTransitGatewayPeeringAttachmentOutput, error) { + req, out := c.AcceptTransitGatewayPeeringAttachmentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opAcceptTransitGatewayVpcAttachment = "AcceptTransitGatewayVpcAttachment" // AcceptTransitGatewayVpcAttachmentRequest generates a "aws/request.Request" representing the @@ -365,8 +440,8 @@ func (c *EC2) AdvertiseByoipCidrRequest(input *AdvertiseByoipCidrInput) (req *re // AdvertiseByoipCidr API operation for Amazon Elastic Compute Cloud. // -// Advertises an IPv4 address range that is provisioned for use with your AWS -// resources through bring your own IP addresses (BYOIP). +// Advertises an IPv4 or IPv6 address range that is provisioned for use with +// your AWS resources through bring your own IP addresses (BYOIP). // // You can perform this operation at most once every 10 seconds, even if you // specify different address ranges each time. @@ -551,8 +626,9 @@ func (c *EC2) AllocateHostsRequest(input *AllocateHostsInput) (req *request.Requ // AllocateHosts API operation for Amazon Elastic Compute Cloud. // -// Allocates a Dedicated Host to your account. At a minimum, specify the instance -// size type, Availability Zone, and quantity of hosts to allocate. +// Allocates a Dedicated Host to your account. At a minimum, specify the supported +// instance type or instance family, the Availability Zone in which to allocate +// the host, and the number of hosts 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 @@ -711,6 +787,9 @@ func (c *EC2) AssignIpv6AddressesRequest(input *AssignIpv6AddressesInput) (req * // Type (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI) // in the Amazon Elastic Compute Cloud User Guide. // +// You must specify either the IPv6 addresses or the IPv6 address count 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. @@ -802,6 +881,8 @@ func (c *EC2) AssignPrivateIpAddressesRequest(input *AssignPrivateIpAddressesInp // address from one network interface to another, check network/interfaces/macs/mac/local-ipv4s // in the instance metadata to confirm that the remapping is complete. // +// You must specify either the IP addresses or the IP address count 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. @@ -895,6 +976,9 @@ func (c *EC2) AssociateAddressRequest(input *AssociateAddressInput) (req *reques // an Elastic IP address with an instance or network interface that has an existing // Elastic IP address. // +// You cannot associate an Elastic IP address with an interface in a different +// network border group. +// // 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, @@ -1211,11 +1295,12 @@ func (c *EC2) AssociateRouteTableRequest(input *AssociateRouteTableInput) (req * // 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. +// Associates a subnet in your VPC or an internet gateway or virtual private +// gateway attached to your VPC with a route table in your VPC. This association +// causes traffic from the subnet or gateway 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 later. A route table can be associated +// with multiple subnets. // // For more information, see Route Tables (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html) // in the Amazon Virtual Private Cloud User Guide. @@ -1324,6 +1409,85 @@ func (c *EC2) AssociateSubnetCidrBlockWithContext(ctx aws.Context, input *Associ return out, req.Send() } +const opAssociateTransitGatewayMulticastDomain = "AssociateTransitGatewayMulticastDomain" + +// AssociateTransitGatewayMulticastDomainRequest generates a "aws/request.Request" representing the +// client's request for the AssociateTransitGatewayMulticastDomain operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AssociateTransitGatewayMulticastDomain for more information on using the AssociateTransitGatewayMulticastDomain +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AssociateTransitGatewayMulticastDomainRequest method. +// req, resp := client.AssociateTransitGatewayMulticastDomainRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateTransitGatewayMulticastDomain +func (c *EC2) AssociateTransitGatewayMulticastDomainRequest(input *AssociateTransitGatewayMulticastDomainInput) (req *request.Request, output *AssociateTransitGatewayMulticastDomainOutput) { + op := &request.Operation{ + Name: opAssociateTransitGatewayMulticastDomain, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AssociateTransitGatewayMulticastDomainInput{} + } + + output = &AssociateTransitGatewayMulticastDomainOutput{} + req = c.newRequest(op, input, output) + return +} + +// AssociateTransitGatewayMulticastDomain API operation for Amazon Elastic Compute Cloud. +// +// Associates the specified subnets and transit gateway attachments with the +// specified transit gateway multicast domain. +// +// The transit gateway attachment must be in the available state before you +// can add a resource. Use DescribeTransitGatewayAttachments (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeTransitGatewayAttachments.html) +// to see the state of the attachment. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation AssociateTransitGatewayMulticastDomain for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/AssociateTransitGatewayMulticastDomain +func (c *EC2) AssociateTransitGatewayMulticastDomain(input *AssociateTransitGatewayMulticastDomainInput) (*AssociateTransitGatewayMulticastDomainOutput, error) { + req, out := c.AssociateTransitGatewayMulticastDomainRequest(input) + return out, req.Send() +} + +// AssociateTransitGatewayMulticastDomainWithContext is the same as AssociateTransitGatewayMulticastDomain with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateTransitGatewayMulticastDomain for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) AssociateTransitGatewayMulticastDomainWithContext(ctx aws.Context, input *AssociateTransitGatewayMulticastDomainInput, opts ...request.Option) (*AssociateTransitGatewayMulticastDomainOutput, error) { + req, out := c.AssociateTransitGatewayMulticastDomainRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opAssociateTransitGatewayRouteTable = "AssociateTransitGatewayRouteTable" // AssociateTransitGatewayRouteTableRequest generates a "aws/request.Request" representing the @@ -1444,8 +1608,13 @@ func (c *EC2) AssociateVpcCidrBlockRequest(input *AssociateVpcCidrBlockInput) (r // AssociateVpcCidrBlock API operation for Amazon Elastic Compute Cloud. // // Associates a CIDR block with your VPC. You can associate a secondary IPv4 -// CIDR block, or you can associate an Amazon-provided IPv6 CIDR block. The -// IPv6 CIDR block size is fixed at /56. +// CIDR block, an Amazon-provided IPv6 CIDR block, or an IPv6 CIDR block from +// an IPv6 address pool that you provisioned through bring your own IP addresses +// (BYOIP (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html)). +// The IPv6 CIDR block size is fixed at /56. +// +// You must specify one of the following in the request: an IPv4 CIDR block, +// an IPv6 pool, or an Amazon-provided IPv6 CIDR block. // // For more information about associating CIDR blocks with your VPC and applicable // restrictions, see VPC and Subnet Sizing (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html#VPC_Sizing) @@ -1609,9 +1778,10 @@ func (c *EC2) AttachInternetGatewayRequest(input *AttachInternetGatewayInput) (r // 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 (https://docs.aws.amazon.com/vpc/latest/userguide/). +// Attaches an internet gateway or a virtual private 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 (https://docs.aws.amazon.com/vpc/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 @@ -3493,11 +3663,10 @@ func (c *EC2) CreateCustomerGatewayRequest(input *CreateCustomerGatewayInput) (r // For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html) // in the AWS Site-to-Site VPN 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. +// To create more than one customer gateway with the same VPN type, IP address, +// and BGP ASN, specify a unique device name for each customer gateway. Identical +// requests return information about the existing customer gateway and do not +// create new customer 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 @@ -4610,6 +4779,154 @@ func (c *EC2) CreateLaunchTemplateVersionWithContext(ctx aws.Context, input *Cre return out, req.Send() } +const opCreateLocalGatewayRoute = "CreateLocalGatewayRoute" + +// CreateLocalGatewayRouteRequest generates a "aws/request.Request" representing the +// client's request for the CreateLocalGatewayRoute operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateLocalGatewayRoute for more information on using the CreateLocalGatewayRoute +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateLocalGatewayRouteRequest method. +// req, resp := client.CreateLocalGatewayRouteRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateLocalGatewayRoute +func (c *EC2) CreateLocalGatewayRouteRequest(input *CreateLocalGatewayRouteInput) (req *request.Request, output *CreateLocalGatewayRouteOutput) { + op := &request.Operation{ + Name: opCreateLocalGatewayRoute, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateLocalGatewayRouteInput{} + } + + output = &CreateLocalGatewayRouteOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateLocalGatewayRoute API operation for Amazon Elastic Compute Cloud. +// +// Creates a static route for the specified local gateway 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 CreateLocalGatewayRoute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateLocalGatewayRoute +func (c *EC2) CreateLocalGatewayRoute(input *CreateLocalGatewayRouteInput) (*CreateLocalGatewayRouteOutput, error) { + req, out := c.CreateLocalGatewayRouteRequest(input) + return out, req.Send() +} + +// CreateLocalGatewayRouteWithContext is the same as CreateLocalGatewayRoute with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLocalGatewayRoute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) CreateLocalGatewayRouteWithContext(ctx aws.Context, input *CreateLocalGatewayRouteInput, opts ...request.Option) (*CreateLocalGatewayRouteOutput, error) { + req, out := c.CreateLocalGatewayRouteRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateLocalGatewayRouteTableVpcAssociation = "CreateLocalGatewayRouteTableVpcAssociation" + +// CreateLocalGatewayRouteTableVpcAssociationRequest generates a "aws/request.Request" representing the +// client's request for the CreateLocalGatewayRouteTableVpcAssociation operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateLocalGatewayRouteTableVpcAssociation for more information on using the CreateLocalGatewayRouteTableVpcAssociation +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateLocalGatewayRouteTableVpcAssociationRequest method. +// req, resp := client.CreateLocalGatewayRouteTableVpcAssociationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateLocalGatewayRouteTableVpcAssociation +func (c *EC2) CreateLocalGatewayRouteTableVpcAssociationRequest(input *CreateLocalGatewayRouteTableVpcAssociationInput) (req *request.Request, output *CreateLocalGatewayRouteTableVpcAssociationOutput) { + op := &request.Operation{ + Name: opCreateLocalGatewayRouteTableVpcAssociation, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateLocalGatewayRouteTableVpcAssociationInput{} + } + + output = &CreateLocalGatewayRouteTableVpcAssociationOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateLocalGatewayRouteTableVpcAssociation API operation for Amazon Elastic Compute Cloud. +// +// Associates the specified VPC with the specified local gateway 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 CreateLocalGatewayRouteTableVpcAssociation for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateLocalGatewayRouteTableVpcAssociation +func (c *EC2) CreateLocalGatewayRouteTableVpcAssociation(input *CreateLocalGatewayRouteTableVpcAssociationInput) (*CreateLocalGatewayRouteTableVpcAssociationOutput, error) { + req, out := c.CreateLocalGatewayRouteTableVpcAssociationRequest(input) + return out, req.Send() +} + +// CreateLocalGatewayRouteTableVpcAssociationWithContext is the same as CreateLocalGatewayRouteTableVpcAssociation with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLocalGatewayRouteTableVpcAssociation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) CreateLocalGatewayRouteTableVpcAssociationWithContext(ctx aws.Context, input *CreateLocalGatewayRouteTableVpcAssociationInput, opts ...request.Option) (*CreateLocalGatewayRouteTableVpcAssociationOutput, error) { + req, out := c.CreateLocalGatewayRouteTableVpcAssociationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateNatGateway = "CreateNatGateway" // CreateNatGatewayRequest generates a "aws/request.Request" representing the @@ -5245,7 +5562,7 @@ func (c *EC2) CreateRouteRequest(input *CreateRouteInput) (req *request.Request, // // 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. +// interface, egress-only internet gateway, or transit 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 @@ -5619,7 +5936,7 @@ func (c *EC2) CreateSnapshotsRequest(input *CreateSnapshotsInput) (req *request. // Creates crash-consistent snapshots of multiple EBS volumes and stores the // data in S3. Volumes are chosen by specifying an instance. Any attached volumes // will produce one snapshot each that is crash-consistent across the instance. -// Boot volumes can be excluded by changing the paramaters. +// Boot volumes can be excluded by changing the 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 @@ -5958,8 +6275,10 @@ func (c *EC2) CreateTrafficMirrorFilterRequest(input *CreateTrafficMirrorFilterI // A Traffic Mirror filter is a set of rules that defines the traffic to mirror. // // By default, no traffic is mirrored. To mirror traffic, use CreateTrafficMirrorFilterRule +// (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTrafficMirrorFilterRule.htm) // to add Traffic Mirror rules to the filter. The rules you add define what // traffic gets mirrored. You can also use ModifyTrafficMirrorFilterNetworkServices +// (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyTrafficMirrorFilterNetworkServices.html) // to mirror supported network services. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -6034,7 +6353,7 @@ func (c *EC2) CreateTrafficMirrorFilterRuleRequest(input *CreateTrafficMirrorFil // CreateTrafficMirrorFilterRule API operation for Amazon Elastic Compute Cloud. // -// Creates a Traffic Mirror rule. +// Creates a Traffic Mirror filter rule. // // A Traffic Mirror rule defines the Traffic Mirror source traffic to mirror. // @@ -6122,8 +6441,8 @@ func (c *EC2) CreateTrafficMirrorSessionRequest(input *CreateTrafficMirrorSessio // can be in the same VPC, or in a different VPC connected via VPC peering or // a transit gateway. // -// By default, no traffic is mirrored. Use CreateTrafficMirrorFilter to create -// filter rules that specify the traffic to mirror. +// By default, no traffic is mirrored. Use CreateTrafficMirrorFilter (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTrafficMirrorFilter.htm) +// to create filter rules that specify the traffic to mirror. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6206,7 +6525,8 @@ func (c *EC2) CreateTrafficMirrorTargetRequest(input *CreateTrafficMirrorTargetI // // A Traffic Mirror target can be a network interface, or a Network Load Balancer. // -// To use the target in a Traffic Mirror session, use CreateTrafficMirrorSession. +// To use the target in a Traffic Mirror session, use CreateTrafficMirrorSession +// (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTrafficMirrorSession.htm). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6329,6 +6649,164 @@ func (c *EC2) CreateTransitGatewayWithContext(ctx aws.Context, input *CreateTran return out, req.Send() } +const opCreateTransitGatewayMulticastDomain = "CreateTransitGatewayMulticastDomain" + +// CreateTransitGatewayMulticastDomainRequest generates a "aws/request.Request" representing the +// client's request for the CreateTransitGatewayMulticastDomain operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateTransitGatewayMulticastDomain for more information on using the CreateTransitGatewayMulticastDomain +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateTransitGatewayMulticastDomainRequest method. +// req, resp := client.CreateTransitGatewayMulticastDomainRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayMulticastDomain +func (c *EC2) CreateTransitGatewayMulticastDomainRequest(input *CreateTransitGatewayMulticastDomainInput) (req *request.Request, output *CreateTransitGatewayMulticastDomainOutput) { + op := &request.Operation{ + Name: opCreateTransitGatewayMulticastDomain, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateTransitGatewayMulticastDomainInput{} + } + + output = &CreateTransitGatewayMulticastDomainOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateTransitGatewayMulticastDomain API operation for Amazon Elastic Compute Cloud. +// +// Creates a multicast domain using the specified transit gateway. +// +// The transit gateway must be in the available state before you create a domain. +// Use DescribeTransitGateways (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeTransitGateways.html) +// to see the state of transit 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 CreateTransitGatewayMulticastDomain for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayMulticastDomain +func (c *EC2) CreateTransitGatewayMulticastDomain(input *CreateTransitGatewayMulticastDomainInput) (*CreateTransitGatewayMulticastDomainOutput, error) { + req, out := c.CreateTransitGatewayMulticastDomainRequest(input) + return out, req.Send() +} + +// CreateTransitGatewayMulticastDomainWithContext is the same as CreateTransitGatewayMulticastDomain with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTransitGatewayMulticastDomain for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) CreateTransitGatewayMulticastDomainWithContext(ctx aws.Context, input *CreateTransitGatewayMulticastDomainInput, opts ...request.Option) (*CreateTransitGatewayMulticastDomainOutput, error) { + req, out := c.CreateTransitGatewayMulticastDomainRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateTransitGatewayPeeringAttachment = "CreateTransitGatewayPeeringAttachment" + +// CreateTransitGatewayPeeringAttachmentRequest generates a "aws/request.Request" representing the +// client's request for the CreateTransitGatewayPeeringAttachment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateTransitGatewayPeeringAttachment for more information on using the CreateTransitGatewayPeeringAttachment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateTransitGatewayPeeringAttachmentRequest method. +// req, resp := client.CreateTransitGatewayPeeringAttachmentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayPeeringAttachment +func (c *EC2) CreateTransitGatewayPeeringAttachmentRequest(input *CreateTransitGatewayPeeringAttachmentInput) (req *request.Request, output *CreateTransitGatewayPeeringAttachmentOutput) { + op := &request.Operation{ + Name: opCreateTransitGatewayPeeringAttachment, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateTransitGatewayPeeringAttachmentInput{} + } + + output = &CreateTransitGatewayPeeringAttachmentOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateTransitGatewayPeeringAttachment API operation for Amazon Elastic Compute Cloud. +// +// Requests a transit gateway peering attachment between the specified transit +// gateway (requester) and a peer transit gateway (accepter). The transit gateways +// must be in different Regions. The peer transit gateway can be in your account +// or a different AWS account. +// +// After you create the peering attachment, the owner of the accepter transit +// gateway must accept the attachment 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 CreateTransitGatewayPeeringAttachment for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateTransitGatewayPeeringAttachment +func (c *EC2) CreateTransitGatewayPeeringAttachment(input *CreateTransitGatewayPeeringAttachmentInput) (*CreateTransitGatewayPeeringAttachmentOutput, error) { + req, out := c.CreateTransitGatewayPeeringAttachmentRequest(input) + return out, req.Send() +} + +// CreateTransitGatewayPeeringAttachmentWithContext is the same as CreateTransitGatewayPeeringAttachment with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTransitGatewayPeeringAttachment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) CreateTransitGatewayPeeringAttachmentWithContext(ctx aws.Context, input *CreateTransitGatewayPeeringAttachmentInput, opts ...request.Option) (*CreateTransitGatewayPeeringAttachmentOutput, error) { + req, out := c.CreateTransitGatewayPeeringAttachmentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateTransitGatewayRoute = "CreateTransitGatewayRoute" // CreateTransitGatewayRouteRequest generates a "aws/request.Request" representing the @@ -6701,9 +7179,10 @@ func (c *EC2) CreateVpcRequest(input *CreateVpcInput) (req *request.Request, out // make your VPC, see Your VPC and Subnets (https://docs.aws.amazon.com/vpc/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. +// You can optionally request an IPv6 CIDR block for the VPC. You can request +// an Amazon-provided IPv6 CIDR block from Amazon's pool of IPv6 addresses, +// or an IPv6 CIDR block from an IPv6 address pool that you provisioned through +// bring your own IP addresses (BYOIP (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html)). // // By default, each instance you launch in the VPC has the default DHCP options, // which include only a default DNS server that we provide (AmazonProvidedDNS). @@ -6789,14 +7268,14 @@ func (c *EC2) CreateVpcEndpointRequest(input *CreateVpcEndpointInput) (req *requ // // Creates a VPC endpoint for a specified service. An endpoint enables you to // create a private connection between your VPC and the service. The service -// may be provided by AWS, an AWS Marketplace partner, or another AWS account. +// may be provided by AWS, an AWS Marketplace Partner, or another AWS account. // For more information, see VPC Endpoints (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html) // in the Amazon Virtual Private Cloud User Guide. // // A gateway endpoint serves as a target for a route in your route table for // traffic destined for the AWS service. 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. +// to attach to the endpoint, which will control access to the service from +// your VPC. You can also specify the VPC route tables that use the endpoint. // // An interface endpoint is a network interface in your subnet that serves as // an endpoint for communicating with the specified service. You can specify @@ -6966,6 +7445,11 @@ func (c *EC2) CreateVpcEndpointServiceConfigurationRequest(input *CreateVpcEndpo // (https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-service.html) // in the Amazon Virtual Private Cloud User Guide. // +// If you set the private DNS name, you must prove that you own the private +// DNS domain name. For more information, see VPC Endpoint Service Private DNS +// Name Verification (https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-services-dns-validation.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. @@ -8247,6 +8731,154 @@ func (c *EC2) DeleteLaunchTemplateVersionsWithContext(ctx aws.Context, input *De return out, req.Send() } +const opDeleteLocalGatewayRoute = "DeleteLocalGatewayRoute" + +// DeleteLocalGatewayRouteRequest generates a "aws/request.Request" representing the +// client's request for the DeleteLocalGatewayRoute operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteLocalGatewayRoute for more information on using the DeleteLocalGatewayRoute +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteLocalGatewayRouteRequest method. +// req, resp := client.DeleteLocalGatewayRouteRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteLocalGatewayRoute +func (c *EC2) DeleteLocalGatewayRouteRequest(input *DeleteLocalGatewayRouteInput) (req *request.Request, output *DeleteLocalGatewayRouteOutput) { + op := &request.Operation{ + Name: opDeleteLocalGatewayRoute, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteLocalGatewayRouteInput{} + } + + output = &DeleteLocalGatewayRouteOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteLocalGatewayRoute API operation for Amazon Elastic Compute Cloud. +// +// Deletes the specified route from the specified local gateway 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 DeleteLocalGatewayRoute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteLocalGatewayRoute +func (c *EC2) DeleteLocalGatewayRoute(input *DeleteLocalGatewayRouteInput) (*DeleteLocalGatewayRouteOutput, error) { + req, out := c.DeleteLocalGatewayRouteRequest(input) + return out, req.Send() +} + +// DeleteLocalGatewayRouteWithContext is the same as DeleteLocalGatewayRoute with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLocalGatewayRoute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DeleteLocalGatewayRouteWithContext(ctx aws.Context, input *DeleteLocalGatewayRouteInput, opts ...request.Option) (*DeleteLocalGatewayRouteOutput, error) { + req, out := c.DeleteLocalGatewayRouteRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteLocalGatewayRouteTableVpcAssociation = "DeleteLocalGatewayRouteTableVpcAssociation" + +// DeleteLocalGatewayRouteTableVpcAssociationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteLocalGatewayRouteTableVpcAssociation operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteLocalGatewayRouteTableVpcAssociation for more information on using the DeleteLocalGatewayRouteTableVpcAssociation +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteLocalGatewayRouteTableVpcAssociationRequest method. +// req, resp := client.DeleteLocalGatewayRouteTableVpcAssociationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteLocalGatewayRouteTableVpcAssociation +func (c *EC2) DeleteLocalGatewayRouteTableVpcAssociationRequest(input *DeleteLocalGatewayRouteTableVpcAssociationInput) (req *request.Request, output *DeleteLocalGatewayRouteTableVpcAssociationOutput) { + op := &request.Operation{ + Name: opDeleteLocalGatewayRouteTableVpcAssociation, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteLocalGatewayRouteTableVpcAssociationInput{} + } + + output = &DeleteLocalGatewayRouteTableVpcAssociationOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteLocalGatewayRouteTableVpcAssociation API operation for Amazon Elastic Compute Cloud. +// +// Deletes the specified association between a VPC and local gateway 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 DeleteLocalGatewayRouteTableVpcAssociation for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteLocalGatewayRouteTableVpcAssociation +func (c *EC2) DeleteLocalGatewayRouteTableVpcAssociation(input *DeleteLocalGatewayRouteTableVpcAssociationInput) (*DeleteLocalGatewayRouteTableVpcAssociationOutput, error) { + req, out := c.DeleteLocalGatewayRouteTableVpcAssociationRequest(input) + return out, req.Send() +} + +// DeleteLocalGatewayRouteTableVpcAssociationWithContext is the same as DeleteLocalGatewayRouteTableVpcAssociation with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLocalGatewayRouteTableVpcAssociation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DeleteLocalGatewayRouteTableVpcAssociationWithContext(ctx aws.Context, input *DeleteLocalGatewayRouteTableVpcAssociationInput, opts ...request.Option) (*DeleteLocalGatewayRouteTableVpcAssociationOutput, error) { + req, out := c.DeleteLocalGatewayRouteTableVpcAssociationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteNatGateway = "DeleteNatGateway" // DeleteNatGatewayRequest generates a "aws/request.Request" representing the @@ -8706,6 +9338,80 @@ func (c *EC2) DeletePlacementGroupWithContext(ctx aws.Context, input *DeletePlac return out, req.Send() } +const opDeleteQueuedReservedInstances = "DeleteQueuedReservedInstances" + +// DeleteQueuedReservedInstancesRequest generates a "aws/request.Request" representing the +// client's request for the DeleteQueuedReservedInstances operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteQueuedReservedInstances for more information on using the DeleteQueuedReservedInstances +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteQueuedReservedInstancesRequest method. +// req, resp := client.DeleteQueuedReservedInstancesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteQueuedReservedInstances +func (c *EC2) DeleteQueuedReservedInstancesRequest(input *DeleteQueuedReservedInstancesInput) (req *request.Request, output *DeleteQueuedReservedInstancesOutput) { + op := &request.Operation{ + Name: opDeleteQueuedReservedInstances, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteQueuedReservedInstancesInput{} + } + + output = &DeleteQueuedReservedInstancesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteQueuedReservedInstances API operation for Amazon Elastic Compute Cloud. +// +// Deletes the queued purchases for the specified Reserved 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 DeleteQueuedReservedInstances for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteQueuedReservedInstances +func (c *EC2) DeleteQueuedReservedInstances(input *DeleteQueuedReservedInstancesInput) (*DeleteQueuedReservedInstancesOutput, error) { + req, out := c.DeleteQueuedReservedInstancesRequest(input) + return out, req.Send() +} + +// DeleteQueuedReservedInstancesWithContext is the same as DeleteQueuedReservedInstances with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteQueuedReservedInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DeleteQueuedReservedInstancesWithContext(ctx aws.Context, input *DeleteQueuedReservedInstancesInput, opts ...request.Option) (*DeleteQueuedReservedInstancesOutput, error) { + req, out := c.DeleteQueuedReservedInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteRoute = "DeleteRoute" // DeleteRouteRequest generates a "aws/request.Request" representing the @@ -9632,6 +10338,154 @@ func (c *EC2) DeleteTransitGatewayWithContext(ctx aws.Context, input *DeleteTran return out, req.Send() } +const opDeleteTransitGatewayMulticastDomain = "DeleteTransitGatewayMulticastDomain" + +// DeleteTransitGatewayMulticastDomainRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTransitGatewayMulticastDomain operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteTransitGatewayMulticastDomain for more information on using the DeleteTransitGatewayMulticastDomain +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteTransitGatewayMulticastDomainRequest method. +// req, resp := client.DeleteTransitGatewayMulticastDomainRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayMulticastDomain +func (c *EC2) DeleteTransitGatewayMulticastDomainRequest(input *DeleteTransitGatewayMulticastDomainInput) (req *request.Request, output *DeleteTransitGatewayMulticastDomainOutput) { + op := &request.Operation{ + Name: opDeleteTransitGatewayMulticastDomain, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteTransitGatewayMulticastDomainInput{} + } + + output = &DeleteTransitGatewayMulticastDomainOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteTransitGatewayMulticastDomain API operation for Amazon Elastic Compute Cloud. +// +// Deletes the specified transit gateway multicast 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 Elastic Compute Cloud's +// API operation DeleteTransitGatewayMulticastDomain for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayMulticastDomain +func (c *EC2) DeleteTransitGatewayMulticastDomain(input *DeleteTransitGatewayMulticastDomainInput) (*DeleteTransitGatewayMulticastDomainOutput, error) { + req, out := c.DeleteTransitGatewayMulticastDomainRequest(input) + return out, req.Send() +} + +// DeleteTransitGatewayMulticastDomainWithContext is the same as DeleteTransitGatewayMulticastDomain with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTransitGatewayMulticastDomain for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DeleteTransitGatewayMulticastDomainWithContext(ctx aws.Context, input *DeleteTransitGatewayMulticastDomainInput, opts ...request.Option) (*DeleteTransitGatewayMulticastDomainOutput, error) { + req, out := c.DeleteTransitGatewayMulticastDomainRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteTransitGatewayPeeringAttachment = "DeleteTransitGatewayPeeringAttachment" + +// DeleteTransitGatewayPeeringAttachmentRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTransitGatewayPeeringAttachment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteTransitGatewayPeeringAttachment for more information on using the DeleteTransitGatewayPeeringAttachment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteTransitGatewayPeeringAttachmentRequest method. +// req, resp := client.DeleteTransitGatewayPeeringAttachmentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayPeeringAttachment +func (c *EC2) DeleteTransitGatewayPeeringAttachmentRequest(input *DeleteTransitGatewayPeeringAttachmentInput) (req *request.Request, output *DeleteTransitGatewayPeeringAttachmentOutput) { + op := &request.Operation{ + Name: opDeleteTransitGatewayPeeringAttachment, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteTransitGatewayPeeringAttachmentInput{} + } + + output = &DeleteTransitGatewayPeeringAttachmentOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteTransitGatewayPeeringAttachment API operation for Amazon Elastic Compute Cloud. +// +// Deletes a transit gateway peering attachment. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DeleteTransitGatewayPeeringAttachment for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeleteTransitGatewayPeeringAttachment +func (c *EC2) DeleteTransitGatewayPeeringAttachment(input *DeleteTransitGatewayPeeringAttachmentInput) (*DeleteTransitGatewayPeeringAttachmentOutput, error) { + req, out := c.DeleteTransitGatewayPeeringAttachmentRequest(input) + return out, req.Send() +} + +// DeleteTransitGatewayPeeringAttachmentWithContext is the same as DeleteTransitGatewayPeeringAttachment with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTransitGatewayPeeringAttachment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DeleteTransitGatewayPeeringAttachmentWithContext(ctx aws.Context, input *DeleteTransitGatewayPeeringAttachmentInput, opts ...request.Option) (*DeleteTransitGatewayPeeringAttachmentOutput, error) { + req, out := c.DeleteTransitGatewayPeeringAttachmentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteTransitGatewayRoute = "DeleteTransitGatewayRoute" // DeleteTransitGatewayRouteRequest generates a "aws/request.Request" representing the @@ -10726,6 +11580,156 @@ func (c *EC2) DeregisterImageWithContext(ctx aws.Context, input *DeregisterImage return out, req.Send() } +const opDeregisterTransitGatewayMulticastGroupMembers = "DeregisterTransitGatewayMulticastGroupMembers" + +// DeregisterTransitGatewayMulticastGroupMembersRequest generates a "aws/request.Request" representing the +// client's request for the DeregisterTransitGatewayMulticastGroupMembers operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeregisterTransitGatewayMulticastGroupMembers for more information on using the DeregisterTransitGatewayMulticastGroupMembers +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeregisterTransitGatewayMulticastGroupMembersRequest method. +// req, resp := client.DeregisterTransitGatewayMulticastGroupMembersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeregisterTransitGatewayMulticastGroupMembers +func (c *EC2) DeregisterTransitGatewayMulticastGroupMembersRequest(input *DeregisterTransitGatewayMulticastGroupMembersInput) (req *request.Request, output *DeregisterTransitGatewayMulticastGroupMembersOutput) { + op := &request.Operation{ + Name: opDeregisterTransitGatewayMulticastGroupMembers, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeregisterTransitGatewayMulticastGroupMembersInput{} + } + + output = &DeregisterTransitGatewayMulticastGroupMembersOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeregisterTransitGatewayMulticastGroupMembers API operation for Amazon Elastic Compute Cloud. +// +// Deregisters the specified members (network interfaces) from the transit gateway +// multicast 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 Elastic Compute Cloud's +// API operation DeregisterTransitGatewayMulticastGroupMembers for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeregisterTransitGatewayMulticastGroupMembers +func (c *EC2) DeregisterTransitGatewayMulticastGroupMembers(input *DeregisterTransitGatewayMulticastGroupMembersInput) (*DeregisterTransitGatewayMulticastGroupMembersOutput, error) { + req, out := c.DeregisterTransitGatewayMulticastGroupMembersRequest(input) + return out, req.Send() +} + +// DeregisterTransitGatewayMulticastGroupMembersWithContext is the same as DeregisterTransitGatewayMulticastGroupMembers with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterTransitGatewayMulticastGroupMembers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DeregisterTransitGatewayMulticastGroupMembersWithContext(ctx aws.Context, input *DeregisterTransitGatewayMulticastGroupMembersInput, opts ...request.Option) (*DeregisterTransitGatewayMulticastGroupMembersOutput, error) { + req, out := c.DeregisterTransitGatewayMulticastGroupMembersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeregisterTransitGatewayMulticastGroupSources = "DeregisterTransitGatewayMulticastGroupSources" + +// DeregisterTransitGatewayMulticastGroupSourcesRequest generates a "aws/request.Request" representing the +// client's request for the DeregisterTransitGatewayMulticastGroupSources operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeregisterTransitGatewayMulticastGroupSources for more information on using the DeregisterTransitGatewayMulticastGroupSources +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeregisterTransitGatewayMulticastGroupSourcesRequest method. +// req, resp := client.DeregisterTransitGatewayMulticastGroupSourcesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeregisterTransitGatewayMulticastGroupSources +func (c *EC2) DeregisterTransitGatewayMulticastGroupSourcesRequest(input *DeregisterTransitGatewayMulticastGroupSourcesInput) (req *request.Request, output *DeregisterTransitGatewayMulticastGroupSourcesOutput) { + op := &request.Operation{ + Name: opDeregisterTransitGatewayMulticastGroupSources, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeregisterTransitGatewayMulticastGroupSourcesInput{} + } + + output = &DeregisterTransitGatewayMulticastGroupSourcesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeregisterTransitGatewayMulticastGroupSources API operation for Amazon Elastic Compute Cloud. +// +// Deregisters the specified sources (network interfaces) from the transit gateway +// multicast 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 Elastic Compute Cloud's +// API operation DeregisterTransitGatewayMulticastGroupSources for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DeregisterTransitGatewayMulticastGroupSources +func (c *EC2) DeregisterTransitGatewayMulticastGroupSources(input *DeregisterTransitGatewayMulticastGroupSourcesInput) (*DeregisterTransitGatewayMulticastGroupSourcesOutput, error) { + req, out := c.DeregisterTransitGatewayMulticastGroupSourcesRequest(input) + return out, req.Send() +} + +// DeregisterTransitGatewayMulticastGroupSourcesWithContext is the same as DeregisterTransitGatewayMulticastGroupSources with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterTransitGatewayMulticastGroupSources for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DeregisterTransitGatewayMulticastGroupSourcesWithContext(ctx aws.Context, input *DeregisterTransitGatewayMulticastGroupSourcesInput, opts ...request.Option) (*DeregisterTransitGatewayMulticastGroupSourcesOutput, error) { + req, out := c.DeregisterTransitGatewayMulticastGroupSourcesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeAccountAttributes = "DescribeAccountAttributes" // DescribeAccountAttributesRequest generates a "aws/request.Request" representing the @@ -10778,8 +11782,10 @@ func (c *EC2) DescribeAccountAttributesRequest(input *DescribeAccountAttributesI // // * 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. +// * max-instances: This attribute is no longer supported. The returned value +// does not reflect your actual vCPU limit for running On-Demand Instances. +// For more information, see On-Demand Instance Limits (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-on-demand-instances.html#ec2-on-demand-instances-limits) +// in the Amazon Elastic Compute Cloud User Guide. // // * vpc-max-security-groups-per-interface: The maximum number of security // groups that you can assign to a network interface. @@ -11028,12 +12034,13 @@ func (c *EC2) DescribeAvailabilityZonesRequest(input *DescribeAvailabilityZonesI // DescribeAvailabilityZones API operation for Amazon Elastic Compute Cloud. // -// Describes 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. +// Describes the Availability Zones and Local Zones that are available to you. +// If there is an event impacting an Availability Zone or Local Zone, you can +// use this request to view the state and any provided messages for that Availability +// Zone or Local Zone. // -// For more information, see Regions and Availability Zones (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html) +// For more information about Availability Zones and Local Zones, see Regions +// and Availability Zones (https://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 @@ -11196,7 +12203,7 @@ func (c *EC2) DescribeByoipCidrsRequest(input *DescribeByoipCidrsInput) (req *re // Describes the IP address ranges that were specified in calls to ProvisionByoipCidr. // // To describe the address pools that were created when you provisioned the -// address ranges, use DescribePublicIpv4Pools. +// address ranges, use DescribePublicIpv4Pools or DescribeIpv6Pools. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -11269,10 +12276,12 @@ func (c *EC2) DescribeByoipCidrsPagesWithContext(ctx aws.Context, input *Describ }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeByoipCidrsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeByoipCidrsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -11400,10 +12409,12 @@ func (c *EC2) DescribeCapacityReservationsPagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCapacityReservationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeCapacityReservationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -11533,10 +12544,12 @@ func (c *EC2) DescribeClassicLinkInstancesPagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClassicLinkInstancesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeClassicLinkInstancesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -11663,10 +12676,12 @@ func (c *EC2) DescribeClientVpnAuthorizationRulesPagesWithContext(ctx aws.Contex }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClientVpnAuthorizationRulesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeClientVpnAuthorizationRulesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -11794,10 +12809,12 @@ func (c *EC2) DescribeClientVpnConnectionsPagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClientVpnConnectionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeClientVpnConnectionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -11924,10 +12941,12 @@ func (c *EC2) DescribeClientVpnEndpointsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClientVpnEndpointsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeClientVpnEndpointsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -12054,10 +13073,12 @@ func (c *EC2) DescribeClientVpnRoutesPagesWithContext(ctx aws.Context, input *De }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClientVpnRoutesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeClientVpnRoutesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -12184,10 +13205,145 @@ func (c *EC2) DescribeClientVpnTargetNetworksPagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClientVpnTargetNetworksOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeClientVpnTargetNetworksOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeCoipPools = "DescribeCoipPools" + +// DescribeCoipPoolsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeCoipPools operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeCoipPools for more information on using the DescribeCoipPools +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeCoipPoolsRequest method. +// req, resp := client.DescribeCoipPoolsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeCoipPools +func (c *EC2) DescribeCoipPoolsRequest(input *DescribeCoipPoolsInput) (req *request.Request, output *DescribeCoipPoolsOutput) { + op := &request.Operation{ + Name: opDescribeCoipPools, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeCoipPoolsInput{} + } + + output = &DescribeCoipPoolsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeCoipPools API operation for Amazon Elastic Compute Cloud. +// +// Describes the specified customer-owned address pools or all of your customer-owned +// address pools. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DescribeCoipPools for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeCoipPools +func (c *EC2) DescribeCoipPools(input *DescribeCoipPoolsInput) (*DescribeCoipPoolsOutput, error) { + req, out := c.DescribeCoipPoolsRequest(input) + return out, req.Send() +} + +// DescribeCoipPoolsWithContext is the same as DescribeCoipPools with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCoipPools for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeCoipPoolsWithContext(ctx aws.Context, input *DescribeCoipPoolsInput, opts ...request.Option) (*DescribeCoipPoolsOutput, error) { + req, out := c.DescribeCoipPoolsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeCoipPoolsPages iterates over the pages of a DescribeCoipPools operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeCoipPools 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 DescribeCoipPools operation. +// pageNum := 0 +// err := client.DescribeCoipPoolsPages(params, +// func(page *ec2.DescribeCoipPoolsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeCoipPoolsPages(input *DescribeCoipPoolsInput, fn func(*DescribeCoipPoolsOutput, bool) bool) error { + return c.DescribeCoipPoolsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeCoipPoolsPagesWithContext same as DescribeCoipPoolsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeCoipPoolsPagesWithContext(ctx aws.Context, input *DescribeCoipPoolsInput, fn func(*DescribeCoipPoolsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeCoipPoolsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeCoipPoolsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeCoipPoolsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -12472,10 +13628,12 @@ func (c *EC2) DescribeDhcpOptionsPagesWithContext(ctx aws.Context, input *Descri }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDhcpOptionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDhcpOptionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -12602,10 +13760,12 @@ func (c *EC2) DescribeEgressOnlyInternetGatewaysPagesWithContext(ctx aws.Context }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEgressOnlyInternetGatewaysOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEgressOnlyInternetGatewaysOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -12716,6 +13876,12 @@ func (c *EC2) DescribeExportImageTasksRequest(input *DescribeExportImageTasksInp Name: opDescribeExportImageTasks, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -12759,6 +13925,58 @@ func (c *EC2) DescribeExportImageTasksWithContext(ctx aws.Context, input *Descri return out, req.Send() } +// DescribeExportImageTasksPages iterates over the pages of a DescribeExportImageTasks operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeExportImageTasks 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 DescribeExportImageTasks operation. +// pageNum := 0 +// err := client.DescribeExportImageTasksPages(params, +// func(page *ec2.DescribeExportImageTasksOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeExportImageTasksPages(input *DescribeExportImageTasksInput, fn func(*DescribeExportImageTasksOutput, bool) bool) error { + return c.DescribeExportImageTasksPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeExportImageTasksPagesWithContext same as DescribeExportImageTasksPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeExportImageTasksPagesWithContext(ctx aws.Context, input *DescribeExportImageTasksInput, fn func(*DescribeExportImageTasksOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeExportImageTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeExportImageTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeExportImageTasksOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opDescribeExportTasks = "DescribeExportTasks" // DescribeExportTasksRequest generates a "aws/request.Request" representing the @@ -12834,6 +14052,138 @@ func (c *EC2) DescribeExportTasksWithContext(ctx aws.Context, input *DescribeExp return out, req.Send() } +const opDescribeFastSnapshotRestores = "DescribeFastSnapshotRestores" + +// DescribeFastSnapshotRestoresRequest generates a "aws/request.Request" representing the +// client's request for the DescribeFastSnapshotRestores operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeFastSnapshotRestores for more information on using the DescribeFastSnapshotRestores +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeFastSnapshotRestoresRequest method. +// req, resp := client.DescribeFastSnapshotRestoresRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFastSnapshotRestores +func (c *EC2) DescribeFastSnapshotRestoresRequest(input *DescribeFastSnapshotRestoresInput) (req *request.Request, output *DescribeFastSnapshotRestoresOutput) { + op := &request.Operation{ + Name: opDescribeFastSnapshotRestores, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeFastSnapshotRestoresInput{} + } + + output = &DescribeFastSnapshotRestoresOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeFastSnapshotRestores API operation for Amazon Elastic Compute Cloud. +// +// Describes the state of fast snapshot restores for your snapshots. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DescribeFastSnapshotRestores for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeFastSnapshotRestores +func (c *EC2) DescribeFastSnapshotRestores(input *DescribeFastSnapshotRestoresInput) (*DescribeFastSnapshotRestoresOutput, error) { + req, out := c.DescribeFastSnapshotRestoresRequest(input) + return out, req.Send() +} + +// DescribeFastSnapshotRestoresWithContext is the same as DescribeFastSnapshotRestores with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeFastSnapshotRestores for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeFastSnapshotRestoresWithContext(ctx aws.Context, input *DescribeFastSnapshotRestoresInput, opts ...request.Option) (*DescribeFastSnapshotRestoresOutput, error) { + req, out := c.DescribeFastSnapshotRestoresRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeFastSnapshotRestoresPages iterates over the pages of a DescribeFastSnapshotRestores operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeFastSnapshotRestores 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 DescribeFastSnapshotRestores operation. +// pageNum := 0 +// err := client.DescribeFastSnapshotRestoresPages(params, +// func(page *ec2.DescribeFastSnapshotRestoresOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeFastSnapshotRestoresPages(input *DescribeFastSnapshotRestoresInput, fn func(*DescribeFastSnapshotRestoresOutput, bool) bool) error { + return c.DescribeFastSnapshotRestoresPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeFastSnapshotRestoresPagesWithContext same as DescribeFastSnapshotRestoresPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeFastSnapshotRestoresPagesWithContext(ctx aws.Context, input *DescribeFastSnapshotRestoresInput, fn func(*DescribeFastSnapshotRestoresOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeFastSnapshotRestoresInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeFastSnapshotRestoresRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeFastSnapshotRestoresOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opDescribeFleetHistory = "DescribeFleetHistory" // DescribeFleetHistoryRequest generates a "aws/request.Request" representing the @@ -12880,6 +14230,10 @@ func (c *EC2) DescribeFleetHistoryRequest(input *DescribeFleetHistoryInput) (req // // Describes the events for the specified EC2 Fleet during the specified time. // +// EC2 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. EC2 Fleet events are available for 48 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. @@ -13032,7 +14386,7 @@ func (c *EC2) DescribeFleetsRequest(input *DescribeFleetsInput) (req *request.Re // DescribeFleets API operation for Amazon Elastic Compute Cloud. // -// Describes the specified EC2 Fleets or all your EC2 Fleets. +// Describes the specified EC2 Fleets or all of your EC2 Fleets. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -13105,10 +14459,12 @@ func (c *EC2) DescribeFleetsPagesWithContext(ctx aws.Context, input *DescribeFle }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeFleetsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeFleetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -13237,10 +14593,12 @@ func (c *EC2) DescribeFlowLogsPagesWithContext(ctx aws.Context, input *DescribeF }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeFlowLogsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeFlowLogsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -13443,10 +14801,12 @@ func (c *EC2) DescribeFpgaImagesPagesWithContext(ctx aws.Context, input *Describ }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeFpgaImagesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeFpgaImagesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -13502,8 +14862,8 @@ func (c *EC2) DescribeHostReservationOfferingsRequest(input *DescribeHostReserva // // 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 +// The results describe all of the Dedicated Host reservation offerings, including +// offerings that might not match the instance family and Region of your Dedicated // Hosts. When purchasing an offering, ensure that the instance family and Region // of the offering matches that of the Dedicated Hosts with which it is to be // associated. For more information about supported instance types, see Dedicated @@ -13581,10 +14941,12 @@ func (c *EC2) DescribeHostReservationOfferingsPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeHostReservationOfferingsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeHostReservationOfferingsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -13711,10 +15073,12 @@ func (c *EC2) DescribeHostReservationsPagesWithContext(ctx aws.Context, input *D }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeHostReservationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeHostReservationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -13845,10 +15209,12 @@ func (c *EC2) DescribeHostsPagesWithContext(ctx aws.Context, input *DescribeHost }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeHostsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeHostsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -13975,10 +15341,12 @@ func (c *EC2) DescribeIamInstanceProfileAssociationsPagesWithContext(ctx aws.Con }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeIamInstanceProfileAssociationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeIamInstanceProfileAssociationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -14447,10 +15815,12 @@ func (c *EC2) DescribeImportImageTasksPagesWithContext(ctx aws.Context, input *D }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeImportImageTasksOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeImportImageTasksOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -14577,10 +15947,12 @@ func (c *EC2) DescribeImportSnapshotTasksPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeImportSnapshotTasksOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeImportSnapshotTasksOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -14712,19 +16084,19 @@ func (c *EC2) DescribeInstanceCreditSpecificationsRequest(input *DescribeInstanc // DescribeInstanceCreditSpecifications API operation for Amazon Elastic Compute Cloud. // -// Describes the credit option for CPU usage of the specified T2 or T3 instances. -// The credit options are standard and unlimited. +// Describes the credit option for CPU usage of the specified burstable performance +// instances. The credit options are standard and unlimited. // -// If you do not specify an instance ID, Amazon EC2 returns T2 and T3 instances -// with the unlimited credit option, as well as instances that were previously -// configured as T2 or T3 with the unlimited credit option. For example, if -// you resize a T2 instance, while it is configured as unlimited, to an M4 instance, -// Amazon EC2 returns the M4 instance. +// If you do not specify an instance ID, Amazon EC2 returns burstable performance +// instances with the unlimited credit option, as well as instances that were +// previously configured as T2, T3, and T3a with the unlimited credit option. +// For example, if you resize a T2 instance, while it is configured as unlimited, +// to an M4 instance, Amazon EC2 returns the M4 instance. // // If you specify one or more instance IDs, Amazon EC2 returns the credit option // (standard or unlimited) of those instances. If you specify an instance ID -// that is not valid, such as an instance that is not a T2 or T3 instance, an -// error is returned. +// that is not valid, such as an instance that is not a burstable performance +// instance, an error is returned. // // Recently terminated instances might appear in the returned results. This // interval is usually less than one hour. @@ -14808,10 +16180,12 @@ func (c *EC2) DescribeInstanceCreditSpecificationsPagesWithContext(ctx aws.Conte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeInstanceCreditSpecificationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeInstanceCreditSpecificationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -14959,10 +16333,279 @@ func (c *EC2) DescribeInstanceStatusPagesWithContext(ctx aws.Context, input *Des }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeInstanceStatusOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeInstanceStatusOutput), !p.HasNextPage()) { + break + } } + + return p.Err() +} + +const opDescribeInstanceTypeOfferings = "DescribeInstanceTypeOfferings" + +// DescribeInstanceTypeOfferingsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeInstanceTypeOfferings operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeInstanceTypeOfferings for more information on using the DescribeInstanceTypeOfferings +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeInstanceTypeOfferingsRequest method. +// req, resp := client.DescribeInstanceTypeOfferingsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceTypeOfferings +func (c *EC2) DescribeInstanceTypeOfferingsRequest(input *DescribeInstanceTypeOfferingsInput) (req *request.Request, output *DescribeInstanceTypeOfferingsOutput) { + op := &request.Operation{ + Name: opDescribeInstanceTypeOfferings, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeInstanceTypeOfferingsInput{} + } + + output = &DescribeInstanceTypeOfferingsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeInstanceTypeOfferings API operation for Amazon Elastic Compute Cloud. +// +// Returns a list of all instance types offered. The results can be filtered +// by location (Region or Availability Zone). If no location is specified, the +// instance types offered in the current Region 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 Elastic Compute Cloud's +// API operation DescribeInstanceTypeOfferings for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceTypeOfferings +func (c *EC2) DescribeInstanceTypeOfferings(input *DescribeInstanceTypeOfferingsInput) (*DescribeInstanceTypeOfferingsOutput, error) { + req, out := c.DescribeInstanceTypeOfferingsRequest(input) + return out, req.Send() +} + +// DescribeInstanceTypeOfferingsWithContext is the same as DescribeInstanceTypeOfferings with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInstanceTypeOfferings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeInstanceTypeOfferingsWithContext(ctx aws.Context, input *DescribeInstanceTypeOfferingsInput, opts ...request.Option) (*DescribeInstanceTypeOfferingsOutput, error) { + req, out := c.DescribeInstanceTypeOfferingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeInstanceTypeOfferingsPages iterates over the pages of a DescribeInstanceTypeOfferings operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeInstanceTypeOfferings 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 DescribeInstanceTypeOfferings operation. +// pageNum := 0 +// err := client.DescribeInstanceTypeOfferingsPages(params, +// func(page *ec2.DescribeInstanceTypeOfferingsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeInstanceTypeOfferingsPages(input *DescribeInstanceTypeOfferingsInput, fn func(*DescribeInstanceTypeOfferingsOutput, bool) bool) error { + return c.DescribeInstanceTypeOfferingsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeInstanceTypeOfferingsPagesWithContext same as DescribeInstanceTypeOfferingsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeInstanceTypeOfferingsPagesWithContext(ctx aws.Context, input *DescribeInstanceTypeOfferingsInput, fn func(*DescribeInstanceTypeOfferingsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeInstanceTypeOfferingsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstanceTypeOfferingsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeInstanceTypeOfferingsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeInstanceTypes = "DescribeInstanceTypes" + +// DescribeInstanceTypesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeInstanceTypes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeInstanceTypes for more information on using the DescribeInstanceTypes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeInstanceTypesRequest method. +// req, resp := client.DescribeInstanceTypesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceTypes +func (c *EC2) DescribeInstanceTypesRequest(input *DescribeInstanceTypesInput) (req *request.Request, output *DescribeInstanceTypesOutput) { + op := &request.Operation{ + Name: opDescribeInstanceTypes, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeInstanceTypesInput{} + } + + output = &DescribeInstanceTypesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeInstanceTypes API operation for Amazon Elastic Compute Cloud. +// +// Returns a list of all instance types offered in your current AWS Region. +// The results can be filtered by the attributes of the instance 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 Amazon Elastic Compute Cloud's +// API operation DescribeInstanceTypes for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeInstanceTypes +func (c *EC2) DescribeInstanceTypes(input *DescribeInstanceTypesInput) (*DescribeInstanceTypesOutput, error) { + req, out := c.DescribeInstanceTypesRequest(input) + return out, req.Send() +} + +// DescribeInstanceTypesWithContext is the same as DescribeInstanceTypes with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInstanceTypes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeInstanceTypesWithContext(ctx aws.Context, input *DescribeInstanceTypesInput, opts ...request.Option) (*DescribeInstanceTypesOutput, error) { + req, out := c.DescribeInstanceTypesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeInstanceTypesPages iterates over the pages of a DescribeInstanceTypes operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeInstanceTypes 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 DescribeInstanceTypes operation. +// pageNum := 0 +// err := client.DescribeInstanceTypesPages(params, +// func(page *ec2.DescribeInstanceTypesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeInstanceTypesPages(input *DescribeInstanceTypesInput, fn func(*DescribeInstanceTypesOutput, bool) bool) error { + return c.DescribeInstanceTypesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeInstanceTypesPagesWithContext same as DescribeInstanceTypesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeInstanceTypesPagesWithContext(ctx aws.Context, input *DescribeInstanceTypesInput, fn func(*DescribeInstanceTypesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeInstanceTypesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstanceTypesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeInstanceTypesOutput), !p.HasNextPage()) { + break + } + } + return p.Err() } @@ -15104,10 +16747,12 @@ func (c *EC2) DescribeInstancesPagesWithContext(ctx aws.Context, input *Describe }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeInstancesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeInstancesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -15234,10 +16879,144 @@ func (c *EC2) DescribeInternetGatewaysPagesWithContext(ctx aws.Context, input *D }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeInternetGatewaysOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeInternetGatewaysOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeIpv6Pools = "DescribeIpv6Pools" + +// DescribeIpv6PoolsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeIpv6Pools operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeIpv6Pools for more information on using the DescribeIpv6Pools +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeIpv6PoolsRequest method. +// req, resp := client.DescribeIpv6PoolsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIpv6Pools +func (c *EC2) DescribeIpv6PoolsRequest(input *DescribeIpv6PoolsInput) (req *request.Request, output *DescribeIpv6PoolsOutput) { + op := &request.Operation{ + Name: opDescribeIpv6Pools, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeIpv6PoolsInput{} + } + + output = &DescribeIpv6PoolsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeIpv6Pools API operation for Amazon Elastic Compute Cloud. +// +// Describes your IPv6 address pools. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation DescribeIpv6Pools for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeIpv6Pools +func (c *EC2) DescribeIpv6Pools(input *DescribeIpv6PoolsInput) (*DescribeIpv6PoolsOutput, error) { + req, out := c.DescribeIpv6PoolsRequest(input) + return out, req.Send() +} + +// DescribeIpv6PoolsWithContext is the same as DescribeIpv6Pools with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeIpv6Pools for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeIpv6PoolsWithContext(ctx aws.Context, input *DescribeIpv6PoolsInput, opts ...request.Option) (*DescribeIpv6PoolsOutput, error) { + req, out := c.DescribeIpv6PoolsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeIpv6PoolsPages iterates over the pages of a DescribeIpv6Pools operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeIpv6Pools 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 DescribeIpv6Pools operation. +// pageNum := 0 +// err := client.DescribeIpv6PoolsPages(params, +// func(page *ec2.DescribeIpv6PoolsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeIpv6PoolsPages(input *DescribeIpv6PoolsInput, fn func(*DescribeIpv6PoolsOutput, bool) bool) error { + return c.DescribeIpv6PoolsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeIpv6PoolsPagesWithContext same as DescribeIpv6PoolsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeIpv6PoolsPagesWithContext(ctx aws.Context, input *DescribeIpv6PoolsInput, fn func(*DescribeIpv6PoolsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeIpv6PoolsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeIpv6PoolsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeIpv6PoolsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -15442,10 +17221,12 @@ func (c *EC2) DescribeLaunchTemplateVersionsPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeLaunchTemplateVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeLaunchTemplateVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -15572,42 +17353,44 @@ func (c *EC2) DescribeLaunchTemplatesPagesWithContext(ctx aws.Context, input *De }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeLaunchTemplatesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeLaunchTemplatesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeMovingAddresses = "DescribeMovingAddresses" +const opDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations = "DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations" -// DescribeMovingAddressesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeMovingAddresses operation. The "output" return +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeMovingAddresses for more information on using the DescribeMovingAddresses +// See DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations for more information on using the DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeMovingAddressesRequest method. -// req, resp := client.DescribeMovingAddressesRequest(params) +// // Example sending a request using the DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsRequest method. +// req, resp := client.DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeMovingAddresses -func (c *EC2) DescribeMovingAddressesRequest(input *DescribeMovingAddressesInput) (req *request.Request, output *DescribeMovingAddressesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations +func (c *EC2) DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsRequest(input *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput) (req *request.Request, output *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput) { op := &request.Operation{ - Name: opDescribeMovingAddresses, + Name: opDescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -15619,127 +17402,128 @@ func (c *EC2) DescribeMovingAddressesRequest(input *DescribeMovingAddressesInput } if input == nil { - input = &DescribeMovingAddressesInput{} + input = &DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput{} } - output = &DescribeMovingAddressesOutput{} + output = &DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput{} req = c.newRequest(op, input, output) return } -// DescribeMovingAddresses API operation for Amazon Elastic Compute Cloud. +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations 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. +// Describes the associations between virtual interface groups and local gateway +// 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 DescribeMovingAddresses for usage and error information. -// See also, 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) +// API operation DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations +func (c *EC2) DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations(input *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput) (*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput, error) { + req, out := c.DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsRequest(input) return out, req.Send() } -// DescribeMovingAddressesWithContext is the same as DescribeMovingAddresses with the addition of +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsWithContext is the same as DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations with the addition of // the ability to pass a context and additional request options. // -// See DescribeMovingAddresses for details on how to use this API operation. +// See DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeMovingAddressesWithContext(ctx aws.Context, input *DescribeMovingAddressesInput, opts ...request.Option) (*DescribeMovingAddressesOutput, error) { - req, out := c.DescribeMovingAddressesRequest(input) +func (c *EC2) DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsWithContext(ctx aws.Context, input *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput, opts ...request.Option) (*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput, error) { + req, out := c.DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeMovingAddressesPages iterates over the pages of a DescribeMovingAddresses operation, +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPages iterates over the pages of a DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribeMovingAddresses method for more information on how to use this operation. +// See DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations 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 DescribeMovingAddresses operation. +// // Example iterating over at most 3 pages of a DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociations operation. // pageNum := 0 -// err := client.DescribeMovingAddressesPages(params, -// func(page *ec2.DescribeMovingAddressesOutput, lastPage bool) bool { +// err := client.DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPages(params, +// func(page *ec2.DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeMovingAddressesPages(input *DescribeMovingAddressesInput, fn func(*DescribeMovingAddressesOutput, bool) bool) error { - return c.DescribeMovingAddressesPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPages(input *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput, fn func(*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput, bool) bool) error { + return c.DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeMovingAddressesPagesWithContext same as DescribeMovingAddressesPages except +// DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPagesWithContext same as DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeMovingAddressesPagesWithContext(ctx aws.Context, input *DescribeMovingAddressesInput, fn func(*DescribeMovingAddressesOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsPagesWithContext(ctx aws.Context, input *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput, fn func(*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeMovingAddressesInput + var inCpy *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeMovingAddressesRequest(inCpy) + req, _ := c.DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeMovingAddressesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeNatGateways = "DescribeNatGateways" +const opDescribeLocalGatewayRouteTableVpcAssociations = "DescribeLocalGatewayRouteTableVpcAssociations" -// DescribeNatGatewaysRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNatGateways operation. The "output" return +// DescribeLocalGatewayRouteTableVpcAssociationsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLocalGatewayRouteTableVpcAssociations operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeNatGateways for more information on using the DescribeNatGateways +// See DescribeLocalGatewayRouteTableVpcAssociations for more information on using the DescribeLocalGatewayRouteTableVpcAssociations // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeNatGatewaysRequest method. -// req, resp := client.DescribeNatGatewaysRequest(params) +// // Example sending a request using the DescribeLocalGatewayRouteTableVpcAssociationsRequest method. +// req, resp := client.DescribeLocalGatewayRouteTableVpcAssociationsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNatGateways -func (c *EC2) DescribeNatGatewaysRequest(input *DescribeNatGatewaysInput) (req *request.Request, output *DescribeNatGatewaysOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLocalGatewayRouteTableVpcAssociations +func (c *EC2) DescribeLocalGatewayRouteTableVpcAssociationsRequest(input *DescribeLocalGatewayRouteTableVpcAssociationsInput) (req *request.Request, output *DescribeLocalGatewayRouteTableVpcAssociationsOutput) { op := &request.Operation{ - Name: opDescribeNatGateways, + Name: opDescribeLocalGatewayRouteTableVpcAssociations, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -15751,125 +17535,128 @@ func (c *EC2) DescribeNatGatewaysRequest(input *DescribeNatGatewaysInput) (req * } if input == nil { - input = &DescribeNatGatewaysInput{} + input = &DescribeLocalGatewayRouteTableVpcAssociationsInput{} } - output = &DescribeNatGatewaysOutput{} + output = &DescribeLocalGatewayRouteTableVpcAssociationsOutput{} req = c.newRequest(op, input, output) return } -// DescribeNatGateways API operation for Amazon Elastic Compute Cloud. +// DescribeLocalGatewayRouteTableVpcAssociations API operation for Amazon Elastic Compute Cloud. // -// Describes one or more of your NAT gateways. +// Describes the specified associations between VPCs and local gateway 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 DescribeNatGateways for usage and error information. -// See also, 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) +// API operation DescribeLocalGatewayRouteTableVpcAssociations for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLocalGatewayRouteTableVpcAssociations +func (c *EC2) DescribeLocalGatewayRouteTableVpcAssociations(input *DescribeLocalGatewayRouteTableVpcAssociationsInput) (*DescribeLocalGatewayRouteTableVpcAssociationsOutput, error) { + req, out := c.DescribeLocalGatewayRouteTableVpcAssociationsRequest(input) return out, req.Send() } -// DescribeNatGatewaysWithContext is the same as DescribeNatGateways with the addition of +// DescribeLocalGatewayRouteTableVpcAssociationsWithContext is the same as DescribeLocalGatewayRouteTableVpcAssociations with the addition of // the ability to pass a context and additional request options. // -// See DescribeNatGateways for details on how to use this API operation. +// See DescribeLocalGatewayRouteTableVpcAssociations for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeNatGatewaysWithContext(ctx aws.Context, input *DescribeNatGatewaysInput, opts ...request.Option) (*DescribeNatGatewaysOutput, error) { - req, out := c.DescribeNatGatewaysRequest(input) +func (c *EC2) DescribeLocalGatewayRouteTableVpcAssociationsWithContext(ctx aws.Context, input *DescribeLocalGatewayRouteTableVpcAssociationsInput, opts ...request.Option) (*DescribeLocalGatewayRouteTableVpcAssociationsOutput, error) { + req, out := c.DescribeLocalGatewayRouteTableVpcAssociationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeNatGatewaysPages iterates over the pages of a DescribeNatGateways operation, +// DescribeLocalGatewayRouteTableVpcAssociationsPages iterates over the pages of a DescribeLocalGatewayRouteTableVpcAssociations 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. +// See DescribeLocalGatewayRouteTableVpcAssociations 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. +// // Example iterating over at most 3 pages of a DescribeLocalGatewayRouteTableVpcAssociations operation. // pageNum := 0 -// err := client.DescribeNatGatewaysPages(params, -// func(page *ec2.DescribeNatGatewaysOutput, lastPage bool) bool { +// err := client.DescribeLocalGatewayRouteTableVpcAssociationsPages(params, +// func(page *ec2.DescribeLocalGatewayRouteTableVpcAssociationsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeNatGatewaysPages(input *DescribeNatGatewaysInput, fn func(*DescribeNatGatewaysOutput, bool) bool) error { - return c.DescribeNatGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeLocalGatewayRouteTableVpcAssociationsPages(input *DescribeLocalGatewayRouteTableVpcAssociationsInput, fn func(*DescribeLocalGatewayRouteTableVpcAssociationsOutput, bool) bool) error { + return c.DescribeLocalGatewayRouteTableVpcAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeNatGatewaysPagesWithContext same as DescribeNatGatewaysPages except +// DescribeLocalGatewayRouteTableVpcAssociationsPagesWithContext same as DescribeLocalGatewayRouteTableVpcAssociationsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeNatGatewaysPagesWithContext(ctx aws.Context, input *DescribeNatGatewaysInput, fn func(*DescribeNatGatewaysOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeLocalGatewayRouteTableVpcAssociationsPagesWithContext(ctx aws.Context, input *DescribeLocalGatewayRouteTableVpcAssociationsInput, fn func(*DescribeLocalGatewayRouteTableVpcAssociationsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeNatGatewaysInput + var inCpy *DescribeLocalGatewayRouteTableVpcAssociationsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeNatGatewaysRequest(inCpy) + req, _ := c.DescribeLocalGatewayRouteTableVpcAssociationsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeNatGatewaysOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeLocalGatewayRouteTableVpcAssociationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeNetworkAcls = "DescribeNetworkAcls" +const opDescribeLocalGatewayRouteTables = "DescribeLocalGatewayRouteTables" -// DescribeNetworkAclsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNetworkAcls operation. The "output" return +// DescribeLocalGatewayRouteTablesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLocalGatewayRouteTables operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeNetworkAcls for more information on using the DescribeNetworkAcls +// See DescribeLocalGatewayRouteTables for more information on using the DescribeLocalGatewayRouteTables // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeNetworkAclsRequest method. -// req, resp := client.DescribeNetworkAclsRequest(params) +// // Example sending a request using the DescribeLocalGatewayRouteTablesRequest method. +// req, resp := client.DescribeLocalGatewayRouteTablesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkAcls -func (c *EC2) DescribeNetworkAclsRequest(input *DescribeNetworkAclsInput) (req *request.Request, output *DescribeNetworkAclsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLocalGatewayRouteTables +func (c *EC2) DescribeLocalGatewayRouteTablesRequest(input *DescribeLocalGatewayRouteTablesInput) (req *request.Request, output *DescribeLocalGatewayRouteTablesOutput) { op := &request.Operation{ - Name: opDescribeNetworkAcls, + Name: opDescribeLocalGatewayRouteTables, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -15881,203 +17668,260 @@ func (c *EC2) DescribeNetworkAclsRequest(input *DescribeNetworkAclsInput) (req * } if input == nil { - input = &DescribeNetworkAclsInput{} + input = &DescribeLocalGatewayRouteTablesInput{} } - output = &DescribeNetworkAclsOutput{} + output = &DescribeLocalGatewayRouteTablesOutput{} req = c.newRequest(op, input, output) return } -// DescribeNetworkAcls API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your network ACLs. +// DescribeLocalGatewayRouteTables API operation for Amazon Elastic Compute Cloud. // -// For more information, see Network ACLs (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ACLs.html) -// in the Amazon Virtual Private Cloud User Guide. +// Describes one or more local gateway route tables. By default, all local gateway +// route tables are described. Alternatively, you can 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 Elastic Compute Cloud's -// API operation DescribeNetworkAcls for usage and error information. -// See also, 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) +// API operation DescribeLocalGatewayRouteTables for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLocalGatewayRouteTables +func (c *EC2) DescribeLocalGatewayRouteTables(input *DescribeLocalGatewayRouteTablesInput) (*DescribeLocalGatewayRouteTablesOutput, error) { + req, out := c.DescribeLocalGatewayRouteTablesRequest(input) return out, req.Send() } -// DescribeNetworkAclsWithContext is the same as DescribeNetworkAcls with the addition of +// DescribeLocalGatewayRouteTablesWithContext is the same as DescribeLocalGatewayRouteTables with the addition of // the ability to pass a context and additional request options. // -// See DescribeNetworkAcls for details on how to use this API operation. +// See DescribeLocalGatewayRouteTables for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeNetworkAclsWithContext(ctx aws.Context, input *DescribeNetworkAclsInput, opts ...request.Option) (*DescribeNetworkAclsOutput, error) { - req, out := c.DescribeNetworkAclsRequest(input) +func (c *EC2) DescribeLocalGatewayRouteTablesWithContext(ctx aws.Context, input *DescribeLocalGatewayRouteTablesInput, opts ...request.Option) (*DescribeLocalGatewayRouteTablesOutput, error) { + req, out := c.DescribeLocalGatewayRouteTablesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeNetworkAclsPages iterates over the pages of a DescribeNetworkAcls operation, +// DescribeLocalGatewayRouteTablesPages iterates over the pages of a DescribeLocalGatewayRouteTables operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribeNetworkAcls method for more information on how to use this operation. +// See DescribeLocalGatewayRouteTables 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 DescribeNetworkAcls operation. +// // Example iterating over at most 3 pages of a DescribeLocalGatewayRouteTables operation. // pageNum := 0 -// err := client.DescribeNetworkAclsPages(params, -// func(page *ec2.DescribeNetworkAclsOutput, lastPage bool) bool { +// err := client.DescribeLocalGatewayRouteTablesPages(params, +// func(page *ec2.DescribeLocalGatewayRouteTablesOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeNetworkAclsPages(input *DescribeNetworkAclsInput, fn func(*DescribeNetworkAclsOutput, bool) bool) error { - return c.DescribeNetworkAclsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeLocalGatewayRouteTablesPages(input *DescribeLocalGatewayRouteTablesInput, fn func(*DescribeLocalGatewayRouteTablesOutput, bool) bool) error { + return c.DescribeLocalGatewayRouteTablesPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeNetworkAclsPagesWithContext same as DescribeNetworkAclsPages except +// DescribeLocalGatewayRouteTablesPagesWithContext same as DescribeLocalGatewayRouteTablesPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeNetworkAclsPagesWithContext(ctx aws.Context, input *DescribeNetworkAclsInput, fn func(*DescribeNetworkAclsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeLocalGatewayRouteTablesPagesWithContext(ctx aws.Context, input *DescribeLocalGatewayRouteTablesInput, fn func(*DescribeLocalGatewayRouteTablesOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeNetworkAclsInput + var inCpy *DescribeLocalGatewayRouteTablesInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeNetworkAclsRequest(inCpy) + req, _ := c.DescribeLocalGatewayRouteTablesRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeNetworkAclsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeLocalGatewayRouteTablesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeNetworkInterfaceAttribute = "DescribeNetworkInterfaceAttribute" +const opDescribeLocalGatewayVirtualInterfaceGroups = "DescribeLocalGatewayVirtualInterfaceGroups" -// DescribeNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNetworkInterfaceAttribute operation. The "output" return +// DescribeLocalGatewayVirtualInterfaceGroupsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLocalGatewayVirtualInterfaceGroups operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeNetworkInterfaceAttribute for more information on using the DescribeNetworkInterfaceAttribute +// See DescribeLocalGatewayVirtualInterfaceGroups for more information on using the DescribeLocalGatewayVirtualInterfaceGroups // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeNetworkInterfaceAttributeRequest method. -// req, resp := client.DescribeNetworkInterfaceAttributeRequest(params) +// // Example sending a request using the DescribeLocalGatewayVirtualInterfaceGroupsRequest method. +// req, resp := client.DescribeLocalGatewayVirtualInterfaceGroupsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaceAttribute -func (c *EC2) DescribeNetworkInterfaceAttributeRequest(input *DescribeNetworkInterfaceAttributeInput) (req *request.Request, output *DescribeNetworkInterfaceAttributeOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLocalGatewayVirtualInterfaceGroups +func (c *EC2) DescribeLocalGatewayVirtualInterfaceGroupsRequest(input *DescribeLocalGatewayVirtualInterfaceGroupsInput) (req *request.Request, output *DescribeLocalGatewayVirtualInterfaceGroupsOutput) { op := &request.Operation{ - Name: opDescribeNetworkInterfaceAttribute, + Name: opDescribeLocalGatewayVirtualInterfaceGroups, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DescribeNetworkInterfaceAttributeInput{} + input = &DescribeLocalGatewayVirtualInterfaceGroupsInput{} } - output = &DescribeNetworkInterfaceAttributeOutput{} + output = &DescribeLocalGatewayVirtualInterfaceGroupsOutput{} req = c.newRequest(op, input, output) return } -// DescribeNetworkInterfaceAttribute API operation for Amazon Elastic Compute Cloud. +// DescribeLocalGatewayVirtualInterfaceGroups API operation for Amazon Elastic Compute Cloud. // -// Describes a network interface attribute. You can specify only one attribute -// at a time. +// Describes the specified local gateway virtual interface 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 Elastic Compute Cloud's -// API operation DescribeNetworkInterfaceAttribute for usage and error information. -// See also, 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) +// API operation DescribeLocalGatewayVirtualInterfaceGroups for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLocalGatewayVirtualInterfaceGroups +func (c *EC2) DescribeLocalGatewayVirtualInterfaceGroups(input *DescribeLocalGatewayVirtualInterfaceGroupsInput) (*DescribeLocalGatewayVirtualInterfaceGroupsOutput, error) { + req, out := c.DescribeLocalGatewayVirtualInterfaceGroupsRequest(input) return out, req.Send() } -// DescribeNetworkInterfaceAttributeWithContext is the same as DescribeNetworkInterfaceAttribute with the addition of +// DescribeLocalGatewayVirtualInterfaceGroupsWithContext is the same as DescribeLocalGatewayVirtualInterfaceGroups with the addition of // the ability to pass a context and additional request options. // -// See DescribeNetworkInterfaceAttribute for details on how to use this API operation. +// See DescribeLocalGatewayVirtualInterfaceGroups for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeNetworkInterfaceAttributeWithContext(ctx aws.Context, input *DescribeNetworkInterfaceAttributeInput, opts ...request.Option) (*DescribeNetworkInterfaceAttributeOutput, error) { - req, out := c.DescribeNetworkInterfaceAttributeRequest(input) +func (c *EC2) DescribeLocalGatewayVirtualInterfaceGroupsWithContext(ctx aws.Context, input *DescribeLocalGatewayVirtualInterfaceGroupsInput, opts ...request.Option) (*DescribeLocalGatewayVirtualInterfaceGroupsOutput, error) { + req, out := c.DescribeLocalGatewayVirtualInterfaceGroupsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeNetworkInterfacePermissions = "DescribeNetworkInterfacePermissions" +// DescribeLocalGatewayVirtualInterfaceGroupsPages iterates over the pages of a DescribeLocalGatewayVirtualInterfaceGroups operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeLocalGatewayVirtualInterfaceGroups 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 DescribeLocalGatewayVirtualInterfaceGroups operation. +// pageNum := 0 +// err := client.DescribeLocalGatewayVirtualInterfaceGroupsPages(params, +// func(page *ec2.DescribeLocalGatewayVirtualInterfaceGroupsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeLocalGatewayVirtualInterfaceGroupsPages(input *DescribeLocalGatewayVirtualInterfaceGroupsInput, fn func(*DescribeLocalGatewayVirtualInterfaceGroupsOutput, bool) bool) error { + return c.DescribeLocalGatewayVirtualInterfaceGroupsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// DescribeNetworkInterfacePermissionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNetworkInterfacePermissions operation. The "output" return +// DescribeLocalGatewayVirtualInterfaceGroupsPagesWithContext same as DescribeLocalGatewayVirtualInterfaceGroupsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeLocalGatewayVirtualInterfaceGroupsPagesWithContext(ctx aws.Context, input *DescribeLocalGatewayVirtualInterfaceGroupsInput, fn func(*DescribeLocalGatewayVirtualInterfaceGroupsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeLocalGatewayVirtualInterfaceGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeLocalGatewayVirtualInterfaceGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeLocalGatewayVirtualInterfaceGroupsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeLocalGatewayVirtualInterfaces = "DescribeLocalGatewayVirtualInterfaces" + +// DescribeLocalGatewayVirtualInterfacesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLocalGatewayVirtualInterfaces operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeNetworkInterfacePermissions for more information on using the DescribeNetworkInterfacePermissions +// See DescribeLocalGatewayVirtualInterfaces for more information on using the DescribeLocalGatewayVirtualInterfaces // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeNetworkInterfacePermissionsRequest method. -// req, resp := client.DescribeNetworkInterfacePermissionsRequest(params) +// // Example sending a request using the DescribeLocalGatewayVirtualInterfacesRequest method. +// req, resp := client.DescribeLocalGatewayVirtualInterfacesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfacePermissions -func (c *EC2) DescribeNetworkInterfacePermissionsRequest(input *DescribeNetworkInterfacePermissionsInput) (req *request.Request, output *DescribeNetworkInterfacePermissionsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLocalGatewayVirtualInterfaces +func (c *EC2) DescribeLocalGatewayVirtualInterfacesRequest(input *DescribeLocalGatewayVirtualInterfacesInput) (req *request.Request, output *DescribeLocalGatewayVirtualInterfacesOutput) { op := &request.Operation{ - Name: opDescribeNetworkInterfacePermissions, + Name: opDescribeLocalGatewayVirtualInterfaces, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -16089,125 +17933,127 @@ func (c *EC2) DescribeNetworkInterfacePermissionsRequest(input *DescribeNetworkI } if input == nil { - input = &DescribeNetworkInterfacePermissionsInput{} + input = &DescribeLocalGatewayVirtualInterfacesInput{} } - output = &DescribeNetworkInterfacePermissionsOutput{} + output = &DescribeLocalGatewayVirtualInterfacesOutput{} req = c.newRequest(op, input, output) return } -// DescribeNetworkInterfacePermissions API operation for Amazon Elastic Compute Cloud. +// DescribeLocalGatewayVirtualInterfaces API operation for Amazon Elastic Compute Cloud. // -// Describes the permissions for your network interfaces. +// Describes the specified local gateway virtual 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 DescribeNetworkInterfacePermissions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfacePermissions -func (c *EC2) DescribeNetworkInterfacePermissions(input *DescribeNetworkInterfacePermissionsInput) (*DescribeNetworkInterfacePermissionsOutput, error) { - req, out := c.DescribeNetworkInterfacePermissionsRequest(input) +// API operation DescribeLocalGatewayVirtualInterfaces for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLocalGatewayVirtualInterfaces +func (c *EC2) DescribeLocalGatewayVirtualInterfaces(input *DescribeLocalGatewayVirtualInterfacesInput) (*DescribeLocalGatewayVirtualInterfacesOutput, error) { + req, out := c.DescribeLocalGatewayVirtualInterfacesRequest(input) return out, req.Send() } -// DescribeNetworkInterfacePermissionsWithContext is the same as DescribeNetworkInterfacePermissions with the addition of +// DescribeLocalGatewayVirtualInterfacesWithContext is the same as DescribeLocalGatewayVirtualInterfaces with the addition of // the ability to pass a context and additional request options. // -// See DescribeNetworkInterfacePermissions for details on how to use this API operation. +// See DescribeLocalGatewayVirtualInterfaces for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeNetworkInterfacePermissionsWithContext(ctx aws.Context, input *DescribeNetworkInterfacePermissionsInput, opts ...request.Option) (*DescribeNetworkInterfacePermissionsOutput, error) { - req, out := c.DescribeNetworkInterfacePermissionsRequest(input) +func (c *EC2) DescribeLocalGatewayVirtualInterfacesWithContext(ctx aws.Context, input *DescribeLocalGatewayVirtualInterfacesInput, opts ...request.Option) (*DescribeLocalGatewayVirtualInterfacesOutput, error) { + req, out := c.DescribeLocalGatewayVirtualInterfacesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeNetworkInterfacePermissionsPages iterates over the pages of a DescribeNetworkInterfacePermissions operation, +// DescribeLocalGatewayVirtualInterfacesPages iterates over the pages of a DescribeLocalGatewayVirtualInterfaces operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribeNetworkInterfacePermissions method for more information on how to use this operation. +// See DescribeLocalGatewayVirtualInterfaces 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 DescribeNetworkInterfacePermissions operation. +// // Example iterating over at most 3 pages of a DescribeLocalGatewayVirtualInterfaces operation. // pageNum := 0 -// err := client.DescribeNetworkInterfacePermissionsPages(params, -// func(page *ec2.DescribeNetworkInterfacePermissionsOutput, lastPage bool) bool { +// err := client.DescribeLocalGatewayVirtualInterfacesPages(params, +// func(page *ec2.DescribeLocalGatewayVirtualInterfacesOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeNetworkInterfacePermissionsPages(input *DescribeNetworkInterfacePermissionsInput, fn func(*DescribeNetworkInterfacePermissionsOutput, bool) bool) error { - return c.DescribeNetworkInterfacePermissionsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeLocalGatewayVirtualInterfacesPages(input *DescribeLocalGatewayVirtualInterfacesInput, fn func(*DescribeLocalGatewayVirtualInterfacesOutput, bool) bool) error { + return c.DescribeLocalGatewayVirtualInterfacesPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeNetworkInterfacePermissionsPagesWithContext same as DescribeNetworkInterfacePermissionsPages except +// DescribeLocalGatewayVirtualInterfacesPagesWithContext same as DescribeLocalGatewayVirtualInterfacesPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeNetworkInterfacePermissionsPagesWithContext(ctx aws.Context, input *DescribeNetworkInterfacePermissionsInput, fn func(*DescribeNetworkInterfacePermissionsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeLocalGatewayVirtualInterfacesPagesWithContext(ctx aws.Context, input *DescribeLocalGatewayVirtualInterfacesInput, fn func(*DescribeLocalGatewayVirtualInterfacesOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeNetworkInterfacePermissionsInput + var inCpy *DescribeLocalGatewayVirtualInterfacesInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeNetworkInterfacePermissionsRequest(inCpy) + req, _ := c.DescribeLocalGatewayVirtualInterfacesRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeNetworkInterfacePermissionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeLocalGatewayVirtualInterfacesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeNetworkInterfaces = "DescribeNetworkInterfaces" +const opDescribeLocalGateways = "DescribeLocalGateways" -// DescribeNetworkInterfacesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNetworkInterfaces operation. The "output" return +// DescribeLocalGatewaysRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLocalGateways operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeNetworkInterfaces for more information on using the DescribeNetworkInterfaces +// See DescribeLocalGateways for more information on using the DescribeLocalGateways // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeNetworkInterfacesRequest method. -// req, resp := client.DescribeNetworkInterfacesRequest(params) +// // Example sending a request using the DescribeLocalGatewaysRequest method. +// req, resp := client.DescribeLocalGatewaysRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaces -func (c *EC2) DescribeNetworkInterfacesRequest(input *DescribeNetworkInterfacesInput) (req *request.Request, output *DescribeNetworkInterfacesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLocalGateways +func (c *EC2) DescribeLocalGatewaysRequest(input *DescribeLocalGatewaysInput) (req *request.Request, output *DescribeLocalGatewaysOutput) { op := &request.Operation{ - Name: opDescribeNetworkInterfaces, + Name: opDescribeLocalGateways, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -16219,201 +18065,262 @@ func (c *EC2) DescribeNetworkInterfacesRequest(input *DescribeNetworkInterfacesI } if input == nil { - input = &DescribeNetworkInterfacesInput{} + input = &DescribeLocalGatewaysInput{} } - output = &DescribeNetworkInterfacesOutput{} + output = &DescribeLocalGatewaysOutput{} req = c.newRequest(op, input, output) return } -// DescribeNetworkInterfaces API operation for Amazon Elastic Compute Cloud. +// DescribeLocalGateways API operation for Amazon Elastic Compute Cloud. // -// Describes one or more of your network interfaces. +// Describes one or more local gateways. By default, all local gateways are +// described. Alternatively, you can 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 Elastic Compute Cloud's -// API operation DescribeNetworkInterfaces for usage and error information. -// See also, 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) +// API operation DescribeLocalGateways for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeLocalGateways +func (c *EC2) DescribeLocalGateways(input *DescribeLocalGatewaysInput) (*DescribeLocalGatewaysOutput, error) { + req, out := c.DescribeLocalGatewaysRequest(input) return out, req.Send() } -// DescribeNetworkInterfacesWithContext is the same as DescribeNetworkInterfaces with the addition of +// DescribeLocalGatewaysWithContext is the same as DescribeLocalGateways with the addition of // the ability to pass a context and additional request options. // -// See DescribeNetworkInterfaces for details on how to use this API operation. +// See DescribeLocalGateways for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeNetworkInterfacesWithContext(ctx aws.Context, input *DescribeNetworkInterfacesInput, opts ...request.Option) (*DescribeNetworkInterfacesOutput, error) { - req, out := c.DescribeNetworkInterfacesRequest(input) +func (c *EC2) DescribeLocalGatewaysWithContext(ctx aws.Context, input *DescribeLocalGatewaysInput, opts ...request.Option) (*DescribeLocalGatewaysOutput, error) { + req, out := c.DescribeLocalGatewaysRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeNetworkInterfacesPages iterates over the pages of a DescribeNetworkInterfaces operation, +// DescribeLocalGatewaysPages iterates over the pages of a DescribeLocalGateways operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribeNetworkInterfaces method for more information on how to use this operation. +// See DescribeLocalGateways 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 DescribeNetworkInterfaces operation. +// // Example iterating over at most 3 pages of a DescribeLocalGateways operation. // pageNum := 0 -// err := client.DescribeNetworkInterfacesPages(params, -// func(page *ec2.DescribeNetworkInterfacesOutput, lastPage bool) bool { +// err := client.DescribeLocalGatewaysPages(params, +// func(page *ec2.DescribeLocalGatewaysOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeNetworkInterfacesPages(input *DescribeNetworkInterfacesInput, fn func(*DescribeNetworkInterfacesOutput, bool) bool) error { - return c.DescribeNetworkInterfacesPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeLocalGatewaysPages(input *DescribeLocalGatewaysInput, fn func(*DescribeLocalGatewaysOutput, bool) bool) error { + return c.DescribeLocalGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeNetworkInterfacesPagesWithContext same as DescribeNetworkInterfacesPages except +// DescribeLocalGatewaysPagesWithContext same as DescribeLocalGatewaysPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeNetworkInterfacesPagesWithContext(ctx aws.Context, input *DescribeNetworkInterfacesInput, fn func(*DescribeNetworkInterfacesOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeLocalGatewaysPagesWithContext(ctx aws.Context, input *DescribeLocalGatewaysInput, fn func(*DescribeLocalGatewaysOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeNetworkInterfacesInput + var inCpy *DescribeLocalGatewaysInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeNetworkInterfacesRequest(inCpy) + req, _ := c.DescribeLocalGatewaysRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeNetworkInterfacesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeLocalGatewaysOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribePlacementGroups = "DescribePlacementGroups" +const opDescribeMovingAddresses = "DescribeMovingAddresses" -// DescribePlacementGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribePlacementGroups operation. The "output" return +// DescribeMovingAddressesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeMovingAddresses operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribePlacementGroups for more information on using the DescribePlacementGroups +// See DescribeMovingAddresses for more information on using the DescribeMovingAddresses // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribePlacementGroupsRequest method. -// req, resp := client.DescribePlacementGroupsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePlacementGroups -func (c *EC2) DescribePlacementGroupsRequest(input *DescribePlacementGroupsInput) (req *request.Request, output *DescribePlacementGroupsOutput) { +// See also, 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: opDescribePlacementGroups, + Name: opDescribeMovingAddresses, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DescribePlacementGroupsInput{} + input = &DescribeMovingAddressesInput{} } - output = &DescribePlacementGroupsOutput{} + output = &DescribeMovingAddressesOutput{} req = c.newRequest(op, input, output) return } -// DescribePlacementGroups API operation for Amazon Elastic Compute Cloud. +// DescribeMovingAddresses API operation for Amazon Elastic Compute Cloud. // -// Describes the specified placement groups or all of your placement groups. -// For more information, see Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) -// in the Amazon Elastic Compute Cloud User Guide. +// 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 DescribePlacementGroups for usage and error information. -// See also, 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) +// API operation DescribeMovingAddresses for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeMovingAddresses +func (c *EC2) DescribeMovingAddresses(input *DescribeMovingAddressesInput) (*DescribeMovingAddressesOutput, error) { + req, out := c.DescribeMovingAddressesRequest(input) return out, req.Send() } -// DescribePlacementGroupsWithContext is the same as DescribePlacementGroups with the addition of +// DescribeMovingAddressesWithContext is the same as DescribeMovingAddresses with the addition of // the ability to pass a context and additional request options. // -// See DescribePlacementGroups for details on how to use this API operation. +// See DescribeMovingAddresses for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribePlacementGroupsWithContext(ctx aws.Context, input *DescribePlacementGroupsInput, opts ...request.Option) (*DescribePlacementGroupsOutput, error) { - req, out := c.DescribePlacementGroupsRequest(input) +func (c *EC2) DescribeMovingAddressesWithContext(ctx aws.Context, input *DescribeMovingAddressesInput, opts ...request.Option) (*DescribeMovingAddressesOutput, error) { + req, out := c.DescribeMovingAddressesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribePrefixLists = "DescribePrefixLists" +// DescribeMovingAddressesPages iterates over the pages of a DescribeMovingAddresses operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeMovingAddresses 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 DescribeMovingAddresses operation. +// pageNum := 0 +// err := client.DescribeMovingAddressesPages(params, +// func(page *ec2.DescribeMovingAddressesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeMovingAddressesPages(input *DescribeMovingAddressesInput, fn func(*DescribeMovingAddressesOutput, bool) bool) error { + return c.DescribeMovingAddressesPagesWithContext(aws.BackgroundContext(), input, fn) +} -// DescribePrefixListsRequest generates a "aws/request.Request" representing the -// client's request for the DescribePrefixLists operation. The "output" return +// DescribeMovingAddressesPagesWithContext same as DescribeMovingAddressesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeMovingAddressesPagesWithContext(ctx aws.Context, input *DescribeMovingAddressesInput, fn func(*DescribeMovingAddressesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeMovingAddressesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeMovingAddressesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeMovingAddressesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeNatGateways = "DescribeNatGateways" + +// DescribeNatGatewaysRequest generates a "aws/request.Request" representing the +// client's request for the DescribeNatGateways operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribePrefixLists for more information on using the DescribePrefixLists +// See DescribeNatGateways for more information on using the DescribeNatGateways // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribePrefixListsRequest method. -// req, resp := client.DescribePrefixListsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrefixLists -func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) (req *request.Request, output *DescribePrefixListsOutput) { +// See also, 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: opDescribePrefixLists, + Name: opDescribeNatGateways, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -16425,130 +18332,127 @@ func (c *EC2) DescribePrefixListsRequest(input *DescribePrefixListsInput) (req * } if input == nil { - input = &DescribePrefixListsInput{} + input = &DescribeNatGatewaysInput{} } - output = &DescribePrefixListsOutput{} + output = &DescribeNatGatewaysOutput{} req = c.newRequest(op, input, output) return } -// DescribePrefixLists API operation for Amazon Elastic Compute Cloud. +// DescribeNatGateways 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 gateway VPC endpoint. Currently, the services that support this -// action are Amazon S3 and Amazon DynamoDB. +// Describes one or more of 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 DescribePrefixLists for usage and error information. -// See also, 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) +// API operation DescribeNatGateways for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNatGateways +func (c *EC2) DescribeNatGateways(input *DescribeNatGatewaysInput) (*DescribeNatGatewaysOutput, error) { + req, out := c.DescribeNatGatewaysRequest(input) return out, req.Send() } -// DescribePrefixListsWithContext is the same as DescribePrefixLists with the addition of +// DescribeNatGatewaysWithContext is the same as DescribeNatGateways with the addition of // the ability to pass a context and additional request options. // -// See DescribePrefixLists for details on how to use this API operation. +// See DescribeNatGateways for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribePrefixListsWithContext(ctx aws.Context, input *DescribePrefixListsInput, opts ...request.Option) (*DescribePrefixListsOutput, error) { - req, out := c.DescribePrefixListsRequest(input) +func (c *EC2) DescribeNatGatewaysWithContext(ctx aws.Context, input *DescribeNatGatewaysInput, opts ...request.Option) (*DescribeNatGatewaysOutput, error) { + req, out := c.DescribeNatGatewaysRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribePrefixListsPages iterates over the pages of a DescribePrefixLists operation, +// 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 DescribePrefixLists method for more information on how to use this operation. +// 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 DescribePrefixLists operation. +// // Example iterating over at most 3 pages of a DescribeNatGateways operation. // pageNum := 0 -// err := client.DescribePrefixListsPages(params, -// func(page *ec2.DescribePrefixListsOutput, lastPage bool) bool { +// err := client.DescribeNatGatewaysPages(params, +// func(page *ec2.DescribeNatGatewaysOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribePrefixListsPages(input *DescribePrefixListsInput, fn func(*DescribePrefixListsOutput, bool) bool) error { - return c.DescribePrefixListsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeNatGatewaysPages(input *DescribeNatGatewaysInput, fn func(*DescribeNatGatewaysOutput, bool) bool) error { + return c.DescribeNatGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribePrefixListsPagesWithContext same as DescribePrefixListsPages except +// DescribeNatGatewaysPagesWithContext same as DescribeNatGatewaysPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribePrefixListsPagesWithContext(ctx aws.Context, input *DescribePrefixListsInput, fn func(*DescribePrefixListsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeNatGatewaysPagesWithContext(ctx aws.Context, input *DescribeNatGatewaysInput, fn func(*DescribeNatGatewaysOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribePrefixListsInput + var inCpy *DescribeNatGatewaysInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribePrefixListsRequest(inCpy) + req, _ := c.DescribeNatGatewaysRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribePrefixListsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeNatGatewaysOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribePrincipalIdFormat = "DescribePrincipalIdFormat" +const opDescribeNetworkAcls = "DescribeNetworkAcls" -// DescribePrincipalIdFormatRequest generates a "aws/request.Request" representing the -// client's request for the DescribePrincipalIdFormat operation. The "output" return +// DescribeNetworkAclsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeNetworkAcls operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribePrincipalIdFormat for more information on using the DescribePrincipalIdFormat +// See DescribeNetworkAcls for more information on using the DescribeNetworkAcls // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribePrincipalIdFormatRequest method. -// req, resp := client.DescribePrincipalIdFormatRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrincipalIdFormat -func (c *EC2) DescribePrincipalIdFormatRequest(input *DescribePrincipalIdFormatInput) (req *request.Request, output *DescribePrincipalIdFormatOutput) { +// See also, 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: opDescribePrincipalIdFormat, + Name: opDescribeNetworkAcls, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -16560,139 +18464,205 @@ func (c *EC2) DescribePrincipalIdFormatRequest(input *DescribePrincipalIdFormatI } if input == nil { - input = &DescribePrincipalIdFormatInput{} + input = &DescribeNetworkAclsInput{} } - output = &DescribePrincipalIdFormatOutput{} + output = &DescribeNetworkAclsOutput{} req = c.newRequest(op, input, output) return } -// DescribePrincipalIdFormat API operation for Amazon Elastic Compute Cloud. -// -// Describes the ID format settings for the root user and all IAM roles and -// IAM users that have explicitly specified a longer ID (17-character ID) preference. +// DescribeNetworkAcls API operation for Amazon Elastic Compute Cloud. // -// By default, all IAM roles and IAM users default to the same ID settings as -// the root user, unless they explicitly override the settings. This request -// is useful for identifying those IAM users and IAM roles that have overridden -// the default ID settings. +// Describes one or more of your network ACLs. // -// The following resource types support longer IDs: bundle | conversion-task -// | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association -// | export-task | flow-log | image | import-task | instance | internet-gateway -// | network-acl | network-acl-association | network-interface | network-interface-attachment -// | prefix-list | reservation | route-table | route-table-association | security-group -// | snapshot | subnet | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association -// | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway. +// For more information, see Network ACLs (https://docs.aws.amazon.com/vpc/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 DescribePrincipalIdFormat for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrincipalIdFormat -func (c *EC2) DescribePrincipalIdFormat(input *DescribePrincipalIdFormatInput) (*DescribePrincipalIdFormatOutput, error) { - req, out := c.DescribePrincipalIdFormatRequest(input) +// API operation DescribeNetworkAcls for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkAcls +func (c *EC2) DescribeNetworkAcls(input *DescribeNetworkAclsInput) (*DescribeNetworkAclsOutput, error) { + req, out := c.DescribeNetworkAclsRequest(input) return out, req.Send() } -// DescribePrincipalIdFormatWithContext is the same as DescribePrincipalIdFormat with the addition of +// DescribeNetworkAclsWithContext is the same as DescribeNetworkAcls with the addition of // the ability to pass a context and additional request options. // -// See DescribePrincipalIdFormat for details on how to use this API operation. +// See DescribeNetworkAcls for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribePrincipalIdFormatWithContext(ctx aws.Context, input *DescribePrincipalIdFormatInput, opts ...request.Option) (*DescribePrincipalIdFormatOutput, error) { - req, out := c.DescribePrincipalIdFormatRequest(input) +func (c *EC2) DescribeNetworkAclsWithContext(ctx aws.Context, input *DescribeNetworkAclsInput, opts ...request.Option) (*DescribeNetworkAclsOutput, error) { + req, out := c.DescribeNetworkAclsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribePrincipalIdFormatPages iterates over the pages of a DescribePrincipalIdFormat operation, +// DescribeNetworkAclsPages iterates over the pages of a DescribeNetworkAcls operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribePrincipalIdFormat method for more information on how to use this operation. +// See DescribeNetworkAcls 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 DescribePrincipalIdFormat operation. +// // Example iterating over at most 3 pages of a DescribeNetworkAcls operation. // pageNum := 0 -// err := client.DescribePrincipalIdFormatPages(params, -// func(page *ec2.DescribePrincipalIdFormatOutput, lastPage bool) bool { +// err := client.DescribeNetworkAclsPages(params, +// func(page *ec2.DescribeNetworkAclsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribePrincipalIdFormatPages(input *DescribePrincipalIdFormatInput, fn func(*DescribePrincipalIdFormatOutput, bool) bool) error { - return c.DescribePrincipalIdFormatPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeNetworkAclsPages(input *DescribeNetworkAclsInput, fn func(*DescribeNetworkAclsOutput, bool) bool) error { + return c.DescribeNetworkAclsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribePrincipalIdFormatPagesWithContext same as DescribePrincipalIdFormatPages except +// DescribeNetworkAclsPagesWithContext same as DescribeNetworkAclsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribePrincipalIdFormatPagesWithContext(ctx aws.Context, input *DescribePrincipalIdFormatInput, fn func(*DescribePrincipalIdFormatOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeNetworkAclsPagesWithContext(ctx aws.Context, input *DescribeNetworkAclsInput, fn func(*DescribeNetworkAclsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribePrincipalIdFormatInput + var inCpy *DescribeNetworkAclsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribePrincipalIdFormatRequest(inCpy) + req, _ := c.DescribeNetworkAclsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribePrincipalIdFormatOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeNetworkAclsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribePublicIpv4Pools = "DescribePublicIpv4Pools" +const opDescribeNetworkInterfaceAttribute = "DescribeNetworkInterfaceAttribute" -// DescribePublicIpv4PoolsRequest generates a "aws/request.Request" representing the -// client's request for the DescribePublicIpv4Pools operation. The "output" return +// DescribeNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the +// client's request for the DescribeNetworkInterfaceAttribute operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribePublicIpv4Pools for more information on using the DescribePublicIpv4Pools +// See DescribeNetworkInterfaceAttribute for more information on using the DescribeNetworkInterfaceAttribute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribePublicIpv4PoolsRequest method. -// req, resp := client.DescribePublicIpv4PoolsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePublicIpv4Pools -func (c *EC2) DescribePublicIpv4PoolsRequest(input *DescribePublicIpv4PoolsInput) (req *request.Request, output *DescribePublicIpv4PoolsOutput) { +// See also, 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: opDescribePublicIpv4Pools, + 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. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaceAttribute +func (c *EC2) DescribeNetworkInterfaceAttribute(input *DescribeNetworkInterfaceAttributeInput) (*DescribeNetworkInterfaceAttributeOutput, error) { + req, out := c.DescribeNetworkInterfaceAttributeRequest(input) + return out, req.Send() +} + +// DescribeNetworkInterfaceAttributeWithContext is the same as DescribeNetworkInterfaceAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeNetworkInterfaceAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeNetworkInterfaceAttributeWithContext(ctx aws.Context, input *DescribeNetworkInterfaceAttributeInput, opts ...request.Option) (*DescribeNetworkInterfaceAttributeOutput, error) { + req, out := c.DescribeNetworkInterfaceAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeNetworkInterfacePermissions = "DescribeNetworkInterfacePermissions" + +// DescribeNetworkInterfacePermissionsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeNetworkInterfacePermissions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeNetworkInterfacePermissions for more information on using the DescribeNetworkInterfacePermissions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeNetworkInterfacePermissionsRequest method. +// req, resp := client.DescribeNetworkInterfacePermissionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfacePermissions +func (c *EC2) DescribeNetworkInterfacePermissionsRequest(input *DescribeNetworkInterfacePermissionsInput) (req *request.Request, output *DescribeNetworkInterfacePermissionsOutput) { + op := &request.Operation{ + Name: opDescribeNetworkInterfacePermissions, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -16704,319 +18674,276 @@ func (c *EC2) DescribePublicIpv4PoolsRequest(input *DescribePublicIpv4PoolsInput } if input == nil { - input = &DescribePublicIpv4PoolsInput{} + input = &DescribeNetworkInterfacePermissionsInput{} } - output = &DescribePublicIpv4PoolsOutput{} + output = &DescribeNetworkInterfacePermissionsOutput{} req = c.newRequest(op, input, output) return } -// DescribePublicIpv4Pools API operation for Amazon Elastic Compute Cloud. +// DescribeNetworkInterfacePermissions API operation for Amazon Elastic Compute Cloud. // -// Describes the specified IPv4 address pools. +// Describes the permissions for 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 DescribePublicIpv4Pools for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePublicIpv4Pools -func (c *EC2) DescribePublicIpv4Pools(input *DescribePublicIpv4PoolsInput) (*DescribePublicIpv4PoolsOutput, error) { - req, out := c.DescribePublicIpv4PoolsRequest(input) +// API operation DescribeNetworkInterfacePermissions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfacePermissions +func (c *EC2) DescribeNetworkInterfacePermissions(input *DescribeNetworkInterfacePermissionsInput) (*DescribeNetworkInterfacePermissionsOutput, error) { + req, out := c.DescribeNetworkInterfacePermissionsRequest(input) return out, req.Send() } -// DescribePublicIpv4PoolsWithContext is the same as DescribePublicIpv4Pools with the addition of +// DescribeNetworkInterfacePermissionsWithContext is the same as DescribeNetworkInterfacePermissions with the addition of // the ability to pass a context and additional request options. // -// See DescribePublicIpv4Pools for details on how to use this API operation. +// See DescribeNetworkInterfacePermissions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribePublicIpv4PoolsWithContext(ctx aws.Context, input *DescribePublicIpv4PoolsInput, opts ...request.Option) (*DescribePublicIpv4PoolsOutput, error) { - req, out := c.DescribePublicIpv4PoolsRequest(input) +func (c *EC2) DescribeNetworkInterfacePermissionsWithContext(ctx aws.Context, input *DescribeNetworkInterfacePermissionsInput, opts ...request.Option) (*DescribeNetworkInterfacePermissionsOutput, error) { + req, out := c.DescribeNetworkInterfacePermissionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribePublicIpv4PoolsPages iterates over the pages of a DescribePublicIpv4Pools operation, +// DescribeNetworkInterfacePermissionsPages iterates over the pages of a DescribeNetworkInterfacePermissions operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribePublicIpv4Pools method for more information on how to use this operation. +// See DescribeNetworkInterfacePermissions 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 DescribePublicIpv4Pools operation. +// // Example iterating over at most 3 pages of a DescribeNetworkInterfacePermissions operation. // pageNum := 0 -// err := client.DescribePublicIpv4PoolsPages(params, -// func(page *ec2.DescribePublicIpv4PoolsOutput, lastPage bool) bool { +// err := client.DescribeNetworkInterfacePermissionsPages(params, +// func(page *ec2.DescribeNetworkInterfacePermissionsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribePublicIpv4PoolsPages(input *DescribePublicIpv4PoolsInput, fn func(*DescribePublicIpv4PoolsOutput, bool) bool) error { - return c.DescribePublicIpv4PoolsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeNetworkInterfacePermissionsPages(input *DescribeNetworkInterfacePermissionsInput, fn func(*DescribeNetworkInterfacePermissionsOutput, bool) bool) error { + return c.DescribeNetworkInterfacePermissionsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribePublicIpv4PoolsPagesWithContext same as DescribePublicIpv4PoolsPages except +// DescribeNetworkInterfacePermissionsPagesWithContext same as DescribeNetworkInterfacePermissionsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribePublicIpv4PoolsPagesWithContext(ctx aws.Context, input *DescribePublicIpv4PoolsInput, fn func(*DescribePublicIpv4PoolsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeNetworkInterfacePermissionsPagesWithContext(ctx aws.Context, input *DescribeNetworkInterfacePermissionsInput, fn func(*DescribeNetworkInterfacePermissionsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribePublicIpv4PoolsInput + var inCpy *DescribeNetworkInterfacePermissionsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribePublicIpv4PoolsRequest(inCpy) + req, _ := c.DescribeNetworkInterfacePermissionsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribePublicIpv4PoolsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeNetworkInterfacePermissionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeRegions = "DescribeRegions" +const opDescribeNetworkInterfaces = "DescribeNetworkInterfaces" -// DescribeRegionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeRegions operation. The "output" return +// DescribeNetworkInterfacesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeNetworkInterfaces operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeRegions for more information on using the DescribeRegions +// See DescribeNetworkInterfaces for more information on using the DescribeNetworkInterfaces // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeRegionsRequest method. -// req, resp := client.DescribeRegionsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRegions -func (c *EC2) DescribeRegionsRequest(input *DescribeRegionsInput) (req *request.Request, output *DescribeRegionsOutput) { +// See also, 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: opDescribeRegions, + Name: opDescribeNetworkInterfaces, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DescribeRegionsInput{} + input = &DescribeNetworkInterfacesInput{} } - output = &DescribeRegionsOutput{} + output = &DescribeNetworkInterfacesOutput{} req = c.newRequest(op, input, output) return } -// DescribeRegions API operation for Amazon Elastic Compute Cloud. -// -// Describes the Regions that are enabled for your account, or all Regions. -// -// For a list of the Regions supported by Amazon EC2, see Regions and Endpoints -// (https://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region). +// DescribeNetworkInterfaces API operation for Amazon Elastic Compute Cloud. // -// For information about enabling and disabling Regions for your account, see -// Managing AWS Regions (https://docs.aws.amazon.com/general/latest/gr/rande-manage.html) -// in the AWS General Reference. +// 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 DescribeRegions for usage and error information. -// See also, 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) +// API operation DescribeNetworkInterfaces for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeNetworkInterfaces +func (c *EC2) DescribeNetworkInterfaces(input *DescribeNetworkInterfacesInput) (*DescribeNetworkInterfacesOutput, error) { + req, out := c.DescribeNetworkInterfacesRequest(input) return out, req.Send() } -// DescribeRegionsWithContext is the same as DescribeRegions with the addition of +// DescribeNetworkInterfacesWithContext is the same as DescribeNetworkInterfaces with the addition of // the ability to pass a context and additional request options. // -// See DescribeRegions for details on how to use this API operation. +// See DescribeNetworkInterfaces for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeRegionsWithContext(ctx aws.Context, input *DescribeRegionsInput, opts ...request.Option) (*DescribeRegionsOutput, error) { - req, out := c.DescribeRegionsRequest(input) +func (c *EC2) DescribeNetworkInterfacesWithContext(ctx aws.Context, input *DescribeNetworkInterfacesInput, opts ...request.Option) (*DescribeNetworkInterfacesOutput, error) { + req, out := c.DescribeNetworkInterfacesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeReservedInstances = "DescribeReservedInstances" - -// DescribeReservedInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedInstances operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeReservedInstances for more information on using the DescribeReservedInstances -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DescribeReservedInstancesRequest method. -// req, resp := client.DescribeReservedInstancesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, 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. +// DescribeNetworkInterfacesPages iterates over the pages of a DescribeNetworkInterfaces operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. // -// Describes one or more of the Reserved Instances that you purchased. +// See DescribeNetworkInterfaces method for more information on how to use this operation. // -// For more information about Reserved Instances, see Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Note: This operation can generate multiple requests to a 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. +// // Example iterating over at most 3 pages of a DescribeNetworkInterfaces operation. +// pageNum := 0 +// err := client.DescribeNetworkInterfacesPages(params, +// func(page *ec2.DescribeNetworkInterfacesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) // -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeReservedInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstances -func (c *EC2) DescribeReservedInstances(input *DescribeReservedInstancesInput) (*DescribeReservedInstancesOutput, error) { - req, out := c.DescribeReservedInstancesRequest(input) - return out, req.Send() +func (c *EC2) DescribeNetworkInterfacesPages(input *DescribeNetworkInterfacesInput, fn func(*DescribeNetworkInterfacesOutput, bool) bool) error { + return c.DescribeNetworkInterfacesPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeReservedInstancesWithContext is the same as DescribeReservedInstances with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeReservedInstances for details on how to use this API operation. +// DescribeNetworkInterfacesPagesWithContext same as DescribeNetworkInterfacesPages except +// it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeReservedInstancesWithContext(ctx aws.Context, input *DescribeReservedInstancesInput, opts ...request.Option) (*DescribeReservedInstancesOutput, error) { - req, out := c.DescribeReservedInstancesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() +func (c *EC2) DescribeNetworkInterfacesPagesWithContext(ctx aws.Context, input *DescribeNetworkInterfacesInput, fn func(*DescribeNetworkInterfacesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeNetworkInterfacesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNetworkInterfacesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeNetworkInterfacesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() } -const opDescribeReservedInstancesListings = "DescribeReservedInstancesListings" +const opDescribePlacementGroups = "DescribePlacementGroups" -// DescribeReservedInstancesListingsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedInstancesListings operation. The "output" return +// DescribePlacementGroupsRequest generates a "aws/request.Request" representing the +// client's request for the DescribePlacementGroups operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeReservedInstancesListings for more information on using the DescribeReservedInstancesListings +// See DescribePlacementGroups for more information on using the DescribePlacementGroups // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeReservedInstancesListingsRequest method. -// req, resp := client.DescribeReservedInstancesListingsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesListings -func (c *EC2) DescribeReservedInstancesListingsRequest(input *DescribeReservedInstancesListingsInput) (req *request.Request, output *DescribeReservedInstancesListingsOutput) { +// See also, 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: opDescribeReservedInstancesListings, + Name: opDescribePlacementGroups, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeReservedInstancesListingsInput{} + input = &DescribePlacementGroupsInput{} } - output = &DescribeReservedInstancesListingsOutput{} + output = &DescribePlacementGroupsOutput{} 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. +// DescribePlacementGroups API operation for Amazon Elastic Compute Cloud. // -// For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) +// Describes the specified placement groups or all of your placement groups. +// For more information, see Placement Groups (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -17024,194 +18951,195 @@ func (c *EC2) DescribeReservedInstancesListingsRequest(input *DescribeReservedIn // the error. // // See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeReservedInstancesListings for usage and error information. -// See also, 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) +// API operation DescribePlacementGroups for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePlacementGroups +func (c *EC2) DescribePlacementGroups(input *DescribePlacementGroupsInput) (*DescribePlacementGroupsOutput, error) { + req, out := c.DescribePlacementGroupsRequest(input) return out, req.Send() } -// DescribeReservedInstancesListingsWithContext is the same as DescribeReservedInstancesListings with the addition of +// DescribePlacementGroupsWithContext is the same as DescribePlacementGroups with the addition of // the ability to pass a context and additional request options. // -// See DescribeReservedInstancesListings for details on how to use this API operation. +// See DescribePlacementGroups for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeReservedInstancesListingsWithContext(ctx aws.Context, input *DescribeReservedInstancesListingsInput, opts ...request.Option) (*DescribeReservedInstancesListingsOutput, error) { - req, out := c.DescribeReservedInstancesListingsRequest(input) +func (c *EC2) DescribePlacementGroupsWithContext(ctx aws.Context, input *DescribePlacementGroupsInput, opts ...request.Option) (*DescribePlacementGroupsOutput, error) { + req, out := c.DescribePlacementGroupsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeReservedInstancesModifications = "DescribeReservedInstancesModifications" +const opDescribePrefixLists = "DescribePrefixLists" -// DescribeReservedInstancesModificationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedInstancesModifications operation. The "output" return +// DescribePrefixListsRequest generates a "aws/request.Request" representing the +// client's request for the DescribePrefixLists operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeReservedInstancesModifications for more information on using the DescribeReservedInstancesModifications +// See DescribePrefixLists for more information on using the DescribePrefixLists // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeReservedInstancesModificationsRequest method. -// req, resp := client.DescribeReservedInstancesModificationsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesModifications -func (c *EC2) DescribeReservedInstancesModificationsRequest(input *DescribeReservedInstancesModificationsInput) (req *request.Request, output *DescribeReservedInstancesModificationsOutput) { +// See also, 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: opDescribeReservedInstancesModifications, + Name: opDescribePrefixLists, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, - LimitToken: "", + LimitToken: "MaxResults", TruncationToken: "", }, } if input == nil { - input = &DescribeReservedInstancesModificationsInput{} + input = &DescribePrefixListsInput{} } - output = &DescribeReservedInstancesModificationsOutput{} + output = &DescribePrefixListsOutput{} 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. +// DescribePrefixLists API operation for Amazon Elastic Compute Cloud. // -// For more information, see Modifying Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html) -// in the Amazon Elastic Compute Cloud User Guide. +// 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 gateway VPC endpoint. Currently, the services that support this +// action are Amazon S3 and Amazon DynamoDB. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation DescribePrefixLists for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrefixLists +func (c *EC2) DescribePrefixLists(input *DescribePrefixListsInput) (*DescribePrefixListsOutput, error) { + req, out := c.DescribePrefixListsRequest(input) return out, req.Send() } -// DescribeReservedInstancesModificationsWithContext is the same as DescribeReservedInstancesModifications with the addition of +// DescribePrefixListsWithContext is the same as DescribePrefixLists with the addition of // the ability to pass a context and additional request options. // -// See DescribeReservedInstancesModifications for details on how to use this API operation. +// See DescribePrefixLists for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeReservedInstancesModificationsWithContext(ctx aws.Context, input *DescribeReservedInstancesModificationsInput, opts ...request.Option) (*DescribeReservedInstancesModificationsOutput, error) { - req, out := c.DescribeReservedInstancesModificationsRequest(input) +func (c *EC2) DescribePrefixListsWithContext(ctx aws.Context, input *DescribePrefixListsInput, opts ...request.Option) (*DescribePrefixListsOutput, error) { + req, out := c.DescribePrefixListsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeReservedInstancesModificationsPages iterates over the pages of a DescribeReservedInstancesModifications operation, +// DescribePrefixListsPages iterates over the pages of a DescribePrefixLists 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. +// See DescribePrefixLists 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. +// // Example iterating over at most 3 pages of a DescribePrefixLists operation. // pageNum := 0 -// err := client.DescribeReservedInstancesModificationsPages(params, -// func(page *ec2.DescribeReservedInstancesModificationsOutput, lastPage bool) bool { +// err := client.DescribePrefixListsPages(params, +// func(page *ec2.DescribePrefixListsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeReservedInstancesModificationsPages(input *DescribeReservedInstancesModificationsInput, fn func(*DescribeReservedInstancesModificationsOutput, bool) bool) error { - return c.DescribeReservedInstancesModificationsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribePrefixListsPages(input *DescribePrefixListsInput, fn func(*DescribePrefixListsOutput, bool) bool) error { + return c.DescribePrefixListsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeReservedInstancesModificationsPagesWithContext same as DescribeReservedInstancesModificationsPages except +// DescribePrefixListsPagesWithContext same as DescribePrefixListsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeReservedInstancesModificationsPagesWithContext(ctx aws.Context, input *DescribeReservedInstancesModificationsInput, fn func(*DescribeReservedInstancesModificationsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribePrefixListsPagesWithContext(ctx aws.Context, input *DescribePrefixListsInput, fn func(*DescribePrefixListsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeReservedInstancesModificationsInput + var inCpy *DescribePrefixListsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeReservedInstancesModificationsRequest(inCpy) + req, _ := c.DescribePrefixListsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedInstancesModificationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribePrefixListsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeReservedInstancesOfferings = "DescribeReservedInstancesOfferings" +const opDescribePrincipalIdFormat = "DescribePrincipalIdFormat" -// DescribeReservedInstancesOfferingsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReservedInstancesOfferings operation. The "output" return +// DescribePrincipalIdFormatRequest generates a "aws/request.Request" representing the +// client's request for the DescribePrincipalIdFormat operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeReservedInstancesOfferings for more information on using the DescribeReservedInstancesOfferings +// See DescribePrincipalIdFormat for more information on using the DescribePrincipalIdFormat // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeReservedInstancesOfferingsRequest method. -// req, resp := client.DescribeReservedInstancesOfferingsRequest(params) +// // Example sending a request using the DescribePrincipalIdFormatRequest method. +// req, resp := client.DescribePrincipalIdFormatRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesOfferings -func (c *EC2) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedInstancesOfferingsInput) (req *request.Request, output *DescribeReservedInstancesOfferingsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrincipalIdFormat +func (c *EC2) DescribePrincipalIdFormatRequest(input *DescribePrincipalIdFormatInput) (req *request.Request, output *DescribePrincipalIdFormatOutput) { op := &request.Operation{ - Name: opDescribeReservedInstancesOfferings, + Name: opDescribePrincipalIdFormat, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -17223,136 +19151,141 @@ func (c *EC2) DescribeReservedInstancesOfferingsRequest(input *DescribeReservedI } if input == nil { - input = &DescribeReservedInstancesOfferingsInput{} + input = &DescribePrincipalIdFormatInput{} } - output = &DescribeReservedInstancesOfferingsOutput{} + output = &DescribePrincipalIdFormatOutput{} req = c.newRequest(op, input, output) return } -// DescribeReservedInstancesOfferings API operation for Amazon Elastic Compute Cloud. +// DescribePrincipalIdFormat 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. +// Describes the ID format settings for the root user and all IAM roles and +// IAM users that have explicitly specified a longer ID (17-character ID) preference. // -// 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. +// By default, all IAM roles and IAM users default to the same ID settings as +// the root user, unless they explicitly override the settings. This request +// is useful for identifying those IAM users and IAM roles that have overridden +// the default ID settings. // -// For more information, see Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. +// The following resource types support longer IDs: bundle | conversion-task +// | customer-gateway | dhcp-options | elastic-ip-allocation | elastic-ip-association +// | export-task | flow-log | image | import-task | instance | internet-gateway +// | network-acl | network-acl-association | network-interface | network-interface-attachment +// | prefix-list | reservation | route-table | route-table-association | security-group +// | snapshot | subnet | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association +// | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-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 DescribeReservedInstancesOfferings for usage and error information. -// See also, 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) +// API operation DescribePrincipalIdFormat for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePrincipalIdFormat +func (c *EC2) DescribePrincipalIdFormat(input *DescribePrincipalIdFormatInput) (*DescribePrincipalIdFormatOutput, error) { + req, out := c.DescribePrincipalIdFormatRequest(input) return out, req.Send() } -// DescribeReservedInstancesOfferingsWithContext is the same as DescribeReservedInstancesOfferings with the addition of +// DescribePrincipalIdFormatWithContext is the same as DescribePrincipalIdFormat with the addition of // the ability to pass a context and additional request options. // -// See DescribeReservedInstancesOfferings for details on how to use this API operation. +// See DescribePrincipalIdFormat for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeReservedInstancesOfferingsWithContext(ctx aws.Context, input *DescribeReservedInstancesOfferingsInput, opts ...request.Option) (*DescribeReservedInstancesOfferingsOutput, error) { - req, out := c.DescribeReservedInstancesOfferingsRequest(input) +func (c *EC2) DescribePrincipalIdFormatWithContext(ctx aws.Context, input *DescribePrincipalIdFormatInput, opts ...request.Option) (*DescribePrincipalIdFormatOutput, error) { + req, out := c.DescribePrincipalIdFormatRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeReservedInstancesOfferingsPages iterates over the pages of a DescribeReservedInstancesOfferings operation, +// DescribePrincipalIdFormatPages iterates over the pages of a DescribePrincipalIdFormat 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. +// See DescribePrincipalIdFormat 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. +// // Example iterating over at most 3 pages of a DescribePrincipalIdFormat operation. // pageNum := 0 -// err := client.DescribeReservedInstancesOfferingsPages(params, -// func(page *ec2.DescribeReservedInstancesOfferingsOutput, lastPage bool) bool { +// err := client.DescribePrincipalIdFormatPages(params, +// func(page *ec2.DescribePrincipalIdFormatOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeReservedInstancesOfferingsPages(input *DescribeReservedInstancesOfferingsInput, fn func(*DescribeReservedInstancesOfferingsOutput, bool) bool) error { - return c.DescribeReservedInstancesOfferingsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribePrincipalIdFormatPages(input *DescribePrincipalIdFormatInput, fn func(*DescribePrincipalIdFormatOutput, bool) bool) error { + return c.DescribePrincipalIdFormatPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeReservedInstancesOfferingsPagesWithContext same as DescribeReservedInstancesOfferingsPages except +// DescribePrincipalIdFormatPagesWithContext same as DescribePrincipalIdFormatPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeReservedInstancesOfferingsPagesWithContext(ctx aws.Context, input *DescribeReservedInstancesOfferingsInput, fn func(*DescribeReservedInstancesOfferingsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribePrincipalIdFormatPagesWithContext(ctx aws.Context, input *DescribePrincipalIdFormatInput, fn func(*DescribePrincipalIdFormatOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeReservedInstancesOfferingsInput + var inCpy *DescribePrincipalIdFormatInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeReservedInstancesOfferingsRequest(inCpy) + req, _ := c.DescribePrincipalIdFormatRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedInstancesOfferingsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribePrincipalIdFormatOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeRouteTables = "DescribeRouteTables" +const opDescribePublicIpv4Pools = "DescribePublicIpv4Pools" -// DescribeRouteTablesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeRouteTables operation. The "output" return +// DescribePublicIpv4PoolsRequest generates a "aws/request.Request" representing the +// client's request for the DescribePublicIpv4Pools operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeRouteTables for more information on using the DescribeRouteTables +// See DescribePublicIpv4Pools for more information on using the DescribePublicIpv4Pools // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeRouteTablesRequest method. -// req, resp := client.DescribeRouteTablesRequest(params) +// // Example sending a request using the DescribePublicIpv4PoolsRequest method. +// req, resp := client.DescribePublicIpv4PoolsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRouteTables -func (c *EC2) DescribeRouteTablesRequest(input *DescribeRouteTablesInput) (req *request.Request, output *DescribeRouteTablesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePublicIpv4Pools +func (c *EC2) DescribePublicIpv4PoolsRequest(input *DescribePublicIpv4PoolsInput) (req *request.Request, output *DescribePublicIpv4PoolsOutput) { op := &request.Operation{ - Name: opDescribeRouteTables, + Name: opDescribePublicIpv4Pools, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -17364,632 +19297,550 @@ func (c *EC2) DescribeRouteTablesRequest(input *DescribeRouteTablesInput) (req * } if input == nil { - input = &DescribeRouteTablesInput{} + input = &DescribePublicIpv4PoolsInput{} } - output = &DescribeRouteTablesOutput{} + output = &DescribePublicIpv4PoolsOutput{} 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. +// DescribePublicIpv4Pools API operation for Amazon Elastic Compute Cloud. // -// For more information, see Route Tables (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. +// Describes the specified IPv4 address pools. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation DescribePublicIpv4Pools for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribePublicIpv4Pools +func (c *EC2) DescribePublicIpv4Pools(input *DescribePublicIpv4PoolsInput) (*DescribePublicIpv4PoolsOutput, error) { + req, out := c.DescribePublicIpv4PoolsRequest(input) return out, req.Send() } -// DescribeRouteTablesWithContext is the same as DescribeRouteTables with the addition of +// DescribePublicIpv4PoolsWithContext is the same as DescribePublicIpv4Pools with the addition of // the ability to pass a context and additional request options. // -// See DescribeRouteTables for details on how to use this API operation. +// See DescribePublicIpv4Pools for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeRouteTablesWithContext(ctx aws.Context, input *DescribeRouteTablesInput, opts ...request.Option) (*DescribeRouteTablesOutput, error) { - req, out := c.DescribeRouteTablesRequest(input) +func (c *EC2) DescribePublicIpv4PoolsWithContext(ctx aws.Context, input *DescribePublicIpv4PoolsInput, opts ...request.Option) (*DescribePublicIpv4PoolsOutput, error) { + req, out := c.DescribePublicIpv4PoolsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeRouteTablesPages iterates over the pages of a DescribeRouteTables operation, +// DescribePublicIpv4PoolsPages iterates over the pages of a DescribePublicIpv4Pools operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribeRouteTables method for more information on how to use this operation. +// See DescribePublicIpv4Pools 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 DescribeRouteTables operation. +// // Example iterating over at most 3 pages of a DescribePublicIpv4Pools operation. // pageNum := 0 -// err := client.DescribeRouteTablesPages(params, -// func(page *ec2.DescribeRouteTablesOutput, lastPage bool) bool { +// err := client.DescribePublicIpv4PoolsPages(params, +// func(page *ec2.DescribePublicIpv4PoolsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeRouteTablesPages(input *DescribeRouteTablesInput, fn func(*DescribeRouteTablesOutput, bool) bool) error { - return c.DescribeRouteTablesPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribePublicIpv4PoolsPages(input *DescribePublicIpv4PoolsInput, fn func(*DescribePublicIpv4PoolsOutput, bool) bool) error { + return c.DescribePublicIpv4PoolsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeRouteTablesPagesWithContext same as DescribeRouteTablesPages except +// DescribePublicIpv4PoolsPagesWithContext same as DescribePublicIpv4PoolsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeRouteTablesPagesWithContext(ctx aws.Context, input *DescribeRouteTablesInput, fn func(*DescribeRouteTablesOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribePublicIpv4PoolsPagesWithContext(ctx aws.Context, input *DescribePublicIpv4PoolsInput, fn func(*DescribePublicIpv4PoolsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeRouteTablesInput + var inCpy *DescribePublicIpv4PoolsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeRouteTablesRequest(inCpy) + req, _ := c.DescribePublicIpv4PoolsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeRouteTablesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribePublicIpv4PoolsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeScheduledInstanceAvailability = "DescribeScheduledInstanceAvailability" +const opDescribeRegions = "DescribeRegions" -// DescribeScheduledInstanceAvailabilityRequest generates a "aws/request.Request" representing the -// client's request for the DescribeScheduledInstanceAvailability operation. The "output" return +// DescribeRegionsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeRegions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeScheduledInstanceAvailability for more information on using the DescribeScheduledInstanceAvailability +// See DescribeRegions for more information on using the DescribeRegions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeScheduledInstanceAvailabilityRequest method. -// req, resp := client.DescribeScheduledInstanceAvailabilityRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstanceAvailability -func (c *EC2) DescribeScheduledInstanceAvailabilityRequest(input *DescribeScheduledInstanceAvailabilityInput) (req *request.Request, output *DescribeScheduledInstanceAvailabilityOutput) { +// See also, 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: opDescribeScheduledInstanceAvailability, + Name: opDescribeRegions, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &DescribeScheduledInstanceAvailabilityInput{} + input = &DescribeRegionsInput{} } - output = &DescribeScheduledInstanceAvailabilityOutput{} + output = &DescribeRegionsOutput{} req = c.newRequest(op, input, output) return } -// DescribeScheduledInstanceAvailability API operation for Amazon Elastic Compute Cloud. +// DescribeRegions API operation for Amazon Elastic Compute Cloud. // -// Finds available schedules that meet the specified criteria. +// Describes the Regions that are enabled for your account, or all Regions. // -// 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. +// For a list of the Regions supported by Amazon EC2, see Regions and Endpoints +// (https://docs.aws.amazon.com/general/latest/gr/rande.html#ec2_region). // -// After you find a schedule that meets your needs, call PurchaseScheduledInstances -// to purchase Scheduled Instances with that schedule. +// For information about enabling and disabling Regions for your account, see +// Managing AWS Regions (https://docs.aws.amazon.com/general/latest/gr/rande-manage.html) +// in the AWS 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 Amazon Elastic Compute Cloud's -// API operation DescribeScheduledInstanceAvailability for usage and error information. -// See also, 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) +// API operation DescribeRegions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRegions +func (c *EC2) DescribeRegions(input *DescribeRegionsInput) (*DescribeRegionsOutput, error) { + req, out := c.DescribeRegionsRequest(input) return out, req.Send() } -// DescribeScheduledInstanceAvailabilityWithContext is the same as DescribeScheduledInstanceAvailability with the addition of +// DescribeRegionsWithContext is the same as DescribeRegions with the addition of // the ability to pass a context and additional request options. // -// See DescribeScheduledInstanceAvailability for details on how to use this API operation. +// See DescribeRegions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeScheduledInstanceAvailabilityWithContext(ctx aws.Context, input *DescribeScheduledInstanceAvailabilityInput, opts ...request.Option) (*DescribeScheduledInstanceAvailabilityOutput, error) { - req, out := c.DescribeScheduledInstanceAvailabilityRequest(input) +func (c *EC2) DescribeRegionsWithContext(ctx aws.Context, input *DescribeRegionsInput, opts ...request.Option) (*DescribeRegionsOutput, error) { + req, out := c.DescribeRegionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeScheduledInstanceAvailabilityPages iterates over the pages of a DescribeScheduledInstanceAvailability operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeScheduledInstanceAvailability 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 DescribeScheduledInstanceAvailability operation. -// pageNum := 0 -// err := client.DescribeScheduledInstanceAvailabilityPages(params, -// func(page *ec2.DescribeScheduledInstanceAvailabilityOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeScheduledInstanceAvailabilityPages(input *DescribeScheduledInstanceAvailabilityInput, fn func(*DescribeScheduledInstanceAvailabilityOutput, bool) bool) error { - return c.DescribeScheduledInstanceAvailabilityPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeScheduledInstanceAvailabilityPagesWithContext same as DescribeScheduledInstanceAvailabilityPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeScheduledInstanceAvailabilityPagesWithContext(ctx aws.Context, input *DescribeScheduledInstanceAvailabilityInput, fn func(*DescribeScheduledInstanceAvailabilityOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeScheduledInstanceAvailabilityInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeScheduledInstanceAvailabilityRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScheduledInstanceAvailabilityOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeScheduledInstances = "DescribeScheduledInstances" +const opDescribeReservedInstances = "DescribeReservedInstances" -// DescribeScheduledInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeScheduledInstances operation. The "output" return +// DescribeReservedInstancesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeReservedInstances operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeScheduledInstances for more information on using the DescribeScheduledInstances +// See DescribeReservedInstances for more information on using the DescribeReservedInstances // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeScheduledInstancesRequest method. -// req, resp := client.DescribeScheduledInstancesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstances -func (c *EC2) DescribeScheduledInstancesRequest(input *DescribeScheduledInstancesInput) (req *request.Request, output *DescribeScheduledInstancesOutput) { +// See also, 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: opDescribeScheduledInstances, + Name: opDescribeReservedInstances, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &DescribeScheduledInstancesInput{} + input = &DescribeReservedInstancesInput{} } - output = &DescribeScheduledInstancesOutput{} + output = &DescribeReservedInstancesOutput{} req = c.newRequest(op, input, output) return } -// DescribeScheduledInstances API operation for Amazon Elastic Compute Cloud. +// DescribeReservedInstances API operation for Amazon Elastic Compute Cloud. // -// Describes the specified Scheduled Instances or all your Scheduled Instances. +// Describes one or more of the Reserved Instances that you purchased. +// +// For more information about Reserved Instances, see Reserved Instances (https://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 DescribeScheduledInstances for usage and error information. -// See also, 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) +// API operation DescribeReservedInstances for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstances +func (c *EC2) DescribeReservedInstances(input *DescribeReservedInstancesInput) (*DescribeReservedInstancesOutput, error) { + req, out := c.DescribeReservedInstancesRequest(input) return out, req.Send() } -// DescribeScheduledInstancesWithContext is the same as DescribeScheduledInstances with the addition of +// DescribeReservedInstancesWithContext is the same as DescribeReservedInstances with the addition of // the ability to pass a context and additional request options. // -// See DescribeScheduledInstances for details on how to use this API operation. +// See DescribeReservedInstances for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeScheduledInstancesWithContext(ctx aws.Context, input *DescribeScheduledInstancesInput, opts ...request.Option) (*DescribeScheduledInstancesOutput, error) { - req, out := c.DescribeScheduledInstancesRequest(input) +func (c *EC2) DescribeReservedInstancesWithContext(ctx aws.Context, input *DescribeReservedInstancesInput, opts ...request.Option) (*DescribeReservedInstancesOutput, error) { + req, out := c.DescribeReservedInstancesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeScheduledInstancesPages iterates over the pages of a DescribeScheduledInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeScheduledInstances 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 DescribeScheduledInstances operation. -// pageNum := 0 -// err := client.DescribeScheduledInstancesPages(params, -// func(page *ec2.DescribeScheduledInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeScheduledInstancesPages(input *DescribeScheduledInstancesInput, fn func(*DescribeScheduledInstancesOutput, bool) bool) error { - return c.DescribeScheduledInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeScheduledInstancesPagesWithContext same as DescribeScheduledInstancesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeScheduledInstancesPagesWithContext(ctx aws.Context, input *DescribeScheduledInstancesInput, fn func(*DescribeScheduledInstancesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeScheduledInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeScheduledInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScheduledInstancesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeSecurityGroupReferences = "DescribeSecurityGroupReferences" +const opDescribeReservedInstancesListings = "DescribeReservedInstancesListings" -// DescribeSecurityGroupReferencesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSecurityGroupReferences operation. The "output" return +// DescribeReservedInstancesListingsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeReservedInstancesListings operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeSecurityGroupReferences for more information on using the DescribeSecurityGroupReferences +// See DescribeReservedInstancesListings for more information on using the DescribeReservedInstancesListings // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeSecurityGroupReferencesRequest method. -// req, resp := client.DescribeSecurityGroupReferencesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroupReferences -func (c *EC2) DescribeSecurityGroupReferencesRequest(input *DescribeSecurityGroupReferencesInput) (req *request.Request, output *DescribeSecurityGroupReferencesOutput) { +// See also, 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: opDescribeSecurityGroupReferences, + Name: opDescribeReservedInstancesListings, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeSecurityGroupReferencesInput{} + input = &DescribeReservedInstancesListingsInput{} } - output = &DescribeSecurityGroupReferencesOutput{} + output = &DescribeReservedInstancesListingsOutput{} req = c.newRequest(op, input, output) return } -// DescribeSecurityGroupReferences API operation for Amazon Elastic Compute Cloud. +// DescribeReservedInstancesListings API operation for Amazon Elastic Compute Cloud. // -// [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. +// 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 (https://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 DescribeSecurityGroupReferences for usage and error information. -// See also, 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) +// API operation DescribeReservedInstancesListings for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesListings +func (c *EC2) DescribeReservedInstancesListings(input *DescribeReservedInstancesListingsInput) (*DescribeReservedInstancesListingsOutput, error) { + req, out := c.DescribeReservedInstancesListingsRequest(input) return out, req.Send() } -// DescribeSecurityGroupReferencesWithContext is the same as DescribeSecurityGroupReferences with the addition of +// DescribeReservedInstancesListingsWithContext is the same as DescribeReservedInstancesListings with the addition of // the ability to pass a context and additional request options. // -// See DescribeSecurityGroupReferences for details on how to use this API operation. +// See DescribeReservedInstancesListings for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeSecurityGroupReferencesWithContext(ctx aws.Context, input *DescribeSecurityGroupReferencesInput, opts ...request.Option) (*DescribeSecurityGroupReferencesOutput, error) { - req, out := c.DescribeSecurityGroupReferencesRequest(input) +func (c *EC2) DescribeReservedInstancesListingsWithContext(ctx aws.Context, input *DescribeReservedInstancesListingsInput, opts ...request.Option) (*DescribeReservedInstancesListingsOutput, error) { + req, out := c.DescribeReservedInstancesListingsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeSecurityGroups = "DescribeSecurityGroups" +const opDescribeReservedInstancesModifications = "DescribeReservedInstancesModifications" -// DescribeSecurityGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSecurityGroups operation. The "output" return +// DescribeReservedInstancesModificationsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeReservedInstancesModifications operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeSecurityGroups for more information on using the DescribeSecurityGroups +// See DescribeReservedInstancesModifications for more information on using the DescribeReservedInstancesModifications // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeSecurityGroupsRequest method. -// req, resp := client.DescribeSecurityGroupsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroups -func (c *EC2) DescribeSecurityGroupsRequest(input *DescribeSecurityGroupsInput) (req *request.Request, output *DescribeSecurityGroupsOutput) { +// See also, 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: opDescribeSecurityGroups, + Name: opDescribeReservedInstancesModifications, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", + LimitToken: "", TruncationToken: "", }, } if input == nil { - input = &DescribeSecurityGroupsInput{} + input = &DescribeReservedInstancesModificationsInput{} } - output = &DescribeSecurityGroupsOutput{} + output = &DescribeReservedInstancesModificationsOutput{} req = c.newRequest(op, input, output) return } -// DescribeSecurityGroups API operation for Amazon Elastic Compute Cloud. +// DescribeReservedInstancesModifications API operation for Amazon Elastic Compute Cloud. // -// Describes the specified security groups or all of your security groups. +// 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. // -// 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 -// (https://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 (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_SecurityGroups.html) -// in the Amazon Virtual Private Cloud User Guide. +// For more information, see Modifying Reserved Instances (https://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 DescribeSecurityGroups for usage and error information. -// See also, 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) +// API operation DescribeReservedInstancesModifications for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesModifications +func (c *EC2) DescribeReservedInstancesModifications(input *DescribeReservedInstancesModificationsInput) (*DescribeReservedInstancesModificationsOutput, error) { + req, out := c.DescribeReservedInstancesModificationsRequest(input) return out, req.Send() } -// DescribeSecurityGroupsWithContext is the same as DescribeSecurityGroups with the addition of +// DescribeReservedInstancesModificationsWithContext is the same as DescribeReservedInstancesModifications with the addition of // the ability to pass a context and additional request options. // -// See DescribeSecurityGroups for details on how to use this API operation. +// See DescribeReservedInstancesModifications for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeSecurityGroupsWithContext(ctx aws.Context, input *DescribeSecurityGroupsInput, opts ...request.Option) (*DescribeSecurityGroupsOutput, error) { - req, out := c.DescribeSecurityGroupsRequest(input) +func (c *EC2) DescribeReservedInstancesModificationsWithContext(ctx aws.Context, input *DescribeReservedInstancesModificationsInput, opts ...request.Option) (*DescribeReservedInstancesModificationsOutput, error) { + req, out := c.DescribeReservedInstancesModificationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeSecurityGroupsPages iterates over the pages of a DescribeSecurityGroups operation, +// 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 DescribeSecurityGroups method for more information on how to use this operation. +// 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 DescribeSecurityGroups operation. +// // Example iterating over at most 3 pages of a DescribeReservedInstancesModifications operation. // pageNum := 0 -// err := client.DescribeSecurityGroupsPages(params, -// func(page *ec2.DescribeSecurityGroupsOutput, lastPage bool) bool { +// err := client.DescribeReservedInstancesModificationsPages(params, +// func(page *ec2.DescribeReservedInstancesModificationsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeSecurityGroupsPages(input *DescribeSecurityGroupsInput, fn func(*DescribeSecurityGroupsOutput, bool) bool) error { - return c.DescribeSecurityGroupsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeReservedInstancesModificationsPages(input *DescribeReservedInstancesModificationsInput, fn func(*DescribeReservedInstancesModificationsOutput, bool) bool) error { + return c.DescribeReservedInstancesModificationsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeSecurityGroupsPagesWithContext same as DescribeSecurityGroupsPages except +// DescribeReservedInstancesModificationsPagesWithContext same as DescribeReservedInstancesModificationsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeSecurityGroupsPagesWithContext(ctx aws.Context, input *DescribeSecurityGroupsInput, fn func(*DescribeSecurityGroupsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeReservedInstancesModificationsPagesWithContext(ctx aws.Context, input *DescribeReservedInstancesModificationsInput, fn func(*DescribeReservedInstancesModificationsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeSecurityGroupsInput + var inCpy *DescribeReservedInstancesModificationsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeSecurityGroupsRequest(inCpy) + req, _ := c.DescribeReservedInstancesModificationsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSecurityGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReservedInstancesModificationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeSnapshotAttribute = "DescribeSnapshotAttribute" +const opDescribeReservedInstancesOfferings = "DescribeReservedInstancesOfferings" -// DescribeSnapshotAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSnapshotAttribute operation. The "output" return +// DescribeReservedInstancesOfferingsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeReservedInstancesOfferings operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeSnapshotAttribute for more information on using the DescribeSnapshotAttribute +// See DescribeReservedInstancesOfferings for more information on using the DescribeReservedInstancesOfferings // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeSnapshotAttributeRequest method. -// req, resp := client.DescribeSnapshotAttributeRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshotAttribute -func (c *EC2) DescribeSnapshotAttributeRequest(input *DescribeSnapshotAttributeInput) (req *request.Request, output *DescribeSnapshotAttributeOutput) { +// See also, 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: opDescribeSnapshotAttribute, + Name: opDescribeReservedInstancesOfferings, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DescribeSnapshotAttributeInput{} + input = &DescribeReservedInstancesOfferingsInput{} } - output = &DescribeSnapshotAttributeOutput{} + output = &DescribeReservedInstancesOfferingsOutput{} req = c.newRequest(op, input, output) return } -// DescribeSnapshotAttribute API operation for Amazon Elastic Compute Cloud. +// DescribeReservedInstancesOfferings API operation for Amazon Elastic Compute Cloud. // -// Describes the specified attribute of the specified snapshot. You can specify -// only one attribute at a time. +// 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. // -// For more information about EBS snapshots, see Amazon EBS Snapshots (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html) +// 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 (https://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 @@ -17997,58 +19848,110 @@ func (c *EC2) DescribeSnapshotAttributeRequest(input *DescribeSnapshotAttributeI // the error. // // See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeSnapshotAttribute for usage and error information. -// See also, 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) +// API operation DescribeReservedInstancesOfferings for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeReservedInstancesOfferings +func (c *EC2) DescribeReservedInstancesOfferings(input *DescribeReservedInstancesOfferingsInput) (*DescribeReservedInstancesOfferingsOutput, error) { + req, out := c.DescribeReservedInstancesOfferingsRequest(input) return out, req.Send() } -// DescribeSnapshotAttributeWithContext is the same as DescribeSnapshotAttribute with the addition of +// DescribeReservedInstancesOfferingsWithContext is the same as DescribeReservedInstancesOfferings with the addition of // the ability to pass a context and additional request options. // -// See DescribeSnapshotAttribute for details on how to use this API operation. +// See DescribeReservedInstancesOfferings for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeSnapshotAttributeWithContext(ctx aws.Context, input *DescribeSnapshotAttributeInput, opts ...request.Option) (*DescribeSnapshotAttributeOutput, error) { - req, out := c.DescribeSnapshotAttributeRequest(input) +func (c *EC2) DescribeReservedInstancesOfferingsWithContext(ctx aws.Context, input *DescribeReservedInstancesOfferingsInput, opts ...request.Option) (*DescribeReservedInstancesOfferingsOutput, error) { + req, out := c.DescribeReservedInstancesOfferingsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeSnapshots = "DescribeSnapshots" +// 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 *ec2.DescribeReservedInstancesOfferingsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeReservedInstancesOfferingsPages(input *DescribeReservedInstancesOfferingsInput, fn func(*DescribeReservedInstancesOfferingsOutput, bool) bool) error { + return c.DescribeReservedInstancesOfferingsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// DescribeSnapshotsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSnapshots operation. The "output" return +// DescribeReservedInstancesOfferingsPagesWithContext same as DescribeReservedInstancesOfferingsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeReservedInstancesOfferingsPagesWithContext(ctx aws.Context, input *DescribeReservedInstancesOfferingsInput, fn func(*DescribeReservedInstancesOfferingsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeReservedInstancesOfferingsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeReservedInstancesOfferingsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeReservedInstancesOfferingsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeRouteTables = "DescribeRouteTables" + +// DescribeRouteTablesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeRouteTables operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeSnapshots for more information on using the DescribeSnapshots +// See DescribeRouteTables for more information on using the DescribeRouteTables // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeSnapshotsRequest method. -// req, resp := client.DescribeSnapshotsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshots -func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *request.Request, output *DescribeSnapshotsOutput) { +// See also, 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: opDescribeSnapshots, + Name: opDescribeRouteTables, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -18060,401 +19963,482 @@ func (c *EC2) DescribeSnapshotsRequest(input *DescribeSnapshotsInput) (req *requ } if input == nil { - input = &DescribeSnapshotsInput{} + input = &DescribeRouteTablesInput{} } - output = &DescribeSnapshotsOutput{} + output = &DescribeRouteTablesOutput{} req = c.newRequest(op, input, output) return } -// DescribeSnapshots API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified EBS snapshots available to you or all of the EBS -// snapshots available to you. -// -// The snapshots available to you include public snapshots, private snapshots -// that you own, and private snapshots owned by other AWS accounts for which -// you have 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. +// DescribeRouteTables API operation for Amazon Elastic Compute Cloud. // -// 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. +// Describes one or more of your route tables. // -// 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. +// 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 EBS snapshots, see Amazon EBS Snapshots (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSSnapshots.html) -// in the Amazon Elastic Compute Cloud User Guide. +// For more information, see Route Tables (https://docs.aws.amazon.com/vpc/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 DescribeSnapshots for usage and error information. -// See also, 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) +// API operation DescribeRouteTables for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeRouteTables +func (c *EC2) DescribeRouteTables(input *DescribeRouteTablesInput) (*DescribeRouteTablesOutput, error) { + req, out := c.DescribeRouteTablesRequest(input) return out, req.Send() } -// DescribeSnapshotsWithContext is the same as DescribeSnapshots with the addition of +// DescribeRouteTablesWithContext is the same as DescribeRouteTables with the addition of // the ability to pass a context and additional request options. // -// See DescribeSnapshots for details on how to use this API operation. +// See DescribeRouteTables for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeSnapshotsWithContext(ctx aws.Context, input *DescribeSnapshotsInput, opts ...request.Option) (*DescribeSnapshotsOutput, error) { - req, out := c.DescribeSnapshotsRequest(input) +func (c *EC2) DescribeRouteTablesWithContext(ctx aws.Context, input *DescribeRouteTablesInput, opts ...request.Option) (*DescribeRouteTablesOutput, error) { + req, out := c.DescribeRouteTablesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeSnapshotsPages iterates over the pages of a DescribeSnapshots operation, +// DescribeRouteTablesPages iterates over the pages of a DescribeRouteTables 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. +// See DescribeRouteTables 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. +// // Example iterating over at most 3 pages of a DescribeRouteTables operation. // pageNum := 0 -// err := client.DescribeSnapshotsPages(params, -// func(page *ec2.DescribeSnapshotsOutput, lastPage bool) bool { +// err := client.DescribeRouteTablesPages(params, +// func(page *ec2.DescribeRouteTablesOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeSnapshotsPages(input *DescribeSnapshotsInput, fn func(*DescribeSnapshotsOutput, bool) bool) error { - return c.DescribeSnapshotsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeRouteTablesPages(input *DescribeRouteTablesInput, fn func(*DescribeRouteTablesOutput, bool) bool) error { + return c.DescribeRouteTablesPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeSnapshotsPagesWithContext same as DescribeSnapshotsPages except +// DescribeRouteTablesPagesWithContext same as DescribeRouteTablesPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeSnapshotsPagesWithContext(ctx aws.Context, input *DescribeSnapshotsInput, fn func(*DescribeSnapshotsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeRouteTablesPagesWithContext(ctx aws.Context, input *DescribeRouteTablesInput, fn func(*DescribeRouteTablesOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeSnapshotsInput + var inCpy *DescribeRouteTablesInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeSnapshotsRequest(inCpy) + req, _ := c.DescribeRouteTablesRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSnapshotsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeRouteTablesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeSpotDatafeedSubscription = "DescribeSpotDatafeedSubscription" +const opDescribeScheduledInstanceAvailability = "DescribeScheduledInstanceAvailability" -// DescribeSpotDatafeedSubscriptionRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotDatafeedSubscription operation. The "output" return +// DescribeScheduledInstanceAvailabilityRequest generates a "aws/request.Request" representing the +// client's request for the DescribeScheduledInstanceAvailability operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeSpotDatafeedSubscription for more information on using the DescribeSpotDatafeedSubscription +// See DescribeScheduledInstanceAvailability for more information on using the DescribeScheduledInstanceAvailability // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeSpotDatafeedSubscriptionRequest method. -// req, resp := client.DescribeSpotDatafeedSubscriptionRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotDatafeedSubscription -func (c *EC2) DescribeSpotDatafeedSubscriptionRequest(input *DescribeSpotDatafeedSubscriptionInput) (req *request.Request, output *DescribeSpotDatafeedSubscriptionOutput) { +// See also, 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: opDescribeSpotDatafeedSubscription, + Name: opDescribeScheduledInstanceAvailability, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DescribeSpotDatafeedSubscriptionInput{} + input = &DescribeScheduledInstanceAvailabilityInput{} } - output = &DescribeSpotDatafeedSubscriptionOutput{} + output = &DescribeScheduledInstanceAvailabilityOutput{} req = c.newRequest(op, input, output) return } -// DescribeSpotDatafeedSubscription API operation for Amazon Elastic Compute Cloud. +// DescribeScheduledInstanceAvailability API operation for Amazon Elastic Compute Cloud. // -// Describes the data feed for Spot Instances. For more information, see Spot -// Instance Data Feed (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) -// in the Amazon EC2 User Guide for Linux Instances. +// 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 DescribeSpotDatafeedSubscription for usage and error information. -// See also, 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) +// API operation DescribeScheduledInstanceAvailability for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstanceAvailability +func (c *EC2) DescribeScheduledInstanceAvailability(input *DescribeScheduledInstanceAvailabilityInput) (*DescribeScheduledInstanceAvailabilityOutput, error) { + req, out := c.DescribeScheduledInstanceAvailabilityRequest(input) return out, req.Send() } -// DescribeSpotDatafeedSubscriptionWithContext is the same as DescribeSpotDatafeedSubscription with the addition of +// DescribeScheduledInstanceAvailabilityWithContext is the same as DescribeScheduledInstanceAvailability with the addition of // the ability to pass a context and additional request options. // -// See DescribeSpotDatafeedSubscription for details on how to use this API operation. +// See DescribeScheduledInstanceAvailability for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeSpotDatafeedSubscriptionWithContext(ctx aws.Context, input *DescribeSpotDatafeedSubscriptionInput, opts ...request.Option) (*DescribeSpotDatafeedSubscriptionOutput, error) { - req, out := c.DescribeSpotDatafeedSubscriptionRequest(input) +func (c *EC2) DescribeScheduledInstanceAvailabilityWithContext(ctx aws.Context, input *DescribeScheduledInstanceAvailabilityInput, opts ...request.Option) (*DescribeScheduledInstanceAvailabilityOutput, error) { + req, out := c.DescribeScheduledInstanceAvailabilityRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeSpotFleetInstances = "DescribeSpotFleetInstances" +// DescribeScheduledInstanceAvailabilityPages iterates over the pages of a DescribeScheduledInstanceAvailability operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeScheduledInstanceAvailability 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 DescribeScheduledInstanceAvailability operation. +// pageNum := 0 +// err := client.DescribeScheduledInstanceAvailabilityPages(params, +// func(page *ec2.DescribeScheduledInstanceAvailabilityOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeScheduledInstanceAvailabilityPages(input *DescribeScheduledInstanceAvailabilityInput, fn func(*DescribeScheduledInstanceAvailabilityOutput, bool) bool) error { + return c.DescribeScheduledInstanceAvailabilityPagesWithContext(aws.BackgroundContext(), input, fn) +} -// DescribeSpotFleetInstancesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotFleetInstances operation. The "output" return +// DescribeScheduledInstanceAvailabilityPagesWithContext same as DescribeScheduledInstanceAvailabilityPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeScheduledInstanceAvailabilityPagesWithContext(ctx aws.Context, input *DescribeScheduledInstanceAvailabilityInput, fn func(*DescribeScheduledInstanceAvailabilityOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeScheduledInstanceAvailabilityInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeScheduledInstanceAvailabilityRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeScheduledInstanceAvailabilityOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeScheduledInstances = "DescribeScheduledInstances" + +// DescribeScheduledInstancesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeScheduledInstances operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeSpotFleetInstances for more information on using the DescribeSpotFleetInstances +// See DescribeScheduledInstances for more information on using the DescribeScheduledInstances // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeSpotFleetInstancesRequest method. -// req, resp := client.DescribeSpotFleetInstancesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetInstances -func (c *EC2) DescribeSpotFleetInstancesRequest(input *DescribeSpotFleetInstancesInput) (req *request.Request, output *DescribeSpotFleetInstancesOutput) { +// See also, 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: opDescribeSpotFleetInstances, + Name: opDescribeScheduledInstances, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DescribeSpotFleetInstancesInput{} + input = &DescribeScheduledInstancesInput{} } - output = &DescribeSpotFleetInstancesOutput{} + output = &DescribeScheduledInstancesOutput{} req = c.newRequest(op, input, output) return } -// DescribeSpotFleetInstances API operation for Amazon Elastic Compute Cloud. +// DescribeScheduledInstances API operation for Amazon Elastic Compute Cloud. // -// Describes the running instances for the specified Spot Fleet. +// Describes the specified Scheduled Instances or all 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 DescribeSpotFleetInstances for usage and error information. -// See also, 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) +// API operation DescribeScheduledInstances for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeScheduledInstances +func (c *EC2) DescribeScheduledInstances(input *DescribeScheduledInstancesInput) (*DescribeScheduledInstancesOutput, error) { + req, out := c.DescribeScheduledInstancesRequest(input) return out, req.Send() } -// DescribeSpotFleetInstancesWithContext is the same as DescribeSpotFleetInstances with the addition of +// DescribeScheduledInstancesWithContext is the same as DescribeScheduledInstances with the addition of // the ability to pass a context and additional request options. // -// See DescribeSpotFleetInstances for details on how to use this API operation. +// See DescribeScheduledInstances for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeSpotFleetInstancesWithContext(ctx aws.Context, input *DescribeSpotFleetInstancesInput, opts ...request.Option) (*DescribeSpotFleetInstancesOutput, error) { - req, out := c.DescribeSpotFleetInstancesRequest(input) +func (c *EC2) DescribeScheduledInstancesWithContext(ctx aws.Context, input *DescribeScheduledInstancesInput, opts ...request.Option) (*DescribeScheduledInstancesOutput, error) { + req, out := c.DescribeScheduledInstancesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeSpotFleetRequestHistory = "DescribeSpotFleetRequestHistory" +// DescribeScheduledInstancesPages iterates over the pages of a DescribeScheduledInstances operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeScheduledInstances 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 DescribeScheduledInstances operation. +// pageNum := 0 +// err := client.DescribeScheduledInstancesPages(params, +// func(page *ec2.DescribeScheduledInstancesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeScheduledInstancesPages(input *DescribeScheduledInstancesInput, fn func(*DescribeScheduledInstancesOutput, bool) bool) error { + return c.DescribeScheduledInstancesPagesWithContext(aws.BackgroundContext(), input, fn) +} -// DescribeSpotFleetRequestHistoryRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotFleetRequestHistory operation. The "output" return +// DescribeScheduledInstancesPagesWithContext same as DescribeScheduledInstancesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeScheduledInstancesPagesWithContext(ctx aws.Context, input *DescribeScheduledInstancesInput, fn func(*DescribeScheduledInstancesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeScheduledInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeScheduledInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeScheduledInstancesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeSecurityGroupReferences = "DescribeSecurityGroupReferences" + +// DescribeSecurityGroupReferencesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeSecurityGroupReferences operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeSpotFleetRequestHistory for more information on using the DescribeSpotFleetRequestHistory +// See DescribeSecurityGroupReferences for more information on using the DescribeSecurityGroupReferences // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeSpotFleetRequestHistoryRequest method. -// req, resp := client.DescribeSpotFleetRequestHistoryRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequestHistory -func (c *EC2) DescribeSpotFleetRequestHistoryRequest(input *DescribeSpotFleetRequestHistoryInput) (req *request.Request, output *DescribeSpotFleetRequestHistoryOutput) { +// See also, 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: opDescribeSpotFleetRequestHistory, + Name: opDescribeSecurityGroupReferences, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeSpotFleetRequestHistoryInput{} + input = &DescribeSecurityGroupReferencesInput{} } - output = &DescribeSpotFleetRequestHistoryOutput{} + output = &DescribeSecurityGroupReferencesOutput{} 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. +// DescribeSecurityGroupReferences API operation for Amazon Elastic Compute Cloud. // -// 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. Spot Fleet events are available for 48 hours. +// [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 DescribeSpotFleetRequestHistory for usage and error information. -// See also, 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) +// API operation DescribeSecurityGroupReferences for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroupReferences +func (c *EC2) DescribeSecurityGroupReferences(input *DescribeSecurityGroupReferencesInput) (*DescribeSecurityGroupReferencesOutput, error) { + req, out := c.DescribeSecurityGroupReferencesRequest(input) return out, req.Send() } -// DescribeSpotFleetRequestHistoryWithContext is the same as DescribeSpotFleetRequestHistory with the addition of +// DescribeSecurityGroupReferencesWithContext is the same as DescribeSecurityGroupReferences with the addition of // the ability to pass a context and additional request options. // -// See DescribeSpotFleetRequestHistory for details on how to use this API operation. +// See DescribeSecurityGroupReferences for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeSpotFleetRequestHistoryWithContext(ctx aws.Context, input *DescribeSpotFleetRequestHistoryInput, opts ...request.Option) (*DescribeSpotFleetRequestHistoryOutput, error) { - req, out := c.DescribeSpotFleetRequestHistoryRequest(input) +func (c *EC2) DescribeSecurityGroupReferencesWithContext(ctx aws.Context, input *DescribeSecurityGroupReferencesInput, opts ...request.Option) (*DescribeSecurityGroupReferencesOutput, error) { + req, out := c.DescribeSecurityGroupReferencesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeSpotFleetRequests = "DescribeSpotFleetRequests" +const opDescribeSecurityGroups = "DescribeSecurityGroups" -// DescribeSpotFleetRequestsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotFleetRequests operation. The "output" return +// DescribeSecurityGroupsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeSecurityGroups operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeSpotFleetRequests for more information on using the DescribeSpotFleetRequests +// See DescribeSecurityGroups for more information on using the DescribeSecurityGroups // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeSpotFleetRequestsRequest method. -// req, resp := client.DescribeSpotFleetRequestsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequests -func (c *EC2) DescribeSpotFleetRequestsRequest(input *DescribeSpotFleetRequestsInput) (req *request.Request, output *DescribeSpotFleetRequestsOutput) { +// See also, 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: opDescribeSpotFleetRequests, + Name: opDescribeSecurityGroups, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -18466,274 +20450,212 @@ func (c *EC2) DescribeSpotFleetRequestsRequest(input *DescribeSpotFleetRequestsI } if input == nil { - input = &DescribeSpotFleetRequestsInput{} + input = &DescribeSecurityGroupsInput{} } - output = &DescribeSpotFleetRequestsOutput{} + output = &DescribeSecurityGroupsOutput{} req = c.newRequest(op, input, output) return } -// DescribeSpotFleetRequests API operation for Amazon Elastic Compute Cloud. +// DescribeSecurityGroups API operation for Amazon Elastic Compute Cloud. // -// Describes your Spot Fleet requests. +// Describes the specified security groups or all of your security groups. // -// Spot Fleet requests are deleted 48 hours after they are canceled and their -// instances are terminated. +// 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 +// (https://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 (https://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 DescribeSpotFleetRequests for usage and error information. -// See also, 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) +// API operation DescribeSecurityGroups for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSecurityGroups +func (c *EC2) DescribeSecurityGroups(input *DescribeSecurityGroupsInput) (*DescribeSecurityGroupsOutput, error) { + req, out := c.DescribeSecurityGroupsRequest(input) return out, req.Send() } -// DescribeSpotFleetRequestsWithContext is the same as DescribeSpotFleetRequests with the addition of +// DescribeSecurityGroupsWithContext is the same as DescribeSecurityGroups with the addition of // the ability to pass a context and additional request options. // -// See DescribeSpotFleetRequests for details on how to use this API operation. +// See DescribeSecurityGroups for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeSpotFleetRequestsWithContext(ctx aws.Context, input *DescribeSpotFleetRequestsInput, opts ...request.Option) (*DescribeSpotFleetRequestsOutput, error) { - req, out := c.DescribeSpotFleetRequestsRequest(input) +func (c *EC2) DescribeSecurityGroupsWithContext(ctx aws.Context, input *DescribeSecurityGroupsInput, opts ...request.Option) (*DescribeSecurityGroupsOutput, error) { + req, out := c.DescribeSecurityGroupsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeSpotFleetRequestsPages iterates over the pages of a DescribeSpotFleetRequests operation, +// DescribeSecurityGroupsPages iterates over the pages of a DescribeSecurityGroups 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. +// See DescribeSecurityGroups 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. +// // Example iterating over at most 3 pages of a DescribeSecurityGroups operation. // pageNum := 0 -// err := client.DescribeSpotFleetRequestsPages(params, -// func(page *ec2.DescribeSpotFleetRequestsOutput, lastPage bool) bool { +// err := client.DescribeSecurityGroupsPages(params, +// func(page *ec2.DescribeSecurityGroupsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeSpotFleetRequestsPages(input *DescribeSpotFleetRequestsInput, fn func(*DescribeSpotFleetRequestsOutput, bool) bool) error { - return c.DescribeSpotFleetRequestsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeSecurityGroupsPages(input *DescribeSecurityGroupsInput, fn func(*DescribeSecurityGroupsOutput, bool) bool) error { + return c.DescribeSecurityGroupsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeSpotFleetRequestsPagesWithContext same as DescribeSpotFleetRequestsPages except +// DescribeSecurityGroupsPagesWithContext same as DescribeSecurityGroupsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeSpotFleetRequestsPagesWithContext(ctx aws.Context, input *DescribeSpotFleetRequestsInput, fn func(*DescribeSpotFleetRequestsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeSecurityGroupsPagesWithContext(ctx aws.Context, input *DescribeSecurityGroupsInput, fn func(*DescribeSecurityGroupsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeSpotFleetRequestsInput + var inCpy *DescribeSecurityGroupsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeSpotFleetRequestsRequest(inCpy) + req, _ := c.DescribeSecurityGroupsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSpotFleetRequestsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeSecurityGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeSpotInstanceRequests = "DescribeSpotInstanceRequests" +const opDescribeSnapshotAttribute = "DescribeSnapshotAttribute" -// DescribeSpotInstanceRequestsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotInstanceRequests operation. The "output" return +// DescribeSnapshotAttributeRequest generates a "aws/request.Request" representing the +// client's request for the DescribeSnapshotAttribute operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeSpotInstanceRequests for more information on using the DescribeSpotInstanceRequests +// See DescribeSnapshotAttribute for more information on using the DescribeSnapshotAttribute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeSpotInstanceRequestsRequest method. -// req, resp := client.DescribeSpotInstanceRequestsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotInstanceRequests -func (c *EC2) DescribeSpotInstanceRequestsRequest(input *DescribeSpotInstanceRequestsInput) (req *request.Request, output *DescribeSpotInstanceRequestsOutput) { +// See also, 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: opDescribeSpotInstanceRequests, + Name: opDescribeSnapshotAttribute, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &DescribeSpotInstanceRequestsInput{} + input = &DescribeSnapshotAttributeInput{} } - output = &DescribeSpotInstanceRequestsOutput{} + output = &DescribeSnapshotAttributeOutput{} req = c.newRequest(op, input, output) return } -// DescribeSpotInstanceRequests API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified Spot Instance requests. -// -// 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. +// DescribeSnapshotAttribute API operation for Amazon Elastic Compute Cloud. // -// We recommend that you set MaxResults to a value between 5 and 1000 to limit -// the number of results returned. This paginates the output, which makes the -// list more manageable and returns the results faster. 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 DescribeSpotInstanceRequests -// request to retrieve the remaining results. +// Describes the specified attribute of the specified snapshot. You can specify +// only one attribute at a time. // -// Spot Instance requests are deleted four hours after they are canceled and -// their instances are terminated. +// For more information about EBS snapshots, see Amazon EBS Snapshots (https://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 DescribeSpotInstanceRequests for usage and error information. -// See also, 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) +// API operation DescribeSnapshotAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshotAttribute +func (c *EC2) DescribeSnapshotAttribute(input *DescribeSnapshotAttributeInput) (*DescribeSnapshotAttributeOutput, error) { + req, out := c.DescribeSnapshotAttributeRequest(input) return out, req.Send() } -// DescribeSpotInstanceRequestsWithContext is the same as DescribeSpotInstanceRequests with the addition of +// DescribeSnapshotAttributeWithContext is the same as DescribeSnapshotAttribute with the addition of // the ability to pass a context and additional request options. // -// See DescribeSpotInstanceRequests for details on how to use this API operation. +// See DescribeSnapshotAttribute for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeSpotInstanceRequestsWithContext(ctx aws.Context, input *DescribeSpotInstanceRequestsInput, opts ...request.Option) (*DescribeSpotInstanceRequestsOutput, error) { - req, out := c.DescribeSpotInstanceRequestsRequest(input) +func (c *EC2) DescribeSnapshotAttributeWithContext(ctx aws.Context, input *DescribeSnapshotAttributeInput, opts ...request.Option) (*DescribeSnapshotAttributeOutput, error) { + req, out := c.DescribeSnapshotAttributeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeSpotInstanceRequestsPages iterates over the pages of a DescribeSpotInstanceRequests operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeSpotInstanceRequests 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 DescribeSpotInstanceRequests operation. -// pageNum := 0 -// err := client.DescribeSpotInstanceRequestsPages(params, -// func(page *ec2.DescribeSpotInstanceRequestsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeSpotInstanceRequestsPages(input *DescribeSpotInstanceRequestsInput, fn func(*DescribeSpotInstanceRequestsOutput, bool) bool) error { - return c.DescribeSpotInstanceRequestsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeSpotInstanceRequestsPagesWithContext same as DescribeSpotInstanceRequestsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSpotInstanceRequestsPagesWithContext(ctx aws.Context, input *DescribeSpotInstanceRequestsInput, fn func(*DescribeSpotInstanceRequestsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeSpotInstanceRequestsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeSpotInstanceRequestsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSpotInstanceRequestsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeSpotPriceHistory = "DescribeSpotPriceHistory" +const opDescribeSnapshots = "DescribeSnapshots" -// DescribeSpotPriceHistoryRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSpotPriceHistory operation. The "output" return +// DescribeSnapshotsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeSnapshots operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeSpotPriceHistory for more information on using the DescribeSpotPriceHistory +// See DescribeSnapshots for more information on using the DescribeSnapshots // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeSpotPriceHistoryRequest method. -// req, resp := client.DescribeSpotPriceHistoryRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotPriceHistory -func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInput) (req *request.Request, output *DescribeSpotPriceHistoryOutput) { +// See also, 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: opDescribeSpotPriceHistory, + Name: opDescribeSnapshots, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -18745,531 +20667,405 @@ func (c *EC2) DescribeSpotPriceHistoryRequest(input *DescribeSpotPriceHistoryInp } if input == nil { - input = &DescribeSpotPriceHistoryInput{} + input = &DescribeSnapshotsInput{} } - output = &DescribeSpotPriceHistoryOutput{} + output = &DescribeSnapshotsOutput{} req = c.newRequest(op, input, output) return } -// DescribeSpotPriceHistory API operation for Amazon Elastic Compute Cloud. +// DescribeSnapshots API operation for Amazon Elastic Compute Cloud. // -// Describes the Spot price history. For more information, see Spot Instance -// Pricing History (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances-history.html) -// in the Amazon EC2 User Guide for Linux Instances. +// Describes the specified EBS snapshots available to you or all of the EBS +// snapshots available to you. // -// 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. +// The snapshots available to you include public snapshots, private snapshots +// that you own, and private snapshots owned by other AWS accounts for which +// you have 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 filtered 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. +// +// To get the state of fast snapshot restores for a snapshot, use DescribeFastSnapshotRestores. +// +// For more information about EBS snapshots, see Amazon EBS Snapshots (https://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 DescribeSpotPriceHistory for usage and error information. -// See also, 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) +// API operation DescribeSnapshots for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSnapshots +func (c *EC2) DescribeSnapshots(input *DescribeSnapshotsInput) (*DescribeSnapshotsOutput, error) { + req, out := c.DescribeSnapshotsRequest(input) return out, req.Send() } -// DescribeSpotPriceHistoryWithContext is the same as DescribeSpotPriceHistory with the addition of +// DescribeSnapshotsWithContext is the same as DescribeSnapshots with the addition of // the ability to pass a context and additional request options. // -// See DescribeSpotPriceHistory for details on how to use this API operation. +// See DescribeSnapshots for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeSpotPriceHistoryWithContext(ctx aws.Context, input *DescribeSpotPriceHistoryInput, opts ...request.Option) (*DescribeSpotPriceHistoryOutput, error) { - req, out := c.DescribeSpotPriceHistoryRequest(input) +func (c *EC2) DescribeSnapshotsWithContext(ctx aws.Context, input *DescribeSnapshotsInput, opts ...request.Option) (*DescribeSnapshotsOutput, error) { + req, out := c.DescribeSnapshotsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeSpotPriceHistoryPages iterates over the pages of a DescribeSpotPriceHistory operation, +// 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 DescribeSpotPriceHistory method for more information on how to use this operation. +// 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 DescribeSpotPriceHistory operation. +// // Example iterating over at most 3 pages of a DescribeSnapshots operation. // pageNum := 0 -// err := client.DescribeSpotPriceHistoryPages(params, -// func(page *ec2.DescribeSpotPriceHistoryOutput, lastPage bool) bool { +// err := client.DescribeSnapshotsPages(params, +// func(page *ec2.DescribeSnapshotsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeSpotPriceHistoryPages(input *DescribeSpotPriceHistoryInput, fn func(*DescribeSpotPriceHistoryOutput, bool) bool) error { - return c.DescribeSpotPriceHistoryPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeSnapshotsPages(input *DescribeSnapshotsInput, fn func(*DescribeSnapshotsOutput, bool) bool) error { + return c.DescribeSnapshotsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeSpotPriceHistoryPagesWithContext same as DescribeSpotPriceHistoryPages except +// DescribeSnapshotsPagesWithContext same as DescribeSnapshotsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeSpotPriceHistoryPagesWithContext(ctx aws.Context, input *DescribeSpotPriceHistoryInput, fn func(*DescribeSpotPriceHistoryOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeSnapshotsPagesWithContext(ctx aws.Context, input *DescribeSnapshotsInput, fn func(*DescribeSnapshotsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeSpotPriceHistoryInput + var inCpy *DescribeSnapshotsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeSpotPriceHistoryRequest(inCpy) + req, _ := c.DescribeSnapshotsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSpotPriceHistoryOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeSnapshotsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeStaleSecurityGroups = "DescribeStaleSecurityGroups" +const opDescribeSpotDatafeedSubscription = "DescribeSpotDatafeedSubscription" -// DescribeStaleSecurityGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeStaleSecurityGroups operation. The "output" return +// DescribeSpotDatafeedSubscriptionRequest generates a "aws/request.Request" representing the +// client's request for the DescribeSpotDatafeedSubscription operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeStaleSecurityGroups for more information on using the DescribeStaleSecurityGroups +// See DescribeSpotDatafeedSubscription for more information on using the DescribeSpotDatafeedSubscription // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeStaleSecurityGroupsRequest method. -// req, resp := client.DescribeStaleSecurityGroupsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeStaleSecurityGroups -func (c *EC2) DescribeStaleSecurityGroupsRequest(input *DescribeStaleSecurityGroupsInput) (req *request.Request, output *DescribeStaleSecurityGroupsOutput) { +// See also, 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: opDescribeStaleSecurityGroups, + Name: opDescribeSpotDatafeedSubscription, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &DescribeStaleSecurityGroupsInput{} + input = &DescribeSpotDatafeedSubscriptionInput{} } - output = &DescribeStaleSecurityGroupsOutput{} + output = &DescribeSpotDatafeedSubscriptionOutput{} req = c.newRequest(op, input, output) return } -// DescribeStaleSecurityGroups API operation for Amazon Elastic Compute Cloud. +// DescribeSpotDatafeedSubscription API operation for Amazon Elastic Compute Cloud. // -// [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. +// Describes the data feed for Spot Instances. For more information, see Spot +// Instance Data Feed (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-data-feeds.html) +// in the Amazon EC2 User Guide for Linux 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 DescribeStaleSecurityGroups for usage and error information. -// See also, 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) +// API operation DescribeSpotDatafeedSubscription for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotDatafeedSubscription +func (c *EC2) DescribeSpotDatafeedSubscription(input *DescribeSpotDatafeedSubscriptionInput) (*DescribeSpotDatafeedSubscriptionOutput, error) { + req, out := c.DescribeSpotDatafeedSubscriptionRequest(input) return out, req.Send() } -// DescribeStaleSecurityGroupsWithContext is the same as DescribeStaleSecurityGroups with the addition of +// DescribeSpotDatafeedSubscriptionWithContext is the same as DescribeSpotDatafeedSubscription with the addition of // the ability to pass a context and additional request options. // -// See DescribeStaleSecurityGroups for details on how to use this API operation. +// See DescribeSpotDatafeedSubscription for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeStaleSecurityGroupsWithContext(ctx aws.Context, input *DescribeStaleSecurityGroupsInput, opts ...request.Option) (*DescribeStaleSecurityGroupsOutput, error) { - req, out := c.DescribeStaleSecurityGroupsRequest(input) +func (c *EC2) DescribeSpotDatafeedSubscriptionWithContext(ctx aws.Context, input *DescribeSpotDatafeedSubscriptionInput, opts ...request.Option) (*DescribeSpotDatafeedSubscriptionOutput, error) { + req, out := c.DescribeSpotDatafeedSubscriptionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeStaleSecurityGroupsPages iterates over the pages of a DescribeStaleSecurityGroups operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeStaleSecurityGroups 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 DescribeStaleSecurityGroups operation. -// pageNum := 0 -// err := client.DescribeStaleSecurityGroupsPages(params, -// func(page *ec2.DescribeStaleSecurityGroupsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeStaleSecurityGroupsPages(input *DescribeStaleSecurityGroupsInput, fn func(*DescribeStaleSecurityGroupsOutput, bool) bool) error { - return c.DescribeStaleSecurityGroupsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeStaleSecurityGroupsPagesWithContext same as DescribeStaleSecurityGroupsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeStaleSecurityGroupsPagesWithContext(ctx aws.Context, input *DescribeStaleSecurityGroupsInput, fn func(*DescribeStaleSecurityGroupsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeStaleSecurityGroupsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeStaleSecurityGroupsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeStaleSecurityGroupsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeSubnets = "DescribeSubnets" +const opDescribeSpotFleetInstances = "DescribeSpotFleetInstances" -// DescribeSubnetsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSubnets operation. The "output" return +// DescribeSpotFleetInstancesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeSpotFleetInstances operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeSubnets for more information on using the DescribeSubnets +// See DescribeSpotFleetInstances for more information on using the DescribeSpotFleetInstances // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeSubnetsRequest method. -// req, resp := client.DescribeSubnetsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSubnets -func (c *EC2) DescribeSubnetsRequest(input *DescribeSubnetsInput) (req *request.Request, output *DescribeSubnetsOutput) { +// See also, 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: opDescribeSubnets, + Name: opDescribeSpotFleetInstances, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &DescribeSubnetsInput{} + input = &DescribeSpotFleetInstancesInput{} } - output = &DescribeSubnetsOutput{} + output = &DescribeSpotFleetInstancesOutput{} req = c.newRequest(op, input, output) return } -// DescribeSubnets API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your subnets. +// DescribeSpotFleetInstances API operation for Amazon Elastic Compute Cloud. // -// For more information, see Your VPC and Subnets (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html) -// in the Amazon Virtual Private Cloud User Guide. +// 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 DescribeSubnets for usage and error information. -// See also, 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) +// API operation DescribeSpotFleetInstances for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetInstances +func (c *EC2) DescribeSpotFleetInstances(input *DescribeSpotFleetInstancesInput) (*DescribeSpotFleetInstancesOutput, error) { + req, out := c.DescribeSpotFleetInstancesRequest(input) return out, req.Send() } -// DescribeSubnetsWithContext is the same as DescribeSubnets with the addition of +// DescribeSpotFleetInstancesWithContext is the same as DescribeSpotFleetInstances with the addition of // the ability to pass a context and additional request options. // -// See DescribeSubnets for details on how to use this API operation. +// See DescribeSpotFleetInstances for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeSubnetsWithContext(ctx aws.Context, input *DescribeSubnetsInput, opts ...request.Option) (*DescribeSubnetsOutput, error) { - req, out := c.DescribeSubnetsRequest(input) +func (c *EC2) DescribeSpotFleetInstancesWithContext(ctx aws.Context, input *DescribeSpotFleetInstancesInput, opts ...request.Option) (*DescribeSpotFleetInstancesOutput, error) { + req, out := c.DescribeSpotFleetInstancesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeSubnetsPages iterates over the pages of a DescribeSubnets operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeSubnets 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 DescribeSubnets operation. -// pageNum := 0 -// err := client.DescribeSubnetsPages(params, -// func(page *ec2.DescribeSubnetsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeSubnetsPages(input *DescribeSubnetsInput, fn func(*DescribeSubnetsOutput, bool) bool) error { - return c.DescribeSubnetsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeSubnetsPagesWithContext same as DescribeSubnetsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeSubnetsPagesWithContext(ctx aws.Context, input *DescribeSubnetsInput, fn func(*DescribeSubnetsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeSubnetsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeSubnetsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSubnetsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeTags = "DescribeTags" +const opDescribeSpotFleetRequestHistory = "DescribeSpotFleetRequestHistory" -// DescribeTagsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTags operation. The "output" return +// DescribeSpotFleetRequestHistoryRequest generates a "aws/request.Request" representing the +// client's request for the DescribeSpotFleetRequestHistory operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeTags for more information on using the DescribeTags +// See DescribeSpotFleetRequestHistory for more information on using the DescribeSpotFleetRequestHistory // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeTagsRequest method. -// req, resp := client.DescribeTagsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTags -func (c *EC2) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Request, output *DescribeTagsOutput) { +// See also, 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: opDescribeTags, + Name: opDescribeSpotFleetRequestHistory, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &DescribeTagsInput{} + input = &DescribeSpotFleetRequestHistoryInput{} } - output = &DescribeTagsOutput{} + output = &DescribeSpotFleetRequestHistoryOutput{} req = c.newRequest(op, input, output) return } -// DescribeTags API operation for Amazon Elastic Compute Cloud. +// DescribeSpotFleetRequestHistory API operation for Amazon Elastic Compute Cloud. // -// Describes the specified tags for your EC2 resources. +// Describes the events for the specified Spot Fleet request during the specified +// time. // -// For more information about tags, see Tagging Your Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html) -// in the Amazon Elastic Compute Cloud User Guide. +// 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. Spot Fleet events are available for 48 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 Amazon Elastic Compute Cloud's -// API operation DescribeTags for usage and error information. -// See also, 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) +// API operation DescribeSpotFleetRequestHistory for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequestHistory +func (c *EC2) DescribeSpotFleetRequestHistory(input *DescribeSpotFleetRequestHistoryInput) (*DescribeSpotFleetRequestHistoryOutput, error) { + req, out := c.DescribeSpotFleetRequestHistoryRequest(input) return out, req.Send() } -// DescribeTagsWithContext is the same as DescribeTags with the addition of +// DescribeSpotFleetRequestHistoryWithContext is the same as DescribeSpotFleetRequestHistory with the addition of // the ability to pass a context and additional request options. // -// See DescribeTags for details on how to use this API operation. +// See DescribeSpotFleetRequestHistory for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeTagsWithContext(ctx aws.Context, input *DescribeTagsInput, opts ...request.Option) (*DescribeTagsOutput, error) { - req, out := c.DescribeTagsRequest(input) +func (c *EC2) DescribeSpotFleetRequestHistoryWithContext(ctx aws.Context, input *DescribeSpotFleetRequestHistoryInput, opts ...request.Option) (*DescribeSpotFleetRequestHistoryOutput, error) { + req, out := c.DescribeSpotFleetRequestHistoryRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// 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 *ec2.DescribeTagsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeTagsPages(input *DescribeTagsInput, fn func(*DescribeTagsOutput, bool) bool) error { - return c.DescribeTagsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeTagsPagesWithContext same as DescribeTagsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeTagsPagesWithContext(ctx aws.Context, input *DescribeTagsInput, fn func(*DescribeTagsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeTagsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeTagsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTagsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeTrafficMirrorFilters = "DescribeTrafficMirrorFilters" +const opDescribeSpotFleetRequests = "DescribeSpotFleetRequests" -// DescribeTrafficMirrorFiltersRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTrafficMirrorFilters operation. The "output" return +// DescribeSpotFleetRequestsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeSpotFleetRequests operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeTrafficMirrorFilters for more information on using the DescribeTrafficMirrorFilters +// See DescribeSpotFleetRequests for more information on using the DescribeSpotFleetRequests // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeTrafficMirrorFiltersRequest method. -// req, resp := client.DescribeTrafficMirrorFiltersRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorFilters -func (c *EC2) DescribeTrafficMirrorFiltersRequest(input *DescribeTrafficMirrorFiltersInput) (req *request.Request, output *DescribeTrafficMirrorFiltersOutput) { +// See also, 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: opDescribeTrafficMirrorFilters, + Name: opDescribeSpotFleetRequests, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -19281,125 +21077,130 @@ func (c *EC2) DescribeTrafficMirrorFiltersRequest(input *DescribeTrafficMirrorFi } if input == nil { - input = &DescribeTrafficMirrorFiltersInput{} + input = &DescribeSpotFleetRequestsInput{} } - output = &DescribeTrafficMirrorFiltersOutput{} + output = &DescribeSpotFleetRequestsOutput{} req = c.newRequest(op, input, output) return } -// DescribeTrafficMirrorFilters API operation for Amazon Elastic Compute Cloud. +// DescribeSpotFleetRequests API operation for Amazon Elastic Compute Cloud. // -// Describes one or more Traffic Mirror filters. +// 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 DescribeTrafficMirrorFilters for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorFilters -func (c *EC2) DescribeTrafficMirrorFilters(input *DescribeTrafficMirrorFiltersInput) (*DescribeTrafficMirrorFiltersOutput, error) { - req, out := c.DescribeTrafficMirrorFiltersRequest(input) +// API operation DescribeSpotFleetRequests for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotFleetRequests +func (c *EC2) DescribeSpotFleetRequests(input *DescribeSpotFleetRequestsInput) (*DescribeSpotFleetRequestsOutput, error) { + req, out := c.DescribeSpotFleetRequestsRequest(input) return out, req.Send() } -// DescribeTrafficMirrorFiltersWithContext is the same as DescribeTrafficMirrorFilters with the addition of +// DescribeSpotFleetRequestsWithContext is the same as DescribeSpotFleetRequests with the addition of // the ability to pass a context and additional request options. // -// See DescribeTrafficMirrorFilters for details on how to use this API operation. +// See DescribeSpotFleetRequests for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeTrafficMirrorFiltersWithContext(ctx aws.Context, input *DescribeTrafficMirrorFiltersInput, opts ...request.Option) (*DescribeTrafficMirrorFiltersOutput, error) { - req, out := c.DescribeTrafficMirrorFiltersRequest(input) +func (c *EC2) DescribeSpotFleetRequestsWithContext(ctx aws.Context, input *DescribeSpotFleetRequestsInput, opts ...request.Option) (*DescribeSpotFleetRequestsOutput, error) { + req, out := c.DescribeSpotFleetRequestsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeTrafficMirrorFiltersPages iterates over the pages of a DescribeTrafficMirrorFilters operation, +// 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 DescribeTrafficMirrorFilters method for more information on how to use this operation. +// 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 DescribeTrafficMirrorFilters operation. +// // Example iterating over at most 3 pages of a DescribeSpotFleetRequests operation. // pageNum := 0 -// err := client.DescribeTrafficMirrorFiltersPages(params, -// func(page *ec2.DescribeTrafficMirrorFiltersOutput, lastPage bool) bool { +// err := client.DescribeSpotFleetRequestsPages(params, +// func(page *ec2.DescribeSpotFleetRequestsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeTrafficMirrorFiltersPages(input *DescribeTrafficMirrorFiltersInput, fn func(*DescribeTrafficMirrorFiltersOutput, bool) bool) error { - return c.DescribeTrafficMirrorFiltersPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeSpotFleetRequestsPages(input *DescribeSpotFleetRequestsInput, fn func(*DescribeSpotFleetRequestsOutput, bool) bool) error { + return c.DescribeSpotFleetRequestsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeTrafficMirrorFiltersPagesWithContext same as DescribeTrafficMirrorFiltersPages except +// DescribeSpotFleetRequestsPagesWithContext same as DescribeSpotFleetRequestsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeTrafficMirrorFiltersPagesWithContext(ctx aws.Context, input *DescribeTrafficMirrorFiltersInput, fn func(*DescribeTrafficMirrorFiltersOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeSpotFleetRequestsPagesWithContext(ctx aws.Context, input *DescribeSpotFleetRequestsInput, fn func(*DescribeSpotFleetRequestsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeTrafficMirrorFiltersInput + var inCpy *DescribeSpotFleetRequestsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeTrafficMirrorFiltersRequest(inCpy) + req, _ := c.DescribeSpotFleetRequestsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTrafficMirrorFiltersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeSpotFleetRequestsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeTrafficMirrorSessions = "DescribeTrafficMirrorSessions" +const opDescribeSpotInstanceRequests = "DescribeSpotInstanceRequests" -// DescribeTrafficMirrorSessionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTrafficMirrorSessions operation. The "output" return +// DescribeSpotInstanceRequestsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeSpotInstanceRequests operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeTrafficMirrorSessions for more information on using the DescribeTrafficMirrorSessions +// See DescribeSpotInstanceRequests for more information on using the DescribeSpotInstanceRequests // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeTrafficMirrorSessionsRequest method. -// req, resp := client.DescribeTrafficMirrorSessionsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorSessions -func (c *EC2) DescribeTrafficMirrorSessionsRequest(input *DescribeTrafficMirrorSessionsInput) (req *request.Request, output *DescribeTrafficMirrorSessionsOutput) { +// See also, 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: opDescribeTrafficMirrorSessions, + Name: opDescribeSpotInstanceRequests, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -19411,126 +21212,143 @@ func (c *EC2) DescribeTrafficMirrorSessionsRequest(input *DescribeTrafficMirrorS } if input == nil { - input = &DescribeTrafficMirrorSessionsInput{} + input = &DescribeSpotInstanceRequestsInput{} } - output = &DescribeTrafficMirrorSessionsOutput{} + output = &DescribeSpotInstanceRequestsOutput{} req = c.newRequest(op, input, output) return } -// DescribeTrafficMirrorSessions API operation for Amazon Elastic Compute Cloud. +// DescribeSpotInstanceRequests API operation for Amazon Elastic Compute Cloud. // -// Describes one or more Traffic Mirror sessions. By default, all Traffic Mirror -// sessions are described. Alternatively, you can filter the results. +// Describes the specified Spot Instance requests. +// +// 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. +// +// We recommend that you set MaxResults to a value between 5 and 1000 to limit +// the number of results returned. This paginates the output, which makes the +// list more manageable and returns the results faster. 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 DescribeSpotInstanceRequests +// request to retrieve the remaining results. +// +// Spot Instance requests are deleted four 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 DescribeTrafficMirrorSessions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorSessions -func (c *EC2) DescribeTrafficMirrorSessions(input *DescribeTrafficMirrorSessionsInput) (*DescribeTrafficMirrorSessionsOutput, error) { - req, out := c.DescribeTrafficMirrorSessionsRequest(input) +// API operation DescribeSpotInstanceRequests for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotInstanceRequests +func (c *EC2) DescribeSpotInstanceRequests(input *DescribeSpotInstanceRequestsInput) (*DescribeSpotInstanceRequestsOutput, error) { + req, out := c.DescribeSpotInstanceRequestsRequest(input) return out, req.Send() } -// DescribeTrafficMirrorSessionsWithContext is the same as DescribeTrafficMirrorSessions with the addition of +// DescribeSpotInstanceRequestsWithContext is the same as DescribeSpotInstanceRequests with the addition of // the ability to pass a context and additional request options. // -// See DescribeTrafficMirrorSessions for details on how to use this API operation. +// See DescribeSpotInstanceRequests for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeTrafficMirrorSessionsWithContext(ctx aws.Context, input *DescribeTrafficMirrorSessionsInput, opts ...request.Option) (*DescribeTrafficMirrorSessionsOutput, error) { - req, out := c.DescribeTrafficMirrorSessionsRequest(input) +func (c *EC2) DescribeSpotInstanceRequestsWithContext(ctx aws.Context, input *DescribeSpotInstanceRequestsInput, opts ...request.Option) (*DescribeSpotInstanceRequestsOutput, error) { + req, out := c.DescribeSpotInstanceRequestsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeTrafficMirrorSessionsPages iterates over the pages of a DescribeTrafficMirrorSessions operation, +// DescribeSpotInstanceRequestsPages iterates over the pages of a DescribeSpotInstanceRequests operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribeTrafficMirrorSessions method for more information on how to use this operation. +// See DescribeSpotInstanceRequests 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 DescribeTrafficMirrorSessions operation. +// // Example iterating over at most 3 pages of a DescribeSpotInstanceRequests operation. // pageNum := 0 -// err := client.DescribeTrafficMirrorSessionsPages(params, -// func(page *ec2.DescribeTrafficMirrorSessionsOutput, lastPage bool) bool { +// err := client.DescribeSpotInstanceRequestsPages(params, +// func(page *ec2.DescribeSpotInstanceRequestsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeTrafficMirrorSessionsPages(input *DescribeTrafficMirrorSessionsInput, fn func(*DescribeTrafficMirrorSessionsOutput, bool) bool) error { - return c.DescribeTrafficMirrorSessionsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeSpotInstanceRequestsPages(input *DescribeSpotInstanceRequestsInput, fn func(*DescribeSpotInstanceRequestsOutput, bool) bool) error { + return c.DescribeSpotInstanceRequestsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeTrafficMirrorSessionsPagesWithContext same as DescribeTrafficMirrorSessionsPages except +// DescribeSpotInstanceRequestsPagesWithContext same as DescribeSpotInstanceRequestsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeTrafficMirrorSessionsPagesWithContext(ctx aws.Context, input *DescribeTrafficMirrorSessionsInput, fn func(*DescribeTrafficMirrorSessionsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeSpotInstanceRequestsPagesWithContext(ctx aws.Context, input *DescribeSpotInstanceRequestsInput, fn func(*DescribeSpotInstanceRequestsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeTrafficMirrorSessionsInput + var inCpy *DescribeSpotInstanceRequestsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeTrafficMirrorSessionsRequest(inCpy) + req, _ := c.DescribeSpotInstanceRequestsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTrafficMirrorSessionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeSpotInstanceRequestsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeTrafficMirrorTargets = "DescribeTrafficMirrorTargets" +const opDescribeSpotPriceHistory = "DescribeSpotPriceHistory" -// DescribeTrafficMirrorTargetsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTrafficMirrorTargets operation. The "output" return +// DescribeSpotPriceHistoryRequest generates a "aws/request.Request" representing the +// client's request for the DescribeSpotPriceHistory operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeTrafficMirrorTargets for more information on using the DescribeTrafficMirrorTargets +// See DescribeSpotPriceHistory for more information on using the DescribeSpotPriceHistory // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeTrafficMirrorTargetsRequest method. -// req, resp := client.DescribeTrafficMirrorTargetsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorTargets -func (c *EC2) DescribeTrafficMirrorTargetsRequest(input *DescribeTrafficMirrorTargetsInput) (req *request.Request, output *DescribeTrafficMirrorTargetsOutput) { +// See also, 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: opDescribeTrafficMirrorTargets, + Name: opDescribeSpotPriceHistory, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -19542,125 +21360,134 @@ func (c *EC2) DescribeTrafficMirrorTargetsRequest(input *DescribeTrafficMirrorTa } if input == nil { - input = &DescribeTrafficMirrorTargetsInput{} + input = &DescribeSpotPriceHistoryInput{} } - output = &DescribeTrafficMirrorTargetsOutput{} + output = &DescribeSpotPriceHistoryOutput{} req = c.newRequest(op, input, output) return } -// DescribeTrafficMirrorTargets API operation for Amazon Elastic Compute Cloud. +// DescribeSpotPriceHistory API operation for Amazon Elastic Compute Cloud. // -// Information about one or more Traffic Mirror targets. +// Describes the Spot price history. For more information, see Spot Instance +// Pricing History (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-spot-instances-history.html) +// in the Amazon EC2 User Guide for Linux Instances. +// +// 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 DescribeTrafficMirrorTargets for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorTargets -func (c *EC2) DescribeTrafficMirrorTargets(input *DescribeTrafficMirrorTargetsInput) (*DescribeTrafficMirrorTargetsOutput, error) { - req, out := c.DescribeTrafficMirrorTargetsRequest(input) +// API operation DescribeSpotPriceHistory for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSpotPriceHistory +func (c *EC2) DescribeSpotPriceHistory(input *DescribeSpotPriceHistoryInput) (*DescribeSpotPriceHistoryOutput, error) { + req, out := c.DescribeSpotPriceHistoryRequest(input) return out, req.Send() } -// DescribeTrafficMirrorTargetsWithContext is the same as DescribeTrafficMirrorTargets with the addition of +// DescribeSpotPriceHistoryWithContext is the same as DescribeSpotPriceHistory with the addition of // the ability to pass a context and additional request options. // -// See DescribeTrafficMirrorTargets for details on how to use this API operation. +// See DescribeSpotPriceHistory for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeTrafficMirrorTargetsWithContext(ctx aws.Context, input *DescribeTrafficMirrorTargetsInput, opts ...request.Option) (*DescribeTrafficMirrorTargetsOutput, error) { - req, out := c.DescribeTrafficMirrorTargetsRequest(input) +func (c *EC2) DescribeSpotPriceHistoryWithContext(ctx aws.Context, input *DescribeSpotPriceHistoryInput, opts ...request.Option) (*DescribeSpotPriceHistoryOutput, error) { + req, out := c.DescribeSpotPriceHistoryRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeTrafficMirrorTargetsPages iterates over the pages of a DescribeTrafficMirrorTargets operation, +// 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 DescribeTrafficMirrorTargets method for more information on how to use this operation. +// 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 DescribeTrafficMirrorTargets operation. +// // Example iterating over at most 3 pages of a DescribeSpotPriceHistory operation. // pageNum := 0 -// err := client.DescribeTrafficMirrorTargetsPages(params, -// func(page *ec2.DescribeTrafficMirrorTargetsOutput, lastPage bool) bool { +// err := client.DescribeSpotPriceHistoryPages(params, +// func(page *ec2.DescribeSpotPriceHistoryOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeTrafficMirrorTargetsPages(input *DescribeTrafficMirrorTargetsInput, fn func(*DescribeTrafficMirrorTargetsOutput, bool) bool) error { - return c.DescribeTrafficMirrorTargetsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeSpotPriceHistoryPages(input *DescribeSpotPriceHistoryInput, fn func(*DescribeSpotPriceHistoryOutput, bool) bool) error { + return c.DescribeSpotPriceHistoryPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeTrafficMirrorTargetsPagesWithContext same as DescribeTrafficMirrorTargetsPages except +// DescribeSpotPriceHistoryPagesWithContext same as DescribeSpotPriceHistoryPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeTrafficMirrorTargetsPagesWithContext(ctx aws.Context, input *DescribeTrafficMirrorTargetsInput, fn func(*DescribeTrafficMirrorTargetsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeSpotPriceHistoryPagesWithContext(ctx aws.Context, input *DescribeSpotPriceHistoryInput, fn func(*DescribeSpotPriceHistoryOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeTrafficMirrorTargetsInput + var inCpy *DescribeSpotPriceHistoryInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeTrafficMirrorTargetsRequest(inCpy) + req, _ := c.DescribeSpotPriceHistoryRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTrafficMirrorTargetsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeSpotPriceHistoryOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeTransitGatewayAttachments = "DescribeTransitGatewayAttachments" +const opDescribeStaleSecurityGroups = "DescribeStaleSecurityGroups" -// DescribeTransitGatewayAttachmentsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTransitGatewayAttachments operation. The "output" return +// DescribeStaleSecurityGroupsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeStaleSecurityGroups operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeTransitGatewayAttachments for more information on using the DescribeTransitGatewayAttachments +// See DescribeStaleSecurityGroups for more information on using the DescribeStaleSecurityGroups // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeTransitGatewayAttachmentsRequest method. -// req, resp := client.DescribeTransitGatewayAttachmentsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayAttachments -func (c *EC2) DescribeTransitGatewayAttachmentsRequest(input *DescribeTransitGatewayAttachmentsInput) (req *request.Request, output *DescribeTransitGatewayAttachmentsOutput) { +// See also, 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: opDescribeTransitGatewayAttachments, + Name: opDescribeStaleSecurityGroups, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -19672,128 +21499,130 @@ func (c *EC2) DescribeTransitGatewayAttachmentsRequest(input *DescribeTransitGat } if input == nil { - input = &DescribeTransitGatewayAttachmentsInput{} + input = &DescribeStaleSecurityGroupsInput{} } - output = &DescribeTransitGatewayAttachmentsOutput{} + output = &DescribeStaleSecurityGroupsOutput{} req = c.newRequest(op, input, output) return } -// DescribeTransitGatewayAttachments API operation for Amazon Elastic Compute Cloud. +// DescribeStaleSecurityGroups API operation for Amazon Elastic Compute Cloud. // -// Describes one or more attachments between resources and transit gateways. -// By default, all attachments are described. Alternatively, you can filter -// the results by attachment ID, attachment state, resource ID, or resource -// owner. +// [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 DescribeTransitGatewayAttachments for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayAttachments -func (c *EC2) DescribeTransitGatewayAttachments(input *DescribeTransitGatewayAttachmentsInput) (*DescribeTransitGatewayAttachmentsOutput, error) { - req, out := c.DescribeTransitGatewayAttachmentsRequest(input) +// API operation DescribeStaleSecurityGroups for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeStaleSecurityGroups +func (c *EC2) DescribeStaleSecurityGroups(input *DescribeStaleSecurityGroupsInput) (*DescribeStaleSecurityGroupsOutput, error) { + req, out := c.DescribeStaleSecurityGroupsRequest(input) return out, req.Send() } -// DescribeTransitGatewayAttachmentsWithContext is the same as DescribeTransitGatewayAttachments with the addition of +// DescribeStaleSecurityGroupsWithContext is the same as DescribeStaleSecurityGroups with the addition of // the ability to pass a context and additional request options. // -// See DescribeTransitGatewayAttachments for details on how to use this API operation. +// See DescribeStaleSecurityGroups for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeTransitGatewayAttachmentsWithContext(ctx aws.Context, input *DescribeTransitGatewayAttachmentsInput, opts ...request.Option) (*DescribeTransitGatewayAttachmentsOutput, error) { - req, out := c.DescribeTransitGatewayAttachmentsRequest(input) +func (c *EC2) DescribeStaleSecurityGroupsWithContext(ctx aws.Context, input *DescribeStaleSecurityGroupsInput, opts ...request.Option) (*DescribeStaleSecurityGroupsOutput, error) { + req, out := c.DescribeStaleSecurityGroupsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeTransitGatewayAttachmentsPages iterates over the pages of a DescribeTransitGatewayAttachments operation, +// DescribeStaleSecurityGroupsPages iterates over the pages of a DescribeStaleSecurityGroups operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribeTransitGatewayAttachments method for more information on how to use this operation. +// See DescribeStaleSecurityGroups 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 DescribeTransitGatewayAttachments operation. +// // Example iterating over at most 3 pages of a DescribeStaleSecurityGroups operation. // pageNum := 0 -// err := client.DescribeTransitGatewayAttachmentsPages(params, -// func(page *ec2.DescribeTransitGatewayAttachmentsOutput, lastPage bool) bool { +// err := client.DescribeStaleSecurityGroupsPages(params, +// func(page *ec2.DescribeStaleSecurityGroupsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeTransitGatewayAttachmentsPages(input *DescribeTransitGatewayAttachmentsInput, fn func(*DescribeTransitGatewayAttachmentsOutput, bool) bool) error { - return c.DescribeTransitGatewayAttachmentsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeStaleSecurityGroupsPages(input *DescribeStaleSecurityGroupsInput, fn func(*DescribeStaleSecurityGroupsOutput, bool) bool) error { + return c.DescribeStaleSecurityGroupsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeTransitGatewayAttachmentsPagesWithContext same as DescribeTransitGatewayAttachmentsPages except +// DescribeStaleSecurityGroupsPagesWithContext same as DescribeStaleSecurityGroupsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeTransitGatewayAttachmentsPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayAttachmentsInput, fn func(*DescribeTransitGatewayAttachmentsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeStaleSecurityGroupsPagesWithContext(ctx aws.Context, input *DescribeStaleSecurityGroupsInput, fn func(*DescribeStaleSecurityGroupsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeTransitGatewayAttachmentsInput + var inCpy *DescribeStaleSecurityGroupsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeTransitGatewayAttachmentsRequest(inCpy) + req, _ := c.DescribeStaleSecurityGroupsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTransitGatewayAttachmentsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeStaleSecurityGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeTransitGatewayRouteTables = "DescribeTransitGatewayRouteTables" +const opDescribeSubnets = "DescribeSubnets" -// DescribeTransitGatewayRouteTablesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTransitGatewayRouteTables operation. The "output" return +// DescribeSubnetsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeSubnets operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeTransitGatewayRouteTables for more information on using the DescribeTransitGatewayRouteTables +// See DescribeSubnets for more information on using the DescribeSubnets // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeTransitGatewayRouteTablesRequest method. -// req, resp := client.DescribeTransitGatewayRouteTablesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayRouteTables -func (c *EC2) DescribeTransitGatewayRouteTablesRequest(input *DescribeTransitGatewayRouteTablesInput) (req *request.Request, output *DescribeTransitGatewayRouteTablesOutput) { +// See also, 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: opDescribeTransitGatewayRouteTables, + Name: opDescribeSubnets, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -19805,126 +21634,130 @@ func (c *EC2) DescribeTransitGatewayRouteTablesRequest(input *DescribeTransitGat } if input == nil { - input = &DescribeTransitGatewayRouteTablesInput{} + input = &DescribeSubnetsInput{} } - output = &DescribeTransitGatewayRouteTablesOutput{} + output = &DescribeSubnetsOutput{} req = c.newRequest(op, input, output) return } -// DescribeTransitGatewayRouteTables API operation for Amazon Elastic Compute Cloud. +// DescribeSubnets API operation for Amazon Elastic Compute Cloud. // -// Describes one or more transit gateway route tables. By default, all transit -// gateway route tables are described. Alternatively, you can filter the results. +// Describes one or more of your subnets. +// +// For more information, see Your VPC and Subnets (https://docs.aws.amazon.com/vpc/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 DescribeTransitGatewayRouteTables for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayRouteTables -func (c *EC2) DescribeTransitGatewayRouteTables(input *DescribeTransitGatewayRouteTablesInput) (*DescribeTransitGatewayRouteTablesOutput, error) { - req, out := c.DescribeTransitGatewayRouteTablesRequest(input) +// API operation DescribeSubnets for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeSubnets +func (c *EC2) DescribeSubnets(input *DescribeSubnetsInput) (*DescribeSubnetsOutput, error) { + req, out := c.DescribeSubnetsRequest(input) return out, req.Send() } -// DescribeTransitGatewayRouteTablesWithContext is the same as DescribeTransitGatewayRouteTables with the addition of +// DescribeSubnetsWithContext is the same as DescribeSubnets with the addition of // the ability to pass a context and additional request options. // -// See DescribeTransitGatewayRouteTables for details on how to use this API operation. +// See DescribeSubnets for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeTransitGatewayRouteTablesWithContext(ctx aws.Context, input *DescribeTransitGatewayRouteTablesInput, opts ...request.Option) (*DescribeTransitGatewayRouteTablesOutput, error) { - req, out := c.DescribeTransitGatewayRouteTablesRequest(input) +func (c *EC2) DescribeSubnetsWithContext(ctx aws.Context, input *DescribeSubnetsInput, opts ...request.Option) (*DescribeSubnetsOutput, error) { + req, out := c.DescribeSubnetsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeTransitGatewayRouteTablesPages iterates over the pages of a DescribeTransitGatewayRouteTables operation, +// DescribeSubnetsPages iterates over the pages of a DescribeSubnets operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribeTransitGatewayRouteTables method for more information on how to use this operation. +// See DescribeSubnets 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 DescribeTransitGatewayRouteTables operation. +// // Example iterating over at most 3 pages of a DescribeSubnets operation. // pageNum := 0 -// err := client.DescribeTransitGatewayRouteTablesPages(params, -// func(page *ec2.DescribeTransitGatewayRouteTablesOutput, lastPage bool) bool { +// err := client.DescribeSubnetsPages(params, +// func(page *ec2.DescribeSubnetsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeTransitGatewayRouteTablesPages(input *DescribeTransitGatewayRouteTablesInput, fn func(*DescribeTransitGatewayRouteTablesOutput, bool) bool) error { - return c.DescribeTransitGatewayRouteTablesPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeSubnetsPages(input *DescribeSubnetsInput, fn func(*DescribeSubnetsOutput, bool) bool) error { + return c.DescribeSubnetsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeTransitGatewayRouteTablesPagesWithContext same as DescribeTransitGatewayRouteTablesPages except +// DescribeSubnetsPagesWithContext same as DescribeSubnetsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeTransitGatewayRouteTablesPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayRouteTablesInput, fn func(*DescribeTransitGatewayRouteTablesOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeSubnetsPagesWithContext(ctx aws.Context, input *DescribeSubnetsInput, fn func(*DescribeSubnetsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeTransitGatewayRouteTablesInput + var inCpy *DescribeSubnetsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeTransitGatewayRouteTablesRequest(inCpy) + req, _ := c.DescribeSubnetsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTransitGatewayRouteTablesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeSubnetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeTransitGatewayVpcAttachments = "DescribeTransitGatewayVpcAttachments" +const opDescribeTags = "DescribeTags" -// DescribeTransitGatewayVpcAttachmentsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTransitGatewayVpcAttachments operation. The "output" return +// DescribeTagsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTags operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeTransitGatewayVpcAttachments for more information on using the DescribeTransitGatewayVpcAttachments +// See DescribeTags for more information on using the DescribeTags // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeTransitGatewayVpcAttachmentsRequest method. -// req, resp := client.DescribeTransitGatewayVpcAttachmentsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayVpcAttachments -func (c *EC2) DescribeTransitGatewayVpcAttachmentsRequest(input *DescribeTransitGatewayVpcAttachmentsInput) (req *request.Request, output *DescribeTransitGatewayVpcAttachmentsOutput) { +// See also, 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: opDescribeTransitGatewayVpcAttachments, + Name: opDescribeTags, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -19936,126 +21769,130 @@ func (c *EC2) DescribeTransitGatewayVpcAttachmentsRequest(input *DescribeTransit } if input == nil { - input = &DescribeTransitGatewayVpcAttachmentsInput{} + input = &DescribeTagsInput{} } - output = &DescribeTransitGatewayVpcAttachmentsOutput{} + output = &DescribeTagsOutput{} req = c.newRequest(op, input, output) return } -// DescribeTransitGatewayVpcAttachments API operation for Amazon Elastic Compute Cloud. +// DescribeTags API operation for Amazon Elastic Compute Cloud. // -// Describes one or more VPC attachments. By default, all VPC attachments are -// described. Alternatively, you can filter the results. +// Describes the specified tags for your EC2 resources. +// +// For more information about tags, see Tagging Your Resources (https://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 DescribeTransitGatewayVpcAttachments for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayVpcAttachments -func (c *EC2) DescribeTransitGatewayVpcAttachments(input *DescribeTransitGatewayVpcAttachmentsInput) (*DescribeTransitGatewayVpcAttachmentsOutput, error) { - req, out := c.DescribeTransitGatewayVpcAttachmentsRequest(input) +// API operation DescribeTags for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTags +func (c *EC2) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { + req, out := c.DescribeTagsRequest(input) return out, req.Send() } -// DescribeTransitGatewayVpcAttachmentsWithContext is the same as DescribeTransitGatewayVpcAttachments with the addition of +// DescribeTagsWithContext is the same as DescribeTags with the addition of // the ability to pass a context and additional request options. // -// See DescribeTransitGatewayVpcAttachments for details on how to use this API operation. +// See DescribeTags for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeTransitGatewayVpcAttachmentsWithContext(ctx aws.Context, input *DescribeTransitGatewayVpcAttachmentsInput, opts ...request.Option) (*DescribeTransitGatewayVpcAttachmentsOutput, error) { - req, out := c.DescribeTransitGatewayVpcAttachmentsRequest(input) +func (c *EC2) DescribeTagsWithContext(ctx aws.Context, input *DescribeTagsInput, opts ...request.Option) (*DescribeTagsOutput, error) { + req, out := c.DescribeTagsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeTransitGatewayVpcAttachmentsPages iterates over the pages of a DescribeTransitGatewayVpcAttachments operation, +// 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 DescribeTransitGatewayVpcAttachments method for more information on how to use this operation. +// 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 DescribeTransitGatewayVpcAttachments operation. +// // Example iterating over at most 3 pages of a DescribeTags operation. // pageNum := 0 -// err := client.DescribeTransitGatewayVpcAttachmentsPages(params, -// func(page *ec2.DescribeTransitGatewayVpcAttachmentsOutput, lastPage bool) bool { +// err := client.DescribeTagsPages(params, +// func(page *ec2.DescribeTagsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeTransitGatewayVpcAttachmentsPages(input *DescribeTransitGatewayVpcAttachmentsInput, fn func(*DescribeTransitGatewayVpcAttachmentsOutput, bool) bool) error { - return c.DescribeTransitGatewayVpcAttachmentsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeTagsPages(input *DescribeTagsInput, fn func(*DescribeTagsOutput, bool) bool) error { + return c.DescribeTagsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeTransitGatewayVpcAttachmentsPagesWithContext same as DescribeTransitGatewayVpcAttachmentsPages except +// DescribeTagsPagesWithContext same as DescribeTagsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeTransitGatewayVpcAttachmentsPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayVpcAttachmentsInput, fn func(*DescribeTransitGatewayVpcAttachmentsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeTagsPagesWithContext(ctx aws.Context, input *DescribeTagsInput, fn func(*DescribeTagsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeTransitGatewayVpcAttachmentsInput + var inCpy *DescribeTagsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeTransitGatewayVpcAttachmentsRequest(inCpy) + req, _ := c.DescribeTagsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTransitGatewayVpcAttachmentsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeTagsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeTransitGateways = "DescribeTransitGateways" +const opDescribeTrafficMirrorFilters = "DescribeTrafficMirrorFilters" -// DescribeTransitGatewaysRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTransitGateways operation. The "output" return +// DescribeTrafficMirrorFiltersRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTrafficMirrorFilters operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeTransitGateways for more information on using the DescribeTransitGateways +// See DescribeTrafficMirrorFilters for more information on using the DescribeTrafficMirrorFilters // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeTransitGatewaysRequest method. -// req, resp := client.DescribeTransitGatewaysRequest(params) +// // Example sending a request using the DescribeTrafficMirrorFiltersRequest method. +// req, resp := client.DescribeTrafficMirrorFiltersRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGateways -func (c *EC2) DescribeTransitGatewaysRequest(input *DescribeTransitGatewaysInput) (req *request.Request, output *DescribeTransitGatewaysOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorFilters +func (c *EC2) DescribeTrafficMirrorFiltersRequest(input *DescribeTrafficMirrorFiltersInput) (req *request.Request, output *DescribeTrafficMirrorFiltersOutput) { op := &request.Operation{ - Name: opDescribeTransitGateways, + Name: opDescribeTrafficMirrorFilters, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -20067,204 +21904,260 @@ func (c *EC2) DescribeTransitGatewaysRequest(input *DescribeTransitGatewaysInput } if input == nil { - input = &DescribeTransitGatewaysInput{} + input = &DescribeTrafficMirrorFiltersInput{} } - output = &DescribeTransitGatewaysOutput{} + output = &DescribeTrafficMirrorFiltersOutput{} req = c.newRequest(op, input, output) return } -// DescribeTransitGateways API operation for Amazon Elastic Compute Cloud. +// DescribeTrafficMirrorFilters API operation for Amazon Elastic Compute Cloud. // -// Describes one or more transit gateways. By default, all transit gateways -// are described. Alternatively, you can filter the results. +// Describes one or more Traffic Mirror filters. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeTransitGateways for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGateways -func (c *EC2) DescribeTransitGateways(input *DescribeTransitGatewaysInput) (*DescribeTransitGatewaysOutput, error) { - req, out := c.DescribeTransitGatewaysRequest(input) +// API operation DescribeTrafficMirrorFilters for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorFilters +func (c *EC2) DescribeTrafficMirrorFilters(input *DescribeTrafficMirrorFiltersInput) (*DescribeTrafficMirrorFiltersOutput, error) { + req, out := c.DescribeTrafficMirrorFiltersRequest(input) return out, req.Send() } -// DescribeTransitGatewaysWithContext is the same as DescribeTransitGateways with the addition of +// DescribeTrafficMirrorFiltersWithContext is the same as DescribeTrafficMirrorFilters with the addition of // the ability to pass a context and additional request options. // -// See DescribeTransitGateways for details on how to use this API operation. +// See DescribeTrafficMirrorFilters for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeTransitGatewaysWithContext(ctx aws.Context, input *DescribeTransitGatewaysInput, opts ...request.Option) (*DescribeTransitGatewaysOutput, error) { - req, out := c.DescribeTransitGatewaysRequest(input) +func (c *EC2) DescribeTrafficMirrorFiltersWithContext(ctx aws.Context, input *DescribeTrafficMirrorFiltersInput, opts ...request.Option) (*DescribeTrafficMirrorFiltersOutput, error) { + req, out := c.DescribeTrafficMirrorFiltersRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeTransitGatewaysPages iterates over the pages of a DescribeTransitGateways operation, +// DescribeTrafficMirrorFiltersPages iterates over the pages of a DescribeTrafficMirrorFilters operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribeTransitGateways method for more information on how to use this operation. +// See DescribeTrafficMirrorFilters 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 DescribeTransitGateways operation. +// // Example iterating over at most 3 pages of a DescribeTrafficMirrorFilters operation. // pageNum := 0 -// err := client.DescribeTransitGatewaysPages(params, -// func(page *ec2.DescribeTransitGatewaysOutput, lastPage bool) bool { +// err := client.DescribeTrafficMirrorFiltersPages(params, +// func(page *ec2.DescribeTrafficMirrorFiltersOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeTransitGatewaysPages(input *DescribeTransitGatewaysInput, fn func(*DescribeTransitGatewaysOutput, bool) bool) error { - return c.DescribeTransitGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeTrafficMirrorFiltersPages(input *DescribeTrafficMirrorFiltersInput, fn func(*DescribeTrafficMirrorFiltersOutput, bool) bool) error { + return c.DescribeTrafficMirrorFiltersPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeTransitGatewaysPagesWithContext same as DescribeTransitGatewaysPages except +// DescribeTrafficMirrorFiltersPagesWithContext same as DescribeTrafficMirrorFiltersPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeTransitGatewaysPagesWithContext(ctx aws.Context, input *DescribeTransitGatewaysInput, fn func(*DescribeTransitGatewaysOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeTrafficMirrorFiltersPagesWithContext(ctx aws.Context, input *DescribeTrafficMirrorFiltersInput, fn func(*DescribeTrafficMirrorFiltersOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeTransitGatewaysInput + var inCpy *DescribeTrafficMirrorFiltersInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeTransitGatewaysRequest(inCpy) + req, _ := c.DescribeTrafficMirrorFiltersRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTransitGatewaysOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeTrafficMirrorFiltersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeVolumeAttribute = "DescribeVolumeAttribute" +const opDescribeTrafficMirrorSessions = "DescribeTrafficMirrorSessions" -// DescribeVolumeAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVolumeAttribute operation. The "output" return +// DescribeTrafficMirrorSessionsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTrafficMirrorSessions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVolumeAttribute for more information on using the DescribeVolumeAttribute +// See DescribeTrafficMirrorSessions for more information on using the DescribeTrafficMirrorSessions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVolumeAttributeRequest method. -// req, resp := client.DescribeVolumeAttributeRequest(params) +// // Example sending a request using the DescribeTrafficMirrorSessionsRequest method. +// req, resp := client.DescribeTrafficMirrorSessionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeAttribute -func (c *EC2) DescribeVolumeAttributeRequest(input *DescribeVolumeAttributeInput) (req *request.Request, output *DescribeVolumeAttributeOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorSessions +func (c *EC2) DescribeTrafficMirrorSessionsRequest(input *DescribeTrafficMirrorSessionsInput) (req *request.Request, output *DescribeTrafficMirrorSessionsOutput) { op := &request.Operation{ - Name: opDescribeVolumeAttribute, + Name: opDescribeTrafficMirrorSessions, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DescribeVolumeAttributeInput{} + input = &DescribeTrafficMirrorSessionsInput{} } - output = &DescribeVolumeAttributeOutput{} + output = &DescribeTrafficMirrorSessionsOutput{} 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. +// DescribeTrafficMirrorSessions API operation for Amazon Elastic Compute Cloud. // -// For more information about EBS volumes, see Amazon EBS Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Describes one or more Traffic Mirror sessions. By default, all Traffic Mirror +// sessions are described. Alternatively, you can 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 Elastic Compute Cloud's -// API operation DescribeVolumeAttribute for usage and error information. -// See also, 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) +// API operation DescribeTrafficMirrorSessions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorSessions +func (c *EC2) DescribeTrafficMirrorSessions(input *DescribeTrafficMirrorSessionsInput) (*DescribeTrafficMirrorSessionsOutput, error) { + req, out := c.DescribeTrafficMirrorSessionsRequest(input) return out, req.Send() } -// DescribeVolumeAttributeWithContext is the same as DescribeVolumeAttribute with the addition of +// DescribeTrafficMirrorSessionsWithContext is the same as DescribeTrafficMirrorSessions with the addition of // the ability to pass a context and additional request options. // -// See DescribeVolumeAttribute for details on how to use this API operation. +// See DescribeTrafficMirrorSessions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVolumeAttributeWithContext(ctx aws.Context, input *DescribeVolumeAttributeInput, opts ...request.Option) (*DescribeVolumeAttributeOutput, error) { - req, out := c.DescribeVolumeAttributeRequest(input) +func (c *EC2) DescribeTrafficMirrorSessionsWithContext(ctx aws.Context, input *DescribeTrafficMirrorSessionsInput, opts ...request.Option) (*DescribeTrafficMirrorSessionsOutput, error) { + req, out := c.DescribeTrafficMirrorSessionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeVolumeStatus = "DescribeVolumeStatus" +// DescribeTrafficMirrorSessionsPages iterates over the pages of a DescribeTrafficMirrorSessions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeTrafficMirrorSessions 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 DescribeTrafficMirrorSessions operation. +// pageNum := 0 +// err := client.DescribeTrafficMirrorSessionsPages(params, +// func(page *ec2.DescribeTrafficMirrorSessionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeTrafficMirrorSessionsPages(input *DescribeTrafficMirrorSessionsInput, fn func(*DescribeTrafficMirrorSessionsOutput, bool) bool) error { + return c.DescribeTrafficMirrorSessionsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// DescribeVolumeStatusRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVolumeStatus operation. The "output" return +// DescribeTrafficMirrorSessionsPagesWithContext same as DescribeTrafficMirrorSessionsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeTrafficMirrorSessionsPagesWithContext(ctx aws.Context, input *DescribeTrafficMirrorSessionsInput, fn func(*DescribeTrafficMirrorSessionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTrafficMirrorSessionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTrafficMirrorSessionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeTrafficMirrorSessionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeTrafficMirrorTargets = "DescribeTrafficMirrorTargets" + +// DescribeTrafficMirrorTargetsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTrafficMirrorTargets operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVolumeStatus for more information on using the DescribeVolumeStatus +// See DescribeTrafficMirrorTargets for more information on using the DescribeTrafficMirrorTargets // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVolumeStatusRequest method. -// req, resp := client.DescribeVolumeStatusRequest(params) +// // Example sending a request using the DescribeTrafficMirrorTargetsRequest method. +// req, resp := client.DescribeTrafficMirrorTargetsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeStatus -func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req *request.Request, output *DescribeVolumeStatusOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorTargets +func (c *EC2) DescribeTrafficMirrorTargetsRequest(input *DescribeTrafficMirrorTargetsInput) (req *request.Request, output *DescribeTrafficMirrorTargetsOutput) { op := &request.Operation{ - Name: opDescribeVolumeStatus, + Name: opDescribeTrafficMirrorTargets, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -20276,160 +22169,127 @@ func (c *EC2) DescribeVolumeStatusRequest(input *DescribeVolumeStatusInput) (req } if input == nil { - input = &DescribeVolumeStatusInput{} + input = &DescribeTrafficMirrorTargetsInput{} } - output = &DescribeVolumeStatusOutput{} + output = &DescribeTrafficMirrorTargetsOutput{} 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 about volume status, see Monitoring the Status of Your Volumes -// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-status.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// 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. +// DescribeTrafficMirrorTargets API operation for Amazon Elastic Compute Cloud. // -// 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.) +// Information about one or more Traffic Mirror 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 Elastic Compute Cloud's -// API operation DescribeVolumeStatus for usage and error information. -// See also, 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) +// API operation DescribeTrafficMirrorTargets for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTrafficMirrorTargets +func (c *EC2) DescribeTrafficMirrorTargets(input *DescribeTrafficMirrorTargetsInput) (*DescribeTrafficMirrorTargetsOutput, error) { + req, out := c.DescribeTrafficMirrorTargetsRequest(input) return out, req.Send() } -// DescribeVolumeStatusWithContext is the same as DescribeVolumeStatus with the addition of +// DescribeTrafficMirrorTargetsWithContext is the same as DescribeTrafficMirrorTargets with the addition of // the ability to pass a context and additional request options. // -// See DescribeVolumeStatus for details on how to use this API operation. +// See DescribeTrafficMirrorTargets for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVolumeStatusWithContext(ctx aws.Context, input *DescribeVolumeStatusInput, opts ...request.Option) (*DescribeVolumeStatusOutput, error) { - req, out := c.DescribeVolumeStatusRequest(input) +func (c *EC2) DescribeTrafficMirrorTargetsWithContext(ctx aws.Context, input *DescribeTrafficMirrorTargetsInput, opts ...request.Option) (*DescribeTrafficMirrorTargetsOutput, error) { + req, out := c.DescribeTrafficMirrorTargetsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeVolumeStatusPages iterates over the pages of a DescribeVolumeStatus operation, +// DescribeTrafficMirrorTargetsPages iterates over the pages of a DescribeTrafficMirrorTargets 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. +// See DescribeTrafficMirrorTargets 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. +// // Example iterating over at most 3 pages of a DescribeTrafficMirrorTargets operation. // pageNum := 0 -// err := client.DescribeVolumeStatusPages(params, -// func(page *ec2.DescribeVolumeStatusOutput, lastPage bool) bool { +// err := client.DescribeTrafficMirrorTargetsPages(params, +// func(page *ec2.DescribeTrafficMirrorTargetsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeVolumeStatusPages(input *DescribeVolumeStatusInput, fn func(*DescribeVolumeStatusOutput, bool) bool) error { - return c.DescribeVolumeStatusPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeTrafficMirrorTargetsPages(input *DescribeTrafficMirrorTargetsInput, fn func(*DescribeTrafficMirrorTargetsOutput, bool) bool) error { + return c.DescribeTrafficMirrorTargetsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeVolumeStatusPagesWithContext same as DescribeVolumeStatusPages except +// DescribeTrafficMirrorTargetsPagesWithContext same as DescribeTrafficMirrorTargetsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVolumeStatusPagesWithContext(ctx aws.Context, input *DescribeVolumeStatusInput, fn func(*DescribeVolumeStatusOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeTrafficMirrorTargetsPagesWithContext(ctx aws.Context, input *DescribeTrafficMirrorTargetsInput, fn func(*DescribeTrafficMirrorTargetsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeVolumeStatusInput + var inCpy *DescribeTrafficMirrorTargetsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeVolumeStatusRequest(inCpy) + req, _ := c.DescribeTrafficMirrorTargetsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVolumeStatusOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeTrafficMirrorTargetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeVolumes = "DescribeVolumes" +const opDescribeTransitGatewayAttachments = "DescribeTransitGatewayAttachments" -// DescribeVolumesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVolumes operation. The "output" return +// DescribeTransitGatewayAttachmentsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTransitGatewayAttachments operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVolumes for more information on using the DescribeVolumes +// See DescribeTransitGatewayAttachments for more information on using the DescribeTransitGatewayAttachments // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVolumesRequest method. -// req, resp := client.DescribeVolumesRequest(params) +// // Example sending a request using the DescribeTransitGatewayAttachmentsRequest method. +// req, resp := client.DescribeTransitGatewayAttachmentsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumes -func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *request.Request, output *DescribeVolumesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayAttachments +func (c *EC2) DescribeTransitGatewayAttachmentsRequest(input *DescribeTransitGatewayAttachmentsInput) (req *request.Request, output *DescribeTransitGatewayAttachmentsOutput) { op := &request.Operation{ - Name: opDescribeVolumes, + Name: opDescribeTransitGatewayAttachments, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -20441,135 +22301,130 @@ func (c *EC2) DescribeVolumesRequest(input *DescribeVolumesInput) (req *request. } if input == nil { - input = &DescribeVolumesInput{} + input = &DescribeTransitGatewayAttachmentsInput{} } - output = &DescribeVolumesOutput{} + output = &DescribeTransitGatewayAttachmentsOutput{} req = c.newRequest(op, input, output) return } -// DescribeVolumes API operation for Amazon Elastic Compute Cloud. -// -// Describes the specified EBS volumes or all of your 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. +// DescribeTransitGatewayAttachments API operation for Amazon Elastic Compute Cloud. // -// For more information about EBS volumes, see Amazon EBS Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumes.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Describes one or more attachments between resources and transit gateways. +// By default, all attachments are described. Alternatively, you can filter +// the results by attachment ID, attachment state, resource ID, or resource +// owner. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DescribeVolumes for usage and error information. -// See also, 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) +// API operation DescribeTransitGatewayAttachments for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayAttachments +func (c *EC2) DescribeTransitGatewayAttachments(input *DescribeTransitGatewayAttachmentsInput) (*DescribeTransitGatewayAttachmentsOutput, error) { + req, out := c.DescribeTransitGatewayAttachmentsRequest(input) return out, req.Send() } -// DescribeVolumesWithContext is the same as DescribeVolumes with the addition of +// DescribeTransitGatewayAttachmentsWithContext is the same as DescribeTransitGatewayAttachments with the addition of // the ability to pass a context and additional request options. // -// See DescribeVolumes for details on how to use this API operation. +// See DescribeTransitGatewayAttachments for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVolumesWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.Option) (*DescribeVolumesOutput, error) { - req, out := c.DescribeVolumesRequest(input) +func (c *EC2) DescribeTransitGatewayAttachmentsWithContext(ctx aws.Context, input *DescribeTransitGatewayAttachmentsInput, opts ...request.Option) (*DescribeTransitGatewayAttachmentsOutput, error) { + req, out := c.DescribeTransitGatewayAttachmentsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeVolumesPages iterates over the pages of a DescribeVolumes operation, +// DescribeTransitGatewayAttachmentsPages iterates over the pages of a DescribeTransitGatewayAttachments 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. +// See DescribeTransitGatewayAttachments 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. +// // Example iterating over at most 3 pages of a DescribeTransitGatewayAttachments operation. // pageNum := 0 -// err := client.DescribeVolumesPages(params, -// func(page *ec2.DescribeVolumesOutput, lastPage bool) bool { +// err := client.DescribeTransitGatewayAttachmentsPages(params, +// func(page *ec2.DescribeTransitGatewayAttachmentsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeVolumesPages(input *DescribeVolumesInput, fn func(*DescribeVolumesOutput, bool) bool) error { - return c.DescribeVolumesPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeTransitGatewayAttachmentsPages(input *DescribeTransitGatewayAttachmentsInput, fn func(*DescribeTransitGatewayAttachmentsOutput, bool) bool) error { + return c.DescribeTransitGatewayAttachmentsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeVolumesPagesWithContext same as DescribeVolumesPages except +// DescribeTransitGatewayAttachmentsPagesWithContext same as DescribeTransitGatewayAttachmentsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVolumesPagesWithContext(ctx aws.Context, input *DescribeVolumesInput, fn func(*DescribeVolumesOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeTransitGatewayAttachmentsPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayAttachmentsInput, fn func(*DescribeTransitGatewayAttachmentsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeVolumesInput + var inCpy *DescribeTransitGatewayAttachmentsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeVolumesRequest(inCpy) + req, _ := c.DescribeTransitGatewayAttachmentsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVolumesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeTransitGatewayAttachmentsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeVolumesModifications = "DescribeVolumesModifications" +const opDescribeTransitGatewayMulticastDomains = "DescribeTransitGatewayMulticastDomains" -// DescribeVolumesModificationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVolumesModifications operation. The "output" return +// DescribeTransitGatewayMulticastDomainsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTransitGatewayMulticastDomains operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVolumesModifications for more information on using the DescribeVolumesModifications +// See DescribeTransitGatewayMulticastDomains for more information on using the DescribeTransitGatewayMulticastDomains // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVolumesModificationsRequest method. -// req, resp := client.DescribeVolumesModificationsRequest(params) +// // Example sending a request using the DescribeTransitGatewayMulticastDomainsRequest method. +// req, resp := client.DescribeTransitGatewayMulticastDomainsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesModifications -func (c *EC2) DescribeVolumesModificationsRequest(input *DescribeVolumesModificationsInput) (req *request.Request, output *DescribeVolumesModificationsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayMulticastDomains +func (c *EC2) DescribeTransitGatewayMulticastDomainsRequest(input *DescribeTransitGatewayMulticastDomainsInput) (req *request.Request, output *DescribeTransitGatewayMulticastDomainsOutput) { op := &request.Operation{ - Name: opDescribeVolumesModifications, + Name: opDescribeTransitGatewayMulticastDomains, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -20581,287 +22436,392 @@ func (c *EC2) DescribeVolumesModificationsRequest(input *DescribeVolumesModifica } if input == nil { - input = &DescribeVolumesModificationsInput{} + input = &DescribeTransitGatewayMulticastDomainsInput{} } - output = &DescribeVolumesModificationsOutput{} + output = &DescribeTransitGatewayMulticastDomainsOutput{} req = c.newRequest(op, input, output) return } -// DescribeVolumesModifications API operation for Amazon Elastic Compute Cloud. +// DescribeTransitGatewayMulticastDomains 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 (https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/). -// For more information, see Monitoring Volume Modifications" (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods) -// in the Amazon Elastic Compute Cloud User Guide. +// Describes one or more transit gateway multicast domains. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation DescribeTransitGatewayMulticastDomains for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayMulticastDomains +func (c *EC2) DescribeTransitGatewayMulticastDomains(input *DescribeTransitGatewayMulticastDomainsInput) (*DescribeTransitGatewayMulticastDomainsOutput, error) { + req, out := c.DescribeTransitGatewayMulticastDomainsRequest(input) return out, req.Send() } -// DescribeVolumesModificationsWithContext is the same as DescribeVolumesModifications with the addition of +// DescribeTransitGatewayMulticastDomainsWithContext is the same as DescribeTransitGatewayMulticastDomains with the addition of // the ability to pass a context and additional request options. // -// See DescribeVolumesModifications for details on how to use this API operation. +// See DescribeTransitGatewayMulticastDomains for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVolumesModificationsWithContext(ctx aws.Context, input *DescribeVolumesModificationsInput, opts ...request.Option) (*DescribeVolumesModificationsOutput, error) { - req, out := c.DescribeVolumesModificationsRequest(input) +func (c *EC2) DescribeTransitGatewayMulticastDomainsWithContext(ctx aws.Context, input *DescribeTransitGatewayMulticastDomainsInput, opts ...request.Option) (*DescribeTransitGatewayMulticastDomainsOutput, error) { + req, out := c.DescribeTransitGatewayMulticastDomainsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeVolumesModificationsPages iterates over the pages of a DescribeVolumesModifications operation, +// DescribeTransitGatewayMulticastDomainsPages iterates over the pages of a DescribeTransitGatewayMulticastDomains operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribeVolumesModifications method for more information on how to use this operation. +// See DescribeTransitGatewayMulticastDomains 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 DescribeVolumesModifications operation. +// // Example iterating over at most 3 pages of a DescribeTransitGatewayMulticastDomains operation. // pageNum := 0 -// err := client.DescribeVolumesModificationsPages(params, -// func(page *ec2.DescribeVolumesModificationsOutput, lastPage bool) bool { +// err := client.DescribeTransitGatewayMulticastDomainsPages(params, +// func(page *ec2.DescribeTransitGatewayMulticastDomainsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeVolumesModificationsPages(input *DescribeVolumesModificationsInput, fn func(*DescribeVolumesModificationsOutput, bool) bool) error { - return c.DescribeVolumesModificationsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeTransitGatewayMulticastDomainsPages(input *DescribeTransitGatewayMulticastDomainsInput, fn func(*DescribeTransitGatewayMulticastDomainsOutput, bool) bool) error { + return c.DescribeTransitGatewayMulticastDomainsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeVolumesModificationsPagesWithContext same as DescribeVolumesModificationsPages except +// DescribeTransitGatewayMulticastDomainsPagesWithContext same as DescribeTransitGatewayMulticastDomainsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVolumesModificationsPagesWithContext(ctx aws.Context, input *DescribeVolumesModificationsInput, fn func(*DescribeVolumesModificationsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeTransitGatewayMulticastDomainsPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayMulticastDomainsInput, fn func(*DescribeTransitGatewayMulticastDomainsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeVolumesModificationsInput + var inCpy *DescribeTransitGatewayMulticastDomainsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeVolumesModificationsRequest(inCpy) + req, _ := c.DescribeTransitGatewayMulticastDomainsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVolumesModificationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeTransitGatewayMulticastDomainsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeVpcAttribute = "DescribeVpcAttribute" +const opDescribeTransitGatewayPeeringAttachments = "DescribeTransitGatewayPeeringAttachments" -// DescribeVpcAttributeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcAttribute operation. The "output" return +// DescribeTransitGatewayPeeringAttachmentsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTransitGatewayPeeringAttachments operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVpcAttribute for more information on using the DescribeVpcAttribute +// See DescribeTransitGatewayPeeringAttachments for more information on using the DescribeTransitGatewayPeeringAttachments // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVpcAttributeRequest method. -// req, resp := client.DescribeVpcAttributeRequest(params) +// // Example sending a request using the DescribeTransitGatewayPeeringAttachmentsRequest method. +// req, resp := client.DescribeTransitGatewayPeeringAttachmentsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcAttribute -func (c *EC2) DescribeVpcAttributeRequest(input *DescribeVpcAttributeInput) (req *request.Request, output *DescribeVpcAttributeOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayPeeringAttachments +func (c *EC2) DescribeTransitGatewayPeeringAttachmentsRequest(input *DescribeTransitGatewayPeeringAttachmentsInput) (req *request.Request, output *DescribeTransitGatewayPeeringAttachmentsOutput) { op := &request.Operation{ - Name: opDescribeVpcAttribute, + Name: opDescribeTransitGatewayPeeringAttachments, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DescribeVpcAttributeInput{} + input = &DescribeTransitGatewayPeeringAttachmentsInput{} } - output = &DescribeVpcAttributeOutput{} + output = &DescribeTransitGatewayPeeringAttachmentsOutput{} req = c.newRequest(op, input, output) return } -// DescribeVpcAttribute API operation for Amazon Elastic Compute Cloud. +// DescribeTransitGatewayPeeringAttachments API operation for Amazon Elastic Compute Cloud. // -// Describes the specified attribute of the specified VPC. You can specify only -// one attribute at a time. +// Describes your transit gateway peering attachments. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation DescribeTransitGatewayPeeringAttachments for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayPeeringAttachments +func (c *EC2) DescribeTransitGatewayPeeringAttachments(input *DescribeTransitGatewayPeeringAttachmentsInput) (*DescribeTransitGatewayPeeringAttachmentsOutput, error) { + req, out := c.DescribeTransitGatewayPeeringAttachmentsRequest(input) return out, req.Send() } -// DescribeVpcAttributeWithContext is the same as DescribeVpcAttribute with the addition of +// DescribeTransitGatewayPeeringAttachmentsWithContext is the same as DescribeTransitGatewayPeeringAttachments with the addition of // the ability to pass a context and additional request options. // -// See DescribeVpcAttribute for details on how to use this API operation. +// See DescribeTransitGatewayPeeringAttachments for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcAttributeWithContext(ctx aws.Context, input *DescribeVpcAttributeInput, opts ...request.Option) (*DescribeVpcAttributeOutput, error) { - req, out := c.DescribeVpcAttributeRequest(input) +func (c *EC2) DescribeTransitGatewayPeeringAttachmentsWithContext(ctx aws.Context, input *DescribeTransitGatewayPeeringAttachmentsInput, opts ...request.Option) (*DescribeTransitGatewayPeeringAttachmentsOutput, error) { + req, out := c.DescribeTransitGatewayPeeringAttachmentsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeVpcClassicLink = "DescribeVpcClassicLink" +// DescribeTransitGatewayPeeringAttachmentsPages iterates over the pages of a DescribeTransitGatewayPeeringAttachments operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeTransitGatewayPeeringAttachments 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 DescribeTransitGatewayPeeringAttachments operation. +// pageNum := 0 +// err := client.DescribeTransitGatewayPeeringAttachmentsPages(params, +// func(page *ec2.DescribeTransitGatewayPeeringAttachmentsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeTransitGatewayPeeringAttachmentsPages(input *DescribeTransitGatewayPeeringAttachmentsInput, fn func(*DescribeTransitGatewayPeeringAttachmentsOutput, bool) bool) error { + return c.DescribeTransitGatewayPeeringAttachmentsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// DescribeVpcClassicLinkRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcClassicLink operation. The "output" return +// DescribeTransitGatewayPeeringAttachmentsPagesWithContext same as DescribeTransitGatewayPeeringAttachmentsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeTransitGatewayPeeringAttachmentsPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayPeeringAttachmentsInput, fn func(*DescribeTransitGatewayPeeringAttachmentsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTransitGatewayPeeringAttachmentsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTransitGatewayPeeringAttachmentsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeTransitGatewayPeeringAttachmentsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeTransitGatewayRouteTables = "DescribeTransitGatewayRouteTables" + +// DescribeTransitGatewayRouteTablesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTransitGatewayRouteTables operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVpcClassicLink for more information on using the DescribeVpcClassicLink +// See DescribeTransitGatewayRouteTables for more information on using the DescribeTransitGatewayRouteTables // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVpcClassicLinkRequest method. -// req, resp := client.DescribeVpcClassicLinkRequest(params) +// // Example sending a request using the DescribeTransitGatewayRouteTablesRequest method. +// req, resp := client.DescribeTransitGatewayRouteTablesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLink -func (c *EC2) DescribeVpcClassicLinkRequest(input *DescribeVpcClassicLinkInput) (req *request.Request, output *DescribeVpcClassicLinkOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayRouteTables +func (c *EC2) DescribeTransitGatewayRouteTablesRequest(input *DescribeTransitGatewayRouteTablesInput) (req *request.Request, output *DescribeTransitGatewayRouteTablesOutput) { op := &request.Operation{ - Name: opDescribeVpcClassicLink, + Name: opDescribeTransitGatewayRouteTables, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DescribeVpcClassicLinkInput{} + input = &DescribeTransitGatewayRouteTablesInput{} } - output = &DescribeVpcClassicLinkOutput{} + output = &DescribeTransitGatewayRouteTablesOutput{} req = c.newRequest(op, input, output) return } -// DescribeVpcClassicLink API operation for Amazon Elastic Compute Cloud. +// DescribeTransitGatewayRouteTables API operation for Amazon Elastic Compute Cloud. // -// Describes the ClassicLink status of one or more VPCs. +// Describes one or more transit gateway route tables. By default, all transit +// gateway route tables are described. Alternatively, you can 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 Elastic Compute Cloud's -// API operation DescribeVpcClassicLink for usage and error information. -// See also, 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) +// API operation DescribeTransitGatewayRouteTables for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayRouteTables +func (c *EC2) DescribeTransitGatewayRouteTables(input *DescribeTransitGatewayRouteTablesInput) (*DescribeTransitGatewayRouteTablesOutput, error) { + req, out := c.DescribeTransitGatewayRouteTablesRequest(input) return out, req.Send() } -// DescribeVpcClassicLinkWithContext is the same as DescribeVpcClassicLink with the addition of +// DescribeTransitGatewayRouteTablesWithContext is the same as DescribeTransitGatewayRouteTables with the addition of // the ability to pass a context and additional request options. // -// See DescribeVpcClassicLink for details on how to use this API operation. +// See DescribeTransitGatewayRouteTables for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcClassicLinkWithContext(ctx aws.Context, input *DescribeVpcClassicLinkInput, opts ...request.Option) (*DescribeVpcClassicLinkOutput, error) { - req, out := c.DescribeVpcClassicLinkRequest(input) +func (c *EC2) DescribeTransitGatewayRouteTablesWithContext(ctx aws.Context, input *DescribeTransitGatewayRouteTablesInput, opts ...request.Option) (*DescribeTransitGatewayRouteTablesOutput, error) { + req, out := c.DescribeTransitGatewayRouteTablesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeVpcClassicLinkDnsSupport = "DescribeVpcClassicLinkDnsSupport" - -// DescribeVpcClassicLinkDnsSupportRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcClassicLinkDnsSupport operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. +// DescribeTransitGatewayRouteTablesPages iterates over the pages of a DescribeTransitGatewayRouteTables operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. // -// Use "Send" method on the returned Request to send the API call to the service. +// See DescribeTransitGatewayRouteTables 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 DescribeTransitGatewayRouteTables operation. +// pageNum := 0 +// err := client.DescribeTransitGatewayRouteTablesPages(params, +// func(page *ec2.DescribeTransitGatewayRouteTablesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeTransitGatewayRouteTablesPages(input *DescribeTransitGatewayRouteTablesInput, fn func(*DescribeTransitGatewayRouteTablesOutput, bool) bool) error { + return c.DescribeTransitGatewayRouteTablesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeTransitGatewayRouteTablesPagesWithContext same as DescribeTransitGatewayRouteTablesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeTransitGatewayRouteTablesPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayRouteTablesInput, fn func(*DescribeTransitGatewayRouteTablesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTransitGatewayRouteTablesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTransitGatewayRouteTablesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeTransitGatewayRouteTablesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeTransitGatewayVpcAttachments = "DescribeTransitGatewayVpcAttachments" + +// DescribeTransitGatewayVpcAttachmentsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTransitGatewayVpcAttachments operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVpcClassicLinkDnsSupport for more information on using the DescribeVpcClassicLinkDnsSupport +// See DescribeTransitGatewayVpcAttachments for more information on using the DescribeTransitGatewayVpcAttachments // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVpcClassicLinkDnsSupportRequest method. -// req, resp := client.DescribeVpcClassicLinkDnsSupportRequest(params) +// // Example sending a request using the DescribeTransitGatewayVpcAttachmentsRequest method. +// req, resp := client.DescribeTransitGatewayVpcAttachmentsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLinkDnsSupport -func (c *EC2) DescribeVpcClassicLinkDnsSupportRequest(input *DescribeVpcClassicLinkDnsSupportInput) (req *request.Request, output *DescribeVpcClassicLinkDnsSupportOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayVpcAttachments +func (c *EC2) DescribeTransitGatewayVpcAttachmentsRequest(input *DescribeTransitGatewayVpcAttachmentsInput) (req *request.Request, output *DescribeTransitGatewayVpcAttachmentsOutput) { op := &request.Operation{ - Name: opDescribeVpcClassicLinkDnsSupport, + Name: opDescribeTransitGatewayVpcAttachments, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -20873,131 +22833,128 @@ func (c *EC2) DescribeVpcClassicLinkDnsSupportRequest(input *DescribeVpcClassicL } if input == nil { - input = &DescribeVpcClassicLinkDnsSupportInput{} + input = &DescribeTransitGatewayVpcAttachmentsInput{} } - output = &DescribeVpcClassicLinkDnsSupportOutput{} + output = &DescribeTransitGatewayVpcAttachmentsOutput{} req = c.newRequest(op, input, output) return } -// DescribeVpcClassicLinkDnsSupport API operation for Amazon Elastic Compute Cloud. +// DescribeTransitGatewayVpcAttachments 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, -// see ClassicLink (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Describes one or more VPC attachments. By default, all VPC attachments are +// described. Alternatively, you can 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 Elastic Compute Cloud's -// API operation DescribeVpcClassicLinkDnsSupport for usage and error information. -// See also, 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) +// API operation DescribeTransitGatewayVpcAttachments for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGatewayVpcAttachments +func (c *EC2) DescribeTransitGatewayVpcAttachments(input *DescribeTransitGatewayVpcAttachmentsInput) (*DescribeTransitGatewayVpcAttachmentsOutput, error) { + req, out := c.DescribeTransitGatewayVpcAttachmentsRequest(input) return out, req.Send() } -// DescribeVpcClassicLinkDnsSupportWithContext is the same as DescribeVpcClassicLinkDnsSupport with the addition of +// DescribeTransitGatewayVpcAttachmentsWithContext is the same as DescribeTransitGatewayVpcAttachments with the addition of // the ability to pass a context and additional request options. // -// See DescribeVpcClassicLinkDnsSupport for details on how to use this API operation. +// See DescribeTransitGatewayVpcAttachments for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *DescribeVpcClassicLinkDnsSupportInput, opts ...request.Option) (*DescribeVpcClassicLinkDnsSupportOutput, error) { - req, out := c.DescribeVpcClassicLinkDnsSupportRequest(input) +func (c *EC2) DescribeTransitGatewayVpcAttachmentsWithContext(ctx aws.Context, input *DescribeTransitGatewayVpcAttachmentsInput, opts ...request.Option) (*DescribeTransitGatewayVpcAttachmentsOutput, error) { + req, out := c.DescribeTransitGatewayVpcAttachmentsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeVpcClassicLinkDnsSupportPages iterates over the pages of a DescribeVpcClassicLinkDnsSupport operation, +// DescribeTransitGatewayVpcAttachmentsPages iterates over the pages of a DescribeTransitGatewayVpcAttachments operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribeVpcClassicLinkDnsSupport method for more information on how to use this operation. +// See DescribeTransitGatewayVpcAttachments 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 DescribeVpcClassicLinkDnsSupport operation. +// // Example iterating over at most 3 pages of a DescribeTransitGatewayVpcAttachments operation. // pageNum := 0 -// err := client.DescribeVpcClassicLinkDnsSupportPages(params, -// func(page *ec2.DescribeVpcClassicLinkDnsSupportOutput, lastPage bool) bool { +// err := client.DescribeTransitGatewayVpcAttachmentsPages(params, +// func(page *ec2.DescribeTransitGatewayVpcAttachmentsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeVpcClassicLinkDnsSupportPages(input *DescribeVpcClassicLinkDnsSupportInput, fn func(*DescribeVpcClassicLinkDnsSupportOutput, bool) bool) error { - return c.DescribeVpcClassicLinkDnsSupportPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeTransitGatewayVpcAttachmentsPages(input *DescribeTransitGatewayVpcAttachmentsInput, fn func(*DescribeTransitGatewayVpcAttachmentsOutput, bool) bool) error { + return c.DescribeTransitGatewayVpcAttachmentsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeVpcClassicLinkDnsSupportPagesWithContext same as DescribeVpcClassicLinkDnsSupportPages except +// DescribeTransitGatewayVpcAttachmentsPagesWithContext same as DescribeTransitGatewayVpcAttachmentsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcClassicLinkDnsSupportPagesWithContext(ctx aws.Context, input *DescribeVpcClassicLinkDnsSupportInput, fn func(*DescribeVpcClassicLinkDnsSupportOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeTransitGatewayVpcAttachmentsPagesWithContext(ctx aws.Context, input *DescribeTransitGatewayVpcAttachmentsInput, fn func(*DescribeTransitGatewayVpcAttachmentsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeVpcClassicLinkDnsSupportInput + var inCpy *DescribeTransitGatewayVpcAttachmentsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeVpcClassicLinkDnsSupportRequest(inCpy) + req, _ := c.DescribeTransitGatewayVpcAttachmentsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVpcClassicLinkDnsSupportOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeTransitGatewayVpcAttachmentsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeVpcEndpointConnectionNotifications = "DescribeVpcEndpointConnectionNotifications" +const opDescribeTransitGateways = "DescribeTransitGateways" -// DescribeVpcEndpointConnectionNotificationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcEndpointConnectionNotifications operation. The "output" return +// DescribeTransitGatewaysRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTransitGateways operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVpcEndpointConnectionNotifications for more information on using the DescribeVpcEndpointConnectionNotifications +// See DescribeTransitGateways for more information on using the DescribeTransitGateways // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVpcEndpointConnectionNotificationsRequest method. -// req, resp := client.DescribeVpcEndpointConnectionNotificationsRequest(params) +// // Example sending a request using the DescribeTransitGatewaysRequest method. +// req, resp := client.DescribeTransitGatewaysRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointConnectionNotifications -func (c *EC2) DescribeVpcEndpointConnectionNotificationsRequest(input *DescribeVpcEndpointConnectionNotificationsInput) (req *request.Request, output *DescribeVpcEndpointConnectionNotificationsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGateways +func (c *EC2) DescribeTransitGatewaysRequest(input *DescribeTransitGatewaysInput) (req *request.Request, output *DescribeTransitGatewaysOutput) { op := &request.Operation{ - Name: opDescribeVpcEndpointConnectionNotifications, + Name: opDescribeTransitGateways, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -21009,257 +22966,206 @@ func (c *EC2) DescribeVpcEndpointConnectionNotificationsRequest(input *DescribeV } if input == nil { - input = &DescribeVpcEndpointConnectionNotificationsInput{} + input = &DescribeTransitGatewaysInput{} } - output = &DescribeVpcEndpointConnectionNotificationsOutput{} + output = &DescribeTransitGatewaysOutput{} req = c.newRequest(op, input, output) return } -// DescribeVpcEndpointConnectionNotifications API operation for Amazon Elastic Compute Cloud. +// DescribeTransitGateways API operation for Amazon Elastic Compute Cloud. // -// Describes the connection notifications for VPC endpoints and VPC endpoint -// services. +// Describes one or more transit gateways. By default, all transit gateways +// are described. Alternatively, you can 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 Elastic Compute Cloud's -// API operation DescribeVpcEndpointConnectionNotifications for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointConnectionNotifications -func (c *EC2) DescribeVpcEndpointConnectionNotifications(input *DescribeVpcEndpointConnectionNotificationsInput) (*DescribeVpcEndpointConnectionNotificationsOutput, error) { - req, out := c.DescribeVpcEndpointConnectionNotificationsRequest(input) +// API operation DescribeTransitGateways for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeTransitGateways +func (c *EC2) DescribeTransitGateways(input *DescribeTransitGatewaysInput) (*DescribeTransitGatewaysOutput, error) { + req, out := c.DescribeTransitGatewaysRequest(input) return out, req.Send() } -// DescribeVpcEndpointConnectionNotificationsWithContext is the same as DescribeVpcEndpointConnectionNotifications with the addition of +// DescribeTransitGatewaysWithContext is the same as DescribeTransitGateways with the addition of // the ability to pass a context and additional request options. // -// See DescribeVpcEndpointConnectionNotifications for details on how to use this API operation. +// See DescribeTransitGateways for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointConnectionNotificationsWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionNotificationsInput, opts ...request.Option) (*DescribeVpcEndpointConnectionNotificationsOutput, error) { - req, out := c.DescribeVpcEndpointConnectionNotificationsRequest(input) +func (c *EC2) DescribeTransitGatewaysWithContext(ctx aws.Context, input *DescribeTransitGatewaysInput, opts ...request.Option) (*DescribeTransitGatewaysOutput, error) { + req, out := c.DescribeTransitGatewaysRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeVpcEndpointConnectionNotificationsPages iterates over the pages of a DescribeVpcEndpointConnectionNotifications operation, +// DescribeTransitGatewaysPages iterates over the pages of a DescribeTransitGateways operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribeVpcEndpointConnectionNotifications method for more information on how to use this operation. +// See DescribeTransitGateways 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 DescribeVpcEndpointConnectionNotifications operation. +// // Example iterating over at most 3 pages of a DescribeTransitGateways operation. // pageNum := 0 -// err := client.DescribeVpcEndpointConnectionNotificationsPages(params, -// func(page *ec2.DescribeVpcEndpointConnectionNotificationsOutput, lastPage bool) bool { +// err := client.DescribeTransitGatewaysPages(params, +// func(page *ec2.DescribeTransitGatewaysOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeVpcEndpointConnectionNotificationsPages(input *DescribeVpcEndpointConnectionNotificationsInput, fn func(*DescribeVpcEndpointConnectionNotificationsOutput, bool) bool) error { - return c.DescribeVpcEndpointConnectionNotificationsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeTransitGatewaysPages(input *DescribeTransitGatewaysInput, fn func(*DescribeTransitGatewaysOutput, bool) bool) error { + return c.DescribeTransitGatewaysPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeVpcEndpointConnectionNotificationsPagesWithContext same as DescribeVpcEndpointConnectionNotificationsPages except +// DescribeTransitGatewaysPagesWithContext same as DescribeTransitGatewaysPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointConnectionNotificationsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionNotificationsInput, fn func(*DescribeVpcEndpointConnectionNotificationsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeTransitGatewaysPagesWithContext(ctx aws.Context, input *DescribeTransitGatewaysInput, fn func(*DescribeTransitGatewaysOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeVpcEndpointConnectionNotificationsInput + var inCpy *DescribeTransitGatewaysInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeVpcEndpointConnectionNotificationsRequest(inCpy) + req, _ := c.DescribeTransitGatewaysRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVpcEndpointConnectionNotificationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeTransitGatewaysOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeVpcEndpointConnections = "DescribeVpcEndpointConnections" +const opDescribeVolumeAttribute = "DescribeVolumeAttribute" -// DescribeVpcEndpointConnectionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcEndpointConnections operation. The "output" return +// DescribeVolumeAttributeRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVolumeAttribute operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVpcEndpointConnections for more information on using the DescribeVpcEndpointConnections +// See DescribeVolumeAttribute for more information on using the DescribeVolumeAttribute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVpcEndpointConnectionsRequest method. -// req, resp := client.DescribeVpcEndpointConnectionsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointConnections -func (c *EC2) DescribeVpcEndpointConnectionsRequest(input *DescribeVpcEndpointConnectionsInput) (req *request.Request, output *DescribeVpcEndpointConnectionsOutput) { +// See also, 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: opDescribeVpcEndpointConnections, + Name: opDescribeVolumeAttribute, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &DescribeVpcEndpointConnectionsInput{} + input = &DescribeVolumeAttributeInput{} } - output = &DescribeVpcEndpointConnectionsOutput{} + output = &DescribeVolumeAttributeOutput{} req = c.newRequest(op, input, output) return } -// DescribeVpcEndpointConnections API operation for Amazon Elastic Compute Cloud. +// DescribeVolumeAttribute API operation for Amazon Elastic Compute Cloud. // -// Describes the VPC endpoint connections to your VPC endpoint services, including -// any endpoints that are pending your acceptance. +// 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 (https://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 DescribeVpcEndpointConnections for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointConnections -func (c *EC2) DescribeVpcEndpointConnections(input *DescribeVpcEndpointConnectionsInput) (*DescribeVpcEndpointConnectionsOutput, error) { - req, out := c.DescribeVpcEndpointConnectionsRequest(input) +// API operation DescribeVolumeAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeAttribute +func (c *EC2) DescribeVolumeAttribute(input *DescribeVolumeAttributeInput) (*DescribeVolumeAttributeOutput, error) { + req, out := c.DescribeVolumeAttributeRequest(input) return out, req.Send() } -// DescribeVpcEndpointConnectionsWithContext is the same as DescribeVpcEndpointConnections with the addition of +// DescribeVolumeAttributeWithContext is the same as DescribeVolumeAttribute with the addition of // the ability to pass a context and additional request options. // -// See DescribeVpcEndpointConnections for details on how to use this API operation. +// See DescribeVolumeAttribute for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointConnectionsWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionsInput, opts ...request.Option) (*DescribeVpcEndpointConnectionsOutput, error) { - req, out := c.DescribeVpcEndpointConnectionsRequest(input) +func (c *EC2) DescribeVolumeAttributeWithContext(ctx aws.Context, input *DescribeVolumeAttributeInput, opts ...request.Option) (*DescribeVolumeAttributeOutput, error) { + req, out := c.DescribeVolumeAttributeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeVpcEndpointConnectionsPages iterates over the pages of a DescribeVpcEndpointConnections operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See DescribeVpcEndpointConnections 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 DescribeVpcEndpointConnections operation. -// pageNum := 0 -// err := client.DescribeVpcEndpointConnectionsPages(params, -// func(page *ec2.DescribeVpcEndpointConnectionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) DescribeVpcEndpointConnectionsPages(input *DescribeVpcEndpointConnectionsInput, fn func(*DescribeVpcEndpointConnectionsOutput, bool) bool) error { - return c.DescribeVpcEndpointConnectionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// DescribeVpcEndpointConnectionsPagesWithContext same as DescribeVpcEndpointConnectionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointConnectionsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionsInput, fn func(*DescribeVpcEndpointConnectionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeVpcEndpointConnectionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVpcEndpointConnectionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVpcEndpointConnectionsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opDescribeVpcEndpointServiceConfigurations = "DescribeVpcEndpointServiceConfigurations" +const opDescribeVolumeStatus = "DescribeVolumeStatus" -// DescribeVpcEndpointServiceConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcEndpointServiceConfigurations operation. The "output" return +// DescribeVolumeStatusRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVolumeStatus operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVpcEndpointServiceConfigurations for more information on using the DescribeVpcEndpointServiceConfigurations +// See DescribeVolumeStatus for more information on using the DescribeVolumeStatus // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVpcEndpointServiceConfigurationsRequest method. -// req, resp := client.DescribeVpcEndpointServiceConfigurationsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServiceConfigurations -func (c *EC2) DescribeVpcEndpointServiceConfigurationsRequest(input *DescribeVpcEndpointServiceConfigurationsInput) (req *request.Request, output *DescribeVpcEndpointServiceConfigurationsOutput) { +// See also, 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: opDescribeVpcEndpointServiceConfigurations, + Name: opDescribeVolumeStatus, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -21271,125 +23177,162 @@ func (c *EC2) DescribeVpcEndpointServiceConfigurationsRequest(input *DescribeVpc } if input == nil { - input = &DescribeVpcEndpointServiceConfigurationsInput{} + input = &DescribeVolumeStatusInput{} } - output = &DescribeVpcEndpointServiceConfigurationsOutput{} + output = &DescribeVolumeStatusOutput{} req = c.newRequest(op, input, output) return } -// DescribeVpcEndpointServiceConfigurations API operation for Amazon Elastic Compute Cloud. +// DescribeVolumeStatus API operation for Amazon Elastic Compute Cloud. // -// Describes the VPC endpoint service configurations in your account (your services). +// 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 about volume status, see Monitoring the Status of Your Volumes +// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/monitoring-volume-status.html) +// in the Amazon Elastic Compute Cloud User Guide. +// +// 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 DescribeVpcEndpointServiceConfigurations for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServiceConfigurations -func (c *EC2) DescribeVpcEndpointServiceConfigurations(input *DescribeVpcEndpointServiceConfigurationsInput) (*DescribeVpcEndpointServiceConfigurationsOutput, error) { - req, out := c.DescribeVpcEndpointServiceConfigurationsRequest(input) +// API operation DescribeVolumeStatus for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumeStatus +func (c *EC2) DescribeVolumeStatus(input *DescribeVolumeStatusInput) (*DescribeVolumeStatusOutput, error) { + req, out := c.DescribeVolumeStatusRequest(input) return out, req.Send() } -// DescribeVpcEndpointServiceConfigurationsWithContext is the same as DescribeVpcEndpointServiceConfigurations with the addition of +// DescribeVolumeStatusWithContext is the same as DescribeVolumeStatus with the addition of // the ability to pass a context and additional request options. // -// See DescribeVpcEndpointServiceConfigurations for details on how to use this API operation. +// See DescribeVolumeStatus for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointServiceConfigurationsWithContext(ctx aws.Context, input *DescribeVpcEndpointServiceConfigurationsInput, opts ...request.Option) (*DescribeVpcEndpointServiceConfigurationsOutput, error) { - req, out := c.DescribeVpcEndpointServiceConfigurationsRequest(input) +func (c *EC2) DescribeVolumeStatusWithContext(ctx aws.Context, input *DescribeVolumeStatusInput, opts ...request.Option) (*DescribeVolumeStatusOutput, error) { + req, out := c.DescribeVolumeStatusRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeVpcEndpointServiceConfigurationsPages iterates over the pages of a DescribeVpcEndpointServiceConfigurations operation, +// 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 DescribeVpcEndpointServiceConfigurations method for more information on how to use this operation. +// 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 DescribeVpcEndpointServiceConfigurations operation. +// // Example iterating over at most 3 pages of a DescribeVolumeStatus operation. // pageNum := 0 -// err := client.DescribeVpcEndpointServiceConfigurationsPages(params, -// func(page *ec2.DescribeVpcEndpointServiceConfigurationsOutput, lastPage bool) bool { +// err := client.DescribeVolumeStatusPages(params, +// func(page *ec2.DescribeVolumeStatusOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeVpcEndpointServiceConfigurationsPages(input *DescribeVpcEndpointServiceConfigurationsInput, fn func(*DescribeVpcEndpointServiceConfigurationsOutput, bool) bool) error { - return c.DescribeVpcEndpointServiceConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeVolumeStatusPages(input *DescribeVolumeStatusInput, fn func(*DescribeVolumeStatusOutput, bool) bool) error { + return c.DescribeVolumeStatusPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeVpcEndpointServiceConfigurationsPagesWithContext same as DescribeVpcEndpointServiceConfigurationsPages except +// DescribeVolumeStatusPagesWithContext same as DescribeVolumeStatusPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointServiceConfigurationsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointServiceConfigurationsInput, fn func(*DescribeVpcEndpointServiceConfigurationsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeVolumeStatusPagesWithContext(ctx aws.Context, input *DescribeVolumeStatusInput, fn func(*DescribeVolumeStatusOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeVpcEndpointServiceConfigurationsInput + var inCpy *DescribeVolumeStatusInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeVpcEndpointServiceConfigurationsRequest(inCpy) + req, _ := c.DescribeVolumeStatusRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVpcEndpointServiceConfigurationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeVolumeStatusOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeVpcEndpointServicePermissions = "DescribeVpcEndpointServicePermissions" +const opDescribeVolumes = "DescribeVolumes" -// DescribeVpcEndpointServicePermissionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcEndpointServicePermissions operation. The "output" return +// DescribeVolumesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVolumes operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVpcEndpointServicePermissions for more information on using the DescribeVpcEndpointServicePermissions +// See DescribeVolumes for more information on using the DescribeVolumes // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVpcEndpointServicePermissionsRequest method. -// req, resp := client.DescribeVpcEndpointServicePermissionsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServicePermissions -func (c *EC2) DescribeVpcEndpointServicePermissionsRequest(input *DescribeVpcEndpointServicePermissionsInput) (req *request.Request, output *DescribeVpcEndpointServicePermissionsOutput) { +// See also, 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: opDescribeVpcEndpointServicePermissions, + Name: opDescribeVolumes, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -21401,330 +23344,431 @@ func (c *EC2) DescribeVpcEndpointServicePermissionsRequest(input *DescribeVpcEnd } if input == nil { - input = &DescribeVpcEndpointServicePermissionsInput{} + input = &DescribeVolumesInput{} } - output = &DescribeVpcEndpointServicePermissionsOutput{} + output = &DescribeVolumesOutput{} req = c.newRequest(op, input, output) return } -// DescribeVpcEndpointServicePermissions API operation for Amazon Elastic Compute Cloud. +// DescribeVolumes API operation for Amazon Elastic Compute Cloud. // -// Describes the principals (service consumers) that are permitted to discover -// your VPC endpoint service. +// Describes the specified EBS volumes or all of your 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 (https://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 DescribeVpcEndpointServicePermissions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServicePermissions -func (c *EC2) DescribeVpcEndpointServicePermissions(input *DescribeVpcEndpointServicePermissionsInput) (*DescribeVpcEndpointServicePermissionsOutput, error) { - req, out := c.DescribeVpcEndpointServicePermissionsRequest(input) +// API operation DescribeVolumes for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumes +func (c *EC2) DescribeVolumes(input *DescribeVolumesInput) (*DescribeVolumesOutput, error) { + req, out := c.DescribeVolumesRequest(input) return out, req.Send() } -// DescribeVpcEndpointServicePermissionsWithContext is the same as DescribeVpcEndpointServicePermissions with the addition of +// DescribeVolumesWithContext is the same as DescribeVolumes with the addition of // the ability to pass a context and additional request options. // -// See DescribeVpcEndpointServicePermissions for details on how to use this API operation. +// See DescribeVolumes for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointServicePermissionsWithContext(ctx aws.Context, input *DescribeVpcEndpointServicePermissionsInput, opts ...request.Option) (*DescribeVpcEndpointServicePermissionsOutput, error) { - req, out := c.DescribeVpcEndpointServicePermissionsRequest(input) +func (c *EC2) DescribeVolumesWithContext(ctx aws.Context, input *DescribeVolumesInput, opts ...request.Option) (*DescribeVolumesOutput, error) { + req, out := c.DescribeVolumesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeVpcEndpointServicePermissionsPages iterates over the pages of a DescribeVpcEndpointServicePermissions operation, +// 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 DescribeVpcEndpointServicePermissions method for more information on how to use this operation. +// 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 DescribeVpcEndpointServicePermissions operation. +// // Example iterating over at most 3 pages of a DescribeVolumes operation. // pageNum := 0 -// err := client.DescribeVpcEndpointServicePermissionsPages(params, -// func(page *ec2.DescribeVpcEndpointServicePermissionsOutput, lastPage bool) bool { +// err := client.DescribeVolumesPages(params, +// func(page *ec2.DescribeVolumesOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeVpcEndpointServicePermissionsPages(input *DescribeVpcEndpointServicePermissionsInput, fn func(*DescribeVpcEndpointServicePermissionsOutput, bool) bool) error { - return c.DescribeVpcEndpointServicePermissionsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeVolumesPages(input *DescribeVolumesInput, fn func(*DescribeVolumesOutput, bool) bool) error { + return c.DescribeVolumesPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeVpcEndpointServicePermissionsPagesWithContext same as DescribeVpcEndpointServicePermissionsPages except +// DescribeVolumesPagesWithContext same as DescribeVolumesPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointServicePermissionsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointServicePermissionsInput, fn func(*DescribeVpcEndpointServicePermissionsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeVolumesPagesWithContext(ctx aws.Context, input *DescribeVolumesInput, fn func(*DescribeVolumesOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeVpcEndpointServicePermissionsInput + var inCpy *DescribeVolumesInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeVpcEndpointServicePermissionsRequest(inCpy) + req, _ := c.DescribeVolumesRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVpcEndpointServicePermissionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeVolumesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeVpcEndpointServices = "DescribeVpcEndpointServices" +const opDescribeVolumesModifications = "DescribeVolumesModifications" -// DescribeVpcEndpointServicesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcEndpointServices operation. The "output" return +// DescribeVolumesModificationsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVolumesModifications operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVpcEndpointServices for more information on using the DescribeVpcEndpointServices +// See DescribeVolumesModifications for more information on using the DescribeVolumesModifications // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVpcEndpointServicesRequest method. -// req, resp := client.DescribeVpcEndpointServicesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServices -func (c *EC2) DescribeVpcEndpointServicesRequest(input *DescribeVpcEndpointServicesInput) (req *request.Request, output *DescribeVpcEndpointServicesOutput) { +// See also, 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: opDescribeVpcEndpointServices, + Name: opDescribeVolumesModifications, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DescribeVpcEndpointServicesInput{} + input = &DescribeVolumesModificationsInput{} } - output = &DescribeVpcEndpointServicesOutput{} + output = &DescribeVolumesModificationsOutput{} req = c.newRequest(op, input, output) return } -// DescribeVpcEndpointServices API operation for Amazon Elastic Compute Cloud. +// DescribeVolumesModifications API operation for Amazon Elastic Compute Cloud. // -// Describes available services to which you can create a VPC endpoint. +// 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 (https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/). +// For more information, see Monitoring Volume Modifications" (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods) +// 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 DescribeVpcEndpointServices for usage and error information. -// See also, 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) +// API operation DescribeVolumesModifications for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVolumesModifications +func (c *EC2) DescribeVolumesModifications(input *DescribeVolumesModificationsInput) (*DescribeVolumesModificationsOutput, error) { + req, out := c.DescribeVolumesModificationsRequest(input) return out, req.Send() } -// DescribeVpcEndpointServicesWithContext is the same as DescribeVpcEndpointServices with the addition of +// DescribeVolumesModificationsWithContext is the same as DescribeVolumesModifications with the addition of // the ability to pass a context and additional request options. // -// See DescribeVpcEndpointServices for details on how to use this API operation. +// See DescribeVolumesModifications for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointServicesWithContext(ctx aws.Context, input *DescribeVpcEndpointServicesInput, opts ...request.Option) (*DescribeVpcEndpointServicesOutput, error) { - req, out := c.DescribeVpcEndpointServicesRequest(input) +func (c *EC2) DescribeVolumesModificationsWithContext(ctx aws.Context, input *DescribeVolumesModificationsInput, opts ...request.Option) (*DescribeVolumesModificationsOutput, error) { + req, out := c.DescribeVolumesModificationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeVpcEndpoints = "DescribeVpcEndpoints" +// DescribeVolumesModificationsPages iterates over the pages of a DescribeVolumesModifications operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVolumesModifications 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 DescribeVolumesModifications operation. +// pageNum := 0 +// err := client.DescribeVolumesModificationsPages(params, +// func(page *ec2.DescribeVolumesModificationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVolumesModificationsPages(input *DescribeVolumesModificationsInput, fn func(*DescribeVolumesModificationsOutput, bool) bool) error { + return c.DescribeVolumesModificationsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// DescribeVpcEndpointsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcEndpoints operation. The "output" return +// DescribeVolumesModificationsPagesWithContext same as DescribeVolumesModificationsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeVolumesModificationsPagesWithContext(ctx aws.Context, input *DescribeVolumesModificationsInput, fn func(*DescribeVolumesModificationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVolumesModificationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVolumesModificationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeVolumesModificationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeVpcAttribute = "DescribeVpcAttribute" + +// DescribeVpcAttributeRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVpcAttribute operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVpcEndpoints for more information on using the DescribeVpcEndpoints +// See DescribeVpcAttribute for more information on using the DescribeVpcAttribute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVpcEndpointsRequest method. -// req, resp := client.DescribeVpcEndpointsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpoints -func (c *EC2) DescribeVpcEndpointsRequest(input *DescribeVpcEndpointsInput) (req *request.Request, output *DescribeVpcEndpointsOutput) { +// See also, 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: opDescribeVpcEndpoints, + Name: opDescribeVpcAttribute, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &DescribeVpcEndpointsInput{} + input = &DescribeVpcAttributeInput{} } - output = &DescribeVpcEndpointsOutput{} + output = &DescribeVpcAttributeOutput{} req = c.newRequest(op, input, output) return } -// DescribeVpcEndpoints API operation for Amazon Elastic Compute Cloud. +// DescribeVpcAttribute API operation for Amazon Elastic Compute Cloud. // -// Describes one or more of your VPC endpoints. +// 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 DescribeVpcEndpoints for usage and error information. -// See also, 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) +// API operation DescribeVpcAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcAttribute +func (c *EC2) DescribeVpcAttribute(input *DescribeVpcAttributeInput) (*DescribeVpcAttributeOutput, error) { + req, out := c.DescribeVpcAttributeRequest(input) return out, req.Send() } -// DescribeVpcEndpointsWithContext is the same as DescribeVpcEndpoints with the addition of +// DescribeVpcAttributeWithContext is the same as DescribeVpcAttribute with the addition of // the ability to pass a context and additional request options. // -// See DescribeVpcEndpoints for details on how to use this API operation. +// See DescribeVpcAttribute for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointsWithContext(ctx aws.Context, input *DescribeVpcEndpointsInput, opts ...request.Option) (*DescribeVpcEndpointsOutput, error) { - req, out := c.DescribeVpcEndpointsRequest(input) +func (c *EC2) DescribeVpcAttributeWithContext(ctx aws.Context, input *DescribeVpcAttributeInput, opts ...request.Option) (*DescribeVpcAttributeOutput, error) { + req, out := c.DescribeVpcAttributeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeVpcEndpointsPages iterates over the pages of a DescribeVpcEndpoints operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. +const opDescribeVpcClassicLink = "DescribeVpcClassicLink" + +// DescribeVpcClassicLinkRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVpcClassicLink operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. // -// See DescribeVpcEndpoints method for more information on how to use this operation. +// 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. // -// Note: This operation can generate multiple requests to a service. +// See DescribeVpcClassicLink for more information on using the DescribeVpcClassicLink +// API call, and error handling. // -// // Example iterating over at most 3 pages of a DescribeVpcEndpoints operation. -// pageNum := 0 -// err := client.DescribeVpcEndpointsPages(params, -// func(page *ec2.DescribeVpcEndpointsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// 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. // -func (c *EC2) DescribeVpcEndpointsPages(input *DescribeVpcEndpointsInput, fn func(*DescribeVpcEndpointsOutput, bool) bool) error { - return c.DescribeVpcEndpointsPagesWithContext(aws.BackgroundContext(), input, fn) +// +// // 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) +// } +// +// See also, 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 } -// DescribeVpcEndpointsPagesWithContext same as DescribeVpcEndpointsPages except -// it takes a Context and allows setting request options on the pages. +// 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. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLink +func (c *EC2) DescribeVpcClassicLink(input *DescribeVpcClassicLinkInput) (*DescribeVpcClassicLinkOutput, error) { + req, out := c.DescribeVpcClassicLinkRequest(input) + return out, req.Send() +} + +// DescribeVpcClassicLinkWithContext is the same as DescribeVpcClassicLink with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeVpcClassicLink for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcEndpointsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointsInput, fn func(*DescribeVpcEndpointsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *DescribeVpcEndpointsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.DescribeVpcEndpointsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVpcEndpointsOutput), !p.HasNextPage()) - } - return p.Err() +func (c *EC2) DescribeVpcClassicLinkWithContext(ctx aws.Context, input *DescribeVpcClassicLinkInput, opts ...request.Option) (*DescribeVpcClassicLinkOutput, error) { + req, out := c.DescribeVpcClassicLinkRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -const opDescribeVpcPeeringConnections = "DescribeVpcPeeringConnections" +const opDescribeVpcClassicLinkDnsSupport = "DescribeVpcClassicLinkDnsSupport" -// DescribeVpcPeeringConnectionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcPeeringConnections operation. The "output" return +// DescribeVpcClassicLinkDnsSupportRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVpcClassicLinkDnsSupport operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVpcPeeringConnections for more information on using the DescribeVpcPeeringConnections +// See DescribeVpcClassicLinkDnsSupport for more information on using the DescribeVpcClassicLinkDnsSupport // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVpcPeeringConnectionsRequest method. -// req, resp := client.DescribeVpcPeeringConnectionsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcPeeringConnections -func (c *EC2) DescribeVpcPeeringConnectionsRequest(input *DescribeVpcPeeringConnectionsInput) (req *request.Request, output *DescribeVpcPeeringConnectionsOutput) { +// See also, 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: opDescribeVpcPeeringConnections, + Name: opDescribeVpcClassicLinkDnsSupport, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -21736,125 +23780,133 @@ func (c *EC2) DescribeVpcPeeringConnectionsRequest(input *DescribeVpcPeeringConn } if input == nil { - input = &DescribeVpcPeeringConnectionsInput{} + input = &DescribeVpcClassicLinkDnsSupportInput{} } - output = &DescribeVpcPeeringConnectionsOutput{} + output = &DescribeVpcClassicLinkDnsSupportOutput{} req = c.newRequest(op, input, output) return } -// DescribeVpcPeeringConnections API operation for Amazon Elastic Compute Cloud. +// DescribeVpcClassicLinkDnsSupport API operation for Amazon Elastic Compute Cloud. // -// Describes one or more of your VPC peering connections. +// 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, +// see ClassicLink (https://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 DescribeVpcPeeringConnections for usage and error information. -// See also, 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) +// API operation DescribeVpcClassicLinkDnsSupport for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcClassicLinkDnsSupport +func (c *EC2) DescribeVpcClassicLinkDnsSupport(input *DescribeVpcClassicLinkDnsSupportInput) (*DescribeVpcClassicLinkDnsSupportOutput, error) { + req, out := c.DescribeVpcClassicLinkDnsSupportRequest(input) return out, req.Send() } -// DescribeVpcPeeringConnectionsWithContext is the same as DescribeVpcPeeringConnections with the addition of +// DescribeVpcClassicLinkDnsSupportWithContext is the same as DescribeVpcClassicLinkDnsSupport with the addition of // the ability to pass a context and additional request options. // -// See DescribeVpcPeeringConnections for details on how to use this API operation. +// See DescribeVpcClassicLinkDnsSupport for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcPeeringConnectionsWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, opts ...request.Option) (*DescribeVpcPeeringConnectionsOutput, error) { - req, out := c.DescribeVpcPeeringConnectionsRequest(input) +func (c *EC2) DescribeVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *DescribeVpcClassicLinkDnsSupportInput, opts ...request.Option) (*DescribeVpcClassicLinkDnsSupportOutput, error) { + req, out := c.DescribeVpcClassicLinkDnsSupportRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeVpcPeeringConnectionsPages iterates over the pages of a DescribeVpcPeeringConnections operation, +// DescribeVpcClassicLinkDnsSupportPages iterates over the pages of a DescribeVpcClassicLinkDnsSupport operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribeVpcPeeringConnections method for more information on how to use this operation. +// See DescribeVpcClassicLinkDnsSupport 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 DescribeVpcPeeringConnections operation. +// // Example iterating over at most 3 pages of a DescribeVpcClassicLinkDnsSupport operation. // pageNum := 0 -// err := client.DescribeVpcPeeringConnectionsPages(params, -// func(page *ec2.DescribeVpcPeeringConnectionsOutput, lastPage bool) bool { +// err := client.DescribeVpcClassicLinkDnsSupportPages(params, +// func(page *ec2.DescribeVpcClassicLinkDnsSupportOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeVpcPeeringConnectionsPages(input *DescribeVpcPeeringConnectionsInput, fn func(*DescribeVpcPeeringConnectionsOutput, bool) bool) error { - return c.DescribeVpcPeeringConnectionsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeVpcClassicLinkDnsSupportPages(input *DescribeVpcClassicLinkDnsSupportInput, fn func(*DescribeVpcClassicLinkDnsSupportOutput, bool) bool) error { + return c.DescribeVpcClassicLinkDnsSupportPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeVpcPeeringConnectionsPagesWithContext same as DescribeVpcPeeringConnectionsPages except +// DescribeVpcClassicLinkDnsSupportPagesWithContext same as DescribeVpcClassicLinkDnsSupportPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcPeeringConnectionsPagesWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, fn func(*DescribeVpcPeeringConnectionsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeVpcClassicLinkDnsSupportPagesWithContext(ctx aws.Context, input *DescribeVpcClassicLinkDnsSupportInput, fn func(*DescribeVpcClassicLinkDnsSupportOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeVpcPeeringConnectionsInput + var inCpy *DescribeVpcClassicLinkDnsSupportInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeVpcPeeringConnectionsRequest(inCpy) + req, _ := c.DescribeVpcClassicLinkDnsSupportRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVpcPeeringConnectionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeVpcClassicLinkDnsSupportOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeVpcs = "DescribeVpcs" +const opDescribeVpcEndpointConnectionNotifications = "DescribeVpcEndpointConnectionNotifications" -// DescribeVpcsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpcs operation. The "output" return +// DescribeVpcEndpointConnectionNotificationsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVpcEndpointConnectionNotifications operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVpcs for more information on using the DescribeVpcs +// See DescribeVpcEndpointConnectionNotifications for more information on using the DescribeVpcEndpointConnectionNotifications // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVpcsRequest method. -// req, resp := client.DescribeVpcsRequest(params) +// // Example sending a request using the DescribeVpcEndpointConnectionNotificationsRequest method. +// req, resp := client.DescribeVpcEndpointConnectionNotificationsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcs -func (c *EC2) DescribeVpcsRequest(input *DescribeVpcsInput) (req *request.Request, output *DescribeVpcsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointConnectionNotifications +func (c *EC2) DescribeVpcEndpointConnectionNotificationsRequest(input *DescribeVpcEndpointConnectionNotificationsInput) (req *request.Request, output *DescribeVpcEndpointConnectionNotificationsOutput) { op := &request.Operation{ - Name: opDescribeVpcs, + Name: opDescribeVpcEndpointConnectionNotifications, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -21866,2506 +23918,2749 @@ func (c *EC2) DescribeVpcsRequest(input *DescribeVpcsInput) (req *request.Reques } if input == nil { - input = &DescribeVpcsInput{} + input = &DescribeVpcEndpointConnectionNotificationsInput{} } - output = &DescribeVpcsOutput{} + output = &DescribeVpcEndpointConnectionNotificationsOutput{} req = c.newRequest(op, input, output) return } -// DescribeVpcs API operation for Amazon Elastic Compute Cloud. +// DescribeVpcEndpointConnectionNotifications API operation for Amazon Elastic Compute Cloud. // -// Describes one or more of your VPCs. +// Describes the connection notifications for VPC endpoints and VPC endpoint +// 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 DescribeVpcs for usage and error information. -// See also, 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) +// API operation DescribeVpcEndpointConnectionNotifications for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointConnectionNotifications +func (c *EC2) DescribeVpcEndpointConnectionNotifications(input *DescribeVpcEndpointConnectionNotificationsInput) (*DescribeVpcEndpointConnectionNotificationsOutput, error) { + req, out := c.DescribeVpcEndpointConnectionNotificationsRequest(input) return out, req.Send() } -// DescribeVpcsWithContext is the same as DescribeVpcs with the addition of +// DescribeVpcEndpointConnectionNotificationsWithContext is the same as DescribeVpcEndpointConnectionNotifications with the addition of // the ability to pass a context and additional request options. // -// See DescribeVpcs for details on how to use this API operation. +// See DescribeVpcEndpointConnectionNotifications for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcsWithContext(ctx aws.Context, input *DescribeVpcsInput, opts ...request.Option) (*DescribeVpcsOutput, error) { - req, out := c.DescribeVpcsRequest(input) +func (c *EC2) DescribeVpcEndpointConnectionNotificationsWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionNotificationsInput, opts ...request.Option) (*DescribeVpcEndpointConnectionNotificationsOutput, error) { + req, out := c.DescribeVpcEndpointConnectionNotificationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// DescribeVpcsPages iterates over the pages of a DescribeVpcs operation, +// DescribeVpcEndpointConnectionNotificationsPages iterates over the pages of a DescribeVpcEndpointConnectionNotifications operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See DescribeVpcs method for more information on how to use this operation. +// See DescribeVpcEndpointConnectionNotifications 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 DescribeVpcs operation. +// // Example iterating over at most 3 pages of a DescribeVpcEndpointConnectionNotifications operation. // pageNum := 0 -// err := client.DescribeVpcsPages(params, -// func(page *ec2.DescribeVpcsOutput, lastPage bool) bool { +// err := client.DescribeVpcEndpointConnectionNotificationsPages(params, +// func(page *ec2.DescribeVpcEndpointConnectionNotificationsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) DescribeVpcsPages(input *DescribeVpcsInput, fn func(*DescribeVpcsOutput, bool) bool) error { - return c.DescribeVpcsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) DescribeVpcEndpointConnectionNotificationsPages(input *DescribeVpcEndpointConnectionNotificationsInput, fn func(*DescribeVpcEndpointConnectionNotificationsOutput, bool) bool) error { + return c.DescribeVpcEndpointConnectionNotificationsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DescribeVpcsPagesWithContext same as DescribeVpcsPages except +// DescribeVpcEndpointConnectionNotificationsPagesWithContext same as DescribeVpcEndpointConnectionNotificationsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpcsPagesWithContext(ctx aws.Context, input *DescribeVpcsInput, fn func(*DescribeVpcsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) DescribeVpcEndpointConnectionNotificationsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionNotificationsInput, fn func(*DescribeVpcEndpointConnectionNotificationsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *DescribeVpcsInput + var inCpy *DescribeVpcEndpointConnectionNotificationsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.DescribeVpcsRequest(inCpy) + req, _ := c.DescribeVpcEndpointConnectionNotificationsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVpcsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeVpcEndpointConnectionNotificationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opDescribeVpnConnections = "DescribeVpnConnections" +const opDescribeVpcEndpointConnections = "DescribeVpcEndpointConnections" -// DescribeVpnConnectionsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpnConnections operation. The "output" return +// DescribeVpcEndpointConnectionsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVpcEndpointConnections operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVpnConnections for more information on using the DescribeVpnConnections +// See DescribeVpcEndpointConnections for more information on using the DescribeVpcEndpointConnections // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVpnConnectionsRequest method. -// req, resp := client.DescribeVpnConnectionsRequest(params) +// // Example sending a request using the DescribeVpcEndpointConnectionsRequest method. +// req, resp := client.DescribeVpcEndpointConnectionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnConnections -func (c *EC2) DescribeVpnConnectionsRequest(input *DescribeVpnConnectionsInput) (req *request.Request, output *DescribeVpnConnectionsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointConnections +func (c *EC2) DescribeVpcEndpointConnectionsRequest(input *DescribeVpcEndpointConnectionsInput) (req *request.Request, output *DescribeVpcEndpointConnectionsOutput) { op := &request.Operation{ - Name: opDescribeVpnConnections, + Name: opDescribeVpcEndpointConnections, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DescribeVpnConnectionsInput{} + input = &DescribeVpcEndpointConnectionsInput{} } - output = &DescribeVpnConnectionsOutput{} + output = &DescribeVpcEndpointConnectionsOutput{} req = c.newRequest(op, input, output) return } -// DescribeVpnConnections API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your VPN connections. +// DescribeVpcEndpointConnections API operation for Amazon Elastic Compute Cloud. // -// For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html) -// in the AWS Site-to-Site VPN User Guide. +// Describes the VPC endpoint connections to your VPC endpoint services, including +// any endpoints that are pending your acceptance. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation DescribeVpcEndpointConnections for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointConnections +func (c *EC2) DescribeVpcEndpointConnections(input *DescribeVpcEndpointConnectionsInput) (*DescribeVpcEndpointConnectionsOutput, error) { + req, out := c.DescribeVpcEndpointConnectionsRequest(input) return out, req.Send() } -// DescribeVpnConnectionsWithContext is the same as DescribeVpnConnections with the addition of +// DescribeVpcEndpointConnectionsWithContext is the same as DescribeVpcEndpointConnections with the addition of // the ability to pass a context and additional request options. // -// See DescribeVpnConnections for details on how to use this API operation. +// See DescribeVpcEndpointConnections for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpnConnectionsWithContext(ctx aws.Context, input *DescribeVpnConnectionsInput, opts ...request.Option) (*DescribeVpnConnectionsOutput, error) { - req, out := c.DescribeVpnConnectionsRequest(input) +func (c *EC2) DescribeVpcEndpointConnectionsWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionsInput, opts ...request.Option) (*DescribeVpcEndpointConnectionsOutput, error) { + req, out := c.DescribeVpcEndpointConnectionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeVpnGateways = "DescribeVpnGateways" +// DescribeVpcEndpointConnectionsPages iterates over the pages of a DescribeVpcEndpointConnections operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcEndpointConnections 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 DescribeVpcEndpointConnections operation. +// pageNum := 0 +// err := client.DescribeVpcEndpointConnectionsPages(params, +// func(page *ec2.DescribeVpcEndpointConnectionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcEndpointConnectionsPages(input *DescribeVpcEndpointConnectionsInput, fn func(*DescribeVpcEndpointConnectionsOutput, bool) bool) error { + return c.DescribeVpcEndpointConnectionsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// DescribeVpnGatewaysRequest generates a "aws/request.Request" representing the -// client's request for the DescribeVpnGateways operation. The "output" return +// DescribeVpcEndpointConnectionsPagesWithContext same as DescribeVpcEndpointConnectionsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeVpcEndpointConnectionsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointConnectionsInput, fn func(*DescribeVpcEndpointConnectionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcEndpointConnectionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcEndpointConnectionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeVpcEndpointConnectionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeVpcEndpointServiceConfigurations = "DescribeVpcEndpointServiceConfigurations" + +// DescribeVpcEndpointServiceConfigurationsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVpcEndpointServiceConfigurations operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeVpnGateways for more information on using the DescribeVpnGateways +// See DescribeVpcEndpointServiceConfigurations for more information on using the DescribeVpcEndpointServiceConfigurations // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeVpnGatewaysRequest method. -// req, resp := client.DescribeVpnGatewaysRequest(params) +// // Example sending a request using the DescribeVpcEndpointServiceConfigurationsRequest method. +// req, resp := client.DescribeVpcEndpointServiceConfigurationsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnGateways -func (c *EC2) DescribeVpnGatewaysRequest(input *DescribeVpnGatewaysInput) (req *request.Request, output *DescribeVpnGatewaysOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServiceConfigurations +func (c *EC2) DescribeVpcEndpointServiceConfigurationsRequest(input *DescribeVpcEndpointServiceConfigurationsInput) (req *request.Request, output *DescribeVpcEndpointServiceConfigurationsOutput) { op := &request.Operation{ - Name: opDescribeVpnGateways, + Name: opDescribeVpcEndpointServiceConfigurations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DescribeVpnGatewaysInput{} + input = &DescribeVpcEndpointServiceConfigurationsInput{} } - output = &DescribeVpnGatewaysOutput{} + output = &DescribeVpcEndpointServiceConfigurationsOutput{} req = c.newRequest(op, input, output) return } -// DescribeVpnGateways API operation for Amazon Elastic Compute Cloud. -// -// Describes one or more of your virtual private gateways. +// DescribeVpcEndpointServiceConfigurations API operation for Amazon Elastic Compute Cloud. // -// For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html) -// in the AWS Site-to-Site VPN User Guide. +// Describes the VPC endpoint service configurations in your account (your 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 DescribeVpnGateways for usage and error information. -// See also, 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) +// API operation DescribeVpcEndpointServiceConfigurations for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServiceConfigurations +func (c *EC2) DescribeVpcEndpointServiceConfigurations(input *DescribeVpcEndpointServiceConfigurationsInput) (*DescribeVpcEndpointServiceConfigurationsOutput, error) { + req, out := c.DescribeVpcEndpointServiceConfigurationsRequest(input) return out, req.Send() } -// DescribeVpnGatewaysWithContext is the same as DescribeVpnGateways with the addition of +// DescribeVpcEndpointServiceConfigurationsWithContext is the same as DescribeVpcEndpointServiceConfigurations with the addition of // the ability to pass a context and additional request options. // -// See DescribeVpnGateways for details on how to use this API operation. +// See DescribeVpcEndpointServiceConfigurations for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DescribeVpnGatewaysWithContext(ctx aws.Context, input *DescribeVpnGatewaysInput, opts ...request.Option) (*DescribeVpnGatewaysOutput, error) { - req, out := c.DescribeVpnGatewaysRequest(input) +func (c *EC2) DescribeVpcEndpointServiceConfigurationsWithContext(ctx aws.Context, input *DescribeVpcEndpointServiceConfigurationsInput, opts ...request.Option) (*DescribeVpcEndpointServiceConfigurationsOutput, error) { + req, out := c.DescribeVpcEndpointServiceConfigurationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDetachClassicLinkVpc = "DetachClassicLinkVpc" - -// DetachClassicLinkVpcRequest generates a "aws/request.Request" representing the -// client's request for the DetachClassicLinkVpc operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. +// DescribeVpcEndpointServiceConfigurationsPages iterates over the pages of a DescribeVpcEndpointServiceConfigurations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. // -// 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 DescribeVpcEndpointServiceConfigurations method for more information on how to use this operation. // -// See DetachClassicLinkVpc for more information on using the DetachClassicLinkVpc -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// -// // Example sending a request using the DetachClassicLinkVpcRequest method. -// req, resp := client.DetachClassicLinkVpcRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, 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. +// Note: This operation can generate multiple requests to a 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. +// // Example iterating over at most 3 pages of a DescribeVpcEndpointServiceConfigurations operation. +// pageNum := 0 +// err := client.DescribeVpcEndpointServiceConfigurationsPages(params, +// func(page *ec2.DescribeVpcEndpointServiceConfigurationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) // -// See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DetachClassicLinkVpc for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachClassicLinkVpc -func (c *EC2) DetachClassicLinkVpc(input *DetachClassicLinkVpcInput) (*DetachClassicLinkVpcOutput, error) { - req, out := c.DetachClassicLinkVpcRequest(input) - return out, req.Send() +func (c *EC2) DescribeVpcEndpointServiceConfigurationsPages(input *DescribeVpcEndpointServiceConfigurationsInput, fn func(*DescribeVpcEndpointServiceConfigurationsOutput, bool) bool) error { + return c.DescribeVpcEndpointServiceConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) } -// DetachClassicLinkVpcWithContext is the same as DetachClassicLinkVpc with the addition of -// the ability to pass a context and additional request options. -// -// See DetachClassicLinkVpc for details on how to use this API operation. +// DescribeVpcEndpointServiceConfigurationsPagesWithContext same as DescribeVpcEndpointServiceConfigurationsPages except +// it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DetachClassicLinkVpcWithContext(ctx aws.Context, input *DetachClassicLinkVpcInput, opts ...request.Option) (*DetachClassicLinkVpcOutput, error) { - req, out := c.DetachClassicLinkVpcRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() +func (c *EC2) DescribeVpcEndpointServiceConfigurationsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointServiceConfigurationsInput, fn func(*DescribeVpcEndpointServiceConfigurationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcEndpointServiceConfigurationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcEndpointServiceConfigurationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeVpcEndpointServiceConfigurationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() } -const opDetachInternetGateway = "DetachInternetGateway" +const opDescribeVpcEndpointServicePermissions = "DescribeVpcEndpointServicePermissions" -// DetachInternetGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DetachInternetGateway operation. The "output" return +// DescribeVpcEndpointServicePermissionsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVpcEndpointServicePermissions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DetachInternetGateway for more information on using the DetachInternetGateway +// See DescribeVpcEndpointServicePermissions for more information on using the DescribeVpcEndpointServicePermissions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DetachInternetGatewayRequest method. -// req, resp := client.DetachInternetGatewayRequest(params) +// // Example sending a request using the DescribeVpcEndpointServicePermissionsRequest method. +// req, resp := client.DescribeVpcEndpointServicePermissionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachInternetGateway -func (c *EC2) DetachInternetGatewayRequest(input *DetachInternetGatewayInput) (req *request.Request, output *DetachInternetGatewayOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServicePermissions +func (c *EC2) DescribeVpcEndpointServicePermissionsRequest(input *DescribeVpcEndpointServicePermissionsInput) (req *request.Request, output *DescribeVpcEndpointServicePermissionsOutput) { op := &request.Operation{ - Name: opDetachInternetGateway, + Name: opDescribeVpcEndpointServicePermissions, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DetachInternetGatewayInput{} + input = &DescribeVpcEndpointServicePermissionsInput{} } - output = &DetachInternetGatewayOutput{} + output = &DescribeVpcEndpointServicePermissionsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DetachInternetGateway API operation for Amazon Elastic Compute Cloud. +// DescribeVpcEndpointServicePermissions 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 or public IPv4 addresses. +// Describes the principals (service consumers) that are permitted to discover +// your VPC endpoint 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 DetachInternetGateway for usage and error information. -// See also, 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) +// API operation DescribeVpcEndpointServicePermissions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServicePermissions +func (c *EC2) DescribeVpcEndpointServicePermissions(input *DescribeVpcEndpointServicePermissionsInput) (*DescribeVpcEndpointServicePermissionsOutput, error) { + req, out := c.DescribeVpcEndpointServicePermissionsRequest(input) return out, req.Send() } -// DetachInternetGatewayWithContext is the same as DetachInternetGateway with the addition of +// DescribeVpcEndpointServicePermissionsWithContext is the same as DescribeVpcEndpointServicePermissions with the addition of // the ability to pass a context and additional request options. // -// See DetachInternetGateway for details on how to use this API operation. +// See DescribeVpcEndpointServicePermissions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DetachInternetGatewayWithContext(ctx aws.Context, input *DetachInternetGatewayInput, opts ...request.Option) (*DetachInternetGatewayOutput, error) { - req, out := c.DetachInternetGatewayRequest(input) +func (c *EC2) DescribeVpcEndpointServicePermissionsWithContext(ctx aws.Context, input *DescribeVpcEndpointServicePermissionsInput, opts ...request.Option) (*DescribeVpcEndpointServicePermissionsOutput, error) { + req, out := c.DescribeVpcEndpointServicePermissionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDetachNetworkInterface = "DetachNetworkInterface" +// DescribeVpcEndpointServicePermissionsPages iterates over the pages of a DescribeVpcEndpointServicePermissions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcEndpointServicePermissions 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 DescribeVpcEndpointServicePermissions operation. +// pageNum := 0 +// err := client.DescribeVpcEndpointServicePermissionsPages(params, +// func(page *ec2.DescribeVpcEndpointServicePermissionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcEndpointServicePermissionsPages(input *DescribeVpcEndpointServicePermissionsInput, fn func(*DescribeVpcEndpointServicePermissionsOutput, bool) bool) error { + return c.DescribeVpcEndpointServicePermissionsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// DetachNetworkInterfaceRequest generates a "aws/request.Request" representing the -// client's request for the DetachNetworkInterface operation. The "output" return +// DescribeVpcEndpointServicePermissionsPagesWithContext same as DescribeVpcEndpointServicePermissionsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeVpcEndpointServicePermissionsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointServicePermissionsInput, fn func(*DescribeVpcEndpointServicePermissionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcEndpointServicePermissionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcEndpointServicePermissionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeVpcEndpointServicePermissionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeVpcEndpointServices = "DescribeVpcEndpointServices" + +// DescribeVpcEndpointServicesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVpcEndpointServices operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DetachNetworkInterface for more information on using the DetachNetworkInterface +// See DescribeVpcEndpointServices for more information on using the DescribeVpcEndpointServices // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DetachNetworkInterfaceRequest method. -// req, resp := client.DetachNetworkInterfaceRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachNetworkInterface -func (c *EC2) DetachNetworkInterfaceRequest(input *DetachNetworkInterfaceInput) (req *request.Request, output *DetachNetworkInterfaceOutput) { +// See also, 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: opDetachNetworkInterface, + Name: opDescribeVpcEndpointServices, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DetachNetworkInterfaceInput{} + input = &DescribeVpcEndpointServicesInput{} } - output = &DetachNetworkInterfaceOutput{} + output = &DescribeVpcEndpointServicesOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DetachNetworkInterface API operation for Amazon Elastic Compute Cloud. +// DescribeVpcEndpointServices API operation for Amazon Elastic Compute Cloud. // -// Detaches a network interface from an instance. +// Describes available services to which you can create 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 DetachNetworkInterface for usage and error information. -// See also, 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) +// API operation DescribeVpcEndpointServices for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpointServices +func (c *EC2) DescribeVpcEndpointServices(input *DescribeVpcEndpointServicesInput) (*DescribeVpcEndpointServicesOutput, error) { + req, out := c.DescribeVpcEndpointServicesRequest(input) return out, req.Send() } -// DetachNetworkInterfaceWithContext is the same as DetachNetworkInterface with the addition of +// DescribeVpcEndpointServicesWithContext is the same as DescribeVpcEndpointServices with the addition of // the ability to pass a context and additional request options. // -// See DetachNetworkInterface for details on how to use this API operation. +// See DescribeVpcEndpointServices for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DetachNetworkInterfaceWithContext(ctx aws.Context, input *DetachNetworkInterfaceInput, opts ...request.Option) (*DetachNetworkInterfaceOutput, error) { - req, out := c.DetachNetworkInterfaceRequest(input) +func (c *EC2) DescribeVpcEndpointServicesWithContext(ctx aws.Context, input *DescribeVpcEndpointServicesInput, opts ...request.Option) (*DescribeVpcEndpointServicesOutput, error) { + req, out := c.DescribeVpcEndpointServicesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDetachVolume = "DetachVolume" +const opDescribeVpcEndpoints = "DescribeVpcEndpoints" -// DetachVolumeRequest generates a "aws/request.Request" representing the -// client's request for the DetachVolume operation. The "output" return +// DescribeVpcEndpointsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVpcEndpoints operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DetachVolume for more information on using the DetachVolume +// See DescribeVpcEndpoints for more information on using the DescribeVpcEndpoints // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DetachVolumeRequest method. -// req, resp := client.DetachVolumeRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVolume -func (c *EC2) DetachVolumeRequest(input *DetachVolumeInput) (req *request.Request, output *VolumeAttachment) { +// See also, 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: opDetachVolume, + Name: opDescribeVpcEndpoints, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DetachVolumeInput{} + input = &DescribeVpcEndpointsInput{} } - output = &VolumeAttachment{} + output = &DescribeVpcEndpointsOutput{} 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. +// DescribeVpcEndpoints API operation for Amazon Elastic Compute Cloud. // -// For more information, see Detaching an Amazon EBS Volume (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-detaching-volume.html) -// in the Amazon Elastic Compute Cloud User Guide. +// 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 DetachVolume for usage and error information. -// See also, 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) +// API operation DescribeVpcEndpoints for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcEndpoints +func (c *EC2) DescribeVpcEndpoints(input *DescribeVpcEndpointsInput) (*DescribeVpcEndpointsOutput, error) { + req, out := c.DescribeVpcEndpointsRequest(input) return out, req.Send() } -// DetachVolumeWithContext is the same as DetachVolume with the addition of +// DescribeVpcEndpointsWithContext is the same as DescribeVpcEndpoints with the addition of // the ability to pass a context and additional request options. // -// See DetachVolume for details on how to use this API operation. +// See DescribeVpcEndpoints for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DetachVolumeWithContext(ctx aws.Context, input *DetachVolumeInput, opts ...request.Option) (*VolumeAttachment, error) { - req, out := c.DetachVolumeRequest(input) +func (c *EC2) DescribeVpcEndpointsWithContext(ctx aws.Context, input *DescribeVpcEndpointsInput, opts ...request.Option) (*DescribeVpcEndpointsOutput, error) { + req, out := c.DescribeVpcEndpointsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDetachVpnGateway = "DetachVpnGateway" +// DescribeVpcEndpointsPages iterates over the pages of a DescribeVpcEndpoints operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcEndpoints 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 DescribeVpcEndpoints operation. +// pageNum := 0 +// err := client.DescribeVpcEndpointsPages(params, +// func(page *ec2.DescribeVpcEndpointsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcEndpointsPages(input *DescribeVpcEndpointsInput, fn func(*DescribeVpcEndpointsOutput, bool) bool) error { + return c.DescribeVpcEndpointsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// DetachVpnGatewayRequest generates a "aws/request.Request" representing the -// client's request for the DetachVpnGateway operation. The "output" return +// DescribeVpcEndpointsPagesWithContext same as DescribeVpcEndpointsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeVpcEndpointsPagesWithContext(ctx aws.Context, input *DescribeVpcEndpointsInput, fn func(*DescribeVpcEndpointsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcEndpointsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcEndpointsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeVpcEndpointsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeVpcPeeringConnections = "DescribeVpcPeeringConnections" + +// DescribeVpcPeeringConnectionsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVpcPeeringConnections operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DetachVpnGateway for more information on using the DetachVpnGateway +// See DescribeVpcPeeringConnections for more information on using the DescribeVpcPeeringConnections // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DetachVpnGatewayRequest method. -// req, resp := client.DetachVpnGatewayRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVpnGateway -func (c *EC2) DetachVpnGatewayRequest(input *DetachVpnGatewayInput) (req *request.Request, output *DetachVpnGatewayOutput) { +// See also, 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: opDetachVpnGateway, + Name: opDescribeVpcPeeringConnections, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DetachVpnGatewayInput{} + input = &DescribeVpcPeeringConnectionsInput{} } - output = &DetachVpnGatewayOutput{} + output = &DescribeVpcPeeringConnectionsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, 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). +// DescribeVpcPeeringConnections API operation for Amazon Elastic Compute Cloud. // -// 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. +// 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 DetachVpnGateway for usage and error information. -// See also, 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) +// API operation DescribeVpcPeeringConnections for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcPeeringConnections +func (c *EC2) DescribeVpcPeeringConnections(input *DescribeVpcPeeringConnectionsInput) (*DescribeVpcPeeringConnectionsOutput, error) { + req, out := c.DescribeVpcPeeringConnectionsRequest(input) return out, req.Send() } -// DetachVpnGatewayWithContext is the same as DetachVpnGateway with the addition of +// DescribeVpcPeeringConnectionsWithContext is the same as DescribeVpcPeeringConnections with the addition of // the ability to pass a context and additional request options. // -// See DetachVpnGateway for details on how to use this API operation. +// See DescribeVpcPeeringConnections for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DetachVpnGatewayWithContext(ctx aws.Context, input *DetachVpnGatewayInput, opts ...request.Option) (*DetachVpnGatewayOutput, error) { - req, out := c.DetachVpnGatewayRequest(input) +func (c *EC2) DescribeVpcPeeringConnectionsWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, opts ...request.Option) (*DescribeVpcPeeringConnectionsOutput, error) { + req, out := c.DescribeVpcPeeringConnectionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDisableEbsEncryptionByDefault = "DisableEbsEncryptionByDefault" +// DescribeVpcPeeringConnectionsPages iterates over the pages of a DescribeVpcPeeringConnections operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeVpcPeeringConnections 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 DescribeVpcPeeringConnections operation. +// pageNum := 0 +// err := client.DescribeVpcPeeringConnectionsPages(params, +// func(page *ec2.DescribeVpcPeeringConnectionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcPeeringConnectionsPages(input *DescribeVpcPeeringConnectionsInput, fn func(*DescribeVpcPeeringConnectionsOutput, bool) bool) error { + return c.DescribeVpcPeeringConnectionsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// DisableEbsEncryptionByDefaultRequest generates a "aws/request.Request" representing the -// client's request for the DisableEbsEncryptionByDefault operation. The "output" return +// DescribeVpcPeeringConnectionsPagesWithContext same as DescribeVpcPeeringConnectionsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeVpcPeeringConnectionsPagesWithContext(ctx aws.Context, input *DescribeVpcPeeringConnectionsInput, fn func(*DescribeVpcPeeringConnectionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcPeeringConnectionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcPeeringConnectionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeVpcPeeringConnectionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeVpcs = "DescribeVpcs" + +// DescribeVpcsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVpcs operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DisableEbsEncryptionByDefault for more information on using the DisableEbsEncryptionByDefault +// See DescribeVpcs for more information on using the DescribeVpcs // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DisableEbsEncryptionByDefaultRequest method. -// req, resp := client.DisableEbsEncryptionByDefaultRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableEbsEncryptionByDefault -func (c *EC2) DisableEbsEncryptionByDefaultRequest(input *DisableEbsEncryptionByDefaultInput) (req *request.Request, output *DisableEbsEncryptionByDefaultOutput) { +// See also, 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: opDisableEbsEncryptionByDefault, + Name: opDescribeVpcs, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DisableEbsEncryptionByDefaultInput{} + input = &DescribeVpcsInput{} } - output = &DisableEbsEncryptionByDefaultOutput{} + output = &DescribeVpcsOutput{} req = c.newRequest(op, input, output) return } -// DisableEbsEncryptionByDefault API operation for Amazon Elastic Compute Cloud. -// -// Disables EBS encryption by default for your account in the current Region. -// -// After you disable encryption by default, you can still create encrypted volumes -// by enabling encryption when you create each volume. -// -// Disabling encryption by default does not change the encryption status of -// your existing volumes. +// DescribeVpcs API operation for Amazon Elastic Compute Cloud. // -// For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) -// in the Amazon Elastic Compute Cloud User Guide. +// 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 DisableEbsEncryptionByDefault for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableEbsEncryptionByDefault -func (c *EC2) DisableEbsEncryptionByDefault(input *DisableEbsEncryptionByDefaultInput) (*DisableEbsEncryptionByDefaultOutput, error) { - req, out := c.DisableEbsEncryptionByDefaultRequest(input) +// API operation DescribeVpcs for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpcs +func (c *EC2) DescribeVpcs(input *DescribeVpcsInput) (*DescribeVpcsOutput, error) { + req, out := c.DescribeVpcsRequest(input) return out, req.Send() } -// DisableEbsEncryptionByDefaultWithContext is the same as DisableEbsEncryptionByDefault with the addition of +// DescribeVpcsWithContext is the same as DescribeVpcs with the addition of // the ability to pass a context and additional request options. // -// See DisableEbsEncryptionByDefault for details on how to use this API operation. +// See DescribeVpcs for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DisableEbsEncryptionByDefaultWithContext(ctx aws.Context, input *DisableEbsEncryptionByDefaultInput, opts ...request.Option) (*DisableEbsEncryptionByDefaultOutput, error) { - req, out := c.DisableEbsEncryptionByDefaultRequest(input) +func (c *EC2) DescribeVpcsWithContext(ctx aws.Context, input *DescribeVpcsInput, opts ...request.Option) (*DescribeVpcsOutput, error) { + req, out := c.DescribeVpcsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDisableTransitGatewayRouteTablePropagation = "DisableTransitGatewayRouteTablePropagation" - -// DisableTransitGatewayRouteTablePropagationRequest generates a "aws/request.Request" representing the -// client's request for the DisableTransitGatewayRouteTablePropagation operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. +// DescribeVpcsPages iterates over the pages of a DescribeVpcs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. // -// Use "Send" method on the returned Request to send the API call to the service. +// See DescribeVpcs 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 DescribeVpcs operation. +// pageNum := 0 +// err := client.DescribeVpcsPages(params, +// func(page *ec2.DescribeVpcsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) DescribeVpcsPages(input *DescribeVpcsInput, fn func(*DescribeVpcsOutput, bool) bool) error { + return c.DescribeVpcsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeVpcsPagesWithContext same as DescribeVpcsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) DescribeVpcsPagesWithContext(ctx aws.Context, input *DescribeVpcsInput, fn func(*DescribeVpcsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeVpcsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeVpcsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeVpcsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeVpnConnections = "DescribeVpnConnections" + +// DescribeVpnConnectionsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVpnConnections operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DisableTransitGatewayRouteTablePropagation for more information on using the DisableTransitGatewayRouteTablePropagation +// See DescribeVpnConnections for more information on using the DescribeVpnConnections // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DisableTransitGatewayRouteTablePropagationRequest method. -// req, resp := client.DisableTransitGatewayRouteTablePropagationRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableTransitGatewayRouteTablePropagation -func (c *EC2) DisableTransitGatewayRouteTablePropagationRequest(input *DisableTransitGatewayRouteTablePropagationInput) (req *request.Request, output *DisableTransitGatewayRouteTablePropagationOutput) { +// See also, 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: opDisableTransitGatewayRouteTablePropagation, + Name: opDescribeVpnConnections, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DisableTransitGatewayRouteTablePropagationInput{} + input = &DescribeVpnConnectionsInput{} } - output = &DisableTransitGatewayRouteTablePropagationOutput{} + output = &DescribeVpnConnectionsOutput{} req = c.newRequest(op, input, output) return } -// DisableTransitGatewayRouteTablePropagation API operation for Amazon Elastic Compute Cloud. +// DescribeVpnConnections API operation for Amazon Elastic Compute Cloud. // -// Disables the specified resource attachment from propagating routes to the -// specified propagation route table. +// Describes one or more of your VPN connections. +// +// For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html) +// in the AWS Site-to-Site VPN User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation DisableTransitGatewayRouteTablePropagation for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableTransitGatewayRouteTablePropagation -func (c *EC2) DisableTransitGatewayRouteTablePropagation(input *DisableTransitGatewayRouteTablePropagationInput) (*DisableTransitGatewayRouteTablePropagationOutput, error) { - req, out := c.DisableTransitGatewayRouteTablePropagationRequest(input) +// API operation DescribeVpnConnections for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnConnections +func (c *EC2) DescribeVpnConnections(input *DescribeVpnConnectionsInput) (*DescribeVpnConnectionsOutput, error) { + req, out := c.DescribeVpnConnectionsRequest(input) return out, req.Send() } -// DisableTransitGatewayRouteTablePropagationWithContext is the same as DisableTransitGatewayRouteTablePropagation with the addition of +// DescribeVpnConnectionsWithContext is the same as DescribeVpnConnections with the addition of // the ability to pass a context and additional request options. // -// See DisableTransitGatewayRouteTablePropagation for details on how to use this API operation. +// See DescribeVpnConnections for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DisableTransitGatewayRouteTablePropagationWithContext(ctx aws.Context, input *DisableTransitGatewayRouteTablePropagationInput, opts ...request.Option) (*DisableTransitGatewayRouteTablePropagationOutput, error) { - req, out := c.DisableTransitGatewayRouteTablePropagationRequest(input) +func (c *EC2) DescribeVpnConnectionsWithContext(ctx aws.Context, input *DescribeVpnConnectionsInput, opts ...request.Option) (*DescribeVpnConnectionsOutput, error) { + req, out := c.DescribeVpnConnectionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDisableVgwRoutePropagation = "DisableVgwRoutePropagation" +const opDescribeVpnGateways = "DescribeVpnGateways" -// DisableVgwRoutePropagationRequest generates a "aws/request.Request" representing the -// client's request for the DisableVgwRoutePropagation operation. The "output" return +// DescribeVpnGatewaysRequest generates a "aws/request.Request" representing the +// client's request for the DescribeVpnGateways operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DisableVgwRoutePropagation for more information on using the DisableVgwRoutePropagation +// See DescribeVpnGateways for more information on using the DescribeVpnGateways // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DisableVgwRoutePropagationRequest method. -// req, resp := client.DisableVgwRoutePropagationRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVgwRoutePropagation -func (c *EC2) DisableVgwRoutePropagationRequest(input *DisableVgwRoutePropagationInput) (req *request.Request, output *DisableVgwRoutePropagationOutput) { +// See also, 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: opDisableVgwRoutePropagation, + Name: opDescribeVpnGateways, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DisableVgwRoutePropagationInput{} + input = &DescribeVpnGatewaysInput{} } - output = &DisableVgwRoutePropagationOutput{} + output = &DescribeVpnGatewaysOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DisableVgwRoutePropagation API operation for Amazon Elastic Compute Cloud. +// DescribeVpnGateways API operation for Amazon Elastic Compute Cloud. // -// Disables a virtual private gateway (VGW) from propagating routes to a specified -// route table of a VPC. +// Describes one or more of your virtual private gateways. +// +// For more information, see AWS Site-to-Site VPN (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPC_VPN.html) +// in the AWS Site-to-Site VPN User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation DescribeVpnGateways for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DescribeVpnGateways +func (c *EC2) DescribeVpnGateways(input *DescribeVpnGatewaysInput) (*DescribeVpnGatewaysOutput, error) { + req, out := c.DescribeVpnGatewaysRequest(input) return out, req.Send() } -// DisableVgwRoutePropagationWithContext is the same as DisableVgwRoutePropagation with the addition of +// DescribeVpnGatewaysWithContext is the same as DescribeVpnGateways with the addition of // the ability to pass a context and additional request options. // -// See DisableVgwRoutePropagation for details on how to use this API operation. +// See DescribeVpnGateways for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DisableVgwRoutePropagationWithContext(ctx aws.Context, input *DisableVgwRoutePropagationInput, opts ...request.Option) (*DisableVgwRoutePropagationOutput, error) { - req, out := c.DisableVgwRoutePropagationRequest(input) +func (c *EC2) DescribeVpnGatewaysWithContext(ctx aws.Context, input *DescribeVpnGatewaysInput, opts ...request.Option) (*DescribeVpnGatewaysOutput, error) { + req, out := c.DescribeVpnGatewaysRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDisableVpcClassicLink = "DisableVpcClassicLink" +const opDetachClassicLinkVpc = "DetachClassicLinkVpc" -// DisableVpcClassicLinkRequest generates a "aws/request.Request" representing the -// client's request for the DisableVpcClassicLink operation. The "output" return +// DetachClassicLinkVpcRequest generates a "aws/request.Request" representing the +// client's request for the DetachClassicLinkVpc operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DisableVpcClassicLink for more information on using the DisableVpcClassicLink +// See DetachClassicLinkVpc for more information on using the DetachClassicLinkVpc // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DisableVpcClassicLinkRequest method. -// req, resp := client.DisableVpcClassicLinkRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLink -func (c *EC2) DisableVpcClassicLinkRequest(input *DisableVpcClassicLinkInput) (req *request.Request, output *DisableVpcClassicLinkOutput) { +// See also, 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: opDisableVpcClassicLink, + Name: opDetachClassicLinkVpc, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DisableVpcClassicLinkInput{} + input = &DetachClassicLinkVpcInput{} } - output = &DisableVpcClassicLinkOutput{} + output = &DetachClassicLinkVpcOutput{} req = c.newRequest(op, input, output) return } -// DisableVpcClassicLink API operation for Amazon Elastic Compute Cloud. +// DetachClassicLinkVpc 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. +// 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 DisableVpcClassicLink for usage and error information. -// See also, 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) +// API operation DetachClassicLinkVpc for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachClassicLinkVpc +func (c *EC2) DetachClassicLinkVpc(input *DetachClassicLinkVpcInput) (*DetachClassicLinkVpcOutput, error) { + req, out := c.DetachClassicLinkVpcRequest(input) return out, req.Send() } -// DisableVpcClassicLinkWithContext is the same as DisableVpcClassicLink with the addition of +// DetachClassicLinkVpcWithContext is the same as DetachClassicLinkVpc with the addition of // the ability to pass a context and additional request options. // -// See DisableVpcClassicLink for details on how to use this API operation. +// See DetachClassicLinkVpc for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DisableVpcClassicLinkWithContext(ctx aws.Context, input *DisableVpcClassicLinkInput, opts ...request.Option) (*DisableVpcClassicLinkOutput, error) { - req, out := c.DisableVpcClassicLinkRequest(input) +func (c *EC2) DetachClassicLinkVpcWithContext(ctx aws.Context, input *DetachClassicLinkVpcInput, opts ...request.Option) (*DetachClassicLinkVpcOutput, error) { + req, out := c.DetachClassicLinkVpcRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDisableVpcClassicLinkDnsSupport = "DisableVpcClassicLinkDnsSupport" +const opDetachInternetGateway = "DetachInternetGateway" -// DisableVpcClassicLinkDnsSupportRequest generates a "aws/request.Request" representing the -// client's request for the DisableVpcClassicLinkDnsSupport operation. The "output" return +// DetachInternetGatewayRequest generates a "aws/request.Request" representing the +// client's request for the DetachInternetGateway operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DisableVpcClassicLinkDnsSupport for more information on using the DisableVpcClassicLinkDnsSupport +// See DetachInternetGateway for more information on using the DetachInternetGateway // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DisableVpcClassicLinkDnsSupportRequest method. -// req, resp := client.DisableVpcClassicLinkDnsSupportRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLinkDnsSupport -func (c *EC2) DisableVpcClassicLinkDnsSupportRequest(input *DisableVpcClassicLinkDnsSupportInput) (req *request.Request, output *DisableVpcClassicLinkDnsSupportOutput) { +// See also, 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: opDisableVpcClassicLinkDnsSupport, + Name: opDetachInternetGateway, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DisableVpcClassicLinkDnsSupportInput{} + input = &DetachInternetGatewayInput{} } - output = &DisableVpcClassicLinkDnsSupportOutput{} + output = &DetachInternetGatewayOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DisableVpcClassicLinkDnsSupport API operation for Amazon Elastic Compute Cloud. +// DetachInternetGateway 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, see -// ClassicLink (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) -// in the Amazon Elastic Compute Cloud User Guide. +// 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 or public IPv4 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 DisableVpcClassicLinkDnsSupport for usage and error information. -// See also, 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) +// API operation DetachInternetGateway for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachInternetGateway +func (c *EC2) DetachInternetGateway(input *DetachInternetGatewayInput) (*DetachInternetGatewayOutput, error) { + req, out := c.DetachInternetGatewayRequest(input) return out, req.Send() } -// DisableVpcClassicLinkDnsSupportWithContext is the same as DisableVpcClassicLinkDnsSupport with the addition of +// DetachInternetGatewayWithContext is the same as DetachInternetGateway with the addition of // the ability to pass a context and additional request options. // -// See DisableVpcClassicLinkDnsSupport for details on how to use this API operation. +// See DetachInternetGateway for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DisableVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *DisableVpcClassicLinkDnsSupportInput, opts ...request.Option) (*DisableVpcClassicLinkDnsSupportOutput, error) { - req, out := c.DisableVpcClassicLinkDnsSupportRequest(input) +func (c *EC2) DetachInternetGatewayWithContext(ctx aws.Context, input *DetachInternetGatewayInput, opts ...request.Option) (*DetachInternetGatewayOutput, error) { + req, out := c.DetachInternetGatewayRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDisassociateAddress = "DisassociateAddress" +const opDetachNetworkInterface = "DetachNetworkInterface" -// DisassociateAddressRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateAddress operation. The "output" return +// DetachNetworkInterfaceRequest generates a "aws/request.Request" representing the +// client's request for the DetachNetworkInterface operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DisassociateAddress for more information on using the DisassociateAddress +// See DetachNetworkInterface for more information on using the DetachNetworkInterface // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DisassociateAddressRequest method. -// req, resp := client.DisassociateAddressRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateAddress -func (c *EC2) DisassociateAddressRequest(input *DisassociateAddressInput) (req *request.Request, output *DisassociateAddressOutput) { +// See also, 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: opDisassociateAddress, + Name: opDetachNetworkInterface, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DisassociateAddressInput{} + input = &DetachNetworkInterfaceInput{} } - output = &DisassociateAddressOutput{} + output = &DetachNetworkInterfaceOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, 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 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html) -// in the Amazon Elastic Compute Cloud User Guide. +// DetachNetworkInterface API operation for Amazon Elastic Compute Cloud. // -// This is an idempotent operation. If you perform the operation more than once, -// Amazon EC2 doesn't return an error. +// 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 DisassociateAddress for usage and error information. -// See also, 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) +// API operation DetachNetworkInterface for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachNetworkInterface +func (c *EC2) DetachNetworkInterface(input *DetachNetworkInterfaceInput) (*DetachNetworkInterfaceOutput, error) { + req, out := c.DetachNetworkInterfaceRequest(input) return out, req.Send() } -// DisassociateAddressWithContext is the same as DisassociateAddress with the addition of +// DetachNetworkInterfaceWithContext is the same as DetachNetworkInterface with the addition of // the ability to pass a context and additional request options. // -// See DisassociateAddress for details on how to use this API operation. +// See DetachNetworkInterface for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DisassociateAddressWithContext(ctx aws.Context, input *DisassociateAddressInput, opts ...request.Option) (*DisassociateAddressOutput, error) { - req, out := c.DisassociateAddressRequest(input) +func (c *EC2) DetachNetworkInterfaceWithContext(ctx aws.Context, input *DetachNetworkInterfaceInput, opts ...request.Option) (*DetachNetworkInterfaceOutput, error) { + req, out := c.DetachNetworkInterfaceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDisassociateClientVpnTargetNetwork = "DisassociateClientVpnTargetNetwork" +const opDetachVolume = "DetachVolume" -// DisassociateClientVpnTargetNetworkRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateClientVpnTargetNetwork operation. The "output" return +// DetachVolumeRequest generates a "aws/request.Request" representing the +// client's request for the DetachVolume operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DisassociateClientVpnTargetNetwork for more information on using the DisassociateClientVpnTargetNetwork +// See DetachVolume for more information on using the DetachVolume // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DisassociateClientVpnTargetNetworkRequest method. -// req, resp := client.DisassociateClientVpnTargetNetworkRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateClientVpnTargetNetwork -func (c *EC2) DisassociateClientVpnTargetNetworkRequest(input *DisassociateClientVpnTargetNetworkInput) (req *request.Request, output *DisassociateClientVpnTargetNetworkOutput) { +// See also, 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: opDisassociateClientVpnTargetNetwork, + Name: opDetachVolume, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DisassociateClientVpnTargetNetworkInput{} + input = &DetachVolumeInput{} } - output = &DisassociateClientVpnTargetNetworkOutput{} + output = &VolumeAttachment{} req = c.newRequest(op, input, output) return } -// DisassociateClientVpnTargetNetwork API operation for Amazon Elastic Compute Cloud. -// -// Disassociates a target network from the specified Client VPN endpoint. When -// you disassociate the last target network from a Client VPN, the following -// happens: -// -// * The route that was automatically added for the VPC is deleted +// DetachVolume API operation for Amazon Elastic Compute Cloud. // -// * All active client connections are terminated +// 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. // -// * New client connections are disallowed +// When a volume with an AWS Marketplace product code is detached from an instance, +// the product code is no longer associated with the instance. // -// * The Client VPN endpoint's status changes to pending-associate +// For more information, see Detaching an Amazon EBS Volume (https://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 DisassociateClientVpnTargetNetwork for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateClientVpnTargetNetwork -func (c *EC2) DisassociateClientVpnTargetNetwork(input *DisassociateClientVpnTargetNetworkInput) (*DisassociateClientVpnTargetNetworkOutput, error) { - req, out := c.DisassociateClientVpnTargetNetworkRequest(input) +// API operation DetachVolume for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVolume +func (c *EC2) DetachVolume(input *DetachVolumeInput) (*VolumeAttachment, error) { + req, out := c.DetachVolumeRequest(input) return out, req.Send() } -// DisassociateClientVpnTargetNetworkWithContext is the same as DisassociateClientVpnTargetNetwork with the addition of +// DetachVolumeWithContext is the same as DetachVolume with the addition of // the ability to pass a context and additional request options. // -// See DisassociateClientVpnTargetNetwork for details on how to use this API operation. +// See DetachVolume for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DisassociateClientVpnTargetNetworkWithContext(ctx aws.Context, input *DisassociateClientVpnTargetNetworkInput, opts ...request.Option) (*DisassociateClientVpnTargetNetworkOutput, error) { - req, out := c.DisassociateClientVpnTargetNetworkRequest(input) +func (c *EC2) DetachVolumeWithContext(ctx aws.Context, input *DetachVolumeInput, opts ...request.Option) (*VolumeAttachment, error) { + req, out := c.DetachVolumeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDisassociateIamInstanceProfile = "DisassociateIamInstanceProfile" +const opDetachVpnGateway = "DetachVpnGateway" -// DisassociateIamInstanceProfileRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateIamInstanceProfile operation. The "output" return +// DetachVpnGatewayRequest generates a "aws/request.Request" representing the +// client's request for the DetachVpnGateway operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DisassociateIamInstanceProfile for more information on using the DisassociateIamInstanceProfile +// See DetachVpnGateway for more information on using the DetachVpnGateway // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DisassociateIamInstanceProfileRequest method. -// req, resp := client.DisassociateIamInstanceProfileRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateIamInstanceProfile -func (c *EC2) DisassociateIamInstanceProfileRequest(input *DisassociateIamInstanceProfileInput) (req *request.Request, output *DisassociateIamInstanceProfileOutput) { +// See also, 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: opDisassociateIamInstanceProfile, + Name: opDetachVpnGateway, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DisassociateIamInstanceProfileInput{} + input = &DetachVpnGatewayInput{} } - output = &DisassociateIamInstanceProfileOutput{} + output = &DetachVpnGatewayOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DisassociateIamInstanceProfile API operation for Amazon Elastic Compute Cloud. +// DetachVpnGateway API operation for Amazon Elastic Compute Cloud. // -// Disassociates an IAM instance profile from a running or stopped instance. +// 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). // -// Use DescribeIamInstanceProfileAssociations to get the association ID. +// 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 DisassociateIamInstanceProfile for usage and error information. -// See also, 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) +// API operation DetachVpnGateway for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DetachVpnGateway +func (c *EC2) DetachVpnGateway(input *DetachVpnGatewayInput) (*DetachVpnGatewayOutput, error) { + req, out := c.DetachVpnGatewayRequest(input) return out, req.Send() } -// DisassociateIamInstanceProfileWithContext is the same as DisassociateIamInstanceProfile with the addition of +// DetachVpnGatewayWithContext is the same as DetachVpnGateway with the addition of // the ability to pass a context and additional request options. // -// See DisassociateIamInstanceProfile for details on how to use this API operation. +// See DetachVpnGateway for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DisassociateIamInstanceProfileWithContext(ctx aws.Context, input *DisassociateIamInstanceProfileInput, opts ...request.Option) (*DisassociateIamInstanceProfileOutput, error) { - req, out := c.DisassociateIamInstanceProfileRequest(input) +func (c *EC2) DetachVpnGatewayWithContext(ctx aws.Context, input *DetachVpnGatewayInput, opts ...request.Option) (*DetachVpnGatewayOutput, error) { + req, out := c.DetachVpnGatewayRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDisassociateRouteTable = "DisassociateRouteTable" +const opDisableEbsEncryptionByDefault = "DisableEbsEncryptionByDefault" -// DisassociateRouteTableRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateRouteTable operation. The "output" return +// DisableEbsEncryptionByDefaultRequest generates a "aws/request.Request" representing the +// client's request for the DisableEbsEncryptionByDefault operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DisassociateRouteTable for more information on using the DisassociateRouteTable +// See DisableEbsEncryptionByDefault for more information on using the DisableEbsEncryptionByDefault // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DisassociateRouteTableRequest method. -// req, resp := client.DisassociateRouteTableRequest(params) +// // Example sending a request using the DisableEbsEncryptionByDefaultRequest method. +// req, resp := client.DisableEbsEncryptionByDefaultRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateRouteTable -func (c *EC2) DisassociateRouteTableRequest(input *DisassociateRouteTableInput) (req *request.Request, output *DisassociateRouteTableOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableEbsEncryptionByDefault +func (c *EC2) DisableEbsEncryptionByDefaultRequest(input *DisableEbsEncryptionByDefaultInput) (req *request.Request, output *DisableEbsEncryptionByDefaultOutput) { op := &request.Operation{ - Name: opDisassociateRouteTable, + Name: opDisableEbsEncryptionByDefault, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DisassociateRouteTableInput{} + input = &DisableEbsEncryptionByDefaultInput{} } - output = &DisassociateRouteTableOutput{} + output = &DisableEbsEncryptionByDefaultOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DisassociateRouteTable API operation for Amazon Elastic Compute Cloud. +// DisableEbsEncryptionByDefault API operation for Amazon Elastic Compute Cloud. // -// Disassociates a subnet from a route table. +// Disables EBS encryption by default for your account in the current Region. // -// 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 (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. +// After you disable encryption by default, you can still create encrypted volumes +// by enabling encryption when you create each volume. +// +// Disabling encryption by default does not change the encryption status of +// your existing volumes. +// +// For more information, see Amazon EBS Encryption (https://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 DisassociateRouteTable for usage and error information. -// See also, 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) +// API operation DisableEbsEncryptionByDefault for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableEbsEncryptionByDefault +func (c *EC2) DisableEbsEncryptionByDefault(input *DisableEbsEncryptionByDefaultInput) (*DisableEbsEncryptionByDefaultOutput, error) { + req, out := c.DisableEbsEncryptionByDefaultRequest(input) return out, req.Send() } -// DisassociateRouteTableWithContext is the same as DisassociateRouteTable with the addition of +// DisableEbsEncryptionByDefaultWithContext is the same as DisableEbsEncryptionByDefault with the addition of // the ability to pass a context and additional request options. // -// See DisassociateRouteTable for details on how to use this API operation. +// See DisableEbsEncryptionByDefault for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DisassociateRouteTableWithContext(ctx aws.Context, input *DisassociateRouteTableInput, opts ...request.Option) (*DisassociateRouteTableOutput, error) { - req, out := c.DisassociateRouteTableRequest(input) +func (c *EC2) DisableEbsEncryptionByDefaultWithContext(ctx aws.Context, input *DisableEbsEncryptionByDefaultInput, opts ...request.Option) (*DisableEbsEncryptionByDefaultOutput, error) { + req, out := c.DisableEbsEncryptionByDefaultRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDisassociateSubnetCidrBlock = "DisassociateSubnetCidrBlock" +const opDisableFastSnapshotRestores = "DisableFastSnapshotRestores" -// DisassociateSubnetCidrBlockRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateSubnetCidrBlock operation. The "output" return +// DisableFastSnapshotRestoresRequest generates a "aws/request.Request" representing the +// client's request for the DisableFastSnapshotRestores operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DisassociateSubnetCidrBlock for more information on using the DisassociateSubnetCidrBlock +// See DisableFastSnapshotRestores for more information on using the DisableFastSnapshotRestores // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DisassociateSubnetCidrBlockRequest method. -// req, resp := client.DisassociateSubnetCidrBlockRequest(params) +// // Example sending a request using the DisableFastSnapshotRestoresRequest method. +// req, resp := client.DisableFastSnapshotRestoresRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateSubnetCidrBlock -func (c *EC2) DisassociateSubnetCidrBlockRequest(input *DisassociateSubnetCidrBlockInput) (req *request.Request, output *DisassociateSubnetCidrBlockOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableFastSnapshotRestores +func (c *EC2) DisableFastSnapshotRestoresRequest(input *DisableFastSnapshotRestoresInput) (req *request.Request, output *DisableFastSnapshotRestoresOutput) { op := &request.Operation{ - Name: opDisassociateSubnetCidrBlock, + Name: opDisableFastSnapshotRestores, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DisassociateSubnetCidrBlockInput{} + input = &DisableFastSnapshotRestoresInput{} } - output = &DisassociateSubnetCidrBlockOutput{} + output = &DisableFastSnapshotRestoresOutput{} req = c.newRequest(op, input, output) return } -// DisassociateSubnetCidrBlock API operation for Amazon Elastic Compute Cloud. +// DisableFastSnapshotRestores 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. +// Disables fast snapshot restores for the specified snapshots in the specified +// Availability Zones. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation DisableFastSnapshotRestores for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableFastSnapshotRestores +func (c *EC2) DisableFastSnapshotRestores(input *DisableFastSnapshotRestoresInput) (*DisableFastSnapshotRestoresOutput, error) { + req, out := c.DisableFastSnapshotRestoresRequest(input) return out, req.Send() } -// DisassociateSubnetCidrBlockWithContext is the same as DisassociateSubnetCidrBlock with the addition of +// DisableFastSnapshotRestoresWithContext is the same as DisableFastSnapshotRestores with the addition of // the ability to pass a context and additional request options. // -// See DisassociateSubnetCidrBlock for details on how to use this API operation. +// See DisableFastSnapshotRestores for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DisassociateSubnetCidrBlockWithContext(ctx aws.Context, input *DisassociateSubnetCidrBlockInput, opts ...request.Option) (*DisassociateSubnetCidrBlockOutput, error) { - req, out := c.DisassociateSubnetCidrBlockRequest(input) +func (c *EC2) DisableFastSnapshotRestoresWithContext(ctx aws.Context, input *DisableFastSnapshotRestoresInput, opts ...request.Option) (*DisableFastSnapshotRestoresOutput, error) { + req, out := c.DisableFastSnapshotRestoresRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDisassociateTransitGatewayRouteTable = "DisassociateTransitGatewayRouteTable" +const opDisableTransitGatewayRouteTablePropagation = "DisableTransitGatewayRouteTablePropagation" -// DisassociateTransitGatewayRouteTableRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateTransitGatewayRouteTable operation. The "output" return +// DisableTransitGatewayRouteTablePropagationRequest generates a "aws/request.Request" representing the +// client's request for the DisableTransitGatewayRouteTablePropagation operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DisassociateTransitGatewayRouteTable for more information on using the DisassociateTransitGatewayRouteTable +// See DisableTransitGatewayRouteTablePropagation for more information on using the DisableTransitGatewayRouteTablePropagation // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DisassociateTransitGatewayRouteTableRequest method. -// req, resp := client.DisassociateTransitGatewayRouteTableRequest(params) +// // Example sending a request using the DisableTransitGatewayRouteTablePropagationRequest method. +// req, resp := client.DisableTransitGatewayRouteTablePropagationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateTransitGatewayRouteTable -func (c *EC2) DisassociateTransitGatewayRouteTableRequest(input *DisassociateTransitGatewayRouteTableInput) (req *request.Request, output *DisassociateTransitGatewayRouteTableOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableTransitGatewayRouteTablePropagation +func (c *EC2) DisableTransitGatewayRouteTablePropagationRequest(input *DisableTransitGatewayRouteTablePropagationInput) (req *request.Request, output *DisableTransitGatewayRouteTablePropagationOutput) { op := &request.Operation{ - Name: opDisassociateTransitGatewayRouteTable, + Name: opDisableTransitGatewayRouteTablePropagation, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DisassociateTransitGatewayRouteTableInput{} + input = &DisableTransitGatewayRouteTablePropagationInput{} } - output = &DisassociateTransitGatewayRouteTableOutput{} + output = &DisableTransitGatewayRouteTablePropagationOutput{} req = c.newRequest(op, input, output) return } -// DisassociateTransitGatewayRouteTable API operation for Amazon Elastic Compute Cloud. +// DisableTransitGatewayRouteTablePropagation API operation for Amazon Elastic Compute Cloud. // -// Disassociates a resource attachment from a transit gateway route table. +// Disables the specified resource attachment from propagating routes to the +// specified propagation 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 DisassociateTransitGatewayRouteTable for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateTransitGatewayRouteTable -func (c *EC2) DisassociateTransitGatewayRouteTable(input *DisassociateTransitGatewayRouteTableInput) (*DisassociateTransitGatewayRouteTableOutput, error) { - req, out := c.DisassociateTransitGatewayRouteTableRequest(input) +// API operation DisableTransitGatewayRouteTablePropagation for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableTransitGatewayRouteTablePropagation +func (c *EC2) DisableTransitGatewayRouteTablePropagation(input *DisableTransitGatewayRouteTablePropagationInput) (*DisableTransitGatewayRouteTablePropagationOutput, error) { + req, out := c.DisableTransitGatewayRouteTablePropagationRequest(input) return out, req.Send() } -// DisassociateTransitGatewayRouteTableWithContext is the same as DisassociateTransitGatewayRouteTable with the addition of +// DisableTransitGatewayRouteTablePropagationWithContext is the same as DisableTransitGatewayRouteTablePropagation with the addition of // the ability to pass a context and additional request options. // -// See DisassociateTransitGatewayRouteTable for details on how to use this API operation. +// See DisableTransitGatewayRouteTablePropagation for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DisassociateTransitGatewayRouteTableWithContext(ctx aws.Context, input *DisassociateTransitGatewayRouteTableInput, opts ...request.Option) (*DisassociateTransitGatewayRouteTableOutput, error) { - req, out := c.DisassociateTransitGatewayRouteTableRequest(input) +func (c *EC2) DisableTransitGatewayRouteTablePropagationWithContext(ctx aws.Context, input *DisableTransitGatewayRouteTablePropagationInput, opts ...request.Option) (*DisableTransitGatewayRouteTablePropagationOutput, error) { + req, out := c.DisableTransitGatewayRouteTablePropagationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDisassociateVpcCidrBlock = "DisassociateVpcCidrBlock" +const opDisableVgwRoutePropagation = "DisableVgwRoutePropagation" -// DisassociateVpcCidrBlockRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateVpcCidrBlock operation. The "output" return +// DisableVgwRoutePropagationRequest generates a "aws/request.Request" representing the +// client's request for the DisableVgwRoutePropagation operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DisassociateVpcCidrBlock for more information on using the DisassociateVpcCidrBlock +// See DisableVgwRoutePropagation for more information on using the DisableVgwRoutePropagation // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DisassociateVpcCidrBlockRequest method. -// req, resp := client.DisassociateVpcCidrBlockRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateVpcCidrBlock -func (c *EC2) DisassociateVpcCidrBlockRequest(input *DisassociateVpcCidrBlockInput) (req *request.Request, output *DisassociateVpcCidrBlockOutput) { +// See also, 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: opDisassociateVpcCidrBlock, + Name: opDisableVgwRoutePropagation, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DisassociateVpcCidrBlockInput{} + input = &DisableVgwRoutePropagationInput{} } - output = &DisassociateVpcCidrBlockOutput{} + output = &DisableVgwRoutePropagationOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DisassociateVpcCidrBlock API operation for Amazon Elastic Compute Cloud. -// -// Disassociates a CIDR block from a VPC. To disassociate the CIDR block, you -// must specify its association ID. You can get the association ID by using -// DescribeVpcs. You must detach or delete all gateways and resources that are -// associated with the CIDR block before you can disassociate it. +// DisableVgwRoutePropagation API operation for Amazon Elastic Compute Cloud. // -// You cannot disassociate the CIDR block with which you originally created -// the VPC (the primary CIDR block). +// 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 DisassociateVpcCidrBlock for usage and error information. -// See also, 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) +// API operation DisableVgwRoutePropagation for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVgwRoutePropagation +func (c *EC2) DisableVgwRoutePropagation(input *DisableVgwRoutePropagationInput) (*DisableVgwRoutePropagationOutput, error) { + req, out := c.DisableVgwRoutePropagationRequest(input) return out, req.Send() } -// DisassociateVpcCidrBlockWithContext is the same as DisassociateVpcCidrBlock with the addition of +// DisableVgwRoutePropagationWithContext is the same as DisableVgwRoutePropagation with the addition of // the ability to pass a context and additional request options. // -// See DisassociateVpcCidrBlock for details on how to use this API operation. +// See DisableVgwRoutePropagation for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) DisassociateVpcCidrBlockWithContext(ctx aws.Context, input *DisassociateVpcCidrBlockInput, opts ...request.Option) (*DisassociateVpcCidrBlockOutput, error) { - req, out := c.DisassociateVpcCidrBlockRequest(input) +func (c *EC2) DisableVgwRoutePropagationWithContext(ctx aws.Context, input *DisableVgwRoutePropagationInput, opts ...request.Option) (*DisableVgwRoutePropagationOutput, error) { + req, out := c.DisableVgwRoutePropagationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opEnableEbsEncryptionByDefault = "EnableEbsEncryptionByDefault" +const opDisableVpcClassicLink = "DisableVpcClassicLink" -// EnableEbsEncryptionByDefaultRequest generates a "aws/request.Request" representing the -// client's request for the EnableEbsEncryptionByDefault operation. The "output" return +// DisableVpcClassicLinkRequest generates a "aws/request.Request" representing the +// client's request for the DisableVpcClassicLink operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See EnableEbsEncryptionByDefault for more information on using the EnableEbsEncryptionByDefault +// See DisableVpcClassicLink for more information on using the DisableVpcClassicLink // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the EnableEbsEncryptionByDefaultRequest method. -// req, resp := client.EnableEbsEncryptionByDefaultRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableEbsEncryptionByDefault -func (c *EC2) EnableEbsEncryptionByDefaultRequest(input *EnableEbsEncryptionByDefaultInput) (req *request.Request, output *EnableEbsEncryptionByDefaultOutput) { +// See also, 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: opEnableEbsEncryptionByDefault, + Name: opDisableVpcClassicLink, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &EnableEbsEncryptionByDefaultInput{} + input = &DisableVpcClassicLinkInput{} } - output = &EnableEbsEncryptionByDefaultOutput{} + output = &DisableVpcClassicLinkOutput{} req = c.newRequest(op, input, output) return } -// EnableEbsEncryptionByDefault API operation for Amazon Elastic Compute Cloud. -// -// Enables EBS encryption by default for your account in the current Region. -// -// After you enable encryption by default, the EBS volumes that you create are -// are always encrypted, either using the default CMK or the CMK that you specified -// when you created each volume. For more information, see Amazon EBS Encryption -// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// You can specify the default CMK for encryption by default using ModifyEbsDefaultKmsKeyId -// or ResetEbsDefaultKmsKeyId. -// -// Enabling encryption by default has no effect on the encryption status of -// your existing volumes. +// DisableVpcClassicLink API operation for Amazon Elastic Compute Cloud. // -// After you enable encryption by default, you can no longer launch instances -// using instance types that do not support encryption. For more information, -// see Supported Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances). +// 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 EnableEbsEncryptionByDefault for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableEbsEncryptionByDefault -func (c *EC2) EnableEbsEncryptionByDefault(input *EnableEbsEncryptionByDefaultInput) (*EnableEbsEncryptionByDefaultOutput, error) { - req, out := c.EnableEbsEncryptionByDefaultRequest(input) +// API operation DisableVpcClassicLink for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLink +func (c *EC2) DisableVpcClassicLink(input *DisableVpcClassicLinkInput) (*DisableVpcClassicLinkOutput, error) { + req, out := c.DisableVpcClassicLinkRequest(input) return out, req.Send() } -// EnableEbsEncryptionByDefaultWithContext is the same as EnableEbsEncryptionByDefault with the addition of +// DisableVpcClassicLinkWithContext is the same as DisableVpcClassicLink with the addition of // the ability to pass a context and additional request options. // -// See EnableEbsEncryptionByDefault for details on how to use this API operation. +// See DisableVpcClassicLink for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) EnableEbsEncryptionByDefaultWithContext(ctx aws.Context, input *EnableEbsEncryptionByDefaultInput, opts ...request.Option) (*EnableEbsEncryptionByDefaultOutput, error) { - req, out := c.EnableEbsEncryptionByDefaultRequest(input) +func (c *EC2) DisableVpcClassicLinkWithContext(ctx aws.Context, input *DisableVpcClassicLinkInput, opts ...request.Option) (*DisableVpcClassicLinkOutput, error) { + req, out := c.DisableVpcClassicLinkRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opEnableTransitGatewayRouteTablePropagation = "EnableTransitGatewayRouteTablePropagation" +const opDisableVpcClassicLinkDnsSupport = "DisableVpcClassicLinkDnsSupport" -// EnableTransitGatewayRouteTablePropagationRequest generates a "aws/request.Request" representing the -// client's request for the EnableTransitGatewayRouteTablePropagation operation. The "output" return +// DisableVpcClassicLinkDnsSupportRequest generates a "aws/request.Request" representing the +// client's request for the DisableVpcClassicLinkDnsSupport operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See EnableTransitGatewayRouteTablePropagation for more information on using the EnableTransitGatewayRouteTablePropagation +// See DisableVpcClassicLinkDnsSupport for more information on using the DisableVpcClassicLinkDnsSupport // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the EnableTransitGatewayRouteTablePropagationRequest method. -// req, resp := client.EnableTransitGatewayRouteTablePropagationRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableTransitGatewayRouteTablePropagation -func (c *EC2) EnableTransitGatewayRouteTablePropagationRequest(input *EnableTransitGatewayRouteTablePropagationInput) (req *request.Request, output *EnableTransitGatewayRouteTablePropagationOutput) { +// See also, 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: opEnableTransitGatewayRouteTablePropagation, + Name: opDisableVpcClassicLinkDnsSupport, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &EnableTransitGatewayRouteTablePropagationInput{} + input = &DisableVpcClassicLinkDnsSupportInput{} } - output = &EnableTransitGatewayRouteTablePropagationOutput{} + output = &DisableVpcClassicLinkDnsSupportOutput{} req = c.newRequest(op, input, output) return } -// EnableTransitGatewayRouteTablePropagation API operation for Amazon Elastic Compute Cloud. +// DisableVpcClassicLinkDnsSupport API operation for Amazon Elastic Compute Cloud. // -// Enables the specified attachment to propagate routes to the specified propagation -// route table. +// 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, see +// ClassicLink (https://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 EnableTransitGatewayRouteTablePropagation for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableTransitGatewayRouteTablePropagation -func (c *EC2) EnableTransitGatewayRouteTablePropagation(input *EnableTransitGatewayRouteTablePropagationInput) (*EnableTransitGatewayRouteTablePropagationOutput, error) { - req, out := c.EnableTransitGatewayRouteTablePropagationRequest(input) +// API operation DisableVpcClassicLinkDnsSupport for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisableVpcClassicLinkDnsSupport +func (c *EC2) DisableVpcClassicLinkDnsSupport(input *DisableVpcClassicLinkDnsSupportInput) (*DisableVpcClassicLinkDnsSupportOutput, error) { + req, out := c.DisableVpcClassicLinkDnsSupportRequest(input) return out, req.Send() } -// EnableTransitGatewayRouteTablePropagationWithContext is the same as EnableTransitGatewayRouteTablePropagation with the addition of +// DisableVpcClassicLinkDnsSupportWithContext is the same as DisableVpcClassicLinkDnsSupport with the addition of // the ability to pass a context and additional request options. // -// See EnableTransitGatewayRouteTablePropagation for details on how to use this API operation. +// See DisableVpcClassicLinkDnsSupport for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) EnableTransitGatewayRouteTablePropagationWithContext(ctx aws.Context, input *EnableTransitGatewayRouteTablePropagationInput, opts ...request.Option) (*EnableTransitGatewayRouteTablePropagationOutput, error) { - req, out := c.EnableTransitGatewayRouteTablePropagationRequest(input) +func (c *EC2) DisableVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *DisableVpcClassicLinkDnsSupportInput, opts ...request.Option) (*DisableVpcClassicLinkDnsSupportOutput, error) { + req, out := c.DisableVpcClassicLinkDnsSupportRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opEnableVgwRoutePropagation = "EnableVgwRoutePropagation" +const opDisassociateAddress = "DisassociateAddress" -// EnableVgwRoutePropagationRequest generates a "aws/request.Request" representing the -// client's request for the EnableVgwRoutePropagation operation. The "output" return +// DisassociateAddressRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateAddress operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See EnableVgwRoutePropagation for more information on using the EnableVgwRoutePropagation +// See DisassociateAddress for more information on using the DisassociateAddress // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the EnableVgwRoutePropagationRequest method. -// req, resp := client.EnableVgwRoutePropagationRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVgwRoutePropagation -func (c *EC2) EnableVgwRoutePropagationRequest(input *EnableVgwRoutePropagationInput) (req *request.Request, output *EnableVgwRoutePropagationOutput) { +// See also, 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: opEnableVgwRoutePropagation, + Name: opDisassociateAddress, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &EnableVgwRoutePropagationInput{} + input = &DisassociateAddressInput{} } - output = &EnableVgwRoutePropagationOutput{} + output = &DisassociateAddressOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// EnableVgwRoutePropagation API operation for Amazon Elastic Compute Cloud. +// DisassociateAddress API operation for Amazon Elastic Compute Cloud. // -// Enables a virtual private gateway (VGW) to propagate routes to the specified -// route table of a VPC. +// 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 (https://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 EnableVgwRoutePropagation for usage and error information. -// See also, 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) +// API operation DisassociateAddress for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateAddress +func (c *EC2) DisassociateAddress(input *DisassociateAddressInput) (*DisassociateAddressOutput, error) { + req, out := c.DisassociateAddressRequest(input) return out, req.Send() } -// EnableVgwRoutePropagationWithContext is the same as EnableVgwRoutePropagation with the addition of +// DisassociateAddressWithContext is the same as DisassociateAddress with the addition of // the ability to pass a context and additional request options. // -// See EnableVgwRoutePropagation for details on how to use this API operation. +// See DisassociateAddress for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) EnableVgwRoutePropagationWithContext(ctx aws.Context, input *EnableVgwRoutePropagationInput, opts ...request.Option) (*EnableVgwRoutePropagationOutput, error) { - req, out := c.EnableVgwRoutePropagationRequest(input) +func (c *EC2) DisassociateAddressWithContext(ctx aws.Context, input *DisassociateAddressInput, opts ...request.Option) (*DisassociateAddressOutput, error) { + req, out := c.DisassociateAddressRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opEnableVolumeIO = "EnableVolumeIO" +const opDisassociateClientVpnTargetNetwork = "DisassociateClientVpnTargetNetwork" -// EnableVolumeIORequest generates a "aws/request.Request" representing the -// client's request for the EnableVolumeIO operation. The "output" return +// DisassociateClientVpnTargetNetworkRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateClientVpnTargetNetwork operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See EnableVolumeIO for more information on using the EnableVolumeIO +// See DisassociateClientVpnTargetNetwork for more information on using the DisassociateClientVpnTargetNetwork // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the EnableVolumeIORequest method. -// req, resp := client.EnableVolumeIORequest(params) +// // Example sending a request using the DisassociateClientVpnTargetNetworkRequest method. +// req, resp := client.DisassociateClientVpnTargetNetworkRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVolumeIO -func (c *EC2) EnableVolumeIORequest(input *EnableVolumeIOInput) (req *request.Request, output *EnableVolumeIOOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateClientVpnTargetNetwork +func (c *EC2) DisassociateClientVpnTargetNetworkRequest(input *DisassociateClientVpnTargetNetworkInput) (req *request.Request, output *DisassociateClientVpnTargetNetworkOutput) { op := &request.Operation{ - Name: opEnableVolumeIO, + Name: opDisassociateClientVpnTargetNetwork, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &EnableVolumeIOInput{} + input = &DisassociateClientVpnTargetNetworkInput{} } - output = &EnableVolumeIOOutput{} + output = &DisassociateClientVpnTargetNetworkOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// EnableVolumeIO API operation for Amazon Elastic Compute Cloud. +// DisassociateClientVpnTargetNetwork 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. +// Disassociates a target network from the specified Client VPN endpoint. When +// you disassociate the last target network from a Client VPN, the following +// happens: +// +// * The route that was automatically added for the VPC is deleted +// +// * All active client connections are terminated +// +// * New client connections are disallowed +// +// * The Client VPN endpoint's status changes to pending-associate // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation DisassociateClientVpnTargetNetwork for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateClientVpnTargetNetwork +func (c *EC2) DisassociateClientVpnTargetNetwork(input *DisassociateClientVpnTargetNetworkInput) (*DisassociateClientVpnTargetNetworkOutput, error) { + req, out := c.DisassociateClientVpnTargetNetworkRequest(input) return out, req.Send() } -// EnableVolumeIOWithContext is the same as EnableVolumeIO with the addition of +// DisassociateClientVpnTargetNetworkWithContext is the same as DisassociateClientVpnTargetNetwork with the addition of // the ability to pass a context and additional request options. // -// See EnableVolumeIO for details on how to use this API operation. +// See DisassociateClientVpnTargetNetwork for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) EnableVolumeIOWithContext(ctx aws.Context, input *EnableVolumeIOInput, opts ...request.Option) (*EnableVolumeIOOutput, error) { - req, out := c.EnableVolumeIORequest(input) +func (c *EC2) DisassociateClientVpnTargetNetworkWithContext(ctx aws.Context, input *DisassociateClientVpnTargetNetworkInput, opts ...request.Option) (*DisassociateClientVpnTargetNetworkOutput, error) { + req, out := c.DisassociateClientVpnTargetNetworkRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opEnableVpcClassicLink = "EnableVpcClassicLink" +const opDisassociateIamInstanceProfile = "DisassociateIamInstanceProfile" -// EnableVpcClassicLinkRequest generates a "aws/request.Request" representing the -// client's request for the EnableVpcClassicLink operation. The "output" return +// DisassociateIamInstanceProfileRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateIamInstanceProfile operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See EnableVpcClassicLink for more information on using the EnableVpcClassicLink +// See DisassociateIamInstanceProfile for more information on using the DisassociateIamInstanceProfile // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the EnableVpcClassicLinkRequest method. -// req, resp := client.EnableVpcClassicLinkRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLink -func (c *EC2) EnableVpcClassicLinkRequest(input *EnableVpcClassicLinkInput) (req *request.Request, output *EnableVpcClassicLinkOutput) { +// See also, 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: opEnableVpcClassicLink, + Name: opDisassociateIamInstanceProfile, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &EnableVpcClassicLinkInput{} + input = &DisassociateIamInstanceProfileInput{} } - output = &EnableVpcClassicLinkOutput{} + output = &DisassociateIamInstanceProfileOutput{} req = c.newRequest(op, input, output) return } -// EnableVpcClassicLink API operation for Amazon Elastic Compute Cloud. +// DisassociateIamInstanceProfile 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 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 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) -// in the Amazon Elastic Compute Cloud User Guide. +// 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 EnableVpcClassicLink for usage and error information. -// See also, 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) +// API operation DisassociateIamInstanceProfile for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateIamInstanceProfile +func (c *EC2) DisassociateIamInstanceProfile(input *DisassociateIamInstanceProfileInput) (*DisassociateIamInstanceProfileOutput, error) { + req, out := c.DisassociateIamInstanceProfileRequest(input) return out, req.Send() } -// EnableVpcClassicLinkWithContext is the same as EnableVpcClassicLink with the addition of +// DisassociateIamInstanceProfileWithContext is the same as DisassociateIamInstanceProfile with the addition of // the ability to pass a context and additional request options. // -// See EnableVpcClassicLink for details on how to use this API operation. +// See DisassociateIamInstanceProfile for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) EnableVpcClassicLinkWithContext(ctx aws.Context, input *EnableVpcClassicLinkInput, opts ...request.Option) (*EnableVpcClassicLinkOutput, error) { - req, out := c.EnableVpcClassicLinkRequest(input) +func (c *EC2) DisassociateIamInstanceProfileWithContext(ctx aws.Context, input *DisassociateIamInstanceProfileInput, opts ...request.Option) (*DisassociateIamInstanceProfileOutput, error) { + req, out := c.DisassociateIamInstanceProfileRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opEnableVpcClassicLinkDnsSupport = "EnableVpcClassicLinkDnsSupport" +const opDisassociateRouteTable = "DisassociateRouteTable" -// EnableVpcClassicLinkDnsSupportRequest generates a "aws/request.Request" representing the -// client's request for the EnableVpcClassicLinkDnsSupport operation. The "output" return +// DisassociateRouteTableRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateRouteTable operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See EnableVpcClassicLinkDnsSupport for more information on using the EnableVpcClassicLinkDnsSupport +// See DisassociateRouteTable for more information on using the DisassociateRouteTable // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the EnableVpcClassicLinkDnsSupportRequest method. -// req, resp := client.EnableVpcClassicLinkDnsSupportRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLinkDnsSupport -func (c *EC2) EnableVpcClassicLinkDnsSupportRequest(input *EnableVpcClassicLinkDnsSupportInput) (req *request.Request, output *EnableVpcClassicLinkDnsSupportOutput) { +// See also, 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: opEnableVpcClassicLinkDnsSupport, + Name: opDisassociateRouteTable, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &EnableVpcClassicLinkDnsSupportInput{} + input = &DisassociateRouteTableInput{} } - output = &EnableVpcClassicLinkDnsSupportOutput{} + output = &DisassociateRouteTableOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// EnableVpcClassicLinkDnsSupport API operation for Amazon Elastic Compute Cloud. +// DisassociateRouteTable 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, -// see ClassicLink (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/vpc-classiclink.html) -// in the Amazon Elastic Compute Cloud User Guide. +// 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 (https://docs.aws.amazon.com/vpc/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 EnableVpcClassicLinkDnsSupport for usage and error information. -// See also, 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) +// API operation DisassociateRouteTable for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateRouteTable +func (c *EC2) DisassociateRouteTable(input *DisassociateRouteTableInput) (*DisassociateRouteTableOutput, error) { + req, out := c.DisassociateRouteTableRequest(input) return out, req.Send() } -// EnableVpcClassicLinkDnsSupportWithContext is the same as EnableVpcClassicLinkDnsSupport with the addition of +// DisassociateRouteTableWithContext is the same as DisassociateRouteTable with the addition of // the ability to pass a context and additional request options. // -// See EnableVpcClassicLinkDnsSupport for details on how to use this API operation. +// See DisassociateRouteTable for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) EnableVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *EnableVpcClassicLinkDnsSupportInput, opts ...request.Option) (*EnableVpcClassicLinkDnsSupportOutput, error) { - req, out := c.EnableVpcClassicLinkDnsSupportRequest(input) +func (c *EC2) DisassociateRouteTableWithContext(ctx aws.Context, input *DisassociateRouteTableInput, opts ...request.Option) (*DisassociateRouteTableOutput, error) { + req, out := c.DisassociateRouteTableRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opExportClientVpnClientCertificateRevocationList = "ExportClientVpnClientCertificateRevocationList" +const opDisassociateSubnetCidrBlock = "DisassociateSubnetCidrBlock" -// ExportClientVpnClientCertificateRevocationListRequest generates a "aws/request.Request" representing the -// client's request for the ExportClientVpnClientCertificateRevocationList operation. The "output" return +// DisassociateSubnetCidrBlockRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateSubnetCidrBlock operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ExportClientVpnClientCertificateRevocationList for more information on using the ExportClientVpnClientCertificateRevocationList +// See DisassociateSubnetCidrBlock for more information on using the DisassociateSubnetCidrBlock // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ExportClientVpnClientCertificateRevocationListRequest method. -// req, resp := client.ExportClientVpnClientCertificateRevocationListRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportClientVpnClientCertificateRevocationList -func (c *EC2) ExportClientVpnClientCertificateRevocationListRequest(input *ExportClientVpnClientCertificateRevocationListInput) (req *request.Request, output *ExportClientVpnClientCertificateRevocationListOutput) { +// See also, 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: opExportClientVpnClientCertificateRevocationList, + Name: opDisassociateSubnetCidrBlock, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ExportClientVpnClientCertificateRevocationListInput{} + input = &DisassociateSubnetCidrBlockInput{} } - output = &ExportClientVpnClientCertificateRevocationListOutput{} + output = &DisassociateSubnetCidrBlockOutput{} req = c.newRequest(op, input, output) return } -// ExportClientVpnClientCertificateRevocationList API operation for Amazon Elastic Compute Cloud. +// DisassociateSubnetCidrBlock API operation for Amazon Elastic Compute Cloud. // -// Downloads the client certificate revocation list for the specified Client -// VPN endpoint. +// 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 ExportClientVpnClientCertificateRevocationList for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportClientVpnClientCertificateRevocationList -func (c *EC2) ExportClientVpnClientCertificateRevocationList(input *ExportClientVpnClientCertificateRevocationListInput) (*ExportClientVpnClientCertificateRevocationListOutput, error) { - req, out := c.ExportClientVpnClientCertificateRevocationListRequest(input) +// API operation DisassociateSubnetCidrBlock for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateSubnetCidrBlock +func (c *EC2) DisassociateSubnetCidrBlock(input *DisassociateSubnetCidrBlockInput) (*DisassociateSubnetCidrBlockOutput, error) { + req, out := c.DisassociateSubnetCidrBlockRequest(input) return out, req.Send() } -// ExportClientVpnClientCertificateRevocationListWithContext is the same as ExportClientVpnClientCertificateRevocationList with the addition of +// DisassociateSubnetCidrBlockWithContext is the same as DisassociateSubnetCidrBlock with the addition of // the ability to pass a context and additional request options. // -// See ExportClientVpnClientCertificateRevocationList for details on how to use this API operation. +// See DisassociateSubnetCidrBlock for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ExportClientVpnClientCertificateRevocationListWithContext(ctx aws.Context, input *ExportClientVpnClientCertificateRevocationListInput, opts ...request.Option) (*ExportClientVpnClientCertificateRevocationListOutput, error) { - req, out := c.ExportClientVpnClientCertificateRevocationListRequest(input) +func (c *EC2) DisassociateSubnetCidrBlockWithContext(ctx aws.Context, input *DisassociateSubnetCidrBlockInput, opts ...request.Option) (*DisassociateSubnetCidrBlockOutput, error) { + req, out := c.DisassociateSubnetCidrBlockRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opExportClientVpnClientConfiguration = "ExportClientVpnClientConfiguration" +const opDisassociateTransitGatewayMulticastDomain = "DisassociateTransitGatewayMulticastDomain" -// ExportClientVpnClientConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the ExportClientVpnClientConfiguration operation. The "output" return +// DisassociateTransitGatewayMulticastDomainRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateTransitGatewayMulticastDomain operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ExportClientVpnClientConfiguration for more information on using the ExportClientVpnClientConfiguration +// See DisassociateTransitGatewayMulticastDomain for more information on using the DisassociateTransitGatewayMulticastDomain // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ExportClientVpnClientConfigurationRequest method. -// req, resp := client.ExportClientVpnClientConfigurationRequest(params) +// // Example sending a request using the DisassociateTransitGatewayMulticastDomainRequest method. +// req, resp := client.DisassociateTransitGatewayMulticastDomainRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportClientVpnClientConfiguration -func (c *EC2) ExportClientVpnClientConfigurationRequest(input *ExportClientVpnClientConfigurationInput) (req *request.Request, output *ExportClientVpnClientConfigurationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateTransitGatewayMulticastDomain +func (c *EC2) DisassociateTransitGatewayMulticastDomainRequest(input *DisassociateTransitGatewayMulticastDomainInput) (req *request.Request, output *DisassociateTransitGatewayMulticastDomainOutput) { op := &request.Operation{ - Name: opExportClientVpnClientConfiguration, + Name: opDisassociateTransitGatewayMulticastDomain, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ExportClientVpnClientConfigurationInput{} + input = &DisassociateTransitGatewayMulticastDomainInput{} } - output = &ExportClientVpnClientConfigurationOutput{} + output = &DisassociateTransitGatewayMulticastDomainOutput{} req = c.newRequest(op, input, output) return } -// ExportClientVpnClientConfiguration API operation for Amazon Elastic Compute Cloud. +// DisassociateTransitGatewayMulticastDomain API operation for Amazon Elastic Compute Cloud. // -// Downloads the contents of the Client VPN endpoint configuration file for -// the specified Client VPN endpoint. The Client VPN endpoint configuration -// file includes the Client VPN endpoint and certificate information clients -// need to establish a connection with the Client VPN endpoint. +// Disassociates the specified subnets from the transit gateway multicast 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 Elastic Compute Cloud's -// API operation ExportClientVpnClientConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportClientVpnClientConfiguration -func (c *EC2) ExportClientVpnClientConfiguration(input *ExportClientVpnClientConfigurationInput) (*ExportClientVpnClientConfigurationOutput, error) { - req, out := c.ExportClientVpnClientConfigurationRequest(input) +// API operation DisassociateTransitGatewayMulticastDomain for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateTransitGatewayMulticastDomain +func (c *EC2) DisassociateTransitGatewayMulticastDomain(input *DisassociateTransitGatewayMulticastDomainInput) (*DisassociateTransitGatewayMulticastDomainOutput, error) { + req, out := c.DisassociateTransitGatewayMulticastDomainRequest(input) return out, req.Send() } -// ExportClientVpnClientConfigurationWithContext is the same as ExportClientVpnClientConfiguration with the addition of +// DisassociateTransitGatewayMulticastDomainWithContext is the same as DisassociateTransitGatewayMulticastDomain with the addition of // the ability to pass a context and additional request options. // -// See ExportClientVpnClientConfiguration for details on how to use this API operation. +// See DisassociateTransitGatewayMulticastDomain for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ExportClientVpnClientConfigurationWithContext(ctx aws.Context, input *ExportClientVpnClientConfigurationInput, opts ...request.Option) (*ExportClientVpnClientConfigurationOutput, error) { - req, out := c.ExportClientVpnClientConfigurationRequest(input) +func (c *EC2) DisassociateTransitGatewayMulticastDomainWithContext(ctx aws.Context, input *DisassociateTransitGatewayMulticastDomainInput, opts ...request.Option) (*DisassociateTransitGatewayMulticastDomainOutput, error) { + req, out := c.DisassociateTransitGatewayMulticastDomainRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opExportImage = "ExportImage" +const opDisassociateTransitGatewayRouteTable = "DisassociateTransitGatewayRouteTable" -// ExportImageRequest generates a "aws/request.Request" representing the -// client's request for the ExportImage operation. The "output" return +// DisassociateTransitGatewayRouteTableRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateTransitGatewayRouteTable operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ExportImage for more information on using the ExportImage +// See DisassociateTransitGatewayRouteTable for more information on using the DisassociateTransitGatewayRouteTable // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ExportImageRequest method. -// req, resp := client.ExportImageRequest(params) +// // Example sending a request using the DisassociateTransitGatewayRouteTableRequest method. +// req, resp := client.DisassociateTransitGatewayRouteTableRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportImage -func (c *EC2) ExportImageRequest(input *ExportImageInput) (req *request.Request, output *ExportImageOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateTransitGatewayRouteTable +func (c *EC2) DisassociateTransitGatewayRouteTableRequest(input *DisassociateTransitGatewayRouteTableInput) (req *request.Request, output *DisassociateTransitGatewayRouteTableOutput) { op := &request.Operation{ - Name: opExportImage, + Name: opDisassociateTransitGatewayRouteTable, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ExportImageInput{} + input = &DisassociateTransitGatewayRouteTableInput{} } - output = &ExportImageOutput{} + output = &DisassociateTransitGatewayRouteTableOutput{} req = c.newRequest(op, input, output) return } -// ExportImage API operation for Amazon Elastic Compute Cloud. +// DisassociateTransitGatewayRouteTable API operation for Amazon Elastic Compute Cloud. // -// Exports an Amazon Machine Image (AMI) to a VM file. For more information, -// see Exporting a VM Directory from an Amazon Machine Image (AMI) (https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport_image.html) -// in the VM Import/Export User Guide. +// Disassociates a resource attachment from a transit gateway 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 ExportImage for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportImage -func (c *EC2) ExportImage(input *ExportImageInput) (*ExportImageOutput, error) { - req, out := c.ExportImageRequest(input) +// API operation DisassociateTransitGatewayRouteTable for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateTransitGatewayRouteTable +func (c *EC2) DisassociateTransitGatewayRouteTable(input *DisassociateTransitGatewayRouteTableInput) (*DisassociateTransitGatewayRouteTableOutput, error) { + req, out := c.DisassociateTransitGatewayRouteTableRequest(input) return out, req.Send() } -// ExportImageWithContext is the same as ExportImage with the addition of +// DisassociateTransitGatewayRouteTableWithContext is the same as DisassociateTransitGatewayRouteTable with the addition of // the ability to pass a context and additional request options. // -// See ExportImage for details on how to use this API operation. +// See DisassociateTransitGatewayRouteTable for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ExportImageWithContext(ctx aws.Context, input *ExportImageInput, opts ...request.Option) (*ExportImageOutput, error) { - req, out := c.ExportImageRequest(input) +func (c *EC2) DisassociateTransitGatewayRouteTableWithContext(ctx aws.Context, input *DisassociateTransitGatewayRouteTableInput, opts ...request.Option) (*DisassociateTransitGatewayRouteTableOutput, error) { + req, out := c.DisassociateTransitGatewayRouteTableRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opExportTransitGatewayRoutes = "ExportTransitGatewayRoutes" +const opDisassociateVpcCidrBlock = "DisassociateVpcCidrBlock" -// ExportTransitGatewayRoutesRequest generates a "aws/request.Request" representing the -// client's request for the ExportTransitGatewayRoutes operation. The "output" return +// DisassociateVpcCidrBlockRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateVpcCidrBlock operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ExportTransitGatewayRoutes for more information on using the ExportTransitGatewayRoutes +// See DisassociateVpcCidrBlock for more information on using the DisassociateVpcCidrBlock // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ExportTransitGatewayRoutesRequest method. -// req, resp := client.ExportTransitGatewayRoutesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportTransitGatewayRoutes -func (c *EC2) ExportTransitGatewayRoutesRequest(input *ExportTransitGatewayRoutesInput) (req *request.Request, output *ExportTransitGatewayRoutesOutput) { +// See also, 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: opExportTransitGatewayRoutes, + Name: opDisassociateVpcCidrBlock, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ExportTransitGatewayRoutesInput{} + input = &DisassociateVpcCidrBlockInput{} } - output = &ExportTransitGatewayRoutesOutput{} + output = &DisassociateVpcCidrBlockOutput{} req = c.newRequest(op, input, output) return } -// ExportTransitGatewayRoutes API operation for Amazon Elastic Compute Cloud. -// -// Exports routes from the specified transit gateway route table to the specified -// S3 bucket. By default, all routes are exported. Alternatively, you can filter -// by CIDR range. +// DisassociateVpcCidrBlock API operation for Amazon Elastic Compute Cloud. // -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about +// Disassociates a CIDR block from a VPC. To disassociate the CIDR block, you +// must specify its association ID. You can get the association ID by using +// DescribeVpcs. You must detach or delete all gateways and resources that are +// associated with the CIDR block before you can disassociate it. +// +// You cannot disassociate the CIDR block with which you originally created +// the VPC (the primary CIDR block). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ExportTransitGatewayRoutes for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportTransitGatewayRoutes -func (c *EC2) ExportTransitGatewayRoutes(input *ExportTransitGatewayRoutesInput) (*ExportTransitGatewayRoutesOutput, error) { - req, out := c.ExportTransitGatewayRoutesRequest(input) +// API operation DisassociateVpcCidrBlock for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/DisassociateVpcCidrBlock +func (c *EC2) DisassociateVpcCidrBlock(input *DisassociateVpcCidrBlockInput) (*DisassociateVpcCidrBlockOutput, error) { + req, out := c.DisassociateVpcCidrBlockRequest(input) return out, req.Send() } -// ExportTransitGatewayRoutesWithContext is the same as ExportTransitGatewayRoutes with the addition of +// DisassociateVpcCidrBlockWithContext is the same as DisassociateVpcCidrBlock with the addition of // the ability to pass a context and additional request options. // -// See ExportTransitGatewayRoutes for details on how to use this API operation. +// See DisassociateVpcCidrBlock for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ExportTransitGatewayRoutesWithContext(ctx aws.Context, input *ExportTransitGatewayRoutesInput, opts ...request.Option) (*ExportTransitGatewayRoutesOutput, error) { - req, out := c.ExportTransitGatewayRoutesRequest(input) +func (c *EC2) DisassociateVpcCidrBlockWithContext(ctx aws.Context, input *DisassociateVpcCidrBlockInput, opts ...request.Option) (*DisassociateVpcCidrBlockOutput, error) { + req, out := c.DisassociateVpcCidrBlockRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetCapacityReservationUsage = "GetCapacityReservationUsage" +const opEnableEbsEncryptionByDefault = "EnableEbsEncryptionByDefault" -// GetCapacityReservationUsageRequest generates a "aws/request.Request" representing the -// client's request for the GetCapacityReservationUsage operation. The "output" return +// EnableEbsEncryptionByDefaultRequest generates a "aws/request.Request" representing the +// client's request for the EnableEbsEncryptionByDefault operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetCapacityReservationUsage for more information on using the GetCapacityReservationUsage +// See EnableEbsEncryptionByDefault for more information on using the EnableEbsEncryptionByDefault // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetCapacityReservationUsageRequest method. -// req, resp := client.GetCapacityReservationUsageRequest(params) +// // Example sending a request using the EnableEbsEncryptionByDefaultRequest method. +// req, resp := client.EnableEbsEncryptionByDefaultRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetCapacityReservationUsage -func (c *EC2) GetCapacityReservationUsageRequest(input *GetCapacityReservationUsageInput) (req *request.Request, output *GetCapacityReservationUsageOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableEbsEncryptionByDefault +func (c *EC2) EnableEbsEncryptionByDefaultRequest(input *EnableEbsEncryptionByDefaultInput) (req *request.Request, output *EnableEbsEncryptionByDefaultOutput) { op := &request.Operation{ - Name: opGetCapacityReservationUsage, + Name: opEnableEbsEncryptionByDefault, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetCapacityReservationUsageInput{} + input = &EnableEbsEncryptionByDefaultInput{} } - output = &GetCapacityReservationUsageOutput{} + output = &EnableEbsEncryptionByDefaultOutput{} req = c.newRequest(op, input, output) return } -// GetCapacityReservationUsage API operation for Amazon Elastic Compute Cloud. +// EnableEbsEncryptionByDefault API operation for Amazon Elastic Compute Cloud. // -// Gets usage information about a Capacity Reservation. If the Capacity Reservation -// is shared, it shows usage information for the Capacity Reservation owner -// and each AWS account that is currently using the shared capacity. If the -// Capacity Reservation is not shared, it shows only the Capacity Reservation -// owner's usage. +// Enables EBS encryption by default for your account in the current Region. +// +// After you enable encryption by default, the EBS volumes that you create are +// are always encrypted, either using the default CMK or the CMK that you specified +// when you created each volume. For more information, see Amazon EBS Encryption +// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) +// in the Amazon Elastic Compute Cloud User Guide. +// +// You can specify the default CMK for encryption by default using ModifyEbsDefaultKmsKeyId +// or ResetEbsDefaultKmsKeyId. +// +// Enabling encryption by default has no effect on the encryption status of +// your existing volumes. +// +// After you enable encryption by default, you can no longer launch instances +// using instance types that do not support encryption. For more information, +// see Supported Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_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 GetCapacityReservationUsage for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetCapacityReservationUsage -func (c *EC2) GetCapacityReservationUsage(input *GetCapacityReservationUsageInput) (*GetCapacityReservationUsageOutput, error) { - req, out := c.GetCapacityReservationUsageRequest(input) +// API operation EnableEbsEncryptionByDefault for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableEbsEncryptionByDefault +func (c *EC2) EnableEbsEncryptionByDefault(input *EnableEbsEncryptionByDefaultInput) (*EnableEbsEncryptionByDefaultOutput, error) { + req, out := c.EnableEbsEncryptionByDefaultRequest(input) return out, req.Send() } -// GetCapacityReservationUsageWithContext is the same as GetCapacityReservationUsage with the addition of +// EnableEbsEncryptionByDefaultWithContext is the same as EnableEbsEncryptionByDefault with the addition of // the ability to pass a context and additional request options. // -// See GetCapacityReservationUsage for details on how to use this API operation. +// See EnableEbsEncryptionByDefault for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) GetCapacityReservationUsageWithContext(ctx aws.Context, input *GetCapacityReservationUsageInput, opts ...request.Option) (*GetCapacityReservationUsageOutput, error) { - req, out := c.GetCapacityReservationUsageRequest(input) +func (c *EC2) EnableEbsEncryptionByDefaultWithContext(ctx aws.Context, input *EnableEbsEncryptionByDefaultInput, opts ...request.Option) (*EnableEbsEncryptionByDefaultOutput, error) { + req, out := c.EnableEbsEncryptionByDefaultRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetConsoleOutput = "GetConsoleOutput" +const opEnableFastSnapshotRestores = "EnableFastSnapshotRestores" -// GetConsoleOutputRequest generates a "aws/request.Request" representing the -// client's request for the GetConsoleOutput operation. The "output" return +// EnableFastSnapshotRestoresRequest generates a "aws/request.Request" representing the +// client's request for the EnableFastSnapshotRestores operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetConsoleOutput for more information on using the GetConsoleOutput +// See EnableFastSnapshotRestores for more information on using the EnableFastSnapshotRestores // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetConsoleOutputRequest method. -// req, resp := client.GetConsoleOutputRequest(params) +// // Example sending a request using the EnableFastSnapshotRestoresRequest method. +// req, resp := client.EnableFastSnapshotRestoresRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleOutput -func (c *EC2) GetConsoleOutputRequest(input *GetConsoleOutputInput) (req *request.Request, output *GetConsoleOutputOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableFastSnapshotRestores +func (c *EC2) EnableFastSnapshotRestoresRequest(input *EnableFastSnapshotRestoresInput) (req *request.Request, output *EnableFastSnapshotRestoresOutput) { op := &request.Operation{ - Name: opGetConsoleOutput, + Name: opEnableFastSnapshotRestores, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetConsoleOutputInput{} + input = &EnableFastSnapshotRestoresInput{} } - output = &GetConsoleOutputOutput{} + output = &EnableFastSnapshotRestoresOutput{} req = c.newRequest(op, input, output) return } -// GetConsoleOutput API operation for Amazon Elastic Compute Cloud. -// -// Gets the console output for the specified instance. 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. For Windows -// instances, the instance console output includes the last three system event -// log errors. +// EnableFastSnapshotRestores API operation for Amazon Elastic Compute Cloud. // -// By default, the console output returns buffered information that was posted -// shortly after an instance transition state (start, stop, reboot, or terminate). -// This information is available for at least one hour after the most recent -// post. Only the most recent 64 KB of console output is available. +// Enables fast snapshot restores for the specified snapshots in the specified +// Availability Zones. // -// You can optionally retrieve the latest serial console output at any time -// during the instance lifecycle. This option is supported on instance types -// that use the Nitro hypervisor. +// You get the full benefit of fast snapshot restores after they enter the enabled +// state. To get the current state of fast snapshot restores, use DescribeFastSnapshotRestores. +// To disable fast snapshot restores, use DisableFastSnapshotRestores. // -// For more information, see Instance Console Output (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html#instance-console-console-output) +// For more information, see Amazon EBS Fast Snapshot Restore (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-fast-snapshot-restore.html) // in the Amazon Elastic Compute Cloud User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -24373,875 +26668,749 @@ func (c *EC2) GetConsoleOutputRequest(input *GetConsoleOutputInput) (req *reques // the error. // // See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation GetConsoleOutput for usage and error information. -// See also, 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) +// API operation EnableFastSnapshotRestores for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableFastSnapshotRestores +func (c *EC2) EnableFastSnapshotRestores(input *EnableFastSnapshotRestoresInput) (*EnableFastSnapshotRestoresOutput, error) { + req, out := c.EnableFastSnapshotRestoresRequest(input) return out, req.Send() } -// GetConsoleOutputWithContext is the same as GetConsoleOutput with the addition of +// EnableFastSnapshotRestoresWithContext is the same as EnableFastSnapshotRestores with the addition of // the ability to pass a context and additional request options. // -// See GetConsoleOutput for details on how to use this API operation. +// See EnableFastSnapshotRestores for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) GetConsoleOutputWithContext(ctx aws.Context, input *GetConsoleOutputInput, opts ...request.Option) (*GetConsoleOutputOutput, error) { - req, out := c.GetConsoleOutputRequest(input) +func (c *EC2) EnableFastSnapshotRestoresWithContext(ctx aws.Context, input *EnableFastSnapshotRestoresInput, opts ...request.Option) (*EnableFastSnapshotRestoresOutput, error) { + req, out := c.EnableFastSnapshotRestoresRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetConsoleScreenshot = "GetConsoleScreenshot" +const opEnableTransitGatewayRouteTablePropagation = "EnableTransitGatewayRouteTablePropagation" -// GetConsoleScreenshotRequest generates a "aws/request.Request" representing the -// client's request for the GetConsoleScreenshot operation. The "output" return +// EnableTransitGatewayRouteTablePropagationRequest generates a "aws/request.Request" representing the +// client's request for the EnableTransitGatewayRouteTablePropagation operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetConsoleScreenshot for more information on using the GetConsoleScreenshot +// See EnableTransitGatewayRouteTablePropagation for more information on using the EnableTransitGatewayRouteTablePropagation // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetConsoleScreenshotRequest method. -// req, resp := client.GetConsoleScreenshotRequest(params) +// // Example sending a request using the EnableTransitGatewayRouteTablePropagationRequest method. +// req, resp := client.EnableTransitGatewayRouteTablePropagationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleScreenshot -func (c *EC2) GetConsoleScreenshotRequest(input *GetConsoleScreenshotInput) (req *request.Request, output *GetConsoleScreenshotOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableTransitGatewayRouteTablePropagation +func (c *EC2) EnableTransitGatewayRouteTablePropagationRequest(input *EnableTransitGatewayRouteTablePropagationInput) (req *request.Request, output *EnableTransitGatewayRouteTablePropagationOutput) { op := &request.Operation{ - Name: opGetConsoleScreenshot, + Name: opEnableTransitGatewayRouteTablePropagation, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetConsoleScreenshotInput{} + input = &EnableTransitGatewayRouteTablePropagationInput{} } - output = &GetConsoleScreenshotOutput{} + output = &EnableTransitGatewayRouteTablePropagationOutput{} 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. +// EnableTransitGatewayRouteTablePropagation API operation for Amazon Elastic Compute Cloud. // -// The returned content is Base64-encoded. +// Enables the specified attachment to propagate routes to the specified propagation +// 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 GetConsoleScreenshot for usage and error information. -// See also, 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) +// API operation EnableTransitGatewayRouteTablePropagation for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableTransitGatewayRouteTablePropagation +func (c *EC2) EnableTransitGatewayRouteTablePropagation(input *EnableTransitGatewayRouteTablePropagationInput) (*EnableTransitGatewayRouteTablePropagationOutput, error) { + req, out := c.EnableTransitGatewayRouteTablePropagationRequest(input) return out, req.Send() } -// GetConsoleScreenshotWithContext is the same as GetConsoleScreenshot with the addition of +// EnableTransitGatewayRouteTablePropagationWithContext is the same as EnableTransitGatewayRouteTablePropagation with the addition of // the ability to pass a context and additional request options. // -// See GetConsoleScreenshot for details on how to use this API operation. +// See EnableTransitGatewayRouteTablePropagation for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) GetConsoleScreenshotWithContext(ctx aws.Context, input *GetConsoleScreenshotInput, opts ...request.Option) (*GetConsoleScreenshotOutput, error) { - req, out := c.GetConsoleScreenshotRequest(input) +func (c *EC2) EnableTransitGatewayRouteTablePropagationWithContext(ctx aws.Context, input *EnableTransitGatewayRouteTablePropagationInput, opts ...request.Option) (*EnableTransitGatewayRouteTablePropagationOutput, error) { + req, out := c.EnableTransitGatewayRouteTablePropagationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetEbsDefaultKmsKeyId = "GetEbsDefaultKmsKeyId" +const opEnableVgwRoutePropagation = "EnableVgwRoutePropagation" -// GetEbsDefaultKmsKeyIdRequest generates a "aws/request.Request" representing the -// client's request for the GetEbsDefaultKmsKeyId operation. The "output" return +// EnableVgwRoutePropagationRequest generates a "aws/request.Request" representing the +// client's request for the EnableVgwRoutePropagation operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetEbsDefaultKmsKeyId for more information on using the GetEbsDefaultKmsKeyId +// See EnableVgwRoutePropagation for more information on using the EnableVgwRoutePropagation // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetEbsDefaultKmsKeyIdRequest method. -// req, resp := client.GetEbsDefaultKmsKeyIdRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetEbsDefaultKmsKeyId -func (c *EC2) GetEbsDefaultKmsKeyIdRequest(input *GetEbsDefaultKmsKeyIdInput) (req *request.Request, output *GetEbsDefaultKmsKeyIdOutput) { +// See also, 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: opGetEbsDefaultKmsKeyId, + Name: opEnableVgwRoutePropagation, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetEbsDefaultKmsKeyIdInput{} + input = &EnableVgwRoutePropagationInput{} } - output = &GetEbsDefaultKmsKeyIdOutput{} + output = &EnableVgwRoutePropagationOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// GetEbsDefaultKmsKeyId API operation for Amazon Elastic Compute Cloud. -// -// Describes the default customer master key (CMK) for EBS encryption by default -// for your account in this Region. You can change the default CMK for encryption -// by default using ModifyEbsDefaultKmsKeyId or ResetEbsDefaultKmsKeyId. +// EnableVgwRoutePropagation API operation for Amazon Elastic Compute Cloud. // -// For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) -// in the Amazon Elastic Compute Cloud User Guide. +// 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 GetEbsDefaultKmsKeyId for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetEbsDefaultKmsKeyId -func (c *EC2) GetEbsDefaultKmsKeyId(input *GetEbsDefaultKmsKeyIdInput) (*GetEbsDefaultKmsKeyIdOutput, error) { - req, out := c.GetEbsDefaultKmsKeyIdRequest(input) +// API operation EnableVgwRoutePropagation for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVgwRoutePropagation +func (c *EC2) EnableVgwRoutePropagation(input *EnableVgwRoutePropagationInput) (*EnableVgwRoutePropagationOutput, error) { + req, out := c.EnableVgwRoutePropagationRequest(input) return out, req.Send() } -// GetEbsDefaultKmsKeyIdWithContext is the same as GetEbsDefaultKmsKeyId with the addition of +// EnableVgwRoutePropagationWithContext is the same as EnableVgwRoutePropagation with the addition of // the ability to pass a context and additional request options. // -// See GetEbsDefaultKmsKeyId for details on how to use this API operation. +// See EnableVgwRoutePropagation for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) GetEbsDefaultKmsKeyIdWithContext(ctx aws.Context, input *GetEbsDefaultKmsKeyIdInput, opts ...request.Option) (*GetEbsDefaultKmsKeyIdOutput, error) { - req, out := c.GetEbsDefaultKmsKeyIdRequest(input) +func (c *EC2) EnableVgwRoutePropagationWithContext(ctx aws.Context, input *EnableVgwRoutePropagationInput, opts ...request.Option) (*EnableVgwRoutePropagationOutput, error) { + req, out := c.EnableVgwRoutePropagationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetEbsEncryptionByDefault = "GetEbsEncryptionByDefault" +const opEnableVolumeIO = "EnableVolumeIO" -// GetEbsEncryptionByDefaultRequest generates a "aws/request.Request" representing the -// client's request for the GetEbsEncryptionByDefault operation. The "output" return +// EnableVolumeIORequest generates a "aws/request.Request" representing the +// client's request for the EnableVolumeIO operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetEbsEncryptionByDefault for more information on using the GetEbsEncryptionByDefault +// See EnableVolumeIO for more information on using the EnableVolumeIO // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetEbsEncryptionByDefaultRequest method. -// req, resp := client.GetEbsEncryptionByDefaultRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetEbsEncryptionByDefault -func (c *EC2) GetEbsEncryptionByDefaultRequest(input *GetEbsEncryptionByDefaultInput) (req *request.Request, output *GetEbsEncryptionByDefaultOutput) { +// See also, 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: opGetEbsEncryptionByDefault, + Name: opEnableVolumeIO, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetEbsEncryptionByDefaultInput{} + input = &EnableVolumeIOInput{} } - output = &GetEbsEncryptionByDefaultOutput{} + output = &EnableVolumeIOOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// GetEbsEncryptionByDefault API operation for Amazon Elastic Compute Cloud. -// -// Describes whether EBS encryption by default is enabled for your account in -// the current Region. +// EnableVolumeIO API operation for Amazon Elastic Compute Cloud. // -// For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) -// in the Amazon Elastic Compute Cloud User Guide. +// 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 GetEbsEncryptionByDefault for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetEbsEncryptionByDefault -func (c *EC2) GetEbsEncryptionByDefault(input *GetEbsEncryptionByDefaultInput) (*GetEbsEncryptionByDefaultOutput, error) { - req, out := c.GetEbsEncryptionByDefaultRequest(input) +// API operation EnableVolumeIO for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVolumeIO +func (c *EC2) EnableVolumeIO(input *EnableVolumeIOInput) (*EnableVolumeIOOutput, error) { + req, out := c.EnableVolumeIORequest(input) return out, req.Send() } -// GetEbsEncryptionByDefaultWithContext is the same as GetEbsEncryptionByDefault with the addition of +// EnableVolumeIOWithContext is the same as EnableVolumeIO with the addition of // the ability to pass a context and additional request options. // -// See GetEbsEncryptionByDefault for details on how to use this API operation. +// See EnableVolumeIO for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) GetEbsEncryptionByDefaultWithContext(ctx aws.Context, input *GetEbsEncryptionByDefaultInput, opts ...request.Option) (*GetEbsEncryptionByDefaultOutput, error) { - req, out := c.GetEbsEncryptionByDefaultRequest(input) +func (c *EC2) EnableVolumeIOWithContext(ctx aws.Context, input *EnableVolumeIOInput, opts ...request.Option) (*EnableVolumeIOOutput, error) { + req, out := c.EnableVolumeIORequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetHostReservationPurchasePreview = "GetHostReservationPurchasePreview" +const opEnableVpcClassicLink = "EnableVpcClassicLink" -// GetHostReservationPurchasePreviewRequest generates a "aws/request.Request" representing the -// client's request for the GetHostReservationPurchasePreview operation. The "output" return +// EnableVpcClassicLinkRequest generates a "aws/request.Request" representing the +// client's request for the EnableVpcClassicLink operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetHostReservationPurchasePreview for more information on using the GetHostReservationPurchasePreview +// See EnableVpcClassicLink for more information on using the EnableVpcClassicLink // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetHostReservationPurchasePreviewRequest method. -// req, resp := client.GetHostReservationPurchasePreviewRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetHostReservationPurchasePreview -func (c *EC2) GetHostReservationPurchasePreviewRequest(input *GetHostReservationPurchasePreviewInput) (req *request.Request, output *GetHostReservationPurchasePreviewOutput) { +// See also, 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: opGetHostReservationPurchasePreview, + Name: opEnableVpcClassicLink, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetHostReservationPurchasePreviewInput{} + input = &EnableVpcClassicLinkInput{} } - output = &GetHostReservationPurchasePreviewOutput{} + output = &EnableVpcClassicLinkOutput{} 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. +// EnableVpcClassicLink API operation for Amazon Elastic Compute Cloud. // -// This is a preview of the PurchaseHostReservation action and does not result -// in the offering being purchased. +// 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 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 (https://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 GetHostReservationPurchasePreview for usage and error information. -// See also, 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) +// API operation EnableVpcClassicLink for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLink +func (c *EC2) EnableVpcClassicLink(input *EnableVpcClassicLinkInput) (*EnableVpcClassicLinkOutput, error) { + req, out := c.EnableVpcClassicLinkRequest(input) return out, req.Send() } -// GetHostReservationPurchasePreviewWithContext is the same as GetHostReservationPurchasePreview with the addition of +// EnableVpcClassicLinkWithContext is the same as EnableVpcClassicLink with the addition of // the ability to pass a context and additional request options. // -// See GetHostReservationPurchasePreview for details on how to use this API operation. +// See EnableVpcClassicLink for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) GetHostReservationPurchasePreviewWithContext(ctx aws.Context, input *GetHostReservationPurchasePreviewInput, opts ...request.Option) (*GetHostReservationPurchasePreviewOutput, error) { - req, out := c.GetHostReservationPurchasePreviewRequest(input) +func (c *EC2) EnableVpcClassicLinkWithContext(ctx aws.Context, input *EnableVpcClassicLinkInput, opts ...request.Option) (*EnableVpcClassicLinkOutput, error) { + req, out := c.EnableVpcClassicLinkRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetLaunchTemplateData = "GetLaunchTemplateData" +const opEnableVpcClassicLinkDnsSupport = "EnableVpcClassicLinkDnsSupport" -// GetLaunchTemplateDataRequest generates a "aws/request.Request" representing the -// client's request for the GetLaunchTemplateData operation. The "output" return +// EnableVpcClassicLinkDnsSupportRequest generates a "aws/request.Request" representing the +// client's request for the EnableVpcClassicLinkDnsSupport operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetLaunchTemplateData for more information on using the GetLaunchTemplateData +// See EnableVpcClassicLinkDnsSupport for more information on using the EnableVpcClassicLinkDnsSupport // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetLaunchTemplateDataRequest method. -// req, resp := client.GetLaunchTemplateDataRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetLaunchTemplateData -func (c *EC2) GetLaunchTemplateDataRequest(input *GetLaunchTemplateDataInput) (req *request.Request, output *GetLaunchTemplateDataOutput) { +// See also, 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: opGetLaunchTemplateData, + Name: opEnableVpcClassicLinkDnsSupport, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetLaunchTemplateDataInput{} + input = &EnableVpcClassicLinkDnsSupportInput{} } - output = &GetLaunchTemplateDataOutput{} + output = &EnableVpcClassicLinkDnsSupportOutput{} req = c.newRequest(op, input, output) return } -// GetLaunchTemplateData API operation for Amazon Elastic Compute Cloud. +// EnableVpcClassicLinkDnsSupport API operation for Amazon Elastic Compute Cloud. // -// Retrieves the configuration data of the specified instance. You can use this -// data to create a launch template. +// 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, +// see ClassicLink (https://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 GetLaunchTemplateData for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetLaunchTemplateData -func (c *EC2) GetLaunchTemplateData(input *GetLaunchTemplateDataInput) (*GetLaunchTemplateDataOutput, error) { - req, out := c.GetLaunchTemplateDataRequest(input) +// API operation EnableVpcClassicLinkDnsSupport for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/EnableVpcClassicLinkDnsSupport +func (c *EC2) EnableVpcClassicLinkDnsSupport(input *EnableVpcClassicLinkDnsSupportInput) (*EnableVpcClassicLinkDnsSupportOutput, error) { + req, out := c.EnableVpcClassicLinkDnsSupportRequest(input) return out, req.Send() } -// GetLaunchTemplateDataWithContext is the same as GetLaunchTemplateData with the addition of +// EnableVpcClassicLinkDnsSupportWithContext is the same as EnableVpcClassicLinkDnsSupport with the addition of // the ability to pass a context and additional request options. // -// See GetLaunchTemplateData for details on how to use this API operation. +// See EnableVpcClassicLinkDnsSupport for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) GetLaunchTemplateDataWithContext(ctx aws.Context, input *GetLaunchTemplateDataInput, opts ...request.Option) (*GetLaunchTemplateDataOutput, error) { - req, out := c.GetLaunchTemplateDataRequest(input) +func (c *EC2) EnableVpcClassicLinkDnsSupportWithContext(ctx aws.Context, input *EnableVpcClassicLinkDnsSupportInput, opts ...request.Option) (*EnableVpcClassicLinkDnsSupportOutput, error) { + req, out := c.EnableVpcClassicLinkDnsSupportRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetPasswordData = "GetPasswordData" +const opExportClientVpnClientCertificateRevocationList = "ExportClientVpnClientCertificateRevocationList" -// GetPasswordDataRequest generates a "aws/request.Request" representing the -// client's request for the GetPasswordData operation. The "output" return +// ExportClientVpnClientCertificateRevocationListRequest generates a "aws/request.Request" representing the +// client's request for the ExportClientVpnClientCertificateRevocationList operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetPasswordData for more information on using the GetPasswordData +// See ExportClientVpnClientCertificateRevocationList for more information on using the ExportClientVpnClientCertificateRevocationList // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetPasswordDataRequest method. -// req, resp := client.GetPasswordDataRequest(params) +// // Example sending a request using the ExportClientVpnClientCertificateRevocationListRequest method. +// req, resp := client.ExportClientVpnClientCertificateRevocationListRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetPasswordData -func (c *EC2) GetPasswordDataRequest(input *GetPasswordDataInput) (req *request.Request, output *GetPasswordDataOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportClientVpnClientCertificateRevocationList +func (c *EC2) ExportClientVpnClientCertificateRevocationListRequest(input *ExportClientVpnClientCertificateRevocationListInput) (req *request.Request, output *ExportClientVpnClientCertificateRevocationListOutput) { op := &request.Operation{ - Name: opGetPasswordData, + Name: opExportClientVpnClientCertificateRevocationList, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetPasswordDataInput{} + input = &ExportClientVpnClientCertificateRevocationListInput{} } - output = &GetPasswordDataOutput{} + output = &ExportClientVpnClientCertificateRevocationListOutput{} req = c.newRequest(op, input, output) return } -// GetPasswordData API operation for Amazon Elastic Compute Cloud. -// -// Retrieves the encrypted administrator password for a running Windows instance. -// -// The Windows password is generated at boot by the EC2Config service or EC2Launch -// scripts (Windows Server 2016 and later). This usually only happens the first -// time an instance is launched. For more information, see EC2Config (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/UsingConfig_WinAMI.html) -// and EC2Launch (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2launch.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// For the EC2Config service, 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. +// ExportClientVpnClientCertificateRevocationList API operation for Amazon Elastic Compute Cloud. // -// When you launch an instance, password generation and encryption may take -// a few minutes. If you try to retrieve the password before it's available, -// the output returns an empty string. We recommend that you wait up to 15 minutes -// after launching an instance before trying to retrieve the generated password. +// Downloads the client certificate revocation list for the specified Client +// VPN 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 GetPasswordData for usage and error information. -// See also, 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) +// API operation ExportClientVpnClientCertificateRevocationList for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportClientVpnClientCertificateRevocationList +func (c *EC2) ExportClientVpnClientCertificateRevocationList(input *ExportClientVpnClientCertificateRevocationListInput) (*ExportClientVpnClientCertificateRevocationListOutput, error) { + req, out := c.ExportClientVpnClientCertificateRevocationListRequest(input) return out, req.Send() } -// GetPasswordDataWithContext is the same as GetPasswordData with the addition of +// ExportClientVpnClientCertificateRevocationListWithContext is the same as ExportClientVpnClientCertificateRevocationList with the addition of // the ability to pass a context and additional request options. // -// See GetPasswordData for details on how to use this API operation. +// See ExportClientVpnClientCertificateRevocationList for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) GetPasswordDataWithContext(ctx aws.Context, input *GetPasswordDataInput, opts ...request.Option) (*GetPasswordDataOutput, error) { - req, out := c.GetPasswordDataRequest(input) +func (c *EC2) ExportClientVpnClientCertificateRevocationListWithContext(ctx aws.Context, input *ExportClientVpnClientCertificateRevocationListInput, opts ...request.Option) (*ExportClientVpnClientCertificateRevocationListOutput, error) { + req, out := c.ExportClientVpnClientCertificateRevocationListRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetReservedInstancesExchangeQuote = "GetReservedInstancesExchangeQuote" +const opExportClientVpnClientConfiguration = "ExportClientVpnClientConfiguration" -// GetReservedInstancesExchangeQuoteRequest generates a "aws/request.Request" representing the -// client's request for the GetReservedInstancesExchangeQuote operation. The "output" return +// ExportClientVpnClientConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the ExportClientVpnClientConfiguration operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetReservedInstancesExchangeQuote for more information on using the GetReservedInstancesExchangeQuote +// See ExportClientVpnClientConfiguration for more information on using the ExportClientVpnClientConfiguration // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetReservedInstancesExchangeQuoteRequest method. -// req, resp := client.GetReservedInstancesExchangeQuoteRequest(params) +// // Example sending a request using the ExportClientVpnClientConfigurationRequest method. +// req, resp := client.ExportClientVpnClientConfigurationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetReservedInstancesExchangeQuote -func (c *EC2) GetReservedInstancesExchangeQuoteRequest(input *GetReservedInstancesExchangeQuoteInput) (req *request.Request, output *GetReservedInstancesExchangeQuoteOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportClientVpnClientConfiguration +func (c *EC2) ExportClientVpnClientConfigurationRequest(input *ExportClientVpnClientConfigurationInput) (req *request.Request, output *ExportClientVpnClientConfigurationOutput) { op := &request.Operation{ - Name: opGetReservedInstancesExchangeQuote, + Name: opExportClientVpnClientConfiguration, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetReservedInstancesExchangeQuoteInput{} + input = &ExportClientVpnClientConfigurationInput{} } - output = &GetReservedInstancesExchangeQuoteOutput{} + output = &ExportClientVpnClientConfigurationOutput{} req = c.newRequest(op, input, output) return } -// GetReservedInstancesExchangeQuote API operation for Amazon Elastic Compute Cloud. +// ExportClientVpnClientConfiguration API operation for Amazon Elastic Compute Cloud. // -// Returns a quote and exchange information for exchanging one or more specified -// Convertible Reserved Instances for a new Convertible Reserved Instance. If -// the exchange cannot be performed, the reason is returned in the response. -// Use AcceptReservedInstancesExchangeQuote to perform the exchange. +// Downloads the contents of the Client VPN endpoint configuration file for +// the specified Client VPN endpoint. The Client VPN endpoint configuration +// file includes the Client VPN endpoint and certificate information clients +// need to establish a connection with the Client VPN 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 GetReservedInstancesExchangeQuote for usage and error information. -// See also, 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) +// API operation ExportClientVpnClientConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportClientVpnClientConfiguration +func (c *EC2) ExportClientVpnClientConfiguration(input *ExportClientVpnClientConfigurationInput) (*ExportClientVpnClientConfigurationOutput, error) { + req, out := c.ExportClientVpnClientConfigurationRequest(input) return out, req.Send() } -// GetReservedInstancesExchangeQuoteWithContext is the same as GetReservedInstancesExchangeQuote with the addition of +// ExportClientVpnClientConfigurationWithContext is the same as ExportClientVpnClientConfiguration with the addition of // the ability to pass a context and additional request options. // -// See GetReservedInstancesExchangeQuote for details on how to use this API operation. +// See ExportClientVpnClientConfiguration for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) GetReservedInstancesExchangeQuoteWithContext(ctx aws.Context, input *GetReservedInstancesExchangeQuoteInput, opts ...request.Option) (*GetReservedInstancesExchangeQuoteOutput, error) { - req, out := c.GetReservedInstancesExchangeQuoteRequest(input) +func (c *EC2) ExportClientVpnClientConfigurationWithContext(ctx aws.Context, input *ExportClientVpnClientConfigurationInput, opts ...request.Option) (*ExportClientVpnClientConfigurationOutput, error) { + req, out := c.ExportClientVpnClientConfigurationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetTransitGatewayAttachmentPropagations = "GetTransitGatewayAttachmentPropagations" +const opExportImage = "ExportImage" -// GetTransitGatewayAttachmentPropagationsRequest generates a "aws/request.Request" representing the -// client's request for the GetTransitGatewayAttachmentPropagations operation. The "output" return +// ExportImageRequest generates a "aws/request.Request" representing the +// client's request for the ExportImage operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetTransitGatewayAttachmentPropagations for more information on using the GetTransitGatewayAttachmentPropagations +// See ExportImage for more information on using the ExportImage // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetTransitGatewayAttachmentPropagationsRequest method. -// req, resp := client.GetTransitGatewayAttachmentPropagationsRequest(params) +// // Example sending a request using the ExportImageRequest method. +// req, resp := client.ExportImageRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayAttachmentPropagations -func (c *EC2) GetTransitGatewayAttachmentPropagationsRequest(input *GetTransitGatewayAttachmentPropagationsInput) (req *request.Request, output *GetTransitGatewayAttachmentPropagationsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportImage +func (c *EC2) ExportImageRequest(input *ExportImageInput) (req *request.Request, output *ExportImageOutput) { op := &request.Operation{ - Name: opGetTransitGatewayAttachmentPropagations, + Name: opExportImage, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &GetTransitGatewayAttachmentPropagationsInput{} + input = &ExportImageInput{} } - output = &GetTransitGatewayAttachmentPropagationsOutput{} + output = &ExportImageOutput{} req = c.newRequest(op, input, output) return } -// GetTransitGatewayAttachmentPropagations API operation for Amazon Elastic Compute Cloud. +// ExportImage API operation for Amazon Elastic Compute Cloud. // -// Lists the route tables to which the specified resource attachment propagates -// routes. +// Exports an Amazon Machine Image (AMI) to a VM file. For more information, +// see Exporting a VM Directory from an Amazon Machine Image (AMI) (https://docs.aws.amazon.com/vm-import/latest/userguide/vmexport_image.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 GetTransitGatewayAttachmentPropagations for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayAttachmentPropagations -func (c *EC2) GetTransitGatewayAttachmentPropagations(input *GetTransitGatewayAttachmentPropagationsInput) (*GetTransitGatewayAttachmentPropagationsOutput, error) { - req, out := c.GetTransitGatewayAttachmentPropagationsRequest(input) +// API operation ExportImage for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportImage +func (c *EC2) ExportImage(input *ExportImageInput) (*ExportImageOutput, error) { + req, out := c.ExportImageRequest(input) return out, req.Send() } -// GetTransitGatewayAttachmentPropagationsWithContext is the same as GetTransitGatewayAttachmentPropagations with the addition of +// ExportImageWithContext is the same as ExportImage with the addition of // the ability to pass a context and additional request options. // -// See GetTransitGatewayAttachmentPropagations for details on how to use this API operation. +// See ExportImage for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) GetTransitGatewayAttachmentPropagationsWithContext(ctx aws.Context, input *GetTransitGatewayAttachmentPropagationsInput, opts ...request.Option) (*GetTransitGatewayAttachmentPropagationsOutput, error) { - req, out := c.GetTransitGatewayAttachmentPropagationsRequest(input) +func (c *EC2) ExportImageWithContext(ctx aws.Context, input *ExportImageInput, opts ...request.Option) (*ExportImageOutput, error) { + req, out := c.ExportImageRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// GetTransitGatewayAttachmentPropagationsPages iterates over the pages of a GetTransitGatewayAttachmentPropagations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetTransitGatewayAttachmentPropagations 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 GetTransitGatewayAttachmentPropagations operation. -// pageNum := 0 -// err := client.GetTransitGatewayAttachmentPropagationsPages(params, -// func(page *ec2.GetTransitGatewayAttachmentPropagationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) GetTransitGatewayAttachmentPropagationsPages(input *GetTransitGatewayAttachmentPropagationsInput, fn func(*GetTransitGatewayAttachmentPropagationsOutput, bool) bool) error { - return c.GetTransitGatewayAttachmentPropagationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetTransitGatewayAttachmentPropagationsPagesWithContext same as GetTransitGatewayAttachmentPropagationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) GetTransitGatewayAttachmentPropagationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayAttachmentPropagationsInput, fn func(*GetTransitGatewayAttachmentPropagationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetTransitGatewayAttachmentPropagationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetTransitGatewayAttachmentPropagationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTransitGatewayAttachmentPropagationsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opGetTransitGatewayRouteTableAssociations = "GetTransitGatewayRouteTableAssociations" +const opExportTransitGatewayRoutes = "ExportTransitGatewayRoutes" -// GetTransitGatewayRouteTableAssociationsRequest generates a "aws/request.Request" representing the -// client's request for the GetTransitGatewayRouteTableAssociations operation. The "output" return +// ExportTransitGatewayRoutesRequest generates a "aws/request.Request" representing the +// client's request for the ExportTransitGatewayRoutes operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetTransitGatewayRouteTableAssociations for more information on using the GetTransitGatewayRouteTableAssociations +// See ExportTransitGatewayRoutes for more information on using the ExportTransitGatewayRoutes // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetTransitGatewayRouteTableAssociationsRequest method. -// req, resp := client.GetTransitGatewayRouteTableAssociationsRequest(params) +// // Example sending a request using the ExportTransitGatewayRoutesRequest method. +// req, resp := client.ExportTransitGatewayRoutesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayRouteTableAssociations -func (c *EC2) GetTransitGatewayRouteTableAssociationsRequest(input *GetTransitGatewayRouteTableAssociationsInput) (req *request.Request, output *GetTransitGatewayRouteTableAssociationsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportTransitGatewayRoutes +func (c *EC2) ExportTransitGatewayRoutesRequest(input *ExportTransitGatewayRoutesInput) (req *request.Request, output *ExportTransitGatewayRoutesOutput) { op := &request.Operation{ - Name: opGetTransitGatewayRouteTableAssociations, + Name: opExportTransitGatewayRoutes, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &GetTransitGatewayRouteTableAssociationsInput{} + input = &ExportTransitGatewayRoutesInput{} } - output = &GetTransitGatewayRouteTableAssociationsOutput{} + output = &ExportTransitGatewayRoutesOutput{} req = c.newRequest(op, input, output) return } -// GetTransitGatewayRouteTableAssociations API operation for Amazon Elastic Compute Cloud. +// ExportTransitGatewayRoutes API operation for Amazon Elastic Compute Cloud. // -// Gets information about the associations for the specified transit gateway -// route table. +// Exports routes from the specified transit gateway route table to the specified +// S3 bucket. By default, all routes are exported. Alternatively, you can filter +// by CIDR range. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation GetTransitGatewayRouteTableAssociations for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayRouteTableAssociations -func (c *EC2) GetTransitGatewayRouteTableAssociations(input *GetTransitGatewayRouteTableAssociationsInput) (*GetTransitGatewayRouteTableAssociationsOutput, error) { - req, out := c.GetTransitGatewayRouteTableAssociationsRequest(input) +// API operation ExportTransitGatewayRoutes for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ExportTransitGatewayRoutes +func (c *EC2) ExportTransitGatewayRoutes(input *ExportTransitGatewayRoutesInput) (*ExportTransitGatewayRoutesOutput, error) { + req, out := c.ExportTransitGatewayRoutesRequest(input) return out, req.Send() } -// GetTransitGatewayRouteTableAssociationsWithContext is the same as GetTransitGatewayRouteTableAssociations with the addition of +// ExportTransitGatewayRoutesWithContext is the same as ExportTransitGatewayRoutes with the addition of // the ability to pass a context and additional request options. // -// See GetTransitGatewayRouteTableAssociations for details on how to use this API operation. +// See ExportTransitGatewayRoutes for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) GetTransitGatewayRouteTableAssociationsWithContext(ctx aws.Context, input *GetTransitGatewayRouteTableAssociationsInput, opts ...request.Option) (*GetTransitGatewayRouteTableAssociationsOutput, error) { - req, out := c.GetTransitGatewayRouteTableAssociationsRequest(input) +func (c *EC2) ExportTransitGatewayRoutesWithContext(ctx aws.Context, input *ExportTransitGatewayRoutesInput, opts ...request.Option) (*ExportTransitGatewayRoutesOutput, error) { + req, out := c.ExportTransitGatewayRoutesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// GetTransitGatewayRouteTableAssociationsPages iterates over the pages of a GetTransitGatewayRouteTableAssociations operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetTransitGatewayRouteTableAssociations 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 GetTransitGatewayRouteTableAssociations operation. -// pageNum := 0 -// err := client.GetTransitGatewayRouteTableAssociationsPages(params, -// func(page *ec2.GetTransitGatewayRouteTableAssociationsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EC2) GetTransitGatewayRouteTableAssociationsPages(input *GetTransitGatewayRouteTableAssociationsInput, fn func(*GetTransitGatewayRouteTableAssociationsOutput, bool) bool) error { - return c.GetTransitGatewayRouteTableAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetTransitGatewayRouteTableAssociationsPagesWithContext same as GetTransitGatewayRouteTableAssociationsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) GetTransitGatewayRouteTableAssociationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayRouteTableAssociationsInput, fn func(*GetTransitGatewayRouteTableAssociationsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetTransitGatewayRouteTableAssociationsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetTransitGatewayRouteTableAssociationsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTransitGatewayRouteTableAssociationsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opGetTransitGatewayRouteTablePropagations = "GetTransitGatewayRouteTablePropagations" +const opGetAssociatedIpv6PoolCidrs = "GetAssociatedIpv6PoolCidrs" -// GetTransitGatewayRouteTablePropagationsRequest generates a "aws/request.Request" representing the -// client's request for the GetTransitGatewayRouteTablePropagations operation. The "output" return +// GetAssociatedIpv6PoolCidrsRequest generates a "aws/request.Request" representing the +// client's request for the GetAssociatedIpv6PoolCidrs operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetTransitGatewayRouteTablePropagations for more information on using the GetTransitGatewayRouteTablePropagations +// See GetAssociatedIpv6PoolCidrs for more information on using the GetAssociatedIpv6PoolCidrs // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetTransitGatewayRouteTablePropagationsRequest method. -// req, resp := client.GetTransitGatewayRouteTablePropagationsRequest(params) +// // Example sending a request using the GetAssociatedIpv6PoolCidrsRequest method. +// req, resp := client.GetAssociatedIpv6PoolCidrsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayRouteTablePropagations -func (c *EC2) GetTransitGatewayRouteTablePropagationsRequest(input *GetTransitGatewayRouteTablePropagationsInput) (req *request.Request, output *GetTransitGatewayRouteTablePropagationsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetAssociatedIpv6PoolCidrs +func (c *EC2) GetAssociatedIpv6PoolCidrsRequest(input *GetAssociatedIpv6PoolCidrsInput) (req *request.Request, output *GetAssociatedIpv6PoolCidrsOutput) { op := &request.Operation{ - Name: opGetTransitGatewayRouteTablePropagations, + Name: opGetAssociatedIpv6PoolCidrs, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -25253,5446 +27422,5549 @@ func (c *EC2) GetTransitGatewayRouteTablePropagationsRequest(input *GetTransitGa } if input == nil { - input = &GetTransitGatewayRouteTablePropagationsInput{} + input = &GetAssociatedIpv6PoolCidrsInput{} } - output = &GetTransitGatewayRouteTablePropagationsOutput{} + output = &GetAssociatedIpv6PoolCidrsOutput{} req = c.newRequest(op, input, output) return } -// GetTransitGatewayRouteTablePropagations API operation for Amazon Elastic Compute Cloud. +// GetAssociatedIpv6PoolCidrs API operation for Amazon Elastic Compute Cloud. // -// Gets information about the route table propagations for the specified transit -// gateway route table. +// Gets information about the IPv6 CIDR block associations for a specified IPv6 +// address pool. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation GetTransitGatewayRouteTablePropagations for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayRouteTablePropagations -func (c *EC2) GetTransitGatewayRouteTablePropagations(input *GetTransitGatewayRouteTablePropagationsInput) (*GetTransitGatewayRouteTablePropagationsOutput, error) { - req, out := c.GetTransitGatewayRouteTablePropagationsRequest(input) +// API operation GetAssociatedIpv6PoolCidrs for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetAssociatedIpv6PoolCidrs +func (c *EC2) GetAssociatedIpv6PoolCidrs(input *GetAssociatedIpv6PoolCidrsInput) (*GetAssociatedIpv6PoolCidrsOutput, error) { + req, out := c.GetAssociatedIpv6PoolCidrsRequest(input) return out, req.Send() } -// GetTransitGatewayRouteTablePropagationsWithContext is the same as GetTransitGatewayRouteTablePropagations with the addition of +// GetAssociatedIpv6PoolCidrsWithContext is the same as GetAssociatedIpv6PoolCidrs with the addition of // the ability to pass a context and additional request options. // -// See GetTransitGatewayRouteTablePropagations for details on how to use this API operation. +// See GetAssociatedIpv6PoolCidrs for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) GetTransitGatewayRouteTablePropagationsWithContext(ctx aws.Context, input *GetTransitGatewayRouteTablePropagationsInput, opts ...request.Option) (*GetTransitGatewayRouteTablePropagationsOutput, error) { - req, out := c.GetTransitGatewayRouteTablePropagationsRequest(input) +func (c *EC2) GetAssociatedIpv6PoolCidrsWithContext(ctx aws.Context, input *GetAssociatedIpv6PoolCidrsInput, opts ...request.Option) (*GetAssociatedIpv6PoolCidrsOutput, error) { + req, out := c.GetAssociatedIpv6PoolCidrsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// GetTransitGatewayRouteTablePropagationsPages iterates over the pages of a GetTransitGatewayRouteTablePropagations operation, +// GetAssociatedIpv6PoolCidrsPages iterates over the pages of a GetAssociatedIpv6PoolCidrs operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See GetTransitGatewayRouteTablePropagations method for more information on how to use this operation. +// See GetAssociatedIpv6PoolCidrs 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 GetTransitGatewayRouteTablePropagations operation. +// // Example iterating over at most 3 pages of a GetAssociatedIpv6PoolCidrs operation. // pageNum := 0 -// err := client.GetTransitGatewayRouteTablePropagationsPages(params, -// func(page *ec2.GetTransitGatewayRouteTablePropagationsOutput, lastPage bool) bool { +// err := client.GetAssociatedIpv6PoolCidrsPages(params, +// func(page *ec2.GetAssociatedIpv6PoolCidrsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *EC2) GetTransitGatewayRouteTablePropagationsPages(input *GetTransitGatewayRouteTablePropagationsInput, fn func(*GetTransitGatewayRouteTablePropagationsOutput, bool) bool) error { - return c.GetTransitGatewayRouteTablePropagationsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *EC2) GetAssociatedIpv6PoolCidrsPages(input *GetAssociatedIpv6PoolCidrsInput, fn func(*GetAssociatedIpv6PoolCidrsOutput, bool) bool) error { + return c.GetAssociatedIpv6PoolCidrsPagesWithContext(aws.BackgroundContext(), input, fn) } -// GetTransitGatewayRouteTablePropagationsPagesWithContext same as GetTransitGatewayRouteTablePropagationsPages except +// GetAssociatedIpv6PoolCidrsPagesWithContext same as GetAssociatedIpv6PoolCidrsPages except // it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) GetTransitGatewayRouteTablePropagationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayRouteTablePropagationsInput, fn func(*GetTransitGatewayRouteTablePropagationsOutput, bool) bool, opts ...request.Option) error { +func (c *EC2) GetAssociatedIpv6PoolCidrsPagesWithContext(ctx aws.Context, input *GetAssociatedIpv6PoolCidrsInput, fn func(*GetAssociatedIpv6PoolCidrsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *GetTransitGatewayRouteTablePropagationsInput + var inCpy *GetAssociatedIpv6PoolCidrsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.GetTransitGatewayRouteTablePropagationsRequest(inCpy) + req, _ := c.GetAssociatedIpv6PoolCidrsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTransitGatewayRouteTablePropagationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetAssociatedIpv6PoolCidrsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opImportClientVpnClientCertificateRevocationList = "ImportClientVpnClientCertificateRevocationList" +const opGetCapacityReservationUsage = "GetCapacityReservationUsage" -// ImportClientVpnClientCertificateRevocationListRequest generates a "aws/request.Request" representing the -// client's request for the ImportClientVpnClientCertificateRevocationList operation. The "output" return +// GetCapacityReservationUsageRequest generates a "aws/request.Request" representing the +// client's request for the GetCapacityReservationUsage operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ImportClientVpnClientCertificateRevocationList for more information on using the ImportClientVpnClientCertificateRevocationList +// See GetCapacityReservationUsage for more information on using the GetCapacityReservationUsage // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ImportClientVpnClientCertificateRevocationListRequest method. -// req, resp := client.ImportClientVpnClientCertificateRevocationListRequest(params) +// // Example sending a request using the GetCapacityReservationUsageRequest method. +// req, resp := client.GetCapacityReservationUsageRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportClientVpnClientCertificateRevocationList -func (c *EC2) ImportClientVpnClientCertificateRevocationListRequest(input *ImportClientVpnClientCertificateRevocationListInput) (req *request.Request, output *ImportClientVpnClientCertificateRevocationListOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetCapacityReservationUsage +func (c *EC2) GetCapacityReservationUsageRequest(input *GetCapacityReservationUsageInput) (req *request.Request, output *GetCapacityReservationUsageOutput) { op := &request.Operation{ - Name: opImportClientVpnClientCertificateRevocationList, + Name: opGetCapacityReservationUsage, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ImportClientVpnClientCertificateRevocationListInput{} + input = &GetCapacityReservationUsageInput{} } - output = &ImportClientVpnClientCertificateRevocationListOutput{} + output = &GetCapacityReservationUsageOutput{} req = c.newRequest(op, input, output) return } -// ImportClientVpnClientCertificateRevocationList API operation for Amazon Elastic Compute Cloud. -// -// Uploads a client certificate revocation list to the specified Client VPN -// endpoint. Uploading a client certificate revocation list overwrites the existing -// client certificate revocation list. +// GetCapacityReservationUsage API operation for Amazon Elastic Compute Cloud. // -// Uploading a client certificate revocation list resets existing client connections. +// Gets usage information about a Capacity Reservation. If the Capacity Reservation +// is shared, it shows usage information for the Capacity Reservation owner +// and each AWS account that is currently using the shared capacity. If the +// Capacity Reservation is not shared, it shows only the Capacity Reservation +// owner's usage. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ImportClientVpnClientCertificateRevocationList for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportClientVpnClientCertificateRevocationList -func (c *EC2) ImportClientVpnClientCertificateRevocationList(input *ImportClientVpnClientCertificateRevocationListInput) (*ImportClientVpnClientCertificateRevocationListOutput, error) { - req, out := c.ImportClientVpnClientCertificateRevocationListRequest(input) +// API operation GetCapacityReservationUsage for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetCapacityReservationUsage +func (c *EC2) GetCapacityReservationUsage(input *GetCapacityReservationUsageInput) (*GetCapacityReservationUsageOutput, error) { + req, out := c.GetCapacityReservationUsageRequest(input) return out, req.Send() } -// ImportClientVpnClientCertificateRevocationListWithContext is the same as ImportClientVpnClientCertificateRevocationList with the addition of +// GetCapacityReservationUsageWithContext is the same as GetCapacityReservationUsage with the addition of // the ability to pass a context and additional request options. // -// See ImportClientVpnClientCertificateRevocationList for details on how to use this API operation. +// See GetCapacityReservationUsage for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ImportClientVpnClientCertificateRevocationListWithContext(ctx aws.Context, input *ImportClientVpnClientCertificateRevocationListInput, opts ...request.Option) (*ImportClientVpnClientCertificateRevocationListOutput, error) { - req, out := c.ImportClientVpnClientCertificateRevocationListRequest(input) +func (c *EC2) GetCapacityReservationUsageWithContext(ctx aws.Context, input *GetCapacityReservationUsageInput, opts ...request.Option) (*GetCapacityReservationUsageOutput, error) { + req, out := c.GetCapacityReservationUsageRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opImportImage = "ImportImage" +const opGetCoipPoolUsage = "GetCoipPoolUsage" -// ImportImageRequest generates a "aws/request.Request" representing the -// client's request for the ImportImage operation. The "output" return +// GetCoipPoolUsageRequest generates a "aws/request.Request" representing the +// client's request for the GetCoipPoolUsage operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ImportImage for more information on using the ImportImage +// See GetCoipPoolUsage for more information on using the GetCoipPoolUsage // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ImportImageRequest method. -// req, resp := client.ImportImageRequest(params) +// // Example sending a request using the GetCoipPoolUsageRequest method. +// req, resp := client.GetCoipPoolUsageRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportImage -func (c *EC2) ImportImageRequest(input *ImportImageInput) (req *request.Request, output *ImportImageOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetCoipPoolUsage +func (c *EC2) GetCoipPoolUsageRequest(input *GetCoipPoolUsageInput) (req *request.Request, output *GetCoipPoolUsageOutput) { op := &request.Operation{ - Name: opImportImage, + Name: opGetCoipPoolUsage, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ImportImageInput{} + input = &GetCoipPoolUsageInput{} } - output = &ImportImageOutput{} + output = &GetCoipPoolUsageOutput{} req = c.newRequest(op, input, output) return } -// ImportImage API operation for Amazon Elastic Compute Cloud. +// GetCoipPoolUsage 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 (https://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html) -// in the VM Import/Export User Guide. +// Describes the allocations from the specified customer-owned address pool. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation GetCoipPoolUsage for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetCoipPoolUsage +func (c *EC2) GetCoipPoolUsage(input *GetCoipPoolUsageInput) (*GetCoipPoolUsageOutput, error) { + req, out := c.GetCoipPoolUsageRequest(input) return out, req.Send() } -// ImportImageWithContext is the same as ImportImage with the addition of +// GetCoipPoolUsageWithContext is the same as GetCoipPoolUsage with the addition of // the ability to pass a context and additional request options. // -// See ImportImage for details on how to use this API operation. +// See GetCoipPoolUsage for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ImportImageWithContext(ctx aws.Context, input *ImportImageInput, opts ...request.Option) (*ImportImageOutput, error) { - req, out := c.ImportImageRequest(input) +func (c *EC2) GetCoipPoolUsageWithContext(ctx aws.Context, input *GetCoipPoolUsageInput, opts ...request.Option) (*GetCoipPoolUsageOutput, error) { + req, out := c.GetCoipPoolUsageRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opImportInstance = "ImportInstance" +const opGetConsoleOutput = "GetConsoleOutput" -// ImportInstanceRequest generates a "aws/request.Request" representing the -// client's request for the ImportInstance operation. The "output" return +// GetConsoleOutputRequest generates a "aws/request.Request" representing the +// client's request for the GetConsoleOutput operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ImportInstance for more information on using the ImportInstance +// See GetConsoleOutput for more information on using the GetConsoleOutput // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ImportInstanceRequest method. -// req, resp := client.ImportInstanceRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportInstance -func (c *EC2) ImportInstanceRequest(input *ImportInstanceInput) (req *request.Request, output *ImportInstanceOutput) { +// See also, 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: opImportInstance, + Name: opGetConsoleOutput, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ImportInstanceInput{} + input = &GetConsoleOutputInput{} } - output = &ImportInstanceOutput{} + output = &GetConsoleOutputOutput{} req = c.newRequest(op, input, output) return } -// ImportInstance API operation for Amazon Elastic Compute Cloud. +// GetConsoleOutput 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 (https://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/ec2-cli-vmimport-export.html). +// Gets the console output for the specified instance. 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. For Windows +// instances, the instance console output includes the last three system event +// log errors. // -// For information about the import manifest referenced by this API action, -// see VM Import Manifest (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html). +// By default, the console output returns buffered information that was posted +// shortly after an instance transition state (start, stop, reboot, or terminate). +// This information is available for at least one hour after the most recent +// post. Only the most recent 64 KB of console output is available. +// +// You can optionally retrieve the latest serial console output at any time +// during the instance lifecycle. This option is supported on instance types +// that use the Nitro hypervisor. +// +// For more information, see Instance Console Output (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html#instance-console-console-output) +// 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 ImportInstance for usage and error information. -// See also, 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) +// API operation GetConsoleOutput for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleOutput +func (c *EC2) GetConsoleOutput(input *GetConsoleOutputInput) (*GetConsoleOutputOutput, error) { + req, out := c.GetConsoleOutputRequest(input) return out, req.Send() } -// ImportInstanceWithContext is the same as ImportInstance with the addition of +// GetConsoleOutputWithContext is the same as GetConsoleOutput with the addition of // the ability to pass a context and additional request options. // -// See ImportInstance for details on how to use this API operation. +// See GetConsoleOutput for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ImportInstanceWithContext(ctx aws.Context, input *ImportInstanceInput, opts ...request.Option) (*ImportInstanceOutput, error) { - req, out := c.ImportInstanceRequest(input) +func (c *EC2) GetConsoleOutputWithContext(ctx aws.Context, input *GetConsoleOutputInput, opts ...request.Option) (*GetConsoleOutputOutput, error) { + req, out := c.GetConsoleOutputRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opImportKeyPair = "ImportKeyPair" +const opGetConsoleScreenshot = "GetConsoleScreenshot" -// ImportKeyPairRequest generates a "aws/request.Request" representing the -// client's request for the ImportKeyPair operation. The "output" return +// GetConsoleScreenshotRequest generates a "aws/request.Request" representing the +// client's request for the GetConsoleScreenshot operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ImportKeyPair for more information on using the ImportKeyPair +// See GetConsoleScreenshot for more information on using the GetConsoleScreenshot // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ImportKeyPairRequest method. -// req, resp := client.ImportKeyPairRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportKeyPair -func (c *EC2) ImportKeyPairRequest(input *ImportKeyPairInput) (req *request.Request, output *ImportKeyPairOutput) { +// See also, 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: opImportKeyPair, + Name: opGetConsoleScreenshot, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ImportKeyPairInput{} + input = &GetConsoleScreenshotInput{} } - output = &ImportKeyPairOutput{} + output = &GetConsoleScreenshotOutput{} req = c.newRequest(op, input, output) return } -// ImportKeyPair API operation for Amazon Elastic Compute Cloud. +// GetConsoleScreenshot 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. +// Retrieve a JPG-format screenshot of a running instance to help with troubleshooting. // -// For more information about key pairs, see Key Pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) -// in the Amazon Elastic Compute Cloud User Guide. +// 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 ImportKeyPair for usage and error information. -// See also, 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) +// API operation GetConsoleScreenshot for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetConsoleScreenshot +func (c *EC2) GetConsoleScreenshot(input *GetConsoleScreenshotInput) (*GetConsoleScreenshotOutput, error) { + req, out := c.GetConsoleScreenshotRequest(input) return out, req.Send() } -// ImportKeyPairWithContext is the same as ImportKeyPair with the addition of +// GetConsoleScreenshotWithContext is the same as GetConsoleScreenshot with the addition of // the ability to pass a context and additional request options. // -// See ImportKeyPair for details on how to use this API operation. +// See GetConsoleScreenshot for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ImportKeyPairWithContext(ctx aws.Context, input *ImportKeyPairInput, opts ...request.Option) (*ImportKeyPairOutput, error) { - req, out := c.ImportKeyPairRequest(input) +func (c *EC2) GetConsoleScreenshotWithContext(ctx aws.Context, input *GetConsoleScreenshotInput, opts ...request.Option) (*GetConsoleScreenshotOutput, error) { + req, out := c.GetConsoleScreenshotRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opImportSnapshot = "ImportSnapshot" +const opGetDefaultCreditSpecification = "GetDefaultCreditSpecification" -// ImportSnapshotRequest generates a "aws/request.Request" representing the -// client's request for the ImportSnapshot operation. The "output" return +// GetDefaultCreditSpecificationRequest generates a "aws/request.Request" representing the +// client's request for the GetDefaultCreditSpecification operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ImportSnapshot for more information on using the ImportSnapshot +// See GetDefaultCreditSpecification for more information on using the GetDefaultCreditSpecification // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ImportSnapshotRequest method. -// req, resp := client.ImportSnapshotRequest(params) +// // Example sending a request using the GetDefaultCreditSpecificationRequest method. +// req, resp := client.GetDefaultCreditSpecificationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportSnapshot -func (c *EC2) ImportSnapshotRequest(input *ImportSnapshotInput) (req *request.Request, output *ImportSnapshotOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetDefaultCreditSpecification +func (c *EC2) GetDefaultCreditSpecificationRequest(input *GetDefaultCreditSpecificationInput) (req *request.Request, output *GetDefaultCreditSpecificationOutput) { op := &request.Operation{ - Name: opImportSnapshot, + Name: opGetDefaultCreditSpecification, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ImportSnapshotInput{} + input = &GetDefaultCreditSpecificationInput{} } - output = &ImportSnapshotOutput{} + output = &GetDefaultCreditSpecificationOutput{} req = c.newRequest(op, input, output) return } -// ImportSnapshot API operation for Amazon Elastic Compute Cloud. +// GetDefaultCreditSpecification API operation for Amazon Elastic Compute Cloud. // -// Imports a disk into an EBS snapshot. +// Describes the default credit option for CPU usage of a burstable performance +// instance family. +// +// For more information, see Burstable Performance Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-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 ImportSnapshot for usage and error information. -// See also, 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) +// API operation GetDefaultCreditSpecification for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetDefaultCreditSpecification +func (c *EC2) GetDefaultCreditSpecification(input *GetDefaultCreditSpecificationInput) (*GetDefaultCreditSpecificationOutput, error) { + req, out := c.GetDefaultCreditSpecificationRequest(input) return out, req.Send() } -// ImportSnapshotWithContext is the same as ImportSnapshot with the addition of +// GetDefaultCreditSpecificationWithContext is the same as GetDefaultCreditSpecification with the addition of // the ability to pass a context and additional request options. // -// See ImportSnapshot for details on how to use this API operation. +// See GetDefaultCreditSpecification for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ImportSnapshotWithContext(ctx aws.Context, input *ImportSnapshotInput, opts ...request.Option) (*ImportSnapshotOutput, error) { - req, out := c.ImportSnapshotRequest(input) +func (c *EC2) GetDefaultCreditSpecificationWithContext(ctx aws.Context, input *GetDefaultCreditSpecificationInput, opts ...request.Option) (*GetDefaultCreditSpecificationOutput, error) { + req, out := c.GetDefaultCreditSpecificationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opImportVolume = "ImportVolume" +const opGetEbsDefaultKmsKeyId = "GetEbsDefaultKmsKeyId" -// ImportVolumeRequest generates a "aws/request.Request" representing the -// client's request for the ImportVolume operation. The "output" return +// GetEbsDefaultKmsKeyIdRequest generates a "aws/request.Request" representing the +// client's request for the GetEbsDefaultKmsKeyId operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ImportVolume for more information on using the ImportVolume +// See GetEbsDefaultKmsKeyId for more information on using the GetEbsDefaultKmsKeyId // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ImportVolumeRequest method. -// req, resp := client.ImportVolumeRequest(params) +// // Example sending a request using the GetEbsDefaultKmsKeyIdRequest method. +// req, resp := client.GetEbsDefaultKmsKeyIdRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportVolume -func (c *EC2) ImportVolumeRequest(input *ImportVolumeInput) (req *request.Request, output *ImportVolumeOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetEbsDefaultKmsKeyId +func (c *EC2) GetEbsDefaultKmsKeyIdRequest(input *GetEbsDefaultKmsKeyIdInput) (req *request.Request, output *GetEbsDefaultKmsKeyIdOutput) { op := &request.Operation{ - Name: opImportVolume, + Name: opGetEbsDefaultKmsKeyId, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ImportVolumeInput{} + input = &GetEbsDefaultKmsKeyIdInput{} } - output = &ImportVolumeOutput{} + output = &GetEbsDefaultKmsKeyIdOutput{} req = c.newRequest(op, input, output) return } -// ImportVolume API operation for Amazon Elastic Compute Cloud. +// GetEbsDefaultKmsKeyId 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 (https://docs.aws.amazon.com/AWSEC2/latest/CommandLineReference/importing-your-volumes-into-amazon-ebs.html). +// Describes the default customer master key (CMK) for EBS encryption by default +// for your account in this Region. You can change the default CMK for encryption +// by default using ModifyEbsDefaultKmsKeyId or ResetEbsDefaultKmsKeyId. // -// For information about the import manifest referenced by this API action, -// see VM Import Manifest (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/manifest.html). +// For more information, see Amazon EBS Encryption (https://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 ImportVolume for usage and error information. -// See also, 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) +// API operation GetEbsDefaultKmsKeyId for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetEbsDefaultKmsKeyId +func (c *EC2) GetEbsDefaultKmsKeyId(input *GetEbsDefaultKmsKeyIdInput) (*GetEbsDefaultKmsKeyIdOutput, error) { + req, out := c.GetEbsDefaultKmsKeyIdRequest(input) return out, req.Send() } -// ImportVolumeWithContext is the same as ImportVolume with the addition of +// GetEbsDefaultKmsKeyIdWithContext is the same as GetEbsDefaultKmsKeyId with the addition of // the ability to pass a context and additional request options. // -// See ImportVolume for details on how to use this API operation. +// See GetEbsDefaultKmsKeyId for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ImportVolumeWithContext(ctx aws.Context, input *ImportVolumeInput, opts ...request.Option) (*ImportVolumeOutput, error) { - req, out := c.ImportVolumeRequest(input) +func (c *EC2) GetEbsDefaultKmsKeyIdWithContext(ctx aws.Context, input *GetEbsDefaultKmsKeyIdInput, opts ...request.Option) (*GetEbsDefaultKmsKeyIdOutput, error) { + req, out := c.GetEbsDefaultKmsKeyIdRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyCapacityReservation = "ModifyCapacityReservation" +const opGetEbsEncryptionByDefault = "GetEbsEncryptionByDefault" -// ModifyCapacityReservationRequest generates a "aws/request.Request" representing the -// client's request for the ModifyCapacityReservation operation. The "output" return +// GetEbsEncryptionByDefaultRequest generates a "aws/request.Request" representing the +// client's request for the GetEbsEncryptionByDefault operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyCapacityReservation for more information on using the ModifyCapacityReservation +// See GetEbsEncryptionByDefault for more information on using the GetEbsEncryptionByDefault // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyCapacityReservationRequest method. -// req, resp := client.ModifyCapacityReservationRequest(params) +// // Example sending a request using the GetEbsEncryptionByDefaultRequest method. +// req, resp := client.GetEbsEncryptionByDefaultRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyCapacityReservation -func (c *EC2) ModifyCapacityReservationRequest(input *ModifyCapacityReservationInput) (req *request.Request, output *ModifyCapacityReservationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetEbsEncryptionByDefault +func (c *EC2) GetEbsEncryptionByDefaultRequest(input *GetEbsEncryptionByDefaultInput) (req *request.Request, output *GetEbsEncryptionByDefaultOutput) { op := &request.Operation{ - Name: opModifyCapacityReservation, + Name: opGetEbsEncryptionByDefault, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyCapacityReservationInput{} + input = &GetEbsEncryptionByDefaultInput{} } - output = &ModifyCapacityReservationOutput{} + output = &GetEbsEncryptionByDefaultOutput{} req = c.newRequest(op, input, output) return } -// ModifyCapacityReservation API operation for Amazon Elastic Compute Cloud. +// GetEbsEncryptionByDefault API operation for Amazon Elastic Compute Cloud. // -// Modifies a Capacity Reservation's capacity and the conditions under which -// it is to be released. You cannot change a Capacity Reservation's instance -// type, EBS optimization, instance store settings, platform, Availability Zone, -// or instance eligibility. If you need to modify any of these attributes, we -// recommend that you cancel the Capacity Reservation, and then create a new -// one with the required attributes. +// Describes whether EBS encryption by default is enabled for your account in +// the current Region. +// +// For more information, see Amazon EBS Encryption (https://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 ModifyCapacityReservation for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyCapacityReservation -func (c *EC2) ModifyCapacityReservation(input *ModifyCapacityReservationInput) (*ModifyCapacityReservationOutput, error) { - req, out := c.ModifyCapacityReservationRequest(input) +// API operation GetEbsEncryptionByDefault for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetEbsEncryptionByDefault +func (c *EC2) GetEbsEncryptionByDefault(input *GetEbsEncryptionByDefaultInput) (*GetEbsEncryptionByDefaultOutput, error) { + req, out := c.GetEbsEncryptionByDefaultRequest(input) return out, req.Send() } -// ModifyCapacityReservationWithContext is the same as ModifyCapacityReservation with the addition of +// GetEbsEncryptionByDefaultWithContext is the same as GetEbsEncryptionByDefault with the addition of // the ability to pass a context and additional request options. // -// See ModifyCapacityReservation for details on how to use this API operation. +// See GetEbsEncryptionByDefault for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyCapacityReservationWithContext(ctx aws.Context, input *ModifyCapacityReservationInput, opts ...request.Option) (*ModifyCapacityReservationOutput, error) { - req, out := c.ModifyCapacityReservationRequest(input) +func (c *EC2) GetEbsEncryptionByDefaultWithContext(ctx aws.Context, input *GetEbsEncryptionByDefaultInput, opts ...request.Option) (*GetEbsEncryptionByDefaultOutput, error) { + req, out := c.GetEbsEncryptionByDefaultRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyClientVpnEndpoint = "ModifyClientVpnEndpoint" +const opGetHostReservationPurchasePreview = "GetHostReservationPurchasePreview" -// ModifyClientVpnEndpointRequest generates a "aws/request.Request" representing the -// client's request for the ModifyClientVpnEndpoint operation. The "output" return +// GetHostReservationPurchasePreviewRequest generates a "aws/request.Request" representing the +// client's request for the GetHostReservationPurchasePreview operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyClientVpnEndpoint for more information on using the ModifyClientVpnEndpoint +// See GetHostReservationPurchasePreview for more information on using the GetHostReservationPurchasePreview // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyClientVpnEndpointRequest method. -// req, resp := client.ModifyClientVpnEndpointRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyClientVpnEndpoint -func (c *EC2) ModifyClientVpnEndpointRequest(input *ModifyClientVpnEndpointInput) (req *request.Request, output *ModifyClientVpnEndpointOutput) { +// See also, 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: opModifyClientVpnEndpoint, + Name: opGetHostReservationPurchasePreview, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyClientVpnEndpointInput{} + input = &GetHostReservationPurchasePreviewInput{} } - output = &ModifyClientVpnEndpointOutput{} + output = &GetHostReservationPurchasePreviewOutput{} req = c.newRequest(op, input, output) return } -// ModifyClientVpnEndpoint API operation for Amazon Elastic Compute Cloud. +// GetHostReservationPurchasePreview API operation for Amazon Elastic Compute Cloud. // -// Modifies the specified Client VPN endpoint. You can only modify an endpoint's -// server certificate information, client connection logging information, DNS -// server, and description. Modifying the DNS server resets existing client -// connections. +// 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 ModifyClientVpnEndpoint for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyClientVpnEndpoint -func (c *EC2) ModifyClientVpnEndpoint(input *ModifyClientVpnEndpointInput) (*ModifyClientVpnEndpointOutput, error) { - req, out := c.ModifyClientVpnEndpointRequest(input) +// API operation GetHostReservationPurchasePreview for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetHostReservationPurchasePreview +func (c *EC2) GetHostReservationPurchasePreview(input *GetHostReservationPurchasePreviewInput) (*GetHostReservationPurchasePreviewOutput, error) { + req, out := c.GetHostReservationPurchasePreviewRequest(input) return out, req.Send() } -// ModifyClientVpnEndpointWithContext is the same as ModifyClientVpnEndpoint with the addition of +// GetHostReservationPurchasePreviewWithContext is the same as GetHostReservationPurchasePreview with the addition of // the ability to pass a context and additional request options. // -// See ModifyClientVpnEndpoint for details on how to use this API operation. +// See GetHostReservationPurchasePreview for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyClientVpnEndpointWithContext(ctx aws.Context, input *ModifyClientVpnEndpointInput, opts ...request.Option) (*ModifyClientVpnEndpointOutput, error) { - req, out := c.ModifyClientVpnEndpointRequest(input) +func (c *EC2) GetHostReservationPurchasePreviewWithContext(ctx aws.Context, input *GetHostReservationPurchasePreviewInput, opts ...request.Option) (*GetHostReservationPurchasePreviewOutput, error) { + req, out := c.GetHostReservationPurchasePreviewRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyEbsDefaultKmsKeyId = "ModifyEbsDefaultKmsKeyId" +const opGetLaunchTemplateData = "GetLaunchTemplateData" -// ModifyEbsDefaultKmsKeyIdRequest generates a "aws/request.Request" representing the -// client's request for the ModifyEbsDefaultKmsKeyId operation. The "output" return +// GetLaunchTemplateDataRequest generates a "aws/request.Request" representing the +// client's request for the GetLaunchTemplateData operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyEbsDefaultKmsKeyId for more information on using the ModifyEbsDefaultKmsKeyId +// See GetLaunchTemplateData for more information on using the GetLaunchTemplateData // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyEbsDefaultKmsKeyIdRequest method. -// req, resp := client.ModifyEbsDefaultKmsKeyIdRequest(params) +// // Example sending a request using the GetLaunchTemplateDataRequest method. +// req, resp := client.GetLaunchTemplateDataRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyEbsDefaultKmsKeyId -func (c *EC2) ModifyEbsDefaultKmsKeyIdRequest(input *ModifyEbsDefaultKmsKeyIdInput) (req *request.Request, output *ModifyEbsDefaultKmsKeyIdOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetLaunchTemplateData +func (c *EC2) GetLaunchTemplateDataRequest(input *GetLaunchTemplateDataInput) (req *request.Request, output *GetLaunchTemplateDataOutput) { op := &request.Operation{ - Name: opModifyEbsDefaultKmsKeyId, + Name: opGetLaunchTemplateData, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyEbsDefaultKmsKeyIdInput{} + input = &GetLaunchTemplateDataInput{} } - output = &ModifyEbsDefaultKmsKeyIdOutput{} + output = &GetLaunchTemplateDataOutput{} req = c.newRequest(op, input, output) return } -// ModifyEbsDefaultKmsKeyId API operation for Amazon Elastic Compute Cloud. -// -// Changes the default customer master key (CMK) for EBS encryption by default -// for your account in this Region. -// -// AWS creates a unique AWS managed CMK in each Region for use with encryption -// by default. If you change the default CMK to a customer managed CMK, it is -// used instead of the AWS managed CMK. To reset the default CMK to the AWS -// managed CMK for EBS, use ResetEbsDefaultKmsKeyId. -// -// If you delete or disable the customer managed CMK that you specified for -// use with encryption by default, your instances will fail to launch. +// GetLaunchTemplateData API operation for Amazon Elastic Compute Cloud. // -// For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Retrieves the configuration data of the specified instance. You can use this +// data to create a launch 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 Elastic Compute Cloud's -// API operation ModifyEbsDefaultKmsKeyId for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyEbsDefaultKmsKeyId -func (c *EC2) ModifyEbsDefaultKmsKeyId(input *ModifyEbsDefaultKmsKeyIdInput) (*ModifyEbsDefaultKmsKeyIdOutput, error) { - req, out := c.ModifyEbsDefaultKmsKeyIdRequest(input) +// API operation GetLaunchTemplateData for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetLaunchTemplateData +func (c *EC2) GetLaunchTemplateData(input *GetLaunchTemplateDataInput) (*GetLaunchTemplateDataOutput, error) { + req, out := c.GetLaunchTemplateDataRequest(input) return out, req.Send() } -// ModifyEbsDefaultKmsKeyIdWithContext is the same as ModifyEbsDefaultKmsKeyId with the addition of +// GetLaunchTemplateDataWithContext is the same as GetLaunchTemplateData with the addition of // the ability to pass a context and additional request options. // -// See ModifyEbsDefaultKmsKeyId for details on how to use this API operation. +// See GetLaunchTemplateData for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyEbsDefaultKmsKeyIdWithContext(ctx aws.Context, input *ModifyEbsDefaultKmsKeyIdInput, opts ...request.Option) (*ModifyEbsDefaultKmsKeyIdOutput, error) { - req, out := c.ModifyEbsDefaultKmsKeyIdRequest(input) +func (c *EC2) GetLaunchTemplateDataWithContext(ctx aws.Context, input *GetLaunchTemplateDataInput, opts ...request.Option) (*GetLaunchTemplateDataOutput, error) { + req, out := c.GetLaunchTemplateDataRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyFleet = "ModifyFleet" +const opGetPasswordData = "GetPasswordData" -// ModifyFleetRequest generates a "aws/request.Request" representing the -// client's request for the ModifyFleet operation. The "output" return +// GetPasswordDataRequest generates a "aws/request.Request" representing the +// client's request for the GetPasswordData operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyFleet for more information on using the ModifyFleet +// See GetPasswordData for more information on using the GetPasswordData // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyFleetRequest method. -// req, resp := client.ModifyFleetRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyFleet -func (c *EC2) ModifyFleetRequest(input *ModifyFleetInput) (req *request.Request, output *ModifyFleetOutput) { +// See also, 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: opModifyFleet, + Name: opGetPasswordData, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyFleetInput{} + input = &GetPasswordDataInput{} } - output = &ModifyFleetOutput{} + output = &GetPasswordDataOutput{} req = c.newRequest(op, input, output) return } -// ModifyFleet API operation for Amazon Elastic Compute Cloud. -// -// Modifies the specified EC2 Fleet. +// GetPasswordData API operation for Amazon Elastic Compute Cloud. // -// You can only modify an EC2 Fleet request of type maintain. +// Retrieves the encrypted administrator password for a running Windows instance. // -// While the EC2 Fleet is being modified, it is in the modifying state. +// The Windows password is generated at boot by the EC2Config service or EC2Launch +// scripts (Windows Server 2016 and later). This usually only happens the first +// time an instance is launched. For more information, see EC2Config (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/UsingConfig_WinAMI.html) +// and EC2Launch (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ec2launch.html) +// in the Amazon Elastic Compute Cloud User Guide. // -// To scale up your EC2 Fleet, increase its target capacity. The EC2 Fleet launches -// the additional Spot Instances according to the allocation strategy for the -// EC2 Fleet request. If the allocation strategy is lowestPrice, the EC2 Fleet -// launches instances using the Spot Instance pool with the lowest price. If -// the allocation strategy is diversified, the EC2 Fleet distributes the instances -// across the Spot Instance pools. If the allocation strategy is capacityOptimized, -// EC2 Fleet launches instances from Spot Instance pools with optimal capacity -// for the number of instances that are launching. +// For the EC2Config service, the password is not generated for rebundled AMIs +// unless Ec2SetPassword is enabled before bundling. // -// To scale down your EC2 Fleet, decrease its target capacity. First, the EC2 -// Fleet cancels any open requests that exceed the new target capacity. You -// can request that the EC2 Fleet terminate Spot Instances until the size of -// the fleet no longer exceeds the new target capacity. If the allocation strategy -// is lowestPrice, the EC2 Fleet terminates the instances with the highest price -// per unit. If the allocation strategy is capacityOptimized, the EC2 Fleet -// terminates the instances in the Spot Instance pools that have the least available -// Spot Instance capacity. If the allocation strategy is diversified, the EC2 -// Fleet terminates instances across the Spot Instance pools. Alternatively, -// you can request that the EC2 Fleet keep the fleet at its current size, but -// not replace any Spot Instances that are interrupted or that you terminate -// manually. +// The password is encrypted using the key pair that you specified when you +// launched the instance. You must provide the corresponding key pair file. // -// If you are finished with your EC2 Fleet for now, but will use it again later, -// you can set the target capacity to 0. +// When you launch an instance, password generation and encryption may take +// a few minutes. If you try to retrieve the password before it's available, +// the output returns an empty string. 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 ModifyFleet for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyFleet -func (c *EC2) ModifyFleet(input *ModifyFleetInput) (*ModifyFleetOutput, error) { - req, out := c.ModifyFleetRequest(input) +// API operation GetPasswordData for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetPasswordData +func (c *EC2) GetPasswordData(input *GetPasswordDataInput) (*GetPasswordDataOutput, error) { + req, out := c.GetPasswordDataRequest(input) return out, req.Send() } -// ModifyFleetWithContext is the same as ModifyFleet with the addition of +// GetPasswordDataWithContext is the same as GetPasswordData with the addition of // the ability to pass a context and additional request options. // -// See ModifyFleet for details on how to use this API operation. +// See GetPasswordData for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyFleetWithContext(ctx aws.Context, input *ModifyFleetInput, opts ...request.Option) (*ModifyFleetOutput, error) { - req, out := c.ModifyFleetRequest(input) +func (c *EC2) GetPasswordDataWithContext(ctx aws.Context, input *GetPasswordDataInput, opts ...request.Option) (*GetPasswordDataOutput, error) { + req, out := c.GetPasswordDataRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyFpgaImageAttribute = "ModifyFpgaImageAttribute" +const opGetReservedInstancesExchangeQuote = "GetReservedInstancesExchangeQuote" -// ModifyFpgaImageAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyFpgaImageAttribute operation. The "output" return +// GetReservedInstancesExchangeQuoteRequest generates a "aws/request.Request" representing the +// client's request for the GetReservedInstancesExchangeQuote operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyFpgaImageAttribute for more information on using the ModifyFpgaImageAttribute +// See GetReservedInstancesExchangeQuote for more information on using the GetReservedInstancesExchangeQuote // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyFpgaImageAttributeRequest method. -// req, resp := client.ModifyFpgaImageAttributeRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyFpgaImageAttribute -func (c *EC2) ModifyFpgaImageAttributeRequest(input *ModifyFpgaImageAttributeInput) (req *request.Request, output *ModifyFpgaImageAttributeOutput) { +// See also, 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: opModifyFpgaImageAttribute, + Name: opGetReservedInstancesExchangeQuote, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyFpgaImageAttributeInput{} + input = &GetReservedInstancesExchangeQuoteInput{} } - output = &ModifyFpgaImageAttributeOutput{} + output = &GetReservedInstancesExchangeQuoteOutput{} req = c.newRequest(op, input, output) return } -// ModifyFpgaImageAttribute API operation for Amazon Elastic Compute Cloud. +// GetReservedInstancesExchangeQuote API operation for Amazon Elastic Compute Cloud. // -// Modifies the specified attribute of the specified Amazon FPGA Image (AFI). +// Returns a quote and exchange information for exchanging one or more specified +// Convertible Reserved Instances for a new Convertible Reserved Instance. If +// the exchange cannot be performed, the reason is returned in the response. +// Use AcceptReservedInstancesExchangeQuote to perform the exchange. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyFpgaImageAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyFpgaImageAttribute -func (c *EC2) ModifyFpgaImageAttribute(input *ModifyFpgaImageAttributeInput) (*ModifyFpgaImageAttributeOutput, error) { - req, out := c.ModifyFpgaImageAttributeRequest(input) +// API operation GetReservedInstancesExchangeQuote for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetReservedInstancesExchangeQuote +func (c *EC2) GetReservedInstancesExchangeQuote(input *GetReservedInstancesExchangeQuoteInput) (*GetReservedInstancesExchangeQuoteOutput, error) { + req, out := c.GetReservedInstancesExchangeQuoteRequest(input) return out, req.Send() } -// ModifyFpgaImageAttributeWithContext is the same as ModifyFpgaImageAttribute with the addition of +// GetReservedInstancesExchangeQuoteWithContext is the same as GetReservedInstancesExchangeQuote with the addition of // the ability to pass a context and additional request options. // -// See ModifyFpgaImageAttribute for details on how to use this API operation. +// See GetReservedInstancesExchangeQuote for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyFpgaImageAttributeWithContext(ctx aws.Context, input *ModifyFpgaImageAttributeInput, opts ...request.Option) (*ModifyFpgaImageAttributeOutput, error) { - req, out := c.ModifyFpgaImageAttributeRequest(input) +func (c *EC2) GetReservedInstancesExchangeQuoteWithContext(ctx aws.Context, input *GetReservedInstancesExchangeQuoteInput, opts ...request.Option) (*GetReservedInstancesExchangeQuoteOutput, error) { + req, out := c.GetReservedInstancesExchangeQuoteRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyHosts = "ModifyHosts" +const opGetTransitGatewayAttachmentPropagations = "GetTransitGatewayAttachmentPropagations" -// ModifyHostsRequest generates a "aws/request.Request" representing the -// client's request for the ModifyHosts operation. The "output" return +// GetTransitGatewayAttachmentPropagationsRequest generates a "aws/request.Request" representing the +// client's request for the GetTransitGatewayAttachmentPropagations operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyHosts for more information on using the ModifyHosts +// See GetTransitGatewayAttachmentPropagations for more information on using the GetTransitGatewayAttachmentPropagations // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyHostsRequest method. -// req, resp := client.ModifyHostsRequest(params) +// // Example sending a request using the GetTransitGatewayAttachmentPropagationsRequest method. +// req, resp := client.GetTransitGatewayAttachmentPropagationsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyHosts -func (c *EC2) ModifyHostsRequest(input *ModifyHostsInput) (req *request.Request, output *ModifyHostsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayAttachmentPropagations +func (c *EC2) GetTransitGatewayAttachmentPropagationsRequest(input *GetTransitGatewayAttachmentPropagationsInput) (req *request.Request, output *GetTransitGatewayAttachmentPropagationsOutput) { op := &request.Operation{ - Name: opModifyHosts, + Name: opGetTransitGatewayAttachmentPropagations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &ModifyHostsInput{} + input = &GetTransitGatewayAttachmentPropagationsInput{} } - output = &ModifyHostsOutput{} + output = &GetTransitGatewayAttachmentPropagationsOutput{} req = c.newRequest(op, input, output) return } -// ModifyHosts API operation for Amazon Elastic Compute Cloud. +// GetTransitGatewayAttachmentPropagations API operation for Amazon Elastic Compute Cloud. // -// Modify the auto-placement setting of a Dedicated Host. When auto-placement -// is enabled, any instances that you launch with a tenancy of host but without -// a specific host ID are placed onto any available Dedicated Host in your account -// that has auto-placement enabled. When auto-placement is disabled, you need -// to provide a host ID to have the instance launch onto a specific host. If -// no host ID is provided, the instance is launched onto a suitable host with -// auto-placement enabled. +// Lists the route tables to which the specified resource attachment propagates +// routes. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation GetTransitGatewayAttachmentPropagations for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayAttachmentPropagations +func (c *EC2) GetTransitGatewayAttachmentPropagations(input *GetTransitGatewayAttachmentPropagationsInput) (*GetTransitGatewayAttachmentPropagationsOutput, error) { + req, out := c.GetTransitGatewayAttachmentPropagationsRequest(input) return out, req.Send() } -// ModifyHostsWithContext is the same as ModifyHosts with the addition of +// GetTransitGatewayAttachmentPropagationsWithContext is the same as GetTransitGatewayAttachmentPropagations with the addition of // the ability to pass a context and additional request options. // -// See ModifyHosts for details on how to use this API operation. +// See GetTransitGatewayAttachmentPropagations for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyHostsWithContext(ctx aws.Context, input *ModifyHostsInput, opts ...request.Option) (*ModifyHostsOutput, error) { - req, out := c.ModifyHostsRequest(input) +func (c *EC2) GetTransitGatewayAttachmentPropagationsWithContext(ctx aws.Context, input *GetTransitGatewayAttachmentPropagationsInput, opts ...request.Option) (*GetTransitGatewayAttachmentPropagationsOutput, error) { + req, out := c.GetTransitGatewayAttachmentPropagationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyIdFormat = "ModifyIdFormat" +// GetTransitGatewayAttachmentPropagationsPages iterates over the pages of a GetTransitGatewayAttachmentPropagations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetTransitGatewayAttachmentPropagations 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 GetTransitGatewayAttachmentPropagations operation. +// pageNum := 0 +// err := client.GetTransitGatewayAttachmentPropagationsPages(params, +// func(page *ec2.GetTransitGatewayAttachmentPropagationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) GetTransitGatewayAttachmentPropagationsPages(input *GetTransitGatewayAttachmentPropagationsInput, fn func(*GetTransitGatewayAttachmentPropagationsOutput, bool) bool) error { + return c.GetTransitGatewayAttachmentPropagationsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// ModifyIdFormatRequest generates a "aws/request.Request" representing the -// client's request for the ModifyIdFormat operation. The "output" return +// GetTransitGatewayAttachmentPropagationsPagesWithContext same as GetTransitGatewayAttachmentPropagationsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetTransitGatewayAttachmentPropagationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayAttachmentPropagationsInput, fn func(*GetTransitGatewayAttachmentPropagationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetTransitGatewayAttachmentPropagationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetTransitGatewayAttachmentPropagationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*GetTransitGatewayAttachmentPropagationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opGetTransitGatewayMulticastDomainAssociations = "GetTransitGatewayMulticastDomainAssociations" + +// GetTransitGatewayMulticastDomainAssociationsRequest generates a "aws/request.Request" representing the +// client's request for the GetTransitGatewayMulticastDomainAssociations operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyIdFormat for more information on using the ModifyIdFormat +// See GetTransitGatewayMulticastDomainAssociations for more information on using the GetTransitGatewayMulticastDomainAssociations // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyIdFormatRequest method. -// req, resp := client.ModifyIdFormatRequest(params) +// // Example sending a request using the GetTransitGatewayMulticastDomainAssociationsRequest method. +// req, resp := client.GetTransitGatewayMulticastDomainAssociationsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdFormat -func (c *EC2) ModifyIdFormatRequest(input *ModifyIdFormatInput) (req *request.Request, output *ModifyIdFormatOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayMulticastDomainAssociations +func (c *EC2) GetTransitGatewayMulticastDomainAssociationsRequest(input *GetTransitGatewayMulticastDomainAssociationsInput) (req *request.Request, output *GetTransitGatewayMulticastDomainAssociationsOutput) { op := &request.Operation{ - Name: opModifyIdFormat, + Name: opGetTransitGatewayMulticastDomainAssociations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &ModifyIdFormatInput{} + input = &GetTransitGatewayMulticastDomainAssociationsInput{} } - output = &ModifyIdFormatOutput{} + output = &GetTransitGatewayMulticastDomainAssociationsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, 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. -// -// This request can only be used to modify longer ID settings for resource types -// that are within the opt-in period. Resources currently in their opt-in period -// include: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation -// | elastic-ip-association | export-task | flow-log | image | import-task | -// internet-gateway | network-acl | network-acl-association | network-interface -// | network-interface-attachment | prefix-list | route-table | route-table-association -// | security-group | subnet | subnet-cidr-block-association | vpc | vpc-cidr-block-association -// | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway. -// -// 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 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html) -// in the Amazon Elastic Compute Cloud User Guide. +// GetTransitGatewayMulticastDomainAssociations API operation for Amazon Elastic Compute Cloud. // -// 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. +// Gets information about the associations for the transit gateway multicast +// 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 Elastic Compute Cloud's -// API operation ModifyIdFormat for usage and error information. -// See also, 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) +// API operation GetTransitGatewayMulticastDomainAssociations for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayMulticastDomainAssociations +func (c *EC2) GetTransitGatewayMulticastDomainAssociations(input *GetTransitGatewayMulticastDomainAssociationsInput) (*GetTransitGatewayMulticastDomainAssociationsOutput, error) { + req, out := c.GetTransitGatewayMulticastDomainAssociationsRequest(input) return out, req.Send() } -// ModifyIdFormatWithContext is the same as ModifyIdFormat with the addition of +// GetTransitGatewayMulticastDomainAssociationsWithContext is the same as GetTransitGatewayMulticastDomainAssociations with the addition of // the ability to pass a context and additional request options. // -// See ModifyIdFormat for details on how to use this API operation. +// See GetTransitGatewayMulticastDomainAssociations for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyIdFormatWithContext(ctx aws.Context, input *ModifyIdFormatInput, opts ...request.Option) (*ModifyIdFormatOutput, error) { - req, out := c.ModifyIdFormatRequest(input) +func (c *EC2) GetTransitGatewayMulticastDomainAssociationsWithContext(ctx aws.Context, input *GetTransitGatewayMulticastDomainAssociationsInput, opts ...request.Option) (*GetTransitGatewayMulticastDomainAssociationsOutput, error) { + req, out := c.GetTransitGatewayMulticastDomainAssociationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyIdentityIdFormat = "ModifyIdentityIdFormat" +// GetTransitGatewayMulticastDomainAssociationsPages iterates over the pages of a GetTransitGatewayMulticastDomainAssociations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetTransitGatewayMulticastDomainAssociations 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 GetTransitGatewayMulticastDomainAssociations operation. +// pageNum := 0 +// err := client.GetTransitGatewayMulticastDomainAssociationsPages(params, +// func(page *ec2.GetTransitGatewayMulticastDomainAssociationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) GetTransitGatewayMulticastDomainAssociationsPages(input *GetTransitGatewayMulticastDomainAssociationsInput, fn func(*GetTransitGatewayMulticastDomainAssociationsOutput, bool) bool) error { + return c.GetTransitGatewayMulticastDomainAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// ModifyIdentityIdFormatRequest generates a "aws/request.Request" representing the -// client's request for the ModifyIdentityIdFormat operation. The "output" return +// GetTransitGatewayMulticastDomainAssociationsPagesWithContext same as GetTransitGatewayMulticastDomainAssociationsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetTransitGatewayMulticastDomainAssociationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayMulticastDomainAssociationsInput, fn func(*GetTransitGatewayMulticastDomainAssociationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetTransitGatewayMulticastDomainAssociationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetTransitGatewayMulticastDomainAssociationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*GetTransitGatewayMulticastDomainAssociationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opGetTransitGatewayRouteTableAssociations = "GetTransitGatewayRouteTableAssociations" + +// GetTransitGatewayRouteTableAssociationsRequest generates a "aws/request.Request" representing the +// client's request for the GetTransitGatewayRouteTableAssociations operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyIdentityIdFormat for more information on using the ModifyIdentityIdFormat +// See GetTransitGatewayRouteTableAssociations for more information on using the GetTransitGatewayRouteTableAssociations // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyIdentityIdFormatRequest method. -// req, resp := client.ModifyIdentityIdFormatRequest(params) +// // Example sending a request using the GetTransitGatewayRouteTableAssociationsRequest method. +// req, resp := client.GetTransitGatewayRouteTableAssociationsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdentityIdFormat -func (c *EC2) ModifyIdentityIdFormatRequest(input *ModifyIdentityIdFormatInput) (req *request.Request, output *ModifyIdentityIdFormatOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayRouteTableAssociations +func (c *EC2) GetTransitGatewayRouteTableAssociationsRequest(input *GetTransitGatewayRouteTableAssociationsInput) (req *request.Request, output *GetTransitGatewayRouteTableAssociationsOutput) { op := &request.Operation{ - Name: opModifyIdentityIdFormat, + Name: opGetTransitGatewayRouteTableAssociations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &ModifyIdentityIdFormatInput{} + input = &GetTransitGatewayRouteTableAssociationsInput{} } - output = &ModifyIdentityIdFormatOutput{} + output = &GetTransitGatewayRouteTableAssociationsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, 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. -// -// This request can only be used to modify longer ID settings for resource types -// that are within the opt-in period. Resources currently in their opt-in period -// include: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation -// | elastic-ip-association | export-task | flow-log | image | import-task | -// internet-gateway | network-acl | network-acl-association | network-interface -// | network-interface-attachment | prefix-list | route-table | route-table-association -// | security-group | subnet | subnet-cidr-block-association | vpc | vpc-cidr-block-association -// | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway. -// -// For more information, see Resource IDs (https://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. +// GetTransitGatewayRouteTableAssociations API operation for Amazon Elastic Compute Cloud. // -// 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. +// Gets information about the associations for the specified transit gateway +// 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 ModifyIdentityIdFormat for usage and error information. -// See also, 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) +// API operation GetTransitGatewayRouteTableAssociations for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayRouteTableAssociations +func (c *EC2) GetTransitGatewayRouteTableAssociations(input *GetTransitGatewayRouteTableAssociationsInput) (*GetTransitGatewayRouteTableAssociationsOutput, error) { + req, out := c.GetTransitGatewayRouteTableAssociationsRequest(input) return out, req.Send() } -// ModifyIdentityIdFormatWithContext is the same as ModifyIdentityIdFormat with the addition of +// GetTransitGatewayRouteTableAssociationsWithContext is the same as GetTransitGatewayRouteTableAssociations with the addition of // the ability to pass a context and additional request options. // -// See ModifyIdentityIdFormat for details on how to use this API operation. +// See GetTransitGatewayRouteTableAssociations for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyIdentityIdFormatWithContext(ctx aws.Context, input *ModifyIdentityIdFormatInput, opts ...request.Option) (*ModifyIdentityIdFormatOutput, error) { - req, out := c.ModifyIdentityIdFormatRequest(input) +func (c *EC2) GetTransitGatewayRouteTableAssociationsWithContext(ctx aws.Context, input *GetTransitGatewayRouteTableAssociationsInput, opts ...request.Option) (*GetTransitGatewayRouteTableAssociationsOutput, error) { + req, out := c.GetTransitGatewayRouteTableAssociationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyImageAttribute = "ModifyImageAttribute" - -// ModifyImageAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyImageAttribute operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. +// GetTransitGatewayRouteTableAssociationsPages iterates over the pages of a GetTransitGatewayRouteTableAssociations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. // -// See ModifyImageAttribute for more information on using the ModifyImageAttribute -// API call, and error handling. +// See GetTransitGatewayRouteTableAssociations method for more information on how to use this operation. // -// 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: This operation can generate multiple requests to a service. // +// // Example iterating over at most 3 pages of a GetTransitGatewayRouteTableAssociations operation. +// pageNum := 0 +// err := client.GetTransitGatewayRouteTableAssociationsPages(params, +// func(page *ec2.GetTransitGatewayRouteTableAssociationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) // -// // 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) -// } -// -// See also, 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.Swap(ec2query.UnmarshalHandler.Name, 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. You can use the Attribute parameter to specify the -// attribute or one of the following parameters: Description, LaunchPermission, -// or ProductCode. -// -// AWS Marketplace product codes cannot be modified. Images with an AWS Marketplace -// product code cannot be made public. -// -// To enable the SriovNetSupport enhanced networking attribute of an image, -// enable SriovNetSupport on an instance and create an AMI from 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 Elastic Compute Cloud's -// API operation ModifyImageAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyImageAttribute -func (c *EC2) ModifyImageAttribute(input *ModifyImageAttributeInput) (*ModifyImageAttributeOutput, error) { - req, out := c.ModifyImageAttributeRequest(input) - return out, req.Send() -} - -// ModifyImageAttributeWithContext is the same as ModifyImageAttribute with the addition of -// the ability to pass a context and additional request options. -// -// See ModifyImageAttribute for details on how to use this API operation. +func (c *EC2) GetTransitGatewayRouteTableAssociationsPages(input *GetTransitGatewayRouteTableAssociationsInput, fn func(*GetTransitGatewayRouteTableAssociationsOutput, bool) bool) error { + return c.GetTransitGatewayRouteTableAssociationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetTransitGatewayRouteTableAssociationsPagesWithContext same as GetTransitGatewayRouteTableAssociationsPages except +// it takes a Context and allows setting request options on the pages. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyImageAttributeWithContext(ctx aws.Context, input *ModifyImageAttributeInput, opts ...request.Option) (*ModifyImageAttributeOutput, error) { - req, out := c.ModifyImageAttributeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() +func (c *EC2) GetTransitGatewayRouteTableAssociationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayRouteTableAssociationsInput, fn func(*GetTransitGatewayRouteTableAssociationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetTransitGatewayRouteTableAssociationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetTransitGatewayRouteTableAssociationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*GetTransitGatewayRouteTableAssociationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() } -const opModifyInstanceAttribute = "ModifyInstanceAttribute" +const opGetTransitGatewayRouteTablePropagations = "GetTransitGatewayRouteTablePropagations" -// ModifyInstanceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyInstanceAttribute operation. The "output" return +// GetTransitGatewayRouteTablePropagationsRequest generates a "aws/request.Request" representing the +// client's request for the GetTransitGatewayRouteTablePropagations operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyInstanceAttribute for more information on using the ModifyInstanceAttribute +// See GetTransitGatewayRouteTablePropagations for more information on using the GetTransitGatewayRouteTablePropagations // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyInstanceAttributeRequest method. -// req, resp := client.ModifyInstanceAttributeRequest(params) +// // Example sending a request using the GetTransitGatewayRouteTablePropagationsRequest method. +// req, resp := client.GetTransitGatewayRouteTablePropagationsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceAttribute -func (c *EC2) ModifyInstanceAttributeRequest(input *ModifyInstanceAttributeInput) (req *request.Request, output *ModifyInstanceAttributeOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayRouteTablePropagations +func (c *EC2) GetTransitGatewayRouteTablePropagationsRequest(input *GetTransitGatewayRouteTablePropagationsInput) (req *request.Request, output *GetTransitGatewayRouteTablePropagationsOutput) { op := &request.Operation{ - Name: opModifyInstanceAttribute, + Name: opGetTransitGatewayRouteTablePropagations, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &ModifyInstanceAttributeInput{} + input = &GetTransitGatewayRouteTablePropagationsInput{} } - output = &ModifyInstanceAttributeOutput{} + output = &GetTransitGatewayRouteTablePropagationsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, 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. -// -// Note: Using this action to change the security groups associated with an -// elastic network interface (ENI) attached to an instance in a VPC can result -// in an error if the instance has more than one ENI. To change the security -// groups associated with an ENI attached to an instance that has multiple ENIs, -// we recommend that you use the ModifyNetworkInterfaceAttribute action. +// GetTransitGatewayRouteTablePropagations API operation for Amazon Elastic Compute Cloud. // -// To modify some attributes, the instance must be stopped. For more information, -// see Modifying Attributes of a Stopped Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_ChangingAttributesWhileInstanceStopped.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Gets information about the route table propagations for the specified transit +// gateway 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 ModifyInstanceAttribute for usage and error information. -// See also, 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) +// API operation GetTransitGatewayRouteTablePropagations for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/GetTransitGatewayRouteTablePropagations +func (c *EC2) GetTransitGatewayRouteTablePropagations(input *GetTransitGatewayRouteTablePropagationsInput) (*GetTransitGatewayRouteTablePropagationsOutput, error) { + req, out := c.GetTransitGatewayRouteTablePropagationsRequest(input) return out, req.Send() } -// ModifyInstanceAttributeWithContext is the same as ModifyInstanceAttribute with the addition of +// GetTransitGatewayRouteTablePropagationsWithContext is the same as GetTransitGatewayRouteTablePropagations with the addition of // the ability to pass a context and additional request options. // -// See ModifyInstanceAttribute for details on how to use this API operation. +// See GetTransitGatewayRouteTablePropagations for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyInstanceAttributeWithContext(ctx aws.Context, input *ModifyInstanceAttributeInput, opts ...request.Option) (*ModifyInstanceAttributeOutput, error) { - req, out := c.ModifyInstanceAttributeRequest(input) +func (c *EC2) GetTransitGatewayRouteTablePropagationsWithContext(ctx aws.Context, input *GetTransitGatewayRouteTablePropagationsInput, opts ...request.Option) (*GetTransitGatewayRouteTablePropagationsOutput, error) { + req, out := c.GetTransitGatewayRouteTablePropagationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyInstanceCapacityReservationAttributes = "ModifyInstanceCapacityReservationAttributes" +// GetTransitGatewayRouteTablePropagationsPages iterates over the pages of a GetTransitGatewayRouteTablePropagations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetTransitGatewayRouteTablePropagations 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 GetTransitGatewayRouteTablePropagations operation. +// pageNum := 0 +// err := client.GetTransitGatewayRouteTablePropagationsPages(params, +// func(page *ec2.GetTransitGatewayRouteTablePropagationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) GetTransitGatewayRouteTablePropagationsPages(input *GetTransitGatewayRouteTablePropagationsInput, fn func(*GetTransitGatewayRouteTablePropagationsOutput, bool) bool) error { + return c.GetTransitGatewayRouteTablePropagationsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// ModifyInstanceCapacityReservationAttributesRequest generates a "aws/request.Request" representing the -// client's request for the ModifyInstanceCapacityReservationAttributes operation. The "output" return +// GetTransitGatewayRouteTablePropagationsPagesWithContext same as GetTransitGatewayRouteTablePropagationsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) GetTransitGatewayRouteTablePropagationsPagesWithContext(ctx aws.Context, input *GetTransitGatewayRouteTablePropagationsInput, fn func(*GetTransitGatewayRouteTablePropagationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetTransitGatewayRouteTablePropagationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetTransitGatewayRouteTablePropagationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*GetTransitGatewayRouteTablePropagationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opImportClientVpnClientCertificateRevocationList = "ImportClientVpnClientCertificateRevocationList" + +// ImportClientVpnClientCertificateRevocationListRequest generates a "aws/request.Request" representing the +// client's request for the ImportClientVpnClientCertificateRevocationList operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyInstanceCapacityReservationAttributes for more information on using the ModifyInstanceCapacityReservationAttributes +// See ImportClientVpnClientCertificateRevocationList for more information on using the ImportClientVpnClientCertificateRevocationList // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyInstanceCapacityReservationAttributesRequest method. -// req, resp := client.ModifyInstanceCapacityReservationAttributesRequest(params) +// // Example sending a request using the ImportClientVpnClientCertificateRevocationListRequest method. +// req, resp := client.ImportClientVpnClientCertificateRevocationListRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceCapacityReservationAttributes -func (c *EC2) ModifyInstanceCapacityReservationAttributesRequest(input *ModifyInstanceCapacityReservationAttributesInput) (req *request.Request, output *ModifyInstanceCapacityReservationAttributesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportClientVpnClientCertificateRevocationList +func (c *EC2) ImportClientVpnClientCertificateRevocationListRequest(input *ImportClientVpnClientCertificateRevocationListInput) (req *request.Request, output *ImportClientVpnClientCertificateRevocationListOutput) { op := &request.Operation{ - Name: opModifyInstanceCapacityReservationAttributes, + Name: opImportClientVpnClientCertificateRevocationList, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyInstanceCapacityReservationAttributesInput{} + input = &ImportClientVpnClientCertificateRevocationListInput{} } - output = &ModifyInstanceCapacityReservationAttributesOutput{} + output = &ImportClientVpnClientCertificateRevocationListOutput{} req = c.newRequest(op, input, output) return } -// ModifyInstanceCapacityReservationAttributes API operation for Amazon Elastic Compute Cloud. +// ImportClientVpnClientCertificateRevocationList API operation for Amazon Elastic Compute Cloud. // -// Modifies the Capacity Reservation settings for a stopped instance. Use this -// action to configure an instance to target a specific Capacity Reservation, -// run in any open Capacity Reservation with matching attributes, or run On-Demand -// Instance capacity. +// Uploads a client certificate revocation list to the specified Client VPN +// endpoint. Uploading a client certificate revocation list overwrites the existing +// client certificate revocation list. +// +// Uploading a client certificate revocation list resets existing client 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 ModifyInstanceCapacityReservationAttributes for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceCapacityReservationAttributes -func (c *EC2) ModifyInstanceCapacityReservationAttributes(input *ModifyInstanceCapacityReservationAttributesInput) (*ModifyInstanceCapacityReservationAttributesOutput, error) { - req, out := c.ModifyInstanceCapacityReservationAttributesRequest(input) +// API operation ImportClientVpnClientCertificateRevocationList for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportClientVpnClientCertificateRevocationList +func (c *EC2) ImportClientVpnClientCertificateRevocationList(input *ImportClientVpnClientCertificateRevocationListInput) (*ImportClientVpnClientCertificateRevocationListOutput, error) { + req, out := c.ImportClientVpnClientCertificateRevocationListRequest(input) return out, req.Send() } -// ModifyInstanceCapacityReservationAttributesWithContext is the same as ModifyInstanceCapacityReservationAttributes with the addition of +// ImportClientVpnClientCertificateRevocationListWithContext is the same as ImportClientVpnClientCertificateRevocationList with the addition of // the ability to pass a context and additional request options. // -// See ModifyInstanceCapacityReservationAttributes for details on how to use this API operation. +// See ImportClientVpnClientCertificateRevocationList for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyInstanceCapacityReservationAttributesWithContext(ctx aws.Context, input *ModifyInstanceCapacityReservationAttributesInput, opts ...request.Option) (*ModifyInstanceCapacityReservationAttributesOutput, error) { - req, out := c.ModifyInstanceCapacityReservationAttributesRequest(input) +func (c *EC2) ImportClientVpnClientCertificateRevocationListWithContext(ctx aws.Context, input *ImportClientVpnClientCertificateRevocationListInput, opts ...request.Option) (*ImportClientVpnClientCertificateRevocationListOutput, error) { + req, out := c.ImportClientVpnClientCertificateRevocationListRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyInstanceCreditSpecification = "ModifyInstanceCreditSpecification" +const opImportImage = "ImportImage" -// ModifyInstanceCreditSpecificationRequest generates a "aws/request.Request" representing the -// client's request for the ModifyInstanceCreditSpecification operation. The "output" return +// ImportImageRequest generates a "aws/request.Request" representing the +// client's request for the ImportImage operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyInstanceCreditSpecification for more information on using the ModifyInstanceCreditSpecification +// See ImportImage for more information on using the ImportImage // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyInstanceCreditSpecificationRequest method. -// req, resp := client.ModifyInstanceCreditSpecificationRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceCreditSpecification -func (c *EC2) ModifyInstanceCreditSpecificationRequest(input *ModifyInstanceCreditSpecificationInput) (req *request.Request, output *ModifyInstanceCreditSpecificationOutput) { +// See also, 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: opModifyInstanceCreditSpecification, + Name: opImportImage, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyInstanceCreditSpecificationInput{} + input = &ImportImageInput{} } - output = &ModifyInstanceCreditSpecificationOutput{} + output = &ImportImageOutput{} req = c.newRequest(op, input, output) return } -// ModifyInstanceCreditSpecification API operation for Amazon Elastic Compute Cloud. -// -// Modifies the credit option for CPU usage on a running or stopped T2 or T3 -// instance. The credit options are standard and unlimited. +// ImportImage API operation for Amazon Elastic Compute Cloud. // -// For more information, see Burstable Performance Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) -// in the Amazon Elastic Compute Cloud User Guide. +// 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 (https://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 ModifyInstanceCreditSpecification for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceCreditSpecification -func (c *EC2) ModifyInstanceCreditSpecification(input *ModifyInstanceCreditSpecificationInput) (*ModifyInstanceCreditSpecificationOutput, error) { - req, out := c.ModifyInstanceCreditSpecificationRequest(input) +// API operation ImportImage for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportImage +func (c *EC2) ImportImage(input *ImportImageInput) (*ImportImageOutput, error) { + req, out := c.ImportImageRequest(input) return out, req.Send() } -// ModifyInstanceCreditSpecificationWithContext is the same as ModifyInstanceCreditSpecification with the addition of +// ImportImageWithContext is the same as ImportImage with the addition of // the ability to pass a context and additional request options. // -// See ModifyInstanceCreditSpecification for details on how to use this API operation. +// See ImportImage for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyInstanceCreditSpecificationWithContext(ctx aws.Context, input *ModifyInstanceCreditSpecificationInput, opts ...request.Option) (*ModifyInstanceCreditSpecificationOutput, error) { - req, out := c.ModifyInstanceCreditSpecificationRequest(input) +func (c *EC2) ImportImageWithContext(ctx aws.Context, input *ImportImageInput, opts ...request.Option) (*ImportImageOutput, error) { + req, out := c.ImportImageRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyInstanceEventStartTime = "ModifyInstanceEventStartTime" +const opImportInstance = "ImportInstance" -// ModifyInstanceEventStartTimeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyInstanceEventStartTime operation. The "output" return +// ImportInstanceRequest generates a "aws/request.Request" representing the +// client's request for the ImportInstance operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyInstanceEventStartTime for more information on using the ModifyInstanceEventStartTime +// See ImportInstance for more information on using the ImportInstance // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyInstanceEventStartTimeRequest method. -// req, resp := client.ModifyInstanceEventStartTimeRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceEventStartTime -func (c *EC2) ModifyInstanceEventStartTimeRequest(input *ModifyInstanceEventStartTimeInput) (req *request.Request, output *ModifyInstanceEventStartTimeOutput) { +// See also, 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: opModifyInstanceEventStartTime, + Name: opImportInstance, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyInstanceEventStartTimeInput{} + input = &ImportInstanceInput{} } - output = &ModifyInstanceEventStartTimeOutput{} + output = &ImportInstanceOutput{} req = c.newRequest(op, input, output) return } -// ModifyInstanceEventStartTime API operation for Amazon Elastic Compute Cloud. +// ImportInstance API operation for Amazon Elastic Compute Cloud. // -// Modifies the start time for a scheduled Amazon EC2 instance event. +// 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 (https://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 (https://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 ModifyInstanceEventStartTime for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceEventStartTime -func (c *EC2) ModifyInstanceEventStartTime(input *ModifyInstanceEventStartTimeInput) (*ModifyInstanceEventStartTimeOutput, error) { - req, out := c.ModifyInstanceEventStartTimeRequest(input) +// API operation ImportInstance for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportInstance +func (c *EC2) ImportInstance(input *ImportInstanceInput) (*ImportInstanceOutput, error) { + req, out := c.ImportInstanceRequest(input) return out, req.Send() } -// ModifyInstanceEventStartTimeWithContext is the same as ModifyInstanceEventStartTime with the addition of +// ImportInstanceWithContext is the same as ImportInstance with the addition of // the ability to pass a context and additional request options. // -// See ModifyInstanceEventStartTime for details on how to use this API operation. +// See ImportInstance for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyInstanceEventStartTimeWithContext(ctx aws.Context, input *ModifyInstanceEventStartTimeInput, opts ...request.Option) (*ModifyInstanceEventStartTimeOutput, error) { - req, out := c.ModifyInstanceEventStartTimeRequest(input) +func (c *EC2) ImportInstanceWithContext(ctx aws.Context, input *ImportInstanceInput, opts ...request.Option) (*ImportInstanceOutput, error) { + req, out := c.ImportInstanceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyInstancePlacement = "ModifyInstancePlacement" +const opImportKeyPair = "ImportKeyPair" -// ModifyInstancePlacementRequest generates a "aws/request.Request" representing the -// client's request for the ModifyInstancePlacement operation. The "output" return +// ImportKeyPairRequest generates a "aws/request.Request" representing the +// client's request for the ImportKeyPair operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyInstancePlacement for more information on using the ModifyInstancePlacement +// See ImportKeyPair for more information on using the ImportKeyPair // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyInstancePlacementRequest method. -// req, resp := client.ModifyInstancePlacementRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstancePlacement -func (c *EC2) ModifyInstancePlacementRequest(input *ModifyInstancePlacementInput) (req *request.Request, output *ModifyInstancePlacementOutput) { +// See also, 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: opModifyInstancePlacement, + Name: opImportKeyPair, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyInstancePlacementInput{} + input = &ImportKeyPairInput{} } - output = &ModifyInstancePlacementOutput{} + output = &ImportKeyPairOutput{} req = c.newRequest(op, input, output) return } -// ModifyInstancePlacement API operation for Amazon Elastic Compute Cloud. -// -// Modifies the placement attributes for a specified instance. You can do the -// following: -// -// * Modify the affinity between an instance and a Dedicated Host (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-overview.html). -// When affinity is set to host and the instance is not associated with a -// specific Dedicated Host, the next time the instance is launched, it is -// automatically associated with the host on which it lands. If the instance -// is restarted or rebooted, this relationship persists. -// -// * Change the Dedicated Host with which an instance is associated. -// -// * Change the instance tenancy of an instance from host to dedicated, or -// from dedicated to host. -// -// * Move an instance to or from a placement group (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html). +// ImportKeyPair API operation for Amazon Elastic Compute Cloud. // -// At least one attribute for affinity, host ID, tenancy, or placement group -// name must be specified in the request. Affinity and tenancy can be modified -// in the same request. +// 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. // -// To modify the host ID, tenancy, placement group, or partition for an instance, -// the instance must be in the stopped state. +// For more information about key pairs, see Key Pairs (https://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 ModifyInstancePlacement for usage and error information. -// See also, 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) +// API operation ImportKeyPair for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportKeyPair +func (c *EC2) ImportKeyPair(input *ImportKeyPairInput) (*ImportKeyPairOutput, error) { + req, out := c.ImportKeyPairRequest(input) return out, req.Send() } -// ModifyInstancePlacementWithContext is the same as ModifyInstancePlacement with the addition of +// ImportKeyPairWithContext is the same as ImportKeyPair with the addition of // the ability to pass a context and additional request options. // -// See ModifyInstancePlacement for details on how to use this API operation. +// See ImportKeyPair for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyInstancePlacementWithContext(ctx aws.Context, input *ModifyInstancePlacementInput, opts ...request.Option) (*ModifyInstancePlacementOutput, error) { - req, out := c.ModifyInstancePlacementRequest(input) +func (c *EC2) ImportKeyPairWithContext(ctx aws.Context, input *ImportKeyPairInput, opts ...request.Option) (*ImportKeyPairOutput, error) { + req, out := c.ImportKeyPairRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyLaunchTemplate = "ModifyLaunchTemplate" +const opImportSnapshot = "ImportSnapshot" -// ModifyLaunchTemplateRequest generates a "aws/request.Request" representing the -// client's request for the ModifyLaunchTemplate operation. The "output" return +// ImportSnapshotRequest generates a "aws/request.Request" representing the +// client's request for the ImportSnapshot operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyLaunchTemplate for more information on using the ModifyLaunchTemplate +// See ImportSnapshot for more information on using the ImportSnapshot // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyLaunchTemplateRequest method. -// req, resp := client.ModifyLaunchTemplateRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyLaunchTemplate -func (c *EC2) ModifyLaunchTemplateRequest(input *ModifyLaunchTemplateInput) (req *request.Request, output *ModifyLaunchTemplateOutput) { +// See also, 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: opModifyLaunchTemplate, + Name: opImportSnapshot, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyLaunchTemplateInput{} + input = &ImportSnapshotInput{} } - output = &ModifyLaunchTemplateOutput{} + output = &ImportSnapshotOutput{} req = c.newRequest(op, input, output) return } -// ModifyLaunchTemplate API operation for Amazon Elastic Compute Cloud. +// ImportSnapshot API operation for Amazon Elastic Compute Cloud. // -// Modifies a launch template. You can specify which version of the launch template -// to set as the default version. When launching an instance, the default version -// applies when a launch template version is not specified. +// 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 ModifyLaunchTemplate for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyLaunchTemplate -func (c *EC2) ModifyLaunchTemplate(input *ModifyLaunchTemplateInput) (*ModifyLaunchTemplateOutput, error) { - req, out := c.ModifyLaunchTemplateRequest(input) +// API operation ImportSnapshot for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportSnapshot +func (c *EC2) ImportSnapshot(input *ImportSnapshotInput) (*ImportSnapshotOutput, error) { + req, out := c.ImportSnapshotRequest(input) return out, req.Send() } -// ModifyLaunchTemplateWithContext is the same as ModifyLaunchTemplate with the addition of +// ImportSnapshotWithContext is the same as ImportSnapshot with the addition of // the ability to pass a context and additional request options. // -// See ModifyLaunchTemplate for details on how to use this API operation. +// See ImportSnapshot for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyLaunchTemplateWithContext(ctx aws.Context, input *ModifyLaunchTemplateInput, opts ...request.Option) (*ModifyLaunchTemplateOutput, error) { - req, out := c.ModifyLaunchTemplateRequest(input) +func (c *EC2) ImportSnapshotWithContext(ctx aws.Context, input *ImportSnapshotInput, opts ...request.Option) (*ImportSnapshotOutput, error) { + req, out := c.ImportSnapshotRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyNetworkInterfaceAttribute = "ModifyNetworkInterfaceAttribute" +const opImportVolume = "ImportVolume" -// ModifyNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyNetworkInterfaceAttribute operation. The "output" return +// ImportVolumeRequest generates a "aws/request.Request" representing the +// client's request for the ImportVolume operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyNetworkInterfaceAttribute for more information on using the ModifyNetworkInterfaceAttribute +// See ImportVolume for more information on using the ImportVolume // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyNetworkInterfaceAttributeRequest method. -// req, resp := client.ModifyNetworkInterfaceAttributeRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyNetworkInterfaceAttribute -func (c *EC2) ModifyNetworkInterfaceAttributeRequest(input *ModifyNetworkInterfaceAttributeInput) (req *request.Request, output *ModifyNetworkInterfaceAttributeOutput) { +// See also, 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: opModifyNetworkInterfaceAttribute, + Name: opImportVolume, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyNetworkInterfaceAttributeInput{} + input = &ImportVolumeInput{} } - output = &ModifyNetworkInterfaceAttributeOutput{} + output = &ImportVolumeOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ModifyNetworkInterfaceAttribute API operation for Amazon Elastic Compute Cloud. +// ImportVolume API operation for Amazon Elastic Compute Cloud. // -// Modifies the specified network interface attribute. You can specify only -// one attribute at a time. You can use this action to attach and detach security -// groups from an existing EC2 instance. +// Creates an import volume task using metadata from the specified disk image.For +// more information, see Importing Disks to Amazon EBS (https://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 (https://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 ModifyNetworkInterfaceAttribute for usage and error information. -// See also, 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) +// API operation ImportVolume for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ImportVolume +func (c *EC2) ImportVolume(input *ImportVolumeInput) (*ImportVolumeOutput, error) { + req, out := c.ImportVolumeRequest(input) return out, req.Send() } -// ModifyNetworkInterfaceAttributeWithContext is the same as ModifyNetworkInterfaceAttribute with the addition of +// ImportVolumeWithContext is the same as ImportVolume with the addition of // the ability to pass a context and additional request options. // -// See ModifyNetworkInterfaceAttribute for details on how to use this API operation. +// See ImportVolume for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyNetworkInterfaceAttributeWithContext(ctx aws.Context, input *ModifyNetworkInterfaceAttributeInput, opts ...request.Option) (*ModifyNetworkInterfaceAttributeOutput, error) { - req, out := c.ModifyNetworkInterfaceAttributeRequest(input) +func (c *EC2) ImportVolumeWithContext(ctx aws.Context, input *ImportVolumeInput, opts ...request.Option) (*ImportVolumeOutput, error) { + req, out := c.ImportVolumeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyReservedInstances = "ModifyReservedInstances" +const opModifyCapacityReservation = "ModifyCapacityReservation" -// ModifyReservedInstancesRequest generates a "aws/request.Request" representing the -// client's request for the ModifyReservedInstances operation. The "output" return +// ModifyCapacityReservationRequest generates a "aws/request.Request" representing the +// client's request for the ModifyCapacityReservation operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyReservedInstances for more information on using the ModifyReservedInstances +// See ModifyCapacityReservation for more information on using the ModifyCapacityReservation // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyReservedInstancesRequest method. -// req, resp := client.ModifyReservedInstancesRequest(params) +// // Example sending a request using the ModifyCapacityReservationRequest method. +// req, resp := client.ModifyCapacityReservationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyReservedInstances -func (c *EC2) ModifyReservedInstancesRequest(input *ModifyReservedInstancesInput) (req *request.Request, output *ModifyReservedInstancesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyCapacityReservation +func (c *EC2) ModifyCapacityReservationRequest(input *ModifyCapacityReservationInput) (req *request.Request, output *ModifyCapacityReservationOutput) { op := &request.Operation{ - Name: opModifyReservedInstances, + Name: opModifyCapacityReservation, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyReservedInstancesInput{} + input = &ModifyCapacityReservationInput{} } - output = &ModifyReservedInstancesOutput{} + output = &ModifyCapacityReservationOutput{} req = c.newRequest(op, input, output) return } -// ModifyReservedInstances API operation for Amazon Elastic Compute Cloud. +// ModifyCapacityReservation 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 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 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Modifies a Capacity Reservation's capacity and the conditions under which +// it is to be released. You cannot change a Capacity Reservation's instance +// type, EBS optimization, instance store settings, platform, Availability Zone, +// or instance eligibility. If you need to modify any of these attributes, we +// recommend that you cancel the Capacity Reservation, and then create a new +// one with the required attributes. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation ModifyCapacityReservation for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyCapacityReservation +func (c *EC2) ModifyCapacityReservation(input *ModifyCapacityReservationInput) (*ModifyCapacityReservationOutput, error) { + req, out := c.ModifyCapacityReservationRequest(input) return out, req.Send() } -// ModifyReservedInstancesWithContext is the same as ModifyReservedInstances with the addition of +// ModifyCapacityReservationWithContext is the same as ModifyCapacityReservation with the addition of // the ability to pass a context and additional request options. // -// See ModifyReservedInstances for details on how to use this API operation. +// See ModifyCapacityReservation for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyReservedInstancesWithContext(ctx aws.Context, input *ModifyReservedInstancesInput, opts ...request.Option) (*ModifyReservedInstancesOutput, error) { - req, out := c.ModifyReservedInstancesRequest(input) +func (c *EC2) ModifyCapacityReservationWithContext(ctx aws.Context, input *ModifyCapacityReservationInput, opts ...request.Option) (*ModifyCapacityReservationOutput, error) { + req, out := c.ModifyCapacityReservationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifySnapshotAttribute = "ModifySnapshotAttribute" +const opModifyClientVpnEndpoint = "ModifyClientVpnEndpoint" -// ModifySnapshotAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifySnapshotAttribute operation. The "output" return +// ModifyClientVpnEndpointRequest generates a "aws/request.Request" representing the +// client's request for the ModifyClientVpnEndpoint operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifySnapshotAttribute for more information on using the ModifySnapshotAttribute +// See ModifyClientVpnEndpoint for more information on using the ModifyClientVpnEndpoint // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifySnapshotAttributeRequest method. -// req, resp := client.ModifySnapshotAttributeRequest(params) +// // Example sending a request using the ModifyClientVpnEndpointRequest method. +// req, resp := client.ModifyClientVpnEndpointRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySnapshotAttribute -func (c *EC2) ModifySnapshotAttributeRequest(input *ModifySnapshotAttributeInput) (req *request.Request, output *ModifySnapshotAttributeOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyClientVpnEndpoint +func (c *EC2) ModifyClientVpnEndpointRequest(input *ModifyClientVpnEndpointInput) (req *request.Request, output *ModifyClientVpnEndpointOutput) { op := &request.Operation{ - Name: opModifySnapshotAttribute, + Name: opModifyClientVpnEndpoint, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifySnapshotAttributeInput{} + input = &ModifyClientVpnEndpointInput{} } - output = &ModifySnapshotAttributeOutput{} + output = &ModifyClientVpnEndpointOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, 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 operation. If you need to -// both add and remove account IDs for a snapshot, you must use multiple operations. -// You can make up to 500 modifications to a snapshot in a single operation. -// -// 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. +// ModifyClientVpnEndpoint API operation for Amazon Elastic Compute Cloud. // -// For more information about modifying snapshot permissions, see Sharing Snapshots -// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Modifies the specified Client VPN endpoint. You can only modify an endpoint's +// server certificate information, client connection logging information, DNS +// server, and description. Modifying the DNS server resets existing client +// 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 ModifySnapshotAttribute for usage and error information. -// See also, 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) +// API operation ModifyClientVpnEndpoint for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyClientVpnEndpoint +func (c *EC2) ModifyClientVpnEndpoint(input *ModifyClientVpnEndpointInput) (*ModifyClientVpnEndpointOutput, error) { + req, out := c.ModifyClientVpnEndpointRequest(input) return out, req.Send() } -// ModifySnapshotAttributeWithContext is the same as ModifySnapshotAttribute with the addition of +// ModifyClientVpnEndpointWithContext is the same as ModifyClientVpnEndpoint with the addition of // the ability to pass a context and additional request options. // -// See ModifySnapshotAttribute for details on how to use this API operation. +// See ModifyClientVpnEndpoint for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifySnapshotAttributeWithContext(ctx aws.Context, input *ModifySnapshotAttributeInput, opts ...request.Option) (*ModifySnapshotAttributeOutput, error) { - req, out := c.ModifySnapshotAttributeRequest(input) +func (c *EC2) ModifyClientVpnEndpointWithContext(ctx aws.Context, input *ModifyClientVpnEndpointInput, opts ...request.Option) (*ModifyClientVpnEndpointOutput, error) { + req, out := c.ModifyClientVpnEndpointRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifySpotFleetRequest = "ModifySpotFleetRequest" +const opModifyDefaultCreditSpecification = "ModifyDefaultCreditSpecification" -// ModifySpotFleetRequestRequest generates a "aws/request.Request" representing the -// client's request for the ModifySpotFleetRequest operation. The "output" return +// ModifyDefaultCreditSpecificationRequest generates a "aws/request.Request" representing the +// client's request for the ModifyDefaultCreditSpecification operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifySpotFleetRequest for more information on using the ModifySpotFleetRequest +// See ModifyDefaultCreditSpecification for more information on using the ModifyDefaultCreditSpecification // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifySpotFleetRequestRequest method. -// req, resp := client.ModifySpotFleetRequestRequest(params) +// // Example sending a request using the ModifyDefaultCreditSpecificationRequest method. +// req, resp := client.ModifyDefaultCreditSpecificationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySpotFleetRequest -func (c *EC2) ModifySpotFleetRequestRequest(input *ModifySpotFleetRequestInput) (req *request.Request, output *ModifySpotFleetRequestOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyDefaultCreditSpecification +func (c *EC2) ModifyDefaultCreditSpecificationRequest(input *ModifyDefaultCreditSpecificationInput) (req *request.Request, output *ModifyDefaultCreditSpecificationOutput) { op := &request.Operation{ - Name: opModifySpotFleetRequest, + Name: opModifyDefaultCreditSpecification, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifySpotFleetRequestInput{} + input = &ModifyDefaultCreditSpecificationInput{} } - output = &ModifySpotFleetRequestOutput{} + output = &ModifyDefaultCreditSpecificationOutput{} req = c.newRequest(op, input, output) return } -// ModifySpotFleetRequest API operation for Amazon Elastic Compute Cloud. -// -// Modifies the specified Spot Fleet request. -// -// You can only modify a Spot Fleet request of type maintain. -// -// While the Spot Fleet request is being modified, it is in the modifying state. +// ModifyDefaultCreditSpecification API operation for Amazon Elastic Compute Cloud. // -// 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 Instance pool with the lowest -// price. If the allocation strategy is diversified, the Spot Fleet distributes -// the instances across the Spot Instance pools. If the allocation strategy -// is capacityOptimized, Spot Fleet launches instances from Spot Instance pools -// with optimal capacity for the number of instances that are launching. +// Modifies the default credit option for CPU usage of burstable performance +// instances. The default credit option is set at the account level per AWS +// Region, and is specified per instance family. All new burstable performance +// instances in the account launch using the default credit option. // -// To scale down your Spot Fleet, decrease its target capacity. First, the Spot -// Fleet cancels any open requests 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 capacityOptimized, the Spot -// Fleet terminates the instances in the Spot Instance pools that have the least -// available Spot Instance capacity. If the allocation strategy is diversified, -// the Spot Fleet terminates instances across the Spot Instance 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. +// ModifyDefaultCreditSpecification is an asynchronous operation, which works +// at an AWS Region level and modifies the credit option for each Availability +// Zone. All zones in a Region are updated within five minutes. But if instances +// are launched during this operation, they might not get the new credit option +// until the zone is updated. To verify whether the update has occurred, you +// can call GetDefaultCreditSpecification and check DefaultCreditSpecification +// for updates. // -// If you are finished with your Spot Fleet for now, but will use it again later, -// you can set the target capacity to 0. +// For more information, see Burstable Performance Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-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 ModifySpotFleetRequest for usage and error information. -// See also, 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) +// API operation ModifyDefaultCreditSpecification for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyDefaultCreditSpecification +func (c *EC2) ModifyDefaultCreditSpecification(input *ModifyDefaultCreditSpecificationInput) (*ModifyDefaultCreditSpecificationOutput, error) { + req, out := c.ModifyDefaultCreditSpecificationRequest(input) return out, req.Send() } -// ModifySpotFleetRequestWithContext is the same as ModifySpotFleetRequest with the addition of +// ModifyDefaultCreditSpecificationWithContext is the same as ModifyDefaultCreditSpecification with the addition of // the ability to pass a context and additional request options. // -// See ModifySpotFleetRequest for details on how to use this API operation. +// See ModifyDefaultCreditSpecification for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifySpotFleetRequestWithContext(ctx aws.Context, input *ModifySpotFleetRequestInput, opts ...request.Option) (*ModifySpotFleetRequestOutput, error) { - req, out := c.ModifySpotFleetRequestRequest(input) +func (c *EC2) ModifyDefaultCreditSpecificationWithContext(ctx aws.Context, input *ModifyDefaultCreditSpecificationInput, opts ...request.Option) (*ModifyDefaultCreditSpecificationOutput, error) { + req, out := c.ModifyDefaultCreditSpecificationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifySubnetAttribute = "ModifySubnetAttribute" +const opModifyEbsDefaultKmsKeyId = "ModifyEbsDefaultKmsKeyId" -// ModifySubnetAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifySubnetAttribute operation. The "output" return +// ModifyEbsDefaultKmsKeyIdRequest generates a "aws/request.Request" representing the +// client's request for the ModifyEbsDefaultKmsKeyId operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifySubnetAttribute for more information on using the ModifySubnetAttribute +// See ModifyEbsDefaultKmsKeyId for more information on using the ModifyEbsDefaultKmsKeyId // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifySubnetAttributeRequest method. -// req, resp := client.ModifySubnetAttributeRequest(params) +// // Example sending a request using the ModifyEbsDefaultKmsKeyIdRequest method. +// req, resp := client.ModifyEbsDefaultKmsKeyIdRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySubnetAttribute -func (c *EC2) ModifySubnetAttributeRequest(input *ModifySubnetAttributeInput) (req *request.Request, output *ModifySubnetAttributeOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyEbsDefaultKmsKeyId +func (c *EC2) ModifyEbsDefaultKmsKeyIdRequest(input *ModifyEbsDefaultKmsKeyIdInput) (req *request.Request, output *ModifyEbsDefaultKmsKeyIdOutput) { op := &request.Operation{ - Name: opModifySubnetAttribute, + Name: opModifyEbsDefaultKmsKeyId, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifySubnetAttributeInput{} + input = &ModifyEbsDefaultKmsKeyIdInput{} } - output = &ModifySubnetAttributeOutput{} + output = &ModifyEbsDefaultKmsKeyIdOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ModifySubnetAttribute API operation for Amazon Elastic Compute Cloud. +// ModifyEbsDefaultKmsKeyId API operation for Amazon Elastic Compute Cloud. // -// Modifies a subnet attribute. You can only modify one attribute at a time. +// Changes the default customer master key (CMK) for EBS encryption by default +// for your account in this Region. +// +// AWS creates a unique AWS managed CMK in each Region for use with encryption +// by default. If you change the default CMK to a symmetric customer managed +// CMK, it is used instead of the AWS managed CMK. To reset the default CMK +// to the AWS managed CMK for EBS, use ResetEbsDefaultKmsKeyId. Amazon EBS does +// not support asymmetric CMKs. +// +// If you delete or disable the customer managed CMK that you specified for +// use with encryption by default, your instances will fail to launch. +// +// For more information, see Amazon EBS Encryption (https://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 ModifySubnetAttribute for usage and error information. -// See also, 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) +// API operation ModifyEbsDefaultKmsKeyId for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyEbsDefaultKmsKeyId +func (c *EC2) ModifyEbsDefaultKmsKeyId(input *ModifyEbsDefaultKmsKeyIdInput) (*ModifyEbsDefaultKmsKeyIdOutput, error) { + req, out := c.ModifyEbsDefaultKmsKeyIdRequest(input) return out, req.Send() } -// ModifySubnetAttributeWithContext is the same as ModifySubnetAttribute with the addition of +// ModifyEbsDefaultKmsKeyIdWithContext is the same as ModifyEbsDefaultKmsKeyId with the addition of // the ability to pass a context and additional request options. // -// See ModifySubnetAttribute for details on how to use this API operation. +// See ModifyEbsDefaultKmsKeyId for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifySubnetAttributeWithContext(ctx aws.Context, input *ModifySubnetAttributeInput, opts ...request.Option) (*ModifySubnetAttributeOutput, error) { - req, out := c.ModifySubnetAttributeRequest(input) +func (c *EC2) ModifyEbsDefaultKmsKeyIdWithContext(ctx aws.Context, input *ModifyEbsDefaultKmsKeyIdInput, opts ...request.Option) (*ModifyEbsDefaultKmsKeyIdOutput, error) { + req, out := c.ModifyEbsDefaultKmsKeyIdRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyTrafficMirrorFilterNetworkServices = "ModifyTrafficMirrorFilterNetworkServices" +const opModifyFleet = "ModifyFleet" -// ModifyTrafficMirrorFilterNetworkServicesRequest generates a "aws/request.Request" representing the -// client's request for the ModifyTrafficMirrorFilterNetworkServices operation. The "output" return +// ModifyFleetRequest generates a "aws/request.Request" representing the +// client's request for the ModifyFleet operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyTrafficMirrorFilterNetworkServices for more information on using the ModifyTrafficMirrorFilterNetworkServices +// See ModifyFleet for more information on using the ModifyFleet // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyTrafficMirrorFilterNetworkServicesRequest method. -// req, resp := client.ModifyTrafficMirrorFilterNetworkServicesRequest(params) +// // Example sending a request using the ModifyFleetRequest method. +// req, resp := client.ModifyFleetRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorFilterNetworkServices -func (c *EC2) ModifyTrafficMirrorFilterNetworkServicesRequest(input *ModifyTrafficMirrorFilterNetworkServicesInput) (req *request.Request, output *ModifyTrafficMirrorFilterNetworkServicesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyFleet +func (c *EC2) ModifyFleetRequest(input *ModifyFleetInput) (req *request.Request, output *ModifyFleetOutput) { op := &request.Operation{ - Name: opModifyTrafficMirrorFilterNetworkServices, + Name: opModifyFleet, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyTrafficMirrorFilterNetworkServicesInput{} + input = &ModifyFleetInput{} } - output = &ModifyTrafficMirrorFilterNetworkServicesOutput{} + output = &ModifyFleetOutput{} req = c.newRequest(op, input, output) return } -// ModifyTrafficMirrorFilterNetworkServices API operation for Amazon Elastic Compute Cloud. +// ModifyFleet API operation for Amazon Elastic Compute Cloud. // -// Allows or restricts mirroring network services. +// Modifies the specified EC2 Fleet. // -// By default, Amazon DNS network services are not eligible for Traffic Mirror. -// Use AddNetworkServices to add network services to a Traffic Mirror filter. -// When a network service is added to the Traffic Mirror filter, all traffic -// related to that network service will be mirrored. When you no longer want -// to mirror network services, use RemoveNetworkServices to remove the network -// services from the Traffic Mirror filter. +// You can only modify an EC2 Fleet request of type maintain. // -// FFor information about filter rule properties, see Network Services (https://docs.aws.amazon.com/vpc/latest/mirroring/traffic-mirroring-considerations.html#traffic-mirroring-network-services) -// in the Traffic Mirroring User Guide . +// While the EC2 Fleet is being modified, it is in the modifying state. +// +// To scale up your EC2 Fleet, increase its target capacity. The EC2 Fleet launches +// the additional Spot Instances according to the allocation strategy for the +// EC2 Fleet request. If the allocation strategy is lowest-price, the EC2 Fleet +// launches instances using the Spot Instance pool with the lowest price. If +// the allocation strategy is diversified, the EC2 Fleet distributes the instances +// across the Spot Instance pools. If the allocation strategy is capacity-optimized, +// EC2 Fleet launches instances from Spot Instance pools with optimal capacity +// for the number of instances that are launching. +// +// To scale down your EC2 Fleet, decrease its target capacity. First, the EC2 +// Fleet cancels any open requests that exceed the new target capacity. You +// can request that the EC2 Fleet terminate Spot Instances until the size of +// the fleet no longer exceeds the new target capacity. If the allocation strategy +// is lowest-price, the EC2 Fleet terminates the instances with the highest +// price per unit. If the allocation strategy is capacity-optimized, the EC2 +// Fleet terminates the instances in the Spot Instance pools that have the least +// available Spot Instance capacity. If the allocation strategy is diversified, +// the EC2 Fleet terminates instances across the Spot Instance pools. Alternatively, +// you can request that the EC2 Fleet keep the fleet at its current size, but +// not replace any Spot Instances that are interrupted or that you terminate +// manually. +// +// If you are finished with your EC2 Fleet for now, but will use it again later, +// you can set the target capacity to 0. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyTrafficMirrorFilterNetworkServices for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorFilterNetworkServices -func (c *EC2) ModifyTrafficMirrorFilterNetworkServices(input *ModifyTrafficMirrorFilterNetworkServicesInput) (*ModifyTrafficMirrorFilterNetworkServicesOutput, error) { - req, out := c.ModifyTrafficMirrorFilterNetworkServicesRequest(input) +// API operation ModifyFleet for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyFleet +func (c *EC2) ModifyFleet(input *ModifyFleetInput) (*ModifyFleetOutput, error) { + req, out := c.ModifyFleetRequest(input) return out, req.Send() } -// ModifyTrafficMirrorFilterNetworkServicesWithContext is the same as ModifyTrafficMirrorFilterNetworkServices with the addition of +// ModifyFleetWithContext is the same as ModifyFleet with the addition of // the ability to pass a context and additional request options. // -// See ModifyTrafficMirrorFilterNetworkServices for details on how to use this API operation. +// See ModifyFleet for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyTrafficMirrorFilterNetworkServicesWithContext(ctx aws.Context, input *ModifyTrafficMirrorFilterNetworkServicesInput, opts ...request.Option) (*ModifyTrafficMirrorFilterNetworkServicesOutput, error) { - req, out := c.ModifyTrafficMirrorFilterNetworkServicesRequest(input) +func (c *EC2) ModifyFleetWithContext(ctx aws.Context, input *ModifyFleetInput, opts ...request.Option) (*ModifyFleetOutput, error) { + req, out := c.ModifyFleetRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyTrafficMirrorFilterRule = "ModifyTrafficMirrorFilterRule" +const opModifyFpgaImageAttribute = "ModifyFpgaImageAttribute" -// ModifyTrafficMirrorFilterRuleRequest generates a "aws/request.Request" representing the -// client's request for the ModifyTrafficMirrorFilterRule operation. The "output" return +// ModifyFpgaImageAttributeRequest generates a "aws/request.Request" representing the +// client's request for the ModifyFpgaImageAttribute operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyTrafficMirrorFilterRule for more information on using the ModifyTrafficMirrorFilterRule +// See ModifyFpgaImageAttribute for more information on using the ModifyFpgaImageAttribute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyTrafficMirrorFilterRuleRequest method. -// req, resp := client.ModifyTrafficMirrorFilterRuleRequest(params) +// // Example sending a request using the ModifyFpgaImageAttributeRequest method. +// req, resp := client.ModifyFpgaImageAttributeRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorFilterRule -func (c *EC2) ModifyTrafficMirrorFilterRuleRequest(input *ModifyTrafficMirrorFilterRuleInput) (req *request.Request, output *ModifyTrafficMirrorFilterRuleOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyFpgaImageAttribute +func (c *EC2) ModifyFpgaImageAttributeRequest(input *ModifyFpgaImageAttributeInput) (req *request.Request, output *ModifyFpgaImageAttributeOutput) { op := &request.Operation{ - Name: opModifyTrafficMirrorFilterRule, + Name: opModifyFpgaImageAttribute, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyTrafficMirrorFilterRuleInput{} + input = &ModifyFpgaImageAttributeInput{} } - output = &ModifyTrafficMirrorFilterRuleOutput{} + output = &ModifyFpgaImageAttributeOutput{} req = c.newRequest(op, input, output) return } -// ModifyTrafficMirrorFilterRule API operation for Amazon Elastic Compute Cloud. -// -// Modifies the specified Traffic Mirror rule. +// ModifyFpgaImageAttribute API operation for Amazon Elastic Compute Cloud. // -// DestinationCidrBlock and SourceCidrBlock must both be an IPv4 range or an -// IPv6 range. +// Modifies the specified attribute of the specified Amazon FPGA Image (AFI). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ModifyTrafficMirrorFilterRule for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorFilterRule -func (c *EC2) ModifyTrafficMirrorFilterRule(input *ModifyTrafficMirrorFilterRuleInput) (*ModifyTrafficMirrorFilterRuleOutput, error) { - req, out := c.ModifyTrafficMirrorFilterRuleRequest(input) +// API operation ModifyFpgaImageAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyFpgaImageAttribute +func (c *EC2) ModifyFpgaImageAttribute(input *ModifyFpgaImageAttributeInput) (*ModifyFpgaImageAttributeOutput, error) { + req, out := c.ModifyFpgaImageAttributeRequest(input) return out, req.Send() } -// ModifyTrafficMirrorFilterRuleWithContext is the same as ModifyTrafficMirrorFilterRule with the addition of +// ModifyFpgaImageAttributeWithContext is the same as ModifyFpgaImageAttribute with the addition of // the ability to pass a context and additional request options. // -// See ModifyTrafficMirrorFilterRule for details on how to use this API operation. +// See ModifyFpgaImageAttribute for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyTrafficMirrorFilterRuleWithContext(ctx aws.Context, input *ModifyTrafficMirrorFilterRuleInput, opts ...request.Option) (*ModifyTrafficMirrorFilterRuleOutput, error) { - req, out := c.ModifyTrafficMirrorFilterRuleRequest(input) +func (c *EC2) ModifyFpgaImageAttributeWithContext(ctx aws.Context, input *ModifyFpgaImageAttributeInput, opts ...request.Option) (*ModifyFpgaImageAttributeOutput, error) { + req, out := c.ModifyFpgaImageAttributeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyTrafficMirrorSession = "ModifyTrafficMirrorSession" +const opModifyHosts = "ModifyHosts" -// ModifyTrafficMirrorSessionRequest generates a "aws/request.Request" representing the -// client's request for the ModifyTrafficMirrorSession operation. The "output" return +// ModifyHostsRequest generates a "aws/request.Request" representing the +// client's request for the ModifyHosts operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyTrafficMirrorSession for more information on using the ModifyTrafficMirrorSession +// See ModifyHosts for more information on using the ModifyHosts // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyTrafficMirrorSessionRequest method. -// req, resp := client.ModifyTrafficMirrorSessionRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorSession -func (c *EC2) ModifyTrafficMirrorSessionRequest(input *ModifyTrafficMirrorSessionInput) (req *request.Request, output *ModifyTrafficMirrorSessionOutput) { +// See also, 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: opModifyTrafficMirrorSession, + Name: opModifyHosts, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyTrafficMirrorSessionInput{} + input = &ModifyHostsInput{} } - output = &ModifyTrafficMirrorSessionOutput{} + output = &ModifyHostsOutput{} req = c.newRequest(op, input, output) return } -// ModifyTrafficMirrorSession API operation for Amazon Elastic Compute Cloud. +// ModifyHosts API operation for Amazon Elastic Compute Cloud. // -// Modifies a Traffic Mirror session. +// Modify the auto-placement setting of a Dedicated Host. When auto-placement +// is enabled, any instances that you launch with a tenancy of host but without +// a specific host ID are placed onto any available Dedicated Host in your account +// that has auto-placement enabled. When auto-placement is disabled, you need +// to provide a host ID to have the instance launch onto a specific host. If +// no host ID is provided, the instance is launched onto a suitable host with +// auto-placement enabled. +// +// You can also use this API action to modify a Dedicated Host to support either +// multiple instance types in an instance family, or to support a specific instance +// type 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 Elastic Compute Cloud's -// API operation ModifyTrafficMirrorSession for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorSession -func (c *EC2) ModifyTrafficMirrorSession(input *ModifyTrafficMirrorSessionInput) (*ModifyTrafficMirrorSessionOutput, error) { - req, out := c.ModifyTrafficMirrorSessionRequest(input) +// API operation ModifyHosts for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyHosts +func (c *EC2) ModifyHosts(input *ModifyHostsInput) (*ModifyHostsOutput, error) { + req, out := c.ModifyHostsRequest(input) return out, req.Send() } -// ModifyTrafficMirrorSessionWithContext is the same as ModifyTrafficMirrorSession with the addition of +// ModifyHostsWithContext is the same as ModifyHosts with the addition of // the ability to pass a context and additional request options. // -// See ModifyTrafficMirrorSession for details on how to use this API operation. +// See ModifyHosts for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyTrafficMirrorSessionWithContext(ctx aws.Context, input *ModifyTrafficMirrorSessionInput, opts ...request.Option) (*ModifyTrafficMirrorSessionOutput, error) { - req, out := c.ModifyTrafficMirrorSessionRequest(input) +func (c *EC2) ModifyHostsWithContext(ctx aws.Context, input *ModifyHostsInput, opts ...request.Option) (*ModifyHostsOutput, error) { + req, out := c.ModifyHostsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyTransitGatewayVpcAttachment = "ModifyTransitGatewayVpcAttachment" +const opModifyIdFormat = "ModifyIdFormat" -// ModifyTransitGatewayVpcAttachmentRequest generates a "aws/request.Request" representing the -// client's request for the ModifyTransitGatewayVpcAttachment operation. The "output" return +// ModifyIdFormatRequest generates a "aws/request.Request" representing the +// client's request for the ModifyIdFormat operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyTransitGatewayVpcAttachment for more information on using the ModifyTransitGatewayVpcAttachment +// See ModifyIdFormat for more information on using the ModifyIdFormat // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyTransitGatewayVpcAttachmentRequest method. -// req, resp := client.ModifyTransitGatewayVpcAttachmentRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTransitGatewayVpcAttachment -func (c *EC2) ModifyTransitGatewayVpcAttachmentRequest(input *ModifyTransitGatewayVpcAttachmentInput) (req *request.Request, output *ModifyTransitGatewayVpcAttachmentOutput) { +// See also, 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: opModifyTransitGatewayVpcAttachment, + Name: opModifyIdFormat, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyTransitGatewayVpcAttachmentInput{} + input = &ModifyIdFormatInput{} } - output = &ModifyTransitGatewayVpcAttachmentOutput{} + output = &ModifyIdFormatOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ModifyTransitGatewayVpcAttachment API operation for Amazon Elastic Compute Cloud. +// ModifyIdFormat API operation for Amazon Elastic Compute Cloud. // -// Modifies the specified VPC attachment. +// 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. +// +// This request can only be used to modify longer ID settings for resource types +// that are within the opt-in period. Resources currently in their opt-in period +// include: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation +// | elastic-ip-association | export-task | flow-log | image | import-task | +// internet-gateway | network-acl | network-acl-association | network-interface +// | network-interface-attachment | prefix-list | route-table | route-table-association +// | security-group | subnet | subnet-cidr-block-association | vpc | vpc-cidr-block-association +// | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway. +// +// 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 (https://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 ModifyTransitGatewayVpcAttachment for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTransitGatewayVpcAttachment -func (c *EC2) ModifyTransitGatewayVpcAttachment(input *ModifyTransitGatewayVpcAttachmentInput) (*ModifyTransitGatewayVpcAttachmentOutput, error) { - req, out := c.ModifyTransitGatewayVpcAttachmentRequest(input) +// API operation ModifyIdFormat for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdFormat +func (c *EC2) ModifyIdFormat(input *ModifyIdFormatInput) (*ModifyIdFormatOutput, error) { + req, out := c.ModifyIdFormatRequest(input) return out, req.Send() } -// ModifyTransitGatewayVpcAttachmentWithContext is the same as ModifyTransitGatewayVpcAttachment with the addition of +// ModifyIdFormatWithContext is the same as ModifyIdFormat with the addition of // the ability to pass a context and additional request options. // -// See ModifyTransitGatewayVpcAttachment for details on how to use this API operation. +// See ModifyIdFormat for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyTransitGatewayVpcAttachmentWithContext(ctx aws.Context, input *ModifyTransitGatewayVpcAttachmentInput, opts ...request.Option) (*ModifyTransitGatewayVpcAttachmentOutput, error) { - req, out := c.ModifyTransitGatewayVpcAttachmentRequest(input) +func (c *EC2) ModifyIdFormatWithContext(ctx aws.Context, input *ModifyIdFormatInput, opts ...request.Option) (*ModifyIdFormatOutput, error) { + req, out := c.ModifyIdFormatRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyVolume = "ModifyVolume" +const opModifyIdentityIdFormat = "ModifyIdentityIdFormat" -// ModifyVolumeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVolume operation. The "output" return +// ModifyIdentityIdFormatRequest generates a "aws/request.Request" representing the +// client's request for the ModifyIdentityIdFormat operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyVolume for more information on using the ModifyVolume +// See ModifyIdentityIdFormat for more information on using the ModifyIdentityIdFormat // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyVolumeRequest method. -// req, resp := client.ModifyVolumeRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolume -func (c *EC2) ModifyVolumeRequest(input *ModifyVolumeInput) (req *request.Request, output *ModifyVolumeOutput) { +// See also, 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: opModifyVolume, + Name: opModifyIdentityIdFormat, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyVolumeInput{} + input = &ModifyIdentityIdFormatInput{} } - output = &ModifyVolumeOutput{} + output = &ModifyIdentityIdFormatOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ModifyVolume API operation for Amazon Elastic Compute Cloud. +// ModifyIdentityIdFormat 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 (https://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 (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html). +// 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. // -// 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 (https://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 (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html#recognize-expanded-volume-windows). +// This request can only be used to modify longer ID settings for resource types +// that are within the opt-in period. Resources currently in their opt-in period +// include: bundle | conversion-task | customer-gateway | dhcp-options | elastic-ip-allocation +// | elastic-ip-association | export-task | flow-log | image | import-task | +// internet-gateway | network-acl | network-acl-association | network-interface +// | network-interface-attachment | prefix-list | route-table | route-table-association +// | security-group | subnet | subnet-cidr-block-association | vpc | vpc-cidr-block-association +// | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway. // -// 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 (https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/). -// You can also track the status of a modification using DescribeVolumesModifications. -// For information about tracking status changes using either method, see Monitoring -// Volume Modifications (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html#monitoring_mods). +// For more information, see Resource IDs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/resource-ids.html) +// in the Amazon Elastic Compute Cloud User Guide. // -// 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, see Modifying the Size, IOPS, or Type of an EBS Volume -// on Linux (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html) -// and Modifying the Size, IOPS, or Type of an EBS Volume on Windows (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html). +// This setting applies to the principal specified in the request; it does not +// apply to the principal that makes the request. // -// 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. +// 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 ModifyVolume for usage and error information. -// See also, 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) +// API operation ModifyIdentityIdFormat for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyIdentityIdFormat +func (c *EC2) ModifyIdentityIdFormat(input *ModifyIdentityIdFormatInput) (*ModifyIdentityIdFormatOutput, error) { + req, out := c.ModifyIdentityIdFormatRequest(input) return out, req.Send() } -// ModifyVolumeWithContext is the same as ModifyVolume with the addition of +// ModifyIdentityIdFormatWithContext is the same as ModifyIdentityIdFormat with the addition of // the ability to pass a context and additional request options. // -// See ModifyVolume for details on how to use this API operation. +// See ModifyIdentityIdFormat for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyVolumeWithContext(ctx aws.Context, input *ModifyVolumeInput, opts ...request.Option) (*ModifyVolumeOutput, error) { - req, out := c.ModifyVolumeRequest(input) +func (c *EC2) ModifyIdentityIdFormatWithContext(ctx aws.Context, input *ModifyIdentityIdFormatInput, opts ...request.Option) (*ModifyIdentityIdFormatOutput, error) { + req, out := c.ModifyIdentityIdFormatRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyVolumeAttribute = "ModifyVolumeAttribute" +const opModifyImageAttribute = "ModifyImageAttribute" -// ModifyVolumeAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVolumeAttribute operation. The "output" return -// value will be populated with the request's response once the request completes +// ModifyImageAttributeRequest generates a "aws/request.Request" representing the +// client's request for the ModifyImageAttribute operation. The "output" return +// value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyVolumeAttribute for more information on using the ModifyVolumeAttribute +// See ModifyImageAttribute for more information on using the ModifyImageAttribute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyVolumeAttributeRequest method. -// req, resp := client.ModifyVolumeAttributeRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolumeAttribute -func (c *EC2) ModifyVolumeAttributeRequest(input *ModifyVolumeAttributeInput) (req *request.Request, output *ModifyVolumeAttributeOutput) { +// See also, 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: opModifyVolumeAttribute, + Name: opModifyImageAttribute, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyVolumeAttributeInput{} + input = &ModifyImageAttributeInput{} } - output = &ModifyVolumeAttributeOutput{} + output = &ModifyImageAttributeOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ModifyVolumeAttribute API operation for Amazon Elastic Compute Cloud. +// ModifyImageAttribute API operation for Amazon Elastic Compute Cloud. // -// Modifies a volume attribute. +// Modifies the specified attribute of the specified AMI. You can specify only +// one attribute at a time. You can use the Attribute parameter to specify the +// attribute or one of the following parameters: Description, LaunchPermission, +// or ProductCode. // -// 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. +// AWS Marketplace product codes cannot be modified. Images with an AWS Marketplace +// product code cannot be made public. // -// 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. +// To enable the SriovNetSupport enhanced networking attribute of an image, +// enable SriovNetSupport on an instance and create an AMI from 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 Elastic Compute Cloud's -// API operation ModifyVolumeAttribute for usage and error information. -// See also, 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) +// API operation ModifyImageAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyImageAttribute +func (c *EC2) ModifyImageAttribute(input *ModifyImageAttributeInput) (*ModifyImageAttributeOutput, error) { + req, out := c.ModifyImageAttributeRequest(input) return out, req.Send() } -// ModifyVolumeAttributeWithContext is the same as ModifyVolumeAttribute with the addition of +// ModifyImageAttributeWithContext is the same as ModifyImageAttribute with the addition of // the ability to pass a context and additional request options. // -// See ModifyVolumeAttribute for details on how to use this API operation. +// See ModifyImageAttribute for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyVolumeAttributeWithContext(ctx aws.Context, input *ModifyVolumeAttributeInput, opts ...request.Option) (*ModifyVolumeAttributeOutput, error) { - req, out := c.ModifyVolumeAttributeRequest(input) +func (c *EC2) ModifyImageAttributeWithContext(ctx aws.Context, input *ModifyImageAttributeInput, opts ...request.Option) (*ModifyImageAttributeOutput, error) { + req, out := c.ModifyImageAttributeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyVpcAttribute = "ModifyVpcAttribute" +const opModifyInstanceAttribute = "ModifyInstanceAttribute" -// ModifyVpcAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcAttribute operation. The "output" return +// ModifyInstanceAttributeRequest generates a "aws/request.Request" representing the +// client's request for the ModifyInstanceAttribute operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyVpcAttribute for more information on using the ModifyVpcAttribute +// See ModifyInstanceAttribute for more information on using the ModifyInstanceAttribute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyVpcAttributeRequest method. -// req, resp := client.ModifyVpcAttributeRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcAttribute -func (c *EC2) ModifyVpcAttributeRequest(input *ModifyVpcAttributeInput) (req *request.Request, output *ModifyVpcAttributeOutput) { +// See also, 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: opModifyVpcAttribute, + Name: opModifyInstanceAttribute, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyVpcAttributeInput{} + input = &ModifyInstanceAttributeInput{} } - output = &ModifyVpcAttributeOutput{} + output = &ModifyInstanceAttributeOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ModifyVpcAttribute API operation for Amazon Elastic Compute Cloud. +// ModifyInstanceAttribute API operation for Amazon Elastic Compute Cloud. // -// Modifies the specified attribute of the specified VPC. +// Modifies the specified attribute of the specified instance. You can specify +// only one attribute at a time. +// +// Note: Using this action to change the security groups associated with an +// elastic network interface (ENI) attached to an instance in a VPC can result +// in an error if the instance has more than one ENI. To change the security +// groups associated with an ENI attached to an instance that has multiple ENIs, +// we recommend that you use the ModifyNetworkInterfaceAttribute action. +// +// To modify some attributes, the instance must be stopped. For more information, +// see Modifying Attributes of a Stopped Instance (https://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 ModifyVpcAttribute for usage and error information. -// See also, 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) +// API operation ModifyInstanceAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceAttribute +func (c *EC2) ModifyInstanceAttribute(input *ModifyInstanceAttributeInput) (*ModifyInstanceAttributeOutput, error) { + req, out := c.ModifyInstanceAttributeRequest(input) return out, req.Send() } -// ModifyVpcAttributeWithContext is the same as ModifyVpcAttribute with the addition of +// ModifyInstanceAttributeWithContext is the same as ModifyInstanceAttribute with the addition of // the ability to pass a context and additional request options. // -// See ModifyVpcAttribute for details on how to use this API operation. +// See ModifyInstanceAttribute for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyVpcAttributeWithContext(ctx aws.Context, input *ModifyVpcAttributeInput, opts ...request.Option) (*ModifyVpcAttributeOutput, error) { - req, out := c.ModifyVpcAttributeRequest(input) +func (c *EC2) ModifyInstanceAttributeWithContext(ctx aws.Context, input *ModifyInstanceAttributeInput, opts ...request.Option) (*ModifyInstanceAttributeOutput, error) { + req, out := c.ModifyInstanceAttributeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyVpcEndpoint = "ModifyVpcEndpoint" +const opModifyInstanceCapacityReservationAttributes = "ModifyInstanceCapacityReservationAttributes" -// ModifyVpcEndpointRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcEndpoint operation. The "output" return +// ModifyInstanceCapacityReservationAttributesRequest generates a "aws/request.Request" representing the +// client's request for the ModifyInstanceCapacityReservationAttributes operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyVpcEndpoint for more information on using the ModifyVpcEndpoint +// See ModifyInstanceCapacityReservationAttributes for more information on using the ModifyInstanceCapacityReservationAttributes // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyVpcEndpointRequest method. -// req, resp := client.ModifyVpcEndpointRequest(params) +// // Example sending a request using the ModifyInstanceCapacityReservationAttributesRequest method. +// req, resp := client.ModifyInstanceCapacityReservationAttributesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpoint -func (c *EC2) ModifyVpcEndpointRequest(input *ModifyVpcEndpointInput) (req *request.Request, output *ModifyVpcEndpointOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceCapacityReservationAttributes +func (c *EC2) ModifyInstanceCapacityReservationAttributesRequest(input *ModifyInstanceCapacityReservationAttributesInput) (req *request.Request, output *ModifyInstanceCapacityReservationAttributesOutput) { op := &request.Operation{ - Name: opModifyVpcEndpoint, + Name: opModifyInstanceCapacityReservationAttributes, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyVpcEndpointInput{} + input = &ModifyInstanceCapacityReservationAttributesInput{} } - output = &ModifyVpcEndpointOutput{} + output = &ModifyInstanceCapacityReservationAttributesOutput{} req = c.newRequest(op, input, output) return } -// ModifyVpcEndpoint API operation for Amazon Elastic Compute Cloud. +// ModifyInstanceCapacityReservationAttributes API operation for Amazon Elastic Compute Cloud. // -// Modifies attributes of a specified VPC endpoint. The attributes that you -// can modify depend on the type of VPC endpoint (interface or gateway). For -// more information, see VPC Endpoints (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.html) -// in the Amazon Virtual Private Cloud User Guide. +// Modifies the Capacity Reservation settings for a stopped instance. Use this +// action to configure an instance to target a specific Capacity Reservation, +// run in any open Capacity Reservation with matching attributes, or run On-Demand +// Instance capacity. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation ModifyInstanceCapacityReservationAttributes for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceCapacityReservationAttributes +func (c *EC2) ModifyInstanceCapacityReservationAttributes(input *ModifyInstanceCapacityReservationAttributesInput) (*ModifyInstanceCapacityReservationAttributesOutput, error) { + req, out := c.ModifyInstanceCapacityReservationAttributesRequest(input) return out, req.Send() } -// ModifyVpcEndpointWithContext is the same as ModifyVpcEndpoint with the addition of +// ModifyInstanceCapacityReservationAttributesWithContext is the same as ModifyInstanceCapacityReservationAttributes with the addition of // the ability to pass a context and additional request options. // -// See ModifyVpcEndpoint for details on how to use this API operation. +// See ModifyInstanceCapacityReservationAttributes for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyVpcEndpointWithContext(ctx aws.Context, input *ModifyVpcEndpointInput, opts ...request.Option) (*ModifyVpcEndpointOutput, error) { - req, out := c.ModifyVpcEndpointRequest(input) +func (c *EC2) ModifyInstanceCapacityReservationAttributesWithContext(ctx aws.Context, input *ModifyInstanceCapacityReservationAttributesInput, opts ...request.Option) (*ModifyInstanceCapacityReservationAttributesOutput, error) { + req, out := c.ModifyInstanceCapacityReservationAttributesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyVpcEndpointConnectionNotification = "ModifyVpcEndpointConnectionNotification" +const opModifyInstanceCreditSpecification = "ModifyInstanceCreditSpecification" -// ModifyVpcEndpointConnectionNotificationRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcEndpointConnectionNotification operation. The "output" return +// ModifyInstanceCreditSpecificationRequest generates a "aws/request.Request" representing the +// client's request for the ModifyInstanceCreditSpecification operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyVpcEndpointConnectionNotification for more information on using the ModifyVpcEndpointConnectionNotification +// See ModifyInstanceCreditSpecification for more information on using the ModifyInstanceCreditSpecification // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyVpcEndpointConnectionNotificationRequest method. -// req, resp := client.ModifyVpcEndpointConnectionNotificationRequest(params) +// // Example sending a request using the ModifyInstanceCreditSpecificationRequest method. +// req, resp := client.ModifyInstanceCreditSpecificationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointConnectionNotification -func (c *EC2) ModifyVpcEndpointConnectionNotificationRequest(input *ModifyVpcEndpointConnectionNotificationInput) (req *request.Request, output *ModifyVpcEndpointConnectionNotificationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceCreditSpecification +func (c *EC2) ModifyInstanceCreditSpecificationRequest(input *ModifyInstanceCreditSpecificationInput) (req *request.Request, output *ModifyInstanceCreditSpecificationOutput) { op := &request.Operation{ - Name: opModifyVpcEndpointConnectionNotification, + Name: opModifyInstanceCreditSpecification, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyVpcEndpointConnectionNotificationInput{} + input = &ModifyInstanceCreditSpecificationInput{} } - output = &ModifyVpcEndpointConnectionNotificationOutput{} + output = &ModifyInstanceCreditSpecificationOutput{} req = c.newRequest(op, input, output) return } -// ModifyVpcEndpointConnectionNotification API operation for Amazon Elastic Compute Cloud. +// ModifyInstanceCreditSpecification API operation for Amazon Elastic Compute Cloud. // -// Modifies a connection notification for VPC endpoint or VPC endpoint service. -// You can change the SNS topic for the notification, or the events for which -// to be notified. +// Modifies the credit option for CPU usage on a running or stopped burstable +// performance instance. The credit options are standard and unlimited. +// +// For more information, see Burstable Performance Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-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 ModifyVpcEndpointConnectionNotification for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointConnectionNotification -func (c *EC2) ModifyVpcEndpointConnectionNotification(input *ModifyVpcEndpointConnectionNotificationInput) (*ModifyVpcEndpointConnectionNotificationOutput, error) { - req, out := c.ModifyVpcEndpointConnectionNotificationRequest(input) +// API operation ModifyInstanceCreditSpecification for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceCreditSpecification +func (c *EC2) ModifyInstanceCreditSpecification(input *ModifyInstanceCreditSpecificationInput) (*ModifyInstanceCreditSpecificationOutput, error) { + req, out := c.ModifyInstanceCreditSpecificationRequest(input) return out, req.Send() } -// ModifyVpcEndpointConnectionNotificationWithContext is the same as ModifyVpcEndpointConnectionNotification with the addition of +// ModifyInstanceCreditSpecificationWithContext is the same as ModifyInstanceCreditSpecification with the addition of // the ability to pass a context and additional request options. // -// See ModifyVpcEndpointConnectionNotification for details on how to use this API operation. +// See ModifyInstanceCreditSpecification for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyVpcEndpointConnectionNotificationWithContext(ctx aws.Context, input *ModifyVpcEndpointConnectionNotificationInput, opts ...request.Option) (*ModifyVpcEndpointConnectionNotificationOutput, error) { - req, out := c.ModifyVpcEndpointConnectionNotificationRequest(input) +func (c *EC2) ModifyInstanceCreditSpecificationWithContext(ctx aws.Context, input *ModifyInstanceCreditSpecificationInput, opts ...request.Option) (*ModifyInstanceCreditSpecificationOutput, error) { + req, out := c.ModifyInstanceCreditSpecificationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyVpcEndpointServiceConfiguration = "ModifyVpcEndpointServiceConfiguration" +const opModifyInstanceEventStartTime = "ModifyInstanceEventStartTime" -// ModifyVpcEndpointServiceConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcEndpointServiceConfiguration operation. The "output" return +// ModifyInstanceEventStartTimeRequest generates a "aws/request.Request" representing the +// client's request for the ModifyInstanceEventStartTime operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyVpcEndpointServiceConfiguration for more information on using the ModifyVpcEndpointServiceConfiguration +// See ModifyInstanceEventStartTime for more information on using the ModifyInstanceEventStartTime // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyVpcEndpointServiceConfigurationRequest method. -// req, resp := client.ModifyVpcEndpointServiceConfigurationRequest(params) +// // Example sending a request using the ModifyInstanceEventStartTimeRequest method. +// req, resp := client.ModifyInstanceEventStartTimeRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointServiceConfiguration -func (c *EC2) ModifyVpcEndpointServiceConfigurationRequest(input *ModifyVpcEndpointServiceConfigurationInput) (req *request.Request, output *ModifyVpcEndpointServiceConfigurationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceEventStartTime +func (c *EC2) ModifyInstanceEventStartTimeRequest(input *ModifyInstanceEventStartTimeInput) (req *request.Request, output *ModifyInstanceEventStartTimeOutput) { op := &request.Operation{ - Name: opModifyVpcEndpointServiceConfiguration, + Name: opModifyInstanceEventStartTime, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyVpcEndpointServiceConfigurationInput{} + input = &ModifyInstanceEventStartTimeInput{} } - output = &ModifyVpcEndpointServiceConfigurationOutput{} + output = &ModifyInstanceEventStartTimeOutput{} req = c.newRequest(op, input, output) return } -// ModifyVpcEndpointServiceConfiguration API operation for Amazon Elastic Compute Cloud. +// ModifyInstanceEventStartTime API operation for Amazon Elastic Compute Cloud. // -// Modifies the attributes of your VPC endpoint service configuration. You can -// change the Network Load Balancers for your service, and you can specify whether -// acceptance is required for requests to connect to your endpoint service through -// an interface VPC endpoint. +// Modifies the start time for a scheduled Amazon EC2 instance 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 ModifyVpcEndpointServiceConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointServiceConfiguration -func (c *EC2) ModifyVpcEndpointServiceConfiguration(input *ModifyVpcEndpointServiceConfigurationInput) (*ModifyVpcEndpointServiceConfigurationOutput, error) { - req, out := c.ModifyVpcEndpointServiceConfigurationRequest(input) +// API operation ModifyInstanceEventStartTime for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceEventStartTime +func (c *EC2) ModifyInstanceEventStartTime(input *ModifyInstanceEventStartTimeInput) (*ModifyInstanceEventStartTimeOutput, error) { + req, out := c.ModifyInstanceEventStartTimeRequest(input) return out, req.Send() } -// ModifyVpcEndpointServiceConfigurationWithContext is the same as ModifyVpcEndpointServiceConfiguration with the addition of +// ModifyInstanceEventStartTimeWithContext is the same as ModifyInstanceEventStartTime with the addition of // the ability to pass a context and additional request options. // -// See ModifyVpcEndpointServiceConfiguration for details on how to use this API operation. +// See ModifyInstanceEventStartTime for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyVpcEndpointServiceConfigurationWithContext(ctx aws.Context, input *ModifyVpcEndpointServiceConfigurationInput, opts ...request.Option) (*ModifyVpcEndpointServiceConfigurationOutput, error) { - req, out := c.ModifyVpcEndpointServiceConfigurationRequest(input) +func (c *EC2) ModifyInstanceEventStartTimeWithContext(ctx aws.Context, input *ModifyInstanceEventStartTimeInput, opts ...request.Option) (*ModifyInstanceEventStartTimeOutput, error) { + req, out := c.ModifyInstanceEventStartTimeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyVpcEndpointServicePermissions = "ModifyVpcEndpointServicePermissions" +const opModifyInstanceMetadataOptions = "ModifyInstanceMetadataOptions" -// ModifyVpcEndpointServicePermissionsRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcEndpointServicePermissions operation. The "output" return +// ModifyInstanceMetadataOptionsRequest generates a "aws/request.Request" representing the +// client's request for the ModifyInstanceMetadataOptions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyVpcEndpointServicePermissions for more information on using the ModifyVpcEndpointServicePermissions +// See ModifyInstanceMetadataOptions for more information on using the ModifyInstanceMetadataOptions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyVpcEndpointServicePermissionsRequest method. -// req, resp := client.ModifyVpcEndpointServicePermissionsRequest(params) +// // Example sending a request using the ModifyInstanceMetadataOptionsRequest method. +// req, resp := client.ModifyInstanceMetadataOptionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointServicePermissions -func (c *EC2) ModifyVpcEndpointServicePermissionsRequest(input *ModifyVpcEndpointServicePermissionsInput) (req *request.Request, output *ModifyVpcEndpointServicePermissionsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceMetadataOptions +func (c *EC2) ModifyInstanceMetadataOptionsRequest(input *ModifyInstanceMetadataOptionsInput) (req *request.Request, output *ModifyInstanceMetadataOptionsOutput) { op := &request.Operation{ - Name: opModifyVpcEndpointServicePermissions, + Name: opModifyInstanceMetadataOptions, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyVpcEndpointServicePermissionsInput{} + input = &ModifyInstanceMetadataOptionsInput{} } - output = &ModifyVpcEndpointServicePermissionsOutput{} + output = &ModifyInstanceMetadataOptionsOutput{} req = c.newRequest(op, input, output) return } -// ModifyVpcEndpointServicePermissions API operation for Amazon Elastic Compute Cloud. -// -// Modifies the permissions for your VPC endpoint service (https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-service.html). -// You can add or remove permissions for service consumers (IAM users, IAM roles, -// and AWS accounts) to connect to your endpoint service. +// ModifyInstanceMetadataOptions API operation for Amazon Elastic Compute Cloud. // -// If you grant permissions to all principals, the service is public. Any users -// who know the name of a public service can send a request to attach an endpoint. -// If the service does not require manual approval, attachments are automatically -// approved. +// Modify the instance metadata parameters on a running or stopped instance. +// When you modify the parameters on a stopped instance, they are applied when +// the instance is started. When you modify the parameters on a running instance, +// the API responds with a state of “pending”. After the parameter modifications +// are successfully applied to the instance, the state of the modifications +// changes from “pending” to “applied” in subsequent describe-instances +// API calls. For more information, see Instance Metadata and User Data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.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 ModifyVpcEndpointServicePermissions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointServicePermissions -func (c *EC2) ModifyVpcEndpointServicePermissions(input *ModifyVpcEndpointServicePermissionsInput) (*ModifyVpcEndpointServicePermissionsOutput, error) { - req, out := c.ModifyVpcEndpointServicePermissionsRequest(input) +// API operation ModifyInstanceMetadataOptions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceMetadataOptions +func (c *EC2) ModifyInstanceMetadataOptions(input *ModifyInstanceMetadataOptionsInput) (*ModifyInstanceMetadataOptionsOutput, error) { + req, out := c.ModifyInstanceMetadataOptionsRequest(input) return out, req.Send() } -// ModifyVpcEndpointServicePermissionsWithContext is the same as ModifyVpcEndpointServicePermissions with the addition of +// ModifyInstanceMetadataOptionsWithContext is the same as ModifyInstanceMetadataOptions with the addition of // the ability to pass a context and additional request options. // -// See ModifyVpcEndpointServicePermissions for details on how to use this API operation. +// See ModifyInstanceMetadataOptions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyVpcEndpointServicePermissionsWithContext(ctx aws.Context, input *ModifyVpcEndpointServicePermissionsInput, opts ...request.Option) (*ModifyVpcEndpointServicePermissionsOutput, error) { - req, out := c.ModifyVpcEndpointServicePermissionsRequest(input) +func (c *EC2) ModifyInstanceMetadataOptionsWithContext(ctx aws.Context, input *ModifyInstanceMetadataOptionsInput, opts ...request.Option) (*ModifyInstanceMetadataOptionsOutput, error) { + req, out := c.ModifyInstanceMetadataOptionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyVpcPeeringConnectionOptions = "ModifyVpcPeeringConnectionOptions" +const opModifyInstancePlacement = "ModifyInstancePlacement" -// ModifyVpcPeeringConnectionOptionsRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcPeeringConnectionOptions operation. The "output" return +// ModifyInstancePlacementRequest generates a "aws/request.Request" representing the +// client's request for the ModifyInstancePlacement operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyVpcPeeringConnectionOptions for more information on using the ModifyVpcPeeringConnectionOptions +// See ModifyInstancePlacement for more information on using the ModifyInstancePlacement // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyVpcPeeringConnectionOptionsRequest method. -// req, resp := client.ModifyVpcPeeringConnectionOptionsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcPeeringConnectionOptions -func (c *EC2) ModifyVpcPeeringConnectionOptionsRequest(input *ModifyVpcPeeringConnectionOptionsInput) (req *request.Request, output *ModifyVpcPeeringConnectionOptionsOutput) { +// See also, 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: opModifyVpcPeeringConnectionOptions, + Name: opModifyInstancePlacement, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyVpcPeeringConnectionOptionsInput{} + input = &ModifyInstancePlacementInput{} } - output = &ModifyVpcPeeringConnectionOptionsOutput{} + output = &ModifyInstancePlacementOutput{} req = c.newRequest(op, input, output) return } -// ModifyVpcPeeringConnectionOptions API operation for Amazon Elastic Compute Cloud. +// ModifyInstancePlacement 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: +// Modifies the placement attributes for a specified instance. 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. +// * Modify the affinity between an instance and a Dedicated Host (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-overview.html). +// When affinity is set to host and the instance is not associated with a +// specific Dedicated Host, the next time the instance is launched, it is +// automatically associated with the host on which it lands. If the instance +// is restarted or rebooted, this relationship persists. // -// * Enable/disable communication over the peering connection between instances -// in your VPC and an EC2-Classic instance that's linked to the peer VPC. +// * Change the Dedicated Host with which an instance is associated. // -// * Enable/disable the ability to resolve public DNS hostnames to private -// IP addresses when queried from instances in the peer VPC. +// * Change the instance tenancy of an instance from host to dedicated, or +// from dedicated to host. // -// If the peered VPCs are in the same AWS account, you can enable DNS resolution -// for queries from the local VPC. This ensures that queries from the local -// VPC resolve to private IP addresses in the peer VPC. This option is not available -// if the peered VPCs are in different AWS accounts or different Regions. For -// peered VPCs in different AWS accounts, each AWS account owner must initiate -// a separate request to modify the peering connection options. For inter-region -// peering connections, you must use the Region for the requester VPC to modify -// the requester VPC peering options and the Region for the accepter VPC to -// modify the accepter VPC peering options. To verify which VPCs are the accepter -// and the requester for a VPC peering connection, use the DescribeVpcPeeringConnections -// command. +// * Move an instance to or from a placement group (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/placement-groups.html). +// +// At least one attribute for affinity, host ID, tenancy, or placement group +// name must be specified in the request. Affinity and tenancy can be modified +// in the same request. +// +// To modify the host ID, tenancy, placement group, or partition for an instance, +// the instance must be in the stopped 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 ModifyVpcPeeringConnectionOptions for usage and error information. -// See also, 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) +// API operation ModifyInstancePlacement for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstancePlacement +func (c *EC2) ModifyInstancePlacement(input *ModifyInstancePlacementInput) (*ModifyInstancePlacementOutput, error) { + req, out := c.ModifyInstancePlacementRequest(input) return out, req.Send() } -// ModifyVpcPeeringConnectionOptionsWithContext is the same as ModifyVpcPeeringConnectionOptions with the addition of +// ModifyInstancePlacementWithContext is the same as ModifyInstancePlacement with the addition of // the ability to pass a context and additional request options. // -// See ModifyVpcPeeringConnectionOptions for details on how to use this API operation. +// See ModifyInstancePlacement for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyVpcPeeringConnectionOptionsWithContext(ctx aws.Context, input *ModifyVpcPeeringConnectionOptionsInput, opts ...request.Option) (*ModifyVpcPeeringConnectionOptionsOutput, error) { - req, out := c.ModifyVpcPeeringConnectionOptionsRequest(input) +func (c *EC2) ModifyInstancePlacementWithContext(ctx aws.Context, input *ModifyInstancePlacementInput, opts ...request.Option) (*ModifyInstancePlacementOutput, error) { + req, out := c.ModifyInstancePlacementRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyVpcTenancy = "ModifyVpcTenancy" +const opModifyLaunchTemplate = "ModifyLaunchTemplate" -// ModifyVpcTenancyRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpcTenancy operation. The "output" return +// ModifyLaunchTemplateRequest generates a "aws/request.Request" representing the +// client's request for the ModifyLaunchTemplate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyVpcTenancy for more information on using the ModifyVpcTenancy +// See ModifyLaunchTemplate for more information on using the ModifyLaunchTemplate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyVpcTenancyRequest method. -// req, resp := client.ModifyVpcTenancyRequest(params) +// // Example sending a request using the ModifyLaunchTemplateRequest method. +// req, resp := client.ModifyLaunchTemplateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcTenancy -func (c *EC2) ModifyVpcTenancyRequest(input *ModifyVpcTenancyInput) (req *request.Request, output *ModifyVpcTenancyOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyLaunchTemplate +func (c *EC2) ModifyLaunchTemplateRequest(input *ModifyLaunchTemplateInput) (req *request.Request, output *ModifyLaunchTemplateOutput) { op := &request.Operation{ - Name: opModifyVpcTenancy, + Name: opModifyLaunchTemplate, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyVpcTenancyInput{} + input = &ModifyLaunchTemplateInput{} } - output = &ModifyVpcTenancyOutput{} + output = &ModifyLaunchTemplateOutput{} req = c.newRequest(op, input, output) return } -// ModifyVpcTenancy API operation for Amazon Elastic Compute Cloud. -// -// Modifies the instance tenancy attribute of the specified VPC. You can change -// the instance tenancy attribute of a VPC to default only. You cannot change -// the instance tenancy attribute to dedicated. -// -// After you modify the tenancy of the VPC, any new instances that you launch -// into the VPC have a tenancy of default, unless you specify otherwise during -// launch. The tenancy of any existing instances in the VPC is not affected. +// ModifyLaunchTemplate API operation for Amazon Elastic Compute Cloud. // -// For more information, see Dedicated Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-instance.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Modifies a launch template. You can specify which version of the launch template +// to set as the default version. When launching an instance, the default version +// applies when a launch template version is 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 Amazon Elastic Compute Cloud's -// API operation ModifyVpcTenancy for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcTenancy -func (c *EC2) ModifyVpcTenancy(input *ModifyVpcTenancyInput) (*ModifyVpcTenancyOutput, error) { - req, out := c.ModifyVpcTenancyRequest(input) +// API operation ModifyLaunchTemplate for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyLaunchTemplate +func (c *EC2) ModifyLaunchTemplate(input *ModifyLaunchTemplateInput) (*ModifyLaunchTemplateOutput, error) { + req, out := c.ModifyLaunchTemplateRequest(input) return out, req.Send() } -// ModifyVpcTenancyWithContext is the same as ModifyVpcTenancy with the addition of +// ModifyLaunchTemplateWithContext is the same as ModifyLaunchTemplate with the addition of // the ability to pass a context and additional request options. // -// See ModifyVpcTenancy for details on how to use this API operation. +// See ModifyLaunchTemplate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyVpcTenancyWithContext(ctx aws.Context, input *ModifyVpcTenancyInput, opts ...request.Option) (*ModifyVpcTenancyOutput, error) { - req, out := c.ModifyVpcTenancyRequest(input) +func (c *EC2) ModifyLaunchTemplateWithContext(ctx aws.Context, input *ModifyLaunchTemplateInput, opts ...request.Option) (*ModifyLaunchTemplateOutput, error) { + req, out := c.ModifyLaunchTemplateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyVpnConnection = "ModifyVpnConnection" +const opModifyNetworkInterfaceAttribute = "ModifyNetworkInterfaceAttribute" -// ModifyVpnConnectionRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpnConnection operation. The "output" return +// ModifyNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the +// client's request for the ModifyNetworkInterfaceAttribute operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyVpnConnection for more information on using the ModifyVpnConnection +// See ModifyNetworkInterfaceAttribute for more information on using the ModifyNetworkInterfaceAttribute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyVpnConnectionRequest method. -// req, resp := client.ModifyVpnConnectionRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnConnection -func (c *EC2) ModifyVpnConnectionRequest(input *ModifyVpnConnectionInput) (req *request.Request, output *ModifyVpnConnectionOutput) { +// See also, 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: opModifyVpnConnection, + Name: opModifyNetworkInterfaceAttribute, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyVpnConnectionInput{} + input = &ModifyNetworkInterfaceAttributeInput{} } - output = &ModifyVpnConnectionOutput{} + output = &ModifyNetworkInterfaceAttributeOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ModifyVpnConnection API operation for Amazon Elastic Compute Cloud. -// -// Modifies the target gateway of an AWS Site-to-Site VPN connection. The following -// migration options are available: -// -// * An existing virtual private gateway to a new virtual private gateway -// -// * An existing virtual private gateway to a transit gateway -// -// * An existing transit gateway to a new transit gateway -// -// * An existing transit gateway to a virtual private gateway -// -// Before you perform the migration to the new gateway, you must configure the -// new gateway. Use CreateVpnGateway to create a virtual private gateway, or -// CreateTransitGateway to create a transit gateway. -// -// This step is required when you migrate from a virtual private gateway with -// static routes to a transit gateway. -// -// You must delete the static routes before you migrate to the new gateway. -// -// Keep a copy of the static route before you delete it. You will need to add -// back these routes to the transit gateway after the VPN connection migration -// is complete. -// -// After you migrate to the new gateway, you might need to modify your VPC route -// table. Use CreateRoute and DeleteRoute to make the changes described in VPN -// Gateway Target Modification Required VPC Route Table Updates (https://docs.aws.amazon.com/vpn/latest/s2svpn/modify-vpn-target.html#step-update-routing) -// in the AWS Site-to-Site VPN User Guide. -// -// When the new gateway is a transit gateway, modify the transit gateway route -// table to allow traffic between the VPC and the AWS Site-to-Site VPN connection. -// Use CreateTransitGatewayRoute to add the routes. -// -// If you deleted VPN static routes, you must add the static routes to the transit -// gateway route table. +// ModifyNetworkInterfaceAttribute API operation for Amazon Elastic Compute Cloud. // -// After you perform this operation, the AWS VPN endpoint's IP addresses on -// the AWS side and the tunnel options remain intact. Your s2slong; connection -// will be temporarily unavailable for approximately 10 minutes while we provision -// the new endpoints +// Modifies the specified network interface attribute. You can specify only +// one attribute at a time. You can use this action to attach and detach security +// groups from an existing 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 Amazon Elastic Compute Cloud's -// API operation ModifyVpnConnection for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnConnection -func (c *EC2) ModifyVpnConnection(input *ModifyVpnConnectionInput) (*ModifyVpnConnectionOutput, error) { - req, out := c.ModifyVpnConnectionRequest(input) +// API operation ModifyNetworkInterfaceAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyNetworkInterfaceAttribute +func (c *EC2) ModifyNetworkInterfaceAttribute(input *ModifyNetworkInterfaceAttributeInput) (*ModifyNetworkInterfaceAttributeOutput, error) { + req, out := c.ModifyNetworkInterfaceAttributeRequest(input) return out, req.Send() } -// ModifyVpnConnectionWithContext is the same as ModifyVpnConnection with the addition of +// ModifyNetworkInterfaceAttributeWithContext is the same as ModifyNetworkInterfaceAttribute with the addition of // the ability to pass a context and additional request options. // -// See ModifyVpnConnection for details on how to use this API operation. +// See ModifyNetworkInterfaceAttribute for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyVpnConnectionWithContext(ctx aws.Context, input *ModifyVpnConnectionInput, opts ...request.Option) (*ModifyVpnConnectionOutput, error) { - req, out := c.ModifyVpnConnectionRequest(input) +func (c *EC2) ModifyNetworkInterfaceAttributeWithContext(ctx aws.Context, input *ModifyNetworkInterfaceAttributeInput, opts ...request.Option) (*ModifyNetworkInterfaceAttributeOutput, error) { + req, out := c.ModifyNetworkInterfaceAttributeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyVpnTunnelCertificate = "ModifyVpnTunnelCertificate" +const opModifyReservedInstances = "ModifyReservedInstances" -// ModifyVpnTunnelCertificateRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpnTunnelCertificate operation. The "output" return +// ModifyReservedInstancesRequest generates a "aws/request.Request" representing the +// client's request for the ModifyReservedInstances operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyVpnTunnelCertificate for more information on using the ModifyVpnTunnelCertificate +// See ModifyReservedInstances for more information on using the ModifyReservedInstances // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyVpnTunnelCertificateRequest method. -// req, resp := client.ModifyVpnTunnelCertificateRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnTunnelCertificate -func (c *EC2) ModifyVpnTunnelCertificateRequest(input *ModifyVpnTunnelCertificateInput) (req *request.Request, output *ModifyVpnTunnelCertificateOutput) { +// See also, 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: opModifyVpnTunnelCertificate, + Name: opModifyReservedInstances, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyVpnTunnelCertificateInput{} + input = &ModifyReservedInstancesInput{} } - output = &ModifyVpnTunnelCertificateOutput{} + output = &ModifyReservedInstancesOutput{} req = c.newRequest(op, input, output) return } -// ModifyVpnTunnelCertificate API operation for Amazon Elastic Compute Cloud. +// ModifyReservedInstances API operation for Amazon Elastic Compute Cloud. // -// Modifies the VPN tunnel endpoint certificate. +// Modifies the Availability Zone, instance count, instance type, or network +// platform (EC2-Classic or EC2-VPC) of your 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 (https://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 ModifyVpnTunnelCertificate for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnTunnelCertificate -func (c *EC2) ModifyVpnTunnelCertificate(input *ModifyVpnTunnelCertificateInput) (*ModifyVpnTunnelCertificateOutput, error) { - req, out := c.ModifyVpnTunnelCertificateRequest(input) +// API operation ModifyReservedInstances for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyReservedInstances +func (c *EC2) ModifyReservedInstances(input *ModifyReservedInstancesInput) (*ModifyReservedInstancesOutput, error) { + req, out := c.ModifyReservedInstancesRequest(input) return out, req.Send() } -// ModifyVpnTunnelCertificateWithContext is the same as ModifyVpnTunnelCertificate with the addition of +// ModifyReservedInstancesWithContext is the same as ModifyReservedInstances with the addition of // the ability to pass a context and additional request options. // -// See ModifyVpnTunnelCertificate for details on how to use this API operation. +// See ModifyReservedInstances for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyVpnTunnelCertificateWithContext(ctx aws.Context, input *ModifyVpnTunnelCertificateInput, opts ...request.Option) (*ModifyVpnTunnelCertificateOutput, error) { - req, out := c.ModifyVpnTunnelCertificateRequest(input) +func (c *EC2) ModifyReservedInstancesWithContext(ctx aws.Context, input *ModifyReservedInstancesInput, opts ...request.Option) (*ModifyReservedInstancesOutput, error) { + req, out := c.ModifyReservedInstancesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyVpnTunnelOptions = "ModifyVpnTunnelOptions" +const opModifySnapshotAttribute = "ModifySnapshotAttribute" -// ModifyVpnTunnelOptionsRequest generates a "aws/request.Request" representing the -// client's request for the ModifyVpnTunnelOptions operation. The "output" return +// ModifySnapshotAttributeRequest generates a "aws/request.Request" representing the +// client's request for the ModifySnapshotAttribute operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyVpnTunnelOptions for more information on using the ModifyVpnTunnelOptions +// See ModifySnapshotAttribute for more information on using the ModifySnapshotAttribute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyVpnTunnelOptionsRequest method. -// req, resp := client.ModifyVpnTunnelOptionsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnTunnelOptions -func (c *EC2) ModifyVpnTunnelOptionsRequest(input *ModifyVpnTunnelOptionsInput) (req *request.Request, output *ModifyVpnTunnelOptionsOutput) { +// See also, 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: opModifyVpnTunnelOptions, + Name: opModifySnapshotAttribute, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyVpnTunnelOptionsInput{} + input = &ModifySnapshotAttributeInput{} } - output = &ModifyVpnTunnelOptionsOutput{} + output = &ModifySnapshotAttributeOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ModifyVpnTunnelOptions API operation for Amazon Elastic Compute Cloud. +// ModifySnapshotAttribute API operation for Amazon Elastic Compute Cloud. // -// Modifies the options for a VPN tunnel in an AWS Site-to-Site VPN connection. -// You can modify multiple options for a tunnel in a single request, but you -// can only modify one tunnel at a time. For more information, see Site-to-Site -// VPN Tunnel Options for Your Site-to-Site VPN Connection (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPNTunnels.html) -// in the AWS Site-to-Site VPN User Guide. +// 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 operation. If you need to +// both add and remove account IDs for a snapshot, you must use multiple operations. +// You can make up to 500 modifications to a snapshot in a single operation. +// +// 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 about modifying snapshot permissions, see Sharing Snapshots +// (https://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 ModifyVpnTunnelOptions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnTunnelOptions -func (c *EC2) ModifyVpnTunnelOptions(input *ModifyVpnTunnelOptionsInput) (*ModifyVpnTunnelOptionsOutput, error) { - req, out := c.ModifyVpnTunnelOptionsRequest(input) +// API operation ModifySnapshotAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySnapshotAttribute +func (c *EC2) ModifySnapshotAttribute(input *ModifySnapshotAttributeInput) (*ModifySnapshotAttributeOutput, error) { + req, out := c.ModifySnapshotAttributeRequest(input) return out, req.Send() } -// ModifyVpnTunnelOptionsWithContext is the same as ModifyVpnTunnelOptions with the addition of +// ModifySnapshotAttributeWithContext is the same as ModifySnapshotAttribute with the addition of // the ability to pass a context and additional request options. // -// See ModifyVpnTunnelOptions for details on how to use this API operation. +// See ModifySnapshotAttribute for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ModifyVpnTunnelOptionsWithContext(ctx aws.Context, input *ModifyVpnTunnelOptionsInput, opts ...request.Option) (*ModifyVpnTunnelOptionsOutput, error) { - req, out := c.ModifyVpnTunnelOptionsRequest(input) +func (c *EC2) ModifySnapshotAttributeWithContext(ctx aws.Context, input *ModifySnapshotAttributeInput, opts ...request.Option) (*ModifySnapshotAttributeOutput, error) { + req, out := c.ModifySnapshotAttributeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opMonitorInstances = "MonitorInstances" +const opModifySpotFleetRequest = "ModifySpotFleetRequest" -// MonitorInstancesRequest generates a "aws/request.Request" representing the -// client's request for the MonitorInstances operation. The "output" return +// ModifySpotFleetRequestRequest generates a "aws/request.Request" representing the +// client's request for the ModifySpotFleetRequest operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See MonitorInstances for more information on using the MonitorInstances +// See ModifySpotFleetRequest for more information on using the ModifySpotFleetRequest // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the MonitorInstancesRequest method. -// req, resp := client.MonitorInstancesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MonitorInstances -func (c *EC2) MonitorInstancesRequest(input *MonitorInstancesInput) (req *request.Request, output *MonitorInstancesOutput) { +// See also, 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: opMonitorInstances, + Name: opModifySpotFleetRequest, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &MonitorInstancesInput{} + input = &ModifySpotFleetRequestInput{} } - output = &MonitorInstancesOutput{} + output = &ModifySpotFleetRequestOutput{} req = c.newRequest(op, input, output) return } -// MonitorInstances API operation for Amazon Elastic Compute Cloud. +// ModifySpotFleetRequest 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 -// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Modifies the specified Spot Fleet request. // -// To disable detailed monitoring, see . +// You can only modify a Spot Fleet request of type maintain. +// +// 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 Instance pool with the lowest +// price. If the allocation strategy is diversified, the Spot Fleet distributes +// the instances across the Spot Instance pools. If the allocation strategy +// is capacityOptimized, Spot Fleet launches instances from Spot Instance pools +// with optimal capacity for the number of instances that are launching. +// +// To scale down your Spot Fleet, decrease its target capacity. First, the Spot +// Fleet cancels any open requests 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 capacityOptimized, the Spot +// Fleet terminates the instances in the Spot Instance pools that have the least +// available Spot Instance capacity. If the allocation strategy is diversified, +// the Spot Fleet terminates instances across the Spot Instance 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. +// +// If you are finished with your Spot Fleet for now, but will use it again later, +// you can set the target capacity to 0. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation ModifySpotFleetRequest for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySpotFleetRequest +func (c *EC2) ModifySpotFleetRequest(input *ModifySpotFleetRequestInput) (*ModifySpotFleetRequestOutput, error) { + req, out := c.ModifySpotFleetRequestRequest(input) return out, req.Send() } -// MonitorInstancesWithContext is the same as MonitorInstances with the addition of +// ModifySpotFleetRequestWithContext is the same as ModifySpotFleetRequest with the addition of // the ability to pass a context and additional request options. // -// See MonitorInstances for details on how to use this API operation. +// See ModifySpotFleetRequest for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) MonitorInstancesWithContext(ctx aws.Context, input *MonitorInstancesInput, opts ...request.Option) (*MonitorInstancesOutput, error) { - req, out := c.MonitorInstancesRequest(input) +func (c *EC2) ModifySpotFleetRequestWithContext(ctx aws.Context, input *ModifySpotFleetRequestInput, opts ...request.Option) (*ModifySpotFleetRequestOutput, error) { + req, out := c.ModifySpotFleetRequestRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opMoveAddressToVpc = "MoveAddressToVpc" +const opModifySubnetAttribute = "ModifySubnetAttribute" -// MoveAddressToVpcRequest generates a "aws/request.Request" representing the -// client's request for the MoveAddressToVpc operation. The "output" return +// ModifySubnetAttributeRequest generates a "aws/request.Request" representing the +// client's request for the ModifySubnetAttribute operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See MoveAddressToVpc for more information on using the MoveAddressToVpc +// See ModifySubnetAttribute for more information on using the ModifySubnetAttribute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the MoveAddressToVpcRequest method. -// req, resp := client.MoveAddressToVpcRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MoveAddressToVpc -func (c *EC2) MoveAddressToVpcRequest(input *MoveAddressToVpcInput) (req *request.Request, output *MoveAddressToVpcOutput) { +// See also, 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: opMoveAddressToVpc, + Name: opModifySubnetAttribute, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &MoveAddressToVpcInput{} + input = &ModifySubnetAttributeInput{} } - output = &MoveAddressToVpcOutput{} + output = &ModifySubnetAttributeOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// MoveAddressToVpc API operation for Amazon Elastic Compute Cloud. +// ModifySubnetAttribute 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. +// 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 MoveAddressToVpc for usage and error information. -// See also, 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) +// API operation ModifySubnetAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifySubnetAttribute +func (c *EC2) ModifySubnetAttribute(input *ModifySubnetAttributeInput) (*ModifySubnetAttributeOutput, error) { + req, out := c.ModifySubnetAttributeRequest(input) return out, req.Send() } -// MoveAddressToVpcWithContext is the same as MoveAddressToVpc with the addition of +// ModifySubnetAttributeWithContext is the same as ModifySubnetAttribute with the addition of // the ability to pass a context and additional request options. // -// See MoveAddressToVpc for details on how to use this API operation. +// See ModifySubnetAttribute for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) MoveAddressToVpcWithContext(ctx aws.Context, input *MoveAddressToVpcInput, opts ...request.Option) (*MoveAddressToVpcOutput, error) { - req, out := c.MoveAddressToVpcRequest(input) +func (c *EC2) ModifySubnetAttributeWithContext(ctx aws.Context, input *ModifySubnetAttributeInput, opts ...request.Option) (*ModifySubnetAttributeOutput, error) { + req, out := c.ModifySubnetAttributeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opProvisionByoipCidr = "ProvisionByoipCidr" +const opModifyTrafficMirrorFilterNetworkServices = "ModifyTrafficMirrorFilterNetworkServices" -// ProvisionByoipCidrRequest generates a "aws/request.Request" representing the -// client's request for the ProvisionByoipCidr operation. The "output" return +// ModifyTrafficMirrorFilterNetworkServicesRequest generates a "aws/request.Request" representing the +// client's request for the ModifyTrafficMirrorFilterNetworkServices operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ProvisionByoipCidr for more information on using the ProvisionByoipCidr +// See ModifyTrafficMirrorFilterNetworkServices for more information on using the ModifyTrafficMirrorFilterNetworkServices // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ProvisionByoipCidrRequest method. -// req, resp := client.ProvisionByoipCidrRequest(params) +// // Example sending a request using the ModifyTrafficMirrorFilterNetworkServicesRequest method. +// req, resp := client.ModifyTrafficMirrorFilterNetworkServicesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ProvisionByoipCidr -func (c *EC2) ProvisionByoipCidrRequest(input *ProvisionByoipCidrInput) (req *request.Request, output *ProvisionByoipCidrOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorFilterNetworkServices +func (c *EC2) ModifyTrafficMirrorFilterNetworkServicesRequest(input *ModifyTrafficMirrorFilterNetworkServicesInput) (req *request.Request, output *ModifyTrafficMirrorFilterNetworkServicesOutput) { op := &request.Operation{ - Name: opProvisionByoipCidr, + Name: opModifyTrafficMirrorFilterNetworkServices, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ProvisionByoipCidrInput{} + input = &ModifyTrafficMirrorFilterNetworkServicesInput{} } - output = &ProvisionByoipCidrOutput{} + output = &ModifyTrafficMirrorFilterNetworkServicesOutput{} req = c.newRequest(op, input, output) return } -// ProvisionByoipCidr API operation for Amazon Elastic Compute Cloud. +// ModifyTrafficMirrorFilterNetworkServices API operation for Amazon Elastic Compute Cloud. // -// Provisions an address range for use with your AWS resources through bring -// your own IP addresses (BYOIP) and creates a corresponding address pool. After -// the address range is provisioned, it is ready to be advertised using AdvertiseByoipCidr. +// Allows or restricts mirroring network services. // -// AWS verifies that you own the address range and are authorized to advertise -// it. You must ensure that the address range is registered to you and that -// you created an RPKI ROA to authorize Amazon ASNs 16509 and 14618 to advertise -// the address range. For more information, see Bring Your Own IP Addresses -// (BYOIP) (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html) -// in the Amazon Elastic Compute Cloud User Guide. +// By default, Amazon DNS network services are not eligible for Traffic Mirror. +// Use AddNetworkServices to add network services to a Traffic Mirror filter. +// When a network service is added to the Traffic Mirror filter, all traffic +// related to that network service will be mirrored. When you no longer want +// to mirror network services, use RemoveNetworkServices to remove the network +// services from the Traffic Mirror filter. // -// Provisioning an address range is an asynchronous operation, so the call returns -// immediately, but the address range is not ready to use until its status changes -// from pending-provision to provisioned. To monitor the status of an address -// range, use DescribeByoipCidrs. To allocate an Elastic IP address from your -// address pool, use AllocateAddress with either the specific address from the -// address pool or the ID of the address pool. +// For information about filter rule properties, see Network Services (https://docs.aws.amazon.com/vpc/latest/mirroring/traffic-mirroring-considerations.html) +// in the Traffic Mirroring User Guide . // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ProvisionByoipCidr for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ProvisionByoipCidr -func (c *EC2) ProvisionByoipCidr(input *ProvisionByoipCidrInput) (*ProvisionByoipCidrOutput, error) { - req, out := c.ProvisionByoipCidrRequest(input) +// API operation ModifyTrafficMirrorFilterNetworkServices for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorFilterNetworkServices +func (c *EC2) ModifyTrafficMirrorFilterNetworkServices(input *ModifyTrafficMirrorFilterNetworkServicesInput) (*ModifyTrafficMirrorFilterNetworkServicesOutput, error) { + req, out := c.ModifyTrafficMirrorFilterNetworkServicesRequest(input) return out, req.Send() } -// ProvisionByoipCidrWithContext is the same as ProvisionByoipCidr with the addition of +// ModifyTrafficMirrorFilterNetworkServicesWithContext is the same as ModifyTrafficMirrorFilterNetworkServices with the addition of // the ability to pass a context and additional request options. // -// See ProvisionByoipCidr for details on how to use this API operation. +// See ModifyTrafficMirrorFilterNetworkServices for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ProvisionByoipCidrWithContext(ctx aws.Context, input *ProvisionByoipCidrInput, opts ...request.Option) (*ProvisionByoipCidrOutput, error) { - req, out := c.ProvisionByoipCidrRequest(input) +func (c *EC2) ModifyTrafficMirrorFilterNetworkServicesWithContext(ctx aws.Context, input *ModifyTrafficMirrorFilterNetworkServicesInput, opts ...request.Option) (*ModifyTrafficMirrorFilterNetworkServicesOutput, error) { + req, out := c.ModifyTrafficMirrorFilterNetworkServicesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPurchaseHostReservation = "PurchaseHostReservation" +const opModifyTrafficMirrorFilterRule = "ModifyTrafficMirrorFilterRule" -// PurchaseHostReservationRequest generates a "aws/request.Request" representing the -// client's request for the PurchaseHostReservation operation. The "output" return +// ModifyTrafficMirrorFilterRuleRequest generates a "aws/request.Request" representing the +// client's request for the ModifyTrafficMirrorFilterRule operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PurchaseHostReservation for more information on using the PurchaseHostReservation +// See ModifyTrafficMirrorFilterRule for more information on using the ModifyTrafficMirrorFilterRule // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PurchaseHostReservationRequest method. -// req, resp := client.PurchaseHostReservationRequest(params) +// // Example sending a request using the ModifyTrafficMirrorFilterRuleRequest method. +// req, resp := client.ModifyTrafficMirrorFilterRuleRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseHostReservation -func (c *EC2) PurchaseHostReservationRequest(input *PurchaseHostReservationInput) (req *request.Request, output *PurchaseHostReservationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorFilterRule +func (c *EC2) ModifyTrafficMirrorFilterRuleRequest(input *ModifyTrafficMirrorFilterRuleInput) (req *request.Request, output *ModifyTrafficMirrorFilterRuleOutput) { op := &request.Operation{ - Name: opPurchaseHostReservation, + Name: opModifyTrafficMirrorFilterRule, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PurchaseHostReservationInput{} + input = &ModifyTrafficMirrorFilterRuleInput{} } - output = &PurchaseHostReservationOutput{} + output = &ModifyTrafficMirrorFilterRuleOutput{} req = c.newRequest(op, input, output) return } -// PurchaseHostReservation API operation for Amazon Elastic Compute Cloud. +// ModifyTrafficMirrorFilterRule 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. +// Modifies the specified Traffic Mirror rule. +// +// DestinationCidrBlock and SourceCidrBlock must both be an IPv4 range or an +// IPv6 range. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation ModifyTrafficMirrorFilterRule for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorFilterRule +func (c *EC2) ModifyTrafficMirrorFilterRule(input *ModifyTrafficMirrorFilterRuleInput) (*ModifyTrafficMirrorFilterRuleOutput, error) { + req, out := c.ModifyTrafficMirrorFilterRuleRequest(input) return out, req.Send() } -// PurchaseHostReservationWithContext is the same as PurchaseHostReservation with the addition of +// ModifyTrafficMirrorFilterRuleWithContext is the same as ModifyTrafficMirrorFilterRule with the addition of // the ability to pass a context and additional request options. // -// See PurchaseHostReservation for details on how to use this API operation. +// See ModifyTrafficMirrorFilterRule for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) PurchaseHostReservationWithContext(ctx aws.Context, input *PurchaseHostReservationInput, opts ...request.Option) (*PurchaseHostReservationOutput, error) { - req, out := c.PurchaseHostReservationRequest(input) +func (c *EC2) ModifyTrafficMirrorFilterRuleWithContext(ctx aws.Context, input *ModifyTrafficMirrorFilterRuleInput, opts ...request.Option) (*ModifyTrafficMirrorFilterRuleOutput, error) { + req, out := c.ModifyTrafficMirrorFilterRuleRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPurchaseReservedInstancesOffering = "PurchaseReservedInstancesOffering" +const opModifyTrafficMirrorSession = "ModifyTrafficMirrorSession" -// PurchaseReservedInstancesOfferingRequest generates a "aws/request.Request" representing the -// client's request for the PurchaseReservedInstancesOffering operation. The "output" return +// ModifyTrafficMirrorSessionRequest generates a "aws/request.Request" representing the +// client's request for the ModifyTrafficMirrorSession operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PurchaseReservedInstancesOffering for more information on using the PurchaseReservedInstancesOffering +// See ModifyTrafficMirrorSession for more information on using the ModifyTrafficMirrorSession // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PurchaseReservedInstancesOfferingRequest method. -// req, resp := client.PurchaseReservedInstancesOfferingRequest(params) +// // Example sending a request using the ModifyTrafficMirrorSessionRequest method. +// req, resp := client.ModifyTrafficMirrorSessionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseReservedInstancesOffering -func (c *EC2) PurchaseReservedInstancesOfferingRequest(input *PurchaseReservedInstancesOfferingInput) (req *request.Request, output *PurchaseReservedInstancesOfferingOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorSession +func (c *EC2) ModifyTrafficMirrorSessionRequest(input *ModifyTrafficMirrorSessionInput) (req *request.Request, output *ModifyTrafficMirrorSessionOutput) { op := &request.Operation{ - Name: opPurchaseReservedInstancesOffering, + Name: opModifyTrafficMirrorSession, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PurchaseReservedInstancesOfferingInput{} + input = &ModifyTrafficMirrorSessionInput{} } - output = &PurchaseReservedInstancesOfferingOutput{} + output = &ModifyTrafficMirrorSessionOutput{} 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. +// ModifyTrafficMirrorSession API operation for Amazon Elastic Compute Cloud. // -// For more information, see Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html) -// and Reserved Instance Marketplace (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-market-general.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Modifies a Traffic Mirror session. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation ModifyTrafficMirrorSession for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTrafficMirrorSession +func (c *EC2) ModifyTrafficMirrorSession(input *ModifyTrafficMirrorSessionInput) (*ModifyTrafficMirrorSessionOutput, error) { + req, out := c.ModifyTrafficMirrorSessionRequest(input) return out, req.Send() } -// PurchaseReservedInstancesOfferingWithContext is the same as PurchaseReservedInstancesOffering with the addition of +// ModifyTrafficMirrorSessionWithContext is the same as ModifyTrafficMirrorSession with the addition of // the ability to pass a context and additional request options. // -// See PurchaseReservedInstancesOffering for details on how to use this API operation. +// See ModifyTrafficMirrorSession for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) PurchaseReservedInstancesOfferingWithContext(ctx aws.Context, input *PurchaseReservedInstancesOfferingInput, opts ...request.Option) (*PurchaseReservedInstancesOfferingOutput, error) { - req, out := c.PurchaseReservedInstancesOfferingRequest(input) +func (c *EC2) ModifyTrafficMirrorSessionWithContext(ctx aws.Context, input *ModifyTrafficMirrorSessionInput, opts ...request.Option) (*ModifyTrafficMirrorSessionOutput, error) { + req, out := c.ModifyTrafficMirrorSessionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPurchaseScheduledInstances = "PurchaseScheduledInstances" +const opModifyTransitGatewayVpcAttachment = "ModifyTransitGatewayVpcAttachment" -// PurchaseScheduledInstancesRequest generates a "aws/request.Request" representing the -// client's request for the PurchaseScheduledInstances operation. The "output" return +// ModifyTransitGatewayVpcAttachmentRequest generates a "aws/request.Request" representing the +// client's request for the ModifyTransitGatewayVpcAttachment operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PurchaseScheduledInstances for more information on using the PurchaseScheduledInstances +// See ModifyTransitGatewayVpcAttachment for more information on using the ModifyTransitGatewayVpcAttachment // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PurchaseScheduledInstancesRequest method. -// req, resp := client.PurchaseScheduledInstancesRequest(params) +// // Example sending a request using the ModifyTransitGatewayVpcAttachmentRequest method. +// req, resp := client.ModifyTransitGatewayVpcAttachmentRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseScheduledInstances -func (c *EC2) PurchaseScheduledInstancesRequest(input *PurchaseScheduledInstancesInput) (req *request.Request, output *PurchaseScheduledInstancesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTransitGatewayVpcAttachment +func (c *EC2) ModifyTransitGatewayVpcAttachmentRequest(input *ModifyTransitGatewayVpcAttachmentInput) (req *request.Request, output *ModifyTransitGatewayVpcAttachmentOutput) { op := &request.Operation{ - Name: opPurchaseScheduledInstances, + Name: opModifyTransitGatewayVpcAttachment, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &PurchaseScheduledInstancesInput{} + input = &ModifyTransitGatewayVpcAttachmentInput{} } - output = &PurchaseScheduledInstancesOutput{} + output = &ModifyTransitGatewayVpcAttachmentOutput{} req = c.newRequest(op, input, output) return } -// PurchaseScheduledInstances API operation for Amazon Elastic Compute Cloud. -// -// Purchases the 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. +// ModifyTransitGatewayVpcAttachment API operation for Amazon Elastic Compute Cloud. // -// After you purchase a Scheduled Instance, you can't cancel, modify, or resell -// your purchase. +// Modifies the specified VPC attachment. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation ModifyTransitGatewayVpcAttachment for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyTransitGatewayVpcAttachment +func (c *EC2) ModifyTransitGatewayVpcAttachment(input *ModifyTransitGatewayVpcAttachmentInput) (*ModifyTransitGatewayVpcAttachmentOutput, error) { + req, out := c.ModifyTransitGatewayVpcAttachmentRequest(input) return out, req.Send() } -// PurchaseScheduledInstancesWithContext is the same as PurchaseScheduledInstances with the addition of +// ModifyTransitGatewayVpcAttachmentWithContext is the same as ModifyTransitGatewayVpcAttachment with the addition of // the ability to pass a context and additional request options. // -// See PurchaseScheduledInstances for details on how to use this API operation. +// See ModifyTransitGatewayVpcAttachment for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) PurchaseScheduledInstancesWithContext(ctx aws.Context, input *PurchaseScheduledInstancesInput, opts ...request.Option) (*PurchaseScheduledInstancesOutput, error) { - req, out := c.PurchaseScheduledInstancesRequest(input) +func (c *EC2) ModifyTransitGatewayVpcAttachmentWithContext(ctx aws.Context, input *ModifyTransitGatewayVpcAttachmentInput, opts ...request.Option) (*ModifyTransitGatewayVpcAttachmentOutput, error) { + req, out := c.ModifyTransitGatewayVpcAttachmentRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRebootInstances = "RebootInstances" +const opModifyVolume = "ModifyVolume" -// RebootInstancesRequest generates a "aws/request.Request" representing the -// client's request for the RebootInstances operation. The "output" return +// ModifyVolumeRequest generates a "aws/request.Request" representing the +// client's request for the ModifyVolume operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RebootInstances for more information on using the RebootInstances +// See ModifyVolume for more information on using the ModifyVolume // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RebootInstancesRequest method. -// req, resp := client.RebootInstancesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RebootInstances -func (c *EC2) RebootInstancesRequest(input *RebootInstancesInput) (req *request.Request, output *RebootInstancesOutput) { +// See also, 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: opRebootInstances, + Name: opModifyVolume, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RebootInstancesInput{} + input = &ModifyVolumeInput{} } - output = &RebootInstancesOutput{} + output = &ModifyVolumeOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// RebootInstances API operation for Amazon Elastic Compute Cloud. +// ModifyVolume API operation for Amazon Elastic Compute Cloud. // -// Requests a reboot of the specified 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. +// 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 (https://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 (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html). // -// If an instance does not cleanly shut down within four minutes, Amazon EC2 -// performs a hard reboot. +// 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 (https://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 (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/ebs-expand-volume.html#recognize-expanded-volume-windows). // -// For more information about troubleshooting, see Getting Console Output and -// Rebooting Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-console.html) -// in the Amazon Elastic Compute Cloud User Guide. +// 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 (https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/). +// You can also track the status of a modification using DescribeVolumesModifications. +// For information about tracking status changes using either method, see Monitoring +// Volume Modifications (https://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, see Modifying the Size, IOPS, or Type of an EBS Volume +// on Linux (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-expand-volume.html) +// and Modifying the Size, IOPS, or Type of an EBS Volume on Windows (https://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 RebootInstances for usage and error information. -// See also, 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) +// API operation ModifyVolume for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolume +func (c *EC2) ModifyVolume(input *ModifyVolumeInput) (*ModifyVolumeOutput, error) { + req, out := c.ModifyVolumeRequest(input) return out, req.Send() } -// RebootInstancesWithContext is the same as RebootInstances with the addition of +// ModifyVolumeWithContext is the same as ModifyVolume with the addition of // the ability to pass a context and additional request options. // -// See RebootInstances for details on how to use this API operation. +// See ModifyVolume for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) RebootInstancesWithContext(ctx aws.Context, input *RebootInstancesInput, opts ...request.Option) (*RebootInstancesOutput, error) { - req, out := c.RebootInstancesRequest(input) +func (c *EC2) ModifyVolumeWithContext(ctx aws.Context, input *ModifyVolumeInput, opts ...request.Option) (*ModifyVolumeOutput, error) { + req, out := c.ModifyVolumeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRegisterImage = "RegisterImage" +const opModifyVolumeAttribute = "ModifyVolumeAttribute" -// RegisterImageRequest generates a "aws/request.Request" representing the -// client's request for the RegisterImage operation. The "output" return +// ModifyVolumeAttributeRequest generates a "aws/request.Request" representing the +// client's request for the ModifyVolumeAttribute operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RegisterImage for more information on using the RegisterImage +// See ModifyVolumeAttribute for more information on using the ModifyVolumeAttribute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RegisterImageRequest method. -// req, resp := client.RegisterImageRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RegisterImage -func (c *EC2) RegisterImageRequest(input *RegisterImageInput) (req *request.Request, output *RegisterImageOutput) { +// See also, 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: opRegisterImage, + Name: opModifyVolumeAttribute, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RegisterImageInput{} + input = &ModifyVolumeAttributeInput{} } - output = &RegisterImageOutput{} + output = &ModifyVolumeAttributeOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 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 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// For Amazon EBS-backed instances, CreateImage creates and registers the AMI -// in a single request, so you don't have to register the AMI yourself. -// -// You can also use RegisterImage to create an Amazon EBS-backed Linux AMI from -// a snapshot of a root device volume. You specify the snapshot using the block -// device mapping. For more information, see Launching a Linux Instance from -// a Backup (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-launch-snapshot.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// You can't register an image where a secondary (non-root) snapshot has AWS -// Marketplace product codes. +// ModifyVolumeAttribute API operation for Amazon Elastic Compute Cloud. // -// 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 instances -// launched from such an AMI are not able to connect to package update infrastructure. -// If you purchase a Reserved Instance offering for one of these Linux distributions -// and launch instances using an AMI that does not contain the required billing -// code, your Reserved Instance is not applied to these instances. +// Modifies a volume attribute. // -// To create an AMI for operating systems that require a billing code, see CreateImage. +// 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. // -// 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. +// 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 RegisterImage for usage and error information. -// See also, 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) +// API operation ModifyVolumeAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVolumeAttribute +func (c *EC2) ModifyVolumeAttribute(input *ModifyVolumeAttributeInput) (*ModifyVolumeAttributeOutput, error) { + req, out := c.ModifyVolumeAttributeRequest(input) return out, req.Send() } -// RegisterImageWithContext is the same as RegisterImage with the addition of +// ModifyVolumeAttributeWithContext is the same as ModifyVolumeAttribute with the addition of // the ability to pass a context and additional request options. // -// See RegisterImage for details on how to use this API operation. +// See ModifyVolumeAttribute for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) RegisterImageWithContext(ctx aws.Context, input *RegisterImageInput, opts ...request.Option) (*RegisterImageOutput, error) { - req, out := c.RegisterImageRequest(input) +func (c *EC2) ModifyVolumeAttributeWithContext(ctx aws.Context, input *ModifyVolumeAttributeInput, opts ...request.Option) (*ModifyVolumeAttributeOutput, error) { + req, out := c.ModifyVolumeAttributeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRejectTransitGatewayVpcAttachment = "RejectTransitGatewayVpcAttachment" +const opModifyVpcAttribute = "ModifyVpcAttribute" -// RejectTransitGatewayVpcAttachmentRequest generates a "aws/request.Request" representing the -// client's request for the RejectTransitGatewayVpcAttachment operation. The "output" return +// ModifyVpcAttributeRequest generates a "aws/request.Request" representing the +// client's request for the ModifyVpcAttribute operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RejectTransitGatewayVpcAttachment for more information on using the RejectTransitGatewayVpcAttachment +// See ModifyVpcAttribute for more information on using the ModifyVpcAttribute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RejectTransitGatewayVpcAttachmentRequest method. -// req, resp := client.RejectTransitGatewayVpcAttachmentRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectTransitGatewayVpcAttachment -func (c *EC2) RejectTransitGatewayVpcAttachmentRequest(input *RejectTransitGatewayVpcAttachmentInput) (req *request.Request, output *RejectTransitGatewayVpcAttachmentOutput) { +// See also, 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: opRejectTransitGatewayVpcAttachment, + Name: opModifyVpcAttribute, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RejectTransitGatewayVpcAttachmentInput{} + input = &ModifyVpcAttributeInput{} } - output = &RejectTransitGatewayVpcAttachmentOutput{} + output = &ModifyVpcAttributeOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// RejectTransitGatewayVpcAttachment API operation for Amazon Elastic Compute Cloud. -// -// Rejects a request to attach a VPC to a transit gateway. +// ModifyVpcAttribute API operation for Amazon Elastic Compute Cloud. // -// The VPC attachment must be in the pendingAcceptance state. Use DescribeTransitGatewayVpcAttachments -// to view your pending VPC attachment requests. Use AcceptTransitGatewayVpcAttachment -// to accept a VPC attachment request. +// 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 RejectTransitGatewayVpcAttachment for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectTransitGatewayVpcAttachment -func (c *EC2) RejectTransitGatewayVpcAttachment(input *RejectTransitGatewayVpcAttachmentInput) (*RejectTransitGatewayVpcAttachmentOutput, error) { - req, out := c.RejectTransitGatewayVpcAttachmentRequest(input) +// API operation ModifyVpcAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcAttribute +func (c *EC2) ModifyVpcAttribute(input *ModifyVpcAttributeInput) (*ModifyVpcAttributeOutput, error) { + req, out := c.ModifyVpcAttributeRequest(input) return out, req.Send() } -// RejectTransitGatewayVpcAttachmentWithContext is the same as RejectTransitGatewayVpcAttachment with the addition of +// ModifyVpcAttributeWithContext is the same as ModifyVpcAttribute with the addition of // the ability to pass a context and additional request options. // -// See RejectTransitGatewayVpcAttachment for details on how to use this API operation. +// See ModifyVpcAttribute for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) RejectTransitGatewayVpcAttachmentWithContext(ctx aws.Context, input *RejectTransitGatewayVpcAttachmentInput, opts ...request.Option) (*RejectTransitGatewayVpcAttachmentOutput, error) { - req, out := c.RejectTransitGatewayVpcAttachmentRequest(input) +func (c *EC2) ModifyVpcAttributeWithContext(ctx aws.Context, input *ModifyVpcAttributeInput, opts ...request.Option) (*ModifyVpcAttributeOutput, error) { + req, out := c.ModifyVpcAttributeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRejectVpcEndpointConnections = "RejectVpcEndpointConnections" +const opModifyVpcEndpoint = "ModifyVpcEndpoint" -// RejectVpcEndpointConnectionsRequest generates a "aws/request.Request" representing the -// client's request for the RejectVpcEndpointConnections operation. The "output" return +// ModifyVpcEndpointRequest generates a "aws/request.Request" representing the +// client's request for the ModifyVpcEndpoint operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RejectVpcEndpointConnections for more information on using the RejectVpcEndpointConnections +// See ModifyVpcEndpoint for more information on using the ModifyVpcEndpoint // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RejectVpcEndpointConnectionsRequest method. -// req, resp := client.RejectVpcEndpointConnectionsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectVpcEndpointConnections -func (c *EC2) RejectVpcEndpointConnectionsRequest(input *RejectVpcEndpointConnectionsInput) (req *request.Request, output *RejectVpcEndpointConnectionsOutput) { +// See also, 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: opRejectVpcEndpointConnections, + Name: opModifyVpcEndpoint, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RejectVpcEndpointConnectionsInput{} + input = &ModifyVpcEndpointInput{} } - output = &RejectVpcEndpointConnectionsOutput{} + output = &ModifyVpcEndpointOutput{} req = c.newRequest(op, input, output) return } -// RejectVpcEndpointConnections API operation for Amazon Elastic Compute Cloud. +// ModifyVpcEndpoint API operation for Amazon Elastic Compute Cloud. // -// Rejects one or more VPC endpoint connection requests to your VPC endpoint -// service. +// Modifies attributes of a specified VPC endpoint. The attributes that you +// can modify depend on the type of VPC endpoint (interface or gateway). For +// more information, see VPC Endpoints (https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints.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 RejectVpcEndpointConnections for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectVpcEndpointConnections -func (c *EC2) RejectVpcEndpointConnections(input *RejectVpcEndpointConnectionsInput) (*RejectVpcEndpointConnectionsOutput, error) { - req, out := c.RejectVpcEndpointConnectionsRequest(input) +// API operation ModifyVpcEndpoint for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpoint +func (c *EC2) ModifyVpcEndpoint(input *ModifyVpcEndpointInput) (*ModifyVpcEndpointOutput, error) { + req, out := c.ModifyVpcEndpointRequest(input) return out, req.Send() } -// RejectVpcEndpointConnectionsWithContext is the same as RejectVpcEndpointConnections with the addition of +// ModifyVpcEndpointWithContext is the same as ModifyVpcEndpoint with the addition of // the ability to pass a context and additional request options. // -// See RejectVpcEndpointConnections for details on how to use this API operation. +// See ModifyVpcEndpoint for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) RejectVpcEndpointConnectionsWithContext(ctx aws.Context, input *RejectVpcEndpointConnectionsInput, opts ...request.Option) (*RejectVpcEndpointConnectionsOutput, error) { - req, out := c.RejectVpcEndpointConnectionsRequest(input) +func (c *EC2) ModifyVpcEndpointWithContext(ctx aws.Context, input *ModifyVpcEndpointInput, opts ...request.Option) (*ModifyVpcEndpointOutput, error) { + req, out := c.ModifyVpcEndpointRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRejectVpcPeeringConnection = "RejectVpcPeeringConnection" +const opModifyVpcEndpointConnectionNotification = "ModifyVpcEndpointConnectionNotification" -// RejectVpcPeeringConnectionRequest generates a "aws/request.Request" representing the -// client's request for the RejectVpcPeeringConnection operation. The "output" return +// ModifyVpcEndpointConnectionNotificationRequest generates a "aws/request.Request" representing the +// client's request for the ModifyVpcEndpointConnectionNotification operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RejectVpcPeeringConnection for more information on using the RejectVpcPeeringConnection +// See ModifyVpcEndpointConnectionNotification for more information on using the ModifyVpcEndpointConnectionNotification // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RejectVpcPeeringConnectionRequest method. -// req, resp := client.RejectVpcPeeringConnectionRequest(params) +// // Example sending a request using the ModifyVpcEndpointConnectionNotificationRequest method. +// req, resp := client.ModifyVpcEndpointConnectionNotificationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectVpcPeeringConnection -func (c *EC2) RejectVpcPeeringConnectionRequest(input *RejectVpcPeeringConnectionInput) (req *request.Request, output *RejectVpcPeeringConnectionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointConnectionNotification +func (c *EC2) ModifyVpcEndpointConnectionNotificationRequest(input *ModifyVpcEndpointConnectionNotificationInput) (req *request.Request, output *ModifyVpcEndpointConnectionNotificationOutput) { op := &request.Operation{ - Name: opRejectVpcPeeringConnection, + Name: opModifyVpcEndpointConnectionNotification, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RejectVpcPeeringConnectionInput{} + input = &ModifyVpcEndpointConnectionNotificationInput{} } - output = &RejectVpcPeeringConnectionOutput{} + output = &ModifyVpcEndpointConnectionNotificationOutput{} req = c.newRequest(op, input, output) return } -// RejectVpcPeeringConnection API operation for Amazon Elastic Compute Cloud. +// ModifyVpcEndpointConnectionNotification 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. +// Modifies a connection notification for VPC endpoint or VPC endpoint service. +// You can change the SNS topic for the notification, or the events for which +// to be notified. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation ModifyVpcEndpointConnectionNotification for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointConnectionNotification +func (c *EC2) ModifyVpcEndpointConnectionNotification(input *ModifyVpcEndpointConnectionNotificationInput) (*ModifyVpcEndpointConnectionNotificationOutput, error) { + req, out := c.ModifyVpcEndpointConnectionNotificationRequest(input) return out, req.Send() } -// RejectVpcPeeringConnectionWithContext is the same as RejectVpcPeeringConnection with the addition of +// ModifyVpcEndpointConnectionNotificationWithContext is the same as ModifyVpcEndpointConnectionNotification with the addition of // the ability to pass a context and additional request options. // -// See RejectVpcPeeringConnection for details on how to use this API operation. +// See ModifyVpcEndpointConnectionNotification for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) RejectVpcPeeringConnectionWithContext(ctx aws.Context, input *RejectVpcPeeringConnectionInput, opts ...request.Option) (*RejectVpcPeeringConnectionOutput, error) { - req, out := c.RejectVpcPeeringConnectionRequest(input) +func (c *EC2) ModifyVpcEndpointConnectionNotificationWithContext(ctx aws.Context, input *ModifyVpcEndpointConnectionNotificationInput, opts ...request.Option) (*ModifyVpcEndpointConnectionNotificationOutput, error) { + req, out := c.ModifyVpcEndpointConnectionNotificationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opReleaseAddress = "ReleaseAddress" +const opModifyVpcEndpointServiceConfiguration = "ModifyVpcEndpointServiceConfiguration" -// ReleaseAddressRequest generates a "aws/request.Request" representing the -// client's request for the ReleaseAddress operation. The "output" return +// ModifyVpcEndpointServiceConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the ModifyVpcEndpointServiceConfiguration operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ReleaseAddress for more information on using the ReleaseAddress +// See ModifyVpcEndpointServiceConfiguration for more information on using the ModifyVpcEndpointServiceConfiguration // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ReleaseAddressRequest method. -// req, resp := client.ReleaseAddressRequest(params) +// // Example sending a request using the ModifyVpcEndpointServiceConfigurationRequest method. +// req, resp := client.ModifyVpcEndpointServiceConfigurationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseAddress -func (c *EC2) ReleaseAddressRequest(input *ReleaseAddressInput) (req *request.Request, output *ReleaseAddressOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointServiceConfiguration +func (c *EC2) ModifyVpcEndpointServiceConfigurationRequest(input *ModifyVpcEndpointServiceConfigurationInput) (req *request.Request, output *ModifyVpcEndpointServiceConfigurationOutput) { op := &request.Operation{ - Name: opReleaseAddress, + Name: opModifyVpcEndpointServiceConfiguration, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ReleaseAddressInput{} + input = &ModifyVpcEndpointServiceConfigurationInput{} } - output = &ReleaseAddressOutput{} + output = &ModifyVpcEndpointServiceConfigurationOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ReleaseAddress API operation for Amazon Elastic Compute Cloud. -// -// Releases the specified Elastic IP address. -// -// [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 can release it. Otherwise, Amazon EC2 returns an error -// (InvalidIPAddress.InUse). +// ModifyVpcEndpointServiceConfiguration API operation for Amazon Elastic Compute Cloud. // -// After releasing an Elastic IP address, it is released to the IP address pool. -// 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. +// Modifies the attributes of your VPC endpoint service configuration. You can +// change the Network Load Balancers for your service, and you can specify whether +// acceptance is required for requests to connect to your endpoint service through +// an interface VPC endpoint. // -// [EC2-VPC] After you release an Elastic IP address for use in a VPC, you might -// be able to recover it. For more information, see AllocateAddress. +// If you set or modify the private DNS name, you must prove that you own the +// private DNS domain name. For more information, see VPC Endpoint Service Private +// DNS Name Verification (https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-services-dns-validation.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 ReleaseAddress for usage and error information. -// See also, 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) +// API operation ModifyVpcEndpointServiceConfiguration for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointServiceConfiguration +func (c *EC2) ModifyVpcEndpointServiceConfiguration(input *ModifyVpcEndpointServiceConfigurationInput) (*ModifyVpcEndpointServiceConfigurationOutput, error) { + req, out := c.ModifyVpcEndpointServiceConfigurationRequest(input) return out, req.Send() } -// ReleaseAddressWithContext is the same as ReleaseAddress with the addition of +// ModifyVpcEndpointServiceConfigurationWithContext is the same as ModifyVpcEndpointServiceConfiguration with the addition of // the ability to pass a context and additional request options. // -// See ReleaseAddress for details on how to use this API operation. +// See ModifyVpcEndpointServiceConfiguration for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ReleaseAddressWithContext(ctx aws.Context, input *ReleaseAddressInput, opts ...request.Option) (*ReleaseAddressOutput, error) { - req, out := c.ReleaseAddressRequest(input) +func (c *EC2) ModifyVpcEndpointServiceConfigurationWithContext(ctx aws.Context, input *ModifyVpcEndpointServiceConfigurationInput, opts ...request.Option) (*ModifyVpcEndpointServiceConfigurationOutput, error) { + req, out := c.ModifyVpcEndpointServiceConfigurationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opReleaseHosts = "ReleaseHosts" +const opModifyVpcEndpointServicePermissions = "ModifyVpcEndpointServicePermissions" -// ReleaseHostsRequest generates a "aws/request.Request" representing the -// client's request for the ReleaseHosts operation. The "output" return +// ModifyVpcEndpointServicePermissionsRequest generates a "aws/request.Request" representing the +// client's request for the ModifyVpcEndpointServicePermissions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ReleaseHosts for more information on using the ReleaseHosts +// See ModifyVpcEndpointServicePermissions for more information on using the ModifyVpcEndpointServicePermissions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ReleaseHostsRequest method. -// req, resp := client.ReleaseHostsRequest(params) +// // Example sending a request using the ModifyVpcEndpointServicePermissionsRequest method. +// req, resp := client.ModifyVpcEndpointServicePermissionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseHosts -func (c *EC2) ReleaseHostsRequest(input *ReleaseHostsInput) (req *request.Request, output *ReleaseHostsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointServicePermissions +func (c *EC2) ModifyVpcEndpointServicePermissionsRequest(input *ModifyVpcEndpointServicePermissionsInput) (req *request.Request, output *ModifyVpcEndpointServicePermissionsOutput) { op := &request.Operation{ - Name: opReleaseHosts, + Name: opModifyVpcEndpointServicePermissions, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ReleaseHostsInput{} + input = &ModifyVpcEndpointServicePermissionsInput{} } - output = &ReleaseHostsOutput{} + output = &ModifyVpcEndpointServicePermissionsOutput{} 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, for example, to modify the host. You must stop or terminate -// all instances on a host before it can be released. +// ModifyVpcEndpointServicePermissions API operation for Amazon Elastic Compute Cloud. // -// When Dedicated Hosts are released, it may take some time for them to stop -// counting toward your limit and you may receive capacity errors when trying -// to allocate new Dedicated Hosts. Wait a few minutes and then try again. +// Modifies the permissions for your VPC endpoint service (https://docs.aws.amazon.com/vpc/latest/userguide/endpoint-service.html). +// You can add or remove permissions for service consumers (IAM users, IAM roles, +// and AWS accounts) to connect to your endpoint service. // -// Released hosts still appear in a DescribeHosts response. +// If you grant permissions to all principals, the service is public. Any users +// who know the name of a public service can send a request to attach an endpoint. +// If the service does not require manual approval, attachments are automatically +// approved. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation ModifyVpcEndpointServicePermissions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcEndpointServicePermissions +func (c *EC2) ModifyVpcEndpointServicePermissions(input *ModifyVpcEndpointServicePermissionsInput) (*ModifyVpcEndpointServicePermissionsOutput, error) { + req, out := c.ModifyVpcEndpointServicePermissionsRequest(input) return out, req.Send() } -// ReleaseHostsWithContext is the same as ReleaseHosts with the addition of +// ModifyVpcEndpointServicePermissionsWithContext is the same as ModifyVpcEndpointServicePermissions with the addition of // the ability to pass a context and additional request options. // -// See ReleaseHosts for details on how to use this API operation. +// See ModifyVpcEndpointServicePermissions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ReleaseHostsWithContext(ctx aws.Context, input *ReleaseHostsInput, opts ...request.Option) (*ReleaseHostsOutput, error) { - req, out := c.ReleaseHostsRequest(input) +func (c *EC2) ModifyVpcEndpointServicePermissionsWithContext(ctx aws.Context, input *ModifyVpcEndpointServicePermissionsInput, opts ...request.Option) (*ModifyVpcEndpointServicePermissionsOutput, error) { + req, out := c.ModifyVpcEndpointServicePermissionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opReplaceIamInstanceProfileAssociation = "ReplaceIamInstanceProfileAssociation" +const opModifyVpcPeeringConnectionOptions = "ModifyVpcPeeringConnectionOptions" -// ReplaceIamInstanceProfileAssociationRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceIamInstanceProfileAssociation operation. The "output" return +// ModifyVpcPeeringConnectionOptionsRequest generates a "aws/request.Request" representing the +// client's request for the ModifyVpcPeeringConnectionOptions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ReplaceIamInstanceProfileAssociation for more information on using the ReplaceIamInstanceProfileAssociation +// See ModifyVpcPeeringConnectionOptions for more information on using the ModifyVpcPeeringConnectionOptions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ReplaceIamInstanceProfileAssociationRequest method. -// req, resp := client.ReplaceIamInstanceProfileAssociationRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceIamInstanceProfileAssociation -func (c *EC2) ReplaceIamInstanceProfileAssociationRequest(input *ReplaceIamInstanceProfileAssociationInput) (req *request.Request, output *ReplaceIamInstanceProfileAssociationOutput) { +// See also, 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: opReplaceIamInstanceProfileAssociation, + Name: opModifyVpcPeeringConnectionOptions, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ReplaceIamInstanceProfileAssociationInput{} + input = &ModifyVpcPeeringConnectionOptionsInput{} } - output = &ReplaceIamInstanceProfileAssociationOutput{} + output = &ModifyVpcPeeringConnectionOptionsOutput{} req = c.newRequest(op, input, output) return } -// ReplaceIamInstanceProfileAssociation API operation for Amazon Elastic Compute Cloud. +// ModifyVpcPeeringConnectionOptions 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. +// Modifies the VPC peering connection options on one side of a VPC peering +// connection. You can do the following: // -// Use DescribeIamInstanceProfileAssociations to get the association ID. +// * 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 the ability to resolve public DNS hostnames to private +// IP addresses when queried from instances in the peer VPC. +// +// If the peered VPCs are in the same AWS account, you can enable DNS resolution +// for queries from the local VPC. This ensures that queries from the local +// VPC resolve to private IP addresses in the peer VPC. This option is not available +// if the peered VPCs are in different AWS accounts or different Regions. For +// peered VPCs in different AWS accounts, each AWS account owner must initiate +// a separate request to modify the peering connection options. For inter-region +// peering connections, you must use the Region for the requester VPC to modify +// the requester VPC peering options and the Region for the accepter VPC to +// modify the accepter VPC peering options. To verify which VPCs are the accepter +// and the 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 ReplaceIamInstanceProfileAssociation for usage and error information. -// See also, 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) +// API operation ModifyVpcPeeringConnectionOptions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcPeeringConnectionOptions +func (c *EC2) ModifyVpcPeeringConnectionOptions(input *ModifyVpcPeeringConnectionOptionsInput) (*ModifyVpcPeeringConnectionOptionsOutput, error) { + req, out := c.ModifyVpcPeeringConnectionOptionsRequest(input) return out, req.Send() } -// ReplaceIamInstanceProfileAssociationWithContext is the same as ReplaceIamInstanceProfileAssociation with the addition of +// ModifyVpcPeeringConnectionOptionsWithContext is the same as ModifyVpcPeeringConnectionOptions with the addition of // the ability to pass a context and additional request options. // -// See ReplaceIamInstanceProfileAssociation for details on how to use this API operation. +// See ModifyVpcPeeringConnectionOptions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ReplaceIamInstanceProfileAssociationWithContext(ctx aws.Context, input *ReplaceIamInstanceProfileAssociationInput, opts ...request.Option) (*ReplaceIamInstanceProfileAssociationOutput, error) { - req, out := c.ReplaceIamInstanceProfileAssociationRequest(input) +func (c *EC2) ModifyVpcPeeringConnectionOptionsWithContext(ctx aws.Context, input *ModifyVpcPeeringConnectionOptionsInput, opts ...request.Option) (*ModifyVpcPeeringConnectionOptionsOutput, error) { + req, out := c.ModifyVpcPeeringConnectionOptionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opReplaceNetworkAclAssociation = "ReplaceNetworkAclAssociation" +const opModifyVpcTenancy = "ModifyVpcTenancy" -// ReplaceNetworkAclAssociationRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceNetworkAclAssociation operation. The "output" return +// ModifyVpcTenancyRequest generates a "aws/request.Request" representing the +// client's request for the ModifyVpcTenancy operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ReplaceNetworkAclAssociation for more information on using the ReplaceNetworkAclAssociation +// See ModifyVpcTenancy for more information on using the ModifyVpcTenancy // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ReplaceNetworkAclAssociationRequest method. -// req, resp := client.ReplaceNetworkAclAssociationRequest(params) +// // Example sending a request using the ModifyVpcTenancyRequest method. +// req, resp := client.ModifyVpcTenancyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclAssociation -func (c *EC2) ReplaceNetworkAclAssociationRequest(input *ReplaceNetworkAclAssociationInput) (req *request.Request, output *ReplaceNetworkAclAssociationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcTenancy +func (c *EC2) ModifyVpcTenancyRequest(input *ModifyVpcTenancyInput) (req *request.Request, output *ModifyVpcTenancyOutput) { op := &request.Operation{ - Name: opReplaceNetworkAclAssociation, + Name: opModifyVpcTenancy, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ReplaceNetworkAclAssociationInput{} + input = &ModifyVpcTenancyInput{} } - output = &ReplaceNetworkAclAssociationOutput{} + output = &ModifyVpcTenancyOutput{} req = c.newRequest(op, input, output) return } -// ReplaceNetworkAclAssociation API operation for Amazon Elastic Compute Cloud. +// ModifyVpcTenancy 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, see Network ACLs (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ACLs.html) -// in the Amazon Virtual Private Cloud User Guide. +// Modifies the instance tenancy attribute of the specified VPC. You can change +// the instance tenancy attribute of a VPC to default only. You cannot change +// the instance tenancy attribute to dedicated. // -// This is an idempotent operation. +// After you modify the tenancy of the VPC, any new instances that you launch +// into the VPC have a tenancy of default, unless you specify otherwise during +// launch. The tenancy of any existing instances in the VPC is not affected. +// +// For more information, see Dedicated Instances (https://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 ReplaceNetworkAclAssociation for usage and error information. -// See also, 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) +// API operation ModifyVpcTenancy for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpcTenancy +func (c *EC2) ModifyVpcTenancy(input *ModifyVpcTenancyInput) (*ModifyVpcTenancyOutput, error) { + req, out := c.ModifyVpcTenancyRequest(input) return out, req.Send() } -// ReplaceNetworkAclAssociationWithContext is the same as ReplaceNetworkAclAssociation with the addition of +// ModifyVpcTenancyWithContext is the same as ModifyVpcTenancy with the addition of // the ability to pass a context and additional request options. // -// See ReplaceNetworkAclAssociation for details on how to use this API operation. +// See ModifyVpcTenancy for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ReplaceNetworkAclAssociationWithContext(ctx aws.Context, input *ReplaceNetworkAclAssociationInput, opts ...request.Option) (*ReplaceNetworkAclAssociationOutput, error) { - req, out := c.ReplaceNetworkAclAssociationRequest(input) +func (c *EC2) ModifyVpcTenancyWithContext(ctx aws.Context, input *ModifyVpcTenancyInput, opts ...request.Option) (*ModifyVpcTenancyOutput, error) { + req, out := c.ModifyVpcTenancyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opReplaceNetworkAclEntry = "ReplaceNetworkAclEntry" +const opModifyVpnConnection = "ModifyVpnConnection" -// ReplaceNetworkAclEntryRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceNetworkAclEntry operation. The "output" return +// ModifyVpnConnectionRequest generates a "aws/request.Request" representing the +// client's request for the ModifyVpnConnection operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ReplaceNetworkAclEntry for more information on using the ReplaceNetworkAclEntry +// See ModifyVpnConnection for more information on using the ModifyVpnConnection // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ReplaceNetworkAclEntryRequest method. -// req, resp := client.ReplaceNetworkAclEntryRequest(params) +// // Example sending a request using the ModifyVpnConnectionRequest method. +// req, resp := client.ModifyVpnConnectionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclEntry -func (c *EC2) ReplaceNetworkAclEntryRequest(input *ReplaceNetworkAclEntryInput) (req *request.Request, output *ReplaceNetworkAclEntryOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnConnection +func (c *EC2) ModifyVpnConnectionRequest(input *ModifyVpnConnectionInput) (req *request.Request, output *ModifyVpnConnectionOutput) { op := &request.Operation{ - Name: opReplaceNetworkAclEntry, + Name: opModifyVpnConnection, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ReplaceNetworkAclEntryInput{} + input = &ModifyVpnConnectionInput{} } - output = &ReplaceNetworkAclEntryOutput{} + output = &ModifyVpnConnectionOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ReplaceNetworkAclEntry API operation for Amazon Elastic Compute Cloud. +// ModifyVpnConnection API operation for Amazon Elastic Compute Cloud. // -// Replaces an entry (rule) in a network ACL. For more information, see Network -// ACLs (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ACLs.html) in -// the Amazon Virtual Private Cloud User Guide. +// Modifies the target gateway of an AWS Site-to-Site VPN connection. The following +// migration options are available: +// +// * An existing virtual private gateway to a new virtual private gateway +// +// * An existing virtual private gateway to a transit gateway +// +// * An existing transit gateway to a new transit gateway +// +// * An existing transit gateway to a virtual private gateway +// +// Before you perform the migration to the new gateway, you must configure the +// new gateway. Use CreateVpnGateway to create a virtual private gateway, or +// CreateTransitGateway to create a transit gateway. +// +// This step is required when you migrate from a virtual private gateway with +// static routes to a transit gateway. +// +// You must delete the static routes before you migrate to the new gateway. +// +// Keep a copy of the static route before you delete it. You will need to add +// back these routes to the transit gateway after the VPN connection migration +// is complete. +// +// After you migrate to the new gateway, you might need to modify your VPC route +// table. Use CreateRoute and DeleteRoute to make the changes described in VPN +// Gateway Target Modification Required VPC Route Table Updates (https://docs.aws.amazon.com/vpn/latest/s2svpn/modify-vpn-target.html#step-update-routing) +// in the AWS Site-to-Site VPN User Guide. +// +// When the new gateway is a transit gateway, modify the transit gateway route +// table to allow traffic between the VPC and the AWS Site-to-Site VPN connection. +// Use CreateTransitGatewayRoute to add the routes. +// +// If you deleted VPN static routes, you must add the static routes to the transit +// gateway route table. +// +// After you perform this operation, the AWS VPN endpoint's IP addresses on +// the AWS side and the tunnel options remain intact. Your s2slong; connection +// will be temporarily unavailable for approximately 10 minutes while we provision +// the new 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 ReplaceNetworkAclEntry for usage and error information. -// See also, 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) +// API operation ModifyVpnConnection for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnConnection +func (c *EC2) ModifyVpnConnection(input *ModifyVpnConnectionInput) (*ModifyVpnConnectionOutput, error) { + req, out := c.ModifyVpnConnectionRequest(input) return out, req.Send() } -// ReplaceNetworkAclEntryWithContext is the same as ReplaceNetworkAclEntry with the addition of +// ModifyVpnConnectionWithContext is the same as ModifyVpnConnection with the addition of // the ability to pass a context and additional request options. // -// See ReplaceNetworkAclEntry for details on how to use this API operation. +// See ModifyVpnConnection for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ReplaceNetworkAclEntryWithContext(ctx aws.Context, input *ReplaceNetworkAclEntryInput, opts ...request.Option) (*ReplaceNetworkAclEntryOutput, error) { - req, out := c.ReplaceNetworkAclEntryRequest(input) +func (c *EC2) ModifyVpnConnectionWithContext(ctx aws.Context, input *ModifyVpnConnectionInput, opts ...request.Option) (*ModifyVpnConnectionOutput, error) { + req, out := c.ModifyVpnConnectionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opReplaceRoute = "ReplaceRoute" +const opModifyVpnTunnelCertificate = "ModifyVpnTunnelCertificate" -// ReplaceRouteRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceRoute operation. The "output" return +// ModifyVpnTunnelCertificateRequest generates a "aws/request.Request" representing the +// client's request for the ModifyVpnTunnelCertificate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ReplaceRoute for more information on using the ReplaceRoute +// See ModifyVpnTunnelCertificate for more information on using the ModifyVpnTunnelCertificate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ReplaceRouteRequest method. -// req, resp := client.ReplaceRouteRequest(params) +// // Example sending a request using the ModifyVpnTunnelCertificateRequest method. +// req, resp := client.ModifyVpnTunnelCertificateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRoute -func (c *EC2) ReplaceRouteRequest(input *ReplaceRouteInput) (req *request.Request, output *ReplaceRouteOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnTunnelCertificate +func (c *EC2) ModifyVpnTunnelCertificateRequest(input *ModifyVpnTunnelCertificateInput) (req *request.Request, output *ModifyVpnTunnelCertificateOutput) { op := &request.Operation{ - Name: opReplaceRoute, + Name: opModifyVpnTunnelCertificate, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ReplaceRouteInput{} + input = &ModifyVpnTunnelCertificateInput{} } - output = &ReplaceRouteOutput{} + output = &ModifyVpnTunnelCertificateOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, 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. +// ModifyVpnTunnelCertificate API operation for Amazon Elastic Compute Cloud. // -// For more information, see Route Tables (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. +// Modifies the VPN tunnel endpoint 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 Elastic Compute Cloud's -// API operation ReplaceRoute for usage and error information. -// See also, 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) +// API operation ModifyVpnTunnelCertificate for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnTunnelCertificate +func (c *EC2) ModifyVpnTunnelCertificate(input *ModifyVpnTunnelCertificateInput) (*ModifyVpnTunnelCertificateOutput, error) { + req, out := c.ModifyVpnTunnelCertificateRequest(input) return out, req.Send() } -// ReplaceRouteWithContext is the same as ReplaceRoute with the addition of +// ModifyVpnTunnelCertificateWithContext is the same as ModifyVpnTunnelCertificate with the addition of // the ability to pass a context and additional request options. // -// See ReplaceRoute for details on how to use this API operation. +// See ModifyVpnTunnelCertificate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ReplaceRouteWithContext(ctx aws.Context, input *ReplaceRouteInput, opts ...request.Option) (*ReplaceRouteOutput, error) { - req, out := c.ReplaceRouteRequest(input) +func (c *EC2) ModifyVpnTunnelCertificateWithContext(ctx aws.Context, input *ModifyVpnTunnelCertificateInput, opts ...request.Option) (*ModifyVpnTunnelCertificateOutput, error) { + req, out := c.ModifyVpnTunnelCertificateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opReplaceRouteTableAssociation = "ReplaceRouteTableAssociation" +const opModifyVpnTunnelOptions = "ModifyVpnTunnelOptions" -// ReplaceRouteTableAssociationRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceRouteTableAssociation operation. The "output" return +// ModifyVpnTunnelOptionsRequest generates a "aws/request.Request" representing the +// client's request for the ModifyVpnTunnelOptions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ReplaceRouteTableAssociation for more information on using the ReplaceRouteTableAssociation +// See ModifyVpnTunnelOptions for more information on using the ModifyVpnTunnelOptions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ReplaceRouteTableAssociationRequest method. -// req, resp := client.ReplaceRouteTableAssociationRequest(params) +// // Example sending a request using the ModifyVpnTunnelOptionsRequest method. +// req, resp := client.ModifyVpnTunnelOptionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRouteTableAssociation -func (c *EC2) ReplaceRouteTableAssociationRequest(input *ReplaceRouteTableAssociationInput) (req *request.Request, output *ReplaceRouteTableAssociationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnTunnelOptions +func (c *EC2) ModifyVpnTunnelOptionsRequest(input *ModifyVpnTunnelOptionsInput) (req *request.Request, output *ModifyVpnTunnelOptionsOutput) { op := &request.Operation{ - Name: opReplaceRouteTableAssociation, + Name: opModifyVpnTunnelOptions, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ReplaceRouteTableAssociationInput{} + input = &ModifyVpnTunnelOptionsInput{} } - output = &ReplaceRouteTableAssociationOutput{} + output = &ModifyVpnTunnelOptionsOutput{} 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 -// (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html) -// in the Amazon Virtual Private Cloud User Guide. +// ModifyVpnTunnelOptions API operation for Amazon Elastic Compute Cloud. // -// 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. +// Modifies the options for a VPN tunnel in an AWS Site-to-Site VPN connection. +// You can modify multiple options for a tunnel in a single request, but you +// can only modify one tunnel at a time. For more information, see Site-to-Site +// VPN Tunnel Options for Your Site-to-Site VPN Connection (https://docs.aws.amazon.com/vpn/latest/s2svpn/VPNTunnels.html) +// in the AWS Site-to-Site VPN User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation ModifyVpnTunnelOptions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyVpnTunnelOptions +func (c *EC2) ModifyVpnTunnelOptions(input *ModifyVpnTunnelOptionsInput) (*ModifyVpnTunnelOptionsOutput, error) { + req, out := c.ModifyVpnTunnelOptionsRequest(input) return out, req.Send() } -// ReplaceRouteTableAssociationWithContext is the same as ReplaceRouteTableAssociation with the addition of +// ModifyVpnTunnelOptionsWithContext is the same as ModifyVpnTunnelOptions with the addition of // the ability to pass a context and additional request options. // -// See ReplaceRouteTableAssociation for details on how to use this API operation. +// See ModifyVpnTunnelOptions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ReplaceRouteTableAssociationWithContext(ctx aws.Context, input *ReplaceRouteTableAssociationInput, opts ...request.Option) (*ReplaceRouteTableAssociationOutput, error) { - req, out := c.ReplaceRouteTableAssociationRequest(input) +func (c *EC2) ModifyVpnTunnelOptionsWithContext(ctx aws.Context, input *ModifyVpnTunnelOptionsInput, opts ...request.Option) (*ModifyVpnTunnelOptionsOutput, error) { + req, out := c.ModifyVpnTunnelOptionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opReplaceTransitGatewayRoute = "ReplaceTransitGatewayRoute" +const opMonitorInstances = "MonitorInstances" -// ReplaceTransitGatewayRouteRequest generates a "aws/request.Request" representing the -// client's request for the ReplaceTransitGatewayRoute operation. The "output" return +// MonitorInstancesRequest generates a "aws/request.Request" representing the +// client's request for the MonitorInstances operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ReplaceTransitGatewayRoute for more information on using the ReplaceTransitGatewayRoute +// See MonitorInstances for more information on using the MonitorInstances // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ReplaceTransitGatewayRouteRequest method. -// req, resp := client.ReplaceTransitGatewayRouteRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceTransitGatewayRoute -func (c *EC2) ReplaceTransitGatewayRouteRequest(input *ReplaceTransitGatewayRouteInput) (req *request.Request, output *ReplaceTransitGatewayRouteOutput) { +// See also, 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: opReplaceTransitGatewayRoute, + Name: opMonitorInstances, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ReplaceTransitGatewayRouteInput{} + input = &MonitorInstancesInput{} } - output = &ReplaceTransitGatewayRouteOutput{} + output = &MonitorInstancesOutput{} req = c.newRequest(op, input, output) return } -// ReplaceTransitGatewayRoute API operation for Amazon Elastic Compute Cloud. +// MonitorInstances API operation for Amazon Elastic Compute Cloud. // -// Replaces the specified route in the specified transit gateway route table. +// Enables detailed monitoring for a running instance. Otherwise, basic monitoring +// is enabled. For more information, see Monitoring Your Instances and Volumes +// (https://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 ReplaceTransitGatewayRoute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceTransitGatewayRoute -func (c *EC2) ReplaceTransitGatewayRoute(input *ReplaceTransitGatewayRouteInput) (*ReplaceTransitGatewayRouteOutput, error) { - req, out := c.ReplaceTransitGatewayRouteRequest(input) +// API operation MonitorInstances for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MonitorInstances +func (c *EC2) MonitorInstances(input *MonitorInstancesInput) (*MonitorInstancesOutput, error) { + req, out := c.MonitorInstancesRequest(input) return out, req.Send() } -// ReplaceTransitGatewayRouteWithContext is the same as ReplaceTransitGatewayRoute with the addition of +// MonitorInstancesWithContext is the same as MonitorInstances with the addition of // the ability to pass a context and additional request options. // -// See ReplaceTransitGatewayRoute for details on how to use this API operation. +// See MonitorInstances for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ReplaceTransitGatewayRouteWithContext(ctx aws.Context, input *ReplaceTransitGatewayRouteInput, opts ...request.Option) (*ReplaceTransitGatewayRouteOutput, error) { - req, out := c.ReplaceTransitGatewayRouteRequest(input) +func (c *EC2) MonitorInstancesWithContext(ctx aws.Context, input *MonitorInstancesInput, opts ...request.Option) (*MonitorInstancesOutput, error) { + req, out := c.MonitorInstancesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opReportInstanceStatus = "ReportInstanceStatus" +const opMoveAddressToVpc = "MoveAddressToVpc" -// ReportInstanceStatusRequest generates a "aws/request.Request" representing the -// client's request for the ReportInstanceStatus operation. The "output" return +// MoveAddressToVpcRequest generates a "aws/request.Request" representing the +// client's request for the MoveAddressToVpc operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ReportInstanceStatus for more information on using the ReportInstanceStatus +// See MoveAddressToVpc for more information on using the MoveAddressToVpc // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ReportInstanceStatusRequest method. -// req, resp := client.ReportInstanceStatusRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReportInstanceStatus -func (c *EC2) ReportInstanceStatusRequest(input *ReportInstanceStatusInput) (req *request.Request, output *ReportInstanceStatusOutput) { +// See also, 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: opReportInstanceStatus, + Name: opMoveAddressToVpc, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ReportInstanceStatusInput{} + input = &MoveAddressToVpcInput{} } - output = &ReportInstanceStatusOutput{} + output = &MoveAddressToVpcOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, 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. +// MoveAddressToVpc API operation for Amazon Elastic Compute Cloud. // -// Use of this action does not change the value returned by DescribeInstanceStatus. +// 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 ReportInstanceStatus for usage and error information. -// See also, 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) +// API operation MoveAddressToVpc for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/MoveAddressToVpc +func (c *EC2) MoveAddressToVpc(input *MoveAddressToVpcInput) (*MoveAddressToVpcOutput, error) { + req, out := c.MoveAddressToVpcRequest(input) return out, req.Send() } -// ReportInstanceStatusWithContext is the same as ReportInstanceStatus with the addition of +// MoveAddressToVpcWithContext is the same as MoveAddressToVpc with the addition of // the ability to pass a context and additional request options. // -// See ReportInstanceStatus for details on how to use this API operation. +// See MoveAddressToVpc for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ReportInstanceStatusWithContext(ctx aws.Context, input *ReportInstanceStatusInput, opts ...request.Option) (*ReportInstanceStatusOutput, error) { - req, out := c.ReportInstanceStatusRequest(input) +func (c *EC2) MoveAddressToVpcWithContext(ctx aws.Context, input *MoveAddressToVpcInput, opts ...request.Option) (*MoveAddressToVpcOutput, error) { + req, out := c.MoveAddressToVpcRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRequestSpotFleet = "RequestSpotFleet" +const opProvisionByoipCidr = "ProvisionByoipCidr" -// RequestSpotFleetRequest generates a "aws/request.Request" representing the -// client's request for the RequestSpotFleet operation. The "output" return +// ProvisionByoipCidrRequest generates a "aws/request.Request" representing the +// client's request for the ProvisionByoipCidr operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RequestSpotFleet for more information on using the RequestSpotFleet +// See ProvisionByoipCidr for more information on using the ProvisionByoipCidr // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RequestSpotFleetRequest method. -// req, resp := client.RequestSpotFleetRequest(params) +// // Example sending a request using the ProvisionByoipCidrRequest method. +// req, resp := client.ProvisionByoipCidrRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotFleet -func (c *EC2) RequestSpotFleetRequest(input *RequestSpotFleetInput) (req *request.Request, output *RequestSpotFleetOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ProvisionByoipCidr +func (c *EC2) ProvisionByoipCidrRequest(input *ProvisionByoipCidrInput) (req *request.Request, output *ProvisionByoipCidrOutput) { op := &request.Operation{ - Name: opRequestSpotFleet, + Name: opProvisionByoipCidr, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RequestSpotFleetInput{} + input = &ProvisionByoipCidrInput{} } - output = &RequestSpotFleetOutput{} + output = &ProvisionByoipCidrOutput{} req = c.newRequest(op, input, output) return } -// RequestSpotFleet API operation for Amazon Elastic Compute Cloud. -// -// Creates a Spot Fleet request. -// -// The Spot Fleet request specifies the total target capacity and the On-Demand -// target capacity. Amazon EC2 calculates the difference between the total capacity -// and On-Demand capacity, and launches the difference as Spot capacity. -// -// 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 Instance 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. +// ProvisionByoipCidr API operation for Amazon Elastic Compute Cloud. // -// 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. +// Provisions an IPv4 or IPv6 address range for use with your AWS resources +// through bring your own IP addresses (BYOIP) and creates a corresponding address +// pool. After the address range is provisioned, it is ready to be advertised +// using AdvertiseByoipCidr. // -// You can specify tags for the Spot Instances. You cannot tag other resource -// types in a Spot Fleet request because only the instance resource type is -// supported. +// AWS verifies that you own the address range and are authorized to advertise +// it. You must ensure that the address range is registered to you and that +// you created an RPKI ROA to authorize Amazon ASNs 16509 and 14618 to advertise +// the address range. For more information, see Bring Your Own IP Addresses +// (BYOIP) (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html) +// in the Amazon Elastic Compute Cloud User Guide. // -// For more information, see Spot Fleet Requests (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html) -// in the Amazon EC2 User Guide for Linux Instances. +// Provisioning an address range is an asynchronous operation, so the call returns +// immediately, but the address range is not ready to use until its status changes +// from pending-provision to provisioned. To monitor the status of an address +// range, use DescribeByoipCidrs. To allocate an Elastic IP address from your +// IPv4 address pool, use AllocateAddress with either the specific address from +// the address pool or the ID of the address pool. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation ProvisionByoipCidr for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ProvisionByoipCidr +func (c *EC2) ProvisionByoipCidr(input *ProvisionByoipCidrInput) (*ProvisionByoipCidrOutput, error) { + req, out := c.ProvisionByoipCidrRequest(input) return out, req.Send() } -// RequestSpotFleetWithContext is the same as RequestSpotFleet with the addition of +// ProvisionByoipCidrWithContext is the same as ProvisionByoipCidr with the addition of // the ability to pass a context and additional request options. // -// See RequestSpotFleet for details on how to use this API operation. +// See ProvisionByoipCidr for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) RequestSpotFleetWithContext(ctx aws.Context, input *RequestSpotFleetInput, opts ...request.Option) (*RequestSpotFleetOutput, error) { - req, out := c.RequestSpotFleetRequest(input) +func (c *EC2) ProvisionByoipCidrWithContext(ctx aws.Context, input *ProvisionByoipCidrInput, opts ...request.Option) (*ProvisionByoipCidrOutput, error) { + req, out := c.ProvisionByoipCidrRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRequestSpotInstances = "RequestSpotInstances" +const opPurchaseHostReservation = "PurchaseHostReservation" -// RequestSpotInstancesRequest generates a "aws/request.Request" representing the -// client's request for the RequestSpotInstances operation. The "output" return +// PurchaseHostReservationRequest generates a "aws/request.Request" representing the +// client's request for the PurchaseHostReservation operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RequestSpotInstances for more information on using the RequestSpotInstances +// See PurchaseHostReservation for more information on using the PurchaseHostReservation // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RequestSpotInstancesRequest method. -// req, resp := client.RequestSpotInstancesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotInstances -func (c *EC2) RequestSpotInstancesRequest(input *RequestSpotInstancesInput) (req *request.Request, output *RequestSpotInstancesOutput) { +// See also, 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: opRequestSpotInstances, + Name: opPurchaseHostReservation, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RequestSpotInstancesInput{} + input = &PurchaseHostReservationInput{} } - output = &RequestSpotInstancesOutput{} + output = &PurchaseHostReservationOutput{} req = c.newRequest(op, input, output) return } -// RequestSpotInstances API operation for Amazon Elastic Compute Cloud. -// -// Creates a Spot Instance request. +// PurchaseHostReservation API operation for Amazon Elastic Compute Cloud. // -// For more information, see Spot Instance Requests (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html) -// in the Amazon EC2 User Guide for Linux Instances. +// 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 RequestSpotInstances for usage and error information. -// See also, 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) +// API operation PurchaseHostReservation for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseHostReservation +func (c *EC2) PurchaseHostReservation(input *PurchaseHostReservationInput) (*PurchaseHostReservationOutput, error) { + req, out := c.PurchaseHostReservationRequest(input) return out, req.Send() } -// RequestSpotInstancesWithContext is the same as RequestSpotInstances with the addition of +// PurchaseHostReservationWithContext is the same as PurchaseHostReservation with the addition of // the ability to pass a context and additional request options. // -// See RequestSpotInstances for details on how to use this API operation. +// See PurchaseHostReservation for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) RequestSpotInstancesWithContext(ctx aws.Context, input *RequestSpotInstancesInput, opts ...request.Option) (*RequestSpotInstancesOutput, error) { - req, out := c.RequestSpotInstancesRequest(input) +func (c *EC2) PurchaseHostReservationWithContext(ctx aws.Context, input *PurchaseHostReservationInput, opts ...request.Option) (*PurchaseHostReservationOutput, error) { + req, out := c.PurchaseHostReservationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opResetEbsDefaultKmsKeyId = "ResetEbsDefaultKmsKeyId" +const opPurchaseReservedInstancesOffering = "PurchaseReservedInstancesOffering" -// ResetEbsDefaultKmsKeyIdRequest generates a "aws/request.Request" representing the -// client's request for the ResetEbsDefaultKmsKeyId operation. The "output" return +// PurchaseReservedInstancesOfferingRequest generates a "aws/request.Request" representing the +// client's request for the PurchaseReservedInstancesOffering operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ResetEbsDefaultKmsKeyId for more information on using the ResetEbsDefaultKmsKeyId +// See PurchaseReservedInstancesOffering for more information on using the PurchaseReservedInstancesOffering // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ResetEbsDefaultKmsKeyIdRequest method. -// req, resp := client.ResetEbsDefaultKmsKeyIdRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetEbsDefaultKmsKeyId -func (c *EC2) ResetEbsDefaultKmsKeyIdRequest(input *ResetEbsDefaultKmsKeyIdInput) (req *request.Request, output *ResetEbsDefaultKmsKeyIdOutput) { +// See also, 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: opResetEbsDefaultKmsKeyId, + Name: opPurchaseReservedInstancesOffering, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ResetEbsDefaultKmsKeyIdInput{} + input = &PurchaseReservedInstancesOfferingInput{} } - output = &ResetEbsDefaultKmsKeyIdOutput{} + output = &PurchaseReservedInstancesOfferingOutput{} req = c.newRequest(op, input, output) return } -// ResetEbsDefaultKmsKeyId API operation for Amazon Elastic Compute Cloud. +// PurchaseReservedInstancesOffering API operation for Amazon Elastic Compute Cloud. // -// Resets the default customer master key (CMK) for EBS encryption for your -// account in this Region to the AWS managed CMK for EBS. +// Purchases a Reserved Instance for use with your account. With Reserved Instances, +// you pay a lower hourly rate compared to On-Demand instance pricing. // -// After resetting the default CMK to the AWS managed CMK, you can continue -// to encrypt by a customer managed CMK by specifying it when you create the -// volume. For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) +// 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. +// +// To queue a purchase for a future date and time, specify a purchase time. +// If you do not specify a purchase time, the default is the current time. +// +// For more information, see Reserved Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts-on-demand-reserved-instances.html) +// and Reserved Instance Marketplace (https://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 @@ -30700,2023 +32972,6772 @@ func (c *EC2) ResetEbsDefaultKmsKeyIdRequest(input *ResetEbsDefaultKmsKeyIdInput // the error. // // See the AWS API reference guide for Amazon Elastic Compute Cloud's -// API operation ResetEbsDefaultKmsKeyId for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetEbsDefaultKmsKeyId -func (c *EC2) ResetEbsDefaultKmsKeyId(input *ResetEbsDefaultKmsKeyIdInput) (*ResetEbsDefaultKmsKeyIdOutput, error) { - req, out := c.ResetEbsDefaultKmsKeyIdRequest(input) +// API operation PurchaseReservedInstancesOffering for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseReservedInstancesOffering +func (c *EC2) PurchaseReservedInstancesOffering(input *PurchaseReservedInstancesOfferingInput) (*PurchaseReservedInstancesOfferingOutput, error) { + req, out := c.PurchaseReservedInstancesOfferingRequest(input) return out, req.Send() } -// ResetEbsDefaultKmsKeyIdWithContext is the same as ResetEbsDefaultKmsKeyId with the addition of +// PurchaseReservedInstancesOfferingWithContext is the same as PurchaseReservedInstancesOffering with the addition of // the ability to pass a context and additional request options. // -// See ResetEbsDefaultKmsKeyId for details on how to use this API operation. +// See PurchaseReservedInstancesOffering for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ResetEbsDefaultKmsKeyIdWithContext(ctx aws.Context, input *ResetEbsDefaultKmsKeyIdInput, opts ...request.Option) (*ResetEbsDefaultKmsKeyIdOutput, error) { - req, out := c.ResetEbsDefaultKmsKeyIdRequest(input) +func (c *EC2) PurchaseReservedInstancesOfferingWithContext(ctx aws.Context, input *PurchaseReservedInstancesOfferingInput, opts ...request.Option) (*PurchaseReservedInstancesOfferingOutput, error) { + req, out := c.PurchaseReservedInstancesOfferingRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opResetFpgaImageAttribute = "ResetFpgaImageAttribute" +const opPurchaseScheduledInstances = "PurchaseScheduledInstances" -// ResetFpgaImageAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ResetFpgaImageAttribute operation. The "output" return +// PurchaseScheduledInstancesRequest generates a "aws/request.Request" representing the +// client's request for the PurchaseScheduledInstances operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ResetFpgaImageAttribute for more information on using the ResetFpgaImageAttribute +// See PurchaseScheduledInstances for more information on using the PurchaseScheduledInstances // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ResetFpgaImageAttributeRequest method. -// req, resp := client.ResetFpgaImageAttributeRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetFpgaImageAttribute -func (c *EC2) ResetFpgaImageAttributeRequest(input *ResetFpgaImageAttributeInput) (req *request.Request, output *ResetFpgaImageAttributeOutput) { +// See also, 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: opResetFpgaImageAttribute, + Name: opPurchaseScheduledInstances, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ResetFpgaImageAttributeInput{} + input = &PurchaseScheduledInstancesInput{} } - output = &ResetFpgaImageAttributeOutput{} + output = &PurchaseScheduledInstancesOutput{} req = c.newRequest(op, input, output) return } -// ResetFpgaImageAttribute API operation for Amazon Elastic Compute Cloud. +// PurchaseScheduledInstances API operation for Amazon Elastic Compute Cloud. // -// Resets the specified attribute of the specified Amazon FPGA Image (AFI) to -// its default value. You can only reset the load permission attribute. +// Purchases the 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 ResetFpgaImageAttribute for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetFpgaImageAttribute -func (c *EC2) ResetFpgaImageAttribute(input *ResetFpgaImageAttributeInput) (*ResetFpgaImageAttributeOutput, error) { - req, out := c.ResetFpgaImageAttributeRequest(input) +// API operation PurchaseScheduledInstances for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/PurchaseScheduledInstances +func (c *EC2) PurchaseScheduledInstances(input *PurchaseScheduledInstancesInput) (*PurchaseScheduledInstancesOutput, error) { + req, out := c.PurchaseScheduledInstancesRequest(input) return out, req.Send() } -// ResetFpgaImageAttributeWithContext is the same as ResetFpgaImageAttribute with the addition of +// PurchaseScheduledInstancesWithContext is the same as PurchaseScheduledInstances with the addition of // the ability to pass a context and additional request options. // -// See ResetFpgaImageAttribute for details on how to use this API operation. +// See PurchaseScheduledInstances for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ResetFpgaImageAttributeWithContext(ctx aws.Context, input *ResetFpgaImageAttributeInput, opts ...request.Option) (*ResetFpgaImageAttributeOutput, error) { - req, out := c.ResetFpgaImageAttributeRequest(input) +func (c *EC2) PurchaseScheduledInstancesWithContext(ctx aws.Context, input *PurchaseScheduledInstancesInput, opts ...request.Option) (*PurchaseScheduledInstancesOutput, error) { + req, out := c.PurchaseScheduledInstancesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opResetImageAttribute = "ResetImageAttribute" +const opRebootInstances = "RebootInstances" -// ResetImageAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ResetImageAttribute operation. The "output" return +// RebootInstancesRequest generates a "aws/request.Request" representing the +// client's request for the RebootInstances operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ResetImageAttribute for more information on using the ResetImageAttribute +// See RebootInstances for more information on using the RebootInstances // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ResetImageAttributeRequest method. -// req, resp := client.ResetImageAttributeRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetImageAttribute -func (c *EC2) ResetImageAttributeRequest(input *ResetImageAttributeInput) (req *request.Request, output *ResetImageAttributeOutput) { +// See also, 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: opResetImageAttribute, + Name: opRebootInstances, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ResetImageAttributeInput{} + input = &RebootInstancesInput{} } - output = &ResetImageAttributeOutput{} + output = &RebootInstancesOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ResetImageAttribute API operation for Amazon Elastic Compute Cloud. +// RebootInstances API operation for Amazon Elastic Compute Cloud. // -// Resets an attribute of an AMI to its default value. +// Requests a reboot of the specified 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. // -// The productCodes attribute can't be reset. +// 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 (https://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 ResetImageAttribute for usage and error information. -// See also, 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) +// API operation RebootInstances for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RebootInstances +func (c *EC2) RebootInstances(input *RebootInstancesInput) (*RebootInstancesOutput, error) { + req, out := c.RebootInstancesRequest(input) return out, req.Send() } -// ResetImageAttributeWithContext is the same as ResetImageAttribute with the addition of +// RebootInstancesWithContext is the same as RebootInstances with the addition of // the ability to pass a context and additional request options. // -// See ResetImageAttribute for details on how to use this API operation. +// See RebootInstances for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ResetImageAttributeWithContext(ctx aws.Context, input *ResetImageAttributeInput, opts ...request.Option) (*ResetImageAttributeOutput, error) { - req, out := c.ResetImageAttributeRequest(input) +func (c *EC2) RebootInstancesWithContext(ctx aws.Context, input *RebootInstancesInput, opts ...request.Option) (*RebootInstancesOutput, error) { + req, out := c.RebootInstancesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opResetInstanceAttribute = "ResetInstanceAttribute" +const opRegisterImage = "RegisterImage" -// ResetInstanceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ResetInstanceAttribute operation. The "output" return +// RegisterImageRequest generates a "aws/request.Request" representing the +// client's request for the RegisterImage operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ResetInstanceAttribute for more information on using the ResetInstanceAttribute +// See RegisterImage for more information on using the RegisterImage // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ResetInstanceAttributeRequest method. -// req, resp := client.ResetInstanceAttributeRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetInstanceAttribute -func (c *EC2) ResetInstanceAttributeRequest(input *ResetInstanceAttributeInput) (req *request.Request, output *ResetInstanceAttributeOutput) { +// See also, 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: opResetInstanceAttribute, + Name: opRegisterImage, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ResetInstanceAttributeInput{} + input = &RegisterImageInput{} } - output = &ResetInstanceAttributeOutput{} + output = &RegisterImageOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ResetInstanceAttribute API operation for Amazon Elastic Compute Cloud. +// RegisterImage 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. +// 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 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami.html) +// in the Amazon Elastic Compute Cloud User Guide. // -// 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 (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html) -// in the Amazon Virtual Private Cloud User Guide. +// For Amazon EBS-backed instances, CreateImage creates and registers the AMI +// in a single request, so you don't have to register the AMI yourself. +// +// You can also use RegisterImage to create an Amazon EBS-backed Linux AMI from +// a snapshot of a root device volume. You specify the snapshot using the block +// device mapping. For more information, see Launching a Linux Instance from +// a Backup (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-launch-snapshot.html) +// in the Amazon Elastic Compute Cloud User Guide. +// +// You can't register an image where a secondary (non-root) snapshot has AWS +// Marketplace product codes. +// +// Windows and 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. +// To create a new AMI for operating systems that require a billing product +// code, instead of registering the AMI, do the following to preserve the billing +// product code association: +// +// Launch an instance from an existing AMI with that billing product code. +// +// Customize the instance. +// +// Create an AMI from the instance using CreateImage. +// +// If you purchase a Reserved Instance to apply to an On-Demand Instance that +// was launched from an AMI with a billing product code, make sure that the +// Reserved Instance has the matching billing product code. If you purchase +// a Reserved Instance without the matching billing product code, the Reserved +// Instance will not be applied to the On-Demand Instance. For information about +// how to obtain the platform details and billing information of an AMI, see +// Obtaining Billing Information (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html) +// in the Amazon Elastic Compute Cloud User Guide. +// +// 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 ResetInstanceAttribute for usage and error information. -// See also, 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) +// API operation RegisterImage for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RegisterImage +func (c *EC2) RegisterImage(input *RegisterImageInput) (*RegisterImageOutput, error) { + req, out := c.RegisterImageRequest(input) return out, req.Send() } -// ResetInstanceAttributeWithContext is the same as ResetInstanceAttribute with the addition of +// RegisterImageWithContext is the same as RegisterImage with the addition of // the ability to pass a context and additional request options. // -// See ResetInstanceAttribute for details on how to use this API operation. +// See RegisterImage for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ResetInstanceAttributeWithContext(ctx aws.Context, input *ResetInstanceAttributeInput, opts ...request.Option) (*ResetInstanceAttributeOutput, error) { - req, out := c.ResetInstanceAttributeRequest(input) +func (c *EC2) RegisterImageWithContext(ctx aws.Context, input *RegisterImageInput, opts ...request.Option) (*RegisterImageOutput, error) { + req, out := c.RegisterImageRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opResetNetworkInterfaceAttribute = "ResetNetworkInterfaceAttribute" +const opRegisterTransitGatewayMulticastGroupMembers = "RegisterTransitGatewayMulticastGroupMembers" -// ResetNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ResetNetworkInterfaceAttribute operation. The "output" return +// RegisterTransitGatewayMulticastGroupMembersRequest generates a "aws/request.Request" representing the +// client's request for the RegisterTransitGatewayMulticastGroupMembers operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ResetNetworkInterfaceAttribute for more information on using the ResetNetworkInterfaceAttribute +// See RegisterTransitGatewayMulticastGroupMembers for more information on using the RegisterTransitGatewayMulticastGroupMembers // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ResetNetworkInterfaceAttributeRequest method. -// req, resp := client.ResetNetworkInterfaceAttributeRequest(params) +// // Example sending a request using the RegisterTransitGatewayMulticastGroupMembersRequest method. +// req, resp := client.RegisterTransitGatewayMulticastGroupMembersRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetNetworkInterfaceAttribute -func (c *EC2) ResetNetworkInterfaceAttributeRequest(input *ResetNetworkInterfaceAttributeInput) (req *request.Request, output *ResetNetworkInterfaceAttributeOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RegisterTransitGatewayMulticastGroupMembers +func (c *EC2) RegisterTransitGatewayMulticastGroupMembersRequest(input *RegisterTransitGatewayMulticastGroupMembersInput) (req *request.Request, output *RegisterTransitGatewayMulticastGroupMembersOutput) { op := &request.Operation{ - Name: opResetNetworkInterfaceAttribute, + Name: opRegisterTransitGatewayMulticastGroupMembers, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ResetNetworkInterfaceAttributeInput{} + input = &RegisterTransitGatewayMulticastGroupMembersInput{} } - output = &ResetNetworkInterfaceAttributeOutput{} + output = &RegisterTransitGatewayMulticastGroupMembersOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ResetNetworkInterfaceAttribute API operation for Amazon Elastic Compute Cloud. +// RegisterTransitGatewayMulticastGroupMembers API operation for Amazon Elastic Compute Cloud. // -// Resets a network interface attribute. You can specify only one attribute -// at a time. +// Registers members (network interfaces) with the transit gateway multicast +// group. A member is a network interface associated with a supported EC2 instance +// that receives multicast traffic. For information about supported instances, +// see Multicast Consideration (https://docs.aws.amazon.com/vpc/latest/tgw/transit-gateway-limits.html#multicast-limits) +// in Amazon VPC Transit Gateways. +// +// After you add the members, use SearchTransitGatewayMulticastGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SearchTransitGatewayMulticastGroups.html) +// to verify that the members were added to the transit gateway multicast 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 Elastic Compute Cloud's -// API operation ResetNetworkInterfaceAttribute for usage and error information. -// See also, 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) +// API operation RegisterTransitGatewayMulticastGroupMembers for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RegisterTransitGatewayMulticastGroupMembers +func (c *EC2) RegisterTransitGatewayMulticastGroupMembers(input *RegisterTransitGatewayMulticastGroupMembersInput) (*RegisterTransitGatewayMulticastGroupMembersOutput, error) { + req, out := c.RegisterTransitGatewayMulticastGroupMembersRequest(input) return out, req.Send() } -// ResetNetworkInterfaceAttributeWithContext is the same as ResetNetworkInterfaceAttribute with the addition of +// RegisterTransitGatewayMulticastGroupMembersWithContext is the same as RegisterTransitGatewayMulticastGroupMembers with the addition of // the ability to pass a context and additional request options. // -// See ResetNetworkInterfaceAttribute for details on how to use this API operation. +// See RegisterTransitGatewayMulticastGroupMembers for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ResetNetworkInterfaceAttributeWithContext(ctx aws.Context, input *ResetNetworkInterfaceAttributeInput, opts ...request.Option) (*ResetNetworkInterfaceAttributeOutput, error) { - req, out := c.ResetNetworkInterfaceAttributeRequest(input) +func (c *EC2) RegisterTransitGatewayMulticastGroupMembersWithContext(ctx aws.Context, input *RegisterTransitGatewayMulticastGroupMembersInput, opts ...request.Option) (*RegisterTransitGatewayMulticastGroupMembersOutput, error) { + req, out := c.RegisterTransitGatewayMulticastGroupMembersRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opResetSnapshotAttribute = "ResetSnapshotAttribute" +const opRegisterTransitGatewayMulticastGroupSources = "RegisterTransitGatewayMulticastGroupSources" -// ResetSnapshotAttributeRequest generates a "aws/request.Request" representing the -// client's request for the ResetSnapshotAttribute operation. The "output" return +// RegisterTransitGatewayMulticastGroupSourcesRequest generates a "aws/request.Request" representing the +// client's request for the RegisterTransitGatewayMulticastGroupSources operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ResetSnapshotAttribute for more information on using the ResetSnapshotAttribute +// See RegisterTransitGatewayMulticastGroupSources for more information on using the RegisterTransitGatewayMulticastGroupSources // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ResetSnapshotAttributeRequest method. -// req, resp := client.ResetSnapshotAttributeRequest(params) +// // Example sending a request using the RegisterTransitGatewayMulticastGroupSourcesRequest method. +// req, resp := client.RegisterTransitGatewayMulticastGroupSourcesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetSnapshotAttribute -func (c *EC2) ResetSnapshotAttributeRequest(input *ResetSnapshotAttributeInput) (req *request.Request, output *ResetSnapshotAttributeOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RegisterTransitGatewayMulticastGroupSources +func (c *EC2) RegisterTransitGatewayMulticastGroupSourcesRequest(input *RegisterTransitGatewayMulticastGroupSourcesInput) (req *request.Request, output *RegisterTransitGatewayMulticastGroupSourcesOutput) { op := &request.Operation{ - Name: opResetSnapshotAttribute, + Name: opRegisterTransitGatewayMulticastGroupSources, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ResetSnapshotAttributeInput{} + input = &RegisterTransitGatewayMulticastGroupSourcesInput{} } - output = &ResetSnapshotAttributeOutput{} + output = &RegisterTransitGatewayMulticastGroupSourcesOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ResetSnapshotAttribute API operation for Amazon Elastic Compute Cloud. +// RegisterTransitGatewayMulticastGroupSources API operation for Amazon Elastic Compute Cloud. // -// Resets permission settings for the specified snapshot. +// Registers sources (network interfaces) with the specified transit gateway +// multicast group. // -// For more information about modifying snapshot permissions, see Sharing Snapshots -// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-modifying-snapshot-permissions.html) -// in the Amazon Elastic Compute Cloud User Guide. +// A multicast source is a network interface attached to a supported instance +// that sends multicast traffic. For information about supported instances, +// see Multicast Considerations (https://docs.aws.amazon.com/vpc/latest/tgw/transit-gateway-limits.html#multicast-limits) +// in Amazon VPC Transit Gateways. +// +// After you add the source, use SearchTransitGatewayMulticastGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SearchTransitGatewayMulticastGroups.html) +// to verify that the source was added to the multicast 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 Elastic Compute Cloud's -// API operation ResetSnapshotAttribute for usage and error information. -// See also, 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) +// API operation RegisterTransitGatewayMulticastGroupSources for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RegisterTransitGatewayMulticastGroupSources +func (c *EC2) RegisterTransitGatewayMulticastGroupSources(input *RegisterTransitGatewayMulticastGroupSourcesInput) (*RegisterTransitGatewayMulticastGroupSourcesOutput, error) { + req, out := c.RegisterTransitGatewayMulticastGroupSourcesRequest(input) return out, req.Send() } -// ResetSnapshotAttributeWithContext is the same as ResetSnapshotAttribute with the addition of +// RegisterTransitGatewayMulticastGroupSourcesWithContext is the same as RegisterTransitGatewayMulticastGroupSources with the addition of // the ability to pass a context and additional request options. // -// See ResetSnapshotAttribute for details on how to use this API operation. +// See RegisterTransitGatewayMulticastGroupSources for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) ResetSnapshotAttributeWithContext(ctx aws.Context, input *ResetSnapshotAttributeInput, opts ...request.Option) (*ResetSnapshotAttributeOutput, error) { - req, out := c.ResetSnapshotAttributeRequest(input) +func (c *EC2) RegisterTransitGatewayMulticastGroupSourcesWithContext(ctx aws.Context, input *RegisterTransitGatewayMulticastGroupSourcesInput, opts ...request.Option) (*RegisterTransitGatewayMulticastGroupSourcesOutput, error) { + req, out := c.RegisterTransitGatewayMulticastGroupSourcesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRestoreAddressToClassic = "RestoreAddressToClassic" +const opRejectTransitGatewayPeeringAttachment = "RejectTransitGatewayPeeringAttachment" -// RestoreAddressToClassicRequest generates a "aws/request.Request" representing the -// client's request for the RestoreAddressToClassic operation. The "output" return +// RejectTransitGatewayPeeringAttachmentRequest generates a "aws/request.Request" representing the +// client's request for the RejectTransitGatewayPeeringAttachment operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RestoreAddressToClassic for more information on using the RestoreAddressToClassic +// See RejectTransitGatewayPeeringAttachment for more information on using the RejectTransitGatewayPeeringAttachment // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RestoreAddressToClassicRequest method. -// req, resp := client.RestoreAddressToClassicRequest(params) +// // Example sending a request using the RejectTransitGatewayPeeringAttachmentRequest method. +// req, resp := client.RejectTransitGatewayPeeringAttachmentRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RestoreAddressToClassic -func (c *EC2) RestoreAddressToClassicRequest(input *RestoreAddressToClassicInput) (req *request.Request, output *RestoreAddressToClassicOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectTransitGatewayPeeringAttachment +func (c *EC2) RejectTransitGatewayPeeringAttachmentRequest(input *RejectTransitGatewayPeeringAttachmentInput) (req *request.Request, output *RejectTransitGatewayPeeringAttachmentOutput) { op := &request.Operation{ - Name: opRestoreAddressToClassic, + Name: opRejectTransitGatewayPeeringAttachment, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RestoreAddressToClassicInput{} + input = &RejectTransitGatewayPeeringAttachmentInput{} } - output = &RestoreAddressToClassicOutput{} + output = &RejectTransitGatewayPeeringAttachmentOutput{} req = c.newRequest(op, input, output) return } -// RestoreAddressToClassic API operation for Amazon Elastic Compute Cloud. +// RejectTransitGatewayPeeringAttachment 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. +// Rejects a transit gateway peering attachment 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 RestoreAddressToClassic for usage and error information. -// See also, 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) +// API operation RejectTransitGatewayPeeringAttachment for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectTransitGatewayPeeringAttachment +func (c *EC2) RejectTransitGatewayPeeringAttachment(input *RejectTransitGatewayPeeringAttachmentInput) (*RejectTransitGatewayPeeringAttachmentOutput, error) { + req, out := c.RejectTransitGatewayPeeringAttachmentRequest(input) return out, req.Send() } -// RestoreAddressToClassicWithContext is the same as RestoreAddressToClassic with the addition of +// RejectTransitGatewayPeeringAttachmentWithContext is the same as RejectTransitGatewayPeeringAttachment with the addition of // the ability to pass a context and additional request options. // -// See RestoreAddressToClassic for details on how to use this API operation. +// See RejectTransitGatewayPeeringAttachment for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) RestoreAddressToClassicWithContext(ctx aws.Context, input *RestoreAddressToClassicInput, opts ...request.Option) (*RestoreAddressToClassicOutput, error) { - req, out := c.RestoreAddressToClassicRequest(input) +func (c *EC2) RejectTransitGatewayPeeringAttachmentWithContext(ctx aws.Context, input *RejectTransitGatewayPeeringAttachmentInput, opts ...request.Option) (*RejectTransitGatewayPeeringAttachmentOutput, error) { + req, out := c.RejectTransitGatewayPeeringAttachmentRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRevokeClientVpnIngress = "RevokeClientVpnIngress" +const opRejectTransitGatewayVpcAttachment = "RejectTransitGatewayVpcAttachment" -// RevokeClientVpnIngressRequest generates a "aws/request.Request" representing the -// client's request for the RevokeClientVpnIngress operation. The "output" return +// RejectTransitGatewayVpcAttachmentRequest generates a "aws/request.Request" representing the +// client's request for the RejectTransitGatewayVpcAttachment operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RevokeClientVpnIngress for more information on using the RevokeClientVpnIngress +// See RejectTransitGatewayVpcAttachment for more information on using the RejectTransitGatewayVpcAttachment // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RevokeClientVpnIngressRequest method. -// req, resp := client.RevokeClientVpnIngressRequest(params) +// // Example sending a request using the RejectTransitGatewayVpcAttachmentRequest method. +// req, resp := client.RejectTransitGatewayVpcAttachmentRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeClientVpnIngress -func (c *EC2) RevokeClientVpnIngressRequest(input *RevokeClientVpnIngressInput) (req *request.Request, output *RevokeClientVpnIngressOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectTransitGatewayVpcAttachment +func (c *EC2) RejectTransitGatewayVpcAttachmentRequest(input *RejectTransitGatewayVpcAttachmentInput) (req *request.Request, output *RejectTransitGatewayVpcAttachmentOutput) { op := &request.Operation{ - Name: opRevokeClientVpnIngress, + Name: opRejectTransitGatewayVpcAttachment, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RevokeClientVpnIngressInput{} + input = &RejectTransitGatewayVpcAttachmentInput{} } - output = &RevokeClientVpnIngressOutput{} + output = &RejectTransitGatewayVpcAttachmentOutput{} req = c.newRequest(op, input, output) return } -// RevokeClientVpnIngress API operation for Amazon Elastic Compute Cloud. +// RejectTransitGatewayVpcAttachment API operation for Amazon Elastic Compute Cloud. // -// Removes an ingress authorization rule from a Client VPN endpoint. +// Rejects a request to attach a VPC to a transit gateway. +// +// The VPC attachment must be in the pendingAcceptance state. Use DescribeTransitGatewayVpcAttachments +// to view your pending VPC attachment requests. Use AcceptTransitGatewayVpcAttachment +// to accept a VPC attachment 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 RevokeClientVpnIngress for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeClientVpnIngress -func (c *EC2) RevokeClientVpnIngress(input *RevokeClientVpnIngressInput) (*RevokeClientVpnIngressOutput, error) { - req, out := c.RevokeClientVpnIngressRequest(input) +// API operation RejectTransitGatewayVpcAttachment for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectTransitGatewayVpcAttachment +func (c *EC2) RejectTransitGatewayVpcAttachment(input *RejectTransitGatewayVpcAttachmentInput) (*RejectTransitGatewayVpcAttachmentOutput, error) { + req, out := c.RejectTransitGatewayVpcAttachmentRequest(input) return out, req.Send() } -// RevokeClientVpnIngressWithContext is the same as RevokeClientVpnIngress with the addition of +// RejectTransitGatewayVpcAttachmentWithContext is the same as RejectTransitGatewayVpcAttachment with the addition of // the ability to pass a context and additional request options. // -// See RevokeClientVpnIngress for details on how to use this API operation. +// See RejectTransitGatewayVpcAttachment for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) RevokeClientVpnIngressWithContext(ctx aws.Context, input *RevokeClientVpnIngressInput, opts ...request.Option) (*RevokeClientVpnIngressOutput, error) { - req, out := c.RevokeClientVpnIngressRequest(input) +func (c *EC2) RejectTransitGatewayVpcAttachmentWithContext(ctx aws.Context, input *RejectTransitGatewayVpcAttachmentInput, opts ...request.Option) (*RejectTransitGatewayVpcAttachmentOutput, error) { + req, out := c.RejectTransitGatewayVpcAttachmentRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRevokeSecurityGroupEgress = "RevokeSecurityGroupEgress" +const opRejectVpcEndpointConnections = "RejectVpcEndpointConnections" -// RevokeSecurityGroupEgressRequest generates a "aws/request.Request" representing the -// client's request for the RevokeSecurityGroupEgress operation. The "output" return +// RejectVpcEndpointConnectionsRequest generates a "aws/request.Request" representing the +// client's request for the RejectVpcEndpointConnections operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RevokeSecurityGroupEgress for more information on using the RevokeSecurityGroupEgress +// See RejectVpcEndpointConnections for more information on using the RejectVpcEndpointConnections // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RevokeSecurityGroupEgressRequest method. -// req, resp := client.RevokeSecurityGroupEgressRequest(params) +// // Example sending a request using the RejectVpcEndpointConnectionsRequest method. +// req, resp := client.RejectVpcEndpointConnectionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupEgress -func (c *EC2) RevokeSecurityGroupEgressRequest(input *RevokeSecurityGroupEgressInput) (req *request.Request, output *RevokeSecurityGroupEgressOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectVpcEndpointConnections +func (c *EC2) RejectVpcEndpointConnectionsRequest(input *RejectVpcEndpointConnectionsInput) (req *request.Request, output *RejectVpcEndpointConnectionsOutput) { op := &request.Operation{ - Name: opRevokeSecurityGroupEgress, + Name: opRejectVpcEndpointConnections, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RevokeSecurityGroupEgressInput{} + input = &RejectVpcEndpointConnectionsInput{} } - output = &RevokeSecurityGroupEgressOutput{} + output = &RejectVpcEndpointConnectionsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// RevokeSecurityGroupEgress API operation for Amazon Elastic Compute Cloud. -// -// [VPC only] Removes the specified egress rules from a security group for EC2-VPC. -// This action doesn't apply to security groups for use in EC2-Classic. To remove -// a rule, the values that you specify (for example, ports) must match the existing -// rule's values exactly. -// -// 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. If the security group rule has a description, -// you do not have to specify the description to revoke the rule. +// RejectVpcEndpointConnections API operation for Amazon Elastic Compute Cloud. // -// Rule changes are propagated to instances within the security group as quickly -// as possible. However, a small delay might occur. +// Rejects one or more VPC endpoint connection requests to your VPC endpoint +// 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 RevokeSecurityGroupEgress for usage and error information. -// See also, 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) +// API operation RejectVpcEndpointConnections for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectVpcEndpointConnections +func (c *EC2) RejectVpcEndpointConnections(input *RejectVpcEndpointConnectionsInput) (*RejectVpcEndpointConnectionsOutput, error) { + req, out := c.RejectVpcEndpointConnectionsRequest(input) return out, req.Send() } -// RevokeSecurityGroupEgressWithContext is the same as RevokeSecurityGroupEgress with the addition of +// RejectVpcEndpointConnectionsWithContext is the same as RejectVpcEndpointConnections with the addition of // the ability to pass a context and additional request options. // -// See RevokeSecurityGroupEgress for details on how to use this API operation. +// See RejectVpcEndpointConnections for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) RevokeSecurityGroupEgressWithContext(ctx aws.Context, input *RevokeSecurityGroupEgressInput, opts ...request.Option) (*RevokeSecurityGroupEgressOutput, error) { - req, out := c.RevokeSecurityGroupEgressRequest(input) +func (c *EC2) RejectVpcEndpointConnectionsWithContext(ctx aws.Context, input *RejectVpcEndpointConnectionsInput, opts ...request.Option) (*RejectVpcEndpointConnectionsOutput, error) { + req, out := c.RejectVpcEndpointConnectionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRevokeSecurityGroupIngress = "RevokeSecurityGroupIngress" +const opRejectVpcPeeringConnection = "RejectVpcPeeringConnection" -// RevokeSecurityGroupIngressRequest generates a "aws/request.Request" representing the -// client's request for the RevokeSecurityGroupIngress operation. The "output" return +// RejectVpcPeeringConnectionRequest generates a "aws/request.Request" representing the +// client's request for the RejectVpcPeeringConnection operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RevokeSecurityGroupIngress for more information on using the RevokeSecurityGroupIngress +// See RejectVpcPeeringConnection for more information on using the RejectVpcPeeringConnection // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RevokeSecurityGroupIngressRequest method. -// req, resp := client.RevokeSecurityGroupIngressRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupIngress -func (c *EC2) RevokeSecurityGroupIngressRequest(input *RevokeSecurityGroupIngressInput) (req *request.Request, output *RevokeSecurityGroupIngressOutput) { +// See also, 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: opRevokeSecurityGroupIngress, + Name: opRejectVpcPeeringConnection, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RevokeSecurityGroupIngressInput{} + input = &RejectVpcPeeringConnectionInput{} } - output = &RevokeSecurityGroupIngressOutput{} + output = &RejectVpcPeeringConnectionOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// RevokeSecurityGroupIngress API operation for Amazon Elastic Compute Cloud. -// -// Removes the specified ingress rules from a security group. To remove a rule, -// the values that you specify (for example, ports) must match the existing -// rule's values exactly. -// -// [EC2-Classic only] If the values you specify do not match the existing rule's -// values, no error is returned. Use DescribeSecurityGroups to verify that the -// rule has been 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. If the security group rule has a description, you do -// not have to specify the description to revoke the rule. +// RejectVpcPeeringConnection API operation for Amazon Elastic Compute Cloud. // -// Rule changes are propagated to instances within the security group as quickly -// as possible. However, a small delay might occur. +// 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 RevokeSecurityGroupIngress for usage and error information. -// See also, 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) +// API operation RejectVpcPeeringConnection for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RejectVpcPeeringConnection +func (c *EC2) RejectVpcPeeringConnection(input *RejectVpcPeeringConnectionInput) (*RejectVpcPeeringConnectionOutput, error) { + req, out := c.RejectVpcPeeringConnectionRequest(input) return out, req.Send() } -// RevokeSecurityGroupIngressWithContext is the same as RevokeSecurityGroupIngress with the addition of +// RejectVpcPeeringConnectionWithContext is the same as RejectVpcPeeringConnection with the addition of // the ability to pass a context and additional request options. // -// See RevokeSecurityGroupIngress for details on how to use this API operation. +// See RejectVpcPeeringConnection for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) RevokeSecurityGroupIngressWithContext(ctx aws.Context, input *RevokeSecurityGroupIngressInput, opts ...request.Option) (*RevokeSecurityGroupIngressOutput, error) { - req, out := c.RevokeSecurityGroupIngressRequest(input) +func (c *EC2) RejectVpcPeeringConnectionWithContext(ctx aws.Context, input *RejectVpcPeeringConnectionInput, opts ...request.Option) (*RejectVpcPeeringConnectionOutput, error) { + req, out := c.RejectVpcPeeringConnectionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRunInstances = "RunInstances" +const opReleaseAddress = "ReleaseAddress" -// RunInstancesRequest generates a "aws/request.Request" representing the -// client's request for the RunInstances operation. The "output" return +// ReleaseAddressRequest generates a "aws/request.Request" representing the +// client's request for the ReleaseAddress operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RunInstances for more information on using the RunInstances +// See ReleaseAddress for more information on using the ReleaseAddress // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RunInstancesRequest method. -// req, resp := client.RunInstancesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunInstances -func (c *EC2) RunInstancesRequest(input *RunInstancesInput) (req *request.Request, output *Reservation) { +// See also, 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: opRunInstances, + Name: opReleaseAddress, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RunInstancesInput{} + input = &ReleaseAddressInput{} } - output = &Reservation{} + output = &ReleaseAddressOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) 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 (https://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 (https://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 (https://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. +// ReleaseAddress API operation for Amazon Elastic Compute Cloud. // -// You can create a launch template (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html), -// which is a resource that contains the parameters to launch an instance. When -// you launch an instance using RunInstances, you can specify the launch template -// instead of specifying the launch parameters. +// Releases the specified Elastic IP address. // -// To ensure faster instance launches, break up large requests into smaller -// batches. For example, create five separate launch requests for 100 instances -// each instead of one launch request for 500 instances. +// [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. // -// An instance is ready for you to use when it's in the running state. You can -// check the state of your instance using DescribeInstances. You can tag instances -// and EBS volumes during launch, after launch, or both. For more information, -// see CreateTags and Tagging Your Amazon EC2 Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html). +// [Nondefault VPC] You must use DisassociateAddress to disassociate the Elastic +// IP address before you can release it. Otherwise, Amazon EC2 returns an error +// (InvalidIPAddress.InUse). // -// 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 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) -// in the Amazon Elastic Compute Cloud User Guide. +// After releasing an Elastic IP address, it is released to the IP address pool. +// 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. // -// For troubleshooting, see What To Do If An Instance Immediately Terminates -// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_InstanceStraightToTerminated.html), -// and Troubleshooting Connecting to Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesConnecting.html) -// in the Amazon Elastic Compute Cloud User Guide. +// [EC2-VPC] After you release an Elastic IP address for use in a VPC, you might +// be able to recover it. For more information, see AllocateAddress. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code 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. -// See also, 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) +// API operation ReleaseAddress for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseAddress +func (c *EC2) ReleaseAddress(input *ReleaseAddressInput) (*ReleaseAddressOutput, error) { + req, out := c.ReleaseAddressRequest(input) return out, req.Send() } -// RunInstancesWithContext is the same as RunInstances with the addition of +// ReleaseAddressWithContext is the same as ReleaseAddress with the addition of // the ability to pass a context and additional request options. // -// See RunInstances for details on how to use this API operation. +// See ReleaseAddress for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) RunInstancesWithContext(ctx aws.Context, input *RunInstancesInput, opts ...request.Option) (*Reservation, error) { - req, out := c.RunInstancesRequest(input) +func (c *EC2) ReleaseAddressWithContext(ctx aws.Context, input *ReleaseAddressInput, opts ...request.Option) (*ReleaseAddressOutput, error) { + req, out := c.ReleaseAddressRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRunScheduledInstances = "RunScheduledInstances" +const opReleaseHosts = "ReleaseHosts" -// RunScheduledInstancesRequest generates a "aws/request.Request" representing the -// client's request for the RunScheduledInstances operation. The "output" return +// ReleaseHostsRequest generates a "aws/request.Request" representing the +// client's request for the ReleaseHosts operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RunScheduledInstances for more information on using the RunScheduledInstances +// See ReleaseHosts for more information on using the ReleaseHosts // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RunScheduledInstancesRequest method. -// req, resp := client.RunScheduledInstancesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunScheduledInstances -func (c *EC2) RunScheduledInstancesRequest(input *RunScheduledInstancesInput) (req *request.Request, output *RunScheduledInstancesOutput) { +// See also, 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: opRunScheduledInstances, + Name: opReleaseHosts, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RunScheduledInstancesInput{} + input = &ReleaseHostsInput{} } - output = &RunScheduledInstancesOutput{} + output = &ReleaseHostsOutput{} req = c.newRequest(op, input, output) return } -// RunScheduledInstances API operation for Amazon Elastic Compute Cloud. +// ReleaseHosts API operation for Amazon Elastic Compute Cloud. // -// Launches the specified Scheduled Instances. +// 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, for example, to modify the host. You must stop or terminate +// all instances on a host before it can be released. // -// Before you can launch a Scheduled Instance, you must purchase it and obtain -// an identifier using PurchaseScheduledInstances. +// When Dedicated Hosts are released, it may take some time for them to stop +// counting toward your limit and you may receive capacity errors when trying +// to allocate new Dedicated Hosts. Wait a few minutes and then try again. // -// 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 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-scheduled-instances.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Released hosts 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 RunScheduledInstances for usage and error information. -// See also, 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) +// API operation ReleaseHosts for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReleaseHosts +func (c *EC2) ReleaseHosts(input *ReleaseHostsInput) (*ReleaseHostsOutput, error) { + req, out := c.ReleaseHostsRequest(input) return out, req.Send() } -// RunScheduledInstancesWithContext is the same as RunScheduledInstances with the addition of +// ReleaseHostsWithContext is the same as ReleaseHosts with the addition of // the ability to pass a context and additional request options. // -// See RunScheduledInstances for details on how to use this API operation. +// See ReleaseHosts for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) RunScheduledInstancesWithContext(ctx aws.Context, input *RunScheduledInstancesInput, opts ...request.Option) (*RunScheduledInstancesOutput, error) { - req, out := c.RunScheduledInstancesRequest(input) +func (c *EC2) ReleaseHostsWithContext(ctx aws.Context, input *ReleaseHostsInput, opts ...request.Option) (*ReleaseHostsOutput, error) { + req, out := c.ReleaseHostsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opSearchTransitGatewayRoutes = "SearchTransitGatewayRoutes" +const opReplaceIamInstanceProfileAssociation = "ReplaceIamInstanceProfileAssociation" -// SearchTransitGatewayRoutesRequest generates a "aws/request.Request" representing the -// client's request for the SearchTransitGatewayRoutes operation. The "output" return +// ReplaceIamInstanceProfileAssociationRequest generates a "aws/request.Request" representing the +// client's request for the ReplaceIamInstanceProfileAssociation operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See SearchTransitGatewayRoutes for more information on using the SearchTransitGatewayRoutes +// See ReplaceIamInstanceProfileAssociation for more information on using the ReplaceIamInstanceProfileAssociation // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the SearchTransitGatewayRoutesRequest method. -// req, resp := client.SearchTransitGatewayRoutesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SearchTransitGatewayRoutes -func (c *EC2) SearchTransitGatewayRoutesRequest(input *SearchTransitGatewayRoutesInput) (req *request.Request, output *SearchTransitGatewayRoutesOutput) { +// See also, 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: opSearchTransitGatewayRoutes, + Name: opReplaceIamInstanceProfileAssociation, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &SearchTransitGatewayRoutesInput{} + input = &ReplaceIamInstanceProfileAssociationInput{} } - output = &SearchTransitGatewayRoutesOutput{} + output = &ReplaceIamInstanceProfileAssociationOutput{} req = c.newRequest(op, input, output) return } -// SearchTransitGatewayRoutes API operation for Amazon Elastic Compute Cloud. +// ReplaceIamInstanceProfileAssociation API operation for Amazon Elastic Compute Cloud. // -// Searches for routes in the specified transit gateway route table. +// 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 SearchTransitGatewayRoutes for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SearchTransitGatewayRoutes -func (c *EC2) SearchTransitGatewayRoutes(input *SearchTransitGatewayRoutesInput) (*SearchTransitGatewayRoutesOutput, error) { - req, out := c.SearchTransitGatewayRoutesRequest(input) +// API operation ReplaceIamInstanceProfileAssociation for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceIamInstanceProfileAssociation +func (c *EC2) ReplaceIamInstanceProfileAssociation(input *ReplaceIamInstanceProfileAssociationInput) (*ReplaceIamInstanceProfileAssociationOutput, error) { + req, out := c.ReplaceIamInstanceProfileAssociationRequest(input) return out, req.Send() } -// SearchTransitGatewayRoutesWithContext is the same as SearchTransitGatewayRoutes with the addition of +// ReplaceIamInstanceProfileAssociationWithContext is the same as ReplaceIamInstanceProfileAssociation with the addition of // the ability to pass a context and additional request options. // -// See SearchTransitGatewayRoutes for details on how to use this API operation. +// See ReplaceIamInstanceProfileAssociation for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) SearchTransitGatewayRoutesWithContext(ctx aws.Context, input *SearchTransitGatewayRoutesInput, opts ...request.Option) (*SearchTransitGatewayRoutesOutput, error) { - req, out := c.SearchTransitGatewayRoutesRequest(input) +func (c *EC2) ReplaceIamInstanceProfileAssociationWithContext(ctx aws.Context, input *ReplaceIamInstanceProfileAssociationInput, opts ...request.Option) (*ReplaceIamInstanceProfileAssociationOutput, error) { + req, out := c.ReplaceIamInstanceProfileAssociationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opSendDiagnosticInterrupt = "SendDiagnosticInterrupt" +const opReplaceNetworkAclAssociation = "ReplaceNetworkAclAssociation" -// SendDiagnosticInterruptRequest generates a "aws/request.Request" representing the -// client's request for the SendDiagnosticInterrupt operation. The "output" return +// ReplaceNetworkAclAssociationRequest generates a "aws/request.Request" representing the +// client's request for the ReplaceNetworkAclAssociation operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See SendDiagnosticInterrupt for more information on using the SendDiagnosticInterrupt +// See ReplaceNetworkAclAssociation for more information on using the ReplaceNetworkAclAssociation // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the SendDiagnosticInterruptRequest method. -// req, resp := client.SendDiagnosticInterruptRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SendDiagnosticInterrupt -func (c *EC2) SendDiagnosticInterruptRequest(input *SendDiagnosticInterruptInput) (req *request.Request, output *SendDiagnosticInterruptOutput) { +// See also, 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: opSendDiagnosticInterrupt, + Name: opReplaceNetworkAclAssociation, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &SendDiagnosticInterruptInput{} + input = &ReplaceNetworkAclAssociationInput{} } - output = &SendDiagnosticInterruptOutput{} + output = &ReplaceNetworkAclAssociationOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// SendDiagnosticInterrupt API operation for Amazon Elastic Compute Cloud. -// -// Sends a diagnostic interrupt to the specified Amazon EC2 instance to trigger -// a kernel panic (on Linux instances), or a blue screen/stop error (on Windows -// instances). For instances based on Intel and AMD processors, the interrupt -// is received as a non-maskable interrupt (NMI). -// -// In general, the operating system crashes and reboots when a kernel panic -// or stop error is triggered. The operating system can also be configured to -// perform diagnostic tasks, such as generating a memory dump file, loading -// a secondary kernel, or obtaining a call trace. +// ReplaceNetworkAclAssociation API operation for Amazon Elastic Compute Cloud. // -// Before sending a diagnostic interrupt to your instance, ensure that its operating -// system is configured to perform the required diagnostic tasks. +// 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, see Network ACLs (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_ACLs.html) +// in the Amazon Virtual Private Cloud User Guide. // -// For more information about configuring your operating system to generate -// a crash dump when a kernel panic or stop error occurs, see Send a Diagnostic -// Interrupt (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/diagnostic-interrupt.html) -// (Linux instances) or Send a Diagnostic Interrupt (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/diagnostic-interrupt.html) -// (Windows instances). +// This is an idempotent 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 Elastic Compute Cloud's -// API operation SendDiagnosticInterrupt for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SendDiagnosticInterrupt -func (c *EC2) SendDiagnosticInterrupt(input *SendDiagnosticInterruptInput) (*SendDiagnosticInterruptOutput, error) { - req, out := c.SendDiagnosticInterruptRequest(input) +// API operation ReplaceNetworkAclAssociation for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclAssociation +func (c *EC2) ReplaceNetworkAclAssociation(input *ReplaceNetworkAclAssociationInput) (*ReplaceNetworkAclAssociationOutput, error) { + req, out := c.ReplaceNetworkAclAssociationRequest(input) return out, req.Send() } -// SendDiagnosticInterruptWithContext is the same as SendDiagnosticInterrupt with the addition of +// ReplaceNetworkAclAssociationWithContext is the same as ReplaceNetworkAclAssociation with the addition of // the ability to pass a context and additional request options. // -// See SendDiagnosticInterrupt for details on how to use this API operation. +// See ReplaceNetworkAclAssociation for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) SendDiagnosticInterruptWithContext(ctx aws.Context, input *SendDiagnosticInterruptInput, opts ...request.Option) (*SendDiagnosticInterruptOutput, error) { - req, out := c.SendDiagnosticInterruptRequest(input) +func (c *EC2) ReplaceNetworkAclAssociationWithContext(ctx aws.Context, input *ReplaceNetworkAclAssociationInput, opts ...request.Option) (*ReplaceNetworkAclAssociationOutput, error) { + req, out := c.ReplaceNetworkAclAssociationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStartInstances = "StartInstances" +const opReplaceNetworkAclEntry = "ReplaceNetworkAclEntry" -// StartInstancesRequest generates a "aws/request.Request" representing the -// client's request for the StartInstances operation. The "output" return +// ReplaceNetworkAclEntryRequest generates a "aws/request.Request" representing the +// client's request for the ReplaceNetworkAclEntry operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StartInstances for more information on using the StartInstances +// See ReplaceNetworkAclEntry for more information on using the ReplaceNetworkAclEntry // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StartInstancesRequest method. -// req, resp := client.StartInstancesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StartInstances -func (c *EC2) StartInstancesRequest(input *StartInstancesInput) (req *request.Request, output *StartInstancesOutput) { +// See also, 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: opStartInstances, + Name: opReplaceNetworkAclEntry, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StartInstancesInput{} + input = &ReplaceNetworkAclEntryInput{} } - output = &StartInstancesOutput{} + output = &ReplaceNetworkAclEntryOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// StartInstances API operation for Amazon Elastic Compute Cloud. -// -// Starts an Amazon EBS-backed instance 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 instance usage. However, your root partition -// Amazon EBS volume remains and continues to persist your data, and you are -// charged for Amazon EBS volume usage. You can restart your instance at any -// time. Every time you start your Windows instance, Amazon EC2 charges you -// for a full instance hour. If you stop and restart your Windows instance, -// a new instance hour begins and Amazon EC2 charges you for another full instance -// hour even if you are still within the same 60-minute period when it was stopped. -// Every time you start your Linux instance, Amazon EC2 charges a one-minute -// minimum for instance usage, and thereafter charges per second for instance -// usage. -// -// 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. +// ReplaceNetworkAclEntry API operation for Amazon Elastic Compute Cloud. // -// For more information, see Stopping Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Replaces an entry (rule) in a network ACL. For more information, see Network +// ACLs (https://docs.aws.amazon.com/vpc/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 StartInstances for usage and error information. -// See also, 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) +// API operation ReplaceNetworkAclEntry for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceNetworkAclEntry +func (c *EC2) ReplaceNetworkAclEntry(input *ReplaceNetworkAclEntryInput) (*ReplaceNetworkAclEntryOutput, error) { + req, out := c.ReplaceNetworkAclEntryRequest(input) return out, req.Send() } -// StartInstancesWithContext is the same as StartInstances with the addition of +// ReplaceNetworkAclEntryWithContext is the same as ReplaceNetworkAclEntry with the addition of // the ability to pass a context and additional request options. // -// See StartInstances for details on how to use this API operation. +// See ReplaceNetworkAclEntry for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) StartInstancesWithContext(ctx aws.Context, input *StartInstancesInput, opts ...request.Option) (*StartInstancesOutput, error) { - req, out := c.StartInstancesRequest(input) +func (c *EC2) ReplaceNetworkAclEntryWithContext(ctx aws.Context, input *ReplaceNetworkAclEntryInput, opts ...request.Option) (*ReplaceNetworkAclEntryOutput, error) { + req, out := c.ReplaceNetworkAclEntryRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopInstances = "StopInstances" +const opReplaceRoute = "ReplaceRoute" -// StopInstancesRequest generates a "aws/request.Request" representing the -// client's request for the StopInstances operation. The "output" return +// ReplaceRouteRequest generates a "aws/request.Request" representing the +// client's request for the ReplaceRoute operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopInstances for more information on using the StopInstances +// See ReplaceRoute for more information on using the ReplaceRoute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopInstancesRequest method. -// req, resp := client.StopInstancesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StopInstances -func (c *EC2) StopInstancesRequest(input *StopInstancesInput) (req *request.Request, output *StopInstancesOutput) { +// See also, 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: opStopInstances, + Name: opReplaceRoute, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StopInstancesInput{} + input = &ReplaceRouteInput{} } - output = &StopInstancesOutput{} + output = &ReplaceRouteOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// StopInstances API operation for Amazon Elastic Compute Cloud. -// -// Stops an Amazon EBS-backed instance. -// -// You can use the Stop action to hibernate an instance if the instance is enabled -// for hibernation (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#enabling-hibernation) -// and it meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites). -// For more information, see Hibernate Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) -// in the Amazon Elastic Compute Cloud User Guide. -// -// We don't charge usage for a stopped instance, or data transfer fees; however, -// your root partition Amazon EBS volume remains and continues to persist your -// data, and you are charged for Amazon EBS volume usage. Every time you start -// your Windows instance, Amazon EC2 charges you for a full instance hour. If -// you stop and restart your Windows instance, a new instance hour begins and -// Amazon EC2 charges you for another full instance hour even if you are still -// within the same 60-minute period when it was stopped. Every time you start -// your Linux instance, Amazon EC2 charges a one-minute minimum for instance -// usage, and thereafter charges per second for instance usage. -// -// You can't start, stop, or hibernate Spot Instances, and you can't stop or -// hibernate instance store-backed instances. For information about using hibernation -// for Spot Instances, see Hibernating Interrupted Spot Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html#hibernate-spot-instances) -// in the Amazon Elastic Compute Cloud User Guide. -// -// When you stop or hibernate an instance, we shut it down. You can restart -// your instance at any time. Before stopping or hibernating 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, but hibernating an instance does preserve -// data stored in RAM. If an instance cannot hibernate successfully, a normal -// shutdown occurs. +// ReplaceRoute API operation for Amazon Elastic Compute Cloud. // -// Stopping and hibernating an instance is different to rebooting or terminating -// it. For example, when you stop or hibernate 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, hibernating, and terminating instances, see -// Instance Lifecycle (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Replaces an existing route within a route table in a VPC. You must provide +// only one of the following: internet gateway, virtual private gateway, NAT +// instance, NAT gateway, VPC peering connection, network interface, egress-only +// internet gateway, or transit gateway. // -// 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 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesStopping.html) -// in the Amazon Elastic Compute Cloud User Guide. +// For more information, see Route Tables (https://docs.aws.amazon.com/vpc/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 StopInstances for usage and error information. -// See also, 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) +// API operation ReplaceRoute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRoute +func (c *EC2) ReplaceRoute(input *ReplaceRouteInput) (*ReplaceRouteOutput, error) { + req, out := c.ReplaceRouteRequest(input) return out, req.Send() } -// StopInstancesWithContext is the same as StopInstances with the addition of +// ReplaceRouteWithContext is the same as ReplaceRoute with the addition of // the ability to pass a context and additional request options. // -// See StopInstances for details on how to use this API operation. +// See ReplaceRoute for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) StopInstancesWithContext(ctx aws.Context, input *StopInstancesInput, opts ...request.Option) (*StopInstancesOutput, error) { - req, out := c.StopInstancesRequest(input) +func (c *EC2) ReplaceRouteWithContext(ctx aws.Context, input *ReplaceRouteInput, opts ...request.Option) (*ReplaceRouteOutput, error) { + req, out := c.ReplaceRouteRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opTerminateClientVpnConnections = "TerminateClientVpnConnections" +const opReplaceRouteTableAssociation = "ReplaceRouteTableAssociation" -// TerminateClientVpnConnectionsRequest generates a "aws/request.Request" representing the -// client's request for the TerminateClientVpnConnections operation. The "output" return +// ReplaceRouteTableAssociationRequest generates a "aws/request.Request" representing the +// client's request for the ReplaceRouteTableAssociation operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See TerminateClientVpnConnections for more information on using the TerminateClientVpnConnections +// See ReplaceRouteTableAssociation for more information on using the ReplaceRouteTableAssociation // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the TerminateClientVpnConnectionsRequest method. -// req, resp := client.TerminateClientVpnConnectionsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TerminateClientVpnConnections -func (c *EC2) TerminateClientVpnConnectionsRequest(input *TerminateClientVpnConnectionsInput) (req *request.Request, output *TerminateClientVpnConnectionsOutput) { +// See also, 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: opTerminateClientVpnConnections, + Name: opReplaceRouteTableAssociation, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &TerminateClientVpnConnectionsInput{} + input = &ReplaceRouteTableAssociationInput{} } - output = &TerminateClientVpnConnectionsOutput{} + output = &ReplaceRouteTableAssociationOutput{} req = c.newRequest(op, input, output) return } -// TerminateClientVpnConnections API operation for Amazon Elastic Compute Cloud. +// ReplaceRouteTableAssociation API operation for Amazon Elastic Compute Cloud. // -// Terminates active Client VPN endpoint connections. This action can be used -// to terminate a specific client connection, or up to five connections established -// by a specific user. +// Changes the route table associated with a given subnet, internet gateway, +// or virtual private gateway in a VPC. After the operation completes, the subnet +// or gateway uses the routes in the new route table. For more information about +// route tables, see Route Tables (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Route_Tables.html) +// in the Amazon Virtual Private Cloud User Guide. +// +// You can also use this operation to change which table is the main route table +// in the VPC. Specify the main route table's association ID and the route table +// ID of 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 TerminateClientVpnConnections for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TerminateClientVpnConnections -func (c *EC2) TerminateClientVpnConnections(input *TerminateClientVpnConnectionsInput) (*TerminateClientVpnConnectionsOutput, error) { - req, out := c.TerminateClientVpnConnectionsRequest(input) +// API operation ReplaceRouteTableAssociation for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceRouteTableAssociation +func (c *EC2) ReplaceRouteTableAssociation(input *ReplaceRouteTableAssociationInput) (*ReplaceRouteTableAssociationOutput, error) { + req, out := c.ReplaceRouteTableAssociationRequest(input) return out, req.Send() } -// TerminateClientVpnConnectionsWithContext is the same as TerminateClientVpnConnections with the addition of +// ReplaceRouteTableAssociationWithContext is the same as ReplaceRouteTableAssociation with the addition of // the ability to pass a context and additional request options. // -// See TerminateClientVpnConnections for details on how to use this API operation. +// See ReplaceRouteTableAssociation for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) TerminateClientVpnConnectionsWithContext(ctx aws.Context, input *TerminateClientVpnConnectionsInput, opts ...request.Option) (*TerminateClientVpnConnectionsOutput, error) { - req, out := c.TerminateClientVpnConnectionsRequest(input) +func (c *EC2) ReplaceRouteTableAssociationWithContext(ctx aws.Context, input *ReplaceRouteTableAssociationInput, opts ...request.Option) (*ReplaceRouteTableAssociationOutput, error) { + req, out := c.ReplaceRouteTableAssociationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opTerminateInstances = "TerminateInstances" +const opReplaceTransitGatewayRoute = "ReplaceTransitGatewayRoute" -// TerminateInstancesRequest generates a "aws/request.Request" representing the -// client's request for the TerminateInstances operation. The "output" return +// ReplaceTransitGatewayRouteRequest generates a "aws/request.Request" representing the +// client's request for the ReplaceTransitGatewayRoute operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See TerminateInstances for more information on using the TerminateInstances +// See ReplaceTransitGatewayRoute for more information on using the ReplaceTransitGatewayRoute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the TerminateInstancesRequest method. -// req, resp := client.TerminateInstancesRequest(params) +// // Example sending a request using the ReplaceTransitGatewayRouteRequest method. +// req, resp := client.ReplaceTransitGatewayRouteRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TerminateInstances -func (c *EC2) TerminateInstancesRequest(input *TerminateInstancesInput) (req *request.Request, output *TerminateInstancesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceTransitGatewayRoute +func (c *EC2) ReplaceTransitGatewayRouteRequest(input *ReplaceTransitGatewayRouteInput) (req *request.Request, output *ReplaceTransitGatewayRouteOutput) { op := &request.Operation{ - Name: opTerminateInstances, + Name: opReplaceTransitGatewayRoute, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &TerminateInstancesInput{} + input = &ReplaceTransitGatewayRouteInput{} } - output = &TerminateInstancesOutput{} + output = &ReplaceTransitGatewayRouteOutput{} req = c.newRequest(op, input, output) return } -// TerminateInstances API operation for Amazon Elastic Compute Cloud. -// -// Shuts down the specified 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 (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-lifecycle.html) -// in the Amazon Elastic Compute Cloud User Guide. +// ReplaceTransitGatewayRoute API operation for Amazon Elastic Compute Cloud. // -// For more information about troubleshooting, see Troubleshooting Terminating -// Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/TroubleshootingInstancesShuttingDown.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Replaces the specified route in the specified transit gateway 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 TerminateInstances for usage and error information. -// See also, 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) +// API operation ReplaceTransitGatewayRoute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReplaceTransitGatewayRoute +func (c *EC2) ReplaceTransitGatewayRoute(input *ReplaceTransitGatewayRouteInput) (*ReplaceTransitGatewayRouteOutput, error) { + req, out := c.ReplaceTransitGatewayRouteRequest(input) return out, req.Send() } -// TerminateInstancesWithContext is the same as TerminateInstances with the addition of +// ReplaceTransitGatewayRouteWithContext is the same as ReplaceTransitGatewayRoute with the addition of // the ability to pass a context and additional request options. // -// See TerminateInstances for details on how to use this API operation. +// See ReplaceTransitGatewayRoute for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) TerminateInstancesWithContext(ctx aws.Context, input *TerminateInstancesInput, opts ...request.Option) (*TerminateInstancesOutput, error) { - req, out := c.TerminateInstancesRequest(input) +func (c *EC2) ReplaceTransitGatewayRouteWithContext(ctx aws.Context, input *ReplaceTransitGatewayRouteInput, opts ...request.Option) (*ReplaceTransitGatewayRouteOutput, error) { + req, out := c.ReplaceTransitGatewayRouteRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUnassignIpv6Addresses = "UnassignIpv6Addresses" +const opReportInstanceStatus = "ReportInstanceStatus" -// UnassignIpv6AddressesRequest generates a "aws/request.Request" representing the -// client's request for the UnassignIpv6Addresses operation. The "output" return +// ReportInstanceStatusRequest generates a "aws/request.Request" representing the +// client's request for the ReportInstanceStatus operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UnassignIpv6Addresses for more information on using the UnassignIpv6Addresses +// See ReportInstanceStatus for more information on using the ReportInstanceStatus // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UnassignIpv6AddressesRequest method. -// req, resp := client.UnassignIpv6AddressesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignIpv6Addresses -func (c *EC2) UnassignIpv6AddressesRequest(input *UnassignIpv6AddressesInput) (req *request.Request, output *UnassignIpv6AddressesOutput) { +// See also, 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: opUnassignIpv6Addresses, + Name: opReportInstanceStatus, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UnassignIpv6AddressesInput{} + input = &ReportInstanceStatusInput{} } - output = &UnassignIpv6AddressesOutput{} + output = &ReportInstanceStatusOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UnassignIpv6Addresses API operation for Amazon Elastic Compute Cloud. +// ReportInstanceStatus API operation for Amazon Elastic Compute Cloud. // -// Unassigns one or more IPv6 addresses from a network interface. +// 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 UnassignIpv6Addresses for usage and error information. -// See also, 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) +// API operation ReportInstanceStatus for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ReportInstanceStatus +func (c *EC2) ReportInstanceStatus(input *ReportInstanceStatusInput) (*ReportInstanceStatusOutput, error) { + req, out := c.ReportInstanceStatusRequest(input) return out, req.Send() } -// UnassignIpv6AddressesWithContext is the same as UnassignIpv6Addresses with the addition of +// ReportInstanceStatusWithContext is the same as ReportInstanceStatus with the addition of // the ability to pass a context and additional request options. // -// See UnassignIpv6Addresses for details on how to use this API operation. +// See ReportInstanceStatus for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) UnassignIpv6AddressesWithContext(ctx aws.Context, input *UnassignIpv6AddressesInput, opts ...request.Option) (*UnassignIpv6AddressesOutput, error) { - req, out := c.UnassignIpv6AddressesRequest(input) +func (c *EC2) ReportInstanceStatusWithContext(ctx aws.Context, input *ReportInstanceStatusInput, opts ...request.Option) (*ReportInstanceStatusOutput, error) { + req, out := c.ReportInstanceStatusRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUnassignPrivateIpAddresses = "UnassignPrivateIpAddresses" +const opRequestSpotFleet = "RequestSpotFleet" -// UnassignPrivateIpAddressesRequest generates a "aws/request.Request" representing the -// client's request for the UnassignPrivateIpAddresses operation. The "output" return +// RequestSpotFleetRequest generates a "aws/request.Request" representing the +// client's request for the RequestSpotFleet operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UnassignPrivateIpAddresses for more information on using the UnassignPrivateIpAddresses +// See RequestSpotFleet for more information on using the RequestSpotFleet // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UnassignPrivateIpAddressesRequest method. -// req, resp := client.UnassignPrivateIpAddressesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignPrivateIpAddresses -func (c *EC2) UnassignPrivateIpAddressesRequest(input *UnassignPrivateIpAddressesInput) (req *request.Request, output *UnassignPrivateIpAddressesOutput) { +// See also, 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: opUnassignPrivateIpAddresses, + Name: opRequestSpotFleet, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UnassignPrivateIpAddressesInput{} + input = &RequestSpotFleetInput{} } - output = &UnassignPrivateIpAddressesOutput{} + output = &RequestSpotFleetOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UnassignPrivateIpAddresses API operation for Amazon Elastic Compute Cloud. +// RequestSpotFleet API operation for Amazon Elastic Compute Cloud. // -// Unassigns one or more secondary private IP addresses from a network interface. +// Creates a Spot Fleet request. +// +// The Spot Fleet request specifies the total target capacity and the On-Demand +// target capacity. Amazon EC2 calculates the difference between the total capacity +// and On-Demand capacity, and launches the difference as Spot capacity. +// +// 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 Instance 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. +// +// You can specify tags for the Spot Fleet and Spot Instances. You cannot tag +// other resource types in a Spot Fleet request because only the spot-fleet-request +// and instance resource types are supported. +// +// For more information, see Spot Fleet Requests (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-fleet-requests.html) +// in the Amazon EC2 User Guide for Linux 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 UnassignPrivateIpAddresses for usage and error information. -// See also, 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) +// API operation RequestSpotFleet for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotFleet +func (c *EC2) RequestSpotFleet(input *RequestSpotFleetInput) (*RequestSpotFleetOutput, error) { + req, out := c.RequestSpotFleetRequest(input) return out, req.Send() } -// UnassignPrivateIpAddressesWithContext is the same as UnassignPrivateIpAddresses with the addition of +// RequestSpotFleetWithContext is the same as RequestSpotFleet with the addition of // the ability to pass a context and additional request options. // -// See UnassignPrivateIpAddresses for details on how to use this API operation. +// See RequestSpotFleet for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) UnassignPrivateIpAddressesWithContext(ctx aws.Context, input *UnassignPrivateIpAddressesInput, opts ...request.Option) (*UnassignPrivateIpAddressesOutput, error) { - req, out := c.UnassignPrivateIpAddressesRequest(input) +func (c *EC2) RequestSpotFleetWithContext(ctx aws.Context, input *RequestSpotFleetInput, opts ...request.Option) (*RequestSpotFleetOutput, error) { + req, out := c.RequestSpotFleetRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUnmonitorInstances = "UnmonitorInstances" +const opRequestSpotInstances = "RequestSpotInstances" -// UnmonitorInstancesRequest generates a "aws/request.Request" representing the -// client's request for the UnmonitorInstances operation. The "output" return +// RequestSpotInstancesRequest generates a "aws/request.Request" representing the +// client's request for the RequestSpotInstances operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UnmonitorInstances for more information on using the UnmonitorInstances +// See RequestSpotInstances for more information on using the RequestSpotInstances // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UnmonitorInstancesRequest method. -// req, resp := client.UnmonitorInstancesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnmonitorInstances -func (c *EC2) UnmonitorInstancesRequest(input *UnmonitorInstancesInput) (req *request.Request, output *UnmonitorInstancesOutput) { +// See also, 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: opUnmonitorInstances, + Name: opRequestSpotInstances, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UnmonitorInstancesInput{} + input = &RequestSpotInstancesInput{} } - output = &UnmonitorInstancesOutput{} + output = &RequestSpotInstancesOutput{} req = c.newRequest(op, input, output) return } -// UnmonitorInstances API operation for Amazon Elastic Compute Cloud. +// RequestSpotInstances API operation for Amazon Elastic Compute Cloud. // -// Disables detailed monitoring for a running instance. For more information, -// see Monitoring Your Instances and Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-cloudwatch.html) -// in the Amazon Elastic Compute Cloud User Guide. +// Creates a Spot Instance request. +// +// For more information, see Spot Instance Requests (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-requests.html) +// in the Amazon EC2 User Guide for Linux 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 UnmonitorInstances for usage and error information. -// See also, 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) +// API operation RequestSpotInstances for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RequestSpotInstances +func (c *EC2) RequestSpotInstances(input *RequestSpotInstancesInput) (*RequestSpotInstancesOutput, error) { + req, out := c.RequestSpotInstancesRequest(input) return out, req.Send() } -// UnmonitorInstancesWithContext is the same as UnmonitorInstances with the addition of +// RequestSpotInstancesWithContext is the same as RequestSpotInstances with the addition of // the ability to pass a context and additional request options. // -// See UnmonitorInstances for details on how to use this API operation. +// See RequestSpotInstances for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) UnmonitorInstancesWithContext(ctx aws.Context, input *UnmonitorInstancesInput, opts ...request.Option) (*UnmonitorInstancesOutput, error) { - req, out := c.UnmonitorInstancesRequest(input) +func (c *EC2) RequestSpotInstancesWithContext(ctx aws.Context, input *RequestSpotInstancesInput, opts ...request.Option) (*RequestSpotInstancesOutput, error) { + req, out := c.RequestSpotInstancesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateSecurityGroupRuleDescriptionsEgress = "UpdateSecurityGroupRuleDescriptionsEgress" +const opResetEbsDefaultKmsKeyId = "ResetEbsDefaultKmsKeyId" -// UpdateSecurityGroupRuleDescriptionsEgressRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSecurityGroupRuleDescriptionsEgress operation. The "output" return +// ResetEbsDefaultKmsKeyIdRequest generates a "aws/request.Request" representing the +// client's request for the ResetEbsDefaultKmsKeyId operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateSecurityGroupRuleDescriptionsEgress for more information on using the UpdateSecurityGroupRuleDescriptionsEgress +// See ResetEbsDefaultKmsKeyId for more information on using the ResetEbsDefaultKmsKeyId // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateSecurityGroupRuleDescriptionsEgressRequest method. -// req, resp := client.UpdateSecurityGroupRuleDescriptionsEgressRequest(params) +// // Example sending a request using the ResetEbsDefaultKmsKeyIdRequest method. +// req, resp := client.ResetEbsDefaultKmsKeyIdRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UpdateSecurityGroupRuleDescriptionsEgress -func (c *EC2) UpdateSecurityGroupRuleDescriptionsEgressRequest(input *UpdateSecurityGroupRuleDescriptionsEgressInput) (req *request.Request, output *UpdateSecurityGroupRuleDescriptionsEgressOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetEbsDefaultKmsKeyId +func (c *EC2) ResetEbsDefaultKmsKeyIdRequest(input *ResetEbsDefaultKmsKeyIdInput) (req *request.Request, output *ResetEbsDefaultKmsKeyIdOutput) { op := &request.Operation{ - Name: opUpdateSecurityGroupRuleDescriptionsEgress, + Name: opResetEbsDefaultKmsKeyId, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateSecurityGroupRuleDescriptionsEgressInput{} + input = &ResetEbsDefaultKmsKeyIdInput{} } - output = &UpdateSecurityGroupRuleDescriptionsEgressOutput{} + output = &ResetEbsDefaultKmsKeyIdOutput{} req = c.newRequest(op, input, output) return } -// UpdateSecurityGroupRuleDescriptionsEgress API operation for Amazon Elastic Compute Cloud. +// ResetEbsDefaultKmsKeyId API operation for Amazon Elastic Compute Cloud. // -// [VPC only] Updates the description of an egress (outbound) security group -// rule. You can replace an existing description, or add a description to a -// rule that did not have one previously. +// Resets the default customer master key (CMK) for EBS encryption for your +// account in this Region to the AWS managed CMK for EBS. // -// You specify the description as part of the IP permissions structure. You -// can remove a description for a security group rule by omitting the description -// parameter in the request. +// After resetting the default CMK to the AWS managed CMK, you can continue +// to encrypt by a customer managed CMK by specifying it when you create the +// volume. For more information, see Amazon EBS Encryption (https://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 UpdateSecurityGroupRuleDescriptionsEgress for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UpdateSecurityGroupRuleDescriptionsEgress -func (c *EC2) UpdateSecurityGroupRuleDescriptionsEgress(input *UpdateSecurityGroupRuleDescriptionsEgressInput) (*UpdateSecurityGroupRuleDescriptionsEgressOutput, error) { - req, out := c.UpdateSecurityGroupRuleDescriptionsEgressRequest(input) +// API operation ResetEbsDefaultKmsKeyId for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetEbsDefaultKmsKeyId +func (c *EC2) ResetEbsDefaultKmsKeyId(input *ResetEbsDefaultKmsKeyIdInput) (*ResetEbsDefaultKmsKeyIdOutput, error) { + req, out := c.ResetEbsDefaultKmsKeyIdRequest(input) return out, req.Send() } -// UpdateSecurityGroupRuleDescriptionsEgressWithContext is the same as UpdateSecurityGroupRuleDescriptionsEgress with the addition of +// ResetEbsDefaultKmsKeyIdWithContext is the same as ResetEbsDefaultKmsKeyId with the addition of // the ability to pass a context and additional request options. // -// See UpdateSecurityGroupRuleDescriptionsEgress for details on how to use this API operation. +// See ResetEbsDefaultKmsKeyId for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) UpdateSecurityGroupRuleDescriptionsEgressWithContext(ctx aws.Context, input *UpdateSecurityGroupRuleDescriptionsEgressInput, opts ...request.Option) (*UpdateSecurityGroupRuleDescriptionsEgressOutput, error) { - req, out := c.UpdateSecurityGroupRuleDescriptionsEgressRequest(input) +func (c *EC2) ResetEbsDefaultKmsKeyIdWithContext(ctx aws.Context, input *ResetEbsDefaultKmsKeyIdInput, opts ...request.Option) (*ResetEbsDefaultKmsKeyIdOutput, error) { + req, out := c.ResetEbsDefaultKmsKeyIdRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateSecurityGroupRuleDescriptionsIngress = "UpdateSecurityGroupRuleDescriptionsIngress" +const opResetFpgaImageAttribute = "ResetFpgaImageAttribute" -// UpdateSecurityGroupRuleDescriptionsIngressRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSecurityGroupRuleDescriptionsIngress operation. The "output" return +// ResetFpgaImageAttributeRequest generates a "aws/request.Request" representing the +// client's request for the ResetFpgaImageAttribute operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateSecurityGroupRuleDescriptionsIngress for more information on using the UpdateSecurityGroupRuleDescriptionsIngress +// See ResetFpgaImageAttribute for more information on using the ResetFpgaImageAttribute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateSecurityGroupRuleDescriptionsIngressRequest method. -// req, resp := client.UpdateSecurityGroupRuleDescriptionsIngressRequest(params) +// // Example sending a request using the ResetFpgaImageAttributeRequest method. +// req, resp := client.ResetFpgaImageAttributeRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UpdateSecurityGroupRuleDescriptionsIngress -func (c *EC2) UpdateSecurityGroupRuleDescriptionsIngressRequest(input *UpdateSecurityGroupRuleDescriptionsIngressInput) (req *request.Request, output *UpdateSecurityGroupRuleDescriptionsIngressOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetFpgaImageAttribute +func (c *EC2) ResetFpgaImageAttributeRequest(input *ResetFpgaImageAttributeInput) (req *request.Request, output *ResetFpgaImageAttributeOutput) { op := &request.Operation{ - Name: opUpdateSecurityGroupRuleDescriptionsIngress, + Name: opResetFpgaImageAttribute, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateSecurityGroupRuleDescriptionsIngressInput{} + input = &ResetFpgaImageAttributeInput{} } - output = &UpdateSecurityGroupRuleDescriptionsIngressOutput{} + output = &ResetFpgaImageAttributeOutput{} req = c.newRequest(op, input, output) return } -// UpdateSecurityGroupRuleDescriptionsIngress API operation for Amazon Elastic Compute Cloud. +// ResetFpgaImageAttribute API operation for Amazon Elastic Compute Cloud. // -// Updates the description of an ingress (inbound) security group rule. You -// can replace an existing description, or add a description to a rule that -// did not have one previously. +// Resets the specified attribute of the specified Amazon FPGA Image (AFI) to +// its default value. You can only reset the load permission attribute. // -// You specify the description as part of the IP permissions structure. You -// can remove a description for a security group rule by omitting the description -// parameter 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 Compute Cloud's +// API operation ResetFpgaImageAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetFpgaImageAttribute +func (c *EC2) ResetFpgaImageAttribute(input *ResetFpgaImageAttributeInput) (*ResetFpgaImageAttributeOutput, error) { + req, out := c.ResetFpgaImageAttributeRequest(input) + return out, req.Send() +} + +// ResetFpgaImageAttributeWithContext is the same as ResetFpgaImageAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ResetFpgaImageAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) ResetFpgaImageAttributeWithContext(ctx aws.Context, input *ResetFpgaImageAttributeInput, opts ...request.Option) (*ResetFpgaImageAttributeOutput, error) { + req, out := c.ResetFpgaImageAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opResetImageAttribute = "ResetImageAttribute" + +// ResetImageAttributeRequest generates a "aws/request.Request" representing the +// client's request for the ResetImageAttribute operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ResetImageAttribute for more information on using the ResetImageAttribute +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ResetImageAttributeRequest method. +// req, resp := client.ResetImageAttributeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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.Swap(ec2query.UnmarshalHandler.Name, 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 UpdateSecurityGroupRuleDescriptionsIngress for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UpdateSecurityGroupRuleDescriptionsIngress -func (c *EC2) UpdateSecurityGroupRuleDescriptionsIngress(input *UpdateSecurityGroupRuleDescriptionsIngressInput) (*UpdateSecurityGroupRuleDescriptionsIngressOutput, error) { - req, out := c.UpdateSecurityGroupRuleDescriptionsIngressRequest(input) +// API operation ResetImageAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetImageAttribute +func (c *EC2) ResetImageAttribute(input *ResetImageAttributeInput) (*ResetImageAttributeOutput, error) { + req, out := c.ResetImageAttributeRequest(input) return out, req.Send() } -// UpdateSecurityGroupRuleDescriptionsIngressWithContext is the same as UpdateSecurityGroupRuleDescriptionsIngress with the addition of +// ResetImageAttributeWithContext is the same as ResetImageAttribute with the addition of // the ability to pass a context and additional request options. // -// See UpdateSecurityGroupRuleDescriptionsIngress for details on how to use this API operation. +// See ResetImageAttribute for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EC2) UpdateSecurityGroupRuleDescriptionsIngressWithContext(ctx aws.Context, input *UpdateSecurityGroupRuleDescriptionsIngressInput, opts ...request.Option) (*UpdateSecurityGroupRuleDescriptionsIngressOutput, error) { - req, out := c.UpdateSecurityGroupRuleDescriptionsIngressRequest(input) +func (c *EC2) ResetImageAttributeWithContext(ctx aws.Context, input *ResetImageAttributeInput, opts ...request.Option) (*ResetImageAttributeOutput, error) { + req, out := c.ResetImageAttributeRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opWithdrawByoipCidr = "WithdrawByoipCidr" +const opResetInstanceAttribute = "ResetInstanceAttribute" -// WithdrawByoipCidrRequest generates a "aws/request.Request" representing the -// client's request for the WithdrawByoipCidr operation. The "output" return +// ResetInstanceAttributeRequest generates a "aws/request.Request" representing the +// client's request for the ResetInstanceAttribute operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See WithdrawByoipCidr for more information on using the WithdrawByoipCidr +// See ResetInstanceAttribute for more information on using the ResetInstanceAttribute // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the WithdrawByoipCidrRequest method. -// req, resp := client.WithdrawByoipCidrRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/WithdrawByoipCidr -func (c *EC2) WithdrawByoipCidrRequest(input *WithdrawByoipCidrInput) (req *request.Request, output *WithdrawByoipCidrOutput) { +// See also, 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: opWithdrawByoipCidr, + Name: opResetInstanceAttribute, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &WithdrawByoipCidrInput{} + input = &ResetInstanceAttributeInput{} } - output = &WithdrawByoipCidrOutput{} + output = &ResetInstanceAttributeOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// WithdrawByoipCidr API operation for Amazon Elastic Compute Cloud. +// ResetInstanceAttribute API operation for Amazon Elastic Compute Cloud. // -// Stops advertising an IPv4 address range that is provisioned as an address -// pool. +// 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. // -// You can perform this operation at most once every 10 seconds, even if you -// specify different address ranges each time. +// 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 (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_NAT_Instance.html) +// in the Amazon Virtual Private Cloud User Guide. // -// It can take a few minutes before traffic to the specified addresses stops -// routing to AWS because of BGP propagation delays. +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code 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. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetInstanceAttribute +func (c *EC2) ResetInstanceAttribute(input *ResetInstanceAttributeInput) (*ResetInstanceAttributeOutput, error) { + req, out := c.ResetInstanceAttributeRequest(input) + return out, req.Send() +} + +// ResetInstanceAttributeWithContext is the same as ResetInstanceAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ResetInstanceAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) ResetInstanceAttributeWithContext(ctx aws.Context, input *ResetInstanceAttributeInput, opts ...request.Option) (*ResetInstanceAttributeOutput, error) { + req, out := c.ResetInstanceAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opResetNetworkInterfaceAttribute = "ResetNetworkInterfaceAttribute" + +// ResetNetworkInterfaceAttributeRequest generates a "aws/request.Request" representing the +// client's request for the ResetNetworkInterfaceAttribute operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ResetNetworkInterfaceAttribute for more information on using the ResetNetworkInterfaceAttribute +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ResetNetworkInterfaceAttributeRequest method. +// req, resp := client.ResetNetworkInterfaceAttributeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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.Swap(ec2query.UnmarshalHandler.Name, 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 WithdrawByoipCidr for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/WithdrawByoipCidr -func (c *EC2) WithdrawByoipCidr(input *WithdrawByoipCidrInput) (*WithdrawByoipCidrOutput, error) { - req, out := c.WithdrawByoipCidrRequest(input) +// API operation ResetNetworkInterfaceAttribute for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetNetworkInterfaceAttribute +func (c *EC2) ResetNetworkInterfaceAttribute(input *ResetNetworkInterfaceAttributeInput) (*ResetNetworkInterfaceAttributeOutput, error) { + req, out := c.ResetNetworkInterfaceAttributeRequest(input) + return out, req.Send() +} + +// ResetNetworkInterfaceAttributeWithContext is the same as ResetNetworkInterfaceAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ResetNetworkInterfaceAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) ResetNetworkInterfaceAttributeWithContext(ctx aws.Context, input *ResetNetworkInterfaceAttributeInput, opts ...request.Option) (*ResetNetworkInterfaceAttributeOutput, error) { + req, out := c.ResetNetworkInterfaceAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opResetSnapshotAttribute = "ResetSnapshotAttribute" + +// ResetSnapshotAttributeRequest generates a "aws/request.Request" representing the +// client's request for the ResetSnapshotAttribute operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ResetSnapshotAttribute for more information on using the ResetSnapshotAttribute +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ResetSnapshotAttributeRequest method. +// req, resp := client.ResetSnapshotAttributeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// ResetSnapshotAttribute API operation for Amazon Elastic Compute Cloud. +// +// Resets permission settings for the specified snapshot. +// +// For more information about modifying snapshot permissions, see Sharing Snapshots +// (https://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. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ResetSnapshotAttribute +func (c *EC2) ResetSnapshotAttribute(input *ResetSnapshotAttributeInput) (*ResetSnapshotAttributeOutput, error) { + req, out := c.ResetSnapshotAttributeRequest(input) + return out, req.Send() +} + +// ResetSnapshotAttributeWithContext is the same as ResetSnapshotAttribute with the addition of +// the ability to pass a context and additional request options. +// +// See ResetSnapshotAttribute for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) ResetSnapshotAttributeWithContext(ctx aws.Context, input *ResetSnapshotAttributeInput, opts ...request.Option) (*ResetSnapshotAttributeOutput, error) { + req, out := c.ResetSnapshotAttributeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRestoreAddressToClassic = "RestoreAddressToClassic" + +// RestoreAddressToClassicRequest generates a "aws/request.Request" representing the +// client's request for the RestoreAddressToClassic operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RestoreAddressToClassic for more information on using the RestoreAddressToClassic +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RestoreAddressToClassicRequest method. +// req, resp := client.RestoreAddressToClassicRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RestoreAddressToClassic +func (c *EC2) RestoreAddressToClassic(input *RestoreAddressToClassicInput) (*RestoreAddressToClassicOutput, error) { + req, out := c.RestoreAddressToClassicRequest(input) + return out, req.Send() +} + +// RestoreAddressToClassicWithContext is the same as RestoreAddressToClassic with the addition of +// the ability to pass a context and additional request options. +// +// See RestoreAddressToClassic for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) RestoreAddressToClassicWithContext(ctx aws.Context, input *RestoreAddressToClassicInput, opts ...request.Option) (*RestoreAddressToClassicOutput, error) { + req, out := c.RestoreAddressToClassicRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRevokeClientVpnIngress = "RevokeClientVpnIngress" + +// RevokeClientVpnIngressRequest generates a "aws/request.Request" representing the +// client's request for the RevokeClientVpnIngress operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RevokeClientVpnIngress for more information on using the RevokeClientVpnIngress +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RevokeClientVpnIngressRequest method. +// req, resp := client.RevokeClientVpnIngressRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeClientVpnIngress +func (c *EC2) RevokeClientVpnIngressRequest(input *RevokeClientVpnIngressInput) (req *request.Request, output *RevokeClientVpnIngressOutput) { + op := &request.Operation{ + Name: opRevokeClientVpnIngress, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RevokeClientVpnIngressInput{} + } + + output = &RevokeClientVpnIngressOutput{} + req = c.newRequest(op, input, output) + return +} + +// RevokeClientVpnIngress API operation for Amazon Elastic Compute Cloud. +// +// Removes an ingress authorization rule from a Client VPN 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 RevokeClientVpnIngress for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeClientVpnIngress +func (c *EC2) RevokeClientVpnIngress(input *RevokeClientVpnIngressInput) (*RevokeClientVpnIngressOutput, error) { + req, out := c.RevokeClientVpnIngressRequest(input) + return out, req.Send() +} + +// RevokeClientVpnIngressWithContext is the same as RevokeClientVpnIngress with the addition of +// the ability to pass a context and additional request options. +// +// See RevokeClientVpnIngress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) RevokeClientVpnIngressWithContext(ctx aws.Context, input *RevokeClientVpnIngressInput, opts ...request.Option) (*RevokeClientVpnIngressOutput, error) { + req, out := c.RevokeClientVpnIngressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) return out, req.Send() } -// WithdrawByoipCidrWithContext is the same as WithdrawByoipCidr with the addition of -// the ability to pass a context and additional request options. -// -// See WithdrawByoipCidr for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *EC2) WithdrawByoipCidrWithContext(ctx aws.Context, input *WithdrawByoipCidrInput, opts ...request.Option) (*WithdrawByoipCidrOutput, error) { - req, out := c.WithdrawByoipCidrRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() +const opRevokeSecurityGroupEgress = "RevokeSecurityGroupEgress" + +// RevokeSecurityGroupEgressRequest generates a "aws/request.Request" representing the +// client's request for the RevokeSecurityGroupEgress operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RevokeSecurityGroupEgress for more information on using the RevokeSecurityGroupEgress +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RevokeSecurityGroupEgressRequest method. +// req, resp := client.RevokeSecurityGroupEgressRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// RevokeSecurityGroupEgress API operation for Amazon Elastic Compute Cloud. +// +// [VPC only] Removes the specified egress rules from a security group for EC2-VPC. +// This action doesn't apply to security groups for use in EC2-Classic. To remove +// a rule, the values that you specify (for example, ports) must match the existing +// rule's values exactly. +// +// 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. If the security group rule has a description, +// you do not have to specify the description to revoke the rule. +// +// 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. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupEgress +func (c *EC2) RevokeSecurityGroupEgress(input *RevokeSecurityGroupEgressInput) (*RevokeSecurityGroupEgressOutput, error) { + req, out := c.RevokeSecurityGroupEgressRequest(input) + return out, req.Send() +} + +// RevokeSecurityGroupEgressWithContext is the same as RevokeSecurityGroupEgress with the addition of +// the ability to pass a context and additional request options. +// +// See RevokeSecurityGroupEgress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) RevokeSecurityGroupEgressWithContext(ctx aws.Context, input *RevokeSecurityGroupEgressInput, opts ...request.Option) (*RevokeSecurityGroupEgressOutput, error) { + req, out := c.RevokeSecurityGroupEgressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRevokeSecurityGroupIngress = "RevokeSecurityGroupIngress" + +// RevokeSecurityGroupIngressRequest generates a "aws/request.Request" representing the +// client's request for the RevokeSecurityGroupIngress operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RevokeSecurityGroupIngress for more information on using the RevokeSecurityGroupIngress +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RevokeSecurityGroupIngressRequest method. +// req, resp := client.RevokeSecurityGroupIngressRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// RevokeSecurityGroupIngress API operation for Amazon Elastic Compute Cloud. +// +// Removes the specified ingress rules from a security group. To remove a rule, +// the values that you specify (for example, ports) must match the existing +// rule's values exactly. +// +// [EC2-Classic only] If the values you specify do not match the existing rule's +// values, no error is returned. Use DescribeSecurityGroups to verify that the +// rule has been 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. If the security group rule has a description, you do +// not have to specify the description to revoke the rule. +// +// 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. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RevokeSecurityGroupIngress +func (c *EC2) RevokeSecurityGroupIngress(input *RevokeSecurityGroupIngressInput) (*RevokeSecurityGroupIngressOutput, error) { + req, out := c.RevokeSecurityGroupIngressRequest(input) + return out, req.Send() +} + +// RevokeSecurityGroupIngressWithContext is the same as RevokeSecurityGroupIngress with the addition of +// the ability to pass a context and additional request options. +// +// See RevokeSecurityGroupIngress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) RevokeSecurityGroupIngressWithContext(ctx aws.Context, input *RevokeSecurityGroupIngressInput, opts ...request.Option) (*RevokeSecurityGroupIngressOutput, error) { + req, out := c.RevokeSecurityGroupIngressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRunInstances = "RunInstances" + +// RunInstancesRequest generates a "aws/request.Request" representing the +// client's request for the RunInstances operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RunInstances for more information on using the RunInstances +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RunInstancesRequest method. +// req, resp := client.RunInstancesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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 (https://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 (https://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 (https://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. +// +// You can create a launch template (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html), +// which is a resource that contains the parameters to launch an instance. When +// you launch an instance using RunInstances, you can specify the launch template +// instead of specifying the launch parameters. +// +// To ensure faster instance launches, break up large requests into smaller +// batches. For example, create five separate launch requests for 100 instances +// each instead of one launch request for 500 instances. +// +// An instance is ready for you to use when it's in the running state. You can +// check the state of your instance using DescribeInstances. You can tag instances +// and EBS volumes during launch, after launch, or both. For more information, +// see CreateTags and Tagging Your Amazon EC2 Resources (https://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 (https://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 +// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_InstanceStraightToTerminated.html), +// and Troubleshooting Connecting to Your Instance (https://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. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunInstances +func (c *EC2) RunInstances(input *RunInstancesInput) (*Reservation, error) { + req, out := c.RunInstancesRequest(input) + return out, req.Send() +} + +// RunInstancesWithContext is the same as RunInstances with the addition of +// the ability to pass a context and additional request options. +// +// See RunInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) RunInstancesWithContext(ctx aws.Context, input *RunInstancesInput, opts ...request.Option) (*Reservation, error) { + req, out := c.RunInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRunScheduledInstances = "RunScheduledInstances" + +// RunScheduledInstancesRequest generates a "aws/request.Request" representing the +// client's request for the RunScheduledInstances operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RunScheduledInstances for more information on using the RunScheduledInstances +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RunScheduledInstancesRequest method. +// req, resp := client.RunScheduledInstancesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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 (https://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. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/RunScheduledInstances +func (c *EC2) RunScheduledInstances(input *RunScheduledInstancesInput) (*RunScheduledInstancesOutput, error) { + req, out := c.RunScheduledInstancesRequest(input) + return out, req.Send() +} + +// RunScheduledInstancesWithContext is the same as RunScheduledInstances with the addition of +// the ability to pass a context and additional request options. +// +// See RunScheduledInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) RunScheduledInstancesWithContext(ctx aws.Context, input *RunScheduledInstancesInput, opts ...request.Option) (*RunScheduledInstancesOutput, error) { + req, out := c.RunScheduledInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSearchLocalGatewayRoutes = "SearchLocalGatewayRoutes" + +// SearchLocalGatewayRoutesRequest generates a "aws/request.Request" representing the +// client's request for the SearchLocalGatewayRoutes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SearchLocalGatewayRoutes for more information on using the SearchLocalGatewayRoutes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SearchLocalGatewayRoutesRequest method. +// req, resp := client.SearchLocalGatewayRoutesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SearchLocalGatewayRoutes +func (c *EC2) SearchLocalGatewayRoutesRequest(input *SearchLocalGatewayRoutesInput) (req *request.Request, output *SearchLocalGatewayRoutesOutput) { + op := &request.Operation{ + Name: opSearchLocalGatewayRoutes, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &SearchLocalGatewayRoutesInput{} + } + + output = &SearchLocalGatewayRoutesOutput{} + req = c.newRequest(op, input, output) + return +} + +// SearchLocalGatewayRoutes API operation for Amazon Elastic Compute Cloud. +// +// Searches for routes in the specified local gateway 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 SearchLocalGatewayRoutes for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SearchLocalGatewayRoutes +func (c *EC2) SearchLocalGatewayRoutes(input *SearchLocalGatewayRoutesInput) (*SearchLocalGatewayRoutesOutput, error) { + req, out := c.SearchLocalGatewayRoutesRequest(input) + return out, req.Send() +} + +// SearchLocalGatewayRoutesWithContext is the same as SearchLocalGatewayRoutes with the addition of +// the ability to pass a context and additional request options. +// +// See SearchLocalGatewayRoutes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) SearchLocalGatewayRoutesWithContext(ctx aws.Context, input *SearchLocalGatewayRoutesInput, opts ...request.Option) (*SearchLocalGatewayRoutesOutput, error) { + req, out := c.SearchLocalGatewayRoutesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// SearchLocalGatewayRoutesPages iterates over the pages of a SearchLocalGatewayRoutes operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See SearchLocalGatewayRoutes 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 SearchLocalGatewayRoutes operation. +// pageNum := 0 +// err := client.SearchLocalGatewayRoutesPages(params, +// func(page *ec2.SearchLocalGatewayRoutesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) SearchLocalGatewayRoutesPages(input *SearchLocalGatewayRoutesInput, fn func(*SearchLocalGatewayRoutesOutput, bool) bool) error { + return c.SearchLocalGatewayRoutesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// SearchLocalGatewayRoutesPagesWithContext same as SearchLocalGatewayRoutesPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) SearchLocalGatewayRoutesPagesWithContext(ctx aws.Context, input *SearchLocalGatewayRoutesInput, fn func(*SearchLocalGatewayRoutesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *SearchLocalGatewayRoutesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.SearchLocalGatewayRoutesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*SearchLocalGatewayRoutesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opSearchTransitGatewayMulticastGroups = "SearchTransitGatewayMulticastGroups" + +// SearchTransitGatewayMulticastGroupsRequest generates a "aws/request.Request" representing the +// client's request for the SearchTransitGatewayMulticastGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SearchTransitGatewayMulticastGroups for more information on using the SearchTransitGatewayMulticastGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SearchTransitGatewayMulticastGroupsRequest method. +// req, resp := client.SearchTransitGatewayMulticastGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SearchTransitGatewayMulticastGroups +func (c *EC2) SearchTransitGatewayMulticastGroupsRequest(input *SearchTransitGatewayMulticastGroupsInput) (req *request.Request, output *SearchTransitGatewayMulticastGroupsOutput) { + op := &request.Operation{ + Name: opSearchTransitGatewayMulticastGroups, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &SearchTransitGatewayMulticastGroupsInput{} + } + + output = &SearchTransitGatewayMulticastGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// SearchTransitGatewayMulticastGroups API operation for Amazon Elastic Compute Cloud. +// +// Searches one or more transit gateway multicast groups and returns the group +// membership 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 Elastic Compute Cloud's +// API operation SearchTransitGatewayMulticastGroups for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SearchTransitGatewayMulticastGroups +func (c *EC2) SearchTransitGatewayMulticastGroups(input *SearchTransitGatewayMulticastGroupsInput) (*SearchTransitGatewayMulticastGroupsOutput, error) { + req, out := c.SearchTransitGatewayMulticastGroupsRequest(input) + return out, req.Send() +} + +// SearchTransitGatewayMulticastGroupsWithContext is the same as SearchTransitGatewayMulticastGroups with the addition of +// the ability to pass a context and additional request options. +// +// See SearchTransitGatewayMulticastGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) SearchTransitGatewayMulticastGroupsWithContext(ctx aws.Context, input *SearchTransitGatewayMulticastGroupsInput, opts ...request.Option) (*SearchTransitGatewayMulticastGroupsOutput, error) { + req, out := c.SearchTransitGatewayMulticastGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// SearchTransitGatewayMulticastGroupsPages iterates over the pages of a SearchTransitGatewayMulticastGroups operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See SearchTransitGatewayMulticastGroups 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 SearchTransitGatewayMulticastGroups operation. +// pageNum := 0 +// err := client.SearchTransitGatewayMulticastGroupsPages(params, +// func(page *ec2.SearchTransitGatewayMulticastGroupsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EC2) SearchTransitGatewayMulticastGroupsPages(input *SearchTransitGatewayMulticastGroupsInput, fn func(*SearchTransitGatewayMulticastGroupsOutput, bool) bool) error { + return c.SearchTransitGatewayMulticastGroupsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// SearchTransitGatewayMulticastGroupsPagesWithContext same as SearchTransitGatewayMulticastGroupsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) SearchTransitGatewayMulticastGroupsPagesWithContext(ctx aws.Context, input *SearchTransitGatewayMulticastGroupsInput, fn func(*SearchTransitGatewayMulticastGroupsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *SearchTransitGatewayMulticastGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.SearchTransitGatewayMulticastGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*SearchTransitGatewayMulticastGroupsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opSearchTransitGatewayRoutes = "SearchTransitGatewayRoutes" + +// SearchTransitGatewayRoutesRequest generates a "aws/request.Request" representing the +// client's request for the SearchTransitGatewayRoutes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SearchTransitGatewayRoutes for more information on using the SearchTransitGatewayRoutes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SearchTransitGatewayRoutesRequest method. +// req, resp := client.SearchTransitGatewayRoutesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SearchTransitGatewayRoutes +func (c *EC2) SearchTransitGatewayRoutesRequest(input *SearchTransitGatewayRoutesInput) (req *request.Request, output *SearchTransitGatewayRoutesOutput) { + op := &request.Operation{ + Name: opSearchTransitGatewayRoutes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SearchTransitGatewayRoutesInput{} + } + + output = &SearchTransitGatewayRoutesOutput{} + req = c.newRequest(op, input, output) + return +} + +// SearchTransitGatewayRoutes API operation for Amazon Elastic Compute Cloud. +// +// Searches for routes in the specified transit gateway 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 SearchTransitGatewayRoutes for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SearchTransitGatewayRoutes +func (c *EC2) SearchTransitGatewayRoutes(input *SearchTransitGatewayRoutesInput) (*SearchTransitGatewayRoutesOutput, error) { + req, out := c.SearchTransitGatewayRoutesRequest(input) + return out, req.Send() +} + +// SearchTransitGatewayRoutesWithContext is the same as SearchTransitGatewayRoutes with the addition of +// the ability to pass a context and additional request options. +// +// See SearchTransitGatewayRoutes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) SearchTransitGatewayRoutesWithContext(ctx aws.Context, input *SearchTransitGatewayRoutesInput, opts ...request.Option) (*SearchTransitGatewayRoutesOutput, error) { + req, out := c.SearchTransitGatewayRoutesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSendDiagnosticInterrupt = "SendDiagnosticInterrupt" + +// SendDiagnosticInterruptRequest generates a "aws/request.Request" representing the +// client's request for the SendDiagnosticInterrupt operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SendDiagnosticInterrupt for more information on using the SendDiagnosticInterrupt +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SendDiagnosticInterruptRequest method. +// req, resp := client.SendDiagnosticInterruptRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SendDiagnosticInterrupt +func (c *EC2) SendDiagnosticInterruptRequest(input *SendDiagnosticInterruptInput) (req *request.Request, output *SendDiagnosticInterruptOutput) { + op := &request.Operation{ + Name: opSendDiagnosticInterrupt, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SendDiagnosticInterruptInput{} + } + + output = &SendDiagnosticInterruptOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(ec2query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// SendDiagnosticInterrupt API operation for Amazon Elastic Compute Cloud. +// +// Sends a diagnostic interrupt to the specified Amazon EC2 instance to trigger +// a kernel panic (on Linux instances), or a blue screen/stop error (on Windows +// instances). For instances based on Intel and AMD processors, the interrupt +// is received as a non-maskable interrupt (NMI). +// +// In general, the operating system crashes and reboots when a kernel panic +// or stop error is triggered. The operating system can also be configured to +// perform diagnostic tasks, such as generating a memory dump file, loading +// a secondary kernel, or obtaining a call trace. +// +// Before sending a diagnostic interrupt to your instance, ensure that its operating +// system is configured to perform the required diagnostic tasks. +// +// For more information about configuring your operating system to generate +// a crash dump when a kernel panic or stop error occurs, see Send a Diagnostic +// Interrupt (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/diagnostic-interrupt.html) +// (Linux instances) or Send a Diagnostic Interrupt (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/diagnostic-interrupt.html) +// (Windows 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 SendDiagnosticInterrupt for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/SendDiagnosticInterrupt +func (c *EC2) SendDiagnosticInterrupt(input *SendDiagnosticInterruptInput) (*SendDiagnosticInterruptOutput, error) { + req, out := c.SendDiagnosticInterruptRequest(input) + return out, req.Send() +} + +// SendDiagnosticInterruptWithContext is the same as SendDiagnosticInterrupt with the addition of +// the ability to pass a context and additional request options. +// +// See SendDiagnosticInterrupt for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) SendDiagnosticInterruptWithContext(ctx aws.Context, input *SendDiagnosticInterruptInput, opts ...request.Option) (*SendDiagnosticInterruptOutput, error) { + req, out := c.SendDiagnosticInterruptRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartInstances = "StartInstances" + +// StartInstancesRequest generates a "aws/request.Request" representing the +// client's request for the StartInstances operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartInstances for more information on using the StartInstances +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartInstancesRequest method. +// req, resp := client.StartInstancesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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 instance 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 instance usage. However, your root partition +// Amazon EBS volume remains and continues to persist your data, and you are +// charged for Amazon EBS volume usage. You can restart your instance at any +// time. Every time you start your Windows instance, Amazon EC2 charges you +// for a full instance hour. If you stop and restart your Windows instance, +// a new instance hour begins and Amazon EC2 charges you for another full instance +// hour even if you are still within the same 60-minute period when it was stopped. +// Every time you start your Linux instance, Amazon EC2 charges a one-minute +// minimum for instance usage, and thereafter charges per second for instance +// usage. +// +// 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 (https://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. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StartInstances +func (c *EC2) StartInstances(input *StartInstancesInput) (*StartInstancesOutput, error) { + req, out := c.StartInstancesRequest(input) + return out, req.Send() +} + +// StartInstancesWithContext is the same as StartInstances with the addition of +// the ability to pass a context and additional request options. +// +// See StartInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) StartInstancesWithContext(ctx aws.Context, input *StartInstancesInput, opts ...request.Option) (*StartInstancesOutput, error) { + req, out := c.StartInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartVpcEndpointServicePrivateDnsVerification = "StartVpcEndpointServicePrivateDnsVerification" + +// StartVpcEndpointServicePrivateDnsVerificationRequest generates a "aws/request.Request" representing the +// client's request for the StartVpcEndpointServicePrivateDnsVerification operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartVpcEndpointServicePrivateDnsVerification for more information on using the StartVpcEndpointServicePrivateDnsVerification +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartVpcEndpointServicePrivateDnsVerificationRequest method. +// req, resp := client.StartVpcEndpointServicePrivateDnsVerificationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StartVpcEndpointServicePrivateDnsVerification +func (c *EC2) StartVpcEndpointServicePrivateDnsVerificationRequest(input *StartVpcEndpointServicePrivateDnsVerificationInput) (req *request.Request, output *StartVpcEndpointServicePrivateDnsVerificationOutput) { + op := &request.Operation{ + Name: opStartVpcEndpointServicePrivateDnsVerification, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StartVpcEndpointServicePrivateDnsVerificationInput{} + } + + output = &StartVpcEndpointServicePrivateDnsVerificationOutput{} + req = c.newRequest(op, input, output) + return +} + +// StartVpcEndpointServicePrivateDnsVerification API operation for Amazon Elastic Compute Cloud. +// +// Initiates the verification process to prove that the service provider owns +// the private DNS name domain for the endpoint service. +// +// The service provider must successfully perform the verification before the +// consumer can use the name to access the service. +// +// Before the service provider runs this command, they must add a record to +// the DNS server. For more information, see Adding a TXT Record to Your Domain's +// DNS Server (https://docs.aws.amazon.com/vpc/latest/userguide/ndpoint-services-dns-validation.html#add-dns-txt-record) +// in the Amazon VPC User Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation StartVpcEndpointServicePrivateDnsVerification for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StartVpcEndpointServicePrivateDnsVerification +func (c *EC2) StartVpcEndpointServicePrivateDnsVerification(input *StartVpcEndpointServicePrivateDnsVerificationInput) (*StartVpcEndpointServicePrivateDnsVerificationOutput, error) { + req, out := c.StartVpcEndpointServicePrivateDnsVerificationRequest(input) + return out, req.Send() +} + +// StartVpcEndpointServicePrivateDnsVerificationWithContext is the same as StartVpcEndpointServicePrivateDnsVerification with the addition of +// the ability to pass a context and additional request options. +// +// See StartVpcEndpointServicePrivateDnsVerification for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) StartVpcEndpointServicePrivateDnsVerificationWithContext(ctx aws.Context, input *StartVpcEndpointServicePrivateDnsVerificationInput, opts ...request.Option) (*StartVpcEndpointServicePrivateDnsVerificationOutput, error) { + req, out := c.StartVpcEndpointServicePrivateDnsVerificationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopInstances = "StopInstances" + +// StopInstancesRequest generates a "aws/request.Request" representing the +// client's request for the StopInstances operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopInstances for more information on using the StopInstances +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopInstancesRequest method. +// req, resp := client.StopInstancesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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. +// +// You can use the Stop action to hibernate an instance if the instance is enabled +// for hibernation (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#enabling-hibernation) +// and it meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites). +// For more information, see Hibernate Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) +// in the Amazon Elastic Compute Cloud User Guide. +// +// We don't charge usage for a stopped instance, or data transfer fees; however, +// your root partition Amazon EBS volume remains and continues to persist your +// data, and you are charged for Amazon EBS volume usage. Every time you start +// your Windows instance, Amazon EC2 charges you for a full instance hour. If +// you stop and restart your Windows instance, a new instance hour begins and +// Amazon EC2 charges you for another full instance hour even if you are still +// within the same 60-minute period when it was stopped. Every time you start +// your Linux instance, Amazon EC2 charges a one-minute minimum for instance +// usage, and thereafter charges per second for instance usage. +// +// You can't hibernate Spot Instances, and you can't stop or hibernate instance +// store-backed instances. For information about using hibernation for Spot +// Instances, see Hibernating Interrupted Spot Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/spot-interruptions.html#hibernate-spot-instances) +// in the Amazon Elastic Compute Cloud User Guide. +// +// When you stop or hibernate an instance, we shut it down. You can restart +// your instance at any time. Before stopping or hibernating 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, but hibernating an instance does preserve +// data stored in RAM. If an instance cannot hibernate successfully, a normal +// shutdown occurs. +// +// Stopping and hibernating an instance is different to rebooting or terminating +// it. For example, when you stop or hibernate 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, hibernating, and terminating instances, see +// Instance Lifecycle (https://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 (https://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. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/StopInstances +func (c *EC2) StopInstances(input *StopInstancesInput) (*StopInstancesOutput, error) { + req, out := c.StopInstancesRequest(input) + return out, req.Send() +} + +// StopInstancesWithContext is the same as StopInstances with the addition of +// the ability to pass a context and additional request options. +// +// See StopInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) StopInstancesWithContext(ctx aws.Context, input *StopInstancesInput, opts ...request.Option) (*StopInstancesOutput, error) { + req, out := c.StopInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTerminateClientVpnConnections = "TerminateClientVpnConnections" + +// TerminateClientVpnConnectionsRequest generates a "aws/request.Request" representing the +// client's request for the TerminateClientVpnConnections operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TerminateClientVpnConnections for more information on using the TerminateClientVpnConnections +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TerminateClientVpnConnectionsRequest method. +// req, resp := client.TerminateClientVpnConnectionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TerminateClientVpnConnections +func (c *EC2) TerminateClientVpnConnectionsRequest(input *TerminateClientVpnConnectionsInput) (req *request.Request, output *TerminateClientVpnConnectionsOutput) { + op := &request.Operation{ + Name: opTerminateClientVpnConnections, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &TerminateClientVpnConnectionsInput{} + } + + output = &TerminateClientVpnConnectionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// TerminateClientVpnConnections API operation for Amazon Elastic Compute Cloud. +// +// Terminates active Client VPN endpoint connections. This action can be used +// to terminate a specific client connection, or up to five connections established +// by a specific 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 Elastic Compute Cloud's +// API operation TerminateClientVpnConnections for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TerminateClientVpnConnections +func (c *EC2) TerminateClientVpnConnections(input *TerminateClientVpnConnectionsInput) (*TerminateClientVpnConnectionsOutput, error) { + req, out := c.TerminateClientVpnConnectionsRequest(input) + return out, req.Send() +} + +// TerminateClientVpnConnectionsWithContext is the same as TerminateClientVpnConnections with the addition of +// the ability to pass a context and additional request options. +// +// See TerminateClientVpnConnections for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) TerminateClientVpnConnectionsWithContext(ctx aws.Context, input *TerminateClientVpnConnectionsInput, opts ...request.Option) (*TerminateClientVpnConnectionsOutput, error) { + req, out := c.TerminateClientVpnConnectionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTerminateInstances = "TerminateInstances" + +// TerminateInstancesRequest generates a "aws/request.Request" representing the +// client's request for the TerminateInstances operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TerminateInstances for more information on using the TerminateInstances +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TerminateInstancesRequest method. +// req, resp := client.TerminateInstancesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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 the specified 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 (https://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 (https://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. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/TerminateInstances +func (c *EC2) TerminateInstances(input *TerminateInstancesInput) (*TerminateInstancesOutput, error) { + req, out := c.TerminateInstancesRequest(input) + return out, req.Send() +} + +// TerminateInstancesWithContext is the same as TerminateInstances with the addition of +// the ability to pass a context and additional request options. +// +// See TerminateInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) TerminateInstancesWithContext(ctx aws.Context, input *TerminateInstancesInput, opts ...request.Option) (*TerminateInstancesOutput, error) { + req, out := c.TerminateInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUnassignIpv6Addresses = "UnassignIpv6Addresses" + +// UnassignIpv6AddressesRequest generates a "aws/request.Request" representing the +// client's request for the UnassignIpv6Addresses operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UnassignIpv6Addresses for more information on using the UnassignIpv6Addresses +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UnassignIpv6AddressesRequest method. +// req, resp := client.UnassignIpv6AddressesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignIpv6Addresses +func (c *EC2) UnassignIpv6Addresses(input *UnassignIpv6AddressesInput) (*UnassignIpv6AddressesOutput, error) { + req, out := c.UnassignIpv6AddressesRequest(input) + return out, req.Send() +} + +// UnassignIpv6AddressesWithContext is the same as UnassignIpv6Addresses with the addition of +// the ability to pass a context and additional request options. +// +// See UnassignIpv6Addresses for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) UnassignIpv6AddressesWithContext(ctx aws.Context, input *UnassignIpv6AddressesInput, opts ...request.Option) (*UnassignIpv6AddressesOutput, error) { + req, out := c.UnassignIpv6AddressesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUnassignPrivateIpAddresses = "UnassignPrivateIpAddresses" + +// UnassignPrivateIpAddressesRequest generates a "aws/request.Request" representing the +// client's request for the UnassignPrivateIpAddresses operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UnassignPrivateIpAddresses for more information on using the UnassignPrivateIpAddresses +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UnassignPrivateIpAddressesRequest method. +// req, resp := client.UnassignPrivateIpAddressesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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.Swap(ec2query.UnmarshalHandler.Name, 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. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnassignPrivateIpAddresses +func (c *EC2) UnassignPrivateIpAddresses(input *UnassignPrivateIpAddressesInput) (*UnassignPrivateIpAddressesOutput, error) { + req, out := c.UnassignPrivateIpAddressesRequest(input) + return out, req.Send() +} + +// UnassignPrivateIpAddressesWithContext is the same as UnassignPrivateIpAddresses with the addition of +// the ability to pass a context and additional request options. +// +// See UnassignPrivateIpAddresses for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) UnassignPrivateIpAddressesWithContext(ctx aws.Context, input *UnassignPrivateIpAddressesInput, opts ...request.Option) (*UnassignPrivateIpAddressesOutput, error) { + req, out := c.UnassignPrivateIpAddressesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUnmonitorInstances = "UnmonitorInstances" + +// UnmonitorInstancesRequest generates a "aws/request.Request" representing the +// client's request for the UnmonitorInstances operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UnmonitorInstances for more information on using the UnmonitorInstances +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UnmonitorInstancesRequest method. +// req, resp := client.UnmonitorInstancesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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 (https://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. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UnmonitorInstances +func (c *EC2) UnmonitorInstances(input *UnmonitorInstancesInput) (*UnmonitorInstancesOutput, error) { + req, out := c.UnmonitorInstancesRequest(input) + return out, req.Send() +} + +// UnmonitorInstancesWithContext is the same as UnmonitorInstances with the addition of +// the ability to pass a context and additional request options. +// +// See UnmonitorInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) UnmonitorInstancesWithContext(ctx aws.Context, input *UnmonitorInstancesInput, opts ...request.Option) (*UnmonitorInstancesOutput, error) { + req, out := c.UnmonitorInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateSecurityGroupRuleDescriptionsEgress = "UpdateSecurityGroupRuleDescriptionsEgress" + +// UpdateSecurityGroupRuleDescriptionsEgressRequest generates a "aws/request.Request" representing the +// client's request for the UpdateSecurityGroupRuleDescriptionsEgress operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateSecurityGroupRuleDescriptionsEgress for more information on using the UpdateSecurityGroupRuleDescriptionsEgress +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateSecurityGroupRuleDescriptionsEgressRequest method. +// req, resp := client.UpdateSecurityGroupRuleDescriptionsEgressRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UpdateSecurityGroupRuleDescriptionsEgress +func (c *EC2) UpdateSecurityGroupRuleDescriptionsEgressRequest(input *UpdateSecurityGroupRuleDescriptionsEgressInput) (req *request.Request, output *UpdateSecurityGroupRuleDescriptionsEgressOutput) { + op := &request.Operation{ + Name: opUpdateSecurityGroupRuleDescriptionsEgress, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateSecurityGroupRuleDescriptionsEgressInput{} + } + + output = &UpdateSecurityGroupRuleDescriptionsEgressOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateSecurityGroupRuleDescriptionsEgress API operation for Amazon Elastic Compute Cloud. +// +// [VPC only] Updates the description of an egress (outbound) security group +// rule. You can replace an existing description, or add a description to a +// rule that did not have one previously. +// +// You specify the description as part of the IP permissions structure. You +// can remove a description for a security group rule by omitting the description +// parameter 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 Compute Cloud's +// API operation UpdateSecurityGroupRuleDescriptionsEgress for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UpdateSecurityGroupRuleDescriptionsEgress +func (c *EC2) UpdateSecurityGroupRuleDescriptionsEgress(input *UpdateSecurityGroupRuleDescriptionsEgressInput) (*UpdateSecurityGroupRuleDescriptionsEgressOutput, error) { + req, out := c.UpdateSecurityGroupRuleDescriptionsEgressRequest(input) + return out, req.Send() +} + +// UpdateSecurityGroupRuleDescriptionsEgressWithContext is the same as UpdateSecurityGroupRuleDescriptionsEgress with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSecurityGroupRuleDescriptionsEgress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) UpdateSecurityGroupRuleDescriptionsEgressWithContext(ctx aws.Context, input *UpdateSecurityGroupRuleDescriptionsEgressInput, opts ...request.Option) (*UpdateSecurityGroupRuleDescriptionsEgressOutput, error) { + req, out := c.UpdateSecurityGroupRuleDescriptionsEgressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateSecurityGroupRuleDescriptionsIngress = "UpdateSecurityGroupRuleDescriptionsIngress" + +// UpdateSecurityGroupRuleDescriptionsIngressRequest generates a "aws/request.Request" representing the +// client's request for the UpdateSecurityGroupRuleDescriptionsIngress operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateSecurityGroupRuleDescriptionsIngress for more information on using the UpdateSecurityGroupRuleDescriptionsIngress +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateSecurityGroupRuleDescriptionsIngressRequest method. +// req, resp := client.UpdateSecurityGroupRuleDescriptionsIngressRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UpdateSecurityGroupRuleDescriptionsIngress +func (c *EC2) UpdateSecurityGroupRuleDescriptionsIngressRequest(input *UpdateSecurityGroupRuleDescriptionsIngressInput) (req *request.Request, output *UpdateSecurityGroupRuleDescriptionsIngressOutput) { + op := &request.Operation{ + Name: opUpdateSecurityGroupRuleDescriptionsIngress, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateSecurityGroupRuleDescriptionsIngressInput{} + } + + output = &UpdateSecurityGroupRuleDescriptionsIngressOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateSecurityGroupRuleDescriptionsIngress API operation for Amazon Elastic Compute Cloud. +// +// Updates the description of an ingress (inbound) security group rule. You +// can replace an existing description, or add a description to a rule that +// did not have one previously. +// +// You specify the description as part of the IP permissions structure. You +// can remove a description for a security group rule by omitting the description +// parameter 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 Compute Cloud's +// API operation UpdateSecurityGroupRuleDescriptionsIngress for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/UpdateSecurityGroupRuleDescriptionsIngress +func (c *EC2) UpdateSecurityGroupRuleDescriptionsIngress(input *UpdateSecurityGroupRuleDescriptionsIngressInput) (*UpdateSecurityGroupRuleDescriptionsIngressOutput, error) { + req, out := c.UpdateSecurityGroupRuleDescriptionsIngressRequest(input) + return out, req.Send() +} + +// UpdateSecurityGroupRuleDescriptionsIngressWithContext is the same as UpdateSecurityGroupRuleDescriptionsIngress with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSecurityGroupRuleDescriptionsIngress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) UpdateSecurityGroupRuleDescriptionsIngressWithContext(ctx aws.Context, input *UpdateSecurityGroupRuleDescriptionsIngressInput, opts ...request.Option) (*UpdateSecurityGroupRuleDescriptionsIngressOutput, error) { + req, out := c.UpdateSecurityGroupRuleDescriptionsIngressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opWithdrawByoipCidr = "WithdrawByoipCidr" + +// WithdrawByoipCidrRequest generates a "aws/request.Request" representing the +// client's request for the WithdrawByoipCidr operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See WithdrawByoipCidr for more information on using the WithdrawByoipCidr +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the WithdrawByoipCidrRequest method. +// req, resp := client.WithdrawByoipCidrRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/WithdrawByoipCidr +func (c *EC2) WithdrawByoipCidrRequest(input *WithdrawByoipCidrInput) (req *request.Request, output *WithdrawByoipCidrOutput) { + op := &request.Operation{ + Name: opWithdrawByoipCidr, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &WithdrawByoipCidrInput{} + } + + output = &WithdrawByoipCidrOutput{} + req = c.newRequest(op, input, output) + return +} + +// WithdrawByoipCidr API operation for Amazon Elastic Compute Cloud. +// +// Stops advertising an address range that is provisioned as an address pool. +// +// You can perform this operation at most once every 10 seconds, even if you +// specify different address ranges each time. +// +// It can take a few minutes before traffic to the specified addresses stops +// routing to AWS because of BGP propagation delays. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Compute Cloud's +// API operation WithdrawByoipCidr for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/WithdrawByoipCidr +func (c *EC2) WithdrawByoipCidr(input *WithdrawByoipCidrInput) (*WithdrawByoipCidrOutput, error) { + req, out := c.WithdrawByoipCidrRequest(input) + return out, req.Send() +} + +// WithdrawByoipCidrWithContext is the same as WithdrawByoipCidr with the addition of +// the ability to pass a context and additional request options. +// +// See WithdrawByoipCidr for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) WithdrawByoipCidrWithContext(ctx aws.Context, input *WithdrawByoipCidrInput, opts ...request.Option) (*WithdrawByoipCidrOutput, error) { + req, out := c.WithdrawByoipCidrRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Contains the parameters for accepting the quote. +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 another Convertible + // Reserved Instance of the same or higher value. + // + // ReservedInstanceIds is a required field + ReservedInstanceIds []*string `locationName:"ReservedInstanceId" locationNameList:"ReservedInstanceId" type:"list" required:"true"` + + // The configuration of the target Convertible Reserved Instance to exchange + // for your current Convertible Reserved Instances. + 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. +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 +} + +type AcceptTransitGatewayPeeringAttachmentInput 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 transit gateway attachment. + // + // TransitGatewayAttachmentId is a required field + TransitGatewayAttachmentId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AcceptTransitGatewayPeeringAttachmentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AcceptTransitGatewayPeeringAttachmentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AcceptTransitGatewayPeeringAttachmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AcceptTransitGatewayPeeringAttachmentInput"} + if s.TransitGatewayAttachmentId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *AcceptTransitGatewayPeeringAttachmentInput) SetDryRun(v bool) *AcceptTransitGatewayPeeringAttachmentInput { + s.DryRun = &v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *AcceptTransitGatewayPeeringAttachmentInput) SetTransitGatewayAttachmentId(v string) *AcceptTransitGatewayPeeringAttachmentInput { + s.TransitGatewayAttachmentId = &v + return s +} + +type AcceptTransitGatewayPeeringAttachmentOutput struct { + _ struct{} `type:"structure"` + + // The transit gateway peering attachment. + TransitGatewayPeeringAttachment *TransitGatewayPeeringAttachment `locationName:"transitGatewayPeeringAttachment" type:"structure"` +} + +// String returns the string representation +func (s AcceptTransitGatewayPeeringAttachmentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AcceptTransitGatewayPeeringAttachmentOutput) GoString() string { + return s.String() +} + +// SetTransitGatewayPeeringAttachment sets the TransitGatewayPeeringAttachment field's value. +func (s *AcceptTransitGatewayPeeringAttachmentOutput) SetTransitGatewayPeeringAttachment(v *TransitGatewayPeeringAttachment) *AcceptTransitGatewayPeeringAttachmentOutput { + s.TransitGatewayPeeringAttachment = v + return s +} + +type AcceptTransitGatewayVpcAttachmentInput 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 attachment. + // + // TransitGatewayAttachmentId is a required field + TransitGatewayAttachmentId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AcceptTransitGatewayVpcAttachmentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AcceptTransitGatewayVpcAttachmentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AcceptTransitGatewayVpcAttachmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AcceptTransitGatewayVpcAttachmentInput"} + if s.TransitGatewayAttachmentId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *AcceptTransitGatewayVpcAttachmentInput) SetDryRun(v bool) *AcceptTransitGatewayVpcAttachmentInput { + s.DryRun = &v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *AcceptTransitGatewayVpcAttachmentInput) SetTransitGatewayAttachmentId(v string) *AcceptTransitGatewayVpcAttachmentInput { + s.TransitGatewayAttachmentId = &v + return s +} + +type AcceptTransitGatewayVpcAttachmentOutput struct { + _ struct{} `type:"structure"` + + // The VPC attachment. + TransitGatewayVpcAttachment *TransitGatewayVpcAttachment `locationName:"transitGatewayVpcAttachment" type:"structure"` +} + +// String returns the string representation +func (s AcceptTransitGatewayVpcAttachmentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AcceptTransitGatewayVpcAttachmentOutput) GoString() string { + return s.String() +} + +// SetTransitGatewayVpcAttachment sets the TransitGatewayVpcAttachment field's value. +func (s *AcceptTransitGatewayVpcAttachmentOutput) SetTransitGatewayVpcAttachment(v *TransitGatewayVpcAttachment) *AcceptTransitGatewayVpcAttachmentOutput { + s.TransitGatewayVpcAttachment = v + return s +} + +type AcceptVpcEndpointConnectionsInput 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 VPC endpoint service. + // + // ServiceId is a required field + ServiceId *string `type:"string" required:"true"` + + // The IDs of one or more interface VPC endpoints. + // + // VpcEndpointIds is a required field + VpcEndpointIds []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list" required:"true"` +} + +// String returns the string representation +func (s AcceptVpcEndpointConnectionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AcceptVpcEndpointConnectionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AcceptVpcEndpointConnectionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AcceptVpcEndpointConnectionsInput"} + if s.ServiceId == nil { + invalidParams.Add(request.NewErrParamRequired("ServiceId")) + } + 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 *AcceptVpcEndpointConnectionsInput) SetDryRun(v bool) *AcceptVpcEndpointConnectionsInput { + s.DryRun = &v + return s +} + +// SetServiceId sets the ServiceId field's value. +func (s *AcceptVpcEndpointConnectionsInput) SetServiceId(v string) *AcceptVpcEndpointConnectionsInput { + s.ServiceId = &v + return s +} + +// SetVpcEndpointIds sets the VpcEndpointIds field's value. +func (s *AcceptVpcEndpointConnectionsInput) SetVpcEndpointIds(v []*string) *AcceptVpcEndpointConnectionsInput { + s.VpcEndpointIds = v + return s +} + +type AcceptVpcEndpointConnectionsOutput struct { + _ struct{} `type:"structure"` + + // Information about the interface endpoints that were not accepted, if applicable. + Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s AcceptVpcEndpointConnectionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AcceptVpcEndpointConnectionsOutput) GoString() string { + return s.String() +} + +// SetUnsuccessful sets the Unsuccessful field's value. +func (s *AcceptVpcEndpointConnectionsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *AcceptVpcEndpointConnectionsOutput { + s.Unsuccessful = v + return s +} + +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. You must specify this parameter in + // the request. + 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 +} + +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. +type AccountAttribute struct { + _ struct{} `type:"structure"` + + // The name of the account attribute. + AttributeName *string `locationName:"attributeName" type:"string"` + + // The 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. +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. +type ActiveInstance struct { + _ struct{} `type:"structure"` + + // The health status of the instance. If the status of either the instance status + // check or the system status check is impaired, the health status of the instance + // is unhealthy. Otherwise, the health status is healthy. + InstanceHealth *string `locationName:"instanceHealth" type:"string" enum:"InstanceHealthStatus"` + + // The ID of the instance. + InstanceId *string `locationName:"instanceId" type:"string"` + + // The instance type. + InstanceType *string `locationName:"instanceType" type:"string"` + + // The ID of the Spot Instance request. + SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` +} + +// String returns the string representation +func (s ActiveInstance) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ActiveInstance) GoString() string { + return s.String() +} + +// SetInstanceHealth sets the InstanceHealth field's value. +func (s *ActiveInstance) SetInstanceHealth(v string) *ActiveInstance { + s.InstanceHealth = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *ActiveInstance) SetInstanceId(v string) *ActiveInstance { + s.InstanceId = &v + return s +} + +// SetInstanceType sets the InstanceType field's value. +func (s *ActiveInstance) SetInstanceType(v string) *ActiveInstance { + s.InstanceType = &v + return s +} + +// SetSpotInstanceRequestId sets the SpotInstanceRequestId field's value. +func (s *ActiveInstance) SetSpotInstanceRequestId(v string) *ActiveInstance { + s.SpotInstanceRequestId = &v + return s +} + +// Describes an Elastic IP address. +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"` + + // The customer-owned IP address. + CustomerOwnedIp *string `locationName:"customerOwnedIp" type:"string"` + + // The ID of the customer-owned address pool. + CustomerOwnedIpv4Pool *string `locationName:"customerOwnedIpv4Pool" 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 name of the location from which the IP address is advertised. + NetworkBorderGroup *string `locationName:"networkBorderGroup" 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"` + + // The ID of an address pool. + PublicIpv4Pool *string `locationName:"publicIpv4Pool" type:"string"` + + // Any tags assigned to the Elastic IP address. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` +} + +// 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 +} + +// SetCustomerOwnedIp sets the CustomerOwnedIp field's value. +func (s *Address) SetCustomerOwnedIp(v string) *Address { + s.CustomerOwnedIp = &v + return s +} + +// SetCustomerOwnedIpv4Pool sets the CustomerOwnedIpv4Pool field's value. +func (s *Address) SetCustomerOwnedIpv4Pool(v string) *Address { + s.CustomerOwnedIpv4Pool = &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 +} + +// SetNetworkBorderGroup sets the NetworkBorderGroup field's value. +func (s *Address) SetNetworkBorderGroup(v string) *Address { + s.NetworkBorderGroup = &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 +} + +// SetPublicIpv4Pool sets the PublicIpv4Pool field's value. +func (s *Address) SetPublicIpv4Pool(v string) *Address { + s.PublicIpv4Pool = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *Address) SetTags(v []*Tag) *Address { + s.Tags = v + return s +} + +type AdvertiseByoipCidrInput struct { + _ struct{} `type:"structure"` + + // The address range, in CIDR notation. This must be the exact range that you + // provisioned. You can't advertise only a portion of the provisioned range. + // + // Cidr is a required field + Cidr *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 `type:"boolean"` +} + +// String returns the string representation +func (s AdvertiseByoipCidrInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AdvertiseByoipCidrInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AdvertiseByoipCidrInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AdvertiseByoipCidrInput"} + if s.Cidr == nil { + invalidParams.Add(request.NewErrParamRequired("Cidr")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCidr sets the Cidr field's value. +func (s *AdvertiseByoipCidrInput) SetCidr(v string) *AdvertiseByoipCidrInput { + s.Cidr = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *AdvertiseByoipCidrInput) SetDryRun(v bool) *AdvertiseByoipCidrInput { + s.DryRun = &v + return s +} + +type AdvertiseByoipCidrOutput struct { + _ struct{} `type:"structure"` + + // Information about the address range. + ByoipCidr *ByoipCidr `locationName:"byoipCidr" type:"structure"` +} + +// String returns the string representation +func (s AdvertiseByoipCidrOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AdvertiseByoipCidrOutput) GoString() string { + return s.String() +} + +// SetByoipCidr sets the ByoipCidr field's value. +func (s *AdvertiseByoipCidrOutput) SetByoipCidr(v *ByoipCidr) *AdvertiseByoipCidrOutput { + s.ByoipCidr = v + return s +} + +type AllocateAddressInput struct { + _ struct{} `type:"structure"` + + // [EC2-VPC] The Elastic IP address to recover or an IPv4 address from an address + // pool. + Address *string `type:"string"` + + // The ID of a customer-owned address pool. Use this parameter to let Amazon + // EC2 select an address from the address pool. Alternatively, specify a specific + // address from the address pool. + CustomerOwnedIpv4Pool *string `type:"string"` + + // 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"` + + // The location from which the IP address is advertised. Use this parameter + // to limit the address to this location. + // + // Use DescribeVpcs (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeVpcs.html) + // to view the network border groups. + // + // You cannot use a network border group with EC2 Classic. If you attempt this + // operation on EC2 classic, you will receive an InvalidParameterCombination + // error. For more information, see Error Codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html). + NetworkBorderGroup *string `type:"string"` + + // The ID of an address pool that you own. Use this parameter to let Amazon + // EC2 select an address from the address pool. To specify a specific address + // from the address pool, use the Address parameter instead. + PublicIpv4Pool *string `type:"string"` +} + +// 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() +} + +// SetAddress sets the Address field's value. +func (s *AllocateAddressInput) SetAddress(v string) *AllocateAddressInput { + s.Address = &v + return s +} + +// SetCustomerOwnedIpv4Pool sets the CustomerOwnedIpv4Pool field's value. +func (s *AllocateAddressInput) SetCustomerOwnedIpv4Pool(v string) *AllocateAddressInput { + s.CustomerOwnedIpv4Pool = &v + return s +} + +// 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 +} + +// SetNetworkBorderGroup sets the NetworkBorderGroup field's value. +func (s *AllocateAddressInput) SetNetworkBorderGroup(v string) *AllocateAddressInput { + s.NetworkBorderGroup = &v + return s +} + +// SetPublicIpv4Pool sets the PublicIpv4Pool field's value. +func (s *AllocateAddressInput) SetPublicIpv4Pool(v string) *AllocateAddressInput { + s.PublicIpv4Pool = &v + return s +} + +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"` + + // The customer-owned IP address. + CustomerOwnedIp *string `locationName:"customerOwnedIp" type:"string"` + + // The ID of the customer-owned address pool. + CustomerOwnedIpv4Pool *string `locationName:"customerOwnedIpv4Pool" 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 location from which the IP address is advertised. + NetworkBorderGroup *string `locationName:"networkBorderGroup" type:"string"` + + // The Elastic IP address. + PublicIp *string `locationName:"publicIp" type:"string"` + + // The ID of an address pool. + PublicIpv4Pool *string `locationName:"publicIpv4Pool" 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 +} + +// SetCustomerOwnedIp sets the CustomerOwnedIp field's value. +func (s *AllocateAddressOutput) SetCustomerOwnedIp(v string) *AllocateAddressOutput { + s.CustomerOwnedIp = &v + return s +} + +// SetCustomerOwnedIpv4Pool sets the CustomerOwnedIpv4Pool field's value. +func (s *AllocateAddressOutput) SetCustomerOwnedIpv4Pool(v string) *AllocateAddressOutput { + s.CustomerOwnedIpv4Pool = &v + return s +} + +// SetDomain sets the Domain field's value. +func (s *AllocateAddressOutput) SetDomain(v string) *AllocateAddressOutput { + s.Domain = &v + return s +} + +// SetNetworkBorderGroup sets the NetworkBorderGroup field's value. +func (s *AllocateAddressOutput) SetNetworkBorderGroup(v string) *AllocateAddressOutput { + s.NetworkBorderGroup = &v + return s +} + +// SetPublicIp sets the PublicIp field's value. +func (s *AllocateAddressOutput) SetPublicIp(v string) *AllocateAddressOutput { + s.PublicIp = &v + return s +} + +// SetPublicIpv4Pool sets the PublicIpv4Pool field's value. +func (s *AllocateAddressOutput) SetPublicIpv4Pool(v string) *AllocateAddressOutput { + s.PublicIpv4Pool = &v + return s +} + +type AllocateHostsInput struct { + _ struct{} `type:"structure"` + + // Indicates whether the host accepts any untargeted instance launches that + // match its instance type configuration, or if it only accepts Host tenancy + // instance launches that specify its unique host ID. For more information, + // see Understanding Instance Placement and Host Affinity (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-understanding) + // in the Amazon EC2 User Guide for Linux Instances. + // + // Default: on + AutoPlacement *string `locationName:"autoPlacement" type:"string" enum:"AutoPlacement"` + + // The Availability Zone in which to allocate the Dedicated Host. + // + // AvailabilityZone is a required field + AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `locationName:"clientToken" type:"string"` + + // Indicates whether to enable or disable host recovery for the Dedicated Host. + // Host recovery is disabled by default. For more information, see Host Recovery + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html) + // in the Amazon Elastic Compute Cloud User Guide. + // + // Default: off + HostRecovery *string `type:"string" enum:"HostRecovery"` + + // Specifies the instance family to be supported by the Dedicated Hosts. If + // you specify an instance family, the Dedicated Hosts support multiple instance + // types within that instance family. + // + // If you want the Dedicated Hosts to support a specific instance type only, + // omit this parameter and specify InstanceType instead. You cannot specify + // InstanceFamily and InstanceType in the same request. + InstanceFamily *string `type:"string"` + + // Specifies the instance type to be supported by the Dedicated Hosts. If you + // specify an instance type, the Dedicated Hosts support instances of the specified + // instance type only. + // + // If you want the Dedicated Hosts to support multiple instance types in a specific + // instance family, omit this parameter and specify InstanceFamily instead. + // You cannot specify InstanceType and InstanceFamily in the same request. + InstanceType *string `locationName:"instanceType" type:"string"` + + // The number of Dedicated Hosts to allocate to your account with these parameters. + // + // Quantity is a required field + Quantity *int64 `locationName:"quantity" type:"integer" required:"true"` + + // The tags to apply to the Dedicated Host during creation. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` +} + +// 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.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 +} + +// SetHostRecovery sets the HostRecovery field's value. +func (s *AllocateHostsInput) SetHostRecovery(v string) *AllocateHostsInput { + s.HostRecovery = &v + return s +} + +// SetInstanceFamily sets the InstanceFamily field's value. +func (s *AllocateHostsInput) SetInstanceFamily(v string) *AllocateHostsInput { + s.InstanceFamily = &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 +} + +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *AllocateHostsInput) SetTagSpecifications(v []*TagSpecification) *AllocateHostsInput { + s.TagSpecifications = v + return s +} + +// Contains the output of AllocateHosts. +type AllocateHostsOutput struct { + _ struct{} `type:"structure"` + + // The ID of the allocated Dedicated Host. This is used 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 +} + +// Describes a principal. +type AllowedPrincipal struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the principal. + Principal *string `locationName:"principal" type:"string"` + + // The type of principal. + PrincipalType *string `locationName:"principalType" type:"string" enum:"PrincipalType"` +} + +// String returns the string representation +func (s AllowedPrincipal) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AllowedPrincipal) GoString() string { + return s.String() +} + +// SetPrincipal sets the Principal field's value. +func (s *AllowedPrincipal) SetPrincipal(v string) *AllowedPrincipal { + s.Principal = &v + return s +} + +// SetPrincipalType sets the PrincipalType field's value. +func (s *AllowedPrincipal) SetPrincipalType(v string) *AllowedPrincipal { + s.PrincipalType = &v + return s +} + +type ApplySecurityGroupsToClientVpnTargetNetworkInput struct { + _ struct{} `type:"structure"` + + // The ID of the Client VPN endpoint. + // + // ClientVpnEndpointId is a required field + ClientVpnEndpointId *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 `type:"boolean"` + + // The IDs of the security groups to apply to the associated target network. + // Up to 5 security groups can be applied to an associated target network. + // + // SecurityGroupIds is a required field + SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"item" type:"list" required:"true"` + + // The ID of the VPC in which the associated target network is located. + // + // VpcId is a required field + VpcId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ApplySecurityGroupsToClientVpnTargetNetworkInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApplySecurityGroupsToClientVpnTargetNetworkInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ApplySecurityGroupsToClientVpnTargetNetworkInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ApplySecurityGroupsToClientVpnTargetNetworkInput"} + if s.ClientVpnEndpointId == nil { + invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) + } + if s.SecurityGroupIds == nil { + invalidParams.Add(request.NewErrParamRequired("SecurityGroupIds")) + } + if s.VpcId == nil { + invalidParams.Add(request.NewErrParamRequired("VpcId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. +func (s *ApplySecurityGroupsToClientVpnTargetNetworkInput) SetClientVpnEndpointId(v string) *ApplySecurityGroupsToClientVpnTargetNetworkInput { + s.ClientVpnEndpointId = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *ApplySecurityGroupsToClientVpnTargetNetworkInput) SetDryRun(v bool) *ApplySecurityGroupsToClientVpnTargetNetworkInput { + s.DryRun = &v + return s +} + +// SetSecurityGroupIds sets the SecurityGroupIds field's value. +func (s *ApplySecurityGroupsToClientVpnTargetNetworkInput) SetSecurityGroupIds(v []*string) *ApplySecurityGroupsToClientVpnTargetNetworkInput { + s.SecurityGroupIds = v + return s +} + +// SetVpcId sets the VpcId field's value. +func (s *ApplySecurityGroupsToClientVpnTargetNetworkInput) SetVpcId(v string) *ApplySecurityGroupsToClientVpnTargetNetworkInput { + s.VpcId = &v + return s +} + +type ApplySecurityGroupsToClientVpnTargetNetworkOutput struct { + _ struct{} `type:"structure"` + + // The IDs of the applied security groups. + SecurityGroupIds []*string `locationName:"securityGroupIds" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s ApplySecurityGroupsToClientVpnTargetNetworkOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApplySecurityGroupsToClientVpnTargetNetworkOutput) GoString() string { + return s.String() +} + +// SetSecurityGroupIds sets the SecurityGroupIds field's value. +func (s *ApplySecurityGroupsToClientVpnTargetNetworkOutput) SetSecurityGroupIds(v []*string) *ApplySecurityGroupsToClientVpnTargetNetworkOutput { + s.SecurityGroupIds = v + return s +} + +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 +} + +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. +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 +} + +type AssignPrivateIpAddressesOutput struct { + _ struct{} `type:"structure"` + + // The private IP addresses assigned to the network interface. + AssignedPrivateIpAddresses []*AssignedPrivateIpAddress `locationName:"assignedPrivateIpAddressesSet" locationNameList:"item" type:"list"` + + // The ID of the network interface. + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` +} + +// 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() +} + +// SetAssignedPrivateIpAddresses sets the AssignedPrivateIpAddresses field's value. +func (s *AssignPrivateIpAddressesOutput) SetAssignedPrivateIpAddresses(v []*AssignedPrivateIpAddress) *AssignPrivateIpAddressesOutput { + s.AssignedPrivateIpAddresses = v + return s +} + +// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. +func (s *AssignPrivateIpAddressesOutput) SetNetworkInterfaceId(v string) *AssignPrivateIpAddressesOutput { + s.NetworkInterfaceId = &v + return s +} + +// Describes the private IP addresses assigned to a network interface. +type AssignedPrivateIpAddress struct { + _ struct{} `type:"structure"` + + // The private IP address assigned to the network interface. + PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` +} + +// String returns the string representation +func (s AssignedPrivateIpAddress) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssignedPrivateIpAddress) GoString() string { + return s.String() +} + +// SetPrivateIpAddress sets the PrivateIpAddress field's value. +func (s *AssignedPrivateIpAddress) SetPrivateIpAddress(v string) *AssignedPrivateIpAddress { + s.PrivateIpAddress = &v + return s +} + +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. + // + // For EC2-VPC, you can specify either the instance ID or the network interface + // ID, but not both. + 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 to associate with the instance. 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 +} + +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 +} + +type AssociateClientVpnTargetNetworkInput struct { + _ struct{} `type:"structure"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `type:"string" idempotencyToken:"true"` + + // The ID of the Client VPN endpoint. + // + // ClientVpnEndpointId is a required field + ClientVpnEndpointId *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 `type:"boolean"` + + // The ID of the subnet to associate with the Client VPN endpoint. + // + // SubnetId is a required field + SubnetId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AssociateClientVpnTargetNetworkInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateClientVpnTargetNetworkInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssociateClientVpnTargetNetworkInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssociateClientVpnTargetNetworkInput"} + if s.ClientVpnEndpointId == nil { + invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) + } + if s.SubnetId == nil { + invalidParams.Add(request.NewErrParamRequired("SubnetId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *AssociateClientVpnTargetNetworkInput) SetClientToken(v string) *AssociateClientVpnTargetNetworkInput { + s.ClientToken = &v + return s +} + +// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. +func (s *AssociateClientVpnTargetNetworkInput) SetClientVpnEndpointId(v string) *AssociateClientVpnTargetNetworkInput { + s.ClientVpnEndpointId = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *AssociateClientVpnTargetNetworkInput) SetDryRun(v bool) *AssociateClientVpnTargetNetworkInput { + s.DryRun = &v + return s +} + +// SetSubnetId sets the SubnetId field's value. +func (s *AssociateClientVpnTargetNetworkInput) SetSubnetId(v string) *AssociateClientVpnTargetNetworkInput { + s.SubnetId = &v + return s +} + +type AssociateClientVpnTargetNetworkOutput struct { + _ struct{} `type:"structure"` + + // The unique ID of the target network association. + AssociationId *string `locationName:"associationId" type:"string"` + + // The current state of the target network association. + Status *AssociationStatus `locationName:"status" type:"structure"` +} + +// String returns the string representation +func (s AssociateClientVpnTargetNetworkOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateClientVpnTargetNetworkOutput) GoString() string { + return s.String() +} + +// SetAssociationId sets the AssociationId field's value. +func (s *AssociateClientVpnTargetNetworkOutput) SetAssociationId(v string) *AssociateClientVpnTargetNetworkOutput { + s.AssociationId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *AssociateClientVpnTargetNetworkOutput) SetStatus(v *AssociationStatus) *AssociateClientVpnTargetNetworkOutput { + s.Status = v + return s +} + +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 +} + +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() +} + +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 +} + +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 +} + +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 internet gateway or virtual private gateway. + GatewayId *string `type:"string"` + + // 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 *string `locationName:"subnetId" type:"string"` +} + +// 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 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 +} + +// SetGatewayId sets the GatewayId field's value. +func (s *AssociateRouteTableInput) SetGatewayId(v string) *AssociateRouteTableInput { + s.GatewayId = &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 +} + +type AssociateRouteTableOutput struct { + _ struct{} `type:"structure"` + + // The route table association ID. This ID is required for disassociating the + // route table. + AssociationId *string `locationName:"associationId" type:"string"` + + // The state of the association. + AssociationState *RouteTableAssociationState `locationName:"associationState" type:"structure"` +} + +// 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 +} + +// SetAssociationState sets the AssociationState field's value. +func (s *AssociateRouteTableOutput) SetAssociationState(v *RouteTableAssociationState) *AssociateRouteTableOutput { + s.AssociationState = v + return s +} + +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 +} + +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 +} + +type AssociateTransitGatewayMulticastDomainInput 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 subnets to associate with the transit gateway multicast domain. + SubnetIds []*string `locationNameList:"item" type:"list"` + + // The ID of the transit gateway attachment to associate with the transit gateway + // multicast domain. + TransitGatewayAttachmentId *string `type:"string"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `type:"string"` +} + +// String returns the string representation +func (s AssociateTransitGatewayMulticastDomainInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateTransitGatewayMulticastDomainInput) GoString() string { + return s.String() +} + +// SetDryRun sets the DryRun field's value. +func (s *AssociateTransitGatewayMulticastDomainInput) SetDryRun(v bool) *AssociateTransitGatewayMulticastDomainInput { + s.DryRun = &v + return s +} + +// SetSubnetIds sets the SubnetIds field's value. +func (s *AssociateTransitGatewayMulticastDomainInput) SetSubnetIds(v []*string) *AssociateTransitGatewayMulticastDomainInput { + s.SubnetIds = v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *AssociateTransitGatewayMulticastDomainInput) SetTransitGatewayAttachmentId(v string) *AssociateTransitGatewayMulticastDomainInput { + s.TransitGatewayAttachmentId = &v + return s +} + +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *AssociateTransitGatewayMulticastDomainInput) SetTransitGatewayMulticastDomainId(v string) *AssociateTransitGatewayMulticastDomainInput { + s.TransitGatewayMulticastDomainId = &v + return s +} + +type AssociateTransitGatewayMulticastDomainOutput struct { + _ struct{} `type:"structure"` + + // Information about the transit gateway multicast domain associations. + Associations *TransitGatewayMulticastDomainAssociations `locationName:"associations" type:"structure"` +} + +// String returns the string representation +func (s AssociateTransitGatewayMulticastDomainOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateTransitGatewayMulticastDomainOutput) GoString() string { + return s.String() +} + +// SetAssociations sets the Associations field's value. +func (s *AssociateTransitGatewayMulticastDomainOutput) SetAssociations(v *TransitGatewayMulticastDomainAssociations) *AssociateTransitGatewayMulticastDomainOutput { + s.Associations = v + return s +} + +type AssociateTransitGatewayRouteTableInput 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 attachment. + // + // TransitGatewayAttachmentId is a required field + TransitGatewayAttachmentId *string `type:"string" required:"true"` + + // The ID of the transit gateway route table. + // + // TransitGatewayRouteTableId is a required field + TransitGatewayRouteTableId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AssociateTransitGatewayRouteTableInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateTransitGatewayRouteTableInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssociateTransitGatewayRouteTableInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssociateTransitGatewayRouteTableInput"} + if s.TransitGatewayAttachmentId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId")) + } + if s.TransitGatewayRouteTableId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *AssociateTransitGatewayRouteTableInput) SetDryRun(v bool) *AssociateTransitGatewayRouteTableInput { + s.DryRun = &v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *AssociateTransitGatewayRouteTableInput) SetTransitGatewayAttachmentId(v string) *AssociateTransitGatewayRouteTableInput { + s.TransitGatewayAttachmentId = &v + return s +} + +// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value. +func (s *AssociateTransitGatewayRouteTableInput) SetTransitGatewayRouteTableId(v string) *AssociateTransitGatewayRouteTableInput { + s.TransitGatewayRouteTableId = &v + return s +} + +type AssociateTransitGatewayRouteTableOutput struct { + _ struct{} `type:"structure"` + + // The ID of the association. + Association *TransitGatewayAssociation `locationName:"association" type:"structure"` +} + +// String returns the string representation +func (s AssociateTransitGatewayRouteTableOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateTransitGatewayRouteTableOutput) GoString() string { + return s.String() +} + +// SetAssociation sets the Association field's value. +func (s *AssociateTransitGatewayRouteTableOutput) SetAssociation(v *TransitGatewayAssociation) *AssociateTransitGatewayRouteTableOutput { + s.Association = v + return s +} + +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"` + + // An IPv4 CIDR block to associate with the VPC. + CidrBlock *string `type:"string"` + + // An IPv6 CIDR block from the IPv6 address pool. You must also specify Ipv6Pool + // in the request. + // + // To let Amazon choose the IPv6 CIDR block for you, omit this parameter. + Ipv6CidrBlock *string `type:"string"` + + // The name of the location from which we advertise the IPV6 CIDR block. Use + // this parameter to limit the CiDR block to this location. + // + // You must set AmazonProvidedIpv6CidrBlock to true to use this parameter. + // + // You can have one IPv6 CIDR block association per network border group. + Ipv6CidrBlockNetworkBorderGroup *string `type:"string"` + + // The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block. + Ipv6Pool *string `type:"string"` + + // 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 +} + +// SetCidrBlock sets the CidrBlock field's value. +func (s *AssociateVpcCidrBlockInput) SetCidrBlock(v string) *AssociateVpcCidrBlockInput { + s.CidrBlock = &v + return s +} + +// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. +func (s *AssociateVpcCidrBlockInput) SetIpv6CidrBlock(v string) *AssociateVpcCidrBlockInput { + s.Ipv6CidrBlock = &v + return s +} + +// SetIpv6CidrBlockNetworkBorderGroup sets the Ipv6CidrBlockNetworkBorderGroup field's value. +func (s *AssociateVpcCidrBlockInput) SetIpv6CidrBlockNetworkBorderGroup(v string) *AssociateVpcCidrBlockInput { + s.Ipv6CidrBlockNetworkBorderGroup = &v + return s +} + +// SetIpv6Pool sets the Ipv6Pool field's value. +func (s *AssociateVpcCidrBlockInput) SetIpv6Pool(v string) *AssociateVpcCidrBlockInput { + s.Ipv6Pool = &v + return s +} + +// SetVpcId sets the VpcId field's value. +func (s *AssociateVpcCidrBlockInput) SetVpcId(v string) *AssociateVpcCidrBlockInput { + s.VpcId = &v + return s +} + +type AssociateVpcCidrBlockOutput struct { + _ struct{} `type:"structure"` + + // Information about the IPv4 CIDR block association. + CidrBlockAssociation *VpcCidrBlockAssociation `locationName:"cidrBlockAssociation" 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() +} + +// SetCidrBlockAssociation sets the CidrBlockAssociation field's value. +func (s *AssociateVpcCidrBlockOutput) SetCidrBlockAssociation(v *VpcCidrBlockAssociation) *AssociateVpcCidrBlockOutput { + s.CidrBlockAssociation = v + return s +} + +// 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 +} + +// Describes a target network that is associated with a Client VPN endpoint. +// A target network is a subnet in a VPC. +type AssociatedTargetNetwork struct { + _ struct{} `type:"structure"` + + // The ID of the subnet. + NetworkId *string `locationName:"networkId" type:"string"` + + // The target network type. + NetworkType *string `locationName:"networkType" type:"string" enum:"AssociatedNetworkType"` +} + +// String returns the string representation +func (s AssociatedTargetNetwork) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociatedTargetNetwork) GoString() string { + return s.String() +} + +// SetNetworkId sets the NetworkId field's value. +func (s *AssociatedTargetNetwork) SetNetworkId(v string) *AssociatedTargetNetwork { + s.NetworkId = &v + return s +} + +// SetNetworkType sets the NetworkType field's value. +func (s *AssociatedTargetNetwork) SetNetworkType(v string) *AssociatedTargetNetwork { + s.NetworkType = &v + return s +} + +// Describes the state of a target network association. +type AssociationStatus struct { + _ struct{} `type:"structure"` + + // The state of the target network association. + Code *string `locationName:"code" type:"string" enum:"AssociationStatusCode"` + + // A message about the status of the target network association, if applicable. + Message *string `locationName:"message" type:"string"` +} + +// 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() +} + +// SetCode sets the Code field's value. +func (s *AssociationStatus) SetCode(v string) *AssociationStatus { + s.Code = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *AssociationStatus) SetMessage(v string) *AssociationStatus { + s.Message = &v + return s +} + +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 +} + +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 +} + +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 +} + +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. +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. +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 +} + +type AttachVolumeInput struct { + _ struct{} `type:"structure"` + + // The device name (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 } -// Contains the parameters for accepting the quote. -type AcceptReservedInstancesExchangeQuoteInput struct { +// 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. +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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // The IDs of the Convertible Reserved Instances to exchange for another Convertible - // Reserved Instance of the same or higher value. + // The ID of the VPC. // - // ReservedInstanceIds is a required field - ReservedInstanceIds []*string `locationName:"ReservedInstanceId" locationNameList:"ReservedInstanceId" type:"list" required:"true"` + // VpcId is a required field + VpcId *string `type:"string" required:"true"` - // The configuration of the target Convertible Reserved Instance to exchange - // for your current Convertible Reserved Instances. - TargetConfigurations []*TargetConfigurationRequest `locationName:"TargetConfiguration" locationNameList:"TargetConfigurationRequest" type:"list"` + // 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 AcceptReservedInstancesExchangeQuoteInput) String() string { +func (s AttachVpnGatewayInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AcceptReservedInstancesExchangeQuoteInput) GoString() string { +func (s AttachVpnGatewayInput) 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")) +func (s *AttachVpnGatewayInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AttachVpnGatewayInput"} + if s.VpcId == nil { + invalidParams.Add(request.NewErrParamRequired("VpcId")) } - 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 s.VpnGatewayId == nil { + invalidParams.Add(request.NewErrParamRequired("VpnGatewayId")) } if invalidParams.Len() > 0 { @@ -32726,158 +39747,219 @@ func (s *AcceptReservedInstancesExchangeQuoteInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *AcceptReservedInstancesExchangeQuoteInput) SetDryRun(v bool) *AcceptReservedInstancesExchangeQuoteInput { +func (s *AttachVpnGatewayInput) SetDryRun(v bool) *AttachVpnGatewayInput { s.DryRun = &v return s } -// SetReservedInstanceIds sets the ReservedInstanceIds field's value. -func (s *AcceptReservedInstancesExchangeQuoteInput) SetReservedInstanceIds(v []*string) *AcceptReservedInstancesExchangeQuoteInput { - s.ReservedInstanceIds = v +// SetVpcId sets the VpcId field's value. +func (s *AttachVpnGatewayInput) SetVpcId(v string) *AttachVpnGatewayInput { + s.VpcId = &v return s } -// SetTargetConfigurations sets the TargetConfigurations field's value. -func (s *AcceptReservedInstancesExchangeQuoteInput) SetTargetConfigurations(v []*TargetConfigurationRequest) *AcceptReservedInstancesExchangeQuoteInput { - s.TargetConfigurations = v +// SetVpnGatewayId sets the VpnGatewayId field's value. +func (s *AttachVpnGatewayInput) SetVpnGatewayId(v string) *AttachVpnGatewayInput { + s.VpnGatewayId = &v return s } -// The result of the exchange and whether it was successful. -type AcceptReservedInstancesExchangeQuoteOutput struct { +// Contains the output of AttachVpnGateway. +type AttachVpnGatewayOutput struct { _ struct{} `type:"structure"` - // The ID of the successful exchange. - ExchangeId *string `locationName:"exchangeId" type:"string"` + // Information about the attachment. + VpcAttachment *VpcAttachment `locationName:"attachment" type:"structure"` } // String returns the string representation -func (s AcceptReservedInstancesExchangeQuoteOutput) String() string { +func (s AttachVpnGatewayOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AcceptReservedInstancesExchangeQuoteOutput) GoString() string { +func (s AttachVpnGatewayOutput) GoString() string { return s.String() } -// SetExchangeId sets the ExchangeId field's value. -func (s *AcceptReservedInstancesExchangeQuoteOutput) SetExchangeId(v string) *AcceptReservedInstancesExchangeQuoteOutput { - s.ExchangeId = &v +// SetVpcAttachment sets the VpcAttachment field's value. +func (s *AttachVpnGatewayOutput) SetVpcAttachment(v *VpcAttachment) *AttachVpnGatewayOutput { + s.VpcAttachment = v return s } -type AcceptTransitGatewayVpcAttachmentInput struct { +// Describes a value for a resource attribute that is a Boolean value. +type AttributeBooleanValue 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 attachment. - // - // TransitGatewayAttachmentId is a required field - TransitGatewayAttachmentId *string `type:"string" required:"true"` + // The attribute value. The valid values are true or false. + Value *bool `locationName:"value" type:"boolean"` } // String returns the string representation -func (s AcceptTransitGatewayVpcAttachmentInput) String() string { +func (s AttributeBooleanValue) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AcceptTransitGatewayVpcAttachmentInput) GoString() string { +func (s AttributeBooleanValue) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AcceptTransitGatewayVpcAttachmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AcceptTransitGatewayVpcAttachmentInput"} - if s.TransitGatewayAttachmentId == nil { - invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId")) - } +// SetValue sets the Value field's value. +func (s *AttributeBooleanValue) SetValue(v bool) *AttributeBooleanValue { + s.Value = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// Describes a value for a resource attribute that is a String. +type AttributeValue struct { + _ struct{} `type:"structure"` + + // The attribute value. The value is case-sensitive. + Value *string `locationName:"value" type:"string"` } -// SetDryRun sets the DryRun field's value. -func (s *AcceptTransitGatewayVpcAttachmentInput) SetDryRun(v bool) *AcceptTransitGatewayVpcAttachmentInput { - s.DryRun = &v - return s +// String returns the string representation +func (s AttributeValue) String() string { + return awsutil.Prettify(s) } -// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. -func (s *AcceptTransitGatewayVpcAttachmentInput) SetTransitGatewayAttachmentId(v string) *AcceptTransitGatewayVpcAttachmentInput { - s.TransitGatewayAttachmentId = &v +// 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 } -type AcceptTransitGatewayVpcAttachmentOutput struct { +// Information about an authorization rule. +type AuthorizationRule struct { _ struct{} `type:"structure"` - // The VPC attachment. - TransitGatewayVpcAttachment *TransitGatewayVpcAttachment `locationName:"transitGatewayVpcAttachment" type:"structure"` + // Indicates whether the authorization rule grants access to all clients. + AccessAll *bool `locationName:"accessAll" type:"boolean"` + + // The ID of the Client VPN endpoint with which the authorization rule is associated. + ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"` + + // A brief description of the authorization rule. + Description *string `locationName:"description" type:"string"` + + // The IPv4 address range, in CIDR notation, of the network to which the authorization + // rule applies. + DestinationCidr *string `locationName:"destinationCidr" type:"string"` + + // The ID of the Active Directory group to which the authorization rule grants + // access. + GroupId *string `locationName:"groupId" type:"string"` + + // The current state of the authorization rule. + Status *ClientVpnAuthorizationRuleStatus `locationName:"status" type:"structure"` } // String returns the string representation -func (s AcceptTransitGatewayVpcAttachmentOutput) String() string { +func (s AuthorizationRule) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AcceptTransitGatewayVpcAttachmentOutput) GoString() string { +func (s AuthorizationRule) GoString() string { return s.String() } -// SetTransitGatewayVpcAttachment sets the TransitGatewayVpcAttachment field's value. -func (s *AcceptTransitGatewayVpcAttachmentOutput) SetTransitGatewayVpcAttachment(v *TransitGatewayVpcAttachment) *AcceptTransitGatewayVpcAttachmentOutput { - s.TransitGatewayVpcAttachment = v +// SetAccessAll sets the AccessAll field's value. +func (s *AuthorizationRule) SetAccessAll(v bool) *AuthorizationRule { + s.AccessAll = &v return s } -type AcceptVpcEndpointConnectionsInput struct { +// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. +func (s *AuthorizationRule) SetClientVpnEndpointId(v string) *AuthorizationRule { + s.ClientVpnEndpointId = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *AuthorizationRule) SetDescription(v string) *AuthorizationRule { + s.Description = &v + return s +} + +// SetDestinationCidr sets the DestinationCidr field's value. +func (s *AuthorizationRule) SetDestinationCidr(v string) *AuthorizationRule { + s.DestinationCidr = &v + return s +} + +// SetGroupId sets the GroupId field's value. +func (s *AuthorizationRule) SetGroupId(v string) *AuthorizationRule { + s.GroupId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *AuthorizationRule) SetStatus(v *ClientVpnAuthorizationRuleStatus) *AuthorizationRule { + s.Status = v + return s +} + +type AuthorizeClientVpnIngressInput struct { _ struct{} `type:"structure"` + // The ID of the Active Directory group to grant access. + AccessGroupId *string `type:"string"` + + // Indicates whether to grant access to all clients. Use true to grant all clients + // who successfully establish a VPN connection access to the network. + AuthorizeAllGroups *bool `type:"boolean"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `type:"string" idempotencyToken:"true"` + + // The ID of the Client VPN endpoint. + // + // ClientVpnEndpointId is a required field + ClientVpnEndpointId *string `type:"string" required:"true"` + + // A brief description of the authorization rule. + 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 `type:"boolean"` - // The ID of the endpoint service. - // - // ServiceId is a required field - ServiceId *string `type:"string" required:"true"` - - // The IDs of one or more interface VPC endpoints. + // The IPv4 address range, in CIDR notation, of the network for which access + // is being authorized. // - // VpcEndpointIds is a required field - VpcEndpointIds []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list" required:"true"` + // TargetNetworkCidr is a required field + TargetNetworkCidr *string `type:"string" required:"true"` } // String returns the string representation -func (s AcceptVpcEndpointConnectionsInput) String() string { +func (s AuthorizeClientVpnIngressInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AcceptVpcEndpointConnectionsInput) GoString() string { +func (s AuthorizeClientVpnIngressInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *AcceptVpcEndpointConnectionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AcceptVpcEndpointConnectionsInput"} - if s.ServiceId == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceId")) +func (s *AuthorizeClientVpnIngressInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AuthorizeClientVpnIngressInput"} + if s.ClientVpnEndpointId == nil { + invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) } - if s.VpcEndpointIds == nil { - invalidParams.Add(request.NewErrParamRequired("VpcEndpointIds")) + if s.TargetNetworkCidr == nil { + invalidParams.Add(request.NewErrParamRequired("TargetNetworkCidr")) } if invalidParams.Len() > 0 { @@ -32886,728 +39968,903 @@ func (s *AcceptVpcEndpointConnectionsInput) Validate() error { return nil } -// SetDryRun sets the DryRun field's value. -func (s *AcceptVpcEndpointConnectionsInput) SetDryRun(v bool) *AcceptVpcEndpointConnectionsInput { - s.DryRun = &v +// SetAccessGroupId sets the AccessGroupId field's value. +func (s *AuthorizeClientVpnIngressInput) SetAccessGroupId(v string) *AuthorizeClientVpnIngressInput { + s.AccessGroupId = &v return s } -// SetServiceId sets the ServiceId field's value. -func (s *AcceptVpcEndpointConnectionsInput) SetServiceId(v string) *AcceptVpcEndpointConnectionsInput { - s.ServiceId = &v +// SetAuthorizeAllGroups sets the AuthorizeAllGroups field's value. +func (s *AuthorizeClientVpnIngressInput) SetAuthorizeAllGroups(v bool) *AuthorizeClientVpnIngressInput { + s.AuthorizeAllGroups = &v return s } -// SetVpcEndpointIds sets the VpcEndpointIds field's value. -func (s *AcceptVpcEndpointConnectionsInput) SetVpcEndpointIds(v []*string) *AcceptVpcEndpointConnectionsInput { - s.VpcEndpointIds = v +// SetClientToken sets the ClientToken field's value. +func (s *AuthorizeClientVpnIngressInput) SetClientToken(v string) *AuthorizeClientVpnIngressInput { + s.ClientToken = &v return s } -type AcceptVpcEndpointConnectionsOutput struct { +// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. +func (s *AuthorizeClientVpnIngressInput) SetClientVpnEndpointId(v string) *AuthorizeClientVpnIngressInput { + s.ClientVpnEndpointId = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *AuthorizeClientVpnIngressInput) SetDescription(v string) *AuthorizeClientVpnIngressInput { + s.Description = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *AuthorizeClientVpnIngressInput) SetDryRun(v bool) *AuthorizeClientVpnIngressInput { + s.DryRun = &v + return s +} + +// SetTargetNetworkCidr sets the TargetNetworkCidr field's value. +func (s *AuthorizeClientVpnIngressInput) SetTargetNetworkCidr(v string) *AuthorizeClientVpnIngressInput { + s.TargetNetworkCidr = &v + return s +} + +type AuthorizeClientVpnIngressOutput struct { _ struct{} `type:"structure"` - // Information about the interface endpoints that were not accepted, if applicable. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` + // The current state of the authorization rule. + Status *ClientVpnAuthorizationRuleStatus `locationName:"status" type:"structure"` } // String returns the string representation -func (s AcceptVpcEndpointConnectionsOutput) String() string { +func (s AuthorizeClientVpnIngressOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AcceptVpcEndpointConnectionsOutput) GoString() string { +func (s AuthorizeClientVpnIngressOutput) GoString() string { return s.String() } -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *AcceptVpcEndpointConnectionsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *AcceptVpcEndpointConnectionsOutput { - s.Unsuccessful = v +// SetStatus sets the Status field's value. +func (s *AuthorizeClientVpnIngressOutput) SetStatus(v *ClientVpnAuthorizationRuleStatus) *AuthorizeClientVpnIngressOutput { + s.Status = v return s } -type AcceptVpcPeeringConnectionInput struct { +type AuthorizeSecurityGroupEgressInput struct { _ struct{} `type:"structure"` + // Not supported. Use a set of IP permissions to specify the CIDR. + 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 ID of the VPC peering connection. You must specify this parameter in - // the request. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` + // Not supported. Use a set of IP permissions to specify the port. + 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"` + + // The sets of IP permissions. You can't specify a destination security group + // and a CIDR IP address range in the same set of permissions. + IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` + + // Not supported. Use a set of IP permissions to specify the protocol name or + // number. + IpProtocol *string `locationName:"ipProtocol" type:"string"` + + // Not supported. Use a set of IP permissions to specify a destination security + // group. + SourceSecurityGroupName *string `locationName:"sourceSecurityGroupName" type:"string"` + + // Not supported. Use a set of IP permissions to specify a destination security + // group. + SourceSecurityGroupOwnerId *string `locationName:"sourceSecurityGroupOwnerId" type:"string"` + + // Not supported. Use a set of IP permissions to specify the port. + ToPort *int64 `locationName:"toPort" type:"integer"` } // String returns the string representation -func (s AcceptVpcPeeringConnectionInput) String() string { +func (s AuthorizeSecurityGroupEgressInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AcceptVpcPeeringConnectionInput) GoString() string { +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 *AcceptVpcPeeringConnectionInput) SetDryRun(v bool) *AcceptVpcPeeringConnectionInput { +func (s *AuthorizeSecurityGroupEgressInput) SetDryRun(v bool) *AuthorizeSecurityGroupEgressInput { s.DryRun = &v return s } -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *AcceptVpcPeeringConnectionInput) SetVpcPeeringConnectionId(v string) *AcceptVpcPeeringConnectionInput { - s.VpcPeeringConnectionId = &v +// SetFromPort sets the FromPort field's value. +func (s *AuthorizeSecurityGroupEgressInput) SetFromPort(v int64) *AuthorizeSecurityGroupEgressInput { + s.FromPort = &v return s } -type AcceptVpcPeeringConnectionOutput struct { +// 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 +} + +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() +} + +type AuthorizeSecurityGroupIngressInput struct { _ struct{} `type:"structure"` - // Information about the VPC peering connection. - VpcPeeringConnection *VpcPeeringConnection `locationName:"vpcPeeringConnection" type:"structure"` + // The IPv4 address range, in CIDR format. You can't specify this parameter + // when specifying a source security group. To specify an IPv6 address range, + // use a set of IP permissions. + // + // Alternatively, use a set of IP permissions to specify multiple rules and + // a description for the rule. + 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 types. If you specify all + // ICMP types, you must specify all codes. + // + // Alternatively, use a set of IP permissions to specify multiple rules and + // a description for the rule. + FromPort *int64 `type:"integer"` + + // The ID of the security group. You must specify either the security group + // ID or the security group name in the request. For security groups in a nondefault + // VPC, you must specify the security group ID. + GroupId *string `type:"string"` + + // [EC2-Classic, default VPC] The name of the security group. You must specify + // either the security group ID or the security group name in the request. + GroupName *string `type:"string"` + + // The sets of IP permissions. + 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)). + // To specify icmpv6, use a set of IP permissions. + // + // [VPC only] Use -1 to specify all protocols. If you specify -1 or a protocol + // other than tcp, udp, or icmp, traffic on all ports is allowed, regardless + // of any ports you specify. + // + // Alternatively, use a set of IP permissions to specify multiple rules and + // a description for the rule. + 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"` + + // [nondefault VPC] The AWS account ID 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 code number. + // For the ICMP code number, use -1 to specify all codes. If you specify all + // ICMP types, you must specify all codes. + // + // Alternatively, use a set of IP permissions to specify multiple rules and + // a description for the rule. + ToPort *int64 `type:"integer"` } // String returns the string representation -func (s AcceptVpcPeeringConnectionOutput) String() string { +func (s AuthorizeSecurityGroupIngressInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AcceptVpcPeeringConnectionOutput) GoString() string { +func (s AuthorizeSecurityGroupIngressInput) GoString() string { return s.String() } -// SetVpcPeeringConnection sets the VpcPeeringConnection field's value. -func (s *AcceptVpcPeeringConnectionOutput) SetVpcPeeringConnection(v *VpcPeeringConnection) *AcceptVpcPeeringConnectionOutput { - s.VpcPeeringConnection = v +// SetCidrIp sets the CidrIp field's value. +func (s *AuthorizeSecurityGroupIngressInput) SetCidrIp(v string) *AuthorizeSecurityGroupIngressInput { + s.CidrIp = &v return s } -// Describes an account attribute. -type AccountAttribute struct { - _ struct{} `type:"structure"` - - // The name of the account attribute. - AttributeName *string `locationName:"attributeName" type:"string"` - - // The values for the account attribute. - AttributeValues []*AccountAttributeValue `locationName:"attributeValueSet" locationNameList:"item" type:"list"` +// SetDryRun sets the DryRun field's value. +func (s *AuthorizeSecurityGroupIngressInput) SetDryRun(v bool) *AuthorizeSecurityGroupIngressInput { + s.DryRun = &v + return s } -// String returns the string representation -func (s AccountAttribute) String() string { - return awsutil.Prettify(s) +// SetFromPort sets the FromPort field's value. +func (s *AuthorizeSecurityGroupIngressInput) SetFromPort(v int64) *AuthorizeSecurityGroupIngressInput { + s.FromPort = &v + return s } -// GoString returns the string representation -func (s AccountAttribute) GoString() string { - return s.String() +// SetGroupId sets the GroupId field's value. +func (s *AuthorizeSecurityGroupIngressInput) SetGroupId(v string) *AuthorizeSecurityGroupIngressInput { + s.GroupId = &v + return s } -// SetAttributeName sets the AttributeName field's value. -func (s *AccountAttribute) SetAttributeName(v string) *AccountAttribute { - s.AttributeName = &v +// SetGroupName sets the GroupName field's value. +func (s *AuthorizeSecurityGroupIngressInput) SetGroupName(v string) *AuthorizeSecurityGroupIngressInput { + s.GroupName = &v return s } -// SetAttributeValues sets the AttributeValues field's value. -func (s *AccountAttribute) SetAttributeValues(v []*AccountAttributeValue) *AccountAttribute { - s.AttributeValues = v +// SetIpPermissions sets the IpPermissions field's value. +func (s *AuthorizeSecurityGroupIngressInput) SetIpPermissions(v []*IpPermission) *AuthorizeSecurityGroupIngressInput { + s.IpPermissions = v return s } -// Describes a value of an account attribute. -type AccountAttributeValue struct { - _ struct{} `type:"structure"` - - // The value of the attribute. - AttributeValue *string `locationName:"attributeValue" type:"string"` +// SetIpProtocol sets the IpProtocol field's value. +func (s *AuthorizeSecurityGroupIngressInput) SetIpProtocol(v string) *AuthorizeSecurityGroupIngressInput { + s.IpProtocol = &v + return s } -// String returns the string representation -func (s AccountAttributeValue) String() string { - return awsutil.Prettify(s) +// SetSourceSecurityGroupName sets the SourceSecurityGroupName field's value. +func (s *AuthorizeSecurityGroupIngressInput) SetSourceSecurityGroupName(v string) *AuthorizeSecurityGroupIngressInput { + s.SourceSecurityGroupName = &v + return s } -// GoString returns the string representation -func (s AccountAttributeValue) GoString() string { - return s.String() +// SetSourceSecurityGroupOwnerId sets the SourceSecurityGroupOwnerId field's value. +func (s *AuthorizeSecurityGroupIngressInput) SetSourceSecurityGroupOwnerId(v string) *AuthorizeSecurityGroupIngressInput { + s.SourceSecurityGroupOwnerId = &v + return s } -// SetAttributeValue sets the AttributeValue field's value. -func (s *AccountAttributeValue) SetAttributeValue(v string) *AccountAttributeValue { - s.AttributeValue = &v +// SetToPort sets the ToPort field's value. +func (s *AuthorizeSecurityGroupIngressInput) SetToPort(v int64) *AuthorizeSecurityGroupIngressInput { + s.ToPort = &v return s } -// Describes a running instance in a Spot Fleet. -type ActiveInstance struct { +type AuthorizeSecurityGroupIngressOutput struct { _ struct{} `type:"structure"` - - // The health status of the instance. If the status of either the instance status - // check or the system status check is impaired, the health status of the instance - // is unhealthy. Otherwise, the health status is healthy. - InstanceHealth *string `locationName:"instanceHealth" type:"string" enum:"InstanceHealthStatus"` - - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` - - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string"` - - // The ID of the Spot Instance request. - SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` } // String returns the string representation -func (s ActiveInstance) String() string { +func (s AuthorizeSecurityGroupIngressOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ActiveInstance) GoString() string { +func (s AuthorizeSecurityGroupIngressOutput) 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. -type Address struct { +// Describes an Availability Zone or Local Zone. +type AvailabilityZone 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"` + // For Availability Zones, this parameter has the same value as the Region name. + // + // For Local Zones, the name of the associated group, for example us-west-2-lax-1. + GroupName *string `locationName:"groupName" type:"string"` - // The ID of the instance that the address is associated with (if any). - InstanceId *string `locationName:"instanceId" type:"string"` + // Any messages about the Availability Zone or Local Zone. + Messages []*AvailabilityZoneMessage `locationName:"messageSet" locationNameList:"item" type:"list"` - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` + // The name of the location from which the address is advertised. + NetworkBorderGroup *string `locationName:"networkBorderGroup" type:"string"` - // The ID of the AWS account that owns the network interface. - NetworkInterfaceOwnerId *string `locationName:"networkInterfaceOwnerId" type:"string"` + // For Availability Zones, this parameter always has the value of opt-in-not-required. + // + // For Local Zones, this parameter is the opt in status. The possible values + // are opted-in, and not-opted-in. + OptInStatus *string `locationName:"optInStatus" type:"string" enum:"AvailabilityZoneOptInStatus"` - // The private IP address associated with the Elastic IP address. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` + // The name of the Region. + RegionName *string `locationName:"regionName" type:"string"` - // The Elastic IP address. - PublicIp *string `locationName:"publicIp" type:"string"` + // The state of the Availability Zone or Local Zone. + State *string `locationName:"zoneState" type:"string" enum:"AvailabilityZoneState"` - // The ID of an address pool. - PublicIpv4Pool *string `locationName:"publicIpv4Pool" type:"string"` + // The ID of the Availability Zone or Local Zone. + ZoneId *string `locationName:"zoneId" type:"string"` - // Any tags assigned to the Elastic IP address. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + // The name of the Availability Zone or Local Zone. + ZoneName *string `locationName:"zoneName" type:"string"` } // String returns the string representation -func (s Address) String() string { +func (s AvailabilityZone) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Address) GoString() string { +func (s AvailabilityZone) GoString() string { return s.String() } -// SetAllocationId sets the AllocationId field's value. -func (s *Address) SetAllocationId(v string) *Address { - s.AllocationId = &v +// SetGroupName sets the GroupName field's value. +func (s *AvailabilityZone) SetGroupName(v string) *AvailabilityZone { + s.GroupName = &v return s } -// SetAssociationId sets the AssociationId field's value. -func (s *Address) SetAssociationId(v string) *Address { - s.AssociationId = &v +// SetMessages sets the Messages field's value. +func (s *AvailabilityZone) SetMessages(v []*AvailabilityZoneMessage) *AvailabilityZone { + s.Messages = v return s } -// SetDomain sets the Domain field's value. -func (s *Address) SetDomain(v string) *Address { - s.Domain = &v +// SetNetworkBorderGroup sets the NetworkBorderGroup field's value. +func (s *AvailabilityZone) SetNetworkBorderGroup(v string) *AvailabilityZone { + s.NetworkBorderGroup = &v return s } -// SetInstanceId sets the InstanceId field's value. -func (s *Address) SetInstanceId(v string) *Address { - s.InstanceId = &v +// SetOptInStatus sets the OptInStatus field's value. +func (s *AvailabilityZone) SetOptInStatus(v string) *AvailabilityZone { + s.OptInStatus = &v return s } -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *Address) SetNetworkInterfaceId(v string) *Address { - s.NetworkInterfaceId = &v +// SetRegionName sets the RegionName field's value. +func (s *AvailabilityZone) SetRegionName(v string) *AvailabilityZone { + s.RegionName = &v return s } -// SetNetworkInterfaceOwnerId sets the NetworkInterfaceOwnerId field's value. -func (s *Address) SetNetworkInterfaceOwnerId(v string) *Address { - s.NetworkInterfaceOwnerId = &v +// SetState sets the State field's value. +func (s *AvailabilityZone) SetState(v string) *AvailabilityZone { + s.State = &v return s } -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *Address) SetPrivateIpAddress(v string) *Address { - s.PrivateIpAddress = &v +// SetZoneId sets the ZoneId field's value. +func (s *AvailabilityZone) SetZoneId(v string) *AvailabilityZone { + s.ZoneId = &v return s } -// SetPublicIp sets the PublicIp field's value. -func (s *Address) SetPublicIp(v string) *Address { - s.PublicIp = &v +// SetZoneName sets the ZoneName field's value. +func (s *AvailabilityZone) SetZoneName(v string) *AvailabilityZone { + s.ZoneName = &v return s } -// SetPublicIpv4Pool sets the PublicIpv4Pool field's value. -func (s *Address) SetPublicIpv4Pool(v string) *Address { - s.PublicIpv4Pool = &v - return s +// Describes a message about an Availability Zone or Local Zone. +type AvailabilityZoneMessage struct { + _ struct{} `type:"structure"` + + // The message about the Availability Zone or Local Zone. + Message *string `locationName:"message" type:"string"` } -// SetTags sets the Tags field's value. -func (s *Address) SetTags(v []*Tag) *Address { - s.Tags = v +// 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 } -type AdvertiseByoipCidrInput struct { +// The capacity information for instances that can be launched onto the Dedicated +// Host. +type AvailableCapacity struct { _ struct{} `type:"structure"` - // The IPv4 address range, in CIDR notation. This must be the exact range that - // you provisioned. You can't advertise only a portion of the provisioned range. - // - // Cidr is a required field - Cidr *string `type:"string" required:"true"` + // The number of instances that can be launched onto the Dedicated Host depending + // on the host's available capacity. For Dedicated Hosts that support multiple + // instance types, this parameter represents the number of instances for each + // instance size that is supported on the host. + AvailableInstanceCapacity []*InstanceCapacity `locationName:"availableInstanceCapacity" 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 number of vCPUs available for launching instances onto the Dedicated + // Host. + AvailableVCpus *int64 `locationName:"availableVCpus" type:"integer"` } // String returns the string representation -func (s AdvertiseByoipCidrInput) String() string { +func (s AvailableCapacity) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AdvertiseByoipCidrInput) GoString() string { +func (s AvailableCapacity) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AdvertiseByoipCidrInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AdvertiseByoipCidrInput"} - if s.Cidr == nil { - invalidParams.Add(request.NewErrParamRequired("Cidr")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCidr sets the Cidr field's value. -func (s *AdvertiseByoipCidrInput) SetCidr(v string) *AdvertiseByoipCidrInput { - s.Cidr = &v +// SetAvailableInstanceCapacity sets the AvailableInstanceCapacity field's value. +func (s *AvailableCapacity) SetAvailableInstanceCapacity(v []*InstanceCapacity) *AvailableCapacity { + s.AvailableInstanceCapacity = v return s } -// SetDryRun sets the DryRun field's value. -func (s *AdvertiseByoipCidrInput) SetDryRun(v bool) *AdvertiseByoipCidrInput { - s.DryRun = &v +// SetAvailableVCpus sets the AvailableVCpus field's value. +func (s *AvailableCapacity) SetAvailableVCpus(v int64) *AvailableCapacity { + s.AvailableVCpus = &v return s } -type AdvertiseByoipCidrOutput struct { +type BlobAttributeValue struct { _ struct{} `type:"structure"` - // Information about the address range. - ByoipCidr *ByoipCidr `locationName:"byoipCidr" type:"structure"` + // Value is automatically base64 encoded/decoded by the SDK. + Value []byte `locationName:"value" type:"blob"` } // String returns the string representation -func (s AdvertiseByoipCidrOutput) String() string { +func (s BlobAttributeValue) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AdvertiseByoipCidrOutput) GoString() string { +func (s BlobAttributeValue) GoString() string { return s.String() } -// SetByoipCidr sets the ByoipCidr field's value. -func (s *AdvertiseByoipCidrOutput) SetByoipCidr(v *ByoipCidr) *AdvertiseByoipCidrOutput { - s.ByoipCidr = v +// SetValue sets the Value field's value. +func (s *BlobAttributeValue) SetValue(v []byte) *BlobAttributeValue { + s.Value = v return s } -type AllocateAddressInput struct { +// Describes a block device mapping. +type BlockDeviceMapping struct { _ struct{} `type:"structure"` - // [EC2-VPC] The Elastic IP address to recover or an IPv4 address from an address - // pool. - Address *string `type:"string"` + // The device name (for example, /dev/sdh or xvdh). + DeviceName *string `locationName:"deviceName" type:"string"` - // 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"` + // Parameters used to automatically set up EBS volumes when the instance is + // launched. + Ebs *EbsBlockDevice `locationName:"ebs" 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"` + // Suppresses the specified device included in the block device mapping of the + // AMI. + NoDevice *string `locationName:"noDevice" type:"string"` - // The ID of an address pool that you own. Use this parameter to let Amazon - // EC2 select an address from the address pool. To specify a specific address - // from the address pool, use the Address parameter instead. - PublicIpv4Pool *string `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. + // + // NVMe instance store volumes are automatically enumerated and assigned a device + // name. Including them in your block device mapping has no effect. + // + // 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 AllocateAddressInput) String() string { +func (s BlockDeviceMapping) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AllocateAddressInput) GoString() string { +func (s BlockDeviceMapping) GoString() string { return s.String() } -// SetAddress sets the Address field's value. -func (s *AllocateAddressInput) SetAddress(v string) *AllocateAddressInput { - s.Address = &v +// SetDeviceName sets the DeviceName field's value. +func (s *BlockDeviceMapping) SetDeviceName(v string) *BlockDeviceMapping { + s.DeviceName = &v return s } -// SetDomain sets the Domain field's value. -func (s *AllocateAddressInput) SetDomain(v string) *AllocateAddressInput { - s.Domain = &v +// SetEbs sets the Ebs field's value. +func (s *BlockDeviceMapping) SetEbs(v *EbsBlockDevice) *BlockDeviceMapping { + s.Ebs = v return s } -// SetDryRun sets the DryRun field's value. -func (s *AllocateAddressInput) SetDryRun(v bool) *AllocateAddressInput { - s.DryRun = &v +// SetNoDevice sets the NoDevice field's value. +func (s *BlockDeviceMapping) SetNoDevice(v string) *BlockDeviceMapping { + s.NoDevice = &v return s } -// SetPublicIpv4Pool sets the PublicIpv4Pool field's value. -func (s *AllocateAddressInput) SetPublicIpv4Pool(v string) *AllocateAddressInput { - s.PublicIpv4Pool = &v +// SetVirtualName sets the VirtualName field's value. +func (s *BlockDeviceMapping) SetVirtualName(v string) *BlockDeviceMapping { + s.VirtualName = &v return s } -type AllocateAddressOutput struct { +// Contains the parameters for BundleInstance. +type BundleInstanceInput 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"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides 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 *string `locationName:"publicIp" type:"string"` + // 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 ID of an address pool. - PublicIpv4Pool *string `locationName:"publicIpv4Pool" 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. + // + // Storage is a required field + Storage *Storage `type:"structure" required:"true"` } // String returns the string representation -func (s AllocateAddressOutput) String() string { +func (s BundleInstanceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AllocateAddressOutput) GoString() string { +func (s BundleInstanceInput) GoString() string { return s.String() } -// SetAllocationId sets the AllocationId field's value. -func (s *AllocateAddressOutput) SetAllocationId(v string) *AllocateAddressOutput { - s.AllocationId = &v +// 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 } -// SetDomain sets the Domain field's value. -func (s *AllocateAddressOutput) SetDomain(v string) *AllocateAddressOutput { - s.Domain = &v +// SetInstanceId sets the InstanceId field's value. +func (s *BundleInstanceInput) SetInstanceId(v string) *BundleInstanceInput { + s.InstanceId = &v return s } -// SetPublicIp sets the PublicIp field's value. -func (s *AllocateAddressOutput) SetPublicIp(v string) *AllocateAddressOutput { - s.PublicIp = &v +// SetStorage sets the Storage field's value. +func (s *BundleInstanceInput) SetStorage(v *Storage) *BundleInstanceInput { + s.Storage = v return s } -// SetPublicIpv4Pool sets the PublicIpv4Pool field's value. -func (s *AllocateAddressOutput) SetPublicIpv4Pool(v string) *AllocateAddressOutput { - s.PublicIpv4Pool = &v +// Contains the output of BundleInstance. +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 } -type AllocateHostsInput struct { +// Describes a bundle task. +type BundleTask struct { _ struct{} `type:"structure"` - // Indicates whether the host accepts any untargeted instance launches that - // match its instance type configuration, or if it only accepts Host tenancy - // instance launches that specify its unique host ID. For more information, - // see Understanding Instance Placement and Host Affinity (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/how-dedicated-hosts-work.html#dedicated-hosts-understanding) - // in the Amazon EC2 User Guide for Linux Instances. - // - // Default: on - AutoPlacement *string `locationName:"autoPlacement" type:"string" enum:"AutoPlacement"` + // The ID of the bundle task. + BundleId *string `locationName:"bundleId" type:"string"` - // The Availability Zone in which to allocate the Dedicated Host. - // - // AvailabilityZone is a required field - AvailabilityZone *string `locationName:"availabilityZone" type:"string" required:"true"` + // If the task fails, a description of the error. + BundleTaskError *BundleTaskError `locationName:"error" type:"structure"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" type:"string"` + // The ID of the instance associated with this bundle task. + InstanceId *string `locationName:"instanceId" type:"string"` - // Indicates whether to enable or disable host recovery for the Dedicated Host. - // Host recovery is disabled by default. For more information, see Host Recovery - // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Default: off - HostRecovery *string `type:"string" enum:"HostRecovery"` + // The level of task completion, as a percent (for example, 20%). + Progress *string `locationName:"progress" type:"string"` - // Specifies the instance type for which to configure your Dedicated Hosts. - // 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 time this task started. + StartTime *time.Time `locationName:"startTime" type:"timestamp"` - // The number of Dedicated Hosts to allocate to your account with these parameters. - // - // Quantity is a required field - Quantity *int64 `locationName:"quantity" type:"integer" required:"true"` + // The state of the task. + State *string `locationName:"state" type:"string" enum:"BundleTaskState"` - // The tags to apply to the Dedicated Host during creation. - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // 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"` } // String returns the string representation -func (s AllocateHostsInput) String() string { +func (s BundleTask) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AllocateHostsInput) GoString() string { +func (s BundleTask) 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 +// SetBundleId sets the BundleId field's value. +func (s *BundleTask) SetBundleId(v string) *BundleTask { + s.BundleId = &v + return s } -// SetAutoPlacement sets the AutoPlacement field's value. -func (s *AllocateHostsInput) SetAutoPlacement(v string) *AllocateHostsInput { - s.AutoPlacement = &v +// SetBundleTaskError sets the BundleTaskError field's value. +func (s *BundleTask) SetBundleTaskError(v *BundleTaskError) *BundleTask { + s.BundleTaskError = v return s } -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *AllocateHostsInput) SetAvailabilityZone(v string) *AllocateHostsInput { - s.AvailabilityZone = &v +// SetInstanceId sets the InstanceId field's value. +func (s *BundleTask) SetInstanceId(v string) *BundleTask { + s.InstanceId = &v return s } -// SetClientToken sets the ClientToken field's value. -func (s *AllocateHostsInput) SetClientToken(v string) *AllocateHostsInput { - s.ClientToken = &v +// SetProgress sets the Progress field's value. +func (s *BundleTask) SetProgress(v string) *BundleTask { + s.Progress = &v return s } -// SetHostRecovery sets the HostRecovery field's value. -func (s *AllocateHostsInput) SetHostRecovery(v string) *AllocateHostsInput { - s.HostRecovery = &v +// SetStartTime sets the StartTime field's value. +func (s *BundleTask) SetStartTime(v time.Time) *BundleTask { + s.StartTime = &v return s } -// SetInstanceType sets the InstanceType field's value. -func (s *AllocateHostsInput) SetInstanceType(v string) *AllocateHostsInput { - s.InstanceType = &v +// SetState sets the State field's value. +func (s *BundleTask) SetState(v string) *BundleTask { + s.State = &v return s } -// SetQuantity sets the Quantity field's value. -func (s *AllocateHostsInput) SetQuantity(v int64) *AllocateHostsInput { - s.Quantity = &v +// SetStorage sets the Storage field's value. +func (s *BundleTask) SetStorage(v *Storage) *BundleTask { + s.Storage = v return s } -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *AllocateHostsInput) SetTagSpecifications(v []*TagSpecification) *AllocateHostsInput { - s.TagSpecifications = v +// SetUpdateTime sets the UpdateTime field's value. +func (s *BundleTask) SetUpdateTime(v time.Time) *BundleTask { + s.UpdateTime = &v return s } -// Contains the output of AllocateHosts. -type AllocateHostsOutput struct { +// Describes an error for BundleInstance. +type BundleTaskError struct { _ struct{} `type:"structure"` - // The ID of the allocated Dedicated Host. This is used to launch an instance - // onto a specific host. - HostIds []*string `locationName:"hostIdSet" locationNameList:"item" type:"list"` + // 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 AllocateHostsOutput) String() string { +func (s BundleTaskError) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AllocateHostsOutput) GoString() string { +func (s BundleTaskError) GoString() string { return s.String() } -// SetHostIds sets the HostIds field's value. -func (s *AllocateHostsOutput) SetHostIds(v []*string) *AllocateHostsOutput { - s.HostIds = v +// SetCode sets the Code field's value. +func (s *BundleTaskError) SetCode(v string) *BundleTaskError { + s.Code = &v return s } -// Describes a principal. -type AllowedPrincipal struct { +// SetMessage sets the Message field's value. +func (s *BundleTaskError) SetMessage(v string) *BundleTaskError { + s.Message = &v + return s +} + +// Information about an address range that is provisioned for use with your +// AWS resources through bring your own IP addresses (BYOIP). +type ByoipCidr struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the principal. - Principal *string `locationName:"principal" type:"string"` + // The address range, in CIDR notation. + Cidr *string `locationName:"cidr" type:"string"` - // The type of principal. - PrincipalType *string `locationName:"principalType" type:"string" enum:"PrincipalType"` + // The description of the address range. + Description *string `locationName:"description" type:"string"` + + // The state of the address pool. + State *string `locationName:"state" type:"string" enum:"ByoipCidrState"` + + // Upon success, contains the ID of the address pool. Otherwise, contains an + // error message. + StatusMessage *string `locationName:"statusMessage" type:"string"` } // String returns the string representation -func (s AllowedPrincipal) String() string { +func (s ByoipCidr) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AllowedPrincipal) GoString() string { +func (s ByoipCidr) GoString() string { return s.String() } -// SetPrincipal sets the Principal field's value. -func (s *AllowedPrincipal) SetPrincipal(v string) *AllowedPrincipal { - s.Principal = &v +// SetCidr sets the Cidr field's value. +func (s *ByoipCidr) SetCidr(v string) *ByoipCidr { + s.Cidr = &v return s } -// SetPrincipalType sets the PrincipalType field's value. -func (s *AllowedPrincipal) SetPrincipalType(v string) *AllowedPrincipal { - s.PrincipalType = &v +// SetDescription sets the Description field's value. +func (s *ByoipCidr) SetDescription(v string) *ByoipCidr { + s.Description = &v return s } -type ApplySecurityGroupsToClientVpnTargetNetworkInput struct { +// SetState sets the State field's value. +func (s *ByoipCidr) SetState(v string) *ByoipCidr { + s.State = &v + return s +} + +// SetStatusMessage sets the StatusMessage field's value. +func (s *ByoipCidr) SetStatusMessage(v string) *ByoipCidr { + s.StatusMessage = &v + return s +} + +// Contains the parameters for CancelBundleTask. +type CancelBundleTaskInput struct { _ struct{} `type:"structure"` - // The ID of the Client VPN endpoint. + // The ID of the bundle task. // - // ClientVpnEndpointId is a required field - ClientVpnEndpointId *string `type:"string" required:"true"` + // 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 `type:"boolean"` - - // The IDs of the security groups to apply to the associated target network. - // Up to 5 security groups can be applied to an associated target network. - // - // SecurityGroupIds is a required field - SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"item" type:"list" required:"true"` - - // The ID of the VPC in which the associated target network is located. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` + DryRun *bool `locationName:"dryRun" type:"boolean"` } // String returns the string representation -func (s ApplySecurityGroupsToClientVpnTargetNetworkInput) String() string { +func (s CancelBundleTaskInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ApplySecurityGroupsToClientVpnTargetNetworkInput) GoString() string { +func (s CancelBundleTaskInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ApplySecurityGroupsToClientVpnTargetNetworkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ApplySecurityGroupsToClientVpnTargetNetworkInput"} - if s.ClientVpnEndpointId == nil { - invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) - } - if s.SecurityGroupIds == nil { - invalidParams.Add(request.NewErrParamRequired("SecurityGroupIds")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) +func (s *CancelBundleTaskInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CancelBundleTaskInput"} + if s.BundleId == nil { + invalidParams.Add(request.NewErrParamRequired("BundleId")) } if invalidParams.Len() > 0 { @@ -33616,86 +40873,72 @@ func (s *ApplySecurityGroupsToClientVpnTargetNetworkInput) Validate() error { return nil } -// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. -func (s *ApplySecurityGroupsToClientVpnTargetNetworkInput) SetClientVpnEndpointId(v string) *ApplySecurityGroupsToClientVpnTargetNetworkInput { - s.ClientVpnEndpointId = &v +// 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 *ApplySecurityGroupsToClientVpnTargetNetworkInput) SetDryRun(v bool) *ApplySecurityGroupsToClientVpnTargetNetworkInput { +func (s *CancelBundleTaskInput) SetDryRun(v bool) *CancelBundleTaskInput { s.DryRun = &v return s } -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *ApplySecurityGroupsToClientVpnTargetNetworkInput) SetSecurityGroupIds(v []*string) *ApplySecurityGroupsToClientVpnTargetNetworkInput { - s.SecurityGroupIds = v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *ApplySecurityGroupsToClientVpnTargetNetworkInput) SetVpcId(v string) *ApplySecurityGroupsToClientVpnTargetNetworkInput { - s.VpcId = &v - return s -} - -type ApplySecurityGroupsToClientVpnTargetNetworkOutput struct { +// Contains the output of CancelBundleTask. +type CancelBundleTaskOutput struct { _ struct{} `type:"structure"` - // The IDs of the applied security groups. - SecurityGroupIds []*string `locationName:"securityGroupIds" locationNameList:"item" type:"list"` + // Information about the bundle task. + BundleTask *BundleTask `locationName:"bundleInstanceTask" type:"structure"` } // String returns the string representation -func (s ApplySecurityGroupsToClientVpnTargetNetworkOutput) String() string { +func (s CancelBundleTaskOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ApplySecurityGroupsToClientVpnTargetNetworkOutput) GoString() string { +func (s CancelBundleTaskOutput) GoString() string { return s.String() } -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *ApplySecurityGroupsToClientVpnTargetNetworkOutput) SetSecurityGroupIds(v []*string) *ApplySecurityGroupsToClientVpnTargetNetworkOutput { - s.SecurityGroupIds = v +// SetBundleTask sets the BundleTask field's value. +func (s *CancelBundleTaskOutput) SetBundleTask(v *BundleTask) *CancelBundleTaskOutput { + s.BundleTask = v return s } -type AssignIpv6AddressesInput struct { +type CancelCapacityReservationInput 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. + // The ID of the Capacity Reservation to be cancelled. // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` + // CapacityReservationId is a required field + CapacityReservationId *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 `type:"boolean"` } // String returns the string representation -func (s AssignIpv6AddressesInput) String() string { +func (s CancelCapacityReservationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssignIpv6AddressesInput) GoString() string { +func (s CancelCapacityReservationInput) 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")) +func (s *CancelCapacityReservationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CancelCapacityReservationInput"} + if s.CapacityReservationId == nil { + invalidParams.Add(request.NewErrParamRequired("CapacityReservationId")) } if invalidParams.Len() > 0 { @@ -33704,97 +40947,74 @@ func (s *AssignIpv6AddressesInput) Validate() error { 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 +// SetCapacityReservationId sets the CapacityReservationId field's value. +func (s *CancelCapacityReservationInput) SetCapacityReservationId(v string) *CancelCapacityReservationInput { + s.CapacityReservationId = &v return s } -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *AssignIpv6AddressesInput) SetNetworkInterfaceId(v string) *AssignIpv6AddressesInput { - s.NetworkInterfaceId = &v +// SetDryRun sets the DryRun field's value. +func (s *CancelCapacityReservationInput) SetDryRun(v bool) *CancelCapacityReservationInput { + s.DryRun = &v return s } -type AssignIpv6AddressesOutput struct { +type CancelCapacityReservationOutput 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"` + // Returns true if the request succeeds; otherwise, it returns an error. + Return *bool `locationName:"return" type:"boolean"` } // String returns the string representation -func (s AssignIpv6AddressesOutput) String() string { +func (s CancelCapacityReservationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssignIpv6AddressesOutput) GoString() string { +func (s CancelCapacityReservationOutput) 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 +// SetReturn sets the Return field's value. +func (s *CancelCapacityReservationOutput) SetReturn(v bool) *CancelCapacityReservationOutput { + s.Return = &v return s } -// Contains the parameters for AssignPrivateIpAddresses. -type AssignPrivateIpAddressesInput struct { +type CancelConversionTaskInput 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. + // The ID of the conversion task. // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` + // ConversionTaskId is a required field + ConversionTaskId *string `locationName:"conversionTaskId" 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"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides 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 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"` + // The reason for canceling the conversion task. + ReasonMessage *string `locationName:"reasonMessage" type:"string"` } // String returns the string representation -func (s AssignPrivateIpAddressesInput) String() string { +func (s CancelConversionTaskInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssignPrivateIpAddressesInput) GoString() string { +func (s CancelConversionTaskInput) 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")) +func (s *CancelConversionTaskInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CancelConversionTaskInput"} + if s.ConversionTaskId == nil { + invalidParams.Add(request.NewErrParamRequired("ConversionTaskId")) } if invalidParams.Len() > 0 { @@ -33803,247 +41023,200 @@ func (s *AssignPrivateIpAddressesInput) Validate() error { return nil } -// SetAllowReassignment sets the AllowReassignment field's value. -func (s *AssignPrivateIpAddressesInput) SetAllowReassignment(v bool) *AssignPrivateIpAddressesInput { - s.AllowReassignment = &v +// SetConversionTaskId sets the ConversionTaskId field's value. +func (s *CancelConversionTaskInput) SetConversionTaskId(v string) *CancelConversionTaskInput { + s.ConversionTaskId = &v return s } -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *AssignPrivateIpAddressesInput) SetNetworkInterfaceId(v string) *AssignPrivateIpAddressesInput { - s.NetworkInterfaceId = &v +// SetDryRun sets the DryRun field's value. +func (s *CancelConversionTaskInput) SetDryRun(v bool) *CancelConversionTaskInput { + s.DryRun = &v return s } -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *AssignPrivateIpAddressesInput) SetPrivateIpAddresses(v []*string) *AssignPrivateIpAddressesInput { - s.PrivateIpAddresses = v +// SetReasonMessage sets the ReasonMessage field's value. +func (s *CancelConversionTaskInput) SetReasonMessage(v string) *CancelConversionTaskInput { + s.ReasonMessage = &v return s } -// SetSecondaryPrivateIpAddressCount sets the SecondaryPrivateIpAddressCount field's value. -func (s *AssignPrivateIpAddressesInput) SetSecondaryPrivateIpAddressCount(v int64) *AssignPrivateIpAddressesInput { - s.SecondaryPrivateIpAddressCount = &v - return s +type CancelConversionTaskOutput struct { + _ struct{} `type:"structure"` } -type AssignPrivateIpAddressesOutput struct { - _ struct{} `type:"structure"` +// String returns the string representation +func (s CancelConversionTaskOutput) String() string { + return awsutil.Prettify(s) +} - // The private IP addresses assigned to the network interface. - AssignedPrivateIpAddresses []*AssignedPrivateIpAddress `locationName:"assignedPrivateIpAddressesSet" locationNameList:"item" type:"list"` +// GoString returns the string representation +func (s CancelConversionTaskOutput) GoString() string { + return s.String() +} - // The ID of the network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` +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 AssignPrivateIpAddressesOutput) String() string { +func (s CancelExportTaskInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssignPrivateIpAddressesOutput) GoString() string { +func (s CancelExportTaskInput) GoString() string { return s.String() } -// SetAssignedPrivateIpAddresses sets the AssignedPrivateIpAddresses field's value. -func (s *AssignPrivateIpAddressesOutput) SetAssignedPrivateIpAddresses(v []*AssignedPrivateIpAddress) *AssignPrivateIpAddressesOutput { - s.AssignedPrivateIpAddresses = v - return s +// 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 } -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *AssignPrivateIpAddressesOutput) SetNetworkInterfaceId(v string) *AssignPrivateIpAddressesOutput { - s.NetworkInterfaceId = &v +// SetExportTaskId sets the ExportTaskId field's value. +func (s *CancelExportTaskInput) SetExportTaskId(v string) *CancelExportTaskInput { + s.ExportTaskId = &v return s } -// Describes the private IP addresses assigned to a network interface. -type AssignedPrivateIpAddress struct { +type CancelExportTaskOutput struct { _ struct{} `type:"structure"` - - // The private IP address assigned to the network interface. - PrivateIpAddress *string `locationName:"privateIpAddress" type:"string"` } // String returns the string representation -func (s AssignedPrivateIpAddress) String() string { +func (s CancelExportTaskOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssignedPrivateIpAddress) GoString() string { +func (s CancelExportTaskOutput) GoString() string { return s.String() } -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *AssignedPrivateIpAddress) SetPrivateIpAddress(v string) *AssignedPrivateIpAddress { - s.PrivateIpAddress = &v - return s -} - -type AssociateAddressInput struct { +type CancelImportTaskInput 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"` + // 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 `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. - // - // For EC2-VPC, you can specify either the instance ID or the network interface - // ID, but not both. - 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"` + DryRun *bool `type:"boolean"` - // The Elastic IP address to associate with the instance. This is required for - // EC2-Classic. - PublicIp *string `type:"string"` + // The ID of the import image or import snapshot task to be canceled. + ImportTaskId *string `type:"string"` } // String returns the string representation -func (s AssociateAddressInput) String() string { +func (s CancelImportTaskInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateAddressInput) GoString() string { +func (s CancelImportTaskInput) 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 +// 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 *AssociateAddressInput) SetDryRun(v bool) *AssociateAddressInput { +func (s *CancelImportTaskInput) SetDryRun(v bool) *CancelImportTaskInput { 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 +// SetImportTaskId sets the ImportTaskId field's value. +func (s *CancelImportTaskInput) SetImportTaskId(v string) *CancelImportTaskInput { + s.ImportTaskId = &v return s } -type AssociateAddressOutput struct { +type CancelImportTaskOutput 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"` + // 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 AssociateAddressOutput) String() string { +func (s CancelImportTaskOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateAddressOutput) GoString() string { +func (s CancelImportTaskOutput) GoString() string { return s.String() } -// SetAssociationId sets the AssociationId field's value. -func (s *AssociateAddressOutput) SetAssociationId(v string) *AssociateAddressOutput { - s.AssociationId = &v +// SetImportTaskId sets the ImportTaskId field's value. +func (s *CancelImportTaskOutput) SetImportTaskId(v string) *CancelImportTaskOutput { + s.ImportTaskId = &v return s } -type AssociateClientVpnTargetNetworkInput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string" idempotencyToken:"true"` +// SetPreviousState sets the PreviousState field's value. +func (s *CancelImportTaskOutput) SetPreviousState(v string) *CancelImportTaskOutput { + s.PreviousState = &v + return s +} - // The ID of the Client VPN endpoint. - // - // ClientVpnEndpointId is a required field - ClientVpnEndpointId *string `type:"string" required:"true"` +// SetState sets the State field's value. +func (s *CancelImportTaskOutput) SetState(v string) *CancelImportTaskOutput { + s.State = &v + return s +} - // Checks whether you have the required permissions for the action, without - // actually making 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"` +// Contains the parameters for CancelReservedInstancesListing. +type CancelReservedInstancesListingInput struct { + _ struct{} `type:"structure"` - // The ID of the subnet to associate with the Client VPN endpoint. + // The ID of the Reserved Instance listing. // - // SubnetId is a required field - SubnetId *string `type:"string" required:"true"` + // ReservedInstancesListingId is a required field + ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string" required:"true"` } // String returns the string representation -func (s AssociateClientVpnTargetNetworkInput) String() string { +func (s CancelReservedInstancesListingInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateClientVpnTargetNetworkInput) GoString() string { +func (s CancelReservedInstancesListingInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateClientVpnTargetNetworkInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateClientVpnTargetNetworkInput"} - if s.ClientVpnEndpointId == nil { - invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) - } - if s.SubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetId")) +func (s *CancelReservedInstancesListingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CancelReservedInstancesListingInput"} + if s.ReservedInstancesListingId == nil { + invalidParams.Add(request.NewErrParamRequired("ReservedInstancesListingId")) } if invalidParams.Len() > 0 { @@ -34052,101 +41225,142 @@ func (s *AssociateClientVpnTargetNetworkInput) Validate() error { return nil } -// SetClientToken sets the ClientToken field's value. -func (s *AssociateClientVpnTargetNetworkInput) SetClientToken(v string) *AssociateClientVpnTargetNetworkInput { - s.ClientToken = &v +// SetReservedInstancesListingId sets the ReservedInstancesListingId field's value. +func (s *CancelReservedInstancesListingInput) SetReservedInstancesListingId(v string) *CancelReservedInstancesListingInput { + s.ReservedInstancesListingId = &v return s } -// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. -func (s *AssociateClientVpnTargetNetworkInput) SetClientVpnEndpointId(v string) *AssociateClientVpnTargetNetworkInput { - s.ClientVpnEndpointId = &v +// Contains the output of CancelReservedInstancesListing. +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 } -// SetDryRun sets the DryRun field's value. -func (s *AssociateClientVpnTargetNetworkInput) SetDryRun(v bool) *AssociateClientVpnTargetNetworkInput { - s.DryRun = &v +// Describes a Spot Fleet error. +type CancelSpotFleetRequestsError struct { + _ struct{} `type:"structure"` + + // The error code. + Code *string `locationName:"code" type:"string" enum:"CancelBatchErrorCode"` + + // The description for the error code. + Message *string `locationName:"message" type:"string"` +} + +// 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 } -// SetSubnetId sets the SubnetId field's value. -func (s *AssociateClientVpnTargetNetworkInput) SetSubnetId(v string) *AssociateClientVpnTargetNetworkInput { - s.SubnetId = &v +// SetMessage sets the Message field's value. +func (s *CancelSpotFleetRequestsError) SetMessage(v string) *CancelSpotFleetRequestsError { + s.Message = &v return s } -type AssociateClientVpnTargetNetworkOutput struct { +// Describes a Spot Fleet request that was not successfully canceled. +type CancelSpotFleetRequestsErrorItem struct { _ struct{} `type:"structure"` - // The unique ID of the target network association. - AssociationId *string `locationName:"associationId" type:"string"` + // The error. + Error *CancelSpotFleetRequestsError `locationName:"error" type:"structure"` - // The current state of the target network association. - Status *AssociationStatus `locationName:"status" type:"structure"` + // The ID of the Spot Fleet request. + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string"` } // String returns the string representation -func (s AssociateClientVpnTargetNetworkOutput) String() string { +func (s CancelSpotFleetRequestsErrorItem) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateClientVpnTargetNetworkOutput) GoString() string { +func (s CancelSpotFleetRequestsErrorItem) GoString() string { return s.String() } -// SetAssociationId sets the AssociationId field's value. -func (s *AssociateClientVpnTargetNetworkOutput) SetAssociationId(v string) *AssociateClientVpnTargetNetworkOutput { - s.AssociationId = &v +// SetError sets the Error field's value. +func (s *CancelSpotFleetRequestsErrorItem) SetError(v *CancelSpotFleetRequestsError) *CancelSpotFleetRequestsErrorItem { + s.Error = v return s } -// SetStatus sets the Status field's value. -func (s *AssociateClientVpnTargetNetworkOutput) SetStatus(v *AssociationStatus) *AssociateClientVpnTargetNetworkOutput { - s.Status = v +// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. +func (s *CancelSpotFleetRequestsErrorItem) SetSpotFleetRequestId(v string) *CancelSpotFleetRequestsErrorItem { + s.SpotFleetRequestId = &v return s } -type AssociateDhcpOptionsInput struct { +// Contains the parameters for CancelSpotFleetRequests. +type CancelSpotFleetRequestsInput 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. + // The IDs of the Spot Fleet requests. // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` + // 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 AssociateDhcpOptionsInput) String() string { +func (s CancelSpotFleetRequestsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateDhcpOptionsInput) GoString() string { +func (s CancelSpotFleetRequestsInput) 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")) +func (s *CancelSpotFleetRequestsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CancelSpotFleetRequestsInput"} + if s.SpotFleetRequestIds == nil { + invalidParams.Add(request.NewErrParamRequired("SpotFleetRequestIds")) } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) + if s.TerminateInstances == nil { + invalidParams.Add(request.NewErrParamRequired("TerminateInstances")) } if invalidParams.Len() > 0 { @@ -34155,114 +41369,101 @@ func (s *AssociateDhcpOptionsInput) Validate() error { 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 { +func (s *CancelSpotFleetRequestsInput) SetDryRun(v bool) *CancelSpotFleetRequestsInput { s.DryRun = &v return s } -// SetVpcId sets the VpcId field's value. -func (s *AssociateDhcpOptionsInput) SetVpcId(v string) *AssociateDhcpOptionsInput { - s.VpcId = &v +// SetSpotFleetRequestIds sets the SpotFleetRequestIds field's value. +func (s *CancelSpotFleetRequestsInput) SetSpotFleetRequestIds(v []*string) *CancelSpotFleetRequestsInput { + s.SpotFleetRequestIds = v return s } -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() +// SetTerminateInstances sets the TerminateInstances field's value. +func (s *CancelSpotFleetRequestsInput) SetTerminateInstances(v bool) *CancelSpotFleetRequestsInput { + s.TerminateInstances = &v + return s } -type AssociateIamInstanceProfileInput struct { +// Contains the output of CancelSpotFleetRequests. +type CancelSpotFleetRequestsOutput struct { _ struct{} `type:"structure"` - // The IAM instance profile. - // - // IamInstanceProfile is a required field - IamInstanceProfile *IamInstanceProfileSpecification `type:"structure" required:"true"` + // Information about the Spot Fleet requests that are successfully canceled. + SuccessfulFleetRequests []*CancelSpotFleetRequestsSuccessItem `locationName:"successfulFleetRequestSet" locationNameList:"item" type:"list"` - // The ID of the instance. - // - // InstanceId is a required field - InstanceId *string `type:"string" required:"true"` + // 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 AssociateIamInstanceProfileInput) String() string { +func (s CancelSpotFleetRequestsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateIamInstanceProfileInput) GoString() string { +func (s CancelSpotFleetRequestsOutput) 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 +// SetSuccessfulFleetRequests sets the SuccessfulFleetRequests field's value. +func (s *CancelSpotFleetRequestsOutput) SetSuccessfulFleetRequests(v []*CancelSpotFleetRequestsSuccessItem) *CancelSpotFleetRequestsOutput { + s.SuccessfulFleetRequests = v return s } -// SetInstanceId sets the InstanceId field's value. -func (s *AssociateIamInstanceProfileInput) SetInstanceId(v string) *AssociateIamInstanceProfileInput { - s.InstanceId = &v +// SetUnsuccessfulFleetRequests sets the UnsuccessfulFleetRequests field's value. +func (s *CancelSpotFleetRequestsOutput) SetUnsuccessfulFleetRequests(v []*CancelSpotFleetRequestsErrorItem) *CancelSpotFleetRequestsOutput { + s.UnsuccessfulFleetRequests = v return s } -type AssociateIamInstanceProfileOutput struct { +// Describes a Spot Fleet request that was successfully canceled. +type CancelSpotFleetRequestsSuccessItem struct { _ struct{} `type:"structure"` - // Information about the IAM instance profile association. - IamInstanceProfileAssociation *IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociation" type:"structure"` + // The current state of the Spot Fleet request. + CurrentSpotFleetRequestState *string `locationName:"currentSpotFleetRequestState" type:"string" enum:"BatchState"` + + // The previous state of the Spot Fleet request. + PreviousSpotFleetRequestState *string `locationName:"previousSpotFleetRequestState" type:"string" enum:"BatchState"` + + // The ID of the Spot Fleet request. + SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string"` } // String returns the string representation -func (s AssociateIamInstanceProfileOutput) String() string { +func (s CancelSpotFleetRequestsSuccessItem) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateIamInstanceProfileOutput) GoString() string { +func (s CancelSpotFleetRequestsSuccessItem) GoString() string { return s.String() } -// SetIamInstanceProfileAssociation sets the IamInstanceProfileAssociation field's value. -func (s *AssociateIamInstanceProfileOutput) SetIamInstanceProfileAssociation(v *IamInstanceProfileAssociation) *AssociateIamInstanceProfileOutput { - s.IamInstanceProfileAssociation = v +// SetCurrentSpotFleetRequestState sets the CurrentSpotFleetRequestState field's value. +func (s *CancelSpotFleetRequestsSuccessItem) SetCurrentSpotFleetRequestState(v string) *CancelSpotFleetRequestsSuccessItem { + s.CurrentSpotFleetRequestState = &v return s } -type AssociateRouteTableInput struct { +// 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. +type CancelSpotInstanceRequestsInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -34271,35 +41472,27 @@ type AssociateRouteTableInput struct { // 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. + // One or more Spot Instance request IDs. // - // SubnetId is a required field - SubnetId *string `locationName:"subnetId" type:"string" required:"true"` + // SpotInstanceRequestIds is a required field + SpotInstanceRequestIds []*string `locationName:"SpotInstanceRequestId" locationNameList:"SpotInstanceRequestId" type:"list" required:"true"` } // String returns the string representation -func (s AssociateRouteTableInput) String() string { +func (s CancelSpotInstanceRequestsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateRouteTableInput) GoString() string { +func (s CancelSpotInstanceRequestsInput) 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")) +func (s *CancelSpotInstanceRequestsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CancelSpotInstanceRequestsInput"} + if s.SpotInstanceRequestIds == nil { + invalidParams.Add(request.NewErrParamRequired("SpotInstanceRequestIds")) } if invalidParams.Len() > 0 { @@ -34309,611 +41502,622 @@ func (s *AssociateRouteTableInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *AssociateRouteTableInput) SetDryRun(v bool) *AssociateRouteTableInput { +func (s *CancelSpotInstanceRequestsInput) SetDryRun(v bool) *CancelSpotInstanceRequestsInput { 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 +// SetSpotInstanceRequestIds sets the SpotInstanceRequestIds field's value. +func (s *CancelSpotInstanceRequestsInput) SetSpotInstanceRequestIds(v []*string) *CancelSpotInstanceRequestsInput { + s.SpotInstanceRequestIds = v return s } -type AssociateRouteTableOutput struct { +// Contains the output of CancelSpotInstanceRequests. +type CancelSpotInstanceRequestsOutput struct { _ struct{} `type:"structure"` - // The route table association ID. This ID is required for disassociating the - // route table. - AssociationId *string `locationName:"associationId" type:"string"` + // One or more Spot Instance requests. + CancelledSpotInstanceRequests []*CancelledSpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s AssociateRouteTableOutput) String() string { +func (s CancelSpotInstanceRequestsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateRouteTableOutput) GoString() string { +func (s CancelSpotInstanceRequestsOutput) GoString() string { return s.String() } -// SetAssociationId sets the AssociationId field's value. -func (s *AssociateRouteTableOutput) SetAssociationId(v string) *AssociateRouteTableOutput { - s.AssociationId = &v +// SetCancelledSpotInstanceRequests sets the CancelledSpotInstanceRequests field's value. +func (s *CancelSpotInstanceRequestsOutput) SetCancelledSpotInstanceRequests(v []*CancelledSpotInstanceRequest) *CancelSpotInstanceRequestsOutput { + s.CancelledSpotInstanceRequests = v return s } -type AssociateSubnetCidrBlockInput struct { +// Describes a request to cancel a Spot Instance. +type CancelledSpotInstanceRequest 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 the Spot Instance request. + SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` - // The ID of your subnet. - // - // SubnetId is a required field - SubnetId *string `locationName:"subnetId" type:"string" required:"true"` + // The state of the Spot Instance request. + State *string `locationName:"state" type:"string" enum:"CancelSpotInstanceRequestState"` } // String returns the string representation -func (s AssociateSubnetCidrBlockInput) String() string { +func (s CancelledSpotInstanceRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateSubnetCidrBlockInput) GoString() string { +func (s CancelledSpotInstanceRequest) 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 +// SetSpotInstanceRequestId sets the SpotInstanceRequestId field's value. +func (s *CancelledSpotInstanceRequest) SetSpotInstanceRequestId(v string) *CancelledSpotInstanceRequest { + s.SpotInstanceRequestId = &v return s } -// SetSubnetId sets the SubnetId field's value. -func (s *AssociateSubnetCidrBlockInput) SetSubnetId(v string) *AssociateSubnetCidrBlockInput { - s.SubnetId = &v +// SetState sets the State field's value. +func (s *CancelledSpotInstanceRequest) SetState(v string) *CancelledSpotInstanceRequest { + s.State = &v return s } -type AssociateSubnetCidrBlockOutput struct { - _ struct{} `type:"structure"` +// Describes a Capacity Reservation. +type CapacityReservation struct { + _ struct{} `type:"structure"` + + // The Availability Zone in which the capacity is reserved. + AvailabilityZone *string `locationName:"availabilityZone" type:"string"` + + // The Availability Zone ID of the Capacity Reservation. + AvailabilityZoneId *string `locationName:"availabilityZoneId" type:"string"` + + // The remaining capacity. Indicates the number of instances that can be launched + // in the Capacity Reservation. + AvailableInstanceCount *int64 `locationName:"availableInstanceCount" type:"integer"` + + // The Amazon Resource Name (ARN) of the Capacity Reservation. + CapacityReservationArn *string `locationName:"capacityReservationArn" type:"string"` + + // The ID of the Capacity Reservation. + CapacityReservationId *string `locationName:"capacityReservationId" type:"string"` + + // The date and time at which the Capacity Reservation was created. + CreateDate *time.Time `locationName:"createDate" type:"timestamp"` + + // Indicates whether the Capacity Reservation supports EBS-optimized instances. + // 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"` + + // The date and time at which the Capacity Reservation expires. When a Capacity + // Reservation expires, the reserved capacity is released and you can no longer + // launch instances into it. The Capacity Reservation's state changes to expired + // when it reaches its end date and time. + EndDate *time.Time `locationName:"endDate" type:"timestamp"` + + // Indicates the way in which the Capacity Reservation ends. A Capacity Reservation + // can have one of the following end types: + // + // * unlimited - The Capacity Reservation remains active until you explicitly + // cancel it. + // + // * limited - The Capacity Reservation expires automatically at a specified + // date and time. + EndDateType *string `locationName:"endDateType" type:"string" enum:"EndDateType"` + + // Indicates whether the Capacity Reservation supports instances with temporary, + // block-level storage. + EphemeralStorage *bool `locationName:"ephemeralStorage" type:"boolean"` + + // Indicates the type of instance launches that the Capacity Reservation accepts. + // The options include: + // + // * open - The Capacity Reservation accepts all instances that have matching + // attributes (instance type, platform, and Availability Zone). Instances + // that have matching attributes launch into the Capacity Reservation automatically + // without specifying any additional parameters. + // + // * targeted - The Capacity Reservation only accepts instances that have + // matching attributes (instance type, platform, and Availability Zone), + // and explicitly target the Capacity Reservation. This ensures that only + // permitted instances can use the reserved capacity. + InstanceMatchCriteria *string `locationName:"instanceMatchCriteria" type:"string" enum:"InstanceMatchCriteria"` + + // The type of operating system for which the Capacity Reservation reserves + // capacity. + InstancePlatform *string `locationName:"instancePlatform" type:"string" enum:"CapacityReservationInstancePlatform"` + + // The type of instance for which the Capacity Reservation reserves capacity. + InstanceType *string `locationName:"instanceType" type:"string"` + + // The ID of the AWS account that owns the Capacity Reservation. + OwnerId *string `locationName:"ownerId" type:"string"` + + // The current state of the Capacity Reservation. A Capacity Reservation can + // be in one of the following states: + // + // * active - The Capacity Reservation is active and the capacity is available + // for your use. + // + // * expired - The Capacity Reservation expired automatically at the date + // and time specified in your request. The reserved capacity is no longer + // available for your use. + // + // * cancelled - The Capacity Reservation was manually cancelled. The reserved + // capacity is no longer available for your use. + // + // * pending - The Capacity Reservation request was successful but the capacity + // provisioning is still pending. + // + // * failed - The Capacity Reservation request has failed. A request might + // fail due to invalid request parameters, capacity constraints, or instance + // limit constraints. Failed requests are retained for 60 minutes. + State *string `locationName:"state" type:"string" enum:"CapacityReservationState"` + + // Any tags assigned to the Capacity Reservation. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` - // Information about the IPv6 CIDR block association. - Ipv6CidrBlockAssociation *SubnetIpv6CidrBlockAssociation `locationName:"ipv6CidrBlockAssociation" type:"structure"` + // Indicates the tenancy of the Capacity Reservation. A Capacity Reservation + // can have one of the following tenancy settings: + // + // * default - The Capacity Reservation is created on hardware that is shared + // with other AWS accounts. + // + // * dedicated - The Capacity Reservation is created on single-tenant hardware + // that is dedicated to a single AWS account. + Tenancy *string `locationName:"tenancy" type:"string" enum:"CapacityReservationTenancy"` - // The ID of the subnet. - SubnetId *string `locationName:"subnetId" type:"string"` + // The total number of instances for which the Capacity Reservation reserves + // capacity. + TotalInstanceCount *int64 `locationName:"totalInstanceCount" type:"integer"` } // String returns the string representation -func (s AssociateSubnetCidrBlockOutput) String() string { +func (s CapacityReservation) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateSubnetCidrBlockOutput) GoString() string { +func (s CapacityReservation) GoString() string { return s.String() } -// SetIpv6CidrBlockAssociation sets the Ipv6CidrBlockAssociation field's value. -func (s *AssociateSubnetCidrBlockOutput) SetIpv6CidrBlockAssociation(v *SubnetIpv6CidrBlockAssociation) *AssociateSubnetCidrBlockOutput { - s.Ipv6CidrBlockAssociation = v +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *CapacityReservation) SetAvailabilityZone(v string) *CapacityReservation { + s.AvailabilityZone = &v return s } -// SetSubnetId sets the SubnetId field's value. -func (s *AssociateSubnetCidrBlockOutput) SetSubnetId(v string) *AssociateSubnetCidrBlockOutput { - s.SubnetId = &v +// SetAvailabilityZoneId sets the AvailabilityZoneId field's value. +func (s *CapacityReservation) SetAvailabilityZoneId(v string) *CapacityReservation { + s.AvailabilityZoneId = &v return s } -type AssociateTransitGatewayRouteTableInput 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 attachment. - // - // TransitGatewayAttachmentId is a required field - TransitGatewayAttachmentId *string `type:"string" required:"true"` - - // The ID of the transit gateway route table. - // - // TransitGatewayRouteTableId is a required field - TransitGatewayRouteTableId *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s AssociateTransitGatewayRouteTableInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s AssociateTransitGatewayRouteTableInput) GoString() string { - return s.String() +// SetAvailableInstanceCount sets the AvailableInstanceCount field's value. +func (s *CapacityReservation) SetAvailableInstanceCount(v int64) *CapacityReservation { + s.AvailableInstanceCount = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateTransitGatewayRouteTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateTransitGatewayRouteTableInput"} - if s.TransitGatewayAttachmentId == nil { - invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId")) - } - if s.TransitGatewayRouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCapacityReservationArn sets the CapacityReservationArn field's value. +func (s *CapacityReservation) SetCapacityReservationArn(v string) *CapacityReservation { + s.CapacityReservationArn = &v + return s } -// SetDryRun sets the DryRun field's value. -func (s *AssociateTransitGatewayRouteTableInput) SetDryRun(v bool) *AssociateTransitGatewayRouteTableInput { - s.DryRun = &v +// SetCapacityReservationId sets the CapacityReservationId field's value. +func (s *CapacityReservation) SetCapacityReservationId(v string) *CapacityReservation { + s.CapacityReservationId = &v return s } -// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. -func (s *AssociateTransitGatewayRouteTableInput) SetTransitGatewayAttachmentId(v string) *AssociateTransitGatewayRouteTableInput { - s.TransitGatewayAttachmentId = &v +// SetCreateDate sets the CreateDate field's value. +func (s *CapacityReservation) SetCreateDate(v time.Time) *CapacityReservation { + s.CreateDate = &v return s } -// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value. -func (s *AssociateTransitGatewayRouteTableInput) SetTransitGatewayRouteTableId(v string) *AssociateTransitGatewayRouteTableInput { - s.TransitGatewayRouteTableId = &v +// SetEbsOptimized sets the EbsOptimized field's value. +func (s *CapacityReservation) SetEbsOptimized(v bool) *CapacityReservation { + s.EbsOptimized = &v return s } -type AssociateTransitGatewayRouteTableOutput struct { - _ struct{} `type:"structure"` - - // The ID of the association. - Association *TransitGatewayAssociation `locationName:"association" type:"structure"` +// SetEndDate sets the EndDate field's value. +func (s *CapacityReservation) SetEndDate(v time.Time) *CapacityReservation { + s.EndDate = &v + return s } -// String returns the string representation -func (s AssociateTransitGatewayRouteTableOutput) String() string { - return awsutil.Prettify(s) +// SetEndDateType sets the EndDateType field's value. +func (s *CapacityReservation) SetEndDateType(v string) *CapacityReservation { + s.EndDateType = &v + return s } -// GoString returns the string representation -func (s AssociateTransitGatewayRouteTableOutput) GoString() string { - return s.String() +// SetEphemeralStorage sets the EphemeralStorage field's value. +func (s *CapacityReservation) SetEphemeralStorage(v bool) *CapacityReservation { + s.EphemeralStorage = &v + return s } -// SetAssociation sets the Association field's value. -func (s *AssociateTransitGatewayRouteTableOutput) SetAssociation(v *TransitGatewayAssociation) *AssociateTransitGatewayRouteTableOutput { - s.Association = v +// SetInstanceMatchCriteria sets the InstanceMatchCriteria field's value. +func (s *CapacityReservation) SetInstanceMatchCriteria(v string) *CapacityReservation { + s.InstanceMatchCriteria = &v return s } -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"` - - // An IPv4 CIDR block to associate with the VPC. - CidrBlock *string `type:"string"` - - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` +// SetInstancePlatform sets the InstancePlatform field's value. +func (s *CapacityReservation) SetInstancePlatform(v string) *CapacityReservation { + s.InstancePlatform = &v + return s } -// String returns the string representation -func (s AssociateVpcCidrBlockInput) String() string { - return awsutil.Prettify(s) +// SetInstanceType sets the InstanceType field's value. +func (s *CapacityReservation) SetInstanceType(v string) *CapacityReservation { + s.InstanceType = &v + return s } -// GoString returns the string representation -func (s AssociateVpcCidrBlockInput) GoString() string { - return s.String() +// SetOwnerId sets the OwnerId field's value. +func (s *CapacityReservation) SetOwnerId(v string) *CapacityReservation { + s.OwnerId = &v + return s } -// 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 +// SetState sets the State field's value. +func (s *CapacityReservation) SetState(v string) *CapacityReservation { + s.State = &v + return s } -// SetAmazonProvidedIpv6CidrBlock sets the AmazonProvidedIpv6CidrBlock field's value. -func (s *AssociateVpcCidrBlockInput) SetAmazonProvidedIpv6CidrBlock(v bool) *AssociateVpcCidrBlockInput { - s.AmazonProvidedIpv6CidrBlock = &v +// SetTags sets the Tags field's value. +func (s *CapacityReservation) SetTags(v []*Tag) *CapacityReservation { + s.Tags = v return s } -// SetCidrBlock sets the CidrBlock field's value. -func (s *AssociateVpcCidrBlockInput) SetCidrBlock(v string) *AssociateVpcCidrBlockInput { - s.CidrBlock = &v +// SetTenancy sets the Tenancy field's value. +func (s *CapacityReservation) SetTenancy(v string) *CapacityReservation { + s.Tenancy = &v return s } -// SetVpcId sets the VpcId field's value. -func (s *AssociateVpcCidrBlockInput) SetVpcId(v string) *AssociateVpcCidrBlockInput { - s.VpcId = &v +// SetTotalInstanceCount sets the TotalInstanceCount field's value. +func (s *CapacityReservation) SetTotalInstanceCount(v int64) *CapacityReservation { + s.TotalInstanceCount = &v return s } -type AssociateVpcCidrBlockOutput struct { +// Describes the strategy for using unused Capacity Reservations for fulfilling +// On-Demand capacity. +// +// This strategy can only be used if the EC2 Fleet is of type instant. +// +// For more information about Capacity Reservations, see On-Demand Capacity +// Reservations (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html) +// in the Amazon Elastic Compute Cloud User Guide. For examples of using Capacity +// Reservations in an EC2 Fleet, see EC2 Fleet Example Configurations (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-examples.html) +// in the Amazon Elastic Compute Cloud User Guide. +type CapacityReservationOptions struct { _ struct{} `type:"structure"` - // Information about the IPv4 CIDR block association. - CidrBlockAssociation *VpcCidrBlockAssociation `locationName:"cidrBlockAssociation" 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"` + // Indicates whether to use unused Capacity Reservations for fulfilling On-Demand + // capacity. + // + // If you specify use-capacity-reservations-first, the fleet uses unused Capacity + // Reservations to fulfill On-Demand capacity up to the target On-Demand capacity. + // If multiple instance pools have unused Capacity Reservations, the On-Demand + // allocation strategy (lowest-price or prioritized) is applied. If the number + // of unused Capacity Reservations is less than the On-Demand target capacity, + // the remaining On-Demand target capacity is launched according to the On-Demand + // allocation strategy (lowest-price or prioritized). + // + // If you do not specify a value, the fleet fulfils the On-Demand capacity according + // to the chosen On-Demand allocation strategy. + UsageStrategy *string `locationName:"usageStrategy" type:"string" enum:"FleetCapacityReservationUsageStrategy"` } // String returns the string representation -func (s AssociateVpcCidrBlockOutput) String() string { +func (s CapacityReservationOptions) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateVpcCidrBlockOutput) GoString() string { +func (s CapacityReservationOptions) GoString() string { return s.String() } -// SetCidrBlockAssociation sets the CidrBlockAssociation field's value. -func (s *AssociateVpcCidrBlockOutput) SetCidrBlockAssociation(v *VpcCidrBlockAssociation) *AssociateVpcCidrBlockOutput { - s.CidrBlockAssociation = v - return s -} - -// 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 +// SetUsageStrategy sets the UsageStrategy field's value. +func (s *CapacityReservationOptions) SetUsageStrategy(v string) *CapacityReservationOptions { + s.UsageStrategy = &v return s } -// Describes a target network that is associated with a Client VPN endpoint. -// A target network is a subnet in a VPC. -type AssociatedTargetNetwork struct { +// Describes the strategy for using unused Capacity Reservations for fulfilling +// On-Demand capacity. +// +// This strategy can only be used if the EC2 Fleet is of type instant. +// +// For more information about Capacity Reservations, see On-Demand Capacity +// Reservations (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html) +// in the Amazon Elastic Compute Cloud User Guide. For examples of using Capacity +// Reservations in an EC2 Fleet, see EC2 Fleet Example Configurations (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-examples.html) +// in the Amazon Elastic Compute Cloud User Guide. +type CapacityReservationOptionsRequest struct { _ struct{} `type:"structure"` - // The ID of the subnet. - NetworkId *string `locationName:"networkId" type:"string"` - - // The target network type. - NetworkType *string `locationName:"networkType" type:"string" enum:"AssociatedNetworkType"` + // Indicates whether to use unused Capacity Reservations for fulfilling On-Demand + // capacity. + // + // If you specify use-capacity-reservations-first, the fleet uses unused Capacity + // Reservations to fulfill On-Demand capacity up to the target On-Demand capacity. + // If multiple instance pools have unused Capacity Reservations, the On-Demand + // allocation strategy (lowest-price or prioritized) is applied. If the number + // of unused Capacity Reservations is less than the On-Demand target capacity, + // the remaining On-Demand target capacity is launched according to the On-Demand + // allocation strategy (lowest-price or prioritized). + // + // If you do not specify a value, the fleet fulfils the On-Demand capacity according + // to the chosen On-Demand allocation strategy. + UsageStrategy *string `type:"string" enum:"FleetCapacityReservationUsageStrategy"` } // String returns the string representation -func (s AssociatedTargetNetwork) String() string { +func (s CapacityReservationOptionsRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociatedTargetNetwork) GoString() string { +func (s CapacityReservationOptionsRequest) GoString() string { return s.String() } -// SetNetworkId sets the NetworkId field's value. -func (s *AssociatedTargetNetwork) SetNetworkId(v string) *AssociatedTargetNetwork { - s.NetworkId = &v - return s -} - -// SetNetworkType sets the NetworkType field's value. -func (s *AssociatedTargetNetwork) SetNetworkType(v string) *AssociatedTargetNetwork { - s.NetworkType = &v +// SetUsageStrategy sets the UsageStrategy field's value. +func (s *CapacityReservationOptionsRequest) SetUsageStrategy(v string) *CapacityReservationOptionsRequest { + s.UsageStrategy = &v return s } -// Describes the state of a target network association. -type AssociationStatus struct { +// Describes an instance's Capacity Reservation targeting option. You can specify +// only one parameter at a time. If you specify CapacityReservationPreference +// and CapacityReservationTarget, the request fails. +// +// Use the CapacityReservationPreference parameter to configure the instance +// to run as an On-Demand Instance or to run in any open Capacity Reservation +// that has matching attributes (instance type, platform, Availability Zone). +// Use the CapacityReservationTarget parameter to explicitly target a specific +// Capacity Reservation. +type CapacityReservationSpecification struct { _ struct{} `type:"structure"` - // The state of the target network association. - Code *string `locationName:"code" type:"string" enum:"AssociationStatusCode"` + // Indicates the instance's Capacity Reservation preferences. Possible preferences + // include: + // + // * open - The instance can run in any open Capacity Reservation that has + // matching attributes (instance type, platform, Availability Zone). + // + // * none - The instance avoids running in a Capacity Reservation even if + // one is available. The instance runs as an On-Demand Instance. + CapacityReservationPreference *string `type:"string" enum:"CapacityReservationPreference"` - // A message about the status of the target network association, if applicable. - Message *string `locationName:"message" type:"string"` + // Information about the target Capacity Reservation. + CapacityReservationTarget *CapacityReservationTarget `type:"structure"` } // String returns the string representation -func (s AssociationStatus) String() string { +func (s CapacityReservationSpecification) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociationStatus) GoString() string { +func (s CapacityReservationSpecification) GoString() string { return s.String() } -// SetCode sets the Code field's value. -func (s *AssociationStatus) SetCode(v string) *AssociationStatus { - s.Code = &v +// SetCapacityReservationPreference sets the CapacityReservationPreference field's value. +func (s *CapacityReservationSpecification) SetCapacityReservationPreference(v string) *CapacityReservationSpecification { + s.CapacityReservationPreference = &v return s } -// SetMessage sets the Message field's value. -func (s *AssociationStatus) SetMessage(v string) *AssociationStatus { - s.Message = &v +// SetCapacityReservationTarget sets the CapacityReservationTarget field's value. +func (s *CapacityReservationSpecification) SetCapacityReservationTarget(v *CapacityReservationTarget) *CapacityReservationSpecification { + s.CapacityReservationTarget = v return s } -type AttachClassicLinkVpcInput struct { +// Describes the instance's Capacity Reservation targeting preferences. The +// action returns the capacityReservationPreference response element if the +// instance is configured to run in On-Demand capacity, or if it is configured +// in run in any open Capacity Reservation that has matching attributes (instance +// type, platform, Availability Zone). The action returns the capacityReservationTarget +// response element if the instance explicily targets a specific Capacity Reservation. +type CapacityReservationSpecificationResponse 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. + // Describes the instance's Capacity Reservation preferences. Possible preferences + // include: // - // 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. + // * open - The instance can run in any open Capacity Reservation that has + // matching attributes (instance type, platform, Availability Zone). // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` + // * none - The instance avoids running in a Capacity Reservation even if + // one is available. The instance runs in On-Demand capacity. + CapacityReservationPreference *string `locationName:"capacityReservationPreference" type:"string" enum:"CapacityReservationPreference"` - // The ID of a ClassicLink-enabled VPC. - // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` + // Information about the targeted Capacity Reservation. + CapacityReservationTarget *CapacityReservationTargetResponse `locationName:"capacityReservationTarget" type:"structure"` } // String returns the string representation -func (s AttachClassicLinkVpcInput) String() string { +func (s CapacityReservationSpecificationResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AttachClassicLinkVpcInput) GoString() string { +func (s CapacityReservationSpecificationResponse) 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 +// SetCapacityReservationPreference sets the CapacityReservationPreference field's value. +func (s *CapacityReservationSpecificationResponse) SetCapacityReservationPreference(v string) *CapacityReservationSpecificationResponse { + s.CapacityReservationPreference = &v return s } -// SetVpcId sets the VpcId field's value. -func (s *AttachClassicLinkVpcInput) SetVpcId(v string) *AttachClassicLinkVpcInput { - s.VpcId = &v +// SetCapacityReservationTarget sets the CapacityReservationTarget field's value. +func (s *CapacityReservationSpecificationResponse) SetCapacityReservationTarget(v *CapacityReservationTargetResponse) *CapacityReservationSpecificationResponse { + s.CapacityReservationTarget = v return s } -type AttachClassicLinkVpcOutput struct { +// Describes a target Capacity Reservation. +type CapacityReservationTarget struct { _ struct{} `type:"structure"` - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` + // The ID of the Capacity Reservation. + CapacityReservationId *string `type:"string"` } // String returns the string representation -func (s AttachClassicLinkVpcOutput) String() string { +func (s CapacityReservationTarget) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AttachClassicLinkVpcOutput) GoString() string { +func (s CapacityReservationTarget) GoString() string { return s.String() } -// SetReturn sets the Return field's value. -func (s *AttachClassicLinkVpcOutput) SetReturn(v bool) *AttachClassicLinkVpcOutput { - s.Return = &v +// SetCapacityReservationId sets the CapacityReservationId field's value. +func (s *CapacityReservationTarget) SetCapacityReservationId(v string) *CapacityReservationTarget { + s.CapacityReservationId = &v return s } -type AttachInternetGatewayInput struct { +// Describes a target Capacity Reservation. +type CapacityReservationTargetResponse 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"` + // The ID of the Capacity Reservation. + CapacityReservationId *string `locationName:"capacityReservationId" type:"string"` } // String returns the string representation -func (s AttachInternetGatewayInput) String() string { +func (s CapacityReservationTargetResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AttachInternetGatewayInput) GoString() string { +func (s CapacityReservationTargetResponse) 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")) - } +// SetCapacityReservationId sets the CapacityReservationId field's value. +func (s *CapacityReservationTargetResponse) SetCapacityReservationId(v string) *CapacityReservationTargetResponse { + s.CapacityReservationId = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// Information about the client certificate used for authentication. +type CertificateAuthentication struct { + _ struct{} `type:"structure"` + + // The ARN of the client certificate. + ClientRootCertificateChain *string `locationName:"clientRootCertificateChain" type:"string"` } -// SetDryRun sets the DryRun field's value. -func (s *AttachInternetGatewayInput) SetDryRun(v bool) *AttachInternetGatewayInput { - s.DryRun = &v - return s +// String returns the string representation +func (s CertificateAuthentication) String() string { + return awsutil.Prettify(s) } -// SetInternetGatewayId sets the InternetGatewayId field's value. -func (s *AttachInternetGatewayInput) SetInternetGatewayId(v string) *AttachInternetGatewayInput { - s.InternetGatewayId = &v - return s +// GoString returns the string representation +func (s CertificateAuthentication) GoString() string { + return s.String() } -// SetVpcId sets the VpcId field's value. -func (s *AttachInternetGatewayInput) SetVpcId(v string) *AttachInternetGatewayInput { - s.VpcId = &v +// SetClientRootCertificateChain sets the ClientRootCertificateChain field's value. +func (s *CertificateAuthentication) SetClientRootCertificateChain(v string) *CertificateAuthentication { + s.ClientRootCertificateChain = &v return s } -type AttachInternetGatewayOutput struct { +// Information about the client certificate to be used for authentication. +type CertificateAuthenticationRequest struct { _ struct{} `type:"structure"` + + // The ARN of the client certificate. The certificate must be signed by a certificate + // authority (CA) and it must be provisioned in AWS Certificate Manager (ACM). + ClientRootCertificateChainArn *string `type:"string"` } // String returns the string representation -func (s AttachInternetGatewayOutput) String() string { +func (s CertificateAuthenticationRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AttachInternetGatewayOutput) GoString() string { +func (s CertificateAuthenticationRequest) GoString() string { return s.String() } -// Contains the parameters for AttachNetworkInterface. -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"` +// SetClientRootCertificateChainArn sets the ClientRootCertificateChainArn field's value. +func (s *CertificateAuthenticationRequest) SetClientRootCertificateChainArn(v string) *CertificateAuthenticationRequest { + s.ClientRootCertificateChainArn = &v + return s +} - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` +// Provides authorization for Amazon to bring a specific IP address range to +// a specific AWS account using bring your own IP addresses (BYOIP). For more +// information, see Prepare to Bring Your Address Range to Your AWS Account +// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#prepare-for-byoip) +// in the Amazon Elastic Compute Cloud User Guide. +type CidrAuthorizationContext struct { + _ struct{} `type:"structure"` - // The ID of the instance. + // The plain-text authorization message for the prefix and account. // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` + // Message is a required field + Message *string `type:"string" required:"true"` - // The ID of the network interface. + // The signed authorization message for the prefix and account. // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` + // Signature is a required field + Signature *string `type:"string" required:"true"` } // String returns the string representation -func (s AttachNetworkInterfaceInput) String() string { +func (s CidrAuthorizationContext) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AttachNetworkInterfaceInput) GoString() string { +func (s CidrAuthorizationContext) 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")) +func (s *CidrAuthorizationContext) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CidrAuthorizationContext"} + if s.Message == nil { + invalidParams.Add(request.NewErrParamRequired("Message")) } - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) + if s.Signature == nil { + invalidParams.Add(request.NewErrParamRequired("Signature")) } if invalidParams.Len() > 0 { @@ -34922,964 +42126,1007 @@ func (s *AttachNetworkInterfaceInput) Validate() error { 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 +// SetMessage sets the Message field's value. +func (s *CidrAuthorizationContext) SetMessage(v string) *CidrAuthorizationContext { + s.Message = &v return s } -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *AttachNetworkInterfaceInput) SetNetworkInterfaceId(v string) *AttachNetworkInterfaceInput { - s.NetworkInterfaceId = &v +// SetSignature sets the Signature field's value. +func (s *CidrAuthorizationContext) SetSignature(v string) *CidrAuthorizationContext { + s.Signature = &v return s } -// Contains the output of AttachNetworkInterface. -type AttachNetworkInterfaceOutput struct { +// Describes an IPv4 CIDR block. +type CidrBlock struct { _ struct{} `type:"structure"` - // The ID of the network interface attachment. - AttachmentId *string `locationName:"attachmentId" type:"string"` + // The IPv4 CIDR block. + CidrBlock *string `locationName:"cidrBlock" type:"string"` } // String returns the string representation -func (s AttachNetworkInterfaceOutput) String() string { +func (s CidrBlock) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AttachNetworkInterfaceOutput) GoString() string { +func (s CidrBlock) GoString() string { return s.String() } -// SetAttachmentId sets the AttachmentId field's value. -func (s *AttachNetworkInterfaceOutput) SetAttachmentId(v string) *AttachNetworkInterfaceOutput { - s.AttachmentId = &v +// SetCidrBlock sets the CidrBlock field's value. +func (s *CidrBlock) SetCidrBlock(v string) *CidrBlock { + s.CidrBlock = &v return s } -// Contains the parameters for AttachVolume. -type AttachVolumeInput struct { +// Describes the ClassicLink DNS support status of a VPC. +type ClassicLinkDnsSupport struct { _ struct{} `type:"structure"` - // The device name (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"` + // Indicates whether ClassicLink DNS support is enabled for the VPC. + ClassicLinkDnsSupported *bool `locationName:"classicLinkDnsSupported" type:"boolean"` - // 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"` + // The ID of the VPC. + VpcId *string `locationName:"vpcId" type:"string"` } // String returns the string representation -func (s AttachVolumeInput) String() string { +func (s ClassicLinkDnsSupport) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AttachVolumeInput) GoString() string { +func (s ClassicLinkDnsSupport) 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 +// SetClassicLinkDnsSupported sets the ClassicLinkDnsSupported field's value. +func (s *ClassicLinkDnsSupport) SetClassicLinkDnsSupported(v bool) *ClassicLinkDnsSupport { + s.ClassicLinkDnsSupported = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *AttachVolumeInput) SetDryRun(v bool) *AttachVolumeInput { - s.DryRun = &v +// SetVpcId sets the VpcId field's value. +func (s *ClassicLinkDnsSupport) SetVpcId(v string) *ClassicLinkDnsSupport { + s.VpcId = &v return s } -// SetInstanceId sets the InstanceId field's value. -func (s *AttachVolumeInput) SetInstanceId(v string) *AttachVolumeInput { - s.InstanceId = &v - return s -} +// Describes a linked EC2-Classic instance. +type ClassicLinkInstance struct { + _ struct{} `type:"structure"` -// SetVolumeId sets the VolumeId field's value. -func (s *AttachVolumeInput) SetVolumeId(v string) *AttachVolumeInput { - s.VolumeId = &v - return s -} + // A list of security groups. + Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` -// Contains the parameters for AttachVpnGateway. -type AttachVpnGatewayInput struct { - _ struct{} `type:"structure"` + // The ID of the instance. + InstanceId *string `locationName:"instanceId" 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"` + // Any tags assigned to the instance. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` // 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"` + VpcId *string `locationName:"vpcId" type:"string"` } // String returns the string representation -func (s AttachVpnGatewayInput) String() string { +func (s ClassicLinkInstance) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AttachVpnGatewayInput) GoString() string { +func (s ClassicLinkInstance) 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 +// SetGroups sets the Groups field's value. +func (s *ClassicLinkInstance) SetGroups(v []*GroupIdentifier) *ClassicLinkInstance { + s.Groups = v + return s } -// SetDryRun sets the DryRun field's value. -func (s *AttachVpnGatewayInput) SetDryRun(v bool) *AttachVpnGatewayInput { - s.DryRun = &v +// SetInstanceId sets the InstanceId field's value. +func (s *ClassicLinkInstance) SetInstanceId(v string) *ClassicLinkInstance { + s.InstanceId = &v return s } -// SetVpcId sets the VpcId field's value. -func (s *AttachVpnGatewayInput) SetVpcId(v string) *AttachVpnGatewayInput { - s.VpcId = &v +// SetTags sets the Tags field's value. +func (s *ClassicLinkInstance) SetTags(v []*Tag) *ClassicLinkInstance { + s.Tags = v return s } -// SetVpnGatewayId sets the VpnGatewayId field's value. -func (s *AttachVpnGatewayInput) SetVpnGatewayId(v string) *AttachVpnGatewayInput { - s.VpnGatewayId = &v +// SetVpcId sets the VpcId field's value. +func (s *ClassicLinkInstance) SetVpcId(v string) *ClassicLinkInstance { + s.VpcId = &v return s } -// Contains the output of AttachVpnGateway. -type AttachVpnGatewayOutput struct { +// Describes a Classic Load Balancer. +type ClassicLoadBalancer struct { _ struct{} `type:"structure"` - // Information about the attachment. - VpcAttachment *VpcAttachment `locationName:"attachment" type:"structure"` + // The name of the load balancer. + Name *string `locationName:"name" type:"string"` } // String returns the string representation -func (s AttachVpnGatewayOutput) String() string { +func (s ClassicLoadBalancer) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AttachVpnGatewayOutput) GoString() string { +func (s ClassicLoadBalancer) GoString() string { return s.String() } -// SetVpcAttachment sets the VpcAttachment field's value. -func (s *AttachVpnGatewayOutput) SetVpcAttachment(v *VpcAttachment) *AttachVpnGatewayOutput { - s.VpcAttachment = v +// SetName sets the Name field's value. +func (s *ClassicLoadBalancer) SetName(v string) *ClassicLoadBalancer { + s.Name = &v return s } -// Describes a value for a resource attribute that is a Boolean value. -type AttributeBooleanValue struct { +// Describes the Classic Load Balancers to attach to a Spot Fleet. Spot Fleet +// registers the running Spot Instances with these Classic Load Balancers. +type ClassicLoadBalancersConfig struct { _ struct{} `type:"structure"` - // The attribute value. The valid values are true or false. - Value *bool `locationName:"value" type:"boolean"` + // One or more Classic Load Balancers. + ClassicLoadBalancers []*ClassicLoadBalancer `locationName:"classicLoadBalancers" locationNameList:"item" min:"1" type:"list"` } // String returns the string representation -func (s AttributeBooleanValue) String() string { +func (s ClassicLoadBalancersConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AttributeBooleanValue) GoString() string { +func (s ClassicLoadBalancersConfig) GoString() string { return s.String() } -// SetValue sets the Value field's value. -func (s *AttributeBooleanValue) SetValue(v bool) *AttributeBooleanValue { - s.Value = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *ClassicLoadBalancersConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ClassicLoadBalancersConfig"} + if s.ClassicLoadBalancers != nil && len(s.ClassicLoadBalancers) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClassicLoadBalancers", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClassicLoadBalancers sets the ClassicLoadBalancers field's value. +func (s *ClassicLoadBalancersConfig) SetClassicLoadBalancers(v []*ClassicLoadBalancer) *ClassicLoadBalancersConfig { + s.ClassicLoadBalancers = v return s } -// Describes a value for a resource attribute that is a String. -type AttributeValue struct { +// Describes the state of a client certificate revocation list. +type ClientCertificateRevocationListStatus struct { _ struct{} `type:"structure"` - // The attribute value. The value is case-sensitive. - Value *string `locationName:"value" type:"string"` + // The state of the client certificate revocation list. + Code *string `locationName:"code" type:"string" enum:"ClientCertificateRevocationListStatusCode"` + + // A message about the status of the client certificate revocation list, if + // applicable. + Message *string `locationName:"message" type:"string"` } // String returns the string representation -func (s AttributeValue) String() string { +func (s ClientCertificateRevocationListStatus) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AttributeValue) GoString() string { +func (s ClientCertificateRevocationListStatus) GoString() string { return s.String() } -// SetValue sets the Value field's value. -func (s *AttributeValue) SetValue(v string) *AttributeValue { - s.Value = &v +// SetCode sets the Code field's value. +func (s *ClientCertificateRevocationListStatus) SetCode(v string) *ClientCertificateRevocationListStatus { + s.Code = &v return s } -// Information about an authorization rule. -type AuthorizationRule struct { - _ struct{} `type:"structure"` - - // Indicates whether the authorization rule grants access to all clients. - AccessAll *bool `locationName:"accessAll" type:"boolean"` +// SetMessage sets the Message field's value. +func (s *ClientCertificateRevocationListStatus) SetMessage(v string) *ClientCertificateRevocationListStatus { + s.Message = &v + return s +} - // The ID of the Client VPN endpoint with which the authorization rule is associated. - ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"` +// Describes the client-specific data. +type ClientData struct { + _ struct{} `type:"structure"` - // A brief description of the authorization rule. - Description *string `locationName:"description" type:"string"` + // A user-defined comment about the disk upload. + Comment *string `type:"string"` - // The IPv4 address range, in CIDR notation, of the network to which the authorization - // rule applies. - DestinationCidr *string `locationName:"destinationCidr" type:"string"` + // The time that the disk upload ends. + UploadEnd *time.Time `type:"timestamp"` - // The ID of the Active Directory group to which the authorization rule grants - // access. - GroupId *string `locationName:"groupId" type:"string"` + // The size of the uploaded disk image, in GiB. + UploadSize *float64 `type:"double"` - // The current state of the authorization rule. - Status *ClientVpnAuthorizationRuleStatus `locationName:"status" type:"structure"` + // The time that the disk upload starts. + UploadStart *time.Time `type:"timestamp"` } // String returns the string representation -func (s AuthorizationRule) String() string { +func (s ClientData) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AuthorizationRule) GoString() string { +func (s ClientData) GoString() string { return s.String() } -// SetAccessAll sets the AccessAll field's value. -func (s *AuthorizationRule) SetAccessAll(v bool) *AuthorizationRule { - s.AccessAll = &v - return s -} - -// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. -func (s *AuthorizationRule) SetClientVpnEndpointId(v string) *AuthorizationRule { - s.ClientVpnEndpointId = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *AuthorizationRule) SetDescription(v string) *AuthorizationRule { - s.Description = &v +// SetComment sets the Comment field's value. +func (s *ClientData) SetComment(v string) *ClientData { + s.Comment = &v return s } -// SetDestinationCidr sets the DestinationCidr field's value. -func (s *AuthorizationRule) SetDestinationCidr(v string) *AuthorizationRule { - s.DestinationCidr = &v +// SetUploadEnd sets the UploadEnd field's value. +func (s *ClientData) SetUploadEnd(v time.Time) *ClientData { + s.UploadEnd = &v return s } -// SetGroupId sets the GroupId field's value. -func (s *AuthorizationRule) SetGroupId(v string) *AuthorizationRule { - s.GroupId = &v +// SetUploadSize sets the UploadSize field's value. +func (s *ClientData) SetUploadSize(v float64) *ClientData { + s.UploadSize = &v return s } -// SetStatus sets the Status field's value. -func (s *AuthorizationRule) SetStatus(v *ClientVpnAuthorizationRuleStatus) *AuthorizationRule { - s.Status = v +// SetUploadStart sets the UploadStart field's value. +func (s *ClientData) SetUploadStart(v time.Time) *ClientData { + s.UploadStart = &v return s } -type AuthorizeClientVpnIngressInput struct { +// Describes the authentication methods used by a Client VPN endpoint. Client +// VPN supports Active Directory and mutual authentication. For more information, +// see Authentication (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/authentication-authrization.html#client-authentication) +// in the AWS Client VPN Administrator Guide. +type ClientVpnAuthentication struct { _ struct{} `type:"structure"` - // The ID of the Active Directory group to grant access. - AccessGroupId *string `type:"string"` - - // Indicates whether to grant access to all clients. Use true to grant all clients - // who successfully establish a VPN connection access to the network. - AuthorizeAllGroups *bool `type:"boolean"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string" idempotencyToken:"true"` - - // The ID of the Client VPN endpoint. - // - // ClientVpnEndpointId is a required field - ClientVpnEndpointId *string `type:"string" required:"true"` - - // A brief description of the authorization rule. - Description *string `type:"string"` + // Information about the Active Directory, if applicable. + ActiveDirectory *DirectoryServiceAuthentication `locationName:"activeDirectory" 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"` + // Information about the authentication certificates, if applicable. + MutualAuthentication *CertificateAuthentication `locationName:"mutualAuthentication" type:"structure"` - // The IPv4 address range, in CIDR notation, of the network for which access - // is being authorized. - // - // TargetNetworkCidr is a required field - TargetNetworkCidr *string `type:"string" required:"true"` + // The authentication type used. + Type *string `locationName:"type" type:"string" enum:"ClientVpnAuthenticationType"` } // String returns the string representation -func (s AuthorizeClientVpnIngressInput) String() string { +func (s ClientVpnAuthentication) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AuthorizeClientVpnIngressInput) GoString() string { +func (s ClientVpnAuthentication) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AuthorizeClientVpnIngressInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AuthorizeClientVpnIngressInput"} - if s.ClientVpnEndpointId == nil { - invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) - } - if s.TargetNetworkCidr == nil { - invalidParams.Add(request.NewErrParamRequired("TargetNetworkCidr")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetActiveDirectory sets the ActiveDirectory field's value. +func (s *ClientVpnAuthentication) SetActiveDirectory(v *DirectoryServiceAuthentication) *ClientVpnAuthentication { + s.ActiveDirectory = v + return s } -// SetAccessGroupId sets the AccessGroupId field's value. -func (s *AuthorizeClientVpnIngressInput) SetAccessGroupId(v string) *AuthorizeClientVpnIngressInput { - s.AccessGroupId = &v +// SetMutualAuthentication sets the MutualAuthentication field's value. +func (s *ClientVpnAuthentication) SetMutualAuthentication(v *CertificateAuthentication) *ClientVpnAuthentication { + s.MutualAuthentication = v return s } -// SetAuthorizeAllGroups sets the AuthorizeAllGroups field's value. -func (s *AuthorizeClientVpnIngressInput) SetAuthorizeAllGroups(v bool) *AuthorizeClientVpnIngressInput { - s.AuthorizeAllGroups = &v +// SetType sets the Type field's value. +func (s *ClientVpnAuthentication) SetType(v string) *ClientVpnAuthentication { + s.Type = &v return s } -// SetClientToken sets the ClientToken field's value. -func (s *AuthorizeClientVpnIngressInput) SetClientToken(v string) *AuthorizeClientVpnIngressInput { - s.ClientToken = &v - return s +// Describes the authentication method to be used by a Client VPN endpoint. +// Client VPN supports Active Directory and mutual authentication. For more +// information, see Authentication (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/authentication-authrization.html#client-authentication) +// in the AWS Client VPN Administrator Guide. +type ClientVpnAuthenticationRequest struct { + _ struct{} `type:"structure"` + + // Information about the Active Directory to be used, if applicable. You must + // provide this information if Type is directory-service-authentication. + ActiveDirectory *DirectoryServiceAuthenticationRequest `type:"structure"` + + // Information about the authentication certificates to be used, if applicable. + // You must provide this information if Type is certificate-authentication. + MutualAuthentication *CertificateAuthenticationRequest `type:"structure"` + + // The type of client authentication to be used. Specify certificate-authentication + // to use certificate-based authentication, or directory-service-authentication + // to use Active Directory authentication. + Type *string `type:"string" enum:"ClientVpnAuthenticationType"` } -// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. -func (s *AuthorizeClientVpnIngressInput) SetClientVpnEndpointId(v string) *AuthorizeClientVpnIngressInput { - s.ClientVpnEndpointId = &v - return s +// String returns the string representation +func (s ClientVpnAuthenticationRequest) String() string { + return awsutil.Prettify(s) } -// SetDescription sets the Description field's value. -func (s *AuthorizeClientVpnIngressInput) SetDescription(v string) *AuthorizeClientVpnIngressInput { - s.Description = &v +// GoString returns the string representation +func (s ClientVpnAuthenticationRequest) GoString() string { + return s.String() +} + +// SetActiveDirectory sets the ActiveDirectory field's value. +func (s *ClientVpnAuthenticationRequest) SetActiveDirectory(v *DirectoryServiceAuthenticationRequest) *ClientVpnAuthenticationRequest { + s.ActiveDirectory = v return s } -// SetDryRun sets the DryRun field's value. -func (s *AuthorizeClientVpnIngressInput) SetDryRun(v bool) *AuthorizeClientVpnIngressInput { - s.DryRun = &v +// SetMutualAuthentication sets the MutualAuthentication field's value. +func (s *ClientVpnAuthenticationRequest) SetMutualAuthentication(v *CertificateAuthenticationRequest) *ClientVpnAuthenticationRequest { + s.MutualAuthentication = v return s } -// SetTargetNetworkCidr sets the TargetNetworkCidr field's value. -func (s *AuthorizeClientVpnIngressInput) SetTargetNetworkCidr(v string) *AuthorizeClientVpnIngressInput { - s.TargetNetworkCidr = &v +// SetType sets the Type field's value. +func (s *ClientVpnAuthenticationRequest) SetType(v string) *ClientVpnAuthenticationRequest { + s.Type = &v return s } -type AuthorizeClientVpnIngressOutput struct { +// Describes the state of an authorization rule. +type ClientVpnAuthorizationRuleStatus struct { _ struct{} `type:"structure"` - // The current state of the authorization rule. - Status *ClientVpnAuthorizationRuleStatus `locationName:"status" type:"structure"` + // The state of the authorization rule. + Code *string `locationName:"code" type:"string" enum:"ClientVpnAuthorizationRuleStatusCode"` + + // A message about the status of the authorization rule, if applicable. + Message *string `locationName:"message" type:"string"` } // String returns the string representation -func (s AuthorizeClientVpnIngressOutput) String() string { +func (s ClientVpnAuthorizationRuleStatus) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AuthorizeClientVpnIngressOutput) GoString() string { +func (s ClientVpnAuthorizationRuleStatus) GoString() string { return s.String() } -// SetStatus sets the Status field's value. -func (s *AuthorizeClientVpnIngressOutput) SetStatus(v *ClientVpnAuthorizationRuleStatus) *AuthorizeClientVpnIngressOutput { - s.Status = v - return s -} +// SetCode sets the Code field's value. +func (s *ClientVpnAuthorizationRuleStatus) SetCode(v string) *ClientVpnAuthorizationRuleStatus { + s.Code = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *ClientVpnAuthorizationRuleStatus) SetMessage(v string) *ClientVpnAuthorizationRuleStatus { + s.Message = &v + return s +} + +// Describes a client connection. +type ClientVpnConnection struct { + _ struct{} `type:"structure"` + + // The IP address of the client. + ClientIp *string `locationName:"clientIp" type:"string"` + + // The ID of the Client VPN endpoint to which the client is connected. + ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"` + + // The common name associated with the client. This is either the name of the + // client certificate, or the Active Directory user name. + CommonName *string `locationName:"commonName" type:"string"` -type AuthorizeSecurityGroupEgressInput struct { - _ struct{} `type:"structure"` + // The date and time the client connection was terminated. + ConnectionEndTime *string `locationName:"connectionEndTime" type:"string"` - // Not supported. Use a set of IP permissions to specify the CIDR. - CidrIp *string `locationName:"cidrIp" type:"string"` + // The date and time the client connection was established. + ConnectionEstablishedTime *string `locationName:"connectionEstablishedTime" 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 client connection. + ConnectionId *string `locationName:"connectionId" type:"string"` - // Not supported. Use a set of IP permissions to specify the port. - FromPort *int64 `locationName:"fromPort" type:"integer"` + // The number of bytes received by the client. + EgressBytes *string `locationName:"egressBytes" type:"string"` - // The ID of the security group. - // - // GroupId is a required field - GroupId *string `locationName:"groupId" type:"string" required:"true"` + // The number of packets received by the client. + EgressPackets *string `locationName:"egressPackets" type:"string"` - // The sets of IP permissions. You can't specify a destination security group - // and a CIDR IP address range in the same set of permissions. - IpPermissions []*IpPermission `locationName:"ipPermissions" locationNameList:"item" type:"list"` + // The number of bytes sent by the client. + IngressBytes *string `locationName:"ingressBytes" type:"string"` - // Not supported. Use a set of IP permissions to specify the protocol name or - // number. - IpProtocol *string `locationName:"ipProtocol" type:"string"` + // The number of packets sent by the client. + IngressPackets *string `locationName:"ingressPackets" type:"string"` - // Not supported. Use a set of IP permissions to specify a destination security - // group. - SourceSecurityGroupName *string `locationName:"sourceSecurityGroupName" type:"string"` + // The current state of the client connection. + Status *ClientVpnConnectionStatus `locationName:"status" type:"structure"` - // Not supported. Use a set of IP permissions to specify a destination security - // group. - SourceSecurityGroupOwnerId *string `locationName:"sourceSecurityGroupOwnerId" type:"string"` + // The current date and time. + Timestamp *string `locationName:"timestamp" type:"string"` - // Not supported. Use a set of IP permissions to specify the port. - ToPort *int64 `locationName:"toPort" type:"integer"` + // The username of the client who established the client connection. This information + // is only provided if Active Directory client authentication is used. + Username *string `locationName:"username" type:"string"` } // String returns the string representation -func (s AuthorizeSecurityGroupEgressInput) String() string { +func (s ClientVpnConnection) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AuthorizeSecurityGroupEgressInput) GoString() string { +func (s ClientVpnConnection) 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")) - } +// SetClientIp sets the ClientIp field's value. +func (s *ClientVpnConnection) SetClientIp(v string) *ClientVpnConnection { + s.ClientIp = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. +func (s *ClientVpnConnection) SetClientVpnEndpointId(v string) *ClientVpnConnection { + s.ClientVpnEndpointId = &v + return s } -// SetCidrIp sets the CidrIp field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetCidrIp(v string) *AuthorizeSecurityGroupEgressInput { - s.CidrIp = &v +// SetCommonName sets the CommonName field's value. +func (s *ClientVpnConnection) SetCommonName(v string) *ClientVpnConnection { + s.CommonName = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetDryRun(v bool) *AuthorizeSecurityGroupEgressInput { - s.DryRun = &v +// SetConnectionEndTime sets the ConnectionEndTime field's value. +func (s *ClientVpnConnection) SetConnectionEndTime(v string) *ClientVpnConnection { + s.ConnectionEndTime = &v return s } -// SetFromPort sets the FromPort field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetFromPort(v int64) *AuthorizeSecurityGroupEgressInput { - s.FromPort = &v +// SetConnectionEstablishedTime sets the ConnectionEstablishedTime field's value. +func (s *ClientVpnConnection) SetConnectionEstablishedTime(v string) *ClientVpnConnection { + s.ConnectionEstablishedTime = &v return s } -// SetGroupId sets the GroupId field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetGroupId(v string) *AuthorizeSecurityGroupEgressInput { - s.GroupId = &v +// SetConnectionId sets the ConnectionId field's value. +func (s *ClientVpnConnection) SetConnectionId(v string) *ClientVpnConnection { + s.ConnectionId = &v return s } -// SetIpPermissions sets the IpPermissions field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetIpPermissions(v []*IpPermission) *AuthorizeSecurityGroupEgressInput { - s.IpPermissions = v +// SetEgressBytes sets the EgressBytes field's value. +func (s *ClientVpnConnection) SetEgressBytes(v string) *ClientVpnConnection { + s.EgressBytes = &v return s } -// SetIpProtocol sets the IpProtocol field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetIpProtocol(v string) *AuthorizeSecurityGroupEgressInput { - s.IpProtocol = &v +// SetEgressPackets sets the EgressPackets field's value. +func (s *ClientVpnConnection) SetEgressPackets(v string) *ClientVpnConnection { + s.EgressPackets = &v return s } -// SetSourceSecurityGroupName sets the SourceSecurityGroupName field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetSourceSecurityGroupName(v string) *AuthorizeSecurityGroupEgressInput { - s.SourceSecurityGroupName = &v +// SetIngressBytes sets the IngressBytes field's value. +func (s *ClientVpnConnection) SetIngressBytes(v string) *ClientVpnConnection { + s.IngressBytes = &v return s } -// SetSourceSecurityGroupOwnerId sets the SourceSecurityGroupOwnerId field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetSourceSecurityGroupOwnerId(v string) *AuthorizeSecurityGroupEgressInput { - s.SourceSecurityGroupOwnerId = &v +// SetIngressPackets sets the IngressPackets field's value. +func (s *ClientVpnConnection) SetIngressPackets(v string) *ClientVpnConnection { + s.IngressPackets = &v return s } -// SetToPort sets the ToPort field's value. -func (s *AuthorizeSecurityGroupEgressInput) SetToPort(v int64) *AuthorizeSecurityGroupEgressInput { - s.ToPort = &v +// SetStatus sets the Status field's value. +func (s *ClientVpnConnection) SetStatus(v *ClientVpnConnectionStatus) *ClientVpnConnection { + s.Status = v return s } -type AuthorizeSecurityGroupEgressOutput struct { +// SetTimestamp sets the Timestamp field's value. +func (s *ClientVpnConnection) SetTimestamp(v string) *ClientVpnConnection { + s.Timestamp = &v + return s +} + +// SetUsername sets the Username field's value. +func (s *ClientVpnConnection) SetUsername(v string) *ClientVpnConnection { + s.Username = &v + return s +} + +// Describes the status of a client connection. +type ClientVpnConnectionStatus struct { _ struct{} `type:"structure"` + + // The state of the client connection. + Code *string `locationName:"code" type:"string" enum:"ClientVpnConnectionStatusCode"` + + // A message about the status of the client connection, if applicable. + Message *string `locationName:"message" type:"string"` } // String returns the string representation -func (s AuthorizeSecurityGroupEgressOutput) String() string { +func (s ClientVpnConnectionStatus) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AuthorizeSecurityGroupEgressOutput) GoString() string { +func (s ClientVpnConnectionStatus) GoString() string { return s.String() } -type AuthorizeSecurityGroupIngressInput struct { +// SetCode sets the Code field's value. +func (s *ClientVpnConnectionStatus) SetCode(v string) *ClientVpnConnectionStatus { + s.Code = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *ClientVpnConnectionStatus) SetMessage(v string) *ClientVpnConnectionStatus { + s.Message = &v + return s +} + +// Describes a Client VPN endpoint. +type ClientVpnEndpoint struct { _ struct{} `type:"structure"` - // The IPv4 address range, in CIDR format. You can't specify this parameter - // when specifying a source security group. To specify an IPv6 address range, - // use a set of IP permissions. + // Information about the associated target networks. A target network is a subnet + // in a VPC. // - // Alternatively, use a set of IP permissions to specify multiple rules and - // a description for the rule. - CidrIp *string `type:"string"` + // Deprecated: This property is deprecated. To view the target networks associated with a Client VPN endpoint, call DescribeClientVpnTargetNetworks and inspect the clientVpnTargetNetworks response element. + AssociatedTargetNetworks []*AssociatedTargetNetwork `locationName:"associatedTargetNetwork" locationNameList:"item" deprecated:"true" 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"` + // Information about the authentication method used by the Client VPN endpoint. + AuthenticationOptions []*ClientVpnAuthentication `locationName:"authenticationOptions" locationNameList:"item" type:"list"` - // 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 types. If you specify all - // ICMP types, you must specify all codes. - // - // Alternatively, use a set of IP permissions to specify multiple rules and - // a description for the rule. - FromPort *int64 `type:"integer"` + // The IPv4 address range, in CIDR notation, from which client IP addresses + // are assigned. + ClientCidrBlock *string `locationName:"clientCidrBlock" type:"string"` - // The ID of the security group. You must specify either the security group - // ID or the security group name in the request. For security groups in a nondefault - // VPC, you must specify the security group ID. - GroupId *string `type:"string"` + // The ID of the Client VPN endpoint. + ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"` - // [EC2-Classic, default VPC] The name of the security group. You must specify - // either the security group ID or the security group name in the request. - GroupName *string `type:"string"` + // Information about the client connection logging options for the Client VPN + // endpoint. + ConnectionLogOptions *ConnectionLogResponseOptions `locationName:"connectionLogOptions" type:"structure"` - // The sets of IP permissions. - IpPermissions []*IpPermission `locationNameList:"item" type:"list"` + // The date and time the Client VPN endpoint was created. + CreationTime *string `locationName:"creationTime" type:"string"` - // The IP protocol name (tcp, udp, icmp) or number (see Protocol Numbers (http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml)). - // To specify icmpv6, use a set of IP permissions. - // - // [VPC only] Use -1 to specify all protocols. If you specify -1 or a protocol - // other than tcp, udp, or icmp, traffic on all ports is allowed, regardless - // of any ports you specify. - // - // Alternatively, use a set of IP permissions to specify multiple rules and - // a description for the rule. - IpProtocol *string `type:"string"` + // The date and time the Client VPN endpoint was deleted, if applicable. + DeletionTime *string `locationName:"deletionTime" 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"` + // A brief description of the endpoint. + Description *string `locationName:"description" type:"string"` - // [nondefault VPC] The AWS account ID 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 DNS name to be used by clients when connecting to the Client VPN endpoint. + DnsName *string `locationName:"dnsName" 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 codes. If you specify all - // ICMP types, you must specify all codes. + // Information about the DNS servers to be used for DNS resolution. + DnsServers []*string `locationName:"dnsServer" locationNameList:"item" type:"list"` + + // The ARN of the server certificate. + ServerCertificateArn *string `locationName:"serverCertificateArn" type:"string"` + + // Indicates whether split-tunnel is enabled in the AWS Client VPN endpoint. // - // Alternatively, use a set of IP permissions to specify multiple rules and - // a description for the rule. - ToPort *int64 `type:"integer"` + // For information about split-tunnel VPN endpoints, see Split-Tunnel AWS Client + // VPN Endpoint (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/split-tunnel-vpn.html) + // in the AWS Client VPN Administrator Guide. + SplitTunnel *bool `locationName:"splitTunnel" type:"boolean"` + + // The current state of the Client VPN endpoint. + Status *ClientVpnEndpointStatus `locationName:"status" type:"structure"` + + // Any tags assigned to the Client VPN endpoint. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The transport protocol used by the Client VPN endpoint. + TransportProtocol *string `locationName:"transportProtocol" type:"string" enum:"TransportProtocol"` + + // The port number for the Client VPN endpoint. + VpnPort *int64 `locationName:"vpnPort" type:"integer"` + + // The protocol used by the VPN session. + VpnProtocol *string `locationName:"vpnProtocol" type:"string" enum:"VpnProtocol"` } // String returns the string representation -func (s AuthorizeSecurityGroupIngressInput) String() string { +func (s ClientVpnEndpoint) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AuthorizeSecurityGroupIngressInput) GoString() string { +func (s ClientVpnEndpoint) GoString() string { return s.String() } -// SetCidrIp sets the CidrIp field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetCidrIp(v string) *AuthorizeSecurityGroupIngressInput { - s.CidrIp = &v +// SetAssociatedTargetNetworks sets the AssociatedTargetNetworks field's value. +func (s *ClientVpnEndpoint) SetAssociatedTargetNetworks(v []*AssociatedTargetNetwork) *ClientVpnEndpoint { + s.AssociatedTargetNetworks = v return s } -// SetDryRun sets the DryRun field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetDryRun(v bool) *AuthorizeSecurityGroupIngressInput { - s.DryRun = &v +// SetAuthenticationOptions sets the AuthenticationOptions field's value. +func (s *ClientVpnEndpoint) SetAuthenticationOptions(v []*ClientVpnAuthentication) *ClientVpnEndpoint { + s.AuthenticationOptions = v return s } -// SetFromPort sets the FromPort field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetFromPort(v int64) *AuthorizeSecurityGroupIngressInput { - s.FromPort = &v +// SetClientCidrBlock sets the ClientCidrBlock field's value. +func (s *ClientVpnEndpoint) SetClientCidrBlock(v string) *ClientVpnEndpoint { + s.ClientCidrBlock = &v return s } -// SetGroupId sets the GroupId field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetGroupId(v string) *AuthorizeSecurityGroupIngressInput { - s.GroupId = &v +// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. +func (s *ClientVpnEndpoint) SetClientVpnEndpointId(v string) *ClientVpnEndpoint { + s.ClientVpnEndpointId = &v return s } -// SetGroupName sets the GroupName field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetGroupName(v string) *AuthorizeSecurityGroupIngressInput { - s.GroupName = &v +// SetConnectionLogOptions sets the ConnectionLogOptions field's value. +func (s *ClientVpnEndpoint) SetConnectionLogOptions(v *ConnectionLogResponseOptions) *ClientVpnEndpoint { + s.ConnectionLogOptions = v return s } -// SetIpPermissions sets the IpPermissions field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetIpPermissions(v []*IpPermission) *AuthorizeSecurityGroupIngressInput { - s.IpPermissions = v +// SetCreationTime sets the CreationTime field's value. +func (s *ClientVpnEndpoint) SetCreationTime(v string) *ClientVpnEndpoint { + s.CreationTime = &v return s } -// SetIpProtocol sets the IpProtocol field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetIpProtocol(v string) *AuthorizeSecurityGroupIngressInput { - s.IpProtocol = &v +// SetDeletionTime sets the DeletionTime field's value. +func (s *ClientVpnEndpoint) SetDeletionTime(v string) *ClientVpnEndpoint { + s.DeletionTime = &v return s } -// SetSourceSecurityGroupName sets the SourceSecurityGroupName field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetSourceSecurityGroupName(v string) *AuthorizeSecurityGroupIngressInput { - s.SourceSecurityGroupName = &v +// SetDescription sets the Description field's value. +func (s *ClientVpnEndpoint) SetDescription(v string) *ClientVpnEndpoint { + s.Description = &v return s } -// SetSourceSecurityGroupOwnerId sets the SourceSecurityGroupOwnerId field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetSourceSecurityGroupOwnerId(v string) *AuthorizeSecurityGroupIngressInput { - s.SourceSecurityGroupOwnerId = &v +// SetDnsName sets the DnsName field's value. +func (s *ClientVpnEndpoint) SetDnsName(v string) *ClientVpnEndpoint { + s.DnsName = &v return s } -// SetToPort sets the ToPort field's value. -func (s *AuthorizeSecurityGroupIngressInput) SetToPort(v int64) *AuthorizeSecurityGroupIngressInput { - s.ToPort = &v +// SetDnsServers sets the DnsServers field's value. +func (s *ClientVpnEndpoint) SetDnsServers(v []*string) *ClientVpnEndpoint { + s.DnsServers = v return s } -type AuthorizeSecurityGroupIngressOutput struct { +// SetServerCertificateArn sets the ServerCertificateArn field's value. +func (s *ClientVpnEndpoint) SetServerCertificateArn(v string) *ClientVpnEndpoint { + s.ServerCertificateArn = &v + return s +} + +// SetSplitTunnel sets the SplitTunnel field's value. +func (s *ClientVpnEndpoint) SetSplitTunnel(v bool) *ClientVpnEndpoint { + s.SplitTunnel = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ClientVpnEndpoint) SetStatus(v *ClientVpnEndpointStatus) *ClientVpnEndpoint { + s.Status = v + return s +} + +// SetTags sets the Tags field's value. +func (s *ClientVpnEndpoint) SetTags(v []*Tag) *ClientVpnEndpoint { + s.Tags = v + return s +} + +// SetTransportProtocol sets the TransportProtocol field's value. +func (s *ClientVpnEndpoint) SetTransportProtocol(v string) *ClientVpnEndpoint { + s.TransportProtocol = &v + return s +} + +// SetVpnPort sets the VpnPort field's value. +func (s *ClientVpnEndpoint) SetVpnPort(v int64) *ClientVpnEndpoint { + s.VpnPort = &v + return s +} + +// SetVpnProtocol sets the VpnProtocol field's value. +func (s *ClientVpnEndpoint) SetVpnProtocol(v string) *ClientVpnEndpoint { + s.VpnProtocol = &v + return s +} + +// Describes the state of a Client VPN endpoint. +type ClientVpnEndpointStatus struct { _ struct{} `type:"structure"` + + // The state of the Client VPN endpoint. Possible states include: + // + // * pending-associate - The Client VPN endpoint has been created but no + // target networks have been associated. The Client VPN endpoint cannot accept + // connections. + // + // * available - The Client VPN endpoint has been created and a target network + // has been associated. The Client VPN endpoint can accept connections. + // + // * deleting - The Client VPN endpoint is being deleted. The Client VPN + // endpoint cannot accept connections. + // + // * deleted - The Client VPN endpoint has been deleted. The Client VPN endpoint + // cannot accept connections. + Code *string `locationName:"code" type:"string" enum:"ClientVpnEndpointStatusCode"` + + // A message about the status of the Client VPN endpoint. + Message *string `locationName:"message" type:"string"` } // String returns the string representation -func (s AuthorizeSecurityGroupIngressOutput) String() string { +func (s ClientVpnEndpointStatus) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AuthorizeSecurityGroupIngressOutput) GoString() string { +func (s ClientVpnEndpointStatus) GoString() string { return s.String() } -// Describes an Availability Zone. -type AvailabilityZone struct { +// SetCode sets the Code field's value. +func (s *ClientVpnEndpointStatus) SetCode(v string) *ClientVpnEndpointStatus { + s.Code = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *ClientVpnEndpointStatus) SetMessage(v string) *ClientVpnEndpointStatus { + s.Message = &v + return s +} + +// Information about a Client VPN endpoint route. +type ClientVpnRoute struct { _ struct{} `type:"structure"` - // Any messages about the Availability Zone. - Messages []*AvailabilityZoneMessage `locationName:"messageSet" locationNameList:"item" type:"list"` + // The ID of the Client VPN endpoint with which the route is associated. + ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"` - // The name of the Region. - RegionName *string `locationName:"regionName" type:"string"` + // A brief description of the route. + Description *string `locationName:"description" type:"string"` - // The state of the Availability Zone. - State *string `locationName:"zoneState" type:"string" enum:"AvailabilityZoneState"` + // The IPv4 address range, in CIDR notation, of the route destination. + DestinationCidr *string `locationName:"destinationCidr" type:"string"` - // The ID of the Availability Zone. - ZoneId *string `locationName:"zoneId" type:"string"` + // Indicates how the route was associated with the Client VPN endpoint. associate + // indicates that the route was automatically added when the target network + // was associated with the Client VPN endpoint. add-route indicates that the + // route was manually added using the CreateClientVpnRoute action. + Origin *string `locationName:"origin" type:"string"` - // The name of the Availability Zone. - ZoneName *string `locationName:"zoneName" type:"string"` + // The current state of the route. + Status *ClientVpnRouteStatus `locationName:"status" type:"structure"` + + // The ID of the subnet through which traffic is routed. + TargetSubnet *string `locationName:"targetSubnet" type:"string"` + + // The route type. + Type *string `locationName:"type" type:"string"` } // String returns the string representation -func (s AvailabilityZone) String() string { +func (s ClientVpnRoute) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AvailabilityZone) GoString() string { +func (s ClientVpnRoute) GoString() string { return s.String() } -// SetMessages sets the Messages field's value. -func (s *AvailabilityZone) SetMessages(v []*AvailabilityZoneMessage) *AvailabilityZone { - s.Messages = v +// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. +func (s *ClientVpnRoute) SetClientVpnEndpointId(v string) *ClientVpnRoute { + s.ClientVpnEndpointId = &v return s } -// SetRegionName sets the RegionName field's value. -func (s *AvailabilityZone) SetRegionName(v string) *AvailabilityZone { - s.RegionName = &v +// SetDescription sets the Description field's value. +func (s *ClientVpnRoute) SetDescription(v string) *ClientVpnRoute { + s.Description = &v return s } -// SetState sets the State field's value. -func (s *AvailabilityZone) SetState(v string) *AvailabilityZone { - s.State = &v +// SetDestinationCidr sets the DestinationCidr field's value. +func (s *ClientVpnRoute) SetDestinationCidr(v string) *ClientVpnRoute { + s.DestinationCidr = &v return s } -// SetZoneId sets the ZoneId field's value. -func (s *AvailabilityZone) SetZoneId(v string) *AvailabilityZone { - s.ZoneId = &v +// SetOrigin sets the Origin field's value. +func (s *ClientVpnRoute) SetOrigin(v string) *ClientVpnRoute { + s.Origin = &v return s } -// SetZoneName sets the ZoneName field's value. -func (s *AvailabilityZone) SetZoneName(v string) *AvailabilityZone { - s.ZoneName = &v +// SetStatus sets the Status field's value. +func (s *ClientVpnRoute) SetStatus(v *ClientVpnRouteStatus) *ClientVpnRoute { + s.Status = v return s } -// Describes a message about an Availability Zone. -type AvailabilityZoneMessage struct { +// SetTargetSubnet sets the TargetSubnet field's value. +func (s *ClientVpnRoute) SetTargetSubnet(v string) *ClientVpnRoute { + s.TargetSubnet = &v + return s +} + +// SetType sets the Type field's value. +func (s *ClientVpnRoute) SetType(v string) *ClientVpnRoute { + s.Type = &v + return s +} + +// Describes the state of a Client VPN endpoint route. +type ClientVpnRouteStatus struct { _ struct{} `type:"structure"` - // The message about the Availability Zone. + // The state of the Client VPN endpoint route. + Code *string `locationName:"code" type:"string" enum:"ClientVpnRouteStatusCode"` + + // A message about the status of the Client VPN endpoint route, if applicable. Message *string `locationName:"message" type:"string"` } // String returns the string representation -func (s AvailabilityZoneMessage) String() string { +func (s ClientVpnRouteStatus) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AvailabilityZoneMessage) GoString() string { +func (s ClientVpnRouteStatus) GoString() string { return s.String() } +// SetCode sets the Code field's value. +func (s *ClientVpnRouteStatus) SetCode(v string) *ClientVpnRouteStatus { + s.Code = &v + return s +} + // SetMessage sets the Message field's value. -func (s *AvailabilityZoneMessage) SetMessage(v string) *AvailabilityZoneMessage { +func (s *ClientVpnRouteStatus) SetMessage(v string) *ClientVpnRouteStatus { s.Message = &v return s } -// The capacity information for instances launched onto the Dedicated Host. -type AvailableCapacity struct { +// Describes address usage for a customer-owned address pool. +type CoipAddressUsage struct { _ struct{} `type:"structure"` - // The total number of instances supported by the Dedicated Host. - AvailableInstanceCapacity []*InstanceCapacity `locationName:"availableInstanceCapacity" locationNameList:"item" type:"list"` + // The allocation ID of the address. + AllocationId *string `locationName:"allocationId" type:"string"` - // The number of vCPUs available on the Dedicated Host. - AvailableVCpus *int64 `locationName:"availableVCpus" type:"integer"` + // The AWS account ID. + AwsAccountId *string `locationName:"awsAccountId" type:"string"` + + // The AWS service. + AwsService *string `locationName:"awsService" type:"string"` + + // The customer-owned IP address. + CoIp *string `locationName:"coIp" type:"string"` } // String returns the string representation -func (s AvailableCapacity) String() string { +func (s CoipAddressUsage) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AvailableCapacity) GoString() string { +func (s CoipAddressUsage) GoString() string { return s.String() } -// SetAvailableInstanceCapacity sets the AvailableInstanceCapacity field's value. -func (s *AvailableCapacity) SetAvailableInstanceCapacity(v []*InstanceCapacity) *AvailableCapacity { - s.AvailableInstanceCapacity = v +// SetAllocationId sets the AllocationId field's value. +func (s *CoipAddressUsage) SetAllocationId(v string) *CoipAddressUsage { + s.AllocationId = &v return s } -// SetAvailableVCpus sets the AvailableVCpus field's value. -func (s *AvailableCapacity) SetAvailableVCpus(v int64) *AvailableCapacity { - s.AvailableVCpus = &v +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *CoipAddressUsage) SetAwsAccountId(v string) *CoipAddressUsage { + s.AwsAccountId = &v return s } -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() +// SetAwsService sets the AwsService field's value. +func (s *CoipAddressUsage) SetAwsService(v string) *CoipAddressUsage { + s.AwsService = &v + return s } -// SetValue sets the Value field's value. -func (s *BlobAttributeValue) SetValue(v []byte) *BlobAttributeValue { - s.Value = v +// SetCoIp sets the CoIp field's value. +func (s *CoipAddressUsage) SetCoIp(v string) *CoipAddressUsage { + s.CoIp = &v return s } -// Describes a block device mapping. -type BlockDeviceMapping struct { +// Describes a customer-owned address pool. +type CoipPool struct { _ struct{} `type:"structure"` - // The device name (for example, /dev/sdh or xvdh). - DeviceName *string `locationName:"deviceName" type:"string"` + // The ID of the local gateway route table. + LocalGatewayRouteTableId *string `locationName:"localGatewayRouteTableId" type:"string"` - // Parameters used to automatically set up EBS volumes when the instance is - // launched. - Ebs *EbsBlockDevice `locationName:"ebs" type:"structure"` + // The address ranges of the address pool. + PoolCidrs []*string `locationName:"poolCidrSet" locationNameList:"item" type:"list"` - // Suppresses the specified device included in the block device mapping of the - // AMI. - NoDevice *string `locationName:"noDevice" type:"string"` + // The ID of the address pool. + PoolId *string `locationName:"poolId" 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. - // - // NVMe instance store volumes are automatically enumerated and assigned a device - // name. Including them in your block device mapping has no effect. - // - // 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"` + // The tags. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s BlockDeviceMapping) String() string { +func (s CoipPool) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BlockDeviceMapping) GoString() string { +func (s CoipPool) GoString() string { return s.String() } -// SetDeviceName sets the DeviceName field's value. -func (s *BlockDeviceMapping) SetDeviceName(v string) *BlockDeviceMapping { - s.DeviceName = &v +// SetLocalGatewayRouteTableId sets the LocalGatewayRouteTableId field's value. +func (s *CoipPool) SetLocalGatewayRouteTableId(v string) *CoipPool { + s.LocalGatewayRouteTableId = &v return s } -// SetEbs sets the Ebs field's value. -func (s *BlockDeviceMapping) SetEbs(v *EbsBlockDevice) *BlockDeviceMapping { - s.Ebs = v +// SetPoolCidrs sets the PoolCidrs field's value. +func (s *CoipPool) SetPoolCidrs(v []*string) *CoipPool { + s.PoolCidrs = v return s } -// SetNoDevice sets the NoDevice field's value. -func (s *BlockDeviceMapping) SetNoDevice(v string) *BlockDeviceMapping { - s.NoDevice = &v +// SetPoolId sets the PoolId field's value. +func (s *CoipPool) SetPoolId(v string) *CoipPool { + s.PoolId = &v return s } -// SetVirtualName sets the VirtualName field's value. -func (s *BlockDeviceMapping) SetVirtualName(v string) *BlockDeviceMapping { - s.VirtualName = &v +// SetTags sets the Tags field's value. +func (s *CoipPool) SetTags(v []*Tag) *CoipPool { + s.Tags = v return s } -// Contains the parameters for BundleInstance. -type BundleInstanceInput struct { +type ConfirmProductInstanceInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -35888,43 +43135,35 @@ type BundleInstanceInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the instance to bundle. - // - // Type: String - // - // Default: None - // - // Required: Yes + // The ID of the instance. // // 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. + // The product code. This must be a product code that you own. // - // Storage is a required field - Storage *Storage `type:"structure" required:"true"` + // ProductCode is a required field + ProductCode *string `type:"string" required:"true"` } // String returns the string representation -func (s BundleInstanceInput) String() string { +func (s ConfirmProductInstanceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BundleInstanceInput) GoString() string { +func (s ConfirmProductInstanceInput) 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"} +func (s *ConfirmProductInstanceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConfirmProductInstanceInput"} if s.InstanceId == nil { invalidParams.Add(request.NewErrParamRequired("InstanceId")) } - if s.Storage == nil { - invalidParams.Add(request.NewErrParamRequired("Storage")) + if s.ProductCode == nil { + invalidParams.Add(request.NewErrParamRequired("ProductCode")) } if invalidParams.Len() > 0 { @@ -35934,465 +43173,354 @@ func (s *BundleInstanceInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *BundleInstanceInput) SetDryRun(v bool) *BundleInstanceInput { +func (s *ConfirmProductInstanceInput) SetDryRun(v bool) *ConfirmProductInstanceInput { s.DryRun = &v return s } // SetInstanceId sets the InstanceId field's value. -func (s *BundleInstanceInput) SetInstanceId(v string) *BundleInstanceInput { +func (s *ConfirmProductInstanceInput) SetInstanceId(v string) *ConfirmProductInstanceInput { 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. -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 +// SetProductCode sets the ProductCode field's value. +func (s *ConfirmProductInstanceInput) SetProductCode(v string) *ConfirmProductInstanceInput { + s.ProductCode = &v return s } -// Describes a bundle task. -type BundleTask struct { +type ConfirmProductInstanceOutput 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"` - - // 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 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 time of the most recent update for the task. - UpdateTime *time.Time `locationName:"updateTime" type:"timestamp"` + // 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 BundleTask) String() string { +func (s ConfirmProductInstanceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BundleTask) GoString() string { +func (s ConfirmProductInstanceOutput) 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 +// SetOwnerId sets the OwnerId field's value. +func (s *ConfirmProductInstanceOutput) SetOwnerId(v string) *ConfirmProductInstanceOutput { + s.OwnerId = &v return s } -// SetUpdateTime sets the UpdateTime field's value. -func (s *BundleTask) SetUpdateTime(v time.Time) *BundleTask { - s.UpdateTime = &v +// SetReturn sets the Return field's value. +func (s *ConfirmProductInstanceOutput) SetReturn(v bool) *ConfirmProductInstanceOutput { + s.Return = &v return s } -// Describes an error for BundleInstance. -type BundleTaskError struct { +// Describes the client connection logging options for the Client VPN endpoint. +type ConnectionLogOptions struct { _ struct{} `type:"structure"` - // The error code. - Code *string `locationName:"code" type:"string"` + // The name of the CloudWatch Logs log group. + CloudwatchLogGroup *string `type:"string"` - // The error message. - Message *string `locationName:"message" type:"string"` + // The name of the CloudWatch Logs log stream to which the connection data is + // published. + CloudwatchLogStream *string `type:"string"` + + // Indicates whether connection logging is enabled. + Enabled *bool `type:"boolean"` } // String returns the string representation -func (s BundleTaskError) String() string { +func (s ConnectionLogOptions) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BundleTaskError) GoString() string { +func (s ConnectionLogOptions) GoString() string { return s.String() } -// SetCode sets the Code field's value. -func (s *BundleTaskError) SetCode(v string) *BundleTaskError { - s.Code = &v +// SetCloudwatchLogGroup sets the CloudwatchLogGroup field's value. +func (s *ConnectionLogOptions) SetCloudwatchLogGroup(v string) *ConnectionLogOptions { + s.CloudwatchLogGroup = &v return s } -// SetMessage sets the Message field's value. -func (s *BundleTaskError) SetMessage(v string) *BundleTaskError { - s.Message = &v +// SetCloudwatchLogStream sets the CloudwatchLogStream field's value. +func (s *ConnectionLogOptions) SetCloudwatchLogStream(v string) *ConnectionLogOptions { + s.CloudwatchLogStream = &v return s } -// Information about an address range that is provisioned for use with your -// AWS resources through bring your own IP addresses (BYOIP). -type ByoipCidr struct { - _ struct{} `type:"structure"` +// SetEnabled sets the Enabled field's value. +func (s *ConnectionLogOptions) SetEnabled(v bool) *ConnectionLogOptions { + s.Enabled = &v + return s +} - // The public IPv4 address range, in CIDR notation. - Cidr *string `locationName:"cidr" type:"string"` +// Information about the client connection logging options for a Client VPN +// endpoint. +type ConnectionLogResponseOptions struct { + _ struct{} `type:"structure"` - // The description of the address range. - Description *string `locationName:"description" type:"string"` + // The name of the Amazon CloudWatch Logs log group to which connection logging + // data is published. + CloudwatchLogGroup *string `type:"string"` - // The state of the address pool. - State *string `locationName:"state" type:"string" enum:"ByoipCidrState"` + // The name of the Amazon CloudWatch Logs log stream to which connection logging + // data is published. + CloudwatchLogStream *string `type:"string"` - // Upon success, contains the ID of the address pool. Otherwise, contains an - // error message. - StatusMessage *string `locationName:"statusMessage" type:"string"` + // Indicates whether client connection logging is enabled for the Client VPN + // endpoint. + Enabled *bool `type:"boolean"` } // String returns the string representation -func (s ByoipCidr) String() string { +func (s ConnectionLogResponseOptions) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ByoipCidr) GoString() string { +func (s ConnectionLogResponseOptions) GoString() string { return s.String() } -// SetCidr sets the Cidr field's value. -func (s *ByoipCidr) SetCidr(v string) *ByoipCidr { - s.Cidr = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *ByoipCidr) SetDescription(v string) *ByoipCidr { - s.Description = &v +// SetCloudwatchLogGroup sets the CloudwatchLogGroup field's value. +func (s *ConnectionLogResponseOptions) SetCloudwatchLogGroup(v string) *ConnectionLogResponseOptions { + s.CloudwatchLogGroup = &v return s } -// SetState sets the State field's value. -func (s *ByoipCidr) SetState(v string) *ByoipCidr { - s.State = &v +// SetCloudwatchLogStream sets the CloudwatchLogStream field's value. +func (s *ConnectionLogResponseOptions) SetCloudwatchLogStream(v string) *ConnectionLogResponseOptions { + s.CloudwatchLogStream = &v return s } -// SetStatusMessage sets the StatusMessage field's value. -func (s *ByoipCidr) SetStatusMessage(v string) *ByoipCidr { - s.StatusMessage = &v +// SetEnabled sets the Enabled field's value. +func (s *ConnectionLogResponseOptions) SetEnabled(v bool) *ConnectionLogResponseOptions { + s.Enabled = &v return s } -// Contains the parameters for CancelBundleTask. -type CancelBundleTaskInput struct { +// Describes a connection notification for a VPC endpoint or VPC endpoint service. +type ConnectionNotification 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() -} + // The events for the notification. Valid values are Accept, Connect, Delete, + // and Reject. + ConnectionEvents []*string `locationName:"connectionEvents" locationNameList:"item" type:"list"` -// 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")) - } + // The ARN of the SNS topic for the notification. + ConnectionNotificationArn *string `locationName:"connectionNotificationArn" type:"string"` - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} + // The ID of the notification. + ConnectionNotificationId *string `locationName:"connectionNotificationId" type:"string"` -// SetBundleId sets the BundleId field's value. -func (s *CancelBundleTaskInput) SetBundleId(v string) *CancelBundleTaskInput { - s.BundleId = &v - return s -} + // The state of the notification. + ConnectionNotificationState *string `locationName:"connectionNotificationState" type:"string" enum:"ConnectionNotificationState"` -// SetDryRun sets the DryRun field's value. -func (s *CancelBundleTaskInput) SetDryRun(v bool) *CancelBundleTaskInput { - s.DryRun = &v - return s -} + // The type of notification. + ConnectionNotificationType *string `locationName:"connectionNotificationType" type:"string" enum:"ConnectionNotificationType"` -// Contains the output of CancelBundleTask. -type CancelBundleTaskOutput struct { - _ struct{} `type:"structure"` + // The ID of the endpoint service. + ServiceId *string `locationName:"serviceId" type:"string"` - // Information about the bundle task. - BundleTask *BundleTask `locationName:"bundleInstanceTask" type:"structure"` + // The ID of the VPC endpoint. + VpcEndpointId *string `locationName:"vpcEndpointId" type:"string"` } // String returns the string representation -func (s CancelBundleTaskOutput) String() string { +func (s ConnectionNotification) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CancelBundleTaskOutput) GoString() string { +func (s ConnectionNotification) GoString() string { return s.String() } -// SetBundleTask sets the BundleTask field's value. -func (s *CancelBundleTaskOutput) SetBundleTask(v *BundleTask) *CancelBundleTaskOutput { - s.BundleTask = v +// SetConnectionEvents sets the ConnectionEvents field's value. +func (s *ConnectionNotification) SetConnectionEvents(v []*string) *ConnectionNotification { + s.ConnectionEvents = v return s } -type CancelCapacityReservationInput struct { - _ struct{} `type:"structure"` - - // The ID of the Capacity Reservation to be cancelled. - // - // CapacityReservationId is a required field - CapacityReservationId *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 `type:"boolean"` +// SetConnectionNotificationArn sets the ConnectionNotificationArn field's value. +func (s *ConnectionNotification) SetConnectionNotificationArn(v string) *ConnectionNotification { + s.ConnectionNotificationArn = &v + return s } -// String returns the string representation -func (s CancelCapacityReservationInput) String() string { - return awsutil.Prettify(s) +// SetConnectionNotificationId sets the ConnectionNotificationId field's value. +func (s *ConnectionNotification) SetConnectionNotificationId(v string) *ConnectionNotification { + s.ConnectionNotificationId = &v + return s } -// GoString returns the string representation -func (s CancelCapacityReservationInput) GoString() string { - return s.String() +// SetConnectionNotificationState sets the ConnectionNotificationState field's value. +func (s *ConnectionNotification) SetConnectionNotificationState(v string) *ConnectionNotification { + s.ConnectionNotificationState = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelCapacityReservationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelCapacityReservationInput"} - if s.CapacityReservationId == nil { - invalidParams.Add(request.NewErrParamRequired("CapacityReservationId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetConnectionNotificationType sets the ConnectionNotificationType field's value. +func (s *ConnectionNotification) SetConnectionNotificationType(v string) *ConnectionNotification { + s.ConnectionNotificationType = &v + return s } -// SetCapacityReservationId sets the CapacityReservationId field's value. -func (s *CancelCapacityReservationInput) SetCapacityReservationId(v string) *CancelCapacityReservationInput { - s.CapacityReservationId = &v +// SetServiceId sets the ServiceId field's value. +func (s *ConnectionNotification) SetServiceId(v string) *ConnectionNotification { + s.ServiceId = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *CancelCapacityReservationInput) SetDryRun(v bool) *CancelCapacityReservationInput { - s.DryRun = &v +// SetVpcEndpointId sets the VpcEndpointId field's value. +func (s *ConnectionNotification) SetVpcEndpointId(v string) *ConnectionNotification { + s.VpcEndpointId = &v return s } -type CancelCapacityReservationOutput struct { +// Describes a conversion task. +type ConversionTask 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 CancelCapacityReservationOutput) String() string { - return awsutil.Prettify(s) -} + // The ID of the conversion task. + ConversionTaskId *string `locationName:"conversionTaskId" type:"string"` -// GoString returns the string representation -func (s CancelCapacityReservationOutput) GoString() string { - return s.String() -} + // 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"` -// SetReturn sets the Return field's value. -func (s *CancelCapacityReservationOutput) SetReturn(v bool) *CancelCapacityReservationOutput { - s.Return = &v - return s -} + // If the task is for importing an instance, this contains information about + // the import instance task. + ImportInstance *ImportInstanceTaskDetails `locationName:"importInstance" type:"structure"` -type CancelConversionTaskInput struct { - _ struct{} `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 ID of the conversion task. - // - // ConversionTaskId is a required field - ConversionTaskId *string `locationName:"conversionTaskId" type:"string" required:"true"` + // The state of the conversion task. + State *string `locationName:"state" type:"string" enum:"ConversionTaskState"` - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides 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 status message related to the conversion task. + StatusMessage *string `locationName:"statusMessage" type:"string"` - // The reason for canceling the conversion task. - ReasonMessage *string `locationName:"reasonMessage" type:"string"` + // Any tags assigned to the task. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s CancelConversionTaskInput) String() string { +func (s ConversionTask) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CancelConversionTaskInput) GoString() string { +func (s ConversionTask) 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 { +func (s *ConversionTask) SetConversionTaskId(v string) *ConversionTask { s.ConversionTaskId = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *CancelConversionTaskInput) SetDryRun(v bool) *CancelConversionTaskInput { - s.DryRun = &v +// SetExpirationTime sets the ExpirationTime field's value. +func (s *ConversionTask) SetExpirationTime(v string) *ConversionTask { + s.ExpirationTime = &v return s } -// SetReasonMessage sets the ReasonMessage field's value. -func (s *CancelConversionTaskInput) SetReasonMessage(v string) *CancelConversionTaskInput { - s.ReasonMessage = &v +// SetImportInstance sets the ImportInstance field's value. +func (s *ConversionTask) SetImportInstance(v *ImportInstanceTaskDetails) *ConversionTask { + s.ImportInstance = v return s } -type CancelConversionTaskOutput struct { - _ struct{} `type:"structure"` +// SetImportVolume sets the ImportVolume field's value. +func (s *ConversionTask) SetImportVolume(v *ImportVolumeTaskDetails) *ConversionTask { + s.ImportVolume = v + return s } -// String returns the string representation -func (s CancelConversionTaskOutput) String() string { - return awsutil.Prettify(s) +// SetState sets the State field's value. +func (s *ConversionTask) SetState(v string) *ConversionTask { + s.State = &v + return s } -// GoString returns the string representation -func (s CancelConversionTaskOutput) GoString() string { - return s.String() +// SetStatusMessage sets the StatusMessage field's value. +func (s *ConversionTask) SetStatusMessage(v string) *ConversionTask { + s.StatusMessage = &v + return s } -type CancelExportTaskInput struct { +// SetTags sets the Tags field's value. +func (s *ConversionTask) SetTags(v []*Tag) *ConversionTask { + s.Tags = v + return s +} + +type CopyFpgaImageInput struct { _ struct{} `type:"structure"` - // The ID of the export task. This is the ID returned by CreateInstanceExportTask. + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). + ClientToken *string `type:"string"` + + // The description for the new AFI. + 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 `type:"boolean"` + + // The name for the new AFI. The default is the name of the source AFI. + Name *string `type:"string"` + + // The ID of the source AFI. // - // ExportTaskId is a required field - ExportTaskId *string `locationName:"exportTaskId" type:"string" required:"true"` + // SourceFpgaImageId is a required field + SourceFpgaImageId *string `type:"string" required:"true"` + + // The Region that contains the source AFI. + // + // SourceRegion is a required field + SourceRegion *string `type:"string" required:"true"` } // String returns the string representation -func (s CancelExportTaskInput) String() string { +func (s CopyFpgaImageInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CancelExportTaskInput) GoString() string { +func (s CopyFpgaImageInput) 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")) +func (s *CopyFpgaImageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CopyFpgaImageInput"} + if s.SourceFpgaImageId == nil { + invalidParams.Add(request.NewErrParamRequired("SourceFpgaImageId")) + } + if s.SourceRegion == nil { + invalidParams.Add(request.NewErrParamRequired("SourceRegion")) } if invalidParams.Len() > 0 { @@ -36401,136 +43529,156 @@ func (s *CancelExportTaskInput) Validate() error { return nil } -// SetExportTaskId sets the ExportTaskId field's value. -func (s *CancelExportTaskInput) SetExportTaskId(v string) *CancelExportTaskInput { - s.ExportTaskId = &v +// SetClientToken sets the ClientToken field's value. +func (s *CopyFpgaImageInput) SetClientToken(v string) *CopyFpgaImageInput { + s.ClientToken = &v return s } -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() -} - -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) +// SetDescription sets the Description field's value. +func (s *CopyFpgaImageInput) SetDescription(v string) *CopyFpgaImageInput { + s.Description = &v + return s } -// GoString returns the string representation -func (s CancelImportTaskInput) GoString() string { - return s.String() +// SetDryRun sets the DryRun field's value. +func (s *CopyFpgaImageInput) SetDryRun(v bool) *CopyFpgaImageInput { + s.DryRun = &v + return s } -// SetCancelReason sets the CancelReason field's value. -func (s *CancelImportTaskInput) SetCancelReason(v string) *CancelImportTaskInput { - s.CancelReason = &v +// SetName sets the Name field's value. +func (s *CopyFpgaImageInput) SetName(v string) *CopyFpgaImageInput { + s.Name = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *CancelImportTaskInput) SetDryRun(v bool) *CancelImportTaskInput { - s.DryRun = &v +// SetSourceFpgaImageId sets the SourceFpgaImageId field's value. +func (s *CopyFpgaImageInput) SetSourceFpgaImageId(v string) *CopyFpgaImageInput { + s.SourceFpgaImageId = &v return s } -// SetImportTaskId sets the ImportTaskId field's value. -func (s *CancelImportTaskInput) SetImportTaskId(v string) *CancelImportTaskInput { - s.ImportTaskId = &v +// SetSourceRegion sets the SourceRegion field's value. +func (s *CopyFpgaImageInput) SetSourceRegion(v string) *CopyFpgaImageInput { + s.SourceRegion = &v return s } -type CancelImportTaskOutput struct { +type CopyFpgaImageOutput 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"` + // The ID of the new AFI. + FpgaImageId *string `locationName:"fpgaImageId" type:"string"` } // String returns the string representation -func (s CancelImportTaskOutput) String() string { +func (s CopyFpgaImageOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CancelImportTaskOutput) GoString() string { +func (s CopyFpgaImageOutput) GoString() string { return s.String() } -// SetImportTaskId sets the ImportTaskId field's value. -func (s *CancelImportTaskOutput) SetImportTaskId(v string) *CancelImportTaskOutput { - s.ImportTaskId = &v +// SetFpgaImageId sets the FpgaImageId field's value. +func (s *CopyFpgaImageOutput) SetFpgaImageId(v string) *CopyFpgaImageOutput { + s.FpgaImageId = &v return s } -// SetPreviousState sets the PreviousState field's value. -func (s *CancelImportTaskOutput) SetPreviousState(v string) *CancelImportTaskOutput { - s.PreviousState = &v - return s -} +// Contains the parameters for CopyImage. +type CopyImageInput struct { + _ struct{} `type:"structure"` -// SetState sets the State field's value. -func (s *CancelImportTaskOutput) SetState(v string) *CancelImportTaskOutput { - s.State = &v - return s -} + // Unique, case-sensitive identifier you provide to ensure idempotency of the + // request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) + // in the Amazon Elastic Compute Cloud User Guide. + ClientToken *string `type:"string"` -// Contains the parameters for CancelReservedInstancesListing. -type CancelReservedInstancesListingInput struct { - _ struct{} `type:"structure"` + // A description for the new AMI in the destination Region. + Description *string `type:"string"` - // The ID of the Reserved Instance listing. + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides 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. You can encrypt a copy of an unencrypted snapshot, but you cannot + // create an unencrypted copy of an encrypted snapshot. The default CMK for + // EBS is used unless you specify a non-default AWS Key Management Service (AWS + // KMS) CMK using KmsKeyId. For more information, see Amazon EBS Encryption + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) + // in the Amazon Elastic Compute Cloud User Guide. + Encrypted *bool `locationName:"encrypted" type:"boolean"` + + // An identifier for the symmetric 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. If a KmsKeyId is specified, + // the Encrypted flag must also be set. // - // ReservedInstancesListingId is a required field - ReservedInstancesListingId *string `locationName:"reservedInstancesListingId" type:"string" required:"true"` + // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, + // or alias ARN. When using an alias name, prefix it with "alias/". For example: + // + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key 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 + // + // AWS parses KmsKeyId asynchronously, meaning that the action you call may + // appear to complete even though you provided an invalid identifier. This action + // will eventually report failure. + // + // The specified CMK must exist in the Region that the snapshot is being copied + // to. + // + // Amazon EBS does not support asymmetric CMKs. + 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 CancelReservedInstancesListingInput) String() string { +func (s CopyImageInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CancelReservedInstancesListingInput) GoString() string { +func (s CopyImageInput) 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")) +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 { @@ -36539,142 +43687,175 @@ func (s *CancelReservedInstancesListingInput) Validate() error { return nil } -// SetReservedInstancesListingId sets the ReservedInstancesListingId field's value. -func (s *CancelReservedInstancesListingInput) SetReservedInstancesListingId(v string) *CancelReservedInstancesListingInput { - s.ReservedInstancesListingId = &v +// SetClientToken sets the ClientToken field's value. +func (s *CopyImageInput) SetClientToken(v string) *CopyImageInput { + s.ClientToken = &v return s } -// Contains the output of CancelReservedInstancesListing. -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() +// SetDescription sets the Description field's value. +func (s *CopyImageInput) SetDescription(v string) *CopyImageInput { + s.Description = &v + return s } -// SetReservedInstancesListings sets the ReservedInstancesListings field's value. -func (s *CancelReservedInstancesListingOutput) SetReservedInstancesListings(v []*ReservedInstancesListing) *CancelReservedInstancesListingOutput { - s.ReservedInstancesListings = v +// SetDryRun sets the DryRun field's value. +func (s *CopyImageInput) SetDryRun(v bool) *CopyImageInput { + s.DryRun = &v return s } -// Describes a Spot Fleet error. -type CancelSpotFleetRequestsError struct { - _ struct{} `type:"structure"` - - // The error code. - Code *string `locationName:"code" type:"string" enum:"CancelBatchErrorCode"` - - // The description for the error code. - Message *string `locationName:"message" type:"string"` +// SetEncrypted sets the Encrypted field's value. +func (s *CopyImageInput) SetEncrypted(v bool) *CopyImageInput { + s.Encrypted = &v + return s } -// String returns the string representation -func (s CancelSpotFleetRequestsError) String() string { - return awsutil.Prettify(s) +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *CopyImageInput) SetKmsKeyId(v string) *CopyImageInput { + s.KmsKeyId = &v + return s } -// GoString returns the string representation -func (s CancelSpotFleetRequestsError) GoString() string { - return s.String() +// SetName sets the Name field's value. +func (s *CopyImageInput) SetName(v string) *CopyImageInput { + s.Name = &v + return s } -// SetCode sets the Code field's value. -func (s *CancelSpotFleetRequestsError) SetCode(v string) *CancelSpotFleetRequestsError { - s.Code = &v +// SetSourceImageId sets the SourceImageId field's value. +func (s *CopyImageInput) SetSourceImageId(v string) *CopyImageInput { + s.SourceImageId = &v return s } -// SetMessage sets the Message field's value. -func (s *CancelSpotFleetRequestsError) SetMessage(v string) *CancelSpotFleetRequestsError { - s.Message = &v +// SetSourceRegion sets the SourceRegion field's value. +func (s *CopyImageInput) SetSourceRegion(v string) *CopyImageInput { + s.SourceRegion = &v return s } -// Describes a Spot Fleet request that was not successfully canceled. -type CancelSpotFleetRequestsErrorItem struct { +// Contains the output of CopyImage. +type CopyImageOutput struct { _ struct{} `type:"structure"` - // The error. - Error *CancelSpotFleetRequestsError `locationName:"error" type:"structure"` - - // The ID of the Spot Fleet request. - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string"` + // The ID of the new AMI. + ImageId *string `locationName:"imageId" type:"string"` } // String returns the string representation -func (s CancelSpotFleetRequestsErrorItem) String() string { +func (s CopyImageOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CancelSpotFleetRequestsErrorItem) GoString() string { +func (s CopyImageOutput) 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 +// SetImageId sets the ImageId field's value. +func (s *CopyImageOutput) SetImageId(v string) *CopyImageOutput { + s.ImageId = &v return s } -// Contains the parameters for CancelSpotFleetRequests. -type CancelSpotFleetRequestsInput struct { +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. + // + // The snapshot copy is sent to the regional endpoint that you sent the HTTP + // request to (for example, ec2.us-east-1.amazonaws.com). With the AWS CLI, + // this is specified using 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"` - // The IDs of the Spot Fleet requests. + // To encrypt a copy of an unencrypted snapshot if encryption by default is + // not enabled, enable encryption using this parameter. Otherwise, omit this + // parameter. Encrypted snapshots are encrypted, even if you omit this parameter + // and encryption by default is not enabled. You cannot set this parameter to + // false. For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) + // in the Amazon Elastic Compute Cloud User Guide. + Encrypted *bool `locationName:"encrypted" type:"boolean"` + + // The identifier of the AWS Key Management Service (AWS KMS) customer master + // key (CMK) to use for Amazon EBS encryption. If this parameter is not specified, + // your AWS managed CMK for EBS is used. If KmsKeyId is specified, the encrypted + // state must be true. // - // SpotFleetRequestIds is a required field - SpotFleetRequestIds []*string `locationName:"spotFleetRequestId" locationNameList:"item" type:"list" required:"true"` + // You can specify the CMK using any of the following: + // + // * Key ID. For example, key/1234abcd-12ab-34cd-56ef-1234567890ab. + // + // * Key alias. For example, alias/ExampleAlias. + // + // * Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. + // + // * Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. + // + // AWS authenticates the CMK asynchronously. Therefore, if you specify an ID, + // alias, or ARN that is not valid, the action can appear to complete, but eventually + // fails. + KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - // Indicates whether to terminate instances for a Spot Fleet request if it is - // canceled successfully. + // When you copy an encrypted source snapshot using the Amazon EC2 Query API, + // you must supply a pre-signed URL. This parameter is optional for unencrypted + // snapshots. For more information, see Query Requests (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html). // - // TerminateInstances is a required field - TerminateInstances *bool `locationName:"terminateInstances" type:"boolean" required:"true"` + // 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) (https://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"` + + // The tags to apply to the new snapshot. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } // String returns the string representation -func (s CancelSpotFleetRequestsInput) String() string { +func (s CopySnapshotInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CancelSpotFleetRequestsInput) GoString() string { +func (s CopySnapshotInput) 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")) +func (s *CopySnapshotInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CopySnapshotInput"} + if s.SourceRegion == nil { + invalidParams.Add(request.NewErrParamRequired("SourceRegion")) } - if s.TerminateInstances == nil { - invalidParams.Add(request.NewErrParamRequired("TerminateInstances")) + if s.SourceSnapshotId == nil { + invalidParams.Add(request.NewErrParamRequired("SourceSnapshotId")) } if invalidParams.Len() > 0 { @@ -36683,304 +43864,252 @@ func (s *CancelSpotFleetRequestsInput) Validate() error { 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. -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() +// SetDescription sets the Description field's value. +func (s *CopySnapshotInput) SetDescription(v string) *CopySnapshotInput { + s.Description = &v + return s } -// SetSuccessfulFleetRequests sets the SuccessfulFleetRequests field's value. -func (s *CancelSpotFleetRequestsOutput) SetSuccessfulFleetRequests(v []*CancelSpotFleetRequestsSuccessItem) *CancelSpotFleetRequestsOutput { - s.SuccessfulFleetRequests = v +// SetDestinationRegion sets the DestinationRegion field's value. +func (s *CopySnapshotInput) SetDestinationRegion(v string) *CopySnapshotInput { + s.DestinationRegion = &v return s } -// SetUnsuccessfulFleetRequests sets the UnsuccessfulFleetRequests field's value. -func (s *CancelSpotFleetRequestsOutput) SetUnsuccessfulFleetRequests(v []*CancelSpotFleetRequestsErrorItem) *CancelSpotFleetRequestsOutput { - s.UnsuccessfulFleetRequests = v +// SetDryRun sets the DryRun field's value. +func (s *CopySnapshotInput) SetDryRun(v bool) *CopySnapshotInput { + s.DryRun = &v return s } -// Describes a Spot Fleet request that was successfully canceled. -type CancelSpotFleetRequestsSuccessItem struct { - _ struct{} `type:"structure"` - - // The current state of the Spot Fleet request. - CurrentSpotFleetRequestState *string `locationName:"currentSpotFleetRequestState" type:"string" enum:"BatchState"` - - // The previous state of the Spot Fleet request. - PreviousSpotFleetRequestState *string `locationName:"previousSpotFleetRequestState" type:"string" enum:"BatchState"` - - // The ID of the Spot Fleet request. - SpotFleetRequestId *string `locationName:"spotFleetRequestId" type:"string"` +// SetEncrypted sets the Encrypted field's value. +func (s *CopySnapshotInput) SetEncrypted(v bool) *CopySnapshotInput { + s.Encrypted = &v + return s } -// String returns the string representation -func (s CancelSpotFleetRequestsSuccessItem) String() string { - return awsutil.Prettify(s) +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *CopySnapshotInput) SetKmsKeyId(v string) *CopySnapshotInput { + s.KmsKeyId = &v + return s } -// GoString returns the string representation -func (s CancelSpotFleetRequestsSuccessItem) GoString() string { - return s.String() +// SetPresignedUrl sets the PresignedUrl field's value. +func (s *CopySnapshotInput) SetPresignedUrl(v string) *CopySnapshotInput { + s.PresignedUrl = &v + return s } -// SetCurrentSpotFleetRequestState sets the CurrentSpotFleetRequestState field's value. -func (s *CancelSpotFleetRequestsSuccessItem) SetCurrentSpotFleetRequestState(v string) *CancelSpotFleetRequestsSuccessItem { - s.CurrentSpotFleetRequestState = &v +// SetSourceRegion sets the SourceRegion field's value. +func (s *CopySnapshotInput) SetSourceRegion(v string) *CopySnapshotInput { + s.SourceRegion = &v return s } -// SetPreviousSpotFleetRequestState sets the PreviousSpotFleetRequestState field's value. -func (s *CancelSpotFleetRequestsSuccessItem) SetPreviousSpotFleetRequestState(v string) *CancelSpotFleetRequestsSuccessItem { - s.PreviousSpotFleetRequestState = &v +// SetSourceSnapshotId sets the SourceSnapshotId field's value. +func (s *CopySnapshotInput) SetSourceSnapshotId(v string) *CopySnapshotInput { + s.SourceSnapshotId = &v return s } -// SetSpotFleetRequestId sets the SpotFleetRequestId field's value. -func (s *CancelSpotFleetRequestsSuccessItem) SetSpotFleetRequestId(v string) *CancelSpotFleetRequestsSuccessItem { - s.SpotFleetRequestId = &v +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CopySnapshotInput) SetTagSpecifications(v []*TagSpecification) *CopySnapshotInput { + s.TagSpecifications = v return s } -// Contains the parameters for CancelSpotInstanceRequests. -type CancelSpotInstanceRequestsInput struct { +type CopySnapshotOutput 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 new snapshot. + SnapshotId *string `locationName:"snapshotId" type:"string"` - // One or more Spot Instance request IDs. - // - // SpotInstanceRequestIds is a required field - SpotInstanceRequestIds []*string `locationName:"SpotInstanceRequestId" locationNameList:"SpotInstanceRequestId" type:"list" required:"true"` + // Any tags applied to the new snapshot. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s CancelSpotInstanceRequestsInput) String() string { +func (s CopySnapshotOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CancelSpotInstanceRequestsInput) GoString() string { +func (s CopySnapshotOutput) 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 +// SetSnapshotId sets the SnapshotId field's value. +func (s *CopySnapshotOutput) SetSnapshotId(v string) *CopySnapshotOutput { + s.SnapshotId = &v return s } -// SetSpotInstanceRequestIds sets the SpotInstanceRequestIds field's value. -func (s *CancelSpotInstanceRequestsInput) SetSpotInstanceRequestIds(v []*string) *CancelSpotInstanceRequestsInput { - s.SpotInstanceRequestIds = v +// SetTags sets the Tags field's value. +func (s *CopySnapshotOutput) SetTags(v []*Tag) *CopySnapshotOutput { + s.Tags = v return s } -// Contains the output of CancelSpotInstanceRequests. -type CancelSpotInstanceRequestsOutput struct { +// The CPU options for the instance. +type CpuOptions struct { _ struct{} `type:"structure"` - // One or more Spot Instance requests. - CancelledSpotInstanceRequests []*CancelledSpotInstanceRequest `locationName:"spotInstanceRequestSet" locationNameList:"item" type:"list"` + // The number of CPU cores for the instance. + CoreCount *int64 `locationName:"coreCount" type:"integer"` + + // The number of threads per CPU core. + ThreadsPerCore *int64 `locationName:"threadsPerCore" type:"integer"` } // String returns the string representation -func (s CancelSpotInstanceRequestsOutput) String() string { +func (s CpuOptions) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CancelSpotInstanceRequestsOutput) GoString() string { +func (s CpuOptions) GoString() string { return s.String() } -// SetCancelledSpotInstanceRequests sets the CancelledSpotInstanceRequests field's value. -func (s *CancelSpotInstanceRequestsOutput) SetCancelledSpotInstanceRequests(v []*CancelledSpotInstanceRequest) *CancelSpotInstanceRequestsOutput { - s.CancelledSpotInstanceRequests = v +// SetCoreCount sets the CoreCount field's value. +func (s *CpuOptions) SetCoreCount(v int64) *CpuOptions { + s.CoreCount = &v return s } -// Describes a request to cancel a Spot Instance. -type CancelledSpotInstanceRequest struct { +// SetThreadsPerCore sets the ThreadsPerCore field's value. +func (s *CpuOptions) SetThreadsPerCore(v int64) *CpuOptions { + s.ThreadsPerCore = &v + return s +} + +// The CPU options for the instance. Both the core count and threads per core +// must be specified in the request. +type CpuOptionsRequest struct { _ struct{} `type:"structure"` - // The ID of the Spot Instance request. - SpotInstanceRequestId *string `locationName:"spotInstanceRequestId" type:"string"` + // The number of CPU cores for the instance. + CoreCount *int64 `type:"integer"` - // The state of the Spot Instance request. - State *string `locationName:"state" type:"string" enum:"CancelSpotInstanceRequestState"` + // The number of threads per CPU core. To disable multithreading for the instance, + // specify a value of 1. Otherwise, specify the default value of 2. + ThreadsPerCore *int64 `type:"integer"` } // String returns the string representation -func (s CancelledSpotInstanceRequest) String() string { +func (s CpuOptionsRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CancelledSpotInstanceRequest) GoString() string { +func (s CpuOptionsRequest) GoString() string { return s.String() } -// SetSpotInstanceRequestId sets the SpotInstanceRequestId field's value. -func (s *CancelledSpotInstanceRequest) SetSpotInstanceRequestId(v string) *CancelledSpotInstanceRequest { - s.SpotInstanceRequestId = &v +// SetCoreCount sets the CoreCount field's value. +func (s *CpuOptionsRequest) SetCoreCount(v int64) *CpuOptionsRequest { + s.CoreCount = &v return s } -// SetState sets the State field's value. -func (s *CancelledSpotInstanceRequest) SetState(v string) *CancelledSpotInstanceRequest { - s.State = &v +// SetThreadsPerCore sets the ThreadsPerCore field's value. +func (s *CpuOptionsRequest) SetThreadsPerCore(v int64) *CpuOptionsRequest { + s.ThreadsPerCore = &v return s } -// Describes a Capacity Reservation. -type CapacityReservation struct { +type CreateCapacityReservationInput struct { _ struct{} `type:"structure"` - // The Availability Zone in which the capacity is reserved. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - - // The Availability Zone ID of the Capacity Reservation. - AvailabilityZoneId *string `locationName:"availabilityZoneId" type:"string"` - - // The remaining capacity. Indicates the number of instances that can be launched - // in the Capacity Reservation. - AvailableInstanceCount *int64 `locationName:"availableInstanceCount" type:"integer"` + // The Availability Zone in which to create the Capacity Reservation. + AvailabilityZone *string `type:"string"` - // The Amazon Resource Name (ARN) of the Capacity Reservation. - CapacityReservationArn *string `locationName:"capacityReservationArn" type:"string"` + // The ID of the Availability Zone in which to create the Capacity Reservation. + AvailabilityZoneId *string `type:"string"` - // The ID of the Capacity Reservation. - CapacityReservationId *string `locationName:"capacityReservationId" type:"string"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + // + // Constraint: Maximum 64 ASCII characters. + ClientToken *string `type:"string"` - // The date and time at which the Capacity Reservation was created. - CreateDate *time.Time `locationName:"createDate" type:"timestamp"` + // Checks whether you have the required permissions for the action, without + // actually making 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"` // Indicates whether the Capacity Reservation supports EBS-optimized instances. // 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"` + EbsOptimized *bool `type:"boolean"` // The date and time at which the Capacity Reservation expires. When a Capacity // Reservation expires, the reserved capacity is released and you can no longer // launch instances into it. The Capacity Reservation's state changes to expired // when it reaches its end date and time. - EndDate *time.Time `locationName:"endDate" type:"timestamp"` + // + // You must provide an EndDate value if EndDateType is limited. Omit EndDate + // if EndDateType is unlimited. + // + // If the EndDateType is limited, the Capacity Reservation is cancelled within + // an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, + // the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 + // on 5/31/2019. + EndDate *time.Time `type:"timestamp"` // Indicates the way in which the Capacity Reservation ends. A Capacity Reservation // can have one of the following end types: // // * unlimited - The Capacity Reservation remains active until you explicitly - // cancel it. + // cancel it. Do not provide an EndDate if the EndDateType is unlimited. // // * limited - The Capacity Reservation expires automatically at a specified - // date and time. - EndDateType *string `locationName:"endDateType" type:"string" enum:"EndDateType"` + // date and time. You must provide an EndDate value if the EndDateType value + // is limited. + EndDateType *string `type:"string" enum:"EndDateType"` // Indicates whether the Capacity Reservation supports instances with temporary, // block-level storage. - EphemeralStorage *bool `locationName:"ephemeralStorage" type:"boolean"` + EphemeralStorage *bool `type:"boolean"` + + // The number of instances for which to reserve capacity. + // + // InstanceCount is a required field + InstanceCount *int64 `type:"integer" required:"true"` // Indicates the type of instance launches that the Capacity Reservation accepts. // The options include: // - // * open - The Capacity Reservation accepts all instances that have matching - // attributes (instance type, platform, and Availability Zone). Instances - // that have matching attributes launch into the Capacity Reservation automatically - // without specifying any additional parameters. + // * open - The Capacity Reservation automatically matches all instances + // that have matching attributes (instance type, platform, and Availability + // Zone). Instances that have matching attributes run in the Capacity Reservation + // automatically without specifying any additional parameters. // // * targeted - The Capacity Reservation only accepts instances that have // matching attributes (instance type, platform, and Availability Zone), // and explicitly target the Capacity Reservation. This ensures that only // permitted instances can use the reserved capacity. - InstanceMatchCriteria *string `locationName:"instanceMatchCriteria" type:"string" enum:"InstanceMatchCriteria"` - - // The type of operating system for which the Capacity Reservation reserves - // capacity. - InstancePlatform *string `locationName:"instancePlatform" type:"string" enum:"CapacityReservationInstancePlatform"` - - // The type of instance for which the Capacity Reservation reserves capacity. - InstanceType *string `locationName:"instanceType" type:"string"` - - // The ID of the AWS account that owns the Capacity Reservation. - OwnerId *string `locationName:"ownerId" type:"string"` - - // The current state of the Capacity Reservation. A Capacity Reservation can - // be in one of the following states: // - // * active - The Capacity Reservation is active and the capacity is available - // for your use. - // - // * expired - The Capacity Reservation expired automatically at the date - // and time specified in your request. The reserved capacity is no longer - // available for your use. - // - // * cancelled - The Capacity Reservation was manually cancelled. The reserved - // capacity is no longer available for your use. + // Default: open + InstanceMatchCriteria *string `type:"string" enum:"InstanceMatchCriteria"` + + // The type of operating system for which to reserve capacity. // - // * pending - The Capacity Reservation request was successful but the capacity - // provisioning is still pending. + // InstancePlatform is a required field + InstancePlatform *string `type:"string" required:"true" enum:"CapacityReservationInstancePlatform"` + + // The instance type for which to reserve capacity. For more information, see + // Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) + // in the Amazon Elastic Compute Cloud User Guide. // - // * failed - The Capacity Reservation request has failed. A request might - // fail due to invalid request parameters, capacity constraints, or instance - // limit constraints. Failed requests are retained for 60 minutes. - State *string `locationName:"state" type:"string" enum:"CapacityReservationState"` + // InstanceType is a required field + InstanceType *string `type:"string" required:"true"` - // Any tags assigned to the Capacity Reservation. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + // The tags to apply to the Capacity Reservation during launch. + TagSpecifications []*TagSpecification `locationNameList:"item" type:"list"` // Indicates the tenancy of the Capacity Reservation. A Capacity Reservation // can have one of the following tenancy settings: @@ -36990,358 +44119,654 @@ type CapacityReservation struct { // // * dedicated - The Capacity Reservation is created on single-tenant hardware // that is dedicated to a single AWS account. - Tenancy *string `locationName:"tenancy" type:"string" enum:"CapacityReservationTenancy"` - - // The total number of instances for which the Capacity Reservation reserves - // capacity. - TotalInstanceCount *int64 `locationName:"totalInstanceCount" type:"integer"` + Tenancy *string `type:"string" enum:"CapacityReservationTenancy"` } // String returns the string representation -func (s CapacityReservation) String() string { +func (s CreateCapacityReservationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CapacityReservation) GoString() string { +func (s CreateCapacityReservationInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateCapacityReservationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateCapacityReservationInput"} + if s.InstanceCount == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceCount")) + } + if s.InstancePlatform == nil { + invalidParams.Add(request.NewErrParamRequired("InstancePlatform")) + } + if s.InstanceType == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CapacityReservation) SetAvailabilityZone(v string) *CapacityReservation { +func (s *CreateCapacityReservationInput) SetAvailabilityZone(v string) *CreateCapacityReservationInput { s.AvailabilityZone = &v return s } // SetAvailabilityZoneId sets the AvailabilityZoneId field's value. -func (s *CapacityReservation) SetAvailabilityZoneId(v string) *CapacityReservation { +func (s *CreateCapacityReservationInput) SetAvailabilityZoneId(v string) *CreateCapacityReservationInput { s.AvailabilityZoneId = &v return s } -// SetAvailableInstanceCount sets the AvailableInstanceCount field's value. -func (s *CapacityReservation) SetAvailableInstanceCount(v int64) *CapacityReservation { - s.AvailableInstanceCount = &v +// SetClientToken sets the ClientToken field's value. +func (s *CreateCapacityReservationInput) SetClientToken(v string) *CreateCapacityReservationInput { + s.ClientToken = &v return s } -// SetCapacityReservationArn sets the CapacityReservationArn field's value. -func (s *CapacityReservation) SetCapacityReservationArn(v string) *CapacityReservation { - s.CapacityReservationArn = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateCapacityReservationInput) SetDryRun(v bool) *CreateCapacityReservationInput { + s.DryRun = &v return s } -// SetCapacityReservationId sets the CapacityReservationId field's value. -func (s *CapacityReservation) SetCapacityReservationId(v string) *CapacityReservation { - s.CapacityReservationId = &v +// SetEbsOptimized sets the EbsOptimized field's value. +func (s *CreateCapacityReservationInput) SetEbsOptimized(v bool) *CreateCapacityReservationInput { + s.EbsOptimized = &v return s } -// SetCreateDate sets the CreateDate field's value. -func (s *CapacityReservation) SetCreateDate(v time.Time) *CapacityReservation { - s.CreateDate = &v +// SetEndDate sets the EndDate field's value. +func (s *CreateCapacityReservationInput) SetEndDate(v time.Time) *CreateCapacityReservationInput { + s.EndDate = &v return s } -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *CapacityReservation) SetEbsOptimized(v bool) *CapacityReservation { - s.EbsOptimized = &v +// SetEndDateType sets the EndDateType field's value. +func (s *CreateCapacityReservationInput) SetEndDateType(v string) *CreateCapacityReservationInput { + s.EndDateType = &v + return s +} + +// SetEphemeralStorage sets the EphemeralStorage field's value. +func (s *CreateCapacityReservationInput) SetEphemeralStorage(v bool) *CreateCapacityReservationInput { + s.EphemeralStorage = &v + return s +} + +// SetInstanceCount sets the InstanceCount field's value. +func (s *CreateCapacityReservationInput) SetInstanceCount(v int64) *CreateCapacityReservationInput { + s.InstanceCount = &v + return s +} + +// SetInstanceMatchCriteria sets the InstanceMatchCriteria field's value. +func (s *CreateCapacityReservationInput) SetInstanceMatchCriteria(v string) *CreateCapacityReservationInput { + s.InstanceMatchCriteria = &v + return s +} + +// SetInstancePlatform sets the InstancePlatform field's value. +func (s *CreateCapacityReservationInput) SetInstancePlatform(v string) *CreateCapacityReservationInput { + s.InstancePlatform = &v + return s +} + +// SetInstanceType sets the InstanceType field's value. +func (s *CreateCapacityReservationInput) SetInstanceType(v string) *CreateCapacityReservationInput { + s.InstanceType = &v + return s +} + +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateCapacityReservationInput) SetTagSpecifications(v []*TagSpecification) *CreateCapacityReservationInput { + s.TagSpecifications = v + return s +} + +// SetTenancy sets the Tenancy field's value. +func (s *CreateCapacityReservationInput) SetTenancy(v string) *CreateCapacityReservationInput { + s.Tenancy = &v + return s +} + +type CreateCapacityReservationOutput struct { + _ struct{} `type:"structure"` + + // Information about the Capacity Reservation. + CapacityReservation *CapacityReservation `locationName:"capacityReservation" type:"structure"` +} + +// String returns the string representation +func (s CreateCapacityReservationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCapacityReservationOutput) GoString() string { + return s.String() +} + +// SetCapacityReservation sets the CapacityReservation field's value. +func (s *CreateCapacityReservationOutput) SetCapacityReservation(v *CapacityReservation) *CreateCapacityReservationOutput { + s.CapacityReservation = v + return s +} + +type CreateClientVpnEndpointInput struct { + _ struct{} `type:"structure"` + + // Information about the authentication method to be used to authenticate clients. + // + // AuthenticationOptions is a required field + AuthenticationOptions []*ClientVpnAuthenticationRequest `locationName:"Authentication" type:"list" required:"true"` + + // The IPv4 address range, in CIDR notation, from which to assign client IP + // addresses. The address range cannot overlap with the local CIDR of the VPC + // in which the associated subnet is located, or the routes that you add manually. + // The address range cannot be changed after the Client VPN endpoint has been + // created. The CIDR block should be /22 or greater. + // + // ClientCidrBlock is a required field + ClientCidrBlock *string `type:"string" required:"true"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `type:"string" idempotencyToken:"true"` + + // Information about the client connection logging options. + // + // If you enable client connection logging, data about client connections is + // sent to a Cloudwatch Logs log stream. The following information is logged: + // + // * Client connection requests + // + // * Client connection results (successful and unsuccessful) + // + // * Reasons for unsuccessful client connection requests + // + // * Client connection termination time + // + // ConnectionLogOptions is a required field + ConnectionLogOptions *ConnectionLogOptions `type:"structure" required:"true"` + + // A brief description of the Client VPN endpoint. + Description *string `type:"string"` + + // Information about the DNS servers to be used for DNS resolution. A Client + // VPN endpoint can have up to two DNS servers. If no DNS server is specified, + // the DNS address configured on the device is used for the DNS server. + DnsServers []*string `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 ARN of the server certificate. For more information, see the AWS Certificate + // Manager User Guide (https://docs.aws.amazon.com/acm/latest/userguide/). + // + // ServerCertificateArn is a required field + ServerCertificateArn *string `type:"string" required:"true"` + + // Indicates whether split-tunnel is enabled on the AWS Client VPN endpoint. + // + // By default, split-tunnel on a VPN endpoint is disabled. + // + // For information about split-tunnel VPN endpoints, see Split-Tunnel AWS Client + // VPN Endpoint (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/split-tunnel-vpn.html) + // in the AWS Client VPN Administrator Guide. + SplitTunnel *bool `type:"boolean"` + + // The tags to apply to the Client VPN endpoint during creation. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + + // The transport protocol to be used by the VPN session. + // + // Default value: udp + TransportProtocol *string `type:"string" enum:"TransportProtocol"` + + // The port number to assign to the Client VPN endpoint for TCP and UDP traffic. + // + // Valid Values: 443 | 1194 + // + // Default Value: 443 + VpnPort *int64 `type:"integer"` +} + +// String returns the string representation +func (s CreateClientVpnEndpointInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateClientVpnEndpointInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateClientVpnEndpointInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateClientVpnEndpointInput"} + if s.AuthenticationOptions == nil { + invalidParams.Add(request.NewErrParamRequired("AuthenticationOptions")) + } + if s.ClientCidrBlock == nil { + invalidParams.Add(request.NewErrParamRequired("ClientCidrBlock")) + } + if s.ConnectionLogOptions == nil { + invalidParams.Add(request.NewErrParamRequired("ConnectionLogOptions")) + } + if s.ServerCertificateArn == nil { + invalidParams.Add(request.NewErrParamRequired("ServerCertificateArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuthenticationOptions sets the AuthenticationOptions field's value. +func (s *CreateClientVpnEndpointInput) SetAuthenticationOptions(v []*ClientVpnAuthenticationRequest) *CreateClientVpnEndpointInput { + s.AuthenticationOptions = v return s } -// SetEndDate sets the EndDate field's value. -func (s *CapacityReservation) SetEndDate(v time.Time) *CapacityReservation { - s.EndDate = &v +// SetClientCidrBlock sets the ClientCidrBlock field's value. +func (s *CreateClientVpnEndpointInput) SetClientCidrBlock(v string) *CreateClientVpnEndpointInput { + s.ClientCidrBlock = &v return s } -// SetEndDateType sets the EndDateType field's value. -func (s *CapacityReservation) SetEndDateType(v string) *CapacityReservation { - s.EndDateType = &v +// SetClientToken sets the ClientToken field's value. +func (s *CreateClientVpnEndpointInput) SetClientToken(v string) *CreateClientVpnEndpointInput { + s.ClientToken = &v return s } -// SetEphemeralStorage sets the EphemeralStorage field's value. -func (s *CapacityReservation) SetEphemeralStorage(v bool) *CapacityReservation { - s.EphemeralStorage = &v +// SetConnectionLogOptions sets the ConnectionLogOptions field's value. +func (s *CreateClientVpnEndpointInput) SetConnectionLogOptions(v *ConnectionLogOptions) *CreateClientVpnEndpointInput { + s.ConnectionLogOptions = v return s } -// SetInstanceMatchCriteria sets the InstanceMatchCriteria field's value. -func (s *CapacityReservation) SetInstanceMatchCriteria(v string) *CapacityReservation { - s.InstanceMatchCriteria = &v +// SetDescription sets the Description field's value. +func (s *CreateClientVpnEndpointInput) SetDescription(v string) *CreateClientVpnEndpointInput { + s.Description = &v return s } -// SetInstancePlatform sets the InstancePlatform field's value. -func (s *CapacityReservation) SetInstancePlatform(v string) *CapacityReservation { - s.InstancePlatform = &v +// SetDnsServers sets the DnsServers field's value. +func (s *CreateClientVpnEndpointInput) SetDnsServers(v []*string) *CreateClientVpnEndpointInput { + s.DnsServers = v return s } -// SetInstanceType sets the InstanceType field's value. -func (s *CapacityReservation) SetInstanceType(v string) *CapacityReservation { - s.InstanceType = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateClientVpnEndpointInput) SetDryRun(v bool) *CreateClientVpnEndpointInput { + s.DryRun = &v return s } -// SetOwnerId sets the OwnerId field's value. -func (s *CapacityReservation) SetOwnerId(v string) *CapacityReservation { - s.OwnerId = &v +// SetServerCertificateArn sets the ServerCertificateArn field's value. +func (s *CreateClientVpnEndpointInput) SetServerCertificateArn(v string) *CreateClientVpnEndpointInput { + s.ServerCertificateArn = &v return s } -// SetState sets the State field's value. -func (s *CapacityReservation) SetState(v string) *CapacityReservation { - s.State = &v +// SetSplitTunnel sets the SplitTunnel field's value. +func (s *CreateClientVpnEndpointInput) SetSplitTunnel(v bool) *CreateClientVpnEndpointInput { + s.SplitTunnel = &v return s } -// SetTags sets the Tags field's value. -func (s *CapacityReservation) SetTags(v []*Tag) *CapacityReservation { - s.Tags = v +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateClientVpnEndpointInput) SetTagSpecifications(v []*TagSpecification) *CreateClientVpnEndpointInput { + s.TagSpecifications = v return s } -// SetTenancy sets the Tenancy field's value. -func (s *CapacityReservation) SetTenancy(v string) *CapacityReservation { - s.Tenancy = &v +// SetTransportProtocol sets the TransportProtocol field's value. +func (s *CreateClientVpnEndpointInput) SetTransportProtocol(v string) *CreateClientVpnEndpointInput { + s.TransportProtocol = &v return s } -// SetTotalInstanceCount sets the TotalInstanceCount field's value. -func (s *CapacityReservation) SetTotalInstanceCount(v int64) *CapacityReservation { - s.TotalInstanceCount = &v +// SetVpnPort sets the VpnPort field's value. +func (s *CreateClientVpnEndpointInput) SetVpnPort(v int64) *CreateClientVpnEndpointInput { + s.VpnPort = &v return s } -// Describes an instance's Capacity Reservation targeting option. You can specify -// only one parameter at a time. If you specify CapacityReservationPreference -// and CapacityReservationTarget, the request fails. -// -// Use the CapacityReservationPreference parameter to configure the instance -// to run as an On-Demand Instance or to run in any open Capacity Reservation -// that has matching attributes (instance type, platform, Availability Zone). -// Use the CapacityReservationTarget parameter to explicitly target a specific -// Capacity Reservation. -type CapacityReservationSpecification struct { +type CreateClientVpnEndpointOutput struct { _ struct{} `type:"structure"` - // Indicates the instance's Capacity Reservation preferences. Possible preferences - // include: - // - // * open - The instance can run in any open Capacity Reservation that has - // matching attributes (instance type, platform, Availability Zone). - // - // * none - The instance avoids running in a Capacity Reservation even if - // one is available. The instance runs as an On-Demand Instance. - CapacityReservationPreference *string `type:"string" enum:"CapacityReservationPreference"` + // The ID of the Client VPN endpoint. + ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"` - // Information about the target Capacity Reservation. - CapacityReservationTarget *CapacityReservationTarget `type:"structure"` + // The DNS name to be used by clients when establishing their VPN session. + DnsName *string `locationName:"dnsName" type:"string"` + + // The current state of the Client VPN endpoint. + Status *ClientVpnEndpointStatus `locationName:"status" type:"structure"` } // String returns the string representation -func (s CapacityReservationSpecification) String() string { +func (s CreateClientVpnEndpointOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CapacityReservationSpecification) GoString() string { +func (s CreateClientVpnEndpointOutput) GoString() string { return s.String() } -// SetCapacityReservationPreference sets the CapacityReservationPreference field's value. -func (s *CapacityReservationSpecification) SetCapacityReservationPreference(v string) *CapacityReservationSpecification { - s.CapacityReservationPreference = &v +// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. +func (s *CreateClientVpnEndpointOutput) SetClientVpnEndpointId(v string) *CreateClientVpnEndpointOutput { + s.ClientVpnEndpointId = &v return s } -// SetCapacityReservationTarget sets the CapacityReservationTarget field's value. -func (s *CapacityReservationSpecification) SetCapacityReservationTarget(v *CapacityReservationTarget) *CapacityReservationSpecification { - s.CapacityReservationTarget = v +// SetDnsName sets the DnsName field's value. +func (s *CreateClientVpnEndpointOutput) SetDnsName(v string) *CreateClientVpnEndpointOutput { + s.DnsName = &v return s } -// Describes the instance's Capacity Reservation targeting preferences. The -// action returns the capacityReservationPreference response element if the -// instance is configured to run in On-Demand capacity, or if it is configured -// in run in any open Capacity Reservation that has matching attributes (instance -// type, platform, Availability Zone). The action returns the capacityReservationTarget -// response element if the instance explicily targets a specific Capacity Reservation. -type CapacityReservationSpecificationResponse struct { +// SetStatus sets the Status field's value. +func (s *CreateClientVpnEndpointOutput) SetStatus(v *ClientVpnEndpointStatus) *CreateClientVpnEndpointOutput { + s.Status = v + return s +} + +type CreateClientVpnRouteInput struct { _ struct{} `type:"structure"` - // Describes the instance's Capacity Reservation preferences. Possible preferences - // include: + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `type:"string" idempotencyToken:"true"` + + // The ID of the Client VPN endpoint to which to add the route. // - // * open - The instance can run in any open Capacity Reservation that has - // matching attributes (instance type, platform, Availability Zone). + // ClientVpnEndpointId is a required field + ClientVpnEndpointId *string `type:"string" required:"true"` + + // A brief description of the route. + Description *string `type:"string"` + + // The IPv4 address range, in CIDR notation, of the route destination. For example: // - // * none - The instance avoids running in a Capacity Reservation even if - // one is available. The instance runs in On-Demand capacity. - CapacityReservationPreference *string `locationName:"capacityReservationPreference" type:"string" enum:"CapacityReservationPreference"` + // * To add a route for Internet access, enter 0.0.0.0/0 + // + // * To add a route for a peered VPC, enter the peered VPC's IPv4 CIDR range + // + // * To add a route for an on-premises network, enter the AWS Site-to-Site + // VPN connection's IPv4 CIDR range + // + // Route address ranges cannot overlap with the CIDR range specified for client + // allocation. + // + // DestinationCidrBlock is a required field + DestinationCidrBlock *string `type:"string" required:"true"` - // Information about the targeted Capacity Reservation. - CapacityReservationTarget *CapacityReservationTargetResponse `locationName:"capacityReservationTarget" 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 subnet through which you want to route traffic. The specified + // subnet must be an existing target network of the Client VPN endpoint. + // + // TargetVpcSubnetId is a required field + TargetVpcSubnetId *string `type:"string" required:"true"` } // String returns the string representation -func (s CapacityReservationSpecificationResponse) String() string { +func (s CreateClientVpnRouteInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CapacityReservationSpecificationResponse) GoString() string { +func (s CreateClientVpnRouteInput) GoString() string { return s.String() } -// SetCapacityReservationPreference sets the CapacityReservationPreference field's value. -func (s *CapacityReservationSpecificationResponse) SetCapacityReservationPreference(v string) *CapacityReservationSpecificationResponse { - s.CapacityReservationPreference = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateClientVpnRouteInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateClientVpnRouteInput"} + if s.ClientVpnEndpointId == nil { + invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) + } + if s.DestinationCidrBlock == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock")) + } + if s.TargetVpcSubnetId == nil { + invalidParams.Add(request.NewErrParamRequired("TargetVpcSubnetId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateClientVpnRouteInput) SetClientToken(v string) *CreateClientVpnRouteInput { + s.ClientToken = &v return s } -// SetCapacityReservationTarget sets the CapacityReservationTarget field's value. -func (s *CapacityReservationSpecificationResponse) SetCapacityReservationTarget(v *CapacityReservationTargetResponse) *CapacityReservationSpecificationResponse { - s.CapacityReservationTarget = v +// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. +func (s *CreateClientVpnRouteInput) SetClientVpnEndpointId(v string) *CreateClientVpnRouteInput { + s.ClientVpnEndpointId = &v return s } -// Describes a target Capacity Reservation. -type CapacityReservationTarget struct { +// SetDescription sets the Description field's value. +func (s *CreateClientVpnRouteInput) SetDescription(v string) *CreateClientVpnRouteInput { + s.Description = &v + return s +} + +// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. +func (s *CreateClientVpnRouteInput) SetDestinationCidrBlock(v string) *CreateClientVpnRouteInput { + s.DestinationCidrBlock = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *CreateClientVpnRouteInput) SetDryRun(v bool) *CreateClientVpnRouteInput { + s.DryRun = &v + return s +} + +// SetTargetVpcSubnetId sets the TargetVpcSubnetId field's value. +func (s *CreateClientVpnRouteInput) SetTargetVpcSubnetId(v string) *CreateClientVpnRouteInput { + s.TargetVpcSubnetId = &v + return s +} + +type CreateClientVpnRouteOutput struct { _ struct{} `type:"structure"` - // The ID of the Capacity Reservation. - CapacityReservationId *string `type:"string"` + // The current state of the route. + Status *ClientVpnRouteStatus `locationName:"status" type:"structure"` } // String returns the string representation -func (s CapacityReservationTarget) String() string { +func (s CreateClientVpnRouteOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CapacityReservationTarget) GoString() string { +func (s CreateClientVpnRouteOutput) GoString() string { return s.String() } -// SetCapacityReservationId sets the CapacityReservationId field's value. -func (s *CapacityReservationTarget) SetCapacityReservationId(v string) *CapacityReservationTarget { - s.CapacityReservationId = &v +// SetStatus sets the Status field's value. +func (s *CreateClientVpnRouteOutput) SetStatus(v *ClientVpnRouteStatus) *CreateClientVpnRouteOutput { + s.Status = v return s } -// Describes a target Capacity Reservation. -type CapacityReservationTargetResponse struct { +// Contains the parameters for CreateCustomerGateway. +type CreateCustomerGatewayInput struct { _ struct{} `type:"structure"` - // The ID of the Capacity Reservation. - CapacityReservationId *string `locationName:"capacityReservationId" type:"string"` + // For devices that support BGP, the customer gateway's BGP ASN. + // + // Default: 65000 + // + // BgpAsn is a required field + BgpAsn *int64 `type:"integer" required:"true"` + + // The Amazon Resource Name (ARN) for the customer gateway certificate. + CertificateArn *string `type:"string"` + + // A name for the customer gateway device. + // + // Length Constraints: Up to 255 characters. + DeviceName *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 Internet-routable IP address for the customer gateway's outside interface. + // The address must be static. + PublicIp *string `locationName:"IpAddress" type:"string"` + + // 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 CapacityReservationTargetResponse) String() string { +func (s CreateCustomerGatewayInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CapacityReservationTargetResponse) GoString() string { +func (s CreateCustomerGatewayInput) GoString() string { return s.String() } -// SetCapacityReservationId sets the CapacityReservationId field's value. -func (s *CapacityReservationTargetResponse) SetCapacityReservationId(v string) *CapacityReservationTargetResponse { - s.CapacityReservationId = &v +// 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.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 } -// Information about the client certificate used for authentication. -type CertificateAuthentication struct { - _ struct{} `type:"structure"` +// SetCertificateArn sets the CertificateArn field's value. +func (s *CreateCustomerGatewayInput) SetCertificateArn(v string) *CreateCustomerGatewayInput { + s.CertificateArn = &v + return s +} - // The ARN of the client certificate. - ClientRootCertificateChain *string `locationName:"clientRootCertificateChain" type:"string"` +// SetDeviceName sets the DeviceName field's value. +func (s *CreateCustomerGatewayInput) SetDeviceName(v string) *CreateCustomerGatewayInput { + s.DeviceName = &v + return s } -// String returns the string representation -func (s CertificateAuthentication) String() string { - return awsutil.Prettify(s) +// SetDryRun sets the DryRun field's value. +func (s *CreateCustomerGatewayInput) SetDryRun(v bool) *CreateCustomerGatewayInput { + s.DryRun = &v + return s } -// GoString returns the string representation -func (s CertificateAuthentication) GoString() string { - return s.String() +// SetPublicIp sets the PublicIp field's value. +func (s *CreateCustomerGatewayInput) SetPublicIp(v string) *CreateCustomerGatewayInput { + s.PublicIp = &v + return s } -// SetClientRootCertificateChain sets the ClientRootCertificateChain field's value. -func (s *CertificateAuthentication) SetClientRootCertificateChain(v string) *CertificateAuthentication { - s.ClientRootCertificateChain = &v +// SetType sets the Type field's value. +func (s *CreateCustomerGatewayInput) SetType(v string) *CreateCustomerGatewayInput { + s.Type = &v return s } -// Information about the client certificate to be used for authentication. -type CertificateAuthenticationRequest struct { +// Contains the output of CreateCustomerGateway. +type CreateCustomerGatewayOutput struct { _ struct{} `type:"structure"` - // The ARN of the client certificate. The certificate must be signed by a certificate - // authority (CA) and it must be provisioned in AWS Certificate Manager (ACM). - ClientRootCertificateChainArn *string `type:"string"` + // Information about the customer gateway. + CustomerGateway *CustomerGateway `locationName:"customerGateway" type:"structure"` } // String returns the string representation -func (s CertificateAuthenticationRequest) String() string { +func (s CreateCustomerGatewayOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CertificateAuthenticationRequest) GoString() string { +func (s CreateCustomerGatewayOutput) GoString() string { return s.String() } -// SetClientRootCertificateChainArn sets the ClientRootCertificateChainArn field's value. -func (s *CertificateAuthenticationRequest) SetClientRootCertificateChainArn(v string) *CertificateAuthenticationRequest { - s.ClientRootCertificateChainArn = &v +// SetCustomerGateway sets the CustomerGateway field's value. +func (s *CreateCustomerGatewayOutput) SetCustomerGateway(v *CustomerGateway) *CreateCustomerGatewayOutput { + s.CustomerGateway = v return s } -// Provides authorization for Amazon to bring a specific IP address range to -// a specific AWS account using bring your own IP addresses (BYOIP). For more -// information, see Prepare to Bring Your Address Range to Your AWS Account -// (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-byoip.html#prepare-for-byoip) -// in the Amazon Elastic Compute Cloud User Guide. -type CidrAuthorizationContext struct { +type CreateDefaultSubnetInput struct { _ struct{} `type:"structure"` - // The plain-text authorization message for the prefix and account. + // The Availability Zone in which to create the default subnet. // - // Message is a required field - Message *string `type:"string" required:"true"` + // AvailabilityZone is a required field + AvailabilityZone *string `type:"string" required:"true"` - // The signed authorization message for the prefix and account. - // - // Signature is a required field - Signature *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 `type:"boolean"` } // String returns the string representation -func (s CidrAuthorizationContext) String() string { +func (s CreateDefaultSubnetInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CidrAuthorizationContext) GoString() string { +func (s CreateDefaultSubnetInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CidrAuthorizationContext) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CidrAuthorizationContext"} - if s.Message == nil { - invalidParams.Add(request.NewErrParamRequired("Message")) - } - if s.Signature == nil { - invalidParams.Add(request.NewErrParamRequired("Signature")) +func (s *CreateDefaultSubnetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateDefaultSubnetInput"} + if s.AvailabilityZone == nil { + invalidParams.Add(request.NewErrParamRequired("AvailabilityZone")) } if invalidParams.Len() > 0 { @@ -37350,174 +44775,197 @@ func (s *CidrAuthorizationContext) Validate() error { return nil } -// SetMessage sets the Message field's value. -func (s *CidrAuthorizationContext) SetMessage(v string) *CidrAuthorizationContext { - s.Message = &v +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *CreateDefaultSubnetInput) SetAvailabilityZone(v string) *CreateDefaultSubnetInput { + s.AvailabilityZone = &v return s } -// SetSignature sets the Signature field's value. -func (s *CidrAuthorizationContext) SetSignature(v string) *CidrAuthorizationContext { - s.Signature = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateDefaultSubnetInput) SetDryRun(v bool) *CreateDefaultSubnetInput { + s.DryRun = &v return s } -// Describes an IPv4 CIDR block. -type CidrBlock struct { +type CreateDefaultSubnetOutput struct { _ struct{} `type:"structure"` - // The IPv4 CIDR block. - CidrBlock *string `locationName:"cidrBlock" type:"string"` + // Information about the subnet. + Subnet *Subnet `locationName:"subnet" type:"structure"` } // String returns the string representation -func (s CidrBlock) String() string { +func (s CreateDefaultSubnetOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CidrBlock) GoString() string { +func (s CreateDefaultSubnetOutput) GoString() string { return s.String() } -// SetCidrBlock sets the CidrBlock field's value. -func (s *CidrBlock) SetCidrBlock(v string) *CidrBlock { - s.CidrBlock = &v +// SetSubnet sets the Subnet field's value. +func (s *CreateDefaultSubnetOutput) SetSubnet(v *Subnet) *CreateDefaultSubnetOutput { + s.Subnet = v return s } -// Describes the ClassicLink DNS support status of a VPC. -type ClassicLinkDnsSupport struct { +type CreateDefaultVpcInput 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"` + // Checks whether you have the required permissions for the action, without + // actually making 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"` } // String returns the string representation -func (s ClassicLinkDnsSupport) String() string { +func (s CreateDefaultVpcInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClassicLinkDnsSupport) GoString() string { +func (s CreateDefaultVpcInput) GoString() string { return s.String() } -// SetClassicLinkDnsSupported sets the ClassicLinkDnsSupported field's value. -func (s *ClassicLinkDnsSupport) SetClassicLinkDnsSupported(v bool) *ClassicLinkDnsSupport { - s.ClassicLinkDnsSupported = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateDefaultVpcInput) SetDryRun(v bool) *CreateDefaultVpcInput { + s.DryRun = &v return s } -// SetVpcId sets the VpcId field's value. -func (s *ClassicLinkDnsSupport) SetVpcId(v string) *ClassicLinkDnsSupport { - s.VpcId = &v - return s +type CreateDefaultVpcOutput struct { + _ struct{} `type:"structure"` + + // Information about the VPC. + Vpc *Vpc `locationName:"vpc" type:"structure"` } -// Describes a linked EC2-Classic instance. -type ClassicLinkInstance struct { - _ struct{} `type:"structure"` +// String returns the string representation +func (s CreateDefaultVpcOutput) String() string { + return awsutil.Prettify(s) +} - // A list of security groups. - Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` +// GoString returns the string representation +func (s CreateDefaultVpcOutput) GoString() string { + return s.String() +} - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` +// SetVpc sets the Vpc field's value. +func (s *CreateDefaultVpcOutput) SetVpc(v *Vpc) *CreateDefaultVpcOutput { + s.Vpc = v + return s +} - // Any tags assigned to the instance. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` +type CreateDhcpOptionsInput struct { + _ struct{} `type:"structure"` - // The ID of the VPC. - VpcId *string `locationName:"vpcId" type:"string"` + // 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 ClassicLinkInstance) String() string { +func (s CreateDhcpOptionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClassicLinkInstance) GoString() string { +func (s CreateDhcpOptionsInput) GoString() string { return s.String() } -// SetGroups sets the Groups field's value. -func (s *ClassicLinkInstance) SetGroups(v []*GroupIdentifier) *ClassicLinkInstance { - s.Groups = v - return s -} +// 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")) + } -// SetInstanceId sets the InstanceId field's value. -func (s *ClassicLinkInstance) SetInstanceId(v string) *ClassicLinkInstance { - s.InstanceId = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetTags sets the Tags field's value. -func (s *ClassicLinkInstance) SetTags(v []*Tag) *ClassicLinkInstance { - s.Tags = v +// SetDhcpConfigurations sets the DhcpConfigurations field's value. +func (s *CreateDhcpOptionsInput) SetDhcpConfigurations(v []*NewDhcpConfiguration) *CreateDhcpOptionsInput { + s.DhcpConfigurations = v return s } -// SetVpcId sets the VpcId field's value. -func (s *ClassicLinkInstance) SetVpcId(v string) *ClassicLinkInstance { - s.VpcId = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateDhcpOptionsInput) SetDryRun(v bool) *CreateDhcpOptionsInput { + s.DryRun = &v return s } -// Describes a Classic Load Balancer. -type ClassicLoadBalancer struct { +type CreateDhcpOptionsOutput struct { _ struct{} `type:"structure"` - // The name of the load balancer. - Name *string `locationName:"name" type:"string"` + // A set of DHCP options. + DhcpOptions *DhcpOptions `locationName:"dhcpOptions" type:"structure"` } // String returns the string representation -func (s ClassicLoadBalancer) String() string { +func (s CreateDhcpOptionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClassicLoadBalancer) GoString() string { +func (s CreateDhcpOptionsOutput) GoString() string { return s.String() } -// SetName sets the Name field's value. -func (s *ClassicLoadBalancer) SetName(v string) *ClassicLoadBalancer { - s.Name = &v +// SetDhcpOptions sets the DhcpOptions field's value. +func (s *CreateDhcpOptionsOutput) SetDhcpOptions(v *DhcpOptions) *CreateDhcpOptionsOutput { + s.DhcpOptions = v return s } -// Describes the Classic Load Balancers to attach to a Spot Fleet. Spot Fleet -// registers the running Spot Instances with these Classic Load Balancers. -type ClassicLoadBalancersConfig struct { +type CreateEgressOnlyInternetGatewayInput struct { _ struct{} `type:"structure"` - // One or more Classic Load Balancers. - ClassicLoadBalancers []*ClassicLoadBalancer `locationName:"classicLoadBalancers" locationNameList:"item" min:"1" type:"list"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://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 ClassicLoadBalancersConfig) String() string { +func (s CreateEgressOnlyInternetGatewayInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClassicLoadBalancersConfig) GoString() string { +func (s CreateEgressOnlyInternetGatewayInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ClassicLoadBalancersConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ClassicLoadBalancersConfig"} - if s.ClassicLoadBalancers != nil && len(s.ClassicLoadBalancers) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClassicLoadBalancers", 1)) +func (s *CreateEgressOnlyInternetGatewayInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateEgressOnlyInternetGatewayInput"} + if s.VpcId == nil { + invalidParams.Add(request.NewErrParamRequired("VpcId")) } if invalidParams.Len() > 0 { @@ -37526,758 +44974,937 @@ func (s *ClassicLoadBalancersConfig) Validate() error { return nil } -// SetClassicLoadBalancers sets the ClassicLoadBalancers field's value. -func (s *ClassicLoadBalancersConfig) SetClassicLoadBalancers(v []*ClassicLoadBalancer) *ClassicLoadBalancersConfig { - s.ClassicLoadBalancers = v +// SetClientToken sets the ClientToken field's value. +func (s *CreateEgressOnlyInternetGatewayInput) SetClientToken(v string) *CreateEgressOnlyInternetGatewayInput { + s.ClientToken = &v return s } -// Describes the state of a client certificate revocation list. -type ClientCertificateRevocationListStatus struct { +// 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 +} + +type CreateEgressOnlyInternetGatewayOutput struct { _ struct{} `type:"structure"` - // The state of the client certificate revocation list. - Code *string `locationName:"code" type:"string" enum:"ClientCertificateRevocationListStatusCode"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string `locationName:"clientToken" type:"string"` - // A message about the status of the client certificate revocation list, if - // applicable. - Message *string `locationName:"message" type:"string"` + // Information about the egress-only internet gateway. + EgressOnlyInternetGateway *EgressOnlyInternetGateway `locationName:"egressOnlyInternetGateway" type:"structure"` } // String returns the string representation -func (s ClientCertificateRevocationListStatus) String() string { +func (s CreateEgressOnlyInternetGatewayOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClientCertificateRevocationListStatus) GoString() string { +func (s CreateEgressOnlyInternetGatewayOutput) GoString() string { return s.String() } -// SetCode sets the Code field's value. -func (s *ClientCertificateRevocationListStatus) SetCode(v string) *ClientCertificateRevocationListStatus { - s.Code = &v +// SetClientToken sets the ClientToken field's value. +func (s *CreateEgressOnlyInternetGatewayOutput) SetClientToken(v string) *CreateEgressOnlyInternetGatewayOutput { + s.ClientToken = &v return s } -// SetMessage sets the Message field's value. -func (s *ClientCertificateRevocationListStatus) SetMessage(v string) *ClientCertificateRevocationListStatus { - s.Message = &v +// SetEgressOnlyInternetGateway sets the EgressOnlyInternetGateway field's value. +func (s *CreateEgressOnlyInternetGatewayOutput) SetEgressOnlyInternetGateway(v *EgressOnlyInternetGateway) *CreateEgressOnlyInternetGatewayOutput { + s.EgressOnlyInternetGateway = v return s } -// Describes the client-specific data. -type ClientData struct { +// Describes the instances that could not be launched by the fleet. +type CreateFleetError struct { _ struct{} `type:"structure"` - // A user-defined comment about the disk upload. - Comment *string `type:"string"` + // The error code that indicates why the instance could not be launched. For + // more information about error codes, see Error Codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html.html). + ErrorCode *string `locationName:"errorCode" type:"string"` - // The time that the disk upload ends. - UploadEnd *time.Time `type:"timestamp"` + // The error message that describes why the instance could not be launched. + // For more information about error messages, see Error Codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html.html). + ErrorMessage *string `locationName:"errorMessage" type:"string"` - // The size of the uploaded disk image, in GiB. - UploadSize *float64 `type:"double"` + // The launch templates and overrides that were used for launching the instances. + // The values that you specify in the Overrides replace the values in the launch + // template. + LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse `locationName:"launchTemplateAndOverrides" type:"structure"` - // The time that the disk upload starts. - UploadStart *time.Time `type:"timestamp"` + // Indicates if the instance that could not be launched was a Spot Instance + // or On-Demand Instance. + Lifecycle *string `locationName:"lifecycle" type:"string" enum:"InstanceLifecycle"` } // String returns the string representation -func (s ClientData) String() string { +func (s CreateFleetError) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClientData) GoString() string { +func (s CreateFleetError) GoString() string { return s.String() } -// SetComment sets the Comment field's value. -func (s *ClientData) SetComment(v string) *ClientData { - s.Comment = &v +// SetErrorCode sets the ErrorCode field's value. +func (s *CreateFleetError) SetErrorCode(v string) *CreateFleetError { + s.ErrorCode = &v return s } -// SetUploadEnd sets the UploadEnd field's value. -func (s *ClientData) SetUploadEnd(v time.Time) *ClientData { - s.UploadEnd = &v +// SetErrorMessage sets the ErrorMessage field's value. +func (s *CreateFleetError) SetErrorMessage(v string) *CreateFleetError { + s.ErrorMessage = &v return s } -// SetUploadSize sets the UploadSize field's value. -func (s *ClientData) SetUploadSize(v float64) *ClientData { - s.UploadSize = &v +// SetLaunchTemplateAndOverrides sets the LaunchTemplateAndOverrides field's value. +func (s *CreateFleetError) SetLaunchTemplateAndOverrides(v *LaunchTemplateAndOverridesResponse) *CreateFleetError { + s.LaunchTemplateAndOverrides = v return s } -// SetUploadStart sets the UploadStart field's value. -func (s *ClientData) SetUploadStart(v time.Time) *ClientData { - s.UploadStart = &v +// SetLifecycle sets the Lifecycle field's value. +func (s *CreateFleetError) SetLifecycle(v string) *CreateFleetError { + s.Lifecycle = &v return s } -// Describes the authentication methods used by a Client VPN endpoint. Client -// VPN supports Active Directory and mutual authentication. For more information, -// see Authentication (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/authentication-authrization.html#client-authentication) -// in the AWS Client VPN Administrator Guide. -type ClientVpnAuthentication struct { +type CreateFleetInput struct { _ struct{} `type:"structure"` - // Information about the Active Directory, if applicable. - ActiveDirectory *DirectoryServiceAuthentication `locationName:"activeDirectory" type:"structure"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `type:"string"` - // Information about the authentication certificates, if applicable. - MutualAuthentication *CertificateAuthentication `locationName:"mutualAuthentication" 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 authentication type used. - Type *string `locationName:"type" type:"string" enum:"ClientVpnAuthenticationType"` + // Indicates whether running instances should be terminated if the total target + // capacity of the EC2 Fleet is decreased below the current size of the EC2 + // Fleet. + ExcessCapacityTerminationPolicy *string `type:"string" enum:"FleetExcessCapacityTerminationPolicy"` + + // The configuration for the EC2 Fleet. + // + // LaunchTemplateConfigs is a required field + LaunchTemplateConfigs []*FleetLaunchTemplateConfigRequest `locationNameList:"item" type:"list" required:"true"` + + // Describes the configuration of On-Demand Instances in an EC2 Fleet. + OnDemandOptions *OnDemandOptionsRequest `type:"structure"` + + // Indicates whether EC2 Fleet should replace unhealthy instances. + ReplaceUnhealthyInstances *bool `type:"boolean"` + + // Describes the configuration of Spot Instances in an EC2 Fleet. + SpotOptions *SpotOptionsRequest `type:"structure"` + + // The key-value pair for tagging the EC2 Fleet request on creation. The value + // for ResourceType must be fleet, otherwise the fleet request fails. To tag + // instances at launch, specify the tags in the launch template (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template). + // For information about tagging after launch, see Tagging Your Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources). + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + + // The number of units to request. + // + // TargetCapacitySpecification is a required field + TargetCapacitySpecification *TargetCapacitySpecificationRequest `type:"structure" required:"true"` + + // Indicates whether running instances should be terminated when the EC2 Fleet + // expires. + TerminateInstancesWithExpiration *bool `type:"boolean"` + + // The type of the request. By default, the EC2 Fleet places an asynchronous + // request for your desired capacity, and maintains it by replenishing interrupted + // Spot Instances (maintain). A value of instant places a synchronous one-time + // request, and returns errors for any instances that could not be launched. + // A value of request places an asynchronous one-time request without maintaining + // capacity or submitting requests in alternative capacity pools if capacity + // is unavailable. For more information, see EC2 Fleet Request Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-configuration-strategies.html#ec2-fleet-request-type) + // in the Amazon Elastic Compute Cloud User Guide. + Type *string `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 `type:"timestamp"` + + // The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). + // At this point, no new EC2 Fleet requests are placed or able to fulfill the + // request. If no value is specified, the request remains until you cancel it. + ValidUntil *time.Time `type:"timestamp"` } // String returns the string representation -func (s ClientVpnAuthentication) String() string { +func (s CreateFleetInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClientVpnAuthentication) GoString() string { +func (s CreateFleetInput) GoString() string { return s.String() } -// SetActiveDirectory sets the ActiveDirectory field's value. -func (s *ClientVpnAuthentication) SetActiveDirectory(v *DirectoryServiceAuthentication) *ClientVpnAuthentication { - s.ActiveDirectory = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateFleetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateFleetInput"} + if s.LaunchTemplateConfigs == nil { + invalidParams.Add(request.NewErrParamRequired("LaunchTemplateConfigs")) + } + if s.TargetCapacitySpecification == nil { + invalidParams.Add(request.NewErrParamRequired("TargetCapacitySpecification")) + } + if s.LaunchTemplateConfigs != nil { + for i, v := range s.LaunchTemplateConfigs { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LaunchTemplateConfigs", i), err.(request.ErrInvalidParams)) + } + } + } + if s.TargetCapacitySpecification != nil { + if err := s.TargetCapacitySpecification.Validate(); err != nil { + invalidParams.AddNested("TargetCapacitySpecification", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateFleetInput) SetClientToken(v string) *CreateFleetInput { + s.ClientToken = &v return s } -// SetMutualAuthentication sets the MutualAuthentication field's value. -func (s *ClientVpnAuthentication) SetMutualAuthentication(v *CertificateAuthentication) *ClientVpnAuthentication { - s.MutualAuthentication = v +// SetDryRun sets the DryRun field's value. +func (s *CreateFleetInput) SetDryRun(v bool) *CreateFleetInput { + s.DryRun = &v + return s +} + +// SetExcessCapacityTerminationPolicy sets the ExcessCapacityTerminationPolicy field's value. +func (s *CreateFleetInput) SetExcessCapacityTerminationPolicy(v string) *CreateFleetInput { + s.ExcessCapacityTerminationPolicy = &v + return s +} + +// SetLaunchTemplateConfigs sets the LaunchTemplateConfigs field's value. +func (s *CreateFleetInput) SetLaunchTemplateConfigs(v []*FleetLaunchTemplateConfigRequest) *CreateFleetInput { + s.LaunchTemplateConfigs = v + return s +} + +// SetOnDemandOptions sets the OnDemandOptions field's value. +func (s *CreateFleetInput) SetOnDemandOptions(v *OnDemandOptionsRequest) *CreateFleetInput { + s.OnDemandOptions = v + return s +} + +// SetReplaceUnhealthyInstances sets the ReplaceUnhealthyInstances field's value. +func (s *CreateFleetInput) SetReplaceUnhealthyInstances(v bool) *CreateFleetInput { + s.ReplaceUnhealthyInstances = &v + return s +} + +// SetSpotOptions sets the SpotOptions field's value. +func (s *CreateFleetInput) SetSpotOptions(v *SpotOptionsRequest) *CreateFleetInput { + s.SpotOptions = v + return s +} + +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateFleetInput) SetTagSpecifications(v []*TagSpecification) *CreateFleetInput { + s.TagSpecifications = v + return s +} + +// SetTargetCapacitySpecification sets the TargetCapacitySpecification field's value. +func (s *CreateFleetInput) SetTargetCapacitySpecification(v *TargetCapacitySpecificationRequest) *CreateFleetInput { + s.TargetCapacitySpecification = v + return s +} + +// SetTerminateInstancesWithExpiration sets the TerminateInstancesWithExpiration field's value. +func (s *CreateFleetInput) SetTerminateInstancesWithExpiration(v bool) *CreateFleetInput { + s.TerminateInstancesWithExpiration = &v return s } // SetType sets the Type field's value. -func (s *ClientVpnAuthentication) SetType(v string) *ClientVpnAuthentication { +func (s *CreateFleetInput) SetType(v string) *CreateFleetInput { s.Type = &v return s } -// Describes the authentication method to be used by a Client VPN endpoint. -// Client VPN supports Active Directory and mutual authentication. For more -// information, see Authentication (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/authentication-authrization.html#client-authentication) -// in the AWS Client VPN Administrator Guide. -type ClientVpnAuthenticationRequest struct { +// SetValidFrom sets the ValidFrom field's value. +func (s *CreateFleetInput) SetValidFrom(v time.Time) *CreateFleetInput { + s.ValidFrom = &v + return s +} + +// SetValidUntil sets the ValidUntil field's value. +func (s *CreateFleetInput) SetValidUntil(v time.Time) *CreateFleetInput { + s.ValidUntil = &v + return s +} + +// Describes the instances that were launched by the fleet. +type CreateFleetInstance struct { _ struct{} `type:"structure"` - // Information about the Active Directory to be used, if applicable. You must - // provide this information if Type is directory-service-authentication. - ActiveDirectory *DirectoryServiceAuthenticationRequest `type:"structure"` + // The IDs of the instances. + InstanceIds []*string `locationName:"instanceIds" locationNameList:"item" type:"list"` - // Information about the authentication certificates to be used, if applicable. - // You must provide this information if Type is certificate-authentication. - MutualAuthentication *CertificateAuthenticationRequest `type:"structure"` + // The instance type. + InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` - // The type of client authentication to be used. Specify certificate-authentication - // to use certificate-based authentication, or directory-service-authentication - // to use Active Directory authentication. - Type *string `type:"string" enum:"ClientVpnAuthenticationType"` + // The launch templates and overrides that were used for launching the instances. + // The values that you specify in the Overrides replace the values in the launch + // template. + LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse `locationName:"launchTemplateAndOverrides" type:"structure"` + + // Indicates if the instance that was launched is a Spot Instance or On-Demand + // Instance. + Lifecycle *string `locationName:"lifecycle" type:"string" enum:"InstanceLifecycle"` + + // The value is Windows for Windows instances. Otherwise, the value is blank. + Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` } // String returns the string representation -func (s ClientVpnAuthenticationRequest) String() string { +func (s CreateFleetInstance) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClientVpnAuthenticationRequest) GoString() string { +func (s CreateFleetInstance) GoString() string { return s.String() } -// SetActiveDirectory sets the ActiveDirectory field's value. -func (s *ClientVpnAuthenticationRequest) SetActiveDirectory(v *DirectoryServiceAuthenticationRequest) *ClientVpnAuthenticationRequest { - s.ActiveDirectory = v +// SetInstanceIds sets the InstanceIds field's value. +func (s *CreateFleetInstance) SetInstanceIds(v []*string) *CreateFleetInstance { + s.InstanceIds = v return s } -// SetMutualAuthentication sets the MutualAuthentication field's value. -func (s *ClientVpnAuthenticationRequest) SetMutualAuthentication(v *CertificateAuthenticationRequest) *ClientVpnAuthenticationRequest { - s.MutualAuthentication = v +// SetInstanceType sets the InstanceType field's value. +func (s *CreateFleetInstance) SetInstanceType(v string) *CreateFleetInstance { + s.InstanceType = &v return s } -// SetType sets the Type field's value. -func (s *ClientVpnAuthenticationRequest) SetType(v string) *ClientVpnAuthenticationRequest { - s.Type = &v +// SetLaunchTemplateAndOverrides sets the LaunchTemplateAndOverrides field's value. +func (s *CreateFleetInstance) SetLaunchTemplateAndOverrides(v *LaunchTemplateAndOverridesResponse) *CreateFleetInstance { + s.LaunchTemplateAndOverrides = v return s } -// Describes the state of an authorization rule. -type ClientVpnAuthorizationRuleStatus struct { +// SetLifecycle sets the Lifecycle field's value. +func (s *CreateFleetInstance) SetLifecycle(v string) *CreateFleetInstance { + s.Lifecycle = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *CreateFleetInstance) SetPlatform(v string) *CreateFleetInstance { + s.Platform = &v + return s +} + +type CreateFleetOutput struct { _ struct{} `type:"structure"` - // The state of the authorization rule. - Code *string `locationName:"code" type:"string" enum:"ClientVpnAuthorizationRuleStatusCode"` + // Information about the instances that could not be launched by the fleet. + // Valid only when Type is set to instant. + Errors []*CreateFleetError `locationName:"errorSet" locationNameList:"item" type:"list"` - // A message about the status of the authorization rule, if applicable. - Message *string `locationName:"message" type:"string"` + // The ID of the EC2 Fleet. + FleetId *string `locationName:"fleetId" type:"string"` + + // Information about the instances that were launched by the fleet. Valid only + // when Type is set to instant. + Instances []*CreateFleetInstance `locationName:"fleetInstanceSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s ClientVpnAuthorizationRuleStatus) String() string { +func (s CreateFleetOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClientVpnAuthorizationRuleStatus) GoString() string { +func (s CreateFleetOutput) GoString() string { return s.String() } -// SetCode sets the Code field's value. -func (s *ClientVpnAuthorizationRuleStatus) SetCode(v string) *ClientVpnAuthorizationRuleStatus { - s.Code = &v +// SetErrors sets the Errors field's value. +func (s *CreateFleetOutput) SetErrors(v []*CreateFleetError) *CreateFleetOutput { + s.Errors = v return s } -// SetMessage sets the Message field's value. -func (s *ClientVpnAuthorizationRuleStatus) SetMessage(v string) *ClientVpnAuthorizationRuleStatus { - s.Message = &v +// SetFleetId sets the FleetId field's value. +func (s *CreateFleetOutput) SetFleetId(v string) *CreateFleetOutput { + s.FleetId = &v return s } -// Describes a client connection. -type ClientVpnConnection struct { - _ struct{} `type:"structure"` - - // The IP address of the client. - ClientIp *string `locationName:"clientIp" type:"string"` +// SetInstances sets the Instances field's value. +func (s *CreateFleetOutput) SetInstances(v []*CreateFleetInstance) *CreateFleetOutput { + s.Instances = v + return s +} - // The ID of the Client VPN endpoint to which the client is connected. - ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"` +type CreateFlowLogsInput struct { + _ struct{} `type:"structure"` - // The common name associated with the client. This is either the name of the - // client certificate, or the Active Directory user name. - CommonName *string `locationName:"commonName" type:"string"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). + ClientToken *string `type:"string"` - // The date and time the client connection was terminated. - ConnectionEndTime *string `locationName:"connectionEndTime" type:"string"` + // The ARN for the IAM role that permits Amazon EC2 to publish flow logs to + // a CloudWatch Logs log group in your account. + // + // If you specify LogDestinationType as s3, do not specify DeliverLogsPermissionArn + // or LogGroupName. + DeliverLogsPermissionArn *string `type:"string"` - // The date and time the client connection was established. - ConnectionEstablishedTime *string `locationName:"connectionEstablishedTime" 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 client connection. - ConnectionId *string `locationName:"connectionId" type:"string"` + // Specifies the destination to which the flow log data is to be published. + // Flow log data can be published to a CloudWatch Logs log group or an Amazon + // S3 bucket. The value specified for this parameter depends on the value specified + // for LogDestinationType. + // + // If LogDestinationType is not specified or cloud-watch-logs, specify the Amazon + // Resource Name (ARN) of the CloudWatch Logs log group. For example, to publish + // to a log group called my-logs, specify arn:aws:logs:us-east-1:123456789012:log-group:my-logs. + // Alternatively, use LogGroupName instead. + // + // If LogDestinationType is s3, specify the ARN of the Amazon S3 bucket. You + // can also specify a subfolder in the bucket. To specify a subfolder in the + // bucket, use the following ARN format: bucket_ARN/subfolder_name/. For example, + // to specify a subfolder named my-logs in a bucket named my-bucket, use the + // following ARN: arn:aws:s3:::my-bucket/my-logs/. You cannot use AWSLogs as + // a subfolder name. This is a reserved term. + LogDestination *string `type:"string"` - // The number of bytes received by the client. - EgressBytes *string `locationName:"egressBytes" type:"string"` + // Specifies the type of destination to which the flow log data is to be published. + // Flow log data can be published to CloudWatch Logs or Amazon S3. To publish + // flow log data to CloudWatch Logs, specify cloud-watch-logs. To publish flow + // log data to Amazon S3, specify s3. + // + // If you specify LogDestinationType as s3, do not specify DeliverLogsPermissionArn + // or LogGroupName. + // + // Default: cloud-watch-logs + LogDestinationType *string `type:"string" enum:"LogDestinationType"` - // The number of packets received by the client. - EgressPackets *string `locationName:"egressPackets" type:"string"` + // The fields to include in the flow log record, in the order in which they + // should appear. For a list of available fields, see Flow Log Records (https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html#flow-log-records). + // If you omit this parameter, the flow log is created using the default format. + // If you specify this parameter, you must specify at least one field. + // + // Specify the fields using the ${field-id} format, separated by spaces. For + // the AWS CLI, use single quotation marks (' ') to surround the parameter value. + // + // Only applicable to flow logs that are published to an Amazon S3 bucket. + LogFormat *string `type:"string"` - // The number of bytes sent by the client. - IngressBytes *string `locationName:"ingressBytes" type:"string"` + // The name of a new or existing CloudWatch Logs log group where Amazon EC2 + // publishes your flow logs. + // + // If you specify LogDestinationType as s3, do not specify DeliverLogsPermissionArn + // or LogGroupName. + LogGroupName *string `type:"string"` - // The number of packets sent by the client. - IngressPackets *string `locationName:"ingressPackets" type:"string"` + // The maximum interval of time during which a flow of packets is captured and + // aggregated into a flow log record. You can specify 60 seconds (1 minute) + // or 600 seconds (10 minutes). + // + // When a network interface is attached to a Nitro-based instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances), + // the aggregation interval is always 60 seconds or less, regardless of the + // value that you specify. + // + // Default: 600 + MaxAggregationInterval *int64 `type:"integer"` - // The current state of the client connection. - Status *ClientVpnConnectionStatus `locationName:"status" type:"structure"` + // The ID of the subnet, network interface, or VPC for which you want to create + // a flow log. + // + // Constraints: Maximum of 1000 resources + // + // ResourceIds is a required field + ResourceIds []*string `locationName:"ResourceId" locationNameList:"item" type:"list" required:"true"` - // The current date and time. - Timestamp *string `locationName:"timestamp" type:"string"` + // The type of resource for which to create the flow log. For example, if you + // specified a VPC ID for the ResourceId property, specify VPC for this property. + // + // ResourceType is a required field + ResourceType *string `type:"string" required:"true" enum:"FlowLogsResourceType"` - // The username of the client who established the client connection. This information - // is only provided if Active Directory client authentication is used. - Username *string `locationName:"username" type:"string"` + // The tags to apply to the flow logs. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + + // The type of traffic to log. You can log traffic that the resource accepts + // or rejects, or all traffic. + // + // TrafficType is a required field + TrafficType *string `type:"string" required:"true" enum:"TrafficType"` } // String returns the string representation -func (s ClientVpnConnection) String() string { +func (s CreateFlowLogsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClientVpnConnection) GoString() string { +func (s CreateFlowLogsInput) GoString() string { return s.String() } -// SetClientIp sets the ClientIp field's value. -func (s *ClientVpnConnection) SetClientIp(v string) *ClientVpnConnection { - s.ClientIp = &v - return s +// 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.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 } -// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. -func (s *ClientVpnConnection) SetClientVpnEndpointId(v string) *ClientVpnConnection { - s.ClientVpnEndpointId = &v +// SetClientToken sets the ClientToken field's value. +func (s *CreateFlowLogsInput) SetClientToken(v string) *CreateFlowLogsInput { + s.ClientToken = &v return s } -// SetCommonName sets the CommonName field's value. -func (s *ClientVpnConnection) SetCommonName(v string) *ClientVpnConnection { - s.CommonName = &v +// SetDeliverLogsPermissionArn sets the DeliverLogsPermissionArn field's value. +func (s *CreateFlowLogsInput) SetDeliverLogsPermissionArn(v string) *CreateFlowLogsInput { + s.DeliverLogsPermissionArn = &v return s } -// SetConnectionEndTime sets the ConnectionEndTime field's value. -func (s *ClientVpnConnection) SetConnectionEndTime(v string) *ClientVpnConnection { - s.ConnectionEndTime = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateFlowLogsInput) SetDryRun(v bool) *CreateFlowLogsInput { + s.DryRun = &v return s } -// SetConnectionEstablishedTime sets the ConnectionEstablishedTime field's value. -func (s *ClientVpnConnection) SetConnectionEstablishedTime(v string) *ClientVpnConnection { - s.ConnectionEstablishedTime = &v +// SetLogDestination sets the LogDestination field's value. +func (s *CreateFlowLogsInput) SetLogDestination(v string) *CreateFlowLogsInput { + s.LogDestination = &v return s } -// SetConnectionId sets the ConnectionId field's value. -func (s *ClientVpnConnection) SetConnectionId(v string) *ClientVpnConnection { - s.ConnectionId = &v +// SetLogDestinationType sets the LogDestinationType field's value. +func (s *CreateFlowLogsInput) SetLogDestinationType(v string) *CreateFlowLogsInput { + s.LogDestinationType = &v return s } -// SetEgressBytes sets the EgressBytes field's value. -func (s *ClientVpnConnection) SetEgressBytes(v string) *ClientVpnConnection { - s.EgressBytes = &v +// SetLogFormat sets the LogFormat field's value. +func (s *CreateFlowLogsInput) SetLogFormat(v string) *CreateFlowLogsInput { + s.LogFormat = &v return s } -// SetEgressPackets sets the EgressPackets field's value. -func (s *ClientVpnConnection) SetEgressPackets(v string) *ClientVpnConnection { - s.EgressPackets = &v +// SetLogGroupName sets the LogGroupName field's value. +func (s *CreateFlowLogsInput) SetLogGroupName(v string) *CreateFlowLogsInput { + s.LogGroupName = &v return s } -// SetIngressBytes sets the IngressBytes field's value. -func (s *ClientVpnConnection) SetIngressBytes(v string) *ClientVpnConnection { - s.IngressBytes = &v +// SetMaxAggregationInterval sets the MaxAggregationInterval field's value. +func (s *CreateFlowLogsInput) SetMaxAggregationInterval(v int64) *CreateFlowLogsInput { + s.MaxAggregationInterval = &v return s } -// SetIngressPackets sets the IngressPackets field's value. -func (s *ClientVpnConnection) SetIngressPackets(v string) *ClientVpnConnection { - s.IngressPackets = &v +// SetResourceIds sets the ResourceIds field's value. +func (s *CreateFlowLogsInput) SetResourceIds(v []*string) *CreateFlowLogsInput { + s.ResourceIds = v return s } -// SetStatus sets the Status field's value. -func (s *ClientVpnConnection) SetStatus(v *ClientVpnConnectionStatus) *ClientVpnConnection { - s.Status = v +// SetResourceType sets the ResourceType field's value. +func (s *CreateFlowLogsInput) SetResourceType(v string) *CreateFlowLogsInput { + s.ResourceType = &v return s } -// SetTimestamp sets the Timestamp field's value. -func (s *ClientVpnConnection) SetTimestamp(v string) *ClientVpnConnection { - s.Timestamp = &v +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateFlowLogsInput) SetTagSpecifications(v []*TagSpecification) *CreateFlowLogsInput { + s.TagSpecifications = v return s } -// SetUsername sets the Username field's value. -func (s *ClientVpnConnection) SetUsername(v string) *ClientVpnConnection { - s.Username = &v +// SetTrafficType sets the TrafficType field's value. +func (s *CreateFlowLogsInput) SetTrafficType(v string) *CreateFlowLogsInput { + s.TrafficType = &v return s } -// Describes the status of a client connection. -type ClientVpnConnectionStatus struct { +type CreateFlowLogsOutput struct { _ struct{} `type:"structure"` - // The state of the client connection. - Code *string `locationName:"code" type:"string" enum:"ClientVpnConnectionStatusCode"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string `locationName:"clientToken" type:"string"` - // A message about the status of the client connection, if applicable. - Message *string `locationName:"message" 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 ClientVpnConnectionStatus) String() string { +func (s CreateFlowLogsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClientVpnConnectionStatus) GoString() string { +func (s CreateFlowLogsOutput) GoString() string { return s.String() } -// SetCode sets the Code field's value. -func (s *ClientVpnConnectionStatus) SetCode(v string) *ClientVpnConnectionStatus { - s.Code = &v +// SetClientToken sets the ClientToken field's value. +func (s *CreateFlowLogsOutput) SetClientToken(v string) *CreateFlowLogsOutput { + s.ClientToken = &v return s } -// SetMessage sets the Message field's value. -func (s *ClientVpnConnectionStatus) SetMessage(v string) *ClientVpnConnectionStatus { - s.Message = &v +// SetFlowLogIds sets the FlowLogIds field's value. +func (s *CreateFlowLogsOutput) SetFlowLogIds(v []*string) *CreateFlowLogsOutput { + s.FlowLogIds = v return s } -// Describes a Client VPN endpoint. -type ClientVpnEndpoint struct { - _ struct{} `type:"structure"` - - // Information about the associated target networks. A target network is a subnet - // in a VPC. - // - // Deprecated: This property is deprecated. To view the target networks associated with a Client VPN endpoint, call DescribeClientVpnTargetNetworks and inspect the clientVpnTargetNetworks response element. - AssociatedTargetNetworks []*AssociatedTargetNetwork `locationName:"associatedTargetNetwork" locationNameList:"item" deprecated:"true" type:"list"` - - // Information about the authentication method used by the Client VPN endpoint. - AuthenticationOptions []*ClientVpnAuthentication `locationName:"authenticationOptions" locationNameList:"item" type:"list"` - - // The IPv4 address range, in CIDR notation, from which client IP addresses - // are assigned. - ClientCidrBlock *string `locationName:"clientCidrBlock" type:"string"` - - // The ID of the Client VPN endpoint. - ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"` - - // Information about the client connection logging options for the Client VPN - // endpoint. - ConnectionLogOptions *ConnectionLogResponseOptions `locationName:"connectionLogOptions" type:"structure"` - - // The date and time the Client VPN endpoint was created. - CreationTime *string `locationName:"creationTime" type:"string"` - - // The date and time the Client VPN endpoint was deleted, if applicable. - DeletionTime *string `locationName:"deletionTime" type:"string"` +// SetUnsuccessful sets the Unsuccessful field's value. +func (s *CreateFlowLogsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *CreateFlowLogsOutput { + s.Unsuccessful = v + return s +} - // A brief description of the endpoint. - Description *string `locationName:"description" type:"string"` +type CreateFpgaImageInput struct { + _ struct{} `type:"structure"` - // The DNS name to be used by clients when connecting to the Client VPN endpoint. - DnsName *string `locationName:"dnsName" type:"string"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). + ClientToken *string `type:"string"` - // Information about the DNS servers to be used for DNS resolution. - DnsServers []*string `locationName:"dnsServer" locationNameList:"item" type:"list"` + // A description for the AFI. + Description *string `type:"string"` - // The ARN of the server certificate. - ServerCertificateArn *string `locationName:"serverCertificateArn" 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"` - // Indicates whether split-tunnel is enabled in the AWS Client VPN endpoint. + // The location of the encrypted design checkpoint in Amazon S3. The input must + // be a tarball. // - // For information about split-tunnel VPN endpoints, see Split-Tunnel AWS Client - // VPN Endpoint (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/split-tunnel-vpn.html) - // in the AWS Client VPN Administrator Guide. - SplitTunnel *bool `locationName:"splitTunnel" type:"boolean"` - - // The current state of the Client VPN endpoint. - Status *ClientVpnEndpointStatus `locationName:"status" type:"structure"` + // InputStorageLocation is a required field + InputStorageLocation *StorageLocation `type:"structure" required:"true"` - // Any tags assigned to the Client VPN endpoint. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + // The location in Amazon S3 for the output logs. + LogsStorageLocation *StorageLocation `type:"structure"` - // The transport protocol used by the Client VPN endpoint. - TransportProtocol *string `locationName:"transportProtocol" type:"string" enum:"TransportProtocol"` + // A name for the AFI. + Name *string `type:"string"` - // The protocol used by the VPN session. - VpnProtocol *string `locationName:"vpnProtocol" type:"string" enum:"VpnProtocol"` + // The tags to apply to the FPGA image during creation. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } // String returns the string representation -func (s ClientVpnEndpoint) String() string { +func (s CreateFpgaImageInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClientVpnEndpoint) GoString() string { +func (s CreateFpgaImageInput) GoString() string { return s.String() } -// SetAssociatedTargetNetworks sets the AssociatedTargetNetworks field's value. -func (s *ClientVpnEndpoint) SetAssociatedTargetNetworks(v []*AssociatedTargetNetwork) *ClientVpnEndpoint { - s.AssociatedTargetNetworks = v - return s -} - -// SetAuthenticationOptions sets the AuthenticationOptions field's value. -func (s *ClientVpnEndpoint) SetAuthenticationOptions(v []*ClientVpnAuthentication) *ClientVpnEndpoint { - s.AuthenticationOptions = v - return s -} - -// SetClientCidrBlock sets the ClientCidrBlock field's value. -func (s *ClientVpnEndpoint) SetClientCidrBlock(v string) *ClientVpnEndpoint { - s.ClientCidrBlock = &v - return s -} - -// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. -func (s *ClientVpnEndpoint) SetClientVpnEndpointId(v string) *ClientVpnEndpoint { - s.ClientVpnEndpointId = &v - return s -} - -// SetConnectionLogOptions sets the ConnectionLogOptions field's value. -func (s *ClientVpnEndpoint) SetConnectionLogOptions(v *ConnectionLogResponseOptions) *ClientVpnEndpoint { - s.ConnectionLogOptions = v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateFpgaImageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateFpgaImageInput"} + if s.InputStorageLocation == nil { + invalidParams.Add(request.NewErrParamRequired("InputStorageLocation")) + } -// SetCreationTime sets the CreationTime field's value. -func (s *ClientVpnEndpoint) SetCreationTime(v string) *ClientVpnEndpoint { - s.CreationTime = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetDeletionTime sets the DeletionTime field's value. -func (s *ClientVpnEndpoint) SetDeletionTime(v string) *ClientVpnEndpoint { - s.DeletionTime = &v +// SetClientToken sets the ClientToken field's value. +func (s *CreateFpgaImageInput) SetClientToken(v string) *CreateFpgaImageInput { + s.ClientToken = &v return s } // SetDescription sets the Description field's value. -func (s *ClientVpnEndpoint) SetDescription(v string) *ClientVpnEndpoint { +func (s *CreateFpgaImageInput) SetDescription(v string) *CreateFpgaImageInput { s.Description = &v return s } -// SetDnsName sets the DnsName field's value. -func (s *ClientVpnEndpoint) SetDnsName(v string) *ClientVpnEndpoint { - s.DnsName = &v - return s -} - -// SetDnsServers sets the DnsServers field's value. -func (s *ClientVpnEndpoint) SetDnsServers(v []*string) *ClientVpnEndpoint { - s.DnsServers = v - return s -} - -// SetServerCertificateArn sets the ServerCertificateArn field's value. -func (s *ClientVpnEndpoint) SetServerCertificateArn(v string) *ClientVpnEndpoint { - s.ServerCertificateArn = &v - return s -} - -// SetSplitTunnel sets the SplitTunnel field's value. -func (s *ClientVpnEndpoint) SetSplitTunnel(v bool) *ClientVpnEndpoint { - s.SplitTunnel = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateFpgaImageInput) SetDryRun(v bool) *CreateFpgaImageInput { + s.DryRun = &v return s } -// SetStatus sets the Status field's value. -func (s *ClientVpnEndpoint) SetStatus(v *ClientVpnEndpointStatus) *ClientVpnEndpoint { - s.Status = v +// SetInputStorageLocation sets the InputStorageLocation field's value. +func (s *CreateFpgaImageInput) SetInputStorageLocation(v *StorageLocation) *CreateFpgaImageInput { + s.InputStorageLocation = v return s } -// SetTags sets the Tags field's value. -func (s *ClientVpnEndpoint) SetTags(v []*Tag) *ClientVpnEndpoint { - s.Tags = v +// SetLogsStorageLocation sets the LogsStorageLocation field's value. +func (s *CreateFpgaImageInput) SetLogsStorageLocation(v *StorageLocation) *CreateFpgaImageInput { + s.LogsStorageLocation = v return s } -// SetTransportProtocol sets the TransportProtocol field's value. -func (s *ClientVpnEndpoint) SetTransportProtocol(v string) *ClientVpnEndpoint { - s.TransportProtocol = &v +// SetName sets the Name field's value. +func (s *CreateFpgaImageInput) SetName(v string) *CreateFpgaImageInput { + s.Name = &v return s } -// SetVpnProtocol sets the VpnProtocol field's value. -func (s *ClientVpnEndpoint) SetVpnProtocol(v string) *ClientVpnEndpoint { - s.VpnProtocol = &v +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateFpgaImageInput) SetTagSpecifications(v []*TagSpecification) *CreateFpgaImageInput { + s.TagSpecifications = v return s } -// Describes the state of a Client VPN endpoint. -type ClientVpnEndpointStatus struct { +type CreateFpgaImageOutput struct { _ struct{} `type:"structure"` - // The state of the Client VPN endpoint. Possible states include: - // - // * pending-associate - The Client VPN endpoint has been created but no - // target networks have been associated. The Client VPN endpoint cannot accept - // connections. - // - // * available - The Client VPN endpoint has been created and a target network - // has been associated. The Client VPN endpoint can accept connections. - // - // * deleting - The Client VPN endpoint is being deleted. The Client VPN - // endpoint cannot accept connections. - // - // * deleted - The Client VPN endpoint has been deleted. The Client VPN endpoint - // cannot accept connections. - Code *string `locationName:"code" type:"string" enum:"ClientVpnEndpointStatusCode"` + // The global FPGA image identifier (AGFI ID). + FpgaImageGlobalId *string `locationName:"fpgaImageGlobalId" type:"string"` - // A message about the status of the Client VPN endpoint. - Message *string `locationName:"message" type:"string"` + // The FPGA image identifier (AFI ID). + FpgaImageId *string `locationName:"fpgaImageId" type:"string"` } // String returns the string representation -func (s ClientVpnEndpointStatus) String() string { +func (s CreateFpgaImageOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClientVpnEndpointStatus) GoString() string { +func (s CreateFpgaImageOutput) GoString() string { return s.String() } -// SetCode sets the Code field's value. -func (s *ClientVpnEndpointStatus) SetCode(v string) *ClientVpnEndpointStatus { - s.Code = &v +// SetFpgaImageGlobalId sets the FpgaImageGlobalId field's value. +func (s *CreateFpgaImageOutput) SetFpgaImageGlobalId(v string) *CreateFpgaImageOutput { + s.FpgaImageGlobalId = &v return s } -// SetMessage sets the Message field's value. -func (s *ClientVpnEndpointStatus) SetMessage(v string) *ClientVpnEndpointStatus { - s.Message = &v +// SetFpgaImageId sets the FpgaImageId field's value. +func (s *CreateFpgaImageOutput) SetFpgaImageId(v string) *CreateFpgaImageOutput { + s.FpgaImageId = &v return s } -// Information about a Client VPN endpoint route. -type ClientVpnRoute struct { +type CreateImageInput struct { _ struct{} `type:"structure"` - // The ID of the Client VPN endpoint with which the route is associated. - ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"` + // The block device mappings. This parameter cannot be used to modify the encryption + // status of existing volumes or snapshots. To create an AMI with encrypted + // snapshots, use the CopyImage action. + BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` - // A brief description of the route. + // A description for the new image. Description *string `locationName:"description" type:"string"` - // The IPv4 address range, in CIDR notation, of the route destination. - DestinationCidr *string `locationName:"destinationCidr" type:"string"` - - // Indicates how the route was associated with the Client VPN endpoint. associate - // indicates that the route was automatically added when the target network - // was associated with the Client VPN endpoint. add-route indicates that the - // route was manually added using the CreateClientVpnRoute action. - Origin *string `locationName:"origin" 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 current state of the route. - Status *ClientVpnRouteStatus `locationName:"status" type:"structure"` + // The ID of the instance. + // + // InstanceId is a required field + InstanceId *string `locationName:"instanceId" type:"string" required:"true"` - // The ID of the subnet through which traffic is routed. - TargetSubnet *string `locationName:"targetSubnet" type:"string"` + // 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"` - // The route type. - Type *string `locationName:"type" type:"string"` + // 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 ClientVpnRoute) String() string { +func (s CreateImageInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClientVpnRoute) GoString() string { +func (s CreateImageInput) GoString() string { return s.String() } -// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. -func (s *ClientVpnRoute) SetClientVpnEndpointId(v string) *ClientVpnRoute { - s.ClientVpnEndpointId = &v - return s +// 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 } -// SetDescription sets the Description field's value. -func (s *ClientVpnRoute) SetDescription(v string) *ClientVpnRoute { - s.Description = &v +// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. +func (s *CreateImageInput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *CreateImageInput { + s.BlockDeviceMappings = v return s } -// SetDestinationCidr sets the DestinationCidr field's value. -func (s *ClientVpnRoute) SetDestinationCidr(v string) *ClientVpnRoute { - s.DestinationCidr = &v +// SetDescription sets the Description field's value. +func (s *CreateImageInput) SetDescription(v string) *CreateImageInput { + s.Description = &v return s } -// SetOrigin sets the Origin field's value. -func (s *ClientVpnRoute) SetOrigin(v string) *ClientVpnRoute { - s.Origin = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateImageInput) SetDryRun(v bool) *CreateImageInput { + s.DryRun = &v return s } -// SetStatus sets the Status field's value. -func (s *ClientVpnRoute) SetStatus(v *ClientVpnRouteStatus) *ClientVpnRoute { - s.Status = v +// SetInstanceId sets the InstanceId field's value. +func (s *CreateImageInput) SetInstanceId(v string) *CreateImageInput { + s.InstanceId = &v return s } -// SetTargetSubnet sets the TargetSubnet field's value. -func (s *ClientVpnRoute) SetTargetSubnet(v string) *ClientVpnRoute { - s.TargetSubnet = &v +// SetName sets the Name field's value. +func (s *CreateImageInput) SetName(v string) *CreateImageInput { + s.Name = &v return s } -// SetType sets the Type field's value. -func (s *ClientVpnRoute) SetType(v string) *ClientVpnRoute { - s.Type = &v +// SetNoReboot sets the NoReboot field's value. +func (s *CreateImageInput) SetNoReboot(v bool) *CreateImageInput { + s.NoReboot = &v return s } -// Describes the state of a Client VPN endpoint route. -type ClientVpnRouteStatus struct { +type CreateImageOutput struct { _ struct{} `type:"structure"` - // The state of the Client VPN endpoint route. - Code *string `locationName:"code" type:"string" enum:"ClientVpnRouteStatusCode"` - - // A message about the status of the Client VPN endpoint route, if applicable. - Message *string `locationName:"message" type:"string"` + // The ID of the new AMI. + ImageId *string `locationName:"imageId" type:"string"` } // String returns the string representation -func (s ClientVpnRouteStatus) String() string { +func (s CreateImageOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClientVpnRouteStatus) GoString() string { +func (s CreateImageOutput) GoString() string { return s.String() } -// SetCode sets the Code field's value. -func (s *ClientVpnRouteStatus) SetCode(v string) *ClientVpnRouteStatus { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *ClientVpnRouteStatus) SetMessage(v string) *ClientVpnRouteStatus { - s.Message = &v +// SetImageId sets the ImageId field's value. +func (s *CreateImageOutput) SetImageId(v string) *CreateImageOutput { + s.ImageId = &v return s } -type ConfirmProductInstanceInput struct { +type CreateInstanceExportTaskInput 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 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 `type:"string" required:"true"` + InstanceId *string `locationName:"instanceId" 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"` + // The target virtualization environment. + TargetEnvironment *string `locationName:"targetEnvironment" type:"string" enum:"ExportEnvironment"` } // String returns the string representation -func (s ConfirmProductInstanceInput) String() string { +func (s CreateInstanceExportTaskInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConfirmProductInstanceInput) GoString() string { +func (s CreateInstanceExportTaskInput) 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"} +func (s *CreateInstanceExportTaskInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateInstanceExportTaskInput"} if s.InstanceId == nil { invalidParams.Add(request.NewErrParamRequired("InstanceId")) } - if s.ProductCode == nil { - invalidParams.Add(request.NewErrParamRequired("ProductCode")) - } if invalidParams.Len() > 0 { return invalidParams @@ -38285,355 +45912,263 @@ func (s *ConfirmProductInstanceInput) Validate() error { return nil } -// SetDryRun sets the DryRun field's value. -func (s *ConfirmProductInstanceInput) SetDryRun(v bool) *ConfirmProductInstanceInput { - s.DryRun = &v +// 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 *ConfirmProductInstanceInput) SetInstanceId(v string) *ConfirmProductInstanceInput { +func (s *CreateInstanceExportTaskInput) SetInstanceId(v string) *CreateInstanceExportTaskInput { s.InstanceId = &v return s } -// SetProductCode sets the ProductCode field's value. -func (s *ConfirmProductInstanceInput) SetProductCode(v string) *ConfirmProductInstanceInput { - s.ProductCode = &v +// SetTargetEnvironment sets the TargetEnvironment field's value. +func (s *CreateInstanceExportTaskInput) SetTargetEnvironment(v string) *CreateInstanceExportTaskInput { + s.TargetEnvironment = &v return s } -type ConfirmProductInstanceOutput struct { +type CreateInstanceExportTaskOutput 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"` + // Information about the instance export task. + ExportTask *ExportTask `locationName:"exportTask" type:"structure"` } // String returns the string representation -func (s ConfirmProductInstanceOutput) String() string { +func (s CreateInstanceExportTaskOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConfirmProductInstanceOutput) GoString() string { +func (s CreateInstanceExportTaskOutput) 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 +// SetExportTask sets the ExportTask field's value. +func (s *CreateInstanceExportTaskOutput) SetExportTask(v *ExportTask) *CreateInstanceExportTaskOutput { + s.ExportTask = v return s } -// Describes the client connection logging options for the Client VPN endpoint. -type ConnectionLogOptions struct { +type CreateInternetGatewayInput struct { _ struct{} `type:"structure"` - // The name of the CloudWatch Logs log group. - CloudwatchLogGroup *string `type:"string"` - - // The name of the CloudWatch Logs log stream to which the connection data is - // published. - CloudwatchLogStream *string `type:"string"` - - // Indicates whether connection logging is enabled. - Enabled *bool `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"` } // String returns the string representation -func (s ConnectionLogOptions) String() string { +func (s CreateInternetGatewayInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConnectionLogOptions) GoString() string { +func (s CreateInternetGatewayInput) GoString() string { return s.String() } -// SetCloudwatchLogGroup sets the CloudwatchLogGroup field's value. -func (s *ConnectionLogOptions) SetCloudwatchLogGroup(v string) *ConnectionLogOptions { - s.CloudwatchLogGroup = &v - return s -} - -// SetCloudwatchLogStream sets the CloudwatchLogStream field's value. -func (s *ConnectionLogOptions) SetCloudwatchLogStream(v string) *ConnectionLogOptions { - s.CloudwatchLogStream = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *ConnectionLogOptions) SetEnabled(v bool) *ConnectionLogOptions { - s.Enabled = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateInternetGatewayInput) SetDryRun(v bool) *CreateInternetGatewayInput { + s.DryRun = &v return s } -// Information about the client connection logging options for a Client VPN -// endpoint. -type ConnectionLogResponseOptions struct { +type CreateInternetGatewayOutput struct { _ struct{} `type:"structure"` - // The name of the Amazon CloudWatch Logs log group to which connection logging - // data is published. - CloudwatchLogGroup *string `type:"string"` - - // The name of the Amazon CloudWatch Logs log stream to which connection logging - // data is published. - CloudwatchLogStream *string `type:"string"` - - // Indicates whether client connection logging is enabled for the Client VPN - // endpoint. - Enabled *bool `type:"boolean"` + // Information about the internet gateway. + InternetGateway *InternetGateway `locationName:"internetGateway" type:"structure"` } // String returns the string representation -func (s ConnectionLogResponseOptions) String() string { +func (s CreateInternetGatewayOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConnectionLogResponseOptions) GoString() string { +func (s CreateInternetGatewayOutput) GoString() string { return s.String() } -// SetCloudwatchLogGroup sets the CloudwatchLogGroup field's value. -func (s *ConnectionLogResponseOptions) SetCloudwatchLogGroup(v string) *ConnectionLogResponseOptions { - s.CloudwatchLogGroup = &v - return s -} - -// SetCloudwatchLogStream sets the CloudwatchLogStream field's value. -func (s *ConnectionLogResponseOptions) SetCloudwatchLogStream(v string) *ConnectionLogResponseOptions { - s.CloudwatchLogStream = &v - return s -} - -// SetEnabled sets the Enabled field's value. -func (s *ConnectionLogResponseOptions) SetEnabled(v bool) *ConnectionLogResponseOptions { - s.Enabled = &v +// SetInternetGateway sets the InternetGateway field's value. +func (s *CreateInternetGatewayOutput) SetInternetGateway(v *InternetGateway) *CreateInternetGatewayOutput { + s.InternetGateway = v return s } -// Describes a connection notification for a VPC endpoint or VPC endpoint service. -type ConnectionNotification struct { +type CreateKeyPairInput struct { _ struct{} `type:"structure"` - // The events for the notification. Valid values are Accept, Connect, Delete, - // and Reject. - ConnectionEvents []*string `locationName:"connectionEvents" locationNameList:"item" type:"list"` - - // The ARN of the SNS topic for the notification. - ConnectionNotificationArn *string `locationName:"connectionNotificationArn" type:"string"` - - // The ID of the notification. - ConnectionNotificationId *string `locationName:"connectionNotificationId" type:"string"` - - // The state of the notification. - ConnectionNotificationState *string `locationName:"connectionNotificationState" type:"string" enum:"ConnectionNotificationState"` - - // The type of notification. - ConnectionNotificationType *string `locationName:"connectionNotificationType" type:"string" enum:"ConnectionNotificationType"` - - // The ID of the endpoint service. - ServiceId *string `locationName:"serviceId" 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 VPC endpoint. - VpcEndpointId *string `locationName:"vpcEndpointId" type:"string"` + // 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 ConnectionNotification) String() string { +func (s CreateKeyPairInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConnectionNotification) GoString() string { +func (s CreateKeyPairInput) GoString() string { return s.String() } -// SetConnectionEvents sets the ConnectionEvents field's value. -func (s *ConnectionNotification) SetConnectionEvents(v []*string) *ConnectionNotification { - s.ConnectionEvents = v - return s -} - -// SetConnectionNotificationArn sets the ConnectionNotificationArn field's value. -func (s *ConnectionNotification) SetConnectionNotificationArn(v string) *ConnectionNotification { - s.ConnectionNotificationArn = &v - return s -} - -// SetConnectionNotificationId sets the ConnectionNotificationId field's value. -func (s *ConnectionNotification) SetConnectionNotificationId(v string) *ConnectionNotification { - s.ConnectionNotificationId = &v - return s -} - -// SetConnectionNotificationState sets the ConnectionNotificationState field's value. -func (s *ConnectionNotification) SetConnectionNotificationState(v string) *ConnectionNotification { - s.ConnectionNotificationState = &v - return s -} +// 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")) + } -// SetConnectionNotificationType sets the ConnectionNotificationType field's value. -func (s *ConnectionNotification) SetConnectionNotificationType(v string) *ConnectionNotification { - s.ConnectionNotificationType = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetServiceId sets the ServiceId field's value. -func (s *ConnectionNotification) SetServiceId(v string) *ConnectionNotification { - s.ServiceId = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateKeyPairInput) SetDryRun(v bool) *CreateKeyPairInput { + s.DryRun = &v return s } -// SetVpcEndpointId sets the VpcEndpointId field's value. -func (s *ConnectionNotification) SetVpcEndpointId(v string) *ConnectionNotification { - s.VpcEndpointId = &v +// SetKeyName sets the KeyName field's value. +func (s *CreateKeyPairInput) SetKeyName(v string) *CreateKeyPairInput { + s.KeyName = &v return s } -// Describes a conversion task. -type ConversionTask struct { +// Describes a key pair. +type CreateKeyPairOutput struct { _ struct{} `type:"structure"` - // The ID of the conversion task. - ConversionTaskId *string `locationName:"conversionTaskId" type:"string"` - - // 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 SHA-1 digest of the DER encoded private key. + KeyFingerprint *string `locationName:"keyFingerprint" type:"string"` - // The state of the conversion task. - State *string `locationName:"state" type:"string" enum:"ConversionTaskState"` + // An unencrypted PEM encoded RSA private key. + KeyMaterial *string `locationName:"keyMaterial" type:"string" sensitive:"true"` - // The status message related to the conversion task. - StatusMessage *string `locationName:"statusMessage" type:"string"` + // The name of the key pair. + KeyName *string `locationName:"keyName" type:"string"` - // Any tags assigned to the task. - Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + // The ID of the key pair. + KeyPairId *string `locationName:"keyPairId" type:"string"` } // String returns the string representation -func (s ConversionTask) String() string { +func (s CreateKeyPairOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConversionTask) GoString() string { +func (s CreateKeyPairOutput) 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 +// SetKeyFingerprint sets the KeyFingerprint field's value. +func (s *CreateKeyPairOutput) SetKeyFingerprint(v string) *CreateKeyPairOutput { + s.KeyFingerprint = &v return s } -// SetState sets the State field's value. -func (s *ConversionTask) SetState(v string) *ConversionTask { - s.State = &v +// SetKeyMaterial sets the KeyMaterial field's value. +func (s *CreateKeyPairOutput) SetKeyMaterial(v string) *CreateKeyPairOutput { + s.KeyMaterial = &v return s } -// SetStatusMessage sets the StatusMessage field's value. -func (s *ConversionTask) SetStatusMessage(v string) *ConversionTask { - s.StatusMessage = &v +// SetKeyName sets the KeyName field's value. +func (s *CreateKeyPairOutput) SetKeyName(v string) *CreateKeyPairOutput { + s.KeyName = &v return s } -// SetTags sets the Tags field's value. -func (s *ConversionTask) SetTags(v []*Tag) *ConversionTask { - s.Tags = v +// SetKeyPairId sets the KeyPairId field's value. +func (s *CreateKeyPairOutput) SetKeyPairId(v string) *CreateKeyPairOutput { + s.KeyPairId = &v return s } -type CopyFpgaImageInput struct { +type CreateLaunchTemplateInput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). + // Unique, case-sensitive identifier you provide to ensure the idempotency of + // the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + // + // Constraint: Maximum 128 ASCII characters. ClientToken *string `type:"string"` - // The description for the new AFI. - 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 `type:"boolean"` - // The name for the new AFI. The default is the name of the source AFI. - Name *string `type:"string"` - - // The ID of the source AFI. + // The information for the launch template. // - // SourceFpgaImageId is a required field - SourceFpgaImageId *string `type:"string" required:"true"` + // LaunchTemplateData is a required field + LaunchTemplateData *RequestLaunchTemplateData `type:"structure" required:"true"` - // The Region that contains the source AFI. + // A name for the launch template. // - // SourceRegion is a required field - SourceRegion *string `type:"string" required:"true"` + // LaunchTemplateName is a required field + LaunchTemplateName *string `min:"3" type:"string" required:"true"` + + // The tags to apply to the launch template during creation. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + + // A description for the first version of the launch template. + VersionDescription *string `type:"string"` } // String returns the string representation -func (s CopyFpgaImageInput) String() string { +func (s CreateLaunchTemplateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CopyFpgaImageInput) GoString() string { +func (s CreateLaunchTemplateInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CopyFpgaImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyFpgaImageInput"} - if s.SourceFpgaImageId == nil { - invalidParams.Add(request.NewErrParamRequired("SourceFpgaImageId")) +func (s *CreateLaunchTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLaunchTemplateInput"} + if s.LaunchTemplateData == nil { + invalidParams.Add(request.NewErrParamRequired("LaunchTemplateData")) } - if s.SourceRegion == nil { - invalidParams.Add(request.NewErrParamRequired("SourceRegion")) + if s.LaunchTemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("LaunchTemplateName")) + } + if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) + } + if s.LaunchTemplateData != nil { + if err := s.LaunchTemplateData.Validate(); err != nil { + invalidParams.AddNested("LaunchTemplateData", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -38643,153 +46178,126 @@ func (s *CopyFpgaImageInput) Validate() error { } // SetClientToken sets the ClientToken field's value. -func (s *CopyFpgaImageInput) SetClientToken(v string) *CopyFpgaImageInput { +func (s *CreateLaunchTemplateInput) SetClientToken(v string) *CreateLaunchTemplateInput { s.ClientToken = &v return s } -// SetDescription sets the Description field's value. -func (s *CopyFpgaImageInput) SetDescription(v string) *CopyFpgaImageInput { - s.Description = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateLaunchTemplateInput) SetDryRun(v bool) *CreateLaunchTemplateInput { + s.DryRun = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *CopyFpgaImageInput) SetDryRun(v bool) *CopyFpgaImageInput { - s.DryRun = &v +// SetLaunchTemplateData sets the LaunchTemplateData field's value. +func (s *CreateLaunchTemplateInput) SetLaunchTemplateData(v *RequestLaunchTemplateData) *CreateLaunchTemplateInput { + s.LaunchTemplateData = v return s } -// SetName sets the Name field's value. -func (s *CopyFpgaImageInput) SetName(v string) *CopyFpgaImageInput { - s.Name = &v +// SetLaunchTemplateName sets the LaunchTemplateName field's value. +func (s *CreateLaunchTemplateInput) SetLaunchTemplateName(v string) *CreateLaunchTemplateInput { + s.LaunchTemplateName = &v return s } -// SetSourceFpgaImageId sets the SourceFpgaImageId field's value. -func (s *CopyFpgaImageInput) SetSourceFpgaImageId(v string) *CopyFpgaImageInput { - s.SourceFpgaImageId = &v +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateLaunchTemplateInput) SetTagSpecifications(v []*TagSpecification) *CreateLaunchTemplateInput { + s.TagSpecifications = v return s } -// SetSourceRegion sets the SourceRegion field's value. -func (s *CopyFpgaImageInput) SetSourceRegion(v string) *CopyFpgaImageInput { - s.SourceRegion = &v +// SetVersionDescription sets the VersionDescription field's value. +func (s *CreateLaunchTemplateInput) SetVersionDescription(v string) *CreateLaunchTemplateInput { + s.VersionDescription = &v return s } -type CopyFpgaImageOutput struct { +type CreateLaunchTemplateOutput struct { _ struct{} `type:"structure"` - // The ID of the new AFI. - FpgaImageId *string `locationName:"fpgaImageId" type:"string"` + // Information about the launch template. + LaunchTemplate *LaunchTemplate `locationName:"launchTemplate" type:"structure"` } // String returns the string representation -func (s CopyFpgaImageOutput) String() string { +func (s CreateLaunchTemplateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CopyFpgaImageOutput) GoString() string { +func (s CreateLaunchTemplateOutput) GoString() string { return s.String() } -// SetFpgaImageId sets the FpgaImageId field's value. -func (s *CopyFpgaImageOutput) SetFpgaImageId(v string) *CopyFpgaImageOutput { - s.FpgaImageId = &v +// SetLaunchTemplate sets the LaunchTemplate field's value. +func (s *CreateLaunchTemplateOutput) SetLaunchTemplate(v *LaunchTemplate) *CreateLaunchTemplateOutput { + s.LaunchTemplate = v return s } -// Contains the parameters for CopyImage. -type CopyImageInput struct { +type CreateLaunchTemplateVersionInput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier you provide to ensure idempotency of the - // request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html) - // in the Amazon Elastic Compute Cloud User Guide. + // Unique, case-sensitive identifier you provide to ensure the idempotency of + // the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + // + // Constraint: Maximum 128 ASCII characters. 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. You can encrypt a copy of an unencrypted snapshot, but you cannot - // create an unencrypted copy of an encrypted snapshot. The default CMK for - // EBS is used unless you specify a non-default AWS Key Management Service (AWS - // KMS) CMK using KmsKeyId. For more information, see Amazon EBS Encryption - // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) - // in the Amazon Elastic Compute Cloud User Guide. - Encrypted *bool `locationName:"encrypted" type:"boolean"` + DryRun *bool `type:"boolean"` - // An identifier for 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. If a KmsKeyId is specified, the Encrypted - // flag must also be set. - // - // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, - // or alias ARN. When using an alias name, prefix it with "alias/". For example: - // - // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * Key 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 - // - // AWS parses KmsKeyId asynchronously, meaning that the action you call may - // appear to complete even though you provided an invalid identifier. This action - // will eventually report failure. + // The information for the launch template. // - // The specified CMK must exist in the Region that the snapshot is being copied - // to. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` + // LaunchTemplateData is a required field + LaunchTemplateData *RequestLaunchTemplateData `type:"structure" required:"true"` - // 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 launch template. You must specify either the launch template + // ID or launch template name in the request. + LaunchTemplateId *string `type:"string"` - // The ID of the AMI to copy. - // - // SourceImageId is a required field - SourceImageId *string `type:"string" required:"true"` + // The name of the launch template. You must specify either the launch template + // ID or launch template name in the request. + LaunchTemplateName *string `min:"3" type:"string"` - // The name of the Region that contains the AMI to copy. - // - // SourceRegion is a required field - SourceRegion *string `type:"string" required:"true"` + // The version number of the launch template version on which to base the new + // version. The new version inherits the same launch parameters as the source + // version, except for parameters that you specify in LaunchTemplateData. Snapshots + // applied to the block device mapping are ignored when creating a new version + // unless they are explicitly included. + SourceVersion *string `type:"string"` + + // A description for the version of the launch template. + VersionDescription *string `type:"string"` } // String returns the string representation -func (s CopyImageInput) String() string { +func (s CreateLaunchTemplateVersionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CopyImageInput) GoString() string { +func (s CreateLaunchTemplateVersionInput) 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")) +func (s *CreateLaunchTemplateVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLaunchTemplateVersionInput"} + if s.LaunchTemplateData == nil { + invalidParams.Add(request.NewErrParamRequired("LaunchTemplateData")) } - if s.SourceImageId == nil { - invalidParams.Add(request.NewErrParamRequired("SourceImageId")) + if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) } - if s.SourceRegion == nil { - invalidParams.Add(request.NewErrParamRequired("SourceRegion")) + if s.LaunchTemplateData != nil { + if err := s.LaunchTemplateData.Validate(); err != nil { + invalidParams.AddNested("LaunchTemplateData", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -38799,172 +46307,117 @@ func (s *CopyImageInput) Validate() error { } // SetClientToken sets the ClientToken field's value. -func (s *CopyImageInput) SetClientToken(v string) *CopyImageInput { +func (s *CreateLaunchTemplateVersionInput) SetClientToken(v string) *CreateLaunchTemplateVersionInput { 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 { +func (s *CreateLaunchTemplateVersionInput) SetDryRun(v bool) *CreateLaunchTemplateVersionInput { s.DryRun = &v return s } -// SetEncrypted sets the Encrypted field's value. -func (s *CopyImageInput) SetEncrypted(v bool) *CopyImageInput { - s.Encrypted = &v +// SetLaunchTemplateData sets the LaunchTemplateData field's value. +func (s *CreateLaunchTemplateVersionInput) SetLaunchTemplateData(v *RequestLaunchTemplateData) *CreateLaunchTemplateVersionInput { + s.LaunchTemplateData = v return s } -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CopyImageInput) SetKmsKeyId(v string) *CopyImageInput { - s.KmsKeyId = &v +// SetLaunchTemplateId sets the LaunchTemplateId field's value. +func (s *CreateLaunchTemplateVersionInput) SetLaunchTemplateId(v string) *CreateLaunchTemplateVersionInput { + s.LaunchTemplateId = &v return s } -// SetName sets the Name field's value. -func (s *CopyImageInput) SetName(v string) *CopyImageInput { - s.Name = &v +// SetLaunchTemplateName sets the LaunchTemplateName field's value. +func (s *CreateLaunchTemplateVersionInput) SetLaunchTemplateName(v string) *CreateLaunchTemplateVersionInput { + s.LaunchTemplateName = &v return s } -// SetSourceImageId sets the SourceImageId field's value. -func (s *CopyImageInput) SetSourceImageId(v string) *CopyImageInput { - s.SourceImageId = &v +// SetSourceVersion sets the SourceVersion field's value. +func (s *CreateLaunchTemplateVersionInput) SetSourceVersion(v string) *CreateLaunchTemplateVersionInput { + s.SourceVersion = &v return s } -// SetSourceRegion sets the SourceRegion field's value. -func (s *CopyImageInput) SetSourceRegion(v string) *CopyImageInput { - s.SourceRegion = &v +// SetVersionDescription sets the VersionDescription field's value. +func (s *CreateLaunchTemplateVersionInput) SetVersionDescription(v string) *CreateLaunchTemplateVersionInput { + s.VersionDescription = &v return s } -// Contains the output of CopyImage. -type CopyImageOutput struct { +type CreateLaunchTemplateVersionOutput struct { _ struct{} `type:"structure"` - // The ID of the new AMI. - ImageId *string `locationName:"imageId" type:"string"` + // Information about the launch template version. + LaunchTemplateVersion *LaunchTemplateVersion `locationName:"launchTemplateVersion" type:"structure"` } // String returns the string representation -func (s CopyImageOutput) String() string { +func (s CreateLaunchTemplateVersionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CopyImageOutput) GoString() string { +func (s CreateLaunchTemplateVersionOutput) GoString() string { return s.String() } -// SetImageId sets the ImageId field's value. -func (s *CopyImageOutput) SetImageId(v string) *CopyImageOutput { - s.ImageId = &v +// SetLaunchTemplateVersion sets the LaunchTemplateVersion field's value. +func (s *CreateLaunchTemplateVersionOutput) SetLaunchTemplateVersion(v *LaunchTemplateVersion) *CreateLaunchTemplateVersionOutput { + s.LaunchTemplateVersion = v return s } -// Contains the parameters for CopySnapshot. -type CopySnapshotInput struct { +type CreateLocalGatewayRouteInput 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. + // The CIDR range used for destination matches. Routing decisions are based + // on the most specific match. // - // The snapshot copy is sent to the regional endpoint that you sent the HTTP - // request to (for example, ec2.us-east-1.amazonaws.com). With the AWS CLI, - // this is specified using the --region parameter or the default Region in your - // AWS configuration file. - DestinationRegion *string `locationName:"destinationRegion" type:"string"` + // DestinationCidrBlock is a required field + DestinationCidrBlock *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"` - - // To encrypt a copy of an unencrypted snapshot if encryption by default is - // not enabled, enable encryption using this parameter. Otherwise, omit this - // parameter. Encrypted snapshots are encrypted, even if you omit this parameter - // and encryption by default is not enabled. You cannot set this parameter to - // false. For more information, see Amazon EBS Encryption (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) - // in the Amazon Elastic Compute Cloud User Guide. - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // The identifier of the AWS Key Management Service (AWS KMS) customer master - // key (CMK) to use for Amazon EBS encryption. If this parameter is not specified, - // your AWS managed CMK for EBS is used. If KmsKeyId is specified, the encrypted - // state must be true. - // - // You can specify the CMK using any of the following: - // - // * Key ID. For example, key/1234abcd-12ab-34cd-56ef-1234567890ab. - // - // * Key alias. For example, alias/ExampleAlias. - // - // * Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. - // - // * Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. - // - // AWS authenticates the CMK asynchronously. Therefore, if you specify an ID, - // alias, or ARN that is not valid, the action can appear to complete, but eventually - // fails. - KmsKeyId *string `locationName:"kmsKeyId" type:"string"` - - // When you copy an encrypted source snapshot using the Amazon EC2 Query API, - // you must supply a pre-signed URL. This parameter is optional for unencrypted - // snapshots. For more information, see Query Requests (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html). - // - // 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) (https://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"` + DryRun *bool `type:"boolean"` - // The ID of the Region that contains the snapshot to be copied. + // The ID of the local gateway route table. // - // SourceRegion is a required field - SourceRegion *string `type:"string" required:"true"` + // LocalGatewayRouteTableId is a required field + LocalGatewayRouteTableId *string `type:"string" required:"true"` - // The ID of the EBS snapshot to copy. + // The ID of the virtual interface group. // - // SourceSnapshotId is a required field - SourceSnapshotId *string `type:"string" required:"true"` + // LocalGatewayVirtualInterfaceGroupId is a required field + LocalGatewayVirtualInterfaceGroupId *string `type:"string" required:"true"` } // String returns the string representation -func (s CopySnapshotInput) String() string { +func (s CreateLocalGatewayRouteInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CopySnapshotInput) GoString() string { +func (s CreateLocalGatewayRouteInput) 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")) +func (s *CreateLocalGatewayRouteInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLocalGatewayRouteInput"} + if s.DestinationCidrBlock == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock")) } - if s.SourceSnapshotId == nil { - invalidParams.Add(request.NewErrParamRequired("SourceSnapshotId")) + if s.LocalGatewayRouteTableId == nil { + invalidParams.Add(request.NewErrParamRequired("LocalGatewayRouteTableId")) + } + if s.LocalGatewayVirtualInterfaceGroupId == nil { + invalidParams.Add(request.NewErrParamRequired("LocalGatewayVirtualInterfaceGroupId")) } if invalidParams.Len() > 0 { @@ -38973,271 +46426,326 @@ func (s *CopySnapshotInput) Validate() error { return nil } -// SetDescription sets the Description field's value. -func (s *CopySnapshotInput) SetDescription(v string) *CopySnapshotInput { - s.Description = &v +// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. +func (s *CreateLocalGatewayRouteInput) SetDestinationCidrBlock(v string) *CreateLocalGatewayRouteInput { + s.DestinationCidrBlock = &v return s } -// SetDestinationRegion sets the DestinationRegion field's value. -func (s *CopySnapshotInput) SetDestinationRegion(v string) *CopySnapshotInput { - s.DestinationRegion = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateLocalGatewayRouteInput) SetDryRun(v bool) *CreateLocalGatewayRouteInput { + s.DryRun = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *CopySnapshotInput) SetDryRun(v bool) *CopySnapshotInput { - s.DryRun = &v +// SetLocalGatewayRouteTableId sets the LocalGatewayRouteTableId field's value. +func (s *CreateLocalGatewayRouteInput) SetLocalGatewayRouteTableId(v string) *CreateLocalGatewayRouteInput { + s.LocalGatewayRouteTableId = &v return s } -// SetEncrypted sets the Encrypted field's value. -func (s *CopySnapshotInput) SetEncrypted(v bool) *CopySnapshotInput { - s.Encrypted = &v +// SetLocalGatewayVirtualInterfaceGroupId sets the LocalGatewayVirtualInterfaceGroupId field's value. +func (s *CreateLocalGatewayRouteInput) SetLocalGatewayVirtualInterfaceGroupId(v string) *CreateLocalGatewayRouteInput { + s.LocalGatewayVirtualInterfaceGroupId = &v return s } -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CopySnapshotInput) SetKmsKeyId(v string) *CopySnapshotInput { - s.KmsKeyId = &v +type CreateLocalGatewayRouteOutput struct { + _ struct{} `type:"structure"` + + // Information about the route. + Route *LocalGatewayRoute `locationName:"route" type:"structure"` +} + +// String returns the string representation +func (s CreateLocalGatewayRouteOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLocalGatewayRouteOutput) GoString() string { + return s.String() +} + +// SetRoute sets the Route field's value. +func (s *CreateLocalGatewayRouteOutput) SetRoute(v *LocalGatewayRoute) *CreateLocalGatewayRouteOutput { + s.Route = v return s } -// SetPresignedUrl sets the PresignedUrl field's value. -func (s *CopySnapshotInput) SetPresignedUrl(v string) *CopySnapshotInput { - s.PresignedUrl = &v +type CreateLocalGatewayRouteTableVpcAssociationInput 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 local gateway route table. + // + // LocalGatewayRouteTableId is a required field + LocalGatewayRouteTableId *string `type:"string" required:"true"` + + // The ID of the VPC. + // + // VpcId is a required field + VpcId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateLocalGatewayRouteTableVpcAssociationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLocalGatewayRouteTableVpcAssociationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateLocalGatewayRouteTableVpcAssociationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLocalGatewayRouteTableVpcAssociationInput"} + if s.LocalGatewayRouteTableId == nil { + invalidParams.Add(request.NewErrParamRequired("LocalGatewayRouteTableId")) + } + 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 *CreateLocalGatewayRouteTableVpcAssociationInput) SetDryRun(v bool) *CreateLocalGatewayRouteTableVpcAssociationInput { + s.DryRun = &v return s } -// SetSourceRegion sets the SourceRegion field's value. -func (s *CopySnapshotInput) SetSourceRegion(v string) *CopySnapshotInput { - s.SourceRegion = &v +// SetLocalGatewayRouteTableId sets the LocalGatewayRouteTableId field's value. +func (s *CreateLocalGatewayRouteTableVpcAssociationInput) SetLocalGatewayRouteTableId(v string) *CreateLocalGatewayRouteTableVpcAssociationInput { + s.LocalGatewayRouteTableId = &v return s } -// SetSourceSnapshotId sets the SourceSnapshotId field's value. -func (s *CopySnapshotInput) SetSourceSnapshotId(v string) *CopySnapshotInput { - s.SourceSnapshotId = &v +// SetVpcId sets the VpcId field's value. +func (s *CreateLocalGatewayRouteTableVpcAssociationInput) SetVpcId(v string) *CreateLocalGatewayRouteTableVpcAssociationInput { + s.VpcId = &v return s } -// Contains the output of CopySnapshot. -type CopySnapshotOutput struct { +type CreateLocalGatewayRouteTableVpcAssociationOutput struct { _ struct{} `type:"structure"` - // The ID of the new snapshot. - SnapshotId *string `locationName:"snapshotId" type:"string"` + // Information about the association. + LocalGatewayRouteTableVpcAssociation *LocalGatewayRouteTableVpcAssociation `locationName:"localGatewayRouteTableVpcAssociation" type:"structure"` } // String returns the string representation -func (s CopySnapshotOutput) String() string { +func (s CreateLocalGatewayRouteTableVpcAssociationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CopySnapshotOutput) GoString() string { +func (s CreateLocalGatewayRouteTableVpcAssociationOutput) GoString() string { return s.String() } -// SetSnapshotId sets the SnapshotId field's value. -func (s *CopySnapshotOutput) SetSnapshotId(v string) *CopySnapshotOutput { - s.SnapshotId = &v +// SetLocalGatewayRouteTableVpcAssociation sets the LocalGatewayRouteTableVpcAssociation field's value. +func (s *CreateLocalGatewayRouteTableVpcAssociationOutput) SetLocalGatewayRouteTableVpcAssociation(v *LocalGatewayRouteTableVpcAssociation) *CreateLocalGatewayRouteTableVpcAssociationOutput { + s.LocalGatewayRouteTableVpcAssociation = v return s } -// The CPU options for the instance. -type CpuOptions struct { +type CreateNatGatewayInput struct { _ struct{} `type:"structure"` - // The number of CPU cores for the instance. - CoreCount *int64 `locationName:"coreCount" type:"integer"` + // 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"` - // The number of threads per CPU core. - ThreadsPerCore *int64 `locationName:"threadsPerCore" type:"integer"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://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 CpuOptions) String() string { +func (s CreateNatGatewayInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CpuOptions) GoString() string { +func (s CreateNatGatewayInput) GoString() string { return s.String() } -// SetCoreCount sets the CoreCount field's value. -func (s *CpuOptions) SetCoreCount(v int64) *CpuOptions { - s.CoreCount = &v +// 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 } -// SetThreadsPerCore sets the ThreadsPerCore field's value. -func (s *CpuOptions) SetThreadsPerCore(v int64) *CpuOptions { - s.ThreadsPerCore = &v +// SetClientToken sets the ClientToken field's value. +func (s *CreateNatGatewayInput) SetClientToken(v string) *CreateNatGatewayInput { + s.ClientToken = &v return s } -// The CPU options for the instance. Both the core count and threads per core -// must be specified in the request. -type CpuOptionsRequest struct { +// SetSubnetId sets the SubnetId field's value. +func (s *CreateNatGatewayInput) SetSubnetId(v string) *CreateNatGatewayInput { + s.SubnetId = &v + return s +} + +type CreateNatGatewayOutput struct { _ struct{} `type:"structure"` - // The number of CPU cores for the instance. - CoreCount *int64 `type:"integer"` + // 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"` - // The number of threads per CPU core. To disable multithreading for the instance, - // specify a value of 1. Otherwise, specify the default value of 2. - ThreadsPerCore *int64 `type:"integer"` + // Information about the NAT gateway. + NatGateway *NatGateway `locationName:"natGateway" type:"structure"` } // String returns the string representation -func (s CpuOptionsRequest) String() string { +func (s CreateNatGatewayOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CpuOptionsRequest) GoString() string { +func (s CreateNatGatewayOutput) GoString() string { return s.String() } -// SetCoreCount sets the CoreCount field's value. -func (s *CpuOptionsRequest) SetCoreCount(v int64) *CpuOptionsRequest { - s.CoreCount = &v +// SetClientToken sets the ClientToken field's value. +func (s *CreateNatGatewayOutput) SetClientToken(v string) *CreateNatGatewayOutput { + s.ClientToken = &v return s } -// SetThreadsPerCore sets the ThreadsPerCore field's value. -func (s *CpuOptionsRequest) SetThreadsPerCore(v int64) *CpuOptionsRequest { - s.ThreadsPerCore = &v +// SetNatGateway sets the NatGateway field's value. +func (s *CreateNatGatewayOutput) SetNatGateway(v *NatGateway) *CreateNatGatewayOutput { + s.NatGateway = v return s } -type CreateCapacityReservationInput struct { +type CreateNetworkAclEntryInput struct { _ struct{} `type:"structure"` - // The Availability Zone in which to create the Capacity Reservation. - AvailabilityZone *string `type:"string"` - - // The ID of the Availability Zone in which to create the Capacity Reservation. - AvailabilityZoneId *string `type:"string"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - // - // Constraint: Maximum 64 ASCII characters. - ClientToken *string `type:"string"` + // 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 `type:"boolean"` - - // Indicates whether the Capacity Reservation supports EBS-optimized instances. - // 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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // The date and time at which the Capacity Reservation expires. When a Capacity - // Reservation expires, the reserved capacity is released and you can no longer - // launch instances into it. The Capacity Reservation's state changes to expired - // when it reaches its end date and time. - // - // You must provide an EndDate value if EndDateType is limited. Omit EndDate - // if EndDateType is unlimited. + // Indicates whether this is an egress rule (rule is applied to traffic leaving + // the subnet). // - // If the EndDateType is limited, the Capacity Reservation is cancelled within - // an hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, - // the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 - // on 5/31/2019. - EndDate *time.Time `type:"timestamp"` + // Egress is a required field + Egress *bool `locationName:"egress" type:"boolean" required:"true"` - // Indicates the way in which the Capacity Reservation ends. A Capacity Reservation - // can have one of the following end types: - // - // * unlimited - The Capacity Reservation remains active until you explicitly - // cancel it. Do not provide an EndDate if the EndDateType is unlimited. - // - // * limited - The Capacity Reservation expires automatically at a specified - // date and time. You must provide an EndDate value if the EndDateType value - // is limited. - EndDateType *string `type:"string" enum:"EndDateType"` + // ICMP protocol: The ICMP or ICMPv6 type and code. Required if specifying protocol + // 1 (ICMP) or protocol 58 (ICMPv6) with an IPv6 CIDR block. + IcmpTypeCode *IcmpTypeCode `locationName:"Icmp" type:"structure"` - // Indicates whether the Capacity Reservation supports instances with temporary, - // block-level storage. - EphemeralStorage *bool `type:"boolean"` + // 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 number of instances for which to reserve capacity. + // The ID of the network ACL. // - // InstanceCount is a required field - InstanceCount *int64 `type:"integer" required:"true"` + // NetworkAclId is a required field + NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` - // Indicates the type of instance launches that the Capacity Reservation accepts. - // The options include: - // - // * open - The Capacity Reservation automatically matches all instances - // that have matching attributes (instance type, platform, and Availability - // Zone). Instances that have matching attributes run in the Capacity Reservation - // automatically without specifying any additional parameters. - // - // * targeted - The Capacity Reservation only accepts instances that have - // matching attributes (instance type, platform, and Availability Zone), - // and explicitly target the Capacity Reservation. This ensures that only - // permitted instances can use the reserved capacity. - // - // Default: open - InstanceMatchCriteria *string `type:"string" enum:"InstanceMatchCriteria"` + // TCP or UDP protocols: The range of ports the rule applies to. Required if + // specifying protocol 6 (TCP) or 17 (UDP). + PortRange *PortRange `locationName:"portRange" type:"structure"` - // The type of operating system for which to reserve capacity. + // The protocol number. A value of "-1" means all protocols. If you specify + // "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), + // traffic on all ports is allowed, regardless of any ports or ICMP types or + // codes that 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. // - // InstancePlatform is a required field - InstancePlatform *string `type:"string" required:"true" enum:"CapacityReservationInstancePlatform"` + // Protocol is a required field + Protocol *string `locationName:"protocol" type:"string" required:"true"` - // The instance type for which to reserve capacity. For more information, see - // Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) - // in the Amazon Elastic Compute Cloud User Guide. + // Indicates whether to allow or deny the traffic that matches the rule. // - // InstanceType is a required field - InstanceType *string `type:"string" required:"true"` - - // The tags to apply to the Capacity Reservation during launch. - TagSpecifications []*TagSpecification `locationNameList:"item" type:"list"` + // RuleAction is a required field + RuleAction *string `locationName:"ruleAction" type:"string" required:"true" enum:"RuleAction"` - // Indicates the tenancy of the Capacity Reservation. A Capacity Reservation - // can have one of the following tenancy settings: + // The rule number for the entry (for example, 100). ACL entries are processed + // in ascending order by rule number. // - // * default - The Capacity Reservation is created on hardware that is shared - // with other AWS accounts. + // Constraints: Positive integer from 1 to 32766. The range 32767 to 65535 is + // reserved for internal use. // - // * dedicated - The Capacity Reservation is created on single-tenant hardware - // that is dedicated to a single AWS account. - Tenancy *string `type:"string" enum:"CapacityReservationTenancy"` + // RuleNumber is a required field + RuleNumber *int64 `locationName:"ruleNumber" type:"integer" required:"true"` } // String returns the string representation -func (s CreateCapacityReservationInput) String() string { +func (s CreateNetworkAclEntryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateCapacityReservationInput) GoString() string { +func (s CreateNetworkAclEntryInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCapacityReservationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCapacityReservationInput"} - if s.InstanceCount == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceCount")) +func (s *CreateNetworkAclEntryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateNetworkAclEntryInput"} + if s.Egress == nil { + invalidParams.Add(request.NewErrParamRequired("Egress")) } - if s.InstancePlatform == nil { - invalidParams.Add(request.NewErrParamRequired("InstancePlatform")) + if s.NetworkAclId == nil { + invalidParams.Add(request.NewErrParamRequired("NetworkAclId")) } - if s.InstanceType == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceType")) + 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 { @@ -39246,212 +46754,227 @@ func (s *CreateCapacityReservationInput) Validate() error { return nil } -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateCapacityReservationInput) SetAvailabilityZone(v string) *CreateCapacityReservationInput { - s.AvailabilityZone = &v +// SetCidrBlock sets the CidrBlock field's value. +func (s *CreateNetworkAclEntryInput) SetCidrBlock(v string) *CreateNetworkAclEntryInput { + s.CidrBlock = &v return s } -// SetAvailabilityZoneId sets the AvailabilityZoneId field's value. -func (s *CreateCapacityReservationInput) SetAvailabilityZoneId(v string) *CreateCapacityReservationInput { - s.AvailabilityZoneId = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateNetworkAclEntryInput) SetDryRun(v bool) *CreateNetworkAclEntryInput { + s.DryRun = &v return s } -// SetClientToken sets the ClientToken field's value. -func (s *CreateCapacityReservationInput) SetClientToken(v string) *CreateCapacityReservationInput { - s.ClientToken = &v +// SetEgress sets the Egress field's value. +func (s *CreateNetworkAclEntryInput) SetEgress(v bool) *CreateNetworkAclEntryInput { + s.Egress = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *CreateCapacityReservationInput) SetDryRun(v bool) *CreateCapacityReservationInput { - s.DryRun = &v +// 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 } -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *CreateCapacityReservationInput) SetEbsOptimized(v bool) *CreateCapacityReservationInput { - s.EbsOptimized = &v +// SetRuleAction sets the RuleAction field's value. +func (s *CreateNetworkAclEntryInput) SetRuleAction(v string) *CreateNetworkAclEntryInput { + s.RuleAction = &v return s } -// SetEndDate sets the EndDate field's value. -func (s *CreateCapacityReservationInput) SetEndDate(v time.Time) *CreateCapacityReservationInput { - s.EndDate = &v +// SetRuleNumber sets the RuleNumber field's value. +func (s *CreateNetworkAclEntryInput) SetRuleNumber(v int64) *CreateNetworkAclEntryInput { + s.RuleNumber = &v return s } -// SetEndDateType sets the EndDateType field's value. -func (s *CreateCapacityReservationInput) SetEndDateType(v string) *CreateCapacityReservationInput { - s.EndDateType = &v - return s +type CreateNetworkAclEntryOutput struct { + _ struct{} `type:"structure"` } -// SetEphemeralStorage sets the EphemeralStorage field's value. -func (s *CreateCapacityReservationInput) SetEphemeralStorage(v bool) *CreateCapacityReservationInput { - s.EphemeralStorage = &v - return s +// String returns the string representation +func (s CreateNetworkAclEntryOutput) String() string { + return awsutil.Prettify(s) } -// SetInstanceCount sets the InstanceCount field's value. -func (s *CreateCapacityReservationInput) SetInstanceCount(v int64) *CreateCapacityReservationInput { - s.InstanceCount = &v - return s +// GoString returns the string representation +func (s CreateNetworkAclEntryOutput) GoString() string { + return s.String() } -// SetInstanceMatchCriteria sets the InstanceMatchCriteria field's value. -func (s *CreateCapacityReservationInput) SetInstanceMatchCriteria(v string) *CreateCapacityReservationInput { - s.InstanceMatchCriteria = &v - return s +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"` } -// SetInstancePlatform sets the InstancePlatform field's value. -func (s *CreateCapacityReservationInput) SetInstancePlatform(v string) *CreateCapacityReservationInput { - s.InstancePlatform = &v - return s +// String returns the string representation +func (s CreateNetworkAclInput) String() string { + return awsutil.Prettify(s) } -// SetInstanceType sets the InstanceType field's value. -func (s *CreateCapacityReservationInput) SetInstanceType(v string) *CreateCapacityReservationInput { - s.InstanceType = &v - return s +// GoString returns the string representation +func (s CreateNetworkAclInput) GoString() string { + return s.String() } -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateCapacityReservationInput) SetTagSpecifications(v []*TagSpecification) *CreateCapacityReservationInput { - s.TagSpecifications = v +// 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 } -// SetTenancy sets the Tenancy field's value. -func (s *CreateCapacityReservationInput) SetTenancy(v string) *CreateCapacityReservationInput { - s.Tenancy = &v +// SetVpcId sets the VpcId field's value. +func (s *CreateNetworkAclInput) SetVpcId(v string) *CreateNetworkAclInput { + s.VpcId = &v return s } -type CreateCapacityReservationOutput struct { +type CreateNetworkAclOutput struct { _ struct{} `type:"structure"` - // Information about the Capacity Reservation. - CapacityReservation *CapacityReservation `locationName:"capacityReservation" type:"structure"` + // Information about the network ACL. + NetworkAcl *NetworkAcl `locationName:"networkAcl" type:"structure"` } // String returns the string representation -func (s CreateCapacityReservationOutput) String() string { +func (s CreateNetworkAclOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateCapacityReservationOutput) GoString() string { +func (s CreateNetworkAclOutput) GoString() string { return s.String() } -// SetCapacityReservation sets the CapacityReservation field's value. -func (s *CreateCapacityReservationOutput) SetCapacityReservation(v *CapacityReservation) *CreateCapacityReservationOutput { - s.CapacityReservation = v +// SetNetworkAcl sets the NetworkAcl field's value. +func (s *CreateNetworkAclOutput) SetNetworkAcl(v *NetworkAcl) *CreateNetworkAclOutput { + s.NetworkAcl = v return s } -type CreateClientVpnEndpointInput struct { +// Contains the parameters for CreateNetworkInterface. +type CreateNetworkInterfaceInput struct { _ struct{} `type:"structure"` - // Information about the authentication method to be used to authenticate clients. - // - // AuthenticationOptions is a required field - AuthenticationOptions []*ClientVpnAuthenticationRequest `locationName:"Authentication" type:"list" required:"true"` + // A description for the network interface. + Description *string `locationName:"description" type:"string"` - // The IPv4 address range, in CIDR notation, from which to assign client IP - // addresses. The address range cannot overlap with the local CIDR of the VPC - // in which the associated subnet is located, or the routes that you add manually. - // The address range cannot be changed after the Client VPN endpoint has been - // created. The CIDR block should be /22 or greater. - // - // ClientCidrBlock is a required field - ClientCidrBlock *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"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string" idempotencyToken:"true"` + // The IDs of one or more security groups. + Groups []*string `locationName:"SecurityGroupId" locationNameList:"SecurityGroupId" type:"list"` - // Information about the client connection logging options. - // - // If you enable client connection logging, data about client connections is - // sent to a Cloudwatch Logs log stream. The following information is logged: - // - // * Client connection requests - // - // * Client connection results (successful and unsuccessful) - // - // * Reasons for unsuccessful client connection requests - // - // * Client connection termination time - // - // ConnectionLogOptions is a required field - ConnectionLogOptions *ConnectionLogOptions `type:"structure" required:"true"` + // Indicates the type of network interface. To create an Elastic Fabric Adapter + // (EFA), specify efa. For more information, see Elastic Fabric Adapter (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa.html) + // in the Amazon Elastic Compute Cloud User Guide. + InterfaceType *string `type:"string" enum:"NetworkInterfaceCreationType"` - // A brief description of the Client VPN endpoint. - Description *string `type:"string"` + // 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"` - // Information about the DNS servers to be used for DNS resolution. A Client - // VPN endpoint can have up to two DNS servers. If no DNS server is specified, - // the DNS address configured on the device is used for the DNS server. - DnsServers []*string `locationNameList:"item" type:"list"` + // 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"` - // Checks whether you have the required permissions for the action, without - // actually making 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 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"` - // The ARN of the server certificate. For more information, see the AWS Certificate - // Manager User Guide (https://docs.aws.amazon.com/acm/latest/userguide/). - // - // ServerCertificateArn is a required field - ServerCertificateArn *string `type:"string" required:"true"` + // One or more private IPv4 addresses. + PrivateIpAddresses []*PrivateIpAddressSpecification `locationName:"privateIpAddresses" locationNameList:"item" type:"list"` - // Indicates whether split-tunnel is enabled on the AWS Client VPN endpoint. - // - // By default, split-tunnel on a VPN endpoint is disabled. + // 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. // - // For information about split-tunnel VPN endpoints, see Split-Tunnel AWS Client - // VPN Endpoint (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/split-tunnel-vpn.html) - // in the AWS Client VPN Administrator Guide. - SplitTunnel *bool `type:"boolean"` - - // The tags to apply to the Client VPN endpoint during creation. - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // 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 (https://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 transport protocol to be used by the VPN session. + // The ID of the subnet to associate with the network interface. // - // Default value: udp - TransportProtocol *string `type:"string" enum:"TransportProtocol"` + // SubnetId is a required field + SubnetId *string `locationName:"subnetId" type:"string" required:"true"` } // String returns the string representation -func (s CreateClientVpnEndpointInput) String() string { +func (s CreateNetworkInterfaceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateClientVpnEndpointInput) GoString() string { +func (s CreateNetworkInterfaceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateClientVpnEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateClientVpnEndpointInput"} - if s.AuthenticationOptions == nil { - invalidParams.Add(request.NewErrParamRequired("AuthenticationOptions")) - } - if s.ClientCidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("ClientCidrBlock")) - } - if s.ConnectionLogOptions == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectionLogOptions")) - } - if s.ServerCertificateArn == nil { - invalidParams.Add(request.NewErrParamRequired("ServerCertificateArn")) +func (s *CreateNetworkInterfaceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateNetworkInterfaceInput"} + if s.SubnetId == nil { + invalidParams.Add(request.NewErrParamRequired("SubnetId")) } if invalidParams.Len() > 0 { @@ -39460,142 +46983,99 @@ func (s *CreateClientVpnEndpointInput) Validate() error { return nil } -// SetAuthenticationOptions sets the AuthenticationOptions field's value. -func (s *CreateClientVpnEndpointInput) SetAuthenticationOptions(v []*ClientVpnAuthenticationRequest) *CreateClientVpnEndpointInput { - s.AuthenticationOptions = v - return s -} - -// SetClientCidrBlock sets the ClientCidrBlock field's value. -func (s *CreateClientVpnEndpointInput) SetClientCidrBlock(v string) *CreateClientVpnEndpointInput { - s.ClientCidrBlock = &v +// SetDescription sets the Description field's value. +func (s *CreateNetworkInterfaceInput) SetDescription(v string) *CreateNetworkInterfaceInput { + s.Description = &v return s } -// SetClientToken sets the ClientToken field's value. -func (s *CreateClientVpnEndpointInput) SetClientToken(v string) *CreateClientVpnEndpointInput { - s.ClientToken = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateNetworkInterfaceInput) SetDryRun(v bool) *CreateNetworkInterfaceInput { + s.DryRun = &v return s } -// SetConnectionLogOptions sets the ConnectionLogOptions field's value. -func (s *CreateClientVpnEndpointInput) SetConnectionLogOptions(v *ConnectionLogOptions) *CreateClientVpnEndpointInput { - s.ConnectionLogOptions = v +// SetGroups sets the Groups field's value. +func (s *CreateNetworkInterfaceInput) SetGroups(v []*string) *CreateNetworkInterfaceInput { + s.Groups = v return s } -// SetDescription sets the Description field's value. -func (s *CreateClientVpnEndpointInput) SetDescription(v string) *CreateClientVpnEndpointInput { - s.Description = &v +// SetInterfaceType sets the InterfaceType field's value. +func (s *CreateNetworkInterfaceInput) SetInterfaceType(v string) *CreateNetworkInterfaceInput { + s.InterfaceType = &v return s } -// SetDnsServers sets the DnsServers field's value. -func (s *CreateClientVpnEndpointInput) SetDnsServers(v []*string) *CreateClientVpnEndpointInput { - s.DnsServers = v +// SetIpv6AddressCount sets the Ipv6AddressCount field's value. +func (s *CreateNetworkInterfaceInput) SetIpv6AddressCount(v int64) *CreateNetworkInterfaceInput { + s.Ipv6AddressCount = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *CreateClientVpnEndpointInput) SetDryRun(v bool) *CreateClientVpnEndpointInput { - s.DryRun = &v +// SetIpv6Addresses sets the Ipv6Addresses field's value. +func (s *CreateNetworkInterfaceInput) SetIpv6Addresses(v []*InstanceIpv6Address) *CreateNetworkInterfaceInput { + s.Ipv6Addresses = v return s } -// SetServerCertificateArn sets the ServerCertificateArn field's value. -func (s *CreateClientVpnEndpointInput) SetServerCertificateArn(v string) *CreateClientVpnEndpointInput { - s.ServerCertificateArn = &v +// SetPrivateIpAddress sets the PrivateIpAddress field's value. +func (s *CreateNetworkInterfaceInput) SetPrivateIpAddress(v string) *CreateNetworkInterfaceInput { + s.PrivateIpAddress = &v return s } -// SetSplitTunnel sets the SplitTunnel field's value. -func (s *CreateClientVpnEndpointInput) SetSplitTunnel(v bool) *CreateClientVpnEndpointInput { - s.SplitTunnel = &v +// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. +func (s *CreateNetworkInterfaceInput) SetPrivateIpAddresses(v []*PrivateIpAddressSpecification) *CreateNetworkInterfaceInput { + s.PrivateIpAddresses = v return s } -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateClientVpnEndpointInput) SetTagSpecifications(v []*TagSpecification) *CreateClientVpnEndpointInput { - s.TagSpecifications = v +// SetSecondaryPrivateIpAddressCount sets the SecondaryPrivateIpAddressCount field's value. +func (s *CreateNetworkInterfaceInput) SetSecondaryPrivateIpAddressCount(v int64) *CreateNetworkInterfaceInput { + s.SecondaryPrivateIpAddressCount = &v return s } -// SetTransportProtocol sets the TransportProtocol field's value. -func (s *CreateClientVpnEndpointInput) SetTransportProtocol(v string) *CreateClientVpnEndpointInput { - s.TransportProtocol = &v +// SetSubnetId sets the SubnetId field's value. +func (s *CreateNetworkInterfaceInput) SetSubnetId(v string) *CreateNetworkInterfaceInput { + s.SubnetId = &v return s } -type CreateClientVpnEndpointOutput struct { +// Contains the output of CreateNetworkInterface. +type CreateNetworkInterfaceOutput struct { _ struct{} `type:"structure"` - // The ID of the Client VPN endpoint. - ClientVpnEndpointId *string `locationName:"clientVpnEndpointId" type:"string"` - - // The DNS name to be used by clients when establishing their VPN session. - DnsName *string `locationName:"dnsName" type:"string"` - - // The current state of the Client VPN endpoint. - Status *ClientVpnEndpointStatus `locationName:"status" type:"structure"` + // Information about the network interface. + NetworkInterface *NetworkInterface `locationName:"networkInterface" type:"structure"` } // String returns the string representation -func (s CreateClientVpnEndpointOutput) String() string { +func (s CreateNetworkInterfaceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateClientVpnEndpointOutput) GoString() string { +func (s CreateNetworkInterfaceOutput) GoString() string { return s.String() } -// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. -func (s *CreateClientVpnEndpointOutput) SetClientVpnEndpointId(v string) *CreateClientVpnEndpointOutput { - s.ClientVpnEndpointId = &v - return s -} - -// SetDnsName sets the DnsName field's value. -func (s *CreateClientVpnEndpointOutput) SetDnsName(v string) *CreateClientVpnEndpointOutput { - s.DnsName = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateClientVpnEndpointOutput) SetStatus(v *ClientVpnEndpointStatus) *CreateClientVpnEndpointOutput { - s.Status = v +// SetNetworkInterface sets the NetworkInterface field's value. +func (s *CreateNetworkInterfaceOutput) SetNetworkInterface(v *NetworkInterface) *CreateNetworkInterfaceOutput { + s.NetworkInterface = v return s } -type CreateClientVpnRouteInput struct { +// Contains the parameters for CreateNetworkInterfacePermission. +type CreateNetworkInterfacePermissionInput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string" idempotencyToken:"true"` - - // The ID of the Client VPN endpoint to which to add the route. - // - // ClientVpnEndpointId is a required field - ClientVpnEndpointId *string `type:"string" required:"true"` - - // A brief description of the route. - Description *string `type:"string"` + // The AWS account ID. + AwsAccountId *string `type:"string"` - // The IPv4 address range, in CIDR notation, of the route destination. For example: - // - // * To add a route for Internet access, enter 0.0.0.0/0 - // - // * To add a route for a peered VPC, enter the peered VPC's IPv4 CIDR range - // - // * To add a route for an on-premises network, enter the AWS Site-to-Site - // VPN connection's IPv4 CIDR range - // - // Route address ranges cannot overlap with the CIDR range specified for client - // allocation. - // - // DestinationCidrBlock is a required field - DestinationCidrBlock *string `type:"string" required:"true"` + // The AWS service. Currently not supported. + AwsService *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 @@ -39603,34 +47083,35 @@ type CreateClientVpnRouteInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The ID of the subnet through which you want to route traffic. The specified - // subnet must be an existing target network of the Client VPN endpoint. + // The ID of the network interface. // - // TargetVpcSubnetId is a required field - TargetVpcSubnetId *string `type:"string" required:"true"` + // NetworkInterfaceId is a required field + NetworkInterfaceId *string `type:"string" required:"true"` + + // The type of permission to grant. + // + // Permission is a required field + Permission *string `type:"string" required:"true" enum:"InterfacePermissionType"` } // String returns the string representation -func (s CreateClientVpnRouteInput) String() string { +func (s CreateNetworkInterfacePermissionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateClientVpnRouteInput) GoString() string { +func (s CreateNetworkInterfacePermissionInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateClientVpnRouteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateClientVpnRouteInput"} - if s.ClientVpnEndpointId == nil { - invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) - } - if s.DestinationCidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock")) +func (s *CreateNetworkInterfacePermissionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateNetworkInterfacePermissionInput"} + if s.NetworkInterfaceId == nil { + invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) } - if s.TargetVpcSubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("TargetVpcSubnetId")) + if s.Permission == nil { + invalidParams.Add(request.NewErrParamRequired("Permission")) } if invalidParams.Len() > 0 { @@ -39639,113 +47120,185 @@ func (s *CreateClientVpnRouteInput) Validate() error { return nil } -// SetClientToken sets the ClientToken field's value. -func (s *CreateClientVpnRouteInput) SetClientToken(v string) *CreateClientVpnRouteInput { - s.ClientToken = &v +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *CreateNetworkInterfacePermissionInput) SetAwsAccountId(v string) *CreateNetworkInterfacePermissionInput { + s.AwsAccountId = &v return s } -// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. -func (s *CreateClientVpnRouteInput) SetClientVpnEndpointId(v string) *CreateClientVpnRouteInput { - s.ClientVpnEndpointId = &v +// SetAwsService sets the AwsService field's value. +func (s *CreateNetworkInterfacePermissionInput) SetAwsService(v string) *CreateNetworkInterfacePermissionInput { + s.AwsService = &v return s } -// SetDescription sets the Description field's value. -func (s *CreateClientVpnRouteInput) SetDescription(v string) *CreateClientVpnRouteInput { - s.Description = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateNetworkInterfacePermissionInput) SetDryRun(v bool) *CreateNetworkInterfacePermissionInput { + s.DryRun = &v return s } -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *CreateClientVpnRouteInput) SetDestinationCidrBlock(v string) *CreateClientVpnRouteInput { - s.DestinationCidrBlock = &v +// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. +func (s *CreateNetworkInterfacePermissionInput) SetNetworkInterfaceId(v string) *CreateNetworkInterfacePermissionInput { + s.NetworkInterfaceId = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *CreateClientVpnRouteInput) SetDryRun(v bool) *CreateClientVpnRouteInput { - s.DryRun = &v +// SetPermission sets the Permission field's value. +func (s *CreateNetworkInterfacePermissionInput) SetPermission(v string) *CreateNetworkInterfacePermissionInput { + s.Permission = &v return s } -// SetTargetVpcSubnetId sets the TargetVpcSubnetId field's value. -func (s *CreateClientVpnRouteInput) SetTargetVpcSubnetId(v string) *CreateClientVpnRouteInput { - s.TargetVpcSubnetId = &v +// Contains the output of CreateNetworkInterfacePermission. +type CreateNetworkInterfacePermissionOutput struct { + _ struct{} `type:"structure"` + + // Information about the permission for the network interface. + InterfacePermission *NetworkInterfacePermission `locationName:"interfacePermission" type:"structure"` +} + +// String returns the string representation +func (s CreateNetworkInterfacePermissionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNetworkInterfacePermissionOutput) GoString() string { + return s.String() +} + +// SetInterfacePermission sets the InterfacePermission field's value. +func (s *CreateNetworkInterfacePermissionOutput) SetInterfacePermission(v *NetworkInterfacePermission) *CreateNetworkInterfacePermissionOutput { + s.InterfacePermission = v return s } -type CreateClientVpnRouteOutput struct { +type CreatePlacementGroupInput struct { _ struct{} `type:"structure"` - // The current state of the route. - Status *ClientVpnRouteStatus `locationName:"status" 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. Must be unique within the scope of your account + // for the Region. + // + // Constraints: Up to 255 ASCII characters + GroupName *string `locationName:"groupName" type:"string"` + + // The number of partitions. Valid only when Strategy is set to partition. + PartitionCount *int64 `type:"integer"` + + // The placement strategy. + Strategy *string `locationName:"strategy" type:"string" enum:"PlacementStrategy"` } // String returns the string representation -func (s CreateClientVpnRouteOutput) String() string { +func (s CreatePlacementGroupInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateClientVpnRouteOutput) GoString() string { +func (s CreatePlacementGroupInput) GoString() string { return s.String() } -// SetStatus sets the Status field's value. -func (s *CreateClientVpnRouteOutput) SetStatus(v *ClientVpnRouteStatus) *CreateClientVpnRouteOutput { - s.Status = v +// SetDryRun sets the DryRun field's value. +func (s *CreatePlacementGroupInput) SetDryRun(v bool) *CreatePlacementGroupInput { + s.DryRun = &v return s } -// Contains the parameters for CreateCustomerGateway. -type CreateCustomerGatewayInput struct { +// SetGroupName sets the GroupName field's value. +func (s *CreatePlacementGroupInput) SetGroupName(v string) *CreatePlacementGroupInput { + s.GroupName = &v + return s +} + +// SetPartitionCount sets the PartitionCount field's value. +func (s *CreatePlacementGroupInput) SetPartitionCount(v int64) *CreatePlacementGroupInput { + s.PartitionCount = &v + return s +} + +// SetStrategy sets the Strategy field's value. +func (s *CreatePlacementGroupInput) SetStrategy(v string) *CreatePlacementGroupInput { + s.Strategy = &v + return s +} + +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. +type CreateReservedInstancesListingInput struct { _ struct{} `type:"structure"` - // For devices that support BGP, the customer gateway's BGP ASN. - // - // Default: 65000 + // Unique, case-sensitive identifier you provide to ensure idempotency of your + // listings. This helps avoid duplicate listings. For more information, see + // Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). // - // BgpAsn is a required field - BgpAsn *int64 `type:"integer" required:"true"` - - // The Amazon Resource Name (ARN) for the customer gateway certificate. - CertificateArn *string `type:"string"` + // ClientToken is a required field + ClientToken *string `locationName:"clientToken" 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 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"` - // The Internet-routable IP address for the customer gateway's outside interface. - // The address must be static. - PublicIp *string `locationName:"IpAddress" type:"string"` + // 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 type of VPN connection that this customer gateway supports (ipsec.1). + // The ID of the active Standard Reserved Instance. // - // Type is a required field - Type *string `type:"string" required:"true" enum:"GatewayType"` + // ReservedInstancesId is a required field + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string" required:"true"` } // String returns the string representation -func (s CreateCustomerGatewayInput) String() string { +func (s CreateReservedInstancesListingInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateCustomerGatewayInput) GoString() string { +func (s CreateReservedInstancesListingInput) 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")) +func (s *CreateReservedInstancesListingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateReservedInstancesListingInput"} + if s.ClientToken == nil { + invalidParams.Add(request.NewErrParamRequired("ClientToken")) } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) + 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 { @@ -39754,90 +47307,118 @@ func (s *CreateCustomerGatewayInput) Validate() error { return nil } -// SetBgpAsn sets the BgpAsn field's value. -func (s *CreateCustomerGatewayInput) SetBgpAsn(v int64) *CreateCustomerGatewayInput { - s.BgpAsn = &v - return s -} - -// SetCertificateArn sets the CertificateArn field's value. -func (s *CreateCustomerGatewayInput) SetCertificateArn(v string) *CreateCustomerGatewayInput { - s.CertificateArn = &v +// SetClientToken sets the ClientToken field's value. +func (s *CreateReservedInstancesListingInput) SetClientToken(v string) *CreateReservedInstancesListingInput { + s.ClientToken = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *CreateCustomerGatewayInput) SetDryRun(v bool) *CreateCustomerGatewayInput { - s.DryRun = &v +// SetInstanceCount sets the InstanceCount field's value. +func (s *CreateReservedInstancesListingInput) SetInstanceCount(v int64) *CreateReservedInstancesListingInput { + s.InstanceCount = &v return s } -// SetPublicIp sets the PublicIp field's value. -func (s *CreateCustomerGatewayInput) SetPublicIp(v string) *CreateCustomerGatewayInput { - s.PublicIp = &v +// SetPriceSchedules sets the PriceSchedules field's value. +func (s *CreateReservedInstancesListingInput) SetPriceSchedules(v []*PriceScheduleSpecification) *CreateReservedInstancesListingInput { + s.PriceSchedules = v return s } -// SetType sets the Type field's value. -func (s *CreateCustomerGatewayInput) SetType(v string) *CreateCustomerGatewayInput { - s.Type = &v +// SetReservedInstancesId sets the ReservedInstancesId field's value. +func (s *CreateReservedInstancesListingInput) SetReservedInstancesId(v string) *CreateReservedInstancesListingInput { + s.ReservedInstancesId = &v return s } -// Contains the output of CreateCustomerGateway. -type CreateCustomerGatewayOutput struct { +// Contains the output of CreateReservedInstancesListing. +type CreateReservedInstancesListingOutput struct { _ struct{} `type:"structure"` - // Information about the customer gateway. - CustomerGateway *CustomerGateway `locationName:"customerGateway" type:"structure"` + // Information about the Standard Reserved Instance listing. + ReservedInstancesListings []*ReservedInstancesListing `locationName:"reservedInstancesListingsSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s CreateCustomerGatewayOutput) String() string { +func (s CreateReservedInstancesListingOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateCustomerGatewayOutput) GoString() string { +func (s CreateReservedInstancesListingOutput) GoString() string { return s.String() } -// SetCustomerGateway sets the CustomerGateway field's value. -func (s *CreateCustomerGatewayOutput) SetCustomerGateway(v *CustomerGateway) *CreateCustomerGatewayOutput { - s.CustomerGateway = v +// SetReservedInstancesListings sets the ReservedInstancesListings field's value. +func (s *CreateReservedInstancesListingOutput) SetReservedInstancesListings(v []*ReservedInstancesListing) *CreateReservedInstancesListingOutput { + s.ReservedInstancesListings = v return s } -type CreateDefaultSubnetInput struct { +type CreateRouteInput struct { _ struct{} `type:"structure"` - // The Availability Zone in which to create the default subnet. - // - // AvailabilityZone is a required field - AvailabilityZone *string `type:"string" required:"true"` + // 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 `type:"boolean"` + 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"` + + // The ID of the local gateway. + LocalGatewayId *string `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 transit gateway. + TransitGatewayId *string `type:"string"` + + // The ID of a VPC peering connection. + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` } // String returns the string representation -func (s CreateDefaultSubnetInput) String() string { +func (s CreateRouteInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateDefaultSubnetInput) GoString() string { +func (s CreateRouteInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateDefaultSubnetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateDefaultSubnetInput"} - if s.AvailabilityZone == nil { - invalidParams.Add(request.NewErrParamRequired("AvailabilityZone")) +func (s *CreateRouteInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateRouteInput"} + if s.RouteTableId == nil { + invalidParams.Add(request.NewErrParamRequired("RouteTableId")) } if invalidParams.Len() > 0 { @@ -39846,120 +47427,131 @@ func (s *CreateDefaultSubnetInput) Validate() error { return nil } -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateDefaultSubnetInput) SetAvailabilityZone(v string) *CreateDefaultSubnetInput { - s.AvailabilityZone = &v +// 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 *CreateDefaultSubnetInput) SetDryRun(v bool) *CreateDefaultSubnetInput { +func (s *CreateRouteInput) SetDryRun(v bool) *CreateRouteInput { s.DryRun = &v return s } -type CreateDefaultSubnetOutput struct { - _ struct{} `type:"structure"` - - // Information about the subnet. - Subnet *Subnet `locationName:"subnet" type:"structure"` +// SetEgressOnlyInternetGatewayId sets the EgressOnlyInternetGatewayId field's value. +func (s *CreateRouteInput) SetEgressOnlyInternetGatewayId(v string) *CreateRouteInput { + s.EgressOnlyInternetGatewayId = &v + return s } -// String returns the string representation -func (s CreateDefaultSubnetOutput) String() string { - return awsutil.Prettify(s) +// SetGatewayId sets the GatewayId field's value. +func (s *CreateRouteInput) SetGatewayId(v string) *CreateRouteInput { + s.GatewayId = &v + return s } -// GoString returns the string representation -func (s CreateDefaultSubnetOutput) GoString() string { - return s.String() +// SetInstanceId sets the InstanceId field's value. +func (s *CreateRouteInput) SetInstanceId(v string) *CreateRouteInput { + s.InstanceId = &v + return s } -// SetSubnet sets the Subnet field's value. -func (s *CreateDefaultSubnetOutput) SetSubnet(v *Subnet) *CreateDefaultSubnetOutput { - s.Subnet = v +// SetLocalGatewayId sets the LocalGatewayId field's value. +func (s *CreateRouteInput) SetLocalGatewayId(v string) *CreateRouteInput { + s.LocalGatewayId = &v return s } -type CreateDefaultVpcInput struct { - _ struct{} `type:"structure"` +// SetNatGatewayId sets the NatGatewayId field's value. +func (s *CreateRouteInput) SetNatGatewayId(v string) *CreateRouteInput { + s.NatGatewayId = &v + return s +} - // Checks whether you have the required permissions for the action, without - // actually making 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"` +// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. +func (s *CreateRouteInput) SetNetworkInterfaceId(v string) *CreateRouteInput { + s.NetworkInterfaceId = &v + return s } -// String returns the string representation -func (s CreateDefaultVpcInput) String() string { - return awsutil.Prettify(s) +// SetRouteTableId sets the RouteTableId field's value. +func (s *CreateRouteInput) SetRouteTableId(v string) *CreateRouteInput { + s.RouteTableId = &v + return s } -// GoString returns the string representation -func (s CreateDefaultVpcInput) GoString() string { - return s.String() +// SetTransitGatewayId sets the TransitGatewayId field's value. +func (s *CreateRouteInput) SetTransitGatewayId(v string) *CreateRouteInput { + s.TransitGatewayId = &v + return s } -// SetDryRun sets the DryRun field's value. -func (s *CreateDefaultVpcInput) SetDryRun(v bool) *CreateDefaultVpcInput { - s.DryRun = &v +// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. +func (s *CreateRouteInput) SetVpcPeeringConnectionId(v string) *CreateRouteInput { + s.VpcPeeringConnectionId = &v return s } -type CreateDefaultVpcOutput struct { +type CreateRouteOutput struct { _ struct{} `type:"structure"` - // Information about the VPC. - Vpc *Vpc `locationName:"vpc" 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 CreateDefaultVpcOutput) String() string { +func (s CreateRouteOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateDefaultVpcOutput) GoString() string { +func (s CreateRouteOutput) GoString() string { return s.String() } -// SetVpc sets the Vpc field's value. -func (s *CreateDefaultVpcOutput) SetVpc(v *Vpc) *CreateDefaultVpcOutput { - s.Vpc = v +// SetReturn sets the Return field's value. +func (s *CreateRouteOutput) SetReturn(v bool) *CreateRouteOutput { + s.Return = &v return s } -type CreateDhcpOptionsInput struct { +type CreateRouteTableInput 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"` + + // 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 CreateDhcpOptionsInput) String() string { +func (s CreateRouteTableInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateDhcpOptionsInput) GoString() string { +func (s CreateRouteTableInput) 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")) +func (s *CreateRouteTableInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateRouteTableInput"} + if s.VpcId == nil { + invalidParams.Add(request.NewErrParamRequired("VpcId")) } if invalidParams.Len() > 0 { @@ -39968,75 +47560,94 @@ func (s *CreateDhcpOptionsInput) Validate() error { return nil } -// SetDhcpConfigurations sets the DhcpConfigurations field's value. -func (s *CreateDhcpOptionsInput) SetDhcpConfigurations(v []*NewDhcpConfiguration) *CreateDhcpOptionsInput { - s.DhcpConfigurations = v +// SetDryRun sets the DryRun field's value. +func (s *CreateRouteTableInput) SetDryRun(v bool) *CreateRouteTableInput { + s.DryRun = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *CreateDhcpOptionsInput) SetDryRun(v bool) *CreateDhcpOptionsInput { - s.DryRun = &v +// SetVpcId sets the VpcId field's value. +func (s *CreateRouteTableInput) SetVpcId(v string) *CreateRouteTableInput { + s.VpcId = &v return s } -type CreateDhcpOptionsOutput struct { +type CreateRouteTableOutput struct { _ struct{} `type:"structure"` - // A set of DHCP options. - DhcpOptions *DhcpOptions `locationName:"dhcpOptions" type:"structure"` + // Information about the route table. + RouteTable *RouteTable `locationName:"routeTable" type:"structure"` } // String returns the string representation -func (s CreateDhcpOptionsOutput) String() string { +func (s CreateRouteTableOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateDhcpOptionsOutput) GoString() string { +func (s CreateRouteTableOutput) GoString() string { return s.String() } -// SetDhcpOptions sets the DhcpOptions field's value. -func (s *CreateDhcpOptionsOutput) SetDhcpOptions(v *DhcpOptions) *CreateDhcpOptionsOutput { - s.DhcpOptions = v +// SetRouteTable sets the RouteTable field's value. +func (s *CreateRouteTableOutput) SetRouteTable(v *RouteTable) *CreateRouteTableOutput { + s.RouteTable = v return s } -type CreateEgressOnlyInternetGatewayInput struct { +type CreateSecurityGroupInput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` + // 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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the VPC for which to create the egress-only internet gateway. + // The name of the security group. // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` + // Constraints: Up to 255 characters in length. Cannot start with sg-. + // + // 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 CreateEgressOnlyInternetGatewayInput) String() string { +func (s CreateSecurityGroupInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateEgressOnlyInternetGatewayInput) GoString() string { +func (s CreateSecurityGroupInput) 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")) +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 { @@ -40045,213 +47656,89 @@ func (s *CreateEgressOnlyInternetGatewayInput) Validate() error { return nil } -// SetClientToken sets the ClientToken field's value. -func (s *CreateEgressOnlyInternetGatewayInput) SetClientToken(v string) *CreateEgressOnlyInternetGatewayInput { - s.ClientToken = &v +// 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 *CreateEgressOnlyInternetGatewayInput) SetDryRun(v bool) *CreateEgressOnlyInternetGatewayInput { +func (s *CreateSecurityGroupInput) SetDryRun(v bool) *CreateSecurityGroupInput { s.DryRun = &v return s } -// SetVpcId sets the VpcId field's value. -func (s *CreateEgressOnlyInternetGatewayInput) SetVpcId(v string) *CreateEgressOnlyInternetGatewayInput { - s.VpcId = &v - return s -} - -type CreateEgressOnlyInternetGatewayOutput struct { - _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that 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 +// SetGroupName sets the GroupName field's value. +func (s *CreateSecurityGroupInput) SetGroupName(v string) *CreateSecurityGroupInput { + s.GroupName = &v return s } -// SetEgressOnlyInternetGateway sets the EgressOnlyInternetGateway field's value. -func (s *CreateEgressOnlyInternetGatewayOutput) SetEgressOnlyInternetGateway(v *EgressOnlyInternetGateway) *CreateEgressOnlyInternetGatewayOutput { - s.EgressOnlyInternetGateway = v +// SetVpcId sets the VpcId field's value. +func (s *CreateSecurityGroupInput) SetVpcId(v string) *CreateSecurityGroupInput { + s.VpcId = &v return s } -// Describes the instances that could not be launched by the fleet. -type CreateFleetError struct { +type CreateSecurityGroupOutput struct { _ struct{} `type:"structure"` - // The error code that indicates why the instance could not be launched. For - // more information about error codes, see Error Codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html.html). - ErrorCode *string `locationName:"errorCode" type:"string"` - - // The error message that describes why the instance could not be launched. - // For more information about error messages, see ee Error Codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html.html). - ErrorMessage *string `locationName:"errorMessage" type:"string"` - - // The launch templates and overrides that were used for launching the instances. - // Any parameters that you specify in the Overrides override the same parameters - // in the launch template. - LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse `locationName:"launchTemplateAndOverrides" type:"structure"` - - // Indicates if the instance that could not be launched was a Spot Instance - // or On-Demand Instance. - Lifecycle *string `locationName:"lifecycle" type:"string" enum:"InstanceLifecycle"` + // The ID of the security group. + GroupId *string `locationName:"groupId" type:"string"` } // String returns the string representation -func (s CreateFleetError) String() string { +func (s CreateSecurityGroupOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateFleetError) GoString() string { +func (s CreateSecurityGroupOutput) GoString() string { return s.String() } -// SetErrorCode sets the ErrorCode field's value. -func (s *CreateFleetError) SetErrorCode(v string) *CreateFleetError { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *CreateFleetError) SetErrorMessage(v string) *CreateFleetError { - s.ErrorMessage = &v - return s -} - -// SetLaunchTemplateAndOverrides sets the LaunchTemplateAndOverrides field's value. -func (s *CreateFleetError) SetLaunchTemplateAndOverrides(v *LaunchTemplateAndOverridesResponse) *CreateFleetError { - s.LaunchTemplateAndOverrides = v - return s -} - -// SetLifecycle sets the Lifecycle field's value. -func (s *CreateFleetError) SetLifecycle(v string) *CreateFleetError { - s.Lifecycle = &v +// SetGroupId sets the GroupId field's value. +func (s *CreateSecurityGroupOutput) SetGroupId(v string) *CreateSecurityGroupOutput { + s.GroupId = &v return s } -type CreateFleetInput struct { +type CreateSnapshotInput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` + // 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 `type:"boolean"` - - // Indicates whether running instances should be terminated if the total target - // capacity of the EC2 Fleet is decreased below the current size of the EC2 - // Fleet. - ExcessCapacityTerminationPolicy *string `type:"string" enum:"FleetExcessCapacityTerminationPolicy"` - - // The configuration for the EC2 Fleet. - // - // LaunchTemplateConfigs is a required field - LaunchTemplateConfigs []*FleetLaunchTemplateConfigRequest `locationNameList:"item" type:"list" required:"true"` - - // Describes the configuration of On-Demand Instances in an EC2 Fleet. - OnDemandOptions *OnDemandOptionsRequest `type:"structure"` - - // Indicates whether EC2 Fleet should replace unhealthy instances. - ReplaceUnhealthyInstances *bool `type:"boolean"` - - // Describes the configuration of Spot Instances in an EC2 Fleet. - SpotOptions *SpotOptionsRequest `type:"structure"` - - // The key-value pair for tagging the EC2 Fleet request on creation. The value - // for ResourceType must be fleet, otherwise the fleet request fails. To tag - // instances at launch, specify the tags in the launch template (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template). - // For information about tagging after launch, see Tagging Your Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources). - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` - - // The number of units to request. - // - // TargetCapacitySpecification is a required field - TargetCapacitySpecification *TargetCapacitySpecificationRequest `type:"structure" required:"true"` - - // Indicates whether running instances should be terminated when the EC2 Fleet - // expires. - TerminateInstancesWithExpiration *bool `type:"boolean"` - - // The type of the request. By default, the EC2 Fleet places an asynchronous - // request for your desired capacity, and maintains it by replenishing interrupted - // Spot Instances (maintain). A value of instant places a synchronous one-time - // request, and returns errors for any instances that could not be launched. - // A value of request places an asynchronous one-time request without maintaining - // capacity or submitting requests in alternative capacity pools if capacity - // is unavailable. For more information, see EC2 Fleet Request Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-fleet-configuration-strategies.html#ec2-fleet-request-type) - // in the Amazon Elastic Compute Cloud User Guide. - Type *string `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 `type:"timestamp"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // The end date and time of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // At this point, no new EC2 Fleet requests are placed or able to fulfill the - // request. If no value is specified, the request remains until you cancel it. - ValidUntil *time.Time `type:"timestamp"` + // The tags to apply to the snapshot during creation. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + + // The ID of the EBS volume. + // + // VolumeId is a required field + VolumeId *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateFleetInput) String() string { +func (s CreateSnapshotInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateFleetInput) GoString() string { +func (s CreateSnapshotInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateFleetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateFleetInput"} - if s.LaunchTemplateConfigs == nil { - invalidParams.Add(request.NewErrParamRequired("LaunchTemplateConfigs")) - } - if s.TargetCapacitySpecification == nil { - invalidParams.Add(request.NewErrParamRequired("TargetCapacitySpecification")) - } - if s.LaunchTemplateConfigs != nil { - for i, v := range s.LaunchTemplateConfigs { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LaunchTemplateConfigs", i), err.(request.ErrInvalidParams)) - } - } - } - if s.TargetCapacitySpecification != nil { - if err := s.TargetCapacitySpecification.Validate(); err != nil { - invalidParams.AddNested("TargetCapacitySpecification", err.(request.ErrInvalidParams)) - } +func (s *CreateSnapshotInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateSnapshotInput"} + if s.VolumeId == nil { + invalidParams.Add(request.NewErrParamRequired("VolumeId")) } if invalidParams.Len() > 0 { @@ -40260,297 +47747,273 @@ func (s *CreateFleetInput) Validate() error { return nil } -// SetClientToken sets the ClientToken field's value. -func (s *CreateFleetInput) SetClientToken(v string) *CreateFleetInput { - s.ClientToken = &v +// 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 *CreateFleetInput) SetDryRun(v bool) *CreateFleetInput { +func (s *CreateSnapshotInput) SetDryRun(v bool) *CreateSnapshotInput { s.DryRun = &v return s } -// SetExcessCapacityTerminationPolicy sets the ExcessCapacityTerminationPolicy field's value. -func (s *CreateFleetInput) SetExcessCapacityTerminationPolicy(v string) *CreateFleetInput { - s.ExcessCapacityTerminationPolicy = &v +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateSnapshotInput) SetTagSpecifications(v []*TagSpecification) *CreateSnapshotInput { + s.TagSpecifications = v return s } -// SetLaunchTemplateConfigs sets the LaunchTemplateConfigs field's value. -func (s *CreateFleetInput) SetLaunchTemplateConfigs(v []*FleetLaunchTemplateConfigRequest) *CreateFleetInput { - s.LaunchTemplateConfigs = v +// SetVolumeId sets the VolumeId field's value. +func (s *CreateSnapshotInput) SetVolumeId(v string) *CreateSnapshotInput { + s.VolumeId = &v return s } -// SetOnDemandOptions sets the OnDemandOptions field's value. -func (s *CreateFleetInput) SetOnDemandOptions(v *OnDemandOptionsRequest) *CreateFleetInput { - s.OnDemandOptions = v - return s +type CreateSnapshotsInput struct { + _ struct{} `type:"structure"` + + // Copies the tags from the specified volume to corresponding snapshot. + CopyTagsFromSource *string `type:"string" enum:"CopyTagsFromSource"` + + // A description propagated to every snapshot specified by the instance. + 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 `type:"boolean"` + + // The instance to specify which volumes should be included in the snapshots. + // + // InstanceSpecification is a required field + InstanceSpecification *InstanceSpecification `type:"structure" required:"true"` + + // Tags to apply to every snapshot specified by the instance. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } -// SetReplaceUnhealthyInstances sets the ReplaceUnhealthyInstances field's value. -func (s *CreateFleetInput) SetReplaceUnhealthyInstances(v bool) *CreateFleetInput { - s.ReplaceUnhealthyInstances = &v - return s +// String returns the string representation +func (s CreateSnapshotsInput) String() string { + return awsutil.Prettify(s) } -// SetSpotOptions sets the SpotOptions field's value. -func (s *CreateFleetInput) SetSpotOptions(v *SpotOptionsRequest) *CreateFleetInput { - s.SpotOptions = v - return s +// GoString returns the string representation +func (s CreateSnapshotsInput) GoString() string { + return s.String() } -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateFleetInput) SetTagSpecifications(v []*TagSpecification) *CreateFleetInput { - s.TagSpecifications = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateSnapshotsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateSnapshotsInput"} + if s.InstanceSpecification == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceSpecification")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetTargetCapacitySpecification sets the TargetCapacitySpecification field's value. -func (s *CreateFleetInput) SetTargetCapacitySpecification(v *TargetCapacitySpecificationRequest) *CreateFleetInput { - s.TargetCapacitySpecification = v +// SetCopyTagsFromSource sets the CopyTagsFromSource field's value. +func (s *CreateSnapshotsInput) SetCopyTagsFromSource(v string) *CreateSnapshotsInput { + s.CopyTagsFromSource = &v return s } -// SetTerminateInstancesWithExpiration sets the TerminateInstancesWithExpiration field's value. -func (s *CreateFleetInput) SetTerminateInstancesWithExpiration(v bool) *CreateFleetInput { - s.TerminateInstancesWithExpiration = &v +// SetDescription sets the Description field's value. +func (s *CreateSnapshotsInput) SetDescription(v string) *CreateSnapshotsInput { + s.Description = &v return s } -// SetType sets the Type field's value. -func (s *CreateFleetInput) SetType(v string) *CreateFleetInput { - s.Type = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateSnapshotsInput) SetDryRun(v bool) *CreateSnapshotsInput { + s.DryRun = &v return s } -// SetValidFrom sets the ValidFrom field's value. -func (s *CreateFleetInput) SetValidFrom(v time.Time) *CreateFleetInput { - s.ValidFrom = &v +// SetInstanceSpecification sets the InstanceSpecification field's value. +func (s *CreateSnapshotsInput) SetInstanceSpecification(v *InstanceSpecification) *CreateSnapshotsInput { + s.InstanceSpecification = v return s } -// SetValidUntil sets the ValidUntil field's value. -func (s *CreateFleetInput) SetValidUntil(v time.Time) *CreateFleetInput { - s.ValidUntil = &v +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateSnapshotsInput) SetTagSpecifications(v []*TagSpecification) *CreateSnapshotsInput { + s.TagSpecifications = v return s } -// Describes the instances that were launched by the fleet. -type CreateFleetInstance struct { +type CreateSnapshotsOutput struct { _ struct{} `type:"structure"` - // The IDs of the instances. - InstanceIds []*string `locationName:"instanceIds" locationNameList:"item" type:"list"` + // List of snapshots. + Snapshots []*SnapshotInfo `locationName:"snapshotSet" locationNameList:"item" type:"list"` +} - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` +// String returns the string representation +func (s CreateSnapshotsOutput) String() string { + return awsutil.Prettify(s) +} - // The launch templates and overrides that were used for launching the instances. - // Any parameters that you specify in the Overrides override the same parameters - // in the launch template. - LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse `locationName:"launchTemplateAndOverrides" type:"structure"` +// GoString returns the string representation +func (s CreateSnapshotsOutput) GoString() string { + return s.String() +} - // Indicates if the instance that was launched is a Spot Instance or On-Demand - // Instance. - Lifecycle *string `locationName:"lifecycle" type:"string" enum:"InstanceLifecycle"` +// SetSnapshots sets the Snapshots field's value. +func (s *CreateSnapshotsOutput) SetSnapshots(v []*SnapshotInfo) *CreateSnapshotsOutput { + s.Snapshots = v + return s +} - // The value is Windows for Windows instances; otherwise blank. - Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` +// Contains the parameters for CreateSpotDatafeedSubscription. +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 CreateFleetInstance) String() string { +func (s CreateSpotDatafeedSubscriptionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateFleetInstance) GoString() string { +func (s CreateSpotDatafeedSubscriptionInput) GoString() string { return s.String() } -// SetInstanceIds sets the InstanceIds field's value. -func (s *CreateFleetInstance) SetInstanceIds(v []*string) *CreateFleetInstance { - s.InstanceIds = v - return s -} +// 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")) + } -// SetInstanceType sets the InstanceType field's value. -func (s *CreateFleetInstance) SetInstanceType(v string) *CreateFleetInstance { - s.InstanceType = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetLaunchTemplateAndOverrides sets the LaunchTemplateAndOverrides field's value. -func (s *CreateFleetInstance) SetLaunchTemplateAndOverrides(v *LaunchTemplateAndOverridesResponse) *CreateFleetInstance { - s.LaunchTemplateAndOverrides = v +// SetBucket sets the Bucket field's value. +func (s *CreateSpotDatafeedSubscriptionInput) SetBucket(v string) *CreateSpotDatafeedSubscriptionInput { + s.Bucket = &v return s } -// SetLifecycle sets the Lifecycle field's value. -func (s *CreateFleetInstance) SetLifecycle(v string) *CreateFleetInstance { - s.Lifecycle = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateSpotDatafeedSubscriptionInput) SetDryRun(v bool) *CreateSpotDatafeedSubscriptionInput { + s.DryRun = &v return s } -// SetPlatform sets the Platform field's value. -func (s *CreateFleetInstance) SetPlatform(v string) *CreateFleetInstance { - s.Platform = &v +// SetPrefix sets the Prefix field's value. +func (s *CreateSpotDatafeedSubscriptionInput) SetPrefix(v string) *CreateSpotDatafeedSubscriptionInput { + s.Prefix = &v return s } -type CreateFleetOutput struct { +// Contains the output of CreateSpotDatafeedSubscription. +type CreateSpotDatafeedSubscriptionOutput struct { _ struct{} `type:"structure"` - // Information about the instances that could not be launched by the fleet. - // Valid only when Type is set to instant. - Errors []*CreateFleetError `locationName:"errorSet" locationNameList:"item" type:"list"` - - // The ID of the EC2 Fleet. - FleetId *string `locationName:"fleetId" type:"string"` - - // Information about the instances that were launched by the fleet. Valid only - // when Type is set to instant. - Instances []*CreateFleetInstance `locationName:"fleetInstanceSet" locationNameList:"item" type:"list"` + // The Spot Instance data feed subscription. + SpotDatafeedSubscription *SpotDatafeedSubscription `locationName:"spotDatafeedSubscription" type:"structure"` } // String returns the string representation -func (s CreateFleetOutput) String() string { +func (s CreateSpotDatafeedSubscriptionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateFleetOutput) GoString() string { +func (s CreateSpotDatafeedSubscriptionOutput) GoString() string { return s.String() } -// SetErrors sets the Errors field's value. -func (s *CreateFleetOutput) SetErrors(v []*CreateFleetError) *CreateFleetOutput { - s.Errors = v - return s -} - -// SetFleetId sets the FleetId field's value. -func (s *CreateFleetOutput) SetFleetId(v string) *CreateFleetOutput { - s.FleetId = &v - return s -} - -// SetInstances sets the Instances field's value. -func (s *CreateFleetOutput) SetInstances(v []*CreateFleetInstance) *CreateFleetOutput { - s.Instances = v +// SetSpotDatafeedSubscription sets the SpotDatafeedSubscription field's value. +func (s *CreateSpotDatafeedSubscriptionOutput) SetSpotDatafeedSubscription(v *SpotDatafeedSubscription) *CreateSpotDatafeedSubscriptionOutput { + s.SpotDatafeedSubscription = v return s } -type CreateFlowLogsInput struct { +type CreateSubnetInput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` + // The Availability Zone or Local Zone for the subnet. + // + // Default: AWS selects one for you. If you create more than one subnet in your + // VPC, we do not necessarily select a different zone for each subnet. + // + // To create a subnet in a Local Zone, set this value to the Local Zone ID, + // for example us-west-2-lax-1a. For information about the Regions that support + // Local Zones, see Available Regions (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-available-regions) + // in the Amazon Elastic Compute Cloud User Guide. + AvailabilityZone *string `type:"string"` - // The ARN for the IAM role that permits Amazon EC2 to publish flow logs to - // a CloudWatch Logs log group in your account. + // The AZ ID or the Local Zone ID of the subnet. + AvailabilityZoneId *string `type:"string"` + + // The IPv4 network range for the subnet, in CIDR notation. For example, 10.0.0.0/24. // - // If you specify LogDestinationType as s3, do not specify DeliverLogsPermissionArn - // or LogGroupName. - DeliverLogsPermissionArn *string `type:"string"` + // 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 `type:"boolean"` - - // Specifies the destination to which the flow log data is to be published. - // Flow log data can be published to a CloudWatch Logs log group or an Amazon - // S3 bucket. The value specified for this parameter depends on the value specified - // for LogDestinationType. - // - // If LogDestinationType is not specified or cloud-watch-logs, specify the Amazon - // Resource Name (ARN) of the CloudWatch Logs log group. - // - // If LogDestinationType is s3, specify the ARN of the Amazon S3 bucket. You - // can also specify a subfolder in the bucket. To specify a subfolder in the - // bucket, use the following ARN format: bucket_ARN/subfolder_name/. For example, - // to specify a subfolder named my-logs in a bucket named my-bucket, use the - // following ARN: arn:aws:s3:::my-bucket/my-logs/. You cannot use AWSLogs as - // a subfolder name. This is a reserved term. - LogDestination *string `type:"string"` - - // Specifies the type of destination to which the flow log data is to be published. - // Flow log data can be published to CloudWatch Logs or Amazon S3. To publish - // flow log data to CloudWatch Logs, specify cloud-watch-logs. To publish flow - // log data to Amazon S3, specify s3. - // - // If you specify LogDestinationType as s3, do not specify DeliverLogsPermissionArn - // or LogGroupName. - // - // Default: cloud-watch-logs - LogDestinationType *string `type:"string" enum:"LogDestinationType"` - - // The fields to include in the flow log record, in the order in which they - // should appear. For a list of available fields, see Flow Log Records (https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html#flow-log-records). - // If you omit this parameter, the flow log is created using the default format. - // If you specify this parameter, you must specify at least one field. - // - // Specify the fields using the ${field-id} format, separated by spaces. For - // the AWS CLI, use single quotation marks (' ') to surround the parameter value. - // - // Only applicable to flow logs that are published to an Amazon S3 bucket. - LogFormat *string `type:"string"` - - // The name of a new or existing CloudWatch Logs log group where Amazon EC2 - // publishes your flow logs. - // - // If you specify LogDestinationType as s3, do not specify DeliverLogsPermissionArn - // or LogGroupName. - LogGroupName *string `type:"string"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the subnet, network interface, or VPC for which you want to create - // a flow log. - // - // Constraints: Maximum of 1000 resources - // - // ResourceIds is a required field - ResourceIds []*string `locationName:"ResourceId" locationNameList:"item" type:"list" required:"true"` + // The IPv6 network range for the subnet, in CIDR notation. The subnet size + // must use a /64 prefix length. + Ipv6CidrBlock *string `type:"string"` - // The type of resource for which to create the flow log. For example, if you - // specified a VPC ID for the ResourceId property, specify VPC for this property. - // - // ResourceType is a required field - ResourceType *string `type:"string" required:"true" enum:"FlowLogsResourceType"` + // The Amazon Resource Name (ARN) of the Outpost. + OutpostArn *string `type:"string"` - // The type of traffic to log. You can log traffic that the resource accepts - // or rejects, or all traffic. + // The ID of the VPC. // - // TrafficType is a required field - TrafficType *string `type:"string" required:"true" enum:"TrafficType"` + // VpcId is a required field + VpcId *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateFlowLogsInput) String() string { +func (s CreateSubnetInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateFlowLogsInput) GoString() string { +func (s CreateSubnetInput) 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.ResourceIds == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIds")) - } - if s.ResourceType == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceType")) +func (s *CreateSubnetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateSubnetInput"} + if s.CidrBlock == nil { + invalidParams.Add(request.NewErrParamRequired("CidrBlock")) } - if s.TrafficType == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficType")) + if s.VpcId == nil { + invalidParams.Add(request.NewErrParamRequired("VpcId")) } if invalidParams.Len() > 0 { @@ -40559,152 +48022,114 @@ func (s *CreateFlowLogsInput) Validate() error { 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 -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateFlowLogsInput) SetDryRun(v bool) *CreateFlowLogsInput { - s.DryRun = &v - return s -} - -// SetLogDestination sets the LogDestination field's value. -func (s *CreateFlowLogsInput) SetLogDestination(v string) *CreateFlowLogsInput { - s.LogDestination = &v +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *CreateSubnetInput) SetAvailabilityZone(v string) *CreateSubnetInput { + s.AvailabilityZone = &v return s } -// SetLogDestinationType sets the LogDestinationType field's value. -func (s *CreateFlowLogsInput) SetLogDestinationType(v string) *CreateFlowLogsInput { - s.LogDestinationType = &v +// SetAvailabilityZoneId sets the AvailabilityZoneId field's value. +func (s *CreateSubnetInput) SetAvailabilityZoneId(v string) *CreateSubnetInput { + s.AvailabilityZoneId = &v return s } -// SetLogFormat sets the LogFormat field's value. -func (s *CreateFlowLogsInput) SetLogFormat(v string) *CreateFlowLogsInput { - s.LogFormat = &v +// SetCidrBlock sets the CidrBlock field's value. +func (s *CreateSubnetInput) SetCidrBlock(v string) *CreateSubnetInput { + s.CidrBlock = &v return s } -// SetLogGroupName sets the LogGroupName field's value. -func (s *CreateFlowLogsInput) SetLogGroupName(v string) *CreateFlowLogsInput { - s.LogGroupName = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateSubnetInput) SetDryRun(v bool) *CreateSubnetInput { + s.DryRun = &v return s } -// SetResourceIds sets the ResourceIds field's value. -func (s *CreateFlowLogsInput) SetResourceIds(v []*string) *CreateFlowLogsInput { - s.ResourceIds = v +// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. +func (s *CreateSubnetInput) SetIpv6CidrBlock(v string) *CreateSubnetInput { + s.Ipv6CidrBlock = &v return s } -// SetResourceType sets the ResourceType field's value. -func (s *CreateFlowLogsInput) SetResourceType(v string) *CreateFlowLogsInput { - s.ResourceType = &v +// SetOutpostArn sets the OutpostArn field's value. +func (s *CreateSubnetInput) SetOutpostArn(v string) *CreateSubnetInput { + s.OutpostArn = &v return s } -// SetTrafficType sets the TrafficType field's value. -func (s *CreateFlowLogsInput) SetTrafficType(v string) *CreateFlowLogsInput { - s.TrafficType = &v +// SetVpcId sets the VpcId field's value. +func (s *CreateSubnetInput) SetVpcId(v string) *CreateSubnetInput { + s.VpcId = &v return s } -type CreateFlowLogsOutput struct { +type CreateSubnetOutput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier that 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"` + // Information about the subnet. + Subnet *Subnet `locationName:"subnet" type:"structure"` } // String returns the string representation -func (s CreateFlowLogsOutput) String() string { +func (s CreateSubnetOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateFlowLogsOutput) GoString() string { +func (s CreateSubnetOutput) 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 +// SetSubnet sets the Subnet field's value. +func (s *CreateSubnetOutput) SetSubnet(v *Subnet) *CreateSubnetOutput { + s.Subnet = v return s } -type CreateFpgaImageInput struct { +type CreateTagsInput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` - - // A description for the AFI. - 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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // The location of the encrypted design checkpoint in Amazon S3. The input must - // be a tarball. + // The IDs of the resources, separated by spaces. // - // InputStorageLocation is a required field - InputStorageLocation *StorageLocation `type:"structure" required:"true"` - - // The location in Amazon S3 for the output logs. - LogsStorageLocation *StorageLocation `type:"structure"` + // Constraints: Up to 1000 resource IDs. We recommend breaking up this request + // into smaller batches. + // + // Resources is a required field + Resources []*string `locationName:"ResourceId" type:"list" required:"true"` - // A name for the AFI. - Name *string `type:"string"` + // The 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 CreateFpgaImageInput) String() string { +func (s CreateTagsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateFpgaImageInput) GoString() string { +func (s CreateTagsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateFpgaImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateFpgaImageInput"} - if s.InputStorageLocation == nil { - invalidParams.Add(request.NewErrParamRequired("InputStorageLocation")) +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 { @@ -40713,231 +48138,216 @@ func (s *CreateFpgaImageInput) Validate() error { return nil } -// SetClientToken sets the ClientToken field's value. -func (s *CreateFpgaImageInput) SetClientToken(v string) *CreateFpgaImageInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateFpgaImageInput) SetDescription(v string) *CreateFpgaImageInput { - s.Description = &v - return s -} - // SetDryRun sets the DryRun field's value. -func (s *CreateFpgaImageInput) SetDryRun(v bool) *CreateFpgaImageInput { +func (s *CreateTagsInput) SetDryRun(v bool) *CreateTagsInput { s.DryRun = &v return s } -// SetInputStorageLocation sets the InputStorageLocation field's value. -func (s *CreateFpgaImageInput) SetInputStorageLocation(v *StorageLocation) *CreateFpgaImageInput { - s.InputStorageLocation = v - return s -} - -// SetLogsStorageLocation sets the LogsStorageLocation field's value. -func (s *CreateFpgaImageInput) SetLogsStorageLocation(v *StorageLocation) *CreateFpgaImageInput { - s.LogsStorageLocation = v +// SetResources sets the Resources field's value. +func (s *CreateTagsInput) SetResources(v []*string) *CreateTagsInput { + s.Resources = v return s } -// SetName sets the Name field's value. -func (s *CreateFpgaImageInput) SetName(v string) *CreateFpgaImageInput { - s.Name = &v +// SetTags sets the Tags field's value. +func (s *CreateTagsInput) SetTags(v []*Tag) *CreateTagsInput { + s.Tags = v return s } -type CreateFpgaImageOutput struct { +type CreateTagsOutput struct { _ struct{} `type:"structure"` - - // The global FPGA image identifier (AGFI ID). - FpgaImageGlobalId *string `locationName:"fpgaImageGlobalId" type:"string"` - - // The FPGA image identifier (AFI ID). - FpgaImageId *string `locationName:"fpgaImageId" type:"string"` } // String returns the string representation -func (s CreateFpgaImageOutput) String() string { +func (s CreateTagsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateFpgaImageOutput) GoString() string { +func (s CreateTagsOutput) GoString() string { return s.String() } -// SetFpgaImageGlobalId sets the FpgaImageGlobalId field's value. -func (s *CreateFpgaImageOutput) SetFpgaImageGlobalId(v string) *CreateFpgaImageOutput { - s.FpgaImageGlobalId = &v - return s -} - -// SetFpgaImageId sets the FpgaImageId field's value. -func (s *CreateFpgaImageOutput) SetFpgaImageId(v string) *CreateFpgaImageOutput { - s.FpgaImageId = &v - return s -} - -type CreateImageInput struct { +type CreateTrafficMirrorFilterInput struct { _ struct{} `type:"structure"` - // The block device mappings. This parameter cannot be used to modify the encryption - // status of existing volumes or snapshots. To create an AMI with encrypted - // snapshots, use the CopyImage action. - BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `type:"string" idempotencyToken:"true"` - // A description for the new image. - Description *string `locationName:"description" type:"string"` + // The description of the Traffic Mirror filter. + 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 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"` + DryRun *bool `type:"boolean"` - // 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"` + // The tags to assign to a Traffic Mirror filter. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } // String returns the string representation -func (s CreateImageInput) String() string { +func (s CreateTrafficMirrorFilterInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateImageInput) GoString() string { +func (s CreateTrafficMirrorFilterInput) 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 +// SetClientToken sets the ClientToken field's value. +func (s *CreateTrafficMirrorFilterInput) SetClientToken(v string) *CreateTrafficMirrorFilterInput { + s.ClientToken = &v return s } // SetDescription sets the Description field's value. -func (s *CreateImageInput) SetDescription(v string) *CreateImageInput { +func (s *CreateTrafficMirrorFilterInput) SetDescription(v string) *CreateTrafficMirrorFilterInput { s.Description = &v return s } // SetDryRun sets the DryRun field's value. -func (s *CreateImageInput) SetDryRun(v bool) *CreateImageInput { +func (s *CreateTrafficMirrorFilterInput) SetDryRun(v bool) *CreateTrafficMirrorFilterInput { 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 +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateTrafficMirrorFilterInput) SetTagSpecifications(v []*TagSpecification) *CreateTrafficMirrorFilterInput { + s.TagSpecifications = v return s } -type CreateImageOutput struct { +type CreateTrafficMirrorFilterOutput struct { _ struct{} `type:"structure"` - // The ID of the new AMI. - ImageId *string `locationName:"imageId" type:"string"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `locationName:"clientToken" type:"string"` + + // Information about the Traffic Mirror filter. + TrafficMirrorFilter *TrafficMirrorFilter `locationName:"trafficMirrorFilter" type:"structure"` } // String returns the string representation -func (s CreateImageOutput) String() string { +func (s CreateTrafficMirrorFilterOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateImageOutput) GoString() string { +func (s CreateTrafficMirrorFilterOutput) GoString() string { return s.String() } -// SetImageId sets the ImageId field's value. -func (s *CreateImageOutput) SetImageId(v string) *CreateImageOutput { - s.ImageId = &v +// SetClientToken sets the ClientToken field's value. +func (s *CreateTrafficMirrorFilterOutput) SetClientToken(v string) *CreateTrafficMirrorFilterOutput { + s.ClientToken = &v return s } -type CreateInstanceExportTaskInput struct { +// SetTrafficMirrorFilter sets the TrafficMirrorFilter field's value. +func (s *CreateTrafficMirrorFilterOutput) SetTrafficMirrorFilter(v *TrafficMirrorFilter) *CreateTrafficMirrorFilterOutput { + s.TrafficMirrorFilter = v + return s +} + +type CreateTrafficMirrorFilterRuleInput 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"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `type:"string" idempotencyToken:"true"` - // The format and location for an instance export task. - ExportToS3Task *ExportToS3TaskSpecification `locationName:"exportToS3" type:"structure"` + // The description of the Traffic Mirror rule. + Description *string `type:"string"` - // The ID of the instance. + // The destination CIDR block to assign to the Traffic Mirror rule. // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` + // DestinationCidrBlock is a required field + DestinationCidrBlock *string `type:"string" required:"true"` - // The target virtualization environment. - TargetEnvironment *string `locationName:"targetEnvironment" type:"string" enum:"ExportEnvironment"` + // The destination port range. + DestinationPortRange *TrafficMirrorPortRangeRequest `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 protocol, for example UDP, to assign to the Traffic Mirror rule. + // + // For information about the protocol value, see Protocol Numbers (https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml) + // on the Internet Assigned Numbers Authority (IANA) website. + Protocol *int64 `type:"integer"` + + // The action to take (accept | reject) on the filtered traffic. + // + // RuleAction is a required field + RuleAction *string `type:"string" required:"true" enum:"TrafficMirrorRuleAction"` + + // The number of the Traffic Mirror rule. This number must be unique for each + // Traffic Mirror rule in a given direction. The rules are processed in ascending + // order by rule number. + // + // RuleNumber is a required field + RuleNumber *int64 `type:"integer" required:"true"` + + // The source CIDR block to assign to the Traffic Mirror rule. + // + // SourceCidrBlock is a required field + SourceCidrBlock *string `type:"string" required:"true"` + + // The source port range. + SourcePortRange *TrafficMirrorPortRangeRequest `type:"structure"` + + // The type of traffic (ingress | egress). + // + // TrafficDirection is a required field + TrafficDirection *string `type:"string" required:"true" enum:"TrafficDirection"` + + // The ID of the filter that this rule is associated with. + // + // TrafficMirrorFilterId is a required field + TrafficMirrorFilterId *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateInstanceExportTaskInput) String() string { +func (s CreateTrafficMirrorFilterRuleInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateInstanceExportTaskInput) GoString() string { +func (s CreateTrafficMirrorFilterRuleInput) 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")) +func (s *CreateTrafficMirrorFilterRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTrafficMirrorFilterRuleInput"} + if s.DestinationCidrBlock == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock")) + } + if s.RuleAction == nil { + invalidParams.Add(request.NewErrParamRequired("RuleAction")) + } + if s.RuleNumber == nil { + invalidParams.Add(request.NewErrParamRequired("RuleNumber")) + } + if s.SourceCidrBlock == nil { + invalidParams.Add(request.NewErrParamRequired("SourceCidrBlock")) + } + if s.TrafficDirection == nil { + invalidParams.Add(request.NewErrParamRequired("TrafficDirection")) + } + if s.TrafficMirrorFilterId == nil { + invalidParams.Add(request.NewErrParamRequired("TrafficMirrorFilterId")) } if invalidParams.Len() > 0 { @@ -40946,134 +48356,195 @@ func (s *CreateInstanceExportTaskInput) Validate() error { return nil } -// SetDescription sets the Description field's value. -func (s *CreateInstanceExportTaskInput) SetDescription(v string) *CreateInstanceExportTaskInput { - s.Description = &v +// SetClientToken sets the ClientToken field's value. +func (s *CreateTrafficMirrorFilterRuleInput) SetClientToken(v string) *CreateTrafficMirrorFilterRuleInput { + s.ClientToken = &v return s } -// SetExportToS3Task sets the ExportToS3Task field's value. -func (s *CreateInstanceExportTaskInput) SetExportToS3Task(v *ExportToS3TaskSpecification) *CreateInstanceExportTaskInput { - s.ExportToS3Task = v +// SetDescription sets the Description field's value. +func (s *CreateTrafficMirrorFilterRuleInput) SetDescription(v string) *CreateTrafficMirrorFilterRuleInput { + s.Description = &v return s } -// SetInstanceId sets the InstanceId field's value. -func (s *CreateInstanceExportTaskInput) SetInstanceId(v string) *CreateInstanceExportTaskInput { - s.InstanceId = &v +// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. +func (s *CreateTrafficMirrorFilterRuleInput) SetDestinationCidrBlock(v string) *CreateTrafficMirrorFilterRuleInput { + s.DestinationCidrBlock = &v return s } -// SetTargetEnvironment sets the TargetEnvironment field's value. -func (s *CreateInstanceExportTaskInput) SetTargetEnvironment(v string) *CreateInstanceExportTaskInput { - s.TargetEnvironment = &v +// SetDestinationPortRange sets the DestinationPortRange field's value. +func (s *CreateTrafficMirrorFilterRuleInput) SetDestinationPortRange(v *TrafficMirrorPortRangeRequest) *CreateTrafficMirrorFilterRuleInput { + s.DestinationPortRange = v return s } -type CreateInstanceExportTaskOutput struct { - _ struct{} `type:"structure"` - - // Information about the instance export task. - ExportTask *ExportTask `locationName:"exportTask" type:"structure"` +// SetDryRun sets the DryRun field's value. +func (s *CreateTrafficMirrorFilterRuleInput) SetDryRun(v bool) *CreateTrafficMirrorFilterRuleInput { + s.DryRun = &v + return s } -// String returns the string representation -func (s CreateInstanceExportTaskOutput) String() string { - return awsutil.Prettify(s) +// SetProtocol sets the Protocol field's value. +func (s *CreateTrafficMirrorFilterRuleInput) SetProtocol(v int64) *CreateTrafficMirrorFilterRuleInput { + s.Protocol = &v + return s } -// GoString returns the string representation -func (s CreateInstanceExportTaskOutput) GoString() string { - return s.String() +// SetRuleAction sets the RuleAction field's value. +func (s *CreateTrafficMirrorFilterRuleInput) SetRuleAction(v string) *CreateTrafficMirrorFilterRuleInput { + s.RuleAction = &v + return s } -// SetExportTask sets the ExportTask field's value. -func (s *CreateInstanceExportTaskOutput) SetExportTask(v *ExportTask) *CreateInstanceExportTaskOutput { - s.ExportTask = v +// SetRuleNumber sets the RuleNumber field's value. +func (s *CreateTrafficMirrorFilterRuleInput) SetRuleNumber(v int64) *CreateTrafficMirrorFilterRuleInput { + s.RuleNumber = &v return s } -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"` +// SetSourceCidrBlock sets the SourceCidrBlock field's value. +func (s *CreateTrafficMirrorFilterRuleInput) SetSourceCidrBlock(v string) *CreateTrafficMirrorFilterRuleInput { + s.SourceCidrBlock = &v + return s } -// String returns the string representation -func (s CreateInternetGatewayInput) String() string { - return awsutil.Prettify(s) +// SetSourcePortRange sets the SourcePortRange field's value. +func (s *CreateTrafficMirrorFilterRuleInput) SetSourcePortRange(v *TrafficMirrorPortRangeRequest) *CreateTrafficMirrorFilterRuleInput { + s.SourcePortRange = v + return s } -// GoString returns the string representation -func (s CreateInternetGatewayInput) GoString() string { - return s.String() +// SetTrafficDirection sets the TrafficDirection field's value. +func (s *CreateTrafficMirrorFilterRuleInput) SetTrafficDirection(v string) *CreateTrafficMirrorFilterRuleInput { + s.TrafficDirection = &v + return s } -// SetDryRun sets the DryRun field's value. -func (s *CreateInternetGatewayInput) SetDryRun(v bool) *CreateInternetGatewayInput { - s.DryRun = &v +// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value. +func (s *CreateTrafficMirrorFilterRuleInput) SetTrafficMirrorFilterId(v string) *CreateTrafficMirrorFilterRuleInput { + s.TrafficMirrorFilterId = &v return s } -type CreateInternetGatewayOutput struct { +type CreateTrafficMirrorFilterRuleOutput struct { _ struct{} `type:"structure"` - // Information about the internet gateway. - InternetGateway *InternetGateway `locationName:"internetGateway" type:"structure"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `locationName:"clientToken" type:"string"` + + // The Traffic Mirror rule. + TrafficMirrorFilterRule *TrafficMirrorFilterRule `locationName:"trafficMirrorFilterRule" type:"structure"` } // String returns the string representation -func (s CreateInternetGatewayOutput) String() string { +func (s CreateTrafficMirrorFilterRuleOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateInternetGatewayOutput) GoString() string { +func (s CreateTrafficMirrorFilterRuleOutput) GoString() string { return s.String() } -// SetInternetGateway sets the InternetGateway field's value. -func (s *CreateInternetGatewayOutput) SetInternetGateway(v *InternetGateway) *CreateInternetGatewayOutput { - s.InternetGateway = v +// SetClientToken sets the ClientToken field's value. +func (s *CreateTrafficMirrorFilterRuleOutput) SetClientToken(v string) *CreateTrafficMirrorFilterRuleOutput { + s.ClientToken = &v return s } -type CreateKeyPairInput struct { +// SetTrafficMirrorFilterRule sets the TrafficMirrorFilterRule field's value. +func (s *CreateTrafficMirrorFilterRuleOutput) SetTrafficMirrorFilterRule(v *TrafficMirrorFilterRule) *CreateTrafficMirrorFilterRuleOutput { + s.TrafficMirrorFilterRule = v + return s +} + +type CreateTrafficMirrorSessionInput struct { _ struct{} `type:"structure"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `type:"string" idempotencyToken:"true"` + + // The description of the Traffic Mirror session. + 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"` + DryRun *bool `type:"boolean"` - // A unique name for the key pair. + // The ID of the source network interface. // - // Constraints: Up to 255 ASCII characters + // NetworkInterfaceId is a required field + NetworkInterfaceId *string `type:"string" required:"true"` + + // The number of bytes in each packet to mirror. These are bytes after the VXLAN + // header. Do not specify this parameter when you want to mirror the entire + // packet. To mirror a subset of the packet, set this to the length (in bytes) + // that you want to mirror. For example, if you set this value to 100, then + // the first 100 bytes that meet the filter criteria are copied to the target. // - // KeyName is a required field - KeyName *string `type:"string" required:"true"` + // If you do not want to mirror the entire packet, use the PacketLength parameter + // to specify the number of bytes in each packet to mirror. + PacketLength *int64 `type:"integer"` + + // The session number determines the order in which sessions are evaluated when + // an interface is used by multiple sessions. The first session with a matching + // filter is the one that mirrors the packets. + // + // Valid values are 1-32766. + // + // SessionNumber is a required field + SessionNumber *int64 `type:"integer" required:"true"` + + // The tags to assign to a Traffic Mirror session. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + + // The ID of the Traffic Mirror filter. + // + // TrafficMirrorFilterId is a required field + TrafficMirrorFilterId *string `type:"string" required:"true"` + + // The ID of the Traffic Mirror target. + // + // TrafficMirrorTargetId is a required field + TrafficMirrorTargetId *string `type:"string" required:"true"` + + // The VXLAN ID for the Traffic Mirror session. For more information about the + // VXLAN protocol, see RFC 7348 (https://tools.ietf.org/html/rfc7348). If you + // do not specify a VirtualNetworkId, an account-wide unique id is chosen at + // random. + VirtualNetworkId *int64 `type:"integer"` } // String returns the string representation -func (s CreateKeyPairInput) String() string { +func (s CreateTrafficMirrorSessionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateKeyPairInput) GoString() string { +func (s CreateTrafficMirrorSessionInput) 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")) +func (s *CreateTrafficMirrorSessionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTrafficMirrorSessionInput"} + if s.NetworkInterfaceId == nil { + invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) + } + if s.SessionNumber == nil { + invalidParams.Add(request.NewErrParamRequired("SessionNumber")) + } + if s.TrafficMirrorFilterId == nil { + invalidParams.Add(request.NewErrParamRequired("TrafficMirrorFilterId")) + } + if s.TrafficMirrorTargetId == nil { + invalidParams.Add(request.NewErrParamRequired("TrafficMirrorTargetId")) } if invalidParams.Len() > 0 { @@ -41082,68 +48553,108 @@ func (s *CreateKeyPairInput) Validate() error { return nil } +// SetClientToken sets the ClientToken field's value. +func (s *CreateTrafficMirrorSessionInput) SetClientToken(v string) *CreateTrafficMirrorSessionInput { + s.ClientToken = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateTrafficMirrorSessionInput) SetDescription(v string) *CreateTrafficMirrorSessionInput { + s.Description = &v + return s +} + // SetDryRun sets the DryRun field's value. -func (s *CreateKeyPairInput) SetDryRun(v bool) *CreateKeyPairInput { +func (s *CreateTrafficMirrorSessionInput) SetDryRun(v bool) *CreateTrafficMirrorSessionInput { s.DryRun = &v return s } -// SetKeyName sets the KeyName field's value. -func (s *CreateKeyPairInput) SetKeyName(v string) *CreateKeyPairInput { - s.KeyName = &v +// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. +func (s *CreateTrafficMirrorSessionInput) SetNetworkInterfaceId(v string) *CreateTrafficMirrorSessionInput { + s.NetworkInterfaceId = &v return s } -// Describes a key pair. -type CreateKeyPairOutput struct { - _ struct{} `type:"structure"` +// SetPacketLength sets the PacketLength field's value. +func (s *CreateTrafficMirrorSessionInput) SetPacketLength(v int64) *CreateTrafficMirrorSessionInput { + s.PacketLength = &v + return s +} - // The SHA-1 digest of the DER encoded private key. - KeyFingerprint *string `locationName:"keyFingerprint" type:"string"` +// SetSessionNumber sets the SessionNumber field's value. +func (s *CreateTrafficMirrorSessionInput) SetSessionNumber(v int64) *CreateTrafficMirrorSessionInput { + s.SessionNumber = &v + return s +} - // An unencrypted PEM encoded RSA private key. - KeyMaterial *string `locationName:"keyMaterial" type:"string"` +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateTrafficMirrorSessionInput) SetTagSpecifications(v []*TagSpecification) *CreateTrafficMirrorSessionInput { + s.TagSpecifications = v + return s +} - // The name of the key pair. - KeyName *string `locationName:"keyName" type:"string"` +// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value. +func (s *CreateTrafficMirrorSessionInput) SetTrafficMirrorFilterId(v string) *CreateTrafficMirrorSessionInput { + s.TrafficMirrorFilterId = &v + return s +} + +// SetTrafficMirrorTargetId sets the TrafficMirrorTargetId field's value. +func (s *CreateTrafficMirrorSessionInput) SetTrafficMirrorTargetId(v string) *CreateTrafficMirrorSessionInput { + s.TrafficMirrorTargetId = &v + return s +} + +// SetVirtualNetworkId sets the VirtualNetworkId field's value. +func (s *CreateTrafficMirrorSessionInput) SetVirtualNetworkId(v int64) *CreateTrafficMirrorSessionInput { + s.VirtualNetworkId = &v + return s +} + +type CreateTrafficMirrorSessionOutput struct { + _ struct{} `type:"structure"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `locationName:"clientToken" type:"string"` + + // Information about the Traffic Mirror session. + TrafficMirrorSession *TrafficMirrorSession `locationName:"trafficMirrorSession" type:"structure"` } // String returns the string representation -func (s CreateKeyPairOutput) String() string { +func (s CreateTrafficMirrorSessionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateKeyPairOutput) GoString() string { +func (s CreateTrafficMirrorSessionOutput) 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 +// SetClientToken sets the ClientToken field's value. +func (s *CreateTrafficMirrorSessionOutput) SetClientToken(v string) *CreateTrafficMirrorSessionOutput { + s.ClientToken = &v return s } -// SetKeyName sets the KeyName field's value. -func (s *CreateKeyPairOutput) SetKeyName(v string) *CreateKeyPairOutput { - s.KeyName = &v +// SetTrafficMirrorSession sets the TrafficMirrorSession field's value. +func (s *CreateTrafficMirrorSessionOutput) SetTrafficMirrorSession(v *TrafficMirrorSession) *CreateTrafficMirrorSessionOutput { + s.TrafficMirrorSession = v return s } -type CreateLaunchTemplateInput struct { +type CreateTrafficMirrorTargetInput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - // - // Constraint: Maximum 128 ASCII characters. - ClientToken *string `type:"string"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `type:"string" idempotencyToken:"true"` + + // The description of the Traffic Mirror target. + 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 @@ -41151,124 +48662,101 @@ type CreateLaunchTemplateInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The information for the launch template. - // - // LaunchTemplateData is a required field - LaunchTemplateData *RequestLaunchTemplateData `type:"structure" required:"true"` + // The network interface ID that is associated with the target. + NetworkInterfaceId *string `type:"string"` - // A name for the launch template. - // - // LaunchTemplateName is a required field - LaunchTemplateName *string `min:"3" type:"string" required:"true"` + // The Amazon Resource Name (ARN) of the Network Load Balancer that is associated + // with the target. + NetworkLoadBalancerArn *string `type:"string"` - // The tags to apply to the launch template during creation. + // The tags to assign to the Traffic Mirror target. TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` - - // A description for the first version of the launch template. - VersionDescription *string `type:"string"` } // String returns the string representation -func (s CreateLaunchTemplateInput) String() string { +func (s CreateTrafficMirrorTargetInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateLaunchTemplateInput) GoString() string { +func (s CreateTrafficMirrorTargetInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLaunchTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLaunchTemplateInput"} - if s.LaunchTemplateData == nil { - invalidParams.Add(request.NewErrParamRequired("LaunchTemplateData")) - } - if s.LaunchTemplateName == nil { - invalidParams.Add(request.NewErrParamRequired("LaunchTemplateName")) - } - if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) - } - if s.LaunchTemplateData != nil { - if err := s.LaunchTemplateData.Validate(); err != nil { - invalidParams.AddNested("LaunchTemplateData", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - // SetClientToken sets the ClientToken field's value. -func (s *CreateLaunchTemplateInput) SetClientToken(v string) *CreateLaunchTemplateInput { +func (s *CreateTrafficMirrorTargetInput) SetClientToken(v string) *CreateTrafficMirrorTargetInput { s.ClientToken = &v return s } +// SetDescription sets the Description field's value. +func (s *CreateTrafficMirrorTargetInput) SetDescription(v string) *CreateTrafficMirrorTargetInput { + s.Description = &v + return s +} + // SetDryRun sets the DryRun field's value. -func (s *CreateLaunchTemplateInput) SetDryRun(v bool) *CreateLaunchTemplateInput { +func (s *CreateTrafficMirrorTargetInput) SetDryRun(v bool) *CreateTrafficMirrorTargetInput { s.DryRun = &v return s } -// SetLaunchTemplateData sets the LaunchTemplateData field's value. -func (s *CreateLaunchTemplateInput) SetLaunchTemplateData(v *RequestLaunchTemplateData) *CreateLaunchTemplateInput { - s.LaunchTemplateData = v +// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. +func (s *CreateTrafficMirrorTargetInput) SetNetworkInterfaceId(v string) *CreateTrafficMirrorTargetInput { + s.NetworkInterfaceId = &v return s } -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *CreateLaunchTemplateInput) SetLaunchTemplateName(v string) *CreateLaunchTemplateInput { - s.LaunchTemplateName = &v +// SetNetworkLoadBalancerArn sets the NetworkLoadBalancerArn field's value. +func (s *CreateTrafficMirrorTargetInput) SetNetworkLoadBalancerArn(v string) *CreateTrafficMirrorTargetInput { + s.NetworkLoadBalancerArn = &v return s } // SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateLaunchTemplateInput) SetTagSpecifications(v []*TagSpecification) *CreateLaunchTemplateInput { +func (s *CreateTrafficMirrorTargetInput) SetTagSpecifications(v []*TagSpecification) *CreateTrafficMirrorTargetInput { s.TagSpecifications = v return s } -// SetVersionDescription sets the VersionDescription field's value. -func (s *CreateLaunchTemplateInput) SetVersionDescription(v string) *CreateLaunchTemplateInput { - s.VersionDescription = &v - return s -} - -type CreateLaunchTemplateOutput struct { +type CreateTrafficMirrorTargetOutput struct { _ struct{} `type:"structure"` - // Information about the launch template. - LaunchTemplate *LaunchTemplate `locationName:"launchTemplate" type:"structure"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `locationName:"clientToken" type:"string"` + + // Information about the Traffic Mirror target. + TrafficMirrorTarget *TrafficMirrorTarget `locationName:"trafficMirrorTarget" type:"structure"` } // String returns the string representation -func (s CreateLaunchTemplateOutput) String() string { +func (s CreateTrafficMirrorTargetOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateLaunchTemplateOutput) GoString() string { +func (s CreateTrafficMirrorTargetOutput) GoString() string { return s.String() } -// SetLaunchTemplate sets the LaunchTemplate field's value. -func (s *CreateLaunchTemplateOutput) SetLaunchTemplate(v *LaunchTemplate) *CreateLaunchTemplateOutput { - s.LaunchTemplate = v +// SetClientToken sets the ClientToken field's value. +func (s *CreateTrafficMirrorTargetOutput) SetClientToken(v string) *CreateTrafficMirrorTargetOutput { + s.ClientToken = &v return s } -type CreateLaunchTemplateVersionInput struct { +// SetTrafficMirrorTarget sets the TrafficMirrorTarget field's value. +func (s *CreateTrafficMirrorTargetOutput) SetTrafficMirrorTarget(v *TrafficMirrorTarget) *CreateTrafficMirrorTargetOutput { + s.TrafficMirrorTarget = v + return s +} + +type CreateTransitGatewayInput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - // - // Constraint: Maximum 128 ASCII characters. - ClientToken *string `type:"string"` + // A description of the transit gateway. + 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 @@ -41276,53 +48764,80 @@ type CreateLaunchTemplateVersionInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The information for the launch template. - // - // LaunchTemplateData is a required field - LaunchTemplateData *RequestLaunchTemplateData `type:"structure" required:"true"` + // The transit gateway options. + Options *TransitGatewayRequestOptions `type:"structure"` - // The ID of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateId *string `type:"string"` + // The tags to apply to the transit gateway. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` +} - // The name of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateName *string `min:"3" type:"string"` +// String returns the string representation +func (s CreateTransitGatewayInput) String() string { + return awsutil.Prettify(s) +} - // The version number of the launch template version on which to base the new - // version. The new version inherits the same launch parameters as the source - // version, except for parameters that you specify in LaunchTemplateData. Snapshots - // applied to the block device mapping are ignored when creating a new version - // unless they are explicitly included. - SourceVersion *string `type:"string"` +// GoString returns the string representation +func (s CreateTransitGatewayInput) GoString() string { + return s.String() +} - // A description for the version of the launch template. - VersionDescription *string `type:"string"` +// SetDescription sets the Description field's value. +func (s *CreateTransitGatewayInput) SetDescription(v string) *CreateTransitGatewayInput { + s.Description = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *CreateTransitGatewayInput) SetDryRun(v bool) *CreateTransitGatewayInput { + s.DryRun = &v + return s +} + +// SetOptions sets the Options field's value. +func (s *CreateTransitGatewayInput) SetOptions(v *TransitGatewayRequestOptions) *CreateTransitGatewayInput { + s.Options = v + return s +} + +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateTransitGatewayInput) SetTagSpecifications(v []*TagSpecification) *CreateTransitGatewayInput { + s.TagSpecifications = v + return s +} + +type CreateTransitGatewayMulticastDomainInput 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 tags for the transit gateway multicast domain. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + + // The ID of the transit gateway. + // + // TransitGatewayId is a required field + TransitGatewayId *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateLaunchTemplateVersionInput) String() string { +func (s CreateTransitGatewayMulticastDomainInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateLaunchTemplateVersionInput) GoString() string { +func (s CreateTransitGatewayMulticastDomainInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLaunchTemplateVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLaunchTemplateVersionInput"} - if s.LaunchTemplateData == nil { - invalidParams.Add(request.NewErrParamRequired("LaunchTemplateData")) - } - if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) - } - if s.LaunchTemplateData != nil { - if err := s.LaunchTemplateData.Validate(); err != nil { - invalidParams.AddNested("LaunchTemplateData", err.(request.ErrInvalidParams)) - } +func (s *CreateTransitGatewayMulticastDomainInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTransitGatewayMulticastDomainInput"} + if s.TransitGatewayId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayId")) } if invalidParams.Len() > 0 { @@ -41331,111 +48846,127 @@ func (s *CreateLaunchTemplateVersionInput) Validate() error { return nil } -// SetClientToken sets the ClientToken field's value. -func (s *CreateLaunchTemplateVersionInput) SetClientToken(v string) *CreateLaunchTemplateVersionInput { - s.ClientToken = &v - return s -} - // SetDryRun sets the DryRun field's value. -func (s *CreateLaunchTemplateVersionInput) SetDryRun(v bool) *CreateLaunchTemplateVersionInput { +func (s *CreateTransitGatewayMulticastDomainInput) SetDryRun(v bool) *CreateTransitGatewayMulticastDomainInput { s.DryRun = &v return s } -// SetLaunchTemplateData sets the LaunchTemplateData field's value. -func (s *CreateLaunchTemplateVersionInput) SetLaunchTemplateData(v *RequestLaunchTemplateData) *CreateLaunchTemplateVersionInput { - s.LaunchTemplateData = v +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateTransitGatewayMulticastDomainInput) SetTagSpecifications(v []*TagSpecification) *CreateTransitGatewayMulticastDomainInput { + s.TagSpecifications = v return s } -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *CreateLaunchTemplateVersionInput) SetLaunchTemplateId(v string) *CreateLaunchTemplateVersionInput { - s.LaunchTemplateId = &v +// SetTransitGatewayId sets the TransitGatewayId field's value. +func (s *CreateTransitGatewayMulticastDomainInput) SetTransitGatewayId(v string) *CreateTransitGatewayMulticastDomainInput { + s.TransitGatewayId = &v return s } -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *CreateLaunchTemplateVersionInput) SetLaunchTemplateName(v string) *CreateLaunchTemplateVersionInput { - s.LaunchTemplateName = &v - return s +type CreateTransitGatewayMulticastDomainOutput struct { + _ struct{} `type:"structure"` + + // Information about the transit gateway multicast domain. + TransitGatewayMulticastDomain *TransitGatewayMulticastDomain `locationName:"transitGatewayMulticastDomain" type:"structure"` } -// SetSourceVersion sets the SourceVersion field's value. -func (s *CreateLaunchTemplateVersionInput) SetSourceVersion(v string) *CreateLaunchTemplateVersionInput { - s.SourceVersion = &v - return s +// String returns the string representation +func (s CreateTransitGatewayMulticastDomainOutput) String() string { + return awsutil.Prettify(s) } -// SetVersionDescription sets the VersionDescription field's value. -func (s *CreateLaunchTemplateVersionInput) SetVersionDescription(v string) *CreateLaunchTemplateVersionInput { - s.VersionDescription = &v +// GoString returns the string representation +func (s CreateTransitGatewayMulticastDomainOutput) GoString() string { + return s.String() +} + +// SetTransitGatewayMulticastDomain sets the TransitGatewayMulticastDomain field's value. +func (s *CreateTransitGatewayMulticastDomainOutput) SetTransitGatewayMulticastDomain(v *TransitGatewayMulticastDomain) *CreateTransitGatewayMulticastDomainOutput { + s.TransitGatewayMulticastDomain = v return s } -type CreateLaunchTemplateVersionOutput struct { +type CreateTransitGatewayOutput struct { _ struct{} `type:"structure"` - // Information about the launch template version. - LaunchTemplateVersion *LaunchTemplateVersion `locationName:"launchTemplateVersion" type:"structure"` + // Information about the transit gateway. + TransitGateway *TransitGateway `locationName:"transitGateway" type:"structure"` } // String returns the string representation -func (s CreateLaunchTemplateVersionOutput) String() string { +func (s CreateTransitGatewayOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateLaunchTemplateVersionOutput) GoString() string { +func (s CreateTransitGatewayOutput) GoString() string { return s.String() } -// SetLaunchTemplateVersion sets the LaunchTemplateVersion field's value. -func (s *CreateLaunchTemplateVersionOutput) SetLaunchTemplateVersion(v *LaunchTemplateVersion) *CreateLaunchTemplateVersionOutput { - s.LaunchTemplateVersion = v +// SetTransitGateway sets the TransitGateway field's value. +func (s *CreateTransitGatewayOutput) SetTransitGateway(v *TransitGateway) *CreateTransitGatewayOutput { + s.TransitGateway = v return s } -type CreateNatGatewayInput struct { +type CreateTransitGatewayPeeringAttachmentInput 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. + // Checks whether you have the required permissions for the action, without + // actually making 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 AWS account ID of the owner of the peer transit gateway. // - // AllocationId is a required field - AllocationId *string `type:"string" required:"true"` + // PeerAccountId is a required field + PeerAccountId *string `type:"string" required:"true"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + // The Region where the peer transit gateway is located. // - // Constraint: Maximum 64 ASCII characters. - ClientToken *string `type:"string"` + // PeerRegion is a required field + PeerRegion *string `type:"string" required:"true"` - // The subnet in which to create the NAT gateway. + // The ID of the peer transit gateway with which to create the peering attachment. // - // SubnetId is a required field - SubnetId *string `type:"string" required:"true"` + // PeerTransitGatewayId is a required field + PeerTransitGatewayId *string `type:"string" required:"true"` + + // The tags to apply to the transit gateway peering attachment. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + + // The ID of the transit gateway. + // + // TransitGatewayId is a required field + TransitGatewayId *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateNatGatewayInput) String() string { +func (s CreateTransitGatewayPeeringAttachmentInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateNatGatewayInput) GoString() string { +func (s CreateTransitGatewayPeeringAttachmentInput) 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")) +func (s *CreateTransitGatewayPeeringAttachmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTransitGatewayPeeringAttachmentInput"} + if s.PeerAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("PeerAccountId")) } - if s.SubnetId == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetId")) + if s.PeerRegion == nil { + invalidParams.Add(request.NewErrParamRequired("PeerRegion")) + } + if s.PeerTransitGatewayId == nil { + invalidParams.Add(request.NewErrParamRequired("PeerTransitGatewayId")) + } + if s.TransitGatewayId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayId")) } if invalidParams.Len() > 0 { @@ -41444,144 +48975,110 @@ func (s *CreateNatGatewayInput) Validate() error { return nil } -// SetAllocationId sets the AllocationId field's value. -func (s *CreateNatGatewayInput) SetAllocationId(v string) *CreateNatGatewayInput { - s.AllocationId = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateTransitGatewayPeeringAttachmentInput) SetDryRun(v bool) *CreateTransitGatewayPeeringAttachmentInput { + s.DryRun = &v return s } -// SetClientToken sets the ClientToken field's value. -func (s *CreateNatGatewayInput) SetClientToken(v string) *CreateNatGatewayInput { - s.ClientToken = &v +// SetPeerAccountId sets the PeerAccountId field's value. +func (s *CreateTransitGatewayPeeringAttachmentInput) SetPeerAccountId(v string) *CreateTransitGatewayPeeringAttachmentInput { + s.PeerAccountId = &v return s } -// SetSubnetId sets the SubnetId field's value. -func (s *CreateNatGatewayInput) SetSubnetId(v string) *CreateNatGatewayInput { - s.SubnetId = &v +// SetPeerRegion sets the PeerRegion field's value. +func (s *CreateTransitGatewayPeeringAttachmentInput) SetPeerRegion(v string) *CreateTransitGatewayPeeringAttachmentInput { + s.PeerRegion = &v return s } -type CreateNatGatewayOutput struct { - _ struct{} `type:"structure"` +// SetPeerTransitGatewayId sets the PeerTransitGatewayId field's value. +func (s *CreateTransitGatewayPeeringAttachmentInput) SetPeerTransitGatewayId(v string) *CreateTransitGatewayPeeringAttachmentInput { + s.PeerTransitGatewayId = &v + return s +} - // 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"` +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateTransitGatewayPeeringAttachmentInput) SetTagSpecifications(v []*TagSpecification) *CreateTransitGatewayPeeringAttachmentInput { + s.TagSpecifications = v + return s +} - // Information about the NAT gateway. - NatGateway *NatGateway `locationName:"natGateway" type:"structure"` +// SetTransitGatewayId sets the TransitGatewayId field's value. +func (s *CreateTransitGatewayPeeringAttachmentInput) SetTransitGatewayId(v string) *CreateTransitGatewayPeeringAttachmentInput { + s.TransitGatewayId = &v + return s +} + +type CreateTransitGatewayPeeringAttachmentOutput struct { + _ struct{} `type:"structure"` + + // The transit gateway peering attachment. + TransitGatewayPeeringAttachment *TransitGatewayPeeringAttachment `locationName:"transitGatewayPeeringAttachment" type:"structure"` } // String returns the string representation -func (s CreateNatGatewayOutput) String() string { +func (s CreateTransitGatewayPeeringAttachmentOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateNatGatewayOutput) GoString() string { +func (s CreateTransitGatewayPeeringAttachmentOutput) 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 +// SetTransitGatewayPeeringAttachment sets the TransitGatewayPeeringAttachment field's value. +func (s *CreateTransitGatewayPeeringAttachmentOutput) SetTransitGatewayPeeringAttachment(v *TransitGatewayPeeringAttachment) *CreateTransitGatewayPeeringAttachmentOutput { + s.TransitGatewayPeeringAttachment = v return s } -type CreateNetworkAclEntryInput struct { +type CreateTransitGatewayRouteInput 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"` + // Indicates whether to drop traffic that matches this route. + Blackhole *bool `type:"boolean"` + + // The CIDR range used for destination matches. Routing decisions are based + // on the most specific match. + // + // DestinationCidrBlock is a required field + DestinationCidrBlock *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 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 protocol - // 1 (ICMP) 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. Required if - // specifying protocol 6 (TCP) or 17 (UDP). - PortRange *PortRange `locationName:"portRange" type:"structure"` - - // The protocol number. A value of "-1" means all protocols. If you specify - // "-1" or a protocol number other than "6" (TCP), "17" (UDP), or "1" (ICMP), - // traffic on all ports is allowed, regardless of any ports or ICMP types or - // codes that 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"` + DryRun *bool `type:"boolean"` - // 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 ID of the attachment. + TransitGatewayAttachmentId *string `type:"string"` - // 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. + // The ID of the transit gateway route table. // - // RuleNumber is a required field - RuleNumber *int64 `locationName:"ruleNumber" type:"integer" required:"true"` + // TransitGatewayRouteTableId is a required field + TransitGatewayRouteTableId *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateNetworkAclEntryInput) String() string { +func (s CreateTransitGatewayRouteInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateNetworkAclEntryInput) GoString() string { +func (s CreateTransitGatewayRouteInput) 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")) +func (s *CreateTransitGatewayRouteInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTransitGatewayRouteInput"} + if s.DestinationCidrBlock == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock")) } - if s.RuleNumber == nil { - invalidParams.Add(request.NewErrParamRequired("RuleNumber")) + if s.TransitGatewayRouteTableId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId")) } if invalidParams.Len() > 0 { @@ -41590,110 +49087,92 @@ func (s *CreateNetworkAclEntryInput) Validate() error { 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 +// SetBlackhole sets the Blackhole field's value. +func (s *CreateTransitGatewayRouteInput) SetBlackhole(v bool) *CreateTransitGatewayRouteInput { + s.Blackhole = &v return s } -// SetPortRange sets the PortRange field's value. -func (s *CreateNetworkAclEntryInput) SetPortRange(v *PortRange) *CreateNetworkAclEntryInput { - s.PortRange = v +// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. +func (s *CreateTransitGatewayRouteInput) SetDestinationCidrBlock(v string) *CreateTransitGatewayRouteInput { + s.DestinationCidrBlock = &v return s } -// SetProtocol sets the Protocol field's value. -func (s *CreateNetworkAclEntryInput) SetProtocol(v string) *CreateNetworkAclEntryInput { - s.Protocol = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateTransitGatewayRouteInput) SetDryRun(v bool) *CreateTransitGatewayRouteInput { + s.DryRun = &v return s } -// SetRuleAction sets the RuleAction field's value. -func (s *CreateNetworkAclEntryInput) SetRuleAction(v string) *CreateNetworkAclEntryInput { - s.RuleAction = &v +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *CreateTransitGatewayRouteInput) SetTransitGatewayAttachmentId(v string) *CreateTransitGatewayRouteInput { + s.TransitGatewayAttachmentId = &v return s } -// SetRuleNumber sets the RuleNumber field's value. -func (s *CreateNetworkAclEntryInput) SetRuleNumber(v int64) *CreateNetworkAclEntryInput { - s.RuleNumber = &v +// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value. +func (s *CreateTransitGatewayRouteInput) SetTransitGatewayRouteTableId(v string) *CreateTransitGatewayRouteInput { + s.TransitGatewayRouteTableId = &v return s } -type CreateNetworkAclEntryOutput struct { +type CreateTransitGatewayRouteOutput struct { _ struct{} `type:"structure"` + + // Information about the route. + Route *TransitGatewayRoute `locationName:"route" type:"structure"` } // String returns the string representation -func (s CreateNetworkAclEntryOutput) String() string { +func (s CreateTransitGatewayRouteOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateNetworkAclEntryOutput) GoString() string { +func (s CreateTransitGatewayRouteOutput) GoString() string { return s.String() } -type CreateNetworkAclInput struct { +// SetRoute sets the Route field's value. +func (s *CreateTransitGatewayRouteOutput) SetRoute(v *TransitGatewayRoute) *CreateTransitGatewayRouteOutput { + s.Route = v + return s +} + +type CreateTransitGatewayRouteTableInput 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"` + DryRun *bool `type:"boolean"` - // The ID of the VPC. + // The tags to apply to the transit gateway route table. + TagSpecifications []*TagSpecification `locationNameList:"item" type:"list"` + + // The ID of the transit gateway. // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` + // TransitGatewayId is a required field + TransitGatewayId *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateNetworkAclInput) String() string { +func (s CreateTransitGatewayRouteTableInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateNetworkAclInput) GoString() string { +func (s CreateTransitGatewayRouteTableInput) 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")) +func (s *CreateTransitGatewayRouteTableInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTransitGatewayRouteTableInput"} + if s.TransitGatewayId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayId")) } if invalidParams.Len() > 0 { @@ -41703,114 +49182,101 @@ func (s *CreateNetworkAclInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *CreateNetworkAclInput) SetDryRun(v bool) *CreateNetworkAclInput { +func (s *CreateTransitGatewayRouteTableInput) SetDryRun(v bool) *CreateTransitGatewayRouteTableInput { s.DryRun = &v return s } -// SetVpcId sets the VpcId field's value. -func (s *CreateNetworkAclInput) SetVpcId(v string) *CreateNetworkAclInput { - s.VpcId = &v +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateTransitGatewayRouteTableInput) SetTagSpecifications(v []*TagSpecification) *CreateTransitGatewayRouteTableInput { + s.TagSpecifications = v return s } -type CreateNetworkAclOutput struct { +// SetTransitGatewayId sets the TransitGatewayId field's value. +func (s *CreateTransitGatewayRouteTableInput) SetTransitGatewayId(v string) *CreateTransitGatewayRouteTableInput { + s.TransitGatewayId = &v + return s +} + +type CreateTransitGatewayRouteTableOutput struct { _ struct{} `type:"structure"` - // Information about the network ACL. - NetworkAcl *NetworkAcl `locationName:"networkAcl" type:"structure"` + // Information about the transit gateway route table. + TransitGatewayRouteTable *TransitGatewayRouteTable `locationName:"transitGatewayRouteTable" type:"structure"` } // String returns the string representation -func (s CreateNetworkAclOutput) String() string { +func (s CreateTransitGatewayRouteTableOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateNetworkAclOutput) GoString() string { +func (s CreateTransitGatewayRouteTableOutput) GoString() string { return s.String() } -// SetNetworkAcl sets the NetworkAcl field's value. -func (s *CreateNetworkAclOutput) SetNetworkAcl(v *NetworkAcl) *CreateNetworkAclOutput { - s.NetworkAcl = v +// SetTransitGatewayRouteTable sets the TransitGatewayRouteTable field's value. +func (s *CreateTransitGatewayRouteTableOutput) SetTransitGatewayRouteTable(v *TransitGatewayRouteTable) *CreateTransitGatewayRouteTableOutput { + s.TransitGatewayRouteTable = v return s } -// Contains the parameters for CreateNetworkInterface. -type CreateNetworkInterfaceInput struct { +type CreateTransitGatewayVpcAttachmentInput 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"` - - // Indicates the type of network interface. To create an Elastic Fabric Adapter - // (EFA), specify efa. For more information, see Elastic Fabric Adapter (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/efa.html) - // in the Amazon Elastic Compute Cloud User Guide. - InterfaceType *string `type:"string" enum:"NetworkInterfaceCreationType"` - - // 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"` + DryRun *bool `type:"boolean"` - // 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 VPC attachment options. + Options *CreateTransitGatewayVpcAttachmentRequestOptions `type:"structure"` - // 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"` + // The IDs of one or more subnets. You can specify only one subnet per Availability + // Zone. You must specify at least one subnet, but we recommend that you specify + // two subnets for better availability. The transit gateway uses one IP address + // from each specified subnet. + // + // SubnetIds is a required field + SubnetIds []*string `locationNameList:"item" type:"list" required:"true"` - // One or more private IPv4 addresses. - PrivateIpAddresses []*PrivateIpAddressSpecification `locationName:"privateIpAddresses" locationNameList:"item" type:"list"` + // The tags to apply to the VPC attachment. + TagSpecifications []*TagSpecification `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 ID of the transit gateway. // - // 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 (https://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"` + // TransitGatewayId is a required field + TransitGatewayId *string `type:"string" required:"true"` - // The ID of the subnet to associate with the network interface. + // The ID of the VPC. // - // SubnetId is a required field - SubnetId *string `locationName:"subnetId" type:"string" required:"true"` + // VpcId is a required field + VpcId *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateNetworkInterfaceInput) String() string { +func (s CreateTransitGatewayVpcAttachmentInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateNetworkInterfaceInput) GoString() string { +func (s CreateTransitGatewayVpcAttachmentInput) 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")) +func (s *CreateTransitGatewayVpcAttachmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTransitGatewayVpcAttachmentInput"} + if s.SubnetIds == nil { + invalidParams.Add(request.NewErrParamRequired("SubnetIds")) + } + if s.TransitGatewayId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayId")) + } + if s.VpcId == nil { + invalidParams.Add(request.NewErrParamRequired("VpcId")) } if invalidParams.Len() > 0 { @@ -41819,135 +49285,204 @@ func (s *CreateNetworkInterfaceInput) Validate() error { 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 { +func (s *CreateTransitGatewayVpcAttachmentInput) SetDryRun(v bool) *CreateTransitGatewayVpcAttachmentInput { s.DryRun = &v return s } -// SetGroups sets the Groups field's value. -func (s *CreateNetworkInterfaceInput) SetGroups(v []*string) *CreateNetworkInterfaceInput { - s.Groups = v +// SetOptions sets the Options field's value. +func (s *CreateTransitGatewayVpcAttachmentInput) SetOptions(v *CreateTransitGatewayVpcAttachmentRequestOptions) *CreateTransitGatewayVpcAttachmentInput { + s.Options = v return s } -// SetInterfaceType sets the InterfaceType field's value. -func (s *CreateNetworkInterfaceInput) SetInterfaceType(v string) *CreateNetworkInterfaceInput { - s.InterfaceType = &v +// SetSubnetIds sets the SubnetIds field's value. +func (s *CreateTransitGatewayVpcAttachmentInput) SetSubnetIds(v []*string) *CreateTransitGatewayVpcAttachmentInput { + s.SubnetIds = v return s } -// SetIpv6AddressCount sets the Ipv6AddressCount field's value. -func (s *CreateNetworkInterfaceInput) SetIpv6AddressCount(v int64) *CreateNetworkInterfaceInput { - s.Ipv6AddressCount = &v +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateTransitGatewayVpcAttachmentInput) SetTagSpecifications(v []*TagSpecification) *CreateTransitGatewayVpcAttachmentInput { + s.TagSpecifications = v return s } -// SetIpv6Addresses sets the Ipv6Addresses field's value. -func (s *CreateNetworkInterfaceInput) SetIpv6Addresses(v []*InstanceIpv6Address) *CreateNetworkInterfaceInput { - s.Ipv6Addresses = v +// SetTransitGatewayId sets the TransitGatewayId field's value. +func (s *CreateTransitGatewayVpcAttachmentInput) SetTransitGatewayId(v string) *CreateTransitGatewayVpcAttachmentInput { + s.TransitGatewayId = &v return s } -// SetPrivateIpAddress sets the PrivateIpAddress field's value. -func (s *CreateNetworkInterfaceInput) SetPrivateIpAddress(v string) *CreateNetworkInterfaceInput { - s.PrivateIpAddress = &v +// SetVpcId sets the VpcId field's value. +func (s *CreateTransitGatewayVpcAttachmentInput) SetVpcId(v string) *CreateTransitGatewayVpcAttachmentInput { + s.VpcId = &v return s } -// SetPrivateIpAddresses sets the PrivateIpAddresses field's value. -func (s *CreateNetworkInterfaceInput) SetPrivateIpAddresses(v []*PrivateIpAddressSpecification) *CreateNetworkInterfaceInput { - s.PrivateIpAddresses = v - return s +type CreateTransitGatewayVpcAttachmentOutput struct { + _ struct{} `type:"structure"` + + // Information about the VPC attachment. + TransitGatewayVpcAttachment *TransitGatewayVpcAttachment `locationName:"transitGatewayVpcAttachment" type:"structure"` } -// SetSecondaryPrivateIpAddressCount sets the SecondaryPrivateIpAddressCount field's value. -func (s *CreateNetworkInterfaceInput) SetSecondaryPrivateIpAddressCount(v int64) *CreateNetworkInterfaceInput { - s.SecondaryPrivateIpAddressCount = &v - return s +// String returns the string representation +func (s CreateTransitGatewayVpcAttachmentOutput) String() string { + return awsutil.Prettify(s) } -// SetSubnetId sets the SubnetId field's value. -func (s *CreateNetworkInterfaceInput) SetSubnetId(v string) *CreateNetworkInterfaceInput { - s.SubnetId = &v +// GoString returns the string representation +func (s CreateTransitGatewayVpcAttachmentOutput) GoString() string { + return s.String() +} + +// SetTransitGatewayVpcAttachment sets the TransitGatewayVpcAttachment field's value. +func (s *CreateTransitGatewayVpcAttachmentOutput) SetTransitGatewayVpcAttachment(v *TransitGatewayVpcAttachment) *CreateTransitGatewayVpcAttachmentOutput { + s.TransitGatewayVpcAttachment = v return s } -// Contains the output of CreateNetworkInterface. -type CreateNetworkInterfaceOutput struct { +// Describes the options for a VPC attachment. +type CreateTransitGatewayVpcAttachmentRequestOptions struct { _ struct{} `type:"structure"` - // Information about the network interface. - NetworkInterface *NetworkInterface `locationName:"networkInterface" type:"structure"` + // Enable or disable DNS support. The default is enable. + DnsSupport *string `type:"string" enum:"DnsSupportValue"` + + // Enable or disable IPv6 support. The default is enable. + Ipv6Support *string `type:"string" enum:"Ipv6SupportValue"` } // String returns the string representation -func (s CreateNetworkInterfaceOutput) String() string { +func (s CreateTransitGatewayVpcAttachmentRequestOptions) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateNetworkInterfaceOutput) GoString() string { +func (s CreateTransitGatewayVpcAttachmentRequestOptions) GoString() string { return s.String() } -// SetNetworkInterface sets the NetworkInterface field's value. -func (s *CreateNetworkInterfaceOutput) SetNetworkInterface(v *NetworkInterface) *CreateNetworkInterfaceOutput { - s.NetworkInterface = v +// SetDnsSupport sets the DnsSupport field's value. +func (s *CreateTransitGatewayVpcAttachmentRequestOptions) SetDnsSupport(v string) *CreateTransitGatewayVpcAttachmentRequestOptions { + s.DnsSupport = &v return s } -// Contains the parameters for CreateNetworkInterfacePermission. -type CreateNetworkInterfacePermissionInput struct { - _ struct{} `type:"structure"` +// SetIpv6Support sets the Ipv6Support field's value. +func (s *CreateTransitGatewayVpcAttachmentRequestOptions) SetIpv6Support(v string) *CreateTransitGatewayVpcAttachmentRequestOptions { + s.Ipv6Support = &v + return s +} - // The AWS account ID. - AwsAccountId *string `type:"string"` +type CreateVolumeInput struct { + _ struct{} `type:"structure"` - // The AWS service. Currently not supported. - AwsService *string `type:"string"` + // The Availability Zone in which to create the volume. + // + // 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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the network interface. + // Specifies whether the volume should be encrypted. The effect of setting the + // encryption state to true depends on the volume origin (new or from a snapshot), + // starting encryption state, ownership, and whether encryption by default is + // enabled. For more information, see Encryption by Default (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default) + // in the Amazon Elastic Compute Cloud User Guide. // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `type:"string" required:"true"` + // Encrypted Amazon EBS volumes must be attached to instances that support Amazon + // EBS encryption. For more information, see Supported Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances). + Encrypted *bool `locationName:"encrypted" type:"boolean"` - // The type of permission to grant. + // The number of I/O operations per second (IOPS) to provision for the volume, + // with a maximum ratio of 50 IOPS/GiB. Range is 100 to 64,000 IOPS for volumes + // in most Regions. Maximum IOPS of 64,000 is guaranteed only on Nitro-based + // instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). + // Other instance families guarantee performance up to 32,000 IOPS. For more + // information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) + // in the Amazon Elastic Compute Cloud User Guide. // - // Permission is a required field - Permission *string `type:"string" required:"true" enum:"InterfacePermissionType"` + // This parameter is valid only for Provisioned IOPS SSD (io1) volumes. + Iops *int64 `type:"integer"` + + // The identifier of the AWS Key Management Service (AWS KMS) customer master + // key (CMK) to use for Amazon EBS encryption. If this parameter is not specified, + // your AWS managed CMK for EBS is used. If KmsKeyId is specified, the encrypted + // state must be true. + // + // You can specify the CMK using any of the following: + // + // * Key ID. For example, key/1234abcd-12ab-34cd-56ef-1234567890ab. + // + // * Key alias. For example, alias/ExampleAlias. + // + // * Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. + // + // * Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. + // + // AWS authenticates the CMK asynchronously. Therefore, if you specify an ID, + // alias, or ARN that is not valid, the action can appear to complete, but eventually + // fails. + KmsKeyId *string `type:"string"` + + // Specifies whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, + // you can attach the volume to up to 16 Nitro-based instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances) + // in the same Availability Zone. For more information, see Amazon EBS Multi-Attach + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes-multi.html) + // in the Amazon Elastic Compute Cloud User Guide. + MultiAttachEnabled *bool `type:"boolean"` + + // The Amazon Resource Name (ARN) of the Outpost. + OutpostArn *string `type:"string"` + + // The size of the volume, in GiBs. You must specify either a snapshot ID or + // a volume size. + // + // Constraints: 1-16,384 for gp2, 4-16,384 for io1, 500-16,384 for st1, 500-16,384 + // for sc1, and 1-1,024 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. You must specify either a snapshot + // ID or a volume size. + SnapshotId *string `type:"string"` + + // The tags to apply to the volume during creation. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + + // The volume type. This can be gp2 for General Purpose SSD, io1 for Provisioned + // IOPS SSD, st1 for Throughput Optimized HDD, sc1 for Cold HDD, or standard + // for Magnetic volumes. + // + // Default: gp2 + VolumeType *string `type:"string" enum:"VolumeType"` } // String returns the string representation -func (s CreateNetworkInterfacePermissionInput) String() string { +func (s CreateVolumeInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateNetworkInterfacePermissionInput) GoString() string { +func (s CreateVolumeInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateNetworkInterfacePermissionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateNetworkInterfacePermissionInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - if s.Permission == nil { - invalidParams.Add(request.NewErrParamRequired("Permission")) +func (s *CreateVolumeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateVolumeInput"} + if s.AvailabilityZone == nil { + invalidParams.Add(request.NewErrParamRequired("AvailabilityZone")) } if invalidParams.Len() > 0 { @@ -41956,185 +49491,188 @@ func (s *CreateNetworkInterfacePermissionInput) Validate() error { return nil } -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *CreateNetworkInterfacePermissionInput) SetAwsAccountId(v string) *CreateNetworkInterfacePermissionInput { - s.AwsAccountId = &v - return s -} - -// SetAwsService sets the AwsService field's value. -func (s *CreateNetworkInterfacePermissionInput) SetAwsService(v string) *CreateNetworkInterfacePermissionInput { - s.AwsService = &v +// 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 *CreateNetworkInterfacePermissionInput) SetDryRun(v bool) *CreateNetworkInterfacePermissionInput { +func (s *CreateVolumeInput) SetDryRun(v bool) *CreateVolumeInput { s.DryRun = &v return s } -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *CreateNetworkInterfacePermissionInput) SetNetworkInterfaceId(v string) *CreateNetworkInterfacePermissionInput { - s.NetworkInterfaceId = &v +// SetEncrypted sets the Encrypted field's value. +func (s *CreateVolumeInput) SetEncrypted(v bool) *CreateVolumeInput { + s.Encrypted = &v return s } -// SetPermission sets the Permission field's value. -func (s *CreateNetworkInterfacePermissionInput) SetPermission(v string) *CreateNetworkInterfacePermissionInput { - s.Permission = &v +// SetIops sets the Iops field's value. +func (s *CreateVolumeInput) SetIops(v int64) *CreateVolumeInput { + s.Iops = &v return s } -// Contains the output of CreateNetworkInterfacePermission. -type CreateNetworkInterfacePermissionOutput struct { - _ struct{} `type:"structure"` +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *CreateVolumeInput) SetKmsKeyId(v string) *CreateVolumeInput { + s.KmsKeyId = &v + return s +} - // Information about the permission for the network interface. - InterfacePermission *NetworkInterfacePermission `locationName:"interfacePermission" type:"structure"` +// SetMultiAttachEnabled sets the MultiAttachEnabled field's value. +func (s *CreateVolumeInput) SetMultiAttachEnabled(v bool) *CreateVolumeInput { + s.MultiAttachEnabled = &v + return s } -// String returns the string representation -func (s CreateNetworkInterfacePermissionOutput) String() string { - return awsutil.Prettify(s) +// SetOutpostArn sets the OutpostArn field's value. +func (s *CreateVolumeInput) SetOutpostArn(v string) *CreateVolumeInput { + s.OutpostArn = &v + return s } -// GoString returns the string representation -func (s CreateNetworkInterfacePermissionOutput) GoString() string { - return s.String() +// SetSize sets the Size field's value. +func (s *CreateVolumeInput) SetSize(v int64) *CreateVolumeInput { + s.Size = &v + return s } -// SetInterfacePermission sets the InterfacePermission field's value. -func (s *CreateNetworkInterfacePermissionOutput) SetInterfacePermission(v *NetworkInterfacePermission) *CreateNetworkInterfacePermissionOutput { - s.InterfacePermission = v +// SetSnapshotId sets the SnapshotId field's value. +func (s *CreateVolumeInput) SetSnapshotId(v string) *CreateVolumeInput { + s.SnapshotId = &v return s } -type CreatePlacementGroupInput struct { - _ struct{} `type:"structure"` +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateVolumeInput) SetTagSpecifications(v []*TagSpecification) *CreateVolumeInput { + s.TagSpecifications = v + return s +} - // Checks whether you have the required permissions for the action, without - // actually making the request, and provides an error response. If you have - // the required permissions, the error response is DryRunOperation. Otherwise, - // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` +// SetVolumeType sets the VolumeType field's value. +func (s *CreateVolumeInput) SetVolumeType(v string) *CreateVolumeInput { + s.VolumeType = &v + return s +} - // A name for the placement group. Must be unique within the scope of your account - // for the Region. - // - // Constraints: Up to 255 ASCII characters - GroupName *string `locationName:"groupName" type:"string"` +// Describes the user or group to be added or removed from the list of create +// volume permissions for a volume. +type CreateVolumePermission struct { + _ struct{} `type:"structure"` - // The number of partitions. Valid only when Strategy is set to partition. - PartitionCount *int64 `type:"integer"` + // The group to be added or removed. The possible value is all. + Group *string `locationName:"group" type:"string" enum:"PermissionGroup"` - // The placement strategy. - Strategy *string `locationName:"strategy" type:"string" enum:"PlacementStrategy"` + // The AWS account ID to be added or removed. + UserId *string `locationName:"userId" type:"string"` } // String returns the string representation -func (s CreatePlacementGroupInput) String() string { +func (s CreateVolumePermission) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreatePlacementGroupInput) GoString() string { +func (s CreateVolumePermission) GoString() string { return s.String() } -// SetDryRun sets the DryRun field's value. -func (s *CreatePlacementGroupInput) SetDryRun(v bool) *CreatePlacementGroupInput { - s.DryRun = &v +// SetGroup sets the Group field's value. +func (s *CreateVolumePermission) SetGroup(v string) *CreateVolumePermission { + s.Group = &v return s } -// SetGroupName sets the GroupName field's value. -func (s *CreatePlacementGroupInput) SetGroupName(v string) *CreatePlacementGroupInput { - s.GroupName = &v +// SetUserId sets the UserId field's value. +func (s *CreateVolumePermission) SetUserId(v string) *CreateVolumePermission { + s.UserId = &v return s } -// SetPartitionCount sets the PartitionCount field's value. -func (s *CreatePlacementGroupInput) SetPartitionCount(v int64) *CreatePlacementGroupInput { - s.PartitionCount = &v - return s -} +// Describes modifications to the list of create volume permissions for a volume. +type CreateVolumePermissionModifications struct { + _ struct{} `type:"structure"` -// SetStrategy sets the Strategy field's value. -func (s *CreatePlacementGroupInput) SetStrategy(v string) *CreatePlacementGroupInput { - s.Strategy = &v - return s -} + // Adds the specified AWS account ID or group to the list. + Add []*CreateVolumePermission `locationNameList:"item" type:"list"` -type CreatePlacementGroupOutput struct { - _ struct{} `type:"structure"` + // Removes the specified AWS account ID or group from the list. + Remove []*CreateVolumePermission `locationNameList:"item" type:"list"` } // String returns the string representation -func (s CreatePlacementGroupOutput) String() string { +func (s CreateVolumePermissionModifications) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreatePlacementGroupOutput) GoString() string { +func (s CreateVolumePermissionModifications) GoString() string { return s.String() } -// Contains the parameters for CreateReservedInstancesListing. -type CreateReservedInstancesListingInput struct { +// 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 +} + +type CreateVpcEndpointConnectionNotificationInput 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 (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - // - // ClientToken is a required field - ClientToken *string `locationName:"clientToken" type:"string" required:"true"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + ClientToken *string `type:"string"` - // 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. + // One or more endpoint events for which to receive notifications. Valid values + // are Accept, Connect, Delete, and Reject. // - // InstanceCount is a required field - InstanceCount *int64 `locationName:"instanceCount" type:"integer" required:"true"` + // ConnectionEvents is a required field + ConnectionEvents []*string `locationNameList:"item" type:"list" required:"true"` - // A list specifying the price of the Standard Reserved Instance for each month - // remaining in the Reserved Instance term. + // The ARN of the SNS topic for the notifications. // - // PriceSchedules is a required field - PriceSchedules []*PriceScheduleSpecification `locationName:"priceSchedules" locationNameList:"item" type:"list" required:"true"` + // ConnectionNotificationArn is a required field + ConnectionNotificationArn *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 `type:"boolean"` - // The ID of the active Standard Reserved Instance. - // - // ReservedInstancesId is a required field - ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string" required:"true"` + // The ID of the endpoint service. + ServiceId *string `type:"string"` + + // The ID of the endpoint. + VpcEndpointId *string `type:"string"` } // String returns the string representation -func (s CreateReservedInstancesListingInput) String() string { +func (s CreateVpcEndpointConnectionNotificationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateReservedInstancesListingInput) GoString() string { +func (s CreateVpcEndpointConnectionNotificationInput) 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")) +func (s *CreateVpcEndpointConnectionNotificationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateVpcEndpointConnectionNotificationInput"} + if s.ConnectionEvents == nil { + invalidParams.Add(request.NewErrParamRequired("ConnectionEvents")) } - if s.ReservedInstancesId == nil { - invalidParams.Add(request.NewErrParamRequired("ReservedInstancesId")) + if s.ConnectionNotificationArn == nil { + invalidParams.Add(request.NewErrParamRequired("ConnectionNotificationArn")) } if invalidParams.Len() > 0 { @@ -42144,114 +49682,157 @@ func (s *CreateReservedInstancesListingInput) Validate() error { } // SetClientToken sets the ClientToken field's value. -func (s *CreateReservedInstancesListingInput) SetClientToken(v string) *CreateReservedInstancesListingInput { +func (s *CreateVpcEndpointConnectionNotificationInput) SetClientToken(v string) *CreateVpcEndpointConnectionNotificationInput { s.ClientToken = &v return s } -// SetInstanceCount sets the InstanceCount field's value. -func (s *CreateReservedInstancesListingInput) SetInstanceCount(v int64) *CreateReservedInstancesListingInput { - s.InstanceCount = &v +// SetConnectionEvents sets the ConnectionEvents field's value. +func (s *CreateVpcEndpointConnectionNotificationInput) SetConnectionEvents(v []*string) *CreateVpcEndpointConnectionNotificationInput { + s.ConnectionEvents = v return s } -// SetPriceSchedules sets the PriceSchedules field's value. -func (s *CreateReservedInstancesListingInput) SetPriceSchedules(v []*PriceScheduleSpecification) *CreateReservedInstancesListingInput { - s.PriceSchedules = v +// SetConnectionNotificationArn sets the ConnectionNotificationArn field's value. +func (s *CreateVpcEndpointConnectionNotificationInput) SetConnectionNotificationArn(v string) *CreateVpcEndpointConnectionNotificationInput { + s.ConnectionNotificationArn = &v return s } -// SetReservedInstancesId sets the ReservedInstancesId field's value. -func (s *CreateReservedInstancesListingInput) SetReservedInstancesId(v string) *CreateReservedInstancesListingInput { - s.ReservedInstancesId = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateVpcEndpointConnectionNotificationInput) SetDryRun(v bool) *CreateVpcEndpointConnectionNotificationInput { + s.DryRun = &v return s } -// Contains the output of CreateReservedInstancesListing. -type CreateReservedInstancesListingOutput struct { +// SetServiceId sets the ServiceId field's value. +func (s *CreateVpcEndpointConnectionNotificationInput) SetServiceId(v string) *CreateVpcEndpointConnectionNotificationInput { + s.ServiceId = &v + return s +} + +// SetVpcEndpointId sets the VpcEndpointId field's value. +func (s *CreateVpcEndpointConnectionNotificationInput) SetVpcEndpointId(v string) *CreateVpcEndpointConnectionNotificationInput { + s.VpcEndpointId = &v + return s +} + +type CreateVpcEndpointConnectionNotificationOutput struct { _ struct{} `type:"structure"` - // Information about the Standard Reserved Instance listing. - ReservedInstancesListings []*ReservedInstancesListing `locationName:"reservedInstancesListingsSet" locationNameList:"item" type:"list"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string `locationName:"clientToken" type:"string"` + + // Information about the notification. + ConnectionNotification *ConnectionNotification `locationName:"connectionNotification" type:"structure"` } // String returns the string representation -func (s CreateReservedInstancesListingOutput) String() string { +func (s CreateVpcEndpointConnectionNotificationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateReservedInstancesListingOutput) GoString() string { +func (s CreateVpcEndpointConnectionNotificationOutput) GoString() string { return s.String() } -// SetReservedInstancesListings sets the ReservedInstancesListings field's value. -func (s *CreateReservedInstancesListingOutput) SetReservedInstancesListings(v []*ReservedInstancesListing) *CreateReservedInstancesListingOutput { - s.ReservedInstancesListings = v +// SetClientToken sets the ClientToken field's value. +func (s *CreateVpcEndpointConnectionNotificationOutput) SetClientToken(v string) *CreateVpcEndpointConnectionNotificationOutput { + s.ClientToken = &v return s } -type CreateRouteInput struct { - _ struct{} `type:"structure"` +// SetConnectionNotification sets the ConnectionNotification field's value. +func (s *CreateVpcEndpointConnectionNotificationOutput) SetConnectionNotification(v *ConnectionNotification) *CreateVpcEndpointConnectionNotificationOutput { + s.ConnectionNotification = v + return s +} - // 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"` +// Contains the parameters for CreateVpcEndpoint. +type CreateVpcEndpointInput struct { + _ struct{} `type:"structure"` - // The IPv6 CIDR block used for the destination match. Routing decisions are - // based on the most specific match. - DestinationIpv6CidrBlock *string `locationName:"destinationIpv6CidrBlock" type:"string"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://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 `locationName:"dryRun" type:"boolean"` - - // [IPv6 traffic only] The ID of an egress-only internet gateway. - EgressOnlyInternetGatewayId *string `locationName:"egressOnlyInternetGatewayId" type:"string"` + DryRun *bool `type:"boolean"` - // The ID of an internet gateway or virtual private gateway attached to your - // VPC. - GatewayId *string `locationName:"gatewayId" type:"string"` + // 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"` - // 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"` + // (Interface endpoint) Indicates whether to associate a private hosted zone + // with the specified VPC. The private hosted zone contains a record set for + // the default public DNS name for the service for the Region (for example, + // kinesis.us-east-1.amazonaws.com), which resolves to the private IP addresses + // of the endpoint network interfaces in the VPC. This enables you to make requests + // to the default public DNS name for the service instead of the public DNS + // names that are automatically generated by the VPC endpoint service. + // + // To use a private hosted zone, you must set the following VPC attributes to + // true: enableDnsHostnames and enableDnsSupport. Use ModifyVpcAttribute to + // set the VPC attributes. + // + // Default: true + PrivateDnsEnabled *bool `type:"boolean"` - // [IPv4 traffic only] The ID of a NAT gateway. - NatGatewayId *string `locationName:"natGatewayId" type:"string"` + // (Gateway endpoint) One or more route table IDs. + RouteTableIds []*string `locationName:"RouteTableId" locationNameList:"item" type:"list"` - // The ID of a network interface. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` + // (Interface endpoint) The ID of one or more security groups to associate with + // the endpoint network interface. + SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"item" type:"list"` - // The ID of the route table for the route. + // The service name. To get a list of available services, use the DescribeVpcEndpointServices + // request, or get the name from the service provider. // - // RouteTableId is a required field - RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` + // ServiceName is a required field + ServiceName *string `type:"string" required:"true"` - // The ID of a transit gateway. - TransitGatewayId *string `type:"string"` + // (Interface endpoint) The ID of one or more subnets in which to create an + // endpoint network interface. + SubnetIds []*string `locationName:"SubnetId" locationNameList:"item" type:"list"` - // The ID of a VPC peering connection. - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string"` + // The tags to associate with the endpoint. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + + // The type of endpoint. + // + // Default: Gateway + VpcEndpointType *string `type:"string" enum:"VpcEndpointType"` + + // 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 CreateRouteInput) String() string { +func (s CreateVpcEndpointInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateRouteInput) GoString() string { +func (s CreateVpcEndpointInput) 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")) +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 { @@ -42260,125 +49841,151 @@ func (s *CreateRouteInput) Validate() error { return nil } -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *CreateRouteInput) SetDestinationCidrBlock(v string) *CreateRouteInput { - s.DestinationCidrBlock = &v +// SetClientToken sets the ClientToken field's value. +func (s *CreateVpcEndpointInput) SetClientToken(v string) *CreateVpcEndpointInput { + s.ClientToken = &v return s } -// SetDestinationIpv6CidrBlock sets the DestinationIpv6CidrBlock field's value. -func (s *CreateRouteInput) SetDestinationIpv6CidrBlock(v string) *CreateRouteInput { - s.DestinationIpv6CidrBlock = &v +// SetDryRun sets the DryRun field's value. +func (s *CreateVpcEndpointInput) SetDryRun(v bool) *CreateVpcEndpointInput { + s.DryRun = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *CreateRouteInput) SetDryRun(v bool) *CreateRouteInput { - s.DryRun = &v +// SetPolicyDocument sets the PolicyDocument field's value. +func (s *CreateVpcEndpointInput) SetPolicyDocument(v string) *CreateVpcEndpointInput { + s.PolicyDocument = &v return s } -// SetEgressOnlyInternetGatewayId sets the EgressOnlyInternetGatewayId field's value. -func (s *CreateRouteInput) SetEgressOnlyInternetGatewayId(v string) *CreateRouteInput { - s.EgressOnlyInternetGatewayId = &v +// SetPrivateDnsEnabled sets the PrivateDnsEnabled field's value. +func (s *CreateVpcEndpointInput) SetPrivateDnsEnabled(v bool) *CreateVpcEndpointInput { + s.PrivateDnsEnabled = &v return s } -// SetGatewayId sets the GatewayId field's value. -func (s *CreateRouteInput) SetGatewayId(v string) *CreateRouteInput { - s.GatewayId = &v +// SetRouteTableIds sets the RouteTableIds field's value. +func (s *CreateVpcEndpointInput) SetRouteTableIds(v []*string) *CreateVpcEndpointInput { + s.RouteTableIds = v return s } -// SetInstanceId sets the InstanceId field's value. -func (s *CreateRouteInput) SetInstanceId(v string) *CreateRouteInput { - s.InstanceId = &v +// SetSecurityGroupIds sets the SecurityGroupIds field's value. +func (s *CreateVpcEndpointInput) SetSecurityGroupIds(v []*string) *CreateVpcEndpointInput { + s.SecurityGroupIds = v return s } -// SetNatGatewayId sets the NatGatewayId field's value. -func (s *CreateRouteInput) SetNatGatewayId(v string) *CreateRouteInput { - s.NatGatewayId = &v +// SetServiceName sets the ServiceName field's value. +func (s *CreateVpcEndpointInput) SetServiceName(v string) *CreateVpcEndpointInput { + s.ServiceName = &v return s } -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *CreateRouteInput) SetNetworkInterfaceId(v string) *CreateRouteInput { - s.NetworkInterfaceId = &v +// SetSubnetIds sets the SubnetIds field's value. +func (s *CreateVpcEndpointInput) SetSubnetIds(v []*string) *CreateVpcEndpointInput { + s.SubnetIds = v return s } -// SetRouteTableId sets the RouteTableId field's value. -func (s *CreateRouteInput) SetRouteTableId(v string) *CreateRouteInput { - s.RouteTableId = &v +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateVpcEndpointInput) SetTagSpecifications(v []*TagSpecification) *CreateVpcEndpointInput { + s.TagSpecifications = v return s } -// SetTransitGatewayId sets the TransitGatewayId field's value. -func (s *CreateRouteInput) SetTransitGatewayId(v string) *CreateRouteInput { - s.TransitGatewayId = &v +// SetVpcEndpointType sets the VpcEndpointType field's value. +func (s *CreateVpcEndpointInput) SetVpcEndpointType(v string) *CreateVpcEndpointInput { + s.VpcEndpointType = &v return s } -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *CreateRouteInput) SetVpcPeeringConnectionId(v string) *CreateRouteInput { - s.VpcPeeringConnectionId = &v +// SetVpcId sets the VpcId field's value. +func (s *CreateVpcEndpointInput) SetVpcId(v string) *CreateVpcEndpointInput { + s.VpcId = &v return s } -type CreateRouteOutput struct { +// Contains the output of CreateVpcEndpoint. +type CreateVpcEndpointOutput struct { _ struct{} `type:"structure"` - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` + // Unique, case-sensitive identifier that 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 CreateRouteOutput) String() string { +func (s CreateVpcEndpointOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateRouteOutput) GoString() string { +func (s CreateVpcEndpointOutput) GoString() string { return s.String() } -// SetReturn sets the Return field's value. -func (s *CreateRouteOutput) SetReturn(v bool) *CreateRouteOutput { - s.Return = &v +// SetClientToken sets the ClientToken field's value. +func (s *CreateVpcEndpointOutput) SetClientToken(v string) *CreateVpcEndpointOutput { + s.ClientToken = &v return s } -type CreateRouteTableInput struct { +// SetVpcEndpoint sets the VpcEndpoint field's value. +func (s *CreateVpcEndpointOutput) SetVpcEndpoint(v *VpcEndpoint) *CreateVpcEndpointOutput { + s.VpcEndpoint = v + return s +} + +type CreateVpcEndpointServiceConfigurationInput struct { _ struct{} `type:"structure"` + // Indicates whether requests from service consumers to create an endpoint to + // your service must be accepted. To accept a request, use AcceptVpcEndpointConnections. + AcceptanceRequired *bool `type:"boolean"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see How to Ensure Idempotency (https://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 `locationName:"dryRun" type:"boolean"` + DryRun *bool `type:"boolean"` - // The ID of the VPC. + // The Amazon Resource Names (ARNs) of one or more Network Load Balancers for + // your service. // - // VpcId is a required field - VpcId *string `locationName:"vpcId" type:"string" required:"true"` + // NetworkLoadBalancerArns is a required field + NetworkLoadBalancerArns []*string `locationName:"NetworkLoadBalancerArn" locationNameList:"item" type:"list" required:"true"` + + // The private DNS name to assign to the VPC endpoint service. + PrivateDnsName *string `type:"string"` + + // The tags to associate with the service. + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } // String returns the string representation -func (s CreateRouteTableInput) String() string { +func (s CreateVpcEndpointServiceConfigurationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateRouteTableInput) GoString() string { +func (s CreateVpcEndpointServiceConfigurationInput) 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")) +func (s *CreateVpcEndpointServiceConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateVpcEndpointServiceConfigurationInput"} + if s.NetworkLoadBalancerArns == nil { + invalidParams.Add(request.NewErrParamRequired("NetworkLoadBalancerArns")) } if invalidParams.Len() > 0 { @@ -42387,54 +49994,87 @@ func (s *CreateRouteTableInput) Validate() error { return nil } +// SetAcceptanceRequired sets the AcceptanceRequired field's value. +func (s *CreateVpcEndpointServiceConfigurationInput) SetAcceptanceRequired(v bool) *CreateVpcEndpointServiceConfigurationInput { + s.AcceptanceRequired = &v + return s +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateVpcEndpointServiceConfigurationInput) SetClientToken(v string) *CreateVpcEndpointServiceConfigurationInput { + s.ClientToken = &v + return s +} + // SetDryRun sets the DryRun field's value. -func (s *CreateRouteTableInput) SetDryRun(v bool) *CreateRouteTableInput { +func (s *CreateVpcEndpointServiceConfigurationInput) SetDryRun(v bool) *CreateVpcEndpointServiceConfigurationInput { s.DryRun = &v return s } -// SetVpcId sets the VpcId field's value. -func (s *CreateRouteTableInput) SetVpcId(v string) *CreateRouteTableInput { - s.VpcId = &v +// SetNetworkLoadBalancerArns sets the NetworkLoadBalancerArns field's value. +func (s *CreateVpcEndpointServiceConfigurationInput) SetNetworkLoadBalancerArns(v []*string) *CreateVpcEndpointServiceConfigurationInput { + s.NetworkLoadBalancerArns = v return s } -type CreateRouteTableOutput struct { +// SetPrivateDnsName sets the PrivateDnsName field's value. +func (s *CreateVpcEndpointServiceConfigurationInput) SetPrivateDnsName(v string) *CreateVpcEndpointServiceConfigurationInput { + s.PrivateDnsName = &v + return s +} + +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *CreateVpcEndpointServiceConfigurationInput) SetTagSpecifications(v []*TagSpecification) *CreateVpcEndpointServiceConfigurationInput { + s.TagSpecifications = v + return s +} + +type CreateVpcEndpointServiceConfigurationOutput struct { _ struct{} `type:"structure"` - // Information about the route table. - RouteTable *RouteTable `locationName:"routeTable" type:"structure"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string `locationName:"clientToken" type:"string"` + + // Information about the service configuration. + ServiceConfiguration *ServiceConfiguration `locationName:"serviceConfiguration" type:"structure"` } // String returns the string representation -func (s CreateRouteTableOutput) String() string { +func (s CreateVpcEndpointServiceConfigurationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateRouteTableOutput) GoString() string { +func (s CreateVpcEndpointServiceConfigurationOutput) GoString() string { return s.String() } -// SetRouteTable sets the RouteTable field's value. -func (s *CreateRouteTableOutput) SetRouteTable(v *RouteTable) *CreateRouteTableOutput { - s.RouteTable = v +// SetClientToken sets the ClientToken field's value. +func (s *CreateVpcEndpointServiceConfigurationOutput) SetClientToken(v string) *CreateVpcEndpointServiceConfigurationOutput { + s.ClientToken = &v return s } -type CreateSecurityGroupInput struct { +// SetServiceConfiguration sets the ServiceConfiguration field's value. +func (s *CreateVpcEndpointServiceConfigurationOutput) SetServiceConfiguration(v *ServiceConfiguration) *CreateVpcEndpointServiceConfigurationOutput { + s.ServiceConfiguration = v + return s +} + +type CreateVpcInput 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 ._-:/()#,@[]+=&;{}!$* + // 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. // - // Description is a required field - Description *string `locationName:"GroupDescription" type:"string" required:"true"` + // 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 @@ -42442,39 +50082,49 @@ type CreateSecurityGroupInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The name of the security group. + // 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. // - // Constraints: Up to 255 characters in length. Cannot start with sg-. + // Important: The host value cannot be used with this parameter. Use the default + // or dedicated values only. // - // Constraints for EC2-Classic: ASCII characters + // Default: default + InstanceTenancy *string `locationName:"instanceTenancy" type:"string" enum:"Tenancy"` + + // The IPv6 CIDR block from the IPv6 address pool. You must also specify Ipv6Pool + // in the request. // - // Constraints for EC2-VPC: a-z, A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$* + // To let Amazon choose the IPv6 CIDR block for you, omit this parameter. + Ipv6CidrBlock *string `type:"string"` + + // The name of the location from which we advertise the IPV6 CIDR block. Use + // this parameter to limit the address to this location. // - // GroupName is a required field - GroupName *string `type:"string" required:"true"` + // You must set AmazonProvidedIpv6CidrBlock to true to use this parameter. + Ipv6CidrBlockNetworkBorderGroup *string `type:"string"` - // [EC2-VPC] The ID of the VPC. Required for EC2-VPC. - VpcId *string `type:"string"` + // The ID of an IPv6 address pool from which to allocate the IPv6 CIDR block. + Ipv6Pool *string `type:"string"` } // String returns the string representation -func (s CreateSecurityGroupInput) String() string { +func (s CreateVpcInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateSecurityGroupInput) GoString() string { +func (s CreateVpcInput) 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")) +func (s *CreateVpcInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateVpcInput"} + if s.CidrBlock == nil { + invalidParams.Add(request.NewErrParamRequired("CidrBlock")) } if invalidParams.Len() > 0 { @@ -42483,59 +50133,170 @@ func (s *CreateSecurityGroupInput) Validate() error { return nil } -// SetDescription sets the Description field's value. -func (s *CreateSecurityGroupInput) SetDescription(v string) *CreateSecurityGroupInput { - s.Description = &v +// 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 +} + +// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. +func (s *CreateVpcInput) SetIpv6CidrBlock(v string) *CreateVpcInput { + s.Ipv6CidrBlock = &v + return s +} + +// SetIpv6CidrBlockNetworkBorderGroup sets the Ipv6CidrBlockNetworkBorderGroup field's value. +func (s *CreateVpcInput) SetIpv6CidrBlockNetworkBorderGroup(v string) *CreateVpcInput { + s.Ipv6CidrBlockNetworkBorderGroup = &v + return s +} + +// SetIpv6Pool sets the Ipv6Pool field's value. +func (s *CreateVpcInput) SetIpv6Pool(v string) *CreateVpcInput { + s.Ipv6Pool = &v + return s +} + +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 +} + +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 accepter VPC. + // + // Default: Your AWS account ID + PeerOwnerId *string `locationName:"peerOwnerId" type:"string"` + + // The Region code for the accepter VPC, if the accepter VPC is located in a + // Region other than the Region in which you make the request. + // + // Default: The Region in which you make the request. + PeerRegion *string `type:"string"` + + // The ID of the VPC with which you are creating the VPC peering connection. + // You must specify this parameter in the request. + PeerVpcId *string `locationName:"peerVpcId" type:"string"` + + // The ID of the requester VPC. You must specify this parameter in the request. + 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 } -// SetDryRun sets the DryRun field's value. -func (s *CreateSecurityGroupInput) SetDryRun(v bool) *CreateSecurityGroupInput { - s.DryRun = &v +// SetPeerOwnerId sets the PeerOwnerId field's value. +func (s *CreateVpcPeeringConnectionInput) SetPeerOwnerId(v string) *CreateVpcPeeringConnectionInput { + s.PeerOwnerId = &v return s } -// SetGroupName sets the GroupName field's value. -func (s *CreateSecurityGroupInput) SetGroupName(v string) *CreateSecurityGroupInput { - s.GroupName = &v +// SetPeerRegion sets the PeerRegion field's value. +func (s *CreateVpcPeeringConnectionInput) SetPeerRegion(v string) *CreateVpcPeeringConnectionInput { + s.PeerRegion = &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 *CreateSecurityGroupInput) SetVpcId(v string) *CreateSecurityGroupInput { +func (s *CreateVpcPeeringConnectionInput) SetVpcId(v string) *CreateVpcPeeringConnectionInput { s.VpcId = &v return s } -type CreateSecurityGroupOutput struct { +type CreateVpcPeeringConnectionOutput struct { _ struct{} `type:"structure"` - // The ID of the security group. - GroupId *string `locationName:"groupId" type:"string"` + // Information about the VPC peering connection. + VpcPeeringConnection *VpcPeeringConnection `locationName:"vpcPeeringConnection" type:"structure"` } // String returns the string representation -func (s CreateSecurityGroupOutput) String() string { +func (s CreateVpcPeeringConnectionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateSecurityGroupOutput) GoString() string { +func (s CreateVpcPeeringConnectionOutput) GoString() string { return s.String() } -// SetGroupId sets the GroupId field's value. -func (s *CreateSecurityGroupOutput) SetGroupId(v string) *CreateSecurityGroupOutput { - s.GroupId = &v +// SetVpcPeeringConnection sets the VpcPeeringConnection field's value. +func (s *CreateVpcPeeringConnectionOutput) SetVpcPeeringConnection(v *VpcPeeringConnection) *CreateVpcPeeringConnectionOutput { + s.VpcPeeringConnection = v return s } -// Contains the parameters for CreateSnapshot. -type CreateSnapshotInput struct { +// Contains the parameters for CreateVpnConnection. +type CreateVpnConnectionInput struct { _ struct{} `type:"structure"` - // A description for the snapshot. - Description *string `type:"string"` + // 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 @@ -42543,30 +50304,41 @@ type CreateSnapshotInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The tags to apply to the snapshot during creation. - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // The options for the VPN connection. + Options *VpnConnectionOptionsSpecification `locationName:"options" type:"structure"` - // The ID of the EBS volume. + // The ID of the transit gateway. If you specify a transit gateway, you cannot + // specify a virtual private gateway. + TransitGatewayId *string `type:"string"` + + // The type of VPN connection (ipsec.1). // - // VolumeId is a required field - VolumeId *string `type:"string" required:"true"` + // Type is a required field + Type *string `type:"string" required:"true"` + + // The ID of the virtual private gateway. If you specify a virtual private gateway, + // you cannot specify a transit gateway. + VpnGatewayId *string `type:"string"` } // String returns the string representation -func (s CreateSnapshotInput) String() string { +func (s CreateVpnConnectionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateSnapshotInput) GoString() string { +func (s CreateVpnConnectionInput) 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")) +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 invalidParams.Len() > 0 { @@ -42575,68 +50347,99 @@ func (s *CreateSnapshotInput) Validate() error { return nil } -// SetDescription sets the Description field's value. -func (s *CreateSnapshotInput) SetDescription(v string) *CreateSnapshotInput { - s.Description = &v +// 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 *CreateSnapshotInput) SetDryRun(v bool) *CreateSnapshotInput { +func (s *CreateVpnConnectionInput) SetDryRun(v bool) *CreateVpnConnectionInput { s.DryRun = &v return s } -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateSnapshotInput) SetTagSpecifications(v []*TagSpecification) *CreateSnapshotInput { - s.TagSpecifications = v +// SetOptions sets the Options field's value. +func (s *CreateVpnConnectionInput) SetOptions(v *VpnConnectionOptionsSpecification) *CreateVpnConnectionInput { + s.Options = v return s } -// SetVolumeId sets the VolumeId field's value. -func (s *CreateSnapshotInput) SetVolumeId(v string) *CreateSnapshotInput { - s.VolumeId = &v +// SetTransitGatewayId sets the TransitGatewayId field's value. +func (s *CreateVpnConnectionInput) SetTransitGatewayId(v string) *CreateVpnConnectionInput { + s.TransitGatewayId = &v return s } -type CreateSnapshotsInput struct { +// 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. +type CreateVpnConnectionOutput struct { _ struct{} `type:"structure"` - // Copies the tags from the specified volume to corresponding snapshot. - CopyTagsFromSource *string `type:"string" enum:"CopyTagsFromSource"` + // Information about the VPN connection. + VpnConnection *VpnConnection `locationName:"vpnConnection" type:"structure"` +} - // A description propagated to every snapshot specified by the instance. - Description *string `type:"string"` +// String returns the string representation +func (s CreateVpnConnectionOutput) String() string { + return awsutil.Prettify(s) +} - // Checks whether you have the required permissions for the action without actually - // making the request. Provides an error response. If you have the required - // permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation. - DryRun *bool `type:"boolean"` +// GoString returns the string representation +func (s CreateVpnConnectionOutput) GoString() string { + return s.String() +} - // The instance to specify which volumes should be included in the snapshots. +// SetVpnConnection sets the VpnConnection field's value. +func (s *CreateVpnConnectionOutput) SetVpnConnection(v *VpnConnection) *CreateVpnConnectionOutput { + s.VpnConnection = v + return s +} + +// Contains the parameters for CreateVpnConnectionRoute. +type CreateVpnConnectionRouteInput struct { + _ struct{} `type:"structure"` + + // The CIDR block associated with the local subnet of the customer network. // - // InstanceSpecification is a required field - InstanceSpecification *InstanceSpecification `type:"structure" required:"true"` + // DestinationCidrBlock is a required field + DestinationCidrBlock *string `type:"string" required:"true"` - // Tags to apply to every snapshot specified by the instance. - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // The ID of the VPN connection. + // + // VpnConnectionId is a required field + VpnConnectionId *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateSnapshotsInput) String() string { +func (s CreateVpnConnectionRouteInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateSnapshotsInput) GoString() string { +func (s CreateVpnConnectionRouteInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSnapshotsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSnapshotsInput"} - if s.InstanceSpecification == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceSpecification")) +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 { @@ -42645,67 +50448,45 @@ func (s *CreateSnapshotsInput) Validate() error { return nil } -// SetCopyTagsFromSource sets the CopyTagsFromSource field's value. -func (s *CreateSnapshotsInput) SetCopyTagsFromSource(v string) *CreateSnapshotsInput { - s.CopyTagsFromSource = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateSnapshotsInput) SetDescription(v string) *CreateSnapshotsInput { - s.Description = &v - return s -} - -// SetDryRun sets the DryRun field's value. -func (s *CreateSnapshotsInput) SetDryRun(v bool) *CreateSnapshotsInput { - s.DryRun = &v - return s -} - -// SetInstanceSpecification sets the InstanceSpecification field's value. -func (s *CreateSnapshotsInput) SetInstanceSpecification(v *InstanceSpecification) *CreateSnapshotsInput { - s.InstanceSpecification = v +// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. +func (s *CreateVpnConnectionRouteInput) SetDestinationCidrBlock(v string) *CreateVpnConnectionRouteInput { + s.DestinationCidrBlock = &v return s } -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateSnapshotsInput) SetTagSpecifications(v []*TagSpecification) *CreateSnapshotsInput { - s.TagSpecifications = v +// SetVpnConnectionId sets the VpnConnectionId field's value. +func (s *CreateVpnConnectionRouteInput) SetVpnConnectionId(v string) *CreateVpnConnectionRouteInput { + s.VpnConnectionId = &v return s } -type CreateSnapshotsOutput struct { +type CreateVpnConnectionRouteOutput struct { _ struct{} `type:"structure"` - - // List of snapshots. - Snapshots []*SnapshotInfo `locationName:"snapshotSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s CreateSnapshotsOutput) String() string { +func (s CreateVpnConnectionRouteOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateSnapshotsOutput) GoString() string { +func (s CreateVpnConnectionRouteOutput) GoString() string { return s.String() } -// SetSnapshots sets the Snapshots field's value. -func (s *CreateSnapshotsOutput) SetSnapshots(v []*SnapshotInfo) *CreateSnapshotsOutput { - s.Snapshots = v - return s -} - -// Contains the parameters for CreateSpotDatafeedSubscription. -type CreateSpotDatafeedSubscriptionInput struct { +// Contains the parameters for CreateVpnGateway. +type CreateVpnGatewayInput struct { _ struct{} `type:"structure"` - // The Amazon S3 bucket in which to store the Spot Instance data feed. + // A private Autonomous System Number (ASN) for the Amazon side of a BGP session. + // If you're using a 16-bit ASN, it must be in the 64512 to 65534 range. If + // you're using a 32-bit ASN, it must be in the 4200000000 to 4294967294 range. // - // Bucket is a required field - Bucket *string `locationName:"bucket" type:"string" required:"true"` + // Default: 64512 + AmazonSideAsn *int64 `type:"long"` + + // 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 @@ -42713,25 +50494,27 @@ type CreateSpotDatafeedSubscriptionInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // A prefix for the data feed file names. - Prefix *string `locationName:"prefix" type:"string"` + // 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 CreateSpotDatafeedSubscriptionInput) String() string { +func (s CreateVpnGatewayInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateSpotDatafeedSubscriptionInput) GoString() string { +func (s CreateVpnGatewayInput) 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")) +func (s *CreateVpnGatewayInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateVpnGatewayInput"} + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) } if invalidParams.Len() > 0 { @@ -42740,99 +50523,105 @@ func (s *CreateSpotDatafeedSubscriptionInput) Validate() error { return nil } -// SetBucket sets the Bucket field's value. -func (s *CreateSpotDatafeedSubscriptionInput) SetBucket(v string) *CreateSpotDatafeedSubscriptionInput { - s.Bucket = &v +// SetAmazonSideAsn sets the AmazonSideAsn field's value. +func (s *CreateVpnGatewayInput) SetAmazonSideAsn(v int64) *CreateVpnGatewayInput { + s.AmazonSideAsn = &v + return s +} + +// 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 *CreateSpotDatafeedSubscriptionInput) SetDryRun(v bool) *CreateSpotDatafeedSubscriptionInput { +func (s *CreateVpnGatewayInput) SetDryRun(v bool) *CreateVpnGatewayInput { s.DryRun = &v return s } -// SetPrefix sets the Prefix field's value. -func (s *CreateSpotDatafeedSubscriptionInput) SetPrefix(v string) *CreateSpotDatafeedSubscriptionInput { - s.Prefix = &v +// SetType sets the Type field's value. +func (s *CreateVpnGatewayInput) SetType(v string) *CreateVpnGatewayInput { + s.Type = &v return s } -// Contains the output of CreateSpotDatafeedSubscription. -type CreateSpotDatafeedSubscriptionOutput struct { +// Contains the output of CreateVpnGateway. +type CreateVpnGatewayOutput struct { _ struct{} `type:"structure"` - // The Spot Instance data feed subscription. - SpotDatafeedSubscription *SpotDatafeedSubscription `locationName:"spotDatafeedSubscription" type:"structure"` + // Information about the virtual private gateway. + VpnGateway *VpnGateway `locationName:"vpnGateway" type:"structure"` } // String returns the string representation -func (s CreateSpotDatafeedSubscriptionOutput) String() string { +func (s CreateVpnGatewayOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateSpotDatafeedSubscriptionOutput) GoString() string { +func (s CreateVpnGatewayOutput) GoString() string { return s.String() } -// SetSpotDatafeedSubscription sets the SpotDatafeedSubscription field's value. -func (s *CreateSpotDatafeedSubscriptionOutput) SetSpotDatafeedSubscription(v *SpotDatafeedSubscription) *CreateSpotDatafeedSubscriptionOutput { - s.SpotDatafeedSubscription = v +// SetVpnGateway sets the VpnGateway field's value. +func (s *CreateVpnGatewayOutput) SetVpnGateway(v *VpnGateway) *CreateVpnGatewayOutput { + s.VpnGateway = v return s } -type CreateSubnetInput struct { +// Describes the credit option for CPU usage of a T2 or T3 instance. +type CreditSpecification 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 credit option for CPU usage of a T2 or T3 instance. Valid values are + // standard and unlimited. + CpuCredits *string `locationName:"cpuCredits" type:"string"` +} - // The AZ ID of the subnet. - AvailabilityZoneId *string `type:"string"` +// String returns the string representation +func (s CreditSpecification) String() string { + return awsutil.Prettify(s) +} - // 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"` +// GoString returns the string representation +func (s CreditSpecification) GoString() string { + return s.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"` +// SetCpuCredits sets the CpuCredits field's value. +func (s *CreditSpecification) SetCpuCredits(v string) *CreditSpecification { + s.CpuCredits = &v + return s +} - // The IPv6 network range for the subnet, in CIDR notation. The subnet size - // must use a /64 prefix length. - Ipv6CidrBlock *string `type:"string"` +// The credit option for CPU usage of a T2 or T3 instance. +type CreditSpecificationRequest struct { + _ struct{} `type:"structure"` - // The ID of the VPC. + // The credit option for CPU usage of a T2 or T3 instance. Valid values are + // standard and unlimited. // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` + // CpuCredits is a required field + CpuCredits *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateSubnetInput) String() string { +func (s CreditSpecificationRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateSubnetInput) GoString() string { +func (s CreditSpecificationRequest) 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")) +func (s *CreditSpecificationRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreditSpecificationRequest"} + if s.CpuCredits == nil { + invalidParams.Add(request.NewErrParamRequired("CpuCredits")) } if invalidParams.Len() > 0 { @@ -42841,327 +50630,216 @@ func (s *CreateSubnetInput) Validate() error { return nil } -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *CreateSubnetInput) SetAvailabilityZone(v string) *CreateSubnetInput { - s.AvailabilityZone = &v +// SetCpuCredits sets the CpuCredits field's value. +func (s *CreditSpecificationRequest) SetCpuCredits(v string) *CreditSpecificationRequest { + s.CpuCredits = &v return s } -// SetAvailabilityZoneId sets the AvailabilityZoneId field's value. -func (s *CreateSubnetInput) SetAvailabilityZoneId(v string) *CreateSubnetInput { - s.AvailabilityZoneId = &v - return s -} +// Describes a customer gateway. +type CustomerGateway struct { + _ struct{} `type:"structure"` -// SetCidrBlock sets the CidrBlock field's value. -func (s *CreateSubnetInput) SetCidrBlock(v string) *CreateSubnetInput { - s.CidrBlock = &v - return s -} + // The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number + // (ASN). + BgpAsn *string `locationName:"bgpAsn" type:"string"` -// SetDryRun sets the DryRun field's value. -func (s *CreateSubnetInput) SetDryRun(v bool) *CreateSubnetInput { - s.DryRun = &v - return s -} + // The Amazon Resource Name (ARN) for the customer gateway certificate. + CertificateArn *string `locationName:"certificateArn" type:"string"` -// SetIpv6CidrBlock sets the Ipv6CidrBlock field's value. -func (s *CreateSubnetInput) SetIpv6CidrBlock(v string) *CreateSubnetInput { - s.Ipv6CidrBlock = &v - return s -} + // The ID of the customer gateway. + CustomerGatewayId *string `locationName:"customerGatewayId" type:"string"` -// SetVpcId sets the VpcId field's value. -func (s *CreateSubnetInput) SetVpcId(v string) *CreateSubnetInput { - s.VpcId = &v - return s -} + // The name of customer gateway device. + DeviceName *string `locationName:"deviceName" type:"string"` -type CreateSubnetOutput struct { - _ struct{} `type:"structure"` + // The Internet-routable IP address of the customer gateway's outside interface. + IpAddress *string `locationName:"ipAddress" type:"string"` - // Information about the subnet. - Subnet *Subnet `locationName:"subnet" type:"structure"` + // 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 CreateSubnetOutput) String() string { +func (s CustomerGateway) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateSubnetOutput) GoString() string { +func (s CustomerGateway) GoString() string { return s.String() } -// SetSubnet sets the Subnet field's value. -func (s *CreateSubnetOutput) SetSubnet(v *Subnet) *CreateSubnetOutput { - s.Subnet = v +// SetBgpAsn sets the BgpAsn field's value. +func (s *CustomerGateway) SetBgpAsn(v string) *CustomerGateway { + s.BgpAsn = &v return s } -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 the resources, separated by spaces. - // - // Constraints: Up to 1000 resource IDs. We recommend breaking up this request - // into smaller batches. - // - // Resources is a required field - Resources []*string `locationName:"ResourceId" type:"list" required:"true"` - - // The 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) +// SetCertificateArn sets the CertificateArn field's value. +func (s *CustomerGateway) SetCertificateArn(v string) *CustomerGateway { + s.CertificateArn = &v + return s } -// GoString returns the string representation -func (s CreateTagsInput) GoString() string { - return s.String() +// SetCustomerGatewayId sets the CustomerGatewayId field's value. +func (s *CustomerGateway) SetCustomerGatewayId(v string) *CustomerGateway { + s.CustomerGatewayId = &v + return s } -// 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 +// SetDeviceName sets the DeviceName field's value. +func (s *CustomerGateway) SetDeviceName(v string) *CustomerGateway { + s.DeviceName = &v + return s } -// SetDryRun sets the DryRun field's value. -func (s *CreateTagsInput) SetDryRun(v bool) *CreateTagsInput { - s.DryRun = &v +// SetIpAddress sets the IpAddress field's value. +func (s *CustomerGateway) SetIpAddress(v string) *CustomerGateway { + s.IpAddress = &v return s } -// SetResources sets the Resources field's value. -func (s *CreateTagsInput) SetResources(v []*string) *CreateTagsInput { - s.Resources = v +// 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 *CreateTagsInput) SetTags(v []*Tag) *CreateTagsInput { +func (s *CustomerGateway) SetTags(v []*Tag) *CustomerGateway { s.Tags = v return s } -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() +// SetType sets the Type field's value. +func (s *CustomerGateway) SetType(v string) *CustomerGateway { + s.Type = &v + return s } -type CreateTrafficMirrorFilterInput struct { +type DeleteClientVpnEndpointInput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string" idempotencyToken:"true"` - - // The description of the Traffic Mirror filter. - Description *string `type:"string"` + // The ID of the Client VPN to be deleted. + // + // ClientVpnEndpointId is a required field + ClientVpnEndpointId *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 `type:"boolean"` - - // The tags to assign to a Traffic Mirror filter. - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` } // String returns the string representation -func (s CreateTrafficMirrorFilterInput) String() string { +func (s DeleteClientVpnEndpointInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTrafficMirrorFilterInput) GoString() string { +func (s DeleteClientVpnEndpointInput) GoString() string { return s.String() } -// SetClientToken sets the ClientToken field's value. -func (s *CreateTrafficMirrorFilterInput) SetClientToken(v string) *CreateTrafficMirrorFilterInput { - s.ClientToken = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteClientVpnEndpointInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteClientVpnEndpointInput"} + if s.ClientVpnEndpointId == nil { + invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetDescription sets the Description field's value. -func (s *CreateTrafficMirrorFilterInput) SetDescription(v string) *CreateTrafficMirrorFilterInput { - s.Description = &v +// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. +func (s *DeleteClientVpnEndpointInput) SetClientVpnEndpointId(v string) *DeleteClientVpnEndpointInput { + s.ClientVpnEndpointId = &v return s } // SetDryRun sets the DryRun field's value. -func (s *CreateTrafficMirrorFilterInput) SetDryRun(v bool) *CreateTrafficMirrorFilterInput { +func (s *DeleteClientVpnEndpointInput) SetDryRun(v bool) *DeleteClientVpnEndpointInput { s.DryRun = &v return s } -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateTrafficMirrorFilterInput) SetTagSpecifications(v []*TagSpecification) *CreateTrafficMirrorFilterInput { - s.TagSpecifications = v - return s -} - -type CreateTrafficMirrorFilterOutput struct { +type DeleteClientVpnEndpointOutput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" type:"string"` - - // Information about the Traffic Mirror filter. - TrafficMirrorFilter *TrafficMirrorFilter `locationName:"trafficMirrorFilter" type:"structure"` + // The current state of the Client VPN endpoint. + Status *ClientVpnEndpointStatus `locationName:"status" type:"structure"` } // String returns the string representation -func (s CreateTrafficMirrorFilterOutput) String() string { +func (s DeleteClientVpnEndpointOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTrafficMirrorFilterOutput) GoString() string { +func (s DeleteClientVpnEndpointOutput) GoString() string { return s.String() } -// SetClientToken sets the ClientToken field's value. -func (s *CreateTrafficMirrorFilterOutput) SetClientToken(v string) *CreateTrafficMirrorFilterOutput { - s.ClientToken = &v - return s -} - -// SetTrafficMirrorFilter sets the TrafficMirrorFilter field's value. -func (s *CreateTrafficMirrorFilterOutput) SetTrafficMirrorFilter(v *TrafficMirrorFilter) *CreateTrafficMirrorFilterOutput { - s.TrafficMirrorFilter = v +// SetStatus sets the Status field's value. +func (s *DeleteClientVpnEndpointOutput) SetStatus(v *ClientVpnEndpointStatus) *DeleteClientVpnEndpointOutput { + s.Status = v return s } -type CreateTrafficMirrorFilterRuleInput struct { +type DeleteClientVpnRouteInput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string" idempotencyToken:"true"` - - // The description of the Traffic Mirror rule. - Description *string `type:"string"` + // The ID of the Client VPN endpoint from which the route is to be deleted. + // + // ClientVpnEndpointId is a required field + ClientVpnEndpointId *string `type:"string" required:"true"` - // The destination CIDR block to assign to the Traffic Mirror rule. + // The IPv4 address range, in CIDR notation, of the route to be deleted. // // DestinationCidrBlock is a required field DestinationCidrBlock *string `type:"string" required:"true"` - // The destination port range. - DestinationPortRange *TrafficMirrorPortRangeRequest `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 protocol, for example UDP, to assign to the Traffic Mirror rule. - // - // For information about the protocol value, see Protocol Numbers (https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml) - // on the Internet Assigned Numbers Authority (IANA) website. - Protocol *int64 `type:"integer"` - - // The action to take (accept | reject) on the filtered traffic. - // - // RuleAction is a required field - RuleAction *string `type:"string" required:"true" enum:"TrafficMirrorRuleAction"` - - // The number of the Traffic Mirror rule. This number must be unique for each - // Traffic Mirror rule in a given direction. The rules are processed in ascending - // order by rule number. - // - // RuleNumber is a required field - RuleNumber *int64 `type:"integer" required:"true"` - - // The source CIDR block to assign to the Traffic Mirror rule. - // - // SourceCidrBlock is a required field - SourceCidrBlock *string `type:"string" required:"true"` - - // The source port range. - SourcePortRange *TrafficMirrorPortRangeRequest `type:"structure"` - - // The type of traffic (ingress | egress). - // - // TrafficDirection is a required field - TrafficDirection *string `type:"string" required:"true" enum:"TrafficDirection"` - - // The ID of the filter that this rule is associated with. - // - // TrafficMirrorFilterId is a required field - TrafficMirrorFilterId *string `type:"string" required:"true"` + // The ID of the target subnet used by the route. + TargetVpcSubnetId *string `type:"string"` } // String returns the string representation -func (s CreateTrafficMirrorFilterRuleInput) String() string { +func (s DeleteClientVpnRouteInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTrafficMirrorFilterRuleInput) GoString() string { +func (s DeleteClientVpnRouteInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTrafficMirrorFilterRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTrafficMirrorFilterRuleInput"} +func (s *DeleteClientVpnRouteInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteClientVpnRouteInput"} + if s.ClientVpnEndpointId == nil { + invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) + } if s.DestinationCidrBlock == nil { invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock")) } - if s.RuleAction == nil { - invalidParams.Add(request.NewErrParamRequired("RuleAction")) - } - if s.RuleNumber == nil { - invalidParams.Add(request.NewErrParamRequired("RuleNumber")) - } - if s.SourceCidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("SourceCidrBlock")) - } - if s.TrafficDirection == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficDirection")) - } - if s.TrafficMirrorFilterId == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficMirrorFilterId")) - } if invalidParams.Len() > 0 { return invalidParams @@ -43169,196 +50847,84 @@ func (s *CreateTrafficMirrorFilterRuleInput) Validate() error { return nil } -// SetClientToken sets the ClientToken field's value. -func (s *CreateTrafficMirrorFilterRuleInput) SetClientToken(v string) *CreateTrafficMirrorFilterRuleInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateTrafficMirrorFilterRuleInput) SetDescription(v string) *CreateTrafficMirrorFilterRuleInput { - s.Description = &v +// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. +func (s *DeleteClientVpnRouteInput) SetClientVpnEndpointId(v string) *DeleteClientVpnRouteInput { + s.ClientVpnEndpointId = &v return s } // SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *CreateTrafficMirrorFilterRuleInput) SetDestinationCidrBlock(v string) *CreateTrafficMirrorFilterRuleInput { +func (s *DeleteClientVpnRouteInput) SetDestinationCidrBlock(v string) *DeleteClientVpnRouteInput { s.DestinationCidrBlock = &v return s } -// SetDestinationPortRange sets the DestinationPortRange field's value. -func (s *CreateTrafficMirrorFilterRuleInput) SetDestinationPortRange(v *TrafficMirrorPortRangeRequest) *CreateTrafficMirrorFilterRuleInput { - s.DestinationPortRange = v - return s -} - // SetDryRun sets the DryRun field's value. -func (s *CreateTrafficMirrorFilterRuleInput) SetDryRun(v bool) *CreateTrafficMirrorFilterRuleInput { +func (s *DeleteClientVpnRouteInput) SetDryRun(v bool) *DeleteClientVpnRouteInput { s.DryRun = &v return s } -// SetProtocol sets the Protocol field's value. -func (s *CreateTrafficMirrorFilterRuleInput) SetProtocol(v int64) *CreateTrafficMirrorFilterRuleInput { - s.Protocol = &v - return s -} - -// SetRuleAction sets the RuleAction field's value. -func (s *CreateTrafficMirrorFilterRuleInput) SetRuleAction(v string) *CreateTrafficMirrorFilterRuleInput { - s.RuleAction = &v - return s -} - -// SetRuleNumber sets the RuleNumber field's value. -func (s *CreateTrafficMirrorFilterRuleInput) SetRuleNumber(v int64) *CreateTrafficMirrorFilterRuleInput { - s.RuleNumber = &v - return s -} - -// SetSourceCidrBlock sets the SourceCidrBlock field's value. -func (s *CreateTrafficMirrorFilterRuleInput) SetSourceCidrBlock(v string) *CreateTrafficMirrorFilterRuleInput { - s.SourceCidrBlock = &v - return s -} - -// SetSourcePortRange sets the SourcePortRange field's value. -func (s *CreateTrafficMirrorFilterRuleInput) SetSourcePortRange(v *TrafficMirrorPortRangeRequest) *CreateTrafficMirrorFilterRuleInput { - s.SourcePortRange = v - return s -} - -// SetTrafficDirection sets the TrafficDirection field's value. -func (s *CreateTrafficMirrorFilterRuleInput) SetTrafficDirection(v string) *CreateTrafficMirrorFilterRuleInput { - s.TrafficDirection = &v - return s -} - -// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value. -func (s *CreateTrafficMirrorFilterRuleInput) SetTrafficMirrorFilterId(v string) *CreateTrafficMirrorFilterRuleInput { - s.TrafficMirrorFilterId = &v +// SetTargetVpcSubnetId sets the TargetVpcSubnetId field's value. +func (s *DeleteClientVpnRouteInput) SetTargetVpcSubnetId(v string) *DeleteClientVpnRouteInput { + s.TargetVpcSubnetId = &v return s } -type CreateTrafficMirrorFilterRuleOutput struct { +type DeleteClientVpnRouteOutput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" type:"string"` - - // The Traffic Mirror rule. - TrafficMirrorFilterRule *TrafficMirrorFilterRule `locationName:"trafficMirrorFilterRule" type:"structure"` + // The current state of the route. + Status *ClientVpnRouteStatus `locationName:"status" type:"structure"` } // String returns the string representation -func (s CreateTrafficMirrorFilterRuleOutput) String() string { +func (s DeleteClientVpnRouteOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTrafficMirrorFilterRuleOutput) GoString() string { +func (s DeleteClientVpnRouteOutput) GoString() string { return s.String() } -// SetClientToken sets the ClientToken field's value. -func (s *CreateTrafficMirrorFilterRuleOutput) SetClientToken(v string) *CreateTrafficMirrorFilterRuleOutput { - s.ClientToken = &v - return s -} - -// SetTrafficMirrorFilterRule sets the TrafficMirrorFilterRule field's value. -func (s *CreateTrafficMirrorFilterRuleOutput) SetTrafficMirrorFilterRule(v *TrafficMirrorFilterRule) *CreateTrafficMirrorFilterRuleOutput { - s.TrafficMirrorFilterRule = v +// SetStatus sets the Status field's value. +func (s *DeleteClientVpnRouteOutput) SetStatus(v *ClientVpnRouteStatus) *DeleteClientVpnRouteOutput { + s.Status = v return s } -type CreateTrafficMirrorSessionInput struct { +// Contains the parameters for DeleteCustomerGateway. +type DeleteCustomerGatewayInput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string" idempotencyToken:"true"` - - // The description of the Traffic Mirror session. - Description *string `type:"string"` + // 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 `type:"boolean"` - - // The ID of the source network interface. - // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `type:"string" required:"true"` - - // The number of bytes in each packet to mirror. These are bytes after the VXLAN - // header. Do not specify this parameter when you want to mirror the entire - // packet. To mirror a subset of the packet, set this to the length (in bytes) - // that you want to mirror. For example, if you set this value to 1network0, - // then the first 100 bytes that meet the filter criteria are copied to the - // target. - // - // If you do not want to mirror the entire packet, use the PacketLength parameter - // to specify the number of bytes in each packet to mirror. - PacketLength *int64 `type:"integer"` - - // The session number determines the order in which sessions are evaluated when - // an interface is used by multiple sessions. The first session with a matching - // filter is the one that mirrors the packets. - // - // Valid values are 1-32766. - // - // SessionNumber is a required field - SessionNumber *int64 `type:"integer" required:"true"` - - // The tags to assign to a Traffic Mirror session. - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` - - // The ID of the Traffic Mirror filter. - // - // TrafficMirrorFilterId is a required field - TrafficMirrorFilterId *string `type:"string" required:"true"` - - // The ID of the Traffic Mirror target. - // - // TrafficMirrorTargetId is a required field - TrafficMirrorTargetId *string `type:"string" required:"true"` - - // The VXLAN ID for the Traffic Mirror session. For more information about the - // VXLAN protocol, see RFC 7348 (https://tools.ietf.org/html/rfc7348). If you - // do not specify a VirtualNetworkId, an account-wide unique id is chosen at - // random. - VirtualNetworkId *int64 `type:"integer"` + DryRun *bool `locationName:"dryRun" type:"boolean"` } // String returns the string representation -func (s CreateTrafficMirrorSessionInput) String() string { +func (s DeleteCustomerGatewayInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTrafficMirrorSessionInput) GoString() string { +func (s DeleteCustomerGatewayInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTrafficMirrorSessionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTrafficMirrorSessionInput"} - if s.NetworkInterfaceId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfaceId")) - } - if s.SessionNumber == nil { - invalidParams.Add(request.NewErrParamRequired("SessionNumber")) - } - if s.TrafficMirrorFilterId == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficMirrorFilterId")) - } - if s.TrafficMirrorTargetId == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficMirrorTargetId")) +func (s *DeleteCustomerGatewayInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteCustomerGatewayInput"} + if s.CustomerGatewayId == nil { + invalidParams.Add(request.NewErrParamRequired("CustomerGatewayId")) } if invalidParams.Len() > 0 { @@ -43367,388 +50933,278 @@ func (s *CreateTrafficMirrorSessionInput) Validate() error { return nil } -// SetClientToken sets the ClientToken field's value. -func (s *CreateTrafficMirrorSessionInput) SetClientToken(v string) *CreateTrafficMirrorSessionInput { - s.ClientToken = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateTrafficMirrorSessionInput) SetDescription(v string) *CreateTrafficMirrorSessionInput { - s.Description = &v +// 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 *CreateTrafficMirrorSessionInput) SetDryRun(v bool) *CreateTrafficMirrorSessionInput { +func (s *DeleteCustomerGatewayInput) SetDryRun(v bool) *DeleteCustomerGatewayInput { s.DryRun = &v return s } -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *CreateTrafficMirrorSessionInput) SetNetworkInterfaceId(v string) *CreateTrafficMirrorSessionInput { - s.NetworkInterfaceId = &v - return s -} - -// SetPacketLength sets the PacketLength field's value. -func (s *CreateTrafficMirrorSessionInput) SetPacketLength(v int64) *CreateTrafficMirrorSessionInput { - s.PacketLength = &v - return s -} - -// SetSessionNumber sets the SessionNumber field's value. -func (s *CreateTrafficMirrorSessionInput) SetSessionNumber(v int64) *CreateTrafficMirrorSessionInput { - s.SessionNumber = &v - return s -} - -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateTrafficMirrorSessionInput) SetTagSpecifications(v []*TagSpecification) *CreateTrafficMirrorSessionInput { - s.TagSpecifications = v - return s -} - -// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value. -func (s *CreateTrafficMirrorSessionInput) SetTrafficMirrorFilterId(v string) *CreateTrafficMirrorSessionInput { - s.TrafficMirrorFilterId = &v - return s -} - -// SetTrafficMirrorTargetId sets the TrafficMirrorTargetId field's value. -func (s *CreateTrafficMirrorSessionInput) SetTrafficMirrorTargetId(v string) *CreateTrafficMirrorSessionInput { - s.TrafficMirrorTargetId = &v - return s -} - -// SetVirtualNetworkId sets the VirtualNetworkId field's value. -func (s *CreateTrafficMirrorSessionInput) SetVirtualNetworkId(v int64) *CreateTrafficMirrorSessionInput { - s.VirtualNetworkId = &v - return s -} - -type CreateTrafficMirrorSessionOutput struct { +type DeleteCustomerGatewayOutput struct { _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" type:"string"` - - // Information about the Traffic Mirror session. - TrafficMirrorSession *TrafficMirrorSession `locationName:"trafficMirrorSession" type:"structure"` } // String returns the string representation -func (s CreateTrafficMirrorSessionOutput) String() string { +func (s DeleteCustomerGatewayOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTrafficMirrorSessionOutput) GoString() string { +func (s DeleteCustomerGatewayOutput) GoString() string { return s.String() } -// SetClientToken sets the ClientToken field's value. -func (s *CreateTrafficMirrorSessionOutput) SetClientToken(v string) *CreateTrafficMirrorSessionOutput { - s.ClientToken = &v - return s -} - -// SetTrafficMirrorSession sets the TrafficMirrorSession field's value. -func (s *CreateTrafficMirrorSessionOutput) SetTrafficMirrorSession(v *TrafficMirrorSession) *CreateTrafficMirrorSessionOutput { - s.TrafficMirrorSession = v - return s -} - -type CreateTrafficMirrorTargetInput struct { +type DeleteDhcpOptionsInput struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string" idempotencyToken:"true"` - - // The description of the Traffic Mirror target. - Description *string `type:"string"` + // 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 `type:"boolean"` - - // The network interface ID that is associated with the target. - NetworkInterfaceId *string `type:"string"` - - // The Amazon Resource Name (ARN) of the Network Load Balancer that is associated - // with the target. - NetworkLoadBalancerArn *string `type:"string"` - - // The tags to assign to the Traffic Mirror target. - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + DryRun *bool `locationName:"dryRun" type:"boolean"` } // String returns the string representation -func (s CreateTrafficMirrorTargetInput) String() string { +func (s DeleteDhcpOptionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTrafficMirrorTargetInput) GoString() string { +func (s DeleteDhcpOptionsInput) GoString() string { return s.String() } -// SetClientToken sets the ClientToken field's value. -func (s *CreateTrafficMirrorTargetInput) SetClientToken(v string) *CreateTrafficMirrorTargetInput { - s.ClientToken = &v - return s +// 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 } -// SetDescription sets the Description field's value. -func (s *CreateTrafficMirrorTargetInput) SetDescription(v string) *CreateTrafficMirrorTargetInput { - s.Description = &v +// 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 *CreateTrafficMirrorTargetInput) SetDryRun(v bool) *CreateTrafficMirrorTargetInput { +func (s *DeleteDhcpOptionsInput) SetDryRun(v bool) *DeleteDhcpOptionsInput { s.DryRun = &v return s } -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *CreateTrafficMirrorTargetInput) SetNetworkInterfaceId(v string) *CreateTrafficMirrorTargetInput { - s.NetworkInterfaceId = &v - return s -} - -// SetNetworkLoadBalancerArn sets the NetworkLoadBalancerArn field's value. -func (s *CreateTrafficMirrorTargetInput) SetNetworkLoadBalancerArn(v string) *CreateTrafficMirrorTargetInput { - s.NetworkLoadBalancerArn = &v - return s -} - -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateTrafficMirrorTargetInput) SetTagSpecifications(v []*TagSpecification) *CreateTrafficMirrorTargetInput { - s.TagSpecifications = v - return s -} - -type CreateTrafficMirrorTargetOutput struct { +type DeleteDhcpOptionsOutput struct { _ struct{} `type:"structure"` - - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. For more information, see How to Ensure Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `locationName:"clientToken" type:"string"` - - // Information about the Traffic Mirror target. - TrafficMirrorTarget *TrafficMirrorTarget `locationName:"trafficMirrorTarget" type:"structure"` } // String returns the string representation -func (s CreateTrafficMirrorTargetOutput) String() string { +func (s DeleteDhcpOptionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTrafficMirrorTargetOutput) GoString() string { +func (s DeleteDhcpOptionsOutput) GoString() string { return s.String() } -// SetClientToken sets the ClientToken field's value. -func (s *CreateTrafficMirrorTargetOutput) SetClientToken(v string) *CreateTrafficMirrorTargetOutput { - s.ClientToken = &v - return s -} - -// SetTrafficMirrorTarget sets the TrafficMirrorTarget field's value. -func (s *CreateTrafficMirrorTargetOutput) SetTrafficMirrorTarget(v *TrafficMirrorTarget) *CreateTrafficMirrorTargetOutput { - s.TrafficMirrorTarget = v - return s -} - -type CreateTransitGatewayInput struct { +type DeleteEgressOnlyInternetGatewayInput struct { _ struct{} `type:"structure"` - // A description of the transit gateway. - 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 `type:"boolean"` - // The transit gateway options. - Options *TransitGatewayRequestOptions `type:"structure"` - - // The tags to apply to the transit gateway. - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // 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 CreateTransitGatewayInput) String() string { +func (s DeleteEgressOnlyInternetGatewayInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTransitGatewayInput) GoString() string { +func (s DeleteEgressOnlyInternetGatewayInput) GoString() string { return s.String() } -// SetDescription sets the Description field's value. -func (s *CreateTransitGatewayInput) SetDescription(v string) *CreateTransitGatewayInput { - s.Description = &v - return s +// 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 *CreateTransitGatewayInput) SetDryRun(v bool) *CreateTransitGatewayInput { +func (s *DeleteEgressOnlyInternetGatewayInput) SetDryRun(v bool) *DeleteEgressOnlyInternetGatewayInput { s.DryRun = &v return s } -// SetOptions sets the Options field's value. -func (s *CreateTransitGatewayInput) SetOptions(v *TransitGatewayRequestOptions) *CreateTransitGatewayInput { - s.Options = v - return s -} - -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateTransitGatewayInput) SetTagSpecifications(v []*TagSpecification) *CreateTransitGatewayInput { - s.TagSpecifications = v +// SetEgressOnlyInternetGatewayId sets the EgressOnlyInternetGatewayId field's value. +func (s *DeleteEgressOnlyInternetGatewayInput) SetEgressOnlyInternetGatewayId(v string) *DeleteEgressOnlyInternetGatewayInput { + s.EgressOnlyInternetGatewayId = &v return s } -type CreateTransitGatewayOutput struct { +type DeleteEgressOnlyInternetGatewayOutput struct { _ struct{} `type:"structure"` - // Information about the transit gateway. - TransitGateway *TransitGateway `locationName:"transitGateway" 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 CreateTransitGatewayOutput) String() string { +func (s DeleteEgressOnlyInternetGatewayOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTransitGatewayOutput) GoString() string { +func (s DeleteEgressOnlyInternetGatewayOutput) GoString() string { return s.String() } -// SetTransitGateway sets the TransitGateway field's value. -func (s *CreateTransitGatewayOutput) SetTransitGateway(v *TransitGateway) *CreateTransitGatewayOutput { - s.TransitGateway = v +// SetReturnCode sets the ReturnCode field's value. +func (s *DeleteEgressOnlyInternetGatewayOutput) SetReturnCode(v bool) *DeleteEgressOnlyInternetGatewayOutput { + s.ReturnCode = &v return s } -type CreateTransitGatewayRouteInput struct { +// Describes an EC2 Fleet error. +type DeleteFleetError struct { _ struct{} `type:"structure"` - // Indicates whether to drop traffic that matches this route. - Blackhole *bool `type:"boolean"` - - // The CIDR range used for destination matches. Routing decisions are based - // on the most specific match. - // - // DestinationCidrBlock is a required field - DestinationCidrBlock *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 `type:"boolean"` - - // The ID of the attachment. - TransitGatewayAttachmentId *string `type:"string"` + // The error code. + Code *string `locationName:"code" type:"string" enum:"DeleteFleetErrorCode"` - // The ID of the transit gateway route table. - // - // TransitGatewayRouteTableId is a required field - TransitGatewayRouteTableId *string `type:"string" required:"true"` + // The description for the error code. + Message *string `locationName:"message" type:"string"` } // String returns the string representation -func (s CreateTransitGatewayRouteInput) String() string { +func (s DeleteFleetError) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTransitGatewayRouteInput) GoString() string { +func (s DeleteFleetError) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTransitGatewayRouteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTransitGatewayRouteInput"} - if s.DestinationCidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock")) - } - if s.TransitGatewayRouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCode sets the Code field's value. +func (s *DeleteFleetError) SetCode(v string) *DeleteFleetError { + s.Code = &v + return s } -// SetBlackhole sets the Blackhole field's value. -func (s *CreateTransitGatewayRouteInput) SetBlackhole(v bool) *CreateTransitGatewayRouteInput { - s.Blackhole = &v +// SetMessage sets the Message field's value. +func (s *DeleteFleetError) SetMessage(v string) *DeleteFleetError { + s.Message = &v return s } -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *CreateTransitGatewayRouteInput) SetDestinationCidrBlock(v string) *CreateTransitGatewayRouteInput { - s.DestinationCidrBlock = &v - return s +// Describes an EC2 Fleet that was not successfully deleted. +type DeleteFleetErrorItem struct { + _ struct{} `type:"structure"` + + // The error. + Error *DeleteFleetError `locationName:"error" type:"structure"` + + // The ID of the EC2 Fleet. + FleetId *string `locationName:"fleetId" type:"string"` } -// SetDryRun sets the DryRun field's value. -func (s *CreateTransitGatewayRouteInput) SetDryRun(v bool) *CreateTransitGatewayRouteInput { - s.DryRun = &v - return s +// String returns the string representation +func (s DeleteFleetErrorItem) String() string { + return awsutil.Prettify(s) } -// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. -func (s *CreateTransitGatewayRouteInput) SetTransitGatewayAttachmentId(v string) *CreateTransitGatewayRouteInput { - s.TransitGatewayAttachmentId = &v +// GoString returns the string representation +func (s DeleteFleetErrorItem) GoString() string { + return s.String() +} + +// SetError sets the Error field's value. +func (s *DeleteFleetErrorItem) SetError(v *DeleteFleetError) *DeleteFleetErrorItem { + s.Error = v return s } -// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value. -func (s *CreateTransitGatewayRouteInput) SetTransitGatewayRouteTableId(v string) *CreateTransitGatewayRouteInput { - s.TransitGatewayRouteTableId = &v +// SetFleetId sets the FleetId field's value. +func (s *DeleteFleetErrorItem) SetFleetId(v string) *DeleteFleetErrorItem { + s.FleetId = &v return s } -type CreateTransitGatewayRouteOutput struct { +// Describes an EC2 Fleet that was successfully deleted. +type DeleteFleetSuccessItem struct { _ struct{} `type:"structure"` - // Information about the route. - Route *TransitGatewayRoute `locationName:"route" type:"structure"` + // The current state of the EC2 Fleet. + CurrentFleetState *string `locationName:"currentFleetState" type:"string" enum:"FleetStateCode"` + + // The ID of the EC2 Fleet. + FleetId *string `locationName:"fleetId" type:"string"` + + // The previous state of the EC2 Fleet. + PreviousFleetState *string `locationName:"previousFleetState" type:"string" enum:"FleetStateCode"` } // String returns the string representation -func (s CreateTransitGatewayRouteOutput) String() string { +func (s DeleteFleetSuccessItem) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTransitGatewayRouteOutput) GoString() string { +func (s DeleteFleetSuccessItem) GoString() string { return s.String() } -// SetRoute sets the Route field's value. -func (s *CreateTransitGatewayRouteOutput) SetRoute(v *TransitGatewayRoute) *CreateTransitGatewayRouteOutput { - s.Route = v +// SetCurrentFleetState sets the CurrentFleetState field's value. +func (s *DeleteFleetSuccessItem) SetCurrentFleetState(v string) *DeleteFleetSuccessItem { + s.CurrentFleetState = &v return s } -type CreateTransitGatewayRouteTableInput struct { +// SetFleetId sets the FleetId field's value. +func (s *DeleteFleetSuccessItem) SetFleetId(v string) *DeleteFleetSuccessItem { + s.FleetId = &v + return s +} + +// SetPreviousFleetState sets the PreviousFleetState field's value. +func (s *DeleteFleetSuccessItem) SetPreviousFleetState(v string) *DeleteFleetSuccessItem { + s.PreviousFleetState = &v + return s +} + +type DeleteFleetsInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -43757,30 +51213,36 @@ type CreateTransitGatewayRouteTableInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The tags to apply to the transit gateway route table. - TagSpecifications []*TagSpecification `locationNameList:"item" type:"list"` + // The IDs of the EC2 Fleets. + // + // FleetIds is a required field + FleetIds []*string `locationName:"FleetId" type:"list" required:"true"` - // The ID of the transit gateway. + // Indicates whether to terminate instances for an EC2 Fleet if it is deleted + // successfully. // - // TransitGatewayId is a required field - TransitGatewayId *string `type:"string" required:"true"` + // TerminateInstances is a required field + TerminateInstances *bool `type:"boolean" required:"true"` } // String returns the string representation -func (s CreateTransitGatewayRouteTableInput) String() string { +func (s DeleteFleetsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTransitGatewayRouteTableInput) GoString() string { +func (s DeleteFleetsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTransitGatewayRouteTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTransitGatewayRouteTableInput"} - if s.TransitGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("TransitGatewayId")) +func (s *DeleteFleetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteFleetsInput"} + if s.FleetIds == nil { + invalidParams.Add(request.NewErrParamRequired("FleetIds")) + } + if s.TerminateInstances == nil { + invalidParams.Add(request.NewErrParamRequired("TerminateInstances")) } if invalidParams.Len() > 0 { @@ -43790,47 +51252,56 @@ func (s *CreateTransitGatewayRouteTableInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *CreateTransitGatewayRouteTableInput) SetDryRun(v bool) *CreateTransitGatewayRouteTableInput { +func (s *DeleteFleetsInput) SetDryRun(v bool) *DeleteFleetsInput { s.DryRun = &v return s } -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateTransitGatewayRouteTableInput) SetTagSpecifications(v []*TagSpecification) *CreateTransitGatewayRouteTableInput { - s.TagSpecifications = v +// SetFleetIds sets the FleetIds field's value. +func (s *DeleteFleetsInput) SetFleetIds(v []*string) *DeleteFleetsInput { + s.FleetIds = v return s } -// SetTransitGatewayId sets the TransitGatewayId field's value. -func (s *CreateTransitGatewayRouteTableInput) SetTransitGatewayId(v string) *CreateTransitGatewayRouteTableInput { - s.TransitGatewayId = &v +// SetTerminateInstances sets the TerminateInstances field's value. +func (s *DeleteFleetsInput) SetTerminateInstances(v bool) *DeleteFleetsInput { + s.TerminateInstances = &v return s } -type CreateTransitGatewayRouteTableOutput struct { +type DeleteFleetsOutput struct { _ struct{} `type:"structure"` - // Information about the transit gateway route table. - TransitGatewayRouteTable *TransitGatewayRouteTable `locationName:"transitGatewayRouteTable" type:"structure"` + // Information about the EC2 Fleets that are successfully deleted. + SuccessfulFleetDeletions []*DeleteFleetSuccessItem `locationName:"successfulFleetDeletionSet" locationNameList:"item" type:"list"` + + // Information about the EC2 Fleets that are not successfully deleted. + UnsuccessfulFleetDeletions []*DeleteFleetErrorItem `locationName:"unsuccessfulFleetDeletionSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s CreateTransitGatewayRouteTableOutput) String() string { +func (s DeleteFleetsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTransitGatewayRouteTableOutput) GoString() string { +func (s DeleteFleetsOutput) GoString() string { return s.String() } -// SetTransitGatewayRouteTable sets the TransitGatewayRouteTable field's value. -func (s *CreateTransitGatewayRouteTableOutput) SetTransitGatewayRouteTable(v *TransitGatewayRouteTable) *CreateTransitGatewayRouteTableOutput { - s.TransitGatewayRouteTable = v +// SetSuccessfulFleetDeletions sets the SuccessfulFleetDeletions field's value. +func (s *DeleteFleetsOutput) SetSuccessfulFleetDeletions(v []*DeleteFleetSuccessItem) *DeleteFleetsOutput { + s.SuccessfulFleetDeletions = v return s } -type CreateTransitGatewayVpcAttachmentInput struct { +// SetUnsuccessfulFleetDeletions sets the UnsuccessfulFleetDeletions field's value. +func (s *DeleteFleetsOutput) SetUnsuccessfulFleetDeletions(v []*DeleteFleetErrorItem) *DeleteFleetsOutput { + s.UnsuccessfulFleetDeletions = v + return s +} + +type DeleteFlowLogsInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -43839,52 +51310,29 @@ type CreateTransitGatewayVpcAttachmentInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The VPC attachment options. - Options *CreateTransitGatewayVpcAttachmentRequestOptions `type:"structure"` - - // The IDs of one or more subnets. You can specify only one subnet per Availability - // Zone. You must specify at least one subnet, but we recommend that you specify - // two subnets for better availability. The transit gateway uses one IP address - // from each specified subnet. - // - // SubnetIds is a required field - SubnetIds []*string `locationNameList:"item" type:"list" required:"true"` - - // The tags to apply to the VPC attachment. - TagSpecifications []*TagSpecification `locationNameList:"item" type:"list"` - - // The ID of the transit gateway. + // One or more flow log IDs. // - // TransitGatewayId is a required field - TransitGatewayId *string `type:"string" required:"true"` - - // The ID of the VPC. + // Constraint: Maximum of 1000 flow log IDs. // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` + // FlowLogIds is a required field + FlowLogIds []*string `locationName:"FlowLogId" locationNameList:"item" type:"list" required:"true"` } // String returns the string representation -func (s CreateTransitGatewayVpcAttachmentInput) String() string { +func (s DeleteFlowLogsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTransitGatewayVpcAttachmentInput) GoString() string { +func (s DeleteFlowLogsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTransitGatewayVpcAttachmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTransitGatewayVpcAttachmentInput"} - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) - } - if s.TransitGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("TransitGatewayId")) - } - if s.VpcId == nil { - invalidParams.Add(request.NewErrParamRequired("VpcId")) +func (s *DeleteFlowLogsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteFlowLogsInput"} + if s.FlowLogIds == nil { + invalidParams.Add(request.NewErrParamRequired("FlowLogIds")) } if invalidParams.Len() > 0 { @@ -43894,196 +51342,70 @@ func (s *CreateTransitGatewayVpcAttachmentInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *CreateTransitGatewayVpcAttachmentInput) SetDryRun(v bool) *CreateTransitGatewayVpcAttachmentInput { +func (s *DeleteFlowLogsInput) SetDryRun(v bool) *DeleteFlowLogsInput { s.DryRun = &v return s } -// SetOptions sets the Options field's value. -func (s *CreateTransitGatewayVpcAttachmentInput) SetOptions(v *CreateTransitGatewayVpcAttachmentRequestOptions) *CreateTransitGatewayVpcAttachmentInput { - s.Options = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *CreateTransitGatewayVpcAttachmentInput) SetSubnetIds(v []*string) *CreateTransitGatewayVpcAttachmentInput { - s.SubnetIds = v - return s -} - -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateTransitGatewayVpcAttachmentInput) SetTagSpecifications(v []*TagSpecification) *CreateTransitGatewayVpcAttachmentInput { - s.TagSpecifications = v - return s -} - -// SetTransitGatewayId sets the TransitGatewayId field's value. -func (s *CreateTransitGatewayVpcAttachmentInput) SetTransitGatewayId(v string) *CreateTransitGatewayVpcAttachmentInput { - s.TransitGatewayId = &v - return s -} - -// SetVpcId sets the VpcId field's value. -func (s *CreateTransitGatewayVpcAttachmentInput) SetVpcId(v string) *CreateTransitGatewayVpcAttachmentInput { - s.VpcId = &v - return s -} - -type CreateTransitGatewayVpcAttachmentOutput struct { - _ struct{} `type:"structure"` - - // Information about the VPC attachment. - TransitGatewayVpcAttachment *TransitGatewayVpcAttachment `locationName:"transitGatewayVpcAttachment" type:"structure"` -} - -// String returns the string representation -func (s CreateTransitGatewayVpcAttachmentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateTransitGatewayVpcAttachmentOutput) GoString() string { - return s.String() -} - -// SetTransitGatewayVpcAttachment sets the TransitGatewayVpcAttachment field's value. -func (s *CreateTransitGatewayVpcAttachmentOutput) SetTransitGatewayVpcAttachment(v *TransitGatewayVpcAttachment) *CreateTransitGatewayVpcAttachmentOutput { - s.TransitGatewayVpcAttachment = v +// SetFlowLogIds sets the FlowLogIds field's value. +func (s *DeleteFlowLogsInput) SetFlowLogIds(v []*string) *DeleteFlowLogsInput { + s.FlowLogIds = v return s } -// Describes the options for a VPC attachment. -type CreateTransitGatewayVpcAttachmentRequestOptions struct { +type DeleteFlowLogsOutput struct { _ struct{} `type:"structure"` - // Enable or disable DNS support. The default is enable. - DnsSupport *string `type:"string" enum:"DnsSupportValue"` - - // Enable or disable IPv6 support. The default is enable. - Ipv6Support *string `type:"string" enum:"Ipv6SupportValue"` + // 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 CreateTransitGatewayVpcAttachmentRequestOptions) String() string { +func (s DeleteFlowLogsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTransitGatewayVpcAttachmentRequestOptions) GoString() string { +func (s DeleteFlowLogsOutput) GoString() string { return s.String() } -// SetDnsSupport sets the DnsSupport field's value. -func (s *CreateTransitGatewayVpcAttachmentRequestOptions) SetDnsSupport(v string) *CreateTransitGatewayVpcAttachmentRequestOptions { - s.DnsSupport = &v - return s -} - -// SetIpv6Support sets the Ipv6Support field's value. -func (s *CreateTransitGatewayVpcAttachmentRequestOptions) SetIpv6Support(v string) *CreateTransitGatewayVpcAttachmentRequestOptions { - s.Ipv6Support = &v +// SetUnsuccessful sets the Unsuccessful field's value. +func (s *DeleteFlowLogsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *DeleteFlowLogsOutput { + s.Unsuccessful = v return s } -// Contains the parameters for CreateVolume. -type CreateVolumeInput struct { +type DeleteFpgaImageInput struct { _ struct{} `type:"structure"` - // The Availability Zone in which to create the volume. - // - // 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. The effect of setting the - // encryption state to true depends on the volume origin (new or from a snapshot), - // starting encryption state, ownership, and whether encryption by default is - // enabled. For more information, see Encryption by Default (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#encryption-by-default) - // in the Amazon Elastic Compute Cloud User Guide. - // - // Encrypted Amazon EBS volumes must be attached to instances that support Amazon - // EBS encryption. For more information, see Supported Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances). - Encrypted *bool `locationName:"encrypted" type:"boolean"` - - // The number of I/O operations per second (IOPS) to provision for the volume, - // with a maximum ratio of 50 IOPS/GiB. Range is 100 to 64,000 IOPS for volumes - // in most Regions. Maximum IOPS of 64,000 is guaranteed only on Nitro-based - // instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances). - // Other instance families guarantee performance up to 32,000 IOPS. For more - // information, see Amazon EBS Volume Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSVolumeTypes.html) - // in the Amazon Elastic Compute Cloud User Guide. - // - // This parameter is valid only for Provisioned IOPS SSD (io1) volumes. - Iops *int64 `type:"integer"` - - // The identifier of the AWS Key Management Service (AWS KMS) customer master - // key (CMK) to use for Amazon EBS encryption. If this parameter is not specified, - // your AWS managed CMK for EBS is used. If KmsKeyId is specified, the encrypted - // state must be true. - // - // You can specify the CMK using any of the following: - // - // * Key ID. For example, key/1234abcd-12ab-34cd-56ef-1234567890ab. - // - // * Key alias. For example, alias/ExampleAlias. - // - // * Key ARN. For example, arn:aws:kms:us-east-1:012345678910:key/abcd1234-a123-456a-a12b-a123b4cd56ef. - // - // * Alias ARN. For example, arn:aws:kms:us-east-1:012345678910:alias/ExampleAlias. - // - // AWS authenticates the CMK asynchronously. Therefore, if you specify an ID, - // alias, or ARN that is not valid, the action can appear to complete, but eventually - // fails. - KmsKeyId *string `type:"string"` - - // The size of the volume, in GiBs. - // - // Constraints: 1-16,384 for gp2, 4-16,384 for io1, 500-16,384 for st1, 500-16,384 - // for sc1, and 1-1,024 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. - // - // At least one of Size or SnapshotId is required. - Size *int64 `type:"integer"` - - // The snapshot from which to create the volume. - // - // At least one of Size or SnapshotId are required. - SnapshotId *string `type:"string"` - - // The tags to apply to the volume during creation. - TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + DryRun *bool `type:"boolean"` - // 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. + // The ID of the AFI. // - // Default: gp2 - VolumeType *string `type:"string" enum:"VolumeType"` + // FpgaImageId is a required field + FpgaImageId *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateVolumeInput) String() string { +func (s DeleteFpgaImageInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVolumeInput) GoString() string { +func (s DeleteFpgaImageInput) 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")) +func (s *DeleteFpgaImageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteFpgaImageInput"} + if s.FpgaImageId == nil { + invalidParams.Add(request.NewErrParamRequired("FpgaImageId")) } if invalidParams.Len() > 0 { @@ -44092,176 +51414,135 @@ func (s *CreateVolumeInput) Validate() error { 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 { +func (s *DeleteFpgaImageInput) SetDryRun(v bool) *DeleteFpgaImageInput { s.DryRun = &v return s } -// SetEncrypted sets the Encrypted field's value. -func (s *CreateVolumeInput) SetEncrypted(v bool) *CreateVolumeInput { - s.Encrypted = &v - return s -} - -// SetIops sets the Iops field's value. -func (s *CreateVolumeInput) SetIops(v int64) *CreateVolumeInput { - s.Iops = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateVolumeInput) SetKmsKeyId(v string) *CreateVolumeInput { - s.KmsKeyId = &v - return s -} - -// SetSize sets the Size field's value. -func (s *CreateVolumeInput) SetSize(v int64) *CreateVolumeInput { - s.Size = &v - return s -} - -// SetSnapshotId sets the SnapshotId field's value. -func (s *CreateVolumeInput) SetSnapshotId(v string) *CreateVolumeInput { - s.SnapshotId = &v - return s -} - -// SetTagSpecifications sets the TagSpecifications field's value. -func (s *CreateVolumeInput) SetTagSpecifications(v []*TagSpecification) *CreateVolumeInput { - s.TagSpecifications = v - return s -} - -// SetVolumeType sets the VolumeType field's value. -func (s *CreateVolumeInput) SetVolumeType(v string) *CreateVolumeInput { - s.VolumeType = &v +// SetFpgaImageId sets the FpgaImageId field's value. +func (s *DeleteFpgaImageInput) SetFpgaImageId(v string) *DeleteFpgaImageInput { + s.FpgaImageId = &v return s } -// Describes the user or group to be added or removed from the list of create -// volume permissions for a volume. -type CreateVolumePermission struct { +type DeleteFpgaImageOutput struct { _ struct{} `type:"structure"` - // The group to be added or removed. The possible value is all. - Group *string `locationName:"group" type:"string" enum:"PermissionGroup"` - - // The AWS account ID to be added or removed. - UserId *string `locationName:"userId" type:"string"` + // Is true if the request succeeds, and an error otherwise. + Return *bool `locationName:"return" type:"boolean"` } // String returns the string representation -func (s CreateVolumePermission) String() string { +func (s DeleteFpgaImageOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVolumePermission) GoString() string { +func (s DeleteFpgaImageOutput) 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 +// SetReturn sets the Return field's value. +func (s *DeleteFpgaImageOutput) SetReturn(v bool) *DeleteFpgaImageOutput { + s.Return = &v return s } -// Describes modifications to the list of create volume permissions for a volume. -type CreateVolumePermissionModifications struct { +type DeleteInternetGatewayInput struct { _ struct{} `type:"structure"` - // Adds the specified AWS account ID or group to the list. - Add []*CreateVolumePermission `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"` - // Removes the specified AWS account ID or group from the list. - Remove []*CreateVolumePermission `locationNameList:"item" type:"list"` + // 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 CreateVolumePermissionModifications) String() string { +func (s DeleteInternetGatewayInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVolumePermissionModifications) GoString() string { +func (s DeleteInternetGatewayInput) GoString() string { return s.String() } -// SetAdd sets the Add field's value. -func (s *CreateVolumePermissionModifications) SetAdd(v []*CreateVolumePermission) *CreateVolumePermissionModifications { - s.Add = v +// 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 } -// SetRemove sets the Remove field's value. -func (s *CreateVolumePermissionModifications) SetRemove(v []*CreateVolumePermission) *CreateVolumePermissionModifications { - s.Remove = v +// SetInternetGatewayId sets the InternetGatewayId field's value. +func (s *DeleteInternetGatewayInput) SetInternetGatewayId(v string) *DeleteInternetGatewayInput { + s.InternetGatewayId = &v return s } -type CreateVpcEndpointConnectionNotificationInput struct { +type DeleteInternetGatewayOutput 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 (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). - ClientToken *string `type:"string"` +// String returns the string representation +func (s DeleteInternetGatewayOutput) String() string { + return awsutil.Prettify(s) +} - // One or more endpoint events for which to receive notifications. Valid values - // are Accept, Connect, Delete, and Reject. - // - // ConnectionEvents is a required field - ConnectionEvents []*string `locationNameList:"item" type:"list" required:"true"` +// GoString returns the string representation +func (s DeleteInternetGatewayOutput) GoString() string { + return s.String() +} - // The ARN of the SNS topic for the notifications. - // - // ConnectionNotificationArn is a required field - ConnectionNotificationArn *string `type:"string" required:"true"` +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 `type:"boolean"` - - // The ID of the endpoint service. - ServiceId *string `type:"string"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the endpoint. - VpcEndpointId *string `type:"string"` + // The name of the key pair. + // + // KeyName is a required field + KeyName *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateVpcEndpointConnectionNotificationInput) String() string { +func (s DeleteKeyPairInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVpcEndpointConnectionNotificationInput) GoString() string { +func (s DeleteKeyPairInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpcEndpointConnectionNotificationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpcEndpointConnectionNotificationInput"} - if s.ConnectionEvents == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectionEvents")) - } - if s.ConnectionNotificationArn == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectionNotificationArn")) +func (s *DeleteKeyPairInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteKeyPairInput"} + if s.KeyName == nil { + invalidParams.Add(request.NewErrParamRequired("KeyName")) } if invalidParams.Len() > 0 { @@ -44270,155 +51551,65 @@ func (s *CreateVpcEndpointConnectionNotificationInput) Validate() error { return nil } -// SetClientToken sets the ClientToken field's value. -func (s *CreateVpcEndpointConnectionNotificationInput) SetClientToken(v string) *CreateVpcEndpointConnectionNotificationInput { - s.ClientToken = &v - return s -} - -// SetConnectionEvents sets the ConnectionEvents field's value. -func (s *CreateVpcEndpointConnectionNotificationInput) SetConnectionEvents(v []*string) *CreateVpcEndpointConnectionNotificationInput { - s.ConnectionEvents = v - return s -} - -// SetConnectionNotificationArn sets the ConnectionNotificationArn field's value. -func (s *CreateVpcEndpointConnectionNotificationInput) SetConnectionNotificationArn(v string) *CreateVpcEndpointConnectionNotificationInput { - s.ConnectionNotificationArn = &v - return s -} - // SetDryRun sets the DryRun field's value. -func (s *CreateVpcEndpointConnectionNotificationInput) SetDryRun(v bool) *CreateVpcEndpointConnectionNotificationInput { +func (s *DeleteKeyPairInput) SetDryRun(v bool) *DeleteKeyPairInput { s.DryRun = &v return s } -// SetServiceId sets the ServiceId field's value. -func (s *CreateVpcEndpointConnectionNotificationInput) SetServiceId(v string) *CreateVpcEndpointConnectionNotificationInput { - s.ServiceId = &v - return s -} - -// SetVpcEndpointId sets the VpcEndpointId field's value. -func (s *CreateVpcEndpointConnectionNotificationInput) SetVpcEndpointId(v string) *CreateVpcEndpointConnectionNotificationInput { - s.VpcEndpointId = &v +// SetKeyName sets the KeyName field's value. +func (s *DeleteKeyPairInput) SetKeyName(v string) *DeleteKeyPairInput { + s.KeyName = &v return s } -type CreateVpcEndpointConnectionNotificationOutput struct { +type DeleteKeyPairOutput 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 notification. - ConnectionNotification *ConnectionNotification `locationName:"connectionNotification" type:"structure"` } // String returns the string representation -func (s CreateVpcEndpointConnectionNotificationOutput) String() string { +func (s DeleteKeyPairOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVpcEndpointConnectionNotificationOutput) GoString() string { +func (s DeleteKeyPairOutput) GoString() string { return s.String() } -// SetClientToken sets the ClientToken field's value. -func (s *CreateVpcEndpointConnectionNotificationOutput) SetClientToken(v string) *CreateVpcEndpointConnectionNotificationOutput { - s.ClientToken = &v - return s -} - -// SetConnectionNotification sets the ConnectionNotification field's value. -func (s *CreateVpcEndpointConnectionNotificationOutput) SetConnectionNotification(v *ConnectionNotification) *CreateVpcEndpointConnectionNotificationOutput { - s.ConnectionNotification = v - return s -} - -// Contains the parameters for CreateVpcEndpoint. -type CreateVpcEndpointInput struct { +type DeleteLaunchTemplateInput 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 (https://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"` - - // (Interface endpoint) Indicate whether to associate a private hosted zone - // with the specified VPC. The private hosted zone contains a record set for - // the default public DNS name for the service for the Region (for example, - // kinesis.us-east-1.amazonaws.com) which resolves to the private IP addresses - // of the endpoint network interfaces in the VPC. This enables you to make requests - // to the default public DNS name for the service instead of the public DNS - // names that are automatically generated by the VPC endpoint service. - // - // To use a private hosted zone, you must set the following VPC attributes to - // true: enableDnsHostnames and enableDnsSupport. Use ModifyVpcAttribute to - // set the VPC attributes. - // - // Default: true - PrivateDnsEnabled *bool `type:"boolean"` - - // (Gateway endpoint) One or more route table IDs. - RouteTableIds []*string `locationName:"RouteTableId" locationNameList:"item" type:"list"` - - // (Interface endpoint) The ID of one or more security groups to associate with - // the endpoint network interface. - SecurityGroupIds []*string `locationName:"SecurityGroupId" locationNameList:"item" type:"list"` - - // The service name. To get a list of available services, use the DescribeVpcEndpointServices - // request, or get the name from the service provider. - // - // ServiceName is a required field - ServiceName *string `type:"string" required:"true"` - - // (Interface endpoint) The ID of one or more subnets in which to create an - // endpoint network interface. - SubnetIds []*string `locationName:"SubnetId" locationNameList:"item" type:"list"` - - // The type of endpoint. - // - // Default: Gateway - VpcEndpointType *string `type:"string" enum:"VpcEndpointType"` + // The ID of the launch template. You must specify either the launch template + // ID or launch template name in the request. + LaunchTemplateId *string `type:"string"` - // The ID of the VPC in which the endpoint will be used. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` + // The name of the launch template. You must specify either the launch template + // ID or launch template name in the request. + LaunchTemplateName *string `min:"3" type:"string"` } // String returns the string representation -func (s CreateVpcEndpointInput) String() string { +func (s DeleteLaunchTemplateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVpcEndpointInput) GoString() string { +func (s DeleteLaunchTemplateInput) 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")) +func (s *DeleteLaunchTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteLaunchTemplateInput"} + if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) } if invalidParams.Len() > 0 { @@ -44427,139 +51618,88 @@ func (s *CreateVpcEndpointInput) Validate() error { 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 { +func (s *DeleteLaunchTemplateInput) SetDryRun(v bool) *DeleteLaunchTemplateInput { s.DryRun = &v return s } -// SetPolicyDocument sets the PolicyDocument field's value. -func (s *CreateVpcEndpointInput) SetPolicyDocument(v string) *CreateVpcEndpointInput { - s.PolicyDocument = &v - return s -} - -// SetPrivateDnsEnabled sets the PrivateDnsEnabled field's value. -func (s *CreateVpcEndpointInput) SetPrivateDnsEnabled(v bool) *CreateVpcEndpointInput { - s.PrivateDnsEnabled = &v - return s -} - -// SetRouteTableIds sets the RouteTableIds field's value. -func (s *CreateVpcEndpointInput) SetRouteTableIds(v []*string) *CreateVpcEndpointInput { - s.RouteTableIds = v - return s -} - -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *CreateVpcEndpointInput) SetSecurityGroupIds(v []*string) *CreateVpcEndpointInput { - s.SecurityGroupIds = v - return s -} - -// SetServiceName sets the ServiceName field's value. -func (s *CreateVpcEndpointInput) SetServiceName(v string) *CreateVpcEndpointInput { - s.ServiceName = &v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *CreateVpcEndpointInput) SetSubnetIds(v []*string) *CreateVpcEndpointInput { - s.SubnetIds = v - return s -} - -// SetVpcEndpointType sets the VpcEndpointType field's value. -func (s *CreateVpcEndpointInput) SetVpcEndpointType(v string) *CreateVpcEndpointInput { - s.VpcEndpointType = &v +// SetLaunchTemplateId sets the LaunchTemplateId field's value. +func (s *DeleteLaunchTemplateInput) SetLaunchTemplateId(v string) *DeleteLaunchTemplateInput { + s.LaunchTemplateId = &v return s } -// SetVpcId sets the VpcId field's value. -func (s *CreateVpcEndpointInput) SetVpcId(v string) *CreateVpcEndpointInput { - s.VpcId = &v +// SetLaunchTemplateName sets the LaunchTemplateName field's value. +func (s *DeleteLaunchTemplateInput) SetLaunchTemplateName(v string) *DeleteLaunchTemplateInput { + s.LaunchTemplateName = &v return s } -// Contains the output of CreateVpcEndpoint. -type CreateVpcEndpointOutput struct { +type DeleteLaunchTemplateOutput 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"` + // Information about the launch template. + LaunchTemplate *LaunchTemplate `locationName:"launchTemplate" type:"structure"` } // String returns the string representation -func (s CreateVpcEndpointOutput) String() string { +func (s DeleteLaunchTemplateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVpcEndpointOutput) GoString() string { +func (s DeleteLaunchTemplateOutput) 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 +// SetLaunchTemplate sets the LaunchTemplate field's value. +func (s *DeleteLaunchTemplateOutput) SetLaunchTemplate(v *LaunchTemplate) *DeleteLaunchTemplateOutput { + s.LaunchTemplate = v return s } -type CreateVpcEndpointServiceConfigurationInput struct { +type DeleteLaunchTemplateVersionsInput struct { _ struct{} `type:"structure"` - // Indicate whether requests from service consumers to create an endpoint to - // your service must be accepted. To accept a request, use AcceptVpcEndpointConnections. - AcceptanceRequired *bool `type:"boolean"` - - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see How to Ensure Idempotency (https://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 Amazon Resource Names (ARNs) of one or more Network Load Balancers for - // your service. + // The ID of the launch template. You must specify either the launch template + // ID or launch template name in the request. + LaunchTemplateId *string `type:"string"` + + // The name of the launch template. You must specify either the launch template + // ID or launch template name in the request. + LaunchTemplateName *string `min:"3" type:"string"` + + // The version numbers of one or more launch template versions to delete. // - // NetworkLoadBalancerArns is a required field - NetworkLoadBalancerArns []*string `locationName:"NetworkLoadBalancerArn" locationNameList:"item" type:"list" required:"true"` + // Versions is a required field + Versions []*string `locationName:"LaunchTemplateVersion" locationNameList:"item" type:"list" required:"true"` } // String returns the string representation -func (s CreateVpcEndpointServiceConfigurationInput) String() string { +func (s DeleteLaunchTemplateVersionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVpcEndpointServiceConfigurationInput) GoString() string { +func (s DeleteLaunchTemplateVersionsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateVpcEndpointServiceConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateVpcEndpointServiceConfigurationInput"} - if s.NetworkLoadBalancerArns == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkLoadBalancerArns")) +func (s *DeleteLaunchTemplateVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteLaunchTemplateVersionsInput"} + if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) + } + if s.Versions == nil { + invalidParams.Add(request.NewErrParamRequired("Versions")) } if invalidParams.Len() > 0 { @@ -44568,306 +51708,272 @@ func (s *CreateVpcEndpointServiceConfigurationInput) Validate() error { return nil } -// SetAcceptanceRequired sets the AcceptanceRequired field's value. -func (s *CreateVpcEndpointServiceConfigurationInput) SetAcceptanceRequired(v bool) *CreateVpcEndpointServiceConfigurationInput { - s.AcceptanceRequired = &v +// SetDryRun sets the DryRun field's value. +func (s *DeleteLaunchTemplateVersionsInput) SetDryRun(v bool) *DeleteLaunchTemplateVersionsInput { + s.DryRun = &v return s } -// SetClientToken sets the ClientToken field's value. -func (s *CreateVpcEndpointServiceConfigurationInput) SetClientToken(v string) *CreateVpcEndpointServiceConfigurationInput { - s.ClientToken = &v +// SetLaunchTemplateId sets the LaunchTemplateId field's value. +func (s *DeleteLaunchTemplateVersionsInput) SetLaunchTemplateId(v string) *DeleteLaunchTemplateVersionsInput { + s.LaunchTemplateId = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *CreateVpcEndpointServiceConfigurationInput) SetDryRun(v bool) *CreateVpcEndpointServiceConfigurationInput { - s.DryRun = &v +// SetLaunchTemplateName sets the LaunchTemplateName field's value. +func (s *DeleteLaunchTemplateVersionsInput) SetLaunchTemplateName(v string) *DeleteLaunchTemplateVersionsInput { + s.LaunchTemplateName = &v return s } -// SetNetworkLoadBalancerArns sets the NetworkLoadBalancerArns field's value. -func (s *CreateVpcEndpointServiceConfigurationInput) SetNetworkLoadBalancerArns(v []*string) *CreateVpcEndpointServiceConfigurationInput { - s.NetworkLoadBalancerArns = v +// SetVersions sets the Versions field's value. +func (s *DeleteLaunchTemplateVersionsInput) SetVersions(v []*string) *DeleteLaunchTemplateVersionsInput { + s.Versions = v return s } -type CreateVpcEndpointServiceConfigurationOutput struct { +type DeleteLaunchTemplateVersionsOutput 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 launch template versions that were successfully deleted. + SuccessfullyDeletedLaunchTemplateVersions []*DeleteLaunchTemplateVersionsResponseSuccessItem `locationName:"successfullyDeletedLaunchTemplateVersionSet" locationNameList:"item" type:"list"` - // Information about the service configuration. - ServiceConfiguration *ServiceConfiguration `locationName:"serviceConfiguration" type:"structure"` + // Information about the launch template versions that could not be deleted. + UnsuccessfullyDeletedLaunchTemplateVersions []*DeleteLaunchTemplateVersionsResponseErrorItem `locationName:"unsuccessfullyDeletedLaunchTemplateVersionSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s CreateVpcEndpointServiceConfigurationOutput) String() string { +func (s DeleteLaunchTemplateVersionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVpcEndpointServiceConfigurationOutput) GoString() string { +func (s DeleteLaunchTemplateVersionsOutput) GoString() string { return s.String() } -// SetClientToken sets the ClientToken field's value. -func (s *CreateVpcEndpointServiceConfigurationOutput) SetClientToken(v string) *CreateVpcEndpointServiceConfigurationOutput { - s.ClientToken = &v +// SetSuccessfullyDeletedLaunchTemplateVersions sets the SuccessfullyDeletedLaunchTemplateVersions field's value. +func (s *DeleteLaunchTemplateVersionsOutput) SetSuccessfullyDeletedLaunchTemplateVersions(v []*DeleteLaunchTemplateVersionsResponseSuccessItem) *DeleteLaunchTemplateVersionsOutput { + s.SuccessfullyDeletedLaunchTemplateVersions = v return s } -// SetServiceConfiguration sets the ServiceConfiguration field's value. -func (s *CreateVpcEndpointServiceConfigurationOutput) SetServiceConfiguration(v *ServiceConfiguration) *CreateVpcEndpointServiceConfigurationOutput { - s.ServiceConfiguration = v +// SetUnsuccessfullyDeletedLaunchTemplateVersions sets the UnsuccessfullyDeletedLaunchTemplateVersions field's value. +func (s *DeleteLaunchTemplateVersionsOutput) SetUnsuccessfullyDeletedLaunchTemplateVersions(v []*DeleteLaunchTemplateVersionsResponseErrorItem) *DeleteLaunchTemplateVersionsOutput { + s.UnsuccessfullyDeletedLaunchTemplateVersions = v return s } -type CreateVpcInput struct { +// Describes a launch template version that could not be deleted. +type DeleteLaunchTemplateVersionsResponseErrorItem 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 ID of the launch template. + LaunchTemplateId *string `locationName:"launchTemplateId" type:"string"` - // 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"` + // The name of the launch template. + LaunchTemplateName *string `locationName:"launchTemplateName" 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"` + // Information about the error. + ResponseError *ResponseError `locationName:"responseError" type:"structure"` - // 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"` + // The version number of the launch template. + VersionNumber *int64 `locationName:"versionNumber" type:"long"` } // String returns the string representation -func (s CreateVpcInput) String() string { +func (s DeleteLaunchTemplateVersionsResponseErrorItem) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVpcInput) GoString() string { +func (s DeleteLaunchTemplateVersionsResponseErrorItem) 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 +// SetLaunchTemplateId sets the LaunchTemplateId field's value. +func (s *DeleteLaunchTemplateVersionsResponseErrorItem) SetLaunchTemplateId(v string) *DeleteLaunchTemplateVersionsResponseErrorItem { + s.LaunchTemplateId = &v return s } -// SetCidrBlock sets the CidrBlock field's value. -func (s *CreateVpcInput) SetCidrBlock(v string) *CreateVpcInput { - s.CidrBlock = &v +// SetLaunchTemplateName sets the LaunchTemplateName field's value. +func (s *DeleteLaunchTemplateVersionsResponseErrorItem) SetLaunchTemplateName(v string) *DeleteLaunchTemplateVersionsResponseErrorItem { + s.LaunchTemplateName = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *CreateVpcInput) SetDryRun(v bool) *CreateVpcInput { - s.DryRun = &v +// SetResponseError sets the ResponseError field's value. +func (s *DeleteLaunchTemplateVersionsResponseErrorItem) SetResponseError(v *ResponseError) *DeleteLaunchTemplateVersionsResponseErrorItem { + s.ResponseError = v return s } -// SetInstanceTenancy sets the InstanceTenancy field's value. -func (s *CreateVpcInput) SetInstanceTenancy(v string) *CreateVpcInput { - s.InstanceTenancy = &v +// SetVersionNumber sets the VersionNumber field's value. +func (s *DeleteLaunchTemplateVersionsResponseErrorItem) SetVersionNumber(v int64) *DeleteLaunchTemplateVersionsResponseErrorItem { + s.VersionNumber = &v return s } -type CreateVpcOutput struct { +// Describes a launch template version that was successfully deleted. +type DeleteLaunchTemplateVersionsResponseSuccessItem struct { _ struct{} `type:"structure"` - // Information about the VPC. - Vpc *Vpc `locationName:"vpc" type:"structure"` + // The ID of the launch template. + LaunchTemplateId *string `locationName:"launchTemplateId" type:"string"` + + // The name of the launch template. + LaunchTemplateName *string `locationName:"launchTemplateName" type:"string"` + + // The version number of the launch template. + VersionNumber *int64 `locationName:"versionNumber" type:"long"` } // String returns the string representation -func (s CreateVpcOutput) String() string { +func (s DeleteLaunchTemplateVersionsResponseSuccessItem) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVpcOutput) GoString() string { +func (s DeleteLaunchTemplateVersionsResponseSuccessItem) GoString() string { return s.String() } -// SetVpc sets the Vpc field's value. -func (s *CreateVpcOutput) SetVpc(v *Vpc) *CreateVpcOutput { - s.Vpc = v +// SetLaunchTemplateId sets the LaunchTemplateId field's value. +func (s *DeleteLaunchTemplateVersionsResponseSuccessItem) SetLaunchTemplateId(v string) *DeleteLaunchTemplateVersionsResponseSuccessItem { + s.LaunchTemplateId = &v + return s +} + +// SetLaunchTemplateName sets the LaunchTemplateName field's value. +func (s *DeleteLaunchTemplateVersionsResponseSuccessItem) SetLaunchTemplateName(v string) *DeleteLaunchTemplateVersionsResponseSuccessItem { + s.LaunchTemplateName = &v + return s +} + +// SetVersionNumber sets the VersionNumber field's value. +func (s *DeleteLaunchTemplateVersionsResponseSuccessItem) SetVersionNumber(v int64) *DeleteLaunchTemplateVersionsResponseSuccessItem { + s.VersionNumber = &v return s } -type CreateVpcPeeringConnectionInput struct { +type DeleteLocalGatewayRouteInput struct { _ struct{} `type:"structure"` + // The CIDR range for the route. This must match the CIDR for the route exactly. + // + // DestinationCidrBlock is a required field + DestinationCidrBlock *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 AWS account ID of the owner of the accepter VPC. - // - // Default: Your AWS account ID - PeerOwnerId *string `locationName:"peerOwnerId" type:"string"` + DryRun *bool `type:"boolean"` - // The Region code for the accepter VPC, if the accepter VPC is located in a - // Region other than the Region in which you make the request. + // The ID of the local gateway route table. // - // Default: The Region in which you make the request. - PeerRegion *string `type:"string"` - - // The ID of the VPC with which you are creating the VPC peering connection. - // You must specify this parameter in the request. - PeerVpcId *string `locationName:"peerVpcId" type:"string"` - - // The ID of the requester VPC. You must specify this parameter in the request. - VpcId *string `locationName:"vpcId" type:"string"` + // LocalGatewayRouteTableId is a required field + LocalGatewayRouteTableId *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateVpcPeeringConnectionInput) String() string { +func (s DeleteLocalGatewayRouteInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVpcPeeringConnectionInput) GoString() string { +func (s DeleteLocalGatewayRouteInput) GoString() string { return s.String() } -// SetDryRun sets the DryRun field's value. -func (s *CreateVpcPeeringConnectionInput) SetDryRun(v bool) *CreateVpcPeeringConnectionInput { - s.DryRun = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteLocalGatewayRouteInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteLocalGatewayRouteInput"} + if s.DestinationCidrBlock == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock")) + } + if s.LocalGatewayRouteTableId == nil { + invalidParams.Add(request.NewErrParamRequired("LocalGatewayRouteTableId")) + } -// SetPeerOwnerId sets the PeerOwnerId field's value. -func (s *CreateVpcPeeringConnectionInput) SetPeerOwnerId(v string) *CreateVpcPeeringConnectionInput { - s.PeerOwnerId = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetPeerRegion sets the PeerRegion field's value. -func (s *CreateVpcPeeringConnectionInput) SetPeerRegion(v string) *CreateVpcPeeringConnectionInput { - s.PeerRegion = &v +// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. +func (s *DeleteLocalGatewayRouteInput) SetDestinationCidrBlock(v string) *DeleteLocalGatewayRouteInput { + s.DestinationCidrBlock = &v return s } -// SetPeerVpcId sets the PeerVpcId field's value. -func (s *CreateVpcPeeringConnectionInput) SetPeerVpcId(v string) *CreateVpcPeeringConnectionInput { - s.PeerVpcId = &v +// SetDryRun sets the DryRun field's value. +func (s *DeleteLocalGatewayRouteInput) SetDryRun(v bool) *DeleteLocalGatewayRouteInput { + s.DryRun = &v return s } -// SetVpcId sets the VpcId field's value. -func (s *CreateVpcPeeringConnectionInput) SetVpcId(v string) *CreateVpcPeeringConnectionInput { - s.VpcId = &v +// SetLocalGatewayRouteTableId sets the LocalGatewayRouteTableId field's value. +func (s *DeleteLocalGatewayRouteInput) SetLocalGatewayRouteTableId(v string) *DeleteLocalGatewayRouteInput { + s.LocalGatewayRouteTableId = &v return s } -type CreateVpcPeeringConnectionOutput struct { +type DeleteLocalGatewayRouteOutput struct { _ struct{} `type:"structure"` - // Information about the VPC peering connection. - VpcPeeringConnection *VpcPeeringConnection `locationName:"vpcPeeringConnection" type:"structure"` + // Information about the route. + Route *LocalGatewayRoute `locationName:"route" type:"structure"` } // String returns the string representation -func (s CreateVpcPeeringConnectionOutput) String() string { +func (s DeleteLocalGatewayRouteOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVpcPeeringConnectionOutput) GoString() string { +func (s DeleteLocalGatewayRouteOutput) GoString() string { return s.String() } -// SetVpcPeeringConnection sets the VpcPeeringConnection field's value. -func (s *CreateVpcPeeringConnectionOutput) SetVpcPeeringConnection(v *VpcPeeringConnection) *CreateVpcPeeringConnectionOutput { - s.VpcPeeringConnection = v +// SetRoute sets the Route field's value. +func (s *DeleteLocalGatewayRouteOutput) SetRoute(v *LocalGatewayRoute) *DeleteLocalGatewayRouteOutput { + s.Route = v return s } -// Contains the parameters for CreateVpnConnection. -type CreateVpnConnectionInput struct { +type DeleteLocalGatewayRouteTableVpcAssociationInput 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"` - - // The options for the VPN connection. - Options *VpnConnectionOptionsSpecification `locationName:"options" type:"structure"` - - // The ID of the transit gateway. If you specify a transit gateway, you cannot - // specify a virtual private gateway. - TransitGatewayId *string `type:"string"` + DryRun *bool `type:"boolean"` - // The type of VPN connection (ipsec.1). + // The ID of the association. // - // Type is a required field - Type *string `type:"string" required:"true"` - - // The ID of the virtual private gateway. If you specify a virtual private gateway, - // you cannot specify a transit gateway. - VpnGatewayId *string `type:"string"` + // LocalGatewayRouteTableVpcAssociationId is a required field + LocalGatewayRouteTableVpcAssociationId *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateVpnConnectionInput) String() string { +func (s DeleteLocalGatewayRouteTableVpcAssociationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVpnConnectionInput) GoString() string { +func (s DeleteLocalGatewayRouteTableVpcAssociationInput) 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")) +func (s *DeleteLocalGatewayRouteTableVpcAssociationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteLocalGatewayRouteTableVpcAssociationInput"} + if s.LocalGatewayRouteTableVpcAssociationId == nil { + invalidParams.Add(request.NewErrParamRequired("LocalGatewayRouteTableVpcAssociationId")) } if invalidParams.Len() > 0 { @@ -44876,99 +51982,65 @@ func (s *CreateVpnConnectionInput) Validate() error { 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 { +func (s *DeleteLocalGatewayRouteTableVpcAssociationInput) SetDryRun(v bool) *DeleteLocalGatewayRouteTableVpcAssociationInput { s.DryRun = &v return s } -// SetOptions sets the Options field's value. -func (s *CreateVpnConnectionInput) SetOptions(v *VpnConnectionOptionsSpecification) *CreateVpnConnectionInput { - s.Options = v - return s -} - -// SetTransitGatewayId sets the TransitGatewayId field's value. -func (s *CreateVpnConnectionInput) SetTransitGatewayId(v string) *CreateVpnConnectionInput { - s.TransitGatewayId = &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 +// SetLocalGatewayRouteTableVpcAssociationId sets the LocalGatewayRouteTableVpcAssociationId field's value. +func (s *DeleteLocalGatewayRouteTableVpcAssociationInput) SetLocalGatewayRouteTableVpcAssociationId(v string) *DeleteLocalGatewayRouteTableVpcAssociationInput { + s.LocalGatewayRouteTableVpcAssociationId = &v return s } -// Contains the output of CreateVpnConnection. -type CreateVpnConnectionOutput struct { +type DeleteLocalGatewayRouteTableVpcAssociationOutput struct { _ struct{} `type:"structure"` - // Information about the VPN connection. - VpnConnection *VpnConnection `locationName:"vpnConnection" type:"structure"` + // Information about the association. + LocalGatewayRouteTableVpcAssociation *LocalGatewayRouteTableVpcAssociation `locationName:"localGatewayRouteTableVpcAssociation" type:"structure"` } // String returns the string representation -func (s CreateVpnConnectionOutput) String() string { +func (s DeleteLocalGatewayRouteTableVpcAssociationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVpnConnectionOutput) GoString() string { +func (s DeleteLocalGatewayRouteTableVpcAssociationOutput) GoString() string { return s.String() } -// SetVpnConnection sets the VpnConnection field's value. -func (s *CreateVpnConnectionOutput) SetVpnConnection(v *VpnConnection) *CreateVpnConnectionOutput { - s.VpnConnection = v +// SetLocalGatewayRouteTableVpcAssociation sets the LocalGatewayRouteTableVpcAssociation field's value. +func (s *DeleteLocalGatewayRouteTableVpcAssociationOutput) SetLocalGatewayRouteTableVpcAssociation(v *LocalGatewayRouteTableVpcAssociation) *DeleteLocalGatewayRouteTableVpcAssociationOutput { + s.LocalGatewayRouteTableVpcAssociation = v return s } -// Contains the parameters for CreateVpnConnectionRoute. -type CreateVpnConnectionRouteInput struct { +type DeleteNatGatewayInput 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. + // The ID of the NAT gateway. // - // VpnConnectionId is a required field - VpnConnectionId *string `type:"string" required:"true"` + // NatGatewayId is a required field + NatGatewayId *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateVpnConnectionRouteInput) String() string { +func (s DeleteNatGatewayInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVpnConnectionRouteInput) GoString() string { +func (s DeleteNatGatewayInput) 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")) +func (s *DeleteNatGatewayInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteNatGatewayInput"} + if s.NatGatewayId == nil { + invalidParams.Add(request.NewErrParamRequired("NatGatewayId")) } if invalidParams.Len() > 0 { @@ -44977,45 +52049,37 @@ func (s *CreateVpnConnectionRouteInput) Validate() error { 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 +// SetNatGatewayId sets the NatGatewayId field's value. +func (s *DeleteNatGatewayInput) SetNatGatewayId(v string) *DeleteNatGatewayInput { + s.NatGatewayId = &v return s } -type CreateVpnConnectionRouteOutput struct { +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 CreateVpnConnectionRouteOutput) String() string { +func (s DeleteNatGatewayOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVpnConnectionRouteOutput) GoString() string { +func (s DeleteNatGatewayOutput) GoString() string { return s.String() } -// Contains the parameters for CreateVpnGateway. -type CreateVpnGatewayInput struct { - _ struct{} `type:"structure"` - - // A private Autonomous System Number (ASN) for the Amazon side of a BGP session. - // If you're using a 16-bit ASN, it must be in the 64512 to 65534 range. If - // you're using a 32-bit ASN, it must be in the 4200000000 to 4294967294 range. - // - // Default: 64512 - AmazonSideAsn *int64 `type:"long"` +// SetNatGatewayId sets the NatGatewayId field's value. +func (s *DeleteNatGatewayOutput) SetNatGatewayId(v string) *DeleteNatGatewayOutput { + s.NatGatewayId = &v + return s +} - // The Availability Zone for the virtual private gateway. - AvailabilityZone *string `type:"string"` +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 @@ -45023,27 +52087,43 @@ type CreateVpnGatewayInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The type of VPN connection this virtual private gateway supports. + // Indicates whether the rule is an egress rule. // - // Type is a required field - Type *string `type:"string" required:"true" enum:"GatewayType"` + // 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 CreateVpnGatewayInput) String() string { +func (s DeleteNetworkAclEntryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateVpnGatewayInput) GoString() string { +func (s DeleteNetworkAclEntryInput) 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")) +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 { @@ -45052,105 +52132,74 @@ func (s *CreateVpnGatewayInput) Validate() error { return nil } -// SetAmazonSideAsn sets the AmazonSideAsn field's value. -func (s *CreateVpnGatewayInput) SetAmazonSideAsn(v int64) *CreateVpnGatewayInput { - s.AmazonSideAsn = &v - return s -} - -// 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 { +func (s *DeleteNetworkAclEntryInput) SetDryRun(v bool) *DeleteNetworkAclEntryInput { s.DryRun = &v return s } -// SetType sets the Type field's value. -func (s *CreateVpnGatewayInput) SetType(v string) *CreateVpnGatewayInput { - s.Type = &v +// SetEgress sets the Egress field's value. +func (s *DeleteNetworkAclEntryInput) SetEgress(v bool) *DeleteNetworkAclEntryInput { + s.Egress = &v return s } -// Contains the output of CreateVpnGateway. -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() +// SetNetworkAclId sets the NetworkAclId field's value. +func (s *DeleteNetworkAclEntryInput) SetNetworkAclId(v string) *DeleteNetworkAclEntryInput { + s.NetworkAclId = &v + return s } -// SetVpnGateway sets the VpnGateway field's value. -func (s *CreateVpnGatewayOutput) SetVpnGateway(v *VpnGateway) *CreateVpnGatewayOutput { - s.VpnGateway = v +// SetRuleNumber sets the RuleNumber field's value. +func (s *DeleteNetworkAclEntryInput) SetRuleNumber(v int64) *DeleteNetworkAclEntryInput { + s.RuleNumber = &v return s } -// Describes the credit option for CPU usage of a T2 or T3 instance. -type CreditSpecification struct { +type DeleteNetworkAclEntryOutput struct { _ struct{} `type:"structure"` - - // The credit option for CPU usage of a T2 or T3 instance. Valid values are - // standard and unlimited. - CpuCredits *string `locationName:"cpuCredits" type:"string"` } // String returns the string representation -func (s CreditSpecification) String() string { +func (s DeleteNetworkAclEntryOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreditSpecification) GoString() string { +func (s DeleteNetworkAclEntryOutput) GoString() string { return s.String() } -// SetCpuCredits sets the CpuCredits field's value. -func (s *CreditSpecification) SetCpuCredits(v string) *CreditSpecification { - s.CpuCredits = &v - return s -} - -// The credit option for CPU usage of a T2 or T3 instance. -type CreditSpecificationRequest struct { +type DeleteNetworkAclInput struct { _ struct{} `type:"structure"` - // The credit option for CPU usage of a T2 or T3 instance. Valid values are - // standard and unlimited. + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides 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. // - // CpuCredits is a required field - CpuCredits *string `type:"string" required:"true"` + // NetworkAclId is a required field + NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` } // String returns the string representation -func (s CreditSpecificationRequest) String() string { +func (s DeleteNetworkAclInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreditSpecificationRequest) GoString() string { +func (s DeleteNetworkAclInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreditSpecificationRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreditSpecificationRequest"} - if s.CpuCredits == nil { - invalidParams.Add(request.NewErrParamRequired("CpuCredits")) +func (s *DeleteNetworkAclInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteNetworkAclInput"} + if s.NetworkAclId == nil { + invalidParams.Add(request.NewErrParamRequired("NetworkAclId")) } if invalidParams.Len() > 0 { @@ -45159,122 +52208,132 @@ func (s *CreditSpecificationRequest) Validate() error { return nil } -// SetCpuCredits sets the CpuCredits field's value. -func (s *CreditSpecificationRequest) SetCpuCredits(v string) *CreditSpecificationRequest { - s.CpuCredits = &v +// SetDryRun sets the DryRun field's value. +func (s *DeleteNetworkAclInput) SetDryRun(v bool) *DeleteNetworkAclInput { + s.DryRun = &v return s } -// Describes a customer gateway. -type CustomerGateway struct { - _ struct{} `type:"structure"` - - // The customer gateway's Border Gateway Protocol (BGP) Autonomous System Number - // (ASN). - BgpAsn *string `locationName:"bgpAsn" type:"string"` +// SetNetworkAclId sets the NetworkAclId field's value. +func (s *DeleteNetworkAclInput) SetNetworkAclId(v string) *DeleteNetworkAclInput { + s.NetworkAclId = &v + return s +} - // The Amazon Resource Name (ARN) for the customer gateway certificate. - CertificateArn *string `locationName:"certificateArn" type:"string"` +type DeleteNetworkAclOutput struct { + _ struct{} `type:"structure"` +} - // The ID of the customer gateway. - CustomerGatewayId *string `locationName:"customerGatewayId" type:"string"` +// String returns the string representation +func (s DeleteNetworkAclOutput) String() string { + return awsutil.Prettify(s) +} - // The Internet-routable IP address of the customer gateway's outside interface. - IpAddress *string `locationName:"ipAddress" type:"string"` +// GoString returns the string representation +func (s DeleteNetworkAclOutput) GoString() string { + return s.String() +} - // The current state of the customer gateway (pending | available | deleting - // | deleted). - State *string `locationName:"state" type:"string"` +// Contains the parameters for DeleteNetworkInterface. +type DeleteNetworkInterfaceInput struct { + _ struct{} `type:"structure"` - // Any tags assigned to the customer gateway. - Tags []*Tag `locationName:"tagSet" 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"` - // The type of VPN connection the customer gateway supports (ipsec.1). - Type *string `locationName:"type" type:"string"` + // 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 CustomerGateway) String() string { +func (s DeleteNetworkInterfaceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CustomerGateway) GoString() string { +func (s DeleteNetworkInterfaceInput) GoString() string { return s.String() } -// SetBgpAsn sets the BgpAsn field's value. -func (s *CustomerGateway) SetBgpAsn(v string) *CustomerGateway { - s.BgpAsn = &v - return s -} +// 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")) + } -// SetCertificateArn sets the CertificateArn field's value. -func (s *CustomerGateway) SetCertificateArn(v string) *CustomerGateway { - s.CertificateArn = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetCustomerGatewayId sets the CustomerGatewayId field's value. -func (s *CustomerGateway) SetCustomerGatewayId(v string) *CustomerGateway { - s.CustomerGatewayId = &v +// SetDryRun sets the DryRun field's value. +func (s *DeleteNetworkInterfaceInput) SetDryRun(v bool) *DeleteNetworkInterfaceInput { + s.DryRun = &v return s } -// SetIpAddress sets the IpAddress field's value. -func (s *CustomerGateway) SetIpAddress(v string) *CustomerGateway { - s.IpAddress = &v +// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. +func (s *DeleteNetworkInterfaceInput) SetNetworkInterfaceId(v string) *DeleteNetworkInterfaceInput { + s.NetworkInterfaceId = &v return s } -// SetState sets the State field's value. -func (s *CustomerGateway) SetState(v string) *CustomerGateway { - s.State = &v - return s +type DeleteNetworkInterfaceOutput struct { + _ struct{} `type:"structure"` } -// SetTags sets the Tags field's value. -func (s *CustomerGateway) SetTags(v []*Tag) *CustomerGateway { - s.Tags = v - return s +// String returns the string representation +func (s DeleteNetworkInterfaceOutput) String() string { + return awsutil.Prettify(s) } -// SetType sets the Type field's value. -func (s *CustomerGateway) SetType(v string) *CustomerGateway { - s.Type = &v - return s +// GoString returns the string representation +func (s DeleteNetworkInterfaceOutput) GoString() string { + return s.String() } -type DeleteClientVpnEndpointInput struct { +// Contains the parameters for DeleteNetworkInterfacePermission. +type DeleteNetworkInterfacePermissionInput struct { _ struct{} `type:"structure"` - // The ID of the Client VPN to be deleted. - // - // ClientVpnEndpointId is a required field - ClientVpnEndpointId *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 `type:"boolean"` + + // Specify true to remove the permission even if the network interface is attached + // to an instance. + Force *bool `type:"boolean"` + + // The ID of the network interface permission. + // + // NetworkInterfacePermissionId is a required field + NetworkInterfacePermissionId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteClientVpnEndpointInput) String() string { +func (s DeleteNetworkInterfacePermissionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteClientVpnEndpointInput) GoString() string { +func (s DeleteNetworkInterfacePermissionInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteClientVpnEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteClientVpnEndpointInput"} - if s.ClientVpnEndpointId == nil { - invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) +func (s *DeleteNetworkInterfacePermissionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteNetworkInterfacePermissionInput"} + if s.NetworkInterfacePermissionId == nil { + invalidParams.Add(request.NewErrParamRequired("NetworkInterfacePermissionId")) } if invalidParams.Len() > 0 { @@ -45283,82 +52342,78 @@ func (s *DeleteClientVpnEndpointInput) Validate() error { return nil } -// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. -func (s *DeleteClientVpnEndpointInput) SetClientVpnEndpointId(v string) *DeleteClientVpnEndpointInput { - s.ClientVpnEndpointId = &v +// SetDryRun sets the DryRun field's value. +func (s *DeleteNetworkInterfacePermissionInput) SetDryRun(v bool) *DeleteNetworkInterfacePermissionInput { + s.DryRun = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *DeleteClientVpnEndpointInput) SetDryRun(v bool) *DeleteClientVpnEndpointInput { - s.DryRun = &v +// SetForce sets the Force field's value. +func (s *DeleteNetworkInterfacePermissionInput) SetForce(v bool) *DeleteNetworkInterfacePermissionInput { + s.Force = &v return s } -type DeleteClientVpnEndpointOutput struct { +// SetNetworkInterfacePermissionId sets the NetworkInterfacePermissionId field's value. +func (s *DeleteNetworkInterfacePermissionInput) SetNetworkInterfacePermissionId(v string) *DeleteNetworkInterfacePermissionInput { + s.NetworkInterfacePermissionId = &v + return s +} + +// Contains the output for DeleteNetworkInterfacePermission. +type DeleteNetworkInterfacePermissionOutput struct { _ struct{} `type:"structure"` - // The current state of the Client VPN endpoint. - Status *ClientVpnEndpointStatus `locationName:"status" type:"structure"` + // Returns true if the request succeeds, otherwise returns an error. + Return *bool `locationName:"return" type:"boolean"` } // String returns the string representation -func (s DeleteClientVpnEndpointOutput) String() string { +func (s DeleteNetworkInterfacePermissionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteClientVpnEndpointOutput) GoString() string { +func (s DeleteNetworkInterfacePermissionOutput) GoString() string { return s.String() } -// SetStatus sets the Status field's value. -func (s *DeleteClientVpnEndpointOutput) SetStatus(v *ClientVpnEndpointStatus) *DeleteClientVpnEndpointOutput { - s.Status = v +// SetReturn sets the Return field's value. +func (s *DeleteNetworkInterfacePermissionOutput) SetReturn(v bool) *DeleteNetworkInterfacePermissionOutput { + s.Return = &v return s } -type DeleteClientVpnRouteInput struct { +type DeletePlacementGroupInput struct { _ struct{} `type:"structure"` - // The ID of the Client VPN endpoint from which the route is to be deleted. - // - // ClientVpnEndpointId is a required field - ClientVpnEndpointId *string `type:"string" required:"true"` - - // The IPv4 address range, in CIDR notation, of the route to be deleted. - // - // DestinationCidrBlock is a required field - DestinationCidrBlock *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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the target subnet used by the route. - TargetVpcSubnetId *string `type:"string"` + // 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 DeleteClientVpnRouteInput) String() string { +func (s DeletePlacementGroupInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteClientVpnRouteInput) GoString() string { +func (s DeletePlacementGroupInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteClientVpnRouteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteClientVpnRouteInput"} - if s.ClientVpnEndpointId == nil { - invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) - } - if s.DestinationCidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock")) +func (s *DeletePlacementGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeletePlacementGroupInput"} + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) } if invalidParams.Len() > 0 { @@ -45367,84 +52422,99 @@ func (s *DeleteClientVpnRouteInput) Validate() error { return nil } -// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. -func (s *DeleteClientVpnRouteInput) SetClientVpnEndpointId(v string) *DeleteClientVpnRouteInput { - s.ClientVpnEndpointId = &v +// SetDryRun sets the DryRun field's value. +func (s *DeletePlacementGroupInput) SetDryRun(v bool) *DeletePlacementGroupInput { + s.DryRun = &v return s } -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *DeleteClientVpnRouteInput) SetDestinationCidrBlock(v string) *DeleteClientVpnRouteInput { - s.DestinationCidrBlock = &v +// SetGroupName sets the GroupName field's value. +func (s *DeletePlacementGroupInput) SetGroupName(v string) *DeletePlacementGroupInput { + s.GroupName = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *DeleteClientVpnRouteInput) SetDryRun(v bool) *DeleteClientVpnRouteInput { - s.DryRun = &v - return s +type DeletePlacementGroupOutput struct { + _ struct{} `type:"structure"` } -// SetTargetVpcSubnetId sets the TargetVpcSubnetId field's value. -func (s *DeleteClientVpnRouteInput) SetTargetVpcSubnetId(v string) *DeleteClientVpnRouteInput { - s.TargetVpcSubnetId = &v - return s +// String returns the string representation +func (s DeletePlacementGroupOutput) String() string { + return awsutil.Prettify(s) } -type DeleteClientVpnRouteOutput struct { +// GoString returns the string representation +func (s DeletePlacementGroupOutput) GoString() string { + return s.String() +} + +// Describes the error for a Reserved Instance whose queued purchase could not +// be deleted. +type DeleteQueuedReservedInstancesError struct { _ struct{} `type:"structure"` - // The current state of the route. - Status *ClientVpnRouteStatus `locationName:"status" type:"structure"` + // The error code. + Code *string `locationName:"code" type:"string" enum:"DeleteQueuedReservedInstancesErrorCode"` + + // The error message. + Message *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DeleteClientVpnRouteOutput) String() string { +func (s DeleteQueuedReservedInstancesError) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteClientVpnRouteOutput) GoString() string { +func (s DeleteQueuedReservedInstancesError) GoString() string { return s.String() } -// SetStatus sets the Status field's value. -func (s *DeleteClientVpnRouteOutput) SetStatus(v *ClientVpnRouteStatus) *DeleteClientVpnRouteOutput { - s.Status = v +// SetCode sets the Code field's value. +func (s *DeleteQueuedReservedInstancesError) SetCode(v string) *DeleteQueuedReservedInstancesError { + s.Code = &v return s } -// Contains the parameters for DeleteCustomerGateway. -type DeleteCustomerGatewayInput struct { - _ struct{} `type:"structure"` +// SetMessage sets the Message field's value. +func (s *DeleteQueuedReservedInstancesError) SetMessage(v string) *DeleteQueuedReservedInstancesError { + s.Message = &v + return s +} - // The ID of the customer gateway. - // - // CustomerGatewayId is a required field - CustomerGatewayId *string `type:"string" required:"true"` +type DeleteQueuedReservedInstancesInput 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"` + DryRun *bool `type:"boolean"` + + // The IDs of the Reserved Instances. + // + // ReservedInstancesIds is a required field + ReservedInstancesIds []*string `locationName:"ReservedInstancesId" locationNameList:"item" min:"1" type:"list" required:"true"` } // String returns the string representation -func (s DeleteCustomerGatewayInput) String() string { +func (s DeleteQueuedReservedInstancesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteCustomerGatewayInput) GoString() string { +func (s DeleteQueuedReservedInstancesInput) 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")) +func (s *DeleteQueuedReservedInstancesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteQueuedReservedInstancesInput"} + if s.ReservedInstancesIds == nil { + invalidParams.Add(request.NewErrParamRequired("ReservedInstancesIds")) + } + if s.ReservedInstancesIds != nil && len(s.ReservedInstancesIds) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ReservedInstancesIds", 1)) } if invalidParams.Len() > 0 { @@ -45453,62 +52523,88 @@ func (s *DeleteCustomerGatewayInput) Validate() error { return nil } -// SetCustomerGatewayId sets the CustomerGatewayId field's value. -func (s *DeleteCustomerGatewayInput) SetCustomerGatewayId(v string) *DeleteCustomerGatewayInput { - s.CustomerGatewayId = &v +// SetDryRun sets the DryRun field's value. +func (s *DeleteQueuedReservedInstancesInput) SetDryRun(v bool) *DeleteQueuedReservedInstancesInput { + s.DryRun = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *DeleteCustomerGatewayInput) SetDryRun(v bool) *DeleteCustomerGatewayInput { - s.DryRun = &v +// SetReservedInstancesIds sets the ReservedInstancesIds field's value. +func (s *DeleteQueuedReservedInstancesInput) SetReservedInstancesIds(v []*string) *DeleteQueuedReservedInstancesInput { + s.ReservedInstancesIds = v return s } -type DeleteCustomerGatewayOutput struct { +type DeleteQueuedReservedInstancesOutput struct { _ struct{} `type:"structure"` + + // Information about the queued purchases that could not be deleted. + FailedQueuedPurchaseDeletions []*FailedQueuedPurchaseDeletion `locationName:"failedQueuedPurchaseDeletionSet" locationNameList:"item" type:"list"` + + // Information about the queued purchases that were successfully deleted. + SuccessfulQueuedPurchaseDeletions []*SuccessfulQueuedPurchaseDeletion `locationName:"successfulQueuedPurchaseDeletionSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DeleteCustomerGatewayOutput) String() string { +func (s DeleteQueuedReservedInstancesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteCustomerGatewayOutput) GoString() string { +func (s DeleteQueuedReservedInstancesOutput) GoString() string { return s.String() } -type DeleteDhcpOptionsInput struct { +// SetFailedQueuedPurchaseDeletions sets the FailedQueuedPurchaseDeletions field's value. +func (s *DeleteQueuedReservedInstancesOutput) SetFailedQueuedPurchaseDeletions(v []*FailedQueuedPurchaseDeletion) *DeleteQueuedReservedInstancesOutput { + s.FailedQueuedPurchaseDeletions = v + return s +} + +// SetSuccessfulQueuedPurchaseDeletions sets the SuccessfulQueuedPurchaseDeletions field's value. +func (s *DeleteQueuedReservedInstancesOutput) SetSuccessfulQueuedPurchaseDeletions(v []*SuccessfulQueuedPurchaseDeletion) *DeleteQueuedReservedInstancesOutput { + s.SuccessfulQueuedPurchaseDeletions = v + return s +} + +type DeleteRouteInput struct { _ struct{} `type:"structure"` - // The ID of the DHCP options set. - // - // DhcpOptionsId is a required field - DhcpOptionsId *string `type:"string" required:"true"` + // 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 DeleteDhcpOptionsInput) String() string { +func (s DeleteRouteInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteDhcpOptionsInput) GoString() string { +func (s DeleteRouteInput) 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")) +func (s *DeleteRouteInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteRouteInput"} + if s.RouteTableId == nil { + invalidParams.Add(request.NewErrParamRequired("RouteTableId")) } if invalidParams.Len() > 0 { @@ -45517,62 +52613,74 @@ func (s *DeleteDhcpOptionsInput) Validate() error { return nil } -// SetDhcpOptionsId sets the DhcpOptionsId field's value. -func (s *DeleteDhcpOptionsInput) SetDhcpOptionsId(v string) *DeleteDhcpOptionsInput { - s.DhcpOptionsId = &v +// 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 *DeleteDhcpOptionsInput) SetDryRun(v bool) *DeleteDhcpOptionsInput { +func (s *DeleteRouteInput) SetDryRun(v bool) *DeleteRouteInput { s.DryRun = &v return s } -type DeleteDhcpOptionsOutput struct { +// SetRouteTableId sets the RouteTableId field's value. +func (s *DeleteRouteInput) SetRouteTableId(v string) *DeleteRouteInput { + s.RouteTableId = &v + return s +} + +type DeleteRouteOutput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s DeleteDhcpOptionsOutput) String() string { +func (s DeleteRouteOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteDhcpOptionsOutput) GoString() string { +func (s DeleteRouteOutput) GoString() string { return s.String() } -type DeleteEgressOnlyInternetGatewayInput struct { +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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the egress-only internet gateway. + // The ID of the route table. // - // EgressOnlyInternetGatewayId is a required field - EgressOnlyInternetGatewayId *string `type:"string" required:"true"` + // RouteTableId is a required field + RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` } // String returns the string representation -func (s DeleteEgressOnlyInternetGatewayInput) String() string { +func (s DeleteRouteTableInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteEgressOnlyInternetGatewayInput) GoString() string { +func (s DeleteRouteTableInput) 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")) +func (s *DeleteRouteTableInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteRouteTableInput"} + if s.RouteTableId == nil { + invalidParams.Add(request.NewErrParamRequired("RouteTableId")) } if invalidParams.Len() > 0 { @@ -45582,187 +52690,120 @@ func (s *DeleteEgressOnlyInternetGatewayInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteEgressOnlyInternetGatewayInput) SetDryRun(v bool) *DeleteEgressOnlyInternetGatewayInput { +func (s *DeleteRouteTableInput) SetDryRun(v bool) *DeleteRouteTableInput { s.DryRun = &v return s } -// SetEgressOnlyInternetGatewayId sets the EgressOnlyInternetGatewayId field's value. -func (s *DeleteEgressOnlyInternetGatewayInput) SetEgressOnlyInternetGatewayId(v string) *DeleteEgressOnlyInternetGatewayInput { - s.EgressOnlyInternetGatewayId = &v +// SetRouteTableId sets the RouteTableId field's value. +func (s *DeleteRouteTableInput) SetRouteTableId(v string) *DeleteRouteTableInput { + s.RouteTableId = &v return s } -type DeleteEgressOnlyInternetGatewayOutput struct { +type DeleteRouteTableOutput 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 { +func (s DeleteRouteTableOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteEgressOnlyInternetGatewayOutput) GoString() string { +func (s DeleteRouteTableOutput) GoString() string { return s.String() } -// SetReturnCode sets the ReturnCode field's value. -func (s *DeleteEgressOnlyInternetGatewayOutput) SetReturnCode(v bool) *DeleteEgressOnlyInternetGatewayOutput { - s.ReturnCode = &v - return s -} - -// Describes an EC2 Fleet error. -type DeleteFleetError struct { +type DeleteSecurityGroupInput struct { _ struct{} `type:"structure"` - // The error code. - Code *string `locationName:"code" type:"string" enum:"DeleteFleetErrorCode"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides 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 description for the error code. - Message *string `locationName:"message" type:"string"` + // 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 DeleteFleetError) String() string { +func (s DeleteSecurityGroupInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteFleetError) GoString() string { +func (s DeleteSecurityGroupInput) GoString() string { return s.String() } -// SetCode sets the Code field's value. -func (s *DeleteFleetError) SetCode(v string) *DeleteFleetError { - s.Code = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *DeleteFleetError) SetMessage(v string) *DeleteFleetError { - s.Message = &v +// SetDryRun sets the DryRun field's value. +func (s *DeleteSecurityGroupInput) SetDryRun(v bool) *DeleteSecurityGroupInput { + s.DryRun = &v return s } -// Describes an EC2 Fleet that was not successfully deleted. -type DeleteFleetErrorItem struct { - _ struct{} `type:"structure"` - - // The error. - Error *DeleteFleetError `locationName:"error" type:"structure"` - - // The ID of the EC2 Fleet. - FleetId *string `locationName:"fleetId" type:"string"` -} - -// String returns the string representation -func (s DeleteFleetErrorItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteFleetErrorItem) GoString() string { - return s.String() -} - -// SetError sets the Error field's value. -func (s *DeleteFleetErrorItem) SetError(v *DeleteFleetError) *DeleteFleetErrorItem { - s.Error = v +// SetGroupId sets the GroupId field's value. +func (s *DeleteSecurityGroupInput) SetGroupId(v string) *DeleteSecurityGroupInput { + s.GroupId = &v return s } -// SetFleetId sets the FleetId field's value. -func (s *DeleteFleetErrorItem) SetFleetId(v string) *DeleteFleetErrorItem { - s.FleetId = &v +// SetGroupName sets the GroupName field's value. +func (s *DeleteSecurityGroupInput) SetGroupName(v string) *DeleteSecurityGroupInput { + s.GroupName = &v return s } -// Describes an EC2 Fleet that was successfully deleted. -type DeleteFleetSuccessItem struct { +type DeleteSecurityGroupOutput struct { _ struct{} `type:"structure"` - - // The current state of the EC2 Fleet. - CurrentFleetState *string `locationName:"currentFleetState" type:"string" enum:"FleetStateCode"` - - // The ID of the EC2 Fleet. - FleetId *string `locationName:"fleetId" type:"string"` - - // The previous state of the EC2 Fleet. - PreviousFleetState *string `locationName:"previousFleetState" type:"string" enum:"FleetStateCode"` } // String returns the string representation -func (s DeleteFleetSuccessItem) String() string { +func (s DeleteSecurityGroupOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteFleetSuccessItem) GoString() string { +func (s DeleteSecurityGroupOutput) GoString() string { return s.String() } -// SetCurrentFleetState sets the CurrentFleetState field's value. -func (s *DeleteFleetSuccessItem) SetCurrentFleetState(v string) *DeleteFleetSuccessItem { - s.CurrentFleetState = &v - return s -} - -// SetFleetId sets the FleetId field's value. -func (s *DeleteFleetSuccessItem) SetFleetId(v string) *DeleteFleetSuccessItem { - s.FleetId = &v - return s -} - -// SetPreviousFleetState sets the PreviousFleetState field's value. -func (s *DeleteFleetSuccessItem) SetPreviousFleetState(v string) *DeleteFleetSuccessItem { - s.PreviousFleetState = &v - return s -} - -type DeleteFleetsInput struct { +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 `type:"boolean"` - - // The IDs of the EC2 Fleets. - // - // FleetIds is a required field - FleetIds []*string `locationName:"FleetId" type:"list" required:"true"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // Indicates whether to terminate instances for an EC2 Fleet if it is deleted - // successfully. + // The ID of the EBS snapshot. // - // TerminateInstances is a required field - TerminateInstances *bool `type:"boolean" required:"true"` + // SnapshotId is a required field + SnapshotId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteFleetsInput) String() string { +func (s DeleteSnapshotInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteFleetsInput) GoString() string { +func (s DeleteSnapshotInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteFleetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteFleetsInput"} - if s.FleetIds == nil { - invalidParams.Add(request.NewErrParamRequired("FleetIds")) - } - if s.TerminateInstances == nil { - invalidParams.Add(request.NewErrParamRequired("TerminateInstances")) +func (s *DeleteSnapshotInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteSnapshotInput"} + if s.SnapshotId == nil { + invalidParams.Add(request.NewErrParamRequired("SnapshotId")) } if invalidParams.Len() > 0 { @@ -45772,160 +52813,102 @@ func (s *DeleteFleetsInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteFleetsInput) SetDryRun(v bool) *DeleteFleetsInput { +func (s *DeleteSnapshotInput) SetDryRun(v bool) *DeleteSnapshotInput { s.DryRun = &v return s } -// SetFleetIds sets the FleetIds field's value. -func (s *DeleteFleetsInput) SetFleetIds(v []*string) *DeleteFleetsInput { - s.FleetIds = v - return s -} - -// SetTerminateInstances sets the TerminateInstances field's value. -func (s *DeleteFleetsInput) SetTerminateInstances(v bool) *DeleteFleetsInput { - s.TerminateInstances = &v +// SetSnapshotId sets the SnapshotId field's value. +func (s *DeleteSnapshotInput) SetSnapshotId(v string) *DeleteSnapshotInput { + s.SnapshotId = &v return s } -type DeleteFleetsOutput struct { +type DeleteSnapshotOutput struct { _ struct{} `type:"structure"` - - // Information about the EC2 Fleets that are successfully deleted. - SuccessfulFleetDeletions []*DeleteFleetSuccessItem `locationName:"successfulFleetDeletionSet" locationNameList:"item" type:"list"` - - // Information about the EC2 Fleets that are not successfully deleted. - UnsuccessfulFleetDeletions []*DeleteFleetErrorItem `locationName:"unsuccessfulFleetDeletionSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DeleteFleetsOutput) String() string { +func (s DeleteSnapshotOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteFleetsOutput) GoString() string { +func (s DeleteSnapshotOutput) GoString() string { return s.String() } -// SetSuccessfulFleetDeletions sets the SuccessfulFleetDeletions field's value. -func (s *DeleteFleetsOutput) SetSuccessfulFleetDeletions(v []*DeleteFleetSuccessItem) *DeleteFleetsOutput { - s.SuccessfulFleetDeletions = v - return s -} - -// SetUnsuccessfulFleetDeletions sets the UnsuccessfulFleetDeletions field's value. -func (s *DeleteFleetsOutput) SetUnsuccessfulFleetDeletions(v []*DeleteFleetErrorItem) *DeleteFleetsOutput { - s.UnsuccessfulFleetDeletions = v - return s -} - -type DeleteFlowLogsInput struct { +// Contains the parameters for DeleteSpotDatafeedSubscription. +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 `type:"boolean"` - - // One or more flow log IDs. - // - // Constraint: Maximum of 1000 flow log IDs. - // - // FlowLogIds is a required field - FlowLogIds []*string `locationName:"FlowLogId" locationNameList:"item" type:"list" required:"true"` + DryRun *bool `locationName:"dryRun" type:"boolean"` } // String returns the string representation -func (s DeleteFlowLogsInput) String() string { +func (s DeleteSpotDatafeedSubscriptionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteFlowLogsInput) GoString() string { +func (s DeleteSpotDatafeedSubscriptionInput) 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 -} - // SetDryRun sets the DryRun field's value. -func (s *DeleteFlowLogsInput) SetDryRun(v bool) *DeleteFlowLogsInput { +func (s *DeleteSpotDatafeedSubscriptionInput) SetDryRun(v bool) *DeleteSpotDatafeedSubscriptionInput { s.DryRun = &v return s } -// SetFlowLogIds sets the FlowLogIds field's value. -func (s *DeleteFlowLogsInput) SetFlowLogIds(v []*string) *DeleteFlowLogsInput { - s.FlowLogIds = v - return s -} - -type DeleteFlowLogsOutput struct { +type DeleteSpotDatafeedSubscriptionOutput 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 { +func (s DeleteSpotDatafeedSubscriptionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteFlowLogsOutput) GoString() string { +func (s DeleteSpotDatafeedSubscriptionOutput) GoString() string { return s.String() } -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *DeleteFlowLogsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *DeleteFlowLogsOutput { - s.Unsuccessful = v - return s -} - -type DeleteFpgaImageInput struct { +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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the AFI. + // The ID of the subnet. // - // FpgaImageId is a required field - FpgaImageId *string `type:"string" required:"true"` + // SubnetId is a required field + SubnetId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteFpgaImageInput) String() string { +func (s DeleteSubnetInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteFpgaImageInput) GoString() string { +func (s DeleteSubnetInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteFpgaImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteFpgaImageInput"} - if s.FpgaImageId == nil { - invalidParams.Add(request.NewErrParamRequired("FpgaImageId")) +func (s *DeleteSubnetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteSubnetInput"} + if s.SubnetId == nil { + invalidParams.Add(request.NewErrParamRequired("SubnetId")) } if invalidParams.Len() > 0 { @@ -45935,41 +52918,32 @@ func (s *DeleteFpgaImageInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteFpgaImageInput) SetDryRun(v bool) *DeleteFpgaImageInput { +func (s *DeleteSubnetInput) SetDryRun(v bool) *DeleteSubnetInput { s.DryRun = &v return s } -// SetFpgaImageId sets the FpgaImageId field's value. -func (s *DeleteFpgaImageInput) SetFpgaImageId(v string) *DeleteFpgaImageInput { - s.FpgaImageId = &v +// SetSubnetId sets the SubnetId field's value. +func (s *DeleteSubnetInput) SetSubnetId(v string) *DeleteSubnetInput { + s.SubnetId = &v return s } -type DeleteFpgaImageOutput struct { +type DeleteSubnetOutput 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 DeleteFpgaImageOutput) String() string { +func (s DeleteSubnetOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteFpgaImageOutput) GoString() string { +func (s DeleteSubnetOutput) GoString() string { return s.String() } -// SetReturn sets the Return field's value. -func (s *DeleteFpgaImageOutput) SetReturn(v bool) *DeleteFpgaImageOutput { - s.Return = &v - return s -} - -type DeleteInternetGatewayInput struct { +type DeleteTagsInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -45978,27 +52952,40 @@ type DeleteInternetGatewayInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the internet gateway. + // The IDs of the resources, separated by spaces. // - // InternetGatewayId is a required field - InternetGatewayId *string `locationName:"internetGatewayId" type:"string" required:"true"` + // Constraints: Up to 1000 resource IDs. We recommend breaking up this request + // into smaller batches. + // + // Resources is a required field + Resources []*string `locationName:"resourceId" type:"list" required:"true"` + + // The tags to delete. Specify a tag key and an optional tag value to delete + // specific tags. If you specify a tag key without a tag value, we delete any + // tag with this key regardless of its value. If you specify a tag key with + // an empty string as the tag value, we delete the tag only if its value is + // an empty string. + // + // If you omit this parameter, we delete all user-defined tags for the specified + // resources. We do not delete AWS-generated tags (tags that have the aws: prefix). + Tags []*Tag `locationName:"tag" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DeleteInternetGatewayInput) String() string { +func (s DeleteTagsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteInternetGatewayInput) GoString() string { +func (s DeleteTagsInput) 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")) +func (s *DeleteTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTagsInput"} + if s.Resources == nil { + invalidParams.Add(request.NewErrParamRequired("Resources")) } if invalidParams.Len() > 0 { @@ -46008,61 +52995,67 @@ func (s *DeleteInternetGatewayInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteInternetGatewayInput) SetDryRun(v bool) *DeleteInternetGatewayInput { +func (s *DeleteTagsInput) SetDryRun(v bool) *DeleteTagsInput { s.DryRun = &v return s } -// SetInternetGatewayId sets the InternetGatewayId field's value. -func (s *DeleteInternetGatewayInput) SetInternetGatewayId(v string) *DeleteInternetGatewayInput { - s.InternetGatewayId = &v +// SetResources sets the Resources field's value. +func (s *DeleteTagsInput) SetResources(v []*string) *DeleteTagsInput { + s.Resources = v return s } -type DeleteInternetGatewayOutput struct { +// SetTags sets the Tags field's value. +func (s *DeleteTagsInput) SetTags(v []*Tag) *DeleteTagsInput { + s.Tags = v + return s +} + +type DeleteTagsOutput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s DeleteInternetGatewayOutput) String() string { +func (s DeleteTagsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteInternetGatewayOutput) GoString() string { +func (s DeleteTagsOutput) GoString() string { return s.String() } -type DeleteKeyPairInput struct { +type DeleteTrafficMirrorFilterInput 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"` + DryRun *bool `type:"boolean"` - // The name of the key pair. + // The ID of the Traffic Mirror filter. // - // KeyName is a required field - KeyName *string `type:"string" required:"true"` + // TrafficMirrorFilterId is a required field + TrafficMirrorFilterId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteKeyPairInput) String() string { +func (s DeleteTrafficMirrorFilterInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteKeyPairInput) GoString() string { +func (s DeleteTrafficMirrorFilterInput) 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")) +func (s *DeleteTrafficMirrorFilterInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficMirrorFilterInput"} + if s.TrafficMirrorFilterId == nil { + invalidParams.Add(request.NewErrParamRequired("TrafficMirrorFilterId")) } if invalidParams.Len() > 0 { @@ -46072,32 +53065,41 @@ func (s *DeleteKeyPairInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteKeyPairInput) SetDryRun(v bool) *DeleteKeyPairInput { +func (s *DeleteTrafficMirrorFilterInput) SetDryRun(v bool) *DeleteTrafficMirrorFilterInput { s.DryRun = &v return s } -// SetKeyName sets the KeyName field's value. -func (s *DeleteKeyPairInput) SetKeyName(v string) *DeleteKeyPairInput { - s.KeyName = &v +// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value. +func (s *DeleteTrafficMirrorFilterInput) SetTrafficMirrorFilterId(v string) *DeleteTrafficMirrorFilterInput { + s.TrafficMirrorFilterId = &v return s } -type DeleteKeyPairOutput struct { +type DeleteTrafficMirrorFilterOutput struct { _ struct{} `type:"structure"` + + // The ID of the Traffic Mirror filter. + TrafficMirrorFilterId *string `locationName:"trafficMirrorFilterId" type:"string"` } // String returns the string representation -func (s DeleteKeyPairOutput) String() string { +func (s DeleteTrafficMirrorFilterOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteKeyPairOutput) GoString() string { +func (s DeleteTrafficMirrorFilterOutput) GoString() string { return s.String() } -type DeleteLaunchTemplateInput struct { +// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value. +func (s *DeleteTrafficMirrorFilterOutput) SetTrafficMirrorFilterId(v string) *DeleteTrafficMirrorFilterOutput { + s.TrafficMirrorFilterId = &v + return s +} + +type DeleteTrafficMirrorFilterRuleInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -46106,30 +53108,27 @@ type DeleteLaunchTemplateInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The ID of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateId *string `type:"string"` - - // The name of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateName *string `min:"3" type:"string"` + // The ID of the Traffic Mirror rule. + // + // TrafficMirrorFilterRuleId is a required field + TrafficMirrorFilterRuleId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteLaunchTemplateInput) String() string { +func (s DeleteTrafficMirrorFilterRuleInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteLaunchTemplateInput) GoString() string { +func (s DeleteTrafficMirrorFilterRuleInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLaunchTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLaunchTemplateInput"} - if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) +func (s *DeleteTrafficMirrorFilterRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficMirrorFilterRuleInput"} + if s.TrafficMirrorFilterRuleId == nil { + invalidParams.Add(request.NewErrParamRequired("TrafficMirrorFilterRuleId")) } if invalidParams.Len() > 0 { @@ -46139,47 +53138,41 @@ func (s *DeleteLaunchTemplateInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteLaunchTemplateInput) SetDryRun(v bool) *DeleteLaunchTemplateInput { +func (s *DeleteTrafficMirrorFilterRuleInput) SetDryRun(v bool) *DeleteTrafficMirrorFilterRuleInput { s.DryRun = &v return s } -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *DeleteLaunchTemplateInput) SetLaunchTemplateId(v string) *DeleteLaunchTemplateInput { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *DeleteLaunchTemplateInput) SetLaunchTemplateName(v string) *DeleteLaunchTemplateInput { - s.LaunchTemplateName = &v +// SetTrafficMirrorFilterRuleId sets the TrafficMirrorFilterRuleId field's value. +func (s *DeleteTrafficMirrorFilterRuleInput) SetTrafficMirrorFilterRuleId(v string) *DeleteTrafficMirrorFilterRuleInput { + s.TrafficMirrorFilterRuleId = &v return s } -type DeleteLaunchTemplateOutput struct { +type DeleteTrafficMirrorFilterRuleOutput struct { _ struct{} `type:"structure"` - // Information about the launch template. - LaunchTemplate *LaunchTemplate `locationName:"launchTemplate" type:"structure"` + // The ID of the deleted Traffic Mirror rule. + TrafficMirrorFilterRuleId *string `locationName:"trafficMirrorFilterRuleId" type:"string"` } // String returns the string representation -func (s DeleteLaunchTemplateOutput) String() string { +func (s DeleteTrafficMirrorFilterRuleOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteLaunchTemplateOutput) GoString() string { +func (s DeleteTrafficMirrorFilterRuleOutput) GoString() string { return s.String() } -// SetLaunchTemplate sets the LaunchTemplate field's value. -func (s *DeleteLaunchTemplateOutput) SetLaunchTemplate(v *LaunchTemplate) *DeleteLaunchTemplateOutput { - s.LaunchTemplate = v +// SetTrafficMirrorFilterRuleId sets the TrafficMirrorFilterRuleId field's value. +func (s *DeleteTrafficMirrorFilterRuleOutput) SetTrafficMirrorFilterRuleId(v string) *DeleteTrafficMirrorFilterRuleOutput { + s.TrafficMirrorFilterRuleId = &v return s } -type DeleteLaunchTemplateVersionsInput struct { +type DeleteTrafficMirrorSessionInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -46188,38 +53181,27 @@ type DeleteLaunchTemplateVersionsInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The ID of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateId *string `type:"string"` - - // The name of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateName *string `min:"3" type:"string"` - - // The version numbers of one or more launch template versions to delete. + // The ID of the Traffic Mirror session. // - // Versions is a required field - Versions []*string `locationName:"LaunchTemplateVersion" locationNameList:"item" type:"list" required:"true"` + // TrafficMirrorSessionId is a required field + TrafficMirrorSessionId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteLaunchTemplateVersionsInput) String() string { +func (s DeleteTrafficMirrorSessionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteLaunchTemplateVersionsInput) GoString() string { +func (s DeleteTrafficMirrorSessionInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLaunchTemplateVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLaunchTemplateVersionsInput"} - if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) - } - if s.Versions == nil { - invalidParams.Add(request.NewErrParamRequired("Versions")) +func (s *DeleteTrafficMirrorSessionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficMirrorSessionInput"} + if s.TrafficMirrorSessionId == nil { + invalidParams.Add(request.NewErrParamRequired("TrafficMirrorSessionId")) } if invalidParams.Len() > 0 { @@ -46229,178 +53211,143 @@ func (s *DeleteLaunchTemplateVersionsInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteLaunchTemplateVersionsInput) SetDryRun(v bool) *DeleteLaunchTemplateVersionsInput { +func (s *DeleteTrafficMirrorSessionInput) SetDryRun(v bool) *DeleteTrafficMirrorSessionInput { s.DryRun = &v return s } -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *DeleteLaunchTemplateVersionsInput) SetLaunchTemplateId(v string) *DeleteLaunchTemplateVersionsInput { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *DeleteLaunchTemplateVersionsInput) SetLaunchTemplateName(v string) *DeleteLaunchTemplateVersionsInput { - s.LaunchTemplateName = &v - return s -} - -// SetVersions sets the Versions field's value. -func (s *DeleteLaunchTemplateVersionsInput) SetVersions(v []*string) *DeleteLaunchTemplateVersionsInput { - s.Versions = v +// SetTrafficMirrorSessionId sets the TrafficMirrorSessionId field's value. +func (s *DeleteTrafficMirrorSessionInput) SetTrafficMirrorSessionId(v string) *DeleteTrafficMirrorSessionInput { + s.TrafficMirrorSessionId = &v return s } -type DeleteLaunchTemplateVersionsOutput struct { +type DeleteTrafficMirrorSessionOutput struct { _ struct{} `type:"structure"` - // Information about the launch template versions that were successfully deleted. - SuccessfullyDeletedLaunchTemplateVersions []*DeleteLaunchTemplateVersionsResponseSuccessItem `locationName:"successfullyDeletedLaunchTemplateVersionSet" locationNameList:"item" type:"list"` - - // Information about the launch template versions that could not be deleted. - UnsuccessfullyDeletedLaunchTemplateVersions []*DeleteLaunchTemplateVersionsResponseErrorItem `locationName:"unsuccessfullyDeletedLaunchTemplateVersionSet" locationNameList:"item" type:"list"` + // The ID of the deleted Traffic Mirror session. + TrafficMirrorSessionId *string `locationName:"trafficMirrorSessionId" type:"string"` } // String returns the string representation -func (s DeleteLaunchTemplateVersionsOutput) String() string { +func (s DeleteTrafficMirrorSessionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteLaunchTemplateVersionsOutput) GoString() string { +func (s DeleteTrafficMirrorSessionOutput) GoString() string { return s.String() } -// SetSuccessfullyDeletedLaunchTemplateVersions sets the SuccessfullyDeletedLaunchTemplateVersions field's value. -func (s *DeleteLaunchTemplateVersionsOutput) SetSuccessfullyDeletedLaunchTemplateVersions(v []*DeleteLaunchTemplateVersionsResponseSuccessItem) *DeleteLaunchTemplateVersionsOutput { - s.SuccessfullyDeletedLaunchTemplateVersions = v - return s -} - -// SetUnsuccessfullyDeletedLaunchTemplateVersions sets the UnsuccessfullyDeletedLaunchTemplateVersions field's value. -func (s *DeleteLaunchTemplateVersionsOutput) SetUnsuccessfullyDeletedLaunchTemplateVersions(v []*DeleteLaunchTemplateVersionsResponseErrorItem) *DeleteLaunchTemplateVersionsOutput { - s.UnsuccessfullyDeletedLaunchTemplateVersions = v +// SetTrafficMirrorSessionId sets the TrafficMirrorSessionId field's value. +func (s *DeleteTrafficMirrorSessionOutput) SetTrafficMirrorSessionId(v string) *DeleteTrafficMirrorSessionOutput { + s.TrafficMirrorSessionId = &v return s } -// Describes a launch template version that could not be deleted. -type DeleteLaunchTemplateVersionsResponseErrorItem struct { +type DeleteTrafficMirrorTargetInput struct { _ struct{} `type:"structure"` - // The ID of the launch template. - LaunchTemplateId *string `locationName:"launchTemplateId" type:"string"` - - // The name of the launch template. - LaunchTemplateName *string `locationName:"launchTemplateName" type:"string"` - - // Information about the error. - ResponseError *ResponseError `locationName:"responseError" 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 version number of the launch template. - VersionNumber *int64 `locationName:"versionNumber" type:"long"` + // The ID of the Traffic Mirror target. + // + // TrafficMirrorTargetId is a required field + TrafficMirrorTargetId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteLaunchTemplateVersionsResponseErrorItem) String() string { +func (s DeleteTrafficMirrorTargetInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteLaunchTemplateVersionsResponseErrorItem) GoString() string { +func (s DeleteTrafficMirrorTargetInput) GoString() string { return s.String() } -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *DeleteLaunchTemplateVersionsResponseErrorItem) SetLaunchTemplateId(v string) *DeleteLaunchTemplateVersionsResponseErrorItem { - s.LaunchTemplateId = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteTrafficMirrorTargetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficMirrorTargetInput"} + if s.TrafficMirrorTargetId == nil { + invalidParams.Add(request.NewErrParamRequired("TrafficMirrorTargetId")) + } -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *DeleteLaunchTemplateVersionsResponseErrorItem) SetLaunchTemplateName(v string) *DeleteLaunchTemplateVersionsResponseErrorItem { - s.LaunchTemplateName = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetResponseError sets the ResponseError field's value. -func (s *DeleteLaunchTemplateVersionsResponseErrorItem) SetResponseError(v *ResponseError) *DeleteLaunchTemplateVersionsResponseErrorItem { - s.ResponseError = v +// SetDryRun sets the DryRun field's value. +func (s *DeleteTrafficMirrorTargetInput) SetDryRun(v bool) *DeleteTrafficMirrorTargetInput { + s.DryRun = &v return s } -// SetVersionNumber sets the VersionNumber field's value. -func (s *DeleteLaunchTemplateVersionsResponseErrorItem) SetVersionNumber(v int64) *DeleteLaunchTemplateVersionsResponseErrorItem { - s.VersionNumber = &v +// SetTrafficMirrorTargetId sets the TrafficMirrorTargetId field's value. +func (s *DeleteTrafficMirrorTargetInput) SetTrafficMirrorTargetId(v string) *DeleteTrafficMirrorTargetInput { + s.TrafficMirrorTargetId = &v return s } -// Describes a launch template version that was successfully deleted. -type DeleteLaunchTemplateVersionsResponseSuccessItem struct { +type DeleteTrafficMirrorTargetOutput struct { _ struct{} `type:"structure"` - // The ID of the launch template. - LaunchTemplateId *string `locationName:"launchTemplateId" type:"string"` - - // The name of the launch template. - LaunchTemplateName *string `locationName:"launchTemplateName" type:"string"` - - // The version number of the launch template. - VersionNumber *int64 `locationName:"versionNumber" type:"long"` + // The ID of the deleted Traffic Mirror target. + TrafficMirrorTargetId *string `locationName:"trafficMirrorTargetId" type:"string"` } // String returns the string representation -func (s DeleteLaunchTemplateVersionsResponseSuccessItem) String() string { +func (s DeleteTrafficMirrorTargetOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteLaunchTemplateVersionsResponseSuccessItem) GoString() string { +func (s DeleteTrafficMirrorTargetOutput) GoString() string { return s.String() } -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *DeleteLaunchTemplateVersionsResponseSuccessItem) SetLaunchTemplateId(v string) *DeleteLaunchTemplateVersionsResponseSuccessItem { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *DeleteLaunchTemplateVersionsResponseSuccessItem) SetLaunchTemplateName(v string) *DeleteLaunchTemplateVersionsResponseSuccessItem { - s.LaunchTemplateName = &v - return s -} - -// SetVersionNumber sets the VersionNumber field's value. -func (s *DeleteLaunchTemplateVersionsResponseSuccessItem) SetVersionNumber(v int64) *DeleteLaunchTemplateVersionsResponseSuccessItem { - s.VersionNumber = &v +// SetTrafficMirrorTargetId sets the TrafficMirrorTargetId field's value. +func (s *DeleteTrafficMirrorTargetOutput) SetTrafficMirrorTargetId(v string) *DeleteTrafficMirrorTargetOutput { + s.TrafficMirrorTargetId = &v return s } -type DeleteNatGatewayInput struct { +type DeleteTransitGatewayInput struct { _ struct{} `type:"structure"` - // The ID of the NAT gateway. + // Checks whether you have the required permissions for the action, without + // actually making 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 transit gateway. // - // NatGatewayId is a required field - NatGatewayId *string `type:"string" required:"true"` + // TransitGatewayId is a required field + TransitGatewayId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteNatGatewayInput) String() string { +func (s DeleteTransitGatewayInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteNatGatewayInput) GoString() string { +func (s DeleteTransitGatewayInput) 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")) +func (s *DeleteTransitGatewayInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayInput"} + if s.TransitGatewayId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayId")) } if invalidParams.Len() > 0 { @@ -46409,81 +53356,48 @@ func (s *DeleteNatGatewayInput) Validate() error { return nil } -// SetNatGatewayId sets the NatGatewayId field's value. -func (s *DeleteNatGatewayInput) SetNatGatewayId(v string) *DeleteNatGatewayInput { - s.NatGatewayId = &v +// SetDryRun sets the DryRun field's value. +func (s *DeleteTransitGatewayInput) SetDryRun(v bool) *DeleteTransitGatewayInput { + s.DryRun = &v return s } -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 +// SetTransitGatewayId sets the TransitGatewayId field's value. +func (s *DeleteTransitGatewayInput) SetTransitGatewayId(v string) *DeleteTransitGatewayInput { + s.TransitGatewayId = &v return s } -type DeleteNetworkAclEntryInput struct { +type DeleteTransitGatewayMulticastDomainInput 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"` + DryRun *bool `type:"boolean"` - // The rule number of the entry to delete. + // The ID of the transit gateway multicast domain. // - // RuleNumber is a required field - RuleNumber *int64 `locationName:"ruleNumber" type:"integer" required:"true"` + // TransitGatewayMulticastDomainId is a required field + TransitGatewayMulticastDomainId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteNetworkAclEntryInput) String() string { +func (s DeleteTransitGatewayMulticastDomainInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteNetworkAclEntryInput) GoString() string { +func (s DeleteTransitGatewayMulticastDomainInput) 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")) +func (s *DeleteTransitGatewayMulticastDomainInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayMulticastDomainInput"} + if s.TransitGatewayMulticastDomainId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayMulticastDomainId")) } if invalidParams.Len() > 0 { @@ -46493,73 +53407,93 @@ func (s *DeleteNetworkAclEntryInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteNetworkAclEntryInput) SetDryRun(v bool) *DeleteNetworkAclEntryInput { +func (s *DeleteTransitGatewayMulticastDomainInput) SetDryRun(v bool) *DeleteTransitGatewayMulticastDomainInput { s.DryRun = &v return s } -// SetEgress sets the Egress field's value. -func (s *DeleteNetworkAclEntryInput) SetEgress(v bool) *DeleteNetworkAclEntryInput { - s.Egress = &v +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *DeleteTransitGatewayMulticastDomainInput) SetTransitGatewayMulticastDomainId(v string) *DeleteTransitGatewayMulticastDomainInput { + s.TransitGatewayMulticastDomainId = &v return s } -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *DeleteNetworkAclEntryInput) SetNetworkAclId(v string) *DeleteNetworkAclEntryInput { - s.NetworkAclId = &v - return s +type DeleteTransitGatewayMulticastDomainOutput struct { + _ struct{} `type:"structure"` + + // Information about the deleted transit gateway multicast domain. + TransitGatewayMulticastDomain *TransitGatewayMulticastDomain `locationName:"transitGatewayMulticastDomain" type:"structure"` } -// SetRuleNumber sets the RuleNumber field's value. -func (s *DeleteNetworkAclEntryInput) SetRuleNumber(v int64) *DeleteNetworkAclEntryInput { - s.RuleNumber = &v +// String returns the string representation +func (s DeleteTransitGatewayMulticastDomainOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTransitGatewayMulticastDomainOutput) GoString() string { + return s.String() +} + +// SetTransitGatewayMulticastDomain sets the TransitGatewayMulticastDomain field's value. +func (s *DeleteTransitGatewayMulticastDomainOutput) SetTransitGatewayMulticastDomain(v *TransitGatewayMulticastDomain) *DeleteTransitGatewayMulticastDomainOutput { + s.TransitGatewayMulticastDomain = v return s } -type DeleteNetworkAclEntryOutput struct { +type DeleteTransitGatewayOutput struct { _ struct{} `type:"structure"` + + // Information about the deleted transit gateway. + TransitGateway *TransitGateway `locationName:"transitGateway" type:"structure"` } // String returns the string representation -func (s DeleteNetworkAclEntryOutput) String() string { +func (s DeleteTransitGatewayOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteNetworkAclEntryOutput) GoString() string { +func (s DeleteTransitGatewayOutput) GoString() string { return s.String() } -type DeleteNetworkAclInput struct { +// SetTransitGateway sets the TransitGateway field's value. +func (s *DeleteTransitGatewayOutput) SetTransitGateway(v *TransitGateway) *DeleteTransitGatewayOutput { + s.TransitGateway = v + return s +} + +type DeleteTransitGatewayPeeringAttachmentInput 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"` + DryRun *bool `type:"boolean"` - // The ID of the network ACL. + // The ID of the transit gateway peering attachment. // - // NetworkAclId is a required field - NetworkAclId *string `locationName:"networkAclId" type:"string" required:"true"` + // TransitGatewayAttachmentId is a required field + TransitGatewayAttachmentId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteNetworkAclInput) String() string { +func (s DeleteTransitGatewayPeeringAttachmentInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteNetworkAclInput) GoString() string { +func (s DeleteTransitGatewayPeeringAttachmentInput) 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")) +func (s *DeleteTransitGatewayPeeringAttachmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayPeeringAttachmentInput"} + if s.TransitGatewayAttachmentId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId")) } if invalidParams.Len() > 0 { @@ -46569,62 +53503,78 @@ func (s *DeleteNetworkAclInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteNetworkAclInput) SetDryRun(v bool) *DeleteNetworkAclInput { +func (s *DeleteTransitGatewayPeeringAttachmentInput) SetDryRun(v bool) *DeleteTransitGatewayPeeringAttachmentInput { s.DryRun = &v return s } -// SetNetworkAclId sets the NetworkAclId field's value. -func (s *DeleteNetworkAclInput) SetNetworkAclId(v string) *DeleteNetworkAclInput { - s.NetworkAclId = &v +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *DeleteTransitGatewayPeeringAttachmentInput) SetTransitGatewayAttachmentId(v string) *DeleteTransitGatewayPeeringAttachmentInput { + s.TransitGatewayAttachmentId = &v return s } -type DeleteNetworkAclOutput struct { +type DeleteTransitGatewayPeeringAttachmentOutput struct { _ struct{} `type:"structure"` + + // The transit gateway peering attachment. + TransitGatewayPeeringAttachment *TransitGatewayPeeringAttachment `locationName:"transitGatewayPeeringAttachment" type:"structure"` } // String returns the string representation -func (s DeleteNetworkAclOutput) String() string { +func (s DeleteTransitGatewayPeeringAttachmentOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteNetworkAclOutput) GoString() string { +func (s DeleteTransitGatewayPeeringAttachmentOutput) GoString() string { return s.String() } -// Contains the parameters for DeleteNetworkInterface. -type DeleteNetworkInterfaceInput struct { +// SetTransitGatewayPeeringAttachment sets the TransitGatewayPeeringAttachment field's value. +func (s *DeleteTransitGatewayPeeringAttachmentOutput) SetTransitGatewayPeeringAttachment(v *TransitGatewayPeeringAttachment) *DeleteTransitGatewayPeeringAttachmentOutput { + s.TransitGatewayPeeringAttachment = v + return s +} + +type DeleteTransitGatewayRouteInput struct { _ struct{} `type:"structure"` + // The CIDR range for the route. This must match the CIDR for the route exactly. + // + // DestinationCidrBlock is a required field + DestinationCidrBlock *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"` + DryRun *bool `type:"boolean"` - // The ID of the network interface. + // The ID of the transit gateway route table. // - // NetworkInterfaceId is a required field - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string" required:"true"` + // TransitGatewayRouteTableId is a required field + TransitGatewayRouteTableId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteNetworkInterfaceInput) String() string { +func (s DeleteTransitGatewayRouteInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteNetworkInterfaceInput) GoString() string { +func (s DeleteTransitGatewayRouteInput) 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")) +func (s *DeleteTransitGatewayRouteInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayRouteInput"} + if s.DestinationCidrBlock == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock")) + } + if s.TransitGatewayRouteTableId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId")) } if invalidParams.Len() > 0 { @@ -46633,34 +53583,48 @@ func (s *DeleteNetworkInterfaceInput) Validate() error { return nil } +// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. +func (s *DeleteTransitGatewayRouteInput) SetDestinationCidrBlock(v string) *DeleteTransitGatewayRouteInput { + s.DestinationCidrBlock = &v + return s +} + // SetDryRun sets the DryRun field's value. -func (s *DeleteNetworkInterfaceInput) SetDryRun(v bool) *DeleteNetworkInterfaceInput { +func (s *DeleteTransitGatewayRouteInput) SetDryRun(v bool) *DeleteTransitGatewayRouteInput { s.DryRun = &v return s } -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *DeleteNetworkInterfaceInput) SetNetworkInterfaceId(v string) *DeleteNetworkInterfaceInput { - s.NetworkInterfaceId = &v +// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value. +func (s *DeleteTransitGatewayRouteInput) SetTransitGatewayRouteTableId(v string) *DeleteTransitGatewayRouteInput { + s.TransitGatewayRouteTableId = &v return s } -type DeleteNetworkInterfaceOutput struct { +type DeleteTransitGatewayRouteOutput struct { _ struct{} `type:"structure"` + + // Information about the route. + Route *TransitGatewayRoute `locationName:"route" type:"structure"` } // String returns the string representation -func (s DeleteNetworkInterfaceOutput) String() string { +func (s DeleteTransitGatewayRouteOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteNetworkInterfaceOutput) GoString() string { +func (s DeleteTransitGatewayRouteOutput) GoString() string { return s.String() } -// Contains the parameters for DeleteNetworkInterfacePermission. -type DeleteNetworkInterfacePermissionInput struct { +// SetRoute sets the Route field's value. +func (s *DeleteTransitGatewayRouteOutput) SetRoute(v *TransitGatewayRoute) *DeleteTransitGatewayRouteOutput { + s.Route = v + return s +} + +type DeleteTransitGatewayRouteTableInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -46669,31 +53633,27 @@ type DeleteNetworkInterfacePermissionInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // Specify true to remove the permission even if the network interface is attached - // to an instance. - Force *bool `type:"boolean"` - - // The ID of the network interface permission. + // The ID of the transit gateway route table. // - // NetworkInterfacePermissionId is a required field - NetworkInterfacePermissionId *string `type:"string" required:"true"` + // TransitGatewayRouteTableId is a required field + TransitGatewayRouteTableId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteNetworkInterfacePermissionInput) String() string { +func (s DeleteTransitGatewayRouteTableInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteNetworkInterfacePermissionInput) GoString() string { +func (s DeleteTransitGatewayRouteTableInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNetworkInterfacePermissionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNetworkInterfacePermissionInput"} - if s.NetworkInterfacePermissionId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkInterfacePermissionId")) +func (s *DeleteTransitGatewayRouteTableInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayRouteTableInput"} + if s.TransitGatewayRouteTableId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId")) } if invalidParams.Len() > 0 { @@ -46703,77 +53663,70 @@ func (s *DeleteNetworkInterfacePermissionInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteNetworkInterfacePermissionInput) SetDryRun(v bool) *DeleteNetworkInterfacePermissionInput { +func (s *DeleteTransitGatewayRouteTableInput) SetDryRun(v bool) *DeleteTransitGatewayRouteTableInput { s.DryRun = &v return s } -// SetForce sets the Force field's value. -func (s *DeleteNetworkInterfacePermissionInput) SetForce(v bool) *DeleteNetworkInterfacePermissionInput { - s.Force = &v - return s -} - -// SetNetworkInterfacePermissionId sets the NetworkInterfacePermissionId field's value. -func (s *DeleteNetworkInterfacePermissionInput) SetNetworkInterfacePermissionId(v string) *DeleteNetworkInterfacePermissionInput { - s.NetworkInterfacePermissionId = &v +// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value. +func (s *DeleteTransitGatewayRouteTableInput) SetTransitGatewayRouteTableId(v string) *DeleteTransitGatewayRouteTableInput { + s.TransitGatewayRouteTableId = &v return s } -// Contains the output for DeleteNetworkInterfacePermission. -type DeleteNetworkInterfacePermissionOutput struct { +type DeleteTransitGatewayRouteTableOutput struct { _ struct{} `type:"structure"` - // Returns true if the request succeeds, otherwise returns an error. - Return *bool `locationName:"return" type:"boolean"` + // Information about the deleted transit gateway route table. + TransitGatewayRouteTable *TransitGatewayRouteTable `locationName:"transitGatewayRouteTable" type:"structure"` } // String returns the string representation -func (s DeleteNetworkInterfacePermissionOutput) String() string { +func (s DeleteTransitGatewayRouteTableOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteNetworkInterfacePermissionOutput) GoString() string { +func (s DeleteTransitGatewayRouteTableOutput) GoString() string { return s.String() } -// SetReturn sets the Return field's value. -func (s *DeleteNetworkInterfacePermissionOutput) SetReturn(v bool) *DeleteNetworkInterfacePermissionOutput { - s.Return = &v +// SetTransitGatewayRouteTable sets the TransitGatewayRouteTable field's value. +func (s *DeleteTransitGatewayRouteTableOutput) SetTransitGatewayRouteTable(v *TransitGatewayRouteTable) *DeleteTransitGatewayRouteTableOutput { + s.TransitGatewayRouteTable = v return s } -type DeletePlacementGroupInput struct { +type DeleteTransitGatewayVpcAttachmentInput 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"` + DryRun *bool `type:"boolean"` - // The name of the placement group. + // The ID of the attachment. // - // GroupName is a required field - GroupName *string `locationName:"groupName" type:"string" required:"true"` + // TransitGatewayAttachmentId is a required field + TransitGatewayAttachmentId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeletePlacementGroupInput) String() string { +func (s DeleteTransitGatewayVpcAttachmentInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeletePlacementGroupInput) GoString() string { +func (s DeleteTransitGatewayVpcAttachmentInput) 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")) +func (s *DeleteTransitGatewayVpcAttachmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayVpcAttachmentInput"} + if s.TransitGatewayAttachmentId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId")) } if invalidParams.Len() > 0 { @@ -46783,41 +53736,42 @@ func (s *DeletePlacementGroupInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeletePlacementGroupInput) SetDryRun(v bool) *DeletePlacementGroupInput { +func (s *DeleteTransitGatewayVpcAttachmentInput) SetDryRun(v bool) *DeleteTransitGatewayVpcAttachmentInput { s.DryRun = &v return s } -// SetGroupName sets the GroupName field's value. -func (s *DeletePlacementGroupInput) SetGroupName(v string) *DeletePlacementGroupInput { - s.GroupName = &v +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *DeleteTransitGatewayVpcAttachmentInput) SetTransitGatewayAttachmentId(v string) *DeleteTransitGatewayVpcAttachmentInput { + s.TransitGatewayAttachmentId = &v return s } -type DeletePlacementGroupOutput struct { +type DeleteTransitGatewayVpcAttachmentOutput struct { _ struct{} `type:"structure"` + + // Information about the deleted VPC attachment. + TransitGatewayVpcAttachment *TransitGatewayVpcAttachment `locationName:"transitGatewayVpcAttachment" type:"structure"` } // String returns the string representation -func (s DeletePlacementGroupOutput) String() string { +func (s DeleteTransitGatewayVpcAttachmentOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeletePlacementGroupOutput) GoString() string { +func (s DeleteTransitGatewayVpcAttachmentOutput) GoString() string { return s.String() } -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"` +// SetTransitGatewayVpcAttachment sets the TransitGatewayVpcAttachment field's value. +func (s *DeleteTransitGatewayVpcAttachmentOutput) SetTransitGatewayVpcAttachment(v *TransitGatewayVpcAttachment) *DeleteTransitGatewayVpcAttachmentOutput { + s.TransitGatewayVpcAttachment = v + return s +} - // 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"` +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 @@ -46825,27 +53779,27 @@ type DeleteRouteInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the route table. + // The ID of the volume. // - // RouteTableId is a required field - RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` + // VolumeId is a required field + VolumeId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteRouteInput) String() string { +func (s DeleteVolumeInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteRouteInput) GoString() string { +func (s DeleteVolumeInput) 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")) +func (s *DeleteVolumeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteVolumeInput"} + if s.VolumeId == nil { + invalidParams.Add(request.NewErrParamRequired("VolumeId")) } if invalidParams.Len() > 0 { @@ -46854,74 +53808,62 @@ func (s *DeleteRouteInput) Validate() error { 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 { +func (s *DeleteVolumeInput) SetDryRun(v bool) *DeleteVolumeInput { s.DryRun = &v return s } -// SetRouteTableId sets the RouteTableId field's value. -func (s *DeleteRouteInput) SetRouteTableId(v string) *DeleteRouteInput { - s.RouteTableId = &v +// SetVolumeId sets the VolumeId field's value. +func (s *DeleteVolumeInput) SetVolumeId(v string) *DeleteVolumeInput { + s.VolumeId = &v return s } -type DeleteRouteOutput struct { +type DeleteVolumeOutput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s DeleteRouteOutput) String() string { +func (s DeleteVolumeOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteRouteOutput) GoString() string { +func (s DeleteVolumeOutput) GoString() string { return s.String() } -type DeleteRouteTableInput struct { +type DeleteVpcEndpointConnectionNotificationsInput struct { _ struct{} `type:"structure"` + // One or more notification IDs. + // + // ConnectionNotificationIds is a required field + ConnectionNotificationIds []*string `locationName:"ConnectionNotificationId" 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"` - - // The ID of the route table. - // - // RouteTableId is a required field - RouteTableId *string `locationName:"routeTableId" type:"string" required:"true"` + DryRun *bool `type:"boolean"` } // String returns the string representation -func (s DeleteRouteTableInput) String() string { +func (s DeleteVpcEndpointConnectionNotificationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteRouteTableInput) GoString() string { +func (s DeleteVpcEndpointConnectionNotificationsInput) 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")) +func (s *DeleteVpcEndpointConnectionNotificationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteVpcEndpointConnectionNotificationsInput"} + if s.ConnectionNotificationIds == nil { + invalidParams.Add(request.NewErrParamRequired("ConnectionNotificationIds")) } if invalidParams.Len() > 0 { @@ -46930,122 +53872,145 @@ func (s *DeleteRouteTableInput) Validate() error { return nil } -// SetDryRun sets the DryRun field's value. -func (s *DeleteRouteTableInput) SetDryRun(v bool) *DeleteRouteTableInput { - s.DryRun = &v +// SetConnectionNotificationIds sets the ConnectionNotificationIds field's value. +func (s *DeleteVpcEndpointConnectionNotificationsInput) SetConnectionNotificationIds(v []*string) *DeleteVpcEndpointConnectionNotificationsInput { + s.ConnectionNotificationIds = v return s } -// SetRouteTableId sets the RouteTableId field's value. -func (s *DeleteRouteTableInput) SetRouteTableId(v string) *DeleteRouteTableInput { - s.RouteTableId = &v +// SetDryRun sets the DryRun field's value. +func (s *DeleteVpcEndpointConnectionNotificationsInput) SetDryRun(v bool) *DeleteVpcEndpointConnectionNotificationsInput { + s.DryRun = &v return s } -type DeleteRouteTableOutput struct { +type DeleteVpcEndpointConnectionNotificationsOutput struct { _ struct{} `type:"structure"` + + // Information about the notifications that could not be deleted successfully. + Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DeleteRouteTableOutput) String() string { +func (s DeleteVpcEndpointConnectionNotificationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteRouteTableOutput) GoString() string { +func (s DeleteVpcEndpointConnectionNotificationsOutput) GoString() string { return s.String() } -type DeleteSecurityGroupInput struct { +// SetUnsuccessful sets the Unsuccessful field's value. +func (s *DeleteVpcEndpointConnectionNotificationsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *DeleteVpcEndpointConnectionNotificationsOutput { + s.Unsuccessful = v + return s +} + +type DeleteVpcEndpointServiceConfigurationsInput 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"` + DryRun *bool `type:"boolean"` - // [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"` + // The IDs of one or more services. + // + // ServiceIds is a required field + ServiceIds []*string `locationName:"ServiceId" locationNameList:"item" type:"list" required:"true"` } // String returns the string representation -func (s DeleteSecurityGroupInput) String() string { +func (s DeleteVpcEndpointServiceConfigurationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSecurityGroupInput) GoString() string { +func (s DeleteVpcEndpointServiceConfigurationsInput) GoString() string { return s.String() } -// SetDryRun sets the DryRun field's value. -func (s *DeleteSecurityGroupInput) SetDryRun(v bool) *DeleteSecurityGroupInput { - s.DryRun = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteVpcEndpointServiceConfigurationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteVpcEndpointServiceConfigurationsInput"} + if s.ServiceIds == nil { + invalidParams.Add(request.NewErrParamRequired("ServiceIds")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetGroupId sets the GroupId field's value. -func (s *DeleteSecurityGroupInput) SetGroupId(v string) *DeleteSecurityGroupInput { - s.GroupId = &v +// SetDryRun sets the DryRun field's value. +func (s *DeleteVpcEndpointServiceConfigurationsInput) SetDryRun(v bool) *DeleteVpcEndpointServiceConfigurationsInput { + s.DryRun = &v return s } -// SetGroupName sets the GroupName field's value. -func (s *DeleteSecurityGroupInput) SetGroupName(v string) *DeleteSecurityGroupInput { - s.GroupName = &v +// SetServiceIds sets the ServiceIds field's value. +func (s *DeleteVpcEndpointServiceConfigurationsInput) SetServiceIds(v []*string) *DeleteVpcEndpointServiceConfigurationsInput { + s.ServiceIds = v return s } -type DeleteSecurityGroupOutput struct { +type DeleteVpcEndpointServiceConfigurationsOutput struct { _ struct{} `type:"structure"` + + // Information about the service configurations that were not deleted, if applicable. + Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DeleteSecurityGroupOutput) String() string { +func (s DeleteVpcEndpointServiceConfigurationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSecurityGroupOutput) GoString() string { +func (s DeleteVpcEndpointServiceConfigurationsOutput) GoString() string { return s.String() } -// Contains the parameters for DeleteSnapshot. -type DeleteSnapshotInput struct { +// SetUnsuccessful sets the Unsuccessful field's value. +func (s *DeleteVpcEndpointServiceConfigurationsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *DeleteVpcEndpointServiceConfigurationsOutput { + s.Unsuccessful = v + return s +} + +// Contains the parameters for DeleteVpcEndpoints. +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 `locationName:"dryRun" type:"boolean"` + DryRun *bool `type:"boolean"` - // The ID of the EBS snapshot. + // One or more VPC endpoint IDs. // - // SnapshotId is a required field - SnapshotId *string `type:"string" required:"true"` + // VpcEndpointIds is a required field + VpcEndpointIds []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list" required:"true"` } // String returns the string representation -func (s DeleteSnapshotInput) String() string { +func (s DeleteVpcEndpointsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSnapshotInput) GoString() string { +func (s DeleteVpcEndpointsInput) 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")) +func (s *DeleteVpcEndpointsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteVpcEndpointsInput"} + if s.VpcEndpointIds == nil { + invalidParams.Add(request.NewErrParamRequired("VpcEndpointIds")) } if invalidParams.Len() > 0 { @@ -47055,33 +54020,42 @@ func (s *DeleteSnapshotInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteSnapshotInput) SetDryRun(v bool) *DeleteSnapshotInput { +func (s *DeleteVpcEndpointsInput) SetDryRun(v bool) *DeleteVpcEndpointsInput { s.DryRun = &v return s } -// SetSnapshotId sets the SnapshotId field's value. -func (s *DeleteSnapshotInput) SetSnapshotId(v string) *DeleteSnapshotInput { - s.SnapshotId = &v +// SetVpcEndpointIds sets the VpcEndpointIds field's value. +func (s *DeleteVpcEndpointsInput) SetVpcEndpointIds(v []*string) *DeleteVpcEndpointsInput { + s.VpcEndpointIds = v return s } -type DeleteSnapshotOutput struct { +// Contains the output of DeleteVpcEndpoints. +type DeleteVpcEndpointsOutput struct { _ struct{} `type:"structure"` + + // Information about the VPC endpoints that were not successfully deleted. + Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DeleteSnapshotOutput) String() string { +func (s DeleteVpcEndpointsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSnapshotOutput) GoString() string { +func (s DeleteVpcEndpointsOutput) GoString() string { return s.String() } -// Contains the parameters for DeleteSpotDatafeedSubscription. -type DeleteSpotDatafeedSubscriptionInput struct { +// SetUnsuccessful sets the Unsuccessful field's value. +func (s *DeleteVpcEndpointsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *DeleteVpcEndpointsOutput { + s.Unsuccessful = v + return s +} + +type DeleteVpcInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -47089,39 +54063,63 @@ type DeleteSpotDatafeedSubscriptionInput struct { // 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 DeleteSpotDatafeedSubscriptionInput) String() string { +func (s DeleteVpcInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSpotDatafeedSubscriptionInput) GoString() string { +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 *DeleteSpotDatafeedSubscriptionInput) SetDryRun(v bool) *DeleteSpotDatafeedSubscriptionInput { +func (s *DeleteVpcInput) SetDryRun(v bool) *DeleteVpcInput { s.DryRun = &v return s } -type DeleteSpotDatafeedSubscriptionOutput struct { +// SetVpcId sets the VpcId field's value. +func (s *DeleteVpcInput) SetVpcId(v string) *DeleteVpcInput { + s.VpcId = &v + return s +} + +type DeleteVpcOutput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s DeleteSpotDatafeedSubscriptionOutput) String() string { +func (s DeleteVpcOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSpotDatafeedSubscriptionOutput) GoString() string { +func (s DeleteVpcOutput) GoString() string { return s.String() } -type DeleteSubnetInput struct { +type DeleteVpcPeeringConnectionInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -47130,27 +54128,27 @@ type DeleteSubnetInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the subnet. + // The ID of the VPC peering connection. // - // SubnetId is a required field - SubnetId *string `type:"string" required:"true"` + // VpcPeeringConnectionId is a required field + VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string" required:"true"` } // String returns the string representation -func (s DeleteSubnetInput) String() string { +func (s DeleteVpcPeeringConnectionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSubnetInput) GoString() string { +func (s DeleteVpcPeeringConnectionInput) 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")) +func (s *DeleteVpcPeeringConnectionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteVpcPeeringConnectionInput"} + if s.VpcPeeringConnectionId == nil { + invalidParams.Add(request.NewErrParamRequired("VpcPeeringConnectionId")) } if invalidParams.Len() > 0 { @@ -47160,32 +54158,42 @@ func (s *DeleteSubnetInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteSubnetInput) SetDryRun(v bool) *DeleteSubnetInput { +func (s *DeleteVpcPeeringConnectionInput) SetDryRun(v bool) *DeleteVpcPeeringConnectionInput { s.DryRun = &v return s } -// SetSubnetId sets the SubnetId field's value. -func (s *DeleteSubnetInput) SetSubnetId(v string) *DeleteSubnetInput { - s.SubnetId = &v +// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. +func (s *DeleteVpcPeeringConnectionInput) SetVpcPeeringConnectionId(v string) *DeleteVpcPeeringConnectionInput { + s.VpcPeeringConnectionId = &v return s } -type DeleteSubnetOutput struct { +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 DeleteSubnetOutput) String() string { +func (s DeleteVpcPeeringConnectionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSubnetOutput) GoString() string { +func (s DeleteVpcPeeringConnectionOutput) GoString() string { return s.String() } -type DeleteTagsInput struct { +// SetReturn sets the Return field's value. +func (s *DeleteVpcPeeringConnectionOutput) SetReturn(v bool) *DeleteVpcPeeringConnectionOutput { + s.Return = &v + return s +} + +// Contains the parameters for DeleteVpnConnection. +type DeleteVpnConnectionInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -47194,40 +54202,27 @@ type DeleteTagsInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The IDs of the resources, separated by spaces. - // - // Constraints: Up to 1000 resource IDs. We recommend breaking up this request - // into smaller batches. - // - // Resources is a required field - Resources []*string `locationName:"resourceId" type:"list" required:"true"` - - // The tags to delete. Specify a tag key and an optional tag value to delete - // specific tags. If you specify a tag key without a tag value, we delete any - // tag with this key regardless of its value. If you specify a tag key with - // an empty string as the tag value, we delete the tag only if its value is - // an empty string. + // The ID of the VPN connection. // - // If you omit this parameter, we delete all user-defined tags for the specified - // resources. We do not delete AWS-generated tags (tags that have the aws: prefix). - Tags []*Tag `locationName:"tag" locationNameList:"item" type:"list"` + // VpnConnectionId is a required field + VpnConnectionId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteTagsInput) String() string { +func (s DeleteVpnConnectionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTagsInput) GoString() string { +func (s DeleteVpnConnectionInput) 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")) +func (s *DeleteVpnConnectionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteVpnConnectionInput"} + if s.VpnConnectionId == nil { + invalidParams.Add(request.NewErrParamRequired("VpnConnectionId")) } if invalidParams.Len() > 0 { @@ -47237,67 +54232,64 @@ func (s *DeleteTagsInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteTagsInput) SetDryRun(v bool) *DeleteTagsInput { +func (s *DeleteVpnConnectionInput) SetDryRun(v bool) *DeleteVpnConnectionInput { 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 +// SetVpnConnectionId sets the VpnConnectionId field's value. +func (s *DeleteVpnConnectionInput) SetVpnConnectionId(v string) *DeleteVpnConnectionInput { + s.VpnConnectionId = &v return s } -type DeleteTagsOutput struct { +type DeleteVpnConnectionOutput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s DeleteTagsOutput) String() string { +func (s DeleteVpnConnectionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTagsOutput) GoString() string { +func (s DeleteVpnConnectionOutput) GoString() string { return s.String() } -type DeleteTrafficMirrorFilterInput struct { +// Contains the parameters for DeleteVpnConnectionRoute. +type DeleteVpnConnectionRouteInput 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 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 Traffic Mirror filter. + // The ID of the VPN connection. // - // TrafficMirrorFilterId is a required field - TrafficMirrorFilterId *string `type:"string" required:"true"` + // VpnConnectionId is a required field + VpnConnectionId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteTrafficMirrorFilterInput) String() string { +func (s DeleteVpnConnectionRouteInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTrafficMirrorFilterInput) GoString() string { +func (s DeleteVpnConnectionRouteInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTrafficMirrorFilterInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficMirrorFilterInput"} - if s.TrafficMirrorFilterId == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficMirrorFilterId")) +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 { @@ -47306,71 +54298,63 @@ func (s *DeleteTrafficMirrorFilterInput) Validate() error { return nil } -// SetDryRun sets the DryRun field's value. -func (s *DeleteTrafficMirrorFilterInput) SetDryRun(v bool) *DeleteTrafficMirrorFilterInput { - s.DryRun = &v +// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. +func (s *DeleteVpnConnectionRouteInput) SetDestinationCidrBlock(v string) *DeleteVpnConnectionRouteInput { + s.DestinationCidrBlock = &v return s } -// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value. -func (s *DeleteTrafficMirrorFilterInput) SetTrafficMirrorFilterId(v string) *DeleteTrafficMirrorFilterInput { - s.TrafficMirrorFilterId = &v +// SetVpnConnectionId sets the VpnConnectionId field's value. +func (s *DeleteVpnConnectionRouteInput) SetVpnConnectionId(v string) *DeleteVpnConnectionRouteInput { + s.VpnConnectionId = &v return s } -type DeleteTrafficMirrorFilterOutput struct { +type DeleteVpnConnectionRouteOutput struct { _ struct{} `type:"structure"` - - // The ID of the Traffic Mirror filter. - TrafficMirrorFilterId *string `locationName:"trafficMirrorFilterId" type:"string"` } // String returns the string representation -func (s DeleteTrafficMirrorFilterOutput) String() string { +func (s DeleteVpnConnectionRouteOutput) String() string { return awsutil.Prettify(s) } -// GoString returns the string representation -func (s DeleteTrafficMirrorFilterOutput) GoString() string { - return s.String() -} - -// SetTrafficMirrorFilterId sets the TrafficMirrorFilterId field's value. -func (s *DeleteTrafficMirrorFilterOutput) SetTrafficMirrorFilterId(v string) *DeleteTrafficMirrorFilterOutput { - s.TrafficMirrorFilterId = &v - return s +// GoString returns the string representation +func (s DeleteVpnConnectionRouteOutput) GoString() string { + return s.String() } -type DeleteTrafficMirrorFilterRuleInput struct { +// Contains the parameters for DeleteVpnGateway. +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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the Traffic Mirror rule. + // The ID of the virtual private gateway. // - // TrafficMirrorFilterRuleId is a required field - TrafficMirrorFilterRuleId *string `type:"string" required:"true"` + // VpnGatewayId is a required field + VpnGatewayId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteTrafficMirrorFilterRuleInput) String() string { +func (s DeleteVpnGatewayInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTrafficMirrorFilterRuleInput) GoString() string { +func (s DeleteVpnGatewayInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTrafficMirrorFilterRuleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficMirrorFilterRuleInput"} - if s.TrafficMirrorFilterRuleId == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficMirrorFilterRuleId")) +func (s *DeleteVpnGatewayInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteVpnGatewayInput"} + if s.VpnGatewayId == nil { + invalidParams.Add(request.NewErrParamRequired("VpnGatewayId")) } if invalidParams.Len() > 0 { @@ -47380,70 +54364,62 @@ func (s *DeleteTrafficMirrorFilterRuleInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteTrafficMirrorFilterRuleInput) SetDryRun(v bool) *DeleteTrafficMirrorFilterRuleInput { +func (s *DeleteVpnGatewayInput) SetDryRun(v bool) *DeleteVpnGatewayInput { s.DryRun = &v return s } -// SetTrafficMirrorFilterRuleId sets the TrafficMirrorFilterRuleId field's value. -func (s *DeleteTrafficMirrorFilterRuleInput) SetTrafficMirrorFilterRuleId(v string) *DeleteTrafficMirrorFilterRuleInput { - s.TrafficMirrorFilterRuleId = &v +// SetVpnGatewayId sets the VpnGatewayId field's value. +func (s *DeleteVpnGatewayInput) SetVpnGatewayId(v string) *DeleteVpnGatewayInput { + s.VpnGatewayId = &v return s } -type DeleteTrafficMirrorFilterRuleOutput struct { +type DeleteVpnGatewayOutput struct { _ struct{} `type:"structure"` - - // The ID of the deleted Traffic Mirror rule. - TrafficMirrorFilterRuleId *string `locationName:"trafficMirrorFilterRuleId" type:"string"` } // String returns the string representation -func (s DeleteTrafficMirrorFilterRuleOutput) String() string { +func (s DeleteVpnGatewayOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTrafficMirrorFilterRuleOutput) GoString() string { +func (s DeleteVpnGatewayOutput) GoString() string { return s.String() } -// SetTrafficMirrorFilterRuleId sets the TrafficMirrorFilterRuleId field's value. -func (s *DeleteTrafficMirrorFilterRuleOutput) SetTrafficMirrorFilterRuleId(v string) *DeleteTrafficMirrorFilterRuleOutput { - s.TrafficMirrorFilterRuleId = &v - return s -} - -type DeleteTrafficMirrorSessionInput struct { +type DeprovisionByoipCidrInput struct { _ struct{} `type:"structure"` + // The address range, in CIDR notation. The prefix must be the same prefix that + // you specified when you provisioned the address range. + // + // Cidr is a required field + Cidr *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 `type:"boolean"` - - // The ID of the Traffic Mirror session. - // - // TrafficMirrorSessionId is a required field - TrafficMirrorSessionId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteTrafficMirrorSessionInput) String() string { +func (s DeprovisionByoipCidrInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTrafficMirrorSessionInput) GoString() string { +func (s DeprovisionByoipCidrInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTrafficMirrorSessionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficMirrorSessionInput"} - if s.TrafficMirrorSessionId == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficMirrorSessionId")) +func (s *DeprovisionByoipCidrInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeprovisionByoipCidrInput"} + if s.Cidr == nil { + invalidParams.Add(request.NewErrParamRequired("Cidr")) } if invalidParams.Len() > 0 { @@ -47452,71 +54428,72 @@ func (s *DeleteTrafficMirrorSessionInput) Validate() error { return nil } -// SetDryRun sets the DryRun field's value. -func (s *DeleteTrafficMirrorSessionInput) SetDryRun(v bool) *DeleteTrafficMirrorSessionInput { - s.DryRun = &v +// SetCidr sets the Cidr field's value. +func (s *DeprovisionByoipCidrInput) SetCidr(v string) *DeprovisionByoipCidrInput { + s.Cidr = &v return s } -// SetTrafficMirrorSessionId sets the TrafficMirrorSessionId field's value. -func (s *DeleteTrafficMirrorSessionInput) SetTrafficMirrorSessionId(v string) *DeleteTrafficMirrorSessionInput { - s.TrafficMirrorSessionId = &v +// SetDryRun sets the DryRun field's value. +func (s *DeprovisionByoipCidrInput) SetDryRun(v bool) *DeprovisionByoipCidrInput { + s.DryRun = &v return s } -type DeleteTrafficMirrorSessionOutput struct { +type DeprovisionByoipCidrOutput struct { _ struct{} `type:"structure"` - // The ID of the deleted Traffic Mirror session. - TrafficMirrorSessionId *string `locationName:"trafficMirrorSessionId" type:"string"` + // Information about the address range. + ByoipCidr *ByoipCidr `locationName:"byoipCidr" type:"structure"` } // String returns the string representation -func (s DeleteTrafficMirrorSessionOutput) String() string { +func (s DeprovisionByoipCidrOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTrafficMirrorSessionOutput) GoString() string { +func (s DeprovisionByoipCidrOutput) GoString() string { return s.String() } -// SetTrafficMirrorSessionId sets the TrafficMirrorSessionId field's value. -func (s *DeleteTrafficMirrorSessionOutput) SetTrafficMirrorSessionId(v string) *DeleteTrafficMirrorSessionOutput { - s.TrafficMirrorSessionId = &v +// SetByoipCidr sets the ByoipCidr field's value. +func (s *DeprovisionByoipCidrOutput) SetByoipCidr(v *ByoipCidr) *DeprovisionByoipCidrOutput { + s.ByoipCidr = v return s } -type DeleteTrafficMirrorTargetInput struct { +// Contains the parameters for DeregisterImage. +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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the Traffic Mirror target. + // The ID of the AMI. // - // TrafficMirrorTargetId is a required field - TrafficMirrorTargetId *string `type:"string" required:"true"` + // ImageId is a required field + ImageId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteTrafficMirrorTargetInput) String() string { +func (s DeregisterImageInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTrafficMirrorTargetInput) GoString() string { +func (s DeregisterImageInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTrafficMirrorTargetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTrafficMirrorTargetInput"} - if s.TrafficMirrorTargetId == nil { - invalidParams.Add(request.NewErrParamRequired("TrafficMirrorTargetId")) +func (s *DeregisterImageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeregisterImageInput"} + if s.ImageId == nil { + invalidParams.Add(request.NewErrParamRequired("ImageId")) } if invalidParams.Len() > 0 { @@ -47526,41 +54503,32 @@ func (s *DeleteTrafficMirrorTargetInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteTrafficMirrorTargetInput) SetDryRun(v bool) *DeleteTrafficMirrorTargetInput { +func (s *DeregisterImageInput) SetDryRun(v bool) *DeregisterImageInput { s.DryRun = &v return s } -// SetTrafficMirrorTargetId sets the TrafficMirrorTargetId field's value. -func (s *DeleteTrafficMirrorTargetInput) SetTrafficMirrorTargetId(v string) *DeleteTrafficMirrorTargetInput { - s.TrafficMirrorTargetId = &v +// SetImageId sets the ImageId field's value. +func (s *DeregisterImageInput) SetImageId(v string) *DeregisterImageInput { + s.ImageId = &v return s } -type DeleteTrafficMirrorTargetOutput struct { +type DeregisterImageOutput struct { _ struct{} `type:"structure"` - - // The ID of the deleted Traffic Mirror target. - TrafficMirrorTargetId *string `locationName:"trafficMirrorTargetId" type:"string"` } // String returns the string representation -func (s DeleteTrafficMirrorTargetOutput) String() string { +func (s DeregisterImageOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTrafficMirrorTargetOutput) GoString() string { +func (s DeregisterImageOutput) GoString() string { return s.String() } -// SetTrafficMirrorTargetId sets the TrafficMirrorTargetId field's value. -func (s *DeleteTrafficMirrorTargetOutput) SetTrafficMirrorTargetId(v string) *DeleteTrafficMirrorTargetOutput { - s.TrafficMirrorTargetId = &v - return s -} - -type DeleteTransitGatewayInput struct { +type DeregisterTransitGatewayMulticastGroupMembersInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -47569,516 +54537,578 @@ type DeleteTransitGatewayInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The ID of the transit gateway. - // - // TransitGatewayId is a required field - TransitGatewayId *string `type:"string" required:"true"` + // The IP address assigned to the transit gateway multicast group. + GroupIpAddress *string `type:"string"` + + // The IDs of the group members' network interfaces. + NetworkInterfaceIds []*string `locationNameList:"item" type:"list"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `type:"string"` } // String returns the string representation -func (s DeleteTransitGatewayInput) String() string { +func (s DeregisterTransitGatewayMulticastGroupMembersInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTransitGatewayInput) GoString() string { +func (s DeregisterTransitGatewayMulticastGroupMembersInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTransitGatewayInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayInput"} - if s.TransitGatewayId == nil { - invalidParams.Add(request.NewErrParamRequired("TransitGatewayId")) - } +// SetDryRun sets the DryRun field's value. +func (s *DeregisterTransitGatewayMulticastGroupMembersInput) SetDryRun(v bool) *DeregisterTransitGatewayMulticastGroupMembersInput { + s.DryRun = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetGroupIpAddress sets the GroupIpAddress field's value. +func (s *DeregisterTransitGatewayMulticastGroupMembersInput) SetGroupIpAddress(v string) *DeregisterTransitGatewayMulticastGroupMembersInput { + s.GroupIpAddress = &v + return s } -// SetDryRun sets the DryRun field's value. -func (s *DeleteTransitGatewayInput) SetDryRun(v bool) *DeleteTransitGatewayInput { - s.DryRun = &v +// SetNetworkInterfaceIds sets the NetworkInterfaceIds field's value. +func (s *DeregisterTransitGatewayMulticastGroupMembersInput) SetNetworkInterfaceIds(v []*string) *DeregisterTransitGatewayMulticastGroupMembersInput { + s.NetworkInterfaceIds = v return s } -// SetTransitGatewayId sets the TransitGatewayId field's value. -func (s *DeleteTransitGatewayInput) SetTransitGatewayId(v string) *DeleteTransitGatewayInput { - s.TransitGatewayId = &v +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *DeregisterTransitGatewayMulticastGroupMembersInput) SetTransitGatewayMulticastDomainId(v string) *DeregisterTransitGatewayMulticastGroupMembersInput { + s.TransitGatewayMulticastDomainId = &v return s } -type DeleteTransitGatewayOutput struct { +type DeregisterTransitGatewayMulticastGroupMembersOutput struct { _ struct{} `type:"structure"` - // Information about the deleted transit gateway. - TransitGateway *TransitGateway `locationName:"transitGateway" type:"structure"` + // Information about the deregistered members. + DeregisteredMulticastGroupMembers *TransitGatewayMulticastDeregisteredGroupMembers `locationName:"deregisteredMulticastGroupMembers" type:"structure"` } // String returns the string representation -func (s DeleteTransitGatewayOutput) String() string { +func (s DeregisterTransitGatewayMulticastGroupMembersOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTransitGatewayOutput) GoString() string { +func (s DeregisterTransitGatewayMulticastGroupMembersOutput) GoString() string { return s.String() } -// SetTransitGateway sets the TransitGateway field's value. -func (s *DeleteTransitGatewayOutput) SetTransitGateway(v *TransitGateway) *DeleteTransitGatewayOutput { - s.TransitGateway = v +// SetDeregisteredMulticastGroupMembers sets the DeregisteredMulticastGroupMembers field's value. +func (s *DeregisterTransitGatewayMulticastGroupMembersOutput) SetDeregisteredMulticastGroupMembers(v *TransitGatewayMulticastDeregisteredGroupMembers) *DeregisterTransitGatewayMulticastGroupMembersOutput { + s.DeregisteredMulticastGroupMembers = v return s } -type DeleteTransitGatewayRouteInput struct { +type DeregisterTransitGatewayMulticastGroupSourcesInput struct { _ struct{} `type:"structure"` - // The CIDR range for the route. This must match the CIDR for the route exactly. - // - // DestinationCidrBlock is a required field - DestinationCidrBlock *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 `type:"boolean"` - // The ID of the transit gateway route table. - // - // TransitGatewayRouteTableId is a required field - TransitGatewayRouteTableId *string `type:"string" required:"true"` + // The IP address assigned to the transit gateway multicast group. + GroupIpAddress *string `type:"string"` + + // The IDs of the group sources' network interfaces. + NetworkInterfaceIds []*string `locationNameList:"item" type:"list"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `type:"string"` } // String returns the string representation -func (s DeleteTransitGatewayRouteInput) String() string { +func (s DeregisterTransitGatewayMulticastGroupSourcesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTransitGatewayRouteInput) GoString() string { +func (s DeregisterTransitGatewayMulticastGroupSourcesInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTransitGatewayRouteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayRouteInput"} - if s.DestinationCidrBlock == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationCidrBlock")) - } - if s.TransitGatewayRouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetDryRun sets the DryRun field's value. +func (s *DeregisterTransitGatewayMulticastGroupSourcesInput) SetDryRun(v bool) *DeregisterTransitGatewayMulticastGroupSourcesInput { + s.DryRun = &v + return s } -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *DeleteTransitGatewayRouteInput) SetDestinationCidrBlock(v string) *DeleteTransitGatewayRouteInput { - s.DestinationCidrBlock = &v +// SetGroupIpAddress sets the GroupIpAddress field's value. +func (s *DeregisterTransitGatewayMulticastGroupSourcesInput) SetGroupIpAddress(v string) *DeregisterTransitGatewayMulticastGroupSourcesInput { + s.GroupIpAddress = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *DeleteTransitGatewayRouteInput) SetDryRun(v bool) *DeleteTransitGatewayRouteInput { - s.DryRun = &v +// SetNetworkInterfaceIds sets the NetworkInterfaceIds field's value. +func (s *DeregisterTransitGatewayMulticastGroupSourcesInput) SetNetworkInterfaceIds(v []*string) *DeregisterTransitGatewayMulticastGroupSourcesInput { + s.NetworkInterfaceIds = v return s } -// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value. -func (s *DeleteTransitGatewayRouteInput) SetTransitGatewayRouteTableId(v string) *DeleteTransitGatewayRouteInput { - s.TransitGatewayRouteTableId = &v +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *DeregisterTransitGatewayMulticastGroupSourcesInput) SetTransitGatewayMulticastDomainId(v string) *DeregisterTransitGatewayMulticastGroupSourcesInput { + s.TransitGatewayMulticastDomainId = &v return s } -type DeleteTransitGatewayRouteOutput struct { +type DeregisterTransitGatewayMulticastGroupSourcesOutput struct { _ struct{} `type:"structure"` - // Information about the route. - Route *TransitGatewayRoute `locationName:"route" type:"structure"` + // Information about the deregistered group sources. + DeregisteredMulticastGroupSources *TransitGatewayMulticastDeregisteredGroupSources `locationName:"deregisteredMulticastGroupSources" type:"structure"` } // String returns the string representation -func (s DeleteTransitGatewayRouteOutput) String() string { +func (s DeregisterTransitGatewayMulticastGroupSourcesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTransitGatewayRouteOutput) GoString() string { +func (s DeregisterTransitGatewayMulticastGroupSourcesOutput) GoString() string { return s.String() } -// SetRoute sets the Route field's value. -func (s *DeleteTransitGatewayRouteOutput) SetRoute(v *TransitGatewayRoute) *DeleteTransitGatewayRouteOutput { - s.Route = v +// SetDeregisteredMulticastGroupSources sets the DeregisteredMulticastGroupSources field's value. +func (s *DeregisterTransitGatewayMulticastGroupSourcesOutput) SetDeregisteredMulticastGroupSources(v *TransitGatewayMulticastDeregisteredGroupSources) *DeregisterTransitGatewayMulticastGroupSourcesOutput { + s.DeregisteredMulticastGroupSources = v return s } -type DeleteTransitGatewayRouteTableInput struct { +type DescribeAccountAttributesInput struct { _ struct{} `type:"structure"` + // The 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 `type:"boolean"` - - // The ID of the transit gateway route table. - // - // TransitGatewayRouteTableId is a required field - TransitGatewayRouteTableId *string `type:"string" required:"true"` + DryRun *bool `locationName:"dryRun" type:"boolean"` } // String returns the string representation -func (s DeleteTransitGatewayRouteTableInput) String() string { +func (s DescribeAccountAttributesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTransitGatewayRouteTableInput) GoString() string { +func (s DescribeAccountAttributesInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTransitGatewayRouteTableInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayRouteTableInput"} - if s.TransitGatewayRouteTableId == nil { - invalidParams.Add(request.NewErrParamRequired("TransitGatewayRouteTableId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// 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 *DeleteTransitGatewayRouteTableInput) SetDryRun(v bool) *DeleteTransitGatewayRouteTableInput { +func (s *DescribeAccountAttributesInput) SetDryRun(v bool) *DescribeAccountAttributesInput { s.DryRun = &v return s } -// SetTransitGatewayRouteTableId sets the TransitGatewayRouteTableId field's value. -func (s *DeleteTransitGatewayRouteTableInput) SetTransitGatewayRouteTableId(v string) *DeleteTransitGatewayRouteTableInput { - s.TransitGatewayRouteTableId = &v - return s -} - -type DeleteTransitGatewayRouteTableOutput struct { +type DescribeAccountAttributesOutput struct { _ struct{} `type:"structure"` - // Information about the deleted transit gateway route table. - TransitGatewayRouteTable *TransitGatewayRouteTable `locationName:"transitGatewayRouteTable" type:"structure"` + // Information about the account attributes. + AccountAttributes []*AccountAttribute `locationName:"accountAttributeSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DeleteTransitGatewayRouteTableOutput) String() string { +func (s DescribeAccountAttributesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTransitGatewayRouteTableOutput) GoString() string { +func (s DescribeAccountAttributesOutput) GoString() string { return s.String() } -// SetTransitGatewayRouteTable sets the TransitGatewayRouteTable field's value. -func (s *DeleteTransitGatewayRouteTableOutput) SetTransitGatewayRouteTable(v *TransitGatewayRouteTable) *DeleteTransitGatewayRouteTableOutput { - s.TransitGatewayRouteTable = v +// SetAccountAttributes sets the AccountAttributes field's value. +func (s *DescribeAccountAttributesOutput) SetAccountAttributes(v []*AccountAttribute) *DescribeAccountAttributesOutput { + s.AccountAttributes = v return s } -type DeleteTransitGatewayVpcAttachmentInput struct { +type DescribeAddressesInput struct { _ struct{} `type:"structure"` + // [EC2-VPC] Information about the allocation IDs. + 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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the attachment. + // One or more filters. Filter names and values are case-sensitive. // - // TransitGatewayAttachmentId is a required field - TransitGatewayAttachmentId *string `type:"string" required:"true"` + // * 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-border-group - The location from where the IP address is advertised. + // + // * 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. + // + // * tag: - The key/value combination of a tag assigned to the resource. + // Use the tag key in the filter name and the tag value as the filter value. + // For example, to find all resources that have a tag with the key Owner + // and the value TeamA, specify tag:Owner for the filter name and TeamA for + // the filter value. + // + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // 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 DeleteTransitGatewayVpcAttachmentInput) String() string { +func (s DescribeAddressesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTransitGatewayVpcAttachmentInput) GoString() string { +func (s DescribeAddressesInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTransitGatewayVpcAttachmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTransitGatewayVpcAttachmentInput"} - if s.TransitGatewayAttachmentId == nil { - invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// 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 *DeleteTransitGatewayVpcAttachmentInput) SetDryRun(v bool) *DeleteTransitGatewayVpcAttachmentInput { +func (s *DescribeAddressesInput) SetDryRun(v bool) *DescribeAddressesInput { s.DryRun = &v return s } -// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. -func (s *DeleteTransitGatewayVpcAttachmentInput) SetTransitGatewayAttachmentId(v string) *DeleteTransitGatewayVpcAttachmentInput { - s.TransitGatewayAttachmentId = &v +// SetFilters sets the Filters field's value. +func (s *DescribeAddressesInput) SetFilters(v []*Filter) *DescribeAddressesInput { + s.Filters = v return s } -type DeleteTransitGatewayVpcAttachmentOutput struct { +// SetPublicIps sets the PublicIps field's value. +func (s *DescribeAddressesInput) SetPublicIps(v []*string) *DescribeAddressesInput { + s.PublicIps = v + return s +} + +type DescribeAddressesOutput struct { _ struct{} `type:"structure"` - // Information about the deleted VPC attachment. - TransitGatewayVpcAttachment *TransitGatewayVpcAttachment `locationName:"transitGatewayVpcAttachment" type:"structure"` + // Information about the Elastic IP addresses. + Addresses []*Address `locationName:"addressesSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DeleteTransitGatewayVpcAttachmentOutput) String() string { +func (s DescribeAddressesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTransitGatewayVpcAttachmentOutput) GoString() string { +func (s DescribeAddressesOutput) GoString() string { return s.String() } -// SetTransitGatewayVpcAttachment sets the TransitGatewayVpcAttachment field's value. -func (s *DeleteTransitGatewayVpcAttachmentOutput) SetTransitGatewayVpcAttachment(v *TransitGatewayVpcAttachment) *DeleteTransitGatewayVpcAttachmentOutput { - s.TransitGatewayVpcAttachment = v +// SetAddresses sets the Addresses field's value. +func (s *DescribeAddressesOutput) SetAddresses(v []*Address) *DescribeAddressesOutput { + s.Addresses = v return s } -// Contains the parameters for DeleteVolume. -type DeleteVolumeInput struct { +type DescribeAggregateIdFormatInput 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"` + DryRun *bool `type:"boolean"` } // String returns the string representation -func (s DeleteVolumeInput) String() string { +func (s DescribeAggregateIdFormatInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVolumeInput) GoString() string { +func (s DescribeAggregateIdFormatInput) 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 { +func (s *DescribeAggregateIdFormatInput) SetDryRun(v bool) *DescribeAggregateIdFormatInput { s.DryRun = &v return s } -// SetVolumeId sets the VolumeId field's value. -func (s *DeleteVolumeInput) SetVolumeId(v string) *DeleteVolumeInput { - s.VolumeId = &v - return s -} - -type DeleteVolumeOutput struct { +type DescribeAggregateIdFormatOutput struct { _ struct{} `type:"structure"` + + // Information about each resource's ID format. + Statuses []*IdFormat `locationName:"statusSet" locationNameList:"item" type:"list"` + + // Indicates whether all resource types in the Region are configured to use + // longer IDs. This value is only true if all users are configured to use longer + // IDs for all resources types in the Region. + UseLongIdsAggregated *bool `locationName:"useLongIdsAggregated" type:"boolean"` } // String returns the string representation -func (s DeleteVolumeOutput) String() string { +func (s DescribeAggregateIdFormatOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVolumeOutput) GoString() string { +func (s DescribeAggregateIdFormatOutput) GoString() string { return s.String() } -type DeleteVpcEndpointConnectionNotificationsInput struct { +// SetStatuses sets the Statuses field's value. +func (s *DescribeAggregateIdFormatOutput) SetStatuses(v []*IdFormat) *DescribeAggregateIdFormatOutput { + s.Statuses = v + return s +} + +// SetUseLongIdsAggregated sets the UseLongIdsAggregated field's value. +func (s *DescribeAggregateIdFormatOutput) SetUseLongIdsAggregated(v bool) *DescribeAggregateIdFormatOutput { + s.UseLongIdsAggregated = &v + return s +} + +type DescribeAvailabilityZonesInput struct { _ struct{} `type:"structure"` - // One or more notification IDs. + // Include all Availability Zones and Local Zones regardless of your opt in + // status. // - // ConnectionNotificationIds is a required field - ConnectionNotificationIds []*string `locationName:"ConnectionNotificationId" locationNameList:"item" type:"list" required:"true"` + // If you do not use this parameter, the results include only the zones for + // the Regions where you have chosen the option to opt in. + AllAvailabilityZones *bool `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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` + + // The filters. + // + // * group-name - For Availability Zones, use the Region name. For Local + // Zones, use the name of the group associated with the Local Zone (for example, + // us-west-2-lax-1). + // + // * message - The Availability Zone or Local Zone message. + // + // * opt-in-status - The opt in status (opted-in, and not-opted-in | opt-in-not-required). + // + // * region-name - The name of the Region for the Availability Zone or Local + // Zone (for example, us-east-1). + // + // * state - The state of the Availability Zone or Local Zone (available + // | information | impaired | unavailable). + // + // * zone-id - The ID of the Availability Zone (for example, use1-az1) or + // the Local Zone (for example, use usw2-lax1-az1). + // + // * zone-name - The name of the Availability Zone (for example, us-east-1a) + // or the Local Zone (for example, use us-west-2-lax-1a). + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The IDs of the Availability Zones and Local Zones. + ZoneIds []*string `locationName:"ZoneId" locationNameList:"ZoneId" type:"list"` + + // The names of the Availability Zones and Local Zones. + ZoneNames []*string `locationName:"ZoneName" locationNameList:"ZoneName" type:"list"` } // String returns the string representation -func (s DeleteVpcEndpointConnectionNotificationsInput) String() string { +func (s DescribeAvailabilityZonesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpcEndpointConnectionNotificationsInput) GoString() string { +func (s DescribeAvailabilityZonesInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpcEndpointConnectionNotificationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpcEndpointConnectionNotificationsInput"} - if s.ConnectionNotificationIds == nil { - invalidParams.Add(request.NewErrParamRequired("ConnectionNotificationIds")) - } +// SetAllAvailabilityZones sets the AllAvailabilityZones field's value. +func (s *DescribeAvailabilityZonesInput) SetAllAvailabilityZones(v bool) *DescribeAvailabilityZonesInput { + s.AllAvailabilityZones = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetDryRun sets the DryRun field's value. +func (s *DescribeAvailabilityZonesInput) SetDryRun(v bool) *DescribeAvailabilityZonesInput { + s.DryRun = &v + return s } -// SetConnectionNotificationIds sets the ConnectionNotificationIds field's value. -func (s *DeleteVpcEndpointConnectionNotificationsInput) SetConnectionNotificationIds(v []*string) *DeleteVpcEndpointConnectionNotificationsInput { - s.ConnectionNotificationIds = v +// SetFilters sets the Filters field's value. +func (s *DescribeAvailabilityZonesInput) SetFilters(v []*Filter) *DescribeAvailabilityZonesInput { + s.Filters = v return s } -// SetDryRun sets the DryRun field's value. -func (s *DeleteVpcEndpointConnectionNotificationsInput) SetDryRun(v bool) *DeleteVpcEndpointConnectionNotificationsInput { - s.DryRun = &v +// SetZoneIds sets the ZoneIds field's value. +func (s *DescribeAvailabilityZonesInput) SetZoneIds(v []*string) *DescribeAvailabilityZonesInput { + s.ZoneIds = v return s } -type DeleteVpcEndpointConnectionNotificationsOutput struct { +// SetZoneNames sets the ZoneNames field's value. +func (s *DescribeAvailabilityZonesInput) SetZoneNames(v []*string) *DescribeAvailabilityZonesInput { + s.ZoneNames = v + return s +} + +type DescribeAvailabilityZonesOutput struct { _ struct{} `type:"structure"` - // Information about the notifications that could not be deleted successfully. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` + // Information about the Availability Zones and Local Zones. + AvailabilityZones []*AvailabilityZone `locationName:"availabilityZoneInfo" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DeleteVpcEndpointConnectionNotificationsOutput) String() string { +func (s DescribeAvailabilityZonesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpcEndpointConnectionNotificationsOutput) GoString() string { +func (s DescribeAvailabilityZonesOutput) GoString() string { return s.String() } -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *DeleteVpcEndpointConnectionNotificationsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *DeleteVpcEndpointConnectionNotificationsOutput { - s.Unsuccessful = v +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *DescribeAvailabilityZonesOutput) SetAvailabilityZones(v []*AvailabilityZone) *DescribeAvailabilityZonesOutput { + s.AvailabilityZones = v return s } -type DeleteVpcEndpointServiceConfigurationsInput struct { +type DescribeBundleTasksInput struct { _ struct{} `type:"structure"` + // The 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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // The IDs of one or more services. + // The filters. // - // ServiceIds is a required field - ServiceIds []*string `locationName:"ServiceId" locationNameList:"item" type:"list" required:"true"` + // * 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 DeleteVpcEndpointServiceConfigurationsInput) String() string { +func (s DescribeBundleTasksInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpcEndpointServiceConfigurationsInput) GoString() string { +func (s DescribeBundleTasksInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVpcEndpointServiceConfigurationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVpcEndpointServiceConfigurationsInput"} - if s.ServiceIds == nil { - invalidParams.Add(request.NewErrParamRequired("ServiceIds")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// 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 *DeleteVpcEndpointServiceConfigurationsInput) SetDryRun(v bool) *DeleteVpcEndpointServiceConfigurationsInput { +func (s *DescribeBundleTasksInput) SetDryRun(v bool) *DescribeBundleTasksInput { s.DryRun = &v return s } -// SetServiceIds sets the ServiceIds field's value. -func (s *DeleteVpcEndpointServiceConfigurationsInput) SetServiceIds(v []*string) *DeleteVpcEndpointServiceConfigurationsInput { - s.ServiceIds = v +// SetFilters sets the Filters field's value. +func (s *DescribeBundleTasksInput) SetFilters(v []*Filter) *DescribeBundleTasksInput { + s.Filters = v return s } -type DeleteVpcEndpointServiceConfigurationsOutput struct { +type DescribeBundleTasksOutput struct { _ struct{} `type:"structure"` - // Information about the service configurations that were not deleted, if applicable. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` + // Information about the bundle tasks. + BundleTasks []*BundleTask `locationName:"bundleInstanceTasksSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DeleteVpcEndpointServiceConfigurationsOutput) String() string { +func (s DescribeBundleTasksOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpcEndpointServiceConfigurationsOutput) GoString() string { +func (s DescribeBundleTasksOutput) GoString() string { return s.String() } -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *DeleteVpcEndpointServiceConfigurationsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *DeleteVpcEndpointServiceConfigurationsOutput { - s.Unsuccessful = v +// SetBundleTasks sets the BundleTasks field's value. +func (s *DescribeBundleTasksOutput) SetBundleTasks(v []*BundleTask) *DescribeBundleTasksOutput { + s.BundleTasks = v return s } -// Contains the parameters for DeleteVpcEndpoints. -type DeleteVpcEndpointsInput struct { +type DescribeByoipCidrsInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -48087,27 +55117,34 @@ type DeleteVpcEndpointsInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // One or more VPC endpoint IDs. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. // - // VpcEndpointIds is a required field - VpcEndpointIds []*string `locationName:"VpcEndpointId" locationNameList:"item" type:"list" required:"true"` + // MaxResults is a required field + MaxResults *int64 `min:"1" type:"integer" required:"true"` + + // The token for the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DeleteVpcEndpointsInput) String() string { +func (s DescribeByoipCidrsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpcEndpointsInput) GoString() string { +func (s DescribeByoipCidrsInput) 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")) +func (s *DescribeByoipCidrsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeByoipCidrsInput"} + if s.MaxResults == nil { + invalidParams.Add(request.NewErrParamRequired("MaxResults")) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -48117,71 +55154,95 @@ func (s *DeleteVpcEndpointsInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteVpcEndpointsInput) SetDryRun(v bool) *DeleteVpcEndpointsInput { +func (s *DescribeByoipCidrsInput) SetDryRun(v bool) *DescribeByoipCidrsInput { s.DryRun = &v return s } -// SetVpcEndpointIds sets the VpcEndpointIds field's value. -func (s *DeleteVpcEndpointsInput) SetVpcEndpointIds(v []*string) *DeleteVpcEndpointsInput { - s.VpcEndpointIds = v +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeByoipCidrsInput) SetMaxResults(v int64) *DescribeByoipCidrsInput { + s.MaxResults = &v return s } -// Contains the output of DeleteVpcEndpoints. -type DeleteVpcEndpointsOutput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeByoipCidrsInput) SetNextToken(v string) *DescribeByoipCidrsInput { + s.NextToken = &v + return s +} + +type DescribeByoipCidrsOutput struct { _ struct{} `type:"structure"` - // Information about the VPC endpoints that were not successfully deleted. - Unsuccessful []*UnsuccessfulItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` + // Information about your address ranges. + ByoipCidrs []*ByoipCidr `locationName:"byoipCidrSet" 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 DeleteVpcEndpointsOutput) String() string { +func (s DescribeByoipCidrsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpcEndpointsOutput) GoString() string { +func (s DescribeByoipCidrsOutput) GoString() string { return s.String() } -// SetUnsuccessful sets the Unsuccessful field's value. -func (s *DeleteVpcEndpointsOutput) SetUnsuccessful(v []*UnsuccessfulItem) *DeleteVpcEndpointsOutput { - s.Unsuccessful = v +// SetByoipCidrs sets the ByoipCidrs field's value. +func (s *DescribeByoipCidrsOutput) SetByoipCidrs(v []*ByoipCidr) *DescribeByoipCidrsOutput { + s.ByoipCidrs = v return s } -type DeleteVpcInput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeByoipCidrsOutput) SetNextToken(v string) *DescribeByoipCidrsOutput { + s.NextToken = &v + return s +} + +type DescribeCapacityReservationsInput struct { _ struct{} `type:"structure"` + // The ID of the Capacity Reservation. + CapacityReservationIds []*string `locationName:"CapacityReservationId" 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"` + DryRun *bool `type:"boolean"` - // The ID of the VPC. - // - // VpcId is a required field - VpcId *string `type:"string" required:"true"` + // One or more filters. + 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 can be seen by sending another request with the returned + // nextToken value. + MaxResults *int64 `min:"1" type:"integer"` + + // The token to retrieve the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DeleteVpcInput) String() string { +func (s DescribeCapacityReservationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpcInput) GoString() string { +func (s DescribeCapacityReservationsInput) 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")) +func (s *DescribeCapacityReservationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeCapacityReservationsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -48190,33 +55251,70 @@ func (s *DeleteVpcInput) Validate() error { return nil } +// SetCapacityReservationIds sets the CapacityReservationIds field's value. +func (s *DescribeCapacityReservationsInput) SetCapacityReservationIds(v []*string) *DescribeCapacityReservationsInput { + s.CapacityReservationIds = v + return s +} + // SetDryRun sets the DryRun field's value. -func (s *DeleteVpcInput) SetDryRun(v bool) *DeleteVpcInput { +func (s *DescribeCapacityReservationsInput) SetDryRun(v bool) *DescribeCapacityReservationsInput { s.DryRun = &v return s } -// SetVpcId sets the VpcId field's value. -func (s *DeleteVpcInput) SetVpcId(v string) *DeleteVpcInput { - s.VpcId = &v +// SetFilters sets the Filters field's value. +func (s *DescribeCapacityReservationsInput) SetFilters(v []*Filter) *DescribeCapacityReservationsInput { + s.Filters = v return s } -type DeleteVpcOutput struct { +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeCapacityReservationsInput) SetMaxResults(v int64) *DescribeCapacityReservationsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeCapacityReservationsInput) SetNextToken(v string) *DescribeCapacityReservationsInput { + s.NextToken = &v + return s +} + +type DescribeCapacityReservationsOutput struct { _ struct{} `type:"structure"` + + // Information about the Capacity Reservations. + CapacityReservations []*CapacityReservation `locationName:"capacityReservationSet" 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 DeleteVpcOutput) String() string { +func (s DescribeCapacityReservationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpcOutput) GoString() string { +func (s DescribeCapacityReservationsOutput) GoString() string { return s.String() } -type DeleteVpcPeeringConnectionInput struct { +// SetCapacityReservations sets the CapacityReservations field's value. +func (s *DescribeCapacityReservationsOutput) SetCapacityReservations(v []*CapacityReservation) *DescribeCapacityReservationsOutput { + s.CapacityReservations = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeCapacityReservationsOutput) SetNextToken(v string) *DescribeCapacityReservationsOutput { + s.NextToken = &v + return s +} + +type DescribeClassicLinkInstancesInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -48225,27 +55323,55 @@ type DeleteVpcPeeringConnectionInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The ID of the VPC peering connection. + // One or more filters. // - // VpcPeeringConnectionId is a required field - VpcPeeringConnectionId *string `locationName:"vpcPeeringConnectionId" type:"string" required:"true"` + // * group-id - The ID of a VPC security group that's associated with the + // instance. + // + // * instance-id - The ID of the instance. + // + // * tag: - The key/value combination of a tag assigned to the resource. + // Use the tag key in the filter name and the tag value as the filter value. + // For example, to find all resources that have a tag with the key Owner + // and the value TeamA, specify tag:Owner for the filter name and TeamA for + // the filter value. + // + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. + // + // * vpc-id - The ID of the VPC to which the instance is linked. 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 with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + // + // Constraint: If the value is greater than 1000, we return only 1000 items. + MaxResults *int64 `locationName:"maxResults" min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation -func (s DeleteVpcPeeringConnectionInput) String() string { +func (s DescribeClassicLinkInstancesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpcPeeringConnectionInput) GoString() string { +func (s DescribeClassicLinkInstancesInput) 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")) +func (s *DescribeClassicLinkInstancesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeClassicLinkInstancesInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) } if invalidParams.Len() > 0 { @@ -48255,71 +55381,120 @@ func (s *DeleteVpcPeeringConnectionInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DeleteVpcPeeringConnectionInput) SetDryRun(v bool) *DeleteVpcPeeringConnectionInput { +func (s *DescribeClassicLinkInstancesInput) SetDryRun(v bool) *DescribeClassicLinkInstancesInput { s.DryRun = &v return s } -// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. -func (s *DeleteVpcPeeringConnectionInput) SetVpcPeeringConnectionId(v string) *DeleteVpcPeeringConnectionInput { - s.VpcPeeringConnectionId = &v +// SetFilters sets the Filters field's value. +func (s *DescribeClassicLinkInstancesInput) SetFilters(v []*Filter) *DescribeClassicLinkInstancesInput { + s.Filters = v return s } -type DeleteVpcPeeringConnectionOutput struct { +// 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 +} + +type DescribeClassicLinkInstancesOutput struct { _ struct{} `type:"structure"` - // Returns true if the request succeeds; otherwise, it returns an error. - Return *bool `locationName:"return" type:"boolean"` + // 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 DeleteVpcPeeringConnectionOutput) String() string { +func (s DescribeClassicLinkInstancesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpcPeeringConnectionOutput) GoString() string { +func (s DescribeClassicLinkInstancesOutput) GoString() string { return s.String() } -// SetReturn sets the Return field's value. -func (s *DeleteVpcPeeringConnectionOutput) SetReturn(v bool) *DeleteVpcPeeringConnectionOutput { - s.Return = &v +// SetInstances sets the Instances field's value. +func (s *DescribeClassicLinkInstancesOutput) SetInstances(v []*ClassicLinkInstance) *DescribeClassicLinkInstancesOutput { + s.Instances = v return s } -// Contains the parameters for DeleteVpnConnection. -type DeleteVpnConnectionInput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeClassicLinkInstancesOutput) SetNextToken(v string) *DescribeClassicLinkInstancesOutput { + s.NextToken = &v + return s +} + +type DescribeClientVpnAuthorizationRulesInput struct { _ struct{} `type:"structure"` + // The ID of the Client VPN endpoint. + // + // ClientVpnEndpointId is a required field + ClientVpnEndpointId *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"` + DryRun *bool `type:"boolean"` - // The ID of the VPN connection. + // One or more filters. Filter names and values are case-sensitive. // - // VpnConnectionId is a required field - VpnConnectionId *string `type:"string" required:"true"` + // * description - The description of the authorization rule. + // + // * destination-cidr - The CIDR of the network to which the authorization + // rule applies. + // + // * group-id - The ID of the Active Directory group to which the authorization + // rule grants access. + 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 can be seen by sending another request with the nextToken + // value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token to retrieve the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DeleteVpnConnectionInput) String() string { +func (s DescribeClientVpnAuthorizationRulesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpnConnectionInput) GoString() string { +func (s DescribeClientVpnAuthorizationRulesInput) 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")) +func (s *DescribeClientVpnAuthorizationRulesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeClientVpnAuthorizationRulesInput"} + if s.ClientVpnEndpointId == nil { + invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) + } + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) } if invalidParams.Len() > 0 { @@ -48328,65 +55503,118 @@ func (s *DeleteVpnConnectionInput) Validate() error { return nil } +// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. +func (s *DescribeClientVpnAuthorizationRulesInput) SetClientVpnEndpointId(v string) *DescribeClientVpnAuthorizationRulesInput { + s.ClientVpnEndpointId = &v + return s +} + // SetDryRun sets the DryRun field's value. -func (s *DeleteVpnConnectionInput) SetDryRun(v bool) *DeleteVpnConnectionInput { +func (s *DescribeClientVpnAuthorizationRulesInput) SetDryRun(v bool) *DescribeClientVpnAuthorizationRulesInput { s.DryRun = &v return s } -// SetVpnConnectionId sets the VpnConnectionId field's value. -func (s *DeleteVpnConnectionInput) SetVpnConnectionId(v string) *DeleteVpnConnectionInput { - s.VpnConnectionId = &v +// SetFilters sets the Filters field's value. +func (s *DescribeClientVpnAuthorizationRulesInput) SetFilters(v []*Filter) *DescribeClientVpnAuthorizationRulesInput { + s.Filters = v return s } -type DeleteVpnConnectionOutput struct { +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeClientVpnAuthorizationRulesInput) SetMaxResults(v int64) *DescribeClientVpnAuthorizationRulesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeClientVpnAuthorizationRulesInput) SetNextToken(v string) *DescribeClientVpnAuthorizationRulesInput { + s.NextToken = &v + return s +} + +type DescribeClientVpnAuthorizationRulesOutput struct { _ struct{} `type:"structure"` + + // Information about the authorization rules. + AuthorizationRules []*AuthorizationRule `locationName:"authorizationRule" 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 DeleteVpnConnectionOutput) String() string { +func (s DescribeClientVpnAuthorizationRulesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpnConnectionOutput) GoString() string { +func (s DescribeClientVpnAuthorizationRulesOutput) GoString() string { return s.String() } -// Contains the parameters for DeleteVpnConnectionRoute. -type DeleteVpnConnectionRouteInput struct { +// SetAuthorizationRules sets the AuthorizationRules field's value. +func (s *DescribeClientVpnAuthorizationRulesOutput) SetAuthorizationRules(v []*AuthorizationRule) *DescribeClientVpnAuthorizationRulesOutput { + s.AuthorizationRules = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeClientVpnAuthorizationRulesOutput) SetNextToken(v string) *DescribeClientVpnAuthorizationRulesOutput { + s.NextToken = &v + return s +} + +type DescribeClientVpnConnectionsInput struct { _ struct{} `type:"structure"` - // The CIDR block associated with the local subnet of the customer network. + // The ID of the Client VPN endpoint. // - // DestinationCidrBlock is a required field - DestinationCidrBlock *string `type:"string" required:"true"` + // ClientVpnEndpointId is a required field + ClientVpnEndpointId *string `type:"string" required:"true"` - // The ID of the VPN connection. + // Checks whether you have the required permissions for the action, without + // actually making 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. Filter names and values are case-sensitive. // - // VpnConnectionId is a required field - VpnConnectionId *string `type:"string" required:"true"` + // * connection-id - The ID of the connection. + // + // * username - For Active Directory client authentication, the user name + // of the client who established the client connection. + 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 can be seen by sending another request with the nextToken + // value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token to retrieve the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DeleteVpnConnectionRouteInput) String() string { +func (s DescribeClientVpnConnectionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpnConnectionRouteInput) GoString() string { +func (s DescribeClientVpnConnectionsInput) 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")) +func (s *DescribeClientVpnConnectionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeClientVpnConnectionsInput"} + if s.ClientVpnEndpointId == nil { + invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) } - if s.VpnConnectionId == nil { - invalidParams.Add(request.NewErrParamRequired("VpnConnectionId")) + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) } if invalidParams.Len() > 0 { @@ -48395,63 +55623,112 @@ func (s *DeleteVpnConnectionRouteInput) Validate() error { return nil } -// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. -func (s *DeleteVpnConnectionRouteInput) SetDestinationCidrBlock(v string) *DeleteVpnConnectionRouteInput { - s.DestinationCidrBlock = &v +// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. +func (s *DescribeClientVpnConnectionsInput) SetClientVpnEndpointId(v string) *DescribeClientVpnConnectionsInput { + s.ClientVpnEndpointId = &v return s } -// SetVpnConnectionId sets the VpnConnectionId field's value. -func (s *DeleteVpnConnectionRouteInput) SetVpnConnectionId(v string) *DeleteVpnConnectionRouteInput { - s.VpnConnectionId = &v +// SetDryRun sets the DryRun field's value. +func (s *DescribeClientVpnConnectionsInput) SetDryRun(v bool) *DescribeClientVpnConnectionsInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeClientVpnConnectionsInput) SetFilters(v []*Filter) *DescribeClientVpnConnectionsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeClientVpnConnectionsInput) SetMaxResults(v int64) *DescribeClientVpnConnectionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeClientVpnConnectionsInput) SetNextToken(v string) *DescribeClientVpnConnectionsInput { + s.NextToken = &v return s } -type DeleteVpnConnectionRouteOutput struct { - _ struct{} `type:"structure"` +type DescribeClientVpnConnectionsOutput struct { + _ struct{} `type:"structure"` + + // Information about the active and terminated client connections. + Connections []*ClientVpnConnection `locationName:"connections" 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 DeleteVpnConnectionRouteOutput) String() string { +func (s DescribeClientVpnConnectionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpnConnectionRouteOutput) GoString() string { +func (s DescribeClientVpnConnectionsOutput) GoString() string { return s.String() } -// Contains the parameters for DeleteVpnGateway. -type DeleteVpnGatewayInput struct { +// SetConnections sets the Connections field's value. +func (s *DescribeClientVpnConnectionsOutput) SetConnections(v []*ClientVpnConnection) *DescribeClientVpnConnectionsOutput { + s.Connections = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeClientVpnConnectionsOutput) SetNextToken(v string) *DescribeClientVpnConnectionsOutput { + s.NextToken = &v + return s +} + +type DescribeClientVpnEndpointsInput struct { _ struct{} `type:"structure"` + // The ID of the Client VPN endpoint. + ClientVpnEndpointIds []*string `locationName:"ClientVpnEndpointId" 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"` + DryRun *bool `type:"boolean"` - // The ID of the virtual private gateway. + // One or more filters. Filter names and values are case-sensitive. // - // VpnGatewayId is a required field - VpnGatewayId *string `type:"string" required:"true"` + // * endpoint-id - The ID of the Client VPN endpoint. + // + // * transport-protocol - The transport protocol (tcp | udp). + 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 can be seen by sending another request with the nextToken + // value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token to retrieve the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DeleteVpnGatewayInput) String() string { +func (s DescribeClientVpnEndpointsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpnGatewayInput) GoString() string { +func (s DescribeClientVpnEndpointsInput) 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")) +func (s *DescribeClientVpnEndpointsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeClientVpnEndpointsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) } if invalidParams.Len() > 0 { @@ -48460,63 +55737,120 @@ func (s *DeleteVpnGatewayInput) Validate() error { return nil } +// SetClientVpnEndpointIds sets the ClientVpnEndpointIds field's value. +func (s *DescribeClientVpnEndpointsInput) SetClientVpnEndpointIds(v []*string) *DescribeClientVpnEndpointsInput { + s.ClientVpnEndpointIds = v + return s +} + // SetDryRun sets the DryRun field's value. -func (s *DeleteVpnGatewayInput) SetDryRun(v bool) *DeleteVpnGatewayInput { +func (s *DescribeClientVpnEndpointsInput) SetDryRun(v bool) *DescribeClientVpnEndpointsInput { s.DryRun = &v return s } -// SetVpnGatewayId sets the VpnGatewayId field's value. -func (s *DeleteVpnGatewayInput) SetVpnGatewayId(v string) *DeleteVpnGatewayInput { - s.VpnGatewayId = &v +// SetFilters sets the Filters field's value. +func (s *DescribeClientVpnEndpointsInput) SetFilters(v []*Filter) *DescribeClientVpnEndpointsInput { + s.Filters = v return s } -type DeleteVpnGatewayOutput struct { +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeClientVpnEndpointsInput) SetMaxResults(v int64) *DescribeClientVpnEndpointsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeClientVpnEndpointsInput) SetNextToken(v string) *DescribeClientVpnEndpointsInput { + s.NextToken = &v + return s +} + +type DescribeClientVpnEndpointsOutput struct { _ struct{} `type:"structure"` + + // Information about the Client VPN endpoints. + ClientVpnEndpoints []*ClientVpnEndpoint `locationName:"clientVpnEndpoint" 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 DeleteVpnGatewayOutput) String() string { +func (s DescribeClientVpnEndpointsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVpnGatewayOutput) GoString() string { +func (s DescribeClientVpnEndpointsOutput) GoString() string { return s.String() } -type DeprovisionByoipCidrInput struct { +// SetClientVpnEndpoints sets the ClientVpnEndpoints field's value. +func (s *DescribeClientVpnEndpointsOutput) SetClientVpnEndpoints(v []*ClientVpnEndpoint) *DescribeClientVpnEndpointsOutput { + s.ClientVpnEndpoints = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeClientVpnEndpointsOutput) SetNextToken(v string) *DescribeClientVpnEndpointsOutput { + s.NextToken = &v + return s +} + +type DescribeClientVpnRoutesInput struct { _ struct{} `type:"structure"` - // The public IPv4 address range, in CIDR notation. The prefix must be the same - // prefix that you specified when you provisioned the address range. + // The ID of the Client VPN endpoint. // - // Cidr is a required field - Cidr *string `type:"string" required:"true"` + // ClientVpnEndpointId is a required field + ClientVpnEndpointId *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 `type:"boolean"` + + // One or more filters. Filter names and values are case-sensitive. + // + // * destination-cidr - The CIDR of the route destination. + // + // * origin - How the route was associated with the Client VPN endpoint (associate + // | add-route). + // + // * target-subnet - The ID of the subnet through which traffic is routed. + 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 can be seen by sending another request with the nextToken + // value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token to retrieve the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DeprovisionByoipCidrInput) String() string { +func (s DescribeClientVpnRoutesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeprovisionByoipCidrInput) GoString() string { +func (s DescribeClientVpnRoutesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeprovisionByoipCidrInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeprovisionByoipCidrInput"} - if s.Cidr == nil { - invalidParams.Add(request.NewErrParamRequired("Cidr")) +func (s *DescribeClientVpnRoutesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeClientVpnRoutesInput"} + if s.ClientVpnEndpointId == nil { + invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) + } + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) } if invalidParams.Len() > 0 { @@ -48525,72 +55859,122 @@ func (s *DeprovisionByoipCidrInput) Validate() error { return nil } -// SetCidr sets the Cidr field's value. -func (s *DeprovisionByoipCidrInput) SetCidr(v string) *DeprovisionByoipCidrInput { - s.Cidr = &v +// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. +func (s *DescribeClientVpnRoutesInput) SetClientVpnEndpointId(v string) *DescribeClientVpnRoutesInput { + s.ClientVpnEndpointId = &v return s } // SetDryRun sets the DryRun field's value. -func (s *DeprovisionByoipCidrInput) SetDryRun(v bool) *DeprovisionByoipCidrInput { +func (s *DescribeClientVpnRoutesInput) SetDryRun(v bool) *DescribeClientVpnRoutesInput { s.DryRun = &v return s } -type DeprovisionByoipCidrOutput struct { +// SetFilters sets the Filters field's value. +func (s *DescribeClientVpnRoutesInput) SetFilters(v []*Filter) *DescribeClientVpnRoutesInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeClientVpnRoutesInput) SetMaxResults(v int64) *DescribeClientVpnRoutesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeClientVpnRoutesInput) SetNextToken(v string) *DescribeClientVpnRoutesInput { + s.NextToken = &v + return s +} + +type DescribeClientVpnRoutesOutput struct { _ struct{} `type:"structure"` - // Information about the address range. - ByoipCidr *ByoipCidr `locationName:"byoipCidr" 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 Client VPN endpoint routes. + Routes []*ClientVpnRoute `locationName:"routes" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DeprovisionByoipCidrOutput) String() string { +func (s DescribeClientVpnRoutesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeprovisionByoipCidrOutput) GoString() string { +func (s DescribeClientVpnRoutesOutput) GoString() string { return s.String() } -// SetByoipCidr sets the ByoipCidr field's value. -func (s *DeprovisionByoipCidrOutput) SetByoipCidr(v *ByoipCidr) *DeprovisionByoipCidrOutput { - s.ByoipCidr = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeClientVpnRoutesOutput) SetNextToken(v string) *DescribeClientVpnRoutesOutput { + s.NextToken = &v return s } -// Contains the parameters for DeregisterImage. -type DeregisterImageInput struct { +// SetRoutes sets the Routes field's value. +func (s *DescribeClientVpnRoutesOutput) SetRoutes(v []*ClientVpnRoute) *DescribeClientVpnRoutesOutput { + s.Routes = v + return s +} + +type DescribeClientVpnTargetNetworksInput struct { _ struct{} `type:"structure"` + // The IDs of the target network associations. + AssociationIds []*string `locationNameList:"item" type:"list"` + + // The ID of the Client VPN endpoint. + // + // ClientVpnEndpointId is a required field + ClientVpnEndpointId *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"` + DryRun *bool `type:"boolean"` - // The ID of the AMI. + // One or more filters. Filter names and values are case-sensitive. // - // ImageId is a required field - ImageId *string `type:"string" required:"true"` + // * association-id - The ID of the association. + // + // * target-network-id - The ID of the subnet specified as the target network. + // + // * vpc-id - The ID of the VPC in which the target network is located. + 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 can be seen by sending another request with the nextToken + // value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token to retrieve the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DeregisterImageInput) String() string { +func (s DescribeClientVpnTargetNetworksInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeregisterImageInput) GoString() string { +func (s DescribeClientVpnTargetNetworksInput) 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")) +func (s *DescribeClientVpnTargetNetworksInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeClientVpnTargetNetworksInput"} + if s.ClientVpnEndpointId == nil { + invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) + } + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) } if invalidParams.Len() > 0 { @@ -48599,353 +55983,348 @@ func (s *DeregisterImageInput) Validate() error { return nil } -// SetDryRun sets the DryRun field's value. -func (s *DeregisterImageInput) SetDryRun(v bool) *DeregisterImageInput { - s.DryRun = &v +// SetAssociationIds sets the AssociationIds field's value. +func (s *DescribeClientVpnTargetNetworksInput) SetAssociationIds(v []*string) *DescribeClientVpnTargetNetworksInput { + s.AssociationIds = v return s } -// SetImageId sets the ImageId field's value. -func (s *DeregisterImageInput) SetImageId(v string) *DeregisterImageInput { - s.ImageId = &v +// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. +func (s *DescribeClientVpnTargetNetworksInput) SetClientVpnEndpointId(v string) *DescribeClientVpnTargetNetworksInput { + s.ClientVpnEndpointId = &v return s } -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() -} - -type DescribeAccountAttributesInput struct { - _ struct{} `type:"structure"` - - // The 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) +// SetDryRun sets the DryRun field's value. +func (s *DescribeClientVpnTargetNetworksInput) SetDryRun(v bool) *DescribeClientVpnTargetNetworksInput { + s.DryRun = &v + return s } -// GoString returns the string representation -func (s DescribeAccountAttributesInput) GoString() string { - return s.String() +// SetFilters sets the Filters field's value. +func (s *DescribeClientVpnTargetNetworksInput) SetFilters(v []*Filter) *DescribeClientVpnTargetNetworksInput { + s.Filters = v + return s } -// SetAttributeNames sets the AttributeNames field's value. -func (s *DescribeAccountAttributesInput) SetAttributeNames(v []*string) *DescribeAccountAttributesInput { - s.AttributeNames = v +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeClientVpnTargetNetworksInput) SetMaxResults(v int64) *DescribeClientVpnTargetNetworksInput { + s.MaxResults = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *DescribeAccountAttributesInput) SetDryRun(v bool) *DescribeAccountAttributesInput { - s.DryRun = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeClientVpnTargetNetworksInput) SetNextToken(v string) *DescribeClientVpnTargetNetworksInput { + s.NextToken = &v return s } -type DescribeAccountAttributesOutput struct { +type DescribeClientVpnTargetNetworksOutput struct { _ struct{} `type:"structure"` - // Information about the account attributes. - AccountAttributes []*AccountAttribute `locationName:"accountAttributeSet" locationNameList:"item" type:"list"` + // Information about the associated target networks. + ClientVpnTargetNetworks []*TargetNetwork `locationName:"clientVpnTargetNetworks" 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 DescribeAccountAttributesOutput) String() string { +func (s DescribeClientVpnTargetNetworksOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAccountAttributesOutput) GoString() string { +func (s DescribeClientVpnTargetNetworksOutput) GoString() string { return s.String() } -// SetAccountAttributes sets the AccountAttributes field's value. -func (s *DescribeAccountAttributesOutput) SetAccountAttributes(v []*AccountAttribute) *DescribeAccountAttributesOutput { - s.AccountAttributes = v +// SetClientVpnTargetNetworks sets the ClientVpnTargetNetworks field's value. +func (s *DescribeClientVpnTargetNetworksOutput) SetClientVpnTargetNetworks(v []*TargetNetwork) *DescribeClientVpnTargetNetworksOutput { + s.ClientVpnTargetNetworks = v return s } -type DescribeAddressesInput struct { - _ struct{} `type:"structure"` +// SetNextToken sets the NextToken field's value. +func (s *DescribeClientVpnTargetNetworksOutput) SetNextToken(v string) *DescribeClientVpnTargetNetworksOutput { + s.NextToken = &v + return s +} - // [EC2-VPC] Information about the allocation IDs. - AllocationIds []*string `locationName:"AllocationId" locationNameList:"AllocationId" type:"list"` +type DescribeCoipPoolsInput 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"` + DryRun *bool `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. + // The filters. The following are the possible values: // - // * tag: - The key/value combination of a tag assigned to the resource. - // Use the tag key in the filter name and the tag value as the filter value. - // For example, to find all resources that have a tag with the key Owner - // and the value TeamA, specify tag:Owner for the filter name and TeamA for - // the filter value. + // * coip-pool.pool-id // - // * tag-key - The key of a tag assigned to the resource. Use this filter - // to find all resources assigned a tag with a specific key, regardless of - // the tag value. + // * coip-pool.local-gateway-route-table-id Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // One or more Elastic IP addresses. - // - // Default: Describes all your Elastic IP addresses. - PublicIps []*string `locationName:"PublicIp" locationNameList:"PublicIp" type:"list"` + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + + // The IDs of the address pools. + PoolIds []*string `locationName:"PoolId" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DescribeAddressesInput) String() string { +func (s DescribeCoipPoolsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAddressesInput) GoString() string { +func (s DescribeCoipPoolsInput) GoString() string { return s.String() } -// SetAllocationIds sets the AllocationIds field's value. -func (s *DescribeAddressesInput) SetAllocationIds(v []*string) *DescribeAddressesInput { - s.AllocationIds = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeCoipPoolsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeCoipPoolsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } // SetDryRun sets the DryRun field's value. -func (s *DescribeAddressesInput) SetDryRun(v bool) *DescribeAddressesInput { +func (s *DescribeCoipPoolsInput) SetDryRun(v bool) *DescribeCoipPoolsInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeAddressesInput) SetFilters(v []*Filter) *DescribeAddressesInput { +func (s *DescribeCoipPoolsInput) SetFilters(v []*Filter) *DescribeCoipPoolsInput { s.Filters = v return s } -// SetPublicIps sets the PublicIps field's value. -func (s *DescribeAddressesInput) SetPublicIps(v []*string) *DescribeAddressesInput { - s.PublicIps = v +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeCoipPoolsInput) SetMaxResults(v int64) *DescribeCoipPoolsInput { + s.MaxResults = &v return s } -type DescribeAddressesOutput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeCoipPoolsInput) SetNextToken(v string) *DescribeCoipPoolsInput { + s.NextToken = &v + return s +} + +// SetPoolIds sets the PoolIds field's value. +func (s *DescribeCoipPoolsInput) SetPoolIds(v []*string) *DescribeCoipPoolsInput { + s.PoolIds = v + return s +} + +type DescribeCoipPoolsOutput struct { _ struct{} `type:"structure"` - // Information about the Elastic IP addresses. - Addresses []*Address `locationName:"addressesSet" locationNameList:"item" type:"list"` + // Information about the address pools. + CoipPools []*CoipPool `locationName:"coipPoolSet" 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 DescribeAddressesOutput) String() string { +func (s DescribeCoipPoolsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAddressesOutput) GoString() string { +func (s DescribeCoipPoolsOutput) GoString() string { return s.String() } -// SetAddresses sets the Addresses field's value. -func (s *DescribeAddressesOutput) SetAddresses(v []*Address) *DescribeAddressesOutput { - s.Addresses = v +// SetCoipPools sets the CoipPools field's value. +func (s *DescribeCoipPoolsOutput) SetCoipPools(v []*CoipPool) *DescribeCoipPoolsOutput { + s.CoipPools = v return s } -type DescribeAggregateIdFormatInput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeCoipPoolsOutput) SetNextToken(v string) *DescribeCoipPoolsOutput { + s.NextToken = &v + return s +} + +type DescribeConversionTasksInput struct { _ struct{} `type:"structure"` + // The 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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` } // String returns the string representation -func (s DescribeAggregateIdFormatInput) String() string { +func (s DescribeConversionTasksInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAggregateIdFormatInput) GoString() string { +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 *DescribeAggregateIdFormatInput) SetDryRun(v bool) *DescribeAggregateIdFormatInput { +func (s *DescribeConversionTasksInput) SetDryRun(v bool) *DescribeConversionTasksInput { s.DryRun = &v return s } -type DescribeAggregateIdFormatOutput struct { +type DescribeConversionTasksOutput struct { _ struct{} `type:"structure"` - // Information about each resource's ID format. - Statuses []*IdFormat `locationName:"statusSet" locationNameList:"item" type:"list"` - - // Indicates whether all resource types in the Region are configured to use - // longer IDs. This value is only true if all users are configured to use longer - // IDs for all resources types in the Region. - UseLongIdsAggregated *bool `locationName:"useLongIdsAggregated" type:"boolean"` + // Information about the conversion tasks. + ConversionTasks []*ConversionTask `locationName:"conversionTasks" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DescribeAggregateIdFormatOutput) String() string { +func (s DescribeConversionTasksOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAggregateIdFormatOutput) GoString() string { +func (s DescribeConversionTasksOutput) GoString() string { return s.String() } -// SetStatuses sets the Statuses field's value. -func (s *DescribeAggregateIdFormatOutput) SetStatuses(v []*IdFormat) *DescribeAggregateIdFormatOutput { - s.Statuses = v - return s -} - -// SetUseLongIdsAggregated sets the UseLongIdsAggregated field's value. -func (s *DescribeAggregateIdFormatOutput) SetUseLongIdsAggregated(v bool) *DescribeAggregateIdFormatOutput { - s.UseLongIdsAggregated = &v +// SetConversionTasks sets the ConversionTasks field's value. +func (s *DescribeConversionTasksOutput) SetConversionTasks(v []*ConversionTask) *DescribeConversionTasksOutput { + s.ConversionTasks = v return s } -type DescribeAvailabilityZonesInput struct { +// Contains the parameters for DescribeCustomerGateways. +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"` - // The filters. + // 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. // - // * message - Information about the Availability Zone. + // * ip-address - The IP address of the customer gateway's Internet-routable + // external interface. // - // * region-name - The name of the Region for the Availability Zone (for - // example, us-east-1). + // * state - The state of the customer gateway (pending | available | deleting + // | deleted). // - // * state - The state of the Availability Zone (available | information - // | impaired | unavailable). + // * type - The type of customer gateway. Currently, the only supported type + // is ipsec.1. // - // * zone-id - The ID of the Availability Zone (for example, use1-az1). + // * tag: - The key/value combination of a tag assigned to the resource. + // Use the tag key in the filter name and the tag value as the filter value. + // For example, to find all resources that have a tag with the key Owner + // and the value TeamA, specify tag:Owner for the filter name and TeamA for + // the filter value. // - // * zone-name - The name of the Availability Zone (for example, us-east-1a). + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The IDs of the Availability Zones. - ZoneIds []*string `locationName:"ZoneId" locationNameList:"ZoneId" type:"list"` - - // The names of the Availability Zones. - ZoneNames []*string `locationName:"ZoneName" locationNameList:"ZoneName" type:"list"` } // String returns the string representation -func (s DescribeAvailabilityZonesInput) String() string { +func (s DescribeCustomerGatewaysInput) String() string { return awsutil.Prettify(s) } -// GoString returns the string representation -func (s DescribeAvailabilityZonesInput) GoString() string { - return s.String() +// 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 *DescribeAvailabilityZonesInput) SetDryRun(v bool) *DescribeAvailabilityZonesInput { +func (s *DescribeCustomerGatewaysInput) SetDryRun(v bool) *DescribeCustomerGatewaysInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeAvailabilityZonesInput) SetFilters(v []*Filter) *DescribeAvailabilityZonesInput { +func (s *DescribeCustomerGatewaysInput) SetFilters(v []*Filter) *DescribeCustomerGatewaysInput { s.Filters = v return s } -// SetZoneIds sets the ZoneIds field's value. -func (s *DescribeAvailabilityZonesInput) SetZoneIds(v []*string) *DescribeAvailabilityZonesInput { - s.ZoneIds = v - return s -} - -// SetZoneNames sets the ZoneNames field's value. -func (s *DescribeAvailabilityZonesInput) SetZoneNames(v []*string) *DescribeAvailabilityZonesInput { - s.ZoneNames = v - return s -} - -type DescribeAvailabilityZonesOutput struct { +// Contains the output of DescribeCustomerGateways. +type DescribeCustomerGatewaysOutput struct { _ struct{} `type:"structure"` - // Information about the Availability Zones. - AvailabilityZones []*AvailabilityZone `locationName:"availabilityZoneInfo" locationNameList:"item" type:"list"` + // Information about one or more customer gateways. + CustomerGateways []*CustomerGateway `locationName:"customerGatewaySet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DescribeAvailabilityZonesOutput) String() string { +func (s DescribeCustomerGatewaysOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAvailabilityZonesOutput) GoString() string { +func (s DescribeCustomerGatewaysOutput) GoString() string { return s.String() } -// SetAvailabilityZones sets the AvailabilityZones field's value. -func (s *DescribeAvailabilityZonesOutput) SetAvailabilityZones(v []*AvailabilityZone) *DescribeAvailabilityZonesOutput { - s.AvailabilityZones = v +// SetCustomerGateways sets the CustomerGateways field's value. +func (s *DescribeCustomerGatewaysOutput) SetCustomerGateways(v []*CustomerGateway) *DescribeCustomerGatewaysOutput { + s.CustomerGateways = v return s } -type DescribeBundleTasksInput struct { +type DescribeDhcpOptionsInput struct { _ struct{} `type:"structure"` - // The bundle task IDs. + // The IDs of one or more DHCP options sets. // - // Default: Describes all your bundle tasks. - BundleIds []*string `locationName:"BundleId" locationNameList:"BundleId" type:"list"` + // 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 @@ -48953,84 +56332,122 @@ type DescribeBundleTasksInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` - // The 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. + // One or more filters. // - // * progress - The level of task completion, as a percentage (for example, - // 20%). + // * dhcp-options-id - The ID of a DHCP options set. // - // * s3-bucket - The Amazon S3 bucket to store the AMI. + // * key - The key for one of the options (for example, domain-name). // - // * s3-prefix - The beginning of the AMI name. + // * value - The value for one of the options. // - // * start-time - The time the task started (for example, 2013-09-15T17:15:20.000Z). + // * owner-id - The ID of the AWS account that owns the DHCP options set. // - // * state - The state of the task (pending | waiting-for-shutdown | bundling - // | storing | cancelling | complete | failed). + // * tag: - The key/value combination of a tag assigned to the resource. + // Use the tag key in the filter name and the tag value as the filter value. + // For example, to find all resources that have a tag with the key Owner + // and the value TeamA, specify tag:Owner for the filter name and TeamA for + // the filter value. // - // * update-time - The time of the most recent update for the task. + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeBundleTasksInput) String() string { +func (s DescribeDhcpOptionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeBundleTasksInput) GoString() string { +func (s DescribeDhcpOptionsInput) GoString() string { return s.String() } -// SetBundleIds sets the BundleIds field's value. -func (s *DescribeBundleTasksInput) SetBundleIds(v []*string) *DescribeBundleTasksInput { - s.BundleIds = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeDhcpOptionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeDhcpOptionsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// 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 *DescribeBundleTasksInput) SetDryRun(v bool) *DescribeBundleTasksInput { +func (s *DescribeDhcpOptionsInput) SetDryRun(v bool) *DescribeDhcpOptionsInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeBundleTasksInput) SetFilters(v []*Filter) *DescribeBundleTasksInput { +func (s *DescribeDhcpOptionsInput) SetFilters(v []*Filter) *DescribeDhcpOptionsInput { s.Filters = v return s } -type DescribeBundleTasksOutput struct { +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeDhcpOptionsInput) SetMaxResults(v int64) *DescribeDhcpOptionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeDhcpOptionsInput) SetNextToken(v string) *DescribeDhcpOptionsInput { + s.NextToken = &v + return s +} + +type DescribeDhcpOptionsOutput struct { _ struct{} `type:"structure"` - // Information about the bundle tasks. - BundleTasks []*BundleTask `locationName:"bundleInstanceTasksSet" locationNameList:"item" type:"list"` + // Information about one or more DHCP options sets. + DhcpOptions []*DhcpOptions `locationName:"dhcpOptionsSet" 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 DescribeBundleTasksOutput) String() string { +func (s DescribeDhcpOptionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeBundleTasksOutput) GoString() string { +func (s DescribeDhcpOptionsOutput) GoString() string { return s.String() } -// SetBundleTasks sets the BundleTasks field's value. -func (s *DescribeBundleTasksOutput) SetBundleTasks(v []*BundleTask) *DescribeBundleTasksOutput { - s.BundleTasks = v +// SetDhcpOptions sets the DhcpOptions field's value. +func (s *DescribeDhcpOptionsOutput) SetDhcpOptions(v []*DhcpOptions) *DescribeDhcpOptionsOutput { + s.DhcpOptions = v return s } -type DescribeByoipCidrsInput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeDhcpOptionsOutput) SetNextToken(v string) *DescribeDhcpOptionsOutput { + s.NextToken = &v + return s +} + +type DescribeEgressOnlyInternetGatewaysInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -49039,34 +56456,45 @@ type DescribeByoipCidrsInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` + // One or more egress-only internet gateway IDs. + EgressOnlyInternetGatewayIds []*string `locationName:"EgressOnlyInternetGatewayId" locationNameList:"item" type:"list"` + + // One or more filters. + // + // * tag: - The key/value combination of a tag assigned to the resource. + // Use the tag key in the filter name and the tag value as the filter value. + // For example, to find all resources that have a tag with the key Owner + // and the value TeamA, specify tag:Owner for the filter name and TeamA for + // the filter value. + // + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + // The maximum number of results to return with a single call. To retrieve the // remaining results, make another call with the returned nextToken value. - // - // MaxResults is a required field - MaxResults *int64 `min:"1" type:"integer" required:"true"` + MaxResults *int64 `min:"5" type:"integer"` // The token for the next page of results. NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeByoipCidrsInput) String() string { +func (s DescribeEgressOnlyInternetGatewaysInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeByoipCidrsInput) GoString() string { +func (s DescribeEgressOnlyInternetGatewaysInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeByoipCidrsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeByoipCidrsInput"} - if s.MaxResults == nil { - invalidParams.Add(request.NewErrParamRequired("MaxResults")) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *DescribeEgressOnlyInternetGatewaysInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeEgressOnlyInternetGatewaysInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) } if invalidParams.Len() > 0 { @@ -49076,28 +56504,40 @@ func (s *DescribeByoipCidrsInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DescribeByoipCidrsInput) SetDryRun(v bool) *DescribeByoipCidrsInput { +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 +} + +// SetFilters sets the Filters field's value. +func (s *DescribeEgressOnlyInternetGatewaysInput) SetFilters(v []*Filter) *DescribeEgressOnlyInternetGatewaysInput { + s.Filters = v + return s +} + // SetMaxResults sets the MaxResults field's value. -func (s *DescribeByoipCidrsInput) SetMaxResults(v int64) *DescribeByoipCidrsInput { +func (s *DescribeEgressOnlyInternetGatewaysInput) SetMaxResults(v int64) *DescribeEgressOnlyInternetGatewaysInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeByoipCidrsInput) SetNextToken(v string) *DescribeByoipCidrsInput { +func (s *DescribeEgressOnlyInternetGatewaysInput) SetNextToken(v string) *DescribeEgressOnlyInternetGatewaysInput { s.NextToken = &v return s } -type DescribeByoipCidrsOutput struct { +type DescribeEgressOnlyInternetGatewaysOutput struct { _ struct{} `type:"structure"` - // Information about your address ranges. - ByoipCidrs []*ByoipCidr `locationName:"byoipCidrSet" locationNameList:"item" type:"list"` + // 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. This value is null // when there are no more results to return. @@ -49105,66 +56545,80 @@ type DescribeByoipCidrsOutput struct { } // String returns the string representation -func (s DescribeByoipCidrsOutput) String() string { +func (s DescribeEgressOnlyInternetGatewaysOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeByoipCidrsOutput) GoString() string { +func (s DescribeEgressOnlyInternetGatewaysOutput) GoString() string { return s.String() } -// SetByoipCidrs sets the ByoipCidrs field's value. -func (s *DescribeByoipCidrsOutput) SetByoipCidrs(v []*ByoipCidr) *DescribeByoipCidrsOutput { - s.ByoipCidrs = v +// 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 *DescribeByoipCidrsOutput) SetNextToken(v string) *DescribeByoipCidrsOutput { +func (s *DescribeEgressOnlyInternetGatewaysOutput) SetNextToken(v string) *DescribeEgressOnlyInternetGatewaysOutput { s.NextToken = &v return s } -type DescribeCapacityReservationsInput struct { +type DescribeElasticGpusInput struct { _ struct{} `type:"structure"` - // The ID of the Capacity Reservation. - CapacityReservationIds []*string `locationName:"CapacityReservationId" 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"` - // One or more filters. + // The Elastic Graphics accelerator IDs. + ElasticGpuIds []*string `locationName:"ElasticGpuId" locationNameList:"item" type:"list"` + + // The filters. + // + // * availability-zone - The Availability Zone in which the Elastic Graphics + // accelerator resides. + // + // * elastic-gpu-health - The status of the Elastic Graphics accelerator + // (OK | IMPAIRED). + // + // * elastic-gpu-state - The state of the Elastic Graphics accelerator (ATTACHED). + // + // * elastic-gpu-type - The type of Elastic Graphics accelerator; for example, + // eg1.medium. + // + // * instance-id - The ID of the instance to which the Elastic Graphics accelerator + // is associated. 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 can be seen by sending another request with the returned - // nextToken value. - MaxResults *int64 `min:"1" type:"integer"` + // 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. + MaxResults *int64 `min:"10" type:"integer"` - // The token to retrieve the next page of results. + // The token to request the next page of results. NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeCapacityReservationsInput) String() string { +func (s DescribeElasticGpusInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeCapacityReservationsInput) GoString() string { +func (s DescribeElasticGpusInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeCapacityReservationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeCapacityReservationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *DescribeElasticGpusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeElasticGpusInput"} + if s.MaxResults != nil && *s.MaxResults < 10 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 10)) } if invalidParams.Len() > 0 { @@ -49173,41 +56627,46 @@ func (s *DescribeCapacityReservationsInput) Validate() error { return nil } -// SetCapacityReservationIds sets the CapacityReservationIds field's value. -func (s *DescribeCapacityReservationsInput) SetCapacityReservationIds(v []*string) *DescribeCapacityReservationsInput { - s.CapacityReservationIds = v +// SetDryRun sets the DryRun field's value. +func (s *DescribeElasticGpusInput) SetDryRun(v bool) *DescribeElasticGpusInput { + s.DryRun = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *DescribeCapacityReservationsInput) SetDryRun(v bool) *DescribeCapacityReservationsInput { - s.DryRun = &v +// SetElasticGpuIds sets the ElasticGpuIds field's value. +func (s *DescribeElasticGpusInput) SetElasticGpuIds(v []*string) *DescribeElasticGpusInput { + s.ElasticGpuIds = v return s } // SetFilters sets the Filters field's value. -func (s *DescribeCapacityReservationsInput) SetFilters(v []*Filter) *DescribeCapacityReservationsInput { +func (s *DescribeElasticGpusInput) SetFilters(v []*Filter) *DescribeElasticGpusInput { s.Filters = v return s } // SetMaxResults sets the MaxResults field's value. -func (s *DescribeCapacityReservationsInput) SetMaxResults(v int64) *DescribeCapacityReservationsInput { +func (s *DescribeElasticGpusInput) SetMaxResults(v int64) *DescribeElasticGpusInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeCapacityReservationsInput) SetNextToken(v string) *DescribeCapacityReservationsInput { +func (s *DescribeElasticGpusInput) SetNextToken(v string) *DescribeElasticGpusInput { s.NextToken = &v return s } -type DescribeCapacityReservationsOutput struct { +type DescribeElasticGpusOutput struct { _ struct{} `type:"structure"` - // Information about the Capacity Reservations. - CapacityReservations []*CapacityReservation `locationName:"capacityReservationSet" locationNameList:"item" type:"list"` + // Information about the Elastic Graphics accelerators. + ElasticGpuSet []*ElasticGpus `locationName:"elasticGpuSet" locationNameList:"item" type:"list"` + + // The total number of items to return. If the total number of items available + // is more than the value specified in max-items then a Next-Token will be provided + // in the output that you can use to resume pagination. + MaxResults *int64 `locationName:"maxResults" type:"integer"` // The token to use to retrieve the next page of results. This value is null // when there are no more results to return. @@ -49215,85 +56674,71 @@ type DescribeCapacityReservationsOutput struct { } // String returns the string representation -func (s DescribeCapacityReservationsOutput) String() string { +func (s DescribeElasticGpusOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeCapacityReservationsOutput) GoString() string { +func (s DescribeElasticGpusOutput) GoString() string { return s.String() } -// SetCapacityReservations sets the CapacityReservations field's value. -func (s *DescribeCapacityReservationsOutput) SetCapacityReservations(v []*CapacityReservation) *DescribeCapacityReservationsOutput { - s.CapacityReservations = v +// SetElasticGpuSet sets the ElasticGpuSet field's value. +func (s *DescribeElasticGpusOutput) SetElasticGpuSet(v []*ElasticGpus) *DescribeElasticGpusOutput { + s.ElasticGpuSet = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeElasticGpusOutput) SetMaxResults(v int64) *DescribeElasticGpusOutput { + s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeCapacityReservationsOutput) SetNextToken(v string) *DescribeCapacityReservationsOutput { +func (s *DescribeElasticGpusOutput) SetNextToken(v string) *DescribeElasticGpusOutput { s.NextToken = &v return s } -type DescribeClassicLinkInstancesInput struct { +type DescribeExportImageTasksInput 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"` + DryRun *bool `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: - The key/value combination of a tag assigned to the resource. - // Use the tag key in the filter name and the tag value as the filter value. - // For example, to find all resources that have a tag with the key Owner - // and the value TeamA, specify tag:Owner for the filter name and TeamA for - // the filter value. - // - // * tag-key - The key of a tag assigned to the resource. Use this filter - // to find all resources assigned a tag with a specific key, regardless of - // the tag value. - // - // * vpc-id - The ID of the VPC to which the instance is linked. vpc-id - - // The ID of the VPC that the instance is linked to. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + // The IDs of the export image tasks. + ExportImageTaskIds []*string `locationName:"ExportImageTaskId" locationNameList:"ExportImageTaskId" type:"list"` - // One or more instance IDs. Must be instances linked to a VPC through ClassicLink. - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` + // Filter tasks using the task-state filter and one of the following values: + // active, completed, deleting, or deleted. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - // - // Constraint: If the value is greater than 1000, we return only 1000 items. - MaxResults *int64 `locationName:"maxResults" min:"5" type:"integer"` + // The maximum number of results to return in a single call. + MaxResults *int64 `min:"1" type:"integer"` - // The token for the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` + // A token that indicates the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeClassicLinkInstancesInput) String() string { +func (s DescribeExportImageTasksInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClassicLinkInstancesInput) GoString() string { +func (s DescribeExportImageTasksInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeClassicLinkInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeClassicLinkInstancesInput"} - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) +func (s *DescribeExportImageTasksInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeExportImageTasksInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -49303,270 +56748,311 @@ func (s *DescribeClassicLinkInstancesInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DescribeClassicLinkInstancesInput) SetDryRun(v bool) *DescribeClassicLinkInstancesInput { +func (s *DescribeExportImageTasksInput) SetDryRun(v bool) *DescribeExportImageTasksInput { s.DryRun = &v return s } -// SetFilters sets the Filters field's value. -func (s *DescribeClassicLinkInstancesInput) SetFilters(v []*Filter) *DescribeClassicLinkInstancesInput { - s.Filters = v +// SetExportImageTaskIds sets the ExportImageTaskIds field's value. +func (s *DescribeExportImageTasksInput) SetExportImageTaskIds(v []*string) *DescribeExportImageTasksInput { + s.ExportImageTaskIds = v return s } -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeClassicLinkInstancesInput) SetInstanceIds(v []*string) *DescribeClassicLinkInstancesInput { - s.InstanceIds = v +// SetFilters sets the Filters field's value. +func (s *DescribeExportImageTasksInput) SetFilters(v []*Filter) *DescribeExportImageTasksInput { + s.Filters = v return s } // SetMaxResults sets the MaxResults field's value. -func (s *DescribeClassicLinkInstancesInput) SetMaxResults(v int64) *DescribeClassicLinkInstancesInput { +func (s *DescribeExportImageTasksInput) SetMaxResults(v int64) *DescribeExportImageTasksInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeClassicLinkInstancesInput) SetNextToken(v string) *DescribeClassicLinkInstancesInput { +func (s *DescribeExportImageTasksInput) SetNextToken(v string) *DescribeExportImageTasksInput { s.NextToken = &v return s } -type DescribeClassicLinkInstancesOutput struct { +type DescribeExportImageTasksOutput struct { _ struct{} `type:"structure"` - // Information about one or more linked EC2-Classic instances. - Instances []*ClassicLinkInstance `locationName:"instancesSet" locationNameList:"item" type:"list"` + // Information about the export image tasks. + ExportImageTasks []*ExportImageTask `locationName:"exportImageTaskSet" 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. + // 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 DescribeClassicLinkInstancesOutput) String() string { +func (s DescribeExportImageTasksOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClassicLinkInstancesOutput) GoString() string { +func (s DescribeExportImageTasksOutput) GoString() string { return s.String() } -// SetInstances sets the Instances field's value. -func (s *DescribeClassicLinkInstancesOutput) SetInstances(v []*ClassicLinkInstance) *DescribeClassicLinkInstancesOutput { - s.Instances = v +// SetExportImageTasks sets the ExportImageTasks field's value. +func (s *DescribeExportImageTasksOutput) SetExportImageTasks(v []*ExportImageTask) *DescribeExportImageTasksOutput { + s.ExportImageTasks = v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeClassicLinkInstancesOutput) SetNextToken(v string) *DescribeClassicLinkInstancesOutput { +func (s *DescribeExportImageTasksOutput) SetNextToken(v string) *DescribeExportImageTasksOutput { s.NextToken = &v return s } -type DescribeClientVpnAuthorizationRulesInput struct { +type DescribeExportTasksInput struct { _ struct{} `type:"structure"` - // The ID of the Client VPN endpoint. - // - // ClientVpnEndpointId is a required field - ClientVpnEndpointId *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 `type:"boolean"` + // The export task IDs. + ExportTaskIds []*string `locationName:"exportTaskId" locationNameList:"ExportTaskId" type:"list"` - // One or more filters. Filter names and values are case-sensitive. + // the filters for the export tasks. 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 can be seen by sending another request with the nextToken - // value. - MaxResults *int64 `min:"5" type:"integer"` +// String returns the string representation +func (s DescribeExportTasksInput) String() string { + return awsutil.Prettify(s) +} - // The token to retrieve the next page of results. - NextToken *string `type:"string"` +// 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 +} + +// SetFilters sets the Filters field's value. +func (s *DescribeExportTasksInput) SetFilters(v []*Filter) *DescribeExportTasksInput { + s.Filters = v + return s +} + +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 DescribeClientVpnAuthorizationRulesInput) String() string { +func (s DescribeExportTasksOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClientVpnAuthorizationRulesInput) GoString() string { +func (s DescribeExportTasksOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeClientVpnAuthorizationRulesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeClientVpnAuthorizationRulesInput"} - if s.ClientVpnEndpointId == nil { - invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) - } - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) - } +// SetExportTasks sets the ExportTasks field's value. +func (s *DescribeExportTasksOutput) SetExportTasks(v []*ExportTask) *DescribeExportTasksOutput { + s.ExportTasks = v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// Describes fast snapshot restores for a snapshot. +type DescribeFastSnapshotRestoreSuccessItem struct { + _ struct{} `type:"structure"` + + // The Availability Zone. + AvailabilityZone *string `locationName:"availabilityZone" type:"string"` + + // The time at which fast snapshot restores entered the disabled state. + DisabledTime *time.Time `locationName:"disabledTime" type:"timestamp"` + + // The time at which fast snapshot restores entered the disabling state. + DisablingTime *time.Time `locationName:"disablingTime" type:"timestamp"` + + // The time at which fast snapshot restores entered the enabled state. + EnabledTime *time.Time `locationName:"enabledTime" type:"timestamp"` + + // The time at which fast snapshot restores entered the enabling state. + EnablingTime *time.Time `locationName:"enablingTime" type:"timestamp"` + + // The time at which fast snapshot restores entered the optimizing state. + OptimizingTime *time.Time `locationName:"optimizingTime" type:"timestamp"` + + // The alias of the snapshot owner. + OwnerAlias *string `locationName:"ownerAlias" type:"string"` + + // The ID of the AWS account that owns the snapshot. + OwnerId *string `locationName:"ownerId" type:"string"` + + // The ID of the snapshot. + SnapshotId *string `locationName:"snapshotId" type:"string"` + + // The state of fast snapshot restores. + State *string `locationName:"state" type:"string" enum:"FastSnapshotRestoreStateCode"` + + // The reason for the state transition. The possible values are as follows: + // + // * Client.UserInitiated - The state successfully transitioned to enabling + // or disabling. + // + // * Client.UserInitiated - Lifecycle state transition - The state successfully + // transitioned to optimizing, enabled, or disabled. + StateTransitionReason *string `locationName:"stateTransitionReason" type:"string"` } -// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. -func (s *DescribeClientVpnAuthorizationRulesInput) SetClientVpnEndpointId(v string) *DescribeClientVpnAuthorizationRulesInput { - s.ClientVpnEndpointId = &v - return s +// String returns the string representation +func (s DescribeFastSnapshotRestoreSuccessItem) String() string { + return awsutil.Prettify(s) } -// SetDryRun sets the DryRun field's value. -func (s *DescribeClientVpnAuthorizationRulesInput) SetDryRun(v bool) *DescribeClientVpnAuthorizationRulesInput { - s.DryRun = &v +// GoString returns the string representation +func (s DescribeFastSnapshotRestoreSuccessItem) GoString() string { + return s.String() +} + +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *DescribeFastSnapshotRestoreSuccessItem) SetAvailabilityZone(v string) *DescribeFastSnapshotRestoreSuccessItem { + s.AvailabilityZone = &v return s } -// SetFilters sets the Filters field's value. -func (s *DescribeClientVpnAuthorizationRulesInput) SetFilters(v []*Filter) *DescribeClientVpnAuthorizationRulesInput { - s.Filters = v +// SetDisabledTime sets the DisabledTime field's value. +func (s *DescribeFastSnapshotRestoreSuccessItem) SetDisabledTime(v time.Time) *DescribeFastSnapshotRestoreSuccessItem { + s.DisabledTime = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeClientVpnAuthorizationRulesInput) SetMaxResults(v int64) *DescribeClientVpnAuthorizationRulesInput { - s.MaxResults = &v +// SetDisablingTime sets the DisablingTime field's value. +func (s *DescribeFastSnapshotRestoreSuccessItem) SetDisablingTime(v time.Time) *DescribeFastSnapshotRestoreSuccessItem { + s.DisablingTime = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeClientVpnAuthorizationRulesInput) SetNextToken(v string) *DescribeClientVpnAuthorizationRulesInput { - s.NextToken = &v +// SetEnabledTime sets the EnabledTime field's value. +func (s *DescribeFastSnapshotRestoreSuccessItem) SetEnabledTime(v time.Time) *DescribeFastSnapshotRestoreSuccessItem { + s.EnabledTime = &v return s } -type DescribeClientVpnAuthorizationRulesOutput struct { - _ struct{} `type:"structure"` +// SetEnablingTime sets the EnablingTime field's value. +func (s *DescribeFastSnapshotRestoreSuccessItem) SetEnablingTime(v time.Time) *DescribeFastSnapshotRestoreSuccessItem { + s.EnablingTime = &v + return s +} - // Information about the authorization rules. - AuthorizationRules []*AuthorizationRule `locationName:"authorizationRule" locationNameList:"item" type:"list"` +// SetOptimizingTime sets the OptimizingTime field's value. +func (s *DescribeFastSnapshotRestoreSuccessItem) SetOptimizingTime(v time.Time) *DescribeFastSnapshotRestoreSuccessItem { + s.OptimizingTime = &v + return s +} - // 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"` +// SetOwnerAlias sets the OwnerAlias field's value. +func (s *DescribeFastSnapshotRestoreSuccessItem) SetOwnerAlias(v string) *DescribeFastSnapshotRestoreSuccessItem { + s.OwnerAlias = &v + return s } -// String returns the string representation -func (s DescribeClientVpnAuthorizationRulesOutput) String() string { - return awsutil.Prettify(s) +// SetOwnerId sets the OwnerId field's value. +func (s *DescribeFastSnapshotRestoreSuccessItem) SetOwnerId(v string) *DescribeFastSnapshotRestoreSuccessItem { + s.OwnerId = &v + return s } -// GoString returns the string representation -func (s DescribeClientVpnAuthorizationRulesOutput) GoString() string { - return s.String() +// SetSnapshotId sets the SnapshotId field's value. +func (s *DescribeFastSnapshotRestoreSuccessItem) SetSnapshotId(v string) *DescribeFastSnapshotRestoreSuccessItem { + s.SnapshotId = &v + return s } -// SetAuthorizationRules sets the AuthorizationRules field's value. -func (s *DescribeClientVpnAuthorizationRulesOutput) SetAuthorizationRules(v []*AuthorizationRule) *DescribeClientVpnAuthorizationRulesOutput { - s.AuthorizationRules = v +// SetState sets the State field's value. +func (s *DescribeFastSnapshotRestoreSuccessItem) SetState(v string) *DescribeFastSnapshotRestoreSuccessItem { + s.State = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeClientVpnAuthorizationRulesOutput) SetNextToken(v string) *DescribeClientVpnAuthorizationRulesOutput { - s.NextToken = &v +// SetStateTransitionReason sets the StateTransitionReason field's value. +func (s *DescribeFastSnapshotRestoreSuccessItem) SetStateTransitionReason(v string) *DescribeFastSnapshotRestoreSuccessItem { + s.StateTransitionReason = &v return s } -type DescribeClientVpnConnectionsInput struct { +type DescribeFastSnapshotRestoresInput struct { _ struct{} `type:"structure"` - // The ID of the Client VPN endpoint. - // - // ClientVpnEndpointId is a required field - ClientVpnEndpointId *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 `type:"boolean"` - // One or more filters. Filter names and values are case-sensitive. + // The filters. The possible values are: + // + // * availability-zone: The Availability Zone of the snapshot. + // + // * owner-id: The ID of the AWS account that owns the snapshot. + // + // * snapshot-id: The ID of the snapshot. + // + // * state: The state of fast snapshot restores for the snapshot (enabling + // | optimizing | enabled | disabling | disabled). 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 can be seen by sending another request with the nextToken - // value. - MaxResults *int64 `min:"5" type:"integer"` + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `type:"integer"` - // The token to retrieve the next page of results. + // The token for the next page of results. NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeClientVpnConnectionsInput) String() string { +func (s DescribeFastSnapshotRestoresInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClientVpnConnectionsInput) GoString() string { +func (s DescribeFastSnapshotRestoresInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeClientVpnConnectionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeClientVpnConnectionsInput"} - if s.ClientVpnEndpointId == nil { - invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) - } - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. -func (s *DescribeClientVpnConnectionsInput) SetClientVpnEndpointId(v string) *DescribeClientVpnConnectionsInput { - s.ClientVpnEndpointId = &v - return s -} - // SetDryRun sets the DryRun field's value. -func (s *DescribeClientVpnConnectionsInput) SetDryRun(v bool) *DescribeClientVpnConnectionsInput { +func (s *DescribeFastSnapshotRestoresInput) SetDryRun(v bool) *DescribeFastSnapshotRestoresInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeClientVpnConnectionsInput) SetFilters(v []*Filter) *DescribeClientVpnConnectionsInput { +func (s *DescribeFastSnapshotRestoresInput) SetFilters(v []*Filter) *DescribeFastSnapshotRestoresInput { s.Filters = v return s } // SetMaxResults sets the MaxResults field's value. -func (s *DescribeClientVpnConnectionsInput) SetMaxResults(v int64) *DescribeClientVpnConnectionsInput { +func (s *DescribeFastSnapshotRestoresInput) SetMaxResults(v int64) *DescribeFastSnapshotRestoresInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeClientVpnConnectionsInput) SetNextToken(v string) *DescribeClientVpnConnectionsInput { +func (s *DescribeFastSnapshotRestoresInput) SetNextToken(v string) *DescribeFastSnapshotRestoresInput { s.NextToken = &v return s } -type DescribeClientVpnConnectionsOutput struct { +type DescribeFastSnapshotRestoresOutput struct { _ struct{} `type:"structure"` - // Information about the active and terminated client connections. - Connections []*ClientVpnConnection `locationName:"connections" locationNameList:"item" type:"list"` + // Information about the state of fast snapshot restores. + FastSnapshotRestores []*DescribeFastSnapshotRestoreSuccessItem `locationName:"fastSnapshotRestoreSet" 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. @@ -49574,32 +57060,85 @@ type DescribeClientVpnConnectionsOutput struct { } // String returns the string representation -func (s DescribeClientVpnConnectionsOutput) String() string { +func (s DescribeFastSnapshotRestoresOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClientVpnConnectionsOutput) GoString() string { +func (s DescribeFastSnapshotRestoresOutput) GoString() string { return s.String() } -// SetConnections sets the Connections field's value. -func (s *DescribeClientVpnConnectionsOutput) SetConnections(v []*ClientVpnConnection) *DescribeClientVpnConnectionsOutput { - s.Connections = v +// SetFastSnapshotRestores sets the FastSnapshotRestores field's value. +func (s *DescribeFastSnapshotRestoresOutput) SetFastSnapshotRestores(v []*DescribeFastSnapshotRestoreSuccessItem) *DescribeFastSnapshotRestoresOutput { + s.FastSnapshotRestores = v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeClientVpnConnectionsOutput) SetNextToken(v string) *DescribeClientVpnConnectionsOutput { +func (s *DescribeFastSnapshotRestoresOutput) SetNextToken(v string) *DescribeFastSnapshotRestoresOutput { s.NextToken = &v return s } -type DescribeClientVpnEndpointsInput struct { +// Describes the instances that could not be launched by the fleet. +type DescribeFleetError struct { _ struct{} `type:"structure"` - // The ID of the Client VPN endpoint. - ClientVpnEndpointIds []*string `locationName:"ClientVpnEndpointId" locationNameList:"item" type:"list"` + // The error code that indicates why the instance could not be launched. For + // more information about error codes, see Error Codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html.html). + ErrorCode *string `locationName:"errorCode" type:"string"` + + // The error message that describes why the instance could not be launched. + // For more information about error messages, see Error Codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html.html). + ErrorMessage *string `locationName:"errorMessage" type:"string"` + + // The launch templates and overrides that were used for launching the instances. + // The values that you specify in the Overrides replace the values in the launch + // template. + LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse `locationName:"launchTemplateAndOverrides" type:"structure"` + + // Indicates if the instance that could not be launched was a Spot Instance + // or On-Demand Instance. + Lifecycle *string `locationName:"lifecycle" type:"string" enum:"InstanceLifecycle"` +} + +// String returns the string representation +func (s DescribeFleetError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeFleetError) GoString() string { + return s.String() +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *DescribeFleetError) SetErrorCode(v string) *DescribeFleetError { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *DescribeFleetError) SetErrorMessage(v string) *DescribeFleetError { + s.ErrorMessage = &v + return s +} + +// SetLaunchTemplateAndOverrides sets the LaunchTemplateAndOverrides field's value. +func (s *DescribeFleetError) SetLaunchTemplateAndOverrides(v *LaunchTemplateAndOverridesResponse) *DescribeFleetError { + s.LaunchTemplateAndOverrides = v + return s +} + +// SetLifecycle sets the Lifecycle field's value. +func (s *DescribeFleetError) SetLifecycle(v string) *DescribeFleetError { + s.Lifecycle = &v + return s +} + +type DescribeFleetHistoryInput 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 @@ -49607,33 +57146,46 @@ type DescribeClientVpnEndpointsInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // One or more filters. Filter names and values are case-sensitive. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + // The type of events to describe. By default, all events are described. + EventType *string `type:"string" enum:"FleetEventType"` - // 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 nextToken - // value. - MaxResults *int64 `min:"5" type:"integer"` + // The ID of the EC2 Fleet. + // + // FleetId is a required field + FleetId *string `type:"string" required:"true"` - // The token to retrieve the next page of results. + // 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 `type:"integer"` + + // The token for the next set of results. NextToken *string `type:"string"` + + // The start date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). + // + // StartTime is a required field + StartTime *time.Time `type:"timestamp" required:"true"` } // String returns the string representation -func (s DescribeClientVpnEndpointsInput) String() string { +func (s DescribeFleetHistoryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClientVpnEndpointsInput) GoString() string { +func (s DescribeFleetHistoryInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeClientVpnEndpointsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeClientVpnEndpointsInput"} - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) +func (s *DescribeFleetHistoryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeFleetHistoryInput"} + if s.FleetId == nil { + invalidParams.Add(request.NewErrParamRequired("FleetId")) + } + if s.StartTime == nil { + invalidParams.Add(request.NewErrParamRequired("StartTime")) } if invalidParams.Len() > 0 { @@ -49642,76 +57194,106 @@ func (s *DescribeClientVpnEndpointsInput) Validate() error { return nil } -// SetClientVpnEndpointIds sets the ClientVpnEndpointIds field's value. -func (s *DescribeClientVpnEndpointsInput) SetClientVpnEndpointIds(v []*string) *DescribeClientVpnEndpointsInput { - s.ClientVpnEndpointIds = v +// SetDryRun sets the DryRun field's value. +func (s *DescribeFleetHistoryInput) SetDryRun(v bool) *DescribeFleetHistoryInput { + s.DryRun = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *DescribeClientVpnEndpointsInput) SetDryRun(v bool) *DescribeClientVpnEndpointsInput { - s.DryRun = &v +// SetEventType sets the EventType field's value. +func (s *DescribeFleetHistoryInput) SetEventType(v string) *DescribeFleetHistoryInput { + s.EventType = &v return s } -// SetFilters sets the Filters field's value. -func (s *DescribeClientVpnEndpointsInput) SetFilters(v []*Filter) *DescribeClientVpnEndpointsInput { - s.Filters = v +// SetFleetId sets the FleetId field's value. +func (s *DescribeFleetHistoryInput) SetFleetId(v string) *DescribeFleetHistoryInput { + s.FleetId = &v return s } // SetMaxResults sets the MaxResults field's value. -func (s *DescribeClientVpnEndpointsInput) SetMaxResults(v int64) *DescribeClientVpnEndpointsInput { +func (s *DescribeFleetHistoryInput) SetMaxResults(v int64) *DescribeFleetHistoryInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeClientVpnEndpointsInput) SetNextToken(v string) *DescribeClientVpnEndpointsInput { +func (s *DescribeFleetHistoryInput) SetNextToken(v string) *DescribeFleetHistoryInput { s.NextToken = &v return s } -type DescribeClientVpnEndpointsOutput struct { +// SetStartTime sets the StartTime field's value. +func (s *DescribeFleetHistoryInput) SetStartTime(v time.Time) *DescribeFleetHistoryInput { + s.StartTime = &v + return s +} + +type DescribeFleetHistoryOutput struct { _ struct{} `type:"structure"` - // Information about the Client VPN endpoints. - ClientVpnEndpoints []*ClientVpnEndpoint `locationName:"clientVpnEndpoint" locationNameList:"item" type:"list"` + // The ID of the EC Fleet. + FleetId *string `locationName:"fleetId" type:"string"` - // The token to use to retrieve the next page of results. This value is null - // when there are no more results to return. + // Information about the events in the history of the EC2 Fleet. + HistoryRecords []*HistoryRecordEntry `locationName:"historyRecordSet" locationNameList:"item" type:"list"` + + // 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 *time.Time `locationName:"lastEvaluatedTime" type:"timestamp"` + + // The token for the next set of results. NextToken *string `locationName:"nextToken" type:"string"` + + // The start date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). + StartTime *time.Time `locationName:"startTime" type:"timestamp"` } // String returns the string representation -func (s DescribeClientVpnEndpointsOutput) String() string { +func (s DescribeFleetHistoryOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClientVpnEndpointsOutput) GoString() string { +func (s DescribeFleetHistoryOutput) GoString() string { return s.String() } -// SetClientVpnEndpoints sets the ClientVpnEndpoints field's value. -func (s *DescribeClientVpnEndpointsOutput) SetClientVpnEndpoints(v []*ClientVpnEndpoint) *DescribeClientVpnEndpointsOutput { - s.ClientVpnEndpoints = v +// SetFleetId sets the FleetId field's value. +func (s *DescribeFleetHistoryOutput) SetFleetId(v string) *DescribeFleetHistoryOutput { + s.FleetId = &v + return s +} + +// SetHistoryRecords sets the HistoryRecords field's value. +func (s *DescribeFleetHistoryOutput) SetHistoryRecords(v []*HistoryRecordEntry) *DescribeFleetHistoryOutput { + s.HistoryRecords = v + return s +} + +// SetLastEvaluatedTime sets the LastEvaluatedTime field's value. +func (s *DescribeFleetHistoryOutput) SetLastEvaluatedTime(v time.Time) *DescribeFleetHistoryOutput { + s.LastEvaluatedTime = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeClientVpnEndpointsOutput) SetNextToken(v string) *DescribeClientVpnEndpointsOutput { +func (s *DescribeFleetHistoryOutput) SetNextToken(v string) *DescribeFleetHistoryOutput { s.NextToken = &v return s } -type DescribeClientVpnRoutesInput struct { - _ struct{} `type:"structure"` +// SetStartTime sets the StartTime field's value. +func (s *DescribeFleetHistoryOutput) SetStartTime(v time.Time) *DescribeFleetHistoryOutput { + s.StartTime = &v + return s +} - // The ID of the Client VPN endpoint. - // - // ClientVpnEndpointId is a required field - ClientVpnEndpointId *string `type:"string" required:"true"` +type DescribeFleetInstancesInput 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 @@ -49719,36 +57301,40 @@ type DescribeClientVpnRoutesInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // One or more filters. Filter names and values are case-sensitive. + // The filters. + // + // * instance-type - The instance type. 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 can be seen by sending another request with the nextToken - // value. - MaxResults *int64 `min:"5" type:"integer"` + // The ID of the EC2 Fleet. + // + // FleetId is a required field + FleetId *string `type:"string" required:"true"` - // The token to retrieve the next page of results. + // 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 `type:"integer"` + + // The token for the next set of results. NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeClientVpnRoutesInput) String() string { +func (s DescribeFleetInstancesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClientVpnRoutesInput) GoString() string { +func (s DescribeFleetInstancesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeClientVpnRoutesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeClientVpnRoutesInput"} - if s.ClientVpnEndpointId == nil { - invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) - } - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) +func (s *DescribeFleetInstancesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeFleetInstancesInput"} + if s.FleetId == nil { + invalidParams.Add(request.NewErrParamRequired("FleetId")) } if invalidParams.Len() > 0 { @@ -49757,79 +57343,80 @@ func (s *DescribeClientVpnRoutesInput) Validate() error { return nil } -// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. -func (s *DescribeClientVpnRoutesInput) SetClientVpnEndpointId(v string) *DescribeClientVpnRoutesInput { - s.ClientVpnEndpointId = &v - return s -} - // SetDryRun sets the DryRun field's value. -func (s *DescribeClientVpnRoutesInput) SetDryRun(v bool) *DescribeClientVpnRoutesInput { +func (s *DescribeFleetInstancesInput) SetDryRun(v bool) *DescribeFleetInstancesInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeClientVpnRoutesInput) SetFilters(v []*Filter) *DescribeClientVpnRoutesInput { +func (s *DescribeFleetInstancesInput) SetFilters(v []*Filter) *DescribeFleetInstancesInput { s.Filters = v return s } +// SetFleetId sets the FleetId field's value. +func (s *DescribeFleetInstancesInput) SetFleetId(v string) *DescribeFleetInstancesInput { + s.FleetId = &v + return s +} + // SetMaxResults sets the MaxResults field's value. -func (s *DescribeClientVpnRoutesInput) SetMaxResults(v int64) *DescribeClientVpnRoutesInput { +func (s *DescribeFleetInstancesInput) SetMaxResults(v int64) *DescribeFleetInstancesInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeClientVpnRoutesInput) SetNextToken(v string) *DescribeClientVpnRoutesInput { +func (s *DescribeFleetInstancesInput) SetNextToken(v string) *DescribeFleetInstancesInput { s.NextToken = &v return s } -type DescribeClientVpnRoutesOutput struct { +type DescribeFleetInstancesOutput 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 running instances. This list is refreshed periodically and might be out + // of date. + ActiveInstances []*ActiveInstance `locationName:"activeInstanceSet" locationNameList:"item" type:"list"` - // Information about the Client VPN endpoint routes. - Routes []*ClientVpnRoute `locationName:"routes" locationNameList:"item" type:"list"` + // The ID of the EC2 Fleet. + FleetId *string `locationName:"fleetId" type:"string"` + + // The token for the next set of results. + NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation -func (s DescribeClientVpnRoutesOutput) String() string { +func (s DescribeFleetInstancesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClientVpnRoutesOutput) GoString() string { +func (s DescribeFleetInstancesOutput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribeClientVpnRoutesOutput) SetNextToken(v string) *DescribeClientVpnRoutesOutput { - s.NextToken = &v +// SetActiveInstances sets the ActiveInstances field's value. +func (s *DescribeFleetInstancesOutput) SetActiveInstances(v []*ActiveInstance) *DescribeFleetInstancesOutput { + s.ActiveInstances = v return s } -// SetRoutes sets the Routes field's value. -func (s *DescribeClientVpnRoutesOutput) SetRoutes(v []*ClientVpnRoute) *DescribeClientVpnRoutesOutput { - s.Routes = v +// SetFleetId sets the FleetId field's value. +func (s *DescribeFleetInstancesOutput) SetFleetId(v string) *DescribeFleetInstancesOutput { + s.FleetId = &v return s } -type DescribeClientVpnTargetNetworksInput struct { - _ struct{} `type:"structure"` - - // The IDs of the target network associations. - AssociationIds []*string `locationNameList:"item" type:"list"` +// SetNextToken sets the NextToken field's value. +func (s *DescribeFleetInstancesOutput) SetNextToken(v string) *DescribeFleetInstancesOutput { + s.NextToken = &v + return s +} - // The ID of the Client VPN endpoint. - // - // ClientVpnEndpointId is a required field - ClientVpnEndpointId *string `type:"string" required:"true"` +type DescribeFleetsInput 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 @@ -49837,201 +57424,195 @@ type DescribeClientVpnTargetNetworksInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // One or more filters. Filter names and values are case-sensitive. + // The filters. + // + // * activity-status - The progress of the EC2 Fleet ( error | pending-fulfillment + // | pending-termination | fulfilled). + // + // * excess-capacity-termination-policy - Indicates whether to terminate + // running instances if the target capacity is decreased below the current + // EC2 Fleet size (true | false). + // + // * fleet-state - The state of the EC2 Fleet (submitted | active | deleted + // | failed | deleted-running | deleted-terminating | modifying). + // + // * replace-unhealthy-instances - Indicates whether EC2 Fleet should replace + // unhealthy instances (true | false). + // + // * type - The type of request (instant | request | maintain). 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 can be seen by sending another request with the nextToken - // value. - MaxResults *int64 `min:"5" type:"integer"` + // The ID of the EC2 Fleets. + FleetIds []*string `locationName:"FleetId" type:"list"` - // The token to retrieve the next page of results. + // 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 `type:"integer"` + + // The token for the next set of results. NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeClientVpnTargetNetworksInput) String() string { +func (s DescribeFleetsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClientVpnTargetNetworksInput) GoString() string { +func (s DescribeFleetsInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeClientVpnTargetNetworksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeClientVpnTargetNetworksInput"} - if s.ClientVpnEndpointId == nil { - invalidParams.Add(request.NewErrParamRequired("ClientVpnEndpointId")) - } - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAssociationIds sets the AssociationIds field's value. -func (s *DescribeClientVpnTargetNetworksInput) SetAssociationIds(v []*string) *DescribeClientVpnTargetNetworksInput { - s.AssociationIds = v - return s -} - -// SetClientVpnEndpointId sets the ClientVpnEndpointId field's value. -func (s *DescribeClientVpnTargetNetworksInput) SetClientVpnEndpointId(v string) *DescribeClientVpnTargetNetworksInput { - s.ClientVpnEndpointId = &v - return s -} - // SetDryRun sets the DryRun field's value. -func (s *DescribeClientVpnTargetNetworksInput) SetDryRun(v bool) *DescribeClientVpnTargetNetworksInput { +func (s *DescribeFleetsInput) SetDryRun(v bool) *DescribeFleetsInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeClientVpnTargetNetworksInput) SetFilters(v []*Filter) *DescribeClientVpnTargetNetworksInput { +func (s *DescribeFleetsInput) SetFilters(v []*Filter) *DescribeFleetsInput { s.Filters = v return s } +// SetFleetIds sets the FleetIds field's value. +func (s *DescribeFleetsInput) SetFleetIds(v []*string) *DescribeFleetsInput { + s.FleetIds = v + return s +} + // SetMaxResults sets the MaxResults field's value. -func (s *DescribeClientVpnTargetNetworksInput) SetMaxResults(v int64) *DescribeClientVpnTargetNetworksInput { +func (s *DescribeFleetsInput) SetMaxResults(v int64) *DescribeFleetsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeClientVpnTargetNetworksInput) SetNextToken(v string) *DescribeClientVpnTargetNetworksInput { +func (s *DescribeFleetsInput) SetNextToken(v string) *DescribeFleetsInput { s.NextToken = &v return s } -type DescribeClientVpnTargetNetworksOutput struct { +// Describes the instances that were launched by the fleet. +type DescribeFleetsInstances struct { _ struct{} `type:"structure"` - // Information about the associated target networks. - ClientVpnTargetNetworks []*TargetNetwork `locationName:"clientVpnTargetNetworks" locationNameList:"item" type:"list"` + // The IDs of the instances. + InstanceIds []*string `locationName:"instanceIds" 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"` + // The instance type. + InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` + + // The launch templates and overrides that were used for launching the instances. + // The values that you specify in the Overrides replace the values in the launch + // template. + LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse `locationName:"launchTemplateAndOverrides" type:"structure"` + + // Indicates if the instance that was launched is a Spot Instance or On-Demand + // Instance. + Lifecycle *string `locationName:"lifecycle" type:"string" enum:"InstanceLifecycle"` + + // The value is Windows for Windows instances. Otherwise, the value is blank. + Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` } // String returns the string representation -func (s DescribeClientVpnTargetNetworksOutput) String() string { +func (s DescribeFleetsInstances) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClientVpnTargetNetworksOutput) GoString() string { +func (s DescribeFleetsInstances) GoString() string { return s.String() } -// SetClientVpnTargetNetworks sets the ClientVpnTargetNetworks field's value. -func (s *DescribeClientVpnTargetNetworksOutput) SetClientVpnTargetNetworks(v []*TargetNetwork) *DescribeClientVpnTargetNetworksOutput { - s.ClientVpnTargetNetworks = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeClientVpnTargetNetworksOutput) SetNextToken(v string) *DescribeClientVpnTargetNetworksOutput { - s.NextToken = &v - return s -} - -type DescribeConversionTasksInput struct { - _ struct{} `type:"structure"` - - // The 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"` +// SetInstanceIds sets the InstanceIds field's value. +func (s *DescribeFleetsInstances) SetInstanceIds(v []*string) *DescribeFleetsInstances { + s.InstanceIds = v + return s } -// String returns the string representation -func (s DescribeConversionTasksInput) String() string { - return awsutil.Prettify(s) +// SetInstanceType sets the InstanceType field's value. +func (s *DescribeFleetsInstances) SetInstanceType(v string) *DescribeFleetsInstances { + s.InstanceType = &v + return s } -// GoString returns the string representation -func (s DescribeConversionTasksInput) GoString() string { - return s.String() +// SetLaunchTemplateAndOverrides sets the LaunchTemplateAndOverrides field's value. +func (s *DescribeFleetsInstances) SetLaunchTemplateAndOverrides(v *LaunchTemplateAndOverridesResponse) *DescribeFleetsInstances { + s.LaunchTemplateAndOverrides = v + return s } -// SetConversionTaskIds sets the ConversionTaskIds field's value. -func (s *DescribeConversionTasksInput) SetConversionTaskIds(v []*string) *DescribeConversionTasksInput { - s.ConversionTaskIds = v +// SetLifecycle sets the Lifecycle field's value. +func (s *DescribeFleetsInstances) SetLifecycle(v string) *DescribeFleetsInstances { + s.Lifecycle = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *DescribeConversionTasksInput) SetDryRun(v bool) *DescribeConversionTasksInput { - s.DryRun = &v +// SetPlatform sets the Platform field's value. +func (s *DescribeFleetsInstances) SetPlatform(v string) *DescribeFleetsInstances { + s.Platform = &v return s } -type DescribeConversionTasksOutput struct { +type DescribeFleetsOutput struct { _ struct{} `type:"structure"` - // Information about the conversion tasks. - ConversionTasks []*ConversionTask `locationName:"conversionTasks" locationNameList:"item" type:"list"` + // Information about the EC2 Fleets. + Fleets []*FleetData `locationName:"fleetSet" locationNameList:"item" type:"list"` + + // The token for the next set of results. + NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation -func (s DescribeConversionTasksOutput) String() string { +func (s DescribeFleetsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeConversionTasksOutput) GoString() string { +func (s DescribeFleetsOutput) GoString() string { return s.String() } -// SetConversionTasks sets the ConversionTasks field's value. -func (s *DescribeConversionTasksOutput) SetConversionTasks(v []*ConversionTask) *DescribeConversionTasksOutput { - s.ConversionTasks = v +// SetFleets sets the Fleets field's value. +func (s *DescribeFleetsOutput) SetFleets(v []*FleetData) *DescribeFleetsOutput { + s.Fleets = v return s } -// Contains the parameters for DescribeCustomerGateways. -type DescribeCustomerGatewaysInput struct { - _ struct{} `type:"structure"` +// SetNextToken sets the NextToken field's value. +func (s *DescribeFleetsOutput) SetNextToken(v string) *DescribeFleetsOutput { + s.NextToken = &v + return s +} - // One or more customer gateway IDs. - // - // Default: Describes all your customer gateways. - CustomerGatewayIds []*string `locationName:"CustomerGatewayId" locationNameList:"CustomerGatewayId" type:"list"` +type DescribeFlowLogsInput 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"` + DryRun *bool `type:"boolean"` // One or more filters. // - // * bgp-asn - The customer gateway's Border Gateway Protocol (BGP) Autonomous - // System Number (ASN). + // * deliver-log-status - The status of the logs delivery (SUCCESS | FAILED). // - // * customer-gateway-id - The ID of the customer gateway. + // * log-destination-type - The type of destination to which the flow log + // publishes data. Possible destination types include cloud-watch-logs and + // S3. // - // * ip-address - The IP address of the customer gateway's Internet-routable - // external interface. + // * flow-log-id - The ID of the flow log. // - // * state - The state of the customer gateway (pending | available | deleting - // | deleted). + // * log-group-name - The name of the log group. // - // * type - The type of customer gateway. Currently, the only supported type - // is ipsec.1. + // * resource-id - The ID of the VPC, subnet, or network interface. + // + // * traffic-type - The type of traffic (ACCEPT | REJECT | ALL). // // * tag: - The key/value combination of a tag assigned to the resource. // Use the tag key in the filter name and the tag value as the filter value. @@ -50042,119 +57623,132 @@ type DescribeCustomerGatewaysInput struct { // * tag-key - The key of a tag assigned to the resource. Use this filter // to find all resources assigned a tag with a specific key, regardless of // the tag value. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + Filter []*Filter `locationNameList:"Filter" type:"list"` + + // One or more flow log IDs. + // + // Constraint: Maximum of 1000 flow log IDs. + FlowLogIds []*string `locationName:"FlowLogId" locationNameList:"item" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeCustomerGatewaysInput) String() string { +func (s DescribeFlowLogsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeCustomerGatewaysInput) GoString() string { +func (s DescribeFlowLogsInput) GoString() string { return s.String() } -// SetCustomerGatewayIds sets the CustomerGatewayIds field's value. -func (s *DescribeCustomerGatewaysInput) SetCustomerGatewayIds(v []*string) *DescribeCustomerGatewaysInput { - s.CustomerGatewayIds = v +// SetDryRun sets the DryRun field's value. +func (s *DescribeFlowLogsInput) SetDryRun(v bool) *DescribeFlowLogsInput { + s.DryRun = &v return s } -// SetDryRun sets the DryRun field's value. -func (s *DescribeCustomerGatewaysInput) SetDryRun(v bool) *DescribeCustomerGatewaysInput { - s.DryRun = &v +// SetFilter sets the Filter field's value. +func (s *DescribeFlowLogsInput) SetFilter(v []*Filter) *DescribeFlowLogsInput { + s.Filter = v return s } -// SetFilters sets the Filters field's value. -func (s *DescribeCustomerGatewaysInput) SetFilters(v []*Filter) *DescribeCustomerGatewaysInput { - s.Filters = v +// SetFlowLogIds sets the FlowLogIds field's value. +func (s *DescribeFlowLogsInput) SetFlowLogIds(v []*string) *DescribeFlowLogsInput { + s.FlowLogIds = v return s } -// Contains the output of DescribeCustomerGateways. -type DescribeCustomerGatewaysOutput struct { +// 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 +} + +type DescribeFlowLogsOutput struct { _ struct{} `type:"structure"` - // Information about one or more customer gateways. - CustomerGateways []*CustomerGateway `locationName:"customerGatewaySet" locationNameList:"item" type:"list"` + // 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 DescribeCustomerGatewaysOutput) String() string { +func (s DescribeFlowLogsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeCustomerGatewaysOutput) GoString() string { +func (s DescribeFlowLogsOutput) GoString() string { return s.String() } -// SetCustomerGateways sets the CustomerGateways field's value. -func (s *DescribeCustomerGatewaysOutput) SetCustomerGateways(v []*CustomerGateway) *DescribeCustomerGatewaysOutput { - s.CustomerGateways = v +// SetFlowLogs sets the FlowLogs field's value. +func (s *DescribeFlowLogsOutput) SetFlowLogs(v []*FlowLog) *DescribeFlowLogsOutput { + s.FlowLogs = v return s } -type DescribeDhcpOptionsInput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeFlowLogsOutput) SetNextToken(v string) *DescribeFlowLogsOutput { + s.NextToken = &v + return s +} + +type DescribeFpgaImageAttributeInput struct { _ struct{} `type:"structure"` - // The IDs of one or more DHCP options sets. + // The AFI attribute. // - // Default: Describes all your DHCP options sets. - DhcpOptionsIds []*string `locationName:"DhcpOptionsId" locationNameList:"DhcpOptionsId" type:"list"` + // Attribute is a required field + Attribute *string `type:"string" required:"true" enum:"FpgaImageAttributeName"` // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. - DryRun *bool `locationName:"dryRun" type:"boolean"` + DryRun *bool `type:"boolean"` - // One or more filters. - // - // * dhcp-options-id - The ID of a DHCP options set. - // - // * key - The key for one of the options (for example, domain-name). - // - // * value - The value for one of the options. - // - // * owner-id - The ID of the AWS account that owns the DHCP options set. - // - // * tag: - The key/value combination of a tag assigned to the resource. - // Use the tag key in the filter name and the tag value as the filter value. - // For example, to find all resources that have a tag with the key Owner - // and the value TeamA, specify tag:Owner for the filter name and TeamA for - // the filter value. + // The ID of the AFI. // - // * tag-key - The key of a tag assigned to the resource. Use this filter - // to find all resources assigned a tag with a specific key, regardless of - // the tag value. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int64 `min:"5" type:"integer"` - - // The token for the next page of results. - NextToken *string `type:"string"` + // FpgaImageId is a required field + FpgaImageId *string `type:"string" required:"true"` } // String returns the string representation -func (s DescribeDhcpOptionsInput) String() string { +func (s DescribeFpgaImageAttributeInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeDhcpOptionsInput) GoString() string { +func (s DescribeFpgaImageAttributeInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeDhcpOptionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeDhcpOptionsInput"} - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) +func (s *DescribeFpgaImageAttributeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeFpgaImageAttributeInput"} + if s.Attribute == nil { + invalidParams.Add(request.NewErrParamRequired("Attribute")) + } + if s.FpgaImageId == nil { + invalidParams.Add(request.NewErrParamRequired("FpgaImageId")) } if invalidParams.Len() > 0 { @@ -50163,70 +57757,48 @@ func (s *DescribeDhcpOptionsInput) Validate() error { return nil } -// SetDhcpOptionsIds sets the DhcpOptionsIds field's value. -func (s *DescribeDhcpOptionsInput) SetDhcpOptionsIds(v []*string) *DescribeDhcpOptionsInput { - s.DhcpOptionsIds = v +// SetAttribute sets the Attribute field's value. +func (s *DescribeFpgaImageAttributeInput) SetAttribute(v string) *DescribeFpgaImageAttributeInput { + s.Attribute = &v return s } // SetDryRun sets the DryRun field's value. -func (s *DescribeDhcpOptionsInput) SetDryRun(v bool) *DescribeDhcpOptionsInput { +func (s *DescribeFpgaImageAttributeInput) SetDryRun(v bool) *DescribeFpgaImageAttributeInput { s.DryRun = &v return s } -// SetFilters sets the Filters field's value. -func (s *DescribeDhcpOptionsInput) SetFilters(v []*Filter) *DescribeDhcpOptionsInput { - s.Filters = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeDhcpOptionsInput) SetMaxResults(v int64) *DescribeDhcpOptionsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeDhcpOptionsInput) SetNextToken(v string) *DescribeDhcpOptionsInput { - s.NextToken = &v +// SetFpgaImageId sets the FpgaImageId field's value. +func (s *DescribeFpgaImageAttributeInput) SetFpgaImageId(v string) *DescribeFpgaImageAttributeInput { + s.FpgaImageId = &v return s } -type DescribeDhcpOptionsOutput struct { +type DescribeFpgaImageAttributeOutput struct { _ struct{} `type:"structure"` - // Information about one or more DHCP options sets. - DhcpOptions []*DhcpOptions `locationName:"dhcpOptionsSet" 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"` + // Information about the attribute. + FpgaImageAttribute *FpgaImageAttribute `locationName:"fpgaImageAttribute" type:"structure"` } // String returns the string representation -func (s DescribeDhcpOptionsOutput) String() string { +func (s DescribeFpgaImageAttributeOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeDhcpOptionsOutput) GoString() string { +func (s DescribeFpgaImageAttributeOutput) GoString() string { return s.String() } -// SetDhcpOptions sets the DhcpOptions field's value. -func (s *DescribeDhcpOptionsOutput) SetDhcpOptions(v []*DhcpOptions) *DescribeDhcpOptionsOutput { - s.DhcpOptions = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeDhcpOptionsOutput) SetNextToken(v string) *DescribeDhcpOptionsOutput { - s.NextToken = &v +// SetFpgaImageAttribute sets the FpgaImageAttribute field's value. +func (s *DescribeFpgaImageAttributeOutput) SetFpgaImageAttribute(v *FpgaImageAttribute) *DescribeFpgaImageAttributeOutput { + s.FpgaImageAttribute = v return s } -type DescribeEgressOnlyInternetGatewaysInput struct { +type DescribeFpgaImagesInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -50235,30 +57807,65 @@ type DescribeEgressOnlyInternetGatewaysInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // One or more egress-only internet gateway IDs. - EgressOnlyInternetGatewayIds []*string `locationName:"EgressOnlyInternetGatewayId" locationNameList:"item" type:"list"` + // The filters. + // + // * create-time - The creation time of the AFI. + // + // * fpga-image-id - The FPGA image identifier (AFI ID). + // + // * fpga-image-global-id - The global FPGA image identifier (AGFI ID). + // + // * name - The name of the AFI. + // + // * owner-id - The AWS account ID of the AFI owner. + // + // * product-code - The product code. + // + // * shell-version - The version of the AWS Shell that was used to create + // the bitstream. + // + // * state - The state of the AFI (pending | failed | available | unavailable). + // + // * tag: - The key/value combination of a tag assigned to the resource. + // Use the tag key in the filter name and the tag value as the filter value. + // For example, to find all resources that have a tag with the key Owner + // and the value TeamA, specify tag:Owner for the filter name and TeamA for + // the filter value. + // + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. + // + // * update-time - The time of the most recent update. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. + // The AFI IDs. + FpgaImageIds []*string `locationName:"FpgaImageId" locationNameList:"item" type:"list"` + + // The maximum number of results to return in a single call. MaxResults *int64 `min:"5" type:"integer"` - // The token for the next page of results. + // The token to retrieve the next page of results. NextToken *string `type:"string"` + + // Filters the AFI by 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). + Owners []*string `locationName:"Owner" locationNameList:"Owner" type:"list"` } // String returns the string representation -func (s DescribeEgressOnlyInternetGatewaysInput) String() string { +func (s DescribeFpgaImagesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeEgressOnlyInternetGatewaysInput) GoString() string { +func (s DescribeFpgaImagesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEgressOnlyInternetGatewaysInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEgressOnlyInternetGatewaysInput"} +func (s *DescribeFpgaImagesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeFpgaImagesInput"} if s.MaxResults != nil && *s.MaxResults < 5 { invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) } @@ -50270,34 +57877,46 @@ func (s *DescribeEgressOnlyInternetGatewaysInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DescribeEgressOnlyInternetGatewaysInput) SetDryRun(v bool) *DescribeEgressOnlyInternetGatewaysInput { +func (s *DescribeFpgaImagesInput) SetDryRun(v bool) *DescribeFpgaImagesInput { s.DryRun = &v return s } -// SetEgressOnlyInternetGatewayIds sets the EgressOnlyInternetGatewayIds field's value. -func (s *DescribeEgressOnlyInternetGatewaysInput) SetEgressOnlyInternetGatewayIds(v []*string) *DescribeEgressOnlyInternetGatewaysInput { - s.EgressOnlyInternetGatewayIds = v +// SetFilters sets the Filters field's value. +func (s *DescribeFpgaImagesInput) SetFilters(v []*Filter) *DescribeFpgaImagesInput { + s.Filters = v + return s +} + +// SetFpgaImageIds sets the FpgaImageIds field's value. +func (s *DescribeFpgaImagesInput) SetFpgaImageIds(v []*string) *DescribeFpgaImagesInput { + s.FpgaImageIds = v return s } // SetMaxResults sets the MaxResults field's value. -func (s *DescribeEgressOnlyInternetGatewaysInput) SetMaxResults(v int64) *DescribeEgressOnlyInternetGatewaysInput { +func (s *DescribeFpgaImagesInput) SetMaxResults(v int64) *DescribeFpgaImagesInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeEgressOnlyInternetGatewaysInput) SetNextToken(v string) *DescribeEgressOnlyInternetGatewaysInput { +func (s *DescribeFpgaImagesInput) SetNextToken(v string) *DescribeFpgaImagesInput { s.NextToken = &v return s } -type DescribeEgressOnlyInternetGatewaysOutput struct { +// SetOwners sets the Owners field's value. +func (s *DescribeFpgaImagesInput) SetOwners(v []*string) *DescribeFpgaImagesInput { + s.Owners = v + return s +} + +type DescribeFpgaImagesOutput struct { _ struct{} `type:"structure"` - // Information about the egress-only internet gateways. - EgressOnlyInternetGateways []*EgressOnlyInternetGateway `locationName:"egressOnlyInternetGatewaySet" locationNameList:"item" type:"list"` + // Information about the FPGA images. + FpgaImages []*FpgaImage `locationName:"fpgaImageSet" 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. @@ -50305,80 +57924,80 @@ type DescribeEgressOnlyInternetGatewaysOutput struct { } // String returns the string representation -func (s DescribeEgressOnlyInternetGatewaysOutput) String() string { +func (s DescribeFpgaImagesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeEgressOnlyInternetGatewaysOutput) GoString() string { +func (s DescribeFpgaImagesOutput) GoString() string { return s.String() } -// SetEgressOnlyInternetGateways sets the EgressOnlyInternetGateways field's value. -func (s *DescribeEgressOnlyInternetGatewaysOutput) SetEgressOnlyInternetGateways(v []*EgressOnlyInternetGateway) *DescribeEgressOnlyInternetGatewaysOutput { - s.EgressOnlyInternetGateways = v +// SetFpgaImages sets the FpgaImages field's value. +func (s *DescribeFpgaImagesOutput) SetFpgaImages(v []*FpgaImage) *DescribeFpgaImagesOutput { + s.FpgaImages = v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeEgressOnlyInternetGatewaysOutput) SetNextToken(v string) *DescribeEgressOnlyInternetGatewaysOutput { +func (s *DescribeFpgaImagesOutput) SetNextToken(v string) *DescribeFpgaImagesOutput { s.NextToken = &v return s } -type DescribeElasticGpusInput struct { +type DescribeHostReservationOfferingsInput 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 Elastic Graphics accelerator IDs. - ElasticGpuIds []*string `locationName:"ElasticGpuId" locationNameList:"item" type:"list"` - // The filters. // - // * availability-zone - The Availability Zone in which the Elastic Graphics - // accelerator resides. - // - // * elastic-gpu-health - The status of the Elastic Graphics accelerator - // (OK | IMPAIRED). - // - // * elastic-gpu-state - The state of the Elastic Graphics accelerator (ATTACHED). - // - // * elastic-gpu-type - The type of Elastic Graphics accelerator; for example, - // eg1.medium. + // * instance-family - The instance family of the offering (for example, + // m4). // - // * instance-id - The ID of the instance to which the Elastic Graphics accelerator - // is associated. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + // * payment-option - The payment option (NoUpfront | PartialUpfront | AllUpfront). + Filter []*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. This - // value can be between 5 and 1000. - MaxResults *int64 `min:"10" type:"integer"` + // This is the maximum duration of the reservation 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 token to request the next page of results. + // 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 receive an error. + MaxResults *int64 `min:"5" 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 DescribeElasticGpusInput) String() string { +func (s DescribeHostReservationOfferingsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeElasticGpusInput) GoString() string { +func (s DescribeHostReservationOfferingsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeElasticGpusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeElasticGpusInput"} - if s.MaxResults != nil && *s.MaxResults < 10 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 10)) +func (s *DescribeHostReservationOfferingsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeHostReservationOfferingsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) } if invalidParams.Len() > 0 { @@ -50387,340 +58006,324 @@ func (s *DescribeElasticGpusInput) Validate() error { return nil } -// SetDryRun sets the DryRun field's value. -func (s *DescribeElasticGpusInput) SetDryRun(v bool) *DescribeElasticGpusInput { - s.DryRun = &v +// SetFilter sets the Filter field's value. +func (s *DescribeHostReservationOfferingsInput) SetFilter(v []*Filter) *DescribeHostReservationOfferingsInput { + s.Filter = v return s } -// SetElasticGpuIds sets the ElasticGpuIds field's value. -func (s *DescribeElasticGpusInput) SetElasticGpuIds(v []*string) *DescribeElasticGpusInput { - s.ElasticGpuIds = v +// SetMaxDuration sets the MaxDuration field's value. +func (s *DescribeHostReservationOfferingsInput) SetMaxDuration(v int64) *DescribeHostReservationOfferingsInput { + s.MaxDuration = &v return s } -// SetFilters sets the Filters field's value. -func (s *DescribeElasticGpusInput) SetFilters(v []*Filter) *DescribeElasticGpusInput { - s.Filters = v +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeHostReservationOfferingsInput) SetMaxResults(v int64) *DescribeHostReservationOfferingsInput { + s.MaxResults = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeElasticGpusInput) SetMaxResults(v int64) *DescribeElasticGpusInput { - s.MaxResults = &v +// 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 *DescribeElasticGpusInput) SetNextToken(v string) *DescribeElasticGpusInput { +func (s *DescribeHostReservationOfferingsInput) SetNextToken(v string) *DescribeHostReservationOfferingsInput { s.NextToken = &v return s } -type DescribeElasticGpusOutput struct { - _ struct{} `type:"structure"` - - // Information about the Elastic Graphics accelerators. - ElasticGpuSet []*ElasticGpus `locationName:"elasticGpuSet" locationNameList:"item" type:"list"` +// SetOfferingId sets the OfferingId field's value. +func (s *DescribeHostReservationOfferingsInput) SetOfferingId(v string) *DescribeHostReservationOfferingsInput { + s.OfferingId = &v + return s +} - // The total number of items to return. If the total number of items available - // is more than the value specified in max-items then a Next-Token will be provided - // in the output that you can use to resume pagination. - MaxResults *int64 `locationName:"maxResults" type:"integer"` +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" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DescribeElasticGpusOutput) String() string { +func (s DescribeHostReservationOfferingsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeElasticGpusOutput) GoString() string { +func (s DescribeHostReservationOfferingsOutput) GoString() string { return s.String() } -// SetElasticGpuSet sets the ElasticGpuSet field's value. -func (s *DescribeElasticGpusOutput) SetElasticGpuSet(v []*ElasticGpus) *DescribeElasticGpusOutput { - s.ElasticGpuSet = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeElasticGpusOutput) SetMaxResults(v int64) *DescribeElasticGpusOutput { - s.MaxResults = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeHostReservationOfferingsOutput) SetNextToken(v string) *DescribeHostReservationOfferingsOutput { + s.NextToken = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeElasticGpusOutput) SetNextToken(v string) *DescribeElasticGpusOutput { - s.NextToken = &v +// SetOfferingSet sets the OfferingSet field's value. +func (s *DescribeHostReservationOfferingsOutput) SetOfferingSet(v []*HostOffering) *DescribeHostReservationOfferingsOutput { + s.OfferingSet = v return s } -type DescribeExportImageTasksInput struct { +type DescribeHostReservationsInput 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 export image tasks. - ExportImageTaskIds []*string `locationName:"ExportImageTaskId" locationNameList:"ExportImageTaskId" type:"list"` + // The filters. + // + // * instance-family - The instance family (for example, m4). + // + // * payment-option - The payment option (NoUpfront | PartialUpfront | AllUpfront). + // + // * state - The state of the reservation (payment-pending | payment-failed + // | active | retired). + // + // * tag: - The key/value combination of a tag assigned to the resource. + // Use the tag key in the filter name and the tag value as the filter value. + // For example, to find all resources that have a tag with the key Owner + // and the value TeamA, specify tag:Owner for the filter name and TeamA for + // the filter value. + // + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. + Filter []*Filter `locationNameList:"Filter" type:"list"` - // Filter tasks using the task-state filter and one of the following values: - // active, completed, deleting, or deleted. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + // The host reservation IDs. + HostReservationIdSet []*string `locationNameList:"item" type:"list"` - // The maximum number of results to return in a single call. - MaxResults *int64 `min:"1" 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 receive an error. + MaxResults *int64 `type:"integer"` - // A token that indicates the next page of results. + // The token to use to retrieve the next page of results. NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeExportImageTasksInput) String() string { +func (s DescribeHostReservationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeExportImageTasksInput) GoString() string { +func (s DescribeHostReservationsInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeExportImageTasksInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeExportImageTasksInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDryRun sets the DryRun field's value. -func (s *DescribeExportImageTasksInput) SetDryRun(v bool) *DescribeExportImageTasksInput { - s.DryRun = &v - return s -} - -// SetExportImageTaskIds sets the ExportImageTaskIds field's value. -func (s *DescribeExportImageTasksInput) SetExportImageTaskIds(v []*string) *DescribeExportImageTasksInput { - s.ExportImageTaskIds = v +// SetFilter sets the Filter field's value. +func (s *DescribeHostReservationsInput) SetFilter(v []*Filter) *DescribeHostReservationsInput { + s.Filter = v return s } -// SetFilters sets the Filters field's value. -func (s *DescribeExportImageTasksInput) SetFilters(v []*Filter) *DescribeExportImageTasksInput { - s.Filters = v +// 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 *DescribeExportImageTasksInput) SetMaxResults(v int64) *DescribeExportImageTasksInput { +func (s *DescribeHostReservationsInput) SetMaxResults(v int64) *DescribeHostReservationsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeExportImageTasksInput) SetNextToken(v string) *DescribeExportImageTasksInput { +func (s *DescribeHostReservationsInput) SetNextToken(v string) *DescribeHostReservationsInput { s.NextToken = &v return s } -type DescribeExportImageTasksOutput struct { +type DescribeHostReservationsOutput struct { _ struct{} `type:"structure"` - // Information about the export image tasks. - ExportImageTasks []*ExportImageTask `locationName:"exportImageTaskSet" locationNameList:"item" type:"list"` + // Details about the reservation's configuration. + HostReservationSet []*HostReservation `locationName:"hostReservationSet" 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. + // 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 DescribeExportImageTasksOutput) String() string { +func (s DescribeHostReservationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeExportImageTasksOutput) GoString() string { +func (s DescribeHostReservationsOutput) GoString() string { return s.String() } -// SetExportImageTasks sets the ExportImageTasks field's value. -func (s *DescribeExportImageTasksOutput) SetExportImageTasks(v []*ExportImageTask) *DescribeExportImageTasksOutput { - s.ExportImageTasks = v +// 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 *DescribeExportImageTasksOutput) SetNextToken(v string) *DescribeExportImageTasksOutput { +func (s *DescribeHostReservationsOutput) SetNextToken(v string) *DescribeHostReservationsOutput { s.NextToken = &v return s } -type DescribeExportTasksInput struct { +type DescribeHostsInput struct { _ struct{} `type:"structure"` - // The export task IDs. - ExportTaskIds []*string `locationName:"exportTaskId" locationNameList:"ExportTaskId" type:"list"` + // The filters. + // + // * auto-placement - Whether auto-placement is enabled or disabled (on | + // off). + // + // * availability-zone - The Availability Zone of the host. + // + // * client-token - The idempotency token that you provided when you allocated + // the host. + // + // * host-reservation-id - The ID of the reservation assigned to this host. + // + // * instance-type - The instance type size that the Dedicated Host is configured + // to support. + // + // * state - The allocation state of the Dedicated Host (available | under-assessment + // | permanent-failure | released | released-permanent-failure). + // + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. + 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 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 use to retrieve the next page of results. + NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation -func (s DescribeExportTasksInput) String() string { +func (s DescribeHostsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeExportTasksInput) GoString() string { +func (s DescribeHostsInput) GoString() string { return s.String() } -// SetExportTaskIds sets the ExportTaskIds field's value. -func (s *DescribeExportTasksInput) SetExportTaskIds(v []*string) *DescribeExportTasksInput { - s.ExportTaskIds = v +// SetFilter sets the Filter field's value. +func (s *DescribeHostsInput) SetFilter(v []*Filter) *DescribeHostsInput { + s.Filter = v return s } -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) +// SetHostIds sets the HostIds field's value. +func (s *DescribeHostsInput) SetHostIds(v []*string) *DescribeHostsInput { + s.HostIds = v + return s } -// GoString returns the string representation -func (s DescribeExportTasksOutput) GoString() string { - return s.String() +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeHostsInput) SetMaxResults(v int64) *DescribeHostsInput { + s.MaxResults = &v + return s } -// SetExportTasks sets the ExportTasks field's value. -func (s *DescribeExportTasksOutput) SetExportTasks(v []*ExportTask) *DescribeExportTasksOutput { - s.ExportTasks = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeHostsInput) SetNextToken(v string) *DescribeHostsInput { + s.NextToken = &v return s } -// Describes the instances that could not be launched by the fleet. -type DescribeFleetError struct { +type DescribeHostsOutput struct { _ struct{} `type:"structure"` - // The error code that indicates why the instance could not be launched. For - // more information about error codes, see Error Codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html.html). - ErrorCode *string `locationName:"errorCode" type:"string"` - - // The error message that describes why the instance could not be launched. - // For more information about error messages, see ee Error Codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html.html). - ErrorMessage *string `locationName:"errorMessage" type:"string"` - - // The launch templates and overrides that were used for launching the instances. - // Any parameters that you specify in the Overrides override the same parameters - // in the launch template. - LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse `locationName:"launchTemplateAndOverrides" type:"structure"` + // Information about the Dedicated Hosts. + Hosts []*Host `locationName:"hostSet" locationNameList:"item" type:"list"` - // Indicates if the instance that could not be launched was a Spot Instance - // or On-Demand Instance. - Lifecycle *string `locationName:"lifecycle" type:"string" enum:"InstanceLifecycle"` + // 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 DescribeFleetError) String() string { +func (s DescribeHostsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeFleetError) GoString() string { +func (s DescribeHostsOutput) GoString() string { return s.String() } -// SetErrorCode sets the ErrorCode field's value. -func (s *DescribeFleetError) SetErrorCode(v string) *DescribeFleetError { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *DescribeFleetError) SetErrorMessage(v string) *DescribeFleetError { - s.ErrorMessage = &v - return s -} - -// SetLaunchTemplateAndOverrides sets the LaunchTemplateAndOverrides field's value. -func (s *DescribeFleetError) SetLaunchTemplateAndOverrides(v *LaunchTemplateAndOverridesResponse) *DescribeFleetError { - s.LaunchTemplateAndOverrides = v +// SetHosts sets the Hosts field's value. +func (s *DescribeHostsOutput) SetHosts(v []*Host) *DescribeHostsOutput { + s.Hosts = v return s } -// SetLifecycle sets the Lifecycle field's value. -func (s *DescribeFleetError) SetLifecycle(v string) *DescribeFleetError { - s.Lifecycle = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeHostsOutput) SetNextToken(v string) *DescribeHostsOutput { + s.NextToken = &v return s } -type DescribeFleetHistoryInput struct { +type DescribeIamInstanceProfileAssociationsInput 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 type of events to describe. By default, all events are described. - EventType *string `type:"string" enum:"FleetEventType"` + // The IAM instance profile associations. + AssociationIds []*string `locationName:"AssociationId" locationNameList:"AssociationId" type:"list"` - // The ID of the EC2 Fleet. + // The filters. // - // FleetId is a required field - FleetId *string `type:"string" required:"true"` + // * 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. 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 `type:"integer"` + // 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 for the next set of results. + // The token to request the next page of results. NextToken *string `type:"string"` - - // The start date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - // - // StartTime is a required field - StartTime *time.Time `type:"timestamp" required:"true"` } // String returns the string representation -func (s DescribeFleetHistoryInput) String() string { +func (s DescribeIamInstanceProfileAssociationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeFleetHistoryInput) GoString() string { +func (s DescribeIamInstanceProfileAssociationsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeFleetHistoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeFleetHistoryInput"} - if s.FleetId == nil { - invalidParams.Add(request.NewErrParamRequired("FleetId")) - } - if s.StartTime == nil { - invalidParams.Add(request.NewErrParamRequired("StartTime")) +func (s *DescribeIamInstanceProfileAssociationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeIamInstanceProfileAssociationsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) } if invalidParams.Len() > 0 { @@ -50729,147 +58332,149 @@ func (s *DescribeFleetHistoryInput) Validate() error { return nil } -// SetDryRun sets the DryRun field's value. -func (s *DescribeFleetHistoryInput) SetDryRun(v bool) *DescribeFleetHistoryInput { - s.DryRun = &v - return s -} - -// SetEventType sets the EventType field's value. -func (s *DescribeFleetHistoryInput) SetEventType(v string) *DescribeFleetHistoryInput { - s.EventType = &v +// SetAssociationIds sets the AssociationIds field's value. +func (s *DescribeIamInstanceProfileAssociationsInput) SetAssociationIds(v []*string) *DescribeIamInstanceProfileAssociationsInput { + s.AssociationIds = v return s } -// SetFleetId sets the FleetId field's value. -func (s *DescribeFleetHistoryInput) SetFleetId(v string) *DescribeFleetHistoryInput { - s.FleetId = &v +// 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 *DescribeFleetHistoryInput) SetMaxResults(v int64) *DescribeFleetHistoryInput { +func (s *DescribeIamInstanceProfileAssociationsInput) SetMaxResults(v int64) *DescribeIamInstanceProfileAssociationsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeFleetHistoryInput) SetNextToken(v string) *DescribeFleetHistoryInput { +func (s *DescribeIamInstanceProfileAssociationsInput) SetNextToken(v string) *DescribeIamInstanceProfileAssociationsInput { s.NextToken = &v return s } -// SetStartTime sets the StartTime field's value. -func (s *DescribeFleetHistoryInput) SetStartTime(v time.Time) *DescribeFleetHistoryInput { - s.StartTime = &v - return s -} - -type DescribeFleetHistoryOutput struct { +type DescribeIamInstanceProfileAssociationsOutput struct { _ struct{} `type:"structure"` - // The ID of the EC Fleet. - FleetId *string `locationName:"fleetId" type:"string"` - - // Information about the events in the history of the EC2 Fleet. - HistoryRecords []*HistoryRecordEntry `locationName:"historyRecordSet" locationNameList:"item" type:"list"` - - // 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 *time.Time `locationName:"lastEvaluatedTime" type:"timestamp"` + // Information about the IAM instance profile associations. + IamInstanceProfileAssociations []*IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociationSet" locationNameList:"item" type:"list"` - // The token for the next set of results. + // 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 start date and time for the events, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). - StartTime *time.Time `locationName:"startTime" type:"timestamp"` } // String returns the string representation -func (s DescribeFleetHistoryOutput) String() string { +func (s DescribeIamInstanceProfileAssociationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeFleetHistoryOutput) GoString() string { +func (s DescribeIamInstanceProfileAssociationsOutput) GoString() string { return s.String() } -// SetFleetId sets the FleetId field's value. -func (s *DescribeFleetHistoryOutput) SetFleetId(v string) *DescribeFleetHistoryOutput { - s.FleetId = &v +// SetIamInstanceProfileAssociations sets the IamInstanceProfileAssociations field's value. +func (s *DescribeIamInstanceProfileAssociationsOutput) SetIamInstanceProfileAssociations(v []*IamInstanceProfileAssociation) *DescribeIamInstanceProfileAssociationsOutput { + s.IamInstanceProfileAssociations = v return s } -// SetHistoryRecords sets the HistoryRecords field's value. -func (s *DescribeFleetHistoryOutput) SetHistoryRecords(v []*HistoryRecordEntry) *DescribeFleetHistoryOutput { - s.HistoryRecords = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeIamInstanceProfileAssociationsOutput) SetNextToken(v string) *DescribeIamInstanceProfileAssociationsOutput { + s.NextToken = &v return s } -// SetLastEvaluatedTime sets the LastEvaluatedTime field's value. -func (s *DescribeFleetHistoryOutput) SetLastEvaluatedTime(v time.Time) *DescribeFleetHistoryOutput { - s.LastEvaluatedTime = &v - return s +type DescribeIdFormatInput struct { + _ struct{} `type:"structure"` + + // The type of resource: bundle | conversion-task | customer-gateway | dhcp-options + // | elastic-ip-allocation | elastic-ip-association | export-task | flow-log + // | image | import-task | instance | internet-gateway | network-acl | network-acl-association + // | network-interface | network-interface-attachment | prefix-list | reservation + // | route-table | route-table-association | security-group | snapshot | subnet + // | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association + // | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway + Resource *string `type:"string"` } -// SetNextToken sets the NextToken field's value. -func (s *DescribeFleetHistoryOutput) SetNextToken(v string) *DescribeFleetHistoryOutput { - s.NextToken = &v - return s +// String returns the string representation +func (s DescribeIdFormatInput) String() string { + return awsutil.Prettify(s) } -// SetStartTime sets the StartTime field's value. -func (s *DescribeFleetHistoryOutput) SetStartTime(v time.Time) *DescribeFleetHistoryOutput { - s.StartTime = &v +// 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 } -type DescribeFleetInstancesInput struct { +type DescribeIdFormatOutput 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"` + // Information about the ID format for the resource. + Statuses []*IdFormat `locationName:"statusSet" locationNameList:"item" type:"list"` +} - // The filters. - // - // * instance-type - The instance type. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` +// String returns the string representation +func (s DescribeIdFormatOutput) String() string { + return awsutil.Prettify(s) +} - // The ID of the EC2 Fleet. - // - // FleetId is a required field - FleetId *string `type:"string" required:"true"` +// GoString returns the string representation +func (s DescribeIdFormatOutput) GoString() string { + return s.String() +} - // 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 `type:"integer"` +// SetStatuses sets the Statuses field's value. +func (s *DescribeIdFormatOutput) SetStatuses(v []*IdFormat) *DescribeIdFormatOutput { + s.Statuses = v + return s +} - // The token for the next set of results. - NextToken *string `type:"string"` +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: bundle | conversion-task | customer-gateway | dhcp-options + // | elastic-ip-allocation | elastic-ip-association | export-task | flow-log + // | image | import-task | instance | internet-gateway | network-acl | network-acl-association + // | network-interface | network-interface-attachment | prefix-list | reservation + // | route-table | route-table-association | security-group | snapshot | subnet + // | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association + // | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway + Resource *string `locationName:"resource" type:"string"` } // String returns the string representation -func (s DescribeFleetInstancesInput) String() string { +func (s DescribeIdentityIdFormatInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeFleetInstancesInput) GoString() string { +func (s DescribeIdentityIdFormatInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeFleetInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeFleetInstancesInput"} - if s.FleetId == nil { - invalidParams.Add(request.NewErrParamRequired("FleetId")) +func (s *DescribeIdentityIdFormatInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeIdentityIdFormatInput"} + if s.PrincipalArn == nil { + invalidParams.Add(request.NewErrParamRequired("PrincipalArn")) } if invalidParams.Len() > 0 { @@ -50878,452 +58483,466 @@ func (s *DescribeFleetInstancesInput) Validate() error { return nil } -// SetDryRun sets the DryRun field's value. -func (s *DescribeFleetInstancesInput) SetDryRun(v bool) *DescribeFleetInstancesInput { - s.DryRun = &v - return s -} - -// SetFilters sets the Filters field's value. -func (s *DescribeFleetInstancesInput) SetFilters(v []*Filter) *DescribeFleetInstancesInput { - s.Filters = v - return s -} - -// SetFleetId sets the FleetId field's value. -func (s *DescribeFleetInstancesInput) SetFleetId(v string) *DescribeFleetInstancesInput { - s.FleetId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeFleetInstancesInput) SetMaxResults(v int64) *DescribeFleetInstancesInput { - s.MaxResults = &v +// SetPrincipalArn sets the PrincipalArn field's value. +func (s *DescribeIdentityIdFormatInput) SetPrincipalArn(v string) *DescribeIdentityIdFormatInput { + s.PrincipalArn = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeFleetInstancesInput) SetNextToken(v string) *DescribeFleetInstancesInput { - s.NextToken = &v +// SetResource sets the Resource field's value. +func (s *DescribeIdentityIdFormatInput) SetResource(v string) *DescribeIdentityIdFormatInput { + s.Resource = &v return s } -type DescribeFleetInstancesOutput struct { +type DescribeIdentityIdFormatOutput struct { _ struct{} `type:"structure"` - // The running instances. This list is refreshed periodically and might be out - // of date. - ActiveInstances []*ActiveInstance `locationName:"activeInstanceSet" locationNameList:"item" type:"list"` - - // The ID of the EC2 Fleet. - FleetId *string `locationName:"fleetId" type:"string"` - - // The token for the next set of results. - NextToken *string `locationName:"nextToken" type:"string"` + // Information about the ID format for the resources. + Statuses []*IdFormat `locationName:"statusSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DescribeFleetInstancesOutput) String() string { +func (s DescribeIdentityIdFormatOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeFleetInstancesOutput) GoString() string { +func (s DescribeIdentityIdFormatOutput) GoString() string { return s.String() } -// SetActiveInstances sets the ActiveInstances field's value. -func (s *DescribeFleetInstancesOutput) SetActiveInstances(v []*ActiveInstance) *DescribeFleetInstancesOutput { - s.ActiveInstances = v - return s -} - -// SetFleetId sets the FleetId field's value. -func (s *DescribeFleetInstancesOutput) SetFleetId(v string) *DescribeFleetInstancesOutput { - s.FleetId = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *DescribeFleetInstancesOutput) SetNextToken(v string) *DescribeFleetInstancesOutput { - s.NextToken = &v +// SetStatuses sets the Statuses field's value. +func (s *DescribeIdentityIdFormatOutput) SetStatuses(v []*IdFormat) *DescribeIdentityIdFormatOutput { + s.Statuses = v return s } -type DescribeFleetsInput struct { +// Contains the parameters for DescribeImageAttribute. +type DescribeImageAttributeInput 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 filters. - // - // * activity-status - The progress of the EC2 Fleet ( error | pending-fulfillment - // | pending-termination | fulfilled). - // - // * excess-capacity-termination-policy - Indicates whether to terminate - // running instances if the target capacity is decreased below the current - // EC2 Fleet size (true | false). - // - // * fleet-state - The state of the EC2 Fleet (submitted | active | deleted - // | failed | deleted-running | deleted-terminating | modifying). + + // The AMI attribute. // - // * replace-unhealthy-instances - Indicates whether EC2 Fleet should replace - // unhealthy instances (true | false). + // 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. // - // * type - The type of request (instant | request | maintain). - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The ID of the EC2 Fleets. - FleetIds []*string `locationName:"FleetId" type:"list"` + // Attribute is a required field + Attribute *string `type:"string" required:"true" enum:"ImageAttributeName"` - // 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 `type:"integer"` + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides 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 token for the next set of results. - NextToken *string `type:"string"` + // The ID of the AMI. + // + // ImageId is a required field + ImageId *string `type:"string" required:"true"` } // String returns the string representation -func (s DescribeFleetsInput) String() string { +func (s DescribeImageAttributeInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeFleetsInput) GoString() string { +func (s DescribeImageAttributeInput) GoString() string { return s.String() } -// SetDryRun sets the DryRun field's value. -func (s *DescribeFleetsInput) SetDryRun(v bool) *DescribeFleetsInput { - s.DryRun = &v - return s -} +// 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")) + } -// SetFilters sets the Filters field's value. -func (s *DescribeFleetsInput) SetFilters(v []*Filter) *DescribeFleetsInput { - s.Filters = v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetFleetIds sets the FleetIds field's value. -func (s *DescribeFleetsInput) SetFleetIds(v []*string) *DescribeFleetsInput { - s.FleetIds = v +// SetAttribute sets the Attribute field's value. +func (s *DescribeImageAttributeInput) SetAttribute(v string) *DescribeImageAttributeInput { + s.Attribute = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeFleetsInput) SetMaxResults(v int64) *DescribeFleetsInput { - s.MaxResults = &v +// SetDryRun sets the DryRun field's value. +func (s *DescribeImageAttributeInput) SetDryRun(v bool) *DescribeImageAttributeInput { + s.DryRun = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeFleetsInput) SetNextToken(v string) *DescribeFleetsInput { - s.NextToken = &v +// SetImageId sets the ImageId field's value. +func (s *DescribeImageAttributeInput) SetImageId(v string) *DescribeImageAttributeInput { + s.ImageId = &v return s } -// Describes the instances that were launched by the fleet. -type DescribeFleetsInstances struct { +// Describes an image attribute. +type DescribeImageAttributeOutput struct { _ struct{} `type:"structure"` - // The IDs of the instances. - InstanceIds []*string `locationName:"instanceIds" locationNameList:"item" type:"list"` + // The block device mapping entries. + BlockDeviceMappings []*BlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` - // The instance type. - InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` + // A description for the AMI. + Description *AttributeValue `locationName:"description" type:"structure"` - // The launch templates and overrides that were used for launching the instances. - // Any parameters that you specify in the Overrides override the same parameters - // in the launch template. - LaunchTemplateAndOverrides *LaunchTemplateAndOverridesResponse `locationName:"launchTemplateAndOverrides" type:"structure"` + // The ID of the AMI. + ImageId *string `locationName:"imageId" type:"string"` - // Indicates if the instance that was launched is a Spot Instance or On-Demand - // Instance. - Lifecycle *string `locationName:"lifecycle" type:"string" enum:"InstanceLifecycle"` + // The kernel ID. + KernelId *AttributeValue `locationName:"kernel" type:"structure"` - // The value is Windows for Windows instances; otherwise blank. - Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` + // The launch permissions. + LaunchPermissions []*LaunchPermission `locationName:"launchPermission" locationNameList:"item" type:"list"` + + // The 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 DescribeFleetsInstances) String() string { +func (s DescribeImageAttributeOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeFleetsInstances) GoString() string { +func (s DescribeImageAttributeOutput) GoString() string { return s.String() } -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeFleetsInstances) SetInstanceIds(v []*string) *DescribeFleetsInstances { - s.InstanceIds = v +// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. +func (s *DescribeImageAttributeOutput) SetBlockDeviceMappings(v []*BlockDeviceMapping) *DescribeImageAttributeOutput { + s.BlockDeviceMappings = v return s } -// SetInstanceType sets the InstanceType field's value. -func (s *DescribeFleetsInstances) SetInstanceType(v string) *DescribeFleetsInstances { - s.InstanceType = &v +// SetDescription sets the Description field's value. +func (s *DescribeImageAttributeOutput) SetDescription(v *AttributeValue) *DescribeImageAttributeOutput { + s.Description = v return s } -// SetLaunchTemplateAndOverrides sets the LaunchTemplateAndOverrides field's value. -func (s *DescribeFleetsInstances) SetLaunchTemplateAndOverrides(v *LaunchTemplateAndOverridesResponse) *DescribeFleetsInstances { - s.LaunchTemplateAndOverrides = v +// SetImageId sets the ImageId field's value. +func (s *DescribeImageAttributeOutput) SetImageId(v string) *DescribeImageAttributeOutput { + s.ImageId = &v return s } -// SetLifecycle sets the Lifecycle field's value. -func (s *DescribeFleetsInstances) SetLifecycle(v string) *DescribeFleetsInstances { - s.Lifecycle = &v +// SetKernelId sets the KernelId field's value. +func (s *DescribeImageAttributeOutput) SetKernelId(v *AttributeValue) *DescribeImageAttributeOutput { + s.KernelId = v return s } -// SetPlatform sets the Platform field's value. -func (s *DescribeFleetsInstances) SetPlatform(v string) *DescribeFleetsInstances { - s.Platform = &v +// SetLaunchPermissions sets the LaunchPermissions field's value. +func (s *DescribeImageAttributeOutput) SetLaunchPermissions(v []*LaunchPermission) *DescribeImageAttributeOutput { + s.LaunchPermissions = v return s } -type DescribeFleetsOutput struct { - _ struct{} `type:"structure"` - - // Information about the EC2 Fleets. - Fleets []*FleetData `locationName:"fleetSet" locationNameList:"item" type:"list"` - - // The token for the next set of results. - NextToken *string `locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s DescribeFleetsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeFleetsOutput) GoString() string { - return s.String() +// SetProductCodes sets the ProductCodes field's value. +func (s *DescribeImageAttributeOutput) SetProductCodes(v []*ProductCode) *DescribeImageAttributeOutput { + s.ProductCodes = v + return s } -// SetFleets sets the Fleets field's value. -func (s *DescribeFleetsOutput) SetFleets(v []*FleetData) *DescribeFleetsOutput { - s.Fleets = v +// SetRamdiskId sets the RamdiskId field's value. +func (s *DescribeImageAttributeOutput) SetRamdiskId(v *AttributeValue) *DescribeImageAttributeOutput { + s.RamdiskId = v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeFleetsOutput) SetNextToken(v string) *DescribeFleetsOutput { - s.NextToken = &v +// SetSriovNetSupport sets the SriovNetSupport field's value. +func (s *DescribeImageAttributeOutput) SetSriovNetSupport(v *AttributeValue) *DescribeImageAttributeOutput { + s.SriovNetSupport = v return s } -type DescribeFlowLogsInput struct { +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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // One or more filters. + // 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"` + + // The filters. // - // * deliver-log-status - The status of the logs delivery (SUCCESS | FAILED). + // * architecture - The image architecture (i386 | x86_64 | arm64). // - // * log-destination-type - The type of destination to which the flow log - // publishes data. Possible destination types include cloud-watch-logs and - // S3. + // * block-device-mapping.delete-on-termination - A Boolean value that indicates + // whether the Amazon EBS volume is deleted on instance termination. // - // * flow-log-id - The ID of the flow log. + // * block-device-mapping.device-name - The device name specified in the + // block device mapping (for example, /dev/sdh or xvdh). // - // * log-group-name - The name of the log group. + // * block-device-mapping.snapshot-id - The ID of the snapshot used for the + // EBS volume. // - // * resource-id - The ID of the VPC, subnet, or network interface. + // * block-device-mapping.volume-size - The volume size of the EBS volume, + // in GiB. // - // * traffic-type - The type of traffic (ACCEPT | REJECT | ALL). - Filter []*Filter `locationNameList:"Filter" type:"list"` - - // One or more flow log IDs. + // * block-device-mapping.volume-type - The volume type of the EBS volume + // (gp2 | io1 | st1 | sc1 | standard). // - // Constraint: Maximum of 1000 flow log IDs. - FlowLogIds []*string `locationName:"FlowLogId" locationNameList:"item" type:"list"` + // * block-device-mapping.encrypted - A Boolean that indicates whether the + // EBS volume is encrypted. + // + // * 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 device 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. + // + // * sriov-net-support - A value of simple indicates that enhanced networking + // with the Intel 82599 VF interface is enabled. + // + // * tag: - The key/value combination of a tag assigned to the resource. + // Use the tag key in the filter name and the tag value as the filter value. + // For example, to find all resources that have a tag with the key Owner + // and the value TeamA, specify tag:Owner for the filter name and TeamA for + // the filter value. + // + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. + // + // * virtualization-type - The virtualization type (paravirtual | hvm). + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int64 `type:"integer"` + // The image IDs. + // + // Default: Describes all images available to you. + ImageIds []*string `locationName:"ImageId" locationNameList:"ImageId" type:"list"` - // The token for the next page of results. - NextToken *string `type:"string"` + // 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 DescribeFlowLogsInput) String() string { +func (s DescribeImagesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeFlowLogsInput) GoString() string { +func (s DescribeImagesInput) GoString() string { return s.String() } // SetDryRun sets the DryRun field's value. -func (s *DescribeFlowLogsInput) SetDryRun(v bool) *DescribeFlowLogsInput { +func (s *DescribeImagesInput) SetDryRun(v bool) *DescribeImagesInput { s.DryRun = &v return s } -// SetFilter sets the Filter field's value. -func (s *DescribeFlowLogsInput) SetFilter(v []*Filter) *DescribeFlowLogsInput { - s.Filter = v +// SetExecutableUsers sets the ExecutableUsers field's value. +func (s *DescribeImagesInput) SetExecutableUsers(v []*string) *DescribeImagesInput { + s.ExecutableUsers = v return s } -// SetFlowLogIds sets the FlowLogIds field's value. -func (s *DescribeFlowLogsInput) SetFlowLogIds(v []*string) *DescribeFlowLogsInput { - s.FlowLogIds = v +// SetFilters sets the Filters field's value. +func (s *DescribeImagesInput) SetFilters(v []*Filter) *DescribeImagesInput { + s.Filters = v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeFlowLogsInput) SetMaxResults(v int64) *DescribeFlowLogsInput { - s.MaxResults = &v +// SetImageIds sets the ImageIds field's value. +func (s *DescribeImagesInput) SetImageIds(v []*string) *DescribeImagesInput { + s.ImageIds = v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeFlowLogsInput) SetNextToken(v string) *DescribeFlowLogsInput { - s.NextToken = &v +// SetOwners sets the Owners field's value. +func (s *DescribeImagesInput) SetOwners(v []*string) *DescribeImagesInput { + s.Owners = v return s } -type DescribeFlowLogsOutput struct { +type DescribeImagesOutput 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"` + // Information about the images. + Images []*Image `locationName:"imagesSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DescribeFlowLogsOutput) String() string { +func (s DescribeImagesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeFlowLogsOutput) GoString() string { +func (s DescribeImagesOutput) 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 +// SetImages sets the Images field's value. +func (s *DescribeImagesOutput) SetImages(v []*Image) *DescribeImagesOutput { + s.Images = v return s } -type DescribeFpgaImageAttributeInput struct { +type DescribeImportImageTasksInput struct { _ struct{} `type:"structure"` - // The AFI attribute. - // - // Attribute is a required field - Attribute *string `type:"string" required:"true" enum:"FpgaImageAttributeName"` - // Checks whether you have the required permissions for the action, without // actually making 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 AFI. - // - // FpgaImageId is a required field - FpgaImageId *string `type:"string" required:"true"` + // Filter tasks using the task-state filter and one of the following values: + // active, completed, deleting, or deleted. + Filters []*Filter `locationNameList:"Filter" type:"list"` + + // The IDs of the import image tasks. + ImportTaskIds []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` + + // The maximum number of results to return in a single call. + MaxResults *int64 `type:"integer"` + + // A token that indicates the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeFpgaImageAttributeInput) String() string { +func (s DescribeImportImageTasksInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeFpgaImageAttributeInput) GoString() string { +func (s DescribeImportImageTasksInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeFpgaImageAttributeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeFpgaImageAttributeInput"} - if s.Attribute == nil { - invalidParams.Add(request.NewErrParamRequired("Attribute")) - } - if s.FpgaImageId == nil { - invalidParams.Add(request.NewErrParamRequired("FpgaImageId")) - } +// SetDryRun sets the DryRun field's value. +func (s *DescribeImportImageTasksInput) SetDryRun(v bool) *DescribeImportImageTasksInput { + s.DryRun = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetFilters sets the Filters field's value. +func (s *DescribeImportImageTasksInput) SetFilters(v []*Filter) *DescribeImportImageTasksInput { + s.Filters = v + return s } -// SetAttribute sets the Attribute field's value. -func (s *DescribeFpgaImageAttributeInput) SetAttribute(v string) *DescribeFpgaImageAttributeInput { - s.Attribute = &v +// SetImportTaskIds sets the ImportTaskIds field's value. +func (s *DescribeImportImageTasksInput) SetImportTaskIds(v []*string) *DescribeImportImageTasksInput { + s.ImportTaskIds = v return s } -// SetDryRun sets the DryRun field's value. -func (s *DescribeFpgaImageAttributeInput) SetDryRun(v bool) *DescribeFpgaImageAttributeInput { - s.DryRun = &v +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeImportImageTasksInput) SetMaxResults(v int64) *DescribeImportImageTasksInput { + s.MaxResults = &v return s } -// SetFpgaImageId sets the FpgaImageId field's value. -func (s *DescribeFpgaImageAttributeInput) SetFpgaImageId(v string) *DescribeFpgaImageAttributeInput { - s.FpgaImageId = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeImportImageTasksInput) SetNextToken(v string) *DescribeImportImageTasksInput { + s.NextToken = &v return s } -type DescribeFpgaImageAttributeOutput struct { +type DescribeImportImageTasksOutput struct { _ struct{} `type:"structure"` - // Information about the attribute. - FpgaImageAttribute *FpgaImageAttribute `locationName:"fpgaImageAttribute" 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 DescribeFpgaImageAttributeOutput) String() string { +func (s DescribeImportImageTasksOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeFpgaImageAttributeOutput) GoString() string { +func (s DescribeImportImageTasksOutput) GoString() string { return s.String() } -// SetFpgaImageAttribute sets the FpgaImageAttribute field's value. -func (s *DescribeFpgaImageAttributeOutput) SetFpgaImageAttribute(v *FpgaImageAttribute) *DescribeFpgaImageAttributeOutput { - s.FpgaImageAttribute = v +// SetImportImageTasks sets the ImportImageTasks field's value. +func (s *DescribeImportImageTasksOutput) SetImportImageTasks(v []*ImportImageTask) *DescribeImportImageTasksOutput { + s.ImportImageTasks = v return s } -type DescribeFpgaImagesInput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeImportImageTasksOutput) SetNextToken(v string) *DescribeImportImageTasksOutput { + s.NextToken = &v + return s +} + +type DescribeImportSnapshotTasksInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -51333,196 +58952,133 @@ type DescribeFpgaImagesInput struct { DryRun *bool `type:"boolean"` // The filters. - // - // * create-time - The creation time of the AFI. - // - // * fpga-image-id - The FPGA image identifier (AFI ID). - // - // * fpga-image-global-id - The global FPGA image identifier (AGFI ID). - // - // * name - The name of the AFI. - // - // * owner-id - The AWS account ID of the AFI owner. - // - // * product-code - The product code. - // - // * shell-version - The version of the AWS Shell that was used to create - // the bitstream. - // - // * state - The state of the AFI (pending | failed | available | unavailable). - // - // * tag: - The key/value combination of a tag assigned to the resource. - // Use the tag key in the filter name and the tag value as the filter value. - // For example, to find all resources that have a tag with the key Owner - // and the value TeamA, specify tag:Owner for the filter name and TeamA for - // the filter value. - // - // * tag-key - The key of a tag assigned to the resource. Use this filter - // to find all resources assigned a tag with a specific key, regardless of - // the tag value. - // - // * update-time - The time of the most recent update. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + Filters []*Filter `locationNameList:"Filter" type:"list"` - // The AFI IDs. - FpgaImageIds []*string `locationName:"FpgaImageId" locationNameList:"item" 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. - MaxResults *int64 `min:"5" type:"integer"` + // 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"` - // The token to retrieve the next page of results. + // A token that indicates the next page of results. NextToken *string `type:"string"` - - // Filters the AFI by 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). - Owners []*string `locationName:"Owner" locationNameList:"Owner" type:"list"` } // String returns the string representation -func (s DescribeFpgaImagesInput) String() string { +func (s DescribeImportSnapshotTasksInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeFpgaImagesInput) GoString() string { +func (s DescribeImportSnapshotTasksInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeFpgaImagesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeFpgaImagesInput"} - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - // SetDryRun sets the DryRun field's value. -func (s *DescribeFpgaImagesInput) SetDryRun(v bool) *DescribeFpgaImagesInput { +func (s *DescribeImportSnapshotTasksInput) SetDryRun(v bool) *DescribeImportSnapshotTasksInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeFpgaImagesInput) SetFilters(v []*Filter) *DescribeFpgaImagesInput { +func (s *DescribeImportSnapshotTasksInput) SetFilters(v []*Filter) *DescribeImportSnapshotTasksInput { s.Filters = v return s } -// SetFpgaImageIds sets the FpgaImageIds field's value. -func (s *DescribeFpgaImagesInput) SetFpgaImageIds(v []*string) *DescribeFpgaImagesInput { - s.FpgaImageIds = v +// 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 *DescribeFpgaImagesInput) SetMaxResults(v int64) *DescribeFpgaImagesInput { +func (s *DescribeImportSnapshotTasksInput) SetMaxResults(v int64) *DescribeImportSnapshotTasksInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeFpgaImagesInput) SetNextToken(v string) *DescribeFpgaImagesInput { +func (s *DescribeImportSnapshotTasksInput) SetNextToken(v string) *DescribeImportSnapshotTasksInput { s.NextToken = &v return s } -// SetOwners sets the Owners field's value. -func (s *DescribeFpgaImagesInput) SetOwners(v []*string) *DescribeFpgaImagesInput { - s.Owners = v - return s -} - -type DescribeFpgaImagesOutput struct { +type DescribeImportSnapshotTasksOutput struct { _ struct{} `type:"structure"` - // Information about the FPGA images. - FpgaImages []*FpgaImage `locationName:"fpgaImageSet" locationNameList:"item" type:"list"` + // 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 retrieve the next page of results. This value is null - // when there are no more results to return. + // 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 DescribeFpgaImagesOutput) String() string { +func (s DescribeImportSnapshotTasksOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeFpgaImagesOutput) GoString() string { +func (s DescribeImportSnapshotTasksOutput) GoString() string { return s.String() } -// SetFpgaImages sets the FpgaImages field's value. -func (s *DescribeFpgaImagesOutput) SetFpgaImages(v []*FpgaImage) *DescribeFpgaImagesOutput { - s.FpgaImages = v +// 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 *DescribeFpgaImagesOutput) SetNextToken(v string) *DescribeFpgaImagesOutput { +func (s *DescribeImportSnapshotTasksOutput) SetNextToken(v string) *DescribeImportSnapshotTasksOutput { s.NextToken = &v return s } -type DescribeHostReservationOfferingsInput struct { +type DescribeInstanceAttributeInput struct { _ struct{} `type:"structure"` - // The filters. + // The instance attribute. // - // * instance-family - The instance family of the offering (for example, - // m4). + // Note: The enaSupport attribute is not supported at this time. // - // * payment-option - The payment option (NoUpfront | PartialUpfront | AllUpfront). - Filter []*Filter `locationNameList:"Filter" type:"list"` - - // This is the maximum duration of the reservation 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 receive an error. - MaxResults *int64 `min:"5" 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"` + // Attribute is a required field + Attribute *string `locationName:"attribute" type:"string" required:"true" enum:"InstanceAttributeName"` - // The token to use to retrieve the next page of results. - NextToken *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 reservation offering. - OfferingId *string `type:"string"` + // 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 DescribeHostReservationOfferingsInput) String() string { +func (s DescribeInstanceAttributeInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeHostReservationOfferingsInput) GoString() string { +func (s DescribeInstanceAttributeInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeHostReservationOfferingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeHostReservationOfferingsInput"} - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) +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 { @@ -51531,259 +59087,268 @@ func (s *DescribeHostReservationOfferingsInput) Validate() error { return nil } -// SetFilter sets the Filter field's value. -func (s *DescribeHostReservationOfferingsInput) SetFilter(v []*Filter) *DescribeHostReservationOfferingsInput { - s.Filter = v +// SetAttribute sets the Attribute field's value. +func (s *DescribeInstanceAttributeInput) SetAttribute(v string) *DescribeInstanceAttributeInput { + s.Attribute = &v return s } -// SetMaxDuration sets the MaxDuration field's value. -func (s *DescribeHostReservationOfferingsInput) SetMaxDuration(v int64) *DescribeHostReservationOfferingsInput { - s.MaxDuration = &v +// SetDryRun sets the DryRun field's value. +func (s *DescribeInstanceAttributeInput) SetDryRun(v bool) *DescribeInstanceAttributeInput { + s.DryRun = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeHostReservationOfferingsInput) SetMaxResults(v int64) *DescribeHostReservationOfferingsInput { - s.MaxResults = &v +// SetInstanceId sets the InstanceId field's value. +func (s *DescribeInstanceAttributeInput) SetInstanceId(v string) *DescribeInstanceAttributeInput { + s.InstanceId = &v return s } -// SetMinDuration sets the MinDuration field's value. -func (s *DescribeHostReservationOfferingsInput) SetMinDuration(v int64) *DescribeHostReservationOfferingsInput { - s.MinDuration = &v - return s -} +// Describes an instance attribute. +type DescribeInstanceAttributeOutput struct { + _ struct{} `type:"structure"` -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostReservationOfferingsInput) SetNextToken(v string) *DescribeHostReservationOfferingsInput { - s.NextToken = &v - return s -} + // The block device mapping of the instance. + BlockDeviceMappings []*InstanceBlockDeviceMapping `locationName:"blockDeviceMapping" locationNameList:"item" type:"list"` -// SetOfferingId sets the OfferingId field's value. -func (s *DescribeHostReservationOfferingsInput) SetOfferingId(v string) *DescribeHostReservationOfferingsInput { - s.OfferingId = &v - return s -} + // 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"` -type DescribeHostReservationOfferingsOutput struct { - _ struct{} `type:"structure"` + // Indicates whether the instance is optimized for Amazon EBS I/O. + EbsOptimized *AttributeBooleanValue `locationName:"ebsOptimized" 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"` + // Indicates whether enhanced networking with ENA is enabled. + EnaSupport *AttributeBooleanValue `locationName:"enaSupport" type:"structure"` - // Information about the offerings. - OfferingSet []*HostOffering `locationName:"offeringSet" locationNameList:"item" type:"list"` + // 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 device name of the root device volume (for example, /dev/sda1). + RootDeviceName *AttributeValue `locationName:"rootDeviceName" type:"structure"` + + // Indicates whether source/destination checking is enabled. A value of true + // means that checking is enabled, and false means that 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 DescribeHostReservationOfferingsOutput) String() string { +func (s DescribeInstanceAttributeOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeHostReservationOfferingsOutput) GoString() string { +func (s DescribeInstanceAttributeOutput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostReservationOfferingsOutput) SetNextToken(v string) *DescribeHostReservationOfferingsOutput { - s.NextToken = &v +// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. +func (s *DescribeInstanceAttributeOutput) SetBlockDeviceMappings(v []*InstanceBlockDeviceMapping) *DescribeInstanceAttributeOutput { + s.BlockDeviceMappings = v return s } -// SetOfferingSet sets the OfferingSet field's value. -func (s *DescribeHostReservationOfferingsOutput) SetOfferingSet(v []*HostOffering) *DescribeHostReservationOfferingsOutput { - s.OfferingSet = v +// SetDisableApiTermination sets the DisableApiTermination field's value. +func (s *DescribeInstanceAttributeOutput) SetDisableApiTermination(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { + s.DisableApiTermination = v return s } -type DescribeHostReservationsInput struct { - _ struct{} `type:"structure"` - - // The filters. - // - // * instance-family - The instance family (for example, m4). - // - // * payment-option - The payment option (NoUpfront | PartialUpfront | AllUpfront). - // - // * state - The state of the reservation (payment-pending | payment-failed - // | active | retired). - // - // * tag: - The key/value combination of a tag assigned to the resource. - // Use the tag key in the filter name and the tag value as the filter value. - // For example, to find all resources that have a tag with the key Owner - // and the value TeamA, specify tag:Owner for the filter name and TeamA for - // the filter value. - // - // * tag-key - The key of a tag assigned to the resource. Use this filter - // to find all resources assigned a tag with a specific key, regardless of - // the tag value. - Filter []*Filter `locationNameList:"Filter" type:"list"` - - // The 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 receive an error. - MaxResults *int64 `type:"integer"` - - // The token to use to retrieve the next page of results. - NextToken *string `type:"string"` +// SetEbsOptimized sets the EbsOptimized field's value. +func (s *DescribeInstanceAttributeOutput) SetEbsOptimized(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { + s.EbsOptimized = v + return s } -// String returns the string representation -func (s DescribeHostReservationsInput) String() string { - return awsutil.Prettify(s) +// SetEnaSupport sets the EnaSupport field's value. +func (s *DescribeInstanceAttributeOutput) SetEnaSupport(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { + s.EnaSupport = v + return s } -// GoString returns the string representation -func (s DescribeHostReservationsInput) GoString() string { - return s.String() +// SetGroups sets the Groups field's value. +func (s *DescribeInstanceAttributeOutput) SetGroups(v []*GroupIdentifier) *DescribeInstanceAttributeOutput { + s.Groups = v + return s } -// SetFilter sets the Filter field's value. -func (s *DescribeHostReservationsInput) SetFilter(v []*Filter) *DescribeHostReservationsInput { - s.Filter = v +// SetInstanceId sets the InstanceId field's value. +func (s *DescribeInstanceAttributeOutput) SetInstanceId(v string) *DescribeInstanceAttributeOutput { + s.InstanceId = &v return s } -// SetHostReservationIdSet sets the HostReservationIdSet field's value. -func (s *DescribeHostReservationsInput) SetHostReservationIdSet(v []*string) *DescribeHostReservationsInput { - s.HostReservationIdSet = v +// SetInstanceInitiatedShutdownBehavior sets the InstanceInitiatedShutdownBehavior field's value. +func (s *DescribeInstanceAttributeOutput) SetInstanceInitiatedShutdownBehavior(v *AttributeValue) *DescribeInstanceAttributeOutput { + s.InstanceInitiatedShutdownBehavior = v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeHostReservationsInput) SetMaxResults(v int64) *DescribeHostReservationsInput { - s.MaxResults = &v +// SetInstanceType sets the InstanceType field's value. +func (s *DescribeInstanceAttributeOutput) SetInstanceType(v *AttributeValue) *DescribeInstanceAttributeOutput { + s.InstanceType = v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostReservationsInput) SetNextToken(v string) *DescribeHostReservationsInput { - s.NextToken = &v +// SetKernelId sets the KernelId field's value. +func (s *DescribeInstanceAttributeOutput) SetKernelId(v *AttributeValue) *DescribeInstanceAttributeOutput { + s.KernelId = v return s } -type DescribeHostReservationsOutput struct { - _ struct{} `type:"structure"` - - // Details about the reservation's configuration. - HostReservationSet []*HostReservation `locationName:"hostReservationSet" locationNameList:"item" type:"list"` +// SetProductCodes sets the ProductCodes field's value. +func (s *DescribeInstanceAttributeOutput) SetProductCodes(v []*ProductCode) *DescribeInstanceAttributeOutput { + s.ProductCodes = v + return s +} - // 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"` +// SetRamdiskId sets the RamdiskId field's value. +func (s *DescribeInstanceAttributeOutput) SetRamdiskId(v *AttributeValue) *DescribeInstanceAttributeOutput { + s.RamdiskId = v + return s } -// String returns the string representation -func (s DescribeHostReservationsOutput) String() string { - return awsutil.Prettify(s) +// SetRootDeviceName sets the RootDeviceName field's value. +func (s *DescribeInstanceAttributeOutput) SetRootDeviceName(v *AttributeValue) *DescribeInstanceAttributeOutput { + s.RootDeviceName = v + return s } -// GoString returns the string representation -func (s DescribeHostReservationsOutput) GoString() string { - return s.String() +// SetSourceDestCheck sets the SourceDestCheck field's value. +func (s *DescribeInstanceAttributeOutput) SetSourceDestCheck(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { + s.SourceDestCheck = v + return s } -// SetHostReservationSet sets the HostReservationSet field's value. -func (s *DescribeHostReservationsOutput) SetHostReservationSet(v []*HostReservation) *DescribeHostReservationsOutput { - s.HostReservationSet = v +// SetSriovNetSupport sets the SriovNetSupport field's value. +func (s *DescribeInstanceAttributeOutput) SetSriovNetSupport(v *AttributeValue) *DescribeInstanceAttributeOutput { + s.SriovNetSupport = v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeHostReservationsOutput) SetNextToken(v string) *DescribeHostReservationsOutput { - s.NextToken = &v +// SetUserData sets the UserData field's value. +func (s *DescribeInstanceAttributeOutput) SetUserData(v *AttributeValue) *DescribeInstanceAttributeOutput { + s.UserData = v return s } -type DescribeHostsInput struct { +type DescribeInstanceCreditSpecificationsInput 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 filters. // - // * auto-placement - Whether auto-placement is enabled or disabled (on | - // off). - // - // * availability-zone - The Availability Zone of the host. - // - // * client-token - The idempotency token that you provided when you allocated - // the host. - // - // * host-reservation-id - The ID of the reservation assigned to this host. - // - // * instance-type - The instance type size that the Dedicated Host is configured - // to support. + // * instance-id - The ID of the instance. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The instance IDs. // - // * state - The allocation state of the Dedicated Host (available | under-assessment - // | permanent-failure | released | released-permanent-failure). + // Default: Describes all your instances. // - // * tag-key - The key of a tag assigned to the resource. Use this filter - // to find all resources assigned a tag with a specific key, regardless of - // the tag value. - 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"` + // Constraints: Maximum 1000 explicitly specified instance IDs. + 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 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 receive an error. - // - // You cannot specify this parameter and the host IDs parameter in the same - // request. - MaxResults *int64 `locationName:"maxResults" type:"integer"` + // 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 `min:"5" type:"integer"` - // The token to use to retrieve the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` + // The token to retrieve the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeHostsInput) String() string { +func (s DescribeInstanceCreditSpecificationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeHostsInput) GoString() string { +func (s DescribeInstanceCreditSpecificationsInput) GoString() string { return s.String() } -// SetFilter sets the Filter field's value. -func (s *DescribeHostsInput) SetFilter(v []*Filter) *DescribeHostsInput { - s.Filter = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeInstanceCreditSpecificationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeInstanceCreditSpecificationsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *DescribeInstanceCreditSpecificationsInput) SetDryRun(v bool) *DescribeInstanceCreditSpecificationsInput { + s.DryRun = &v return s } -// SetHostIds sets the HostIds field's value. -func (s *DescribeHostsInput) SetHostIds(v []*string) *DescribeHostsInput { - s.HostIds = v +// SetFilters sets the Filters field's value. +func (s *DescribeInstanceCreditSpecificationsInput) SetFilters(v []*Filter) *DescribeInstanceCreditSpecificationsInput { + s.Filters = v + return s +} + +// SetInstanceIds sets the InstanceIds field's value. +func (s *DescribeInstanceCreditSpecificationsInput) SetInstanceIds(v []*string) *DescribeInstanceCreditSpecificationsInput { + s.InstanceIds = v return s } // SetMaxResults sets the MaxResults field's value. -func (s *DescribeHostsInput) SetMaxResults(v int64) *DescribeHostsInput { +func (s *DescribeInstanceCreditSpecificationsInput) SetMaxResults(v int64) *DescribeInstanceCreditSpecificationsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeHostsInput) SetNextToken(v string) *DescribeHostsInput { +func (s *DescribeInstanceCreditSpecificationsInput) SetNextToken(v string) *DescribeInstanceCreditSpecificationsInput { s.NextToken = &v return s } -type DescribeHostsOutput struct { +type DescribeInstanceCreditSpecificationsOutput struct { _ struct{} `type:"structure"` - // Information about the Dedicated Hosts. - Hosts []*Host `locationName:"hostSet" locationNameList:"item" type:"list"` + // Information about the credit option for CPU usage of an instance. + InstanceCreditSpecifications []*InstanceCreditSpecification `locationName:"instanceCreditSpecificationSet" 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. @@ -51791,101 +59356,153 @@ type DescribeHostsOutput struct { } // String returns the string representation -func (s DescribeHostsOutput) String() string { +func (s DescribeInstanceCreditSpecificationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeHostsOutput) GoString() string { +func (s DescribeInstanceCreditSpecificationsOutput) GoString() string { return s.String() } -// SetHosts sets the Hosts field's value. -func (s *DescribeHostsOutput) SetHosts(v []*Host) *DescribeHostsOutput { - s.Hosts = v +// SetInstanceCreditSpecifications sets the InstanceCreditSpecifications field's value. +func (s *DescribeInstanceCreditSpecificationsOutput) SetInstanceCreditSpecifications(v []*InstanceCreditSpecification) *DescribeInstanceCreditSpecificationsOutput { + s.InstanceCreditSpecifications = v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeHostsOutput) SetNextToken(v string) *DescribeHostsOutput { +func (s *DescribeInstanceCreditSpecificationsOutput) SetNextToken(v string) *DescribeInstanceCreditSpecificationsOutput { s.NextToken = &v return s } -type DescribeIamInstanceProfileAssociationsInput struct { +type DescribeInstanceStatusInput struct { _ struct{} `type:"structure"` - // The IAM instance profile associations. - AssociationIds []*string `locationName:"AssociationId" locationNameList:"AssociationId" 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 filters. // - // * instance-id - The ID of the instance. + // * availability-zone - The Availability Zone of the instance. // - // * state - The state of the association (associating | associated | disassociating - // | disassociated). + // * 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.instance-event-id - The ID of the event whose date and time you + // are modifying. + // + // * 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). + // + // * event.not-before-deadline - The deadline for starting the 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 used for internal purposes 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"` + + // The 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. - MaxResults *int64 `min:"5" type:"integer"` + // 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 request the next page of results. + // The token to retrieve the next page of results. NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeIamInstanceProfileAssociationsInput) String() string { +func (s DescribeInstanceStatusInput) 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 invalidParams.Len() > 0 { - return invalidParams - } - return nil +func (s DescribeInstanceStatusInput) GoString() string { + return s.String() } -// SetAssociationIds sets the AssociationIds field's value. -func (s *DescribeIamInstanceProfileAssociationsInput) SetAssociationIds(v []*string) *DescribeIamInstanceProfileAssociationsInput { - s.AssociationIds = v +// 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 *DescribeIamInstanceProfileAssociationsInput) SetFilters(v []*Filter) *DescribeIamInstanceProfileAssociationsInput { +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 *DescribeIamInstanceProfileAssociationsInput) SetMaxResults(v int64) *DescribeIamInstanceProfileAssociationsInput { +func (s *DescribeInstanceStatusInput) SetMaxResults(v int64) *DescribeInstanceStatusInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeIamInstanceProfileAssociationsInput) SetNextToken(v string) *DescribeIamInstanceProfileAssociationsInput { +func (s *DescribeInstanceStatusInput) SetNextToken(v string) *DescribeInstanceStatusInput { s.NextToken = &v return s } -type DescribeIamInstanceProfileAssociationsOutput struct { +type DescribeInstanceStatusOutput struct { _ struct{} `type:"structure"` - // Information about the IAM instance profile associations. - IamInstanceProfileAssociations []*IamInstanceProfileAssociation `locationName:"iamInstanceProfileAssociationSet" locationNameList:"item" type:"list"` + // Information about the status of the instances. + 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. @@ -51893,113 +59510,72 @@ type DescribeIamInstanceProfileAssociationsOutput struct { } // String returns the string representation -func (s DescribeIamInstanceProfileAssociationsOutput) String() string { +func (s DescribeInstanceStatusOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeIamInstanceProfileAssociationsOutput) GoString() string { +func (s DescribeInstanceStatusOutput) GoString() string { return s.String() } -// SetIamInstanceProfileAssociations sets the IamInstanceProfileAssociations field's value. -func (s *DescribeIamInstanceProfileAssociationsOutput) SetIamInstanceProfileAssociations(v []*IamInstanceProfileAssociation) *DescribeIamInstanceProfileAssociationsOutput { - s.IamInstanceProfileAssociations = v +// 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 *DescribeIamInstanceProfileAssociationsOutput) SetNextToken(v string) *DescribeIamInstanceProfileAssociationsOutput { +func (s *DescribeInstanceStatusOutput) SetNextToken(v string) *DescribeInstanceStatusOutput { s.NextToken = &v return s } -type DescribeIdFormatInput struct { - _ struct{} `type:"structure"` - - // The type of resource: bundle | conversion-task | customer-gateway | dhcp-options - // | elastic-ip-allocation | elastic-ip-association | export-task | flow-log - // | image | import-task | instance | internet-gateway | network-acl | network-acl-association - // | network-interface | network-interface-attachment | prefix-list | reservation - // | route-table | route-table-association | security-group | snapshot | subnet - // | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association - // | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway - 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 -} - -type DescribeIdFormatOutput struct { +type DescribeInstanceTypeOfferingsInput 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() -} + // Checks whether you have the required permissions for the action, without + // actually making 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"` -// SetStatuses sets the Statuses field's value. -func (s *DescribeIdFormatOutput) SetStatuses(v []*IdFormat) *DescribeIdFormatOutput { - s.Statuses = v - return s -} + // One or more filters. Filter names and values are case-sensitive. + // + // * location - This depends on the location type. For example, if the location + // type is region (default), the location is the Region code (for example, + // us-east-2.) + // + // * instance-type - The instance type. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` -type DescribeIdentityIdFormatInput struct { - _ struct{} `type:"structure"` + // The location type. + LocationType *string `type:"string" enum:"LocationType"` - // 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 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 next + // token value. + MaxResults *int64 `min:"5" type:"integer"` - // The type of resource: bundle | conversion-task | customer-gateway | dhcp-options - // | elastic-ip-allocation | elastic-ip-association | export-task | flow-log - // | image | import-task | instance | internet-gateway | network-acl | network-acl-association - // | network-interface | network-interface-attachment | prefix-list | reservation - // | route-table | route-table-association | security-group | snapshot | subnet - // | subnet-cidr-block-association | volume | vpc | vpc-cidr-block-association - // | vpc-endpoint | vpc-peering-connection | vpn-connection | vpn-gateway - Resource *string `locationName:"resource" type:"string"` + // The token to retrieve the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeIdentityIdFormatInput) String() string { +func (s DescribeInstanceTypeOfferingsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeIdentityIdFormatInput) GoString() string { +func (s DescribeInstanceTypeOfferingsInput) 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")) +func (s *DescribeInstanceTypeOfferingsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeInstanceTypeOfferingsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) } if invalidParams.Len() > 0 { @@ -52008,84 +59584,180 @@ func (s *DescribeIdentityIdFormatInput) Validate() error { return nil } -// SetPrincipalArn sets the PrincipalArn field's value. -func (s *DescribeIdentityIdFormatInput) SetPrincipalArn(v string) *DescribeIdentityIdFormatInput { - s.PrincipalArn = &v +// SetDryRun sets the DryRun field's value. +func (s *DescribeInstanceTypeOfferingsInput) SetDryRun(v bool) *DescribeInstanceTypeOfferingsInput { + s.DryRun = &v return s } -// SetResource sets the Resource field's value. -func (s *DescribeIdentityIdFormatInput) SetResource(v string) *DescribeIdentityIdFormatInput { - s.Resource = &v +// SetFilters sets the Filters field's value. +func (s *DescribeInstanceTypeOfferingsInput) SetFilters(v []*Filter) *DescribeInstanceTypeOfferingsInput { + s.Filters = v return s } -type DescribeIdentityIdFormatOutput struct { +// SetLocationType sets the LocationType field's value. +func (s *DescribeInstanceTypeOfferingsInput) SetLocationType(v string) *DescribeInstanceTypeOfferingsInput { + s.LocationType = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeInstanceTypeOfferingsInput) SetMaxResults(v int64) *DescribeInstanceTypeOfferingsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeInstanceTypeOfferingsInput) SetNextToken(v string) *DescribeInstanceTypeOfferingsInput { + s.NextToken = &v + return s +} + +type DescribeInstanceTypeOfferingsOutput struct { _ struct{} `type:"structure"` - // Information about the ID format for the resources. - Statuses []*IdFormat `locationName:"statusSet" locationNameList:"item" type:"list"` + // The instance types offered. + InstanceTypeOfferings []*InstanceTypeOffering `locationName:"instanceTypeOfferingSet" 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 DescribeIdentityIdFormatOutput) String() string { +func (s DescribeInstanceTypeOfferingsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeIdentityIdFormatOutput) GoString() string { +func (s DescribeInstanceTypeOfferingsOutput) GoString() string { return s.String() } -// SetStatuses sets the Statuses field's value. -func (s *DescribeIdentityIdFormatOutput) SetStatuses(v []*IdFormat) *DescribeIdentityIdFormatOutput { - s.Statuses = v +// SetInstanceTypeOfferings sets the InstanceTypeOfferings field's value. +func (s *DescribeInstanceTypeOfferingsOutput) SetInstanceTypeOfferings(v []*InstanceTypeOffering) *DescribeInstanceTypeOfferingsOutput { + s.InstanceTypeOfferings = v return s } -// Contains the parameters for DescribeImageAttribute. -type DescribeImageAttributeInput struct { - _ struct{} `type:"structure"` +// SetNextToken sets the NextToken field's value. +func (s *DescribeInstanceTypeOfferingsOutput) SetNextToken(v string) *DescribeInstanceTypeOfferingsOutput { + s.NextToken = &v + return s +} - // 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"` +type DescribeInstanceTypesInput 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"` + DryRun *bool `type:"boolean"` - // The ID of the AMI. + // One or more filters. Filter names and values are case-sensitive. // - // ImageId is a required field - ImageId *string `type:"string" required:"true"` + // * auto-recovery-supported - Indicates whether auto recovery is supported. + // (true | false) + // + // * bare-metal - Indicates whether it is a bare metal instance type. (true + // | false) + // + // * burstable-performance-supported - Indicates whether it is a burstable + // performance instance type. (true | false) + // + // * current-generation - Indicates whether this instance type is the latest + // generation instance type of an instance family. (true | false) + // + // * ebs-info.ebs-optimized-support - Indicates whether the instance type + // is EBS-optimized. (true | false) + // + // * ebs-info.encryption-support - Indicates whether EBS encryption is supported. + // (true | false) + // + // * free-tier-eligible - Indicates whether the instance type is eligible + // to use in the free tier. (true | false) + // + // * hibernation-supported - Indicates whether On-Demand hibernation is supported. + // (true | false) + // + // * hypervisor - The hypervisor used. (nitro | xen) + // + // * instance-storage-info.disk.count - The number of local disks. + // + // * instance-storage-info.disk.size-in-gb - The storage size of each instance + // storage disk, in GB. + // + // * instance-storage-info.disk.type - The storage technology for the local + // instance storage disks. (hdd | ssd) + // + // * instance-storage-info.total-size-in-gb - The total amount of storage + // available from all local instance storage, in GB. + // + // * instance-storage-supported - Indicates whether the instance type has + // local instance storage. (true | false) + // + // * memory-info.size-in-mib - The memory size. + // + // * network-info.ena-support - Indicates whether Elastic Network Adapter + // (ENA) is supported or required. (required | supported | unsupported) + // + // * network-info.ipv4-addresses-per-interface - The maximum number of private + // IPv4 addresses per network interface. + // + // * network-info.ipv6-addresses-per-interface - The maximum number of private + // IPv6 addresses per network interface. + // + // * network-info.ipv6-supported - Indicates whether the instance type supports + // IPv6. (true | false) + // + // * network-info.maximum-network-interfaces - The maximum number of network + // interfaces per instance. + // + // * network-info.network-performance - Describes the network performance. + // + // * processor-info.sustained-clock-speed-in-ghz - The CPU clock speed, in + // GHz. + // + // * vcpu-info.default-cores - The default number of cores for the instance + // type. + // + // * vcpu-info.default-threads-per-core - The default number of threads per + // core for the instance type. + // + // * vcpu-info.default-vcpus - The default number of vCPUs for the instance + // type. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The instance types. For more information, see Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) + // in the Amazon Elastic Compute Cloud User Guide. + InstanceTypes []*string `locationName:"InstanceType" 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 next + // token value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token to retrieve the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeImageAttributeInput) String() string { +func (s DescribeInstanceTypesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeImageAttributeInput) GoString() string { +func (s DescribeInstanceTypesInput) 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")) +func (s *DescribeInstanceTypesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeInstanceTypesInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) } if invalidParams.Len() > 0 { @@ -52094,113 +59766,71 @@ func (s *DescribeImageAttributeInput) Validate() error { 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 { +func (s *DescribeInstanceTypesInput) SetDryRun(v bool) *DescribeInstanceTypesInput { s.DryRun = &v return s } -// SetImageId sets the ImageId field's value. -func (s *DescribeImageAttributeInput) SetImageId(v string) *DescribeImageAttributeInput { - s.ImageId = &v +// SetFilters sets the Filters field's value. +func (s *DescribeInstanceTypesInput) SetFilters(v []*Filter) *DescribeInstanceTypesInput { + s.Filters = v return s } -// Describes an image attribute. -type DescribeImageAttributeOutput struct { - _ struct{} `type:"structure"` - - // The 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"` - - // The launch permissions. - LaunchPermissions []*LaunchPermission `locationName:"launchPermission" locationNameList:"item" type:"list"` - - // The 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 +// SetInstanceTypes sets the InstanceTypes field's value. +func (s *DescribeInstanceTypesInput) SetInstanceTypes(v []*string) *DescribeInstanceTypesInput { + s.InstanceTypes = v return s } -// SetDescription sets the Description field's value. -func (s *DescribeImageAttributeOutput) SetDescription(v *AttributeValue) *DescribeImageAttributeOutput { - s.Description = v +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeInstanceTypesInput) SetMaxResults(v int64) *DescribeInstanceTypesInput { + s.MaxResults = &v return s } -// SetImageId sets the ImageId field's value. -func (s *DescribeImageAttributeOutput) SetImageId(v string) *DescribeImageAttributeOutput { - s.ImageId = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeInstanceTypesInput) SetNextToken(v string) *DescribeInstanceTypesInput { + s.NextToken = &v return s } -// SetKernelId sets the KernelId field's value. -func (s *DescribeImageAttributeOutput) SetKernelId(v *AttributeValue) *DescribeImageAttributeOutput { - s.KernelId = v - return s +type DescribeInstanceTypesOutput struct { + _ struct{} `type:"structure"` + + // The instance type. For more information, see Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) + // in the Amazon Elastic Compute Cloud User Guide. + InstanceTypes []*InstanceTypeInfo `locationName:"instanceTypeSet" 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"` } -// SetLaunchPermissions sets the LaunchPermissions field's value. -func (s *DescribeImageAttributeOutput) SetLaunchPermissions(v []*LaunchPermission) *DescribeImageAttributeOutput { - s.LaunchPermissions = v - return s +// String returns the string representation +func (s DescribeInstanceTypesOutput) String() string { + return awsutil.Prettify(s) } -// SetProductCodes sets the ProductCodes field's value. -func (s *DescribeImageAttributeOutput) SetProductCodes(v []*ProductCode) *DescribeImageAttributeOutput { - s.ProductCodes = v - return s +// GoString returns the string representation +func (s DescribeInstanceTypesOutput) GoString() string { + return s.String() } -// SetRamdiskId sets the RamdiskId field's value. -func (s *DescribeImageAttributeOutput) SetRamdiskId(v *AttributeValue) *DescribeImageAttributeOutput { - s.RamdiskId = v +// SetInstanceTypes sets the InstanceTypes field's value. +func (s *DescribeInstanceTypesOutput) SetInstanceTypes(v []*InstanceTypeInfo) *DescribeInstanceTypesOutput { + s.InstanceTypes = v return s } -// SetSriovNetSupport sets the SriovNetSupport field's value. -func (s *DescribeImageAttributeOutput) SetSriovNetSupport(v *AttributeValue) *DescribeImageAttributeOutput { - s.SriovNetSupport = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeInstanceTypesOutput) SetNextToken(v string) *DescribeInstanceTypesOutput { + s.NextToken = &v return s } -type DescribeImagesInput struct { +type DescribeInstancesInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -52209,78 +59839,235 @@ type DescribeImagesInput struct { // 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"` - // The filters. // - // * architecture - The image architecture (i386 | x86_64 | arm64). + // * affinity - The affinity setting for an instance running on a Dedicated + // Host (default | host). // - // * block-device-mapping.delete-on-termination - A Boolean value that indicates - // whether the Amazon EBS volume is deleted on instance termination. + // * architecture - The instance architecture (i386 | x86_64 | arm64). + // + // * 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 specified in the // block device mapping (for example, /dev/sdh or xvdh). // - // * block-device-mapping.snapshot-id - The ID of the snapshot used for the - // EBS volume. + // * block-device-mapping.status - The status for the EBS volume (attaching + // | attached | detaching | detached). // - // * block-device-mapping.volume-size - The volume size of the EBS volume, - // in GiB. + // * block-device-mapping.volume-id - The volume ID of the EBS volume. // - // * block-device-mapping.volume-type - The volume type of the EBS volume - // (gp2 | io1 | st1 | sc1 | standard). + // * client-token - The idempotency token you provided when you launched + // the instance. // - // * block-device-mapping.encrypted - A Boolean that indicates whether the - // EBS volume is encrypted. + // * dns-name - The public DNS name of the instance. // - // * description - The description of the image (provided during image creation). + // * group-id - The ID of the security group for the instance. EC2-Classic + // only. // - // * ena-support - A Boolean that indicates whether enhanced networking with - // ENA is enabled. + // * group-name - The name of the security group for the instance. EC2-Classic + // only. // - // * hypervisor - The hypervisor type (ovm | xen). + // * hibernation-options.configured - A Boolean that indicates whether the + // instance is enabled for hibernation. A value of true means that the instance + // is enabled for hibernation. // - // * image-id - The ID of the image. + // * 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 used for internal purposes 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. + // + // * metadata-options.http-tokens - The metadata request authorization state + // (optional | required) + // + // * metadata-options.http-put-response-hop-limit - The http metadata request + // put response hop limit (integer, possible values 1 to 64) + // + // * metadata-options.http-endpoint - Enable or disable metadata access on + // http endpoint (enabled | disabled) + // + // * 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.association.public-ip - The address of the Elastic + // IP address (IPv4) bound to the network interface. + // + // * network-interface.association.ip-owner-id - The owner of the Elastic + // IP address (IPv4) associated with the network interface. + // + // * network-interface.association.allocation-id - The allocation ID returned + // when you allocated the Elastic IP address (IPv4) for your network interface. + // + // * network-interface.association.association-id - The association ID returned + // when the network interface was associated with an IPv4 address. + // + // * 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 that checking + // is enabled, and false means that 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. // - // * image-type - The image type (machine | kernel | ramdisk). + // * placement-group-name - The name of the placement group for the instance. // - // * is-public - A Boolean that indicates whether the image is public. + // * placement-partition-number - The partition in which the instance is + // located. // - // * kernel-id - The kernel ID. + // * platform - The platform. To list only Windows instances, use windows. // - // * manifest-location - The location of the image manifest. + // * private-dns-name - The private IPv4 DNS name of the instance. // - // * name - The name of the AMI (provided during image creation). + // * private-ip-address - The private IPv4 address of the instance. // - // * 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. + // * product-code - The product code associated with the AMI used to launch + // the instance. // - // * owner-id - The AWS account ID of the image owner. + // * product-code.type - The type of product code (devpay | marketplace). // - // * platform - The platform. To only list Windows-based AMIs, use windows. + // * ramdisk-id - The RAM disk ID. // - // * product-code - The product code. + // * 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. // - // * product-code.type - The type of the product code (devpay | marketplace). + // * requester-id - The ID of the entity that launched the instance on your + // behalf (for example, AWS Management Console, Auto Scaling, and so on). // - // * ramdisk-id - The RAM disk ID. + // * 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 get + // one reservation ID. If you launch ten instances using the same launch + // request, you also get one reservation ID. // // * root-device-name - The device 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). + // * source-dest-check - Indicates whether the instance performs source/destination + // checking. A value of true means that checking is enabled, and false means + // that 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 - The message for the state change. + // * state-reason-message - A message that describes the state change. // - // * sriov-net-support - A value of simple indicates that enhanced networking - // with the Intel 82599 VF interface is enabled. + // * subnet-id - The ID of the subnet for the instance. // // * tag: - The key/value combination of a tag assigned to the resource. // Use the tag key in the filter name and the tag value as the filter value. @@ -52289,185 +60076,236 @@ type DescribeImagesInput struct { // the filter value. // // * tag-key - The key of a tag assigned to the resource. Use this filter - // to find all resources assigned a tag with a specific key, regardless of - // the tag value. + // to find all resources that have a tag with a specific key, regardless + // of the tag value. // - // * virtualization-type - The virtualization type (paravirtual | hvm). + // * 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"` - // The image IDs. + // The instance IDs. // - // Default: Describes all images available to you. - ImageIds []*string `locationName:"ImageId" locationNameList:"ImageId" type:"list"` + // Default: Describes all your instances. + InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" 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"` + // 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 `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 DescribeImagesInput) String() string { +func (s DescribeInstancesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeImagesInput) GoString() string { +func (s DescribeInstancesInput) GoString() string { return s.String() } // SetDryRun sets the DryRun field's value. -func (s *DescribeImagesInput) SetDryRun(v bool) *DescribeImagesInput { +func (s *DescribeInstancesInput) SetDryRun(v bool) *DescribeInstancesInput { s.DryRun = &v return s } -// SetExecutableUsers sets the ExecutableUsers field's value. -func (s *DescribeImagesInput) SetExecutableUsers(v []*string) *DescribeImagesInput { - s.ExecutableUsers = v +// SetFilters sets the Filters field's value. +func (s *DescribeInstancesInput) SetFilters(v []*Filter) *DescribeInstancesInput { + s.Filters = v return s } -// SetFilters sets the Filters field's value. -func (s *DescribeImagesInput) SetFilters(v []*Filter) *DescribeImagesInput { - s.Filters = v +// SetInstanceIds sets the InstanceIds field's value. +func (s *DescribeInstancesInput) SetInstanceIds(v []*string) *DescribeInstancesInput { + s.InstanceIds = v return s } -// SetImageIds sets the ImageIds field's value. -func (s *DescribeImagesInput) SetImageIds(v []*string) *DescribeImagesInput { - s.ImageIds = v +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeInstancesInput) SetMaxResults(v int64) *DescribeInstancesInput { + s.MaxResults = &v return s } -// SetOwners sets the Owners field's value. -func (s *DescribeImagesInput) SetOwners(v []*string) *DescribeImagesInput { - s.Owners = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeInstancesInput) SetNextToken(v string) *DescribeInstancesInput { + s.NextToken = &v return s } -type DescribeImagesOutput struct { +type DescribeInstancesOutput struct { _ struct{} `type:"structure"` - // Information about the images. - Images []*Image `locationName:"imagesSet" 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"` + + // Information about the reservations. + Reservations []*Reservation `locationName:"reservationSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DescribeImagesOutput) String() string { +func (s DescribeInstancesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeImagesOutput) GoString() string { +func (s DescribeInstancesOutput) GoString() string { return s.String() } -// SetImages sets the Images field's value. -func (s *DescribeImagesOutput) SetImages(v []*Image) *DescribeImagesOutput { - s.Images = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeInstancesOutput) SetNextToken(v string) *DescribeInstancesOutput { + s.NextToken = &v return s } -type DescribeImportImageTasksInput struct { +// SetReservations sets the Reservations field's value. +func (s *DescribeInstancesOutput) SetReservations(v []*Reservation) *DescribeInstancesOutput { + s.Reservations = v + return s +} + +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 `type:"boolean"` + DryRun *bool `locationName:"dryRun" type:"boolean"` - // Filter tasks using the task-state filter and one of the following values: - // active, completed, deleting, or deleted. - Filters []*Filter `locationNameList:"Filter" type:"list"` + // 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. + // + // * owner-id - The ID of the AWS account that owns the internet gateway. + // + // * tag: - The key/value combination of a tag assigned to the resource. + // Use the tag key in the filter name and the tag value as the filter value. + // For example, to find all resources that have a tag with the key Owner + // and the value TeamA, specify tag:Owner for the filter name and TeamA for + // the filter value. + // + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The IDs of the import image tasks. - ImportTaskIds []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` + // One or more internet gateway IDs. + // + // Default: Describes all your internet gateways. + InternetGatewayIds []*string `locationName:"internetGatewayId" locationNameList:"item" type:"list"` - // The maximum number of results to return in a single call. - MaxResults *int64 `type:"integer"` + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` - // A token that indicates the next page of results. + // The token for the next page of results. NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeImportImageTasksInput) String() string { +func (s DescribeInternetGatewaysInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeImportImageTasksInput) GoString() string { +func (s DescribeInternetGatewaysInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeInternetGatewaysInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeInternetGatewaysInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetDryRun sets the DryRun field's value. -func (s *DescribeImportImageTasksInput) SetDryRun(v bool) *DescribeImportImageTasksInput { +func (s *DescribeInternetGatewaysInput) SetDryRun(v bool) *DescribeInternetGatewaysInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeImportImageTasksInput) SetFilters(v []*Filter) *DescribeImportImageTasksInput { +func (s *DescribeInternetGatewaysInput) SetFilters(v []*Filter) *DescribeInternetGatewaysInput { s.Filters = v return s } -// SetImportTaskIds sets the ImportTaskIds field's value. -func (s *DescribeImportImageTasksInput) SetImportTaskIds(v []*string) *DescribeImportImageTasksInput { - s.ImportTaskIds = v +// SetInternetGatewayIds sets the InternetGatewayIds field's value. +func (s *DescribeInternetGatewaysInput) SetInternetGatewayIds(v []*string) *DescribeInternetGatewaysInput { + s.InternetGatewayIds = v return s } // SetMaxResults sets the MaxResults field's value. -func (s *DescribeImportImageTasksInput) SetMaxResults(v int64) *DescribeImportImageTasksInput { +func (s *DescribeInternetGatewaysInput) SetMaxResults(v int64) *DescribeInternetGatewaysInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeImportImageTasksInput) SetNextToken(v string) *DescribeImportImageTasksInput { +func (s *DescribeInternetGatewaysInput) SetNextToken(v string) *DescribeInternetGatewaysInput { s.NextToken = &v return s } -type DescribeImportImageTasksOutput struct { +type DescribeInternetGatewaysOutput 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"` + // Information about one or more internet gateways. + InternetGateways []*InternetGateway `locationName:"internetGatewaySet" 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. + // 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 DescribeImportImageTasksOutput) String() string { +func (s DescribeInternetGatewaysOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeImportImageTasksOutput) GoString() string { +func (s DescribeInternetGatewaysOutput) GoString() string { return s.String() } -// SetImportImageTasks sets the ImportImageTasks field's value. -func (s *DescribeImportImageTasksOutput) SetImportImageTasks(v []*ImportImageTask) *DescribeImportImageTasksOutput { - s.ImportImageTasks = v +// SetInternetGateways sets the InternetGateways field's value. +func (s *DescribeInternetGatewaysOutput) SetInternetGateways(v []*InternetGateway) *DescribeInternetGatewaysOutput { + s.InternetGateways = v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeImportImageTasksOutput) SetNextToken(v string) *DescribeImportImageTasksOutput { +func (s *DescribeInternetGatewaysOutput) SetNextToken(v string) *DescribeInternetGatewaysOutput { s.NextToken = &v return s } -type DescribeImportSnapshotTasksInput struct { +type DescribeIpv6PoolsInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -52476,316 +60314,365 @@ type DescribeImportSnapshotTasksInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The filters. - Filters []*Filter `locationNameList:"Filter" type:"list"` - - // A list of import snapshot task IDs. - ImportTaskIds []*string `locationName:"ImportTaskId" locationNameList:"ImportTaskId" type:"list"` + // One or more filters. + // + // * tag: - The key/value combination of a tag assigned to the resource. + // Use the tag key in the filter name and the tag value as the filter value. + // For example, to find all resources that have a tag with the key Owner + // and the value TeamA, specify tag:Owner for the filter name and TeamA for + // the filter value. + // + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. + 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 `type:"integer"` + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"1" type:"integer"` - // A token that indicates the next page of results. + // The token for the next page of results. NextToken *string `type:"string"` + + // The IDs of the IPv6 address pools. + PoolIds []*string `locationName:"PoolId" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DescribeImportSnapshotTasksInput) String() string { +func (s DescribeIpv6PoolsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeImportSnapshotTasksInput) GoString() string { +func (s DescribeIpv6PoolsInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeIpv6PoolsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeIpv6PoolsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetDryRun sets the DryRun field's value. -func (s *DescribeImportSnapshotTasksInput) SetDryRun(v bool) *DescribeImportSnapshotTasksInput { +func (s *DescribeIpv6PoolsInput) SetDryRun(v bool) *DescribeIpv6PoolsInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeImportSnapshotTasksInput) SetFilters(v []*Filter) *DescribeImportSnapshotTasksInput { +func (s *DescribeIpv6PoolsInput) SetFilters(v []*Filter) *DescribeIpv6PoolsInput { 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 { +func (s *DescribeIpv6PoolsInput) SetMaxResults(v int64) *DescribeIpv6PoolsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeImportSnapshotTasksInput) SetNextToken(v string) *DescribeImportSnapshotTasksInput { +func (s *DescribeIpv6PoolsInput) SetNextToken(v string) *DescribeIpv6PoolsInput { s.NextToken = &v return s } -type DescribeImportSnapshotTasksOutput struct { +// SetPoolIds sets the PoolIds field's value. +func (s *DescribeIpv6PoolsInput) SetPoolIds(v []*string) *DescribeIpv6PoolsInput { + s.PoolIds = v + return s +} + +type DescribeIpv6PoolsOutput 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"` + // Information about the IPv6 address pools. + Ipv6Pools []*Ipv6Pool `locationName:"ipv6PoolSet" 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. + // 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 DescribeImportSnapshotTasksOutput) String() string { +func (s DescribeIpv6PoolsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeImportSnapshotTasksOutput) GoString() string { +func (s DescribeIpv6PoolsOutput) GoString() string { return s.String() } -// SetImportSnapshotTasks sets the ImportSnapshotTasks field's value. -func (s *DescribeImportSnapshotTasksOutput) SetImportSnapshotTasks(v []*ImportSnapshotTask) *DescribeImportSnapshotTasksOutput { - s.ImportSnapshotTasks = v +// SetIpv6Pools sets the Ipv6Pools field's value. +func (s *DescribeIpv6PoolsOutput) SetIpv6Pools(v []*Ipv6Pool) *DescribeIpv6PoolsOutput { + s.Ipv6Pools = v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeImportSnapshotTasksOutput) SetNextToken(v string) *DescribeImportSnapshotTasksOutput { +func (s *DescribeIpv6PoolsOutput) SetNextToken(v string) *DescribeIpv6PoolsOutput { s.NextToken = &v return s } -type DescribeInstanceAttributeInput struct { +type DescribeKeyPairsInput 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. + // The filters. // - // InstanceId is a required field - InstanceId *string `locationName:"instanceId" type:"string" required:"true"` + // * fingerprint - The fingerprint of the key pair. + // + // * key-name - The name of the key pair. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The key pair names. + // + // Default: Describes all your key pairs. + KeyNames []*string `locationName:"KeyName" locationNameList:"KeyName" type:"list"` + + // The IDs of the key pairs. + KeyPairIds []*string `locationName:"KeyPairId" locationNameList:"KeyPairId" type:"list"` } // String returns the string representation -func (s DescribeInstanceAttributeInput) String() string { +func (s DescribeKeyPairsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeInstanceAttributeInput) GoString() string { +func (s DescribeKeyPairsInput) 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 +// SetDryRun sets the DryRun field's value. +func (s *DescribeKeyPairsInput) SetDryRun(v bool) *DescribeKeyPairsInput { + s.DryRun = &v + return s } -// SetAttribute sets the Attribute field's value. -func (s *DescribeInstanceAttributeInput) SetAttribute(v string) *DescribeInstanceAttributeInput { - s.Attribute = &v +// SetFilters sets the Filters field's value. +func (s *DescribeKeyPairsInput) SetFilters(v []*Filter) *DescribeKeyPairsInput { + s.Filters = v return s } -// SetDryRun sets the DryRun field's value. -func (s *DescribeInstanceAttributeInput) SetDryRun(v bool) *DescribeInstanceAttributeInput { - s.DryRun = &v +// SetKeyNames sets the KeyNames field's value. +func (s *DescribeKeyPairsInput) SetKeyNames(v []*string) *DescribeKeyPairsInput { + s.KeyNames = v return s } -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeInstanceAttributeInput) SetInstanceId(v string) *DescribeInstanceAttributeInput { - s.InstanceId = &v +// SetKeyPairIds sets the KeyPairIds field's value. +func (s *DescribeKeyPairsInput) SetKeyPairIds(v []*string) *DescribeKeyPairsInput { + s.KeyPairIds = v return s } -// Describes an instance attribute. -type DescribeInstanceAttributeOutput struct { +type DescribeKeyPairsOutput 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"` + // Information about the key pairs. + KeyPairs []*KeyPairInfo `locationName:"keySet" locationNameList:"item" type:"list"` +} - // Indicates whether the instance is optimized for Amazon EBS I/O. - EbsOptimized *AttributeBooleanValue `locationName:"ebsOptimized" type:"structure"` +// String returns the string representation +func (s DescribeKeyPairsOutput) String() string { + return awsutil.Prettify(s) +} - // Indicates whether enhanced networking with ENA is enabled. - EnaSupport *AttributeBooleanValue `locationName:"enaSupport" type:"structure"` +// GoString returns the string representation +func (s DescribeKeyPairsOutput) GoString() string { + return s.String() +} - // The security groups associated with the instance. - Groups []*GroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` +// SetKeyPairs sets the KeyPairs field's value. +func (s *DescribeKeyPairsOutput) SetKeyPairs(v []*KeyPairInfo) *DescribeKeyPairsOutput { + s.KeyPairs = v + return s +} - // The ID of the instance. - InstanceId *string `locationName:"instanceId" type:"string"` +type DescribeLaunchTemplateVersionsInput struct { + _ struct{} `type:"structure"` - // 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"` + // Checks whether you have the required permissions for the action, without + // actually making 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 instance type. - InstanceType *AttributeValue `locationName:"instanceType" type:"structure"` + // One or more filters. + // + // * create-time - The time the launch template version was created. + // + // * ebs-optimized - A boolean that indicates whether the instance is optimized + // for Amazon EBS I/O. + // + // * iam-instance-profile - The ARN of the IAM instance profile. + // + // * image-id - The ID of the AMI. + // + // * instance-type - The instance type. + // + // * is-default-version - A boolean that indicates whether the launch template + // version is the default version. + // + // * kernel-id - The kernel ID. + // + // * ram-disk-id - The RAM disk ID. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The kernel ID. - KernelId *AttributeValue `locationName:"kernel" type:"structure"` + // The ID of the launch template. You must specify either the launch template + // ID or launch template name in the request. + LaunchTemplateId *string `type:"string"` - // A list of product codes. - ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` + // The name of the launch template. You must specify either the launch template + // ID or launch template name in the request. + LaunchTemplateName *string `min:"3" type:"string"` - // The RAM disk ID. - RamdiskId *AttributeValue `locationName:"ramdisk" type:"structure"` + // 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 1 and 200. + MaxResults *int64 `type:"integer"` - // The device name of the root device volume (for example, /dev/sda1). - RootDeviceName *AttributeValue `locationName:"rootDeviceName" type:"structure"` + // The version number up to which to describe launch template versions. + MaxVersion *string `type:"string"` - // Indicates whether source/destination checking is enabled. A value of true - // means that checking is enabled, and false means that checking is disabled. - // This value must be false for a NAT instance to perform NAT. - SourceDestCheck *AttributeBooleanValue `locationName:"sourceDestCheck" type:"structure"` + // The version number after which to describe launch template versions. + MinVersion *string `type:"string"` - // Indicates whether enhanced networking with the Intel 82599 Virtual Function - // interface is enabled. - SriovNetSupport *AttributeValue `locationName:"sriovNetSupport" type:"structure"` + // The token to request the next page of results. + NextToken *string `type:"string"` - // The user data. - UserData *AttributeValue `locationName:"userData" type:"structure"` + // One or more versions of the launch template. + Versions []*string `locationName:"LaunchTemplateVersion" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DescribeInstanceAttributeOutput) String() string { +func (s DescribeLaunchTemplateVersionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeInstanceAttributeOutput) GoString() string { +func (s DescribeLaunchTemplateVersionsInput) GoString() string { return s.String() } -// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. -func (s *DescribeInstanceAttributeOutput) SetBlockDeviceMappings(v []*InstanceBlockDeviceMapping) *DescribeInstanceAttributeOutput { - s.BlockDeviceMappings = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLaunchTemplateVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLaunchTemplateVersionsInput"} + if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetDisableApiTermination sets the DisableApiTermination field's value. -func (s *DescribeInstanceAttributeOutput) SetDisableApiTermination(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { - s.DisableApiTermination = v +// SetDryRun sets the DryRun field's value. +func (s *DescribeLaunchTemplateVersionsInput) SetDryRun(v bool) *DescribeLaunchTemplateVersionsInput { + s.DryRun = &v return s } -// SetEbsOptimized sets the EbsOptimized field's value. -func (s *DescribeInstanceAttributeOutput) SetEbsOptimized(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { - s.EbsOptimized = v +// SetFilters sets the Filters field's value. +func (s *DescribeLaunchTemplateVersionsInput) SetFilters(v []*Filter) *DescribeLaunchTemplateVersionsInput { + s.Filters = v return s } -// SetEnaSupport sets the EnaSupport field's value. -func (s *DescribeInstanceAttributeOutput) SetEnaSupport(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { - s.EnaSupport = v +// SetLaunchTemplateId sets the LaunchTemplateId field's value. +func (s *DescribeLaunchTemplateVersionsInput) SetLaunchTemplateId(v string) *DescribeLaunchTemplateVersionsInput { + s.LaunchTemplateId = &v return s } -// SetGroups sets the Groups field's value. -func (s *DescribeInstanceAttributeOutput) SetGroups(v []*GroupIdentifier) *DescribeInstanceAttributeOutput { - s.Groups = v +// SetLaunchTemplateName sets the LaunchTemplateName field's value. +func (s *DescribeLaunchTemplateVersionsInput) SetLaunchTemplateName(v string) *DescribeLaunchTemplateVersionsInput { + s.LaunchTemplateName = &v return s } -// SetInstanceId sets the InstanceId field's value. -func (s *DescribeInstanceAttributeOutput) SetInstanceId(v string) *DescribeInstanceAttributeOutput { - s.InstanceId = &v +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeLaunchTemplateVersionsInput) SetMaxResults(v int64) *DescribeLaunchTemplateVersionsInput { + s.MaxResults = &v return s } -// SetInstanceInitiatedShutdownBehavior sets the InstanceInitiatedShutdownBehavior field's value. -func (s *DescribeInstanceAttributeOutput) SetInstanceInitiatedShutdownBehavior(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.InstanceInitiatedShutdownBehavior = v +// SetMaxVersion sets the MaxVersion field's value. +func (s *DescribeLaunchTemplateVersionsInput) SetMaxVersion(v string) *DescribeLaunchTemplateVersionsInput { + s.MaxVersion = &v return s } -// SetInstanceType sets the InstanceType field's value. -func (s *DescribeInstanceAttributeOutput) SetInstanceType(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.InstanceType = v +// SetMinVersion sets the MinVersion field's value. +func (s *DescribeLaunchTemplateVersionsInput) SetMinVersion(v string) *DescribeLaunchTemplateVersionsInput { + s.MinVersion = &v return s } -// SetKernelId sets the KernelId field's value. -func (s *DescribeInstanceAttributeOutput) SetKernelId(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.KernelId = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeLaunchTemplateVersionsInput) SetNextToken(v string) *DescribeLaunchTemplateVersionsInput { + s.NextToken = &v return s } -// SetProductCodes sets the ProductCodes field's value. -func (s *DescribeInstanceAttributeOutput) SetProductCodes(v []*ProductCode) *DescribeInstanceAttributeOutput { - s.ProductCodes = v +// SetVersions sets the Versions field's value. +func (s *DescribeLaunchTemplateVersionsInput) SetVersions(v []*string) *DescribeLaunchTemplateVersionsInput { + s.Versions = v return s } -// SetRamdiskId sets the RamdiskId field's value. -func (s *DescribeInstanceAttributeOutput) SetRamdiskId(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.RamdiskId = v - return s +type DescribeLaunchTemplateVersionsOutput struct { + _ struct{} `type:"structure"` + + // Information about the launch template versions. + LaunchTemplateVersions []*LaunchTemplateVersion `locationName:"launchTemplateVersionSet" 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"` } -// SetRootDeviceName sets the RootDeviceName field's value. -func (s *DescribeInstanceAttributeOutput) SetRootDeviceName(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.RootDeviceName = v - return s +// String returns the string representation +func (s DescribeLaunchTemplateVersionsOutput) String() string { + return awsutil.Prettify(s) } -// SetSourceDestCheck sets the SourceDestCheck field's value. -func (s *DescribeInstanceAttributeOutput) SetSourceDestCheck(v *AttributeBooleanValue) *DescribeInstanceAttributeOutput { - s.SourceDestCheck = v - return s +// GoString returns the string representation +func (s DescribeLaunchTemplateVersionsOutput) GoString() string { + return s.String() } -// SetSriovNetSupport sets the SriovNetSupport field's value. -func (s *DescribeInstanceAttributeOutput) SetSriovNetSupport(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.SriovNetSupport = v +// SetLaunchTemplateVersions sets the LaunchTemplateVersions field's value. +func (s *DescribeLaunchTemplateVersionsOutput) SetLaunchTemplateVersions(v []*LaunchTemplateVersion) *DescribeLaunchTemplateVersionsOutput { + s.LaunchTemplateVersions = v return s } -// SetUserData sets the UserData field's value. -func (s *DescribeInstanceAttributeOutput) SetUserData(v *AttributeValue) *DescribeInstanceAttributeOutput { - s.UserData = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeLaunchTemplateVersionsOutput) SetNextToken(v string) *DescribeLaunchTemplateVersionsOutput { + s.NextToken = &v return s } -type DescribeInstanceCreditSpecificationsInput struct { +type DescribeLaunchTemplatesInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -52794,43 +60681,53 @@ type DescribeInstanceCreditSpecificationsInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The filters. + // One or more filters. // - // * instance-id - The ID of the instance. - Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - - // The instance IDs. + // * create-time - The time the launch template was created. // - // Default: Describes all your instances. + // * launch-template-name - The name of the launch template. // - // Constraints: Maximum 1000 explicitly specified instance IDs. - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` + // * tag: - The key/value combination of a tag assigned to the resource. + // Use the tag key in the filter name and the tag value as the filter value. + // For example, to find all resources that have a tag with the key Owner + // and the value TeamA, specify tag:Owner for the filter name and TeamA for + // the filter value. + // + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // One or more launch template IDs. + LaunchTemplateIds []*string `locationName:"LaunchTemplateId" locationNameList:"item" type:"list"` + + // One or more launch template names. + LaunchTemplateNames []*string `locationName:"LaunchTemplateName" locationNameList:"item" 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 `min:"5" type:"integer"` + // value can be between 1 and 200. + MaxResults *int64 `min:"1" type:"integer"` - // The token to retrieve the next page of results. + // The token to request the next page of results. NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeInstanceCreditSpecificationsInput) String() string { +func (s DescribeLaunchTemplatesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeInstanceCreditSpecificationsInput) GoString() string { +func (s DescribeLaunchTemplatesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeInstanceCreditSpecificationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeInstanceCreditSpecificationsInput"} - if s.MaxResults != nil && *s.MaxResults < 5 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) +func (s *DescribeLaunchTemplatesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLaunchTemplatesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -52840,40 +60737,46 @@ func (s *DescribeInstanceCreditSpecificationsInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DescribeInstanceCreditSpecificationsInput) SetDryRun(v bool) *DescribeInstanceCreditSpecificationsInput { +func (s *DescribeLaunchTemplatesInput) SetDryRun(v bool) *DescribeLaunchTemplatesInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeInstanceCreditSpecificationsInput) SetFilters(v []*Filter) *DescribeInstanceCreditSpecificationsInput { +func (s *DescribeLaunchTemplatesInput) SetFilters(v []*Filter) *DescribeLaunchTemplatesInput { s.Filters = v return s } -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeInstanceCreditSpecificationsInput) SetInstanceIds(v []*string) *DescribeInstanceCreditSpecificationsInput { - s.InstanceIds = v +// SetLaunchTemplateIds sets the LaunchTemplateIds field's value. +func (s *DescribeLaunchTemplatesInput) SetLaunchTemplateIds(v []*string) *DescribeLaunchTemplatesInput { + s.LaunchTemplateIds = v + return s +} + +// SetLaunchTemplateNames sets the LaunchTemplateNames field's value. +func (s *DescribeLaunchTemplatesInput) SetLaunchTemplateNames(v []*string) *DescribeLaunchTemplatesInput { + s.LaunchTemplateNames = v return s } // SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstanceCreditSpecificationsInput) SetMaxResults(v int64) *DescribeInstanceCreditSpecificationsInput { +func (s *DescribeLaunchTemplatesInput) SetMaxResults(v int64) *DescribeLaunchTemplatesInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceCreditSpecificationsInput) SetNextToken(v string) *DescribeInstanceCreditSpecificationsInput { +func (s *DescribeLaunchTemplatesInput) SetNextToken(v string) *DescribeLaunchTemplatesInput { s.NextToken = &v return s } -type DescribeInstanceCreditSpecificationsOutput struct { +type DescribeLaunchTemplatesOutput struct { _ struct{} `type:"structure"` - // Information about the credit option for CPU usage of an instance. - InstanceCreditSpecifications []*InstanceCreditSpecification `locationName:"instanceCreditSpecificationSet" locationNameList:"item" type:"list"` + // Information about the launch templates. + LaunchTemplates []*LaunchTemplate `locationName:"launchTemplates" 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. @@ -52881,153 +60784,108 @@ type DescribeInstanceCreditSpecificationsOutput struct { } // String returns the string representation -func (s DescribeInstanceCreditSpecificationsOutput) String() string { +func (s DescribeLaunchTemplatesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeInstanceCreditSpecificationsOutput) GoString() string { +func (s DescribeLaunchTemplatesOutput) GoString() string { return s.String() } -// SetInstanceCreditSpecifications sets the InstanceCreditSpecifications field's value. -func (s *DescribeInstanceCreditSpecificationsOutput) SetInstanceCreditSpecifications(v []*InstanceCreditSpecification) *DescribeInstanceCreditSpecificationsOutput { - s.InstanceCreditSpecifications = v +// SetLaunchTemplates sets the LaunchTemplates field's value. +func (s *DescribeLaunchTemplatesOutput) SetLaunchTemplates(v []*LaunchTemplate) *DescribeLaunchTemplatesOutput { + s.LaunchTemplates = v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceCreditSpecificationsOutput) SetNextToken(v string) *DescribeInstanceCreditSpecificationsOutput { +func (s *DescribeLaunchTemplatesOutput) SetNextToken(v string) *DescribeLaunchTemplatesOutput { s.NextToken = &v return s } -type DescribeInstanceStatusInput struct { +type DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput 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"` + DryRun *bool `type:"boolean"` - // The 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.instance-event-id - The ID of the event whose date and time you - // are modifying. - // - // * 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). - // - // * event.not-before-deadline - The deadline for starting the 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 used for internal purposes 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). + // One or more filters. 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"` - - // The instance IDs. - // - // Default: Describes all your instances. - // - // Constraints: Maximum 100 explicitly specified instance IDs. - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` + // The IDs of the associations. + LocalGatewayRouteTableVirtualInterfaceGroupAssociationIds []*string `locationName:"LocalGatewayRouteTableVirtualInterfaceGroupAssociationId" locationNameList:"item" 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 maximum number of results to return with 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 retrieve the next page of results. + // The token for the next page of results. NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeInstanceStatusInput) String() string { +func (s DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeInstanceStatusInput) GoString() string { +func (s DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetDryRun sets the DryRun field's value. -func (s *DescribeInstanceStatusInput) SetDryRun(v bool) *DescribeInstanceStatusInput { +func (s *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput) SetDryRun(v bool) *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeInstanceStatusInput) SetFilters(v []*Filter) *DescribeInstanceStatusInput { +func (s *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput) SetFilters(v []*Filter) *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput { 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 +// SetLocalGatewayRouteTableVirtualInterfaceGroupAssociationIds sets the LocalGatewayRouteTableVirtualInterfaceGroupAssociationIds field's value. +func (s *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput) SetLocalGatewayRouteTableVirtualInterfaceGroupAssociationIds(v []*string) *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput { + s.LocalGatewayRouteTableVirtualInterfaceGroupAssociationIds = v return s } // SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstanceStatusInput) SetMaxResults(v int64) *DescribeInstanceStatusInput { +func (s *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput) SetMaxResults(v int64) *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceStatusInput) SetNextToken(v string) *DescribeInstanceStatusInput { +func (s *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput) SetNextToken(v string) *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsInput { s.NextToken = &v return s } -type DescribeInstanceStatusOutput struct { +type DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput struct { _ struct{} `type:"structure"` - // Information about the status of the instances. - InstanceStatuses []*InstanceStatus `locationName:"instanceStatusSet" locationNameList:"item" type:"list"` + // Information about the associations. + LocalGatewayRouteTableVirtualInterfaceGroupAssociations []*LocalGatewayRouteTableVirtualInterfaceGroupAssociation `locationName:"localGatewayRouteTableVirtualInterfaceGroupAssociationSet" 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. @@ -53035,398 +60893,150 @@ type DescribeInstanceStatusOutput struct { } // String returns the string representation -func (s DescribeInstanceStatusOutput) String() string { +func (s DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeInstanceStatusOutput) GoString() string { +func (s DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput) GoString() string { return s.String() } -// SetInstanceStatuses sets the InstanceStatuses field's value. -func (s *DescribeInstanceStatusOutput) SetInstanceStatuses(v []*InstanceStatus) *DescribeInstanceStatusOutput { - s.InstanceStatuses = v +// SetLocalGatewayRouteTableVirtualInterfaceGroupAssociations sets the LocalGatewayRouteTableVirtualInterfaceGroupAssociations field's value. +func (s *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput) SetLocalGatewayRouteTableVirtualInterfaceGroupAssociations(v []*LocalGatewayRouteTableVirtualInterfaceGroupAssociation) *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput { + s.LocalGatewayRouteTableVirtualInterfaceGroupAssociations = v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeInstanceStatusOutput) SetNextToken(v string) *DescribeInstanceStatusOutput { +func (s *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput) SetNextToken(v string) *DescribeLocalGatewayRouteTableVirtualInterfaceGroupAssociationsOutput { s.NextToken = &v return s } -type DescribeInstancesInput struct { +type DescribeLocalGatewayRouteTableVpcAssociationsInput 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"` + DryRun *bool `type:"boolean"` - // The filters. - // - // * affinity - The affinity setting for an instance running on a Dedicated - // Host (default | host). - // - // * architecture - The instance architecture (i386 | x86_64 | arm64). - // - // * 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 specified in the - // block device mapping (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. - // - // * hibernation-options.configured - A Boolean that indicates whether the - // instance is enabled for hibernation. A value of true means that the instance - // is enabled for hibernation. - // - // * 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 used for internal purposes 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.association.public-ip - The address of the Elastic - // IP address (IPv4) bound to the network interface. - // - // * network-interface.association.ip-owner-id - The owner of the Elastic - // IP address (IPv4) associated with the network interface. - // - // * network-interface.association.allocation-id - The allocation ID returned - // when you allocated the Elastic IP address (IPv4) for your network interface. - // - // * network-interface.association.association-id - The association ID returned - // when the network interface was associated with an IPv4 address. - // - // * 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 that checking - // is enabled, and false means that 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. - // - // * placement-partition-number - The partition in which the instance is - // located. - // - // * platform - The platform. To list only Windows instances, use windows. - // - // * 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 get - // one reservation ID. If you launch ten instances using the same launch - // request, you also get one reservation ID. - // - // * root-device-name - The device name of the root device volume (for example, - // /dev/sda1). - // - // * root-device-type - The type of the root device volume (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 - // that 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: - The key/value combination of a tag assigned to the resource. - // Use the tag key in the filter name and the tag value as the filter value. - // For example, to find all resources that have a tag with the key Owner - // and the value TeamA, specify tag:Owner for the filter name and TeamA for - // the filter value. - // - // * tag-key - The key of a tag assigned to the resource. Use this filter - // to find all resources that have a tag with a specific key, regardless - // of the tag value. - // - // * 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. + // One or more filters. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The instance IDs. - // - // Default: Describes all your instances. - InstanceIds []*string `locationName:"InstanceId" locationNameList:"InstanceId" type:"list"` + // The IDs of the associations. + LocalGatewayRouteTableVpcAssociationIds []*string `locationName:"LocalGatewayRouteTableVpcAssociationId" locationNameList:"item" 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 `locationName:"maxResults" type:"integer"` + // The maximum number of results to return with 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 `locationName:"nextToken" type:"string"` + // The token for the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeInstancesInput) String() string { +func (s DescribeLocalGatewayRouteTableVpcAssociationsInput) String() string { return awsutil.Prettify(s) } -// GoString returns the string representation -func (s DescribeInstancesInput) GoString() string { - return s.String() +// GoString returns the string representation +func (s DescribeLocalGatewayRouteTableVpcAssociationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLocalGatewayRouteTableVpcAssociationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLocalGatewayRouteTableVpcAssociationsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } // SetDryRun sets the DryRun field's value. -func (s *DescribeInstancesInput) SetDryRun(v bool) *DescribeInstancesInput { +func (s *DescribeLocalGatewayRouteTableVpcAssociationsInput) SetDryRun(v bool) *DescribeLocalGatewayRouteTableVpcAssociationsInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeInstancesInput) SetFilters(v []*Filter) *DescribeInstancesInput { +func (s *DescribeLocalGatewayRouteTableVpcAssociationsInput) SetFilters(v []*Filter) *DescribeLocalGatewayRouteTableVpcAssociationsInput { s.Filters = v return s } -// SetInstanceIds sets the InstanceIds field's value. -func (s *DescribeInstancesInput) SetInstanceIds(v []*string) *DescribeInstancesInput { - s.InstanceIds = v +// SetLocalGatewayRouteTableVpcAssociationIds sets the LocalGatewayRouteTableVpcAssociationIds field's value. +func (s *DescribeLocalGatewayRouteTableVpcAssociationsInput) SetLocalGatewayRouteTableVpcAssociationIds(v []*string) *DescribeLocalGatewayRouteTableVpcAssociationsInput { + s.LocalGatewayRouteTableVpcAssociationIds = v return s } // SetMaxResults sets the MaxResults field's value. -func (s *DescribeInstancesInput) SetMaxResults(v int64) *DescribeInstancesInput { +func (s *DescribeLocalGatewayRouteTableVpcAssociationsInput) SetMaxResults(v int64) *DescribeLocalGatewayRouteTableVpcAssociationsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeInstancesInput) SetNextToken(v string) *DescribeInstancesInput { +func (s *DescribeLocalGatewayRouteTableVpcAssociationsInput) SetNextToken(v string) *DescribeLocalGatewayRouteTableVpcAssociationsInput { s.NextToken = &v return s } -type DescribeInstancesOutput struct { +type DescribeLocalGatewayRouteTableVpcAssociationsOutput struct { _ struct{} `type:"structure"` + // Information about the associations. + LocalGatewayRouteTableVpcAssociations []*LocalGatewayRouteTableVpcAssociation `locationName:"localGatewayRouteTableVpcAssociationSet" 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"` - - // Information about the reservations. - Reservations []*Reservation `locationName:"reservationSet" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DescribeInstancesOutput) String() string { +func (s DescribeLocalGatewayRouteTableVpcAssociationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeInstancesOutput) GoString() string { +func (s DescribeLocalGatewayRouteTableVpcAssociationsOutput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribeInstancesOutput) SetNextToken(v string) *DescribeInstancesOutput { - s.NextToken = &v +// SetLocalGatewayRouteTableVpcAssociations sets the LocalGatewayRouteTableVpcAssociations field's value. +func (s *DescribeLocalGatewayRouteTableVpcAssociationsOutput) SetLocalGatewayRouteTableVpcAssociations(v []*LocalGatewayRouteTableVpcAssociation) *DescribeLocalGatewayRouteTableVpcAssociationsOutput { + s.LocalGatewayRouteTableVpcAssociations = v return s } -// SetReservations sets the Reservations field's value. -func (s *DescribeInstancesOutput) SetReservations(v []*Reservation) *DescribeInstancesOutput { - s.Reservations = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeLocalGatewayRouteTableVpcAssociationsOutput) SetNextToken(v string) *DescribeLocalGatewayRouteTableVpcAssociationsOutput { + s.NextToken = &v return s } -type DescribeInternetGatewaysInput struct { +type DescribeLocalGatewayRouteTablesInput 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"` + DryRun *bool `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. - // - // * owner-id - The ID of the AWS account that owns the internet gateway. - // - // * tag: - The key/value combination of a tag assigned to the resource. - // Use the tag key in the filter name and the tag value as the filter value. - // For example, to find all resources that have a tag with the key Owner - // and the value TeamA, specify tag:Owner for the filter name and TeamA for - // the filter value. - // - // * tag-key - The key of a tag assigned to the resource. Use this filter - // to find all resources assigned a tag with a specific key, regardless of - // the tag value. 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"` + // The IDs of the local gateway route tables. + LocalGatewayRouteTableIds []*string `locationName:"LocalGatewayRouteTableId" locationNameList:"item" type:"list"` // The maximum number of results to return with a single call. To retrieve the // remaining results, make another call with the returned nextToken value. @@ -53437,18 +61047,18 @@ type DescribeInternetGatewaysInput struct { } // String returns the string representation -func (s DescribeInternetGatewaysInput) String() string { +func (s DescribeLocalGatewayRouteTablesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeInternetGatewaysInput) GoString() string { +func (s DescribeLocalGatewayRouteTablesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeInternetGatewaysInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeInternetGatewaysInput"} +func (s *DescribeLocalGatewayRouteTablesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLocalGatewayRouteTablesInput"} if s.MaxResults != nil && *s.MaxResults < 5 { invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) } @@ -53460,40 +61070,40 @@ func (s *DescribeInternetGatewaysInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DescribeInternetGatewaysInput) SetDryRun(v bool) *DescribeInternetGatewaysInput { +func (s *DescribeLocalGatewayRouteTablesInput) SetDryRun(v bool) *DescribeLocalGatewayRouteTablesInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeInternetGatewaysInput) SetFilters(v []*Filter) *DescribeInternetGatewaysInput { +func (s *DescribeLocalGatewayRouteTablesInput) SetFilters(v []*Filter) *DescribeLocalGatewayRouteTablesInput { s.Filters = v return s } -// SetInternetGatewayIds sets the InternetGatewayIds field's value. -func (s *DescribeInternetGatewaysInput) SetInternetGatewayIds(v []*string) *DescribeInternetGatewaysInput { - s.InternetGatewayIds = v +// SetLocalGatewayRouteTableIds sets the LocalGatewayRouteTableIds field's value. +func (s *DescribeLocalGatewayRouteTablesInput) SetLocalGatewayRouteTableIds(v []*string) *DescribeLocalGatewayRouteTablesInput { + s.LocalGatewayRouteTableIds = v return s } // SetMaxResults sets the MaxResults field's value. -func (s *DescribeInternetGatewaysInput) SetMaxResults(v int64) *DescribeInternetGatewaysInput { +func (s *DescribeLocalGatewayRouteTablesInput) SetMaxResults(v int64) *DescribeLocalGatewayRouteTablesInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeInternetGatewaysInput) SetNextToken(v string) *DescribeInternetGatewaysInput { +func (s *DescribeLocalGatewayRouteTablesInput) SetNextToken(v string) *DescribeLocalGatewayRouteTablesInput { s.NextToken = &v return s } -type DescribeInternetGatewaysOutput struct { +type DescribeLocalGatewayRouteTablesOutput struct { _ struct{} `type:"structure"` - // Information about one or more internet gateways. - InternetGateways []*InternetGateway `locationName:"internetGatewaySet" locationNameList:"item" type:"list"` + // Information about the local gateway route tables. + LocalGatewayRouteTables []*LocalGatewayRouteTable `locationName:"localGatewayRouteTableSet" 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. @@ -53501,101 +61111,137 @@ type DescribeInternetGatewaysOutput struct { } // String returns the string representation -func (s DescribeInternetGatewaysOutput) String() string { +func (s DescribeLocalGatewayRouteTablesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeInternetGatewaysOutput) GoString() string { +func (s DescribeLocalGatewayRouteTablesOutput) GoString() string { return s.String() } -// SetInternetGateways sets the InternetGateways field's value. -func (s *DescribeInternetGatewaysOutput) SetInternetGateways(v []*InternetGateway) *DescribeInternetGatewaysOutput { - s.InternetGateways = v +// SetLocalGatewayRouteTables sets the LocalGatewayRouteTables field's value. +func (s *DescribeLocalGatewayRouteTablesOutput) SetLocalGatewayRouteTables(v []*LocalGatewayRouteTable) *DescribeLocalGatewayRouteTablesOutput { + s.LocalGatewayRouteTables = v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeInternetGatewaysOutput) SetNextToken(v string) *DescribeInternetGatewaysOutput { +func (s *DescribeLocalGatewayRouteTablesOutput) SetNextToken(v string) *DescribeLocalGatewayRouteTablesOutput { s.NextToken = &v return s } -type DescribeKeyPairsInput struct { +type DescribeLocalGatewayVirtualInterfaceGroupsInput 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"` + DryRun *bool `type:"boolean"` - // The filters. - // - // * fingerprint - The fingerprint of the key pair. - // - // * key-name - The name of the key pair. + // One or more filters. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The key pair names. - // - // Default: Describes all your key pairs. - KeyNames []*string `locationName:"KeyName" locationNameList:"KeyName" type:"list"` + // The IDs of the virtual interface groups. + LocalGatewayVirtualInterfaceGroupIds []*string `locationName:"LocalGatewayVirtualInterfaceGroupId" locationNameList:"item" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeKeyPairsInput) String() string { +func (s DescribeLocalGatewayVirtualInterfaceGroupsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeKeyPairsInput) GoString() string { +func (s DescribeLocalGatewayVirtualInterfaceGroupsInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLocalGatewayVirtualInterfaceGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLocalGatewayVirtualInterfaceGroupsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetDryRun sets the DryRun field's value. -func (s *DescribeKeyPairsInput) SetDryRun(v bool) *DescribeKeyPairsInput { +func (s *DescribeLocalGatewayVirtualInterfaceGroupsInput) SetDryRun(v bool) *DescribeLocalGatewayVirtualInterfaceGroupsInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeKeyPairsInput) SetFilters(v []*Filter) *DescribeKeyPairsInput { +func (s *DescribeLocalGatewayVirtualInterfaceGroupsInput) SetFilters(v []*Filter) *DescribeLocalGatewayVirtualInterfaceGroupsInput { s.Filters = v return s } -// SetKeyNames sets the KeyNames field's value. -func (s *DescribeKeyPairsInput) SetKeyNames(v []*string) *DescribeKeyPairsInput { - s.KeyNames = v +// SetLocalGatewayVirtualInterfaceGroupIds sets the LocalGatewayVirtualInterfaceGroupIds field's value. +func (s *DescribeLocalGatewayVirtualInterfaceGroupsInput) SetLocalGatewayVirtualInterfaceGroupIds(v []*string) *DescribeLocalGatewayVirtualInterfaceGroupsInput { + s.LocalGatewayVirtualInterfaceGroupIds = v return s } -type DescribeKeyPairsOutput struct { +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeLocalGatewayVirtualInterfaceGroupsInput) SetMaxResults(v int64) *DescribeLocalGatewayVirtualInterfaceGroupsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeLocalGatewayVirtualInterfaceGroupsInput) SetNextToken(v string) *DescribeLocalGatewayVirtualInterfaceGroupsInput { + s.NextToken = &v + return s +} + +type DescribeLocalGatewayVirtualInterfaceGroupsOutput struct { _ struct{} `type:"structure"` - // Information about the key pairs. - KeyPairs []*KeyPairInfo `locationName:"keySet" locationNameList:"item" type:"list"` + // The virtual interface groups. + LocalGatewayVirtualInterfaceGroups []*LocalGatewayVirtualInterfaceGroup `locationName:"localGatewayVirtualInterfaceGroupSet" 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 DescribeKeyPairsOutput) String() string { +func (s DescribeLocalGatewayVirtualInterfaceGroupsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeKeyPairsOutput) GoString() string { +func (s DescribeLocalGatewayVirtualInterfaceGroupsOutput) GoString() string { return s.String() } -// SetKeyPairs sets the KeyPairs field's value. -func (s *DescribeKeyPairsOutput) SetKeyPairs(v []*KeyPairInfo) *DescribeKeyPairsOutput { - s.KeyPairs = v +// SetLocalGatewayVirtualInterfaceGroups sets the LocalGatewayVirtualInterfaceGroups field's value. +func (s *DescribeLocalGatewayVirtualInterfaceGroupsOutput) SetLocalGatewayVirtualInterfaceGroups(v []*LocalGatewayVirtualInterfaceGroup) *DescribeLocalGatewayVirtualInterfaceGroupsOutput { + s.LocalGatewayVirtualInterfaceGroups = v return s } -type DescribeLaunchTemplateVersionsInput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeLocalGatewayVirtualInterfaceGroupsOutput) SetNextToken(v string) *DescribeLocalGatewayVirtualInterfaceGroupsOutput { + s.NextToken = &v + return s +} + +type DescribeLocalGatewayVirtualInterfacesInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -53605,67 +61251,34 @@ type DescribeLaunchTemplateVersionsInput struct { DryRun *bool `type:"boolean"` // One or more filters. - // - // * create-time - The time the launch template version was created. - // - // * ebs-optimized - A boolean that indicates whether the instance is optimized - // for Amazon EBS I/O. - // - // * iam-instance-profile - The ARN of the IAM instance profile. - // - // * image-id - The ID of the AMI. - // - // * instance-type - The instance type. - // - // * is-default-version - A boolean that indicates whether the launch template - // version is the default version. - // - // * kernel-id - The kernel ID. - // - // * ram-disk-id - The RAM disk ID. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // The ID of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateId *string `type:"string"` - - // The name of the launch template. You must specify either the launch template - // ID or launch template name in the request. - LaunchTemplateName *string `min:"3" type:"string"` - - // 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 1 and 200. - MaxResults *int64 `type:"integer"` - - // The version number up to which to describe launch template versions. - MaxVersion *string `type:"string"` + // The IDs of the virtual interfaces. + LocalGatewayVirtualInterfaceIds []*string `locationName:"LocalGatewayVirtualInterfaceId" locationNameList:"item" type:"list"` - // The version number after which to describe launch template versions. - MinVersion *string `type:"string"` + // The maximum number of results to return with 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. + // The token for the next page of results. NextToken *string `type:"string"` - - // One or more versions of the launch template. - Versions []*string `locationName:"LaunchTemplateVersion" locationNameList:"item" type:"list"` } // String returns the string representation -func (s DescribeLaunchTemplateVersionsInput) String() string { +func (s DescribeLocalGatewayVirtualInterfacesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeLaunchTemplateVersionsInput) GoString() string { +func (s DescribeLocalGatewayVirtualInterfacesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLaunchTemplateVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLaunchTemplateVersionsInput"} - if s.LaunchTemplateName != nil && len(*s.LaunchTemplateName) < 3 { - invalidParams.Add(request.NewErrParamMinLen("LaunchTemplateName", 3)) +func (s *DescribeLocalGatewayVirtualInterfacesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLocalGatewayVirtualInterfacesInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) } if invalidParams.Len() > 0 { @@ -53675,64 +61288,40 @@ func (s *DescribeLaunchTemplateVersionsInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetDryRun(v bool) *DescribeLaunchTemplateVersionsInput { +func (s *DescribeLocalGatewayVirtualInterfacesInput) SetDryRun(v bool) *DescribeLocalGatewayVirtualInterfacesInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetFilters(v []*Filter) *DescribeLaunchTemplateVersionsInput { +func (s *DescribeLocalGatewayVirtualInterfacesInput) SetFilters(v []*Filter) *DescribeLocalGatewayVirtualInterfacesInput { s.Filters = v return s } -// SetLaunchTemplateId sets the LaunchTemplateId field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetLaunchTemplateId(v string) *DescribeLaunchTemplateVersionsInput { - s.LaunchTemplateId = &v - return s -} - -// SetLaunchTemplateName sets the LaunchTemplateName field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetLaunchTemplateName(v string) *DescribeLaunchTemplateVersionsInput { - s.LaunchTemplateName = &v +// SetLocalGatewayVirtualInterfaceIds sets the LocalGatewayVirtualInterfaceIds field's value. +func (s *DescribeLocalGatewayVirtualInterfacesInput) SetLocalGatewayVirtualInterfaceIds(v []*string) *DescribeLocalGatewayVirtualInterfacesInput { + s.LocalGatewayVirtualInterfaceIds = v return s } // SetMaxResults sets the MaxResults field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetMaxResults(v int64) *DescribeLaunchTemplateVersionsInput { +func (s *DescribeLocalGatewayVirtualInterfacesInput) SetMaxResults(v int64) *DescribeLocalGatewayVirtualInterfacesInput { s.MaxResults = &v return s } -// SetMaxVersion sets the MaxVersion field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetMaxVersion(v string) *DescribeLaunchTemplateVersionsInput { - s.MaxVersion = &v - return s -} - -// SetMinVersion sets the MinVersion field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetMinVersion(v string) *DescribeLaunchTemplateVersionsInput { - s.MinVersion = &v - return s -} - // SetNextToken sets the NextToken field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetNextToken(v string) *DescribeLaunchTemplateVersionsInput { +func (s *DescribeLocalGatewayVirtualInterfacesInput) SetNextToken(v string) *DescribeLocalGatewayVirtualInterfacesInput { s.NextToken = &v return s } -// SetVersions sets the Versions field's value. -func (s *DescribeLaunchTemplateVersionsInput) SetVersions(v []*string) *DescribeLaunchTemplateVersionsInput { - s.Versions = v - return s -} - -type DescribeLaunchTemplateVersionsOutput struct { +type DescribeLocalGatewayVirtualInterfacesOutput struct { _ struct{} `type:"structure"` - // Information about the launch template versions. - LaunchTemplateVersions []*LaunchTemplateVersion `locationName:"launchTemplateVersionSet" locationNameList:"item" type:"list"` + // Information about the virtual interfaces. + LocalGatewayVirtualInterfaces []*LocalGatewayVirtualInterface `locationName:"localGatewayVirtualInterfaceSet" 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. @@ -53740,28 +61329,28 @@ type DescribeLaunchTemplateVersionsOutput struct { } // String returns the string representation -func (s DescribeLaunchTemplateVersionsOutput) String() string { +func (s DescribeLocalGatewayVirtualInterfacesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeLaunchTemplateVersionsOutput) GoString() string { +func (s DescribeLocalGatewayVirtualInterfacesOutput) GoString() string { return s.String() } -// SetLaunchTemplateVersions sets the LaunchTemplateVersions field's value. -func (s *DescribeLaunchTemplateVersionsOutput) SetLaunchTemplateVersions(v []*LaunchTemplateVersion) *DescribeLaunchTemplateVersionsOutput { - s.LaunchTemplateVersions = v +// SetLocalGatewayVirtualInterfaces sets the LocalGatewayVirtualInterfaces field's value. +func (s *DescribeLocalGatewayVirtualInterfacesOutput) SetLocalGatewayVirtualInterfaces(v []*LocalGatewayVirtualInterface) *DescribeLocalGatewayVirtualInterfacesOutput { + s.LocalGatewayVirtualInterfaces = v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeLaunchTemplateVersionsOutput) SetNextToken(v string) *DescribeLaunchTemplateVersionsOutput { +func (s *DescribeLocalGatewayVirtualInterfacesOutput) SetNextToken(v string) *DescribeLocalGatewayVirtualInterfacesOutput { s.NextToken = &v return s } -type DescribeLaunchTemplatesInput struct { +type DescribeLocalGatewaysInput struct { _ struct{} `type:"structure"` // Checks whether you have the required permissions for the action, without @@ -53771,52 +61360,34 @@ type DescribeLaunchTemplatesInput struct { DryRun *bool `type:"boolean"` // One or more filters. - // - // * create-time - The time the launch template was created. - // - // * launch-template-name - The name of the launch template. - // - // * tag: - The key/value combination of a tag assigned to the resource. - // Use the tag key in the filter name and the tag value as the filter value. - // For example, to find all resources that have a tag with the key Owner - // and the value TeamA, specify tag:Owner for the filter name and TeamA for - // the filter value. - // - // * tag-key - The key of a tag assigned to the resource. Use this filter - // to find all resources assigned a tag with a specific key, regardless of - // the tag value. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` - // One or more launch template IDs. - LaunchTemplateIds []*string `locationName:"LaunchTemplateId" locationNameList:"item" type:"list"` - - // One or more launch template names. - LaunchTemplateNames []*string `locationName:"LaunchTemplateName" locationNameList:"item" type:"list"` + // The IDs of the local gateways. + LocalGatewayIds []*string `locationName:"LocalGatewayId" locationNameList:"item" 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 1 and 200. - MaxResults *int64 `min:"1" type:"integer"` + // The maximum number of results to return with 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. + // The token for the next page of results. NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeLaunchTemplatesInput) String() string { +func (s DescribeLocalGatewaysInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeLaunchTemplatesInput) GoString() string { +func (s DescribeLocalGatewaysInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLaunchTemplatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLaunchTemplatesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *DescribeLocalGatewaysInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLocalGatewaysInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) } if invalidParams.Len() > 0 { @@ -53826,46 +61397,40 @@ func (s *DescribeLaunchTemplatesInput) Validate() error { } // SetDryRun sets the DryRun field's value. -func (s *DescribeLaunchTemplatesInput) SetDryRun(v bool) *DescribeLaunchTemplatesInput { +func (s *DescribeLocalGatewaysInput) SetDryRun(v bool) *DescribeLocalGatewaysInput { s.DryRun = &v return s } // SetFilters sets the Filters field's value. -func (s *DescribeLaunchTemplatesInput) SetFilters(v []*Filter) *DescribeLaunchTemplatesInput { +func (s *DescribeLocalGatewaysInput) SetFilters(v []*Filter) *DescribeLocalGatewaysInput { s.Filters = v return s } -// SetLaunchTemplateIds sets the LaunchTemplateIds field's value. -func (s *DescribeLaunchTemplatesInput) SetLaunchTemplateIds(v []*string) *DescribeLaunchTemplatesInput { - s.LaunchTemplateIds = v - return s -} - -// SetLaunchTemplateNames sets the LaunchTemplateNames field's value. -func (s *DescribeLaunchTemplatesInput) SetLaunchTemplateNames(v []*string) *DescribeLaunchTemplatesInput { - s.LaunchTemplateNames = v +// SetLocalGatewayIds sets the LocalGatewayIds field's value. +func (s *DescribeLocalGatewaysInput) SetLocalGatewayIds(v []*string) *DescribeLocalGatewaysInput { + s.LocalGatewayIds = v return s } // SetMaxResults sets the MaxResults field's value. -func (s *DescribeLaunchTemplatesInput) SetMaxResults(v int64) *DescribeLaunchTemplatesInput { +func (s *DescribeLocalGatewaysInput) SetMaxResults(v int64) *DescribeLocalGatewaysInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeLaunchTemplatesInput) SetNextToken(v string) *DescribeLaunchTemplatesInput { +func (s *DescribeLocalGatewaysInput) SetNextToken(v string) *DescribeLocalGatewaysInput { s.NextToken = &v return s } -type DescribeLaunchTemplatesOutput struct { +type DescribeLocalGatewaysOutput struct { _ struct{} `type:"structure"` - // Information about the launch templates. - LaunchTemplates []*LaunchTemplate `locationName:"launchTemplates" locationNameList:"item" type:"list"` + // Information about the local gateways. + LocalGateways []*LocalGateway `locationName:"localGatewaySet" 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. @@ -53873,23 +61438,23 @@ type DescribeLaunchTemplatesOutput struct { } // String returns the string representation -func (s DescribeLaunchTemplatesOutput) String() string { +func (s DescribeLocalGatewaysOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeLaunchTemplatesOutput) GoString() string { +func (s DescribeLocalGatewaysOutput) GoString() string { return s.String() } -// SetLaunchTemplates sets the LaunchTemplates field's value. -func (s *DescribeLaunchTemplatesOutput) SetLaunchTemplates(v []*LaunchTemplate) *DescribeLaunchTemplatesOutput { - s.LaunchTemplates = v +// SetLocalGateways sets the LocalGateways field's value. +func (s *DescribeLocalGatewaysOutput) SetLocalGateways(v []*LocalGateway) *DescribeLocalGatewaysOutput { + s.LocalGateways = v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeLaunchTemplatesOutput) SetNextToken(v string) *DescribeLaunchTemplatesOutput { +func (s *DescribeLocalGatewaysOutput) SetNextToken(v string) *DescribeLocalGatewaysOutput { s.NextToken = &v return s } @@ -54635,7 +62200,8 @@ type DescribeNetworkInterfacesInput struct { // 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. + // results. You cannot specify this parameter and the network interface IDs + // parameter in the same request. MaxResults *int64 `min:"5" type:"integer"` // One or more network interface IDs. @@ -54753,6 +62319,9 @@ type DescribePlacementGroupsInput struct { // * strategy - The strategy of the placement group (cluster | spread | partition). Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + // The IDs of the placement groups. + GroupIds []*string `locationName:"GroupId" locationNameList:"GroupId" type:"list"` + // The names of the placement groups. // // Default: Describes all your placement groups, or only those otherwise specified. @@ -54781,6 +62350,12 @@ func (s *DescribePlacementGroupsInput) SetFilters(v []*Filter) *DescribePlacemen return s } +// SetGroupIds sets the GroupIds field's value. +func (s *DescribePlacementGroupsInput) SetGroupIds(v []*string) *DescribePlacementGroupsInput { + s.GroupIds = v + return s +} + // SetGroupNames sets the GroupNames field's value. func (s *DescribePlacementGroupsInput) SetGroupNames(v []*string) *DescribePlacementGroupsInput { s.GroupNames = v @@ -55019,6 +62594,19 @@ func (s *DescribePrincipalIdFormatOutput) SetPrincipals(v []*PrincipalIdFormat) type DescribePublicIpv4PoolsInput struct { _ struct{} `type:"structure"` + // One or more filters. + // + // * tag: - The key/value combination of a tag assigned to the resource. + // Use the tag key in the filter name and the tag value as the filter value. + // For example, to find all resources that have a tag with the key Owner + // and the value TeamA, specify tag:Owner for the filter name and TeamA for + // the filter value. + // + // * tag-key - The key of a tag assigned to the resource. Use this filter + // to find all resources assigned a tag with a specific key, regardless of + // the tag value. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + // The maximum number of results to return with a single call. To retrieve the // remaining results, make another call with the returned nextToken value. MaxResults *int64 `min:"1" type:"integer"` @@ -55053,6 +62641,12 @@ func (s *DescribePublicIpv4PoolsInput) Validate() error { return nil } +// SetFilters sets the Filters field's value. +func (s *DescribePublicIpv4PoolsInput) SetFilters(v []*Filter) *DescribePublicIpv4PoolsInput { + s.Filters = v + return s +} + // SetMaxResults sets the MaxResults field's value. func (s *DescribePublicIpv4PoolsInput) SetMaxResults(v int64) *DescribePublicIpv4PoolsInput { s.MaxResults = &v @@ -56489,7 +64083,6 @@ func (s *DescribeSecurityGroupsOutput) SetSecurityGroups(v []*SecurityGroup) *De return s } -// Contains the parameters for DescribeSnapshotAttribute. type DescribeSnapshotAttributeInput struct { _ struct{} `type:"structure"` @@ -56554,7 +64147,6 @@ func (s *DescribeSnapshotAttributeInput) SetSnapshotId(v string) *DescribeSnapsh return s } -// Contains the output of DescribeSnapshotAttribute. type DescribeSnapshotAttributeOutput struct { _ struct{} `type:"structure"` @@ -58402,6 +65994,232 @@ func (s *DescribeTransitGatewayAttachmentsOutput) SetTransitGatewayAttachments(v return s } +type DescribeTransitGatewayMulticastDomainsInput 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. The possible values are: + // + // * state - The state of the transit gateway multicast domain. Valid values + // are pending | available | deleting | deleted. + // + // * transit-gateway-id - The ID of the transit gateway. + // + // * transit-gateway-multicast-domain-id - The ID of the transit gateway + // multicast domain. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainIds []*string `locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s DescribeTransitGatewayMulticastDomainsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTransitGatewayMulticastDomainsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeTransitGatewayMulticastDomainsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTransitGatewayMulticastDomainsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *DescribeTransitGatewayMulticastDomainsInput) SetDryRun(v bool) *DescribeTransitGatewayMulticastDomainsInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeTransitGatewayMulticastDomainsInput) SetFilters(v []*Filter) *DescribeTransitGatewayMulticastDomainsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeTransitGatewayMulticastDomainsInput) SetMaxResults(v int64) *DescribeTransitGatewayMulticastDomainsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeTransitGatewayMulticastDomainsInput) SetNextToken(v string) *DescribeTransitGatewayMulticastDomainsInput { + s.NextToken = &v + return s +} + +// SetTransitGatewayMulticastDomainIds sets the TransitGatewayMulticastDomainIds field's value. +func (s *DescribeTransitGatewayMulticastDomainsInput) SetTransitGatewayMulticastDomainIds(v []*string) *DescribeTransitGatewayMulticastDomainsInput { + s.TransitGatewayMulticastDomainIds = v + return s +} + +type DescribeTransitGatewayMulticastDomainsOutput 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 transit gateway multicast domains. + TransitGatewayMulticastDomains []*TransitGatewayMulticastDomain `locationName:"transitGatewayMulticastDomains" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s DescribeTransitGatewayMulticastDomainsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTransitGatewayMulticastDomainsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeTransitGatewayMulticastDomainsOutput) SetNextToken(v string) *DescribeTransitGatewayMulticastDomainsOutput { + s.NextToken = &v + return s +} + +// SetTransitGatewayMulticastDomains sets the TransitGatewayMulticastDomains field's value. +func (s *DescribeTransitGatewayMulticastDomainsOutput) SetTransitGatewayMulticastDomains(v []*TransitGatewayMulticastDomain) *DescribeTransitGatewayMulticastDomainsOutput { + s.TransitGatewayMulticastDomains = v + return s +} + +type DescribeTransitGatewayPeeringAttachmentsInput 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 `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + + // One or more IDs of the transit gateway peering attachments. + TransitGatewayAttachmentIds []*string `type:"list"` +} + +// String returns the string representation +func (s DescribeTransitGatewayPeeringAttachmentsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTransitGatewayPeeringAttachmentsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeTransitGatewayPeeringAttachmentsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTransitGatewayPeeringAttachmentsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *DescribeTransitGatewayPeeringAttachmentsInput) SetDryRun(v bool) *DescribeTransitGatewayPeeringAttachmentsInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeTransitGatewayPeeringAttachmentsInput) SetFilters(v []*Filter) *DescribeTransitGatewayPeeringAttachmentsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeTransitGatewayPeeringAttachmentsInput) SetMaxResults(v int64) *DescribeTransitGatewayPeeringAttachmentsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeTransitGatewayPeeringAttachmentsInput) SetNextToken(v string) *DescribeTransitGatewayPeeringAttachmentsInput { + s.NextToken = &v + return s +} + +// SetTransitGatewayAttachmentIds sets the TransitGatewayAttachmentIds field's value. +func (s *DescribeTransitGatewayPeeringAttachmentsInput) SetTransitGatewayAttachmentIds(v []*string) *DescribeTransitGatewayPeeringAttachmentsInput { + s.TransitGatewayAttachmentIds = v + return s +} + +type DescribeTransitGatewayPeeringAttachmentsOutput 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 transit gateway peering attachments. + TransitGatewayPeeringAttachments []*TransitGatewayPeeringAttachment `locationName:"transitGatewayPeeringAttachments" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s DescribeTransitGatewayPeeringAttachmentsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTransitGatewayPeeringAttachmentsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeTransitGatewayPeeringAttachmentsOutput) SetNextToken(v string) *DescribeTransitGatewayPeeringAttachmentsOutput { + s.NextToken = &v + return s +} + +// SetTransitGatewayPeeringAttachments sets the TransitGatewayPeeringAttachments field's value. +func (s *DescribeTransitGatewayPeeringAttachmentsOutput) SetTransitGatewayPeeringAttachments(v []*TransitGatewayPeeringAttachment) *DescribeTransitGatewayPeeringAttachmentsOutput { + s.TransitGatewayPeeringAttachments = v + return s +} + type DescribeTransitGatewayRouteTablesInput struct { _ struct{} `type:"structure"` @@ -58788,7 +66606,6 @@ func (s *DescribeTransitGatewaysOutput) SetTransitGateways(v []*TransitGateway) return s } -// Contains the parameters for DescribeVolumeAttribute. type DescribeVolumeAttributeInput struct { _ struct{} `type:"structure"` @@ -58853,7 +66670,6 @@ func (s *DescribeVolumeAttributeInput) SetVolumeId(v string) *DescribeVolumeAttr return s } -// Contains the output of DescribeVolumeAttribute. type DescribeVolumeAttributeOutput struct { _ struct{} `type:"structure"` @@ -59062,6 +66878,12 @@ type DescribeVolumesInput struct { // // * encrypted - Indicates whether the volume is encrypted (true | false) // + // * multi-attach-enabled - Indicates whether the volume is enabled for Multi-Attach + // (true | false) + // + // * fast-restored - Indicates whether the volume was created from a snapshot + // that is enabled for fast snapshot restore (true | false). + // // * size - The size of the volume, in GiB. // // * snapshot-id - The snapshot from which the volume was created. @@ -59156,9 +66978,9 @@ type DescribeVolumesModificationsInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` - // The filters. Supported filters: volume-id, modification-state, target-size, - // target-iops, target-volume-type, original-size, original-iops, original-volume-type, - // start-time. + // The filters. Supported filters: volume-id | modification-state | target-size + // | target-iops | target-volume-type | original-size | original-iops | original-volume-type + // | start-time | originalMultiAttachEnabled | targetMultiAttachEnabled. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` // The maximum number of results (up to a limit of 500) to be returned in a @@ -59573,7 +67395,7 @@ type DescribeVpcEndpointConnectionNotificationsInput struct { // One or more filters. // - // * connection-notification-arn - The ARN of SNS topic for the notification. + // * connection-notification-arn - The ARN of the SNS topic for the notification. // // * connection-notification-id - The ID of the notification. // @@ -59692,7 +67514,7 @@ type DescribeVpcEndpointConnectionsInput struct { // 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 + // 1,000; if MaxResults is given a value larger than 1,000, only 1,000 results // are returned. MaxResults *int64 `type:"integer"` @@ -59799,7 +67621,7 @@ type DescribeVpcEndpointServiceConfigurationsInput struct { // 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 + // 1,000; if MaxResults is given a value larger than 1,000, only 1,000 results // are returned. MaxResults *int64 `type:"integer"` @@ -59903,7 +67725,7 @@ type DescribeVpcEndpointServicePermissionsInput struct { // 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 + // 1,000; if MaxResults is given a value larger than 1,000, only 1,000 results // are returned. MaxResults *int64 `type:"integer"` @@ -60014,7 +67836,7 @@ type DescribeVpcEndpointServicesInput struct { // One or more filters. // - // * service-name: The name of the service. + // * service-name - The name of the service. // // * tag: - The key/value combination of a tag assigned to the resource. // Use the tag key in the filter name and the tag value as the filter value. @@ -60031,7 +67853,7 @@ type DescribeVpcEndpointServicesInput struct { // 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. + // Constraint: If the value is greater than 1,000, we return only 1,000 items. MaxResults *int64 `type:"integer"` // The token for the next set of items to return. (You received this token from @@ -60137,11 +67959,11 @@ type DescribeVpcEndpointsInput struct { // One or more filters. // - // * service-name: The name of the service. + // * service-name - The name of the service. // - // * vpc-id: The ID of the VPC in which the endpoint resides. + // * vpc-id - The ID of the VPC in which the endpoint resides. // - // * vpc-endpoint-id: The ID of the endpoint. + // * vpc-endpoint-id - The ID of the endpoint. // // * vpc-endpoint-state - The state of the endpoint (pendingAcceptance | // pending | available | deleting | deleted | rejected | failed). @@ -60161,7 +67983,7 @@ type DescribeVpcEndpointsInput struct { // 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. + // Constraint: If the value is greater than 1,000, we return only 1,000 items. MaxResults *int64 `type:"integer"` // The token for the next set of items to return. (You received this token from @@ -60422,6 +68244,9 @@ type DescribeVpcsInput struct { // * ipv6-cidr-block-association.ipv6-cidr-block - An IPv6 CIDR block associated // with the VPC. // + // * ipv6-cidr-block-association.ipv6-pool - The ID of the IPv6 address pool + // from which the IPv6 CIDR block is allocated. + // // * ipv6-cidr-block-association.association-id - The association ID for // an IPv6 CIDR block associated with the VPC. // @@ -60594,6 +68419,9 @@ type DescribeVpnConnectionsInput struct { // // * vpn-gateway-id - The ID of a virtual private gateway associated with // the VPN connection. + // + // * transit-gateway-id - The ID of a transit gateway associated with the + // VPN connection. Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` // One or more VPN connection IDs. @@ -61006,7 +68834,6 @@ func (s DetachNetworkInterfaceOutput) GoString() string { return s.String() } -// Contains the parameters for DetachVolume. type DetachVolumeInput struct { _ struct{} `type:"structure"` @@ -61028,7 +68855,8 @@ type DetachVolumeInput struct { // and repair procedures. Force *bool `type:"boolean"` - // The ID of the instance. + // The ID of the instance. If you are detaching a Multi-Attach enabled volume, + // you must specify an instance ID. InstanceId *string `type:"string"` // The ID of the volume. @@ -61350,6 +69178,325 @@ func (s *DisableEbsEncryptionByDefaultOutput) SetEbsEncryptionByDefault(v bool) return s } +// Contains information about the errors that occurred when disabling fast snapshot +// restores. +type DisableFastSnapshotRestoreErrorItem struct { + _ struct{} `type:"structure"` + + // The errors. + FastSnapshotRestoreStateErrors []*DisableFastSnapshotRestoreStateErrorItem `locationName:"fastSnapshotRestoreStateErrorSet" locationNameList:"item" type:"list"` + + // The ID of the snapshot. + SnapshotId *string `locationName:"snapshotId" type:"string"` +} + +// String returns the string representation +func (s DisableFastSnapshotRestoreErrorItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableFastSnapshotRestoreErrorItem) GoString() string { + return s.String() +} + +// SetFastSnapshotRestoreStateErrors sets the FastSnapshotRestoreStateErrors field's value. +func (s *DisableFastSnapshotRestoreErrorItem) SetFastSnapshotRestoreStateErrors(v []*DisableFastSnapshotRestoreStateErrorItem) *DisableFastSnapshotRestoreErrorItem { + s.FastSnapshotRestoreStateErrors = v + return s +} + +// SetSnapshotId sets the SnapshotId field's value. +func (s *DisableFastSnapshotRestoreErrorItem) SetSnapshotId(v string) *DisableFastSnapshotRestoreErrorItem { + s.SnapshotId = &v + return s +} + +// Describes an error that occurred when disabling fast snapshot restores. +type DisableFastSnapshotRestoreStateError 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 DisableFastSnapshotRestoreStateError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableFastSnapshotRestoreStateError) GoString() string { + return s.String() +} + +// SetCode sets the Code field's value. +func (s *DisableFastSnapshotRestoreStateError) SetCode(v string) *DisableFastSnapshotRestoreStateError { + s.Code = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *DisableFastSnapshotRestoreStateError) SetMessage(v string) *DisableFastSnapshotRestoreStateError { + s.Message = &v + return s +} + +// Contains information about an error that occurred when disabling fast snapshot +// restores. +type DisableFastSnapshotRestoreStateErrorItem struct { + _ struct{} `type:"structure"` + + // The Availability Zone. + AvailabilityZone *string `locationName:"availabilityZone" type:"string"` + + // The error. + Error *DisableFastSnapshotRestoreStateError `locationName:"error" type:"structure"` +} + +// String returns the string representation +func (s DisableFastSnapshotRestoreStateErrorItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableFastSnapshotRestoreStateErrorItem) GoString() string { + return s.String() +} + +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *DisableFastSnapshotRestoreStateErrorItem) SetAvailabilityZone(v string) *DisableFastSnapshotRestoreStateErrorItem { + s.AvailabilityZone = &v + return s +} + +// SetError sets the Error field's value. +func (s *DisableFastSnapshotRestoreStateErrorItem) SetError(v *DisableFastSnapshotRestoreStateError) *DisableFastSnapshotRestoreStateErrorItem { + s.Error = v + return s +} + +// Describes fast snapshot restores that were successfully disabled. +type DisableFastSnapshotRestoreSuccessItem struct { + _ struct{} `type:"structure"` + + // The Availability Zone. + AvailabilityZone *string `locationName:"availabilityZone" type:"string"` + + // The time at which fast snapshot restores entered the disabled state. + DisabledTime *time.Time `locationName:"disabledTime" type:"timestamp"` + + // The time at which fast snapshot restores entered the disabling state. + DisablingTime *time.Time `locationName:"disablingTime" type:"timestamp"` + + // The time at which fast snapshot restores entered the enabled state. + EnabledTime *time.Time `locationName:"enabledTime" type:"timestamp"` + + // The time at which fast snapshot restores entered the enabling state. + EnablingTime *time.Time `locationName:"enablingTime" type:"timestamp"` + + // The time at which fast snapshot restores entered the optimizing state. + OptimizingTime *time.Time `locationName:"optimizingTime" type:"timestamp"` + + // The alias of the snapshot owner. + OwnerAlias *string `locationName:"ownerAlias" type:"string"` + + // The ID of the AWS account that owns the snapshot. + OwnerId *string `locationName:"ownerId" type:"string"` + + // The ID of the snapshot. + SnapshotId *string `locationName:"snapshotId" type:"string"` + + // The state of fast snapshot restores for the snapshot. + State *string `locationName:"state" type:"string" enum:"FastSnapshotRestoreStateCode"` + + // The reason for the state transition. The possible values are as follows: + // + // * Client.UserInitiated - The state successfully transitioned to enabling + // or disabling. + // + // * Client.UserInitiated - Lifecycle state transition - The state successfully + // transitioned to optimizing, enabled, or disabled. + StateTransitionReason *string `locationName:"stateTransitionReason" type:"string"` +} + +// String returns the string representation +func (s DisableFastSnapshotRestoreSuccessItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableFastSnapshotRestoreSuccessItem) GoString() string { + return s.String() +} + +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *DisableFastSnapshotRestoreSuccessItem) SetAvailabilityZone(v string) *DisableFastSnapshotRestoreSuccessItem { + s.AvailabilityZone = &v + return s +} + +// SetDisabledTime sets the DisabledTime field's value. +func (s *DisableFastSnapshotRestoreSuccessItem) SetDisabledTime(v time.Time) *DisableFastSnapshotRestoreSuccessItem { + s.DisabledTime = &v + return s +} + +// SetDisablingTime sets the DisablingTime field's value. +func (s *DisableFastSnapshotRestoreSuccessItem) SetDisablingTime(v time.Time) *DisableFastSnapshotRestoreSuccessItem { + s.DisablingTime = &v + return s +} + +// SetEnabledTime sets the EnabledTime field's value. +func (s *DisableFastSnapshotRestoreSuccessItem) SetEnabledTime(v time.Time) *DisableFastSnapshotRestoreSuccessItem { + s.EnabledTime = &v + return s +} + +// SetEnablingTime sets the EnablingTime field's value. +func (s *DisableFastSnapshotRestoreSuccessItem) SetEnablingTime(v time.Time) *DisableFastSnapshotRestoreSuccessItem { + s.EnablingTime = &v + return s +} + +// SetOptimizingTime sets the OptimizingTime field's value. +func (s *DisableFastSnapshotRestoreSuccessItem) SetOptimizingTime(v time.Time) *DisableFastSnapshotRestoreSuccessItem { + s.OptimizingTime = &v + return s +} + +// SetOwnerAlias sets the OwnerAlias field's value. +func (s *DisableFastSnapshotRestoreSuccessItem) SetOwnerAlias(v string) *DisableFastSnapshotRestoreSuccessItem { + s.OwnerAlias = &v + return s +} + +// SetOwnerId sets the OwnerId field's value. +func (s *DisableFastSnapshotRestoreSuccessItem) SetOwnerId(v string) *DisableFastSnapshotRestoreSuccessItem { + s.OwnerId = &v + return s +} + +// SetSnapshotId sets the SnapshotId field's value. +func (s *DisableFastSnapshotRestoreSuccessItem) SetSnapshotId(v string) *DisableFastSnapshotRestoreSuccessItem { + s.SnapshotId = &v + return s +} + +// SetState sets the State field's value. +func (s *DisableFastSnapshotRestoreSuccessItem) SetState(v string) *DisableFastSnapshotRestoreSuccessItem { + s.State = &v + return s +} + +// SetStateTransitionReason sets the StateTransitionReason field's value. +func (s *DisableFastSnapshotRestoreSuccessItem) SetStateTransitionReason(v string) *DisableFastSnapshotRestoreSuccessItem { + s.StateTransitionReason = &v + return s +} + +type DisableFastSnapshotRestoresInput struct { + _ struct{} `type:"structure"` + + // One or more Availability Zones. For example, us-east-2a. + // + // AvailabilityZones is a required field + AvailabilityZones []*string `locationName:"AvailabilityZone" locationNameList:"AvailabilityZone" 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 `type:"boolean"` + + // The IDs of one or more snapshots. For example, snap-1234567890abcdef0. + // + // SourceSnapshotIds is a required field + SourceSnapshotIds []*string `locationName:"SourceSnapshotId" locationNameList:"SnapshotId" type:"list" required:"true"` +} + +// String returns the string representation +func (s DisableFastSnapshotRestoresInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableFastSnapshotRestoresInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisableFastSnapshotRestoresInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisableFastSnapshotRestoresInput"} + if s.AvailabilityZones == nil { + invalidParams.Add(request.NewErrParamRequired("AvailabilityZones")) + } + if s.SourceSnapshotIds == nil { + invalidParams.Add(request.NewErrParamRequired("SourceSnapshotIds")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *DisableFastSnapshotRestoresInput) SetAvailabilityZones(v []*string) *DisableFastSnapshotRestoresInput { + s.AvailabilityZones = v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *DisableFastSnapshotRestoresInput) SetDryRun(v bool) *DisableFastSnapshotRestoresInput { + s.DryRun = &v + return s +} + +// SetSourceSnapshotIds sets the SourceSnapshotIds field's value. +func (s *DisableFastSnapshotRestoresInput) SetSourceSnapshotIds(v []*string) *DisableFastSnapshotRestoresInput { + s.SourceSnapshotIds = v + return s +} + +type DisableFastSnapshotRestoresOutput struct { + _ struct{} `type:"structure"` + + // Information about the snapshots for which fast snapshot restores were successfully + // disabled. + Successful []*DisableFastSnapshotRestoreSuccessItem `locationName:"successful" locationNameList:"item" type:"list"` + + // Information about the snapshots for which fast snapshot restores could not + // be disabled. + Unsuccessful []*DisableFastSnapshotRestoreErrorItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s DisableFastSnapshotRestoresOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisableFastSnapshotRestoresOutput) GoString() string { + return s.String() +} + +// SetSuccessful sets the Successful field's value. +func (s *DisableFastSnapshotRestoresOutput) SetSuccessful(v []*DisableFastSnapshotRestoreSuccessItem) *DisableFastSnapshotRestoresOutput { + s.Successful = v + return s +} + +// SetUnsuccessful sets the Unsuccessful field's value. +func (s *DisableFastSnapshotRestoresOutput) SetUnsuccessful(v []*DisableFastSnapshotRestoreErrorItem) *DisableFastSnapshotRestoresOutput { + s.Unsuccessful = v + return s +} + type DisableTransitGatewayRouteTablePropagationInput struct { _ struct{} `type:"structure"` @@ -61441,6 +69588,8 @@ func (s *DisableTransitGatewayRouteTablePropagationOutput) SetPropagation(v *Tra type DisableVgwRoutePropagationInput struct { _ struct{} `type:"structure"` + DryRun *bool `type:"boolean"` + // The ID of the virtual private gateway. // // GatewayId is a required field @@ -61478,6 +69627,12 @@ func (s *DisableVgwRoutePropagationInput) Validate() error { return nil } +// SetDryRun sets the DryRun field's value. +func (s *DisableVgwRoutePropagationInput) SetDryRun(v bool) *DisableVgwRoutePropagationInput { + s.DryRun = &v + return s +} + // SetGatewayId sets the GatewayId field's value. func (s *DisableVgwRoutePropagationInput) SetGatewayId(v string) *DisableVgwRoutePropagationInput { s.GatewayId = &v @@ -61973,6 +70128,82 @@ func (s *DisassociateSubnetCidrBlockOutput) SetSubnetId(v string) *DisassociateS return s } +type DisassociateTransitGatewayMulticastDomainInput 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 subnets; + SubnetIds []*string `locationNameList:"item" type:"list"` + + // The ID of the attachment. + TransitGatewayAttachmentId *string `type:"string"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `type:"string"` +} + +// String returns the string representation +func (s DisassociateTransitGatewayMulticastDomainInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateTransitGatewayMulticastDomainInput) GoString() string { + return s.String() +} + +// SetDryRun sets the DryRun field's value. +func (s *DisassociateTransitGatewayMulticastDomainInput) SetDryRun(v bool) *DisassociateTransitGatewayMulticastDomainInput { + s.DryRun = &v + return s +} + +// SetSubnetIds sets the SubnetIds field's value. +func (s *DisassociateTransitGatewayMulticastDomainInput) SetSubnetIds(v []*string) *DisassociateTransitGatewayMulticastDomainInput { + s.SubnetIds = v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *DisassociateTransitGatewayMulticastDomainInput) SetTransitGatewayAttachmentId(v string) *DisassociateTransitGatewayMulticastDomainInput { + s.TransitGatewayAttachmentId = &v + return s +} + +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *DisassociateTransitGatewayMulticastDomainInput) SetTransitGatewayMulticastDomainId(v string) *DisassociateTransitGatewayMulticastDomainInput { + s.TransitGatewayMulticastDomainId = &v + return s +} + +type DisassociateTransitGatewayMulticastDomainOutput struct { + _ struct{} `type:"structure"` + + // Information about the association. + Associations *TransitGatewayMulticastDomainAssociations `locationName:"associations" type:"structure"` +} + +// String returns the string representation +func (s DisassociateTransitGatewayMulticastDomainOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateTransitGatewayMulticastDomainOutput) GoString() string { + return s.String() +} + +// SetAssociations sets the Associations field's value. +func (s *DisassociateTransitGatewayMulticastDomainOutput) SetAssociations(v *TransitGatewayMulticastDomainAssociations) *DisassociateTransitGatewayMulticastDomainOutput { + s.Associations = v + return s +} + type DisassociateTransitGatewayRouteTableInput struct { _ struct{} `type:"structure"` @@ -62366,6 +70597,48 @@ func (s *DiskImageVolumeDescription) SetSize(v int64) *DiskImageVolumeDescriptio return s } +// Describes the disk. +type DiskInfo struct { + _ struct{} `type:"structure"` + + // The number of disks with this configuration. + Count *int64 `locationName:"count" type:"integer"` + + // The size of the disk in GB. + SizeInGB *int64 `locationName:"sizeInGB" type:"long"` + + // The type of disk. + Type *string `locationName:"type" type:"string" enum:"DiskType"` +} + +// String returns the string representation +func (s DiskInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DiskInfo) GoString() string { + return s.String() +} + +// SetCount sets the Count field's value. +func (s *DiskInfo) SetCount(v int64) *DiskInfo { + s.Count = &v + return s +} + +// SetSizeInGB sets the SizeInGB field's value. +func (s *DiskInfo) SetSizeInGB(v int64) *DiskInfo { + s.SizeInGB = &v + return s +} + +// SetType sets the Type field's value. +func (s *DiskInfo) SetType(v string) *DiskInfo { + s.Type = &v + return s +} + // Describes a DNS entry. type DnsEntry struct { _ struct{} `type:"structure"` @@ -62439,7 +70712,10 @@ func (s *DnsServersOptionsModifyStructure) SetEnabled(v bool) *DnsServersOptions type EbsBlockDevice struct { _ struct{} `type:"structure"` - // Indicates whether the EBS volume is deleted on instance termination. + // Indicates whether the EBS volume is deleted on instance termination. For + // more information, see Preserving Amazon EBS Volumes on Instance Termination + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/terminating-instances.html#preserving-volumes-on-termination) + // in the Amazon Elastic Compute Cloud User Guide. DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` // Indicates whether the encryption state of an EBS volume is changed while @@ -62453,6 +70729,8 @@ type EbsBlockDevice struct { // // Encrypted volumes can only be attached to instances that support Amazon EBS // encryption. For more information, see Supported Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html#EBSEncryption_supported_instances). + // + // This parameter is not returned by . Encrypted *bool `locationName:"encrypted" type:"boolean"` // The number of I/O operations per second (IOPS) that the volume supports. @@ -62497,8 +70775,9 @@ type EbsBlockDevice struct { // size. VolumeSize *int64 `locationName:"volumeSize" type:"integer"` - // The volume type. If you set the type to io1, you must also specify the IOPS - // that the volume supports. + // The volume type. If you set the type to io1, you must also specify the Iops + // parameter. If you set the type to gp2, st1, sc1, or standard, you must omit + // the Iops parameter. // // Default: gp2 VolumeType *string `locationName:"volumeType" type:"string" enum:"VolumeType"` @@ -62556,6 +70835,41 @@ func (s *EbsBlockDevice) SetVolumeType(v string) *EbsBlockDevice { return s } +// Describes the Amazon EBS features supported by the instance type. +type EbsInfo struct { + _ struct{} `type:"structure"` + + // Indicates that the instance type is Amazon EBS-optimized. For more information, + // see Amazon EBS-Optimized Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSOptimized.html) + // in Amazon EC2 User Guide for Linux Instances. + EbsOptimizedSupport *string `locationName:"ebsOptimizedSupport" type:"string" enum:"EbsOptimizedSupport"` + + // Indicates whether Amazon EBS encryption is supported. + EncryptionSupport *string `locationName:"encryptionSupport" type:"string" enum:"EbsEncryptionSupport"` +} + +// String returns the string representation +func (s EbsInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EbsInfo) GoString() string { + return s.String() +} + +// SetEbsOptimizedSupport sets the EbsOptimizedSupport field's value. +func (s *EbsInfo) SetEbsOptimizedSupport(v string) *EbsInfo { + s.EbsOptimizedSupport = &v + return s +} + +// SetEncryptionSupport sets the EncryptionSupport field's value. +func (s *EbsInfo) SetEncryptionSupport(v string) *EbsInfo { + s.EncryptionSupport = &v + return s +} + // Describes a parameter used to set up an EBS volume in a block device mapping. type EbsInstanceBlockDevice struct { _ struct{} `type:"structure"` @@ -62650,6 +70964,9 @@ type EgressOnlyInternetGateway struct { // The ID of the egress-only internet gateway. EgressOnlyInternetGatewayId *string `locationName:"egressOnlyInternetGatewayId" type:"string"` + + // The tags assigned to the egress-only internet gateway. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation @@ -62674,6 +70991,12 @@ func (s *EgressOnlyInternetGateway) SetEgressOnlyInternetGatewayId(v string) *Eg return s } +// SetTags sets the Tags field's value. +func (s *EgressOnlyInternetGateway) SetTags(v []*Tag) *EgressOnlyInternetGateway { + s.Tags = v + return s +} + // Describes the association between an instance and an Elastic Graphics accelerator. type ElasticGpuAssociation struct { _ struct{} `type:"structure"` @@ -62754,7 +71077,10 @@ func (s *ElasticGpuHealth) SetStatus(v string) *ElasticGpuHealth { type ElasticGpuSpecification struct { _ struct{} `type:"structure"` - // The type of Elastic Graphics accelerator. + // The type of Elastic Graphics accelerator. For more information about the + // values to specify for Type, see Elastic Graphics Basics (https://docs.aws.amazon.com/AWSEC2/latest/WindowsGuide/elastic-graphics.html#elastic-graphics-basics), + // specifically the Elastic Graphics accelerator column, in the Amazon Elastic + // Compute Cloud User Guide for Windows Instances. // // Type is a required field Type *string `type:"string" required:"true"` @@ -62834,6 +71160,9 @@ type ElasticGpus struct { // The ID of the instance to which the Elastic Graphics accelerator is attached. InstanceId *string `locationName:"instanceId" type:"string"` + + // The tags assigned to the Elastic Graphics accelerator. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation @@ -62882,12 +71211,23 @@ func (s *ElasticGpus) SetInstanceId(v string) *ElasticGpus { return s } +// SetTags sets the Tags field's value. +func (s *ElasticGpus) SetTags(v []*Tag) *ElasticGpus { + s.Tags = v + return s +} + // Describes an elastic inference accelerator. type ElasticInferenceAccelerator struct { _ struct{} `type:"structure"` - // The type of elastic inference accelerator. The possible values are eia1.small, - // eia1.medium, and eia1.large. + // The number of elastic inference accelerators to attach to the instance. + // + // Default: 1 + Count *int64 `min:"1" type:"integer"` + + // The type of elastic inference accelerator. The possible values are eia1.medium, + // eia1.large, and eia1.xlarge. // // Type is a required field Type *string `type:"string" required:"true"` @@ -62906,6 +71246,9 @@ func (s ElasticInferenceAccelerator) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *ElasticInferenceAccelerator) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ElasticInferenceAccelerator"} + if s.Count != nil && *s.Count < 1 { + invalidParams.Add(request.NewErrParamMinValue("Count", 1)) + } if s.Type == nil { invalidParams.Add(request.NewErrParamRequired("Type")) } @@ -62916,6 +71259,12 @@ func (s *ElasticInferenceAccelerator) Validate() error { return nil } +// SetCount sets the Count field's value. +func (s *ElasticInferenceAccelerator) SetCount(v int64) *ElasticInferenceAccelerator { + s.Count = &v + return s +} + // SetType sets the Type field's value. func (s *ElasticInferenceAccelerator) SetType(v string) *ElasticInferenceAccelerator { s.Type = &v @@ -63023,6 +71372,326 @@ func (s *EnableEbsEncryptionByDefaultOutput) SetEbsEncryptionByDefault(v bool) * return s } +// Contains information about the errors that occurred when enabling fast snapshot +// restores. +type EnableFastSnapshotRestoreErrorItem struct { + _ struct{} `type:"structure"` + + // The errors. + FastSnapshotRestoreStateErrors []*EnableFastSnapshotRestoreStateErrorItem `locationName:"fastSnapshotRestoreStateErrorSet" locationNameList:"item" type:"list"` + + // The ID of the snapshot. + SnapshotId *string `locationName:"snapshotId" type:"string"` +} + +// String returns the string representation +func (s EnableFastSnapshotRestoreErrorItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableFastSnapshotRestoreErrorItem) GoString() string { + return s.String() +} + +// SetFastSnapshotRestoreStateErrors sets the FastSnapshotRestoreStateErrors field's value. +func (s *EnableFastSnapshotRestoreErrorItem) SetFastSnapshotRestoreStateErrors(v []*EnableFastSnapshotRestoreStateErrorItem) *EnableFastSnapshotRestoreErrorItem { + s.FastSnapshotRestoreStateErrors = v + return s +} + +// SetSnapshotId sets the SnapshotId field's value. +func (s *EnableFastSnapshotRestoreErrorItem) SetSnapshotId(v string) *EnableFastSnapshotRestoreErrorItem { + s.SnapshotId = &v + return s +} + +// Describes an error that occurred when enabling fast snapshot restores. +type EnableFastSnapshotRestoreStateError 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 EnableFastSnapshotRestoreStateError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableFastSnapshotRestoreStateError) GoString() string { + return s.String() +} + +// SetCode sets the Code field's value. +func (s *EnableFastSnapshotRestoreStateError) SetCode(v string) *EnableFastSnapshotRestoreStateError { + s.Code = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *EnableFastSnapshotRestoreStateError) SetMessage(v string) *EnableFastSnapshotRestoreStateError { + s.Message = &v + return s +} + +// Contains information about an error that occurred when enabling fast snapshot +// restores. +type EnableFastSnapshotRestoreStateErrorItem struct { + _ struct{} `type:"structure"` + + // The Availability Zone. + AvailabilityZone *string `locationName:"availabilityZone" type:"string"` + + // The error. + Error *EnableFastSnapshotRestoreStateError `locationName:"error" type:"structure"` +} + +// String returns the string representation +func (s EnableFastSnapshotRestoreStateErrorItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableFastSnapshotRestoreStateErrorItem) GoString() string { + return s.String() +} + +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *EnableFastSnapshotRestoreStateErrorItem) SetAvailabilityZone(v string) *EnableFastSnapshotRestoreStateErrorItem { + s.AvailabilityZone = &v + return s +} + +// SetError sets the Error field's value. +func (s *EnableFastSnapshotRestoreStateErrorItem) SetError(v *EnableFastSnapshotRestoreStateError) *EnableFastSnapshotRestoreStateErrorItem { + s.Error = v + return s +} + +// Describes fast snapshot restores that were successfully enabled. +type EnableFastSnapshotRestoreSuccessItem struct { + _ struct{} `type:"structure"` + + // The Availability Zone. + AvailabilityZone *string `locationName:"availabilityZone" type:"string"` + + // The time at which fast snapshot restores entered the disabled state. + DisabledTime *time.Time `locationName:"disabledTime" type:"timestamp"` + + // The time at which fast snapshot restores entered the disabling state. + DisablingTime *time.Time `locationName:"disablingTime" type:"timestamp"` + + // The time at which fast snapshot restores entered the enabled state. + EnabledTime *time.Time `locationName:"enabledTime" type:"timestamp"` + + // The time at which fast snapshot restores entered the enabling state. + EnablingTime *time.Time `locationName:"enablingTime" type:"timestamp"` + + // The time at which fast snapshot restores entered the optimizing state. + OptimizingTime *time.Time `locationName:"optimizingTime" type:"timestamp"` + + // The alias of the snapshot owner. + OwnerAlias *string `locationName:"ownerAlias" type:"string"` + + // The ID of the AWS account that owns the snapshot. + OwnerId *string `locationName:"ownerId" type:"string"` + + // The ID of the snapshot. + SnapshotId *string `locationName:"snapshotId" type:"string"` + + // The state of fast snapshot restores. + State *string `locationName:"state" type:"string" enum:"FastSnapshotRestoreStateCode"` + + // The reason for the state transition. The possible values are as follows: + // + // * Client.UserInitiated - The state successfully transitioned to enabling + // or disabling. + // + // * Client.UserInitiated - Lifecycle state transition - The state successfully + // transitioned to optimizing, enabled, or disabled. + StateTransitionReason *string `locationName:"stateTransitionReason" type:"string"` +} + +// String returns the string representation +func (s EnableFastSnapshotRestoreSuccessItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableFastSnapshotRestoreSuccessItem) GoString() string { + return s.String() +} + +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *EnableFastSnapshotRestoreSuccessItem) SetAvailabilityZone(v string) *EnableFastSnapshotRestoreSuccessItem { + s.AvailabilityZone = &v + return s +} + +// SetDisabledTime sets the DisabledTime field's value. +func (s *EnableFastSnapshotRestoreSuccessItem) SetDisabledTime(v time.Time) *EnableFastSnapshotRestoreSuccessItem { + s.DisabledTime = &v + return s +} + +// SetDisablingTime sets the DisablingTime field's value. +func (s *EnableFastSnapshotRestoreSuccessItem) SetDisablingTime(v time.Time) *EnableFastSnapshotRestoreSuccessItem { + s.DisablingTime = &v + return s +} + +// SetEnabledTime sets the EnabledTime field's value. +func (s *EnableFastSnapshotRestoreSuccessItem) SetEnabledTime(v time.Time) *EnableFastSnapshotRestoreSuccessItem { + s.EnabledTime = &v + return s +} + +// SetEnablingTime sets the EnablingTime field's value. +func (s *EnableFastSnapshotRestoreSuccessItem) SetEnablingTime(v time.Time) *EnableFastSnapshotRestoreSuccessItem { + s.EnablingTime = &v + return s +} + +// SetOptimizingTime sets the OptimizingTime field's value. +func (s *EnableFastSnapshotRestoreSuccessItem) SetOptimizingTime(v time.Time) *EnableFastSnapshotRestoreSuccessItem { + s.OptimizingTime = &v + return s +} + +// SetOwnerAlias sets the OwnerAlias field's value. +func (s *EnableFastSnapshotRestoreSuccessItem) SetOwnerAlias(v string) *EnableFastSnapshotRestoreSuccessItem { + s.OwnerAlias = &v + return s +} + +// SetOwnerId sets the OwnerId field's value. +func (s *EnableFastSnapshotRestoreSuccessItem) SetOwnerId(v string) *EnableFastSnapshotRestoreSuccessItem { + s.OwnerId = &v + return s +} + +// SetSnapshotId sets the SnapshotId field's value. +func (s *EnableFastSnapshotRestoreSuccessItem) SetSnapshotId(v string) *EnableFastSnapshotRestoreSuccessItem { + s.SnapshotId = &v + return s +} + +// SetState sets the State field's value. +func (s *EnableFastSnapshotRestoreSuccessItem) SetState(v string) *EnableFastSnapshotRestoreSuccessItem { + s.State = &v + return s +} + +// SetStateTransitionReason sets the StateTransitionReason field's value. +func (s *EnableFastSnapshotRestoreSuccessItem) SetStateTransitionReason(v string) *EnableFastSnapshotRestoreSuccessItem { + s.StateTransitionReason = &v + return s +} + +type EnableFastSnapshotRestoresInput struct { + _ struct{} `type:"structure"` + + // One or more Availability Zones. For example, us-east-2a. + // + // AvailabilityZones is a required field + AvailabilityZones []*string `locationName:"AvailabilityZone" locationNameList:"AvailabilityZone" 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 `type:"boolean"` + + // The IDs of one or more snapshots. For example, snap-1234567890abcdef0. You + // can specify a snapshot that was shared with you from another AWS account. + // + // SourceSnapshotIds is a required field + SourceSnapshotIds []*string `locationName:"SourceSnapshotId" locationNameList:"SnapshotId" type:"list" required:"true"` +} + +// String returns the string representation +func (s EnableFastSnapshotRestoresInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableFastSnapshotRestoresInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EnableFastSnapshotRestoresInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EnableFastSnapshotRestoresInput"} + if s.AvailabilityZones == nil { + invalidParams.Add(request.NewErrParamRequired("AvailabilityZones")) + } + if s.SourceSnapshotIds == nil { + invalidParams.Add(request.NewErrParamRequired("SourceSnapshotIds")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *EnableFastSnapshotRestoresInput) SetAvailabilityZones(v []*string) *EnableFastSnapshotRestoresInput { + s.AvailabilityZones = v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *EnableFastSnapshotRestoresInput) SetDryRun(v bool) *EnableFastSnapshotRestoresInput { + s.DryRun = &v + return s +} + +// SetSourceSnapshotIds sets the SourceSnapshotIds field's value. +func (s *EnableFastSnapshotRestoresInput) SetSourceSnapshotIds(v []*string) *EnableFastSnapshotRestoresInput { + s.SourceSnapshotIds = v + return s +} + +type EnableFastSnapshotRestoresOutput struct { + _ struct{} `type:"structure"` + + // Information about the snapshots for which fast snapshot restores were successfully + // enabled. + Successful []*EnableFastSnapshotRestoreSuccessItem `locationName:"successful" locationNameList:"item" type:"list"` + + // Information about the snapshots for which fast snapshot restores could not + // be enabled. + Unsuccessful []*EnableFastSnapshotRestoreErrorItem `locationName:"unsuccessful" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s EnableFastSnapshotRestoresOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EnableFastSnapshotRestoresOutput) GoString() string { + return s.String() +} + +// SetSuccessful sets the Successful field's value. +func (s *EnableFastSnapshotRestoresOutput) SetSuccessful(v []*EnableFastSnapshotRestoreSuccessItem) *EnableFastSnapshotRestoresOutput { + s.Successful = v + return s +} + +// SetUnsuccessful sets the Unsuccessful field's value. +func (s *EnableFastSnapshotRestoresOutput) SetUnsuccessful(v []*EnableFastSnapshotRestoreErrorItem) *EnableFastSnapshotRestoresOutput { + s.Unsuccessful = v + return s +} + type EnableTransitGatewayRouteTablePropagationInput struct { _ struct{} `type:"structure"` @@ -63114,6 +71783,8 @@ func (s *EnableTransitGatewayRouteTablePropagationOutput) SetPropagation(v *Tran type EnableVgwRoutePropagationInput struct { _ struct{} `type:"structure"` + DryRun *bool `type:"boolean"` + // The ID of the virtual private gateway that is attached to a VPC. The virtual // private gateway must be attached to the same VPC that the routing tables // are associated with. @@ -63154,6 +71825,12 @@ func (s *EnableVgwRoutePropagationInput) Validate() error { return nil } +// SetDryRun sets the DryRun field's value. +func (s *EnableVgwRoutePropagationInput) SetDryRun(v bool) *EnableVgwRoutePropagationInput { + s.DryRun = &v + return s +} + // SetGatewayId sets the GatewayId field's value. func (s *EnableVgwRoutePropagationInput) SetGatewayId(v string) *EnableVgwRoutePropagationInput { s.GatewayId = &v @@ -63180,7 +71857,6 @@ func (s EnableVgwRoutePropagationOutput) GoString() string { return s.String() } -// Contains the parameters for EnableVolumeIO. type EnableVolumeIOInput struct { _ struct{} `type:"structure"` @@ -63934,6 +72610,9 @@ type ExportTask struct { // The status message related to the export task. StatusMessage *string `locationName:"statusMessage" type:"string"` + + // The tags for the export task. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation @@ -63982,6 +72661,12 @@ func (s *ExportTask) SetStatusMessage(v string) *ExportTask { return s } +// SetTags sets the Tags field's value. +func (s *ExportTask) SetTags(v []*Tag) *ExportTask { + s.Tags = v + return s +} + // Describes the destination for an export image task. type ExportTaskS3Location struct { _ struct{} `type:"structure"` @@ -64292,6 +72977,39 @@ func (s *ExportTransitGatewayRoutesOutput) SetS3Location(v string) *ExportTransi return s } +// Describes a Reserved Instance whose queued purchase was not deleted. +type FailedQueuedPurchaseDeletion struct { + _ struct{} `type:"structure"` + + // The error. + Error *DeleteQueuedReservedInstancesError `locationName:"error" type:"structure"` + + // The ID of the Reserved Instance. + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` +} + +// String returns the string representation +func (s FailedQueuedPurchaseDeletion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FailedQueuedPurchaseDeletion) GoString() string { + return s.String() +} + +// SetError sets the Error field's value. +func (s *FailedQueuedPurchaseDeletion) SetError(v *DeleteQueuedReservedInstancesError) *FailedQueuedPurchaseDeletion { + s.Error = v + return s +} + +// SetReservedInstancesId sets the ReservedInstancesId field's value. +func (s *FailedQueuedPurchaseDeletion) SetReservedInstancesId(v string) *FailedQueuedPurchaseDeletion { + s.ReservedInstancesId = &v + return s +} + // A filter name and value pair that is used to return a more specific list // of results from a describe operation. Filters can be used to match a set // of resources by specific criteria, such as tags, attributes, or IDs. The @@ -64360,8 +73078,8 @@ type FleetData struct { // is pending_termination while instances are terminating. ActivityStatus *string `locationName:"activityStatus" type:"string" enum:"FleetActivityStatus"` - // Unique, case-sensitive identifier you provide to ensure the idempotency of - // the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. For more information, see Ensuring Idempotency (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html). // // Constraints: Maximum 64 ASCII characters ClientToken *string `locationName:"clientToken" type:"string"` @@ -64424,11 +73142,11 @@ type FleetData struct { // The type of request. Indicates whether the EC2 Fleet only requests the target // capacity, or also attempts to maintain it. If you request a certain target // capacity, EC2 Fleet only places the required requests; it does not attempt - // to replenish instances if capacity is diminished, and does not submit requests - // in alternative capacity pools if capacity is unavailable. To maintain a certain - // target capacity, EC2 Fleet places the required requests to meet this target - // capacity. It also automatically replenishes any interrupted Spot Instances. - // Default: maintain. + // to replenish instances if capacity is diminished, and it does not submit + // requests in alternative capacity pools if capacity is unavailable. To maintain + // a certain target capacity, EC2 Fleet places the required requests to meet + // this target capacity. It also automatically replenishes any interrupted Spot + // 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). @@ -64762,7 +73480,9 @@ type FleetLaunchTemplateOverridesRequest struct { // override has the lowest priority. Priority *float64 `type:"double"` - // The ID of the subnet in which to launch the instances. + // The IDs of the subnets in which to launch the instances. Separate multiple + // subnet IDs using commas (for example, subnet-1234abcdeexample1, subnet-0987cdef6example2). + // A request of type instant can have only one subnet ID. SubnetId *string `type:"string"` // The number of units provided by the specified instance type. @@ -64980,9 +73700,22 @@ type FlowLog struct { // The name of the flow log group. LogGroupName *string `locationName:"logGroupName" type:"string"` + // The maximum interval of time, in seconds, during which a flow of packets + // is captured and aggregated into a flow log record. + // + // When a network interface is attached to a Nitro-based instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances), + // the aggregation interval is always 60 seconds (1 minute) or less, regardless + // of the specified value. + // + // Valid Values: 60 | 600 + MaxAggregationInterval *int64 `locationName:"maxAggregationInterval" type:"integer"` + // The ID of the resource on which the flow log was created. ResourceId *string `locationName:"resourceId" type:"string"` + // The tags for the flow log. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + // The type of traffic captured for the flow log. TrafficType *string `locationName:"trafficType" type:"string" enum:"TrafficType"` } @@ -65057,18 +73790,105 @@ func (s *FlowLog) SetLogGroupName(v string) *FlowLog { return s } +// SetMaxAggregationInterval sets the MaxAggregationInterval field's value. +func (s *FlowLog) SetMaxAggregationInterval(v int64) *FlowLog { + s.MaxAggregationInterval = &v + return s +} + // SetResourceId sets the ResourceId field's value. func (s *FlowLog) SetResourceId(v string) *FlowLog { s.ResourceId = &v return s } +// SetTags sets the Tags field's value. +func (s *FlowLog) SetTags(v []*Tag) *FlowLog { + s.Tags = v + return s +} + // SetTrafficType sets the TrafficType field's value. func (s *FlowLog) SetTrafficType(v string) *FlowLog { s.TrafficType = &v return s } +// Describes the FPGA accelerator for the instance type. +type FpgaDeviceInfo struct { + _ struct{} `type:"structure"` + + // The count of FPGA accelerators for the instance type. + Count *int64 `locationName:"count" type:"integer"` + + // The manufacturer of the FPGA accelerator. + Manufacturer *string `locationName:"manufacturer" type:"string"` + + // Describes the memory for the FPGA accelerator for the instance type. + MemoryInfo *FpgaDeviceMemoryInfo `locationName:"memoryInfo" type:"structure"` + + // The name of the FPGA accelerator. + Name *string `locationName:"name" type:"string"` +} + +// String returns the string representation +func (s FpgaDeviceInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FpgaDeviceInfo) GoString() string { + return s.String() +} + +// SetCount sets the Count field's value. +func (s *FpgaDeviceInfo) SetCount(v int64) *FpgaDeviceInfo { + s.Count = &v + return s +} + +// SetManufacturer sets the Manufacturer field's value. +func (s *FpgaDeviceInfo) SetManufacturer(v string) *FpgaDeviceInfo { + s.Manufacturer = &v + return s +} + +// SetMemoryInfo sets the MemoryInfo field's value. +func (s *FpgaDeviceInfo) SetMemoryInfo(v *FpgaDeviceMemoryInfo) *FpgaDeviceInfo { + s.MemoryInfo = v + return s +} + +// SetName sets the Name field's value. +func (s *FpgaDeviceInfo) SetName(v string) *FpgaDeviceInfo { + s.Name = &v + return s +} + +// Describes the memory for the FPGA accelerator for the instance type. +type FpgaDeviceMemoryInfo struct { + _ struct{} `type:"structure"` + + // The size (in MiB) for the memory available to the FPGA accelerator. + SizeInMiB *int64 `locationName:"sizeInMiB" type:"integer"` +} + +// String returns the string representation +func (s FpgaDeviceMemoryInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FpgaDeviceMemoryInfo) GoString() string { + return s.String() +} + +// SetSizeInMiB sets the SizeInMiB field's value. +func (s *FpgaDeviceMemoryInfo) SetSizeInMiB(v int64) *FpgaDeviceMemoryInfo { + s.SizeInMiB = &v + return s +} + // Describes an Amazon FPGA image (AFI). type FpgaImage struct { _ struct{} `type:"structure"` @@ -65321,6 +74141,144 @@ func (s *FpgaImageState) SetMessage(v string) *FpgaImageState { return s } +// Describes the FPGAs for the instance type. +type FpgaInfo struct { + _ struct{} `type:"structure"` + + // Describes the FPGAs for the instance type. + Fpgas []*FpgaDeviceInfo `locationName:"fpgas" locationNameList:"item" type:"list"` + + // The total memory of all FPGA accelerators for the instance type. + TotalFpgaMemoryInMiB *int64 `locationName:"totalFpgaMemoryInMiB" type:"integer"` +} + +// String returns the string representation +func (s FpgaInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FpgaInfo) GoString() string { + return s.String() +} + +// SetFpgas sets the Fpgas field's value. +func (s *FpgaInfo) SetFpgas(v []*FpgaDeviceInfo) *FpgaInfo { + s.Fpgas = v + return s +} + +// SetTotalFpgaMemoryInMiB sets the TotalFpgaMemoryInMiB field's value. +func (s *FpgaInfo) SetTotalFpgaMemoryInMiB(v int64) *FpgaInfo { + s.TotalFpgaMemoryInMiB = &v + return s +} + +type GetAssociatedIpv6PoolCidrsInput 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 results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"1" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + + // The ID of the IPv6 address pool. + // + // PoolId is a required field + PoolId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s GetAssociatedIpv6PoolCidrsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAssociatedIpv6PoolCidrsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAssociatedIpv6PoolCidrsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAssociatedIpv6PoolCidrsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.PoolId == nil { + invalidParams.Add(request.NewErrParamRequired("PoolId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *GetAssociatedIpv6PoolCidrsInput) SetDryRun(v bool) *GetAssociatedIpv6PoolCidrsInput { + s.DryRun = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *GetAssociatedIpv6PoolCidrsInput) SetMaxResults(v int64) *GetAssociatedIpv6PoolCidrsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetAssociatedIpv6PoolCidrsInput) SetNextToken(v string) *GetAssociatedIpv6PoolCidrsInput { + s.NextToken = &v + return s +} + +// SetPoolId sets the PoolId field's value. +func (s *GetAssociatedIpv6PoolCidrsInput) SetPoolId(v string) *GetAssociatedIpv6PoolCidrsInput { + s.PoolId = &v + return s +} + +type GetAssociatedIpv6PoolCidrsOutput struct { + _ struct{} `type:"structure"` + + // Information about the IPv6 CIDR block associations. + Ipv6CidrAssociations []*Ipv6CidrAssociation `locationName:"ipv6CidrAssociationSet" 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 GetAssociatedIpv6PoolCidrsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAssociatedIpv6PoolCidrsOutput) GoString() string { + return s.String() +} + +// SetIpv6CidrAssociations sets the Ipv6CidrAssociations field's value. +func (s *GetAssociatedIpv6PoolCidrsOutput) SetIpv6CidrAssociations(v []*Ipv6CidrAssociation) *GetAssociatedIpv6PoolCidrsOutput { + s.Ipv6CidrAssociations = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetAssociatedIpv6PoolCidrsOutput) SetNextToken(v string) *GetAssociatedIpv6PoolCidrsOutput { + s.NextToken = &v + return s +} + type GetCapacityReservationUsageInput struct { _ struct{} `type:"structure"` @@ -65493,6 +74451,136 @@ func (s *GetCapacityReservationUsageOutput) SetTotalInstanceCount(v int64) *GetC return s } +type GetCoipPoolUsageInput 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 filters. The following are the possible values: + // + // * coip-address-usage.allocation-id + // + // * coip-address-usage.aws-account-id + // + // * coip-address-usage.aws-service + // + // * coip-address-usage.co-ip + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + + // The ID of the address pool. + // + // PoolId is a required field + PoolId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s GetCoipPoolUsageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCoipPoolUsageInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetCoipPoolUsageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetCoipPoolUsageInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + if s.PoolId == nil { + invalidParams.Add(request.NewErrParamRequired("PoolId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *GetCoipPoolUsageInput) SetDryRun(v bool) *GetCoipPoolUsageInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *GetCoipPoolUsageInput) SetFilters(v []*Filter) *GetCoipPoolUsageInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *GetCoipPoolUsageInput) SetMaxResults(v int64) *GetCoipPoolUsageInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetCoipPoolUsageInput) SetNextToken(v string) *GetCoipPoolUsageInput { + s.NextToken = &v + return s +} + +// SetPoolId sets the PoolId field's value. +func (s *GetCoipPoolUsageInput) SetPoolId(v string) *GetCoipPoolUsageInput { + s.PoolId = &v + return s +} + +type GetCoipPoolUsageOutput struct { + _ struct{} `type:"structure"` + + // Information about the address usage. + CoipAddressUsages []*CoipAddressUsage `locationName:"coipAddressUsageSet" locationNameList:"item" type:"list"` + + // The ID of the customer-owned address pool. + CoipPoolId *string `locationName:"coipPoolId" type:"string"` + + // The ID of the local gateway route table. + LocalGatewayRouteTableId *string `locationName:"localGatewayRouteTableId" type:"string"` +} + +// String returns the string representation +func (s GetCoipPoolUsageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCoipPoolUsageOutput) GoString() string { + return s.String() +} + +// SetCoipAddressUsages sets the CoipAddressUsages field's value. +func (s *GetCoipPoolUsageOutput) SetCoipAddressUsages(v []*CoipAddressUsage) *GetCoipPoolUsageOutput { + s.CoipAddressUsages = v + return s +} + +// SetCoipPoolId sets the CoipPoolId field's value. +func (s *GetCoipPoolUsageOutput) SetCoipPoolId(v string) *GetCoipPoolUsageOutput { + s.CoipPoolId = &v + return s +} + +// SetLocalGatewayRouteTableId sets the LocalGatewayRouteTableId field's value. +func (s *GetCoipPoolUsageOutput) SetLocalGatewayRouteTableId(v string) *GetCoipPoolUsageOutput { + s.LocalGatewayRouteTableId = &v + return s +} + type GetConsoleOutputInput struct { _ struct{} `type:"structure"` @@ -65688,6 +74776,79 @@ func (s *GetConsoleScreenshotOutput) SetInstanceId(v string) *GetConsoleScreensh return s } +type GetDefaultCreditSpecificationInput 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 instance family. + // + // InstanceFamily is a required field + InstanceFamily *string `type:"string" required:"true" enum:"UnlimitedSupportedInstanceFamily"` +} + +// String returns the string representation +func (s GetDefaultCreditSpecificationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDefaultCreditSpecificationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetDefaultCreditSpecificationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetDefaultCreditSpecificationInput"} + if s.InstanceFamily == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceFamily")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *GetDefaultCreditSpecificationInput) SetDryRun(v bool) *GetDefaultCreditSpecificationInput { + s.DryRun = &v + return s +} + +// SetInstanceFamily sets the InstanceFamily field's value. +func (s *GetDefaultCreditSpecificationInput) SetInstanceFamily(v string) *GetDefaultCreditSpecificationInput { + s.InstanceFamily = &v + return s +} + +type GetDefaultCreditSpecificationOutput struct { + _ struct{} `type:"structure"` + + // The default credit option for CPU usage of the instance family. + InstanceFamilyCreditSpecification *InstanceFamilyCreditSpecification `locationName:"instanceFamilyCreditSpecification" type:"structure"` +} + +// String returns the string representation +func (s GetDefaultCreditSpecificationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDefaultCreditSpecificationOutput) GoString() string { + return s.String() +} + +// SetInstanceFamilyCreditSpecification sets the InstanceFamilyCreditSpecification field's value. +func (s *GetDefaultCreditSpecificationOutput) SetInstanceFamilyCreditSpecification(v *InstanceFamilyCreditSpecification) *GetDefaultCreditSpecificationOutput { + s.InstanceFamilyCreditSpecification = v + return s +} + type GetEbsDefaultKmsKeyIdInput struct { _ struct{} `type:"structure"` @@ -66339,6 +75500,126 @@ func (s *GetTransitGatewayAttachmentPropagationsOutput) SetTransitGatewayAttachm return s } +type GetTransitGatewayMulticastDomainAssociationsInput 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. The possible values are: + // + // * resource-id - The ID of the resource. + // + // * resource-type - The type of resource. The valid value is: vpc. + // + // * state - The state of the subnet association. Valid values are associated + // | associating | disassociated | disassociating. + // + // * subnet-id - The ID of the subnet. + // + // * transit-gateway-attachment-id - The id of the transit gateway attachment. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `type:"string"` +} + +// String returns the string representation +func (s GetTransitGatewayMulticastDomainAssociationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTransitGatewayMulticastDomainAssociationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetTransitGatewayMulticastDomainAssociationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetTransitGatewayMulticastDomainAssociationsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *GetTransitGatewayMulticastDomainAssociationsInput) SetDryRun(v bool) *GetTransitGatewayMulticastDomainAssociationsInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *GetTransitGatewayMulticastDomainAssociationsInput) SetFilters(v []*Filter) *GetTransitGatewayMulticastDomainAssociationsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *GetTransitGatewayMulticastDomainAssociationsInput) SetMaxResults(v int64) *GetTransitGatewayMulticastDomainAssociationsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetTransitGatewayMulticastDomainAssociationsInput) SetNextToken(v string) *GetTransitGatewayMulticastDomainAssociationsInput { + s.NextToken = &v + return s +} + +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *GetTransitGatewayMulticastDomainAssociationsInput) SetTransitGatewayMulticastDomainId(v string) *GetTransitGatewayMulticastDomainAssociationsInput { + s.TransitGatewayMulticastDomainId = &v + return s +} + +type GetTransitGatewayMulticastDomainAssociationsOutput struct { + _ struct{} `type:"structure"` + + // Information about the multicast domain associations. + MulticastDomainAssociations []*TransitGatewayMulticastDomainAssociation `locationName:"multicastDomainAssociations" 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 GetTransitGatewayMulticastDomainAssociationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTransitGatewayMulticastDomainAssociationsOutput) GoString() string { + return s.String() +} + +// SetMulticastDomainAssociations sets the MulticastDomainAssociations field's value. +func (s *GetTransitGatewayMulticastDomainAssociationsOutput) SetMulticastDomainAssociations(v []*TransitGatewayMulticastDomainAssociation) *GetTransitGatewayMulticastDomainAssociationsOutput { + s.MulticastDomainAssociations = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetTransitGatewayMulticastDomainAssociationsOutput) SetNextToken(v string) *GetTransitGatewayMulticastDomainAssociationsOutput { + s.NextToken = &v + return s +} + type GetTransitGatewayRouteTableAssociationsInput struct { _ struct{} `type:"structure"` @@ -66579,6 +75860,114 @@ func (s *GetTransitGatewayRouteTablePropagationsOutput) SetTransitGatewayRouteTa return s } +// Describes the GPU accelerators for the instance type. +type GpuDeviceInfo struct { + _ struct{} `type:"structure"` + + // The number of GPUs for the instance type. + Count *int64 `locationName:"count" type:"integer"` + + // The manufacturer of the GPU accelerator. + Manufacturer *string `locationName:"manufacturer" type:"string"` + + // Describes the memory available to the GPU accelerator. + MemoryInfo *GpuDeviceMemoryInfo `locationName:"memoryInfo" type:"structure"` + + // The name of the GPU accelerator. + Name *string `locationName:"name" type:"string"` +} + +// String returns the string representation +func (s GpuDeviceInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GpuDeviceInfo) GoString() string { + return s.String() +} + +// SetCount sets the Count field's value. +func (s *GpuDeviceInfo) SetCount(v int64) *GpuDeviceInfo { + s.Count = &v + return s +} + +// SetManufacturer sets the Manufacturer field's value. +func (s *GpuDeviceInfo) SetManufacturer(v string) *GpuDeviceInfo { + s.Manufacturer = &v + return s +} + +// SetMemoryInfo sets the MemoryInfo field's value. +func (s *GpuDeviceInfo) SetMemoryInfo(v *GpuDeviceMemoryInfo) *GpuDeviceInfo { + s.MemoryInfo = v + return s +} + +// SetName sets the Name field's value. +func (s *GpuDeviceInfo) SetName(v string) *GpuDeviceInfo { + s.Name = &v + return s +} + +// Describes the memory available to the GPU accelerator. +type GpuDeviceMemoryInfo struct { + _ struct{} `type:"structure"` + + // The size (in MiB) for the memory available to the GPU accelerator. + SizeInMiB *int64 `locationName:"sizeInMiB" type:"integer"` +} + +// String returns the string representation +func (s GpuDeviceMemoryInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GpuDeviceMemoryInfo) GoString() string { + return s.String() +} + +// SetSizeInMiB sets the SizeInMiB field's value. +func (s *GpuDeviceMemoryInfo) SetSizeInMiB(v int64) *GpuDeviceMemoryInfo { + s.SizeInMiB = &v + return s +} + +// Describes the GPU accelerators for the instance type. +type GpuInfo struct { + _ struct{} `type:"structure"` + + // Describes the GPU accelerators for the instance type. + Gpus []*GpuDeviceInfo `locationName:"gpus" locationNameList:"item" type:"list"` + + // The total size of the memory for the GPU accelerators for the instance type. + TotalGpuMemoryInMiB *int64 `locationName:"totalGpuMemoryInMiB" type:"integer"` +} + +// String returns the string representation +func (s GpuInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GpuInfo) GoString() string { + return s.String() +} + +// SetGpus sets the Gpus field's value. +func (s *GpuInfo) SetGpus(v []*GpuDeviceInfo) *GpuInfo { + s.Gpus = v + return s +} + +// SetTotalGpuMemoryInMiB sets the TotalGpuMemoryInMiB field's value. +func (s *GpuInfo) SetTotalGpuMemoryInMiB(v int64) *GpuInfo { + s.TotalGpuMemoryInMiB = &v + return s +} + // Describes a security group. type GroupIdentifier struct { _ struct{} `type:"structure"` @@ -66614,8 +76003,7 @@ func (s *GroupIdentifier) SetGroupName(v string) *GroupIdentifier { // Indicates whether your instance is configured for hibernation. This parameter // is valid only if the instance meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites). -// Hibernation is currently supported only for Amazon Linux. For more information, -// see Hibernate Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) +// For more information, see Hibernate Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) // in the Amazon Elastic Compute Cloud User Guide. type HibernationOptions struct { _ struct{} `type:"structure"` @@ -66643,8 +76031,7 @@ func (s *HibernationOptions) SetConfigured(v bool) *HibernationOptions { // Indicates whether your instance is configured for hibernation. This parameter // is valid only if the instance meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites). -// Hibernation is currently supported only for Amazon Linux. For more information, -// see Hibernate Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) +// For more information, see Hibernate Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) // in the Amazon Elastic Compute Cloud User Guide. type HibernationOptionsRequest struct { _ struct{} `type:"structure"` @@ -66771,13 +76158,23 @@ type Host struct { // The time that the Dedicated Host was allocated. AllocationTime *time.Time `locationName:"allocationTime" type:"timestamp"` + // Indicates whether the Dedicated Host supports multiple instance types of + // the same instance family, or a specific instance type only. one indicates + // that the Dedicated Host supports multiple instance types in the instance + // family. off indicates that the Dedicated Host supports a single instance + // type only. + AllowsMultipleInstanceTypes *string `locationName:"allowsMultipleInstanceTypes" type:"string" enum:"AllowsMultipleInstanceTypes"` + // 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. + // The ID of the Availability Zone in which the Dedicated Host is allocated. + AvailabilityZoneId *string `locationName:"availabilityZoneId" type:"string"` + + // Information about the instances running on the Dedicated Host. AvailableCapacity *AvailableCapacity `locationName:"availableCapacity" type:"structure"` // Unique, case-sensitive identifier that you provide to ensure the idempotency @@ -66801,6 +76198,13 @@ type Host struct { // The IDs and instance type that are currently running on the Dedicated Host. Instances []*HostInstance `locationName:"instances" locationNameList:"item" type:"list"` + // Indicates whether the Dedicated Host is in a host resource group. If memberOfServiceLinkedResourceGroup + // is true, the host is in a host resource group; otherwise, it is not. + MemberOfServiceLinkedResourceGroup *bool `locationName:"memberOfServiceLinkedResourceGroup" type:"boolean"` + + // The ID of the AWS account that owns the Dedicated Host. + OwnerId *string `locationName:"ownerId" type:"string"` + // The time that the Dedicated Host was released. ReleaseTime *time.Time `locationName:"releaseTime" type:"timestamp"` @@ -66827,6 +76231,12 @@ func (s *Host) SetAllocationTime(v time.Time) *Host { return s } +// SetAllowsMultipleInstanceTypes sets the AllowsMultipleInstanceTypes field's value. +func (s *Host) SetAllowsMultipleInstanceTypes(v string) *Host { + s.AllowsMultipleInstanceTypes = &v + return s +} + // SetAutoPlacement sets the AutoPlacement field's value. func (s *Host) SetAutoPlacement(v string) *Host { s.AutoPlacement = &v @@ -66839,6 +76249,12 @@ func (s *Host) SetAvailabilityZone(v string) *Host { return s } +// SetAvailabilityZoneId sets the AvailabilityZoneId field's value. +func (s *Host) SetAvailabilityZoneId(v string) *Host { + s.AvailabilityZoneId = &v + return s +} + // SetAvailableCapacity sets the AvailableCapacity field's value. func (s *Host) SetAvailableCapacity(v *AvailableCapacity) *Host { s.AvailableCapacity = v @@ -66881,6 +76297,18 @@ func (s *Host) SetInstances(v []*HostInstance) *Host { return s } +// SetMemberOfServiceLinkedResourceGroup sets the MemberOfServiceLinkedResourceGroup field's value. +func (s *Host) SetMemberOfServiceLinkedResourceGroup(v bool) *Host { + s.MemberOfServiceLinkedResourceGroup = &v + return s +} + +// SetOwnerId sets the OwnerId field's value. +func (s *Host) SetOwnerId(v string) *Host { + s.OwnerId = &v + return s +} + // SetReleaseTime sets the ReleaseTime field's value. func (s *Host) SetReleaseTime(v time.Time) *Host { s.ReleaseTime = &v @@ -66903,11 +76331,14 @@ func (s *Host) SetTags(v []*Tag) *Host { type HostInstance struct { _ struct{} `type:"structure"` - // the IDs of instances that are running on the Dedicated Host. + // The ID of instance that is running on the Dedicated Host. InstanceId *string `locationName:"instanceId" type:"string"` - // The instance type size (for example, m3.medium) of the running instance. + // The instance type (for example, m3.medium) of the running instance. InstanceType *string `locationName:"instanceType" type:"string"` + + // The ID of the AWS account that owns the instance. + OwnerId *string `locationName:"ownerId" type:"string"` } // String returns the string representation @@ -66932,6 +76363,12 @@ func (s *HostInstance) SetInstanceType(v string) *HostInstance { return s } +// SetOwnerId sets the OwnerId field's value. +func (s *HostInstance) SetOwnerId(v string) *HostInstance { + s.OwnerId = &v + return s +} + // Details about the Dedicated Host Reservation offering. type HostOffering struct { _ struct{} `type:"structure"` @@ -67010,20 +76447,24 @@ func (s *HostOffering) SetUpfrontPrice(v string) *HostOffering { return s } -// Describes properties of a Dedicated Host. +// Describes the properties of a Dedicated Host. 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). + // The instance family supported by the Dedicated Host. For example, m5. + InstanceFamily *string `locationName:"instanceFamily" type:"string"` + + // The instance type supported by the Dedicated Host. For example, m5.large. + // If the host supports multiple instance types, no instanceType is returned. 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. + // The total number of vCPUs on the Dedicated Host. TotalVCpus *int64 `locationName:"totalVCpus" type:"integer"` } @@ -67043,6 +76484,12 @@ func (s *HostProperties) SetCores(v int64) *HostProperties { return s } +// SetInstanceFamily sets the InstanceFamily field's value. +func (s *HostProperties) SetInstanceFamily(v string) *HostProperties { + s.InstanceFamily = &v + return s +} + // SetInstanceType sets the InstanceType field's value. func (s *HostProperties) SetInstanceType(v string) *HostProperties { s.InstanceType = &v @@ -67506,6 +76953,11 @@ type Image struct { // This value is set to windows for Windows AMIs; otherwise, it is blank. Platform *string `locationName:"platform" type:"string" enum:"PlatformValues"` + // The platform details associated with the billing code of the AMI. For more + // information, see Obtaining Billing Information (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html) + // in the Amazon Elastic Compute Cloud User Guide. + PlatformDetails *string `locationName:"platformDetails" type:"string"` + // Any product codes associated with the AMI. ProductCodes []*ProductCode `locationName:"productCodes" locationNameList:"item" type:"list"` @@ -67539,6 +76991,14 @@ type Image struct { // Any tags assigned to the image. Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + // The operation of the Amazon EC2 instance and the billing code that is associated + // with the AMI. usageOperation corresponds to the lineitem/Operation (https://docs.aws.amazon.com/cur/latest/userguide/Lineitem-columns.html#Lineitem-details-O-Operation) + // column on your AWS Cost and Usage Report and in the AWS Price List API (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/price-changes.html). + // For the list of UsageOperation codes, see Platform Details and Usage Operation + // Billing Codes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html#billing-info) + // in the Amazon Elastic Compute Cloud User Guide. + UsageOperation *string `locationName:"usageOperation" type:"string"` + // The type of virtualization of the AMI. VirtualizationType *string `locationName:"virtualizationType" type:"string" enum:"VirtualizationType"` } @@ -67637,6 +77097,12 @@ func (s *Image) SetPlatform(v string) *Image { return s } +// SetPlatformDetails sets the PlatformDetails field's value. +func (s *Image) SetPlatformDetails(v string) *Image { + s.PlatformDetails = &v + return s +} + // SetProductCodes sets the ProductCodes field's value. func (s *Image) SetProductCodes(v []*ProductCode) *Image { s.ProductCodes = v @@ -67691,6 +77157,12 @@ func (s *Image) SetTags(v []*Tag) *Image { return s } +// SetUsageOperation sets the UsageOperation field's value. +func (s *Image) SetUsageOperation(v string) *Image { + s.UsageOperation = &v + return s +} + // SetVirtualizationType sets the VirtualizationType field's value. func (s *Image) SetVirtualizationType(v string) *Image { s.VirtualizationType = &v @@ -67897,11 +77369,11 @@ type ImportImageInput struct { // Valid values: xen Hypervisor *string `type:"string"` - // An identifier for the AWS Key Management Service (AWS KMS) customer master - // key (CMK) to use when creating the encrypted AMI. 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. If a KmsKeyId is specified, the Encrypted - // flag must also be set. + // An identifier for the symmetric AWS Key Management Service (AWS KMS) customer + // master key (CMK) to use when creating the encrypted AMI. 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. If a KmsKeyId is specified, + // the Encrypted flag must also be set. // // The CMK identifier may be provided in any of the following formats: // @@ -67924,8 +77396,13 @@ type ImportImageInput struct { // will eventually report failure. // // The specified CMK must exist in the Region that the AMI is being copied to. + // + // Amazon EBS does not support asymmetric CMKs. KmsKeyId *string `type:"string"` + // The ARNs of the license configurations. + LicenseSpecifications []*ImportImageLicenseConfigurationRequest `locationNameList:"item" type:"list"` + // The license type to be used for the Amazon Machine Image (AMI) after importing. // // By default, we detect the source-system operating system (OS) and apply the @@ -68012,6 +77489,12 @@ func (s *ImportImageInput) SetKmsKeyId(v string) *ImportImageInput { return s } +// SetLicenseSpecifications sets the LicenseSpecifications field's value. +func (s *ImportImageInput) SetLicenseSpecifications(v []*ImportImageLicenseConfigurationRequest) *ImportImageInput { + s.LicenseSpecifications = v + return s +} + // SetLicenseType sets the LicenseType field's value. func (s *ImportImageInput) SetLicenseType(v string) *ImportImageInput { s.LicenseType = &v @@ -68030,6 +77513,54 @@ func (s *ImportImageInput) SetRoleName(v string) *ImportImageInput { return s } +// The request information of license configurations. +type ImportImageLicenseConfigurationRequest struct { + _ struct{} `type:"structure"` + + // The ARN of a license configuration. + LicenseConfigurationArn *string `type:"string"` +} + +// String returns the string representation +func (s ImportImageLicenseConfigurationRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportImageLicenseConfigurationRequest) GoString() string { + return s.String() +} + +// SetLicenseConfigurationArn sets the LicenseConfigurationArn field's value. +func (s *ImportImageLicenseConfigurationRequest) SetLicenseConfigurationArn(v string) *ImportImageLicenseConfigurationRequest { + s.LicenseConfigurationArn = &v + return s +} + +// The response information for license configurations. +type ImportImageLicenseConfigurationResponse struct { + _ struct{} `type:"structure"` + + // The ARN of a license configuration. + LicenseConfigurationArn *string `locationName:"licenseConfigurationArn" type:"string"` +} + +// String returns the string representation +func (s ImportImageLicenseConfigurationResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportImageLicenseConfigurationResponse) GoString() string { + return s.String() +} + +// SetLicenseConfigurationArn sets the LicenseConfigurationArn field's value. +func (s *ImportImageLicenseConfigurationResponse) SetLicenseConfigurationArn(v string) *ImportImageLicenseConfigurationResponse { + s.LicenseConfigurationArn = &v + return s +} + type ImportImageOutput struct { _ struct{} `type:"structure"` @@ -68051,10 +77582,13 @@ type ImportImageOutput struct { // The task ID of the import image task. ImportTaskId *string `locationName:"importTaskId" type:"string"` - // The identifier for the AWS Key Management Service (AWS KMS) customer master - // key (CMK) that was used to create the encrypted AMI. + // The identifier for the symmetric AWS Key Management Service (AWS KMS) customer + // master key (CMK) that was used to create the encrypted AMI. KmsKeyId *string `locationName:"kmsKeyId" type:"string"` + // The ARNs of the license configurations. + LicenseSpecifications []*ImportImageLicenseConfigurationResponse `locationName:"licenseSpecifications" locationNameList:"item" type:"list"` + // The license type of the virtual machine. LicenseType *string `locationName:"licenseType" type:"string"` @@ -68126,6 +77660,12 @@ func (s *ImportImageOutput) SetKmsKeyId(v string) *ImportImageOutput { return s } +// SetLicenseSpecifications sets the LicenseSpecifications field's value. +func (s *ImportImageOutput) SetLicenseSpecifications(v []*ImportImageLicenseConfigurationResponse) *ImportImageOutput { + s.LicenseSpecifications = v + return s +} + // SetLicenseType sets the LicenseType field's value. func (s *ImportImageOutput) SetLicenseType(v string) *ImportImageOutput { s.LicenseType = &v @@ -68192,6 +77732,10 @@ type ImportImageTask struct { // key (CMK) that was used to create the encrypted image. KmsKeyId *string `locationName:"kmsKeyId" type:"string"` + // The ARNs of the license configurations that are associated with the import + // image task. + LicenseSpecifications []*ImportImageLicenseConfigurationResponse `locationName:"licenseSpecifications" locationNameList:"item" type:"list"` + // The license type of the virtual machine. LicenseType *string `locationName:"licenseType" type:"string"` @@ -68209,6 +77753,9 @@ type ImportImageTask struct { // A descriptive status message for the import image task. StatusMessage *string `locationName:"statusMessage" type:"string"` + + // The tags for the import image task. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation @@ -68263,6 +77810,12 @@ func (s *ImportImageTask) SetKmsKeyId(v string) *ImportImageTask { return s } +// SetLicenseSpecifications sets the LicenseSpecifications field's value. +func (s *ImportImageTask) SetLicenseSpecifications(v []*ImportImageLicenseConfigurationResponse) *ImportImageTask { + s.LicenseSpecifications = v + return s +} + // SetLicenseType sets the LicenseType field's value. func (s *ImportImageTask) SetLicenseType(v string) *ImportImageTask { s.LicenseType = &v @@ -68299,6 +77852,12 @@ func (s *ImportImageTask) SetStatusMessage(v string) *ImportImageTask { return s } +// SetTags sets the Tags field's value. +func (s *ImportImageTask) SetTags(v []*Tag) *ImportImageTask { + s.Tags = v + return s +} + type ImportInstanceInput struct { _ struct{} `type:"structure"` @@ -68424,7 +77983,7 @@ type ImportInstanceLaunchSpecification struct { SubnetId *string `locationName:"subnetId" type:"string"` // The Base64-encoded user data to make available to the instance. - UserData *UserData `locationName:"userData" type:"structure"` + UserData *UserData `locationName:"userData" type:"structure" sensitive:"true"` } // String returns the string representation @@ -68782,10 +78341,10 @@ type ImportSnapshotInput struct { // in the Amazon Elastic Compute Cloud User Guide. Encrypted *bool `type:"boolean"` - // An identifier for the AWS Key Management Service (AWS KMS) customer master - // key (CMK) to use when creating the encrypted snapshot. 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. If a KmsKeyId is specified, + // An identifier for the symmetric AWS Key Management Service (AWS KMS) customer + // master key (CMK) to use when creating the encrypted snapshot. 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. If a KmsKeyId is specified, // the Encrypted flag must also be set. // // The CMK identifier may be provided in any of the following formats: @@ -68810,6 +78369,8 @@ type ImportSnapshotInput struct { // // The specified CMK must exist in the Region that the snapshot is being copied // to. + // + // Amazon EBS does not support asymmetric CMKs. KmsKeyId *string `type:"string"` // The name of the role to use when not using the default role, 'vmimport'. @@ -68927,6 +78488,9 @@ type ImportSnapshotTask struct { // Describes an import snapshot task. SnapshotTaskDetail *SnapshotTaskDetail `locationName:"snapshotTaskDetail" type:"structure"` + + // The tags for the import snapshot task. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation @@ -68957,6 +78521,12 @@ func (s *ImportSnapshotTask) SetSnapshotTaskDetail(v *SnapshotTaskDetail) *Impor return s } +// SetTags sets the Tags field's value. +func (s *ImportSnapshotTask) SetTags(v []*Tag) *ImportSnapshotTask { + s.Tags = v + return s +} + type ImportVolumeInput struct { _ struct{} `type:"structure"` @@ -69137,6 +78707,72 @@ func (s *ImportVolumeTaskDetails) SetVolume(v *DiskImageVolumeDescription) *Impo return s } +// Describes the Inference accelerators for the instance type. +type InferenceAcceleratorInfo struct { + _ struct{} `type:"structure"` + + // Describes the Inference accelerators for the instance type. + Accelerators []*InferenceDeviceInfo `locationName:"accelerators" type:"list"` +} + +// String returns the string representation +func (s InferenceAcceleratorInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InferenceAcceleratorInfo) GoString() string { + return s.String() +} + +// SetAccelerators sets the Accelerators field's value. +func (s *InferenceAcceleratorInfo) SetAccelerators(v []*InferenceDeviceInfo) *InferenceAcceleratorInfo { + s.Accelerators = v + return s +} + +// Describes the Inference accelerators for the instance type. +type InferenceDeviceInfo struct { + _ struct{} `type:"structure"` + + // The number of Inference accelerators for the instance type. + Count *int64 `locationName:"count" type:"integer"` + + // The manufacturer of the Inference accelerator. + Manufacturer *string `locationName:"manufacturer" type:"string"` + + // The name of the Inference accelerator. + Name *string `locationName:"name" type:"string"` +} + +// String returns the string representation +func (s InferenceDeviceInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InferenceDeviceInfo) GoString() string { + return s.String() +} + +// SetCount sets the Count field's value. +func (s *InferenceDeviceInfo) SetCount(v int64) *InferenceDeviceInfo { + s.Count = &v + return s +} + +// SetManufacturer sets the Manufacturer field's value. +func (s *InferenceDeviceInfo) SetManufacturer(v string) *InferenceDeviceInfo { + s.Manufacturer = &v + return s +} + +// SetName sets the Name field's value. +func (s *InferenceDeviceInfo) SetName(v string) *InferenceDeviceInfo { + s.Name = &v + return s +} + // Describes an instance. type Instance struct { _ struct{} `type:"structure"` @@ -69213,12 +78849,18 @@ type Instance struct { // The license configurations. Licenses []*LicenseConfiguration `locationName:"licenseSet" locationNameList:"item" type:"list"` + // The metadata options for the instance. + MetadataOptions *InstanceMetadataOptionsResponse `locationName:"metadataOptions" type:"structure"` + // The monitoring for the instance. Monitoring *Monitoring `locationName:"monitoring" type:"structure"` // [EC2-VPC] The network interfaces for the instance. NetworkInterfaces []*InstanceNetworkInterface `locationName:"networkInterfaceSet" locationNameList:"item" type:"list"` + // The Amazon Resource Name (ARN) of the Outpost. + OutpostArn *string `locationName:"outpostArn" type:"string"` + // The location where the instance launched, if applicable. Placement *Placement `locationName:"placement" type:"structure"` @@ -69441,6 +79083,12 @@ func (s *Instance) SetLicenses(v []*LicenseConfiguration) *Instance { return s } +// SetMetadataOptions sets the MetadataOptions field's value. +func (s *Instance) SetMetadataOptions(v *InstanceMetadataOptionsResponse) *Instance { + s.MetadataOptions = v + return s +} + // SetMonitoring sets the Monitoring field's value. func (s *Instance) SetMonitoring(v *Monitoring) *Instance { s.Monitoring = v @@ -69453,6 +79101,12 @@ func (s *Instance) SetNetworkInterfaces(v []*InstanceNetworkInterface) *Instance return s } +// SetOutpostArn sets the OutpostArn field's value. +func (s *Instance) SetOutpostArn(v string) *Instance { + s.OutpostArn = &v + return s +} + // SetPlacement sets the Placement field's value. func (s *Instance) SetPlacement(v *Placement) *Instance { s.Placement = v @@ -69665,17 +79319,20 @@ func (s *InstanceBlockDeviceMappingSpecification) SetVirtualName(v string) *Inst return s } -// Information about the instance type that the Dedicated Host supports. +// Information about the number of instances that can be launched onto the Dedicated +// Host. type InstanceCapacity struct { _ struct{} `type:"structure"` - // The number of instances that can still be launched onto the Dedicated Host. + // The number of instances that can be launched onto the Dedicated Host based + // on the host's available capacity. AvailableCapacity *int64 `locationName:"availableCapacity" type:"integer"` - // The instance type size supported by the Dedicated Host. + // The instance type supported by the Dedicated Host. InstanceType *string `locationName:"instanceType" type:"string"` - // The total number of instances that can be launched onto the Dedicated Host. + // The total number of instances that can be launched onto the Dedicated Host + // if there are no instances running on it. TotalCapacity *int64 `locationName:"totalCapacity" type:"integer"` } @@ -69740,7 +79397,7 @@ func (s *InstanceCount) SetState(v string) *InstanceCount { return s } -// Describes the credit option for CPU usage of a T2 or T3 instance. +// Describes the credit option for CPU usage of a burstable performance instance. type InstanceCreditSpecification struct { _ struct{} `type:"structure"` @@ -69774,7 +79431,7 @@ func (s *InstanceCreditSpecification) SetInstanceId(v string) *InstanceCreditSpe return s } -// Describes the credit option for CPU usage of a T2 or T3 instance. +// Describes the credit option for CPU usage of a burstable performance instance. type InstanceCreditSpecificationRequest struct { _ struct{} `type:"structure"` @@ -69841,6 +79498,41 @@ func (s *InstanceExportDetails) SetTargetEnvironment(v string) *InstanceExportDe return s } +// Describes the default credit option for CPU usage of a burstable performance +// instance family. +type InstanceFamilyCreditSpecification struct { + _ struct{} `type:"structure"` + + // The default credit option for CPU usage of the instance family. Valid values + // are standard and unlimited. + CpuCredits *string `locationName:"cpuCredits" type:"string"` + + // The instance family. + InstanceFamily *string `locationName:"instanceFamily" type:"string" enum:"UnlimitedSupportedInstanceFamily"` +} + +// String returns the string representation +func (s InstanceFamilyCreditSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceFamilyCreditSpecification) GoString() string { + return s.String() +} + +// SetCpuCredits sets the CpuCredits field's value. +func (s *InstanceFamilyCreditSpecification) SetCpuCredits(v string) *InstanceFamilyCreditSpecification { + s.CpuCredits = &v + return s +} + +// SetInstanceFamily sets the InstanceFamily field's value. +func (s *InstanceFamilyCreditSpecification) SetInstanceFamily(v string) *InstanceFamilyCreditSpecification { + s.InstanceFamily = &v + return s +} + // Describes an IPv6 address. type InstanceIpv6Address struct { _ struct{} `type:"structure"` @@ -69922,6 +79614,146 @@ func (s *InstanceMarketOptionsRequest) SetSpotOptions(v *SpotMarketOptions) *Ins return s } +// The metadata options for the instance. +type InstanceMetadataOptionsRequest struct { + _ struct{} `type:"structure"` + + // This parameter enables or disables the HTTP metadata endpoint on your instances. + // If the parameter is not specified, the default state is enabled. + // + // If you specify a value of disabled, you will not be able to access your instance + // metadata. + HttpEndpoint *string `type:"string" enum:"InstanceMetadataEndpointState"` + + // The desired HTTP PUT response hop limit for instance metadata requests. The + // larger the number, the further instance metadata requests can travel. + // + // Default: 1 + // + // Possible values: Integers from 1 to 64 + HttpPutResponseHopLimit *int64 `type:"integer"` + + // The state of token usage for your instance metadata requests. If the parameter + // is not specified in the request, the default state is optional. + // + // If the state is optional, you can choose to retrieve instance metadata with + // or without a signed token header on your request. If you retrieve the IAM + // role credentials without a token, the version 1.0 role credentials are returned. + // If you retrieve the IAM role credentials using a valid signed token, the + // version 2.0 role credentials are returned. + // + // If the state is required, you must send a signed token header with any instance + // metadata retrieval requests. In this state, retrieving the IAM role credentials + // always returns the version 2.0 credentials; the version 1.0 credentials are + // not available. + HttpTokens *string `type:"string" enum:"HttpTokensState"` +} + +// String returns the string representation +func (s InstanceMetadataOptionsRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceMetadataOptionsRequest) GoString() string { + return s.String() +} + +// SetHttpEndpoint sets the HttpEndpoint field's value. +func (s *InstanceMetadataOptionsRequest) SetHttpEndpoint(v string) *InstanceMetadataOptionsRequest { + s.HttpEndpoint = &v + return s +} + +// SetHttpPutResponseHopLimit sets the HttpPutResponseHopLimit field's value. +func (s *InstanceMetadataOptionsRequest) SetHttpPutResponseHopLimit(v int64) *InstanceMetadataOptionsRequest { + s.HttpPutResponseHopLimit = &v + return s +} + +// SetHttpTokens sets the HttpTokens field's value. +func (s *InstanceMetadataOptionsRequest) SetHttpTokens(v string) *InstanceMetadataOptionsRequest { + s.HttpTokens = &v + return s +} + +// The metadata options for the instance. +type InstanceMetadataOptionsResponse struct { + _ struct{} `type:"structure"` + + // This parameter enables or disables the HTTP metadata endpoint on your instances. + // If the parameter is not specified, the default state is enabled. + // + // If you specify a value of disabled, you will not be able to access your instance + // metadata. + HttpEndpoint *string `locationName:"httpEndpoint" type:"string" enum:"InstanceMetadataEndpointState"` + + // The desired HTTP PUT response hop limit for instance metadata requests. The + // larger the number, the further instance metadata requests can travel. + // + // Default: 1 + // + // Possible values: Integers from 1 to 64 + HttpPutResponseHopLimit *int64 `locationName:"httpPutResponseHopLimit" type:"integer"` + + // The state of token usage for your instance metadata requests. If the parameter + // is not specified in the request, the default state is optional. + // + // If the state is optional, you can choose to retrieve instance metadata with + // or without a signed token header on your request. If you retrieve the IAM + // role credentials without a token, the version 1.0 role credentials are returned. + // If you retrieve the IAM role credentials using a valid signed token, the + // version 2.0 role credentials are returned. + // + // If the state is required, you must send a signed token header with any instance + // metadata retrieval requests. In this state, retrieving the IAM role credential + // always returns the version 2.0 credentials; the version 1.0 credentials are + // not available. + HttpTokens *string `locationName:"httpTokens" type:"string" enum:"HttpTokensState"` + + // The state of the metadata option changes. + // + // pending - The metadata options are being updated and the instance is not + // ready to process metadata traffic with the new selection. + // + // applied - The metadata options have been successfully applied on the instance. + State *string `locationName:"state" type:"string" enum:"InstanceMetadataOptionsState"` +} + +// String returns the string representation +func (s InstanceMetadataOptionsResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceMetadataOptionsResponse) GoString() string { + return s.String() +} + +// SetHttpEndpoint sets the HttpEndpoint field's value. +func (s *InstanceMetadataOptionsResponse) SetHttpEndpoint(v string) *InstanceMetadataOptionsResponse { + s.HttpEndpoint = &v + return s +} + +// SetHttpPutResponseHopLimit sets the HttpPutResponseHopLimit field's value. +func (s *InstanceMetadataOptionsResponse) SetHttpPutResponseHopLimit(v int64) *InstanceMetadataOptionsResponse { + s.HttpPutResponseHopLimit = &v + return s +} + +// SetHttpTokens sets the HttpTokens field's value. +func (s *InstanceMetadataOptionsResponse) SetHttpTokens(v string) *InstanceMetadataOptionsResponse { + s.HttpTokens = &v + return s +} + +// SetState sets the State field's value. +func (s *InstanceMetadataOptionsResponse) SetState(v string) *InstanceMetadataOptionsResponse { + s.State = &v + return s +} + // Describes the monitoring of an instance. type InstanceMonitoring struct { _ struct{} `type:"structure"` @@ -70273,6 +80105,9 @@ type InstanceNetworkInterfaceSpecification struct { Ipv6Addresses []*InstanceIpv6Address `locationName:"ipv6AddressesSet" queryName:"Ipv6Addresses" locationNameList:"item" type:"list"` // The ID of the network interface. + // + // If you are creating a Spot Fleet, omit this parameter because you can’t + // specify a network interface ID in a launch specification. NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` // The private IPv4 address of the network interface. Applies only if creating @@ -70594,6 +80429,9 @@ type InstanceStatus struct { // such as impaired reachability. InstanceStatus *InstanceStatusSummary `locationName:"instanceStatus" type:"structure"` + // The Amazon Resource Name (ARN) of the Outpost. + OutpostArn *string `locationName:"outpostArn" type:"string"` + // Reports impaired functionality that stems from issues related to the systems // that support an instance, such as hardware failures and network connectivity // problems. @@ -70640,6 +80478,12 @@ func (s *InstanceStatus) SetInstanceStatus(v *InstanceStatusSummary) *InstanceSt return s } +// SetOutpostArn sets the OutpostArn field's value. +func (s *InstanceStatus) SetOutpostArn(v string) *InstanceStatus { + s.OutpostArn = &v + return s +} + // SetSystemStatus sets the SystemStatus field's value. func (s *InstanceStatus) SetSystemStatus(v *InstanceStatusSummary) *InstanceStatus { s.SystemStatus = v @@ -70795,6 +80639,298 @@ func (s *InstanceStatusSummary) SetStatus(v string) *InstanceStatusSummary { return s } +// Describes the disks that are available for the instance type. +type InstanceStorageInfo struct { + _ struct{} `type:"structure"` + + // Array describing the disks that are available for the instance type. + Disks []*DiskInfo `locationName:"disks" locationNameList:"item" type:"list"` + + // The total size of the disks, in GB. + TotalSizeInGB *int64 `locationName:"totalSizeInGB" type:"long"` +} + +// String returns the string representation +func (s InstanceStorageInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceStorageInfo) GoString() string { + return s.String() +} + +// SetDisks sets the Disks field's value. +func (s *InstanceStorageInfo) SetDisks(v []*DiskInfo) *InstanceStorageInfo { + s.Disks = v + return s +} + +// SetTotalSizeInGB sets the TotalSizeInGB field's value. +func (s *InstanceStorageInfo) SetTotalSizeInGB(v int64) *InstanceStorageInfo { + s.TotalSizeInGB = &v + return s +} + +// Describes the instance type. +type InstanceTypeInfo struct { + _ struct{} `type:"structure"` + + // Indicates whether auto recovery is supported. + AutoRecoverySupported *bool `locationName:"autoRecoverySupported" type:"boolean"` + + // Indicates whether the instance is bare metal. + BareMetal *bool `locationName:"bareMetal" type:"boolean"` + + // Indicates whether the instance type is a burstable performance instance type. + BurstablePerformanceSupported *bool `locationName:"burstablePerformanceSupported" type:"boolean"` + + // Indicates whether the instance type is a current generation. + CurrentGeneration *bool `locationName:"currentGeneration" type:"boolean"` + + // Indicates whether Dedicated Hosts are supported on the instance type. + DedicatedHostsSupported *bool `locationName:"dedicatedHostsSupported" type:"boolean"` + + // Describes the Amazon EBS settings for the instance type. + EbsInfo *EbsInfo `locationName:"ebsInfo" type:"structure"` + + // Describes the FPGA accelerator settings for the instance type. + FpgaInfo *FpgaInfo `locationName:"fpgaInfo" type:"structure"` + + // Indicates whether the instance type is eligible for the free tier. + FreeTierEligible *bool `locationName:"freeTierEligible" type:"boolean"` + + // Describes the GPU accelerator settings for the instance type. + GpuInfo *GpuInfo `locationName:"gpuInfo" type:"structure"` + + // Indicates whether On-Demand hibernation is supported. + HibernationSupported *bool `locationName:"hibernationSupported" type:"boolean"` + + // Indicates the hypervisor used for the instance type. + Hypervisor *string `locationName:"hypervisor" type:"string" enum:"InstanceTypeHypervisor"` + + // Describes the Inference accelerator settings for the instance type. + InferenceAcceleratorInfo *InferenceAcceleratorInfo `locationName:"inferenceAcceleratorInfo" type:"structure"` + + // Describes the disks for the instance type. + InstanceStorageInfo *InstanceStorageInfo `locationName:"instanceStorageInfo" type:"structure"` + + // Indicates whether instance storage is supported. + InstanceStorageSupported *bool `locationName:"instanceStorageSupported" type:"boolean"` + + // The instance type. For more information, see Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) + // in the Amazon Elastic Compute Cloud User Guide. + InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` + + // Describes the memory for the instance type. + MemoryInfo *MemoryInfo `locationName:"memoryInfo" type:"structure"` + + // Describes the network settings for the instance type. + NetworkInfo *NetworkInfo `locationName:"networkInfo" type:"structure"` + + // Describes the placement group settings for the instance type. + PlacementGroupInfo *PlacementGroupInfo `locationName:"placementGroupInfo" type:"structure"` + + // Describes the processor. + ProcessorInfo *ProcessorInfo `locationName:"processorInfo" type:"structure"` + + // Indicates the supported root device types. + SupportedRootDeviceTypes []*string `locationName:"supportedRootDeviceTypes" locationNameList:"item" type:"list"` + + // Indicates whether the instance type is offered for spot or On-Demand. + SupportedUsageClasses []*string `locationName:"supportedUsageClasses" locationNameList:"item" type:"list"` + + // Describes the vCPU configurations for the instance type. + VCpuInfo *VCpuInfo `locationName:"vCpuInfo" type:"structure"` +} + +// String returns the string representation +func (s InstanceTypeInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceTypeInfo) GoString() string { + return s.String() +} + +// SetAutoRecoverySupported sets the AutoRecoverySupported field's value. +func (s *InstanceTypeInfo) SetAutoRecoverySupported(v bool) *InstanceTypeInfo { + s.AutoRecoverySupported = &v + return s +} + +// SetBareMetal sets the BareMetal field's value. +func (s *InstanceTypeInfo) SetBareMetal(v bool) *InstanceTypeInfo { + s.BareMetal = &v + return s +} + +// SetBurstablePerformanceSupported sets the BurstablePerformanceSupported field's value. +func (s *InstanceTypeInfo) SetBurstablePerformanceSupported(v bool) *InstanceTypeInfo { + s.BurstablePerformanceSupported = &v + return s +} + +// SetCurrentGeneration sets the CurrentGeneration field's value. +func (s *InstanceTypeInfo) SetCurrentGeneration(v bool) *InstanceTypeInfo { + s.CurrentGeneration = &v + return s +} + +// SetDedicatedHostsSupported sets the DedicatedHostsSupported field's value. +func (s *InstanceTypeInfo) SetDedicatedHostsSupported(v bool) *InstanceTypeInfo { + s.DedicatedHostsSupported = &v + return s +} + +// SetEbsInfo sets the EbsInfo field's value. +func (s *InstanceTypeInfo) SetEbsInfo(v *EbsInfo) *InstanceTypeInfo { + s.EbsInfo = v + return s +} + +// SetFpgaInfo sets the FpgaInfo field's value. +func (s *InstanceTypeInfo) SetFpgaInfo(v *FpgaInfo) *InstanceTypeInfo { + s.FpgaInfo = v + return s +} + +// SetFreeTierEligible sets the FreeTierEligible field's value. +func (s *InstanceTypeInfo) SetFreeTierEligible(v bool) *InstanceTypeInfo { + s.FreeTierEligible = &v + return s +} + +// SetGpuInfo sets the GpuInfo field's value. +func (s *InstanceTypeInfo) SetGpuInfo(v *GpuInfo) *InstanceTypeInfo { + s.GpuInfo = v + return s +} + +// SetHibernationSupported sets the HibernationSupported field's value. +func (s *InstanceTypeInfo) SetHibernationSupported(v bool) *InstanceTypeInfo { + s.HibernationSupported = &v + return s +} + +// SetHypervisor sets the Hypervisor field's value. +func (s *InstanceTypeInfo) SetHypervisor(v string) *InstanceTypeInfo { + s.Hypervisor = &v + return s +} + +// SetInferenceAcceleratorInfo sets the InferenceAcceleratorInfo field's value. +func (s *InstanceTypeInfo) SetInferenceAcceleratorInfo(v *InferenceAcceleratorInfo) *InstanceTypeInfo { + s.InferenceAcceleratorInfo = v + return s +} + +// SetInstanceStorageInfo sets the InstanceStorageInfo field's value. +func (s *InstanceTypeInfo) SetInstanceStorageInfo(v *InstanceStorageInfo) *InstanceTypeInfo { + s.InstanceStorageInfo = v + return s +} + +// SetInstanceStorageSupported sets the InstanceStorageSupported field's value. +func (s *InstanceTypeInfo) SetInstanceStorageSupported(v bool) *InstanceTypeInfo { + s.InstanceStorageSupported = &v + return s +} + +// SetInstanceType sets the InstanceType field's value. +func (s *InstanceTypeInfo) SetInstanceType(v string) *InstanceTypeInfo { + s.InstanceType = &v + return s +} + +// SetMemoryInfo sets the MemoryInfo field's value. +func (s *InstanceTypeInfo) SetMemoryInfo(v *MemoryInfo) *InstanceTypeInfo { + s.MemoryInfo = v + return s +} + +// SetNetworkInfo sets the NetworkInfo field's value. +func (s *InstanceTypeInfo) SetNetworkInfo(v *NetworkInfo) *InstanceTypeInfo { + s.NetworkInfo = v + return s +} + +// SetPlacementGroupInfo sets the PlacementGroupInfo field's value. +func (s *InstanceTypeInfo) SetPlacementGroupInfo(v *PlacementGroupInfo) *InstanceTypeInfo { + s.PlacementGroupInfo = v + return s +} + +// SetProcessorInfo sets the ProcessorInfo field's value. +func (s *InstanceTypeInfo) SetProcessorInfo(v *ProcessorInfo) *InstanceTypeInfo { + s.ProcessorInfo = v + return s +} + +// SetSupportedRootDeviceTypes sets the SupportedRootDeviceTypes field's value. +func (s *InstanceTypeInfo) SetSupportedRootDeviceTypes(v []*string) *InstanceTypeInfo { + s.SupportedRootDeviceTypes = v + return s +} + +// SetSupportedUsageClasses sets the SupportedUsageClasses field's value. +func (s *InstanceTypeInfo) SetSupportedUsageClasses(v []*string) *InstanceTypeInfo { + s.SupportedUsageClasses = v + return s +} + +// SetVCpuInfo sets the VCpuInfo field's value. +func (s *InstanceTypeInfo) SetVCpuInfo(v *VCpuInfo) *InstanceTypeInfo { + s.VCpuInfo = v + return s +} + +// The instance types offered. +type InstanceTypeOffering struct { + _ struct{} `type:"structure"` + + // The instance type. For more information, see Instance Types (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html) + // in the Amazon Elastic Compute Cloud User Guide. + InstanceType *string `locationName:"instanceType" type:"string" enum:"InstanceType"` + + // The identifier for the location. This depends on the location type. For example, + // if the location type is region, the location is the Region code (for example, + // us-east-2.) + Location *string `locationName:"location" type:"string"` + + // The location type. + LocationType *string `locationName:"locationType" type:"string" enum:"LocationType"` +} + +// String returns the string representation +func (s InstanceTypeOffering) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceTypeOffering) GoString() string { + return s.String() +} + +// SetInstanceType sets the InstanceType field's value. +func (s *InstanceTypeOffering) SetInstanceType(v string) *InstanceTypeOffering { + s.InstanceType = &v + return s +} + +// SetLocation sets the Location field's value. +func (s *InstanceTypeOffering) SetLocation(v string) *InstanceTypeOffering { + s.Location = &v + return s +} + +// SetLocationType sets the LocationType field's value. +func (s *InstanceTypeOffering) SetLocationType(v string) *InstanceTypeOffering { + s.LocationType = &v + return s +} + // Information about the Capacity Reservation usage. type InstanceUsage struct { _ struct{} `type:"structure"` @@ -71018,7 +81154,7 @@ type IpRange struct { // range. // // Constraints: Up to 255 characters in length. Allowed characters are a-z, - // A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$* + // A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$* Description *string `locationName:"description" type:"string"` } @@ -71044,6 +81180,39 @@ func (s *IpRange) SetDescription(v string) *IpRange { return s } +// Describes an IPv6 CIDR block association. +type Ipv6CidrAssociation struct { + _ struct{} `type:"structure"` + + // The resource that's associated with the IPv6 CIDR block. + AssociatedResource *string `locationName:"associatedResource" type:"string"` + + // The IPv6 CIDR block. + Ipv6Cidr *string `locationName:"ipv6Cidr" type:"string"` +} + +// String returns the string representation +func (s Ipv6CidrAssociation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Ipv6CidrAssociation) GoString() string { + return s.String() +} + +// SetAssociatedResource sets the AssociatedResource field's value. +func (s *Ipv6CidrAssociation) SetAssociatedResource(v string) *Ipv6CidrAssociation { + s.AssociatedResource = &v + return s +} + +// SetIpv6Cidr sets the Ipv6Cidr field's value. +func (s *Ipv6CidrAssociation) SetIpv6Cidr(v string) *Ipv6CidrAssociation { + s.Ipv6Cidr = &v + return s +} + // Describes an IPv6 CIDR block. type Ipv6CidrBlock struct { _ struct{} `type:"structure"` @@ -71068,6 +81237,57 @@ func (s *Ipv6CidrBlock) SetIpv6CidrBlock(v string) *Ipv6CidrBlock { return s } +// Describes an IPv6 address pool. +type Ipv6Pool struct { + _ struct{} `type:"structure"` + + // The description for the address pool. + Description *string `locationName:"description" type:"string"` + + // The CIDR blocks for the address pool. + PoolCidrBlocks []*PoolCidrBlock `locationName:"poolCidrBlockSet" locationNameList:"item" type:"list"` + + // The ID of the address pool. + PoolId *string `locationName:"poolId" type:"string"` + + // Any tags for the address pool. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s Ipv6Pool) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Ipv6Pool) GoString() string { + return s.String() +} + +// SetDescription sets the Description field's value. +func (s *Ipv6Pool) SetDescription(v string) *Ipv6Pool { + s.Description = &v + return s +} + +// SetPoolCidrBlocks sets the PoolCidrBlocks field's value. +func (s *Ipv6Pool) SetPoolCidrBlocks(v []*PoolCidrBlock) *Ipv6Pool { + s.PoolCidrBlocks = v + return s +} + +// SetPoolId sets the PoolId field's value. +func (s *Ipv6Pool) SetPoolId(v string) *Ipv6Pool { + s.PoolId = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *Ipv6Pool) SetTags(v []*Tag) *Ipv6Pool { + s.Tags = v + return s +} + // [EC2-VPC only] Describes an IPv6 range. type Ipv6Range struct { _ struct{} `type:"structure"` @@ -71080,7 +81300,7 @@ type Ipv6Range struct { // range. // // Constraints: Up to 255 characters in length. Allowed characters are a-z, - // A-Z, 0-9, spaces, and ._-:/()#,@[]+=;{}!$* + // A-Z, 0-9, spaces, and ._-:/()#,@[]+=&;{}!$* Description *string `locationName:"description" type:"string"` } @@ -71118,6 +81338,12 @@ type KeyPairInfo struct { // The name of the key pair. KeyName *string `locationName:"keyName" type:"string"` + + // The ID of the key pair. + KeyPairId *string `locationName:"keyPairId" type:"string"` + + // Any tags applied to the key pair. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation @@ -71142,6 +81368,51 @@ func (s *KeyPairInfo) SetKeyName(v string) *KeyPairInfo { return s } +// SetKeyPairId sets the KeyPairId field's value. +func (s *KeyPairInfo) SetKeyPairId(v string) *KeyPairInfo { + s.KeyPairId = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *KeyPairInfo) SetTags(v []*Tag) *KeyPairInfo { + s.Tags = v + return s +} + +// The last error that occurred for a VPC endpoint. +type LastError struct { + _ struct{} `type:"structure"` + + // The error code for the VPC endpoint error. + Code *string `locationName:"code" type:"string"` + + // The error message for the VPC endpoint error. + Message *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LastError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LastError) GoString() string { + return s.String() +} + +// SetCode sets the Code field's value. +func (s *LastError) SetCode(v string) *LastError { + s.Code = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *LastError) SetMessage(v string) *LastError { + s.Message = &v + return s +} + // Describes a launch permission. type LaunchPermission struct { _ struct{} `type:"structure"` @@ -71893,7 +82164,8 @@ type LaunchTemplateEbsBlockDeviceRequest struct { // it is not used in requests to create gp2, st1, sc1, or standard volumes. Iops *int64 `type:"integer"` - // The ARN of the AWS Key Management Service (AWS KMS) CMK used for encryption. + // The ARN of the symmetric AWS Key Management Service (AWS KMS) CMK used for + // encryption. KmsKeyId *string `type:"string"` // The ID of the snapshot. @@ -71965,6 +82237,11 @@ func (s *LaunchTemplateEbsBlockDeviceRequest) SetVolumeType(v string) *LaunchTem type LaunchTemplateElasticInferenceAccelerator struct { _ struct{} `type:"structure"` + // The number of elastic inference accelerators to attach to the instance. + // + // Default: 1 + Count *int64 `min:"1" type:"integer"` + // The type of elastic inference accelerator. The possible values are eia1.medium, // eia1.large, and eia1.xlarge. // @@ -71985,6 +82262,9 @@ func (s LaunchTemplateElasticInferenceAccelerator) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *LaunchTemplateElasticInferenceAccelerator) Validate() error { invalidParams := request.ErrInvalidParams{Context: "LaunchTemplateElasticInferenceAccelerator"} + if s.Count != nil && *s.Count < 1 { + invalidParams.Add(request.NewErrParamMinValue("Count", 1)) + } if s.Type == nil { invalidParams.Add(request.NewErrParamRequired("Type")) } @@ -71995,6 +82275,12 @@ func (s *LaunchTemplateElasticInferenceAccelerator) Validate() error { return nil } +// SetCount sets the Count field's value. +func (s *LaunchTemplateElasticInferenceAccelerator) SetCount(v int64) *LaunchTemplateElasticInferenceAccelerator { + s.Count = &v + return s +} + // SetType sets the Type field's value. func (s *LaunchTemplateElasticInferenceAccelerator) SetType(v string) *LaunchTemplateElasticInferenceAccelerator { s.Type = &v @@ -72005,6 +82291,11 @@ func (s *LaunchTemplateElasticInferenceAccelerator) SetType(v string) *LaunchTem type LaunchTemplateElasticInferenceAcceleratorResponse struct { _ struct{} `type:"structure"` + // The number of elastic inference accelerators to attach to the instance. + // + // Default: 1 + Count *int64 `locationName:"count" type:"integer"` + // The type of elastic inference accelerator. The possible values are eia1.medium, // eia1.large, and eia1.xlarge. Type *string `locationName:"type" type:"string"` @@ -72020,6 +82311,12 @@ func (s LaunchTemplateElasticInferenceAcceleratorResponse) GoString() string { return s.String() } +// SetCount sets the Count field's value. +func (s *LaunchTemplateElasticInferenceAcceleratorResponse) SetCount(v int64) *LaunchTemplateElasticInferenceAcceleratorResponse { + s.Count = &v + return s +} + // SetType sets the Type field's value. func (s *LaunchTemplateElasticInferenceAcceleratorResponse) SetType(v string) *LaunchTemplateElasticInferenceAcceleratorResponse { s.Type = &v @@ -72053,7 +82350,6 @@ func (s *LaunchTemplateHibernationOptions) SetConfigured(v bool) *LaunchTemplate // Indicates whether the instance is configured for hibernation. This parameter // is valid only if the instance meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites). -// Hibernation is currently supported only for Amazon Linux. type LaunchTemplateHibernationOptionsRequest struct { _ struct{} `type:"structure"` @@ -72211,6 +82507,150 @@ func (s *LaunchTemplateInstanceMarketOptionsRequest) SetSpotOptions(v *LaunchTem return s } +// The metadata options for the instance. For more information, see Instance +// Metadata and User Data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) +// in the Amazon Elastic Compute Cloud User Guide. +type LaunchTemplateInstanceMetadataOptions struct { + _ struct{} `type:"structure"` + + // This parameter enables or disables the HTTP metadata endpoint on your instances. + // If the parameter is not specified, the default state is enabled. + // + // If you specify a value of disabled, you will not be able to access your instance + // metadata. + HttpEndpoint *string `locationName:"httpEndpoint" type:"string" enum:"LaunchTemplateInstanceMetadataEndpointState"` + + // The desired HTTP PUT response hop limit for instance metadata requests. The + // larger the number, the further instance metadata requests can travel. + // + // Default: 1 + // + // Possible values: Integers from 1 to 64 + HttpPutResponseHopLimit *int64 `locationName:"httpPutResponseHopLimit" type:"integer"` + + // The state of token usage for your instance metadata requests. If the parameter + // is not specified in the request, the default state is optional. + // + // If the state is optional, you can choose to retrieve instance metadata with + // or without a signed token header on your request. If you retrieve the IAM + // role credentials without a token, the version 1.0 role credentials are returned. + // If you retrieve the IAM role credentials using a valid signed token, the + // version 2.0 role credentials are returned. + // + // If the state is required, you must send a signed token header with any instance + // metadata retrieval requests. In this state, retrieving the IAM role credentials + // always returns the version 2.0 credentials; the version 1.0 credentials are + // not available. + HttpTokens *string `locationName:"httpTokens" type:"string" enum:"LaunchTemplateHttpTokensState"` + + // The state of the metadata option changes. + // + // pending - The metadata options are being updated and the instance is not + // ready to process metadata traffic with the new selection. + // + // applied - The metadata options have been successfully applied on the instance. + State *string `locationName:"state" type:"string" enum:"LaunchTemplateInstanceMetadataOptionsState"` +} + +// String returns the string representation +func (s LaunchTemplateInstanceMetadataOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LaunchTemplateInstanceMetadataOptions) GoString() string { + return s.String() +} + +// SetHttpEndpoint sets the HttpEndpoint field's value. +func (s *LaunchTemplateInstanceMetadataOptions) SetHttpEndpoint(v string) *LaunchTemplateInstanceMetadataOptions { + s.HttpEndpoint = &v + return s +} + +// SetHttpPutResponseHopLimit sets the HttpPutResponseHopLimit field's value. +func (s *LaunchTemplateInstanceMetadataOptions) SetHttpPutResponseHopLimit(v int64) *LaunchTemplateInstanceMetadataOptions { + s.HttpPutResponseHopLimit = &v + return s +} + +// SetHttpTokens sets the HttpTokens field's value. +func (s *LaunchTemplateInstanceMetadataOptions) SetHttpTokens(v string) *LaunchTemplateInstanceMetadataOptions { + s.HttpTokens = &v + return s +} + +// SetState sets the State field's value. +func (s *LaunchTemplateInstanceMetadataOptions) SetState(v string) *LaunchTemplateInstanceMetadataOptions { + s.State = &v + return s +} + +// The metadata options for the instance. For more information, see Instance +// Metadata and User Data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) +// in the Amazon Elastic Compute Cloud User Guide. +type LaunchTemplateInstanceMetadataOptionsRequest struct { + _ struct{} `type:"structure"` + + // This parameter enables or disables the HTTP metadata endpoint on your instances. + // If the parameter is not specified, the default state is enabled. + // + // If you specify a value of disabled, you will not be able to access your instance + // metadata. + HttpEndpoint *string `type:"string" enum:"LaunchTemplateInstanceMetadataEndpointState"` + + // The desired HTTP PUT response hop limit for instance metadata requests. The + // larger the number, the further instance metadata requests can travel. + // + // Default: 1 + // + // Possible values: Integers from 1 to 64 + HttpPutResponseHopLimit *int64 `type:"integer"` + + // The state of token usage for your instance metadata requests. If the parameter + // is not specified in the request, the default state is optional. + // + // If the state is optional, you can choose to retrieve instance metadata with + // or without a signed token header on your request. If you retrieve the IAM + // role credentials without a token, the version 1.0 role credentials are returned. + // If you retrieve the IAM role credentials using a valid signed token, the + // version 2.0 role credentials are returned. + // + // If the state is required, you must send a signed token header with any instance + // metadata retrieval requests. In this state, retrieving the IAM role credentials + // always returns the version 2.0 credentials; the version 1.0 credentials are + // not available. + HttpTokens *string `type:"string" enum:"LaunchTemplateHttpTokensState"` +} + +// String returns the string representation +func (s LaunchTemplateInstanceMetadataOptionsRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LaunchTemplateInstanceMetadataOptionsRequest) GoString() string { + return s.String() +} + +// SetHttpEndpoint sets the HttpEndpoint field's value. +func (s *LaunchTemplateInstanceMetadataOptionsRequest) SetHttpEndpoint(v string) *LaunchTemplateInstanceMetadataOptionsRequest { + s.HttpEndpoint = &v + return s +} + +// SetHttpPutResponseHopLimit sets the HttpPutResponseHopLimit field's value. +func (s *LaunchTemplateInstanceMetadataOptionsRequest) SetHttpPutResponseHopLimit(v int64) *LaunchTemplateInstanceMetadataOptionsRequest { + s.HttpPutResponseHopLimit = &v + return s +} + +// SetHttpTokens sets the HttpTokens field's value. +func (s *LaunchTemplateInstanceMetadataOptionsRequest) SetHttpTokens(v string) *LaunchTemplateInstanceMetadataOptionsRequest { + s.HttpTokens = &v + return s +} + // Describes a network interface. type LaunchTemplateInstanceNetworkInterfaceSpecification struct { _ struct{} `type:"structure"` @@ -72623,6 +83063,13 @@ type LaunchTemplatePlacement struct { // The ID of the Dedicated Host for the instance. HostId *string `locationName:"hostId" type:"string"` + // The ARN of the host resource group in which to launch the instances. + HostResourceGroupArn *string `locationName:"hostResourceGroupArn" type:"string"` + + // The number of the partition the instance should launch in. Valid only if + // the placement group strategy is set to partition. + PartitionNumber *int64 `locationName:"partitionNumber" type:"integer"` + // Reserved for future use. SpreadDomain *string `locationName:"spreadDomain" type:"string"` @@ -72665,6 +83112,18 @@ func (s *LaunchTemplatePlacement) SetHostId(v string) *LaunchTemplatePlacement { return s } +// SetHostResourceGroupArn sets the HostResourceGroupArn field's value. +func (s *LaunchTemplatePlacement) SetHostResourceGroupArn(v string) *LaunchTemplatePlacement { + s.HostResourceGroupArn = &v + return s +} + +// SetPartitionNumber sets the PartitionNumber field's value. +func (s *LaunchTemplatePlacement) SetPartitionNumber(v int64) *LaunchTemplatePlacement { + s.PartitionNumber = &v + return s +} + // SetSpreadDomain sets the SpreadDomain field's value. func (s *LaunchTemplatePlacement) SetSpreadDomain(v string) *LaunchTemplatePlacement { s.SpreadDomain = &v @@ -72693,6 +83152,15 @@ type LaunchTemplatePlacementRequest struct { // The ID of the Dedicated Host for the instance. HostId *string `type:"string"` + // The ARN of the host resource group in which to launch the instances. If you + // specify a host resource group ARN, omit the Tenancy parameter or set it to + // host. + HostResourceGroupArn *string `type:"string"` + + // The number of the partition the instance should launch in. Valid only if + // the placement group strategy is set to partition. + PartitionNumber *int64 `type:"integer"` + // Reserved for future use. SpreadDomain *string `type:"string"` @@ -72735,6 +83203,18 @@ func (s *LaunchTemplatePlacementRequest) SetHostId(v string) *LaunchTemplatePlac return s } +// SetHostResourceGroupArn sets the HostResourceGroupArn field's value. +func (s *LaunchTemplatePlacementRequest) SetHostResourceGroupArn(v string) *LaunchTemplatePlacementRequest { + s.HostResourceGroupArn = &v + return s +} + +// SetPartitionNumber sets the PartitionNumber field's value. +func (s *LaunchTemplatePlacementRequest) SetPartitionNumber(v int64) *LaunchTemplatePlacementRequest { + s.PartitionNumber = &v + return s +} + // SetSpreadDomain sets the SpreadDomain field's value. func (s *LaunchTemplatePlacementRequest) SetSpreadDomain(v string) *LaunchTemplatePlacementRequest { s.SpreadDomain = &v @@ -73329,6 +83809,488 @@ func (s *LoadPermissionRequest) SetUserId(v string) *LoadPermissionRequest { return s } +// Describes a local gateway. +type LocalGateway struct { + _ struct{} `type:"structure"` + + // The ID of the local gateway. + LocalGatewayId *string `locationName:"localGatewayId" type:"string"` + + // The Amazon Resource Name (ARN) of the Outpost. + OutpostArn *string `locationName:"outpostArn" type:"string"` + + // The ID of the AWS account ID that owns the local gateway. + OwnerId *string `locationName:"ownerId" type:"string"` + + // The state of the local gateway. + State *string `locationName:"state" type:"string"` + + // The tags assigned to the local gateway. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s LocalGateway) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LocalGateway) GoString() string { + return s.String() +} + +// SetLocalGatewayId sets the LocalGatewayId field's value. +func (s *LocalGateway) SetLocalGatewayId(v string) *LocalGateway { + s.LocalGatewayId = &v + return s +} + +// SetOutpostArn sets the OutpostArn field's value. +func (s *LocalGateway) SetOutpostArn(v string) *LocalGateway { + s.OutpostArn = &v + return s +} + +// SetOwnerId sets the OwnerId field's value. +func (s *LocalGateway) SetOwnerId(v string) *LocalGateway { + s.OwnerId = &v + return s +} + +// SetState sets the State field's value. +func (s *LocalGateway) SetState(v string) *LocalGateway { + s.State = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *LocalGateway) SetTags(v []*Tag) *LocalGateway { + s.Tags = v + return s +} + +// Describes a route for a local gateway route table. +type LocalGatewayRoute struct { + _ struct{} `type:"structure"` + + // The CIDR block used for destination matches. + DestinationCidrBlock *string `locationName:"destinationCidrBlock" type:"string"` + + // The ID of the local gateway route table. + LocalGatewayRouteTableId *string `locationName:"localGatewayRouteTableId" type:"string"` + + // The ID of the virtual interface group. + LocalGatewayVirtualInterfaceGroupId *string `locationName:"localGatewayVirtualInterfaceGroupId" type:"string"` + + // The state of the route. + State *string `locationName:"state" type:"string" enum:"LocalGatewayRouteState"` + + // The route type. + Type *string `locationName:"type" type:"string" enum:"LocalGatewayRouteType"` +} + +// String returns the string representation +func (s LocalGatewayRoute) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LocalGatewayRoute) GoString() string { + return s.String() +} + +// SetDestinationCidrBlock sets the DestinationCidrBlock field's value. +func (s *LocalGatewayRoute) SetDestinationCidrBlock(v string) *LocalGatewayRoute { + s.DestinationCidrBlock = &v + return s +} + +// SetLocalGatewayRouteTableId sets the LocalGatewayRouteTableId field's value. +func (s *LocalGatewayRoute) SetLocalGatewayRouteTableId(v string) *LocalGatewayRoute { + s.LocalGatewayRouteTableId = &v + return s +} + +// SetLocalGatewayVirtualInterfaceGroupId sets the LocalGatewayVirtualInterfaceGroupId field's value. +func (s *LocalGatewayRoute) SetLocalGatewayVirtualInterfaceGroupId(v string) *LocalGatewayRoute { + s.LocalGatewayVirtualInterfaceGroupId = &v + return s +} + +// SetState sets the State field's value. +func (s *LocalGatewayRoute) SetState(v string) *LocalGatewayRoute { + s.State = &v + return s +} + +// SetType sets the Type field's value. +func (s *LocalGatewayRoute) SetType(v string) *LocalGatewayRoute { + s.Type = &v + return s +} + +// Describes a local gateway route table. +type LocalGatewayRouteTable struct { + _ struct{} `type:"structure"` + + // The ID of the local gateway. + LocalGatewayId *string `locationName:"localGatewayId" type:"string"` + + // The ID of the local gateway route table. + LocalGatewayRouteTableId *string `locationName:"localGatewayRouteTableId" type:"string"` + + // The Amazon Resource Name (ARN) of the Outpost. + OutpostArn *string `locationName:"outpostArn" type:"string"` + + // The state of the local gateway route table. + State *string `locationName:"state" type:"string"` + + // The tags assigned to the local gateway route table. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s LocalGatewayRouteTable) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LocalGatewayRouteTable) GoString() string { + return s.String() +} + +// SetLocalGatewayId sets the LocalGatewayId field's value. +func (s *LocalGatewayRouteTable) SetLocalGatewayId(v string) *LocalGatewayRouteTable { + s.LocalGatewayId = &v + return s +} + +// SetLocalGatewayRouteTableId sets the LocalGatewayRouteTableId field's value. +func (s *LocalGatewayRouteTable) SetLocalGatewayRouteTableId(v string) *LocalGatewayRouteTable { + s.LocalGatewayRouteTableId = &v + return s +} + +// SetOutpostArn sets the OutpostArn field's value. +func (s *LocalGatewayRouteTable) SetOutpostArn(v string) *LocalGatewayRouteTable { + s.OutpostArn = &v + return s +} + +// SetState sets the State field's value. +func (s *LocalGatewayRouteTable) SetState(v string) *LocalGatewayRouteTable { + s.State = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *LocalGatewayRouteTable) SetTags(v []*Tag) *LocalGatewayRouteTable { + s.Tags = v + return s +} + +// Describes an association between a local gateway route table and a virtual +// interface group. +type LocalGatewayRouteTableVirtualInterfaceGroupAssociation struct { + _ struct{} `type:"structure"` + + // The ID of the local gateway. + LocalGatewayId *string `locationName:"localGatewayId" type:"string"` + + // The ID of the local gateway route table. + LocalGatewayRouteTableId *string `locationName:"localGatewayRouteTableId" type:"string"` + + // The ID of the association. + LocalGatewayRouteTableVirtualInterfaceGroupAssociationId *string `locationName:"localGatewayRouteTableVirtualInterfaceGroupAssociationId" type:"string"` + + // The ID of the virtual interface group. + LocalGatewayVirtualInterfaceGroupId *string `locationName:"localGatewayVirtualInterfaceGroupId" type:"string"` + + // The state of the association. + State *string `locationName:"state" type:"string"` + + // The tags assigned to the association. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s LocalGatewayRouteTableVirtualInterfaceGroupAssociation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LocalGatewayRouteTableVirtualInterfaceGroupAssociation) GoString() string { + return s.String() +} + +// SetLocalGatewayId sets the LocalGatewayId field's value. +func (s *LocalGatewayRouteTableVirtualInterfaceGroupAssociation) SetLocalGatewayId(v string) *LocalGatewayRouteTableVirtualInterfaceGroupAssociation { + s.LocalGatewayId = &v + return s +} + +// SetLocalGatewayRouteTableId sets the LocalGatewayRouteTableId field's value. +func (s *LocalGatewayRouteTableVirtualInterfaceGroupAssociation) SetLocalGatewayRouteTableId(v string) *LocalGatewayRouteTableVirtualInterfaceGroupAssociation { + s.LocalGatewayRouteTableId = &v + return s +} + +// SetLocalGatewayRouteTableVirtualInterfaceGroupAssociationId sets the LocalGatewayRouteTableVirtualInterfaceGroupAssociationId field's value. +func (s *LocalGatewayRouteTableVirtualInterfaceGroupAssociation) SetLocalGatewayRouteTableVirtualInterfaceGroupAssociationId(v string) *LocalGatewayRouteTableVirtualInterfaceGroupAssociation { + s.LocalGatewayRouteTableVirtualInterfaceGroupAssociationId = &v + return s +} + +// SetLocalGatewayVirtualInterfaceGroupId sets the LocalGatewayVirtualInterfaceGroupId field's value. +func (s *LocalGatewayRouteTableVirtualInterfaceGroupAssociation) SetLocalGatewayVirtualInterfaceGroupId(v string) *LocalGatewayRouteTableVirtualInterfaceGroupAssociation { + s.LocalGatewayVirtualInterfaceGroupId = &v + return s +} + +// SetState sets the State field's value. +func (s *LocalGatewayRouteTableVirtualInterfaceGroupAssociation) SetState(v string) *LocalGatewayRouteTableVirtualInterfaceGroupAssociation { + s.State = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *LocalGatewayRouteTableVirtualInterfaceGroupAssociation) SetTags(v []*Tag) *LocalGatewayRouteTableVirtualInterfaceGroupAssociation { + s.Tags = v + return s +} + +// Describes an association between a local gateway route table and a VPC. +type LocalGatewayRouteTableVpcAssociation struct { + _ struct{} `type:"structure"` + + // The ID of the local gateway. + LocalGatewayId *string `locationName:"localGatewayId" type:"string"` + + // The ID of the local gateway route table. + LocalGatewayRouteTableId *string `locationName:"localGatewayRouteTableId" type:"string"` + + // The ID of the association. + LocalGatewayRouteTableVpcAssociationId *string `locationName:"localGatewayRouteTableVpcAssociationId" type:"string"` + + // The state of the association. + State *string `locationName:"state" type:"string"` + + // The tags assigned to the association. + 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 LocalGatewayRouteTableVpcAssociation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LocalGatewayRouteTableVpcAssociation) GoString() string { + return s.String() +} + +// SetLocalGatewayId sets the LocalGatewayId field's value. +func (s *LocalGatewayRouteTableVpcAssociation) SetLocalGatewayId(v string) *LocalGatewayRouteTableVpcAssociation { + s.LocalGatewayId = &v + return s +} + +// SetLocalGatewayRouteTableId sets the LocalGatewayRouteTableId field's value. +func (s *LocalGatewayRouteTableVpcAssociation) SetLocalGatewayRouteTableId(v string) *LocalGatewayRouteTableVpcAssociation { + s.LocalGatewayRouteTableId = &v + return s +} + +// SetLocalGatewayRouteTableVpcAssociationId sets the LocalGatewayRouteTableVpcAssociationId field's value. +func (s *LocalGatewayRouteTableVpcAssociation) SetLocalGatewayRouteTableVpcAssociationId(v string) *LocalGatewayRouteTableVpcAssociation { + s.LocalGatewayRouteTableVpcAssociationId = &v + return s +} + +// SetState sets the State field's value. +func (s *LocalGatewayRouteTableVpcAssociation) SetState(v string) *LocalGatewayRouteTableVpcAssociation { + s.State = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *LocalGatewayRouteTableVpcAssociation) SetTags(v []*Tag) *LocalGatewayRouteTableVpcAssociation { + s.Tags = v + return s +} + +// SetVpcId sets the VpcId field's value. +func (s *LocalGatewayRouteTableVpcAssociation) SetVpcId(v string) *LocalGatewayRouteTableVpcAssociation { + s.VpcId = &v + return s +} + +// Describes a local gateway virtual interface. +type LocalGatewayVirtualInterface struct { + _ struct{} `type:"structure"` + + // The local address. + LocalAddress *string `locationName:"localAddress" type:"string"` + + // The Border Gateway Protocol (BGP) Autonomous System Number (ASN) of the local + // gateway. + LocalBgpAsn *int64 `locationName:"localBgpAsn" type:"integer"` + + // The ID of the local gateway. + LocalGatewayId *string `locationName:"localGatewayId" type:"string"` + + // The ID of the virtual interface. + LocalGatewayVirtualInterfaceId *string `locationName:"localGatewayVirtualInterfaceId" type:"string"` + + // The peer address. + PeerAddress *string `locationName:"peerAddress" type:"string"` + + // The peer BGP ASN. + PeerBgpAsn *int64 `locationName:"peerBgpAsn" type:"integer"` + + // The tags assigned to the virtual interface. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The ID of the VLAN. + Vlan *int64 `locationName:"vlan" type:"integer"` +} + +// String returns the string representation +func (s LocalGatewayVirtualInterface) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LocalGatewayVirtualInterface) GoString() string { + return s.String() +} + +// SetLocalAddress sets the LocalAddress field's value. +func (s *LocalGatewayVirtualInterface) SetLocalAddress(v string) *LocalGatewayVirtualInterface { + s.LocalAddress = &v + return s +} + +// SetLocalBgpAsn sets the LocalBgpAsn field's value. +func (s *LocalGatewayVirtualInterface) SetLocalBgpAsn(v int64) *LocalGatewayVirtualInterface { + s.LocalBgpAsn = &v + return s +} + +// SetLocalGatewayId sets the LocalGatewayId field's value. +func (s *LocalGatewayVirtualInterface) SetLocalGatewayId(v string) *LocalGatewayVirtualInterface { + s.LocalGatewayId = &v + return s +} + +// SetLocalGatewayVirtualInterfaceId sets the LocalGatewayVirtualInterfaceId field's value. +func (s *LocalGatewayVirtualInterface) SetLocalGatewayVirtualInterfaceId(v string) *LocalGatewayVirtualInterface { + s.LocalGatewayVirtualInterfaceId = &v + return s +} + +// SetPeerAddress sets the PeerAddress field's value. +func (s *LocalGatewayVirtualInterface) SetPeerAddress(v string) *LocalGatewayVirtualInterface { + s.PeerAddress = &v + return s +} + +// SetPeerBgpAsn sets the PeerBgpAsn field's value. +func (s *LocalGatewayVirtualInterface) SetPeerBgpAsn(v int64) *LocalGatewayVirtualInterface { + s.PeerBgpAsn = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *LocalGatewayVirtualInterface) SetTags(v []*Tag) *LocalGatewayVirtualInterface { + s.Tags = v + return s +} + +// SetVlan sets the Vlan field's value. +func (s *LocalGatewayVirtualInterface) SetVlan(v int64) *LocalGatewayVirtualInterface { + s.Vlan = &v + return s +} + +// Describes a local gateway virtual interface group. +type LocalGatewayVirtualInterfaceGroup struct { + _ struct{} `type:"structure"` + + // The ID of the local gateway. + LocalGatewayId *string `locationName:"localGatewayId" type:"string"` + + // The ID of the virtual interface group. + LocalGatewayVirtualInterfaceGroupId *string `locationName:"localGatewayVirtualInterfaceGroupId" type:"string"` + + // The IDs of the virtual interfaces. + LocalGatewayVirtualInterfaceIds []*string `locationName:"localGatewayVirtualInterfaceIdSet" locationNameList:"item" type:"list"` + + // The tags assigned to the virtual interface group. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s LocalGatewayVirtualInterfaceGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LocalGatewayVirtualInterfaceGroup) GoString() string { + return s.String() +} + +// SetLocalGatewayId sets the LocalGatewayId field's value. +func (s *LocalGatewayVirtualInterfaceGroup) SetLocalGatewayId(v string) *LocalGatewayVirtualInterfaceGroup { + s.LocalGatewayId = &v + return s +} + +// SetLocalGatewayVirtualInterfaceGroupId sets the LocalGatewayVirtualInterfaceGroupId field's value. +func (s *LocalGatewayVirtualInterfaceGroup) SetLocalGatewayVirtualInterfaceGroupId(v string) *LocalGatewayVirtualInterfaceGroup { + s.LocalGatewayVirtualInterfaceGroupId = &v + return s +} + +// SetLocalGatewayVirtualInterfaceIds sets the LocalGatewayVirtualInterfaceIds field's value. +func (s *LocalGatewayVirtualInterfaceGroup) SetLocalGatewayVirtualInterfaceIds(v []*string) *LocalGatewayVirtualInterfaceGroup { + s.LocalGatewayVirtualInterfaceIds = v + return s +} + +// SetTags sets the Tags field's value. +func (s *LocalGatewayVirtualInterfaceGroup) SetTags(v []*Tag) *LocalGatewayVirtualInterfaceGroup { + s.Tags = v + return s +} + +// Describes the memory for the instance type. +type MemoryInfo struct { + _ struct{} `type:"structure"` + + // Size of the memory, in MiB. + SizeInMiB *int64 `locationName:"sizeInMiB" type:"long"` +} + +// String returns the string representation +func (s MemoryInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MemoryInfo) GoString() string { + return s.String() +} + +// SetSizeInMiB sets the SizeInMiB field's value. +func (s *MemoryInfo) SetSizeInMiB(v int64) *MemoryInfo { + s.SizeInMiB = &v + return s +} + type ModifyCapacityReservationInput struct { _ struct{} `type:"structure"` @@ -73491,6 +84453,13 @@ type ModifyClientVpnEndpointInput struct { // VPN Endpoint (https://docs.aws.amazon.com/vpn/latest/clientvpn-admin/split-tunnel-vpn.html) // in the AWS Client VPN Administrator Guide. SplitTunnel *bool `type:"boolean"` + + // The port number to assign to the Client VPN endpoint for TCP and UDP traffic. + // + // Valid Values: 443 | 1194 + // + // Default Value: 443 + VpnPort *int64 `type:"integer"` } // String returns the string representation @@ -73558,6 +84527,12 @@ func (s *ModifyClientVpnEndpointInput) SetSplitTunnel(v bool) *ModifyClientVpnEn return s } +// SetVpnPort sets the VpnPort field's value. +func (s *ModifyClientVpnEndpointInput) SetVpnPort(v int64) *ModifyClientVpnEndpointInput { + s.VpnPort = &v + return s +} + type ModifyClientVpnEndpointOutput struct { _ struct{} `type:"structure"` @@ -73581,6 +84556,95 @@ func (s *ModifyClientVpnEndpointOutput) SetReturn(v bool) *ModifyClientVpnEndpoi return s } +type ModifyDefaultCreditSpecificationInput struct { + _ struct{} `type:"structure"` + + // The credit option for CPU usage of the instance family. + // + // Valid Values: standard | unlimited + // + // CpuCredits is a required field + CpuCredits *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 `type:"boolean"` + + // The instance family. + // + // InstanceFamily is a required field + InstanceFamily *string `type:"string" required:"true" enum:"UnlimitedSupportedInstanceFamily"` +} + +// String returns the string representation +func (s ModifyDefaultCreditSpecificationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyDefaultCreditSpecificationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyDefaultCreditSpecificationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyDefaultCreditSpecificationInput"} + if s.CpuCredits == nil { + invalidParams.Add(request.NewErrParamRequired("CpuCredits")) + } + if s.InstanceFamily == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceFamily")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCpuCredits sets the CpuCredits field's value. +func (s *ModifyDefaultCreditSpecificationInput) SetCpuCredits(v string) *ModifyDefaultCreditSpecificationInput { + s.CpuCredits = &v + return s +} + +// SetDryRun sets the DryRun field's value. +func (s *ModifyDefaultCreditSpecificationInput) SetDryRun(v bool) *ModifyDefaultCreditSpecificationInput { + s.DryRun = &v + return s +} + +// SetInstanceFamily sets the InstanceFamily field's value. +func (s *ModifyDefaultCreditSpecificationInput) SetInstanceFamily(v string) *ModifyDefaultCreditSpecificationInput { + s.InstanceFamily = &v + return s +} + +type ModifyDefaultCreditSpecificationOutput struct { + _ struct{} `type:"structure"` + + // The default credit option for CPU usage of the instance family. + InstanceFamilyCreditSpecification *InstanceFamilyCreditSpecification `locationName:"instanceFamilyCreditSpecification" type:"structure"` +} + +// String returns the string representation +func (s ModifyDefaultCreditSpecificationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyDefaultCreditSpecificationOutput) GoString() string { + return s.String() +} + +// SetInstanceFamilyCreditSpecification sets the InstanceFamilyCreditSpecification field's value. +func (s *ModifyDefaultCreditSpecificationOutput) SetInstanceFamilyCreditSpecification(v *InstanceFamilyCreditSpecification) *ModifyDefaultCreditSpecificationOutput { + s.InstanceFamilyCreditSpecification = v + return s +} + type ModifyEbsDefaultKmsKeyIdInput struct { _ struct{} `type:"structure"` @@ -73609,6 +84673,8 @@ type ModifyEbsDefaultKmsKeyIdInput struct { // alias, or ARN that is not valid, the action can appear to complete, but eventually // fails. // + // Amazon EBS does not support asymmetric CMKs. + // // KmsKeyId is a required field KmsKeyId *string `type:"string" required:"true"` } @@ -73937,6 +85003,24 @@ type ModifyHostsInput struct { // For more information, see Host Recovery (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/dedicated-hosts-recovery.html) // in the Amazon Elastic Compute Cloud User Guide. HostRecovery *string `type:"string" enum:"HostRecovery"` + + // Specifies the instance family to be supported by the Dedicated Host. Specify + // this parameter to modify a Dedicated Host to support multiple instance types + // within its current instance family. + // + // If you want to modify a Dedicated Host to support a specific instance type + // only, omit this parameter and specify InstanceType instead. You cannot specify + // InstanceFamily and InstanceType in the same request. + InstanceFamily *string `type:"string"` + + // Specifies the instance type to be supported by the Dedicated Host. Specify + // this parameter to modify a Dedicated Host to support only a specific instance + // type. + // + // If you want to modify a Dedicated Host to support multiple instance types + // in its current instance family, omit this parameter and specify InstanceFamily + // instead. You cannot specify InstanceType and InstanceFamily in the same request. + InstanceType *string `type:"string"` } // String returns the string representation @@ -73980,6 +85064,18 @@ func (s *ModifyHostsInput) SetHostRecovery(v string) *ModifyHostsInput { return s } +// SetInstanceFamily sets the InstanceFamily field's value. +func (s *ModifyHostsInput) SetInstanceFamily(v string) *ModifyHostsInput { + s.InstanceFamily = &v + return s +} + +// SetInstanceType sets the InstanceType field's value. +func (s *ModifyHostsInput) SetInstanceType(v string) *ModifyHostsInput { + s.InstanceType = &v + return s +} + type ModifyHostsOutput struct { _ struct{} `type:"structure"` @@ -74834,6 +85930,135 @@ func (s *ModifyInstanceEventStartTimeOutput) SetEvent(v *InstanceStatusEvent) *M return s } +type ModifyInstanceMetadataOptionsInput 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"` + + // This parameter enables or disables the HTTP metadata endpoint on your instances. + // If the parameter is not specified, the existing state is maintained. + // + // If you specify a value of disabled, you will not be able to access your instance + // metadata. + HttpEndpoint *string `type:"string" enum:"InstanceMetadataEndpointState"` + + // The desired HTTP PUT response hop limit for instance metadata requests. The + // larger the number, the further instance metadata requests can travel. If + // no parameter is specified, the existing state is maintained. + // + // Possible values: Integers from 1 to 64 + HttpPutResponseHopLimit *int64 `type:"integer"` + + // The state of token usage for your instance metadata requests. If the parameter + // is not specified in the request, the default state is optional. + // + // If the state is optional, you can choose to retrieve instance metadata with + // or without a signed token header on your request. If you retrieve the IAM + // role credentials without a token, the version 1.0 role credentials are returned. + // If you retrieve the IAM role credentials using a valid signed token, the + // version 2.0 role credentials are returned. + // + // If the state is required, you must send a signed token header with any instance + // metadata retrieval requests. In this state, retrieving the IAM role credential + // always returns the version 2.0 credentials; the version 1.0 credentials are + // not available. + HttpTokens *string `type:"string" enum:"HttpTokensState"` + + // The ID of the instance. + // + // InstanceId is a required field + InstanceId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ModifyInstanceMetadataOptionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyInstanceMetadataOptionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyInstanceMetadataOptionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyInstanceMetadataOptionsInput"} + 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 *ModifyInstanceMetadataOptionsInput) SetDryRun(v bool) *ModifyInstanceMetadataOptionsInput { + s.DryRun = &v + return s +} + +// SetHttpEndpoint sets the HttpEndpoint field's value. +func (s *ModifyInstanceMetadataOptionsInput) SetHttpEndpoint(v string) *ModifyInstanceMetadataOptionsInput { + s.HttpEndpoint = &v + return s +} + +// SetHttpPutResponseHopLimit sets the HttpPutResponseHopLimit field's value. +func (s *ModifyInstanceMetadataOptionsInput) SetHttpPutResponseHopLimit(v int64) *ModifyInstanceMetadataOptionsInput { + s.HttpPutResponseHopLimit = &v + return s +} + +// SetHttpTokens sets the HttpTokens field's value. +func (s *ModifyInstanceMetadataOptionsInput) SetHttpTokens(v string) *ModifyInstanceMetadataOptionsInput { + s.HttpTokens = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *ModifyInstanceMetadataOptionsInput) SetInstanceId(v string) *ModifyInstanceMetadataOptionsInput { + s.InstanceId = &v + return s +} + +type ModifyInstanceMetadataOptionsOutput struct { + _ struct{} `type:"structure"` + + // The ID of the instance. + InstanceId *string `locationName:"instanceId" type:"string"` + + // The metadata options for the instance. + InstanceMetadataOptions *InstanceMetadataOptionsResponse `locationName:"instanceMetadataOptions" type:"structure"` +} + +// String returns the string representation +func (s ModifyInstanceMetadataOptionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyInstanceMetadataOptionsOutput) GoString() string { + return s.String() +} + +// SetInstanceId sets the InstanceId field's value. +func (s *ModifyInstanceMetadataOptionsOutput) SetInstanceId(v string) *ModifyInstanceMetadataOptionsOutput { + s.InstanceId = &v + return s +} + +// SetInstanceMetadataOptions sets the InstanceMetadataOptions field's value. +func (s *ModifyInstanceMetadataOptionsOutput) SetInstanceMetadataOptions(v *InstanceMetadataOptionsResponse) *ModifyInstanceMetadataOptionsOutput { + s.InstanceMetadataOptions = v + return s +} + type ModifyInstancePlacementInput struct { _ struct{} `type:"structure"` @@ -74851,6 +86076,9 @@ type ModifyInstancePlacementInput struct { // The ID of the Dedicated Host with which to associate the instance. HostId *string `locationName:"hostId" type:"string"` + // The ARN of the host resource group in which to place the instance. + HostResourceGroupArn *string `type:"string"` + // The ID of the instance that you are modifying. // // InstanceId is a required field @@ -74904,6 +86132,12 @@ func (s *ModifyInstancePlacementInput) SetHostId(v string) *ModifyInstancePlacem return s } +// SetHostResourceGroupArn sets the HostResourceGroupArn field's value. +func (s *ModifyInstancePlacementInput) SetHostResourceGroupArn(v string) *ModifyInstancePlacementInput { + s.HostResourceGroupArn = &v + return s +} + // SetInstanceId sets the InstanceId field's value. func (s *ModifyInstancePlacementInput) SetInstanceId(v string) *ModifyInstancePlacementInput { s.InstanceId = &v @@ -75244,7 +86478,6 @@ func (s *ModifyReservedInstancesOutput) SetReservedInstancesModificationId(v str return s } -// Contains the parameters for ModifySnapshotAttribute. type ModifySnapshotAttributeInput struct { _ struct{} `type:"structure"` @@ -75946,6 +87179,8 @@ type ModifyTransitGatewayVpcAttachmentInput struct { DryRun *bool `type:"boolean"` // The new VPC attachment options. + // + // You cannot modify the IPv6 options. Options *ModifyTransitGatewayVpcAttachmentRequestOptions `type:"structure"` // The IDs of one or more subnets to remove. @@ -76066,7 +87301,6 @@ func (s *ModifyTransitGatewayVpcAttachmentRequestOptions) SetIpv6Support(v strin return s } -// Contains the parameters for ModifyVolumeAttribute. type ModifyVolumeAttributeInput struct { _ struct{} `type:"structure"` @@ -76449,7 +87683,7 @@ type ModifyVpcEndpointInput struct { // policy must be in valid JSON format. PolicyDocument *string `type:"string"` - // (Interface endpoint) Indicate whether a private hosted zone is associated + // (Interface endpoint) Indicates whether a private hosted zone is associated // with the VPC. PrivateDnsEnabled *bool `type:"boolean"` @@ -76588,7 +87822,8 @@ func (s *ModifyVpcEndpointOutput) SetReturn(v bool) *ModifyVpcEndpointOutput { type ModifyVpcEndpointServiceConfigurationInput struct { _ struct{} `type:"structure"` - // Indicate whether requests to create an endpoint to your service must be accepted. + // Indicates whether requests to create an endpoint to your service must be + // accepted. AcceptanceRequired *bool `type:"boolean"` // The Amazon Resource Names (ARNs) of Network Load Balancers to add to your @@ -76601,10 +87836,16 @@ type ModifyVpcEndpointServiceConfigurationInput struct { // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` + // The private DNS name to assign to the endpoint service. + PrivateDnsName *string `type:"string"` + // The Amazon Resource Names (ARNs) of Network Load Balancers to remove from // your service configuration. RemoveNetworkLoadBalancerArns []*string `locationName:"RemoveNetworkLoadBalancerArn" locationNameList:"item" type:"list"` + // Removes the private DNS name of the endpoint service. + RemovePrivateDnsName *bool `type:"boolean"` + // The ID of the service. // // ServiceId is a required field @@ -76652,12 +87893,24 @@ func (s *ModifyVpcEndpointServiceConfigurationInput) SetDryRun(v bool) *ModifyVp return s } +// SetPrivateDnsName sets the PrivateDnsName field's value. +func (s *ModifyVpcEndpointServiceConfigurationInput) SetPrivateDnsName(v string) *ModifyVpcEndpointServiceConfigurationInput { + s.PrivateDnsName = &v + return s +} + // SetRemoveNetworkLoadBalancerArns sets the RemoveNetworkLoadBalancerArns field's value. func (s *ModifyVpcEndpointServiceConfigurationInput) SetRemoveNetworkLoadBalancerArns(v []*string) *ModifyVpcEndpointServiceConfigurationInput { s.RemoveNetworkLoadBalancerArns = v return s } +// SetRemovePrivateDnsName sets the RemovePrivateDnsName field's value. +func (s *ModifyVpcEndpointServiceConfigurationInput) SetRemovePrivateDnsName(v bool) *ModifyVpcEndpointServiceConfigurationInput { + s.RemovePrivateDnsName = &v + return s +} + // SetServiceId sets the ServiceId field's value. func (s *ModifyVpcEndpointServiceConfigurationInput) SetServiceId(v string) *ModifyVpcEndpointServiceConfigurationInput { s.ServiceId = &v @@ -78107,6 +89360,75 @@ func (s *NetworkAclEntry) SetRuleNumber(v int64) *NetworkAclEntry { return s } +// Describes the networking features of the instance type. +type NetworkInfo struct { + _ struct{} `type:"structure"` + + // Indicates whether Elastic Network Adapter (ENA) is supported. + EnaSupport *string `locationName:"enaSupport" type:"string" enum:"EnaSupport"` + + // The maximum number of IPv4 addresses per network interface. + Ipv4AddressesPerInterface *int64 `locationName:"ipv4AddressesPerInterface" type:"integer"` + + // The maximum number of IPv6 addresses per network interface. + Ipv6AddressesPerInterface *int64 `locationName:"ipv6AddressesPerInterface" type:"integer"` + + // Indicates whether IPv6 is supported. + Ipv6Supported *bool `locationName:"ipv6Supported" type:"boolean"` + + // The maximum number of network interfaces for the instance type. + MaximumNetworkInterfaces *int64 `locationName:"maximumNetworkInterfaces" type:"integer"` + + // Describes the network performance. + NetworkPerformance *string `locationName:"networkPerformance" type:"string"` +} + +// String returns the string representation +func (s NetworkInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NetworkInfo) GoString() string { + return s.String() +} + +// SetEnaSupport sets the EnaSupport field's value. +func (s *NetworkInfo) SetEnaSupport(v string) *NetworkInfo { + s.EnaSupport = &v + return s +} + +// SetIpv4AddressesPerInterface sets the Ipv4AddressesPerInterface field's value. +func (s *NetworkInfo) SetIpv4AddressesPerInterface(v int64) *NetworkInfo { + s.Ipv4AddressesPerInterface = &v + return s +} + +// SetIpv6AddressesPerInterface sets the Ipv6AddressesPerInterface field's value. +func (s *NetworkInfo) SetIpv6AddressesPerInterface(v int64) *NetworkInfo { + s.Ipv6AddressesPerInterface = &v + return s +} + +// SetIpv6Supported sets the Ipv6Supported field's value. +func (s *NetworkInfo) SetIpv6Supported(v bool) *NetworkInfo { + s.Ipv6Supported = &v + return s +} + +// SetMaximumNetworkInterfaces sets the MaximumNetworkInterfaces field's value. +func (s *NetworkInfo) SetMaximumNetworkInterfaces(v int64) *NetworkInfo { + s.MaximumNetworkInterfaces = &v + return s +} + +// SetNetworkPerformance sets the NetworkPerformance field's value. +func (s *NetworkInfo) SetNetworkPerformance(v string) *NetworkInfo { + s.NetworkPerformance = &v + return s +} + // Describes a network interface. type NetworkInterface struct { _ struct{} `type:"structure"` @@ -78139,6 +89461,9 @@ type NetworkInterface struct { // The ID of the network interface. NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` + // The Amazon Resource Name (ARN) of the Outpost. + OutpostArn *string `locationName:"outpostArn" type:"string"` + // The AWS account ID of the owner of the network interface. OwnerId *string `locationName:"ownerId" type:"string"` @@ -78238,6 +89563,12 @@ func (s *NetworkInterface) SetNetworkInterfaceId(v string) *NetworkInterface { return s } +// SetOutpostArn sets the OutpostArn field's value. +func (s *NetworkInterface) SetOutpostArn(v string) *NetworkInterface { + s.OutpostArn = &v + return s +} + // SetOwnerId sets the OwnerId field's value. func (s *NetworkInterface) SetOwnerId(v string) *NetworkInterface { s.OwnerId = &v @@ -78696,6 +90027,10 @@ type OnDemandOptions struct { // Fleet defaults to lowest-price. AllocationStrategy *string `locationName:"allocationStrategy" type:"string" enum:"FleetOnDemandAllocationStrategy"` + // The strategy for using unused Capacity Reservations for fulfilling On-Demand + // capacity. Supported only for fleets of type instant. + CapacityReservationOptions *CapacityReservationOptions `locationName:"capacityReservationOptions" type:"structure"` + // The maximum amount per hour for On-Demand Instances that you're willing to // pay. MaxTotalPrice *string `locationName:"maxTotalPrice" type:"string"` @@ -78705,11 +90040,11 @@ type OnDemandOptions struct { MinTargetCapacity *int64 `locationName:"minTargetCapacity" type:"integer"` // Indicates that the fleet launches all On-Demand Instances into a single Availability - // Zone. + // Zone. Supported only for fleets of type instant. SingleAvailabilityZone *bool `locationName:"singleAvailabilityZone" type:"boolean"` // Indicates that the fleet uses a single instance type to launch all On-Demand - // Instances in the fleet. + // Instances in the fleet. Supported only for fleets of type instant. SingleInstanceType *bool `locationName:"singleInstanceType" type:"boolean"` } @@ -78729,6 +90064,12 @@ func (s *OnDemandOptions) SetAllocationStrategy(v string) *OnDemandOptions { return s } +// SetCapacityReservationOptions sets the CapacityReservationOptions field's value. +func (s *OnDemandOptions) SetCapacityReservationOptions(v *CapacityReservationOptions) *OnDemandOptions { + s.CapacityReservationOptions = v + return s +} + // SetMaxTotalPrice sets the MaxTotalPrice field's value. func (s *OnDemandOptions) SetMaxTotalPrice(v string) *OnDemandOptions { s.MaxTotalPrice = &v @@ -78765,6 +90106,10 @@ type OnDemandOptionsRequest struct { // Fleet defaults to lowest-price. AllocationStrategy *string `type:"string" enum:"FleetOnDemandAllocationStrategy"` + // The strategy for using unused Capacity Reservations for fulfilling On-Demand + // capacity. Supported only for fleets of type instant. + CapacityReservationOptions *CapacityReservationOptionsRequest `type:"structure"` + // The maximum amount per hour for On-Demand Instances that you're willing to // pay. MaxTotalPrice *string `type:"string"` @@ -78774,11 +90119,11 @@ type OnDemandOptionsRequest struct { MinTargetCapacity *int64 `type:"integer"` // Indicates that the fleet launches all On-Demand Instances into a single Availability - // Zone. + // Zone. Supported only for fleets of type instant. SingleAvailabilityZone *bool `type:"boolean"` // Indicates that the fleet uses a single instance type to launch all On-Demand - // Instances in the fleet. + // Instances in the fleet. Supported only for fleets of type instant. SingleInstanceType *bool `type:"boolean"` } @@ -78798,6 +90143,12 @@ func (s *OnDemandOptionsRequest) SetAllocationStrategy(v string) *OnDemandOption return s } +// SetCapacityReservationOptions sets the CapacityReservationOptions field's value. +func (s *OnDemandOptionsRequest) SetCapacityReservationOptions(v *CapacityReservationOptionsRequest) *OnDemandOptionsRequest { + s.CapacityReservationOptions = v + return s +} + // SetMaxTotalPrice sets the MaxTotalPrice field's value. func (s *OnDemandOptionsRequest) SetMaxTotalPrice(v string) *OnDemandOptionsRequest { s.MaxTotalPrice = &v @@ -78874,6 +90225,39 @@ func (s *PciId) SetVendorId(v string) *PciId { return s } +// The status of the transit gateway peering attachment. +type PeeringAttachmentStatus struct { + _ struct{} `type:"structure"` + + // The status code. + Code *string `locationName:"code" type:"string"` + + // The status message, if applicable. + Message *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PeeringAttachmentStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PeeringAttachmentStatus) GoString() string { + return s.String() +} + +// SetCode sets the Code field's value. +func (s *PeeringAttachmentStatus) SetCode(v string) *PeeringAttachmentStatus { + s.Code = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *PeeringAttachmentStatus) SetMessage(v string) *PeeringAttachmentStatus { + s.Message = &v + return s +} + // Describes the VPC peering connection options. type PeeringConnectionOptions struct { _ struct{} `type:"structure"` @@ -78964,6 +90348,48 @@ func (s *PeeringConnectionOptionsRequest) SetAllowEgressFromLocalVpcToRemoteClas return s } +// Information about the transit gateway in the peering attachment. +type PeeringTgwInfo struct { + _ struct{} `type:"structure"` + + // The AWS account ID of the owner of the transit gateway. + OwnerId *string `locationName:"ownerId" type:"string"` + + // The Region of the transit gateway. + Region *string `locationName:"region" type:"string"` + + // The ID of the transit gateway. + TransitGatewayId *string `locationName:"transitGatewayId" type:"string"` +} + +// String returns the string representation +func (s PeeringTgwInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PeeringTgwInfo) GoString() string { + return s.String() +} + +// SetOwnerId sets the OwnerId field's value. +func (s *PeeringTgwInfo) SetOwnerId(v string) *PeeringTgwInfo { + s.OwnerId = &v + return s +} + +// SetRegion sets the Region field's value. +func (s *PeeringTgwInfo) SetRegion(v string) *PeeringTgwInfo { + s.Region = &v + return s +} + +// SetTransitGatewayId sets the TransitGatewayId field's value. +func (s *PeeringTgwInfo) SetTransitGatewayId(v string) *PeeringTgwInfo { + s.TransitGatewayId = &v + return s +} + // The Diffie-Hellmann group number for phase 1 IKE negotiations. type Phase1DHGroupNumbersListValue struct { _ struct{} `type:"structure"` @@ -79260,12 +90686,16 @@ type Placement struct { // The affinity setting for the instance on the Dedicated Host. This parameter // is not supported for the ImportInstance command. + // + // This parameter is not supported by . Affinity *string `locationName:"affinity" type:"string"` // The Availability Zone of the instance. // // If not specified, an Availability Zone will be automatically chosen for you // based on the load balancing criteria for the Region. + // + // This parameter is not supported by . AvailabilityZone *string `locationName:"availabilityZone" type:"string"` // The name of the placement group the instance is in. @@ -79273,18 +90703,33 @@ type Placement struct { // The ID of the Dedicated Host on which the instance resides. This parameter // is not supported for the ImportInstance command. + // + // This parameter is not supported by . HostId *string `locationName:"hostId" type:"string"` + // The ARN of the host resource group in which to launch the instances. If you + // specify a host resource group ARN, omit the Tenancy parameter or set it to + // host. + // + // This parameter is not supported by . + HostResourceGroupArn *string `locationName:"hostResourceGroupArn" type:"string"` + // The number of the partition the instance is in. Valid only if the placement // group strategy is set to partition. + // + // This parameter is not supported by . PartitionNumber *int64 `locationName:"partitionNumber" type:"integer"` // Reserved for future use. + // + // This parameter is not supported by . SpreadDomain *string `locationName:"spreadDomain" 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. + // + // This parameter is not supported by . Tenancy *string `locationName:"tenancy" type:"string" enum:"Tenancy"` } @@ -79322,6 +90767,12 @@ func (s *Placement) SetHostId(v string) *Placement { return s } +// SetHostResourceGroupArn sets the HostResourceGroupArn field's value. +func (s *Placement) SetHostResourceGroupArn(v string) *Placement { + s.HostResourceGroupArn = &v + return s +} + // SetPartitionNumber sets the PartitionNumber field's value. func (s *Placement) SetPartitionNumber(v int64) *Placement { s.PartitionNumber = &v @@ -79344,6 +90795,9 @@ func (s *Placement) SetTenancy(v string) *Placement { type PlacementGroup struct { _ struct{} `type:"structure"` + // The ID of the placement group. + GroupId *string `locationName:"groupId" type:"string"` + // The name of the placement group. GroupName *string `locationName:"groupName" type:"string"` @@ -79355,6 +90809,9 @@ type PlacementGroup struct { // The placement strategy. Strategy *string `locationName:"strategy" type:"string" enum:"PlacementStrategy"` + + // Any tags applied to the placement group. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation @@ -79367,6 +90824,12 @@ func (s PlacementGroup) GoString() string { return s.String() } +// SetGroupId sets the GroupId field's value. +func (s *PlacementGroup) SetGroupId(v string) *PlacementGroup { + s.GroupId = &v + return s +} + // SetGroupName sets the GroupName field's value. func (s *PlacementGroup) SetGroupName(v string) *PlacementGroup { s.GroupName = &v @@ -79391,11 +90854,41 @@ func (s *PlacementGroup) SetStrategy(v string) *PlacementGroup { return s } +// SetTags sets the Tags field's value. +func (s *PlacementGroup) SetTags(v []*Tag) *PlacementGroup { + s.Tags = v + return s +} + +// Describes the placement group support of the instance type. +type PlacementGroupInfo struct { + _ struct{} `type:"structure"` + + // A list of supported placement groups types. + SupportedStrategies []*string `locationName:"supportedStrategies" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s PlacementGroupInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PlacementGroupInfo) GoString() string { + return s.String() +} + +// SetSupportedStrategies sets the SupportedStrategies field's value. +func (s *PlacementGroupInfo) SetSupportedStrategies(v []*string) *PlacementGroupInfo { + s.SupportedStrategies = v + return s +} + // Describes the placement of an instance. type PlacementResponse struct { _ struct{} `type:"structure"` - // The name of the placement group the instance is in. + // The name of the placement group that the instance is in. GroupName *string `locationName:"groupName" type:"string"` } @@ -79415,6 +90908,30 @@ func (s *PlacementResponse) SetGroupName(v string) *PlacementResponse { return s } +// Describes a CIDR block for an address pool. +type PoolCidrBlock struct { + _ struct{} `type:"structure"` + + // The CIDR block. + Cidr *string `locationName:"poolCidrBlock" type:"string"` +} + +// String returns the string representation +func (s PoolCidrBlock) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PoolCidrBlock) GoString() string { + return s.String() +} + +// SetCidr sets the Cidr field's value. +func (s *PoolCidrBlock) SetCidr(v string) *PoolCidrBlock { + s.Cidr = &v + return s +} + // Describes a range of ports. type PortRange struct { _ struct{} `type:"structure"` @@ -79699,6 +91216,65 @@ func (s *PrincipalIdFormat) SetStatuses(v []*IdFormat) *PrincipalIdFormat { return s } +// Information about the private DNS name for the service endpoint. For more +// information about these parameters, see VPC Endpoint Service Private DNS +// Name Verification (https://docs.aws.amazon.com/vpc/latest/userguide/ndpoint-services-dns-validation.html) +// in the Amazon Virtual Private Cloud User Guide. +type PrivateDnsNameConfiguration struct { + _ struct{} `type:"structure"` + + // The name of the record subdomain the service provider needs to create. The + // service provider adds the value text to the name. + Name *string `locationName:"name" type:"string"` + + // The verification state of the VPC endpoint service. + // + // >Consumers of the endpoint service can use the private name only when the + // state is verified. + State *string `locationName:"state" type:"string" enum:"DnsNameState"` + + // The endpoint service verification type, for example TXT. + Type *string `locationName:"type" type:"string"` + + // The value the service provider adds to the private DNS name domain record + // before verification. + Value *string `locationName:"value" type:"string"` +} + +// String returns the string representation +func (s PrivateDnsNameConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PrivateDnsNameConfiguration) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *PrivateDnsNameConfiguration) SetName(v string) *PrivateDnsNameConfiguration { + s.Name = &v + return s +} + +// SetState sets the State field's value. +func (s *PrivateDnsNameConfiguration) SetState(v string) *PrivateDnsNameConfiguration { + s.State = &v + return s +} + +// SetType sets the Type field's value. +func (s *PrivateDnsNameConfiguration) SetType(v string) *PrivateDnsNameConfiguration { + s.Type = &v + return s +} + +// SetValue sets the Value field's value. +func (s *PrivateDnsNameConfiguration) SetValue(v string) *PrivateDnsNameConfiguration { + s.Value = &v + return s +} + // Describes a secondary private IPv4 address for a network interface. type PrivateIpAddressSpecification struct { _ struct{} `type:"structure"` @@ -79733,6 +91309,39 @@ func (s *PrivateIpAddressSpecification) SetPrivateIpAddress(v string) *PrivateIp return s } +// Describes the processor used by the instance type. +type ProcessorInfo struct { + _ struct{} `type:"structure"` + + // A list of architectures supported by the instance type. + SupportedArchitectures []*string `locationName:"supportedArchitectures" locationNameList:"item" type:"list"` + + // The speed of the processor, in GHz. + SustainedClockSpeedInGhz *float64 `locationName:"sustainedClockSpeedInGhz" type:"double"` +} + +// String returns the string representation +func (s ProcessorInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ProcessorInfo) GoString() string { + return s.String() +} + +// SetSupportedArchitectures sets the SupportedArchitectures field's value. +func (s *ProcessorInfo) SetSupportedArchitectures(v []*string) *ProcessorInfo { + s.SupportedArchitectures = v + return s +} + +// SetSustainedClockSpeedInGhz sets the SustainedClockSpeedInGhz field's value. +func (s *ProcessorInfo) SetSustainedClockSpeedInGhz(v float64) *ProcessorInfo { + s.SustainedClockSpeedInGhz = &v + return s +} + // Describes a product code. type ProductCode struct { _ struct{} `type:"structure"` @@ -79793,9 +91402,10 @@ func (s *PropagatingVgw) SetGatewayId(v string) *PropagatingVgw { type ProvisionByoipCidrInput struct { _ struct{} `type:"structure"` - // The public IPv4 address range, in CIDR notation. The most specific prefix - // that you can specify is /24. The address range cannot overlap with another - // address range that you've brought to this or another Region. + // The public IPv4 or IPv6 address range, in CIDR notation. The most specific + // IPv4 prefix that you can specify is /24. The most specific IPv6 prefix you + // can specify is /56. The address range cannot overlap with another address + // range that you've brought to this or another Region. // // Cidr is a required field Cidr *string `type:"string" required:"true"` @@ -79812,6 +91422,12 @@ type ProvisionByoipCidrInput struct { // the required permissions, the error response is DryRunOperation. Otherwise, // it is UnauthorizedOperation. DryRun *bool `type:"boolean"` + + // (IPv6 only) Indicate whether the address range will be publicly advertised + // to the internet. + // + // Default: true + PubliclyAdvertisable *bool `type:"boolean"` } // String returns the string representation @@ -79866,10 +91482,16 @@ func (s *ProvisionByoipCidrInput) SetDryRun(v bool) *ProvisionByoipCidrInput { return s } +// SetPubliclyAdvertisable sets the PubliclyAdvertisable field's value. +func (s *ProvisionByoipCidrInput) SetPubliclyAdvertisable(v bool) *ProvisionByoipCidrInput { + s.PubliclyAdvertisable = &v + return s +} + type ProvisionByoipCidrOutput struct { _ struct{} `type:"structure"` - // Information about the address pool. + // Information about the address range. ByoipCidr *ByoipCidr `locationName:"byoipCidr" type:"structure"` } @@ -79961,7 +91583,7 @@ func (s *ProvisionedBandwidth) SetStatus(v string) *ProvisionedBandwidth { return s } -// Describes an address pool. +// Describes an IPv4 address pool. type PublicIpv4Pool struct { _ struct{} `type:"structure"` @@ -79971,9 +91593,12 @@ type PublicIpv4Pool struct { // The address ranges. PoolAddressRanges []*PublicIpv4PoolRange `locationName:"poolAddressRangeSet" locationNameList:"item" type:"list"` - // The ID of the IPv4 address pool. + // The ID of the address pool. PoolId *string `locationName:"poolId" type:"string"` + // Any tags for the address pool. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + // The total number of addresses. TotalAddressCount *int64 `locationName:"totalAddressCount" type:"integer"` @@ -80009,6 +91634,12 @@ func (s *PublicIpv4Pool) SetPoolId(v string) *PublicIpv4Pool { return s } +// SetTags sets the Tags field's value. +func (s *PublicIpv4Pool) SetTags(v []*Tag) *PublicIpv4Pool { + s.Tags = v + return s +} + // SetTotalAddressCount sets the TotalAddressCount field's value. func (s *PublicIpv4Pool) SetTotalAddressCount(v int64) *PublicIpv4Pool { s.TotalAddressCount = &v @@ -80381,6 +92012,10 @@ type PurchaseReservedInstancesOfferingInput struct { // prices. LimitPrice *ReservedInstanceLimitPrice `locationName:"limitPrice" type:"structure"` + // The time at which to purchase the Reserved Instance, in UTC format (for example, + // YYYY-MM-DDTHH:MM:SSZ). + PurchaseTime *time.Time `type:"timestamp"` + // The ID of the Reserved Instance offering to purchase. // // ReservedInstancesOfferingId is a required field @@ -80431,6 +92066,12 @@ func (s *PurchaseReservedInstancesOfferingInput) SetLimitPrice(v *ReservedInstan return s } +// SetPurchaseTime sets the PurchaseTime field's value. +func (s *PurchaseReservedInstancesOfferingInput) SetPurchaseTime(v time.Time) *PurchaseReservedInstancesOfferingInput { + s.PurchaseTime = &v + return s +} + // SetReservedInstancesOfferingId sets the ReservedInstancesOfferingId field's value. func (s *PurchaseReservedInstancesOfferingInput) SetReservedInstancesOfferingId(v string) *PurchaseReservedInstancesOfferingInput { s.ReservedInstancesOfferingId = &v @@ -80898,6 +92539,233 @@ func (s *RegisterImageOutput) SetImageId(v string) *RegisterImageOutput { return s } +type RegisterTransitGatewayMulticastGroupMembersInput 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 IP address assigned to the transit gateway multicast group. + GroupIpAddress *string `type:"string"` + + // The group members' network interface IDs to register with the transit gateway + // multicast group. + NetworkInterfaceIds []*string `locationNameList:"item" type:"list"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `type:"string"` +} + +// String returns the string representation +func (s RegisterTransitGatewayMulticastGroupMembersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterTransitGatewayMulticastGroupMembersInput) GoString() string { + return s.String() +} + +// SetDryRun sets the DryRun field's value. +func (s *RegisterTransitGatewayMulticastGroupMembersInput) SetDryRun(v bool) *RegisterTransitGatewayMulticastGroupMembersInput { + s.DryRun = &v + return s +} + +// SetGroupIpAddress sets the GroupIpAddress field's value. +func (s *RegisterTransitGatewayMulticastGroupMembersInput) SetGroupIpAddress(v string) *RegisterTransitGatewayMulticastGroupMembersInput { + s.GroupIpAddress = &v + return s +} + +// SetNetworkInterfaceIds sets the NetworkInterfaceIds field's value. +func (s *RegisterTransitGatewayMulticastGroupMembersInput) SetNetworkInterfaceIds(v []*string) *RegisterTransitGatewayMulticastGroupMembersInput { + s.NetworkInterfaceIds = v + return s +} + +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *RegisterTransitGatewayMulticastGroupMembersInput) SetTransitGatewayMulticastDomainId(v string) *RegisterTransitGatewayMulticastGroupMembersInput { + s.TransitGatewayMulticastDomainId = &v + return s +} + +type RegisterTransitGatewayMulticastGroupMembersOutput struct { + _ struct{} `type:"structure"` + + // Information about the registered transit gateway multicast group members. + RegisteredMulticastGroupMembers *TransitGatewayMulticastRegisteredGroupMembers `locationName:"registeredMulticastGroupMembers" type:"structure"` +} + +// String returns the string representation +func (s RegisterTransitGatewayMulticastGroupMembersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterTransitGatewayMulticastGroupMembersOutput) GoString() string { + return s.String() +} + +// SetRegisteredMulticastGroupMembers sets the RegisteredMulticastGroupMembers field's value. +func (s *RegisterTransitGatewayMulticastGroupMembersOutput) SetRegisteredMulticastGroupMembers(v *TransitGatewayMulticastRegisteredGroupMembers) *RegisterTransitGatewayMulticastGroupMembersOutput { + s.RegisteredMulticastGroupMembers = v + return s +} + +type RegisterTransitGatewayMulticastGroupSourcesInput 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 IP address assigned to the transit gateway multicast group. + GroupIpAddress *string `type:"string"` + + // The group sources' network interface IDs to register with the transit gateway + // multicast group. + NetworkInterfaceIds []*string `locationNameList:"item" type:"list"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `type:"string"` +} + +// String returns the string representation +func (s RegisterTransitGatewayMulticastGroupSourcesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterTransitGatewayMulticastGroupSourcesInput) GoString() string { + return s.String() +} + +// SetDryRun sets the DryRun field's value. +func (s *RegisterTransitGatewayMulticastGroupSourcesInput) SetDryRun(v bool) *RegisterTransitGatewayMulticastGroupSourcesInput { + s.DryRun = &v + return s +} + +// SetGroupIpAddress sets the GroupIpAddress field's value. +func (s *RegisterTransitGatewayMulticastGroupSourcesInput) SetGroupIpAddress(v string) *RegisterTransitGatewayMulticastGroupSourcesInput { + s.GroupIpAddress = &v + return s +} + +// SetNetworkInterfaceIds sets the NetworkInterfaceIds field's value. +func (s *RegisterTransitGatewayMulticastGroupSourcesInput) SetNetworkInterfaceIds(v []*string) *RegisterTransitGatewayMulticastGroupSourcesInput { + s.NetworkInterfaceIds = v + return s +} + +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *RegisterTransitGatewayMulticastGroupSourcesInput) SetTransitGatewayMulticastDomainId(v string) *RegisterTransitGatewayMulticastGroupSourcesInput { + s.TransitGatewayMulticastDomainId = &v + return s +} + +type RegisterTransitGatewayMulticastGroupSourcesOutput struct { + _ struct{} `type:"structure"` + + // Information about the transit gateway multicast group sources. + RegisteredMulticastGroupSources *TransitGatewayMulticastRegisteredGroupSources `locationName:"registeredMulticastGroupSources" type:"structure"` +} + +// String returns the string representation +func (s RegisterTransitGatewayMulticastGroupSourcesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterTransitGatewayMulticastGroupSourcesOutput) GoString() string { + return s.String() +} + +// SetRegisteredMulticastGroupSources sets the RegisteredMulticastGroupSources field's value. +func (s *RegisterTransitGatewayMulticastGroupSourcesOutput) SetRegisteredMulticastGroupSources(v *TransitGatewayMulticastRegisteredGroupSources) *RegisterTransitGatewayMulticastGroupSourcesOutput { + s.RegisteredMulticastGroupSources = v + return s +} + +type RejectTransitGatewayPeeringAttachmentInput 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 transit gateway peering attachment. + // + // TransitGatewayAttachmentId is a required field + TransitGatewayAttachmentId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s RejectTransitGatewayPeeringAttachmentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RejectTransitGatewayPeeringAttachmentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RejectTransitGatewayPeeringAttachmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RejectTransitGatewayPeeringAttachmentInput"} + if s.TransitGatewayAttachmentId == nil { + invalidParams.Add(request.NewErrParamRequired("TransitGatewayAttachmentId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *RejectTransitGatewayPeeringAttachmentInput) SetDryRun(v bool) *RejectTransitGatewayPeeringAttachmentInput { + s.DryRun = &v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *RejectTransitGatewayPeeringAttachmentInput) SetTransitGatewayAttachmentId(v string) *RejectTransitGatewayPeeringAttachmentInput { + s.TransitGatewayAttachmentId = &v + return s +} + +type RejectTransitGatewayPeeringAttachmentOutput struct { + _ struct{} `type:"structure"` + + // The transit gateway peering attachment. + TransitGatewayPeeringAttachment *TransitGatewayPeeringAttachment `locationName:"transitGatewayPeeringAttachment" type:"structure"` +} + +// String returns the string representation +func (s RejectTransitGatewayPeeringAttachmentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RejectTransitGatewayPeeringAttachmentOutput) GoString() string { + return s.String() +} + +// SetTransitGatewayPeeringAttachment sets the TransitGatewayPeeringAttachment field's value. +func (s *RejectTransitGatewayPeeringAttachmentOutput) SetTransitGatewayPeeringAttachment(v *TransitGatewayPeeringAttachment) *RejectTransitGatewayPeeringAttachmentOutput { + s.TransitGatewayPeeringAttachment = v + return s +} + type RejectTransitGatewayVpcAttachmentInput struct { _ struct{} `type:"structure"` @@ -81143,6 +93011,16 @@ type ReleaseAddressInput struct { // it is UnauthorizedOperation. DryRun *bool `locationName:"dryRun" type:"boolean"` + // The location that the IP address is released from. + // + // If you provide an incorrect network border group, you will receive an InvalidAddress.NotFound + // error. For more information, see Error Codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html). + // + // You cannot use a network border group with EC2 Classic. If you attempt this + // operation on EC2 classic, you will receive an InvalidParameterCombination + // error. For more information, see Error Codes (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/errors-overview.html). + NetworkBorderGroup *string `type:"string"` + // [EC2-Classic] The Elastic IP address. Required for EC2-Classic. PublicIp *string `type:"string"` } @@ -81169,6 +93047,12 @@ func (s *ReleaseAddressInput) SetDryRun(v bool) *ReleaseAddressInput { return s } +// SetNetworkBorderGroup sets the NetworkBorderGroup field's value. +func (s *ReleaseAddressInput) SetNetworkBorderGroup(v string) *ReleaseAddressInput { + s.NetworkBorderGroup = &v + return s +} + // SetPublicIp sets the PublicIp field's value. func (s *ReleaseAddressInput) SetPublicIp(v string) *ReleaseAddressInput { s.PublicIp = &v @@ -81615,6 +93499,12 @@ type ReplaceRouteInput struct { // The ID of a NAT instance in your VPC. InstanceId *string `locationName:"instanceId" type:"string"` + // The ID of the local gateway. + LocalGatewayId *string `type:"string"` + + // Specifies whether to reset the local route to its default target (local). + LocalTarget *bool `type:"boolean"` + // [IPv4 traffic only] The ID of a NAT gateway. NatGatewayId *string `locationName:"natGatewayId" type:"string"` @@ -81692,6 +93582,18 @@ func (s *ReplaceRouteInput) SetInstanceId(v string) *ReplaceRouteInput { return s } +// SetLocalGatewayId sets the LocalGatewayId field's value. +func (s *ReplaceRouteInput) SetLocalGatewayId(v string) *ReplaceRouteInput { + s.LocalGatewayId = &v + return s +} + +// SetLocalTarget sets the LocalTarget field's value. +func (s *ReplaceRouteInput) SetLocalTarget(v bool) *ReplaceRouteInput { + s.LocalTarget = &v + return s +} + // SetNatGatewayId sets the NatGatewayId field's value. func (s *ReplaceRouteInput) SetNatGatewayId(v string) *ReplaceRouteInput { s.NatGatewayId = &v @@ -81803,6 +93705,9 @@ func (s *ReplaceRouteTableAssociationInput) SetRouteTableId(v string) *ReplaceRo type ReplaceRouteTableAssociationOutput struct { _ struct{} `type:"structure"` + // The state of the association. + AssociationState *RouteTableAssociationState `locationName:"associationState" type:"structure"` + // The ID of the new association. NewAssociationId *string `locationName:"newAssociationId" type:"string"` } @@ -81817,6 +93722,12 @@ func (s ReplaceRouteTableAssociationOutput) GoString() string { return s.String() } +// SetAssociationState sets the AssociationState field's value. +func (s *ReplaceRouteTableAssociationOutput) SetAssociationState(v *RouteTableAssociationState) *ReplaceRouteTableAssociationOutput { + s.AssociationState = v + return s +} + // SetNewAssociationId sets the NewAssociationId field's value. func (s *ReplaceRouteTableAssociationOutput) SetNewAssociationId(v string) *ReplaceRouteTableAssociationOutput { s.NewAssociationId = &v @@ -82074,12 +93985,6 @@ type RequestLaunchTemplateData struct { _ struct{} `type:"structure"` // 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 []*LaunchTemplateBlockDeviceMappingRequest `locationName:"BlockDeviceMapping" locationNameList:"BlockDeviceMapping" type:"list"` // The Capacity Reservation targeting option. If you do not specify this parameter, @@ -82119,8 +94024,7 @@ type RequestLaunchTemplateData struct { // Indicates whether an instance is enabled for hibernation. This parameter // is valid only if the instance meets the hibernation prerequisites (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html#hibernating-prerequisites). - // Hibernation is currently supported only for Amazon Linux. For more information, - // see Hibernate Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) + // For more information, see Hibernate Your Instance (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Hibernate.html) // in the Amazon Elastic Compute Cloud User Guide. HibernationOptions *LaunchTemplateHibernationOptionsRequest `type:"structure"` @@ -82160,6 +94064,11 @@ type RequestLaunchTemplateData struct { // The license configurations. LicenseSpecifications []*LaunchTemplateLicenseConfigurationRequest `locationName:"LicenseSpecification" locationNameList:"item" type:"list"` + // The metadata options for the instance. For more information, see Instance + // Metadata and User Data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) + // in the Amazon Elastic Compute Cloud User Guide. + MetadataOptions *LaunchTemplateInstanceMetadataOptionsRequest `type:"structure"` + // The monitoring for the instance. Monitoring *LaunchTemplatesMonitoringRequest `type:"structure"` @@ -82348,6 +94257,12 @@ func (s *RequestLaunchTemplateData) SetLicenseSpecifications(v []*LaunchTemplate return s } +// SetMetadataOptions sets the MetadataOptions field's value. +func (s *RequestLaunchTemplateData) SetMetadataOptions(v *LaunchTemplateInstanceMetadataOptionsRequest) *RequestLaunchTemplateData { + s.MetadataOptions = v + return s +} + // SetMonitoring sets the Monitoring field's value. func (s *RequestLaunchTemplateData) SetMonitoring(v *LaunchTemplatesMonitoringRequest) *RequestLaunchTemplateData { s.Monitoring = v @@ -82556,6 +94471,10 @@ type RequestSpotInstancesInput struct { // 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. + // + // The specified start date and time cannot be equal to the current date and + // time. You must specify a start date and time that occurs after the current + // date and time. ValidFrom *time.Time `locationName:"validFrom" type:"timestamp"` // The end date of the request. If this is a one-time request, the request remains @@ -83095,7 +95014,7 @@ type ReservedInstances struct { ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` // The scope of the Reserved Instance. - Scope *string `locationName:"scope" type:"string" enum:"scope"` + Scope *string `locationName:"scope" type:"string" enum:"Scope"` // The date and time the Reserved Instance started. Start *time.Time `locationName:"start" type:"timestamp"` @@ -83249,7 +95168,7 @@ type ReservedInstancesConfiguration struct { // 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"` + Scope *string `locationName:"scope" type:"string" enum:"Scope"` } // String returns the string representation @@ -83608,7 +95527,7 @@ type ReservedInstancesOffering struct { // Whether the Reserved Instance is applied to instances in a Region or an Availability // Zone. - Scope *string `locationName:"scope" type:"string" enum:"scope"` + Scope *string `locationName:"scope" type:"string" enum:"Scope"` // The usage price of the Reserved Instance, per hour. UsagePrice *float64 `locationName:"usagePrice" type:"float"` @@ -84080,7 +95999,6 @@ func (s ResetNetworkInterfaceAttributeOutput) GoString() string { return s.String() } -// Contains the parameters for ResetSnapshotAttribute. type ResetSnapshotAttributeInput struct { _ struct{} `type:"structure"` @@ -84255,6 +96173,11 @@ type ResponseLaunchTemplateData struct { // The license configurations. LicenseSpecifications []*LaunchTemplateLicenseConfiguration `locationName:"licenseSet" locationNameList:"item" type:"list"` + // The metadata options for the instance. For more information, see Instance + // Metadata and User Data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html) + // in the Amazon Elastic Compute Cloud User Guide. + MetadataOptions *LaunchTemplateInstanceMetadataOptions `locationName:"metadataOptions" type:"structure"` + // The monitoring for the instance. Monitoring *LaunchTemplatesMonitoring `locationName:"monitoring" type:"structure"` @@ -84392,6 +96315,12 @@ func (s *ResponseLaunchTemplateData) SetLicenseSpecifications(v []*LaunchTemplat return s } +// SetMetadataOptions sets the MetadataOptions field's value. +func (s *ResponseLaunchTemplateData) SetMetadataOptions(v *LaunchTemplateInstanceMetadataOptions) *ResponseLaunchTemplateData { + s.MetadataOptions = v + return s +} + // SetMonitoring sets the Monitoring field's value. func (s *ResponseLaunchTemplateData) SetMonitoring(v *LaunchTemplatesMonitoring) *ResponseLaunchTemplateData { s.Monitoring = v @@ -84923,6 +96852,9 @@ type Route struct { // The AWS account ID of the owner of the instance. InstanceOwnerId *string `locationName:"instanceOwnerId" type:"string"` + // The ID of the local gateway. + LocalGatewayId *string `locationName:"localGatewayId" type:"string"` + // The ID of a NAT gateway. NatGatewayId *string `locationName:"natGatewayId" type:"string"` @@ -85003,6 +96935,12 @@ func (s *Route) SetInstanceOwnerId(v string) *Route { return s } +// SetLocalGatewayId sets the LocalGatewayId field's value. +func (s *Route) SetLocalGatewayId(v string) *Route { + s.LocalGatewayId = &v + return s +} + // SetNatGatewayId sets the NatGatewayId field's value. func (s *Route) SetNatGatewayId(v string) *Route { s.NatGatewayId = &v @@ -85043,7 +96981,7 @@ func (s *Route) SetVpcPeeringConnectionId(v string) *Route { type RouteTable struct { _ struct{} `type:"structure"` - // The associations between the route table and one or more subnets. + // The associations between the route table and one or more subnets or a gateway. Associations []*RouteTableAssociation `locationName:"associationSet" locationNameList:"item" type:"list"` // The ID of the AWS account that owns the route table. @@ -85117,14 +97055,20 @@ func (s *RouteTable) SetVpcId(v string) *RouteTable { return s } -// Describes an association between a route table and a subnet. +// Describes an association between a route table and a subnet or gateway. type RouteTableAssociation struct { _ struct{} `type:"structure"` + // The state of the association. + AssociationState *RouteTableAssociationState `locationName:"associationState" type:"structure"` + + // The ID of the internet gateway or virtual private gateway. + GatewayId *string `locationName:"gatewayId" type:"string"` + // 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. + // The ID of the association. RouteTableAssociationId *string `locationName:"routeTableAssociationId" type:"string"` // The ID of the route table. @@ -85144,6 +97088,18 @@ func (s RouteTableAssociation) GoString() string { return s.String() } +// SetAssociationState sets the AssociationState field's value. +func (s *RouteTableAssociation) SetAssociationState(v *RouteTableAssociationState) *RouteTableAssociation { + s.AssociationState = v + return s +} + +// SetGatewayId sets the GatewayId field's value. +func (s *RouteTableAssociation) SetGatewayId(v string) *RouteTableAssociation { + s.GatewayId = &v + return s +} + // SetMain sets the Main field's value. func (s *RouteTableAssociation) SetMain(v bool) *RouteTableAssociation { s.Main = &v @@ -85168,6 +97124,40 @@ func (s *RouteTableAssociation) SetSubnetId(v string) *RouteTableAssociation { return s } +// Describes the state of an association between a route table and a subnet +// or gateway. +type RouteTableAssociationState struct { + _ struct{} `type:"structure"` + + // The state of the association. + State *string `locationName:"state" type:"string" enum:"RouteTableAssociationStateCode"` + + // The status message, if applicable. + StatusMessage *string `locationName:"statusMessage" type:"string"` +} + +// String returns the string representation +func (s RouteTableAssociationState) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RouteTableAssociationState) GoString() string { + return s.String() +} + +// SetState sets the State field's value. +func (s *RouteTableAssociationState) SetState(v string) *RouteTableAssociationState { + s.State = &v + return s +} + +// SetStatusMessage sets the StatusMessage field's value. +func (s *RouteTableAssociationState) SetStatusMessage(v string) *RouteTableAssociationState { + s.StatusMessage = &v + return s +} + type RunInstancesInput struct { _ struct{} `type:"structure"` @@ -85194,13 +97184,13 @@ type RunInstancesInput struct { // in the Amazon Elastic Compute Cloud User Guide. CpuOptions *CpuOptionsRequest `type:"structure"` - // The credit option for CPU usage of the T2 or T3 instance. Valid values are - // standard and unlimited. To change this attribute after launch, use ModifyInstanceCreditSpecification - // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html). + // The credit option for CPU usage of the burstable performance instance. Valid + // values are standard and unlimited. To change this attribute after launch, + // use ModifyInstanceCreditSpecification (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyInstanceCreditSpecification.html). // For more information, see Burstable Performance Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/burstable-performance-instances.html) // in the Amazon Elastic Compute Cloud User Guide. // - // Default: standard (T2 instances) or unlimited (T3 instances) + // Default: standard (T2 instances) or unlimited (T3/T3a instances) CreditSpecification *CreditSpecificationRequest `type:"structure"` // If you set this parameter to true, you can't terminate the instance using @@ -85321,6 +97311,10 @@ type RunInstancesInput struct { // MaxCount is a required field MaxCount *int64 `type:"integer" required:"true"` + // The metadata options for the instance. For more information, see Instance + // Metadata and User Data (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html). + MetadataOptions *InstanceMetadataOptionsRequest `type:"structure"` + // 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. @@ -85603,6 +97597,12 @@ func (s *RunInstancesInput) SetMaxCount(v int64) *RunInstancesInput { return s } +// SetMetadataOptions sets the MetadataOptions field's value. +func (s *RunInstancesInput) SetMetadataOptions(v *InstanceMetadataOptionsRequest) *RunInstancesInput { + s.MetadataOptions = v + return s +} + // SetMinCount sets the MinCount field's value. func (s *RunInstancesInput) SetMinCount(v int64) *RunInstancesInput { s.MinCount = &v @@ -86899,6 +98899,255 @@ func (s *ScheduledInstancesPrivateIpAddressConfig) SetPrivateIpAddress(v string) return s } +type SearchLocalGatewayRoutesInput 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 is a required field + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list" required:"true"` + + // The ID of the local gateway route table. + // + // LocalGatewayRouteTableId is a required field + LocalGatewayRouteTableId *string `type:"string" required:"true"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s SearchLocalGatewayRoutesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SearchLocalGatewayRoutesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SearchLocalGatewayRoutesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SearchLocalGatewayRoutesInput"} + if s.Filters == nil { + invalidParams.Add(request.NewErrParamRequired("Filters")) + } + if s.LocalGatewayRouteTableId == nil { + invalidParams.Add(request.NewErrParamRequired("LocalGatewayRouteTableId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *SearchLocalGatewayRoutesInput) SetDryRun(v bool) *SearchLocalGatewayRoutesInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *SearchLocalGatewayRoutesInput) SetFilters(v []*Filter) *SearchLocalGatewayRoutesInput { + s.Filters = v + return s +} + +// SetLocalGatewayRouteTableId sets the LocalGatewayRouteTableId field's value. +func (s *SearchLocalGatewayRoutesInput) SetLocalGatewayRouteTableId(v string) *SearchLocalGatewayRoutesInput { + s.LocalGatewayRouteTableId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *SearchLocalGatewayRoutesInput) SetMaxResults(v int64) *SearchLocalGatewayRoutesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *SearchLocalGatewayRoutesInput) SetNextToken(v string) *SearchLocalGatewayRoutesInput { + s.NextToken = &v + return s +} + +type SearchLocalGatewayRoutesOutput 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 routes. + Routes []*LocalGatewayRoute `locationName:"routeSet" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s SearchLocalGatewayRoutesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SearchLocalGatewayRoutesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *SearchLocalGatewayRoutesOutput) SetNextToken(v string) *SearchLocalGatewayRoutesOutput { + s.NextToken = &v + return s +} + +// SetRoutes sets the Routes field's value. +func (s *SearchLocalGatewayRoutesOutput) SetRoutes(v []*LocalGatewayRoute) *SearchLocalGatewayRoutesOutput { + s.Routes = v + return s +} + +type SearchTransitGatewayMulticastGroupsInput 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. The possible values are: + // + // * group-ip-address - The IP address of the transit gateway multicast group. + // + // * is-group-member - The resource is a group member. Valid values are true + // | false. + // + // * is-group-source - The resource is a group source. Valid values are true + // | false. + // + // * member-type - The member type. Valid values are igmp | static. + // + // * resource-id - The ID of the resource. + // + // * resource-type - The type of resource. Valid values are vpc | vpn | direct-connect-gateway + // | tgw-peering. + // + // * source-type - The source type. Valid values are igmp | static. + // + // * state - The state of the subnet association. Valid values are associated + // | associated | disassociated | disassociating. + // + // * subnet-id - The ID of the subnet. + // + // * transit-gateway-attachment-id - The id of the transit gateway attachment. + Filters []*Filter `locationName:"Filter" locationNameList:"Filter" type:"list"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"5" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `type:"string"` +} + +// String returns the string representation +func (s SearchTransitGatewayMulticastGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SearchTransitGatewayMulticastGroupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SearchTransitGatewayMulticastGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SearchTransitGatewayMulticastGroupsInput"} + if s.MaxResults != nil && *s.MaxResults < 5 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *SearchTransitGatewayMulticastGroupsInput) SetDryRun(v bool) *SearchTransitGatewayMulticastGroupsInput { + s.DryRun = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *SearchTransitGatewayMulticastGroupsInput) SetFilters(v []*Filter) *SearchTransitGatewayMulticastGroupsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *SearchTransitGatewayMulticastGroupsInput) SetMaxResults(v int64) *SearchTransitGatewayMulticastGroupsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *SearchTransitGatewayMulticastGroupsInput) SetNextToken(v string) *SearchTransitGatewayMulticastGroupsInput { + s.NextToken = &v + return s +} + +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *SearchTransitGatewayMulticastGroupsInput) SetTransitGatewayMulticastDomainId(v string) *SearchTransitGatewayMulticastGroupsInput { + s.TransitGatewayMulticastDomainId = &v + return s +} + +type SearchTransitGatewayMulticastGroupsOutput struct { + _ struct{} `type:"structure"` + + // Information about the transit gateway multicast group. + MulticastGroups []*TransitGatewayMulticastGroup `locationName:"multicastGroups" 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 SearchTransitGatewayMulticastGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SearchTransitGatewayMulticastGroupsOutput) GoString() string { + return s.String() +} + +// SetMulticastGroups sets the MulticastGroups field's value. +func (s *SearchTransitGatewayMulticastGroupsOutput) SetMulticastGroups(v []*TransitGatewayMulticastGroup) *SearchTransitGatewayMulticastGroupsOutput { + s.MulticastGroups = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *SearchTransitGatewayMulticastGroupsOutput) SetNextToken(v string) *SearchTransitGatewayMulticastGroupsOutput { + s.NextToken = &v + return s +} + type SearchTransitGatewayRoutesInput struct { _ struct{} `type:"structure"` @@ -87265,13 +99514,13 @@ type ServiceConfiguration struct { // to the service must first be accepted. AcceptanceRequired *bool `locationName:"acceptanceRequired" type:"boolean"` - // In the Availability Zones in which the service is available. + // The Availability Zones in which the service is available. AvailabilityZones []*string `locationName:"availabilityZoneSet" locationNameList:"item" type:"list"` // The DNS names for the service. BaseEndpointDnsNames []*string `locationName:"baseEndpointDnsNameSet" locationNameList:"item" type:"list"` - // Indicates whether the service manages it's VPC endpoints. Management of the + // Indicates whether the service manages its VPC endpoints. Management of the // service VPC endpoints using the VPC endpoint API is restricted. ManagesVpcEndpoints *bool `locationName:"managesVpcEndpoints" type:"boolean"` @@ -87281,6 +99530,9 @@ type ServiceConfiguration struct { // The private DNS name for the service. PrivateDnsName *string `locationName:"privateDnsName" type:"string"` + // Information about the endpoint service private DNS name configuration. + PrivateDnsNameConfiguration *PrivateDnsNameConfiguration `locationName:"privateDnsNameConfiguration" type:"structure"` + // The ID of the service. ServiceId *string `locationName:"serviceId" type:"string"` @@ -87343,6 +99595,12 @@ func (s *ServiceConfiguration) SetPrivateDnsName(v string) *ServiceConfiguration return s } +// SetPrivateDnsNameConfiguration sets the PrivateDnsNameConfiguration field's value. +func (s *ServiceConfiguration) SetPrivateDnsNameConfiguration(v *PrivateDnsNameConfiguration) *ServiceConfiguration { + s.PrivateDnsNameConfiguration = v + return s +} + // SetServiceId sets the ServiceId field's value. func (s *ServiceConfiguration) SetServiceId(v string) *ServiceConfiguration { s.ServiceId = &v @@ -87387,7 +99645,7 @@ type ServiceDetail struct { // The DNS names for the service. BaseEndpointDnsNames []*string `locationName:"baseEndpointDnsNameSet" locationNameList:"item" type:"list"` - // Indicates whether the service manages it's VPC endpoints. Management of the + // Indicates whether the service manages its VPC endpoints. Management of the // service VPC endpoints using the VPC endpoint API is restricted. ManagesVpcEndpoints *bool `locationName:"managesVpcEndpoints" type:"boolean"` @@ -87397,6 +99655,12 @@ type ServiceDetail struct { // The private DNS name for the service. PrivateDnsName *string `locationName:"privateDnsName" type:"string"` + // The verification state of the VPC endpoint service. + // + // Consumers of the endpoint service cannot use the private name when the state + // is not verified. + PrivateDnsNameVerificationState *string `locationName:"privateDnsNameVerificationState" type:"string" enum:"DnsNameState"` + // The ID of the endpoint service. ServiceId *string `locationName:"serviceId" type:"string"` @@ -87459,6 +99723,12 @@ func (s *ServiceDetail) SetPrivateDnsName(v string) *ServiceDetail { return s } +// SetPrivateDnsNameVerificationState sets the PrivateDnsNameVerificationState field's value. +func (s *ServiceDetail) SetPrivateDnsNameVerificationState(v string) *ServiceDetail { + s.PrivateDnsNameVerificationState = &v + return s +} + // SetServiceId sets the ServiceId field's value. func (s *ServiceDetail) SetServiceId(v string) *ServiceDetail { s.ServiceId = &v @@ -88454,6 +100724,9 @@ type SpotFleetRequestConfig struct { // The state of the Spot Fleet request. SpotFleetRequestState *string `locationName:"spotFleetRequestState" type:"string" enum:"BatchState"` + + // The tags for a Spot Fleet resource. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` } // String returns the string representation @@ -88496,6 +100769,12 @@ func (s *SpotFleetRequestConfig) SetSpotFleetRequestState(v string) *SpotFleetRe return s } +// SetTags sets the Tags field's value. +func (s *SpotFleetRequestConfig) SetTags(v []*Tag) *SpotFleetRequestConfig { + s.Tags = v + return s +} + // Describes the configuration of a Spot Fleet request. type SpotFleetRequestConfigData struct { _ struct{} `type:"structure"` @@ -88615,6 +100894,13 @@ type SpotFleetRequestConfigData struct { // The default is the On-Demand price. SpotPrice *string `locationName:"spotPrice" type:"string"` + // The key-value pair for tagging the Spot Fleet request on creation. The value + // for ResourceType must be spot-fleet-request, otherwise the Spot Fleet request + // fails. To tag instances at launch, specify the tags in the launch template + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-launch-templates.html#create-launch-template). + // For information about tagging after launch, see Tagging Your Resources (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-resources). + TagSpecifications []*TagSpecification `locationName:"TagSpecification" locationNameList:"item" type:"list"` + // The number of units to request for the Spot Fleet. 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 @@ -88792,6 +101078,12 @@ func (s *SpotFleetRequestConfigData) SetSpotPrice(v string) *SpotFleetRequestCon return s } +// SetTagSpecifications sets the TagSpecifications field's value. +func (s *SpotFleetRequestConfigData) SetTagSpecifications(v []*TagSpecification) *SpotFleetRequestConfigData { + s.TagSpecifications = v + return s +} + // SetTargetCapacity sets the TargetCapacity field's value. func (s *SpotFleetRequestConfigData) SetTargetCapacity(v int64) *SpotFleetRequestConfigData { s.TargetCapacity = &v @@ -88826,8 +101118,8 @@ func (s *SpotFleetRequestConfigData) SetValidUntil(v time.Time) *SpotFleetReques type SpotFleetTagSpecification struct { _ struct{} `type:"structure"` - // The type of resource. Currently, the only resource type that is supported - // is instance. + // The type of resource. Currently, the only resource types that are supported + // are spot-fleet-request and instance. ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` // The tags. @@ -89208,14 +101500,14 @@ type SpotOptions struct { // Indicates how to allocate the target Spot Instance capacity across the Spot // Instance pools specified by the EC2 Fleet. // - // If the allocation strategy is lowestPrice, EC2 Fleet launches instances from - // the Spot Instance pools with the lowest price. This is the default allocation + // If the allocation strategy is lowest-price, EC2 Fleet launches instances + // from the Spot Instance pools with the lowest price. This is the default allocation // strategy. // // If the allocation strategy is diversified, EC2 Fleet launches instances from - // all the Spot Instance pools that you specify. + // all of the Spot Instance pools that you specify. // - // If the allocation strategy is capacityOptimized, EC2 Fleet launches instances + // If the allocation strategy is capacity-optimized, EC2 Fleet launches instances // from Spot Instance pools with optimal capacity for the number of instances // that are launching. AllocationStrategy *string `locationName:"allocationStrategy" type:"string" enum:"SpotAllocationStrategy"` @@ -89224,7 +101516,7 @@ type SpotOptions struct { InstanceInterruptionBehavior *string `locationName:"instanceInterruptionBehavior" type:"string" enum:"SpotInstanceInterruptionBehavior"` // The number of Spot pools across which to allocate your target Spot capacity. - // Valid only when AllocationStrategy is set to lowestPrice. EC2 Fleet selects + // Valid only when AllocationStrategy is set to lowest-price. EC2 Fleet selects // the cheapest Spot pools and evenly allocates your target Spot capacity across // the number of Spot pools that you specify. InstancePoolsToUseCount *int64 `locationName:"instancePoolsToUseCount" type:"integer"` @@ -89237,11 +101529,11 @@ type SpotOptions struct { MinTargetCapacity *int64 `locationName:"minTargetCapacity" type:"integer"` // Indicates that the fleet launches all Spot Instances into a single Availability - // Zone. + // Zone. Supported only for fleets of type instant. SingleAvailabilityZone *bool `locationName:"singleAvailabilityZone" type:"boolean"` // Indicates that the fleet uses a single instance type to launch all Spot Instances - // in the fleet. + // in the fleet. Supported only for fleets of type instant. SingleInstanceType *bool `locationName:"singleInstanceType" type:"boolean"` } @@ -89304,14 +101596,14 @@ type SpotOptionsRequest struct { // Indicates how to allocate the target Spot Instance capacity across the Spot // Instance pools specified by the EC2 Fleet. // - // If the allocation strategy is lowestPrice, EC2 Fleet launches instances from - // the Spot Instance pools with the lowest price. This is the default allocation + // If the allocation strategy is lowest-price, EC2 Fleet launches instances + // from the Spot Instance pools with the lowest price. This is the default allocation // strategy. // // If the allocation strategy is diversified, EC2 Fleet launches instances from - // all the Spot Instance pools that you specify. + // all of the Spot Instance pools that you specify. // - // If the allocation strategy is capacityOptimized, EC2 Fleet launches instances + // If the allocation strategy is capacity-optimized, EC2 Fleet launches instances // from Spot Instance pools with optimal capacity for the number of instances // that are launching. AllocationStrategy *string `type:"string" enum:"SpotAllocationStrategy"` @@ -89333,11 +101625,11 @@ type SpotOptionsRequest struct { MinTargetCapacity *int64 `type:"integer"` // Indicates that the fleet launches all Spot Instances into a single Availability - // Zone. + // Zone. Supported only for fleets of type instant. SingleAvailabilityZone *bool `type:"boolean"` // Indicates that the fleet uses a single instance type to launch all Spot Instances - // in the fleet. + // in the fleet. Supported only for fleets of type instant. SingleInstanceType *bool `type:"boolean"` } @@ -89726,6 +102018,79 @@ func (s *StartInstancesOutput) SetStartingInstances(v []*InstanceStateChange) *S return s } +type StartVpcEndpointServicePrivateDnsVerificationInput 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 endpoint service. + // + // ServiceId is a required field + ServiceId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s StartVpcEndpointServicePrivateDnsVerificationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartVpcEndpointServicePrivateDnsVerificationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartVpcEndpointServicePrivateDnsVerificationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartVpcEndpointServicePrivateDnsVerificationInput"} + if s.ServiceId == nil { + invalidParams.Add(request.NewErrParamRequired("ServiceId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDryRun sets the DryRun field's value. +func (s *StartVpcEndpointServicePrivateDnsVerificationInput) SetDryRun(v bool) *StartVpcEndpointServicePrivateDnsVerificationInput { + s.DryRun = &v + return s +} + +// SetServiceId sets the ServiceId field's value. +func (s *StartVpcEndpointServicePrivateDnsVerificationInput) SetServiceId(v string) *StartVpcEndpointServicePrivateDnsVerificationInput { + s.ServiceId = &v + return s +} + +type StartVpcEndpointServicePrivateDnsVerificationOutput struct { + _ struct{} `type:"structure"` + + // Returns true if the request succeeds; otherwise, it returns an error. + ReturnValue *bool `locationName:"return" type:"boolean"` +} + +// String returns the string representation +func (s StartVpcEndpointServicePrivateDnsVerificationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartVpcEndpointServicePrivateDnsVerificationOutput) GoString() string { + return s.String() +} + +// SetReturnValue sets the ReturnValue field's value. +func (s *StartVpcEndpointServicePrivateDnsVerificationOutput) SetReturnValue(v bool) *StartVpcEndpointServicePrivateDnsVerificationOutput { + s.ReturnValue = &v + return s +} + // Describes a state change. type StateReason struct { _ struct{} `type:"structure"` @@ -89986,6 +102351,9 @@ type Subnet struct { // address. MapPublicIpOnLaunch *bool `locationName:"mapPublicIpOnLaunch" type:"boolean"` + // The Amazon Resource Name (ARN) of the Outpost. + OutpostArn *string `locationName:"outpostArn" type:"string"` + // The ID of the AWS account that owns the subnet. OwnerId *string `locationName:"ownerId" type:"string"` @@ -90063,6 +102431,12 @@ func (s *Subnet) SetMapPublicIpOnLaunch(v bool) *Subnet { return s } +// SetOutpostArn sets the OutpostArn field's value. +func (s *Subnet) SetOutpostArn(v string) *Subnet { + s.OutpostArn = &v + return s +} + // SetOwnerId sets the OwnerId field's value. func (s *Subnet) SetOwnerId(v string) *Subnet { s.OwnerId = &v @@ -90099,6 +102473,39 @@ func (s *Subnet) SetVpcId(v string) *Subnet { return s } +// Describes the subnet association with the transit gateway multicast domain. +type SubnetAssociation struct { + _ struct{} `type:"structure"` + + // The state of the subnet association. + State *string `locationName:"state" type:"string" enum:"TransitGatewayMulitcastDomainAssociationState"` + + // The ID of the subnet. + SubnetId *string `locationName:"subnetId" type:"string"` +} + +// String returns the string representation +func (s SubnetAssociation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SubnetAssociation) GoString() string { + return s.String() +} + +// SetState sets the State field's value. +func (s *SubnetAssociation) SetState(v string) *SubnetAssociation { + s.State = &v + return s +} + +// SetSubnetId sets the SubnetId field's value. +func (s *SubnetAssociation) SetSubnetId(v string) *SubnetAssociation { + s.SubnetId = &v + return s +} + // Describes the state of a CIDR block. type SubnetCidrBlockState struct { _ struct{} `type:"structure"` @@ -90174,8 +102581,8 @@ func (s *SubnetIpv6CidrBlockAssociation) SetIpv6CidrBlockState(v *SubnetCidrBloc return s } -// Describes the T2 or T3 instance whose credit option for CPU usage was successfully -// modified. +// Describes the burstable performance instance whose credit option for CPU +// usage was successfully modified. type SuccessfulInstanceCreditSpecificationItem struct { _ struct{} `type:"structure"` @@ -90199,6 +102606,30 @@ func (s *SuccessfulInstanceCreditSpecificationItem) SetInstanceId(v string) *Suc return s } +// Describes a Reserved Instance whose queued purchase was successfully deleted. +type SuccessfulQueuedPurchaseDeletion struct { + _ struct{} `type:"structure"` + + // The ID of the Reserved Instance. + ReservedInstancesId *string `locationName:"reservedInstancesId" type:"string"` +} + +// String returns the string representation +func (s SuccessfulQueuedPurchaseDeletion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SuccessfulQueuedPurchaseDeletion) GoString() string { + return s.String() +} + +// SetReservedInstancesId sets the ReservedInstancesId field's value. +func (s *SuccessfulQueuedPurchaseDeletion) SetReservedInstancesId(v string) *SuccessfulQueuedPurchaseDeletion { + s.ReservedInstancesId = &v + return s +} + // Describes a tag. type Tag struct { _ struct{} `type:"structure"` @@ -90295,10 +102726,12 @@ type TagSpecification struct { // The type of resource to tag. Currently, the resource types that support tagging // on creation are: capacity-reservation | client-vpn-endpoint | dedicated-host - // | fleet | instance | launch-template | snapshot | transit-gateway | transit-gateway-attachment - // | transit-gateway-route-table | volume. + // | fleet | fpga-image | instance | key-pair | launch-template | placement-group + // | snapshot | traffic-mirror-filter | traffic-mirror-session | traffic-mirror-target + // | transit-gateway | transit-gateway-attachment | transit-gateway-route-table + // | volume. // - // To tag a resource after it has been created, see CreateTags. + // To tag a resource after it has been created, see CreateTags (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html). ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` // The tags to apply to the resource. @@ -90334,13 +102767,13 @@ func (s *TagSpecification) SetTags(v []*Tag) *TagSpecification { // later. // // You can use the On-Demand Instance MaxTotalPrice parameter, the Spot Instance -// MaxTotalPrice, or both to ensure your fleet cost does not exceed your budget. -// If you set a maximum price per hour for the On-Demand Instances and Spot -// Instances in your request, EC2 Fleet will launch instances until it reaches -// the maximum amount you're willing to pay. When the maximum amount you're -// willing to pay is reached, the fleet stops launching instances even if it -// hasn’t met the target capacity. The MaxTotalPrice parameters are located -// in and +// MaxTotalPrice, or both to ensure that your fleet cost does not exceed your +// budget. If you set a maximum price per hour for the On-Demand Instances and +// Spot Instances in your request, EC2 Fleet will launch instances until it +// reaches the maximum amount that you're willing to pay. When the maximum amount +// you're willing to pay is reached, the fleet stops launching instances even +// if it hasn’t met the target capacity. The MaxTotalPrice parameters are +// located in and type TargetCapacitySpecification struct { _ struct{} `type:"structure"` @@ -90403,9 +102836,9 @@ func (s *TargetCapacitySpecification) SetTotalTargetCapacity(v int64) *TargetCap // MaxTotalPrice parameter, or both parameters to ensure that your fleet cost // does not exceed your budget. If you set a maximum price per hour for the // On-Demand Instances and Spot Instances in your request, EC2 Fleet will launch -// instances until it reaches the maximum amount you're willing to pay. When -// the maximum amount you're willing to pay is reached, the fleet stops launching -// instances even if it hasn’t met the target capacity. The MaxTotalPrice +// instances until it reaches the maximum amount that you're willing to pay. +// When the maximum amount you're willing to pay is reached, the fleet stops +// launching instances even if it hasn’t met the target capacity. The MaxTotalPrice // parameters are located in and . type TargetCapacitySpecificationRequest struct { _ struct{} `type:"structure"` @@ -91716,6 +104149,451 @@ func (s *TransitGatewayAttachmentPropagation) SetTransitGatewayRouteTableId(v st return s } +// Describes the deregistered transit gateway multicast group members. +type TransitGatewayMulticastDeregisteredGroupMembers struct { + _ struct{} `type:"structure"` + + // The network interface IDs of the deregistered members. + DeregisteredNetworkInterfaceIds []*string `locationName:"deregisteredNetworkInterfaceIds" locationNameList:"item" type:"list"` + + // The IP address assigned to the transit gateway multicast group. + GroupIpAddress *string `locationName:"groupIpAddress" type:"string"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `locationName:"transitGatewayMulticastDomainId" type:"string"` +} + +// String returns the string representation +func (s TransitGatewayMulticastDeregisteredGroupMembers) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayMulticastDeregisteredGroupMembers) GoString() string { + return s.String() +} + +// SetDeregisteredNetworkInterfaceIds sets the DeregisteredNetworkInterfaceIds field's value. +func (s *TransitGatewayMulticastDeregisteredGroupMembers) SetDeregisteredNetworkInterfaceIds(v []*string) *TransitGatewayMulticastDeregisteredGroupMembers { + s.DeregisteredNetworkInterfaceIds = v + return s +} + +// SetGroupIpAddress sets the GroupIpAddress field's value. +func (s *TransitGatewayMulticastDeregisteredGroupMembers) SetGroupIpAddress(v string) *TransitGatewayMulticastDeregisteredGroupMembers { + s.GroupIpAddress = &v + return s +} + +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *TransitGatewayMulticastDeregisteredGroupMembers) SetTransitGatewayMulticastDomainId(v string) *TransitGatewayMulticastDeregisteredGroupMembers { + s.TransitGatewayMulticastDomainId = &v + return s +} + +// Describes the deregistered transit gateway multicast group sources. +type TransitGatewayMulticastDeregisteredGroupSources struct { + _ struct{} `type:"structure"` + + // The network interface IDs of the non-registered members. + DeregisteredNetworkInterfaceIds []*string `locationName:"deregisteredNetworkInterfaceIds" locationNameList:"item" type:"list"` + + // The IP address assigned to the transit gateway multicast group. + GroupIpAddress *string `locationName:"groupIpAddress" type:"string"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `locationName:"transitGatewayMulticastDomainId" type:"string"` +} + +// String returns the string representation +func (s TransitGatewayMulticastDeregisteredGroupSources) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayMulticastDeregisteredGroupSources) GoString() string { + return s.String() +} + +// SetDeregisteredNetworkInterfaceIds sets the DeregisteredNetworkInterfaceIds field's value. +func (s *TransitGatewayMulticastDeregisteredGroupSources) SetDeregisteredNetworkInterfaceIds(v []*string) *TransitGatewayMulticastDeregisteredGroupSources { + s.DeregisteredNetworkInterfaceIds = v + return s +} + +// SetGroupIpAddress sets the GroupIpAddress field's value. +func (s *TransitGatewayMulticastDeregisteredGroupSources) SetGroupIpAddress(v string) *TransitGatewayMulticastDeregisteredGroupSources { + s.GroupIpAddress = &v + return s +} + +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *TransitGatewayMulticastDeregisteredGroupSources) SetTransitGatewayMulticastDomainId(v string) *TransitGatewayMulticastDeregisteredGroupSources { + s.TransitGatewayMulticastDomainId = &v + return s +} + +// Describes the transit gateway multicast domain. +type TransitGatewayMulticastDomain struct { + _ struct{} `type:"structure"` + + // The time the transit gateway multicast domain was created. + CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` + + // The state of the transit gateway multicast domain. + State *string `locationName:"state" type:"string" enum:"TransitGatewayMulticastDomainState"` + + // The tags for the transit gateway multicast domain. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The ID of the transit gateway. + TransitGatewayId *string `locationName:"transitGatewayId" type:"string"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `locationName:"transitGatewayMulticastDomainId" type:"string"` +} + +// String returns the string representation +func (s TransitGatewayMulticastDomain) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayMulticastDomain) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *TransitGatewayMulticastDomain) SetCreationTime(v time.Time) *TransitGatewayMulticastDomain { + s.CreationTime = &v + return s +} + +// SetState sets the State field's value. +func (s *TransitGatewayMulticastDomain) SetState(v string) *TransitGatewayMulticastDomain { + s.State = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *TransitGatewayMulticastDomain) SetTags(v []*Tag) *TransitGatewayMulticastDomain { + s.Tags = v + return s +} + +// SetTransitGatewayId sets the TransitGatewayId field's value. +func (s *TransitGatewayMulticastDomain) SetTransitGatewayId(v string) *TransitGatewayMulticastDomain { + s.TransitGatewayId = &v + return s +} + +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *TransitGatewayMulticastDomain) SetTransitGatewayMulticastDomainId(v string) *TransitGatewayMulticastDomain { + s.TransitGatewayMulticastDomainId = &v + return s +} + +// Describes the resources associated with the transit gateway multicast domain. +type TransitGatewayMulticastDomainAssociation struct { + _ struct{} `type:"structure"` + + // The ID of the resource. + ResourceId *string `locationName:"resourceId" type:"string"` + + // The type of resource, for example a VPC attachment. + ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"` + + // The subnet associated with the transit gateway multicast domain. + Subnet *SubnetAssociation `locationName:"subnet" type:"structure"` + + // The ID of the transit gateway attachment. + TransitGatewayAttachmentId *string `locationName:"transitGatewayAttachmentId" type:"string"` +} + +// String returns the string representation +func (s TransitGatewayMulticastDomainAssociation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayMulticastDomainAssociation) GoString() string { + return s.String() +} + +// SetResourceId sets the ResourceId field's value. +func (s *TransitGatewayMulticastDomainAssociation) SetResourceId(v string) *TransitGatewayMulticastDomainAssociation { + s.ResourceId = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *TransitGatewayMulticastDomainAssociation) SetResourceType(v string) *TransitGatewayMulticastDomainAssociation { + s.ResourceType = &v + return s +} + +// SetSubnet sets the Subnet field's value. +func (s *TransitGatewayMulticastDomainAssociation) SetSubnet(v *SubnetAssociation) *TransitGatewayMulticastDomainAssociation { + s.Subnet = v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *TransitGatewayMulticastDomainAssociation) SetTransitGatewayAttachmentId(v string) *TransitGatewayMulticastDomainAssociation { + s.TransitGatewayAttachmentId = &v + return s +} + +// Describes the multicast domain associations. +type TransitGatewayMulticastDomainAssociations struct { + _ struct{} `type:"structure"` + + // The ID of the resource. + ResourceId *string `locationName:"resourceId" type:"string"` + + // The type of resource, for example a VPC attachment. + ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"` + + // The subnets associated with the multicast domain. + Subnets []*SubnetAssociation `locationName:"subnets" locationNameList:"item" type:"list"` + + // The ID of the transit gateway attachment. + TransitGatewayAttachmentId *string `locationName:"transitGatewayAttachmentId" type:"string"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `locationName:"transitGatewayMulticastDomainId" type:"string"` +} + +// String returns the string representation +func (s TransitGatewayMulticastDomainAssociations) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayMulticastDomainAssociations) GoString() string { + return s.String() +} + +// SetResourceId sets the ResourceId field's value. +func (s *TransitGatewayMulticastDomainAssociations) SetResourceId(v string) *TransitGatewayMulticastDomainAssociations { + s.ResourceId = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *TransitGatewayMulticastDomainAssociations) SetResourceType(v string) *TransitGatewayMulticastDomainAssociations { + s.ResourceType = &v + return s +} + +// SetSubnets sets the Subnets field's value. +func (s *TransitGatewayMulticastDomainAssociations) SetSubnets(v []*SubnetAssociation) *TransitGatewayMulticastDomainAssociations { + s.Subnets = v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *TransitGatewayMulticastDomainAssociations) SetTransitGatewayAttachmentId(v string) *TransitGatewayMulticastDomainAssociations { + s.TransitGatewayAttachmentId = &v + return s +} + +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *TransitGatewayMulticastDomainAssociations) SetTransitGatewayMulticastDomainId(v string) *TransitGatewayMulticastDomainAssociations { + s.TransitGatewayMulticastDomainId = &v + return s +} + +// Describes the transit gateway multicast group resources. +type TransitGatewayMulticastGroup struct { + _ struct{} `type:"structure"` + + // The IP address assigned to the transit gateway multicast group. + GroupIpAddress *string `locationName:"groupIpAddress" type:"string"` + + // Indicates that the resource is a transit gateway multicast group member. + GroupMember *bool `locationName:"groupMember" type:"boolean"` + + // Indicates that the resource is a transit gateway multicast group member. + GroupSource *bool `locationName:"groupSource" type:"boolean"` + + // The member type (for example, static). + MemberType *string `locationName:"memberType" type:"string" enum:"MembershipType"` + + // The ID of the transit gateway attachment. + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` + + // The ID of the resource. + ResourceId *string `locationName:"resourceId" type:"string"` + + // The type of resource, for example a VPC attachment. + ResourceType *string `locationName:"resourceType" type:"string" enum:"TransitGatewayAttachmentResourceType"` + + // The source type. + SourceType *string `locationName:"sourceType" type:"string" enum:"MembershipType"` + + // The ID of the subnet. + SubnetId *string `locationName:"subnetId" type:"string"` + + // The ID of the transit gateway attachment. + TransitGatewayAttachmentId *string `locationName:"transitGatewayAttachmentId" type:"string"` +} + +// String returns the string representation +func (s TransitGatewayMulticastGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayMulticastGroup) GoString() string { + return s.String() +} + +// SetGroupIpAddress sets the GroupIpAddress field's value. +func (s *TransitGatewayMulticastGroup) SetGroupIpAddress(v string) *TransitGatewayMulticastGroup { + s.GroupIpAddress = &v + return s +} + +// SetGroupMember sets the GroupMember field's value. +func (s *TransitGatewayMulticastGroup) SetGroupMember(v bool) *TransitGatewayMulticastGroup { + s.GroupMember = &v + return s +} + +// SetGroupSource sets the GroupSource field's value. +func (s *TransitGatewayMulticastGroup) SetGroupSource(v bool) *TransitGatewayMulticastGroup { + s.GroupSource = &v + return s +} + +// SetMemberType sets the MemberType field's value. +func (s *TransitGatewayMulticastGroup) SetMemberType(v string) *TransitGatewayMulticastGroup { + s.MemberType = &v + return s +} + +// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. +func (s *TransitGatewayMulticastGroup) SetNetworkInterfaceId(v string) *TransitGatewayMulticastGroup { + s.NetworkInterfaceId = &v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *TransitGatewayMulticastGroup) SetResourceId(v string) *TransitGatewayMulticastGroup { + s.ResourceId = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *TransitGatewayMulticastGroup) SetResourceType(v string) *TransitGatewayMulticastGroup { + s.ResourceType = &v + return s +} + +// SetSourceType sets the SourceType field's value. +func (s *TransitGatewayMulticastGroup) SetSourceType(v string) *TransitGatewayMulticastGroup { + s.SourceType = &v + return s +} + +// SetSubnetId sets the SubnetId field's value. +func (s *TransitGatewayMulticastGroup) SetSubnetId(v string) *TransitGatewayMulticastGroup { + s.SubnetId = &v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *TransitGatewayMulticastGroup) SetTransitGatewayAttachmentId(v string) *TransitGatewayMulticastGroup { + s.TransitGatewayAttachmentId = &v + return s +} + +// Describes the registered transit gateway multicast group members. +type TransitGatewayMulticastRegisteredGroupMembers struct { + _ struct{} `type:"structure"` + + // The IP address assigned to the transit gateway multicast group. + GroupIpAddress *string `locationName:"groupIpAddress" type:"string"` + + // The ID of the registered network interfaces. + RegisteredNetworkInterfaceIds []*string `locationName:"registeredNetworkInterfaceIds" locationNameList:"item" type:"list"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `locationName:"transitGatewayMulticastDomainId" type:"string"` +} + +// String returns the string representation +func (s TransitGatewayMulticastRegisteredGroupMembers) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayMulticastRegisteredGroupMembers) GoString() string { + return s.String() +} + +// SetGroupIpAddress sets the GroupIpAddress field's value. +func (s *TransitGatewayMulticastRegisteredGroupMembers) SetGroupIpAddress(v string) *TransitGatewayMulticastRegisteredGroupMembers { + s.GroupIpAddress = &v + return s +} + +// SetRegisteredNetworkInterfaceIds sets the RegisteredNetworkInterfaceIds field's value. +func (s *TransitGatewayMulticastRegisteredGroupMembers) SetRegisteredNetworkInterfaceIds(v []*string) *TransitGatewayMulticastRegisteredGroupMembers { + s.RegisteredNetworkInterfaceIds = v + return s +} + +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *TransitGatewayMulticastRegisteredGroupMembers) SetTransitGatewayMulticastDomainId(v string) *TransitGatewayMulticastRegisteredGroupMembers { + s.TransitGatewayMulticastDomainId = &v + return s +} + +// Describes the members registered with the transit gateway multicast group. +type TransitGatewayMulticastRegisteredGroupSources struct { + _ struct{} `type:"structure"` + + // The IP address assigned to the transit gateway multicast group. + GroupIpAddress *string `locationName:"groupIpAddress" type:"string"` + + // The IDs of the network interfaces members registered with the transit gateway + // multicast group. + RegisteredNetworkInterfaceIds []*string `locationName:"registeredNetworkInterfaceIds" locationNameList:"item" type:"list"` + + // The ID of the transit gateway multicast domain. + TransitGatewayMulticastDomainId *string `locationName:"transitGatewayMulticastDomainId" type:"string"` +} + +// String returns the string representation +func (s TransitGatewayMulticastRegisteredGroupSources) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayMulticastRegisteredGroupSources) GoString() string { + return s.String() +} + +// SetGroupIpAddress sets the GroupIpAddress field's value. +func (s *TransitGatewayMulticastRegisteredGroupSources) SetGroupIpAddress(v string) *TransitGatewayMulticastRegisteredGroupSources { + s.GroupIpAddress = &v + return s +} + +// SetRegisteredNetworkInterfaceIds sets the RegisteredNetworkInterfaceIds field's value. +func (s *TransitGatewayMulticastRegisteredGroupSources) SetRegisteredNetworkInterfaceIds(v []*string) *TransitGatewayMulticastRegisteredGroupSources { + s.RegisteredNetworkInterfaceIds = v + return s +} + +// SetTransitGatewayMulticastDomainId sets the TransitGatewayMulticastDomainId field's value. +func (s *TransitGatewayMulticastRegisteredGroupSources) SetTransitGatewayMulticastDomainId(v string) *TransitGatewayMulticastRegisteredGroupSources { + s.TransitGatewayMulticastDomainId = &v + return s +} + // Describes the options for a transit gateway. type TransitGatewayOptions struct { _ struct{} `type:"structure"` @@ -91742,6 +104620,9 @@ type TransitGatewayOptions struct { // Indicates whether DNS support is enabled. DnsSupport *string `locationName:"dnsSupport" type:"string" enum:"DnsSupportValue"` + // Indicates whether multicast is enabled on the transit gateway + MulticastSupport *string `locationName:"multicastSupport" type:"string" enum:"MulticastSupportValue"` + // The ID of the default propagation route table. PropagationDefaultRouteTableId *string `locationName:"propagationDefaultRouteTableId" type:"string"` @@ -91795,6 +104676,12 @@ func (s *TransitGatewayOptions) SetDnsSupport(v string) *TransitGatewayOptions { return s } +// SetMulticastSupport sets the MulticastSupport field's value. +func (s *TransitGatewayOptions) SetMulticastSupport(v string) *TransitGatewayOptions { + s.MulticastSupport = &v + return s +} + // SetPropagationDefaultRouteTableId sets the PropagationDefaultRouteTableId field's value. func (s *TransitGatewayOptions) SetPropagationDefaultRouteTableId(v string) *TransitGatewayOptions { s.PropagationDefaultRouteTableId = &v @@ -91807,6 +104694,84 @@ func (s *TransitGatewayOptions) SetVpnEcmpSupport(v string) *TransitGatewayOptio return s } +// Describes the transit gateway peering attachment. +type TransitGatewayPeeringAttachment struct { + _ struct{} `type:"structure"` + + // Information about the accepter transit gateway. + AccepterTgwInfo *PeeringTgwInfo `locationName:"accepterTgwInfo" type:"structure"` + + // The time the transit gateway peering attachment was created. + CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` + + // Information about the requester transit gateway. + RequesterTgwInfo *PeeringTgwInfo `locationName:"requesterTgwInfo" type:"structure"` + + // The state of the transit gateway peering attachment. + State *string `locationName:"state" type:"string" enum:"TransitGatewayAttachmentState"` + + // The status of the transit gateway peering attachment. + Status *PeeringAttachmentStatus `locationName:"status" type:"structure"` + + // The tags for the transit gateway peering attachment. + Tags []*Tag `locationName:"tagSet" locationNameList:"item" type:"list"` + + // The ID of the transit gateway peering attachment. + TransitGatewayAttachmentId *string `locationName:"transitGatewayAttachmentId" type:"string"` +} + +// String returns the string representation +func (s TransitGatewayPeeringAttachment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransitGatewayPeeringAttachment) GoString() string { + return s.String() +} + +// SetAccepterTgwInfo sets the AccepterTgwInfo field's value. +func (s *TransitGatewayPeeringAttachment) SetAccepterTgwInfo(v *PeeringTgwInfo) *TransitGatewayPeeringAttachment { + s.AccepterTgwInfo = v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *TransitGatewayPeeringAttachment) SetCreationTime(v time.Time) *TransitGatewayPeeringAttachment { + s.CreationTime = &v + return s +} + +// SetRequesterTgwInfo sets the RequesterTgwInfo field's value. +func (s *TransitGatewayPeeringAttachment) SetRequesterTgwInfo(v *PeeringTgwInfo) *TransitGatewayPeeringAttachment { + s.RequesterTgwInfo = v + return s +} + +// SetState sets the State field's value. +func (s *TransitGatewayPeeringAttachment) SetState(v string) *TransitGatewayPeeringAttachment { + s.State = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *TransitGatewayPeeringAttachment) SetStatus(v *PeeringAttachmentStatus) *TransitGatewayPeeringAttachment { + s.Status = v + return s +} + +// SetTags sets the Tags field's value. +func (s *TransitGatewayPeeringAttachment) SetTags(v []*Tag) *TransitGatewayPeeringAttachment { + s.Tags = v + return s +} + +// SetTransitGatewayAttachmentId sets the TransitGatewayAttachmentId field's value. +func (s *TransitGatewayPeeringAttachment) SetTransitGatewayAttachmentId(v string) *TransitGatewayPeeringAttachment { + s.TransitGatewayAttachmentId = &v + return s +} + // Describes route propagation. type TransitGatewayPropagation struct { _ struct{} `type:"structure"` @@ -91891,6 +104856,9 @@ type TransitGatewayRequestOptions struct { // Enable or disable DNS support. DnsSupport *string `type:"string" enum:"DnsSupportValue"` + // Indicates whether multicast is enabled on the transit gateway + MulticastSupport *string `type:"string" enum:"MulticastSupportValue"` + // Enable or disable Equal Cost Multipath Protocol support. VpnEcmpSupport *string `type:"string" enum:"VpnEcmpSupportValue"` } @@ -91935,6 +104903,12 @@ func (s *TransitGatewayRequestOptions) SetDnsSupport(v string) *TransitGatewayRe return s } +// SetMulticastSupport sets the MulticastSupport field's value. +func (s *TransitGatewayRequestOptions) SetMulticastSupport(v string) *TransitGatewayRequestOptions { + s.MulticastSupport = &v + return s +} + // SetVpnEcmpSupport sets the VpnEcmpSupport field's value. func (s *TransitGatewayRequestOptions) SetVpnEcmpSupport(v string) *TransitGatewayRequestOptions { s.VpnEcmpSupport = &v @@ -92319,7 +105293,7 @@ type TransitGatewayVpcAttachmentOptions struct { // Indicates whether DNS support is enabled. DnsSupport *string `locationName:"dnsSupport" type:"string" enum:"DnsSupportValue"` - // Indicates whether IPv6 support is enabled. + // Indicates whether IPv6 support is disabled. Ipv6Support *string `locationName:"ipv6Support" type:"string" enum:"Ipv6SupportValue"` } @@ -92734,13 +105708,13 @@ func (s *UnmonitorInstancesOutput) SetInstanceMonitorings(v []*InstanceMonitorin return s } -// Describes the T2 or T3 instance whose credit option for CPU usage was not -// modified. +// Describes the burstable performance instance whose credit option for CPU +// usage was not modified. type UnsuccessfulInstanceCreditSpecificationItem struct { _ struct{} `type:"structure"` - // The applicable error for the T2 or T3 instance whose credit option for CPU - // usage was not modified. + // The applicable error for the burstable performance instance whose credit + // option for CPU usage was not modified. Error *UnsuccessfulInstanceCreditSpecificationItemError `locationName:"error" type:"structure"` // The ID of the instance. @@ -92769,8 +105743,8 @@ func (s *UnsuccessfulInstanceCreditSpecificationItem) SetInstanceId(v string) *U return s } -// Information about the error for the T2 or T3 instance whose credit option -// for CPU usage was not modified. +// Information about the error for the burstable performance instance whose +// credit option for CPU usage was not modified. type UnsuccessfulInstanceCreditSpecificationItemError struct { _ struct{} `type:"structure"` @@ -93126,7 +106100,7 @@ func (s *UserBucketDetails) SetS3Key(v string) *UserBucketDetails { // Describes the user data for an instance. type UserData struct { - _ struct{} `type:"structure"` + _ struct{} `type:"structure" sensitive:"true"` // 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 @@ -93244,6 +106218,68 @@ func (s *UserIdGroupPair) SetVpcPeeringConnectionId(v string) *UserIdGroupPair { return s } +// Describes the vCPU configurations for the instance type. +type VCpuInfo struct { + _ struct{} `type:"structure"` + + // The default number of cores for the instance type. + DefaultCores *int64 `locationName:"defaultCores" type:"integer"` + + // The default number of threads per core for the instance type. + DefaultThreadsPerCore *int64 `locationName:"defaultThreadsPerCore" type:"integer"` + + // The default number of vCPUs for the instance type. + DefaultVCpus *int64 `locationName:"defaultVCpus" type:"integer"` + + // List of the valid number of cores that can be configured for the instance + // type. + ValidCores []*int64 `locationName:"validCores" locationNameList:"item" type:"list"` + + // List of the valid number of threads per core that can be configured for the + // instance type. + ValidThreadsPerCore []*int64 `locationName:"validThreadsPerCore" locationNameList:"item" type:"list"` +} + +// String returns the string representation +func (s VCpuInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VCpuInfo) GoString() string { + return s.String() +} + +// SetDefaultCores sets the DefaultCores field's value. +func (s *VCpuInfo) SetDefaultCores(v int64) *VCpuInfo { + s.DefaultCores = &v + return s +} + +// SetDefaultThreadsPerCore sets the DefaultThreadsPerCore field's value. +func (s *VCpuInfo) SetDefaultThreadsPerCore(v int64) *VCpuInfo { + s.DefaultThreadsPerCore = &v + return s +} + +// SetDefaultVCpus sets the DefaultVCpus field's value. +func (s *VCpuInfo) SetDefaultVCpus(v int64) *VCpuInfo { + s.DefaultVCpus = &v + return s +} + +// SetValidCores sets the ValidCores field's value. +func (s *VCpuInfo) SetValidCores(v []*int64) *VCpuInfo { + s.ValidCores = v + return s +} + +// SetValidThreadsPerCore sets the ValidThreadsPerCore field's value. +func (s *VCpuInfo) SetValidThreadsPerCore(v []*int64) *VCpuInfo { + s.ValidThreadsPerCore = v + return s +} + // Describes telemetry for a VPN tunnel. type VgwTelemetry struct { _ struct{} `type:"structure"` @@ -93330,6 +106366,9 @@ type Volume struct { // Indicates whether the volume is encrypted. Encrypted *bool `locationName:"encrypted" type:"boolean"` + // Indicates whether the volume was created using fast snapshot restore. + FastRestored *bool `locationName:"fastRestored" 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 @@ -93352,6 +106391,12 @@ type Volume struct { // key for the volume. KmsKeyId *string `locationName:"kmsKeyId" type:"string"` + // Indicates whether Amazon EBS Multi-Attach is enabled. + MultiAttachEnabled *bool `locationName:"multiAttachEnabled" type:"boolean"` + + // The Amazon Resource Name (ARN) of the Outpost. + OutpostArn *string `locationName:"outpostArn" type:"string"` + // The size of the volume, in GiBs. Size *int64 `locationName:"size" type:"integer"` @@ -93407,6 +106452,12 @@ func (s *Volume) SetEncrypted(v bool) *Volume { return s } +// SetFastRestored sets the FastRestored field's value. +func (s *Volume) SetFastRestored(v bool) *Volume { + s.FastRestored = &v + return s +} + // SetIops sets the Iops field's value. func (s *Volume) SetIops(v int64) *Volume { s.Iops = &v @@ -93419,6 +106470,18 @@ func (s *Volume) SetKmsKeyId(v string) *Volume { return s } +// SetMultiAttachEnabled sets the MultiAttachEnabled field's value. +func (s *Volume) SetMultiAttachEnabled(v bool) *Volume { + s.MultiAttachEnabled = &v + return s +} + +// SetOutpostArn sets the OutpostArn field's value. +func (s *Volume) SetOutpostArn(v string) *Volume { + s.OutpostArn = &v + return s +} + // SetSize sets the Size field's value. func (s *Volume) SetSize(v int64) *Volume { s.Size = &v @@ -93740,6 +106803,39 @@ func (s *VolumeStatusAction) SetEventType(v string) *VolumeStatusAction { return s } +// Information about the instances to which the volume is attached. +type VolumeStatusAttachmentStatus struct { + _ struct{} `type:"structure"` + + // The ID of the attached instance. + InstanceId *string `locationName:"instanceId" type:"string"` + + // The maximum IOPS supported by the attached instance. + IoPerformance *string `locationName:"ioPerformance" type:"string"` +} + +// String returns the string representation +func (s VolumeStatusAttachmentStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VolumeStatusAttachmentStatus) GoString() string { + return s.String() +} + +// SetInstanceId sets the InstanceId field's value. +func (s *VolumeStatusAttachmentStatus) SetInstanceId(v string) *VolumeStatusAttachmentStatus { + s.InstanceId = &v + return s +} + +// SetIoPerformance sets the IoPerformance field's value. +func (s *VolumeStatusAttachmentStatus) SetIoPerformance(v string) *VolumeStatusAttachmentStatus { + s.IoPerformance = &v + return s +} + // Describes a volume status. type VolumeStatusDetails struct { _ struct{} `type:"structure"` @@ -93786,6 +106882,9 @@ type VolumeStatusEvent struct { // The type of this event. EventType *string `locationName:"eventType" type:"string"` + // The ID of the instance associated with the event. + InstanceId *string `locationName:"instanceId" type:"string"` + // The latest end time of the event. NotAfter *time.Time `locationName:"notAfter" type:"timestamp"` @@ -93821,6 +106920,12 @@ func (s *VolumeStatusEvent) SetEventType(v string) *VolumeStatusEvent { return s } +// SetInstanceId sets the InstanceId field's value. +func (s *VolumeStatusEvent) SetInstanceId(v string) *VolumeStatusEvent { + s.InstanceId = &v + return s +} + // SetNotAfter sets the NotAfter field's value. func (s *VolumeStatusEvent) SetNotAfter(v time.Time) *VolumeStatusEvent { s.NotAfter = &v @@ -93873,12 +106978,18 @@ type VolumeStatusItem struct { // The details of the operation. Actions []*VolumeStatusAction `locationName:"actionsSet" locationNameList:"item" type:"list"` + // Information about the instances to which the volume is attached. + AttachmentStatuses []*VolumeStatusAttachmentStatus `locationName:"attachmentStatuses" 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 Amazon Resource Name (ARN) of the Outpost. + OutpostArn *string `locationName:"outpostArn" type:"string"` + // The volume ID. VolumeId *string `locationName:"volumeId" type:"string"` @@ -93902,6 +107013,12 @@ func (s *VolumeStatusItem) SetActions(v []*VolumeStatusAction) *VolumeStatusItem return s } +// SetAttachmentStatuses sets the AttachmentStatuses field's value. +func (s *VolumeStatusItem) SetAttachmentStatuses(v []*VolumeStatusAttachmentStatus) *VolumeStatusItem { + s.AttachmentStatuses = v + return s +} + // SetAvailabilityZone sets the AvailabilityZone field's value. func (s *VolumeStatusItem) SetAvailabilityZone(v string) *VolumeStatusItem { s.AvailabilityZone = &v @@ -93914,6 +107031,12 @@ func (s *VolumeStatusItem) SetEvents(v []*VolumeStatusEvent) *VolumeStatusItem { return s } +// SetOutpostArn sets the OutpostArn field's value. +func (s *VolumeStatusItem) SetOutpostArn(v string) *VolumeStatusItem { + s.OutpostArn = &v + return s +} + // SetVolumeId sets the VolumeId field's value. func (s *VolumeStatusItem) SetVolumeId(v string) *VolumeStatusItem { s.VolumeId = &v @@ -94186,16 +107309,19 @@ func (s *VpcClassicLink) SetVpcId(v string) *VpcClassicLink { type VpcEndpoint struct { _ struct{} `type:"structure"` - // The date and time the VPC endpoint was created. + // The date and time that the VPC endpoint was created. CreationTimestamp *time.Time `locationName:"creationTimestamp" type:"timestamp"` // (Interface endpoint) The DNS entries for the endpoint. DnsEntries []*DnsEntry `locationName:"dnsEntrySet" locationNameList:"item" type:"list"` - // (Interface endpoint) Information about the security groups associated with - // the network interface. + // (Interface endpoint) Information about the security groups that are associated + // with the network interface. Groups []*SecurityGroupIdentifier `locationName:"groupSet" locationNameList:"item" type:"list"` + // The last error that occurred for VPC endpoint. + LastError *LastError `locationName:"lastError" type:"structure"` + // (Interface endpoint) One or more network interfaces for the endpoint. NetworkInterfaceIds []*string `locationName:"networkInterfaceIdSet" locationNameList:"item" type:"list"` @@ -94265,6 +107391,12 @@ func (s *VpcEndpoint) SetGroups(v []*SecurityGroupIdentifier) *VpcEndpoint { return s } +// SetLastError sets the LastError field's value. +func (s *VpcEndpoint) SetLastError(v *LastError) *VpcEndpoint { + s.LastError = v + return s +} + // SetNetworkInterfaceIds sets the NetworkInterfaceIds field's value. func (s *VpcEndpoint) SetNetworkInterfaceIds(v []*string) *VpcEndpoint { s.NetworkInterfaceIds = v @@ -94347,7 +107479,7 @@ func (s *VpcEndpoint) SetVpcId(v string) *VpcEndpoint { type VpcEndpointConnection struct { _ struct{} `type:"structure"` - // The date and time the VPC endpoint was created. + // The date and time that the VPC endpoint was created. CreationTimestamp *time.Time `locationName:"creationTimestamp" type:"timestamp"` // The DNS entries for the VPC endpoint. @@ -94433,6 +107565,12 @@ type VpcIpv6CidrBlockAssociation struct { // Information about the state of the CIDR block. Ipv6CidrBlockState *VpcCidrBlockState `locationName:"ipv6CidrBlockState" type:"structure"` + + // The ID of the IPv6 address pool from which the IPv6 CIDR block is allocated. + Ipv6Pool *string `locationName:"ipv6Pool" type:"string"` + + // The name of the location from which we advertise the IPV6 CIDR block. + NetworkBorderGroup *string `locationName:"networkBorderGroup" type:"string"` } // String returns the string representation @@ -94463,6 +107601,18 @@ func (s *VpcIpv6CidrBlockAssociation) SetIpv6CidrBlockState(v *VpcCidrBlockState return s } +// SetIpv6Pool sets the Ipv6Pool field's value. +func (s *VpcIpv6CidrBlockAssociation) SetIpv6Pool(v string) *VpcIpv6CidrBlockAssociation { + s.Ipv6Pool = &v + return s +} + +// SetNetworkBorderGroup sets the NetworkBorderGroup field's value. +func (s *VpcIpv6CidrBlockAssociation) SetNetworkBorderGroup(v string) *VpcIpv6CidrBlockAssociation { + s.NetworkBorderGroup = &v + return s +} + // Describes a VPC peering connection. type VpcPeeringConnection struct { _ struct{} `type:"structure"` @@ -94822,6 +107972,9 @@ func (s *VpnConnection) SetVpnGatewayId(v string) *VpnConnection { type VpnConnectionOptions struct { _ struct{} `type:"structure"` + // Indicates whether acceleration is enabled for the VPN connection. + EnableAcceleration *bool `locationName:"enableAcceleration" type:"boolean"` + // 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"` @@ -94840,6 +107993,12 @@ func (s VpnConnectionOptions) GoString() string { return s.String() } +// SetEnableAcceleration sets the EnableAcceleration field's value. +func (s *VpnConnectionOptions) SetEnableAcceleration(v bool) *VpnConnectionOptions { + s.EnableAcceleration = &v + return s +} + // SetStaticRoutesOnly sets the StaticRoutesOnly field's value. func (s *VpnConnectionOptions) SetStaticRoutesOnly(v bool) *VpnConnectionOptions { s.StaticRoutesOnly = &v @@ -94856,6 +108015,11 @@ func (s *VpnConnectionOptions) SetTunnelOptions(v []*TunnelOption) *VpnConnectio type VpnConnectionOptionsSpecification struct { _ struct{} `type:"structure"` + // Indicate whether to enable acceleration for the VPN connection. + // + // Default: false + EnableAcceleration *bool `type:"boolean"` + // Indicate whether the VPN connection uses static routes only. If you are creating // a VPN connection for a device that does not support BGP, you must specify // true. Use CreateVpnConnectionRoute to create a static route. @@ -94877,6 +108041,12 @@ func (s VpnConnectionOptionsSpecification) GoString() string { return s.String() } +// SetEnableAcceleration sets the EnableAcceleration field's value. +func (s *VpnConnectionOptionsSpecification) SetEnableAcceleration(v bool) *VpnConnectionOptionsSpecification { + s.EnableAcceleration = &v + return s +} + // SetStaticRoutesOnly sets the StaticRoutesOnly field's value. func (s *VpnConnectionOptionsSpecification) SetStaticRoutesOnly(v bool) *VpnConnectionOptionsSpecification { s.StaticRoutesOnly = &v @@ -95010,7 +108180,7 @@ func (s *VpnStaticRoute) SetState(v string) *VpnStaticRoute { return s } -// The tunnel options for a VPN connection. +// The tunnel options for a single VPN tunnel. type VpnTunnelOptionsSpecification struct { _ struct{} `type:"structure"` @@ -95235,7 +108405,7 @@ func (s *VpnTunnelOptionsSpecification) SetTunnelInsideCidr(v string) *VpnTunnel type WithdrawByoipCidrInput struct { _ struct{} `type:"structure"` - // The public IPv4 address range, in CIDR notation. + // The address range, in CIDR notation. // // Cidr is a required field Cidr *string `type:"string" required:"true"` @@ -95366,6 +108536,25 @@ const ( AllocationStrategyCapacityOptimized = "capacityOptimized" ) +const ( + // AllowsMultipleInstanceTypesOn is a AllowsMultipleInstanceTypes enum value + AllowsMultipleInstanceTypesOn = "on" + + // AllowsMultipleInstanceTypesOff is a AllowsMultipleInstanceTypes enum value + AllowsMultipleInstanceTypesOff = "off" +) + +const ( + // ArchitectureTypeI386 is a ArchitectureType enum value + ArchitectureTypeI386 = "i386" + + // ArchitectureTypeX8664 is a ArchitectureType enum value + ArchitectureTypeX8664 = "x86_64" + + // ArchitectureTypeArm64 is a ArchitectureType enum value + ArchitectureTypeArm64 = "arm64" +) + const ( // ArchitectureValuesI386 is a ArchitectureValues enum value ArchitectureValuesI386 = "i386" @@ -95429,6 +108618,17 @@ const ( AutoPlacementOff = "off" ) +const ( + // AvailabilityZoneOptInStatusOptInNotRequired is a AvailabilityZoneOptInStatus enum value + AvailabilityZoneOptInStatusOptInNotRequired = "opt-in-not-required" + + // AvailabilityZoneOptInStatusOptedIn is a AvailabilityZoneOptInStatus enum value + AvailabilityZoneOptInStatusOptedIn = "opted-in" + + // AvailabilityZoneOptInStatusNotOptedIn is a AvailabilityZoneOptInStatus enum value + AvailabilityZoneOptInStatusNotOptedIn = "not-opted-in" +) + const ( // AvailabilityZoneStateAvailable is a AvailabilityZoneState enum value AvailabilityZoneStateAvailable = "available" @@ -95510,6 +108710,9 @@ const ( // ByoipCidrStateProvisioned is a ByoipCidrState enum value ByoipCidrStateProvisioned = "provisioned" + + // ByoipCidrStateProvisionedNotPubliclyAdvertisable is a ByoipCidrState enum value + ByoipCidrStateProvisionedNotPubliclyAdvertisable = "provisioned-not-publicly-advertisable" ) const ( @@ -95771,6 +108974,17 @@ const ( DeleteFleetErrorCodeUnexpectedError = "unexpectedError" ) +const ( + // DeleteQueuedReservedInstancesErrorCodeReservedInstancesIdInvalid is a DeleteQueuedReservedInstancesErrorCode enum value + DeleteQueuedReservedInstancesErrorCodeReservedInstancesIdInvalid = "reserved-instances-id-invalid" + + // DeleteQueuedReservedInstancesErrorCodeReservedInstancesNotInQueuedState is a DeleteQueuedReservedInstancesErrorCode enum value + DeleteQueuedReservedInstancesErrorCodeReservedInstancesNotInQueuedState = "reserved-instances-not-in-queued-state" + + // DeleteQueuedReservedInstancesErrorCodeUnexpectedError is a DeleteQueuedReservedInstancesErrorCode enum value + DeleteQueuedReservedInstancesErrorCodeUnexpectedError = "unexpected-error" +) + const ( // DeviceTypeEbs is a DeviceType enum value DeviceTypeEbs = "ebs" @@ -95790,6 +109004,25 @@ const ( DiskImageFormatVhd = "VHD" ) +const ( + // DiskTypeHdd is a DiskType enum value + DiskTypeHdd = "hdd" + + // DiskTypeSsd is a DiskType enum value + DiskTypeSsd = "ssd" +) + +const ( + // DnsNameStatePendingVerification is a DnsNameState enum value + DnsNameStatePendingVerification = "pendingVerification" + + // DnsNameStateVerified is a DnsNameState enum value + DnsNameStateVerified = "verified" + + // DnsNameStateFailed is a DnsNameState enum value + DnsNameStateFailed = "failed" +) + const ( // DnsSupportValueEnable is a DnsSupportValue enum value DnsSupportValueEnable = "enable" @@ -95806,6 +109039,25 @@ const ( DomainTypeStandard = "standard" ) +const ( + // EbsEncryptionSupportUnsupported is a EbsEncryptionSupport enum value + EbsEncryptionSupportUnsupported = "unsupported" + + // EbsEncryptionSupportSupported is a EbsEncryptionSupport enum value + EbsEncryptionSupportSupported = "supported" +) + +const ( + // EbsOptimizedSupportUnsupported is a EbsOptimizedSupport enum value + EbsOptimizedSupportUnsupported = "unsupported" + + // EbsOptimizedSupportSupported is a EbsOptimizedSupport enum value + EbsOptimizedSupportSupported = "supported" + + // EbsOptimizedSupportDefault is a EbsOptimizedSupport enum value + EbsOptimizedSupportDefault = "default" +) + const ( // ElasticGpuStateAttached is a ElasticGpuState enum value ElasticGpuStateAttached = "ATTACHED" @@ -95819,6 +109071,17 @@ const ( ElasticGpuStatusImpaired = "IMPAIRED" ) +const ( + // EnaSupportUnsupported is a EnaSupport enum value + EnaSupportUnsupported = "unsupported" + + // EnaSupportSupported is a EnaSupport enum value + EnaSupportSupported = "supported" + + // EnaSupportRequired is a EnaSupport enum value + EnaSupportRequired = "required" +) + const ( // EndDateTypeUnlimited is a EndDateType enum value EndDateTypeUnlimited = "unlimited" @@ -95891,6 +109154,23 @@ const ( ExportTaskStateCompleted = "completed" ) +const ( + // FastSnapshotRestoreStateCodeEnabling is a FastSnapshotRestoreStateCode enum value + FastSnapshotRestoreStateCodeEnabling = "enabling" + + // FastSnapshotRestoreStateCodeOptimizing is a FastSnapshotRestoreStateCode enum value + FastSnapshotRestoreStateCodeOptimizing = "optimizing" + + // FastSnapshotRestoreStateCodeEnabled is a FastSnapshotRestoreStateCode enum value + FastSnapshotRestoreStateCodeEnabled = "enabled" + + // FastSnapshotRestoreStateCodeDisabling is a FastSnapshotRestoreStateCode enum value + FastSnapshotRestoreStateCodeDisabling = "disabling" + + // FastSnapshotRestoreStateCodeDisabled is a FastSnapshotRestoreStateCode enum value + FastSnapshotRestoreStateCodeDisabled = "disabled" +) + const ( // FleetActivityStatusError is a FleetActivityStatus enum value FleetActivityStatusError = "error" @@ -95905,6 +109185,11 @@ const ( FleetActivityStatusFulfilled = "fulfilled" ) +const ( + // FleetCapacityReservationUsageStrategyUseCapacityReservationsFirst is a FleetCapacityReservationUsageStrategy enum value + FleetCapacityReservationUsageStrategyUseCapacityReservationsFirst = "use-capacity-reservations-first" +) + const ( // FleetEventTypeInstanceChange is a FleetEventType enum value FleetEventTypeInstanceChange = "instance-change" @@ -96026,6 +109311,14 @@ const ( HostTenancyHost = "host" ) +const ( + // HttpTokensStateOptional is a HttpTokensState enum value + HttpTokensStateOptional = "optional" + + // HttpTokensStateRequired is a HttpTokensState enum value + HttpTokensStateRequired = "required" +) + const ( // HypervisorTypeOvm is a HypervisorType enum value HypervisorTypeOvm = "ovm" @@ -96192,6 +109485,22 @@ const ( InstanceMatchCriteriaTargeted = "targeted" ) +const ( + // InstanceMetadataEndpointStateDisabled is a InstanceMetadataEndpointState enum value + InstanceMetadataEndpointStateDisabled = "disabled" + + // InstanceMetadataEndpointStateEnabled is a InstanceMetadataEndpointState enum value + InstanceMetadataEndpointStateEnabled = "enabled" +) + +const ( + // InstanceMetadataOptionsStatePending is a InstanceMetadataOptionsState enum value + InstanceMetadataOptionsStatePending = "pending" + + // InstanceMetadataOptionsStateApplied is a InstanceMetadataOptionsState enum value + InstanceMetadataOptionsStateApplied = "applied" +) + const ( // InstanceStateNamePending is a InstanceStateName enum value InstanceStateNamePending = "pending" @@ -96633,9 +109942,18 @@ const ( // InstanceTypeC5d9xlarge is a InstanceType enum value InstanceTypeC5d9xlarge = "c5d.9xlarge" + // InstanceTypeC5d12xlarge is a InstanceType enum value + InstanceTypeC5d12xlarge = "c5d.12xlarge" + // InstanceTypeC5d18xlarge is a InstanceType enum value InstanceTypeC5d18xlarge = "c5d.18xlarge" + // InstanceTypeC5d24xlarge is a InstanceType enum value + InstanceTypeC5d24xlarge = "c5d.24xlarge" + + // InstanceTypeC5dMetal is a InstanceType enum value + InstanceTypeC5dMetal = "c5d.metal" + // InstanceTypeC5nLarge is a InstanceType enum value InstanceTypeC5nLarge = "c5n.large" @@ -96885,6 +110203,12 @@ const ( // InstanceTypeU12tb1Metal is a InstanceType enum value InstanceTypeU12tb1Metal = "u-12tb1.metal" + // InstanceTypeU18tb1Metal is a InstanceType enum value + InstanceTypeU18tb1Metal = "u-18tb1.metal" + + // InstanceTypeU24tb1Metal is a InstanceType enum value + InstanceTypeU24tb1Metal = "u-24tb1.metal" + // InstanceTypeA1Medium is a InstanceType enum value InstanceTypeA1Medium = "a1.medium" @@ -96899,6 +110223,125 @@ const ( // InstanceTypeA14xlarge is a InstanceType enum value InstanceTypeA14xlarge = "a1.4xlarge" + + // InstanceTypeA1Metal is a InstanceType enum value + InstanceTypeA1Metal = "a1.metal" + + // InstanceTypeM5dnLarge is a InstanceType enum value + InstanceTypeM5dnLarge = "m5dn.large" + + // InstanceTypeM5dnXlarge is a InstanceType enum value + InstanceTypeM5dnXlarge = "m5dn.xlarge" + + // InstanceTypeM5dn2xlarge is a InstanceType enum value + InstanceTypeM5dn2xlarge = "m5dn.2xlarge" + + // InstanceTypeM5dn4xlarge is a InstanceType enum value + InstanceTypeM5dn4xlarge = "m5dn.4xlarge" + + // InstanceTypeM5dn8xlarge is a InstanceType enum value + InstanceTypeM5dn8xlarge = "m5dn.8xlarge" + + // InstanceTypeM5dn12xlarge is a InstanceType enum value + InstanceTypeM5dn12xlarge = "m5dn.12xlarge" + + // InstanceTypeM5dn16xlarge is a InstanceType enum value + InstanceTypeM5dn16xlarge = "m5dn.16xlarge" + + // InstanceTypeM5dn24xlarge is a InstanceType enum value + InstanceTypeM5dn24xlarge = "m5dn.24xlarge" + + // InstanceTypeM5nLarge is a InstanceType enum value + InstanceTypeM5nLarge = "m5n.large" + + // InstanceTypeM5nXlarge is a InstanceType enum value + InstanceTypeM5nXlarge = "m5n.xlarge" + + // InstanceTypeM5n2xlarge is a InstanceType enum value + InstanceTypeM5n2xlarge = "m5n.2xlarge" + + // InstanceTypeM5n4xlarge is a InstanceType enum value + InstanceTypeM5n4xlarge = "m5n.4xlarge" + + // InstanceTypeM5n8xlarge is a InstanceType enum value + InstanceTypeM5n8xlarge = "m5n.8xlarge" + + // InstanceTypeM5n12xlarge is a InstanceType enum value + InstanceTypeM5n12xlarge = "m5n.12xlarge" + + // InstanceTypeM5n16xlarge is a InstanceType enum value + InstanceTypeM5n16xlarge = "m5n.16xlarge" + + // InstanceTypeM5n24xlarge is a InstanceType enum value + InstanceTypeM5n24xlarge = "m5n.24xlarge" + + // InstanceTypeR5dnLarge is a InstanceType enum value + InstanceTypeR5dnLarge = "r5dn.large" + + // InstanceTypeR5dnXlarge is a InstanceType enum value + InstanceTypeR5dnXlarge = "r5dn.xlarge" + + // InstanceTypeR5dn2xlarge is a InstanceType enum value + InstanceTypeR5dn2xlarge = "r5dn.2xlarge" + + // InstanceTypeR5dn4xlarge is a InstanceType enum value + InstanceTypeR5dn4xlarge = "r5dn.4xlarge" + + // InstanceTypeR5dn8xlarge is a InstanceType enum value + InstanceTypeR5dn8xlarge = "r5dn.8xlarge" + + // InstanceTypeR5dn12xlarge is a InstanceType enum value + InstanceTypeR5dn12xlarge = "r5dn.12xlarge" + + // InstanceTypeR5dn16xlarge is a InstanceType enum value + InstanceTypeR5dn16xlarge = "r5dn.16xlarge" + + // InstanceTypeR5dn24xlarge is a InstanceType enum value + InstanceTypeR5dn24xlarge = "r5dn.24xlarge" + + // InstanceTypeR5nLarge is a InstanceType enum value + InstanceTypeR5nLarge = "r5n.large" + + // InstanceTypeR5nXlarge is a InstanceType enum value + InstanceTypeR5nXlarge = "r5n.xlarge" + + // InstanceTypeR5n2xlarge is a InstanceType enum value + InstanceTypeR5n2xlarge = "r5n.2xlarge" + + // InstanceTypeR5n4xlarge is a InstanceType enum value + InstanceTypeR5n4xlarge = "r5n.4xlarge" + + // InstanceTypeR5n8xlarge is a InstanceType enum value + InstanceTypeR5n8xlarge = "r5n.8xlarge" + + // InstanceTypeR5n12xlarge is a InstanceType enum value + InstanceTypeR5n12xlarge = "r5n.12xlarge" + + // InstanceTypeR5n16xlarge is a InstanceType enum value + InstanceTypeR5n16xlarge = "r5n.16xlarge" + + // InstanceTypeR5n24xlarge is a InstanceType enum value + InstanceTypeR5n24xlarge = "r5n.24xlarge" + + // InstanceTypeInf1Xlarge is a InstanceType enum value + InstanceTypeInf1Xlarge = "inf1.xlarge" + + // InstanceTypeInf12xlarge is a InstanceType enum value + InstanceTypeInf12xlarge = "inf1.2xlarge" + + // InstanceTypeInf16xlarge is a InstanceType enum value + InstanceTypeInf16xlarge = "inf1.6xlarge" + + // InstanceTypeInf124xlarge is a InstanceType enum value + InstanceTypeInf124xlarge = "inf1.24xlarge" +) + +const ( + // InstanceTypeHypervisorNitro is a InstanceTypeHypervisor enum value + InstanceTypeHypervisorNitro = "nitro" + + // InstanceTypeHypervisorXen is a InstanceTypeHypervisor enum value + InstanceTypeHypervisorXen = "xen" ) const ( @@ -96937,6 +110380,30 @@ const ( LaunchTemplateErrorCodeUnexpectedError = "unexpectedError" ) +const ( + // LaunchTemplateHttpTokensStateOptional is a LaunchTemplateHttpTokensState enum value + LaunchTemplateHttpTokensStateOptional = "optional" + + // LaunchTemplateHttpTokensStateRequired is a LaunchTemplateHttpTokensState enum value + LaunchTemplateHttpTokensStateRequired = "required" +) + +const ( + // LaunchTemplateInstanceMetadataEndpointStateDisabled is a LaunchTemplateInstanceMetadataEndpointState enum value + LaunchTemplateInstanceMetadataEndpointStateDisabled = "disabled" + + // LaunchTemplateInstanceMetadataEndpointStateEnabled is a LaunchTemplateInstanceMetadataEndpointState enum value + LaunchTemplateInstanceMetadataEndpointStateEnabled = "enabled" +) + +const ( + // LaunchTemplateInstanceMetadataOptionsStatePending is a LaunchTemplateInstanceMetadataOptionsState enum value + LaunchTemplateInstanceMetadataOptionsStatePending = "pending" + + // LaunchTemplateInstanceMetadataOptionsStateApplied is a LaunchTemplateInstanceMetadataOptionsState enum value + LaunchTemplateInstanceMetadataOptionsStateApplied = "applied" +) + const ( // ListingStateAvailable is a ListingState enum value ListingStateAvailable = "available" @@ -96965,6 +110432,42 @@ const ( ListingStatusClosed = "closed" ) +const ( + // LocalGatewayRouteStatePending is a LocalGatewayRouteState enum value + LocalGatewayRouteStatePending = "pending" + + // LocalGatewayRouteStateActive is a LocalGatewayRouteState enum value + LocalGatewayRouteStateActive = "active" + + // LocalGatewayRouteStateBlackhole is a LocalGatewayRouteState enum value + LocalGatewayRouteStateBlackhole = "blackhole" + + // LocalGatewayRouteStateDeleting is a LocalGatewayRouteState enum value + LocalGatewayRouteStateDeleting = "deleting" + + // LocalGatewayRouteStateDeleted is a LocalGatewayRouteState enum value + LocalGatewayRouteStateDeleted = "deleted" +) + +const ( + // LocalGatewayRouteTypeStatic is a LocalGatewayRouteType enum value + LocalGatewayRouteTypeStatic = "static" + + // LocalGatewayRouteTypePropagated is a LocalGatewayRouteType enum value + LocalGatewayRouteTypePropagated = "propagated" +) + +const ( + // LocationTypeRegion is a LocationType enum value + LocationTypeRegion = "region" + + // LocationTypeAvailabilityZone is a LocationType enum value + LocationTypeAvailabilityZone = "availability-zone" + + // LocationTypeAvailabilityZoneId is a LocationType enum value + LocationTypeAvailabilityZoneId = "availability-zone-id" +) + const ( // LogDestinationTypeCloudWatchLogs is a LogDestinationType enum value LogDestinationTypeCloudWatchLogs = "cloud-watch-logs" @@ -96978,6 +110481,14 @@ const ( MarketTypeSpot = "spot" ) +const ( + // MembershipTypeStatic is a MembershipType enum value + MembershipTypeStatic = "static" + + // MembershipTypeIgmp is a MembershipType enum value + MembershipTypeIgmp = "igmp" +) + const ( // MonitoringStateDisabled is a MonitoringState enum value MonitoringStateDisabled = "disabled" @@ -97000,6 +110511,14 @@ const ( MoveStatusRestoringToClassic = "restoringToClassic" ) +const ( + // MulticastSupportValueEnable is a MulticastSupportValue enum value + MulticastSupportValueEnable = "enable" + + // MulticastSupportValueDisable is a MulticastSupportValue enum value + MulticastSupportValueDisable = "disable" +) + const ( // NatGatewayStatePending is a NatGatewayState enum value NatGatewayStatePending = "pending" @@ -97152,6 +110671,17 @@ const ( PlacementGroupStateDeleted = "deleted" ) +const ( + // PlacementGroupStrategyCluster is a PlacementGroupStrategy enum value + PlacementGroupStrategyCluster = "cluster" + + // PlacementGroupStrategyPartition is a PlacementGroupStrategy enum value + PlacementGroupStrategyPartition = "partition" + + // PlacementGroupStrategySpread is a PlacementGroupStrategy enum value + PlacementGroupStrategySpread = "spread" +) + const ( // PlacementStrategyCluster is a PlacementStrategy enum value PlacementStrategyCluster = "cluster" @@ -97278,6 +110808,12 @@ const ( // ReservedInstanceStateRetired is a ReservedInstanceState enum value ReservedInstanceStateRetired = "retired" + + // ReservedInstanceStateQueued is a ReservedInstanceState enum value + ReservedInstanceStateQueued = "queued" + + // ReservedInstanceStateQueuedDeleted is a ReservedInstanceState enum value + ReservedInstanceStateQueuedDeleted = "queued-deleted" ) const ( @@ -97324,6 +110860,9 @@ const ( // ResourceTypeInternetGateway is a ResourceType enum value ResourceTypeInternetGateway = "internet-gateway" + // ResourceTypeKeyPair is a ResourceType enum value + ResourceTypeKeyPair = "key-pair" + // ResourceTypeLaunchTemplate is a ResourceType enum value ResourceTypeLaunchTemplate = "launch-template" @@ -97336,6 +110875,9 @@ const ( // ResourceTypeNetworkInterface is a ResourceType enum value ResourceTypeNetworkInterface = "network-interface" + // ResourceTypePlacementGroup is a ResourceType enum value + ResourceTypePlacementGroup = "placement-group" + // ResourceTypeReservedInstances is a ResourceType enum value ResourceTypeReservedInstances = "reserved-instances" @@ -97348,6 +110890,9 @@ const ( // ResourceTypeSnapshot is a ResourceType enum value ResourceTypeSnapshot = "snapshot" + // ResourceTypeSpotFleetRequest is a ResourceType enum value + ResourceTypeSpotFleetRequest = "spot-fleet-request" + // ResourceTypeSpotInstancesRequest is a ResourceType enum value ResourceTypeSpotInstancesRequest = "spot-instances-request" @@ -97369,6 +110914,9 @@ const ( // ResourceTypeTransitGatewayAttachment is a ResourceType enum value ResourceTypeTransitGatewayAttachment = "transit-gateway-attachment" + // ResourceTypeTransitGatewayMulticastDomain is a ResourceType enum value + ResourceTypeTransitGatewayMulticastDomain = "transit-gateway-multicast-domain" + // ResourceTypeTransitGatewayRouteTable is a ResourceType enum value ResourceTypeTransitGatewayRouteTable = "transit-gateway-route-table" @@ -97386,6 +110934,17 @@ const ( // ResourceTypeVpnGateway is a ResourceType enum value ResourceTypeVpnGateway = "vpn-gateway" + + // ResourceTypeVpcFlowLog is a ResourceType enum value + ResourceTypeVpcFlowLog = "vpc-flow-log" +) + +const ( + // RootDeviceTypeEbs is a RootDeviceType enum value + RootDeviceTypeEbs = "ebs" + + // RootDeviceTypeInstanceStore is a RootDeviceType enum value + RootDeviceTypeInstanceStore = "instance-store" ) const ( @@ -97407,6 +110966,23 @@ const ( RouteStateBlackhole = "blackhole" ) +const ( + // RouteTableAssociationStateCodeAssociating is a RouteTableAssociationStateCode enum value + RouteTableAssociationStateCodeAssociating = "associating" + + // RouteTableAssociationStateCodeAssociated is a RouteTableAssociationStateCode enum value + RouteTableAssociationStateCodeAssociated = "associated" + + // RouteTableAssociationStateCodeDisassociating is a RouteTableAssociationStateCode enum value + RouteTableAssociationStateCodeDisassociating = "disassociating" + + // RouteTableAssociationStateCodeDisassociated is a RouteTableAssociationStateCode enum value + RouteTableAssociationStateCodeDisassociated = "disassociated" + + // RouteTableAssociationStateCodeFailed is a RouteTableAssociationStateCode enum value + RouteTableAssociationStateCodeFailed = "failed" +) + const ( // RuleActionAllow is a RuleAction enum value RuleActionAllow = "allow" @@ -97415,6 +110991,14 @@ const ( RuleActionDeny = "deny" ) +const ( + // ScopeAvailabilityZone is a Scope enum value + ScopeAvailabilityZone = "Availability Zone" + + // ScopeRegion is a Scope enum value + ScopeRegion = "Region" +) + const ( // ServiceStatePending is a ServiceState enum value ServiceStatePending = "Pending" @@ -97722,9 +111306,15 @@ const ( // TransitGatewayAttachmentResourceTypeDirectConnectGateway is a TransitGatewayAttachmentResourceType enum value TransitGatewayAttachmentResourceTypeDirectConnectGateway = "direct-connect-gateway" + + // TransitGatewayAttachmentResourceTypeTgwPeering is a TransitGatewayAttachmentResourceType enum value + TransitGatewayAttachmentResourceTypeTgwPeering = "tgw-peering" ) const ( + // TransitGatewayAttachmentStateInitiating is a TransitGatewayAttachmentState enum value + TransitGatewayAttachmentStateInitiating = "initiating" + // TransitGatewayAttachmentStatePendingAcceptance is a TransitGatewayAttachmentState enum value TransitGatewayAttachmentStatePendingAcceptance = "pendingAcceptance" @@ -97759,6 +111349,34 @@ const ( TransitGatewayAttachmentStateFailing = "failing" ) +const ( + // TransitGatewayMulitcastDomainAssociationStateAssociating is a TransitGatewayMulitcastDomainAssociationState enum value + TransitGatewayMulitcastDomainAssociationStateAssociating = "associating" + + // TransitGatewayMulitcastDomainAssociationStateAssociated is a TransitGatewayMulitcastDomainAssociationState enum value + TransitGatewayMulitcastDomainAssociationStateAssociated = "associated" + + // TransitGatewayMulitcastDomainAssociationStateDisassociating is a TransitGatewayMulitcastDomainAssociationState enum value + TransitGatewayMulitcastDomainAssociationStateDisassociating = "disassociating" + + // TransitGatewayMulitcastDomainAssociationStateDisassociated is a TransitGatewayMulitcastDomainAssociationState enum value + TransitGatewayMulitcastDomainAssociationStateDisassociated = "disassociated" +) + +const ( + // TransitGatewayMulticastDomainStatePending is a TransitGatewayMulticastDomainState enum value + TransitGatewayMulticastDomainStatePending = "pending" + + // TransitGatewayMulticastDomainStateAvailable is a TransitGatewayMulticastDomainState enum value + TransitGatewayMulticastDomainStateAvailable = "available" + + // TransitGatewayMulticastDomainStateDeleting is a TransitGatewayMulticastDomainState enum value + TransitGatewayMulticastDomainStateDeleting = "deleting" + + // TransitGatewayMulticastDomainStateDeleted is a TransitGatewayMulticastDomainState enum value + TransitGatewayMulticastDomainStateDeleted = "deleted" +) + const ( // TransitGatewayPropagationStateEnabling is a TransitGatewayPropagationState enum value TransitGatewayPropagationStateEnabling = "enabling" @@ -97837,6 +111455,17 @@ const ( TransportProtocolUdp = "udp" ) +const ( + // UnlimitedSupportedInstanceFamilyT2 is a UnlimitedSupportedInstanceFamily enum value + UnlimitedSupportedInstanceFamilyT2 = "t2" + + // UnlimitedSupportedInstanceFamilyT3 is a UnlimitedSupportedInstanceFamily enum value + UnlimitedSupportedInstanceFamilyT3 = "t3" + + // UnlimitedSupportedInstanceFamilyT3a is a UnlimitedSupportedInstanceFamily enum value + UnlimitedSupportedInstanceFamilyT3a = "t3a" +) + const ( // UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceIdMalformed is a UnsuccessfulInstanceCreditSpecificationErrorCode enum value UnsuccessfulInstanceCreditSpecificationErrorCodeInvalidInstanceIdMalformed = "InvalidInstanceID.Malformed" @@ -97851,6 +111480,14 @@ const ( UnsuccessfulInstanceCreditSpecificationErrorCodeInstanceCreditSpecificationNotSupported = "InstanceCreditSpecification.NotSupported" ) +const ( + // UsageClassTypeSpot is a UsageClassType enum value + UsageClassTypeSpot = "spot" + + // UsageClassTypeOnDemand is a UsageClassType enum value + UsageClassTypeOnDemand = "on-demand" +) + const ( // VirtualizationTypeHvm is a VirtualizationType enum value VirtualizationTypeHvm = "hvm" @@ -98063,11 +111700,3 @@ 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/service.go b/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go index 6acbc43fe3d..1bde2c2f5c5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "ec2" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "EC2" // ServiceID is a unique identifer of a specific service. + ServiceID = "EC2" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the EC2 client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a EC2 client from just a session. // svc := ec2.New(mySession) // @@ -46,11 +48,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *EC2 { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *EC2 { svc := &EC2{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-11-15", }, 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 index 0469f0f01a1..b9bdbde157f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ec2/waiters.go @@ -952,6 +952,57 @@ func (c *EC2) WaitUntilPasswordDataAvailableWithContext(ctx aws.Context, input * return w.WaitWithContext(ctx) } +// WaitUntilSecurityGroupExists uses the Amazon EC2 API operation +// DescribeSecurityGroups to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *EC2) WaitUntilSecurityGroupExists(input *DescribeSecurityGroupsInput) error { + return c.WaitUntilSecurityGroupExistsWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilSecurityGroupExistsWithContext is an extended version of WaitUntilSecurityGroupExists. +// With the support for passing in a context and options to configure the +// Waiter and the underlying request options. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EC2) WaitUntilSecurityGroupExistsWithContext(ctx aws.Context, input *DescribeSecurityGroupsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilSecurityGroupExists", + MaxAttempts: 6, + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "length(SecurityGroups[].GroupId) > `0`", + Expected: true, + }, + { + State: request.RetryWaiterState, + Matcher: request.ErrorWaiterMatch, + Expected: "InvalidGroupNotFound", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeSecurityGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeSecurityGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + // WaitUntilSnapshotCompleted uses the Amazon EC2 API operation // DescribeSnapshots to wait for a condition to be met before returning. // If the condition is not met within the max attempt window, an error will 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 index 237899c6061..2a5e6e3cd46 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecr/api.go @@ -57,8 +57,13 @@ func (c *ECR) BatchCheckLayerAvailabilityRequest(input *BatchCheckLayerAvailabil // BatchCheckLayerAvailability API operation for Amazon EC2 Container Registry. // -// Check the availability of multiple image layers in a specified registry and -// repository. +// Checks the availability of one or more image layers in a repository. +// +// When an image is pushed to a repository, each image layer is checked to verify +// if it has been uploaded before. If it is, then the image layer is skipped. +// +// When an image is pulled from a repository, each image layer is checked once +// to verify it is available to be pulled. // // 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 @@ -71,16 +76,16 @@ func (c *ECR) BatchCheckLayerAvailabilityRequest(input *BatchCheckLayerAvailabil // 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" +// Returned Error Types: +// * 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" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server-side issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/BatchCheckLayerAvailability @@ -149,8 +154,8 @@ func (c *ECR) BatchDeleteImageRequest(input *BatchDeleteImageInput) (req *reques // 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. +// Deletes a list of specified images within a repository. Images are specified +// with either an 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 @@ -166,15 +171,15 @@ func (c *ECR) BatchDeleteImageRequest(input *BatchDeleteImageInput) (req *reques // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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. // @@ -244,8 +249,11 @@ func (c *ECR) BatchGetImageRequest(input *BatchGetImageInput) (req *request.Requ // 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. +// Gets detailed information for an image. Images are specified with either +// an imageTag or imageDigest. +// +// When an image is pulled, the BatchGetImage API is called once to retrieve +// the image manifest. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -254,15 +262,15 @@ func (c *ECR) BatchGetImageRequest(input *BatchGetImageInput) (req *request.Requ // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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. // @@ -336,6 +344,9 @@ func (c *ECR) CompleteLayerUploadRequest(input *CompleteLayerUploadInput) (req * // registry, repository name, and upload ID. You can optionally provide a sha256 // digest of the image layer for data validation purposes. // +// When an image is pushed, the CompleteLayerUpload API is called once per each +// new image layer to verify that the upload has completed. +// // 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. @@ -347,33 +358,33 @@ func (c *ECR) CompleteLayerUploadRequest(input *CompleteLayerUploadInput) (req * // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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" +// * UploadNotFoundException // The upload could not be found, or the specified upload id is not valid for // this repository. // -// * ErrCodeInvalidLayerException "InvalidLayerException" +// * InvalidLayerException // The layer digest calculation performed by Amazon ECR upon receipt of the // image layer does not match the digest specified. // -// * ErrCodeLayerPartTooSmallException "LayerPartTooSmallException" +// * LayerPartTooSmallException // Layer parts must be at least 5 MiB in size. // -// * ErrCodeLayerAlreadyExistsException "LayerAlreadyExistsException" +// * LayerAlreadyExistsException // The image layer already exists in the associated repository. // -// * ErrCodeEmptyUploadException "EmptyUploadException" +// * EmptyUploadException // The specified layer upload does not contain any layer parts. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/CompleteLayerUpload @@ -442,7 +453,8 @@ func (c *ECR) CreateRepositoryRequest(input *CreateRepositoryInput) (req *reques // CreateRepository API operation for Amazon EC2 Container Registry. // -// Creates an image repository. +// Creates a repository. For more information, see Amazon ECR Repositories (https://docs.aws.amazon.com/AmazonECR/latest/userguide/Repositories.html) +// in the Amazon Elastic Container Registry User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -451,27 +463,27 @@ func (c *ECR) CreateRepositoryRequest(input *CreateRepositoryInput) (req *reques // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeInvalidTagParameterException "InvalidTagParameterException" +// * InvalidTagParameterException // An invalid parameter has been specified. Tag keys can have a maximum character // length of 128 characters, and tag values can have a maximum length of 256 // characters. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // The list of tags on the repository is over the limit. The maximum number // of tags that can be applied to a repository is 50. // -// * ErrCodeRepositoryAlreadyExistsException "RepositoryAlreadyExistsException" +// * RepositoryAlreadyExistsException // The specified repository already exists in the specified registry. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * 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 // (https://docs.aws.amazon.com/AmazonECR/latest/userguide/service_limits.html) @@ -543,7 +555,7 @@ func (c *ECR) DeleteLifecyclePolicyRequest(input *DeleteLifecyclePolicyInput) (r // DeleteLifecyclePolicy API operation for Amazon EC2 Container Registry. // -// Deletes the specified lifecycle policy. +// Deletes the lifecycle policy associated with the 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 @@ -552,19 +564,19 @@ func (c *ECR) DeleteLifecyclePolicyRequest(input *DeleteLifecyclePolicyInput) (r // See the AWS API reference guide for Amazon EC2 Container Registry's // API operation DeleteLifecyclePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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. // -// * ErrCodeLifecyclePolicyNotFoundException "LifecyclePolicyNotFoundException" +// * LifecyclePolicyNotFoundException // The lifecycle policy could not be found, and no policy is set to the repository. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DeleteLifecyclePolicy @@ -633,8 +645,9 @@ func (c *ECR) DeleteRepositoryRequest(input *DeleteRepositoryInput) (req *reques // 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. +// Deletes a repository. If the repository contains images, you must either +// delete all images in the repository or use the force option to delete the +// 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 @@ -643,19 +656,19 @@ func (c *ECR) DeleteRepositoryRequest(input *DeleteRepositoryInput) (req *reques // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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" +// * RepositoryNotEmptyException // The specified repository contains images. To delete a repository that contains // images, you must force the deletion with the force parameter. // @@ -725,7 +738,7 @@ func (c *ECR) DeleteRepositoryPolicyRequest(input *DeleteRepositoryPolicyInput) // DeleteRepositoryPolicy API operation for Amazon EC2 Container Registry. // -// Deletes the repository policy from a specified repository. +// Deletes the repository policy associated with the 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 @@ -734,19 +747,19 @@ func (c *ECR) DeleteRepositoryPolicyRequest(input *DeleteRepositoryPolicyInput) // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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" +// * RepositoryPolicyNotFoundException // The specified repository and registry combination does not have an associated // repository policy. // @@ -772,6 +785,158 @@ func (c *ECR) DeleteRepositoryPolicyWithContext(ctx aws.Context, input *DeleteRe return out, req.Send() } +const opDescribeImageScanFindings = "DescribeImageScanFindings" + +// DescribeImageScanFindingsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeImageScanFindings operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeImageScanFindings for more information on using the DescribeImageScanFindings +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeImageScanFindingsRequest method. +// req, resp := client.DescribeImageScanFindingsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeImageScanFindings +func (c *ECR) DescribeImageScanFindingsRequest(input *DescribeImageScanFindingsInput) (req *request.Request, output *DescribeImageScanFindingsOutput) { + op := &request.Operation{ + Name: opDescribeImageScanFindings, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeImageScanFindingsInput{} + } + + output = &DescribeImageScanFindingsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeImageScanFindings API operation for Amazon EC2 Container Registry. +// +// Returns the scan findings for the specified 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 EC2 Container Registry's +// API operation DescribeImageScanFindings for usage and error information. +// +// Returned Error Types: +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * 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. +// +// * ImageNotFoundException +// The image requested does not exist in the specified repository. +// +// * ScanNotFoundException +// The specified image scan could not be found. Ensure that image scanning is +// enabled on the repository and try again. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeImageScanFindings +func (c *ECR) DescribeImageScanFindings(input *DescribeImageScanFindingsInput) (*DescribeImageScanFindingsOutput, error) { + req, out := c.DescribeImageScanFindingsRequest(input) + return out, req.Send() +} + +// DescribeImageScanFindingsWithContext is the same as DescribeImageScanFindings with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeImageScanFindings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ECR) DescribeImageScanFindingsWithContext(ctx aws.Context, input *DescribeImageScanFindingsInput, opts ...request.Option) (*DescribeImageScanFindingsOutput, error) { + req, out := c.DescribeImageScanFindingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeImageScanFindingsPages iterates over the pages of a DescribeImageScanFindings operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeImageScanFindings 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 DescribeImageScanFindings operation. +// pageNum := 0 +// err := client.DescribeImageScanFindingsPages(params, +// func(page *ecr.DescribeImageScanFindingsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *ECR) DescribeImageScanFindingsPages(input *DescribeImageScanFindingsInput, fn func(*DescribeImageScanFindingsOutput, bool) bool) error { + return c.DescribeImageScanFindingsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeImageScanFindingsPagesWithContext same as DescribeImageScanFindingsPages 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 *ECR) DescribeImageScanFindingsPagesWithContext(ctx aws.Context, input *DescribeImageScanFindingsInput, fn func(*DescribeImageScanFindingsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeImageScanFindingsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeImageScanFindingsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeImageScanFindingsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opDescribeImages = "DescribeImages" // DescribeImagesRequest generates a "aws/request.Request" representing the @@ -822,8 +987,7 @@ func (c *ECR) DescribeImagesRequest(input *DescribeImagesInput) (req *request.Re // DescribeImages API operation for Amazon EC2 Container Registry. // -// Returns metadata about the images in a repository, including image size, -// image tags, and creation date. +// Returns metadata about the images in a 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 @@ -837,19 +1001,19 @@ func (c *ECR) DescribeImagesRequest(input *DescribeImagesInput) (req *request.Re // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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" +// * ImageNotFoundException // The image requested does not exist in the specified repository. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/DescribeImages @@ -917,10 +1081,12 @@ func (c *ECR) DescribeImagesPagesWithContext(ctx aws.Context, input *DescribeIma }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeImagesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeImagesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -983,15 +1149,15 @@ func (c *ECR) DescribeRepositoriesRequest(input *DescribeRepositoriesInput) (req // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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. // @@ -1060,10 +1226,12 @@ func (c *ECR) DescribeRepositoriesPagesWithContext(ctx aws.Context, input *Descr }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeRepositoriesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeRepositoriesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1111,14 +1279,16 @@ func (c *ECR) GetAuthorizationTokenRequest(input *GetAuthorizationTokenInput) (r // 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. +// Retrieves an authorization token. An authorization token represents your +// IAM authentication credentials and can be used to access any Amazon ECR registry +// that your IAM principal has access to. The authorization token is valid for +// 12 hours. // -// 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. +// The authorizationToken returned 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 get-login-password command that simplifies the login process. +// For more information, see Registry Authentication (https://docs.aws.amazon.com/AmazonECR/latest/userguide/Registries.html#registry_auth) +// in the Amazon Elastic Container Registry User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1127,11 +1297,11 @@ func (c *ECR) GetAuthorizationTokenRequest(input *GetAuthorizationTokenInput) (r // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -1204,6 +1374,9 @@ func (c *ECR) GetDownloadUrlForLayerRequest(input *GetDownloadUrlForLayerInput) // 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. // +// When an image is pulled, the GetDownloadUrlForLayer API is called once per +// 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. @@ -1215,23 +1388,23 @@ func (c *ECR) GetDownloadUrlForLayerRequest(input *GetDownloadUrlForLayerInput) // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeLayersNotFoundException "LayersNotFoundException" +// * LayersNotFoundException // The specified layers could not be found, or the specified layer is not valid // for this repository. // -// * ErrCodeLayerInaccessibleException "LayerInaccessibleException" +// * 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" +// * 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. // @@ -1301,7 +1474,7 @@ func (c *ECR) GetLifecyclePolicyRequest(input *GetLifecyclePolicyInput) (req *re // GetLifecyclePolicy API operation for Amazon EC2 Container Registry. // -// Retrieves the specified lifecycle policy. +// Retrieves the lifecycle policy for the 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 @@ -1310,19 +1483,19 @@ func (c *ECR) GetLifecyclePolicyRequest(input *GetLifecyclePolicyInput) (req *re // See the AWS API reference guide for Amazon EC2 Container Registry's // API operation GetLifecyclePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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. // -// * ErrCodeLifecyclePolicyNotFoundException "LifecyclePolicyNotFoundException" +// * LifecyclePolicyNotFoundException // The lifecycle policy could not be found, and no policy is set to the repository. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetLifecyclePolicy @@ -1378,6 +1551,12 @@ func (c *ECR) GetLifecyclePolicyPreviewRequest(input *GetLifecyclePolicyPreviewI Name: opGetLifecyclePolicyPreview, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, } if input == nil { @@ -1391,7 +1570,8 @@ func (c *ECR) GetLifecyclePolicyPreviewRequest(input *GetLifecyclePolicyPreviewI // GetLifecyclePolicyPreview API operation for Amazon EC2 Container Registry. // -// Retrieves the results of the specified lifecycle policy preview request. +// Retrieves the results of the lifecycle policy preview request for the 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 @@ -1400,19 +1580,19 @@ func (c *ECR) GetLifecyclePolicyPreviewRequest(input *GetLifecyclePolicyPreviewI // See the AWS API reference guide for Amazon EC2 Container Registry's // API operation GetLifecyclePolicyPreview for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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. // -// * ErrCodeLifecyclePolicyPreviewNotFoundException "LifecyclePolicyPreviewNotFoundException" +// * LifecyclePolicyPreviewNotFoundException // There is no dry run for this repository. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/GetLifecyclePolicyPreview @@ -1437,6 +1617,58 @@ func (c *ECR) GetLifecyclePolicyPreviewWithContext(ctx aws.Context, input *GetLi return out, req.Send() } +// GetLifecyclePolicyPreviewPages iterates over the pages of a GetLifecyclePolicyPreview operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See GetLifecyclePolicyPreview 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 GetLifecyclePolicyPreview operation. +// pageNum := 0 +// err := client.GetLifecyclePolicyPreviewPages(params, +// func(page *ecr.GetLifecyclePolicyPreviewOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *ECR) GetLifecyclePolicyPreviewPages(input *GetLifecyclePolicyPreviewInput, fn func(*GetLifecyclePolicyPreviewOutput, bool) bool) error { + return c.GetLifecyclePolicyPreviewPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetLifecyclePolicyPreviewPagesWithContext same as GetLifecyclePolicyPreviewPages 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 *ECR) GetLifecyclePolicyPreviewPagesWithContext(ctx aws.Context, input *GetLifecyclePolicyPreviewInput, fn func(*GetLifecyclePolicyPreviewOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetLifecyclePolicyPreviewInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetLifecyclePolicyPreviewRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*GetLifecyclePolicyPreviewOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opGetRepositoryPolicy = "GetRepositoryPolicy" // GetRepositoryPolicyRequest generates a "aws/request.Request" representing the @@ -1481,7 +1713,7 @@ func (c *ECR) GetRepositoryPolicyRequest(input *GetRepositoryPolicyInput) (req * // GetRepositoryPolicy API operation for Amazon EC2 Container Registry. // -// Retrieves the repository policy for a specified repository. +// Retrieves the repository policy for the 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 @@ -1490,19 +1722,19 @@ func (c *ECR) GetRepositoryPolicyRequest(input *GetRepositoryPolicyInput) (req * // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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" +// * RepositoryPolicyNotFoundException // The specified repository and registry combination does not have an associated // repository policy. // @@ -1572,7 +1804,11 @@ func (c *ECR) InitiateLayerUploadRequest(input *InitiateLayerUploadInput) (req * // InitiateLayerUpload API operation for Amazon EC2 Container Registry. // -// Notify Amazon ECR that you intend to upload an image layer. +// Notifies Amazon ECR that you intend to upload an image layer. +// +// When an image is pushed, the InitiateLayerUpload API is called once per image +// layer that has not already been uploaded. Whether an image layer has been +// uploaded before is determined by the BatchCheckLayerAvailability API action. // // 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 @@ -1585,15 +1821,15 @@ func (c *ECR) InitiateLayerUploadRequest(input *InitiateLayerUploadInput) (req * // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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. // @@ -1669,13 +1905,14 @@ func (c *ECR) ListImagesRequest(input *ListImagesInput) (req *request.Request, o // ListImages API operation for Amazon EC2 Container Registry. // -// Lists all the image IDs for a given repository. +// Lists all the image IDs for the specified 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. +// You can filter images based on whether or not they are tagged by using the +// tagStatus filter and specifying either TAGGED, UNTAGGED or ANY. 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 @@ -1684,15 +1921,15 @@ func (c *ECR) ListImagesRequest(input *ListImagesInput) (req *request.Request, o // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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. // @@ -1761,10 +1998,12 @@ func (c *ECR) ListImagesPagesWithContext(ctx aws.Context, input *ListImagesInput }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListImagesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListImagesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1821,16 +2060,16 @@ func (c *ECR) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req * // See the AWS API reference guide for Amazon EC2 Container Registry's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server-side issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/ListTagsForResource @@ -1901,6 +2140,10 @@ func (c *ECR) PutImageRequest(input *PutImageInput) (req *request.Request, outpu // // Creates or updates the image manifest and tags associated with an image. // +// When an image is pushed and all new image layers have been uploaded, the +// PutImage API is called once to create or update the image manifest and tags +// associated with the 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. @@ -1912,33 +2155,33 @@ func (c *ECR) PutImageRequest(input *PutImageInput) (req *request.Request, outpu // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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" +// * ImageAlreadyExistsException // The specified image has already been pushed, and there were no changes to // the manifest or image tag after the last push. // -// * ErrCodeLayersNotFoundException "LayersNotFoundException" +// * LayersNotFoundException // The specified layers could not be found, or the specified layer is not valid // for this repository. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * 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 // (https://docs.aws.amazon.com/AmazonECR/latest/userguide/service_limits.html) // in the Amazon Elastic Container Registry User Guide. // -// * ErrCodeImageTagAlreadyExistsException "ImageTagAlreadyExistsException" +// * ImageTagAlreadyExistsException // The specified image is tagged with a tag that already exists. The repository // is configured for tag immutability. // @@ -1964,6 +2207,93 @@ func (c *ECR) PutImageWithContext(ctx aws.Context, input *PutImageInput, opts .. return out, req.Send() } +const opPutImageScanningConfiguration = "PutImageScanningConfiguration" + +// PutImageScanningConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the PutImageScanningConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutImageScanningConfiguration for more information on using the PutImageScanningConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutImageScanningConfigurationRequest method. +// req, resp := client.PutImageScanningConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/PutImageScanningConfiguration +func (c *ECR) PutImageScanningConfigurationRequest(input *PutImageScanningConfigurationInput) (req *request.Request, output *PutImageScanningConfigurationOutput) { + op := &request.Operation{ + Name: opPutImageScanningConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutImageScanningConfigurationInput{} + } + + output = &PutImageScanningConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutImageScanningConfiguration API operation for Amazon EC2 Container Registry. +// +// Updates the image scanning configuration for the 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 PutImageScanningConfiguration for usage and error information. +// +// Returned Error Types: +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * 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. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/PutImageScanningConfiguration +func (c *ECR) PutImageScanningConfiguration(input *PutImageScanningConfigurationInput) (*PutImageScanningConfigurationOutput, error) { + req, out := c.PutImageScanningConfigurationRequest(input) + return out, req.Send() +} + +// PutImageScanningConfigurationWithContext is the same as PutImageScanningConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutImageScanningConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ECR) PutImageScanningConfigurationWithContext(ctx aws.Context, input *PutImageScanningConfigurationInput, opts ...request.Option) (*PutImageScanningConfigurationOutput, error) { + req, out := c.PutImageScanningConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opPutImageTagMutability = "PutImageTagMutability" // PutImageTagMutabilityRequest generates a "aws/request.Request" representing the @@ -2008,7 +2338,9 @@ func (c *ECR) PutImageTagMutabilityRequest(input *PutImageTagMutabilityInput) (r // PutImageTagMutability API operation for Amazon EC2 Container Registry. // -// Updates the image tag mutability settings for a repository. +// Updates the image tag mutability settings for the specified repository. For +// more information, see Image Tag Mutability (https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-tag-mutability.html) +// in the Amazon Elastic Container Registry User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2017,15 +2349,15 @@ func (c *ECR) PutImageTagMutabilityRequest(input *PutImageTagMutabilityInput) (r // See the AWS API reference guide for Amazon EC2 Container Registry's // API operation PutImageTagMutability for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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. // @@ -2095,8 +2427,8 @@ func (c *ECR) PutLifecyclePolicyRequest(input *PutLifecyclePolicyInput) (req *re // PutLifecyclePolicy API operation for Amazon EC2 Container Registry. // -// Creates or updates a lifecycle policy. For information about lifecycle policy -// syntax, see Lifecycle Policy Template (https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.html). +// Creates or updates the lifecycle policy for the specified repository. For +// more information, see Lifecycle Policy Template (https://docs.aws.amazon.com/AmazonECR/latest/userguide/LifecyclePolicies.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 @@ -2105,15 +2437,15 @@ func (c *ECR) PutLifecyclePolicyRequest(input *PutLifecyclePolicyInput) (req *re // See the AWS API reference guide for Amazon EC2 Container Registry's // API operation PutLifecyclePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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. // @@ -2183,8 +2515,8 @@ func (c *ECR) SetRepositoryPolicyRequest(input *SetRepositoryPolicyInput) (req * // SetRepositoryPolicy API operation for Amazon EC2 Container Registry. // -// Applies a repository policy on a specified repository to control access permissions. -// For more information, see Amazon ECR Repository Policies (https://docs.aws.amazon.com/AmazonECR/latest/userguide/RepositoryPolicies.html) +// Applies a repository policy to the specified repository to control access +// permissions. For more information, see Amazon ECR Repository Policies (https://docs.aws.amazon.com/AmazonECR/latest/userguide/RepositoryPolicies.html) // in the Amazon Elastic Container Registry User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -2194,15 +2526,15 @@ func (c *ECR) SetRepositoryPolicyRequest(input *SetRepositoryPolicyInput) (req * // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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. // @@ -2228,81 +2560,175 @@ func (c *ECR) SetRepositoryPolicyWithContext(ctx aws.Context, input *SetReposito return out, req.Send() } -const opStartLifecyclePolicyPreview = "StartLifecyclePolicyPreview" +const opStartImageScan = "StartImageScan" -// StartLifecyclePolicyPreviewRequest generates a "aws/request.Request" representing the -// client's request for the StartLifecyclePolicyPreview operation. The "output" return +// StartImageScanRequest generates a "aws/request.Request" representing the +// client's request for the StartImageScan operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StartLifecyclePolicyPreview for more information on using the StartLifecyclePolicyPreview +// See StartImageScan for more information on using the StartImageScan // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StartLifecyclePolicyPreviewRequest method. -// req, resp := client.StartLifecyclePolicyPreviewRequest(params) +// // Example sending a request using the StartImageScanRequest method. +// req, resp := client.StartImageScanRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/StartLifecyclePolicyPreview -func (c *ECR) StartLifecyclePolicyPreviewRequest(input *StartLifecyclePolicyPreviewInput) (req *request.Request, output *StartLifecyclePolicyPreviewOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/StartImageScan +func (c *ECR) StartImageScanRequest(input *StartImageScanInput) (req *request.Request, output *StartImageScanOutput) { op := &request.Operation{ - Name: opStartLifecyclePolicyPreview, + Name: opStartImageScan, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StartLifecyclePolicyPreviewInput{} + input = &StartImageScanInput{} } - output = &StartLifecyclePolicyPreviewOutput{} + output = &StartImageScanOutput{} req = c.newRequest(op, input, output) return } -// StartLifecyclePolicyPreview API operation for Amazon EC2 Container Registry. +// StartImageScan API operation for Amazon EC2 Container Registry. // -// Starts a preview of the specified lifecycle policy. This allows you to see -// the results before creating the lifecycle policy. +// Starts an image vulnerability scan. An image scan can only be started once +// per day on an individual image. This limit includes if an image was scanned +// on initial push. For more information, see Image Scanning (https://docs.aws.amazon.com/AmazonECR/latest/userguide/image-scanning.html) +// in the Amazon Elastic Container Registry User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 StartLifecyclePolicyPreview for usage and error information. +// API operation StartImageScan for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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. // -// * ErrCodeLifecyclePolicyNotFoundException "LifecyclePolicyNotFoundException" -// The lifecycle policy could not be found, and no policy is set to the repository. -// -// * ErrCodeLifecyclePolicyPreviewInProgressException "LifecyclePolicyPreviewInProgressException" -// The previous lifecycle policy preview request has not completed. Please try -// again later. +// * ImageNotFoundException +// The image requested does not exist in the specified repository. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/StartLifecyclePolicyPreview -func (c *ECR) StartLifecyclePolicyPreview(input *StartLifecyclePolicyPreviewInput) (*StartLifecyclePolicyPreviewOutput, error) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/StartImageScan +func (c *ECR) StartImageScan(input *StartImageScanInput) (*StartImageScanOutput, error) { + req, out := c.StartImageScanRequest(input) + return out, req.Send() +} + +// StartImageScanWithContext is the same as StartImageScan with the addition of +// the ability to pass a context and additional request options. +// +// See StartImageScan for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ECR) StartImageScanWithContext(ctx aws.Context, input *StartImageScanInput, opts ...request.Option) (*StartImageScanOutput, error) { + req, out := c.StartImageScanRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartLifecyclePolicyPreview = "StartLifecyclePolicyPreview" + +// StartLifecyclePolicyPreviewRequest generates a "aws/request.Request" representing the +// client's request for the StartLifecyclePolicyPreview operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartLifecyclePolicyPreview for more information on using the StartLifecyclePolicyPreview +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartLifecyclePolicyPreviewRequest method. +// req, resp := client.StartLifecyclePolicyPreviewRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/StartLifecyclePolicyPreview +func (c *ECR) StartLifecyclePolicyPreviewRequest(input *StartLifecyclePolicyPreviewInput) (req *request.Request, output *StartLifecyclePolicyPreviewOutput) { + op := &request.Operation{ + Name: opStartLifecyclePolicyPreview, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StartLifecyclePolicyPreviewInput{} + } + + output = &StartLifecyclePolicyPreviewOutput{} + req = c.newRequest(op, input, output) + return +} + +// StartLifecyclePolicyPreview API operation for Amazon EC2 Container Registry. +// +// Starts a preview of a lifecycle policy for the specified repository. This +// allows you to see the results before associating the lifecycle policy with +// the 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 StartLifecyclePolicyPreview for usage and error information. +// +// Returned Error Types: +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * 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. +// +// * LifecyclePolicyNotFoundException +// The lifecycle policy could not be found, and no policy is set to the repository. +// +// * LifecyclePolicyPreviewInProgressException +// The previous lifecycle policy preview request has not completed. Please try +// again later. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/StartLifecyclePolicyPreview +func (c *ECR) StartLifecyclePolicyPreview(input *StartLifecyclePolicyPreviewInput) (*StartLifecyclePolicyPreviewOutput, error) { req, out := c.StartLifecyclePolicyPreviewRequest(input) return out, req.Send() } @@ -2378,25 +2804,25 @@ func (c *ECR) TagResourceRequest(input *TagResourceInput) (req *request.Request, // See the AWS API reference guide for Amazon EC2 Container Registry's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeInvalidTagParameterException "InvalidTagParameterException" +// * InvalidTagParameterException // An invalid parameter has been specified. Tag keys can have a maximum character // length of 128 characters, and tag values can have a maximum length of 256 // characters. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // The list of tags on the repository is over the limit. The maximum number // of tags that can be applied to a repository is 50. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server-side issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/TagResource @@ -2475,25 +2901,25 @@ func (c *ECR) UntagResourceRequest(input *UntagResourceInput) (req *request.Requ // See the AWS API reference guide for Amazon EC2 Container Registry's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeInvalidTagParameterException "InvalidTagParameterException" +// * InvalidTagParameterException // An invalid parameter has been specified. Tag keys can have a maximum character // length of 128 characters, and tag values can have a maximum length of 256 // characters. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // The list of tags on the repository is over the limit. The maximum number // of tags that can be applied to a repository is 50. // -// * ErrCodeRepositoryNotFoundException "RepositoryNotFoundException" +// * 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. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server-side issue. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ecr-2015-09-21/UntagResource @@ -2564,6 +2990,10 @@ func (c *ECR) UploadLayerPartRequest(input *UploadLayerPartInput) (req *request. // // Uploads an image layer part to Amazon ECR. // +// When an image is pushed, each new image layer is uploaded in parts. The maximum +// size of each image layer part can be 20971520 bytes (or about 20MB). The +// UploadLayerPart API is called once per each new image layer part. +// // 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. @@ -2575,27 +3005,27 @@ func (c *ECR) UploadLayerPartRequest(input *UploadLayerPartInput) (req *request. // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeInvalidLayerPartException "InvalidLayerPartException" +// * 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" +// * 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" +// * UploadNotFoundException // The upload could not be found, or the specified upload id is not valid for // this repository. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * 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 // (https://docs.aws.amazon.com/AmazonECR/latest/userguide/service_limits.html) @@ -2623,6 +3053,41 @@ func (c *ECR) UploadLayerPartWithContext(ctx aws.Context, input *UploadLayerPart return out, req.Send() } +// This data type is used in the ImageScanFinding data type. +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() +} + +// 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 +} + // An object representing authorization data for an Amazon ECR registry. type AuthorizationData struct { _ struct{} `type:"structure"` @@ -3146,6 +3611,11 @@ func (s *CompleteLayerUploadOutput) SetUploadId(v string) *CompleteLayerUploadOu type CreateRepositoryInput struct { _ struct{} `type:"structure"` + // The image scanning configuration for the repository. This setting determines + // whether images are scanned for known vulnerabilities after being pushed to + // the repository. + ImageScanningConfiguration *ImageScanningConfiguration `locationName:"imageScanningConfiguration" type:"structure"` + // The tag mutability setting for the repository. If this parameter is omitted, // the default setting of MUTABLE will be used which will allow image tags to // be overwritten. If IMMUTABLE is specified, all image tags within the repository @@ -3192,6 +3662,12 @@ func (s *CreateRepositoryInput) Validate() error { return nil } +// SetImageScanningConfiguration sets the ImageScanningConfiguration field's value. +func (s *CreateRepositoryInput) SetImageScanningConfiguration(v *ImageScanningConfiguration) *CreateRepositoryInput { + s.ImageScanningConfiguration = v + return s +} + // SetImageTagMutability sets the ImageTagMutability field's value. func (s *CreateRepositoryInput) SetImageTagMutability(v string) *CreateRepositoryInput { s.ImageTagMutability = &v @@ -3511,6 +3987,180 @@ func (s *DeleteRepositoryPolicyOutput) SetRepositoryName(v string) *DeleteReposi return s } +type DescribeImageScanFindingsInput struct { + _ struct{} `type:"structure"` + + // An object with identifying information for an Amazon ECR image. + // + // ImageId is a required field + ImageId *ImageIdentifier `locationName:"imageId" type:"structure" required:"true"` + + // The maximum number of image scan results returned by DescribeImageScanFindings + // in paginated output. When this parameter is used, DescribeImageScanFindings + // 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 DescribeImageScanFindings request with the returned nextToken value. + // This value can be between 1 and 1000. If this parameter is not used, then + // DescribeImageScanFindings 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 DescribeImageScanFindings + // 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 the image scan findings for. If you do not specify a + // registry, the default registry is assumed. + RegistryId *string `locationName:"registryId" type:"string"` + + // The repository for the image for which to describe the scan findings. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeImageScanFindingsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeImageScanFindingsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeImageScanFindingsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeImageScanFindingsInput"} + if s.ImageId == nil { + invalidParams.Add(request.NewErrParamRequired("ImageId")) + } + 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 s.ImageId != nil { + if err := s.ImageId.Validate(); err != nil { + invalidParams.AddNested("ImageId", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetImageId sets the ImageId field's value. +func (s *DescribeImageScanFindingsInput) SetImageId(v *ImageIdentifier) *DescribeImageScanFindingsInput { + s.ImageId = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeImageScanFindingsInput) SetMaxResults(v int64) *DescribeImageScanFindingsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeImageScanFindingsInput) SetNextToken(v string) *DescribeImageScanFindingsInput { + s.NextToken = &v + return s +} + +// SetRegistryId sets the RegistryId field's value. +func (s *DescribeImageScanFindingsInput) SetRegistryId(v string) *DescribeImageScanFindingsInput { + s.RegistryId = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *DescribeImageScanFindingsInput) SetRepositoryName(v string) *DescribeImageScanFindingsInput { + s.RepositoryName = &v + return s +} + +type DescribeImageScanFindingsOutput struct { + _ struct{} `type:"structure"` + + // An object with identifying information for an Amazon ECR image. + ImageId *ImageIdentifier `locationName:"imageId" type:"structure"` + + // The information contained in the image scan findings. + ImageScanFindings *ImageScanFindings `locationName:"imageScanFindings" type:"structure"` + + // The current state of the scan. + ImageScanStatus *ImageScanStatus `locationName:"imageScanStatus" type:"structure"` + + // The nextToken value to include in a future DescribeImageScanFindings request. + // When the results of a DescribeImageScanFindings 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 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 DescribeImageScanFindingsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeImageScanFindingsOutput) GoString() string { + return s.String() +} + +// SetImageId sets the ImageId field's value. +func (s *DescribeImageScanFindingsOutput) SetImageId(v *ImageIdentifier) *DescribeImageScanFindingsOutput { + s.ImageId = v + return s +} + +// SetImageScanFindings sets the ImageScanFindings field's value. +func (s *DescribeImageScanFindingsOutput) SetImageScanFindings(v *ImageScanFindings) *DescribeImageScanFindingsOutput { + s.ImageScanFindings = v + return s +} + +// SetImageScanStatus sets the ImageScanStatus field's value. +func (s *DescribeImageScanFindingsOutput) SetImageScanStatus(v *ImageScanStatus) *DescribeImageScanFindingsOutput { + s.ImageScanStatus = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeImageScanFindingsOutput) SetNextToken(v string) *DescribeImageScanFindingsOutput { + s.NextToken = &v + return s +} + +// SetRegistryId sets the RegistryId field's value. +func (s *DescribeImageScanFindingsOutput) SetRegistryId(v string) *DescribeImageScanFindingsOutput { + s.RegistryId = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *DescribeImageScanFindingsOutput) SetRepositoryName(v string) *DescribeImageScanFindingsOutput { + s.RepositoryName = &v + return s +} + // An object representing a filter on a DescribeImages operation. type DescribeImagesFilter struct { _ struct{} `type:"structure"` @@ -3805,34 +4455,91 @@ func (s *DescribeRepositoriesOutput) SetRepositories(v []*Repository) *DescribeR return s } -type GetAuthorizationTokenInput struct { - _ struct{} `type:"structure"` +// The specified layer upload does not contain any layer parts. +type EmptyUploadException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GetAuthorizationTokenInput) String() string { +func (s EmptyUploadException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetAuthorizationTokenInput) GoString() string { +func (s EmptyUploadException) 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)) +func newErrorEmptyUploadException(v protocol.ResponseMetadata) error { + return &EmptyUploadException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s EmptyUploadException) Code() string { + return "EmptyUploadException" +} + +// Message returns the exception's message. +func (s EmptyUploadException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EmptyUploadException) OrigErr() error { + return nil +} + +func (s EmptyUploadException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EmptyUploadException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EmptyUploadException) RequestID() string { + return s.respMetadata.RequestID +} + +type GetAuthorizationTokenInput struct { + _ struct{} `type:"structure"` + + // A list of AWS account IDs that are associated with the registries for which + // to get AuthorizationData objects. 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 } @@ -4361,7 +5068,7 @@ type Image struct { ImageId *ImageIdentifier `locationName:"imageId" type:"structure"` // The image manifest associated with the image. - ImageManifest *string `locationName:"imageManifest" type:"string"` + ImageManifest *string `locationName:"imageManifest" min:"1" type:"string"` // The AWS account ID associated with the registry containing the image. RegistryId *string `locationName:"registryId" type:"string"` @@ -4404,6 +5111,64 @@ func (s *Image) SetRepositoryName(v string) *Image { return s } +// The specified image has already been pushed, and there were no changes to +// the manifest or image tag after the last push. +type ImageAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ImageAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImageAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorImageAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ImageAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ImageAlreadyExistsException) Code() string { + return "ImageAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ImageAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ImageAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ImageAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ImageAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ImageAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + // An object that describes an image returned by a DescribeImages operation. type ImageDetail struct { _ struct{} `type:"structure"` @@ -4415,6 +5180,12 @@ type ImageDetail struct { // the current image was pushed to the repository. ImagePushedAt *time.Time `locationName:"imagePushedAt" type:"timestamp"` + // A summary of the last completed image scan. + ImageScanFindingsSummary *ImageScanFindingsSummary `locationName:"imageScanFindingsSummary" type:"structure"` + + // The current state of the scan. + ImageScanStatus *ImageScanStatus `locationName:"imageScanStatus" type:"structure"` + // The size, in bytes, of the image in the repository. // // Beginning with Docker version 1.9, the Docker client compresses image layers @@ -4455,6 +5226,18 @@ func (s *ImageDetail) SetImagePushedAt(v time.Time) *ImageDetail { return s } +// SetImageScanFindingsSummary sets the ImageScanFindingsSummary field's value. +func (s *ImageDetail) SetImageScanFindingsSummary(v *ImageScanFindingsSummary) *ImageDetail { + s.ImageScanFindingsSummary = v + return s +} + +// SetImageScanStatus sets the ImageScanStatus field's value. +func (s *ImageDetail) SetImageScanStatus(v *ImageScanStatus) *ImageDetail { + s.ImageScanStatus = v + return s +} + // SetImageSizeInBytes sets the ImageSizeInBytes field's value. func (s *ImageDetail) SetImageSizeInBytes(v int64) *ImageDetail { s.ImageSizeInBytes = &v @@ -4567,290 +5350,1261 @@ func (s *ImageIdentifier) SetImageTag(v string) *ImageIdentifier { return s } -type InitiateLayerUploadInput struct { - _ struct{} `type:"structure"` - - // The AWS account ID associated with the registry to which you intend to upload - // layers. If you do not specify a registry, the default registry is assumed. - RegistryId *string `locationName:"registryId" type:"string"` +// The image requested does not exist in the specified repository. +type ImageNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The name of the repository to which you intend to upload layers. - // - // RepositoryName is a required field - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s InitiateLayerUploadInput) String() string { +func (s ImageNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InitiateLayerUploadInput) GoString() string { +func (s ImageNotFoundException) 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)) +func newErrorImageNotFoundException(v protocol.ResponseMetadata) error { + return &ImageNotFoundException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s ImageNotFoundException) Code() string { + return "ImageNotFoundException" +} + +// Message returns the exception's message. +func (s ImageNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ImageNotFoundException) OrigErr() error { return nil } -// SetRegistryId sets the RegistryId field's value. -func (s *InitiateLayerUploadInput) SetRegistryId(v string) *InitiateLayerUploadInput { - s.RegistryId = &v - return s +func (s ImageNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetRepositoryName sets the RepositoryName field's value. -func (s *InitiateLayerUploadInput) SetRepositoryName(v string) *InitiateLayerUploadInput { - s.RepositoryName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ImageNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode } -type InitiateLayerUploadOutput struct { +// RequestID returns the service's response RequestID for request. +func (s ImageNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Contains information about an image scan finding. +type ImageScanFinding struct { _ struct{} `type:"structure"` - // The size, in bytes, that Amazon ECR expects future layer part uploads to - // be. - PartSize *int64 `locationName:"partSize" type:"long"` + // A collection of attributes of the host from which the finding is generated. + Attributes []*Attribute `locationName:"attributes" type:"list"` - // The upload ID for the layer upload. This parameter is passed to further UploadLayerPart - // and CompleteLayerUpload operations. - UploadId *string `locationName:"uploadId" type:"string"` + // The description of the finding. + Description *string `locationName:"description" type:"string"` + + // The name associated with the finding, usually a CVE number. + Name *string `locationName:"name" type:"string"` + + // The finding severity. + Severity *string `locationName:"severity" type:"string" enum:"FindingSeverity"` + + // A link containing additional details about the security vulnerability. + Uri *string `locationName:"uri" type:"string"` } // String returns the string representation -func (s InitiateLayerUploadOutput) String() string { +func (s ImageScanFinding) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InitiateLayerUploadOutput) GoString() string { +func (s ImageScanFinding) GoString() string { return s.String() } -// SetPartSize sets the PartSize field's value. -func (s *InitiateLayerUploadOutput) SetPartSize(v int64) *InitiateLayerUploadOutput { - s.PartSize = &v +// SetAttributes sets the Attributes field's value. +func (s *ImageScanFinding) SetAttributes(v []*Attribute) *ImageScanFinding { + s.Attributes = v return s } -// SetUploadId sets the UploadId field's value. -func (s *InitiateLayerUploadOutput) SetUploadId(v string) *InitiateLayerUploadOutput { - s.UploadId = &v +// SetDescription sets the Description field's value. +func (s *ImageScanFinding) SetDescription(v string) *ImageScanFinding { + s.Description = &v return s } -// An object representing an Amazon ECR image layer. -type Layer struct { +// SetName sets the Name field's value. +func (s *ImageScanFinding) SetName(v string) *ImageScanFinding { + s.Name = &v + return s +} + +// SetSeverity sets the Severity field's value. +func (s *ImageScanFinding) SetSeverity(v string) *ImageScanFinding { + s.Severity = &v + return s +} + +// SetUri sets the Uri field's value. +func (s *ImageScanFinding) SetUri(v string) *ImageScanFinding { + s.Uri = &v + return s +} + +// The details of an image scan. +type ImageScanFindings struct { _ struct{} `type:"structure"` - // The availability status of the image layer. - LayerAvailability *string `locationName:"layerAvailability" type:"string" enum:"LayerAvailability"` + // The image vulnerability counts, sorted by severity. + FindingSeverityCounts map[string]*int64 `locationName:"findingSeverityCounts" type:"map"` - // The sha256 digest of the image layer. - LayerDigest *string `locationName:"layerDigest" type:"string"` + // The findings from the image scan. + Findings []*ImageScanFinding `locationName:"findings" type:"list"` - // The size, in bytes, of the image layer. - LayerSize *int64 `locationName:"layerSize" type:"long"` + // The time of the last completed image scan. + ImageScanCompletedAt *time.Time `locationName:"imageScanCompletedAt" type:"timestamp"` - // 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"` + // The time when the vulnerability data was last scanned. + VulnerabilitySourceUpdatedAt *time.Time `locationName:"vulnerabilitySourceUpdatedAt" type:"timestamp"` } // String returns the string representation -func (s Layer) String() string { +func (s ImageScanFindings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Layer) GoString() string { +func (s ImageScanFindings) GoString() string { return s.String() } -// SetLayerAvailability sets the LayerAvailability field's value. -func (s *Layer) SetLayerAvailability(v string) *Layer { - s.LayerAvailability = &v +// SetFindingSeverityCounts sets the FindingSeverityCounts field's value. +func (s *ImageScanFindings) SetFindingSeverityCounts(v map[string]*int64) *ImageScanFindings { + s.FindingSeverityCounts = v return s } -// SetLayerDigest sets the LayerDigest field's value. -func (s *Layer) SetLayerDigest(v string) *Layer { - s.LayerDigest = &v +// SetFindings sets the Findings field's value. +func (s *ImageScanFindings) SetFindings(v []*ImageScanFinding) *ImageScanFindings { + s.Findings = v return s } -// SetLayerSize sets the LayerSize field's value. -func (s *Layer) SetLayerSize(v int64) *Layer { - s.LayerSize = &v +// SetImageScanCompletedAt sets the ImageScanCompletedAt field's value. +func (s *ImageScanFindings) SetImageScanCompletedAt(v time.Time) *ImageScanFindings { + s.ImageScanCompletedAt = &v return s } -// SetMediaType sets the MediaType field's value. -func (s *Layer) SetMediaType(v string) *Layer { - s.MediaType = &v +// SetVulnerabilitySourceUpdatedAt sets the VulnerabilitySourceUpdatedAt field's value. +func (s *ImageScanFindings) SetVulnerabilitySourceUpdatedAt(v time.Time) *ImageScanFindings { + s.VulnerabilitySourceUpdatedAt = &v return s } -// An object representing an Amazon ECR image layer failure. -type LayerFailure struct { +// A summary of the last completed image scan. +type ImageScanFindingsSummary struct { _ struct{} `type:"structure"` - // The failure code associated with the failure. - FailureCode *string `locationName:"failureCode" type:"string" enum:"LayerFailureCode"` + // The image vulnerability counts, sorted by severity. + FindingSeverityCounts map[string]*int64 `locationName:"findingSeverityCounts" type:"map"` - // The reason for the failure. - FailureReason *string `locationName:"failureReason" type:"string"` + // The time of the last completed image scan. + ImageScanCompletedAt *time.Time `locationName:"imageScanCompletedAt" type:"timestamp"` - // The layer digest associated with the failure. - LayerDigest *string `locationName:"layerDigest" type:"string"` + // The time when the vulnerability data was last scanned. + VulnerabilitySourceUpdatedAt *time.Time `locationName:"vulnerabilitySourceUpdatedAt" type:"timestamp"` } // String returns the string representation -func (s LayerFailure) String() string { +func (s ImageScanFindingsSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LayerFailure) GoString() string { +func (s ImageScanFindingsSummary) GoString() string { return s.String() } -// SetFailureCode sets the FailureCode field's value. -func (s *LayerFailure) SetFailureCode(v string) *LayerFailure { - s.FailureCode = &v +// SetFindingSeverityCounts sets the FindingSeverityCounts field's value. +func (s *ImageScanFindingsSummary) SetFindingSeverityCounts(v map[string]*int64) *ImageScanFindingsSummary { + s.FindingSeverityCounts = v return s } -// SetFailureReason sets the FailureReason field's value. -func (s *LayerFailure) SetFailureReason(v string) *LayerFailure { - s.FailureReason = &v +// SetImageScanCompletedAt sets the ImageScanCompletedAt field's value. +func (s *ImageScanFindingsSummary) SetImageScanCompletedAt(v time.Time) *ImageScanFindingsSummary { + s.ImageScanCompletedAt = &v return s } -// SetLayerDigest sets the LayerDigest field's value. -func (s *LayerFailure) SetLayerDigest(v string) *LayerFailure { - s.LayerDigest = &v +// SetVulnerabilitySourceUpdatedAt sets the VulnerabilitySourceUpdatedAt field's value. +func (s *ImageScanFindingsSummary) SetVulnerabilitySourceUpdatedAt(v time.Time) *ImageScanFindingsSummary { + s.VulnerabilitySourceUpdatedAt = &v return s } -// The filter for the lifecycle policy preview. -type LifecyclePolicyPreviewFilter struct { +// The current status of an image scan. +type ImageScanStatus struct { _ struct{} `type:"structure"` - // The tag status of the image. - TagStatus *string `locationName:"tagStatus" type:"string" enum:"TagStatus"` + // The description of the image scan status. + Description *string `locationName:"description" type:"string"` + + // The current state of an image scan. + Status *string `locationName:"status" type:"string" enum:"ScanStatus"` } // String returns the string representation -func (s LifecyclePolicyPreviewFilter) String() string { +func (s ImageScanStatus) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LifecyclePolicyPreviewFilter) GoString() string { +func (s ImageScanStatus) GoString() string { return s.String() } -// SetTagStatus sets the TagStatus field's value. -func (s *LifecyclePolicyPreviewFilter) SetTagStatus(v string) *LifecyclePolicyPreviewFilter { - s.TagStatus = &v +// SetDescription sets the Description field's value. +func (s *ImageScanStatus) SetDescription(v string) *ImageScanStatus { + s.Description = &v return s } -// The result of the lifecycle policy preview. -type LifecyclePolicyPreviewResult struct { - _ struct{} `type:"structure"` - - // The type of action to be taken. - Action *LifecyclePolicyRuleAction `locationName:"action" type:"structure"` - - // The priority of the applied rule. - AppliedRulePriority *int64 `locationName:"appliedRulePriority" min:"1" type:"integer"` - - // The sha256 digest of the image manifest. - ImageDigest *string `locationName:"imageDigest" type:"string"` +// SetStatus sets the Status field's value. +func (s *ImageScanStatus) SetStatus(v string) *ImageScanStatus { + s.Status = &v + return s +} - // 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"` +// The image scanning configuration for a repository. +type ImageScanningConfiguration struct { + _ struct{} `type:"structure"` - // The list of tags associated with this image. - ImageTags []*string `locationName:"imageTags" type:"list"` + // The setting that determines whether images are scanned after being pushed + // to a repository. If set to true, images will be scanned after being pushed. + // If this parameter is not specified, it will default to false and images will + // not be scanned unless a scan is manually started with the StartImageScan + // API. + ScanOnPush *bool `locationName:"scanOnPush" type:"boolean"` } // String returns the string representation -func (s LifecyclePolicyPreviewResult) String() string { +func (s ImageScanningConfiguration) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LifecyclePolicyPreviewResult) GoString() string { +func (s ImageScanningConfiguration) GoString() string { return s.String() } -// SetAction sets the Action field's value. -func (s *LifecyclePolicyPreviewResult) SetAction(v *LifecyclePolicyRuleAction) *LifecyclePolicyPreviewResult { - s.Action = v +// SetScanOnPush sets the ScanOnPush field's value. +func (s *ImageScanningConfiguration) SetScanOnPush(v bool) *ImageScanningConfiguration { + s.ScanOnPush = &v return s } -// SetAppliedRulePriority sets the AppliedRulePriority field's value. -func (s *LifecyclePolicyPreviewResult) SetAppliedRulePriority(v int64) *LifecyclePolicyPreviewResult { - s.AppliedRulePriority = &v - return s +// The specified image is tagged with a tag that already exists. The repository +// is configured for tag immutability. +type ImageTagAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetImageDigest sets the ImageDigest field's value. -func (s *LifecyclePolicyPreviewResult) SetImageDigest(v string) *LifecyclePolicyPreviewResult { - s.ImageDigest = &v - return s +// String returns the string representation +func (s ImageTagAlreadyExistsException) String() string { + return awsutil.Prettify(s) } -// SetImagePushedAt sets the ImagePushedAt field's value. -func (s *LifecyclePolicyPreviewResult) SetImagePushedAt(v time.Time) *LifecyclePolicyPreviewResult { - s.ImagePushedAt = &v - return s +// GoString returns the string representation +func (s ImageTagAlreadyExistsException) GoString() string { + return s.String() } -// SetImageTags sets the ImageTags field's value. -func (s *LifecyclePolicyPreviewResult) SetImageTags(v []*string) *LifecyclePolicyPreviewResult { - s.ImageTags = v - return s +func newErrorImageTagAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ImageTagAlreadyExistsException{ + respMetadata: v, + } } -// The summary of the lifecycle policy preview request. -type LifecyclePolicyPreviewSummary struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s ImageTagAlreadyExistsException) Code() string { + return "ImageTagAlreadyExistsException" +} - // The number of expiring images. - ExpiringImageTotalCount *int64 `locationName:"expiringImageTotalCount" type:"integer"` +// Message returns the exception's message. +func (s ImageTagAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s LifecyclePolicyPreviewSummary) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ImageTagAlreadyExistsException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s LifecyclePolicyPreviewSummary) GoString() string { - return s.String() +func (s ImageTagAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetExpiringImageTotalCount sets the ExpiringImageTotalCount field's value. -func (s *LifecyclePolicyPreviewSummary) SetExpiringImageTotalCount(v int64) *LifecyclePolicyPreviewSummary { +// Status code returns the HTTP status code for the request's response error. +func (s ImageTagAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ImageTagAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +type InitiateLayerUploadInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID associated with the registry to which you intend 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 which you intend to upload layers. + // + // 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 +} + +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 +} + +// The layer digest calculation performed by Amazon ECR upon receipt of the +// image layer does not match the digest specified. +type InvalidLayerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidLayerException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidLayerException) GoString() string { + return s.String() +} + +func newErrorInvalidLayerException(v protocol.ResponseMetadata) error { + return &InvalidLayerException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidLayerException) Code() string { + return "InvalidLayerException" +} + +// Message returns the exception's message. +func (s InvalidLayerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidLayerException) OrigErr() error { + return nil +} + +func (s InvalidLayerException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidLayerException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidLayerException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type InvalidLayerPartException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The last valid byte received from the layer part upload that is associated + // with the exception. + LastValidByteReceived *int64 `locationName:"lastValidByteReceived" type:"long"` + + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` + + // The registry ID associated with the exception. + RegistryId *string `locationName:"registryId" type:"string"` + + // The repository name associated with the exception. + RepositoryName *string `locationName:"repositoryName" min:"2" type:"string"` + + // The upload ID associated with the exception. + UploadId *string `locationName:"uploadId" type:"string"` +} + +// String returns the string representation +func (s InvalidLayerPartException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidLayerPartException) GoString() string { + return s.String() +} + +func newErrorInvalidLayerPartException(v protocol.ResponseMetadata) error { + return &InvalidLayerPartException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidLayerPartException) Code() string { + return "InvalidLayerPartException" +} + +// Message returns the exception's message. +func (s InvalidLayerPartException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidLayerPartException) OrigErr() error { + return nil +} + +func (s InvalidLayerPartException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidLayerPartException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidLayerPartException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified parameter is invalid. Review the available parameters for the +// API request. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} + +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// An invalid parameter has been specified. Tag keys can have a maximum character +// length of 128 characters, and tag values can have a maximum length of 256 +// characters. +type InvalidTagParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidTagParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidTagParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidTagParameterException(v protocol.ResponseMetadata) error { + return &InvalidTagParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidTagParameterException) Code() string { + return "InvalidTagParameterException" +} + +// Message returns the exception's message. +func (s InvalidTagParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTagParameterException) OrigErr() error { + return nil +} + +func (s InvalidTagParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTagParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidTagParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// An object representing an Amazon ECR image 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 +} + +// The image layer already exists in the associated repository. +type LayerAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LayerAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LayerAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorLayerAlreadyExistsException(v protocol.ResponseMetadata) error { + return &LayerAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LayerAlreadyExistsException) Code() string { + return "LayerAlreadyExistsException" +} + +// Message returns the exception's message. +func (s LayerAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LayerAlreadyExistsException) OrigErr() error { + return nil +} + +func (s LayerAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LayerAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LayerAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// An object representing an Amazon ECR image layer failure. +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 +} + +// The specified layer is not available because it is not associated with an +// image. Unassociated image layers may be cleaned up at any time. +type LayerInaccessibleException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LayerInaccessibleException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LayerInaccessibleException) GoString() string { + return s.String() +} + +func newErrorLayerInaccessibleException(v protocol.ResponseMetadata) error { + return &LayerInaccessibleException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LayerInaccessibleException) Code() string { + return "LayerInaccessibleException" +} + +// Message returns the exception's message. +func (s LayerInaccessibleException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LayerInaccessibleException) OrigErr() error { + return nil +} + +func (s LayerInaccessibleException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LayerInaccessibleException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LayerInaccessibleException) RequestID() string { + return s.respMetadata.RequestID +} + +// Layer parts must be at least 5 MiB in size. +type LayerPartTooSmallException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LayerPartTooSmallException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LayerPartTooSmallException) GoString() string { + return s.String() +} + +func newErrorLayerPartTooSmallException(v protocol.ResponseMetadata) error { + return &LayerPartTooSmallException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LayerPartTooSmallException) Code() string { + return "LayerPartTooSmallException" +} + +// Message returns the exception's message. +func (s LayerPartTooSmallException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LayerPartTooSmallException) OrigErr() error { + return nil +} + +func (s LayerPartTooSmallException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LayerPartTooSmallException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LayerPartTooSmallException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified layers could not be found, or the specified layer is not valid +// for this repository. +type LayersNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LayersNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LayersNotFoundException) GoString() string { + return s.String() +} + +func newErrorLayersNotFoundException(v protocol.ResponseMetadata) error { + return &LayersNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LayersNotFoundException) Code() string { + return "LayersNotFoundException" +} + +// Message returns the exception's message. +func (s LayersNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LayersNotFoundException) OrigErr() error { + return nil +} + +func (s LayersNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LayersNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LayersNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The lifecycle policy could not be found, and no policy is set to the repository. +type LifecyclePolicyNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LifecyclePolicyNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecyclePolicyNotFoundException) GoString() string { + return s.String() +} + +func newErrorLifecyclePolicyNotFoundException(v protocol.ResponseMetadata) error { + return &LifecyclePolicyNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LifecyclePolicyNotFoundException) Code() string { + return "LifecyclePolicyNotFoundException" +} + +// Message returns the exception's message. +func (s LifecyclePolicyNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LifecyclePolicyNotFoundException) OrigErr() error { + return nil +} + +func (s LifecyclePolicyNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LifecyclePolicyNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LifecyclePolicyNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The filter for the lifecycle policy preview. +type LifecyclePolicyPreviewFilter struct { + _ struct{} `type:"structure"` + + // The tag status of the image. + TagStatus *string `locationName:"tagStatus" type:"string" enum:"TagStatus"` +} + +// String returns the string representation +func (s LifecyclePolicyPreviewFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecyclePolicyPreviewFilter) GoString() string { + return s.String() +} + +// SetTagStatus sets the TagStatus field's value. +func (s *LifecyclePolicyPreviewFilter) SetTagStatus(v string) *LifecyclePolicyPreviewFilter { + s.TagStatus = &v + return s +} + +// The previous lifecycle policy preview request has not completed. Please try +// again later. +type LifecyclePolicyPreviewInProgressException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LifecyclePolicyPreviewInProgressException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecyclePolicyPreviewInProgressException) GoString() string { + return s.String() +} + +func newErrorLifecyclePolicyPreviewInProgressException(v protocol.ResponseMetadata) error { + return &LifecyclePolicyPreviewInProgressException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LifecyclePolicyPreviewInProgressException) Code() string { + return "LifecyclePolicyPreviewInProgressException" +} + +// Message returns the exception's message. +func (s LifecyclePolicyPreviewInProgressException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LifecyclePolicyPreviewInProgressException) OrigErr() error { + return nil +} + +func (s LifecyclePolicyPreviewInProgressException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LifecyclePolicyPreviewInProgressException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LifecyclePolicyPreviewInProgressException) RequestID() string { + return s.respMetadata.RequestID +} + +// There is no dry run for this repository. +type LifecyclePolicyPreviewNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LifecyclePolicyPreviewNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecyclePolicyPreviewNotFoundException) GoString() string { + return s.String() +} + +func newErrorLifecyclePolicyPreviewNotFoundException(v protocol.ResponseMetadata) error { + return &LifecyclePolicyPreviewNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LifecyclePolicyPreviewNotFoundException) Code() string { + return "LifecyclePolicyPreviewNotFoundException" +} + +// Message returns the exception's message. +func (s LifecyclePolicyPreviewNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LifecyclePolicyPreviewNotFoundException) OrigErr() error { + return nil +} + +func (s LifecyclePolicyPreviewNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LifecyclePolicyPreviewNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LifecyclePolicyPreviewNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The result of the lifecycle policy preview. +type LifecyclePolicyPreviewResult struct { + _ struct{} `type:"structure"` + + // The type of action to be taken. + Action *LifecyclePolicyRuleAction `locationName:"action" type:"structure"` + + // The priority of the applied rule. + AppliedRulePriority *int64 `locationName:"appliedRulePriority" min:"1" type:"integer"` + + // 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"` + + // The list of tags associated with this image. + ImageTags []*string `locationName:"imageTags" type:"list"` +} + +// String returns the string representation +func (s LifecyclePolicyPreviewResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecyclePolicyPreviewResult) GoString() string { + return s.String() +} + +// SetAction sets the Action field's value. +func (s *LifecyclePolicyPreviewResult) SetAction(v *LifecyclePolicyRuleAction) *LifecyclePolicyPreviewResult { + s.Action = v + return s +} + +// SetAppliedRulePriority sets the AppliedRulePriority field's value. +func (s *LifecyclePolicyPreviewResult) SetAppliedRulePriority(v int64) *LifecyclePolicyPreviewResult { + s.AppliedRulePriority = &v + return s +} + +// SetImageDigest sets the ImageDigest field's value. +func (s *LifecyclePolicyPreviewResult) SetImageDigest(v string) *LifecyclePolicyPreviewResult { + s.ImageDigest = &v + return s +} + +// SetImagePushedAt sets the ImagePushedAt field's value. +func (s *LifecyclePolicyPreviewResult) SetImagePushedAt(v time.Time) *LifecyclePolicyPreviewResult { + s.ImagePushedAt = &v + return s +} + +// SetImageTags sets the ImageTags field's value. +func (s *LifecyclePolicyPreviewResult) SetImageTags(v []*string) *LifecyclePolicyPreviewResult { + s.ImageTags = v + return s +} + +// The summary of the lifecycle policy preview request. +type LifecyclePolicyPreviewSummary struct { + _ struct{} `type:"structure"` + + // The number of expiring images. + ExpiringImageTotalCount *int64 `locationName:"expiringImageTotalCount" type:"integer"` +} + +// String returns the string representation +func (s LifecyclePolicyPreviewSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LifecyclePolicyPreviewSummary) GoString() string { + return s.String() +} + +// SetExpiringImageTotalCount sets the ExpiringImageTotalCount field's value. +func (s *LifecyclePolicyPreviewSummary) SetExpiringImageTotalCount(v int64) *LifecyclePolicyPreviewSummary { s.ExpiringImageTotalCount = &v return s } @@ -4879,6 +6633,66 @@ func (s *LifecyclePolicyRuleAction) SetType(v string) *LifecyclePolicyRuleAction return s } +// 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 +// (https://docs.aws.amazon.com/AmazonECR/latest/userguide/service_limits.html) +// in the Amazon Elastic Container Registry User Guide. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // An object representing a filter on a ListImages operation. type ListImagesFilter struct { _ struct{} `type:"structure"` @@ -5101,7 +6915,7 @@ type PutImageInput struct { // The image manifest corresponding to the image to be uploaded. // // ImageManifest is a required field - ImageManifest *string `locationName:"imageManifest" type:"string" required:"true"` + ImageManifest *string `locationName:"imageManifest" min:"1" 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. @@ -5134,6 +6948,9 @@ func (s *PutImageInput) Validate() error { if s.ImageManifest == nil { invalidParams.Add(request.NewErrParamRequired("ImageManifest")) } + if s.ImageManifest != nil && len(*s.ImageManifest) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ImageManifest", 1)) + } if s.ImageTag != nil && len(*s.ImageTag) < 1 { invalidParams.Add(request.NewErrParamMinLen("ImageTag", 1)) } @@ -5177,23 +6994,133 @@ func (s *PutImageInput) SetRepositoryName(v string) *PutImageInput { type PutImageOutput struct { _ struct{} `type:"structure"` - // Details of the image uploaded. - Image *Image `locationName:"image" 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 +} + +type PutImageScanningConfigurationInput struct { + _ struct{} `type:"structure"` + + // The image scanning configuration for the repository. This setting determines + // whether images are scanned for known vulnerabilities after being pushed to + // the repository. + // + // ImageScanningConfiguration is a required field + ImageScanningConfiguration *ImageScanningConfiguration `locationName:"imageScanningConfiguration" type:"structure" required:"true"` + + // The AWS account ID associated with the registry that contains the repository + // in which to update the image scanning configuration setting. 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 update the image scanning configuration + // setting. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` +} + +// String returns the string representation +func (s PutImageScanningConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutImageScanningConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutImageScanningConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutImageScanningConfigurationInput"} + if s.ImageScanningConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("ImageScanningConfiguration")) + } + 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 +} + +// SetImageScanningConfiguration sets the ImageScanningConfiguration field's value. +func (s *PutImageScanningConfigurationInput) SetImageScanningConfiguration(v *ImageScanningConfiguration) *PutImageScanningConfigurationInput { + s.ImageScanningConfiguration = v + return s +} + +// SetRegistryId sets the RegistryId field's value. +func (s *PutImageScanningConfigurationInput) SetRegistryId(v string) *PutImageScanningConfigurationInput { + s.RegistryId = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *PutImageScanningConfigurationInput) SetRepositoryName(v string) *PutImageScanningConfigurationInput { + s.RepositoryName = &v + return s +} + +type PutImageScanningConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The image scanning configuration setting for the repository. + ImageScanningConfiguration *ImageScanningConfiguration `locationName:"imageScanningConfiguration" type:"structure"` + + // 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 PutImageOutput) String() string { +func (s PutImageScanningConfigurationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutImageOutput) GoString() string { +func (s PutImageScanningConfigurationOutput) GoString() string { return s.String() } -// SetImage sets the Image field's value. -func (s *PutImageOutput) SetImage(v *Image) *PutImageOutput { - s.Image = v +// SetImageScanningConfiguration sets the ImageScanningConfiguration field's value. +func (s *PutImageScanningConfigurationOutput) SetImageScanningConfiguration(v *ImageScanningConfiguration) *PutImageScanningConfigurationOutput { + s.ImageScanningConfiguration = v + return s +} + +// SetRegistryId sets the RegistryId field's value. +func (s *PutImageScanningConfigurationOutput) SetRegistryId(v string) *PutImageScanningConfigurationOutput { + s.RegistryId = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *PutImageScanningConfigurationOutput) SetRepositoryName(v string) *PutImageScanningConfigurationOutput { + s.RepositoryName = &v return s } @@ -5356,136 +7283,490 @@ func (s *PutLifecyclePolicyInput) Validate() error { return nil } -// SetLifecyclePolicyText sets the LifecyclePolicyText field's value. -func (s *PutLifecyclePolicyInput) SetLifecyclePolicyText(v string) *PutLifecyclePolicyInput { - s.LifecyclePolicyText = &v - return s +// SetLifecyclePolicyText sets the LifecyclePolicyText field's value. +func (s *PutLifecyclePolicyInput) SetLifecyclePolicyText(v string) *PutLifecyclePolicyInput { + s.LifecyclePolicyText = &v + return s +} + +// SetRegistryId sets the RegistryId field's value. +func (s *PutLifecyclePolicyInput) SetRegistryId(v string) *PutLifecyclePolicyInput { + s.RegistryId = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *PutLifecyclePolicyInput) SetRepositoryName(v string) *PutLifecyclePolicyInput { + s.RepositoryName = &v + return s +} + +type PutLifecyclePolicyOutput struct { + _ struct{} `type:"structure"` + + // The JSON repository policy text. + LifecyclePolicyText *string `locationName:"lifecyclePolicyText" min:"100" 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 PutLifecyclePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutLifecyclePolicyOutput) GoString() string { + return s.String() +} + +// SetLifecyclePolicyText sets the LifecyclePolicyText field's value. +func (s *PutLifecyclePolicyOutput) SetLifecyclePolicyText(v string) *PutLifecyclePolicyOutput { + s.LifecyclePolicyText = &v + return s +} + +// SetRegistryId sets the RegistryId field's value. +func (s *PutLifecyclePolicyOutput) SetRegistryId(v string) *PutLifecyclePolicyOutput { + s.RegistryId = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *PutLifecyclePolicyOutput) SetRepositoryName(v string) *PutLifecyclePolicyOutput { + s.RepositoryName = &v + return s +} + +// An object representing a repository. +type Repository struct { + _ struct{} `type:"structure"` + + // The date and time, in JavaScript date format, when the repository was created. + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` + + // The image scanning configuration for a repository. + ImageScanningConfiguration *ImageScanningConfiguration `locationName:"imageScanningConfiguration" type:"structure"` + + // The tag mutability setting for the repository. + ImageTagMutability *string `locationName:"imageTagMutability" type:"string" enum:"ImageTagMutability"` + + // 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, AWS + // account ID of the repository owner, repository namespace, and 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 or 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 +} + +// SetImageScanningConfiguration sets the ImageScanningConfiguration field's value. +func (s *Repository) SetImageScanningConfiguration(v *ImageScanningConfiguration) *Repository { + s.ImageScanningConfiguration = v + return s +} + +// SetImageTagMutability sets the ImageTagMutability field's value. +func (s *Repository) SetImageTagMutability(v string) *Repository { + s.ImageTagMutability = &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 +} + +// The specified repository already exists in the specified registry. +type RepositoryAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RepositoryAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RepositoryAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorRepositoryAlreadyExistsException(v protocol.ResponseMetadata) error { + return &RepositoryAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RepositoryAlreadyExistsException) Code() string { + return "RepositoryAlreadyExistsException" +} + +// Message returns the exception's message. +func (s RepositoryAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RepositoryAlreadyExistsException) OrigErr() error { + return nil +} + +func (s RepositoryAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RepositoryAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RepositoryAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified repository contains images. To delete a repository that contains +// images, you must force the deletion with the force parameter. +type RepositoryNotEmptyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RepositoryNotEmptyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RepositoryNotEmptyException) GoString() string { + return s.String() +} + +func newErrorRepositoryNotEmptyException(v protocol.ResponseMetadata) error { + return &RepositoryNotEmptyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RepositoryNotEmptyException) Code() string { + return "RepositoryNotEmptyException" +} + +// Message returns the exception's message. +func (s RepositoryNotEmptyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RepositoryNotEmptyException) OrigErr() error { + return nil +} + +func (s RepositoryNotEmptyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RepositoryNotEmptyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RepositoryNotEmptyException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type RepositoryNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RepositoryNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RepositoryNotFoundException) GoString() string { + return s.String() +} + +func newErrorRepositoryNotFoundException(v protocol.ResponseMetadata) error { + return &RepositoryNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RepositoryNotFoundException) Code() string { + return "RepositoryNotFoundException" +} + +// Message returns the exception's message. +func (s RepositoryNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RepositoryNotFoundException) OrigErr() error { + return nil +} + +func (s RepositoryNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RepositoryNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RepositoryNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified repository and registry combination does not have an associated +// repository policy. +type RepositoryPolicyNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RepositoryPolicyNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RepositoryPolicyNotFoundException) GoString() string { + return s.String() +} + +func newErrorRepositoryPolicyNotFoundException(v protocol.ResponseMetadata) error { + return &RepositoryPolicyNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RepositoryPolicyNotFoundException) Code() string { + return "RepositoryPolicyNotFoundException" +} + +// Message returns the exception's message. +func (s RepositoryPolicyNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetRegistryId sets the RegistryId field's value. -func (s *PutLifecyclePolicyInput) SetRegistryId(v string) *PutLifecyclePolicyInput { - s.RegistryId = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RepositoryPolicyNotFoundException) OrigErr() error { + return nil } -// SetRepositoryName sets the RepositoryName field's value. -func (s *PutLifecyclePolicyInput) SetRepositoryName(v string) *PutLifecyclePolicyInput { - s.RepositoryName = &v - return s +func (s RepositoryPolicyNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -type PutLifecyclePolicyOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s RepositoryPolicyNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The JSON repository policy text. - LifecyclePolicyText *string `locationName:"lifecyclePolicyText" min:"100" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s RepositoryPolicyNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} - // The registry ID associated with the request. - RegistryId *string `locationName:"registryId" type:"string"` +// The specified image scan could not be found. Ensure that image scanning is +// enabled on the repository and try again. +type ScanNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The repository name associated with the request. - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s PutLifecyclePolicyOutput) String() string { +func (s ScanNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutLifecyclePolicyOutput) GoString() string { +func (s ScanNotFoundException) GoString() string { return s.String() } -// SetLifecyclePolicyText sets the LifecyclePolicyText field's value. -func (s *PutLifecyclePolicyOutput) SetLifecyclePolicyText(v string) *PutLifecyclePolicyOutput { - s.LifecyclePolicyText = &v - return s +func newErrorScanNotFoundException(v protocol.ResponseMetadata) error { + return &ScanNotFoundException{ + respMetadata: v, + } } -// SetRegistryId sets the RegistryId field's value. -func (s *PutLifecyclePolicyOutput) SetRegistryId(v string) *PutLifecyclePolicyOutput { - s.RegistryId = &v - return s +// Code returns the exception type name. +func (s ScanNotFoundException) Code() string { + return "ScanNotFoundException" } -// SetRepositoryName sets the RepositoryName field's value. -func (s *PutLifecyclePolicyOutput) SetRepositoryName(v string) *PutLifecyclePolicyOutput { - s.RepositoryName = &v - return s +// Message returns the exception's message. +func (s ScanNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// An object representing a repository. -type Repository struct { - _ struct{} `type:"structure"` - - // The date and time, in JavaScript date format, when the repository was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ScanNotFoundException) OrigErr() error { + return nil +} - // The tag mutability setting for the repository. - ImageTagMutability *string `locationName:"imageTagMutability" type:"string" enum:"ImageTagMutability"` +func (s ScanNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The AWS account ID associated with the registry that contains the repository. - RegistryId *string `locationName:"registryId" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s ScanNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The Amazon Resource Name (ARN) that identifies the repository. The ARN contains - // the arn:aws:ecr namespace, followed by the region of the repository, AWS - // account ID of the repository owner, repository namespace, and repository - // name. For example, arn:aws:ecr:region:012345678910:repository/test. - RepositoryArn *string `locationName:"repositoryArn" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s ScanNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} - // The name of the repository. - RepositoryName *string `locationName:"repositoryName" min:"2" type:"string"` +// These errors are usually caused by a server-side issue. +type ServerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The URI for the repository. You can use this URI for Docker push or pull - // operations. - RepositoryUri *string `locationName:"repositoryUri" type:"string"` + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s Repository) String() string { +func (s ServerException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Repository) GoString() string { +func (s ServerException) 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 +func newErrorServerException(v protocol.ResponseMetadata) error { + return &ServerException{ + respMetadata: v, + } } -// SetImageTagMutability sets the ImageTagMutability field's value. -func (s *Repository) SetImageTagMutability(v string) *Repository { - s.ImageTagMutability = &v - return s +// Code returns the exception type name. +func (s ServerException) Code() string { + return "ServerException" } -// SetRegistryId sets the RegistryId field's value. -func (s *Repository) SetRegistryId(v string) *Repository { - s.RegistryId = &v - return s +// Message returns the exception's message. +func (s ServerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetRepositoryArn sets the RepositoryArn field's value. -func (s *Repository) SetRepositoryArn(v string) *Repository { - s.RepositoryArn = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServerException) OrigErr() error { + return nil } -// SetRepositoryName sets the RepositoryName field's value. -func (s *Repository) SetRepositoryName(v string) *Repository { - s.RepositoryName = &v - return s +func (s ServerException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetRepositoryUri sets the RepositoryUri field's value. -func (s *Repository) SetRepositoryUri(v string) *Repository { - s.RepositoryUri = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ServerException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServerException) RequestID() string { + return s.respMetadata.RequestID } type SetRepositoryPolicyInput struct { @@ -5607,6 +7888,127 @@ func (s *SetRepositoryPolicyOutput) SetRepositoryName(v string) *SetRepositoryPo return s } +type StartImageScanInput struct { + _ struct{} `type:"structure"` + + // An object with identifying information for an Amazon ECR image. + // + // ImageId is a required field + ImageId *ImageIdentifier `locationName:"imageId" type:"structure" required:"true"` + + // The AWS account ID associated with the registry that contains the repository + // in which to start an image scan request. If you do not specify a registry, + // the default registry is assumed. + RegistryId *string `locationName:"registryId" type:"string"` + + // The name of the repository that contains the images to scan. + // + // RepositoryName is a required field + RepositoryName *string `locationName:"repositoryName" min:"2" type:"string" required:"true"` +} + +// String returns the string representation +func (s StartImageScanInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartImageScanInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartImageScanInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartImageScanInput"} + if s.ImageId == nil { + invalidParams.Add(request.NewErrParamRequired("ImageId")) + } + 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.ImageId != nil { + if err := s.ImageId.Validate(); err != nil { + invalidParams.AddNested("ImageId", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetImageId sets the ImageId field's value. +func (s *StartImageScanInput) SetImageId(v *ImageIdentifier) *StartImageScanInput { + s.ImageId = v + return s +} + +// SetRegistryId sets the RegistryId field's value. +func (s *StartImageScanInput) SetRegistryId(v string) *StartImageScanInput { + s.RegistryId = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *StartImageScanInput) SetRepositoryName(v string) *StartImageScanInput { + s.RepositoryName = &v + return s +} + +type StartImageScanOutput struct { + _ struct{} `type:"structure"` + + // An object with identifying information for an Amazon ECR image. + ImageId *ImageIdentifier `locationName:"imageId" type:"structure"` + + // The current state of the scan. + ImageScanStatus *ImageScanStatus `locationName:"imageScanStatus" type:"structure"` + + // 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 StartImageScanOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartImageScanOutput) GoString() string { + return s.String() +} + +// SetImageId sets the ImageId field's value. +func (s *StartImageScanOutput) SetImageId(v *ImageIdentifier) *StartImageScanOutput { + s.ImageId = v + return s +} + +// SetImageScanStatus sets the ImageScanStatus field's value. +func (s *StartImageScanOutput) SetImageScanStatus(v *ImageScanStatus) *StartImageScanOutput { + s.ImageScanStatus = v + return s +} + +// SetRegistryId sets the RegistryId field's value. +func (s *StartImageScanOutput) SetRegistryId(v string) *StartImageScanOutput { + s.RegistryId = &v + return s +} + +// SetRepositoryName sets the RepositoryName field's value. +func (s *StartImageScanOutput) SetRepositoryName(v string) *StartImageScanOutput { + s.RepositoryName = &v + return s +} + type StartLifecyclePolicyPreviewInput struct { _ struct{} `type:"structure"` @@ -5828,6 +8230,63 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// The list of tags on the repository is over the limit. The maximum number +// of tags that can be applied to a repository is 50. +type TooManyTagsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyTagsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyTagsException) GoString() string { + return s.String() +} + +func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { + return &TooManyTagsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyTagsException) Code() string { + return "TooManyTagsException" +} + +// Message returns the exception's message. +func (s TooManyTagsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTagsException) OrigErr() error { + return nil +} + +func (s TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTagsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyTagsException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -6055,6 +8514,84 @@ func (s *UploadLayerPartOutput) SetUploadId(v string) *UploadLayerPartOutput { return s } +// The upload could not be found, or the specified upload id is not valid for +// this repository. +type UploadNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message associated with the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UploadNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UploadNotFoundException) GoString() string { + return s.String() +} + +func newErrorUploadNotFoundException(v protocol.ResponseMetadata) error { + return &UploadNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UploadNotFoundException) Code() string { + return "UploadNotFoundException" +} + +// Message returns the exception's message. +func (s UploadNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UploadNotFoundException) OrigErr() error { + return nil +} + +func (s UploadNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UploadNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UploadNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +const ( + // FindingSeverityInformational is a FindingSeverity enum value + FindingSeverityInformational = "INFORMATIONAL" + + // FindingSeverityLow is a FindingSeverity enum value + FindingSeverityLow = "LOW" + + // FindingSeverityMedium is a FindingSeverity enum value + FindingSeverityMedium = "MEDIUM" + + // FindingSeverityHigh is a FindingSeverity enum value + FindingSeverityHigh = "HIGH" + + // FindingSeverityCritical is a FindingSeverity enum value + FindingSeverityCritical = "CRITICAL" + + // FindingSeverityUndefined is a FindingSeverity enum value + FindingSeverityUndefined = "UNDEFINED" +) + const ( // ImageActionTypeExpire is a ImageActionType enum value ImageActionTypeExpire = "EXPIRE" @@ -6115,6 +8652,17 @@ const ( LifecyclePolicyPreviewStatusFailed = "FAILED" ) +const ( + // ScanStatusInProgress is a ScanStatus enum value + ScanStatusInProgress = "IN_PROGRESS" + + // ScanStatusComplete is a ScanStatus enum value + ScanStatusComplete = "COMPLETE" + + // ScanStatusFailed is a ScanStatus enum value + ScanStatusFailed = "FAILED" +) + const ( // TagStatusTagged is a TagStatus enum value TagStatusTagged = "TAGGED" 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 index c1f18605ca6..732d865bf40 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecr/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecr/errors.go @@ -2,6 +2,10 @@ package ecr +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeEmptyUploadException for service response error code @@ -140,6 +144,13 @@ const ( // repository policy. ErrCodeRepositoryPolicyNotFoundException = "RepositoryPolicyNotFoundException" + // ErrCodeScanNotFoundException for service response error code + // "ScanNotFoundException". + // + // The specified image scan could not be found. Ensure that image scanning is + // enabled on the repository and try again. + ErrCodeScanNotFoundException = "ScanNotFoundException" + // ErrCodeServerException for service response error code // "ServerException". // @@ -160,3 +171,30 @@ const ( // this repository. ErrCodeUploadNotFoundException = "UploadNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "EmptyUploadException": newErrorEmptyUploadException, + "ImageAlreadyExistsException": newErrorImageAlreadyExistsException, + "ImageNotFoundException": newErrorImageNotFoundException, + "ImageTagAlreadyExistsException": newErrorImageTagAlreadyExistsException, + "InvalidLayerException": newErrorInvalidLayerException, + "InvalidLayerPartException": newErrorInvalidLayerPartException, + "InvalidParameterException": newErrorInvalidParameterException, + "InvalidTagParameterException": newErrorInvalidTagParameterException, + "LayerAlreadyExistsException": newErrorLayerAlreadyExistsException, + "LayerInaccessibleException": newErrorLayerInaccessibleException, + "LayerPartTooSmallException": newErrorLayerPartTooSmallException, + "LayersNotFoundException": newErrorLayersNotFoundException, + "LifecyclePolicyNotFoundException": newErrorLifecyclePolicyNotFoundException, + "LifecyclePolicyPreviewInProgressException": newErrorLifecyclePolicyPreviewInProgressException, + "LifecyclePolicyPreviewNotFoundException": newErrorLifecyclePolicyPreviewNotFoundException, + "LimitExceededException": newErrorLimitExceededException, + "RepositoryAlreadyExistsException": newErrorRepositoryAlreadyExistsException, + "RepositoryNotEmptyException": newErrorRepositoryNotEmptyException, + "RepositoryNotFoundException": newErrorRepositoryNotFoundException, + "RepositoryPolicyNotFoundException": newErrorRepositoryPolicyNotFoundException, + "ScanNotFoundException": newErrorScanNotFoundException, + "ServerException": newErrorServerException, + "TooManyTagsException": newErrorTooManyTagsException, + "UploadNotFoundException": newErrorUploadNotFoundException, +} 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 index 3eba7f696b6..c4392395cea 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecr/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecr/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "ecr" // Name of service. EndpointsID = "api.ecr" // ID to lookup a service endpoint with. - ServiceID = "ECR" // ServiceID is a unique identifer of a specific service. + ServiceID = "ECR" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ECR client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ECR client from just a session. // svc := ecr.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *ECR { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "ecr" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ECR { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ECR { svc := &ECR{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-09-21", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecr/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/ecr/waiters.go new file mode 100644 index 00000000000..4b6f88e4e15 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/ecr/waiters.go @@ -0,0 +1,112 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package ecr + +import ( + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/request" +) + +// WaitUntilImageScanComplete uses the Amazon ECR API operation +// DescribeImageScanFindings to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *ECR) WaitUntilImageScanComplete(input *DescribeImageScanFindingsInput) error { + return c.WaitUntilImageScanCompleteWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilImageScanCompleteWithContext is an extended version of WaitUntilImageScanComplete. +// 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 *ECR) WaitUntilImageScanCompleteWithContext(ctx aws.Context, input *DescribeImageScanFindingsInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilImageScanComplete", + MaxAttempts: 60, + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "imageScanStatus.status", + Expected: "COMPLETE", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "imageScanStatus.status", + Expected: "FAILED", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeImageScanFindingsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeImageScanFindingsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + +// WaitUntilLifecyclePolicyPreviewComplete uses the Amazon ECR API operation +// GetLifecyclePolicyPreview to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *ECR) WaitUntilLifecyclePolicyPreviewComplete(input *GetLifecyclePolicyPreviewInput) error { + return c.WaitUntilLifecyclePolicyPreviewCompleteWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilLifecyclePolicyPreviewCompleteWithContext is an extended version of WaitUntilLifecyclePolicyPreviewComplete. +// 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 *ECR) WaitUntilLifecyclePolicyPreviewCompleteWithContext(ctx aws.Context, input *GetLifecyclePolicyPreviewInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilLifecyclePolicyPreviewComplete", + MaxAttempts: 20, + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "status", + Expected: "COMPLETE", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "status", + Expected: "FAILED", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *GetLifecyclePolicyPreviewInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetLifecyclePolicyPreviewRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go b/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go index ac78be2b524..912efcd8dc7 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecs/api.go @@ -13,6 +13,104 @@ import ( "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) +const opCreateCapacityProvider = "CreateCapacityProvider" + +// CreateCapacityProviderRequest generates a "aws/request.Request" representing the +// client's request for the CreateCapacityProvider operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateCapacityProvider for more information on using the CreateCapacityProvider +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateCapacityProviderRequest method. +// req, resp := client.CreateCapacityProviderRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateCapacityProvider +func (c *ECS) CreateCapacityProviderRequest(input *CreateCapacityProviderInput) (req *request.Request, output *CreateCapacityProviderOutput) { + op := &request.Operation{ + Name: opCreateCapacityProvider, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateCapacityProviderInput{} + } + + output = &CreateCapacityProviderOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateCapacityProvider API operation for Amazon EC2 Container Service. +// +// Creates a new capacity provider. Capacity providers are associated with an +// Amazon ECS cluster and are used in capacity provider strategies to facilitate +// cluster auto scaling. +// +// Only capacity providers using an Auto Scaling group can be created. Amazon +// ECS tasks on AWS Fargate use the FARGATE and FARGATE_SPOT capacity providers +// which are already created and available to all accounts in Regions supported +// by AWS Fargate. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 CreateCapacityProvider for usage and error information. +// +// Returned Error Types: +// * ServerException +// These errors are usually caused by a server issue. +// +// * 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 permissions to use the +// action or resource, or specifying an identifier that is not valid. +// +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * LimitExceededException +// The limit for the resource has been exceeded. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateCapacityProvider +func (c *ECS) CreateCapacityProvider(input *CreateCapacityProviderInput) (*CreateCapacityProviderOutput, error) { + req, out := c.CreateCapacityProviderRequest(input) + return out, req.Send() +} + +// CreateCapacityProviderWithContext is the same as CreateCapacityProvider with the addition of +// the ability to pass a context and additional request options. +// +// See CreateCapacityProvider for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ECS) CreateCapacityProviderWithContext(ctx aws.Context, input *CreateCapacityProviderInput, opts ...request.Option) (*CreateCapacityProviderOutput, error) { + req, out := c.CreateCapacityProviderRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateCluster = "CreateCluster" // CreateClusterRequest generates a "aws/request.Request" representing the @@ -62,11 +160,11 @@ func (c *ECS) CreateClusterRequest(input *CreateClusterInput) (req *request.Requ // your own cluster with a unique name with the CreateCluster action. // // When you call the CreateCluster API operation, Amazon ECS attempts to create -// the service-linked role for your account so that required resources in other -// AWS services can be managed on your behalf. However, if the IAM user that -// makes the call does not have permissions to create the service-linked role, -// it is not created. For more information, see Using Service-Linked Roles for -// Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html) +// the Amazon ECS service-linked role for your account so that required resources +// in other AWS services can be managed on your behalf. However, if the IAM +// user that makes the call does not have permissions to create the service-linked +// role, it is not created. For more information, see Using Service-Linked Roles +// for Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html) // in the Amazon Elastic Container Service Developer Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -76,16 +174,16 @@ func (c *ECS) CreateClusterRequest(input *CreateClusterInput) (req *request.Requ // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -262,34 +360,34 @@ func (c *ECS) CreateServiceRequest(input *CreateServiceInput) (req *request.Requ // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException" +// * UnsupportedFeatureException // The specified task is not supported in this Region. // -// * ErrCodePlatformUnknownException "PlatformUnknownException" +// * PlatformUnknownException // The specified platform version does not exist. // -// * ErrCodePlatformTaskDefinitionIncompatibilityException "PlatformTaskDefinitionIncompatibilityException" +// * PlatformTaskDefinitionIncompatibilityException // The specified platform version does not satisfy the task definition's required // capabilities. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have authorization to perform the requested action. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/CreateService @@ -370,41 +468,41 @@ func (c *ECS) CreateTaskSetRequest(input *CreateTaskSetInput) (req *request.Requ // See the AWS API reference guide for Amazon EC2 Container Service's // API operation CreateTaskSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException" +// * UnsupportedFeatureException // The specified task is not supported in this Region. // -// * ErrCodePlatformUnknownException "PlatformUnknownException" +// * PlatformUnknownException // The specified platform version does not exist. // -// * ErrCodePlatformTaskDefinitionIncompatibilityException "PlatformTaskDefinitionIncompatibilityException" +// * PlatformTaskDefinitionIncompatibilityException // The specified platform version does not satisfy the task definition's required // capabilities. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have authorization to perform the requested action. // -// * ErrCodeServiceNotFoundException "ServiceNotFoundException" +// * 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" +// * ServiceNotActiveException // The specified service is not active. You can't update a service that is inactive. // If you have previously deleted a service, you can re-create it with CreateService. // @@ -484,16 +582,16 @@ func (c *ECS) DeleteAccountSettingRequest(input *DeleteAccountSettingInput) (req // See the AWS API reference guide for Amazon EC2 Container Service's // API operation DeleteAccountSetting for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -572,17 +670,17 @@ func (c *ECS) DeleteAttributesRequest(input *DeleteAttributesInput) (req *reques // 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" +// Returned Error Types: +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeTargetNotFoundException "TargetNotFoundException" +// * 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" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -652,9 +750,14 @@ func (c *ECS) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Requ // 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. +// Deletes the specified cluster. The cluster will transition to the INACTIVE +// state. Clusters with an INACTIVE status may remain discoverable in your account +// for a period of time. However, this behavior is subject to change in the +// future, so you should not rely on INACTIVE clusters persisting. +// +// 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 @@ -663,36 +766,43 @@ func (c *ECS) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Requ // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeClusterContainsContainerInstancesException "ClusterContainsContainerInstancesException" +// * ClusterContainsContainerInstancesException // You cannot delete a cluster that has registered container instances. First, // deregister the container instances before you can delete the cluster. For // more information, see DeregisterContainerInstance. // -// * ErrCodeClusterContainsServicesException "ClusterContainsServicesException" +// * ClusterContainsServicesException // You cannot delete a cluster that contains services. First, update the service // to reduce its desired task count to 0 and then delete the service. For more // information, see UpdateService and DeleteService. // -// * ErrCodeClusterContainsTasksException "ClusterContainsTasksException" +// * ClusterContainsTasksException // You cannot delete a cluster that has active tasks. // +// * 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. +// // See also, 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) @@ -785,24 +895,24 @@ func (c *ECS) DeleteServiceRequest(input *DeleteServiceInput) (req *request.Requ // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeServiceNotFoundException "ServiceNotFoundException" +// * 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. // @@ -884,41 +994,41 @@ func (c *ECS) DeleteTaskSetRequest(input *DeleteTaskSetInput) (req *request.Requ // See the AWS API reference guide for Amazon EC2 Container Service's // API operation DeleteTaskSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException" +// * UnsupportedFeatureException // The specified task is not supported in this Region. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have authorization to perform the requested action. // -// * ErrCodeServiceNotFoundException "ServiceNotFoundException" +// * 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" +// * ServiceNotActiveException // The specified service is not active. You can't update a service that is inactive. // If you have previously deleted a service, you can re-create it with CreateService. // -// * ErrCodeTaskSetNotFoundException "TaskSetNotFoundException" -// The specified task set could not be found. You can view your available container -// instances with DescribeTaskSets. Task sets are specific to each cluster, -// service and Region. +// * TaskSetNotFoundException +// The specified task set could not be found. You can view your available task +// sets with DescribeTaskSets. Task sets are specific to each cluster, service +// and Region. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DeleteTaskSet func (c *ECS) DeleteTaskSet(input *DeleteTaskSetInput) (*DeleteTaskSetOutput, error) { @@ -1009,20 +1119,20 @@ func (c *ECS) DeregisterContainerInstanceRequest(input *DeregisterContainerInsta // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // @@ -1115,16 +1225,16 @@ func (c *ECS) DeregisterTaskDefinitionRequest(input *DeregisterTaskDefinitionInp // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -1150,6 +1260,94 @@ func (c *ECS) DeregisterTaskDefinitionWithContext(ctx aws.Context, input *Deregi return out, req.Send() } +const opDescribeCapacityProviders = "DescribeCapacityProviders" + +// DescribeCapacityProvidersRequest generates a "aws/request.Request" representing the +// client's request for the DescribeCapacityProviders operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeCapacityProviders for more information on using the DescribeCapacityProviders +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeCapacityProvidersRequest method. +// req, resp := client.DescribeCapacityProvidersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeCapacityProviders +func (c *ECS) DescribeCapacityProvidersRequest(input *DescribeCapacityProvidersInput) (req *request.Request, output *DescribeCapacityProvidersOutput) { + op := &request.Operation{ + Name: opDescribeCapacityProviders, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeCapacityProvidersInput{} + } + + output = &DescribeCapacityProvidersOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeCapacityProviders API operation for Amazon EC2 Container Service. +// +// Describes one or more of your capacity providers. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 DescribeCapacityProviders for usage and error information. +// +// Returned Error Types: +// * ServerException +// These errors are usually caused by a server issue. +// +// * 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 permissions to use the +// action or resource, or specifying an identifier that is not valid. +// +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/DescribeCapacityProviders +func (c *ECS) DescribeCapacityProviders(input *DescribeCapacityProvidersInput) (*DescribeCapacityProvidersOutput, error) { + req, out := c.DescribeCapacityProvidersRequest(input) + return out, req.Send() +} + +// DescribeCapacityProvidersWithContext is the same as DescribeCapacityProviders with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCapacityProviders for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ECS) DescribeCapacityProvidersWithContext(ctx aws.Context, input *DescribeCapacityProvidersInput, opts ...request.Option) (*DescribeCapacityProvidersOutput, error) { + req, out := c.DescribeCapacityProvidersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeClusters = "DescribeClusters" // DescribeClustersRequest generates a "aws/request.Request" representing the @@ -1203,16 +1401,16 @@ func (c *ECS) DescribeClustersRequest(input *DescribeClustersInput) (req *reques // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -1292,20 +1490,20 @@ func (c *ECS) DescribeContainerInstancesRequest(input *DescribeContainerInstance // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // @@ -1384,20 +1582,20 @@ func (c *ECS) DescribeServicesRequest(input *DescribeServicesInput) (req *reques // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // @@ -1481,16 +1679,16 @@ func (c *ECS) DescribeTaskDefinitionRequest(input *DescribeTaskDefinitionInput) // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -1572,34 +1770,34 @@ func (c *ECS) DescribeTaskSetsRequest(input *DescribeTaskSetsInput) (req *reques // See the AWS API reference guide for Amazon EC2 Container Service's // API operation DescribeTaskSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException" +// * UnsupportedFeatureException // The specified task is not supported in this Region. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have authorization to perform the requested action. // -// * ErrCodeServiceNotFoundException "ServiceNotFoundException" +// * 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" +// * ServiceNotActiveException // The specified service is not active. You can't update a service that is inactive. // If you have previously deleted a service, you can re-create it with CreateService. // @@ -1678,20 +1876,20 @@ func (c *ECS) DescribeTasksRequest(input *DescribeTasksInput) (req *request.Requ // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // @@ -1774,11 +1972,11 @@ func (c *ECS) DiscoverPollEndpointRequest(input *DiscoverPollEndpointInput) (req // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. @@ -1836,6 +2034,12 @@ func (c *ECS) ListAccountSettingsRequest(input *ListAccountSettingsInput) (req * Name: opListAccountSettings, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, } if input == nil { @@ -1858,16 +2062,16 @@ func (c *ECS) ListAccountSettingsRequest(input *ListAccountSettingsInput) (req * // See the AWS API reference guide for Amazon EC2 Container Service's // API operation ListAccountSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -1893,6 +2097,58 @@ func (c *ECS) ListAccountSettingsWithContext(ctx aws.Context, input *ListAccount return out, req.Send() } +// ListAccountSettingsPages iterates over the pages of a ListAccountSettings operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListAccountSettings 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 ListAccountSettings operation. +// pageNum := 0 +// err := client.ListAccountSettingsPages(params, +// func(page *ecs.ListAccountSettingsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *ECS) ListAccountSettingsPages(input *ListAccountSettingsInput, fn func(*ListAccountSettingsOutput, bool) bool) error { + return c.ListAccountSettingsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListAccountSettingsPagesWithContext same as ListAccountSettingsPages 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 *ECS) ListAccountSettingsPagesWithContext(ctx aws.Context, input *ListAccountSettingsInput, fn func(*ListAccountSettingsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAccountSettingsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAccountSettingsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListAccountSettingsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opListAttributes = "ListAttributes" // ListAttributesRequest generates a "aws/request.Request" representing the @@ -1924,6 +2180,12 @@ func (c *ECS) ListAttributesRequest(input *ListAttributesInput) (req *request.Re Name: opListAttributes, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, } if input == nil { @@ -1952,12 +2214,12 @@ func (c *ECS) ListAttributesRequest(input *ListAttributesInput) (req *request.Re // 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" +// Returned Error Types: +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -1983,6 +2245,58 @@ func (c *ECS) ListAttributesWithContext(ctx aws.Context, input *ListAttributesIn return out, req.Send() } +// ListAttributesPages iterates over the pages of a ListAttributes operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListAttributes 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 ListAttributes operation. +// pageNum := 0 +// err := client.ListAttributesPages(params, +// func(page *ecs.ListAttributesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *ECS) ListAttributesPages(input *ListAttributesInput, fn func(*ListAttributesOutput, bool) bool) error { + return c.ListAttributesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListAttributesPagesWithContext same as ListAttributesPages 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 *ECS) ListAttributesPagesWithContext(ctx aws.Context, input *ListAttributesInput, fn func(*ListAttributesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAttributesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAttributesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListAttributesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opListClusters = "ListClusters" // ListClustersRequest generates a "aws/request.Request" representing the @@ -2042,16 +2356,16 @@ func (c *ECS) ListClustersRequest(input *ListClustersInput) (req *request.Reques // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -2120,10 +2434,12 @@ func (c *ECS) ListClustersPagesWithContext(ctx aws.Context, input *ListClustersI }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListClustersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListClustersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2190,20 +2506,20 @@ func (c *ECS) ListContainerInstancesRequest(input *ListContainerInstancesInput) // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // @@ -2272,10 +2588,12 @@ func (c *ECS) ListContainerInstancesPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListContainerInstancesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListContainerInstancesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2338,20 +2656,20 @@ func (c *ECS) ListServicesRequest(input *ListServicesInput) (req *request.Reques // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // @@ -2420,10 +2738,12 @@ func (c *ECS) ListServicesPagesWithContext(ctx aws.Context, input *ListServicesI }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListServicesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListServicesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2480,20 +2800,20 @@ func (c *ECS) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req * // See the AWS API reference guide for Amazon EC2 Container Service's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -2584,16 +2904,16 @@ func (c *ECS) ListTaskDefinitionFamiliesRequest(input *ListTaskDefinitionFamilie // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -2662,10 +2982,12 @@ func (c *ECS) ListTaskDefinitionFamiliesPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTaskDefinitionFamiliesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTaskDefinitionFamiliesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2730,16 +3052,16 @@ func (c *ECS) ListTaskDefinitionsRequest(input *ListTaskDefinitionsInput) (req * // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -2808,10 +3130,12 @@ func (c *ECS) ListTaskDefinitionsPagesWithContext(ctx aws.Context, input *ListTa }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTaskDefinitionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTaskDefinitionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2879,24 +3203,24 @@ func (c *ECS) ListTasksRequest(input *ListTasksInput) (req *request.Request, out // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeServiceNotFoundException "ServiceNotFoundException" +// * 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. // @@ -2965,10 +3289,12 @@ func (c *ECS) ListTasksPagesWithContext(ctx aws.Context, input *ListTasksInput, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTasksOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTasksOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3054,16 +3380,16 @@ func (c *ECS) PutAccountSettingRequest(input *PutAccountSettingInput) (req *requ // See the AWS API reference guide for Amazon EC2 Container Service's // API operation PutAccountSetting for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -3144,16 +3470,16 @@ func (c *ECS) PutAccountSettingDefaultRequest(input *PutAccountSettingDefaultInp // See the AWS API reference guide for Amazon EC2 Container Service's // API operation PutAccountSettingDefault for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -3236,22 +3562,22 @@ func (c *ECS) PutAttributesRequest(input *PutAttributesInput) (req *request.Requ // 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" +// Returned Error Types: +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeTargetNotFoundException "TargetNotFoundException" +// * 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" +// * 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" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -3277,81 +3603,199 @@ func (c *ECS) PutAttributesWithContext(ctx aws.Context, input *PutAttributesInpu return out, req.Send() } -const opRegisterContainerInstance = "RegisterContainerInstance" +const opPutClusterCapacityProviders = "PutClusterCapacityProviders" -// RegisterContainerInstanceRequest generates a "aws/request.Request" representing the -// client's request for the RegisterContainerInstance operation. The "output" return +// PutClusterCapacityProvidersRequest generates a "aws/request.Request" representing the +// client's request for the PutClusterCapacityProviders operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RegisterContainerInstance for more information on using the RegisterContainerInstance +// See PutClusterCapacityProviders for more information on using the PutClusterCapacityProviders // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RegisterContainerInstanceRequest method. -// req, resp := client.RegisterContainerInstanceRequest(params) +// // Example sending a request using the PutClusterCapacityProvidersRequest method. +// req, resp := client.PutClusterCapacityProvidersRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/RegisterContainerInstance -func (c *ECS) RegisterContainerInstanceRequest(input *RegisterContainerInstanceInput) (req *request.Request, output *RegisterContainerInstanceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PutClusterCapacityProviders +func (c *ECS) PutClusterCapacityProvidersRequest(input *PutClusterCapacityProvidersInput) (req *request.Request, output *PutClusterCapacityProvidersOutput) { op := &request.Operation{ - Name: opRegisterContainerInstance, + Name: opPutClusterCapacityProviders, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RegisterContainerInstanceInput{} + input = &PutClusterCapacityProvidersInput{} } - output = &RegisterContainerInstanceOutput{} + output = &PutClusterCapacityProvidersOutput{} req = c.newRequest(op, input, output) return } -// RegisterContainerInstance API operation for Amazon EC2 Container Service. +// PutClusterCapacityProviders API operation for Amazon EC2 Container Service. // +// Modifies the available capacity providers and the default capacity provider +// strategy for a cluster. // -// This action is only used by the Amazon ECS agent, and it is not intended -// for use outside of the agent. +// You must specify both the available capacity providers and a default capacity +// provider strategy for the cluster. If the specified cluster has existing +// capacity providers associated with it, you must specify all existing capacity +// providers in addition to any new ones you want to add. Any existing capacity +// providers associated with a cluster that are omitted from a PutClusterCapacityProviders +// API call will be disassociated with the cluster. You can only disassociate +// an existing capacity provider from a cluster if it's not being used by any +// existing tasks. // -// Registers an EC2 instance into the specified cluster. This instance becomes -// available to place containers on. +// When creating a service or running a task on a cluster, if no capacity provider +// or launch type is specified, then the cluster's default capacity provider +// strategy is used. It is recommended to define a default capacity provider +// strategy for your cluster, however you may specify an empty array ([]) to +// bypass defining a default strategy. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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. +// API operation PutClusterCapacityProviders for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// See also, 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) - return out, req.Send() +// * ClusterNotFoundException +// The specified cluster could not be found. You can view your available clusters +// with ListClusters. Amazon ECS clusters are Region-specific. +// +// * ResourceInUseException +// The specified resource is in-use and cannot be removed. +// +// * 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. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/PutClusterCapacityProviders +func (c *ECS) PutClusterCapacityProviders(input *PutClusterCapacityProvidersInput) (*PutClusterCapacityProvidersOutput, error) { + req, out := c.PutClusterCapacityProvidersRequest(input) + return out, req.Send() +} + +// PutClusterCapacityProvidersWithContext is the same as PutClusterCapacityProviders with the addition of +// the ability to pass a context and additional request options. +// +// See PutClusterCapacityProviders for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ECS) PutClusterCapacityProvidersWithContext(ctx aws.Context, input *PutClusterCapacityProvidersInput, opts ...request.Option) (*PutClusterCapacityProvidersOutput, error) { + req, out := c.PutClusterCapacityProvidersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRegisterContainerInstance = "RegisterContainerInstance" + +// RegisterContainerInstanceRequest generates a "aws/request.Request" representing the +// client's request for the RegisterContainerInstance operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RegisterContainerInstance for more information on using the RegisterContainerInstance +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RegisterContainerInstanceRequest method. +// req, resp := client.RegisterContainerInstanceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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 ECS 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 Types: +// * ServerException +// These errors are usually caused by a server issue. +// +// * 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 permissions to use the +// action or resource, or specifying an identifier that is not valid. +// +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// See also, 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) + return out, req.Send() } // RegisterContainerInstanceWithContext is the same as RegisterContainerInstance with the addition of @@ -3443,16 +3887,16 @@ func (c *ECS) RegisterTaskDefinitionRequest(input *RegisterTaskDefinitionInput) // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -3559,37 +4003,37 @@ func (c *ECS) RunTaskRequest(input *RunTaskInput) (req *request.Request, output // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException" +// * UnsupportedFeatureException // The specified task is not supported in this Region. // -// * ErrCodePlatformUnknownException "PlatformUnknownException" +// * PlatformUnknownException // The specified platform version does not exist. // -// * ErrCodePlatformTaskDefinitionIncompatibilityException "PlatformTaskDefinitionIncompatibilityException" +// * PlatformTaskDefinitionIncompatibilityException // The specified platform version does not satisfy the task definition's required // capabilities. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have authorization to perform the requested action. // -// * ErrCodeBlockedException "BlockedException" +// * BlockedException // Your AWS account has been blocked. For more information, contact AWS Support // (http://aws.amazon.com/contact-us/). // @@ -3673,20 +4117,20 @@ func (c *ECS) StartTaskRequest(input *StartTaskInput) (req *request.Request, out // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // @@ -3777,20 +4221,20 @@ func (c *ECS) StopTaskRequest(input *StopTaskInput) (req *request.Request, outpu // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // @@ -3873,19 +4317,19 @@ func (c *ECS) SubmitAttachmentStateChangesRequest(input *SubmitAttachmentStateCh // See the AWS API reference guide for Amazon EC2 Container Service's // API operation SubmitAttachmentStateChanges for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have authorization to perform the requested action. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -3968,16 +4412,16 @@ func (c *ECS) SubmitContainerStateChangeRequest(input *SubmitContainerStateChang // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have authorization to perform the requested action. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/SubmitContainerStateChange @@ -4059,19 +4503,19 @@ func (c *ECS) SubmitTaskStateChangeRequest(input *SubmitTaskStateChangeInput) (r // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have authorization to perform the requested action. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -4154,23 +4598,23 @@ func (c *ECS) TagResourceRequest(input *TagResourceInput) (req *request.Request, // See the AWS API reference guide for Amazon EC2 Container Service's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -4250,23 +4694,23 @@ func (c *ECS) UntagResourceRequest(input *UntagResourceInput) (req *request.Requ // See the AWS API reference guide for Amazon EC2 Container Service's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource could not be found. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -4345,20 +4789,20 @@ func (c *ECS) UpdateClusterSettingsRequest(input *UpdateClusterSettingsInput) (r // See the AWS API reference guide for Amazon EC2 Container Service's // API operation UpdateClusterSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // @@ -4447,36 +4891,36 @@ func (c *ECS) UpdateContainerAgentRequest(input *UpdateContainerAgentInput) (req // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeUpdateInProgressException "UpdateInProgressException" +// * 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" +// * 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" +// * 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 @@ -4605,20 +5049,20 @@ func (c *ECS) UpdateContainerInstancesStateRequest(input *UpdateContainerInstanc // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // @@ -4785,39 +5229,39 @@ func (c *ECS) UpdateServiceRequest(input *UpdateServiceInput) (req *request.Requ // 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" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeServiceNotFoundException "ServiceNotFoundException" +// * 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" +// * ServiceNotActiveException // The specified service is not active. You can't update a service that is inactive. // If you have previously deleted a service, you can re-create it with CreateService. // -// * ErrCodePlatformUnknownException "PlatformUnknownException" +// * PlatformUnknownException // The specified platform version does not exist. // -// * ErrCodePlatformTaskDefinitionIncompatibilityException "PlatformTaskDefinitionIncompatibilityException" +// * PlatformTaskDefinitionIncompatibilityException // The specified platform version does not satisfy the task definition's required // capabilities. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have authorization to perform the requested action. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateService @@ -4899,43 +5343,40 @@ func (c *ECS) UpdateServicePrimaryTaskSetRequest(input *UpdateServicePrimaryTask // See the AWS API reference guide for Amazon EC2 Container Service's // API operation UpdateServicePrimaryTaskSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException" +// * UnsupportedFeatureException // The specified task is not supported in this Region. // -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You do not have authorization to perform the requested action. -// -// * ErrCodeServiceNotFoundException "ServiceNotFoundException" +// * 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" +// * ServiceNotActiveException // The specified service is not active. You can't update a service that is inactive. // If you have previously deleted a service, you can re-create it with CreateService. // -// * ErrCodeTaskSetNotFoundException "TaskSetNotFoundException" -// The specified task set could not be found. You can view your available container -// instances with DescribeTaskSets. Task sets are specific to each cluster, -// service and Region. +// * TaskSetNotFoundException +// The specified task set could not be found. You can view your available task +// sets with DescribeTaskSets. Task sets are specific to each cluster, service +// and Region. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have authorization to perform the requested action. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateServicePrimaryTaskSet @@ -5015,41 +5456,41 @@ func (c *ECS) UpdateTaskSetRequest(input *UpdateTaskSetInput) (req *request.Requ // See the AWS API reference guide for Amazon EC2 Container Service's // API operation UpdateTaskSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerException "ServerException" +// Returned Error Types: +// * ServerException // These errors are usually caused by a server issue. // -// * ErrCodeClientException "ClientException" +// * 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 permissions to use the // action or resource, or specifying an identifier that is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClusterNotFoundException "ClusterNotFoundException" +// * ClusterNotFoundException // The specified cluster could not be found. You can view your available clusters // with ListClusters. Amazon ECS clusters are Region-specific. // -// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException" +// * UnsupportedFeatureException // The specified task is not supported in this Region. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have authorization to perform the requested action. // -// * ErrCodeServiceNotFoundException "ServiceNotFoundException" +// * 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" +// * ServiceNotActiveException // The specified service is not active. You can't update a service that is inactive. // If you have previously deleted a service, you can re-create it with CreateService. // -// * ErrCodeTaskSetNotFoundException "TaskSetNotFoundException" -// The specified task set could not be found. You can view your available container -// instances with DescribeTaskSets. Task sets are specific to each cluster, -// service and Region. +// * TaskSetNotFoundException +// The specified task set could not be found. You can view your available task +// sets with DescribeTaskSets. Task sets are specific to each cluster, service +// and Region. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ecs-2014-11-13/UpdateTaskSet func (c *ECS) UpdateTaskSet(input *UpdateTaskSetInput) (*UpdateTaskSetOutput, error) { @@ -5073,6 +5514,62 @@ func (c *ECS) UpdateTaskSetWithContext(ctx aws.Context, input *UpdateTaskSetInpu return out, req.Send() } +// You do not have authorization to perform the requested action. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + // An object representing a container instance or task attachment. type Attachment struct { _ struct{} `type:"structure"` @@ -5255,6 +5752,141 @@ func (s *Attribute) SetValue(v string) *Attribute { return s } +// 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. +type AttributeLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AttributeLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttributeLimitExceededException) GoString() string { + return s.String() +} + +func newErrorAttributeLimitExceededException(v protocol.ResponseMetadata) error { + return &AttributeLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AttributeLimitExceededException) Code() string { + return "AttributeLimitExceededException" +} + +// Message returns the exception's message. +func (s AttributeLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AttributeLimitExceededException) OrigErr() error { + return nil +} + +func (s AttributeLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AttributeLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AttributeLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The details of the Auto Scaling group for the capacity provider. +type AutoScalingGroupProvider struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) that identifies the Auto Scaling group. + // + // AutoScalingGroupArn is a required field + AutoScalingGroupArn *string `locationName:"autoScalingGroupArn" type:"string" required:"true"` + + // The managed scaling settings for the Auto Scaling group capacity provider. + ManagedScaling *ManagedScaling `locationName:"managedScaling" type:"structure"` + + // The managed termination protection setting to use for the Auto Scaling group + // capacity provider. This determines whether the Auto Scaling group has managed + // termination protection. + // + // When using managed termination protection, managed scaling must also be used + // otherwise managed termination protection will not work. + // + // When managed termination protection is enabled, Amazon ECS prevents the Amazon + // EC2 instances in an Auto Scaling group that contain tasks from being terminated + // during a scale-in action. The Auto Scaling group and each instance in the + // Auto Scaling group must have instance protection from scale-in actions enabled + // as well. For more information, see Instance Protection (https://docs.aws.amazon.com/autoscaling/ec2/userguide/as-instance-termination.html#instance-protection) + // in the AWS Auto Scaling User Guide. + // + // When managed termination protection is disabled, your Amazon EC2 instances + // are not protected from termination when the Auto Scaling group scales in. + ManagedTerminationProtection *string `locationName:"managedTerminationProtection" type:"string" enum:"ManagedTerminationProtection"` +} + +// String returns the string representation +func (s AutoScalingGroupProvider) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoScalingGroupProvider) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AutoScalingGroupProvider) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AutoScalingGroupProvider"} + if s.AutoScalingGroupArn == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupArn")) + } + if s.ManagedScaling != nil { + if err := s.ManagedScaling.Validate(); err != nil { + invalidParams.AddNested("ManagedScaling", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoScalingGroupArn sets the AutoScalingGroupArn field's value. +func (s *AutoScalingGroupProvider) SetAutoScalingGroupArn(v string) *AutoScalingGroupProvider { + s.AutoScalingGroupArn = &v + return s +} + +// SetManagedScaling sets the ManagedScaling field's value. +func (s *AutoScalingGroupProvider) SetManagedScaling(v *ManagedScaling) *AutoScalingGroupProvider { + s.ManagedScaling = v + return s +} + +// SetManagedTerminationProtection sets the ManagedTerminationProtection field's value. +func (s *AutoScalingGroupProvider) SetManagedTerminationProtection(v string) *AutoScalingGroupProvider { + s.ManagedTerminationProtection = &v + return s +} + // An object representing the networking details for a task or service. type AwsVpcConfiguration struct { _ struct{} `type:"structure"` @@ -5320,52 +5952,350 @@ func (s *AwsVpcConfiguration) SetSubnets(v []*string) *AwsVpcConfiguration { 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. -type Cluster struct { - _ struct{} `type:"structure"` +// Your AWS account has been blocked. For more information, contact AWS Support +// (http://aws.amazon.com/contact-us/). +type BlockedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` +} - // 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"` +// String returns the string representation +func (s BlockedException) String() string { + return awsutil.Prettify(s) +} - // A user-generated string that you use to identify your cluster. - ClusterName *string `locationName:"clusterName" type:"string"` +// GoString returns the string representation +func (s BlockedException) GoString() string { + return s.String() +} - // The number of tasks in the cluster that are in the PENDING state. - PendingTasksCount *int64 `locationName:"pendingTasksCount" type:"integer"` +func newErrorBlockedException(v protocol.ResponseMetadata) error { + return &BlockedException{ + respMetadata: v, + } +} - // The number of container instances registered into the cluster. This includes - // container instances in both ACTIVE and DRAINING status. - RegisteredContainerInstancesCount *int64 `locationName:"registeredContainerInstancesCount" type:"integer"` +// Code returns the exception type name. +func (s BlockedException) Code() string { + return "BlockedException" +} - // The number of tasks in the cluster that are in the RUNNING state. - RunningTasksCount *int64 `locationName:"runningTasksCount" type:"integer"` +// Message returns the exception's message. +func (s BlockedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The settings for the cluster. This parameter indicates whether CloudWatch - // Container Insights is enabled or disabled for a cluster. - Settings []*ClusterSetting `locationName:"settings" type:"list"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BlockedException) OrigErr() error { + return nil +} - // Additional information about your clusters that are separated by launch type, - // including: +func (s BlockedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BlockedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BlockedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The details of a capacity provider. +type CapacityProvider struct { + _ struct{} `type:"structure"` + + // The Auto Scaling group settings for the capacity provider. + AutoScalingGroupProvider *AutoScalingGroupProvider `locationName:"autoScalingGroupProvider" type:"structure"` + + // The Amazon Resource Name (ARN) that identifies the capacity provider. + CapacityProviderArn *string `locationName:"capacityProviderArn" type:"string"` + + // The name of the capacity provider. + Name *string `locationName:"name" type:"string"` + + // The current status of the capacity provider. Only capacity providers in an + // ACTIVE state can be used in a cluster. + Status *string `locationName:"status" type:"string" enum:"CapacityProviderStatus"` + + // The metadata that you apply to the capacity provider to help you categorize + // and organize it. Each tag consists of a key and an optional value, both of + // which you define. // - // * runningEC2TasksCount + // The following basic restrictions apply to tags: // - // * RunningFargateTasksCount + // * Maximum number of tags per resource - 50 // - // * pendingEC2TasksCount + // * For each resource, each tag key must be unique, and each tag key can + // have only one value. // - // * pendingFargateTasksCount + // * Maximum key length - 128 Unicode characters in UTF-8 // - // * activeEC2ServiceCount + // * Maximum value length - 256 Unicode characters in UTF-8 + // + // * If your tagging schema is used across multiple services and resources, + // remember that other services may have restrictions on allowed characters. + // Generally allowed characters are: letters, numbers, and spaces representable + // in UTF-8, and the following characters: + - = . _ : / @. + // + // * Tag keys and values are case-sensitive. + // + // * Do not use aws:, AWS:, or any upper or lowercase combination of such + // as a prefix for either keys or values as it is reserved for AWS use. You + // cannot edit or delete tag keys or values with this prefix. Tags with this + // prefix do not count against your tags per resource limit. + Tags []*Tag `locationName:"tags" type:"list"` +} + +// String returns the string representation +func (s CapacityProvider) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CapacityProvider) GoString() string { + return s.String() +} + +// SetAutoScalingGroupProvider sets the AutoScalingGroupProvider field's value. +func (s *CapacityProvider) SetAutoScalingGroupProvider(v *AutoScalingGroupProvider) *CapacityProvider { + s.AutoScalingGroupProvider = v + return s +} + +// SetCapacityProviderArn sets the CapacityProviderArn field's value. +func (s *CapacityProvider) SetCapacityProviderArn(v string) *CapacityProvider { + s.CapacityProviderArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *CapacityProvider) SetName(v string) *CapacityProvider { + s.Name = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CapacityProvider) SetStatus(v string) *CapacityProvider { + s.Status = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CapacityProvider) SetTags(v []*Tag) *CapacityProvider { + s.Tags = v + return s +} + +// The details of a capacity provider strategy. +type CapacityProviderStrategyItem struct { + _ struct{} `type:"structure"` + + // The base value designates how many tasks, at a minimum, to run on the specified + // capacity provider. Only one capacity provider in a capacity provider strategy + // can have a base defined. + Base *int64 `locationName:"base" type:"integer"` + + // The short name or full Amazon Resource Name (ARN) of the capacity provider. + // + // CapacityProvider is a required field + CapacityProvider *string `locationName:"capacityProvider" type:"string" required:"true"` + + // The weight value designates the relative percentage of the total number of + // tasks launched that should use the specified capacity provider. + // + // For example, if you have a strategy that contains two capacity providers + // and both have a weight of 1, then when the base is satisfied, the tasks will + // be split evenly across the two capacity providers. Using that same logic, + // if you specify a weight of 1 for capacityProviderA and a weight of 4 for + // capacityProviderB, then for every one task that is run using capacityProviderA, + // four tasks would use capacityProviderB. + Weight *int64 `locationName:"weight" type:"integer"` +} + +// String returns the string representation +func (s CapacityProviderStrategyItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CapacityProviderStrategyItem) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CapacityProviderStrategyItem) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CapacityProviderStrategyItem"} + if s.CapacityProvider == nil { + invalidParams.Add(request.NewErrParamRequired("CapacityProvider")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBase sets the Base field's value. +func (s *CapacityProviderStrategyItem) SetBase(v int64) *CapacityProviderStrategyItem { + s.Base = &v + return s +} + +// SetCapacityProvider sets the CapacityProvider field's value. +func (s *CapacityProviderStrategyItem) SetCapacityProvider(v string) *CapacityProviderStrategyItem { + s.CapacityProvider = &v + return s +} + +// SetWeight sets the Weight field's value. +func (s *CapacityProviderStrategyItem) SetWeight(v int64) *CapacityProviderStrategyItem { + s.Weight = &v + return s +} + +// 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 permissions to use the +// action or resource, or specifying an identifier that is not valid. +type ClientException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ClientException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClientException) GoString() string { + return s.String() +} + +func newErrorClientException(v protocol.ResponseMetadata) error { + return &ClientException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ClientException) Code() string { + return "ClientException" +} + +// Message returns the exception's message. +func (s ClientException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ClientException) OrigErr() error { + return nil +} + +func (s ClientException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ClientException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ClientException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +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 resources attached to a cluster. When using a capacity provider with + // a cluster, the Auto Scaling plan that is created will be returned as a cluster + // attachment. + Attachments []*Attachment `locationName:"attachments" type:"list"` + + // The status of the capacity providers associated with the cluster. The following + // are the states that will be returned: + // + // UPDATE_IN_PROGRESS + // + // The available capacity providers for the cluster are updating. This occurs + // when the Auto Scaling plan is provisioning or deprovisioning. + // + // UPDATE_COMPLETE + // + // The capacity providers have successfully updated. + // + // UPDATE_FAILED + // + // The capacity provider updates failed. + AttachmentsStatus *string `locationName:"attachmentsStatus" type:"string"` + + // The capacity providers associated with the cluster. + CapacityProviders []*string `locationName:"capacityProviders" type:"list"` + + // 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 default capacity provider strategy for the cluster. When services or + // tasks are run in the cluster with no launch type or capacity provider strategy + // specified, the default capacity provider strategy is used. + DefaultCapacityProviderStrategy []*CapacityProviderStrategyItem `locationName:"defaultCapacityProviderStrategy" type:"list"` + + // 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. This includes + // container instances in both ACTIVE and DRAINING status. + 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 settings for the cluster. This parameter indicates whether CloudWatch + // Container Insights is enabled or disabled for a cluster. + Settings []*ClusterSetting `locationName:"settings" type:"list"` + + // Additional information about your clusters that are separated by launch type, + // including: + // + // * runningEC2TasksCount + // + // * RunningFargateTasksCount + // + // * pendingEC2TasksCount + // + // * pendingFargateTasksCount + // + // * activeEC2ServiceCount // // * activeFargateServiceCount // @@ -5374,9 +6304,35 @@ type Cluster struct { // * drainingFargateServiceCount Statistics []*KeyValuePair `locationName:"statistics" type:"list"` - // 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. + // The status of the cluster. The following are the possible states that will + // be returned. + // + // ACTIVE + // + // The cluster is ready to accept tasks and if applicable you can register container + // instances with the cluster. + // + // PROVISIONING + // + // The cluster has capacity providers associated with it and the resources needed + // for the capacity provider are being created. + // + // DEPROVISIONING + // + // The cluster has capacity providers associated with it and the resources needed + // for the capacity provider are being deleted. + // + // FAILED + // + // The cluster has capacity providers associated with it and the resources needed + // for the capacity provider have failed to create. + // + // INACTIVE + // + // The cluster has been deleted. Clusters with an INACTIVE status may remain + // discoverable in your account for a period of time. However, this behavior + // is subject to change in the future, so you should not rely on INACTIVE clusters + // persisting. Status *string `locationName:"status" type:"string"` // The metadata that you apply to the cluster to help you categorize and organize @@ -5424,6 +6380,24 @@ func (s *Cluster) SetActiveServicesCount(v int64) *Cluster { return s } +// SetAttachments sets the Attachments field's value. +func (s *Cluster) SetAttachments(v []*Attachment) *Cluster { + s.Attachments = v + return s +} + +// SetAttachmentsStatus sets the AttachmentsStatus field's value. +func (s *Cluster) SetAttachmentsStatus(v string) *Cluster { + s.AttachmentsStatus = &v + return s +} + +// SetCapacityProviders sets the CapacityProviders field's value. +func (s *Cluster) SetCapacityProviders(v []*string) *Cluster { + s.CapacityProviders = v + return s +} + // SetClusterArn sets the ClusterArn field's value. func (s *Cluster) SetClusterArn(v string) *Cluster { s.ClusterArn = &v @@ -5436,6 +6410,12 @@ func (s *Cluster) SetClusterName(v string) *Cluster { return s } +// SetDefaultCapacityProviderStrategy sets the DefaultCapacityProviderStrategy field's value. +func (s *Cluster) SetDefaultCapacityProviderStrategy(v []*CapacityProviderStrategyItem) *Cluster { + s.DefaultCapacityProviderStrategy = v + return s +} + // SetPendingTasksCount sets the PendingTasksCount field's value. func (s *Cluster) SetPendingTasksCount(v int64) *Cluster { s.PendingTasksCount = &v @@ -5478,6 +6458,235 @@ func (s *Cluster) SetTags(v []*Tag) *Cluster { return s } +// You cannot delete a cluster that has registered container instances. First, +// deregister the container instances before you can delete the cluster. For +// more information, see DeregisterContainerInstance. +type ClusterContainsContainerInstancesException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ClusterContainsContainerInstancesException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClusterContainsContainerInstancesException) GoString() string { + return s.String() +} + +func newErrorClusterContainsContainerInstancesException(v protocol.ResponseMetadata) error { + return &ClusterContainsContainerInstancesException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ClusterContainsContainerInstancesException) Code() string { + return "ClusterContainsContainerInstancesException" +} + +// Message returns the exception's message. +func (s ClusterContainsContainerInstancesException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ClusterContainsContainerInstancesException) OrigErr() error { + return nil +} + +func (s ClusterContainsContainerInstancesException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ClusterContainsContainerInstancesException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ClusterContainsContainerInstancesException) RequestID() string { + return s.respMetadata.RequestID +} + +// You cannot delete a cluster that contains services. First, update the service +// to reduce its desired task count to 0 and then delete the service. For more +// information, see UpdateService and DeleteService. +type ClusterContainsServicesException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ClusterContainsServicesException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClusterContainsServicesException) GoString() string { + return s.String() +} + +func newErrorClusterContainsServicesException(v protocol.ResponseMetadata) error { + return &ClusterContainsServicesException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ClusterContainsServicesException) Code() string { + return "ClusterContainsServicesException" +} + +// Message returns the exception's message. +func (s ClusterContainsServicesException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ClusterContainsServicesException) OrigErr() error { + return nil +} + +func (s ClusterContainsServicesException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ClusterContainsServicesException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ClusterContainsServicesException) RequestID() string { + return s.respMetadata.RequestID +} + +// You cannot delete a cluster that has active tasks. +type ClusterContainsTasksException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ClusterContainsTasksException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClusterContainsTasksException) GoString() string { + return s.String() +} + +func newErrorClusterContainsTasksException(v protocol.ResponseMetadata) error { + return &ClusterContainsTasksException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ClusterContainsTasksException) Code() string { + return "ClusterContainsTasksException" +} + +// Message returns the exception's message. +func (s ClusterContainsTasksException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ClusterContainsTasksException) OrigErr() error { + return nil +} + +func (s ClusterContainsTasksException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ClusterContainsTasksException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ClusterContainsTasksException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified cluster could not be found. You can view your available clusters +// with ListClusters. Amazon ECS clusters are Region-specific. +type ClusterNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ClusterNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClusterNotFoundException) GoString() string { + return s.String() +} + +func newErrorClusterNotFoundException(v protocol.ResponseMetadata) error { + return &ClusterNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ClusterNotFoundException) Code() string { + return "ClusterNotFoundException" +} + +// Message returns the exception's message. +func (s ClusterNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ClusterNotFoundException) OrigErr() error { + return nil +} + +func (s ClusterNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ClusterNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ClusterNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // The settings to use when creating a cluster. This parameter is used to enable // CloudWatch Container Insights for a cluster. type ClusterSetting struct { @@ -5711,15 +6920,6 @@ type ContainerDefinition struct { // 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. - // // Linux containers share unallocated CPU units with other containers on the // container instance with the same ratio as their allocated amount. For example, // if you run a single-container task on a single-core instance type with 512 @@ -5770,9 +6970,8 @@ type ContainerDefinition struct { // AMI (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) // in the Amazon Elastic Container Service Developer Guide. // - // This parameter is available for tasks using the Fargate launch type in the - // Ohio (us-east-2) region only and the task or service requires platform version - // 1.3.0 or later. + // For tasks using the Fargate launch type, the task or service requires platform + // version 1.3.0 or later. DependsOn []*ContainerDependency `locationName:"dependsOn" type:"list"` // When this parameter is true, networking is disabled within the container. @@ -5812,6 +7011,11 @@ type ContainerDefinition struct { // security systems. This field is not valid for containers in tasks using the // Fargate launch type. // + // With Windows containers, this parameter can be used to reference a credential + // spec file when configuring a container for Active Directory authentication. + // For more information, see Using gMSAs for Windows Containers (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/windows-gmsa.html) + // in the Amazon Elastic Container Service Developer Guide. + // // This parameter maps to SecurityOpt in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) // section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/) // and the --security-opt option to docker run (https://docs.docker.com/engine/reference/run/). @@ -5822,8 +7026,6 @@ type ContainerDefinition struct { // options. For more information, see Amazon ECS Container Agent Configuration // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) // in the Amazon Elastic Container Service Developer Guide. - // - // This parameter is not supported for Windows containers. DockerSecurityOptions []*string `locationName:"dockerSecurityOptions" type:"list"` // @@ -6138,15 +7340,14 @@ type ContainerDefinition struct { // AMI (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) // in the Amazon Elastic Container Service Developer Guide. // - // This parameter is available for tasks using the Fargate launch type in the - // Ohio (us-east-2) region only and the task or service requires platform version - // 1.3.0 or later. + // For tasks using the Fargate launch type, the task or service requires platform + // version 1.3.0 or later. StartTimeout *int64 `locationName:"startTimeout" type:"integer"` // Time duration (in seconds) to wait before the container is forcefully killed - // if it doesn't exit normally on its own. For tasks using the Fargate launch - // type, the max stopTimeout value is 2 minutes. This parameter is available - // for tasks using the Fargate launch type in the Ohio (us-east-2) region only + // if it doesn't exit normally on its own. + // + // For tasks using the Fargate launch type, the max stopTimeout value is 2 minutes // and the task or service requires platform version 1.3.0 or later. // // For tasks using the EC2 launch type, the stop timeout value for the container @@ -6567,8 +7768,8 @@ func (s *ContainerDefinition) SetWorkingDirectory(v string) *ContainerDefinition // AMI (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html) // in the Amazon Elastic Container Service Developer Guide. // -// If you are using tasks that use the Fargate launch type, container dependency -// parameters are not supported. +// For tasks using the Fargate launch type, this parameter requires that the +// task or service uses platform version 1.3.0 or later. type ContainerDependency struct { _ struct{} `type:"structure"` @@ -6659,6 +7860,9 @@ type ContainerInstance struct { // agent at instance registration or manually with the PutAttributes operation. Attributes []*Attribute `locationName:"attributes" type:"list"` + // The capacity provider associated with the container instance. + CapacityProviderName *string `locationName:"capacityProviderName" type:"string"` + // 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 @@ -6794,6 +7998,12 @@ func (s *ContainerInstance) SetAttributes(v []*Attribute) *ContainerInstance { return s } +// SetCapacityProviderName sets the CapacityProviderName field's value. +func (s *ContainerInstance) SetCapacityProviderName(v string) *ContainerInstance { + s.CapacityProviderName = &v + return s +} + // SetContainerInstanceArn sets the ContainerInstanceArn field's value. func (s *ContainerInstance) SetContainerInstanceArn(v string) *ContainerInstance { s.ContainerInstanceArn = &v @@ -7060,14 +8270,181 @@ func (s *ContainerStateChange) SetStatus(v string) *ContainerStateChange { return s } +type CreateCapacityProviderInput struct { + _ struct{} `type:"structure"` + + // The details of the Auto Scaling group for the capacity provider. + // + // AutoScalingGroupProvider is a required field + AutoScalingGroupProvider *AutoScalingGroupProvider `locationName:"autoScalingGroupProvider" type:"structure" required:"true"` + + // The name of the capacity provider. Up to 255 characters are allowed, including + // letters (upper and lowercase), numbers, underscores, and hyphens. The name + // cannot be prefixed with "aws", "ecs", or "fargate". + // + // Name is a required field + Name *string `locationName:"name" type:"string" required:"true"` + + // The metadata that you apply to the capacity provider to help you categorize + // and organize them. Each tag consists of a key and an optional value, both + // of which you define. + // + // The following basic restrictions apply to tags: + // + // * Maximum number of tags per resource - 50 + // + // * For each resource, each tag key must be unique, and each tag key can + // have only one value. + // + // * Maximum key length - 128 Unicode characters in UTF-8 + // + // * Maximum value length - 256 Unicode characters in UTF-8 + // + // * If your tagging schema is used across multiple services and resources, + // remember that other services may have restrictions on allowed characters. + // Generally allowed characters are: letters, numbers, and spaces representable + // in UTF-8, and the following characters: + - = . _ : / @. + // + // * Tag keys and values are case-sensitive. + // + // * Do not use aws:, AWS:, or any upper or lowercase combination of such + // as a prefix for either keys or values as it is reserved for AWS use. You + // cannot edit or delete tag keys or values with this prefix. Tags with this + // prefix do not count against your tags per resource limit. + Tags []*Tag `locationName:"tags" type:"list"` +} + +// String returns the string representation +func (s CreateCapacityProviderInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCapacityProviderInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateCapacityProviderInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateCapacityProviderInput"} + if s.AutoScalingGroupProvider == nil { + invalidParams.Add(request.NewErrParamRequired("AutoScalingGroupProvider")) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.AutoScalingGroupProvider != nil { + if err := s.AutoScalingGroupProvider.Validate(); err != nil { + invalidParams.AddNested("AutoScalingGroupProvider", 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 +} + +// SetAutoScalingGroupProvider sets the AutoScalingGroupProvider field's value. +func (s *CreateCapacityProviderInput) SetAutoScalingGroupProvider(v *AutoScalingGroupProvider) *CreateCapacityProviderInput { + s.AutoScalingGroupProvider = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateCapacityProviderInput) SetName(v string) *CreateCapacityProviderInput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateCapacityProviderInput) SetTags(v []*Tag) *CreateCapacityProviderInput { + s.Tags = v + return s +} + +type CreateCapacityProviderOutput struct { + _ struct{} `type:"structure"` + + // The full description of the new capacity provider. + CapacityProvider *CapacityProvider `locationName:"capacityProvider" type:"structure"` +} + +// String returns the string representation +func (s CreateCapacityProviderOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCapacityProviderOutput) GoString() string { + return s.String() +} + +// SetCapacityProvider sets the CapacityProvider field's value. +func (s *CreateCapacityProviderOutput) SetCapacityProvider(v *CapacityProvider) *CreateCapacityProviderOutput { + s.CapacityProvider = v + return s +} + type CreateClusterInput struct { _ struct{} `type:"structure"` + // The short name or full Amazon Resource Name (ARN) of one or more capacity + // providers to associate with the cluster. + // + // If specifying a capacity provider that uses an Auto Scaling group, the capacity + // provider must already be created and not already associated with another + // cluster. New capacity providers can be created with the CreateCapacityProvider + // API operation. + // + // To use a AWS Fargate capacity provider, specify either the FARGATE or FARGATE_SPOT + // capacity providers. The AWS Fargate capacity providers are available to all + // accounts and only need to be associated with a cluster to be used. + // + // The PutClusterCapacityProviders API operation is used to update the list + // of available capacity providers for a cluster after the cluster is created. + CapacityProviders []*string `locationName:"capacityProviders" type:"list"` + // 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, and hyphens are allowed. ClusterName *string `locationName:"clusterName" type:"string"` + // The capacity provider strategy to use by default for the cluster. + // + // When creating a service or running a task on a cluster, if no capacity provider + // or launch type is specified then the default capacity provider strategy for + // the cluster is used. + // + // A capacity provider strategy consists of one or more capacity providers along + // with the base and weight to assign to them. A capacity provider must be associated + // with the cluster to be used in a capacity provider strategy. The PutClusterCapacityProviders + // API is used to associate a capacity provider with a cluster. Only capacity + // providers with an ACTIVE or UPDATING status can be used. + // + // If specifying a capacity provider that uses an Auto Scaling group, the capacity + // provider must already be created. New capacity providers can be created with + // the CreateCapacityProvider API operation. + // + // To use a AWS Fargate capacity provider, specify either the FARGATE or FARGATE_SPOT + // capacity providers. The AWS Fargate capacity providers are available to all + // accounts and only need to be associated with a cluster to be used. + // + // If a default capacity provider strategy is not defined for a cluster during + // creation, it can be defined later with the PutClusterCapacityProviders API + // operation. + DefaultCapacityProviderStrategy []*CapacityProviderStrategyItem `locationName:"defaultCapacityProviderStrategy" type:"list"` + // The setting to use when creating a cluster. This parameter is used to enable // CloudWatch Container Insights for a cluster. If this value is specified, // it will override the containerInsights value set with PutAccountSetting or @@ -7116,6 +8493,16 @@ func (s CreateClusterInput) GoString() 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.DefaultCapacityProviderStrategy != nil { + for i, v := range s.DefaultCapacityProviderStrategy { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DefaultCapacityProviderStrategy", i), err.(request.ErrInvalidParams)) + } + } + } if s.Tags != nil { for i, v := range s.Tags { if v == nil { @@ -7133,12 +8520,24 @@ func (s *CreateClusterInput) Validate() error { return nil } +// SetCapacityProviders sets the CapacityProviders field's value. +func (s *CreateClusterInput) SetCapacityProviders(v []*string) *CreateClusterInput { + s.CapacityProviders = v + return s +} + // SetClusterName sets the ClusterName field's value. func (s *CreateClusterInput) SetClusterName(v string) *CreateClusterInput { s.ClusterName = &v return s } +// SetDefaultCapacityProviderStrategy sets the DefaultCapacityProviderStrategy field's value. +func (s *CreateClusterInput) SetDefaultCapacityProviderStrategy(v []*CapacityProviderStrategyItem) *CreateClusterInput { + s.DefaultCapacityProviderStrategy = v + return s +} + // SetSettings sets the Settings field's value. func (s *CreateClusterInput) SetSettings(v []*ClusterSetting) *CreateClusterInput { s.Settings = v @@ -7177,6 +8576,30 @@ func (s *CreateClusterOutput) SetCluster(v *Cluster) *CreateClusterOutput { type CreateServiceInput struct { _ struct{} `type:"structure"` + // The capacity provider strategy to use for the service. + // + // A capacity provider strategy consists of one or more capacity providers along + // with the base and weight to assign to them. A capacity provider must be associated + // with the cluster to be used in a capacity provider strategy. The PutClusterCapacityProviders + // API is used to associate a capacity provider with a cluster. Only capacity + // providers with an ACTIVE or UPDATING status can be used. + // + // If a capacityProviderStrategy is specified, the launchType parameter must + // be omitted. If no capacityProviderStrategy or launchType is specified, the + // defaultCapacityProviderStrategy for the cluster is used. + // + // If specifying a capacity provider that uses an Auto Scaling group, the capacity + // provider must already be created. New capacity providers can be created with + // the CreateCapacityProvider API operation. + // + // To use a AWS Fargate capacity provider, specify either the FARGATE or FARGATE_SPOT + // capacity providers. The AWS Fargate capacity providers are available to all + // accounts and only need to be associated with a cluster to be used. + // + // The PutClusterCapacityProviders API operation is used to update the list + // of available capacity providers for a cluster after the cluster is created. + CapacityProviderStrategy []*CapacityProviderStrategyItem `locationName:"capacityProviderStrategy" type:"list"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency // of the request. Up to 32 ASCII characters are allowed. ClientToken *string `locationName:"clientToken" type:"string"` @@ -7220,6 +8643,9 @@ type CreateServiceInput struct { // The launch type on which to run your service. For more information, see Amazon // ECS Launch Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) // in the Amazon Elastic Container Service Developer Guide. + // + // If a launchType is specified, the capacityProviderStrategy parameter must + // be omitted. LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"` // A load balancer object representing the load balancers to use with your service. @@ -7311,9 +8737,9 @@ type CreateServiceInput struct { // role is used by default for your service unless you specify a role here. // The service-linked role is required if your task definition uses the awsvpc // network mode or if the service is configured to use service discovery, an - // external deployment controller, or multiple target groups in which case you - // should not specify a role here. For more information, see Using Service-Linked - // Roles for Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html) + // external deployment controller, multiple target groups, or Elastic Inference + // accelerators in which case you should not specify a role here. For more information, + // see Using Service-Linked Roles for Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using-service-linked-roles.html) // in the Amazon Elastic Container Service Developer Guide. // // If your specified role has a path other than /, then you must either specify @@ -7414,6 +8840,16 @@ func (s *CreateServiceInput) Validate() error { if s.ServiceName == nil { invalidParams.Add(request.NewErrParamRequired("ServiceName")) } + if s.CapacityProviderStrategy != nil { + for i, v := range s.CapacityProviderStrategy { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CapacityProviderStrategy", i), err.(request.ErrInvalidParams)) + } + } + } if s.DeploymentController != nil { if err := s.DeploymentController.Validate(); err != nil { invalidParams.AddNested("DeploymentController", err.(request.ErrInvalidParams)) @@ -7441,6 +8877,12 @@ func (s *CreateServiceInput) Validate() error { return nil } +// SetCapacityProviderStrategy sets the CapacityProviderStrategy field's value. +func (s *CreateServiceInput) SetCapacityProviderStrategy(v []*CapacityProviderStrategyItem) *CreateServiceInput { + s.CapacityProviderStrategy = v + return s +} + // SetClientToken sets the ClientToken field's value. func (s *CreateServiceInput) SetClientToken(v string) *CreateServiceInput { s.ClientToken = &v @@ -7594,6 +9036,30 @@ func (s *CreateServiceOutput) SetService(v *Service) *CreateServiceOutput { type CreateTaskSetInput struct { _ struct{} `type:"structure"` + // The capacity provider strategy to use for the task set. + // + // A capacity provider strategy consists of one or more capacity providers along + // with the base and weight to assign to them. A capacity provider must be associated + // with the cluster to be used in a capacity provider strategy. The PutClusterCapacityProviders + // API is used to associate a capacity provider with a cluster. Only capacity + // providers with an ACTIVE or UPDATING status can be used. + // + // If a capacityProviderStrategy is specified, the launchType parameter must + // be omitted. If no capacityProviderStrategy or launchType is specified, the + // defaultCapacityProviderStrategy for the cluster is used. + // + // If specifying a capacity provider that uses an Auto Scaling group, the capacity + // provider must already be created. New capacity providers can be created with + // the CreateCapacityProvider API operation. + // + // To use a AWS Fargate capacity provider, specify either the FARGATE or FARGATE_SPOT + // capacity providers. The AWS Fargate capacity providers are available to all + // accounts and only need to be associated with a cluster to be used. + // + // The PutClusterCapacityProviders API operation is used to update the list + // of available capacity providers for a cluster after the cluster is created. + CapacityProviderStrategy []*CapacityProviderStrategyItem `locationName:"capacityProviderStrategy" type:"list"` + // Unique, case-sensitive identifier that you provide to ensure the idempotency // of the request. Up to 32 ASCII characters are allowed. ClientToken *string `locationName:"clientToken" type:"string"` @@ -7613,6 +9079,9 @@ type CreateTaskSetInput struct { // The launch type that new tasks in the task set will use. For more information, // see Amazon ECS Launch Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) // in the Amazon Elastic Container Service Developer Guide. + // + // If a launchType is specified, the capacityProviderStrategy parameter must + // be omitted. LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"` // A load balancer object representing the load balancer to use with the task @@ -7642,6 +9111,34 @@ type CreateTaskSetInput struct { // For more information, see Service Discovery (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/service-discovery.html). ServiceRegistries []*ServiceRegistry `locationName:"serviceRegistries" type:"list"` + // The metadata that you apply to the task set to help you categorize and organize + // them. Each tag consists of a key and an optional value, both of which you + // define. When a service is deleted, the tags are deleted as well. + // + // The following basic restrictions apply to tags: + // + // * Maximum number of tags per resource - 50 + // + // * For each resource, each tag key must be unique, and each tag key can + // have only one value. + // + // * Maximum key length - 128 Unicode characters in UTF-8 + // + // * Maximum value length - 256 Unicode characters in UTF-8 + // + // * If your tagging schema is used across multiple services and resources, + // remember that other services may have restrictions on allowed characters. + // Generally allowed characters are: letters, numbers, and spaces representable + // in UTF-8, and the following characters: + - = . _ : / @. + // + // * Tag keys and values are case-sensitive. + // + // * Do not use aws:, AWS:, or any upper or lowercase combination of such + // as a prefix for either keys or values as it is reserved for AWS use. You + // cannot edit or delete tag keys or values with this prefix. Tags with this + // prefix do not count against your tags per resource limit. + Tags []*Tag `locationName:"tags" type:"list"` + // The task definition for the tasks in the task set to use. // // TaskDefinition is a required field @@ -7670,11 +9167,31 @@ func (s *CreateTaskSetInput) Validate() error { if s.TaskDefinition == nil { invalidParams.Add(request.NewErrParamRequired("TaskDefinition")) } + if s.CapacityProviderStrategy != nil { + for i, v := range s.CapacityProviderStrategy { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CapacityProviderStrategy", i), err.(request.ErrInvalidParams)) + } + } + } if s.NetworkConfiguration != nil { if err := s.NetworkConfiguration.Validate(); err != nil { invalidParams.AddNested("NetworkConfiguration", 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 @@ -7682,6 +9199,12 @@ func (s *CreateTaskSetInput) Validate() error { return nil } +// SetCapacityProviderStrategy sets the CapacityProviderStrategy field's value. +func (s *CreateTaskSetInput) SetCapacityProviderStrategy(v []*CapacityProviderStrategyItem) *CreateTaskSetInput { + s.CapacityProviderStrategy = v + return s +} + // SetClientToken sets the ClientToken field's value. func (s *CreateTaskSetInput) SetClientToken(v string) *CreateTaskSetInput { s.ClientToken = &v @@ -7742,6 +9265,12 @@ func (s *CreateTaskSetInput) SetServiceRegistries(v []*ServiceRegistry) *CreateT return s } +// SetTags sets the Tags field's value. +func (s *CreateTaskSetInput) SetTags(v []*Tag) *CreateTaskSetInput { + s.Tags = v + return s +} + // SetTaskDefinition sets the TaskDefinition field's value. func (s *CreateTaskSetInput) SetTaskDefinition(v string) *CreateTaskSetInput { s.TaskDefinition = &v @@ -8191,6 +9720,9 @@ func (s *DeleteTaskSetOutput) SetTaskSet(v *TaskSet) *DeleteTaskSetOutput { type Deployment struct { _ struct{} `type:"structure"` + // The capacity provider strategy that the deployment is using. + CapacityProviderStrategy []*CapacityProviderStrategyItem `locationName:"capacityProviderStrategy" type:"list"` + // The Unix timestamp for when the service deployment was created. CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` @@ -8257,6 +9789,12 @@ func (s Deployment) GoString() string { return s.String() } +// SetCapacityProviderStrategy sets the CapacityProviderStrategy field's value. +func (s *Deployment) SetCapacityProviderStrategy(v []*CapacityProviderStrategyItem) *Deployment { + s.CapacityProviderStrategy = v + return s +} + // SetCreatedAt sets the CreatedAt field's value. func (s *Deployment) SetCreatedAt(v time.Time) *Deployment { s.CreatedAt = &v @@ -8617,6 +10155,115 @@ func (s *DeregisterTaskDefinitionOutput) SetTaskDefinition(v *TaskDefinition) *D return s } +type DescribeCapacityProvidersInput struct { + _ struct{} `type:"structure"` + + // The short name or full Amazon Resource Name (ARN) of one or more capacity + // providers. Up to 100 capacity providers can be described in an action. + CapacityProviders []*string `locationName:"capacityProviders" type:"list"` + + // Specifies whether or not you want to see the resource tags for the capacity + // provider. If TAGS is specified, the tags are included in the response. If + // this field is omitted, tags are not included in the response. + Include []*string `locationName:"include" type:"list"` + + // The maximum number of account setting results returned by DescribeCapacityProviders + // in paginated output. When this parameter is used, DescribeCapacityProviders + // 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 DescribeCapacityProviders request with the returned nextToken value. + // This value can be between 1 and 10. If this parameter is not used, then DescribeCapacityProviders + // 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 DescribeCapacityProviders + // 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 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 DescribeCapacityProvidersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCapacityProvidersInput) GoString() string { + return s.String() +} + +// SetCapacityProviders sets the CapacityProviders field's value. +func (s *DescribeCapacityProvidersInput) SetCapacityProviders(v []*string) *DescribeCapacityProvidersInput { + s.CapacityProviders = v + return s +} + +// SetInclude sets the Include field's value. +func (s *DescribeCapacityProvidersInput) SetInclude(v []*string) *DescribeCapacityProvidersInput { + s.Include = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeCapacityProvidersInput) SetMaxResults(v int64) *DescribeCapacityProvidersInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeCapacityProvidersInput) SetNextToken(v string) *DescribeCapacityProvidersInput { + s.NextToken = &v + return s +} + +type DescribeCapacityProvidersOutput struct { + _ struct{} `type:"structure"` + + // The list of capacity providers. + CapacityProviders []*CapacityProvider `locationName:"capacityProviders" type:"list"` + + // Any failures associated with the call. + Failures []*Failure `locationName:"failures" type:"list"` + + // The nextToken value to include in a future DescribeCapacityProviders request. + // When the results of a DescribeCapacityProviders 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 DescribeCapacityProvidersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCapacityProvidersOutput) GoString() string { + return s.String() +} + +// SetCapacityProviders sets the CapacityProviders field's value. +func (s *DescribeCapacityProvidersOutput) SetCapacityProviders(v []*CapacityProvider) *DescribeCapacityProvidersOutput { + s.CapacityProviders = v + return s +} + +// SetFailures sets the Failures field's value. +func (s *DescribeCapacityProvidersOutput) SetFailures(v []*Failure) *DescribeCapacityProvidersOutput { + s.Failures = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeCapacityProvidersOutput) SetNextToken(v string) *DescribeCapacityProvidersOutput { + s.NextToken = &v + return s +} + type DescribeClustersInput struct { _ struct{} `type:"structure"` @@ -8624,8 +10271,16 @@ type DescribeClustersInput struct { // entries. If you do not specify a cluster, the default cluster is assumed. Clusters []*string `locationName:"clusters" type:"list"` - // Additional information about your clusters to be separated by launch type, - // including: + // Whether to include additional information about your clusters in the response. + // If this field is omitted, the attachments, statistics, and tags are not included. + // + // If ATTACHMENTS is specified, the attachments for the container instances + // or tasks within the cluster are included. + // + // If SETTINGS is specified, the settings for the cluster are included. + // + // If STATISTICS is specified, the following additional information, separated + // by launch type, is included: // // * runningEC2TasksCount // @@ -8642,6 +10297,8 @@ type DescribeClustersInput struct { // * drainingEC2ServiceCount // // * drainingFargateServiceCount + // + // If TAGS is specified, the metadata tags associated with the cluster are included. Include []*string `locationName:"include" type:"list"` } @@ -9005,6 +10662,11 @@ type DescribeTaskSetsInput struct { // Cluster is a required field Cluster *string `locationName:"cluster" type:"string" required:"true"` + // Specifies whether to see the resource tags for the task set. If TAGS is specified, + // the tags are included in the response. If this field is omitted, tags are + // not included in the response. + Include []*string `locationName:"include" type:"list"` + // The short name or full Amazon Resource Name (ARN) of the service that the // task sets exist in. // @@ -9047,6 +10709,12 @@ func (s *DescribeTaskSetsInput) SetCluster(v string) *DescribeTaskSetsInput { return s } +// SetInclude sets the Include field's value. +func (s *DescribeTaskSetsInput) SetInclude(v []*string) *DescribeTaskSetsInput { + s.Include = v + return s +} + // SetService sets the Service field's value. func (s *DescribeTaskSetsInput) SetService(v string) *DescribeTaskSetsInput { s.Service = &v @@ -9393,6 +11061,63 @@ func (s *DockerVolumeConfiguration) SetScope(v string) *DockerVolumeConfiguratio return s } +// This parameter is specified when you are using an Amazon Elastic File System +// (Amazon EFS) file storage. Amazon EFS file systems are only supported when +// you are using the EC2 launch type. +// +// EFSVolumeConfiguration remains in preview and is a Beta Service as defined +// by and subject to the Beta Service Participation Service Terms located at +// https://aws.amazon.com/service-terms (https://aws.amazon.com/service-terms) +// ("Beta Terms"). These Beta Terms apply to your participation in this preview +// of EFSVolumeConfiguration. +type EFSVolumeConfiguration struct { + _ struct{} `type:"structure"` + + // The Amazon EFS file system ID to use. + // + // FileSystemId is a required field + FileSystemId *string `locationName:"fileSystemId" type:"string" required:"true"` + + // The directory within the Amazon EFS file system to mount as the root directory + // inside the host. + RootDirectory *string `locationName:"rootDirectory" type:"string"` +} + +// String returns the string representation +func (s EFSVolumeConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EFSVolumeConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EFSVolumeConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EFSVolumeConfiguration"} + 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 *EFSVolumeConfiguration) SetFileSystemId(v string) *EFSVolumeConfiguration { + s.FileSystemId = &v + return s +} + +// SetRootDirectory sets the RootDirectory field's value. +func (s *EFSVolumeConfiguration) SetRootDirectory(v string) *EFSVolumeConfiguration { + s.RootDirectory = &v + return s +} + // A failed resource. type Failure struct { _ struct{} `type:"structure"` @@ -9400,6 +11125,9 @@ type Failure struct { // The Amazon Resource Name (ARN) of the failed resource. Arn *string `locationName:"arn" type:"string"` + // The details of the failure. + Detail *string `locationName:"detail" type:"string"` + // The reason for the failure. Reason *string `locationName:"reason" type:"string"` } @@ -9420,6 +11148,12 @@ func (s *Failure) SetArn(v string) *Failure { return s } +// SetDetail sets the Detail field's value. +func (s *Failure) SetDetail(v string) *Failure { + s.Detail = &v + return s +} + // SetReason sets the Reason field's value. func (s *Failure) SetReason(v string) *Failure { s.Reason = &v @@ -9434,9 +11168,12 @@ type FirelensConfiguration struct { _ struct{} `type:"structure"` // The options to use when configuring the log router. This field is optional - // and can be used to add additional metadata, such as the task, task definition, - // cluster, and container instance details to the log event. If specified, the - // syntax to use is "options":{"enable-ecs-log-metadata":"true|false"}. + // and can be used to specify a custom configuration file or to add additional + // metadata, such as the task, task definition, cluster, and container instance + // details to the log event. If specified, the syntax to use is "options":{"enable-ecs-log-metadata":"true|false","config-file-type:"s3|file","config-file-value":"arn:aws:s3:::mybucket/fluent.conf|filepath"}. + // For more information, see Creating a Task Definition that Uses a FireLens + // Configuration (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html#firelens-taskdef) + // in the Amazon Elastic Container Service Developer Guide. Options map[string]*string `locationName:"options" type:"map"` // The log router to use. The valid values are fluentd or fluentbit. @@ -9774,6 +11511,63 @@ func (s *InferenceAcceleratorOverride) SetDeviceType(v string) *InferenceAcceler return s } +// The specified parameter is invalid. Review the available parameters for the +// API request. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} + +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + // The Linux capabilities for the container that are added to or dropped from // the default configuration provided by Docker. For more information on the // default capabilities and the non-default available capabilities, see Runtime @@ -9877,6 +11671,62 @@ func (s *KeyValuePair) SetValue(v string) *KeyValuePair { return s } +// The limit for the resource has been exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Linux-specific options that are applied to the container, such as Linux KernelCapabilities. type LinuxParameters struct { _ struct{} `type:"structure"` @@ -10049,11 +11899,11 @@ type ListAccountSettingsInput struct { // The resource name you want to list the account settings for. Name *string `locationName:"name" type:"string" enum:"SettingName"` - - // The nextToken value returned from a previous paginated ListAccountSettings - // 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. + + // The nextToken value returned from a ListAccountSettings request indicating + // that more results are available to fulfill the request and further calls + // will be needed. If maxResults was provided, it is possible the number of + // results to be fewer than maxResults. // // 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. @@ -10173,10 +12023,10 @@ type ListAttributesInput struct { // 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. + // The nextToken value returned from a ListAttributes request indicating that + // more results are available to fulfill the request and further calls will + // be needed. If maxResults was provided, it is possible the number of results + // to be fewer than maxResults. // // 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. @@ -10294,10 +12144,10 @@ type ListClustersInput struct { // 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. + // The nextToken value returned from a ListClusters request indicating that + // more results are available to fulfill the request and further calls will + // be needed. If maxResults was provided, it is possible the number of results + // to be fewer than maxResults. // // 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. @@ -10386,10 +12236,10 @@ type ListContainerInstancesInput struct { // 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. + // The nextToken value returned from a ListContainerInstances request indicating + // that more results are available to fulfill the request and further calls + // will be needed. If maxResults was provided, it is possible the number of + // results to be fewer than maxResults. // // 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. @@ -10499,10 +12349,10 @@ type ListServicesInput struct { // 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. + // The nextToken value returned from a ListServices request indicating that + // more results are available to fulfill the request and further calls will + // be needed. If maxResults was provided, it is possible the number of results + // to be fewer than maxResults. // // 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. @@ -10669,10 +12519,10 @@ type ListTaskDefinitionFamiliesInput struct { // 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. + // The nextToken value returned from a ListTaskDefinitionFamilies request indicating + // that more results are available to fulfill the request and further calls + // will be needed. If maxResults was provided, it is possible the number of + // results to be fewer than maxResults. // // 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. @@ -10775,10 +12625,10 @@ type ListTaskDefinitionsInput struct { // 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. + // The nextToken value returned from a ListTaskDefinitions request indicating + // that more results are available to fulfill the request and further calls + // will be needed. If maxResults was provided, it is possible the number of + // results to be fewer than maxResults. // // 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. @@ -10917,10 +12767,10 @@ type ListTasksInput struct { // 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. + // The nextToken value returned from a ListTasks request indicating that more + // results are available to fulfill the request and further calls will be needed. + // If maxResults was provided, it is possible the number of results to be fewer + // than maxResults. // // 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. @@ -11117,19 +12967,56 @@ func (s *LoadBalancer) SetTargetGroupArn(v string) *LoadBalancer { return s } -// Log configuration options to send to a custom log driver for the container. +// The log configuration specification for the container. +// +// This parameter maps to LogConfig in the Create a container (https://docs.docker.com/engine/api/v1.35/#operation/ContainerCreate) +// section of the Docker Remote API (https://docs.docker.com/engine/api/v1.35/) +// and the --log-driver option to docker run (https://docs.docker.com/engine/reference/commandline/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. +// +// The following should be noted when specifying a log configuration for your +// containers: +// +// * Amazon ECS currently supports a subset of the logging drivers available +// to the Docker daemon (shown in the valid values below). 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. +// +// * For tasks using the EC2 launch type, 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 +// (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-agent-config.html) +// in the Amazon Elastic Container Service Developer Guide. +// +// * For tasks using the Fargate launch type, because you do not have access +// to the underlying infrastructure your tasks are hosted on, any additional +// software needed will have to be installed outside of the task. For example, +// the Fluentd output aggregators or a remote host running Logstash to send +// Gelf logs to. 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. + // The log driver to use for the container. The valid values listed earlier + // are log drivers that the Amazon ECS container agent can communicate with + // by default. // // For tasks using the Fargate launch type, the supported log drivers are awslogs, // splunk, and awsfirelens. // // For tasks using the EC2 launch type, the supported log drivers are awslogs, - // fluentd, gelf, json-file, journald, logentries, syslog, splunk, and awsfirelens. + // fluentd, gelf, json-file, journald, logentries,syslog, splunk, and awsfirelens. // // For more information about using the awslogs log driver, see Using the awslogs // Log Driver (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_awslogs.html) @@ -11139,17 +13026,11 @@ type LogConfiguration struct { // Routing (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/using_firelens.html) // in the Amazon Elastic Container Service Developer Guide. // - // 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 + // If you have a custom driver that is not listed, 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 support 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 in to your container instance and run the following - // command: sudo docker version --format '{{.Server.APIVersion}}' + // requests for changes that you would like to have included. However, we do + // not currently provide support for running modified copies of this software. // // LogDriver is a required field LogDriver *string `locationName:"logDriver" type:"string" required:"true" enum:"LogDriver"` @@ -11218,6 +13099,152 @@ func (s *LogConfiguration) SetSecretOptions(v []*Secret) *LogConfiguration { return s } +// The managed scaling settings for the Auto Scaling group capacity provider. +// +// When managed scaling is enabled, Amazon ECS manages the scale-in and scale-out +// actions of the Auto Scaling group. Amazon ECS manages a target tracking scaling +// policy using an Amazon ECS-managed CloudWatch metric with the specified targetCapacity +// value as the target value for the metric. For more information, see Using +// Managed Scaling (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/asg-capacity-providers.html#asg-capacity-providers-managed-scaling) +// in the Amazon Elastic Container Service Developer Guide. +// +// If managed scaling is disabled, the user must manage the scaling of the Auto +// Scaling group. +type ManagedScaling struct { + _ struct{} `type:"structure"` + + // The maximum number of container instances that Amazon ECS will scale in or + // scale out at one time. If this parameter is omitted, the default value of + // 10000 is used. + MaximumScalingStepSize *int64 `locationName:"maximumScalingStepSize" min:"1" type:"integer"` + + // The minimum number of container instances that Amazon ECS will scale in or + // scale out at one time. If this parameter is omitted, the default value of + // 1 is used. + MinimumScalingStepSize *int64 `locationName:"minimumScalingStepSize" min:"1" type:"integer"` + + // Whether or not to enable managed scaling for the capacity provider. + Status *string `locationName:"status" type:"string" enum:"ManagedScalingStatus"` + + // The target capacity value for the capacity provider. The specified value + // must be greater than 0 and less than or equal to 100. A value of 100 will + // result in the Amazon EC2 instances in your Auto Scaling group being completely + // utilized. + TargetCapacity *int64 `locationName:"targetCapacity" min:"1" type:"integer"` +} + +// String returns the string representation +func (s ManagedScaling) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ManagedScaling) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ManagedScaling) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ManagedScaling"} + if s.MaximumScalingStepSize != nil && *s.MaximumScalingStepSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaximumScalingStepSize", 1)) + } + if s.MinimumScalingStepSize != nil && *s.MinimumScalingStepSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("MinimumScalingStepSize", 1)) + } + if s.TargetCapacity != nil && *s.TargetCapacity < 1 { + invalidParams.Add(request.NewErrParamMinValue("TargetCapacity", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaximumScalingStepSize sets the MaximumScalingStepSize field's value. +func (s *ManagedScaling) SetMaximumScalingStepSize(v int64) *ManagedScaling { + s.MaximumScalingStepSize = &v + return s +} + +// SetMinimumScalingStepSize sets the MinimumScalingStepSize field's value. +func (s *ManagedScaling) SetMinimumScalingStepSize(v int64) *ManagedScaling { + s.MinimumScalingStepSize = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ManagedScaling) SetStatus(v string) *ManagedScaling { + s.Status = &v + return s +} + +// SetTargetCapacity sets the TargetCapacity field's value. +func (s *ManagedScaling) SetTargetCapacity(v int64) *ManagedScaling { + s.TargetCapacity = &v + return s +} + +// 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. +type MissingVersionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s MissingVersionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MissingVersionException) GoString() string { + return s.String() +} + +func newErrorMissingVersionException(v protocol.ResponseMetadata) error { + return &MissingVersionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MissingVersionException) Code() string { + return "MissingVersionException" +} + +// Message returns the exception's message. +func (s MissingVersionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MissingVersionException) OrigErr() error { + return nil +} + +func (s MissingVersionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MissingVersionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MissingVersionException) RequestID() string { + return s.respMetadata.RequestID +} + // Details on a volume mount point that is used in a container definition. type MountPoint struct { _ struct{} `type:"structure"` @@ -11401,6 +13428,64 @@ func (s *NetworkInterface) SetPrivateIpv4Address(v string) *NetworkInterface { return s } +// 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. +type NoUpdateAvailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NoUpdateAvailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NoUpdateAvailableException) GoString() string { + return s.String() +} + +func newErrorNoUpdateAvailableException(v protocol.ResponseMetadata) error { + return &NoUpdateAvailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NoUpdateAvailableException) Code() string { + return "NoUpdateAvailableException" +} + +// Message returns the exception's message. +func (s NoUpdateAvailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoUpdateAvailableException) OrigErr() error { + return nil +} + +func (s NoUpdateAvailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NoUpdateAvailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NoUpdateAvailableException) RequestID() string { + return s.respMetadata.RequestID +} + // An object representing a constraint on task placement. For more information, // see Task Placement Constraints (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-placement-constraints.html) // in the Amazon Elastic Container Service Developer Guide. @@ -11547,6 +13632,119 @@ func (s *PlatformDevice) SetType(v string) *PlatformDevice { return s } +// The specified platform version does not satisfy the task definition's required +// capabilities. +type PlatformTaskDefinitionIncompatibilityException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PlatformTaskDefinitionIncompatibilityException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PlatformTaskDefinitionIncompatibilityException) GoString() string { + return s.String() +} + +func newErrorPlatformTaskDefinitionIncompatibilityException(v protocol.ResponseMetadata) error { + return &PlatformTaskDefinitionIncompatibilityException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PlatformTaskDefinitionIncompatibilityException) Code() string { + return "PlatformTaskDefinitionIncompatibilityException" +} + +// Message returns the exception's message. +func (s PlatformTaskDefinitionIncompatibilityException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PlatformTaskDefinitionIncompatibilityException) OrigErr() error { + return nil +} + +func (s PlatformTaskDefinitionIncompatibilityException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PlatformTaskDefinitionIncompatibilityException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PlatformTaskDefinitionIncompatibilityException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified platform version does not exist. +type PlatformUnknownException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PlatformUnknownException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PlatformUnknownException) GoString() string { + return s.String() +} + +func newErrorPlatformUnknownException(v protocol.ResponseMetadata) error { + return &PlatformUnknownException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PlatformUnknownException) Code() string { + return "PlatformUnknownException" +} + +// Message returns the exception's message. +func (s PlatformUnknownException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PlatformUnknownException) OrigErr() error { + return nil +} + +func (s PlatformUnknownException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PlatformUnknownException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PlatformUnknownException) RequestID() string { + return s.respMetadata.RequestID +} + // 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. @@ -11894,68 +14092,189 @@ func (s *PutAccountSettingInput) SetValue(v string) *PutAccountSettingInput { return s } -type PutAccountSettingOutput struct { +type PutAccountSettingOutput struct { + _ struct{} `type:"structure"` + + // The current account setting for a resource. + Setting *Setting `locationName:"setting" type:"structure"` +} + +// String returns the string representation +func (s PutAccountSettingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutAccountSettingOutput) GoString() string { + return s.String() +} + +// SetSetting sets the Setting field's value. +func (s *PutAccountSettingOutput) SetSetting(v *Setting) *PutAccountSettingOutput { + s.Setting = v + return s +} + +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 +} + +type PutAttributesOutput struct { _ struct{} `type:"structure"` - // The current account setting for a resource. - Setting *Setting `locationName:"setting" type:"structure"` + // The attributes applied to your resource. + Attributes []*Attribute `locationName:"attributes" type:"list"` } // String returns the string representation -func (s PutAccountSettingOutput) String() string { +func (s PutAttributesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutAccountSettingOutput) GoString() string { +func (s PutAttributesOutput) GoString() string { return s.String() } -// SetSetting sets the Setting field's value. -func (s *PutAccountSettingOutput) SetSetting(v *Setting) *PutAccountSettingOutput { - s.Setting = v +// SetAttributes sets the Attributes field's value. +func (s *PutAttributesOutput) SetAttributes(v []*Attribute) *PutAttributesOutput { + s.Attributes = v return s } -type PutAttributesInput struct { +type PutClusterCapacityProvidersInput 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. + // The name of one or more capacity providers to associate with the cluster. // - // Attributes is a required field - Attributes []*Attribute `locationName:"attributes" type:"list" required:"true"` + // If specifying a capacity provider that uses an Auto Scaling group, the capacity + // provider must already be created. New capacity providers can be created with + // the CreateCapacityProvider API operation. + // + // To use a AWS Fargate capacity provider, specify either the FARGATE or FARGATE_SPOT + // capacity providers. The AWS Fargate capacity providers are available to all + // accounts and only need to be associated with a cluster to be used. + // + // CapacityProviders is a required field + CapacityProviders []*string `locationName:"capacityProviders" 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"` + // The short name or full Amazon Resource Name (ARN) of the cluster to modify + // the capacity provider settings for. If you do not specify a cluster, the + // default cluster is assumed. + // + // Cluster is a required field + Cluster *string `locationName:"cluster" type:"string" required:"true"` + + // The capacity provider strategy to use by default for the cluster. + // + // When creating a service or running a task on a cluster, if no capacity provider + // or launch type is specified then the default capacity provider strategy for + // the cluster is used. + // + // A capacity provider strategy consists of one or more capacity providers along + // with the base and weight to assign to them. A capacity provider must be associated + // with the cluster to be used in a capacity provider strategy. The PutClusterCapacityProviders + // API is used to associate a capacity provider with a cluster. Only capacity + // providers with an ACTIVE or UPDATING status can be used. + // + // If specifying a capacity provider that uses an Auto Scaling group, the capacity + // provider must already be created. New capacity providers can be created with + // the CreateCapacityProvider API operation. + // + // To use a AWS Fargate capacity provider, specify either the FARGATE or FARGATE_SPOT + // capacity providers. The AWS Fargate capacity providers are available to all + // accounts and only need to be associated with a cluster to be used. + // + // DefaultCapacityProviderStrategy is a required field + DefaultCapacityProviderStrategy []*CapacityProviderStrategyItem `locationName:"defaultCapacityProviderStrategy" type:"list" required:"true"` } // String returns the string representation -func (s PutAttributesInput) String() string { +func (s PutClusterCapacityProvidersInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutAttributesInput) GoString() string { +func (s PutClusterCapacityProvidersInput) 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")) +func (s *PutClusterCapacityProvidersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutClusterCapacityProvidersInput"} + if s.CapacityProviders == nil { + invalidParams.Add(request.NewErrParamRequired("CapacityProviders")) } - if s.Attributes != nil { - for i, v := range s.Attributes { + if s.Cluster == nil { + invalidParams.Add(request.NewErrParamRequired("Cluster")) + } + if s.DefaultCapacityProviderStrategy == nil { + invalidParams.Add(request.NewErrParamRequired("DefaultCapacityProviderStrategy")) + } + if s.DefaultCapacityProviderStrategy != nil { + for i, v := range s.DefaultCapacityProviderStrategy { if v == nil { continue } if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Attributes", i), err.(request.ErrInvalidParams)) + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DefaultCapacityProviderStrategy", i), err.(request.ErrInvalidParams)) } } } @@ -11966,38 +14285,47 @@ func (s *PutAttributesInput) Validate() error { return nil } -// SetAttributes sets the Attributes field's value. -func (s *PutAttributesInput) SetAttributes(v []*Attribute) *PutAttributesInput { - s.Attributes = v +// SetCapacityProviders sets the CapacityProviders field's value. +func (s *PutClusterCapacityProvidersInput) SetCapacityProviders(v []*string) *PutClusterCapacityProvidersInput { + s.CapacityProviders = v return s } // SetCluster sets the Cluster field's value. -func (s *PutAttributesInput) SetCluster(v string) *PutAttributesInput { +func (s *PutClusterCapacityProvidersInput) SetCluster(v string) *PutClusterCapacityProvidersInput { s.Cluster = &v return s } -type PutAttributesOutput struct { +// SetDefaultCapacityProviderStrategy sets the DefaultCapacityProviderStrategy field's value. +func (s *PutClusterCapacityProvidersInput) SetDefaultCapacityProviderStrategy(v []*CapacityProviderStrategyItem) *PutClusterCapacityProvidersInput { + s.DefaultCapacityProviderStrategy = v + return s +} + +type PutClusterCapacityProvidersOutput struct { _ struct{} `type:"structure"` - // The attributes applied to your resource. - Attributes []*Attribute `locationName:"attributes" type:"list"` + // 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. + Cluster *Cluster `locationName:"cluster" type:"structure"` } // String returns the string representation -func (s PutAttributesOutput) String() string { +func (s PutClusterCapacityProvidersOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutAttributesOutput) GoString() string { +func (s PutClusterCapacityProvidersOutput) GoString() string { return s.String() } -// SetAttributes sets the Attributes field's value. -func (s *PutAttributesOutput) SetAttributes(v []*Attribute) *PutAttributesOutput { - s.Attributes = v +// SetCluster sets the Cluster field's value. +func (s *PutClusterCapacityProvidersOutput) SetCluster(v *Cluster) *PutClusterCapacityProvidersOutput { + s.Cluster = v return s } @@ -12478,6 +14806,16 @@ func (s *RegisterTaskDefinitionInput) Validate() error { } } } + if s.Volumes != nil { + for i, v := range s.Volumes { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Volumes", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -12725,6 +15063,118 @@ func (s *Resource) SetType(v string) *Resource { return s } +// The specified resource is in-use and cannot be removed. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource could not be found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // The type and amount of a resource to assign to a container. The supported // resource types are GPUs and Elastic Inference accelerators. For more information, // see Working with GPUs on Amazon ECS (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-gpu.html) @@ -12794,6 +15244,30 @@ func (s *ResourceRequirement) SetValue(v string) *ResourceRequirement { type RunTaskInput struct { _ struct{} `type:"structure"` + // The capacity provider strategy to use for the task. + // + // A capacity provider strategy consists of one or more capacity providers along + // with the base and weight to assign to them. A capacity provider must be associated + // with the cluster to be used in a capacity provider strategy. The PutClusterCapacityProviders + // API is used to associate a capacity provider with a cluster. Only capacity + // providers with an ACTIVE or UPDATING status can be used. + // + // If a capacityProviderStrategy is specified, the launchType parameter must + // be omitted. If no capacityProviderStrategy or launchType is specified, the + // defaultCapacityProviderStrategy for the cluster is used. + // + // If specifying a capacity provider that uses an Auto Scaling group, the capacity + // provider must already be created. New capacity providers can be created with + // the CreateCapacityProvider API operation. + // + // To use a AWS Fargate capacity provider, specify either the FARGATE or FARGATE_SPOT + // capacity providers. The AWS Fargate capacity providers are available to all + // accounts and only need to be associated with a cluster to be used. + // + // The PutClusterCapacityProviders API operation is used to update the list + // of available capacity providers for a cluster after the cluster is created. + CapacityProviderStrategy []*CapacityProviderStrategyItem `locationName:"capacityProviderStrategy" type:"list"` + // 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. @@ -12815,6 +15289,9 @@ type RunTaskInput struct { // The launch type on which to run your task. For more information, see Amazon // ECS Launch Types (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_types.html) // in the Amazon Elastic Container Service Developer Guide. + // + // If a launchType is specified, the capacityProviderStrategy parameter must + // be omitted. LaunchType *string `locationName:"launchType" type:"string" enum:"LaunchType"` // The network configuration for the task. This parameter is required for task @@ -12861,6 +15338,9 @@ type RunTaskInput struct { // a task. PropagateTags *string `locationName:"propagateTags" type:"string" enum:"PropagateTags"` + // The reference ID to use for the task. + ReferenceId *string `locationName:"referenceId" type:"string"` + // 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 @@ -12923,6 +15403,16 @@ func (s *RunTaskInput) Validate() error { if s.TaskDefinition == nil { invalidParams.Add(request.NewErrParamRequired("TaskDefinition")) } + if s.CapacityProviderStrategy != nil { + for i, v := range s.CapacityProviderStrategy { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CapacityProviderStrategy", i), err.(request.ErrInvalidParams)) + } + } + } if s.NetworkConfiguration != nil { if err := s.NetworkConfiguration.Validate(); err != nil { invalidParams.AddNested("NetworkConfiguration", err.(request.ErrInvalidParams)) @@ -12950,6 +15440,12 @@ func (s *RunTaskInput) Validate() error { return nil } +// SetCapacityProviderStrategy sets the CapacityProviderStrategy field's value. +func (s *RunTaskInput) SetCapacityProviderStrategy(v []*CapacityProviderStrategyItem) *RunTaskInput { + s.CapacityProviderStrategy = v + return s +} + // SetCluster sets the Cluster field's value. func (s *RunTaskInput) SetCluster(v string) *RunTaskInput { s.Cluster = &v @@ -13016,6 +15512,12 @@ func (s *RunTaskInput) SetPropagateTags(v string) *RunTaskInput { return s } +// SetReferenceId sets the ReferenceId field's value. +func (s *RunTaskInput) SetReferenceId(v string) *RunTaskInput { + s.ReferenceId = &v + return s +} + // SetStartedBy sets the StartedBy field's value. func (s *RunTaskInput) SetStartedBy(v string) *RunTaskInput { s.StartedBy = &v @@ -13172,10 +15674,69 @@ func (s *Secret) SetValueFrom(v string) *Secret { return s } +// These errors are usually caused by a server issue. +type ServerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServerException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServerException) GoString() string { + return s.String() +} + +func newErrorServerException(v protocol.ResponseMetadata) error { + return &ServerException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServerException) Code() string { + return "ServerException" +} + +// Message returns the exception's message. +func (s ServerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServerException) OrigErr() error { + return nil +} + +func (s ServerException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServerException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServerException) RequestID() string { + return s.respMetadata.RequestID +} + // Details on a service within a cluster type Service struct { _ struct{} `type:"structure"` + // The capacity provider strategy associated with the service. + CapacityProviderStrategy []*CapacityProviderStrategyItem `locationName:"capacityProviderStrategy" type:"list"` + // The Amazon Resource Name (ARN) of the cluster that hosts the service. ClusterArn *string `locationName:"clusterArn" type:"string"` @@ -13343,6 +15904,12 @@ func (s Service) GoString() string { return s.String() } +// SetCapacityProviderStrategy sets the CapacityProviderStrategy field's value. +func (s *Service) SetCapacityProviderStrategy(v []*CapacityProviderStrategyItem) *Service { + s.CapacityProviderStrategy = v + return s +} + // SetClusterArn sets the ClusterArn field's value. func (s *Service) SetClusterArn(v string) *Service { s.ClusterArn = &v @@ -13541,16 +16108,130 @@ func (s *ServiceEvent) SetCreatedAt(v time.Time) *ServiceEvent { return s } -// SetId sets the Id field's value. -func (s *ServiceEvent) SetId(v string) *ServiceEvent { - s.Id = &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 +} + +// The specified service is not active. You can't update a service that is inactive. +// If you have previously deleted a service, you can re-create it with CreateService. +type ServiceNotActiveException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceNotActiveException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceNotActiveException) GoString() string { + return s.String() +} + +func newErrorServiceNotActiveException(v protocol.ResponseMetadata) error { + return &ServiceNotActiveException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceNotActiveException) Code() string { + return "ServiceNotActiveException" +} + +// Message returns the exception's message. +func (s ServiceNotActiveException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceNotActiveException) OrigErr() error { + return nil +} + +func (s ServiceNotActiveException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceNotActiveException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceNotActiveException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified service could not be found. You can view your available services +// with ListServices. Amazon ECS services are cluster-specific and Region-specific. +type ServiceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceNotFoundException) GoString() string { + return s.String() +} + +func newErrorServiceNotFoundException(v protocol.ResponseMetadata) error { + return &ServiceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceNotFoundException) Code() string { + return "ServiceNotFoundException" +} + +// Message returns the exception's message. +func (s ServiceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceNotFoundException) OrigErr() error { + return nil +} + +func (s ServiceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetMessage sets the Message field's value. -func (s *ServiceEvent) SetMessage(v string) *ServiceEvent { - s.Message = &v - return s +// RequestID returns the service's response RequestID for request. +func (s ServiceNotFoundException) RequestID() string { + return s.respMetadata.RequestID } // Details of the service registry. @@ -13707,6 +16388,9 @@ type StartTaskInput struct { // to the task. If no value is specified, the tags are not propagated. PropagateTags *string `locationName:"propagateTags" type:"string" enum:"PropagateTags"` + // The reference ID to use for the task. + ReferenceId *string `locationName:"referenceId" type:"string"` + // 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 @@ -13841,6 +16525,12 @@ func (s *StartTaskInput) SetPropagateTags(v string) *StartTaskInput { return s } +// SetReferenceId sets the ReferenceId field's value. +func (s *StartTaskInput) SetReferenceId(v string) *StartTaskInput { + s.ReferenceId = &v + return s +} + // SetStartedBy sets the StartedBy field's value. func (s *StartTaskInput) SetStartedBy(v string) *StartTaskInput { s.StartedBy = &v @@ -14432,8 +17122,8 @@ type TagResourceInput struct { _ struct{} `type:"structure"` // The Amazon Resource Name (ARN) of the resource to which to add tags. Currently, - // the supported resources are Amazon ECS tasks, services, task definitions, - // clusters, and container instances. + // the supported resources are Amazon ECS capacity providers, tasks, services, + // task definitions, clusters, and container instances. // // ResourceArn is a required field ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"` @@ -14529,6 +17219,64 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// 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. +type TargetNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TargetNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TargetNotFoundException) GoString() string { + return s.String() +} + +func newErrorTargetNotFoundException(v protocol.ResponseMetadata) error { + return &TargetNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TargetNotFoundException) Code() string { + return "TargetNotFoundException" +} + +// Message returns the exception's message. +func (s TargetNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TargetNotFoundException) OrigErr() error { + return nil +} + +func (s TargetNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TargetNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TargetNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Details on a task in a cluster. type Task struct { _ struct{} `type:"structure"` @@ -14537,6 +17285,15 @@ type Task struct { // awsvpc network mode. Attachments []*Attachment `locationName:"attachments" type:"list"` + // The attributes of the task + Attributes []*Attribute `locationName:"attributes" type:"list"` + + // The availability zone of the task. + AvailabilityZone *string `locationName:"availabilityZone" type:"string"` + + // The capacity provider associated with the task. + CapacityProviderName *string `locationName:"capacityProviderName" type:"string"` + // The ARN of the cluster that hosts the task. ClusterArn *string `locationName:"clusterArn" type:"string"` @@ -14747,6 +17504,24 @@ func (s *Task) SetAttachments(v []*Attachment) *Task { return s } +// SetAttributes sets the Attributes field's value. +func (s *Task) SetAttributes(v []*Attribute) *Task { + s.Attributes = v + return s +} + +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *Task) SetAvailabilityZone(v string) *Task { + s.AvailabilityZone = &v + return s +} + +// SetCapacityProviderName sets the CapacityProviderName field's value. +func (s *Task) SetCapacityProviderName(v string) *Task { + s.CapacityProviderName = &v + return s +} + // SetClusterArn sets the ClusterArn field's value. func (s *Task) SetClusterArn(v string) *Task { s.ClusterArn = &v @@ -14967,12 +17742,19 @@ type TaskDefinition struct { // that are specified in this role. ExecutionRoleArn *string `locationName:"executionRoleArn" type:"string"` - // The name of a family that this task definition is registered to. A family - // groups multiple versions of a task definition. Amazon ECS gives the first - // task definition that you registered to a family a revision number of 1. Amazon - // ECS gives sequential revision numbers to each task definition that you add. + // The name of a family that this task definition is registered to. Up to 255 + // letters (uppercase and lowercase), numbers, hyphens, and underscores are + // allowed. + // + // A family groups multiple versions of a task definition. Amazon ECS gives + // the first task definition that you registered to a family a revision number + // of 1. Amazon ECS gives sequential revision numbers to each task definition + // that you add. Family *string `locationName:"family" type:"string"` + // The Elastic Inference accelerator associated with the task. + InferenceAccelerators []*InferenceAccelerator `locationName:"inferenceAccelerators" type:"list"` + // The IPC resource namespace to use for the containers in the task. The valid // values are host, task, or none. If host is specified, then all containers // within the tasks that specified the host IPC mode on the same container instance @@ -15185,6 +17967,12 @@ func (s *TaskDefinition) SetFamily(v string) *TaskDefinition { return s } +// SetInferenceAccelerators sets the InferenceAccelerators field's value. +func (s *TaskDefinition) SetInferenceAccelerators(v []*InferenceAccelerator) *TaskDefinition { + s.InferenceAccelerators = v + return s +} + // SetIpcMode sets the IpcMode field's value. func (s *TaskDefinition) SetIpcMode(v string) *TaskDefinition { s.IpcMode = &v @@ -15311,6 +18099,9 @@ type TaskOverride struct { // One or more container overrides sent to a task. ContainerOverrides []*ContainerOverride `locationName:"containerOverrides" type:"list"` + // The cpu override for the task. + Cpu *string `locationName:"cpu" type:"string"` + // The Amazon Resource Name (ARN) of the task execution role that the Amazon // ECS container agent and the Docker daemon can assume. ExecutionRoleArn *string `locationName:"executionRoleArn" type:"string"` @@ -15318,6 +18109,9 @@ type TaskOverride struct { // The Elastic Inference accelerator override for the task. InferenceAcceleratorOverrides []*InferenceAcceleratorOverride `locationName:"inferenceAcceleratorOverrides" type:"list"` + // The memory override for the task. + Memory *string `locationName:"memory" 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. @@ -15360,6 +18154,12 @@ func (s *TaskOverride) SetContainerOverrides(v []*ContainerOverride) *TaskOverri return s } +// SetCpu sets the Cpu field's value. +func (s *TaskOverride) SetCpu(v string) *TaskOverride { + s.Cpu = &v + return s +} + // SetExecutionRoleArn sets the ExecutionRoleArn field's value. func (s *TaskOverride) SetExecutionRoleArn(v string) *TaskOverride { s.ExecutionRoleArn = &v @@ -15372,6 +18172,12 @@ func (s *TaskOverride) SetInferenceAcceleratorOverrides(v []*InferenceAccelerato return s } +// SetMemory sets the Memory field's value. +func (s *TaskOverride) SetMemory(v string) *TaskOverride { + s.Memory = &v + return s +} + // SetTaskRoleArn sets the TaskRoleArn field's value. func (s *TaskOverride) SetTaskRoleArn(v string) *TaskOverride { s.TaskRoleArn = &v @@ -15385,6 +18191,9 @@ func (s *TaskOverride) SetTaskRoleArn(v string) *TaskOverride { type TaskSet struct { _ struct{} `type:"structure"` + // The capacity provider strategy associated with the task set. + CapacityProviderStrategy []*CapacityProviderStrategyItem `locationName:"capacityProviderStrategy" type:"list"` + // The Amazon Resource Name (ARN) of the cluster that the service that hosts // the task set exists in. ClusterArn *string `locationName:"clusterArn" type:"string"` @@ -15491,6 +18300,34 @@ type TaskSet struct { // are being deregistered from their target group. Status *string `locationName:"status" type:"string"` + // The metadata that you apply to the task set to help you categorize and organize + // them. Each tag consists of a key and an optional value, both of which you + // define. + // + // The following basic restrictions apply to tags: + // + // * Maximum number of tags per resource - 50 + // + // * For each resource, each tag key must be unique, and each tag key can + // have only one value. + // + // * Maximum key length - 128 Unicode characters in UTF-8 + // + // * Maximum value length - 256 Unicode characters in UTF-8 + // + // * If your tagging schema is used across multiple services and resources, + // remember that other services may have restrictions on allowed characters. + // Generally allowed characters are: letters, numbers, and spaces representable + // in UTF-8, and the following characters: + - = . _ : / @. + // + // * Tag keys and values are case-sensitive. + // + // * Do not use aws:, AWS:, or any upper or lowercase combination of such + // as a prefix for either keys or values as it is reserved for AWS use. You + // cannot edit or delete tag keys or values with this prefix. Tags with this + // prefix do not count against your tags per resource limit. + Tags []*Tag `locationName:"tags" type:"list"` + // The task definition the task set is using. TaskDefinition *string `locationName:"taskDefinition" type:"string"` @@ -15511,6 +18348,12 @@ func (s TaskSet) GoString() string { return s.String() } +// SetCapacityProviderStrategy sets the CapacityProviderStrategy field's value. +func (s *TaskSet) SetCapacityProviderStrategy(v []*CapacityProviderStrategyItem) *TaskSet { + s.CapacityProviderStrategy = v + return s +} + // SetClusterArn sets the ClusterArn field's value. func (s *TaskSet) SetClusterArn(v string) *TaskSet { s.ClusterArn = &v @@ -15619,6 +18462,12 @@ func (s *TaskSet) SetStatus(v string) *TaskSet { return s } +// SetTags sets the Tags field's value. +func (s *TaskSet) SetTags(v []*Tag) *TaskSet { + s.Tags = v + return s +} + // SetTaskDefinition sets the TaskDefinition field's value. func (s *TaskSet) SetTaskDefinition(v string) *TaskSet { s.TaskDefinition = &v @@ -15637,6 +18486,64 @@ func (s *TaskSet) SetUpdatedAt(v time.Time) *TaskSet { return s } +// The specified task set could not be found. You can view your available task +// sets with DescribeTaskSets. Task sets are specific to each cluster, service +// and Region. +type TaskSetNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TaskSetNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TaskSetNotFoundException) GoString() string { + return s.String() +} + +func newErrorTaskSetNotFoundException(v protocol.ResponseMetadata) error { + return &TaskSetNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TaskSetNotFoundException) Code() string { + return "TaskSetNotFoundException" +} + +// Message returns the exception's message. +func (s TaskSetNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TaskSetNotFoundException) OrigErr() error { + return nil +} + +func (s TaskSetNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TaskSetNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TaskSetNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // The container path, mount options, and size of the tmpfs mount. type Tmpfs struct { _ struct{} `type:"structure"` @@ -15773,12 +18680,68 @@ func (s *Ulimit) SetSoftLimit(v int64) *Ulimit { return s } +// The specified task is not supported in this Region. +type UnsupportedFeatureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedFeatureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedFeatureException) GoString() string { + return s.String() +} + +func newErrorUnsupportedFeatureException(v protocol.ResponseMetadata) error { + return &UnsupportedFeatureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedFeatureException) Code() string { + return "UnsupportedFeatureException" +} + +// Message returns the exception's message. +func (s UnsupportedFeatureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedFeatureException) OrigErr() error { + return nil +} + +func (s UnsupportedFeatureException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedFeatureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedFeatureException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` // The Amazon Resource Name (ARN) of the resource from which to delete tags. - // Currently, the supported resources are Amazon ECS tasks, services, task definitions, - // clusters, and container instances. + // Currently, the supported resources are Amazon ECS capacity providers, tasks, + // services, task definitions, clusters, and container instances. // // ResourceArn is a required field ResourceArn *string `locationName:"resourceArn" type:"string" required:"true"` @@ -16095,9 +19058,77 @@ func (s *UpdateContainerInstancesStateOutput) SetFailures(v []*Failure) *UpdateC return s } +// 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. +type UpdateInProgressException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UpdateInProgressException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateInProgressException) GoString() string { + return s.String() +} + +func newErrorUpdateInProgressException(v protocol.ResponseMetadata) error { + return &UpdateInProgressException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UpdateInProgressException) Code() string { + return "UpdateInProgressException" +} + +// Message returns the exception's message. +func (s UpdateInProgressException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UpdateInProgressException) OrigErr() error { + return nil +} + +func (s UpdateInProgressException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UpdateInProgressException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UpdateInProgressException) RequestID() string { + return s.respMetadata.RequestID +} + type UpdateServiceInput struct { _ struct{} `type:"structure"` + // The capacity provider strategy to update the service to use. + // + // If the service is using the default capacity provider strategy for the cluster, + // the service can be updated to use one or more capacity providers. However, + // when a service is using a non-default capacity provider strategy, the service + // cannot be updated to use the cluster's default capacity provider strategy. + CapacityProviderStrategy []*CapacityProviderStrategyItem `locationName:"capacityProviderStrategy" type:"list"` + // 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. @@ -16123,28 +19154,19 @@ type UpdateServiceInput struct { // has first started. This is only valid if your service is configured to use // a load balancer. If your service's tasks take a while to start and respond // to Elastic Load Balancing health checks, you can specify a health check grace - // period of up to 2,147,483,647 seconds. During that time, the ECS service + // period of up to 2,147,483,647 seconds. During that time, the Amazon ECS service // scheduler ignores the Elastic Load Balancing health check status. This grace // period can prevent the ECS service scheduler from marking tasks as unhealthy // and stopping them before they have time to come up. HealthCheckGracePeriodSeconds *int64 `locationName:"healthCheckGracePeriodSeconds" type:"integer"` - // The network configuration for the service. This parameter is required for - // task definitions that use the awsvpc network mode to receive their own elastic - // network interface, and it is not supported for other network modes. For more - // information, see Task Networking (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-networking.html) - // in the Amazon Elastic Container Service Developer Guide. - // - // Updating a service to add a subnet to a list of existing subnets does not - // trigger a service deployment. For example, if your network configuration - // change is to keep the existing subnets and simply add another subnet to the - // network configuration, this does not trigger a new service deployment. + // An object representing the network configuration for a task or service. NetworkConfiguration *NetworkConfiguration `locationName:"networkConfiguration" type:"structure"` // The platform version on which your tasks in the service are running. A platform - // version is only specified for tasks using the Fargate launch type. If one - // is not specified, the LATEST platform version is used by default. For more - // information, see AWS Fargate Platform Versions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) + // version is only specified for tasks using the Fargate launch type. If a platform + // version is not specified, the LATEST platform version is used by default. + // For more information, see AWS Fargate Platform Versions (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/platform_versions.html) // in the Amazon Elastic Container Service Developer Guide. PlatformVersion *string `locationName:"platformVersion" type:"string"` @@ -16177,6 +19199,16 @@ func (s *UpdateServiceInput) Validate() error { if s.Service == nil { invalidParams.Add(request.NewErrParamRequired("Service")) } + if s.CapacityProviderStrategy != nil { + for i, v := range s.CapacityProviderStrategy { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CapacityProviderStrategy", i), err.(request.ErrInvalidParams)) + } + } + } if s.NetworkConfiguration != nil { if err := s.NetworkConfiguration.Validate(); err != nil { invalidParams.AddNested("NetworkConfiguration", err.(request.ErrInvalidParams)) @@ -16189,6 +19221,12 @@ func (s *UpdateServiceInput) Validate() error { return nil } +// SetCapacityProviderStrategy sets the CapacityProviderStrategy field's value. +func (s *UpdateServiceInput) SetCapacityProviderStrategy(v []*CapacityProviderStrategyItem) *UpdateServiceInput { + s.CapacityProviderStrategy = v + return s +} + // SetCluster sets the Cluster field's value. func (s *UpdateServiceInput) SetCluster(v string) *UpdateServiceInput { s.Cluster = &v @@ -16523,10 +19561,21 @@ type Volume struct { // This parameter is specified when you are using Docker volumes. Docker volumes // are only supported when you are using the EC2 launch type. Windows containers - // only support the use of the local driver. To use bind mounts, specify a host - // instead. + // only support the use of the local driver. To use bind mounts, specify the + // host parameter instead. DockerVolumeConfiguration *DockerVolumeConfiguration `locationName:"dockerVolumeConfiguration" type:"structure"` + // This parameter is specified when you are using an Amazon Elastic File System + // (Amazon EFS) file storage. Amazon EFS file systems are only supported when + // you are using the EC2 launch type. + // + // EFSVolumeConfiguration remains in preview and is a Beta Service as defined + // by and subject to the Beta Service Participation Service Terms located at + // https://aws.amazon.com/service-terms (https://aws.amazon.com/service-terms) + // ("Beta Terms"). These Beta Terms apply to your participation in this preview + // of EFSVolumeConfiguration. + EfsVolumeConfiguration *EFSVolumeConfiguration `locationName:"efsVolumeConfiguration" type:"structure"` + // This parameter is specified when you are using bind mount host volumes. Bind // mount host volumes are supported when you are using either the EC2 or Fargate // launch types. The contents of the host parameter determine whether your bind @@ -16557,12 +19606,33 @@ func (s Volume) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *Volume) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Volume"} + if s.EfsVolumeConfiguration != nil { + if err := s.EfsVolumeConfiguration.Validate(); err != nil { + invalidParams.AddNested("EfsVolumeConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetDockerVolumeConfiguration sets the DockerVolumeConfiguration field's value. func (s *Volume) SetDockerVolumeConfiguration(v *DockerVolumeConfiguration) *Volume { s.DockerVolumeConfiguration = v return s } +// SetEfsVolumeConfiguration sets the EfsVolumeConfiguration field's value. +func (s *Volume) SetEfsVolumeConfiguration(v *EFSVolumeConfiguration) *Volume { + s.EfsVolumeConfiguration = v + return s +} + // SetHost sets the Host field's value. func (s *Volume) SetHost(v *HostVolumeProperties) *Volume { s.Host = v @@ -16640,6 +19710,22 @@ const ( ) const ( + // CapacityProviderFieldTags is a CapacityProviderField enum value + CapacityProviderFieldTags = "TAGS" +) + +const ( + // CapacityProviderStatusActive is a CapacityProviderStatus enum value + CapacityProviderStatusActive = "ACTIVE" +) + +const ( + // ClusterFieldAttachments is a ClusterField enum value + ClusterFieldAttachments = "ATTACHMENTS" + + // ClusterFieldSettings is a ClusterField enum value + ClusterFieldSettings = "SETTINGS" + // ClusterFieldStatistics is a ClusterField enum value ClusterFieldStatistics = "STATISTICS" @@ -16801,6 +19887,22 @@ const ( LogDriverAwsfirelens = "awsfirelens" ) +const ( + // ManagedScalingStatusEnabled is a ManagedScalingStatus enum value + ManagedScalingStatusEnabled = "ENABLED" + + // ManagedScalingStatusDisabled is a ManagedScalingStatus enum value + ManagedScalingStatusDisabled = "DISABLED" +) + +const ( + // ManagedTerminationProtectionEnabled is a ManagedTerminationProtection enum value + ManagedTerminationProtectionEnabled = "ENABLED" + + // ManagedTerminationProtectionDisabled is a ManagedTerminationProtection enum value + ManagedTerminationProtectionDisabled = "DISABLED" +) + const ( // NetworkModeBridge is a NetworkMode enum value NetworkModeBridge = "bridge" @@ -16966,6 +20068,11 @@ const ( TaskFieldTags = "TAGS" ) +const ( + // TaskSetFieldTags is a TaskSetField enum value + TaskSetFieldTags = "TAGS" +) + const ( // TaskStopCodeTaskFailedToStart is a TaskStopCode enum value TaskStopCodeTaskFailedToStart = "TaskFailedToStart" 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 index c350d185b15..736a07682ab 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecs/errors.go @@ -2,6 +2,10 @@ package ecs +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccessDeniedException for service response error code @@ -69,6 +73,12 @@ const ( // API request. ErrCodeInvalidParameterException = "InvalidParameterException" + // ErrCodeLimitExceededException for service response error code + // "LimitExceededException". + // + // The limit for the resource has been exceeded. + ErrCodeLimitExceededException = "LimitExceededException" + // ErrCodeMissingVersionException for service response error code // "MissingVersionException". // @@ -99,6 +109,12 @@ const ( // The specified platform version does not exist. ErrCodePlatformUnknownException = "PlatformUnknownException" + // ErrCodeResourceInUseException for service response error code + // "ResourceInUseException". + // + // The specified resource is in-use and cannot be removed. + ErrCodeResourceInUseException = "ResourceInUseException" + // ErrCodeResourceNotFoundException for service response error code // "ResourceNotFoundException". // @@ -136,9 +152,9 @@ const ( // ErrCodeTaskSetNotFoundException for service response error code // "TaskSetNotFoundException". // - // The specified task set could not be found. You can view your available container - // instances with DescribeTaskSets. Task sets are specific to each cluster, - // service and Region. + // The specified task set could not be found. You can view your available task + // sets with DescribeTaskSets. Task sets are specific to each cluster, service + // and Region. ErrCodeTaskSetNotFoundException = "TaskSetNotFoundException" // ErrCodeUnsupportedFeatureException for service response error code @@ -157,3 +173,29 @@ const ( // it resumes where it stopped previously. ErrCodeUpdateInProgressException = "UpdateInProgressException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "AttributeLimitExceededException": newErrorAttributeLimitExceededException, + "BlockedException": newErrorBlockedException, + "ClientException": newErrorClientException, + "ClusterContainsContainerInstancesException": newErrorClusterContainsContainerInstancesException, + "ClusterContainsServicesException": newErrorClusterContainsServicesException, + "ClusterContainsTasksException": newErrorClusterContainsTasksException, + "ClusterNotFoundException": newErrorClusterNotFoundException, + "InvalidParameterException": newErrorInvalidParameterException, + "LimitExceededException": newErrorLimitExceededException, + "MissingVersionException": newErrorMissingVersionException, + "NoUpdateAvailableException": newErrorNoUpdateAvailableException, + "PlatformTaskDefinitionIncompatibilityException": newErrorPlatformTaskDefinitionIncompatibilityException, + "PlatformUnknownException": newErrorPlatformUnknownException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ServerException": newErrorServerException, + "ServiceNotActiveException": newErrorServiceNotActiveException, + "ServiceNotFoundException": newErrorServiceNotFoundException, + "TargetNotFoundException": newErrorTargetNotFoundException, + "TaskSetNotFoundException": newErrorTaskSetNotFoundException, + "UnsupportedFeatureException": newErrorUnsupportedFeatureException, + "UpdateInProgressException": newErrorUpdateInProgressException, +} 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 index c268614ecb9..af14f7607cf 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ecs/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "ecs" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "ECS" // ServiceID is a unique identifer of a specific service. + ServiceID = "ECS" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ECS client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ECS client from just a session. // svc := ecs.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ECS { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ECS { svc := &ECS{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2014-11-13", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index bc4815e74e8..515a9d05855 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/efs/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/efs/api.go @@ -13,6 +13,111 @@ import ( "github.com/aws/aws-sdk-go/private/protocol/restjson" ) +const opCreateAccessPoint = "CreateAccessPoint" + +// CreateAccessPointRequest generates a "aws/request.Request" representing the +// client's request for the CreateAccessPoint operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateAccessPoint for more information on using the CreateAccessPoint +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateAccessPointRequest method. +// req, resp := client.CreateAccessPointRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateAccessPoint +func (c *EFS) CreateAccessPointRequest(input *CreateAccessPointInput) (req *request.Request, output *CreateAccessPointOutput) { + op := &request.Operation{ + Name: opCreateAccessPoint, + HTTPMethod: "POST", + HTTPPath: "/2015-02-01/access-points", + } + + if input == nil { + input = &CreateAccessPointInput{} + } + + output = &CreateAccessPointOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateAccessPoint API operation for Amazon Elastic File System. +// +// Creates an EFS access point. An access point is an application-specific view +// into an EFS file system that applies an operating system user and group, +// and a file system path, to any file system request made through the access +// point. The operating system user and group override any identity information +// provided by the NFS client. The file system path is exposed as the access +// point's root directory. Applications using the access point can only access +// data in its own directory and below. To learn more, see Mounting a File System +// Using EFS Access Points (https://docs.aws.amazon.com/efs/latest/ug/efs-access-points.html). +// +// This operation requires permissions for the elasticfilesystem:CreateAccessPoint +// 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 CreateAccessPoint for usage and error information. +// +// Returned Error Types: +// * BadRequest +// Returned if the request is malformed or contains an error such as an invalid +// parameter value or a missing required parameter. +// +// * AccessPointAlreadyExists +// Returned if the access point you are trying to create already exists, with +// the creation token you provided in the request. +// +// * InternalServerError +// Returned if an error occurred on the server side. +// +// * FileSystemNotFound +// Returned if the specified FileSystemId value doesn't exist in the requester's +// AWS account. +// +// * AccessPointLimitExceeded +// Returned if the AWS account has already created the maximum number of access +// points allowed per file system. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateAccessPoint +func (c *EFS) CreateAccessPoint(input *CreateAccessPointInput) (*CreateAccessPointOutput, error) { + req, out := c.CreateAccessPointRequest(input) + return out, req.Send() +} + +// CreateAccessPointWithContext is the same as CreateAccessPoint with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAccessPoint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) CreateAccessPointWithContext(ctx aws.Context, input *CreateAccessPointInput, opts ...request.Option) (*CreateAccessPointOutput, error) { + req, out := c.CreateAccessPointRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateFileSystem = "CreateFileSystem" // CreateFileSystemRequest generates a "aws/request.Request" representing the @@ -112,30 +217,30 @@ func (c *EFS) CreateFileSystemRequest(input *CreateFileSystemInput) (req *reques // 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 Error Types: +// * BadRequest // Returned if the request is malformed or contains an error such as an invalid // parameter value or a missing required parameter. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // Returned if an error occurred on the server side. // -// * ErrCodeFileSystemAlreadyExists "FileSystemAlreadyExists" +// * FileSystemAlreadyExists // Returned if the file system you are trying to create already exists, with // the creation token you provided. // -// * ErrCodeFileSystemLimitExceeded "FileSystemLimitExceeded" +// * FileSystemLimitExceeded // Returned if the AWS account has already created the maximum number of file // systems allowed per account. // -// * ErrCodeInsufficientThroughputCapacity "InsufficientThroughputCapacity" +// * InsufficientThroughputCapacity // Returned if there's not enough capacity to provision additional throughput. // This value might be returned when you try to create a file system in provisioned // throughput mode, when you attempt to increase the provisioned throughput // of an existing file system, or when you attempt to change an existing file // system from bursting to provisioned throughput mode. // -// * ErrCodeThroughputLimitExceeded "ThroughputLimitExceeded" +// * ThroughputLimitExceeded // Returned if the throughput mode or amount of provisioned throughput can't // be changed because the throughput limit of 1024 MiB/s has been reached. // @@ -302,37 +407,37 @@ func (c *EFS) CreateMountTargetRequest(input *CreateMountTargetInput) (req *requ // 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 Error Types: +// * BadRequest // Returned if the request is malformed or contains an error such as an invalid // parameter value or a missing required parameter. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // Returned if an error occurred on the server side. // -// * ErrCodeFileSystemNotFound "FileSystemNotFound" +// * FileSystemNotFound // Returned if the specified FileSystemId value doesn't exist in the requester's // AWS account. // -// * ErrCodeIncorrectFileSystemLifeCycleState "IncorrectFileSystemLifeCycleState" +// * IncorrectFileSystemLifeCycleState // Returned if the file system's lifecycle state is not "available". // -// * ErrCodeMountTargetConflict "MountTargetConflict" +// * MountTargetConflict // Returned if the mount target would violate one of the specified restrictions // based on the file system's existing mount targets. // -// * ErrCodeSubnetNotFound "SubnetNotFound" +// * SubnetNotFound // Returned if there is no subnet with ID SubnetId provided in the request. // -// * ErrCodeNoFreeAddressesInSubnet "NoFreeAddressesInSubnet" +// * NoFreeAddressesInSubnet // Returned if IpAddress was not specified in the request and there are no free // IP addresses in the subnet. // -// * ErrCodeIpAddressInUse "IpAddressInUse" +// * IpAddressInUse // Returned if the request specified an IpAddress that is already in use in // the subnet. // -// * ErrCodeNetworkInterfaceLimitExceeded "NetworkInterfaceLimitExceeded" +// * NetworkInterfaceLimitExceeded // The calling account has reached the limit for elastic network interfaces // for the specific AWS Region. The client should try to delete some elastic // network interfaces or get the account limit raised. For more information, @@ -340,15 +445,15 @@ func (c *EFS) CreateMountTargetRequest(input *CreateMountTargetInput) (req *requ // in the Amazon VPC User Guide (see the Network interfaces per VPC entry in // the table). // -// * ErrCodeSecurityGroupLimitExceeded "SecurityGroupLimitExceeded" +// * SecurityGroupLimitExceeded // Returned if the size of SecurityGroups specified in the request is greater // than five. // -// * ErrCodeSecurityGroupNotFound "SecurityGroupNotFound" +// * SecurityGroupNotFound // Returned if one of the specified security groups doesn't exist in the subnet's // VPC. // -// * ErrCodeUnsupportedAvailabilityZone "UnsupportedAvailabilityZone" +// * UnsupportedAvailabilityZone // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateMountTarget func (c *EFS) CreateMountTarget(input *CreateMountTargetInput) (*MountTargetDescription, error) { @@ -398,7 +503,12 @@ const opCreateTags = "CreateTags" // } // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateTags +// +// Deprecated: Use TagResource. func (c *EFS) CreateTagsRequest(input *CreateTagsInput) (req *request.Request, output *CreateTagsOutput) { + if c.Client.Config.Logger != nil { + c.Client.Config.Logger.Log("This operation, CreateTags, has been deprecated") + } op := &request.Operation{ Name: opCreateTags, HTTPMethod: "POST", @@ -432,19 +542,21 @@ func (c *EFS) CreateTagsRequest(input *CreateTagsInput) (req *request.Request, o // 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 Error Types: +// * BadRequest // Returned if the request is malformed or contains an error such as an invalid // parameter value or a missing required parameter. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // Returned if an error occurred on the server side. // -// * ErrCodeFileSystemNotFound "FileSystemNotFound" +// * FileSystemNotFound // Returned if the specified FileSystemId value doesn't exist in the requester's // AWS account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/CreateTags +// +// Deprecated: Use TagResource. func (c *EFS) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) { req, out := c.CreateTagsRequest(input) return out, req.Send() @@ -459,6 +571,8 @@ func (c *EFS) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) { // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. +// +// Deprecated: Use TagResource. func (c *EFS) CreateTagsWithContext(ctx aws.Context, input *CreateTagsInput, opts ...request.Option) (*CreateTagsOutput, error) { req, out := c.CreateTagsRequest(input) req.SetContext(ctx) @@ -466,6 +580,100 @@ func (c *EFS) CreateTagsWithContext(ctx aws.Context, input *CreateTagsInput, opt return out, req.Send() } +const opDeleteAccessPoint = "DeleteAccessPoint" + +// DeleteAccessPointRequest generates a "aws/request.Request" representing the +// client's request for the DeleteAccessPoint operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteAccessPoint for more information on using the DeleteAccessPoint +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteAccessPointRequest method. +// req, resp := client.DeleteAccessPointRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteAccessPoint +func (c *EFS) DeleteAccessPointRequest(input *DeleteAccessPointInput) (req *request.Request, output *DeleteAccessPointOutput) { + op := &request.Operation{ + Name: opDeleteAccessPoint, + HTTPMethod: "DELETE", + HTTPPath: "/2015-02-01/access-points/{AccessPointId}", + } + + if input == nil { + input = &DeleteAccessPointInput{} + } + + output = &DeleteAccessPointOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteAccessPoint API operation for Amazon Elastic File System. +// +// Deletes the specified access point. After deletion is complete, new clients +// can no longer connect to the access points. Clients connected to the access +// point at the time of deletion will continue to function until they terminate +// their connection. +// +// This operation requires permissions for the elasticfilesystem:DeleteAccessPoint +// 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 DeleteAccessPoint for usage and error information. +// +// Returned Error Types: +// * BadRequest +// Returned if the request is malformed or contains an error such as an invalid +// parameter value or a missing required parameter. +// +// * InternalServerError +// Returned if an error occurred on the server side. +// +// * AccessPointNotFound +// Returned if the specified AccessPointId value doesn't exist in the requester's +// AWS account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteAccessPoint +func (c *EFS) DeleteAccessPoint(input *DeleteAccessPointInput) (*DeleteAccessPointOutput, error) { + req, out := c.DeleteAccessPointRequest(input) + return out, req.Send() +} + +// DeleteAccessPointWithContext is the same as DeleteAccessPoint with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAccessPoint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) DeleteAccessPointWithContext(ctx aws.Context, input *DeleteAccessPointInput, opts ...request.Option) (*DeleteAccessPointOutput, error) { + req, out := c.DeleteAccessPointRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteFileSystem = "DeleteFileSystem" // DeleteFileSystemRequest generates a "aws/request.Request" representing the @@ -535,19 +743,19 @@ func (c *EFS) DeleteFileSystemRequest(input *DeleteFileSystemInput) (req *reques // 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 Error Types: +// * BadRequest // Returned if the request is malformed or contains an error such as an invalid // parameter value or a missing required parameter. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // Returned if an error occurred on the server side. // -// * ErrCodeFileSystemNotFound "FileSystemNotFound" +// * FileSystemNotFound // Returned if the specified FileSystemId value doesn't exist in the requester's // AWS account. // -// * ErrCodeFileSystemInUse "FileSystemInUse" +// * FileSystemInUse // Returned if a file system has mount targets. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteFileSystem @@ -572,6 +780,99 @@ func (c *EFS) DeleteFileSystemWithContext(ctx aws.Context, input *DeleteFileSyst return out, req.Send() } +const opDeleteFileSystemPolicy = "DeleteFileSystemPolicy" + +// DeleteFileSystemPolicyRequest generates a "aws/request.Request" representing the +// client's request for the DeleteFileSystemPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteFileSystemPolicy for more information on using the DeleteFileSystemPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteFileSystemPolicyRequest method. +// req, resp := client.DeleteFileSystemPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteFileSystemPolicy +func (c *EFS) DeleteFileSystemPolicyRequest(input *DeleteFileSystemPolicyInput) (req *request.Request, output *DeleteFileSystemPolicyOutput) { + op := &request.Operation{ + Name: opDeleteFileSystemPolicy, + HTTPMethod: "DELETE", + HTTPPath: "/2015-02-01/file-systems/{FileSystemId}/policy", + } + + if input == nil { + input = &DeleteFileSystemPolicyInput{} + } + + output = &DeleteFileSystemPolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteFileSystemPolicy API operation for Amazon Elastic File System. +// +// Deletes the FileSystemPolicy for the specified file system. The default FileSystemPolicy +// goes into effect once the existing policy is deleted. For more information +// about the default file system policy, see Using Resource-based Policies with +// EFS (https://docs.aws.amazon.com/efs/latest/ug/res-based-policies-efs.html). +// +// This operation requires permissions for the elasticfilesystem:DeleteFileSystemPolicy +// 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 DeleteFileSystemPolicy for usage and error information. +// +// Returned Error Types: +// * InternalServerError +// Returned if an error occurred on the server side. +// +// * FileSystemNotFound +// Returned if the specified FileSystemId value doesn't exist in the requester's +// AWS account. +// +// * IncorrectFileSystemLifeCycleState +// Returned if the file system's lifecycle state is not "available". +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteFileSystemPolicy +func (c *EFS) DeleteFileSystemPolicy(input *DeleteFileSystemPolicyInput) (*DeleteFileSystemPolicyOutput, error) { + req, out := c.DeleteFileSystemPolicyRequest(input) + return out, req.Send() +} + +// DeleteFileSystemPolicyWithContext is the same as DeleteFileSystemPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteFileSystemPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) DeleteFileSystemPolicyWithContext(ctx aws.Context, input *DeleteFileSystemPolicyInput, opts ...request.Option) (*DeleteFileSystemPolicyOutput, error) { + req, out := c.DeleteFileSystemPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteMountTarget = "DeleteMountTarget" // DeleteMountTargetRequest generates a "aws/request.Request" representing the @@ -650,19 +951,19 @@ func (c *EFS) DeleteMountTargetRequest(input *DeleteMountTargetInput) (req *requ // 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 Error Types: +// * BadRequest // Returned if the request is malformed or contains an error such as an invalid // parameter value or a missing required parameter. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // Returned if an error occurred on the server side. // -// * ErrCodeDependencyTimeout "DependencyTimeout" +// * DependencyTimeout // The service timed out trying to fulfill the request, and the client should // try the call again. // -// * ErrCodeMountTargetNotFound "MountTargetNotFound" +// * MountTargetNotFound // Returned if there is no mount target with the specified ID found in the caller's // account. // @@ -714,7 +1015,12 @@ const opDeleteTags = "DeleteTags" // } // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteTags +// +// Deprecated: Use UntagResource. func (c *EFS) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, output *DeleteTagsOutput) { + if c.Client.Config.Logger != nil { + c.Client.Config.Logger.Log("This operation, DeleteTags, has been deprecated") + } op := &request.Operation{ Name: opDeleteTags, HTTPMethod: "POST", @@ -749,19 +1055,21 @@ func (c *EFS) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, o // 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 Error Types: +// * BadRequest // Returned if the request is malformed or contains an error such as an invalid // parameter value or a missing required parameter. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // Returned if an error occurred on the server side. // -// * ErrCodeFileSystemNotFound "FileSystemNotFound" +// * FileSystemNotFound // Returned if the specified FileSystemId value doesn't exist in the requester's // AWS account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DeleteTags +// +// Deprecated: Use UntagResource. func (c *EFS) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { req, out := c.DeleteTagsRequest(input) return out, req.Send() @@ -776,6 +1084,8 @@ func (c *EFS) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. +// +// Deprecated: Use UntagResource. func (c *EFS) DeleteTagsWithContext(ctx aws.Context, input *DeleteTagsInput, opts ...request.Option) (*DeleteTagsOutput, error) { req, out := c.DeleteTagsRequest(input) req.SetContext(ctx) @@ -783,73 +1093,62 @@ func (c *EFS) DeleteTagsWithContext(ctx aws.Context, input *DeleteTagsInput, opt return out, req.Send() } -const opDescribeFileSystems = "DescribeFileSystems" +const opDescribeAccessPoints = "DescribeAccessPoints" -// DescribeFileSystemsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeFileSystems operation. The "output" return +// DescribeAccessPointsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeAccessPoints operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeFileSystems for more information on using the DescribeFileSystems +// See DescribeAccessPoints for more information on using the DescribeAccessPoints // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeFileSystemsRequest method. -// req, resp := client.DescribeFileSystemsRequest(params) +// // Example sending a request using the DescribeAccessPointsRequest method. +// req, resp := client.DescribeAccessPointsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeFileSystems -func (c *EFS) DescribeFileSystemsRequest(input *DescribeFileSystemsInput) (req *request.Request, output *DescribeFileSystemsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeAccessPoints +func (c *EFS) DescribeAccessPointsRequest(input *DescribeAccessPointsInput) (req *request.Request, output *DescribeAccessPointsOutput) { op := &request.Operation{ - Name: opDescribeFileSystems, + Name: opDescribeAccessPoints, HTTPMethod: "GET", - HTTPPath: "/2015-02-01/file-systems", + HTTPPath: "/2015-02-01/access-points", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &DescribeFileSystemsInput{} + input = &DescribeAccessPointsInput{} } - output = &DescribeFileSystemsOutput{} + output = &DescribeAccessPointsOutput{} 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. -// Currently, this number is automatically set to 10. 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. +// DescribeAccessPoints API operation for Amazon Elastic File System. // -// 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 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. +// Returns the description of a specific Amazon EFS access point if the AccessPointId +// is provided. If you provide an EFS FileSystemId, it returns descriptions +// of all access points for that file system. You can provide either an AccessPointId +// or a FileSystemId in the request, but not both. // -// This operation requires permissions for the elasticfilesystem:DescribeFileSystems +// This operation requires permissions for the elasticfilesystem:DescribeAccessPoints // action. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -857,57 +1156,371 @@ func (c *EFS) DescribeFileSystemsRequest(input *DescribeFileSystemsInput) (req * // the error. // // See the AWS API reference guide for Amazon Elastic File System's -// API operation DescribeFileSystems for usage and error information. +// API operation DescribeAccessPoints for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" +// Returned Error Types: +// * BadRequest // Returned if the request is malformed or contains an error such as an invalid // parameter value or a missing required parameter. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // Returned if an error occurred on the server side. // -// * ErrCodeFileSystemNotFound "FileSystemNotFound" +// * FileSystemNotFound // Returned if the specified FileSystemId value doesn't exist in the requester's // AWS account. // -// See also, 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) +// * AccessPointNotFound +// Returned if the specified AccessPointId value doesn't exist in the requester's +// AWS account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeAccessPoints +func (c *EFS) DescribeAccessPoints(input *DescribeAccessPointsInput) (*DescribeAccessPointsOutput, error) { + req, out := c.DescribeAccessPointsRequest(input) return out, req.Send() } -// DescribeFileSystemsWithContext is the same as DescribeFileSystems with the addition of +// DescribeAccessPointsWithContext is the same as DescribeAccessPoints with the addition of // the ability to pass a context and additional request options. // -// See DescribeFileSystems for details on how to use this API operation. +// See DescribeAccessPoints for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EFS) DescribeFileSystemsWithContext(ctx aws.Context, input *DescribeFileSystemsInput, opts ...request.Option) (*DescribeFileSystemsOutput, error) { - req, out := c.DescribeFileSystemsRequest(input) +func (c *EFS) DescribeAccessPointsWithContext(ctx aws.Context, input *DescribeAccessPointsInput, opts ...request.Option) (*DescribeAccessPointsOutput, error) { + req, out := c.DescribeAccessPointsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeLifecycleConfiguration = "DescribeLifecycleConfiguration" - -// DescribeLifecycleConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLifecycleConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. +// DescribeAccessPointsPages iterates over the pages of a DescribeAccessPoints operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. // -// 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 DescribeAccessPoints method for more information on how to use this operation. // -// See DescribeLifecycleConfiguration for more information on using the DescribeLifecycleConfiguration -// API call, and error handling. +// Note: This operation can generate multiple requests to a service. // -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// // Example iterating over at most 3 pages of a DescribeAccessPoints operation. +// pageNum := 0 +// err := client.DescribeAccessPointsPages(params, +// func(page *efs.DescribeAccessPointsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EFS) DescribeAccessPointsPages(input *DescribeAccessPointsInput, fn func(*DescribeAccessPointsOutput, bool) bool) error { + return c.DescribeAccessPointsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeAccessPointsPagesWithContext same as DescribeAccessPointsPages 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 *EFS) DescribeAccessPointsPagesWithContext(ctx aws.Context, input *DescribeAccessPointsInput, fn func(*DescribeAccessPointsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeAccessPointsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeAccessPointsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeAccessPointsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeFileSystemPolicy = "DescribeFileSystemPolicy" + +// DescribeFileSystemPolicyRequest generates a "aws/request.Request" representing the +// client's request for the DescribeFileSystemPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeFileSystemPolicy for more information on using the DescribeFileSystemPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeFileSystemPolicyRequest method. +// req, resp := client.DescribeFileSystemPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeFileSystemPolicy +func (c *EFS) DescribeFileSystemPolicyRequest(input *DescribeFileSystemPolicyInput) (req *request.Request, output *DescribeFileSystemPolicyOutput) { + op := &request.Operation{ + Name: opDescribeFileSystemPolicy, + HTTPMethod: "GET", + HTTPPath: "/2015-02-01/file-systems/{FileSystemId}/policy", + } + + if input == nil { + input = &DescribeFileSystemPolicyInput{} + } + + output = &DescribeFileSystemPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeFileSystemPolicy API operation for Amazon Elastic File System. +// +// Returns the FileSystemPolicy for the specified EFS file system. +// +// This operation requires permissions for the elasticfilesystem:DescribeFileSystemPolicy +// 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 DescribeFileSystemPolicy for usage and error information. +// +// Returned Error Types: +// * InternalServerError +// Returned if an error occurred on the server side. +// +// * FileSystemNotFound +// Returned if the specified FileSystemId value doesn't exist in the requester's +// AWS account. +// +// * PolicyNotFound +// Returned if the default file system policy is in effect for the EFS file +// system specified. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeFileSystemPolicy +func (c *EFS) DescribeFileSystemPolicy(input *DescribeFileSystemPolicyInput) (*DescribeFileSystemPolicyOutput, error) { + req, out := c.DescribeFileSystemPolicyRequest(input) + return out, req.Send() +} + +// DescribeFileSystemPolicyWithContext is the same as DescribeFileSystemPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeFileSystemPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) DescribeFileSystemPolicyWithContext(ctx aws.Context, input *DescribeFileSystemPolicyInput, opts ...request.Option) (*DescribeFileSystemPolicyOutput, error) { + req, out := c.DescribeFileSystemPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeFileSystems = "DescribeFileSystems" + +// DescribeFileSystemsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeFileSystems operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeFileSystems for more information on using the DescribeFileSystems +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeFileSystemsRequest method. +// req, resp := client.DescribeFileSystemsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"NextMarker"}, + LimitToken: "MaxItems", + TruncationToken: "", + }, + } + + 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. +// Currently, this number is automatically set to 10. 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 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 Types: +// * BadRequest +// Returned if the request is malformed or contains an error such as an invalid +// parameter value or a missing required parameter. +// +// * InternalServerError +// Returned if an error occurred on the server side. +// +// * FileSystemNotFound +// Returned if the specified FileSystemId value doesn't exist in the requester's +// AWS account. +// +// See also, 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) + return out, req.Send() +} + +// DescribeFileSystemsWithContext is the same as DescribeFileSystems with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeFileSystems for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) DescribeFileSystemsWithContext(ctx aws.Context, input *DescribeFileSystemsInput, opts ...request.Option) (*DescribeFileSystemsOutput, error) { + req, out := c.DescribeFileSystemsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeFileSystemsPages iterates over the pages of a DescribeFileSystems operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeFileSystems 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 DescribeFileSystems operation. +// pageNum := 0 +// err := client.DescribeFileSystemsPages(params, +// func(page *efs.DescribeFileSystemsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EFS) DescribeFileSystemsPages(input *DescribeFileSystemsInput, fn func(*DescribeFileSystemsOutput, bool) bool) error { + return c.DescribeFileSystemsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeFileSystemsPagesWithContext same as DescribeFileSystemsPages 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 *EFS) DescribeFileSystemsPagesWithContext(ctx aws.Context, input *DescribeFileSystemsInput, fn func(*DescribeFileSystemsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeFileSystemsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeFileSystemsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeFileSystemsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeLifecycleConfiguration = "DescribeLifecycleConfiguration" + +// DescribeLifecycleConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLifecycleConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeLifecycleConfiguration for more information on using the DescribeLifecycleConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // // Example sending a request using the DescribeLifecycleConfigurationRequest method. @@ -953,15 +1566,15 @@ func (c *EFS) DescribeLifecycleConfigurationRequest(input *DescribeLifecycleConf // See the AWS API reference guide for Amazon Elastic File System's // API operation DescribeLifecycleConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // Returned if an error occurred on the server side. // -// * ErrCodeBadRequest "BadRequest" +// * BadRequest // Returned if the request is malformed or contains an error such as an invalid // parameter value or a missing required parameter. // -// * ErrCodeFileSystemNotFound "FileSystemNotFound" +// * FileSystemNotFound // Returned if the specified FileSystemId value doesn't exist in the requester's // AWS account. // @@ -1050,19 +1663,19 @@ func (c *EFS) DescribeMountTargetSecurityGroupsRequest(input *DescribeMountTarge // 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 Error Types: +// * BadRequest // Returned if the request is malformed or contains an error such as an invalid // parameter value or a missing required parameter. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // Returned if an error occurred on the server side. // -// * ErrCodeMountTargetNotFound "MountTargetNotFound" +// * MountTargetNotFound // Returned if there is no mount target with the specified ID found in the caller's // account. // -// * ErrCodeIncorrectMountTargetState "IncorrectMountTargetState" +// * IncorrectMountTargetState // Returned if the mount target is not in the correct state for the operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeMountTargetSecurityGroups @@ -1146,22 +1759,26 @@ func (c *EFS) DescribeMountTargetsRequest(input *DescribeMountTargetsInput) (req // 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 Error Types: +// * BadRequest // Returned if the request is malformed or contains an error such as an invalid // parameter value or a missing required parameter. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // Returned if an error occurred on the server side. // -// * ErrCodeFileSystemNotFound "FileSystemNotFound" +// * FileSystemNotFound // Returned if the specified FileSystemId value doesn't exist in the requester's // AWS account. // -// * ErrCodeMountTargetNotFound "MountTargetNotFound" +// * MountTargetNotFound // Returned if there is no mount target with the specified ID found in the caller's // account. // +// * AccessPointNotFound +// Returned if the specified AccessPointId value doesn't exist in the requester's +// AWS account. +// // See also, 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) @@ -1210,11 +1827,22 @@ const opDescribeTags = "DescribeTags" // } // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeTags +// +// Deprecated: Use ListTagsForResource. func (c *EFS) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Request, output *DescribeTagsOutput) { + if c.Client.Config.Logger != nil { + c.Client.Config.Logger.Log("This operation, DescribeTags, has been deprecated") + } op := &request.Operation{ Name: opDescribeTags, HTTPMethod: "GET", HTTPPath: "/2015-02-01/tags/{FileSystemId}/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"NextMarker"}, + LimitToken: "MaxItems", + TruncationToken: "", + }, } if input == nil { @@ -1242,19 +1870,21 @@ func (c *EFS) DescribeTagsRequest(input *DescribeTagsInput) (req *request.Reques // 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 Error Types: +// * BadRequest // Returned if the request is malformed or contains an error such as an invalid // parameter value or a missing required parameter. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // Returned if an error occurred on the server side. // -// * ErrCodeFileSystemNotFound "FileSystemNotFound" +// * FileSystemNotFound // Returned if the specified FileSystemId value doesn't exist in the requester's // AWS account. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/DescribeTags +// +// Deprecated: Use ListTagsForResource. func (c *EFS) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error) { req, out := c.DescribeTagsRequest(input) return out, req.Send() @@ -1269,6 +1899,8 @@ func (c *EFS) DescribeTags(input *DescribeTagsInput) (*DescribeTagsOutput, error // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. +// +// Deprecated: Use ListTagsForResource. func (c *EFS) DescribeTagsWithContext(ctx aws.Context, input *DescribeTagsInput, opts ...request.Option) (*DescribeTagsOutput, error) { req, out := c.DescribeTagsRequest(input) req.SetContext(ctx) @@ -1276,37 +1908,246 @@ func (c *EFS) DescribeTagsWithContext(ctx aws.Context, input *DescribeTagsInput, return out, req.Send() } -const opModifyMountTargetSecurityGroups = "ModifyMountTargetSecurityGroups" +// 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 *efs.DescribeTagsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +// +// Deprecated: Use ListTagsForResource. +func (c *EFS) DescribeTagsPages(input *DescribeTagsInput, fn func(*DescribeTagsOutput, bool) bool) error { + return c.DescribeTagsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// ModifyMountTargetSecurityGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ModifyMountTargetSecurityGroups operation. The "output" return +// DescribeTagsPagesWithContext same as DescribeTagsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +// +// Deprecated: Use ListTagsForResource. +func (c *EFS) DescribeTagsPagesWithContext(ctx aws.Context, input *DescribeTagsInput, fn func(*DescribeTagsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeTagsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeTagsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeTagsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyMountTargetSecurityGroups for more information on using the ModifyMountTargetSecurityGroups +// See ListTagsForResource for more information on using the ListTagsForResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyMountTargetSecurityGroupsRequest method. -// req, resp := client.ModifyMountTargetSecurityGroupsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/ModifyMountTargetSecurityGroups -func (c *EFS) ModifyMountTargetSecurityGroupsRequest(input *ModifyMountTargetSecurityGroupsInput) (req *request.Request, output *ModifyMountTargetSecurityGroupsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/ListTagsForResource +func (c *EFS) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { op := &request.Operation{ - Name: opModifyMountTargetSecurityGroups, - HTTPMethod: "PUT", - HTTPPath: "/2015-02-01/mount-targets/{MountTargetId}/security-groups", + Name: opListTagsForResource, + HTTPMethod: "GET", + HTTPPath: "/2015-02-01/resource-tags/{ResourceId}", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListTagsForResourceInput{} + } + + output = &ListTagsForResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTagsForResource API operation for Amazon Elastic File System. +// +// Lists all tags for a top-level EFS resource. You must provide the ID of the +// resource that you want to retrieve the tags for. +// +// This operation requires permissions for the elasticfilesystem:DescribeAccessPoints +// 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 ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * BadRequest +// Returned if the request is malformed or contains an error such as an invalid +// parameter value or a missing required parameter. +// +// * InternalServerError +// Returned if an error occurred on the server side. +// +// * FileSystemNotFound +// Returned if the specified FileSystemId value doesn't exist in the requester's +// AWS account. +// +// * AccessPointNotFound +// Returned if the specified AccessPointId value doesn't exist in the requester's +// AWS account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/ListTagsForResource +func (c *EFS) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListTagsForResourcePages iterates over the pages of a ListTagsForResource operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTagsForResource 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 ListTagsForResource operation. +// pageNum := 0 +// err := client.ListTagsForResourcePages(params, +// func(page *efs.ListTagsForResourceOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EFS) ListTagsForResourcePages(input *ListTagsForResourceInput, fn func(*ListTagsForResourceOutput, bool) bool) error { + return c.ListTagsForResourcePagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListTagsForResourcePagesWithContext same as ListTagsForResourcePages 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 *EFS) ListTagsForResourcePagesWithContext(ctx aws.Context, input *ListTagsForResourceInput, fn func(*ListTagsForResourceOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTagsForResourceInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTagsForResourceRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opModifyMountTargetSecurityGroups = "ModifyMountTargetSecurityGroups" + +// ModifyMountTargetSecurityGroupsRequest generates a "aws/request.Request" representing the +// client's request for the ModifyMountTargetSecurityGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ModifyMountTargetSecurityGroups for more information on using the ModifyMountTargetSecurityGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ModifyMountTargetSecurityGroupsRequest method. +// req, resp := client.ModifyMountTargetSecurityGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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 { @@ -1345,26 +2186,26 @@ func (c *EFS) ModifyMountTargetSecurityGroupsRequest(input *ModifyMountTargetSec // 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 Error Types: +// * BadRequest // Returned if the request is malformed or contains an error such as an invalid // parameter value or a missing required parameter. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // Returned if an error occurred on the server side. // -// * ErrCodeMountTargetNotFound "MountTargetNotFound" +// * MountTargetNotFound // Returned if there is no mount target with the specified ID found in the caller's // account. // -// * ErrCodeIncorrectMountTargetState "IncorrectMountTargetState" +// * IncorrectMountTargetState // Returned if the mount target is not in the correct state for the operation. // -// * ErrCodeSecurityGroupLimitExceeded "SecurityGroupLimitExceeded" +// * SecurityGroupLimitExceeded // Returned if the size of SecurityGroups specified in the request is greater // than five. // -// * ErrCodeSecurityGroupNotFound "SecurityGroupNotFound" +// * SecurityGroupNotFound // Returned if one of the specified security groups doesn't exist in the subnet's // VPC. // @@ -1390,6 +2231,106 @@ func (c *EFS) ModifyMountTargetSecurityGroupsWithContext(ctx aws.Context, input return out, req.Send() } +const opPutFileSystemPolicy = "PutFileSystemPolicy" + +// PutFileSystemPolicyRequest generates a "aws/request.Request" representing the +// client's request for the PutFileSystemPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutFileSystemPolicy for more information on using the PutFileSystemPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutFileSystemPolicyRequest method. +// req, resp := client.PutFileSystemPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/PutFileSystemPolicy +func (c *EFS) PutFileSystemPolicyRequest(input *PutFileSystemPolicyInput) (req *request.Request, output *PutFileSystemPolicyOutput) { + op := &request.Operation{ + Name: opPutFileSystemPolicy, + HTTPMethod: "PUT", + HTTPPath: "/2015-02-01/file-systems/{FileSystemId}/policy", + } + + if input == nil { + input = &PutFileSystemPolicyInput{} + } + + output = &PutFileSystemPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutFileSystemPolicy API operation for Amazon Elastic File System. +// +// Applies an Amazon EFS FileSystemPolicy to an Amazon EFS file system. A file +// system policy is an IAM resource-based policy and can contain multiple policy +// statements. A file system always has exactly one file system policy, which +// can be the default policy or an explicit policy set or updated using this +// API operation. When an explicit policy is set, it overrides the default policy. +// For more information about the default file system policy, see Using Resource-based +// Policies with EFS (https://docs.aws.amazon.com/efs/latest/ug/res-based-policies-efs.html). +// +// This operation requires permissions for the elasticfilesystem:PutFileSystemPolicy +// 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 PutFileSystemPolicy for usage and error information. +// +// Returned Error Types: +// * InternalServerError +// Returned if an error occurred on the server side. +// +// * FileSystemNotFound +// Returned if the specified FileSystemId value doesn't exist in the requester's +// AWS account. +// +// * InvalidPolicyException +// Returned if the FileSystemPolicy is is malformed or contains an error such +// as an invalid parameter value or a missing required parameter. Returned in +// the case of a policy lockout safety check error. +// +// * IncorrectFileSystemLifeCycleState +// Returned if the file system's lifecycle state is not "available". +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/PutFileSystemPolicy +func (c *EFS) PutFileSystemPolicy(input *PutFileSystemPolicyInput) (*PutFileSystemPolicyOutput, error) { + req, out := c.PutFileSystemPolicyRequest(input) + return out, req.Send() +} + +// PutFileSystemPolicyWithContext is the same as PutFileSystemPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutFileSystemPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) PutFileSystemPolicyWithContext(ctx aws.Context, input *PutFileSystemPolicyInput, opts ...request.Option) (*PutFileSystemPolicyOutput, error) { + req, out := c.PutFileSystemPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opPutLifecycleConfiguration = "PutLifecycleConfiguration" // PutLifecycleConfigurationRequest generates a "aws/request.Request" representing the @@ -1470,19 +2411,19 @@ func (c *EFS) PutLifecycleConfigurationRequest(input *PutLifecycleConfigurationI // See the AWS API reference guide for Amazon Elastic File System's // API operation PutLifecycleConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" +// Returned Error Types: +// * BadRequest // Returned if the request is malformed or contains an error such as an invalid // parameter value or a missing required parameter. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // Returned if an error occurred on the server side. // -// * ErrCodeFileSystemNotFound "FileSystemNotFound" +// * FileSystemNotFound // Returned if the specified FileSystemId value doesn't exist in the requester's // AWS account. // -// * ErrCodeIncorrectFileSystemLifeCycleState "IncorrectFileSystemLifeCycleState" +// * IncorrectFileSystemLifeCycleState // Returned if the file system's lifecycle state is not "available". // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/PutLifecycleConfiguration @@ -1507,439 +2448,3167 @@ func (c *EFS) PutLifecycleConfigurationWithContext(ctx aws.Context, input *PutLi return out, req.Send() } -const opUpdateFileSystem = "UpdateFileSystem" +const opTagResource = "TagResource" -// UpdateFileSystemRequest generates a "aws/request.Request" representing the -// client's request for the UpdateFileSystem operation. The "output" return +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateFileSystem for more information on using the UpdateFileSystem +// See TagResource for more information on using the TagResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateFileSystemRequest method. -// req, resp := client.UpdateFileSystemRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/UpdateFileSystem -func (c *EFS) UpdateFileSystemRequest(input *UpdateFileSystemInput) (req *request.Request, output *UpdateFileSystemOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/TagResource +func (c *EFS) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { op := &request.Operation{ - Name: opUpdateFileSystem, - HTTPMethod: "PUT", - HTTPPath: "/2015-02-01/file-systems/{FileSystemId}", + Name: opTagResource, + HTTPMethod: "POST", + HTTPPath: "/2015-02-01/resource-tags/{ResourceId}", } if input == nil { - input = &UpdateFileSystemInput{} + input = &TagResourceInput{} } - output = &UpdateFileSystemOutput{} + output = &TagResourceOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateFileSystem API operation for Amazon Elastic File System. +// TagResource API operation for Amazon Elastic File System. // -// Updates the throughput mode or the amount of provisioned throughput of an -// existing file system. +// Creates a tag for an EFS resource. You can create tags for EFS file systems +// and access points using this API operation. +// +// This operation requires permissions for the elasticfilesystem:TagResource +// 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 UpdateFileSystem for usage and error information. +// API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" +// Returned Error Types: +// * BadRequest // Returned if the request is malformed or contains an error such as an invalid // parameter value or a missing required parameter. // -// * ErrCodeFileSystemNotFound "FileSystemNotFound" -// Returned if the specified FileSystemId value doesn't exist in the requester's -// AWS account. -// -// * ErrCodeIncorrectFileSystemLifeCycleState "IncorrectFileSystemLifeCycleState" -// Returned if the file system's lifecycle state is not "available". -// -// * ErrCodeInsufficientThroughputCapacity "InsufficientThroughputCapacity" -// Returned if there's not enough capacity to provision additional throughput. -// This value might be returned when you try to create a file system in provisioned -// throughput mode, when you attempt to increase the provisioned throughput -// of an existing file system, or when you attempt to change an existing file -// system from bursting to provisioned throughput mode. -// -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // Returned if an error occurred on the server side. // -// * ErrCodeThroughputLimitExceeded "ThroughputLimitExceeded" -// Returned if the throughput mode or amount of provisioned throughput can't -// be changed because the throughput limit of 1024 MiB/s has been reached. +// * FileSystemNotFound +// Returned if the specified FileSystemId value doesn't exist in the requester's +// AWS account. // -// * ErrCodeTooManyRequests "TooManyRequests" -// Returned if you don’t wait at least 24 hours before changing the throughput -// mode, or decreasing the Provisioned Throughput value. +// * AccessPointNotFound +// Returned if the specified AccessPointId value doesn't exist in the requester's +// AWS account. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/UpdateFileSystem -func (c *EFS) UpdateFileSystem(input *UpdateFileSystemInput) (*UpdateFileSystemOutput, error) { - req, out := c.UpdateFileSystemRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/TagResource +func (c *EFS) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) return out, req.Send() } -// UpdateFileSystemWithContext is the same as UpdateFileSystem with the addition of +// TagResourceWithContext is the same as TagResource with the addition of // the ability to pass a context and additional request options. // -// See UpdateFileSystem for details on how to use this API operation. +// See TagResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EFS) UpdateFileSystemWithContext(ctx aws.Context, input *UpdateFileSystemInput, opts ...request.Option) (*UpdateFileSystemOutput, error) { - req, out := c.UpdateFileSystemRequest(input) +func (c *EFS) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -type CreateFileSystemInput struct { - _ struct{} `type:"structure"` +const opUntagResource = "UntagResource" - // A 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"` +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/UntagResource +func (c *EFS) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { + op := &request.Operation{ + Name: opUntagResource, + HTTPMethod: "DELETE", + HTTPPath: "/2015-02-01/resource-tags/{ResourceId}", + } - // A Boolean value that, if true, creates an encrypted file system. When creating - // an encrypted file system, you have the option of specifying CreateFileSystemRequest$KmsKeyId - // for an existing AWS Key Management Service (AWS KMS) customer master key - // (CMK). If you don't specify a CMK, then the default CMK for Amazon EFS, /aws/elasticfilesystem, - // is used to protect the encrypted file system. - Encrypted *bool `type:"boolean"` + if input == nil { + input = &UntagResourceInput{} + } - // The ID of the AWS KMS CMK to be used to protect the encrypted file system. - // This parameter is only required if you want to use a nondefault CMK. If this - // parameter is not specified, the default CMK for Amazon EFS is used. This - // ID can be in one of the following formats: - // - // * Key ID - A unique identifier of the key, for example 1234abcd-12ab-34cd-56ef-1234567890ab. - // - // * ARN - An Amazon Resource Name (ARN) for the key, for example arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab. - // - // * Key alias - A previously created display name for a key, for example - // alias/projectKey1. - // - // * Key alias ARN - An ARN for a key alias, for example arn:aws:kms:us-west-2:444455556666:alias/projectKey1. - // - // If KmsKeyId is specified, the CreateFileSystemRequest$Encrypted parameter - // must be set to true. - KmsKeyId *string `min:"1" type:"string"` + output = &UntagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for Amazon Elastic File System. +// +// Removes tags from an EFS resource. You can remove tags from EFS file systems +// and access points using this API operation. +// +// This operation requires permissions for the elasticfilesystem:UntagResource +// 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 UntagResource for usage and error information. +// +// Returned Error Types: +// * BadRequest +// Returned if the request is malformed or contains an error such as an invalid +// parameter value or a missing required parameter. +// +// * InternalServerError +// Returned if an error occurred on the server side. +// +// * FileSystemNotFound +// Returned if the specified FileSystemId value doesn't exist in the requester's +// AWS account. +// +// * AccessPointNotFound +// Returned if the specified AccessPointId value doesn't exist in the requester's +// AWS account. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/UntagResource +func (c *EFS) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateFileSystem = "UpdateFileSystem" + +// UpdateFileSystemRequest generates a "aws/request.Request" representing the +// client's request for the UpdateFileSystem operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateFileSystem for more information on using the UpdateFileSystem +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateFileSystemRequest method. +// req, resp := client.UpdateFileSystemRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/UpdateFileSystem +func (c *EFS) UpdateFileSystemRequest(input *UpdateFileSystemInput) (req *request.Request, output *UpdateFileSystemOutput) { + op := &request.Operation{ + Name: opUpdateFileSystem, + HTTPMethod: "PUT", + HTTPPath: "/2015-02-01/file-systems/{FileSystemId}", + } + + if input == nil { + input = &UpdateFileSystemInput{} + } + + output = &UpdateFileSystemOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateFileSystem API operation for Amazon Elastic File System. +// +// Updates the throughput mode or the amount of provisioned throughput of an +// existing file 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 Elastic File System's +// API operation UpdateFileSystem for usage and error information. +// +// Returned Error Types: +// * BadRequest +// Returned if the request is malformed or contains an error such as an invalid +// parameter value or a missing required parameter. +// +// * FileSystemNotFound +// Returned if the specified FileSystemId value doesn't exist in the requester's +// AWS account. +// +// * IncorrectFileSystemLifeCycleState +// Returned if the file system's lifecycle state is not "available". +// +// * InsufficientThroughputCapacity +// Returned if there's not enough capacity to provision additional throughput. +// This value might be returned when you try to create a file system in provisioned +// throughput mode, when you attempt to increase the provisioned throughput +// of an existing file system, or when you attempt to change an existing file +// system from bursting to provisioned throughput mode. +// +// * InternalServerError +// Returned if an error occurred on the server side. +// +// * ThroughputLimitExceeded +// Returned if the throughput mode or amount of provisioned throughput can't +// be changed because the throughput limit of 1024 MiB/s has been reached. +// +// * TooManyRequests +// Returned if you don’t wait at least 24 hours before changing the throughput +// mode, or decreasing the Provisioned Throughput value. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticfilesystem-2015-02-01/UpdateFileSystem +func (c *EFS) UpdateFileSystem(input *UpdateFileSystemInput) (*UpdateFileSystemOutput, error) { + req, out := c.UpdateFileSystemRequest(input) + return out, req.Send() +} + +// UpdateFileSystemWithContext is the same as UpdateFileSystem with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateFileSystem for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EFS) UpdateFileSystemWithContext(ctx aws.Context, input *UpdateFileSystemInput, opts ...request.Option) (*UpdateFileSystemOutput, error) { + req, out := c.UpdateFileSystemRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Returned if the access point you are trying to create already exists, with +// the creation token you provided in the request. +type AccessPointAlreadyExists struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // AccessPointId is a required field + AccessPointId *string `type:"string" required:"true"` + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccessPointAlreadyExists) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessPointAlreadyExists) GoString() string { + return s.String() +} + +func newErrorAccessPointAlreadyExists(v protocol.ResponseMetadata) error { + return &AccessPointAlreadyExists{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessPointAlreadyExists) Code() string { + return "AccessPointAlreadyExists" +} + +// Message returns the exception's message. +func (s AccessPointAlreadyExists) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessPointAlreadyExists) OrigErr() error { + return nil +} + +func (s AccessPointAlreadyExists) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessPointAlreadyExists) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessPointAlreadyExists) RequestID() string { + return s.respMetadata.RequestID +} + +// Provides a description of an EFS file system access point. +type AccessPointDescription struct { + _ struct{} `type:"structure"` + + // The unique Amazon Resource Name (ARN) associated with the access point. + AccessPointArn *string `type:"string"` + + // The ID of the access point, assigned by Amazon EFS. + AccessPointId *string `type:"string"` + + // The opaque string specified in the request to ensure idempotent creation. + ClientToken *string `min:"1" type:"string"` + + // The ID of the EFS file system that the access point applies to. + FileSystemId *string `type:"string"` + + // Identifies the lifecycle phase of the access point. + LifeCycleState *string `type:"string" enum:"LifeCycleState"` + + // The name of the access point. This is the value of the Name tag. + Name *string `type:"string"` + + // Identified the AWS account that owns the access point resource. + OwnerId *string `type:"string"` + + // The full POSIX identity, including the user ID, group ID, and secondary group + // IDs on the access point that is used for all file operations by NFS clients + // using the access point. + PosixUser *PosixUser `type:"structure"` + + // The directory on the Amazon EFS file system that the access point exposes + // as the root directory to NFS clients using the access point. + RootDirectory *RootDirectory `type:"structure"` + + // The tags associated with the access point, presented as an array of Tag objects. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s AccessPointDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessPointDescription) GoString() string { + return s.String() +} + +// SetAccessPointArn sets the AccessPointArn field's value. +func (s *AccessPointDescription) SetAccessPointArn(v string) *AccessPointDescription { + s.AccessPointArn = &v + return s +} + +// SetAccessPointId sets the AccessPointId field's value. +func (s *AccessPointDescription) SetAccessPointId(v string) *AccessPointDescription { + s.AccessPointId = &v + return s +} + +// SetClientToken sets the ClientToken field's value. +func (s *AccessPointDescription) SetClientToken(v string) *AccessPointDescription { + s.ClientToken = &v + return s +} + +// SetFileSystemId sets the FileSystemId field's value. +func (s *AccessPointDescription) SetFileSystemId(v string) *AccessPointDescription { + s.FileSystemId = &v + return s +} + +// SetLifeCycleState sets the LifeCycleState field's value. +func (s *AccessPointDescription) SetLifeCycleState(v string) *AccessPointDescription { + s.LifeCycleState = &v + return s +} + +// SetName sets the Name field's value. +func (s *AccessPointDescription) SetName(v string) *AccessPointDescription { + s.Name = &v + return s +} + +// SetOwnerId sets the OwnerId field's value. +func (s *AccessPointDescription) SetOwnerId(v string) *AccessPointDescription { + s.OwnerId = &v + return s +} + +// SetPosixUser sets the PosixUser field's value. +func (s *AccessPointDescription) SetPosixUser(v *PosixUser) *AccessPointDescription { + s.PosixUser = v + return s +} + +// SetRootDirectory sets the RootDirectory field's value. +func (s *AccessPointDescription) SetRootDirectory(v *RootDirectory) *AccessPointDescription { + s.RootDirectory = v + return s +} + +// SetTags sets the Tags field's value. +func (s *AccessPointDescription) SetTags(v []*Tag) *AccessPointDescription { + s.Tags = v + return s +} + +// Returned if the AWS account has already created the maximum number of access +// points allowed per file system. +type AccessPointLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccessPointLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessPointLimitExceeded) GoString() string { + return s.String() +} + +func newErrorAccessPointLimitExceeded(v protocol.ResponseMetadata) error { + return &AccessPointLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessPointLimitExceeded) Code() string { + return "AccessPointLimitExceeded" +} + +// Message returns the exception's message. +func (s AccessPointLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessPointLimitExceeded) OrigErr() error { + return nil +} + +func (s AccessPointLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessPointLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessPointLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + +// Returned if the specified AccessPointId value doesn't exist in the requester's +// AWS account. +type AccessPointNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccessPointNotFound) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessPointNotFound) GoString() string { + return s.String() +} + +func newErrorAccessPointNotFound(v protocol.ResponseMetadata) error { + return &AccessPointNotFound{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessPointNotFound) Code() string { + return "AccessPointNotFound" +} + +// Message returns the exception's message. +func (s AccessPointNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessPointNotFound) OrigErr() error { + return nil +} + +func (s AccessPointNotFound) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessPointNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessPointNotFound) RequestID() string { + return s.respMetadata.RequestID +} + +// Returned if the request is malformed or contains an error such as an invalid +// parameter value or a missing required parameter. +type BadRequest struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s BadRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequest) GoString() string { + return s.String() +} + +func newErrorBadRequest(v protocol.ResponseMetadata) error { + return &BadRequest{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequest) Code() string { + return "BadRequest" +} + +// Message returns the exception's message. +func (s BadRequest) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequest) OrigErr() error { + return nil +} + +func (s BadRequest) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequest) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequest) RequestID() string { + return s.respMetadata.RequestID +} + +type CreateAccessPointInput struct { + _ struct{} `type:"structure"` + + // A string of up to 64 ASCII characters that Amazon EFS uses to ensure idempotent + // creation. + ClientToken *string `min:"1" type:"string" idempotencyToken:"true"` + + // The ID of the EFS file system that the access point provides access to. + // + // FileSystemId is a required field + FileSystemId *string `type:"string" required:"true"` + + // The operating system user and group applied to all file system requests made + // using the access point. + PosixUser *PosixUser `type:"structure"` + + // Specifies the directory on the Amazon EFS file system that the access point + // exposes as the root directory of your file system to NFS clients using the + // access point. The clients using the access point can only access the root + // directory and below. If the RootDirectory > Path specified does not exist, + // EFS creates it and applies the CreationInfo settings when a client connects + // to an access point. When specifying a RootDirectory, you need to provide + // the Path, and the CreationInfo is optional. + RootDirectory *RootDirectory `type:"structure"` + + // Creates tags associated with the access point. Each tag is a key-value pair. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s CreateAccessPointInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAccessPointInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateAccessPointInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateAccessPointInput"} + if s.ClientToken != nil && len(*s.ClientToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) + } + if s.FileSystemId == nil { + invalidParams.Add(request.NewErrParamRequired("FileSystemId")) + } + if s.PosixUser != nil { + if err := s.PosixUser.Validate(); err != nil { + invalidParams.AddNested("PosixUser", err.(request.ErrInvalidParams)) + } + } + if s.RootDirectory != nil { + if err := s.RootDirectory.Validate(); err != nil { + invalidParams.AddNested("RootDirectory", 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 +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateAccessPointInput) SetClientToken(v string) *CreateAccessPointInput { + s.ClientToken = &v + return s +} + +// SetFileSystemId sets the FileSystemId field's value. +func (s *CreateAccessPointInput) SetFileSystemId(v string) *CreateAccessPointInput { + s.FileSystemId = &v + return s +} + +// SetPosixUser sets the PosixUser field's value. +func (s *CreateAccessPointInput) SetPosixUser(v *PosixUser) *CreateAccessPointInput { + s.PosixUser = v + return s +} + +// SetRootDirectory sets the RootDirectory field's value. +func (s *CreateAccessPointInput) SetRootDirectory(v *RootDirectory) *CreateAccessPointInput { + s.RootDirectory = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateAccessPointInput) SetTags(v []*Tag) *CreateAccessPointInput { + s.Tags = v + return s +} + +// Provides a description of an EFS file system access point. +type CreateAccessPointOutput struct { + _ struct{} `type:"structure"` + + // The unique Amazon Resource Name (ARN) associated with the access point. + AccessPointArn *string `type:"string"` + + // The ID of the access point, assigned by Amazon EFS. + AccessPointId *string `type:"string"` + + // The opaque string specified in the request to ensure idempotent creation. + ClientToken *string `min:"1" type:"string"` + + // The ID of the EFS file system that the access point applies to. + FileSystemId *string `type:"string"` + + // Identifies the lifecycle phase of the access point. + LifeCycleState *string `type:"string" enum:"LifeCycleState"` + + // The name of the access point. This is the value of the Name tag. + Name *string `type:"string"` + + // Identified the AWS account that owns the access point resource. + OwnerId *string `type:"string"` + + // The full POSIX identity, including the user ID, group ID, and secondary group + // IDs on the access point that is used for all file operations by NFS clients + // using the access point. + PosixUser *PosixUser `type:"structure"` + + // The directory on the Amazon EFS file system that the access point exposes + // as the root directory to NFS clients using the access point. + RootDirectory *RootDirectory `type:"structure"` + + // The tags associated with the access point, presented as an array of Tag objects. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s CreateAccessPointOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAccessPointOutput) GoString() string { + return s.String() +} + +// SetAccessPointArn sets the AccessPointArn field's value. +func (s *CreateAccessPointOutput) SetAccessPointArn(v string) *CreateAccessPointOutput { + s.AccessPointArn = &v + return s +} + +// SetAccessPointId sets the AccessPointId field's value. +func (s *CreateAccessPointOutput) SetAccessPointId(v string) *CreateAccessPointOutput { + s.AccessPointId = &v + return s +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateAccessPointOutput) SetClientToken(v string) *CreateAccessPointOutput { + s.ClientToken = &v + return s +} + +// SetFileSystemId sets the FileSystemId field's value. +func (s *CreateAccessPointOutput) SetFileSystemId(v string) *CreateAccessPointOutput { + s.FileSystemId = &v + return s +} + +// SetLifeCycleState sets the LifeCycleState field's value. +func (s *CreateAccessPointOutput) SetLifeCycleState(v string) *CreateAccessPointOutput { + s.LifeCycleState = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateAccessPointOutput) SetName(v string) *CreateAccessPointOutput { + s.Name = &v + return s +} + +// SetOwnerId sets the OwnerId field's value. +func (s *CreateAccessPointOutput) SetOwnerId(v string) *CreateAccessPointOutput { + s.OwnerId = &v + return s +} + +// SetPosixUser sets the PosixUser field's value. +func (s *CreateAccessPointOutput) SetPosixUser(v *PosixUser) *CreateAccessPointOutput { + s.PosixUser = v + return s +} + +// SetRootDirectory sets the RootDirectory field's value. +func (s *CreateAccessPointOutput) SetRootDirectory(v *RootDirectory) *CreateAccessPointOutput { + s.RootDirectory = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateAccessPointOutput) SetTags(v []*Tag) *CreateAccessPointOutput { + s.Tags = v + return s +} + +type CreateFileSystemInput struct { + _ struct{} `type:"structure"` + + // A string of up to 64 ASCII characters. Amazon EFS uses this to ensure idempotent + // creation. + CreationToken *string `min:"1" type:"string" idempotencyToken:"true"` + + // A Boolean value that, if true, creates an encrypted file system. When creating + // an encrypted file system, you have the option of specifying CreateFileSystemRequest$KmsKeyId + // for an existing AWS Key Management Service (AWS KMS) customer master key + // (CMK). If you don't specify a CMK, then the default CMK for Amazon EFS, /aws/elasticfilesystem, + // is used to protect the encrypted file system. + Encrypted *bool `type:"boolean"` + + // The ID of the AWS KMS CMK to be used to protect the encrypted file system. + // This parameter is only required if you want to use a nondefault CMK. If this + // parameter is not specified, the default CMK for Amazon EFS is used. This + // ID can be in one of the following formats: + // + // * Key ID - A unique identifier of the key, for example 1234abcd-12ab-34cd-56ef-1234567890ab. + // + // * ARN - An Amazon Resource Name (ARN) for the key, for example arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab. + // + // * Key alias - A previously created display name for a key, for example + // alias/projectKey1. + // + // * Key alias ARN - An ARN for a key alias, for example arn:aws:kms:us-west-2:444455556666:alias/projectKey1. + // + // If KmsKeyId is specified, the CreateFileSystemRequest$Encrypted parameter + // must be set to true. + KmsKeyId *string `min:"1" type:"string"` + + // The performance mode 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. The + // performance mode can't be changed after the file system has been created. + PerformanceMode *string `type:"string" enum:"PerformanceMode"` + + // The throughput, measured in MiB/s, that you want to provision for a file + // system that you're creating. Valid values are 1-1024. Required if ThroughputMode + // is set to provisioned. The upper limit for throughput is 1024 MiB/s. You + // can get this limit increased by contacting AWS Support. For more information, + // see Amazon EFS Limits That You Can Increase (https://docs.aws.amazon.com/efs/latest/ug/limits.html#soft-limits) + // in the Amazon EFS User Guide. + ProvisionedThroughputInMibps *float64 `min:"1" type:"double"` + + // A value that specifies to create one or more tags associated with the file + // system. Each tag is a user-defined key-value pair. Name your file system + // on creation by including a "Key":"Name","Value":"{value}" key-value pair. + Tags []*Tag `type:"list"` + + // The throughput mode for the file system to be created. There are two throughput + // modes to choose from for your file system: bursting and provisioned. If you + // set ThroughputMode to provisioned, you must also set a value for ProvisionedThroughPutInMibps. + // You can decrease your file system's throughput in Provisioned Throughput + // mode or change between the throughput modes as long as it’s been more than + // 24 hours since the last decrease or throughput mode change. For more, see + // Specifying Throughput with Provisioned Mode (https://docs.aws.amazon.com/efs/latest/ug/performance.html#provisioned-throughput) + // in the Amazon EFS User Guide. + ThroughputMode *string `type:"string" enum:"ThroughputMode"` +} + +// 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 && len(*s.CreationToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CreationToken", 1)) + } + if s.KmsKeyId != nil && len(*s.KmsKeyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("KmsKeyId", 1)) + } + if s.ProvisionedThroughputInMibps != nil && *s.ProvisionedThroughputInMibps < 1 { + invalidParams.Add(request.NewErrParamMinValue("ProvisionedThroughputInMibps", 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 +} + +// SetCreationToken sets the CreationToken field's value. +func (s *CreateFileSystemInput) SetCreationToken(v string) *CreateFileSystemInput { + s.CreationToken = &v + return s +} + +// SetEncrypted sets the Encrypted field's value. +func (s *CreateFileSystemInput) SetEncrypted(v bool) *CreateFileSystemInput { + s.Encrypted = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *CreateFileSystemInput) SetKmsKeyId(v string) *CreateFileSystemInput { + s.KmsKeyId = &v + return s +} + +// SetPerformanceMode sets the PerformanceMode field's value. +func (s *CreateFileSystemInput) SetPerformanceMode(v string) *CreateFileSystemInput { + s.PerformanceMode = &v + return s +} + +// SetProvisionedThroughputInMibps sets the ProvisionedThroughputInMibps field's value. +func (s *CreateFileSystemInput) SetProvisionedThroughputInMibps(v float64) *CreateFileSystemInput { + s.ProvisionedThroughputInMibps = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateFileSystemInput) SetTags(v []*Tag) *CreateFileSystemInput { + s.Tags = v + return s +} + +// SetThroughputMode sets the ThroughputMode field's value. +func (s *CreateFileSystemInput) SetThroughputMode(v string) *CreateFileSystemInput { + s.ThroughputMode = &v + return s +} + +type CreateMountTargetInput struct { + _ struct{} `type:"structure"` + + // The 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"` + + // The 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 +} + +type CreateTagsInput struct { + _ struct{} `type:"structure"` + + // The 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"` + + // An 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.FileSystemId != nil && len(*s.FileSystemId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 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 +} + +// 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 +} + +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() +} + +// Required if the RootDirectory > Path specified does not exist. Specifies +// the POSIX IDs and permissions to apply to the access point's RootDirectory +// > Path. If the access point root directory does not exist, EFS creates it +// with these settings when a client connects to the access point. When specifying +// CreationInfo, you must include values for all properties. +// +// If you do not provide CreationInfo and the specified RootDirectory does not +// exist, attempts to mount the file system using the access point will fail. +type CreationInfo struct { + _ struct{} `type:"structure"` + + // Specifies the POSIX group ID to apply to the RootDirectory. Accepts values + // from 0 to 2^32 (4294967295). + // + // OwnerGid is a required field + OwnerGid *int64 `type:"long" required:"true"` + + // Specifies the POSIX user ID to apply to the RootDirectory. Accepts values + // from 0 to 2^32 (4294967295). + // + // OwnerUid is a required field + OwnerUid *int64 `type:"long" required:"true"` + + // Specifies the POSIX permissions to apply to the RootDirectory, in the format + // of an octal number representing the file's mode bits. + // + // Permissions is a required field + Permissions *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreationInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreationInfo) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreationInfo) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreationInfo"} + if s.OwnerGid == nil { + invalidParams.Add(request.NewErrParamRequired("OwnerGid")) + } + if s.OwnerUid == nil { + invalidParams.Add(request.NewErrParamRequired("OwnerUid")) + } + if s.Permissions == nil { + invalidParams.Add(request.NewErrParamRequired("Permissions")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOwnerGid sets the OwnerGid field's value. +func (s *CreationInfo) SetOwnerGid(v int64) *CreationInfo { + s.OwnerGid = &v + return s +} + +// SetOwnerUid sets the OwnerUid field's value. +func (s *CreationInfo) SetOwnerUid(v int64) *CreationInfo { + s.OwnerUid = &v + return s +} + +// SetPermissions sets the Permissions field's value. +func (s *CreationInfo) SetPermissions(v string) *CreationInfo { + s.Permissions = &v + return s +} + +type DeleteAccessPointInput struct { + _ struct{} `type:"structure"` + + // The ID of the access point that you want to delete. + // + // AccessPointId is a required field + AccessPointId *string `location:"uri" locationName:"AccessPointId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteAccessPointInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAccessPointInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteAccessPointInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteAccessPointInput"} + if s.AccessPointId == nil { + invalidParams.Add(request.NewErrParamRequired("AccessPointId")) + } + if s.AccessPointId != nil && len(*s.AccessPointId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AccessPointId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessPointId sets the AccessPointId field's value. +func (s *DeleteAccessPointInput) SetAccessPointId(v string) *DeleteAccessPointInput { + s.AccessPointId = &v + return s +} + +type DeleteAccessPointOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteAccessPointOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAccessPointOutput) GoString() string { + return s.String() +} + +type DeleteFileSystemInput struct { + _ struct{} `type:"structure"` + + // The 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 s.FileSystemId != nil && len(*s.FileSystemId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 1)) + } + + 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 +} + +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() +} + +type DeleteFileSystemPolicyInput struct { + _ struct{} `type:"structure"` + + // Specifies the EFS file system for which to delete the FileSystemPolicy. + // + // FileSystemId is a required field + FileSystemId *string `location:"uri" locationName:"FileSystemId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteFileSystemPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFileSystemPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteFileSystemPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteFileSystemPolicyInput"} + if s.FileSystemId == nil { + invalidParams.Add(request.NewErrParamRequired("FileSystemId")) + } + if s.FileSystemId != nil && len(*s.FileSystemId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFileSystemId sets the FileSystemId field's value. +func (s *DeleteFileSystemPolicyInput) SetFileSystemId(v string) *DeleteFileSystemPolicyInput { + s.FileSystemId = &v + return s +} + +type DeleteFileSystemPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteFileSystemPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFileSystemPolicyOutput) GoString() string { + return s.String() +} + +type DeleteMountTargetInput struct { + _ struct{} `type:"structure"` + + // The 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 s.MountTargetId != nil && len(*s.MountTargetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MountTargetId", 1)) + } + + 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 +} + +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() +} + +type DeleteTagsInput struct { + _ struct{} `type:"structure"` + + // The 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"` + + // A list of tag keys to delete. + // + // TagKeys is a required field + TagKeys []*string `min:"1" 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.FileSystemId != nil && len(*s.FileSystemId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 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 +} + +// 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 +} + +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() +} + +// The service timed out trying to fulfill the request, and the client should +// try the call again. +type DependencyTimeout struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DependencyTimeout) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DependencyTimeout) GoString() string { + return s.String() +} + +func newErrorDependencyTimeout(v protocol.ResponseMetadata) error { + return &DependencyTimeout{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DependencyTimeout) Code() string { + return "DependencyTimeout" +} + +// Message returns the exception's message. +func (s DependencyTimeout) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DependencyTimeout) OrigErr() error { + return nil +} + +func (s DependencyTimeout) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DependencyTimeout) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DependencyTimeout) RequestID() string { + return s.respMetadata.RequestID +} + +type DescribeAccessPointsInput struct { + _ struct{} `type:"structure"` + + // (Optional) Specifies an EFS access point to describe in the response; mutually + // exclusive with FileSystemId. + AccessPointId *string `location:"querystring" locationName:"AccessPointId" type:"string"` + + // (Optional) If you provide a FileSystemId, EFS returns all access points for + // that file system; mutually exclusive with AccessPointId. + FileSystemId *string `location:"querystring" locationName:"FileSystemId" type:"string"` + + // (Optional) When retrieving all access points for a file system, you can optionally + // specify the MaxItems parameter to limit the number of objects returned in + // a response. The default value is 100. + MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` + + // NextToken is present if the response is paginated. You can use NextMarker + // in the subsequent request to fetch the next page of access point descriptions. + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s DescribeAccessPointsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAccessPointsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeAccessPointsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeAccessPointsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessPointId sets the AccessPointId field's value. +func (s *DescribeAccessPointsInput) SetAccessPointId(v string) *DescribeAccessPointsInput { + s.AccessPointId = &v + return s +} + +// SetFileSystemId sets the FileSystemId field's value. +func (s *DescribeAccessPointsInput) SetFileSystemId(v string) *DescribeAccessPointsInput { + s.FileSystemId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeAccessPointsInput) SetMaxResults(v int64) *DescribeAccessPointsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeAccessPointsInput) SetNextToken(v string) *DescribeAccessPointsInput { + s.NextToken = &v + return s +} + +type DescribeAccessPointsOutput struct { + _ struct{} `type:"structure"` + + // An array of access point descriptions. + AccessPoints []*AccessPointDescription `type:"list"` + + // Present if there are more access points than returned in the response. You + // can use the NextMarker in the subsequent request to fetch the additional + // descriptions. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeAccessPointsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAccessPointsOutput) GoString() string { + return s.String() +} + +// SetAccessPoints sets the AccessPoints field's value. +func (s *DescribeAccessPointsOutput) SetAccessPoints(v []*AccessPointDescription) *DescribeAccessPointsOutput { + s.AccessPoints = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeAccessPointsOutput) SetNextToken(v string) *DescribeAccessPointsOutput { + s.NextToken = &v + return s +} + +type DescribeFileSystemPolicyInput struct { + _ struct{} `type:"structure"` + + // Specifies which EFS file system to retrieve the FileSystemPolicy for. + // + // FileSystemId is a required field + FileSystemId *string `location:"uri" locationName:"FileSystemId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeFileSystemPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeFileSystemPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeFileSystemPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeFileSystemPolicyInput"} + if s.FileSystemId == nil { + invalidParams.Add(request.NewErrParamRequired("FileSystemId")) + } + if s.FileSystemId != nil && len(*s.FileSystemId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFileSystemId sets the FileSystemId field's value. +func (s *DescribeFileSystemPolicyInput) SetFileSystemId(v string) *DescribeFileSystemPolicyInput { + s.FileSystemId = &v + return s +} + +type DescribeFileSystemPolicyOutput struct { + _ struct{} `type:"structure"` + + // Specifies the EFS file system to which the FileSystemPolicy applies. + FileSystemId *string `type:"string"` + + // The JSON formatted FileSystemPolicy for the EFS file system. + Policy *string `type:"string"` +} + +// String returns the string representation +func (s DescribeFileSystemPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeFileSystemPolicyOutput) GoString() string { + return s.String() +} + +// SetFileSystemId sets the FileSystemId field's value. +func (s *DescribeFileSystemPolicyOutput) SetFileSystemId(v string) *DescribeFileSystemPolicyOutput { + s.FileSystemId = &v + return s +} + +// SetPolicy sets the Policy field's value. +func (s *DescribeFileSystemPolicyOutput) SetPolicy(v string) *DescribeFileSystemPolicyOutput { + s.Policy = &v + return s +} + +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 number is automatically set to 100. The response + // is paginated at 100 per page if you have more than 100 file systems. + 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 +} + +type DescribeFileSystemsOutput struct { + _ struct{} `type:"structure"` + + // An 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 +} + +type DescribeLifecycleConfigurationInput struct { + _ struct{} `type:"structure"` + + // The ID of the file system whose LifecycleConfiguration object you want to + // retrieve (String). + // + // FileSystemId is a required field + FileSystemId *string `location:"uri" locationName:"FileSystemId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeLifecycleConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLifecycleConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLifecycleConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLifecycleConfigurationInput"} + if s.FileSystemId == nil { + invalidParams.Add(request.NewErrParamRequired("FileSystemId")) + } + if s.FileSystemId != nil && len(*s.FileSystemId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFileSystemId sets the FileSystemId field's value. +func (s *DescribeLifecycleConfigurationInput) SetFileSystemId(v string) *DescribeLifecycleConfigurationInput { + s.FileSystemId = &v + return s +} + +type DescribeLifecycleConfigurationOutput struct { + _ struct{} `type:"structure"` + + // An array of lifecycle management policies. Currently, EFS supports a maximum + // of one policy per file system. + LifecyclePolicies []*LifecyclePolicy `type:"list"` +} + +// String returns the string representation +func (s DescribeLifecycleConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLifecycleConfigurationOutput) GoString() string { + return s.String() +} + +// SetLifecyclePolicies sets the LifecyclePolicies field's value. +func (s *DescribeLifecycleConfigurationOutput) SetLifecyclePolicies(v []*LifecyclePolicy) *DescribeLifecycleConfigurationOutput { + s.LifecyclePolicies = v + return s +} + +type DescribeMountTargetSecurityGroupsInput struct { + _ struct{} `type:"structure"` + + // The 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 s.MountTargetId != nil && len(*s.MountTargetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MountTargetId", 1)) + } + + 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 +} + +type DescribeMountTargetSecurityGroupsOutput struct { + _ struct{} `type:"structure"` + + // An 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 +} + +type DescribeMountTargetsInput struct { + _ struct{} `type:"structure"` + + // (Optional) The ID of the access point whose mount targets that you want to + // list. It must be included in your request if a FileSystemId or MountTargetId + // is not included in your request. Accepts either an access point ID or ARN + // as input. + AccessPointId *string `location:"querystring" locationName:"AccessPointId" type:"string"` + + // (Optional) ID of the file system whose mount targets you want to list (String). + // It must be included in your request if an AccessPointId or MountTargetId + // is not included. Accepts either a file system ID or ARN as input. + 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. Currently, + // this number is automatically set to 10, and other values are ignored. The + // response is paginated at 100 per page if you have more than 100 mount targets. + 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. Accepts + // either a mount target ID or ARN as input. + 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 +} + +// SetAccessPointId sets the AccessPointId field's value. +func (s *DescribeMountTargetsInput) SetAccessPointId(v string) *DescribeMountTargetsInput { + s.AccessPointId = &v + return s +} + +// 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 +} + +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 +} + +type DescribeTagsInput struct { + _ struct{} `type:"structure"` + + // The 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) An 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) The maximum number of file system tags to return in the response. + // Currently, this number is automatically set to 100, and other values are + // ignored. The response is paginated at 100 per page if you have more than + // 100 tags. + 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.FileSystemId != nil && len(*s.FileSystemId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 1)) + } + 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 +} + +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 +} + +// Returned if the file system you are trying to create already exists, with +// the creation token you provided. +type FileSystemAlreadyExists struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + // FileSystemId is a required field + FileSystemId *string `type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s FileSystemAlreadyExists) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileSystemAlreadyExists) GoString() string { + return s.String() +} + +func newErrorFileSystemAlreadyExists(v protocol.ResponseMetadata) error { + return &FileSystemAlreadyExists{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FileSystemAlreadyExists) Code() string { + return "FileSystemAlreadyExists" +} + +// Message returns the exception's message. +func (s FileSystemAlreadyExists) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FileSystemAlreadyExists) OrigErr() error { + return nil +} + +func (s FileSystemAlreadyExists) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FileSystemAlreadyExists) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FileSystemAlreadyExists) RequestID() string { + return s.respMetadata.RequestID +} + +// A description of the file system. +type FileSystemDescription struct { + _ struct{} `type:"structure"` + + // The 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" required:"true"` + + // The opaque string specified in the request. + // + // CreationToken is a required field + CreationToken *string `min:"1" type:"string" required:"true"` + + // A Boolean value that, if true, indicates that the file system is encrypted. + Encrypted *bool `type:"boolean"` + + // The ID of the file system, assigned by Amazon EFS. + // + // FileSystemId is a required field + FileSystemId *string `type:"string" required:"true"` + + // The ID of an AWS Key Management Service (AWS KMS) customer master key (CMK) + // that was used to protect the encrypted file system. + KmsKeyId *string `min:"1" type:"string"` + + // The 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 CreateFileSystem. If the file system has a Name tag, Amazon EFS returns + // the value in this field. + Name *string `type:"string"` + + // The 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"` + + // The 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 performance mode of the file system. + // + // PerformanceMode is a required field + PerformanceMode *string `type:"string" required:"true" enum:"PerformanceMode"` + + // The throughput, measured in MiB/s, that you want to provision for a file + // system. Valid values are 1-1024. Required if ThroughputMode is set to provisioned. + // The limit on throughput is 1024 MiB/s. You can get these limits increased + // by contacting AWS Support. For more information, see Amazon EFS Limits That + // You Can Increase (https://docs.aws.amazon.com/efs/latest/ug/limits.html#soft-limits) + // in the Amazon EFS User Guide. + ProvisionedThroughputInMibps *float64 `min:"1" type:"double"` + + // The 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. The Timestamp value is the integer number of seconds since + // 1970-01-01T00:00:00Z. The SizeInBytes value doesn't 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, SizeInBytes represents + // 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 that the file + // system was at any point in time. + // + // SizeInBytes is a required field + SizeInBytes *FileSystemSize `type:"structure" required:"true"` + + // The tags associated with the file system, presented as an array of Tag objects. + // + // Tags is a required field + Tags []*Tag `type:"list" required:"true"` + + // The throughput mode for a file system. There are two throughput modes to + // choose from for your file system: bursting and provisioned. If you set ThroughputMode + // to provisioned, you must also set a value for ProvisionedThroughPutInMibps. + // You can decrease your file system's throughput in Provisioned Throughput + // mode or change between the throughput modes as long as it’s been more than + // 24 hours since the last decrease or throughput mode change. + ThroughputMode *string `type:"string" enum:"ThroughputMode"` +} + +// 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 +} + +// SetEncrypted sets the Encrypted field's value. +func (s *FileSystemDescription) SetEncrypted(v bool) *FileSystemDescription { + s.Encrypted = &v + return s +} + +// SetFileSystemId sets the FileSystemId field's value. +func (s *FileSystemDescription) SetFileSystemId(v string) *FileSystemDescription { + s.FileSystemId = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *FileSystemDescription) SetKmsKeyId(v string) *FileSystemDescription { + s.KmsKeyId = &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 +} + +// SetProvisionedThroughputInMibps sets the ProvisionedThroughputInMibps field's value. +func (s *FileSystemDescription) SetProvisionedThroughputInMibps(v float64) *FileSystemDescription { + s.ProvisionedThroughputInMibps = &v + return s +} + +// SetSizeInBytes sets the SizeInBytes field's value. +func (s *FileSystemDescription) SetSizeInBytes(v *FileSystemSize) *FileSystemDescription { + s.SizeInBytes = v + return s +} + +// SetTags sets the Tags field's value. +func (s *FileSystemDescription) SetTags(v []*Tag) *FileSystemDescription { + s.Tags = v + return s +} + +// SetThroughputMode sets the ThroughputMode field's value. +func (s *FileSystemDescription) SetThroughputMode(v string) *FileSystemDescription { + s.ThroughputMode = &v + return s +} + +// Returned if a file system has mount targets. +type FileSystemInUse struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s FileSystemInUse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileSystemInUse) GoString() string { + return s.String() +} + +func newErrorFileSystemInUse(v protocol.ResponseMetadata) error { + return &FileSystemInUse{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FileSystemInUse) Code() string { + return "FileSystemInUse" +} + +// Message returns the exception's message. +func (s FileSystemInUse) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FileSystemInUse) OrigErr() error { + return nil +} + +func (s FileSystemInUse) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FileSystemInUse) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FileSystemInUse) RequestID() string { + return s.respMetadata.RequestID +} + +// Returned if the AWS account has already created the maximum number of file +// systems allowed per account. +type FileSystemLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s FileSystemLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileSystemLimitExceeded) GoString() string { + return s.String() +} + +func newErrorFileSystemLimitExceeded(v protocol.ResponseMetadata) error { + return &FileSystemLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FileSystemLimitExceeded) Code() string { + return "FileSystemLimitExceeded" +} + +// Message returns the exception's message. +func (s FileSystemLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FileSystemLimitExceeded) OrigErr() error { + return nil +} + +func (s FileSystemLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FileSystemLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FileSystemLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + +// Returned if the specified FileSystemId value doesn't exist in the requester's +// AWS account. +type FileSystemNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s FileSystemNotFound) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileSystemNotFound) GoString() string { + return s.String() +} + +func newErrorFileSystemNotFound(v protocol.ResponseMetadata) error { + return &FileSystemNotFound{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FileSystemNotFound) Code() string { + return "FileSystemNotFound" +} + +// Message returns the exception's message. +func (s FileSystemNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FileSystemNotFound) OrigErr() error { + return nil +} + +func (s FileSystemNotFound) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FileSystemNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FileSystemNotFound) RequestID() string { + return s.respMetadata.RequestID +} + +// The 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. The value doesn't 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 represents 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. +type FileSystemSize struct { + _ struct{} `type:"structure"` + + // The 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"` + + // The latest known metered size (in bytes) of data stored in the file system. + // + // Value is a required field + Value *int64 `type:"long" required:"true"` + + // The latest known metered size (in bytes) of data stored in the Infrequent + // Access storage class. + ValueInIA *int64 `type:"long"` + + // The latest known metered size (in bytes) of data stored in the Standard storage + // class. + ValueInStandard *int64 `type:"long"` +} + +// 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 +} + +// SetValueInIA sets the ValueInIA field's value. +func (s *FileSystemSize) SetValueInIA(v int64) *FileSystemSize { + s.ValueInIA = &v + return s +} + +// SetValueInStandard sets the ValueInStandard field's value. +func (s *FileSystemSize) SetValueInStandard(v int64) *FileSystemSize { + s.ValueInStandard = &v + return s +} + +// Returned if the file system's lifecycle state is not "available". +type IncorrectFileSystemLifeCycleState struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s IncorrectFileSystemLifeCycleState) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IncorrectFileSystemLifeCycleState) GoString() string { + return s.String() +} + +func newErrorIncorrectFileSystemLifeCycleState(v protocol.ResponseMetadata) error { + return &IncorrectFileSystemLifeCycleState{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IncorrectFileSystemLifeCycleState) Code() string { + return "IncorrectFileSystemLifeCycleState" +} + +// Message returns the exception's message. +func (s IncorrectFileSystemLifeCycleState) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IncorrectFileSystemLifeCycleState) OrigErr() error { + return nil +} - // The performance mode 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. The - // performance mode can't be changed after the file system has been created. - PerformanceMode *string `type:"string" enum:"PerformanceMode"` +func (s IncorrectFileSystemLifeCycleState) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} - // The throughput, measured in MiB/s, that you want to provision for a file - // system that you're creating. Valid values are 1-1024. Required if ThroughputMode - // is set to provisioned. The upper limit for throughput is 1024 MiB/s. You - // can get this limit increased by contacting AWS Support. For more information, - // see Amazon EFS Limits That You Can Increase (https://docs.aws.amazon.com/efs/latest/ug/limits.html#soft-limits) - // in the Amazon EFS User Guide. - ProvisionedThroughputInMibps *float64 `min:"1" type:"double"` +// Status code returns the HTTP status code for the request's response error. +func (s IncorrectFileSystemLifeCycleState) StatusCode() int { + return s.respMetadata.StatusCode +} - // A value that specifies to create one or more tags associated with the file - // system. Each tag is a user-defined key-value pair. Name your file system - // on creation by including a "Key":"Name","Value":"{value}" key-value pair. - Tags []*Tag `type:"list"` +// RequestID returns the service's response RequestID for request. +func (s IncorrectFileSystemLifeCycleState) RequestID() string { + return s.respMetadata.RequestID +} - // The throughput mode for the file system to be created. There are two throughput - // modes to choose from for your file system: bursting and provisioned. If you - // set ThroughputMode to provisioned, you must also set a value for ProvisionedThroughPutInMibps. - // You can decrease your file system's throughput in Provisioned Throughput - // mode or change between the throughput modes as long as it’s been more than - // 24 hours since the last decrease or throughput mode change. For more, see - // Specifying Throughput with Provisioned Mode (https://docs.aws.amazon.com/efs/latest/ug/performance.html#provisioned-throughput) - // in the Amazon EFS User Guide. - ThroughputMode *string `type:"string" enum:"ThroughputMode"` +// Returned if the mount target is not in the correct state for the operation. +type IncorrectMountTargetState struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s CreateFileSystemInput) String() string { +func (s IncorrectMountTargetState) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateFileSystemInput) GoString() string { +func (s IncorrectMountTargetState) 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 s.KmsKeyId != nil && len(*s.KmsKeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyId", 1)) - } - if s.ProvisionedThroughputInMibps != nil && *s.ProvisionedThroughputInMibps < 1 { - invalidParams.Add(request.NewErrParamMinValue("ProvisionedThroughputInMibps", 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)) - } - } +func newErrorIncorrectMountTargetState(v protocol.ResponseMetadata) error { + return &IncorrectMountTargetState{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s IncorrectMountTargetState) Code() string { + return "IncorrectMountTargetState" +} + +// Message returns the exception's message. +func (s IncorrectMountTargetState) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IncorrectMountTargetState) OrigErr() error { return nil } -// SetCreationToken sets the CreationToken field's value. -func (s *CreateFileSystemInput) SetCreationToken(v string) *CreateFileSystemInput { - s.CreationToken = &v - return s +func (s IncorrectMountTargetState) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetEncrypted sets the Encrypted field's value. -func (s *CreateFileSystemInput) SetEncrypted(v bool) *CreateFileSystemInput { - s.Encrypted = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s IncorrectMountTargetState) StatusCode() int { + return s.respMetadata.StatusCode } -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateFileSystemInput) SetKmsKeyId(v string) *CreateFileSystemInput { - s.KmsKeyId = &v - return s +// RequestID returns the service's response RequestID for request. +func (s IncorrectMountTargetState) RequestID() string { + return s.respMetadata.RequestID } -// SetPerformanceMode sets the PerformanceMode field's value. -func (s *CreateFileSystemInput) SetPerformanceMode(v string) *CreateFileSystemInput { - s.PerformanceMode = &v - return s +// Returned if there's not enough capacity to provision additional throughput. +// This value might be returned when you try to create a file system in provisioned +// throughput mode, when you attempt to increase the provisioned throughput +// of an existing file system, or when you attempt to change an existing file +// system from bursting to provisioned throughput mode. +type InsufficientThroughputCapacity struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` } -// SetProvisionedThroughputInMibps sets the ProvisionedThroughputInMibps field's value. -func (s *CreateFileSystemInput) SetProvisionedThroughputInMibps(v float64) *CreateFileSystemInput { - s.ProvisionedThroughputInMibps = &v - return s +// String returns the string representation +func (s InsufficientThroughputCapacity) String() string { + return awsutil.Prettify(s) } -// SetTags sets the Tags field's value. -func (s *CreateFileSystemInput) SetTags(v []*Tag) *CreateFileSystemInput { - s.Tags = v - return s +// GoString returns the string representation +func (s InsufficientThroughputCapacity) GoString() string { + return s.String() } -// SetThroughputMode sets the ThroughputMode field's value. -func (s *CreateFileSystemInput) SetThroughputMode(v string) *CreateFileSystemInput { - s.ThroughputMode = &v - return s +func newErrorInsufficientThroughputCapacity(v protocol.ResponseMetadata) error { + return &InsufficientThroughputCapacity{ + respMetadata: v, + } } -type CreateMountTargetInput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s InsufficientThroughputCapacity) Code() string { + return "InsufficientThroughputCapacity" +} - // The ID of the file system for which to create the mount target. - // - // FileSystemId is a required field - FileSystemId *string `type:"string" required:"true"` +// Message returns the exception's message. +func (s InsufficientThroughputCapacity) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Valid IPv4 address within the address range of the specified subnet. - IpAddress *string `type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InsufficientThroughputCapacity) OrigErr() error { + return nil +} - // 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"` +func (s InsufficientThroughputCapacity) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} - // The ID of the subnet to add the mount target in. - // - // SubnetId is a required field - SubnetId *string `type:"string" required:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s InsufficientThroughputCapacity) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InsufficientThroughputCapacity) RequestID() string { + return s.respMetadata.RequestID +} + +// Returned if an error occurred on the server side. +type InternalServerError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s CreateMountTargetInput) String() string { +func (s InternalServerError) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateMountTargetInput) GoString() string { +func (s InternalServerError) 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")) +func newErrorInternalServerError(v protocol.ResponseMetadata) error { + return &InternalServerError{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InternalServerError) Code() string { + return "InternalServerError" +} + +// Message returns the exception's message. +func (s InternalServerError) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetFileSystemId sets the FileSystemId field's value. -func (s *CreateMountTargetInput) SetFileSystemId(v string) *CreateMountTargetInput { - s.FileSystemId = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerError) OrigErr() error { + return nil } -// SetIpAddress sets the IpAddress field's value. -func (s *CreateMountTargetInput) SetIpAddress(v string) *CreateMountTargetInput { - s.IpAddress = &v - return s +func (s InternalServerError) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *CreateMountTargetInput) SetSecurityGroups(v []*string) *CreateMountTargetInput { - s.SecurityGroups = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerError) StatusCode() int { + return s.respMetadata.StatusCode } -// SetSubnetId sets the SubnetId field's value. -func (s *CreateMountTargetInput) SetSubnetId(v string) *CreateMountTargetInput { - s.SubnetId = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InternalServerError) RequestID() string { + return s.respMetadata.RequestID } -type CreateTagsInput struct { - _ struct{} `type:"structure"` +// Returned if the FileSystemPolicy is is malformed or contains an error such +// as an invalid parameter value or a missing required parameter. Returned in +// the case of a policy lockout safety check error. +type InvalidPolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The 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"` + ErrorCode *string `min:"1" type:"string"` - // An 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"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s CreateTagsInput) String() string { +func (s InvalidPolicyException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTagsInput) GoString() string { +func (s InvalidPolicyException) 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.FileSystemId != nil && len(*s.FileSystemId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 1)) +func newErrorInvalidPolicyException(v protocol.ResponseMetadata) error { + return &InvalidPolicyException{ + respMetadata: v, } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) +} + +// Code returns the exception type name. +func (s InvalidPolicyException) Code() string { + return "InvalidPolicyException" +} + +// Message returns the exception's message. +func (s InvalidPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - 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)) - } - } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPolicyException) OrigErr() error { + return nil +} + +func (s InvalidPolicyException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPolicyException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returned if the request specified an IpAddress that is already in use in +// the subnet. +type IpAddressInUse struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s IpAddressInUse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IpAddressInUse) GoString() string { + return s.String() +} + +func newErrorIpAddressInUse(v protocol.ResponseMetadata) error { + return &IpAddressInUse{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s IpAddressInUse) Code() string { + return "IpAddressInUse" +} + +// Message returns the exception's message. +func (s IpAddressInUse) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IpAddressInUse) OrigErr() error { return nil } -// SetFileSystemId sets the FileSystemId field's value. -func (s *CreateTagsInput) SetFileSystemId(v string) *CreateTagsInput { - s.FileSystemId = &v - return s +func (s IpAddressInUse) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetTags sets the Tags field's value. -func (s *CreateTagsInput) SetTags(v []*Tag) *CreateTagsInput { - s.Tags = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s IpAddressInUse) StatusCode() int { + return s.respMetadata.StatusCode } -type CreateTagsOutput struct { +// RequestID returns the service's response RequestID for request. +func (s IpAddressInUse) RequestID() string { + return s.respMetadata.RequestID +} + +// Describes a policy used by EFS lifecycle management to transition files to +// the Infrequent Access (IA) storage class. +type LifecyclePolicy struct { _ struct{} `type:"structure"` + + // A value that describes the period of time that a file is not accessed, after + // which it transitions to the IA storage class. Metadata operations such as + // listing the contents of a directory don't count as file access events. + TransitionToIA *string `type:"string" enum:"TransitionToIARules"` } // String returns the string representation -func (s CreateTagsOutput) String() string { +func (s LifecyclePolicy) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTagsOutput) GoString() string { +func (s LifecyclePolicy) GoString() string { return s.String() } -type DeleteFileSystemInput struct { +// SetTransitionToIA sets the TransitionToIA field's value. +func (s *LifecyclePolicy) SetTransitionToIA(v string) *LifecyclePolicy { + s.TransitionToIA = &v + return s +} + +type ListTagsForResourceInput struct { _ struct{} `type:"structure"` - // The ID of the file system you want to delete. + // (Optional) Specifies the maximum number of tag objects to return in the response. + // The default value is 100. + MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` + + // You can use NextToken in a subsequent request to fetch the next page of access + // point descriptions if the response payload was paginated. + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` + + // Specifies the EFS resource you want to retrieve tags for. You can retrieve + // tags for EFS file systems and access points using this API endpoint. // - // FileSystemId is a required field - FileSystemId *string `location:"uri" locationName:"FileSystemId" type:"string" required:"true"` + // ResourceId is a required field + ResourceId *string `location:"uri" locationName:"ResourceId" type:"string" required:"true"` } // String returns the string representation -func (s DeleteFileSystemInput) String() string { +func (s ListTagsForResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteFileSystemInput) GoString() string { +func (s ListTagsForResourceInput) 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")) +func (s *ListTagsForResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } - if s.FileSystemId != nil && len(*s.FileSystemId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 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 invalidParams.Len() > 0 { @@ -1948,48 +5617,82 @@ func (s *DeleteFileSystemInput) Validate() error { return nil } -// SetFileSystemId sets the FileSystemId field's value. -func (s *DeleteFileSystemInput) SetFileSystemId(v string) *DeleteFileSystemInput { - s.FileSystemId = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListTagsForResourceInput) SetMaxResults(v int64) *ListTagsForResourceInput { + s.MaxResults = &v return s } -type DeleteFileSystemOutput struct { +// 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 +} + +type ListTagsForResourceOutput struct { _ struct{} `type:"structure"` + + // NextToken is present if the response payload is paginated. You can use NextToken + // in a subsequent request to fetch the next page of access point descriptions. + NextToken *string `type:"string"` + + // An array of the tags for the specified EFS resource. + Tags []*Tag `type:"list"` } // String returns the string representation -func (s DeleteFileSystemOutput) String() string { +func (s ListTagsForResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteFileSystemOutput) GoString() string { +func (s ListTagsForResourceOutput) GoString() string { return s.String() } -type DeleteMountTargetInput struct { +// 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 +} + +type ModifyMountTargetSecurityGroupsInput struct { _ struct{} `type:"structure"` - // The ID of the mount target to delete (String). + // The 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"` + + // An array of up to five VPC security group IDs. + SecurityGroups []*string `type:"list"` } // String returns the string representation -func (s DeleteMountTargetInput) String() string { +func (s ModifyMountTargetSecurityGroupsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteMountTargetInput) GoString() string { +func (s ModifyMountTargetSecurityGroupsInput) 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"} +func (s *ModifyMountTargetSecurityGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyMountTargetSecurityGroupsInput"} if s.MountTargetId == nil { invalidParams.Add(request.NewErrParamRequired("MountTargetId")) } @@ -2004,302 +5707,484 @@ func (s *DeleteMountTargetInput) Validate() error { } // SetMountTargetId sets the MountTargetId field's value. -func (s *DeleteMountTargetInput) SetMountTargetId(v string) *DeleteMountTargetInput { +func (s *ModifyMountTargetSecurityGroupsInput) SetMountTargetId(v string) *ModifyMountTargetSecurityGroupsInput { s.MountTargetId = &v return s } -type DeleteMountTargetOutput struct { +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *ModifyMountTargetSecurityGroupsInput) SetSecurityGroups(v []*string) *ModifyMountTargetSecurityGroupsInput { + s.SecurityGroups = v + return s +} + +type ModifyMountTargetSecurityGroupsOutput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s DeleteMountTargetOutput) String() string { +func (s ModifyMountTargetSecurityGroupsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteMountTargetOutput) GoString() string { +func (s ModifyMountTargetSecurityGroupsOutput) GoString() string { return s.String() } -type DeleteTagsInput struct { +// Returned if the mount target would violate one of the specified restrictions +// based on the file system's existing mount targets. +type MountTargetConflict struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s MountTargetConflict) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MountTargetConflict) GoString() string { + return s.String() +} + +func newErrorMountTargetConflict(v protocol.ResponseMetadata) error { + return &MountTargetConflict{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MountTargetConflict) Code() string { + return "MountTargetConflict" +} + +// Message returns the exception's message. +func (s MountTargetConflict) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MountTargetConflict) OrigErr() error { + return nil +} + +func (s MountTargetConflict) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MountTargetConflict) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MountTargetConflict) RequestID() string { + return s.respMetadata.RequestID +} + +// Provides a description of a mount target. +type MountTargetDescription struct { _ struct{} `type:"structure"` - // The ID of the file system whose tags you want to delete (String). + // The unique and consistent identifier of the Availability Zone (AZ) that the + // mount target resides in. For example, use1-az1 is an AZ ID for the us-east-1 + // Region and it has the same location in every AWS account. + AvailabilityZoneId *string `type:"string"` + + // The name of the Availability Zone (AZ) that the mount target resides in. + // AZs are independently mapped to names for each AWS account. For example, + // the Availability Zone us-east-1a for your AWS account might not be the same + // location as us-east-1a for another AWS account. + AvailabilityZoneName *string `type:"string"` + + // The ID of the file system for which the mount target is intended. // // FileSystemId is a required field - FileSystemId *string `location:"uri" locationName:"FileSystemId" type:"string" required:"true"` + FileSystemId *string `type:"string" required:"true"` - // A list of tag keys to delete. + // Address at which the file system can be mounted by using the mount target. + IpAddress *string `type:"string"` + + // Lifecycle state of the mount target. // - // TagKeys is a required field - TagKeys []*string `type:"list" required:"true"` + // 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"` + + // The 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"` + + // The 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 DeleteTagsInput) String() string { +func (s MountTargetDescription) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTagsInput) GoString() string { +func (s MountTargetDescription) 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.FileSystemId != nil && len(*s.FileSystemId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } +// SetAvailabilityZoneId sets the AvailabilityZoneId field's value. +func (s *MountTargetDescription) SetAvailabilityZoneId(v string) *MountTargetDescription { + s.AvailabilityZoneId = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetAvailabilityZoneName sets the AvailabilityZoneName field's value. +func (s *MountTargetDescription) SetAvailabilityZoneName(v string) *MountTargetDescription { + s.AvailabilityZoneName = &v + return s } // SetFileSystemId sets the FileSystemId field's value. -func (s *DeleteTagsInput) SetFileSystemId(v string) *DeleteTagsInput { +func (s *MountTargetDescription) SetFileSystemId(v string) *MountTargetDescription { s.FileSystemId = &v return s } -// SetTagKeys sets the TagKeys field's value. -func (s *DeleteTagsInput) SetTagKeys(v []*string) *DeleteTagsInput { - s.TagKeys = v +// SetIpAddress sets the IpAddress field's value. +func (s *MountTargetDescription) SetIpAddress(v string) *MountTargetDescription { + s.IpAddress = &v return s } -type DeleteTagsOutput struct { - _ struct{} `type:"structure"` +// 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 +} + +// Returned if there is no mount target with the specified ID found in the caller's +// account. +type MountTargetNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s DeleteTagsOutput) String() string { +func (s MountTargetNotFound) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTagsOutput) GoString() string { +func (s MountTargetNotFound) GoString() string { return s.String() } -type DescribeFileSystemsInput struct { - _ struct{} `type:"structure"` +func newErrorMountTargetNotFound(v protocol.ResponseMetadata) error { + return &MountTargetNotFound{ + respMetadata: v, + } +} - // (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"` +// Code returns the exception type name. +func (s MountTargetNotFound) Code() string { + return "MountTargetNotFound" +} - // (Optional) ID of the file system whose description you want to retrieve (String). - FileSystemId *string `location:"querystring" locationName:"FileSystemId" type:"string"` +// Message returns the exception's message. +func (s MountTargetNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // (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"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MountTargetNotFound) OrigErr() error { + return nil +} - // (Optional) Specifies the maximum number of file systems to return in the - // response (integer). Currently, this number is automatically set to 10, and - // other values are ignored. The response is paginated at 10 per page if you - // have more than 10 file systems. - MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` +func (s MountTargetNotFound) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MountTargetNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MountTargetNotFound) RequestID() string { + return s.respMetadata.RequestID +} + +// The calling account has reached the limit for elastic network interfaces +// for the specific AWS Region. The client should try to delete some elastic +// network interfaces or get the account limit raised. For more information, +// see Amazon VPC Limits (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Appendix_Limits.html) +// in the Amazon VPC User Guide (see the Network interfaces per VPC entry in +// the table). +type NetworkInterfaceLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s DescribeFileSystemsInput) String() string { +func (s NetworkInterfaceLimitExceeded) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeFileSystemsInput) GoString() string { +func (s NetworkInterfaceLimitExceeded) 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)) +func newErrorNetworkInterfaceLimitExceeded(v protocol.ResponseMetadata) error { + return &NetworkInterfaceLimitExceeded{ + respMetadata: v, } - - 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 +// Code returns the exception type name. +func (s NetworkInterfaceLimitExceeded) Code() string { + return "NetworkInterfaceLimitExceeded" } -// SetFileSystemId sets the FileSystemId field's value. -func (s *DescribeFileSystemsInput) SetFileSystemId(v string) *DescribeFileSystemsInput { - s.FileSystemId = &v - return s +// Message returns the exception's message. +func (s NetworkInterfaceLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetMarker sets the Marker field's value. -func (s *DescribeFileSystemsInput) SetMarker(v string) *DescribeFileSystemsInput { - s.Marker = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NetworkInterfaceLimitExceeded) OrigErr() error { + return nil } -// SetMaxItems sets the MaxItems field's value. -func (s *DescribeFileSystemsInput) SetMaxItems(v int64) *DescribeFileSystemsInput { - s.MaxItems = &v - return s +func (s NetworkInterfaceLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NetworkInterfaceLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode } -type DescribeFileSystemsOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s NetworkInterfaceLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} - // An array of file system descriptions. - FileSystems []*FileSystemDescription `type:"list"` +// Returned if IpAddress was not specified in the request and there are no free +// IP addresses in the subnet. +type NoFreeAddressesInSubnet struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Present if provided by caller in the request (String). - Marker *string `type:"string"` + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` - // 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"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s DescribeFileSystemsOutput) String() string { +func (s NoFreeAddressesInSubnet) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeFileSystemsOutput) GoString() string { +func (s NoFreeAddressesInSubnet) GoString() string { return s.String() } -// SetFileSystems sets the FileSystems field's value. -func (s *DescribeFileSystemsOutput) SetFileSystems(v []*FileSystemDescription) *DescribeFileSystemsOutput { - s.FileSystems = v - return s +func newErrorNoFreeAddressesInSubnet(v protocol.ResponseMetadata) error { + return &NoFreeAddressesInSubnet{ + respMetadata: v, + } } -// SetMarker sets the Marker field's value. -func (s *DescribeFileSystemsOutput) SetMarker(v string) *DescribeFileSystemsOutput { - s.Marker = &v - return s +// Code returns the exception type name. +func (s NoFreeAddressesInSubnet) Code() string { + return "NoFreeAddressesInSubnet" } -// SetNextMarker sets the NextMarker field's value. -func (s *DescribeFileSystemsOutput) SetNextMarker(v string) *DescribeFileSystemsOutput { - s.NextMarker = &v - return s +// Message returns the exception's message. +func (s NoFreeAddressesInSubnet) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type DescribeLifecycleConfigurationInput struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoFreeAddressesInSubnet) OrigErr() error { + return nil +} - // The ID of the file system whose LifecycleConfiguration object you want to - // retrieve (String). - // - // FileSystemId is a required field - FileSystemId *string `location:"uri" locationName:"FileSystemId" type:"string" required:"true"` +func (s NoFreeAddressesInSubnet) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NoFreeAddressesInSubnet) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NoFreeAddressesInSubnet) RequestID() string { + return s.respMetadata.RequestID +} + +// Returned if the default file system policy is in effect for the EFS file +// system specified. +type PolicyNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + ErrorCode *string `min:"1" type:"string"` + + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s DescribeLifecycleConfigurationInput) String() string { +func (s PolicyNotFound) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeLifecycleConfigurationInput) GoString() string { +func (s PolicyNotFound) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLifecycleConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLifecycleConfigurationInput"} - if s.FileSystemId == nil { - invalidParams.Add(request.NewErrParamRequired("FileSystemId")) - } - if s.FileSystemId != nil && len(*s.FileSystemId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams +func newErrorPolicyNotFound(v protocol.ResponseMetadata) error { + return &PolicyNotFound{ + respMetadata: v, } - return nil } -// SetFileSystemId sets the FileSystemId field's value. -func (s *DescribeLifecycleConfigurationInput) SetFileSystemId(v string) *DescribeLifecycleConfigurationInput { - s.FileSystemId = &v - return s +// Code returns the exception type name. +func (s PolicyNotFound) Code() string { + return "PolicyNotFound" } -type DescribeLifecycleConfigurationOutput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s PolicyNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // An array of lifecycle management policies. Currently, EFS supports a maximum - // of one policy per file system. - LifecyclePolicies []*LifecyclePolicy `type:"list"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PolicyNotFound) OrigErr() error { + return nil } -// String returns the string representation -func (s DescribeLifecycleConfigurationOutput) String() string { - return awsutil.Prettify(s) +func (s PolicyNotFound) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// GoString returns the string representation -func (s DescribeLifecycleConfigurationOutput) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s PolicyNotFound) StatusCode() int { + return s.respMetadata.StatusCode } -// SetLifecyclePolicies sets the LifecyclePolicies field's value. -func (s *DescribeLifecycleConfigurationOutput) SetLifecyclePolicies(v []*LifecyclePolicy) *DescribeLifecycleConfigurationOutput { - s.LifecyclePolicies = v - return s +// RequestID returns the service's response RequestID for request. +func (s PolicyNotFound) RequestID() string { + return s.respMetadata.RequestID } -type DescribeMountTargetSecurityGroupsInput struct { +// The full POSIX identity, including the user ID, group ID, and any secondary +// group IDs, on the access point that is used for all file system operations +// performed by NFS clients using the access point. +type PosixUser struct { _ struct{} `type:"structure"` - // The ID of the mount target whose security groups you want to retrieve. + // The POSIX group ID used for all file system operations using this access + // point. // - // MountTargetId is a required field - MountTargetId *string `location:"uri" locationName:"MountTargetId" type:"string" required:"true"` + // Gid is a required field + Gid *int64 `type:"long" required:"true"` + + // Secondary POSIX group IDs used for all file system operations using this + // access point. + SecondaryGids []*int64 `type:"list"` + + // The POSIX user ID used for all file system operations using this access point. + // + // Uid is a required field + Uid *int64 `type:"long" required:"true"` } // String returns the string representation -func (s DescribeMountTargetSecurityGroupsInput) String() string { +func (s PosixUser) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeMountTargetSecurityGroupsInput) GoString() string { +func (s PosixUser) 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")) +func (s *PosixUser) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PosixUser"} + if s.Gid == nil { + invalidParams.Add(request.NewErrParamRequired("Gid")) } - if s.MountTargetId != nil && len(*s.MountTargetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MountTargetId", 1)) + if s.Uid == nil { + invalidParams.Add(request.NewErrParamRequired("Uid")) } if invalidParams.Len() > 0 { @@ -2308,74 +6193,71 @@ func (s *DescribeMountTargetSecurityGroupsInput) Validate() error { return nil } -// SetMountTargetId sets the MountTargetId field's value. -func (s *DescribeMountTargetSecurityGroupsInput) SetMountTargetId(v string) *DescribeMountTargetSecurityGroupsInput { - s.MountTargetId = &v +// SetGid sets the Gid field's value. +func (s *PosixUser) SetGid(v int64) *PosixUser { + s.Gid = &v return s } -type DescribeMountTargetSecurityGroupsOutput struct { - _ struct{} `type:"structure"` - - // An 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() +// SetSecondaryGids sets the SecondaryGids field's value. +func (s *PosixUser) SetSecondaryGids(v []*int64) *PosixUser { + s.SecondaryGids = v + return s } -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *DescribeMountTargetSecurityGroupsOutput) SetSecurityGroups(v []*string) *DescribeMountTargetSecurityGroupsOutput { - s.SecurityGroups = v +// SetUid sets the Uid field's value. +func (s *PosixUser) SetUid(v int64) *PosixUser { + s.Uid = &v return s } -type DescribeMountTargetsInput struct { +type PutFileSystemPolicyInput 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. Currently, - // this number is automatically set to 10, and other values are ignored. The - // response is paginated at 10 per page if you have more than 10 mount targets. - MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` + // (Optional) A flag to indicate whether to bypass the FileSystemPolicy lockout + // safety check. The policy lockout safety check determines whether the policy + // in the request will prevent the principal making the request will be locked + // out from making future PutFileSystemPolicy requests on the file system. Set + // BypassPolicyLockoutSafetyCheck to True only when you intend to prevent the + // principal that is making the request from making a subsequent PutFileSystemPolicy + // request on the file system. The default value is False. + BypassPolicyLockoutSafetyCheck *bool `type:"boolean"` + + // The ID of the EFS file system that you want to create or update the FileSystemPolicy + // for. + // + // FileSystemId is a required field + FileSystemId *string `location:"uri" locationName:"FileSystemId" type:"string" required:"true"` - // (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"` + // The FileSystemPolicy that you're creating. Accepts a JSON formatted policy + // definition. To find out more about the elements that make up a file system + // policy, see EFS Resource-based Policies (https://docs.aws.amazon.com/efs/latest/ug/access-control-overview.html#access-control-manage-access-intro-resource-policies). + // + // Policy is a required field + Policy *string `type:"string" required:"true"` } // String returns the string representation -func (s DescribeMountTargetsInput) String() string { +func (s PutFileSystemPolicyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeMountTargetsInput) GoString() string { +func (s PutFileSystemPolicyInput) 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)) +func (s *PutFileSystemPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutFileSystemPolicyInput"} + if s.FileSystemId == nil { + invalidParams.Add(request.NewErrParamRequired("FileSystemId")) + } + if s.FileSystemId != nil && len(*s.FileSystemId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 1)) + } + if s.Policy == nil { + invalidParams.Add(request.NewErrParamRequired("Policy")) } if invalidParams.Len() > 0 { @@ -2384,115 +6266,95 @@ func (s *DescribeMountTargetsInput) Validate() error { 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 +// SetBypassPolicyLockoutSafetyCheck sets the BypassPolicyLockoutSafetyCheck field's value. +func (s *PutFileSystemPolicyInput) SetBypassPolicyLockoutSafetyCheck(v bool) *PutFileSystemPolicyInput { + s.BypassPolicyLockoutSafetyCheck = &v return s } -// SetMaxItems sets the MaxItems field's value. -func (s *DescribeMountTargetsInput) SetMaxItems(v int64) *DescribeMountTargetsInput { - s.MaxItems = &v +// SetFileSystemId sets the FileSystemId field's value. +func (s *PutFileSystemPolicyInput) SetFileSystemId(v string) *PutFileSystemPolicyInput { + s.FileSystemId = &v return s } -// SetMountTargetId sets the MountTargetId field's value. -func (s *DescribeMountTargetsInput) SetMountTargetId(v string) *DescribeMountTargetsInput { - s.MountTargetId = &v +// SetPolicy sets the Policy field's value. +func (s *PutFileSystemPolicyInput) SetPolicy(v string) *PutFileSystemPolicyInput { + s.Policy = &v return s } -type DescribeMountTargetsOutput struct { +type PutFileSystemPolicyOutput 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"` + // Specifies the EFS file system to which the FileSystemPolicy applies. + FileSystemId *string `type:"string"` - // 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"` + // The JSON formatted FileSystemPolicy for the EFS file system. + Policy *string `type:"string"` } // String returns the string representation -func (s DescribeMountTargetsOutput) String() string { +func (s PutFileSystemPolicyOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeMountTargetsOutput) GoString() string { +func (s PutFileSystemPolicyOutput) 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 +// SetFileSystemId sets the FileSystemId field's value. +func (s *PutFileSystemPolicyOutput) SetFileSystemId(v string) *PutFileSystemPolicyOutput { + s.FileSystemId = &v return s } -// SetNextMarker sets the NextMarker field's value. -func (s *DescribeMountTargetsOutput) SetNextMarker(v string) *DescribeMountTargetsOutput { - s.NextMarker = &v +// SetPolicy sets the Policy field's value. +func (s *PutFileSystemPolicyOutput) SetPolicy(v string) *PutFileSystemPolicyOutput { + s.Policy = &v return s } -type DescribeTagsInput struct { +type PutLifecycleConfigurationInput struct { _ struct{} `type:"structure"` - // The ID of the file system whose tag set you want to retrieve. + // The ID of the file system for which you are creating the LifecycleConfiguration + // object (String). // // FileSystemId is a required field FileSystemId *string `location:"uri" locationName:"FileSystemId" type:"string" required:"true"` - // (Optional) An 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) The maximum number of file system tags to return in the response. - // Currently, this number is automatically set to 10, and other values are ignored. - // The response is paginated at 10 per page if you have more than 10 tags. - MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` + // An array of LifecyclePolicy objects that define the file system's LifecycleConfiguration + // object. A LifecycleConfiguration object tells lifecycle management when to + // transition files from the Standard storage class to the Infrequent Access + // storage class. + // + // LifecyclePolicies is a required field + LifecyclePolicies []*LifecyclePolicy `type:"list" required:"true"` } // String returns the string representation -func (s DescribeTagsInput) String() string { +func (s PutLifecycleConfigurationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeTagsInput) GoString() string { +func (s PutLifecycleConfigurationInput) 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"} +func (s *PutLifecycleConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutLifecycleConfigurationInput"} if s.FileSystemId == nil { invalidParams.Add(request.NewErrParamRequired("FileSystemId")) } if s.FileSystemId != nil && len(*s.FileSystemId) < 1 { invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 1)) } - if s.MaxItems != nil && *s.MaxItems < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + if s.LifecyclePolicies == nil { + invalidParams.Add(request.NewErrParamRequired("LifecyclePolicies")) } if invalidParams.Len() > 0 { @@ -2502,371 +6364,387 @@ func (s *DescribeTagsInput) Validate() error { } // SetFileSystemId sets the FileSystemId field's value. -func (s *DescribeTagsInput) SetFileSystemId(v string) *DescribeTagsInput { +func (s *PutLifecycleConfigurationInput) SetFileSystemId(v string) *PutLifecycleConfigurationInput { 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 +// SetLifecyclePolicies sets the LifecyclePolicies field's value. +func (s *PutLifecycleConfigurationInput) SetLifecyclePolicies(v []*LifecyclePolicy) *PutLifecycleConfigurationInput { + s.LifecyclePolicies = v return s } -type DescribeTagsOutput struct { +type PutLifecycleConfigurationOutput 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"` + // An array of lifecycle management policies. Currently, EFS supports a maximum + // of one policy per file system. + LifecyclePolicies []*LifecyclePolicy `type:"list"` } // String returns the string representation -func (s DescribeTagsOutput) String() string { +func (s PutLifecycleConfigurationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeTagsOutput) GoString() string { +func (s PutLifecycleConfigurationOutput) 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 +// SetLifecyclePolicies sets the LifecyclePolicies field's value. +func (s *PutLifecycleConfigurationOutput) SetLifecyclePolicies(v []*LifecyclePolicy) *PutLifecycleConfigurationOutput { + s.LifecyclePolicies = v return s } -// A description of the file system. -type FileSystemDescription struct { +// Specifies the directory on the Amazon EFS file system that the access point +// provides access to. The access point exposes the specified file system path +// as the root directory of your file system to applications using the access +// point. NFS clients using the access point can only access data in the access +// point's RootDirectory and it's subdirectories. +type RootDirectory struct { _ struct{} `type:"structure"` - // The 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" required:"true"` - - // The opaque string specified in the request. - // - // CreationToken is a required field - CreationToken *string `min:"1" type:"string" required:"true"` - - // A Boolean value that, if true, indicates that the file system is encrypted. - Encrypted *bool `type:"boolean"` - - // The ID of the file system, assigned by Amazon EFS. + // (Optional) Specifies the POSIX IDs and permissions to apply to the access + // point's RootDirectory. If the RootDirectory > Path specified does not exist, + // EFS creates the root directory using the CreationInfo settings when a client + // connects to an access point. When specifying the CreationInfo, you must provide + // values for all properties. // - // FileSystemId is a required field - FileSystemId *string `type:"string" required:"true"` + // If you do not provide CreationInfo and the specified RootDirectory > Path + // does not exist, attempts to mount the file system using the access point + // will fail. + CreationInfo *CreationInfo `type:"structure"` - // The ID of an AWS Key Management Service (AWS KMS) customer master key (CMK) - // that was used to protect the encrypted file system. - KmsKeyId *string `min:"1" type:"string"` + // Specifies the path on the EFS file system to expose as the root directory + // to NFS clients using the access point to access the EFS file system. A path + // can have up to four subdirectories. If the specified path does not exist, + // you are required to provide the CreationInfo. + Path *string `min:"1" type:"string"` +} - // The lifecycle phase of the file system. - // - // LifeCycleState is a required field - LifeCycleState *string `type:"string" required:"true" enum:"LifeCycleState"` +// String returns the string representation +func (s RootDirectory) String() string { + return awsutil.Prettify(s) +} - // You can add tags to a file system, including a Name tag. For more information, - // see CreateFileSystem. If the file system has a Name tag, Amazon EFS returns - // the value in this field. - Name *string `type:"string"` +// GoString returns the string representation +func (s RootDirectory) GoString() string { + return s.String() +} - // The 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"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *RootDirectory) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RootDirectory"} + if s.Path != nil && len(*s.Path) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Path", 1)) + } + if s.CreationInfo != nil { + if err := s.CreationInfo.Validate(); err != nil { + invalidParams.AddNested("CreationInfo", err.(request.ErrInvalidParams)) + } + } - // The 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"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // The performance mode of the file system. - // - // PerformanceMode is a required field - PerformanceMode *string `type:"string" required:"true" enum:"PerformanceMode"` +// SetCreationInfo sets the CreationInfo field's value. +func (s *RootDirectory) SetCreationInfo(v *CreationInfo) *RootDirectory { + s.CreationInfo = v + return s +} - // The throughput, measured in MiB/s, that you want to provision for a file - // system. Valid values are 1-1024. Required if ThroughputMode is set to provisioned. - // The limit on throughput is 1024 MiB/s. You can get these limits increased - // by contacting AWS Support. For more information, see Amazon EFS Limits That - // You Can Increase (https://docs.aws.amazon.com/efs/latest/ug/limits.html#soft-limits) - // in the Amazon EFS User Guide. - ProvisionedThroughputInMibps *float64 `min:"1" type:"double"` +// SetPath sets the Path field's value. +func (s *RootDirectory) SetPath(v string) *RootDirectory { + s.Path = &v + return s +} - // The 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. The Timestamp value is the integer number of seconds since - // 1970-01-01T00:00:00Z. The SizeInBytes value doesn't 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, SizeInBytes represents - // 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 that the file - // system was at any point in time. - // - // SizeInBytes is a required field - SizeInBytes *FileSystemSize `type:"structure" required:"true"` +// Returned if the size of SecurityGroups specified in the request is greater +// than five. +type SecurityGroupLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The tags associated with the file system, presented as an array of Tag objects. - // - // Tags is a required field - Tags []*Tag `type:"list" required:"true"` + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` - // The throughput mode for a file system. There are two throughput modes to - // choose from for your file system: bursting and provisioned. If you set ThroughputMode - // to provisioned, you must also set a value for ProvisionedThroughPutInMibps. - // You can decrease your file system's throughput in Provisioned Throughput - // mode or change between the throughput modes as long as it’s been more than - // 24 hours since the last decrease or throughput mode change. - ThroughputMode *string `type:"string" enum:"ThroughputMode"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s FileSystemDescription) String() string { +func (s SecurityGroupLimitExceeded) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s FileSystemDescription) GoString() string { +func (s SecurityGroupLimitExceeded) 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 +func newErrorSecurityGroupLimitExceeded(v protocol.ResponseMetadata) error { + return &SecurityGroupLimitExceeded{ + respMetadata: v, + } } -// SetCreationToken sets the CreationToken field's value. -func (s *FileSystemDescription) SetCreationToken(v string) *FileSystemDescription { - s.CreationToken = &v - return s +// Code returns the exception type name. +func (s SecurityGroupLimitExceeded) Code() string { + return "SecurityGroupLimitExceeded" } -// SetEncrypted sets the Encrypted field's value. -func (s *FileSystemDescription) SetEncrypted(v bool) *FileSystemDescription { - s.Encrypted = &v - return s +// Message returns the exception's message. +func (s SecurityGroupLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetFileSystemId sets the FileSystemId field's value. -func (s *FileSystemDescription) SetFileSystemId(v string) *FileSystemDescription { - s.FileSystemId = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SecurityGroupLimitExceeded) OrigErr() error { + return nil } -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *FileSystemDescription) SetKmsKeyId(v string) *FileSystemDescription { - s.KmsKeyId = &v - return s +func (s SecurityGroupLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetLifeCycleState sets the LifeCycleState field's value. -func (s *FileSystemDescription) SetLifeCycleState(v string) *FileSystemDescription { - s.LifeCycleState = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s SecurityGroupLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode } -// SetName sets the Name field's value. -func (s *FileSystemDescription) SetName(v string) *FileSystemDescription { - s.Name = &v - return s +// RequestID returns the service's response RequestID for request. +func (s SecurityGroupLimitExceeded) RequestID() string { + return s.respMetadata.RequestID } -// SetNumberOfMountTargets sets the NumberOfMountTargets field's value. -func (s *FileSystemDescription) SetNumberOfMountTargets(v int64) *FileSystemDescription { - s.NumberOfMountTargets = &v - return s +// Returned if one of the specified security groups doesn't exist in the subnet's +// VPC. +type SecurityGroupNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` } -// SetOwnerId sets the OwnerId field's value. -func (s *FileSystemDescription) SetOwnerId(v string) *FileSystemDescription { - s.OwnerId = &v - return s +// String returns the string representation +func (s SecurityGroupNotFound) String() string { + return awsutil.Prettify(s) } -// SetPerformanceMode sets the PerformanceMode field's value. -func (s *FileSystemDescription) SetPerformanceMode(v string) *FileSystemDescription { - s.PerformanceMode = &v - return s +// GoString returns the string representation +func (s SecurityGroupNotFound) GoString() string { + return s.String() } -// SetProvisionedThroughputInMibps sets the ProvisionedThroughputInMibps field's value. -func (s *FileSystemDescription) SetProvisionedThroughputInMibps(v float64) *FileSystemDescription { - s.ProvisionedThroughputInMibps = &v - return s +func newErrorSecurityGroupNotFound(v protocol.ResponseMetadata) error { + return &SecurityGroupNotFound{ + respMetadata: v, + } } -// SetSizeInBytes sets the SizeInBytes field's value. -func (s *FileSystemDescription) SetSizeInBytes(v *FileSystemSize) *FileSystemDescription { - s.SizeInBytes = v - return s +// Code returns the exception type name. +func (s SecurityGroupNotFound) Code() string { + return "SecurityGroupNotFound" } -// SetTags sets the Tags field's value. -func (s *FileSystemDescription) SetTags(v []*Tag) *FileSystemDescription { - s.Tags = v - return s +// Message returns the exception's message. +func (s SecurityGroupNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetThroughputMode sets the ThroughputMode field's value. -func (s *FileSystemDescription) SetThroughputMode(v string) *FileSystemDescription { - s.ThroughputMode = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SecurityGroupNotFound) OrigErr() error { + return nil } -// The 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. The value doesn't 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 represents 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. -type FileSystemSize struct { - _ struct{} `type:"structure"` +func (s SecurityGroupNotFound) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} - // The 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"` +// Status code returns the HTTP status code for the request's response error. +func (s SecurityGroupNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} - // The latest known metered size (in bytes) of data stored in the file system. - // - // Value is a required field - Value *int64 `type:"long" required:"true"` +// RequestID returns the service's response RequestID for request. +func (s SecurityGroupNotFound) RequestID() string { + return s.respMetadata.RequestID +} - // The latest known metered size (in bytes) of data stored in the Infrequent - // Access storage class. - ValueInIA *int64 `type:"long"` +// Returned if there is no subnet with ID SubnetId provided in the request. +type SubnetNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The latest known metered size (in bytes) of data stored in the Standard storage - // class. - ValueInStandard *int64 `type:"long"` + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s FileSystemSize) String() string { +func (s SubnetNotFound) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s FileSystemSize) GoString() string { +func (s SubnetNotFound) 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 +func newErrorSubnetNotFound(v protocol.ResponseMetadata) error { + return &SubnetNotFound{ + respMetadata: v, + } } -// SetValue sets the Value field's value. -func (s *FileSystemSize) SetValue(v int64) *FileSystemSize { - s.Value = &v - return s +// Code returns the exception type name. +func (s SubnetNotFound) Code() string { + return "SubnetNotFound" } -// SetValueInIA sets the ValueInIA field's value. -func (s *FileSystemSize) SetValueInIA(v int64) *FileSystemSize { - s.ValueInIA = &v - return s +// Message returns the exception's message. +func (s SubnetNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetValueInStandard sets the ValueInStandard field's value. -func (s *FileSystemSize) SetValueInStandard(v int64) *FileSystemSize { - s.ValueInStandard = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SubnetNotFound) OrigErr() error { + return nil } -// Describes a policy used by EFS lifecycle management to transition files to -// the Infrequent Access (IA) storage class. -type LifecyclePolicy struct { +func (s SubnetNotFound) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SubnetNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SubnetNotFound) RequestID() string { + return s.respMetadata.RequestID +} + +// A tag is a key-value pair. Allowed characters are letters, white space, and +// numbers that can be represented in UTF-8, and the following characters:+ +// - = . _ : / +type Tag struct { _ struct{} `type:"structure"` - // A value that describes the period of time that a file is not accessed, after - // which it transitions to the IA storage class. Metadata operations such as - // listing the contents of a directory don't count as file access events. - TransitionToIA *string `type:"string" enum:"TransitionToIARules"` + // The tag key (String). The key can't start with aws:. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // The value of the tag key. + // + // Value is a required field + Value *string `type:"string" required:"true"` } // String returns the string representation -func (s LifecyclePolicy) String() string { +func (s Tag) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LifecyclePolicy) GoString() string { +func (s Tag) GoString() string { return s.String() } -// SetTransitionToIA sets the TransitionToIA field's value. -func (s *LifecyclePolicy) SetTransitionToIA(v string) *LifecyclePolicy { - s.TransitionToIA = &v +// 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 } -type ModifyMountTargetSecurityGroupsInput struct { +// SetValue sets the Value field's value. +func (s *Tag) SetValue(v string) *Tag { + s.Value = &v + return s +} + +type TagResourceInput struct { _ struct{} `type:"structure"` - // The ID of the mount target whose security groups you want to modify. + // The ID specifying the EFS resource that you want to create a tag for. // - // MountTargetId is a required field - MountTargetId *string `location:"uri" locationName:"MountTargetId" type:"string" required:"true"` + // ResourceId is a required field + ResourceId *string `location:"uri" locationName:"ResourceId" type:"string" required:"true"` - // An array of up to five VPC security group IDs. - SecurityGroups []*string `type:"list"` + // Tags is a required field + Tags []*Tag `type:"list" required:"true"` } // String returns the string representation -func (s ModifyMountTargetSecurityGroupsInput) String() string { +func (s TagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModifyMountTargetSecurityGroupsInput) GoString() string { +func (s TagResourceInput) 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")) +func (s *TagResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) } - if s.MountTargetId != nil && len(*s.MountTargetId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MountTargetId", 1)) + if s.ResourceId != nil && len(*s.ResourceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceId", 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 { @@ -2875,240 +6753,244 @@ func (s *ModifyMountTargetSecurityGroupsInput) Validate() error { return nil } -// SetMountTargetId sets the MountTargetId field's value. -func (s *ModifyMountTargetSecurityGroupsInput) SetMountTargetId(v string) *ModifyMountTargetSecurityGroupsInput { - s.MountTargetId = &v +// SetResourceId sets the ResourceId field's value. +func (s *TagResourceInput) SetResourceId(v string) *TagResourceInput { + s.ResourceId = &v return s } -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *ModifyMountTargetSecurityGroupsInput) SetSecurityGroups(v []*string) *ModifyMountTargetSecurityGroupsInput { - s.SecurityGroups = v +// SetTags sets the Tags field's value. +func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { + s.Tags = v return s } -type ModifyMountTargetSecurityGroupsOutput struct { +type TagResourceOutput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s ModifyMountTargetSecurityGroupsOutput) String() string { +func (s TagResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModifyMountTargetSecurityGroupsOutput) GoString() string { +func (s TagResourceOutput) GoString() string { return s.String() } -// Provides a description of a mount target. -type MountTargetDescription struct { - _ struct{} `type:"structure"` - - // The 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 can be mounted by using 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"` - - // The ID of the network interface that Amazon EFS created when it created the - // mount target. - NetworkInterfaceId *string `type:"string"` +// Returned if the throughput mode or amount of provisioned throughput can't +// be changed because the throughput limit of 1024 MiB/s has been reached. +type ThroughputLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // AWS account ID that owns the resource. - OwnerId *string `type:"string"` + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` - // The ID of the mount target's subnet. - // - // SubnetId is a required field - SubnetId *string `type:"string" required:"true"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s MountTargetDescription) String() string { +func (s ThroughputLimitExceeded) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MountTargetDescription) GoString() string { +func (s ThroughputLimitExceeded) GoString() string { return s.String() } -// SetFileSystemId sets the FileSystemId field's value. -func (s *MountTargetDescription) SetFileSystemId(v string) *MountTargetDescription { - s.FileSystemId = &v - return s +func newErrorThroughputLimitExceeded(v protocol.ResponseMetadata) error { + return &ThroughputLimitExceeded{ + respMetadata: v, + } } -// SetIpAddress sets the IpAddress field's value. -func (s *MountTargetDescription) SetIpAddress(v string) *MountTargetDescription { - s.IpAddress = &v - return s +// Code returns the exception type name. +func (s ThroughputLimitExceeded) Code() string { + return "ThroughputLimitExceeded" } -// SetLifeCycleState sets the LifeCycleState field's value. -func (s *MountTargetDescription) SetLifeCycleState(v string) *MountTargetDescription { - s.LifeCycleState = &v - return s +// Message returns the exception's message. +func (s ThroughputLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetMountTargetId sets the MountTargetId field's value. -func (s *MountTargetDescription) SetMountTargetId(v string) *MountTargetDescription { - s.MountTargetId = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ThroughputLimitExceeded) OrigErr() error { + return nil } -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *MountTargetDescription) SetNetworkInterfaceId(v string) *MountTargetDescription { - s.NetworkInterfaceId = &v - return s +func (s ThroughputLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetOwnerId sets the OwnerId field's value. -func (s *MountTargetDescription) SetOwnerId(v string) *MountTargetDescription { - s.OwnerId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ThroughputLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode } -// SetSubnetId sets the SubnetId field's value. -func (s *MountTargetDescription) SetSubnetId(v string) *MountTargetDescription { - s.SubnetId = &v - return s +// RequestID returns the service's response RequestID for request. +func (s ThroughputLimitExceeded) RequestID() string { + return s.respMetadata.RequestID } -type PutLifecycleConfigurationInput struct { - _ struct{} `type:"structure"` +// Returned if you don’t wait at least 24 hours before changing the throughput +// mode, or decreasing the Provisioned Throughput value. +type TooManyRequests struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The ID of the file system for which you are creating the LifecycleConfiguration - // object (String). - // - // FileSystemId is a required field - FileSystemId *string `location:"uri" locationName:"FileSystemId" type:"string" required:"true"` + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` - // An array of LifecyclePolicy objects that define the file system's LifecycleConfiguration - // object. A LifecycleConfiguration object tells lifecycle management when to - // transition files from the Standard storage class to the Infrequent Access - // storage class. - // - // LifecyclePolicies is a required field - LifecyclePolicies []*LifecyclePolicy `type:"list" required:"true"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s PutLifecycleConfigurationInput) String() string { +func (s TooManyRequests) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutLifecycleConfigurationInput) GoString() string { +func (s TooManyRequests) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutLifecycleConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutLifecycleConfigurationInput"} - if s.FileSystemId == nil { - invalidParams.Add(request.NewErrParamRequired("FileSystemId")) - } - if s.FileSystemId != nil && len(*s.FileSystemId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 1)) - } - if s.LifecyclePolicies == nil { - invalidParams.Add(request.NewErrParamRequired("LifecyclePolicies")) +func newErrorTooManyRequests(v protocol.ResponseMetadata) error { + return &TooManyRequests{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s TooManyRequests) Code() string { + return "TooManyRequests" +} + +// Message returns the exception's message. +func (s TooManyRequests) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequests) OrigErr() error { return nil } -// SetFileSystemId sets the FileSystemId field's value. -func (s *PutLifecycleConfigurationInput) SetFileSystemId(v string) *PutLifecycleConfigurationInput { - s.FileSystemId = &v - return s +func (s TooManyRequests) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetLifecyclePolicies sets the LifecyclePolicies field's value. -func (s *PutLifecycleConfigurationInput) SetLifecyclePolicies(v []*LifecyclePolicy) *PutLifecycleConfigurationInput { - s.LifecyclePolicies = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequests) StatusCode() int { + return s.respMetadata.StatusCode } -type PutLifecycleConfigurationOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s TooManyRequests) RequestID() string { + return s.respMetadata.RequestID +} - // An array of lifecycle management policies. Currently, EFS supports a maximum - // of one policy per file system. - LifecyclePolicies []*LifecyclePolicy `type:"list"` +type UnsupportedAvailabilityZone struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // ErrorCode is a required field + ErrorCode *string `min:"1" type:"string" required:"true"` + + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s PutLifecycleConfigurationOutput) String() string { +func (s UnsupportedAvailabilityZone) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutLifecycleConfigurationOutput) GoString() string { +func (s UnsupportedAvailabilityZone) GoString() string { return s.String() } -// SetLifecyclePolicies sets the LifecyclePolicies field's value. -func (s *PutLifecycleConfigurationOutput) SetLifecyclePolicies(v []*LifecyclePolicy) *PutLifecycleConfigurationOutput { - s.LifecyclePolicies = v - return s +func newErrorUnsupportedAvailabilityZone(v protocol.ResponseMetadata) error { + return &UnsupportedAvailabilityZone{ + respMetadata: v, + } } -// A tag is a key-value pair. Allowed characters are letters, white space, and -// numbers that can be represented in UTF-8, and the following characters:+ -// - = . _ : / -type Tag struct { +// Code returns the exception type name. +func (s UnsupportedAvailabilityZone) Code() string { + return "UnsupportedAvailabilityZone" +} + +// Message returns the exception's message. +func (s UnsupportedAvailabilityZone) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedAvailabilityZone) OrigErr() error { + return nil +} + +func (s UnsupportedAvailabilityZone) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedAvailabilityZone) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedAvailabilityZone) RequestID() string { + return s.respMetadata.RequestID +} + +type UntagResourceInput struct { _ struct{} `type:"structure"` - // The tag key (String). The key can't start with aws:. + // Specifies the EFS resource that you want to remove tags from. // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` + // ResourceId is a required field + ResourceId *string `location:"uri" locationName:"ResourceId" type:"string" required:"true"` - // The value of the tag key. - // - // Value is a required field - Value *string `type:"string" required:"true"` + // The keys of the key:value tag pairs that you want to remove from the specified + // EFS resource. + TagKeys []*string `min:"1" type:"list"` } // String returns the string representation -func (s Tag) String() string { +func (s UntagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Tag) GoString() string { +func (s UntagResourceInput) 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")) +func (s *UntagResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + if s.ResourceId != nil && len(*s.ResourceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) + if s.TagKeys != nil && len(s.TagKeys) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TagKeys", 1)) } if invalidParams.Len() > 0 { @@ -3117,18 +6999,32 @@ func (s *Tag) Validate() error { return nil } -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v +// SetResourceId sets the ResourceId field's value. +func (s *UntagResourceInput) SetResourceId(v string) *UntagResourceInput { + s.ResourceId = &v return s } -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v +// SetTagKeys sets the TagKeys field's value. +func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { + s.TagKeys = v return s } +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() +} + type UpdateFileSystemInput struct { _ struct{} `type:"structure"` @@ -3414,6 +7310,9 @@ const ( ) const ( + // TransitionToIARulesAfter7Days is a TransitionToIARules enum value + TransitionToIARulesAfter7Days = "AFTER_7_DAYS" + // TransitionToIARulesAfter14Days is a TransitionToIARules enum value TransitionToIARulesAfter14Days = "AFTER_14_DAYS" 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 index 7a7eb3b1bf7..bccb1f84ff2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/efs/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/efs/errors.go @@ -2,8 +2,33 @@ package efs +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( + // ErrCodeAccessPointAlreadyExists for service response error code + // "AccessPointAlreadyExists". + // + // Returned if the access point you are trying to create already exists, with + // the creation token you provided in the request. + ErrCodeAccessPointAlreadyExists = "AccessPointAlreadyExists" + + // ErrCodeAccessPointLimitExceeded for service response error code + // "AccessPointLimitExceeded". + // + // Returned if the AWS account has already created the maximum number of access + // points allowed per file system. + ErrCodeAccessPointLimitExceeded = "AccessPointLimitExceeded" + + // ErrCodeAccessPointNotFound for service response error code + // "AccessPointNotFound". + // + // Returned if the specified AccessPointId value doesn't exist in the requester's + // AWS account. + ErrCodeAccessPointNotFound = "AccessPointNotFound" + // ErrCodeBadRequest for service response error code // "BadRequest". // @@ -73,6 +98,14 @@ const ( // Returned if an error occurred on the server side. ErrCodeInternalServerError = "InternalServerError" + // ErrCodeInvalidPolicyException for service response error code + // "InvalidPolicyException". + // + // Returned if the FileSystemPolicy is is malformed or contains an error such + // as an invalid parameter value or a missing required parameter. Returned in + // the case of a policy lockout safety check error. + ErrCodeInvalidPolicyException = "InvalidPolicyException" + // ErrCodeIpAddressInUse for service response error code // "IpAddressInUse". // @@ -112,6 +145,13 @@ const ( // IP addresses in the subnet. ErrCodeNoFreeAddressesInSubnet = "NoFreeAddressesInSubnet" + // ErrCodePolicyNotFound for service response error code + // "PolicyNotFound". + // + // Returned if the default file system policy is in effect for the EFS file + // system specified. + ErrCodePolicyNotFound = "PolicyNotFound" + // ErrCodeSecurityGroupLimitExceeded for service response error code // "SecurityGroupLimitExceeded". // @@ -150,3 +190,32 @@ const ( // "UnsupportedAvailabilityZone". ErrCodeUnsupportedAvailabilityZone = "UnsupportedAvailabilityZone" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessPointAlreadyExists": newErrorAccessPointAlreadyExists, + "AccessPointLimitExceeded": newErrorAccessPointLimitExceeded, + "AccessPointNotFound": newErrorAccessPointNotFound, + "BadRequest": newErrorBadRequest, + "DependencyTimeout": newErrorDependencyTimeout, + "FileSystemAlreadyExists": newErrorFileSystemAlreadyExists, + "FileSystemInUse": newErrorFileSystemInUse, + "FileSystemLimitExceeded": newErrorFileSystemLimitExceeded, + "FileSystemNotFound": newErrorFileSystemNotFound, + "IncorrectFileSystemLifeCycleState": newErrorIncorrectFileSystemLifeCycleState, + "IncorrectMountTargetState": newErrorIncorrectMountTargetState, + "InsufficientThroughputCapacity": newErrorInsufficientThroughputCapacity, + "InternalServerError": newErrorInternalServerError, + "InvalidPolicyException": newErrorInvalidPolicyException, + "IpAddressInUse": newErrorIpAddressInUse, + "MountTargetConflict": newErrorMountTargetConflict, + "MountTargetNotFound": newErrorMountTargetNotFound, + "NetworkInterfaceLimitExceeded": newErrorNetworkInterfaceLimitExceeded, + "NoFreeAddressesInSubnet": newErrorNoFreeAddressesInSubnet, + "PolicyNotFound": newErrorPolicyNotFound, + "SecurityGroupLimitExceeded": newErrorSecurityGroupLimitExceeded, + "SecurityGroupNotFound": newErrorSecurityGroupNotFound, + "SubnetNotFound": newErrorSubnetNotFound, + "ThroughputLimitExceeded": newErrorThroughputLimitExceeded, + "TooManyRequests": newErrorTooManyRequests, + "UnsupportedAvailabilityZone": newErrorUnsupportedAvailabilityZone, +} 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 index 6b1a11c900a..ac105c46ec6 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/efs/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/efs/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "elasticfilesystem" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "EFS" // ServiceID is a unique identifer of a specific service. + ServiceID = "EFS" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the EFS client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a EFS client from just a session. // svc := efs.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *EFS { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *EFS { svc := &EFS{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-02-01", }, @@ -71,7 +75,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/eks/api.go b/vendor/github.com/aws/aws-sdk-go/service/eks/api.go index bf3bea5d7db..254927a4399 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/eks/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/eks/api.go @@ -3,6 +3,7 @@ package eks import ( + "fmt" "time" "github.com/aws/aws-sdk-go/aws" @@ -105,29 +106,29 @@ func (c *EKS) CreateClusterRequest(input *CreateClusterInput) (req *request.Requ // See the AWS API reference guide for Amazon Elastic Kubernetes Service's // API operation CreateCluster for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The specified resource is in use. // -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" +// * ResourceLimitExceededException // You have encountered a service limit on the specified resource. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClientException "ClientException" +// * ClientException // These errors are usually caused by a client action. Actions can include using // an action or resource on behalf of a user that doesn't have permissions to // use the action or resource or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is unavailable. Back off and retry the operation. // -// * ErrCodeUnsupportedAvailabilityZoneException "UnsupportedAvailabilityZoneException" +// * UnsupportedAvailabilityZoneException // At least one of your specified cluster subnets is in an Availability Zone // that does not support Amazon EKS. The exception output specifies the supported // Availability Zones for your account, from which you can choose subnets for @@ -155,57 +156,81 @@ func (c *EKS) CreateClusterWithContext(ctx aws.Context, input *CreateClusterInpu return out, req.Send() } -const opDeleteCluster = "DeleteCluster" +const opCreateFargateProfile = "CreateFargateProfile" -// DeleteClusterRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCluster operation. The "output" return +// CreateFargateProfileRequest generates a "aws/request.Request" representing the +// client's request for the CreateFargateProfile operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteCluster for more information on using the DeleteCluster +// See CreateFargateProfile for more information on using the CreateFargateProfile // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteClusterRequest method. -// req, resp := client.DeleteClusterRequest(params) +// // Example sending a request using the CreateFargateProfileRequest method. +// req, resp := client.CreateFargateProfileRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteCluster -func (c *EKS) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Request, output *DeleteClusterOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateFargateProfile +func (c *EKS) CreateFargateProfileRequest(input *CreateFargateProfileInput) (req *request.Request, output *CreateFargateProfileOutput) { op := &request.Operation{ - Name: opDeleteCluster, - HTTPMethod: "DELETE", - HTTPPath: "/clusters/{name}", + Name: opCreateFargateProfile, + HTTPMethod: "POST", + HTTPPath: "/clusters/{name}/fargate-profiles", } if input == nil { - input = &DeleteClusterInput{} + input = &CreateFargateProfileInput{} } - output = &DeleteClusterOutput{} + output = &CreateFargateProfileOutput{} req = c.newRequest(op, input, output) return } -// DeleteCluster API operation for Amazon Elastic Kubernetes Service. +// CreateFargateProfile API operation for Amazon Elastic Kubernetes Service. +// +// Creates an AWS Fargate profile for your Amazon EKS cluster. You must have +// at least one Fargate profile in a cluster to be able to run pods on Fargate. +// +// The Fargate profile allows an administrator to declare which pods run on +// Fargate and specify which pods run on which Fargate profile. This declaration +// is done through the profile’s selectors. Each profile can have up to five +// selectors that contain a namespace and labels. A namespace is required for +// every selector. The label field consists of multiple optional key-value pairs. +// Pods that match the selectors are scheduled on Fargate. If a to-be-scheduled +// pod matches any of the selectors in the Fargate profile, then that pod is +// run on Fargate. +// +// When you create a Fargate profile, you must specify a pod execution role +// to use with the pods that are scheduled with the profile. This role is added +// to the cluster's Kubernetes Role Based Access Control (https://kubernetes.io/docs/admin/authorization/rbac/) +// (RBAC) for authorization so that the kubelet that is running on the Fargate +// infrastructure can register with your Amazon EKS cluster so that it can appear +// in your cluster as a node. The pod execution role also provides IAM permissions +// to the Fargate infrastructure to allow read access to Amazon ECR image repositories. +// For more information, see Pod Execution Role (https://docs.aws.amazon.com/eks/latest/userguide/pod-execution-role.html) +// in the Amazon EKS User Guide. // -// Deletes the Amazon EKS cluster control plane. +// Fargate profiles are immutable. However, you can create a new updated profile +// to replace an existing profile and then delete the original after the updated +// profile has finished creating. // -// If you have active services in your cluster that are associated with a load -// balancer, you must delete those services before deleting the cluster so that -// the load balancers are deleted properly. Otherwise, you can have orphaned -// resources in your VPC that prevent you from being able to delete the VPC. -// For more information, see Deleting a Cluster (https://docs.aws.amazon.com/eks/latest/userguide/delete-cluster.html) +// If any Fargate profiles in a cluster are in the DELETING status, you must +// wait for that Fargate profile to finish deleting before you can create any +// other profiles in that cluster. +// +// For more information, see AWS Fargate Profile (https://docs.aws.amazon.com/eks/latest/userguide/fargate-profile.html) // in the Amazon EKS User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -213,1525 +238,4884 @@ func (c *EKS) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Requ // the error. // // See the AWS API reference guide for Amazon Elastic Kubernetes Service's -// API operation DeleteCluster for usage and error information. +// API operation CreateFargateProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" -// The specified resource is in use. +// Returned Error Types: +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource could not be found. You can view your available clusters -// with ListClusters. Amazon EKS clusters are Region-specific. +// * InvalidRequestException +// The request is invalid given the state of the cluster. Check the state of +// the cluster and the associated operations. // -// * ErrCodeClientException "ClientException" +// * ClientException // These errors are usually caused by a client action. Actions can include using // an action or resource on behalf of a user that doesn't have permissions to // use the action or resource or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service is unavailable. Back off and retry the operation. +// * ResourceLimitExceededException +// You have encountered a service limit on the specified resource. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteCluster -func (c *EKS) DeleteCluster(input *DeleteClusterInput) (*DeleteClusterOutput, error) { - req, out := c.DeleteClusterRequest(input) +// * UnsupportedAvailabilityZoneException +// At least one of your specified cluster subnets is in an Availability Zone +// that does not support Amazon EKS. The exception output specifies the supported +// Availability Zones for your account, from which you can choose subnets for +// your cluster. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateFargateProfile +func (c *EKS) CreateFargateProfile(input *CreateFargateProfileInput) (*CreateFargateProfileOutput, error) { + req, out := c.CreateFargateProfileRequest(input) return out, req.Send() } -// DeleteClusterWithContext is the same as DeleteCluster with the addition of +// CreateFargateProfileWithContext is the same as CreateFargateProfile with the addition of // the ability to pass a context and additional request options. // -// See DeleteCluster for details on how to use this API operation. +// See CreateFargateProfile for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EKS) DeleteClusterWithContext(ctx aws.Context, input *DeleteClusterInput, opts ...request.Option) (*DeleteClusterOutput, error) { - req, out := c.DeleteClusterRequest(input) +func (c *EKS) CreateFargateProfileWithContext(ctx aws.Context, input *CreateFargateProfileInput, opts ...request.Option) (*CreateFargateProfileOutput, error) { + req, out := c.CreateFargateProfileRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeCluster = "DescribeCluster" +const opCreateNodegroup = "CreateNodegroup" -// DescribeClusterRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCluster operation. The "output" return +// CreateNodegroupRequest generates a "aws/request.Request" representing the +// client's request for the CreateNodegroup operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeCluster for more information on using the DescribeCluster +// See CreateNodegroup for more information on using the CreateNodegroup // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeClusterRequest method. -// req, resp := client.DescribeClusterRequest(params) +// // Example sending a request using the CreateNodegroupRequest method. +// req, resp := client.CreateNodegroupRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeCluster -func (c *EKS) DescribeClusterRequest(input *DescribeClusterInput) (req *request.Request, output *DescribeClusterOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateNodegroup +func (c *EKS) CreateNodegroupRequest(input *CreateNodegroupInput) (req *request.Request, output *CreateNodegroupOutput) { op := &request.Operation{ - Name: opDescribeCluster, - HTTPMethod: "GET", - HTTPPath: "/clusters/{name}", + Name: opCreateNodegroup, + HTTPMethod: "POST", + HTTPPath: "/clusters/{name}/node-groups", } if input == nil { - input = &DescribeClusterInput{} + input = &CreateNodegroupInput{} } - output = &DescribeClusterOutput{} + output = &CreateNodegroupOutput{} req = c.newRequest(op, input, output) return } -// DescribeCluster API operation for Amazon Elastic Kubernetes Service. -// -// Returns descriptive information about an Amazon EKS cluster. +// CreateNodegroup API operation for Amazon Elastic Kubernetes Service. // -// The API server endpoint and certificate authority data returned by this operation -// are required for kubelet and kubectl to communicate with your Kubernetes -// API server. For more information, see Create a kubeconfig for Amazon EKS -// (https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html). +// Creates a managed worker node group for an Amazon EKS cluster. You can only +// create a node group for your cluster that is equal to the current Kubernetes +// version for the cluster. All node groups are created with the latest AMI +// release version for the respective minor Kubernetes version of the cluster. // -// The API server endpoint and certificate authority data aren't available until -// the cluster reaches the ACTIVE state. +// An Amazon EKS managed node group is an Amazon EC2 Auto Scaling group and +// associated Amazon EC2 instances that are managed by AWS for an Amazon EKS +// cluster. Each node group uses a version of the Amazon EKS-optimized Amazon +// Linux 2 AMI. For more information, see Managed Node Groups (https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html) +// in the Amazon EKS User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Elastic Kubernetes Service's -// API operation DescribeCluster for usage and error information. +// API operation CreateNodegroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource could not be found. You can view your available clusters -// with ListClusters. Amazon EKS clusters are Region-specific. +// Returned Error Types: +// * ResourceInUseException +// The specified resource is in use. +// +// * ResourceLimitExceededException +// You have encountered a service limit on the specified resource. +// +// * InvalidRequestException +// The request is invalid given the state of the cluster. Check the state of +// the cluster and the associated operations. // -// * ErrCodeClientException "ClientException" +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ClientException // These errors are usually caused by a client action. Actions can include using // an action or resource on behalf of a user that doesn't have permissions to // use the action or resource or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is unavailable. Back off and retry the operation. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeCluster -func (c *EKS) DescribeCluster(input *DescribeClusterInput) (*DescribeClusterOutput, error) { - req, out := c.DescribeClusterRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/CreateNodegroup +func (c *EKS) CreateNodegroup(input *CreateNodegroupInput) (*CreateNodegroupOutput, error) { + req, out := c.CreateNodegroupRequest(input) return out, req.Send() } -// DescribeClusterWithContext is the same as DescribeCluster with the addition of +// CreateNodegroupWithContext is the same as CreateNodegroup with the addition of // the ability to pass a context and additional request options. // -// See DescribeCluster for details on how to use this API operation. +// See CreateNodegroup for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EKS) DescribeClusterWithContext(ctx aws.Context, input *DescribeClusterInput, opts ...request.Option) (*DescribeClusterOutput, error) { - req, out := c.DescribeClusterRequest(input) +func (c *EKS) CreateNodegroupWithContext(ctx aws.Context, input *CreateNodegroupInput, opts ...request.Option) (*CreateNodegroupOutput, error) { + req, out := c.CreateNodegroupRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeUpdate = "DescribeUpdate" +const opDeleteCluster = "DeleteCluster" -// DescribeUpdateRequest generates a "aws/request.Request" representing the -// client's request for the DescribeUpdate operation. The "output" return +// DeleteClusterRequest generates a "aws/request.Request" representing the +// client's request for the DeleteCluster operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeUpdate for more information on using the DescribeUpdate +// See DeleteCluster for more information on using the DeleteCluster // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeUpdateRequest method. -// req, resp := client.DescribeUpdateRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeUpdate -func (c *EKS) DescribeUpdateRequest(input *DescribeUpdateInput) (req *request.Request, output *DescribeUpdateOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteCluster +func (c *EKS) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Request, output *DeleteClusterOutput) { op := &request.Operation{ - Name: opDescribeUpdate, - HTTPMethod: "GET", - HTTPPath: "/clusters/{name}/updates/{updateId}", + Name: opDeleteCluster, + HTTPMethod: "DELETE", + HTTPPath: "/clusters/{name}", } if input == nil { - input = &DescribeUpdateInput{} + input = &DeleteClusterInput{} } - output = &DescribeUpdateOutput{} + output = &DeleteClusterOutput{} req = c.newRequest(op, input, output) return } -// DescribeUpdate API operation for Amazon Elastic Kubernetes Service. +// DeleteCluster API operation for Amazon Elastic Kubernetes Service. // -// Returns descriptive information about an update against your Amazon EKS cluster. +// Deletes the Amazon EKS cluster control plane. // -// When the status of the update is Succeeded, the update is complete. If an -// update fails, the status is Failed, and an error detail explains the reason -// for the failure. +// If you have active services in your cluster that are associated with a load +// balancer, you must delete those services before deleting the cluster so that +// the load balancers are deleted properly. Otherwise, you can have orphaned +// resources in your VPC that prevent you from being able to delete the VPC. +// For more information, see Deleting a Cluster (https://docs.aws.amazon.com/eks/latest/userguide/delete-cluster.html) +// in the Amazon EKS User Guide. +// +// If you have managed node groups or Fargate profiles attached to the cluster, +// you must delete them first. For more information, see DeleteNodegroup andDeleteFargateProfile. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Elastic Kubernetes Service's -// API operation DescribeUpdate for usage and error information. +// API operation DeleteCluster for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. +// Returned Error Types: +// * ResourceInUseException +// The specified resource is in use. +// +// * ResourceNotFoundException +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. // -// * ErrCodeClientException "ClientException" +// * ClientException // These errors are usually caused by a client action. Actions can include using // an action or resource on behalf of a user that doesn't have permissions to // use the action or resource or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource could not be found. You can view your available clusters -// with ListClusters. Amazon EKS clusters are Region-specific. +// * ServiceUnavailableException +// The service is unavailable. Back off and retry the operation. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeUpdate -func (c *EKS) DescribeUpdate(input *DescribeUpdateInput) (*DescribeUpdateOutput, error) { - req, out := c.DescribeUpdateRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteCluster +func (c *EKS) DeleteCluster(input *DeleteClusterInput) (*DeleteClusterOutput, error) { + req, out := c.DeleteClusterRequest(input) return out, req.Send() } -// DescribeUpdateWithContext is the same as DescribeUpdate with the addition of +// DeleteClusterWithContext is the same as DeleteCluster with the addition of // the ability to pass a context and additional request options. // -// See DescribeUpdate for details on how to use this API operation. +// See DeleteCluster for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EKS) DescribeUpdateWithContext(ctx aws.Context, input *DescribeUpdateInput, opts ...request.Option) (*DescribeUpdateOutput, error) { - req, out := c.DescribeUpdateRequest(input) +func (c *EKS) DeleteClusterWithContext(ctx aws.Context, input *DeleteClusterInput, opts ...request.Option) (*DeleteClusterOutput, error) { + req, out := c.DeleteClusterRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListClusters = "ListClusters" +const opDeleteFargateProfile = "DeleteFargateProfile" -// ListClustersRequest generates a "aws/request.Request" representing the -// client's request for the ListClusters operation. The "output" return +// DeleteFargateProfileRequest generates a "aws/request.Request" representing the +// client's request for the DeleteFargateProfile operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListClusters for more information on using the ListClusters +// See DeleteFargateProfile for more information on using the DeleteFargateProfile // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListClustersRequest method. -// req, resp := client.ListClustersRequest(params) +// // Example sending a request using the DeleteFargateProfileRequest method. +// req, resp := client.DeleteFargateProfileRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListClusters -func (c *EKS) ListClustersRequest(input *ListClustersInput) (req *request.Request, output *ListClustersOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteFargateProfile +func (c *EKS) DeleteFargateProfileRequest(input *DeleteFargateProfileInput) (req *request.Request, output *DeleteFargateProfileOutput) { op := &request.Operation{ - Name: opListClusters, - HTTPMethod: "GET", - HTTPPath: "/clusters", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, + Name: opDeleteFargateProfile, + HTTPMethod: "DELETE", + HTTPPath: "/clusters/{name}/fargate-profiles/{fargateProfileName}", } if input == nil { - input = &ListClustersInput{} + input = &DeleteFargateProfileInput{} } - output = &ListClustersOutput{} + output = &DeleteFargateProfileOutput{} req = c.newRequest(op, input, output) return } -// ListClusters API operation for Amazon Elastic Kubernetes Service. +// DeleteFargateProfile API operation for Amazon Elastic Kubernetes Service. // -// Lists the Amazon EKS clusters in your AWS account in the specified Region. +// Deletes an AWS Fargate profile. +// +// When you delete a Fargate profile, any pods running on Fargate that were +// created with the profile are deleted. If those pods match another Fargate +// profile, then they are scheduled on Fargate with that profile. If they no +// longer match any Fargate profiles, then they are not scheduled on Fargate +// and they may remain in a pending state. +// +// Only one Fargate profile in a cluster can be in the DELETING status at a +// time. You must wait for a Fargate profile to finish deleting before you can +// delete any other profiles in that 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 Kubernetes Service's -// API operation ListClusters for usage and error information. +// API operation DeleteFargateProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClientException "ClientException" +// * ClientException // These errors are usually caused by a client action. Actions can include using // an action or resource on behalf of a user that doesn't have permissions to // use the action or resource or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" -// The service is unavailable. Back off and retry the operation. +// * ResourceNotFoundException +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListClusters -func (c *EKS) ListClusters(input *ListClustersInput) (*ListClustersOutput, error) { - req, out := c.ListClustersRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteFargateProfile +func (c *EKS) DeleteFargateProfile(input *DeleteFargateProfileInput) (*DeleteFargateProfileOutput, error) { + req, out := c.DeleteFargateProfileRequest(input) return out, req.Send() } -// ListClustersWithContext is the same as ListClusters with the addition of +// DeleteFargateProfileWithContext is the same as DeleteFargateProfile with the addition of // the ability to pass a context and additional request options. // -// See ListClusters for details on how to use this API operation. +// See DeleteFargateProfile for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EKS) ListClustersWithContext(ctx aws.Context, input *ListClustersInput, opts ...request.Option) (*ListClustersOutput, error) { - req, out := c.ListClustersRequest(input) +func (c *EKS) DeleteFargateProfileWithContext(ctx aws.Context, input *DeleteFargateProfileInput, opts ...request.Option) (*DeleteFargateProfileOutput, error) { + req, out := c.DeleteFargateProfileRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// 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 *eks.ListClustersOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EKS) ListClustersPages(input *ListClustersInput, fn func(*ListClustersOutput, bool) bool) error { - return c.ListClustersPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListClustersPagesWithContext same as ListClustersPages 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 *EKS) ListClustersPagesWithContext(ctx aws.Context, input *ListClustersInput, fn func(*ListClustersOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListClustersInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListClustersRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListClustersOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" +const opDeleteNodegroup = "DeleteNodegroup" -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource operation. The "output" return +// DeleteNodegroupRequest generates a "aws/request.Request" representing the +// client's request for the DeleteNodegroup operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListTagsForResource for more information on using the ListTagsForResource +// See DeleteNodegroup for more information on using the DeleteNodegroup // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) +// // Example sending a request using the DeleteNodegroupRequest method. +// req, resp := client.DeleteNodegroupRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListTagsForResource -func (c *EKS) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteNodegroup +func (c *EKS) DeleteNodegroupRequest(input *DeleteNodegroupInput) (req *request.Request, output *DeleteNodegroupOutput) { op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", + Name: opDeleteNodegroup, + HTTPMethod: "DELETE", + HTTPPath: "/clusters/{name}/node-groups/{nodegroupName}", } if input == nil { - input = &ListTagsForResourceInput{} + input = &DeleteNodegroupInput{} } - output = &ListTagsForResourceOutput{} + output = &DeleteNodegroupOutput{} req = c.newRequest(op, input, output) return } -// ListTagsForResource API operation for Amazon Elastic Kubernetes Service. +// DeleteNodegroup API operation for Amazon Elastic Kubernetes Service. // -// List the tags for an Amazon EKS resource. +// Deletes an Amazon EKS node group 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 Elastic Kubernetes Service's -// API operation ListTagsForResource for usage and error information. +// API operation DeleteNodegroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// This exception is thrown if the request contains a semantic error. The precise -// meaning will depend on the API, and will be documented in the error message. +// Returned Error Types: +// * ResourceInUseException +// The specified resource is in use. // -// * ErrCodeNotFoundException "NotFoundException" -// A service resource associated with the request could not be found. Clients -// should not retry such requests. +// * ResourceNotFoundException +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListTagsForResource -func (c *EKS) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ClientException +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * ServiceUnavailableException +// The service is unavailable. Back off and retry the operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DeleteNodegroup +func (c *EKS) DeleteNodegroup(input *DeleteNodegroupInput) (*DeleteNodegroupOutput, error) { + req, out := c.DeleteNodegroupRequest(input) + return out, req.Send() } -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// DeleteNodegroupWithContext is the same as DeleteNodegroup with the addition of // the ability to pass a context and additional request options. // -// See ListTagsForResource for details on how to use this API operation. +// See DeleteNodegroup for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EKS) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) +func (c *EKS) DeleteNodegroupWithContext(ctx aws.Context, input *DeleteNodegroupInput, opts ...request.Option) (*DeleteNodegroupOutput, error) { + req, out := c.DeleteNodegroupRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListUpdates = "ListUpdates" +const opDescribeCluster = "DescribeCluster" -// ListUpdatesRequest generates a "aws/request.Request" representing the -// client's request for the ListUpdates operation. The "output" return +// DescribeClusterRequest generates a "aws/request.Request" representing the +// client's request for the DescribeCluster operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListUpdates for more information on using the ListUpdates +// See DescribeCluster for more information on using the DescribeCluster // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListUpdatesRequest method. -// req, resp := client.ListUpdatesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListUpdates -func (c *EKS) ListUpdatesRequest(input *ListUpdatesInput) (req *request.Request, output *ListUpdatesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeCluster +func (c *EKS) DescribeClusterRequest(input *DescribeClusterInput) (req *request.Request, output *DescribeClusterOutput) { op := &request.Operation{ - Name: opListUpdates, + Name: opDescribeCluster, HTTPMethod: "GET", - HTTPPath: "/clusters/{name}/updates", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, + HTTPPath: "/clusters/{name}", } if input == nil { - input = &ListUpdatesInput{} + input = &DescribeClusterInput{} } - output = &ListUpdatesOutput{} + output = &DescribeClusterOutput{} req = c.newRequest(op, input, output) return } -// ListUpdates API operation for Amazon Elastic Kubernetes Service. +// DescribeCluster API operation for Amazon Elastic Kubernetes Service. // -// Lists the updates associated with an Amazon EKS cluster in your AWS account, -// in the specified Region. +// Returns descriptive information about an Amazon EKS cluster. +// +// The API server endpoint and certificate authority data returned by this operation +// are required for kubelet and kubectl to communicate with your Kubernetes +// API server. For more information, see Create a kubeconfig for Amazon EKS +// (https://docs.aws.amazon.com/eks/latest/userguide/create-kubeconfig.html). +// +// The API server endpoint and certificate authority data aren't available until +// the cluster reaches the ACTIVE 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 Kubernetes Service's -// API operation ListUpdates for usage and error information. +// API operation DescribeCluster for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" -// The specified parameter is invalid. Review the available parameters for the -// API request. +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. // -// * ErrCodeClientException "ClientException" +// * ClientException // These errors are usually caused by a client action. Actions can include using // an action or resource on behalf of a user that doesn't have permissions to // use the action or resource or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource could not be found. You can view your available clusters -// with ListClusters. Amazon EKS clusters are Region-specific. +// * ServiceUnavailableException +// The service is unavailable. Back off and retry the operation. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListUpdates -func (c *EKS) ListUpdates(input *ListUpdatesInput) (*ListUpdatesOutput, error) { - req, out := c.ListUpdatesRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeCluster +func (c *EKS) DescribeCluster(input *DescribeClusterInput) (*DescribeClusterOutput, error) { + req, out := c.DescribeClusterRequest(input) return out, req.Send() } -// ListUpdatesWithContext is the same as ListUpdates with the addition of +// DescribeClusterWithContext is the same as DescribeCluster with the addition of // the ability to pass a context and additional request options. // -// See ListUpdates for details on how to use this API operation. +// See DescribeCluster for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EKS) ListUpdatesWithContext(ctx aws.Context, input *ListUpdatesInput, opts ...request.Option) (*ListUpdatesOutput, error) { - req, out := c.ListUpdatesRequest(input) +func (c *EKS) DescribeClusterWithContext(ctx aws.Context, input *DescribeClusterInput, opts ...request.Option) (*DescribeClusterOutput, error) { + req, out := c.DescribeClusterRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListUpdatesPages iterates over the pages of a ListUpdates operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListUpdates 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 ListUpdates operation. -// pageNum := 0 -// err := client.ListUpdatesPages(params, -// func(page *eks.ListUpdatesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *EKS) ListUpdatesPages(input *ListUpdatesInput, fn func(*ListUpdatesOutput, bool) bool) error { - return c.ListUpdatesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListUpdatesPagesWithContext same as ListUpdatesPages 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 *EKS) ListUpdatesPagesWithContext(ctx aws.Context, input *ListUpdatesInput, fn func(*ListUpdatesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListUpdatesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListUpdatesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListUpdatesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opTagResource = "TagResource" +const opDescribeFargateProfile = "DescribeFargateProfile" -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource operation. The "output" return +// DescribeFargateProfileRequest generates a "aws/request.Request" representing the +// client's request for the DescribeFargateProfile operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See TagResource for more information on using the TagResource +// See DescribeFargateProfile for more information on using the DescribeFargateProfile // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) +// // Example sending a request using the DescribeFargateProfileRequest method. +// req, resp := client.DescribeFargateProfileRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/TagResource -func (c *EKS) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeFargateProfile +func (c *EKS) DescribeFargateProfileRequest(input *DescribeFargateProfileInput) (req *request.Request, output *DescribeFargateProfileOutput) { op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/tags/{resourceArn}", + Name: opDescribeFargateProfile, + HTTPMethod: "GET", + HTTPPath: "/clusters/{name}/fargate-profiles/{fargateProfileName}", } if input == nil { - input = &TagResourceInput{} + input = &DescribeFargateProfileInput{} } - output = &TagResourceOutput{} + output = &DescribeFargateProfileOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// TagResource API operation for Amazon Elastic Kubernetes Service. +// DescribeFargateProfile API operation for Amazon Elastic Kubernetes Service. // -// Associates the specified tags to a resource with the specified resourceArn. -// If existing tags on a resource are not specified in the request parameters, -// they are not changed. When a resource is deleted, the tags associated with -// that resource are deleted as well. +// Returns descriptive information about an AWS Fargate profile. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Elastic Kubernetes Service's -// API operation TagResource for usage and error information. +// API operation DescribeFargateProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// This exception is thrown if the request contains a semantic error. The precise -// meaning will depend on the API, and will be documented in the error message. +// Returned Error Types: +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. // -// * ErrCodeNotFoundException "NotFoundException" -// A service resource associated with the request could not be found. Clients -// should not retry such requests. +// * ClientException +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/TagResource -func (c *EKS) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * ResourceNotFoundException +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeFargateProfile +func (c *EKS) DescribeFargateProfile(input *DescribeFargateProfileInput) (*DescribeFargateProfileOutput, error) { + req, out := c.DescribeFargateProfileRequest(input) return out, req.Send() } -// TagResourceWithContext is the same as TagResource with the addition of +// DescribeFargateProfileWithContext is the same as DescribeFargateProfile with the addition of // the ability to pass a context and additional request options. // -// See TagResource for details on how to use this API operation. +// See DescribeFargateProfile for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EKS) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) +func (c *EKS) DescribeFargateProfileWithContext(ctx aws.Context, input *DescribeFargateProfileInput, opts ...request.Option) (*DescribeFargateProfileOutput, error) { + req, out := c.DescribeFargateProfileRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUntagResource = "UntagResource" +const opDescribeNodegroup = "DescribeNodegroup" -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource operation. The "output" return +// DescribeNodegroupRequest generates a "aws/request.Request" representing the +// client's request for the DescribeNodegroup operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UntagResource for more information on using the UntagResource +// See DescribeNodegroup for more information on using the DescribeNodegroup // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) +// // Example sending a request using the DescribeNodegroupRequest method. +// req, resp := client.DescribeNodegroupRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UntagResource -func (c *EKS) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeNodegroup +func (c *EKS) DescribeNodegroupRequest(input *DescribeNodegroupInput) (req *request.Request, output *DescribeNodegroupOutput) { op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/tags/{resourceArn}", + Name: opDescribeNodegroup, + HTTPMethod: "GET", + HTTPPath: "/clusters/{name}/node-groups/{nodegroupName}", } if input == nil { - input = &UntagResourceInput{} + input = &DescribeNodegroupInput{} } - output = &UntagResourceOutput{} + output = &DescribeNodegroupOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UntagResource API operation for Amazon Elastic Kubernetes Service. +// DescribeNodegroup API operation for Amazon Elastic Kubernetes Service. // -// Deletes specified tags from a resource. +// Returns descriptive information about an Amazon EKS node 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 Elastic Kubernetes Service's -// API operation UntagResource for usage and error information. +// API operation DescribeNodegroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// This exception is thrown if the request contains a semantic error. The precise -// meaning will depend on the API, and will be documented in the error message. +// Returned Error Types: +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. // -// * ErrCodeNotFoundException "NotFoundException" -// A service resource associated with the request could not be found. Clients -// should not retry such requests. +// * ResourceNotFoundException +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UntagResource -func (c *EKS) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) +// * ClientException +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * ServiceUnavailableException +// The service is unavailable. Back off and retry the operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeNodegroup +func (c *EKS) DescribeNodegroup(input *DescribeNodegroupInput) (*DescribeNodegroupOutput, error) { + req, out := c.DescribeNodegroupRequest(input) return out, req.Send() } -// UntagResourceWithContext is the same as UntagResource with the addition of +// DescribeNodegroupWithContext is the same as DescribeNodegroup with the addition of // the ability to pass a context and additional request options. // -// See UntagResource for details on how to use this API operation. +// See DescribeNodegroup for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EKS) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) +func (c *EKS) DescribeNodegroupWithContext(ctx aws.Context, input *DescribeNodegroupInput, opts ...request.Option) (*DescribeNodegroupOutput, error) { + req, out := c.DescribeNodegroupRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateClusterConfig = "UpdateClusterConfig" +const opDescribeUpdate = "DescribeUpdate" -// UpdateClusterConfigRequest generates a "aws/request.Request" representing the -// client's request for the UpdateClusterConfig operation. The "output" return +// DescribeUpdateRequest generates a "aws/request.Request" representing the +// client's request for the DescribeUpdate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateClusterConfig for more information on using the UpdateClusterConfig +// See DescribeUpdate for more information on using the DescribeUpdate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateClusterConfigRequest method. -// req, resp := client.UpdateClusterConfigRequest(params) +// // Example sending a request using the DescribeUpdateRequest method. +// req, resp := client.DescribeUpdateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterConfig -func (c *EKS) UpdateClusterConfigRequest(input *UpdateClusterConfigInput) (req *request.Request, output *UpdateClusterConfigOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeUpdate +func (c *EKS) DescribeUpdateRequest(input *DescribeUpdateInput) (req *request.Request, output *DescribeUpdateOutput) { op := &request.Operation{ - Name: opUpdateClusterConfig, - HTTPMethod: "POST", - HTTPPath: "/clusters/{name}/update-config", + Name: opDescribeUpdate, + HTTPMethod: "GET", + HTTPPath: "/clusters/{name}/updates/{updateId}", } if input == nil { - input = &UpdateClusterConfigInput{} + input = &DescribeUpdateInput{} } - output = &UpdateClusterConfigOutput{} + output = &DescribeUpdateOutput{} req = c.newRequest(op, input, output) return } -// UpdateClusterConfig API operation for Amazon Elastic Kubernetes Service. +// DescribeUpdate API operation for Amazon Elastic Kubernetes Service. // -// Updates an Amazon EKS cluster configuration. Your cluster continues to function -// during the update. The response output includes an update ID that you can -// use to track the status of your cluster update with the DescribeUpdate API -// operation. +// Returns descriptive information about an update against your Amazon EKS cluster +// or associated managed node group. // -// You can use this API operation to enable or disable exporting the Kubernetes -// control plane logs for your cluster to CloudWatch Logs. By default, cluster -// control plane logs aren't exported to CloudWatch Logs. For more information, -// see Amazon EKS Cluster Control Plane Logs (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) -// in the Amazon EKS User Guide . +// When the status of the update is Succeeded, the update is complete. If an +// update fails, the status is Failed, and an error detail explains the reason +// for the failure. // -// CloudWatch Logs ingestion, archive storage, and data scanning rates apply -// to exported control plane logs. For more information, see Amazon CloudWatch -// Pricing (http://aws.amazon.com/cloudwatch/pricing/). -// -// You can also use this API operation to enable or disable public and private -// access to your cluster's Kubernetes API server endpoint. By default, public -// access is enabled, and private access is disabled. For more information, -// see Amazon EKS Cluster Endpoint Access Control (https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html) -// in the Amazon EKS User Guide . -// -// At this time, you can not update the subnets or security group IDs for an -// existing cluster. -// -// Cluster updates are asynchronous, and they should finish within a few minutes. -// During an update, the cluster status moves to UPDATING (this status transition -// is eventually consistent). When the update is complete (either Failed or -// Successful), the cluster status moves to Active. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the 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 Kubernetes Service's -// API operation UpdateClusterConfig for usage and error information. +// API operation DescribeUpdate for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClientException "ClientException" +// * ClientException // These errors are usually caused by a client action. Actions can include using // an action or resource on behalf of a user that doesn't have permissions to // use the action or resource or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeResourceInUseException "ResourceInUseException" -// The specified resource is in use. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource could not be found. You can view your available clusters -// with ListClusters. Amazon EKS clusters are Region-specific. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is invalid given the state of the cluster. Check the state of -// the cluster and the associated operations. +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterConfig -func (c *EKS) UpdateClusterConfig(input *UpdateClusterConfigInput) (*UpdateClusterConfigOutput, error) { - req, out := c.UpdateClusterConfigRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/DescribeUpdate +func (c *EKS) DescribeUpdate(input *DescribeUpdateInput) (*DescribeUpdateOutput, error) { + req, out := c.DescribeUpdateRequest(input) return out, req.Send() } -// UpdateClusterConfigWithContext is the same as UpdateClusterConfig with the addition of +// DescribeUpdateWithContext is the same as DescribeUpdate with the addition of // the ability to pass a context and additional request options. // -// See UpdateClusterConfig for details on how to use this API operation. +// See DescribeUpdate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EKS) UpdateClusterConfigWithContext(ctx aws.Context, input *UpdateClusterConfigInput, opts ...request.Option) (*UpdateClusterConfigOutput, error) { - req, out := c.UpdateClusterConfigRequest(input) +func (c *EKS) DescribeUpdateWithContext(ctx aws.Context, input *DescribeUpdateInput, opts ...request.Option) (*DescribeUpdateOutput, error) { + req, out := c.DescribeUpdateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateClusterVersion = "UpdateClusterVersion" +const opListClusters = "ListClusters" -// UpdateClusterVersionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateClusterVersion operation. The "output" return +// ListClustersRequest generates a "aws/request.Request" representing the +// client's request for the ListClusters operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateClusterVersion for more information on using the UpdateClusterVersion +// See ListClusters for more information on using the ListClusters // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateClusterVersionRequest method. -// req, resp := client.UpdateClusterVersionRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterVersion -func (c *EKS) UpdateClusterVersionRequest(input *UpdateClusterVersionInput) (req *request.Request, output *UpdateClusterVersionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListClusters +func (c *EKS) ListClustersRequest(input *ListClustersInput) (req *request.Request, output *ListClustersOutput) { op := &request.Operation{ - Name: opUpdateClusterVersion, - HTTPMethod: "POST", - HTTPPath: "/clusters/{name}/updates", + Name: opListClusters, + HTTPMethod: "GET", + HTTPPath: "/clusters", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, } if input == nil { - input = &UpdateClusterVersionInput{} + input = &ListClustersInput{} } - output = &UpdateClusterVersionOutput{} + output = &ListClustersOutput{} req = c.newRequest(op, input, output) return } -// UpdateClusterVersion API operation for Amazon Elastic Kubernetes Service. -// -// Updates an Amazon EKS cluster to the specified Kubernetes version. Your cluster -// continues to function during the update. The response output includes an -// update ID that you can use to track the status of your cluster update with -// the DescribeUpdate API operation. +// ListClusters API operation for Amazon Elastic Kubernetes Service. // -// Cluster updates are asynchronous, and they should finish within a few minutes. -// During an update, the cluster status moves to UPDATING (this status transition -// is eventually consistent). When the update is complete (either Failed or -// Successful), the cluster status moves to Active. +// Lists the Amazon EKS clusters in your AWS account 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 Amazon Elastic Kubernetes Service's -// API operation UpdateClusterVersion for usage and error information. +// API operation ListClusters for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // The specified parameter is invalid. Review the available parameters for the // API request. // -// * ErrCodeClientException "ClientException" +// * ClientException // These errors are usually caused by a client action. Actions can include using // an action or resource on behalf of a user that doesn't have permissions to // use the action or resource or specifying an identifier that is not valid. // -// * ErrCodeServerException "ServerException" +// * ServerException // These errors are usually caused by a server-side issue. // -// * ErrCodeResourceInUseException "ResourceInUseException" -// The specified resource is in use. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The specified resource could not be found. You can view your available clusters -// with ListClusters. Amazon EKS clusters are Region-specific. -// -// * ErrCodeInvalidRequestException "InvalidRequestException" -// The request is invalid given the state of the cluster. Check the state of -// the cluster and the associated operations. +// * ServiceUnavailableException +// The service is unavailable. Back off and retry the operation. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterVersion -func (c *EKS) UpdateClusterVersion(input *UpdateClusterVersionInput) (*UpdateClusterVersionOutput, error) { - req, out := c.UpdateClusterVersionRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListClusters +func (c *EKS) ListClusters(input *ListClustersInput) (*ListClustersOutput, error) { + req, out := c.ListClustersRequest(input) return out, req.Send() } -// UpdateClusterVersionWithContext is the same as UpdateClusterVersion with the addition of +// ListClustersWithContext is the same as ListClusters with the addition of // the ability to pass a context and additional request options. // -// See UpdateClusterVersion for details on how to use this API operation. +// See ListClusters for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *EKS) UpdateClusterVersionWithContext(ctx aws.Context, input *UpdateClusterVersionInput, opts ...request.Option) (*UpdateClusterVersionOutput, error) { - req, out := c.UpdateClusterVersionRequest(input) +func (c *EKS) ListClustersWithContext(ctx aws.Context, input *ListClustersInput, opts ...request.Option) (*ListClustersOutput, error) { + req, out := c.ListClustersRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// An object representing the certificate-authority-data for your cluster. -type Certificate struct { - _ struct{} `type:"structure"` - - // The Base64-encoded certificate data required to communicate with your cluster. - // Add this to the certificate-authority-data section of the kubeconfig file - // for your cluster. - Data *string `locationName:"data" type:"string"` +// 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 *eks.ListClustersOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EKS) ListClustersPages(input *ListClustersInput, fn func(*ListClustersOutput, bool) bool) error { + return c.ListClustersPagesWithContext(aws.BackgroundContext(), input, fn) } -// String returns the string representation -func (s Certificate) String() string { - return awsutil.Prettify(s) -} +// ListClustersPagesWithContext same as ListClustersPages 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 *EKS) ListClustersPagesWithContext(ctx aws.Context, input *ListClustersInput, fn func(*ListClustersOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListClustersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListClustersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } -// GoString returns the string representation -func (s Certificate) GoString() string { - return s.String() -} + for p.Next() { + if !fn(p.Page().(*ListClustersOutput), !p.HasNextPage()) { + break + } + } -// SetData sets the Data field's value. -func (s *Certificate) SetData(v string) *Certificate { - s.Data = &v - return s + return p.Err() } -// An object representing an Amazon EKS cluster. -type Cluster struct { - _ struct{} `type:"structure"` +const opListFargateProfiles = "ListFargateProfiles" - // The Amazon Resource Name (ARN) of the cluster. - Arn *string `locationName:"arn" type:"string"` +// ListFargateProfilesRequest generates a "aws/request.Request" representing the +// client's request for the ListFargateProfiles operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListFargateProfiles for more information on using the ListFargateProfiles +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListFargateProfilesRequest method. +// req, resp := client.ListFargateProfilesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListFargateProfiles +func (c *EKS) ListFargateProfilesRequest(input *ListFargateProfilesInput) (req *request.Request, output *ListFargateProfilesOutput) { + op := &request.Operation{ + Name: opListFargateProfiles, + HTTPMethod: "GET", + HTTPPath: "/clusters/{name}/fargate-profiles", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } - // The certificate-authority-data for your cluster. - CertificateAuthority *Certificate `locationName:"certificateAuthority" type:"structure"` + if input == nil { + input = &ListFargateProfilesInput{} + } - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string `locationName:"clientRequestToken" type:"string"` + output = &ListFargateProfilesOutput{} + req = c.newRequest(op, input, output) + return +} - // The Unix epoch timestamp in seconds for when the cluster was created. - CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` +// ListFargateProfiles API operation for Amazon Elastic Kubernetes Service. +// +// Lists the AWS Fargate profiles associated with the specified cluster in your +// AWS account 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 Amazon Elastic Kubernetes Service's +// API operation ListFargateProfiles for usage and error information. +// +// Returned Error Types: +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ResourceNotFoundException +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// * ClientException +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ServerException +// These errors are usually caused by a server-side issue. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListFargateProfiles +func (c *EKS) ListFargateProfiles(input *ListFargateProfilesInput) (*ListFargateProfilesOutput, error) { + req, out := c.ListFargateProfilesRequest(input) + return out, req.Send() +} - // The endpoint for your Kubernetes API server. - Endpoint *string `locationName:"endpoint" type:"string"` +// ListFargateProfilesWithContext is the same as ListFargateProfiles with the addition of +// the ability to pass a context and additional request options. +// +// See ListFargateProfiles for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EKS) ListFargateProfilesWithContext(ctx aws.Context, input *ListFargateProfilesInput, opts ...request.Option) (*ListFargateProfilesOutput, error) { + req, out := c.ListFargateProfilesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} - // The identity provider information for the cluster. - Identity *Identity `locationName:"identity" type:"structure"` +// ListFargateProfilesPages iterates over the pages of a ListFargateProfiles operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListFargateProfiles 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 ListFargateProfiles operation. +// pageNum := 0 +// err := client.ListFargateProfilesPages(params, +// func(page *eks.ListFargateProfilesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EKS) ListFargateProfilesPages(input *ListFargateProfilesInput, fn func(*ListFargateProfilesOutput, bool) bool) error { + return c.ListFargateProfilesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListFargateProfilesPagesWithContext same as ListFargateProfilesPages 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 *EKS) ListFargateProfilesPagesWithContext(ctx aws.Context, input *ListFargateProfilesInput, fn func(*ListFargateProfilesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListFargateProfilesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListFargateProfilesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListFargateProfilesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListNodegroups = "ListNodegroups" + +// ListNodegroupsRequest generates a "aws/request.Request" representing the +// client's request for the ListNodegroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListNodegroups for more information on using the ListNodegroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListNodegroupsRequest method. +// req, resp := client.ListNodegroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListNodegroups +func (c *EKS) ListNodegroupsRequest(input *ListNodegroupsInput) (req *request.Request, output *ListNodegroupsOutput) { + op := &request.Operation{ + Name: opListNodegroups, + HTTPMethod: "GET", + HTTPPath: "/clusters/{name}/node-groups", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListNodegroupsInput{} + } + + output = &ListNodegroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListNodegroups API operation for Amazon Elastic Kubernetes Service. +// +// Lists the Amazon EKS node groups associated with the specified cluster in +// your AWS account 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 Amazon Elastic Kubernetes Service's +// API operation ListNodegroups for usage and error information. +// +// Returned Error Types: +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ClientException +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * ServiceUnavailableException +// The service is unavailable. Back off and retry the operation. +// +// * ResourceNotFoundException +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListNodegroups +func (c *EKS) ListNodegroups(input *ListNodegroupsInput) (*ListNodegroupsOutput, error) { + req, out := c.ListNodegroupsRequest(input) + return out, req.Send() +} + +// ListNodegroupsWithContext is the same as ListNodegroups with the addition of +// the ability to pass a context and additional request options. +// +// See ListNodegroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EKS) ListNodegroupsWithContext(ctx aws.Context, input *ListNodegroupsInput, opts ...request.Option) (*ListNodegroupsOutput, error) { + req, out := c.ListNodegroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListNodegroupsPages iterates over the pages of a ListNodegroups operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListNodegroups 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 ListNodegroups operation. +// pageNum := 0 +// err := client.ListNodegroupsPages(params, +// func(page *eks.ListNodegroupsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EKS) ListNodegroupsPages(input *ListNodegroupsInput, fn func(*ListNodegroupsOutput, bool) bool) error { + return c.ListNodegroupsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListNodegroupsPagesWithContext same as ListNodegroupsPages 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 *EKS) ListNodegroupsPagesWithContext(ctx aws.Context, input *ListNodegroupsInput, fn func(*ListNodegroupsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListNodegroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListNodegroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListNodegroupsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListTagsForResource +func (c *EKS) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { + op := &request.Operation{ + Name: opListTagsForResource, + HTTPMethod: "GET", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &ListTagsForResourceInput{} + } + + output = &ListTagsForResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTagsForResource API operation for Amazon Elastic Kubernetes Service. +// +// List the tags for an Amazon EKS 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 Elastic Kubernetes Service's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// This exception is thrown if the request contains a semantic error. The precise +// meaning will depend on the API, and will be documented in the error message. +// +// * NotFoundException +// A service resource associated with the request could not be found. Clients +// should not retry such requests. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListTagsForResource +func (c *EKS) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EKS) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListUpdates = "ListUpdates" + +// ListUpdatesRequest generates a "aws/request.Request" representing the +// client's request for the ListUpdates operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListUpdates for more information on using the ListUpdates +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListUpdatesRequest method. +// req, resp := client.ListUpdatesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListUpdates +func (c *EKS) ListUpdatesRequest(input *ListUpdatesInput) (req *request.Request, output *ListUpdatesOutput) { + op := &request.Operation{ + Name: opListUpdates, + HTTPMethod: "GET", + HTTPPath: "/clusters/{name}/updates", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListUpdatesInput{} + } + + output = &ListUpdatesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListUpdates API operation for Amazon Elastic Kubernetes Service. +// +// Lists the updates associated with an Amazon EKS cluster or managed node group +// in your AWS account, 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 Amazon Elastic Kubernetes Service's +// API operation ListUpdates for usage and error information. +// +// Returned Error Types: +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ClientException +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * ResourceNotFoundException +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/ListUpdates +func (c *EKS) ListUpdates(input *ListUpdatesInput) (*ListUpdatesOutput, error) { + req, out := c.ListUpdatesRequest(input) + return out, req.Send() +} + +// ListUpdatesWithContext is the same as ListUpdates with the addition of +// the ability to pass a context and additional request options. +// +// See ListUpdates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EKS) ListUpdatesWithContext(ctx aws.Context, input *ListUpdatesInput, opts ...request.Option) (*ListUpdatesOutput, error) { + req, out := c.ListUpdatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListUpdatesPages iterates over the pages of a ListUpdates operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListUpdates 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 ListUpdates operation. +// pageNum := 0 +// err := client.ListUpdatesPages(params, +// func(page *eks.ListUpdatesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *EKS) ListUpdatesPages(input *ListUpdatesInput, fn func(*ListUpdatesOutput, bool) bool) error { + return c.ListUpdatesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListUpdatesPagesWithContext same as ListUpdatesPages 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 *EKS) ListUpdatesPagesWithContext(ctx aws.Context, input *ListUpdatesInput, fn func(*ListUpdatesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListUpdatesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListUpdatesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListUpdatesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/TagResource +func (c *EKS) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { + op := &request.Operation{ + Name: opTagResource, + HTTPMethod: "POST", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &TagResourceInput{} + } + + output = &TagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for Amazon Elastic Kubernetes Service. +// +// Associates the specified tags to a resource with the specified resourceArn. +// If existing tags on a resource are not specified in the request parameters, +// they are not changed. When a resource is deleted, the tags associated with +// that resource are deleted as well. Tags that you create for Amazon EKS resources +// do not propagate to any other resources associated with the cluster. For +// example, if you tag a cluster with this operation, that tag does not automatically +// propagate to the subnets and worker nodes associated with 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 Kubernetes Service's +// API operation TagResource for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// This exception is thrown if the request contains a semantic error. The precise +// meaning will depend on the API, and will be documented in the error message. +// +// * NotFoundException +// A service resource associated with the request could not be found. Clients +// should not retry such requests. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/TagResource +func (c *EKS) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EKS) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UntagResource +func (c *EKS) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { + op := &request.Operation{ + Name: opUntagResource, + HTTPMethod: "DELETE", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &UntagResourceInput{} + } + + output = &UntagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for Amazon Elastic Kubernetes Service. +// +// Deletes specified tags from 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 Elastic Kubernetes Service's +// API operation UntagResource for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// This exception is thrown if the request contains a semantic error. The precise +// meaning will depend on the API, and will be documented in the error message. +// +// * NotFoundException +// A service resource associated with the request could not be found. Clients +// should not retry such requests. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UntagResource +func (c *EKS) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EKS) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateClusterConfig = "UpdateClusterConfig" + +// UpdateClusterConfigRequest generates a "aws/request.Request" representing the +// client's request for the UpdateClusterConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateClusterConfig for more information on using the UpdateClusterConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateClusterConfigRequest method. +// req, resp := client.UpdateClusterConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterConfig +func (c *EKS) UpdateClusterConfigRequest(input *UpdateClusterConfigInput) (req *request.Request, output *UpdateClusterConfigOutput) { + op := &request.Operation{ + Name: opUpdateClusterConfig, + HTTPMethod: "POST", + HTTPPath: "/clusters/{name}/update-config", + } + + if input == nil { + input = &UpdateClusterConfigInput{} + } + + output = &UpdateClusterConfigOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateClusterConfig API operation for Amazon Elastic Kubernetes Service. +// +// Updates an Amazon EKS cluster configuration. Your cluster continues to function +// during the update. The response output includes an update ID that you can +// use to track the status of your cluster update with the DescribeUpdate API +// operation. +// +// You can use this API operation to enable or disable exporting the Kubernetes +// control plane logs for your cluster to CloudWatch Logs. By default, cluster +// control plane logs aren't exported to CloudWatch Logs. For more information, +// see Amazon EKS Cluster Control Plane Logs (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) +// in the Amazon EKS User Guide . +// +// CloudWatch Logs ingestion, archive storage, and data scanning rates apply +// to exported control plane logs. For more information, see Amazon CloudWatch +// Pricing (http://aws.amazon.com/cloudwatch/pricing/). +// +// You can also use this API operation to enable or disable public and private +// access to your cluster's Kubernetes API server endpoint. By default, public +// access is enabled, and private access is disabled. For more information, +// see Amazon EKS Cluster Endpoint Access Control (https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html) +// in the Amazon EKS User Guide . +// +// At this time, you can not update the subnets or security group IDs for an +// existing cluster. +// +// Cluster updates are asynchronous, and they should finish within a few minutes. +// During an update, the cluster status moves to UPDATING (this status transition +// is eventually consistent). When the update is complete (either Failed or +// Successful), the cluster status moves to Active. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Kubernetes Service's +// API operation UpdateClusterConfig for usage and error information. +// +// Returned Error Types: +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ClientException +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * ResourceInUseException +// The specified resource is in use. +// +// * ResourceNotFoundException +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// * InvalidRequestException +// The request is invalid given the state of the cluster. Check the state of +// the cluster and the associated operations. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterConfig +func (c *EKS) UpdateClusterConfig(input *UpdateClusterConfigInput) (*UpdateClusterConfigOutput, error) { + req, out := c.UpdateClusterConfigRequest(input) + return out, req.Send() +} + +// UpdateClusterConfigWithContext is the same as UpdateClusterConfig with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateClusterConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EKS) UpdateClusterConfigWithContext(ctx aws.Context, input *UpdateClusterConfigInput, opts ...request.Option) (*UpdateClusterConfigOutput, error) { + req, out := c.UpdateClusterConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateClusterVersion = "UpdateClusterVersion" + +// UpdateClusterVersionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateClusterVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateClusterVersion for more information on using the UpdateClusterVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateClusterVersionRequest method. +// req, resp := client.UpdateClusterVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterVersion +func (c *EKS) UpdateClusterVersionRequest(input *UpdateClusterVersionInput) (req *request.Request, output *UpdateClusterVersionOutput) { + op := &request.Operation{ + Name: opUpdateClusterVersion, + HTTPMethod: "POST", + HTTPPath: "/clusters/{name}/updates", + } + + if input == nil { + input = &UpdateClusterVersionInput{} + } + + output = &UpdateClusterVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateClusterVersion API operation for Amazon Elastic Kubernetes Service. +// +// Updates an Amazon EKS cluster to the specified Kubernetes version. Your cluster +// continues to function during the update. The response output includes an +// update ID that you can use to track the status of your cluster update with +// the DescribeUpdate API operation. +// +// Cluster updates are asynchronous, and they should finish within a few minutes. +// During an update, the cluster status moves to UPDATING (this status transition +// is eventually consistent). When the update is complete (either Failed or +// Successful), the cluster status moves to Active. +// +// If your cluster has managed node groups attached to it, all of your node +// groups’ Kubernetes versions must match the cluster’s Kubernetes version +// in order to update the cluster to a new Kubernetes 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 Amazon Elastic Kubernetes Service's +// API operation UpdateClusterVersion for usage and error information. +// +// Returned Error Types: +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ClientException +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * ResourceInUseException +// The specified resource is in use. +// +// * ResourceNotFoundException +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// * InvalidRequestException +// The request is invalid given the state of the cluster. Check the state of +// the cluster and the associated operations. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateClusterVersion +func (c *EKS) UpdateClusterVersion(input *UpdateClusterVersionInput) (*UpdateClusterVersionOutput, error) { + req, out := c.UpdateClusterVersionRequest(input) + return out, req.Send() +} + +// UpdateClusterVersionWithContext is the same as UpdateClusterVersion with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateClusterVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EKS) UpdateClusterVersionWithContext(ctx aws.Context, input *UpdateClusterVersionInput, opts ...request.Option) (*UpdateClusterVersionOutput, error) { + req, out := c.UpdateClusterVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateNodegroupConfig = "UpdateNodegroupConfig" + +// UpdateNodegroupConfigRequest generates a "aws/request.Request" representing the +// client's request for the UpdateNodegroupConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateNodegroupConfig for more information on using the UpdateNodegroupConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateNodegroupConfigRequest method. +// req, resp := client.UpdateNodegroupConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateNodegroupConfig +func (c *EKS) UpdateNodegroupConfigRequest(input *UpdateNodegroupConfigInput) (req *request.Request, output *UpdateNodegroupConfigOutput) { + op := &request.Operation{ + Name: opUpdateNodegroupConfig, + HTTPMethod: "POST", + HTTPPath: "/clusters/{name}/node-groups/{nodegroupName}/update-config", + } + + if input == nil { + input = &UpdateNodegroupConfigInput{} + } + + output = &UpdateNodegroupConfigOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateNodegroupConfig API operation for Amazon Elastic Kubernetes Service. +// +// Updates an Amazon EKS managed node group configuration. Your node group continues +// to function during the update. The response output includes an update ID +// that you can use to track the status of your node group update with the DescribeUpdate +// API operation. Currently you can update the Kubernetes labels for a node +// group or the scaling 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 Kubernetes Service's +// API operation UpdateNodegroupConfig for usage and error information. +// +// Returned Error Types: +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ClientException +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * ResourceInUseException +// The specified resource is in use. +// +// * ResourceNotFoundException +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// * InvalidRequestException +// The request is invalid given the state of the cluster. Check the state of +// the cluster and the associated operations. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateNodegroupConfig +func (c *EKS) UpdateNodegroupConfig(input *UpdateNodegroupConfigInput) (*UpdateNodegroupConfigOutput, error) { + req, out := c.UpdateNodegroupConfigRequest(input) + return out, req.Send() +} + +// UpdateNodegroupConfigWithContext is the same as UpdateNodegroupConfig with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateNodegroupConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EKS) UpdateNodegroupConfigWithContext(ctx aws.Context, input *UpdateNodegroupConfigInput, opts ...request.Option) (*UpdateNodegroupConfigOutput, error) { + req, out := c.UpdateNodegroupConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateNodegroupVersion = "UpdateNodegroupVersion" + +// UpdateNodegroupVersionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateNodegroupVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateNodegroupVersion for more information on using the UpdateNodegroupVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateNodegroupVersionRequest method. +// req, resp := client.UpdateNodegroupVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateNodegroupVersion +func (c *EKS) UpdateNodegroupVersionRequest(input *UpdateNodegroupVersionInput) (req *request.Request, output *UpdateNodegroupVersionOutput) { + op := &request.Operation{ + Name: opUpdateNodegroupVersion, + HTTPMethod: "POST", + HTTPPath: "/clusters/{name}/node-groups/{nodegroupName}/update-version", + } + + if input == nil { + input = &UpdateNodegroupVersionInput{} + } + + output = &UpdateNodegroupVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateNodegroupVersion API operation for Amazon Elastic Kubernetes Service. +// +// Updates the Kubernetes version or AMI version of an Amazon EKS managed node +// group. +// +// You can update to the latest available AMI version of a node group's current +// Kubernetes version by not specifying a Kubernetes version in the request. +// You can update to the latest AMI version of your cluster's current Kubernetes +// version by specifying your cluster's Kubernetes version in the request. For +// more information, see Amazon EKS-Optimized Linux AMI Versions (https://docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html) +// in the Amazon EKS User Guide. +// +// You cannot roll back a node group to an earlier Kubernetes version or AMI +// version. +// +// When a node in a managed node group is terminated due to a scaling action +// or update, the pods in that node are drained first. Amazon EKS attempts to +// drain the nodes gracefully and will fail if it is unable to do so. You can +// force the update if Amazon EKS is unable to drain the nodes as a result of +// a pod disruption budget issue. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Elastic Kubernetes Service's +// API operation UpdateNodegroupVersion for usage and error information. +// +// Returned Error Types: +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ClientException +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +// +// * ServerException +// These errors are usually caused by a server-side issue. +// +// * ResourceInUseException +// The specified resource is in use. +// +// * ResourceNotFoundException +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +// +// * InvalidRequestException +// The request is invalid given the state of the cluster. Check the state of +// the cluster and the associated operations. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/eks-2017-11-01/UpdateNodegroupVersion +func (c *EKS) UpdateNodegroupVersion(input *UpdateNodegroupVersionInput) (*UpdateNodegroupVersionOutput, error) { + req, out := c.UpdateNodegroupVersionRequest(input) + return out, req.Send() +} + +// UpdateNodegroupVersionWithContext is the same as UpdateNodegroupVersion with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateNodegroupVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EKS) UpdateNodegroupVersionWithContext(ctx aws.Context, input *UpdateNodegroupVersionInput, opts ...request.Option) (*UpdateNodegroupVersionOutput, error) { + req, out := c.UpdateNodegroupVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// An Auto Scaling group that is associated with an Amazon EKS managed node +// group. +type AutoScalingGroup struct { + _ struct{} `type:"structure"` + + // The name of the Auto Scaling group associated with an Amazon EKS managed + // node group. + 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() +} + +// SetName sets the Name field's value. +func (s *AutoScalingGroup) SetName(v string) *AutoScalingGroup { + s.Name = &v + return s +} + +// This exception is thrown if the request contains a semantic error. The precise +// meaning will depend on the API, and will be documented in the error message. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// An object representing the certificate-authority-data for your cluster. +type Certificate struct { + _ struct{} `type:"structure"` + + // The Base64-encoded certificate data required to communicate with your cluster. + // Add this to the certificate-authority-data section of the kubeconfig file + // for your cluster. + Data *string `locationName:"data" 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() +} + +// SetData sets the Data field's value. +func (s *Certificate) SetData(v string) *Certificate { + s.Data = &v + return s +} + +// These errors are usually caused by a client action. Actions can include using +// an action or resource on behalf of a user that doesn't have permissions to +// use the action or resource or specifying an identifier that is not valid. +type ClientException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The Amazon EKS cluster associated with the exception. + ClusterName *string `locationName:"clusterName" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + // The Amazon EKS managed node group associated with the exception. + NodegroupName *string `locationName:"nodegroupName" type:"string"` +} + +// String returns the string representation +func (s ClientException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClientException) GoString() string { + return s.String() +} + +func newErrorClientException(v protocol.ResponseMetadata) error { + return &ClientException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ClientException) Code() string { + return "ClientException" +} + +// Message returns the exception's message. +func (s ClientException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ClientException) OrigErr() error { + return nil +} + +func (s ClientException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ClientException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ClientException) RequestID() string { + return s.respMetadata.RequestID +} + +// An object representing an Amazon EKS cluster. +type Cluster struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the cluster. + Arn *string `locationName:"arn" type:"string"` + + // The certificate-authority-data for your cluster. + CertificateAuthority *Certificate `locationName:"certificateAuthority" type:"structure"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string"` + + // The Unix epoch timestamp in seconds for when the cluster was created. + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` + + // The endpoint for your Kubernetes API server. + Endpoint *string `locationName:"endpoint" type:"string"` + + // The identity provider information for the cluster. + Identity *Identity `locationName:"identity" type:"structure"` // The logging configuration for your cluster. Logging *Logging `locationName:"logging" type:"structure"` - // The name of the cluster. - Name *string `locationName:"name" type:"string"` + // The name of the cluster. + Name *string `locationName:"name" type:"string"` + + // The platform version of your Amazon EKS cluster. For more information, see + // Platform Versions (https://docs.aws.amazon.com/eks/latest/userguide/platform-versions.html) + // in the Amazon EKS User Guide . + PlatformVersion *string `locationName:"platformVersion" type:"string"` + + // The VPC configuration used by the cluster control plane. Amazon EKS VPC resources + // have specific requirements to work properly with Kubernetes. For more information, + // see Cluster VPC Considerations (https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html) + // and Cluster Security Group Considerations (https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html) + // in the Amazon EKS User Guide. + ResourcesVpcConfig *VpcConfigResponse `locationName:"resourcesVpcConfig" type:"structure"` + + // The Amazon Resource Name (ARN) of the IAM role that provides permissions + // for the Kubernetes control plane to make calls to AWS API operations on your + // behalf. + RoleArn *string `locationName:"roleArn" type:"string"` + + // The current status of the cluster. + Status *string `locationName:"status" type:"string" enum:"ClusterStatus"` + + // The metadata that you apply to the cluster to assist with categorization + // and organization. Each tag consists of a key and an optional value, both + // of which you define. Cluster tags do not propagate to any other resources + // associated with the cluster. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The Kubernetes server version for the cluster. + Version *string `locationName:"version" 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() +} + +// SetArn sets the Arn field's value. +func (s *Cluster) SetArn(v string) *Cluster { + s.Arn = &v + return s +} + +// SetCertificateAuthority sets the CertificateAuthority field's value. +func (s *Cluster) SetCertificateAuthority(v *Certificate) *Cluster { + s.CertificateAuthority = v + return s +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *Cluster) SetClientRequestToken(v string) *Cluster { + s.ClientRequestToken = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *Cluster) SetCreatedAt(v time.Time) *Cluster { + s.CreatedAt = &v + return s +} + +// SetEndpoint sets the Endpoint field's value. +func (s *Cluster) SetEndpoint(v string) *Cluster { + s.Endpoint = &v + return s +} + +// SetIdentity sets the Identity field's value. +func (s *Cluster) SetIdentity(v *Identity) *Cluster { + s.Identity = v + return s +} + +// SetLogging sets the Logging field's value. +func (s *Cluster) SetLogging(v *Logging) *Cluster { + s.Logging = v + return s +} + +// SetName sets the Name field's value. +func (s *Cluster) SetName(v string) *Cluster { + s.Name = &v + return s +} + +// SetPlatformVersion sets the PlatformVersion field's value. +func (s *Cluster) SetPlatformVersion(v string) *Cluster { + s.PlatformVersion = &v + return s +} + +// SetResourcesVpcConfig sets the ResourcesVpcConfig field's value. +func (s *Cluster) SetResourcesVpcConfig(v *VpcConfigResponse) *Cluster { + s.ResourcesVpcConfig = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *Cluster) SetRoleArn(v string) *Cluster { + s.RoleArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *Cluster) SetStatus(v string) *Cluster { + s.Status = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *Cluster) SetTags(v map[string]*string) *Cluster { + s.Tags = v + return s +} + +// SetVersion sets the Version field's value. +func (s *Cluster) SetVersion(v string) *Cluster { + s.Version = &v + return s +} + +type CreateClusterInput struct { + _ struct{} `type:"structure"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` + + // Enable or disable exporting the Kubernetes control plane logs for your cluster + // to CloudWatch Logs. By default, cluster control plane logs aren't exported + // to CloudWatch Logs. For more information, see Amazon EKS Cluster Control + // Plane Logs (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) + // in the Amazon EKS User Guide . + // + // CloudWatch Logs ingestion, archive storage, and data scanning rates apply + // to exported control plane logs. For more information, see Amazon CloudWatch + // Pricing (http://aws.amazon.com/cloudwatch/pricing/). + Logging *Logging `locationName:"logging" type:"structure"` + + // The unique name to give to your cluster. + // + // Name is a required field + Name *string `locationName:"name" min:"1" type:"string" required:"true"` + + // The VPC configuration used by the cluster control plane. Amazon EKS VPC resources + // have specific requirements to work properly with Kubernetes. For more information, + // see Cluster VPC Considerations (https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html) + // and Cluster Security Group Considerations (https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html) + // in the Amazon EKS User Guide. You must specify at least two subnets. You + // can specify up to five security groups, but we recommend that you use a dedicated + // security group for your cluster control plane. + // + // ResourcesVpcConfig is a required field + ResourcesVpcConfig *VpcConfigRequest `locationName:"resourcesVpcConfig" type:"structure" required:"true"` + + // The Amazon Resource Name (ARN) of the IAM role that provides permissions + // for Amazon EKS to make calls to other AWS API operations on your behalf. + // For more information, see Amazon EKS Service IAM Role (https://docs.aws.amazon.com/eks/latest/userguide/service_IAM_role.html) + // in the Amazon EKS User Guide . + // + // RoleArn is a required field + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` + + // The metadata to apply to the cluster to assist with categorization and organization. + // Each tag consists of a key and an optional value, both of which you define. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The desired Kubernetes version for your cluster. If you don't specify a value + // here, the latest version available in Amazon EKS is used. + Version *string `locationName:"version" 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() +} + +// 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.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.ResourcesVpcConfig == nil { + invalidParams.Add(request.NewErrParamRequired("ResourcesVpcConfig")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *CreateClusterInput) SetClientRequestToken(v string) *CreateClusterInput { + s.ClientRequestToken = &v + return s +} + +// SetLogging sets the Logging field's value. +func (s *CreateClusterInput) SetLogging(v *Logging) *CreateClusterInput { + s.Logging = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateClusterInput) SetName(v string) *CreateClusterInput { + s.Name = &v + return s +} + +// SetResourcesVpcConfig sets the ResourcesVpcConfig field's value. +func (s *CreateClusterInput) SetResourcesVpcConfig(v *VpcConfigRequest) *CreateClusterInput { + s.ResourcesVpcConfig = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *CreateClusterInput) SetRoleArn(v string) *CreateClusterInput { + s.RoleArn = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateClusterInput) SetTags(v map[string]*string) *CreateClusterInput { + s.Tags = v + return s +} + +// SetVersion sets the Version field's value. +func (s *CreateClusterInput) SetVersion(v string) *CreateClusterInput { + s.Version = &v + return s +} + +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 +} + +type CreateFargateProfileInput struct { + _ struct{} `type:"structure"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` + + // The name of the Amazon EKS cluster to apply the Fargate profile to. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The name of the Fargate profile. + // + // FargateProfileName is a required field + FargateProfileName *string `locationName:"fargateProfileName" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the pod execution role to use for pods + // that match the selectors in the Fargate profile. The pod execution role allows + // Fargate infrastructure to register with your cluster as a node, and it provides + // read access to Amazon ECR image repositories. For more information, see Pod + // Execution Role (https://docs.aws.amazon.com/eks/latest/userguide/pod-execution-role.html) + // in the Amazon EKS User Guide. + // + // PodExecutionRoleArn is a required field + PodExecutionRoleArn *string `locationName:"podExecutionRoleArn" type:"string" required:"true"` + + // The selectors to match for pods to use this Fargate profile. Each selector + // must have an associated namespace. Optionally, you can also specify labels + // for a namespace. You may specify up to five selectors in a Fargate profile. + Selectors []*FargateProfileSelector `locationName:"selectors" type:"list"` + + // The IDs of subnets to launch your pods into. At this time, pods running on + // Fargate are not assigned public IP addresses, so only private subnets (with + // no direct route to an Internet Gateway) are accepted for this parameter. + Subnets []*string `locationName:"subnets" type:"list"` + + // The metadata to apply to the Fargate profile to assist with categorization + // and organization. Each tag consists of a key and an optional value, both + // of which you define. Fargate profile tags do not propagate to any other resources + // associated with the Fargate profile, such as the pods that are scheduled + // with it. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +} + +// String returns the string representation +func (s CreateFargateProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateFargateProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateFargateProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateFargateProfileInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.FargateProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("FargateProfileName")) + } + if s.PodExecutionRoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("PodExecutionRoleArn")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *CreateFargateProfileInput) SetClientRequestToken(v string) *CreateFargateProfileInput { + s.ClientRequestToken = &v + return s +} + +// SetClusterName sets the ClusterName field's value. +func (s *CreateFargateProfileInput) SetClusterName(v string) *CreateFargateProfileInput { + s.ClusterName = &v + return s +} + +// SetFargateProfileName sets the FargateProfileName field's value. +func (s *CreateFargateProfileInput) SetFargateProfileName(v string) *CreateFargateProfileInput { + s.FargateProfileName = &v + return s +} + +// SetPodExecutionRoleArn sets the PodExecutionRoleArn field's value. +func (s *CreateFargateProfileInput) SetPodExecutionRoleArn(v string) *CreateFargateProfileInput { + s.PodExecutionRoleArn = &v + return s +} + +// SetSelectors sets the Selectors field's value. +func (s *CreateFargateProfileInput) SetSelectors(v []*FargateProfileSelector) *CreateFargateProfileInput { + s.Selectors = v + return s +} + +// SetSubnets sets the Subnets field's value. +func (s *CreateFargateProfileInput) SetSubnets(v []*string) *CreateFargateProfileInput { + s.Subnets = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateFargateProfileInput) SetTags(v map[string]*string) *CreateFargateProfileInput { + s.Tags = v + return s +} + +type CreateFargateProfileOutput struct { + _ struct{} `type:"structure"` + + // The full description of your new Fargate profile. + FargateProfile *FargateProfile `locationName:"fargateProfile" type:"structure"` +} + +// String returns the string representation +func (s CreateFargateProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateFargateProfileOutput) GoString() string { + return s.String() +} + +// SetFargateProfile sets the FargateProfile field's value. +func (s *CreateFargateProfileOutput) SetFargateProfile(v *FargateProfile) *CreateFargateProfileOutput { + s.FargateProfile = v + return s +} + +type CreateNodegroupInput struct { + _ struct{} `type:"structure"` + + // The AMI type for your node group. GPU instance types should use the AL2_x86_64_GPU + // AMI type, which uses the Amazon EKS-optimized Linux AMI with GPU support. + // Non-GPU instances should use the AL2_x86_64 AMI type, which uses the Amazon + // EKS-optimized Linux AMI. + AmiType *string `locationName:"amiType" type:"string" enum:"AMITypes"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` + + // The name of the cluster to create the node group in. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The root device disk size (in GiB) for your node group instances. The default + // disk size is 20 GiB. + DiskSize *int64 `locationName:"diskSize" type:"integer"` + + // The instance type to use for your node group. Currently, you can specify + // a single instance type for a node group. The default value for this parameter + // is t3.medium. If you choose a GPU instance type, be sure to specify the AL2_x86_64_GPU + // with the amiType parameter. + InstanceTypes []*string `locationName:"instanceTypes" type:"list"` + + // The Kubernetes labels to be applied to the nodes in the node group when they + // are created. + Labels map[string]*string `locationName:"labels" type:"map"` + + // The IAM role associated with your node group. The Amazon EKS worker node + // kubelet daemon makes calls to AWS APIs on your behalf. Worker nodes receive + // permissions for these API calls through an IAM instance profile and associated + // policies. Before you can launch worker nodes and register them into a cluster, + // you must create an IAM role for those worker nodes to use when they are launched. + // For more information, see Amazon EKS Worker Node IAM Role (https://docs.aws.amazon.com/eks/latest/userguide/worker_node_IAM_role.html) + // in the Amazon EKS User Guide . + // + // NodeRole is a required field + NodeRole *string `locationName:"nodeRole" type:"string" required:"true"` + + // The unique name to give your node group. + // + // NodegroupName is a required field + NodegroupName *string `locationName:"nodegroupName" type:"string" required:"true"` + + // The AMI version of the Amazon EKS-optimized AMI to use with your node group. + // By default, the latest available AMI version for the node group's current + // Kubernetes version is used. For more information, see Amazon EKS-Optimized + // Linux AMI Versions (https://docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html) + // in the Amazon EKS User Guide. + ReleaseVersion *string `locationName:"releaseVersion" type:"string"` + + // The remote access (SSH) configuration to use with your node group. + RemoteAccess *RemoteAccessConfig `locationName:"remoteAccess" type:"structure"` + + // The scaling configuration details for the Auto Scaling group that is created + // for your node group. + ScalingConfig *NodegroupScalingConfig `locationName:"scalingConfig" type:"structure"` + + // The subnets to use for the Auto Scaling group that is created for your node + // group. These subnets must have the tag key kubernetes.io/cluster/CLUSTER_NAME + // with a value of shared, where CLUSTER_NAME is replaced with the name of your + // cluster. + // + // Subnets is a required field + Subnets []*string `locationName:"subnets" type:"list" required:"true"` + + // The metadata to apply to the node group to assist with categorization and + // organization. Each tag consists of a key and an optional value, both of which + // you define. Node group tags do not propagate to any other resources associated + // with the node group, such as the Amazon EC2 instances or subnets. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The Kubernetes version to use for your managed nodes. By default, the Kubernetes + // version of the cluster is used, and this is the only accepted specified value. + Version *string `locationName:"version" type:"string"` +} + +// String returns the string representation +func (s CreateNodegroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNodegroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateNodegroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateNodegroupInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.NodeRole == nil { + invalidParams.Add(request.NewErrParamRequired("NodeRole")) + } + if s.NodegroupName == nil { + invalidParams.Add(request.NewErrParamRequired("NodegroupName")) + } + 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.ScalingConfig != nil { + if err := s.ScalingConfig.Validate(); err != nil { + invalidParams.AddNested("ScalingConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmiType sets the AmiType field's value. +func (s *CreateNodegroupInput) SetAmiType(v string) *CreateNodegroupInput { + s.AmiType = &v + return s +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *CreateNodegroupInput) SetClientRequestToken(v string) *CreateNodegroupInput { + s.ClientRequestToken = &v + return s +} + +// SetClusterName sets the ClusterName field's value. +func (s *CreateNodegroupInput) SetClusterName(v string) *CreateNodegroupInput { + s.ClusterName = &v + return s +} + +// SetDiskSize sets the DiskSize field's value. +func (s *CreateNodegroupInput) SetDiskSize(v int64) *CreateNodegroupInput { + s.DiskSize = &v + return s +} + +// SetInstanceTypes sets the InstanceTypes field's value. +func (s *CreateNodegroupInput) SetInstanceTypes(v []*string) *CreateNodegroupInput { + s.InstanceTypes = v + return s +} + +// SetLabels sets the Labels field's value. +func (s *CreateNodegroupInput) SetLabels(v map[string]*string) *CreateNodegroupInput { + s.Labels = v + return s +} + +// SetNodeRole sets the NodeRole field's value. +func (s *CreateNodegroupInput) SetNodeRole(v string) *CreateNodegroupInput { + s.NodeRole = &v + return s +} + +// SetNodegroupName sets the NodegroupName field's value. +func (s *CreateNodegroupInput) SetNodegroupName(v string) *CreateNodegroupInput { + s.NodegroupName = &v + return s +} + +// SetReleaseVersion sets the ReleaseVersion field's value. +func (s *CreateNodegroupInput) SetReleaseVersion(v string) *CreateNodegroupInput { + s.ReleaseVersion = &v + return s +} + +// SetRemoteAccess sets the RemoteAccess field's value. +func (s *CreateNodegroupInput) SetRemoteAccess(v *RemoteAccessConfig) *CreateNodegroupInput { + s.RemoteAccess = v + return s +} + +// SetScalingConfig sets the ScalingConfig field's value. +func (s *CreateNodegroupInput) SetScalingConfig(v *NodegroupScalingConfig) *CreateNodegroupInput { + s.ScalingConfig = v + return s +} + +// SetSubnets sets the Subnets field's value. +func (s *CreateNodegroupInput) SetSubnets(v []*string) *CreateNodegroupInput { + s.Subnets = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateNodegroupInput) SetTags(v map[string]*string) *CreateNodegroupInput { + s.Tags = v + return s +} + +// SetVersion sets the Version field's value. +func (s *CreateNodegroupInput) SetVersion(v string) *CreateNodegroupInput { + s.Version = &v + return s +} + +type CreateNodegroupOutput struct { + _ struct{} `type:"structure"` + + // The full description of your new node group. + Nodegroup *Nodegroup `locationName:"nodegroup" type:"structure"` +} + +// String returns the string representation +func (s CreateNodegroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNodegroupOutput) GoString() string { + return s.String() +} + +// SetNodegroup sets the Nodegroup field's value. +func (s *CreateNodegroupOutput) SetNodegroup(v *Nodegroup) *CreateNodegroupOutput { + s.Nodegroup = v + return s +} + +type DeleteClusterInput struct { + _ struct{} `type:"structure"` + + // The name of the cluster to delete. + // + // Name is a required field + Name *string `location:"uri" locationName:"name" 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.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 *DeleteClusterInput) SetName(v string) *DeleteClusterInput { + s.Name = &v + return s +} + +type DeleteClusterOutput struct { + _ struct{} `type:"structure"` + + // The full description of the cluster to delete. + 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 +} + +type DeleteFargateProfileInput struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster associated with the Fargate profile to + // delete. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The name of the Fargate profile to delete. + // + // FargateProfileName is a required field + FargateProfileName *string `location:"uri" locationName:"fargateProfileName" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteFargateProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFargateProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteFargateProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteFargateProfileInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.FargateProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("FargateProfileName")) + } + if s.FargateProfileName != nil && len(*s.FargateProfileName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FargateProfileName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterName sets the ClusterName field's value. +func (s *DeleteFargateProfileInput) SetClusterName(v string) *DeleteFargateProfileInput { + s.ClusterName = &v + return s +} + +// SetFargateProfileName sets the FargateProfileName field's value. +func (s *DeleteFargateProfileInput) SetFargateProfileName(v string) *DeleteFargateProfileInput { + s.FargateProfileName = &v + return s +} + +type DeleteFargateProfileOutput struct { + _ struct{} `type:"structure"` + + // The deleted Fargate profile. + FargateProfile *FargateProfile `locationName:"fargateProfile" type:"structure"` +} + +// String returns the string representation +func (s DeleteFargateProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFargateProfileOutput) GoString() string { + return s.String() +} + +// SetFargateProfile sets the FargateProfile field's value. +func (s *DeleteFargateProfileOutput) SetFargateProfile(v *FargateProfile) *DeleteFargateProfileOutput { + s.FargateProfile = v + return s +} + +type DeleteNodegroupInput struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster that is associated with your node group. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The name of the node group to delete. + // + // NodegroupName is a required field + NodegroupName *string `location:"uri" locationName:"nodegroupName" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteNodegroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNodegroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteNodegroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteNodegroupInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.NodegroupName == nil { + invalidParams.Add(request.NewErrParamRequired("NodegroupName")) + } + if s.NodegroupName != nil && len(*s.NodegroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NodegroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterName sets the ClusterName field's value. +func (s *DeleteNodegroupInput) SetClusterName(v string) *DeleteNodegroupInput { + s.ClusterName = &v + return s +} + +// SetNodegroupName sets the NodegroupName field's value. +func (s *DeleteNodegroupInput) SetNodegroupName(v string) *DeleteNodegroupInput { + s.NodegroupName = &v + return s +} + +type DeleteNodegroupOutput struct { + _ struct{} `type:"structure"` + + // The full description of your deleted node group. + Nodegroup *Nodegroup `locationName:"nodegroup" type:"structure"` +} + +// String returns the string representation +func (s DeleteNodegroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNodegroupOutput) GoString() string { + return s.String() +} + +// SetNodegroup sets the Nodegroup field's value. +func (s *DeleteNodegroupOutput) SetNodegroup(v *Nodegroup) *DeleteNodegroupOutput { + s.Nodegroup = v + return s +} + +type DescribeClusterInput struct { + _ struct{} `type:"structure"` + + // The name of the cluster to describe. + // + // Name is a required field + Name *string `location:"uri" locationName:"name" 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.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 *DescribeClusterInput) SetName(v string) *DescribeClusterInput { + s.Name = &v + return s +} + +type DescribeClusterOutput struct { + _ struct{} `type:"structure"` + + // The full description of your specified cluster. + Cluster *Cluster `locationName:"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 +} + +type DescribeFargateProfileInput struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster associated with the Fargate profile. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The name of the Fargate profile to describe. + // + // FargateProfileName is a required field + FargateProfileName *string `location:"uri" locationName:"fargateProfileName" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeFargateProfileInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeFargateProfileInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeFargateProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeFargateProfileInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.FargateProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("FargateProfileName")) + } + if s.FargateProfileName != nil && len(*s.FargateProfileName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FargateProfileName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterName sets the ClusterName field's value. +func (s *DescribeFargateProfileInput) SetClusterName(v string) *DescribeFargateProfileInput { + s.ClusterName = &v + return s +} + +// SetFargateProfileName sets the FargateProfileName field's value. +func (s *DescribeFargateProfileInput) SetFargateProfileName(v string) *DescribeFargateProfileInput { + s.FargateProfileName = &v + return s +} + +type DescribeFargateProfileOutput struct { + _ struct{} `type:"structure"` + + // The full description of your Fargate profile. + FargateProfile *FargateProfile `locationName:"fargateProfile" type:"structure"` +} + +// String returns the string representation +func (s DescribeFargateProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeFargateProfileOutput) GoString() string { + return s.String() +} + +// SetFargateProfile sets the FargateProfile field's value. +func (s *DescribeFargateProfileOutput) SetFargateProfile(v *FargateProfile) *DescribeFargateProfileOutput { + s.FargateProfile = v + return s +} + +type DescribeNodegroupInput struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster associated with the node group. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The name of the node group to describe. + // + // NodegroupName is a required field + NodegroupName *string `location:"uri" locationName:"nodegroupName" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeNodegroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNodegroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeNodegroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeNodegroupInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.NodegroupName == nil { + invalidParams.Add(request.NewErrParamRequired("NodegroupName")) + } + if s.NodegroupName != nil && len(*s.NodegroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NodegroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterName sets the ClusterName field's value. +func (s *DescribeNodegroupInput) SetClusterName(v string) *DescribeNodegroupInput { + s.ClusterName = &v + return s +} + +// SetNodegroupName sets the NodegroupName field's value. +func (s *DescribeNodegroupInput) SetNodegroupName(v string) *DescribeNodegroupInput { + s.NodegroupName = &v + return s +} + +type DescribeNodegroupOutput struct { + _ struct{} `type:"structure"` + + // The full description of your node group. + Nodegroup *Nodegroup `locationName:"nodegroup" type:"structure"` +} + +// String returns the string representation +func (s DescribeNodegroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNodegroupOutput) GoString() string { + return s.String() +} + +// SetNodegroup sets the Nodegroup field's value. +func (s *DescribeNodegroupOutput) SetNodegroup(v *Nodegroup) *DescribeNodegroupOutput { + s.Nodegroup = v + return s +} + +type DescribeUpdateInput struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster associated with the update. + // + // Name is a required field + Name *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The name of the Amazon EKS node group associated with the update. + NodegroupName *string `location:"querystring" locationName:"nodegroupName" type:"string"` + + // The ID of the update to describe. + // + // UpdateId is a required field + UpdateId *string `location:"uri" locationName:"updateId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeUpdateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeUpdateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeUpdateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeUpdateInput"} + 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.UpdateId == nil { + invalidParams.Add(request.NewErrParamRequired("UpdateId")) + } + if s.UpdateId != nil && len(*s.UpdateId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UpdateId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DescribeUpdateInput) SetName(v string) *DescribeUpdateInput { + s.Name = &v + return s +} + +// SetNodegroupName sets the NodegroupName field's value. +func (s *DescribeUpdateInput) SetNodegroupName(v string) *DescribeUpdateInput { + s.NodegroupName = &v + return s +} + +// SetUpdateId sets the UpdateId field's value. +func (s *DescribeUpdateInput) SetUpdateId(v string) *DescribeUpdateInput { + s.UpdateId = &v + return s +} + +type DescribeUpdateOutput struct { + _ struct{} `type:"structure"` + + // The full description of the specified update. + Update *Update `locationName:"update" type:"structure"` +} + +// String returns the string representation +func (s DescribeUpdateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeUpdateOutput) GoString() string { + return s.String() +} + +// SetUpdate sets the Update field's value. +func (s *DescribeUpdateOutput) SetUpdate(v *Update) *DescribeUpdateOutput { + s.Update = v + return s +} + +// An object representing an error when an asynchronous operation fails. +type ErrorDetail struct { + _ struct{} `type:"structure"` + + // A brief description of the error. + // + // * SubnetNotFound: We couldn't find one of the subnets associated with + // the cluster. + // + // * SecurityGroupNotFound: We couldn't find one of the security groups associated + // with the cluster. + // + // * EniLimitReached: You have reached the elastic network interface limit + // for your account. + // + // * IpNotAvailable: A subnet associated with the cluster doesn't have any + // free IP addresses. + // + // * AccessDenied: You don't have permissions to perform the specified operation. + // + // * OperationNotPermitted: The service role associated with the cluster + // doesn't have the required access permissions for Amazon EKS. + // + // * VpcIdNotFound: We couldn't find the VPC associated with the cluster. + ErrorCode *string `locationName:"errorCode" type:"string" enum:"ErrorCode"` + + // A more complete description of the error. + ErrorMessage *string `locationName:"errorMessage" type:"string"` + + // An optional field that contains the resource IDs associated with the error. + ResourceIds []*string `locationName:"resourceIds" type:"list"` +} + +// String returns the string representation +func (s ErrorDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ErrorDetail) GoString() string { + return s.String() +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *ErrorDetail) SetErrorCode(v string) *ErrorDetail { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *ErrorDetail) SetErrorMessage(v string) *ErrorDetail { + s.ErrorMessage = &v + return s +} + +// SetResourceIds sets the ResourceIds field's value. +func (s *ErrorDetail) SetResourceIds(v []*string) *ErrorDetail { + s.ResourceIds = v + return s +} + +// An object representing an AWS Fargate profile. +type FargateProfile struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster that the Fargate profile belongs to. + ClusterName *string `locationName:"clusterName" type:"string"` + + // The Unix epoch timestamp in seconds for when the Fargate profile was created. + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` + + // The full Amazon Resource Name (ARN) of the Fargate profile. + FargateProfileArn *string `locationName:"fargateProfileArn" type:"string"` + + // The name of the Fargate profile. + FargateProfileName *string `locationName:"fargateProfileName" type:"string"` + + // The Amazon Resource Name (ARN) of the pod execution role to use for pods + // that match the selectors in the Fargate profile. For more information, see + // Pod Execution Role (https://docs.aws.amazon.com/eks/latest/userguide/pod-execution-role.html) + // in the Amazon EKS User Guide. + PodExecutionRoleArn *string `locationName:"podExecutionRoleArn" type:"string"` + + // The selectors to match for pods to use this Fargate profile. + Selectors []*FargateProfileSelector `locationName:"selectors" type:"list"` + + // The current status of the Fargate profile. + Status *string `locationName:"status" type:"string" enum:"FargateProfileStatus"` + + // The IDs of subnets to launch pods into. + Subnets []*string `locationName:"subnets" type:"list"` + + // The metadata applied to the Fargate profile to assist with categorization + // and organization. Each tag consists of a key and an optional value, both + // of which you define. Fargate profile tags do not propagate to any other resources + // associated with the Fargate profile, such as the pods that are scheduled + // with it. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +} + +// String returns the string representation +func (s FargateProfile) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FargateProfile) GoString() string { + return s.String() +} + +// SetClusterName sets the ClusterName field's value. +func (s *FargateProfile) SetClusterName(v string) *FargateProfile { + s.ClusterName = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *FargateProfile) SetCreatedAt(v time.Time) *FargateProfile { + s.CreatedAt = &v + return s +} + +// SetFargateProfileArn sets the FargateProfileArn field's value. +func (s *FargateProfile) SetFargateProfileArn(v string) *FargateProfile { + s.FargateProfileArn = &v + return s +} + +// SetFargateProfileName sets the FargateProfileName field's value. +func (s *FargateProfile) SetFargateProfileName(v string) *FargateProfile { + s.FargateProfileName = &v + return s +} + +// SetPodExecutionRoleArn sets the PodExecutionRoleArn field's value. +func (s *FargateProfile) SetPodExecutionRoleArn(v string) *FargateProfile { + s.PodExecutionRoleArn = &v + return s +} + +// SetSelectors sets the Selectors field's value. +func (s *FargateProfile) SetSelectors(v []*FargateProfileSelector) *FargateProfile { + s.Selectors = v + return s +} + +// SetStatus sets the Status field's value. +func (s *FargateProfile) SetStatus(v string) *FargateProfile { + s.Status = &v + return s +} + +// SetSubnets sets the Subnets field's value. +func (s *FargateProfile) SetSubnets(v []*string) *FargateProfile { + s.Subnets = v + return s +} + +// SetTags sets the Tags field's value. +func (s *FargateProfile) SetTags(v map[string]*string) *FargateProfile { + s.Tags = v + return s +} + +// An object representing an AWS Fargate profile selector. +type FargateProfileSelector struct { + _ struct{} `type:"structure"` + + // The Kubernetes labels that the selector should match. A pod must contain + // all of the labels that are specified in the selector for it to be considered + // a match. + Labels map[string]*string `locationName:"labels" type:"map"` + + // The Kubernetes namespace that the selector should match. + Namespace *string `locationName:"namespace" type:"string"` +} + +// String returns the string representation +func (s FargateProfileSelector) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FargateProfileSelector) GoString() string { + return s.String() +} + +// SetLabels sets the Labels field's value. +func (s *FargateProfileSelector) SetLabels(v map[string]*string) *FargateProfileSelector { + s.Labels = v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *FargateProfileSelector) SetNamespace(v string) *FargateProfileSelector { + s.Namespace = &v + return s +} + +// An object representing an identity provider for authentication credentials. +type Identity struct { + _ struct{} `type:"structure"` + + // The OpenID Connect (https://openid.net/connect/) identity provider information + // for the cluster. + Oidc *OIDC `locationName:"oidc" type:"structure"` +} + +// String returns the string representation +func (s Identity) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Identity) GoString() string { + return s.String() +} + +// SetOidc sets the Oidc field's value. +func (s *Identity) SetOidc(v *OIDC) *Identity { + s.Oidc = v + return s +} + +// The specified parameter is invalid. Review the available parameters for the +// API request. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The Amazon EKS cluster associated with the exception. + ClusterName *string `locationName:"clusterName" type:"string"` + + // The Fargate profile associated with the exception. + FargateProfileName *string `locationName:"fargateProfileName" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + // The Amazon EKS managed node group associated with the exception. + NodegroupName *string `locationName:"nodegroupName" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} + +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request is invalid given the state of the cluster. Check the state of +// the cluster and the associated operations. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The Amazon EKS cluster associated with the exception. + ClusterName *string `locationName:"clusterName" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + // The Amazon EKS managed node group associated with the exception. + NodegroupName *string `locationName:"nodegroupName" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// An object representing an issue with an Amazon EKS resource. +type Issue struct { + _ struct{} `type:"structure"` + + // A brief description of the error. + // + // * AutoScalingGroupNotFound: We couldn't find the Auto Scaling group associated + // with the managed node group. You may be able to recreate an Auto Scaling + // group with the same settings to recover. + // + // * Ec2SecurityGroupNotFound: We couldn't find the cluster security group + // for the cluster. You must recreate your cluster. + // + // * Ec2SecurityGroupDeletionFailure: We could not delete the remote access + // security group for your managed node group. Remove any dependencies from + // the security group. + // + // * Ec2LaunchTemplateNotFound: We couldn't find the Amazon EC2 launch template + // for your managed node group. You may be able to recreate a launch template + // with the same settings to recover. + // + // * Ec2LaunchTemplateVersionMismatch: The Amazon EC2 launch template version + // for your managed node group does not match the version that Amazon EKS + // created. You may be able to revert to the version that Amazon EKS created + // to recover. + // + // * IamInstanceProfileNotFound: We couldn't find the IAM instance profile + // for your managed node group. You may be able to recreate an instance profile + // with the same settings to recover. + // + // * IamNodeRoleNotFound: We couldn't find the IAM role for your managed + // node group. You may be able to recreate an IAM role with the same settings + // to recover. + // + // * AsgInstanceLaunchFailures: Your Auto Scaling group is experiencing failures + // while attempting to launch instances. + // + // * NodeCreationFailure: Your launched instances are unable to register + // with your Amazon EKS cluster. Common causes of this failure are insufficient + // worker node IAM role (https://docs.aws.amazon.com/eks/latest/userguide/worker_node_IAM_role.html) + // permissions or lack of outbound internet access for the nodes. + // + // * InstanceLimitExceeded: Your AWS account is unable to launch any more + // instances of the specified instance type. You may be able to request an + // Amazon EC2 instance limit increase to recover. + // + // * InsufficientFreeAddresses: One or more of the subnets associated with + // your managed node group does not have enough available IP addresses for + // new nodes. + // + // * AccessDenied: Amazon EKS or one or more of your managed nodes is unable + // to communicate with your cluster API server. + // + // * InternalFailure: These errors are usually caused by an Amazon EKS server-side + // issue. + Code *string `locationName:"code" type:"string" enum:"NodegroupIssueCode"` + + // The error message associated with the issue. + Message *string `locationName:"message" type:"string"` + + // The AWS resources that are afflicted by this issue. + ResourceIds []*string `locationName:"resourceIds" type:"list"` +} + +// String returns the string representation +func (s Issue) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Issue) GoString() string { + return s.String() +} + +// SetCode sets the Code field's value. +func (s *Issue) SetCode(v string) *Issue { + s.Code = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *Issue) SetMessage(v string) *Issue { + s.Message = &v + return s +} + +// SetResourceIds sets the ResourceIds field's value. +func (s *Issue) SetResourceIds(v []*string) *Issue { + s.ResourceIds = v + return s +} + +type ListClustersInput struct { + _ struct{} `type:"structure"` + + // The maximum number of cluster results returned by ListClusters in paginated + // output. When you use this parameter, ListClusters returns only maxResults + // results in a single page along with a nextToken response element. You can + // see the remaining results of the initial request by sending another ListClusters + // request with the returned nextToken value. This value can be between 1 and + // 100. If you don't use this parameter, ListClusters returns up to 100 results + // and a nextToken value if applicable. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" 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 token should be treated as an opaque identifier that is used only to + // retrieve the next items in a list and not for other programmatic purposes. + NextToken *string `location:"querystring" 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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListClustersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListClustersInput"} + 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 *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 +} + +type ListClustersOutput struct { + _ struct{} `type:"structure"` + + // A list of all of the clusters for your account in the specified Region. + Clusters []*string `locationName:"clusters" type:"list"` + + // The nextToken value to include in a future ListClusters request. When the + // results of a ListClusters request exceed maxResults, you can use this value + // 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() +} + +// SetClusters sets the Clusters field's value. +func (s *ListClustersOutput) SetClusters(v []*string) *ListClustersOutput { + s.Clusters = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListClustersOutput) SetNextToken(v string) *ListClustersOutput { + s.NextToken = &v + return s +} + +type ListFargateProfilesInput struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster that you would like to listFargate profiles + // in. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The maximum number of Fargate profile results returned by ListFargateProfiles + // in paginated output. When you use this parameter, ListFargateProfiles returns + // only maxResults results in a single page along with a nextToken response + // element. You can see the remaining results of the initial request by sending + // another ListFargateProfiles request with the returned nextToken value. This + // value can be between 1 and 100. If you don't use this parameter, ListFargateProfiles + // returns up to 100 results and a nextToken value if applicable. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // The nextToken value returned from a previous paginated ListFargateProfiles + // 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. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListFargateProfilesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListFargateProfilesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListFargateProfilesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListFargateProfilesInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterName sets the ClusterName field's value. +func (s *ListFargateProfilesInput) SetClusterName(v string) *ListFargateProfilesInput { + s.ClusterName = &v + return s +} - // The platform version of your Amazon EKS cluster. For more information, see - // Platform Versions (https://docs.aws.amazon.com/eks/latest/userguide/platform-versions.html) - // in the Amazon EKS User Guide . - PlatformVersion *string `locationName:"platformVersion" type:"string"` +// SetMaxResults sets the MaxResults field's value. +func (s *ListFargateProfilesInput) SetMaxResults(v int64) *ListFargateProfilesInput { + s.MaxResults = &v + return s +} - // The VPC configuration used by the cluster control plane. Amazon EKS VPC resources - // have specific requirements to work properly with Kubernetes. For more information, - // see Cluster VPC Considerations (https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html) - // and Cluster Security Group Considerations (https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html) - // in the Amazon EKS User Guide. - ResourcesVpcConfig *VpcConfigResponse `locationName:"resourcesVpcConfig" type:"structure"` +// SetNextToken sets the NextToken field's value. +func (s *ListFargateProfilesInput) SetNextToken(v string) *ListFargateProfilesInput { + s.NextToken = &v + return s +} + +type ListFargateProfilesOutput struct { + _ struct{} `type:"structure"` + + // A list of all of the Fargate profiles associated with the specified cluster. + FargateProfileNames []*string `locationName:"fargateProfileNames" type:"list"` + + // The nextToken value to include in a future ListFargateProfiles request. When + // the results of a ListFargateProfiles request exceed maxResults, you can use + // this value 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 ListFargateProfilesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListFargateProfilesOutput) GoString() string { + return s.String() +} + +// SetFargateProfileNames sets the FargateProfileNames field's value. +func (s *ListFargateProfilesOutput) SetFargateProfileNames(v []*string) *ListFargateProfilesOutput { + s.FargateProfileNames = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListFargateProfilesOutput) SetNextToken(v string) *ListFargateProfilesOutput { + s.NextToken = &v + return s +} + +type ListNodegroupsInput struct { + _ struct{} `type:"structure"` + + // The name of the Amazon EKS cluster that you would like to list node groups + // in. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The maximum number of node group results returned by ListNodegroups in paginated + // output. When you use this parameter, ListNodegroups returns only maxResults + // results in a single page along with a nextToken response element. You can + // see the remaining results of the initial request by sending another ListNodegroups + // request with the returned nextToken value. This value can be between 1 and + // 100. If you don't use this parameter, ListNodegroups returns up to 100 results + // and a nextToken value if applicable. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // The nextToken value returned from a previous paginated ListNodegroups 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. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListNodegroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListNodegroupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListNodegroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListNodegroupsInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterName sets the ClusterName field's value. +func (s *ListNodegroupsInput) SetClusterName(v string) *ListNodegroupsInput { + s.ClusterName = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListNodegroupsInput) SetMaxResults(v int64) *ListNodegroupsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListNodegroupsInput) SetNextToken(v string) *ListNodegroupsInput { + s.NextToken = &v + return s +} + +type ListNodegroupsOutput struct { + _ struct{} `type:"structure"` + + // The nextToken value to include in a future ListNodegroups request. When the + // results of a ListNodegroups request exceed maxResults, you can use this value + // 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 all of the node groups associated with the specified cluster. + Nodegroups []*string `locationName:"nodegroups" type:"list"` +} + +// String returns the string representation +func (s ListNodegroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListNodegroupsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListNodegroupsOutput) SetNextToken(v string) *ListNodegroupsOutput { + s.NextToken = &v + return s +} + +// SetNodegroups sets the Nodegroups field's value. +func (s *ListNodegroupsOutput) SetNodegroups(v []*string) *ListNodegroupsOutput { + s.Nodegroups = v + return s +} + +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) that identifies the resource for which to + // list the tags. Currently, the supported resources are Amazon EKS clusters + // and managed node groups. + // + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resourceArn" 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 +} + +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // The tags for the resource. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +} + +// 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 map[string]*string) *ListTagsForResourceOutput { + s.Tags = v + return s +} + +type ListUpdatesInput struct { + _ struct{} `type:"structure"` + + // The maximum number of update results returned by ListUpdates in paginated + // output. When you use this parameter, ListUpdates returns only maxResults + // results in a single page along with a nextToken response element. You can + // see the remaining results of the initial request by sending another ListUpdates + // request with the returned nextToken value. This value can be between 1 and + // 100. If you don't use this parameter, ListUpdates returns up to 100 results + // and a nextToken value if applicable. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // The name of the Amazon EKS cluster to list updates for. + // + // Name is a required field + Name *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The nextToken value returned from a previous paginated ListUpdates 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. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + + // The name of the Amazon EKS managed node group to list updates for. + NodegroupName *string `location:"querystring" locationName:"nodegroupName" type:"string"` +} + +// String returns the string representation +func (s ListUpdatesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListUpdatesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListUpdatesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListUpdatesInput"} + 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 *ListUpdatesInput) SetMaxResults(v int64) *ListUpdatesInput { + s.MaxResults = &v + return s +} + +// SetName sets the Name field's value. +func (s *ListUpdatesInput) SetName(v string) *ListUpdatesInput { + s.Name = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListUpdatesInput) SetNextToken(v string) *ListUpdatesInput { + s.NextToken = &v + return s +} - // The Amazon Resource Name (ARN) of the IAM role that provides permissions - // for the Kubernetes control plane to make calls to AWS API operations on your - // behalf. - RoleArn *string `locationName:"roleArn" type:"string"` +// SetNodegroupName sets the NodegroupName field's value. +func (s *ListUpdatesInput) SetNodegroupName(v string) *ListUpdatesInput { + s.NodegroupName = &v + return s +} - // The current status of the cluster. - Status *string `locationName:"status" type:"string" enum:"ClusterStatus"` +type ListUpdatesOutput struct { + _ struct{} `type:"structure"` - // The metadata that you apply to the cluster to assist with categorization - // and organization. Each tag consists of a key and an optional value, both - // of which you define. - Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + // The nextToken value to include in a future ListUpdates request. When the + // results of a ListUpdates request exceed maxResults, you can use this value + // 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 Kubernetes server version for the cluster. - Version *string `locationName:"version" type:"string"` + // A list of all the updates for the specified cluster and Region. + UpdateIds []*string `locationName:"updateIds" type:"list"` } // String returns the string representation -func (s Cluster) String() string { +func (s ListUpdatesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Cluster) GoString() string { +func (s ListUpdatesOutput) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *Cluster) SetArn(v string) *Cluster { - s.Arn = &v +// SetNextToken sets the NextToken field's value. +func (s *ListUpdatesOutput) SetNextToken(v string) *ListUpdatesOutput { + s.NextToken = &v return s } -// SetCertificateAuthority sets the CertificateAuthority field's value. -func (s *Cluster) SetCertificateAuthority(v *Certificate) *Cluster { - s.CertificateAuthority = v +// SetUpdateIds sets the UpdateIds field's value. +func (s *ListUpdatesOutput) SetUpdateIds(v []*string) *ListUpdatesOutput { + s.UpdateIds = v return s } -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *Cluster) SetClientRequestToken(v string) *Cluster { - s.ClientRequestToken = &v - return s -} +// An object representing the enabled or disabled Kubernetes control plane logs +// for your cluster. +type LogSetup struct { + _ struct{} `type:"structure"` -// SetCreatedAt sets the CreatedAt field's value. -func (s *Cluster) SetCreatedAt(v time.Time) *Cluster { - s.CreatedAt = &v - return s -} + // If a log type is enabled, that log type exports its control plane logs to + // CloudWatch Logs. If a log type isn't enabled, that log type doesn't export + // its control plane logs. Each individual log type can be enabled or disabled + // independently. + Enabled *bool `locationName:"enabled" type:"boolean"` -// SetEndpoint sets the Endpoint field's value. -func (s *Cluster) SetEndpoint(v string) *Cluster { - s.Endpoint = &v - return s + // The available cluster control plane log types. + Types []*string `locationName:"types" type:"list"` } -// SetIdentity sets the Identity field's value. -func (s *Cluster) SetIdentity(v *Identity) *Cluster { - s.Identity = v - return s +// String returns the string representation +func (s LogSetup) String() string { + return awsutil.Prettify(s) } -// SetLogging sets the Logging field's value. -func (s *Cluster) SetLogging(v *Logging) *Cluster { - s.Logging = v - return s +// GoString returns the string representation +func (s LogSetup) GoString() string { + return s.String() } -// SetName sets the Name field's value. -func (s *Cluster) SetName(v string) *Cluster { - s.Name = &v +// SetEnabled sets the Enabled field's value. +func (s *LogSetup) SetEnabled(v bool) *LogSetup { + s.Enabled = &v return s } -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *Cluster) SetPlatformVersion(v string) *Cluster { - s.PlatformVersion = &v +// SetTypes sets the Types field's value. +func (s *LogSetup) SetTypes(v []*string) *LogSetup { + s.Types = v return s } -// SetResourcesVpcConfig sets the ResourcesVpcConfig field's value. -func (s *Cluster) SetResourcesVpcConfig(v *VpcConfigResponse) *Cluster { - s.ResourcesVpcConfig = v - return s -} +// An object representing the logging configuration for resources in your cluster. +type Logging struct { + _ struct{} `type:"structure"` -// SetRoleArn sets the RoleArn field's value. -func (s *Cluster) SetRoleArn(v string) *Cluster { - s.RoleArn = &v - return s + // The cluster control plane logging configuration for your cluster. + ClusterLogging []*LogSetup `locationName:"clusterLogging" type:"list"` } -// SetStatus sets the Status field's value. -func (s *Cluster) SetStatus(v string) *Cluster { - s.Status = &v - return s +// String returns the string representation +func (s Logging) String() string { + return awsutil.Prettify(s) } -// SetTags sets the Tags field's value. -func (s *Cluster) SetTags(v map[string]*string) *Cluster { - s.Tags = v - return s +// GoString returns the string representation +func (s Logging) GoString() string { + return s.String() } -// SetVersion sets the Version field's value. -func (s *Cluster) SetVersion(v string) *Cluster { - s.Version = &v +// SetClusterLogging sets the ClusterLogging field's value. +func (s *Logging) SetClusterLogging(v []*LogSetup) *Logging { + s.ClusterLogging = v return s } -type CreateClusterInput struct { +// An object representing an Amazon EKS managed node group. +type Nodegroup struct { _ struct{} `type:"structure"` - // Unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` + // The AMI type associated with your node group. GPU instance types should use + // the AL2_x86_64_GPU AMI type, which uses the Amazon EKS-optimized Linux AMI + // with GPU support. Non-GPU instances should use the AL2_x86_64 AMI type, which + // uses the Amazon EKS-optimized Linux AMI. + AmiType *string `locationName:"amiType" type:"string" enum:"AMITypes"` - // Enable or disable exporting the Kubernetes control plane logs for your cluster - // to CloudWatch Logs. By default, cluster control plane logs aren't exported - // to CloudWatch Logs. For more information, see Amazon EKS Cluster Control - // Plane Logs (https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html) - // in the Amazon EKS User Guide . - // - // CloudWatch Logs ingestion, archive storage, and data scanning rates apply - // to exported control plane logs. For more information, see Amazon CloudWatch - // Pricing (http://aws.amazon.com/cloudwatch/pricing/). - Logging *Logging `locationName:"logging" type:"structure"` + // The name of the cluster that the managed node group resides in. + ClusterName *string `locationName:"clusterName" type:"string"` - // The unique name to give to your cluster. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` + // The Unix epoch timestamp in seconds for when the managed node group was created. + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` - // The VPC configuration used by the cluster control plane. Amazon EKS VPC resources - // have specific requirements to work properly with Kubernetes. For more information, - // see Cluster VPC Considerations (https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html) - // and Cluster Security Group Considerations (https://docs.aws.amazon.com/eks/latest/userguide/sec-group-reqs.html) - // in the Amazon EKS User Guide. You must specify at least two subnets. You - // can specify up to five security groups, but we recommend that you use a dedicated - // security group for your cluster control plane. - // - // ResourcesVpcConfig is a required field - ResourcesVpcConfig *VpcConfigRequest `locationName:"resourcesVpcConfig" type:"structure" required:"true"` + // The root device disk size (in GiB) for your node group instances. The default + // disk size is 20 GiB. + DiskSize *int64 `locationName:"diskSize" type:"integer"` - // The Amazon Resource Name (ARN) of the IAM role that provides permissions - // for Amazon EKS to make calls to other AWS API operations on your behalf. - // For more information, see Amazon EKS Service IAM Role (https://docs.aws.amazon.com/eks/latest/userguide/service_IAM_role.html) - // in the Amazon EKS User Guide . + // The health status of the node group. If there are issues with your node group's + // health, they are listed here. + Health *NodegroupHealth `locationName:"health" type:"structure"` + + // The instance types associated with your node group. + InstanceTypes []*string `locationName:"instanceTypes" type:"list"` + + // The Kubernetes labels applied to the nodes in the node group. // - // RoleArn is a required field - RoleArn *string `locationName:"roleArn" type:"string" required:"true"` + // Only labels that are applied with the Amazon EKS API are shown here. There + // may be other Kubernetes labels applied to the nodes in this group. + Labels map[string]*string `locationName:"labels" type:"map"` + + // The Unix epoch timestamp in seconds for when the managed node group was last + // modified. + ModifiedAt *time.Time `locationName:"modifiedAt" type:"timestamp"` + + // The IAM role associated with your node group. The Amazon EKS worker node + // kubelet daemon makes calls to AWS APIs on your behalf. Worker nodes receive + // permissions for these API calls through an IAM instance profile and associated + // policies. Before you can launch worker nodes and register them into a cluster, + // you must create an IAM role for those worker nodes to use when they are launched. + // For more information, see Amazon EKS Worker Node IAM Role (https://docs.aws.amazon.com/eks/latest/userguide/worker_node_IAM_role.html) + // in the Amazon EKS User Guide . + NodeRole *string `locationName:"nodeRole" type:"string"` - // The metadata to apply to the cluster to assist with categorization and organization. - // Each tag consists of a key and an optional value, both of which you define. + // The Amazon Resource Name (ARN) associated with the managed node group. + NodegroupArn *string `locationName:"nodegroupArn" type:"string"` + + // The name associated with an Amazon EKS managed node group. + NodegroupName *string `locationName:"nodegroupName" type:"string"` + + // The AMI version of the managed node group. For more information, see Amazon + // EKS-Optimized Linux AMI Versions (https://docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html) + // in the Amazon EKS User Guide. + ReleaseVersion *string `locationName:"releaseVersion" type:"string"` + + // The remote access (SSH) configuration that is associated with the node group. + RemoteAccess *RemoteAccessConfig `locationName:"remoteAccess" type:"structure"` + + // The resources associated with the node group, such as Auto Scaling groups + // and security groups for remote access. + Resources *NodegroupResources `locationName:"resources" type:"structure"` + + // The scaling configuration details for the Auto Scaling group that is associated + // with your node group. + ScalingConfig *NodegroupScalingConfig `locationName:"scalingConfig" type:"structure"` + + // The current status of the managed node group. + Status *string `locationName:"status" type:"string" enum:"NodegroupStatus"` + + // The subnets allowed for the Auto Scaling group that is associated with your + // node group. These subnets must have the following tag: kubernetes.io/cluster/CLUSTER_NAME, + // where CLUSTER_NAME is replaced with the name of your cluster. + Subnets []*string `locationName:"subnets" type:"list"` + + // The metadata applied to the node group to assist with categorization and + // organization. Each tag consists of a key and an optional value, both of which + // you define. Node group tags do not propagate to any other resources associated + // with the node group, such as the Amazon EC2 instances or subnets. Tags map[string]*string `locationName:"tags" min:"1" type:"map"` - // The desired Kubernetes version for your cluster. If you don't specify a value - // here, the latest version available in Amazon EKS is used. + // The Kubernetes version of the managed node group. Version *string `locationName:"version" type:"string"` } // String returns the string representation -func (s CreateClusterInput) String() string { +func (s Nodegroup) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateClusterInput) GoString() string { +func (s Nodegroup) 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.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ResourcesVpcConfig == nil { - invalidParams.Add(request.NewErrParamRequired("ResourcesVpcConfig")) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *CreateClusterInput) SetClientRequestToken(v string) *CreateClusterInput { - s.ClientRequestToken = &v - return s -} - -// SetLogging sets the Logging field's value. -func (s *CreateClusterInput) SetLogging(v *Logging) *CreateClusterInput { - s.Logging = v +// SetAmiType sets the AmiType field's value. +func (s *Nodegroup) SetAmiType(v string) *Nodegroup { + s.AmiType = &v return s } -// SetName sets the Name field's value. -func (s *CreateClusterInput) SetName(v string) *CreateClusterInput { - s.Name = &v +// SetClusterName sets the ClusterName field's value. +func (s *Nodegroup) SetClusterName(v string) *Nodegroup { + s.ClusterName = &v return s } -// SetResourcesVpcConfig sets the ResourcesVpcConfig field's value. -func (s *CreateClusterInput) SetResourcesVpcConfig(v *VpcConfigRequest) *CreateClusterInput { - s.ResourcesVpcConfig = v +// SetCreatedAt sets the CreatedAt field's value. +func (s *Nodegroup) SetCreatedAt(v time.Time) *Nodegroup { + s.CreatedAt = &v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *CreateClusterInput) SetRoleArn(v string) *CreateClusterInput { - s.RoleArn = &v +// SetDiskSize sets the DiskSize field's value. +func (s *Nodegroup) SetDiskSize(v int64) *Nodegroup { + s.DiskSize = &v return s } -// SetTags sets the Tags field's value. -func (s *CreateClusterInput) SetTags(v map[string]*string) *CreateClusterInput { - s.Tags = v +// SetHealth sets the Health field's value. +func (s *Nodegroup) SetHealth(v *NodegroupHealth) *Nodegroup { + s.Health = v return s } -// SetVersion sets the Version field's value. -func (s *CreateClusterInput) SetVersion(v string) *CreateClusterInput { - s.Version = &v +// SetInstanceTypes sets the InstanceTypes field's value. +func (s *Nodegroup) SetInstanceTypes(v []*string) *Nodegroup { + s.InstanceTypes = v return s } -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 +// SetLabels sets the Labels field's value. +func (s *Nodegroup) SetLabels(v map[string]*string) *Nodegroup { + s.Labels = v return s } -type DeleteClusterInput struct { - _ struct{} `type:"structure"` - - // The name of the cluster to delete. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` +// SetModifiedAt sets the ModifiedAt field's value. +func (s *Nodegroup) SetModifiedAt(v time.Time) *Nodegroup { + s.ModifiedAt = &v + return s } -// String returns the string representation -func (s DeleteClusterInput) String() string { - return awsutil.Prettify(s) +// SetNodeRole sets the NodeRole field's value. +func (s *Nodegroup) SetNodeRole(v string) *Nodegroup { + s.NodeRole = &v + return s } -// GoString returns the string representation -func (s DeleteClusterInput) GoString() string { - return s.String() +// SetNodegroupArn sets the NodegroupArn field's value. +func (s *Nodegroup) SetNodegroupArn(v string) *Nodegroup { + s.NodegroupArn = &v + return s } -// 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.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } +// SetNodegroupName sets the NodegroupName field's value. +func (s *Nodegroup) SetNodegroupName(v string) *Nodegroup { + s.NodegroupName = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetReleaseVersion sets the ReleaseVersion field's value. +func (s *Nodegroup) SetReleaseVersion(v string) *Nodegroup { + s.ReleaseVersion = &v + return s } -// SetName sets the Name field's value. -func (s *DeleteClusterInput) SetName(v string) *DeleteClusterInput { - s.Name = &v +// SetRemoteAccess sets the RemoteAccess field's value. +func (s *Nodegroup) SetRemoteAccess(v *RemoteAccessConfig) *Nodegroup { + s.RemoteAccess = v return s } -type DeleteClusterOutput struct { - _ struct{} `type:"structure"` +// SetResources sets the Resources field's value. +func (s *Nodegroup) SetResources(v *NodegroupResources) *Nodegroup { + s.Resources = v + return s +} - // The full description of the cluster to delete. - Cluster *Cluster `locationName:"cluster" type:"structure"` +// SetScalingConfig sets the ScalingConfig field's value. +func (s *Nodegroup) SetScalingConfig(v *NodegroupScalingConfig) *Nodegroup { + s.ScalingConfig = v + return s } -// String returns the string representation -func (s DeleteClusterOutput) String() string { - return awsutil.Prettify(s) +// SetStatus sets the Status field's value. +func (s *Nodegroup) SetStatus(v string) *Nodegroup { + s.Status = &v + return s } -// GoString returns the string representation -func (s DeleteClusterOutput) GoString() string { - return s.String() +// SetSubnets sets the Subnets field's value. +func (s *Nodegroup) SetSubnets(v []*string) *Nodegroup { + s.Subnets = v + return s } -// SetCluster sets the Cluster field's value. -func (s *DeleteClusterOutput) SetCluster(v *Cluster) *DeleteClusterOutput { - s.Cluster = v +// SetTags sets the Tags field's value. +func (s *Nodegroup) SetTags(v map[string]*string) *Nodegroup { + s.Tags = v return s } -type DescribeClusterInput struct { +// SetVersion sets the Version field's value. +func (s *Nodegroup) SetVersion(v string) *Nodegroup { + s.Version = &v + return s +} + +// An object representing the health status of the node group. +type NodegroupHealth struct { _ struct{} `type:"structure"` - // The name of the cluster to describe. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` + // Any issues that are associated with the node group. + Issues []*Issue `locationName:"issues" type:"list"` } // String returns the string representation -func (s DescribeClusterInput) String() string { +func (s NodegroupHealth) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClusterInput) GoString() string { +func (s NodegroupHealth) 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.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 *DescribeClusterInput) SetName(v string) *DescribeClusterInput { - s.Name = &v +// SetIssues sets the Issues field's value. +func (s *NodegroupHealth) SetIssues(v []*Issue) *NodegroupHealth { + s.Issues = v return s } -type DescribeClusterOutput struct { +// An object representing the resources associated with the node group, such +// as Auto Scaling groups and security groups for remote access. +type NodegroupResources struct { _ struct{} `type:"structure"` - // The full description of your specified cluster. - Cluster *Cluster `locationName:"cluster" type:"structure"` + // The Auto Scaling groups associated with the node group. + AutoScalingGroups []*AutoScalingGroup `locationName:"autoScalingGroups" type:"list"` + + // The remote access security group associated with the node group. This security + // group controls SSH access to the worker nodes. + RemoteAccessSecurityGroup *string `locationName:"remoteAccessSecurityGroup" type:"string"` } // String returns the string representation -func (s DescribeClusterOutput) String() string { +func (s NodegroupResources) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClusterOutput) GoString() string { +func (s NodegroupResources) GoString() string { return s.String() } -// SetCluster sets the Cluster field's value. -func (s *DescribeClusterOutput) SetCluster(v *Cluster) *DescribeClusterOutput { - s.Cluster = v +// SetAutoScalingGroups sets the AutoScalingGroups field's value. +func (s *NodegroupResources) SetAutoScalingGroups(v []*AutoScalingGroup) *NodegroupResources { + s.AutoScalingGroups = v return s } -type DescribeUpdateInput struct { +// SetRemoteAccessSecurityGroup sets the RemoteAccessSecurityGroup field's value. +func (s *NodegroupResources) SetRemoteAccessSecurityGroup(v string) *NodegroupResources { + s.RemoteAccessSecurityGroup = &v + return s +} + +// An object representing the scaling configuration details for the Auto Scaling +// group that is associated with your node group. +type NodegroupScalingConfig struct { _ struct{} `type:"structure"` - // The name of the Amazon EKS cluster to update. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` + // The current number of worker nodes that the managed node group should maintain. + DesiredSize *int64 `locationName:"desiredSize" min:"1" type:"integer"` - // The ID of the update to describe. - // - // UpdateId is a required field - UpdateId *string `location:"uri" locationName:"updateId" type:"string" required:"true"` + // The maximum number of worker nodes that the managed node group can scale + // out to. Managed node groups can support up to 100 nodes by default. + MaxSize *int64 `locationName:"maxSize" min:"1" type:"integer"` + + // The minimum number of worker nodes that the managed node group can scale + // in to. This number must be greater than zero. + MinSize *int64 `locationName:"minSize" min:"1" type:"integer"` } // String returns the string representation -func (s DescribeUpdateInput) String() string { +func (s NodegroupScalingConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeUpdateInput) GoString() string { +func (s NodegroupScalingConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeUpdateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeUpdateInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) +func (s *NodegroupScalingConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "NodegroupScalingConfig"} + if s.DesiredSize != nil && *s.DesiredSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("DesiredSize", 1)) } - if s.UpdateId == nil { - invalidParams.Add(request.NewErrParamRequired("UpdateId")) + if s.MaxSize != nil && *s.MaxSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxSize", 1)) } - if s.UpdateId != nil && len(*s.UpdateId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UpdateId", 1)) + if s.MinSize != nil && *s.MinSize < 1 { + invalidParams.Add(request.NewErrParamMinValue("MinSize", 1)) } if invalidParams.Len() > 0 { @@ -1740,481 +5124,462 @@ func (s *DescribeUpdateInput) Validate() error { return nil } -// SetName sets the Name field's value. -func (s *DescribeUpdateInput) SetName(v string) *DescribeUpdateInput { - s.Name = &v +// SetDesiredSize sets the DesiredSize field's value. +func (s *NodegroupScalingConfig) SetDesiredSize(v int64) *NodegroupScalingConfig { + s.DesiredSize = &v return s } -// SetUpdateId sets the UpdateId field's value. -func (s *DescribeUpdateInput) SetUpdateId(v string) *DescribeUpdateInput { - s.UpdateId = &v +// SetMaxSize sets the MaxSize field's value. +func (s *NodegroupScalingConfig) SetMaxSize(v int64) *NodegroupScalingConfig { + s.MaxSize = &v return s } -type DescribeUpdateOutput struct { - _ struct{} `type:"structure"` - - // The full description of the specified update. - Update *Update `locationName:"update" type:"structure"` -} - -// String returns the string representation -func (s DescribeUpdateOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeUpdateOutput) GoString() string { - return s.String() -} - -// SetUpdate sets the Update field's value. -func (s *DescribeUpdateOutput) SetUpdate(v *Update) *DescribeUpdateOutput { - s.Update = v +// SetMinSize sets the MinSize field's value. +func (s *NodegroupScalingConfig) SetMinSize(v int64) *NodegroupScalingConfig { + s.MinSize = &v return s } -// An object representing an error when an asynchronous operation fails. -type ErrorDetail struct { - _ struct{} `type:"structure"` - - // A brief description of the error. - // - // * SubnetNotFound: We couldn't find one of the subnets associated with - // the cluster. - // - // * SecurityGroupNotFound: We couldn't find one of the security groups associated - // with the cluster. - // - // * EniLimitReached: You have reached the elastic network interface limit - // for your account. - // - // * IpNotAvailable: A subnet associated with the cluster doesn't have any - // free IP addresses. - // - // * AccessDenied: You don't have permissions to perform the specified operation. - // - // * OperationNotPermitted: The service role associated with the cluster - // doesn't have the required access permissions for Amazon EKS. - // - // * VpcIdNotFound: We couldn't find the VPC associated with the cluster. - ErrorCode *string `locationName:"errorCode" type:"string" enum:"ErrorCode"` - - // A more complete description of the error. - ErrorMessage *string `locationName:"errorMessage" type:"string"` +// A service resource associated with the request could not be found. Clients +// should not retry such requests. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // An optional field that contains the resource IDs associated with the error. - ResourceIds []*string `locationName:"resourceIds" type:"list"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ErrorDetail) String() string { +func (s NotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ErrorDetail) GoString() string { +func (s NotFoundException) GoString() string { return s.String() } -// SetErrorCode sets the ErrorCode field's value. -func (s *ErrorDetail) SetErrorCode(v string) *ErrorDetail { - s.ErrorCode = &v - return s +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } } -// SetErrorMessage sets the ErrorMessage field's value. -func (s *ErrorDetail) SetErrorMessage(v string) *ErrorDetail { - s.ErrorMessage = &v - return s +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" } -// SetResourceIds sets the ResourceIds field's value. -func (s *ErrorDetail) SetResourceIds(v []*string) *ErrorDetail { - s.ResourceIds = v - return s +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// An object representing an identity provider for authentication credentials. -type Identity struct { - _ struct{} `type:"structure"` - - // The OpenID Connect (https://openid.net/connect/) identity provider information - // for the cluster. - Oidc *OIDC `locationName:"oidc" type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil } -// String returns the string representation -func (s Identity) String() string { - return awsutil.Prettify(s) +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// GoString returns the string representation -func (s Identity) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetOidc sets the Oidc field's value. -func (s *Identity) SetOidc(v *OIDC) *Identity { - s.Oidc = v - return s +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID } -type ListClustersInput struct { +// An object representing the OpenID Connect (https://openid.net/connect/) identity +// provider information for the cluster. +type OIDC struct { _ struct{} `type:"structure"` - // The maximum number of cluster results returned by ListClusters in paginated - // output. When you use this parameter, ListClusters returns only maxResults - // results in a single page along with a nextToken response element. You can - // see the remaining results of the initial request by sending another ListClusters - // request with the returned nextToken value. This value can be between 1 and - // 100. If you don't use this parameter, ListClusters returns up to 100 results - // and a nextToken value if applicable. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" 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 token should be treated as an opaque identifier that is used only to - // retrieve the next items in a list and not for other programmatic purposes. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + // The issuer URL for the OpenID Connect identity provider. + Issuer *string `locationName:"issuer" type:"string"` } // String returns the string representation -func (s ListClustersInput) String() string { +func (s OIDC) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListClustersInput) GoString() string { +func (s OIDC) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListClustersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListClustersInput"} - 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 *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 +// SetIssuer sets the Issuer field's value. +func (s *OIDC) SetIssuer(v string) *OIDC { + s.Issuer = &v return s } -type ListClustersOutput struct { +// An object representing the remote access configuration for the managed node +// group. +type RemoteAccessConfig struct { _ struct{} `type:"structure"` - // A list of all of the clusters for your account in the specified Region. - Clusters []*string `locationName:"clusters" type:"list"` + // The Amazon EC2 SSH key that provides access for SSH communication with the + // worker nodes in the managed node group. For more information, see Amazon + // EC2 Key Pairs (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html) + // in the Amazon Elastic Compute Cloud User Guide for Linux Instances. + Ec2SshKey *string `locationName:"ec2SshKey" type:"string"` - // The nextToken value to include in a future ListClusters request. When the - // results of a ListClusters request exceed maxResults, you can use this value - // 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 security groups that are allowed SSH access (port 22) to the worker nodes. + // If you specify an Amazon EC2 SSH key but do not specify a source security + // group when you create a managed node group, then port 22 on the worker nodes + // is opened to the internet (0.0.0.0/0). For more information, see Security + // Groups for Your VPC (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html) + // in the Amazon Virtual Private Cloud User Guide. + SourceSecurityGroups []*string `locationName:"sourceSecurityGroups" type:"list"` } // String returns the string representation -func (s ListClustersOutput) String() string { +func (s RemoteAccessConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListClustersOutput) GoString() string { +func (s RemoteAccessConfig) GoString() string { return s.String() } -// SetClusters sets the Clusters field's value. -func (s *ListClustersOutput) SetClusters(v []*string) *ListClustersOutput { - s.Clusters = v +// SetEc2SshKey sets the Ec2SshKey field's value. +func (s *RemoteAccessConfig) SetEc2SshKey(v string) *RemoteAccessConfig { + s.Ec2SshKey = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListClustersOutput) SetNextToken(v string) *ListClustersOutput { - s.NextToken = &v +// SetSourceSecurityGroups sets the SourceSecurityGroups field's value. +func (s *RemoteAccessConfig) SetSourceSecurityGroups(v []*string) *RemoteAccessConfig { + s.SourceSecurityGroups = v return s } -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` +// The specified resource is in use. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The Amazon Resource Name (ARN) that identifies the resource for which to - // list the tags. Currently, the supported resources are Amazon EKS clusters. - // - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` + // The Amazon EKS cluster associated with the exception. + ClusterName *string `locationName:"clusterName" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + // The Amazon EKS managed node group associated with the exception. + NodegroupName *string `locationName:"nodegroupName" type:"string"` } // String returns the string representation -func (s ListTagsForResourceInput) String() string { +func (s ResourceInUseException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsForResourceInput) GoString() string { +func (s ResourceInUseException) 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)) +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { return nil } -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v - return s +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The tags for the resource. - Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// You have encountered a service limit on the specified resource. +type ResourceLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The Amazon EKS cluster associated with the exception. + ClusterName *string `locationName:"clusterName" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + // The Amazon EKS managed node group associated with the exception. + NodegroupName *string `locationName:"nodegroupName" type:"string"` } // String returns the string representation -func (s ListTagsForResourceOutput) String() string { +func (s ResourceLimitExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsForResourceOutput) GoString() string { +func (s ResourceLimitExceededException) GoString() string { return s.String() } -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v - return s +func newErrorResourceLimitExceededException(v protocol.ResponseMetadata) error { + return &ResourceLimitExceededException{ + respMetadata: v, + } } -type ListUpdatesInput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s ResourceLimitExceededException) Code() string { + return "ResourceLimitExceededException" +} - // The maximum number of update results returned by ListUpdates in paginated - // output. When you use this parameter, ListUpdates returns only maxResults - // results in a single page along with a nextToken response element. You can - // see the remaining results of the initial request by sending another ListUpdates - // request with the returned nextToken value. This value can be between 1 and - // 100. If you don't use this parameter, ListUpdates returns up to 100 results - // and a nextToken value if applicable. - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` +// Message returns the exception's message. +func (s ResourceLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The name of the Amazon EKS cluster to list updates for. - // - // Name is a required field - Name *string `location:"uri" locationName:"name" type:"string" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceLimitExceededException) OrigErr() error { + return nil +} - // The nextToken value returned from a previous paginated ListUpdates 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. - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +func (s ResourceLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource could not be found. You can view your available clusters +// with ListClusters. You can view your available managed node groups with ListNodegroups. +// Amazon EKS clusters and node groups are Region-specific. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The Amazon EKS cluster associated with the exception. + ClusterName *string `locationName:"clusterName" type:"string"` + + // The Fargate profile associated with the exception. + FargateProfileName *string `locationName:"fargateProfileName" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + // The Amazon EKS managed node group associated with the exception. + NodegroupName *string `locationName:"nodegroupName" type:"string"` } // String returns the string representation -func (s ListUpdatesInput) String() string { +func (s ResourceNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListUpdatesInput) GoString() string { +func (s ResourceNotFoundException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListUpdatesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListUpdatesInput"} - 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)) +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { return nil } -// SetMaxResults sets the MaxResults field's value. -func (s *ListUpdatesInput) SetMaxResults(v int64) *ListUpdatesInput { - s.MaxResults = &v - return s +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetName sets the Name field's value. -func (s *ListUpdatesInput) SetName(v string) *ListUpdatesInput { - s.Name = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetNextToken sets the NextToken field's value. -func (s *ListUpdatesInput) SetNextToken(v string) *ListUpdatesInput { - s.NextToken = &v - return s +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID } -type ListUpdatesOutput struct { - _ struct{} `type:"structure"` +// These errors are usually caused by a server-side issue. +type ServerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The nextToken value to include in a future ListUpdates request. When the - // results of a ListUpdates request exceed maxResults, you can use this value - // 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 Amazon EKS cluster associated with the exception. + ClusterName *string `locationName:"clusterName" type:"string"` - // A list of all the updates for the specified cluster and Region. - UpdateIds []*string `locationName:"updateIds" type:"list"` + Message_ *string `locationName:"message" type:"string"` + + // The Amazon EKS managed node group associated with the exception. + NodegroupName *string `locationName:"nodegroupName" type:"string"` } // String returns the string representation -func (s ListUpdatesOutput) String() string { +func (s ServerException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListUpdatesOutput) GoString() string { +func (s ServerException) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListUpdatesOutput) SetNextToken(v string) *ListUpdatesOutput { - s.NextToken = &v - return s +func newErrorServerException(v protocol.ResponseMetadata) error { + return &ServerException{ + respMetadata: v, + } } -// SetUpdateIds sets the UpdateIds field's value. -func (s *ListUpdatesOutput) SetUpdateIds(v []*string) *ListUpdatesOutput { - s.UpdateIds = v - return s +// Code returns the exception type name. +func (s ServerException) Code() string { + return "ServerException" } -// An object representing the enabled or disabled Kubernetes control plane logs -// for your cluster. -type LogSetup struct { - _ struct{} `type:"structure"` - - // If a log type is enabled, that log type exports its control plane logs to - // CloudWatch Logs. If a log type isn't enabled, that log type doesn't export - // its control plane logs. Each individual log type can be enabled or disabled - // independently. - Enabled *bool `locationName:"enabled" type:"boolean"` - - // The available cluster control plane log types. - Types []*string `locationName:"types" type:"list"` +// Message returns the exception's message. +func (s ServerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s LogSetup) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServerException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s LogSetup) GoString() string { - return s.String() +func (s ServerException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetEnabled sets the Enabled field's value. -func (s *LogSetup) SetEnabled(v bool) *LogSetup { - s.Enabled = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ServerException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetTypes sets the Types field's value. -func (s *LogSetup) SetTypes(v []*string) *LogSetup { - s.Types = v - return s +// RequestID returns the service's response RequestID for request. +func (s ServerException) RequestID() string { + return s.respMetadata.RequestID } -// An object representing the logging configuration for resources in your cluster. -type Logging struct { - _ struct{} `type:"structure"` +// The service is unavailable. Back off and retry the operation. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The cluster control plane logging configuration for your cluster. - ClusterLogging []*LogSetup `locationName:"clusterLogging" type:"list"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s Logging) String() string { +func (s ServiceUnavailableException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Logging) GoString() string { +func (s ServiceUnavailableException) GoString() string { return s.String() } -// SetClusterLogging sets the ClusterLogging field's value. -func (s *Logging) SetClusterLogging(v []*LogSetup) *Logging { - s.ClusterLogging = v - return s +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } } -// An object representing the OpenID Connect (https://openid.net/connect/) identity -// provider information for the cluster. -type OIDC struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} - // The issuer URL for the OpenID Connect identity provider. - Issuer *string `locationName:"issuer" type:"string"` +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s OIDC) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s OIDC) GoString() string { - return s.String() +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetIssuer sets the Issuer field's value. -func (s *OIDC) SetIssuer(v string) *OIDC { - s.Issuer = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID } type TagResourceInput struct { _ struct{} `type:"structure"` // The Amazon Resource Name (ARN) of the resource to which to add tags. Currently, - // the supported resources are Amazon EKS clusters. + // the supported resources are Amazon EKS clusters and managed node groups. // // ResourceArn is a required field ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` @@ -2251,43 +5616,113 @@ func (s *TagResourceInput) Validate() error { invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) } - if invalidParams.Len() > 0 { - return invalidParams + 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 map[string]*string) *TagResourceInput { + s.Tags = v + return s +} + +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() +} + +// At least one of your specified cluster subnets is in an Availability Zone +// that does not support Amazon EKS. The exception output specifies the supported +// Availability Zones for your account, from which you can choose subnets for +// your cluster. +type UnsupportedAvailabilityZoneException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The Amazon EKS cluster associated with the exception. + ClusterName *string `locationName:"clusterName" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + // The Amazon EKS managed node group associated with the exception. + NodegroupName *string `locationName:"nodegroupName" type:"string"` + + // The supported Availability Zones for your account. Choose subnets in these + // Availability Zones for your cluster. + ValidZones []*string `locationName:"validZones" type:"list"` +} + +// String returns the string representation +func (s UnsupportedAvailabilityZoneException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedAvailabilityZoneException) GoString() string { + return s.String() +} + +func newErrorUnsupportedAvailabilityZoneException(v protocol.ResponseMetadata) error { + return &UnsupportedAvailabilityZoneException{ + respMetadata: v, } - return nil } -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v - return s +// Code returns the exception type name. +func (s UnsupportedAvailabilityZoneException) Code() string { + return "UnsupportedAvailabilityZoneException" } -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v map[string]*string) *TagResourceInput { - s.Tags = v - return s +// Message returns the exception's message. +func (s UnsupportedAvailabilityZoneException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type TagResourceOutput struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedAvailabilityZoneException) OrigErr() error { + return nil } -// String returns the string representation -func (s TagResourceOutput) String() string { - return awsutil.Prettify(s) +func (s UnsupportedAvailabilityZoneException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// GoString returns the string representation -func (s TagResourceOutput) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedAvailabilityZoneException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedAvailabilityZoneException) RequestID() string { + return s.respMetadata.RequestID } type UntagResourceInput struct { _ struct{} `type:"structure"` // The Amazon Resource Name (ARN) of the resource from which to delete tags. - // Currently, the supported resources are Amazon EKS clusters. + // Currently, the supported resources are Amazon EKS clusters and managed node + // groups. // // ResourceArn is a required field ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` @@ -2613,6 +6048,283 @@ func (s *UpdateClusterVersionOutput) SetUpdate(v *Update) *UpdateClusterVersionO return s } +// An object representing a Kubernetes label change for a managed node group. +type UpdateLabelsPayload struct { + _ struct{} `type:"structure"` + + // Kubernetes labels to be added or updated. + AddOrUpdateLabels map[string]*string `locationName:"addOrUpdateLabels" type:"map"` + + // Kubernetes labels to be removed. + RemoveLabels []*string `locationName:"removeLabels" type:"list"` +} + +// String returns the string representation +func (s UpdateLabelsPayload) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateLabelsPayload) GoString() string { + return s.String() +} + +// SetAddOrUpdateLabels sets the AddOrUpdateLabels field's value. +func (s *UpdateLabelsPayload) SetAddOrUpdateLabels(v map[string]*string) *UpdateLabelsPayload { + s.AddOrUpdateLabels = v + return s +} + +// SetRemoveLabels sets the RemoveLabels field's value. +func (s *UpdateLabelsPayload) SetRemoveLabels(v []*string) *UpdateLabelsPayload { + s.RemoveLabels = v + return s +} + +type UpdateNodegroupConfigInput struct { + _ struct{} `type:"structure"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` + + // The name of the Amazon EKS cluster that the managed node group resides in. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // The Kubernetes labels to be applied to the nodes in the node group after + // the update. + Labels *UpdateLabelsPayload `locationName:"labels" type:"structure"` + + // The name of the managed node group to update. + // + // NodegroupName is a required field + NodegroupName *string `location:"uri" locationName:"nodegroupName" type:"string" required:"true"` + + // The scaling configuration details for the Auto Scaling group after the update. + ScalingConfig *NodegroupScalingConfig `locationName:"scalingConfig" type:"structure"` +} + +// String returns the string representation +func (s UpdateNodegroupConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateNodegroupConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateNodegroupConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateNodegroupConfigInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.NodegroupName == nil { + invalidParams.Add(request.NewErrParamRequired("NodegroupName")) + } + if s.NodegroupName != nil && len(*s.NodegroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NodegroupName", 1)) + } + if s.ScalingConfig != nil { + if err := s.ScalingConfig.Validate(); err != nil { + invalidParams.AddNested("ScalingConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *UpdateNodegroupConfigInput) SetClientRequestToken(v string) *UpdateNodegroupConfigInput { + s.ClientRequestToken = &v + return s +} + +// SetClusterName sets the ClusterName field's value. +func (s *UpdateNodegroupConfigInput) SetClusterName(v string) *UpdateNodegroupConfigInput { + s.ClusterName = &v + return s +} + +// SetLabels sets the Labels field's value. +func (s *UpdateNodegroupConfigInput) SetLabels(v *UpdateLabelsPayload) *UpdateNodegroupConfigInput { + s.Labels = v + return s +} + +// SetNodegroupName sets the NodegroupName field's value. +func (s *UpdateNodegroupConfigInput) SetNodegroupName(v string) *UpdateNodegroupConfigInput { + s.NodegroupName = &v + return s +} + +// SetScalingConfig sets the ScalingConfig field's value. +func (s *UpdateNodegroupConfigInput) SetScalingConfig(v *NodegroupScalingConfig) *UpdateNodegroupConfigInput { + s.ScalingConfig = v + return s +} + +type UpdateNodegroupConfigOutput struct { + _ struct{} `type:"structure"` + + // An object representing an asynchronous update. + Update *Update `locationName:"update" type:"structure"` +} + +// String returns the string representation +func (s UpdateNodegroupConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateNodegroupConfigOutput) GoString() string { + return s.String() +} + +// SetUpdate sets the Update field's value. +func (s *UpdateNodegroupConfigOutput) SetUpdate(v *Update) *UpdateNodegroupConfigOutput { + s.Update = v + return s +} + +type UpdateNodegroupVersionInput struct { + _ struct{} `type:"structure"` + + // Unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientRequestToken *string `locationName:"clientRequestToken" type:"string" idempotencyToken:"true"` + + // The name of the Amazon EKS cluster that is associated with the managed node + // group to update. + // + // ClusterName is a required field + ClusterName *string `location:"uri" locationName:"name" type:"string" required:"true"` + + // Force the update if the existing node group's pods are unable to be drained + // due to a pod disruption budget issue. If an update fails because pods could + // not be drained, you can force the update after it fails to terminate the + // old node whether or not any pods are running on the node. + Force *bool `locationName:"force" type:"boolean"` + + // The name of the managed node group to update. + // + // NodegroupName is a required field + NodegroupName *string `location:"uri" locationName:"nodegroupName" type:"string" required:"true"` + + // The AMI version of the Amazon EKS-optimized AMI to use for the update. By + // default, the latest available AMI version for the node group's Kubernetes + // version is used. For more information, see Amazon EKS-Optimized Linux AMI + // Versions (https://docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html) + // in the Amazon EKS User Guide. + ReleaseVersion *string `locationName:"releaseVersion" type:"string"` + + // The Kubernetes version to update to. If no version is specified, then the + // Kubernetes version of the node group does not change. You can specify the + // Kubernetes version of the cluster to update the node group to the latest + // AMI version of the cluster's Kubernetes version. + Version *string `locationName:"version" type:"string"` +} + +// String returns the string representation +func (s UpdateNodegroupVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateNodegroupVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateNodegroupVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateNodegroupVersionInput"} + if s.ClusterName == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterName")) + } + if s.ClusterName != nil && len(*s.ClusterName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterName", 1)) + } + if s.NodegroupName == nil { + invalidParams.Add(request.NewErrParamRequired("NodegroupName")) + } + if s.NodegroupName != nil && len(*s.NodegroupName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NodegroupName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *UpdateNodegroupVersionInput) SetClientRequestToken(v string) *UpdateNodegroupVersionInput { + s.ClientRequestToken = &v + return s +} + +// SetClusterName sets the ClusterName field's value. +func (s *UpdateNodegroupVersionInput) SetClusterName(v string) *UpdateNodegroupVersionInput { + s.ClusterName = &v + return s +} + +// SetForce sets the Force field's value. +func (s *UpdateNodegroupVersionInput) SetForce(v bool) *UpdateNodegroupVersionInput { + s.Force = &v + return s +} + +// SetNodegroupName sets the NodegroupName field's value. +func (s *UpdateNodegroupVersionInput) SetNodegroupName(v string) *UpdateNodegroupVersionInput { + s.NodegroupName = &v + return s +} + +// SetReleaseVersion sets the ReleaseVersion field's value. +func (s *UpdateNodegroupVersionInput) SetReleaseVersion(v string) *UpdateNodegroupVersionInput { + s.ReleaseVersion = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *UpdateNodegroupVersionInput) SetVersion(v string) *UpdateNodegroupVersionInput { + s.Version = &v + return s +} + +type UpdateNodegroupVersionOutput struct { + _ struct{} `type:"structure"` + + // An object representing an asynchronous update. + Update *Update `locationName:"update" type:"structure"` +} + +// String returns the string representation +func (s UpdateNodegroupVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateNodegroupVersionOutput) GoString() string { + return s.String() +} + +// SetUpdate sets the Update field's value. +func (s *UpdateNodegroupVersionOutput) SetUpdate(v *Update) *UpdateNodegroupVersionOutput { + s.Update = v + return s +} + // An object representing the details of an update request. type UpdateParam struct { _ struct{} `type:"structure"` @@ -2654,20 +6366,33 @@ type VpcConfigRequest struct { // API server endpoint. If you enable private access, Kubernetes API requests // from within your cluster's VPC use the private VPC endpoint. The default // value for this parameter is false, which disables private access for your - // Kubernetes API server. For more information, see Amazon EKS Cluster Endpoint - // Access Control (https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html) + // Kubernetes API server. If you disable private access and you have worker + // nodes or AWS Fargate pods in the cluster, then ensure that publicAccessCidrs + // includes the necessary CIDR blocks for communication with the worker nodes + // or Fargate pods. For more information, see Amazon EKS Cluster Endpoint Access + // Control (https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html) // in the Amazon EKS User Guide . EndpointPrivateAccess *bool `locationName:"endpointPrivateAccess" type:"boolean"` - // Set this value to false to disable public access for your cluster's Kubernetes + // Set this value to false to disable public access to your cluster's Kubernetes // API server endpoint. If you disable public access, your cluster's Kubernetes - // API server can receive only requests from within the cluster VPC. The default + // API server can only receive requests from within the cluster VPC. The default // value for this parameter is true, which enables public access for your Kubernetes // API server. For more information, see Amazon EKS Cluster Endpoint Access // Control (https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html) // in the Amazon EKS User Guide . EndpointPublicAccess *bool `locationName:"endpointPublicAccess" type:"boolean"` + // The CIDR blocks that are allowed access to your cluster's public Kubernetes + // API server endpoint. Communication to the endpoint from addresses outside + // of the CIDR blocks that you specify is denied. The default value is 0.0.0.0/0. + // If you've disabled private endpoint access and you have worker nodes or AWS + // Fargate pods in the cluster, then ensure that you specify the necessary CIDR + // blocks. For more information, see Amazon EKS Cluster Endpoint Access Control + // (https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html) + // in the Amazon EKS User Guide . + PublicAccessCidrs []*string `locationName:"publicAccessCidrs" type:"list"` + // Specify one or more security groups for the cross-account elastic network // interfaces that Amazon EKS creates to use to allow communication between // your worker nodes and the Kubernetes control plane. If you don't specify @@ -2702,6 +6427,12 @@ func (s *VpcConfigRequest) SetEndpointPublicAccess(v bool) *VpcConfigRequest { return s } +// SetPublicAccessCidrs sets the PublicAccessCidrs field's value. +func (s *VpcConfigRequest) SetPublicAccessCidrs(v []*string) *VpcConfigRequest { + s.PublicAccessCidrs = v + return s +} + // SetSecurityGroupIds sets the SecurityGroupIds field's value. func (s *VpcConfigRequest) SetSecurityGroupIds(v []*string) *VpcConfigRequest { s.SecurityGroupIds = v @@ -2718,18 +6449,37 @@ func (s *VpcConfigRequest) SetSubnetIds(v []*string) *VpcConfigRequest { type VpcConfigResponse struct { _ struct{} `type:"structure"` + // The cluster security group that was created by Amazon EKS for the cluster. + // Managed node groups use this security group for control-plane-to-data-plane + // communication. + ClusterSecurityGroupId *string `locationName:"clusterSecurityGroupId" type:"string"` + // This parameter indicates whether the Amazon EKS private API server endpoint // is enabled. If the Amazon EKS private API server endpoint is enabled, Kubernetes // API requests that originate from within your cluster's VPC use the private - // VPC endpoint instead of traversing the internet. + // VPC endpoint instead of traversing the internet. If this value is disabled + // and you have worker nodes or AWS Fargate pods in the cluster, then ensure + // that publicAccessCidrs includes the necessary CIDR blocks for communication + // with the worker nodes or Fargate pods. For more information, see Amazon EKS + // Cluster Endpoint Access Control (https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html) + // in the Amazon EKS User Guide . EndpointPrivateAccess *bool `locationName:"endpointPrivateAccess" type:"boolean"` // This parameter indicates whether the Amazon EKS public API server endpoint // is enabled. If the Amazon EKS public API server endpoint is disabled, your - // cluster's Kubernetes API server can receive only requests that originate + // cluster's Kubernetes API server can only receive requests that originate // from within the cluster VPC. EndpointPublicAccess *bool `locationName:"endpointPublicAccess" type:"boolean"` + // The CIDR blocks that are allowed access to your cluster's public Kubernetes + // API server endpoint. Communication to the endpoint from addresses outside + // of the listed CIDR blocks is denied. The default value is 0.0.0.0/0. If you've + // disabled private endpoint access and you have worker nodes or AWS Fargate + // pods in the cluster, then ensure that the necessary CIDR blocks are listed. + // For more information, see Amazon EKS Cluster Endpoint Access Control (https://docs.aws.amazon.com/eks/latest/userguide/cluster-endpoint.html) + // in the Amazon EKS User Guide . + PublicAccessCidrs []*string `locationName:"publicAccessCidrs" type:"list"` + // The security groups associated with the cross-account elastic network interfaces // that are used to allow communication between your worker nodes and the Kubernetes // control plane. @@ -2752,6 +6502,12 @@ func (s VpcConfigResponse) GoString() string { return s.String() } +// SetClusterSecurityGroupId sets the ClusterSecurityGroupId field's value. +func (s *VpcConfigResponse) SetClusterSecurityGroupId(v string) *VpcConfigResponse { + s.ClusterSecurityGroupId = &v + return s +} + // SetEndpointPrivateAccess sets the EndpointPrivateAccess field's value. func (s *VpcConfigResponse) SetEndpointPrivateAccess(v bool) *VpcConfigResponse { s.EndpointPrivateAccess = &v @@ -2764,6 +6520,12 @@ func (s *VpcConfigResponse) SetEndpointPublicAccess(v bool) *VpcConfigResponse { return s } +// SetPublicAccessCidrs sets the PublicAccessCidrs field's value. +func (s *VpcConfigResponse) SetPublicAccessCidrs(v []*string) *VpcConfigResponse { + s.PublicAccessCidrs = v + return s +} + // SetSecurityGroupIds sets the SecurityGroupIds field's value. func (s *VpcConfigResponse) SetSecurityGroupIds(v []*string) *VpcConfigResponse { s.SecurityGroupIds = v @@ -2782,6 +6544,14 @@ func (s *VpcConfigResponse) SetVpcId(v string) *VpcConfigResponse { return s } +const ( + // AMITypesAl2X8664 is a AMITypes enum value + AMITypesAl2X8664 = "AL2_x86_64" + + // AMITypesAl2X8664Gpu is a AMITypes enum value + AMITypesAl2X8664Gpu = "AL2_x86_64_GPU" +) + const ( // ClusterStatusCreating is a ClusterStatus enum value ClusterStatusCreating = "CREATING" @@ -2794,6 +6564,9 @@ const ( // ClusterStatusFailed is a ClusterStatus enum value ClusterStatusFailed = "FAILED" + + // ClusterStatusUpdating is a ClusterStatus enum value + ClusterStatusUpdating = "UPDATING" ) const ( @@ -2820,6 +6593,32 @@ const ( // ErrorCodeUnknown is a ErrorCode enum value ErrorCodeUnknown = "Unknown" + + // ErrorCodeNodeCreationFailure is a ErrorCode enum value + ErrorCodeNodeCreationFailure = "NodeCreationFailure" + + // ErrorCodePodEvictionFailure is a ErrorCode enum value + ErrorCodePodEvictionFailure = "PodEvictionFailure" + + // ErrorCodeInsufficientFreeAddresses is a ErrorCode enum value + ErrorCodeInsufficientFreeAddresses = "InsufficientFreeAddresses" +) + +const ( + // FargateProfileStatusCreating is a FargateProfileStatus enum value + FargateProfileStatusCreating = "CREATING" + + // FargateProfileStatusActive is a FargateProfileStatus enum value + FargateProfileStatusActive = "ACTIVE" + + // FargateProfileStatusDeleting is a FargateProfileStatus enum value + FargateProfileStatusDeleting = "DELETING" + + // FargateProfileStatusCreateFailed is a FargateProfileStatus enum value + FargateProfileStatusCreateFailed = "CREATE_FAILED" + + // FargateProfileStatusDeleteFailed is a FargateProfileStatus enum value + FargateProfileStatusDeleteFailed = "DELETE_FAILED" ) const ( @@ -2839,6 +6638,73 @@ const ( LogTypeScheduler = "scheduler" ) +const ( + // NodegroupIssueCodeAutoScalingGroupNotFound is a NodegroupIssueCode enum value + NodegroupIssueCodeAutoScalingGroupNotFound = "AutoScalingGroupNotFound" + + // NodegroupIssueCodeAutoScalingGroupInvalidConfiguration is a NodegroupIssueCode enum value + NodegroupIssueCodeAutoScalingGroupInvalidConfiguration = "AutoScalingGroupInvalidConfiguration" + + // NodegroupIssueCodeEc2securityGroupNotFound is a NodegroupIssueCode enum value + NodegroupIssueCodeEc2securityGroupNotFound = "Ec2SecurityGroupNotFound" + + // NodegroupIssueCodeEc2securityGroupDeletionFailure is a NodegroupIssueCode enum value + NodegroupIssueCodeEc2securityGroupDeletionFailure = "Ec2SecurityGroupDeletionFailure" + + // NodegroupIssueCodeEc2launchTemplateNotFound is a NodegroupIssueCode enum value + NodegroupIssueCodeEc2launchTemplateNotFound = "Ec2LaunchTemplateNotFound" + + // NodegroupIssueCodeEc2launchTemplateVersionMismatch is a NodegroupIssueCode enum value + NodegroupIssueCodeEc2launchTemplateVersionMismatch = "Ec2LaunchTemplateVersionMismatch" + + // NodegroupIssueCodeEc2subnetNotFound is a NodegroupIssueCode enum value + NodegroupIssueCodeEc2subnetNotFound = "Ec2SubnetNotFound" + + // NodegroupIssueCodeIamInstanceProfileNotFound is a NodegroupIssueCode enum value + NodegroupIssueCodeIamInstanceProfileNotFound = "IamInstanceProfileNotFound" + + // NodegroupIssueCodeIamNodeRoleNotFound is a NodegroupIssueCode enum value + NodegroupIssueCodeIamNodeRoleNotFound = "IamNodeRoleNotFound" + + // NodegroupIssueCodeAsgInstanceLaunchFailures is a NodegroupIssueCode enum value + NodegroupIssueCodeAsgInstanceLaunchFailures = "AsgInstanceLaunchFailures" + + // NodegroupIssueCodeInstanceLimitExceeded is a NodegroupIssueCode enum value + NodegroupIssueCodeInstanceLimitExceeded = "InstanceLimitExceeded" + + // NodegroupIssueCodeInsufficientFreeAddresses is a NodegroupIssueCode enum value + NodegroupIssueCodeInsufficientFreeAddresses = "InsufficientFreeAddresses" + + // NodegroupIssueCodeAccessDenied is a NodegroupIssueCode enum value + NodegroupIssueCodeAccessDenied = "AccessDenied" + + // NodegroupIssueCodeInternalFailure is a NodegroupIssueCode enum value + NodegroupIssueCodeInternalFailure = "InternalFailure" +) + +const ( + // NodegroupStatusCreating is a NodegroupStatus enum value + NodegroupStatusCreating = "CREATING" + + // NodegroupStatusActive is a NodegroupStatus enum value + NodegroupStatusActive = "ACTIVE" + + // NodegroupStatusUpdating is a NodegroupStatus enum value + NodegroupStatusUpdating = "UPDATING" + + // NodegroupStatusDeleting is a NodegroupStatus enum value + NodegroupStatusDeleting = "DELETING" + + // NodegroupStatusCreateFailed is a NodegroupStatus enum value + NodegroupStatusCreateFailed = "CREATE_FAILED" + + // NodegroupStatusDeleteFailed is a NodegroupStatus enum value + NodegroupStatusDeleteFailed = "DELETE_FAILED" + + // NodegroupStatusDegraded is a NodegroupStatus enum value + NodegroupStatusDegraded = "DEGRADED" +) + const ( // UpdateParamTypeVersion is a UpdateParamType enum value UpdateParamTypeVersion = "Version" @@ -2854,6 +6720,27 @@ const ( // UpdateParamTypeClusterLogging is a UpdateParamType enum value UpdateParamTypeClusterLogging = "ClusterLogging" + + // UpdateParamTypeDesiredSize is a UpdateParamType enum value + UpdateParamTypeDesiredSize = "DesiredSize" + + // UpdateParamTypeLabelsToAdd is a UpdateParamType enum value + UpdateParamTypeLabelsToAdd = "LabelsToAdd" + + // UpdateParamTypeLabelsToRemove is a UpdateParamType enum value + UpdateParamTypeLabelsToRemove = "LabelsToRemove" + + // UpdateParamTypeMaxSize is a UpdateParamType enum value + UpdateParamTypeMaxSize = "MaxSize" + + // UpdateParamTypeMinSize is a UpdateParamType enum value + UpdateParamTypeMinSize = "MinSize" + + // UpdateParamTypeReleaseVersion is a UpdateParamType enum value + UpdateParamTypeReleaseVersion = "ReleaseVersion" + + // UpdateParamTypePublicAccessCidrs is a UpdateParamType enum value + UpdateParamTypePublicAccessCidrs = "PublicAccessCidrs" ) const ( @@ -2879,4 +6766,7 @@ const ( // UpdateTypeLoggingUpdate is a UpdateType enum value UpdateTypeLoggingUpdate = "LoggingUpdate" + + // UpdateTypeConfigUpdate is a UpdateType enum value + UpdateTypeConfigUpdate = "ConfigUpdate" ) diff --git a/vendor/github.com/aws/aws-sdk-go/service/eks/errors.go b/vendor/github.com/aws/aws-sdk-go/service/eks/errors.go index 6fd3dd1d8c5..7c908d3008e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/eks/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/eks/errors.go @@ -2,6 +2,10 @@ package eks +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadRequestException for service response error code @@ -56,7 +60,8 @@ const ( // "ResourceNotFoundException". // // The specified resource could not be found. You can view your available clusters - // with ListClusters. Amazon EKS clusters are Region-specific. + // with ListClusters. You can view your available managed node groups with ListNodegroups. + // Amazon EKS clusters and node groups are Region-specific. ErrCodeResourceNotFoundException = "ResourceNotFoundException" // ErrCodeServerException for service response error code @@ -80,3 +85,17 @@ const ( // your cluster. ErrCodeUnsupportedAvailabilityZoneException = "UnsupportedAvailabilityZoneException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadRequestException": newErrorBadRequestException, + "ClientException": newErrorClientException, + "InvalidParameterException": newErrorInvalidParameterException, + "InvalidRequestException": newErrorInvalidRequestException, + "NotFoundException": newErrorNotFoundException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceLimitExceededException": newErrorResourceLimitExceededException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ServerException": newErrorServerException, + "ServiceUnavailableException": newErrorServiceUnavailableException, + "UnsupportedAvailabilityZoneException": newErrorUnsupportedAvailabilityZoneException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/eks/service.go b/vendor/github.com/aws/aws-sdk-go/service/eks/service.go index a51bf5458c6..3fc2175454e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/eks/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/eks/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "eks" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "EKS" // ServiceID is a unique identifer of a specific service. + ServiceID = "EKS" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the EKS client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a EKS client from just a session. // svc := eks.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *EKS { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "eks" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *EKS { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *EKS { svc := &EKS{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-11-01", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/eks/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/eks/waiters.go index 022255cf053..31d2071b258 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/eks/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/eks/waiters.go @@ -120,3 +120,105 @@ func (c *EKS) WaitUntilClusterDeletedWithContext(ctx aws.Context, input *Describ return w.WaitWithContext(ctx) } + +// WaitUntilNodegroupActive uses the Amazon EKS API operation +// DescribeNodegroup to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *EKS) WaitUntilNodegroupActive(input *DescribeNodegroupInput) error { + return c.WaitUntilNodegroupActiveWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilNodegroupActiveWithContext is an extended version of WaitUntilNodegroupActive. +// 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 *EKS) WaitUntilNodegroupActiveWithContext(ctx aws.Context, input *DescribeNodegroupInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilNodegroupActive", + MaxAttempts: 80, + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "nodegroup.status", + Expected: "CREATE_FAILED", + }, + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "nodegroup.status", + Expected: "ACTIVE", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeNodegroupInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNodegroupRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + +// WaitUntilNodegroupDeleted uses the Amazon EKS API operation +// DescribeNodegroup to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *EKS) WaitUntilNodegroupDeleted(input *DescribeNodegroupInput) error { + return c.WaitUntilNodegroupDeletedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilNodegroupDeletedWithContext is an extended version of WaitUntilNodegroupDeleted. +// 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 *EKS) WaitUntilNodegroupDeletedWithContext(ctx aws.Context, input *DescribeNodegroupInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilNodegroupDeleted", + MaxAttempts: 40, + Delay: request.ConstantWaiterDelay(30 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "nodegroup.status", + Expected: "DELETE_FAILED", + }, + { + State: request.SuccessWaiterState, + Matcher: request.ErrorWaiterMatch, + Expected: "ResourceNotFoundException", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeNodegroupInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeNodegroupRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticache/api.go b/vendor/github.com/aws/aws-sdk-go/service/elasticache/api.go index f3d4246019a..d72e03e5ed4 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticache/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticache/api.go @@ -377,6 +377,91 @@ func (c *ElastiCache) BatchStopUpdateActionWithContext(ctx aws.Context, input *B return out, req.Send() } +const opCompleteMigration = "CompleteMigration" + +// CompleteMigrationRequest generates a "aws/request.Request" representing the +// client's request for the CompleteMigration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CompleteMigration for more information on using the CompleteMigration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CompleteMigrationRequest method. +// req, resp := client.CompleteMigrationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CompleteMigration +func (c *ElastiCache) CompleteMigrationRequest(input *CompleteMigrationInput) (req *request.Request, output *CompleteMigrationOutput) { + op := &request.Operation{ + Name: opCompleteMigration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CompleteMigrationInput{} + } + + output = &CompleteMigrationOutput{} + req = c.newRequest(op, input, output) + return +} + +// CompleteMigration API operation for Amazon ElastiCache. +// +// Complete the migration of 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 ElastiCache's +// API operation CompleteMigration 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. +// +// * ErrCodeReplicationGroupNotUnderMigrationFault "ReplicationGroupNotUnderMigrationFault" +// The designated replication group is not available for data migration. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/CompleteMigration +func (c *ElastiCache) CompleteMigration(input *CompleteMigrationInput) (*CompleteMigrationOutput, error) { + req, out := c.CompleteMigrationRequest(input) + return out, req.Send() +} + +// CompleteMigrationWithContext is the same as CompleteMigration with the addition of +// the ability to pass a context and additional request options. +// +// See CompleteMigration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ElastiCache) CompleteMigrationWithContext(ctx aws.Context, input *CompleteMigrationInput, opts ...request.Option) (*CompleteMigrationOutput, error) { + req, out := c.CompleteMigrationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCopySnapshot = "CopySnapshot" // CopySnapshotRequest generates a "aws/request.Request" representing the @@ -2100,10 +2185,12 @@ func (c *ElastiCache) DescribeCacheClustersPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCacheClustersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeCacheClustersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2230,10 +2317,12 @@ func (c *ElastiCache) DescribeCacheEngineVersionsPagesWithContext(ctx aws.Contex }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCacheEngineVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeCacheEngineVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2374,10 +2463,12 @@ func (c *ElastiCache) DescribeCacheParameterGroupsPagesWithContext(ctx aws.Conte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCacheParameterGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeCacheParameterGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2516,10 +2607,12 @@ func (c *ElastiCache) DescribeCacheParametersPagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCacheParametersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeCacheParametersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2660,10 +2753,12 @@ func (c *ElastiCache) DescribeCacheSecurityGroupsPagesWithContext(ctx aws.Contex }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCacheSecurityGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeCacheSecurityGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2799,10 +2894,12 @@ func (c *ElastiCache) DescribeCacheSubnetGroupsPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeCacheSubnetGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeCacheSubnetGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2938,10 +3035,12 @@ func (c *ElastiCache) DescribeEngineDefaultParametersPagesWithContext(ctx aws.Co }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEngineDefaultParametersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEngineDefaultParametersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3081,10 +3180,12 @@ func (c *ElastiCache) DescribeEventsPagesWithContext(ctx aws.Context, input *Des }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3226,10 +3327,12 @@ func (c *ElastiCache) DescribeReplicationGroupsPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReplicationGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReplicationGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3368,10 +3471,12 @@ func (c *ElastiCache) DescribeReservedCacheNodesPagesWithContext(ctx aws.Context }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedCacheNodesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReservedCacheNodesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3509,10 +3614,12 @@ func (c *ElastiCache) DescribeReservedCacheNodesOfferingsPagesWithContext(ctx aw }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedCacheNodesOfferingsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReservedCacheNodesOfferingsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3650,10 +3757,12 @@ func (c *ElastiCache) DescribeServiceUpdatesPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeServiceUpdatesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeServiceUpdatesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3799,10 +3908,12 @@ func (c *ElastiCache) DescribeSnapshotsPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeSnapshotsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeSnapshotsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3937,10 +4048,12 @@ func (c *ElastiCache) DescribeUpdateActionsPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeUpdateActionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeUpdateActionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5264,6 +5377,94 @@ func (c *ElastiCache) RevokeCacheSecurityGroupIngressWithContext(ctx aws.Context return out, req.Send() } +const opStartMigration = "StartMigration" + +// StartMigrationRequest generates a "aws/request.Request" representing the +// client's request for the StartMigration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartMigration for more information on using the StartMigration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartMigrationRequest method. +// req, resp := client.StartMigrationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/StartMigration +func (c *ElastiCache) StartMigrationRequest(input *StartMigrationInput) (req *request.Request, output *StartMigrationOutput) { + op := &request.Operation{ + Name: opStartMigration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StartMigrationInput{} + } + + output = &StartMigrationOutput{} + req = c.newRequest(op, input, output) + return +} + +// StartMigration API operation for Amazon ElastiCache. +// +// Start the migration of 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 ElastiCache's +// API operation StartMigration 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. +// +// * ErrCodeReplicationGroupAlreadyUnderMigrationFault "ReplicationGroupAlreadyUnderMigrationFault" +// The targeted replication group is not available. +// +// * ErrCodeInvalidParameterValueException "InvalidParameterValue" +// The value for a parameter is invalid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticache-2015-02-02/StartMigration +func (c *ElastiCache) StartMigration(input *StartMigrationInput) (*StartMigrationOutput, error) { + req, out := c.StartMigrationRequest(input) + return out, req.Send() +} + +// StartMigrationWithContext is the same as StartMigration with the addition of +// the ability to pass a context and additional request options. +// +// See StartMigration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *ElastiCache) StartMigrationWithContext(ctx aws.Context, input *StartMigrationInput, opts ...request.Option) (*StartMigrationOutput, error) { + req, out := c.StartMigrationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opTestFailover = "TestFailover" // TestFailoverRequest generates a "aws/request.Request" representing the @@ -5586,10 +5787,11 @@ func (s *AvailabilityZone) SetName(v string) *AvailabilityZone { type BatchApplyUpdateActionInput struct { _ struct{} `type:"structure"` + // The cache cluster IDs + CacheClusterIds []*string `type:"list"` + // The replication group IDs - // - // ReplicationGroupIds is a required field - ReplicationGroupIds []*string `type:"list" required:"true"` + ReplicationGroupIds []*string `type:"list"` // The unique ID of the service update // @@ -5610,9 +5812,6 @@ func (s BatchApplyUpdateActionInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *BatchApplyUpdateActionInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "BatchApplyUpdateActionInput"} - if s.ReplicationGroupIds == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationGroupIds")) - } if s.ServiceUpdateName == nil { invalidParams.Add(request.NewErrParamRequired("ServiceUpdateName")) } @@ -5623,6 +5822,12 @@ func (s *BatchApplyUpdateActionInput) Validate() error { return nil } +// SetCacheClusterIds sets the CacheClusterIds field's value. +func (s *BatchApplyUpdateActionInput) SetCacheClusterIds(v []*string) *BatchApplyUpdateActionInput { + s.CacheClusterIds = v + return s +} + // SetReplicationGroupIds sets the ReplicationGroupIds field's value. func (s *BatchApplyUpdateActionInput) SetReplicationGroupIds(v []*string) *BatchApplyUpdateActionInput { s.ReplicationGroupIds = v @@ -5670,10 +5875,11 @@ func (s *BatchApplyUpdateActionOutput) SetUnprocessedUpdateActions(v []*Unproces type BatchStopUpdateActionInput struct { _ struct{} `type:"structure"` + // The cache cluster IDs + CacheClusterIds []*string `type:"list"` + // The replication group IDs - // - // ReplicationGroupIds is a required field - ReplicationGroupIds []*string `type:"list" required:"true"` + ReplicationGroupIds []*string `type:"list"` // The unique ID of the service update // @@ -5694,9 +5900,6 @@ func (s BatchStopUpdateActionInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *BatchStopUpdateActionInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "BatchStopUpdateActionInput"} - if s.ReplicationGroupIds == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationGroupIds")) - } if s.ServiceUpdateName == nil { invalidParams.Add(request.NewErrParamRequired("ServiceUpdateName")) } @@ -5707,6 +5910,12 @@ func (s *BatchStopUpdateActionInput) Validate() error { return nil } +// SetCacheClusterIds sets the CacheClusterIds field's value. +func (s *BatchStopUpdateActionInput) SetCacheClusterIds(v []*string) *BatchStopUpdateActionInput { + s.CacheClusterIds = v + return s +} + // SetReplicationGroupIds sets the ReplicationGroupIds field's value. func (s *BatchStopUpdateActionInput) SetReplicationGroupIds(v []*string) *BatchStopUpdateActionInput { s.ReplicationGroupIds = v @@ -5772,6 +5981,9 @@ type CacheCluster struct { // Default: false AuthTokenEnabled *bool `type:"boolean"` + // The date the auth token was last modified + AuthTokenLastModifiedDate *time.Time `type:"timestamp"` + // This parameter is currently disabled. AutoMinorVersionUpgrade *bool `type:"boolean"` @@ -5952,6 +6164,12 @@ func (s *CacheCluster) SetAuthTokenEnabled(v bool) *CacheCluster { return s } +// SetAuthTokenLastModifiedDate sets the AuthTokenLastModifiedDate field's value. +func (s *CacheCluster) SetAuthTokenLastModifiedDate(v time.Time) *CacheCluster { + s.AuthTokenLastModifiedDate = &v + return s +} + // SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. func (s *CacheCluster) SetAutoMinorVersionUpgrade(v bool) *CacheCluster { s.AutoMinorVersionUpgrade = &v @@ -6407,6 +6625,94 @@ func (s *CacheNodeTypeSpecificValue) SetValue(v string) *CacheNodeTypeSpecificVa return s } +// The status of the service update on the cache node +type CacheNodeUpdateStatus struct { + _ struct{} `type:"structure"` + + // The node ID of the cache cluster + CacheNodeId *string `type:"string"` + + // The deletion date of the node + NodeDeletionDate *time.Time `type:"timestamp"` + + // The end date of the update for a node + NodeUpdateEndDate *time.Time `type:"timestamp"` + + // Reflects whether the update was initiated by the customer or automatically + // applied + NodeUpdateInitiatedBy *string `type:"string" enum:"NodeUpdateInitiatedBy"` + + // The date when the update is triggered + NodeUpdateInitiatedDate *time.Time `type:"timestamp"` + + // The start date of the update for a node + NodeUpdateStartDate *time.Time `type:"timestamp"` + + // The update status of the node + NodeUpdateStatus *string `type:"string" enum:"NodeUpdateStatus"` + + // The date when the NodeUpdateStatus was last modified> + NodeUpdateStatusModifiedDate *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s CacheNodeUpdateStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CacheNodeUpdateStatus) GoString() string { + return s.String() +} + +// SetCacheNodeId sets the CacheNodeId field's value. +func (s *CacheNodeUpdateStatus) SetCacheNodeId(v string) *CacheNodeUpdateStatus { + s.CacheNodeId = &v + return s +} + +// SetNodeDeletionDate sets the NodeDeletionDate field's value. +func (s *CacheNodeUpdateStatus) SetNodeDeletionDate(v time.Time) *CacheNodeUpdateStatus { + s.NodeDeletionDate = &v + return s +} + +// SetNodeUpdateEndDate sets the NodeUpdateEndDate field's value. +func (s *CacheNodeUpdateStatus) SetNodeUpdateEndDate(v time.Time) *CacheNodeUpdateStatus { + s.NodeUpdateEndDate = &v + return s +} + +// SetNodeUpdateInitiatedBy sets the NodeUpdateInitiatedBy field's value. +func (s *CacheNodeUpdateStatus) SetNodeUpdateInitiatedBy(v string) *CacheNodeUpdateStatus { + s.NodeUpdateInitiatedBy = &v + return s +} + +// SetNodeUpdateInitiatedDate sets the NodeUpdateInitiatedDate field's value. +func (s *CacheNodeUpdateStatus) SetNodeUpdateInitiatedDate(v time.Time) *CacheNodeUpdateStatus { + s.NodeUpdateInitiatedDate = &v + return s +} + +// SetNodeUpdateStartDate sets the NodeUpdateStartDate field's value. +func (s *CacheNodeUpdateStatus) SetNodeUpdateStartDate(v time.Time) *CacheNodeUpdateStatus { + s.NodeUpdateStartDate = &v + return s +} + +// SetNodeUpdateStatus sets the NodeUpdateStatus field's value. +func (s *CacheNodeUpdateStatus) SetNodeUpdateStatus(v string) *CacheNodeUpdateStatus { + s.NodeUpdateStatus = &v + return s +} + +// SetNodeUpdateStatusModifiedDate sets the NodeUpdateStatusModifiedDate field's value. +func (s *CacheNodeUpdateStatus) SetNodeUpdateStatusModifiedDate(v time.Time) *CacheNodeUpdateStatus { + s.NodeUpdateStatusModifiedDate = &v + return s +} + // Represents the output of a CreateCacheParameterGroup operation. type CacheParameterGroup struct { _ struct{} `type:"structure"` @@ -6673,6 +6979,78 @@ func (s *CacheSubnetGroup) SetVpcId(v string) *CacheSubnetGroup { return s } +type CompleteMigrationInput struct { + _ struct{} `type:"structure"` + + // Forces the migration to stop without ensuring that data is in sync. It is + // recommended to use this option only to abort the migration and not recommended + // when application wants to continue migration to ElastiCache. + Force *bool `type:"boolean"` + + // The ID of the replication group to which data is being migrated. + // + // ReplicationGroupId is a required field + ReplicationGroupId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CompleteMigrationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CompleteMigrationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CompleteMigrationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CompleteMigrationInput"} + if s.ReplicationGroupId == nil { + invalidParams.Add(request.NewErrParamRequired("ReplicationGroupId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetForce sets the Force field's value. +func (s *CompleteMigrationInput) SetForce(v bool) *CompleteMigrationInput { + s.Force = &v + return s +} + +// SetReplicationGroupId sets the ReplicationGroupId field's value. +func (s *CompleteMigrationInput) SetReplicationGroupId(v string) *CompleteMigrationInput { + s.ReplicationGroupId = &v + return s +} + +type CompleteMigrationOutput 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 CompleteMigrationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CompleteMigrationOutput) GoString() string { + return s.String() +} + +// SetReplicationGroup sets the ReplicationGroup field's value. +func (s *CompleteMigrationOutput) SetReplicationGroup(v *ReplicationGroup) *CompleteMigrationOutput { + s.ReplicationGroup = v + return s +} + // Node group (shard) configuration options when adding or removing replicas. // Each node group (shard) configuration has the following members: NodeGroupId, // NewReplicaCount, and PreferredAvailabilityZones. @@ -6885,7 +7263,9 @@ type CreateCacheClusterInput struct { // // * Must be at least 16 characters and no more than 128 characters in length. // - // * Cannot contain any of the following characters: '/', '"', or '@'. + // * The only permitted printable special characters are !, &, #, $, ^, <, + // >, and -. Other printable special characters cannot be used in the AUTH + // token. // // For more information, see AUTH password (http://redis.io/commands/AUTH) at // http://redis.io/commands/AUTH. @@ -7611,7 +7991,9 @@ type CreateReplicationGroupInput struct { // // * Must be at least 16 characters and no more than 128 characters in length. // - // * Cannot contain any of the following characters: '/', '"', or '@'. + // * The only permitted printable special characters are !, &, #, $, ^, <, + // >, and -. Other printable special characters cannot be used in the AUTH + // token. // // For more information, see AUTH password (http://redis.io/commands/AUTH) at // http://redis.io/commands/AUTH. @@ -8230,6 +8612,39 @@ func (s *CreateSnapshotOutput) SetSnapshot(v *Snapshot) *CreateSnapshotOutput { return s } +// The endpoint from which data should be migrated. +type CustomerNodeEndpoint struct { + _ struct{} `type:"structure"` + + // The address of the node endpoint + Address *string `type:"string"` + + // The port of the node endpoint + Port *int64 `type:"integer"` +} + +// String returns the string representation +func (s CustomerNodeEndpoint) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CustomerNodeEndpoint) GoString() string { + return s.String() +} + +// SetAddress sets the Address field's value. +func (s *CustomerNodeEndpoint) SetAddress(v string) *CustomerNodeEndpoint { + s.Address = &v + return s +} + +// SetPort sets the Port field's value. +func (s *CustomerNodeEndpoint) SetPort(v int64) *CustomerNodeEndpoint { + s.Port = &v + return s +} + type DecreaseReplicaCountInput struct { _ struct{} `type:"structure"` @@ -10213,6 +10628,12 @@ func (s *DescribeSnapshotsOutput) SetSnapshots(v []*Snapshot) *DescribeSnapshots type DescribeUpdateActionsInput struct { _ struct{} `type:"structure"` + // The cache cluster IDs + CacheClusterIds []*string `type:"list"` + + // The Elasticache engine to which the update applies. Either Redis or Memcached + Engine *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. @@ -10251,6 +10672,18 @@ func (s DescribeUpdateActionsInput) GoString() string { return s.String() } +// SetCacheClusterIds sets the CacheClusterIds field's value. +func (s *DescribeUpdateActionsInput) SetCacheClusterIds(v []*string) *DescribeUpdateActionsInput { + s.CacheClusterIds = v + return s +} + +// SetEngine sets the Engine field's value. +func (s *DescribeUpdateActionsInput) SetEngine(v string) *DescribeUpdateActionsInput { + s.Engine = &v + return s +} + // SetMarker sets the Marker field's value. func (s *DescribeUpdateActionsInput) SetMarker(v string) *DescribeUpdateActionsInput { s.Marker = &v @@ -10775,10 +11208,7 @@ type ModifyCacheClusterInput struct { // 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 (https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/CacheNodes.SupportedTypes.html). + // Only newly created nodes are located in different Availability Zones. AZMode *string `type:"string" enum:"AZMode"` // If true, this parameter causes the modifications in this request and any @@ -10796,6 +11226,29 @@ type ModifyCacheClusterInput struct { // Default: false ApplyImmediately *bool `type:"boolean"` + // Reserved parameter. The password used to access a password protected server. + // This parameter must be specified with the auth-token-update parameter. 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 at AUTH (http://redis.io/commands/AUTH). + AuthToken *string `type:"string"` + + // Specifies the strategy to use to update the AUTH token. This parameter must + // be specified with the auth-token parameter. Possible values: + // + // * Rotate + // + // * Set + // + // For more information, see Authenticating Users with Redis AUTH (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/auth.html) + AuthTokenUpdateStrategy *string `type:"string" enum:"AuthTokenUpdateStrategyType"` + // This parameter is currently disabled. AutoMinorVersionUpgrade *bool `type:"boolean"` @@ -11015,6 +11468,18 @@ func (s *ModifyCacheClusterInput) SetApplyImmediately(v bool) *ModifyCacheCluste return s } +// SetAuthToken sets the AuthToken field's value. +func (s *ModifyCacheClusterInput) SetAuthToken(v string) *ModifyCacheClusterInput { + s.AuthToken = &v + return s +} + +// SetAuthTokenUpdateStrategy sets the AuthTokenUpdateStrategy field's value. +func (s *ModifyCacheClusterInput) SetAuthTokenUpdateStrategy(v string) *ModifyCacheClusterInput { + s.AuthTokenUpdateStrategy = &v + return s +} + // SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. func (s *ModifyCacheClusterInput) SetAutoMinorVersionUpgrade(v bool) *ModifyCacheClusterInput { s.AutoMinorVersionUpgrade = &v @@ -11289,6 +11754,29 @@ type ModifyReplicationGroupInput struct { // Default: false ApplyImmediately *bool `type:"boolean"` + // Reserved parameter. The password used to access a password protected server. + // This parameter must be specified with the auth-token-update-strategy parameter. + // 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 at AUTH (http://redis.io/commands/AUTH). + AuthToken *string `type:"string"` + + // Specifies the strategy to use to update the AUTH token. This parameter must + // be specified with the auth-token parameter. Possible values: + // + // * Rotate + // + // * Set + // + // For more information, see Authenticating Users with Redis AUTH (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/auth.html) + AuthTokenUpdateStrategy *string `type:"string" enum:"AuthTokenUpdateStrategyType"` + // This parameter is currently disabled. AutoMinorVersionUpgrade *bool `type:"boolean"` @@ -11450,6 +11938,18 @@ func (s *ModifyReplicationGroupInput) SetApplyImmediately(v bool) *ModifyReplica return s } +// SetAuthToken sets the AuthToken field's value. +func (s *ModifyReplicationGroupInput) SetAuthToken(v string) *ModifyReplicationGroupInput { + s.AuthToken = &v + return s +} + +// SetAuthTokenUpdateStrategy sets the AuthTokenUpdateStrategy field's value. +func (s *ModifyReplicationGroupInput) SetAuthTokenUpdateStrategy(v string) *ModifyReplicationGroupInput { + s.AuthTokenUpdateStrategy = &v + return s +} + // SetAutoMinorVersionUpgrade sets the AutoMinorVersionUpgrade field's value. func (s *ModifyReplicationGroupInput) SetAutoMinorVersionUpgrade(v bool) *ModifyReplicationGroupInput { s.AutoMinorVersionUpgrade = &v @@ -12330,6 +12830,9 @@ func (s *ParameterNameValue) SetParameterValue(v string) *ParameterNameValue { type PendingModifiedValues struct { _ struct{} `type:"structure"` + // The auth token status + AuthTokenStatus *string `type:"string" enum:"AuthTokenUpdateStatus"` + // A list of cache node IDs that are being removed (or will be removed) from // the cluster. A node ID is a 4-digit numeric identifier (0001, 0002, etc.). CacheNodeIdsToRemove []*string `locationNameList:"CacheNodeId" type:"list"` @@ -12357,6 +12860,12 @@ func (s PendingModifiedValues) GoString() string { return s.String() } +// SetAuthTokenStatus sets the AuthTokenStatus field's value. +func (s *PendingModifiedValues) SetAuthTokenStatus(v string) *PendingModifiedValues { + s.AuthTokenStatus = &v + return s +} + // SetCacheNodeIdsToRemove sets the CacheNodeIdsToRemove field's value. func (s *PendingModifiedValues) SetCacheNodeIdsToRemove(v []*string) *PendingModifiedValues { s.CacheNodeIdsToRemove = v @@ -12385,6 +12894,9 @@ func (s *PendingModifiedValues) SetNumCacheNodes(v int64) *PendingModifiedValues type ProcessedUpdateAction struct { _ struct{} `type:"structure"` + // The ID of the cache cluster + CacheClusterId *string `type:"string"` + // The ID of the replication group ReplicationGroupId *string `type:"string"` @@ -12405,6 +12917,12 @@ func (s ProcessedUpdateAction) GoString() string { return s.String() } +// SetCacheClusterId sets the CacheClusterId field's value. +func (s *ProcessedUpdateAction) SetCacheClusterId(v string) *ProcessedUpdateAction { + s.CacheClusterId = &v + return s +} + // SetReplicationGroupId sets the ReplicationGroupId field's value. func (s *ProcessedUpdateAction) SetReplicationGroupId(v string) *ProcessedUpdateAction { s.ReplicationGroupId = &v @@ -12703,6 +13221,9 @@ type ReplicationGroup struct { // Default: false AuthTokenEnabled *bool `type:"boolean"` + // The date the auth token was last modified + AuthTokenLastModifiedDate *time.Time `type:"timestamp"` + // Indicates the status of Multi-AZ with automatic failover for this Redis replication // group. // @@ -12815,6 +13336,12 @@ func (s *ReplicationGroup) SetAuthTokenEnabled(v bool) *ReplicationGroup { return s } +// SetAuthTokenLastModifiedDate sets the AuthTokenLastModifiedDate field's value. +func (s *ReplicationGroup) SetAuthTokenLastModifiedDate(v time.Time) *ReplicationGroup { + s.AuthTokenLastModifiedDate = &v + return s +} + // SetAutomaticFailover sets the AutomaticFailover field's value. func (s *ReplicationGroup) SetAutomaticFailover(v string) *ReplicationGroup { s.AutomaticFailover = &v @@ -12910,6 +13437,9 @@ func (s *ReplicationGroup) SetTransitEncryptionEnabled(v bool) *ReplicationGroup type ReplicationGroupPendingModifiedValues struct { _ struct{} `type:"structure"` + // The auth token status + AuthTokenStatus *string `type:"string" enum:"AuthTokenUpdateStatus"` + // Indicates the status of Multi-AZ with automatic failover for this Redis replication // group. // @@ -12941,6 +13471,12 @@ func (s ReplicationGroupPendingModifiedValues) GoString() string { return s.String() } +// SetAuthTokenStatus sets the AuthTokenStatus field's value. +func (s *ReplicationGroupPendingModifiedValues) SetAuthTokenStatus(v string) *ReplicationGroupPendingModifiedValues { + s.AuthTokenStatus = &v + return s +} + // SetAutomaticFailoverStatus sets the AutomaticFailoverStatus field's value. func (s *ReplicationGroupPendingModifiedValues) SetAutomaticFailoverStatus(v string) *ReplicationGroupPendingModifiedValues { s.AutomaticFailoverStatus = &v @@ -13526,10 +14062,11 @@ type ServiceUpdate struct { // recommended apply-by date has expired. AutoUpdateAfterRecommendedApplyByDate *bool `type:"boolean"` - // The Redis engine to which the service update applies + // The Elasticache engine to which the update applies. Either Redis or Memcached Engine *string `type:"string"` - // The Redis engine version to which the service update applies + // The Elasticache engine version to which the update applies. Either Redis + // or Memcached engine version EngineVersion *string `type:"string"` // The estimated length of time the service update will take @@ -13994,6 +14531,82 @@ func (s *Snapshot) SetVpcId(v string) *Snapshot { return s } +type StartMigrationInput struct { + _ struct{} `type:"structure"` + + // List of endpoints from which data should be migrated. For Redis (cluster + // mode disabled), list should have only one element. + // + // CustomerNodeEndpointList is a required field + CustomerNodeEndpointList []*CustomerNodeEndpoint `type:"list" required:"true"` + + // The ID of the replication group to which data should be migrated. + // + // ReplicationGroupId is a required field + ReplicationGroupId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s StartMigrationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartMigrationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartMigrationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartMigrationInput"} + if s.CustomerNodeEndpointList == nil { + invalidParams.Add(request.NewErrParamRequired("CustomerNodeEndpointList")) + } + if s.ReplicationGroupId == nil { + invalidParams.Add(request.NewErrParamRequired("ReplicationGroupId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCustomerNodeEndpointList sets the CustomerNodeEndpointList field's value. +func (s *StartMigrationInput) SetCustomerNodeEndpointList(v []*CustomerNodeEndpoint) *StartMigrationInput { + s.CustomerNodeEndpointList = v + return s +} + +// SetReplicationGroupId sets the ReplicationGroupId field's value. +func (s *StartMigrationInput) SetReplicationGroupId(v string) *StartMigrationInput { + s.ReplicationGroupId = &v + return s +} + +type StartMigrationOutput 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 StartMigrationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartMigrationOutput) GoString() string { + return s.String() +} + +// SetReplicationGroup sets the ReplicationGroup field's value. +func (s *StartMigrationOutput) SetReplicationGroup(v *ReplicationGroup) *StartMigrationOutput { + s.ReplicationGroup = v + return s +} + // Represents the subnet associated with a cluster. This parameter refers to // subnets defined in Amazon Virtual Private Cloud (Amazon VPC) and used with // ElastiCache. @@ -14209,6 +14822,9 @@ func (s *TimeRangeFilter) SetStartTime(v time.Time) *TimeRangeFilter { type UnprocessedUpdateAction struct { _ struct{} `type:"structure"` + // The ID of the cache cluster + CacheClusterId *string `type:"string"` + // The error message that describes the reason the request was not processed ErrorMessage *string `type:"string"` @@ -14232,6 +14848,12 @@ func (s UnprocessedUpdateAction) GoString() string { return s.String() } +// SetCacheClusterId sets the CacheClusterId field's value. +func (s *UnprocessedUpdateAction) SetCacheClusterId(v string) *UnprocessedUpdateAction { + s.CacheClusterId = &v + return s +} + // SetErrorMessage sets the ErrorMessage field's value. func (s *UnprocessedUpdateAction) SetErrorMessage(v string) *UnprocessedUpdateAction { s.ErrorMessage = &v @@ -14260,6 +14882,15 @@ func (s *UnprocessedUpdateAction) SetServiceUpdateName(v string) *UnprocessedUpd type UpdateAction struct { _ struct{} `type:"structure"` + // The ID of the cache cluster + CacheClusterId *string `type:"string"` + + // The status of the service update on the cache node + CacheNodeUpdateStatus []*CacheNodeUpdateStatus `locationNameList:"CacheNodeUpdateStatus" type:"list"` + + // The Elasticache engine to which the update applies. Either Redis or Memcached + Engine *string `type:"string"` + // The estimated length of time for the update to complete EstimatedUpdateTime *string `type:"string"` @@ -14318,6 +14949,24 @@ func (s UpdateAction) GoString() string { return s.String() } +// SetCacheClusterId sets the CacheClusterId field's value. +func (s *UpdateAction) SetCacheClusterId(v string) *UpdateAction { + s.CacheClusterId = &v + return s +} + +// SetCacheNodeUpdateStatus sets the CacheNodeUpdateStatus field's value. +func (s *UpdateAction) SetCacheNodeUpdateStatus(v []*CacheNodeUpdateStatus) *UpdateAction { + s.CacheNodeUpdateStatus = v + return s +} + +// SetEngine sets the Engine field's value. +func (s *UpdateAction) SetEngine(v string) *UpdateAction { + s.Engine = &v + return s +} + // SetEstimatedUpdateTime sets the EstimatedUpdateTime field's value. func (s *UpdateAction) SetEstimatedUpdateTime(v string) *UpdateAction { s.EstimatedUpdateTime = &v @@ -14410,6 +15059,22 @@ const ( AZModeCrossAz = "cross-az" ) +const ( + // AuthTokenUpdateStatusSetting is a AuthTokenUpdateStatus enum value + AuthTokenUpdateStatusSetting = "SETTING" + + // AuthTokenUpdateStatusRotating is a AuthTokenUpdateStatus enum value + AuthTokenUpdateStatusRotating = "ROTATING" +) + +const ( + // AuthTokenUpdateStrategyTypeSet is a AuthTokenUpdateStrategyType enum value + AuthTokenUpdateStrategyTypeSet = "SET" + + // AuthTokenUpdateStrategyTypeRotate is a AuthTokenUpdateStrategyType enum value + AuthTokenUpdateStrategyTypeRotate = "ROTATE" +) + const ( // AutomaticFailoverStatusEnabled is a AutomaticFailoverStatus enum value AutomaticFailoverStatusEnabled = "enabled" 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 index 8f75570b996..25579b1d5d6 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticache/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticache/errors.go @@ -235,12 +235,24 @@ const ( // The specified replication group already exists. ErrCodeReplicationGroupAlreadyExistsFault = "ReplicationGroupAlreadyExists" + // ErrCodeReplicationGroupAlreadyUnderMigrationFault for service response error code + // "ReplicationGroupAlreadyUnderMigrationFault". + // + // The targeted replication group is not available. + ErrCodeReplicationGroupAlreadyUnderMigrationFault = "ReplicationGroupAlreadyUnderMigrationFault" + // ErrCodeReplicationGroupNotFoundFault for service response error code // "ReplicationGroupNotFoundFault". // // The specified replication group does not exist. ErrCodeReplicationGroupNotFoundFault = "ReplicationGroupNotFoundFault" + // ErrCodeReplicationGroupNotUnderMigrationFault for service response error code + // "ReplicationGroupNotUnderMigrationFault". + // + // The designated replication group is not available for data migration. + ErrCodeReplicationGroupNotUnderMigrationFault = "ReplicationGroupNotUnderMigrationFault" + // ErrCodeReservedCacheNodeAlreadyExistsFault for service response error code // "ReservedCacheNodeAlreadyExists". // 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 index fd5f8c51707..ecd863c8a22 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticache/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticache/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "elasticache" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "ElastiCache" // ServiceID is a unique identifer of a specific service. + ServiceID = "ElastiCache" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ElastiCache client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ElastiCache client from just a session. // svc := elasticache.New(mySession) // @@ -46,11 +48,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ElastiCache { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ElastiCache { svc := &ElastiCache{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-02-02", }, 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 index 54f81ba8ee2..2e91780c444 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/api.go @@ -2269,10 +2269,12 @@ func (c *ElasticBeanstalk) DescribeEventsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } 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 index 12e8b1c819a..96a82b0c504 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticbeanstalk/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "elasticbeanstalk" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Elastic Beanstalk" // ServiceID is a unique identifer of a specific service. + ServiceID = "Elastic Beanstalk" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ElasticBeanstalk client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ElasticBeanstalk client from just a session. // svc := elasticbeanstalk.New(mySession) // @@ -46,11 +48,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ElasticBeanstalk { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ElasticBeanstalk { svc := &ElasticBeanstalk{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2010-12-01", }, 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 index 1396376b54c..3acde019b39 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/api.go @@ -67,19 +67,19 @@ func (c *ElasticsearchService) AddTagsRequest(input *AddTagsInput) (req *request // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation AddTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // An exception for trying to create more than allowed resources or sub-resources. // Gives http status code of 409. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // -// * ErrCodeInternalException "InternalException" +// * 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. @@ -158,20 +158,20 @@ func (c *ElasticsearchService) CancelElasticsearchServiceSoftwareUpdateRequest(i // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation CancelElasticsearchServiceSoftwareUpdate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeInternalException "InternalException" +// * 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" +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // @@ -249,32 +249,32 @@ func (c *ElasticsearchService) CreateElasticsearchDomainRequest(input *CreateEla // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation CreateElasticsearchDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeDisabledOperationException "DisabledOperationException" +// * DisabledOperationException // An error occured because the client wanted to access a not supported operation. // Gives http status code of 409. // -// * ErrCodeInternalException "InternalException" +// * 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" +// * 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" +// * LimitExceededException // An exception for trying to create more than allowed resources or sub-resources. // Gives http status code of 409. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // An exception for creating a resource that already exists. Gives http status // code of 400. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // @@ -351,20 +351,20 @@ func (c *ElasticsearchService) DeleteElasticsearchDomainRequest(input *DeleteEla // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation DeleteElasticsearchDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeInternalException "InternalException" +// * 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" +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // @@ -445,16 +445,16 @@ func (c *ElasticsearchService) DeleteElasticsearchServiceRoleRequest(input *Dele // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation DeleteElasticsearchServiceRole for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeInternalException "InternalException" +// * 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" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // @@ -531,20 +531,20 @@ func (c *ElasticsearchService) DescribeElasticsearchDomainRequest(input *Describ // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation DescribeElasticsearchDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeInternalException "InternalException" +// * 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" +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // @@ -622,20 +622,20 @@ func (c *ElasticsearchService) DescribeElasticsearchDomainConfigRequest(input *D // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation DescribeElasticsearchDomainConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeInternalException "InternalException" +// * 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" +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // @@ -712,16 +712,16 @@ func (c *ElasticsearchService) DescribeElasticsearchDomainsRequest(input *Descri // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation DescribeElasticsearchDomains for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeInternalException "InternalException" +// * 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" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // @@ -799,28 +799,28 @@ func (c *ElasticsearchService) DescribeElasticsearchInstanceTypeLimitsRequest(in // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation DescribeElasticsearchInstanceTypeLimits for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeInternalException "InternalException" +// * 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" +// * 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" +// * LimitExceededException // An exception for trying to create more than allowed resources or sub-resources. // Gives http status code of 409. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // @@ -902,20 +902,20 @@ func (c *ElasticsearchService) DescribeReservedElasticsearchInstanceOfferingsReq // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation DescribeReservedElasticsearchInstanceOfferings for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // -// * ErrCodeDisabledOperationException "DisabledOperationException" +// * DisabledOperationException // An error occured because the client wanted to access a not supported operation. // Gives http status code of 409. // -// * ErrCodeInternalException "InternalException" +// * 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. @@ -984,10 +984,12 @@ func (c *ElasticsearchService) DescribeReservedElasticsearchInstanceOfferingsPag }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedElasticsearchInstanceOfferingsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReservedElasticsearchInstanceOfferingsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1048,21 +1050,21 @@ func (c *ElasticsearchService) DescribeReservedElasticsearchInstancesRequest(inp // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation DescribeReservedElasticsearchInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeInternalException "InternalException" +// * 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" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // -// * ErrCodeDisabledOperationException "DisabledOperationException" +// * DisabledOperationException // An error occured because the client wanted to access a not supported operation. // Gives http status code of 409. // @@ -1130,10 +1132,12 @@ func (c *ElasticsearchService) DescribeReservedElasticsearchInstancesPagesWithCo }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedElasticsearchInstancesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReservedElasticsearchInstancesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1190,23 +1194,23 @@ func (c *ElasticsearchService) GetCompatibleElasticsearchVersionsRequest(input * // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation GetCompatibleElasticsearchVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeDisabledOperationException "DisabledOperationException" +// * DisabledOperationException // An error occured because the client wanted to access a not supported operation. // Gives http status code of 409. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // -// * ErrCodeInternalException "InternalException" +// * 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. @@ -1290,23 +1294,23 @@ func (c *ElasticsearchService) GetUpgradeHistoryRequest(input *GetUpgradeHistory // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation GetUpgradeHistory for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeDisabledOperationException "DisabledOperationException" +// * DisabledOperationException // An error occured because the client wanted to access a not supported operation. // Gives http status code of 409. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // -// * ErrCodeInternalException "InternalException" +// * 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. @@ -1375,10 +1379,12 @@ func (c *ElasticsearchService) GetUpgradeHistoryPagesWithContext(ctx aws.Context }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetUpgradeHistoryOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetUpgradeHistoryOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1434,23 +1440,23 @@ func (c *ElasticsearchService) GetUpgradeStatusRequest(input *GetUpgradeStatusIn // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation GetUpgradeStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeDisabledOperationException "DisabledOperationException" +// * DisabledOperationException // An error occured because the client wanted to access a not supported operation. // Gives http status code of 409. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // -// * ErrCodeInternalException "InternalException" +// * 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. @@ -1528,11 +1534,11 @@ func (c *ElasticsearchService) ListDomainNamesRequest(input *ListDomainNamesInpu // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation ListDomainNames for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // @@ -1614,20 +1620,20 @@ func (c *ElasticsearchService) ListElasticsearchInstanceTypesRequest(input *List // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation ListElasticsearchInstanceTypes for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeInternalException "InternalException" +// * 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" +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // @@ -1695,10 +1701,12 @@ func (c *ElasticsearchService) ListElasticsearchInstanceTypesPagesWithContext(ct }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListElasticsearchInstanceTypesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListElasticsearchInstanceTypesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1759,20 +1767,20 @@ func (c *ElasticsearchService) ListElasticsearchVersionsRequest(input *ListElast // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation ListElasticsearchVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeInternalException "InternalException" +// * 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" +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // @@ -1840,10 +1848,12 @@ func (c *ElasticsearchService) ListElasticsearchVersionsPagesWithContext(ctx aws }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListElasticsearchVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListElasticsearchVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1898,19 +1908,19 @@ func (c *ElasticsearchService) ListTagsRequest(input *ListTagsInput) (req *reque // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation ListTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // -// * ErrCodeInternalException "InternalException" +// * 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. @@ -1987,28 +1997,28 @@ func (c *ElasticsearchService) PurchaseReservedElasticsearchInstanceOfferingRequ // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation PurchaseReservedElasticsearchInstanceOffering for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // An exception for creating a resource that already exists. Gives http status // code of 400. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // An exception for trying to create more than allowed resources or sub-resources. // Gives http status code of 409. // -// * ErrCodeDisabledOperationException "DisabledOperationException" +// * DisabledOperationException // An error occured because the client wanted to access a not supported operation. // Gives http status code of 409. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // -// * ErrCodeInternalException "InternalException" +// * 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. @@ -2086,15 +2096,15 @@ func (c *ElasticsearchService) RemoveTagsRequest(input *RemoveTagsInput) (req *r // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation RemoveTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // -// * ErrCodeInternalException "InternalException" +// * 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. @@ -2171,20 +2181,20 @@ func (c *ElasticsearchService) StartElasticsearchServiceSoftwareUpdateRequest(in // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation StartElasticsearchServiceSoftwareUpdate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeInternalException "InternalException" +// * 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" +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // @@ -2261,28 +2271,28 @@ func (c *ElasticsearchService) UpdateElasticsearchDomainConfigRequest(input *Upd // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation UpdateElasticsearchDomainConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeInternalException "InternalException" +// * 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" +// * 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" +// * LimitExceededException // An exception for trying to create more than allowed resources or sub-resources. // Gives http status code of 409. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // @@ -2359,27 +2369,27 @@ func (c *ElasticsearchService) UpgradeElasticsearchDomainRequest(input *UpgradeE // See the AWS API reference guide for Amazon Elasticsearch Service's // API operation UpgradeElasticsearchDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeBaseException "BaseException" +// Returned Error Types: +// * BaseException // An error occurred while processing the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // An exception for accessing or deleting a resource that does not exist. Gives // http status code of 400. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // An exception for creating a resource that already exists. Gives http status // code of 400. // -// * ErrCodeDisabledOperationException "DisabledOperationException" +// * DisabledOperationException // An error occured because the client wanted to access a not supported operation. // Gives http status code of 409. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // An exception for missing / invalid input fields. Gives http status code of // 400. // -// * ErrCodeInternalException "InternalException" +// * 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. @@ -2612,6 +2622,195 @@ func (s *AdvancedOptionsStatus) SetStatus(v *OptionStatus) *AdvancedOptionsStatu return s } +// Specifies the advanced security configuration: whether advanced security +// is enabled, whether the internal database option is enabled. +type AdvancedSecurityOptions struct { + _ struct{} `type:"structure"` + + // True if advanced security is enabled. + Enabled *bool `type:"boolean"` + + // True if the internal user database is enabled. + InternalUserDatabaseEnabled *bool `type:"boolean"` +} + +// String returns the string representation +func (s AdvancedSecurityOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AdvancedSecurityOptions) GoString() string { + return s.String() +} + +// SetEnabled sets the Enabled field's value. +func (s *AdvancedSecurityOptions) SetEnabled(v bool) *AdvancedSecurityOptions { + s.Enabled = &v + return s +} + +// SetInternalUserDatabaseEnabled sets the InternalUserDatabaseEnabled field's value. +func (s *AdvancedSecurityOptions) SetInternalUserDatabaseEnabled(v bool) *AdvancedSecurityOptions { + s.InternalUserDatabaseEnabled = &v + return s +} + +// Specifies the advanced security configuration: whether advanced security +// is enabled, whether the internal database option is enabled, master username +// and password (if internal database is enabled), and master user ARN (if IAM +// is enabled). +type AdvancedSecurityOptionsInput struct { + _ struct{} `type:"structure"` + + // True if advanced security is enabled. + Enabled *bool `type:"boolean"` + + // True if the internal user database is enabled. + InternalUserDatabaseEnabled *bool `type:"boolean"` + + // Credentials for the master user: username and password, ARN, or both. + MasterUserOptions *MasterUserOptions `type:"structure"` +} + +// String returns the string representation +func (s AdvancedSecurityOptionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AdvancedSecurityOptionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AdvancedSecurityOptionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AdvancedSecurityOptionsInput"} + if s.MasterUserOptions != nil { + if err := s.MasterUserOptions.Validate(); err != nil { + invalidParams.AddNested("MasterUserOptions", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEnabled sets the Enabled field's value. +func (s *AdvancedSecurityOptionsInput) SetEnabled(v bool) *AdvancedSecurityOptionsInput { + s.Enabled = &v + return s +} + +// SetInternalUserDatabaseEnabled sets the InternalUserDatabaseEnabled field's value. +func (s *AdvancedSecurityOptionsInput) SetInternalUserDatabaseEnabled(v bool) *AdvancedSecurityOptionsInput { + s.InternalUserDatabaseEnabled = &v + return s +} + +// SetMasterUserOptions sets the MasterUserOptions field's value. +func (s *AdvancedSecurityOptionsInput) SetMasterUserOptions(v *MasterUserOptions) *AdvancedSecurityOptionsInput { + s.MasterUserOptions = v + return s +} + +// Specifies the status of advanced security options for the specified Elasticsearch +// domain. +type AdvancedSecurityOptionsStatus struct { + _ struct{} `type:"structure"` + + // Specifies advanced security options for the specified Elasticsearch domain. + // + // Options is a required field + Options *AdvancedSecurityOptions `type:"structure" required:"true"` + + // Status of the advanced security options for the specified Elasticsearch domain. + // + // Status is a required field + Status *OptionStatus `type:"structure" required:"true"` +} + +// String returns the string representation +func (s AdvancedSecurityOptionsStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AdvancedSecurityOptionsStatus) GoString() string { + return s.String() +} + +// SetOptions sets the Options field's value. +func (s *AdvancedSecurityOptionsStatus) SetOptions(v *AdvancedSecurityOptions) *AdvancedSecurityOptionsStatus { + s.Options = v + return s +} + +// SetStatus sets the Status field's value. +func (s *AdvancedSecurityOptionsStatus) SetStatus(v *OptionStatus) *AdvancedSecurityOptionsStatus { + s.Status = v + return s +} + +// An error occurred while processing the request. +type BaseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A description of the error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BaseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BaseException) GoString() string { + return s.String() +} + +func newErrorBaseException(v protocol.ResponseMetadata) error { + return &BaseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BaseException) Code() string { + return "BaseException" +} + +// Message returns the exception's message. +func (s BaseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BaseException) OrigErr() error { + return nil +} + +func (s BaseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BaseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BaseException) RequestID() string { + return s.respMetadata.RequestID +} + // Container for the parameters to the CancelElasticsearchServiceSoftwareUpdate // operation. Specifies the name of the Elasticsearch domain that you wish to // cancel a service software update on. @@ -2838,13 +3037,19 @@ type CreateElasticsearchDomainInput struct { // for more information. AdvancedOptions map[string]*string `type:"map"` + // Specifies advanced security options. + AdvancedSecurityOptions *AdvancedSecurityOptionsInput `type:"structure"` + // Options to specify the Cognito user and identity pools for Kibana authentication. // For more information, see Amazon Cognito Authentication for Kibana (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-cognito-auth.html). CognitoOptions *CognitoOptions `type:"structure"` + // Options to specify configuration that will be applied to the domain endpoint. + DomainEndpointOptions *DomainEndpointOptions `type:"structure"` + // 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: + // names must start with a lowercase letter and can contain the following characters: // a-z (lowercase), 0-9, and - (hyphen). // // DomainName is a required field @@ -2902,6 +3107,11 @@ func (s *CreateElasticsearchDomainInput) Validate() error { if s.DomainName != nil && len(*s.DomainName) < 3 { invalidParams.Add(request.NewErrParamMinLen("DomainName", 3)) } + if s.AdvancedSecurityOptions != nil { + if err := s.AdvancedSecurityOptions.Validate(); err != nil { + invalidParams.AddNested("AdvancedSecurityOptions", err.(request.ErrInvalidParams)) + } + } if s.CognitoOptions != nil { if err := s.CognitoOptions.Validate(); err != nil { invalidParams.AddNested("CognitoOptions", err.(request.ErrInvalidParams)) @@ -2931,12 +3141,24 @@ func (s *CreateElasticsearchDomainInput) SetAdvancedOptions(v map[string]*string return s } +// SetAdvancedSecurityOptions sets the AdvancedSecurityOptions field's value. +func (s *CreateElasticsearchDomainInput) SetAdvancedSecurityOptions(v *AdvancedSecurityOptionsInput) *CreateElasticsearchDomainInput { + s.AdvancedSecurityOptions = v + return s +} + // SetCognitoOptions sets the CognitoOptions field's value. func (s *CreateElasticsearchDomainInput) SetCognitoOptions(v *CognitoOptions) *CreateElasticsearchDomainInput { s.CognitoOptions = v return s } +// SetDomainEndpointOptions sets the DomainEndpointOptions field's value. +func (s *CreateElasticsearchDomainInput) SetDomainEndpointOptions(v *DomainEndpointOptions) *CreateElasticsearchDomainInput { + s.DomainEndpointOptions = v + return s +} + // SetDomainName sets the DomainName field's value. func (s *CreateElasticsearchDomainInput) SetDomainName(v string) *CreateElasticsearchDomainInput { s.DomainName = &v @@ -3401,9 +3623,11 @@ type DescribeElasticsearchInstanceTypeLimitsOutput struct { // 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 + // * data: If the given InstanceType is used as data node // - // * Master: If the given InstanceType is used as Master node + // * master: If the given InstanceType is used as master node + // + // * ultra_warm: If the given InstanceType is used as warm node LimitsByRole map[string]*Limits `type:"map"` } @@ -3580,6 +3804,140 @@ func (s *DescribeReservedElasticsearchInstancesOutput) SetReservedElasticsearchI return s } +// An error occured because the client wanted to access a not supported operation. +// Gives http status code of 409. +type DisabledOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DisabledOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisabledOperationException) GoString() string { + return s.String() +} + +func newErrorDisabledOperationException(v protocol.ResponseMetadata) error { + return &DisabledOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DisabledOperationException) Code() string { + return "DisabledOperationException" +} + +// Message returns the exception's message. +func (s DisabledOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DisabledOperationException) OrigErr() error { + return nil +} + +func (s DisabledOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DisabledOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DisabledOperationException) RequestID() string { + return s.respMetadata.RequestID +} + +// Options to configure endpoint for the Elasticsearch domain. +type DomainEndpointOptions struct { + _ struct{} `type:"structure"` + + // Specify if only HTTPS endpoint should be enabled for the Elasticsearch domain. + EnforceHTTPS *bool `type:"boolean"` + + // Specify the TLS security policy that needs to be applied to the HTTPS endpoint + // of Elasticsearch domain. It can be one of the following values: + // * Policy-Min-TLS-1-0-2019-07: TLS security policy which supports TLSv1.0 + // and higher. + // + // * Policy-Min-TLS-1-2-2019-07: TLS security policy which supports only + // TLSv1.2 + TLSSecurityPolicy *string `type:"string" enum:"TLSSecurityPolicy"` +} + +// String returns the string representation +func (s DomainEndpointOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DomainEndpointOptions) GoString() string { + return s.String() +} + +// SetEnforceHTTPS sets the EnforceHTTPS field's value. +func (s *DomainEndpointOptions) SetEnforceHTTPS(v bool) *DomainEndpointOptions { + s.EnforceHTTPS = &v + return s +} + +// SetTLSSecurityPolicy sets the TLSSecurityPolicy field's value. +func (s *DomainEndpointOptions) SetTLSSecurityPolicy(v string) *DomainEndpointOptions { + s.TLSSecurityPolicy = &v + return s +} + +// The configured endpoint options for the domain and their current status. +type DomainEndpointOptionsStatus struct { + _ struct{} `type:"structure"` + + // Options to configure endpoint for the Elasticsearch domain. + // + // Options is a required field + Options *DomainEndpointOptions `type:"structure" required:"true"` + + // The status of the endpoint options 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 DomainEndpointOptionsStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DomainEndpointOptionsStatus) GoString() string { + return s.String() +} + +// SetOptions sets the Options field's value. +func (s *DomainEndpointOptionsStatus) SetOptions(v *DomainEndpointOptions) *DomainEndpointOptionsStatus { + s.Options = v + return s +} + +// SetStatus sets the Status field's value. +func (s *DomainEndpointOptionsStatus) SetStatus(v *OptionStatus) *DomainEndpointOptionsStatus { + s.Status = v + return s +} + type DomainInfo struct { _ struct{} `type:"structure"` @@ -3711,9 +4069,19 @@ type ElasticsearchClusterConfig struct { // The number of instances in the specified domain cluster. InstanceCount *int64 `type:"integer"` - // The instance type for an Elasticsearch cluster. + // The instance type for an Elasticsearch cluster. UltraWarm instance types + // are not supported for data instances. InstanceType *string `type:"string" enum:"ESPartitionInstanceType"` + // The number of warm nodes in the cluster. + WarmCount *int64 `type:"integer"` + + // True to enable warm storage. + WarmEnabled *bool `type:"boolean"` + + // The instance type for the Elasticsearch cluster's warm nodes. + WarmType *string `type:"string" enum:"ESWarmPartitionInstanceType"` + // Specifies the zone awareness configuration for a domain when zone awareness // is enabled. ZoneAwarenessConfig *ZoneAwarenessConfig `type:"structure"` @@ -3764,6 +4132,24 @@ func (s *ElasticsearchClusterConfig) SetInstanceType(v string) *ElasticsearchClu return s } +// SetWarmCount sets the WarmCount field's value. +func (s *ElasticsearchClusterConfig) SetWarmCount(v int64) *ElasticsearchClusterConfig { + s.WarmCount = &v + return s +} + +// SetWarmEnabled sets the WarmEnabled field's value. +func (s *ElasticsearchClusterConfig) SetWarmEnabled(v bool) *ElasticsearchClusterConfig { + s.WarmEnabled = &v + return s +} + +// SetWarmType sets the WarmType field's value. +func (s *ElasticsearchClusterConfig) SetWarmType(v string) *ElasticsearchClusterConfig { + s.WarmType = &v + return s +} + // SetZoneAwarenessConfig sets the ZoneAwarenessConfig field's value. func (s *ElasticsearchClusterConfig) SetZoneAwarenessConfig(v *ZoneAwarenessConfig) *ElasticsearchClusterConfig { s.ZoneAwarenessConfig = v @@ -3826,10 +4212,16 @@ type ElasticsearchDomainConfig struct { // for more information. AdvancedOptions *AdvancedOptionsStatus `type:"structure"` + // Specifies AdvancedSecurityOptions for the domain. + AdvancedSecurityOptions *AdvancedSecurityOptionsStatus `type:"structure"` + // The CognitoOptions for the specified domain. For more information, see Amazon // Cognito Authentication for Kibana (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-cognito-auth.html). CognitoOptions *CognitoOptionsStatus `type:"structure"` + // Specifies the DomainEndpointOptions for the Elasticsearch domain. + DomainEndpointOptions *DomainEndpointOptionsStatus `type:"structure"` + // Specifies the EBSOptions for the Elasticsearch domain. EBSOptions *EBSOptionsStatus `type:"structure"` @@ -3878,12 +4270,24 @@ func (s *ElasticsearchDomainConfig) SetAdvancedOptions(v *AdvancedOptionsStatus) return s } +// SetAdvancedSecurityOptions sets the AdvancedSecurityOptions field's value. +func (s *ElasticsearchDomainConfig) SetAdvancedSecurityOptions(v *AdvancedSecurityOptionsStatus) *ElasticsearchDomainConfig { + s.AdvancedSecurityOptions = v + return s +} + // SetCognitoOptions sets the CognitoOptions field's value. func (s *ElasticsearchDomainConfig) SetCognitoOptions(v *CognitoOptionsStatus) *ElasticsearchDomainConfig { s.CognitoOptions = v return s } +// SetDomainEndpointOptions sets the DomainEndpointOptions field's value. +func (s *ElasticsearchDomainConfig) SetDomainEndpointOptions(v *DomainEndpointOptionsStatus) *ElasticsearchDomainConfig { + s.DomainEndpointOptions = v + return s +} + // SetEBSOptions sets the EBSOptions field's value. func (s *ElasticsearchDomainConfig) SetEBSOptions(v *EBSOptionsStatus) *ElasticsearchDomainConfig { s.EBSOptions = v @@ -3949,6 +4353,9 @@ type ElasticsearchDomainStatus struct { // Specifies the status of the AdvancedOptions AdvancedOptions map[string]*string `type:"map"` + // The current status of the Elasticsearch domain's advanced security options. + AdvancedSecurityOptions *AdvancedSecurityOptions `type:"structure"` + // The CognitoOptions for the specified domain. For more information, see Amazon // Cognito Authentication for Kibana (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-cognito-auth.html). CognitoOptions *CognitoOptions `type:"structure"` @@ -3963,6 +4370,9 @@ type ElasticsearchDomainStatus struct { // domain is no longer returned. Deleted *bool `type:"boolean"` + // The current status of the Elasticsearch domain's endpoint options. + DomainEndpointOptions *DomainEndpointOptions `type:"structure"` + // The unique identifier for the specified Elasticsearch domain. // // DomainId is a required field @@ -4053,6 +4463,12 @@ func (s *ElasticsearchDomainStatus) SetAdvancedOptions(v map[string]*string) *El return s } +// SetAdvancedSecurityOptions sets the AdvancedSecurityOptions field's value. +func (s *ElasticsearchDomainStatus) SetAdvancedSecurityOptions(v *AdvancedSecurityOptions) *ElasticsearchDomainStatus { + s.AdvancedSecurityOptions = v + return s +} + // SetCognitoOptions sets the CognitoOptions field's value. func (s *ElasticsearchDomainStatus) SetCognitoOptions(v *CognitoOptions) *ElasticsearchDomainStatus { s.CognitoOptions = v @@ -4071,6 +4487,12 @@ func (s *ElasticsearchDomainStatus) SetDeleted(v bool) *ElasticsearchDomainStatu return s } +// SetDomainEndpointOptions sets the DomainEndpointOptions field's value. +func (s *ElasticsearchDomainStatus) SetDomainEndpointOptions(v *DomainEndpointOptions) *ElasticsearchDomainStatus { + s.DomainEndpointOptions = v + return s +} + // SetDomainId sets the DomainId field's value. func (s *ElasticsearchDomainStatus) SetDomainId(v string) *ElasticsearchDomainStatus { s.DomainId = &v @@ -4613,6 +5035,178 @@ func (s *InstanceLimits) SetInstanceCountLimits(v *InstanceCountLimits) *Instanc return s } +// 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. +type InternalException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalException) GoString() string { + return s.String() +} + +func newErrorInternalException(v protocol.ResponseMetadata) error { + return &InternalException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalException) Code() string { + return "InternalException" +} + +// Message returns the exception's message. +func (s InternalException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalException) OrigErr() error { + return nil +} + +func (s InternalException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalException) RequestID() string { + return s.respMetadata.RequestID +} + +// An exception for trying to create or access sub-resource that is either invalid +// or not supported. Gives http status code of 409. +type InvalidTypeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidTypeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidTypeException) GoString() string { + return s.String() +} + +func newErrorInvalidTypeException(v protocol.ResponseMetadata) error { + return &InvalidTypeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidTypeException) Code() string { + return "InvalidTypeException" +} + +// Message returns the exception's message. +func (s InvalidTypeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTypeException) OrigErr() error { + return nil +} + +func (s InvalidTypeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTypeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidTypeException) RequestID() string { + return s.respMetadata.RequestID +} + +// An exception for trying to create more than allowed resources or sub-resources. +// Gives http status code of 409. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Limits for given InstanceType and for each of it's role. Limits contains // following StorageTypes, InstanceLimits and AdditionalLimits type Limits struct { @@ -5028,6 +5622,66 @@ func (s *LogPublishingOptionsStatus) SetStatus(v *OptionStatus) *LogPublishingOp return s } +// Credentials for the master user: username and password, ARN, or both. +type MasterUserOptions struct { + _ struct{} `type:"structure"` + + // ARN for the master user (if IAM is enabled). + MasterUserARN *string `type:"string"` + + // The master user's username, which is stored in the Amazon Elasticsearch Service + // domain's internal database. + MasterUserName *string `min:"1" type:"string" sensitive:"true"` + + // The master user's password, which is stored in the Amazon Elasticsearch Service + // domain's internal database. + MasterUserPassword *string `min:"8" type:"string" sensitive:"true"` +} + +// String returns the string representation +func (s MasterUserOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MasterUserOptions) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *MasterUserOptions) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MasterUserOptions"} + if s.MasterUserName != nil && len(*s.MasterUserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MasterUserName", 1)) + } + if s.MasterUserPassword != nil && len(*s.MasterUserPassword) < 8 { + invalidParams.Add(request.NewErrParamMinLen("MasterUserPassword", 8)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMasterUserARN sets the MasterUserARN field's value. +func (s *MasterUserOptions) SetMasterUserARN(v string) *MasterUserOptions { + s.MasterUserARN = &v + return s +} + +// SetMasterUserName sets the MasterUserName field's value. +func (s *MasterUserOptions) SetMasterUserName(v string) *MasterUserOptions { + s.MasterUserName = &v + return s +} + +// SetMasterUserPassword sets the MasterUserPassword field's value. +func (s *MasterUserOptions) SetMasterUserPassword(v string) *MasterUserOptions { + s.MasterUserPassword = &v + return s +} + // Specifies the node-to-node encryption options. type NodeToNodeEncryptionOptions struct { _ struct{} `type:"structure"` @@ -5591,6 +6245,120 @@ func (s *ReservedElasticsearchInstanceOffering) SetUsagePrice(v float64) *Reserv return s } +// An exception for creating a resource that already exists. Gives http status +// code of 400. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// An exception for accessing or deleting a resource that does not exist. Gives +// http status code of 400. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // The current options of an Elasticsearch domain service software options. type ServiceSoftwareOptions struct { _ struct{} `type:"structure"` @@ -5968,10 +6736,16 @@ type UpdateElasticsearchDomainConfigInput struct { // for more information. AdvancedOptions map[string]*string `type:"map"` + // Specifies advanced security options. + AdvancedSecurityOptions *AdvancedSecurityOptionsInput `type:"structure"` + // Options to specify the Cognito user and identity pools for Kibana authentication. // For more information, see Amazon Cognito Authentication for Kibana (http://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-cognito-auth.html). CognitoOptions *CognitoOptions `type:"structure"` + // Options to specify configuration that will be applied to the domain endpoint. + DomainEndpointOptions *DomainEndpointOptions `type:"structure"` + // The name of the Elasticsearch domain that you are updating. // // DomainName is a required field @@ -6016,6 +6790,11 @@ func (s *UpdateElasticsearchDomainConfigInput) Validate() error { if s.DomainName != nil && len(*s.DomainName) < 3 { invalidParams.Add(request.NewErrParamMinLen("DomainName", 3)) } + if s.AdvancedSecurityOptions != nil { + if err := s.AdvancedSecurityOptions.Validate(); err != nil { + invalidParams.AddNested("AdvancedSecurityOptions", err.(request.ErrInvalidParams)) + } + } if s.CognitoOptions != nil { if err := s.CognitoOptions.Validate(); err != nil { invalidParams.AddNested("CognitoOptions", err.(request.ErrInvalidParams)) @@ -6040,12 +6819,24 @@ func (s *UpdateElasticsearchDomainConfigInput) SetAdvancedOptions(v map[string]* return s } +// SetAdvancedSecurityOptions sets the AdvancedSecurityOptions field's value. +func (s *UpdateElasticsearchDomainConfigInput) SetAdvancedSecurityOptions(v *AdvancedSecurityOptionsInput) *UpdateElasticsearchDomainConfigInput { + s.AdvancedSecurityOptions = v + return s +} + // SetCognitoOptions sets the CognitoOptions field's value. func (s *UpdateElasticsearchDomainConfigInput) SetCognitoOptions(v *CognitoOptions) *UpdateElasticsearchDomainConfigInput { s.CognitoOptions = v return s } +// SetDomainEndpointOptions sets the DomainEndpointOptions field's value. +func (s *UpdateElasticsearchDomainConfigInput) SetDomainEndpointOptions(v *DomainEndpointOptions) *UpdateElasticsearchDomainConfigInput { + s.DomainEndpointOptions = v + return s +} + // SetDomainName sets the DomainName field's value. func (s *UpdateElasticsearchDomainConfigInput) SetDomainName(v string) *UpdateElasticsearchDomainConfigInput { s.DomainName = &v @@ -6479,6 +7270,63 @@ func (s *VPCOptions) SetSubnetIds(v []*string) *VPCOptions { return s } +// An exception for missing / invalid input fields. Gives http status code of +// 400. +type ValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationException) GoString() string { + return s.String() +} + +func newErrorValidationException(v protocol.ResponseMetadata) error { + return &ValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ValidationException) Code() string { + return "ValidationException" +} + +// Message returns the exception's message. +func (s ValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ValidationException) OrigErr() error { + return nil +} + +func (s ValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ValidationException) RequestID() string { + return s.respMetadata.RequestID +} + // Specifies the zone awareness configuration for the domain cluster, such as // the number of availability zones. type ZoneAwarenessConfig struct { @@ -6599,6 +7447,12 @@ const ( // ESPartitionInstanceTypeC518xlargeElasticsearch is a ESPartitionInstanceType enum value ESPartitionInstanceTypeC518xlargeElasticsearch = "c5.18xlarge.elasticsearch" + // ESPartitionInstanceTypeUltrawarm1MediumElasticsearch is a ESPartitionInstanceType enum value + ESPartitionInstanceTypeUltrawarm1MediumElasticsearch = "ultrawarm1.medium.elasticsearch" + + // ESPartitionInstanceTypeUltrawarm1LargeElasticsearch is a ESPartitionInstanceType enum value + ESPartitionInstanceTypeUltrawarm1LargeElasticsearch = "ultrawarm1.large.elasticsearch" + // ESPartitionInstanceTypeT2MicroElasticsearch is a ESPartitionInstanceType enum value ESPartitionInstanceTypeT2MicroElasticsearch = "t2.micro.elasticsearch" @@ -6693,6 +7547,14 @@ const ( ESPartitionInstanceTypeI316xlargeElasticsearch = "i3.16xlarge.elasticsearch" ) +const ( + // ESWarmPartitionInstanceTypeUltrawarm1MediumElasticsearch is a ESWarmPartitionInstanceType enum value + ESWarmPartitionInstanceTypeUltrawarm1MediumElasticsearch = "ultrawarm1.medium.elasticsearch" + + // ESWarmPartitionInstanceTypeUltrawarm1LargeElasticsearch is a ESWarmPartitionInstanceType enum value + ESWarmPartitionInstanceTypeUltrawarm1LargeElasticsearch = "ultrawarm1.large.elasticsearch" +) + // Type of Log File, it can be one of the following: // * INDEX_SLOW_LOGS: Index slow logs contain insert requests that took more // time than configured index query log threshold to execute. @@ -6742,6 +7604,14 @@ const ( ReservedElasticsearchInstancePaymentOptionNoUpfront = "NO_UPFRONT" ) +const ( + // TLSSecurityPolicyPolicyMinTls10201907 is a TLSSecurityPolicy enum value + TLSSecurityPolicyPolicyMinTls10201907 = "Policy-Min-TLS-1-0-2019-07" + + // TLSSecurityPolicyPolicyMinTls12201907 is a TLSSecurityPolicy enum value + TLSSecurityPolicyPolicyMinTls12201907 = "Policy-Min-TLS-1-2-2019-07" +) + const ( // UpgradeStatusInProgress is a UpgradeStatus enum value UpgradeStatusInProgress = "IN_PROGRESS" diff --git a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/doc.go b/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/doc.go index 944fadc200d..fa8988a22d2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/doc.go @@ -3,9 +3,14 @@ // Package elasticsearchservice provides the client and types for making API // requests to Amazon Elasticsearch Service. // -// Use the Amazon Elasticsearch configuration API to create, configure, and +// Use the Amazon Elasticsearch Configuration API to create, configure, and // manage Elasticsearch domains. // +// For sample code that uses the Configuration API, see the Amazon Elasticsearch +// Service Developer Guide (https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-configuration-samples.html). +// The guide also contains sample code for sending signed HTTP requests to the +// Elasticsearch APIs (https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-request-signing.html). +// // 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). 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 index 332cf8d4fb5..9773068cafa 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/errors.go @@ -2,6 +2,10 @@ package elasticsearchservice +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBaseException for service response error code @@ -60,3 +64,14 @@ const ( // 400. ErrCodeValidationException = "ValidationException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BaseException": newErrorBaseException, + "DisabledOperationException": newErrorDisabledOperationException, + "InternalException": newErrorInternalException, + "InvalidTypeException": newErrorInvalidTypeException, + "LimitExceededException": newErrorLimitExceededException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ValidationException": newErrorValidationException, +} 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 index d2f8f382733..91476dd9b5b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elasticsearchservice/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "es" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Elasticsearch Service" // ServiceID is a unique identifer of a specific service. + ServiceID = "Elasticsearch Service" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ElasticsearchService client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ElasticsearchService client from just a session. // svc := elasticsearchservice.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ElasticsearchService { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ElasticsearchService { svc := &ElasticsearchService{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-01-01", }, @@ -71,7 +75,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index b3e2d0df675..504a3e30815 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/api.go @@ -68,25 +68,25 @@ func (c *ElasticTranscoder) CancelJobRequest(input *CancelJobInput) (req *reques // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation CancelJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * 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" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -168,25 +168,25 @@ func (c *ElasticTranscoder) CreateJobRequest(input *CreateJobInput) (req *reques // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation CreateJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Too many operations for a given AWS account. For example, the number of pipelines // exceeds the maximum allowed. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -262,25 +262,25 @@ func (c *ElasticTranscoder) CreatePipelineRequest(input *CreatePipelineInput) (r // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation CreatePipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * LimitExceededException // Too many operations for a given AWS account. For example, the number of pipelines // exceeds the maximum allowed. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -370,20 +370,20 @@ func (c *ElasticTranscoder) CreatePresetRequest(input *CreatePresetInput) (req * // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation CreatePreset for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Too many operations for a given AWS account. For example, the number of pipelines // exceeds the maximum allowed. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -464,25 +464,25 @@ func (c *ElasticTranscoder) DeletePipelineRequest(input *DeletePipelineInput) (r // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation DeletePipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * 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" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -561,21 +561,21 @@ func (c *ElasticTranscoder) DeletePresetRequest(input *DeletePresetInput) (req * // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation DeletePreset for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -661,21 +661,21 @@ func (c *ElasticTranscoder) ListJobsByPipelineRequest(input *ListJobsByPipelineI // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation ListJobsByPipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -743,10 +743,12 @@ func (c *ElasticTranscoder) ListJobsByPipelinePagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobsByPipelineOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListJobsByPipelineOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -809,21 +811,21 @@ func (c *ElasticTranscoder) ListJobsByStatusRequest(input *ListJobsByStatusInput // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation ListJobsByStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -891,10 +893,12 @@ func (c *ElasticTranscoder) ListJobsByStatusPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobsByStatusOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListJobsByStatusOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -956,16 +960,16 @@ func (c *ElasticTranscoder) ListPipelinesRequest(input *ListPipelinesInput) (req // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation ListPipelines for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -1033,10 +1037,12 @@ func (c *ElasticTranscoder) ListPipelinesPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPipelinesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPipelinesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1098,16 +1104,16 @@ func (c *ElasticTranscoder) ListPresetsRequest(input *ListPresetsInput) (req *re // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation ListPresets for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -1175,10 +1181,12 @@ func (c *ElasticTranscoder) ListPresetsPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPresetsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPresetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1233,21 +1241,21 @@ func (c *ElasticTranscoder) ReadJobRequest(input *ReadJobInput) (req *request.Re // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation ReadJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -1323,21 +1331,21 @@ func (c *ElasticTranscoder) ReadPipelineRequest(input *ReadPipelineInput) (req * // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation ReadPipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -1413,21 +1421,21 @@ func (c *ElasticTranscoder) ReadPresetRequest(input *ReadPresetInput) (req *requ // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation ReadPreset for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -1514,21 +1522,21 @@ func (c *ElasticTranscoder) TestRoleRequest(input *TestRoleInput) (req *request. // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation TestRole for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -1613,25 +1621,25 @@ func (c *ElasticTranscoder) UpdatePipelineRequest(input *UpdatePipelineInput) (r // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation UpdatePipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * 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" +// * 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" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -1711,25 +1719,25 @@ func (c *ElasticTranscoder) UpdatePipelineNotificationsRequest(input *UpdatePipe // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation UpdatePipelineNotifications for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * 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" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -1812,25 +1820,25 @@ func (c *ElasticTranscoder) UpdatePipelineStatusRequest(input *UpdatePipelineSta // See the AWS API reference guide for Amazon Elastic Transcoder's // API operation UpdatePipelineStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // One or more required parameter values were not provided in the request. // -// * ErrCodeIncompatibleVersionException "IncompatibleVersionException" +// * IncompatibleVersionException // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * 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" +// * 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" +// * AccessDeniedException // General authentication failure. The request was not signed correctly. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // Elastic Transcoder encountered an unexpected exception while trying to fulfill // the request. // @@ -1855,6 +1863,62 @@ func (c *ElasticTranscoder) UpdatePipelineStatusWithContext(ctx aws.Context, inp return out, req.Send() } +// General authentication failure. The request was not signed correctly. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + // The file to be used as album art. There can be multiple artworks associated // with an audio file, to a maximum of 20. // @@ -4030,6 +4094,61 @@ func (s *HlsContentProtection) SetMethod(v string) *HlsContentProtection { return s } +type IncompatibleVersionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s IncompatibleVersionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IncompatibleVersionException) GoString() string { + return s.String() +} + +func newErrorIncompatibleVersionException(v protocol.ResponseMetadata) error { + return &IncompatibleVersionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IncompatibleVersionException) Code() string { + return "IncompatibleVersionException" +} + +// Message returns the exception's message. +func (s IncompatibleVersionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IncompatibleVersionException) OrigErr() error { + return nil +} + +func (s IncompatibleVersionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IncompatibleVersionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IncompatibleVersionException) RequestID() string { + return s.respMetadata.RequestID +} + // The captions to be created, if any. type InputCaptions struct { _ struct{} `type:"structure"` @@ -4102,6 +4221,63 @@ func (s *InputCaptions) SetMergePolicy(v string) *InputCaptions { return s } +// Elastic Transcoder encountered an unexpected exception while trying to fulfill +// the request. +type InternalServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServiceException) GoString() string { + return s.String() +} + +func newErrorInternalServiceException(v protocol.ResponseMetadata) error { + return &InternalServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServiceException) Code() string { + return "InternalServiceException" +} + +// Message returns the exception's message. +func (s InternalServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServiceException) OrigErr() error { + return nil +} + +func (s InternalServiceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServiceException) RequestID() string { + return s.respMetadata.RequestID +} + // A section of the response body that provides information about the job that // is created. type Job struct { @@ -4952,6 +5128,63 @@ func (s *JobWatermark) SetPresetWatermarkId(v string) *JobWatermark { return s } +// Too many operations for a given AWS account. For example, the number of pipelines +// exceeds the maximum allowed. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // The ListJobsByPipelineRequest structure. type ListJobsByPipelineInput struct { _ struct{} `type:"structure"` @@ -6527,6 +6760,121 @@ func (s *ReadPresetOutput) SetPreset(v *Preset) *ReadPresetOutput { return s } +// The resource you are attempting to change is in use. For example, you are +// attempting to delete a pipeline that is currently in use. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // The TestRoleRequest structure. // // Deprecated: TestRoleInput has been deprecated @@ -7358,6 +7706,62 @@ func (s *UpdatePipelineStatusOutput) SetPipeline(v *Pipeline) *UpdatePipelineSta return s } +// One or more required parameter values were not provided in the request. +type ValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationException) GoString() string { + return s.String() +} + +func newErrorValidationException(v protocol.ResponseMetadata) error { + return &ValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ValidationException) Code() string { + return "ValidationException" +} + +// Message returns the exception's message. +func (s ValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ValidationException) OrigErr() error { + return nil +} + +func (s ValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ValidationException) RequestID() string { + return s.respMetadata.RequestID +} + // The VideoParameters structure. type VideoParameters struct { _ struct{} `type:"structure"` 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 index 7c670785cc6..4859b429db6 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/errors.go @@ -2,6 +2,10 @@ package elastictranscoder +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccessDeniedException for service response error code @@ -49,3 +53,13 @@ const ( // One or more required parameter values were not provided in the request. ErrCodeValidationException = "ValidationException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "IncompatibleVersionException": newErrorIncompatibleVersionException, + "InternalServiceException": newErrorInternalServiceException, + "LimitExceededException": newErrorLimitExceededException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ValidationException": newErrorValidationException, +} 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 index 30acb8d1bc0..b9d182eb718 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elastictranscoder/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "elastictranscoder" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Elastic Transcoder" // ServiceID is a unique identifer of a specific service. + ServiceID = "Elastic Transcoder" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ElasticTranscoder client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ElasticTranscoder client from just a session. // svc := elastictranscoder.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ElasticTranscoder { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ElasticTranscoder { svc := &ElasticTranscoder{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2012-09-25", }, @@ -71,7 +75,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index acd696d4d6f..c2e93fa72d3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/api.go @@ -1807,10 +1807,12 @@ func (c *ELB) DescribeLoadBalancersPagesWithContext(ctx aws.Context, input *Desc }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeLoadBalancersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeLoadBalancersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } 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 index 5dfdd322c9b..7ed1a60988f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elb/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elb/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "elasticloadbalancing" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Elastic Load Balancing" // ServiceID is a unique identifer of a specific service. + ServiceID = "Elastic Load Balancing" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ELB client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ELB client from just a session. // svc := elb.New(mySession) // @@ -46,11 +48,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ELB { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ELB { svc := &ELB{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2012-06-01", }, 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 index 7dfb07d51f2..c1903d5141d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elbv2/api.go @@ -320,6 +320,11 @@ func (c *ELBV2) CreateListenerRequest(input *CreateListenerInput) (req *request. // * ErrCodeInvalidLoadBalancerActionException "InvalidLoadBalancerAction" // The requested action is not valid. // +// * ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException "TooManyUniqueTargetGroupsPerLoadBalancer" +// You've reached the limit on the number of unique target groups per load balancer +// across all listeners. If a target group is used by multiple actions for a +// load balancer, it is counted as only one use. +// // See also, 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) @@ -583,6 +588,11 @@ func (c *ELBV2) CreateRuleRequest(input *CreateRuleInput) (req *request.Request, // * ErrCodeInvalidLoadBalancerActionException "InvalidLoadBalancerAction" // The requested action is not valid. // +// * ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException "TooManyUniqueTargetGroupsPerLoadBalancer" +// You've reached the limit on the number of unique target groups per load balancer +// across all listeners. If a target group is used by multiple actions for a +// load balancer, it is counted as only one use. +// // See also, 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) @@ -1446,10 +1456,12 @@ func (c *ELBV2) DescribeListenersPagesWithContext(ctx aws.Context, input *Descri }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeListenersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeListenersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1668,10 +1680,12 @@ func (c *ELBV2) DescribeLoadBalancersPagesWithContext(ctx aws.Context, input *De }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeLoadBalancersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeLoadBalancersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2153,10 +2167,12 @@ func (c *ELBV2) DescribeTargetGroupsPagesWithContext(ctx aws.Context, input *Des }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTargetGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeTargetGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2291,14 +2307,18 @@ func (c *ELBV2) ModifyListenerRequest(input *ModifyListenerInput) (req *request. // ModifyListener API operation for Elastic Load Balancing. // -// Modifies the specified properties of the specified listener. +// Replaces the specified properties of the specified listener. Any properties +// that you do not specify remain unchanged. // -// Any properties that you do not specify retain their current values. However, -// changing the protocol from HTTPS to HTTP, or from TLS to TCP, removes the +// Changing the protocol from HTTPS to HTTP, or from TLS to TCP, removes the // security policy and default certificate properties. If you change the protocol // from HTTP to HTTPS, or from TCP to TLS, you must add the security policy // and default certificate properties. // +// To add an item to a list, remove an item from a list, or update an item in +// a list, you must provide the entire list. For example, to add an action, +// specify a list with the current actions plus the new 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. @@ -2353,6 +2373,11 @@ func (c *ELBV2) ModifyListenerRequest(input *ModifyListenerInput) (req *request. // * ErrCodeInvalidLoadBalancerActionException "InvalidLoadBalancerAction" // The requested action is not valid. // +// * ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException "TooManyUniqueTargetGroupsPerLoadBalancer" +// You've reached the limit on the number of unique target groups per load balancer +// across all listeners. If a target group is used by multiple actions for a +// load balancer, it is counted as only one use. +// // See also, 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) @@ -2506,9 +2531,12 @@ func (c *ELBV2) ModifyRuleRequest(input *ModifyRuleInput) (req *request.Request, // ModifyRule API operation for Elastic Load Balancing. // -// Modifies the specified rule. +// Replaces the specified properties of the specified rule. Any properties that +// you do not specify are unchanged. // -// Any existing properties that you do not modify retain their current values. +// To add an item to a list, remove an item from a list, or update an item in +// a list, you must provide the entire list. For example, to add an action, +// specify a list with the current actions plus the new action. // // To modify the actions for the default rule, use ModifyListener. // @@ -2551,6 +2579,11 @@ func (c *ELBV2) ModifyRuleRequest(input *ModifyRuleInput) (req *request.Request, // * ErrCodeInvalidLoadBalancerActionException "InvalidLoadBalancerAction" // The requested action is not valid. // +// * ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException "TooManyUniqueTargetGroupsPerLoadBalancer" +// You've reached the limit on the number of unique target groups per load balancer +// across all listeners. If a target group is used by multiple actions for a +// load balancer, it is counted as only one use. +// // See also, 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) @@ -3337,11 +3370,12 @@ func (c *ELBV2) SetSubnetsRequest(input *SetSubnetsInput) (req *request.Request, // SetSubnets API operation for Elastic Load Balancing. // -// Enables the Availability Zone for the specified public subnets for the specified -// Application Load Balancer. The specified subnets replace the previously enabled -// subnets. +// Enables the Availability Zones for the specified public subnets for the specified +// load balancer. The specified subnets replace the previously enabled subnets. // -// You can't change the subnets for a Network Load Balancer. +// When you specify subnets for a Network Load Balancer, you must include all +// subnets that were enabled previously, with their existing configurations, +// plus any additional 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 @@ -3407,9 +3441,17 @@ type Action struct { // a custom HTTP response. Specify only when Type is fixed-response. FixedResponseConfig *FixedResponseActionConfig `type:"structure"` + // Information for creating an action that distributes requests among one or + // more target groups. For Network Load Balancers, you can specify a single + // target group. Specify only when Type is forward. If you specify both ForwardConfig + // and TargetGroupArn, you can specify only one target group using ForwardConfig + // and it must be the same target group specified in TargetGroupArn. + ForwardConfig *ForwardActionConfig `type:"structure"` + // The order for the action. This value is required for rules with multiple // actions. The action with the lowest value for order is performed first. The - // final action to be performed must be a forward or a fixed-response action. + // last action to be performed must be one of the following types of actions: + // a forward, fixed-response, or redirect. Order *int64 `min:"1" type:"integer"` // [Application Load Balancer] Information for creating a redirect action. Specify @@ -3417,11 +3459,11 @@ type Action struct { RedirectConfig *RedirectActionConfig `type:"structure"` // The Amazon Resource Name (ARN) of the target group. Specify only when Type - // is forward. + // is forward and you want to route to a single target group. To route to one + // or more target groups, use ForwardConfig instead. TargetGroupArn *string `type:"string"` - // The type of action. Each rule must include exactly one of the following types - // of actions: forward, fixed-response, or redirect. + // The type of action. // // Type is a required field Type *string `type:"string" required:"true" enum:"ActionTypeEnum"` @@ -3491,6 +3533,12 @@ func (s *Action) SetFixedResponseConfig(v *FixedResponseActionConfig) *Action { return s } +// SetForwardConfig sets the ForwardConfig field's value. +func (s *Action) SetForwardConfig(v *ForwardActionConfig) *Action { + s.ForwardConfig = v + return s +} + // SetOrder sets the Order field's value. func (s *Action) SetOrder(v int64) *Action { s.Order = &v @@ -3599,7 +3647,7 @@ type AddTagsInput struct { // ResourceArns is a required field ResourceArns []*string `type:"list" required:"true"` - // The tags. Each resource can have a maximum of 10 tags. + // The tags. // // Tags is a required field Tags []*Tag `min:"1" type:"list" required:"true"` @@ -3984,7 +4032,8 @@ type AvailabilityZone struct { // [Network Load Balancers] If you need static IP addresses for your load balancer, // you can specify one Elastic IP address per Availability Zone when you create - // the load balancer. + // an internal-facing load balancer. For internal load balancers, you can specify + // a private IP address from the IPv4 range of the subnet. LoadBalancerAddresses []*LoadBalancerAddress `type:"list"` // The ID of the subnet. You can specify one subnet per Availability Zone. @@ -4104,10 +4153,10 @@ type CreateListenerInput struct { // The actions for the default rule. The rule must include one forward action // or one or more fixed-response actions. // - // If the action type is forward, you specify a target group. The protocol of - // the target group must be HTTP or HTTPS for an Application Load Balancer. - // The protocol of the target group must be TCP, TLS, UDP, or TCP_UDP for a - // Network Load Balancer. + // If the action type is forward, you specify one or more target groups. The + // protocol of the target group must be HTTP or HTTPS for an Application Load + // Balancer. The protocol of the target group must be TCP, TLS, UDP, or TCP_UDP + // for a Network Load Balancer. // // [HTTPS listeners] If the action type is authenticate-oidc, you authenticate // users through an identity provider that is OpenID Connect (OIDC) compliant. @@ -4141,9 +4190,30 @@ type CreateListenerInput struct { // Protocol is a required field Protocol *string `type:"string" required:"true" enum:"ProtocolEnum"` - // [HTTPS and TLS listeners] The security policy that defines which ciphers - // and protocols are supported. The default is the current predefined security - // policy. + // [HTTPS and TLS listeners] The security policy that defines which protocols + // and ciphers are supported. The following are the possible values: + // + // * ELBSecurityPolicy-2016-08 + // + // * ELBSecurityPolicy-TLS-1-0-2015-04 + // + // * ELBSecurityPolicy-TLS-1-1-2017-01 + // + // * ELBSecurityPolicy-TLS-1-2-2017-01 + // + // * ELBSecurityPolicy-TLS-1-2-Ext-2018-06 + // + // * ELBSecurityPolicy-FS-2018-06 + // + // * ELBSecurityPolicy-FS-1-1-2019-08 + // + // * ELBSecurityPolicy-FS-1-2-2019-08 + // + // * ELBSecurityPolicy-FS-1-2-Res-2019-08 + // + // For more information, see Security Policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies) + // in the Application Load Balancers Guide and Security Policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#describe-ssl-policies) + // in the Network Load Balancers Guide. SslPolicy *string `type:"string"` } @@ -4276,8 +4346,8 @@ type CreateLoadBalancerInput struct { // // 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. + // IP addresses of the nodes. Therefore, internal load balancers can route requests + // only 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"` @@ -4294,7 +4364,9 @@ type CreateLoadBalancerInput struct { // // [Network Load Balancers] You can specify subnets from one or more Availability // Zones. You can specify one Elastic IP address per subnet if you need static - // IP addresses for your load balancer. + // IP addresses for your internet-facing load balancer. For internal load balancers, + // you can specify one private IP address per subnet from the IPv4 range of + // the subnet. SubnetMappings []*SubnetMapping `type:"list"` // The IDs of the public subnets. You can specify only one subnet per Availability @@ -4425,12 +4497,13 @@ type CreateRuleInput struct { _ struct{} `type:"structure"` // The actions. Each rule must include exactly one of the following types of - // actions: forward, fixed-response, or redirect. + // actions: forward, fixed-response, or redirect, and it must be the last action + // to be performed. // - // If the action type is forward, you specify a target group. The protocol of - // the target group must be HTTP or HTTPS for an Application Load Balancer. - // The protocol of the target group must be TCP, TLS, UDP, or TCP_UDP for a - // Network Load Balancer. + // If the action type is forward, you specify one or more target groups. The + // protocol of the target group must be HTTP or HTTPS for an Application Load + // Balancer. The protocol of the target group must be TCP, TLS, UDP, or TCP_UDP + // for a Network Load Balancer. // // [HTTPS listeners] If the action type is authenticate-oidc, you authenticate // users through an identity provider that is OpenID Connect (OIDC) compliant. @@ -5681,7 +5754,7 @@ type DescribeSSLPoliciesOutput struct { // Otherwise, this is null. NextMarker *string `type:"string"` - // Information about the policies. + // Information about the security policies. SslPolicies []*SslPolicy `type:"list"` } @@ -5710,7 +5783,8 @@ func (s *DescribeSSLPoliciesOutput) SetSslPolicies(v []*SslPolicy) *DescribeSSLP type DescribeTagsInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Names (ARN) of the resources. + // The Amazon Resource Names (ARN) of the resources. You can specify up to 20 + // resources in a single call. // // ResourceArns is a required field ResourceArns []*string `type:"list" required:"true"` @@ -6075,6 +6149,40 @@ func (s *FixedResponseActionConfig) SetStatusCode(v string) *FixedResponseAction return s } +// Information about a forward action. +type ForwardActionConfig struct { + _ struct{} `type:"structure"` + + // The target group stickiness for the rule. + TargetGroupStickinessConfig *TargetGroupStickinessConfig `type:"structure"` + + // One or more target groups. For Network Load Balancers, you can specify a + // single target group. + TargetGroups []*TargetGroupTuple `type:"list"` +} + +// String returns the string representation +func (s ForwardActionConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ForwardActionConfig) GoString() string { + return s.String() +} + +// SetTargetGroupStickinessConfig sets the TargetGroupStickinessConfig field's value. +func (s *ForwardActionConfig) SetTargetGroupStickinessConfig(v *TargetGroupStickinessConfig) *ForwardActionConfig { + s.TargetGroupStickinessConfig = v + return s +} + +// SetTargetGroups sets the TargetGroups field's value. +func (s *ForwardActionConfig) SetTargetGroups(v []*TargetGroupTuple) *ForwardActionConfig { + s.TargetGroups = v + return s +} + // Information about a host header condition. type HostHeaderConditionConfig struct { _ struct{} `type:"structure"` @@ -6212,6 +6320,12 @@ type Limit struct { // // * target-groups // + // * target-groups-per-action-on-application-load-balancer + // + // * target-groups-per-action-on-network-load-balancer + // + // * target-groups-per-application-load-balancer + // // * targets-per-application-load-balancer // // * targets-per-availability-zone-per-network-load-balancer @@ -6264,8 +6378,8 @@ type Listener struct { // The protocol for connections from clients to the load balancer. Protocol *string `type:"string" enum:"ProtocolEnum"` - // [HTTPS or TLS listener] The security policy that defines which ciphers and - // protocols are supported. The default is the current predefined security policy. + // [HTTPS or TLS listener] The security policy that defines which protocols + // and ciphers are supported. SslPolicy *string `type:"string"` } @@ -6355,8 +6469,8 @@ type LoadBalancer struct { // // 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. + // IP addresses of the nodes. Therefore, internal load balancers can route requests + // only 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. @@ -6458,11 +6572,15 @@ func (s *LoadBalancer) SetVpcId(v string) *LoadBalancer { type LoadBalancerAddress struct { _ struct{} `type:"structure"` - // [Network Load Balancers] The allocation ID of the Elastic IP address. + // [Network Load Balancers] The allocation ID of the Elastic IP address for + // an internal-facing load balancer. AllocationId *string `type:"string"` // The static IP address. IpAddress *string `type:"string"` + + // [Network Load Balancers] The private IPv4 address for an internal load balancer. + PrivateIPv4Address *string `type:"string"` } // String returns the string representation @@ -6487,6 +6605,12 @@ func (s *LoadBalancerAddress) SetIpAddress(v string) *LoadBalancerAddress { return s } +// SetPrivateIPv4Address sets the PrivateIPv4Address field's value. +func (s *LoadBalancerAddress) SetPrivateIPv4Address(v string) *LoadBalancerAddress { + s.PrivateIPv4Address = &v + return s +} + // Information about a load balancer attribute. type LoadBalancerAttribute struct { _ struct{} `type:"structure"` @@ -6515,8 +6639,13 @@ type LoadBalancerAttribute struct { // * idle_timeout.timeout_seconds - The idle timeout value, in seconds. The // valid range is 1-4000 seconds. The default is 60 seconds. // + // * routing.http.drop_invalid_header_fields.enabled - Indicates whether + // HTTP headers with invalid header fields are removed by the load balancer + // (true) or routed to targets (false). The default is false. + // // * routing.http2.enabled - Indicates whether HTTP/2 is enabled. The value - // is true or false. The default is true. + // is true or false. The default is true. Elastic Load Balancing requires + // that message header names contain only alphanumeric characters and hyphens. // // The following attributes are supported by only Network Load Balancers: // @@ -6643,10 +6772,10 @@ type ModifyListenerInput struct { // The actions for the default rule. The rule must include one forward action // or one or more fixed-response actions. // - // If the action type is forward, you specify a target group. The protocol of - // the target group must be HTTP or HTTPS for an Application Load Balancer. - // The protocol of the target group must be TCP, TLS, UDP, or TCP_UDP for a - // Network Load Balancer. + // If the action type is forward, you specify one or more target groups. The + // protocol of the target group must be HTTP or HTTPS for an Application Load + // Balancer. The protocol of the target group must be TCP, TLS, UDP, or TCP_UDP + // for a Network Load Balancer. // // [HTTPS listeners] If the action type is authenticate-oidc, you authenticate // users through an identity provider that is OpenID Connect (OIDC) compliant. @@ -6675,8 +6804,29 @@ type ModifyListenerInput struct { Protocol *string `type:"string" enum:"ProtocolEnum"` // [HTTPS and TLS listeners] The security policy that defines which protocols - // and ciphers are supported. For more information, see Security Policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies) - // in the Application Load Balancers Guide. + // and ciphers are supported. The following are the possible values: + // + // * ELBSecurityPolicy-2016-08 + // + // * ELBSecurityPolicy-TLS-1-0-2015-04 + // + // * ELBSecurityPolicy-TLS-1-1-2017-01 + // + // * ELBSecurityPolicy-TLS-1-2-2017-01 + // + // * ELBSecurityPolicy-TLS-1-2-Ext-2018-06 + // + // * ELBSecurityPolicy-FS-2018-06 + // + // * ELBSecurityPolicy-FS-1-1-2019-08 + // + // * ELBSecurityPolicy-FS-1-2-2019-08 + // + // * ELBSecurityPolicy-FS-1-2-Res-2019-08 + // + // For more information, see Security Policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/application/create-https-listener.html#describe-ssl-policies) + // in the Application Load Balancers Guide and Security Policies (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/create-tls-listener.html#describe-ssl-policies) + // in the Network Load Balancers Guide. SslPolicy *string `type:"string"` } @@ -6854,12 +7004,13 @@ type ModifyRuleInput struct { _ struct{} `type:"structure"` // The actions. Each rule must include exactly one of the following types of - // actions: forward, fixed-response, or redirect. + // actions: forward, fixed-response, or redirect, and it must be the last action + // to be performed. // - // If the action type is forward, you specify a target group. The protocol of - // the target group must be HTTP or HTTPS for an Application Load Balancer. - // The protocol of the target group must be TCP, TLS, UDP, or TCP_UDP for a - // Network Load Balancer. + // If the action type is forward, you specify one or more target groups. The + // protocol of the target group must be HTTP or HTTPS for an Application Load + // Balancer. The protocol of the target group must be TCP, TLS, UDP, or TCP_UDP + // for a Network Load Balancer. // // [HTTPS listeners] If the action type is authenticate-oidc, you authenticate // users through an identity provider that is OpenID Connect (OIDC) compliant. @@ -7044,7 +7195,7 @@ type ModifyTargetGroupInput struct { // target. For Application Load Balancers, the range is 5 to 300 seconds. For // Network Load Balancers, the supported values are 10 or 30 seconds. // - // If the protocol of the target group is TCP, you can't modify this setting. + // With Network Load Balancers, you can't modify this setting. HealthCheckIntervalSeconds *int64 `min:"5" type:"integer"` // [HTTP/HTTPS health checks] The ping path that is the destination for the @@ -7059,13 +7210,13 @@ type ModifyTargetGroupInput struct { // target group is TCP, TLS, UDP, or TCP_UDP. The TLS, UDP, and TCP_UDP protocols // are not supported for health checks. // - // If the protocol of the target group is TCP, you can't modify this setting. + // With Network Load Balancers, you can't modify this setting. HealthCheckProtocol *string `type:"string" enum:"ProtocolEnum"` // [HTTP/HTTPS health checks] The amount of time, in seconds, during which no // response means a failed health check. // - // If the protocol of the target group is TCP, you can't modify this setting. + // With Network Load Balancers, you can't modify this setting. HealthCheckTimeoutSeconds *int64 `min:"2" type:"integer"` // The number of consecutive health checks successes required before considering @@ -7075,7 +7226,7 @@ type ModifyTargetGroupInput struct { // [HTTP/HTTPS health checks] The HTTP codes to use when checking for a successful // response from a target. // - // If the protocol of the target group is TCP, you can't modify this setting. + // With Network Load Balancers, you can't modify this setting. Matcher *Matcher `type:"structure"` // The Amazon Resource Name (ARN) of the target group. @@ -8115,11 +8266,17 @@ type SetSubnetsInput struct { // LoadBalancerArn is a required field LoadBalancerArn *string `type:"string" required:"true"` - // The IDs of the public subnets. You must specify subnets from at least two - // Availability Zones. You can specify only one subnet per Availability Zone. - // You must specify either subnets or subnet mappings. + // The IDs of the public subnets. You can specify only one subnet per Availability + // Zone. You must specify either subnets or subnet mappings. + // + // [Application Load Balancers] You must specify subnets from at least two Availability + // Zones. You cannot specify Elastic IP addresses for your subnets. // - // You cannot specify Elastic IP addresses for your subnets. + // [Network Load Balancers] You can specify subnets from one or more Availability + // Zones. If you need static IP addresses for your internet-facing load balancer, + // you can specify one Elastic IP address per subnet. For internal load balancers, + // you can specify one private IP address per subnet from the IPv4 range of + // the subnet. SubnetMappings []*SubnetMapping `type:"list"` // The IDs of the public subnets. You must specify subnets from at least two @@ -8272,9 +8429,13 @@ func (s *SslPolicy) SetSslProtocols(v []*string) *SslPolicy { type SubnetMapping struct { _ struct{} `type:"structure"` - // [Network Load Balancers] The allocation ID of the Elastic IP address. + // [Network Load Balancers] The allocation ID of the Elastic IP address for + // an internet-facing load balancer. AllocationId *string `type:"string"` + // [Network Load Balancers] The private IPv4 address for an internal load balancer. + PrivateIPv4Address *string `type:"string"` + // The ID of the subnet. SubnetId *string `type:"string"` } @@ -8295,6 +8456,12 @@ func (s *SubnetMapping) SetAllocationId(v string) *SubnetMapping { return s } +// SetPrivateIPv4Address sets the PrivateIPv4Address field's value. +func (s *SubnetMapping) SetPrivateIPv4Address(v string) *SubnetMapping { + s.PrivateIPv4Address = &v + return s +} + // SetSubnetId sets the SubnetId field's value. func (s *SubnetMapping) SetSubnetId(v string) *SubnetMapping { s.SubnetId = &v @@ -8415,7 +8582,8 @@ type TargetDescription struct { // Id is a required field Id *string `type:"string" required:"true"` - // The port on which the target is listening. + // The port on which the target is listening. Not used if the target is a Lambda + // function. Port *int64 `min:"1" type:"integer"` } @@ -8498,7 +8666,8 @@ type TargetGroup struct { // 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. + // The port on which the targets are listening. Not used if the target is a + // Lambda function. Port *int64 `min:"1" type:"integer"` // The protocol to use for routing traffic to the targets. @@ -8635,8 +8804,8 @@ type TargetGroupAttribute struct { // The name of the attribute. // - // The following attribute is supported by both Application Load Balancers and - // Network Load Balancers: + // The following attributes are supported by both Application Load Balancers + // and Network Load Balancers: // // * deregistration_delay.timeout_seconds - The amount of time, in seconds, // for Elastic Load Balancing to wait before changing the state of a deregistering @@ -8644,21 +8813,26 @@ type TargetGroupAttribute struct { // value is 300 seconds. If the target is a Lambda function, this attribute // is not supported. // + // * stickiness.enabled - Indicates whether sticky sessions are enabled. + // The value is true or false. The default is false. + // + // * stickiness.type - The type of sticky sessions. The possible values are + // lb_cookie for Application Load Balancers or source_ip for Network Load + // Balancers. + // // The following attributes are supported by Application Load Balancers if the // target is not a Lambda function: // + // * load_balancing.algorithm.type - The load balancing algorithm determines + // how the load balancer selects targets when routing requests. The value + // is round_robin or least_outstanding_requests. The default is round_robin. + // // * slow_start.duration_seconds - The time period, in seconds, during which // a newly registered target receives a linearly increasing share of the // traffic to the target group. After this time period ends, the target receives // its full share of traffic. The range is 30-900 seconds (15 minutes). Slow // start mode is disabled by default. // - // * stickiness.enabled - Indicates whether sticky sessions are enabled. - // The value is true or false. The default is 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 @@ -8706,6 +8880,74 @@ func (s *TargetGroupAttribute) SetValue(v string) *TargetGroupAttribute { return s } +// Information about the target group stickiness for a rule. +type TargetGroupStickinessConfig struct { + _ struct{} `type:"structure"` + + // The time period, in seconds, during which requests from a client should be + // routed to the same target group. The range is 1-604800 seconds (7 days). + DurationSeconds *int64 `type:"integer"` + + // Indicates whether target group stickiness is enabled. + Enabled *bool `type:"boolean"` +} + +// String returns the string representation +func (s TargetGroupStickinessConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TargetGroupStickinessConfig) GoString() string { + return s.String() +} + +// SetDurationSeconds sets the DurationSeconds field's value. +func (s *TargetGroupStickinessConfig) SetDurationSeconds(v int64) *TargetGroupStickinessConfig { + s.DurationSeconds = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *TargetGroupStickinessConfig) SetEnabled(v bool) *TargetGroupStickinessConfig { + s.Enabled = &v + return s +} + +// Information about how traffic will be distributed between multiple target +// groups in a forward rule. +type TargetGroupTuple struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the target group. + TargetGroupArn *string `type:"string"` + + // The weight. The range is 0 to 999. + Weight *int64 `type:"integer"` +} + +// String returns the string representation +func (s TargetGroupTuple) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TargetGroupTuple) GoString() string { + return s.String() +} + +// SetTargetGroupArn sets the TargetGroupArn field's value. +func (s *TargetGroupTuple) SetTargetGroupArn(v string) *TargetGroupTuple { + s.TargetGroupArn = &v + return s +} + +// SetWeight sets the Weight field's value. +func (s *TargetGroupTuple) SetWeight(v int64) *TargetGroupTuple { + s.Weight = &v + return s +} + // Information about the current health of a target. type TargetHealth struct { _ struct{} `type:"structure"` @@ -8731,14 +8973,16 @@ type TargetHealth struct { // values: // // * Target.ResponseCodeMismatch - The health checks did not return an expected - // HTTP code. + // HTTP code. Applies only to Application Load Balancers. // - // * Target.Timeout - The health check requests timed out. + // * Target.Timeout - The health check requests timed out. Applies only to + // Application Load Balancers. // // * Target.FailedHealthChecks - The load balancer received an error while // establishing a connection to the target or the target response was malformed. // // * Elb.InternalError - The health checks failed due to an internal error. + // Applies only to Application Load Balancers. // // If the target state is unused, the reason code can be one of the following // values: @@ -8750,11 +8994,11 @@ type TargetHealth struct { // 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. + // // * Target.IpUnusable - The target IP address is reserved for use by a 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 @@ -8764,7 +9008,10 @@ type TargetHealth struct { // value: // // * Target.HealthCheckDisabled - Health checks are disabled for the target - // group. + // group. Applies only to Application Load Balancers. + // + // * Elb.InternalError - Target health is unavailable due to an internal + // error. Applies only to Network Load Balancers. Reason *string `type:"string" enum:"TargetHealthReasonEnum"` // The state of the target. 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 index b813ebeff7a..fa10830ff9c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elbv2/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elbv2/errors.go @@ -211,6 +211,14 @@ const ( // You've reached the limit on the number of targets. ErrCodeTooManyTargetsException = "TooManyTargets" + // ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException for service response error code + // "TooManyUniqueTargetGroupsPerLoadBalancer". + // + // You've reached the limit on the number of unique target groups per load balancer + // across all listeners. If a target group is used by multiple actions for a + // load balancer, it is counted as only one use. + ErrCodeTooManyUniqueTargetGroupsPerLoadBalancerException = "TooManyUniqueTargetGroupsPerLoadBalancer" + // ErrCodeUnsupportedProtocolException for service response error code // "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 index ad97e8df885..1c869cf040b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/elbv2/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/elbv2/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "elasticloadbalancing" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Elastic Load Balancing v2" // ServiceID is a unique identifer of a specific service. + ServiceID = "Elastic Load Balancing v2" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ELBV2 client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ELBV2 client from just a session. // svc := elbv2.New(mySession) // @@ -46,11 +48,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ELBV2 { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ELBV2 { svc := &ELBV2{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-12-01", }, 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 index ce35d389aee..f0de166ef22 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/emr/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/emr/api.go @@ -69,11 +69,11 @@ func (c *EMR) AddInstanceFleetRequest(input *AddInstanceFleetInput) (req *reques // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation AddInstanceFleet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddInstanceFleet @@ -151,8 +151,8 @@ func (c *EMR) AddInstanceGroupsRequest(input *AddInstanceGroupsInput) (req *requ // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation AddInstanceGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // Indicates that an error occurred while processing the request and that the // request was not completed. // @@ -253,8 +253,8 @@ func (c *EMR) AddJobFlowStepsRequest(input *AddJobFlowStepsInput) (req *request. // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation AddJobFlowSteps for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // Indicates that an error occurred while processing the request and that the // request was not completed. // @@ -336,11 +336,11 @@ func (c *EMR) AddTagsRequest(input *AddTagsInput) (req *request.Request, output // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation AddTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/AddTags @@ -422,12 +422,12 @@ func (c *EMR) CancelStepsRequest(input *CancelStepsInput) (req *request.Request, // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation CancelSteps for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // Indicates that an error occurred while processing the request and that the // request was not completed. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CancelSteps @@ -506,11 +506,11 @@ func (c *EMR) CreateSecurityConfigurationRequest(input *CreateSecurityConfigurat // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation CreateSecurityConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/CreateSecurityConfiguration @@ -589,11 +589,11 @@ func (c *EMR) DeleteSecurityConfigurationRequest(input *DeleteSecurityConfigurat // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation DeleteSecurityConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DeleteSecurityConfiguration @@ -672,11 +672,11 @@ func (c *EMR) DescribeClusterRequest(input *DescribeClusterInput) (req *request. // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation DescribeCluster for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeCluster @@ -778,8 +778,8 @@ func (c *EMR) DescribeJobFlowsRequest(input *DescribeJobFlowsInput) (req *reques // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation DescribeJobFlows for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // Indicates that an error occurred while processing the request and that the // request was not completed. // @@ -863,11 +863,11 @@ func (c *EMR) DescribeSecurityConfigurationRequest(input *DescribeSecurityConfig // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation DescribeSecurityConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeSecurityConfiguration @@ -945,11 +945,11 @@ func (c *EMR) DescribeStepRequest(input *DescribeStepInput) (req *request.Reques // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation DescribeStep for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/DescribeStep @@ -1030,11 +1030,11 @@ func (c *EMR) GetBlockPublicAccessConfigurationRequest(input *GetBlockPublicAcce // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation GetBlockPublicAccessConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/GetBlockPublicAccessConfiguration @@ -1118,11 +1118,11 @@ func (c *EMR) ListBootstrapActionsRequest(input *ListBootstrapActionsInput) (req // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation ListBootstrapActions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListBootstrapActions @@ -1190,10 +1190,12 @@ func (c *EMR) ListBootstrapActionsPagesWithContext(ctx aws.Context, input *ListB }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListBootstrapActionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListBootstrapActionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1260,11 +1262,11 @@ func (c *EMR) ListClustersRequest(input *ListClustersInput) (req *request.Reques // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation ListClusters for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListClusters @@ -1332,10 +1334,12 @@ func (c *EMR) ListClustersPagesWithContext(ctx aws.Context, input *ListClustersI }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListClustersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListClustersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1401,11 +1405,11 @@ func (c *EMR) ListInstanceFleetsRequest(input *ListInstanceFleetsInput) (req *re // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation ListInstanceFleets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstanceFleets @@ -1473,10 +1477,12 @@ func (c *EMR) ListInstanceFleetsPagesWithContext(ctx aws.Context, input *ListIns }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInstanceFleetsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListInstanceFleetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1539,11 +1545,11 @@ func (c *EMR) ListInstanceGroupsRequest(input *ListInstanceGroupsInput) (req *re // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation ListInstanceGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstanceGroups @@ -1611,10 +1617,12 @@ func (c *EMR) ListInstanceGroupsPagesWithContext(ctx aws.Context, input *ListIns }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInstanceGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListInstanceGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1680,11 +1688,11 @@ func (c *EMR) ListInstancesRequest(input *ListInstancesInput) (req *request.Requ // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation ListInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListInstances @@ -1752,10 +1760,12 @@ func (c *EMR) ListInstancesPagesWithContext(ctx aws.Context, input *ListInstance }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInstancesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListInstancesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1821,11 +1831,11 @@ func (c *EMR) ListSecurityConfigurationsRequest(input *ListSecurityConfiguration // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation ListSecurityConfigurations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListSecurityConfigurations @@ -1893,10 +1903,12 @@ func (c *EMR) ListSecurityConfigurationsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSecurityConfigurationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListSecurityConfigurationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1951,7 +1963,8 @@ func (c *EMR) ListStepsRequest(input *ListStepsInput) (req *request.Request, out // 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. +// stepIds with the request of filter by StepStates. You can specify a maximum +// of ten stepIDs. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1960,11 +1973,11 @@ func (c *EMR) ListStepsRequest(input *ListStepsInput) (req *request.Request, out // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation ListSteps for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ListSteps @@ -2032,13 +2045,99 @@ func (c *EMR) ListStepsPagesWithContext(ctx aws.Context, input *ListStepsInput, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStepsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListStepsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } +const opModifyCluster = "ModifyCluster" + +// ModifyClusterRequest generates a "aws/request.Request" representing the +// client's request for the ModifyCluster operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ModifyCluster for more information on using the ModifyCluster +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ModifyClusterRequest method. +// req, resp := client.ModifyClusterRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ModifyCluster +func (c *EMR) 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 Elastic MapReduce. +// +// Modifies the number of steps that can be executed concurrently for the cluster +// specified using ClusterID. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// 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 ModifyCluster for usage and error information. +// +// Returned Error Types: +// * InternalServerError +// Indicates that an error occurred while processing the request and that the +// request was not completed. +// +// * InvalidRequestException +// This exception occurs when there is something wrong with user input. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ModifyCluster +func (c *EMR) ModifyCluster(input *ModifyClusterInput) (*ModifyClusterOutput, error) { + req, out := c.ModifyClusterRequest(input) + return out, req.Send() +} + +// ModifyClusterWithContext is the same as ModifyCluster with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *EMR) ModifyClusterWithContext(ctx aws.Context, input *ModifyClusterInput, opts ...request.Option) (*ModifyClusterOutput, error) { + req, out := c.ModifyClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opModifyInstanceFleet = "ModifyInstanceFleet" // ModifyInstanceFleetRequest generates a "aws/request.Request" representing the @@ -2098,11 +2197,11 @@ func (c *EMR) ModifyInstanceFleetRequest(input *ModifyInstanceFleetInput) (req * // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation ModifyInstanceFleet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/ModifyInstanceFleet @@ -2184,8 +2283,8 @@ func (c *EMR) ModifyInstanceGroupsRequest(input *ModifyInstanceGroupsInput) (req // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation ModifyInstanceGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // Indicates that an error occurred while processing the request and that the // request was not completed. // @@ -2345,11 +2444,11 @@ func (c *EMR) PutBlockPublicAccessConfigurationRequest(input *PutBlockPublicAcce // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation PutBlockPublicAccessConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/PutBlockPublicAccessConfiguration @@ -2508,11 +2607,11 @@ func (c *EMR) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, o // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation RemoveTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerException "InternalServerException" +// Returned Error Types: +// * InternalServerException // This exception occurs when there is an internal failure in the EMR service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception occurs when there is something wrong with user input. // // See also, https://docs.aws.amazon.com/goto/WebAPI/elasticmapreduce-2009-03-31/RemoveTags @@ -2616,8 +2715,8 @@ func (c *EMR) RunJobFlowRequest(input *RunJobFlowInput) (req *request.Request, o // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation RunJobFlow for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // Indicates that an error occurred while processing the request and that the // request was not completed. // @@ -2713,8 +2812,8 @@ func (c *EMR) SetTerminationProtectionRequest(input *SetTerminationProtectionInp // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation SetTerminationProtection for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // Indicates that an error occurred while processing the request and that the // request was not completed. // @@ -2785,14 +2884,15 @@ func (c *EMR) SetVisibleToAllUsersRequest(input *SetVisibleToAllUsersInput) (req // SetVisibleToAllUsers API operation for Amazon Elastic MapReduce. // -// This member will be deprecated. -// -// 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. +// Sets the Cluster$VisibleToAllUsers value, which determines whether the cluster +// is visible to all IAM users of the AWS account associated with the cluster. +// Only the IAM user who created the cluster or the AWS account root user can +// call this action. The default value, true, indicates that all IAM users in +// the AWS account can perform cluster actions if they have the proper IAM policy +// permissions. If set to false, only the IAM user that created the cluster +// can perform actions. This action works on running clusters. You can override +// the default true setting when you create a cluster by using the VisibleToAllUsers +// parameter with RunJobFlow. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2801,8 +2901,8 @@ func (c *EMR) SetVisibleToAllUsersRequest(input *SetVisibleToAllUsersInput) (req // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation SetVisibleToAllUsers for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // Indicates that an error occurred while processing the request and that the // request was not completed. // @@ -2891,8 +2991,8 @@ func (c *EMR) TerminateJobFlowsRequest(input *TerminateJobFlowsInput) (req *requ // See the AWS API reference guide for Amazon Elastic MapReduce's // API operation TerminateJobFlows for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // Indicates that an error occurred while processing the request and that the // request was not completed. // @@ -2978,6 +3078,9 @@ func (s *AddInstanceFleetInput) SetInstanceFleet(v *InstanceFleetConfig) *AddIns type AddInstanceFleetOutput struct { _ struct{} `type:"structure"` + // The Amazon Resource Name of the cluster. + ClusterArn *string `min:"20" type:"string"` + // The unique identifier of the cluster. ClusterId *string `type:"string"` @@ -2995,6 +3098,12 @@ func (s AddInstanceFleetOutput) GoString() string { return s.String() } +// SetClusterArn sets the ClusterArn field's value. +func (s *AddInstanceFleetOutput) SetClusterArn(v string) *AddInstanceFleetOutput { + s.ClusterArn = &v + return s +} + // SetClusterId sets the ClusterId field's value. func (s *AddInstanceFleetOutput) SetClusterId(v string) *AddInstanceFleetOutput { s.ClusterId = &v @@ -3074,6 +3183,9 @@ func (s *AddInstanceGroupsInput) SetJobFlowId(v string) *AddInstanceGroupsInput type AddInstanceGroupsOutput struct { _ struct{} `type:"structure"` + // The Amazon Resource Name of the cluster. + ClusterArn *string `min:"20" type:"string"` + // Instance group IDs of the newly created instance groups. InstanceGroupIds []*string `type:"list"` @@ -3091,6 +3203,12 @@ func (s AddInstanceGroupsOutput) GoString() string { return s.String() } +// SetClusterArn sets the ClusterArn field's value. +func (s *AddInstanceGroupsOutput) SetClusterArn(v string) *AddInstanceGroupsOutput { + s.ClusterArn = &v + return s +} + // SetInstanceGroupIds sets the InstanceGroupIds field's value. func (s *AddInstanceGroupsOutput) SetInstanceGroupIds(v []*string) *AddInstanceGroupsOutput { s.InstanceGroupIds = v @@ -3756,11 +3874,19 @@ type CancelStepsInput struct { // The ClusterID for which specified steps will be canceled. Use RunJobFlow // and ListClusters to get ClusterIDs. - ClusterId *string `type:"string"` + // + // ClusterId is a required field + ClusterId *string `type:"string" required:"true"` + + // The option to choose for cancelling RUNNING steps. By default, the value + // is SEND_INTERRUPT. + StepCancellationOption *string `type:"string" enum:"StepCancellationOption"` // The list of StepIDs to cancel. Use ListSteps to get steps and their states // for the specified cluster. - StepIds []*string `type:"list"` + // + // StepIds is a required field + StepIds []*string `type:"list" required:"true"` } // String returns the string representation @@ -3773,12 +3899,34 @@ func (s CancelStepsInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *CancelStepsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CancelStepsInput"} + if s.ClusterId == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterId")) + } + if s.StepIds == nil { + invalidParams.Add(request.NewErrParamRequired("StepIds")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetClusterId sets the ClusterId field's value. func (s *CancelStepsInput) SetClusterId(v string) *CancelStepsInput { s.ClusterId = &v return s } +// SetStepCancellationOption sets the StepCancellationOption field's value. +func (s *CancelStepsInput) SetStepCancellationOption(v string) *CancelStepsInput { + s.StepCancellationOption = &v + return s +} + // SetStepIds sets the StepIds field's value. func (s *CancelStepsInput) SetStepIds(v []*string) *CancelStepsInput { s.StepIds = v @@ -3825,8 +3973,8 @@ type CloudWatchAlarmDefinition struct { // 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 number of periods, in five-minute increments, during which the alarm + // condition must exist before the alarm triggers automatic scaling activity. // The default value is 1. EvaluationPeriods *int64 `type:"integer"` @@ -3961,6 +4109,9 @@ type Cluster struct { // Specifies whether the cluster should terminate after completing all steps. AutoTerminate *bool `type:"boolean"` + // The Amazon Resource Name of the cluster. + ClusterArn *string `min:"20" type:"string"` + // Applies only to Amazon EMR releases 4.x and later. The list of Configurations // supplied to the EMR cluster. Configurations []*Configuration `type:"list"` @@ -4013,6 +4164,9 @@ type Cluster struct { // the actual billing rate. NormalizedInstanceHours *int64 `type:"integer"` + // The Amazon Resource Name (ARN) of the Outpost where the cluster is launched. + OutpostArn *string `type:"string"` + // The Amazon EMR release label, which determines the version of open-source // application packages installed on the cluster. Release labels are in the // form emr-x.x.x, where x.x.x is an Amazon EMR release version such as emr-5.14.0. @@ -4058,6 +4212,9 @@ type Cluster struct { // The current status details about the cluster. Status *ClusterStatus `type:"structure"` + // Specifies the number of steps that can be executed concurrently. + StepConcurrencyLevel *int64 `type:"integer"` + // A list of tags associated with a cluster. Tags []*Tag `type:"list"` @@ -4066,14 +4223,14 @@ type Cluster struct { // of a cluster error. TerminationProtected *bool `type:"boolean"` - // This member will be deprecated. - // // 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. + // associated with the cluster. The default value, true, indicates that all + // IAM users in the AWS account can perform cluster actions if they have the + // proper IAM policy permissions. If this value is false, only the IAM user + // that created the cluster can perform actions. This value can be changed on + // a running cluster by using the SetVisibleToAllUsers action. You can override + // the default value of true when you create a cluster by using the VisibleToAllUsers + // parameter of the RunJobFlow action. VisibleToAllUsers *bool `type:"boolean"` } @@ -4105,6 +4262,12 @@ func (s *Cluster) SetAutoTerminate(v bool) *Cluster { return s } +// SetClusterArn sets the ClusterArn field's value. +func (s *Cluster) SetClusterArn(v string) *Cluster { + s.ClusterArn = &v + return s +} + // SetConfigurations sets the Configurations field's value. func (s *Cluster) SetConfigurations(v []*Configuration) *Cluster { s.Configurations = v @@ -4171,6 +4334,12 @@ func (s *Cluster) SetNormalizedInstanceHours(v int64) *Cluster { return s } +// SetOutpostArn sets the OutpostArn field's value. +func (s *Cluster) SetOutpostArn(v string) *Cluster { + s.OutpostArn = &v + return s +} + // SetReleaseLabel sets the ReleaseLabel field's value. func (s *Cluster) SetReleaseLabel(v string) *Cluster { s.ReleaseLabel = &v @@ -4219,6 +4388,12 @@ func (s *Cluster) SetStatus(v *ClusterStatus) *Cluster { return s } +// SetStepConcurrencyLevel sets the StepConcurrencyLevel field's value. +func (s *Cluster) SetStepConcurrencyLevel(v int64) *Cluster { + s.StepConcurrencyLevel = &v + return s +} + // SetTags sets the Tags field's value. func (s *Cluster) SetTags(v []*Tag) *Cluster { s.Tags = v @@ -4317,6 +4492,9 @@ func (s *ClusterStatus) SetTimeline(v *ClusterTimeline) *ClusterStatus { type ClusterSummary struct { _ struct{} `type:"structure"` + // The Amazon Resource Name of the cluster. + ClusterArn *string `min:"20" type:"string"` + // The unique identifier for the cluster. Id *string `type:"string"` @@ -4331,6 +4509,9 @@ type ClusterSummary struct { // the actual billing rate. NormalizedInstanceHours *int64 `type:"integer"` + // The Amazon Resource Name (ARN) of the Outpost where the cluster is launched. + OutpostArn *string `type:"string"` + // The details about the current status of the cluster. Status *ClusterStatus `type:"structure"` } @@ -4345,6 +4526,12 @@ func (s ClusterSummary) GoString() string { return s.String() } +// SetClusterArn sets the ClusterArn field's value. +func (s *ClusterSummary) SetClusterArn(v string) *ClusterSummary { + s.ClusterArn = &v + return s +} + // SetId sets the Id field's value. func (s *ClusterSummary) SetId(v string) *ClusterSummary { s.Id = &v @@ -4363,6 +4550,12 @@ func (s *ClusterSummary) SetNormalizedInstanceHours(v int64) *ClusterSummary { return s } +// SetOutpostArn sets the OutpostArn field's value. +func (s *ClusterSummary) SetOutpostArn(v string) *ClusterSummary { + s.OutpostArn = &v + return s +} + // SetStatus sets the Status field's value. func (s *ClusterSummary) SetStatus(v *ClusterStatus) *ClusterSummary { s.Status = v @@ -6166,12 +6359,9 @@ type InstanceGroup struct { // of a CloudWatch metric. See PutAutoScalingPolicy. AutoScalingPolicy *AutoScalingPolicyDescription `type:"structure"` - // The maximum Spot price your are willing to pay for EC2 instances. - // - // An optional, nullable field that applies if the MarketType for the instance - // group is specified as SPOT. Specify the maximum spot price in USD. If the - // value is NULL and SPOT is specified, the maximum Spot price is set equal - // to the On-Demand price. + // 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"` // @@ -6353,12 +6543,9 @@ type InstanceGroupConfig struct { // of a CloudWatch metric. See PutAutoScalingPolicy. AutoScalingPolicy *AutoScalingPolicy `type:"structure"` - // The maximum Spot price your are willing to pay for EC2 instances. - // - // An optional, nullable field that applies if the MarketType for the instance - // group is specified as SPOT. Specify the maximum spot price in USD. If the - // value is NULL and SPOT is specified, the maximum Spot price is set equal - // to the On-Demand price. + // 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"` // @@ -6495,11 +6682,9 @@ func (s *InstanceGroupConfig) SetName(v string) *InstanceGroupConfig { type InstanceGroupDetail struct { _ struct{} `type:"structure"` - // The maximum Spot price your are willing to pay for EC2 instances. - // - // An optional, nullable field that applies if the MarketType for the instance - // group is specified as SPOT. Specified in USD. If the value is NULL and SPOT - // is specified, the maximum Spot price is set equal to the On-Demand price. + // 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 date/time the instance group was created. @@ -7204,6 +7389,180 @@ func (s *InstanceTypeSpecification) SetWeightedCapacity(v int64) *InstanceTypeSp return s } +// Indicates that an error occurred while processing the request and that the +// request was not completed. +type InternalServerError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalServerError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerError) GoString() string { + return s.String() +} + +func newErrorInternalServerError(v protocol.ResponseMetadata) error { + return &InternalServerError{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerError) Code() string { + return "InternalServerError" +} + +// Message returns the exception's message. +func (s InternalServerError) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerError) OrigErr() error { + return nil +} + +func (s InternalServerError) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerError) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerError) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception occurs when there is an internal failure in the EMR service. +type InternalServerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message associated with the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalServerException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerException) GoString() string { + return s.String() +} + +func newErrorInternalServerException(v protocol.ResponseMetadata) error { + return &InternalServerException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerException) Code() string { + return "InternalServerException" +} + +// Message returns the exception's message. +func (s InternalServerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerException) OrigErr() error { + return nil +} + +func (s InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception occurs when there is something wrong with user input. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error code associated with the exception. + ErrorCode *string `min:"1" type:"string"` + + // The message associated with the exception. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // A description of a cluster (job flow). type JobFlowDetail struct { _ struct{} `type:"structure"` @@ -7274,14 +7633,14 @@ type JobFlowDetail struct { // is empty. SupportedProducts []*string `type:"list"` - // This member will be deprecated. - // - // 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. + // Indicates whether the cluster is visible to all IAM users of the AWS account + // associated with the cluster. The default value, true, indicates that all + // IAM users in the AWS account can perform cluster actions if they have the + // proper IAM policy permissions. If this value is false, only the IAM user + // that created the cluster can perform actions. This value can be changed on + // a running cluster by using the SetVisibleToAllUsers action. You can override + // the default value of true when you create a cluster by using the VisibleToAllUsers + // parameter of the RunJobFlow action. VisibleToAllUsers *bool `type:"boolean"` } @@ -8484,7 +8843,9 @@ type ListStepsInput struct { // 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. + // The filter to limit the step list based on the identifier of the steps. You + // can specify a maximum of ten Step IDs. The character constraint applies to + // the overall length of the array. StepIds []*string `type:"list"` // The filter to limit the step list based on certain states. @@ -8609,6 +8970,77 @@ func (s *MetricDimension) SetValue(v string) *MetricDimension { return s } +type ModifyClusterInput struct { + _ struct{} `type:"structure"` + + // The unique identifier of the cluster. + // + // ClusterId is a required field + ClusterId *string `type:"string" required:"true"` + + // The number of steps that can be executed concurrently. You can specify a + // maximum of 256 steps. + StepConcurrencyLevel *int64 `type:"integer"` +} + +// 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.ClusterId == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterId sets the ClusterId field's value. +func (s *ModifyClusterInput) SetClusterId(v string) *ModifyClusterInput { + s.ClusterId = &v + return s +} + +// SetStepConcurrencyLevel sets the StepConcurrencyLevel field's value. +func (s *ModifyClusterInput) SetStepConcurrencyLevel(v int64) *ModifyClusterInput { + s.StepConcurrencyLevel = &v + return s +} + +type ModifyClusterOutput struct { + _ struct{} `type:"structure"` + + // The number of steps that can be executed concurrently. + StepConcurrencyLevel *int64 `type:"integer"` +} + +// 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() +} + +// SetStepConcurrencyLevel sets the StepConcurrencyLevel field's value. +func (s *ModifyClusterOutput) SetStepConcurrencyLevel(v int64) *ModifyClusterOutput { + s.StepConcurrencyLevel = &v + return s +} + type ModifyInstanceFleetInput struct { _ struct{} `type:"structure"` @@ -8917,6 +9349,9 @@ type PutAutoScalingPolicyOutput struct { // The automatic scaling policy definition. AutoScalingPolicy *AutoScalingPolicyDescription `type:"structure"` + // The Amazon Resource Name of the cluster. + ClusterArn *string `min:"20" type:"string"` + // 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"` @@ -8941,6 +9376,12 @@ func (s *PutAutoScalingPolicyOutput) SetAutoScalingPolicy(v *AutoScalingPolicyDe return s } +// SetClusterArn sets the ClusterArn field's value. +func (s *PutAutoScalingPolicyOutput) SetClusterArn(v string) *PutAutoScalingPolicyOutput { + s.ClusterArn = &v + return s +} + // SetClusterId sets the ClusterId field's value. func (s *PutAutoScalingPolicyOutput) SetClusterId(v string) *PutAutoScalingPolicyOutput { s.ClusterId = &v @@ -9294,6 +9735,10 @@ type RunJobFlowInput struct { // resources on your behalf. ServiceRole *string `type:"string"` + // Specifies the number of steps that can be executed concurrently. The default + // value is 1. The maximum value is 256. + StepConcurrencyLevel *int64 `type:"integer"` + // A list of steps to run. Steps []*StepConfig `type:"list"` @@ -9313,13 +9758,10 @@ type RunJobFlowInput struct { // A list of tags to associate with a cluster and propagate to Amazon EC2 instances. Tags []*Tag `type:"list"` - // This member will be deprecated. - // - // 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. + // A value of true indicates that all IAM users in the AWS account can perform + // cluster actions if they have the proper IAM policy permissions. This is the + // default. A value of false indicates that only the IAM user who created the + // cluster can perform actions. VisibleToAllUsers *bool `type:"boolean"` } @@ -9493,6 +9935,12 @@ func (s *RunJobFlowInput) SetServiceRole(v string) *RunJobFlowInput { return s } +// SetStepConcurrencyLevel sets the StepConcurrencyLevel field's value. +func (s *RunJobFlowInput) SetStepConcurrencyLevel(v int64) *RunJobFlowInput { + s.StepConcurrencyLevel = &v + return s +} + // SetSteps sets the Steps field's value. func (s *RunJobFlowInput) SetSteps(v []*StepConfig) *RunJobFlowInput { s.Steps = v @@ -9521,6 +9969,9 @@ func (s *RunJobFlowInput) SetVisibleToAllUsers(v bool) *RunJobFlowInput { type RunJobFlowOutput struct { _ struct{} `type:"structure"` + // The Amazon Resource Name of the cluster. + ClusterArn *string `min:"20" type:"string"` + // An unique identifier for the job flow. JobFlowId *string `type:"string"` } @@ -9535,6 +9986,12 @@ func (s RunJobFlowOutput) GoString() string { return s.String() } +// SetClusterArn sets the ClusterArn field's value. +func (s *RunJobFlowOutput) SetClusterArn(v string) *RunJobFlowOutput { + s.ClusterArn = &v + return s +} + // SetJobFlowId sets the JobFlowId field's value. func (s *RunJobFlowOutput) SetJobFlowId(v string) *RunJobFlowOutput { s.JobFlowId = &v @@ -9944,24 +10401,19 @@ func (s SetTerminationProtectionOutput) GoString() string { return s.String() } -// This member will be deprecated. -// // The input to the SetVisibleToAllUsers action. type SetVisibleToAllUsersInput struct { _ struct{} `type:"structure"` - // Identifiers of the job flows to receive the new visibility setting. + // The unique identifier of the job flow (cluster). // // JobFlowIds is a required field JobFlowIds []*string `type:"list" required:"true"` - // This member will be deprecated. - // - // 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. + // A value of true indicates that all IAM users in the AWS account can perform + // cluster actions if they have the proper IAM policy permissions. This is the + // default. A value of false indicates that only the IAM user who created the + // cluster can perform actions. // // VisibleToAllUsers is a required field VisibleToAllUsers *bool `type:"boolean" required:"true"` @@ -11189,6 +11641,14 @@ const ( StatisticMaximum = "MAXIMUM" ) +const ( + // StepCancellationOptionSendInterrupt is a StepCancellationOption enum value + StepCancellationOptionSendInterrupt = "SEND_INTERRUPT" + + // StepCancellationOptionTerminateProcess is a StepCancellationOption enum value + StepCancellationOptionTerminateProcess = "TERMINATE_PROCESS" +) + const ( // StepExecutionStatePending is a StepExecutionState enum value StepExecutionStatePending = "PENDING" 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 index b4bf33708ec..e831146649c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/emr/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/emr/errors.go @@ -2,6 +2,10 @@ package emr +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInternalServerError for service response error code @@ -23,3 +27,9 @@ const ( // This exception occurs when there is something wrong with user input. ErrCodeInvalidRequestException = "InvalidRequestException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InternalServerError": newErrorInternalServerError, + "InternalServerException": newErrorInternalServerException, + "InvalidRequestException": newErrorInvalidRequestException, +} 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 index 92735a793d4..27a55b2528a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/emr/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/emr/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "elasticmapreduce" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "EMR" // ServiceID is a unique identifer of a specific service. + ServiceID = "EMR" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the EMR client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a EMR client from just a session. // svc := emr.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *EMR { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *EMR { svc := &EMR{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2009-03-31", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 8a104bcb000..b07a4fc7ed5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/firehose/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/firehose/api.go @@ -63,9 +63,14 @@ func (c *Firehose) CreateDeliveryStreamRequest(input *CreateDeliveryStreamInput) // // 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. +// its status is ACTIVE and it now accepts data. If the delivery stream creation +// fails, the status transitions to CREATING_FAILED. 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. +// +// If the status of a delivery stream is CREATING_FAILED, this status doesn't +// change, and you can't invoke CreateDeliveryStream again on it. However, you +// can invoke the DeleteDeliveryStream operation to delete it. // // A Kinesis Data Firehose delivery stream can be configured to receive records // directly from providers using PutRecord or PutRecordBatch, or it can be configured @@ -74,6 +79,11 @@ func (c *Firehose) CreateDeliveryStreamRequest(input *CreateDeliveryStreamInput) // and provide the Kinesis stream Amazon Resource Name (ARN) and role ARN in // the KinesisStreamSourceConfiguration parameter. // +// To create a delivery stream with server-side encryption (SSE) enabled, include +// DeliveryStreamEncryptionConfigurationInput in your request. This is optional. +// You can also invoke StartDeliveryStreamEncryption to turn on SSE for an existing +// delivery stream that doesn't have SSE enabled. +// // A delivery stream is configured with a single destination: Amazon S3, Amazon // ES, Amazon Redshift, or Splunk. You must specify only one of the following // destination configuration parameters: ExtendedS3DestinationConfiguration, @@ -109,7 +119,7 @@ func (c *Firehose) CreateDeliveryStreamRequest(input *CreateDeliveryStreamInput) // the destination. The role should allow the Kinesis Data Firehose principal // to assume the role, and the role should have permissions that allow the service // to deliver the data. For more information, see Grant Kinesis Data Firehose -// Access to an Amazon S3 Destination (http://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3) +// Access to an Amazon S3 Destination (https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3) // in the Amazon Kinesis Data Firehose Developer Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -119,16 +129,22 @@ func (c *Firehose) CreateDeliveryStreamRequest(input *CreateDeliveryStreamInput) // See the AWS API reference guide for Amazon Kinesis Firehose's // API operation CreateDeliveryStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // The specified input parameter has a value that is not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have already reached the limit for a requested resource. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is already in use and not available for this operation. // +// * InvalidKMSResourceException +// Kinesis Data Firehose throws this exception when an attempt to put records +// or to start or stop delivery stream encryption fails. This happens when the +// KMS service throws one of the following exception types: AccessDeniedException, +// InvalidStateException, DisabledException, or NotFoundException. +// // See also, 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) @@ -198,16 +214,16 @@ func (c *Firehose) DeleteDeliveryStreamRequest(input *DeleteDeliveryStreamInput) // // 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. You +// can delete a delivery stream only if it is in one of the following states: +// ACTIVE, DELETING, CREATING_FAILED, or DELETING_FAILED. You can't delete a +// delivery stream that is 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 might continue to -// accept the records, but it 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. +// While the delivery stream is in the DELETING state, the service might continue +// to accept records, but it doesn't make any guarantees with respect to delivering +// the data. Therefore, as a best practice, first stop any applications that +// are sending records before you delete 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 @@ -216,11 +232,11 @@ func (c *Firehose) DeleteDeliveryStreamRequest(input *DeleteDeliveryStreamInput) // See the AWS API reference guide for Amazon Kinesis Firehose's // API operation DeleteDeliveryStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The resource is already in use and not available for this operation. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/DeleteDeliveryStream @@ -289,10 +305,16 @@ func (c *Firehose) DescribeDeliveryStreamRequest(input *DescribeDeliveryStreamIn // 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 -// whether the delivery stream is ACTIVE and therefore ready for data to be -// sent to it. +// Describes the specified delivery stream and its status. For example, after +// your delivery stream is created, call DescribeDeliveryStream to see whether +// the delivery stream is ACTIVE and therefore ready for data to be sent to +// it. +// +// If the status of a delivery stream is CREATING_FAILED, this status doesn't +// change, and you can't invoke CreateDeliveryStream again on it. However, you +// can invoke the DeleteDeliveryStream operation to delete it. If the status +// is DELETING_FAILED, you can force deletion by invoking DeleteDeliveryStream +// again but with DeleteDeliveryStreamInput$AllowForceDelete 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 @@ -301,8 +323,8 @@ func (c *Firehose) DescribeDeliveryStreamRequest(input *DescribeDeliveryStreamIn // See the AWS API reference guide for Amazon Kinesis Firehose's // API operation DescribeDeliveryStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/DescribeDeliveryStream @@ -463,14 +485,14 @@ func (c *Firehose) ListTagsForDeliveryStreamRequest(input *ListTagsForDeliverySt // See the AWS API reference guide for Amazon Kinesis Firehose's // API operation ListTagsForDeliveryStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource could not be found. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter has a value that is not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have already reached the limit for a requested resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/ListTagsForDeliveryStream @@ -547,7 +569,7 @@ func (c *Firehose) PutRecordRequest(input *PutRecordInput) (req *request.Request // second, 5,000 records per second, or 5 MB per second. 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 Data Firehose Limits (http://docs.aws.amazon.com/firehose/latest/dev/limits.html). +// an increase, see Amazon Kinesis Data Firehose Limits (https://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 @@ -584,18 +606,24 @@ func (c *Firehose) PutRecordRequest(input *PutRecordInput) (req *request.Request // See the AWS API reference guide for Amazon Kinesis Firehose's // API operation PutRecord for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource could not be found. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter has a value that is not valid. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * InvalidKMSResourceException +// Kinesis Data Firehose throws this exception when an attempt to put records +// or to start or stop delivery stream encryption fails. This happens when the +// KMS service throws one of the following exception types: AccessDeniedException, +// InvalidStateException, DisabledException, or NotFoundException. +// +// * 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 Data Firehose Limits (http://docs.aws.amazon.com/firehose/latest/dev/limits.html). +// see Amazon Kinesis Data Firehose Limits (https://docs.aws.amazon.com/firehose/latest/dev/limits.html). // // See also, https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/PutRecord func (c *Firehose) PutRecord(input *PutRecordInput) (*PutRecordOutput, error) { @@ -672,7 +700,7 @@ func (c *Firehose) PutRecordBatchRequest(input *PutRecordBatchInput) (req *reque // second, 5,000 records per second, or 5 MB per second. 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 -// Data Firehose Limits (http://docs.aws.amazon.com/firehose/latest/dev/limits.html). +// Data Firehose Limits (https://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 @@ -734,18 +762,24 @@ func (c *Firehose) PutRecordBatchRequest(input *PutRecordBatchInput) (req *reque // See the AWS API reference guide for Amazon Kinesis Firehose's // API operation PutRecordBatch for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource could not be found. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter has a value that is not valid. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * InvalidKMSResourceException +// Kinesis Data Firehose throws this exception when an attempt to put records +// or to start or stop delivery stream encryption fails. This happens when the +// KMS service throws one of the following exception types: AccessDeniedException, +// InvalidStateException, DisabledException, or NotFoundException. +// +// * 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 Data Firehose Limits (http://docs.aws.amazon.com/firehose/latest/dev/limits.html). +// see Amazon Kinesis Data Firehose Limits (https://docs.aws.amazon.com/firehose/latest/dev/limits.html). // // See also, https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/PutRecordBatch func (c *Firehose) PutRecordBatch(input *PutRecordBatchInput) (*PutRecordBatchOutput, error) { @@ -817,15 +851,32 @@ func (c *Firehose) StartDeliveryStreamEncryptionRequest(input *StartDeliveryStre // Enables server-side encryption (SSE) for the delivery stream. // // This operation is asynchronous. It returns immediately. When you invoke it, -// Kinesis Data Firehose first sets the status of the stream to ENABLING, and -// then to ENABLED. You can continue to read and write data to your stream while -// its status is ENABLING, but the data is not encrypted. It can take up to -// 5 seconds after the encryption status changes to ENABLED before all records -// written to the delivery stream are encrypted. To find out whether a record -// or a batch of records was encrypted, check the response elements PutRecordOutput$Encrypted -// and PutRecordBatchOutput$Encrypted, respectively. -// -// To check the encryption state of a delivery stream, use DescribeDeliveryStream. +// Kinesis Data Firehose first sets the encryption status of the stream to ENABLING, +// and then to ENABLED. The encryption status of a delivery stream is the Status +// property in DeliveryStreamEncryptionConfiguration. If the operation fails, +// the encryption status changes to ENABLING_FAILED. You can continue to read +// and write data to your delivery stream while the encryption status is ENABLING, +// but the data is not encrypted. It can take up to 5 seconds after the encryption +// status changes to ENABLED before all records written to the delivery stream +// are encrypted. To find out whether a record or a batch of records was encrypted, +// check the response elements PutRecordOutput$Encrypted and PutRecordBatchOutput$Encrypted, +// respectively. +// +// To check the encryption status of a delivery stream, use DescribeDeliveryStream. +// +// Even if encryption is currently enabled for a delivery stream, you can still +// invoke this operation on it to change the ARN of the CMK or both its type +// and ARN. In this case, Kinesis Data Firehose schedules the grant it had on +// the old CMK for retirement and creates a grant that enables it to use the +// new CMK to encrypt and decrypt data and to manage the grant. +// +// If a delivery stream already has encryption enabled and then you invoke this +// operation to change the ARN of the CMK or both its type and ARN and you get +// ENABLING_FAILED, this only means that the attempt to change the CMK failed. +// In this case, encryption remains enabled with the old CMK. +// +// If the encryption status of your delivery stream is ENABLING_FAILED, you +// can invoke this operation again. // // You can only enable SSE for a delivery stream that uses DirectPut as its // source. @@ -843,19 +894,25 @@ func (c *Firehose) StartDeliveryStreamEncryptionRequest(input *StartDeliveryStre // See the AWS API reference guide for Amazon Kinesis Firehose's // API operation StartDeliveryStreamEncryption for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource could not be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is already in use and not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter has a value that is not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have already reached the limit for a requested resource. // +// * InvalidKMSResourceException +// Kinesis Data Firehose throws this exception when an attempt to put records +// or to start or stop delivery stream encryption fails. This happens when the +// KMS service throws one of the following exception types: AccessDeniedException, +// InvalidStateException, DisabledException, or NotFoundException. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/StartDeliveryStreamEncryption func (c *Firehose) StartDeliveryStreamEncryption(input *StartDeliveryStreamEncryptionInput) (*StartDeliveryStreamEncryptionOutput, error) { req, out := c.StartDeliveryStreamEncryptionRequest(input) @@ -926,8 +983,8 @@ func (c *Firehose) StopDeliveryStreamEncryptionRequest(input *StopDeliveryStream // Disables server-side encryption (SSE) for the delivery stream. // // This operation is asynchronous. It returns immediately. When you invoke it, -// Kinesis Data Firehose first sets the status of the stream to DISABLING, and -// then to DISABLED. You can continue to read and write data to your stream +// Kinesis Data Firehose first sets the encryption status of the stream to DISABLING, +// and then to DISABLED. You can continue to read and write data to your stream // while its status is DISABLING. It can take up to 5 seconds after the encryption // status changes to DISABLED before all records written to the delivery stream // are no longer subject to encryption. To find out whether a record or a batch @@ -936,6 +993,11 @@ func (c *Firehose) StopDeliveryStreamEncryptionRequest(input *StopDeliveryStream // // To check the encryption state of a delivery stream, use DescribeDeliveryStream. // +// If SSE is enabled using a customer managed CMK and then you invoke StopDeliveryStreamEncryption, +// Kinesis Data Firehose schedules the related KMS grant for retirement and +// then retires it after it ensures that it is finished delivering records to +// the destination. +// // The StartDeliveryStreamEncryption and StopDeliveryStreamEncryption operations // have a combined limit of 25 calls per delivery stream per 24 hours. For example, // you reach the limit if you call StartDeliveryStreamEncryption 13 times and @@ -949,17 +1011,17 @@ func (c *Firehose) StopDeliveryStreamEncryptionRequest(input *StopDeliveryStream // See the AWS API reference guide for Amazon Kinesis Firehose's // API operation StopDeliveryStreamEncryption for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource could not be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is already in use and not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter has a value that is not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have already reached the limit for a requested resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/StopDeliveryStreamEncryption @@ -1049,17 +1111,17 @@ func (c *Firehose) TagDeliveryStreamRequest(input *TagDeliveryStreamInput) (req // See the AWS API reference guide for Amazon Kinesis Firehose's // API operation TagDeliveryStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource could not be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is already in use and not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter has a value that is not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have already reached the limit for a requested resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/TagDeliveryStream @@ -1143,17 +1205,17 @@ func (c *Firehose) UntagDeliveryStreamRequest(input *UntagDeliveryStreamInput) ( // See the AWS API reference guide for Amazon Kinesis Firehose's // API operation UntagDeliveryStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource could not be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is already in use and not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter has a value that is not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have already reached the limit for a requested resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/firehose-2015-08-04/UntagDeliveryStream @@ -1261,17 +1323,17 @@ func (c *Firehose) UpdateDestinationRequest(input *UpdateDestinationInput) (req // See the AWS API reference guide for Amazon Kinesis Firehose's // API operation UpdateDestination for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // The specified input parameter has a value that is not valid. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is already in use and not available for this operation. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource could not be found. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Another modification has already happened. Fetch VersionId again and use // it to update the destination. // @@ -1299,20 +1361,27 @@ func (c *Firehose) UpdateDestinationWithContext(ctx aws.Context, input *UpdateDe // Describes hints for the buffering to perform before delivering data to the // destination. These options are treated as hints, and therefore Kinesis Data -// Firehose might choose to use different values when it is optimal. +// Firehose might choose to use different values when it is optimal. The SizeInMBs +// and IntervalInSeconds parameters are optional. However, if specify a value +// for one of them, you must also provide a value for the other. 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. + // delivering it to the destination. The default value is 300. This parameter + // is optional but if you specify a value for it, you must also specify a value + // for SizeInMBs, and vice versa. 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. + // Buffer incoming data to the specified size, in MiBs, before delivering it + // to the destination. The default value is 5. This parameter is optional but + // if you specify a value for it, you must also specify a value for IntervalInSeconds, + // and vice versa. // // 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. + // if you typically ingest data at 1 MiB/sec, the value should be 10 MiB or + // higher. SizeInMBs *int64 `min:"1" type:"integer"` } @@ -1398,13 +1467,71 @@ func (s *CloudWatchLoggingOptions) SetLogStreamName(v string) *CloudWatchLogging return s } +// Another modification has already happened. Fetch VersionId again and use +// it to update the destination. +type ConcurrentModificationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message that provides information about the error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentModificationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentModificationException) GoString() string { + return s.String() +} + +func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { + return &ConcurrentModificationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentModificationException) Code() string { + return "ConcurrentModificationException" +} + +// Message returns the exception's message. +func (s ConcurrentModificationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentModificationException) OrigErr() error { + return nil +} + +func (s ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentModificationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentModificationException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes a COPY command for Amazon Redshift. 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 + // command (https://docs.aws.amazon.com/redshift/latest/dg/r_COPY.html). Some // possible examples that would apply to Kinesis Data Firehose are as follows: // // delimiter '\t' lzop; - fields are delimited with "\t" (TAB character) and @@ -1421,7 +1548,7 @@ type CopyCommand struct { // 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). + // For more examples, see Amazon Redshift COPY command examples (https://docs.aws.amazon.com/redshift/latest/dg/r_COPY_command_examples.html). CopyOptions *string `type:"string"` // A comma-separated list of column names. @@ -1480,6 +1607,10 @@ func (s *CopyCommand) SetDataTableName(v string) *CopyCommand { type CreateDeliveryStreamInput struct { _ struct{} `type:"structure"` + // Used to specify the type and Amazon Resource Name (ARN) of the KMS key needed + // for Server-Side Encryption (SSE). + DeliveryStreamEncryptionConfigurationInput *DeliveryStreamEncryptionConfigurationInput `type:"structure"` + // The name of the delivery stream. This name must be unique per AWS account // in the same AWS Region. If the delivery streams are in different accounts // or different Regions, you can have multiple delivery streams with the same @@ -1551,6 +1682,11 @@ func (s *CreateDeliveryStreamInput) Validate() error { if s.Tags != nil && len(s.Tags) < 1 { invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) } + if s.DeliveryStreamEncryptionConfigurationInput != nil { + if err := s.DeliveryStreamEncryptionConfigurationInput.Validate(); err != nil { + invalidParams.AddNested("DeliveryStreamEncryptionConfigurationInput", err.(request.ErrInvalidParams)) + } + } if s.ElasticsearchDestinationConfiguration != nil { if err := s.ElasticsearchDestinationConfiguration.Validate(); err != nil { invalidParams.AddNested("ElasticsearchDestinationConfiguration", err.(request.ErrInvalidParams)) @@ -1598,6 +1734,12 @@ func (s *CreateDeliveryStreamInput) Validate() error { return nil } +// SetDeliveryStreamEncryptionConfigurationInput sets the DeliveryStreamEncryptionConfigurationInput field's value. +func (s *CreateDeliveryStreamInput) SetDeliveryStreamEncryptionConfigurationInput(v *DeliveryStreamEncryptionConfigurationInput) *CreateDeliveryStreamInput { + s.DeliveryStreamEncryptionConfigurationInput = v + return s +} + // SetDeliveryStreamName sets the DeliveryStreamName field's value. func (s *CreateDeliveryStreamInput) SetDeliveryStreamName(v string) *CreateDeliveryStreamInput { s.DeliveryStreamName = &v @@ -1752,6 +1894,18 @@ func (s *DataFormatConversionConfiguration) SetSchemaConfiguration(v *SchemaConf type DeleteDeliveryStreamInput struct { _ struct{} `type:"structure"` + // Set this to true if you want to delete the delivery stream even if Kinesis + // Data Firehose is unable to retire the grant for the CMK. Kinesis Data Firehose + // might be unable to retire the grant due to a customer error, such as when + // the CMK or the grant are in an invalid state. If you force deletion, you + // can then use the RevokeGrant (https://docs.aws.amazon.com/kms/latest/APIReference/API_RevokeGrant.html) + // operation to revoke the grant you gave to Kinesis Data Firehose. If a failure + // to retire the grant happens due to an AWS KMS issue, Kinesis Data Firehose + // keeps retrying the delete operation. + // + // The default value is false. + AllowForceDelete *bool `type:"boolean"` + // The name of the delivery stream. // // DeliveryStreamName is a required field @@ -1784,6 +1938,12 @@ func (s *DeleteDeliveryStreamInput) Validate() error { return nil } +// SetAllowForceDelete sets the AllowForceDelete field's value. +func (s *DeleteDeliveryStreamInput) SetAllowForceDelete(v bool) *DeleteDeliveryStreamInput { + s.AllowForceDelete = &v + return s +} + // SetDeliveryStreamName sets the DeliveryStreamName field's value. func (s *DeleteDeliveryStreamInput) SetDeliveryStreamName(v string) *DeleteDeliveryStreamInput { s.DeliveryStreamName = &v @@ -1825,7 +1985,10 @@ type DeliveryStreamDescription struct { // DeliveryStreamName is a required field DeliveryStreamName *string `min:"1" type:"string" required:"true"` - // The status of the delivery stream. + // The status of the delivery stream. If the status of a delivery stream is + // CREATING_FAILED, this status doesn't change, and you can't invoke CreateDeliveryStream + // again on it. However, you can invoke the DeleteDeliveryStream operation to + // delete it. // // DeliveryStreamStatus is a required field DeliveryStreamStatus *string `type:"string" required:"true" enum:"DeliveryStreamStatus"` @@ -1845,6 +2008,11 @@ type DeliveryStreamDescription struct { // Destinations is a required field Destinations []*DestinationDescription `type:"list" required:"true"` + // Provides details in case one of the following operations fails due to an + // error related to KMS: CreateDeliveryStream, DeleteDeliveryStream, StartDeliveryStreamEncryption, + // StopDeliveryStreamEncryption. + FailureDescription *FailureDescription `type:"structure"` + // Indicates whether there are more destinations available to list. // // HasMoreDestinations is a required field @@ -1918,6 +2086,12 @@ func (s *DeliveryStreamDescription) SetDestinations(v []*DestinationDescription) return s } +// SetFailureDescription sets the FailureDescription field's value. +func (s *DeliveryStreamDescription) SetFailureDescription(v *FailureDescription) *DeliveryStreamDescription { + s.FailureDescription = v + return s +} + // SetHasMoreDestinations sets the HasMoreDestinations field's value. func (s *DeliveryStreamDescription) SetHasMoreDestinations(v bool) *DeliveryStreamDescription { s.HasMoreDestinations = &v @@ -1942,12 +2116,32 @@ func (s *DeliveryStreamDescription) SetVersionId(v string) *DeliveryStreamDescri return s } -// Indicates the server-side encryption (SSE) status for the delivery stream. +// Contains information about the server-side encryption (SSE) status for the +// delivery stream, the type customer master key (CMK) in use, if any, and the +// ARN of the CMK. You can get DeliveryStreamEncryptionConfiguration by invoking +// the DescribeDeliveryStream operation. type DeliveryStreamEncryptionConfiguration struct { _ struct{} `type:"structure"` + // Provides details in case one of the following operations fails due to an + // error related to KMS: CreateDeliveryStream, DeleteDeliveryStream, StartDeliveryStreamEncryption, + // StopDeliveryStreamEncryption. + FailureDescription *FailureDescription `type:"structure"` + + // If KeyType is CUSTOMER_MANAGED_CMK, this field contains the ARN of the customer + // managed CMK. If KeyType is AWS_OWNED_CMK, DeliveryStreamEncryptionConfiguration + // doesn't contain a value for KeyARN. + KeyARN *string `min:"1" type:"string"` + + // Indicates the type of customer master key (CMK) that is used for encryption. + // The default setting is AWS_OWNED_CMK. For more information about CMKs, see + // Customer Master Keys (CMKs) (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys). + KeyType *string `type:"string" enum:"KeyType"` + + // This is the server-side encryption (SSE) status for the delivery stream. // For a full description of the different values of this status, see StartDeliveryStreamEncryption - // and StopDeliveryStreamEncryption. + // and StopDeliveryStreamEncryption. If this status is ENABLING_FAILED or DISABLING_FAILED, + // it is the status of the most recent attempt to enable or disable SSE, respectively. Status *string `type:"string" enum:"DeliveryStreamEncryptionStatus"` } @@ -1961,12 +2155,96 @@ func (s DeliveryStreamEncryptionConfiguration) GoString() string { return s.String() } +// SetFailureDescription sets the FailureDescription field's value. +func (s *DeliveryStreamEncryptionConfiguration) SetFailureDescription(v *FailureDescription) *DeliveryStreamEncryptionConfiguration { + s.FailureDescription = v + return s +} + +// SetKeyARN sets the KeyARN field's value. +func (s *DeliveryStreamEncryptionConfiguration) SetKeyARN(v string) *DeliveryStreamEncryptionConfiguration { + s.KeyARN = &v + return s +} + +// SetKeyType sets the KeyType field's value. +func (s *DeliveryStreamEncryptionConfiguration) SetKeyType(v string) *DeliveryStreamEncryptionConfiguration { + s.KeyType = &v + return s +} + // SetStatus sets the Status field's value. func (s *DeliveryStreamEncryptionConfiguration) SetStatus(v string) *DeliveryStreamEncryptionConfiguration { s.Status = &v return s } +// Used to specify the type and Amazon Resource Name (ARN) of the CMK needed +// for Server-Side Encryption (SSE). +type DeliveryStreamEncryptionConfigurationInput struct { + _ struct{} `type:"structure"` + + // If you set KeyType to CUSTOMER_MANAGED_CMK, you must specify the Amazon Resource + // Name (ARN) of the CMK. If you set KeyType to AWS_OWNED_CMK, Kinesis Data + // Firehose uses a service-account CMK. + KeyARN *string `min:"1" type:"string"` + + // Indicates the type of customer master key (CMK) to use for encryption. The + // default setting is AWS_OWNED_CMK. For more information about CMKs, see Customer + // Master Keys (CMKs) (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys). + // When you invoke CreateDeliveryStream or StartDeliveryStreamEncryption with + // KeyType set to CUSTOMER_MANAGED_CMK, Kinesis Data Firehose invokes the Amazon + // KMS operation CreateGrant (https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateGrant.html) + // to create a grant that allows the Kinesis Data Firehose service to use the + // customer managed CMK to perform encryption and decryption. Kinesis Data Firehose + // manages that grant. + // + // When you invoke StartDeliveryStreamEncryption to change the CMK for a delivery + // stream that is already encrypted with a customer managed CMK, Kinesis Data + // Firehose schedules the grant it had on the old CMK for retirement. + // + // KeyType is a required field + KeyType *string `type:"string" required:"true" enum:"KeyType"` +} + +// String returns the string representation +func (s DeliveryStreamEncryptionConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeliveryStreamEncryptionConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeliveryStreamEncryptionConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeliveryStreamEncryptionConfigurationInput"} + if s.KeyARN != nil && len(*s.KeyARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("KeyARN", 1)) + } + if s.KeyType == nil { + invalidParams.Add(request.NewErrParamRequired("KeyType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKeyARN sets the KeyARN field's value. +func (s *DeliveryStreamEncryptionConfigurationInput) SetKeyARN(v string) *DeliveryStreamEncryptionConfigurationInput { + s.KeyARN = &v + return s +} + +// SetKeyType sets the KeyType field's value. +func (s *DeliveryStreamEncryptionConfigurationInput) SetKeyType(v string) *DeliveryStreamEncryptionConfigurationInput { + s.KeyType = &v + return s +} + type DescribeDeliveryStreamInput struct { _ struct{} `type:"structure"` @@ -2242,13 +2520,17 @@ type ElasticsearchDestinationConfiguration struct { // The Amazon CloudWatch logging options for your delivery stream. CloudWatchLoggingOptions *CloudWatchLoggingOptions `type:"structure"` + // The endpoint to use when communicating with the cluster. Specify either this + // ClusterEndpoint or the DomainARN field. + ClusterEndpoint *string `min:"1" type:"string"` + // 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. For more information, see Amazon // Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). // - // DomainARN is a required field - DomainARN *string `min:"1" type:"string" required:"true"` + // Specify either ClusterEndpoint or DomainARN. + DomainARN *string `min:"1" type:"string"` // The Elasticsearch index name. // @@ -2257,7 +2539,7 @@ type ElasticsearchDestinationConfiguration struct { // The Elasticsearch index rotation period. Index rotation appends a timestamp // to the IndexName to facilitate the expiration of old data. For more information, - // see Index Rotation for the Amazon ES Destination (http://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-index-rotation). + // see Index Rotation for the Amazon ES Destination (https://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-index-rotation). // The default value is OneDay. IndexRotationPeriod *string `type:"string" enum:"ElasticsearchIndexRotationPeriod"` @@ -2271,7 +2553,7 @@ type ElasticsearchDestinationConfiguration struct { // The Amazon Resource Name (ARN) of the IAM role to be assumed by Kinesis Data // Firehose for calling the Amazon ES Configuration API and for indexing documents. // For more information, see Grant Kinesis Data Firehose Access to an Amazon - // S3 Destination (http://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3) + // S3 Destination (https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3) // and Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). // // RoleARN is a required field @@ -2283,7 +2565,7 @@ type ElasticsearchDestinationConfiguration struct { // appended to the key prefix. When set to AllDocuments, Kinesis Data 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 the Amazon ES Destination (http://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-s3-backup). + // see Amazon S3 Backup for the Amazon ES Destination (https://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-s3-backup). // Default value is FailedDocumentsOnly. S3BackupMode *string `type:"string" enum:"ElasticsearchS3BackupMode"` @@ -2297,8 +2579,8 @@ type ElasticsearchDestinationConfiguration struct { // already has another type, Kinesis Data Firehose returns an error during run // time. // - // TypeName is a required field - TypeName *string `min:"1" type:"string" required:"true"` + // For Elasticsearch 7.x, don't specify a TypeName. + TypeName *string `type:"string"` } // String returns the string representation @@ -2314,8 +2596,8 @@ func (s ElasticsearchDestinationConfiguration) GoString() 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.ClusterEndpoint != nil && len(*s.ClusterEndpoint) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterEndpoint", 1)) } if s.DomainARN != nil && len(*s.DomainARN) < 1 { invalidParams.Add(request.NewErrParamMinLen("DomainARN", 1)) @@ -2335,12 +2617,6 @@ func (s *ElasticsearchDestinationConfiguration) Validate() error { 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)) @@ -2375,6 +2651,12 @@ func (s *ElasticsearchDestinationConfiguration) SetCloudWatchLoggingOptions(v *C return s } +// SetClusterEndpoint sets the ClusterEndpoint field's value. +func (s *ElasticsearchDestinationConfiguration) SetClusterEndpoint(v string) *ElasticsearchDestinationConfiguration { + s.ClusterEndpoint = &v + return s +} + // SetDomainARN sets the DomainARN field's value. func (s *ElasticsearchDestinationConfiguration) SetDomainARN(v string) *ElasticsearchDestinationConfiguration { s.DomainARN = &v @@ -2439,8 +2721,16 @@ type ElasticsearchDestinationDescription struct { // The Amazon CloudWatch logging options. CloudWatchLoggingOptions *CloudWatchLoggingOptions `type:"structure"` + // The endpoint to use when communicating with the cluster. Kinesis Data Firehose + // uses either this ClusterEndpoint or the DomainARN field to send data to Amazon + // ES. + ClusterEndpoint *string `min:"1" type:"string"` + // The ARN of the Amazon ES domain. For more information, see Amazon Resource // Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). + // + // Kinesis Data Firehose uses either ClusterEndpoint or DomainARN to send data + // to Amazon ES. DomainARN *string `min:"1" type:"string"` // The Elasticsearch index name. @@ -2465,8 +2755,9 @@ type ElasticsearchDestinationDescription struct { // The Amazon S3 destination. S3DestinationDescription *S3DestinationDescription `type:"structure"` - // The Elasticsearch type name. - TypeName *string `min:"1" type:"string"` + // The Elasticsearch type name. This applies to Elasticsearch 6.x and lower + // versions. For Elasticsearch 7.x, there's no value for TypeName. + TypeName *string `type:"string"` } // String returns the string representation @@ -2491,6 +2782,12 @@ func (s *ElasticsearchDestinationDescription) SetCloudWatchLoggingOptions(v *Clo return s } +// SetClusterEndpoint sets the ClusterEndpoint field's value. +func (s *ElasticsearchDestinationDescription) SetClusterEndpoint(v string) *ElasticsearchDestinationDescription { + s.ClusterEndpoint = &v + return s +} + // SetDomainARN sets the DomainARN field's value. func (s *ElasticsearchDestinationDescription) SetDomainARN(v string) *ElasticsearchDestinationDescription { s.DomainARN = &v @@ -2556,10 +2853,16 @@ type ElasticsearchDestinationUpdate struct { // The CloudWatch logging options for your delivery stream. CloudWatchLoggingOptions *CloudWatchLoggingOptions `type:"structure"` + // The endpoint to use when communicating with the cluster. Specify either this + // ClusterEndpoint or the DomainARN field. + ClusterEndpoint *string `min:"1" type:"string"` + // 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. For more information, see Amazon // Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). + // + // Specify either ClusterEndpoint or DomainARN. DomainARN *string `min:"1" type:"string"` // The Elasticsearch index name. @@ -2567,7 +2870,7 @@ type ElasticsearchDestinationUpdate struct { // 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 the Amazon ES Destination (http://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-index-rotation). + // see Index Rotation for the Amazon ES Destination (https://docs.aws.amazon.com/firehose/latest/dev/basic-deliver.html#es-index-rotation). // Default value is OneDay. IndexRotationPeriod *string `type:"string" enum:"ElasticsearchIndexRotationPeriod"` @@ -2581,7 +2884,7 @@ type ElasticsearchDestinationUpdate struct { // The Amazon Resource Name (ARN) of the IAM role to be assumed by Kinesis Data // Firehose for calling the Amazon ES Configuration API and for indexing documents. // For more information, see Grant Kinesis Data Firehose Access to an Amazon - // S3 Destination (http://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3) + // S3 Destination (https://docs.aws.amazon.com/firehose/latest/dev/controlling-access.html#using-iam-s3) // and Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). RoleARN *string `min:"1" type:"string"` @@ -2591,7 +2894,12 @@ type ElasticsearchDestinationUpdate struct { // The Elasticsearch type name. For Elasticsearch 6.x, there can be only one // type per index. If you try to specify a new type for an existing index that // already has another type, Kinesis Data Firehose returns an error during runtime. - TypeName *string `min:"1" type:"string"` + // + // If you upgrade Elasticsearch from 6.x to 7.x and don’t update your delivery + // stream, Kinesis Data Firehose still delivers data to Elasticsearch with the + // old index name and type name. If you want to update your delivery stream + // with a new index name, provide an empty string for TypeName. + TypeName *string `type:"string"` } // String returns the string representation @@ -2607,6 +2915,9 @@ func (s ElasticsearchDestinationUpdate) GoString() 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.ClusterEndpoint != nil && len(*s.ClusterEndpoint) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterEndpoint", 1)) + } if s.DomainARN != nil && len(*s.DomainARN) < 1 { invalidParams.Add(request.NewErrParamMinLen("DomainARN", 1)) } @@ -2616,9 +2927,6 @@ func (s *ElasticsearchDestinationUpdate) Validate() error { 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)) @@ -2653,6 +2961,12 @@ func (s *ElasticsearchDestinationUpdate) SetCloudWatchLoggingOptions(v *CloudWat return s } +// SetClusterEndpoint sets the ClusterEndpoint field's value. +func (s *ElasticsearchDestinationUpdate) SetClusterEndpoint(v string) *ElasticsearchDestinationUpdate { + s.ClusterEndpoint = &v + return s +} + // SetDomainARN sets the DomainARN field's value. func (s *ElasticsearchDestinationUpdate) SetDomainARN(v string) *ElasticsearchDestinationUpdate { s.DomainARN = &v @@ -2808,15 +3122,13 @@ type ExtendedS3DestinationConfiguration struct { // A prefix that Kinesis Data Firehose evaluates and adds to failed records // before writing them to S3. This prefix appears immediately following the - // bucket name. + // bucket name. For information about how to specify this prefix, see Custom + // Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html). ErrorOutputPrefix *string `type:"string"` // The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered - // Amazon S3 files. You can specify an extra prefix to be added in front of - // the time format prefix. 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#s3-object-name) - // in the Amazon Kinesis Data Firehose Developer Guide. + // Amazon S3 files. You can also specify a custom prefix, as described in Custom + // Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html). Prefix *string `type:"string"` // The data processing configuration. @@ -2999,15 +3311,13 @@ type ExtendedS3DestinationDescription struct { // A prefix that Kinesis Data Firehose evaluates and adds to failed records // before writing them to S3. This prefix appears immediately following the - // bucket name. + // bucket name. For information about how to specify this prefix, see Custom + // Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html). ErrorOutputPrefix *string `type:"string"` // The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered - // Amazon S3 files. You can specify an extra prefix to be added in front of - // the time format prefix. 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#s3-object-name) - // in the Amazon Kinesis Data Firehose Developer Guide. + // Amazon S3 files. You can also specify a custom prefix, as described in Custom + // Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html). Prefix *string `type:"string"` // The data processing configuration. @@ -3135,15 +3445,13 @@ type ExtendedS3DestinationUpdate struct { // A prefix that Kinesis Data Firehose evaluates and adds to failed records // before writing them to S3. This prefix appears immediately following the - // bucket name. + // bucket name. For information about how to specify this prefix, see Custom + // Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html). ErrorOutputPrefix *string `type:"string"` // The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered - // Amazon S3 files. You can specify an extra prefix to be added in front of - // the time format prefix. 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#s3-object-name) - // in the Amazon Kinesis Data Firehose Developer Guide. + // Amazon S3 files. You can also specify a custom prefix, as described in Custom + // Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html). Prefix *string `type:"string"` // The data processing configuration. @@ -3283,6 +3591,45 @@ func (s *ExtendedS3DestinationUpdate) SetS3BackupUpdate(v *S3DestinationUpdate) return s } +// Provides details in case one of the following operations fails due to an +// error related to KMS: CreateDeliveryStream, DeleteDeliveryStream, StartDeliveryStreamEncryption, +// StopDeliveryStreamEncryption. +type FailureDescription struct { + _ struct{} `type:"structure"` + + // A message providing details about the error that caused the failure. + // + // Details is a required field + Details *string `type:"string" required:"true"` + + // The type of error that caused the failure. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"DeliveryStreamFailureType"` +} + +// String returns the string representation +func (s FailureDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FailureDescription) GoString() string { + return s.String() +} + +// SetDetails sets the Details field's value. +func (s *FailureDescription) SetDetails(v string) *FailureDescription { + s.Details = &v + return s +} + +// SetType sets the Type field's value. +func (s *FailureDescription) SetType(v string) *FailureDescription { + s.Type = &v + return s +} + // The native Hive / HCatalog JsonSerDe. Used by Kinesis Data Firehose for deserializing // data, which means converting it from the JSON format in preparation for serializing // it to the Parquet or ORC format. This is one of two deserializers you can @@ -3344,6 +3691,124 @@ func (s *InputFormatConfiguration) SetDeserializer(v *Deserializer) *InputFormat return s } +// The specified input parameter has a value that is not valid. +type InvalidArgumentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message that provides information about the error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidArgumentException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidArgumentException) GoString() string { + return s.String() +} + +func newErrorInvalidArgumentException(v protocol.ResponseMetadata) error { + return &InvalidArgumentException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidArgumentException) Code() string { + return "InvalidArgumentException" +} + +// Message returns the exception's message. +func (s InvalidArgumentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidArgumentException) OrigErr() error { + return nil +} + +func (s InvalidArgumentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidArgumentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidArgumentException) RequestID() string { + return s.respMetadata.RequestID +} + +// Kinesis Data Firehose throws this exception when an attempt to put records +// or to start or stop delivery stream encryption fails. This happens when the +// KMS service throws one of the following exception types: AccessDeniedException, +// InvalidStateException, DisabledException, or NotFoundException. +type InvalidKMSResourceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"code" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidKMSResourceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidKMSResourceException) GoString() string { + return s.String() +} + +func newErrorInvalidKMSResourceException(v protocol.ResponseMetadata) error { + return &InvalidKMSResourceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidKMSResourceException) Code() string { + return "InvalidKMSResourceException" +} + +// Message returns the exception's message. +func (s InvalidKMSResourceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidKMSResourceException) OrigErr() error { + return nil +} + +func (s InvalidKMSResourceException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidKMSResourceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidKMSResourceException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes an encryption key for a destination in Amazon S3. type KMSEncryptionConfig struct { _ struct{} `type:"structure"` @@ -3497,6 +3962,63 @@ func (s *KinesisStreamSourceDescription) SetRoleARN(v string) *KinesisStreamSour return s } +// You have already reached the limit for a requested resource. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message that provides information about the error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListDeliveryStreamsInput struct { _ struct{} `type:"structure"` @@ -3969,7 +4491,7 @@ type ParquetSerDe struct { // The compression code to use over data blocks. The possible values are UNCOMPRESSED, // SNAPPY, and GZIP, with the default being SNAPPY. Use SNAPPY for higher decompression - // speed. Use GZIP if the compression ration is more important than speed. + // speed. Use GZIP if the compression ratio is more important than speed. Compression *string `type:"string" enum:"ParquetCompression"` // Indicates whether to enable dictionary compression. @@ -5016,6 +5538,120 @@ func (s *RedshiftRetryOptions) SetDurationInSeconds(v int64) *RedshiftRetryOptio return s } +// The resource is already in use and not available for this operation. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message that provides information about the error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource could not be found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message that provides information about the error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes the configuration of a destination in Amazon S3. type S3DestinationConfiguration struct { _ struct{} `type:"structure"` @@ -5046,15 +5682,13 @@ type S3DestinationConfiguration struct { // A prefix that Kinesis Data Firehose evaluates and adds to failed records // before writing them to S3. This prefix appears immediately following the - // bucket name. + // bucket name. For information about how to specify this prefix, see Custom + // Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html). ErrorOutputPrefix *string `type:"string"` // The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered - // Amazon S3 files. You can specify an extra prefix to be added in front of - // the time format prefix. 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#s3-object-name) - // in the Amazon Kinesis Data Firehose Developer Guide. + // Amazon S3 files. You can also specify a custom prefix, as described in Custom + // Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html). Prefix *string `type:"string"` // The Amazon Resource Name (ARN) of the AWS credentials. For more information, @@ -5186,15 +5820,13 @@ type S3DestinationDescription struct { // A prefix that Kinesis Data Firehose evaluates and adds to failed records // before writing them to S3. This prefix appears immediately following the - // bucket name. + // bucket name. For information about how to specify this prefix, see Custom + // Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html). ErrorOutputPrefix *string `type:"string"` // The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered - // Amazon S3 files. You can specify an extra prefix to be added in front of - // the time format prefix. 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#s3-object-name) - // in the Amazon Kinesis Data Firehose Developer Guide. + // Amazon S3 files. You can also specify a custom prefix, as described in Custom + // Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html). Prefix *string `type:"string"` // The Amazon Resource Name (ARN) of the AWS credentials. For more information, @@ -5290,15 +5922,13 @@ type S3DestinationUpdate struct { // A prefix that Kinesis Data Firehose evaluates and adds to failed records // before writing them to S3. This prefix appears immediately following the - // bucket name. + // bucket name. For information about how to specify this prefix, see Custom + // Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html). ErrorOutputPrefix *string `type:"string"` // The "YYYY/MM/DD/HH" time format prefix is automatically used for delivered - // Amazon S3 files. You can specify an extra prefix to be added in front of - // the time format prefix. 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#s3-object-name) - // in the Amazon Kinesis Data Firehose Developer Guide. + // Amazon S3 files. You can also specify a custom prefix, as described in Custom + // Prefixes for Amazon S3 Objects (https://docs.aws.amazon.com/firehose/latest/dev/s3-prefixes.html). Prefix *string `type:"string"` // The Amazon Resource Name (ARN) of the AWS credentials. For more information, @@ -5526,6 +6156,66 @@ func (s *Serializer) SetParquetSerDe(v *ParquetSerDe) *Serializer { return s } +// 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 Data Firehose Limits (https://docs.aws.amazon.com/firehose/latest/dev/limits.html). +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message that provides information about the error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + // Details about a Kinesis data stream used as the source for a Kinesis Data // Firehose delivery stream. type SourceDescription struct { @@ -5965,6 +6655,10 @@ func (s *SplunkRetryOptions) SetDurationInSeconds(v int64) *SplunkRetryOptions { type StartDeliveryStreamEncryptionInput struct { _ struct{} `type:"structure"` + // Used to specify the type and Amazon Resource Name (ARN) of the KMS key needed + // for Server-Side Encryption (SSE). + DeliveryStreamEncryptionConfigurationInput *DeliveryStreamEncryptionConfigurationInput `type:"structure"` + // The name of the delivery stream for which you want to enable server-side // encryption (SSE). // @@ -5991,6 +6685,11 @@ func (s *StartDeliveryStreamEncryptionInput) Validate() error { if s.DeliveryStreamName != nil && len(*s.DeliveryStreamName) < 1 { invalidParams.Add(request.NewErrParamMinLen("DeliveryStreamName", 1)) } + if s.DeliveryStreamEncryptionConfigurationInput != nil { + if err := s.DeliveryStreamEncryptionConfigurationInput.Validate(); err != nil { + invalidParams.AddNested("DeliveryStreamEncryptionConfigurationInput", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -5998,6 +6697,12 @@ func (s *StartDeliveryStreamEncryptionInput) Validate() error { return nil } +// SetDeliveryStreamEncryptionConfigurationInput sets the DeliveryStreamEncryptionConfigurationInput field's value. +func (s *StartDeliveryStreamEncryptionInput) SetDeliveryStreamEncryptionConfigurationInput(v *DeliveryStreamEncryptionConfigurationInput) *StartDeliveryStreamEncryptionInput { + s.DeliveryStreamEncryptionConfigurationInput = v + return s +} + // SetDeliveryStreamName sets the DeliveryStreamName field's value. func (s *StartDeliveryStreamEncryptionInput) SetDeliveryStreamName(v string) *StartDeliveryStreamEncryptionInput { s.DeliveryStreamName = &v @@ -6470,20 +7175,58 @@ const ( // DeliveryStreamEncryptionStatusEnabling is a DeliveryStreamEncryptionStatus enum value DeliveryStreamEncryptionStatusEnabling = "ENABLING" + // DeliveryStreamEncryptionStatusEnablingFailed is a DeliveryStreamEncryptionStatus enum value + DeliveryStreamEncryptionStatusEnablingFailed = "ENABLING_FAILED" + // DeliveryStreamEncryptionStatusDisabled is a DeliveryStreamEncryptionStatus enum value DeliveryStreamEncryptionStatusDisabled = "DISABLED" // DeliveryStreamEncryptionStatusDisabling is a DeliveryStreamEncryptionStatus enum value DeliveryStreamEncryptionStatusDisabling = "DISABLING" + + // DeliveryStreamEncryptionStatusDisablingFailed is a DeliveryStreamEncryptionStatus enum value + DeliveryStreamEncryptionStatusDisablingFailed = "DISABLING_FAILED" +) + +const ( + // DeliveryStreamFailureTypeRetireKmsGrantFailed is a DeliveryStreamFailureType enum value + DeliveryStreamFailureTypeRetireKmsGrantFailed = "RETIRE_KMS_GRANT_FAILED" + + // DeliveryStreamFailureTypeCreateKmsGrantFailed is a DeliveryStreamFailureType enum value + DeliveryStreamFailureTypeCreateKmsGrantFailed = "CREATE_KMS_GRANT_FAILED" + + // DeliveryStreamFailureTypeKmsAccessDenied is a DeliveryStreamFailureType enum value + DeliveryStreamFailureTypeKmsAccessDenied = "KMS_ACCESS_DENIED" + + // DeliveryStreamFailureTypeDisabledKmsKey is a DeliveryStreamFailureType enum value + DeliveryStreamFailureTypeDisabledKmsKey = "DISABLED_KMS_KEY" + + // DeliveryStreamFailureTypeInvalidKmsKey is a DeliveryStreamFailureType enum value + DeliveryStreamFailureTypeInvalidKmsKey = "INVALID_KMS_KEY" + + // DeliveryStreamFailureTypeKmsKeyNotFound is a DeliveryStreamFailureType enum value + DeliveryStreamFailureTypeKmsKeyNotFound = "KMS_KEY_NOT_FOUND" + + // DeliveryStreamFailureTypeKmsOptInRequired is a DeliveryStreamFailureType enum value + DeliveryStreamFailureTypeKmsOptInRequired = "KMS_OPT_IN_REQUIRED" + + // DeliveryStreamFailureTypeUnknownError is a DeliveryStreamFailureType enum value + DeliveryStreamFailureTypeUnknownError = "UNKNOWN_ERROR" ) const ( // DeliveryStreamStatusCreating is a DeliveryStreamStatus enum value DeliveryStreamStatusCreating = "CREATING" + // DeliveryStreamStatusCreatingFailed is a DeliveryStreamStatus enum value + DeliveryStreamStatusCreatingFailed = "CREATING_FAILED" + // DeliveryStreamStatusDeleting is a DeliveryStreamStatus enum value DeliveryStreamStatusDeleting = "DELETING" + // DeliveryStreamStatusDeletingFailed is a DeliveryStreamStatus enum value + DeliveryStreamStatusDeletingFailed = "DELETING_FAILED" + // DeliveryStreamStatusActive is a DeliveryStreamStatus enum value DeliveryStreamStatusActive = "ACTIVE" ) @@ -6529,6 +7272,14 @@ const ( HECEndpointTypeEvent = "Event" ) +const ( + // KeyTypeAwsOwnedCmk is a KeyType enum value + KeyTypeAwsOwnedCmk = "AWS_OWNED_CMK" + + // KeyTypeCustomerManagedCmk is a KeyType enum value + KeyTypeCustomerManagedCmk = "CUSTOMER_MANAGED_CMK" +) + const ( // NoEncryptionConfigNoEncryption is a NoEncryptionConfig enum value NoEncryptionConfigNoEncryption = "NoEncryption" 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 index d70656e3e3e..3adb1d2d85a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/firehose/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/firehose/errors.go @@ -2,6 +2,10 @@ package firehose +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeConcurrentModificationException for service response error code @@ -17,6 +21,15 @@ const ( // The specified input parameter has a value that is not valid. ErrCodeInvalidArgumentException = "InvalidArgumentException" + // ErrCodeInvalidKMSResourceException for service response error code + // "InvalidKMSResourceException". + // + // Kinesis Data Firehose throws this exception when an attempt to put records + // or to start or stop delivery stream encryption fails. This happens when the + // KMS service throws one of the following exception types: AccessDeniedException, + // InvalidStateException, DisabledException, or NotFoundException. + ErrCodeInvalidKMSResourceException = "InvalidKMSResourceException" + // ErrCodeLimitExceededException for service response error code // "LimitExceededException". // @@ -41,6 +54,16 @@ const ( // 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 Data Firehose Limits (http://docs.aws.amazon.com/firehose/latest/dev/limits.html). + // see Amazon Kinesis Data Firehose Limits (https://docs.aws.amazon.com/firehose/latest/dev/limits.html). ErrCodeServiceUnavailableException = "ServiceUnavailableException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ConcurrentModificationException": newErrorConcurrentModificationException, + "InvalidArgumentException": newErrorInvalidArgumentException, + "InvalidKMSResourceException": newErrorInvalidKMSResourceException, + "LimitExceededException": newErrorLimitExceededException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ServiceUnavailableException": newErrorServiceUnavailableException, +} 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 index bcdf23dffb9..d279f87a652 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/firehose/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/firehose/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "firehose" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Firehose" // ServiceID is a unique identifer of a specific service. + ServiceID = "Firehose" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Firehose client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Firehose client from just a session. // svc := firehose.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Firehose { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Firehose { svc := &Firehose{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-08-04", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/fms/api.go b/vendor/github.com/aws/aws-sdk-go/service/fms/api.go index aff812ab927..52cabde0cc2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/fms/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/fms/api.go @@ -59,7 +59,7 @@ func (c *FMS) AssociateAdminAccountRequest(input *AssociateAdminAccountInput) (r // AssociateAdminAccount API operation for Firewall Management Service. // // Sets the AWS Firewall Manager administrator account. AWS Firewall Manager -// must be associated with the master account your AWS organization or associated +// must be associated with the master account of your AWS organization or associated // with a member account that has the appropriate permissions. If the account // ID that you submit is not an AWS Organizations master account, AWS Firewall // Manager will set the appropriate permissions for the given member account. @@ -74,19 +74,19 @@ func (c *FMS) AssociateAdminAccountRequest(input *AssociateAdminAccountInput) (r // See the AWS API reference guide for Firewall Management Service's // API operation AssociateAdminAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidOperationException "InvalidOperationException" +// Returned Error Types: +// * InvalidOperationException // The operation failed because there was nothing to do. For example, you might // have submitted an AssociateAdminAccount request, but the account ID that // you submitted was already set as the AWS Firewall Manager administrator. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The parameters of the request were invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -168,16 +168,16 @@ func (c *FMS) DeleteNotificationChannelRequest(input *DeleteNotificationChannelI // See the AWS API reference guide for Firewall Management Service's // API operation DeleteNotificationChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // The operation failed because there was nothing to do. For example, you might // have submitted an AssociateAdminAccount request, but the account ID that // you submitted was already set as the AWS Firewall Manager administrator. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -257,16 +257,16 @@ func (c *FMS) DeletePolicyRequest(input *DeletePolicyInput) (req *request.Reques // See the AWS API reference guide for Firewall Management Service's // API operation DeletePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // The operation failed because there was nothing to do. For example, you might // have submitted an AssociateAdminAccount request, but the account ID that // you submitted was already set as the AWS Firewall Manager administrator. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -339,7 +339,7 @@ func (c *FMS) DisassociateAdminAccountRequest(input *DisassociateAdminAccountInp // // Disassociates the account that has been set as the AWS Firewall Manager administrator // account. To set a different account as the administrator account, you must -// submit an AssociateAdminAccount request . +// submit an AssociateAdminAccount 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 @@ -348,16 +348,16 @@ func (c *FMS) DisassociateAdminAccountRequest(input *DisassociateAdminAccountInp // See the AWS API reference guide for Firewall Management Service's // API operation DisassociateAdminAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidOperationException "InvalidOperationException" +// Returned Error Types: +// * InvalidOperationException // The operation failed because there was nothing to do. For example, you might // have submitted an AssociateAdminAccount request, but the account ID that // you submitted was already set as the AWS Firewall Manager administrator. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -437,16 +437,16 @@ func (c *FMS) GetAdminAccountRequest(input *GetAdminAccountInput) (req *request. // See the AWS API reference guide for Firewall Management Service's // API operation GetAdminAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidOperationException "InvalidOperationException" +// Returned Error Types: +// * InvalidOperationException // The operation failed because there was nothing to do. For example, you might // have submitted an AssociateAdminAccount request, but the account ID that // you submitted was already set as the AWS Firewall Manager administrator. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -518,8 +518,11 @@ func (c *FMS) GetComplianceDetailRequest(input *GetComplianceDetailInput) (req * // // Returns detailed compliance information about the specified member account. // Details include resources that are in and out of compliance with the specified -// policy. Resources are considered non-compliant if the specified policy has -// not been applied to them. +// policy. Resources are considered noncompliant for AWS WAF and Shield Advanced +// policies if the specified policy has not been applied to them. Resources +// are considered noncompliant for security group policies if they are in scope +// of the policy, they violate one or more of the policy rules, and remediation +// is disabled or not possible. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -528,11 +531,11 @@ func (c *FMS) GetComplianceDetailRequest(input *GetComplianceDetailInput) (req * // See the AWS API reference guide for Firewall Management Service's // API operation GetComplianceDetail for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -602,8 +605,8 @@ func (c *FMS) GetNotificationChannelRequest(input *GetNotificationChannelInput) // GetNotificationChannel API operation for Firewall Management Service. // -// Returns information about the Amazon Simple Notification Service (SNS) topic -// that is used to record AWS Firewall Manager SNS logs. +// Information about the Amazon Simple Notification Service (SNS) topic that +// is used to record AWS Firewall Manager SNS 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 @@ -612,16 +615,16 @@ func (c *FMS) GetNotificationChannelRequest(input *GetNotificationChannelInput) // See the AWS API reference guide for Firewall Management Service's // API operation GetNotificationChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // The operation failed because there was nothing to do. For example, you might // have submitted an AssociateAdminAccount request, but the account ID that // you submitted was already set as the AWS Firewall Manager administrator. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -700,20 +703,20 @@ func (c *FMS) GetPolicyRequest(input *GetPolicyInput) (req *request.Request, out // See the AWS API reference guide for Firewall Management Service's // API operation GetPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // The operation failed because there was nothing to do. For example, you might // have submitted an AssociateAdminAccount request, but the account ID that // you submitted was already set as the AWS Firewall Manager administrator. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidTypeException "InvalidTypeException" +// * InvalidTypeException // The value of the Type parameter is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/GetPolicy @@ -783,7 +786,8 @@ func (c *FMS) GetProtectionStatusRequest(input *GetProtectionStatusInput) (req * // GetProtectionStatus API operation for Firewall Management Service. // // If you created a Shield Advanced policy, returns policy-level attack summary -// information in the event of a potential DDoS attack. +// information in the event of a potential DDoS attack. Other policy types are +// currently unsupported. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -792,14 +796,14 @@ func (c *FMS) GetProtectionStatusRequest(input *GetProtectionStatusInput) (req * // See the AWS API reference guide for Firewall Management Service's // API operation GetProtectionStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The parameters of the request were invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -886,11 +890,11 @@ func (c *FMS) ListComplianceStatusRequest(input *ListComplianceStatusInput) (req // See the AWS API reference guide for Firewall Management Service's // API operation ListComplianceStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -959,10 +963,12 @@ func (c *FMS) ListComplianceStatusPagesWithContext(ctx aws.Context, input *ListC }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListComplianceStatusOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListComplianceStatusOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1029,11 +1035,11 @@ func (c *FMS) ListMemberAccountsRequest(input *ListMemberAccountsInput) (req *re // See the AWS API reference guide for Firewall Management Service's // API operation ListMemberAccounts for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -1102,10 +1108,12 @@ func (c *FMS) ListMemberAccountsPagesWithContext(ctx aws.Context, input *ListMem }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListMemberAccountsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListMemberAccountsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1168,22 +1176,22 @@ func (c *FMS) ListPoliciesRequest(input *ListPoliciesInput) (req *request.Reques // See the AWS API reference guide for Firewall Management Service's // API operation ListPolicies for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // The operation failed because there was nothing to do. For example, you might // have submitted an AssociateAdminAccount request, but the account ID that // you submitted was already set as the AWS Firewall Manager administrator. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The operation exceeds a resource limit, for example, the maximum number of // policy objects that you can create for an AWS account. For more information, // see Firewall Manager Limits (https://docs.aws.amazon.com/waf/latest/developerguide/fms-limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -1252,13 +1260,106 @@ func (c *FMS) ListPoliciesPagesWithContext(ctx aws.Context, input *ListPoliciesI }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPoliciesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPoliciesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/ListTagsForResource +func (c *FMS) 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 Firewall Management Service. +// +// Retrieves the list of tags for the specified AWS 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 Firewall Management Service's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource was not found. +// +// * InvalidOperationException +// The operation failed because there was nothing to do. For example, you might +// have submitted an AssociateAdminAccount request, but the account ID that +// you submitted was already set as the AWS Firewall Manager administrator. +// +// * InternalErrorException +// The operation failed because of a system problem, even though the request +// was valid. Retry your request. +// +// * InvalidInputException +// The parameters of the request were invalid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/ListTagsForResource +func (c *FMS) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *FMS) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opPutNotificationChannel = "PutNotificationChannel" // PutNotificationChannelRequest generates a "aws/request.Request" representing the @@ -1314,16 +1415,16 @@ func (c *FMS) PutNotificationChannelRequest(input *PutNotificationChannelInput) // See the AWS API reference guide for Firewall Management Service's // API operation PutNotificationChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // The operation failed because there was nothing to do. For example, you might // have submitted an AssociateAdminAccount request, but the account ID that // you submitted was already set as the AWS Firewall Manager administrator. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -1395,16 +1496,23 @@ func (c *FMS) PutPolicyRequest(input *PutPolicyInput) (req *request.Request, out // // Creates an AWS Firewall Manager policy. // -// Firewall Manager provides two types of policies: A Shield Advanced policy, -// which applies Shield Advanced protection to specified accounts and resources, -// or a WAF policy, which contains a rule group and defines which resources -// are to be protected by that rule group. A policy is specific to either WAF -// or Shield Advanced. If you want to enforce both WAF rules and Shield Advanced -// protection across accounts, you can create multiple policies. You can create -// one or more policies for WAF rules, and one or more policies for Shield Advanced. +// Firewall Manager provides the following types of policies: +// +// * A Shield Advanced policy, which applies Shield Advanced protection to +// specified accounts and resources +// +// * An AWS WAF policy, which contains a rule group and defines which resources +// are to be protected by that rule group +// +// * A security group policy, which manages VPC security groups across your +// AWS organization. +// +// Each policy is specific to one of the three types. If you want to enforce +// more than one policy type across accounts, you can create multiple policies. +// You can create multiple policies for each type. // // You must be subscribed to Shield Advanced to create a Shield Advanced policy. -// For more information on subscribing to Shield Advanced, see CreateSubscription +// For more information about subscribing to Shield Advanced, see CreateSubscription // (https://docs.aws.amazon.com/waf/latest/DDOSAPIReference/API_CreateSubscription.html). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1414,29 +1522,29 @@ func (c *FMS) PutPolicyRequest(input *PutPolicyInput) (req *request.Request, out // See the AWS API reference guide for Firewall Management Service's // API operation PutPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // The operation failed because there was nothing to do. For example, you might // have submitted an AssociateAdminAccount request, but the account ID that // you submitted was already set as the AWS Firewall Manager administrator. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The parameters of the request were invalid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The operation exceeds a resource limit, for example, the maximum number of // policy objects that you can create for an AWS account. For more information, // see Firewall Manager Limits (https://docs.aws.amazon.com/waf/latest/developerguide/fms-limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeInternalErrorException "InternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidTypeException "InvalidTypeException" +// * InvalidTypeException // The value of the Type parameter is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/PutPolicy @@ -1461,6 +1569,196 @@ func (c *FMS) PutPolicyWithContext(ctx aws.Context, input *PutPolicyInput, opts return out, req.Send() } +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/TagResource +func (c *FMS) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for Firewall Management Service. +// +// Adds one or more tags to an AWS 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 Firewall Management Service's +// API operation TagResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource was not found. +// +// * InvalidOperationException +// The operation failed because there was nothing to do. For example, you might +// have submitted an AssociateAdminAccount request, but the account ID that +// you submitted was already set as the AWS Firewall Manager administrator. +// +// * InternalErrorException +// The operation failed because of a system problem, even though the request +// was valid. Retry your request. +// +// * InvalidInputException +// The parameters of the request were invalid. +// +// * LimitExceededException +// The operation exceeds a resource limit, for example, the maximum number of +// policy objects that you can create for an AWS account. For more information, +// see Firewall Manager Limits (https://docs.aws.amazon.com/waf/latest/developerguide/fms-limits.html) +// in the AWS WAF Developer Guide. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/TagResource +func (c *FMS) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *FMS) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/UntagResource +func (c *FMS) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for Firewall Management Service. +// +// Removes one or more tags from an AWS 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 Firewall Management Service's +// API operation UntagResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource was not found. +// +// * InvalidOperationException +// The operation failed because there was nothing to do. For example, you might +// have submitted an AssociateAdminAccount request, but the account ID that +// you submitted was already set as the AWS Firewall Manager administrator. +// +// * InternalErrorException +// The operation failed because of a system problem, even though the request +// was valid. Retry your request. +// +// * InvalidInputException +// The parameters of the request were invalid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/fms-2018-01-01/UntagResource +func (c *FMS) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *FMS) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + type AssociateAdminAccountInput struct { _ struct{} `type:"structure"` @@ -1526,8 +1824,8 @@ type ComplianceViolator struct { // The resource ID. ResourceId *string `min:"1" type:"string"` - // The resource type. This is in the format shown in AWS Resource Types Reference - // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html). + // The resource type. This is in the format shown in the AWS Resource Types + // Reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html). // For example: AWS::ElasticLoadBalancingV2::LoadBalancer or AWS::CloudFront::Distribution. ResourceType *string `min:"1" type:"string"` @@ -1594,21 +1892,31 @@ func (s DeleteNotificationChannelOutput) GoString() string { type DeletePolicyInput struct { _ struct{} `type:"structure"` - // If True, the request will also perform a clean-up process that will: + // If True, the request performs cleanup according to the policy type. + // + // For AWS WAF and Shield Advanced policies, the cleanup does the following: + // + // * Deletes rule groups created by AWS Firewall Manager + // + // * Removes web ACLs from in-scope resources + // + // * Deletes web ACLs that contain no rules or rule groups // - // * Delete rule groups created by AWS Firewall Manager + // For security group policies, the cleanup does the following for each security + // group in the policy: // - // * Remove web ACLs from in-scope resources + // * Disassociates the security group from in-scope resources // - // * Delete web ACLs that contain no rules or rule groups + // * Deletes the security group if it was created through Firewall Manager + // and if it's no longer associated with any resources through another policy // - // After the cleanup, in-scope resources will no longer be protected by web - // ACLs in this policy. Protection of out-of-scope resources will remain unchanged. - // Scope is determined by tags and accounts associated with the policy. When - // creating the policy, if you specified that only resources in specific accounts - // or with specific tags be protected by the policy, those resources are in-scope. - // All others are out of scope. If you did not specify tags or accounts, all - // resources are in-scope. + // After the cleanup, in-scope resources are no longer protected by web ACLs + // in this policy. Protection of out-of-scope resources remains unchanged. Scope + // is determined by tags that you create and accounts that you associate with + // the policy. When creating the policy, if you specify that only resources + // in specific accounts or with specific tags are in scope of the policy, those + // accounts and resources are handled by the policy. All others are out of scope. + // If you don't specify tags or accounts, all resources are in scope. DeleteAllPolicyResources *bool `type:"boolean"` // The ID of the policy that you want to delete. PolicyId is returned by PutPolicy @@ -1699,20 +2007,23 @@ func (s DisassociateAdminAccountOutput) GoString() string { } // Describes the compliance status for the account. An account is considered -// non-compliant if it includes resources that are not protected by the specified -// policy. +// noncompliant if it includes resources that are not protected by the specified +// policy or that don't comply with the policy. type EvaluationResult struct { _ struct{} `type:"structure"` // Describes an AWS account's compliance with the AWS Firewall Manager policy. ComplianceStatus *string `type:"string" enum:"PolicyComplianceStatusType"` - // Indicates that over 100 resources are non-compliant with the AWS Firewall + // Indicates that over 100 resources are noncompliant with the AWS Firewall // Manager policy. EvaluationLimitExceeded *bool `type:"boolean"` - // Number of resources that are non-compliant with the specified policy. A resource - // is considered non-compliant if it is not associated with the specified policy. + // The number of resources that are noncompliant with the specified policy. + // For AWS WAF and Shield Advanced policies, a resource is considered noncompliant + // if it is not associated with the policy. For security group policies, a resource + // is considered noncompliant if it doesn't comply with the rules of the policy + // and remediation is disabled or not possible. ViolatorCount *int64 `type:"long"` } @@ -1997,7 +2308,7 @@ type GetProtectionStatusInput struct { _ struct{} `type:"structure"` // The end of the time period to query for the attacks. This is a timestamp - // type. The sample request above indicates a number type because the default + // type. The request syntax listing indicates a number type because the default // used by AWS Firewall Manager is Unix time in seconds. However, any valid // timestamp format is allowed. EndTime *time.Time `type:"timestamp"` @@ -2014,8 +2325,8 @@ type GetProtectionStatusInput struct { // If you specify a value for MaxResults and you have more objects than the // number that you specify for MaxResults, AWS Firewall Manager returns a NextToken - // value in the response that allows you to list another group of objects. For - // the second and subsequent GetProtectionStatus requests, specify the value + // value in the response, which you can use to retrieve another group of objects. + // For the second and subsequent GetProtectionStatus requests, specify the value // of NextToken from the previous response to get information about another // batch of objects. NextToken *string `min:"1" type:"string"` @@ -2026,7 +2337,7 @@ type GetProtectionStatusInput struct { PolicyId *string `min:"36" type:"string" required:"true"` // The start of the time period to query for the attacks. This is a timestamp - // type. The sample request above indicates a number type because the default + // type. The request syntax listing indicates a number type because the default // used by AWS Firewall Manager is Unix time in seconds. However, any valid // timestamp format is allowed. StartTime *time.Time `type:"timestamp"` @@ -2121,8 +2432,7 @@ type GetProtectionStatusOutput struct { // // * End time of the attack (ongoing attacks will not have an end time) // - // The details are in JSON format. An example is shown in the Examples section - // below. + // The details are in JSON format. Data *string `type:"string"` // If you have more objects than the number that you specified for MaxResults @@ -2175,57 +2485,343 @@ func (s *GetProtectionStatusOutput) SetServiceType(v string) *GetProtectionStatu return s } -type ListComplianceStatusInput struct { - _ struct{} `type:"structure"` - - // Specifies the number of PolicyComplianceStatus objects that you want AWS - // Firewall Manager to return for this request. If you have more PolicyComplianceStatus - // objects than the number that you specify for MaxResults, the response includes - // a NextToken value that you can use to get another batch of PolicyComplianceStatus - // objects. - MaxResults *int64 `min:"1" type:"integer"` - - // If you specify a value for MaxResults and you have more PolicyComplianceStatus - // objects than the number that you specify for MaxResults, AWS Firewall Manager - // returns a NextToken value in the response that allows you to list another - // group of PolicyComplianceStatus objects. For the second and subsequent ListComplianceStatus - // requests, specify the value of NextToken from the previous response to get - // information about another batch of PolicyComplianceStatus objects. - NextToken *string `min:"1" type:"string"` +// The operation failed because of a system problem, even though the request +// was valid. Retry your request. +type InternalErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The ID of the AWS Firewall Manager policy that you want the details for. - // - // PolicyId is a required field - PolicyId *string `min:"36" type:"string" required:"true"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s ListComplianceStatusInput) String() string { +func (s InternalErrorException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListComplianceStatusInput) GoString() string { +func (s InternalErrorException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListComplianceStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListComplianceStatusInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - if s.PolicyId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyId")) - } - if s.PolicyId != nil && len(*s.PolicyId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("PolicyId", 36)) +func newErrorInternalErrorException(v protocol.ResponseMetadata) error { + return &InternalErrorException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { +// Code returns the exception type name. +func (s InternalErrorException) Code() string { + return "InternalErrorException" +} + +// Message returns the exception's message. +func (s InternalErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalErrorException) OrigErr() error { + return nil +} + +func (s InternalErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// The parameters of the request were invalid. +type InvalidInputException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidInputException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInputException) GoString() string { + return s.String() +} + +func newErrorInvalidInputException(v protocol.ResponseMetadata) error { + return &InvalidInputException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInputException) Code() string { + return "InvalidInputException" +} + +// Message returns the exception's message. +func (s InvalidInputException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInputException) OrigErr() error { + return nil +} + +func (s InvalidInputException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInputException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInputException) RequestID() string { + return s.respMetadata.RequestID +} + +// The operation failed because there was nothing to do. For example, you might +// have submitted an AssociateAdminAccount request, but the account ID that +// you submitted was already set as the AWS Firewall Manager administrator. +type InvalidOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidOperationException) GoString() string { + return s.String() +} + +func newErrorInvalidOperationException(v protocol.ResponseMetadata) error { + return &InvalidOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidOperationException) Code() string { + return "InvalidOperationException" +} + +// Message returns the exception's message. +func (s InvalidOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidOperationException) OrigErr() error { + return nil +} + +func (s InvalidOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidOperationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The value of the Type parameter is invalid. +type InvalidTypeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidTypeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidTypeException) GoString() string { + return s.String() +} + +func newErrorInvalidTypeException(v protocol.ResponseMetadata) error { + return &InvalidTypeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidTypeException) Code() string { + return "InvalidTypeException" +} + +// Message returns the exception's message. +func (s InvalidTypeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTypeException) OrigErr() error { + return nil +} + +func (s InvalidTypeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTypeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidTypeException) RequestID() string { + return s.respMetadata.RequestID +} + +// The operation exceeds a resource limit, for example, the maximum number of +// policy objects that you can create for an AWS account. For more information, +// see Firewall Manager Limits (https://docs.aws.amazon.com/waf/latest/developerguide/fms-limits.html) +// in the AWS WAF Developer Guide. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +type ListComplianceStatusInput struct { + _ struct{} `type:"structure"` + + // Specifies the number of PolicyComplianceStatus objects that you want AWS + // Firewall Manager to return for this request. If you have more PolicyComplianceStatus + // objects than the number that you specify for MaxResults, the response includes + // a NextToken value that you can use to get another batch of PolicyComplianceStatus + // objects. + MaxResults *int64 `min:"1" type:"integer"` + + // If you specify a value for MaxResults and you have more PolicyComplianceStatus + // objects than the number that you specify for MaxResults, AWS Firewall Manager + // returns a NextToken value in the response that allows you to list another + // group of PolicyComplianceStatus objects. For the second and subsequent ListComplianceStatus + // requests, specify the value of NextToken from the previous response to get + // information about another batch of PolicyComplianceStatus objects. + NextToken *string `min:"1" type:"string"` + + // The ID of the AWS Firewall Manager policy that you want the details for. + // + // PolicyId is a required field + PolicyId *string `min:"36" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListComplianceStatusInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListComplianceStatusInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListComplianceStatusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListComplianceStatusInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + if s.PolicyId == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyId")) + } + if s.PolicyId != nil && len(*s.PolicyId) < 36 { + invalidParams.Add(request.NewErrParamMinLen("PolicyId", 36)) + } + + if invalidParams.Len() > 0 { return invalidParams } return nil @@ -2468,6 +3064,72 @@ func (s *ListPoliciesOutput) SetPolicyList(v []*PolicySummary) *ListPoliciesOutp return s } +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource to return tags for. The Firewall + // Manager policy is the only AWS resource that supports tagging, so this ARN + // is a policy ARN.. + // + // ResourceArn is a required field + ResourceArn *string `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 +} + +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // The tags associated with the resource. + 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 +} + // An AWS Firewall Manager policy. type Policy struct { _ struct{} `type:"structure"` @@ -2482,9 +3144,9 @@ type Policy struct { ExcludeMap map[string][]*string `type:"map"` // If set to True, resources with the tags that are specified in the ResourceTag - // array are not protected by the policy. If set to False, and the ResourceTag - // array is not null, only resources with the specified tags are associated - // with the policy. + // array are not in scope of the policy. If set to False, and the ResourceTag + // array is not null, only resources with the specified tags are in scope of + // the policy. // // ExcludeResourceTags is a required field ExcludeResourceTags *bool `type:"boolean" required:"true"` @@ -2520,9 +3182,14 @@ type Policy struct { // An array of ResourceTag objects. ResourceTags []*ResourceTag `type:"list"` - // The type of resource to protect with the policy. This is in the format shown - // in AWS Resource Types Reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html). - // For example: AWS::ElasticLoadBalancingV2::LoadBalancer or AWS::CloudFront::Distribution. + // The type of resource protected by or in scope of the policy. This is in the + // format shown in the AWS Resource Types Reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html). + // For AWS WAF and Shield Advanced, examples include AWS::ElasticLoadBalancingV2::LoadBalancer + // and AWS::CloudFront::Distribution. For a security group common policy, valid + // values are AWS::EC2::NetworkInterface and AWS::EC2::Instance. For a security + // group content audit policy, valid values are AWS::EC2::SecurityGroup, AWS::EC2::NetworkInterface, + // and AWS::EC2::Instance. For a security group usage audit policy, the value + // is AWS::EC2::SecurityGroup. // // ResourceType is a required field ResourceType *string `min:"1" type:"string" required:"true"` @@ -2664,24 +3331,24 @@ func (s *Policy) SetSecurityServicePolicyData(v *SecurityServicePolicyData) *Pol return s } -// Describes the non-compliant resources in a member account for a specific -// AWS Firewall Manager policy. A maximum of 100 entries are displayed. If more -// than 100 resources are non-compliant, EvaluationLimitExceeded is set to True. +// Describes the noncompliant resources in a member account for a specific AWS +// Firewall Manager policy. A maximum of 100 entries are displayed. If more +// than 100 resources are noncompliant, EvaluationLimitExceeded is set to True. type PolicyComplianceDetail struct { _ struct{} `type:"structure"` - // Indicates if over 100 resources are non-compliant with the AWS Firewall Manager + // Indicates if over 100 resources are noncompliant with the AWS Firewall Manager // policy. EvaluationLimitExceeded *bool `type:"boolean"` - // A time stamp that indicates when the returned information should be considered - // out-of-date. + // A timestamp that indicates when the returned information should be considered + // out of date. ExpiredAt *time.Time `type:"timestamp"` // Details about problems with dependent services, such as AWS WAF or AWS Config, - // that are causing a resource to be non-compliant. The details include the - // name of the dependent service and the error message received that indicates - // the problem with the service. + // that are causing a resource to be noncompliant. The details include the name + // of the dependent service and the error message received that indicates the + // problem with the service. IssueInfoMap map[string]*string `type:"map"` // The AWS account ID. @@ -2693,7 +3360,8 @@ type PolicyComplianceDetail struct { // The AWS account that created the AWS Firewall Manager policy. PolicyOwner *string `min:"1" type:"string"` - // An array of resources that are not protected by the policy. + // An array of resources that aren't protected by the AWS WAF or Shield Advanced + // policy or that aren't in compliance with the security group policy. Violators []*ComplianceViolator `type:"list"` } @@ -2750,8 +3418,9 @@ func (s *PolicyComplianceDetail) SetViolators(v []*ComplianceViolator) *PolicyCo } // Indicates whether the account is compliant with the specified policy. An -// account is considered non-compliant if it includes resources that are not -// protected by the policy. +// account is considered noncompliant if it includes resources that are not +// protected by the policy, for AWS WAF and Shield Advanced policies, or that +// are noncompliant with the policy, for security group policies. type PolicyComplianceStatus struct { _ struct{} `type:"structure"` @@ -2759,12 +3428,12 @@ type PolicyComplianceStatus struct { EvaluationResults []*EvaluationResult `type:"list"` // Details about problems with dependent services, such as AWS WAF or AWS Config, - // that are causing a resource to be non-compliant. The details include the - // name of the dependent service and the error message received that indicates - // the problem with the service. + // that are causing a resource to be noncompliant. The details include the name + // of the dependent service and the error message received that indicates the + // problem with the service. IssueInfoMap map[string]*string `type:"map"` - // Time stamp of the last update to the EvaluationResult objects. + // Timestamp of the last update to the EvaluationResult objects. LastUpdated *time.Time `type:"timestamp"` // The member account ID. @@ -2848,14 +3517,19 @@ type PolicySummary struct { // Indicates if the policy should be automatically applied to new resources. RemediationEnabled *bool `type:"boolean"` - // The type of resource to protect with the policy. This is in the format shown - // in AWS Resource Types Reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html). - // For example: AWS::ElasticLoadBalancingV2::LoadBalancer or AWS::CloudFront::Distribution. + // The type of resource protected by or in scope of the policy. This is in the + // format shown in the AWS Resource Types Reference (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.html). + // For AWS WAF and Shield Advanced, examples include AWS::ElasticLoadBalancingV2::LoadBalancer + // and AWS::CloudFront::Distribution. For a security group common policy, valid + // values are AWS::EC2::NetworkInterface and AWS::EC2::Instance. For a security + // group content audit policy, valid values are AWS::EC2::SecurityGroup, AWS::EC2::NetworkInterface, + // and AWS::EC2::Instance. For a security group usage audit policy, the value + // is AWS::EC2::SecurityGroup. ResourceType *string `min:"1" type:"string"` // The service that the policy is using to protect the resources. This specifies - // the type of policy that is created, either a WAF policy or Shield Advanced - // policy. + // the type of policy that is created, either an AWS WAF policy, a Shield Advanced + // policy, or a security group policy. SecurityServiceType *string `type:"string" enum:"SecurityServiceType"` } @@ -2986,6 +3660,9 @@ type PutPolicyInput struct { // // Policy is a required field Policy *Policy `type:"structure" required:"true"` + + // The tags to add to the AWS resource. + TagList []*Tag `type:"list"` } // String returns the string representation @@ -3009,6 +3686,16 @@ func (s *PutPolicyInput) Validate() error { invalidParams.AddNested("Policy", err.(request.ErrInvalidParams)) } } + 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 @@ -3022,6 +3709,12 @@ func (s *PutPolicyInput) SetPolicy(v *Policy) *PutPolicyInput { return s } +// SetTagList sets the TagList field's value. +func (s *PutPolicyInput) SetTagList(v []*Tag) *PutPolicyInput { + s.TagList = v + return s +} + type PutPolicyOutput struct { _ struct{} `type:"structure"` @@ -3054,14 +3747,70 @@ func (s *PutPolicyOutput) SetPolicyArn(v string) *PutPolicyOutput { return s } +// The specified resource was not found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // The resource tags that AWS Firewall Manager uses to determine if a particular -// resource should be included or excluded from protection by the AWS Firewall -// Manager policy. Tags enable you to categorize your AWS resources 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. Tags are combined -// with an "OR." That is, if you add more than one tag, if any of the tags matches, -// the resource is considered a match for the include or exclude. Working with -// Tag Editor (https://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/tag-editor.html). +// resource should be included or excluded from the AWS Firewall Manager policy. +// Tags enable you to categorize your AWS resources in different ways, for example, +// by purpose, owner, or environment. Each tag consists of a key and an optional +// value. Firewall Manager combines the tags with "AND" so that, if you add +// more than one tag to a policy scope, a resource must have all the specified +// tags to be included or excluded. For more information, see Working with Tag +// Editor (https://docs.aws.amazon.com/awsconsolehelpdocs/latest/gsg/tag-editor.html). type ResourceTag struct { _ struct{} `type:"structure"` @@ -3116,19 +3865,34 @@ func (s *ResourceTag) SetValue(v string) *ResourceTag { type SecurityServicePolicyData struct { _ struct{} `type:"structure"` - // Details about the service. This contains WAF data in JSON format, as shown - // in the following example: + // Details about the service that are specific to the service type, in JSON + // format. For service type SHIELD_ADVANCED, this is an empty string. + // + // * Example: WAF ManagedServiceData": "{\"type\": \"WAF\", \"ruleGroups\": + // [{\"id\": \"12345678-1bcd-9012-efga-0987654321ab\", \"overrideAction\" + // : {\"type\": \"COUNT\"}}], \"defaultAction\": {\"type\": \"BLOCK\"}} + // + // * Example: SECURITY_GROUPS_COMMON "SecurityServicePolicyData":{"Type":"SECURITY_GROUPS_COMMON","ManagedServiceData":"{\"type\":\"SECURITY_GROUPS_COMMON\",\"revertManualSecurityGroupChanges\":false,\"exclusiveResourceSecurityGroupManagement\":false,\"securityGroups\":[{\"id\":\" + // sg-000e55995d61a06bd\"}]}"},"RemediationEnabled":false,"ResourceType":"AWS::EC2::NetworkInterface"} // - // ManagedServiceData": "{\"type\": \"WAF\", \"ruleGroups\": [{\"id\": \"12345678-1bcd-9012-efga-0987654321ab\", - // \"overrideAction\" : {\"type\": \"COUNT\"}}], \"defaultAction\": {\"type\": - // \"BLOCK\"}} + // * Example: SECURITY_GROUPS_CONTENT_AUDIT "SecurityServicePolicyData":{"Type":"SECURITY_GROUPS_CONTENT_AUDIT","ManagedServiceData":"{\"type\":\"SECURITY_GROUPS_CONTENT_AUDIT\",\"securityGroups\":[{\"id\":\" + // sg-000e55995d61a06bd \"}],\"securityGroupAction\":{\"type\":\"ALLOW\"}}"},"RemediationEnabled":false,"ResourceType":"AWS::EC2::NetworkInterface"} + // The security group action for content audit can be ALLOW or DENY. For + // ALLOW, all in-scope security group rules must be within the allowed range + // of the policy's security group rules. For DENY, all in-scope security + // group rules must not contain a value or a range that matches a rule value + // or range in the policy security group. // - // If this is a Shield Advanced policy, this string will be empty. + // * Example: SECURITY_GROUPS_USAGE_AUDIT "SecurityServicePolicyData":{"Type":"SECURITY_GROUPS_USAGE_AUDIT","ManagedServiceData":"{\"type\":\"SECURITY_GROUPS_USAGE_AUDIT\",\"deleteUnusedSecurityGroups\":true,\"coalesceRedundantSecurityGroups\":true}"},"RemediationEnabled":false,"Resou + // rceType":"AWS::EC2::SecurityGroup"} ManagedServiceData *string `min:"1" type:"string"` // The service that the policy is using to protect the resources. This specifies - // the type of policy that is created, either a WAF policy or Shield Advanced - // policy. + // the type of policy that is created, either an AWS WAF policy, a Shield Advanced + // policy, or a security group policy. For security group policies, Firewall + // Manager supports one security group for each common policy and for each content + // audit policy. This is an adjustable limit that you can increase by contacting + // AWS Support. // // Type is a required field Type *string `type:"string" required:"true" enum:"SecurityServiceType"` @@ -3172,6 +3936,219 @@ func (s *SecurityServicePolicyData) SetType(v string) *SecurityServicePolicyData return s } +// A collection of key:value pairs associated with an AWS resource. The key:value +// pair can be anything you define. Typically, the tag key represents a category +// (such as "environment") and the tag value represents a specific value within +// that category (such as "test," "development," or "production"). You can add +// up to 50 tags to each AWS resource. +type Tag struct { + _ struct{} `type:"structure"` + + // Part of the key:value pair that defines a tag. You can use a tag key to describe + // a category of information, such as "customer." Tag keys are case-sensitive. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // Part of the key:value pair that defines a tag. You can use a tag value to + // describe a specific value within a category, such as "companyA" or "companyB." + // Tag values are case-sensitive. + // + // 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 +} + +type TagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. The Firewall Manager policy + // is the only AWS resource that supports tagging, so this ARN is a policy ARN. + // + // ResourceArn is a required field + ResourceArn *string `min:"1" type:"string" required:"true"` + + // The tags to add to the resource. + // + // TagList is a required field + TagList []*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.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 +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { + s.ResourceArn = &v + return s +} + +// SetTagList sets the TagList field's value. +func (s *TagResourceInput) SetTagList(v []*Tag) *TagResourceInput { + s.TagList = v + return s +} + +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() +} + +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. The Firewall Manager policy + // is the only AWS resource that supports tagging, so this ARN is a policy ARN. + // + // ResourceArn is a required field + ResourceArn *string `min:"1" type:"string" required:"true"` + + // The keys of the tags to remove from the 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 +} + +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() +} + const ( // AccountRoleStatusReady is a AccountRoleStatus enum value AccountRoleStatusReady = "READY" @@ -3203,6 +4180,9 @@ const ( // DependentServiceNameAwsshieldAdvanced is a DependentServiceName enum value DependentServiceNameAwsshieldAdvanced = "AWSSHIELD_ADVANCED" + + // DependentServiceNameAwsvpc is a DependentServiceName enum value + DependentServiceNameAwsvpc = "AWSVPC" ) const ( @@ -3219,6 +4199,15 @@ const ( // SecurityServiceTypeShieldAdvanced is a SecurityServiceType enum value SecurityServiceTypeShieldAdvanced = "SHIELD_ADVANCED" + + // SecurityServiceTypeSecurityGroupsCommon is a SecurityServiceType enum value + SecurityServiceTypeSecurityGroupsCommon = "SECURITY_GROUPS_COMMON" + + // SecurityServiceTypeSecurityGroupsContentAudit is a SecurityServiceType enum value + SecurityServiceTypeSecurityGroupsContentAudit = "SECURITY_GROUPS_CONTENT_AUDIT" + + // SecurityServiceTypeSecurityGroupsUsageAudit is a SecurityServiceType enum value + SecurityServiceTypeSecurityGroupsUsageAudit = "SECURITY_GROUPS_USAGE_AUDIT" ) const ( @@ -3233,4 +4222,19 @@ const ( // ViolationReasonResourceMissingShieldProtection is a ViolationReason enum value ViolationReasonResourceMissingShieldProtection = "RESOURCE_MISSING_SHIELD_PROTECTION" + + // ViolationReasonResourceMissingWebAclOrShieldProtection is a ViolationReason enum value + ViolationReasonResourceMissingWebAclOrShieldProtection = "RESOURCE_MISSING_WEB_ACL_OR_SHIELD_PROTECTION" + + // ViolationReasonResourceMissingSecurityGroup is a ViolationReason enum value + ViolationReasonResourceMissingSecurityGroup = "RESOURCE_MISSING_SECURITY_GROUP" + + // ViolationReasonResourceViolatesAuditSecurityGroup is a ViolationReason enum value + ViolationReasonResourceViolatesAuditSecurityGroup = "RESOURCE_VIOLATES_AUDIT_SECURITY_GROUP" + + // ViolationReasonSecurityGroupUnused is a ViolationReason enum value + ViolationReasonSecurityGroupUnused = "SECURITY_GROUP_UNUSED" + + // ViolationReasonSecurityGroupRedundant is a ViolationReason enum value + ViolationReasonSecurityGroupRedundant = "SECURITY_GROUP_REDUNDANT" ) diff --git a/vendor/github.com/aws/aws-sdk-go/service/fms/errors.go b/vendor/github.com/aws/aws-sdk-go/service/fms/errors.go index 596738bf347..0fc209a4a74 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/fms/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/fms/errors.go @@ -2,6 +2,10 @@ package fms +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInternalErrorException for service response error code @@ -46,3 +50,12 @@ const ( // The specified resource was not found. ErrCodeResourceNotFoundException = "ResourceNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InternalErrorException": newErrorInternalErrorException, + "InvalidInputException": newErrorInvalidInputException, + "InvalidOperationException": newErrorInvalidOperationException, + "InvalidTypeException": newErrorInvalidTypeException, + "LimitExceededException": newErrorLimitExceededException, + "ResourceNotFoundException": newErrorResourceNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/fms/service.go b/vendor/github.com/aws/aws-sdk-go/service/fms/service.go index 6103e57fd82..5f05bfe605d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/fms/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/fms/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "fms" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "FMS" // ServiceID is a unique identifer of a specific service. + ServiceID = "FMS" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the FMS client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a FMS client from just a session. // svc := fms.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := fms.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *FMS { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *FMS { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *FMS { svc := &FMS{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-01-01", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/forecastservice/api.go b/vendor/github.com/aws/aws-sdk-go/service/forecastservice/api.go index cf80363ee33..93cc9f06625 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/forecastservice/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/forecastservice/api.go @@ -62,8 +62,6 @@ func (c *ForecastService) CreateDatasetRequest(input *CreateDatasetInput) (req * // This includes the following: // // * DataFrequency - How frequently your historical time-series data is collected. -// Amazon Forecast uses this information when training the model and generating -// a forecast. // // * Domain and DatasetType - Each dataset has an associated dataset domain // and a type within the domain. Amazon Forecast provides a list of predefined @@ -71,15 +69,18 @@ func (c *ForecastService) CreateDatasetRequest(input *CreateDatasetInput) (req * // type within the domain, Amazon Forecast requires your data to include // a minimum set of predefined fields. // -// * Schema - A schema specifies the fields of the dataset, including the +// * Schema - A schema specifies the fields in the dataset, including the // field name and data type. // -// After creating a dataset, you import your training data into the dataset -// and add the dataset to a dataset group. You then use the dataset group to -// create a predictor. For more information, see howitworks-datasets-groups. +// After creating a dataset, you import your training data into it and add the +// dataset to a dataset group. You use the dataset group to create a predictor. +// For more information, see howitworks-datasets-groups. // // To get a list of all your datasets, use the ListDatasets operation. // +// For example Forecast datasets, see the Amazon Forecast Sample GitHub repository +// (https://github.com/aws-samples/amazon-forecast-samples/tree/master/data). +// // The Status of a dataset must be ACTIVE before you can import training data. // Use the DescribeDataset operation to get the status. // @@ -90,17 +91,16 @@ func (c *ForecastService) CreateDatasetRequest(input *CreateDatasetInput) (req * // See the AWS API reference guide for Amazon Forecast Service's // API operation CreateDataset for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" -// There is already a resource with that Amazon Resource Name (ARN). Try again -// with a different ARN. +// * ResourceAlreadyExistsException +// There is already a resource with this name. Try again with a different name. // -// * ErrCodeLimitExceededException "LimitExceededException" -// The limit on the number of requests per second has been exceeded. +// * LimitExceededException +// The limit on the number of resources per account has been exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreateDataset func (c *ForecastService) CreateDataset(input *CreateDatasetInput) (*CreateDatasetOutput, error) { @@ -168,18 +168,18 @@ func (c *ForecastService) CreateDatasetGroupRequest(input *CreateDatasetGroupInp // CreateDatasetGroup API operation for Amazon Forecast Service. // -// Creates an Amazon Forecast dataset group, which holds a collection of related -// datasets. You can add datasets to the dataset group when you create the dataset -// group, or you can add datasets later with the UpdateDatasetGroup operation. +// Creates a dataset group, which holds a collection of related datasets. You +// can add datasets to the dataset group when you create the dataset group, +// or later by using the UpdateDatasetGroup operation. // // After creating a dataset group and adding datasets, you use the dataset group // when you create a predictor. For more information, see howitworks-datasets-groups. // // To get a list of all your datasets groups, use the ListDatasetGroups operation. // -// The Status of a dataset group must be ACTIVE before you can create a predictor -// using the dataset group. Use the DescribeDatasetGroup operation to get the -// status. +// The Status of a dataset group must be ACTIVE before you can create use the +// dataset group to create a predictor. To get the status, use the DescribeDatasetGroup +// 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 @@ -188,24 +188,23 @@ func (c *ForecastService) CreateDatasetGroupRequest(input *CreateDatasetGroupInp // See the AWS API reference guide for Amazon Forecast Service's // API operation CreateDatasetGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" -// There is already a resource with that Amazon Resource Name (ARN). Try again -// with a different ARN. +// * ResourceAlreadyExistsException +// There is already a resource with this name. Try again with a different name. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // -// * ErrCodeLimitExceededException "LimitExceededException" -// The limit on the number of requests per second has been exceeded. +// * LimitExceededException +// The limit on the number of resources per account has been exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreateDatasetGroup func (c *ForecastService) CreateDatasetGroup(input *CreateDatasetGroupInput) (*CreateDatasetGroupOutput, error) { @@ -282,24 +281,14 @@ func (c *ForecastService) CreateDatasetImportJobRequest(input *CreateDatasetImpo // Management (IAM) role that Amazon Forecast can assume to access the data. // For more information, see aws-forecast-iam-roles. // -// Two properties of the training data are optionally specified: -// -// * The delimiter that separates the data fields. The default delimiter -// is a comma (,), which is the only supported delimiter in this release. +// The training data must be in CSV format. The delimiter must be a comma (,). // -// * The format of timestamps. If the format is not specified, Amazon Forecast -// expects the format to be "yyyy-MM-dd HH:mm:ss". +// You can specify the path to a specific CSV file, the S3 bucket, or to a folder +// in the S3 bucket. For the latter two cases, Amazon Forecast imports all files +// up to the limit of 10,000 files. // -// When Amazon Forecast uploads your training data, it verifies that the data -// was collected at the DataFrequency specified when the target dataset was -// created. For more information, see CreateDataset and howitworks-datasets-groups. -// Amazon Forecast also verifies the delimiter and timestamp format. -// -// You can use the ListDatasetImportJobs operation to get a list of all your -// dataset import jobs, filtered by specified criteria. -// -// To get a list of all your dataset import jobs, filtered by the specified -// criteria, use the ListDatasetGroups operation. +// To get a list of all your dataset import jobs, filtered by specified criteria, +// use the ListDatasetImportJobs 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 @@ -308,24 +297,23 @@ func (c *ForecastService) CreateDatasetImportJobRequest(input *CreateDatasetImpo // See the AWS API reference guide for Amazon Forecast Service's // API operation CreateDatasetImportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" -// There is already a resource with that Amazon Resource Name (ARN). Try again -// with a different ARN. +// * ResourceAlreadyExistsException +// There is already a resource with this name. Try again with a different name. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // -// * ErrCodeLimitExceededException "LimitExceededException" -// The limit on the number of requests per second has been exceeded. +// * LimitExceededException +// The limit on the number of resources per account has been exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreateDatasetImportJob func (c *ForecastService) CreateDatasetImportJob(input *CreateDatasetImportJobInput) (*CreateDatasetImportJobOutput, error) { @@ -396,17 +384,17 @@ func (c *ForecastService) CreateForecastRequest(input *CreateForecastInput) (req // Creates a forecast for each item in the TARGET_TIME_SERIES dataset that was // used to train the predictor. This is known as inference. To retrieve the // forecast for a single item at low latency, use the operation. To export the -// complete forecast into your Amazon Simple Storage Service (Amazon S3), use -// the CreateForecastExportJob operation. +// complete forecast into your Amazon Simple Storage Service (Amazon S3) bucket, +// use the CreateForecastExportJob operation. // -// The range of the forecast is determined by the ForecastHorizon, specified -// in the CreatePredictor request, multiplied by the DataFrequency, specified -// in the CreateDataset request. When you query a forecast, you can request -// a specific date range within the complete forecast. +// The range of the forecast is determined by the ForecastHorizon value, which +// you specify in the CreatePredictor request, multiplied by the DataFrequency +// value, which you specify in the CreateDataset request. When you query a forecast, +// you can request a specific date range within the forecast. // // To get a list of all your forecasts, use the ListForecasts operation. // -// The forecasts generated by Amazon Forecast are in the same timezone as the +// The forecasts generated by Amazon Forecast are in the same time zone as the // dataset that was used to create the predictor. // // For more information, see howitworks-forecast. @@ -421,24 +409,23 @@ func (c *ForecastService) CreateForecastRequest(input *CreateForecastInput) (req // See the AWS API reference guide for Amazon Forecast Service's // API operation CreateForecast for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" -// There is already a resource with that Amazon Resource Name (ARN). Try again -// with a different ARN. +// * ResourceAlreadyExistsException +// There is already a resource with this name. Try again with a different name. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // -// * ErrCodeLimitExceededException "LimitExceededException" -// The limit on the number of requests per second has been exceeded. +// * LimitExceededException +// The limit on the number of resources per account has been exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreateForecast func (c *ForecastService) CreateForecast(input *CreateForecastInput) (*CreateForecastOutput, error) { @@ -507,7 +494,12 @@ func (c *ForecastService) CreateForecastExportJobRequest(input *CreateForecastEx // CreateForecastExportJob API operation for Amazon Forecast Service. // // Exports a forecast created by the CreateForecast operation to your Amazon -// Simple Storage Service (Amazon S3) bucket. +// Simple Storage Service (Amazon S3) bucket. The forecast file name will match +// the following conventions: +// +// __ +// +// where the component is in Java SimpleDateFormat (yyyy-MM-ddTHH-mm-ssZ). // // You must specify a DataDestination object that includes an AWS Identity and // Access Management (IAM) role that Amazon Forecast can assume to access the @@ -519,8 +511,8 @@ func (c *ForecastService) CreateForecastExportJobRequest(input *CreateForecastEx // operation. // // The Status of the forecast export job must be ACTIVE before you can access -// the forecast in your Amazon S3 bucket. Use the DescribeForecastExportJob -// operation to get the status. +// the forecast in your Amazon S3 bucket. To get the status, use the DescribeForecastExportJob +// 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 @@ -529,24 +521,23 @@ func (c *ForecastService) CreateForecastExportJobRequest(input *CreateForecastEx // See the AWS API reference guide for Amazon Forecast Service's // API operation CreateForecastExportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" -// There is already a resource with that Amazon Resource Name (ARN). Try again -// with a different ARN. +// * ResourceAlreadyExistsException +// There is already a resource with this name. Try again with a different name. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // -// * ErrCodeLimitExceededException "LimitExceededException" -// The limit on the number of requests per second has been exceeded. +// * LimitExceededException +// The limit on the number of resources per account has been exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreateForecastExportJob func (c *ForecastService) CreateForecastExportJob(input *CreateForecastExportJobInput) (*CreateForecastExportJobOutput, error) { @@ -629,14 +620,19 @@ func (c *ForecastService) CreatePredictorRequest(input *CreatePredictorInput) (r // review the evaluation metrics before deciding to use the predictor to generate // a forecast. // -// Optionally, you can specify a featurization configuration to fill and aggragate +// Optionally, you can specify a featurization configuration to fill and aggregate // the data fields in the TARGET_TIME_SERIES dataset to improve model training. // For more information, see FeaturizationConfig. // +// For RELATED_TIME_SERIES datasets, CreatePredictor verifies that the DataFrequency +// specified when the dataset was created matches the ForecastFrequency. TARGET_TIME_SERIES +// datasets don't have this restriction. Amazon Forecast also verifies the delimiter +// and timestamp format. For more information, see howitworks-datasets-groups. +// // AutoML // -// If you set PerformAutoML to true, Amazon Forecast evaluates each algorithm -// and chooses the one that minimizes the objective function. The objective +// If you want Amazon Forecast to evaluate each algorithm and choose the one +// that minimizes the objective function, set PerformAutoML to true. The objective // function is defined as the mean of the weighted p10, p50, and p90 quantile // losses. For more information, see EvaluationResult. // @@ -650,11 +646,11 @@ func (c *ForecastService) CreatePredictorRequest(input *CreatePredictorInput) (r // // * TrainingParameters // -// To get a list of all your predictors, use the ListPredictors operation. +// To get a list of all of your predictors, use the ListPredictors operation. // -// The Status of the predictor must be ACTIVE, signifying that training has -// completed, before you can use the predictor to create a forecast. Use the -// DescribePredictor operation to get the status. +// Before you can use the predictor to create a forecast, the Status of the +// predictor must be ACTIVE, signifying that training has completed. To get +// the status, use the DescribePredictor 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 @@ -663,24 +659,23 @@ func (c *ForecastService) CreatePredictorRequest(input *CreatePredictorInput) (r // See the AWS API reference guide for Amazon Forecast Service's // API operation CreatePredictor for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" -// There is already a resource with that Amazon Resource Name (ARN). Try again -// with a different ARN. +// * ResourceAlreadyExistsException +// There is already a resource with this name. Try again with a different name. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // -// * ErrCodeLimitExceededException "LimitExceededException" -// The limit on the number of requests per second has been exceeded. +// * LimitExceededException +// The limit on the number of resources per account has been exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/CreatePredictor func (c *ForecastService) CreatePredictor(input *CreatePredictorInput) (*CreatePredictorOutput, error) { @@ -749,9 +744,9 @@ func (c *ForecastService) DeleteDatasetRequest(input *DeleteDatasetInput) (req * // DeleteDataset API operation for Amazon Forecast Service. // -// Deletes an Amazon Forecast dataset created using the CreateDataset operation. -// To be deleted, the dataset must have a status of ACTIVE or CREATE_FAILED. -// Use the DescribeDataset operation to get the status. +// Deletes an Amazon Forecast dataset that was created using the CreateDataset +// operation. You can only delete datasets that have a status of ACTIVE or CREATE_FAILED. +// To get the status use the DescribeDataset 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 @@ -760,16 +755,16 @@ func (c *ForecastService) DeleteDatasetRequest(input *DeleteDatasetInput) (req * // See the AWS API reference guide for Amazon Forecast Service's // API operation DeleteDataset for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/DeleteDataset @@ -839,11 +834,11 @@ func (c *ForecastService) DeleteDatasetGroupRequest(input *DeleteDatasetGroupInp // DeleteDatasetGroup API operation for Amazon Forecast Service. // -// Deletes a dataset group created using the CreateDatasetGroup operation. To -// be deleted, the dataset group must have a status of ACTIVE, CREATE_FAILED, -// or UPDATE_FAILED. Use the DescribeDatasetGroup operation to get the status. +// Deletes a dataset group created using the CreateDatasetGroup operation. You +// can only delete dataset groups that have a status of ACTIVE, CREATE_FAILED, +// or UPDATE_FAILED. To get the status, use the DescribeDatasetGroup operation. // -// The operation deletes only the dataset group, not the datasets in the group. +// This operation deletes only the dataset group, not the datasets in the 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 @@ -852,16 +847,16 @@ func (c *ForecastService) DeleteDatasetGroupRequest(input *DeleteDatasetGroupInp // See the AWS API reference guide for Amazon Forecast Service's // API operation DeleteDatasetGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/DeleteDatasetGroup @@ -932,8 +927,8 @@ func (c *ForecastService) DeleteDatasetImportJobRequest(input *DeleteDatasetImpo // DeleteDatasetImportJob API operation for Amazon Forecast Service. // // Deletes a dataset import job created using the CreateDatasetImportJob operation. -// To be deleted, the import job must have a status of ACTIVE or CREATE_FAILED. -// Use the DescribeDatasetImportJob operation to get the status. +// You can delete only dataset import jobs that have a status of ACTIVE or CREATE_FAILED. +// To get the status, use the DescribeDatasetImportJob 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 @@ -942,16 +937,16 @@ func (c *ForecastService) DeleteDatasetImportJobRequest(input *DeleteDatasetImpo // See the AWS API reference guide for Amazon Forecast Service's // API operation DeleteDatasetImportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/DeleteDatasetImportJob @@ -1021,11 +1016,12 @@ func (c *ForecastService) DeleteForecastRequest(input *DeleteForecastInput) (req // DeleteForecast API operation for Amazon Forecast Service. // -// Deletes a forecast created using the CreateForecast operation. To be deleted, -// the forecast must have a status of ACTIVE or CREATE_FAILED. Use the DescribeForecast -// operation to get the status. +// Deletes a forecast created using the CreateForecast operation. You can delete +// only forecasts that have a status of ACTIVE or CREATE_FAILED. To get the +// status, use the DescribeForecast operation. // -// You can't delete a forecast while it is being exported. +// You can't delete a forecast while it is being exported. After a forecast +// is deleted, you can no longer query the forecast. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1034,16 +1030,16 @@ func (c *ForecastService) DeleteForecastRequest(input *DeleteForecastInput) (req // See the AWS API reference guide for Amazon Forecast Service's // API operation DeleteForecast for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/DeleteForecast @@ -1114,8 +1110,8 @@ func (c *ForecastService) DeleteForecastExportJobRequest(input *DeleteForecastEx // DeleteForecastExportJob API operation for Amazon Forecast Service. // // Deletes a forecast export job created using the CreateForecastExportJob operation. -// To be deleted, the export job must have a status of ACTIVE or CREATE_FAILED. -// Use the DescribeForecastExportJob operation to get the status. +// You can delete only export jobs that have a status of ACTIVE or CREATE_FAILED. +// To get the status, use the DescribeForecastExportJob 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 @@ -1124,16 +1120,16 @@ func (c *ForecastService) DeleteForecastExportJobRequest(input *DeleteForecastEx // See the AWS API reference guide for Amazon Forecast Service's // API operation DeleteForecastExportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/DeleteForecastExportJob @@ -1203,11 +1199,9 @@ func (c *ForecastService) DeletePredictorRequest(input *DeletePredictorInput) (r // DeletePredictor API operation for Amazon Forecast Service. // -// Deletes a predictor created using the CreatePredictor operation. To be deleted, -// the predictor must have a status of ACTIVE or CREATE_FAILED. Use the DescribePredictor -// operation to get the status. -// -// Any forecasts generated by the predictor will no longer be available. +// Deletes a predictor created using the CreatePredictor operation. You can +// delete only predictor that have a status of ACTIVE or CREATE_FAILED. To get +// the status, use the DescribePredictor 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 @@ -1216,16 +1210,16 @@ func (c *ForecastService) DeletePredictorRequest(input *DeletePredictorInput) (r // See the AWS API reference guide for Amazon Forecast Service's // API operation DeletePredictor for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/DeletePredictor @@ -1296,8 +1290,8 @@ func (c *ForecastService) DescribeDatasetRequest(input *DescribeDatasetInput) (r // // Describes an Amazon Forecast dataset created using the CreateDataset operation. // -// In addition to listing the properties provided by the user in the CreateDataset -// request, this operation includes the following properties: +// In addition to listing the parameters specified in the CreateDataset request, +// this operation includes the following dataset properties: // // * CreationTime // @@ -1312,12 +1306,12 @@ func (c *ForecastService) DescribeDatasetRequest(input *DescribeDatasetInput) (r // See the AWS API reference guide for Amazon Forecast Service's // API operation DescribeDataset for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // @@ -1389,7 +1383,7 @@ func (c *ForecastService) DescribeDatasetGroupRequest(input *DescribeDatasetGrou // // Describes a dataset group created using the CreateDatasetGroup operation. // -// In addition to listing the properties provided by the user in the CreateDatasetGroup +// In addition to listing the parameters provided in the CreateDatasetGroup // request, this operation includes the following properties: // // * DatasetArns - The datasets belonging to the group. @@ -1407,12 +1401,12 @@ func (c *ForecastService) DescribeDatasetGroupRequest(input *DescribeDatasetGrou // See the AWS API reference guide for Amazon Forecast Service's // API operation DescribeDatasetGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // @@ -1484,7 +1478,7 @@ func (c *ForecastService) DescribeDatasetImportJobRequest(input *DescribeDataset // // Describes a dataset import job created using the CreateDatasetImportJob operation. // -// In addition to listing the properties provided by the user in the CreateDatasetImportJob +// In addition to listing the parameters provided in the CreateDatasetImportJob // request, this operation includes the following properties: // // * CreationTime @@ -1506,12 +1500,12 @@ func (c *ForecastService) DescribeDatasetImportJobRequest(input *DescribeDataset // See the AWS API reference guide for Amazon Forecast Service's // API operation DescribeDatasetImportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // @@ -1583,8 +1577,8 @@ func (c *ForecastService) DescribeForecastRequest(input *DescribeForecastInput) // // Describes a forecast created using the CreateForecast operation. // -// In addition to listing the properties provided by the user in the CreateForecast -// request, this operation includes the following properties: +// In addition to listing the properties provided in the CreateForecast request, +// this operation lists the following properties: // // * DatasetGroupArn - The dataset group that provided the training data. // @@ -1603,12 +1597,12 @@ func (c *ForecastService) DescribeForecastRequest(input *DescribeForecastInput) // See the AWS API reference guide for Amazon Forecast Service's // API operation DescribeForecast for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // @@ -1682,7 +1676,7 @@ func (c *ForecastService) DescribeForecastExportJobRequest(input *DescribeForeca // operation. // // In addition to listing the properties provided by the user in the CreateForecastExportJob -// request, this operation includes the following properties: +// request, this operation lists the following properties: // // * CreationTime // @@ -1699,12 +1693,12 @@ func (c *ForecastService) DescribeForecastExportJobRequest(input *DescribeForeca // See the AWS API reference guide for Amazon Forecast Service's // API operation DescribeForecastExportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // @@ -1776,13 +1770,14 @@ func (c *ForecastService) DescribePredictorRequest(input *DescribePredictorInput // // Describes a predictor created using the CreatePredictor operation. // -// In addition to listing the properties provided by the user in the CreatePredictor -// request, this operation includes the following properties: +// In addition to listing the properties provided in the CreatePredictor request, +// this operation lists the following properties: // // * DatasetImportJobArns - The dataset import jobs used to import training // data. // -// * AutoMLAlgorithmArns - If AutoML is performed, the algorithms evaluated. +// * AutoMLAlgorithmArns - If AutoML is performed, the algorithms that were +// evaluated. // // * CreationTime // @@ -1799,12 +1794,12 @@ func (c *ForecastService) DescribePredictorRequest(input *DescribePredictorInput // See the AWS API reference guide for Amazon Forecast Service's // API operation DescribePredictor for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // @@ -1876,17 +1871,23 @@ func (c *ForecastService) GetAccuracyMetricsRequest(input *GetAccuracyMetricsInp // // Provides metrics on the accuracy of the models that were trained by the CreatePredictor // operation. Use metrics to see how well the model performed and to decide -// whether to use the predictor to generate a forecast. +// whether to use the predictor to generate a forecast. For more information, +// see metrics. // -// Metrics are generated for each backtest window evaluated. For more information, -// see EvaluationParameters. +// This operation generates metrics for each backtest window that was evaluated. +// The number of backtest windows (NumberOfBacktestWindows) is specified using +// the EvaluationParameters object, which is optionally included in the CreatePredictor +// request. If NumberOfBacktestWindows isn't specified, the number defaults +// to one. // // The parameters of the filling method determine which items contribute to -// the metrics. If zero is specified, all items contribute. If nan is specified, -// only those items that have complete data in the range being evaluated contribute. -// For more information, see FeaturizationMethod. +// the metrics. If you want all items to contribute, specify zero. If you want +// only those items that have complete data in the range being evaluated to +// contribute, specify nan. For more information, see FeaturizationMethod. // -// For an example of how to train a model and review metrics, see getting-started. +// Before you can get accuracy metrics, the Status of the predictor must be +// ACTIVE, signifying that training has completed. To get the status, use the +// DescribePredictor 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 @@ -1895,16 +1896,16 @@ func (c *ForecastService) GetAccuracyMetricsRequest(input *GetAccuracyMetricsInp // See the AWS API reference guide for Amazon Forecast Service's // API operation GetAccuracyMetrics for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/GetAccuracyMetrics @@ -1980,9 +1981,10 @@ func (c *ForecastService) ListDatasetGroupsRequest(input *ListDatasetGroupsInput // ListDatasetGroups API operation for Amazon Forecast Service. // // Returns a list of dataset groups created using the CreateDatasetGroup operation. -// For each dataset group, a summary of its properties, including its Amazon -// Resource Name (ARN), is returned. You can retrieve the complete set of properties -// by using the ARN with the DescribeDatasetGroup operation. +// For each dataset group, this operation returns a summary of its properties, +// including its Amazon Resource Name (ARN). You can retrieve the complete set +// of properties by using the dataset group ARN with the DescribeDatasetGroup +// 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 @@ -1991,8 +1993,8 @@ func (c *ForecastService) ListDatasetGroupsRequest(input *ListDatasetGroupsInput // See the AWS API reference guide for Amazon Forecast Service's // API operation ListDatasetGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The token is not valid. Tokens expire after 24 hours. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/ListDatasetGroups @@ -2060,10 +2062,12 @@ func (c *ForecastService) ListDatasetGroupsPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDatasetGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDatasetGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2118,8 +2122,8 @@ func (c *ForecastService) ListDatasetImportJobsRequest(input *ListDatasetImportJ // ListDatasetImportJobs API operation for Amazon Forecast Service. // // Returns a list of dataset import jobs created using the CreateDatasetImportJob -// operation. For each import job, a summary of its properties, including its -// Amazon Resource Name (ARN), is returned. You can retrieve the complete set +// operation. For each import job, this operation returns a summary of its properties, +// including its Amazon Resource Name (ARN). You can retrieve the complete set // of properties by using the ARN with the DescribeDatasetImportJob operation. // You can filter the list by providing an array of Filter objects. // @@ -2130,11 +2134,11 @@ func (c *ForecastService) ListDatasetImportJobsRequest(input *ListDatasetImportJ // See the AWS API reference guide for Amazon Forecast Service's // API operation ListDatasetImportJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The token is not valid. Tokens expire after 24 hours. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // @@ -2203,10 +2207,12 @@ func (c *ForecastService) ListDatasetImportJobsPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDatasetImportJobsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDatasetImportJobsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2262,8 +2268,8 @@ func (c *ForecastService) ListDatasetsRequest(input *ListDatasetsInput) (req *re // // Returns a list of datasets created using the CreateDataset operation. For // each dataset, a summary of its properties, including its Amazon Resource -// Name (ARN), is returned. You can retrieve the complete set of properties -// by using the ARN with the DescribeDataset operation. +// Name (ARN), is returned. To retrieve the complete set of properties, use +// the ARN with the DescribeDataset 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 @@ -2272,8 +2278,8 @@ func (c *ForecastService) ListDatasetsRequest(input *ListDatasetsInput) (req *re // See the AWS API reference guide for Amazon Forecast Service's // API operation ListDatasets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The token is not valid. Tokens expire after 24 hours. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/ListDatasets @@ -2341,10 +2347,12 @@ func (c *ForecastService) ListDatasetsPagesWithContext(ctx aws.Context, input *L }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDatasetsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDatasetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2399,10 +2407,10 @@ func (c *ForecastService) ListForecastExportJobsRequest(input *ListForecastExpor // ListForecastExportJobs API operation for Amazon Forecast Service. // // Returns a list of forecast export jobs created using the CreateForecastExportJob -// operation. For each forecast export job, a summary of its properties, including -// its Amazon Resource Name (ARN), is returned. You can retrieve the complete -// set of properties by using the ARN with the DescribeForecastExportJob operation. -// The list can be filtered using an array of Filter objects. +// operation. For each forecast export job, this operation returns a summary +// of its properties, including its Amazon Resource Name (ARN). To retrieve +// the complete set of properties, use the ARN with the DescribeForecastExportJob +// operation. You can filter the list using an array of Filter 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 @@ -2411,11 +2419,11 @@ func (c *ForecastService) ListForecastExportJobsRequest(input *ListForecastExpor // See the AWS API reference guide for Amazon Forecast Service's // API operation ListForecastExportJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The token is not valid. Tokens expire after 24 hours. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // @@ -2484,10 +2492,12 @@ func (c *ForecastService) ListForecastExportJobsPagesWithContext(ctx aws.Context }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListForecastExportJobsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListForecastExportJobsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2542,9 +2552,9 @@ func (c *ForecastService) ListForecastsRequest(input *ListForecastsInput) (req * // ListForecasts API operation for Amazon Forecast Service. // // Returns a list of forecasts created using the CreateForecast operation. For -// each forecast, a summary of its properties, including its Amazon Resource -// Name (ARN), is returned. You can retrieve the complete set of properties -// by using the ARN with the DescribeForecast operation. The list can be filtered +// each forecast, this operation returns a summary of its properties, including +// its Amazon Resource Name (ARN). To retrieve the complete set of properties, +// specify the ARN with the DescribeForecast operation. You can filter the list // using an array of Filter objects. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -2554,11 +2564,11 @@ func (c *ForecastService) ListForecastsRequest(input *ListForecastsInput) (req * // See the AWS API reference guide for Amazon Forecast Service's // API operation ListForecasts for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The token is not valid. Tokens expire after 24 hours. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // @@ -2627,10 +2637,12 @@ func (c *ForecastService) ListForecastsPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListForecastsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListForecastsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2685,10 +2697,10 @@ func (c *ForecastService) ListPredictorsRequest(input *ListPredictorsInput) (req // ListPredictors API operation for Amazon Forecast Service. // // Returns a list of predictors created using the CreatePredictor operation. -// For each predictor, a summary of its properties, including its Amazon Resource -// Name (ARN), is returned. You can retrieve the complete set of properties -// by using the ARN with the DescribePredictor operation. The list can be filtered -// using an array of Filter objects. +// For each predictor, this operation returns a summary of its properties, including +// its Amazon Resource Name (ARN). You can retrieve the complete set of properties +// by using the ARN with the DescribePredictor operation. You can filter the +// list using an array of Filter 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 @@ -2697,11 +2709,11 @@ func (c *ForecastService) ListPredictorsRequest(input *ListPredictorsInput) (req // See the AWS API reference guide for Amazon Forecast Service's // API operation ListPredictors for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The token is not valid. Tokens expire after 24 hours. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // @@ -2770,10 +2782,12 @@ func (c *ForecastService) ListPredictorsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPredictorsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPredictorsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2822,11 +2836,11 @@ func (c *ForecastService) UpdateDatasetGroupRequest(input *UpdateDatasetGroupInp // UpdateDatasetGroup API operation for Amazon Forecast Service. // -// Replaces any existing datasets in the dataset group with the specified datasets. +// Replaces the datasets in a dataset group with the specified datasets. // -// The Status of the dataset group must be ACTIVE before creating a predictor -// using the dataset group. Use the DescribeDatasetGroup operation to get the -// status. +// The Status of the dataset group must be ACTIVE before you can use the dataset +// group to create a predictor. Use the DescribeDatasetGroup operation to get +// the 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 @@ -2835,16 +2849,16 @@ func (c *ForecastService) UpdateDatasetGroupRequest(input *UpdateDatasetGroupInp // See the AWS API reference guide for Amazon Forecast Service's // API operation UpdateDatasetGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // We can't process the request because it includes an invalid value or a value // that exceeds the valid range. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find a resource with that Amazon Resource Name (ARN). Check the // ARN and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/UpdateDatasetGroup @@ -2950,9 +2964,7 @@ type ContinuousParameterRange struct { Name *string `min:"1" type:"string" required:"true"` // The scale that hyperparameter tuning uses to search the hyperparameter range. - // For information about choosing a hyperparameter scale, see Hyperparameter - // Scaling (http://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-define-ranges.html#scaling-type). - // One of the following values: + // Valid values: // // Auto // @@ -2968,16 +2980,19 @@ type ContinuousParameterRange struct { // Hyperparameter tuning searches the values in the hyperparameter range by // using a logarithmic scale. // - // Logarithmic scaling works only for ranges that have only values greater than - // 0. + // Logarithmic scaling works only for ranges that have values greater than 0. // // ReverseLogarithmic // - // Hyperparemeter tuning searches the values in the hyperparameter range by + // hyperparameter tuning searches the values in the hyperparameter range by // using a reverse logarithmic scale. // // Reverse logarithmic scaling works only for ranges that are entirely within // the range 0 <= x < 1.0. + // + // For information about choosing a hyperparameter scale, see Hyperparameter + // Scaling (http://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-define-ranges.html#scaling-type). + // One of the following values: ScalingType *string `type:"string" enum:"ScalingType"` } @@ -3049,12 +3064,15 @@ type CreateDatasetGroupInput struct { // DatasetGroupName is a required field DatasetGroupName *string `min:"1" type:"string" required:"true"` - // The domain associated with the dataset group. The Domain and DatasetType - // that you choose determine the fields that must be present in the training - // data that you import to the dataset. For example, if you choose the RETAIL - // domain and TARGET_TIME_SERIES as the DatasetType, Amazon Forecast requires - // item_id, timestamp, and demand fields to be present in your data. For more - // information, see howitworks-datasets-groups. + // The domain associated with the dataset group. When you add a dataset to a + // dataset group, this value and the value specified for the Domain parameter + // of the CreateDataset operation must match. + // + // The Domain and DatasetType that you choose determine the fields that must + // be present in training data that you import to a dataset. For example, if + // you choose the RETAIL domain and TARGET_TIME_SERIES as the DatasetType, Amazon + // Forecast requires that item_id, timestamp, and demand fields are present + // in your data. For more information, see howitworks-datasets-groups. // // Domain is a required field Domain *string `type:"string" required:"true" enum:"Domain"` @@ -3135,6 +3153,12 @@ type CreateDatasetImportJobInput struct { // The location of the training data to import and an AWS Identity and Access // Management (IAM) role that Amazon Forecast can assume to access the data. + // The training data must be stored in an Amazon S3 bucket. + // + // If encryption is used, DataSource must include an AWS Key Management Service + // (KMS) key and the IAM role must allow Amazon Forecast permission to access + // the key. The KMS key and IAM role must match those specified in the EncryptionConfig + // parameter of the CreateDataset operation. // // DataSource is a required field DataSource *DataSource `type:"structure" required:"true"` @@ -3145,20 +3169,24 @@ type CreateDatasetImportJobInput struct { // DatasetArn is a required field DatasetArn *string `type:"string" required:"true"` - // The name for the dataset import job. It is recommended to include the current - // timestamp in the name to guard against getting a ResourceAlreadyExistsException - // exception, for example, 20190721DatasetImport. + // The name for the dataset import job. We recommend including the current timestamp + // in the name, for example, 20190721DatasetImport. This can help you avoid + // getting a ResourceAlreadyExistsException exception. // // DatasetImportJobName is a required field DatasetImportJobName *string `min:"1" type:"string" required:"true"` - // The format of timestamps in the dataset. Two formats are supported, dependent - // on the DataFrequency specified when the dataset was created. + // The format of timestamps in the dataset. The format that you specify depends + // on the DataFrequency specified when the dataset was created. The following + // formats are supported + // + // * "yyyy-MM-dd" For the following data frequencies: Y, M, W, and D // - // * "yyyy-MM-dd" For data frequencies: Y, M, W, and D + // * "yyyy-MM-dd HH:mm:ss" For the following data frequencies: H, 30min, + // 15min, and 1min; and optionally, for: Y, M, W, and D // - // * "yyyy-MM-dd HH:mm:ss" For data frequencies: H, 30min, 15min, and 1min; - // and optionally, for: Y, M, W, and D + // If the format isn't specified, Amazon Forecast expects the format to be "yyyy-MM-dd + // HH:mm:ss". TimestampFormat *string `type:"string"` } @@ -3249,7 +3277,8 @@ func (s *CreateDatasetImportJobOutput) SetDatasetImportJobArn(v string) *CreateD type CreateDatasetInput struct { _ struct{} `type:"structure"` - // The frequency of data collection. + // The frequency of data collection. This parameter is required for RELATED_TIME_SERIES + // datasets. // // Valid intervals are Y (Year), M (Month), W (Week), D (Day), H (Hour), 30min // (30 minutes), 15min (15 minutes), 10min (10 minutes), 5min (5 minutes), and @@ -3267,12 +3296,15 @@ type CreateDatasetInput struct { // DatasetType is a required field DatasetType *string `type:"string" required:"true" enum:"DatasetType"` - // The domain associated with the dataset. The Domain and DatasetType that you - // choose determine the fields that must be present in the training data that - // you import to the dataset. For example, if you choose the RETAIL domain and - // TARGET_TIME_SERIES as the DatasetType, Amazon Forecast requires item_id, - // timestamp, and demand fields to be present in your data. For more information, - // see howitworks-datasets-groups. + // The domain associated with the dataset. When you add a dataset to a dataset + // group, this value and the value specified for the Domain parameter of the + // CreateDatasetGroup operation must match. + // + // The Domain and DatasetType that you choose determine the fields that must + // be present in the training data that you import to the dataset. For example, + // if you choose the RETAIL domain and TARGET_TIME_SERIES as the DatasetType, + // Amazon Forecast requires item_id, timestamp, and demand fields to be present + // in your data. For more information, see howitworks-datasets-groups. // // Domain is a required field Domain *string `type:"string" required:"true" enum:"Domain"` @@ -3397,9 +3429,13 @@ func (s *CreateDatasetOutput) SetDatasetArn(v string) *CreateDatasetOutput { type CreateForecastExportJobInput struct { _ struct{} `type:"structure"` - // The path to the Amazon S3 bucket where you want to save the forecast and - // an AWS Identity and Access Management (IAM) role that Amazon Forecast can - // assume to access the bucket. + // The location where you want to save the forecast and an AWS Identity and + // Access Management (IAM) role that Amazon Forecast can assume to access the + // location. The forecast must be exported to an Amazon S3 bucket. + // + // If encryption is used, Destination must include an AWS Key Management Service + // (KMS) key. The IAM role must allow Amazon Forecast permission to access the + // key. // // Destination is a required field Destination *DataDestination `type:"structure" required:"true"` @@ -3496,11 +3532,18 @@ func (s *CreateForecastExportJobOutput) SetForecastExportJobArn(v string) *Creat type CreateForecastInput struct { _ struct{} `type:"structure"` - // The name for the forecast. + // A name for the forecast. // // ForecastName is a required field ForecastName *string `min:"1" type:"string" required:"true"` + // The quantiles at which probabilistic forecasts are generated. You can specify + // up to 5 quantiles per forecast. Accepted values include 0.01 to 0.99 (increments + // of .01 only) and mean. The mean forecast is different from the median (0.50) + // when the distribution is not symmetric (e.g. Beta, Negative Binomial). The + // default value is ["0.1", "0.5", "0.9"]. + ForecastTypes []*string `min:"1" type:"list"` + // The Amazon Resource Name (ARN) of the predictor to use to generate the forecast. // // PredictorArn is a required field @@ -3526,6 +3569,9 @@ func (s *CreateForecastInput) Validate() error { if s.ForecastName != nil && len(*s.ForecastName) < 1 { invalidParams.Add(request.NewErrParamMinLen("ForecastName", 1)) } + if s.ForecastTypes != nil && len(s.ForecastTypes) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ForecastTypes", 1)) + } if s.PredictorArn == nil { invalidParams.Add(request.NewErrParamRequired("PredictorArn")) } @@ -3542,6 +3588,12 @@ func (s *CreateForecastInput) SetForecastName(v string) *CreateForecastInput { return s } +// SetForecastTypes sets the ForecastTypes field's value. +func (s *CreateForecastInput) SetForecastTypes(v []*string) *CreateForecastInput { + s.ForecastTypes = v + return s +} + // SetPredictorArn sets the PredictorArn field's value. func (s *CreateForecastInput) SetPredictorArn(v string) *CreateForecastInput { s.PredictorArn = &v @@ -3577,12 +3629,12 @@ type CreatePredictorInput struct { // The Amazon Resource Name (ARN) of the algorithm to use for model training. // Required if PerformAutoML is not set to true. // - // Supported algorithms + // Supported algorithms: // // * arn:aws:forecast:::algorithm/ARIMA // - // * arn:aws:forecast:::algorithm/Deep_AR_Plus - supports hyperparameter - // optimization (HPO) + // * arn:aws:forecast:::algorithm/Deep_AR_Plus Supports hyperparameter optimization + // (HPO) // // * arn:aws:forecast:::algorithm/ETS // @@ -3613,6 +3665,9 @@ type CreatePredictorInput struct { // the DataFrequency parameter of the CreateDataset operation) and set the forecast // horizon to 10, the model returns predictions for 10 days. // + // The maximum forecast horizon is the lesser of 500 time-steps or 1/3 of the + // TARGET_TIME_SERIES dataset length. + // // ForecastHorizon is a required field ForecastHorizon *int64 `type:"integer" required:"true"` @@ -3620,6 +3675,8 @@ type CreatePredictorInput struct { // this parameter, Amazon Forecast uses default values. The individual algorithms // specify which hyperparameters support hyperparameter optimization (HPO). // For more information, see aws-forecast-choosing-recipes. + // + // If you included the HPOConfig object, you must set PerformHPO to true. HPOConfig *HyperParameterTuningJobConfig `type:"structure"` // Describes the dataset group that contains the data to use to train the predictor. @@ -3627,27 +3684,32 @@ type CreatePredictorInput struct { // InputDataConfig is a required field InputDataConfig *InputDataConfig `type:"structure" required:"true"` - // Whether to perform AutoML. The default value is false. In this case, you - // are required to specify an algorithm. + // Whether to perform AutoML. When Amazon Forecast performs AutoML, it evaluates + // the algorithms it provides and chooses the best algorithm and configuration + // for your training dataset. + // + // The default value is false. In this case, you are required to specify an + // algorithm. // - // If you want Amazon Forecast to evaluate the algorithms it provides and choose - // the best algorithm and configuration for your training dataset, set PerformAutoML - // to true. This is a good option if you aren't sure which algorithm is suitable - // for your application. + // Set PerformAutoML to true to have Amazon Forecast perform AutoML. This is + // a good option if you aren't sure which algorithm is suitable for your training + // data. In this case, PerformHPO must be false. PerformAutoML *bool `type:"boolean"` // Whether to perform hyperparameter optimization (HPO). HPO finds optimal hyperparameter // values for your training data. The process of performing HPO is known as - // a hyperparameter tuning job. + // running a hyperparameter tuning job. // // The default value is false. In this case, Amazon Forecast uses default hyperparameter // values from the chosen algorithm. // - // To override the default values, set PerformHPO to true and supply the HyperParameterTuningJobConfig - // object. The tuning job specifies an objective metric, the hyperparameters - // to optimize, and the valid range for each hyperparameter. + // To override the default values, set PerformHPO to true and, optionally, supply + // the HyperParameterTuningJobConfig object. The tuning job specifies a metric + // to optimize, which hyperparameters participate in tuning, and the valid range + // for each tunable hyperparameter. In this case, you are required to specify + // an algorithm and PerformAutoML must be false. // - // The following algorithms support HPO: + // The following algorithm supports HPO: // // * DeepAR+ PerformHPO *bool `type:"boolean"` @@ -3657,8 +3719,9 @@ type CreatePredictorInput struct { // PredictorName is a required field PredictorName *string `min:"1" type:"string" required:"true"` - // The training parameters to override for model training. The parameters that - // you can override are listed in the individual algorithms in aws-forecast-choosing-recipes. + // The hyperparameters to override for model training. The hyperparameters that + // you can override are listed in the individual algorithms. For the list of + // supported algorithms, see aws-forecast-choosing-recipes. TrainingParameters map[string]*string `type:"map"` } @@ -3806,8 +3869,10 @@ func (s *CreatePredictorOutput) SetPredictorArn(v string) *CreatePredictorOutput return s } -// The destination of an exported forecast and credentials to access the location. -// This object is submitted in the CreateForecastExportJob request. +// The destination for an exported forecast, an AWS Identity and Access Management +// (IAM) role that allows Amazon Forecast to access the location and, optionally, +// an AWS Key Management Service (KMS) key. This object is submitted in the +// CreateForecastExportJob request. type DataDestination struct { _ struct{} `type:"structure"` @@ -3852,8 +3917,10 @@ func (s *DataDestination) SetS3Config(v *S3Config) *DataDestination { return s } -// The source of your training data and credentials to access the data. This -// object is submitted in the CreateDatasetImportJob request. +// The source of your training data, an AWS Identity and Access Management (IAM) +// role that allows Amazon Forecast to access the data and, optionally, an AWS +// Key Management Service (KMS) key. This object is submitted in the CreateDatasetImportJob +// request. type DataSource struct { _ struct{} `type:"structure"` @@ -3900,11 +3967,11 @@ func (s *DataSource) SetS3Config(v *S3Config) *DataSource { // Provides a summary of the dataset group properties used in the ListDatasetGroups // operation. To get the complete set of properties, call the DescribeDatasetGroup -// operation, and provide the listed DatasetGroupArn. +// operation, and provide the DatasetGroupArn. type DatasetGroupSummary struct { _ struct{} `type:"structure"` - // When the datase group was created. + // When the dataset group was created. CreationTime *time.Time `type:"timestamp"` // The Amazon Resource Name (ARN) of the dataset group. @@ -3915,7 +3982,7 @@ type DatasetGroupSummary struct { // When the dataset group was created or last updated from a call to the UpdateDatasetGroup // operation. While the dataset group is being updated, LastModificationTime - // is the current query time. + // is the current time of the ListDatasetGroups call. LastModificationTime *time.Time `type:"timestamp"` } @@ -3955,14 +4022,19 @@ func (s *DatasetGroupSummary) SetLastModificationTime(v time.Time) *DatasetGroup // Provides a summary of the dataset import job properties used in the ListDatasetImportJobs // operation. To get the complete set of properties, call the DescribeDatasetImportJob -// operation, and provide the listed DatasetImportJobArn. +// operation, and provide the DatasetImportJobArn. type DatasetImportJobSummary struct { _ struct{} `type:"structure"` // When the dataset import job was created. CreationTime *time.Time `type:"timestamp"` - // The location of the Amazon S3 bucket that contains the training data. + // The location of the training data to import and an AWS Identity and Access + // Management (IAM) role that Amazon Forecast can assume to access the data. + // The training data must be stored in an Amazon S3 bucket. + // + // If encryption is used, DataSource includes an AWS Key Management Service + // (KMS) key. DataSource *DataSource `type:"structure"` // The Amazon Resource Name (ARN) of the dataset import job. @@ -3971,13 +4043,14 @@ type DatasetImportJobSummary struct { // The name of the dataset import job. DatasetImportJobName *string `min:"1" type:"string"` - // Dependent on the status as follows: + // The last time that the dataset was modified. The time depends on the status + // of the job, as follows: // - // * CREATE_PENDING - same as CreationTime + // * CREATE_PENDING - The same time as CreationTime. // - // * CREATE_IN_PROGRESS - the current timestamp + // * CREATE_IN_PROGRESS - The current timestamp. // - // * ACTIVE or CREATE_FAILED - when the job finished or failed + // * ACTIVE or CREATE_FAILED - When the job finished or failed. LastModificationTime *time.Time `type:"timestamp"` // If an error occurred, an informational message about the error. @@ -4049,7 +4122,7 @@ func (s *DatasetImportJobSummary) SetStatus(v string) *DatasetImportJobSummary { // Provides a summary of the dataset properties used in the ListDatasets operation. // To get the complete set of properties, call the DescribeDataset operation, -// and provide the listed DatasetArn. +// and provide the DatasetArn. type DatasetSummary struct { _ struct{} `type:"structure"` @@ -4068,10 +4141,10 @@ type DatasetSummary struct { // The domain associated with the dataset. Domain *string `type:"string" enum:"Domain"` - // When the dataset is created, LastModificationTime is the same as CreationTime. - // After a CreateDatasetImportJob operation is called, LastModificationTime - // is when the import job finished or failed. While data is being imported to - // the dataset, LastModificationTime is the current query time. + // When you create a dataset, LastModificationTime is the same as CreationTime. + // While data is being imported to the dataset, LastModificationTime is the + // current time of the ListDatasets call. After a CreateDatasetImportJob operation + // has finished, LastModificationTime is when the import job completed or failed. LastModificationTime *time.Time `type:"timestamp"` } @@ -4487,17 +4560,12 @@ type DescribeDatasetGroupOutput struct { // The name of the dataset group. DatasetGroupName *string `min:"1" type:"string"` - // The domain associated with the dataset group. The Domain and DatasetType - // that you choose determine the fields that must be present in the training - // data that you import to the dataset. For example, if you choose the RETAIL - // domain and TARGET_TIME_SERIES as the DatasetType, Amazon Forecast requires - // item_id, timestamp, and demand fields to be present in your data. For more - // information, see howitworks-datasets-groups. + // The domain associated with the dataset group. Domain *string `type:"string" enum:"Domain"` // When the dataset group was created or last updated from a call to the UpdateDatasetGroup // operation. While the dataset group is being updated, LastModificationTime - // is the current query time. + // is the current time of the DescribeDatasetGroup call. LastModificationTime *time.Time `type:"timestamp"` // The status of the dataset group. States include: @@ -4510,10 +4578,10 @@ type DescribeDatasetGroupOutput struct { // // * UPDATE_PENDING, UPDATE_IN_PROGRESS, UPDATE_FAILED // - // The UPDATE states apply when the UpdateDatasetGroup operation is called. + // The UPDATE states apply when you call the UpdateDatasetGroup operation. // - // The Status of the dataset group must be ACTIVE before creating a predictor - // using the dataset group. + // The Status of the dataset group must be ACTIVE before you can use the dataset + // group to create a predictor. Status *string `type:"string"` } @@ -4613,12 +4681,14 @@ type DescribeDatasetImportJobOutput struct { // When the dataset import job was created. CreationTime *time.Time `type:"timestamp"` - // The size of the dataset in gigabytes (GB) after completion of the import - // job. + // The size of the dataset in gigabytes (GB) after the import job has finished. DataSize *float64 `type:"double"` - // The location of the training data to import. The training data must be stored - // in an Amazon S3 bucket. + // The location of the training data to import and an AWS Identity and Access + // Management (IAM) role that Amazon Forecast can assume to access the data. + // + // If encryption is used, DataSource includes an AWS Key Management Service + // (KMS) key. DataSource *DataSource `type:"structure"` // The Amazon Resource Name (ARN) of the dataset that the training data was @@ -4634,13 +4704,14 @@ type DescribeDatasetImportJobOutput struct { // Statistical information about each field in the input data. FieldStatistics map[string]*Statistics `type:"map"` - // Dependent on the status as follows: + // The last time that the dataset was modified. The time depends on the status + // of the job, as follows: // - // * CREATE_PENDING - same as CreationTime + // * CREATE_PENDING - The same time as CreationTime. // - // * CREATE_IN_PROGRESS - the current timestamp + // * CREATE_IN_PROGRESS - The current timestamp. // - // * ACTIVE or CREATE_FAILED - when the job finished or failed + // * ACTIVE or CREATE_FAILED - When the job finished or failed. LastModificationTime *time.Time `type:"timestamp"` // If an error occurred, an informational message about the error. @@ -4657,13 +4728,14 @@ type DescribeDatasetImportJobOutput struct { // * DELETE_PENDING, DELETE_IN_PROGRESS, DELETE_FAILED Status *string `type:"string"` - // The format of timestamps in the dataset. Two formats are supported dependent - // on the DataFrequency specified when the dataset was created. + // The format of timestamps in the dataset. The format that you specify depends + // on the DataFrequency specified when the dataset was created. The following + // formats are supported // - // * "yyyy-MM-dd" For data frequencies: Y, M, W, and D + // * "yyyy-MM-dd" For the following data frequencies: Y, M, W, and D // - // * "yyyy-MM-dd HH:mm:ss" For data frequencies: H, 30min, 15min, and 1min; - // and optionally, for: Y, M, W, and D + // * "yyyy-MM-dd HH:mm:ss" For the following data frequencies: H, 30min, + // 15min, and 1min; and optionally, for: Y, M, W, and D TimestampFormat *string `type:"string"` } @@ -4804,17 +4876,18 @@ type DescribeDatasetOutput struct { // The dataset type. DatasetType *string `type:"string" enum:"DatasetType"` - // The dataset domain. + // The domain associated with the dataset. Domain *string `type:"string" enum:"Domain"` - // An AWS Key Management Service (KMS) key and the AWS Identity and Access Management - // (IAM) role that Amazon Forecast can assume to access the key. + // The AWS Key Management Service (KMS) key and the AWS Identity and Access + // Management (IAM) role that Amazon Forecast can assume to access the key. EncryptionConfig *EncryptionConfig `type:"structure"` - // When the dataset is created, LastModificationTime is the same as CreationTime. - // After a CreateDatasetImportJob operation is called, LastModificationTime - // is when the import job finished or failed. While data is being imported to - // the dataset, LastModificationTime is the current query time. + // When you create a dataset, LastModificationTime is the same as CreationTime. + // While data is being imported to the dataset, LastModificationTime is the + // current time of the DescribeDataset call. After a CreateDatasetImportJob + // operation has finished, LastModificationTime is when the import job completed + // or failed. LastModificationTime *time.Time `type:"timestamp"` // An array of SchemaAttribute objects that specify the dataset fields. Each @@ -4832,9 +4905,9 @@ type DescribeDatasetOutput struct { // * UPDATE_PENDING, UPDATE_IN_PROGRESS, UPDATE_FAILED // // The UPDATE states apply while data is imported to the dataset from a call - // to the CreateDatasetImportJob operation. During this time, the status reflects - // the status of the dataset import job. For example, when the import job status - // is CREATE_IN_PROGRESS, the status of the dataset is UPDATE_IN_PROGRESS. + // to the CreateDatasetImportJob operation and reflect the status of the dataset + // import job. For example, when the import job status is CREATE_IN_PROGRESS, + // the status of the dataset is UPDATE_IN_PROGRESS. // // The Status of the dataset must be ACTIVE before you can import training data. Status *string `type:"string"` @@ -4954,7 +5027,8 @@ type DescribeForecastExportJobOutput struct { // When the forecast export job was created. CreationTime *time.Time `type:"timestamp"` - // The path to the AWS S3 bucket where the forecast is exported. + // The path to the Amazon Simple Storage Service (Amazon S3) bucket where the + // forecast is exported. Destination *DataDestination `type:"structure"` // The Amazon Resource Name (ARN) of the exported forecast. @@ -4972,7 +5046,7 @@ type DescribeForecastExportJobOutput struct { // If an error occurred, an informational message about the error. Message *string `type:"string"` - // The status of the forecast export job. One of the following states: + // The status of the forecast export job. States include: // // * ACTIVE // @@ -4981,7 +5055,7 @@ type DescribeForecastExportJobOutput struct { // * DELETE_PENDING, DELETE_IN_PROGRESS, DELETE_FAILED // // The Status of the forecast export job must be ACTIVE before you can access - // the forecast in your Amazon S3 bucket. + // the forecast in your S3 bucket. Status *string `type:"string"` } @@ -5090,12 +5164,15 @@ type DescribeForecastOutput struct { // The ARN of the dataset group that provided the data used to train the predictor. DatasetGroupArn *string `type:"string"` - // The same forecast ARN as given in the request. + // The forecast ARN as specified in the request. ForecastArn *string `type:"string"` // The name of the forecast. ForecastName *string `min:"1" type:"string"` + // The quantiles at which proababilistic forecasts were generated. + ForecastTypes []*string `min:"1" type:"list"` + // Initially, the same as CreationTime (status is CREATE_PENDING). Updated when // inference (creating the forecast) starts (status changed to CREATE_IN_PROGRESS), // and when inference is complete (status changed to ACTIVE) or fails (status @@ -5155,6 +5232,12 @@ func (s *DescribeForecastOutput) SetForecastName(v string) *DescribeForecastOutp return s } +// SetForecastTypes sets the ForecastTypes field's value. +func (s *DescribeForecastOutput) SetForecastTypes(v []*string) *DescribeForecastOutput { + s.ForecastTypes = v + return s +} + // SetLastModificationTime sets the LastModificationTime field's value. func (s *DescribeForecastOutput) SetLastModificationTime(v time.Time) *DescribeForecastOutput { s.LastModificationTime = &v @@ -5230,7 +5313,7 @@ type DescribePredictorOutput struct { // When the model training task was created. CreationTime *time.Time `type:"timestamp"` - // An array of ARNs of the dataset import jobs used to import training data + // An array of the ARNs of the dataset import jobs used to import training data // for the predictor. DatasetImportJobArns []*string `type:"list"` @@ -5257,9 +5340,10 @@ type DescribePredictorOutput struct { // Describes the dataset group that contains the data to use to train the predictor. InputDataConfig *InputDataConfig `type:"structure"` - // Initially, the same as CreationTime (status is CREATE_PENDING). Updated when - // training starts (status changed to CREATE_IN_PROGRESS), and when training - // is complete (status changed to ACTIVE) or fails (status changed to CREATE_FAILED). + // Initially, the same as CreationTime (when the status is CREATE_PENDING). + // This value is updated when training starts (when the status changes to CREATE_IN_PROGRESS), + // and when training has completed (when the status changes to ACTIVE) or fails + // (when the status changes to CREATE_FAILED). LastModificationTime *time.Time `type:"timestamp"` // If an error occurred, an informational message about the error. @@ -5268,12 +5352,17 @@ type DescribePredictorOutput struct { // Whether the predictor is set to perform AutoML. PerformAutoML *bool `type:"boolean"` - // Whether the predictor is set to perform HPO. + // Whether the predictor is set to perform hyperparameter optimization (HPO). PerformHPO *bool `type:"boolean"` // The ARN of the predictor. PredictorArn *string `min:"1" type:"string"` + // Details on the the status and results of the backtests performed to evaluate + // the accuracy of the predictor. You specify the number of backtests to perform + // when you call the operation. + PredictorExecutionDetails *PredictorExecutionDetails `type:"structure"` + // The name of the predictor. PredictorName *string `min:"1" type:"string"` @@ -5287,12 +5376,14 @@ type DescribePredictorOutput struct { // // * UPDATE_PENDING, UPDATE_IN_PROGRESS, UPDATE_FAILED // - // The Status of the predictor must be ACTIVE before using the predictor to - // create a forecast. + // The Status of the predictor must be ACTIVE before you can use the predictor + // to create a forecast. Status *string `type:"string"` - // The training parameters to override for model training. The parameters that - // you can override are listed in the individual algorithms in aws-forecast-choosing-recipes. + // The default training parameters or overrides selected during model training. + // If using the AutoML algorithm or if HPO is turned on while using the DeepAR+ + // algorithms, the optimized values for the chosen hyperparameters are returned. + // For more information, see aws-forecast-choosing-recipes. TrainingParameters map[string]*string `type:"map"` } @@ -5396,6 +5487,12 @@ func (s *DescribePredictorOutput) SetPredictorArn(v string) *DescribePredictorOu return s } +// SetPredictorExecutionDetails sets the PredictorExecutionDetails field's value. +func (s *DescribePredictorOutput) SetPredictorExecutionDetails(v *PredictorExecutionDetails) *DescribePredictorOutput { + s.PredictorExecutionDetails = v + return s +} + // SetPredictorName sets the PredictorName field's value. func (s *DescribePredictorOutput) SetPredictorName(v string) *DescribePredictorOutput { s.PredictorName = &v @@ -5415,21 +5512,21 @@ func (s *DescribePredictorOutput) SetTrainingParameters(v map[string]*string) *D } // An AWS Key Management Service (KMS) key and an AWS Identity and Access Management -// (IAM) role that Amazon Forecast can assume to access the key. This object -// is optionally submitted in the CreateDataset and CreatePredictor requests. +// (IAM) role that Amazon Forecast can assume to access the key. You can specify +// this optional object in the CreateDataset and CreatePredictor requests. type EncryptionConfig struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of an AWS Key Management Service (KMS) key. + // The Amazon Resource Name (ARN) of the KMS key. // // KMSKeyArn is a required field KMSKeyArn *string `type:"string" required:"true"` - // The ARN of the AWS Identity and Access Management (IAM) role that Amazon - // Forecast can assume to access the AWS KMS key. + // The ARN of the IAM role that Amazon Forecast can assume to access the AWS + // KMS key. // - // Cross-account pass role is not allowed. If you pass a role that doesn't belong - // to your account, an InvalidInputException is thrown. + // Passing a role across AWS accounts is not allowed. If you pass a role that + // isn't in your account, you get an InvalidInputException error. // // RoleArn is a required field RoleArn *string `type:"string" required:"true"` @@ -5475,27 +5572,24 @@ func (s *EncryptionConfig) SetRoleArn(v string) *EncryptionConfig { // Parameters that define how to split a dataset into training data and testing // data, and the number of iterations to perform. These parameters are specified -// in the predefined algorithms and can be overridden in the CreatePredictor +// in the predefined algorithms but you can override them in the CreatePredictor // request. -// -// For example, suppose that you have a dataset with data collection frequency -// set to every day and you have 200 days worth of data (that is, 200 data points). -// Now suppose that you set the NumberOfBacktestWindows to 2 and the BackTestWindowOffset -// parameter to 20. The algorithm splits the data twice. The first time, the -// algorithm trains the model using the first 180 data points and uses the last -// 20 data points for evaluation. The second time, the algorithm trains the -// model using the first 160 data points and uses the last 40 data points for -// evaluation. type EvaluationParameters struct { _ struct{} `type:"structure"` // The point from the end of the dataset where you want to split the data for - // model training and evaluation. The value is specified as the number of data - // points. + // model training and testing (evaluation). Specify the value as the number + // of data points. The default is the value of the forecast horizon. BackTestWindowOffset + // can be used to mimic a past virtual forecast start date. This value must + // be greater than or equal to the forecast horizon and less than half of the + // TARGET_TIME_SERIES dataset length. + // + // ForecastHorizon <= BackTestWindowOffset < 1/2 * TARGET_TIME_SERIES dataset + // length BackTestWindowOffset *int64 `type:"integer"` - // The number of times to split the input data. The default is 1. The range - // is 1 through 5. + // The number of times to split the input data. The default is 1. Valid values + // are 1 through 5. NumberOfBacktestWindows *int64 `type:"integer"` } @@ -5578,16 +5672,16 @@ func (s *EvaluationResult) SetTestWindows(v []*WindowSummary) *EvaluationResult type Featurization struct { _ struct{} `type:"structure"` - // The name of the schema attribute specifying the data field to be featurized. - // In this release, only the target field of the TARGET_TIME_SERIES dataset - // type is supported. For example, for the RETAIL domain, the target is demand, - // and for the CUSTOM domain, the target is target_value. + // The name of the schema attribute that specifies the data field to be featurized. + // Only the target field of the TARGET_TIME_SERIES dataset type is supported. + // For example, for the RETAIL domain, the target is demand, and for the CUSTOM + // domain, the target is target_value. // // AttributeName is a required field AttributeName *string `min:"1" type:"string" required:"true"` - // An array FeaturizationMethod objects that specifies the feature transformation - // methods. For this release, the number of methods is limited to one. + // An array of one FeaturizationMethod object that specifies the feature transformation + // method. FeaturizationPipeline []*FeaturizationMethod `min:"1" type:"list"` } @@ -5649,7 +5743,7 @@ func (s *Featurization) SetFeaturizationPipeline(v []*FeaturizationMethod) *Feat // // You define featurization using the FeaturizationConfig object. You specify // an array of transformations, one for each field that you want to featurize. -// You then include the FeaturizationConfig in your CreatePredictor request. +// You then include the FeaturizationConfig object in your CreatePredictor request. // Amazon Forecast applies the featurization to the TARGET_TIME_SERIES dataset // before model training. // @@ -5660,7 +5754,7 @@ type FeaturizationConfig struct { _ struct{} `type:"structure"` // An array of featurization (transformation) information for the fields of - // a dataset. In this release, only a single featurization is supported. + // a dataset. Only a single featurization is supported. Featurizations []*Featurization `min:"1" type:"list"` // An array of dimension (field) names that specify how to group the generated @@ -5670,6 +5764,11 @@ type FeaturizationConfig struct { // all of your stores, and your dataset contains a store_id field. If you want // the sales forecast for each item by store, you would specify store_id as // the dimension. + // + // All forecast dimensions specified in the TARGET_TIME_SERIES dataset don't + // need to be specified in the CreatePredictor request. All forecast dimensions + // specified in the RELATED_TIME_SERIES dataset must be specified in the CreatePredictor + // request. ForecastDimensions []*string `min:"1" type:"list"` // The frequency of predictions in a forecast. @@ -5679,6 +5778,12 @@ type FeaturizationConfig struct { // 1min (1 minute). For example, "Y" indicates every year and "5min" indicates // every five minutes. // + // The frequency must be greater than or equal to the TARGET_TIME_SERIES dataset + // frequency. + // + // When a RELATED_TIME_SERIES dataset is provided, the frequency must be equal + // to the RELATED_TIME_SERIES dataset frequency. + // // ForecastFrequency is a required field ForecastFrequency *string `type:"string" required:"true"` } @@ -5740,12 +5845,12 @@ func (s *FeaturizationConfig) SetForecastFrequency(v string) *FeaturizationConfi return s } -// Provides information about a method that featurizes (transforms) a dataset +// Provides information about the method that featurizes (transforms) a dataset // field. The method is part of the FeaturizationPipeline of the Featurization -// object. If FeaturizationMethodParameters isn't specified, Amazon Forecast +// object. If you don't specify FeaturizationMethodParameters, Amazon Forecast // uses default parameters. // -// For example: +// The following is an example of how you specify a FeaturizationMethod object. // // { // @@ -5757,15 +5862,14 @@ func (s *FeaturizationConfig) SetForecastFrequency(v string) *FeaturizationConfi type FeaturizationMethod struct { _ struct{} `type:"structure"` - // The name of the method. In this release, "filling" is the only supported - // method. + // The name of the method. The "filling" method is the only supported method. // // FeaturizationMethodName is a required field FeaturizationMethodName *string `type:"string" required:"true" enum:"FeaturizationMethodName"` - // The method parameters (key-value pairs). Specify these to override the default - // values. The following list shows the parameters and their valid values. Bold - // signifies the default value. + // The method parameters (key-value pairs). Specify these parameters to override + // the default values. The following list shows the parameters and their valid + // values. Bold signifies the default value. // // * aggregation: sum, avg, first, min, max // @@ -5817,12 +5921,13 @@ func (s *FeaturizationMethod) SetFeaturizationMethodParameters(v map[string]*str // Describes a filter for choosing a subset of objects. Each filter consists // of a condition and a match statement. The condition is either IS or IS_NOT, -// which specifies whether to include or exclude, respectively, the objects -// that match the statement. The match statement consists of a key and a value. +// which specifies whether to include or exclude the objects that match the +// statement, respectively. The match statement consists of a key and a value. type Filter struct { _ struct{} `type:"structure"` - // The condition to apply. + // The condition to apply. To include the objects that match the statement, + // specify IS. To exclude matching objects, specify IS_NOT. // // Condition is a required field Condition *string `type:"string" required:"true" enum:"FilterConditionString"` @@ -5832,7 +5937,7 @@ type Filter struct { // Key is a required field Key *string `type:"string" required:"true"` - // A valid value for Key. + // The value to match. // // Value is a required field Value *string `type:"string" required:"true"` @@ -5894,7 +5999,8 @@ type ForecastExportJobSummary struct { // When the forecast export job was created. CreationTime *time.Time `type:"timestamp"` - // The path to the S3 bucket where the forecast is stored. + // The path to the Amazon Simple Storage Service (Amazon S3) bucket where the + // forecast is exported. Destination *DataDestination `type:"structure"` // The Amazon Resource Name (ARN) of the forecast export job. @@ -5909,7 +6015,7 @@ type ForecastExportJobSummary struct { // If an error occurred, an informational message about the error. Message *string `type:"string"` - // The status of the forecast export job. One of the following states: + // The status of the forecast export job. States include: // // * ACTIVE // @@ -5918,7 +6024,7 @@ type ForecastExportJobSummary struct { // * DELETE_PENDING, DELETE_IN_PROGRESS, DELETE_FAILED // // The Status of the forecast export job must be ACTIVE before you can access - // the forecast in your Amazon S3 bucket. + // the forecast in your S3 bucket. Status *string `type:"string"` } @@ -5976,7 +6082,7 @@ func (s *ForecastExportJobSummary) SetStatus(v string) *ForecastExportJobSummary // Provides a summary of the forecast properties used in the ListForecasts operation. // To get the complete set of properties, call the DescribeForecast operation, -// and provide the listed ForecastArn. +// and provide the ForecastArn that is listed in the summary. type ForecastSummary struct { _ struct{} `type:"structure"` @@ -6137,19 +6243,19 @@ func (s *GetAccuracyMetricsOutput) SetPredictorEvaluationResults(v []*Evaluation return s } -// Configuration information for a hyperparameter tuning job. This object is -// specified in the CreatePredictor request. +// Configuration information for a hyperparameter tuning job. You specify this +// object in the CreatePredictor request. // -// A hyperparameter is a parameter that governs the model training process and -// is set before training starts. This is as opposed to a model parameter that -// is determined during training. The values of the hyperparameters have an -// effect on the chosen model parameters. +// A hyperparameter is a parameter that governs the model training process. +// You set hyperparameters before training starts, unlike model parameters, +// which are determined during training. The values of the hyperparameters effect +// which values are chosen for the model parameters. // -// A hyperparameter tuning job is the process of choosing the optimum set of -// hyperparameter values that optimize a specified metric. This is accomplished -// by running many training jobs over a range of hyperparameter values. The -// optimum set of values is dependent on the algorithm, the training data, and -// the given metric objective. +// In a hyperparameter tuning job, Amazon Forecast chooses the set of hyperparameter +// values that optimize a specified metric. Forecast accomplishes this by running +// many training jobs over a range of hyperparameter values. The optimum set +// of values depends on the algorithm, the training data, and the specified +// metric objective. type HyperParameterTuningJobConfig struct { _ struct{} `type:"structure"` @@ -6189,7 +6295,7 @@ func (s *HyperParameterTuningJobConfig) SetParameterRanges(v *ParameterRanges) * } // The data used to train a predictor. The data includes a dataset group and -// any supplementary features. This object is specified in the CreatePredictor +// any supplementary features. You specify this object in the CreatePredictor // request. type InputDataConfig struct { _ struct{} `type:"structure"` @@ -6199,8 +6305,8 @@ type InputDataConfig struct { // DatasetGroupArn is a required field DatasetGroupArn *string `type:"string" required:"true"` - // An array of supplementary features. For this release, the only supported - // feature is a holiday calendar. + // An array of supplementary features. The only supported feature is a holiday + // calendar. SupplementaryFeatures []*SupplementaryFeature `min:"1" type:"list"` } @@ -6273,9 +6379,7 @@ type IntegerParameterRange struct { Name *string `min:"1" type:"string" required:"true"` // The scale that hyperparameter tuning uses to search the hyperparameter range. - // For information about choosing a hyperparameter scale, see Hyperparameter - // Scaling (http://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-define-ranges.html#scaling-type). - // One of the following values: + // Valid values: // // Auto // @@ -6291,8 +6395,7 @@ type IntegerParameterRange struct { // Hyperparameter tuning searches the values in the hyperparameter range by // using a logarithmic scale. // - // Logarithmic scaling works only for ranges that have only values greater than - // 0. + // Logarithmic scaling works only for ranges that have values greater than 0. // // ReverseLogarithmic // @@ -6300,6 +6403,10 @@ type IntegerParameterRange struct { // // Reverse logarithmic scaling works only for ranges that are entirely within // the range 0 <= x < 1.0. + // + // For information about choosing a hyperparameter scale, see Hyperparameter + // Scaling (http://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-define-ranges.html#scaling-type). + // One of the following values: ScalingType *string `type:"string" enum:"ScalingType"` } @@ -6359,6 +6466,175 @@ func (s *IntegerParameterRange) SetScalingType(v string) *IntegerParameterRange return s } +// We can't process the request because it includes an invalid value or a value +// that exceeds the valid range. +type InvalidInputException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidInputException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInputException) GoString() string { + return s.String() +} + +func newErrorInvalidInputException(v protocol.ResponseMetadata) error { + return &InvalidInputException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInputException) Code() string { + return "InvalidInputException" +} + +// Message returns the exception's message. +func (s InvalidInputException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInputException) OrigErr() error { + return nil +} + +func (s InvalidInputException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInputException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInputException) RequestID() string { + return s.respMetadata.RequestID +} + +// The token is not valid. Tokens expire after 24 hours. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNextTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// The limit on the number of resources per account has been exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListDatasetGroupsInput struct { _ struct{} `type:"structure"` @@ -6447,22 +6723,24 @@ type ListDatasetImportJobsInput struct { // An array of filters. For each filter, you provide a condition and a match // statement. The condition is either IS or IS_NOT, which specifies whether - // to include or exclude, respectively, from the list, the predictors that match - // the statement. The match statement consists of a key and a value. In this - // release, Name is the only valid key, which filters on the DatasetImportJobName - // property. + // to include or exclude the datasets that match the statement from the list, + // respectively. The match statement consists of a key and a value. // - // * Condition - IS or IS_NOT + // Filter properties // - // * Key - Name + // * Condition - The condition to apply. Valid values are IS and IS_NOT. + // To include the datasets that match the statement, specify IS. To exclude + // matching datasets, specify IS_NOT. // - // * Value - the value to match + // * Key - The name of the parameter to filter on. Valid values are DatasetArn + // and Status. // - // For example, to list all dataset import jobs named my_dataset_import_job, - // you would specify: + // * Value - The value to match. // - // "Filters": [ { "Condition": "IS", "Key": "Name", "Value": "my_dataset_import_job" - // } ] + // For example, to list all dataset import jobs whose status is ACTIVE, you + // specify the following filter: + // + // "Filters": [ { "Condition": "IS", "Key": "Status", "Value": "ACTIVE" } ] Filters []*Filter `type:"list"` // The number of items to return in the response. @@ -6649,21 +6927,24 @@ type ListForecastExportJobsInput struct { // An array of filters. For each filter, you provide a condition and a match // statement. The condition is either IS or IS_NOT, which specifies whether - // to include or exclude, respectively, from the list, the predictors that match - // the statement. The match statement consists of a key and a value. In this - // release, Name is the only valid key, which filters on the ForecastExportJobName - // property. + // to include or exclude the forecast export jobs that match the statement from + // the list, respectively. The match statement consists of a key and a value. + // + // Filter properties // - // * Condition - IS or IS_NOT + // * Condition - The condition to apply. Valid values are IS and IS_NOT. + // To include the forecast export jobs that match the statement, specify + // IS. To exclude matching forecast export jobs, specify IS_NOT. // - // * Key - Name + // * Key - The name of the parameter to filter on. Valid values are ForecastArn + // and Status. // - // * Value - the value to match + // * Value - The value to match. // - // For example, to list all forecast export jobs named my_forecast_export_job, - // you would specify: + // For example, to list all jobs that export a forecast named electricityforecast, + // specify the following filter: // - // "Filters": [ { "Condition": "IS", "Key": "Name", "Value": "my_forecast_export_job" + // "Filters": [ { "Condition": "IS", "Key": "ForecastArn", "Value": "arn:aws:forecast:us-west-2::forecast/electricityforecast" // } ] Filters []*Filter `type:"list"` @@ -6768,20 +7049,25 @@ type ListForecastsInput struct { // An array of filters. For each filter, you provide a condition and a match // statement. The condition is either IS or IS_NOT, which specifies whether - // to include or exclude, respectively, from the list, the predictors that match - // the statement. The match statement consists of a key and a value. In this - // release, Name is the only valid key, which filters on the ForecastName property. + // to include or exclude the forecasts that match the statement from the list, + // respectively. The match statement consists of a key and a value. // - // * Condition - IS or IS_NOT + // Filter properties // - // * Key - Name + // * Condition - The condition to apply. Valid values are IS and IS_NOT. + // To include the forecasts that match the statement, specify IS. To exclude + // matching forecasts, specify IS_NOT. // - // * Value - the value to match + // * Key - The name of the parameter to filter on. Valid values are DatasetGroupArn, + // PredictorArn, and Status. // - // For example, to list all forecasts named my_forecast, you would specify: + // * Value - The value to match. // - // "Filters": [ { "Condition": "IS", "Key": "Name", "Value": "my_forecast" } - // ] + // For example, to list all forecasts whose status is not ACTIVE, you would + // specify: + // + // "Filters": [ { "Condition": "IS_NOT", "Key": "Status", "Value": "ACTIVE" + // } ] Filters []*Filter `type:"list"` // The number of items to return in the response. @@ -6885,20 +7171,23 @@ type ListPredictorsInput struct { // An array of filters. For each filter, you provide a condition and a match // statement. The condition is either IS or IS_NOT, which specifies whether - // to include or exclude, respectively, from the list, the predictors that match - // the statement. The match statement consists of a key and a value. In this - // release, Name is the only valid key, which filters on the PredictorName property. + // to include or exclude the predictors that match the statement from the list, + // respectively. The match statement consists of a key and a value. // - // * Condition - IS or IS_NOT + // Filter properties // - // * Key - Name + // * Condition - The condition to apply. Valid values are IS and IS_NOT. + // To include the predictors that match the statement, specify IS. To exclude + // matching predictors, specify IS_NOT. // - // * Value - the value to match + // * Key - The name of the parameter to filter on. Valid values are DatasetGroupArn + // and Status. // - // For example, to list all predictors named my_predictor, you would specify: + // * Value - The value to match. // - // "Filters": [ { "Condition": "IS", "Key": "Name", "Value": "my_predictor" - // } ] + // For example, to list all predictors whose status is ACTIVE, you would specify: + // + // "Filters": [ { "Condition": "IS", "Key": "Status", "Value": "ACTIVE" } ] Filters []*Filter `type:"list"` // The number of items to return in the response. @@ -6997,8 +7286,8 @@ func (s *ListPredictorsOutput) SetPredictors(v []*PredictorSummary) *ListPredict return s } -// Provides metrics used to evaluate the performance of a predictor. This object -// is part of the WindowSummary object. +// Provides metrics that are used to evaluate the performance of a predictor. +// This object is part of the WindowSummary object. type Metrics struct { _ struct{} `type:"structure"` @@ -7127,7 +7416,70 @@ func (s *ParameterRanges) SetIntegerParameterRanges(v []*IntegerParameterRange) return s } -// Provides a summary of the predictor properties used in the ListPredictors +// The algorithm used to perform a backtest and the status of those tests. +type PredictorExecution struct { + _ struct{} `type:"structure"` + + // The ARN of the algorithm used to test the predictor. + AlgorithmArn *string `type:"string"` + + // An array of test windows used to evaluate the algorithm. The NumberOfBacktestWindows + // from the object determines the number of windows in the array. + TestWindows []*TestWindowSummary `type:"list"` +} + +// String returns the string representation +func (s PredictorExecution) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PredictorExecution) GoString() string { + return s.String() +} + +// SetAlgorithmArn sets the AlgorithmArn field's value. +func (s *PredictorExecution) SetAlgorithmArn(v string) *PredictorExecution { + s.AlgorithmArn = &v + return s +} + +// SetTestWindows sets the TestWindows field's value. +func (s *PredictorExecution) SetTestWindows(v []*TestWindowSummary) *PredictorExecution { + s.TestWindows = v + return s +} + +// Contains details on the backtests performed to evaluate the accuracy of the +// predictor. The tests are returned in descending order of accuracy, with the +// most accurate backtest appearing first. You specify the number of backtests +// to perform when you call the operation. +type PredictorExecutionDetails struct { + _ struct{} `type:"structure"` + + // An array of the backtests performed to evaluate the accuracy of the predictor + // against a particular algorithm. The NumberOfBacktestWindows from the object + // determines the number of windows in the array. + PredictorExecutions []*PredictorExecution `min:"1" type:"list"` +} + +// String returns the string representation +func (s PredictorExecutionDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PredictorExecutionDetails) GoString() string { + return s.String() +} + +// SetPredictorExecutions sets the PredictorExecutions field's value. +func (s *PredictorExecutionDetails) SetPredictorExecutions(v []*PredictorExecution) *PredictorExecutionDetails { + s.PredictorExecutions = v + return s +} + +// Provides a summary of the predictor properties that are used in the ListPredictors // operation. To get the complete set of properties, call the DescribePredictor // operation, and provide the listed PredictorArn. type PredictorSummary struct { @@ -7164,8 +7516,8 @@ type PredictorSummary struct { // // * UPDATE_PENDING, UPDATE_IN_PROGRESS, UPDATE_FAILED // - // The Status of the predictor must be ACTIVE before using the predictor to - // create a forecast. + // The Status of the predictor must be ACTIVE before you can use the predictor + // to create a forecast. Status *string `type:"string"` } @@ -7221,11 +7573,181 @@ func (s *PredictorSummary) SetStatus(v string) *PredictorSummary { return s } +// There is already a resource with this name. Try again with a different name. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource is in use. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// We can't find a resource with that Amazon Resource Name (ARN). Check the +// ARN and try again. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // The path to the file(s) in an Amazon Simple Storage Service (Amazon S3) bucket, // and an AWS Identity and Access Management (IAM) role that Amazon Forecast // can assume to access the file(s). Optionally, includes an AWS Key Management -// Service (KMS) key. This object is submitted in the CreateDatasetImportJob -// and CreateForecastExportJob requests. +// Service (KMS) key. This object is part of the DataSource object that is submitted +// in the CreateDatasetImportJob request, and part of the DataDestination object +// that is submitted in the CreateForecastExportJob request. type S3Config struct { _ struct{} `type:"structure"` @@ -7239,10 +7761,11 @@ type S3Config struct { Path *string `type:"string" required:"true"` // The ARN of the AWS Identity and Access Management (IAM) role that Amazon - // Forecast can assume to access the Amazon S3 bucket or file(s). + // Forecast can assume to access the Amazon S3 bucket or files. If you provide + // a value for the KMSKeyArn key, the role must allow access to the key. // - // Cross-account pass role is not allowed. If you pass a role that doesn't belong - // to your account, an InvalidInputException is thrown. + // Passing a role across AWS accounts is not allowed. If you pass a role that + // isn't in your account, you get an InvalidInputException error. // // RoleArn is a required field RoleArn *string `type:"string" required:"true"` @@ -7292,7 +7815,7 @@ func (s *S3Config) SetRoleArn(v string) *S3Config { return s } -// Defines the fields of a dataset. This object is specified in the CreateDataset +// Defines the fields of a dataset. You specify this object in the CreateDataset // request. type Schema struct { _ struct{} `type:"structure"` @@ -7337,7 +7860,7 @@ func (s *Schema) SetAttributes(v []*SchemaAttribute) *Schema { return s } -// An attribute of a schema, which defines a field of a dataset. A schema attribute +// An attribute of a schema, which defines a dataset field. A schema attribute // is required for every field in a dataset. The Schema object contains an array // of SchemaAttribute objects. type SchemaAttribute struct { @@ -7385,8 +7908,8 @@ func (s *SchemaAttribute) SetAttributeType(v string) *SchemaAttribute { return s } -// Provides statistics for each data field imported to an Amazon Forecast dataset -// with the CreateDatasetImportJob operation. +// Provides statistics for each data field imported into to an Amazon Forecast +// dataset with the CreateDatasetImportJob operation. type Statistics struct { _ struct{} `type:"structure"` @@ -7476,9 +7999,10 @@ func (s *Statistics) SetStddev(v float64) *Statistics { // Describes a supplementary feature of a dataset group. This object is part // of the InputDataConfig object. // -// For this release, the only supported feature is a holiday calendar. If the -// calendar is used, all data should belong to the same country as the calendar. -// For the calendar data, see http://jollyday.sourceforge.net/data.html (http://jollyday.sourceforge.net/data.html). +// The only supported feature is a holiday calendar. If you use the calendar, +// all data in the datasets should belong to the same country as the calendar. +// For the holiday calendar data, see the Jollyday (http://jollyday.sourceforge.net/data.html) +// web site. type SupplementaryFeature struct { _ struct{} `type:"structure"` @@ -7544,11 +8068,69 @@ func (s *SupplementaryFeature) SetValue(v string) *SupplementaryFeature { return s } +// The status, start time, and end time of a backtest, as well as a failure +// reason if applicable. +type TestWindowSummary struct { + _ struct{} `type:"structure"` + + // If the test failed, the reason why it failed. + Message *string `type:"string"` + + // The status of the test. Possible status values are: + // + // * ACTIVE + // + // * CREATE_IN_PROGRESS + // + // * CREATE_FAILED + Status *string `type:"string"` + + // The time at which the test ended. + TestWindowEnd *time.Time `type:"timestamp"` + + // The time at which the test began. + TestWindowStart *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s TestWindowSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TestWindowSummary) GoString() string { + return s.String() +} + +// SetMessage sets the Message field's value. +func (s *TestWindowSummary) SetMessage(v string) *TestWindowSummary { + s.Message = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *TestWindowSummary) SetStatus(v string) *TestWindowSummary { + s.Status = &v + return s +} + +// SetTestWindowEnd sets the TestWindowEnd field's value. +func (s *TestWindowSummary) SetTestWindowEnd(v time.Time) *TestWindowSummary { + s.TestWindowEnd = &v + return s +} + +// SetTestWindowStart sets the TestWindowStart field's value. +func (s *TestWindowSummary) SetTestWindowStart(v time.Time) *TestWindowSummary { + s.TestWindowStart = &v + return s +} + type UpdateDatasetGroupInput struct { _ struct{} `type:"structure"` - // An array of Amazon Resource Names (ARNs) of the datasets to add to the dataset - // group. + // An array of the Amazon Resource Names (ARNs) of the datasets to add to the + // dataset group. // // DatasetArns is a required field DatasetArns []*string `type:"list" required:"true"` @@ -7616,8 +8198,8 @@ func (s UpdateDatasetGroupOutput) GoString() string { type WeightedQuantileLoss struct { _ struct{} `type:"structure"` - // The difference between the predicted value and actual value over the quantile, - // weighted (normalized) by dividing by the sum over all quantiles. + // The difference between the predicted value and the actual value over the + // quantile, weighted (normalized) by dividing by the sum over all quantiles. LossValue *float64 `type:"double"` // The quantile. Quantiles divide a probability distribution into regions of @@ -7666,8 +8248,7 @@ type WindowSummary struct { // The number of data points within the window. ItemCount *int64 `type:"integer"` - // Provides metrics used to evaluate the performance of a predictor. This object - // is part of the WindowSummary object. + // Provides metrics used to evaluate the performance of a predictor. Metrics *Metrics `type:"structure"` // The timestamp that defines the end of the window. diff --git a/vendor/github.com/aws/aws-sdk-go/service/forecastservice/errors.go b/vendor/github.com/aws/aws-sdk-go/service/forecastservice/errors.go index 19eb82f7388..b60975e2ff7 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/forecastservice/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/forecastservice/errors.go @@ -2,6 +2,10 @@ package forecastservice +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInvalidInputException for service response error code @@ -20,14 +24,13 @@ const ( // ErrCodeLimitExceededException for service response error code // "LimitExceededException". // - // The limit on the number of requests per second has been exceeded. + // The limit on the number of resources per account has been exceeded. ErrCodeLimitExceededException = "LimitExceededException" // ErrCodeResourceAlreadyExistsException for service response error code // "ResourceAlreadyExistsException". // - // There is already a resource with that Amazon Resource Name (ARN). Try again - // with a different ARN. + // There is already a resource with this name. Try again with a different name. ErrCodeResourceAlreadyExistsException = "ResourceAlreadyExistsException" // ErrCodeResourceInUseException for service response error code @@ -43,3 +46,12 @@ const ( // ARN and try again. ErrCodeResourceNotFoundException = "ResourceNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InvalidInputException": newErrorInvalidInputException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "LimitExceededException": newErrorLimitExceededException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/forecastservice/service.go b/vendor/github.com/aws/aws-sdk-go/service/forecastservice/service.go index 2f1cd5c6fd5..55b1aaccd97 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/forecastservice/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/forecastservice/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "forecast" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "forecast" // ServiceID is a unique identifer of a specific service. + ServiceID = "forecast" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ForecastService client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ForecastService client from just a session. // svc := forecastservice.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *ForecastService { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "forecast" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ForecastService { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ForecastService { svc := &ForecastService{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-06-26", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/fsx/api.go b/vendor/github.com/aws/aws-sdk-go/service/fsx/api.go index a4a75ea94d0..eb676ca1590 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/fsx/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/fsx/api.go @@ -13,6 +13,107 @@ import ( "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) +const opCancelDataRepositoryTask = "CancelDataRepositoryTask" + +// CancelDataRepositoryTaskRequest generates a "aws/request.Request" representing the +// client's request for the CancelDataRepositoryTask operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CancelDataRepositoryTask for more information on using the CancelDataRepositoryTask +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CancelDataRepositoryTaskRequest method. +// req, resp := client.CancelDataRepositoryTaskRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/CancelDataRepositoryTask +func (c *FSx) CancelDataRepositoryTaskRequest(input *CancelDataRepositoryTaskInput) (req *request.Request, output *CancelDataRepositoryTaskOutput) { + op := &request.Operation{ + Name: opCancelDataRepositoryTask, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CancelDataRepositoryTaskInput{} + } + + output = &CancelDataRepositoryTaskOutput{} + req = c.newRequest(op, input, output) + return +} + +// CancelDataRepositoryTask API operation for Amazon FSx. +// +// Cancels an existing Amazon FSx for Lustre data repository task if that task +// is in either the PENDING or EXECUTING state. When you cancel a task, Amazon +// FSx does the following. +// +// * Any files that FSx has already exported are not reverted. +// +// * FSx continues to export any files that are "in-flight" when the cancel +// operation is received. +// +// * FSx does not export any files that have not yet been exported. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon FSx's +// API operation CancelDataRepositoryTask for usage and error information. +// +// Returned Error Types: +// * BadRequest +// A generic error indicating a failure with a client request. +// +// * UnsupportedOperation +// The requested operation is not supported for this resource or API. +// +// * DataRepositoryTaskNotFound +// The data repository task or tasks you specified could not be found. +// +// * DataRepositoryTaskEnded +// The data repository task could not be canceled because the task has already +// ended. +// +// * InternalServerError +// A generic error indicating a server-side failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/CancelDataRepositoryTask +func (c *FSx) CancelDataRepositoryTask(input *CancelDataRepositoryTaskInput) (*CancelDataRepositoryTaskOutput, error) { + req, out := c.CancelDataRepositoryTaskRequest(input) + return out, req.Send() +} + +// CancelDataRepositoryTaskWithContext is the same as CancelDataRepositoryTask with the addition of +// the ability to pass a context and additional request options. +// +// See CancelDataRepositoryTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *FSx) CancelDataRepositoryTaskWithContext(ctx aws.Context, input *CancelDataRepositoryTaskInput, opts ...request.Option) (*CancelDataRepositoryTaskOutput, error) { + req, out := c.CancelDataRepositoryTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateBackup = "CreateBackup" // CreateBackupRequest generates a "aws/request.Request" representing the @@ -92,30 +193,30 @@ func (c *FSx) CreateBackupRequest(input *CreateBackupInput) (req *request.Reques // See the AWS API reference guide for Amazon FSx's // API operation CreateBackup for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" +// Returned Error Types: +// * BadRequest // A generic error indicating a failure with a client request. // -// * ErrCodeUnsupportedOperation "UnsupportedOperation" -// An error occured. +// * UnsupportedOperation +// The requested operation is not supported for this resource or API. // -// * ErrCodeFileSystemNotFound "FileSystemNotFound" +// * FileSystemNotFound // No Amazon FSx file systems were found based upon supplied parameters. // -// * ErrCodeBackupInProgress "BackupInProgress" +// * BackupInProgress // Another backup is already under way. Wait for completion before initiating // additional backups of this file system. // -// * ErrCodeIncompatibleParameterError "IncompatibleParameterError" +// * IncompatibleParameterError // The error returned when a second request is received with the same client // request token but different parameters settings. A client request token should // always uniquely identify a single request. // -// * ErrCodeServiceLimitExceeded "ServiceLimitExceeded" +// * ServiceLimitExceeded // An error indicating that a particular service limit was exceeded. You can // increase some service limits by contacting AWS Support. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // A generic error indicating a server-side failure. // // See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/CreateBackup @@ -140,6 +241,116 @@ func (c *FSx) CreateBackupWithContext(ctx aws.Context, input *CreateBackupInput, return out, req.Send() } +const opCreateDataRepositoryTask = "CreateDataRepositoryTask" + +// CreateDataRepositoryTaskRequest generates a "aws/request.Request" representing the +// client's request for the CreateDataRepositoryTask operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateDataRepositoryTask for more information on using the CreateDataRepositoryTask +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateDataRepositoryTaskRequest method. +// req, resp := client.CreateDataRepositoryTaskRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/CreateDataRepositoryTask +func (c *FSx) CreateDataRepositoryTaskRequest(input *CreateDataRepositoryTaskInput) (req *request.Request, output *CreateDataRepositoryTaskOutput) { + op := &request.Operation{ + Name: opCreateDataRepositoryTask, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateDataRepositoryTaskInput{} + } + + output = &CreateDataRepositoryTaskOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateDataRepositoryTask API operation for Amazon FSx. +// +// Creates an Amazon FSx for Lustre data repository task. You use data repository +// tasks to perform bulk operations between your Amazon FSx file system and +// its linked data repository. An example of a data repository task is exporting +// any data and metadata changes, including POSIX metadata, to files, directories, +// and symbolic links (symlinks) from your FSx file system to its linked data +// repository. A CreateDataRepositoryTask operation will fail if a data repository +// is not linked to the FSx file system. To learn more about data repository +// tasks, see Using Data Repository Tasks (https://docs.aws.amazon.com/fsx/latest/LustreGuide/data-repository-tasks.html). +// To learn more about linking a data repository to your file system, see Step +// 1: Create Your Amazon FSx for Lustre File System (https://docs.aws.amazon.com/fsx/latest/LustreGuide/getting-started-step1.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 FSx's +// API operation CreateDataRepositoryTask for usage and error information. +// +// Returned Error Types: +// * BadRequest +// A generic error indicating a failure with a client request. +// +// * UnsupportedOperation +// The requested operation is not supported for this resource or API. +// +// * FileSystemNotFound +// No Amazon FSx file systems were found based upon supplied parameters. +// +// * IncompatibleParameterError +// The error returned when a second request is received with the same client +// request token but different parameters settings. A client request token should +// always uniquely identify a single request. +// +// * ServiceLimitExceeded +// An error indicating that a particular service limit was exceeded. You can +// increase some service limits by contacting AWS Support. +// +// * InternalServerError +// A generic error indicating a server-side failure. +// +// * DataRepositoryTaskExecuting +// An existing data repository task is currently executing on the file system. +// Wait until the existing task has completed, then create the new task. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/CreateDataRepositoryTask +func (c *FSx) CreateDataRepositoryTask(input *CreateDataRepositoryTaskInput) (*CreateDataRepositoryTaskOutput, error) { + req, out := c.CreateDataRepositoryTaskRequest(input) + return out, req.Send() +} + +// CreateDataRepositoryTaskWithContext is the same as CreateDataRepositoryTask with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDataRepositoryTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *FSx) CreateDataRepositoryTaskWithContext(ctx aws.Context, input *CreateDataRepositoryTaskInput, opts ...request.Option) (*CreateDataRepositoryTaskOutput, error) { + req, out := c.CreateDataRepositoryTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateFileSystem = "CreateFileSystem" // CreateFileSystemRequest generates a "aws/request.Request" representing the @@ -221,25 +432,25 @@ func (c *FSx) CreateFileSystemRequest(input *CreateFileSystemInput) (req *reques // See the AWS API reference guide for Amazon FSx's // API operation CreateFileSystem for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" +// Returned Error Types: +// * BadRequest // A generic error indicating a failure with a client request. // -// * ErrCodeActiveDirectoryError "ActiveDirectoryError" +// * ActiveDirectoryError // An Active Directory error. // -// * ErrCodeIncompatibleParameterError "IncompatibleParameterError" +// * IncompatibleParameterError // The error returned when a second request is received with the same client // request token but different parameters settings. A client request token should // always uniquely identify a single request. // -// * ErrCodeInvalidImportPath "InvalidImportPath" +// * InvalidImportPath // The path provided for data repository import isn't valid. // -// * ErrCodeInvalidExportPath "InvalidExportPath" +// * InvalidExportPath // The path provided for data repository export isn't valid. // -// * ErrCodeInvalidNetworkSettings "InvalidNetworkSettings" +// * InvalidNetworkSettings // One or more network settings specified in the request are invalid. InvalidVpcId // means that the ID passed for the virtual private cloud (VPC) is invalid. // InvalidSubnetIds returns the list of IDs for subnets that are either invalid @@ -247,15 +458,19 @@ func (c *FSx) CreateFileSystemRequest(input *CreateFileSystemInput) (req *reques // of IDs for security groups that are either invalid or not part of the VPC // specified. // -// * ErrCodeServiceLimitExceeded "ServiceLimitExceeded" +// * InvalidPerUnitStorageThroughput +// An invalid value for PerUnitStorageThroughput was provided. Please create +// your file system again, using a valid value. +// +// * ServiceLimitExceeded // An error indicating that a particular service limit was exceeded. You can // increase some service limits by contacting AWS Support. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // A generic error indicating a server-side failure. // -// * ErrCodeMissingFileSystemConfiguration "MissingFileSystemConfiguration" -// File system configuration is required for this operation. +// * MissingFileSystemConfiguration +// A file system configuration is required for this operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/CreateFileSystem func (c *FSx) CreateFileSystem(input *CreateFileSystemInput) (*CreateFileSystemOutput, error) { @@ -362,19 +577,19 @@ func (c *FSx) CreateFileSystemFromBackupRequest(input *CreateFileSystemFromBacku // See the AWS API reference guide for Amazon FSx's // API operation CreateFileSystemFromBackup for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" +// Returned Error Types: +// * BadRequest // A generic error indicating a failure with a client request. // -// * ErrCodeActiveDirectoryError "ActiveDirectoryError" +// * ActiveDirectoryError // An Active Directory error. // -// * ErrCodeIncompatibleParameterError "IncompatibleParameterError" +// * IncompatibleParameterError // The error returned when a second request is received with the same client // request token but different parameters settings. A client request token should // always uniquely identify a single request. // -// * ErrCodeInvalidNetworkSettings "InvalidNetworkSettings" +// * InvalidNetworkSettings // One or more network settings specified in the request are invalid. InvalidVpcId // means that the ID passed for the virtual private cloud (VPC) is invalid. // InvalidSubnetIds returns the list of IDs for subnets that are either invalid @@ -382,18 +597,18 @@ func (c *FSx) CreateFileSystemFromBackupRequest(input *CreateFileSystemFromBacku // of IDs for security groups that are either invalid or not part of the VPC // specified. // -// * ErrCodeServiceLimitExceeded "ServiceLimitExceeded" +// * ServiceLimitExceeded // An error indicating that a particular service limit was exceeded. You can // increase some service limits by contacting AWS Support. // -// * ErrCodeBackupNotFound "BackupNotFound" +// * BackupNotFound // No Amazon FSx backups were found based upon the supplied parameters. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // A generic error indicating a server-side failure. // -// * ErrCodeMissingFileSystemConfiguration "MissingFileSystemConfiguration" -// File system configuration is required for this operation. +// * MissingFileSystemConfiguration +// A file system configuration is required for this operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/CreateFileSystemFromBackup func (c *FSx) CreateFileSystemFromBackup(input *CreateFileSystemFromBackupInput) (*CreateFileSystemFromBackupOutput, error) { @@ -477,26 +692,26 @@ func (c *FSx) DeleteBackupRequest(input *DeleteBackupInput) (req *request.Reques // See the AWS API reference guide for Amazon FSx's // API operation DeleteBackup for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" +// Returned Error Types: +// * BadRequest // A generic error indicating a failure with a client request. // -// * ErrCodeBackupInProgress "BackupInProgress" +// * BackupInProgress // Another backup is already under way. Wait for completion before initiating // additional backups of this file system. // -// * ErrCodeBackupNotFound "BackupNotFound" +// * BackupNotFound // No Amazon FSx backups were found based upon the supplied parameters. // -// * ErrCodeBackupRestoring "BackupRestoring" +// * BackupRestoring // You can't delete a backup while it's being used to restore a file system. // -// * ErrCodeIncompatibleParameterError "IncompatibleParameterError" +// * IncompatibleParameterError // The error returned when a second request is received with the same client // request token but different parameters settings. A client request token should // always uniquely identify a single request. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // A generic error indicating a server-side failure. // // See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/DeleteBackup @@ -579,6 +794,9 @@ func (c *FSx) DeleteFileSystemRequest(input *DeleteFileSystemInput) (req *reques // the file system ID for a deleted file system, the DescribeFileSystems returns // a FileSystemNotFound error. // +// Deleting an Amazon FSx for Lustre file system will fail with a 400 BadRequest +// if a data repository task is in a PENDING or EXECUTING state. +// // The data in a deleted file system is also deleted and can't be recovered // by any means. // @@ -589,23 +807,23 @@ func (c *FSx) DeleteFileSystemRequest(input *DeleteFileSystemInput) (req *reques // See the AWS API reference guide for Amazon FSx's // API operation DeleteFileSystem for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" +// Returned Error Types: +// * BadRequest // A generic error indicating a failure with a client request. // -// * ErrCodeIncompatibleParameterError "IncompatibleParameterError" +// * IncompatibleParameterError // The error returned when a second request is received with the same client // request token but different parameters settings. A client request token should // always uniquely identify a single request. // -// * ErrCodeFileSystemNotFound "FileSystemNotFound" +// * FileSystemNotFound // No Amazon FSx file systems were found based upon supplied parameters. // -// * ErrCodeServiceLimitExceeded "ServiceLimitExceeded" +// * ServiceLimitExceeded // An error indicating that a particular service limit was exceeded. You can // increase some service limits by contacting AWS Support. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // A generic error indicating a server-side failure. // // See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/DeleteFileSystem @@ -712,17 +930,17 @@ func (c *FSx) DescribeBackupsRequest(input *DescribeBackupsInput) (req *request. // See the AWS API reference guide for Amazon FSx's // API operation DescribeBackups for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" +// Returned Error Types: +// * BadRequest // A generic error indicating a failure with a client request. // -// * ErrCodeFileSystemNotFound "FileSystemNotFound" +// * FileSystemNotFound // No Amazon FSx file systems were found based upon supplied parameters. // -// * ErrCodeBackupNotFound "BackupNotFound" +// * BackupNotFound // No Amazon FSx backups were found based upon the supplied parameters. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // A generic error indicating a server-side failure. // // See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/DescribeBackups @@ -790,10 +1008,169 @@ func (c *FSx) DescribeBackupsPagesWithContext(ctx aws.Context, input *DescribeBa }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeBackupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeBackupsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeDataRepositoryTasks = "DescribeDataRepositoryTasks" + +// DescribeDataRepositoryTasksRequest generates a "aws/request.Request" representing the +// client's request for the DescribeDataRepositoryTasks operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeDataRepositoryTasks for more information on using the DescribeDataRepositoryTasks +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeDataRepositoryTasksRequest method. +// req, resp := client.DescribeDataRepositoryTasksRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/DescribeDataRepositoryTasks +func (c *FSx) DescribeDataRepositoryTasksRequest(input *DescribeDataRepositoryTasksInput) (req *request.Request, output *DescribeDataRepositoryTasksOutput) { + op := &request.Operation{ + Name: opDescribeDataRepositoryTasks, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeDataRepositoryTasksInput{} + } + + output = &DescribeDataRepositoryTasksOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeDataRepositoryTasks API operation for Amazon FSx. +// +// Returns the description of specific Amazon FSx for Lustre data repository +// tasks, if one or more TaskIds values are provided in the request, or if filters +// are used in the request. You can use filters to narrow the response to include +// just tasks for specific file systems, or tasks in a specific lifecycle state. +// Otherwise, it returns all data repository tasks owned by your AWS account +// in the AWS Region of the endpoint that you're calling. +// +// When retrieving all tasks, you can paginate the response by using the optional +// MaxResults parameter to limit the number of tasks returned in a response. +// If more tasks remain, Amazon FSx returns a NextToken value in the response. +// In this case, send a later request with the NextToken request parameter set +// to the value of NextToken from the last 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 FSx's +// API operation DescribeDataRepositoryTasks for usage and error information. +// +// Returned Error Types: +// * BadRequest +// A generic error indicating a failure with a client request. +// +// * FileSystemNotFound +// No Amazon FSx file systems were found based upon supplied parameters. +// +// * DataRepositoryTaskNotFound +// The data repository task or tasks you specified could not be found. +// +// * InternalServerError +// A generic error indicating a server-side failure. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/DescribeDataRepositoryTasks +func (c *FSx) DescribeDataRepositoryTasks(input *DescribeDataRepositoryTasksInput) (*DescribeDataRepositoryTasksOutput, error) { + req, out := c.DescribeDataRepositoryTasksRequest(input) + return out, req.Send() +} + +// DescribeDataRepositoryTasksWithContext is the same as DescribeDataRepositoryTasks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDataRepositoryTasks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *FSx) DescribeDataRepositoryTasksWithContext(ctx aws.Context, input *DescribeDataRepositoryTasksInput, opts ...request.Option) (*DescribeDataRepositoryTasksOutput, error) { + req, out := c.DescribeDataRepositoryTasksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeDataRepositoryTasksPages iterates over the pages of a DescribeDataRepositoryTasks operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeDataRepositoryTasks 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 DescribeDataRepositoryTasks operation. +// pageNum := 0 +// err := client.DescribeDataRepositoryTasksPages(params, +// func(page *fsx.DescribeDataRepositoryTasksOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *FSx) DescribeDataRepositoryTasksPages(input *DescribeDataRepositoryTasksInput, fn func(*DescribeDataRepositoryTasksOutput, bool) bool) error { + return c.DescribeDataRepositoryTasksPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeDataRepositoryTasksPagesWithContext same as DescribeDataRepositoryTasksPages 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 *FSx) DescribeDataRepositoryTasksPagesWithContext(ctx aws.Context, input *DescribeDataRepositoryTasksInput, fn func(*DescribeDataRepositoryTasksOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeDataRepositoryTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDataRepositoryTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeDataRepositoryTasksOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -879,14 +1256,14 @@ func (c *FSx) DescribeFileSystemsRequest(input *DescribeFileSystemsInput) (req * // See the AWS API reference guide for Amazon FSx's // API operation DescribeFileSystems for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" +// Returned Error Types: +// * BadRequest // A generic error indicating a failure with a client request. // -// * ErrCodeFileSystemNotFound "FileSystemNotFound" +// * FileSystemNotFound // No Amazon FSx file systems were found based upon supplied parameters. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // A generic error indicating a server-side failure. // // See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/DescribeFileSystems @@ -954,10 +1331,12 @@ func (c *FSx) DescribeFileSystemsPagesWithContext(ctx aws.Context, input *Descri }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeFileSystemsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeFileSystemsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1035,21 +1414,21 @@ func (c *FSx) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req * // See the AWS API reference guide for Amazon FSx's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" +// Returned Error Types: +// * BadRequest // A generic error indicating a failure with a client request. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // A generic error indicating a server-side failure. // -// * ErrCodeResourceNotFound "ResourceNotFound" +// * ResourceNotFound // The resource specified by the Amazon Resource Name (ARN) can't be found. // -// * ErrCodeNotServiceResourceError "NotServiceResourceError" +// * NotServiceResourceError // The resource specified for the tagging operation is not a resource type owned // by Amazon FSx. Use the API of the relevant service to perform the operation. // -// * ErrCodeResourceDoesNotSupportTagging "ResourceDoesNotSupportTagging" +// * ResourceDoesNotSupportTagging // The resource specified does not support tagging. // // See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/ListTagsForResource @@ -1128,21 +1507,21 @@ func (c *FSx) TagResourceRequest(input *TagResourceInput) (req *request.Request, // See the AWS API reference guide for Amazon FSx's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" +// Returned Error Types: +// * BadRequest // A generic error indicating a failure with a client request. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // A generic error indicating a server-side failure. // -// * ErrCodeResourceNotFound "ResourceNotFound" +// * ResourceNotFound // The resource specified by the Amazon Resource Name (ARN) can't be found. // -// * ErrCodeNotServiceResourceError "NotServiceResourceError" +// * NotServiceResourceError // The resource specified for the tagging operation is not a resource type owned // by Amazon FSx. Use the API of the relevant service to perform the operation. // -// * ErrCodeResourceDoesNotSupportTagging "ResourceDoesNotSupportTagging" +// * ResourceDoesNotSupportTagging // The resource specified does not support tagging. // // See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/TagResource @@ -1221,21 +1600,21 @@ func (c *FSx) UntagResourceRequest(input *UntagResourceInput) (req *request.Requ // See the AWS API reference guide for Amazon FSx's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" +// Returned Error Types: +// * BadRequest // A generic error indicating a failure with a client request. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // A generic error indicating a server-side failure. // -// * ErrCodeResourceNotFound "ResourceNotFound" +// * ResourceNotFound // The resource specified by the Amazon Resource Name (ARN) can't be found. // -// * ErrCodeNotServiceResourceError "NotServiceResourceError" +// * NotServiceResourceError // The resource specified for the tagging operation is not a resource type owned // by Amazon FSx. Use the API of the relevant service to perform the operation. // -// * ErrCodeResourceDoesNotSupportTagging "ResourceDoesNotSupportTagging" +// * ResourceDoesNotSupportTagging // The resource specified does not support tagging. // // See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/UntagResource @@ -1313,26 +1692,26 @@ func (c *FSx) UpdateFileSystemRequest(input *UpdateFileSystemInput) (req *reques // See the AWS API reference guide for Amazon FSx's // API operation UpdateFileSystem for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequest "BadRequest" +// Returned Error Types: +// * BadRequest // A generic error indicating a failure with a client request. // -// * ErrCodeUnsupportedOperation "UnsupportedOperation" -// An error occured. +// * UnsupportedOperation +// The requested operation is not supported for this resource or API. // -// * ErrCodeIncompatibleParameterError "IncompatibleParameterError" +// * IncompatibleParameterError // The error returned when a second request is received with the same client // request token but different parameters settings. A client request token should // always uniquely identify a single request. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // A generic error indicating a server-side failure. // -// * ErrCodeFileSystemNotFound "FileSystemNotFound" +// * FileSystemNotFound // No Amazon FSx file systems were found based upon supplied parameters. // -// * ErrCodeMissingFileSystemConfiguration "MissingFileSystemConfiguration" -// File system configuration is required for this operation. +// * MissingFileSystemConfiguration +// A file system configuration is required for this operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/fsx-2018-03-01/UpdateFileSystem func (c *FSx) UpdateFileSystem(input *UpdateFileSystemInput) (*UpdateFileSystemOutput, error) { @@ -1366,7 +1745,7 @@ type ActiveDirectoryBackupAttributes struct { ActiveDirectoryId *string `min:"12" type:"string"` // The fully qualified domain name of the self-managed AD directory. - DomainName *string `type:"string"` + DomainName *string `min:"1" type:"string"` } // String returns the string representation @@ -1391,20 +1770,85 @@ func (s *ActiveDirectoryBackupAttributes) SetDomainName(v string) *ActiveDirecto return s } -// A backup of an Amazon FSx for Windows File Server file system. You can create -// a new file system from a backup to protect against data loss. -type Backup struct { - _ struct{} `type:"structure"` +// An Active Directory error. +type ActiveDirectoryError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The ID of the backup. + // The directory ID of the directory that an error pertains to. // - // BackupId is a required field - BackupId *string `min:"12" type:"string" required:"true"` + // ActiveDirectoryId is a required field + ActiveDirectoryId *string `min:"12" type:"string" required:"true"` - // The time when a particular backup was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` + + // The type of Active Directory error. + Type *string `type:"string" enum:"ActiveDirectoryErrorType"` +} + +// String returns the string representation +func (s ActiveDirectoryError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ActiveDirectoryError) GoString() string { + return s.String() +} + +func newErrorActiveDirectoryError(v protocol.ResponseMetadata) error { + return &ActiveDirectoryError{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ActiveDirectoryError) Code() string { + return "ActiveDirectoryError" +} + +// Message returns the exception's message. +func (s ActiveDirectoryError) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ActiveDirectoryError) OrigErr() error { + return nil +} + +func (s ActiveDirectoryError) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ActiveDirectoryError) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ActiveDirectoryError) RequestID() string { + return s.respMetadata.RequestID +} + +// A backup of an Amazon FSx for Windows File Server file system. You can create +// a new file system from a backup to protect against data loss. +type Backup struct { + _ struct{} `type:"structure"` + + // The ID of the backup. + // + // BackupId is a required field + BackupId *string `min:"12" type:"string" required:"true"` + + // The time when a particular backup was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` // The configuration of the self-managed Microsoft Active Directory (AD) to // which the Windows File Server instance is joined. @@ -1420,7 +1864,8 @@ type Backup struct { FileSystem *FileSystem `type:"structure" required:"true"` // The ID of the AWS Key Management Service (AWS KMS) key used to encrypt this - // backup's data. + // backup of the Amazon FSx for Windows file system's data at rest. Amazon FSx + // for Lustre does not support KMS encryption. KmsKeyId *string `min:"1" type:"string"` // The lifecycle status of the backup. @@ -1543,6 +1988,415 @@ func (s *BackupFailureDetails) SetMessage(v string) *BackupFailureDetails { return s } +// Another backup is already under way. Wait for completion before initiating +// additional backups of this file system. +type BackupInProgress struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s BackupInProgress) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BackupInProgress) GoString() string { + return s.String() +} + +func newErrorBackupInProgress(v protocol.ResponseMetadata) error { + return &BackupInProgress{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BackupInProgress) Code() string { + return "BackupInProgress" +} + +// Message returns the exception's message. +func (s BackupInProgress) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BackupInProgress) OrigErr() error { + return nil +} + +func (s BackupInProgress) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BackupInProgress) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BackupInProgress) RequestID() string { + return s.respMetadata.RequestID +} + +// No Amazon FSx backups were found based upon the supplied parameters. +type BackupNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s BackupNotFound) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BackupNotFound) GoString() string { + return s.String() +} + +func newErrorBackupNotFound(v protocol.ResponseMetadata) error { + return &BackupNotFound{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BackupNotFound) Code() string { + return "BackupNotFound" +} + +// Message returns the exception's message. +func (s BackupNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BackupNotFound) OrigErr() error { + return nil +} + +func (s BackupNotFound) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BackupNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BackupNotFound) RequestID() string { + return s.respMetadata.RequestID +} + +// You can't delete a backup while it's being used to restore a file system. +type BackupRestoring struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The ID of a file system being restored from the backup. + FileSystemId *string `min:"11" type:"string"` + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s BackupRestoring) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BackupRestoring) GoString() string { + return s.String() +} + +func newErrorBackupRestoring(v protocol.ResponseMetadata) error { + return &BackupRestoring{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BackupRestoring) Code() string { + return "BackupRestoring" +} + +// Message returns the exception's message. +func (s BackupRestoring) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BackupRestoring) OrigErr() error { + return nil +} + +func (s BackupRestoring) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BackupRestoring) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BackupRestoring) RequestID() string { + return s.respMetadata.RequestID +} + +// A generic error indicating a failure with a client request. +type BadRequest struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s BadRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequest) GoString() string { + return s.String() +} + +func newErrorBadRequest(v protocol.ResponseMetadata) error { + return &BadRequest{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequest) Code() string { + return "BadRequest" +} + +// Message returns the exception's message. +func (s BadRequest) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequest) OrigErr() error { + return nil +} + +func (s BadRequest) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequest) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequest) RequestID() string { + return s.respMetadata.RequestID +} + +// Cancels a data repository task. +type CancelDataRepositoryTaskInput struct { + _ struct{} `type:"structure"` + + // Specifies the data repository task to cancel. + // + // TaskId is a required field + TaskId *string `min:"12" type:"string" required:"true"` +} + +// String returns the string representation +func (s CancelDataRepositoryTaskInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelDataRepositoryTaskInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CancelDataRepositoryTaskInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CancelDataRepositoryTaskInput"} + if s.TaskId == nil { + invalidParams.Add(request.NewErrParamRequired("TaskId")) + } + if s.TaskId != nil && len(*s.TaskId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("TaskId", 12)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTaskId sets the TaskId field's value. +func (s *CancelDataRepositoryTaskInput) SetTaskId(v string) *CancelDataRepositoryTaskInput { + s.TaskId = &v + return s +} + +type CancelDataRepositoryTaskOutput struct { + _ struct{} `type:"structure"` + + // The lifecycle status of the data repository task, as follows: + // + // * PENDING - Amazon FSx has not started the task. + // + // * EXECUTING - Amazon FSx is processing the task. + // + // * FAILED - Amazon FSx was not able to complete the task. For example, + // there may be files the task failed to process. The DataRepositoryTaskFailureDetails + // property provides more information about task failures. + // + // * SUCCEEDED - FSx completed the task successfully. + // + // * CANCELED - Amazon FSx canceled the task and it did not complete. + // + // * CANCELING - FSx is in process of canceling the task. + Lifecycle *string `type:"string" enum:"DataRepositoryTaskLifecycle"` + + // The ID of the task being canceled. + TaskId *string `min:"12" type:"string"` +} + +// String returns the string representation +func (s CancelDataRepositoryTaskOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelDataRepositoryTaskOutput) GoString() string { + return s.String() +} + +// SetLifecycle sets the Lifecycle field's value. +func (s *CancelDataRepositoryTaskOutput) SetLifecycle(v string) *CancelDataRepositoryTaskOutput { + s.Lifecycle = &v + return s +} + +// SetTaskId sets the TaskId field's value. +func (s *CancelDataRepositoryTaskOutput) SetTaskId(v string) *CancelDataRepositoryTaskOutput { + s.TaskId = &v + return s +} + +// Provides a report detailing the data repository task results of the files +// processed that match the criteria specified in the report Scope parameter. +// FSx delivers the report to the file system's linked data repository in Amazon +// S3, using the path specified in the report Path parameter. You can specify +// whether or not a report gets generated for a task using the Enabled parameter. +type CompletionReport struct { + _ struct{} `type:"structure"` + + // Set Enabled to True to generate a CompletionReport when the task completes. + // If set to true, then you need to provide a report Scope, Path, and Format. + // Set Enabled to False if you do not want a CompletionReport generated when + // the task completes. + // + // Enabled is a required field + Enabled *bool `type:"boolean" required:"true"` + + // Required if Enabled is set to true. Specifies the format of the CompletionReport. + // REPORT_CSV_20191124 is the only format currently supported. When Format is + // set to REPORT_CSV_20191124, the CompletionReport is provided in CSV format, + // and is delivered to {path}/task-{id}/failures.csv. + Format *string `type:"string" enum:"ReportFormat"` + + // Required if Enabled is set to true. Specifies the location of the report + // on the file system's linked S3 data repository. An absolute path that defines + // where the completion report will be stored in the destination location. The + // Path you provide must be located within the file system’s ExportPath. An + // example Path value is "s3://myBucket/myExportPath/optionalPrefix". The report + // provides the following information for each file in the report: FilePath, + // FileStatus, and ErrorCode. To learn more about a file system's ExportPath, + // see . + Path *string `min:"3" type:"string"` + + // Required if Enabled is set to true. Specifies the scope of the CompletionReport; + // FAILED_FILES_ONLY is the only scope currently supported. When Scope is set + // to FAILED_FILES_ONLY, the CompletionReport only contains information about + // files that the data repository task failed to process. + Scope *string `type:"string" enum:"ReportScope"` +} + +// String returns the string representation +func (s CompletionReport) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CompletionReport) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CompletionReport) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CompletionReport"} + if s.Enabled == nil { + invalidParams.Add(request.NewErrParamRequired("Enabled")) + } + if s.Path != nil && len(*s.Path) < 3 { + invalidParams.Add(request.NewErrParamMinLen("Path", 3)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEnabled sets the Enabled field's value. +func (s *CompletionReport) SetEnabled(v bool) *CompletionReport { + s.Enabled = &v + return s +} + +// SetFormat sets the Format field's value. +func (s *CompletionReport) SetFormat(v string) *CompletionReport { + s.Format = &v + return s +} + +// SetPath sets the Path field's value. +func (s *CompletionReport) SetPath(v string) *CompletionReport { + s.Path = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *CompletionReport) SetScope(v string) *CompletionReport { + s.Scope = &v + return s +} + // The request object for the CreateBackup operation. type CreateBackupInput struct { _ struct{} `type:"structure"` @@ -1646,23 +2500,169 @@ func (s *CreateBackupOutput) SetBackup(v *Backup) *CreateBackupOutput { return s } -// The request object for the CreateFileSystemFromBackup operation. -type CreateFileSystemFromBackupInput struct { +type CreateDataRepositoryTaskInput struct { _ struct{} `type:"structure"` - // The ID of the backup. Specifies the backup to use if you're creating a file - // system from an existing backup. - // - // BackupId is a required field - BackupId *string `min:"12" type:"string" required:"true"` - - // (Optional) A string of up to 64 ASCII characters that Amazon FSx uses to - // ensure idempotent creation. This string is automatically filled on your behalf + // (Optional) An idempotency token for resource creation, in a string of up + // to 64 ASCII characters. This token is automatically filled on your behalf // when you use the AWS Command Line Interface (AWS CLI) or an AWS SDK. ClientRequestToken *string `min:"1" type:"string" idempotencyToken:"true"` - // A list of IDs for the security groups that apply to the specified network - // interfaces created for file system access. These security groups apply to + // The globally unique ID of the file system, assigned by Amazon FSx. + // + // FileSystemId is a required field + FileSystemId *string `min:"11" type:"string" required:"true"` + + // (Optional) The path or paths on the Amazon FSx file system to use when the + // data repository task is processed. The default path is the file system root + // directory. + Paths []*string `type:"list"` + + // Defines whether or not Amazon FSx provides a CompletionReport once the task + // has completed. A CompletionReport provides a detailed report on the files + // that Amazon FSx processed that meet the criteria specified by the Scope parameter. + // + // Report is a required field + Report *CompletionReport `type:"structure" required:"true"` + + // A list of Tag values, with a maximum of 50 elements. + Tags []*Tag `min:"1" type:"list"` + + // Specifies the type of data repository task to create. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"DataRepositoryTaskType"` +} + +// String returns the string representation +func (s CreateDataRepositoryTaskInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDataRepositoryTaskInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateDataRepositoryTaskInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateDataRepositoryTaskInput"} + if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) + } + if s.FileSystemId == nil { + invalidParams.Add(request.NewErrParamRequired("FileSystemId")) + } + if s.FileSystemId != nil && len(*s.FileSystemId) < 11 { + invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 11)) + } + if s.Report == nil { + invalidParams.Add(request.NewErrParamRequired("Report")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + if s.Report != nil { + if err := s.Report.Validate(); err != nil { + invalidParams.AddNested("Report", 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 +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *CreateDataRepositoryTaskInput) SetClientRequestToken(v string) *CreateDataRepositoryTaskInput { + s.ClientRequestToken = &v + return s +} + +// SetFileSystemId sets the FileSystemId field's value. +func (s *CreateDataRepositoryTaskInput) SetFileSystemId(v string) *CreateDataRepositoryTaskInput { + s.FileSystemId = &v + return s +} + +// SetPaths sets the Paths field's value. +func (s *CreateDataRepositoryTaskInput) SetPaths(v []*string) *CreateDataRepositoryTaskInput { + s.Paths = v + return s +} + +// SetReport sets the Report field's value. +func (s *CreateDataRepositoryTaskInput) SetReport(v *CompletionReport) *CreateDataRepositoryTaskInput { + s.Report = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateDataRepositoryTaskInput) SetTags(v []*Tag) *CreateDataRepositoryTaskInput { + s.Tags = v + return s +} + +// SetType sets the Type field's value. +func (s *CreateDataRepositoryTaskInput) SetType(v string) *CreateDataRepositoryTaskInput { + s.Type = &v + return s +} + +type CreateDataRepositoryTaskOutput struct { + _ struct{} `type:"structure"` + + // The description of the data repository task that you just created. + DataRepositoryTask *DataRepositoryTask `type:"structure"` +} + +// String returns the string representation +func (s CreateDataRepositoryTaskOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDataRepositoryTaskOutput) GoString() string { + return s.String() +} + +// SetDataRepositoryTask sets the DataRepositoryTask field's value. +func (s *CreateDataRepositoryTaskOutput) SetDataRepositoryTask(v *DataRepositoryTask) *CreateDataRepositoryTaskOutput { + s.DataRepositoryTask = v + return s +} + +// The request object for the CreateFileSystemFromBackup operation. +type CreateFileSystemFromBackupInput struct { + _ struct{} `type:"structure"` + + // The ID of the backup. Specifies the backup to use if you're creating a file + // system from an existing backup. + // + // BackupId is a required field + BackupId *string `min:"12" type:"string" required:"true"` + + // (Optional) A string of up to 64 ASCII characters that Amazon FSx uses to + // ensure idempotent creation. This string is automatically filled on your behalf + // when you use the AWS Command Line Interface (AWS CLI) or an AWS SDK. + ClientRequestToken *string `min:"1" type:"string" idempotencyToken:"true"` + + // A list of IDs for the security groups that apply to the specified network + // interfaces created for file system access. These security groups apply to // all network interfaces. This value isn't returned in later describe requests. SecurityGroupIds []*string `type:"list"` @@ -1800,14 +2800,17 @@ type CreateFileSystemInput struct { // when you use the AWS Command Line Interface (AWS CLI) or an AWS SDK. ClientRequestToken *string `min:"1" type:"string" idempotencyToken:"true"` - // The type of Amazon FSx file system to create. + // The type of Amazon FSx file system to create, either WINDOWS or LUSTRE. // // FileSystemType is a required field FileSystemType *string `type:"string" required:"true" enum:"FileSystemType"` - // The ID of your AWS Key Management Service (AWS KMS) key. This ID is used - // to encrypt the data in your file system at rest. For more information, see - // Encrypt (https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html) + // The ID of the AWS Key Management Service (AWS KMS) key used to encrypt the + // file system's data for Amazon FSx for Windows File Server file systems and + // Amazon FSx for Lustre PERSISTENT_1 file systems at rest. In either case, + // if not specified, the Amazon FSx managed key is used. The Amazon FSx for + // Lustre SCRATCH_1 and SCRATCH_2 file systems are always encrypted at rest + // using Amazon FSx managed keys. For more information, see Encrypt (https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html) // in the AWS Key Management Service API Reference. KmsKeyId *string `min:"1" type:"string"` @@ -1822,18 +2825,25 @@ type CreateFileSystemInput struct { // The storage capacity of the file system being created. // - // For Windows file systems, the storage capacity has a minimum of 300 GiB, - // and a maximum of 65,536 GiB. + // For Windows file systems, valid values are 32 GiB - 65,536 GiB. // - // For Lustre file systems, the storage capacity has a minimum of 3,600 GiB. - // Storage capacity is provisioned in increments of 3,600 GiB. + // For SCRATCH_1 Lustre file systems, valid values are 1,200, 2,400, 3,600, + // then continuing in increments of 3600 GiB. For SCRATCH_2 and PERSISTENT_1 + // file systems, valid values are 1200, 2400, then continuing in increments + // of 2400 GiB. // // StorageCapacity is a required field - StorageCapacity *int64 `min:"1" type:"integer" required:"true"` + StorageCapacity *int64 `type:"integer" required:"true"` - // The IDs of the subnets that the file system will be accessible from. File - // systems support only one subnet. The file server is also launched in that - // subnet's Availability Zone. + // Specifies the IDs of the subnets that the file system will be accessible + // from. For Windows MULTI_AZ_1 file system deployment types, provide exactly + // two subnet IDs, one for the preferred file server and one for the standby + // file server. You specify one of these subnets as the preferred subnet using + // the WindowsConfiguration > PreferredSubnetID property. + // + // For Windows SINGLE_AZ_1 file system deployment types and Lustre file systems, + // provide exactly one subnet ID. The file server is launched in that subnet's + // Availability Zone. // // SubnetIds is a required field SubnetIds []*string `type:"list" required:"true"` @@ -1872,9 +2882,6 @@ func (s *CreateFileSystemInput) Validate() error { if s.StorageCapacity == nil { invalidParams.Add(request.NewErrParamRequired("StorageCapacity")) } - if s.StorageCapacity != nil && *s.StorageCapacity < 1 { - invalidParams.Add(request.NewErrParamMinValue("StorageCapacity", 1)) - } if s.SubnetIds == nil { invalidParams.Add(request.NewErrParamRequired("SubnetIds")) } @@ -1967,6 +2974,25 @@ func (s *CreateFileSystemInput) SetWindowsConfiguration(v *CreateFileSystemWindo type CreateFileSystemLustreConfiguration struct { _ struct{} `type:"structure"` + // (Optional) Choose SCRATCH_1 and SCRATCH_2 deployment types when you need + // temporary storage and shorter-term processing of data. The SCRATCH_2 deployment + // type provides in-transit encryption of data and higher burst throughput capacity + // than SCRATCH_1. + // + // Choose PERSISTENT_1 deployment type for longer-term storage and workloads + // and encryption of data in transit. To learn more about deployment types, + // see FSx for Lustre Deployment Options (https://docs.aws.amazon.com/fsx/latest/LustreGuide/lustre-deployment-types.html). + // + // Encryption of data in-transit is automatically enabled when you access a + // SCRATCH_2 or PERSISTENT_1 file system from Amazon EC2 instances that support + // this feature (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/data- protection.html). + // (Default = SCRATCH_1) + // + // Encryption of data in-transit for SCRATCH_2 and PERSISTENT_1 deployment types + // is supported when accessed from supported instance types in supported AWS + // Regions. To learn more, Encrypting Data in Transit (https://docs.aws.amazon.com/fsx/latest/LustreGuide/encryption-in-transit-fsxl.html). + DeploymentType *string `type:"string" enum:"LustreDeploymentType"` + // (Optional) The path in Amazon S3 where the root of your Amazon FSx file system // is exported. The path must use the same Amazon S3 bucket as specified in // ImportPath. You can provide an optional prefix to which new and changed data @@ -1997,10 +3023,21 @@ type CreateFileSystemLustreConfiguration struct { // be striped across is limited by the total number of disks that make up the // file system. // - // The chunk size default is 1,024 MiB (1 GiB) and can go as high as 512,000 + // The default chunk size is 1,024 MiB (1 GiB) and can go as high as 512,000 // MiB (500 GiB). Amazon S3 objects have a maximum size of 5 TB. ImportedFileChunkSize *int64 `min:"1" type:"integer"` + // (Optional) For the PERSISTENT_1 deployment type, describes the amount of + // read and write throughput for each 1 tebibyte of storage, in MB/s/TiB. File + // system throughput capacity is calculated by multiplying file system storage + // capacity (TiB) by the PerUnitStorageThroughput (MB/s/TiB). For a 2.4 TiB + // file system, provisioning 50 MB/s/TiB of PerUnitStorageThroughput yields + // 120 MB/s of file system throughput. You pay for the amount of throughput + // that you provision. (Default = 200 MB/s/TiB) + // + // Valid values are 50, 100, 200. + PerUnitStorageThroughput *int64 `min:"50" type:"integer"` + // The preferred time to perform weekly maintenance, in the UTC time zone. WeeklyMaintenanceStartTime *string `min:"7" type:"string"` } @@ -2027,6 +3064,9 @@ func (s *CreateFileSystemLustreConfiguration) Validate() error { if s.ImportedFileChunkSize != nil && *s.ImportedFileChunkSize < 1 { invalidParams.Add(request.NewErrParamMinValue("ImportedFileChunkSize", 1)) } + if s.PerUnitStorageThroughput != nil && *s.PerUnitStorageThroughput < 50 { + invalidParams.Add(request.NewErrParamMinValue("PerUnitStorageThroughput", 50)) + } if s.WeeklyMaintenanceStartTime != nil && len(*s.WeeklyMaintenanceStartTime) < 7 { invalidParams.Add(request.NewErrParamMinLen("WeeklyMaintenanceStartTime", 7)) } @@ -2037,6 +3077,12 @@ func (s *CreateFileSystemLustreConfiguration) Validate() error { return nil } +// SetDeploymentType sets the DeploymentType field's value. +func (s *CreateFileSystemLustreConfiguration) SetDeploymentType(v string) *CreateFileSystemLustreConfiguration { + s.DeploymentType = &v + return s +} + // SetExportPath sets the ExportPath field's value. func (s *CreateFileSystemLustreConfiguration) SetExportPath(v string) *CreateFileSystemLustreConfiguration { s.ExportPath = &v @@ -2055,6 +3101,12 @@ func (s *CreateFileSystemLustreConfiguration) SetImportedFileChunkSize(v int64) return s } +// SetPerUnitStorageThroughput sets the PerUnitStorageThroughput field's value. +func (s *CreateFileSystemLustreConfiguration) SetPerUnitStorageThroughput(v int64) *CreateFileSystemLustreConfiguration { + s.PerUnitStorageThroughput = &v + return s +} + // SetWeeklyMaintenanceStartTime sets the WeeklyMaintenanceStartTime field's value. func (s *CreateFileSystemLustreConfiguration) SetWeeklyMaintenanceStartTime(v string) *CreateFileSystemLustreConfiguration { s.WeeklyMaintenanceStartTime = &v @@ -2070,195 +3122,714 @@ type CreateFileSystemOutput struct { } // String returns the string representation -func (s CreateFileSystemOutput) String() string { +func (s CreateFileSystemOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateFileSystemOutput) GoString() string { + return s.String() +} + +// SetFileSystem sets the FileSystem field's value. +func (s *CreateFileSystemOutput) SetFileSystem(v *FileSystem) *CreateFileSystemOutput { + s.FileSystem = v + return s +} + +// The configuration object for the Microsoft Windows file system used in CreateFileSystem +// and CreateFileSystemFromBackup operations. +type CreateFileSystemWindowsConfiguration struct { + _ struct{} `type:"structure"` + + // The ID for an existing AWS Managed Microsoft Active Directory (AD) instance + // that the file system should join when it's created. + ActiveDirectoryId *string `min:"12" type:"string"` + + // The number of days to retain automatic backups. The default is to retain + // backups for 7 days. Setting this value to 0 disables the creation of automatic + // backups. The maximum retention period for backups is 35 days. + AutomaticBackupRetentionDays *int64 `type:"integer"` + + // A boolean flag indicating whether tags for the file system should be copied + // to backups. This value defaults to false. If it's set to true, all tags for + // the file system are copied to all automatic and user-initiated backups where + // the user doesn't specify tags. If this value is true, and you specify one + // or more tags, only the specified tags are copied to backups. If you specify + // one or more tags when creating a user-initiated backup, no tags are copied + // from the file system, regardless of this value. + CopyTagsToBackups *bool `type:"boolean"` + + // The preferred time to take daily automatic backups, formatted HH:MM in the + // UTC time zone. + DailyAutomaticBackupStartTime *string `min:"5" type:"string"` + + // Specifies the file system deployment type, valid values are the following: + // + // * MULTI_AZ_1 - Deploys a high availability file system that is configured + // for Multi-AZ redundancy to tolerate temporary Availability Zone (AZ) unavailability. + // You can only deploy a Multi-AZ file system in AWS Regions that have a + // minimum of three Availability Zones. + // + // * SINGLE_AZ_1 - (Default) Choose to deploy a file system that is configured + // for single AZ redundancy. + // + // To learn more about high availability Multi-AZ file systems, see High Availability + // for Amazon FSx for Windows File Server (https://docs.aws.amazon.com/fsx/latest/WindowsGuide/high-availability-multiAZ.html). + DeploymentType *string `type:"string" enum:"WindowsDeploymentType"` + + // Required when DeploymentType is set to MULTI_AZ_1. This specifies the subnet + // in which you want the preferred file server to be located. For in-AWS applications, + // we recommend that you launch your clients in the same Availability Zone (AZ) + // as your preferred file server to reduce cross-AZ data transfer costs and + // minimize latency. + PreferredSubnetId *string `min:"15" type:"string"` + + // The configuration that Amazon FSx uses to join the Windows File Server instance + // to your self-managed (including on-premises) Microsoft Active Directory (AD) + // directory. + SelfManagedActiveDirectoryConfiguration *SelfManagedActiveDirectoryConfiguration `type:"structure"` + + // The throughput of an Amazon FSx file system, measured in megabytes per second, + // in 2 to the nth increments, between 2^3 (8) and 2^11 (2048). + // + // ThroughputCapacity is a required field + ThroughputCapacity *int64 `min:"8" type:"integer" required:"true"` + + // The preferred start time to perform weekly maintenance, formatted d:HH:MM + // in the UTC time zone. + WeeklyMaintenanceStartTime *string `min:"7" type:"string"` +} + +// String returns the string representation +func (s CreateFileSystemWindowsConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateFileSystemWindowsConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateFileSystemWindowsConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateFileSystemWindowsConfiguration"} + if s.ActiveDirectoryId != nil && len(*s.ActiveDirectoryId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("ActiveDirectoryId", 12)) + } + if s.DailyAutomaticBackupStartTime != nil && len(*s.DailyAutomaticBackupStartTime) < 5 { + invalidParams.Add(request.NewErrParamMinLen("DailyAutomaticBackupStartTime", 5)) + } + if s.PreferredSubnetId != nil && len(*s.PreferredSubnetId) < 15 { + invalidParams.Add(request.NewErrParamMinLen("PreferredSubnetId", 15)) + } + if s.ThroughputCapacity == nil { + invalidParams.Add(request.NewErrParamRequired("ThroughputCapacity")) + } + if s.ThroughputCapacity != nil && *s.ThroughputCapacity < 8 { + invalidParams.Add(request.NewErrParamMinValue("ThroughputCapacity", 8)) + } + if s.WeeklyMaintenanceStartTime != nil && len(*s.WeeklyMaintenanceStartTime) < 7 { + invalidParams.Add(request.NewErrParamMinLen("WeeklyMaintenanceStartTime", 7)) + } + if s.SelfManagedActiveDirectoryConfiguration != nil { + if err := s.SelfManagedActiveDirectoryConfiguration.Validate(); err != nil { + invalidParams.AddNested("SelfManagedActiveDirectoryConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetActiveDirectoryId sets the ActiveDirectoryId field's value. +func (s *CreateFileSystemWindowsConfiguration) SetActiveDirectoryId(v string) *CreateFileSystemWindowsConfiguration { + s.ActiveDirectoryId = &v + return s +} + +// SetAutomaticBackupRetentionDays sets the AutomaticBackupRetentionDays field's value. +func (s *CreateFileSystemWindowsConfiguration) SetAutomaticBackupRetentionDays(v int64) *CreateFileSystemWindowsConfiguration { + s.AutomaticBackupRetentionDays = &v + return s +} + +// SetCopyTagsToBackups sets the CopyTagsToBackups field's value. +func (s *CreateFileSystemWindowsConfiguration) SetCopyTagsToBackups(v bool) *CreateFileSystemWindowsConfiguration { + s.CopyTagsToBackups = &v + return s +} + +// SetDailyAutomaticBackupStartTime sets the DailyAutomaticBackupStartTime field's value. +func (s *CreateFileSystemWindowsConfiguration) SetDailyAutomaticBackupStartTime(v string) *CreateFileSystemWindowsConfiguration { + s.DailyAutomaticBackupStartTime = &v + return s +} + +// SetDeploymentType sets the DeploymentType field's value. +func (s *CreateFileSystemWindowsConfiguration) SetDeploymentType(v string) *CreateFileSystemWindowsConfiguration { + s.DeploymentType = &v + return s +} + +// SetPreferredSubnetId sets the PreferredSubnetId field's value. +func (s *CreateFileSystemWindowsConfiguration) SetPreferredSubnetId(v string) *CreateFileSystemWindowsConfiguration { + s.PreferredSubnetId = &v + return s +} + +// SetSelfManagedActiveDirectoryConfiguration sets the SelfManagedActiveDirectoryConfiguration field's value. +func (s *CreateFileSystemWindowsConfiguration) SetSelfManagedActiveDirectoryConfiguration(v *SelfManagedActiveDirectoryConfiguration) *CreateFileSystemWindowsConfiguration { + s.SelfManagedActiveDirectoryConfiguration = v + return s +} + +// SetThroughputCapacity sets the ThroughputCapacity field's value. +func (s *CreateFileSystemWindowsConfiguration) SetThroughputCapacity(v int64) *CreateFileSystemWindowsConfiguration { + s.ThroughputCapacity = &v + return s +} + +// SetWeeklyMaintenanceStartTime sets the WeeklyMaintenanceStartTime field's value. +func (s *CreateFileSystemWindowsConfiguration) SetWeeklyMaintenanceStartTime(v string) *CreateFileSystemWindowsConfiguration { + s.WeeklyMaintenanceStartTime = &v + return s +} + +// The data repository configuration object for Lustre file systems returned +// in the response of the CreateFileSystem operation. +type DataRepositoryConfiguration struct { + _ struct{} `type:"structure"` + + // The export path to the Amazon S3 bucket (and prefix) that you are using to + // store new and changed Lustre file system files in S3. + ExportPath *string `min:"3" type:"string"` + + // The import path to the Amazon S3 bucket (and optional prefix) that you're + // using as the data repository for your FSx for Lustre file system, for example + // s3://import-bucket/optional-prefix. If a prefix is specified after the Amazon + // S3 bucket name, only object keys with that prefix are loaded into the file + // system. + ImportPath *string `min:"3" type:"string"` + + // For files imported from a data repository, this value determines the stripe + // count and maximum amount of data per file (in MiB) stored on a single physical + // disk. The maximum number of disks that a single file can be striped across + // is limited by the total number of disks that make up the file system. + // + // The default chunk size is 1,024 MiB (1 GiB) and can go as high as 512,000 + // MiB (500 GiB). Amazon S3 objects have a maximum size of 5 TB. + ImportedFileChunkSize *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s DataRepositoryConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataRepositoryConfiguration) GoString() string { + return s.String() +} + +// SetExportPath sets the ExportPath field's value. +func (s *DataRepositoryConfiguration) SetExportPath(v string) *DataRepositoryConfiguration { + s.ExportPath = &v + return s +} + +// SetImportPath sets the ImportPath field's value. +func (s *DataRepositoryConfiguration) SetImportPath(v string) *DataRepositoryConfiguration { + s.ImportPath = &v + return s +} + +// SetImportedFileChunkSize sets the ImportedFileChunkSize field's value. +func (s *DataRepositoryConfiguration) SetImportedFileChunkSize(v int64) *DataRepositoryConfiguration { + s.ImportedFileChunkSize = &v + return s +} + +// A description of the data repository task. You use data repository tasks +// to perform bulk transfer operations between your Amazon FSx file system and +// its linked data repository. +type DataRepositoryTask struct { + _ struct{} `type:"structure"` + + // The time that the resource was created, in seconds (since 1970-01-01T00:00:00Z), + // also known as Unix time. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // The time that Amazon FSx completed processing the task, populated after the + // task is complete. + EndTime *time.Time `type:"timestamp"` + + // Failure message describing why the task failed, it is populated only when + // Lifecycle is set to FAILED. + FailureDetails *DataRepositoryTaskFailureDetails `type:"structure"` + + // The globally unique ID of the file system, assigned by Amazon FSx. + // + // FileSystemId is a required field + FileSystemId *string `min:"11" type:"string" required:"true"` + + // The lifecycle status of the data repository task, as follows: + // + // * PENDING - Amazon FSx has not started the task. + // + // * EXECUTING - Amazon FSx is processing the task. + // + // * FAILED - Amazon FSx was not able to complete the task. For example, + // there may be files the task failed to process. The DataRepositoryTaskFailureDetails + // property provides more information about task failures. + // + // * SUCCEEDED - FSx completed the task successfully. + // + // * CANCELED - Amazon FSx canceled the task and it did not complete. + // + // * CANCELING - FSx is in process of canceling the task. + // + // You cannot delete an FSx for Lustre file system if there are data repository + // tasks for the file system in the PENDING or EXECUTING states. Please retry + // when the data repository task is finished (with a status of CANCELED, SUCCEEDED, + // or FAILED). You can use the DescribeDataRepositoryTask action to monitor + // the task status. Contact the FSx team if you need to delete your file system + // immediately. + // + // Lifecycle is a required field + Lifecycle *string `type:"string" required:"true" enum:"DataRepositoryTaskLifecycle"` + + // An array of paths on the Amazon FSx for Lustre file system that specify the + // data for the data repository task to process. For example, in an EXPORT_TO_REPOSITORY + // task, the paths specify which data to export to the linked data repository. + // + // (Default) If Paths is not specified, Amazon FSx uses the file system root + // directory. + Paths []*string `type:"list"` + + // Provides a report detailing the data repository task results of the files + // processed that match the criteria specified in the report Scope parameter. + // FSx delivers the report to the file system's linked data repository in Amazon + // S3, using the path specified in the report Path parameter. You can specify + // whether or not a report gets generated for a task using the Enabled parameter. + Report *CompletionReport `type:"structure"` + + // The Amazon Resource Name (ARN) for a given resource. ARNs uniquely identify + // AWS resources. We require an ARN when you need to specify a resource unambiguously + // across all of AWS. For more information, see Amazon Resource Names (ARNs) + // and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) + // in the AWS General Reference. + ResourceARN *string `min:"8" type:"string"` + + // The time that Amazon FSx began processing the task. + StartTime *time.Time `type:"timestamp"` + + // Provides the status of the number of files that the task has processed successfully + // and failed to process. + Status *DataRepositoryTaskStatus `type:"structure"` + + // A list of Tag values, with a maximum of 50 elements. + Tags []*Tag `min:"1" type:"list"` + + // The system-generated, unique 17-digit ID of the data repository task. + // + // TaskId is a required field + TaskId *string `min:"12" type:"string" required:"true"` + + // The type of data repository task; EXPORT_TO_REPOSITORY is the only type currently + // supported. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"DataRepositoryTaskType"` +} + +// String returns the string representation +func (s DataRepositoryTask) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataRepositoryTask) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DataRepositoryTask) SetCreationTime(v time.Time) *DataRepositoryTask { + s.CreationTime = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *DataRepositoryTask) SetEndTime(v time.Time) *DataRepositoryTask { + s.EndTime = &v + return s +} + +// SetFailureDetails sets the FailureDetails field's value. +func (s *DataRepositoryTask) SetFailureDetails(v *DataRepositoryTaskFailureDetails) *DataRepositoryTask { + s.FailureDetails = v + return s +} + +// SetFileSystemId sets the FileSystemId field's value. +func (s *DataRepositoryTask) SetFileSystemId(v string) *DataRepositoryTask { + s.FileSystemId = &v + return s +} + +// SetLifecycle sets the Lifecycle field's value. +func (s *DataRepositoryTask) SetLifecycle(v string) *DataRepositoryTask { + s.Lifecycle = &v + return s +} + +// SetPaths sets the Paths field's value. +func (s *DataRepositoryTask) SetPaths(v []*string) *DataRepositoryTask { + s.Paths = v + return s +} + +// SetReport sets the Report field's value. +func (s *DataRepositoryTask) SetReport(v *CompletionReport) *DataRepositoryTask { + s.Report = v + return s +} + +// SetResourceARN sets the ResourceARN field's value. +func (s *DataRepositoryTask) SetResourceARN(v string) *DataRepositoryTask { + s.ResourceARN = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *DataRepositoryTask) SetStartTime(v time.Time) *DataRepositoryTask { + s.StartTime = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DataRepositoryTask) SetStatus(v *DataRepositoryTaskStatus) *DataRepositoryTask { + s.Status = v + return s +} + +// SetTags sets the Tags field's value. +func (s *DataRepositoryTask) SetTags(v []*Tag) *DataRepositoryTask { + s.Tags = v + return s +} + +// SetTaskId sets the TaskId field's value. +func (s *DataRepositoryTask) SetTaskId(v string) *DataRepositoryTask { + s.TaskId = &v + return s +} + +// SetType sets the Type field's value. +func (s *DataRepositoryTask) SetType(v string) *DataRepositoryTask { + s.Type = &v + return s +} + +// The data repository task could not be canceled because the task has already +// ended. +type DataRepositoryTaskEnded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s DataRepositoryTaskEnded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataRepositoryTaskEnded) GoString() string { + return s.String() +} + +func newErrorDataRepositoryTaskEnded(v protocol.ResponseMetadata) error { + return &DataRepositoryTaskEnded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DataRepositoryTaskEnded) Code() string { + return "DataRepositoryTaskEnded" +} + +// Message returns the exception's message. +func (s DataRepositoryTaskEnded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DataRepositoryTaskEnded) OrigErr() error { + return nil +} + +func (s DataRepositoryTaskEnded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DataRepositoryTaskEnded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DataRepositoryTaskEnded) RequestID() string { + return s.respMetadata.RequestID +} + +// An existing data repository task is currently executing on the file system. +// Wait until the existing task has completed, then create the new task. +type DataRepositoryTaskExecuting struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s DataRepositoryTaskExecuting) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataRepositoryTaskExecuting) GoString() string { + return s.String() +} + +func newErrorDataRepositoryTaskExecuting(v protocol.ResponseMetadata) error { + return &DataRepositoryTaskExecuting{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DataRepositoryTaskExecuting) Code() string { + return "DataRepositoryTaskExecuting" +} + +// Message returns the exception's message. +func (s DataRepositoryTaskExecuting) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DataRepositoryTaskExecuting) OrigErr() error { + return nil +} + +func (s DataRepositoryTaskExecuting) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DataRepositoryTaskExecuting) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DataRepositoryTaskExecuting) RequestID() string { + return s.respMetadata.RequestID +} + +// Provides information about why a data repository task failed. Only populated +// when the task Lifecycle is set to FAILED. +type DataRepositoryTaskFailureDetails struct { + _ struct{} `type:"structure"` + + // A detailed error message. + Message *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DataRepositoryTaskFailureDetails) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateFileSystemOutput) GoString() string { +func (s DataRepositoryTaskFailureDetails) GoString() string { return s.String() } -// SetFileSystem sets the FileSystem field's value. -func (s *CreateFileSystemOutput) SetFileSystem(v *FileSystem) *CreateFileSystemOutput { - s.FileSystem = v +// SetMessage sets the Message field's value. +func (s *DataRepositoryTaskFailureDetails) SetMessage(v string) *DataRepositoryTaskFailureDetails { + s.Message = &v return s } -// The configuration object for the Microsoft Windows file system used in CreateFileSystem -// and CreateFileSystemFromBackup operations. -type CreateFileSystemWindowsConfiguration struct { +// (Optional) An array of filter objects you can use to filter the response +// of data repository tasks you will see in the the response. You can filter +// the tasks returned in the response by one or more file system IDs, task lifecycles, +// and by task type. A filter object consists of a filter Name, and one or more +// Values for the filter. +type DataRepositoryTaskFilter struct { _ struct{} `type:"structure"` - // The ID for an existing AWS Managed Microsoft Active Directory (AD) instance - // that the file system should join when it's created. - ActiveDirectoryId *string `min:"12" type:"string"` + // Name of the task property to use in filtering the tasks returned in the response. + // + // * Use file-system-id to retrieve data repository tasks for specific file + // systems. + // + // * Use task-lifecycle to retrieve data repository tasks with one or more + // specific lifecycle states, as follows: CANCELED, EXECUTING, FAILED, PENDING, + // and SUCCEEDED. + Name *string `type:"string" enum:"DataRepositoryTaskFilterName"` - // The number of days to retain automatic backups. The default is to retain - // backups for 7 days. Setting this value to 0 disables the creation of automatic - // backups. The maximum retention period for backups is 35 days. - AutomaticBackupRetentionDays *int64 `type:"integer"` + // Use Values to include the specific file system IDs and task lifecycle states + // for the filters you are using. + Values []*string `type:"list"` +} - // A boolean flag indicating whether tags for the file system should be copied - // to backups. This value defaults to false. If it's set to true, all tags for - // the file system are copied to all automatic and user-initiated backups where - // the user doesn't specify tags. If this value is true, and you specify one - // or more tags, only the specified tags are copied to backups. - CopyTagsToBackups *bool `type:"boolean"` +// String returns the string representation +func (s DataRepositoryTaskFilter) String() string { + return awsutil.Prettify(s) +} - // The preferred time to take daily automatic backups, formatted HH:MM in the - // UTC time zone. - DailyAutomaticBackupStartTime *string `min:"5" type:"string"` +// GoString returns the string representation +func (s DataRepositoryTaskFilter) GoString() string { + return s.String() +} - // The configuration that Amazon FSx uses to join the Windows File Server instance - // to your self-managed (including on-premises) Microsoft Active Directory (AD) - // directory. - SelfManagedActiveDirectoryConfiguration *SelfManagedActiveDirectoryConfiguration `type:"structure"` +// SetName sets the Name field's value. +func (s *DataRepositoryTaskFilter) SetName(v string) *DataRepositoryTaskFilter { + s.Name = &v + return s +} - // The throughput of an Amazon FSx file system, measured in megabytes per second, - // in 2 to the nth increments, between 2^3 (8) and 2^11 (2048). - // - // ThroughputCapacity is a required field - ThroughputCapacity *int64 `min:"8" type:"integer" required:"true"` +// SetValues sets the Values field's value. +func (s *DataRepositoryTaskFilter) SetValues(v []*string) *DataRepositoryTaskFilter { + s.Values = v + return s +} - // The preferred start time to perform weekly maintenance, formatted d:HH:MM - // in the UTC time zone. - WeeklyMaintenanceStartTime *string `min:"7" type:"string"` +// The data repository task or tasks you specified could not be found. +type DataRepositoryTaskNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` } // String returns the string representation -func (s CreateFileSystemWindowsConfiguration) String() string { +func (s DataRepositoryTaskNotFound) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateFileSystemWindowsConfiguration) GoString() string { +func (s DataRepositoryTaskNotFound) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateFileSystemWindowsConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateFileSystemWindowsConfiguration"} - if s.ActiveDirectoryId != nil && len(*s.ActiveDirectoryId) < 12 { - invalidParams.Add(request.NewErrParamMinLen("ActiveDirectoryId", 12)) - } - if s.DailyAutomaticBackupStartTime != nil && len(*s.DailyAutomaticBackupStartTime) < 5 { - invalidParams.Add(request.NewErrParamMinLen("DailyAutomaticBackupStartTime", 5)) - } - if s.ThroughputCapacity == nil { - invalidParams.Add(request.NewErrParamRequired("ThroughputCapacity")) - } - if s.ThroughputCapacity != nil && *s.ThroughputCapacity < 8 { - invalidParams.Add(request.NewErrParamMinValue("ThroughputCapacity", 8)) - } - if s.WeeklyMaintenanceStartTime != nil && len(*s.WeeklyMaintenanceStartTime) < 7 { - invalidParams.Add(request.NewErrParamMinLen("WeeklyMaintenanceStartTime", 7)) - } - if s.SelfManagedActiveDirectoryConfiguration != nil { - if err := s.SelfManagedActiveDirectoryConfiguration.Validate(); err != nil { - invalidParams.AddNested("SelfManagedActiveDirectoryConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams +func newErrorDataRepositoryTaskNotFound(v protocol.ResponseMetadata) error { + return &DataRepositoryTaskNotFound{ + respMetadata: v, } - return nil -} - -// SetActiveDirectoryId sets the ActiveDirectoryId field's value. -func (s *CreateFileSystemWindowsConfiguration) SetActiveDirectoryId(v string) *CreateFileSystemWindowsConfiguration { - s.ActiveDirectoryId = &v - return s } -// SetAutomaticBackupRetentionDays sets the AutomaticBackupRetentionDays field's value. -func (s *CreateFileSystemWindowsConfiguration) SetAutomaticBackupRetentionDays(v int64) *CreateFileSystemWindowsConfiguration { - s.AutomaticBackupRetentionDays = &v - return s +// Code returns the exception type name. +func (s DataRepositoryTaskNotFound) Code() string { + return "DataRepositoryTaskNotFound" } -// SetCopyTagsToBackups sets the CopyTagsToBackups field's value. -func (s *CreateFileSystemWindowsConfiguration) SetCopyTagsToBackups(v bool) *CreateFileSystemWindowsConfiguration { - s.CopyTagsToBackups = &v - return s +// Message returns the exception's message. +func (s DataRepositoryTaskNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetDailyAutomaticBackupStartTime sets the DailyAutomaticBackupStartTime field's value. -func (s *CreateFileSystemWindowsConfiguration) SetDailyAutomaticBackupStartTime(v string) *CreateFileSystemWindowsConfiguration { - s.DailyAutomaticBackupStartTime = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DataRepositoryTaskNotFound) OrigErr() error { + return nil } -// SetSelfManagedActiveDirectoryConfiguration sets the SelfManagedActiveDirectoryConfiguration field's value. -func (s *CreateFileSystemWindowsConfiguration) SetSelfManagedActiveDirectoryConfiguration(v *SelfManagedActiveDirectoryConfiguration) *CreateFileSystemWindowsConfiguration { - s.SelfManagedActiveDirectoryConfiguration = v - return s +func (s DataRepositoryTaskNotFound) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetThroughputCapacity sets the ThroughputCapacity field's value. -func (s *CreateFileSystemWindowsConfiguration) SetThroughputCapacity(v int64) *CreateFileSystemWindowsConfiguration { - s.ThroughputCapacity = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s DataRepositoryTaskNotFound) StatusCode() int { + return s.respMetadata.StatusCode } -// SetWeeklyMaintenanceStartTime sets the WeeklyMaintenanceStartTime field's value. -func (s *CreateFileSystemWindowsConfiguration) SetWeeklyMaintenanceStartTime(v string) *CreateFileSystemWindowsConfiguration { - s.WeeklyMaintenanceStartTime = &v - return s +// RequestID returns the service's response RequestID for request. +func (s DataRepositoryTaskNotFound) RequestID() string { + return s.respMetadata.RequestID } -// The data repository configuration object for Lustre file systems returned -// in the response of the CreateFileSystem operation. -type DataRepositoryConfiguration struct { +// Provides the task status showing a running total of the total number of files +// to be processed, the number successfully processed, and the number of files +// the task failed to process. +type DataRepositoryTaskStatus struct { _ struct{} `type:"structure"` - // The export path to the Amazon S3 bucket (and prefix) that you are using to - // store new and changed Lustre file system files in S3. - ExportPath *string `min:"3" type:"string"` + // A running total of the number of files that the task failed to process. + FailedCount *int64 `type:"long"` - // The import path to the Amazon S3 bucket (and optional prefix) that you're - // using as the data repository for your FSx for Lustre file system, for example - // s3://import-bucket/optional-prefix. If a prefix is specified after the Amazon - // S3 bucket name, only object keys with that prefix are loaded into the file - // system. - ImportPath *string `min:"3" type:"string"` + // The time at which the task status was last updated. + LastUpdatedTime *time.Time `type:"timestamp"` - // For files imported from a data repository, this value determines the stripe - // count and maximum amount of data per file (in MiB) stored on a single physical - // disk. The maximum number of disks that a single file can be striped across - // is limited by the total number of disks that make up the file system. - // - // The default chunk size is 1,024 MiB (1 GiB) and can go as high as 512,000 - // MiB (500 GiB). Amazon S3 objects have a maximum size of 5 TB. - ImportedFileChunkSize *int64 `min:"1" type:"integer"` + // A running total of the number of files that the task has successfully processed. + SucceededCount *int64 `type:"long"` + + // The total number of files that the task will process. While a task is executing, + // the sum of SucceededCount plus FailedCount may not equal TotalCount. When + // the task is complete, TotalCount equals the sum of SucceededCount plus FailedCount. + TotalCount *int64 `type:"long"` } // String returns the string representation -func (s DataRepositoryConfiguration) String() string { +func (s DataRepositoryTaskStatus) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DataRepositoryConfiguration) GoString() string { +func (s DataRepositoryTaskStatus) GoString() string { return s.String() } -// SetExportPath sets the ExportPath field's value. -func (s *DataRepositoryConfiguration) SetExportPath(v string) *DataRepositoryConfiguration { - s.ExportPath = &v +// SetFailedCount sets the FailedCount field's value. +func (s *DataRepositoryTaskStatus) SetFailedCount(v int64) *DataRepositoryTaskStatus { + s.FailedCount = &v return s } -// SetImportPath sets the ImportPath field's value. -func (s *DataRepositoryConfiguration) SetImportPath(v string) *DataRepositoryConfiguration { - s.ImportPath = &v +// SetLastUpdatedTime sets the LastUpdatedTime field's value. +func (s *DataRepositoryTaskStatus) SetLastUpdatedTime(v time.Time) *DataRepositoryTaskStatus { + s.LastUpdatedTime = &v return s } -// SetImportedFileChunkSize sets the ImportedFileChunkSize field's value. -func (s *DataRepositoryConfiguration) SetImportedFileChunkSize(v int64) *DataRepositoryConfiguration { - s.ImportedFileChunkSize = &v +// SetSucceededCount sets the SucceededCount field's value. +func (s *DataRepositoryTaskStatus) SetSucceededCount(v int64) *DataRepositoryTaskStatus { + s.SucceededCount = &v + return s +} + +// SetTotalCount sets the TotalCount field's value. +func (s *DataRepositoryTaskStatus) SetTotalCount(v int64) *DataRepositoryTaskStatus { + s.TotalCount = &v return s } @@ -2559,42 +4130,147 @@ func (s *DeleteFileSystemWindowsResponse) SetFinalBackupTags(v []*Tag) *DeleteFi return s } -// The request object for DescribeBackups operation. -type DescribeBackupsInput struct { +// The request object for DescribeBackups operation. +type DescribeBackupsInput struct { + _ struct{} `type:"structure"` + + // (Optional) IDs of the backups you want to retrieve (String). This overrides + // any filters. If any IDs are not found, BackupNotFound will be thrown. + BackupIds []*string `type:"list"` + + // (Optional) Filters structure. Supported names are file-system-id and backup-type. + Filters []*Filter `type:"list"` + + // (Optional) Maximum number of backups to return in the response (integer). + // This parameter value must be greater than 0. The number of items that Amazon + // FSx returns is the minimum of the MaxResults parameter specified in the request + // and the service's internal maximum number of items per page. + MaxResults *int64 `min:"1" type:"integer"` + + // (Optional) Opaque pagination token returned from a previous DescribeBackups + // operation (String). If a token present, the action continues the list from + // where the returning call left off. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DescribeBackupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeBackupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeBackupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeBackupsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBackupIds sets the BackupIds field's value. +func (s *DescribeBackupsInput) SetBackupIds(v []*string) *DescribeBackupsInput { + s.BackupIds = v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeBackupsInput) SetFilters(v []*Filter) *DescribeBackupsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeBackupsInput) SetMaxResults(v int64) *DescribeBackupsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeBackupsInput) SetNextToken(v string) *DescribeBackupsInput { + s.NextToken = &v + return s +} + +// Response object for DescribeBackups operation. +type DescribeBackupsOutput struct { + _ struct{} `type:"structure"` + + // Any array of backups. + Backups []*Backup `type:"list"` + + // This is present if there are more backups than returned in the response (String). + // You can use the NextToken value in the later request to fetch the backups. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DescribeBackupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeBackupsOutput) GoString() string { + return s.String() +} + +// SetBackups sets the Backups field's value. +func (s *DescribeBackupsOutput) SetBackups(v []*Backup) *DescribeBackupsOutput { + s.Backups = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeBackupsOutput) SetNextToken(v string) *DescribeBackupsOutput { + s.NextToken = &v + return s +} + +type DescribeDataRepositoryTasksInput struct { _ struct{} `type:"structure"` - // (Optional) IDs of the backups you want to retrieve (String). This overrides - // any filters. If any IDs are not found, BackupNotFound will be thrown. - BackupIds []*string `type:"list"` - - // (Optional) Filters structure. Supported names are file-system-id and backup-type. - Filters []*Filter `type:"list"` + // (Optional) You can use filters to narrow the DescribeDataRepositoryTasks + // response to include just tasks for specific file systems, or tasks in a specific + // lifecycle state. + Filters []*DataRepositoryTaskFilter `type:"list"` - // (Optional) Maximum number of backups to return in the response (integer). - // This parameter value must be greater than 0. The number of items that Amazon - // FSx returns is the minimum of the MaxResults parameter specified in the request - // and the service's internal maximum number of items per page. + // The maximum number of resources to return in the response. This value must + // be an integer greater than zero. MaxResults *int64 `min:"1" type:"integer"` - // (Optional) Opaque pagination token returned from a previous DescribeBackups - // operation (String). If a token present, the action continues the list from - // where the returning call left off. + // (Optional) Opaque pagination token returned from a previous operation (String). + // If present, this token indicates from what point you can continue processing + // the request, where the previous NextToken value left off. NextToken *string `min:"1" type:"string"` + + // (Optional) IDs of the tasks whose descriptions you want to retrieve (String). + TaskIds []*string `type:"list"` } // String returns the string representation -func (s DescribeBackupsInput) String() string { +func (s DescribeDataRepositoryTasksInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeBackupsInput) GoString() string { +func (s DescribeDataRepositoryTasksInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeBackupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeBackupsInput"} +func (s *DescribeDataRepositoryTasksInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeDataRepositoryTasksInput"} if s.MaxResults != nil && *s.MaxResults < 1 { invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } @@ -2608,60 +4284,60 @@ func (s *DescribeBackupsInput) Validate() error { return nil } -// SetBackupIds sets the BackupIds field's value. -func (s *DescribeBackupsInput) SetBackupIds(v []*string) *DescribeBackupsInput { - s.BackupIds = v - return s -} - // SetFilters sets the Filters field's value. -func (s *DescribeBackupsInput) SetFilters(v []*Filter) *DescribeBackupsInput { +func (s *DescribeDataRepositoryTasksInput) SetFilters(v []*DataRepositoryTaskFilter) *DescribeDataRepositoryTasksInput { s.Filters = v return s } // SetMaxResults sets the MaxResults field's value. -func (s *DescribeBackupsInput) SetMaxResults(v int64) *DescribeBackupsInput { +func (s *DescribeDataRepositoryTasksInput) SetMaxResults(v int64) *DescribeDataRepositoryTasksInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeBackupsInput) SetNextToken(v string) *DescribeBackupsInput { +func (s *DescribeDataRepositoryTasksInput) SetNextToken(v string) *DescribeDataRepositoryTasksInput { s.NextToken = &v return s } -// Response object for DescribeBackups operation. -type DescribeBackupsOutput struct { +// SetTaskIds sets the TaskIds field's value. +func (s *DescribeDataRepositoryTasksInput) SetTaskIds(v []*string) *DescribeDataRepositoryTasksInput { + s.TaskIds = v + return s +} + +type DescribeDataRepositoryTasksOutput struct { _ struct{} `type:"structure"` - // Any array of backups. - Backups []*Backup `type:"list"` + // The collection of data repository task descriptions returned. + DataRepositoryTasks []*DataRepositoryTask `type:"list"` - // This is present if there are more backups than returned in the response (String). - // You can use the NextToken value in the later request to fetch the backups. + // (Optional) Opaque pagination token returned from a previous operation (String). + // If present, this token indicates from what point you can continue processing + // the request, where the previous NextToken value left off. NextToken *string `min:"1" type:"string"` } // String returns the string representation -func (s DescribeBackupsOutput) String() string { +func (s DescribeDataRepositoryTasksOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeBackupsOutput) GoString() string { +func (s DescribeDataRepositoryTasksOutput) GoString() string { return s.String() } -// SetBackups sets the Backups field's value. -func (s *DescribeBackupsOutput) SetBackups(v []*Backup) *DescribeBackupsOutput { - s.Backups = v +// SetDataRepositoryTasks sets the DataRepositoryTasks field's value. +func (s *DescribeDataRepositoryTasksOutput) SetDataRepositoryTasks(v []*DataRepositoryTask) *DescribeDataRepositoryTasksOutput { + s.DataRepositoryTasks = v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeBackupsOutput) SetNextToken(v string) *DescribeBackupsOutput { +func (s *DescribeDataRepositoryTasksOutput) SetNextToken(v string) *DescribeDataRepositoryTasksOutput { s.NextToken = &v return s } @@ -2786,21 +4462,27 @@ type FileSystem struct { FileSystemType *string `type:"string" enum:"FileSystemType"` // The ID of the AWS Key Management Service (AWS KMS) key used to encrypt the - // file system's data for an Amazon FSx for Windows File Server file system. + // file system's data for Amazon FSx for Windows File Server file systems and + // persistent Amazon FSx for Lustre file systems at rest. In either case, if + // not specified, the Amazon FSx managed key is used. The scratch Amazon FSx + // for Lustre file systems are always encrypted at rest using Amazon FSx managed + // keys. For more information, see Encrypt (https://docs.aws.amazon.com/kms/latest/APIReference/API_Encrypt.html) + // in the AWS Key Management Service API Reference. KmsKeyId *string `min:"1" type:"string"` - // The lifecycle status of the file system: + // The lifecycle status of the file system, following are the possible values + // and what they mean: // - // * AVAILABLE indicates that the file system is reachable and available - // for use. + // * AVAILABLE - The file system is in a healthy state, and is reachable + // and available for use. // - // * CREATING indicates that Amazon FSx is in the process of creating the - // new file system. + // * CREATING - Amazon FSx is creating the new file system. // - // * DELETING indicates that Amazon FSx is in the process of deleting the - // file system. + // * DELETING - Amazon FSx is deleting an existing file system. // - // * FAILED indicates that Amazon FSx was not able to create the file system. + // * FAILED - An existing file system has experienced an unrecoverable failure. + // When creating a new file system, Amazon FSx was unable to create the file + // system. // // * MISCONFIGURED indicates that the file system is in a failed but recoverable // state. @@ -2832,7 +4514,7 @@ type FileSystem struct { ResourceARN *string `min:"8" type:"string"` // The storage capacity of the file system in gigabytes (GB). - StorageCapacity *int64 `min:"1" type:"integer"` + StorageCapacity *int64 `type:"integer"` // The ID of the subnet to contain the endpoint for the file system. One and // only one is supported. The file system is launched in the Availability Zone @@ -2982,6 +4664,63 @@ func (s *FileSystemFailureDetails) SetMessage(v string) *FileSystemFailureDetail return s } +// No Amazon FSx file systems were found based upon supplied parameters. +type FileSystemNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s FileSystemNotFound) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FileSystemNotFound) GoString() string { + return s.String() +} + +func newErrorFileSystemNotFound(v protocol.ResponseMetadata) error { + return &FileSystemNotFound{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FileSystemNotFound) Code() string { + return "FileSystemNotFound" +} + +// Message returns the exception's message. +func (s FileSystemNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FileSystemNotFound) OrigErr() error { + return nil +} + +func (s FileSystemNotFound) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FileSystemNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FileSystemNotFound) RequestID() string { + return s.respMetadata.RequestID +} + // A filter used to restrict the results of describe calls. You can use multiple // filters to return results that meet all applied filter requirements. type Filter struct { @@ -3005,16 +4744,383 @@ 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 +// 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 +} + +// The error returned when a second request is received with the same client +// request token but different parameters settings. A client request token should +// always uniquely identify a single request. +type IncompatibleParameterError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` + + // A parameter that is incompatible with the earlier request. + // + // Parameter is a required field + Parameter *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s IncompatibleParameterError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IncompatibleParameterError) GoString() string { + return s.String() +} + +func newErrorIncompatibleParameterError(v protocol.ResponseMetadata) error { + return &IncompatibleParameterError{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IncompatibleParameterError) Code() string { + return "IncompatibleParameterError" +} + +// Message returns the exception's message. +func (s IncompatibleParameterError) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IncompatibleParameterError) OrigErr() error { + return nil +} + +func (s IncompatibleParameterError) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IncompatibleParameterError) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IncompatibleParameterError) RequestID() string { + return s.respMetadata.RequestID +} + +// A generic error indicating a server-side failure. +type InternalServerError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s InternalServerError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerError) GoString() string { + return s.String() +} + +func newErrorInternalServerError(v protocol.ResponseMetadata) error { + return &InternalServerError{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerError) Code() string { + return "InternalServerError" +} + +// Message returns the exception's message. +func (s InternalServerError) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerError) OrigErr() error { + return nil +} + +func (s InternalServerError) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerError) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerError) RequestID() string { + return s.respMetadata.RequestID +} + +// The path provided for data repository export isn't valid. +type InvalidExportPath struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s InvalidExportPath) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidExportPath) GoString() string { + return s.String() +} + +func newErrorInvalidExportPath(v protocol.ResponseMetadata) error { + return &InvalidExportPath{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidExportPath) Code() string { + return "InvalidExportPath" +} + +// Message returns the exception's message. +func (s InvalidExportPath) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidExportPath) OrigErr() error { + return nil +} + +func (s InvalidExportPath) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidExportPath) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidExportPath) RequestID() string { + return s.respMetadata.RequestID +} + +// The path provided for data repository import isn't valid. +type InvalidImportPath struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s InvalidImportPath) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidImportPath) GoString() string { + return s.String() +} + +func newErrorInvalidImportPath(v protocol.ResponseMetadata) error { + return &InvalidImportPath{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidImportPath) Code() string { + return "InvalidImportPath" +} + +// Message returns the exception's message. +func (s InvalidImportPath) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidImportPath) OrigErr() error { + return nil +} + +func (s InvalidImportPath) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidImportPath) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidImportPath) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more network settings specified in the request are invalid. InvalidVpcId +// means that the ID passed for the virtual private cloud (VPC) is invalid. +// InvalidSubnetIds returns the list of IDs for subnets that are either invalid +// or not part of the VPC specified. InvalidSecurityGroupIds returns the list +// of IDs for security groups that are either invalid or not part of the VPC +// specified. +type InvalidNetworkSettings struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The ID of your Amazon EC2 security group. This ID is used to control network + // access to the endpoint that Amazon FSx creates on your behalf in each subnet. + // For more information, see Amazon EC2 Security Groups for Linux Instances + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-network-security.html) + // in the Amazon EC2 User Guide. + InvalidSecurityGroupId *string `min:"11" type:"string"` + + // The ID for a subnet. A subnet is a range of IP addresses in your virtual + // private cloud (VPC). For more information, see VPC and Subnets (https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Subnets.html) + // in the Amazon VPC User Guide. + InvalidSubnetId *string `min:"15" type:"string"` + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s InvalidNetworkSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNetworkSettings) GoString() string { + return s.String() +} + +func newErrorInvalidNetworkSettings(v protocol.ResponseMetadata) error { + return &InvalidNetworkSettings{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNetworkSettings) Code() string { + return "InvalidNetworkSettings" +} + +// Message returns the exception's message. +func (s InvalidNetworkSettings) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNetworkSettings) OrigErr() error { + return nil +} + +func (s InvalidNetworkSettings) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNetworkSettings) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNetworkSettings) RequestID() string { + return s.respMetadata.RequestID +} + +// An invalid value for PerUnitStorageThroughput was provided. Please create +// your file system again, using a valid value. +type InvalidPerUnitStorageThroughput struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s InvalidPerUnitStorageThroughput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPerUnitStorageThroughput) GoString() string { + return s.String() +} + +func newErrorInvalidPerUnitStorageThroughput(v protocol.ResponseMetadata) error { + return &InvalidPerUnitStorageThroughput{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPerUnitStorageThroughput) Code() string { + return "InvalidPerUnitStorageThroughput" +} + +// Message returns the exception's message. +func (s InvalidPerUnitStorageThroughput) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPerUnitStorageThroughput) OrigErr() error { + return nil +} + +func (s InvalidPerUnitStorageThroughput) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetValues sets the Values field's value. -func (s *Filter) SetValues(v []*string) *Filter { - s.Values = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPerUnitStorageThroughput) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPerUnitStorageThroughput) RequestID() string { + return s.respMetadata.RequestID } // The request object for ListTagsForResource operation. @@ -3130,6 +5236,23 @@ type LustreFileSystemConfiguration struct { // in the response of the CreateFileSystem operation. DataRepositoryConfiguration *DataRepositoryConfiguration `type:"structure"` + // The deployment type of the FSX for Lustre file system. + DeploymentType *string `type:"string" enum:"LustreDeploymentType"` + + // You use the MountName value when mounting the file system. + // + // For the SCRATCH_1 deployment type, this value is always "fsx". For SCRATCH_2 + // and PERSISTENT_1 deployment types, this value is a string that is unique + // within an AWS Region. + MountName *string `min:"1" type:"string"` + + // Per unit storage throughput represents the megabytes per second of read or + // write throughput per 1 tebibyte of storage provisioned. File system throughput + // capacity is equal to Storage capacity (TiB) * PerUnitStorageThroughput (MB/s/TiB). + // This option is only valid for PERSISTENT_1 deployment types. Valid values + // are 50, 100, 200. + PerUnitStorageThroughput *int64 `min:"50" type:"integer"` + // The UTC time that you want to begin your weekly maintenance window. WeeklyMaintenanceStartTime *string `min:"7" type:"string"` } @@ -3150,12 +5273,274 @@ func (s *LustreFileSystemConfiguration) SetDataRepositoryConfiguration(v *DataRe return s } +// SetDeploymentType sets the DeploymentType field's value. +func (s *LustreFileSystemConfiguration) SetDeploymentType(v string) *LustreFileSystemConfiguration { + s.DeploymentType = &v + return s +} + +// SetMountName sets the MountName field's value. +func (s *LustreFileSystemConfiguration) SetMountName(v string) *LustreFileSystemConfiguration { + s.MountName = &v + return s +} + +// SetPerUnitStorageThroughput sets the PerUnitStorageThroughput field's value. +func (s *LustreFileSystemConfiguration) SetPerUnitStorageThroughput(v int64) *LustreFileSystemConfiguration { + s.PerUnitStorageThroughput = &v + return s +} + // SetWeeklyMaintenanceStartTime sets the WeeklyMaintenanceStartTime field's value. func (s *LustreFileSystemConfiguration) SetWeeklyMaintenanceStartTime(v string) *LustreFileSystemConfiguration { s.WeeklyMaintenanceStartTime = &v return s } +// A file system configuration is required for this operation. +type MissingFileSystemConfiguration struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s MissingFileSystemConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MissingFileSystemConfiguration) GoString() string { + return s.String() +} + +func newErrorMissingFileSystemConfiguration(v protocol.ResponseMetadata) error { + return &MissingFileSystemConfiguration{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MissingFileSystemConfiguration) Code() string { + return "MissingFileSystemConfiguration" +} + +// Message returns the exception's message. +func (s MissingFileSystemConfiguration) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MissingFileSystemConfiguration) OrigErr() error { + return nil +} + +func (s MissingFileSystemConfiguration) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MissingFileSystemConfiguration) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MissingFileSystemConfiguration) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource specified for the tagging operation is not a resource type owned +// by Amazon FSx. Use the API of the relevant service to perform the operation. +type NotServiceResourceError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the non-Amazon FSx resource. + // + // ResourceARN is a required field + ResourceARN *string `min:"8" type:"string" required:"true"` +} + +// String returns the string representation +func (s NotServiceResourceError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotServiceResourceError) GoString() string { + return s.String() +} + +func newErrorNotServiceResourceError(v protocol.ResponseMetadata) error { + return &NotServiceResourceError{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotServiceResourceError) Code() string { + return "NotServiceResourceError" +} + +// Message returns the exception's message. +func (s NotServiceResourceError) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotServiceResourceError) OrigErr() error { + return nil +} + +func (s NotServiceResourceError) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotServiceResourceError) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotServiceResourceError) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource specified does not support tagging. +type ResourceDoesNotSupportTagging struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the resource that doesn't support tagging. + // + // ResourceARN is a required field + ResourceARN *string `min:"8" type:"string" required:"true"` +} + +// String returns the string representation +func (s ResourceDoesNotSupportTagging) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceDoesNotSupportTagging) GoString() string { + return s.String() +} + +func newErrorResourceDoesNotSupportTagging(v protocol.ResponseMetadata) error { + return &ResourceDoesNotSupportTagging{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceDoesNotSupportTagging) Code() string { + return "ResourceDoesNotSupportTagging" +} + +// Message returns the exception's message. +func (s ResourceDoesNotSupportTagging) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceDoesNotSupportTagging) OrigErr() error { + return nil +} + +func (s ResourceDoesNotSupportTagging) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceDoesNotSupportTagging) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceDoesNotSupportTagging) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource specified by the Amazon Resource Name (ARN) can't be found. +type ResourceNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` + + // The resource ARN of the resource that can't be found. + // + // ResourceARN is a required field + ResourceARN *string `min:"8" type:"string" required:"true"` +} + +// String returns the string representation +func (s ResourceNotFound) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFound) GoString() string { + return s.String() +} + +func newErrorResourceNotFound(v protocol.ResponseMetadata) error { + return &ResourceNotFound{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFound) Code() string { + return "ResourceNotFound" +} + +// Message returns the exception's message. +func (s ResourceNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFound) OrigErr() error { + return nil +} + +func (s ResourceNotFound) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFound) RequestID() string { + return s.respMetadata.RequestID +} + // The configuration of the self-managed Microsoft Active Directory (AD) directory // to which the Windows File Server instance is joined. type SelfManagedActiveDirectoryAttributes struct { @@ -3166,7 +5551,7 @@ type SelfManagedActiveDirectoryAttributes struct { DnsIps []*string `min:"1" type:"list"` // The fully qualified domain name of the self-managed AD directory. - DomainName *string `type:"string"` + DomainName *string `min:"1" type:"string"` // The name of the domain group whose members have administrative privileges // for the FSx file system. @@ -3231,7 +5616,7 @@ type SelfManagedActiveDirectoryConfiguration struct { // A list of up to two IP addresses of DNS servers or domain controllers in // the self-managed AD directory. The IP addresses need to be either in the // same VPC CIDR range as the one in which your Amazon FSx file system is being - // created, or in the private IP version 4 (Iv4) address ranges, as specified + // created, or in the private IP version 4 (IPv4) address ranges, as specified // in RFC 1918 (http://www.faqs.org/rfcs/rfc1918.html): // // * 10.0.0.0 - 10.255.255.255 (10/8 prefix) @@ -3247,12 +5632,13 @@ type SelfManagedActiveDirectoryConfiguration struct { // corp.example.com. // // DomainName is a required field - DomainName *string `type:"string" required:"true"` + DomainName *string `min:"1" type:"string" required:"true"` // (Optional) The name of the domain group whose members are granted administrative // privileges for the file system. Administrative privileges include taking - // ownership of files and folders, and setting audit controls (audit ACLs) on - // files and folders. The group that you specify must already exist in your + // ownership of files and folders, setting audit controls (audit ACLs) on files + // and folders, and administering the file system remotely by using the FSx + // Remote PowerShell. The group that you specify must already exist in your // domain. If you don't provide one, your AD domain's Domain Admins group is // used. FileSystemAdministratorsGroup *string `min:"1" type:"string"` @@ -3306,6 +5692,9 @@ func (s *SelfManagedActiveDirectoryConfiguration) Validate() error { 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.FileSystemAdministratorsGroup != nil && len(*s.FileSystemAdministratorsGroup) < 1 { invalidParams.Add(request.NewErrParamMinLen("FileSystemAdministratorsGroup", 1)) } @@ -3434,6 +5823,69 @@ func (s *SelfManagedActiveDirectoryConfigurationUpdates) SetUserName(v string) * return s } +// An error indicating that a particular service limit was exceeded. You can +// increase some service limits by contacting AWS Support. +type ServiceLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Enumeration of the service limit that was exceeded. + // + // Limit is a required field + Limit *string `type:"string" required:"true" enum:"ServiceLimit"` + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s ServiceLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceLimitExceeded) GoString() string { + return s.String() +} + +func newErrorServiceLimitExceeded(v protocol.ResponseMetadata) error { + return &ServiceLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceLimitExceeded) Code() string { + return "ServiceLimitExceeded" +} + +// Message returns the exception's message. +func (s ServiceLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceLimitExceeded) OrigErr() error { + return nil +} + +func (s ServiceLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + // Specifies a key-value pair for a resource tag. type Tag struct { _ struct{} `type:"structure"` @@ -3570,6 +6022,63 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// The requested operation is not supported for this resource or API. +type UnsupportedOperation struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A detailed error message. + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s UnsupportedOperation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedOperation) GoString() string { + return s.String() +} + +func newErrorUnsupportedOperation(v protocol.ResponseMetadata) error { + return &UnsupportedOperation{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedOperation) Code() string { + return "UnsupportedOperation" +} + +// Message returns the exception's message. +func (s UnsupportedOperation) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedOperation) OrigErr() error { + return nil +} + +func (s UnsupportedOperation) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedOperation) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedOperation) RequestID() string { + return s.respMetadata.RequestID +} + // The request object for UntagResource action. type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -3888,14 +6397,55 @@ type WindowsFileSystemConfiguration struct { // the file system are copied to all automatic backups and any user-initiated // backups where the user doesn't specify any tags. If this value is true, and // you specify one or more tags, only the specified tags are copied to backups. + // If you specify one or more tags when creating a user-initiated backup, no + // tags are copied from the file system, regardless of this value. CopyTagsToBackups *bool `type:"boolean"` // The preferred time to take daily automatic backups, in the UTC time zone. DailyAutomaticBackupStartTime *string `min:"5" type:"string"` + // Specifies the file system deployment type, valid values are the following: + // + // * MULTI_AZ_1 - Specifies a high availability file system that is configured + // for Multi-AZ redundancy to tolerate temporary Availability Zone (AZ) unavailability. + // + // * SINGLE_AZ_1 - (Default) Specifies a file system that is configured for + // single AZ redundancy. + DeploymentType *string `type:"string" enum:"WindowsDeploymentType"` + // The list of maintenance operations in progress for this file system. MaintenanceOperationsInProgress []*string `type:"list"` + // For MULTI_AZ_1 deployment types, the IP address of the primary, or preferred, + // file server. + // + // Use this IP address when mounting the file system on Linux SMB clients or + // Windows SMB clients that are not joined to a Microsoft Active Directory. + // Applicable for both SINGLE_AZ_1 and MULTI_AZ_1 deployment types. This IP + // address is temporarily unavailable when the file system is undergoing maintenance. + // For Linux and Windows SMB clients that are joined to an Active Directory, + // use the file system's DNSName instead. For more information and instruction + // on mapping and mounting file shares, see https://docs.aws.amazon.com/fsx/latest/WindowsGuide/accessing-file-shares.html + // (https://docs.aws.amazon.com/fsx/latest/WindowsGuide/accessing-file-shares.html). + PreferredFileServerIp *string `min:"7" type:"string"` + + // For MULTI_AZ_1 deployment types, it specifies the ID of the subnet where + // the preferred file server is located. Must be one of the two subnet IDs specified + // in SubnetIds property. Amazon FSx serves traffic from this subnet except + // in the event of a failover to the secondary file server. + // + // For SINGLE_AZ_1 deployment types, this value is the same as that for SubnetIDs. + PreferredSubnetId *string `min:"15" type:"string"` + + // For MULTI_AZ_1 deployment types, use this endpoint when performing administrative + // tasks on the file system using Amazon FSx Remote PowerShell. + // + // For SINGLE_AZ_1 deployment types, this is the DNS name of the file system. + // + // This endpoint is temporarily unavailable when the file system is undergoing + // maintenance. + RemoteAdministrationEndpoint *string `min:"16" type:"string"` + // The configuration of the self-managed Microsoft Active Directory (AD) directory // to which the Windows File Server instance is joined. SelfManagedActiveDirectoryConfiguration *SelfManagedActiveDirectoryAttributes `type:"structure"` @@ -3941,12 +6491,36 @@ func (s *WindowsFileSystemConfiguration) SetDailyAutomaticBackupStartTime(v stri return s } +// SetDeploymentType sets the DeploymentType field's value. +func (s *WindowsFileSystemConfiguration) SetDeploymentType(v string) *WindowsFileSystemConfiguration { + s.DeploymentType = &v + return s +} + // SetMaintenanceOperationsInProgress sets the MaintenanceOperationsInProgress field's value. func (s *WindowsFileSystemConfiguration) SetMaintenanceOperationsInProgress(v []*string) *WindowsFileSystemConfiguration { s.MaintenanceOperationsInProgress = v return s } +// SetPreferredFileServerIp sets the PreferredFileServerIp field's value. +func (s *WindowsFileSystemConfiguration) SetPreferredFileServerIp(v string) *WindowsFileSystemConfiguration { + s.PreferredFileServerIp = &v + return s +} + +// SetPreferredSubnetId sets the PreferredSubnetId field's value. +func (s *WindowsFileSystemConfiguration) SetPreferredSubnetId(v string) *WindowsFileSystemConfiguration { + s.PreferredSubnetId = &v + return s +} + +// SetRemoteAdministrationEndpoint sets the RemoteAdministrationEndpoint field's value. +func (s *WindowsFileSystemConfiguration) SetRemoteAdministrationEndpoint(v string) *WindowsFileSystemConfiguration { + s.RemoteAdministrationEndpoint = &v + return s +} + // SetSelfManagedActiveDirectoryConfiguration sets the SelfManagedActiveDirectoryConfiguration field's value. func (s *WindowsFileSystemConfiguration) SetSelfManagedActiveDirectoryConfiguration(v *SelfManagedActiveDirectoryAttributes) *WindowsFileSystemConfiguration { s.SelfManagedActiveDirectoryConfiguration = v @@ -4009,6 +6583,39 @@ const ( BackupTypeUserInitiated = "USER_INITIATED" ) +const ( + // DataRepositoryTaskFilterNameFileSystemId is a DataRepositoryTaskFilterName enum value + DataRepositoryTaskFilterNameFileSystemId = "file-system-id" + + // DataRepositoryTaskFilterNameTaskLifecycle is a DataRepositoryTaskFilterName enum value + DataRepositoryTaskFilterNameTaskLifecycle = "task-lifecycle" +) + +const ( + // DataRepositoryTaskLifecyclePending is a DataRepositoryTaskLifecycle enum value + DataRepositoryTaskLifecyclePending = "PENDING" + + // DataRepositoryTaskLifecycleExecuting is a DataRepositoryTaskLifecycle enum value + DataRepositoryTaskLifecycleExecuting = "EXECUTING" + + // DataRepositoryTaskLifecycleFailed is a DataRepositoryTaskLifecycle enum value + DataRepositoryTaskLifecycleFailed = "FAILED" + + // DataRepositoryTaskLifecycleSucceeded is a DataRepositoryTaskLifecycle enum value + DataRepositoryTaskLifecycleSucceeded = "SUCCEEDED" + + // DataRepositoryTaskLifecycleCanceled is a DataRepositoryTaskLifecycle enum value + DataRepositoryTaskLifecycleCanceled = "CANCELED" + + // DataRepositoryTaskLifecycleCanceling is a DataRepositoryTaskLifecycle enum value + DataRepositoryTaskLifecycleCanceling = "CANCELING" +) + +const ( + // DataRepositoryTaskTypeExportToRepository is a DataRepositoryTaskType enum value + DataRepositoryTaskTypeExportToRepository = "EXPORT_TO_REPOSITORY" +) + // The lifecycle status of the file system. const ( // FileSystemLifecycleAvailable is a FileSystemLifecycle enum value @@ -4057,6 +6664,27 @@ const ( FilterNameBackupType = "backup-type" ) +const ( + // LustreDeploymentTypeScratch1 is a LustreDeploymentType enum value + LustreDeploymentTypeScratch1 = "SCRATCH_1" + + // LustreDeploymentTypeScratch2 is a LustreDeploymentType enum value + LustreDeploymentTypeScratch2 = "SCRATCH_2" + + // LustreDeploymentTypePersistent1 is a LustreDeploymentType enum value + LustreDeploymentTypePersistent1 = "PERSISTENT_1" +) + +const ( + // ReportFormatReportCsv20191124 is a ReportFormat enum value + ReportFormatReportCsv20191124 = "REPORT_CSV_20191124" +) + +const ( + // ReportScopeFailedFilesOnly is a ReportScope enum value + ReportScopeFailedFilesOnly = "FAILED_FILES_ONLY" +) + // The types of limits on your service utilization. Limits include file system // count, total throughput capacity, total storage, and total user-initiated // backups. These limits apply for a specific account in a specific AWS Region. @@ -4074,3 +6702,11 @@ const ( // ServiceLimitTotalUserInitiatedBackups is a ServiceLimit enum value ServiceLimitTotalUserInitiatedBackups = "TOTAL_USER_INITIATED_BACKUPS" ) + +const ( + // WindowsDeploymentTypeMultiAz1 is a WindowsDeploymentType enum value + WindowsDeploymentTypeMultiAz1 = "MULTI_AZ_1" + + // WindowsDeploymentTypeSingleAz1 is a WindowsDeploymentType enum value + WindowsDeploymentTypeSingleAz1 = "SINGLE_AZ_1" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/fsx/errors.go b/vendor/github.com/aws/aws-sdk-go/service/fsx/errors.go index 42a1e80601b..a827e7345c6 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/fsx/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/fsx/errors.go @@ -2,6 +2,10 @@ package fsx +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeActiveDirectoryError for service response error code @@ -35,6 +39,26 @@ const ( // A generic error indicating a failure with a client request. ErrCodeBadRequest = "BadRequest" + // ErrCodeDataRepositoryTaskEnded for service response error code + // "DataRepositoryTaskEnded". + // + // The data repository task could not be canceled because the task has already + // ended. + ErrCodeDataRepositoryTaskEnded = "DataRepositoryTaskEnded" + + // ErrCodeDataRepositoryTaskExecuting for service response error code + // "DataRepositoryTaskExecuting". + // + // An existing data repository task is currently executing on the file system. + // Wait until the existing task has completed, then create the new task. + ErrCodeDataRepositoryTaskExecuting = "DataRepositoryTaskExecuting" + + // ErrCodeDataRepositoryTaskNotFound for service response error code + // "DataRepositoryTaskNotFound". + // + // The data repository task or tasks you specified could not be found. + ErrCodeDataRepositoryTaskNotFound = "DataRepositoryTaskNotFound" + // ErrCodeFileSystemNotFound for service response error code // "FileSystemNotFound". // @@ -78,10 +102,17 @@ const ( // specified. ErrCodeInvalidNetworkSettings = "InvalidNetworkSettings" + // ErrCodeInvalidPerUnitStorageThroughput for service response error code + // "InvalidPerUnitStorageThroughput". + // + // An invalid value for PerUnitStorageThroughput was provided. Please create + // your file system again, using a valid value. + ErrCodeInvalidPerUnitStorageThroughput = "InvalidPerUnitStorageThroughput" + // ErrCodeMissingFileSystemConfiguration for service response error code // "MissingFileSystemConfiguration". // - // File system configuration is required for this operation. + // A file system configuration is required for this operation. ErrCodeMissingFileSystemConfiguration = "MissingFileSystemConfiguration" // ErrCodeNotServiceResourceError for service response error code @@ -113,6 +144,30 @@ const ( // ErrCodeUnsupportedOperation for service response error code // "UnsupportedOperation". // - // An error occured. + // The requested operation is not supported for this resource or API. ErrCodeUnsupportedOperation = "UnsupportedOperation" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ActiveDirectoryError": newErrorActiveDirectoryError, + "BackupInProgress": newErrorBackupInProgress, + "BackupNotFound": newErrorBackupNotFound, + "BackupRestoring": newErrorBackupRestoring, + "BadRequest": newErrorBadRequest, + "DataRepositoryTaskEnded": newErrorDataRepositoryTaskEnded, + "DataRepositoryTaskExecuting": newErrorDataRepositoryTaskExecuting, + "DataRepositoryTaskNotFound": newErrorDataRepositoryTaskNotFound, + "FileSystemNotFound": newErrorFileSystemNotFound, + "IncompatibleParameterError": newErrorIncompatibleParameterError, + "InternalServerError": newErrorInternalServerError, + "InvalidExportPath": newErrorInvalidExportPath, + "InvalidImportPath": newErrorInvalidImportPath, + "InvalidNetworkSettings": newErrorInvalidNetworkSettings, + "InvalidPerUnitStorageThroughput": newErrorInvalidPerUnitStorageThroughput, + "MissingFileSystemConfiguration": newErrorMissingFileSystemConfiguration, + "NotServiceResourceError": newErrorNotServiceResourceError, + "ResourceDoesNotSupportTagging": newErrorResourceDoesNotSupportTagging, + "ResourceNotFound": newErrorResourceNotFound, + "ServiceLimitExceeded": newErrorServiceLimitExceeded, + "UnsupportedOperation": newErrorUnsupportedOperation, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/fsx/service.go b/vendor/github.com/aws/aws-sdk-go/service/fsx/service.go index 544a82e1b07..48ab3b57d31 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/fsx/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/fsx/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "FSx" // Name of service. EndpointsID = "fsx" // ID to lookup a service endpoint with. - ServiceID = "FSx" // ServiceID is a unique identifer of a specific service. + ServiceID = "FSx" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the FSx client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a FSx client from just a session. // svc := fsx.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := fsx.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *FSx { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *FSx { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *FSx { svc := &FSx{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-03-01", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/gamelift/api.go b/vendor/github.com/aws/aws-sdk-go/service/gamelift/api.go index 5fffd192979..9f89e27cd63 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/gamelift/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/gamelift/api.go @@ -106,22 +106,22 @@ func (c *GameLift) AcceptMatchRequest(input *AcceptMatchInput) (req *request.Req // See the AWS API reference guide for Amazon GameLift's // API operation AcceptMatch for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnsupportedRegionException "UnsupportedRegionException" -// The requested operation is not supported in the region specified. +// * UnsupportedRegionException +// The requested operation is not supported in the Region specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/AcceptMatch func (c *GameLift) AcceptMatch(input *AcceptMatchInput) (*AcceptMatchOutput, error) { @@ -190,11 +190,9 @@ func (c *GameLift) CreateAliasRequest(input *CreateAliasInput) (req *request.Req // CreateAlias API operation for Amazon GameLift. // // Creates an alias for a fleet. In most situations, you can use an alias ID -// in place of a fleet ID. By using a fleet alias instead of a specific fleet -// ID, you can switch gameplay and players to a new fleet without changing your -// game client or other game components. For example, for games in production, -// using an alias allows you to seamlessly redirect your player base to a new -// game server update. +// in place of a fleet ID. An alias provides a level of abstraction for a fleet +// that is useful when redirecting player traffic from one fleet to another, +// such as when updating your game build. // // Amazon GameLift supports two types of routing strategies for aliases: simple // and terminal. A simple alias points to an active fleet. A terminal alias @@ -206,8 +204,8 @@ func (c *GameLift) CreateAliasRequest(input *CreateAliasInput) (req *request.Req // To create a fleet alias, specify an alias name, routing strategy, and optional // description. Each simple alias can point to only one fleet, but a fleet can // have multiple aliases. If successful, a new alias record is returned, including -// an alias ID, which you can reference when creating a game session. You can -// reassign an alias to another fleet by calling UpdateAlias. +// an alias ID and an ARN. You can reassign an alias to another fleet by calling +// UpdateAlias. // // * CreateAlias // @@ -228,28 +226,33 @@ func (c *GameLift) CreateAliasRequest(input *CreateAliasInput) (req *request.Req // See the AWS API reference guide for Amazon GameLift's // API operation CreateAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested operation would cause the resource to exceed the allowed service // limit. Resolve the issue before retrying. // +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/CreateAlias func (c *GameLift) CreateAlias(input *CreateAliasInput) (*CreateAliasOutput, error) { req, out := c.CreateAliasRequest(input) @@ -320,30 +323,30 @@ func (c *GameLift) CreateBuildRequest(input *CreateBuildInput) (req *request.Req // and points to the location of your game server build files in an Amazon Simple // Storage Service (Amazon S3) location. // -// Game server binaries must be combined into a .zip file for use with Amazon +// Game server binaries must be combined into a zip file for use with Amazon // GameLift. // -// To create new builds quickly and easily, use the AWS CLI command upload-build -// (https://docs.aws.amazon.com/cli/latest/reference/gamelift/upload-build.html) -// . This helper command uploads your build and creates a new build record in -// one step, and automatically handles the necessary permissions. +// To create new builds directly from a file directory, use the AWS CLI command +// upload-build (https://docs.aws.amazon.com/cli/latest/reference/gamelift/upload-build.html) +// . This helper command uploads build files and creates a new build record +// in one step, and automatically handles the necessary permissions. // -// The CreateBuild operation should be used only when you need to manually upload -// your build files, as in the following scenarios: +// The CreateBuild operation should be used only in the following scenarios: // -// * Store a build file in an Amazon S3 bucket under your own AWS account. -// To use this option, you must first give Amazon GameLift access to that -// Amazon S3 bucket. To create a new build record using files in your Amazon -// S3 bucket, call CreateBuild and specify a build name, operating system, -// and the storage location of your game build. +// * To create a new game build with build files that are in an Amazon S3 +// bucket under your own AWS account. To use this option, you must first +// give Amazon GameLift access to that Amazon S3 bucket. Then call CreateBuild +// and specify a build name, operating system, and the Amazon S3 storage +// location of your game build. // -// * Upload a build file directly to Amazon GameLift's Amazon S3 account. -// To use this option, you first call CreateBuild with a build name and operating -// system. This action creates a new build record and returns an Amazon S3 -// storage location (bucket and key only) and temporary access credentials. -// Use the credentials to manually upload your build file to the storage -// location (see the Amazon S3 topic Uploading Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/UploadingObjects.html)). -// You can upload files to a location only once. +// * To upload build files directly to Amazon GameLift's Amazon S3 account. +// To use this option, first call CreateBuild and specify a build name and +// operating system. This action creates a new build record and returns an +// Amazon S3 storage location (bucket and key only) and temporary access +// credentials. Use the credentials to manually upload your build file to +// the provided storage location (see the Amazon S3 topic Uploading Objects +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/UploadingObjects.html)). +// You can upload build files to the GameLift Amazon S3 location only once. // // If successful, this operation creates a new build record with a unique build // ID and places it in INITIALIZED status. You can use DescribeBuild to check @@ -353,6 +356,8 @@ func (c *GameLift) CreateBuildRequest(input *CreateBuildInput) (req *request.Req // Learn more // // Uploading Your Game (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-intro.html) +// https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html +// (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // // Create a Build with Files in Amazon S3 (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-cli-uploading.html#gamelift-build-cli-uploading-create-build) // @@ -375,20 +380,25 @@ func (c *GameLift) CreateBuildRequest(input *CreateBuildInput) (req *request.Req // See the AWS API reference guide for Amazon GameLift's // API operation CreateBuild for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. +// +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -469,14 +479,9 @@ func (c *GameLift) CreateFleetRequest(input *CreateFleetInput) (req *request.Req // To create a new fleet, you must provide the following: (1) a fleet name, // (2) an EC2 instance type and fleet type (spot or on-demand), (3) the build // ID for your game build or script ID if using Realtime Servers, and (4) a -// run-time configuration, which determines how game servers will run on each +// runtime configuration, which determines how game servers will run on each // instance in the fleet. // -// When creating a Realtime Servers fleet, we recommend using a minimal version -// of the Realtime script (see this working code example (https://docs.aws.amazon.com/gamelift/latest/developerguide/realtime-script.html#realtime-script-examples)). -// This will make it much easier to troubleshoot any fleet creation issues. -// Once the fleet is active, you can update your Realtime script as needed. -// // If the CreateFleet call is successful, Amazon GameLift performs the following // tasks. You can track the process of a fleet by checking the fleet status // or by monitoring fleet creation events: @@ -484,25 +489,26 @@ func (c *GameLift) CreateFleetRequest(input *CreateFleetInput) (req *request.Req // * Creates a fleet record. Status: NEW. // // * Begins writing events to the fleet event log, which can be accessed -// in the Amazon GameLift console. Sets the fleet's target capacity to 1 -// (desired instances), which triggers Amazon GameLift to start one new EC2 -// instance. +// in the Amazon GameLift console. +// +// * Sets the fleet's target capacity to 1 (desired instances), which triggers +// Amazon GameLift to start one new EC2 instance. // // * Downloads the game build or Realtime script to the new instance and // installs it. Statuses: DOWNLOADING, VALIDATING, BUILDING. // // * Starts launching server processes on the instance. If the fleet is configured // to run multiple server processes per instance, Amazon GameLift staggers -// each launch by a few seconds. Status: ACTIVATING. +// each process launch by a few seconds. Status: ACTIVATING. // // * Sets the fleet's status to ACTIVE as soon as one server process is ready // to host a game session. // // Learn more // -// Working with Fleets (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) +// Setting Up Fleets (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-intro.html) // -// Debug Fleet Creation Issues (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-debug.html) +// Debug Fleet Creation Issues (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-debug.html#fleets-creating-debug-creation) // // Related operations // @@ -512,12 +518,9 @@ func (c *GameLift) CreateFleetRequest(input *CreateFleetInput) (req *request.Req // // * DeleteFleet // -// * Describe fleets: DescribeFleetAttributes DescribeFleetCapacity DescribeFleetPortSettings -// DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits -// DescribeFleetEvents +// * DescribeFleetAttributes // -// * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings -// UpdateRuntimeConfiguration +// * UpdateFleetAttributes // // * Manage fleet actions: StartFleetActions StopFleetActions // @@ -528,32 +531,37 @@ func (c *GameLift) CreateFleetRequest(input *CreateFleetInput) (req *request.Req // See the AWS API reference guide for Amazon GameLift's // API operation CreateFleet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested operation would cause the resource to exceed the allowed service // limit. Resolve the issue before retrying. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/CreateFleet func (c *GameLift) CreateFleet(input *CreateFleetInput) (*CreateFleetOutput, error) { req, out := c.CreateFleetRequest(input) @@ -673,49 +681,49 @@ func (c *GameLift) CreateGameSessionRequest(input *CreateGameSessionInput) (req // See the AWS API reference guide for Amazon GameLift's // API operation CreateGameSession for usage and error information. // -// Returned Error Codes: -// * ErrCodeConflictException "ConflictException" +// Returned Error Types: +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidFleetStatusException "InvalidFleetStatusException" +// * InvalidFleetStatusException // The requested operation would cause a conflict with the current state of // a resource associated with the request and/or the fleet. Resolve the conflict // before retrying. // -// * ErrCodeTerminalRoutingStrategyException "TerminalRoutingStrategyException" +// * TerminalRoutingStrategyException // The service is unable to resolve the routing for a particular alias because // it has a terminal RoutingStrategy associated with it. The message returned // in this exception is the message defined in the routing strategy itself. // Such requests should only be retried if the routing strategy for the specified // alias is modified. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeFleetCapacityExceededException "FleetCapacityExceededException" +// * FleetCapacityExceededException // The specified fleet has no available instances to fulfill a CreateGameSession // request. Clients can retry such requests immediately or after a waiting period. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested operation would cause the resource to exceed the allowed service // limit. Resolve the issue before retrying. // -// * ErrCodeIdempotentParameterMismatchException "IdempotentParameterMismatchException" +// * IdempotentParameterMismatchException // A game session with this custom ID string already exists in this fleet. Resolve // this conflict before retrying this request. // @@ -789,7 +797,7 @@ func (c *GameLift) CreateGameSessionQueueRequest(input *CreateGameSessionQueueIn // A queue identifies where new game sessions can be hosted -- by specifying // a list of destinations (fleets or aliases) -- and how long requests can wait // in the queue before timing out. You can set up a queue to try to place game -// sessions on fleets in multiple regions. To add placement requests to a queue, +// sessions on fleets in multiple Regions. To add placement requests to a queue, // call StartGameSessionPlacement and reference the queue name. // // Destination order. When processing a request for a game session, Amazon GameLift @@ -831,23 +839,28 @@ func (c *GameLift) CreateGameSessionQueueRequest(input *CreateGameSessionQueueIn // See the AWS API reference guide for Amazon GameLift's // API operation CreateGameSessionQueue for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested operation would cause the resource to exceed the allowed service // limit. Resolve the issue before retrying. // +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/CreateGameSessionQueue func (c *GameLift) CreateGameSessionQueue(input *CreateGameSessionQueueInput) (*CreateGameSessionQueueOutput, error) { req, out := c.CreateGameSessionQueueRequest(input) @@ -966,26 +979,31 @@ func (c *GameLift) CreateMatchmakingConfigurationRequest(input *CreateMatchmakin // See the AWS API reference guide for Amazon GameLift's // API operation CreateMatchmakingConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested operation would cause the resource to exceed the allowed service // limit. Resolve the issue before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnsupportedRegionException "UnsupportedRegionException" -// The requested operation is not supported in the region specified. +// * UnsupportedRegionException +// The requested operation is not supported in the Region specified. +// +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/CreateMatchmakingConfiguration func (c *GameLift) CreateMatchmakingConfiguration(input *CreateMatchmakingConfigurationInput) (*CreateMatchmakingConfigurationOutput, error) { @@ -1054,12 +1072,12 @@ func (c *GameLift) CreateMatchmakingRuleSetRequest(input *CreateMatchmakingRuleS // CreateMatchmakingRuleSet API operation for Amazon GameLift. // // Creates a new rule set for FlexMatch matchmaking. A rule set describes the -// type of match to create, such as the number and size of teams, and sets the -// parameters for acceptable player matches, such as minimum skill level or -// character type. A rule set is used by a MatchmakingConfiguration. +// type of match to create, such as the number and size of teams. It also sets +// the parameters for acceptable player matches, such as minimum skill level +// or character type. A rule set is used by a MatchmakingConfiguration. // // To create a matchmaking rule set, provide unique rule set name and the rule -// set body in JSON format. Rule sets must be defined in the same region as +// set body in JSON format. Rule sets must be defined in the same Region as // the matchmaking configuration they are used with. // // Since matchmaking rule sets cannot be edited, it is a good idea to check @@ -1099,18 +1117,23 @@ func (c *GameLift) CreateMatchmakingRuleSetRequest(input *CreateMatchmakingRuleS // See the AWS API reference guide for Amazon GameLift's // API operation CreateMatchmakingRuleSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnsupportedRegionException "UnsupportedRegionException" -// The requested operation is not supported in the region specified. +// * UnsupportedRegionException +// The requested operation is not supported in the Region specified. +// +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/CreateMatchmakingRuleSet func (c *GameLift) CreateMatchmakingRuleSet(input *CreateMatchmakingRuleSetInput) (*CreateMatchmakingRuleSetOutput, error) { @@ -1209,36 +1232,36 @@ func (c *GameLift) CreatePlayerSessionRequest(input *CreatePlayerSessionInput) ( // See the AWS API reference guide for Amazon GameLift's // API operation CreatePlayerSession for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidGameSessionStatusException "InvalidGameSessionStatusException" +// * InvalidGameSessionStatusException // The requested operation would cause a conflict with the current state of // a resource associated with the request and/or the game instance. Resolve // the conflict before retrying. // -// * ErrCodeGameSessionFullException "GameSessionFullException" +// * GameSessionFullException // The game instance is currently full and cannot allow the requested player(s) // to join. Clients can retry such requests immediately or after a waiting period. // -// * ErrCodeTerminalRoutingStrategyException "TerminalRoutingStrategyException" +// * TerminalRoutingStrategyException // The service is unable to resolve the routing for a particular alias because // it has a terminal RoutingStrategy associated with it. The message returned // in this exception is the message defined in the routing strategy itself. // Such requests should only be retried if the routing strategy for the specified // alias is modified. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // @@ -1339,36 +1362,36 @@ func (c *GameLift) CreatePlayerSessionsRequest(input *CreatePlayerSessionsInput) // See the AWS API reference guide for Amazon GameLift's // API operation CreatePlayerSessions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidGameSessionStatusException "InvalidGameSessionStatusException" +// * InvalidGameSessionStatusException // The requested operation would cause a conflict with the current state of // a resource associated with the request and/or the game instance. Resolve // the conflict before retrying. // -// * ErrCodeGameSessionFullException "GameSessionFullException" +// * GameSessionFullException // The game instance is currently full and cannot allow the requested player(s) // to join. Clients can retry such requests immediately or after a waiting period. // -// * ErrCodeTerminalRoutingStrategyException "TerminalRoutingStrategyException" +// * TerminalRoutingStrategyException // The service is unable to resolve the routing for a particular alias because // it has a terminal RoutingStrategy associated with it. The message returned // in this exception is the message defined in the routing strategy itself. // Such requests should only be retried if the routing strategy for the specified // alias is modified. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // @@ -1486,20 +1509,25 @@ func (c *GameLift) CreateScriptRequest(input *CreateScriptInput) (req *request.R // See the AWS API reference guide for Amazon GameLift's // API operation CreateScript for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. +// +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -1579,7 +1607,7 @@ func (c *GameLift) CreateVpcPeeringAuthorizationRequest(input *CreateVpcPeeringA // // You can peer with VPCs that are owned by any AWS account you have access // to, including the account that you use to manage your Amazon GameLift fleets. -// You cannot peer with VPCs that are in different regions. +// You cannot peer with VPCs that are in different Regions. // // To request authorization to create a connection, call this operation from // the AWS account with the VPC that you want to peer to your Amazon GameLift @@ -1618,19 +1646,19 @@ func (c *GameLift) CreateVpcPeeringAuthorizationRequest(input *CreateVpcPeeringA // See the AWS API reference guide for Amazon GameLift's // API operation CreateVpcPeeringAuthorization for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -1707,7 +1735,7 @@ func (c *GameLift) CreateVpcPeeringConnectionRequest(input *CreateVpcPeeringConn // enables the game servers on your fleet to communicate directly with other // AWS resources. You can peer with VPCs in any AWS account that you have access // to, including the account that you use to manage your Amazon GameLift fleets. -// You cannot peer with VPCs that are in different regions. For more information, +// You cannot peer with VPCs that are in different Regions. For more information, // see VPC Peering with Amazon GameLift Fleets (https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html). // // Before calling this operation to establish the peering connection, you first @@ -1745,19 +1773,19 @@ func (c *GameLift) CreateVpcPeeringConnectionRequest(input *CreateVpcPeeringConn // See the AWS API reference guide for Amazon GameLift's // API operation CreateVpcPeeringConnection for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -1852,19 +1880,24 @@ func (c *GameLift) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Req // See the AWS API reference guide for Amazon GameLift's // API operation DeleteAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. +// +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -1966,20 +1999,25 @@ func (c *GameLift) DeleteBuildRequest(input *DeleteBuildInput) (req *request.Req // See the AWS API reference guide for Amazon GameLift's // API operation DeleteBuild for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. +// +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // @@ -2073,12 +2111,9 @@ func (c *GameLift) DeleteFleetRequest(input *DeleteFleetInput) (req *request.Req // // * DeleteFleet // -// * Describe fleets: DescribeFleetAttributes DescribeFleetCapacity DescribeFleetPortSettings -// DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits -// DescribeFleetEvents +// * DescribeFleetAttributes // -// * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings -// UpdateRuntimeConfiguration +// * UpdateFleetAttributes // // * Manage fleet actions: StartFleetActions StopFleetActions // @@ -2089,28 +2124,33 @@ func (c *GameLift) DeleteFleetRequest(input *DeleteFleetInput) (req *request.Req // See the AWS API reference guide for Amazon GameLift's // API operation DeleteFleet for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidFleetStatusException "InvalidFleetStatusException" +// * InvalidFleetStatusException // The requested operation would cause a conflict with the current state of // a resource associated with the request and/or the fleet. Resolve the conflict // before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/DeleteFleet func (c *GameLift) DeleteFleet(input *DeleteFleetInput) (*DeleteFleetOutput, error) { req, out := c.DeleteFleetRequest(input) @@ -2197,23 +2237,28 @@ func (c *GameLift) DeleteGameSessionQueueRequest(input *DeleteGameSessionQueueIn // See the AWS API reference guide for Amazon GameLift's // API operation DeleteGameSessionQueue for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/DeleteGameSessionQueue func (c *GameLift) DeleteGameSessionQueue(input *DeleteGameSessionQueueInput) (*DeleteGameSessionQueueOutput, error) { req, out := c.DeleteGameSessionQueueRequest(input) @@ -2310,22 +2355,27 @@ func (c *GameLift) DeleteMatchmakingConfigurationRequest(input *DeleteMatchmakin // See the AWS API reference guide for Amazon GameLift's // API operation DeleteMatchmakingConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnsupportedRegionException "UnsupportedRegionException" -// The requested operation is not supported in the region specified. +// * UnsupportedRegionException +// The requested operation is not supported in the Region specified. +// +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/DeleteMatchmakingConfiguration func (c *GameLift) DeleteMatchmakingConfiguration(input *DeleteMatchmakingConfigurationInput) (*DeleteMatchmakingConfigurationOutput, error) { @@ -2427,23 +2477,28 @@ func (c *GameLift) DeleteMatchmakingRuleSetRequest(input *DeleteMatchmakingRuleS // See the AWS API reference guide for Amazon GameLift's // API operation DeleteMatchmakingRuleSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnsupportedRegionException "UnsupportedRegionException" -// The requested operation is not supported in the region specified. +// * UnsupportedRegionException +// The requested operation is not supported in the Region specified. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/DeleteMatchmakingRuleSet func (c *GameLift) DeleteMatchmakingRuleSet(input *DeleteMatchmakingRuleSetInput) (*DeleteMatchmakingRuleSetOutput, error) { req, out := c.DeleteMatchmakingRuleSetRequest(input) @@ -2536,20 +2591,20 @@ func (c *GameLift) DeleteScalingPolicyRequest(input *DeleteScalingPolicyInput) ( // See the AWS API reference guide for Amazon GameLift's // API operation DeleteScalingPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // @@ -2653,19 +2708,24 @@ func (c *GameLift) DeleteScriptRequest(input *DeleteScriptInput) (req *request.R // See the AWS API reference guide for Amazon GameLift's // API operation DeleteScript for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. +// +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -2759,19 +2819,19 @@ func (c *GameLift) DeleteVpcPeeringAuthorizationRequest(input *DeleteVpcPeeringA // See the AWS API reference guide for Amazon GameLift's // API operation DeleteVpcPeeringAuthorization for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -2872,19 +2932,19 @@ func (c *GameLift) DeleteVpcPeeringConnectionRequest(input *DeleteVpcPeeringConn // See the AWS API reference guide for Amazon GameLift's // API operation DeleteVpcPeeringConnection for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -2980,19 +3040,19 @@ func (c *GameLift) DescribeAliasRequest(input *DescribeAliasInput) (req *request // See the AWS API reference guide for Amazon GameLift's // API operation DescribeAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -3089,19 +3149,19 @@ func (c *GameLift) DescribeBuildRequest(input *DescribeBuildInput) (req *request // See the AWS API reference guide for Amazon GameLift's // API operation DescribeBuild for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -3178,7 +3238,7 @@ func (c *GameLift) DescribeEC2InstanceLimitsRequest(input *DescribeEC2InstanceLi // // * current usage level for the AWS account // -// Service limits vary depending on region. Available regions for Amazon GameLift +// Service limits vary depending on Region. Available Regions for Amazon GameLift // can be found in the AWS Management Console for Amazon GameLift (see the drop-down // list in the upper right corner). // @@ -3210,17 +3270,17 @@ func (c *GameLift) DescribeEC2InstanceLimitsRequest(input *DescribeEC2InstanceLi // See the AWS API reference guide for Amazon GameLift's // API operation DescribeEC2InstanceLimits for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/DescribeEC2InstanceLimits @@ -3317,8 +3377,7 @@ func (c *GameLift) DescribeFleetAttributesRequest(input *DescribeFleetAttributes // DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits // DescribeFleetEvents // -// * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings -// UpdateRuntimeConfiguration +// * UpdateFleetAttributes // // * Manage fleet actions: StartFleetActions StopFleetActions // @@ -3329,21 +3388,21 @@ func (c *GameLift) DescribeFleetAttributesRequest(input *DescribeFleetAttributes // See the AWS API reference guide for Amazon GameLift's // API operation DescribeFleetAttributes for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/DescribeFleetAttributes @@ -3441,8 +3500,7 @@ func (c *GameLift) DescribeFleetCapacityRequest(input *DescribeFleetCapacityInpu // DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits // DescribeFleetEvents // -// * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings -// UpdateRuntimeConfiguration +// * UpdateFleetAttributes // // * Manage fleet actions: StartFleetActions StopFleetActions // @@ -3453,21 +3511,21 @@ func (c *GameLift) DescribeFleetCapacityRequest(input *DescribeFleetCapacityInpu // See the AWS API reference guide for Amazon GameLift's // API operation DescribeFleetCapacity for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/DescribeFleetCapacity @@ -3557,8 +3615,7 @@ func (c *GameLift) DescribeFleetEventsRequest(input *DescribeFleetEventsInput) ( // DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits // DescribeFleetEvents // -// * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings -// UpdateRuntimeConfiguration +// * UpdateFleetAttributes // // * Manage fleet actions: StartFleetActions StopFleetActions // @@ -3569,20 +3626,20 @@ func (c *GameLift) DescribeFleetEventsRequest(input *DescribeFleetEventsInput) ( // See the AWS API reference guide for Amazon GameLift's // API operation DescribeFleetEvents for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // @@ -3675,8 +3732,7 @@ func (c *GameLift) DescribeFleetPortSettingsRequest(input *DescribeFleetPortSett // DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits // DescribeFleetEvents // -// * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings -// UpdateRuntimeConfiguration +// * UpdateFleetAttributes // // * Manage fleet actions: StartFleetActions StopFleetActions // @@ -3687,21 +3743,21 @@ func (c *GameLift) DescribeFleetPortSettingsRequest(input *DescribeFleetPortSett // See the AWS API reference guide for Amazon GameLift's // API operation DescribeFleetPortSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/DescribeFleetPortSettings @@ -3797,8 +3853,7 @@ func (c *GameLift) DescribeFleetUtilizationRequest(input *DescribeFleetUtilizati // DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits // DescribeFleetEvents // -// * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings -// UpdateRuntimeConfiguration +// * UpdateFleetAttributes // // * Manage fleet actions: StartFleetActions StopFleetActions // @@ -3809,21 +3864,21 @@ func (c *GameLift) DescribeFleetUtilizationRequest(input *DescribeFleetUtilizati // See the AWS API reference guide for Amazon GameLift's // API operation DescribeFleetUtilization for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/DescribeFleetUtilization @@ -3926,24 +3981,24 @@ func (c *GameLift) DescribeGameSessionDetailsRequest(input *DescribeGameSessionD // See the AWS API reference guide for Amazon GameLift's // API operation DescribeGameSessionDetails for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeTerminalRoutingStrategyException "TerminalRoutingStrategyException" +// * TerminalRoutingStrategyException // The service is unable to resolve the routing for a particular alias because // it has a terminal RoutingStrategy associated with it. The message returned // in this exception is the message defined in the routing strategy itself. @@ -4042,21 +4097,21 @@ func (c *GameLift) DescribeGameSessionPlacementRequest(input *DescribeGameSessio // See the AWS API reference guide for Amazon GameLift's // API operation DescribeGameSessionPlacement for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/DescribeGameSessionPlacement @@ -4129,7 +4184,7 @@ func (c *GameLift) DescribeGameSessionQueuesRequest(input *DescribeGameSessionQu // multiple queues, use the pagination parameters to retrieve results as a set // of sequential pages. If successful, a GameSessionQueue object is returned // for each requested queue. When specifying a list of queues, objects are returned -// only for queues that currently exist in the region. +// only for queues that currently exist in the Region. // // * CreateGameSessionQueue // @@ -4146,21 +4201,21 @@ func (c *GameLift) DescribeGameSessionQueuesRequest(input *DescribeGameSessionQu // See the AWS API reference guide for Amazon GameLift's // API operation DescribeGameSessionQueues for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/DescribeGameSessionQueues @@ -4264,24 +4319,24 @@ func (c *GameLift) DescribeGameSessionsRequest(input *DescribeGameSessionsInput) // See the AWS API reference guide for Amazon GameLift's // API operation DescribeGameSessions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeTerminalRoutingStrategyException "TerminalRoutingStrategyException" +// * TerminalRoutingStrategyException // The service is unable to resolve the routing for a particular alias because // it has a terminal RoutingStrategy associated with it. The message returned // in this exception is the message defined in the routing strategy itself. @@ -4370,19 +4425,19 @@ func (c *GameLift) DescribeInstancesRequest(input *DescribeInstancesInput) (req // See the AWS API reference guide for Amazon GameLift's // API operation DescribeInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -4470,7 +4525,7 @@ func (c *GameLift) DescribeMatchmakingRequest(input *DescribeMatchmakingInput) ( // // Add FlexMatch to a Game Client (https://docs.aws.amazon.com/gamelift/latest/developerguide/match-client.html) // -// Set Up FlexMatch Event Notification (https://docs.aws.amazon.com/gamelift/latest/developerguidematch-notification.html) +// Set Up FlexMatch Event Notification (https://docs.aws.amazon.com/gamelift/latest/developerguide/match-notification.html) // // Related operations // @@ -4491,18 +4546,18 @@ func (c *GameLift) DescribeMatchmakingRequest(input *DescribeMatchmakingInput) ( // See the AWS API reference guide for Amazon GameLift's // API operation DescribeMatchmaking for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnsupportedRegionException "UnsupportedRegionException" -// The requested operation is not supported in the region specified. +// * UnsupportedRegionException +// The requested operation is not supported in the Region specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/DescribeMatchmaking func (c *GameLift) DescribeMatchmaking(input *DescribeMatchmakingInput) (*DescribeMatchmakingOutput, error) { @@ -4608,18 +4663,18 @@ func (c *GameLift) DescribeMatchmakingConfigurationsRequest(input *DescribeMatch // See the AWS API reference guide for Amazon GameLift's // API operation DescribeMatchmakingConfigurations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnsupportedRegionException "UnsupportedRegionException" -// The requested operation is not supported in the region specified. +// * UnsupportedRegionException +// The requested operation is not supported in the Region specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/DescribeMatchmakingConfigurations func (c *GameLift) DescribeMatchmakingConfigurations(input *DescribeMatchmakingConfigurationsInput) (*DescribeMatchmakingConfigurationsOutput, error) { @@ -4688,7 +4743,7 @@ func (c *GameLift) DescribeMatchmakingRuleSetsRequest(input *DescribeMatchmaking // DescribeMatchmakingRuleSets API operation for Amazon GameLift. // // Retrieves the details for FlexMatch matchmaking rule sets. You can request -// all existing rule sets for the region, or provide a list of one or more rule +// all existing rule sets for the Region, or provide a list of one or more rule // set names. When requesting multiple items, use the pagination parameters // to retrieve results as a set of sequential pages. If successful, a rule set // is returned for each requested name. @@ -4722,22 +4777,22 @@ func (c *GameLift) DescribeMatchmakingRuleSetsRequest(input *DescribeMatchmaking // See the AWS API reference guide for Amazon GameLift's // API operation DescribeMatchmakingRuleSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeUnsupportedRegionException "UnsupportedRegionException" -// The requested operation is not supported in the region specified. +// * UnsupportedRegionException +// The requested operation is not supported in the Region specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/DescribeMatchmakingRuleSets func (c *GameLift) DescribeMatchmakingRuleSets(input *DescribeMatchmakingRuleSetsInput) (*DescribeMatchmakingRuleSetsOutput, error) { @@ -4835,21 +4890,21 @@ func (c *GameLift) DescribePlayerSessionsRequest(input *DescribePlayerSessionsIn // See the AWS API reference guide for Amazon GameLift's // API operation DescribePlayerSessions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/DescribePlayerSessions @@ -4918,8 +4973,8 @@ func (c *GameLift) DescribeRuntimeConfigurationRequest(input *DescribeRuntimeCon // DescribeRuntimeConfiguration API operation for Amazon GameLift. // -// Retrieves the current run-time configuration for the specified fleet. The -// run-time configuration tells Amazon GameLift how to launch server processes +// Retrieves the current runtime configuration for the specified fleet. The +// runtime configuration tells Amazon GameLift how to launch server processes // on instances in the fleet. // // Learn more @@ -4938,8 +4993,7 @@ func (c *GameLift) DescribeRuntimeConfigurationRequest(input *DescribeRuntimeCon // DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits // DescribeFleetEvents // -// * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings -// UpdateRuntimeConfiguration +// * UpdateFleetAttributes // // * Manage fleet actions: StartFleetActions StopFleetActions // @@ -4950,20 +5004,20 @@ func (c *GameLift) DescribeRuntimeConfigurationRequest(input *DescribeRuntimeCon // See the AWS API reference guide for Amazon GameLift's // API operation DescribeRuntimeConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // @@ -5063,20 +5117,20 @@ func (c *GameLift) DescribeScalingPoliciesRequest(input *DescribeScalingPolicies // See the AWS API reference guide for Amazon GameLift's // API operation DescribeScalingPolicies for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // @@ -5174,20 +5228,20 @@ func (c *GameLift) DescribeScriptRequest(input *DescribeScriptInput) (req *reque // See the AWS API reference guide for Amazon GameLift's // API operation DescribeScript for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // @@ -5280,15 +5334,15 @@ func (c *GameLift) DescribeVpcPeeringAuthorizationsRequest(input *DescribeVpcPee // See the AWS API reference guide for Amazon GameLift's // API operation DescribeVpcPeeringAuthorizations for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -5387,19 +5441,19 @@ func (c *GameLift) DescribeVpcPeeringConnectionsRequest(input *DescribeVpcPeerin // See the AWS API reference guide for Amazon GameLift's // API operation DescribeVpcPeeringConnections for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -5501,20 +5555,20 @@ func (c *GameLift) GetGameSessionLogUrlRequest(input *GetGameSessionLogUrlInput) // See the AWS API reference guide for Amazon GameLift's // API operation GetGameSessionLogUrl for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // @@ -5609,19 +5663,19 @@ func (c *GameLift) GetInstanceAccessRequest(input *GetInstanceAccessInput) (req // See the AWS API reference guide for Amazon GameLift's // API operation GetInstanceAccess for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -5717,15 +5771,15 @@ func (c *GameLift) ListAliasesRequest(input *ListAliasesInput) (req *request.Req // See the AWS API reference guide for Amazon GameLift's // API operation ListAliases for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -5826,15 +5880,15 @@ func (c *GameLift) ListBuildsRequest(input *ListBuildsInput) (req *request.Reque // See the AWS API reference guide for Amazon GameLift's // API operation ListBuilds for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -5924,12 +5978,9 @@ func (c *GameLift) ListFleetsRequest(input *ListFleetsInput) (req *request.Reque // // * DeleteFleet // -// * Describe fleets: DescribeFleetAttributes DescribeFleetCapacity DescribeFleetPortSettings -// DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits -// DescribeFleetEvents +// * DescribeFleetAttributes // -// * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings -// UpdateRuntimeConfiguration +// * UpdateFleetAttributes // // * Manage fleet actions: StartFleetActions StopFleetActions // @@ -5940,21 +5991,21 @@ func (c *GameLift) ListFleetsRequest(input *ListFleetsInput) (req *request.Reque // See the AWS API reference guide for Amazon GameLift's // API operation ListFleets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/ListFleets @@ -6049,15 +6100,15 @@ func (c *GameLift) ListScriptsRequest(input *ListScriptsInput) (req *request.Req // See the AWS API reference guide for Amazon GameLift's // API operation ListScripts for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -6084,6 +6135,134 @@ func (c *GameLift) ListScriptsWithContext(ctx aws.Context, input *ListScriptsInp return out, req.Send() } +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/ListTagsForResource +func (c *GameLift) 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 GameLift. +// +// Retrieves all tags that are assigned to a GameLift resource. Resource tags +// are used to organize AWS resources for a range of purposes. This action handles +// the permissions necessary to manage tags for the following GameLift resource +// types: +// +// * Build +// +// * Script +// +// * Fleet +// +// * Alias +// +// * GameSessionQueue +// +// * MatchmakingConfiguration +// +// * MatchmakingRuleSet +// +// To list tags for a resource, specify the unique ARN value for the resource. +// +// Learn more +// +// Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) +// in the AWS General Reference +// +// AWS Tagging Strategies (http://aws.amazon.com/answers/account-management/aws-tagging-strategies/) +// +// Related operations +// +// * TagResource +// +// * UntagResource +// +// * ListTagsForResource +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon GameLift's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// A service resource associated with the request could not be found. Clients +// should not retry such requests. +// +// * InvalidRequestException +// One or more parameter values in the request are invalid. Correct the invalid +// parameter values before retrying. +// +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. +// +// * InternalServiceException +// The service encountered an unrecoverable internal failure while processing +// the request. Clients can retry such requests immediately or after a waiting +// period. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/ListTagsForResource +func (c *GameLift) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GameLift) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opPutScalingPolicy = "PutScalingPolicy" // PutScalingPolicyRequest generates a "aws/request.Request" representing the @@ -6221,20 +6400,20 @@ func (c *GameLift) PutScalingPolicyRequest(input *PutScalingPolicyInput) (req *r // See the AWS API reference guide for Amazon GameLift's // API operation PutScalingPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // @@ -6335,19 +6514,19 @@ func (c *GameLift) RequestUploadCredentialsRequest(input *RequestUploadCredentia // See the AWS API reference guide for Amazon GameLift's // API operation RequestUploadCredentials for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -6418,7 +6597,7 @@ func (c *GameLift) ResolveAliasRequest(input *ResolveAliasInput) (req *request.R // ResolveAlias API operation for Amazon GameLift. // -// Retrieves the fleet ID that a specified alias is currently pointing to. +// Retrieves the fleet ID that an alias is currently pointing to. // // * CreateAlias // @@ -6439,26 +6618,26 @@ func (c *GameLift) ResolveAliasRequest(input *ResolveAliasInput) (req *request.R // See the AWS API reference guide for Amazon GameLift's // API operation ResolveAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeTerminalRoutingStrategyException "TerminalRoutingStrategyException" +// * TerminalRoutingStrategyException // The service is unable to resolve the routing for a particular alias because // it has a terminal RoutingStrategy associated with it. The message returned // in this exception is the message defined in the routing strategy itself. // Such requests should only be retried if the routing strategy for the specified // alias is modified. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -6533,7 +6712,7 @@ func (c *GameLift) SearchGameSessionsRequest(input *SearchGameSessionsInput) (re // sorts them in a specified order. You can search or sort by the following // game session attributes: // -// * gameSessionId -- Unique identifier for the game session. You can use +// * gameSessionId -- A unique identifier for the game session. You can use // either a GameSessionId or GameSessionArn value. // // * gameSessionName -- Name assigned to a game session. This value is set @@ -6601,24 +6780,24 @@ func (c *GameLift) SearchGameSessionsRequest(input *SearchGameSessionsInput) (re // See the AWS API reference guide for Amazon GameLift's // API operation SearchGameSessions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeTerminalRoutingStrategyException "TerminalRoutingStrategyException" +// * TerminalRoutingStrategyException // The service is unable to resolve the routing for a particular alias because // it has a terminal RoutingStrategy associated with it. The message returned // in this exception is the message defined in the routing strategy itself. @@ -6729,20 +6908,20 @@ func (c *GameLift) StartFleetActionsRequest(input *StartFleetActionsInput) (req // See the AWS API reference guide for Amazon GameLift's // API operation StartFleetActions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // @@ -6826,11 +7005,11 @@ func (c *GameLift) StartGameSessionPlacementRequest(input *StartGameSessionPlace // destinations are listed in preference order. // // Alternatively, when requesting a game session with players, you can also -// provide latency data for each player in relevant regions. Latency data indicates +// provide latency data for each player in relevant Regions. Latency data indicates // the performance lag a player experiences when connected to a fleet in the -// region. Amazon GameLift uses latency data to reorder the list of destinations -// to place the game session in a region with minimal lag. If latency data is -// provided for multiple players, Amazon GameLift calculates each region's average +// Region. Amazon GameLift uses latency data to reorder the list of destinations +// to place the game session in a Region with minimal lag. If latency data is +// provided for multiple players, Amazon GameLift calculates each Region's average // lag for all players and reorders to get the best game play across all players. // // To place a new game session request, specify the following: @@ -6851,7 +7030,7 @@ func (c *GameLift) StartGameSessionPlacementRequest(input *StartGameSessionPlace // // To track the status of a placement request, call DescribeGameSessionPlacement // and check the request's status. If the status is FULFILLED, a new game session -// has been created and a game session ARN and region are referenced. If the +// has been created and a game session ARN and Region are referenced. If the // placement request times out, you can resubmit the request or retry it with // a different queue. // @@ -6877,21 +7056,21 @@ func (c *GameLift) StartGameSessionPlacementRequest(input *StartGameSessionPlace // See the AWS API reference guide for Amazon GameLift's // API operation StartGameSessionPlacement for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/StartGameSessionPlacement @@ -7010,22 +7189,22 @@ func (c *GameLift) StartMatchBackfillRequest(input *StartMatchBackfillInput) (re // See the AWS API reference guide for Amazon GameLift's // API operation StartMatchBackfill for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnsupportedRegionException "UnsupportedRegionException" -// The requested operation is not supported in the region specified. +// * UnsupportedRegionException +// The requested operation is not supported in the Region specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/StartMatchBackfill func (c *GameLift) StartMatchBackfill(input *StartMatchBackfillInput) (*StartMatchBackfillOutput, error) { @@ -7182,22 +7361,22 @@ func (c *GameLift) StartMatchmakingRequest(input *StartMatchmakingInput) (req *r // See the AWS API reference guide for Amazon GameLift's // API operation StartMatchmaking for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnsupportedRegionException "UnsupportedRegionException" -// The requested operation is not supported in the region specified. +// * UnsupportedRegionException +// The requested operation is not supported in the Region specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/StartMatchmaking func (c *GameLift) StartMatchmaking(input *StartMatchmakingInput) (*StartMatchmakingOutput, error) { @@ -7305,20 +7484,20 @@ func (c *GameLift) StopFleetActionsRequest(input *StopFleetActionsInput) (req *r // See the AWS API reference guide for Amazon GameLift's // API operation StopFleetActions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // @@ -7414,21 +7593,21 @@ func (c *GameLift) StopGameSessionPlacementRequest(input *StopGameSessionPlaceme // See the AWS API reference guide for Amazon GameLift's // API operation StopGameSessionPlacement for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/StopGameSessionPlacement @@ -7533,22 +7712,22 @@ func (c *GameLift) StopMatchmakingRequest(input *StopMatchmakingInput) (req *req // See the AWS API reference guide for Amazon GameLift's // API operation StopMatchmaking for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnsupportedRegionException "UnsupportedRegionException" -// The requested operation is not supported in the region specified. +// * UnsupportedRegionException +// The requested operation is not supported in the Region specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/StopMatchmaking func (c *GameLift) StopMatchmaking(input *StopMatchmakingInput) (*StopMatchmakingOutput, error) { @@ -7572,259 +7751,524 @@ func (c *GameLift) StopMatchmakingWithContext(ctx aws.Context, input *StopMatchm return out, req.Send() } -const opUpdateAlias = "UpdateAlias" +const opTagResource = "TagResource" -// UpdateAliasRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAlias operation. The "output" return +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateAlias for more information on using the UpdateAlias +// See TagResource for more information on using the TagResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateAliasRequest method. -// req, resp := client.UpdateAliasRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UpdateAlias -func (c *GameLift) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, output *UpdateAliasOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/TagResource +func (c *GameLift) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { op := &request.Operation{ - Name: opUpdateAlias, + Name: opTagResource, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateAliasInput{} + input = &TagResourceInput{} } - output = &UpdateAliasOutput{} + output = &TagResourceOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateAlias API operation for Amazon GameLift. +// TagResource API operation for Amazon GameLift. // -// Updates properties for an alias. To update properties, specify the alias -// ID to be updated and provide the information to be changed. To reassign an -// alias to another fleet, provide an updated routing strategy. If successful, -// the updated alias record is returned. +// Assigns a tag to a GameLift resource. AWS resource tags provide an additional +// management tool set. You can use tags to organize resources, create IAM permissions +// policies to manage access to groups of resources, customize AWS cost breakdowns, +// etc. This action handles the permissions necessary to manage tags for the +// following GameLift resource types: // -// * CreateAlias +// * Build // -// * ListAliases +// * Script // -// * DescribeAlias +// * Fleet // -// * UpdateAlias +// * Alias // -// * DeleteAlias +// * GameSessionQueue // -// * ResolveAlias +// * MatchmakingConfiguration +// +// * MatchmakingRuleSet +// +// To add a tag to a resource, specify the unique ARN value for the resource +// and provide a trig list containing one or more tags. The operation succeeds +// even if the list includes tags that are already assigned to the specified +// resource. +// +// Learn more +// +// Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) +// in the AWS General Reference +// +// AWS Tagging Strategies (http://aws.amazon.com/answers/account-management/aws-tagging-strategies/) +// +// Related operations +// +// * TagResource +// +// * UntagResource +// +// * ListTagsForResource // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon GameLift's -// API operation UpdateAlias for usage and error information. +// API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// The client failed authentication. Clients should not retry such requests. +// Returned Error Types: +// * NotFoundException +// A service resource associated with the request could not be found. Clients +// should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" -// A service resource associated with the request could not be found. Clients -// should not retry such requests. +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UpdateAlias -func (c *GameLift) UpdateAlias(input *UpdateAliasInput) (*UpdateAliasOutput, error) { - req, out := c.UpdateAliasRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/TagResource +func (c *GameLift) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) return out, req.Send() } -// UpdateAliasWithContext is the same as UpdateAlias with the addition of +// TagResourceWithContext is the same as TagResource with the addition of // the ability to pass a context and additional request options. // -// See UpdateAlias for details on how to use this API operation. +// See TagResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *GameLift) UpdateAliasWithContext(ctx aws.Context, input *UpdateAliasInput, opts ...request.Option) (*UpdateAliasOutput, error) { - req, out := c.UpdateAliasRequest(input) +func (c *GameLift) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateBuild = "UpdateBuild" +const opUntagResource = "UntagResource" -// UpdateBuildRequest generates a "aws/request.Request" representing the -// client's request for the UpdateBuild operation. The "output" return +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateBuild for more information on using the UpdateBuild +// See UntagResource for more information on using the UntagResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateBuildRequest method. -// req, resp := client.UpdateBuildRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UpdateBuild -func (c *GameLift) UpdateBuildRequest(input *UpdateBuildInput) (req *request.Request, output *UpdateBuildOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UntagResource +func (c *GameLift) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { op := &request.Operation{ - Name: opUpdateBuild, + Name: opUntagResource, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateBuildInput{} + input = &UntagResourceInput{} } - output = &UpdateBuildOutput{} + output = &UntagResourceOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateBuild API operation for Amazon GameLift. +// UntagResource API operation for Amazon GameLift. // -// Updates metadata in a build record, including the build name and version. -// To update the metadata, specify the build ID to update and provide the new -// values. If successful, a build object containing the updated metadata is -// returned. +// Removes a tag that is assigned to a GameLift resource. Resource tags are +// used to organize AWS resources for a range of purposes. This action handles +// the permissions necessary to manage tags for the following GameLift resource +// types: // -// Learn more +// * Build // -// Working with Builds (https://docs.aws.amazon.com/gamelift/latest/developerguide/build-intro.html) +// * Script // -// Related operations +// * Fleet // -// * CreateBuild +// * Alias // -// * ListBuilds +// * GameSessionQueue // -// * DescribeBuild +// * MatchmakingConfiguration // -// * UpdateBuild +// * MatchmakingRuleSet // -// * DeleteBuild +// To remove a tag from a resource, specify the unique ARN value for the resource +// and provide a string list containing one or more tags to be removed. This +// action succeeds even if the list includes tags that are not currently assigned +// to the specified resource. +// +// Learn more +// +// Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) +// in the AWS General Reference +// +// AWS Tagging Strategies (http://aws.amazon.com/answers/account-management/aws-tagging-strategies/) +// +// Related operations +// +// * TagResource +// +// * UntagResource +// +// * ListTagsForResource // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon GameLift's -// API operation UpdateBuild for usage and error information. +// API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" -// The client failed authentication. Clients should not retry such requests. +// Returned Error Types: +// * NotFoundException +// A service resource associated with the request could not be found. Clients +// should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" -// A service resource associated with the request could not be found. Clients -// should not retry such requests. +// * TaggingFailedException +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UpdateBuild -func (c *GameLift) UpdateBuild(input *UpdateBuildInput) (*UpdateBuildOutput, error) { - req, out := c.UpdateBuildRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UntagResource +func (c *GameLift) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) return out, req.Send() } -// UpdateBuildWithContext is the same as UpdateBuild with the addition of +// UntagResourceWithContext is the same as UntagResource with the addition of // the ability to pass a context and additional request options. // -// See UpdateBuild for details on how to use this API operation. +// See UntagResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *GameLift) UpdateBuildWithContext(ctx aws.Context, input *UpdateBuildInput, opts ...request.Option) (*UpdateBuildOutput, error) { - req, out := c.UpdateBuildRequest(input) +func (c *GameLift) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateFleetAttributes = "UpdateFleetAttributes" +const opUpdateAlias = "UpdateAlias" -// UpdateFleetAttributesRequest generates a "aws/request.Request" representing the -// client's request for the UpdateFleetAttributes operation. The "output" return +// UpdateAliasRequest generates a "aws/request.Request" representing the +// client's request for the UpdateAlias operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateFleetAttributes for more information on using the UpdateFleetAttributes +// See UpdateAlias for more information on using the UpdateAlias // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateFleetAttributesRequest method. -// req, resp := client.UpdateFleetAttributesRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UpdateFleetAttributes -func (c *GameLift) UpdateFleetAttributesRequest(input *UpdateFleetAttributesInput) (req *request.Request, output *UpdateFleetAttributesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UpdateAlias +func (c *GameLift) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, output *UpdateAliasOutput) { op := &request.Operation{ - Name: opUpdateFleetAttributes, + Name: opUpdateAlias, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateFleetAttributesInput{} + input = &UpdateAliasInput{} + } + + output = &UpdateAliasOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateAlias API operation for Amazon GameLift. +// +// Updates properties for an alias. To update properties, specify the alias +// ID to be updated and provide the information to be changed. To reassign an +// alias to another fleet, provide an updated routing strategy. If successful, +// the updated alias record is returned. +// +// * CreateAlias +// +// * ListAliases +// +// * DescribeAlias +// +// * UpdateAlias +// +// * DeleteAlias +// +// * ResolveAlias +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon GameLift's +// API operation UpdateAlias for usage and error information. +// +// Returned Error Types: +// * UnauthorizedException +// The client failed authentication. Clients should not retry such requests. +// +// * InvalidRequestException +// One or more parameter values in the request are invalid. Correct the invalid +// parameter values before retrying. +// +// * NotFoundException +// A service resource associated with the request could not be found. Clients +// should not retry such requests. +// +// * InternalServiceException +// The service encountered an unrecoverable internal failure while processing +// the request. Clients can retry such requests immediately or after a waiting +// period. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UpdateAlias +func (c *GameLift) UpdateAlias(input *UpdateAliasInput) (*UpdateAliasOutput, error) { + req, out := c.UpdateAliasRequest(input) + return out, req.Send() +} + +// UpdateAliasWithContext is the same as UpdateAlias with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GameLift) UpdateAliasWithContext(ctx aws.Context, input *UpdateAliasInput, opts ...request.Option) (*UpdateAliasOutput, error) { + req, out := c.UpdateAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateBuild = "UpdateBuild" + +// UpdateBuildRequest generates a "aws/request.Request" representing the +// client's request for the UpdateBuild operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateBuild for more information on using the UpdateBuild +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateBuildRequest method. +// req, resp := client.UpdateBuildRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UpdateBuild +func (c *GameLift) UpdateBuildRequest(input *UpdateBuildInput) (req *request.Request, output *UpdateBuildOutput) { + op := &request.Operation{ + Name: opUpdateBuild, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateBuildInput{} + } + + output = &UpdateBuildOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateBuild API operation for Amazon GameLift. +// +// Updates metadata in a build record, including the build name and version. +// To update the metadata, specify the build ID to update and provide the new +// values. If successful, a build object containing the updated metadata is +// returned. +// +// Learn more +// +// Working with Builds (https://docs.aws.amazon.com/gamelift/latest/developerguide/build-intro.html) +// +// Related operations +// +// * CreateBuild +// +// * ListBuilds +// +// * DescribeBuild +// +// * UpdateBuild +// +// * DeleteBuild +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon GameLift's +// API operation UpdateBuild for usage and error information. +// +// Returned Error Types: +// * UnauthorizedException +// The client failed authentication. Clients should not retry such requests. +// +// * InvalidRequestException +// One or more parameter values in the request are invalid. Correct the invalid +// parameter values before retrying. +// +// * NotFoundException +// A service resource associated with the request could not be found. Clients +// should not retry such requests. +// +// * InternalServiceException +// The service encountered an unrecoverable internal failure while processing +// the request. Clients can retry such requests immediately or after a waiting +// period. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UpdateBuild +func (c *GameLift) UpdateBuild(input *UpdateBuildInput) (*UpdateBuildOutput, error) { + req, out := c.UpdateBuildRequest(input) + return out, req.Send() +} + +// UpdateBuildWithContext is the same as UpdateBuild with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateBuild for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GameLift) UpdateBuildWithContext(ctx aws.Context, input *UpdateBuildInput, opts ...request.Option) (*UpdateBuildOutput, error) { + req, out := c.UpdateBuildRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateFleetAttributes = "UpdateFleetAttributes" + +// UpdateFleetAttributesRequest generates a "aws/request.Request" representing the +// client's request for the UpdateFleetAttributes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateFleetAttributes for more information on using the UpdateFleetAttributes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateFleetAttributesRequest method. +// req, resp := client.UpdateFleetAttributesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UpdateFleetAttributes +func (c *GameLift) UpdateFleetAttributesRequest(input *UpdateFleetAttributesInput) (req *request.Request, output *UpdateFleetAttributesOutput) { + op := &request.Operation{ + Name: opUpdateFleetAttributes, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateFleetAttributesInput{} } output = &UpdateFleetAttributesOutput{} @@ -7850,9 +8294,7 @@ func (c *GameLift) UpdateFleetAttributesRequest(input *UpdateFleetAttributesInpu // // * DeleteFleet // -// * Describe fleets: DescribeFleetAttributes DescribeFleetCapacity DescribeFleetPortSettings -// DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits -// DescribeFleetEvents +// * DescribeFleetAttributes // // * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings // UpdateRuntimeConfiguration @@ -7866,35 +8308,35 @@ func (c *GameLift) UpdateFleetAttributesRequest(input *UpdateFleetAttributesInpu // See the AWS API reference guide for Amazon GameLift's // API operation UpdateFleetAttributes for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. // -// * ErrCodeInvalidFleetStatusException "InvalidFleetStatusException" +// * InvalidFleetStatusException // The requested operation would cause a conflict with the current state of // a resource associated with the request and/or the fleet. Resolve the conflict // before retrying. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested operation would cause the resource to exceed the allowed service // limit. Resolve the issue before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UpdateFleetAttributes @@ -7992,9 +8434,7 @@ func (c *GameLift) UpdateFleetCapacityRequest(input *UpdateFleetCapacityInput) ( // // * DeleteFleet // -// * Describe fleets: DescribeFleetAttributes DescribeFleetCapacity DescribeFleetPortSettings -// DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits -// DescribeFleetEvents +// * DescribeFleetAttributes // // * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings // UpdateRuntimeConfiguration @@ -8008,35 +8448,35 @@ func (c *GameLift) UpdateFleetCapacityRequest(input *UpdateFleetCapacityInput) ( // See the AWS API reference guide for Amazon GameLift's // API operation UpdateFleetCapacity for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested operation would cause the resource to exceed the allowed service // limit. Resolve the issue before retrying. // -// * ErrCodeInvalidFleetStatusException "InvalidFleetStatusException" +// * InvalidFleetStatusException // The requested operation would cause a conflict with the current state of // a resource associated with the request and/or the fleet. Resolve the conflict // before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UpdateFleetCapacity @@ -8124,9 +8564,7 @@ func (c *GameLift) UpdateFleetPortSettingsRequest(input *UpdateFleetPortSettings // // * DeleteFleet // -// * Describe fleets: DescribeFleetAttributes DescribeFleetCapacity DescribeFleetPortSettings -// DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits -// DescribeFleetEvents +// * DescribeFleetAttributes // // * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings // UpdateRuntimeConfiguration @@ -8140,35 +8578,35 @@ func (c *GameLift) UpdateFleetPortSettingsRequest(input *UpdateFleetPortSettings // See the AWS API reference guide for Amazon GameLift's // API operation UpdateFleetPortSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. // -// * ErrCodeInvalidFleetStatusException "InvalidFleetStatusException" +// * InvalidFleetStatusException // The requested operation would cause a conflict with the current state of // a resource associated with the request and/or the fleet. Resolve the conflict // before retrying. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested operation would cause the resource to exceed the allowed service // limit. Resolve the issue before retrying. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UpdateFleetPortSettings @@ -8267,30 +8705,30 @@ func (c *GameLift) UpdateGameSessionRequest(input *UpdateGameSessionInput) (req // See the AWS API reference guide for Amazon GameLift's // API operation UpdateGameSession for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The requested operation would cause a conflict with the current state of // a service resource associated with the request. Resolve the conflict before // retrying this request. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidGameSessionStatusException "InvalidGameSessionStatusException" +// * InvalidGameSessionStatusException // The requested operation would cause a conflict with the current state of // a resource associated with the request and/or the game instance. Resolve // the conflict before retrying. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // @@ -8380,21 +8818,21 @@ func (c *GameLift) UpdateGameSessionQueueRequest(input *UpdateGameSessionQueueIn // See the AWS API reference guide for Amazon GameLift's // API operation UpdateGameSessionQueue for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UpdateGameSessionQueue @@ -8497,22 +8935,22 @@ func (c *GameLift) UpdateMatchmakingConfigurationRequest(input *UpdateMatchmakin // See the AWS API reference guide for Amazon GameLift's // API operation UpdateMatchmakingConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnsupportedRegionException "UnsupportedRegionException" -// The requested operation is not supported in the region specified. +// * UnsupportedRegionException +// The requested operation is not supported in the Region specified. // // See also, https://docs.aws.amazon.com/goto/WebAPI/gamelift-2015-10-01/UpdateMatchmakingConfiguration func (c *GameLift) UpdateMatchmakingConfiguration(input *UpdateMatchmakingConfigurationInput) (*UpdateMatchmakingConfigurationOutput, error) { @@ -8580,20 +9018,20 @@ func (c *GameLift) UpdateRuntimeConfigurationRequest(input *UpdateRuntimeConfigu // UpdateRuntimeConfiguration API operation for Amazon GameLift. // -// Updates the current run-time configuration for the specified fleet, which +// Updates the current runtime configuration for the specified fleet, which // tells Amazon GameLift how to launch server processes on instances in the -// fleet. You can update a fleet's run-time configuration at any time after -// the fleet is created; it does not need to be in an ACTIVE status. +// fleet. You can update a fleet's runtime configuration at any time after the +// fleet is created; it does not need to be in an ACTIVE status. // -// To update run-time configuration, specify the fleet ID and provide a RuntimeConfiguration +// To update runtime configuration, specify the fleet ID and provide a RuntimeConfiguration // object with an updated set of server process configurations. // // Each instance in a Amazon GameLift fleet checks regularly for an updated -// run-time configuration and changes how it launches server processes to comply +// runtime configuration and changes how it launches server processes to comply // with the latest version. Existing server processes are not affected by the -// update; run-time configuration changes are applied gradually as existing -// processes shut down and new processes are launched during Amazon GameLift's -// normal process recycling activity. +// update; runtime configuration changes are applied gradually as existing processes +// shut down and new processes are launched during Amazon GameLift's normal +// process recycling activity. // // Learn more // @@ -8607,9 +9045,7 @@ func (c *GameLift) UpdateRuntimeConfigurationRequest(input *UpdateRuntimeConfigu // // * DeleteFleet // -// * Describe fleets: DescribeFleetAttributes DescribeFleetCapacity DescribeFleetPortSettings -// DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits -// DescribeFleetEvents +// * DescribeFleetAttributes // // * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings // UpdateRuntimeConfiguration @@ -8623,24 +9059,24 @@ func (c *GameLift) UpdateRuntimeConfigurationRequest(input *UpdateRuntimeConfigu // See the AWS API reference guide for Amazon GameLift's // API operation UpdateRuntimeConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeInvalidFleetStatusException "InvalidFleetStatusException" +// * InvalidFleetStatusException // The requested operation would cause a conflict with the current state of // a resource associated with the request and/or the fleet. Resolve the conflict // before retrying. @@ -8749,19 +9185,19 @@ func (c *GameLift) UpdateScriptRequest(input *UpdateScriptInput) (req *request.R // See the AWS API reference guide for Amazon GameLift's // API operation UpdateScript for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The client failed authentication. Clients should not retry such requests. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // A service resource associated with the request could not be found. Clients // should not retry such requests. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. @@ -8866,16 +9302,16 @@ func (c *GameLift) ValidateMatchmakingRuleSetRequest(input *ValidateMatchmakingR // See the AWS API reference guide for Amazon GameLift's // API operation ValidateMatchmakingRuleSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // The service encountered an unrecoverable internal failure while processing // the request. Clients can retry such requests immediately or after a waiting // period. // -// * ErrCodeUnsupportedRegionException "UnsupportedRegionException" -// The requested operation is not supported in the region specified. +// * UnsupportedRegionException +// The requested operation is not supported in the Region specified. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // One or more parameter values in the request are invalid. Correct the invalid // parameter values before retrying. // @@ -8910,13 +9346,13 @@ type AcceptMatchInput struct { // AcceptanceType is a required field AcceptanceType *string `type:"string" required:"true" enum:"AcceptanceType"` - // Unique identifier for a player delivering the response. This parameter can - // include one or multiple player IDs. + // A unique identifier for a player delivering the response. This parameter + // can include one or multiple player IDs. // // PlayerIds is a required field PlayerIds []*string `type:"list" required:"true"` - // Unique identifier for a matchmaking ticket. The ticket must be in status + // A unique identifier for a matchmaking ticket. The ticket must be in status // REQUIRES_ACCEPTANCE; otherwise this request will fail. // // TicketId is a required field @@ -8984,7 +9420,7 @@ func (s AcceptMatchOutput) GoString() string { return s.String() } -// Properties describing a fleet alias. +// Properties that describe an alias resource. // // * CreateAlias // @@ -9000,28 +9436,32 @@ func (s AcceptMatchOutput) GoString() string { type Alias struct { _ struct{} `type:"structure"` - // Unique identifier for an alias; alias ARNs are unique across all regions. + // Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // that is assigned to a GameLift alias resource and uniquely identifies it. + // ARNs are unique across all Regions.. In a GameLift alias ARN, the resource + // ID matches the alias ID value. AliasArn *string `min:"1" type:"string"` - // Unique identifier for an alias; alias IDs are unique within a region. + // A unique identifier for an alias. Alias IDs are unique within a Region. AliasId *string `type:"string"` - // Time stamp indicating when this data object was created. Format is a number + // A time stamp indicating when this data object was created. Format is a number // expressed in Unix time as milliseconds (for example "1469498468.057"). CreationTime *time.Time `type:"timestamp"` - // Human-readable description of an alias. + // A human-readable description of an alias. Description *string `type:"string"` - // Time stamp indicating when this data object was last modified. Format is - // a number expressed in Unix time as milliseconds (for example "1469498468.057"). + // The time that this data object was last modified. Format is a number expressed + // in Unix time as milliseconds (for example "1469498468.057"). LastUpdatedTime *time.Time `type:"timestamp"` - // Descriptive label that is associated with an alias. Alias names do not need - // to be unique. + // A descriptive label that is associated with an alias. Alias names do not + // need to be unique. Name *string `min:"1" type:"string"` - // Alias configuration for the alias, including routing type and settings. + // The routing configuration, including routing type and fleet target, for the + // alias. RoutingStrategy *RoutingStrategy `type:"structure"` } @@ -9077,7 +9517,7 @@ func (s *Alias) SetRoutingStrategy(v *RoutingStrategy) *Alias { return s } -// Values for use in Player attribute key:value pairs. This object lets you +// Values for use in Player attribute key-value pairs. This object lets you // specify an attribute value using any of the valid data types: string, number, // string array, or data map. Each AttributeValue object can use only one of // the available properties. @@ -9208,14 +9648,20 @@ func (s *AwsCredentials) SetSessionToken(v string) *AwsCredentials { type Build struct { _ struct{} `type:"structure"` - // Unique identifier for a build. + // Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // that is assigned to a GameLift build resource and uniquely identifies it. + // ARNs are unique across all Regions. In a GameLift build ARN, the resource + // ID matches the BuildId value. + BuildArn *string `type:"string"` + + // A unique identifier for a build. BuildId *string `type:"string"` // Time stamp indicating when this data object was created. Format is a number // expressed in Unix time as milliseconds (for example "1469498468.057"). CreationTime *time.Time `type:"timestamp"` - // Descriptive label that is associated with a build. Build names do not need + // A descriptive label that is associated with a build. Build names do not need // to be unique. It can be set using CreateBuild or UpdateBuild. Name *string `type:"string"` @@ -9243,8 +9689,8 @@ type Build struct { // for this build. Status *string `type:"string" enum:"BuildStatus"` - // Version that is associated with a build or script. Version strings do not - // need to be unique. This value can be set using CreateBuild or UpdateBuild. + // Version information that is associated with a build or script. Version strings + // do not need to be unique. This value can be set using CreateBuild or UpdateBuild. Version *string `type:"string"` } @@ -9258,6 +9704,12 @@ func (s Build) GoString() string { return s.String() } +// SetBuildArn sets the BuildArn field's value. +func (s *Build) SetBuildArn(v string) *Build { + s.BuildArn = &v + return s +} + // SetBuildId sets the BuildId field's value. func (s *Build) SetBuildId(v string) *Build { s.BuildId = &v @@ -9300,9 +9752,16 @@ func (s *Build) SetVersion(v string) *Build { return s } +// Information about the use of a TLS/SSL certificate for a fleet. TLS certificate +// generation is enabled at the fleet level, with one certificate generated +// for the fleet. When this feature is enabled, the certificate can be retrieved +// using the GameLift Server SDK (https://docs.aws.amazon.com/gamelift/latest/developerguide/reference-serversdk.html) +// call GetInstanceCertificate. All instances in a fleet share the same certificate. type CertificateConfiguration struct { _ struct{} `type:"structure"` + // Indicates whether a TLS/SSL certificate was generated for a fleet. + // // CertificateType is a required field CertificateType *string `type:"string" required:"true" enum:"CertificateType"` } @@ -9336,50 +9795,129 @@ func (s *CertificateConfiguration) SetCertificateType(v string) *CertificateConf return s } -// Represents the input for a request action. -type CreateAliasInput struct { - _ struct{} `type:"structure"` - - // Human-readable description of an alias. - Description *string `min:"1" type:"string"` - - // Descriptive label that is associated with an alias. Alias names do not need - // to be unique. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` +// The requested operation would cause a conflict with the current state of +// a service resource associated with the request. Resolve the conflict before +// retrying this request. +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Object that specifies the fleet and routing type to use for the alias. - // - // RoutingStrategy is a required field - RoutingStrategy *RoutingStrategy `type:"structure" required:"true"` + Message_ *string `locationName:"Message" min:"1" type:"string"` } // String returns the string representation -func (s CreateAliasInput) String() string { +func (s ConflictException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateAliasInput) GoString() string { +func (s ConflictException) 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.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) +} + +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" +} + +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil +} + +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID +} + +// Represents the input for a request action. +type CreateAliasInput struct { + _ struct{} `type:"structure"` + + // A human-readable description of the alias. + Description *string `min:"1" type:"string"` + + // A descriptive label that is associated with an alias. Alias names do not + // need to be unique. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The routing configuration, including routing type and fleet target, for the + // alias. + // + // RoutingStrategy is a required field + RoutingStrategy *RoutingStrategy `type:"structure" required:"true"` + + // A list of labels to assign to the new alias resource. Tags are developer-defined + // key-value pairs. Tagging AWS resources are useful for resource management, + // access management and cost allocation. For more information, see Tagging + // AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) + // in the AWS General Reference. Once the resource is created, you can use TagResource, + // UntagResource, and ListTagsForResource to add, remove, and view tags. The + // maximum tag limit may be lower than stated. See the AWS General Reference + // for actual tagging limits. + Tags []*Tag `type:"list"` +} + +// 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.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) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) } if s.RoutingStrategy == nil { invalidParams.Add(request.NewErrParamRequired("RoutingStrategy")) } + 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 @@ -9405,11 +9943,17 @@ func (s *CreateAliasInput) SetRoutingStrategy(v *RoutingStrategy) *CreateAliasIn return s } +// SetTags sets the Tags field's value. +func (s *CreateAliasInput) SetTags(v []*Tag) *CreateAliasInput { + s.Tags = v + return s +} + // Represents the returned data in response to a request action. type CreateAliasOutput struct { _ struct{} `type:"structure"` - // Object that describes the newly created alias record. + // The newly created alias resource. Alias *Alias `type:"structure"` } @@ -9433,11 +9977,11 @@ func (s *CreateAliasOutput) SetAlias(v *Alias) *CreateAliasOutput { type CreateBuildInput struct { _ struct{} `type:"structure"` - // Descriptive label that is associated with a build. Build names do not need + // A descriptive label that is associated with a build. Build names do not need // to be unique. You can use UpdateBuild to change this value later. Name *string `min:"1" type:"string"` - // Operating system that the game server binaries are built to run on. This + // The operating system that the game server binaries are built to run on. This // value determines the type of fleet resources that you can use for this build. // If your game build contains multiple executables, they all must run on the // same operating system. If an operating system is not specified when creating @@ -9447,14 +9991,24 @@ type CreateBuildInput struct { // Information indicating where your game build files are stored. Use this parameter // only when creating a build with files stored in an Amazon S3 bucket that - // you own. The storage location must specify an Amazon S3 bucket name and key, - // as well as a the ARN for a role that you set up to allow Amazon GameLift - // to access your Amazon S3 bucket. The S3 bucket must be in the same region - // that you want to create a new build in. + // you own. The storage location must specify an Amazon S3 bucket name and key. + // The location must also specify a role ARN that you set up to allow Amazon + // GameLift to access your Amazon S3 bucket. The S3 bucket and your new build + // must be in the same Region. StorageLocation *S3Location `type:"structure"` - // Version that is associated with a build or script. Version strings do not - // need to be unique. You can use UpdateBuild to change this value later. + // A list of labels to assign to the new build resource. Tags are developer-defined + // key-value pairs. Tagging AWS resources are useful for resource management, + // access management and cost allocation. For more information, see Tagging + // AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) + // in the AWS General Reference. Once the resource is created, you can use TagResource, + // UntagResource, and ListTagsForResource to add, remove, and view tags. The + // maximum tag limit may be lower than stated. See the AWS General Reference + // for actual tagging limits. + Tags []*Tag `type:"list"` + + // Version information that is associated with a build or script. Version strings + // do not need to be unique. You can use UpdateBuild to change this value later. Version *string `min:"1" type:"string"` } @@ -9482,6 +10036,16 @@ func (s *CreateBuildInput) Validate() error { invalidParams.AddNested("StorageLocation", 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 @@ -9507,6 +10071,12 @@ func (s *CreateBuildInput) SetStorageLocation(v *S3Location) *CreateBuildInput { return s } +// SetTags sets the Tags field's value. +func (s *CreateBuildInput) SetTags(v []*Tag) *CreateBuildInput { + s.Tags = v + return s +} + // SetVersion sets the Version field's value. func (s *CreateBuildInput) SetVersion(v string) *CreateBuildInput { s.Version = &v @@ -9517,7 +10087,7 @@ func (s *CreateBuildInput) SetVersion(v string) *CreateBuildInput { type CreateBuildOutput struct { _ struct{} `type:"structure"` - // The newly created build record, including a unique build ID and status. + // The newly created build record, including a unique build IDs and status. Build *Build `type:"structure"` // Amazon S3 location for your game build file, including bucket name and key. @@ -9562,45 +10132,63 @@ func (s *CreateBuildOutput) SetUploadCredentials(v *AwsCredentials) *CreateBuild type CreateFleetInput struct { _ struct{} `type:"structure"` - // Unique identifier for a build to be deployed on the new fleet. The custom - // game server build must have been successfully uploaded to Amazon GameLift - // and be in a READY status. This fleet setting cannot be changed once the fleet - // is created. + // A unique identifier for a build to be deployed on the new fleet. You can + // use either the build ID or ARN value. The custom game server build must have + // been successfully uploaded to Amazon GameLift and be in a READY status. This + // fleet setting cannot be changed once the fleet is created. BuildId *string `type:"string"` + // Indicates whether to generate a TLS/SSL certificate for the new fleet. TLS + // certificates are used for encrypting traffic between game clients and game + // servers running on GameLift. If this parameter is not specified, the default + // value, DISABLED, is used. This fleet setting cannot be changed once the fleet + // is created. Learn more at Securing Client/Server Communication (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-howitworks.html#gamelift-howitworks-security). + // + // Note: This feature requires the AWS Certificate Manager (ACM) service, which + // is available in the AWS global partition but not in all other partitions. + // When working in a partition that does not support this feature, a request + // for a new fleet with certificate generation results fails with a 4xx unsupported + // Region error. + // + // Valid values include: + // + // * GENERATED - Generate a TLS/SSL certificate for this fleet. + // + // * DISABLED - (default) Do not generate a TLS/SSL certificate for this + // fleet. CertificateConfiguration *CertificateConfiguration `type:"structure"` - // Human-readable description of a fleet. + // A human-readable description of a fleet. Description *string `min:"1" type:"string"` // Range of IP addresses and port settings that permit inbound traffic to access - // game sessions that running on the fleet. For fleets using a custom game build, - // this parameter is required before game sessions running on the fleet can - // accept connections. For Realtime Servers fleets, Amazon GameLift automatically + // game sessions that are running on the fleet. For fleets using a custom game + // build, this parameter is required before game sessions running on the fleet + // can accept connections. For Realtime Servers fleets, Amazon GameLift automatically // sets TCP and UDP ranges for use by the Realtime servers. You can specify // multiple permission settings or add more by updating the fleet. EC2InboundPermissions []*IpPermission `type:"list"` - // Name of an EC2 instance type that is supported in Amazon GameLift. A fleet - // instance type determines the computing resources of each instance in the - // fleet, including CPU, memory, storage, and networking capacity. Amazon GameLift - // supports the following EC2 instance types. See Amazon EC2 Instance Types - // (http://aws.amazon.com/ec2/instance-types/) for detailed descriptions. + // The name of an EC2 instance type that is supported in Amazon GameLift. A + // fleet instance type determines the computing resources of each instance in + // the fleet, including CPU, memory, storage, and networking capacity. Amazon + // GameLift supports the following EC2 instance types. See Amazon EC2 Instance + // Types (http://aws.amazon.com/ec2/instance-types/) for detailed descriptions. // // EC2InstanceType is a required field EC2InstanceType *string `type:"string" required:"true" enum:"EC2InstanceType"` - // Indicates whether to use on-demand instances or spot instances for this fleet. + // Indicates whether to use On-Demand instances or Spot instances for this fleet. // If empty, the default is ON_DEMAND. Both categories of instances use identical // hardware and configurations based on the instance type selected for this // fleet. Learn more about On-Demand versus Spot Instances (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-ec2-instances.html#gamelift-ec2-instances-spot). FleetType *string `type:"string" enum:"FleetType"` - // Unique identifier for an AWS IAM role that manages access to your AWS services. + // A unique identifier for an AWS IAM role that manages access to your AWS services. // With an instance role ARN set, any application that runs on an instance in // this fleet can assume the role, including install scripts, server processes, - // daemons (background processes). Create a role or look up a role's ARN using - // the IAM dashboard (https://console.aws.amazon.com/iam/) in the AWS Management + // and daemons (background processes). Create a role or look up a role's ARN + // from the IAM dashboard (https://console.aws.amazon.com/iam/) in the AWS Management // Console. Learn more about using on-box credentials for your game servers // at Access external resources from a game server (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-resources.html). InstanceRoleArn *string `min:"1" type:"string"` @@ -9611,72 +10199,88 @@ type CreateFleetInput struct { // See more information in the Server API Reference (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api-ref.html#gamelift-sdk-server-api-ref-dataypes-process). LogPaths []*string `type:"list"` - // Name of an Amazon CloudWatch metric group to add this fleet to. A metric + // The name of an Amazon CloudWatch metric group to add this fleet to. A metric // group aggregates the metrics for all fleets in the group. Specify an existing // metric group name, or provide a new name to create a new metric group. A // fleet can only be included in one metric group at a time. MetricGroups []*string `type:"list"` - // Descriptive label that is associated with a fleet. Fleet names do not need + // A descriptive label that is associated with a fleet. Fleet names do not need // to be unique. // // Name is a required field Name *string `min:"1" type:"string" required:"true"` - // Game session protection policy to apply to all instances in this fleet. If - // this parameter is not set, instances in this fleet default to no protection. + // A game session protection policy to apply to all instances in this fleet. + // If this parameter is not set, instances in this fleet default to no protection. // You can change a fleet's protection policy using UpdateFleetAttributes, but // this change will only affect sessions created after the policy change. You // can also set protection for individual instances using UpdateGameSession. // - // * NoProtection -- The game session can be terminated during a scale-down + // * NoProtection - The game session can be terminated during a scale-down // event. // - // * FullProtection -- If the game session is in an ACTIVE status, it cannot + // * FullProtection - If the game session is in an ACTIVE status, it cannot // be terminated during a scale-down event. NewGameSessionProtectionPolicy *string `type:"string" enum:"ProtectionPolicy"` - // Unique identifier for the AWS account with the VPC that you want to peer - // your Amazon GameLift fleet with. You can find your Account ID in the AWS + // A unique identifier for the AWS account with the VPC that you want to peer + // your Amazon GameLift fleet with. You can find your account ID in the AWS // Management Console under account settings. PeerVpcAwsAccountId *string `min:"1" type:"string"` - // Unique identifier for a VPC with resources to be accessed by your Amazon - // GameLift fleet. The VPC must be in the same region where your fleet is deployed. - // Look up a VPC ID using the VPC Dashboard (https://console.aws.amazon.com/vpc/) + // A unique identifier for a VPC with resources to be accessed by your Amazon + // GameLift fleet. The VPC must be in the same Region as your fleet. To look + // up a VPC ID, use the VPC Dashboard (https://console.aws.amazon.com/vpc/) // in the AWS Management Console. Learn more about VPC peering in VPC Peering // with Amazon GameLift Fleets (https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html). PeerVpcId *string `min:"1" type:"string"` - // Policy that limits the number of game sessions an individual player can create - // over a span of time for this fleet. + // A policy that limits the number of game sessions an individual player can + // create over a span of time for this fleet. ResourceCreationLimitPolicy *ResourceCreationLimitPolicy `type:"structure"` // Instructions for launching server processes on each instance in the fleet. // Server processes run either a custom game build executable or a Realtime - // Servers script. The run-time configuration lists the types of server processes - // to run on an instance and includes the following configuration settings: - // the server executable or launch script file, launch parameters, and the number - // of processes to run concurrently on each instance. A CreateFleet request - // must include a run-time configuration with at least one server process configuration. + // script. The runtime configuration defines the server executables or launch + // script file, launch parameters, and the number of processes to run concurrently + // on each instance. When creating a fleet, the runtime configuration must have + // at least one server process configuration; otherwise the request fails with + // an invalid request exception. (This parameter replaces the parameters ServerLaunchPath + // and ServerLaunchParameters, although requests that contain values for these + // parameters instead of a runtime configuration will continue to work.) This + // parameter is required unless the parameters ServerLaunchPath and ServerLaunchParameters + // are defined. Runtime configuration replaced these parameters, but fleets + // that use them will continue to work. RuntimeConfiguration *RuntimeConfiguration `type:"structure"` - // Unique identifier for a Realtime script to be deployed on the new fleet. - // The Realtime script must have been successfully uploaded to Amazon GameLift. - // This fleet setting cannot be changed once the fleet is created. + // A unique identifier for a Realtime script to be deployed on the new fleet. + // You can use either the script ID or ARN value. The Realtime script must have + // been successfully uploaded to Amazon GameLift. This fleet setting cannot + // be changed once the fleet is created. ScriptId *string `type:"string"` // This parameter is no longer used. Instead, specify server launch parameters // in the RuntimeConfiguration parameter. (Requests that specify a server launch - // path and launch parameters instead of a run-time configuration will continue + // path and launch parameters instead of a runtime configuration will continue // to work.) ServerLaunchParameters *string `min:"1" type:"string"` // This parameter is no longer used. Instead, specify a server launch path using - // the RuntimeConfiguration parameter. (Requests that specify a server launch - // path and launch parameters instead of a run-time configuration will continue - // to work.) + // the RuntimeConfiguration parameter. Requests that specify a server launch + // path and launch parameters instead of a runtime configuration will continue + // to work. ServerLaunchPath *string `min:"1" type:"string"` + + // A list of labels to assign to the new fleet resource. Tags are developer-defined + // key-value pairs. Tagging AWS resources are useful for resource management, + // access management and cost allocation. For more information, see Tagging + // AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) + // in the AWS General Reference. Once the resource is created, you can use TagResource, + // UntagResource, and ListTagsForResource to add, remove, and view tags. The + // maximum tag limit may be lower than stated. See the AWS General Reference + // for actual tagging limits. + Tags []*Tag `type:"list"` } // String returns the string representation @@ -9739,6 +10343,16 @@ func (s *CreateFleetInput) Validate() error { invalidParams.AddNested("RuntimeConfiguration", 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 @@ -9854,6 +10468,12 @@ func (s *CreateFleetInput) SetServerLaunchPath(v string) *CreateFleetInput { return s } +// SetTags sets the Tags field's value. +func (s *CreateFleetInput) SetTags(v []*Tag) *CreateFleetInput { + s.Tags = v + return s +} + // Represents the returned data in response to a request action. type CreateFleetOutput struct { _ struct{} `type:"structure"` @@ -9882,18 +10502,19 @@ func (s *CreateFleetOutput) SetFleetAttributes(v *FleetAttributes) *CreateFleetO type CreateGameSessionInput struct { _ struct{} `type:"structure"` - // Unique identifier for an alias associated with the fleet to create a game - // session in. Each request must reference either a fleet ID or alias ID, but - // not both. + // A unique identifier for an alias associated with the fleet to create a game + // session in. You can use either the alias ID or ARN value. Each request must + // reference either a fleet ID or alias ID, but not both. AliasId *string `type:"string"` - // Unique identifier for a player or entity creating the game session. This + // A unique identifier for a player or entity creating the game session. This // ID is used to enforce a resource protection policy (if one exists) that limits // the number of concurrent active game sessions one player can have. CreatorId *string `min:"1" type:"string"` - // Unique identifier for a fleet to create a game session in. Each request must - // reference either a fleet ID or alias ID, but not both. + // A unique identifier for a fleet to create a game session in. You can use + // either the fleet ID or ARN value. Each request must reference either a fleet + // ID or alias ID, but not both. FleetId *string `type:"string"` // Set of custom properties for a game session, formatted as key:value pairs. @@ -9923,14 +10544,14 @@ type CreateGameSessionInput struct { // deleted. IdempotencyToken *string `min:"1" type:"string"` - // Maximum number of players that can be connected simultaneously to the game - // session. + // The maximum number of players that can be connected simultaneously to the + // game session. // // MaximumPlayerSessionCount is a required field MaximumPlayerSessionCount *int64 `type:"integer" required:"true"` - // Descriptive label that is associated with a game session. Session names do - // not need to be unique. + // A descriptive label that is associated with a game session. Session names + // do not need to be unique. Name *string `min:"1" type:"string"` } @@ -10064,30 +10685,40 @@ func (s *CreateGameSessionOutput) SetGameSession(v *GameSession) *CreateGameSess type CreateGameSessionQueueInput struct { _ struct{} `type:"structure"` - // List of fleets that can be used to fulfill game session placement requests + // A list of fleets that can be used to fulfill game session placement requests // in the queue. Fleets are identified by either a fleet ARN or a fleet alias // ARN. Destinations are listed in default preference order. Destinations []*GameSessionQueueDestination `type:"list"` - // Descriptive label that is associated with game session queue. Queue names - // must be unique within each region. + // A descriptive label that is associated with game session queue. Queue names + // must be unique within each Region. // // Name is a required field Name *string `min:"1" type:"string" required:"true"` - // Collection of latency policies to apply when processing game sessions placement + // A collection of latency policies to apply when processing game sessions placement // requests with player latency information. Multiple policies are evaluated // in order of the maximum latency value, starting with the lowest latency values. - // With just one policy, it is enforced at the start of the game session placement - // for the duration period. With multiple policies, each policy is enforced - // consecutively for its duration period. For example, a queue might enforce - // a 60-second policy followed by a 120-second policy, and then no policy for - // the remainder of the placement. A player latency policy must set a value - // for MaximumIndividualPlayerLatencyMilliseconds; if none is set, this API - // requests will fail. + // With just one policy, the policy is enforced at the start of the game session + // placement for the duration period. With multiple policies, each policy is + // enforced consecutively for its duration period. For example, a queue might + // enforce a 60-second policy followed by a 120-second policy, and then no policy + // for the remainder of the placement. A player latency policy must set a value + // for MaximumIndividualPlayerLatencyMilliseconds. If none is set, this API + // request fails. PlayerLatencyPolicies []*PlayerLatencyPolicy `type:"list"` - // Maximum time, in seconds, that a new game session placement request remains + // A list of labels to assign to the new game session queue resource. Tags are + // developer-defined key-value pairs. Tagging AWS resources are useful for resource + // management, access management and cost allocation. For more information, + // see Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) + // in the AWS General Reference. Once the resource is created, you can use TagResource, + // UntagResource, and ListTagsForResource to add, remove, and view tags. The + // maximum tag limit may be lower than stated. See the AWS General Reference + // for actual tagging limits. + Tags []*Tag `type:"list"` + + // The maximum time, in seconds, that a new game session placement request remains // in the queue. When a request exceeds this time, the game session placement // changes to a TIMED_OUT status. TimeoutInSeconds *int64 `type:"integer"` @@ -10122,6 +10753,16 @@ func (s *CreateGameSessionQueueInput) Validate() error { } } } + 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 @@ -10147,6 +10788,12 @@ func (s *CreateGameSessionQueueInput) SetPlayerLatencyPolicies(v []*PlayerLatenc return s } +// SetTags sets the Tags field's value. +func (s *CreateGameSessionQueueInput) SetTags(v []*Tag) *CreateGameSessionQueueInput { + s.Tags = v + return s +} + // SetTimeoutInSeconds sets the TimeoutInSeconds field's value. func (s *CreateGameSessionQueueInput) SetTimeoutInSeconds(v int64) *CreateGameSessionQueueInput { s.TimeoutInSeconds = &v @@ -10157,7 +10804,7 @@ func (s *CreateGameSessionQueueInput) SetTimeoutInSeconds(v int64) *CreateGameSe type CreateGameSessionQueueOutput struct { _ struct{} `type:"structure"` - // Object that describes the newly created game session queue. + // An object that describes the newly created game session queue. GameSessionQueue *GameSessionQueue `type:"structure"` } @@ -10181,82 +10828,92 @@ func (s *CreateGameSessionQueueOutput) SetGameSessionQueue(v *GameSessionQueue) type CreateMatchmakingConfigurationInput struct { _ struct{} `type:"structure"` - // Flag that determines whether a match that was created with this configuration + // A flag that determines whether a match that was created with this configuration // must be accepted by the matched players. To require acceptance, set to TRUE. // // AcceptanceRequired is a required field AcceptanceRequired *bool `type:"boolean" required:"true"` - // Length of time (in seconds) to wait for players to accept a proposed match. - // If any player rejects the match or fails to accept before the timeout, the - // ticket continues to look for an acceptable match. + // The length of time (in seconds) to wait for players to accept a proposed + // match. If any player rejects the match or fails to accept before the timeout, + // the ticket continues to look for an acceptable match. AcceptanceTimeoutSeconds *int64 `min:"1" type:"integer"` - // Number of player slots in a match to keep open for future players. For example, - // if the configuration's rule set specifies a match for a single 12-person - // team, and the additional player count is set to 2, only 10 players are selected - // for the match. + // The number of player slots in a match to keep open for future players. For + // example, assume that the configuration's rule set specifies a match for a + // single 12-person team. If the additional player count is set to 2, only 10 + // players are initially selected for the match. AdditionalPlayerCount *int64 `type:"integer"` - // Method used to backfill game sessions created with this matchmaking configuration. - // Specify MANUAL when your game manages backfill requests manually or does - // not use the match backfill feature. Specify AUTOMATIC to have GameLift create - // a StartMatchBackfill request whenever a game session has one or more open - // slots. Learn more about manual and automatic backfill in Backfill Existing + // The method used to backfill game sessions that are created with this matchmaking + // configuration. Specify MANUAL when your game manages backfill requests manually + // or does not use the match backfill feature. Specify AUTOMATIC to have GameLift + // create a StartMatchBackfill request whenever a game session has one or more + // open slots. Learn more about manual and automatic backfill in Backfill Existing // Games with FlexMatch (https://docs.aws.amazon.com/gamelift/latest/developerguide/match-backfill.html). BackfillMode *string `type:"string" enum:"BackfillMode"` // Information to be added to all events related to this matchmaking configuration. CustomEventData *string `type:"string"` - // Meaningful description of the matchmaking configuration. + // A human-readable description of the matchmaking configuration. Description *string `min:"1" type:"string"` - // Set of custom properties for a game session, formatted as key:value pairs. + // A set of custom properties for a game session, formatted as key-value pairs. // These properties are passed to a game server process in the GameSession object // with a request to start a new game session (see Start a Game Session (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). // This information is added to the new GameSession object that is created for // a successful match. GameProperties []*GameProperty `type:"list"` - // Set of custom game session properties, formatted as a single string value. + // A set of custom game session properties, formatted as a single string value. // This data is passed to a game server process in the GameSession object with // a request to start a new game session (see Start a Game Session (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). // This information is added to the new GameSession object that is created for // a successful match. GameSessionData *string `min:"1" type:"string"` - // Amazon Resource Name (ARN (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) - // that is assigned to a game session queue and uniquely identifies it. Format - // is arn:aws:gamelift:::gamesessionqueue/. - // These queues are used when placing game sessions for matches that are created - // with this matchmaking configuration. Queues can be located in any region. + // Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // that is assigned to a GameLift game session queue resource and uniquely identifies + // it. ARNs are unique across all Regions. These queues are used when placing + // game sessions for matches that are created with this matchmaking configuration. + // Queues can be located in any Region. // // GameSessionQueueArns is a required field GameSessionQueueArns []*string `type:"list" required:"true"` - // Unique identifier for a matchmaking configuration. This name is used to identify - // the configuration associated with a matchmaking request or ticket. + // A unique identifier for a matchmaking configuration. This name is used to + // identify the configuration associated with a matchmaking request or ticket. // // Name is a required field Name *string `type:"string" required:"true"` - // SNS topic ARN that is set up to receive matchmaking notifications. + // An SNS topic ARN that is set up to receive matchmaking notifications. NotificationTarget *string `type:"string"` - // Maximum duration, in seconds, that a matchmaking ticket can remain in process - // before timing out. Requests that fail due to timing out can be resubmitted + // The maximum duration, in seconds, that a matchmaking ticket can remain in + // process before timing out. Requests that fail due to timing out can be resubmitted // as needed. // // RequestTimeoutSeconds is a required field RequestTimeoutSeconds *int64 `min:"1" type:"integer" required:"true"` - // Unique identifier for a matchmaking rule set to use with this configuration. - // A matchmaking configuration can only use rule sets that are defined in the - // same region. + // A unique identifier for a matchmaking rule set to use with this configuration. + // You can use either the rule set name or ARN value. A matchmaking configuration + // can only use rule sets that are defined in the same Region. // // RuleSetName is a required field - RuleSetName *string `type:"string" required:"true"` + RuleSetName *string `min:"1" type:"string" required:"true"` + + // A list of labels to assign to the new matchmaking configuration resource. + // Tags are developer-defined key-value pairs. Tagging AWS resources are useful + // for resource management, access management and cost allocation. For more + // information, see Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) + // in the AWS General Reference. Once the resource is created, you can use TagResource, + // UntagResource, and ListTagsForResource to add, remove, and view tags. The + // maximum tag limit may be lower than stated. See the AWS General Reference + // for actual tagging limits. + Tags []*Tag `type:"list"` } // String returns the string representation @@ -10299,6 +10956,9 @@ func (s *CreateMatchmakingConfigurationInput) Validate() error { if s.RuleSetName == nil { invalidParams.Add(request.NewErrParamRequired("RuleSetName")) } + if s.RuleSetName != nil && len(*s.RuleSetName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleSetName", 1)) + } if s.GameProperties != nil { for i, v := range s.GameProperties { if v == nil { @@ -10309,6 +10969,16 @@ func (s *CreateMatchmakingConfigurationInput) Validate() error { } } } + 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 @@ -10394,6 +11064,12 @@ func (s *CreateMatchmakingConfigurationInput) SetRuleSetName(v string) *CreateMa return s } +// SetTags sets the Tags field's value. +func (s *CreateMatchmakingConfigurationInput) SetTags(v []*Tag) *CreateMatchmakingConfigurationInput { + s.Tags = v + return s +} + // Represents the returned data in response to a request action. type CreateMatchmakingConfigurationOutput struct { _ struct{} `type:"structure"` @@ -10422,18 +11098,28 @@ func (s *CreateMatchmakingConfigurationOutput) SetConfiguration(v *MatchmakingCo type CreateMatchmakingRuleSetInput struct { _ struct{} `type:"structure"` - // Unique identifier for a matchmaking rule set. A matchmaking configuration - // identifies the rule set it uses by this name value. (Note: The rule set name - // is different from the optional "name" field in the rule set body.) + // A unique identifier for a matchmaking rule set. A matchmaking configuration + // identifies the rule set it uses by this name value. Note that the rule set + // name is different from the optional name field in the rule set body. // // Name is a required field Name *string `type:"string" required:"true"` - // Collection of matchmaking rules, formatted as a JSON string. Comments are + // A collection of matchmaking rules, formatted as a JSON string. Comments are // not allowed in JSON, but most elements support a description field. // // RuleSetBody is a required field RuleSetBody *string `min:"1" type:"string" required:"true"` + + // A list of labels to assign to the new matchmaking rule set resource. Tags + // are developer-defined key-value pairs. Tagging AWS resources are useful for + // resource management, access management and cost allocation. For more information, + // see Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) + // in the AWS General Reference. Once the resource is created, you can use TagResource, + // UntagResource, and ListTagsForResource to add, remove, and view tags. The + // maximum tag limit may be lower than stated. See the AWS General Reference + // for actual tagging limits. + Tags []*Tag `type:"list"` } // String returns the string representation @@ -10458,6 +11144,16 @@ func (s *CreateMatchmakingRuleSetInput) Validate() error { if s.RuleSetBody != nil && len(*s.RuleSetBody) < 1 { invalidParams.Add(request.NewErrParamMinLen("RuleSetBody", 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 @@ -10477,11 +11173,17 @@ func (s *CreateMatchmakingRuleSetInput) SetRuleSetBody(v string) *CreateMatchmak return s } +// SetTags sets the Tags field's value. +func (s *CreateMatchmakingRuleSetInput) SetTags(v []*Tag) *CreateMatchmakingRuleSetInput { + s.Tags = v + return s +} + // Represents the returned data in response to a request action. type CreateMatchmakingRuleSetOutput struct { _ struct{} `type:"structure"` - // Object that describes the newly created matchmaking rule set. + // The newly created matchmaking rule set. // // RuleSet is a required field RuleSet *MatchmakingRuleSet `type:"structure" required:"true"` @@ -10507,7 +11209,7 @@ func (s *CreateMatchmakingRuleSetOutput) SetRuleSet(v *MatchmakingRuleSet) *Crea type CreatePlayerSessionInput struct { _ struct{} `type:"structure"` - // Unique identifier for the game session to add a player to. + // A unique identifier for the game session to add a player to. // // GameSessionId is a required field GameSessionId *string `min:"1" type:"string" required:"true"` @@ -10516,7 +11218,7 @@ type CreatePlayerSessionInput struct { // use this data, so it can be formatted as needed for use in the game. PlayerData *string `min:"1" type:"string"` - // Unique identifier for a player. Player IDs are developer-defined. + // A unique identifier for a player. Player IDs are developer-defined. // // PlayerId is a required field PlayerId *string `min:"1" type:"string" required:"true"` @@ -10603,7 +11305,7 @@ func (s *CreatePlayerSessionOutput) SetPlayerSession(v *PlayerSession) *CreatePl type CreatePlayerSessionsInput struct { _ struct{} `type:"structure"` - // Unique identifier for the game session to add players to. + // A unique identifier for the game session to add players to. // // GameSessionId is a required field GameSessionId *string `min:"1" type:"string" required:"true"` @@ -10674,7 +11376,7 @@ func (s *CreatePlayerSessionsInput) SetPlayerIds(v []*string) *CreatePlayerSessi type CreatePlayerSessionsOutput struct { _ struct{} `type:"structure"` - // Collection of player session objects created for the added players. + // A collection of player session objects created for the added players. PlayerSessions []*PlayerSession `type:"list"` } @@ -10697,27 +11399,37 @@ func (s *CreatePlayerSessionsOutput) SetPlayerSessions(v []*PlayerSession) *Crea type CreateScriptInput struct { _ struct{} `type:"structure"` - // Descriptive label that is associated with a script. Script names do not need - // to be unique. You can use UpdateScript to change this value later. + // A descriptive label that is associated with a script. Script names do not + // need to be unique. You can use UpdateScript to change this value later. Name *string `min:"1" type:"string"` - // Location of the Amazon S3 bucket where a zipped file containing your Realtime - // scripts is stored. The storage location must specify the Amazon S3 bucket - // name, the zip file name (the "key"), and a role ARN that allows Amazon GameLift - // to access the Amazon S3 storage location. The S3 bucket must be in the same - // region where you want to create a new script. By default, Amazon GameLift - // uploads the latest version of the zip file; if you have S3 object versioning - // turned on, you can use the ObjectVersion parameter to specify an earlier - // version. + // The location of the Amazon S3 bucket where a zipped file containing your + // Realtime scripts is stored. The storage location must specify the Amazon + // S3 bucket name, the zip file name (the "key"), and a role ARN that allows + // Amazon GameLift to access the Amazon S3 storage location. The S3 bucket must + // be in the same Region where you want to create a new script. By default, + // Amazon GameLift uploads the latest version of the zip file; if you have S3 + // object versioning turned on, you can use the ObjectVersion parameter to specify + // an earlier version. StorageLocation *S3Location `type:"structure"` - // Version that is associated with a build or script. Version strings do not - // need to be unique. You can use UpdateScript to change this value later. + // A list of labels to assign to the new script resource. Tags are developer-defined + // key-value pairs. Tagging AWS resources are useful for resource management, + // access management and cost allocation. For more information, see Tagging + // AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) + // in the AWS General Reference. Once the resource is created, you can use TagResource, + // UntagResource, and ListTagsForResource to add, remove, and view tags. The + // maximum tag limit may be lower than stated. See the AWS General Reference + // for actual tagging limits. + Tags []*Tag `type:"list"` + + // The version that is associated with a build or script. Version strings do + // not need to be unique. You can use UpdateScript to change this value later. Version *string `min:"1" type:"string"` - // Data object containing your Realtime scripts and dependencies as a zip file. - // The zip file can have one or multiple files. Maximum size of a zip file is - // 5 MB. + // A data object containing your Realtime scripts and dependencies as a zip + // file. The zip file can have one or multiple files. Maximum size of a zip + // file is 5 MB. // // When using the AWS CLI tool to create a script, this parameter is set to // the zip file name. It must be prepended with the string "fileb://" to indicate @@ -10751,6 +11463,16 @@ func (s *CreateScriptInput) Validate() error { invalidParams.AddNested("StorageLocation", 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 @@ -10770,6 +11492,12 @@ func (s *CreateScriptInput) SetStorageLocation(v *S3Location) *CreateScriptInput return s } +// SetTags sets the Tags field's value. +func (s *CreateScriptInput) SetTags(v []*Tag) *CreateScriptInput { + s.Tags = v + return s +} + // SetVersion sets the Version field's value. func (s *CreateScriptInput) SetVersion(v string) *CreateScriptInput { s.Version = &v @@ -10785,12 +11513,12 @@ func (s *CreateScriptInput) SetZipFile(v []byte) *CreateScriptInput { type CreateScriptOutput struct { _ struct{} `type:"structure"` - // The newly created script record with a unique script ID. The new script's - // storage location reflects an Amazon S3 location: (1) If the script was uploaded - // from an S3 bucket under your account, the storage location reflects the information - // that was provided in the CreateScript request; (2) If the script file was - // uploaded from a local zip file, the storage location reflects an S3 location - // controls by the Amazon GameLift service. + // The newly created script record with a unique script ID and ARN. The new + // script's storage location reflects an Amazon S3 location: (1) If the script + // was uploaded from an S3 bucket under your account, the storage location reflects + // the information that was provided in the CreateScript request; (2) If the + // script file was uploaded from a local zip file, the storage location reflects + // an S3 location controls by the Amazon GameLift service. Script *Script `type:"structure"` } @@ -10814,15 +11542,15 @@ func (s *CreateScriptOutput) SetScript(v *Script) *CreateScriptOutput { type CreateVpcPeeringAuthorizationInput struct { _ struct{} `type:"structure"` - // Unique identifier for the AWS account that you use to manage your Amazon + // A unique identifier for the AWS account that you use to manage your Amazon // GameLift fleet. You can find your Account ID in the AWS Management Console // under account settings. // // GameLiftAwsAccountId is a required field GameLiftAwsAccountId *string `min:"1" type:"string" required:"true"` - // Unique identifier for a VPC with resources to be accessed by your Amazon - // GameLift fleet. The VPC must be in the same region where your fleet is deployed. + // A unique identifier for a VPC with resources to be accessed by your Amazon + // GameLift fleet. The VPC must be in the same Region where your fleet is deployed. // Look up a VPC ID using the VPC Dashboard (https://console.aws.amazon.com/vpc/) // in the AWS Management Console. Learn more about VPC peering in VPC Peering // with Amazon GameLift Fleets (https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html). @@ -10903,21 +11631,21 @@ func (s *CreateVpcPeeringAuthorizationOutput) SetVpcPeeringAuthorization(v *VpcP type CreateVpcPeeringConnectionInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet. This tells Amazon GameLift which GameLift - // VPC to peer with. + // A unique identifier for a fleet. You can use either the fleet ID or ARN value. + // This tells Amazon GameLift which GameLift VPC to peer with. // // FleetId is a required field FleetId *string `type:"string" required:"true"` - // Unique identifier for the AWS account with the VPC that you want to peer + // A unique identifier for the AWS account with the VPC that you want to peer // your Amazon GameLift fleet with. You can find your Account ID in the AWS // Management Console under account settings. // // PeerVpcAwsAccountId is a required field PeerVpcAwsAccountId *string `min:"1" type:"string" required:"true"` - // Unique identifier for a VPC with resources to be accessed by your Amazon - // GameLift fleet. The VPC must be in the same region where your fleet is deployed. + // A unique identifier for a VPC with resources to be accessed by your Amazon + // GameLift fleet. The VPC must be in the same Region where your fleet is deployed. // Look up a VPC ID using the VPC Dashboard (https://console.aws.amazon.com/vpc/) // in the AWS Management Console. Learn more about VPC peering in VPC Peering // with Amazon GameLift Fleets (https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html). @@ -10997,7 +11725,8 @@ func (s CreateVpcPeeringConnectionOutput) GoString() string { type DeleteAliasInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet alias. Specify the alias you want to delete. + // A unique identifier of the alias that you want to delete. You can use either + // the alias ID or ARN value. // // AliasId is a required field AliasId *string `type:"string" required:"true"` @@ -11050,7 +11779,8 @@ func (s DeleteAliasOutput) GoString() string { type DeleteBuildInput struct { _ struct{} `type:"structure"` - // Unique identifier for a build to delete. + // A unique identifier for a build to delete. You can use either the build ID + // or ARN value. // // BuildId is a required field BuildId *string `type:"string" required:"true"` @@ -11103,7 +11833,8 @@ func (s DeleteBuildOutput) GoString() string { type DeleteFleetInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet to be deleted. + // A unique identifier for a fleet to be deleted. You can use either the fleet + // ID or ARN value. // // FleetId is a required field FleetId *string `type:"string" required:"true"` @@ -11156,8 +11887,9 @@ func (s DeleteFleetOutput) GoString() string { type DeleteGameSessionQueueInput struct { _ struct{} `type:"structure"` - // Descriptive label that is associated with game session queue. Queue names - // must be unique within each region. + // A descriptive label that is associated with game session queue. Queue names + // must be unique within each Region. You can use either the queue ID or ARN + // value. // // Name is a required field Name *string `min:"1" type:"string" required:"true"` @@ -11213,10 +11945,11 @@ func (s DeleteGameSessionQueueOutput) GoString() string { type DeleteMatchmakingConfigurationInput struct { _ struct{} `type:"structure"` - // Unique identifier for a matchmaking configuration + // A unique identifier for a matchmaking configuration. You can use either the + // configuration name or ARN value. // // Name is a required field - Name *string `type:"string" required:"true"` + Name *string `min:"1" type:"string" required:"true"` } // String returns the string representation @@ -11235,6 +11968,9 @@ func (s *DeleteMatchmakingConfigurationInput) Validate() error { 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 @@ -11266,11 +12002,12 @@ func (s DeleteMatchmakingConfigurationOutput) GoString() string { type DeleteMatchmakingRuleSetInput struct { _ struct{} `type:"structure"` - // Unique identifier for a matchmaking rule set to be deleted. (Note: The rule - // set name is different from the optional "name" field in the rule set body.) + // A unique identifier for a matchmaking rule set to be deleted. (Note: The + // rule set name is different from the optional "name" field in the rule set + // body.) You can use either the rule set name or ARN value. // // Name is a required field - Name *string `type:"string" required:"true"` + Name *string `min:"1" type:"string" required:"true"` } // String returns the string representation @@ -11289,6 +12026,9 @@ func (s *DeleteMatchmakingRuleSetInput) Validate() error { 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 @@ -11321,12 +12061,13 @@ func (s DeleteMatchmakingRuleSetOutput) GoString() string { type DeleteScalingPolicyInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet to be deleted. + // A unique identifier for a fleet to be deleted. You can use either the fleet + // ID or ARN value. // // FleetId is a required field FleetId *string `type:"string" required:"true"` - // Descriptive label that is associated with a scaling policy. Policy names + // A descriptive label that is associated with a scaling policy. Policy names // do not need to be unique. // // Name is a required field @@ -11391,7 +12132,8 @@ func (s DeleteScalingPolicyOutput) GoString() string { type DeleteScriptInput struct { _ struct{} `type:"structure"` - // Unique identifier for a Realtime script to delete. + // A unique identifier for a Realtime script to delete. You can use either the + // script ID or ARN value. // // ScriptId is a required field ScriptId *string `type:"string" required:"true"` @@ -11444,15 +12186,15 @@ func (s DeleteScriptOutput) GoString() string { type DeleteVpcPeeringAuthorizationInput struct { _ struct{} `type:"structure"` - // Unique identifier for the AWS account that you use to manage your Amazon + // A unique identifier for the AWS account that you use to manage your Amazon // GameLift fleet. You can find your Account ID in the AWS Management Console // under account settings. // // GameLiftAwsAccountId is a required field GameLiftAwsAccountId *string `min:"1" type:"string" required:"true"` - // Unique identifier for a VPC with resources to be accessed by your Amazon - // GameLift fleet. The VPC must be in the same region where your fleet is deployed. + // A unique identifier for a VPC with resources to be accessed by your Amazon + // GameLift fleet. The VPC must be in the same Region where your fleet is deployed. // Look up a VPC ID using the VPC Dashboard (https://console.aws.amazon.com/vpc/) // in the AWS Management Console. Learn more about VPC peering in VPC Peering // with Amazon GameLift Fleets (https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html). @@ -11523,14 +12265,15 @@ func (s DeleteVpcPeeringAuthorizationOutput) GoString() string { type DeleteVpcPeeringConnectionInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet. This value must match the fleet ID referenced - // in the VPC peering connection record. + // A unique identifier for a fleet. This fleet specified must match the fleet + // referenced in the VPC peering connection record. You can use either the fleet + // ID or ARN value. // // FleetId is a required field FleetId *string `type:"string" required:"true"` - // Unique identifier for a VPC peering connection. This value is included in - // the VpcPeeringConnection object, which can be retrieved by calling DescribeVpcPeeringConnections. + // A unique identifier for a VPC peering connection. This value is included + // in the VpcPeeringConnection object, which can be retrieved by calling DescribeVpcPeeringConnections. // // VpcPeeringConnectionId is a required field VpcPeeringConnectionId *string `min:"1" type:"string" required:"true"` @@ -11595,7 +12338,8 @@ func (s DeleteVpcPeeringConnectionOutput) GoString() string { type DescribeAliasInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet alias. Specify the alias you want to retrieve. + // The unique identifier for the fleet alias that you want to retrieve. You + // can use either the alias ID or ARN value. // // AliasId is a required field AliasId *string `type:"string" required:"true"` @@ -11634,7 +12378,7 @@ func (s *DescribeAliasInput) SetAliasId(v string) *DescribeAliasInput { type DescribeAliasOutput struct { _ struct{} `type:"structure"` - // Object that contains the requested alias. + // The requested alias resource. Alias *Alias `type:"structure"` } @@ -11658,7 +12402,8 @@ func (s *DescribeAliasOutput) SetAlias(v *Alias) *DescribeAliasOutput { type DescribeBuildInput struct { _ struct{} `type:"structure"` - // Unique identifier for a build to retrieve properties for. + // A unique identifier for a build to retrieve properties for. You can use either + // the build ID or ARN value. // // BuildId is a required field BuildId *string `type:"string" required:"true"` @@ -11750,8 +12495,7 @@ func (s *DescribeEC2InstanceLimitsInput) SetEC2InstanceType(v string) *DescribeE type DescribeEC2InstanceLimitsOutput struct { _ struct{} `type:"structure"` - // Object that contains the maximum number of instances for the specified instance - // type. + // The maximum number of instances for the specified instance type. EC2InstanceLimits []*EC2InstanceLimit `type:"list"` } @@ -11775,12 +12519,12 @@ func (s *DescribeEC2InstanceLimitsOutput) SetEC2InstanceLimits(v []*EC2InstanceL type DescribeFleetAttributesInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet(s) to retrieve attributes for. To request attributes - // for all fleets, leave this parameter empty. + // A unique identifier for a fleet(s) to retrieve attributes for. You can use + // either the fleet ID or ARN value. FleetIds []*string `min:"1" type:"list"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. This parameter is ignored when + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. This parameter is ignored when // the request specifies one or a list of fleet IDs. Limit *int64 `min:"1" type:"integer"` @@ -11842,8 +12586,8 @@ func (s *DescribeFleetAttributesInput) SetNextToken(v string) *DescribeFleetAttr type DescribeFleetAttributesOutput struct { _ struct{} `type:"structure"` - // Collection of objects containing attribute metadata for each requested fleet - // ID. + // A collection of objects containing attribute metadata for each requested + // fleet ID. FleetAttributes []*FleetAttributes `type:"list"` // Token that indicates where to resume retrieving results on the next call @@ -11878,12 +12622,12 @@ func (s *DescribeFleetAttributesOutput) SetNextToken(v string) *DescribeFleetAtt type DescribeFleetCapacityInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet(s) to retrieve capacity information for. To - // request capacity information for all fleets, leave this parameter empty. + // A unique identifier for a fleet(s) to retrieve capacity information for. + // You can use either the fleet ID or ARN value. FleetIds []*string `min:"1" type:"list"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. This parameter is ignored when + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. This parameter is ignored when // the request specifies one or a list of fleet IDs. Limit *int64 `min:"1" type:"integer"` @@ -11945,7 +12689,7 @@ func (s *DescribeFleetCapacityInput) SetNextToken(v string) *DescribeFleetCapaci type DescribeFleetCapacityOutput struct { _ struct{} `type:"structure"` - // Collection of objects containing capacity information for each requested + // A collection of objects containing capacity information for each requested // fleet ID. Leave this parameter empty to retrieve capacity information for // all fleets. FleetCapacity []*FleetCapacity `type:"list"` @@ -11987,13 +12731,14 @@ type DescribeFleetEventsInput struct { // Format is a number expressed in Unix time as milliseconds (ex: "1469498468.057"). EndTime *time.Time `type:"timestamp"` - // Unique identifier for a fleet to get event logs for. + // A unique identifier for a fleet to get event logs for. You can use either + // the fleet ID or ARN value. // // FleetId is a required field FleetId *string `type:"string" required:"true"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. Limit *int64 `min:"1" type:"integer"` // Token that indicates the start of the next sequential page of results. Use @@ -12071,7 +12816,7 @@ func (s *DescribeFleetEventsInput) SetStartTime(v time.Time) *DescribeFleetEvent type DescribeFleetEventsOutput struct { _ struct{} `type:"structure"` - // Collection of objects containing event log entries for the specified fleet. + // A collection of objects containing event log entries for the specified fleet. Events []*Event `type:"list"` // Token that indicates where to resume retrieving results on the next call @@ -12106,7 +12851,8 @@ func (s *DescribeFleetEventsOutput) SetNextToken(v string) *DescribeFleetEventsO type DescribeFleetPortSettingsInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet to retrieve port settings for. + // A unique identifier for a fleet to retrieve port settings for. You can use + // either the fleet ID or ARN value. // // FleetId is a required field FleetId *string `type:"string" required:"true"` @@ -12145,7 +12891,7 @@ func (s *DescribeFleetPortSettingsInput) SetFleetId(v string) *DescribeFleetPort type DescribeFleetPortSettingsOutput struct { _ struct{} `type:"structure"` - // Object that contains port settings for the requested fleet ID. + // The port settings for the requested fleet ID. InboundPermissions []*IpPermission `type:"list"` } @@ -12169,12 +12915,12 @@ func (s *DescribeFleetPortSettingsOutput) SetInboundPermissions(v []*IpPermissio type DescribeFleetUtilizationInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet(s) to retrieve utilization data for. To request - // utilization data for all fleets, leave this parameter empty. + // A unique identifier for a fleet(s) to retrieve utilization data for. You + // can use either the fleet ID or ARN value. FleetIds []*string `min:"1" type:"list"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. This parameter is ignored when + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. This parameter is ignored when // the request specifies one or a list of fleet IDs. Limit *int64 `min:"1" type:"integer"` @@ -12236,7 +12982,7 @@ func (s *DescribeFleetUtilizationInput) SetNextToken(v string) *DescribeFleetUti type DescribeFleetUtilizationOutput struct { _ struct{} `type:"structure"` - // Collection of objects containing utilization information for each requested + // A collection of objects containing utilization information for each requested // fleet ID. FleetUtilization []*FleetUtilization `type:"list"` @@ -12272,19 +13018,19 @@ func (s *DescribeFleetUtilizationOutput) SetNextToken(v string) *DescribeFleetUt type DescribeGameSessionDetailsInput struct { _ struct{} `type:"structure"` - // Unique identifier for an alias associated with the fleet to retrieve all - // game sessions for. + // A unique identifier for an alias associated with the fleet to retrieve all + // game sessions for. You can use either the alias ID or ARN value. AliasId *string `type:"string"` - // Unique identifier for a fleet to retrieve all game sessions active on the - // fleet. + // A unique identifier for a fleet to retrieve all game sessions active on the + // fleet. You can use either the fleet ID or ARN value. FleetId *string `type:"string"` - // Unique identifier for the game session to retrieve. + // A unique identifier for the game session to retrieve. GameSessionId *string `min:"1" type:"string"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. Limit *int64 `min:"1" type:"integer"` // Token that indicates the start of the next sequential page of results. Use @@ -12370,7 +13116,7 @@ func (s *DescribeGameSessionDetailsInput) SetStatusFilter(v string) *DescribeGam type DescribeGameSessionDetailsOutput struct { _ struct{} `type:"structure"` - // Collection of objects containing game session properties and the protection + // A collection of objects containing game session properties and the protection // policy currently in force for each session matching the request. GameSessionDetails []*GameSessionDetail `type:"list"` @@ -12406,7 +13152,7 @@ func (s *DescribeGameSessionDetailsOutput) SetNextToken(v string) *DescribeGameS type DescribeGameSessionPlacementInput struct { _ struct{} `type:"structure"` - // Unique identifier for a game session placement to retrieve. + // A unique identifier for a game session placement to retrieve. // // PlacementId is a required field PlacementId *string `min:"1" type:"string" required:"true"` @@ -12472,16 +13218,17 @@ func (s *DescribeGameSessionPlacementOutput) SetGameSessionPlacement(v *GameSess type DescribeGameSessionQueuesInput struct { _ struct{} `type:"structure"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. Limit *int64 `min:"1" type:"integer"` - // List of queue names to retrieve information for. To request settings for - // all queues, leave this parameter empty. + // A list of queue names to retrieve information for. You can use either the + // queue ID or ARN value. To request settings for all queues, leave this parameter + // empty. Names []*string `type:"list"` - // Token that indicates the start of the next sequential page of results. Use - // the token that is returned with a previous call to this action. To start + // A token that indicates the start of the next sequential page of results. + // Use the token that is returned with a previous call to this action. To start // at the beginning of the result set, do not specify a value. NextToken *string `min:"1" type:"string"` } @@ -12534,10 +13281,10 @@ func (s *DescribeGameSessionQueuesInput) SetNextToken(v string) *DescribeGameSes type DescribeGameSessionQueuesOutput struct { _ struct{} `type:"structure"` - // Collection of objects that describes the requested game session queues. + // A collection of objects that describe the requested game session queues. GameSessionQueues []*GameSessionQueue `type:"list"` - // Token that indicates where to resume retrieving results on the next call + // A token that indicates where to resume retrieving results on the next call // to this action. If no token is returned, these results represent the end // of the list. NextToken *string `min:"1" type:"string"` @@ -12569,19 +13316,19 @@ func (s *DescribeGameSessionQueuesOutput) SetNextToken(v string) *DescribeGameSe type DescribeGameSessionsInput struct { _ struct{} `type:"structure"` - // Unique identifier for an alias associated with the fleet to retrieve all - // game sessions for. + // A unique identifier for an alias associated with the fleet to retrieve all + // game sessions for. You can use either the alias ID or ARN value. AliasId *string `type:"string"` - // Unique identifier for a fleet to retrieve all game sessions for. + // A unique identifier for a fleet to retrieve all game sessions for. You can + // use either the fleet ID or ARN value. FleetId *string `type:"string"` - // Unique identifier for the game session to retrieve. You can use either a - // GameSessionId or GameSessionArn value. + // A unique identifier for the game session to retrieve. GameSessionId *string `min:"1" type:"string"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. Limit *int64 `min:"1" type:"integer"` // Token that indicates the start of the next sequential page of results. Use @@ -12667,7 +13414,7 @@ func (s *DescribeGameSessionsInput) SetStatusFilter(v string) *DescribeGameSessi type DescribeGameSessionsOutput struct { _ struct{} `type:"structure"` - // Collection of objects containing game session properties for each session + // A collection of objects containing game session properties for each session // matching the request. GameSessions []*GameSession `type:"list"` @@ -12703,17 +13450,18 @@ func (s *DescribeGameSessionsOutput) SetNextToken(v string) *DescribeGameSession type DescribeInstancesInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet to retrieve instance information for. + // A unique identifier for a fleet to retrieve instance information for. You + // can use either the fleet ID or ARN value. // // FleetId is a required field FleetId *string `type:"string" required:"true"` - // Unique identifier for an instance to retrieve. Specify an instance ID or + // A unique identifier for an instance to retrieve. Specify an instance ID or // leave blank to retrieve all instances in the fleet. InstanceId *string `type:"string"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. Limit *int64 `min:"1" type:"integer"` // Token that indicates the start of the next sequential page of results. Use @@ -12779,7 +13527,7 @@ func (s *DescribeInstancesInput) SetNextToken(v string) *DescribeInstancesInput type DescribeInstancesOutput struct { _ struct{} `type:"structure"` - // Collection of objects containing properties for each instance returned. + // A collection of objects containing properties for each instance returned. Instances []*Instance `type:"list"` // Token that indicates where to resume retrieving results on the next call @@ -12814,22 +13562,25 @@ func (s *DescribeInstancesOutput) SetNextToken(v string) *DescribeInstancesOutpu type DescribeMatchmakingConfigurationsInput struct { _ struct{} `type:"structure"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. This parameter is limited to 10. + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. This parameter is limited to + // 10. Limit *int64 `min:"1" type:"integer"` - // Unique identifier for a matchmaking configuration(s) to retrieve. To request - // all existing configurations, leave this parameter empty. + // A unique identifier for a matchmaking configuration(s) to retrieve. You can + // use either the configuration name or ARN value. To request all existing configurations, + // leave this parameter empty. Names []*string `type:"list"` - // Token that indicates the start of the next sequential page of results. Use - // the token that is returned with a previous call to this action. To start + // A token that indicates the start of the next sequential page of results. + // Use the token that is returned with a previous call to this action. To start // at the beginning of the result set, do not specify a value. NextToken *string `min:"1" type:"string"` - // Unique identifier for a matchmaking rule set. Use this parameter to retrieve - // all matchmaking configurations that use this rule set. - RuleSetName *string `type:"string"` + // A unique identifier for a matchmaking rule set. You can use either the rule + // set name or ARN value. Use this parameter to retrieve all matchmaking configurations + // that use this rule set. + RuleSetName *string `min:"1" type:"string"` } // String returns the string representation @@ -12851,6 +13602,9 @@ func (s *DescribeMatchmakingConfigurationsInput) Validate() error { if s.NextToken != nil && len(*s.NextToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } + if s.RuleSetName != nil && len(*s.RuleSetName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleSetName", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -12886,10 +13640,10 @@ func (s *DescribeMatchmakingConfigurationsInput) SetRuleSetName(v string) *Descr type DescribeMatchmakingConfigurationsOutput struct { _ struct{} `type:"structure"` - // Collection of requested matchmaking configuration objects. + // A collection of requested matchmaking configurations. Configurations []*MatchmakingConfiguration `type:"list"` - // Token that indicates where to resume retrieving results on the next call + // A token that indicates where to resume retrieving results on the next call // to this action. If no token is returned, these results represent the end // of the list. NextToken *string `min:"1" type:"string"` @@ -12921,7 +13675,8 @@ func (s *DescribeMatchmakingConfigurationsOutput) SetNextToken(v string) *Descri type DescribeMatchmakingInput struct { _ struct{} `type:"structure"` - // Unique identifier for a matchmaking ticket. You can include up to 10 ID values. + // A unique identifier for a matchmaking ticket. You can include up to 10 ID + // values. // // TicketIds is a required field TicketIds []*string `type:"list" required:"true"` @@ -12960,7 +13715,7 @@ func (s *DescribeMatchmakingInput) SetTicketIds(v []*string) *DescribeMatchmakin type DescribeMatchmakingOutput struct { _ struct{} `type:"structure"` - // Collection of existing matchmaking ticket objects matching the request. + // A collection of existing matchmaking ticket objects matching the request. TicketList []*MatchmakingTicket `type:"list"` } @@ -12984,17 +13739,17 @@ func (s *DescribeMatchmakingOutput) SetTicketList(v []*MatchmakingTicket) *Descr type DescribeMatchmakingRuleSetsInput struct { _ struct{} `type:"structure"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. Limit *int64 `min:"1" type:"integer"` - // List of one or more matchmaking rule set names to retrieve details for. (Note: - // The rule set name is different from the optional "name" field in the rule - // set body.) + // A list of one or more matchmaking rule set names to retrieve details for. + // (Note: The rule set name is different from the optional "name" field in the + // rule set body.) You can use either the rule set name or ARN value. Names []*string `min:"1" type:"list"` - // Token that indicates the start of the next sequential page of results. Use - // the token that is returned with a previous call to this action. To start + // A token that indicates the start of the next sequential page of results. + // Use the token that is returned with a previous call to this action. To start // at the beginning of the result set, do not specify a value. NextToken *string `min:"1" type:"string"` } @@ -13050,12 +13805,12 @@ func (s *DescribeMatchmakingRuleSetsInput) SetNextToken(v string) *DescribeMatch type DescribeMatchmakingRuleSetsOutput struct { _ struct{} `type:"structure"` - // Token that indicates where to resume retrieving results on the next call + // A token that indicates where to resume retrieving results on the next call // to this action. If no token is returned, these results represent the end // of the list. NextToken *string `min:"1" type:"string"` - // Collection of requested matchmaking rule set objects. + // A collection of requested matchmaking rule set objects. // // RuleSets is a required field RuleSets []*MatchmakingRuleSet `type:"list" required:"true"` @@ -13087,11 +13842,11 @@ func (s *DescribeMatchmakingRuleSetsOutput) SetRuleSets(v []*MatchmakingRuleSet) type DescribePlayerSessionsInput struct { _ struct{} `type:"structure"` - // Unique identifier for the game session to retrieve player sessions for. + // A unique identifier for the game session to retrieve player sessions for. GameSessionId *string `min:"1" type:"string"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. If a player session ID is specified, + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. If a player session ID is specified, // this parameter is ignored. Limit *int64 `min:"1" type:"integer"` @@ -13101,10 +13856,10 @@ type DescribePlayerSessionsInput struct { // ID is specified, this parameter is ignored. NextToken *string `min:"1" type:"string"` - // Unique identifier for a player to retrieve player sessions for. + // A unique identifier for a player to retrieve player sessions for. PlayerId *string `min:"1" type:"string"` - // Unique identifier for a player session to retrieve. + // A unique identifier for a player session to retrieve. PlayerSessionId *string `type:"string"` // Player session status to filter results on. @@ -13204,7 +13959,7 @@ type DescribePlayerSessionsOutput struct { // of the list. NextToken *string `min:"1" type:"string"` - // Collection of objects containing properties for each player session that + // A collection of objects containing properties for each player session that // matches the request. PlayerSessions []*PlayerSession `type:"list"` } @@ -13235,7 +13990,8 @@ func (s *DescribePlayerSessionsOutput) SetPlayerSessions(v []*PlayerSession) *De type DescribeRuntimeConfigurationInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet to get the run-time configuration for. + // A unique identifier for a fleet to get the runtime configuration for. You + // can use either the fleet ID or ARN value. // // FleetId is a required field FleetId *string `type:"string" required:"true"` @@ -13299,13 +14055,14 @@ func (s *DescribeRuntimeConfigurationOutput) SetRuntimeConfiguration(v *RuntimeC type DescribeScalingPoliciesInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet to retrieve scaling policies for. + // A unique identifier for a fleet to retrieve scaling policies for. You can + // use either the fleet ID or ARN value. // // FleetId is a required field FleetId *string `type:"string" required:"true"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. Limit *int64 `min:"1" type:"integer"` // Token that indicates the start of the next sequential page of results. Use @@ -13395,7 +14152,7 @@ type DescribeScalingPoliciesOutput struct { // of the list. NextToken *string `min:"1" type:"string"` - // Collection of objects containing the scaling policies matching the request. + // A collection of objects containing the scaling policies matching the request. ScalingPolicies []*ScalingPolicy `type:"list"` } @@ -13424,7 +14181,8 @@ func (s *DescribeScalingPoliciesOutput) SetScalingPolicies(v []*ScalingPolicy) * type DescribeScriptInput struct { _ struct{} `type:"structure"` - // Unique identifier for a Realtime script to retrieve properties for. + // A unique identifier for a Realtime script to retrieve properties for. You + // can use either the script ID or ARN value. // // ScriptId is a required field ScriptId *string `type:"string" required:"true"` @@ -13462,7 +14220,7 @@ func (s *DescribeScriptInput) SetScriptId(v string) *DescribeScriptInput { type DescribeScriptOutput struct { _ struct{} `type:"structure"` - // Set of properties describing the requested script. + // A set of properties describing the requested script. Script *Script `type:"structure"` } @@ -13499,7 +14257,7 @@ func (s DescribeVpcPeeringAuthorizationsInput) GoString() string { type DescribeVpcPeeringAuthorizationsOutput struct { _ struct{} `type:"structure"` - // Collection of objects that describe all valid VPC peering operations for + // A collection of objects that describe all valid VPC peering operations for // the current AWS account. VpcPeeringAuthorizations []*VpcPeeringAuthorization `type:"list"` } @@ -13524,7 +14282,7 @@ func (s *DescribeVpcPeeringAuthorizationsOutput) SetVpcPeeringAuthorizations(v [ type DescribeVpcPeeringConnectionsInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet. + // A unique identifier for a fleet. You can use either the fleet ID or ARN value. FleetId *string `type:"string"` } @@ -13548,7 +14306,7 @@ func (s *DescribeVpcPeeringConnectionsInput) SetFleetId(v string) *DescribeVpcPe type DescribeVpcPeeringConnectionsOutput struct { _ struct{} `type:"structure"` - // Collection of VPC peering connection records that match the request. + // A collection of VPC peering connection records that match the request. VpcPeeringConnections []*VpcPeeringConnection `type:"list"` } @@ -13577,7 +14335,7 @@ type DesiredPlayerSession struct { // use this data, so it can be formatted as needed for use in the game. PlayerData *string `min:"1" type:"string"` - // Unique identifier for a player to associate with the player session. + // A unique identifier for a player to associate with the player session. PlayerId *string `min:"1" type:"string"` } @@ -13631,12 +14389,9 @@ func (s *DesiredPlayerSession) SetPlayerId(v string) *DesiredPlayerSession { // // * DeleteFleet // -// * Describe fleets: DescribeFleetAttributes DescribeFleetCapacity DescribeFleetPortSettings -// DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits -// DescribeFleetEvents +// * DescribeFleetAttributes // -// * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings -// UpdateRuntimeConfiguration +// * UpdateFleetAttributes // // * Manage fleet actions: StartFleetActions StopFleetActions type EC2InstanceCounts struct { @@ -13652,10 +14407,10 @@ type EC2InstanceCounts struct { // game session. IDLE *int64 `type:"integer"` - // Maximum value allowed for the fleet's instance count. + // The maximum value allowed for the fleet's instance count. MAXIMUM *int64 `type:"integer"` - // Minimum value allowed for the fleet's instance count. + // The minimum value allowed for the fleet's instance count. MINIMUM *int64 `type:"integer"` // Number of instances in the fleet that are starting but not yet active. @@ -13718,8 +14473,9 @@ func (s *EC2InstanceCounts) SetTERMINATING(v int64) *EC2InstanceCounts { return s } -// Maximum number of instances allowed based on the Amazon Elastic Compute Cloud -// (Amazon EC2) instance type. Instance limits can be retrieved by calling DescribeEC2InstanceLimits. +// The maximum number of instances allowed based on the Amazon Elastic Compute +// Cloud (Amazon EC2) instance type. Instance limits can be retrieved by calling +// DescribeEC2InstanceLimits. type EC2InstanceLimit struct { _ struct{} `type:"structure"` @@ -13772,9 +14528,9 @@ func (s *EC2InstanceLimit) SetInstanceLimit(v int64) *EC2InstanceLimit { type Event struct { _ struct{} `type:"structure"` - // Type of event being logged. The following events are currently in use: + // The type of event being logged. // - // Fleet creation events: + // Fleet creation events (ordered by fleet creation activity): // // * FLEET_CREATED -- A fleet record was successfully created with a status // of NEW. Event messaging includes the fleet ID. @@ -13801,22 +14557,22 @@ type Event struct { // // * FLEET_CREATION_VALIDATING_RUNTIME_CONFIG -- The build process was successful, // and the Amazon GameLift is now verifying that the game server launch paths, - // which are specified in the fleet's run-time configuration, exist. If any + // which are specified in the fleet's runtime configuration, exist. If any // listed launch path exists, Amazon GameLift tries to launch a game server // process and waits for the process to report ready. Failures in this stage // prevent a fleet from moving to ACTIVE status. Logs for this stage list - // the launch paths in the run-time configuration and indicate whether each + // the launch paths in the runtime configuration and indicate whether each // is found. Access the logs by using the URL in PreSignedLogUrl. // // * FLEET_STATE_VALIDATING -- Fleet status changed from DOWNLOADING to VALIDATING. // - // * FLEET_VALIDATION_LAUNCH_PATH_NOT_FOUND -- Validation of the run-time + // * FLEET_VALIDATION_LAUNCH_PATH_NOT_FOUND -- Validation of the runtime // configuration failed because the executable specified in a launch path // does not exist on the instance. // // * FLEET_STATE_BUILDING -- Fleet status changed from VALIDATING to BUILDING. // - // * FLEET_VALIDATION_EXECUTABLE_RUNTIME_FAILURE -- Validation of the run-time + // * FLEET_VALIDATION_EXECUTABLE_RUNTIME_FAILURE -- Validation of the runtime // configuration failed because the executable specified in a launch path // failed to run on the fleet instance. // @@ -13825,9 +14581,8 @@ type Event struct { // * FLEET_ACTIVATION_FAILED - The fleet failed to successfully complete // one of the steps in the fleet activation process. This event code indicates // that the game build was successfully downloaded to a fleet instance, built, - // and validated, but was not able to start a server process. A possible - // reason for failure is that the game server is not reporting "process ready" - // to the Amazon GameLift service. + // and validated, but was not able to start a server process. Learn more + // at Debug Fleet Creation Issues (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-creating-debug.html#fleets-creating-debug-creation) // // * FLEET_STATE_ACTIVE -- The fleet's status changed from ACTIVATING to // ACTIVE. The fleet is now ready to host game sessions. @@ -13868,7 +14623,7 @@ type Event struct { // * GENERIC_EVENT -- An unspecified event has occurred. EventCode *string `type:"string" enum:"EventCode"` - // Unique identifier for a fleet event. + // A unique identifier for a fleet event. EventId *string `min:"1" type:"string"` // Time stamp indicating when this event occurred. Format is a number expressed @@ -13883,7 +14638,7 @@ type Event struct { // can also access fleet creation logs through the Amazon GameLift console. PreSignedLogUrl *string `min:"1" type:"string"` - // Unique identifier for an event resource, such as a fleet ID. + // A unique identifier for an event resource, such as a fleet ID. ResourceId *string `min:"1" type:"string"` } @@ -13941,20 +14696,24 @@ func (s *Event) SetResourceId(v string) *Event { // // * DeleteFleet // -// * Describe fleets: DescribeFleetAttributes DescribeFleetCapacity DescribeFleetPortSettings -// DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits -// DescribeFleetEvents +// * DescribeFleetAttributes // -// * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings -// UpdateRuntimeConfiguration +// * UpdateFleetAttributes // // * Manage fleet actions: StartFleetActions StopFleetActions type FleetAttributes struct { _ struct{} `type:"structure"` - // Unique identifier for a build. + // The Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // associated with the GameLift build resource that is deployed on instances + // in this fleet. In a GameLift build ARN, the resource ID matches the BuildId + // value. + BuildArn *string `type:"string"` + + // A unique identifier for a build. BuildId *string `type:"string"` + // Indicates whether a TLS/SSL certificate was generated for the fleet. CertificateConfiguration *CertificateConfiguration `type:"structure"` // Time stamp indicating when this data object was created. Format is a number @@ -13964,21 +14723,24 @@ type FleetAttributes struct { // Human-readable description of the fleet. Description *string `min:"1" type:"string"` - // Identifier for a fleet that is unique across all regions. + // The Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // that is assigned to a GameLift fleet resource and uniquely identifies it. + // ARNs are unique across all Regions. In a GameLift fleet ARN, the resource + // ID matches the FleetId value. FleetArn *string `min:"1" type:"string"` - // Unique identifier for a fleet. + // A unique identifier for a fleet. FleetId *string `type:"string"` // Indicates whether the fleet uses on-demand or spot instances. A spot instance // in use may be interrupted with a two-minute notification. FleetType *string `type:"string" enum:"FleetType"` - // Unique identifier for an AWS IAM role that manages access to your AWS services. + // A unique identifier for an AWS IAM role that manages access to your AWS services. // With an instance role ARN set, any application that runs on an instance in // this fleet can assume the role, including install scripts, server processes, - // daemons (background processes). Create a role or look up a role's ARN using - // the IAM dashboard (https://console.aws.amazon.com/iam/) in the AWS Management + // and daemons (background processes). Create a role or look up a role's ARN + // from the IAM dashboard (https://console.aws.amazon.com/iam/) in the AWS Management // Console. Learn more about using on-box credentials for your game servers // at Access external resources from a game server (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-resources.html). InstanceRoleArn *string `min:"1" type:"string"` @@ -14005,12 +14767,12 @@ type FleetAttributes struct { // group at a time. MetricGroups []*string `type:"list"` - // Descriptive label that is associated with a fleet. Fleet names do not need + // A descriptive label that is associated with a fleet. Fleet names do not need // to be unique. Name *string `min:"1" type:"string"` - // Type of game session protection to set for all new instances started in the - // fleet. + // The type of game session protection to set for all new instances started + // in the fleet. // // * NoProtection -- The game session can be terminated during a scale-down // event. @@ -14028,7 +14790,13 @@ type FleetAttributes struct { // create over a span of time. ResourceCreationLimitPolicy *ResourceCreationLimitPolicy `type:"structure"` - // Unique identifier for a Realtime script. + // The Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // associated with the GameLift script resource that is deployed on instances + // in this fleet. In a GameLift script ARN, the resource ID matches the ScriptId + // value. + ScriptArn *string `type:"string"` + + // A unique identifier for a Realtime script. ScriptId *string `type:"string"` // Game server launch parameters specified for fleets created before 2016-08-04 @@ -14081,6 +14849,12 @@ func (s FleetAttributes) GoString() string { return s.String() } +// SetBuildArn sets the BuildArn field's value. +func (s *FleetAttributes) SetBuildArn(v string) *FleetAttributes { + s.BuildArn = &v + return s +} + // SetBuildId sets the BuildId field's value. func (s *FleetAttributes) SetBuildId(v string) *FleetAttributes { s.BuildId = &v @@ -14171,6 +14945,12 @@ func (s *FleetAttributes) SetResourceCreationLimitPolicy(v *ResourceCreationLimi return s } +// SetScriptArn sets the ScriptArn field's value. +func (s *FleetAttributes) SetScriptArn(v string) *FleetAttributes { + s.ScriptArn = &v + return s +} + // SetScriptId sets the ScriptId field's value. func (s *FleetAttributes) SetScriptId(v string) *FleetAttributes { s.ScriptId = &v @@ -14218,18 +14998,15 @@ func (s *FleetAttributes) SetTerminationTime(v time.Time) *FleetAttributes { // // * DeleteFleet // -// * Describe fleets: DescribeFleetAttributes DescribeFleetCapacity DescribeFleetPortSettings -// DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits -// DescribeFleetEvents +// * DescribeFleetAttributes // -// * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings -// UpdateRuntimeConfiguration +// * UpdateFleetAttributes // // * Manage fleet actions: StartFleetActions StopFleetActions type FleetCapacity struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet. + // A unique identifier for a fleet. FleetId *string `type:"string"` // Current status of fleet capacity. @@ -14271,6 +15048,63 @@ func (s *FleetCapacity) SetInstanceType(v string) *FleetCapacity { return s } +// The specified fleet has no available instances to fulfill a CreateGameSession +// request. Clients can retry such requests immediately or after a waiting period. +type FleetCapacityExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s FleetCapacityExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FleetCapacityExceededException) GoString() string { + return s.String() +} + +func newErrorFleetCapacityExceededException(v protocol.ResponseMetadata) error { + return &FleetCapacityExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FleetCapacityExceededException) Code() string { + return "FleetCapacityExceededException" +} + +// Message returns the exception's message. +func (s FleetCapacityExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FleetCapacityExceededException) OrigErr() error { + return nil +} + +func (s FleetCapacityExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FleetCapacityExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FleetCapacityExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Current status of fleet utilization, including the number of game and player // sessions being hosted. // @@ -14280,12 +15114,9 @@ func (s *FleetCapacity) SetInstanceType(v string) *FleetCapacity { // // * DeleteFleet // -// * Describe fleets: DescribeFleetAttributes DescribeFleetCapacity DescribeFleetPortSettings -// DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits -// DescribeFleetEvents +// * DescribeFleetAttributes // -// * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings -// UpdateRuntimeConfiguration +// * UpdateFleetAttributes // // * Manage fleet actions: StartFleetActions StopFleetActions type FleetUtilization struct { @@ -14303,11 +15134,11 @@ type FleetUtilization struct { // in the fleet. CurrentPlayerSessionCount *int64 `type:"integer"` - // Unique identifier for a fleet. + // A unique identifier for a fleet. FleetId *string `type:"string"` - // Maximum players allowed across all game sessions currently being hosted on - // all instances in the fleet. + // The maximum number of players allowed across all game sessions currently + // being hosted on all instances in the fleet. MaximumPlayerSessionCount *int64 `type:"integer"` } @@ -14353,20 +15184,19 @@ func (s *FleetUtilization) SetMaximumPlayerSessionCount(v int64) *FleetUtilizati // Set of key-value pairs that contain information about a game session. When // included in a game session request, these properties communicate details -// to be used when setting up the new game session, such as to specify a game -// mode, level, or map. Game properties are passed to the game server process -// when initiating a new game session; the server process uses the properties -// as appropriate. For more information, see the Amazon GameLift Developer Guide -// (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#gamelift-sdk-client-api-create). +// to be used when setting up the new game session. For example, a game property +// might specify a game mode, level, or map. Game properties are passed to the +// game server process when initiating a new game session. For more information, +// see the Amazon GameLift Developer Guide (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-client-api.html#gamelift-sdk-client-api-create). type GameProperty struct { _ struct{} `type:"structure"` - // Game property identifier. + // The game property identifier. // // Key is a required field Key *string `type:"string" required:"true"` - // Game property value. + // The game property value. // // Value is a required field Value *string `type:"string" required:"true"` @@ -14440,7 +15270,7 @@ type GameSession struct { // expressed in Unix time as milliseconds (for example "1469498468.057"). CreationTime *time.Time `type:"timestamp"` - // Unique identifier for a player. This ID is used to enforce a resource protection + // A unique identifier for a player. This ID is used to enforce a resource protection // policy (if one exists), that limits the number of game sessions a player // can create. CreatorId *string `min:"1" type:"string"` @@ -14448,9 +15278,23 @@ type GameSession struct { // Number of players currently in the game session. CurrentPlayerSessionCount *int64 `type:"integer"` + // DNS identifier assigned to the instance that is running the game session. + // Values have the following format: + // + // * TLS-enabled fleets: ..amazongamelift.com. + // + // * Non-TLS-enabled fleets: ec2-.compute.amazonaws.com. + // (See Amazon EC2 Instance IP Addressing (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses).) + // + // When connecting to a game session that is running on a TLS-enabled fleet, + // you must use the DNS name, not the IP address. DnsName *string `type:"string"` - // Unique identifier for a fleet that the game session is running on. + // The Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // associated with the GameLift fleet that this game session is running on. + FleetArn *string `min:"1" type:"string"` + + // A unique identifier for a fleet that the game session is running on. FleetId *string `type:"string"` // Set of custom properties for a game session, formatted as key:value pairs. @@ -14464,13 +15308,14 @@ type GameSession struct { // a request to start a new game session (see Start a Game Session (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). GameSessionData *string `min:"1" type:"string"` - // Unique identifier for the game session. A game session ARN has the following + // A unique identifier for the game session. A game session ARN has the following // format: arn:aws:gamelift:::gamesession//. GameSessionId *string `min:"1" type:"string"` - // IP address of the game session. To connect to a Amazon GameLift game server, - // an app needs both the IP address and port number. + // IP address of the instance that is running the game session. When connecting + // to a Amazon GameLift game server, a client needs to reference an IP address + // (or DNS name) and port number. IpAddress *string `type:"string"` // Information about the matchmaking process that was used to create the game @@ -14482,12 +15327,12 @@ type GameSession struct { // whenever new players are added during a successful backfill (see StartMatchBackfill). MatchmakerData *string `min:"1" type:"string"` - // Maximum number of players that can be connected simultaneously to the game - // session. + // The maximum number of players that can be connected simultaneously to the + // game session. MaximumPlayerSessionCount *int64 `type:"integer"` - // Descriptive label that is associated with a game session. Session names do - // not need to be unique. + // A descriptive label that is associated with a game session. Session names + // do not need to be unique. Name *string `min:"1" type:"string"` // Indicates whether or not the game session is accepting new players. @@ -14545,6 +15390,12 @@ func (s *GameSession) SetDnsName(v string) *GameSession { return s } +// SetFleetArn sets the FleetArn field's value. +func (s *GameSession) SetFleetArn(v string) *GameSession { + s.FleetArn = &v + return s +} + // SetFleetId sets the FleetId field's value. func (s *GameSession) SetFleetId(v string) *GameSession { s.FleetId = &v @@ -14632,17 +15483,28 @@ func (s *GameSession) SetTerminationTime(v time.Time) *GameSession { type GameSessionConnectionInfo struct { _ struct{} `type:"structure"` + // DNS identifier assigned to the instance that is running the game session. + // Values have the following format: + // + // * TLS-enabled fleets: ..amazongamelift.com. + // + // * Non-TLS-enabled fleets: ec2-.compute.amazonaws.com. + // (See Amazon EC2 Instance IP Addressing (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses).) + // + // When connecting to a game session that is running on a TLS-enabled fleet, + // you must use the DNS name, not the IP address. DnsName *string `type:"string"` - // Amazon Resource Name (ARN (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) + // Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) // that is assigned to a game session and uniquely identifies it. GameSessionArn *string `min:"1" type:"string"` - // IP address of the game session. To connect to a Amazon GameLift game server, - // an app needs both the IP address and port number. + // IP address of the instance that is running the game session. When connecting + // to a Amazon GameLift game server, a client needs to reference an IP address + // (or DNS name) and port number. IpAddress *string `type:"string"` - // Collection of player session IDs, one for each player ID that was included + // A collection of player session IDs, one for each player ID that was included // in the original matchmaking request. MatchedPlayerSessions []*MatchedPlayerSession `type:"list"` @@ -14730,6 +15592,63 @@ func (s *GameSessionDetail) SetProtectionPolicy(v string) *GameSessionDetail { return s } +// The game instance is currently full and cannot allow the requested player(s) +// to join. Clients can retry such requests immediately or after a waiting period. +type GameSessionFullException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s GameSessionFullException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GameSessionFullException) GoString() string { + return s.String() +} + +func newErrorGameSessionFullException(v protocol.ResponseMetadata) error { + return &GameSessionFullException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s GameSessionFullException) Code() string { + return "GameSessionFullException" +} + +// Message returns the exception's message. +func (s GameSessionFullException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s GameSessionFullException) OrigErr() error { + return nil +} + +func (s GameSessionFullException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s GameSessionFullException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s GameSessionFullException) RequestID() string { + return s.respMetadata.RequestID +} + // Object that describes a StartGameSessionPlacement request. This object includes // the full details of the original request plus the current status and start/end // time stamps. @@ -14744,6 +15663,16 @@ func (s *GameSessionDetail) SetProtectionPolicy(v string) *GameSessionDetail { type GameSessionPlacement struct { _ struct{} `type:"structure"` + // DNS identifier assigned to the instance that is running the game session. + // Values have the following format: + // + // * TLS-enabled fleets: ..amazongamelift.com. + // + // * Non-TLS-enabled fleets: ec2-.compute.amazonaws.com. + // (See Amazon EC2 Instance IP Addressing (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses).) + // + // When connecting to a game session that is running on a TLS-enabled fleet, + // you must use the DNS name, not the IP address. DnsName *string `type:"string"` // Time stamp indicating when this request was completed, canceled, or timed @@ -14757,7 +15686,7 @@ type GameSessionPlacement struct { // Identifier for the game session created by this placement request. This value // is set once the new game session is placed (placement status is FULFILLED). - // This identifier is unique across all regions. You can use this value as a + // This identifier is unique across all Regions. You can use this value as a // GameSessionId value as needed. GameSessionArn *string `min:"1" type:"string"` @@ -14766,26 +15695,27 @@ type GameSessionPlacement struct { // a request to start a new game session (see Start a Game Session (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). GameSessionData *string `min:"1" type:"string"` - // Unique identifier for the game session. This value is set once the new game - // session is placed (placement status is FULFILLED). + // A unique identifier for the game session. This value is set once the new + // game session is placed (placement status is FULFILLED). GameSessionId *string `min:"1" type:"string"` - // Descriptive label that is associated with a game session. Session names do - // not need to be unique. + // A descriptive label that is associated with a game session. Session names + // do not need to be unique. GameSessionName *string `min:"1" type:"string"` - // Descriptive label that is associated with game session queue. Queue names - // must be unique within each region. + // A descriptive label that is associated with game session queue. Queue names + // must be unique within each Region. GameSessionQueueName *string `min:"1" type:"string"` - // Name of the region where the game session created by this placement request + // Name of the Region where the game session created by this placement request // is running. This value is set once the new game session is placed (placement // status is FULFILLED). GameSessionRegion *string `min:"1" type:"string"` - // IP address of the game session. To connect to a Amazon GameLift game server, - // an app needs both the IP address and port number. This value is set once - // the new game session is placed (placement status is FULFILLED). + // IP address of the instance that is running the game session. When connecting + // to a Amazon GameLift game server, a client needs to reference an IP address + // (or DNS name) and port number. This value is set once the new game session + // is placed (placement status is FULFILLED). IpAddress *string `type:"string"` // Information on the matchmaking process for this game. Data is in JSON syntax, @@ -14795,23 +15725,23 @@ type GameSessionPlacement struct { // data, see Match Data (https://docs.aws.amazon.com/gamelift/latest/developerguide/match-server.html#match-server-data). MatchmakerData *string `min:"1" type:"string"` - // Maximum number of players that can be connected simultaneously to the game - // session. + // The maximum number of players that can be connected simultaneously to the + // game session. MaximumPlayerSessionCount *int64 `type:"integer"` - // Collection of information on player sessions created in response to the game - // session placement request. These player sessions are created only once a - // new game session is successfully placed (placement status is FULFILLED). + // A collection of information on player sessions created in response to the + // game session placement request. These player sessions are created only once + // a new game session is successfully placed (placement status is FULFILLED). // This information includes the player ID (as provided in the placement request) // and the corresponding player session ID. Retrieve full player sessions by // calling DescribePlayerSessions with the player session ID. PlacedPlayerSessions []*PlacedPlayerSession `type:"list"` - // Unique identifier for a game session placement. + // A unique identifier for a game session placement. PlacementId *string `min:"1" type:"string"` // Set of values, expressed in milliseconds, indicating the amount of latency - // that a player experiences when connected to AWS regions. + // that a player experiences when connected to AWS Regions. PlayerLatencies []*PlayerLatency `type:"list"` // Port number for the game session. To connect to a Amazon GameLift game server, @@ -14836,6 +15766,10 @@ type GameSessionPlacement struct { // // * TIMED_OUT -- A new game session was not successfully created before // the time limit expired. You can resubmit the placement request as needed. + // + // * FAILED -- GameLift is not able to complete the process of placing the + // game session. Common reasons are the game session terminated before the + // placement process was completed, or an unexpected internal error. Status *string `type:"string" enum:"GameSessionPlacementState"` } @@ -14984,31 +15918,32 @@ func (s *GameSessionPlacement) SetStatus(v string) *GameSessionPlacement { type GameSessionQueue struct { _ struct{} `type:"structure"` - // List of fleets that can be used to fulfill game session placement requests + // A list of fleets that can be used to fulfill game session placement requests // in the queue. Fleets are identified by either a fleet ARN or a fleet alias // ARN. Destinations are listed in default preference order. Destinations []*GameSessionQueueDestination `type:"list"` - // Amazon Resource Name (ARN (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) - // that is assigned to a game session queue and uniquely identifies it. Format - // is arn:aws:gamelift:::gamesessionqueue/. + // Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // that is assigned to a GameLift game session queue resource and uniquely identifies + // it. ARNs are unique across all Regions. In a GameLift game session queue + // ARN, the resource ID matches the Name value. GameSessionQueueArn *string `min:"1" type:"string"` - // Descriptive label that is associated with game session queue. Queue names - // must be unique within each region. + // A descriptive label that is associated with game session queue. Queue names + // must be unique within each Region. Name *string `min:"1" type:"string"` - // Collection of latency policies to apply when processing game sessions placement + // A collection of latency policies to apply when processing game sessions placement // requests with player latency information. Multiple policies are evaluated // in order of the maximum latency value, starting with the lowest latency values. - // With just one policy, it is enforced at the start of the game session placement - // for the duration period. With multiple policies, each policy is enforced - // consecutively for its duration period. For example, a queue might enforce - // a 60-second policy followed by a 120-second policy, and then no policy for - // the remainder of the placement. + // With just one policy, the policy is enforced at the start of the game session + // placement for the duration period. With multiple policies, each policy is + // enforced consecutively for its duration period. For example, a queue might + // enforce a 60-second policy followed by a 120-second policy, and then no policy + // for the remainder of the placement. PlayerLatencyPolicies []*PlayerLatencyPolicy `type:"list"` - // Maximum time, in seconds, that a new game session placement request remains + // The maximum time, in seconds, that a new game session placement request remains // in the queue. When a request exceeds this time, the game session placement // changes to a TIMED_OUT status. TimeoutInSeconds *int64 `type:"integer"` @@ -15056,7 +15991,7 @@ func (s *GameSessionQueue) SetTimeoutInSeconds(v int64) *GameSessionQueue { // Fleet designated in a game session queue. Requests for new game sessions // in the queue are fulfilled by starting a new game session on any destination -// configured for a queue. +// that is configured for a queue. // // * CreateGameSessionQueue // @@ -15068,9 +16003,9 @@ func (s *GameSessionQueue) SetTimeoutInSeconds(v int64) *GameSessionQueue { type GameSessionQueueDestination struct { _ struct{} `type:"structure"` - // Amazon Resource Name (ARN) assigned to fleet or fleet alias. ARNs, which - // include a fleet ID or alias ID and a region name, provide a unique identifier - // across all regions. + // The Amazon Resource Name (ARN) that is assigned to fleet or fleet alias. + // ARNs, which include a fleet ID or alias ID and a Region name, provide a unique + // identifier across all Regions. DestinationArn *string `min:"1" type:"string"` } @@ -15107,7 +16042,7 @@ func (s *GameSessionQueueDestination) SetDestinationArn(v string) *GameSessionQu type GetGameSessionLogUrlInput struct { _ struct{} `type:"structure"` - // Unique identifier for the game session to get logs for. + // A unique identifier for the game session to get logs for. // // GameSessionId is a required field GameSessionId *string `min:"1" type:"string" required:"true"` @@ -15176,15 +16111,15 @@ func (s *GetGameSessionLogUrlOutput) SetPreSignedUrl(v string) *GetGameSessionLo type GetInstanceAccessInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet that contains the instance you want access - // to. The fleet can be in any of the following statuses: ACTIVATING, ACTIVE, - // or ERROR. Fleets with an ERROR status may be accessible for a short time - // before they are deleted. + // A unique identifier for a fleet that contains the instance you want access + // to. You can use either the fleet ID or ARN value. The fleet can be in any + // of the following statuses: ACTIVATING, ACTIVE, or ERROR. Fleets with an ERROR + // status may be accessible for a short time before they are deleted. // // FleetId is a required field FleetId *string `type:"string" required:"true"` - // Unique identifier for an instance you want to get access to. You can access + // A unique identifier for an instance you want to get access to. You can access // an instance in any status. // // InstanceId is a required field @@ -15233,8 +16168,8 @@ func (s *GetInstanceAccessInput) SetInstanceId(v string) *GetInstanceAccessInput type GetInstanceAccessOutput struct { _ struct{} `type:"structure"` - // Object that contains connection information for a fleet instance, including - // IP address and access credentials. + // The connection information for a fleet instance, including IP address and + // access credentials. InstanceAccess *InstanceAccess `type:"structure"` } @@ -15254,6 +16189,63 @@ func (s *GetInstanceAccessOutput) SetInstanceAccess(v *InstanceAccess) *GetInsta return s } +// A game session with this custom ID string already exists in this fleet. Resolve +// this conflict before retrying this request. +type IdempotentParameterMismatchException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s IdempotentParameterMismatchException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IdempotentParameterMismatchException) GoString() string { + return s.String() +} + +func newErrorIdempotentParameterMismatchException(v protocol.ResponseMetadata) error { + return &IdempotentParameterMismatchException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IdempotentParameterMismatchException) Code() string { + return "IdempotentParameterMismatchException" +} + +// Message returns the exception's message. +func (s IdempotentParameterMismatchException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IdempotentParameterMismatchException) OrigErr() error { + return nil +} + +func (s IdempotentParameterMismatchException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IdempotentParameterMismatchException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IdempotentParameterMismatchException) RequestID() string { + return s.respMetadata.RequestID +} + // Properties that describe an instance of a virtual computing resource that // hosts one or more game servers. A fleet may contain zero or more instances. type Instance struct { @@ -15263,15 +16255,25 @@ type Instance struct { // expressed in Unix time as milliseconds (for example "1469498468.057"). CreationTime *time.Time `type:"timestamp"` + // DNS identifier assigned to the instance that is running the game session. + // Values have the following format: + // + // * TLS-enabled fleets: ..amazongamelift.com. + // + // * Non-TLS-enabled fleets: ec2-.compute.amazonaws.com. + // (See Amazon EC2 Instance IP Addressing (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses).) + // + // When connecting to a game session that is running on a TLS-enabled fleet, + // you must use the DNS name, not the IP address. DnsName *string `type:"string"` - // Unique identifier for a fleet that the instance is in. + // A unique identifier for a fleet that the instance is in. FleetId *string `type:"string"` - // Unique identifier for an instance. + // A unique identifier for an instance. InstanceId *string `type:"string"` - // IP address assigned to the instance. + // IP address that is assigned to the instance. IpAddress *string `type:"string"` // Operating system that is running on this instance. @@ -15362,13 +16364,13 @@ type InstanceAccess struct { // Credentials required to access the instance. Credentials *InstanceCredentials `type:"structure" sensitive:"true"` - // Unique identifier for a fleet containing the instance being accessed. + // A unique identifier for a fleet containing the instance being accessed. FleetId *string `type:"string"` - // Unique identifier for an instance being accessed. + // A unique identifier for an instance being accessed. InstanceId *string `type:"string"` - // IP address assigned to the instance. + // IP address that is assigned to the instance. IpAddress *string `type:"string"` // Operating system that is running on the instance. @@ -15452,34 +16454,265 @@ func (s *InstanceCredentials) SetUserName(v string) *InstanceCredentials { return s } +// The service encountered an unrecoverable internal failure while processing +// the request. Clients can retry such requests immediately or after a waiting +// period. +type InternalServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s InternalServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServiceException) GoString() string { + return s.String() +} + +func newErrorInternalServiceException(v protocol.ResponseMetadata) error { + return &InternalServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServiceException) Code() string { + return "InternalServiceException" +} + +// Message returns the exception's message. +func (s InternalServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServiceException) OrigErr() error { + return nil +} + +func (s InternalServiceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServiceException) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested operation would cause a conflict with the current state of +// a resource associated with the request and/or the fleet. Resolve the conflict +// before retrying. +type InvalidFleetStatusException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s InvalidFleetStatusException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidFleetStatusException) GoString() string { + return s.String() +} + +func newErrorInvalidFleetStatusException(v protocol.ResponseMetadata) error { + return &InvalidFleetStatusException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidFleetStatusException) Code() string { + return "InvalidFleetStatusException" +} + +// Message returns the exception's message. +func (s InvalidFleetStatusException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidFleetStatusException) OrigErr() error { + return nil +} + +func (s InvalidFleetStatusException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidFleetStatusException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidFleetStatusException) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested operation would cause a conflict with the current state of +// a resource associated with the request and/or the game instance. Resolve +// the conflict before retrying. +type InvalidGameSessionStatusException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s InvalidGameSessionStatusException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidGameSessionStatusException) GoString() string { + return s.String() +} + +func newErrorInvalidGameSessionStatusException(v protocol.ResponseMetadata) error { + return &InvalidGameSessionStatusException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidGameSessionStatusException) Code() string { + return "InvalidGameSessionStatusException" +} + +// Message returns the exception's message. +func (s InvalidGameSessionStatusException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidGameSessionStatusException) OrigErr() error { + return nil +} + +func (s InvalidGameSessionStatusException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidGameSessionStatusException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidGameSessionStatusException) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more parameter values in the request are invalid. Correct the invalid +// parameter values before retrying. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // A range of IP addresses and port settings that allow inbound traffic to connect -// to server processes on an Amazon GameLift. New game sessions that are started -// on the fleet are assigned an IP address/port number combination, which must -// fall into the fleet's allowed ranges. For fleets created with a custom game -// server, the ranges reflect the server's game session assignments. For Realtime -// Servers fleets, Amazon GameLift automatically opens two port ranges, one -// for TCP messaging and one for UDP for use by the Realtime servers. +// to server processes on an Amazon GameLift hosting resource. New game sessions +// that are started on the fleet are assigned an IP address/port number combination, +// which must fall into the fleet's allowed ranges. For fleets created with +// a custom game server, the ranges reflect the server's game session assignments. +// For Realtime Servers fleets, Amazon GameLift automatically opens two port +// ranges, one for TCP messaging and one for UDP for use by the Realtime servers. type IpPermission struct { _ struct{} `type:"structure"` - // Starting value for a range of allowed port numbers. + // A starting value for a range of allowed port numbers. // // FromPort is a required field FromPort *int64 `min:"1" type:"integer" required:"true"` - // Range of allowed IP addresses. This value must be expressed in CIDR notation. + // A range of allowed IP addresses. This value must be expressed in CIDR notation. // Example: "000.000.000.000/[subnet mask]" or optionally the shortened version // "0.0.0.0/[subnet mask]". // // IpRange is a required field IpRange *string `type:"string" required:"true"` - // Network communication protocol used by the fleet. + // The network communication protocol used by the fleet. // // Protocol is a required field Protocol *string `type:"string" required:"true" enum:"IpProtocol"` - // Ending value for a range of allowed port numbers. Port numbers are end-inclusive. + // An ending value for a range of allowed port numbers. Port numbers are end-inclusive. // This value must be higher than FromPort. // // ToPort is a required field @@ -15548,26 +16781,83 @@ func (s *IpPermission) SetToPort(v int64) *IpPermission { return s } +// The requested operation would cause the resource to exceed the allowed service +// limit. Resolve the issue before retrying. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents the input for a request action. type ListAliasesInput struct { _ struct{} `type:"structure"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. Limit *int64 `min:"1" type:"integer"` - // Descriptive label that is associated with an alias. Alias names do not need - // to be unique. + // A descriptive label that is associated with an alias. Alias names do not + // need to be unique. Name *string `min:"1" type:"string"` - // Token that indicates the start of the next sequential page of results. Use - // the token that is returned with a previous call to this action. To start + // A token that indicates the start of the next sequential page of results. + // Use the token that is returned with a previous call to this action. To start // at the beginning of the result set, do not specify a value. NextToken *string `min:"1" type:"string"` - // Type of routing to filter results on. Use this parameter to retrieve only - // aliases of a certain type. To retrieve all aliases, leave this parameter - // empty. + // The routing type to filter results on. Use this parameter to retrieve only + // aliases with a certain routing type. To retrieve all aliases, leave this + // parameter empty. // // Possible routing types include the following: // @@ -15637,10 +16927,10 @@ func (s *ListAliasesInput) SetRoutingStrategyType(v string) *ListAliasesInput { type ListAliasesOutput struct { _ struct{} `type:"structure"` - // Collection of alias records that match the list request. + // A collection of alias resources that match the request parameters. Aliases []*Alias `type:"list"` - // Token that indicates where to resume retrieving results on the next call + // A token that indicates where to resume retrieving results on the next call // to this action. If no token is returned, these results represent the end // of the list. NextToken *string `min:"1" type:"string"` @@ -15672,8 +16962,8 @@ func (s *ListAliasesOutput) SetNextToken(v string) *ListAliasesOutput { type ListBuildsInput struct { _ struct{} `type:"structure"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. Limit *int64 `min:"1" type:"integer"` // Token that indicates the start of the next sequential page of results. Use @@ -15747,7 +17037,7 @@ func (s *ListBuildsInput) SetStatus(v string) *ListBuildsInput { type ListBuildsOutput struct { _ struct{} `type:"structure"` - // Collection of build records that match the request. + // A collection of build records that match the request. Builds []*Build `type:"list"` // Token that indicates where to resume retrieving results on the next call @@ -15782,13 +17072,13 @@ func (s *ListBuildsOutput) SetNextToken(v string) *ListBuildsOutput { type ListFleetsInput struct { _ struct{} `type:"structure"` - // Unique identifier for a build to return fleets for. Use this parameter to - // return only fleets using the specified build. To retrieve all fleets, leave - // this parameter empty. + // A unique identifier for a build to return fleets for. Use this parameter + // to return only fleets using the specified build. Use either the build ID + // or ARN value.To retrieve all fleets, leave this parameter empty. BuildId *string `type:"string"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. Limit *int64 `min:"1" type:"integer"` // Token that indicates the start of the next sequential page of results. Use @@ -15796,9 +17086,9 @@ type ListFleetsInput struct { // at the beginning of the result set, do not specify a value. NextToken *string `min:"1" type:"string"` - // Unique identifier for a Realtime script to return fleets for. Use this parameter - // to return only fleets using the specified script. To retrieve all fleets, - // leave this parameter empty. + // A unique identifier for a Realtime script to return fleets for. Use this + // parameter to return only fleets using the specified script. Use either the + // script ID or ARN value.To retrieve all fleets, leave this parameter empty. ScriptId *string `type:"string"` } @@ -15892,12 +17182,12 @@ func (s *ListFleetsOutput) SetNextToken(v string) *ListFleetsOutput { type ListScriptsInput struct { _ struct{} `type:"structure"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. Limit *int64 `min:"1" type:"integer"` - // Token that indicates the start of the next sequential page of results. Use - // the token that is returned with a previous call to this action. To start + // A token that indicates the start of the next sequential page of results. + // Use the token that is returned with a previous call to this action. To start // at the beginning of the result set, do not specify a value. NextToken *string `min:"1" type:"string"` } @@ -15943,12 +17233,12 @@ func (s *ListScriptsInput) SetNextToken(v string) *ListScriptsInput { type ListScriptsOutput struct { _ struct{} `type:"structure"` - // Token that indicates where to resume retrieving results on the next call + // A token that indicates where to resume retrieving results on the next call // to this action. If no token is returned, these results represent the end // of the list. NextToken *string `min:"1" type:"string"` - // Set of properties describing the requested script. + // A set of properties describing the requested script. Scripts []*Script `type:"list"` } @@ -15974,6 +17264,74 @@ func (s *ListScriptsOutput) SetScripts(v []*Script) *ListScriptsOutput { return s } +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) + // that is assigned to and uniquely identifies the GameLift resource that you + // want to retrieve tags for. GameLift resource ARNs are included in the data + // object for the resource, which can be retrieved by calling a List or Describe + // action for the resource type. + // + // ResourceARN is a required field + ResourceARN *string `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 +} + +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // The collection of tags that have been assigned to the specified resource. + 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() +} + +// SetTags sets the Tags field's value. +func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { + s.Tags = v + return s +} + // Represents a new player session that is created as a result of a successful // FlexMatch match. A successful match automatically creates new player sessions // for every player ID in the original matchmaking request. @@ -15983,10 +17341,10 @@ func (s *ListScriptsOutput) SetScripts(v []*Script) *ListScriptsOutput { type MatchedPlayerSession struct { _ struct{} `type:"structure"` - // Unique identifier for a player + // A unique identifier for a player PlayerId *string `min:"1" type:"string"` - // Unique identifier for a player session + // A unique identifier for a player session PlayerSessionId *string `type:"string"` } @@ -16017,74 +17375,85 @@ func (s *MatchedPlayerSession) SetPlayerSessionId(v string) *MatchedPlayerSessio type MatchmakingConfiguration struct { _ struct{} `type:"structure"` - // Flag that determines whether a match that was created with this configuration + // A flag that indicates whether a match that was created with this configuration // must be accepted by the matched players. To require acceptance, set to TRUE. AcceptanceRequired *bool `type:"boolean"` - // Length of time (in seconds) to wait for players to accept a proposed match. - // If any player rejects the match or fails to accept before the timeout, the - // ticket continues to look for an acceptable match. + // The length of time (in seconds) to wait for players to accept a proposed + // match. If any player rejects the match or fails to accept before the timeout, + // the ticket continues to look for an acceptable match. AcceptanceTimeoutSeconds *int64 `min:"1" type:"integer"` - // Number of player slots in a match to keep open for future players. For example, - // if the configuration's rule set specifies a match for a single 12-person - // team, and the additional player count is set to 2, only 10 players are selected - // for the match. + // The number of player slots in a match to keep open for future players. For + // example, assume that the configuration's rule set specifies a match for a + // single 12-person team. If the additional player count is set to 2, only 10 + // players are initially selected for the match. AdditionalPlayerCount *int64 `type:"integer"` - // Method used to backfill game sessions created with this matchmaking configuration. + // The method used to backfill game sessions created with this matchmaking configuration. // MANUAL indicates that the game makes backfill requests or does not use the // match backfill feature. AUTOMATIC indicates that GameLift creates StartMatchBackfill // requests whenever a game session has one or more open slots. Learn more about // manual and automatic backfill in Backfill Existing Games with FlexMatch (https://docs.aws.amazon.com/gamelift/latest/developerguide/match-backfill.html). BackfillMode *string `type:"string" enum:"BackfillMode"` - // Time stamp indicating when this data object was created. Format is a number - // expressed in Unix time as milliseconds (for example "1469498468.057"). + // Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // that is assigned to a GameLift matchmaking configuration resource and uniquely + // identifies it. ARNs are unique across all Regions. In a GameLift configuration + // ARN, the resource ID matches the Name value. + ConfigurationArn *string `type:"string"` + + // The time stamp indicating when this data object was created. The format is + // a number expressed in Unix time as milliseconds (for example "1469498468.057"). CreationTime *time.Time `type:"timestamp"` // Information to attach to all events related to the matchmaking configuration. CustomEventData *string `type:"string"` - // Descriptive label that is associated with matchmaking configuration. + // A descriptive label that is associated with matchmaking configuration. Description *string `min:"1" type:"string"` - // Set of custom properties for a game session, formatted as key:value pairs. + // A set of custom properties for a game session, formatted as key-value pairs. // These properties are passed to a game server process in the GameSession object // with a request to start a new game session (see Start a Game Session (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). // This information is added to the new GameSession object that is created for // a successful match. GameProperties []*GameProperty `type:"list"` - // Set of custom game session properties, formatted as a single string value. + // A set of custom game session properties, formatted as a single string value. // This data is passed to a game server process in the GameSession object with // a request to start a new game session (see Start a Game Session (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). // This information is added to the new GameSession object that is created for // a successful match. GameSessionData *string `min:"1" type:"string"` - // Amazon Resource Name (ARN (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) - // that is assigned to a game session queue and uniquely identifies it. Format - // is arn:aws:gamelift:::gamesessionqueue/. - // These queues are used when placing game sessions for matches that are created - // with this matchmaking configuration. Queues can be located in any region. + // Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // that is assigned to a GameLift game session queue resource and uniquely identifies + // it. ARNs are unique across all Regions. GameLift uses the listed queues when + // placing game sessions for matches that are created with this matchmaking + // configuration. Queues can be located in any Region. GameSessionQueueArns []*string `type:"list"` - // Unique identifier for a matchmaking configuration. This name is used to identify - // the configuration associated with a matchmaking request or ticket. + // A unique identifier for a matchmaking configuration. This name is used to + // identify the configuration associated with a matchmaking request or ticket. Name *string `type:"string"` - // SNS topic ARN that is set up to receive matchmaking notifications. + // An SNS topic ARN that is set up to receive matchmaking notifications. NotificationTarget *string `type:"string"` - // Maximum duration, in seconds, that a matchmaking ticket can remain in process - // before timing out. Requests that fail due to timing out can be resubmitted + // The maximum duration, in seconds, that a matchmaking ticket can remain in + // process before timing out. Requests that fail due to timing out can be resubmitted // as needed. RequestTimeoutSeconds *int64 `min:"1" type:"integer"` - // Unique identifier for a matchmaking rule set to use with this configuration. + // The Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // associated with the GameLift matchmaking rule set resource that this configuration + // uses. + RuleSetArn *string `type:"string"` + + // A unique identifier for a matchmaking rule set to use with this configuration. // A matchmaking configuration can only use rule sets that are defined in the - // same region. + // same Region. RuleSetName *string `type:"string"` } @@ -16122,6 +17491,12 @@ func (s *MatchmakingConfiguration) SetBackfillMode(v string) *MatchmakingConfigu return s } +// SetConfigurationArn sets the ConfigurationArn field's value. +func (s *MatchmakingConfiguration) SetConfigurationArn(v string) *MatchmakingConfiguration { + s.ConfigurationArn = &v + return s +} + // SetCreationTime sets the CreationTime field's value. func (s *MatchmakingConfiguration) SetCreationTime(v time.Time) *MatchmakingConfiguration { s.CreationTime = &v @@ -16176,6 +17551,12 @@ func (s *MatchmakingConfiguration) SetRequestTimeoutSeconds(v int64) *Matchmakin return s } +// SetRuleSetArn sets the RuleSetArn field's value. +func (s *MatchmakingConfiguration) SetRuleSetArn(v string) *MatchmakingConfiguration { + s.RuleSetArn = &v + return s +} + // SetRuleSetName sets the RuleSetName field's value. func (s *MatchmakingConfiguration) SetRuleSetName(v string) *MatchmakingConfiguration { s.RuleSetName = &v @@ -16218,17 +17599,23 @@ func (s *MatchmakingConfiguration) SetRuleSetName(v string) *MatchmakingConfigur type MatchmakingRuleSet struct { _ struct{} `type:"structure"` - // Time stamp indicating when this data object was created. Format is a number - // expressed in Unix time as milliseconds (for example "1469498468.057"). + // The time stamp indicating when this data object was created. The format is + // a number expressed in Unix time as milliseconds (for example "1469498468.057"). CreationTime *time.Time `type:"timestamp"` - // Collection of matchmaking rules, formatted as a JSON string. Comments are + // Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // that is assigned to a GameLift matchmaking rule set resource and uniquely + // identifies it. ARNs are unique across all Regions. In a GameLift rule set + // ARN, the resource ID matches the RuleSetName value. + RuleSetArn *string `type:"string"` + + // A collection of matchmaking rules, formatted as a JSON string. Comments are // not allowed in JSON, but most elements support a description field. // // RuleSetBody is a required field RuleSetBody *string `min:"1" type:"string" required:"true"` - // Unique identifier for a matchmaking rule set + // A unique identifier for a matchmaking rule set RuleSetName *string `type:"string"` } @@ -16248,6 +17635,12 @@ func (s *MatchmakingRuleSet) SetCreationTime(v time.Time) *MatchmakingRuleSet { return s } +// SetRuleSetArn sets the RuleSetArn field's value. +func (s *MatchmakingRuleSet) SetRuleSetArn(v string) *MatchmakingRuleSet { + s.RuleSetArn = &v + return s +} + // SetRuleSetBody sets the RuleSetBody field's value. func (s *MatchmakingRuleSet) SetRuleSetBody(v string) *MatchmakingRuleSet { s.RuleSetBody = &v @@ -16267,6 +17660,11 @@ func (s *MatchmakingRuleSet) SetRuleSetName(v string) *MatchmakingRuleSet { type MatchmakingTicket struct { _ struct{} `type:"structure"` + // The Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // associated with the GameLift matchmaking configuration resource that is used + // with this ticket. + ConfigurationArn *string `type:"string"` + // Name of the MatchmakingConfiguration that is used with this ticket. Matchmaking // configurations determine how players are grouped into a match and how a new // game session is created for the match. @@ -16336,7 +17734,7 @@ type MatchmakingTicket struct { // to receive player acceptances. StatusReason *string `type:"string"` - // Unique identifier for a matchmaking ticket. + // A unique identifier for a matchmaking ticket. TicketId *string `type:"string"` } @@ -16350,6 +17748,12 @@ func (s MatchmakingTicket) GoString() string { return s.String() } +// SetConfigurationArn sets the ConfigurationArn field's value. +func (s *MatchmakingTicket) SetConfigurationArn(v string) *MatchmakingTicket { + s.ConfigurationArn = &v + return s +} + // SetConfigurationName sets the ConfigurationName field's value. func (s *MatchmakingTicket) SetConfigurationName(v string) *MatchmakingTicket { s.ConfigurationName = &v @@ -16410,6 +17814,63 @@ func (s *MatchmakingTicket) SetTicketId(v string) *MatchmakingTicket { return s } +// A service resource associated with the request could not be found. Clients +// should not retry such requests. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Information about a player session that was created as part of a StartGameSessionPlacement // request. This object contains only the player ID and player session ID. To // retrieve full details on a player session, call DescribePlayerSessions with @@ -16426,10 +17887,10 @@ func (s *MatchmakingTicket) SetTicketId(v string) *MatchmakingTicket { type PlacedPlayerSession struct { _ struct{} `type:"structure"` - // Unique identifier for a player that is associated with this player session. + // A unique identifier for a player that is associated with this player session. PlayerId *string `min:"1" type:"string"` - // Unique identifier for a player session. + // A unique identifier for a player session. PlayerSessionId *string `type:"string"` } @@ -16462,23 +17923,23 @@ type Player struct { _ struct{} `type:"structure"` // Set of values, expressed in milliseconds, indicating the amount of latency - // that a player experiences when connected to AWS regions. If this property - // is present, FlexMatch considers placing the match only in regions for which + // that a player experiences when connected to AWS Regions. If this property + // is present, FlexMatch considers placing the match only in Regions for which // latency is reported. // // If a matchmaker has a rule that evaluates player latency, players must report // latency in order to be matched. If no latency is reported in this scenario, - // FlexMatch assumes that no regions are available to the player and the ticket + // FlexMatch assumes that no Regions are available to the player and the ticket // is not matchable. LatencyInMs map[string]*int64 `type:"map"` - // Collection of key:value pairs containing player information for use in matchmaking. - // Player attribute keys must match the playerAttributes used in a matchmaking - // rule set. Example: "PlayerAttributes": {"skill": {"N": "23"}, "gameMode": - // {"S": "deathmatch"}}. + // A collection of key:value pairs containing player information for use in + // matchmaking. Player attribute keys must match the playerAttributes used in + // a matchmaking rule set. Example: "PlayerAttributes": {"skill": {"N": "23"}, + // "gameMode": {"S": "deathmatch"}}. PlayerAttributes map[string]*AttributeValue `type:"map"` - // Unique identifier for a player + // A unique identifier for a player PlayerId *string `min:"1" type:"string"` // Name of the team that the player is assigned to in a match. Team names are @@ -16549,20 +18010,20 @@ func (s *Player) SetTeam(v string) *Player { // Regional latency information for a player, used when requesting a new game // session with StartGameSessionPlacement. This value indicates the amount of // time lag that exists when the player is connected to a fleet in the specified -// region. The relative difference between a player's latency values for multiple -// regions are used to determine which fleets are best suited to place a new +// Region. The relative difference between a player's latency values for multiple +// Regions are used to determine which fleets are best suited to place a new // game session for the player. type PlayerLatency struct { _ struct{} `type:"structure"` // Amount of time that represents the time lag experienced by the player when - // connected to the specified region. + // connected to the specified Region. LatencyInMilliseconds *float64 `type:"float"` - // Unique identifier for a player associated with the latency data. + // A unique identifier for a player associated with the latency data. PlayerId *string `min:"1" type:"string"` - // Name of the region that is associated with the latency value. + // Name of the Region that is associated with the latency value. RegionIdentifier *string `min:"1" type:"string"` } @@ -16612,9 +18073,9 @@ func (s *PlayerLatency) SetRegionIdentifier(v string) *PlayerLatency { // Queue setting that determines the highest latency allowed for individual // players when placing a game session. When a latency policy is in force, a -// game session cannot be placed at any destination in a region where a player -// is reporting latency higher than the cap. Latency policies are only enforced -// when the placement request contains player latency information. +// game session cannot be placed with any fleet in a Region where a player reports +// latency higher than the cap. Latency policies are only enforced when the +// placement request contains player latency information. // // * CreateGameSessionQueue // @@ -16685,27 +18146,44 @@ type PlayerSession struct { // expressed in Unix time as milliseconds (for example "1469498468.057"). CreationTime *time.Time `type:"timestamp"` + // DNS identifier assigned to the instance that is running the game session. + // Values have the following format: + // + // * TLS-enabled fleets: ..amazongamelift.com. + // + // * Non-TLS-enabled fleets: ec2-.compute.amazonaws.com. + // (See Amazon EC2 Instance IP Addressing (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addresses).) + // + // When connecting to a game session that is running on a TLS-enabled fleet, + // you must use the DNS name, not the IP address. DnsName *string `type:"string"` - // Unique identifier for a fleet that the player's game session is running on. + // The Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // associated with the GameLift fleet that the player's game session is running + // on. + FleetArn *string `min:"1" type:"string"` + + // A unique identifier for a fleet that the player's game session is running + // on. FleetId *string `type:"string"` - // Unique identifier for the game session that the player session is connected + // A unique identifier for the game session that the player session is connected // to. GameSessionId *string `min:"1" type:"string"` - // IP address of the game session. To connect to a Amazon GameLift game server, - // an app needs both the IP address and port number. + // IP address of the instance that is running the game session. When connecting + // to a Amazon GameLift game server, a client needs to reference an IP address + // (or DNS name) and port number. IpAddress *string `type:"string"` // Developer-defined information related to a player. Amazon GameLift does not // use this data, so it can be formatted as needed for use in the game. PlayerData *string `min:"1" type:"string"` - // Unique identifier for a player that is associated with this player session. + // A unique identifier for a player that is associated with this player session. PlayerId *string `min:"1" type:"string"` - // Unique identifier for a player session. + // A unique identifier for a player session. PlayerSessionId *string `type:"string"` // Port number for the game session. To connect to a Amazon GameLift server @@ -16755,6 +18233,12 @@ func (s *PlayerSession) SetDnsName(v string) *PlayerSession { return s } +// SetFleetArn sets the FleetArn field's value. +func (s *PlayerSession) SetFleetArn(v string) *PlayerSession { + s.FleetArn = &v + return s +} + // SetFleetId sets the FleetId field's value. func (s *PlayerSession) SetFleetId(v string) *PlayerSession { s.FleetId = &v @@ -16821,8 +18305,9 @@ type PutScalingPolicyInput struct { // before a scaling event is triggered. EvaluationPeriods *int64 `min:"1" type:"integer"` - // Unique identifier for a fleet to apply this policy to. The fleet cannot be - // in any of the following statuses: ERROR or DELETING. + // A unique identifier for a fleet to apply this policy to. You can use either + // the fleet ID or ARN value. The fleet cannot be in any of the following statuses: + // ERROR or DELETING. // // FleetId is a required field FleetId *string `type:"string" required:"true"` @@ -16867,15 +18352,15 @@ type PutScalingPolicyInput struct { // MetricName is a required field MetricName *string `type:"string" required:"true" enum:"MetricName"` - // Descriptive label that is associated with a scaling policy. Policy names + // A descriptive label that is associated with a scaling policy. Policy names // do not need to be unique. A fleet can have only one scaling policy with the // same name. // // Name is a required field Name *string `min:"1" type:"string" required:"true"` - // Type of scaling policy to create. For a target-based policy, set the parameter - // MetricName to 'PercentAvailableGameSessions' and specify a TargetConfiguration. + // The type of scaling policy to create. For a target-based policy, set the + // parameter MetricName to 'PercentAvailableGameSessions' and specify a TargetConfiguration. // For a rule-based policy set the following parameters: MetricName, ComparisonOperator, // Threshold, EvaluationPeriods, ScalingAdjustmentType, and ScalingAdjustment. PolicyType *string `type:"string" enum:"PolicyType"` @@ -16883,7 +18368,7 @@ type PutScalingPolicyInput struct { // Amount of adjustment to make, based on the scaling adjustment type. ScalingAdjustment *int64 `type:"integer"` - // Type of adjustment to make to a fleet's instance count (see FleetCapacity): + // The type of adjustment to make to a fleet's instance count (see FleetCapacity): // // * ChangeInCapacity -- add (or subtract) the scaling adjustment value from // the current instance count. Positive values scale up while negative values @@ -16897,7 +18382,7 @@ type PutScalingPolicyInput struct { // the fleet down by 10%. ScalingAdjustmentType *string `type:"string" enum:"ScalingAdjustmentType"` - // Object that contains settings for a target-based scaling policy. + // The settings for a target-based scaling policy. TargetConfiguration *TargetConfiguration `type:"structure"` // Metric value used to trigger a scaling event. @@ -17008,7 +18493,7 @@ func (s *PutScalingPolicyInput) SetThreshold(v float64) *PutScalingPolicyInput { type PutScalingPolicyOutput struct { _ struct{} `type:"structure"` - // Descriptive label that is associated with a scaling policy. Policy names + // A descriptive label that is associated with a scaling policy. Policy names // do not need to be unique. Name *string `min:"1" type:"string"` } @@ -17033,7 +18518,8 @@ func (s *PutScalingPolicyOutput) SetName(v string) *PutScalingPolicyOutput { type RequestUploadCredentialsInput struct { _ struct{} `type:"structure"` - // Unique identifier for a build to get credentials for. + // A unique identifier for a build to get credentials for. You can use either + // the build ID or ARN value. // // BuildId is a required field BuildId *string `type:"string" required:"true"` @@ -17107,7 +18593,8 @@ func (s *RequestUploadCredentialsOutput) SetUploadCredentials(v *AwsCredentials) type ResolveAliasInput struct { _ struct{} `type:"structure"` - // Unique identifier for the alias you want to resolve. + // The unique identifier of the alias that you want to retrieve a fleet ID for. + // You can use either the alias ID or ARN value. // // AliasId is a required field AliasId *string `type:"string" required:"true"` @@ -17146,7 +18633,11 @@ func (s *ResolveAliasInput) SetAliasId(v string) *ResolveAliasInput { type ResolveAliasOutput struct { _ struct{} `type:"structure"` - // Fleet identifier that is associated with the requested alias. + // The Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // associated with the GameLift fleet resource that this alias points to. + FleetArn *string `min:"1" type:"string"` + + // The fleet identifier that the alias is pointing to. FleetId *string `type:"string"` } @@ -17160,31 +18651,37 @@ func (s ResolveAliasOutput) GoString() string { return s.String() } +// SetFleetArn sets the FleetArn field's value. +func (s *ResolveAliasOutput) SetFleetArn(v string) *ResolveAliasOutput { + s.FleetArn = &v + return s +} + // SetFleetId sets the FleetId field's value. func (s *ResolveAliasOutput) SetFleetId(v string) *ResolveAliasOutput { s.FleetId = &v return s } -// Policy that limits the number of game sessions a player can create on the +// A policy that limits the number of game sessions a player can create on the // same fleet. This optional policy gives game owners control over how players // can consume available game server resources. A resource creation policy makes // the following statement: "An individual player can create a maximum number // of new game sessions within a specified time period". // // The policy is evaluated when a player tries to create a new game session. -// For example, with a policy of 10 new game sessions and a time period of 60 -// minutes, on receiving a CreateGameSession request, Amazon GameLift checks -// that the player (identified by CreatorId) has created fewer than 10 game -// sessions in the past 60 minutes. +// For example: Assume you have a policy of 10 new game sessions and a time +// period of 60 minutes. On receiving a CreateGameSession request, Amazon GameLift +// checks that the player (identified by CreatorId) has created fewer than 10 +// game sessions in the past 60 minutes. type ResourceCreationLimitPolicy struct { _ struct{} `type:"structure"` - // Maximum number of game sessions that an individual can create during the - // policy period. + // The maximum number of game sessions that an individual can create during + // the policy period. NewGameSessionsPerCreator *int64 `type:"integer"` - // Time span used in evaluating the resource creation limit policy. + // The time span used in evaluating the resource creation limit policy. PolicyPeriodInMinutes *int64 `type:"integer"` } @@ -17210,7 +18707,7 @@ func (s *ResourceCreationLimitPolicy) SetPolicyPeriodInMinutes(v int64) *Resourc return s } -// Routing configuration for a fleet alias. +// The routing configuration for a fleet alias. // // * CreateAlias // @@ -17226,20 +18723,21 @@ func (s *ResourceCreationLimitPolicy) SetPolicyPeriodInMinutes(v int64) *Resourc type RoutingStrategy struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet that the alias points to. + // The unique identifier for a fleet that the alias points to. This value is + // the fleet ID, not the fleet ARN. FleetId *string `type:"string"` - // Message text to be used with a terminal routing strategy. + // The message text to be used with a terminal routing strategy. Message *string `type:"string"` - // Type of routing strategy. + // The type of routing strategy for the alias. // // Possible routing types include the following: // - // * SIMPLE -- The alias resolves to one specific fleet. Use this type when + // * SIMPLE - The alias resolves to one specific fleet. Use this type when // routing to active fleets. // - // * TERMINAL -- The alias does not resolve to a fleet but instead can be + // * TERMINAL - The alias does not resolve to a fleet but instead can be // used to display a message to the user. A terminal alias throws a TerminalRoutingStrategyException // with the RoutingStrategy message embedded. Type *string `type:"string" enum:"RoutingStrategyType"` @@ -17277,15 +18775,15 @@ func (s *RoutingStrategy) SetType(v string) *RoutingStrategy { // to run on each instance in a fleet. Server processes run either a custom // game build executable or a Realtime Servers script. Each instance in the // fleet starts the specified server processes and continues to start new processes -// as existing processes end. An instance regularly checks for an updated run-time -// configuration. +// as existing processes end. Each instance regularly checks for an updated +// runtime configuration. // -// The run-time configuration enables the instances in a fleet to run multiple +// The runtime configuration enables the instances in a fleet to run multiple // processes simultaneously. Learn more about Running Multiple Processes on // a Fleet (https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-multiprocess.html). // // A Amazon GameLift instance is limited to 50 processes running simultaneously. -// To calculate the total number of processes in a run-time configuration, add +// To calculate the total number of processes in a runtime configuration, add // the values of the ConcurrentExecutions parameter for each ServerProcess object. // // * CreateFleet @@ -17294,29 +18792,26 @@ func (s *RoutingStrategy) SetType(v string) *RoutingStrategy { // // * DeleteFleet // -// * Describe fleets: DescribeFleetAttributes DescribeFleetCapacity DescribeFleetPortSettings -// DescribeFleetUtilization DescribeRuntimeConfiguration DescribeEC2InstanceLimits -// DescribeFleetEvents +// * DescribeFleetAttributes // -// * Update fleets: UpdateFleetAttributes UpdateFleetCapacity UpdateFleetPortSettings -// UpdateRuntimeConfiguration +// * UpdateFleetAttributes // // * Manage fleet actions: StartFleetActions StopFleetActions type RuntimeConfiguration struct { _ struct{} `type:"structure"` - // Maximum amount of time (in seconds) that a game session can remain in status - // ACTIVATING. If the game session is not active before the timeout, activation - // is terminated and the game session status is changed to TERMINATED. + // The maximum amount of time (in seconds) that a game session can remain in + // status ACTIVATING. If the game session is not active before the timeout, + // activation is terminated and the game session status is changed to TERMINATED. GameSessionActivationTimeoutSeconds *int64 `min:"1" type:"integer"` - // Maximum number of game sessions with status ACTIVATING to allow on an instance - // simultaneously. This setting limits the amount of instance resources that - // can be used for new game activations at any one time. + // The maximum number of game sessions with status ACTIVATING to allow on an + // instance simultaneously. This setting limits the amount of instance resources + // that can be used for new game activations at any one time. MaxConcurrentGameSessionActivations *int64 `min:"1" type:"integer"` - // Collection of server process configurations that describe which server processes - // to run on each instance in a fleet. + // A collection of server process configurations that describe which server + // processes to run on each instance in a fleet. ServerProcesses []*ServerProcess `min:"1" type:"list"` } @@ -17377,25 +18872,25 @@ func (s *RuntimeConfiguration) SetServerProcesses(v []*ServerProcess) *RuntimeCo return s } -// Location in Amazon Simple Storage Service (Amazon S3) where build or script -// files are stored for access by Amazon GameLift. This location is specified -// in CreateBuild, CreateScript, and UpdateScript requests. +// The location in Amazon S3 where build or script files are stored for access +// by Amazon GameLift. This location is specified in CreateBuild, CreateScript, +// and UpdateScript requests. type S3Location struct { _ struct{} `type:"structure"` - // Amazon S3 bucket identifier. This is the name of the S3 bucket. + // An Amazon S3 bucket identifier. This is the name of the S3 bucket. Bucket *string `min:"1" type:"string"` - // Name of the zip file containing the build files or script files. + // The name of the zip file that contains the build files or script files. Key *string `min:"1" type:"string"` - // Version of the file, if object versioning is turned on for the bucket. Amazon - // GameLift uses this information when retrieving files from an S3 bucket that - // you own. Use this parameter to specify a specific version of the file; if - // not set, the latest version of the file is retrieved. + // The version of the file, if object versioning is turned on for the bucket. + // Amazon GameLift uses this information when retrieving files from an S3 bucket + // that you own. Use this parameter to specify a specific version of the file. + // If not set, the latest version of the file is retrieved. ObjectVersion *string `min:"1" type:"string"` - // Amazon Resource Name (ARN (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) + // The Amazon Resource Name (ARN (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) // for an IAM role that allows Amazon GameLift to access the S3 bucket. RoleArn *string `min:"1" type:"string"` } @@ -17480,7 +18975,7 @@ type ScalingPolicy struct { // before a scaling event is triggered. EvaluationPeriods *int64 `min:"1" type:"integer"` - // Unique identifier for a fleet that is associated with this scaling policy. + // A unique identifier for a fleet that is associated with this scaling policy. FleetId *string `type:"string"` // Name of the Amazon GameLift-defined metric that is used to trigger a scaling @@ -17521,12 +19016,12 @@ type ScalingPolicy struct { // in any queue, where the current fleet is the top-priority destination. MetricName *string `type:"string" enum:"MetricName"` - // Descriptive label that is associated with a scaling policy. Policy names + // A descriptive label that is associated with a scaling policy. Policy names // do not need to be unique. Name *string `min:"1" type:"string"` - // Type of scaling policy to create. For a target-based policy, set the parameter - // MetricName to 'PercentAvailableGameSessions' and specify a TargetConfiguration. + // The type of scaling policy to create. For a target-based policy, set the + // parameter MetricName to 'PercentAvailableGameSessions' and specify a TargetConfiguration. // For a rule-based policy set the following parameters: MetricName, ComparisonOperator, // Threshold, EvaluationPeriods, ScalingAdjustmentType, and ScalingAdjustment. PolicyType *string `type:"string" enum:"PolicyType"` @@ -17534,7 +19029,7 @@ type ScalingPolicy struct { // Amount of adjustment to make, based on the scaling adjustment type. ScalingAdjustment *int64 `type:"integer"` - // Type of adjustment to make to a fleet's instance count (see FleetCapacity): + // The type of adjustment to make to a fleet's instance count (see FleetCapacity): // // * ChangeInCapacity -- add (or subtract) the scaling adjustment value from // the current instance count. Positive values scale up while negative values @@ -17570,7 +19065,7 @@ type ScalingPolicy struct { // and recreated. Status *string `type:"string" enum:"ScalingStatusType"` - // Object that contains settings for a target-based scaling policy. + // The settings for a target-based scaling policy. TargetConfiguration *TargetConfiguration `type:"structure"` // Metric value used to trigger a scaling event. @@ -17669,28 +19164,34 @@ func (s *ScalingPolicy) SetThreshold(v float64) *ScalingPolicy { type Script struct { _ struct{} `type:"structure"` - // Time stamp indicating when this data object was created. Format is a number - // expressed in Unix time as milliseconds (for example "1469498468.057"). + // A time stamp indicating when this data object was created. The format is + // a number expressed in Unix time as milliseconds (for example "1469498468.057"). CreationTime *time.Time `type:"timestamp"` - // Descriptive label that is associated with a script. Script names do not need - // to be unique. + // A descriptive label that is associated with a script. Script names do not + // need to be unique. Name *string `min:"1" type:"string"` - // Unique identifier for a Realtime script + // Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // that is assigned to a GameLift script resource and uniquely identifies it. + // ARNs are unique across all Regions. In a GameLift script ARN, the resource + // ID matches the ScriptId value. + ScriptArn *string `type:"string"` + + // A unique identifier for a Realtime script ScriptId *string `type:"string"` - // File size of the uploaded Realtime script, expressed in bytes. When files + // The file size of the uploaded Realtime script, expressed in bytes. When files // are uploaded from an S3 location, this value remains at "0". SizeOnDisk *int64 `min:"1" type:"long"` - // Location in Amazon Simple Storage Service (Amazon S3) where build or script - // files are stored for access by Amazon GameLift. This location is specified - // in CreateBuild, CreateScript, and UpdateScript requests. + // The location in Amazon S3 where build or script files are stored for access + // by Amazon GameLift. This location is specified in CreateBuild, CreateScript, + // and UpdateScript requests. StorageLocation *S3Location `type:"structure"` - // Version that is associated with a build or script. Version strings do not - // need to be unique. + // The version that is associated with a build or script. Version strings do + // not need to be unique. Version *string `min:"1" type:"string"` } @@ -17716,6 +19217,12 @@ func (s *Script) SetName(v string) *Script { return s } +// SetScriptArn sets the ScriptArn field's value. +func (s *Script) SetScriptArn(v string) *Script { + s.ScriptArn = &v + return s +} + // SetScriptId sets the ScriptId field's value. func (s *Script) SetScriptId(v string) *Script { s.ScriptId = &v @@ -17744,9 +19251,9 @@ func (s *Script) SetVersion(v string) *Script { type SearchGameSessionsInput struct { _ struct{} `type:"structure"` - // Unique identifier for an alias associated with the fleet to search for active - // game sessions. Each request must reference either a fleet ID or alias ID, - // but not both. + // A unique identifier for an alias associated with the fleet to search for + // active game sessions. You can use either the alias ID or ARN value. Each + // request must reference either a fleet ID or alias ID, but not both. AliasId *string `type:"string"` // String containing the search criteria for the session search. If no filter @@ -17790,13 +19297,14 @@ type SearchGameSessionsInput struct { // ten players that have an open player slot: "maximumSessions>=10 AND hasAvailablePlayerSessions=true". FilterExpression *string `min:"1" type:"string"` - // Unique identifier for a fleet to search for active game sessions. Each request - // must reference either a fleet ID or alias ID, but not both. + // A unique identifier for a fleet to search for active game sessions. You can + // use either the fleet ID or ARN value. Each request must reference either + // a fleet ID or alias ID, but not both. FleetId *string `type:"string"` - // Maximum number of results to return. Use this parameter with NextToken to - // get results as a set of sequential pages. The maximum number of results returned - // is 20, even if this value is not set or is set higher than 20. + // The maximum number of results to return. Use this parameter with NextToken + // to get results as a set of sequential pages. The maximum number of results + // returned is 20, even if this value is not set or is set higher than 20. Limit *int64 `min:"1" type:"integer"` // Token that indicates the start of the next sequential page of results. Use @@ -17892,7 +19400,7 @@ func (s *SearchGameSessionsInput) SetSortExpression(v string) *SearchGameSession type SearchGameSessionsOutput struct { _ struct{} `type:"structure"` - // Collection of objects containing game session properties for each session + // A collection of objects containing game session properties for each session // matching the request. GameSessions []*GameSession `type:"list"` @@ -17934,15 +19442,15 @@ func (s *SearchGameSessionsOutput) SetNextToken(v string) *SearchGameSessionsOut type ServerProcess struct { _ struct{} `type:"structure"` - // Number of server processes using this configuration to run concurrently on - // an instance. + // The number of server processes that use this configuration to run concurrently + // on an instance. // // ConcurrentExecutions is a required field ConcurrentExecutions *int64 `min:"1" type:"integer" required:"true"` - // Location of the server executable in a custom game build or the name of the - // Realtime script file that contains the Init() function. Game builds and Realtime - // scripts are installed on instances at the root: + // The location of the server executable in a custom game build or the name + // of the Realtime script file that contains the Init() function. Game builds + // and Realtime scripts are installed on instances at the root: // // * Windows (for custom game builds only): C:\game. Example: "C:\game\MyGame\server.exe" // @@ -17951,7 +19459,7 @@ type ServerProcess struct { // LaunchPath is a required field LaunchPath *string `min:"1" type:"string" required:"true"` - // Optional list of parameters to pass to the server executable or Realtime + // An optional list of parameters to pass to the server executable or Realtime // script on launch. Parameters *string `min:"1" type:"string"` } @@ -18017,7 +19525,8 @@ type StartFleetActionsInput struct { // Actions is a required field Actions []*string `min:"1" type:"list" required:"true"` - // Unique identifier for a fleet + // A unique identifier for a fleet to start actions on. You can use either the + // fleet ID or ARN value. // // FleetId is a required field FleetId *string `type:"string" required:"true"` @@ -18095,30 +19604,31 @@ type StartGameSessionPlacementInput struct { // a request to start a new game session (see Start a Game Session (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). GameSessionData *string `min:"1" type:"string"` - // Descriptive label that is associated with a game session. Session names do - // not need to be unique. + // A descriptive label that is associated with a game session. Session names + // do not need to be unique. GameSessionName *string `min:"1" type:"string"` - // Name of the queue to use to place the new game session. + // Name of the queue to use to place the new game session. You can use either + // the qieue name or ARN value. // // GameSessionQueueName is a required field GameSessionQueueName *string `min:"1" type:"string" required:"true"` - // Maximum number of players that can be connected simultaneously to the game - // session. + // The maximum number of players that can be connected simultaneously to the + // game session. // // MaximumPlayerSessionCount is a required field MaximumPlayerSessionCount *int64 `type:"integer" required:"true"` - // Unique identifier to assign to the new game session placement. This value - // is developer-defined. The value must be unique across all regions and cannot + // A unique identifier to assign to the new game session placement. This value + // is developer-defined. The value must be unique across all Regions and cannot // be reused unless you are resubmitting a canceled or timed-out placement request. // // PlacementId is a required field PlacementId *string `min:"1" type:"string" required:"true"` // Set of values, expressed in milliseconds, indicating the amount of latency - // that a player experiences when connected to AWS regions. This information + // that a player experiences when connected to AWS Regions. This information // is used to try to place the new game session where it can offer the best // possible gameplay experience for the players. PlayerLatencies []*PlayerLatency `type:"list"` @@ -18273,18 +19783,16 @@ func (s *StartGameSessionPlacementOutput) SetGameSessionPlacement(v *GameSession type StartMatchBackfillInput struct { _ struct{} `type:"structure"` - // Name of the matchmaker to use for this request. The name of the matchmaker - // that was used with the original game session is listed in the GameSession - // object, MatchmakerData property. This property contains a matchmaking configuration - // ARN value, which includes the matchmaker name. (In the ARN value "arn:aws:gamelift:us-west-2:111122223333:matchmakingconfiguration/MM-4v4", - // the matchmaking configuration name is "MM-4v4".) Use only the name for this - // parameter. + // Name of the matchmaker to use for this request. You can use either the configuration + // name or ARN value. The ARN of the matchmaker that was used with the original + // game session is listed in the GameSession object, MatchmakerData property. // // ConfigurationName is a required field - ConfigurationName *string `type:"string" required:"true"` + ConfigurationName *string `min:"1" type:"string" required:"true"` - // Amazon Resource Name (ARN (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) - // that is assigned to a game session and uniquely identifies it. + // Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // that is assigned to a game session and uniquely identifies it. This is the + // same as the game session ID. // // GameSessionArn is a required field GameSessionArn *string `min:"1" type:"string" required:"true"` @@ -18299,13 +19807,13 @@ type StartMatchBackfillInput struct { // JSON syntax, formatted as a string. For more details, see Match Data (https://docs.aws.amazon.com/gamelift/latest/developerguide/match-server.html#match-server-data). // // * LatencyInMs -\\- If the matchmaker uses player latency, include a latency - // value, in milliseconds, for the region that the game session is currently - // in. Do not include latency values for any other region. + // value, in milliseconds, for the Region that the game session is currently + // in. Do not include latency values for any other Region. // // Players is a required field Players []*Player `type:"list" required:"true"` - // Unique identifier for a matchmaking ticket. If no ticket ID is specified + // A unique identifier for a matchmaking ticket. If no ticket ID is specified // here, Amazon GameLift will generate one in the form of a UUID. Use this identifier // to track the match backfill ticket status and retrieve match results. TicketId *string `type:"string"` @@ -18327,6 +19835,9 @@ func (s *StartMatchBackfillInput) Validate() error { if s.ConfigurationName == nil { invalidParams.Add(request.NewErrParamRequired("ConfigurationName")) } + if s.ConfigurationName != nil && len(*s.ConfigurationName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigurationName", 1)) + } if s.GameSessionArn == nil { invalidParams.Add(request.NewErrParamRequired("GameSessionArn")) } @@ -18408,10 +19919,11 @@ type StartMatchmakingInput struct { _ struct{} `type:"structure"` // Name of the matchmaking configuration to use for this request. Matchmaking - // configurations must exist in the same region as this request. + // configurations must exist in the same Region as this request. You can use + // either the configuration name or ARN value. // // ConfigurationName is a required field - ConfigurationName *string `type:"string" required:"true"` + ConfigurationName *string `min:"1" type:"string" required:"true"` // Information on each player to be matched. This information must include a // player ID, and may contain player attributes and latency data to be used @@ -18421,7 +19933,7 @@ type StartMatchmakingInput struct { // Players is a required field Players []*Player `type:"list" required:"true"` - // Unique identifier for a matchmaking ticket. If no ticket ID is specified + // A unique identifier for a matchmaking ticket. If no ticket ID is specified // here, Amazon GameLift will generate one in the form of a UUID. Use this identifier // to track the matchmaking ticket status and retrieve match results. TicketId *string `type:"string"` @@ -18443,6 +19955,9 @@ func (s *StartMatchmakingInput) Validate() error { if s.ConfigurationName == nil { invalidParams.Add(request.NewErrParamRequired("ConfigurationName")) } + if s.ConfigurationName != nil && len(*s.ConfigurationName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfigurationName", 1)) + } if s.Players == nil { invalidParams.Add(request.NewErrParamRequired("Players")) } @@ -18515,7 +20030,8 @@ type StopFleetActionsInput struct { // Actions is a required field Actions []*string `min:"1" type:"list" required:"true"` - // Unique identifier for a fleet + // A unique identifier for a fleet to stop actions on. You can use either the + // fleet ID or ARN value. // // FleetId is a required field FleetId *string `type:"string" required:"true"` @@ -18576,34 +20092,249 @@ func (s StopFleetActionsOutput) GoString() string { return s.String() } -// Represents the input for a request action. -type StopGameSessionPlacementInput struct { +// Represents the input for a request action. +type StopGameSessionPlacementInput struct { + _ struct{} `type:"structure"` + + // A unique identifier for a game session placement to cancel. + // + // PlacementId is a required field + PlacementId *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s StopGameSessionPlacementInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopGameSessionPlacementInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StopGameSessionPlacementInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopGameSessionPlacementInput"} + if s.PlacementId == nil { + invalidParams.Add(request.NewErrParamRequired("PlacementId")) + } + if s.PlacementId != nil && len(*s.PlacementId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PlacementId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPlacementId sets the PlacementId field's value. +func (s *StopGameSessionPlacementInput) SetPlacementId(v string) *StopGameSessionPlacementInput { + s.PlacementId = &v + return s +} + +// Represents the returned data in response to a request action. +type StopGameSessionPlacementOutput struct { + _ struct{} `type:"structure"` + + // Object that describes the canceled game session placement, with CANCELLED + // status and an end time stamp. + GameSessionPlacement *GameSessionPlacement `type:"structure"` +} + +// String returns the string representation +func (s StopGameSessionPlacementOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopGameSessionPlacementOutput) GoString() string { + return s.String() +} + +// SetGameSessionPlacement sets the GameSessionPlacement field's value. +func (s *StopGameSessionPlacementOutput) SetGameSessionPlacement(v *GameSessionPlacement) *StopGameSessionPlacementOutput { + s.GameSessionPlacement = v + return s +} + +// Represents the input for a request action. +type StopMatchmakingInput struct { + _ struct{} `type:"structure"` + + // A unique identifier for a matchmaking ticket. + // + // TicketId is a required field + TicketId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s StopMatchmakingInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopMatchmakingInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StopMatchmakingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopMatchmakingInput"} + if s.TicketId == nil { + invalidParams.Add(request.NewErrParamRequired("TicketId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTicketId sets the TicketId field's value. +func (s *StopMatchmakingInput) SetTicketId(v string) *StopMatchmakingInput { + s.TicketId = &v + return s +} + +type StopMatchmakingOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s StopMatchmakingOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopMatchmakingOutput) GoString() string { + return s.String() +} + +// A label that can be assigned to a GameLift resource. +// +// Learn more +// +// Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) +// in the AWS General Reference +// +// AWS Tagging Strategies (http://aws.amazon.com/answers/account-management/aws-tagging-strategies/) +// +// Related operations +// +// * TagResource +// +// * UntagResource +// +// * ListTagsForResource +type Tag struct { + _ struct{} `type:"structure"` + + // The key for a developer-defined key:value pair for tagging an AWS resource. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // The value for a developer-defined key:value pair for tagging an AWS resource. + // + // 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 +} + +type TagResourceInput struct { _ struct{} `type:"structure"` - // Unique identifier for a game session placement to cancel. + // The Amazon Resource Name (ARN (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) + // that is assigned to and uniquely identifies the GameLift resource that you + // want to assign tags to. GameLift resource ARNs are included in the data object + // for the resource, which can be retrieved by calling a List or Describe action + // for the resource type. // - // PlacementId is a required field - PlacementId *string `min:"1" type:"string" required:"true"` + // ResourceARN is a required field + ResourceARN *string `min:"1" type:"string" required:"true"` + + // A list of one or more tags to assign to the specified GameLift resource. + // Tags are developer-defined and structured as key-value pairs. The maximum + // tag limit may be lower than stated. See Tagging AWS Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) + // for actual tagging limits. + // + // Tags is a required field + Tags []*Tag `type:"list" required:"true"` } // String returns the string representation -func (s StopGameSessionPlacementInput) String() string { +func (s TagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s StopGameSessionPlacementInput) GoString() string { +func (s TagResourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *StopGameSessionPlacementInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopGameSessionPlacementInput"} - if s.PlacementId == nil { - invalidParams.Add(request.NewErrParamRequired("PlacementId")) +func (s *TagResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} + if s.ResourceARN == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceARN")) } - if s.PlacementId != nil && len(*s.PlacementId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PlacementId", 1)) + 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 { @@ -18612,88 +20343,88 @@ func (s *StopGameSessionPlacementInput) Validate() error { return nil } -// SetPlacementId sets the PlacementId field's value. -func (s *StopGameSessionPlacementInput) SetPlacementId(v string) *StopGameSessionPlacementInput { - s.PlacementId = &v +// SetResourceARN sets the ResourceARN field's value. +func (s *TagResourceInput) SetResourceARN(v string) *TagResourceInput { + s.ResourceARN = &v return s } -// Represents the returned data in response to a request action. -type StopGameSessionPlacementOutput struct { - _ struct{} `type:"structure"` +// SetTags sets the Tags field's value. +func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { + s.Tags = v + return s +} - // Object that describes the canceled game session placement, with CANCELLED - // status and an end time stamp. - GameSessionPlacement *GameSessionPlacement `type:"structure"` +type TagResourceOutput struct { + _ struct{} `type:"structure"` } // String returns the string representation -func (s StopGameSessionPlacementOutput) String() string { +func (s TagResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s StopGameSessionPlacementOutput) GoString() string { +func (s TagResourceOutput) GoString() string { return s.String() } -// SetGameSessionPlacement sets the GameSessionPlacement field's value. -func (s *StopGameSessionPlacementOutput) SetGameSessionPlacement(v *GameSessionPlacement) *StopGameSessionPlacementOutput { - s.GameSessionPlacement = v - return s -} - -// Represents the input for a request action. -type StopMatchmakingInput struct { - _ struct{} `type:"structure"` +// The requested tagging operation did not succeed. This may be due to invalid +// tag format or the maximum tag limit may have been exceeded. Resolve the issue +// before retrying. +type TaggingFailedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Unique identifier for a matchmaking ticket. - // - // TicketId is a required field - TicketId *string `type:"string" required:"true"` + Message_ *string `locationName:"Message" min:"1" type:"string"` } // String returns the string representation -func (s StopMatchmakingInput) String() string { +func (s TaggingFailedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s StopMatchmakingInput) GoString() string { +func (s TaggingFailedException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopMatchmakingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopMatchmakingInput"} - if s.TicketId == nil { - invalidParams.Add(request.NewErrParamRequired("TicketId")) +func newErrorTaggingFailedException(v protocol.ResponseMetadata) error { + return &TaggingFailedException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s TaggingFailedException) Code() string { + return "TaggingFailedException" +} + +// Message returns the exception's message. +func (s TaggingFailedException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetTicketId sets the TicketId field's value. -func (s *StopMatchmakingInput) SetTicketId(v string) *StopMatchmakingInput { - s.TicketId = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TaggingFailedException) OrigErr() error { + return nil } -type StopMatchmakingOutput struct { - _ struct{} `type:"structure"` +func (s TaggingFailedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// String returns the string representation -func (s StopMatchmakingOutput) String() string { - return awsutil.Prettify(s) +// Status code returns the HTTP status code for the request's response error. +func (s TaggingFailedException) StatusCode() int { + return s.respMetadata.StatusCode } -// GoString returns the string representation -func (s StopMatchmakingOutput) GoString() string { - return s.String() +// RequestID returns the service's response RequestID for request. +func (s TaggingFailedException) RequestID() string { + return s.respMetadata.RequestID } // Settings for a target-based scaling policy (see ScalingPolicy. A target-based @@ -18755,23 +20486,271 @@ func (s *TargetConfiguration) SetTargetValue(v float64) *TargetConfiguration { return s } +// The service is unable to resolve the routing for a particular alias because +// it has a terminal RoutingStrategy associated with it. The message returned +// in this exception is the message defined in the routing strategy itself. +// Such requests should only be retried if the routing strategy for the specified +// alias is modified. +type TerminalRoutingStrategyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s TerminalRoutingStrategyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TerminalRoutingStrategyException) GoString() string { + return s.String() +} + +func newErrorTerminalRoutingStrategyException(v protocol.ResponseMetadata) error { + return &TerminalRoutingStrategyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TerminalRoutingStrategyException) Code() string { + return "TerminalRoutingStrategyException" +} + +// Message returns the exception's message. +func (s TerminalRoutingStrategyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TerminalRoutingStrategyException) OrigErr() error { + return nil +} + +func (s TerminalRoutingStrategyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TerminalRoutingStrategyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TerminalRoutingStrategyException) RequestID() string { + return s.respMetadata.RequestID +} + +// The client failed authentication. Clients should not retry such requests. +type UnauthorizedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s UnauthorizedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnauthorizedException) GoString() string { + return s.String() +} + +func newErrorUnauthorizedException(v protocol.ResponseMetadata) error { + return &UnauthorizedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnauthorizedException) Code() string { + return "UnauthorizedException" +} + +// Message returns the exception's message. +func (s UnauthorizedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnauthorizedException) OrigErr() error { + return nil +} + +func (s UnauthorizedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnauthorizedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnauthorizedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested operation is not supported in the Region specified. +type UnsupportedRegionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s UnsupportedRegionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedRegionException) GoString() string { + return s.String() +} + +func newErrorUnsupportedRegionException(v protocol.ResponseMetadata) error { + return &UnsupportedRegionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedRegionException) Code() string { + return "UnsupportedRegionException" +} + +// Message returns the exception's message. +func (s UnsupportedRegionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedRegionException) OrigErr() error { + return nil +} + +func (s UnsupportedRegionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedRegionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedRegionException) RequestID() string { + return s.respMetadata.RequestID +} + +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) + // that is assigned to and uniquely identifies the GameLift resource that you + // want to remove tags from. GameLift resource ARNs are included in the data + // object for the resource, which can be retrieved by calling a List or Describe + // action for the resource type. + // + // ResourceARN is a required field + ResourceARN *string `min:"1" type:"string" required:"true"` + + // A list of one or more tags to remove from the specified GameLift resource. + // Tags are developer-defined and structured as key-value pairs. + // + // 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 +} + +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 input for a request action. type UpdateAliasInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet alias. Specify the alias you want to update. + // A unique identifier for the alias that you want to update. You can use either + // the alias ID or ARN value. // // AliasId is a required field AliasId *string `type:"string" required:"true"` - // Human-readable description of an alias. + // A human-readable description of the alias. Description *string `min:"1" type:"string"` - // Descriptive label that is associated with an alias. Alias names do not need - // to be unique. + // A descriptive label that is associated with an alias. Alias names do not + // need to be unique. Name *string `min:"1" type:"string"` - // Object that specifies the fleet and routing type to use for the alias. + // The routing configuration, including routing type and fleet target, for the + // alias. RoutingStrategy *RoutingStrategy `type:"structure"` } @@ -18832,7 +20811,7 @@ func (s *UpdateAliasInput) SetRoutingStrategy(v *RoutingStrategy) *UpdateAliasIn type UpdateAliasOutput struct { _ struct{} `type:"structure"` - // Object that contains the updated alias configuration. + // The updated alias resource. Alias *Alias `type:"structure"` } @@ -18856,17 +20835,18 @@ func (s *UpdateAliasOutput) SetAlias(v *Alias) *UpdateAliasOutput { type UpdateBuildInput struct { _ struct{} `type:"structure"` - // Unique identifier for a build to update. + // A unique identifier for a build to update. You can use either the build ID + // or ARN value. // // BuildId is a required field BuildId *string `type:"string" required:"true"` - // Descriptive label that is associated with a build. Build names do not need + // A descriptive label that is associated with a build. Build names do not need // to be unique. Name *string `min:"1" type:"string"` - // Version that is associated with a build or script. Version strings do not - // need to be unique. + // Version information that is associated with a build or script. Version strings + // do not need to be unique. Version *string `min:"1" type:"string"` } @@ -18921,7 +20901,7 @@ func (s *UpdateBuildInput) SetVersion(v string) *UpdateBuildInput { type UpdateBuildOutput struct { _ struct{} `type:"structure"` - // Object that contains the updated build record. + // The updated build record. Build *Build `type:"structure"` } @@ -18948,7 +20928,8 @@ type UpdateFleetAttributesInput struct { // Human-readable description of a fleet. Description *string `min:"1" type:"string"` - // Unique identifier for a fleet to update attribute metadata for. + // A unique identifier for a fleet to update attribute metadata for. You can + // use either the fleet ID or ARN value. // // FleetId is a required field FleetId *string `type:"string" required:"true"` @@ -18960,7 +20941,7 @@ type UpdateFleetAttributesInput struct { // time. MetricGroups []*string `type:"list"` - // Descriptive label that is associated with a fleet. Fleet names do not need + // A descriptive label that is associated with a fleet. Fleet names do not need // to be unique. Name *string `min:"1" type:"string"` @@ -19049,7 +21030,8 @@ func (s *UpdateFleetAttributesInput) SetResourceCreationLimitPolicy(v *ResourceC type UpdateFleetAttributesOutput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet that was updated. + // A unique identifier for a fleet that was updated. Use either the fleet ID + // or ARN value. FleetId *string `type:"string"` } @@ -19076,17 +21058,18 @@ type UpdateFleetCapacityInput struct { // Number of EC2 instances you want this fleet to host. DesiredInstances *int64 `type:"integer"` - // Unique identifier for a fleet to update capacity for. + // A unique identifier for a fleet to update capacity for. You can use either + // the fleet ID or ARN value. // // FleetId is a required field FleetId *string `type:"string" required:"true"` - // Maximum value allowed for the fleet's instance count. Default if not set - // is 1. + // The maximum value allowed for the fleet's instance count. Default if not + // set is 1. MaxSize *int64 `type:"integer"` - // Minimum value allowed for the fleet's instance count. Default if not set - // is 0. + // The minimum value allowed for the fleet's instance count. Default if not + // set is 0. MinSize *int64 `type:"integer"` } @@ -19141,7 +21124,7 @@ func (s *UpdateFleetCapacityInput) SetMinSize(v int64) *UpdateFleetCapacityInput type UpdateFleetCapacityOutput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet that was updated. + // A unique identifier for a fleet that was updated. FleetId *string `type:"string"` } @@ -19165,15 +21148,16 @@ func (s *UpdateFleetCapacityOutput) SetFleetId(v string) *UpdateFleetCapacityOut type UpdateFleetPortSettingsInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet to update port settings for. + // A unique identifier for a fleet to update port settings for. You can use + // either the fleet ID or ARN value. // // FleetId is a required field FleetId *string `type:"string" required:"true"` - // Collection of port settings to be added to the fleet record. + // A collection of port settings to be added to the fleet record. InboundPermissionAuthorizations []*IpPermission `type:"list"` - // Collection of port settings to be removed from the fleet record. + // A collection of port settings to be removed from the fleet record. InboundPermissionRevocations []*IpPermission `type:"list"` } @@ -19242,7 +21226,7 @@ func (s *UpdateFleetPortSettingsInput) SetInboundPermissionRevocations(v []*IpPe type UpdateFleetPortSettingsOutput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet that was updated. + // A unique identifier for a fleet that was updated. FleetId *string `type:"string"` } @@ -19266,17 +21250,17 @@ func (s *UpdateFleetPortSettingsOutput) SetFleetId(v string) *UpdateFleetPortSet type UpdateGameSessionInput struct { _ struct{} `type:"structure"` - // Unique identifier for the game session to update. + // A unique identifier for the game session to update. // // GameSessionId is a required field GameSessionId *string `min:"1" type:"string" required:"true"` - // Maximum number of players that can be connected simultaneously to the game - // session. + // The maximum number of players that can be connected simultaneously to the + // game session. MaximumPlayerSessionCount *int64 `type:"integer"` - // Descriptive label that is associated with a game session. Session names do - // not need to be unique. + // A descriptive label that is associated with a game session. Session names + // do not need to be unique. Name *string `min:"1" type:"string"` // Policy determining whether or not the game session accepts new players. @@ -19355,7 +21339,7 @@ func (s *UpdateGameSessionInput) SetProtectionPolicy(v string) *UpdateGameSessio type UpdateGameSessionOutput struct { _ struct{} `type:"structure"` - // Object that contains the updated game session metadata. + // The updated game session metadata. GameSession *GameSession `type:"structure"` } @@ -19379,30 +21363,31 @@ func (s *UpdateGameSessionOutput) SetGameSession(v *GameSession) *UpdateGameSess type UpdateGameSessionQueueInput struct { _ struct{} `type:"structure"` - // List of fleets that can be used to fulfill game session placement requests + // A list of fleets that can be used to fulfill game session placement requests // in the queue. Fleets are identified by either a fleet ARN or a fleet alias // ARN. Destinations are listed in default preference order. When updating this // list, provide a complete list of destinations. Destinations []*GameSessionQueueDestination `type:"list"` - // Descriptive label that is associated with game session queue. Queue names - // must be unique within each region. + // A descriptive label that is associated with game session queue. Queue names + // must be unique within each Region. You can use either the queue ID or ARN + // value. // // Name is a required field Name *string `min:"1" type:"string" required:"true"` - // Collection of latency policies to apply when processing game sessions placement + // A collection of latency policies to apply when processing game sessions placement // requests with player latency information. Multiple policies are evaluated // in order of the maximum latency value, starting with the lowest latency values. - // With just one policy, it is enforced at the start of the game session placement - // for the duration period. With multiple policies, each policy is enforced - // consecutively for its duration period. For example, a queue might enforce - // a 60-second policy followed by a 120-second policy, and then no policy for - // the remainder of the placement. When updating policies, provide a complete + // With just one policy, the policy is enforced at the start of the game session + // placement for the duration period. With multiple policies, each policy is + // enforced consecutively for its duration period. For example, a queue might + // enforce a 60-second policy followed by a 120-second policy, and then no policy + // for the remainder of the placement. When updating policies, provide a complete // collection of policies. PlayerLatencyPolicies []*PlayerLatencyPolicy `type:"list"` - // Maximum time, in seconds, that a new game session placement request remains + // The maximum time, in seconds, that a new game session placement request remains // in the queue. When a request exceeds this time, the game session placement // changes to a TIMED_OUT status. TimeoutInSeconds *int64 `type:"integer"` @@ -19472,7 +21457,7 @@ func (s *UpdateGameSessionQueueInput) SetTimeoutInSeconds(v int64) *UpdateGameSe type UpdateGameSessionQueueOutput struct { _ struct{} `type:"structure"` - // Object that describes the newly updated game session queue. + // An object that describes the newly updated game session queue. GameSessionQueue *GameSessionQueue `type:"structure"` } @@ -19496,75 +21481,76 @@ func (s *UpdateGameSessionQueueOutput) SetGameSessionQueue(v *GameSessionQueue) type UpdateMatchmakingConfigurationInput struct { _ struct{} `type:"structure"` - // Flag that determines whether a match that was created with this configuration + // A flag that indicates whether a match that was created with this configuration // must be accepted by the matched players. To require acceptance, set to TRUE. AcceptanceRequired *bool `type:"boolean"` - // Length of time (in seconds) to wait for players to accept a proposed match. - // If any player rejects the match or fails to accept before the timeout, the - // ticket continues to look for an acceptable match. + // The length of time (in seconds) to wait for players to accept a proposed + // match. If any player rejects the match or fails to accept before the timeout, + // the ticket continues to look for an acceptable match. AcceptanceTimeoutSeconds *int64 `min:"1" type:"integer"` - // Number of player slots in a match to keep open for future players. For example, - // if the configuration's rule set specifies a match for a single 12-person - // team, and the additional player count is set to 2, only 10 players are selected - // for the match. + // The number of player slots in a match to keep open for future players. For + // example, assume that the configuration's rule set specifies a match for a + // single 12-person team. If the additional player count is set to 2, only 10 + // players are initially selected for the match. AdditionalPlayerCount *int64 `type:"integer"` - // Method used to backfill game sessions created with this matchmaking configuration. - // Specify MANUAL when your game manages backfill requests manually or does - // not use the match backfill feature. Specify AUTOMATIC to have GameLift create - // a StartMatchBackfill request whenever a game session has one or more open - // slots. Learn more about manual and automatic backfill in Backfill Existing + // The method that is used to backfill game sessions created with this matchmaking + // configuration. Specify MANUAL when your game manages backfill requests manually + // or does not use the match backfill feature. Specify AUTOMATIC to have GameLift + // create a StartMatchBackfill request whenever a game session has one or more + // open slots. Learn more about manual and automatic backfill in Backfill Existing // Games with FlexMatch (https://docs.aws.amazon.com/gamelift/latest/developerguide/match-backfill.html). BackfillMode *string `type:"string" enum:"BackfillMode"` // Information to add to all events related to the matchmaking configuration. CustomEventData *string `type:"string"` - // Descriptive label that is associated with matchmaking configuration. + // A descriptive label that is associated with matchmaking configuration. Description *string `min:"1" type:"string"` - // Set of custom properties for a game session, formatted as key:value pairs. + // A set of custom properties for a game session, formatted as key-value pairs. // These properties are passed to a game server process in the GameSession object // with a request to start a new game session (see Start a Game Session (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). // This information is added to the new GameSession object that is created for // a successful match. GameProperties []*GameProperty `type:"list"` - // Set of custom game session properties, formatted as a single string value. + // A set of custom game session properties, formatted as a single string value. // This data is passed to a game server process in the GameSession object with // a request to start a new game session (see Start a Game Session (https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-api.html#gamelift-sdk-server-startsession)). // This information is added to the new GameSession object that is created for // a successful match. GameSessionData *string `min:"1" type:"string"` - // Amazon Resource Name (ARN (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-arn-format.html)) - // that is assigned to a game session queue and uniquely identifies it. Format - // is arn:aws:gamelift:::gamesessionqueue/. - // These queues are used when placing game sessions for matches that are created - // with this matchmaking configuration. Queues can be located in any region. + // Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // that is assigned to a GameLift game session queue resource and uniquely identifies + // it. ARNs are unique across all Regions. These queues are used when placing + // game sessions for matches that are created with this matchmaking configuration. + // Queues can be located in any Region. GameSessionQueueArns []*string `type:"list"` - // Unique identifier for a matchmaking configuration to update. + // A unique identifier for a matchmaking configuration to update. You can use + // either the configuration name or ARN value. // // Name is a required field - Name *string `type:"string" required:"true"` + Name *string `min:"1" type:"string" required:"true"` - // SNS topic ARN that is set up to receive matchmaking notifications. See Setting - // up Notifications for Matchmaking (https://docs.aws.amazon.com/gamelift/latest/developerguide/match-notification.html) + // An SNS topic ARN that is set up to receive matchmaking notifications. See + // Setting up Notifications for Matchmaking (https://docs.aws.amazon.com/gamelift/latest/developerguide/match-notification.html) // for more information. NotificationTarget *string `type:"string"` - // Maximum duration, in seconds, that a matchmaking ticket can remain in process - // before timing out. Requests that fail due to timing out can be resubmitted + // The maximum duration, in seconds, that a matchmaking ticket can remain in + // process before timing out. Requests that fail due to timing out can be resubmitted // as needed. RequestTimeoutSeconds *int64 `min:"1" type:"integer"` - // Unique identifier for a matchmaking rule set to use with this configuration. - // A matchmaking configuration can only use rule sets that are defined in the - // same region. - RuleSetName *string `type:"string"` + // A unique identifier for a matchmaking rule set to use with this configuration. + // You can use either the rule set name or ARN value. A matchmaking configuration + // can only use rule sets that are defined in the same Region. + RuleSetName *string `min:"1" type:"string"` } // String returns the string representation @@ -19592,9 +21578,15 @@ func (s *UpdateMatchmakingConfigurationInput) Validate() error { 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.RequestTimeoutSeconds != nil && *s.RequestTimeoutSeconds < 1 { invalidParams.Add(request.NewErrParamMinValue("RequestTimeoutSeconds", 1)) } + if s.RuleSetName != nil && len(*s.RuleSetName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleSetName", 1)) + } if s.GameProperties != nil { for i, v := range s.GameProperties { if v == nil { @@ -19694,7 +21686,7 @@ func (s *UpdateMatchmakingConfigurationInput) SetRuleSetName(v string) *UpdateMa type UpdateMatchmakingConfigurationOutput struct { _ struct{} `type:"structure"` - // Object that describes the updated matchmaking configuration. + // The updated matchmaking configuration. Configuration *MatchmakingConfiguration `type:"structure"` } @@ -19718,18 +21710,19 @@ func (s *UpdateMatchmakingConfigurationOutput) SetConfiguration(v *MatchmakingCo type UpdateRuntimeConfigurationInput struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet to update run-time configuration for. + // A unique identifier for a fleet to update runtime configuration for. You + // can use either the fleet ID or ARN value. // // FleetId is a required field FleetId *string `type:"string" required:"true"` // Instructions for launching server processes on each instance in the fleet. // Server processes run either a custom game build executable or a Realtime - // Servers script. The run-time configuration lists the types of server processes + // Servers script. The runtime configuration lists the types of server processes // to run on an instance and includes the following configuration settings: // the server executable or launch script file, launch parameters, and the number // of processes to run concurrently on each instance. A CreateFleet request - // must include a run-time configuration with at least one server process configuration. + // must include a runtime configuration with at least one server process configuration. // // RuntimeConfiguration is a required field RuntimeConfiguration *RuntimeConfiguration `type:"structure" required:"true"` @@ -19782,7 +21775,7 @@ func (s *UpdateRuntimeConfigurationInput) SetRuntimeConfiguration(v *RuntimeConf type UpdateRuntimeConfigurationOutput struct { _ struct{} `type:"structure"` - // The run-time configuration currently in force. If the update was successful, + // The runtime configuration currently in force. If the update was successful, // this object matches the one in the request. RuntimeConfiguration *RuntimeConfiguration `type:"structure"` } @@ -19806,32 +21799,33 @@ func (s *UpdateRuntimeConfigurationOutput) SetRuntimeConfiguration(v *RuntimeCon type UpdateScriptInput struct { _ struct{} `type:"structure"` - // Descriptive label that is associated with a script. Script names do not need - // to be unique. + // A descriptive label that is associated with a script. Script names do not + // need to be unique. Name *string `min:"1" type:"string"` - // Unique identifier for a Realtime script to update. + // A unique identifier for a Realtime script to update. You can use either the + // script ID or ARN value. // // ScriptId is a required field ScriptId *string `type:"string" required:"true"` - // Location of the Amazon S3 bucket where a zipped file containing your Realtime - // scripts is stored. The storage location must specify the Amazon S3 bucket - // name, the zip file name (the "key"), and a role ARN that allows Amazon GameLift - // to access the Amazon S3 storage location. The S3 bucket must be in the same - // region where you want to create a new script. By default, Amazon GameLift - // uploads the latest version of the zip file; if you have S3 object versioning - // turned on, you can use the ObjectVersion parameter to specify an earlier - // version. + // The location of the Amazon S3 bucket where a zipped file containing your + // Realtime scripts is stored. The storage location must specify the Amazon + // S3 bucket name, the zip file name (the "key"), and a role ARN that allows + // Amazon GameLift to access the Amazon S3 storage location. The S3 bucket must + // be in the same Region where you want to create a new script. By default, + // Amazon GameLift uploads the latest version of the zip file; if you have S3 + // object versioning turned on, you can use the ObjectVersion parameter to specify + // an earlier version. StorageLocation *S3Location `type:"structure"` - // Version that is associated with a build or script. Version strings do not - // need to be unique. + // The version that is associated with a build or script. Version strings do + // not need to be unique. Version *string `min:"1" type:"string"` - // Data object containing your Realtime scripts and dependencies as a zip file. - // The zip file can have one or multiple files. Maximum size of a zip file is - // 5 MB. + // A data object containing your Realtime scripts and dependencies as a zip + // file. The zip file can have one or multiple files. Maximum size of a zip + // file is 5 MB. // // When using the AWS CLI tool to create a script, this parameter is set to // the zip file name. It must be prepended with the string "fileb://" to indicate @@ -19937,7 +21931,7 @@ func (s *UpdateScriptOutput) SetScript(v *Script) *UpdateScriptOutput { type ValidateMatchmakingRuleSetInput struct { _ struct{} `type:"structure"` - // Collection of matchmaking rules to validate, formatted as a JSON string. + // A collection of matchmaking rules to validate, formatted as a JSON string. // // RuleSetBody is a required field RuleSetBody *string `min:"1" type:"string" required:"true"` @@ -19979,7 +21973,7 @@ func (s *ValidateMatchmakingRuleSetInput) SetRuleSetBody(v string) *ValidateMatc type ValidateMatchmakingRuleSetOutput struct { _ struct{} `type:"structure"` - // Response indicating whether the rule set is valid. + // A response indicating whether the rule set is valid. Valid *bool `type:"boolean"` } @@ -20026,15 +22020,15 @@ type VpcPeeringAuthorization struct { // Format is a number expressed in Unix time as milliseconds (for example "1469498468.057"). ExpirationTime *time.Time `type:"timestamp"` - // Unique identifier for the AWS account that you use to manage your Amazon + // A unique identifier for the AWS account that you use to manage your Amazon // GameLift fleet. You can find your Account ID in the AWS Management Console // under account settings. GameLiftAwsAccountId *string `min:"1" type:"string"` PeerVpcAwsAccountId *string `min:"1" type:"string"` - // Unique identifier for a VPC with resources to be accessed by your Amazon - // GameLift fleet. The VPC must be in the same region where your fleet is deployed. + // A unique identifier for a VPC with resources to be accessed by your Amazon + // GameLift fleet. The VPC must be in the same Region where your fleet is deployed. // Look up a VPC ID using the VPC Dashboard (https://console.aws.amazon.com/vpc/) // in the AWS Management Console. Learn more about VPC peering in VPC Peering // with Amazon GameLift Fleets (https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html). @@ -20099,11 +22093,15 @@ func (s *VpcPeeringAuthorization) SetPeerVpcId(v string) *VpcPeeringAuthorizatio type VpcPeeringConnection struct { _ struct{} `type:"structure"` - // Unique identifier for a fleet. This ID determines the ID of the Amazon GameLift - // VPC for your fleet. + // The Amazon Resource Name (ARN (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html)) + // associated with the GameLift fleet resource for this connection. + FleetArn *string `min:"1" type:"string"` + + // A unique identifier for a fleet. This ID determines the ID of the Amazon + // GameLift VPC for your fleet. FleetId *string `type:"string"` - // Unique identifier for the VPC that contains the Amazon GameLift fleet for + // A unique identifier for the VPC that contains the Amazon GameLift fleet for // this connection. This VPC is managed by Amazon GameLift and does not appear // in your AWS account. GameLiftVpcId *string `min:"1" type:"string"` @@ -20113,18 +22111,18 @@ type VpcPeeringConnection struct { // it; these blocks cannot overlap or the peering connection cannot be created. IpV4CidrBlock *string `min:"1" type:"string"` - // Unique identifier for a VPC with resources to be accessed by your Amazon - // GameLift fleet. The VPC must be in the same region where your fleet is deployed. + // A unique identifier for a VPC with resources to be accessed by your Amazon + // GameLift fleet. The VPC must be in the same Region where your fleet is deployed. // Look up a VPC ID using the VPC Dashboard (https://console.aws.amazon.com/vpc/) // in the AWS Management Console. Learn more about VPC peering in VPC Peering // with Amazon GameLift Fleets (https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html). PeerVpcId *string `min:"1" type:"string"` - // Object that contains status information about the connection. Status indicates - // if a connection is pending, successful, or failed. + // The status information about the connection. Status indicates if a connection + // is pending, successful, or failed. Status *VpcPeeringConnectionStatus `type:"structure"` - // Unique identifier that is automatically assigned to the connection record. + // A unique identifier that is automatically assigned to the connection record. // This ID is referenced in VPC peering connection events, and is used when // deleting a connection with DeleteVpcPeeringConnection. VpcPeeringConnectionId *string `min:"1" type:"string"` @@ -20140,6 +22138,12 @@ func (s VpcPeeringConnection) GoString() string { return s.String() } +// SetFleetArn sets the FleetArn field's value. +func (s *VpcPeeringConnection) SetFleetArn(v string) *VpcPeeringConnection { + s.FleetArn = &v + return s +} + // SetFleetId sets the FleetId field's value. func (s *VpcPeeringConnection) SetFleetId(v string) *VpcPeeringConnection { s.FleetId = &v @@ -20304,6 +22308,30 @@ const ( // EC2InstanceTypeC48xlarge is a EC2InstanceType enum value EC2InstanceTypeC48xlarge = "c4.8xlarge" + // EC2InstanceTypeC5Large is a EC2InstanceType enum value + EC2InstanceTypeC5Large = "c5.large" + + // EC2InstanceTypeC5Xlarge is a EC2InstanceType enum value + EC2InstanceTypeC5Xlarge = "c5.xlarge" + + // EC2InstanceTypeC52xlarge is a EC2InstanceType enum value + EC2InstanceTypeC52xlarge = "c5.2xlarge" + + // EC2InstanceTypeC54xlarge is a EC2InstanceType enum value + EC2InstanceTypeC54xlarge = "c5.4xlarge" + + // EC2InstanceTypeC59xlarge is a EC2InstanceType enum value + EC2InstanceTypeC59xlarge = "c5.9xlarge" + + // EC2InstanceTypeC512xlarge is a EC2InstanceType enum value + EC2InstanceTypeC512xlarge = "c5.12xlarge" + + // EC2InstanceTypeC518xlarge is a EC2InstanceType enum value + EC2InstanceTypeC518xlarge = "c5.18xlarge" + + // EC2InstanceTypeC524xlarge is a EC2InstanceType enum value + EC2InstanceTypeC524xlarge = "c5.24xlarge" + // EC2InstanceTypeR3Large is a EC2InstanceType enum value EC2InstanceTypeR3Large = "r3.large" @@ -20337,6 +22365,30 @@ const ( // EC2InstanceTypeR416xlarge is a EC2InstanceType enum value EC2InstanceTypeR416xlarge = "r4.16xlarge" + // EC2InstanceTypeR5Large is a EC2InstanceType enum value + EC2InstanceTypeR5Large = "r5.large" + + // EC2InstanceTypeR5Xlarge is a EC2InstanceType enum value + EC2InstanceTypeR5Xlarge = "r5.xlarge" + + // EC2InstanceTypeR52xlarge is a EC2InstanceType enum value + EC2InstanceTypeR52xlarge = "r5.2xlarge" + + // EC2InstanceTypeR54xlarge is a EC2InstanceType enum value + EC2InstanceTypeR54xlarge = "r5.4xlarge" + + // EC2InstanceTypeR58xlarge is a EC2InstanceType enum value + EC2InstanceTypeR58xlarge = "r5.8xlarge" + + // EC2InstanceTypeR512xlarge is a EC2InstanceType enum value + EC2InstanceTypeR512xlarge = "r5.12xlarge" + + // EC2InstanceTypeR516xlarge is a EC2InstanceType enum value + EC2InstanceTypeR516xlarge = "r5.16xlarge" + + // EC2InstanceTypeR524xlarge is a EC2InstanceType enum value + EC2InstanceTypeR524xlarge = "r5.24xlarge" + // EC2InstanceTypeM3Medium is a EC2InstanceType enum value EC2InstanceTypeM3Medium = "m3.medium" @@ -20363,6 +22415,30 @@ const ( // EC2InstanceTypeM410xlarge is a EC2InstanceType enum value EC2InstanceTypeM410xlarge = "m4.10xlarge" + + // EC2InstanceTypeM5Large is a EC2InstanceType enum value + EC2InstanceTypeM5Large = "m5.large" + + // EC2InstanceTypeM5Xlarge is a EC2InstanceType enum value + EC2InstanceTypeM5Xlarge = "m5.xlarge" + + // EC2InstanceTypeM52xlarge is a EC2InstanceType enum value + EC2InstanceTypeM52xlarge = "m5.2xlarge" + + // EC2InstanceTypeM54xlarge is a EC2InstanceType enum value + EC2InstanceTypeM54xlarge = "m5.4xlarge" + + // EC2InstanceTypeM58xlarge is a EC2InstanceType enum value + EC2InstanceTypeM58xlarge = "m5.8xlarge" + + // EC2InstanceTypeM512xlarge is a EC2InstanceType enum value + EC2InstanceTypeM512xlarge = "m5.12xlarge" + + // EC2InstanceTypeM516xlarge is a EC2InstanceType enum value + EC2InstanceTypeM516xlarge = "m5.16xlarge" + + // EC2InstanceTypeM524xlarge is a EC2InstanceType enum value + EC2InstanceTypeM524xlarge = "m5.24xlarge" ) const ( @@ -20633,6 +22709,9 @@ const ( // OperatingSystemAmazonLinux is a OperatingSystem enum value OperatingSystemAmazonLinux = "AMAZON_LINUX" + + // OperatingSystemAmazonLinux2 is a OperatingSystem enum value + OperatingSystemAmazonLinux2 = "AMAZON_LINUX_2" ) const ( diff --git a/vendor/github.com/aws/aws-sdk-go/service/gamelift/errors.go b/vendor/github.com/aws/aws-sdk-go/service/gamelift/errors.go index d04e78d0d2c..f9794d64250 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/gamelift/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/gamelift/errors.go @@ -2,6 +2,10 @@ package gamelift +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeConflictException for service response error code @@ -78,6 +82,14 @@ const ( // should not retry such requests. ErrCodeNotFoundException = "NotFoundException" + // ErrCodeTaggingFailedException for service response error code + // "TaggingFailedException". + // + // The requested tagging operation did not succeed. This may be due to invalid + // tag format or the maximum tag limit may have been exceeded. Resolve the issue + // before retrying. + ErrCodeTaggingFailedException = "TaggingFailedException" + // ErrCodeTerminalRoutingStrategyException for service response error code // "TerminalRoutingStrategyException". // @@ -97,6 +109,23 @@ const ( // ErrCodeUnsupportedRegionException for service response error code // "UnsupportedRegionException". // - // The requested operation is not supported in the region specified. + // The requested operation is not supported in the Region specified. ErrCodeUnsupportedRegionException = "UnsupportedRegionException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ConflictException": newErrorConflictException, + "FleetCapacityExceededException": newErrorFleetCapacityExceededException, + "GameSessionFullException": newErrorGameSessionFullException, + "IdempotentParameterMismatchException": newErrorIdempotentParameterMismatchException, + "InternalServiceException": newErrorInternalServiceException, + "InvalidFleetStatusException": newErrorInvalidFleetStatusException, + "InvalidGameSessionStatusException": newErrorInvalidGameSessionStatusException, + "InvalidRequestException": newErrorInvalidRequestException, + "LimitExceededException": newErrorLimitExceededException, + "NotFoundException": newErrorNotFoundException, + "TaggingFailedException": newErrorTaggingFailedException, + "TerminalRoutingStrategyException": newErrorTerminalRoutingStrategyException, + "UnauthorizedException": newErrorUnauthorizedException, + "UnsupportedRegionException": newErrorUnsupportedRegionException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/gamelift/service.go b/vendor/github.com/aws/aws-sdk-go/service/gamelift/service.go index a2361e47690..9d8ead55089 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/gamelift/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/gamelift/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "gamelift" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "GameLift" // ServiceID is a unique identifer of a specific service. + ServiceID = "GameLift" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the GameLift client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a GameLift client from just a session. // svc := gamelift.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := gamelift.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *GameLift { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *GameLift { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *GameLift { svc := &GameLift{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-10-01", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 4e54a116d59..32e021c8728 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/glacier/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/glacier/api.go @@ -84,18 +84,18 @@ func (c *Glacier) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) // See the AWS API reference guide for Amazon Glacier's // API operation AbortMultipartUpload for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) AbortMultipartUpload(input *AbortMultipartUploadInput) (*AbortMultipartUploadOutput, error) { @@ -186,18 +186,18 @@ func (c *Glacier) AbortVaultLockRequest(input *AbortVaultLockInput) (req *reques // See the AWS API reference guide for Amazon Glacier's // API operation AbortVaultLock for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) AbortVaultLock(input *AbortVaultLockInput) (*AbortVaultLockOutput, error) { @@ -278,21 +278,21 @@ func (c *Glacier) AddTagsToVaultRequest(input *AddTagsToVaultInput) (req *reques // See the AWS API reference guide for Amazon Glacier's // API operation AddTagsToVault for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Returned if the request results in a vault or account limit being exceeded. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) AddTagsToVault(input *AddTagsToVaultInput) (*AddTagsToVaultOutput, error) { @@ -410,18 +410,18 @@ func (c *Glacier) CompleteMultipartUploadRequest(input *CompleteMultipartUploadI // See the AWS API reference guide for Amazon Glacier's // API operation CompleteMultipartUpload for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) CompleteMultipartUpload(input *CompleteMultipartUploadInput) (*ArchiveCreationOutput, error) { @@ -511,18 +511,18 @@ func (c *Glacier) CompleteVaultLockRequest(input *CompleteVaultLockInput) (req * // See the AWS API reference guide for Amazon Glacier's // API operation CompleteVaultLock for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) CompleteVaultLock(input *CompleteVaultLockInput) (*CompleteVaultLockOutput, error) { @@ -620,17 +620,17 @@ func (c *Glacier) CreateVaultRequest(input *CreateVaultInput) (req *request.Requ // See the AWS API reference guide for Amazon Glacier's // API operation CreateVault for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Returned if the request results in a vault or account limit being exceeded. // func (c *Glacier) CreateVault(input *CreateVaultInput) (*CreateVaultOutput, error) { @@ -730,18 +730,18 @@ func (c *Glacier) DeleteArchiveRequest(input *DeleteArchiveInput) (req *request. // See the AWS API reference guide for Amazon Glacier's // API operation DeleteArchive for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) DeleteArchive(input *DeleteArchiveInput) (*DeleteArchiveOutput, error) { @@ -839,18 +839,18 @@ func (c *Glacier) DeleteVaultRequest(input *DeleteVaultInput) (req *request.Requ // See the AWS API reference guide for Amazon Glacier's // API operation DeleteVault for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) DeleteVault(input *DeleteVaultInput) (*DeleteVaultOutput, error) { @@ -935,18 +935,18 @@ func (c *Glacier) DeleteVaultAccessPolicyRequest(input *DeleteVaultAccessPolicyI // See the AWS API reference guide for Amazon Glacier's // API operation DeleteVaultAccessPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) DeleteVaultAccessPolicy(input *DeleteVaultAccessPolicyInput) (*DeleteVaultAccessPolicyOutput, error) { @@ -1036,18 +1036,18 @@ func (c *Glacier) DeleteVaultNotificationsRequest(input *DeleteVaultNotification // See the AWS API reference guide for Amazon Glacier's // API operation DeleteVaultNotifications for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) DeleteVaultNotifications(input *DeleteVaultNotificationsInput) (*DeleteVaultNotificationsOutput, error) { @@ -1144,18 +1144,18 @@ func (c *Glacier) DescribeJobRequest(input *DescribeJobInput) (req *request.Requ // See the AWS API reference guide for Amazon Glacier's // API operation DescribeJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) DescribeJob(input *DescribeJobInput) (*JobDescription, error) { @@ -1249,18 +1249,18 @@ func (c *Glacier) DescribeVaultRequest(input *DescribeVaultInput) (req *request. // See the AWS API reference guide for Amazon Glacier's // API operation DescribeVault for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) DescribeVault(input *DescribeVaultInput) (*DescribeVaultOutput, error) { @@ -1337,14 +1337,14 @@ func (c *Glacier) GetDataRetrievalPolicyRequest(input *GetDataRetrievalPolicyInp // See the AWS API reference guide for Amazon Glacier's // API operation GetDataRetrievalPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) GetDataRetrievalPolicy(input *GetDataRetrievalPolicyInput) (*GetDataRetrievalPolicyOutput, error) { @@ -1462,18 +1462,18 @@ func (c *Glacier) GetJobOutputRequest(input *GetJobOutputInput) (req *request.Re // See the AWS API reference guide for Amazon Glacier's // API operation GetJobOutput for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) GetJobOutput(input *GetJobOutputInput) (*GetJobOutputOutput, error) { @@ -1553,18 +1553,18 @@ func (c *Glacier) GetVaultAccessPolicyRequest(input *GetVaultAccessPolicyInput) // See the AWS API reference guide for Amazon Glacier's // API operation GetVaultAccessPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) GetVaultAccessPolicy(input *GetVaultAccessPolicyInput) (*GetVaultAccessPolicyOutput, error) { @@ -1658,18 +1658,18 @@ func (c *Glacier) GetVaultLockRequest(input *GetVaultLockInput) (req *request.Re // See the AWS API reference guide for Amazon Glacier's // API operation GetVaultLock for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) GetVaultLock(input *GetVaultLockInput) (*GetVaultLockOutput, error) { @@ -1762,18 +1762,18 @@ func (c *Glacier) GetVaultNotificationsRequest(input *GetVaultNotificationsInput // See the AWS API reference guide for Amazon Glacier's // API operation GetVaultNotifications for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) GetVaultNotifications(input *GetVaultNotificationsInput) (*GetVaultNotificationsOutput, error) { @@ -1851,27 +1851,27 @@ func (c *Glacier) InitiateJobRequest(input *InitiateJobInput) (req *request.Requ // See the AWS API reference guide for Amazon Glacier's // API operation InitiateJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodePolicyEnforcedException "PolicyEnforcedException" +// * 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" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeInsufficientCapacityException "InsufficientCapacityException" +// * 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" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) InitiateJob(input *InitiateJobInput) (*InitiateJobOutput, error) { @@ -1981,18 +1981,18 @@ func (c *Glacier) InitiateMultipartUploadRequest(input *InitiateMultipartUploadI // See the AWS API reference guide for Amazon Glacier's // API operation InitiateMultipartUpload for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) InitiateMultipartUpload(input *InitiateMultipartUploadInput) (*InitiateMultipartUploadOutput, error) { @@ -2095,18 +2095,18 @@ func (c *Glacier) InitiateVaultLockRequest(input *InitiateVaultLockInput) (req * // See the AWS API reference guide for Amazon Glacier's // API operation InitiateVaultLock for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) InitiateVaultLock(input *InitiateVaultLockInput) (*InitiateVaultLockOutput, error) { @@ -2222,18 +2222,18 @@ func (c *Glacier) ListJobsRequest(input *ListJobsInput) (req *request.Request, o // See the AWS API reference guide for Amazon Glacier's // API operation ListJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) ListJobs(input *ListJobsInput) (*ListJobsOutput, error) { @@ -2300,10 +2300,12 @@ func (c *Glacier) ListJobsPagesWithContext(ctx aws.Context, input *ListJobsInput }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2393,18 +2395,18 @@ func (c *Glacier) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) // See the AWS API reference guide for Amazon Glacier's // API operation ListMultipartUploads for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) ListMultipartUploads(input *ListMultipartUploadsInput) (*ListMultipartUploadsOutput, error) { @@ -2471,10 +2473,12 @@ func (c *Glacier) ListMultipartUploadsPagesWithContext(ctx aws.Context, input *L }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListMultipartUploadsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListMultipartUploadsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2558,18 +2562,18 @@ func (c *Glacier) ListPartsRequest(input *ListPartsInput) (req *request.Request, // See the AWS API reference guide for Amazon Glacier's // API operation ListParts for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) ListParts(input *ListPartsInput) (*ListPartsOutput, error) { @@ -2636,10 +2640,12 @@ func (c *Glacier) ListPartsPagesWithContext(ctx aws.Context, input *ListPartsInp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPartsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPartsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2695,14 +2701,14 @@ func (c *Glacier) ListProvisionedCapacityRequest(input *ListProvisionedCapacityI // See the AWS API reference guide for Amazon Glacier's // API operation ListProvisionedCapacity for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) ListProvisionedCapacity(input *ListProvisionedCapacityInput) (*ListProvisionedCapacityOutput, error) { @@ -2779,18 +2785,18 @@ func (c *Glacier) ListTagsForVaultRequest(input *ListTagsForVaultInput) (req *re // See the AWS API reference guide for Amazon Glacier's // API operation ListTagsForVault for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) ListTagsForVault(input *ListTagsForVaultInput) (*ListTagsForVaultOutput, error) { @@ -2891,18 +2897,18 @@ func (c *Glacier) ListVaultsRequest(input *ListVaultsInput) (req *request.Reques // See the AWS API reference guide for Amazon Glacier's // API operation ListVaults for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) ListVaults(input *ListVaultsInput) (*ListVaultsOutput, error) { @@ -2969,10 +2975,12 @@ func (c *Glacier) ListVaultsPagesWithContext(ctx aws.Context, input *ListVaultsI }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListVaultsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListVaultsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3027,17 +3035,17 @@ func (c *Glacier) PurchaseProvisionedCapacityRequest(input *PurchaseProvisionedC // See the AWS API reference guide for Amazon Glacier's // API operation PurchaseProvisionedCapacity for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Returned if the request results in a vault or account limit being exceeded. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) PurchaseProvisionedCapacity(input *PurchaseProvisionedCapacityInput) (*PurchaseProvisionedCapacityOutput, error) { @@ -3117,18 +3125,18 @@ func (c *Glacier) RemoveTagsFromVaultRequest(input *RemoveTagsFromVaultInput) (r // See the AWS API reference guide for Amazon Glacier's // API operation RemoveTagsFromVault for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) RemoveTagsFromVault(input *RemoveTagsFromVaultInput) (*RemoveTagsFromVaultOutput, error) { @@ -3210,14 +3218,14 @@ func (c *Glacier) SetDataRetrievalPolicyRequest(input *SetDataRetrievalPolicyInp // See the AWS API reference guide for Amazon Glacier's // API operation SetDataRetrievalPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) SetDataRetrievalPolicy(input *SetDataRetrievalPolicyInput) (*SetDataRetrievalPolicyOutput, error) { @@ -3299,18 +3307,18 @@ func (c *Glacier) SetVaultAccessPolicyRequest(input *SetVaultAccessPolicyInput) // See the AWS API reference guide for Amazon Glacier's // API operation SetVaultAccessPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) SetVaultAccessPolicy(input *SetVaultAccessPolicyInput) (*SetVaultAccessPolicyOutput, error) { @@ -3417,18 +3425,18 @@ func (c *Glacier) SetVaultNotificationsRequest(input *SetVaultNotificationsInput // See the AWS API reference guide for Amazon Glacier's // API operation SetVaultNotifications for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) SetVaultNotifications(input *SetVaultNotificationsInput) (*SetVaultNotificationsOutput, error) { @@ -3538,22 +3546,22 @@ func (c *Glacier) UploadArchiveRequest(input *UploadArchiveInput) (req *request. // See the AWS API reference guide for Amazon Glacier's // API operation UploadArchive for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeRequestTimeoutException "RequestTimeoutException" +// * RequestTimeoutException // Returned if, when uploading an archive, Amazon S3 Glacier times out while // receiving the upload. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) UploadArchive(input *UploadArchiveInput) (*ArchiveCreationOutput, error) { @@ -3670,22 +3678,22 @@ func (c *Glacier) UploadMultipartPartRequest(input *UploadMultipartPartInput) (r // See the AWS API reference guide for Amazon Glacier's // API operation UploadMultipartPart for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Returned if the specified resource (such as a vault, upload ID, or job ID) // doesn't exist. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// * InvalidParameterValueException // Returned if a parameter of the request is incorrectly specified. // -// * ErrCodeMissingParameterValueException "MissingParameterValueException" +// * MissingParameterValueException // Returned if a required header or parameter is missing from the request. // -// * ErrCodeRequestTimeoutException "RequestTimeoutException" +// * RequestTimeoutException // Returned if, when uploading an archive, Amazon S3 Glacier times out while // receiving the upload. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returned if the service cannot complete the request. // func (c *Glacier) UploadMultipartPart(input *UploadMultipartPartInput) (*UploadMultipartPartOutput, error) { @@ -6167,6 +6175,131 @@ func (s *InputSerialization) SetCsv(v *CSVInput) *InputSerialization { return s } +// 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. +type InsufficientCapacityException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"code" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + Type *string `locationName:"type" type:"string"` +} + +// String returns the string representation +func (s InsufficientCapacityException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InsufficientCapacityException) GoString() string { + return s.String() +} + +func newErrorInsufficientCapacityException(v protocol.ResponseMetadata) error { + return &InsufficientCapacityException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InsufficientCapacityException) Code() string { + return "InsufficientCapacityException" +} + +// Message returns the exception's message. +func (s InsufficientCapacityException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InsufficientCapacityException) OrigErr() error { + return nil +} + +func (s InsufficientCapacityException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InsufficientCapacityException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InsufficientCapacityException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returned if a parameter of the request is incorrectly specified. +type InvalidParameterValueException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // 400 Bad Request + Code_ *string `locationName:"code" type:"string"` + + // Returned if a parameter of the request is incorrectly specified. + Message_ *string `locationName:"message" type:"string"` + + // Client + Type *string `locationName:"type" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterValueException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterValueException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterValueException(v protocol.ResponseMetadata) error { + return &InvalidParameterValueException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterValueException) Code() string { + return "InvalidParameterValueException" +} + +// Message returns the exception's message. +func (s InvalidParameterValueException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterValueException) OrigErr() error { + return nil +} + +func (s InvalidParameterValueException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterValueException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterValueException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes the options for a range inventory retrieval job. type InventoryRetrievalJobDescription struct { _ struct{} `type:"structure"` @@ -6680,6 +6813,69 @@ func (s *JobParameters) SetType(v string) *JobParameters { return s } +// Returned if the request results in a vault or account limit being exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // 400 Bad Request + Code_ *string `locationName:"code" type:"string"` + + // Returned if the request results in a vault limit or tags limit being exceeded. + Message_ *string `locationName:"message" type:"string"` + + // Client + Type *string `locationName:"type" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Provides options for retrieving a job list for an Amazon S3 Glacier vault. type ListJobsInput struct { _ struct{} `type:"structure"` @@ -7390,6 +7586,69 @@ func (s *ListVaultsOutput) SetVaultList(v []*DescribeVaultOutput) *ListVaultsOut return s } +// Returned if a required header or parameter is missing from the request. +type MissingParameterValueException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // 400 Bad Request + Code_ *string `locationName:"code" type:"string"` + + // Returned if no authentication data is found for the request. + Message_ *string `locationName:"message" type:"string"` + + // Client. + Type *string `locationName:"type" type:"string"` +} + +// String returns the string representation +func (s MissingParameterValueException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MissingParameterValueException) GoString() string { + return s.String() +} + +func newErrorMissingParameterValueException(v protocol.ResponseMetadata) error { + return &MissingParameterValueException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MissingParameterValueException) Code() string { + return "MissingParameterValueException" +} + +// Message returns the exception's message. +func (s MissingParameterValueException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MissingParameterValueException) OrigErr() error { + return nil +} + +func (s MissingParameterValueException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MissingParameterValueException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MissingParameterValueException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains information about the location where the select job results are // stored. type OutputLocation struct { @@ -7488,6 +7747,70 @@ func (s *PartListElement) SetSHA256TreeHash(v string) *PartListElement { return s } +// Returned if a retrieval job would exceed the current data policy's retrieval +// rate limit. For more information about data retrieval policies, +type PolicyEnforcedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // PolicyEnforcedException + Code_ *string `locationName:"code" type:"string"` + + // InitiateJob request denied by current data retrieval policy. + Message_ *string `locationName:"message" type:"string"` + + // Client + Type *string `locationName:"type" type:"string"` +} + +// String returns the string representation +func (s PolicyEnforcedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyEnforcedException) GoString() string { + return s.String() +} + +func newErrorPolicyEnforcedException(v protocol.ResponseMetadata) error { + return &PolicyEnforcedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PolicyEnforcedException) Code() string { + return "PolicyEnforcedException" +} + +// Message returns the exception's message. +func (s PolicyEnforcedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PolicyEnforcedException) OrigErr() error { + return nil +} + +func (s PolicyEnforcedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PolicyEnforcedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PolicyEnforcedException) RequestID() string { + return s.respMetadata.RequestID +} + // The definition for a provisioned capacity unit. type ProvisionedCapacityDescription struct { _ struct{} `type:"structure"` @@ -7686,6 +8009,136 @@ func (s RemoveTagsFromVaultOutput) GoString() string { return s.String() } +// Returned if, when uploading an archive, Amazon S3 Glacier times out while +// receiving the upload. +type RequestTimeoutException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // 408 Request Timeout + Code_ *string `locationName:"code" type:"string"` + + // Returned if, when uploading an archive, Amazon S3 Glacier times out while + // receiving the upload. + Message_ *string `locationName:"message" type:"string"` + + // Client + Type *string `locationName:"type" type:"string"` +} + +// String returns the string representation +func (s RequestTimeoutException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestTimeoutException) GoString() string { + return s.String() +} + +func newErrorRequestTimeoutException(v protocol.ResponseMetadata) error { + return &RequestTimeoutException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RequestTimeoutException) Code() string { + return "RequestTimeoutException" +} + +// Message returns the exception's message. +func (s RequestTimeoutException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RequestTimeoutException) OrigErr() error { + return nil +} + +func (s RequestTimeoutException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RequestTimeoutException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RequestTimeoutException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returned if the specified resource (such as a vault, upload ID, or job ID) +// doesn't exist. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // 404 Not Found + Code_ *string `locationName:"code" type:"string"` + + // Returned if the specified resource (such as a vault, upload ID, or job ID) + // doesn't exist. + Message_ *string `locationName:"message" type:"string"` + + // Client + Type *string `locationName:"type" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains information about the location in Amazon S3 where the select job // results are stored. type S3Location struct { @@ -7846,6 +8299,69 @@ func (s *SelectParameters) SetOutputSerialization(v *OutputSerialization) *Selec return s } +// Returned if the service cannot complete the request. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // 500 Internal Server Error + Code_ *string `locationName:"code" type:"string"` + + // Returned if the service cannot complete the request. + Message_ *string `locationName:"message" type:"string"` + + // Server + Type *string `locationName:"type" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + // SetDataRetrievalPolicy input. type SetDataRetrievalPolicyInput struct { _ struct{} `type:"structure"` 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 index b3e0922d747..21bf7562da3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/glacier/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/glacier/errors.go @@ -2,6 +2,10 @@ package glacier +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInsufficientCapacityException for service response error code @@ -57,3 +61,14 @@ const ( // Returned if the service cannot complete the request. ErrCodeServiceUnavailableException = "ServiceUnavailableException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InsufficientCapacityException": newErrorInsufficientCapacityException, + "InvalidParameterValueException": newErrorInvalidParameterValueException, + "LimitExceededException": newErrorLimitExceededException, + "MissingParameterValueException": newErrorMissingParameterValueException, + "PolicyEnforcedException": newErrorPolicyEnforcedException, + "RequestTimeoutException": newErrorRequestTimeoutException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ServiceUnavailableException": newErrorServiceUnavailableException, +} 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 index 85e6e367b20..5679e79331f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/glacier/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/glacier/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "glacier" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Glacier" // ServiceID is a unique identifer of a specific service. + ServiceID = "Glacier" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Glacier client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Glacier client from just a session. // svc := glacier.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Glacier { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Glacier { svc := &Glacier{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2012-06-01", }, @@ -71,7 +75,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/api.go b/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/api.go index d86736d9665..1470135e8ab 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/api.go @@ -13,6 +13,107 @@ import ( "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) +const opAdvertiseByoipCidr = "AdvertiseByoipCidr" + +// AdvertiseByoipCidrRequest generates a "aws/request.Request" representing the +// client's request for the AdvertiseByoipCidr operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AdvertiseByoipCidr for more information on using the AdvertiseByoipCidr +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AdvertiseByoipCidrRequest method. +// req, resp := client.AdvertiseByoipCidrRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/AdvertiseByoipCidr +func (c *GlobalAccelerator) AdvertiseByoipCidrRequest(input *AdvertiseByoipCidrInput) (req *request.Request, output *AdvertiseByoipCidrOutput) { + op := &request.Operation{ + Name: opAdvertiseByoipCidr, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AdvertiseByoipCidrInput{} + } + + output = &AdvertiseByoipCidrOutput{} + req = c.newRequest(op, input, output) + return +} + +// AdvertiseByoipCidr API operation for AWS Global Accelerator. +// +// Advertises an IPv4 address range that is provisioned for use with your AWS +// resources through bring your own IP addresses (BYOIP). It can take a few +// minutes before traffic to the specified addresses starts routing to AWS because +// of propagation delays. To see an AWS CLI example of advertising an address +// range, scroll down to Example. +// +// To stop advertising the BYOIP address range, use WithdrawByoipCidr (https://docs.aws.amazon.com/global-accelerator/latest/api/WithdrawByoipCidr.html). +// +// For more information, see Bring Your Own IP Addresses (BYOIP) (https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html) +// in the AWS Global Accelerator 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 Global Accelerator's +// API operation AdvertiseByoipCidr for usage and error information. +// +// Returned Error Types: +// * InternalServiceErrorException +// There was an internal error for AWS Global Accelerator. +// +// * InvalidArgumentException +// An argument that you specified is invalid. +// +// * AccessDeniedException +// You don't have access permission. +// +// * ByoipCidrNotFoundException +// The CIDR that you specified was not found or is incorrect. +// +// * IncorrectCidrStateException +// The CIDR that you specified is not valid for this action. For example, the +// state of the CIDR might be incorrect for this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/AdvertiseByoipCidr +func (c *GlobalAccelerator) AdvertiseByoipCidr(input *AdvertiseByoipCidrInput) (*AdvertiseByoipCidrOutput, error) { + req, out := c.AdvertiseByoipCidrRequest(input) + return out, req.Send() +} + +// AdvertiseByoipCidrWithContext is the same as AdvertiseByoipCidr with the addition of +// the ability to pass a context and additional request options. +// +// See AdvertiseByoipCidr for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GlobalAccelerator) AdvertiseByoipCidrWithContext(ctx aws.Context, input *AdvertiseByoipCidrInput, opts ...request.Option) (*AdvertiseByoipCidrOutput, error) { + req, out := c.AdvertiseByoipCidrRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateAccelerator = "CreateAccelerator" // CreateAcceleratorRequest generates a "aws/request.Request" representing the @@ -62,7 +163,12 @@ func (c *GlobalAccelerator) CreateAcceleratorRequest(input *CreateAcceleratorInp // each of which includes endpoints, such as Network Load Balancers. To see // an AWS CLI example of creating an accelerator, scroll down to Example. // -// You must specify the US-West-2 (Oregon) Region to create or update accelerators. +// If you bring your own IP address ranges to AWS Global Accelerator (BYOIP), +// you can assign IP addresses from your own pool to your accelerator as the +// static IP address entry points. Only one IP address from each of your IP +// address ranges can be used for each accelerator. +// +// You must specify the US West (Oregon) Region to create or update accelerators. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -71,14 +177,14 @@ func (c *GlobalAccelerator) CreateAcceleratorRequest(input *CreateAcceleratorInp // See the AWS API reference guide for AWS Global Accelerator's // API operation CreateAccelerator for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// Returned Error Types: +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // An argument that you specified is invalid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Processing your request would cause you to exceed an AWS Global Accelerator // limit. // @@ -159,27 +265,27 @@ func (c *GlobalAccelerator) CreateEndpointGroupRequest(input *CreateEndpointGrou // See the AWS API reference guide for AWS Global Accelerator's // API operation CreateEndpointGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeAcceleratorNotFoundException "AcceleratorNotFoundException" +// Returned Error Types: +// * AcceleratorNotFoundException // The accelerator that you specified doesn't exist. // -// * ErrCodeEndpointGroupAlreadyExistsException "EndpointGroupAlreadyExistsException" +// * EndpointGroupAlreadyExistsException // The endpoint group that you specified already exists. // -// * ErrCodeListenerNotFoundException "ListenerNotFoundException" +// * ListenerNotFoundException // The listener that you specified doesn't exist. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // An argument that you specified is invalid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Processing your request would cause you to exceed an AWS Global Accelerator // limit. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You don't have access permission. // // See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/CreateEndpointGroup @@ -260,21 +366,21 @@ func (c *GlobalAccelerator) CreateListenerRequest(input *CreateListenerInput) (r // See the AWS API reference guide for AWS Global Accelerator's // API operation CreateListener for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // An argument that you specified is invalid. // -// * ErrCodeAcceleratorNotFoundException "AcceleratorNotFoundException" +// * AcceleratorNotFoundException // The accelerator that you specified doesn't exist. // -// * ErrCodeInvalidPortRangeException "InvalidPortRangeException" +// * InvalidPortRangeException // The port numbers that you specified are not valid numbers or are not unique // for this accelerator. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Processing your request would cause you to exceed an AWS Global Accelerator // limit. // @@ -345,8 +451,24 @@ func (c *GlobalAccelerator) DeleteAcceleratorRequest(input *DeleteAcceleratorInp // DeleteAccelerator API operation for AWS Global Accelerator. // -// Delete an accelerator. Note: before you can delete an accelerator, you must -// disable it and remove all dependent resources (listeners and endpoint groups). +// Delete an accelerator. Before you can delete an accelerator, you must disable +// it and remove all dependent resources (listeners and endpoint groups). To +// disable the accelerator, update the accelerator to set Enabled to false. +// +// When you create an accelerator, by default, Global Accelerator provides you +// with a set of two static IP addresses. Alternatively, you can bring your +// own IP address ranges to Global Accelerator and assign IP addresses from +// those ranges. +// +// The IP addresses are assigned to your accelerator for as long as it exists, +// even if you disable the accelerator and it no longer accepts or routes traffic. +// However, when you delete an accelerator, you lose the static IP addresses +// that are assigned to the accelerator, so you can no longer route traffic +// by using them. As a best practice, ensure that you have permissions in place +// to avoid inadvertently deleting accelerators. You can use IAM policies with +// Global Accelerator to limit the users who have permissions to delete an accelerator. +// For more information, see Authentication and Access Control (https://docs.aws.amazon.com/global-accelerator/latest/dg/auth-and-access-control.html) +// in the AWS Global Accelerator 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 @@ -355,22 +477,22 @@ func (c *GlobalAccelerator) DeleteAcceleratorRequest(input *DeleteAcceleratorInp // See the AWS API reference guide for AWS Global Accelerator's // API operation DeleteAccelerator for usage and error information. // -// Returned Error Codes: -// * ErrCodeAcceleratorNotFoundException "AcceleratorNotFoundException" +// Returned Error Types: +// * AcceleratorNotFoundException // The accelerator that you specified doesn't exist. // -// * ErrCodeAcceleratorNotDisabledException "AcceleratorNotDisabledException" +// * AcceleratorNotDisabledException // The accelerator that you specified could not be disabled. // -// * ErrCodeAssociatedListenerFoundException "AssociatedListenerFoundException" +// * AssociatedListenerFoundException // The accelerator that you specified has a listener associated with it. You // must remove all dependent resources from an accelerator before you can delete // it. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // An argument that you specified is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/DeleteAccelerator @@ -449,14 +571,14 @@ func (c *GlobalAccelerator) DeleteEndpointGroupRequest(input *DeleteEndpointGrou // See the AWS API reference guide for AWS Global Accelerator's // API operation DeleteEndpointGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // An argument that you specified is invalid. // -// * ErrCodeEndpointGroupNotFoundException "EndpointGroupNotFoundException" +// * EndpointGroupNotFoundException // The endpoint group that you specified doesn't exist. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // // See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/DeleteEndpointGroup @@ -535,19 +657,19 @@ func (c *GlobalAccelerator) DeleteListenerRequest(input *DeleteListenerInput) (r // See the AWS API reference guide for AWS Global Accelerator's // API operation DeleteListener for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // An argument that you specified is invalid. // -// * ErrCodeListenerNotFoundException "ListenerNotFoundException" +// * ListenerNotFoundException // The listener that you specified doesn't exist. // -// * ErrCodeAssociatedEndpointGroupFoundException "AssociatedEndpointGroupFoundException" +// * AssociatedEndpointGroupFoundException // The listener that you specified has an endpoint group associated with it. // You must remove all dependent resources from a listener before you can delete // it. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // // See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/DeleteListener @@ -572,6 +694,109 @@ func (c *GlobalAccelerator) DeleteListenerWithContext(ctx aws.Context, input *De return out, req.Send() } +const opDeprovisionByoipCidr = "DeprovisionByoipCidr" + +// DeprovisionByoipCidrRequest generates a "aws/request.Request" representing the +// client's request for the DeprovisionByoipCidr operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeprovisionByoipCidr for more information on using the DeprovisionByoipCidr +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeprovisionByoipCidrRequest method. +// req, resp := client.DeprovisionByoipCidrRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/DeprovisionByoipCidr +func (c *GlobalAccelerator) DeprovisionByoipCidrRequest(input *DeprovisionByoipCidrInput) (req *request.Request, output *DeprovisionByoipCidrOutput) { + op := &request.Operation{ + Name: opDeprovisionByoipCidr, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeprovisionByoipCidrInput{} + } + + output = &DeprovisionByoipCidrOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeprovisionByoipCidr API operation for AWS Global Accelerator. +// +// Releases the specified address range that you provisioned to use with your +// AWS resources through bring your own IP addresses (BYOIP) and deletes the +// corresponding address pool. To see an AWS CLI example of deprovisioning an +// address range, scroll down to Example. +// +// Before you can release an address range, you must stop advertising it by +// using WithdrawByoipCidr (https://docs.aws.amazon.com/global-accelerator/latest/api/WithdrawByoipCidr.html) +// and you must not have any accelerators that are using static IP addresses +// allocated from its address range. +// +// For more information, see Bring Your Own IP Addresses (BYOIP) (https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html) +// in the AWS Global Accelerator 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 Global Accelerator's +// API operation DeprovisionByoipCidr for usage and error information. +// +// Returned Error Types: +// * InternalServiceErrorException +// There was an internal error for AWS Global Accelerator. +// +// * InvalidArgumentException +// An argument that you specified is invalid. +// +// * AccessDeniedException +// You don't have access permission. +// +// * ByoipCidrNotFoundException +// The CIDR that you specified was not found or is incorrect. +// +// * IncorrectCidrStateException +// The CIDR that you specified is not valid for this action. For example, the +// state of the CIDR might be incorrect for this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/DeprovisionByoipCidr +func (c *GlobalAccelerator) DeprovisionByoipCidr(input *DeprovisionByoipCidrInput) (*DeprovisionByoipCidrOutput, error) { + req, out := c.DeprovisionByoipCidrRequest(input) + return out, req.Send() +} + +// DeprovisionByoipCidrWithContext is the same as DeprovisionByoipCidr with the addition of +// the ability to pass a context and additional request options. +// +// See DeprovisionByoipCidr for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GlobalAccelerator) DeprovisionByoipCidrWithContext(ctx aws.Context, input *DeprovisionByoipCidrInput, opts ...request.Option) (*DeprovisionByoipCidrOutput, error) { + req, out := c.DeprovisionByoipCidrRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeAccelerator = "DescribeAccelerator" // DescribeAcceleratorRequest generates a "aws/request.Request" representing the @@ -626,14 +851,14 @@ func (c *GlobalAccelerator) DescribeAcceleratorRequest(input *DescribeAccelerato // See the AWS API reference guide for AWS Global Accelerator's // API operation DescribeAccelerator for usage and error information. // -// Returned Error Codes: -// * ErrCodeAcceleratorNotFoundException "AcceleratorNotFoundException" +// Returned Error Types: +// * AcceleratorNotFoundException // The accelerator that you specified doesn't exist. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // An argument that you specified is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/DescribeAccelerator @@ -702,7 +927,8 @@ func (c *GlobalAccelerator) DescribeAcceleratorAttributesRequest(input *Describe // DescribeAcceleratorAttributes API operation for AWS Global Accelerator. // -// Describe the attributes of an accelerator. +// Describe the attributes of an accelerator. To see an AWS CLI example of describing +// the attributes of an accelerator, scroll down to Example. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -711,14 +937,14 @@ func (c *GlobalAccelerator) DescribeAcceleratorAttributesRequest(input *Describe // See the AWS API reference guide for AWS Global Accelerator's // API operation DescribeAcceleratorAttributes for usage and error information. // -// Returned Error Codes: -// * ErrCodeAcceleratorNotFoundException "AcceleratorNotFoundException" +// Returned Error Types: +// * AcceleratorNotFoundException // The accelerator that you specified doesn't exist. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // An argument that you specified is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/DescribeAcceleratorAttributes @@ -796,14 +1022,14 @@ func (c *GlobalAccelerator) DescribeEndpointGroupRequest(input *DescribeEndpoint // See the AWS API reference guide for AWS Global Accelerator's // API operation DescribeEndpointGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // An argument that you specified is invalid. // -// * ErrCodeEndpointGroupNotFoundException "EndpointGroupNotFoundException" +// * EndpointGroupNotFoundException // The endpoint group that you specified doesn't exist. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // // See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/DescribeEndpointGroup @@ -872,7 +1098,8 @@ func (c *GlobalAccelerator) DescribeListenerRequest(input *DescribeListenerInput // DescribeListener API operation for AWS Global Accelerator. // -// Describe a listener. +// Describe a listener. To see an AWS CLI example of describing a listener, +// scroll down to Example. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -881,14 +1108,14 @@ func (c *GlobalAccelerator) DescribeListenerRequest(input *DescribeListenerInput // See the AWS API reference guide for AWS Global Accelerator's // API operation DescribeListener for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // An argument that you specified is invalid. // -// * ErrCodeListenerNotFoundException "ListenerNotFoundException" +// * ListenerNotFoundException // The listener that you specified doesn't exist. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // // See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/DescribeListener @@ -957,7 +1184,8 @@ func (c *GlobalAccelerator) ListAcceleratorsRequest(input *ListAcceleratorsInput // ListAccelerators API operation for AWS Global Accelerator. // -// List the accelerators for an AWS account. +// List the accelerators for an AWS account. To see an AWS CLI example of listing +// the accelerators for an AWS account, scroll down to Example. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -966,14 +1194,14 @@ func (c *GlobalAccelerator) ListAcceleratorsRequest(input *ListAcceleratorsInput // See the AWS API reference guide for AWS Global Accelerator's // API operation ListAccelerators for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // An argument that you specified is invalid. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // There isn't another item to return. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // // See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/ListAccelerators @@ -998,6 +1226,98 @@ func (c *GlobalAccelerator) ListAcceleratorsWithContext(ctx aws.Context, input * return out, req.Send() } +const opListByoipCidrs = "ListByoipCidrs" + +// ListByoipCidrsRequest generates a "aws/request.Request" representing the +// client's request for the ListByoipCidrs operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListByoipCidrs for more information on using the ListByoipCidrs +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListByoipCidrsRequest method. +// req, resp := client.ListByoipCidrsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/ListByoipCidrs +func (c *GlobalAccelerator) ListByoipCidrsRequest(input *ListByoipCidrsInput) (req *request.Request, output *ListByoipCidrsOutput) { + op := &request.Operation{ + Name: opListByoipCidrs, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListByoipCidrsInput{} + } + + output = &ListByoipCidrsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListByoipCidrs API operation for AWS Global Accelerator. +// +// Lists the IP address ranges that were specified in calls to ProvisionByoipCidr +// (https://docs.aws.amazon.com/global-accelerator/latest/api/ProvisionByoipCidr.html). +// +// To see an AWS CLI example of listing BYOIP CIDR addresses, scroll down to +// Example. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Global Accelerator's +// API operation ListByoipCidrs for usage and error information. +// +// Returned Error Types: +// * InternalServiceErrorException +// There was an internal error for AWS Global Accelerator. +// +// * InvalidArgumentException +// An argument that you specified is invalid. +// +// * AccessDeniedException +// You don't have access permission. +// +// * InvalidNextTokenException +// There isn't another item to return. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/ListByoipCidrs +func (c *GlobalAccelerator) ListByoipCidrs(input *ListByoipCidrsInput) (*ListByoipCidrsOutput, error) { + req, out := c.ListByoipCidrsRequest(input) + return out, req.Send() +} + +// ListByoipCidrsWithContext is the same as ListByoipCidrs with the addition of +// the ability to pass a context and additional request options. +// +// See ListByoipCidrs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GlobalAccelerator) ListByoipCidrsWithContext(ctx aws.Context, input *ListByoipCidrsInput, opts ...request.Option) (*ListByoipCidrsOutput, error) { + req, out := c.ListByoipCidrsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opListEndpointGroups = "ListEndpointGroups" // ListEndpointGroupsRequest generates a "aws/request.Request" representing the @@ -1042,7 +1362,8 @@ func (c *GlobalAccelerator) ListEndpointGroupsRequest(input *ListEndpointGroupsI // ListEndpointGroups API operation for AWS Global Accelerator. // -// List the endpoint groups that are associated with a listener. +// List the endpoint groups that are associated with a listener. To see an AWS +// CLI example of listing the endpoint groups for listener, scroll down to Example. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1051,17 +1372,17 @@ func (c *GlobalAccelerator) ListEndpointGroupsRequest(input *ListEndpointGroupsI // See the AWS API reference guide for AWS Global Accelerator's // API operation ListEndpointGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeListenerNotFoundException "ListenerNotFoundException" +// Returned Error Types: +// * ListenerNotFoundException // The listener that you specified doesn't exist. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // There isn't another item to return. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // An argument that you specified is invalid. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // // See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/ListEndpointGroups @@ -1130,7 +1451,8 @@ func (c *GlobalAccelerator) ListListenersRequest(input *ListListenersInput) (req // ListListeners API operation for AWS Global Accelerator. // -// List the listeners for an accelerator. +// List the listeners for an accelerator. To see an AWS CLI example of listing +// the listeners for an accelerator, scroll down to Example. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1139,17 +1461,17 @@ func (c *GlobalAccelerator) ListListenersRequest(input *ListListenersInput) (req // See the AWS API reference guide for AWS Global Accelerator's // API operation ListListeners for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // An argument that you specified is invalid. // -// * ErrCodeAcceleratorNotFoundException "AcceleratorNotFoundException" +// * AcceleratorNotFoundException // The accelerator that you specified doesn't exist. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // There isn't another item to return. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // // See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/ListListeners @@ -1174,673 +1496,2665 @@ func (c *GlobalAccelerator) ListListenersWithContext(ctx aws.Context, input *Lis return out, req.Send() } -const opUpdateAccelerator = "UpdateAccelerator" +const opListTagsForResource = "ListTagsForResource" -// UpdateAcceleratorRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAccelerator operation. The "output" return +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateAccelerator for more information on using the UpdateAccelerator +// See ListTagsForResource for more information on using the ListTagsForResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateAcceleratorRequest method. -// req, resp := client.UpdateAcceleratorRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateAccelerator -func (c *GlobalAccelerator) UpdateAcceleratorRequest(input *UpdateAcceleratorInput) (req *request.Request, output *UpdateAcceleratorOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/ListTagsForResource +func (c *GlobalAccelerator) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { op := &request.Operation{ - Name: opUpdateAccelerator, + Name: opListTagsForResource, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateAcceleratorInput{} + input = &ListTagsForResourceInput{} } - output = &UpdateAcceleratorOutput{} + output = &ListTagsForResourceOutput{} req = c.newRequest(op, input, output) return } -// UpdateAccelerator API operation for AWS Global Accelerator. +// ListTagsForResource API operation for AWS Global Accelerator. // -// Update an accelerator. To see an AWS CLI example of updating an accelerator, -// scroll down to Example. +// List all tags for an accelerator. To see an AWS CLI example of listing tags +// for an accelerator, scroll down to Example. // -// You must specify the US-West-2 (Oregon) Region to create or update accelerators. +// For more information, see Tagging in AWS Global Accelerator (https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html) +// in the AWS Global Accelerator 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 Global Accelerator's -// API operation UpdateAccelerator for usage and error information. +// API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeAcceleratorNotFoundException "AcceleratorNotFoundException" +// Returned Error Types: +// * AcceleratorNotFoundException // The accelerator that you specified doesn't exist. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // An argument that you specified is invalid. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateAccelerator -func (c *GlobalAccelerator) UpdateAccelerator(input *UpdateAcceleratorInput) (*UpdateAcceleratorOutput, error) { - req, out := c.UpdateAcceleratorRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/ListTagsForResource +func (c *GlobalAccelerator) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) return out, req.Send() } -// UpdateAcceleratorWithContext is the same as UpdateAccelerator with the addition of +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of // the ability to pass a context and additional request options. // -// See UpdateAccelerator for details on how to use this API operation. +// See ListTagsForResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *GlobalAccelerator) UpdateAcceleratorWithContext(ctx aws.Context, input *UpdateAcceleratorInput, opts ...request.Option) (*UpdateAcceleratorOutput, error) { - req, out := c.UpdateAcceleratorRequest(input) +func (c *GlobalAccelerator) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateAcceleratorAttributes = "UpdateAcceleratorAttributes" +const opProvisionByoipCidr = "ProvisionByoipCidr" -// UpdateAcceleratorAttributesRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAcceleratorAttributes operation. The "output" return +// ProvisionByoipCidrRequest generates a "aws/request.Request" representing the +// client's request for the ProvisionByoipCidr operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateAcceleratorAttributes for more information on using the UpdateAcceleratorAttributes +// See ProvisionByoipCidr for more information on using the ProvisionByoipCidr // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateAcceleratorAttributesRequest method. -// req, resp := client.UpdateAcceleratorAttributesRequest(params) +// // Example sending a request using the ProvisionByoipCidrRequest method. +// req, resp := client.ProvisionByoipCidrRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateAcceleratorAttributes -func (c *GlobalAccelerator) UpdateAcceleratorAttributesRequest(input *UpdateAcceleratorAttributesInput) (req *request.Request, output *UpdateAcceleratorAttributesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/ProvisionByoipCidr +func (c *GlobalAccelerator) ProvisionByoipCidrRequest(input *ProvisionByoipCidrInput) (req *request.Request, output *ProvisionByoipCidrOutput) { op := &request.Operation{ - Name: opUpdateAcceleratorAttributes, + Name: opProvisionByoipCidr, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateAcceleratorAttributesInput{} + input = &ProvisionByoipCidrInput{} } - output = &UpdateAcceleratorAttributesOutput{} + output = &ProvisionByoipCidrOutput{} req = c.newRequest(op, input, output) return } -// UpdateAcceleratorAttributes API operation for AWS Global Accelerator. +// ProvisionByoipCidr API operation for AWS Global Accelerator. // -// Update the attributes for an accelerator. To see an AWS CLI example of updating -// an accelerator to enable flow logs, scroll down to Example. +// Provisions an IP address range to use with your AWS resources through bring +// your own IP addresses (BYOIP) and creates a corresponding address pool. After +// the address range is provisioned, it is ready to be advertised using AdvertiseByoipCidr +// (https://docs.aws.amazon.com/global-accelerator/latest/api/AdvertiseByoipCidr.html). +// +// To see an AWS CLI example of provisioning an address range for BYOIP, scroll +// down to Example. +// +// For more information, see Bring Your Own IP Addresses (BYOIP) (https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html) +// in the AWS Global Accelerator 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 Global Accelerator's -// API operation UpdateAcceleratorAttributes for usage and error information. +// API operation ProvisionByoipCidr for usage and error information. // -// Returned Error Codes: -// * ErrCodeAcceleratorNotFoundException "AcceleratorNotFoundException" -// The accelerator that you specified doesn't exist. -// -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// Returned Error Types: +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // An argument that you specified is invalid. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * LimitExceededException +// Processing your request would cause you to exceed an AWS Global Accelerator +// limit. +// +// * AccessDeniedException // You don't have access permission. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateAcceleratorAttributes -func (c *GlobalAccelerator) UpdateAcceleratorAttributes(input *UpdateAcceleratorAttributesInput) (*UpdateAcceleratorAttributesOutput, error) { - req, out := c.UpdateAcceleratorAttributesRequest(input) +// * IncorrectCidrStateException +// The CIDR that you specified is not valid for this action. For example, the +// state of the CIDR might be incorrect for this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/ProvisionByoipCidr +func (c *GlobalAccelerator) ProvisionByoipCidr(input *ProvisionByoipCidrInput) (*ProvisionByoipCidrOutput, error) { + req, out := c.ProvisionByoipCidrRequest(input) return out, req.Send() } -// UpdateAcceleratorAttributesWithContext is the same as UpdateAcceleratorAttributes with the addition of +// ProvisionByoipCidrWithContext is the same as ProvisionByoipCidr with the addition of // the ability to pass a context and additional request options. // -// See UpdateAcceleratorAttributes for details on how to use this API operation. +// See ProvisionByoipCidr for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *GlobalAccelerator) UpdateAcceleratorAttributesWithContext(ctx aws.Context, input *UpdateAcceleratorAttributesInput, opts ...request.Option) (*UpdateAcceleratorAttributesOutput, error) { - req, out := c.UpdateAcceleratorAttributesRequest(input) +func (c *GlobalAccelerator) ProvisionByoipCidrWithContext(ctx aws.Context, input *ProvisionByoipCidrInput, opts ...request.Option) (*ProvisionByoipCidrOutput, error) { + req, out := c.ProvisionByoipCidrRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateEndpointGroup = "UpdateEndpointGroup" +const opTagResource = "TagResource" -// UpdateEndpointGroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateEndpointGroup operation. The "output" return +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateEndpointGroup for more information on using the UpdateEndpointGroup +// See TagResource for more information on using the TagResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateEndpointGroupRequest method. -// req, resp := client.UpdateEndpointGroupRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateEndpointGroup -func (c *GlobalAccelerator) UpdateEndpointGroupRequest(input *UpdateEndpointGroupInput) (req *request.Request, output *UpdateEndpointGroupOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/TagResource +func (c *GlobalAccelerator) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { op := &request.Operation{ - Name: opUpdateEndpointGroup, + Name: opTagResource, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateEndpointGroupInput{} + input = &TagResourceInput{} } - output = &UpdateEndpointGroupOutput{} + output = &TagResourceOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateEndpointGroup API operation for AWS Global Accelerator. +// TagResource API operation for AWS Global Accelerator. // -// Update an endpoint group. To see an AWS CLI example of updating an endpoint -// group, scroll down to Example. +// Add tags to an accelerator resource. To see an AWS CLI example of adding +// tags to an accelerator, scroll down to Example. +// +// For more information, see Tagging in AWS Global Accelerator (https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html) +// in the AWS Global Accelerator 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 Global Accelerator's -// API operation UpdateEndpointGroup for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// An argument that you specified is invalid. +// API operation TagResource for usage and error information. // -// * ErrCodeEndpointGroupNotFoundException "EndpointGroupNotFoundException" -// The endpoint group that you specified doesn't exist. +// Returned Error Types: +// * AcceleratorNotFoundException +// The accelerator that you specified doesn't exist. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // -// * ErrCodeLimitExceededException "LimitExceededException" -// Processing your request would cause you to exceed an AWS Global Accelerator -// limit. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access permission. +// * InvalidArgumentException +// An argument that you specified is invalid. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateEndpointGroup -func (c *GlobalAccelerator) UpdateEndpointGroup(input *UpdateEndpointGroupInput) (*UpdateEndpointGroupOutput, error) { - req, out := c.UpdateEndpointGroupRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/TagResource +func (c *GlobalAccelerator) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) return out, req.Send() } -// UpdateEndpointGroupWithContext is the same as UpdateEndpointGroup with the addition of +// TagResourceWithContext is the same as TagResource with the addition of // the ability to pass a context and additional request options. // -// See UpdateEndpointGroup for details on how to use this API operation. +// See TagResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *GlobalAccelerator) UpdateEndpointGroupWithContext(ctx aws.Context, input *UpdateEndpointGroupInput, opts ...request.Option) (*UpdateEndpointGroupOutput, error) { - req, out := c.UpdateEndpointGroupRequest(input) +func (c *GlobalAccelerator) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateListener = "UpdateListener" +const opUntagResource = "UntagResource" -// UpdateListenerRequest generates a "aws/request.Request" representing the -// client's request for the UpdateListener operation. The "output" return +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateListener for more information on using the UpdateListener +// See UntagResource for more information on using the UntagResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateListenerRequest method. -// req, resp := client.UpdateListenerRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateListener -func (c *GlobalAccelerator) UpdateListenerRequest(input *UpdateListenerInput) (req *request.Request, output *UpdateListenerOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UntagResource +func (c *GlobalAccelerator) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { op := &request.Operation{ - Name: opUpdateListener, + Name: opUntagResource, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateListenerInput{} + input = &UntagResourceInput{} } - output = &UpdateListenerOutput{} + output = &UntagResourceOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateListener API operation for AWS Global Accelerator. +// UntagResource API operation for AWS Global Accelerator. +// +// Remove tags from a Global Accelerator resource. When you specify a tag key, +// the action removes both that key and its associated value. To see an AWS +// CLI example of removing tags from an accelerator, scroll down to Example. +// The operation succeeds even if you attempt to remove tags from an accelerator +// that was already removed. // -// Update a listener. +// For more information, see Tagging in AWS Global Accelerator (https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html) +// in the AWS Global Accelerator 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 Global Accelerator's -// API operation UpdateListener for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// An argument that you specified is invalid. -// -// * ErrCodeInvalidPortRangeException "InvalidPortRangeException" -// The port numbers that you specified are not valid numbers or are not unique -// for this accelerator. +// API operation UntagResource for usage and error information. // -// * ErrCodeListenerNotFoundException "ListenerNotFoundException" -// The listener that you specified doesn't exist. +// Returned Error Types: +// * AcceleratorNotFoundException +// The accelerator that you specified doesn't exist. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // There was an internal error for AWS Global Accelerator. // -// * ErrCodeLimitExceededException "LimitExceededException" -// Processing your request would cause you to exceed an AWS Global Accelerator -// limit. +// * InvalidArgumentException +// An argument that you specified is invalid. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateListener -func (c *GlobalAccelerator) UpdateListener(input *UpdateListenerInput) (*UpdateListenerOutput, error) { - req, out := c.UpdateListenerRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UntagResource +func (c *GlobalAccelerator) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) return out, req.Send() } -// UpdateListenerWithContext is the same as UpdateListener with the addition of +// UntagResourceWithContext is the same as UntagResource with the addition of // the ability to pass a context and additional request options. // -// See UpdateListener for details on how to use this API operation. +// See UntagResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *GlobalAccelerator) UpdateListenerWithContext(ctx aws.Context, input *UpdateListenerInput, opts ...request.Option) (*UpdateListenerOutput, error) { - req, out := c.UpdateListenerRequest(input) +func (c *GlobalAccelerator) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// An accelerator is a complex type that includes one or more listeners that -// process inbound connections and then direct traffic to one or more endpoint -// groups, each of which includes endpoints, such as load balancers. -type Accelerator struct { - _ struct{} `type:"structure"` +const opUpdateAccelerator = "UpdateAccelerator" - // The Amazon Resource Name (ARN) of the accelerator. - AcceleratorArn *string `type:"string"` +// UpdateAcceleratorRequest generates a "aws/request.Request" representing the +// client's request for the UpdateAccelerator operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateAccelerator for more information on using the UpdateAccelerator +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateAcceleratorRequest method. +// req, resp := client.UpdateAcceleratorRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateAccelerator +func (c *GlobalAccelerator) UpdateAcceleratorRequest(input *UpdateAcceleratorInput) (req *request.Request, output *UpdateAcceleratorOutput) { + op := &request.Operation{ + Name: opUpdateAccelerator, + HTTPMethod: "POST", + HTTPPath: "/", + } - // The date and time that the accelerator was created. - CreatedTime *time.Time `type:"timestamp"` + if input == nil { + input = &UpdateAcceleratorInput{} + } - // The Domain Name System (DNS) name that Global Accelerator creates that points - // to your accelerator's static IP addresses. - // - // The naming convention for the DNS name is: a lower case letter a, followed - // by a 16-bit random hex string, followed by .awsglobalaccelerator.com. For - // example: a1234567890abcdef.awsglobalaccelerator.com. - // - // For more information about the default DNS name, see Support for DNS Addressing - // in Global Accelerator (https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html#about-accelerators.dns-addressing) - // in the AWS Global Accelerator Developer Guide. - DnsName *string `type:"string"` + output = &UpdateAcceleratorOutput{} + req = c.newRequest(op, input, output) + return +} - // Indicates whether the accelerator is enabled. The value is true or false. - // The default value is true. - // - // If the value is set to true, the accelerator cannot be deleted. If set to - // false, accelerator can be deleted. - Enabled *bool `type:"boolean"` +// UpdateAccelerator API operation for AWS Global Accelerator. +// +// Update an accelerator. To see an AWS CLI example of updating an accelerator, +// scroll down to Example. +// +// You must specify the US West (Oregon) Region to create or update accelerators. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Global Accelerator's +// API operation UpdateAccelerator for usage and error information. +// +// Returned Error Types: +// * AcceleratorNotFoundException +// The accelerator that you specified doesn't exist. +// +// * InternalServiceErrorException +// There was an internal error for AWS Global Accelerator. +// +// * InvalidArgumentException +// An argument that you specified is invalid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateAccelerator +func (c *GlobalAccelerator) UpdateAccelerator(input *UpdateAcceleratorInput) (*UpdateAcceleratorOutput, error) { + req, out := c.UpdateAcceleratorRequest(input) + return out, req.Send() +} - // The value for the address type must be IPv4. - IpAddressType *string `type:"string" enum:"IpAddressType"` +// UpdateAcceleratorWithContext is the same as UpdateAccelerator with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAccelerator for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GlobalAccelerator) UpdateAcceleratorWithContext(ctx aws.Context, input *UpdateAcceleratorInput, opts ...request.Option) (*UpdateAcceleratorOutput, error) { + req, out := c.UpdateAcceleratorRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} - // The static IP addresses that Global Accelerator associates with the accelerator. - IpSets []*IpSet `type:"list"` +const opUpdateAcceleratorAttributes = "UpdateAcceleratorAttributes" - // The date and time that the accelerator was last modified. - LastModifiedTime *time.Time `type:"timestamp"` +// UpdateAcceleratorAttributesRequest generates a "aws/request.Request" representing the +// client's request for the UpdateAcceleratorAttributes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateAcceleratorAttributes for more information on using the UpdateAcceleratorAttributes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateAcceleratorAttributesRequest method. +// req, resp := client.UpdateAcceleratorAttributesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateAcceleratorAttributes +func (c *GlobalAccelerator) UpdateAcceleratorAttributesRequest(input *UpdateAcceleratorAttributesInput) (req *request.Request, output *UpdateAcceleratorAttributesOutput) { + op := &request.Operation{ + Name: opUpdateAcceleratorAttributes, + HTTPMethod: "POST", + HTTPPath: "/", + } - // The name of the accelerator. The name must contain only alphanumeric characters - // or hyphens (-), and must not begin or end with a hyphen. - Name *string `type:"string"` + if input == nil { + input = &UpdateAcceleratorAttributesInput{} + } - // Describes the deployment status of the accelerator. - Status *string `type:"string" enum:"AcceleratorStatus"` + output = &UpdateAcceleratorAttributesOutput{} + req = c.newRequest(op, input, output) + return } -// String returns the string representation -func (s Accelerator) String() string { - return awsutil.Prettify(s) +// UpdateAcceleratorAttributes API operation for AWS Global Accelerator. +// +// Update the attributes for an accelerator. To see an AWS CLI example of updating +// an accelerator to enable flow logs, scroll down to Example. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Global Accelerator's +// API operation UpdateAcceleratorAttributes for usage and error information. +// +// Returned Error Types: +// * AcceleratorNotFoundException +// The accelerator that you specified doesn't exist. +// +// * InternalServiceErrorException +// There was an internal error for AWS Global Accelerator. +// +// * InvalidArgumentException +// An argument that you specified is invalid. +// +// * AccessDeniedException +// You don't have access permission. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateAcceleratorAttributes +func (c *GlobalAccelerator) UpdateAcceleratorAttributes(input *UpdateAcceleratorAttributesInput) (*UpdateAcceleratorAttributesOutput, error) { + req, out := c.UpdateAcceleratorAttributesRequest(input) + return out, req.Send() } -// GoString returns the string representation -func (s Accelerator) GoString() string { - return s.String() +// UpdateAcceleratorAttributesWithContext is the same as UpdateAcceleratorAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAcceleratorAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GlobalAccelerator) UpdateAcceleratorAttributesWithContext(ctx aws.Context, input *UpdateAcceleratorAttributesInput, opts ...request.Option) (*UpdateAcceleratorAttributesOutput, error) { + req, out := c.UpdateAcceleratorAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -// SetAcceleratorArn sets the AcceleratorArn field's value. -func (s *Accelerator) SetAcceleratorArn(v string) *Accelerator { - s.AcceleratorArn = &v - return s -} +const opUpdateEndpointGroup = "UpdateEndpointGroup" -// SetCreatedTime sets the CreatedTime field's value. -func (s *Accelerator) SetCreatedTime(v time.Time) *Accelerator { - s.CreatedTime = &v - return s +// UpdateEndpointGroupRequest generates a "aws/request.Request" representing the +// client's request for the UpdateEndpointGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateEndpointGroup for more information on using the UpdateEndpointGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateEndpointGroupRequest method. +// req, resp := client.UpdateEndpointGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateEndpointGroup +func (c *GlobalAccelerator) UpdateEndpointGroupRequest(input *UpdateEndpointGroupInput) (req *request.Request, output *UpdateEndpointGroupOutput) { + op := &request.Operation{ + Name: opUpdateEndpointGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateEndpointGroupInput{} + } + + output = &UpdateEndpointGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateEndpointGroup API operation for AWS Global Accelerator. +// +// Update an endpoint group. To see an AWS CLI example of updating an endpoint +// group, scroll down to Example. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Global Accelerator's +// API operation UpdateEndpointGroup for usage and error information. +// +// Returned Error Types: +// * InvalidArgumentException +// An argument that you specified is invalid. +// +// * EndpointGroupNotFoundException +// The endpoint group that you specified doesn't exist. +// +// * InternalServiceErrorException +// There was an internal error for AWS Global Accelerator. +// +// * LimitExceededException +// Processing your request would cause you to exceed an AWS Global Accelerator +// limit. +// +// * AccessDeniedException +// You don't have access permission. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateEndpointGroup +func (c *GlobalAccelerator) UpdateEndpointGroup(input *UpdateEndpointGroupInput) (*UpdateEndpointGroupOutput, error) { + req, out := c.UpdateEndpointGroupRequest(input) + return out, req.Send() +} + +// UpdateEndpointGroupWithContext is the same as UpdateEndpointGroup with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateEndpointGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GlobalAccelerator) UpdateEndpointGroupWithContext(ctx aws.Context, input *UpdateEndpointGroupInput, opts ...request.Option) (*UpdateEndpointGroupOutput, error) { + req, out := c.UpdateEndpointGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateListener = "UpdateListener" + +// UpdateListenerRequest generates a "aws/request.Request" representing the +// client's request for the UpdateListener operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateListener for more information on using the UpdateListener +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateListenerRequest method. +// req, resp := client.UpdateListenerRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateListener +func (c *GlobalAccelerator) UpdateListenerRequest(input *UpdateListenerInput) (req *request.Request, output *UpdateListenerOutput) { + op := &request.Operation{ + Name: opUpdateListener, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateListenerInput{} + } + + output = &UpdateListenerOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateListener API operation for AWS Global Accelerator. +// +// Update a listener. To see an AWS CLI example of updating listener, scroll +// down to Example. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Global Accelerator's +// API operation UpdateListener for usage and error information. +// +// Returned Error Types: +// * InvalidArgumentException +// An argument that you specified is invalid. +// +// * InvalidPortRangeException +// The port numbers that you specified are not valid numbers or are not unique +// for this accelerator. +// +// * ListenerNotFoundException +// The listener that you specified doesn't exist. +// +// * InternalServiceErrorException +// There was an internal error for AWS Global Accelerator. +// +// * LimitExceededException +// Processing your request would cause you to exceed an AWS Global Accelerator +// limit. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/UpdateListener +func (c *GlobalAccelerator) UpdateListener(input *UpdateListenerInput) (*UpdateListenerOutput, error) { + req, out := c.UpdateListenerRequest(input) + return out, req.Send() +} + +// UpdateListenerWithContext is the same as UpdateListener with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateListener for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GlobalAccelerator) UpdateListenerWithContext(ctx aws.Context, input *UpdateListenerInput, opts ...request.Option) (*UpdateListenerOutput, error) { + req, out := c.UpdateListenerRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opWithdrawByoipCidr = "WithdrawByoipCidr" + +// WithdrawByoipCidrRequest generates a "aws/request.Request" representing the +// client's request for the WithdrawByoipCidr operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See WithdrawByoipCidr for more information on using the WithdrawByoipCidr +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the WithdrawByoipCidrRequest method. +// req, resp := client.WithdrawByoipCidrRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/WithdrawByoipCidr +func (c *GlobalAccelerator) WithdrawByoipCidrRequest(input *WithdrawByoipCidrInput) (req *request.Request, output *WithdrawByoipCidrOutput) { + op := &request.Operation{ + Name: opWithdrawByoipCidr, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &WithdrawByoipCidrInput{} + } + + output = &WithdrawByoipCidrOutput{} + req = c.newRequest(op, input, output) + return +} + +// WithdrawByoipCidr API operation for AWS Global Accelerator. +// +// Stops advertising an address range that is provisioned as an address pool. +// You can perform this operation at most once every 10 seconds, even if you +// specify different address ranges each time. To see an AWS CLI example of +// withdrawing an address range for BYOIP so it will no longer be advertised +// by AWS, scroll down to Example. +// +// It can take a few minutes before traffic to the specified addresses stops +// routing to AWS because of propagation delays. +// +// For more information, see Bring Your Own IP Addresses (BYOIP) (https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html) +// in the AWS Global Accelerator 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 Global Accelerator's +// API operation WithdrawByoipCidr for usage and error information. +// +// Returned Error Types: +// * InternalServiceErrorException +// There was an internal error for AWS Global Accelerator. +// +// * InvalidArgumentException +// An argument that you specified is invalid. +// +// * AccessDeniedException +// You don't have access permission. +// +// * ByoipCidrNotFoundException +// The CIDR that you specified was not found or is incorrect. +// +// * IncorrectCidrStateException +// The CIDR that you specified is not valid for this action. For example, the +// state of the CIDR might be incorrect for this action. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08/WithdrawByoipCidr +func (c *GlobalAccelerator) WithdrawByoipCidr(input *WithdrawByoipCidrInput) (*WithdrawByoipCidrOutput, error) { + req, out := c.WithdrawByoipCidrRequest(input) + return out, req.Send() +} + +// WithdrawByoipCidrWithContext is the same as WithdrawByoipCidr with the addition of +// the ability to pass a context and additional request options. +// +// See WithdrawByoipCidr for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GlobalAccelerator) WithdrawByoipCidrWithContext(ctx aws.Context, input *WithdrawByoipCidrInput, opts ...request.Option) (*WithdrawByoipCidrOutput, error) { + req, out := c.WithdrawByoipCidrRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// An accelerator is a complex type that includes one or more listeners that +// process inbound connections and then direct traffic to one or more endpoint +// groups, each of which includes endpoints, such as load balancers. +type Accelerator struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the accelerator. + AcceleratorArn *string `type:"string"` + + // The date and time that the accelerator was created. + CreatedTime *time.Time `type:"timestamp"` + + // The Domain Name System (DNS) name that Global Accelerator creates that points + // to your accelerator's static IP addresses. + // + // The naming convention for the DNS name is the following: A lowercase letter + // a, followed by a 16-bit random hex string, followed by .awsglobalaccelerator.com. + // For example: a1234567890abcdef.awsglobalaccelerator.com. + // + // For more information about the default DNS name, see Support for DNS Addressing + // in Global Accelerator (https://docs.aws.amazon.com/global-accelerator/latest/dg/about-accelerators.html#about-accelerators.dns-addressing) + // in the AWS Global Accelerator Developer Guide. + DnsName *string `type:"string"` + + // Indicates whether the accelerator is enabled. The value is true or false. + // The default value is true. + // + // If the value is set to true, the accelerator cannot be deleted. If set to + // false, accelerator can be deleted. + Enabled *bool `type:"boolean"` + + // The value for the address type must be IPv4. + IpAddressType *string `type:"string" enum:"IpAddressType"` + + // The static IP addresses that Global Accelerator associates with the accelerator. + IpSets []*IpSet `type:"list"` + + // The date and time that the accelerator was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The name of the accelerator. The name must contain only alphanumeric characters + // or hyphens (-), and must not begin or end with a hyphen. + Name *string `type:"string"` + + // Describes the deployment status of the accelerator. + Status *string `type:"string" enum:"AcceleratorStatus"` +} + +// String returns the string representation +func (s Accelerator) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Accelerator) GoString() string { + return s.String() +} + +// SetAcceleratorArn sets the AcceleratorArn field's value. +func (s *Accelerator) SetAcceleratorArn(v string) *Accelerator { + s.AcceleratorArn = &v + return s +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *Accelerator) SetCreatedTime(v time.Time) *Accelerator { + s.CreatedTime = &v + return s +} + +// SetDnsName sets the DnsName field's value. +func (s *Accelerator) SetDnsName(v string) *Accelerator { + s.DnsName = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *Accelerator) SetEnabled(v bool) *Accelerator { + s.Enabled = &v + return s +} + +// SetIpAddressType sets the IpAddressType field's value. +func (s *Accelerator) SetIpAddressType(v string) *Accelerator { + s.IpAddressType = &v + return s +} + +// SetIpSets sets the IpSets field's value. +func (s *Accelerator) SetIpSets(v []*IpSet) *Accelerator { + s.IpSets = v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *Accelerator) SetLastModifiedTime(v time.Time) *Accelerator { + s.LastModifiedTime = &v + return s +} + +// SetName sets the Name field's value. +func (s *Accelerator) SetName(v string) *Accelerator { + s.Name = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *Accelerator) SetStatus(v string) *Accelerator { + s.Status = &v + return s +} + +// Attributes of an accelerator. +type AcceleratorAttributes struct { + _ struct{} `type:"structure"` + + // Indicates whether flow logs are enabled. The default value is false. If the + // value is true, FlowLogsS3Bucket and FlowLogsS3Prefix must be specified. + // + // For more information, see Flow Logs (https://docs.aws.amazon.com/global-accelerator/latest/dg/monitoring-global-accelerator.flow-logs.html) + // in the AWS Global Accelerator Developer Guide. + FlowLogsEnabled *bool `type:"boolean"` + + // The name of the Amazon S3 bucket for the flow logs. Attribute is required + // if FlowLogsEnabled is true. The bucket must exist and have a bucket policy + // that grants AWS Global Accelerator permission to write to the bucket. + FlowLogsS3Bucket *string `type:"string"` + + // The prefix for the location in the Amazon S3 bucket for the flow logs. Attribute + // is required if FlowLogsEnabled is true. + // + // If you don’t specify a prefix, the flow logs are stored in the root of + // the bucket. If you specify slash (/) for the S3 bucket prefix, the log file + // bucket folder structure will include a double slash (//), like the following: + // + // s3-bucket_name//AWSLogs/aws_account_id + FlowLogsS3Prefix *string `type:"string"` +} + +// String returns the string representation +func (s AcceleratorAttributes) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AcceleratorAttributes) GoString() string { + return s.String() +} + +// SetFlowLogsEnabled sets the FlowLogsEnabled field's value. +func (s *AcceleratorAttributes) SetFlowLogsEnabled(v bool) *AcceleratorAttributes { + s.FlowLogsEnabled = &v + return s +} + +// SetFlowLogsS3Bucket sets the FlowLogsS3Bucket field's value. +func (s *AcceleratorAttributes) SetFlowLogsS3Bucket(v string) *AcceleratorAttributes { + s.FlowLogsS3Bucket = &v + return s +} + +// SetFlowLogsS3Prefix sets the FlowLogsS3Prefix field's value. +func (s *AcceleratorAttributes) SetFlowLogsS3Prefix(v string) *AcceleratorAttributes { + s.FlowLogsS3Prefix = &v + return s +} + +// The accelerator that you specified could not be disabled. +type AcceleratorNotDisabledException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AcceleratorNotDisabledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AcceleratorNotDisabledException) GoString() string { + return s.String() +} + +func newErrorAcceleratorNotDisabledException(v protocol.ResponseMetadata) error { + return &AcceleratorNotDisabledException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AcceleratorNotDisabledException) Code() string { + return "AcceleratorNotDisabledException" +} + +// Message returns the exception's message. +func (s AcceleratorNotDisabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AcceleratorNotDisabledException) OrigErr() error { + return nil +} + +func (s AcceleratorNotDisabledException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AcceleratorNotDisabledException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AcceleratorNotDisabledException) RequestID() string { + return s.respMetadata.RequestID +} + +// The accelerator that you specified doesn't exist. +type AcceleratorNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AcceleratorNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AcceleratorNotFoundException) GoString() string { + return s.String() +} + +func newErrorAcceleratorNotFoundException(v protocol.ResponseMetadata) error { + return &AcceleratorNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AcceleratorNotFoundException) Code() string { + return "AcceleratorNotFoundException" +} + +// Message returns the exception's message. +func (s AcceleratorNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AcceleratorNotFoundException) OrigErr() error { + return nil +} + +func (s AcceleratorNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AcceleratorNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AcceleratorNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// You don't have access permission. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +type AdvertiseByoipCidrInput struct { + _ struct{} `type:"structure"` + + // The address range, in CIDR notation. This must be the exact range that you + // provisioned. You can't advertise only a portion of the provisioned range. + // + // Cidr is a required field + Cidr *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AdvertiseByoipCidrInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AdvertiseByoipCidrInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AdvertiseByoipCidrInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AdvertiseByoipCidrInput"} + if s.Cidr == nil { + invalidParams.Add(request.NewErrParamRequired("Cidr")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCidr sets the Cidr field's value. +func (s *AdvertiseByoipCidrInput) SetCidr(v string) *AdvertiseByoipCidrInput { + s.Cidr = &v + return s +} + +type AdvertiseByoipCidrOutput struct { + _ struct{} `type:"structure"` + + // Information about the address range. + ByoipCidr *ByoipCidr `type:"structure"` +} + +// String returns the string representation +func (s AdvertiseByoipCidrOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AdvertiseByoipCidrOutput) GoString() string { + return s.String() +} + +// SetByoipCidr sets the ByoipCidr field's value. +func (s *AdvertiseByoipCidrOutput) SetByoipCidr(v *ByoipCidr) *AdvertiseByoipCidrOutput { + s.ByoipCidr = v + return s +} + +// The listener that you specified has an endpoint group associated with it. +// You must remove all dependent resources from a listener before you can delete +// it. +type AssociatedEndpointGroupFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AssociatedEndpointGroupFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociatedEndpointGroupFoundException) GoString() string { + return s.String() +} + +func newErrorAssociatedEndpointGroupFoundException(v protocol.ResponseMetadata) error { + return &AssociatedEndpointGroupFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AssociatedEndpointGroupFoundException) Code() string { + return "AssociatedEndpointGroupFoundException" +} + +// Message returns the exception's message. +func (s AssociatedEndpointGroupFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AssociatedEndpointGroupFoundException) OrigErr() error { + return nil +} + +func (s AssociatedEndpointGroupFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AssociatedEndpointGroupFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AssociatedEndpointGroupFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The accelerator that you specified has a listener associated with it. You +// must remove all dependent resources from an accelerator before you can delete +// it. +type AssociatedListenerFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AssociatedListenerFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociatedListenerFoundException) GoString() string { + return s.String() +} + +func newErrorAssociatedListenerFoundException(v protocol.ResponseMetadata) error { + return &AssociatedListenerFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AssociatedListenerFoundException) Code() string { + return "AssociatedListenerFoundException" +} + +// Message returns the exception's message. +func (s AssociatedListenerFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AssociatedListenerFoundException) OrigErr() error { + return nil +} + +func (s AssociatedListenerFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AssociatedListenerFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AssociatedListenerFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about an IP address range that is provisioned for use with your +// AWS resources through bring your own IP addresses (BYOIP). +// +// The following describes each BYOIP State that your IP address range can be +// in. +// +// * PENDING_PROVISIONING — You’ve submitted a request to provision an +// IP address range but it is not yet provisioned with AWS Global Accelerator. +// +// * READY — The address range is provisioned with AWS Global Accelerator +// and can be advertised. +// +// * PENDING_ADVERTISING — You’ve submitted a request for AWS Global +// Accelerator to advertise an address range but it is not yet being advertised. +// +// * ADVERTISING — The address range is being advertised by AWS Global +// Accelerator. +// +// * PENDING_WITHDRAWING — You’ve submitted a request to withdraw an +// address range from being advertised but it is still being advertised by +// AWS Global Accelerator. +// +// * PENDING_DEPROVISIONING — You’ve submitted a request to deprovision +// an address range from AWS Global Accelerator but it is still provisioned. +// +// * DEPROVISIONED — The address range is deprovisioned from AWS Global +// Accelerator. +// +// * FAILED_PROVISION — The request to provision the address range from +// AWS Global Accelerator was not successful. Please make sure that you provide +// all of the correct information, and try again. If the request fails a +// second time, contact AWS support. +// +// * FAILED_ADVERTISING — The request for AWS Global Accelerator to advertise +// the address range was not successful. Please make sure that you provide +// all of the correct information, and try again. If the request fails a +// second time, contact AWS support. +// +// * FAILED_WITHDRAW — The request to withdraw the address range from advertising +// by AWS Global Accelerator was not successful. Please make sure that you +// provide all of the correct information, and try again. If the request +// fails a second time, contact AWS support. +// +// * FAILED_DEPROVISION — The request to deprovision the address range +// from AWS Global Accelerator was not successful. Please make sure that +// you provide all of the correct information, and try again. If the request +// fails a second time, contact AWS support. +type ByoipCidr struct { + _ struct{} `type:"structure"` + + // The address range, in CIDR notation. + Cidr *string `type:"string"` + + // The state of the address pool. + State *string `type:"string" enum:"ByoipCidrState"` +} + +// String returns the string representation +func (s ByoipCidr) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ByoipCidr) GoString() string { + return s.String() +} + +// SetCidr sets the Cidr field's value. +func (s *ByoipCidr) SetCidr(v string) *ByoipCidr { + s.Cidr = &v + return s +} + +// SetState sets the State field's value. +func (s *ByoipCidr) SetState(v string) *ByoipCidr { + s.State = &v + return s +} + +// The CIDR that you specified was not found or is incorrect. +type ByoipCidrNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ByoipCidrNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ByoipCidrNotFoundException) GoString() string { + return s.String() +} + +func newErrorByoipCidrNotFoundException(v protocol.ResponseMetadata) error { + return &ByoipCidrNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ByoipCidrNotFoundException) Code() string { + return "ByoipCidrNotFoundException" +} + +// Message returns the exception's message. +func (s ByoipCidrNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ByoipCidrNotFoundException) OrigErr() error { + return nil +} + +func (s ByoipCidrNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ByoipCidrNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ByoipCidrNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Provides authorization for Amazon to bring a specific IP address range to +// a specific AWS account using bring your own IP addresses (BYOIP). +// +// For more information, see Bring Your Own IP Addresses (BYOIP) (https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html) +// in the AWS Global Accelerator Developer Guide. +type CidrAuthorizationContext struct { + _ struct{} `type:"structure"` + + // The plain-text authorization message for the prefix and account. + // + // Message is a required field + Message *string `type:"string" required:"true"` + + // The signed authorization message for the prefix and account. + // + // Signature is a required field + Signature *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CidrAuthorizationContext) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CidrAuthorizationContext) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CidrAuthorizationContext) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CidrAuthorizationContext"} + if s.Message == nil { + invalidParams.Add(request.NewErrParamRequired("Message")) + } + if s.Signature == nil { + invalidParams.Add(request.NewErrParamRequired("Signature")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMessage sets the Message field's value. +func (s *CidrAuthorizationContext) SetMessage(v string) *CidrAuthorizationContext { + s.Message = &v + return s +} + +// SetSignature sets the Signature field's value. +func (s *CidrAuthorizationContext) SetSignature(v string) *CidrAuthorizationContext { + s.Signature = &v + return s +} + +type CreateAcceleratorInput struct { + _ struct{} `type:"structure"` + + // Indicates whether an accelerator is enabled. The value is true or false. + // The default value is true. + // + // If the value is set to true, an accelerator cannot be deleted. If set to + // false, the accelerator can be deleted. + Enabled *bool `type:"boolean"` + + // A unique, case-sensitive identifier that you provide to ensure the idempotency—that + // is, the uniqueness—of an accelerator. + IdempotencyToken *string `type:"string" idempotencyToken:"true"` + + // The value for the address type must be IPv4. + IpAddressType *string `type:"string" enum:"IpAddressType"` + + // Optionally, if you've added your own IP address pool to Global Accelerator, + // you can choose IP addresses from your own pool to use for the accelerator's + // static IP addresses. You can specify one or two addresses, separated by a + // comma. Do not include the /32 suffix. + // + // If you specify only one IP address from your IP address range, Global Accelerator + // assigns a second static IP address for the accelerator from the AWS IP address + // pool. + // + // For more information, see Bring Your Own IP Addresses (BYOIP) (https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html) + // in the AWS Global Accelerator Developer Guide. + IpAddresses []*string `type:"list"` + + // The name of an accelerator. The name 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"` + + // Create tags for an accelerator. + // + // For more information, see Tagging in AWS Global Accelerator (https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html) + // in the AWS Global Accelerator Developer Guide. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s CreateAcceleratorInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAcceleratorInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateAcceleratorInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateAcceleratorInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + 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 +} + +// SetEnabled sets the Enabled field's value. +func (s *CreateAcceleratorInput) SetEnabled(v bool) *CreateAcceleratorInput { + s.Enabled = &v + return s +} + +// SetIdempotencyToken sets the IdempotencyToken field's value. +func (s *CreateAcceleratorInput) SetIdempotencyToken(v string) *CreateAcceleratorInput { + s.IdempotencyToken = &v + return s +} + +// SetIpAddressType sets the IpAddressType field's value. +func (s *CreateAcceleratorInput) SetIpAddressType(v string) *CreateAcceleratorInput { + s.IpAddressType = &v + return s +} + +// SetIpAddresses sets the IpAddresses field's value. +func (s *CreateAcceleratorInput) SetIpAddresses(v []*string) *CreateAcceleratorInput { + s.IpAddresses = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateAcceleratorInput) SetName(v string) *CreateAcceleratorInput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateAcceleratorInput) SetTags(v []*Tag) *CreateAcceleratorInput { + s.Tags = v + return s +} + +type CreateAcceleratorOutput struct { + _ struct{} `type:"structure"` + + // The accelerator that is created by specifying a listener and the supported + // IP address types. + Accelerator *Accelerator `type:"structure"` +} + +// String returns the string representation +func (s CreateAcceleratorOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAcceleratorOutput) GoString() string { + return s.String() +} + +// SetAccelerator sets the Accelerator field's value. +func (s *CreateAcceleratorOutput) SetAccelerator(v *Accelerator) *CreateAcceleratorOutput { + s.Accelerator = v + return s +} + +type CreateEndpointGroupInput struct { + _ struct{} `type:"structure"` + + // The list of endpoint objects. + EndpointConfigurations []*EndpointConfiguration `type:"list"` + + // The name of the AWS Region where the endpoint group is located. A listener + // can have only one endpoint group in a specific Region. + // + // EndpointGroupRegion is a required field + EndpointGroupRegion *string `type:"string" required:"true"` + + // The time—10 seconds or 30 seconds—between each health check for an endpoint. + // The default value is 30. + HealthCheckIntervalSeconds *int64 `min:"10" type:"integer"` + + // If the protocol is HTTP/S, then this specifies the path that is the destination + // for health check targets. The default value is slash (/). + HealthCheckPath *string `type:"string"` + + // The port that AWS Global Accelerator uses to check the health of endpoints + // that are part of this endpoint group. The default port is the listener port + // that this endpoint group is associated with. If listener port is a list of + // ports, Global Accelerator uses the first port in the list. + HealthCheckPort *int64 `min:"1" type:"integer"` + + // The protocol that AWS Global Accelerator uses to check the health of endpoints + // that are part of this endpoint group. The default value is TCP. + HealthCheckProtocol *string `type:"string" enum:"HealthCheckProtocol"` + + // A unique, case-sensitive identifier that you provide to ensure the idempotency—that + // is, the uniqueness—of the request. + IdempotencyToken *string `type:"string" idempotencyToken:"true"` + + // The Amazon Resource Name (ARN) of the listener. + // + // ListenerArn is a required field + ListenerArn *string `type:"string" required:"true"` + + // The number of consecutive health checks required to set the state of a healthy + // endpoint to unhealthy, or to set an unhealthy endpoint to healthy. The default + // value is 3. + ThresholdCount *int64 `min:"1" type:"integer"` + + // The percentage of traffic to send to an AWS Region. Additional traffic is + // distributed to other endpoint groups for this listener. + // + // Use this action to increase (dial up) or decrease (dial down) traffic to + // a specific Region. The percentage is applied to the traffic that would otherwise + // have been routed to the Region based on optimal routing. + // + // The default value is 100. + TrafficDialPercentage *float64 `type:"float"` +} + +// String returns the string representation +func (s CreateEndpointGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateEndpointGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateEndpointGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateEndpointGroupInput"} + if s.EndpointGroupRegion == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointGroupRegion")) + } + if s.HealthCheckIntervalSeconds != nil && *s.HealthCheckIntervalSeconds < 10 { + invalidParams.Add(request.NewErrParamMinValue("HealthCheckIntervalSeconds", 10)) + } + if s.HealthCheckPort != nil && *s.HealthCheckPort < 1 { + invalidParams.Add(request.NewErrParamMinValue("HealthCheckPort", 1)) + } + if s.ListenerArn == nil { + invalidParams.Add(request.NewErrParamRequired("ListenerArn")) + } + if s.ThresholdCount != nil && *s.ThresholdCount < 1 { + invalidParams.Add(request.NewErrParamMinValue("ThresholdCount", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEndpointConfigurations sets the EndpointConfigurations field's value. +func (s *CreateEndpointGroupInput) SetEndpointConfigurations(v []*EndpointConfiguration) *CreateEndpointGroupInput { + s.EndpointConfigurations = v + return s +} + +// SetEndpointGroupRegion sets the EndpointGroupRegion field's value. +func (s *CreateEndpointGroupInput) SetEndpointGroupRegion(v string) *CreateEndpointGroupInput { + s.EndpointGroupRegion = &v + return s +} + +// SetHealthCheckIntervalSeconds sets the HealthCheckIntervalSeconds field's value. +func (s *CreateEndpointGroupInput) SetHealthCheckIntervalSeconds(v int64) *CreateEndpointGroupInput { + s.HealthCheckIntervalSeconds = &v + return s +} + +// SetHealthCheckPath sets the HealthCheckPath field's value. +func (s *CreateEndpointGroupInput) SetHealthCheckPath(v string) *CreateEndpointGroupInput { + s.HealthCheckPath = &v + return s +} + +// SetHealthCheckPort sets the HealthCheckPort field's value. +func (s *CreateEndpointGroupInput) SetHealthCheckPort(v int64) *CreateEndpointGroupInput { + s.HealthCheckPort = &v + return s +} + +// SetHealthCheckProtocol sets the HealthCheckProtocol field's value. +func (s *CreateEndpointGroupInput) SetHealthCheckProtocol(v string) *CreateEndpointGroupInput { + s.HealthCheckProtocol = &v + return s +} + +// SetIdempotencyToken sets the IdempotencyToken field's value. +func (s *CreateEndpointGroupInput) SetIdempotencyToken(v string) *CreateEndpointGroupInput { + s.IdempotencyToken = &v + return s +} + +// SetListenerArn sets the ListenerArn field's value. +func (s *CreateEndpointGroupInput) SetListenerArn(v string) *CreateEndpointGroupInput { + s.ListenerArn = &v + return s +} + +// SetThresholdCount sets the ThresholdCount field's value. +func (s *CreateEndpointGroupInput) SetThresholdCount(v int64) *CreateEndpointGroupInput { + s.ThresholdCount = &v + return s +} + +// SetTrafficDialPercentage sets the TrafficDialPercentage field's value. +func (s *CreateEndpointGroupInput) SetTrafficDialPercentage(v float64) *CreateEndpointGroupInput { + s.TrafficDialPercentage = &v + return s +} + +type CreateEndpointGroupOutput struct { + _ struct{} `type:"structure"` + + // The information about the endpoint group that was created. + EndpointGroup *EndpointGroup `type:"structure"` +} + +// String returns the string representation +func (s CreateEndpointGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateEndpointGroupOutput) GoString() string { + return s.String() +} + +// SetEndpointGroup sets the EndpointGroup field's value. +func (s *CreateEndpointGroupOutput) SetEndpointGroup(v *EndpointGroup) *CreateEndpointGroupOutput { + s.EndpointGroup = v + return s +} + +type CreateListenerInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of your accelerator. + // + // AcceleratorArn is a required field + AcceleratorArn *string `type:"string" required:"true"` + + // Client affinity lets you direct all requests from a user to the same endpoint, + // if you have stateful applications, regardless of the port and protocol of + // the client request. Clienty affinity gives you control over whether to always + // route each client to the same specific endpoint. + // + // AWS Global Accelerator uses a consistent-flow hashing algorithm to choose + // the optimal endpoint for a connection. If client affinity is NONE, Global + // Accelerator uses the "five-tuple" (5-tuple) properties—source IP address, + // source port, destination IP address, destination port, and protocol—to + // select the hash value, and then chooses the best endpoint. However, with + // this setting, if someone uses different ports to connect to Global Accelerator, + // their connections might not be always routed to the same endpoint because + // the hash value changes. + // + // If you want a given client to always be routed to the same endpoint, set + // client affinity to SOURCE_IP instead. When you use the SOURCE_IP setting, + // Global Accelerator uses the "two-tuple" (2-tuple) properties— source (client) + // IP address and destination IP address—to select the hash value. + // + // The default value is NONE. + ClientAffinity *string `type:"string" enum:"ClientAffinity"` + + // A unique, case-sensitive identifier that you provide to ensure the idempotency—that + // is, the uniqueness—of the request. + IdempotencyToken *string `type:"string" idempotencyToken:"true"` + + // The list of port ranges to support for connections from clients to your accelerator. + // + // PortRanges is a required field + PortRanges []*PortRange `min:"1" type:"list" required:"true"` + + // The protocol for connections from clients to your accelerator. + // + // Protocol is a required field + Protocol *string `type:"string" required:"true" enum:"Protocol"` +} + +// 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.AcceleratorArn == nil { + invalidParams.Add(request.NewErrParamRequired("AcceleratorArn")) + } + if s.PortRanges == nil { + invalidParams.Add(request.NewErrParamRequired("PortRanges")) + } + if s.PortRanges != nil && len(s.PortRanges) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PortRanges", 1)) + } + if s.Protocol == nil { + invalidParams.Add(request.NewErrParamRequired("Protocol")) + } + if s.PortRanges != nil { + for i, v := range s.PortRanges { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PortRanges", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAcceleratorArn sets the AcceleratorArn field's value. +func (s *CreateListenerInput) SetAcceleratorArn(v string) *CreateListenerInput { + s.AcceleratorArn = &v + return s +} + +// SetClientAffinity sets the ClientAffinity field's value. +func (s *CreateListenerInput) SetClientAffinity(v string) *CreateListenerInput { + s.ClientAffinity = &v + return s +} + +// SetIdempotencyToken sets the IdempotencyToken field's value. +func (s *CreateListenerInput) SetIdempotencyToken(v string) *CreateListenerInput { + s.IdempotencyToken = &v + return s +} + +// SetPortRanges sets the PortRanges field's value. +func (s *CreateListenerInput) SetPortRanges(v []*PortRange) *CreateListenerInput { + s.PortRanges = v + return s +} + +// SetProtocol sets the Protocol field's value. +func (s *CreateListenerInput) SetProtocol(v string) *CreateListenerInput { + s.Protocol = &v + return s +} + +type CreateListenerOutput struct { + _ struct{} `type:"structure"` + + // The listener that you've created. + Listener *Listener `type:"structure"` +} + +// 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() +} + +// SetListener sets the Listener field's value. +func (s *CreateListenerOutput) SetListener(v *Listener) *CreateListenerOutput { + s.Listener = v + return s +} + +type DeleteAcceleratorInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of an accelerator. + // + // AcceleratorArn is a required field + AcceleratorArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteAcceleratorInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAcceleratorInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteAcceleratorInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteAcceleratorInput"} + if s.AcceleratorArn == nil { + invalidParams.Add(request.NewErrParamRequired("AcceleratorArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAcceleratorArn sets the AcceleratorArn field's value. +func (s *DeleteAcceleratorInput) SetAcceleratorArn(v string) *DeleteAcceleratorInput { + s.AcceleratorArn = &v + return s +} + +type DeleteAcceleratorOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteAcceleratorOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAcceleratorOutput) GoString() string { + return s.String() +} + +type DeleteEndpointGroupInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the endpoint group to delete. + // + // EndpointGroupArn is a required field + EndpointGroupArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteEndpointGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteEndpointGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteEndpointGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteEndpointGroupInput"} + if s.EndpointGroupArn == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointGroupArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEndpointGroupArn sets the EndpointGroupArn field's value. +func (s *DeleteEndpointGroupInput) SetEndpointGroupArn(v string) *DeleteEndpointGroupInput { + s.EndpointGroupArn = &v + return s +} + +type DeleteEndpointGroupOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteEndpointGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteEndpointGroupOutput) GoString() string { + return s.String() +} + +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 +} + +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() +} + +type DeprovisionByoipCidrInput struct { + _ struct{} `type:"structure"` + + // The address range, in CIDR notation. The prefix must be the same prefix that + // you specified when you provisioned the address range. + // + // Cidr is a required field + Cidr *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeprovisionByoipCidrInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeprovisionByoipCidrInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeprovisionByoipCidrInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeprovisionByoipCidrInput"} + if s.Cidr == nil { + invalidParams.Add(request.NewErrParamRequired("Cidr")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCidr sets the Cidr field's value. +func (s *DeprovisionByoipCidrInput) SetCidr(v string) *DeprovisionByoipCidrInput { + s.Cidr = &v + return s +} + +type DeprovisionByoipCidrOutput struct { + _ struct{} `type:"structure"` + + // Information about the address range. + ByoipCidr *ByoipCidr `type:"structure"` +} + +// String returns the string representation +func (s DeprovisionByoipCidrOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeprovisionByoipCidrOutput) GoString() string { + return s.String() +} + +// SetByoipCidr sets the ByoipCidr field's value. +func (s *DeprovisionByoipCidrOutput) SetByoipCidr(v *ByoipCidr) *DeprovisionByoipCidrOutput { + s.ByoipCidr = v + return s +} + +type DescribeAcceleratorAttributesInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the accelerator with the attributes that + // you want to describe. + // + // AcceleratorArn is a required field + AcceleratorArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeAcceleratorAttributesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAcceleratorAttributesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeAcceleratorAttributesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeAcceleratorAttributesInput"} + if s.AcceleratorArn == nil { + invalidParams.Add(request.NewErrParamRequired("AcceleratorArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAcceleratorArn sets the AcceleratorArn field's value. +func (s *DescribeAcceleratorAttributesInput) SetAcceleratorArn(v string) *DescribeAcceleratorAttributesInput { + s.AcceleratorArn = &v + return s +} + +type DescribeAcceleratorAttributesOutput struct { + _ struct{} `type:"structure"` + + // The attributes of the accelerator. + AcceleratorAttributes *AcceleratorAttributes `type:"structure"` +} + +// String returns the string representation +func (s DescribeAcceleratorAttributesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAcceleratorAttributesOutput) GoString() string { + return s.String() +} + +// SetAcceleratorAttributes sets the AcceleratorAttributes field's value. +func (s *DescribeAcceleratorAttributesOutput) SetAcceleratorAttributes(v *AcceleratorAttributes) *DescribeAcceleratorAttributesOutput { + s.AcceleratorAttributes = v + return s +} + +type DescribeAcceleratorInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the accelerator to describe. + // + // AcceleratorArn is a required field + AcceleratorArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeAcceleratorInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAcceleratorInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeAcceleratorInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeAcceleratorInput"} + if s.AcceleratorArn == nil { + invalidParams.Add(request.NewErrParamRequired("AcceleratorArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAcceleratorArn sets the AcceleratorArn field's value. +func (s *DescribeAcceleratorInput) SetAcceleratorArn(v string) *DescribeAcceleratorInput { + s.AcceleratorArn = &v + return s +} + +type DescribeAcceleratorOutput struct { + _ struct{} `type:"structure"` + + // The description of the accelerator. + Accelerator *Accelerator `type:"structure"` +} + +// String returns the string representation +func (s DescribeAcceleratorOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAcceleratorOutput) GoString() string { + return s.String() +} + +// SetAccelerator sets the Accelerator field's value. +func (s *DescribeAcceleratorOutput) SetAccelerator(v *Accelerator) *DescribeAcceleratorOutput { + s.Accelerator = v + return s +} + +type DescribeEndpointGroupInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the endpoint group to describe. + // + // EndpointGroupArn is a required field + EndpointGroupArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeEndpointGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEndpointGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeEndpointGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeEndpointGroupInput"} + if s.EndpointGroupArn == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointGroupArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEndpointGroupArn sets the EndpointGroupArn field's value. +func (s *DescribeEndpointGroupInput) SetEndpointGroupArn(v string) *DescribeEndpointGroupInput { + s.EndpointGroupArn = &v + return s +} + +type DescribeEndpointGroupOutput struct { + _ struct{} `type:"structure"` + + // The description of an endpoint group. + EndpointGroup *EndpointGroup `type:"structure"` +} + +// String returns the string representation +func (s DescribeEndpointGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEndpointGroupOutput) GoString() string { + return s.String() +} + +// SetEndpointGroup sets the EndpointGroup field's value. +func (s *DescribeEndpointGroupOutput) SetEndpointGroup(v *EndpointGroup) *DescribeEndpointGroupOutput { + s.EndpointGroup = v + return s +} + +type DescribeListenerInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the listener to describe. + // + // ListenerArn is a required field + ListenerArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeListenerInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeListenerInput) GoString() string { + return s.String() } -// SetDnsName sets the DnsName field's value. -func (s *Accelerator) SetDnsName(v string) *Accelerator { - s.DnsName = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeListenerInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeListenerInput"} + if s.ListenerArn == nil { + invalidParams.Add(request.NewErrParamRequired("ListenerArn")) + } -// SetEnabled sets the Enabled field's value. -func (s *Accelerator) SetEnabled(v bool) *Accelerator { - s.Enabled = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetIpAddressType sets the IpAddressType field's value. -func (s *Accelerator) SetIpAddressType(v string) *Accelerator { - s.IpAddressType = &v +// SetListenerArn sets the ListenerArn field's value. +func (s *DescribeListenerInput) SetListenerArn(v string) *DescribeListenerInput { + s.ListenerArn = &v return s } -// SetIpSets sets the IpSets field's value. -func (s *Accelerator) SetIpSets(v []*IpSet) *Accelerator { - s.IpSets = v - return s +type DescribeListenerOutput struct { + _ struct{} `type:"structure"` + + // The description of a listener. + Listener *Listener `type:"structure"` } -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *Accelerator) SetLastModifiedTime(v time.Time) *Accelerator { - s.LastModifiedTime = &v - return s +// String returns the string representation +func (s DescribeListenerOutput) String() string { + return awsutil.Prettify(s) } -// SetName sets the Name field's value. -func (s *Accelerator) SetName(v string) *Accelerator { - s.Name = &v - return s +// GoString returns the string representation +func (s DescribeListenerOutput) GoString() string { + return s.String() } -// SetStatus sets the Status field's value. -func (s *Accelerator) SetStatus(v string) *Accelerator { - s.Status = &v +// SetListener sets the Listener field's value. +func (s *DescribeListenerOutput) SetListener(v *Listener) *DescribeListenerOutput { + s.Listener = v return s } -// Attributes of an accelerator. -type AcceleratorAttributes struct { +// A complex type for endpoints. +type EndpointConfiguration struct { _ struct{} `type:"structure"` - // Indicates whether flow logs are enabled. The default value is false. If the - // value is true, FlowLogsS3Bucket and FlowLogsS3Prefix must be specified. + // Indicates whether client IP address preservation is enabled for an Application + // Load Balancer endpoint. The value is true or false. The default value is + // true for new accelerators. // - // For more information, see Flow Logs (https://docs.aws.amazon.com/global-accelerator/latest/dg/monitoring-global-accelerator.flow-logs.html) + // If the value is set to true, the client's IP address is preserved in the + // X-Forwarded-For request header as traffic travels to applications on the + // Application Load Balancer endpoint fronted by the accelerator. + // + // For more information, see Viewing Client IP Addresses in AWS Global Accelerator + // (https://docs.aws.amazon.com/global-accelerator/latest/dg/introduction-how-it-works-client-ip.html) // in the AWS Global Accelerator Developer Guide. - FlowLogsEnabled *bool `type:"boolean"` + ClientIPPreservationEnabled *bool `type:"boolean"` - // The name of the Amazon S3 bucket for the flow logs. Attribute is required - // if FlowLogsEnabled is true. The bucket must exist and have a bucket policy - // that grants AWS Global Accelerator permission to write to the bucket. - FlowLogsS3Bucket *string `type:"string"` + // An ID for the endpoint. If the endpoint is a Network Load Balancer or Application + // Load Balancer, this is the Amazon Resource Name (ARN) of the resource. If + // the endpoint is an Elastic IP address, this is the Elastic IP address allocation + // ID. For EC2 instances, this is the EC2 instance ID. + // + // An Application Load Balancer can be either internal or internet-facing. + EndpointId *string `type:"string"` - // The prefix for the location in the Amazon S3 bucket for the flow logs. Attribute - // is required if FlowLogsEnabled is true. If you don’t specify a prefix, - // the flow logs are stored in the root of the bucket. - FlowLogsS3Prefix *string `type:"string"` + // The weight associated with the endpoint. When you add weights to endpoints, + // you configure AWS Global Accelerator to route traffic based on proportions + // that you specify. For example, you might specify endpoint weights of 4, 5, + // 5, and 6 (sum=20). The result is that 4/20 of your traffic, on average, is + // routed to the first endpoint, 5/20 is routed both to the second and third + // endpoints, and 6/20 is routed to the last endpoint. For more information, + // see Endpoint Weights (https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoints-endpoint-weights.html) + // in the AWS Global Accelerator Developer Guide. + Weight *int64 `type:"integer"` } // String returns the string representation -func (s AcceleratorAttributes) String() string { +func (s EndpointConfiguration) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AcceleratorAttributes) GoString() string { +func (s EndpointConfiguration) GoString() string { return s.String() } -// SetFlowLogsEnabled sets the FlowLogsEnabled field's value. -func (s *AcceleratorAttributes) SetFlowLogsEnabled(v bool) *AcceleratorAttributes { - s.FlowLogsEnabled = &v +// SetClientIPPreservationEnabled sets the ClientIPPreservationEnabled field's value. +func (s *EndpointConfiguration) SetClientIPPreservationEnabled(v bool) *EndpointConfiguration { + s.ClientIPPreservationEnabled = &v return s } -// SetFlowLogsS3Bucket sets the FlowLogsS3Bucket field's value. -func (s *AcceleratorAttributes) SetFlowLogsS3Bucket(v string) *AcceleratorAttributes { - s.FlowLogsS3Bucket = &v +// SetEndpointId sets the EndpointId field's value. +func (s *EndpointConfiguration) SetEndpointId(v string) *EndpointConfiguration { + s.EndpointId = &v return s } -// SetFlowLogsS3Prefix sets the FlowLogsS3Prefix field's value. -func (s *AcceleratorAttributes) SetFlowLogsS3Prefix(v string) *AcceleratorAttributes { - s.FlowLogsS3Prefix = &v +// SetWeight sets the Weight field's value. +func (s *EndpointConfiguration) SetWeight(v int64) *EndpointConfiguration { + s.Weight = &v return s } -type CreateAcceleratorInput struct { +// A complex type for an endpoint. Each endpoint group can include one or more +// endpoints, such as load balancers. +type EndpointDescription struct { _ struct{} `type:"structure"` - // Indicates whether an accelerator is enabled. The value is true or false. - // The default value is true. + // Indicates whether client IP address preservation is enabled for an Application + // Load Balancer endpoint. The value is true or false. The default value is + // true for new accelerators. // - // If the value is set to true, an accelerator cannot be deleted. If set to - // false, the accelerator can be deleted. - Enabled *bool `type:"boolean"` - - // A unique, case-sensitive identifier that you provide to ensure the idempotency—that - // is, the uniqueness—of an accelerator. + // If the value is set to true, the client's IP address is preserved in the + // X-Forwarded-For request header as traffic travels to applications on the + // Application Load Balancer endpoint fronted by the accelerator. // - // IdempotencyToken is a required field - IdempotencyToken *string `type:"string" required:"true"` + // For more information, see Viewing Client IP Addresses in AWS Global Accelerator + // (https://docs.aws.amazon.com/global-accelerator/latest/dg/introduction-how-it-works-client-ip.html) + // in the AWS Global Accelerator Developer Guide. + ClientIPPreservationEnabled *bool `type:"boolean"` - // The value for the address type must be IPv4. - IpAddressType *string `type:"string" enum:"IpAddressType"` + // An ID for the endpoint. If the endpoint is a Network Load Balancer or Application + // Load Balancer, this is the Amazon Resource Name (ARN) of the resource. If + // the endpoint is an Elastic IP address, this is the Elastic IP address allocation + // ID. For EC2 instances, this is the EC2 instance ID. + // + // An Application Load Balancer can be either internal or internet-facing. + EndpointId *string `type:"string"` - // The name of an accelerator. The name can have a maximum of 32 characters, - // must contain only alphanumeric characters or hyphens (-), and must not begin - // or end with a hyphen. + // The reason code associated with why the endpoint is not healthy. If the endpoint + // state is healthy, a reason code is not provided. // - // Name is a required field - Name *string `type:"string" required:"true"` + // If the endpoint state is unhealthy, the reason code can be one of the following + // values: + // + // * Timeout: The health check requests to the endpoint are timing out before + // returning a status. + // + // * Failed: The health check failed, for example because the endpoint response + // was invalid (malformed). + // + // If the endpoint state is initial, the reason code can be one of the following + // values: + // + // * ProvisioningInProgress: The endpoint is in the process of being provisioned. + // + // * InitialHealthChecking: Global Accelerator is still setting up the minimum + // number of health checks for the endpoint that are required to determine + // its health status. + HealthReason *string `type:"string"` + + // The health status of the endpoint. + HealthState *string `type:"string" enum:"HealthState"` + + // The weight associated with the endpoint. When you add weights to endpoints, + // you configure AWS Global Accelerator to route traffic based on proportions + // that you specify. For example, you might specify endpoint weights of 4, 5, + // 5, and 6 (sum=20). The result is that 4/20 of your traffic, on average, is + // routed to the first endpoint, 5/20 is routed both to the second and third + // endpoints, and 6/20 is routed to the last endpoint. For more information, + // see Endpoint Weights (https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoints-endpoint-weights.html) + // in the AWS Global Accelerator Developer Guide. + Weight *int64 `type:"integer"` } // String returns the string representation -func (s CreateAcceleratorInput) String() string { +func (s EndpointDescription) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateAcceleratorInput) GoString() string { +func (s EndpointDescription) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAcceleratorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAcceleratorInput"} - if s.IdempotencyToken == nil { - invalidParams.Add(request.NewErrParamRequired("IdempotencyToken")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEnabled sets the Enabled field's value. -func (s *CreateAcceleratorInput) SetEnabled(v bool) *CreateAcceleratorInput { - s.Enabled = &v +// SetClientIPPreservationEnabled sets the ClientIPPreservationEnabled field's value. +func (s *EndpointDescription) SetClientIPPreservationEnabled(v bool) *EndpointDescription { + s.ClientIPPreservationEnabled = &v return s } -// SetIdempotencyToken sets the IdempotencyToken field's value. -func (s *CreateAcceleratorInput) SetIdempotencyToken(v string) *CreateAcceleratorInput { - s.IdempotencyToken = &v +// SetEndpointId sets the EndpointId field's value. +func (s *EndpointDescription) SetEndpointId(v string) *EndpointDescription { + s.EndpointId = &v return s } -// SetIpAddressType sets the IpAddressType field's value. -func (s *CreateAcceleratorInput) SetIpAddressType(v string) *CreateAcceleratorInput { - s.IpAddressType = &v +// SetHealthReason sets the HealthReason field's value. +func (s *EndpointDescription) SetHealthReason(v string) *EndpointDescription { + s.HealthReason = &v return s } -// SetName sets the Name field's value. -func (s *CreateAcceleratorInput) SetName(v string) *CreateAcceleratorInput { - s.Name = &v +// SetHealthState sets the HealthState field's value. +func (s *EndpointDescription) SetHealthState(v string) *EndpointDescription { + s.HealthState = &v return s } -type CreateAcceleratorOutput struct { - _ struct{} `type:"structure"` - - // The accelerator that is created by specifying a listener and the supported - // IP address types. - Accelerator *Accelerator `type:"structure"` -} - -// String returns the string representation -func (s CreateAcceleratorOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateAcceleratorOutput) GoString() string { - return s.String() -} - -// SetAccelerator sets the Accelerator field's value. -func (s *CreateAcceleratorOutput) SetAccelerator(v *Accelerator) *CreateAcceleratorOutput { - s.Accelerator = v +// SetWeight sets the Weight field's value. +func (s *EndpointDescription) SetWeight(v int64) *EndpointDescription { + s.Weight = &v return s } -type CreateEndpointGroupInput struct { +// A complex type for the endpoint group. An AWS Region can have only one endpoint +// group for a specific listener. +type EndpointGroup struct { _ struct{} `type:"structure"` - // The list of endpoint objects. - EndpointConfigurations []*EndpointConfiguration `type:"list"` + // The list of endpoint objects. + EndpointDescriptions []*EndpointDescription `type:"list"` + + // The Amazon Resource Name (ARN) of the endpoint group. + EndpointGroupArn *string `type:"string"` - // The name of the AWS Region where the endpoint group is located. A listener - // can have only one endpoint group in a specific Region. - // - // EndpointGroupRegion is a required field - EndpointGroupRegion *string `type:"string" required:"true"` + // The AWS Region that this endpoint group belongs. + EndpointGroupRegion *string `type:"string"` - // The time—10 seconds or 30 seconds—between each health check for an endpoint. + // The time—10 seconds or 30 seconds—between health checks for each endpoint. // The default value is 30. HealthCheckIntervalSeconds *int64 `min:"10" type:"integer"` - // If the protocol is HTTP/S, then this specifies the path that is the destination - // for health check targets. The default value is slash (/). + // If the protocol is HTTP/S, then this value provides the ping path that Global + // Accelerator uses for the destination on the endpoints for health checks. + // The default is slash (/). HealthCheckPath *string `type:"string"` - // The port that AWS Global Accelerator uses to check the health of endpoints - // that are part of this endpoint group. The default port is the listener port - // that this endpoint group is associated with. If listener port is a list of - // ports, Global Accelerator uses the first port in the list. + // The port that Global Accelerator uses to perform health checks on endpoints + // that are part of this endpoint group. + // + // The default port is the port for the listener that this endpoint group is + // associated with. If the listener port is a list, Global Accelerator uses + // the first specified port in the list of ports. HealthCheckPort *int64 `min:"1" type:"integer"` - // The protocol that AWS Global Accelerator uses to check the health of endpoints + // The protocol that Global Accelerator uses to perform health checks on endpoints // that are part of this endpoint group. The default value is TCP. HealthCheckProtocol *string `type:"string" enum:"HealthCheckProtocol"` - // A unique, case-sensitive identifier that you provide to ensure the idempotency—that - // is, the uniqueness—of the request. - // - // IdempotencyToken is a required field - IdempotencyToken *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the listener. - // - // ListenerArn is a required field - ListenerArn *string `type:"string" required:"true"` - // The number of consecutive health checks required to set the state of a healthy // endpoint to unhealthy, or to set an unhealthy endpoint to healthy. The default // value is 3. @@ -1858,513 +4172,581 @@ type CreateEndpointGroupInput struct { } // String returns the string representation -func (s CreateEndpointGroupInput) String() string { +func (s EndpointGroup) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateEndpointGroupInput) GoString() string { +func (s EndpointGroup) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEndpointGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEndpointGroupInput"} - if s.EndpointGroupRegion == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointGroupRegion")) - } - if s.HealthCheckIntervalSeconds != nil && *s.HealthCheckIntervalSeconds < 10 { - invalidParams.Add(request.NewErrParamMinValue("HealthCheckIntervalSeconds", 10)) - } - if s.HealthCheckPort != nil && *s.HealthCheckPort < 1 { - invalidParams.Add(request.NewErrParamMinValue("HealthCheckPort", 1)) - } - if s.IdempotencyToken == nil { - invalidParams.Add(request.NewErrParamRequired("IdempotencyToken")) - } - if s.ListenerArn == nil { - invalidParams.Add(request.NewErrParamRequired("ListenerArn")) - } - if s.ThresholdCount != nil && *s.ThresholdCount < 1 { - invalidParams.Add(request.NewErrParamMinValue("ThresholdCount", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetEndpointDescriptions sets the EndpointDescriptions field's value. +func (s *EndpointGroup) SetEndpointDescriptions(v []*EndpointDescription) *EndpointGroup { + s.EndpointDescriptions = v + return s } -// SetEndpointConfigurations sets the EndpointConfigurations field's value. -func (s *CreateEndpointGroupInput) SetEndpointConfigurations(v []*EndpointConfiguration) *CreateEndpointGroupInput { - s.EndpointConfigurations = v +// SetEndpointGroupArn sets the EndpointGroupArn field's value. +func (s *EndpointGroup) SetEndpointGroupArn(v string) *EndpointGroup { + s.EndpointGroupArn = &v return s } // SetEndpointGroupRegion sets the EndpointGroupRegion field's value. -func (s *CreateEndpointGroupInput) SetEndpointGroupRegion(v string) *CreateEndpointGroupInput { +func (s *EndpointGroup) SetEndpointGroupRegion(v string) *EndpointGroup { s.EndpointGroupRegion = &v return s } // SetHealthCheckIntervalSeconds sets the HealthCheckIntervalSeconds field's value. -func (s *CreateEndpointGroupInput) SetHealthCheckIntervalSeconds(v int64) *CreateEndpointGroupInput { +func (s *EndpointGroup) SetHealthCheckIntervalSeconds(v int64) *EndpointGroup { s.HealthCheckIntervalSeconds = &v return s } // SetHealthCheckPath sets the HealthCheckPath field's value. -func (s *CreateEndpointGroupInput) SetHealthCheckPath(v string) *CreateEndpointGroupInput { +func (s *EndpointGroup) SetHealthCheckPath(v string) *EndpointGroup { s.HealthCheckPath = &v return s } // SetHealthCheckPort sets the HealthCheckPort field's value. -func (s *CreateEndpointGroupInput) SetHealthCheckPort(v int64) *CreateEndpointGroupInput { +func (s *EndpointGroup) SetHealthCheckPort(v int64) *EndpointGroup { s.HealthCheckPort = &v return s } // SetHealthCheckProtocol sets the HealthCheckProtocol field's value. -func (s *CreateEndpointGroupInput) SetHealthCheckProtocol(v string) *CreateEndpointGroupInput { +func (s *EndpointGroup) SetHealthCheckProtocol(v string) *EndpointGroup { s.HealthCheckProtocol = &v return s } -// SetIdempotencyToken sets the IdempotencyToken field's value. -func (s *CreateEndpointGroupInput) SetIdempotencyToken(v string) *CreateEndpointGroupInput { - s.IdempotencyToken = &v - return s -} - -// SetListenerArn sets the ListenerArn field's value. -func (s *CreateEndpointGroupInput) SetListenerArn(v string) *CreateEndpointGroupInput { - s.ListenerArn = &v - return s -} - // SetThresholdCount sets the ThresholdCount field's value. -func (s *CreateEndpointGroupInput) SetThresholdCount(v int64) *CreateEndpointGroupInput { +func (s *EndpointGroup) SetThresholdCount(v int64) *EndpointGroup { s.ThresholdCount = &v return s } // SetTrafficDialPercentage sets the TrafficDialPercentage field's value. -func (s *CreateEndpointGroupInput) SetTrafficDialPercentage(v float64) *CreateEndpointGroupInput { +func (s *EndpointGroup) SetTrafficDialPercentage(v float64) *EndpointGroup { s.TrafficDialPercentage = &v return s } -type CreateEndpointGroupOutput struct { - _ struct{} `type:"structure"` +// The endpoint group that you specified already exists. +type EndpointGroupAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The information about the endpoint group that was created. - EndpointGroup *EndpointGroup `type:"structure"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s CreateEndpointGroupOutput) String() string { +func (s EndpointGroupAlreadyExistsException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateEndpointGroupOutput) GoString() string { +func (s EndpointGroupAlreadyExistsException) GoString() string { return s.String() } -// SetEndpointGroup sets the EndpointGroup field's value. -func (s *CreateEndpointGroupOutput) SetEndpointGroup(v *EndpointGroup) *CreateEndpointGroupOutput { - s.EndpointGroup = v - return s +func newErrorEndpointGroupAlreadyExistsException(v protocol.ResponseMetadata) error { + return &EndpointGroupAlreadyExistsException{ + respMetadata: v, + } } -type CreateListenerInput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s EndpointGroupAlreadyExistsException) Code() string { + return "EndpointGroupAlreadyExistsException" +} - // The Amazon Resource Name (ARN) of your accelerator. - // - // AcceleratorArn is a required field - AcceleratorArn *string `type:"string" required:"true"` +// Message returns the exception's message. +func (s EndpointGroupAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Client affinity lets you direct all requests from a user to the same endpoint, - // if you have stateful applications, regardless of the port and protocol of - // the client request. Clienty affinity gives you control over whether to always - // route each client to the same specific endpoint. - // - // AWS Global Accelerator uses a consistent-flow hashing algorithm to choose - // the optimal endpoint for a connection. If client affinity is NONE, Global - // Accelerator uses the "five-tuple" (5-tuple) properties—source IP address, - // source port, destination IP address, destination port, and protocol—to - // select the hash value, and then chooses the best endpoint. However, with - // this setting, if someone uses different ports to connect to Global Accelerator, - // their connections might not be always routed to the same endpoint because - // the hash value changes. - // - // If you want a given client to always be routed to the same endpoint, set - // client affinity to SOURCE_IP instead. When you use the SOURCE_IP setting, - // Global Accelerator uses the "two-tuple" (2-tuple) properties— source (client) - // IP address and destination IP address—to select the hash value. - // - // The default value is NONE. - ClientAffinity *string `type:"string" enum:"ClientAffinity"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EndpointGroupAlreadyExistsException) OrigErr() error { + return nil +} - // A unique, case-sensitive identifier that you provide to ensure the idempotency—that - // is, the uniqueness—of the request. - // - // IdempotencyToken is a required field - IdempotencyToken *string `type:"string" required:"true"` +func (s EndpointGroupAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The list of port ranges to support for connections from clients to your accelerator. - // - // PortRanges is a required field - PortRanges []*PortRange `min:"1" type:"list" required:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s EndpointGroupAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The protocol for connections from clients to your accelerator. - // - // Protocol is a required field - Protocol *string `type:"string" required:"true" enum:"Protocol"` +// RequestID returns the service's response RequestID for request. +func (s EndpointGroupAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The endpoint group that you specified doesn't exist. +type EndpointGroupNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s CreateListenerInput) String() string { +func (s EndpointGroupNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateListenerInput) GoString() string { +func (s EndpointGroupNotFoundException) 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.AcceleratorArn == nil { - invalidParams.Add(request.NewErrParamRequired("AcceleratorArn")) - } - if s.IdempotencyToken == nil { - invalidParams.Add(request.NewErrParamRequired("IdempotencyToken")) - } - if s.PortRanges == nil { - invalidParams.Add(request.NewErrParamRequired("PortRanges")) - } - if s.PortRanges != nil && len(s.PortRanges) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PortRanges", 1)) +func newErrorEndpointGroupNotFoundException(v protocol.ResponseMetadata) error { + return &EndpointGroupNotFoundException{ + respMetadata: v, } - if s.Protocol == nil { - invalidParams.Add(request.NewErrParamRequired("Protocol")) +} + +// Code returns the exception type name. +func (s EndpointGroupNotFoundException) Code() string { + return "EndpointGroupNotFoundException" +} + +// Message returns the exception's message. +func (s EndpointGroupNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - if s.PortRanges != nil { - for i, v := range s.PortRanges { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PortRanges", i), err.(request.ErrInvalidParams)) - } - } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EndpointGroupNotFoundException) OrigErr() error { + return nil +} + +func (s EndpointGroupNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EndpointGroupNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EndpointGroupNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The CIDR that you specified is not valid for this action. For example, the +// state of the CIDR might be incorrect for this action. +type IncorrectCidrStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s IncorrectCidrStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IncorrectCidrStateException) GoString() string { + return s.String() +} + +func newErrorIncorrectCidrStateException(v protocol.ResponseMetadata) error { + return &IncorrectCidrStateException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s IncorrectCidrStateException) Code() string { + return "IncorrectCidrStateException" +} + +// Message returns the exception's message. +func (s IncorrectCidrStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IncorrectCidrStateException) OrigErr() error { return nil } -// SetAcceleratorArn sets the AcceleratorArn field's value. -func (s *CreateListenerInput) SetAcceleratorArn(v string) *CreateListenerInput { - s.AcceleratorArn = &v - return s +func (s IncorrectCidrStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetClientAffinity sets the ClientAffinity field's value. -func (s *CreateListenerInput) SetClientAffinity(v string) *CreateListenerInput { - s.ClientAffinity = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s IncorrectCidrStateException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetIdempotencyToken sets the IdempotencyToken field's value. -func (s *CreateListenerInput) SetIdempotencyToken(v string) *CreateListenerInput { - s.IdempotencyToken = &v - return s +// RequestID returns the service's response RequestID for request. +func (s IncorrectCidrStateException) RequestID() string { + return s.respMetadata.RequestID } -// SetPortRanges sets the PortRanges field's value. -func (s *CreateListenerInput) SetPortRanges(v []*PortRange) *CreateListenerInput { - s.PortRanges = v - return s +// There was an internal error for AWS Global Accelerator. +type InternalServiceErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` } -// SetProtocol sets the Protocol field's value. -func (s *CreateListenerInput) SetProtocol(v string) *CreateListenerInput { - s.Protocol = &v - return s +// String returns the string representation +func (s InternalServiceErrorException) String() string { + return awsutil.Prettify(s) } -type CreateListenerOutput struct { - _ struct{} `type:"structure"` +// GoString returns the string representation +func (s InternalServiceErrorException) GoString() string { + return s.String() +} + +func newErrorInternalServiceErrorException(v protocol.ResponseMetadata) error { + return &InternalServiceErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServiceErrorException) Code() string { + return "InternalServiceErrorException" +} + +// Message returns the exception's message. +func (s InternalServiceErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The listener that you've created. - Listener *Listener `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServiceErrorException) OrigErr() error { + return nil } -// String returns the string representation -func (s CreateListenerOutput) String() string { - return awsutil.Prettify(s) +func (s InternalServiceErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// GoString returns the string representation -func (s CreateListenerOutput) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s InternalServiceErrorException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetListener sets the Listener field's value. -func (s *CreateListenerOutput) SetListener(v *Listener) *CreateListenerOutput { - s.Listener = v - return s +// RequestID returns the service's response RequestID for request. +func (s InternalServiceErrorException) RequestID() string { + return s.respMetadata.RequestID } -type DeleteAcceleratorInput struct { - _ struct{} `type:"structure"` +// An argument that you specified is invalid. +type InvalidArgumentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The Amazon Resource Name (ARN) of an accelerator. - // - // AcceleratorArn is a required field - AcceleratorArn *string `type:"string" required:"true"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s DeleteAcceleratorInput) String() string { +func (s InvalidArgumentException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteAcceleratorInput) GoString() string { +func (s InvalidArgumentException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAcceleratorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAcceleratorInput"} - if s.AcceleratorArn == nil { - invalidParams.Add(request.NewErrParamRequired("AcceleratorArn")) +func newErrorInvalidArgumentException(v protocol.ResponseMetadata) error { + return &InvalidArgumentException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidArgumentException) Code() string { + return "InvalidArgumentException" +} + +// Message returns the exception's message. +func (s InvalidArgumentException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetAcceleratorArn sets the AcceleratorArn field's value. -func (s *DeleteAcceleratorInput) SetAcceleratorArn(v string) *DeleteAcceleratorInput { - s.AcceleratorArn = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidArgumentException) OrigErr() error { + return nil } -type DeleteAcceleratorOutput struct { - _ struct{} `type:"structure"` +func (s InvalidArgumentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// String returns the string representation -func (s DeleteAcceleratorOutput) String() string { - return awsutil.Prettify(s) +// Status code returns the HTTP status code for the request's response error. +func (s InvalidArgumentException) StatusCode() int { + return s.respMetadata.StatusCode } -// GoString returns the string representation -func (s DeleteAcceleratorOutput) GoString() string { - return s.String() +// RequestID returns the service's response RequestID for request. +func (s InvalidArgumentException) RequestID() string { + return s.respMetadata.RequestID } -type DeleteEndpointGroupInput struct { - _ struct{} `type:"structure"` +// There isn't another item to return. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The Amazon Resource Name (ARN) of the endpoint group to delete. - // - // EndpointGroupArn is a required field - EndpointGroupArn *string `type:"string" required:"true"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s DeleteEndpointGroupInput) String() string { +func (s InvalidNextTokenException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteEndpointGroupInput) GoString() string { +func (s InvalidNextTokenException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEndpointGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEndpointGroupInput"} - if s.EndpointGroupArn == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointGroupArn")) +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetEndpointGroupArn sets the EndpointGroupArn field's value. -func (s *DeleteEndpointGroupInput) SetEndpointGroupArn(v string) *DeleteEndpointGroupInput { - s.EndpointGroupArn = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil } -type DeleteEndpointGroupOutput struct { - _ struct{} `type:"structure"` +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// String returns the string representation -func (s DeleteEndpointGroupOutput) String() string { - return awsutil.Prettify(s) +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode } -// GoString returns the string representation -func (s DeleteEndpointGroupOutput) GoString() string { - return s.String() +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID } -type DeleteListenerInput struct { - _ struct{} `type:"structure"` +// The port numbers that you specified are not valid numbers or are not unique +// for this accelerator. +type InvalidPortRangeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The Amazon Resource Name (ARN) of the listener. - // - // ListenerArn is a required field - ListenerArn *string `type:"string" required:"true"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s DeleteListenerInput) String() string { +func (s InvalidPortRangeException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteListenerInput) GoString() string { +func (s InvalidPortRangeException) 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")) +func newErrorInvalidPortRangeException(v protocol.ResponseMetadata) error { + return &InvalidPortRangeException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidPortRangeException) Code() string { + return "InvalidPortRangeException" +} + +// Message returns the exception's message. +func (s InvalidPortRangeException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPortRangeException) OrigErr() error { return nil } -// SetListenerArn sets the ListenerArn field's value. -func (s *DeleteListenerInput) SetListenerArn(v string) *DeleteListenerInput { - s.ListenerArn = &v - return s +func (s InvalidPortRangeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -type DeleteListenerOutput struct { +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPortRangeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPortRangeException) RequestID() string { + return s.respMetadata.RequestID +} + +// A complex type for the set of IP addresses for an accelerator. +type IpSet struct { _ struct{} `type:"structure"` + + // The array of IP addresses in the IP address set. An IP address set can have + // a maximum of two IP addresses. + IpAddresses []*string `type:"list"` + + // The types of IP addresses included in this IP set. + IpFamily *string `type:"string"` } // String returns the string representation -func (s DeleteListenerOutput) String() string { +func (s IpSet) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteListenerOutput) GoString() string { +func (s IpSet) GoString() string { return s.String() } -type DescribeAcceleratorAttributesInput struct { - _ struct{} `type:"structure"` +// SetIpAddresses sets the IpAddresses field's value. +func (s *IpSet) SetIpAddresses(v []*string) *IpSet { + s.IpAddresses = v + return s +} - // The Amazon Resource Name (ARN) of the accelerator with the attributes that - // you want to describe. - // - // AcceleratorArn is a required field - AcceleratorArn *string `type:"string" required:"true"` +// SetIpFamily sets the IpFamily field's value. +func (s *IpSet) SetIpFamily(v string) *IpSet { + s.IpFamily = &v + return s +} + +// Processing your request would cause you to exceed an AWS Global Accelerator +// limit. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s DescribeAcceleratorAttributesInput) String() string { +func (s LimitExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAcceleratorAttributesInput) GoString() string { +func (s LimitExceededException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAcceleratorAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAcceleratorAttributesInput"} - if s.AcceleratorArn == nil { - invalidParams.Add(request.NewErrParamRequired("AcceleratorArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, } - return nil } -// SetAcceleratorArn sets the AcceleratorArn field's value. -func (s *DescribeAcceleratorAttributesInput) SetAcceleratorArn(v string) *DescribeAcceleratorAttributesInput { - s.AcceleratorArn = &v - return s +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" } -type DescribeAcceleratorAttributesOutput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The attributes of the accelerator. - AcceleratorAttributes *AcceleratorAttributes `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil } -// String returns the string representation -func (s DescribeAcceleratorAttributesOutput) String() string { - return awsutil.Prettify(s) +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// GoString returns the string representation -func (s DescribeAcceleratorAttributesOutput) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetAcceleratorAttributes sets the AcceleratorAttributes field's value. -func (s *DescribeAcceleratorAttributesOutput) SetAcceleratorAttributes(v *AcceleratorAttributes) *DescribeAcceleratorAttributesOutput { - s.AcceleratorAttributes = v - return s +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID } -type DescribeAcceleratorInput struct { +type ListAcceleratorsInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the accelerator to describe. - // - // AcceleratorArn is a required field - AcceleratorArn *string `type:"string" required:"true"` + // The number of Global Accelerator objects that you want to return with this + // call. The default value is 10. + MaxResults *int64 `min:"1" type:"integer"` + + // The token for the next set of results. You receive this token from a previous + // call. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeAcceleratorInput) String() string { +func (s ListAcceleratorsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAcceleratorInput) GoString() string { +func (s ListAcceleratorsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAcceleratorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAcceleratorInput"} - if s.AcceleratorArn == nil { - invalidParams.Add(request.NewErrParamRequired("AcceleratorArn")) +func (s *ListAcceleratorsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAcceleratorsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -2373,59 +4755,77 @@ func (s *DescribeAcceleratorInput) Validate() error { return nil } -// SetAcceleratorArn sets the AcceleratorArn field's value. -func (s *DescribeAcceleratorInput) SetAcceleratorArn(v string) *DescribeAcceleratorInput { - s.AcceleratorArn = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListAcceleratorsInput) SetMaxResults(v int64) *ListAcceleratorsInput { + s.MaxResults = &v return s } -type DescribeAcceleratorOutput struct { +// SetNextToken sets the NextToken field's value. +func (s *ListAcceleratorsInput) SetNextToken(v string) *ListAcceleratorsInput { + s.NextToken = &v + return s +} + +type ListAcceleratorsOutput struct { _ struct{} `type:"structure"` - // The description of the accelerator. - Accelerator *Accelerator `type:"structure"` + // The list of accelerators for a customer account. + Accelerators []*Accelerator `type:"list"` + + // The token for the next set of results. You receive this token from a previous + // call. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeAcceleratorOutput) String() string { +func (s ListAcceleratorsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAcceleratorOutput) GoString() string { +func (s ListAcceleratorsOutput) GoString() string { return s.String() } -// SetAccelerator sets the Accelerator field's value. -func (s *DescribeAcceleratorOutput) SetAccelerator(v *Accelerator) *DescribeAcceleratorOutput { - s.Accelerator = v +// SetAccelerators sets the Accelerators field's value. +func (s *ListAcceleratorsOutput) SetAccelerators(v []*Accelerator) *ListAcceleratorsOutput { + s.Accelerators = v return s } -type DescribeEndpointGroupInput struct { +// SetNextToken sets the NextToken field's value. +func (s *ListAcceleratorsOutput) SetNextToken(v string) *ListAcceleratorsOutput { + s.NextToken = &v + return s +} + +type ListByoipCidrsInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the endpoint group to describe. - // - // EndpointGroupArn is a required field - EndpointGroupArn *string `type:"string" required:"true"` + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `min:"1" type:"integer"` + + // The token for the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeEndpointGroupInput) String() string { +func (s ListByoipCidrsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeEndpointGroupInput) GoString() string { +func (s ListByoipCidrsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEndpointGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEndpointGroupInput"} - if s.EndpointGroupArn == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointGroupArn")) +func (s *ListByoipCidrsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListByoipCidrsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -2434,60 +4834,86 @@ func (s *DescribeEndpointGroupInput) Validate() error { return nil } -// SetEndpointGroupArn sets the EndpointGroupArn field's value. -func (s *DescribeEndpointGroupInput) SetEndpointGroupArn(v string) *DescribeEndpointGroupInput { - s.EndpointGroupArn = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListByoipCidrsInput) SetMaxResults(v int64) *ListByoipCidrsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListByoipCidrsInput) SetNextToken(v string) *ListByoipCidrsInput { + s.NextToken = &v return s } -type DescribeEndpointGroupOutput struct { +type ListByoipCidrsOutput struct { _ struct{} `type:"structure"` - // The description of an endpoint group. - EndpointGroup *EndpointGroup `type:"structure"` + // Information about your address ranges. + ByoipCidrs []*ByoipCidr `type:"list"` + + // The token for the next page of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeEndpointGroupOutput) String() string { +func (s ListByoipCidrsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeEndpointGroupOutput) GoString() string { +func (s ListByoipCidrsOutput) GoString() string { return s.String() } -// SetEndpointGroup sets the EndpointGroup field's value. -func (s *DescribeEndpointGroupOutput) SetEndpointGroup(v *EndpointGroup) *DescribeEndpointGroupOutput { - s.EndpointGroup = v +// SetByoipCidrs sets the ByoipCidrs field's value. +func (s *ListByoipCidrsOutput) SetByoipCidrs(v []*ByoipCidr) *ListByoipCidrsOutput { + s.ByoipCidrs = v return s } -type DescribeListenerInput struct { +// SetNextToken sets the NextToken field's value. +func (s *ListByoipCidrsOutput) SetNextToken(v string) *ListByoipCidrsOutput { + s.NextToken = &v + return s +} + +type ListEndpointGroupsInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the listener to describe. + // The Amazon Resource Name (ARN) of the listener. // // ListenerArn is a required field ListenerArn *string `type:"string" required:"true"` + + // The number of endpoint group objects that you want to return with this call. + // The default value is 10. + MaxResults *int64 `min:"1" type:"integer"` + + // The token for the next set of results. You receive this token from a previous + // call. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeListenerInput) String() string { +func (s ListEndpointGroupsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeListenerInput) GoString() string { +func (s ListEndpointGroupsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeListenerInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeListenerInput"} +func (s *ListEndpointGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListEndpointGroupsInput"} if s.ListenerArn == nil { invalidParams.Add(request.NewErrParamRequired("ListenerArn")) } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -2496,460 +4922,431 @@ func (s *DescribeListenerInput) Validate() error { } // SetListenerArn sets the ListenerArn field's value. -func (s *DescribeListenerInput) SetListenerArn(v string) *DescribeListenerInput { +func (s *ListEndpointGroupsInput) SetListenerArn(v string) *ListEndpointGroupsInput { s.ListenerArn = &v return s } -type DescribeListenerOutput struct { - _ struct{} `type:"structure"` - - // The description of a listener. - Listener *Listener `type:"structure"` -} - -// String returns the string representation -func (s DescribeListenerOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeListenerOutput) GoString() string { - return s.String() +// SetMaxResults sets the MaxResults field's value. +func (s *ListEndpointGroupsInput) SetMaxResults(v int64) *ListEndpointGroupsInput { + s.MaxResults = &v + return s } -// SetListener sets the Listener field's value. -func (s *DescribeListenerOutput) SetListener(v *Listener) *DescribeListenerOutput { - s.Listener = v +// SetNextToken sets the NextToken field's value. +func (s *ListEndpointGroupsInput) SetNextToken(v string) *ListEndpointGroupsInput { + s.NextToken = &v return s } -// A complex type for endpoints. -type EndpointConfiguration struct { +type ListEndpointGroupsOutput struct { _ struct{} `type:"structure"` - // Indicates whether client IP address preservation is enabled for an Application - // Load Balancer endpoint. The value is true or false. The default value is - // true for new accelerators. - // - // If the value is set to true, the client's IP address is preserved in the - // X-Forwarded-For request header as traffic travels to applications on the - // Application Load Balancer endpoint fronted by the accelerator. - // - // For more information, see Viewing Client IP Addresses in AWS Global Accelerator - // (https://docs.aws.amazon.com/global-accelerator/latest/dg/introduction-how-it-works-client-ip.html) - // in the AWS Global Accelerator Developer Guide. - ClientIPPreservationEnabled *bool `type:"boolean"` - - // An ID for the endpoint. If the endpoint is a Network Load Balancer or Application - // Load Balancer, this is the Amazon Resource Name (ARN) of the resource. If - // the endpoint is an Elastic IP address, this is the Elastic IP address allocation - // ID. - EndpointId *string `type:"string"` + // The list of the endpoint groups associated with a listener. + EndpointGroups []*EndpointGroup `type:"list"` - // The weight associated with the endpoint. When you add weights to endpoints, - // you configure AWS Global Accelerator to route traffic based on proportions - // that you specify. For example, you might specify endpoint weights of 4, 5, - // 5, and 6 (sum=20). The result is that 4/20 of your traffic, on average, is - // routed to the first endpoint, 5/20 is routed both to the second and third - // endpoints, and 6/20 is routed to the last endpoint. For more information, - // see Endpoint Weights (https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoints-endpoint-weights.html) - // in the AWS Global Accelerator Developer Guide. - Weight *int64 `type:"integer"` + // The token for the next set of results. You receive this token from a previous + // call. + NextToken *string `type:"string"` } // String returns the string representation -func (s EndpointConfiguration) String() string { +func (s ListEndpointGroupsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EndpointConfiguration) GoString() string { +func (s ListEndpointGroupsOutput) GoString() string { return s.String() } -// SetClientIPPreservationEnabled sets the ClientIPPreservationEnabled field's value. -func (s *EndpointConfiguration) SetClientIPPreservationEnabled(v bool) *EndpointConfiguration { - s.ClientIPPreservationEnabled = &v - return s -} - -// SetEndpointId sets the EndpointId field's value. -func (s *EndpointConfiguration) SetEndpointId(v string) *EndpointConfiguration { - s.EndpointId = &v +// SetEndpointGroups sets the EndpointGroups field's value. +func (s *ListEndpointGroupsOutput) SetEndpointGroups(v []*EndpointGroup) *ListEndpointGroupsOutput { + s.EndpointGroups = v return s } -// SetWeight sets the Weight field's value. -func (s *EndpointConfiguration) SetWeight(v int64) *EndpointConfiguration { - s.Weight = &v +// SetNextToken sets the NextToken field's value. +func (s *ListEndpointGroupsOutput) SetNextToken(v string) *ListEndpointGroupsOutput { + s.NextToken = &v return s } -// A complex type for an endpoint. Each endpoint group can include one or more -// endpoints, such as load balancers. -type EndpointDescription struct { +type ListListenersInput struct { _ struct{} `type:"structure"` - // Indicates whether client IP address preservation is enabled for an Application - // Load Balancer endpoint. The value is true or false. The default value is - // true for new accelerators. - // - // If the value is set to true, the client's IP address is preserved in the - // X-Forwarded-For request header as traffic travels to applications on the - // Application Load Balancer endpoint fronted by the accelerator. - // - // For more information, see Viewing Client IP Addresses in AWS Global Accelerator - // (https://docs.aws.amazon.com/global-accelerator/latest/dg/introduction-how-it-works-client-ip.html) - // in the AWS Global Accelerator Developer Guide. - ClientIPPreservationEnabled *bool `type:"boolean"` - - // An ID for the endpoint. If the endpoint is a Network Load Balancer or Application - // Load Balancer, this is the Amazon Resource Name (ARN) of the resource. If - // the endpoint is an Elastic IP address, this is the Elastic IP address allocation - // ID. An Application Load Balancer can be either internal or internet-facing. - EndpointId *string `type:"string"` - - // The reason code associated with why the endpoint is not healthy. If the endpoint - // state is healthy, a reason code is not provided. - // - // If the endpoint state is unhealthy, the reason code can be one of the following - // values: - // - // * Timeout: The health check requests to the endpoint are timing out before - // returning a status. - // - // * Failed: The health check failed, for example because the endpoint response - // was invalid (malformed). - // - // If the endpoint state is initial, the reason code can be one of the following - // values: - // - // * ProvisioningInProgress: The endpoint is in the process of being provisioned. + // The Amazon Resource Name (ARN) of the accelerator for which you want to list + // listener objects. // - // * InitialHealthChecking: Global Accelerator is still setting up the minimum - // number of health checks for the endpoint that are required to determine - // its health status. - HealthReason *string `type:"string"` + // AcceleratorArn is a required field + AcceleratorArn *string `type:"string" required:"true"` - // The health status of the endpoint. - HealthState *string `type:"string" enum:"HealthState"` + // The number of listener objects that you want to return with this call. The + // default value is 10. + MaxResults *int64 `min:"1" type:"integer"` - // The weight associated with the endpoint. When you add weights to endpoints, - // you configure AWS Global Accelerator to route traffic based on proportions - // that you specify. For example, you might specify endpoint weights of 4, 5, - // 5, and 6 (sum=20). The result is that 4/20 of your traffic, on average, is - // routed to the first endpoint, 5/20 is routed both to the second and third - // endpoints, and 6/20 is routed to the last endpoint. For more information, - // see Endpoint Weights (https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoints-endpoint-weights.html) - // in the AWS Global Accelerator Developer Guide. - Weight *int64 `type:"integer"` + // The token for the next set of results. You receive this token from a previous + // call. + NextToken *string `type:"string"` } // String returns the string representation -func (s EndpointDescription) String() string { +func (s ListListenersInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EndpointDescription) GoString() string { +func (s ListListenersInput) GoString() string { return s.String() } -// SetClientIPPreservationEnabled sets the ClientIPPreservationEnabled field's value. -func (s *EndpointDescription) SetClientIPPreservationEnabled(v bool) *EndpointDescription { - s.ClientIPPreservationEnabled = &v - return s -} - -// SetEndpointId sets the EndpointId field's value. -func (s *EndpointDescription) SetEndpointId(v string) *EndpointDescription { - s.EndpointId = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListListenersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListListenersInput"} + if s.AcceleratorArn == nil { + invalidParams.Add(request.NewErrParamRequired("AcceleratorArn")) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } -// SetHealthReason sets the HealthReason field's value. -func (s *EndpointDescription) SetHealthReason(v string) *EndpointDescription { - s.HealthReason = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetHealthState sets the HealthState field's value. -func (s *EndpointDescription) SetHealthState(v string) *EndpointDescription { - s.HealthState = &v +// SetAcceleratorArn sets the AcceleratorArn field's value. +func (s *ListListenersInput) SetAcceleratorArn(v string) *ListListenersInput { + s.AcceleratorArn = &v return s } -// SetWeight sets the Weight field's value. -func (s *EndpointDescription) SetWeight(v int64) *EndpointDescription { - s.Weight = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListListenersInput) SetMaxResults(v int64) *ListListenersInput { + s.MaxResults = &v return s -} - -// A complex type for the endpoint group. An AWS Region can have only one endpoint -// group for a specific listener. -type EndpointGroup struct { - _ struct{} `type:"structure"` - - // The list of endpoint objects. - EndpointDescriptions []*EndpointDescription `type:"list"` - - // The Amazon Resource Name (ARN) of the endpoint group. - EndpointGroupArn *string `type:"string"` - - // The AWS Region that this endpoint group belongs. - EndpointGroupRegion *string `type:"string"` - - // The time—10 seconds or 30 seconds—between health checks for each endpoint. - // The default value is 30. - HealthCheckIntervalSeconds *int64 `min:"10" type:"integer"` - - // If the protocol is HTTP/S, then this value provides the ping path that Global - // Accelerator uses for the destination on the endpoints for health checks. - // The default is slash (/). - HealthCheckPath *string `type:"string"` +} - // The port that Global Accelerator uses to perform health checks on endpoints - // that are part of this endpoint group. - // - // The default port is the port for the listener that this endpoint group is - // associated with. If the listener port is a list, Global Accelerator uses - // the first specified port in the list of ports. - HealthCheckPort *int64 `min:"1" type:"integer"` +// SetNextToken sets the NextToken field's value. +func (s *ListListenersInput) SetNextToken(v string) *ListListenersInput { + s.NextToken = &v + return s +} - // The protocol that Global Accelerator uses to perform health checks on endpoints - // that are part of this endpoint group. The default value is TCP. - HealthCheckProtocol *string `type:"string" enum:"HealthCheckProtocol"` +type ListListenersOutput struct { + _ struct{} `type:"structure"` - // The number of consecutive health checks required to set the state of a healthy - // endpoint to unhealthy, or to set an unhealthy endpoint to healthy. The default - // value is 3. - ThresholdCount *int64 `min:"1" type:"integer"` + // The list of listeners for an accelerator. + Listeners []*Listener `type:"list"` - // The percentage of traffic to send to an AWS Region. Additional traffic is - // distributed to other endpoint groups for this listener. - // - // Use this action to increase (dial up) or decrease (dial down) traffic to - // a specific Region. The percentage is applied to the traffic that would otherwise - // have been routed to the Region based on optimal routing. - // - // The default value is 100. - TrafficDialPercentage *float64 `type:"float"` + // The token for the next set of results. You receive this token from a previous + // call. + NextToken *string `type:"string"` } // String returns the string representation -func (s EndpointGroup) String() string { +func (s ListListenersOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EndpointGroup) GoString() string { +func (s ListListenersOutput) GoString() string { return s.String() } -// SetEndpointDescriptions sets the EndpointDescriptions field's value. -func (s *EndpointGroup) SetEndpointDescriptions(v []*EndpointDescription) *EndpointGroup { - s.EndpointDescriptions = v +// SetListeners sets the Listeners field's value. +func (s *ListListenersOutput) SetListeners(v []*Listener) *ListListenersOutput { + s.Listeners = v return s } -// SetEndpointGroupArn sets the EndpointGroupArn field's value. -func (s *EndpointGroup) SetEndpointGroupArn(v string) *EndpointGroup { - s.EndpointGroupArn = &v +// SetNextToken sets the NextToken field's value. +func (s *ListListenersOutput) SetNextToken(v string) *ListListenersOutput { + s.NextToken = &v return s } -// SetEndpointGroupRegion sets the EndpointGroupRegion field's value. -func (s *EndpointGroup) SetEndpointGroupRegion(v string) *EndpointGroup { - s.EndpointGroupRegion = &v - return s +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the accelerator to list tags for. An ARN + // uniquely identifies an accelerator. + // + // ResourceArn is a required field + ResourceArn *string `min:"1" type:"string" required:"true"` } -// SetHealthCheckIntervalSeconds sets the HealthCheckIntervalSeconds field's value. -func (s *EndpointGroup) SetHealthCheckIntervalSeconds(v int64) *EndpointGroup { - s.HealthCheckIntervalSeconds = &v - return s +// String returns the string representation +func (s ListTagsForResourceInput) String() string { + return awsutil.Prettify(s) } -// SetHealthCheckPath sets the HealthCheckPath field's value. -func (s *EndpointGroup) SetHealthCheckPath(v string) *EndpointGroup { - s.HealthCheckPath = &v - return s +// GoString returns the string representation +func (s ListTagsForResourceInput) GoString() string { + return s.String() } -// SetHealthCheckPort sets the HealthCheckPort field's value. -func (s *EndpointGroup) SetHealthCheckPort(v int64) *EndpointGroup { - s.HealthCheckPort = &v - return s +// 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 } -// SetHealthCheckProtocol sets the HealthCheckProtocol field's value. -func (s *EndpointGroup) SetHealthCheckProtocol(v string) *EndpointGroup { - s.HealthCheckProtocol = &v +// SetResourceArn sets the ResourceArn field's value. +func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { + s.ResourceArn = &v return s } -// SetThresholdCount sets the ThresholdCount field's value. -func (s *EndpointGroup) SetThresholdCount(v int64) *EndpointGroup { - s.ThresholdCount = &v - return s +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // Root level tag for the Tags parameters. + Tags []*Tag `type:"list"` } -// SetTrafficDialPercentage sets the TrafficDialPercentage field's value. -func (s *EndpointGroup) SetTrafficDialPercentage(v float64) *EndpointGroup { - s.TrafficDialPercentage = &v +// 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 } -// A complex type for the set of IP addresses for an accelerator. -type IpSet struct { +// A complex type for a listener. +type Listener struct { _ struct{} `type:"structure"` - // The array of IP addresses in the IP address set. An IP address set can have - // a maximum of two IP addresses. - IpAddresses []*string `type:"list"` + // Client affinity lets you direct all requests from a user to the same endpoint, + // if you have stateful applications, regardless of the port and protocol of + // the client request. Clienty affinity gives you control over whether to always + // route each client to the same specific endpoint. + // + // AWS Global Accelerator uses a consistent-flow hashing algorithm to choose + // the optimal endpoint for a connection. If client affinity is NONE, Global + // Accelerator uses the "five-tuple" (5-tuple) properties—source IP address, + // source port, destination IP address, destination port, and protocol—to + // select the hash value, and then chooses the best endpoint. However, with + // this setting, if someone uses different ports to connect to Global Accelerator, + // their connections might not be always routed to the same endpoint because + // the hash value changes. + // + // If you want a given client to always be routed to the same endpoint, set + // client affinity to SOURCE_IP instead. When you use the SOURCE_IP setting, + // Global Accelerator uses the "two-tuple" (2-tuple) properties— source (client) + // IP address and destination IP address—to select the hash value. + // + // The default value is NONE. + ClientAffinity *string `type:"string" enum:"ClientAffinity"` - // The types of IP addresses included in this IP set. - IpFamily *string `type:"string"` + // The Amazon Resource Name (ARN) of the listener. + ListenerArn *string `type:"string"` + + // The list of port ranges for the connections from clients to the accelerator. + PortRanges []*PortRange `min:"1" type:"list"` + + // The protocol for the connections from clients to the accelerator. + Protocol *string `type:"string" enum:"Protocol"` } // String returns the string representation -func (s IpSet) String() string { +func (s Listener) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s IpSet) GoString() string { +func (s Listener) GoString() string { return s.String() } -// SetIpAddresses sets the IpAddresses field's value. -func (s *IpSet) SetIpAddresses(v []*string) *IpSet { - s.IpAddresses = v +// SetClientAffinity sets the ClientAffinity field's value. +func (s *Listener) SetClientAffinity(v string) *Listener { + s.ClientAffinity = &v return s } -// SetIpFamily sets the IpFamily field's value. -func (s *IpSet) SetIpFamily(v string) *IpSet { - s.IpFamily = &v +// SetListenerArn sets the ListenerArn field's value. +func (s *Listener) SetListenerArn(v string) *Listener { + s.ListenerArn = &v return s } -type ListAcceleratorsInput struct { - _ struct{} `type:"structure"` +// SetPortRanges sets the PortRanges field's value. +func (s *Listener) SetPortRanges(v []*PortRange) *Listener { + s.PortRanges = v + return s +} - // The number of Global Accelerator objects that you want to return with this - // call. The default value is 10. - MaxResults *int64 `min:"1" type:"integer"` +// SetProtocol sets the Protocol field's value. +func (s *Listener) SetProtocol(v string) *Listener { + s.Protocol = &v + return s +} - // The token for the next set of results. You receive this token from a previous - // call. - NextToken *string `type:"string"` +// The listener that you specified doesn't exist. +type ListenerNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s ListAcceleratorsInput) String() string { +func (s ListenerNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListAcceleratorsInput) GoString() string { +func (s ListenerNotFoundException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAcceleratorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAcceleratorsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func newErrorListenerNotFoundException(v protocol.ResponseMetadata) error { + return &ListenerNotFoundException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s ListenerNotFoundException) Code() string { + return "ListenerNotFoundException" +} + +// Message returns the exception's message. +func (s ListenerNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ListenerNotFoundException) OrigErr() error { return nil } -// SetMaxResults sets the MaxResults field's value. -func (s *ListAcceleratorsInput) SetMaxResults(v int64) *ListAcceleratorsInput { - s.MaxResults = &v - return s +func (s ListenerNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetNextToken sets the NextToken field's value. -func (s *ListAcceleratorsInput) SetNextToken(v string) *ListAcceleratorsInput { - s.NextToken = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ListenerNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode } -type ListAcceleratorsOutput struct { +// RequestID returns the service's response RequestID for request. +func (s ListenerNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// A complex type for a range of ports for a listener. +type PortRange struct { _ struct{} `type:"structure"` - // The list of accelerators for a customer account. - Accelerators []*Accelerator `type:"list"` + // The first port in the range of ports, inclusive. + FromPort *int64 `min:"1" type:"integer"` - // The token for the next set of results. You receive this token from a previous - // call. - NextToken *string `type:"string"` + // The last port in the range of ports, inclusive. + ToPort *int64 `min:"1" type:"integer"` } // String returns the string representation -func (s ListAcceleratorsOutput) String() string { +func (s PortRange) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListAcceleratorsOutput) GoString() string { +func (s PortRange) GoString() string { return s.String() } -// SetAccelerators sets the Accelerators field's value. -func (s *ListAcceleratorsOutput) SetAccelerators(v []*Accelerator) *ListAcceleratorsOutput { - s.Accelerators = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *PortRange) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PortRange"} + if s.FromPort != nil && *s.FromPort < 1 { + invalidParams.Add(request.NewErrParamMinValue("FromPort", 1)) + } + if s.ToPort != nil && *s.ToPort < 1 { + invalidParams.Add(request.NewErrParamMinValue("ToPort", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFromPort sets the FromPort field's value. +func (s *PortRange) SetFromPort(v int64) *PortRange { + s.FromPort = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListAcceleratorsOutput) SetNextToken(v string) *ListAcceleratorsOutput { - s.NextToken = &v +// SetToPort sets the ToPort field's value. +func (s *PortRange) SetToPort(v int64) *PortRange { + s.ToPort = &v return s } -type ListEndpointGroupsInput struct { +type ProvisionByoipCidrInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the listener. + // The public IPv4 address range, in CIDR notation. The most specific IP prefix + // that you can specify is /24. The address range cannot overlap with another + // address range that you've brought to this or another Region. // - // ListenerArn is a required field - ListenerArn *string `type:"string" required:"true"` + // Cidr is a required field + Cidr *string `type:"string" required:"true"` - // The number of endpoint group objects that you want to return with this call. - // The default value is 10. - MaxResults *int64 `min:"1" type:"integer"` - - // The token for the next set of results. You receive this token from a previous - // call. - NextToken *string `type:"string"` + // A signed document that proves that you are authorized to bring the specified + // IP address range to Amazon using BYOIP. + // + // CidrAuthorizationContext is a required field + CidrAuthorizationContext *CidrAuthorizationContext `type:"structure" required:"true"` } // String returns the string representation -func (s ListEndpointGroupsInput) String() string { +func (s ProvisionByoipCidrInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListEndpointGroupsInput) GoString() string { +func (s ProvisionByoipCidrInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListEndpointGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEndpointGroupsInput"} - if s.ListenerArn == nil { - invalidParams.Add(request.NewErrParamRequired("ListenerArn")) +func (s *ProvisionByoipCidrInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProvisionByoipCidrInput"} + if s.Cidr == nil { + invalidParams.Add(request.NewErrParamRequired("Cidr")) } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + if s.CidrAuthorizationContext == nil { + invalidParams.Add(request.NewErrParamRequired("CidrAuthorizationContext")) + } + if s.CidrAuthorizationContext != nil { + if err := s.CidrAuthorizationContext.Validate(); err != nil { + invalidParams.AddNested("CidrAuthorizationContext", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -2958,93 +5355,77 @@ func (s *ListEndpointGroupsInput) Validate() error { return nil } -// SetListenerArn sets the ListenerArn field's value. -func (s *ListEndpointGroupsInput) SetListenerArn(v string) *ListEndpointGroupsInput { - s.ListenerArn = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListEndpointGroupsInput) SetMaxResults(v int64) *ListEndpointGroupsInput { - s.MaxResults = &v +// SetCidr sets the Cidr field's value. +func (s *ProvisionByoipCidrInput) SetCidr(v string) *ProvisionByoipCidrInput { + s.Cidr = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListEndpointGroupsInput) SetNextToken(v string) *ListEndpointGroupsInput { - s.NextToken = &v +// SetCidrAuthorizationContext sets the CidrAuthorizationContext field's value. +func (s *ProvisionByoipCidrInput) SetCidrAuthorizationContext(v *CidrAuthorizationContext) *ProvisionByoipCidrInput { + s.CidrAuthorizationContext = v return s } -type ListEndpointGroupsOutput struct { +type ProvisionByoipCidrOutput struct { _ struct{} `type:"structure"` - // The list of the endpoint groups associated with a listener. - EndpointGroups []*EndpointGroup `type:"list"` - - // The token for the next set of results. You receive this token from a previous - // call. - NextToken *string `type:"string"` + // Information about the address range. + ByoipCidr *ByoipCidr `type:"structure"` } // String returns the string representation -func (s ListEndpointGroupsOutput) String() string { +func (s ProvisionByoipCidrOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListEndpointGroupsOutput) GoString() string { +func (s ProvisionByoipCidrOutput) GoString() string { return s.String() } -// SetEndpointGroups sets the EndpointGroups field's value. -func (s *ListEndpointGroupsOutput) SetEndpointGroups(v []*EndpointGroup) *ListEndpointGroupsOutput { - s.EndpointGroups = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEndpointGroupsOutput) SetNextToken(v string) *ListEndpointGroupsOutput { - s.NextToken = &v +// SetByoipCidr sets the ByoipCidr field's value. +func (s *ProvisionByoipCidrOutput) SetByoipCidr(v *ByoipCidr) *ProvisionByoipCidrOutput { + s.ByoipCidr = v return s } -type ListListenersInput struct { +// A complex type that contains a Tag key and Tag value. +type Tag struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the accelerator for which you want to list - // listener objects. + // A string that contains a Tag key. // - // AcceleratorArn is a required field - AcceleratorArn *string `type:"string" required:"true"` - - // The number of listener objects that you want to return with this call. The - // default value is 10. - MaxResults *int64 `min:"1" type:"integer"` + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` - // The token for the next set of results. You receive this token from a previous - // call. - NextToken *string `type:"string"` + // A string that contains a Tag value. + // + // Value is a required field + Value *string `type:"string" required:"true"` } // String returns the string representation -func (s ListListenersInput) String() string { +func (s Tag) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListListenersInput) GoString() string { +func (s Tag) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListListenersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListListenersInput"} - if s.AcceleratorArn == nil { - invalidParams.Add(request.NewErrParamRequired("AcceleratorArn")) +func (s *Tag) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Tag"} + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + 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 { @@ -3053,156 +5434,135 @@ func (s *ListListenersInput) Validate() error { return nil } -// SetAcceleratorArn sets the AcceleratorArn field's value. -func (s *ListListenersInput) SetAcceleratorArn(v string) *ListListenersInput { - s.AcceleratorArn = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListListenersInput) SetMaxResults(v int64) *ListListenersInput { - s.MaxResults = &v +// SetKey sets the Key field's value. +func (s *Tag) SetKey(v string) *Tag { + s.Key = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListListenersInput) SetNextToken(v string) *ListListenersInput { - s.NextToken = &v +// SetValue sets the Value field's value. +func (s *Tag) SetValue(v string) *Tag { + s.Value = &v return s } -type ListListenersOutput struct { +type TagResourceInput struct { _ struct{} `type:"structure"` - // The list of listeners for an accelerator. - Listeners []*Listener `type:"list"` + // The Amazon Resource Name (ARN) of the Global Accelerator resource to add + // tags to. An ARN uniquely identifies a resource. + // + // ResourceArn is a required field + ResourceArn *string `min:"1" type:"string" required:"true"` - // The token for the next set of results. You receive this token from a previous - // call. - NextToken *string `type:"string"` + // The tags to add to a resource. A tag consists of a key and a value that you + // define. + // + // Tags is a required field + Tags []*Tag `type:"list" required:"true"` } // String returns the string representation -func (s ListListenersOutput) String() string { +func (s TagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListListenersOutput) GoString() string { +func (s TagResourceInput) GoString() string { return s.String() } -// SetListeners sets the Listeners field's value. -func (s *ListListenersOutput) SetListeners(v []*Listener) *ListListenersOutput { - s.Listeners = v +// 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 } -// SetNextToken sets the NextToken field's value. -func (s *ListListenersOutput) SetNextToken(v string) *ListListenersOutput { - s.NextToken = &v +// SetTags sets the Tags field's value. +func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { + s.Tags = v return s } -// A complex type for a listener. -type Listener struct { +type TagResourceOutput struct { _ struct{} `type:"structure"` - - // Client affinity lets you direct all requests from a user to the same endpoint, - // if you have stateful applications, regardless of the port and protocol of - // the client request. Clienty affinity gives you control over whether to always - // route each client to the same specific endpoint. - // - // AWS Global Accelerator uses a consistent-flow hashing algorithm to choose - // the optimal endpoint for a connection. If client affinity is NONE, Global - // Accelerator uses the "five-tuple" (5-tuple) properties—source IP address, - // source port, destination IP address, destination port, and protocol—to - // select the hash value, and then chooses the best endpoint. However, with - // this setting, if someone uses different ports to connect to Global Accelerator, - // their connections might not be always routed to the same endpoint because - // the hash value changes. - // - // If you want a given client to always be routed to the same endpoint, set - // client affinity to SOURCE_IP instead. When you use the SOURCE_IP setting, - // Global Accelerator uses the "two-tuple" (2-tuple) properties— source (client) - // IP address and destination IP address—to select the hash value. - // - // The default value is NONE. - ClientAffinity *string `type:"string" enum:"ClientAffinity"` - - // The Amazon Resource Name (ARN) of the listener. - ListenerArn *string `type:"string"` - - // The list of port ranges for the connections from clients to the accelerator. - PortRanges []*PortRange `min:"1" type:"list"` - - // The protocol for the connections from clients to the accelerator. - Protocol *string `type:"string" enum:"Protocol"` } // String returns the string representation -func (s Listener) String() string { +func (s TagResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Listener) GoString() string { +func (s TagResourceOutput) GoString() string { return s.String() } -// SetClientAffinity sets the ClientAffinity field's value. -func (s *Listener) SetClientAffinity(v string) *Listener { - s.ClientAffinity = &v - return s -} - -// SetListenerArn sets the ListenerArn field's value. -func (s *Listener) SetListenerArn(v string) *Listener { - s.ListenerArn = &v - return s -} - -// SetPortRanges sets the PortRanges field's value. -func (s *Listener) SetPortRanges(v []*PortRange) *Listener { - s.PortRanges = v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *Listener) SetProtocol(v string) *Listener { - s.Protocol = &v - return s -} - -// A complex type for a range of ports for a listener. -type PortRange struct { +type UntagResourceInput struct { _ struct{} `type:"structure"` - // The first port in the range of ports, inclusive. - FromPort *int64 `min:"1" type:"integer"` + // The Amazon Resource Name (ARN) of the Global Accelerator resource to remove + // tags from. An ARN uniquely identifies a resource. + // + // ResourceArn is a required field + ResourceArn *string `min:"1" type:"string" required:"true"` - // The last port in the range of ports, inclusive. - ToPort *int64 `min:"1" type:"integer"` + // The tag key pairs that you want to remove from the specified resources. + // + // TagKeys is a required field + TagKeys []*string `type:"list" required:"true"` } // String returns the string representation -func (s PortRange) String() string { +func (s UntagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PortRange) GoString() string { +func (s UntagResourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *PortRange) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PortRange"} - if s.FromPort != nil && *s.FromPort < 1 { - invalidParams.Add(request.NewErrParamMinValue("FromPort", 1)) +func (s *UntagResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) } - if s.ToPort != nil && *s.ToPort < 1 { - invalidParams.Add(request.NewErrParamMinValue("ToPort", 1)) + 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 { @@ -3211,18 +5571,32 @@ func (s *PortRange) Validate() error { return nil } -// SetFromPort sets the FromPort field's value. -func (s *PortRange) SetFromPort(v int64) *PortRange { - s.FromPort = &v +// SetResourceArn sets the ResourceArn field's value. +func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { + s.ResourceArn = &v return s } -// SetToPort sets the ToPort field's value. -func (s *PortRange) SetToPort(v int64) *PortRange { - s.ToPort = &v +// SetTagKeys sets the TagKeys field's value. +func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { + s.TagKeys = v return s } +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() +} + type UpdateAcceleratorAttributesInput struct { _ struct{} `type:"structure"` @@ -3244,8 +5618,13 @@ type UpdateAcceleratorAttributesInput struct { FlowLogsS3Bucket *string `type:"string"` // Update the prefix for the location in the Amazon S3 bucket for the flow logs. - // Attribute is required if FlowLogsEnabled is true. If you don’t specify - // a prefix, the flow logs are stored in the root of the bucket. + // Attribute is required if FlowLogsEnabled is true. + // + // If you don’t specify a prefix, the flow logs are stored in the root of + // the bucket. If you specify slash (/) for the S3 bucket prefix, the log file + // bucket folder structure will include a double slash (//), like the following: + // + // s3-bucket_name//AWSLogs/aws_account_id FlowLogsS3Prefix *string `type:"string"` } @@ -3681,6 +6060,67 @@ func (s *UpdateListenerOutput) SetListener(v *Listener) *UpdateListenerOutput { return s } +type WithdrawByoipCidrInput struct { + _ struct{} `type:"structure"` + + // The address range, in CIDR notation. + // + // Cidr is a required field + Cidr *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s WithdrawByoipCidrInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WithdrawByoipCidrInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *WithdrawByoipCidrInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "WithdrawByoipCidrInput"} + if s.Cidr == nil { + invalidParams.Add(request.NewErrParamRequired("Cidr")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCidr sets the Cidr field's value. +func (s *WithdrawByoipCidrInput) SetCidr(v string) *WithdrawByoipCidrInput { + s.Cidr = &v + return s +} + +type WithdrawByoipCidrOutput struct { + _ struct{} `type:"structure"` + + // Information about the address pool. + ByoipCidr *ByoipCidr `type:"structure"` +} + +// String returns the string representation +func (s WithdrawByoipCidrOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WithdrawByoipCidrOutput) GoString() string { + return s.String() +} + +// SetByoipCidr sets the ByoipCidr field's value. +func (s *WithdrawByoipCidrOutput) SetByoipCidr(v *ByoipCidr) *WithdrawByoipCidrOutput { + s.ByoipCidr = v + return s +} + const ( // AcceleratorStatusDeployed is a AcceleratorStatus enum value AcceleratorStatusDeployed = "DEPLOYED" @@ -3689,6 +6129,41 @@ const ( AcceleratorStatusInProgress = "IN_PROGRESS" ) +const ( + // ByoipCidrStatePendingProvisioning is a ByoipCidrState enum value + ByoipCidrStatePendingProvisioning = "PENDING_PROVISIONING" + + // ByoipCidrStateReady is a ByoipCidrState enum value + ByoipCidrStateReady = "READY" + + // ByoipCidrStatePendingAdvertising is a ByoipCidrState enum value + ByoipCidrStatePendingAdvertising = "PENDING_ADVERTISING" + + // ByoipCidrStateAdvertising is a ByoipCidrState enum value + ByoipCidrStateAdvertising = "ADVERTISING" + + // ByoipCidrStatePendingWithdrawing is a ByoipCidrState enum value + ByoipCidrStatePendingWithdrawing = "PENDING_WITHDRAWING" + + // ByoipCidrStatePendingDeprovisioning is a ByoipCidrState enum value + ByoipCidrStatePendingDeprovisioning = "PENDING_DEPROVISIONING" + + // ByoipCidrStateDeprovisioned is a ByoipCidrState enum value + ByoipCidrStateDeprovisioned = "DEPROVISIONED" + + // ByoipCidrStateFailedProvision is a ByoipCidrState enum value + ByoipCidrStateFailedProvision = "FAILED_PROVISION" + + // ByoipCidrStateFailedAdvertising is a ByoipCidrState enum value + ByoipCidrStateFailedAdvertising = "FAILED_ADVERTISING" + + // ByoipCidrStateFailedWithdraw is a ByoipCidrState enum value + ByoipCidrStateFailedWithdraw = "FAILED_WITHDRAW" + + // ByoipCidrStateFailedDeprovision is a ByoipCidrState enum value + ByoipCidrStateFailedDeprovision = "FAILED_DEPROVISION" +) + const ( // ClientAffinityNone is a ClientAffinity enum value ClientAffinityNone = "NONE" diff --git a/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/doc.go b/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/doc.go index eda86021620..638781f4a64 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/doc.go @@ -8,18 +8,20 @@ // types, and errors. For more information about Global Accelerator features, // see the AWS Global Accelerator Developer Guide (https://docs.aws.amazon.com/global-accelerator/latest/dg/Welcome.html). // -// AWS Global Accelerator is a network layer service in which you create accelerators -// to improve availability and performance for internet applications used by -// a global audience. +// AWS Global Accelerator is a service in which you create accelerators to improve +// availability and performance of your applications for local and global users. // -// You must specify the US-West-2 (Oregon) Region to create or update accelerators. +// You must specify the US West (Oregon) Region to create or update accelerators. // -// Global Accelerator provides you with static IP addresses that you associate -// with your accelerator. These IP addresses are anycast from the AWS edge network -// and distribute incoming application traffic across multiple endpoint resources -// in multiple AWS Regions, which increases the availability of your applications. -// Endpoints can be Elastic IP addresses, Network Load Balancers, and Application -// Load Balancers that are located in one AWS Region or multiple Regions. +// By default, Global Accelerator provides you with static IP addresses that +// you associate with your accelerator. (Instead of using the IP addresses that +// Global Accelerator provides, you can configure these entry points to be IPv4 +// addresses from your own IP address ranges that you bring to Global Accelerator.) +// The static IP addresses are anycast from the AWS edge network and distribute +// incoming application traffic across multiple endpoint resources in multiple +// AWS Regions, which increases the availability of your applications. Endpoints +// can be Network Load Balancers, Application Load Balancers, EC2 instances, +// or Elastic IP addresses that are located in one AWS Region or multiple Regions. // // Global Accelerator uses the AWS global network to route traffic to the optimal // regional endpoint based on health, client location, and policies that you @@ -32,12 +34,25 @@ // // Static IP address // -// AWS Global Accelerator provides you with a set of static IP addresses which -// are anycast from the AWS edge network and serve as the single fixed entry -// points for your clients. If you already have Elastic Load Balancing or Elastic -// IP address resources set up for your applications, you can easily add those -// to Global Accelerator to allow the resources to be accessed by a Global Accelerator -// static IP address. +// By default, AWS Global Accelerator provides you with a set of static IP addresses +// that are anycast from the AWS edge network and serve as the single fixed +// entry points for your clients. Or you can configure these entry points to +// be IPv4 addresses from your own IP address ranges that you bring to Global +// Accelerator (BYOIP). For more information, see Bring Your Own IP Addresses +// (BYOIP) (https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html) +// in the AWS Global Accelerator Developer Guide. If you already have load balancers, +// EC2 instances, or Elastic IP addresses set up for your applications, you +// can easily add those to Global Accelerator to allow the resources to be accessed +// by the static IP addresses. +// +// The static IP addresses remain assigned to your accelerator for as long as +// it exists, even if you disable the accelerator and it no longer accepts or +// routes traffic. However, when you delete an accelerator, you lose the static +// IP addresses that are assigned to it, so you can no longer route traffic +// by using them. You can use IAM policies with Global Accelerator to limit +// the users who have permissions to delete an accelerator. For more information, +// see Authentication and Access Control (https://docs.aws.amazon.com/global-accelerator/latest/dg/auth-and-access-control.html) +// in the AWS Global Accelerator Developer Guide. // // Accelerator // @@ -45,16 +60,25 @@ // to improve availability and performance for your internet applications that // have a global audience. Each accelerator includes one or more listeners. // +// DNS name +// +// Global Accelerator assigns each accelerator a default Domain Name System +// (DNS) name, similar to a1234567890abcdef.awsglobalaccelerator.com, that points +// to your Global Accelerator static IP addresses. Depending on the use case, +// you can use your accelerator's static IP addresses or DNS name to route traffic +// to your accelerator, or set up DNS records to route traffic using your own +// custom domain name. +// // Network zone // // A network zone services the static IP addresses for your accelerator from // a unique IP subnet. Similar to an AWS Availability Zone, a network zone is // an isolated unit with its own set of physical infrastructure. When you configure -// an accelerator, Global Accelerator allocates two IPv4 addresses for it. If -// one IP address from a network zone becomes unavailable due to IP address -// blocking by certain client networks, or network disruptions, then client -// applications can retry on the healthy static IP address from the other isolated -// network zone. +// an accelerator, by default, Global Accelerator allocates two IPv4 addresses +// for it. If one IP address from a network zone becomes unavailable due to +// IP address blocking by certain client networks, or network disruptions, then +// client applications can retry on the healthy static IP address from the other +// isolated network zone. // // Listener // @@ -76,13 +100,13 @@ // // Endpoint // -// An endpoint is an Elastic IP address, Network Load Balancer, or Application -// Load Balancer. Traffic is routed to endpoints based on several factors, including -// the geo-proximity to the user, the health of the endpoint, and the configuration -// options that you choose, such as endpoint weights. For each endpoint, you -// can configure weights, which are numbers that you can use to specify the -// proportion of traffic to route to each one. This can be useful, for example, -// to do performance testing within a Region. +// An endpoint is a Network Load Balancer, Application Load Balancer, EC2 instance, +// or Elastic IP address. Traffic is routed to endpoints based on several factors, +// including the geo-proximity to the user, the health of the endpoint, and +// the configuration options that you choose, such as endpoint weights. For +// each endpoint, you can configure weights, which are numbers that you can +// use to specify the proportion of traffic to route to each one. This can be +// useful, for example, to do performance testing within a Region. // // See https://docs.aws.amazon.com/goto/WebAPI/globalaccelerator-2018-08-08 for more information on this service. // diff --git a/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/errors.go b/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/errors.go index 8c1866ba2d4..4d481befa8b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/errors.go @@ -2,6 +2,10 @@ package globalaccelerator +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAcceleratorNotDisabledException for service response error code @@ -38,6 +42,12 @@ const ( // it. ErrCodeAssociatedListenerFoundException = "AssociatedListenerFoundException" + // ErrCodeByoipCidrNotFoundException for service response error code + // "ByoipCidrNotFoundException". + // + // The CIDR that you specified was not found or is incorrect. + ErrCodeByoipCidrNotFoundException = "ByoipCidrNotFoundException" + // ErrCodeEndpointGroupAlreadyExistsException for service response error code // "EndpointGroupAlreadyExistsException". // @@ -50,6 +60,13 @@ const ( // The endpoint group that you specified doesn't exist. ErrCodeEndpointGroupNotFoundException = "EndpointGroupNotFoundException" + // ErrCodeIncorrectCidrStateException for service response error code + // "IncorrectCidrStateException". + // + // The CIDR that you specified is not valid for this action. For example, the + // state of the CIDR might be incorrect for this action. + ErrCodeIncorrectCidrStateException = "IncorrectCidrStateException" + // ErrCodeInternalServiceErrorException for service response error code // "InternalServiceErrorException". // @@ -88,3 +105,21 @@ const ( // The listener that you specified doesn't exist. ErrCodeListenerNotFoundException = "ListenerNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AcceleratorNotDisabledException": newErrorAcceleratorNotDisabledException, + "AcceleratorNotFoundException": newErrorAcceleratorNotFoundException, + "AccessDeniedException": newErrorAccessDeniedException, + "AssociatedEndpointGroupFoundException": newErrorAssociatedEndpointGroupFoundException, + "AssociatedListenerFoundException": newErrorAssociatedListenerFoundException, + "ByoipCidrNotFoundException": newErrorByoipCidrNotFoundException, + "EndpointGroupAlreadyExistsException": newErrorEndpointGroupAlreadyExistsException, + "EndpointGroupNotFoundException": newErrorEndpointGroupNotFoundException, + "IncorrectCidrStateException": newErrorIncorrectCidrStateException, + "InternalServiceErrorException": newErrorInternalServiceErrorException, + "InvalidArgumentException": newErrorInvalidArgumentException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "InvalidPortRangeException": newErrorInvalidPortRangeException, + "LimitExceededException": newErrorLimitExceededException, + "ListenerNotFoundException": newErrorListenerNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/service.go b/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/service.go index 31552ab8c29..37df58b089d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/globalaccelerator/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "Global Accelerator" // Name of service. EndpointsID = "globalaccelerator" // ID to lookup a service endpoint with. - ServiceID = "Global Accelerator" // ServiceID is a unique identifer of a specific service. + ServiceID = "Global Accelerator" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the GlobalAccelerator client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a GlobalAccelerator client from just a session. // svc := globalaccelerator.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *GlobalAccelerator { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "globalaccelerator" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *GlobalAccelerator { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *GlobalAccelerator { svc := &GlobalAccelerator{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-08-08", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/glue/api.go b/vendor/github.com/aws/aws-sdk-go/service/glue/api.go index 153514a4bc3..b6f7683ddd5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/glue/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/glue/api.go @@ -66,26 +66,26 @@ func (c *Glue) BatchCreatePartitionRequest(input *BatchCreatePartitionInput) (re // See the AWS API reference guide for AWS Glue's // API operation BatchCreatePartition for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// * AlreadyExistsException // A resource to be created or added already exists. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchCreatePartition @@ -163,11 +163,11 @@ func (c *Glue) BatchDeleteConnectionRequest(input *BatchDeleteConnectionInput) ( // See the AWS API reference guide for AWS Glue's // API operation BatchDeleteConnection for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeleteConnection @@ -245,17 +245,17 @@ func (c *Glue) BatchDeletePartitionRequest(input *BatchDeletePartitionInput) (re // See the AWS API reference guide for AWS Glue's // API operation BatchDeletePartition for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeletePartition @@ -342,17 +342,17 @@ func (c *Glue) BatchDeleteTableRequest(input *BatchDeleteTableInput) (req *reque // See the AWS API reference guide for AWS Glue's // API operation BatchDeleteTable for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeleteTable @@ -430,17 +430,17 @@ func (c *Glue) BatchDeleteTableVersionRequest(input *BatchDeleteTableVersionInpu // See the AWS API reference guide for AWS Glue's // API operation BatchDeleteTableVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchDeleteTableVersion @@ -521,11 +521,11 @@ func (c *Glue) BatchGetCrawlersRequest(input *BatchGetCrawlersInput) (req *reque // See the AWS API reference guide for AWS Glue's // API operation BatchGetCrawlers for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetCrawlers @@ -606,17 +606,17 @@ func (c *Glue) BatchGetDevEndpointsRequest(input *BatchGetDevEndpointsInput) (re // See the AWS API reference guide for AWS Glue's // API operation BatchGetDevEndpoints for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // Access to a resource was denied. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetDevEndpoints @@ -697,14 +697,14 @@ func (c *Glue) BatchGetJobsRequest(input *BatchGetJobsInput) (req *request.Reque // See the AWS API reference guide for AWS Glue's // API operation BatchGetJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetJobs @@ -782,20 +782,20 @@ func (c *Glue) BatchGetPartitionRequest(input *BatchGetPartitionInput) (req *req // See the AWS API reference guide for AWS Glue's // API operation BatchGetPartition for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetPartition @@ -876,14 +876,14 @@ func (c *Glue) BatchGetTriggersRequest(input *BatchGetTriggersInput) (req *reque // See the AWS API reference guide for AWS Glue's // API operation BatchGetTriggers for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetTriggers @@ -964,14 +964,14 @@ func (c *Glue) BatchGetWorkflowsRequest(input *BatchGetWorkflowsInput) (req *req // See the AWS API reference guide for AWS Glue's // API operation BatchGetWorkflows for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchGetWorkflows @@ -1049,14 +1049,14 @@ func (c *Glue) BatchStopJobRunRequest(input *BatchStopJobRunInput) (req *request // See the AWS API reference guide for AWS Glue's // API operation BatchStopJobRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/BatchStopJobRun @@ -1137,17 +1137,17 @@ func (c *Glue) CancelMLTaskRunRequest(input *CancelMLTaskRunInput) (req *request // See the AWS API reference guide for AWS Glue's // API operation CancelMLTaskRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CancelMLTaskRun @@ -1228,14 +1228,14 @@ func (c *Glue) CreateClassifierRequest(input *CreateClassifierInput) (req *reque // See the AWS API reference guide for AWS Glue's // API operation CreateClassifier for usage and error information. // -// Returned Error Codes: -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// Returned Error Types: +// * AlreadyExistsException // A resource to be created or added already exists. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateClassifier @@ -1314,20 +1314,20 @@ func (c *Glue) CreateConnectionRequest(input *CreateConnectionInput) (req *reque // See the AWS API reference guide for AWS Glue's // API operation CreateConnection for usage and error information. // -// Returned Error Codes: -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// Returned Error Types: +// * AlreadyExistsException // A resource to be created or added already exists. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateConnection @@ -1408,17 +1408,17 @@ func (c *Glue) CreateCrawlerRequest(input *CreateCrawlerInput) (req *request.Req // See the AWS API reference guide for AWS Glue's // API operation CreateCrawler for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// * AlreadyExistsException // A resource to be created or added already exists. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateCrawler @@ -1497,23 +1497,23 @@ func (c *Glue) CreateDatabaseRequest(input *CreateDatabaseInput) (req *request.R // See the AWS API reference guide for AWS Glue's // API operation CreateDatabase for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// * AlreadyExistsException // A resource to be created or added already exists. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateDatabase @@ -1591,29 +1591,29 @@ func (c *Glue) CreateDevEndpointRequest(input *CreateDevEndpointInput) (req *req // See the AWS API reference guide for AWS Glue's // API operation CreateDevEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // Access to a resource was denied. // -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// * AlreadyExistsException // A resource to be created or added already exists. // -// * ErrCodeIdempotentParameterMismatchException "IdempotentParameterMismatchException" +// * IdempotentParameterMismatchException // The same unique identifier was associated with two different records. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // A value could not be validated. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateDevEndpoint @@ -1691,26 +1691,26 @@ func (c *Glue) CreateJobRequest(input *CreateJobInput) (req *request.Request, ou // See the AWS API reference guide for AWS Glue's // API operation CreateJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeIdempotentParameterMismatchException "IdempotentParameterMismatchException" +// * IdempotentParameterMismatchException // The same unique identifier was associated with two different records. // -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// * AlreadyExistsException // A resource to be created or added already exists. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Two processes are trying to modify a resource simultaneously. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateJob @@ -1800,26 +1800,26 @@ func (c *Glue) CreateMLTransformRequest(input *CreateMLTransformInput) (req *req // See the AWS API reference guide for AWS Glue's // API operation CreateMLTransform for usage and error information. // -// Returned Error Codes: -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// Returned Error Types: +// * AlreadyExistsException // A resource to be created or added already exists. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to a resource was denied. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeIdempotentParameterMismatchException "IdempotentParameterMismatchException" +// * IdempotentParameterMismatchException // The same unique identifier was associated with two different records. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateMLTransform @@ -1898,26 +1898,26 @@ func (c *Glue) CreatePartitionRequest(input *CreatePartitionInput) (req *request // See the AWS API reference guide for AWS Glue's // API operation CreatePartition for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// * AlreadyExistsException // A resource to be created or added already exists. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreatePartition @@ -1995,14 +1995,14 @@ func (c *Glue) CreateScriptRequest(input *CreateScriptInput) (req *request.Reque // See the AWS API reference guide for AWS Glue's // API operation CreateScript for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateScript @@ -2084,20 +2084,20 @@ func (c *Glue) CreateSecurityConfigurationRequest(input *CreateSecurityConfigura // See the AWS API reference guide for AWS Glue's // API operation CreateSecurityConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// Returned Error Types: +// * AlreadyExistsException // A resource to be created or added already exists. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateSecurityConfiguration @@ -2176,26 +2176,26 @@ func (c *Glue) CreateTableRequest(input *CreateTableInput) (req *request.Request // See the AWS API reference guide for AWS Glue's // API operation CreateTable for usage and error information. // -// Returned Error Codes: -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// Returned Error Types: +// * AlreadyExistsException // A resource to be created or added already exists. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateTable @@ -2273,29 +2273,29 @@ func (c *Glue) CreateTriggerRequest(input *CreateTriggerInput) (req *request.Req // See the AWS API reference guide for AWS Glue's // API operation CreateTrigger for usage and error information. // -// Returned Error Codes: -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// Returned Error Types: +// * AlreadyExistsException // A resource to be created or added already exists. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeIdempotentParameterMismatchException "IdempotentParameterMismatchException" +// * IdempotentParameterMismatchException // The same unique identifier was associated with two different records. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Two processes are trying to modify a resource simultaneously. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateTrigger @@ -2374,26 +2374,26 @@ func (c *Glue) CreateUserDefinedFunctionRequest(input *CreateUserDefinedFunction // See the AWS API reference guide for AWS Glue's // API operation CreateUserDefinedFunction for usage and error information. // -// Returned Error Codes: -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// Returned Error Types: +// * AlreadyExistsException // A resource to be created or added already exists. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateUserDefinedFunction @@ -2471,23 +2471,23 @@ func (c *Glue) CreateWorkflowRequest(input *CreateWorkflowInput) (req *request.R // See the AWS API reference guide for AWS Glue's // API operation CreateWorkflow for usage and error information. // -// Returned Error Codes: -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// Returned Error Types: +// * AlreadyExistsException // A resource to be created or added already exists. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Two processes are trying to modify a resource simultaneously. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/CreateWorkflow @@ -2566,11 +2566,11 @@ func (c *Glue) DeleteClassifierRequest(input *DeleteClassifierInput) (req *reque // See the AWS API reference guide for AWS Glue's // API operation DeleteClassifier for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteClassifier @@ -2649,11 +2649,11 @@ func (c *Glue) DeleteConnectionRequest(input *DeleteConnectionInput) (req *reque // See the AWS API reference guide for AWS Glue's // API operation DeleteConnection for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteConnection @@ -2733,17 +2733,17 @@ func (c *Glue) DeleteCrawlerRequest(input *DeleteCrawlerInput) (req *request.Req // See the AWS API reference guide for AWS Glue's // API operation DeleteCrawler for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeCrawlerRunningException "CrawlerRunningException" +// * CrawlerRunningException // The operation cannot be performed because the crawler is already running. // -// * ErrCodeSchedulerTransitioningException "SchedulerTransitioningException" +// * SchedulerTransitioningException // The specified scheduler is transitioning. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteCrawler @@ -2833,17 +2833,17 @@ func (c *Glue) DeleteDatabaseRequest(input *DeleteDatabaseInput) (req *request.R // See the AWS API reference guide for AWS Glue's // API operation DeleteDatabase for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteDatabase @@ -2922,17 +2922,17 @@ func (c *Glue) DeleteDevEndpointRequest(input *DeleteDevEndpointInput) (req *req // See the AWS API reference guide for AWS Glue's // API operation DeleteDevEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteDevEndpoint @@ -3011,14 +3011,14 @@ func (c *Glue) DeleteJobRequest(input *DeleteJobInput) (req *request.Request, ou // See the AWS API reference guide for AWS Glue's // API operation DeleteJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteJob @@ -3102,17 +3102,17 @@ func (c *Glue) DeleteMLTransformRequest(input *DeleteMLTransformInput) (req *req // See the AWS API reference guide for AWS Glue's // API operation DeleteMLTransform for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteMLTransform @@ -3191,17 +3191,17 @@ func (c *Glue) DeletePartitionRequest(input *DeletePartitionInput) (req *request // See the AWS API reference guide for AWS Glue's // API operation DeletePartition for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeletePartition @@ -3280,20 +3280,20 @@ func (c *Glue) DeleteResourcePolicyRequest(input *DeleteResourcePolicyInput) (re // See the AWS API reference guide for AWS Glue's // API operation DeleteResourcePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeConditionCheckFailureException "ConditionCheckFailureException" +// * ConditionCheckFailureException // A specified condition was not satisfied. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteResourcePolicy @@ -3372,17 +3372,17 @@ func (c *Glue) DeleteSecurityConfigurationRequest(input *DeleteSecurityConfigura // See the AWS API reference guide for AWS Glue's // API operation DeleteSecurityConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteSecurityConfiguration @@ -3469,17 +3469,17 @@ func (c *Glue) DeleteTableRequest(input *DeleteTableInput) (req *request.Request // See the AWS API reference guide for AWS Glue's // API operation DeleteTable for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteTable @@ -3558,17 +3558,17 @@ func (c *Glue) DeleteTableVersionRequest(input *DeleteTableVersionInput) (req *r // See the AWS API reference guide for AWS Glue's // API operation DeleteTableVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteTableVersion @@ -3647,17 +3647,17 @@ func (c *Glue) DeleteTriggerRequest(input *DeleteTriggerInput) (req *request.Req // See the AWS API reference guide for AWS Glue's // API operation DeleteTrigger for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Two processes are trying to modify a resource simultaneously. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteTrigger @@ -3736,17 +3736,17 @@ func (c *Glue) DeleteUserDefinedFunctionRequest(input *DeleteUserDefinedFunction // See the AWS API reference guide for AWS Glue's // API operation DeleteUserDefinedFunction for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteUserDefinedFunction @@ -3824,17 +3824,17 @@ func (c *Glue) DeleteWorkflowRequest(input *DeleteWorkflowInput) (req *request.R // See the AWS API reference guide for AWS Glue's // API operation DeleteWorkflow for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Two processes are trying to modify a resource simultaneously. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/DeleteWorkflow @@ -3912,11 +3912,11 @@ func (c *Glue) GetCatalogImportStatusRequest(input *GetCatalogImportStatusInput) // See the AWS API reference guide for AWS Glue's // API operation GetCatalogImportStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCatalogImportStatus @@ -3994,11 +3994,11 @@ func (c *Glue) GetClassifierRequest(input *GetClassifierInput) (req *request.Req // See the AWS API reference guide for AWS Glue's // API operation GetClassifier for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetClassifier @@ -4082,8 +4082,8 @@ func (c *Glue) GetClassifiersRequest(input *GetClassifiersInput) (req *request.R // See the AWS API reference guide for AWS Glue's // API operation GetClassifiers for usage and error information. // -// Returned Error Codes: -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// Returned Error Types: +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetClassifiers @@ -4151,10 +4151,12 @@ func (c *Glue) GetClassifiersPagesWithContext(ctx aws.Context, input *GetClassif }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetClassifiersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetClassifiersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4211,17 +4213,17 @@ func (c *Glue) GetConnectionRequest(input *GetConnectionInput) (req *request.Req // See the AWS API reference guide for AWS Glue's // API operation GetConnection for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetConnection @@ -4305,17 +4307,17 @@ func (c *Glue) GetConnectionsRequest(input *GetConnectionsInput) (req *request.R // See the AWS API reference guide for AWS Glue's // API operation GetConnections for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetConnections @@ -4383,10 +4385,12 @@ func (c *Glue) GetConnectionsPagesWithContext(ctx aws.Context, input *GetConnect }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetConnectionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetConnectionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4443,11 +4447,11 @@ func (c *Glue) GetCrawlerRequest(input *GetCrawlerInput) (req *request.Request, // See the AWS API reference guide for AWS Glue's // API operation GetCrawler for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCrawler @@ -4531,8 +4535,8 @@ func (c *Glue) GetCrawlerMetricsRequest(input *GetCrawlerMetricsInput) (req *req // See the AWS API reference guide for AWS Glue's // API operation GetCrawlerMetrics for usage and error information. // -// Returned Error Codes: -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// Returned Error Types: +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCrawlerMetrics @@ -4600,10 +4604,12 @@ func (c *Glue) GetCrawlerMetricsPagesWithContext(ctx aws.Context, input *GetCraw }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetCrawlerMetricsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetCrawlerMetricsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4666,8 +4672,8 @@ func (c *Glue) GetCrawlersRequest(input *GetCrawlersInput) (req *request.Request // See the AWS API reference guide for AWS Glue's // API operation GetCrawlers for usage and error information. // -// Returned Error Codes: -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// Returned Error Types: +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetCrawlers @@ -4735,10 +4741,12 @@ func (c *Glue) GetCrawlersPagesWithContext(ctx aws.Context, input *GetCrawlersIn }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetCrawlersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetCrawlersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4795,14 +4803,14 @@ func (c *Glue) GetDataCatalogEncryptionSettingsRequest(input *GetDataCatalogEncr // See the AWS API reference guide for AWS Glue's // API operation GetDataCatalogEncryptionSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDataCatalogEncryptionSettings @@ -4880,20 +4888,20 @@ func (c *Glue) GetDatabaseRequest(input *GetDatabaseInput) (req *request.Request // See the AWS API reference guide for AWS Glue's // API operation GetDatabase for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDatabase @@ -4977,17 +4985,17 @@ func (c *Glue) GetDatabasesRequest(input *GetDatabasesInput) (req *request.Reque // See the AWS API reference guide for AWS Glue's // API operation GetDatabases for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDatabases @@ -5055,10 +5063,12 @@ func (c *Glue) GetDatabasesPagesWithContext(ctx aws.Context, input *GetDatabases }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetDatabasesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetDatabasesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5115,14 +5125,14 @@ func (c *Glue) GetDataflowGraphRequest(input *GetDataflowGraphInput) (req *reque // See the AWS API reference guide for AWS Glue's // API operation GetDataflowGraph for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDataflowGraph @@ -5205,17 +5215,17 @@ func (c *Glue) GetDevEndpointRequest(input *GetDevEndpointInput) (req *request.R // See the AWS API reference guide for AWS Glue's // API operation GetDevEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDevEndpoint @@ -5304,17 +5314,17 @@ func (c *Glue) GetDevEndpointsRequest(input *GetDevEndpointsInput) (req *request // See the AWS API reference guide for AWS Glue's // API operation GetDevEndpoints for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetDevEndpoints @@ -5382,10 +5392,12 @@ func (c *Glue) GetDevEndpointsPagesWithContext(ctx aws.Context, input *GetDevEnd }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetDevEndpointsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetDevEndpointsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5442,17 +5454,17 @@ func (c *Glue) GetJobRequest(input *GetJobInput) (req *request.Request, output * // See the AWS API reference guide for AWS Glue's // API operation GetJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJob @@ -5530,20 +5542,20 @@ func (c *Glue) GetJobBookmarkRequest(input *GetJobBookmarkInput) (req *request.R // See the AWS API reference guide for AWS Glue's // API operation GetJobBookmark for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // A value could not be validated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJobBookmark @@ -5621,17 +5633,17 @@ func (c *Glue) GetJobRunRequest(input *GetJobRunInput) (req *request.Request, ou // See the AWS API reference guide for AWS Glue's // API operation GetJobRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJobRun @@ -5715,17 +5727,17 @@ func (c *Glue) GetJobRunsRequest(input *GetJobRunsInput) (req *request.Request, // See the AWS API reference guide for AWS Glue's // API operation GetJobRuns for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJobRuns @@ -5793,10 +5805,12 @@ func (c *Glue) GetJobRunsPagesWithContext(ctx aws.Context, input *GetJobRunsInpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetJobRunsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetJobRunsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5859,17 +5873,17 @@ func (c *Glue) GetJobsRequest(input *GetJobsInput) (req *request.Request, output // See the AWS API reference guide for AWS Glue's // API operation GetJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetJobs @@ -5937,10 +5951,12 @@ func (c *Glue) GetJobsPagesWithContext(ctx aws.Context, input *GetJobsInput, fn }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetJobsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetJobsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6001,17 +6017,17 @@ func (c *Glue) GetMLTaskRunRequest(input *GetMLTaskRunInput) (req *request.Reque // See the AWS API reference guide for AWS Glue's // API operation GetMLTaskRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetMLTaskRun @@ -6102,17 +6118,17 @@ func (c *Glue) GetMLTaskRunsRequest(input *GetMLTaskRunsInput) (req *request.Req // See the AWS API reference guide for AWS Glue's // API operation GetMLTaskRuns for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetMLTaskRuns @@ -6180,10 +6196,12 @@ func (c *Glue) GetMLTaskRunsPagesWithContext(ctx aws.Context, input *GetMLTaskRu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetMLTaskRunsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetMLTaskRunsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6244,17 +6262,17 @@ func (c *Glue) GetMLTransformRequest(input *GetMLTransformInput) (req *request.R // See the AWS API reference guide for AWS Glue's // API operation GetMLTransform for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetMLTransform @@ -6342,17 +6360,17 @@ func (c *Glue) GetMLTransformsRequest(input *GetMLTransformsInput) (req *request // See the AWS API reference guide for AWS Glue's // API operation GetMLTransforms for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetMLTransforms @@ -6420,10 +6438,12 @@ func (c *Glue) GetMLTransformsPagesWithContext(ctx aws.Context, input *GetMLTran }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetMLTransformsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetMLTransformsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6480,17 +6500,17 @@ func (c *Glue) GetMappingRequest(input *GetMappingInput) (req *request.Request, // See the AWS API reference guide for AWS Glue's // API operation GetMapping for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetMapping @@ -6568,20 +6588,20 @@ func (c *Glue) GetPartitionRequest(input *GetPartitionInput) (req *request.Reque // See the AWS API reference guide for AWS Glue's // API operation GetPartition for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetPartition @@ -6665,20 +6685,20 @@ func (c *Glue) GetPartitionsRequest(input *GetPartitionsInput) (req *request.Req // See the AWS API reference guide for AWS Glue's // API operation GetPartitions for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetPartitions @@ -6746,10 +6766,12 @@ func (c *Glue) GetPartitionsPagesWithContext(ctx aws.Context, input *GetPartitio }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetPartitionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetPartitionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6806,14 +6828,14 @@ func (c *Glue) GetPlanRequest(input *GetPlanInput) (req *request.Request, output // See the AWS API reference guide for AWS Glue's // API operation GetPlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetPlan @@ -6891,17 +6913,17 @@ func (c *Glue) GetResourcePolicyRequest(input *GetResourcePolicyInput) (req *req // See the AWS API reference guide for AWS Glue's // API operation GetResourcePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetResourcePolicy @@ -6979,17 +7001,17 @@ func (c *Glue) GetSecurityConfigurationRequest(input *GetSecurityConfigurationIn // See the AWS API reference guide for AWS Glue's // API operation GetSecurityConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetSecurityConfiguration @@ -7073,17 +7095,17 @@ func (c *Glue) GetSecurityConfigurationsRequest(input *GetSecurityConfigurations // See the AWS API reference guide for AWS Glue's // API operation GetSecurityConfigurations for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetSecurityConfigurations @@ -7151,10 +7173,12 @@ func (c *Glue) GetSecurityConfigurationsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetSecurityConfigurationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetSecurityConfigurationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7211,20 +7235,20 @@ func (c *Glue) GetTableRequest(input *GetTableInput) (req *request.Request, outp // See the AWS API reference guide for AWS Glue's // API operation GetTable for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTable @@ -7302,20 +7326,20 @@ func (c *Glue) GetTableVersionRequest(input *GetTableVersionInput) (req *request // See the AWS API reference guide for AWS Glue's // API operation GetTableVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTableVersion @@ -7400,20 +7424,20 @@ func (c *Glue) GetTableVersionsRequest(input *GetTableVersionsInput) (req *reque // See the AWS API reference guide for AWS Glue's // API operation GetTableVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTableVersions @@ -7481,10 +7505,12 @@ func (c *Glue) GetTableVersionsPagesWithContext(ctx aws.Context, input *GetTable }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTableVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetTableVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7547,20 +7573,20 @@ func (c *Glue) GetTablesRequest(input *GetTablesInput) (req *request.Request, ou // See the AWS API reference guide for AWS Glue's // API operation GetTables for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTables @@ -7628,10 +7654,12 @@ func (c *Glue) GetTablesPagesWithContext(ctx aws.Context, input *GetTablesInput, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTablesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetTablesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7688,17 +7716,17 @@ func (c *Glue) GetTagsRequest(input *GetTagsInput) (req *request.Request, output // See the AWS API reference guide for AWS Glue's // API operation GetTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTags @@ -7776,17 +7804,17 @@ func (c *Glue) GetTriggerRequest(input *GetTriggerInput) (req *request.Request, // See the AWS API reference guide for AWS Glue's // API operation GetTrigger for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTrigger @@ -7870,17 +7898,17 @@ func (c *Glue) GetTriggersRequest(input *GetTriggersInput) (req *request.Request // See the AWS API reference guide for AWS Glue's // API operation GetTriggers for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetTriggers @@ -7948,10 +7976,12 @@ func (c *Glue) GetTriggersPagesWithContext(ctx aws.Context, input *GetTriggersIn }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTriggersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetTriggersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8008,20 +8038,20 @@ func (c *Glue) GetUserDefinedFunctionRequest(input *GetUserDefinedFunctionInput) // See the AWS API reference guide for AWS Glue's // API operation GetUserDefinedFunction for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetUserDefinedFunction @@ -8105,20 +8135,20 @@ func (c *Glue) GetUserDefinedFunctionsRequest(input *GetUserDefinedFunctionsInpu // See the AWS API reference guide for AWS Glue's // API operation GetUserDefinedFunctions for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetUserDefinedFunctions @@ -8186,10 +8216,12 @@ func (c *Glue) GetUserDefinedFunctionsPagesWithContext(ctx aws.Context, input *G }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetUserDefinedFunctionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetUserDefinedFunctionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8246,17 +8278,17 @@ func (c *Glue) GetWorkflowRequest(input *GetWorkflowInput) (req *request.Request // See the AWS API reference guide for AWS Glue's // API operation GetWorkflow for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetWorkflow @@ -8334,17 +8366,17 @@ func (c *Glue) GetWorkflowRunRequest(input *GetWorkflowRunInput) (req *request.R // See the AWS API reference guide for AWS Glue's // API operation GetWorkflowRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetWorkflowRun @@ -8422,17 +8454,17 @@ func (c *Glue) GetWorkflowRunPropertiesRequest(input *GetWorkflowRunPropertiesIn // See the AWS API reference guide for AWS Glue's // API operation GetWorkflowRunProperties for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetWorkflowRunProperties @@ -8516,17 +8548,17 @@ func (c *Glue) GetWorkflowRunsRequest(input *GetWorkflowRunsInput) (req *request // See the AWS API reference guide for AWS Glue's // API operation GetWorkflowRuns for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/GetWorkflowRuns @@ -8594,10 +8626,12 @@ func (c *Glue) GetWorkflowRunsPagesWithContext(ctx aws.Context, input *GetWorkfl }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetWorkflowRunsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetWorkflowRunsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8655,11 +8689,11 @@ func (c *Glue) ImportCatalogToGlueRequest(input *ImportCatalogToGlueInput) (req // See the AWS API reference guide for AWS Glue's // API operation ImportCatalogToGlue for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ImportCatalogToGlue @@ -8749,8 +8783,8 @@ func (c *Glue) ListCrawlersRequest(input *ListCrawlersInput) (req *request.Reque // See the AWS API reference guide for AWS Glue's // API operation ListCrawlers for usage and error information. // -// Returned Error Codes: -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// Returned Error Types: +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListCrawlers @@ -8818,10 +8852,12 @@ func (c *Glue) ListCrawlersPagesWithContext(ctx aws.Context, input *ListCrawlers }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCrawlersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListCrawlersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8890,17 +8926,17 @@ func (c *Glue) ListDevEndpointsRequest(input *ListDevEndpointsInput) (req *reque // See the AWS API reference guide for AWS Glue's // API operation ListDevEndpoints for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListDevEndpoints @@ -8968,10 +9004,12 @@ func (c *Glue) ListDevEndpointsPagesWithContext(ctx aws.Context, input *ListDevE }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDevEndpointsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDevEndpointsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -9040,17 +9078,17 @@ func (c *Glue) ListJobsRequest(input *ListJobsInput) (req *request.Request, outp // See the AWS API reference guide for AWS Glue's // API operation ListJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListJobs @@ -9118,10 +9156,162 @@ func (c *Glue) ListJobsPagesWithContext(ctx aws.Context, input *ListJobsInput, f }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListMLTransforms = "ListMLTransforms" + +// ListMLTransformsRequest generates a "aws/request.Request" representing the +// client's request for the ListMLTransforms operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListMLTransforms for more information on using the ListMLTransforms +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListMLTransformsRequest method. +// req, resp := client.ListMLTransformsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListMLTransforms +func (c *Glue) ListMLTransformsRequest(input *ListMLTransformsInput) (req *request.Request, output *ListMLTransformsOutput) { + op := &request.Operation{ + Name: opListMLTransforms, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListMLTransformsInput{} + } + + output = &ListMLTransformsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListMLTransforms API operation for AWS Glue. +// +// Retrieves a sortable, filterable list of existing AWS Glue machine learning +// transforms in this AWS account, or the resources with the specified tag. +// This operation takes the optional Tags field, which you can use as a filter +// of the responses so that tagged resources can be retrieved as a group. If +// you choose to use tag filtering, only resources with the tags are retrieved. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Glue's +// API operation ListMLTransforms for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// A specified entity does not exist +// +// * InvalidInputException +// The input provided was not valid. +// +// * OperationTimeoutException +// The operation timed out. +// +// * InternalServiceException +// An internal service error occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListMLTransforms +func (c *Glue) ListMLTransforms(input *ListMLTransformsInput) (*ListMLTransformsOutput, error) { + req, out := c.ListMLTransformsRequest(input) + return out, req.Send() +} + +// ListMLTransformsWithContext is the same as ListMLTransforms with the addition of +// the ability to pass a context and additional request options. +// +// See ListMLTransforms for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Glue) ListMLTransformsWithContext(ctx aws.Context, input *ListMLTransformsInput, opts ...request.Option) (*ListMLTransformsOutput, error) { + req, out := c.ListMLTransformsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListMLTransformsPages iterates over the pages of a ListMLTransforms operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListMLTransforms 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 ListMLTransforms operation. +// pageNum := 0 +// err := client.ListMLTransformsPages(params, +// func(page *glue.ListMLTransformsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Glue) ListMLTransformsPages(input *ListMLTransformsInput, fn func(*ListMLTransformsOutput, bool) bool) error { + return c.ListMLTransformsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListMLTransformsPagesWithContext same as ListMLTransformsPages 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 *Glue) ListMLTransformsPagesWithContext(ctx aws.Context, input *ListMLTransformsInput, fn func(*ListMLTransformsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListMLTransformsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListMLTransformsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListMLTransformsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -9190,17 +9380,17 @@ func (c *Glue) ListTriggersRequest(input *ListTriggersInput) (req *request.Reque // See the AWS API reference guide for AWS Glue's // API operation ListTriggers for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListTriggers @@ -9268,10 +9458,12 @@ func (c *Glue) ListTriggersPagesWithContext(ctx aws.Context, input *ListTriggers }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTriggersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTriggersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -9334,14 +9526,14 @@ func (c *Glue) ListWorkflowsRequest(input *ListWorkflowsInput) (req *request.Req // See the AWS API reference guide for AWS Glue's // API operation ListWorkflows for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ListWorkflows @@ -9409,10 +9601,12 @@ func (c *Glue) ListWorkflowsPagesWithContext(ctx aws.Context, input *ListWorkflo }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListWorkflowsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListWorkflowsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -9472,14 +9666,14 @@ func (c *Glue) PutDataCatalogEncryptionSettingsRequest(input *PutDataCatalogEncr // See the AWS API reference guide for AWS Glue's // API operation PutDataCatalogEncryptionSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/PutDataCatalogEncryptionSettings @@ -9557,20 +9751,20 @@ func (c *Glue) PutResourcePolicyRequest(input *PutResourcePolicyInput) (req *req // See the AWS API reference guide for AWS Glue's // API operation PutResourcePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeConditionCheckFailureException "ConditionCheckFailureException" +// * ConditionCheckFailureException // A specified condition was not satisfied. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/PutResourcePolicy @@ -9651,26 +9845,26 @@ func (c *Glue) PutWorkflowRunPropertiesRequest(input *PutWorkflowRunPropertiesIn // See the AWS API reference guide for AWS Glue's // API operation PutWorkflowRunProperties for usage and error information. // -// Returned Error Codes: -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// Returned Error Types: +// * AlreadyExistsException // A resource to be created or added already exists. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Two processes are trying to modify a resource simultaneously. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/PutWorkflowRunProperties @@ -9748,17 +9942,17 @@ func (c *Glue) ResetJobBookmarkRequest(input *ResetJobBookmarkInput) (req *reque // See the AWS API reference guide for AWS Glue's // API operation ResetJobBookmark for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/ResetJobBookmark @@ -9851,14 +10045,14 @@ func (c *Glue) SearchTablesRequest(input *SearchTablesInput) (req *request.Reque // See the AWS API reference guide for AWS Glue's // API operation SearchTables for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/SearchTables @@ -9926,10 +10120,12 @@ func (c *Glue) SearchTablesPagesWithContext(ctx aws.Context, input *SearchTables }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SearchTablesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*SearchTablesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -9988,14 +10184,14 @@ func (c *Glue) StartCrawlerRequest(input *StartCrawlerInput) (req *request.Reque // See the AWS API reference guide for AWS Glue's // API operation StartCrawler for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeCrawlerRunningException "CrawlerRunningException" +// * CrawlerRunningException // The operation cannot be performed because the crawler is already running. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartCrawler @@ -10075,20 +10271,20 @@ func (c *Glue) StartCrawlerScheduleRequest(input *StartCrawlerScheduleInput) (re // See the AWS API reference guide for AWS Glue's // API operation StartCrawlerSchedule for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeSchedulerRunningException "SchedulerRunningException" +// * SchedulerRunningException // The specified scheduler is already running. // -// * ErrCodeSchedulerTransitioningException "SchedulerTransitioningException" +// * SchedulerTransitioningException // The specified scheduler is transitioning. // -// * ErrCodeNoScheduleException "NoScheduleException" +// * NoScheduleException // There is no applicable schedule. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartCrawlerSchedule @@ -10174,17 +10370,17 @@ func (c *Glue) StartExportLabelsTaskRunRequest(input *StartExportLabelsTaskRunIn // See the AWS API reference guide for AWS Glue's // API operation StartExportLabelsTaskRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartExportLabelsTaskRun @@ -10287,20 +10483,20 @@ func (c *Glue) StartImportLabelsTaskRunRequest(input *StartImportLabelsTaskRunIn // See the AWS API reference guide for AWS Glue's // API operation StartImportLabelsTaskRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartImportLabelsTaskRun @@ -10378,23 +10574,23 @@ func (c *Glue) StartJobRunRequest(input *StartJobRunInput) (req *request.Request // See the AWS API reference guide for AWS Glue's // API operation StartJobRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeConcurrentRunsExceededException "ConcurrentRunsExceededException" +// * ConcurrentRunsExceededException // Too many jobs are being run concurrently. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartJobRun @@ -10479,23 +10675,23 @@ func (c *Glue) StartMLEvaluationTaskRunRequest(input *StartMLEvaluationTaskRunIn // See the AWS API reference guide for AWS Glue's // API operation StartMLEvaluationTaskRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeConcurrentRunsExceededException "ConcurrentRunsExceededException" +// * ConcurrentRunsExceededException // Too many jobs are being run concurrently. // -// * ErrCodeMLTransformNotReadyException "MLTransformNotReadyException" +// * MLTransformNotReadyException // The machine learning transform is not ready to run. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartMLEvaluationTaskRun @@ -10586,20 +10782,20 @@ func (c *Glue) StartMLLabelingSetGenerationTaskRunRequest(input *StartMLLabeling // See the AWS API reference guide for AWS Glue's // API operation StartMLLabelingSetGenerationTaskRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeConcurrentRunsExceededException "ConcurrentRunsExceededException" +// * ConcurrentRunsExceededException // Too many jobs are being run concurrently. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartMLLabelingSetGenerationTaskRun @@ -10678,23 +10874,23 @@ func (c *Glue) StartTriggerRequest(input *StartTriggerInput) (req *request.Reque // See the AWS API reference guide for AWS Glue's // API operation StartTrigger for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeConcurrentRunsExceededException "ConcurrentRunsExceededException" +// * ConcurrentRunsExceededException // Too many jobs are being run concurrently. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartTrigger @@ -10772,23 +10968,23 @@ func (c *Glue) StartWorkflowRunRequest(input *StartWorkflowRunInput) (req *reque // See the AWS API reference guide for AWS Glue's // API operation StartWorkflowRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeConcurrentRunsExceededException "ConcurrentRunsExceededException" +// * ConcurrentRunsExceededException // Too many jobs are being run concurrently. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StartWorkflowRun @@ -10867,17 +11063,17 @@ func (c *Glue) StopCrawlerRequest(input *StopCrawlerInput) (req *request.Request // See the AWS API reference guide for AWS Glue's // API operation StopCrawler for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeCrawlerNotRunningException "CrawlerNotRunningException" +// * CrawlerNotRunningException // The specified crawler is not running. // -// * ErrCodeCrawlerStoppingException "CrawlerStoppingException" +// * CrawlerStoppingException // The specified crawler is stopping. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StopCrawler @@ -10957,17 +11153,17 @@ func (c *Glue) StopCrawlerScheduleRequest(input *StopCrawlerScheduleInput) (req // See the AWS API reference guide for AWS Glue's // API operation StopCrawlerSchedule for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeSchedulerNotRunningException "SchedulerNotRunningException" +// * SchedulerNotRunningException // The specified scheduler is not running. // -// * ErrCodeSchedulerTransitioningException "SchedulerTransitioningException" +// * SchedulerTransitioningException // The specified scheduler is transitioning. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StopCrawlerSchedule @@ -11045,20 +11241,20 @@ func (c *Glue) StopTriggerRequest(input *StopTriggerInput) (req *request.Request // See the AWS API reference guide for AWS Glue's // API operation StopTrigger for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Two processes are trying to modify a resource simultaneously. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/StopTrigger @@ -11139,17 +11335,17 @@ func (c *Glue) TagResourceRequest(input *TagResourceInput) (req *request.Request // See the AWS API reference guide for AWS Glue's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/TagResource @@ -11228,17 +11424,17 @@ func (c *Glue) UntagResourceRequest(input *UntagResourceInput) (req *request.Req // See the AWS API reference guide for AWS Glue's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UntagResource @@ -11318,17 +11514,17 @@ func (c *Glue) UpdateClassifierRequest(input *UpdateClassifierInput) (req *reque // See the AWS API reference guide for AWS Glue's // API operation UpdateClassifier for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeVersionMismatchException "VersionMismatchException" +// * VersionMismatchException // There was a version conflict. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateClassifier @@ -11407,20 +11603,20 @@ func (c *Glue) UpdateConnectionRequest(input *UpdateConnectionInput) (req *reque // See the AWS API reference guide for AWS Glue's // API operation UpdateConnection for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateConnection @@ -11500,20 +11696,20 @@ func (c *Glue) UpdateCrawlerRequest(input *UpdateCrawlerInput) (req *request.Req // See the AWS API reference guide for AWS Glue's // API operation UpdateCrawler for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeVersionMismatchException "VersionMismatchException" +// * VersionMismatchException // There was a version conflict. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeCrawlerRunningException "CrawlerRunningException" +// * CrawlerRunningException // The operation cannot be performed because the crawler is already running. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateCrawler @@ -11592,20 +11788,20 @@ func (c *Glue) UpdateCrawlerScheduleRequest(input *UpdateCrawlerScheduleInput) ( // See the AWS API reference guide for AWS Glue's // API operation UpdateCrawlerSchedule for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeVersionMismatchException "VersionMismatchException" +// * VersionMismatchException // There was a version conflict. // -// * ErrCodeSchedulerTransitioningException "SchedulerTransitioningException" +// * SchedulerTransitioningException // The specified scheduler is transitioning. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateCrawlerSchedule @@ -11684,20 +11880,20 @@ func (c *Glue) UpdateDatabaseRequest(input *UpdateDatabaseInput) (req *request.R // See the AWS API reference guide for AWS Glue's // API operation UpdateDatabase for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateDatabase @@ -11776,20 +11972,20 @@ func (c *Glue) UpdateDevEndpointRequest(input *UpdateDevEndpointInput) (req *req // See the AWS API reference guide for AWS Glue's // API operation UpdateDevEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeValidationException "ValidationException" +// * ValidationException // A value could not be validated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateDevEndpoint @@ -11867,20 +12063,20 @@ func (c *Glue) UpdateJobRequest(input *UpdateJobInput) (req *request.Request, ou // See the AWS API reference guide for AWS Glue's // API operation UpdateJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Two processes are trying to modify a resource simultaneously. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateJob @@ -11963,20 +12159,20 @@ func (c *Glue) UpdateMLTransformRequest(input *UpdateMLTransformInput) (req *req // See the AWS API reference guide for AWS Glue's // API operation UpdateMLTransform for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to a resource was denied. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateMLTransform @@ -12055,20 +12251,20 @@ func (c *Glue) UpdatePartitionRequest(input *UpdatePartitionInput) (req *request // See the AWS API reference guide for AWS Glue's // API operation UpdatePartition for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdatePartition @@ -12147,26 +12343,26 @@ func (c *Glue) UpdateTableRequest(input *UpdateTableInput) (req *request.Request // See the AWS API reference guide for AWS Glue's // API operation UpdateTable for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Two processes are trying to modify a resource simultaneously. // -// * ErrCodeResourceNumberLimitExceededException "ResourceNumberLimitExceededException" +// * ResourceNumberLimitExceededException // A resource numerical limit was exceeded. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateTable @@ -12244,20 +12440,20 @@ func (c *Glue) UpdateTriggerRequest(input *UpdateTriggerInput) (req *request.Req // See the AWS API reference guide for AWS Glue's // API operation UpdateTrigger for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Two processes are trying to modify a resource simultaneously. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateTrigger @@ -12336,20 +12532,20 @@ func (c *Glue) UpdateUserDefinedFunctionRequest(input *UpdateUserDefinedFunction // See the AWS API reference guide for AWS Glue's // API operation UpdateUserDefinedFunction for usage and error information. // -// Returned Error Codes: -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// Returned Error Types: +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEncryptionException "GlueEncryptionException" +// * EncryptionException // An encryption operation failed. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateUserDefinedFunction @@ -12427,20 +12623,20 @@ func (c *Glue) UpdateWorkflowRequest(input *UpdateWorkflowInput) (req *request.R // See the AWS API reference guide for AWS Glue's // API operation UpdateWorkflow for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Two processes are trying to modify a resource simultaneously. // // See also, https://docs.aws.amazon.com/goto/WebAPI/glue-2017-03-31/UpdateWorkflow @@ -12465,6 +12661,63 @@ func (c *Glue) UpdateWorkflowWithContext(ctx aws.Context, input *UpdateWorkflowI return out, req.Send() } +// Access to a resource was denied. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + // Defines an action to be initiated by a trigger. type Action struct { _ struct{} `type:"structure"` @@ -12576,6 +12829,63 @@ func (s *Action) SetTimeout(v int64) *Action { return s } +// A resource to be created or added already exists. +type AlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorAlreadyExistsException(v protocol.ResponseMetadata) error { + return &AlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AlreadyExistsException) Code() string { + return "AlreadyExistsException" +} + +// Message returns the exception's message. +func (s AlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AlreadyExistsException) OrigErr() error { + return nil +} + +func (s AlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + type BatchCreatePartitionInput struct { _ struct{} `type:"structure"` @@ -14402,69 +14712,183 @@ func (s *Column) SetType(v string) *Column { return s } -// Defines a condition under which a trigger fires. -type Condition struct { - _ struct{} `type:"structure"` - - // The state of the crawler to which this condition applies. - CrawlState *string `type:"string" enum:"CrawlState"` - - // The name of the crawler to which this condition applies. - CrawlerName *string `min:"1" type:"string"` - - // The name of the job whose JobRuns this condition applies to, and on which - // this trigger waits. - JobName *string `min:"1" type:"string"` - - // A logical operator. - LogicalOperator *string `type:"string" enum:"LogicalOperator"` +// Two processes are trying to modify a resource simultaneously. +type ConcurrentModificationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The condition state. Currently, the values supported are SUCCEEDED, STOPPED, - // TIMEOUT, and FAILED. - State *string `type:"string" enum:"JobRunState"` + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s Condition) String() string { +func (s ConcurrentModificationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Condition) GoString() string { +func (s ConcurrentModificationException) 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.CrawlerName != nil && len(*s.CrawlerName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CrawlerName", 1)) - } - if s.JobName != nil && len(*s.JobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobName", 1)) +func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { + return &ConcurrentModificationException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s ConcurrentModificationException) Code() string { + return "ConcurrentModificationException" +} + +// Message returns the exception's message. +func (s ConcurrentModificationException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentModificationException) OrigErr() error { return nil } -// SetCrawlState sets the CrawlState field's value. -func (s *Condition) SetCrawlState(v string) *Condition { - s.CrawlState = &v - return s +func (s ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetCrawlerName sets the CrawlerName field's value. -func (s *Condition) SetCrawlerName(v string) *Condition { - s.CrawlerName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentModificationException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetJobName sets the JobName field's value. -func (s *Condition) SetJobName(v string) *Condition { - s.JobName = &v +// RequestID returns the service's response RequestID for request. +func (s ConcurrentModificationException) RequestID() string { + return s.respMetadata.RequestID +} + +// Too many jobs are being run concurrently. +type ConcurrentRunsExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentRunsExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentRunsExceededException) GoString() string { + return s.String() +} + +func newErrorConcurrentRunsExceededException(v protocol.ResponseMetadata) error { + return &ConcurrentRunsExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentRunsExceededException) Code() string { + return "ConcurrentRunsExceededException" +} + +// Message returns the exception's message. +func (s ConcurrentRunsExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentRunsExceededException) OrigErr() error { + return nil +} + +func (s ConcurrentRunsExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentRunsExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentRunsExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// Defines a condition under which a trigger fires. +type Condition struct { + _ struct{} `type:"structure"` + + // The state of the crawler to which this condition applies. + CrawlState *string `type:"string" enum:"CrawlState"` + + // The name of the crawler to which this condition applies. + CrawlerName *string `min:"1" type:"string"` + + // The name of the job whose JobRuns this condition applies to, and on which + // this trigger waits. + JobName *string `min:"1" type:"string"` + + // A logical operator. + LogicalOperator *string `type:"string" enum:"LogicalOperator"` + + // The condition state. Currently, the values supported are SUCCEEDED, STOPPED, + // TIMEOUT, and FAILED. + State *string `type:"string" enum:"JobRunState"` +} + +// 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.CrawlerName != nil && len(*s.CrawlerName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CrawlerName", 1)) + } + if s.JobName != nil && len(*s.JobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("JobName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCrawlState sets the CrawlState field's value. +func (s *Condition) SetCrawlState(v string) *Condition { + s.CrawlState = &v + return s +} + +// SetCrawlerName sets the CrawlerName field's value. +func (s *Condition) SetCrawlerName(v string) *Condition { + s.CrawlerName = &v + return s +} + +// SetJobName sets the JobName field's value. +func (s *Condition) SetJobName(v string) *Condition { + s.JobName = &v return s } @@ -14480,6 +14904,63 @@ func (s *Condition) SetState(v string) *Condition { return s } +// A specified condition was not satisfied. +type ConditionCheckFailureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ConditionCheckFailureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConditionCheckFailureException) GoString() string { + return s.String() +} + +func newErrorConditionCheckFailureException(v protocol.ResponseMetadata) error { + return &ConditionCheckFailureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConditionCheckFailureException) Code() string { + return "ConditionCheckFailureException" +} + +// Message returns the exception's message. +func (s ConditionCheckFailureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConditionCheckFailureException) OrigErr() error { + return nil +} + +func (s ConditionCheckFailureException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConditionCheckFailureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConditionCheckFailureException) RequestID() string { + return s.respMetadata.RequestID +} + // The confusion matrix shows you what your transform is predicting accurately // and what types of errors it is making. // @@ -14578,6 +15059,25 @@ type Connection struct { // * JDBC_ENFORCE_SSL - A Boolean string (true, false) specifying whether // Secure Sockets Layer (SSL) with hostname matching is enforced for the // JDBC connection on the client. The default is false. + // + // * CUSTOM_JDBC_CERT - An Amazon S3 location specifying the customer's root + // certificate. AWS Glue uses this root certificate to validate the customer’s + // certificate when connecting to the customer database. AWS Glue only handles + // X.509 certificates. The certificate provided must be DER-encoded and supplied + // in Base64 encoding PEM format. + // + // * SKIP_CUSTOM_JDBC_CERT_VALIDATION - By default, this is false. AWS Glue + // validates the Signature algorithm and Subject Public Key Algorithm for + // the customer certificate. The only permitted algorithms for the Signature + // algorithm are SHA256withRSA, SHA384withRSA or SHA512withRSA. For the Subject + // Public Key Algorithm, the key length must be at least 2048. You can set + // the value of this property to true to skip AWS Glue’s validation of + // the customer certificate. + // + // * CUSTOM_JDBC_CERT_STRING - A custom JDBC certificate string which is + // used for domain match or distinguished name match to prevent a man-in-the-middle + // attack. In Oracle database, this is used as the SSL_SERVER_CERT_DN; in + // Microsoft SQL Server, this is used as the hostNameInCertificate. ConnectionProperties map[string]*string `type:"map"` // The type of the connection. Currently, only JDBC is supported; SFTP is not @@ -15228,6 +15728,177 @@ func (s *CrawlerNodeDetails) SetCrawls(v []*Crawl) *CrawlerNodeDetails { return s } +// The specified crawler is not running. +type CrawlerNotRunningException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s CrawlerNotRunningException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CrawlerNotRunningException) GoString() string { + return s.String() +} + +func newErrorCrawlerNotRunningException(v protocol.ResponseMetadata) error { + return &CrawlerNotRunningException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CrawlerNotRunningException) Code() string { + return "CrawlerNotRunningException" +} + +// Message returns the exception's message. +func (s CrawlerNotRunningException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CrawlerNotRunningException) OrigErr() error { + return nil +} + +func (s CrawlerNotRunningException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CrawlerNotRunningException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CrawlerNotRunningException) RequestID() string { + return s.respMetadata.RequestID +} + +// The operation cannot be performed because the crawler is already running. +type CrawlerRunningException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s CrawlerRunningException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CrawlerRunningException) GoString() string { + return s.String() +} + +func newErrorCrawlerRunningException(v protocol.ResponseMetadata) error { + return &CrawlerRunningException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CrawlerRunningException) Code() string { + return "CrawlerRunningException" +} + +// Message returns the exception's message. +func (s CrawlerRunningException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CrawlerRunningException) OrigErr() error { + return nil +} + +func (s CrawlerRunningException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CrawlerRunningException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CrawlerRunningException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified crawler is stopping. +type CrawlerStoppingException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s CrawlerStoppingException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CrawlerStoppingException) GoString() string { + return s.String() +} + +func newErrorCrawlerStoppingException(v protocol.ResponseMetadata) error { + return &CrawlerStoppingException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CrawlerStoppingException) Code() string { + return "CrawlerStoppingException" +} + +// Message returns the exception's message. +func (s CrawlerStoppingException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CrawlerStoppingException) OrigErr() error { + return nil +} + +func (s CrawlerStoppingException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CrawlerStoppingException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CrawlerStoppingException) RequestID() string { + return s.respMetadata.RequestID +} + // Specifies data stores to crawl. type CrawlerTargets struct { _ struct{} `type:"structure"` @@ -16411,6 +17082,9 @@ type CreateJobInput struct { // Name is a required field Name *string `min:"1" type:"string" required:"true"` + // Non-overridable arguments for this job, specified as name-value pairs. + NonOverridableArguments map[string]*string `type:"map"` + // Specifies configuration properties of a job notification. NotificationProperty *NotificationProperty `type:"structure"` @@ -16568,6 +17242,12 @@ func (s *CreateJobInput) SetName(v string) *CreateJobInput { return s } +// SetNonOverridableArguments sets the NonOverridableArguments field's value. +func (s *CreateJobInput) SetNonOverridableArguments(v map[string]*string) *CreateJobInput { + s.NonOverridableArguments = v + return s +} + // SetNotificationProperty sets the NotificationProperty field's value. func (s *CreateJobInput) SetNotificationProperty(v *NotificationProperty) *CreateJobInput { s.NotificationProperty = v @@ -16698,6 +17378,13 @@ type CreateMLTransformInput struct { // default is an empty string. Description *string `type:"string"` + // This value determines which version of AWS Glue this machine learning transform + // is compatible with. Glue 1.0 is recommended for most customers. If the value + // is not set, the Glue compatibility defaults to Glue 0.9. For more information, + // see AWS Glue Versions (https://docs.aws.amazon.com/glue/latest/dg/release-notes.html#release-notes-versions) + // in the developer guide. + GlueVersion *string `min:"1" type:"string"` + // A list of AWS Glue table definitions used by the transform. // // InputRecordTables is a required field @@ -16709,6 +17396,21 @@ type CreateMLTransformInput struct { // vCPUs of compute capacity and 16 GB of memory. For more information, see // the AWS Glue pricing page (https://aws.amazon.com/glue/pricing/). // + // MaxCapacity is a mutually exclusive option with NumberOfWorkers and WorkerType. + // + // * If either NumberOfWorkers or WorkerType is set, then MaxCapacity cannot + // be set. + // + // * If MaxCapacity is set then neither NumberOfWorkers or WorkerType can + // be set. + // + // * If WorkerType is set, then NumberOfWorkers is required (and vice versa). + // + // * MaxCapacity and NumberOfWorkers must both be at least 1. + // + // When the WorkerType field is set to a value other than Standard, the MaxCapacity + // field is set automatically and becomes read-only. + // // When the WorkerType field is set to a value other than Standard, the MaxCapacity // field is set automatically and becomes read-only. MaxCapacity *float64 `type:"double"` @@ -16724,6 +17426,8 @@ type CreateMLTransformInput struct { // The number of workers of a defined workerType that are allocated when this // task runs. + // + // If WorkerType is set, then NumberOfWorkers is required (and vice versa). NumberOfWorkers *int64 `type:"integer"` // The algorithmic parameters that are specific to the transform type used. @@ -16733,13 +17437,27 @@ type CreateMLTransformInput struct { Parameters *TransformParameters `type:"structure" required:"true"` // The name or Amazon Resource Name (ARN) of the IAM role with the required - // permissions. Ensure that this role has permission to your Amazon Simple Storage - // Service (Amazon S3) sources, targets, temporary directory, scripts, and any - // libraries that are used by the task run for this transform. + // permissions. The required permissions include both AWS Glue service role + // permissions to AWS Glue resources, and Amazon S3 permissions required by + // the transform. + // + // * This role needs AWS Glue service role permissions to allow access to + // resources in AWS Glue. See Attach a Policy to IAM Users That Access AWS + // Glue (https://docs.aws.amazon.com/glue/latest/dg/attach-policy-iam-user.html). + // + // * This role needs permission to your Amazon Simple Storage Service (Amazon + // S3) sources, targets, temporary directory, scripts, and any libraries + // used by the task run for this transform. // // Role is a required field Role *string `type:"string" required:"true"` + // The tags to use with this machine learning transform. You may use tags to + // limit access to the machine learning transform. For more information about + // tags in AWS Glue, see AWS Tags in AWS Glue (https://docs.aws.amazon.com/glue/latest/dg/monitor-tags.html) + // in the developer guide. + Tags map[string]*string `type:"map"` + // The timeout of the task run for this transform in minutes. This is the maximum // time that a task run for this transform can consume resources before it is // terminated and enters TIMEOUT status. The default is 2,880 minutes (48 hours). @@ -16756,6 +17474,18 @@ type CreateMLTransformInput struct { // // * For the G.2X worker type, each worker provides 8 vCPU, 32 GB of memory // and a 128GB disk, and 1 executor per worker. + // + // MaxCapacity is a mutually exclusive option with NumberOfWorkers and WorkerType. + // + // * If either NumberOfWorkers or WorkerType is set, then MaxCapacity cannot + // be set. + // + // * If MaxCapacity is set then neither NumberOfWorkers or WorkerType can + // be set. + // + // * If WorkerType is set, then NumberOfWorkers is required (and vice versa). + // + // * MaxCapacity and NumberOfWorkers must both be at least 1. WorkerType *string `type:"string" enum:"WorkerType"` } @@ -16772,6 +17502,9 @@ func (s CreateMLTransformInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *CreateMLTransformInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "CreateMLTransformInput"} + if s.GlueVersion != nil && len(*s.GlueVersion) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GlueVersion", 1)) + } if s.InputRecordTables == nil { invalidParams.Add(request.NewErrParamRequired("InputRecordTables")) } @@ -16818,6 +17551,12 @@ func (s *CreateMLTransformInput) SetDescription(v string) *CreateMLTransformInpu return s } +// SetGlueVersion sets the GlueVersion field's value. +func (s *CreateMLTransformInput) SetGlueVersion(v string) *CreateMLTransformInput { + s.GlueVersion = &v + return s +} + // SetInputRecordTables sets the InputRecordTables field's value. func (s *CreateMLTransformInput) SetInputRecordTables(v []*Table) *CreateMLTransformInput { s.InputRecordTables = v @@ -16860,6 +17599,12 @@ func (s *CreateMLTransformInput) SetRole(v string) *CreateMLTransformInput { return s } +// SetTags sets the Tags field's value. +func (s *CreateMLTransformInput) SetTags(v map[string]*string) *CreateMLTransformInput { + s.Tags = v + return s +} + // SetTimeout sets the Timeout field's value. func (s *CreateMLTransformInput) SetTimeout(v int64) *CreateMLTransformInput { s.Timeout = &v @@ -19592,16 +20337,130 @@ func (s *EncryptionConfiguration) SetCloudWatchEncryption(v *CloudWatchEncryptio return s } -// SetJobBookmarksEncryption sets the JobBookmarksEncryption field's value. -func (s *EncryptionConfiguration) SetJobBookmarksEncryption(v *JobBookmarksEncryption) *EncryptionConfiguration { - s.JobBookmarksEncryption = v - return s +// SetJobBookmarksEncryption sets the JobBookmarksEncryption field's value. +func (s *EncryptionConfiguration) SetJobBookmarksEncryption(v *JobBookmarksEncryption) *EncryptionConfiguration { + s.JobBookmarksEncryption = v + return s +} + +// SetS3Encryption sets the S3Encryption field's value. +func (s *EncryptionConfiguration) SetS3Encryption(v []*S3Encryption) *EncryptionConfiguration { + s.S3Encryption = v + return s +} + +// An encryption operation failed. +type EncryptionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s EncryptionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EncryptionException) GoString() string { + return s.String() +} + +func newErrorEncryptionException(v protocol.ResponseMetadata) error { + return &EncryptionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EncryptionException) Code() string { + return "GlueEncryptionException" +} + +// Message returns the exception's message. +func (s EncryptionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EncryptionException) OrigErr() error { + return nil +} + +func (s EncryptionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EncryptionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EncryptionException) RequestID() string { + return s.respMetadata.RequestID +} + +// A specified entity does not exist +type EntityNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s EntityNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EntityNotFoundException) GoString() string { + return s.String() +} + +func newErrorEntityNotFoundException(v protocol.ResponseMetadata) error { + return &EntityNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EntityNotFoundException) Code() string { + return "EntityNotFoundException" +} + +// Message returns the exception's message. +func (s EntityNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EntityNotFoundException) OrigErr() error { + return nil +} + +func (s EntityNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EntityNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetS3Encryption sets the S3Encryption field's value. -func (s *EncryptionConfiguration) SetS3Encryption(v []*S3Encryption) *EncryptionConfiguration { - s.S3Encryption = v - return s +// RequestID returns the service's response RequestID for request. +func (s EntityNotFoundException) RequestID() string { + return s.respMetadata.RequestID } // Contains details about an error. @@ -21771,6 +22630,13 @@ type GetMLTransformOutput struct { // The latest evaluation metrics. EvaluationMetrics *EvaluationMetrics `type:"structure"` + // This value determines which version of AWS Glue this machine learning transform + // is compatible with. Glue 1.0 is recommended for most customers. If the value + // is not set, the Glue compatibility defaults to Glue 0.9. For more information, + // see AWS Glue Versions (https://docs.aws.amazon.com/glue/latest/dg/release-notes.html#release-notes-versions) + // in the developer guide. + GlueVersion *string `min:"1" type:"string"` + // A list of AWS Glue table definitions used by the transform. InputRecordTables []*Table `type:"list"` @@ -21867,6 +22733,12 @@ func (s *GetMLTransformOutput) SetEvaluationMetrics(v *EvaluationMetrics) *GetML return s } +// SetGlueVersion sets the GlueVersion field's value. +func (s *GetMLTransformOutput) SetGlueVersion(v string) *GetMLTransformOutput { + s.GlueVersion = &v + return s +} + // SetInputRecordTables sets the InputRecordTables field's value. func (s *GetMLTransformOutput) SetInputRecordTables(v []*Table) *GetMLTransformOutput { s.InputRecordTables = v @@ -24156,6 +25028,63 @@ func (s *GrokClassifier) SetVersion(v int64) *GrokClassifier { return s } +// The same unique identifier was associated with two different records. +type IdempotentParameterMismatchException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s IdempotentParameterMismatchException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IdempotentParameterMismatchException) GoString() string { + return s.String() +} + +func newErrorIdempotentParameterMismatchException(v protocol.ResponseMetadata) error { + return &IdempotentParameterMismatchException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IdempotentParameterMismatchException) Code() string { + return "IdempotentParameterMismatchException" +} + +// Message returns the exception's message. +func (s IdempotentParameterMismatchException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IdempotentParameterMismatchException) OrigErr() error { + return nil +} + +func (s IdempotentParameterMismatchException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IdempotentParameterMismatchException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IdempotentParameterMismatchException) RequestID() string { + return s.respMetadata.RequestID +} + type ImportCatalogToGlueInput struct { _ struct{} `type:"structure"` @@ -24241,6 +25170,120 @@ func (s *ImportLabelsTaskRunProperties) SetReplace(v bool) *ImportLabelsTaskRunP return s } +// An internal service error occurred. +type InternalServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServiceException) GoString() string { + return s.String() +} + +func newErrorInternalServiceException(v protocol.ResponseMetadata) error { + return &InternalServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServiceException) Code() string { + return "InternalServiceException" +} + +// Message returns the exception's message. +func (s InternalServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServiceException) OrigErr() error { + return nil +} + +func (s InternalServiceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServiceException) RequestID() string { + return s.respMetadata.RequestID +} + +// The input provided was not valid. +type InvalidInputException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidInputException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInputException) GoString() string { + return s.String() +} + +func newErrorInvalidInputException(v protocol.ResponseMetadata) error { + return &InvalidInputException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInputException) Code() string { + return "InvalidInputException" +} + +// Message returns the exception's message. +func (s InvalidInputException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInputException) OrigErr() error { + return nil +} + +func (s InvalidInputException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInputException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInputException) RequestID() string { + return s.respMetadata.RequestID +} + // Specifies a JDBC data store to crawl. type JdbcTarget struct { _ struct{} `type:"structure"` @@ -24370,6 +25413,9 @@ type Job struct { // The name you assign to this job definition. Name *string `min:"1" type:"string"` + // Non-overridable arguments for this job, specified as name-value pairs. + NonOverridableArguments map[string]*string `type:"map"` + // Specifies configuration properties of a job notification. NotificationProperty *NotificationProperty `type:"structure"` @@ -24496,6 +25542,12 @@ func (s *Job) SetName(v string) *Job { return s } +// SetNonOverridableArguments sets the NonOverridableArguments field's value. +func (s *Job) SetNonOverridableArguments(v map[string]*string) *Job { + s.NonOverridableArguments = v + return s +} + // SetNotificationProperty sets the NotificationProperty field's value. func (s *Job) SetNotificationProperty(v *NotificationProperty) *Job { s.NotificationProperty = v @@ -25067,6 +26119,9 @@ type JobUpdate struct { // The maximum number of times to retry this job if it fails. MaxRetries *int64 `type:"integer"` + // Non-overridable arguments for this job, specified as name-value pairs. + NonOverridableArguments map[string]*string `type:"map"` + // Specifies the configuration properties of a job notification. NotificationProperty *NotificationProperty `type:"structure"` @@ -25199,6 +26254,12 @@ func (s *JobUpdate) SetMaxRetries(v int64) *JobUpdate { return s } +// SetNonOverridableArguments sets the NonOverridableArguments field's value. +func (s *JobUpdate) SetNonOverridableArguments(v map[string]*string) *JobUpdate { + s.NonOverridableArguments = v + return s +} + // SetNotificationProperty sets the NotificationProperty field's value. func (s *JobUpdate) SetNotificationProperty(v *NotificationProperty) *JobUpdate { s.NotificationProperty = v @@ -25658,6 +26719,124 @@ func (s *ListJobsOutput) SetNextToken(v string) *ListJobsOutput { return s } +type ListMLTransformsInput struct { + _ struct{} `type:"structure"` + + // A TransformFilterCriteria used to filter the machine learning transforms. + Filter *TransformFilterCriteria `type:"structure"` + + // The maximum size of a list to return. + MaxResults *int64 `min:"1" type:"integer"` + + // A continuation token, if this is a continuation request. + NextToken *string `type:"string"` + + // A TransformSortCriteria used to sort the machine learning transforms. + Sort *TransformSortCriteria `type:"structure"` + + // Specifies to return only these tagged resources. + Tags map[string]*string `type:"map"` +} + +// String returns the string representation +func (s ListMLTransformsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListMLTransformsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListMLTransformsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListMLTransformsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.Filter != nil { + if err := s.Filter.Validate(); err != nil { + invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) + } + } + if s.Sort != nil { + if err := s.Sort.Validate(); err != nil { + invalidParams.AddNested("Sort", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFilter sets the Filter field's value. +func (s *ListMLTransformsInput) SetFilter(v *TransformFilterCriteria) *ListMLTransformsInput { + s.Filter = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListMLTransformsInput) SetMaxResults(v int64) *ListMLTransformsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListMLTransformsInput) SetNextToken(v string) *ListMLTransformsInput { + s.NextToken = &v + return s +} + +// SetSort sets the Sort field's value. +func (s *ListMLTransformsInput) SetSort(v *TransformSortCriteria) *ListMLTransformsInput { + s.Sort = v + return s +} + +// SetTags sets the Tags field's value. +func (s *ListMLTransformsInput) SetTags(v map[string]*string) *ListMLTransformsInput { + s.Tags = v + return s +} + +type ListMLTransformsOutput struct { + _ struct{} `type:"structure"` + + // A continuation token, if the returned list does not contain the last metric + // available. + NextToken *string `type:"string"` + + // The identifiers of all the machine learning transforms in the account, or + // the machine learning transforms with the specified tags. + // + // TransformIds is a required field + TransformIds []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s ListMLTransformsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListMLTransformsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListMLTransformsOutput) SetNextToken(v string) *ListMLTransformsOutput { + s.NextToken = &v + return s +} + +// SetTransformIds sets the TransformIds field's value. +func (s *ListMLTransformsOutput) SetTransformIds(v []*string) *ListMLTransformsOutput { + s.TransformIds = v + return s +} + type ListTriggersInput struct { _ struct{} `type:"structure"` @@ -25934,6 +27113,13 @@ type MLTransform struct { // quality of your machine learning transform. EvaluationMetrics *EvaluationMetrics `type:"structure"` + // This value determines which version of AWS Glue this machine learning transform + // is compatible with. Glue 1.0 is recommended for most customers. If the value + // is not set, the Glue compatibility defaults to Glue 0.9. For more information, + // see AWS Glue Versions (https://docs.aws.amazon.com/glue/latest/dg/release-notes.html#release-notes-versions) + // in the developer guide. + GlueVersion *string `min:"1" type:"string"` + // A list of AWS Glue table definitions used by the transform. InputRecordTables []*Table `type:"list"` @@ -25950,7 +27136,19 @@ type MLTransform struct { // task runs for this transform. You can allocate from 2 to 100 DPUs; the default // is 10. A DPU is a relative measure of processing power that consists of 4 // vCPUs of compute capacity and 16 GB of memory. For more information, see - // the AWS Glue pricing page (https://aws.amazon.com/glue/pricing/). + // the AWS Glue pricing page (http://aws.amazon.com/glue/pricing/). + // + // MaxCapacity is a mutually exclusive option with NumberOfWorkers and WorkerType. + // + // * If either NumberOfWorkers or WorkerType is set, then MaxCapacity cannot + // be set. + // + // * If MaxCapacity is set then neither NumberOfWorkers or WorkerType can + // be set. + // + // * If WorkerType is set, then NumberOfWorkers is required (and vice versa). + // + // * MaxCapacity and NumberOfWorkers must both be at least 1. // // When the WorkerType field is set to a value other than Standard, the MaxCapacity // field is set automatically and becomes read-only. @@ -25966,6 +27164,8 @@ type MLTransform struct { // The number of workers of a defined workerType that are allocated when a task // of the transform runs. + // + // If WorkerType is set, then NumberOfWorkers is required (and vice versa). NumberOfWorkers *int64 `type:"integer"` // A TransformParameters object. You can use parameters to tune (customize) @@ -25975,9 +27175,17 @@ type MLTransform struct { Parameters *TransformParameters `type:"structure"` // The name or Amazon Resource Name (ARN) of the IAM role with the required - // permissions. This role needs permission to your Amazon Simple Storage Service - // (Amazon S3) sources, targets, temporary directory, scripts, and any libraries - // used by the task run for this transform. + // permissions. The required permissions include both AWS Glue service role + // permissions to AWS Glue resources, and Amazon S3 permissions required by + // the transform. + // + // * This role needs AWS Glue service role permissions to allow access to + // resources in AWS Glue. See Attach a Policy to IAM Users That Access AWS + // Glue (https://docs.aws.amazon.com/glue/latest/dg/attach-policy-iam-user.html). + // + // * This role needs permission to your Amazon Simple Storage Service (Amazon + // S3) sources, targets, temporary directory, scripts, and any libraries + // used by the task run for this transform. Role *string `type:"string"` // A map of key-value pairs representing the columns and data types that this @@ -26005,6 +27213,18 @@ type MLTransform struct { // // * For the G.2X worker type, each worker provides 8 vCPU, 32 GB of memory // and a 128GB disk, and 1 executor per worker. + // + // MaxCapacity is a mutually exclusive option with NumberOfWorkers and WorkerType. + // + // * If either NumberOfWorkers or WorkerType is set, then MaxCapacity cannot + // be set. + // + // * If MaxCapacity is set then neither NumberOfWorkers or WorkerType can + // be set. + // + // * If WorkerType is set, then NumberOfWorkers is required (and vice versa). + // + // * MaxCapacity and NumberOfWorkers must both be at least 1. WorkerType *string `type:"string" enum:"WorkerType"` } @@ -26036,6 +27256,12 @@ func (s *MLTransform) SetEvaluationMetrics(v *EvaluationMetrics) *MLTransform { return s } +// SetGlueVersion sets the GlueVersion field's value. +func (s *MLTransform) SetGlueVersion(v string) *MLTransform { + s.GlueVersion = &v + return s +} + // SetInputRecordTables sets the InputRecordTables field's value. func (s *MLTransform) SetInputRecordTables(v []*Table) *MLTransform { s.InputRecordTables = v @@ -26114,10 +27340,67 @@ func (s *MLTransform) SetTransformId(v string) *MLTransform { return s } -// SetWorkerType sets the WorkerType field's value. -func (s *MLTransform) SetWorkerType(v string) *MLTransform { - s.WorkerType = &v - return s +// SetWorkerType sets the WorkerType field's value. +func (s *MLTransform) SetWorkerType(v string) *MLTransform { + s.WorkerType = &v + return s +} + +// The machine learning transform is not ready to run. +type MLTransformNotReadyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s MLTransformNotReadyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MLTransformNotReadyException) GoString() string { + return s.String() +} + +func newErrorMLTransformNotReadyException(v protocol.ResponseMetadata) error { + return &MLTransformNotReadyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MLTransformNotReadyException) Code() string { + return "MLTransformNotReadyException" +} + +// Message returns the exception's message. +func (s MLTransformNotReadyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MLTransformNotReadyException) OrigErr() error { + return nil +} + +func (s MLTransformNotReadyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MLTransformNotReadyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MLTransformNotReadyException) RequestID() string { + return s.respMetadata.RequestID } // Defines a mapping. @@ -26189,6 +27472,63 @@ func (s *MappingEntry) SetTargetType(v string) *MappingEntry { return s } +// There is no applicable schedule. +type NoScheduleException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s NoScheduleException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NoScheduleException) GoString() string { + return s.String() +} + +func newErrorNoScheduleException(v protocol.ResponseMetadata) error { + return &NoScheduleException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NoScheduleException) Code() string { + return "NoScheduleException" +} + +// Message returns the exception's message. +func (s NoScheduleException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoScheduleException) OrigErr() error { + return nil +} + +func (s NoScheduleException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NoScheduleException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NoScheduleException) RequestID() string { + return s.respMetadata.RequestID +} + // A node represents an AWS Glue component like Trigger, Job etc. which is part // of a workflow. type Node struct { @@ -26297,6 +27637,63 @@ func (s *NotificationProperty) SetNotifyDelayAfter(v int64) *NotificationPropert return s } +// The operation timed out. +type OperationTimeoutException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s OperationTimeoutException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OperationTimeoutException) GoString() string { + return s.String() +} + +func newErrorOperationTimeoutException(v protocol.ResponseMetadata) error { + return &OperationTimeoutException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OperationTimeoutException) Code() string { + return "OperationTimeoutException" +} + +// Message returns the exception's message. +func (s OperationTimeoutException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OperationTimeoutException) OrigErr() error { + return nil +} + +func (s OperationTimeoutException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OperationTimeoutException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OperationTimeoutException) RequestID() string { + return s.respMetadata.RequestID +} + // Specifies the sort order of a sorted column. type Order struct { _ struct{} `type:"structure"` @@ -26492,6 +27889,11 @@ type PartitionInput struct { // The values of the partition. Although this parameter is not required by the // SDK, you must specify this parameter for a valid input. + // + // The values for the keys for the new partition must be passed as an array + // of String objects that must be ordered in the same order as the partition + // keys appearing in the Amazon S3 prefix. Otherwise AWS Glue will add the values + // to the wrong keys. Values []*string `type:"list"` } @@ -27143,6 +28545,63 @@ func (s *ResetJobBookmarkOutput) SetJobBookmarkEntry(v *JobBookmarkEntry) *Reset return s } +// A resource numerical limit was exceeded. +type ResourceNumberLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceNumberLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNumberLimitExceededException) GoString() string { + return s.String() +} + +func newErrorResourceNumberLimitExceededException(v protocol.ResponseMetadata) error { + return &ResourceNumberLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNumberLimitExceededException) Code() string { + return "ResourceNumberLimitExceededException" +} + +// Message returns the exception's message. +func (s ResourceNumberLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNumberLimitExceededException) OrigErr() error { + return nil +} + +func (s ResourceNumberLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNumberLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNumberLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // The URIs for function resources. type ResourceUri struct { _ struct{} `type:"structure"` @@ -27292,6 +28751,177 @@ func (s *Schedule) SetState(v string) *Schedule { return s } +// The specified scheduler is not running. +type SchedulerNotRunningException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s SchedulerNotRunningException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SchedulerNotRunningException) GoString() string { + return s.String() +} + +func newErrorSchedulerNotRunningException(v protocol.ResponseMetadata) error { + return &SchedulerNotRunningException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SchedulerNotRunningException) Code() string { + return "SchedulerNotRunningException" +} + +// Message returns the exception's message. +func (s SchedulerNotRunningException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SchedulerNotRunningException) OrigErr() error { + return nil +} + +func (s SchedulerNotRunningException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SchedulerNotRunningException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SchedulerNotRunningException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified scheduler is already running. +type SchedulerRunningException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s SchedulerRunningException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SchedulerRunningException) GoString() string { + return s.String() +} + +func newErrorSchedulerRunningException(v protocol.ResponseMetadata) error { + return &SchedulerRunningException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SchedulerRunningException) Code() string { + return "SchedulerRunningException" +} + +// Message returns the exception's message. +func (s SchedulerRunningException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SchedulerRunningException) OrigErr() error { + return nil +} + +func (s SchedulerRunningException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SchedulerRunningException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SchedulerRunningException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified scheduler is transitioning. +type SchedulerTransitioningException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s SchedulerTransitioningException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SchedulerTransitioningException) GoString() string { + return s.String() +} + +func newErrorSchedulerTransitioningException(v protocol.ResponseMetadata) error { + return &SchedulerTransitioningException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SchedulerTransitioningException) Code() string { + return "SchedulerTransitioningException" +} + +// Message returns the exception's message. +func (s SchedulerTransitioningException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SchedulerTransitioningException) OrigErr() error { + return nil +} + +func (s SchedulerTransitioningException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SchedulerTransitioningException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SchedulerTransitioningException) RequestID() string { + return s.respMetadata.RequestID +} + // A policy that specifies update and deletion behaviors for the crawler. type SchemaChangePolicy struct { _ struct{} `type:"structure"` @@ -27696,11 +29326,14 @@ func (s *SkewedInfo) SetSkewedColumnValues(v []*string) *SkewedInfo { return s } +// Specifies a field to sort by and a sort order. type SortCriterion struct { _ struct{} `type:"structure"` + // The name of the field on which to sort. FieldName *string `type:"string"` + // An ascending or descending sort. Sort *string `type:"string" enum:"Sort"` } @@ -29718,6 +31351,13 @@ type TransformFilterCriteria struct { // The time and date before which the transforms were created. CreatedBefore *time.Time `type:"timestamp"` + // This value determines which version of AWS Glue this machine learning transform + // is compatible with. Glue 1.0 is recommended for most customers. If the value + // is not set, the Glue compatibility defaults to Glue 0.9. For more information, + // see AWS Glue Versions (https://docs.aws.amazon.com/glue/latest/dg/release-notes.html#release-notes-versions) + // in the developer guide. + GlueVersion *string `min:"1" type:"string"` + // Filter on transforms last modified after this date. LastModifiedAfter *time.Time `type:"timestamp"` @@ -29756,6 +31396,9 @@ func (s TransformFilterCriteria) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *TransformFilterCriteria) Validate() error { invalidParams := request.ErrInvalidParams{Context: "TransformFilterCriteria"} + if s.GlueVersion != nil && len(*s.GlueVersion) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GlueVersion", 1)) + } if s.Name != nil && len(*s.Name) < 1 { invalidParams.Add(request.NewErrParamMinLen("Name", 1)) } @@ -29788,6 +31431,12 @@ func (s *TransformFilterCriteria) SetCreatedBefore(v time.Time) *TransformFilter return s } +// SetGlueVersion sets the GlueVersion field's value. +func (s *TransformFilterCriteria) SetGlueVersion(v string) *TransformFilterCriteria { + s.GlueVersion = &v + return s +} + // SetLastModifiedAfter sets the LastModifiedAfter field's value. func (s *TransformFilterCriteria) SetLastModifiedAfter(v time.Time) *TransformFilterCriteria { s.LastModifiedAfter = &v @@ -31163,6 +32812,13 @@ type UpdateMLTransformInput struct { // A description of the transform. The default is an empty string. Description *string `type:"string"` + // This value determines which version of AWS Glue this machine learning transform + // is compatible with. Glue 1.0 is recommended for most customers. If the value + // is not set, the Glue compatibility defaults to Glue 0.9. For more information, + // see AWS Glue Versions (https://docs.aws.amazon.com/glue/latest/dg/release-notes.html#release-notes-versions) + // in the developer guide. + GlueVersion *string `min:"1" type:"string"` + // The number of AWS Glue data processing units (DPUs) that are allocated to // task runs for this transform. You can allocate from 2 to 100 DPUs; the default // is 10. A DPU is a relative measure of processing power that consists of 4 @@ -31229,6 +32885,9 @@ func (s UpdateMLTransformInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *UpdateMLTransformInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "UpdateMLTransformInput"} + if s.GlueVersion != nil && len(*s.GlueVersion) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GlueVersion", 1)) + } if s.Name != nil && len(*s.Name) < 1 { invalidParams.Add(request.NewErrParamMinLen("Name", 1)) } @@ -31259,6 +32918,12 @@ func (s *UpdateMLTransformInput) SetDescription(v string) *UpdateMLTransformInpu return s } +// SetGlueVersion sets the GlueVersion field's value. +func (s *UpdateMLTransformInput) SetGlueVersion(v string) *UpdateMLTransformInput { + s.GlueVersion = &v + return s +} + // SetMaxCapacity sets the MaxCapacity field's value. func (s *UpdateMLTransformInput) SetMaxCapacity(v float64) *UpdateMLTransformInput { s.MaxCapacity = &v @@ -32044,6 +33709,120 @@ func (s *UserDefinedFunctionInput) SetResourceUris(v []*ResourceUri) *UserDefine return s } +// A value could not be validated. +type ValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationException) GoString() string { + return s.String() +} + +func newErrorValidationException(v protocol.ResponseMetadata) error { + return &ValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ValidationException) Code() string { + return "ValidationException" +} + +// Message returns the exception's message. +func (s ValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ValidationException) OrigErr() error { + return nil +} + +func (s ValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ValidationException) RequestID() string { + return s.respMetadata.RequestID +} + +// There was a version conflict. +type VersionMismatchException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s VersionMismatchException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VersionMismatchException) GoString() string { + return s.String() +} + +func newErrorVersionMismatchException(v protocol.ResponseMetadata) error { + return &VersionMismatchException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s VersionMismatchException) Code() string { + return "VersionMismatchException" +} + +// Message returns the exception's message. +func (s VersionMismatchException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s VersionMismatchException) OrigErr() error { + return nil +} + +func (s VersionMismatchException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s VersionMismatchException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s VersionMismatchException) RequestID() string { + return s.respMetadata.RequestID +} + // A workflow represents a flow in which AWS Glue components should be executed // to complete a logical task. type Workflow struct { @@ -32467,6 +34246,15 @@ const ( // ConnectionPropertyKeyJdbcEnforceSsl is a ConnectionPropertyKey enum value ConnectionPropertyKeyJdbcEnforceSsl = "JDBC_ENFORCE_SSL" + + // ConnectionPropertyKeyCustomJdbcCert is a ConnectionPropertyKey enum value + ConnectionPropertyKeyCustomJdbcCert = "CUSTOM_JDBC_CERT" + + // ConnectionPropertyKeySkipCustomJdbcCertValidation is a ConnectionPropertyKey enum value + ConnectionPropertyKeySkipCustomJdbcCertValidation = "SKIP_CUSTOM_JDBC_CERT_VALIDATION" + + // ConnectionPropertyKeyCustomJdbcCertString is a ConnectionPropertyKey enum value + ConnectionPropertyKeyCustomJdbcCertString = "CUSTOM_JDBC_CERT_STRING" ) const ( diff --git a/vendor/github.com/aws/aws-sdk-go/service/glue/errors.go b/vendor/github.com/aws/aws-sdk-go/service/glue/errors.go index b9588ea38b8..dc5ad7afd38 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/glue/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/glue/errors.go @@ -2,6 +2,10 @@ package glue +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccessDeniedException for service response error code @@ -136,3 +140,28 @@ const ( // There was a version conflict. ErrCodeVersionMismatchException = "VersionMismatchException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "AlreadyExistsException": newErrorAlreadyExistsException, + "ConcurrentModificationException": newErrorConcurrentModificationException, + "ConcurrentRunsExceededException": newErrorConcurrentRunsExceededException, + "ConditionCheckFailureException": newErrorConditionCheckFailureException, + "CrawlerNotRunningException": newErrorCrawlerNotRunningException, + "CrawlerRunningException": newErrorCrawlerRunningException, + "CrawlerStoppingException": newErrorCrawlerStoppingException, + "GlueEncryptionException": newErrorEncryptionException, + "EntityNotFoundException": newErrorEntityNotFoundException, + "IdempotentParameterMismatchException": newErrorIdempotentParameterMismatchException, + "InternalServiceException": newErrorInternalServiceException, + "InvalidInputException": newErrorInvalidInputException, + "MLTransformNotReadyException": newErrorMLTransformNotReadyException, + "NoScheduleException": newErrorNoScheduleException, + "OperationTimeoutException": newErrorOperationTimeoutException, + "ResourceNumberLimitExceededException": newErrorResourceNumberLimitExceededException, + "SchedulerNotRunningException": newErrorSchedulerNotRunningException, + "SchedulerRunningException": newErrorSchedulerRunningException, + "SchedulerTransitioningException": newErrorSchedulerTransitioningException, + "ValidationException": newErrorValidationException, + "VersionMismatchException": newErrorVersionMismatchException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/glue/service.go b/vendor/github.com/aws/aws-sdk-go/service/glue/service.go index 075b0a1df6c..060d5ac8135 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/glue/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/glue/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "glue" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Glue" // ServiceID is a unique identifer of a specific service. + ServiceID = "Glue" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Glue client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Glue client from just a session. // svc := glue.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := glue.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *Glue { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Glue { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Glue { svc := &Glue{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-03-31", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/greengrass/api.go b/vendor/github.com/aws/aws-sdk-go/service/greengrass/api.go new file mode 100644 index 00000000000..1f62bf81a43 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/greengrass/api.go @@ -0,0 +1,17851 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package greengrass + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/restjson" +) + +const opAssociateRoleToGroup = "AssociateRoleToGroup" + +// AssociateRoleToGroupRequest generates a "aws/request.Request" representing the +// client's request for the AssociateRoleToGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AssociateRoleToGroup for more information on using the AssociateRoleToGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AssociateRoleToGroupRequest method. +// req, resp := client.AssociateRoleToGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/AssociateRoleToGroup +func (c *Greengrass) AssociateRoleToGroupRequest(input *AssociateRoleToGroupInput) (req *request.Request, output *AssociateRoleToGroupOutput) { + op := &request.Operation{ + Name: opAssociateRoleToGroup, + HTTPMethod: "PUT", + HTTPPath: "/greengrass/groups/{GroupId}/role", + } + + if input == nil { + input = &AssociateRoleToGroupInput{} + } + + output = &AssociateRoleToGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// AssociateRoleToGroup API operation for AWS Greengrass. +// +// Associates a role with a group. Your Greengrass core will use the role to +// access AWS cloud services. The role's permissions should allow Greengrass +// core Lambda functions to perform actions against the cloud. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation AssociateRoleToGroup for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// * InternalServerErrorException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/AssociateRoleToGroup +func (c *Greengrass) AssociateRoleToGroup(input *AssociateRoleToGroupInput) (*AssociateRoleToGroupOutput, error) { + req, out := c.AssociateRoleToGroupRequest(input) + return out, req.Send() +} + +// AssociateRoleToGroupWithContext is the same as AssociateRoleToGroup with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateRoleToGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) AssociateRoleToGroupWithContext(ctx aws.Context, input *AssociateRoleToGroupInput, opts ...request.Option) (*AssociateRoleToGroupOutput, error) { + req, out := c.AssociateRoleToGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opAssociateServiceRoleToAccount = "AssociateServiceRoleToAccount" + +// AssociateServiceRoleToAccountRequest generates a "aws/request.Request" representing the +// client's request for the AssociateServiceRoleToAccount operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AssociateServiceRoleToAccount for more information on using the AssociateServiceRoleToAccount +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AssociateServiceRoleToAccountRequest method. +// req, resp := client.AssociateServiceRoleToAccountRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/AssociateServiceRoleToAccount +func (c *Greengrass) AssociateServiceRoleToAccountRequest(input *AssociateServiceRoleToAccountInput) (req *request.Request, output *AssociateServiceRoleToAccountOutput) { + op := &request.Operation{ + Name: opAssociateServiceRoleToAccount, + HTTPMethod: "PUT", + HTTPPath: "/greengrass/servicerole", + } + + if input == nil { + input = &AssociateServiceRoleToAccountInput{} + } + + output = &AssociateServiceRoleToAccountOutput{} + req = c.newRequest(op, input, output) + return +} + +// AssociateServiceRoleToAccount API operation for AWS Greengrass. +// +// Associates a role with your account. AWS IoT Greengrass will use the role +// to access your Lambda functions and AWS IoT resources. This is necessary +// for deployments to succeed. The role must have at least minimum permissions +// in the policy ''AWSGreengrassResourceAccessRolePolicy''. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation AssociateServiceRoleToAccount for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// * InternalServerErrorException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/AssociateServiceRoleToAccount +func (c *Greengrass) AssociateServiceRoleToAccount(input *AssociateServiceRoleToAccountInput) (*AssociateServiceRoleToAccountOutput, error) { + req, out := c.AssociateServiceRoleToAccountRequest(input) + return out, req.Send() +} + +// AssociateServiceRoleToAccountWithContext is the same as AssociateServiceRoleToAccount with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateServiceRoleToAccount for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) AssociateServiceRoleToAccountWithContext(ctx aws.Context, input *AssociateServiceRoleToAccountInput, opts ...request.Option) (*AssociateServiceRoleToAccountOutput, error) { + req, out := c.AssociateServiceRoleToAccountRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateConnectorDefinition = "CreateConnectorDefinition" + +// CreateConnectorDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the CreateConnectorDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateConnectorDefinition for more information on using the CreateConnectorDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateConnectorDefinitionRequest method. +// req, resp := client.CreateConnectorDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateConnectorDefinition +func (c *Greengrass) CreateConnectorDefinitionRequest(input *CreateConnectorDefinitionInput) (req *request.Request, output *CreateConnectorDefinitionOutput) { + op := &request.Operation{ + Name: opCreateConnectorDefinition, + HTTPMethod: "POST", + HTTPPath: "/greengrass/definition/connectors", + } + + if input == nil { + input = &CreateConnectorDefinitionInput{} + } + + output = &CreateConnectorDefinitionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateConnectorDefinition API operation for AWS Greengrass. +// +// Creates a connector definition. You may provide the initial version of the +// connector definition now or use ''CreateConnectorDefinitionVersion'' at a +// later 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 AWS Greengrass's +// API operation CreateConnectorDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateConnectorDefinition +func (c *Greengrass) CreateConnectorDefinition(input *CreateConnectorDefinitionInput) (*CreateConnectorDefinitionOutput, error) { + req, out := c.CreateConnectorDefinitionRequest(input) + return out, req.Send() +} + +// CreateConnectorDefinitionWithContext is the same as CreateConnectorDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See CreateConnectorDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateConnectorDefinitionWithContext(ctx aws.Context, input *CreateConnectorDefinitionInput, opts ...request.Option) (*CreateConnectorDefinitionOutput, error) { + req, out := c.CreateConnectorDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateConnectorDefinitionVersion = "CreateConnectorDefinitionVersion" + +// CreateConnectorDefinitionVersionRequest generates a "aws/request.Request" representing the +// client's request for the CreateConnectorDefinitionVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateConnectorDefinitionVersion for more information on using the CreateConnectorDefinitionVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateConnectorDefinitionVersionRequest method. +// req, resp := client.CreateConnectorDefinitionVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateConnectorDefinitionVersion +func (c *Greengrass) CreateConnectorDefinitionVersionRequest(input *CreateConnectorDefinitionVersionInput) (req *request.Request, output *CreateConnectorDefinitionVersionOutput) { + op := &request.Operation{ + Name: opCreateConnectorDefinitionVersion, + HTTPMethod: "POST", + HTTPPath: "/greengrass/definition/connectors/{ConnectorDefinitionId}/versions", + } + + if input == nil { + input = &CreateConnectorDefinitionVersionInput{} + } + + output = &CreateConnectorDefinitionVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateConnectorDefinitionVersion API operation for AWS Greengrass. +// +// Creates a version of a connector definition which has already been defined. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation CreateConnectorDefinitionVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateConnectorDefinitionVersion +func (c *Greengrass) CreateConnectorDefinitionVersion(input *CreateConnectorDefinitionVersionInput) (*CreateConnectorDefinitionVersionOutput, error) { + req, out := c.CreateConnectorDefinitionVersionRequest(input) + return out, req.Send() +} + +// CreateConnectorDefinitionVersionWithContext is the same as CreateConnectorDefinitionVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreateConnectorDefinitionVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateConnectorDefinitionVersionWithContext(ctx aws.Context, input *CreateConnectorDefinitionVersionInput, opts ...request.Option) (*CreateConnectorDefinitionVersionOutput, error) { + req, out := c.CreateConnectorDefinitionVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateCoreDefinition = "CreateCoreDefinition" + +// CreateCoreDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the CreateCoreDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateCoreDefinition for more information on using the CreateCoreDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateCoreDefinitionRequest method. +// req, resp := client.CreateCoreDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateCoreDefinition +func (c *Greengrass) CreateCoreDefinitionRequest(input *CreateCoreDefinitionInput) (req *request.Request, output *CreateCoreDefinitionOutput) { + op := &request.Operation{ + Name: opCreateCoreDefinition, + HTTPMethod: "POST", + HTTPPath: "/greengrass/definition/cores", + } + + if input == nil { + input = &CreateCoreDefinitionInput{} + } + + output = &CreateCoreDefinitionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateCoreDefinition API operation for AWS Greengrass. +// +// Creates a core definition. You may provide the initial version of the core +// definition now or use ''CreateCoreDefinitionVersion'' at a later time. Greengrass +// groups must each contain exactly one Greengrass core. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation CreateCoreDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateCoreDefinition +func (c *Greengrass) CreateCoreDefinition(input *CreateCoreDefinitionInput) (*CreateCoreDefinitionOutput, error) { + req, out := c.CreateCoreDefinitionRequest(input) + return out, req.Send() +} + +// CreateCoreDefinitionWithContext is the same as CreateCoreDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See CreateCoreDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateCoreDefinitionWithContext(ctx aws.Context, input *CreateCoreDefinitionInput, opts ...request.Option) (*CreateCoreDefinitionOutput, error) { + req, out := c.CreateCoreDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateCoreDefinitionVersion = "CreateCoreDefinitionVersion" + +// CreateCoreDefinitionVersionRequest generates a "aws/request.Request" representing the +// client's request for the CreateCoreDefinitionVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateCoreDefinitionVersion for more information on using the CreateCoreDefinitionVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateCoreDefinitionVersionRequest method. +// req, resp := client.CreateCoreDefinitionVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateCoreDefinitionVersion +func (c *Greengrass) CreateCoreDefinitionVersionRequest(input *CreateCoreDefinitionVersionInput) (req *request.Request, output *CreateCoreDefinitionVersionOutput) { + op := &request.Operation{ + Name: opCreateCoreDefinitionVersion, + HTTPMethod: "POST", + HTTPPath: "/greengrass/definition/cores/{CoreDefinitionId}/versions", + } + + if input == nil { + input = &CreateCoreDefinitionVersionInput{} + } + + output = &CreateCoreDefinitionVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateCoreDefinitionVersion API operation for AWS Greengrass. +// +// Creates a version of a core definition that has already been defined. Greengrass +// groups must each contain exactly one Greengrass core. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation CreateCoreDefinitionVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateCoreDefinitionVersion +func (c *Greengrass) CreateCoreDefinitionVersion(input *CreateCoreDefinitionVersionInput) (*CreateCoreDefinitionVersionOutput, error) { + req, out := c.CreateCoreDefinitionVersionRequest(input) + return out, req.Send() +} + +// CreateCoreDefinitionVersionWithContext is the same as CreateCoreDefinitionVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreateCoreDefinitionVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateCoreDefinitionVersionWithContext(ctx aws.Context, input *CreateCoreDefinitionVersionInput, opts ...request.Option) (*CreateCoreDefinitionVersionOutput, error) { + req, out := c.CreateCoreDefinitionVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateDeployment = "CreateDeployment" + +// CreateDeploymentRequest generates a "aws/request.Request" representing the +// client's request for the CreateDeployment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateDeployment for more information on using the CreateDeployment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateDeploymentRequest method. +// req, resp := client.CreateDeploymentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateDeployment +func (c *Greengrass) CreateDeploymentRequest(input *CreateDeploymentInput) (req *request.Request, output *CreateDeploymentOutput) { + op := &request.Operation{ + Name: opCreateDeployment, + HTTPMethod: "POST", + HTTPPath: "/greengrass/groups/{GroupId}/deployments", + } + + if input == nil { + input = &CreateDeploymentInput{} + } + + output = &CreateDeploymentOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateDeployment API operation for AWS Greengrass. +// +// Creates a deployment. ''CreateDeployment'' requests are idempotent with respect +// to the ''X-Amzn-Client-Token'' token and the request 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 Greengrass's +// API operation CreateDeployment for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateDeployment +func (c *Greengrass) CreateDeployment(input *CreateDeploymentInput) (*CreateDeploymentOutput, error) { + req, out := c.CreateDeploymentRequest(input) + return out, req.Send() +} + +// CreateDeploymentWithContext is the same as CreateDeployment with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDeployment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateDeploymentWithContext(ctx aws.Context, input *CreateDeploymentInput, opts ...request.Option) (*CreateDeploymentOutput, error) { + req, out := c.CreateDeploymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateDeviceDefinition = "CreateDeviceDefinition" + +// CreateDeviceDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the CreateDeviceDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateDeviceDefinition for more information on using the CreateDeviceDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateDeviceDefinitionRequest method. +// req, resp := client.CreateDeviceDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateDeviceDefinition +func (c *Greengrass) CreateDeviceDefinitionRequest(input *CreateDeviceDefinitionInput) (req *request.Request, output *CreateDeviceDefinitionOutput) { + op := &request.Operation{ + Name: opCreateDeviceDefinition, + HTTPMethod: "POST", + HTTPPath: "/greengrass/definition/devices", + } + + if input == nil { + input = &CreateDeviceDefinitionInput{} + } + + output = &CreateDeviceDefinitionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateDeviceDefinition API operation for AWS Greengrass. +// +// Creates a device definition. You may provide the initial version of the device +// definition now or use ''CreateDeviceDefinitionVersion'' at a later 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 AWS Greengrass's +// API operation CreateDeviceDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateDeviceDefinition +func (c *Greengrass) CreateDeviceDefinition(input *CreateDeviceDefinitionInput) (*CreateDeviceDefinitionOutput, error) { + req, out := c.CreateDeviceDefinitionRequest(input) + return out, req.Send() +} + +// CreateDeviceDefinitionWithContext is the same as CreateDeviceDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDeviceDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateDeviceDefinitionWithContext(ctx aws.Context, input *CreateDeviceDefinitionInput, opts ...request.Option) (*CreateDeviceDefinitionOutput, error) { + req, out := c.CreateDeviceDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateDeviceDefinitionVersion = "CreateDeviceDefinitionVersion" + +// CreateDeviceDefinitionVersionRequest generates a "aws/request.Request" representing the +// client's request for the CreateDeviceDefinitionVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateDeviceDefinitionVersion for more information on using the CreateDeviceDefinitionVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateDeviceDefinitionVersionRequest method. +// req, resp := client.CreateDeviceDefinitionVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateDeviceDefinitionVersion +func (c *Greengrass) CreateDeviceDefinitionVersionRequest(input *CreateDeviceDefinitionVersionInput) (req *request.Request, output *CreateDeviceDefinitionVersionOutput) { + op := &request.Operation{ + Name: opCreateDeviceDefinitionVersion, + HTTPMethod: "POST", + HTTPPath: "/greengrass/definition/devices/{DeviceDefinitionId}/versions", + } + + if input == nil { + input = &CreateDeviceDefinitionVersionInput{} + } + + output = &CreateDeviceDefinitionVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateDeviceDefinitionVersion API operation for AWS Greengrass. +// +// Creates a version of a device definition that has already been defined. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation CreateDeviceDefinitionVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateDeviceDefinitionVersion +func (c *Greengrass) CreateDeviceDefinitionVersion(input *CreateDeviceDefinitionVersionInput) (*CreateDeviceDefinitionVersionOutput, error) { + req, out := c.CreateDeviceDefinitionVersionRequest(input) + return out, req.Send() +} + +// CreateDeviceDefinitionVersionWithContext is the same as CreateDeviceDefinitionVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDeviceDefinitionVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateDeviceDefinitionVersionWithContext(ctx aws.Context, input *CreateDeviceDefinitionVersionInput, opts ...request.Option) (*CreateDeviceDefinitionVersionOutput, error) { + req, out := c.CreateDeviceDefinitionVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateFunctionDefinition = "CreateFunctionDefinition" + +// CreateFunctionDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the CreateFunctionDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateFunctionDefinition for more information on using the CreateFunctionDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateFunctionDefinitionRequest method. +// req, resp := client.CreateFunctionDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateFunctionDefinition +func (c *Greengrass) CreateFunctionDefinitionRequest(input *CreateFunctionDefinitionInput) (req *request.Request, output *CreateFunctionDefinitionOutput) { + op := &request.Operation{ + Name: opCreateFunctionDefinition, + HTTPMethod: "POST", + HTTPPath: "/greengrass/definition/functions", + } + + if input == nil { + input = &CreateFunctionDefinitionInput{} + } + + output = &CreateFunctionDefinitionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateFunctionDefinition API operation for AWS Greengrass. +// +// Creates a Lambda function definition which contains a list of Lambda functions +// and their configurations to be used in a group. You can create an initial +// version of the definition by providing a list of Lambda functions and their +// configurations now, or use ''CreateFunctionDefinitionVersion'' later. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation CreateFunctionDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateFunctionDefinition +func (c *Greengrass) CreateFunctionDefinition(input *CreateFunctionDefinitionInput) (*CreateFunctionDefinitionOutput, error) { + req, out := c.CreateFunctionDefinitionRequest(input) + return out, req.Send() +} + +// CreateFunctionDefinitionWithContext is the same as CreateFunctionDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See CreateFunctionDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateFunctionDefinitionWithContext(ctx aws.Context, input *CreateFunctionDefinitionInput, opts ...request.Option) (*CreateFunctionDefinitionOutput, error) { + req, out := c.CreateFunctionDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateFunctionDefinitionVersion = "CreateFunctionDefinitionVersion" + +// CreateFunctionDefinitionVersionRequest generates a "aws/request.Request" representing the +// client's request for the CreateFunctionDefinitionVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateFunctionDefinitionVersion for more information on using the CreateFunctionDefinitionVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateFunctionDefinitionVersionRequest method. +// req, resp := client.CreateFunctionDefinitionVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateFunctionDefinitionVersion +func (c *Greengrass) CreateFunctionDefinitionVersionRequest(input *CreateFunctionDefinitionVersionInput) (req *request.Request, output *CreateFunctionDefinitionVersionOutput) { + op := &request.Operation{ + Name: opCreateFunctionDefinitionVersion, + HTTPMethod: "POST", + HTTPPath: "/greengrass/definition/functions/{FunctionDefinitionId}/versions", + } + + if input == nil { + input = &CreateFunctionDefinitionVersionInput{} + } + + output = &CreateFunctionDefinitionVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateFunctionDefinitionVersion API operation for AWS Greengrass. +// +// Creates a version of a Lambda function definition that has already been defined. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation CreateFunctionDefinitionVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateFunctionDefinitionVersion +func (c *Greengrass) CreateFunctionDefinitionVersion(input *CreateFunctionDefinitionVersionInput) (*CreateFunctionDefinitionVersionOutput, error) { + req, out := c.CreateFunctionDefinitionVersionRequest(input) + return out, req.Send() +} + +// CreateFunctionDefinitionVersionWithContext is the same as CreateFunctionDefinitionVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreateFunctionDefinitionVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateFunctionDefinitionVersionWithContext(ctx aws.Context, input *CreateFunctionDefinitionVersionInput, opts ...request.Option) (*CreateFunctionDefinitionVersionOutput, error) { + req, out := c.CreateFunctionDefinitionVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateGroup = "CreateGroup" + +// CreateGroupRequest generates a "aws/request.Request" representing the +// client's request for the CreateGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateGroup for more information on using the CreateGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateGroupRequest method. +// req, resp := client.CreateGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateGroup +func (c *Greengrass) CreateGroupRequest(input *CreateGroupInput) (req *request.Request, output *CreateGroupOutput) { + op := &request.Operation{ + Name: opCreateGroup, + HTTPMethod: "POST", + HTTPPath: "/greengrass/groups", + } + + if input == nil { + input = &CreateGroupInput{} + } + + output = &CreateGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateGroup API operation for AWS Greengrass. +// +// Creates a group. You may provide the initial version of the group or use +// ''CreateGroupVersion'' at a later time. Tip: You can use the ''gg_group_setup'' +// package (https://github.com/awslabs/aws-greengrass-group-setup) as a library +// or command-line application to create and deploy Greengrass 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 Greengrass's +// API operation CreateGroup for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateGroup +func (c *Greengrass) CreateGroup(input *CreateGroupInput) (*CreateGroupOutput, error) { + req, out := c.CreateGroupRequest(input) + return out, req.Send() +} + +// CreateGroupWithContext is the same as CreateGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateGroupWithContext(ctx aws.Context, input *CreateGroupInput, opts ...request.Option) (*CreateGroupOutput, error) { + req, out := c.CreateGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateGroupCertificateAuthority = "CreateGroupCertificateAuthority" + +// CreateGroupCertificateAuthorityRequest generates a "aws/request.Request" representing the +// client's request for the CreateGroupCertificateAuthority operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateGroupCertificateAuthority for more information on using the CreateGroupCertificateAuthority +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateGroupCertificateAuthorityRequest method. +// req, resp := client.CreateGroupCertificateAuthorityRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateGroupCertificateAuthority +func (c *Greengrass) CreateGroupCertificateAuthorityRequest(input *CreateGroupCertificateAuthorityInput) (req *request.Request, output *CreateGroupCertificateAuthorityOutput) { + op := &request.Operation{ + Name: opCreateGroupCertificateAuthority, + HTTPMethod: "POST", + HTTPPath: "/greengrass/groups/{GroupId}/certificateauthorities", + } + + if input == nil { + input = &CreateGroupCertificateAuthorityInput{} + } + + output = &CreateGroupCertificateAuthorityOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateGroupCertificateAuthority API operation for AWS Greengrass. +// +// Creates a CA for the group. If a CA already exists, it will rotate the existing +// CA. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation CreateGroupCertificateAuthority for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// * InternalServerErrorException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateGroupCertificateAuthority +func (c *Greengrass) CreateGroupCertificateAuthority(input *CreateGroupCertificateAuthorityInput) (*CreateGroupCertificateAuthorityOutput, error) { + req, out := c.CreateGroupCertificateAuthorityRequest(input) + return out, req.Send() +} + +// CreateGroupCertificateAuthorityWithContext is the same as CreateGroupCertificateAuthority with the addition of +// the ability to pass a context and additional request options. +// +// See CreateGroupCertificateAuthority for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateGroupCertificateAuthorityWithContext(ctx aws.Context, input *CreateGroupCertificateAuthorityInput, opts ...request.Option) (*CreateGroupCertificateAuthorityOutput, error) { + req, out := c.CreateGroupCertificateAuthorityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateGroupVersion = "CreateGroupVersion" + +// CreateGroupVersionRequest generates a "aws/request.Request" representing the +// client's request for the CreateGroupVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateGroupVersion for more information on using the CreateGroupVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateGroupVersionRequest method. +// req, resp := client.CreateGroupVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateGroupVersion +func (c *Greengrass) CreateGroupVersionRequest(input *CreateGroupVersionInput) (req *request.Request, output *CreateGroupVersionOutput) { + op := &request.Operation{ + Name: opCreateGroupVersion, + HTTPMethod: "POST", + HTTPPath: "/greengrass/groups/{GroupId}/versions", + } + + if input == nil { + input = &CreateGroupVersionInput{} + } + + output = &CreateGroupVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateGroupVersion API operation for AWS Greengrass. +// +// Creates a version of a group which has already been defined. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation CreateGroupVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateGroupVersion +func (c *Greengrass) CreateGroupVersion(input *CreateGroupVersionInput) (*CreateGroupVersionOutput, error) { + req, out := c.CreateGroupVersionRequest(input) + return out, req.Send() +} + +// CreateGroupVersionWithContext is the same as CreateGroupVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreateGroupVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateGroupVersionWithContext(ctx aws.Context, input *CreateGroupVersionInput, opts ...request.Option) (*CreateGroupVersionOutput, error) { + req, out := c.CreateGroupVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateLoggerDefinition = "CreateLoggerDefinition" + +// CreateLoggerDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the CreateLoggerDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateLoggerDefinition for more information on using the CreateLoggerDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateLoggerDefinitionRequest method. +// req, resp := client.CreateLoggerDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateLoggerDefinition +func (c *Greengrass) CreateLoggerDefinitionRequest(input *CreateLoggerDefinitionInput) (req *request.Request, output *CreateLoggerDefinitionOutput) { + op := &request.Operation{ + Name: opCreateLoggerDefinition, + HTTPMethod: "POST", + HTTPPath: "/greengrass/definition/loggers", + } + + if input == nil { + input = &CreateLoggerDefinitionInput{} + } + + output = &CreateLoggerDefinitionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateLoggerDefinition API operation for AWS Greengrass. +// +// Creates a logger definition. You may provide the initial version of the logger +// definition now or use ''CreateLoggerDefinitionVersion'' at a later 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 AWS Greengrass's +// API operation CreateLoggerDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateLoggerDefinition +func (c *Greengrass) CreateLoggerDefinition(input *CreateLoggerDefinitionInput) (*CreateLoggerDefinitionOutput, error) { + req, out := c.CreateLoggerDefinitionRequest(input) + return out, req.Send() +} + +// CreateLoggerDefinitionWithContext is the same as CreateLoggerDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLoggerDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateLoggerDefinitionWithContext(ctx aws.Context, input *CreateLoggerDefinitionInput, opts ...request.Option) (*CreateLoggerDefinitionOutput, error) { + req, out := c.CreateLoggerDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateLoggerDefinitionVersion = "CreateLoggerDefinitionVersion" + +// CreateLoggerDefinitionVersionRequest generates a "aws/request.Request" representing the +// client's request for the CreateLoggerDefinitionVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateLoggerDefinitionVersion for more information on using the CreateLoggerDefinitionVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateLoggerDefinitionVersionRequest method. +// req, resp := client.CreateLoggerDefinitionVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateLoggerDefinitionVersion +func (c *Greengrass) CreateLoggerDefinitionVersionRequest(input *CreateLoggerDefinitionVersionInput) (req *request.Request, output *CreateLoggerDefinitionVersionOutput) { + op := &request.Operation{ + Name: opCreateLoggerDefinitionVersion, + HTTPMethod: "POST", + HTTPPath: "/greengrass/definition/loggers/{LoggerDefinitionId}/versions", + } + + if input == nil { + input = &CreateLoggerDefinitionVersionInput{} + } + + output = &CreateLoggerDefinitionVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateLoggerDefinitionVersion API operation for AWS Greengrass. +// +// Creates a version of a logger definition that has already been defined. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation CreateLoggerDefinitionVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateLoggerDefinitionVersion +func (c *Greengrass) CreateLoggerDefinitionVersion(input *CreateLoggerDefinitionVersionInput) (*CreateLoggerDefinitionVersionOutput, error) { + req, out := c.CreateLoggerDefinitionVersionRequest(input) + return out, req.Send() +} + +// CreateLoggerDefinitionVersionWithContext is the same as CreateLoggerDefinitionVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreateLoggerDefinitionVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateLoggerDefinitionVersionWithContext(ctx aws.Context, input *CreateLoggerDefinitionVersionInput, opts ...request.Option) (*CreateLoggerDefinitionVersionOutput, error) { + req, out := c.CreateLoggerDefinitionVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateResourceDefinition = "CreateResourceDefinition" + +// CreateResourceDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the CreateResourceDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateResourceDefinition for more information on using the CreateResourceDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateResourceDefinitionRequest method. +// req, resp := client.CreateResourceDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateResourceDefinition +func (c *Greengrass) CreateResourceDefinitionRequest(input *CreateResourceDefinitionInput) (req *request.Request, output *CreateResourceDefinitionOutput) { + op := &request.Operation{ + Name: opCreateResourceDefinition, + HTTPMethod: "POST", + HTTPPath: "/greengrass/definition/resources", + } + + if input == nil { + input = &CreateResourceDefinitionInput{} + } + + output = &CreateResourceDefinitionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateResourceDefinition API operation for AWS Greengrass. +// +// Creates a resource definition which contains a list of resources to be used +// in a group. You can create an initial version of the definition by providing +// a list of resources now, or use ''CreateResourceDefinitionVersion'' later. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation CreateResourceDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateResourceDefinition +func (c *Greengrass) CreateResourceDefinition(input *CreateResourceDefinitionInput) (*CreateResourceDefinitionOutput, error) { + req, out := c.CreateResourceDefinitionRequest(input) + return out, req.Send() +} + +// CreateResourceDefinitionWithContext is the same as CreateResourceDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See CreateResourceDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateResourceDefinitionWithContext(ctx aws.Context, input *CreateResourceDefinitionInput, opts ...request.Option) (*CreateResourceDefinitionOutput, error) { + req, out := c.CreateResourceDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateResourceDefinitionVersion = "CreateResourceDefinitionVersion" + +// CreateResourceDefinitionVersionRequest generates a "aws/request.Request" representing the +// client's request for the CreateResourceDefinitionVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateResourceDefinitionVersion for more information on using the CreateResourceDefinitionVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateResourceDefinitionVersionRequest method. +// req, resp := client.CreateResourceDefinitionVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateResourceDefinitionVersion +func (c *Greengrass) CreateResourceDefinitionVersionRequest(input *CreateResourceDefinitionVersionInput) (req *request.Request, output *CreateResourceDefinitionVersionOutput) { + op := &request.Operation{ + Name: opCreateResourceDefinitionVersion, + HTTPMethod: "POST", + HTTPPath: "/greengrass/definition/resources/{ResourceDefinitionId}/versions", + } + + if input == nil { + input = &CreateResourceDefinitionVersionInput{} + } + + output = &CreateResourceDefinitionVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateResourceDefinitionVersion API operation for AWS Greengrass. +// +// Creates a version of a resource definition that has already been defined. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation CreateResourceDefinitionVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateResourceDefinitionVersion +func (c *Greengrass) CreateResourceDefinitionVersion(input *CreateResourceDefinitionVersionInput) (*CreateResourceDefinitionVersionOutput, error) { + req, out := c.CreateResourceDefinitionVersionRequest(input) + return out, req.Send() +} + +// CreateResourceDefinitionVersionWithContext is the same as CreateResourceDefinitionVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreateResourceDefinitionVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateResourceDefinitionVersionWithContext(ctx aws.Context, input *CreateResourceDefinitionVersionInput, opts ...request.Option) (*CreateResourceDefinitionVersionOutput, error) { + req, out := c.CreateResourceDefinitionVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateSoftwareUpdateJob = "CreateSoftwareUpdateJob" + +// CreateSoftwareUpdateJobRequest generates a "aws/request.Request" representing the +// client's request for the CreateSoftwareUpdateJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateSoftwareUpdateJob for more information on using the CreateSoftwareUpdateJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateSoftwareUpdateJobRequest method. +// req, resp := client.CreateSoftwareUpdateJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateSoftwareUpdateJob +func (c *Greengrass) CreateSoftwareUpdateJobRequest(input *CreateSoftwareUpdateJobInput) (req *request.Request, output *CreateSoftwareUpdateJobOutput) { + op := &request.Operation{ + Name: opCreateSoftwareUpdateJob, + HTTPMethod: "POST", + HTTPPath: "/greengrass/updates", + } + + if input == nil { + input = &CreateSoftwareUpdateJobInput{} + } + + output = &CreateSoftwareUpdateJobOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateSoftwareUpdateJob API operation for AWS Greengrass. +// +// Creates a software update for a core or group of cores (specified as an IoT +// thing group.) Use this to update the OTA Agent as well as the Greengrass +// core software. It makes use of the IoT Jobs feature which provides additional +// commands to manage a Greengrass core software update 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 AWS Greengrass's +// API operation CreateSoftwareUpdateJob for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// * InternalServerErrorException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateSoftwareUpdateJob +func (c *Greengrass) CreateSoftwareUpdateJob(input *CreateSoftwareUpdateJobInput) (*CreateSoftwareUpdateJobOutput, error) { + req, out := c.CreateSoftwareUpdateJobRequest(input) + return out, req.Send() +} + +// CreateSoftwareUpdateJobWithContext is the same as CreateSoftwareUpdateJob with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSoftwareUpdateJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateSoftwareUpdateJobWithContext(ctx aws.Context, input *CreateSoftwareUpdateJobInput, opts ...request.Option) (*CreateSoftwareUpdateJobOutput, error) { + req, out := c.CreateSoftwareUpdateJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateSubscriptionDefinition = "CreateSubscriptionDefinition" + +// CreateSubscriptionDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the CreateSubscriptionDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateSubscriptionDefinition for more information on using the CreateSubscriptionDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateSubscriptionDefinitionRequest method. +// req, resp := client.CreateSubscriptionDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateSubscriptionDefinition +func (c *Greengrass) CreateSubscriptionDefinitionRequest(input *CreateSubscriptionDefinitionInput) (req *request.Request, output *CreateSubscriptionDefinitionOutput) { + op := &request.Operation{ + Name: opCreateSubscriptionDefinition, + HTTPMethod: "POST", + HTTPPath: "/greengrass/definition/subscriptions", + } + + if input == nil { + input = &CreateSubscriptionDefinitionInput{} + } + + output = &CreateSubscriptionDefinitionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateSubscriptionDefinition API operation for AWS Greengrass. +// +// Creates a subscription definition. You may provide the initial version of +// the subscription definition now or use ''CreateSubscriptionDefinitionVersion'' +// at a later 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 AWS Greengrass's +// API operation CreateSubscriptionDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateSubscriptionDefinition +func (c *Greengrass) CreateSubscriptionDefinition(input *CreateSubscriptionDefinitionInput) (*CreateSubscriptionDefinitionOutput, error) { + req, out := c.CreateSubscriptionDefinitionRequest(input) + return out, req.Send() +} + +// CreateSubscriptionDefinitionWithContext is the same as CreateSubscriptionDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSubscriptionDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateSubscriptionDefinitionWithContext(ctx aws.Context, input *CreateSubscriptionDefinitionInput, opts ...request.Option) (*CreateSubscriptionDefinitionOutput, error) { + req, out := c.CreateSubscriptionDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateSubscriptionDefinitionVersion = "CreateSubscriptionDefinitionVersion" + +// CreateSubscriptionDefinitionVersionRequest generates a "aws/request.Request" representing the +// client's request for the CreateSubscriptionDefinitionVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateSubscriptionDefinitionVersion for more information on using the CreateSubscriptionDefinitionVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateSubscriptionDefinitionVersionRequest method. +// req, resp := client.CreateSubscriptionDefinitionVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateSubscriptionDefinitionVersion +func (c *Greengrass) CreateSubscriptionDefinitionVersionRequest(input *CreateSubscriptionDefinitionVersionInput) (req *request.Request, output *CreateSubscriptionDefinitionVersionOutput) { + op := &request.Operation{ + Name: opCreateSubscriptionDefinitionVersion, + HTTPMethod: "POST", + HTTPPath: "/greengrass/definition/subscriptions/{SubscriptionDefinitionId}/versions", + } + + if input == nil { + input = &CreateSubscriptionDefinitionVersionInput{} + } + + output = &CreateSubscriptionDefinitionVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateSubscriptionDefinitionVersion API operation for AWS Greengrass. +// +// Creates a version of a subscription definition which has already been defined. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation CreateSubscriptionDefinitionVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/CreateSubscriptionDefinitionVersion +func (c *Greengrass) CreateSubscriptionDefinitionVersion(input *CreateSubscriptionDefinitionVersionInput) (*CreateSubscriptionDefinitionVersionOutput, error) { + req, out := c.CreateSubscriptionDefinitionVersionRequest(input) + return out, req.Send() +} + +// CreateSubscriptionDefinitionVersionWithContext is the same as CreateSubscriptionDefinitionVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSubscriptionDefinitionVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) CreateSubscriptionDefinitionVersionWithContext(ctx aws.Context, input *CreateSubscriptionDefinitionVersionInput, opts ...request.Option) (*CreateSubscriptionDefinitionVersionOutput, error) { + req, out := c.CreateSubscriptionDefinitionVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteConnectorDefinition = "DeleteConnectorDefinition" + +// DeleteConnectorDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the DeleteConnectorDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteConnectorDefinition for more information on using the DeleteConnectorDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteConnectorDefinitionRequest method. +// req, resp := client.DeleteConnectorDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteConnectorDefinition +func (c *Greengrass) DeleteConnectorDefinitionRequest(input *DeleteConnectorDefinitionInput) (req *request.Request, output *DeleteConnectorDefinitionOutput) { + op := &request.Operation{ + Name: opDeleteConnectorDefinition, + HTTPMethod: "DELETE", + HTTPPath: "/greengrass/definition/connectors/{ConnectorDefinitionId}", + } + + if input == nil { + input = &DeleteConnectorDefinitionInput{} + } + + output = &DeleteConnectorDefinitionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteConnectorDefinition API operation for AWS Greengrass. +// +// Deletes a connector definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation DeleteConnectorDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteConnectorDefinition +func (c *Greengrass) DeleteConnectorDefinition(input *DeleteConnectorDefinitionInput) (*DeleteConnectorDefinitionOutput, error) { + req, out := c.DeleteConnectorDefinitionRequest(input) + return out, req.Send() +} + +// DeleteConnectorDefinitionWithContext is the same as DeleteConnectorDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteConnectorDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) DeleteConnectorDefinitionWithContext(ctx aws.Context, input *DeleteConnectorDefinitionInput, opts ...request.Option) (*DeleteConnectorDefinitionOutput, error) { + req, out := c.DeleteConnectorDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteCoreDefinition = "DeleteCoreDefinition" + +// DeleteCoreDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the DeleteCoreDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteCoreDefinition for more information on using the DeleteCoreDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteCoreDefinitionRequest method. +// req, resp := client.DeleteCoreDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteCoreDefinition +func (c *Greengrass) DeleteCoreDefinitionRequest(input *DeleteCoreDefinitionInput) (req *request.Request, output *DeleteCoreDefinitionOutput) { + op := &request.Operation{ + Name: opDeleteCoreDefinition, + HTTPMethod: "DELETE", + HTTPPath: "/greengrass/definition/cores/{CoreDefinitionId}", + } + + if input == nil { + input = &DeleteCoreDefinitionInput{} + } + + output = &DeleteCoreDefinitionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteCoreDefinition API operation for AWS Greengrass. +// +// Deletes a core definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation DeleteCoreDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteCoreDefinition +func (c *Greengrass) DeleteCoreDefinition(input *DeleteCoreDefinitionInput) (*DeleteCoreDefinitionOutput, error) { + req, out := c.DeleteCoreDefinitionRequest(input) + return out, req.Send() +} + +// DeleteCoreDefinitionWithContext is the same as DeleteCoreDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteCoreDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) DeleteCoreDefinitionWithContext(ctx aws.Context, input *DeleteCoreDefinitionInput, opts ...request.Option) (*DeleteCoreDefinitionOutput, error) { + req, out := c.DeleteCoreDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteDeviceDefinition = "DeleteDeviceDefinition" + +// DeleteDeviceDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the DeleteDeviceDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteDeviceDefinition for more information on using the DeleteDeviceDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteDeviceDefinitionRequest method. +// req, resp := client.DeleteDeviceDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteDeviceDefinition +func (c *Greengrass) DeleteDeviceDefinitionRequest(input *DeleteDeviceDefinitionInput) (req *request.Request, output *DeleteDeviceDefinitionOutput) { + op := &request.Operation{ + Name: opDeleteDeviceDefinition, + HTTPMethod: "DELETE", + HTTPPath: "/greengrass/definition/devices/{DeviceDefinitionId}", + } + + if input == nil { + input = &DeleteDeviceDefinitionInput{} + } + + output = &DeleteDeviceDefinitionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteDeviceDefinition API operation for AWS Greengrass. +// +// Deletes a device definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation DeleteDeviceDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteDeviceDefinition +func (c *Greengrass) DeleteDeviceDefinition(input *DeleteDeviceDefinitionInput) (*DeleteDeviceDefinitionOutput, error) { + req, out := c.DeleteDeviceDefinitionRequest(input) + return out, req.Send() +} + +// DeleteDeviceDefinitionWithContext is the same as DeleteDeviceDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDeviceDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) DeleteDeviceDefinitionWithContext(ctx aws.Context, input *DeleteDeviceDefinitionInput, opts ...request.Option) (*DeleteDeviceDefinitionOutput, error) { + req, out := c.DeleteDeviceDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteFunctionDefinition = "DeleteFunctionDefinition" + +// DeleteFunctionDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the DeleteFunctionDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteFunctionDefinition for more information on using the DeleteFunctionDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteFunctionDefinitionRequest method. +// req, resp := client.DeleteFunctionDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteFunctionDefinition +func (c *Greengrass) DeleteFunctionDefinitionRequest(input *DeleteFunctionDefinitionInput) (req *request.Request, output *DeleteFunctionDefinitionOutput) { + op := &request.Operation{ + Name: opDeleteFunctionDefinition, + HTTPMethod: "DELETE", + HTTPPath: "/greengrass/definition/functions/{FunctionDefinitionId}", + } + + if input == nil { + input = &DeleteFunctionDefinitionInput{} + } + + output = &DeleteFunctionDefinitionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteFunctionDefinition API operation for AWS Greengrass. +// +// Deletes a Lambda function definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation DeleteFunctionDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteFunctionDefinition +func (c *Greengrass) DeleteFunctionDefinition(input *DeleteFunctionDefinitionInput) (*DeleteFunctionDefinitionOutput, error) { + req, out := c.DeleteFunctionDefinitionRequest(input) + return out, req.Send() +} + +// DeleteFunctionDefinitionWithContext is the same as DeleteFunctionDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteFunctionDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) DeleteFunctionDefinitionWithContext(ctx aws.Context, input *DeleteFunctionDefinitionInput, opts ...request.Option) (*DeleteFunctionDefinitionOutput, error) { + req, out := c.DeleteFunctionDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteGroup = "DeleteGroup" + +// DeleteGroupRequest generates a "aws/request.Request" representing the +// client's request for the DeleteGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteGroup for more information on using the DeleteGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteGroupRequest method. +// req, resp := client.DeleteGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteGroup +func (c *Greengrass) DeleteGroupRequest(input *DeleteGroupInput) (req *request.Request, output *DeleteGroupOutput) { + op := &request.Operation{ + Name: opDeleteGroup, + HTTPMethod: "DELETE", + HTTPPath: "/greengrass/groups/{GroupId}", + } + + if input == nil { + input = &DeleteGroupInput{} + } + + output = &DeleteGroupOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteGroup API operation for AWS Greengrass. +// +// Deletes a 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 Greengrass's +// API operation DeleteGroup for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteGroup +func (c *Greengrass) DeleteGroup(input *DeleteGroupInput) (*DeleteGroupOutput, error) { + req, out := c.DeleteGroupRequest(input) + return out, req.Send() +} + +// DeleteGroupWithContext is the same as DeleteGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) DeleteGroupWithContext(ctx aws.Context, input *DeleteGroupInput, opts ...request.Option) (*DeleteGroupOutput, error) { + req, out := c.DeleteGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteLoggerDefinition = "DeleteLoggerDefinition" + +// DeleteLoggerDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the DeleteLoggerDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteLoggerDefinition for more information on using the DeleteLoggerDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteLoggerDefinitionRequest method. +// req, resp := client.DeleteLoggerDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteLoggerDefinition +func (c *Greengrass) DeleteLoggerDefinitionRequest(input *DeleteLoggerDefinitionInput) (req *request.Request, output *DeleteLoggerDefinitionOutput) { + op := &request.Operation{ + Name: opDeleteLoggerDefinition, + HTTPMethod: "DELETE", + HTTPPath: "/greengrass/definition/loggers/{LoggerDefinitionId}", + } + + if input == nil { + input = &DeleteLoggerDefinitionInput{} + } + + output = &DeleteLoggerDefinitionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteLoggerDefinition API operation for AWS Greengrass. +// +// Deletes a logger definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation DeleteLoggerDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteLoggerDefinition +func (c *Greengrass) DeleteLoggerDefinition(input *DeleteLoggerDefinitionInput) (*DeleteLoggerDefinitionOutput, error) { + req, out := c.DeleteLoggerDefinitionRequest(input) + return out, req.Send() +} + +// DeleteLoggerDefinitionWithContext is the same as DeleteLoggerDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLoggerDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) DeleteLoggerDefinitionWithContext(ctx aws.Context, input *DeleteLoggerDefinitionInput, opts ...request.Option) (*DeleteLoggerDefinitionOutput, error) { + req, out := c.DeleteLoggerDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteResourceDefinition = "DeleteResourceDefinition" + +// DeleteResourceDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the DeleteResourceDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteResourceDefinition for more information on using the DeleteResourceDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteResourceDefinitionRequest method. +// req, resp := client.DeleteResourceDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteResourceDefinition +func (c *Greengrass) DeleteResourceDefinitionRequest(input *DeleteResourceDefinitionInput) (req *request.Request, output *DeleteResourceDefinitionOutput) { + op := &request.Operation{ + Name: opDeleteResourceDefinition, + HTTPMethod: "DELETE", + HTTPPath: "/greengrass/definition/resources/{ResourceDefinitionId}", + } + + if input == nil { + input = &DeleteResourceDefinitionInput{} + } + + output = &DeleteResourceDefinitionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteResourceDefinition API operation for AWS Greengrass. +// +// Deletes a resource definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation DeleteResourceDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteResourceDefinition +func (c *Greengrass) DeleteResourceDefinition(input *DeleteResourceDefinitionInput) (*DeleteResourceDefinitionOutput, error) { + req, out := c.DeleteResourceDefinitionRequest(input) + return out, req.Send() +} + +// DeleteResourceDefinitionWithContext is the same as DeleteResourceDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteResourceDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) DeleteResourceDefinitionWithContext(ctx aws.Context, input *DeleteResourceDefinitionInput, opts ...request.Option) (*DeleteResourceDefinitionOutput, error) { + req, out := c.DeleteResourceDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteSubscriptionDefinition = "DeleteSubscriptionDefinition" + +// DeleteSubscriptionDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the DeleteSubscriptionDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteSubscriptionDefinition for more information on using the DeleteSubscriptionDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteSubscriptionDefinitionRequest method. +// req, resp := client.DeleteSubscriptionDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteSubscriptionDefinition +func (c *Greengrass) DeleteSubscriptionDefinitionRequest(input *DeleteSubscriptionDefinitionInput) (req *request.Request, output *DeleteSubscriptionDefinitionOutput) { + op := &request.Operation{ + Name: opDeleteSubscriptionDefinition, + HTTPMethod: "DELETE", + HTTPPath: "/greengrass/definition/subscriptions/{SubscriptionDefinitionId}", + } + + if input == nil { + input = &DeleteSubscriptionDefinitionInput{} + } + + output = &DeleteSubscriptionDefinitionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteSubscriptionDefinition API operation for AWS Greengrass. +// +// Deletes a subscription definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation DeleteSubscriptionDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DeleteSubscriptionDefinition +func (c *Greengrass) DeleteSubscriptionDefinition(input *DeleteSubscriptionDefinitionInput) (*DeleteSubscriptionDefinitionOutput, error) { + req, out := c.DeleteSubscriptionDefinitionRequest(input) + return out, req.Send() +} + +// DeleteSubscriptionDefinitionWithContext is the same as DeleteSubscriptionDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSubscriptionDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) DeleteSubscriptionDefinitionWithContext(ctx aws.Context, input *DeleteSubscriptionDefinitionInput, opts ...request.Option) (*DeleteSubscriptionDefinitionOutput, error) { + req, out := c.DeleteSubscriptionDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDisassociateRoleFromGroup = "DisassociateRoleFromGroup" + +// DisassociateRoleFromGroupRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateRoleFromGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DisassociateRoleFromGroup for more information on using the DisassociateRoleFromGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DisassociateRoleFromGroupRequest method. +// req, resp := client.DisassociateRoleFromGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DisassociateRoleFromGroup +func (c *Greengrass) DisassociateRoleFromGroupRequest(input *DisassociateRoleFromGroupInput) (req *request.Request, output *DisassociateRoleFromGroupOutput) { + op := &request.Operation{ + Name: opDisassociateRoleFromGroup, + HTTPMethod: "DELETE", + HTTPPath: "/greengrass/groups/{GroupId}/role", + } + + if input == nil { + input = &DisassociateRoleFromGroupInput{} + } + + output = &DisassociateRoleFromGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// DisassociateRoleFromGroup API operation for AWS Greengrass. +// +// Disassociates the role from a 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 Greengrass's +// API operation DisassociateRoleFromGroup for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// * InternalServerErrorException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DisassociateRoleFromGroup +func (c *Greengrass) DisassociateRoleFromGroup(input *DisassociateRoleFromGroupInput) (*DisassociateRoleFromGroupOutput, error) { + req, out := c.DisassociateRoleFromGroupRequest(input) + return out, req.Send() +} + +// DisassociateRoleFromGroupWithContext is the same as DisassociateRoleFromGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateRoleFromGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) DisassociateRoleFromGroupWithContext(ctx aws.Context, input *DisassociateRoleFromGroupInput, opts ...request.Option) (*DisassociateRoleFromGroupOutput, error) { + req, out := c.DisassociateRoleFromGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDisassociateServiceRoleFromAccount = "DisassociateServiceRoleFromAccount" + +// DisassociateServiceRoleFromAccountRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateServiceRoleFromAccount operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DisassociateServiceRoleFromAccount for more information on using the DisassociateServiceRoleFromAccount +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DisassociateServiceRoleFromAccountRequest method. +// req, resp := client.DisassociateServiceRoleFromAccountRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DisassociateServiceRoleFromAccount +func (c *Greengrass) DisassociateServiceRoleFromAccountRequest(input *DisassociateServiceRoleFromAccountInput) (req *request.Request, output *DisassociateServiceRoleFromAccountOutput) { + op := &request.Operation{ + Name: opDisassociateServiceRoleFromAccount, + HTTPMethod: "DELETE", + HTTPPath: "/greengrass/servicerole", + } + + if input == nil { + input = &DisassociateServiceRoleFromAccountInput{} + } + + output = &DisassociateServiceRoleFromAccountOutput{} + req = c.newRequest(op, input, output) + return +} + +// DisassociateServiceRoleFromAccount API operation for AWS Greengrass. +// +// Disassociates the service role from your account. Without a service role, +// deployments will not work. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation DisassociateServiceRoleFromAccount for usage and error information. +// +// Returned Error Types: +// * InternalServerErrorException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/DisassociateServiceRoleFromAccount +func (c *Greengrass) DisassociateServiceRoleFromAccount(input *DisassociateServiceRoleFromAccountInput) (*DisassociateServiceRoleFromAccountOutput, error) { + req, out := c.DisassociateServiceRoleFromAccountRequest(input) + return out, req.Send() +} + +// DisassociateServiceRoleFromAccountWithContext is the same as DisassociateServiceRoleFromAccount with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateServiceRoleFromAccount for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) DisassociateServiceRoleFromAccountWithContext(ctx aws.Context, input *DisassociateServiceRoleFromAccountInput, opts ...request.Option) (*DisassociateServiceRoleFromAccountOutput, error) { + req, out := c.DisassociateServiceRoleFromAccountRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetAssociatedRole = "GetAssociatedRole" + +// GetAssociatedRoleRequest generates a "aws/request.Request" representing the +// client's request for the GetAssociatedRole operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetAssociatedRole for more information on using the GetAssociatedRole +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetAssociatedRoleRequest method. +// req, resp := client.GetAssociatedRoleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetAssociatedRole +func (c *Greengrass) GetAssociatedRoleRequest(input *GetAssociatedRoleInput) (req *request.Request, output *GetAssociatedRoleOutput) { + op := &request.Operation{ + Name: opGetAssociatedRole, + HTTPMethod: "GET", + HTTPPath: "/greengrass/groups/{GroupId}/role", + } + + if input == nil { + input = &GetAssociatedRoleInput{} + } + + output = &GetAssociatedRoleOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetAssociatedRole API operation for AWS Greengrass. +// +// Retrieves the role associated with a particular 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 Greengrass's +// API operation GetAssociatedRole for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// * InternalServerErrorException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetAssociatedRole +func (c *Greengrass) GetAssociatedRole(input *GetAssociatedRoleInput) (*GetAssociatedRoleOutput, error) { + req, out := c.GetAssociatedRoleRequest(input) + return out, req.Send() +} + +// GetAssociatedRoleWithContext is the same as GetAssociatedRole with the addition of +// the ability to pass a context and additional request options. +// +// See GetAssociatedRole for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetAssociatedRoleWithContext(ctx aws.Context, input *GetAssociatedRoleInput, opts ...request.Option) (*GetAssociatedRoleOutput, error) { + req, out := c.GetAssociatedRoleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBulkDeploymentStatus = "GetBulkDeploymentStatus" + +// GetBulkDeploymentStatusRequest generates a "aws/request.Request" representing the +// client's request for the GetBulkDeploymentStatus operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBulkDeploymentStatus for more information on using the GetBulkDeploymentStatus +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetBulkDeploymentStatusRequest method. +// req, resp := client.GetBulkDeploymentStatusRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetBulkDeploymentStatus +func (c *Greengrass) GetBulkDeploymentStatusRequest(input *GetBulkDeploymentStatusInput) (req *request.Request, output *GetBulkDeploymentStatusOutput) { + op := &request.Operation{ + Name: opGetBulkDeploymentStatus, + HTTPMethod: "GET", + HTTPPath: "/greengrass/bulk/deployments/{BulkDeploymentId}/status", + } + + if input == nil { + input = &GetBulkDeploymentStatusInput{} + } + + output = &GetBulkDeploymentStatusOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetBulkDeploymentStatus API operation for AWS Greengrass. +// +// Returns the status of a bulk 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 Greengrass's +// API operation GetBulkDeploymentStatus for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetBulkDeploymentStatus +func (c *Greengrass) GetBulkDeploymentStatus(input *GetBulkDeploymentStatusInput) (*GetBulkDeploymentStatusOutput, error) { + req, out := c.GetBulkDeploymentStatusRequest(input) + return out, req.Send() +} + +// GetBulkDeploymentStatusWithContext is the same as GetBulkDeploymentStatus with the addition of +// the ability to pass a context and additional request options. +// +// See GetBulkDeploymentStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetBulkDeploymentStatusWithContext(ctx aws.Context, input *GetBulkDeploymentStatusInput, opts ...request.Option) (*GetBulkDeploymentStatusOutput, error) { + req, out := c.GetBulkDeploymentStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetConnectivityInfo = "GetConnectivityInfo" + +// GetConnectivityInfoRequest generates a "aws/request.Request" representing the +// client's request for the GetConnectivityInfo operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetConnectivityInfo for more information on using the GetConnectivityInfo +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetConnectivityInfoRequest method. +// req, resp := client.GetConnectivityInfoRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetConnectivityInfo +func (c *Greengrass) GetConnectivityInfoRequest(input *GetConnectivityInfoInput) (req *request.Request, output *GetConnectivityInfoOutput) { + op := &request.Operation{ + Name: opGetConnectivityInfo, + HTTPMethod: "GET", + HTTPPath: "/greengrass/things/{ThingName}/connectivityInfo", + } + + if input == nil { + input = &GetConnectivityInfoInput{} + } + + output = &GetConnectivityInfoOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetConnectivityInfo API operation for AWS Greengrass. +// +// Retrieves the connectivity information for a core. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation GetConnectivityInfo for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// * InternalServerErrorException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetConnectivityInfo +func (c *Greengrass) GetConnectivityInfo(input *GetConnectivityInfoInput) (*GetConnectivityInfoOutput, error) { + req, out := c.GetConnectivityInfoRequest(input) + return out, req.Send() +} + +// GetConnectivityInfoWithContext is the same as GetConnectivityInfo with the addition of +// the ability to pass a context and additional request options. +// +// See GetConnectivityInfo for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetConnectivityInfoWithContext(ctx aws.Context, input *GetConnectivityInfoInput, opts ...request.Option) (*GetConnectivityInfoOutput, error) { + req, out := c.GetConnectivityInfoRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetConnectorDefinition = "GetConnectorDefinition" + +// GetConnectorDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the GetConnectorDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetConnectorDefinition for more information on using the GetConnectorDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetConnectorDefinitionRequest method. +// req, resp := client.GetConnectorDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetConnectorDefinition +func (c *Greengrass) GetConnectorDefinitionRequest(input *GetConnectorDefinitionInput) (req *request.Request, output *GetConnectorDefinitionOutput) { + op := &request.Operation{ + Name: opGetConnectorDefinition, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/connectors/{ConnectorDefinitionId}", + } + + if input == nil { + input = &GetConnectorDefinitionInput{} + } + + output = &GetConnectorDefinitionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetConnectorDefinition API operation for AWS Greengrass. +// +// Retrieves information about a connector definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation GetConnectorDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetConnectorDefinition +func (c *Greengrass) GetConnectorDefinition(input *GetConnectorDefinitionInput) (*GetConnectorDefinitionOutput, error) { + req, out := c.GetConnectorDefinitionRequest(input) + return out, req.Send() +} + +// GetConnectorDefinitionWithContext is the same as GetConnectorDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See GetConnectorDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetConnectorDefinitionWithContext(ctx aws.Context, input *GetConnectorDefinitionInput, opts ...request.Option) (*GetConnectorDefinitionOutput, error) { + req, out := c.GetConnectorDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetConnectorDefinitionVersion = "GetConnectorDefinitionVersion" + +// GetConnectorDefinitionVersionRequest generates a "aws/request.Request" representing the +// client's request for the GetConnectorDefinitionVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetConnectorDefinitionVersion for more information on using the GetConnectorDefinitionVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetConnectorDefinitionVersionRequest method. +// req, resp := client.GetConnectorDefinitionVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetConnectorDefinitionVersion +func (c *Greengrass) GetConnectorDefinitionVersionRequest(input *GetConnectorDefinitionVersionInput) (req *request.Request, output *GetConnectorDefinitionVersionOutput) { + op := &request.Operation{ + Name: opGetConnectorDefinitionVersion, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/connectors/{ConnectorDefinitionId}/versions/{ConnectorDefinitionVersionId}", + } + + if input == nil { + input = &GetConnectorDefinitionVersionInput{} + } + + output = &GetConnectorDefinitionVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetConnectorDefinitionVersion API operation for AWS Greengrass. +// +// Retrieves information about a connector definition version, including the +// connectors that the version contains. Connectors are prebuilt modules that +// interact with local infrastructure, device protocols, AWS, and other cloud +// 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 AWS Greengrass's +// API operation GetConnectorDefinitionVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetConnectorDefinitionVersion +func (c *Greengrass) GetConnectorDefinitionVersion(input *GetConnectorDefinitionVersionInput) (*GetConnectorDefinitionVersionOutput, error) { + req, out := c.GetConnectorDefinitionVersionRequest(input) + return out, req.Send() +} + +// GetConnectorDefinitionVersionWithContext is the same as GetConnectorDefinitionVersion with the addition of +// the ability to pass a context and additional request options. +// +// See GetConnectorDefinitionVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetConnectorDefinitionVersionWithContext(ctx aws.Context, input *GetConnectorDefinitionVersionInput, opts ...request.Option) (*GetConnectorDefinitionVersionOutput, error) { + req, out := c.GetConnectorDefinitionVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetCoreDefinition = "GetCoreDefinition" + +// GetCoreDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the GetCoreDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetCoreDefinition for more information on using the GetCoreDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetCoreDefinitionRequest method. +// req, resp := client.GetCoreDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetCoreDefinition +func (c *Greengrass) GetCoreDefinitionRequest(input *GetCoreDefinitionInput) (req *request.Request, output *GetCoreDefinitionOutput) { + op := &request.Operation{ + Name: opGetCoreDefinition, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/cores/{CoreDefinitionId}", + } + + if input == nil { + input = &GetCoreDefinitionInput{} + } + + output = &GetCoreDefinitionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetCoreDefinition API operation for AWS Greengrass. +// +// Retrieves information about a core definition 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 Greengrass's +// API operation GetCoreDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetCoreDefinition +func (c *Greengrass) GetCoreDefinition(input *GetCoreDefinitionInput) (*GetCoreDefinitionOutput, error) { + req, out := c.GetCoreDefinitionRequest(input) + return out, req.Send() +} + +// GetCoreDefinitionWithContext is the same as GetCoreDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See GetCoreDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetCoreDefinitionWithContext(ctx aws.Context, input *GetCoreDefinitionInput, opts ...request.Option) (*GetCoreDefinitionOutput, error) { + req, out := c.GetCoreDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetCoreDefinitionVersion = "GetCoreDefinitionVersion" + +// GetCoreDefinitionVersionRequest generates a "aws/request.Request" representing the +// client's request for the GetCoreDefinitionVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetCoreDefinitionVersion for more information on using the GetCoreDefinitionVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetCoreDefinitionVersionRequest method. +// req, resp := client.GetCoreDefinitionVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetCoreDefinitionVersion +func (c *Greengrass) GetCoreDefinitionVersionRequest(input *GetCoreDefinitionVersionInput) (req *request.Request, output *GetCoreDefinitionVersionOutput) { + op := &request.Operation{ + Name: opGetCoreDefinitionVersion, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/cores/{CoreDefinitionId}/versions/{CoreDefinitionVersionId}", + } + + if input == nil { + input = &GetCoreDefinitionVersionInput{} + } + + output = &GetCoreDefinitionVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetCoreDefinitionVersion API operation for AWS Greengrass. +// +// Retrieves information about a core definition 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 Greengrass's +// API operation GetCoreDefinitionVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetCoreDefinitionVersion +func (c *Greengrass) GetCoreDefinitionVersion(input *GetCoreDefinitionVersionInput) (*GetCoreDefinitionVersionOutput, error) { + req, out := c.GetCoreDefinitionVersionRequest(input) + return out, req.Send() +} + +// GetCoreDefinitionVersionWithContext is the same as GetCoreDefinitionVersion with the addition of +// the ability to pass a context and additional request options. +// +// See GetCoreDefinitionVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetCoreDefinitionVersionWithContext(ctx aws.Context, input *GetCoreDefinitionVersionInput, opts ...request.Option) (*GetCoreDefinitionVersionOutput, error) { + req, out := c.GetCoreDefinitionVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetDeploymentStatus = "GetDeploymentStatus" + +// GetDeploymentStatusRequest generates a "aws/request.Request" representing the +// client's request for the GetDeploymentStatus operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetDeploymentStatus for more information on using the GetDeploymentStatus +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetDeploymentStatusRequest method. +// req, resp := client.GetDeploymentStatusRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetDeploymentStatus +func (c *Greengrass) GetDeploymentStatusRequest(input *GetDeploymentStatusInput) (req *request.Request, output *GetDeploymentStatusOutput) { + op := &request.Operation{ + Name: opGetDeploymentStatus, + HTTPMethod: "GET", + HTTPPath: "/greengrass/groups/{GroupId}/deployments/{DeploymentId}/status", + } + + if input == nil { + input = &GetDeploymentStatusInput{} + } + + output = &GetDeploymentStatusOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetDeploymentStatus API operation for AWS Greengrass. +// +// Returns the status 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 Greengrass's +// API operation GetDeploymentStatus for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetDeploymentStatus +func (c *Greengrass) GetDeploymentStatus(input *GetDeploymentStatusInput) (*GetDeploymentStatusOutput, error) { + req, out := c.GetDeploymentStatusRequest(input) + return out, req.Send() +} + +// GetDeploymentStatusWithContext is the same as GetDeploymentStatus with the addition of +// the ability to pass a context and additional request options. +// +// See GetDeploymentStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetDeploymentStatusWithContext(ctx aws.Context, input *GetDeploymentStatusInput, opts ...request.Option) (*GetDeploymentStatusOutput, error) { + req, out := c.GetDeploymentStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetDeviceDefinition = "GetDeviceDefinition" + +// GetDeviceDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the GetDeviceDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetDeviceDefinition for more information on using the GetDeviceDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetDeviceDefinitionRequest method. +// req, resp := client.GetDeviceDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetDeviceDefinition +func (c *Greengrass) GetDeviceDefinitionRequest(input *GetDeviceDefinitionInput) (req *request.Request, output *GetDeviceDefinitionOutput) { + op := &request.Operation{ + Name: opGetDeviceDefinition, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/devices/{DeviceDefinitionId}", + } + + if input == nil { + input = &GetDeviceDefinitionInput{} + } + + output = &GetDeviceDefinitionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetDeviceDefinition API operation for AWS Greengrass. +// +// Retrieves information about a device definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation GetDeviceDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetDeviceDefinition +func (c *Greengrass) GetDeviceDefinition(input *GetDeviceDefinitionInput) (*GetDeviceDefinitionOutput, error) { + req, out := c.GetDeviceDefinitionRequest(input) + return out, req.Send() +} + +// GetDeviceDefinitionWithContext is the same as GetDeviceDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See GetDeviceDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetDeviceDefinitionWithContext(ctx aws.Context, input *GetDeviceDefinitionInput, opts ...request.Option) (*GetDeviceDefinitionOutput, error) { + req, out := c.GetDeviceDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetDeviceDefinitionVersion = "GetDeviceDefinitionVersion" + +// GetDeviceDefinitionVersionRequest generates a "aws/request.Request" representing the +// client's request for the GetDeviceDefinitionVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetDeviceDefinitionVersion for more information on using the GetDeviceDefinitionVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetDeviceDefinitionVersionRequest method. +// req, resp := client.GetDeviceDefinitionVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetDeviceDefinitionVersion +func (c *Greengrass) GetDeviceDefinitionVersionRequest(input *GetDeviceDefinitionVersionInput) (req *request.Request, output *GetDeviceDefinitionVersionOutput) { + op := &request.Operation{ + Name: opGetDeviceDefinitionVersion, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/devices/{DeviceDefinitionId}/versions/{DeviceDefinitionVersionId}", + } + + if input == nil { + input = &GetDeviceDefinitionVersionInput{} + } + + output = &GetDeviceDefinitionVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetDeviceDefinitionVersion API operation for AWS Greengrass. +// +// Retrieves information about a device definition 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 Greengrass's +// API operation GetDeviceDefinitionVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetDeviceDefinitionVersion +func (c *Greengrass) GetDeviceDefinitionVersion(input *GetDeviceDefinitionVersionInput) (*GetDeviceDefinitionVersionOutput, error) { + req, out := c.GetDeviceDefinitionVersionRequest(input) + return out, req.Send() +} + +// GetDeviceDefinitionVersionWithContext is the same as GetDeviceDefinitionVersion with the addition of +// the ability to pass a context and additional request options. +// +// See GetDeviceDefinitionVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetDeviceDefinitionVersionWithContext(ctx aws.Context, input *GetDeviceDefinitionVersionInput, opts ...request.Option) (*GetDeviceDefinitionVersionOutput, error) { + req, out := c.GetDeviceDefinitionVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetFunctionDefinition = "GetFunctionDefinition" + +// GetFunctionDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the GetFunctionDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetFunctionDefinition for more information on using the GetFunctionDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetFunctionDefinitionRequest method. +// req, resp := client.GetFunctionDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetFunctionDefinition +func (c *Greengrass) GetFunctionDefinitionRequest(input *GetFunctionDefinitionInput) (req *request.Request, output *GetFunctionDefinitionOutput) { + op := &request.Operation{ + Name: opGetFunctionDefinition, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/functions/{FunctionDefinitionId}", + } + + if input == nil { + input = &GetFunctionDefinitionInput{} + } + + output = &GetFunctionDefinitionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetFunctionDefinition API operation for AWS Greengrass. +// +// Retrieves information about a Lambda function definition, including its creation +// time and latest 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 Greengrass's +// API operation GetFunctionDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetFunctionDefinition +func (c *Greengrass) GetFunctionDefinition(input *GetFunctionDefinitionInput) (*GetFunctionDefinitionOutput, error) { + req, out := c.GetFunctionDefinitionRequest(input) + return out, req.Send() +} + +// GetFunctionDefinitionWithContext is the same as GetFunctionDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See GetFunctionDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetFunctionDefinitionWithContext(ctx aws.Context, input *GetFunctionDefinitionInput, opts ...request.Option) (*GetFunctionDefinitionOutput, error) { + req, out := c.GetFunctionDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetFunctionDefinitionVersion = "GetFunctionDefinitionVersion" + +// GetFunctionDefinitionVersionRequest generates a "aws/request.Request" representing the +// client's request for the GetFunctionDefinitionVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetFunctionDefinitionVersion for more information on using the GetFunctionDefinitionVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetFunctionDefinitionVersionRequest method. +// req, resp := client.GetFunctionDefinitionVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetFunctionDefinitionVersion +func (c *Greengrass) GetFunctionDefinitionVersionRequest(input *GetFunctionDefinitionVersionInput) (req *request.Request, output *GetFunctionDefinitionVersionOutput) { + op := &request.Operation{ + Name: opGetFunctionDefinitionVersion, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/functions/{FunctionDefinitionId}/versions/{FunctionDefinitionVersionId}", + } + + if input == nil { + input = &GetFunctionDefinitionVersionInput{} + } + + output = &GetFunctionDefinitionVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetFunctionDefinitionVersion API operation for AWS Greengrass. +// +// Retrieves information about a Lambda function definition version, including +// which Lambda functions are included in the version and their 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 AWS Greengrass's +// API operation GetFunctionDefinitionVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetFunctionDefinitionVersion +func (c *Greengrass) GetFunctionDefinitionVersion(input *GetFunctionDefinitionVersionInput) (*GetFunctionDefinitionVersionOutput, error) { + req, out := c.GetFunctionDefinitionVersionRequest(input) + return out, req.Send() +} + +// GetFunctionDefinitionVersionWithContext is the same as GetFunctionDefinitionVersion with the addition of +// the ability to pass a context and additional request options. +// +// See GetFunctionDefinitionVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetFunctionDefinitionVersionWithContext(ctx aws.Context, input *GetFunctionDefinitionVersionInput, opts ...request.Option) (*GetFunctionDefinitionVersionOutput, error) { + req, out := c.GetFunctionDefinitionVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetGroup = "GetGroup" + +// GetGroupRequest generates a "aws/request.Request" representing the +// client's request for the GetGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetGroup for more information on using the GetGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetGroupRequest method. +// req, resp := client.GetGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetGroup +func (c *Greengrass) GetGroupRequest(input *GetGroupInput) (req *request.Request, output *GetGroupOutput) { + op := &request.Operation{ + Name: opGetGroup, + HTTPMethod: "GET", + HTTPPath: "/greengrass/groups/{GroupId}", + } + + if input == nil { + input = &GetGroupInput{} + } + + output = &GetGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetGroup API operation for AWS Greengrass. +// +// Retrieves information about a 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 Greengrass's +// API operation GetGroup for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetGroup +func (c *Greengrass) GetGroup(input *GetGroupInput) (*GetGroupOutput, error) { + req, out := c.GetGroupRequest(input) + return out, req.Send() +} + +// GetGroupWithContext is the same as GetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See GetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetGroupWithContext(ctx aws.Context, input *GetGroupInput, opts ...request.Option) (*GetGroupOutput, error) { + req, out := c.GetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetGroupCertificateAuthority = "GetGroupCertificateAuthority" + +// GetGroupCertificateAuthorityRequest generates a "aws/request.Request" representing the +// client's request for the GetGroupCertificateAuthority operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetGroupCertificateAuthority for more information on using the GetGroupCertificateAuthority +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetGroupCertificateAuthorityRequest method. +// req, resp := client.GetGroupCertificateAuthorityRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetGroupCertificateAuthority +func (c *Greengrass) GetGroupCertificateAuthorityRequest(input *GetGroupCertificateAuthorityInput) (req *request.Request, output *GetGroupCertificateAuthorityOutput) { + op := &request.Operation{ + Name: opGetGroupCertificateAuthority, + HTTPMethod: "GET", + HTTPPath: "/greengrass/groups/{GroupId}/certificateauthorities/{CertificateAuthorityId}", + } + + if input == nil { + input = &GetGroupCertificateAuthorityInput{} + } + + output = &GetGroupCertificateAuthorityOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetGroupCertificateAuthority API operation for AWS Greengrass. +// +// Retreives the CA associated with a group. Returns the public key of the CA. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation GetGroupCertificateAuthority for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// * InternalServerErrorException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetGroupCertificateAuthority +func (c *Greengrass) GetGroupCertificateAuthority(input *GetGroupCertificateAuthorityInput) (*GetGroupCertificateAuthorityOutput, error) { + req, out := c.GetGroupCertificateAuthorityRequest(input) + return out, req.Send() +} + +// GetGroupCertificateAuthorityWithContext is the same as GetGroupCertificateAuthority with the addition of +// the ability to pass a context and additional request options. +// +// See GetGroupCertificateAuthority for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetGroupCertificateAuthorityWithContext(ctx aws.Context, input *GetGroupCertificateAuthorityInput, opts ...request.Option) (*GetGroupCertificateAuthorityOutput, error) { + req, out := c.GetGroupCertificateAuthorityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetGroupCertificateConfiguration = "GetGroupCertificateConfiguration" + +// GetGroupCertificateConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the GetGroupCertificateConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetGroupCertificateConfiguration for more information on using the GetGroupCertificateConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetGroupCertificateConfigurationRequest method. +// req, resp := client.GetGroupCertificateConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetGroupCertificateConfiguration +func (c *Greengrass) GetGroupCertificateConfigurationRequest(input *GetGroupCertificateConfigurationInput) (req *request.Request, output *GetGroupCertificateConfigurationOutput) { + op := &request.Operation{ + Name: opGetGroupCertificateConfiguration, + HTTPMethod: "GET", + HTTPPath: "/greengrass/groups/{GroupId}/certificateauthorities/configuration/expiry", + } + + if input == nil { + input = &GetGroupCertificateConfigurationInput{} + } + + output = &GetGroupCertificateConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetGroupCertificateConfiguration API operation for AWS Greengrass. +// +// Retrieves the current configuration for the CA used by the 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 Greengrass's +// API operation GetGroupCertificateConfiguration for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// * InternalServerErrorException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetGroupCertificateConfiguration +func (c *Greengrass) GetGroupCertificateConfiguration(input *GetGroupCertificateConfigurationInput) (*GetGroupCertificateConfigurationOutput, error) { + req, out := c.GetGroupCertificateConfigurationRequest(input) + return out, req.Send() +} + +// GetGroupCertificateConfigurationWithContext is the same as GetGroupCertificateConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetGroupCertificateConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetGroupCertificateConfigurationWithContext(ctx aws.Context, input *GetGroupCertificateConfigurationInput, opts ...request.Option) (*GetGroupCertificateConfigurationOutput, error) { + req, out := c.GetGroupCertificateConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetGroupVersion = "GetGroupVersion" + +// GetGroupVersionRequest generates a "aws/request.Request" representing the +// client's request for the GetGroupVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetGroupVersion for more information on using the GetGroupVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetGroupVersionRequest method. +// req, resp := client.GetGroupVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetGroupVersion +func (c *Greengrass) GetGroupVersionRequest(input *GetGroupVersionInput) (req *request.Request, output *GetGroupVersionOutput) { + op := &request.Operation{ + Name: opGetGroupVersion, + HTTPMethod: "GET", + HTTPPath: "/greengrass/groups/{GroupId}/versions/{GroupVersionId}", + } + + if input == nil { + input = &GetGroupVersionInput{} + } + + output = &GetGroupVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetGroupVersion API operation for AWS Greengrass. +// +// Retrieves information about a group 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 Greengrass's +// API operation GetGroupVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetGroupVersion +func (c *Greengrass) GetGroupVersion(input *GetGroupVersionInput) (*GetGroupVersionOutput, error) { + req, out := c.GetGroupVersionRequest(input) + return out, req.Send() +} + +// GetGroupVersionWithContext is the same as GetGroupVersion with the addition of +// the ability to pass a context and additional request options. +// +// See GetGroupVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetGroupVersionWithContext(ctx aws.Context, input *GetGroupVersionInput, opts ...request.Option) (*GetGroupVersionOutput, error) { + req, out := c.GetGroupVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetLoggerDefinition = "GetLoggerDefinition" + +// GetLoggerDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the GetLoggerDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetLoggerDefinition for more information on using the GetLoggerDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetLoggerDefinitionRequest method. +// req, resp := client.GetLoggerDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetLoggerDefinition +func (c *Greengrass) GetLoggerDefinitionRequest(input *GetLoggerDefinitionInput) (req *request.Request, output *GetLoggerDefinitionOutput) { + op := &request.Operation{ + Name: opGetLoggerDefinition, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/loggers/{LoggerDefinitionId}", + } + + if input == nil { + input = &GetLoggerDefinitionInput{} + } + + output = &GetLoggerDefinitionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetLoggerDefinition API operation for AWS Greengrass. +// +// Retrieves information about a logger definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation GetLoggerDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetLoggerDefinition +func (c *Greengrass) GetLoggerDefinition(input *GetLoggerDefinitionInput) (*GetLoggerDefinitionOutput, error) { + req, out := c.GetLoggerDefinitionRequest(input) + return out, req.Send() +} + +// GetLoggerDefinitionWithContext is the same as GetLoggerDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See GetLoggerDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetLoggerDefinitionWithContext(ctx aws.Context, input *GetLoggerDefinitionInput, opts ...request.Option) (*GetLoggerDefinitionOutput, error) { + req, out := c.GetLoggerDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetLoggerDefinitionVersion = "GetLoggerDefinitionVersion" + +// GetLoggerDefinitionVersionRequest generates a "aws/request.Request" representing the +// client's request for the GetLoggerDefinitionVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetLoggerDefinitionVersion for more information on using the GetLoggerDefinitionVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetLoggerDefinitionVersionRequest method. +// req, resp := client.GetLoggerDefinitionVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetLoggerDefinitionVersion +func (c *Greengrass) GetLoggerDefinitionVersionRequest(input *GetLoggerDefinitionVersionInput) (req *request.Request, output *GetLoggerDefinitionVersionOutput) { + op := &request.Operation{ + Name: opGetLoggerDefinitionVersion, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/loggers/{LoggerDefinitionId}/versions/{LoggerDefinitionVersionId}", + } + + if input == nil { + input = &GetLoggerDefinitionVersionInput{} + } + + output = &GetLoggerDefinitionVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetLoggerDefinitionVersion API operation for AWS Greengrass. +// +// Retrieves information about a logger definition 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 Greengrass's +// API operation GetLoggerDefinitionVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetLoggerDefinitionVersion +func (c *Greengrass) GetLoggerDefinitionVersion(input *GetLoggerDefinitionVersionInput) (*GetLoggerDefinitionVersionOutput, error) { + req, out := c.GetLoggerDefinitionVersionRequest(input) + return out, req.Send() +} + +// GetLoggerDefinitionVersionWithContext is the same as GetLoggerDefinitionVersion with the addition of +// the ability to pass a context and additional request options. +// +// See GetLoggerDefinitionVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetLoggerDefinitionVersionWithContext(ctx aws.Context, input *GetLoggerDefinitionVersionInput, opts ...request.Option) (*GetLoggerDefinitionVersionOutput, error) { + req, out := c.GetLoggerDefinitionVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetResourceDefinition = "GetResourceDefinition" + +// GetResourceDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the GetResourceDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetResourceDefinition for more information on using the GetResourceDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetResourceDefinitionRequest method. +// req, resp := client.GetResourceDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetResourceDefinition +func (c *Greengrass) GetResourceDefinitionRequest(input *GetResourceDefinitionInput) (req *request.Request, output *GetResourceDefinitionOutput) { + op := &request.Operation{ + Name: opGetResourceDefinition, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/resources/{ResourceDefinitionId}", + } + + if input == nil { + input = &GetResourceDefinitionInput{} + } + + output = &GetResourceDefinitionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetResourceDefinition API operation for AWS Greengrass. +// +// Retrieves information about a resource definition, including its creation +// time and latest 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 Greengrass's +// API operation GetResourceDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetResourceDefinition +func (c *Greengrass) GetResourceDefinition(input *GetResourceDefinitionInput) (*GetResourceDefinitionOutput, error) { + req, out := c.GetResourceDefinitionRequest(input) + return out, req.Send() +} + +// GetResourceDefinitionWithContext is the same as GetResourceDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See GetResourceDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetResourceDefinitionWithContext(ctx aws.Context, input *GetResourceDefinitionInput, opts ...request.Option) (*GetResourceDefinitionOutput, error) { + req, out := c.GetResourceDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetResourceDefinitionVersion = "GetResourceDefinitionVersion" + +// GetResourceDefinitionVersionRequest generates a "aws/request.Request" representing the +// client's request for the GetResourceDefinitionVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetResourceDefinitionVersion for more information on using the GetResourceDefinitionVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetResourceDefinitionVersionRequest method. +// req, resp := client.GetResourceDefinitionVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetResourceDefinitionVersion +func (c *Greengrass) GetResourceDefinitionVersionRequest(input *GetResourceDefinitionVersionInput) (req *request.Request, output *GetResourceDefinitionVersionOutput) { + op := &request.Operation{ + Name: opGetResourceDefinitionVersion, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/resources/{ResourceDefinitionId}/versions/{ResourceDefinitionVersionId}", + } + + if input == nil { + input = &GetResourceDefinitionVersionInput{} + } + + output = &GetResourceDefinitionVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetResourceDefinitionVersion API operation for AWS Greengrass. +// +// Retrieves information about a resource definition version, including which +// resources are included in the 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 Greengrass's +// API operation GetResourceDefinitionVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetResourceDefinitionVersion +func (c *Greengrass) GetResourceDefinitionVersion(input *GetResourceDefinitionVersionInput) (*GetResourceDefinitionVersionOutput, error) { + req, out := c.GetResourceDefinitionVersionRequest(input) + return out, req.Send() +} + +// GetResourceDefinitionVersionWithContext is the same as GetResourceDefinitionVersion with the addition of +// the ability to pass a context and additional request options. +// +// See GetResourceDefinitionVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetResourceDefinitionVersionWithContext(ctx aws.Context, input *GetResourceDefinitionVersionInput, opts ...request.Option) (*GetResourceDefinitionVersionOutput, error) { + req, out := c.GetResourceDefinitionVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetServiceRoleForAccount = "GetServiceRoleForAccount" + +// GetServiceRoleForAccountRequest generates a "aws/request.Request" representing the +// client's request for the GetServiceRoleForAccount operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetServiceRoleForAccount for more information on using the GetServiceRoleForAccount +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetServiceRoleForAccountRequest method. +// req, resp := client.GetServiceRoleForAccountRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetServiceRoleForAccount +func (c *Greengrass) GetServiceRoleForAccountRequest(input *GetServiceRoleForAccountInput) (req *request.Request, output *GetServiceRoleForAccountOutput) { + op := &request.Operation{ + Name: opGetServiceRoleForAccount, + HTTPMethod: "GET", + HTTPPath: "/greengrass/servicerole", + } + + if input == nil { + input = &GetServiceRoleForAccountInput{} + } + + output = &GetServiceRoleForAccountOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetServiceRoleForAccount API operation for AWS Greengrass. +// +// Retrieves the service role that is attached 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 AWS Greengrass's +// API operation GetServiceRoleForAccount for usage and error information. +// +// Returned Error Types: +// * InternalServerErrorException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetServiceRoleForAccount +func (c *Greengrass) GetServiceRoleForAccount(input *GetServiceRoleForAccountInput) (*GetServiceRoleForAccountOutput, error) { + req, out := c.GetServiceRoleForAccountRequest(input) + return out, req.Send() +} + +// GetServiceRoleForAccountWithContext is the same as GetServiceRoleForAccount with the addition of +// the ability to pass a context and additional request options. +// +// See GetServiceRoleForAccount for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetServiceRoleForAccountWithContext(ctx aws.Context, input *GetServiceRoleForAccountInput, opts ...request.Option) (*GetServiceRoleForAccountOutput, error) { + req, out := c.GetServiceRoleForAccountRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetSubscriptionDefinition = "GetSubscriptionDefinition" + +// GetSubscriptionDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the GetSubscriptionDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetSubscriptionDefinition for more information on using the GetSubscriptionDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetSubscriptionDefinitionRequest method. +// req, resp := client.GetSubscriptionDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetSubscriptionDefinition +func (c *Greengrass) GetSubscriptionDefinitionRequest(input *GetSubscriptionDefinitionInput) (req *request.Request, output *GetSubscriptionDefinitionOutput) { + op := &request.Operation{ + Name: opGetSubscriptionDefinition, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/subscriptions/{SubscriptionDefinitionId}", + } + + if input == nil { + input = &GetSubscriptionDefinitionInput{} + } + + output = &GetSubscriptionDefinitionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetSubscriptionDefinition API operation for AWS Greengrass. +// +// Retrieves information about a subscription definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation GetSubscriptionDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetSubscriptionDefinition +func (c *Greengrass) GetSubscriptionDefinition(input *GetSubscriptionDefinitionInput) (*GetSubscriptionDefinitionOutput, error) { + req, out := c.GetSubscriptionDefinitionRequest(input) + return out, req.Send() +} + +// GetSubscriptionDefinitionWithContext is the same as GetSubscriptionDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See GetSubscriptionDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetSubscriptionDefinitionWithContext(ctx aws.Context, input *GetSubscriptionDefinitionInput, opts ...request.Option) (*GetSubscriptionDefinitionOutput, error) { + req, out := c.GetSubscriptionDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetSubscriptionDefinitionVersion = "GetSubscriptionDefinitionVersion" + +// GetSubscriptionDefinitionVersionRequest generates a "aws/request.Request" representing the +// client's request for the GetSubscriptionDefinitionVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetSubscriptionDefinitionVersion for more information on using the GetSubscriptionDefinitionVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetSubscriptionDefinitionVersionRequest method. +// req, resp := client.GetSubscriptionDefinitionVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetSubscriptionDefinitionVersion +func (c *Greengrass) GetSubscriptionDefinitionVersionRequest(input *GetSubscriptionDefinitionVersionInput) (req *request.Request, output *GetSubscriptionDefinitionVersionOutput) { + op := &request.Operation{ + Name: opGetSubscriptionDefinitionVersion, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/subscriptions/{SubscriptionDefinitionId}/versions/{SubscriptionDefinitionVersionId}", + } + + if input == nil { + input = &GetSubscriptionDefinitionVersionInput{} + } + + output = &GetSubscriptionDefinitionVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetSubscriptionDefinitionVersion API operation for AWS Greengrass. +// +// Retrieves information about a subscription definition 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 Greengrass's +// API operation GetSubscriptionDefinitionVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/GetSubscriptionDefinitionVersion +func (c *Greengrass) GetSubscriptionDefinitionVersion(input *GetSubscriptionDefinitionVersionInput) (*GetSubscriptionDefinitionVersionOutput, error) { + req, out := c.GetSubscriptionDefinitionVersionRequest(input) + return out, req.Send() +} + +// GetSubscriptionDefinitionVersionWithContext is the same as GetSubscriptionDefinitionVersion with the addition of +// the ability to pass a context and additional request options. +// +// See GetSubscriptionDefinitionVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) GetSubscriptionDefinitionVersionWithContext(ctx aws.Context, input *GetSubscriptionDefinitionVersionInput, opts ...request.Option) (*GetSubscriptionDefinitionVersionOutput, error) { + req, out := c.GetSubscriptionDefinitionVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListBulkDeploymentDetailedReports = "ListBulkDeploymentDetailedReports" + +// ListBulkDeploymentDetailedReportsRequest generates a "aws/request.Request" representing the +// client's request for the ListBulkDeploymentDetailedReports operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListBulkDeploymentDetailedReports for more information on using the ListBulkDeploymentDetailedReports +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListBulkDeploymentDetailedReportsRequest method. +// req, resp := client.ListBulkDeploymentDetailedReportsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListBulkDeploymentDetailedReports +func (c *Greengrass) ListBulkDeploymentDetailedReportsRequest(input *ListBulkDeploymentDetailedReportsInput) (req *request.Request, output *ListBulkDeploymentDetailedReportsOutput) { + op := &request.Operation{ + Name: opListBulkDeploymentDetailedReports, + HTTPMethod: "GET", + HTTPPath: "/greengrass/bulk/deployments/{BulkDeploymentId}/detailed-reports", + } + + if input == nil { + input = &ListBulkDeploymentDetailedReportsInput{} + } + + output = &ListBulkDeploymentDetailedReportsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListBulkDeploymentDetailedReports API operation for AWS Greengrass. +// +// Gets a paginated list of the deployments that have been started in a bulk +// deployment operation, and their current deployment 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 Greengrass's +// API operation ListBulkDeploymentDetailedReports for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListBulkDeploymentDetailedReports +func (c *Greengrass) ListBulkDeploymentDetailedReports(input *ListBulkDeploymentDetailedReportsInput) (*ListBulkDeploymentDetailedReportsOutput, error) { + req, out := c.ListBulkDeploymentDetailedReportsRequest(input) + return out, req.Send() +} + +// ListBulkDeploymentDetailedReportsWithContext is the same as ListBulkDeploymentDetailedReports with the addition of +// the ability to pass a context and additional request options. +// +// See ListBulkDeploymentDetailedReports for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListBulkDeploymentDetailedReportsWithContext(ctx aws.Context, input *ListBulkDeploymentDetailedReportsInput, opts ...request.Option) (*ListBulkDeploymentDetailedReportsOutput, error) { + req, out := c.ListBulkDeploymentDetailedReportsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListBulkDeployments = "ListBulkDeployments" + +// ListBulkDeploymentsRequest generates a "aws/request.Request" representing the +// client's request for the ListBulkDeployments operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListBulkDeployments for more information on using the ListBulkDeployments +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListBulkDeploymentsRequest method. +// req, resp := client.ListBulkDeploymentsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListBulkDeployments +func (c *Greengrass) ListBulkDeploymentsRequest(input *ListBulkDeploymentsInput) (req *request.Request, output *ListBulkDeploymentsOutput) { + op := &request.Operation{ + Name: opListBulkDeployments, + HTTPMethod: "GET", + HTTPPath: "/greengrass/bulk/deployments", + } + + if input == nil { + input = &ListBulkDeploymentsInput{} + } + + output = &ListBulkDeploymentsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListBulkDeployments API operation for AWS Greengrass. +// +// Returns a list of bulk 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 Greengrass's +// API operation ListBulkDeployments for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListBulkDeployments +func (c *Greengrass) ListBulkDeployments(input *ListBulkDeploymentsInput) (*ListBulkDeploymentsOutput, error) { + req, out := c.ListBulkDeploymentsRequest(input) + return out, req.Send() +} + +// ListBulkDeploymentsWithContext is the same as ListBulkDeployments with the addition of +// the ability to pass a context and additional request options. +// +// See ListBulkDeployments for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListBulkDeploymentsWithContext(ctx aws.Context, input *ListBulkDeploymentsInput, opts ...request.Option) (*ListBulkDeploymentsOutput, error) { + req, out := c.ListBulkDeploymentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListConnectorDefinitionVersions = "ListConnectorDefinitionVersions" + +// ListConnectorDefinitionVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListConnectorDefinitionVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListConnectorDefinitionVersions for more information on using the ListConnectorDefinitionVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListConnectorDefinitionVersionsRequest method. +// req, resp := client.ListConnectorDefinitionVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListConnectorDefinitionVersions +func (c *Greengrass) ListConnectorDefinitionVersionsRequest(input *ListConnectorDefinitionVersionsInput) (req *request.Request, output *ListConnectorDefinitionVersionsOutput) { + op := &request.Operation{ + Name: opListConnectorDefinitionVersions, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/connectors/{ConnectorDefinitionId}/versions", + } + + if input == nil { + input = &ListConnectorDefinitionVersionsInput{} + } + + output = &ListConnectorDefinitionVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListConnectorDefinitionVersions API operation for AWS Greengrass. +// +// Lists the versions of a connector definition, which are containers for connectors. +// Connectors run on the Greengrass core and contain built-in integration with +// local infrastructure, device protocols, AWS, and other cloud 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 AWS Greengrass's +// API operation ListConnectorDefinitionVersions for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListConnectorDefinitionVersions +func (c *Greengrass) ListConnectorDefinitionVersions(input *ListConnectorDefinitionVersionsInput) (*ListConnectorDefinitionVersionsOutput, error) { + req, out := c.ListConnectorDefinitionVersionsRequest(input) + return out, req.Send() +} + +// ListConnectorDefinitionVersionsWithContext is the same as ListConnectorDefinitionVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListConnectorDefinitionVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListConnectorDefinitionVersionsWithContext(ctx aws.Context, input *ListConnectorDefinitionVersionsInput, opts ...request.Option) (*ListConnectorDefinitionVersionsOutput, error) { + req, out := c.ListConnectorDefinitionVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListConnectorDefinitions = "ListConnectorDefinitions" + +// ListConnectorDefinitionsRequest generates a "aws/request.Request" representing the +// client's request for the ListConnectorDefinitions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListConnectorDefinitions for more information on using the ListConnectorDefinitions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListConnectorDefinitionsRequest method. +// req, resp := client.ListConnectorDefinitionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListConnectorDefinitions +func (c *Greengrass) ListConnectorDefinitionsRequest(input *ListConnectorDefinitionsInput) (req *request.Request, output *ListConnectorDefinitionsOutput) { + op := &request.Operation{ + Name: opListConnectorDefinitions, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/connectors", + } + + if input == nil { + input = &ListConnectorDefinitionsInput{} + } + + output = &ListConnectorDefinitionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListConnectorDefinitions API operation for AWS Greengrass. +// +// Retrieves a list of connector definitions. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation ListConnectorDefinitions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListConnectorDefinitions +func (c *Greengrass) ListConnectorDefinitions(input *ListConnectorDefinitionsInput) (*ListConnectorDefinitionsOutput, error) { + req, out := c.ListConnectorDefinitionsRequest(input) + return out, req.Send() +} + +// ListConnectorDefinitionsWithContext is the same as ListConnectorDefinitions with the addition of +// the ability to pass a context and additional request options. +// +// See ListConnectorDefinitions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListConnectorDefinitionsWithContext(ctx aws.Context, input *ListConnectorDefinitionsInput, opts ...request.Option) (*ListConnectorDefinitionsOutput, error) { + req, out := c.ListConnectorDefinitionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListCoreDefinitionVersions = "ListCoreDefinitionVersions" + +// ListCoreDefinitionVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListCoreDefinitionVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListCoreDefinitionVersions for more information on using the ListCoreDefinitionVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListCoreDefinitionVersionsRequest method. +// req, resp := client.ListCoreDefinitionVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListCoreDefinitionVersions +func (c *Greengrass) ListCoreDefinitionVersionsRequest(input *ListCoreDefinitionVersionsInput) (req *request.Request, output *ListCoreDefinitionVersionsOutput) { + op := &request.Operation{ + Name: opListCoreDefinitionVersions, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/cores/{CoreDefinitionId}/versions", + } + + if input == nil { + input = &ListCoreDefinitionVersionsInput{} + } + + output = &ListCoreDefinitionVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListCoreDefinitionVersions API operation for AWS Greengrass. +// +// Lists the versions of a core definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation ListCoreDefinitionVersions for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListCoreDefinitionVersions +func (c *Greengrass) ListCoreDefinitionVersions(input *ListCoreDefinitionVersionsInput) (*ListCoreDefinitionVersionsOutput, error) { + req, out := c.ListCoreDefinitionVersionsRequest(input) + return out, req.Send() +} + +// ListCoreDefinitionVersionsWithContext is the same as ListCoreDefinitionVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListCoreDefinitionVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListCoreDefinitionVersionsWithContext(ctx aws.Context, input *ListCoreDefinitionVersionsInput, opts ...request.Option) (*ListCoreDefinitionVersionsOutput, error) { + req, out := c.ListCoreDefinitionVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListCoreDefinitions = "ListCoreDefinitions" + +// ListCoreDefinitionsRequest generates a "aws/request.Request" representing the +// client's request for the ListCoreDefinitions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListCoreDefinitions for more information on using the ListCoreDefinitions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListCoreDefinitionsRequest method. +// req, resp := client.ListCoreDefinitionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListCoreDefinitions +func (c *Greengrass) ListCoreDefinitionsRequest(input *ListCoreDefinitionsInput) (req *request.Request, output *ListCoreDefinitionsOutput) { + op := &request.Operation{ + Name: opListCoreDefinitions, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/cores", + } + + if input == nil { + input = &ListCoreDefinitionsInput{} + } + + output = &ListCoreDefinitionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListCoreDefinitions API operation for AWS Greengrass. +// +// Retrieves a list of core definitions. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation ListCoreDefinitions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListCoreDefinitions +func (c *Greengrass) ListCoreDefinitions(input *ListCoreDefinitionsInput) (*ListCoreDefinitionsOutput, error) { + req, out := c.ListCoreDefinitionsRequest(input) + return out, req.Send() +} + +// ListCoreDefinitionsWithContext is the same as ListCoreDefinitions with the addition of +// the ability to pass a context and additional request options. +// +// See ListCoreDefinitions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListCoreDefinitionsWithContext(ctx aws.Context, input *ListCoreDefinitionsInput, opts ...request.Option) (*ListCoreDefinitionsOutput, error) { + req, out := c.ListCoreDefinitionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListDeployments = "ListDeployments" + +// ListDeploymentsRequest generates a "aws/request.Request" representing the +// client's request for the ListDeployments operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListDeployments for more information on using the ListDeployments +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListDeploymentsRequest method. +// req, resp := client.ListDeploymentsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListDeployments +func (c *Greengrass) ListDeploymentsRequest(input *ListDeploymentsInput) (req *request.Request, output *ListDeploymentsOutput) { + op := &request.Operation{ + Name: opListDeployments, + HTTPMethod: "GET", + HTTPPath: "/greengrass/groups/{GroupId}/deployments", + } + + if input == nil { + input = &ListDeploymentsInput{} + } + + output = &ListDeploymentsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListDeployments API operation for AWS Greengrass. +// +// Returns a history of deployments for the 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 Greengrass's +// API operation ListDeployments for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListDeployments +func (c *Greengrass) ListDeployments(input *ListDeploymentsInput) (*ListDeploymentsOutput, error) { + req, out := c.ListDeploymentsRequest(input) + return out, req.Send() +} + +// ListDeploymentsWithContext is the same as ListDeployments with the addition of +// the ability to pass a context and additional request options. +// +// See ListDeployments for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListDeploymentsWithContext(ctx aws.Context, input *ListDeploymentsInput, opts ...request.Option) (*ListDeploymentsOutput, error) { + req, out := c.ListDeploymentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListDeviceDefinitionVersions = "ListDeviceDefinitionVersions" + +// ListDeviceDefinitionVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListDeviceDefinitionVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListDeviceDefinitionVersions for more information on using the ListDeviceDefinitionVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListDeviceDefinitionVersionsRequest method. +// req, resp := client.ListDeviceDefinitionVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListDeviceDefinitionVersions +func (c *Greengrass) ListDeviceDefinitionVersionsRequest(input *ListDeviceDefinitionVersionsInput) (req *request.Request, output *ListDeviceDefinitionVersionsOutput) { + op := &request.Operation{ + Name: opListDeviceDefinitionVersions, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/devices/{DeviceDefinitionId}/versions", + } + + if input == nil { + input = &ListDeviceDefinitionVersionsInput{} + } + + output = &ListDeviceDefinitionVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListDeviceDefinitionVersions API operation for AWS Greengrass. +// +// Lists the versions of a device definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation ListDeviceDefinitionVersions for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListDeviceDefinitionVersions +func (c *Greengrass) ListDeviceDefinitionVersions(input *ListDeviceDefinitionVersionsInput) (*ListDeviceDefinitionVersionsOutput, error) { + req, out := c.ListDeviceDefinitionVersionsRequest(input) + return out, req.Send() +} + +// ListDeviceDefinitionVersionsWithContext is the same as ListDeviceDefinitionVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListDeviceDefinitionVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListDeviceDefinitionVersionsWithContext(ctx aws.Context, input *ListDeviceDefinitionVersionsInput, opts ...request.Option) (*ListDeviceDefinitionVersionsOutput, error) { + req, out := c.ListDeviceDefinitionVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListDeviceDefinitions = "ListDeviceDefinitions" + +// ListDeviceDefinitionsRequest generates a "aws/request.Request" representing the +// client's request for the ListDeviceDefinitions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListDeviceDefinitions for more information on using the ListDeviceDefinitions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListDeviceDefinitionsRequest method. +// req, resp := client.ListDeviceDefinitionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListDeviceDefinitions +func (c *Greengrass) ListDeviceDefinitionsRequest(input *ListDeviceDefinitionsInput) (req *request.Request, output *ListDeviceDefinitionsOutput) { + op := &request.Operation{ + Name: opListDeviceDefinitions, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/devices", + } + + if input == nil { + input = &ListDeviceDefinitionsInput{} + } + + output = &ListDeviceDefinitionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListDeviceDefinitions API operation for AWS Greengrass. +// +// Retrieves a list of device definitions. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation ListDeviceDefinitions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListDeviceDefinitions +func (c *Greengrass) ListDeviceDefinitions(input *ListDeviceDefinitionsInput) (*ListDeviceDefinitionsOutput, error) { + req, out := c.ListDeviceDefinitionsRequest(input) + return out, req.Send() +} + +// ListDeviceDefinitionsWithContext is the same as ListDeviceDefinitions with the addition of +// the ability to pass a context and additional request options. +// +// See ListDeviceDefinitions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListDeviceDefinitionsWithContext(ctx aws.Context, input *ListDeviceDefinitionsInput, opts ...request.Option) (*ListDeviceDefinitionsOutput, error) { + req, out := c.ListDeviceDefinitionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListFunctionDefinitionVersions = "ListFunctionDefinitionVersions" + +// ListFunctionDefinitionVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListFunctionDefinitionVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListFunctionDefinitionVersions for more information on using the ListFunctionDefinitionVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListFunctionDefinitionVersionsRequest method. +// req, resp := client.ListFunctionDefinitionVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListFunctionDefinitionVersions +func (c *Greengrass) ListFunctionDefinitionVersionsRequest(input *ListFunctionDefinitionVersionsInput) (req *request.Request, output *ListFunctionDefinitionVersionsOutput) { + op := &request.Operation{ + Name: opListFunctionDefinitionVersions, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/functions/{FunctionDefinitionId}/versions", + } + + if input == nil { + input = &ListFunctionDefinitionVersionsInput{} + } + + output = &ListFunctionDefinitionVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListFunctionDefinitionVersions API operation for AWS Greengrass. +// +// Lists the versions of a Lambda function definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation ListFunctionDefinitionVersions for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListFunctionDefinitionVersions +func (c *Greengrass) ListFunctionDefinitionVersions(input *ListFunctionDefinitionVersionsInput) (*ListFunctionDefinitionVersionsOutput, error) { + req, out := c.ListFunctionDefinitionVersionsRequest(input) + return out, req.Send() +} + +// ListFunctionDefinitionVersionsWithContext is the same as ListFunctionDefinitionVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListFunctionDefinitionVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListFunctionDefinitionVersionsWithContext(ctx aws.Context, input *ListFunctionDefinitionVersionsInput, opts ...request.Option) (*ListFunctionDefinitionVersionsOutput, error) { + req, out := c.ListFunctionDefinitionVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListFunctionDefinitions = "ListFunctionDefinitions" + +// ListFunctionDefinitionsRequest generates a "aws/request.Request" representing the +// client's request for the ListFunctionDefinitions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListFunctionDefinitions for more information on using the ListFunctionDefinitions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListFunctionDefinitionsRequest method. +// req, resp := client.ListFunctionDefinitionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListFunctionDefinitions +func (c *Greengrass) ListFunctionDefinitionsRequest(input *ListFunctionDefinitionsInput) (req *request.Request, output *ListFunctionDefinitionsOutput) { + op := &request.Operation{ + Name: opListFunctionDefinitions, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/functions", + } + + if input == nil { + input = &ListFunctionDefinitionsInput{} + } + + output = &ListFunctionDefinitionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListFunctionDefinitions API operation for AWS Greengrass. +// +// Retrieves a list of Lambda function definitions. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation ListFunctionDefinitions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListFunctionDefinitions +func (c *Greengrass) ListFunctionDefinitions(input *ListFunctionDefinitionsInput) (*ListFunctionDefinitionsOutput, error) { + req, out := c.ListFunctionDefinitionsRequest(input) + return out, req.Send() +} + +// ListFunctionDefinitionsWithContext is the same as ListFunctionDefinitions with the addition of +// the ability to pass a context and additional request options. +// +// See ListFunctionDefinitions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListFunctionDefinitionsWithContext(ctx aws.Context, input *ListFunctionDefinitionsInput, opts ...request.Option) (*ListFunctionDefinitionsOutput, error) { + req, out := c.ListFunctionDefinitionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListGroupCertificateAuthorities = "ListGroupCertificateAuthorities" + +// ListGroupCertificateAuthoritiesRequest generates a "aws/request.Request" representing the +// client's request for the ListGroupCertificateAuthorities operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListGroupCertificateAuthorities for more information on using the ListGroupCertificateAuthorities +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListGroupCertificateAuthoritiesRequest method. +// req, resp := client.ListGroupCertificateAuthoritiesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListGroupCertificateAuthorities +func (c *Greengrass) ListGroupCertificateAuthoritiesRequest(input *ListGroupCertificateAuthoritiesInput) (req *request.Request, output *ListGroupCertificateAuthoritiesOutput) { + op := &request.Operation{ + Name: opListGroupCertificateAuthorities, + HTTPMethod: "GET", + HTTPPath: "/greengrass/groups/{GroupId}/certificateauthorities", + } + + if input == nil { + input = &ListGroupCertificateAuthoritiesInput{} + } + + output = &ListGroupCertificateAuthoritiesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListGroupCertificateAuthorities API operation for AWS Greengrass. +// +// Retrieves the current CAs for a 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 Greengrass's +// API operation ListGroupCertificateAuthorities for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// * InternalServerErrorException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListGroupCertificateAuthorities +func (c *Greengrass) ListGroupCertificateAuthorities(input *ListGroupCertificateAuthoritiesInput) (*ListGroupCertificateAuthoritiesOutput, error) { + req, out := c.ListGroupCertificateAuthoritiesRequest(input) + return out, req.Send() +} + +// ListGroupCertificateAuthoritiesWithContext is the same as ListGroupCertificateAuthorities with the addition of +// the ability to pass a context and additional request options. +// +// See ListGroupCertificateAuthorities for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListGroupCertificateAuthoritiesWithContext(ctx aws.Context, input *ListGroupCertificateAuthoritiesInput, opts ...request.Option) (*ListGroupCertificateAuthoritiesOutput, error) { + req, out := c.ListGroupCertificateAuthoritiesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListGroupVersions = "ListGroupVersions" + +// ListGroupVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListGroupVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListGroupVersions for more information on using the ListGroupVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListGroupVersionsRequest method. +// req, resp := client.ListGroupVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListGroupVersions +func (c *Greengrass) ListGroupVersionsRequest(input *ListGroupVersionsInput) (req *request.Request, output *ListGroupVersionsOutput) { + op := &request.Operation{ + Name: opListGroupVersions, + HTTPMethod: "GET", + HTTPPath: "/greengrass/groups/{GroupId}/versions", + } + + if input == nil { + input = &ListGroupVersionsInput{} + } + + output = &ListGroupVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListGroupVersions API operation for AWS Greengrass. +// +// Lists the versions of a 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 Greengrass's +// API operation ListGroupVersions for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListGroupVersions +func (c *Greengrass) ListGroupVersions(input *ListGroupVersionsInput) (*ListGroupVersionsOutput, error) { + req, out := c.ListGroupVersionsRequest(input) + return out, req.Send() +} + +// ListGroupVersionsWithContext is the same as ListGroupVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListGroupVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListGroupVersionsWithContext(ctx aws.Context, input *ListGroupVersionsInput, opts ...request.Option) (*ListGroupVersionsOutput, error) { + req, out := c.ListGroupVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListGroups = "ListGroups" + +// ListGroupsRequest generates a "aws/request.Request" representing the +// client's request for the ListGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListGroups for more information on using the ListGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListGroupsRequest method. +// req, resp := client.ListGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListGroups +func (c *Greengrass) ListGroupsRequest(input *ListGroupsInput) (req *request.Request, output *ListGroupsOutput) { + op := &request.Operation{ + Name: opListGroups, + HTTPMethod: "GET", + HTTPPath: "/greengrass/groups", + } + + if input == nil { + input = &ListGroupsInput{} + } + + output = &ListGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListGroups API operation for AWS Greengrass. +// +// Retrieves a list of 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 Greengrass's +// API operation ListGroups for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListGroups +func (c *Greengrass) ListGroups(input *ListGroupsInput) (*ListGroupsOutput, error) { + req, out := c.ListGroupsRequest(input) + return out, req.Send() +} + +// ListGroupsWithContext is the same as ListGroups with the addition of +// the ability to pass a context and additional request options. +// +// See ListGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListGroupsWithContext(ctx aws.Context, input *ListGroupsInput, opts ...request.Option) (*ListGroupsOutput, error) { + req, out := c.ListGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListLoggerDefinitionVersions = "ListLoggerDefinitionVersions" + +// ListLoggerDefinitionVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListLoggerDefinitionVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListLoggerDefinitionVersions for more information on using the ListLoggerDefinitionVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListLoggerDefinitionVersionsRequest method. +// req, resp := client.ListLoggerDefinitionVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListLoggerDefinitionVersions +func (c *Greengrass) ListLoggerDefinitionVersionsRequest(input *ListLoggerDefinitionVersionsInput) (req *request.Request, output *ListLoggerDefinitionVersionsOutput) { + op := &request.Operation{ + Name: opListLoggerDefinitionVersions, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/loggers/{LoggerDefinitionId}/versions", + } + + if input == nil { + input = &ListLoggerDefinitionVersionsInput{} + } + + output = &ListLoggerDefinitionVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListLoggerDefinitionVersions API operation for AWS Greengrass. +// +// Lists the versions of a logger definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation ListLoggerDefinitionVersions for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListLoggerDefinitionVersions +func (c *Greengrass) ListLoggerDefinitionVersions(input *ListLoggerDefinitionVersionsInput) (*ListLoggerDefinitionVersionsOutput, error) { + req, out := c.ListLoggerDefinitionVersionsRequest(input) + return out, req.Send() +} + +// ListLoggerDefinitionVersionsWithContext is the same as ListLoggerDefinitionVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListLoggerDefinitionVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListLoggerDefinitionVersionsWithContext(ctx aws.Context, input *ListLoggerDefinitionVersionsInput, opts ...request.Option) (*ListLoggerDefinitionVersionsOutput, error) { + req, out := c.ListLoggerDefinitionVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListLoggerDefinitions = "ListLoggerDefinitions" + +// ListLoggerDefinitionsRequest generates a "aws/request.Request" representing the +// client's request for the ListLoggerDefinitions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListLoggerDefinitions for more information on using the ListLoggerDefinitions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListLoggerDefinitionsRequest method. +// req, resp := client.ListLoggerDefinitionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListLoggerDefinitions +func (c *Greengrass) ListLoggerDefinitionsRequest(input *ListLoggerDefinitionsInput) (req *request.Request, output *ListLoggerDefinitionsOutput) { + op := &request.Operation{ + Name: opListLoggerDefinitions, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/loggers", + } + + if input == nil { + input = &ListLoggerDefinitionsInput{} + } + + output = &ListLoggerDefinitionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListLoggerDefinitions API operation for AWS Greengrass. +// +// Retrieves a list of logger definitions. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation ListLoggerDefinitions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListLoggerDefinitions +func (c *Greengrass) ListLoggerDefinitions(input *ListLoggerDefinitionsInput) (*ListLoggerDefinitionsOutput, error) { + req, out := c.ListLoggerDefinitionsRequest(input) + return out, req.Send() +} + +// ListLoggerDefinitionsWithContext is the same as ListLoggerDefinitions with the addition of +// the ability to pass a context and additional request options. +// +// See ListLoggerDefinitions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListLoggerDefinitionsWithContext(ctx aws.Context, input *ListLoggerDefinitionsInput, opts ...request.Option) (*ListLoggerDefinitionsOutput, error) { + req, out := c.ListLoggerDefinitionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListResourceDefinitionVersions = "ListResourceDefinitionVersions" + +// ListResourceDefinitionVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListResourceDefinitionVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListResourceDefinitionVersions for more information on using the ListResourceDefinitionVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListResourceDefinitionVersionsRequest method. +// req, resp := client.ListResourceDefinitionVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListResourceDefinitionVersions +func (c *Greengrass) ListResourceDefinitionVersionsRequest(input *ListResourceDefinitionVersionsInput) (req *request.Request, output *ListResourceDefinitionVersionsOutput) { + op := &request.Operation{ + Name: opListResourceDefinitionVersions, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/resources/{ResourceDefinitionId}/versions", + } + + if input == nil { + input = &ListResourceDefinitionVersionsInput{} + } + + output = &ListResourceDefinitionVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListResourceDefinitionVersions API operation for AWS Greengrass. +// +// Lists the versions of a resource definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation ListResourceDefinitionVersions for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListResourceDefinitionVersions +func (c *Greengrass) ListResourceDefinitionVersions(input *ListResourceDefinitionVersionsInput) (*ListResourceDefinitionVersionsOutput, error) { + req, out := c.ListResourceDefinitionVersionsRequest(input) + return out, req.Send() +} + +// ListResourceDefinitionVersionsWithContext is the same as ListResourceDefinitionVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListResourceDefinitionVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListResourceDefinitionVersionsWithContext(ctx aws.Context, input *ListResourceDefinitionVersionsInput, opts ...request.Option) (*ListResourceDefinitionVersionsOutput, error) { + req, out := c.ListResourceDefinitionVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListResourceDefinitions = "ListResourceDefinitions" + +// ListResourceDefinitionsRequest generates a "aws/request.Request" representing the +// client's request for the ListResourceDefinitions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListResourceDefinitions for more information on using the ListResourceDefinitions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListResourceDefinitionsRequest method. +// req, resp := client.ListResourceDefinitionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListResourceDefinitions +func (c *Greengrass) ListResourceDefinitionsRequest(input *ListResourceDefinitionsInput) (req *request.Request, output *ListResourceDefinitionsOutput) { + op := &request.Operation{ + Name: opListResourceDefinitions, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/resources", + } + + if input == nil { + input = &ListResourceDefinitionsInput{} + } + + output = &ListResourceDefinitionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListResourceDefinitions API operation for AWS Greengrass. +// +// Retrieves a list of resource definitions. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation ListResourceDefinitions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListResourceDefinitions +func (c *Greengrass) ListResourceDefinitions(input *ListResourceDefinitionsInput) (*ListResourceDefinitionsOutput, error) { + req, out := c.ListResourceDefinitionsRequest(input) + return out, req.Send() +} + +// ListResourceDefinitionsWithContext is the same as ListResourceDefinitions with the addition of +// the ability to pass a context and additional request options. +// +// See ListResourceDefinitions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListResourceDefinitionsWithContext(ctx aws.Context, input *ListResourceDefinitionsInput, opts ...request.Option) (*ListResourceDefinitionsOutput, error) { + req, out := c.ListResourceDefinitionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListSubscriptionDefinitionVersions = "ListSubscriptionDefinitionVersions" + +// ListSubscriptionDefinitionVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListSubscriptionDefinitionVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListSubscriptionDefinitionVersions for more information on using the ListSubscriptionDefinitionVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListSubscriptionDefinitionVersionsRequest method. +// req, resp := client.ListSubscriptionDefinitionVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListSubscriptionDefinitionVersions +func (c *Greengrass) ListSubscriptionDefinitionVersionsRequest(input *ListSubscriptionDefinitionVersionsInput) (req *request.Request, output *ListSubscriptionDefinitionVersionsOutput) { + op := &request.Operation{ + Name: opListSubscriptionDefinitionVersions, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/subscriptions/{SubscriptionDefinitionId}/versions", + } + + if input == nil { + input = &ListSubscriptionDefinitionVersionsInput{} + } + + output = &ListSubscriptionDefinitionVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListSubscriptionDefinitionVersions API operation for AWS Greengrass. +// +// Lists the versions of a subscription definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation ListSubscriptionDefinitionVersions for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListSubscriptionDefinitionVersions +func (c *Greengrass) ListSubscriptionDefinitionVersions(input *ListSubscriptionDefinitionVersionsInput) (*ListSubscriptionDefinitionVersionsOutput, error) { + req, out := c.ListSubscriptionDefinitionVersionsRequest(input) + return out, req.Send() +} + +// ListSubscriptionDefinitionVersionsWithContext is the same as ListSubscriptionDefinitionVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListSubscriptionDefinitionVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListSubscriptionDefinitionVersionsWithContext(ctx aws.Context, input *ListSubscriptionDefinitionVersionsInput, opts ...request.Option) (*ListSubscriptionDefinitionVersionsOutput, error) { + req, out := c.ListSubscriptionDefinitionVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListSubscriptionDefinitions = "ListSubscriptionDefinitions" + +// ListSubscriptionDefinitionsRequest generates a "aws/request.Request" representing the +// client's request for the ListSubscriptionDefinitions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListSubscriptionDefinitions for more information on using the ListSubscriptionDefinitions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListSubscriptionDefinitionsRequest method. +// req, resp := client.ListSubscriptionDefinitionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListSubscriptionDefinitions +func (c *Greengrass) ListSubscriptionDefinitionsRequest(input *ListSubscriptionDefinitionsInput) (req *request.Request, output *ListSubscriptionDefinitionsOutput) { + op := &request.Operation{ + Name: opListSubscriptionDefinitions, + HTTPMethod: "GET", + HTTPPath: "/greengrass/definition/subscriptions", + } + + if input == nil { + input = &ListSubscriptionDefinitionsInput{} + } + + output = &ListSubscriptionDefinitionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListSubscriptionDefinitions API operation for AWS Greengrass. +// +// Retrieves a list of subscription definitions. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation ListSubscriptionDefinitions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListSubscriptionDefinitions +func (c *Greengrass) ListSubscriptionDefinitions(input *ListSubscriptionDefinitionsInput) (*ListSubscriptionDefinitionsOutput, error) { + req, out := c.ListSubscriptionDefinitionsRequest(input) + return out, req.Send() +} + +// ListSubscriptionDefinitionsWithContext is the same as ListSubscriptionDefinitions with the addition of +// the ability to pass a context and additional request options. +// +// See ListSubscriptionDefinitions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListSubscriptionDefinitionsWithContext(ctx aws.Context, input *ListSubscriptionDefinitionsInput, opts ...request.Option) (*ListSubscriptionDefinitionsOutput, error) { + req, out := c.ListSubscriptionDefinitionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListTagsForResource +func (c *Greengrass) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { + op := &request.Operation{ + Name: opListTagsForResource, + HTTPMethod: "GET", + HTTPPath: "/tags/{resource-arn}", + } + + if input == nil { + input = &ListTagsForResourceInput{} + } + + output = &ListTagsForResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTagsForResource API operation for AWS Greengrass. +// +// Retrieves a list of resource tags for a resource 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 AWS Greengrass's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ListTagsForResource +func (c *Greengrass) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opResetDeployments = "ResetDeployments" + +// ResetDeploymentsRequest generates a "aws/request.Request" representing the +// client's request for the ResetDeployments operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ResetDeployments for more information on using the ResetDeployments +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ResetDeploymentsRequest method. +// req, resp := client.ResetDeploymentsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ResetDeployments +func (c *Greengrass) ResetDeploymentsRequest(input *ResetDeploymentsInput) (req *request.Request, output *ResetDeploymentsOutput) { + op := &request.Operation{ + Name: opResetDeployments, + HTTPMethod: "POST", + HTTPPath: "/greengrass/groups/{GroupId}/deployments/$reset", + } + + if input == nil { + input = &ResetDeploymentsInput{} + } + + output = &ResetDeploymentsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ResetDeployments API operation for AWS Greengrass. +// +// Resets a group's 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 Greengrass's +// API operation ResetDeployments for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/ResetDeployments +func (c *Greengrass) ResetDeployments(input *ResetDeploymentsInput) (*ResetDeploymentsOutput, error) { + req, out := c.ResetDeploymentsRequest(input) + return out, req.Send() +} + +// ResetDeploymentsWithContext is the same as ResetDeployments with the addition of +// the ability to pass a context and additional request options. +// +// See ResetDeployments for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) ResetDeploymentsWithContext(ctx aws.Context, input *ResetDeploymentsInput, opts ...request.Option) (*ResetDeploymentsOutput, error) { + req, out := c.ResetDeploymentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartBulkDeployment = "StartBulkDeployment" + +// StartBulkDeploymentRequest generates a "aws/request.Request" representing the +// client's request for the StartBulkDeployment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartBulkDeployment for more information on using the StartBulkDeployment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartBulkDeploymentRequest method. +// req, resp := client.StartBulkDeploymentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/StartBulkDeployment +func (c *Greengrass) StartBulkDeploymentRequest(input *StartBulkDeploymentInput) (req *request.Request, output *StartBulkDeploymentOutput) { + op := &request.Operation{ + Name: opStartBulkDeployment, + HTTPMethod: "POST", + HTTPPath: "/greengrass/bulk/deployments", + } + + if input == nil { + input = &StartBulkDeploymentInput{} + } + + output = &StartBulkDeploymentOutput{} + req = c.newRequest(op, input, output) + return +} + +// StartBulkDeployment API operation for AWS Greengrass. +// +// Deploys multiple groups in one operation. This action starts the bulk deployment +// of a specified set of group versions. Each group version deployment will +// be triggered with an adaptive rate that has a fixed upper limit. We recommend +// that you include an ''X-Amzn-Client-Token'' token in every ''StartBulkDeployment'' +// request. These requests are idempotent with respect to the token and the +// request 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 Greengrass's +// API operation StartBulkDeployment for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/StartBulkDeployment +func (c *Greengrass) StartBulkDeployment(input *StartBulkDeploymentInput) (*StartBulkDeploymentOutput, error) { + req, out := c.StartBulkDeploymentRequest(input) + return out, req.Send() +} + +// StartBulkDeploymentWithContext is the same as StartBulkDeployment with the addition of +// the ability to pass a context and additional request options. +// +// See StartBulkDeployment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) StartBulkDeploymentWithContext(ctx aws.Context, input *StartBulkDeploymentInput, opts ...request.Option) (*StartBulkDeploymentOutput, error) { + req, out := c.StartBulkDeploymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopBulkDeployment = "StopBulkDeployment" + +// StopBulkDeploymentRequest generates a "aws/request.Request" representing the +// client's request for the StopBulkDeployment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopBulkDeployment for more information on using the StopBulkDeployment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopBulkDeploymentRequest method. +// req, resp := client.StopBulkDeploymentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/StopBulkDeployment +func (c *Greengrass) StopBulkDeploymentRequest(input *StopBulkDeploymentInput) (req *request.Request, output *StopBulkDeploymentOutput) { + op := &request.Operation{ + Name: opStopBulkDeployment, + HTTPMethod: "PUT", + HTTPPath: "/greengrass/bulk/deployments/{BulkDeploymentId}/$stop", + } + + if input == nil { + input = &StopBulkDeploymentInput{} + } + + output = &StopBulkDeploymentOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StopBulkDeployment API operation for AWS Greengrass. +// +// Stops the execution of a bulk deployment. This action returns a status of +// ''Stopping'' until the deployment is stopped. You cannot start a new bulk +// deployment while a previous deployment is in the ''Stopping'' state. This +// action doesn't rollback completed deployments or cancel pending 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 Greengrass's +// API operation StopBulkDeployment for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/StopBulkDeployment +func (c *Greengrass) StopBulkDeployment(input *StopBulkDeploymentInput) (*StopBulkDeploymentOutput, error) { + req, out := c.StopBulkDeploymentRequest(input) + return out, req.Send() +} + +// StopBulkDeploymentWithContext is the same as StopBulkDeployment with the addition of +// the ability to pass a context and additional request options. +// +// See StopBulkDeployment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) StopBulkDeploymentWithContext(ctx aws.Context, input *StopBulkDeploymentInput, opts ...request.Option) (*StopBulkDeploymentOutput, error) { + req, out := c.StopBulkDeploymentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/TagResource +func (c *Greengrass) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { + op := &request.Operation{ + Name: opTagResource, + HTTPMethod: "POST", + HTTPPath: "/tags/{resource-arn}", + } + + if input == nil { + input = &TagResourceInput{} + } + + output = &TagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for AWS Greengrass. +// +// Adds tags to a Greengrass resource. Valid resources are 'Group', 'ConnectorDefinition', +// 'CoreDefinition', 'DeviceDefinition', 'FunctionDefinition', 'LoggerDefinition', +// 'SubscriptionDefinition', 'ResourceDefinition', and 'BulkDeployment'. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation TagResource for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/TagResource +func (c *Greengrass) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UntagResource +func (c *Greengrass) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { + op := &request.Operation{ + Name: opUntagResource, + HTTPMethod: "DELETE", + HTTPPath: "/tags/{resource-arn}", + } + + if input == nil { + input = &UntagResourceInput{} + } + + output = &UntagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for AWS Greengrass. +// +// Remove resource tags from a Greengrass 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 Greengrass's +// API operation UntagResource for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UntagResource +func (c *Greengrass) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateConnectivityInfo = "UpdateConnectivityInfo" + +// UpdateConnectivityInfoRequest generates a "aws/request.Request" representing the +// client's request for the UpdateConnectivityInfo operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateConnectivityInfo for more information on using the UpdateConnectivityInfo +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateConnectivityInfoRequest method. +// req, resp := client.UpdateConnectivityInfoRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateConnectivityInfo +func (c *Greengrass) UpdateConnectivityInfoRequest(input *UpdateConnectivityInfoInput) (req *request.Request, output *UpdateConnectivityInfoOutput) { + op := &request.Operation{ + Name: opUpdateConnectivityInfo, + HTTPMethod: "PUT", + HTTPPath: "/greengrass/things/{ThingName}/connectivityInfo", + } + + if input == nil { + input = &UpdateConnectivityInfoInput{} + } + + output = &UpdateConnectivityInfoOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateConnectivityInfo API operation for AWS Greengrass. +// +// Updates the connectivity information for the core. Any devices that belong +// to the group which has this core will receive this information in order to +// find the location of the core and connect 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 AWS Greengrass's +// API operation UpdateConnectivityInfo for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// * InternalServerErrorException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateConnectivityInfo +func (c *Greengrass) UpdateConnectivityInfo(input *UpdateConnectivityInfoInput) (*UpdateConnectivityInfoOutput, error) { + req, out := c.UpdateConnectivityInfoRequest(input) + return out, req.Send() +} + +// UpdateConnectivityInfoWithContext is the same as UpdateConnectivityInfo with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateConnectivityInfo for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) UpdateConnectivityInfoWithContext(ctx aws.Context, input *UpdateConnectivityInfoInput, opts ...request.Option) (*UpdateConnectivityInfoOutput, error) { + req, out := c.UpdateConnectivityInfoRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateConnectorDefinition = "UpdateConnectorDefinition" + +// UpdateConnectorDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateConnectorDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateConnectorDefinition for more information on using the UpdateConnectorDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateConnectorDefinitionRequest method. +// req, resp := client.UpdateConnectorDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateConnectorDefinition +func (c *Greengrass) UpdateConnectorDefinitionRequest(input *UpdateConnectorDefinitionInput) (req *request.Request, output *UpdateConnectorDefinitionOutput) { + op := &request.Operation{ + Name: opUpdateConnectorDefinition, + HTTPMethod: "PUT", + HTTPPath: "/greengrass/definition/connectors/{ConnectorDefinitionId}", + } + + if input == nil { + input = &UpdateConnectorDefinitionInput{} + } + + output = &UpdateConnectorDefinitionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateConnectorDefinition API operation for AWS Greengrass. +// +// Updates a connector definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation UpdateConnectorDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateConnectorDefinition +func (c *Greengrass) UpdateConnectorDefinition(input *UpdateConnectorDefinitionInput) (*UpdateConnectorDefinitionOutput, error) { + req, out := c.UpdateConnectorDefinitionRequest(input) + return out, req.Send() +} + +// UpdateConnectorDefinitionWithContext is the same as UpdateConnectorDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateConnectorDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) UpdateConnectorDefinitionWithContext(ctx aws.Context, input *UpdateConnectorDefinitionInput, opts ...request.Option) (*UpdateConnectorDefinitionOutput, error) { + req, out := c.UpdateConnectorDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateCoreDefinition = "UpdateCoreDefinition" + +// UpdateCoreDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateCoreDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateCoreDefinition for more information on using the UpdateCoreDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateCoreDefinitionRequest method. +// req, resp := client.UpdateCoreDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateCoreDefinition +func (c *Greengrass) UpdateCoreDefinitionRequest(input *UpdateCoreDefinitionInput) (req *request.Request, output *UpdateCoreDefinitionOutput) { + op := &request.Operation{ + Name: opUpdateCoreDefinition, + HTTPMethod: "PUT", + HTTPPath: "/greengrass/definition/cores/{CoreDefinitionId}", + } + + if input == nil { + input = &UpdateCoreDefinitionInput{} + } + + output = &UpdateCoreDefinitionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateCoreDefinition API operation for AWS Greengrass. +// +// Updates a core definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation UpdateCoreDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateCoreDefinition +func (c *Greengrass) UpdateCoreDefinition(input *UpdateCoreDefinitionInput) (*UpdateCoreDefinitionOutput, error) { + req, out := c.UpdateCoreDefinitionRequest(input) + return out, req.Send() +} + +// UpdateCoreDefinitionWithContext is the same as UpdateCoreDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateCoreDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) UpdateCoreDefinitionWithContext(ctx aws.Context, input *UpdateCoreDefinitionInput, opts ...request.Option) (*UpdateCoreDefinitionOutput, error) { + req, out := c.UpdateCoreDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateDeviceDefinition = "UpdateDeviceDefinition" + +// UpdateDeviceDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDeviceDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateDeviceDefinition for more information on using the UpdateDeviceDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateDeviceDefinitionRequest method. +// req, resp := client.UpdateDeviceDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateDeviceDefinition +func (c *Greengrass) UpdateDeviceDefinitionRequest(input *UpdateDeviceDefinitionInput) (req *request.Request, output *UpdateDeviceDefinitionOutput) { + op := &request.Operation{ + Name: opUpdateDeviceDefinition, + HTTPMethod: "PUT", + HTTPPath: "/greengrass/definition/devices/{DeviceDefinitionId}", + } + + if input == nil { + input = &UpdateDeviceDefinitionInput{} + } + + output = &UpdateDeviceDefinitionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateDeviceDefinition API operation for AWS Greengrass. +// +// Updates a device definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation UpdateDeviceDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateDeviceDefinition +func (c *Greengrass) UpdateDeviceDefinition(input *UpdateDeviceDefinitionInput) (*UpdateDeviceDefinitionOutput, error) { + req, out := c.UpdateDeviceDefinitionRequest(input) + return out, req.Send() +} + +// UpdateDeviceDefinitionWithContext is the same as UpdateDeviceDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDeviceDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) UpdateDeviceDefinitionWithContext(ctx aws.Context, input *UpdateDeviceDefinitionInput, opts ...request.Option) (*UpdateDeviceDefinitionOutput, error) { + req, out := c.UpdateDeviceDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateFunctionDefinition = "UpdateFunctionDefinition" + +// UpdateFunctionDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateFunctionDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateFunctionDefinition for more information on using the UpdateFunctionDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateFunctionDefinitionRequest method. +// req, resp := client.UpdateFunctionDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateFunctionDefinition +func (c *Greengrass) UpdateFunctionDefinitionRequest(input *UpdateFunctionDefinitionInput) (req *request.Request, output *UpdateFunctionDefinitionOutput) { + op := &request.Operation{ + Name: opUpdateFunctionDefinition, + HTTPMethod: "PUT", + HTTPPath: "/greengrass/definition/functions/{FunctionDefinitionId}", + } + + if input == nil { + input = &UpdateFunctionDefinitionInput{} + } + + output = &UpdateFunctionDefinitionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateFunctionDefinition API operation for AWS Greengrass. +// +// Updates a Lambda function definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation UpdateFunctionDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateFunctionDefinition +func (c *Greengrass) UpdateFunctionDefinition(input *UpdateFunctionDefinitionInput) (*UpdateFunctionDefinitionOutput, error) { + req, out := c.UpdateFunctionDefinitionRequest(input) + return out, req.Send() +} + +// UpdateFunctionDefinitionWithContext is the same as UpdateFunctionDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateFunctionDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) UpdateFunctionDefinitionWithContext(ctx aws.Context, input *UpdateFunctionDefinitionInput, opts ...request.Option) (*UpdateFunctionDefinitionOutput, error) { + req, out := c.UpdateFunctionDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateGroup = "UpdateGroup" + +// UpdateGroupRequest generates a "aws/request.Request" representing the +// client's request for the UpdateGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateGroup for more information on using the UpdateGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateGroupRequest method. +// req, resp := client.UpdateGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateGroup +func (c *Greengrass) UpdateGroupRequest(input *UpdateGroupInput) (req *request.Request, output *UpdateGroupOutput) { + op := &request.Operation{ + Name: opUpdateGroup, + HTTPMethod: "PUT", + HTTPPath: "/greengrass/groups/{GroupId}", + } + + if input == nil { + input = &UpdateGroupInput{} + } + + output = &UpdateGroupOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateGroup API operation for AWS Greengrass. +// +// Updates a 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 Greengrass's +// API operation UpdateGroup for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateGroup +func (c *Greengrass) UpdateGroup(input *UpdateGroupInput) (*UpdateGroupOutput, error) { + req, out := c.UpdateGroupRequest(input) + return out, req.Send() +} + +// UpdateGroupWithContext is the same as UpdateGroup with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) UpdateGroupWithContext(ctx aws.Context, input *UpdateGroupInput, opts ...request.Option) (*UpdateGroupOutput, error) { + req, out := c.UpdateGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateGroupCertificateConfiguration = "UpdateGroupCertificateConfiguration" + +// UpdateGroupCertificateConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the UpdateGroupCertificateConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateGroupCertificateConfiguration for more information on using the UpdateGroupCertificateConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateGroupCertificateConfigurationRequest method. +// req, resp := client.UpdateGroupCertificateConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateGroupCertificateConfiguration +func (c *Greengrass) UpdateGroupCertificateConfigurationRequest(input *UpdateGroupCertificateConfigurationInput) (req *request.Request, output *UpdateGroupCertificateConfigurationOutput) { + op := &request.Operation{ + Name: opUpdateGroupCertificateConfiguration, + HTTPMethod: "PUT", + HTTPPath: "/greengrass/groups/{GroupId}/certificateauthorities/configuration/expiry", + } + + if input == nil { + input = &UpdateGroupCertificateConfigurationInput{} + } + + output = &UpdateGroupCertificateConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateGroupCertificateConfiguration API operation for AWS Greengrass. +// +// Updates the Certificate expiry time for a 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 Greengrass's +// API operation UpdateGroupCertificateConfiguration for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// * InternalServerErrorException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateGroupCertificateConfiguration +func (c *Greengrass) UpdateGroupCertificateConfiguration(input *UpdateGroupCertificateConfigurationInput) (*UpdateGroupCertificateConfigurationOutput, error) { + req, out := c.UpdateGroupCertificateConfigurationRequest(input) + return out, req.Send() +} + +// UpdateGroupCertificateConfigurationWithContext is the same as UpdateGroupCertificateConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateGroupCertificateConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) UpdateGroupCertificateConfigurationWithContext(ctx aws.Context, input *UpdateGroupCertificateConfigurationInput, opts ...request.Option) (*UpdateGroupCertificateConfigurationOutput, error) { + req, out := c.UpdateGroupCertificateConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateLoggerDefinition = "UpdateLoggerDefinition" + +// UpdateLoggerDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateLoggerDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateLoggerDefinition for more information on using the UpdateLoggerDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateLoggerDefinitionRequest method. +// req, resp := client.UpdateLoggerDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateLoggerDefinition +func (c *Greengrass) UpdateLoggerDefinitionRequest(input *UpdateLoggerDefinitionInput) (req *request.Request, output *UpdateLoggerDefinitionOutput) { + op := &request.Operation{ + Name: opUpdateLoggerDefinition, + HTTPMethod: "PUT", + HTTPPath: "/greengrass/definition/loggers/{LoggerDefinitionId}", + } + + if input == nil { + input = &UpdateLoggerDefinitionInput{} + } + + output = &UpdateLoggerDefinitionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateLoggerDefinition API operation for AWS Greengrass. +// +// Updates a logger definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation UpdateLoggerDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateLoggerDefinition +func (c *Greengrass) UpdateLoggerDefinition(input *UpdateLoggerDefinitionInput) (*UpdateLoggerDefinitionOutput, error) { + req, out := c.UpdateLoggerDefinitionRequest(input) + return out, req.Send() +} + +// UpdateLoggerDefinitionWithContext is the same as UpdateLoggerDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateLoggerDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) UpdateLoggerDefinitionWithContext(ctx aws.Context, input *UpdateLoggerDefinitionInput, opts ...request.Option) (*UpdateLoggerDefinitionOutput, error) { + req, out := c.UpdateLoggerDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateResourceDefinition = "UpdateResourceDefinition" + +// UpdateResourceDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateResourceDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateResourceDefinition for more information on using the UpdateResourceDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateResourceDefinitionRequest method. +// req, resp := client.UpdateResourceDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateResourceDefinition +func (c *Greengrass) UpdateResourceDefinitionRequest(input *UpdateResourceDefinitionInput) (req *request.Request, output *UpdateResourceDefinitionOutput) { + op := &request.Operation{ + Name: opUpdateResourceDefinition, + HTTPMethod: "PUT", + HTTPPath: "/greengrass/definition/resources/{ResourceDefinitionId}", + } + + if input == nil { + input = &UpdateResourceDefinitionInput{} + } + + output = &UpdateResourceDefinitionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateResourceDefinition API operation for AWS Greengrass. +// +// Updates a resource definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation UpdateResourceDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateResourceDefinition +func (c *Greengrass) UpdateResourceDefinition(input *UpdateResourceDefinitionInput) (*UpdateResourceDefinitionOutput, error) { + req, out := c.UpdateResourceDefinitionRequest(input) + return out, req.Send() +} + +// UpdateResourceDefinitionWithContext is the same as UpdateResourceDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateResourceDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) UpdateResourceDefinitionWithContext(ctx aws.Context, input *UpdateResourceDefinitionInput, opts ...request.Option) (*UpdateResourceDefinitionOutput, error) { + req, out := c.UpdateResourceDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateSubscriptionDefinition = "UpdateSubscriptionDefinition" + +// UpdateSubscriptionDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateSubscriptionDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateSubscriptionDefinition for more information on using the UpdateSubscriptionDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateSubscriptionDefinitionRequest method. +// req, resp := client.UpdateSubscriptionDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateSubscriptionDefinition +func (c *Greengrass) UpdateSubscriptionDefinitionRequest(input *UpdateSubscriptionDefinitionInput) (req *request.Request, output *UpdateSubscriptionDefinitionOutput) { + op := &request.Operation{ + Name: opUpdateSubscriptionDefinition, + HTTPMethod: "PUT", + HTTPPath: "/greengrass/definition/subscriptions/{SubscriptionDefinitionId}", + } + + if input == nil { + input = &UpdateSubscriptionDefinitionInput{} + } + + output = &UpdateSubscriptionDefinitionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateSubscriptionDefinition API operation for AWS Greengrass. +// +// Updates a subscription definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Greengrass's +// API operation UpdateSubscriptionDefinition for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// General error information. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07/UpdateSubscriptionDefinition +func (c *Greengrass) UpdateSubscriptionDefinition(input *UpdateSubscriptionDefinitionInput) (*UpdateSubscriptionDefinitionOutput, error) { + req, out := c.UpdateSubscriptionDefinitionRequest(input) + return out, req.Send() +} + +// UpdateSubscriptionDefinitionWithContext is the same as UpdateSubscriptionDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSubscriptionDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Greengrass) UpdateSubscriptionDefinitionWithContext(ctx aws.Context, input *UpdateSubscriptionDefinitionInput, opts ...request.Option) (*UpdateSubscriptionDefinitionOutput, error) { + req, out := c.UpdateSubscriptionDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +type AssociateRoleToGroupInput struct { + _ struct{} `type:"structure"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` + + // The ARN of the role you wish to associate with this group. The existence + // of the role is not validated. + // + // RoleArn is a required field + RoleArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AssociateRoleToGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateRoleToGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssociateRoleToGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssociateRoleToGroupInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *AssociateRoleToGroupInput) SetGroupId(v string) *AssociateRoleToGroupInput { + s.GroupId = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *AssociateRoleToGroupInput) SetRoleArn(v string) *AssociateRoleToGroupInput { + s.RoleArn = &v + return s +} + +type AssociateRoleToGroupOutput struct { + _ struct{} `type:"structure"` + + // The time, in milliseconds since the epoch, when the role ARN was associated + // with the group. + AssociatedAt *string `type:"string"` +} + +// String returns the string representation +func (s AssociateRoleToGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateRoleToGroupOutput) GoString() string { + return s.String() +} + +// SetAssociatedAt sets the AssociatedAt field's value. +func (s *AssociateRoleToGroupOutput) SetAssociatedAt(v string) *AssociateRoleToGroupOutput { + s.AssociatedAt = &v + return s +} + +type AssociateServiceRoleToAccountInput struct { + _ struct{} `type:"structure"` + + // The ARN of the service role you wish to associate with your account. + // + // RoleArn is a required field + RoleArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AssociateServiceRoleToAccountInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateServiceRoleToAccountInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssociateServiceRoleToAccountInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssociateServiceRoleToAccountInput"} + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRoleArn sets the RoleArn field's value. +func (s *AssociateServiceRoleToAccountInput) SetRoleArn(v string) *AssociateServiceRoleToAccountInput { + s.RoleArn = &v + return s +} + +type AssociateServiceRoleToAccountOutput struct { + _ struct{} `type:"structure"` + + // The time when the service role was associated with the account. + AssociatedAt *string `type:"string"` +} + +// String returns the string representation +func (s AssociateServiceRoleToAccountOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateServiceRoleToAccountOutput) GoString() string { + return s.String() +} + +// SetAssociatedAt sets the AssociatedAt field's value. +func (s *AssociateServiceRoleToAccountOutput) SetAssociatedAt(v string) *AssociateServiceRoleToAccountOutput { + s.AssociatedAt = &v + return s +} + +// General error information. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A list of error details. + ErrorDetails []*ErrorDetail `type:"list"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about a bulk deployment. You cannot start a new bulk deployment +// while another one is still running or in a non-terminal state. +type BulkDeployment struct { + _ struct{} `type:"structure"` + + // The ARN of the bulk deployment. + BulkDeploymentArn *string `type:"string"` + + // The ID of the bulk deployment. + BulkDeploymentId *string `type:"string"` + + // The time, in ISO format, when the deployment was created. + CreatedAt *string `type:"string"` +} + +// String returns the string representation +func (s BulkDeployment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BulkDeployment) GoString() string { + return s.String() +} + +// SetBulkDeploymentArn sets the BulkDeploymentArn field's value. +func (s *BulkDeployment) SetBulkDeploymentArn(v string) *BulkDeployment { + s.BulkDeploymentArn = &v + return s +} + +// SetBulkDeploymentId sets the BulkDeploymentId field's value. +func (s *BulkDeployment) SetBulkDeploymentId(v string) *BulkDeployment { + s.BulkDeploymentId = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *BulkDeployment) SetCreatedAt(v string) *BulkDeployment { + s.CreatedAt = &v + return s +} + +// Relevant metrics on input records processed during bulk deployment. +type BulkDeploymentMetrics struct { + _ struct{} `type:"structure"` + + // The total number of records that returned a non-retryable error. For example, + // this can occur if a group record from the input file uses an invalid format + // or specifies a nonexistent group version, or if the execution role doesn't + // grant permission to deploy a group or group version. + InvalidInputRecords *int64 `type:"integer"` + + // The total number of group records from the input file that have been processed + // so far, or attempted. + RecordsProcessed *int64 `type:"integer"` + + // The total number of deployment attempts that returned a retryable error. + // For example, a retry is triggered if the attempt to deploy a group returns + // a throttling error. ''StartBulkDeployment'' retries a group deployment up + // to five times. + RetryAttempts *int64 `type:"integer"` +} + +// String returns the string representation +func (s BulkDeploymentMetrics) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BulkDeploymentMetrics) GoString() string { + return s.String() +} + +// SetInvalidInputRecords sets the InvalidInputRecords field's value. +func (s *BulkDeploymentMetrics) SetInvalidInputRecords(v int64) *BulkDeploymentMetrics { + s.InvalidInputRecords = &v + return s +} + +// SetRecordsProcessed sets the RecordsProcessed field's value. +func (s *BulkDeploymentMetrics) SetRecordsProcessed(v int64) *BulkDeploymentMetrics { + s.RecordsProcessed = &v + return s +} + +// SetRetryAttempts sets the RetryAttempts field's value. +func (s *BulkDeploymentMetrics) SetRetryAttempts(v int64) *BulkDeploymentMetrics { + s.RetryAttempts = &v + return s +} + +// Information about an individual group deployment in a bulk deployment operation. +type BulkDeploymentResult struct { + _ struct{} `type:"structure"` + + // The time, in ISO format, when the deployment was created. + CreatedAt *string `type:"string"` + + // The ARN of the group deployment. + DeploymentArn *string `type:"string"` + + // The ID of the group deployment. + DeploymentId *string `type:"string"` + + // The current status of the group deployment: ''InProgress'', ''Building'', + // ''Success'', or ''Failure''. + DeploymentStatus *string `type:"string"` + + // The type of the deployment. + DeploymentType *string `type:"string" enum:"DeploymentType"` + + // Details about the error. + ErrorDetails []*ErrorDetail `type:"list"` + + // The error message for a failed deployment + ErrorMessage *string `type:"string"` + + // The ARN of the Greengrass group. + GroupArn *string `type:"string"` +} + +// String returns the string representation +func (s BulkDeploymentResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BulkDeploymentResult) GoString() string { + return s.String() +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *BulkDeploymentResult) SetCreatedAt(v string) *BulkDeploymentResult { + s.CreatedAt = &v + return s +} + +// SetDeploymentArn sets the DeploymentArn field's value. +func (s *BulkDeploymentResult) SetDeploymentArn(v string) *BulkDeploymentResult { + s.DeploymentArn = &v + return s +} + +// SetDeploymentId sets the DeploymentId field's value. +func (s *BulkDeploymentResult) SetDeploymentId(v string) *BulkDeploymentResult { + s.DeploymentId = &v + return s +} + +// SetDeploymentStatus sets the DeploymentStatus field's value. +func (s *BulkDeploymentResult) SetDeploymentStatus(v string) *BulkDeploymentResult { + s.DeploymentStatus = &v + return s +} + +// SetDeploymentType sets the DeploymentType field's value. +func (s *BulkDeploymentResult) SetDeploymentType(v string) *BulkDeploymentResult { + s.DeploymentType = &v + return s +} + +// SetErrorDetails sets the ErrorDetails field's value. +func (s *BulkDeploymentResult) SetErrorDetails(v []*ErrorDetail) *BulkDeploymentResult { + s.ErrorDetails = v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *BulkDeploymentResult) SetErrorMessage(v string) *BulkDeploymentResult { + s.ErrorMessage = &v + return s +} + +// SetGroupArn sets the GroupArn field's value. +func (s *BulkDeploymentResult) SetGroupArn(v string) *BulkDeploymentResult { + s.GroupArn = &v + return s +} + +// Information about a Greengrass core's connectivity. +type ConnectivityInfo struct { + _ struct{} `type:"structure"` + + // The endpoint for the Greengrass core. Can be an IP address or DNS. + HostAddress *string `type:"string"` + + // The ID of the connectivity information. + Id *string `type:"string"` + + // Metadata for this endpoint. + Metadata *string `type:"string"` + + // The port of the Greengrass core. Usually 8883. + PortNumber *int64 `type:"integer"` +} + +// String returns the string representation +func (s ConnectivityInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectivityInfo) GoString() string { + return s.String() +} + +// SetHostAddress sets the HostAddress field's value. +func (s *ConnectivityInfo) SetHostAddress(v string) *ConnectivityInfo { + s.HostAddress = &v + return s +} + +// SetId sets the Id field's value. +func (s *ConnectivityInfo) SetId(v string) *ConnectivityInfo { + s.Id = &v + return s +} + +// SetMetadata sets the Metadata field's value. +func (s *ConnectivityInfo) SetMetadata(v string) *ConnectivityInfo { + s.Metadata = &v + return s +} + +// SetPortNumber sets the PortNumber field's value. +func (s *ConnectivityInfo) SetPortNumber(v int64) *ConnectivityInfo { + s.PortNumber = &v + return s +} + +// Information about a connector. Connectors run on the Greengrass core and +// contain built-in integration with local infrastructure, device protocols, +// AWS, and other cloud services. +type Connector struct { + _ struct{} `type:"structure"` + + // The ARN of the connector. + // + // ConnectorArn is a required field + ConnectorArn *string `type:"string" required:"true"` + + // A descriptive or arbitrary ID for the connector. This value must be unique + // within the connector definition version. Max length is 128 characters with + // pattern [a-zA-Z0-9:_-]+. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // The parameters or configuration that the connector uses. + Parameters map[string]*string `type:"map"` +} + +// String returns the string representation +func (s Connector) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Connector) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Connector) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Connector"} + if s.ConnectorArn == nil { + invalidParams.Add(request.NewErrParamRequired("ConnectorArn")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConnectorArn sets the ConnectorArn field's value. +func (s *Connector) SetConnectorArn(v string) *Connector { + s.ConnectorArn = &v + return s +} + +// SetId sets the Id field's value. +func (s *Connector) SetId(v string) *Connector { + s.Id = &v + return s +} + +// SetParameters sets the Parameters field's value. +func (s *Connector) SetParameters(v map[string]*string) *Connector { + s.Parameters = v + return s +} + +// Information about the connector definition version, which is a container +// for connectors. +type ConnectorDefinitionVersion struct { + _ struct{} `type:"structure"` + + // A list of references to connectors in this version, with their corresponding + // configuration settings. + Connectors []*Connector `type:"list"` +} + +// String returns the string representation +func (s ConnectorDefinitionVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectorDefinitionVersion) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ConnectorDefinitionVersion) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConnectorDefinitionVersion"} + if s.Connectors != nil { + for i, v := range s.Connectors { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Connectors", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConnectors sets the Connectors field's value. +func (s *ConnectorDefinitionVersion) SetConnectors(v []*Connector) *ConnectorDefinitionVersion { + s.Connectors = v + return s +} + +// Information about a core. +type Core struct { + _ struct{} `type:"structure"` + + // The ARN of the certificate associated with the core. + // + // CertificateArn is a required field + CertificateArn *string `type:"string" required:"true"` + + // A descriptive or arbitrary ID for the core. This value must be unique within + // the core definition version. Max length is 128 characters with pattern ''[a-zA-Z0-9:_-]+''. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // If true, the core's local shadow is automatically synced with the cloud. + SyncShadow *bool `type:"boolean"` + + // The ARN of the thing which is the core. + // + // ThingArn is a required field + ThingArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s Core) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Core) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Core) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Core"} + if s.CertificateArn == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateArn")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.ThingArn == nil { + invalidParams.Add(request.NewErrParamRequired("ThingArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCertificateArn sets the CertificateArn field's value. +func (s *Core) SetCertificateArn(v string) *Core { + s.CertificateArn = &v + return s +} + +// SetId sets the Id field's value. +func (s *Core) SetId(v string) *Core { + s.Id = &v + return s +} + +// SetSyncShadow sets the SyncShadow field's value. +func (s *Core) SetSyncShadow(v bool) *Core { + s.SyncShadow = &v + return s +} + +// SetThingArn sets the ThingArn field's value. +func (s *Core) SetThingArn(v string) *Core { + s.ThingArn = &v + return s +} + +// Information about a core definition version. +type CoreDefinitionVersion struct { + _ struct{} `type:"structure"` + + // A list of cores in the core definition version. + Cores []*Core `type:"list"` +} + +// String returns the string representation +func (s CoreDefinitionVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CoreDefinitionVersion) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CoreDefinitionVersion) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CoreDefinitionVersion"} + if s.Cores != nil { + for i, v := range s.Cores { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Cores", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCores sets the Cores field's value. +func (s *CoreDefinitionVersion) SetCores(v []*Core) *CoreDefinitionVersion { + s.Cores = v + return s +} + +type CreateConnectorDefinitionInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // Information about the connector definition version, which is a container + // for connectors. + InitialVersion *ConnectorDefinitionVersion `type:"structure"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s CreateConnectorDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateConnectorDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateConnectorDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateConnectorDefinitionInput"} + if s.InitialVersion != nil { + if err := s.InitialVersion.Validate(); err != nil { + invalidParams.AddNested("InitialVersion", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateConnectorDefinitionInput) SetAmznClientToken(v string) *CreateConnectorDefinitionInput { + s.AmznClientToken = &v + return s +} + +// SetInitialVersion sets the InitialVersion field's value. +func (s *CreateConnectorDefinitionInput) SetInitialVersion(v *ConnectorDefinitionVersion) *CreateConnectorDefinitionInput { + s.InitialVersion = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateConnectorDefinitionInput) SetName(v string) *CreateConnectorDefinitionInput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateConnectorDefinitionInput) SetTags(v map[string]*string) *CreateConnectorDefinitionInput { + s.Tags = v + return s +} + +type CreateConnectorDefinitionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` +} + +// String returns the string representation +func (s CreateConnectorDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateConnectorDefinitionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateConnectorDefinitionOutput) SetArn(v string) *CreateConnectorDefinitionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateConnectorDefinitionOutput) SetCreationTimestamp(v string) *CreateConnectorDefinitionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateConnectorDefinitionOutput) SetId(v string) *CreateConnectorDefinitionOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *CreateConnectorDefinitionOutput) SetLastUpdatedTimestamp(v string) *CreateConnectorDefinitionOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *CreateConnectorDefinitionOutput) SetLatestVersion(v string) *CreateConnectorDefinitionOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *CreateConnectorDefinitionOutput) SetLatestVersionArn(v string) *CreateConnectorDefinitionOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateConnectorDefinitionOutput) SetName(v string) *CreateConnectorDefinitionOutput { + s.Name = &v + return s +} + +type CreateConnectorDefinitionVersionInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // ConnectorDefinitionId is a required field + ConnectorDefinitionId *string `location:"uri" locationName:"ConnectorDefinitionId" type:"string" required:"true"` + + Connectors []*Connector `type:"list"` +} + +// String returns the string representation +func (s CreateConnectorDefinitionVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateConnectorDefinitionVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateConnectorDefinitionVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateConnectorDefinitionVersionInput"} + if s.ConnectorDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("ConnectorDefinitionId")) + } + if s.ConnectorDefinitionId != nil && len(*s.ConnectorDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConnectorDefinitionId", 1)) + } + if s.Connectors != nil { + for i, v := range s.Connectors { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Connectors", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateConnectorDefinitionVersionInput) SetAmznClientToken(v string) *CreateConnectorDefinitionVersionInput { + s.AmznClientToken = &v + return s +} + +// SetConnectorDefinitionId sets the ConnectorDefinitionId field's value. +func (s *CreateConnectorDefinitionVersionInput) SetConnectorDefinitionId(v string) *CreateConnectorDefinitionVersionInput { + s.ConnectorDefinitionId = &v + return s +} + +// SetConnectors sets the Connectors field's value. +func (s *CreateConnectorDefinitionVersionInput) SetConnectors(v []*Connector) *CreateConnectorDefinitionVersionInput { + s.Connectors = v + return s +} + +type CreateConnectorDefinitionVersionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + Version *string `type:"string"` +} + +// String returns the string representation +func (s CreateConnectorDefinitionVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateConnectorDefinitionVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateConnectorDefinitionVersionOutput) SetArn(v string) *CreateConnectorDefinitionVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateConnectorDefinitionVersionOutput) SetCreationTimestamp(v string) *CreateConnectorDefinitionVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateConnectorDefinitionVersionOutput) SetId(v string) *CreateConnectorDefinitionVersionOutput { + s.Id = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *CreateConnectorDefinitionVersionOutput) SetVersion(v string) *CreateConnectorDefinitionVersionOutput { + s.Version = &v + return s +} + +type CreateCoreDefinitionInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // Information about a core definition version. + InitialVersion *CoreDefinitionVersion `type:"structure"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s CreateCoreDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCoreDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateCoreDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateCoreDefinitionInput"} + if s.InitialVersion != nil { + if err := s.InitialVersion.Validate(); err != nil { + invalidParams.AddNested("InitialVersion", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateCoreDefinitionInput) SetAmznClientToken(v string) *CreateCoreDefinitionInput { + s.AmznClientToken = &v + return s +} + +// SetInitialVersion sets the InitialVersion field's value. +func (s *CreateCoreDefinitionInput) SetInitialVersion(v *CoreDefinitionVersion) *CreateCoreDefinitionInput { + s.InitialVersion = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateCoreDefinitionInput) SetName(v string) *CreateCoreDefinitionInput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateCoreDefinitionInput) SetTags(v map[string]*string) *CreateCoreDefinitionInput { + s.Tags = v + return s +} + +type CreateCoreDefinitionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` +} + +// String returns the string representation +func (s CreateCoreDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCoreDefinitionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateCoreDefinitionOutput) SetArn(v string) *CreateCoreDefinitionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateCoreDefinitionOutput) SetCreationTimestamp(v string) *CreateCoreDefinitionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateCoreDefinitionOutput) SetId(v string) *CreateCoreDefinitionOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *CreateCoreDefinitionOutput) SetLastUpdatedTimestamp(v string) *CreateCoreDefinitionOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *CreateCoreDefinitionOutput) SetLatestVersion(v string) *CreateCoreDefinitionOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *CreateCoreDefinitionOutput) SetLatestVersionArn(v string) *CreateCoreDefinitionOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateCoreDefinitionOutput) SetName(v string) *CreateCoreDefinitionOutput { + s.Name = &v + return s +} + +type CreateCoreDefinitionVersionInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // CoreDefinitionId is a required field + CoreDefinitionId *string `location:"uri" locationName:"CoreDefinitionId" type:"string" required:"true"` + + Cores []*Core `type:"list"` +} + +// String returns the string representation +func (s CreateCoreDefinitionVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCoreDefinitionVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateCoreDefinitionVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateCoreDefinitionVersionInput"} + if s.CoreDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("CoreDefinitionId")) + } + if s.CoreDefinitionId != nil && len(*s.CoreDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CoreDefinitionId", 1)) + } + if s.Cores != nil { + for i, v := range s.Cores { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Cores", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateCoreDefinitionVersionInput) SetAmznClientToken(v string) *CreateCoreDefinitionVersionInput { + s.AmznClientToken = &v + return s +} + +// SetCoreDefinitionId sets the CoreDefinitionId field's value. +func (s *CreateCoreDefinitionVersionInput) SetCoreDefinitionId(v string) *CreateCoreDefinitionVersionInput { + s.CoreDefinitionId = &v + return s +} + +// SetCores sets the Cores field's value. +func (s *CreateCoreDefinitionVersionInput) SetCores(v []*Core) *CreateCoreDefinitionVersionInput { + s.Cores = v + return s +} + +type CreateCoreDefinitionVersionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + Version *string `type:"string"` +} + +// String returns the string representation +func (s CreateCoreDefinitionVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCoreDefinitionVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateCoreDefinitionVersionOutput) SetArn(v string) *CreateCoreDefinitionVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateCoreDefinitionVersionOutput) SetCreationTimestamp(v string) *CreateCoreDefinitionVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateCoreDefinitionVersionOutput) SetId(v string) *CreateCoreDefinitionVersionOutput { + s.Id = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *CreateCoreDefinitionVersionOutput) SetVersion(v string) *CreateCoreDefinitionVersionOutput { + s.Version = &v + return s +} + +// Information about a deployment. +type CreateDeploymentInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // The ID of the deployment if you wish to redeploy a previous deployment. + DeploymentId *string `type:"string"` + + // The type of deployment. When used for ''CreateDeployment'', only ''NewDeployment'' + // and ''Redeployment'' are valid. + // + // DeploymentType is a required field + DeploymentType *string `type:"string" required:"true" enum:"DeploymentType"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` + + // The ID of the group version to be deployed. + GroupVersionId *string `type:"string"` +} + +// 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.DeploymentType == nil { + invalidParams.Add(request.NewErrParamRequired("DeploymentType")) + } + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateDeploymentInput) SetAmznClientToken(v string) *CreateDeploymentInput { + s.AmznClientToken = &v + return s +} + +// SetDeploymentId sets the DeploymentId field's value. +func (s *CreateDeploymentInput) SetDeploymentId(v string) *CreateDeploymentInput { + s.DeploymentId = &v + return s +} + +// SetDeploymentType sets the DeploymentType field's value. +func (s *CreateDeploymentInput) SetDeploymentType(v string) *CreateDeploymentInput { + s.DeploymentType = &v + return s +} + +// SetGroupId sets the GroupId field's value. +func (s *CreateDeploymentInput) SetGroupId(v string) *CreateDeploymentInput { + s.GroupId = &v + return s +} + +// SetGroupVersionId sets the GroupVersionId field's value. +func (s *CreateDeploymentInput) SetGroupVersionId(v string) *CreateDeploymentInput { + s.GroupVersionId = &v + return s +} + +type CreateDeploymentOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the deployment. + DeploymentArn *string `type:"string"` + + // The ID of 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() +} + +// SetDeploymentArn sets the DeploymentArn field's value. +func (s *CreateDeploymentOutput) SetDeploymentArn(v string) *CreateDeploymentOutput { + s.DeploymentArn = &v + return s +} + +// SetDeploymentId sets the DeploymentId field's value. +func (s *CreateDeploymentOutput) SetDeploymentId(v string) *CreateDeploymentOutput { + s.DeploymentId = &v + return s +} + +type CreateDeviceDefinitionInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // Information about a device definition version. + InitialVersion *DeviceDefinitionVersion `type:"structure"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s CreateDeviceDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDeviceDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateDeviceDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateDeviceDefinitionInput"} + if s.InitialVersion != nil { + if err := s.InitialVersion.Validate(); err != nil { + invalidParams.AddNested("InitialVersion", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateDeviceDefinitionInput) SetAmznClientToken(v string) *CreateDeviceDefinitionInput { + s.AmznClientToken = &v + return s +} + +// SetInitialVersion sets the InitialVersion field's value. +func (s *CreateDeviceDefinitionInput) SetInitialVersion(v *DeviceDefinitionVersion) *CreateDeviceDefinitionInput { + s.InitialVersion = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateDeviceDefinitionInput) SetName(v string) *CreateDeviceDefinitionInput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateDeviceDefinitionInput) SetTags(v map[string]*string) *CreateDeviceDefinitionInput { + s.Tags = v + return s +} + +type CreateDeviceDefinitionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` +} + +// String returns the string representation +func (s CreateDeviceDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDeviceDefinitionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateDeviceDefinitionOutput) SetArn(v string) *CreateDeviceDefinitionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateDeviceDefinitionOutput) SetCreationTimestamp(v string) *CreateDeviceDefinitionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateDeviceDefinitionOutput) SetId(v string) *CreateDeviceDefinitionOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *CreateDeviceDefinitionOutput) SetLastUpdatedTimestamp(v string) *CreateDeviceDefinitionOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *CreateDeviceDefinitionOutput) SetLatestVersion(v string) *CreateDeviceDefinitionOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *CreateDeviceDefinitionOutput) SetLatestVersionArn(v string) *CreateDeviceDefinitionOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateDeviceDefinitionOutput) SetName(v string) *CreateDeviceDefinitionOutput { + s.Name = &v + return s +} + +type CreateDeviceDefinitionVersionInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // DeviceDefinitionId is a required field + DeviceDefinitionId *string `location:"uri" locationName:"DeviceDefinitionId" type:"string" required:"true"` + + Devices []*Device `type:"list"` +} + +// String returns the string representation +func (s CreateDeviceDefinitionVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDeviceDefinitionVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateDeviceDefinitionVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateDeviceDefinitionVersionInput"} + if s.DeviceDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("DeviceDefinitionId")) + } + if s.DeviceDefinitionId != nil && len(*s.DeviceDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DeviceDefinitionId", 1)) + } + if s.Devices != nil { + for i, v := range s.Devices { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Devices", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateDeviceDefinitionVersionInput) SetAmznClientToken(v string) *CreateDeviceDefinitionVersionInput { + s.AmznClientToken = &v + return s +} + +// SetDeviceDefinitionId sets the DeviceDefinitionId field's value. +func (s *CreateDeviceDefinitionVersionInput) SetDeviceDefinitionId(v string) *CreateDeviceDefinitionVersionInput { + s.DeviceDefinitionId = &v + return s +} + +// SetDevices sets the Devices field's value. +func (s *CreateDeviceDefinitionVersionInput) SetDevices(v []*Device) *CreateDeviceDefinitionVersionInput { + s.Devices = v + return s +} + +type CreateDeviceDefinitionVersionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + Version *string `type:"string"` +} + +// String returns the string representation +func (s CreateDeviceDefinitionVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDeviceDefinitionVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateDeviceDefinitionVersionOutput) SetArn(v string) *CreateDeviceDefinitionVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateDeviceDefinitionVersionOutput) SetCreationTimestamp(v string) *CreateDeviceDefinitionVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateDeviceDefinitionVersionOutput) SetId(v string) *CreateDeviceDefinitionVersionOutput { + s.Id = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *CreateDeviceDefinitionVersionOutput) SetVersion(v string) *CreateDeviceDefinitionVersionOutput { + s.Version = &v + return s +} + +type CreateFunctionDefinitionInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // Information about a function definition version. + InitialVersion *FunctionDefinitionVersion `type:"structure"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s CreateFunctionDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateFunctionDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateFunctionDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateFunctionDefinitionInput"} + if s.InitialVersion != nil { + if err := s.InitialVersion.Validate(); err != nil { + invalidParams.AddNested("InitialVersion", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateFunctionDefinitionInput) SetAmznClientToken(v string) *CreateFunctionDefinitionInput { + s.AmznClientToken = &v + return s +} + +// SetInitialVersion sets the InitialVersion field's value. +func (s *CreateFunctionDefinitionInput) SetInitialVersion(v *FunctionDefinitionVersion) *CreateFunctionDefinitionInput { + s.InitialVersion = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateFunctionDefinitionInput) SetName(v string) *CreateFunctionDefinitionInput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateFunctionDefinitionInput) SetTags(v map[string]*string) *CreateFunctionDefinitionInput { + s.Tags = v + return s +} + +type CreateFunctionDefinitionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` +} + +// String returns the string representation +func (s CreateFunctionDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateFunctionDefinitionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateFunctionDefinitionOutput) SetArn(v string) *CreateFunctionDefinitionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateFunctionDefinitionOutput) SetCreationTimestamp(v string) *CreateFunctionDefinitionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateFunctionDefinitionOutput) SetId(v string) *CreateFunctionDefinitionOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *CreateFunctionDefinitionOutput) SetLastUpdatedTimestamp(v string) *CreateFunctionDefinitionOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *CreateFunctionDefinitionOutput) SetLatestVersion(v string) *CreateFunctionDefinitionOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *CreateFunctionDefinitionOutput) SetLatestVersionArn(v string) *CreateFunctionDefinitionOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateFunctionDefinitionOutput) SetName(v string) *CreateFunctionDefinitionOutput { + s.Name = &v + return s +} + +type CreateFunctionDefinitionVersionInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // The default configuration that applies to all Lambda functions in the group. + // Individual Lambda functions can override these settings. + DefaultConfig *FunctionDefaultConfig `type:"structure"` + + // FunctionDefinitionId is a required field + FunctionDefinitionId *string `location:"uri" locationName:"FunctionDefinitionId" type:"string" required:"true"` + + Functions []*Function `type:"list"` +} + +// String returns the string representation +func (s CreateFunctionDefinitionVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateFunctionDefinitionVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateFunctionDefinitionVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateFunctionDefinitionVersionInput"} + if s.FunctionDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("FunctionDefinitionId")) + } + if s.FunctionDefinitionId != nil && len(*s.FunctionDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FunctionDefinitionId", 1)) + } + if s.Functions != nil { + for i, v := range s.Functions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Functions", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateFunctionDefinitionVersionInput) SetAmznClientToken(v string) *CreateFunctionDefinitionVersionInput { + s.AmznClientToken = &v + return s +} + +// SetDefaultConfig sets the DefaultConfig field's value. +func (s *CreateFunctionDefinitionVersionInput) SetDefaultConfig(v *FunctionDefaultConfig) *CreateFunctionDefinitionVersionInput { + s.DefaultConfig = v + return s +} + +// SetFunctionDefinitionId sets the FunctionDefinitionId field's value. +func (s *CreateFunctionDefinitionVersionInput) SetFunctionDefinitionId(v string) *CreateFunctionDefinitionVersionInput { + s.FunctionDefinitionId = &v + return s +} + +// SetFunctions sets the Functions field's value. +func (s *CreateFunctionDefinitionVersionInput) SetFunctions(v []*Function) *CreateFunctionDefinitionVersionInput { + s.Functions = v + return s +} + +type CreateFunctionDefinitionVersionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + Version *string `type:"string"` +} + +// String returns the string representation +func (s CreateFunctionDefinitionVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateFunctionDefinitionVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateFunctionDefinitionVersionOutput) SetArn(v string) *CreateFunctionDefinitionVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateFunctionDefinitionVersionOutput) SetCreationTimestamp(v string) *CreateFunctionDefinitionVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateFunctionDefinitionVersionOutput) SetId(v string) *CreateFunctionDefinitionVersionOutput { + s.Id = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *CreateFunctionDefinitionVersionOutput) SetVersion(v string) *CreateFunctionDefinitionVersionOutput { + s.Version = &v + return s +} + +type CreateGroupCertificateAuthorityInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateGroupCertificateAuthorityInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateGroupCertificateAuthorityInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateGroupCertificateAuthorityInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateGroupCertificateAuthorityInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateGroupCertificateAuthorityInput) SetAmznClientToken(v string) *CreateGroupCertificateAuthorityInput { + s.AmznClientToken = &v + return s +} + +// SetGroupId sets the GroupId field's value. +func (s *CreateGroupCertificateAuthorityInput) SetGroupId(v string) *CreateGroupCertificateAuthorityInput { + s.GroupId = &v + return s +} + +type CreateGroupCertificateAuthorityOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the group certificate authority. + GroupCertificateAuthorityArn *string `type:"string"` +} + +// String returns the string representation +func (s CreateGroupCertificateAuthorityOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateGroupCertificateAuthorityOutput) GoString() string { + return s.String() +} + +// SetGroupCertificateAuthorityArn sets the GroupCertificateAuthorityArn field's value. +func (s *CreateGroupCertificateAuthorityOutput) SetGroupCertificateAuthorityArn(v string) *CreateGroupCertificateAuthorityOutput { + s.GroupCertificateAuthorityArn = &v + return s +} + +type CreateGroupInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // Information about a group version. + InitialVersion *GroupVersion `type:"structure"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// 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() +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateGroupInput) SetAmznClientToken(v string) *CreateGroupInput { + s.AmznClientToken = &v + return s +} + +// SetInitialVersion sets the InitialVersion field's value. +func (s *CreateGroupInput) SetInitialVersion(v *GroupVersion) *CreateGroupInput { + s.InitialVersion = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateGroupInput) SetName(v string) *CreateGroupInput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateGroupInput) SetTags(v map[string]*string) *CreateGroupInput { + s.Tags = v + return s +} + +type CreateGroupOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` +} + +// 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() +} + +// SetArn sets the Arn field's value. +func (s *CreateGroupOutput) SetArn(v string) *CreateGroupOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateGroupOutput) SetCreationTimestamp(v string) *CreateGroupOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateGroupOutput) SetId(v string) *CreateGroupOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *CreateGroupOutput) SetLastUpdatedTimestamp(v string) *CreateGroupOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *CreateGroupOutput) SetLatestVersion(v string) *CreateGroupOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *CreateGroupOutput) SetLatestVersionArn(v string) *CreateGroupOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateGroupOutput) SetName(v string) *CreateGroupOutput { + s.Name = &v + return s +} + +type CreateGroupVersionInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + ConnectorDefinitionVersionArn *string `type:"string"` + + CoreDefinitionVersionArn *string `type:"string"` + + DeviceDefinitionVersionArn *string `type:"string"` + + FunctionDefinitionVersionArn *string `type:"string"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` + + LoggerDefinitionVersionArn *string `type:"string"` + + ResourceDefinitionVersionArn *string `type:"string"` + + SubscriptionDefinitionVersionArn *string `type:"string"` +} + +// String returns the string representation +func (s CreateGroupVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateGroupVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateGroupVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateGroupVersionInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateGroupVersionInput) SetAmznClientToken(v string) *CreateGroupVersionInput { + s.AmznClientToken = &v + return s +} + +// SetConnectorDefinitionVersionArn sets the ConnectorDefinitionVersionArn field's value. +func (s *CreateGroupVersionInput) SetConnectorDefinitionVersionArn(v string) *CreateGroupVersionInput { + s.ConnectorDefinitionVersionArn = &v + return s +} + +// SetCoreDefinitionVersionArn sets the CoreDefinitionVersionArn field's value. +func (s *CreateGroupVersionInput) SetCoreDefinitionVersionArn(v string) *CreateGroupVersionInput { + s.CoreDefinitionVersionArn = &v + return s +} + +// SetDeviceDefinitionVersionArn sets the DeviceDefinitionVersionArn field's value. +func (s *CreateGroupVersionInput) SetDeviceDefinitionVersionArn(v string) *CreateGroupVersionInput { + s.DeviceDefinitionVersionArn = &v + return s +} + +// SetFunctionDefinitionVersionArn sets the FunctionDefinitionVersionArn field's value. +func (s *CreateGroupVersionInput) SetFunctionDefinitionVersionArn(v string) *CreateGroupVersionInput { + s.FunctionDefinitionVersionArn = &v + return s +} + +// SetGroupId sets the GroupId field's value. +func (s *CreateGroupVersionInput) SetGroupId(v string) *CreateGroupVersionInput { + s.GroupId = &v + return s +} + +// SetLoggerDefinitionVersionArn sets the LoggerDefinitionVersionArn field's value. +func (s *CreateGroupVersionInput) SetLoggerDefinitionVersionArn(v string) *CreateGroupVersionInput { + s.LoggerDefinitionVersionArn = &v + return s +} + +// SetResourceDefinitionVersionArn sets the ResourceDefinitionVersionArn field's value. +func (s *CreateGroupVersionInput) SetResourceDefinitionVersionArn(v string) *CreateGroupVersionInput { + s.ResourceDefinitionVersionArn = &v + return s +} + +// SetSubscriptionDefinitionVersionArn sets the SubscriptionDefinitionVersionArn field's value. +func (s *CreateGroupVersionInput) SetSubscriptionDefinitionVersionArn(v string) *CreateGroupVersionInput { + s.SubscriptionDefinitionVersionArn = &v + return s +} + +type CreateGroupVersionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + Version *string `type:"string"` +} + +// String returns the string representation +func (s CreateGroupVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateGroupVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateGroupVersionOutput) SetArn(v string) *CreateGroupVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateGroupVersionOutput) SetCreationTimestamp(v string) *CreateGroupVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateGroupVersionOutput) SetId(v string) *CreateGroupVersionOutput { + s.Id = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *CreateGroupVersionOutput) SetVersion(v string) *CreateGroupVersionOutput { + s.Version = &v + return s +} + +type CreateLoggerDefinitionInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // Information about a logger definition version. + InitialVersion *LoggerDefinitionVersion `type:"structure"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s CreateLoggerDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoggerDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateLoggerDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLoggerDefinitionInput"} + if s.InitialVersion != nil { + if err := s.InitialVersion.Validate(); err != nil { + invalidParams.AddNested("InitialVersion", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateLoggerDefinitionInput) SetAmznClientToken(v string) *CreateLoggerDefinitionInput { + s.AmznClientToken = &v + return s +} + +// SetInitialVersion sets the InitialVersion field's value. +func (s *CreateLoggerDefinitionInput) SetInitialVersion(v *LoggerDefinitionVersion) *CreateLoggerDefinitionInput { + s.InitialVersion = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateLoggerDefinitionInput) SetName(v string) *CreateLoggerDefinitionInput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateLoggerDefinitionInput) SetTags(v map[string]*string) *CreateLoggerDefinitionInput { + s.Tags = v + return s +} + +type CreateLoggerDefinitionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` +} + +// String returns the string representation +func (s CreateLoggerDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoggerDefinitionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateLoggerDefinitionOutput) SetArn(v string) *CreateLoggerDefinitionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateLoggerDefinitionOutput) SetCreationTimestamp(v string) *CreateLoggerDefinitionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateLoggerDefinitionOutput) SetId(v string) *CreateLoggerDefinitionOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *CreateLoggerDefinitionOutput) SetLastUpdatedTimestamp(v string) *CreateLoggerDefinitionOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *CreateLoggerDefinitionOutput) SetLatestVersion(v string) *CreateLoggerDefinitionOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *CreateLoggerDefinitionOutput) SetLatestVersionArn(v string) *CreateLoggerDefinitionOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateLoggerDefinitionOutput) SetName(v string) *CreateLoggerDefinitionOutput { + s.Name = &v + return s +} + +type CreateLoggerDefinitionVersionInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // LoggerDefinitionId is a required field + LoggerDefinitionId *string `location:"uri" locationName:"LoggerDefinitionId" type:"string" required:"true"` + + Loggers []*Logger `type:"list"` +} + +// String returns the string representation +func (s CreateLoggerDefinitionVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoggerDefinitionVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateLoggerDefinitionVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLoggerDefinitionVersionInput"} + if s.LoggerDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("LoggerDefinitionId")) + } + if s.LoggerDefinitionId != nil && len(*s.LoggerDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LoggerDefinitionId", 1)) + } + if s.Loggers != nil { + for i, v := range s.Loggers { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Loggers", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateLoggerDefinitionVersionInput) SetAmznClientToken(v string) *CreateLoggerDefinitionVersionInput { + s.AmznClientToken = &v + return s +} + +// SetLoggerDefinitionId sets the LoggerDefinitionId field's value. +func (s *CreateLoggerDefinitionVersionInput) SetLoggerDefinitionId(v string) *CreateLoggerDefinitionVersionInput { + s.LoggerDefinitionId = &v + return s +} + +// SetLoggers sets the Loggers field's value. +func (s *CreateLoggerDefinitionVersionInput) SetLoggers(v []*Logger) *CreateLoggerDefinitionVersionInput { + s.Loggers = v + return s +} + +type CreateLoggerDefinitionVersionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + Version *string `type:"string"` +} + +// String returns the string representation +func (s CreateLoggerDefinitionVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLoggerDefinitionVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateLoggerDefinitionVersionOutput) SetArn(v string) *CreateLoggerDefinitionVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateLoggerDefinitionVersionOutput) SetCreationTimestamp(v string) *CreateLoggerDefinitionVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateLoggerDefinitionVersionOutput) SetId(v string) *CreateLoggerDefinitionVersionOutput { + s.Id = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *CreateLoggerDefinitionVersionOutput) SetVersion(v string) *CreateLoggerDefinitionVersionOutput { + s.Version = &v + return s +} + +type CreateResourceDefinitionInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // Information about a resource definition version. + InitialVersion *ResourceDefinitionVersion `type:"structure"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s CreateResourceDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateResourceDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateResourceDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateResourceDefinitionInput"} + if s.InitialVersion != nil { + if err := s.InitialVersion.Validate(); err != nil { + invalidParams.AddNested("InitialVersion", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateResourceDefinitionInput) SetAmznClientToken(v string) *CreateResourceDefinitionInput { + s.AmznClientToken = &v + return s +} + +// SetInitialVersion sets the InitialVersion field's value. +func (s *CreateResourceDefinitionInput) SetInitialVersion(v *ResourceDefinitionVersion) *CreateResourceDefinitionInput { + s.InitialVersion = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateResourceDefinitionInput) SetName(v string) *CreateResourceDefinitionInput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateResourceDefinitionInput) SetTags(v map[string]*string) *CreateResourceDefinitionInput { + s.Tags = v + return s +} + +type CreateResourceDefinitionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` +} + +// String returns the string representation +func (s CreateResourceDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateResourceDefinitionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateResourceDefinitionOutput) SetArn(v string) *CreateResourceDefinitionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateResourceDefinitionOutput) SetCreationTimestamp(v string) *CreateResourceDefinitionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateResourceDefinitionOutput) SetId(v string) *CreateResourceDefinitionOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *CreateResourceDefinitionOutput) SetLastUpdatedTimestamp(v string) *CreateResourceDefinitionOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *CreateResourceDefinitionOutput) SetLatestVersion(v string) *CreateResourceDefinitionOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *CreateResourceDefinitionOutput) SetLatestVersionArn(v string) *CreateResourceDefinitionOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateResourceDefinitionOutput) SetName(v string) *CreateResourceDefinitionOutput { + s.Name = &v + return s +} + +type CreateResourceDefinitionVersionInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // ResourceDefinitionId is a required field + ResourceDefinitionId *string `location:"uri" locationName:"ResourceDefinitionId" type:"string" required:"true"` + + Resources []*Resource `type:"list"` +} + +// String returns the string representation +func (s CreateResourceDefinitionVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateResourceDefinitionVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateResourceDefinitionVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateResourceDefinitionVersionInput"} + if s.ResourceDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceDefinitionId")) + } + if s.ResourceDefinitionId != nil && len(*s.ResourceDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceDefinitionId", 1)) + } + if s.Resources != nil { + for i, v := range s.Resources { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Resources", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateResourceDefinitionVersionInput) SetAmznClientToken(v string) *CreateResourceDefinitionVersionInput { + s.AmznClientToken = &v + return s +} + +// SetResourceDefinitionId sets the ResourceDefinitionId field's value. +func (s *CreateResourceDefinitionVersionInput) SetResourceDefinitionId(v string) *CreateResourceDefinitionVersionInput { + s.ResourceDefinitionId = &v + return s +} + +// SetResources sets the Resources field's value. +func (s *CreateResourceDefinitionVersionInput) SetResources(v []*Resource) *CreateResourceDefinitionVersionInput { + s.Resources = v + return s +} + +type CreateResourceDefinitionVersionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + Version *string `type:"string"` +} + +// String returns the string representation +func (s CreateResourceDefinitionVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateResourceDefinitionVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateResourceDefinitionVersionOutput) SetArn(v string) *CreateResourceDefinitionVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateResourceDefinitionVersionOutput) SetCreationTimestamp(v string) *CreateResourceDefinitionVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateResourceDefinitionVersionOutput) SetId(v string) *CreateResourceDefinitionVersionOutput { + s.Id = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *CreateResourceDefinitionVersionOutput) SetVersion(v string) *CreateResourceDefinitionVersionOutput { + s.Version = &v + return s +} + +// Request for the CreateSoftwareUpdateJob API. +type CreateSoftwareUpdateJobInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // The IAM Role that Greengrass will use to create pre-signed URLs pointing + // towards the update artifact. + // + // S3UrlSignerRole is a required field + S3UrlSignerRole *string `type:"string" required:"true"` + + // The piece of software on the Greengrass core that will be updated. + // + // SoftwareToUpdate is a required field + SoftwareToUpdate *string `type:"string" required:"true" enum:"SoftwareToUpdate"` + + // The minimum level of log statements that should be logged by the OTA Agent + // during an update. + UpdateAgentLogLevel *string `type:"string" enum:"UpdateAgentLogLevel"` + + // The ARNs of the targets (IoT things or IoT thing groups) that this update + // will be applied to. + // + // UpdateTargets is a required field + UpdateTargets []*string `type:"list" required:"true"` + + // The architecture of the cores which are the targets of an update. + // + // UpdateTargetsArchitecture is a required field + UpdateTargetsArchitecture *string `type:"string" required:"true" enum:"UpdateTargetsArchitecture"` + + // The operating system of the cores which are the targets of an update. + // + // UpdateTargetsOperatingSystem is a required field + UpdateTargetsOperatingSystem *string `type:"string" required:"true" enum:"UpdateTargetsOperatingSystem"` +} + +// String returns the string representation +func (s CreateSoftwareUpdateJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSoftwareUpdateJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateSoftwareUpdateJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateSoftwareUpdateJobInput"} + if s.S3UrlSignerRole == nil { + invalidParams.Add(request.NewErrParamRequired("S3UrlSignerRole")) + } + if s.SoftwareToUpdate == nil { + invalidParams.Add(request.NewErrParamRequired("SoftwareToUpdate")) + } + if s.UpdateTargets == nil { + invalidParams.Add(request.NewErrParamRequired("UpdateTargets")) + } + if s.UpdateTargetsArchitecture == nil { + invalidParams.Add(request.NewErrParamRequired("UpdateTargetsArchitecture")) + } + if s.UpdateTargetsOperatingSystem == nil { + invalidParams.Add(request.NewErrParamRequired("UpdateTargetsOperatingSystem")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateSoftwareUpdateJobInput) SetAmznClientToken(v string) *CreateSoftwareUpdateJobInput { + s.AmznClientToken = &v + return s +} + +// SetS3UrlSignerRole sets the S3UrlSignerRole field's value. +func (s *CreateSoftwareUpdateJobInput) SetS3UrlSignerRole(v string) *CreateSoftwareUpdateJobInput { + s.S3UrlSignerRole = &v + return s +} + +// SetSoftwareToUpdate sets the SoftwareToUpdate field's value. +func (s *CreateSoftwareUpdateJobInput) SetSoftwareToUpdate(v string) *CreateSoftwareUpdateJobInput { + s.SoftwareToUpdate = &v + return s +} + +// SetUpdateAgentLogLevel sets the UpdateAgentLogLevel field's value. +func (s *CreateSoftwareUpdateJobInput) SetUpdateAgentLogLevel(v string) *CreateSoftwareUpdateJobInput { + s.UpdateAgentLogLevel = &v + return s +} + +// SetUpdateTargets sets the UpdateTargets field's value. +func (s *CreateSoftwareUpdateJobInput) SetUpdateTargets(v []*string) *CreateSoftwareUpdateJobInput { + s.UpdateTargets = v + return s +} + +// SetUpdateTargetsArchitecture sets the UpdateTargetsArchitecture field's value. +func (s *CreateSoftwareUpdateJobInput) SetUpdateTargetsArchitecture(v string) *CreateSoftwareUpdateJobInput { + s.UpdateTargetsArchitecture = &v + return s +} + +// SetUpdateTargetsOperatingSystem sets the UpdateTargetsOperatingSystem field's value. +func (s *CreateSoftwareUpdateJobInput) SetUpdateTargetsOperatingSystem(v string) *CreateSoftwareUpdateJobInput { + s.UpdateTargetsOperatingSystem = &v + return s +} + +type CreateSoftwareUpdateJobOutput struct { + _ struct{} `type:"structure"` + + // The IoT Job ARN corresponding to this update. + IotJobArn *string `type:"string"` + + // The IoT Job Id corresponding to this update. + IotJobId *string `type:"string"` + + // The software version installed on the device or devices after the update. + PlatformSoftwareVersion *string `type:"string"` +} + +// String returns the string representation +func (s CreateSoftwareUpdateJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSoftwareUpdateJobOutput) GoString() string { + return s.String() +} + +// SetIotJobArn sets the IotJobArn field's value. +func (s *CreateSoftwareUpdateJobOutput) SetIotJobArn(v string) *CreateSoftwareUpdateJobOutput { + s.IotJobArn = &v + return s +} + +// SetIotJobId sets the IotJobId field's value. +func (s *CreateSoftwareUpdateJobOutput) SetIotJobId(v string) *CreateSoftwareUpdateJobOutput { + s.IotJobId = &v + return s +} + +// SetPlatformSoftwareVersion sets the PlatformSoftwareVersion field's value. +func (s *CreateSoftwareUpdateJobOutput) SetPlatformSoftwareVersion(v string) *CreateSoftwareUpdateJobOutput { + s.PlatformSoftwareVersion = &v + return s +} + +type CreateSubscriptionDefinitionInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // Information about a subscription definition version. + InitialVersion *SubscriptionDefinitionVersion `type:"structure"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s CreateSubscriptionDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSubscriptionDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateSubscriptionDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateSubscriptionDefinitionInput"} + if s.InitialVersion != nil { + if err := s.InitialVersion.Validate(); err != nil { + invalidParams.AddNested("InitialVersion", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateSubscriptionDefinitionInput) SetAmznClientToken(v string) *CreateSubscriptionDefinitionInput { + s.AmznClientToken = &v + return s +} + +// SetInitialVersion sets the InitialVersion field's value. +func (s *CreateSubscriptionDefinitionInput) SetInitialVersion(v *SubscriptionDefinitionVersion) *CreateSubscriptionDefinitionInput { + s.InitialVersion = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateSubscriptionDefinitionInput) SetName(v string) *CreateSubscriptionDefinitionInput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateSubscriptionDefinitionInput) SetTags(v map[string]*string) *CreateSubscriptionDefinitionInput { + s.Tags = v + return s +} + +type CreateSubscriptionDefinitionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` +} + +// String returns the string representation +func (s CreateSubscriptionDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSubscriptionDefinitionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateSubscriptionDefinitionOutput) SetArn(v string) *CreateSubscriptionDefinitionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateSubscriptionDefinitionOutput) SetCreationTimestamp(v string) *CreateSubscriptionDefinitionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateSubscriptionDefinitionOutput) SetId(v string) *CreateSubscriptionDefinitionOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *CreateSubscriptionDefinitionOutput) SetLastUpdatedTimestamp(v string) *CreateSubscriptionDefinitionOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *CreateSubscriptionDefinitionOutput) SetLatestVersion(v string) *CreateSubscriptionDefinitionOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *CreateSubscriptionDefinitionOutput) SetLatestVersionArn(v string) *CreateSubscriptionDefinitionOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateSubscriptionDefinitionOutput) SetName(v string) *CreateSubscriptionDefinitionOutput { + s.Name = &v + return s +} + +type CreateSubscriptionDefinitionVersionInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // SubscriptionDefinitionId is a required field + SubscriptionDefinitionId *string `location:"uri" locationName:"SubscriptionDefinitionId" type:"string" required:"true"` + + Subscriptions []*Subscription `type:"list"` +} + +// String returns the string representation +func (s CreateSubscriptionDefinitionVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSubscriptionDefinitionVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateSubscriptionDefinitionVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateSubscriptionDefinitionVersionInput"} + if s.SubscriptionDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("SubscriptionDefinitionId")) + } + if s.SubscriptionDefinitionId != nil && len(*s.SubscriptionDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SubscriptionDefinitionId", 1)) + } + if s.Subscriptions != nil { + for i, v := range s.Subscriptions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Subscriptions", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *CreateSubscriptionDefinitionVersionInput) SetAmznClientToken(v string) *CreateSubscriptionDefinitionVersionInput { + s.AmznClientToken = &v + return s +} + +// SetSubscriptionDefinitionId sets the SubscriptionDefinitionId field's value. +func (s *CreateSubscriptionDefinitionVersionInput) SetSubscriptionDefinitionId(v string) *CreateSubscriptionDefinitionVersionInput { + s.SubscriptionDefinitionId = &v + return s +} + +// SetSubscriptions sets the Subscriptions field's value. +func (s *CreateSubscriptionDefinitionVersionInput) SetSubscriptions(v []*Subscription) *CreateSubscriptionDefinitionVersionInput { + s.Subscriptions = v + return s +} + +type CreateSubscriptionDefinitionVersionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + Version *string `type:"string"` +} + +// String returns the string representation +func (s CreateSubscriptionDefinitionVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSubscriptionDefinitionVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateSubscriptionDefinitionVersionOutput) SetArn(v string) *CreateSubscriptionDefinitionVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *CreateSubscriptionDefinitionVersionOutput) SetCreationTimestamp(v string) *CreateSubscriptionDefinitionVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateSubscriptionDefinitionVersionOutput) SetId(v string) *CreateSubscriptionDefinitionVersionOutput { + s.Id = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *CreateSubscriptionDefinitionVersionOutput) SetVersion(v string) *CreateSubscriptionDefinitionVersionOutput { + s.Version = &v + return s +} + +// Information about a definition. +type DefinitionInformation struct { + _ struct{} `type:"structure"` + + // The ARN of the definition. + Arn *string `type:"string"` + + // The time, in milliseconds since the epoch, when the definition was created. + CreationTimestamp *string `type:"string"` + + // The ID of the definition. + Id *string `type:"string"` + + // The time, in milliseconds since the epoch, when the definition was last updated. + LastUpdatedTimestamp *string `type:"string"` + + // The ID of the latest version associated with the definition. + LatestVersion *string `type:"string"` + + // The ARN of the latest version associated with the definition. + LatestVersionArn *string `type:"string"` + + // The name of the definition. + Name *string `type:"string"` + + // Tag(s) attached to the resource arn. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s DefinitionInformation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DefinitionInformation) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DefinitionInformation) SetArn(v string) *DefinitionInformation { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *DefinitionInformation) SetCreationTimestamp(v string) *DefinitionInformation { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *DefinitionInformation) SetId(v string) *DefinitionInformation { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *DefinitionInformation) SetLastUpdatedTimestamp(v string) *DefinitionInformation { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *DefinitionInformation) SetLatestVersion(v string) *DefinitionInformation { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *DefinitionInformation) SetLatestVersionArn(v string) *DefinitionInformation { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *DefinitionInformation) SetName(v string) *DefinitionInformation { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *DefinitionInformation) SetTags(v map[string]*string) *DefinitionInformation { + s.Tags = v + return s +} + +type DeleteConnectorDefinitionInput struct { + _ struct{} `type:"structure"` + + // ConnectorDefinitionId is a required field + ConnectorDefinitionId *string `location:"uri" locationName:"ConnectorDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteConnectorDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteConnectorDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteConnectorDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteConnectorDefinitionInput"} + if s.ConnectorDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("ConnectorDefinitionId")) + } + if s.ConnectorDefinitionId != nil && len(*s.ConnectorDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConnectorDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConnectorDefinitionId sets the ConnectorDefinitionId field's value. +func (s *DeleteConnectorDefinitionInput) SetConnectorDefinitionId(v string) *DeleteConnectorDefinitionInput { + s.ConnectorDefinitionId = &v + return s +} + +type DeleteConnectorDefinitionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteConnectorDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteConnectorDefinitionOutput) GoString() string { + return s.String() +} + +type DeleteCoreDefinitionInput struct { + _ struct{} `type:"structure"` + + // CoreDefinitionId is a required field + CoreDefinitionId *string `location:"uri" locationName:"CoreDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteCoreDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCoreDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteCoreDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteCoreDefinitionInput"} + if s.CoreDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("CoreDefinitionId")) + } + if s.CoreDefinitionId != nil && len(*s.CoreDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CoreDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCoreDefinitionId sets the CoreDefinitionId field's value. +func (s *DeleteCoreDefinitionInput) SetCoreDefinitionId(v string) *DeleteCoreDefinitionInput { + s.CoreDefinitionId = &v + return s +} + +type DeleteCoreDefinitionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteCoreDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCoreDefinitionOutput) GoString() string { + return s.String() +} + +type DeleteDeviceDefinitionInput struct { + _ struct{} `type:"structure"` + + // DeviceDefinitionId is a required field + DeviceDefinitionId *string `location:"uri" locationName:"DeviceDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteDeviceDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDeviceDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteDeviceDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteDeviceDefinitionInput"} + if s.DeviceDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("DeviceDefinitionId")) + } + if s.DeviceDefinitionId != nil && len(*s.DeviceDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DeviceDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDeviceDefinitionId sets the DeviceDefinitionId field's value. +func (s *DeleteDeviceDefinitionInput) SetDeviceDefinitionId(v string) *DeleteDeviceDefinitionInput { + s.DeviceDefinitionId = &v + return s +} + +type DeleteDeviceDefinitionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteDeviceDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDeviceDefinitionOutput) GoString() string { + return s.String() +} + +type DeleteFunctionDefinitionInput struct { + _ struct{} `type:"structure"` + + // FunctionDefinitionId is a required field + FunctionDefinitionId *string `location:"uri" locationName:"FunctionDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteFunctionDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFunctionDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteFunctionDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteFunctionDefinitionInput"} + if s.FunctionDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("FunctionDefinitionId")) + } + if s.FunctionDefinitionId != nil && len(*s.FunctionDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FunctionDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFunctionDefinitionId sets the FunctionDefinitionId field's value. +func (s *DeleteFunctionDefinitionInput) SetFunctionDefinitionId(v string) *DeleteFunctionDefinitionInput { + s.FunctionDefinitionId = &v + return s +} + +type DeleteFunctionDefinitionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteFunctionDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFunctionDefinitionOutput) GoString() string { + return s.String() +} + +type DeleteGroupInput struct { + _ struct{} `type:"structure"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" 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.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *DeleteGroupInput) SetGroupId(v string) *DeleteGroupInput { + s.GroupId = &v + return s +} + +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() +} + +type DeleteLoggerDefinitionInput struct { + _ struct{} `type:"structure"` + + // LoggerDefinitionId is a required field + LoggerDefinitionId *string `location:"uri" locationName:"LoggerDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteLoggerDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoggerDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteLoggerDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteLoggerDefinitionInput"} + if s.LoggerDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("LoggerDefinitionId")) + } + if s.LoggerDefinitionId != nil && len(*s.LoggerDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LoggerDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoggerDefinitionId sets the LoggerDefinitionId field's value. +func (s *DeleteLoggerDefinitionInput) SetLoggerDefinitionId(v string) *DeleteLoggerDefinitionInput { + s.LoggerDefinitionId = &v + return s +} + +type DeleteLoggerDefinitionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteLoggerDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoggerDefinitionOutput) GoString() string { + return s.String() +} + +type DeleteResourceDefinitionInput struct { + _ struct{} `type:"structure"` + + // ResourceDefinitionId is a required field + ResourceDefinitionId *string `location:"uri" locationName:"ResourceDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteResourceDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteResourceDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteResourceDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteResourceDefinitionInput"} + if s.ResourceDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceDefinitionId")) + } + if s.ResourceDefinitionId != nil && len(*s.ResourceDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceDefinitionId sets the ResourceDefinitionId field's value. +func (s *DeleteResourceDefinitionInput) SetResourceDefinitionId(v string) *DeleteResourceDefinitionInput { + s.ResourceDefinitionId = &v + return s +} + +type DeleteResourceDefinitionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteResourceDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteResourceDefinitionOutput) GoString() string { + return s.String() +} + +type DeleteSubscriptionDefinitionInput struct { + _ struct{} `type:"structure"` + + // SubscriptionDefinitionId is a required field + SubscriptionDefinitionId *string `location:"uri" locationName:"SubscriptionDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteSubscriptionDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSubscriptionDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteSubscriptionDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteSubscriptionDefinitionInput"} + if s.SubscriptionDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("SubscriptionDefinitionId")) + } + if s.SubscriptionDefinitionId != nil && len(*s.SubscriptionDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SubscriptionDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSubscriptionDefinitionId sets the SubscriptionDefinitionId field's value. +func (s *DeleteSubscriptionDefinitionInput) SetSubscriptionDefinitionId(v string) *DeleteSubscriptionDefinitionInput { + s.SubscriptionDefinitionId = &v + return s +} + +type DeleteSubscriptionDefinitionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteSubscriptionDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSubscriptionDefinitionOutput) GoString() string { + return s.String() +} + +// Information about a deployment. +type Deployment struct { + _ struct{} `type:"structure"` + + // The time, in milliseconds since the epoch, when the deployment was created. + CreatedAt *string `type:"string"` + + // The ARN of the deployment. + DeploymentArn *string `type:"string"` + + // The ID of the deployment. + DeploymentId *string `type:"string"` + + // The type of the deployment. + DeploymentType *string `type:"string" enum:"DeploymentType"` + + // The ARN of the group for this deployment. + GroupArn *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() +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *Deployment) SetCreatedAt(v string) *Deployment { + s.CreatedAt = &v + return s +} + +// SetDeploymentArn sets the DeploymentArn field's value. +func (s *Deployment) SetDeploymentArn(v string) *Deployment { + s.DeploymentArn = &v + return s +} + +// SetDeploymentId sets the DeploymentId field's value. +func (s *Deployment) SetDeploymentId(v string) *Deployment { + s.DeploymentId = &v + return s +} + +// SetDeploymentType sets the DeploymentType field's value. +func (s *Deployment) SetDeploymentType(v string) *Deployment { + s.DeploymentType = &v + return s +} + +// SetGroupArn sets the GroupArn field's value. +func (s *Deployment) SetGroupArn(v string) *Deployment { + s.GroupArn = &v + return s +} + +// Information about a device. +type Device struct { + _ struct{} `type:"structure"` + + // The ARN of the certificate associated with the device. + // + // CertificateArn is a required field + CertificateArn *string `type:"string" required:"true"` + + // A descriptive or arbitrary ID for the device. This value must be unique within + // the device definition version. Max length is 128 characters with pattern + // ''[a-zA-Z0-9:_-]+''. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // If true, the device's local shadow will be automatically synced with the + // cloud. + SyncShadow *bool `type:"boolean"` + + // The thing ARN of the device. + // + // ThingArn is a required field + ThingArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s Device) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Device) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Device) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Device"} + if s.CertificateArn == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateArn")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.ThingArn == nil { + invalidParams.Add(request.NewErrParamRequired("ThingArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCertificateArn sets the CertificateArn field's value. +func (s *Device) SetCertificateArn(v string) *Device { + s.CertificateArn = &v + return s +} + +// SetId sets the Id field's value. +func (s *Device) SetId(v string) *Device { + s.Id = &v + return s +} + +// SetSyncShadow sets the SyncShadow field's value. +func (s *Device) SetSyncShadow(v bool) *Device { + s.SyncShadow = &v + return s +} + +// SetThingArn sets the ThingArn field's value. +func (s *Device) SetThingArn(v string) *Device { + s.ThingArn = &v + return s +} + +// Information about a device definition version. +type DeviceDefinitionVersion struct { + _ struct{} `type:"structure"` + + // A list of devices in the definition version. + Devices []*Device `type:"list"` +} + +// String returns the string representation +func (s DeviceDefinitionVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeviceDefinitionVersion) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeviceDefinitionVersion) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeviceDefinitionVersion"} + if s.Devices != nil { + for i, v := range s.Devices { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Devices", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDevices sets the Devices field's value. +func (s *DeviceDefinitionVersion) SetDevices(v []*Device) *DeviceDefinitionVersion { + s.Devices = v + return s +} + +type DisassociateRoleFromGroupInput struct { + _ struct{} `type:"structure"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DisassociateRoleFromGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateRoleFromGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisassociateRoleFromGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisassociateRoleFromGroupInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *DisassociateRoleFromGroupInput) SetGroupId(v string) *DisassociateRoleFromGroupInput { + s.GroupId = &v + return s +} + +type DisassociateRoleFromGroupOutput struct { + _ struct{} `type:"structure"` + + // The time, in milliseconds since the epoch, when the role was disassociated + // from the group. + DisassociatedAt *string `type:"string"` +} + +// String returns the string representation +func (s DisassociateRoleFromGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateRoleFromGroupOutput) GoString() string { + return s.String() +} + +// SetDisassociatedAt sets the DisassociatedAt field's value. +func (s *DisassociateRoleFromGroupOutput) SetDisassociatedAt(v string) *DisassociateRoleFromGroupOutput { + s.DisassociatedAt = &v + return s +} + +type DisassociateServiceRoleFromAccountInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DisassociateServiceRoleFromAccountInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateServiceRoleFromAccountInput) GoString() string { + return s.String() +} + +type DisassociateServiceRoleFromAccountOutput struct { + _ struct{} `type:"structure"` + + // The time when the service role was disassociated from the account. + DisassociatedAt *string `type:"string"` +} + +// String returns the string representation +func (s DisassociateServiceRoleFromAccountOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateServiceRoleFromAccountOutput) GoString() string { + return s.String() +} + +// SetDisassociatedAt sets the DisassociatedAt field's value. +func (s *DisassociateServiceRoleFromAccountOutput) SetDisassociatedAt(v string) *DisassociateServiceRoleFromAccountOutput { + s.DisassociatedAt = &v + return s +} + +// Details about the error. +type ErrorDetail struct { + _ struct{} `type:"structure"` + + // A detailed error code. + DetailedErrorCode *string `type:"string"` + + // A detailed error message. + DetailedErrorMessage *string `type:"string"` +} + +// String returns the string representation +func (s ErrorDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ErrorDetail) GoString() string { + return s.String() +} + +// SetDetailedErrorCode sets the DetailedErrorCode field's value. +func (s *ErrorDetail) SetDetailedErrorCode(v string) *ErrorDetail { + s.DetailedErrorCode = &v + return s +} + +// SetDetailedErrorMessage sets the DetailedErrorMessage field's value. +func (s *ErrorDetail) SetDetailedErrorMessage(v string) *ErrorDetail { + s.DetailedErrorMessage = &v + return s +} + +// Information about a Lambda function. +type Function struct { + _ struct{} `type:"structure"` + + // The ARN of the Lambda function. + FunctionArn *string `type:"string"` + + // The configuration of the Lambda function. + FunctionConfiguration *FunctionConfiguration `type:"structure"` + + // A descriptive or arbitrary ID for the function. This value must be unique + // within the function definition version. Max length is 128 characters with + // pattern ''[a-zA-Z0-9:_-]+''. + // + // Id is a required field + Id *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s Function) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Function) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Function) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Function"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.FunctionConfiguration != nil { + if err := s.FunctionConfiguration.Validate(); err != nil { + invalidParams.AddNested("FunctionConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFunctionArn sets the FunctionArn field's value. +func (s *Function) SetFunctionArn(v string) *Function { + s.FunctionArn = &v + return s +} + +// SetFunctionConfiguration sets the FunctionConfiguration field's value. +func (s *Function) SetFunctionConfiguration(v *FunctionConfiguration) *Function { + s.FunctionConfiguration = v + return s +} + +// SetId sets the Id field's value. +func (s *Function) SetId(v string) *Function { + s.Id = &v + return s +} + +// The configuration of the Lambda function. +type FunctionConfiguration struct { + _ struct{} `type:"structure"` + + // The expected encoding type of the input payload for the function. The default + // is ''json''. + EncodingType *string `type:"string" enum:"EncodingType"` + + // The environment configuration of the function. + Environment *FunctionConfigurationEnvironment `type:"structure"` + + // The execution arguments. + ExecArgs *string `type:"string"` + + // The name of the function executable. + Executable *string `type:"string"` + + // The memory size, in KB, which the function requires. This setting is not + // applicable and should be cleared when you run the Lambda function without + // containerization. + MemorySize *int64 `type:"integer"` + + // True if the function is pinned. Pinned means the function is long-lived and + // starts when the core starts. + Pinned *bool `type:"boolean"` + + // The allowed function execution time, after which Lambda should terminate + // the function. This timeout still applies to pinned Lambda functions for each + // request. + Timeout *int64 `type:"integer"` +} + +// 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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *FunctionConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "FunctionConfiguration"} + if s.Environment != nil { + if err := s.Environment.Validate(); err != nil { + invalidParams.AddNested("Environment", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEncodingType sets the EncodingType field's value. +func (s *FunctionConfiguration) SetEncodingType(v string) *FunctionConfiguration { + s.EncodingType = &v + return s +} + +// SetEnvironment sets the Environment field's value. +func (s *FunctionConfiguration) SetEnvironment(v *FunctionConfigurationEnvironment) *FunctionConfiguration { + s.Environment = v + return s +} + +// SetExecArgs sets the ExecArgs field's value. +func (s *FunctionConfiguration) SetExecArgs(v string) *FunctionConfiguration { + s.ExecArgs = &v + return s +} + +// SetExecutable sets the Executable field's value. +func (s *FunctionConfiguration) SetExecutable(v string) *FunctionConfiguration { + s.Executable = &v + return s +} + +// SetMemorySize sets the MemorySize field's value. +func (s *FunctionConfiguration) SetMemorySize(v int64) *FunctionConfiguration { + s.MemorySize = &v + return s +} + +// SetPinned sets the Pinned field's value. +func (s *FunctionConfiguration) SetPinned(v bool) *FunctionConfiguration { + s.Pinned = &v + return s +} + +// SetTimeout sets the Timeout field's value. +func (s *FunctionConfiguration) SetTimeout(v int64) *FunctionConfiguration { + s.Timeout = &v + return s +} + +// The environment configuration of the function. +type FunctionConfigurationEnvironment struct { + _ struct{} `type:"structure"` + + // If true, the Lambda function is allowed to access the host's /sys folder. + // Use this when the Lambda function needs to read device information from /sys. + // This setting applies only when you run the Lambda function in a Greengrass + // container. + AccessSysfs *bool `type:"boolean"` + + // Configuration related to executing the Lambda function + Execution *FunctionExecutionConfig `type:"structure"` + + // A list of the resources, with their permissions, to which the Lambda function + // will be granted access. A Lambda function can have at most 10 resources. + // ResourceAccessPolicies apply only when you run the Lambda function in a Greengrass + // container. + ResourceAccessPolicies []*ResourceAccessPolicy `type:"list"` + + // Environment variables for the Lambda function's configuration. + Variables map[string]*string `type:"map"` +} + +// String returns the string representation +func (s FunctionConfigurationEnvironment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FunctionConfigurationEnvironment) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *FunctionConfigurationEnvironment) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "FunctionConfigurationEnvironment"} + if s.ResourceAccessPolicies != nil { + for i, v := range s.ResourceAccessPolicies { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResourceAccessPolicies", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccessSysfs sets the AccessSysfs field's value. +func (s *FunctionConfigurationEnvironment) SetAccessSysfs(v bool) *FunctionConfigurationEnvironment { + s.AccessSysfs = &v + return s +} + +// SetExecution sets the Execution field's value. +func (s *FunctionConfigurationEnvironment) SetExecution(v *FunctionExecutionConfig) *FunctionConfigurationEnvironment { + s.Execution = v + return s +} + +// SetResourceAccessPolicies sets the ResourceAccessPolicies field's value. +func (s *FunctionConfigurationEnvironment) SetResourceAccessPolicies(v []*ResourceAccessPolicy) *FunctionConfigurationEnvironment { + s.ResourceAccessPolicies = v + return s +} + +// SetVariables sets the Variables field's value. +func (s *FunctionConfigurationEnvironment) SetVariables(v map[string]*string) *FunctionConfigurationEnvironment { + s.Variables = v + return s +} + +// The default configuration that applies to all Lambda functions in the group. +// Individual Lambda functions can override these settings. +type FunctionDefaultConfig struct { + _ struct{} `type:"structure"` + + // Configuration information that specifies how a Lambda function runs. + Execution *FunctionDefaultExecutionConfig `type:"structure"` +} + +// String returns the string representation +func (s FunctionDefaultConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FunctionDefaultConfig) GoString() string { + return s.String() +} + +// SetExecution sets the Execution field's value. +func (s *FunctionDefaultConfig) SetExecution(v *FunctionDefaultExecutionConfig) *FunctionDefaultConfig { + s.Execution = v + return s +} + +// Configuration information that specifies how a Lambda function runs. +type FunctionDefaultExecutionConfig struct { + _ struct{} `type:"structure"` + + // Specifies whether the Lambda function runs in a Greengrass container (default) + // or without containerization. Unless your scenario requires that you run without + // containerization, we recommend that you run in a Greengrass container. Omit + // this value to run the Lambda function with the default containerization for + // the group. + IsolationMode *string `type:"string" enum:"FunctionIsolationMode"` + + // Specifies the user and group whose permissions are used when running the + // Lambda function. You can specify one or both values to override the default + // values. We recommend that you avoid running as root unless absolutely necessary + // to minimize the risk of unintended changes or malicious attacks. To run as + // root, you must set ''IsolationMode'' to ''NoContainer'' and update config.json + // in ''greengrass-root/config'' to set ''allowFunctionsToRunAsRoot'' to ''yes''. + RunAs *FunctionRunAsConfig `type:"structure"` +} + +// String returns the string representation +func (s FunctionDefaultExecutionConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FunctionDefaultExecutionConfig) GoString() string { + return s.String() +} + +// SetIsolationMode sets the IsolationMode field's value. +func (s *FunctionDefaultExecutionConfig) SetIsolationMode(v string) *FunctionDefaultExecutionConfig { + s.IsolationMode = &v + return s +} + +// SetRunAs sets the RunAs field's value. +func (s *FunctionDefaultExecutionConfig) SetRunAs(v *FunctionRunAsConfig) *FunctionDefaultExecutionConfig { + s.RunAs = v + return s +} + +// Information about a function definition version. +type FunctionDefinitionVersion struct { + _ struct{} `type:"structure"` + + // The default configuration that applies to all Lambda functions in this function + // definition version. Individual Lambda functions can override these settings. + DefaultConfig *FunctionDefaultConfig `type:"structure"` + + // A list of Lambda functions in this function definition version. + Functions []*Function `type:"list"` +} + +// String returns the string representation +func (s FunctionDefinitionVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FunctionDefinitionVersion) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *FunctionDefinitionVersion) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "FunctionDefinitionVersion"} + if s.Functions != nil { + for i, v := range s.Functions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Functions", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDefaultConfig sets the DefaultConfig field's value. +func (s *FunctionDefinitionVersion) SetDefaultConfig(v *FunctionDefaultConfig) *FunctionDefinitionVersion { + s.DefaultConfig = v + return s +} + +// SetFunctions sets the Functions field's value. +func (s *FunctionDefinitionVersion) SetFunctions(v []*Function) *FunctionDefinitionVersion { + s.Functions = v + return s +} + +// Configuration information that specifies how a Lambda function runs. +type FunctionExecutionConfig struct { + _ struct{} `type:"structure"` + + // Specifies whether the Lambda function runs in a Greengrass container (default) + // or without containerization. Unless your scenario requires that you run without + // containerization, we recommend that you run in a Greengrass container. Omit + // this value to run the Lambda function with the default containerization for + // the group. + IsolationMode *string `type:"string" enum:"FunctionIsolationMode"` + + // Specifies the user and group whose permissions are used when running the + // Lambda function. You can specify one or both values to override the default + // values. We recommend that you avoid running as root unless absolutely necessary + // to minimize the risk of unintended changes or malicious attacks. To run as + // root, you must set ''IsolationMode'' to ''NoContainer'' and update config.json + // in ''greengrass-root/config'' to set ''allowFunctionsToRunAsRoot'' to ''yes''. + RunAs *FunctionRunAsConfig `type:"structure"` +} + +// String returns the string representation +func (s FunctionExecutionConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FunctionExecutionConfig) GoString() string { + return s.String() +} + +// SetIsolationMode sets the IsolationMode field's value. +func (s *FunctionExecutionConfig) SetIsolationMode(v string) *FunctionExecutionConfig { + s.IsolationMode = &v + return s +} + +// SetRunAs sets the RunAs field's value. +func (s *FunctionExecutionConfig) SetRunAs(v *FunctionRunAsConfig) *FunctionExecutionConfig { + s.RunAs = v + return s +} + +// Specifies the user and group whose permissions are used when running the +// Lambda function. You can specify one or both values to override the default +// values. We recommend that you avoid running as root unless absolutely necessary +// to minimize the risk of unintended changes or malicious attacks. To run as +// root, you must set ''IsolationMode'' to ''NoContainer'' and update config.json +// in ''greengrass-root/config'' to set ''allowFunctionsToRunAsRoot'' to ''yes''. +type FunctionRunAsConfig struct { + _ struct{} `type:"structure"` + + // The group ID whose permissions are used to run a Lambda function. + Gid *int64 `type:"integer"` + + // The user ID whose permissions are used to run a Lambda function. + Uid *int64 `type:"integer"` +} + +// String returns the string representation +func (s FunctionRunAsConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FunctionRunAsConfig) GoString() string { + return s.String() +} + +// SetGid sets the Gid field's value. +func (s *FunctionRunAsConfig) SetGid(v int64) *FunctionRunAsConfig { + s.Gid = &v + return s +} + +// SetUid sets the Uid field's value. +func (s *FunctionRunAsConfig) SetUid(v int64) *FunctionRunAsConfig { + s.Uid = &v + return s +} + +type GetAssociatedRoleInput struct { + _ struct{} `type:"structure"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetAssociatedRoleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAssociatedRoleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAssociatedRoleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAssociatedRoleInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *GetAssociatedRoleInput) SetGroupId(v string) *GetAssociatedRoleInput { + s.GroupId = &v + return s +} + +type GetAssociatedRoleOutput struct { + _ struct{} `type:"structure"` + + // The time when the role was associated with the group. + AssociatedAt *string `type:"string"` + + // The ARN of the role that is associated with the group. + RoleArn *string `type:"string"` +} + +// String returns the string representation +func (s GetAssociatedRoleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAssociatedRoleOutput) GoString() string { + return s.String() +} + +// SetAssociatedAt sets the AssociatedAt field's value. +func (s *GetAssociatedRoleOutput) SetAssociatedAt(v string) *GetAssociatedRoleOutput { + s.AssociatedAt = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *GetAssociatedRoleOutput) SetRoleArn(v string) *GetAssociatedRoleOutput { + s.RoleArn = &v + return s +} + +type GetBulkDeploymentStatusInput struct { + _ struct{} `type:"structure"` + + // BulkDeploymentId is a required field + BulkDeploymentId *string `location:"uri" locationName:"BulkDeploymentId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBulkDeploymentStatusInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBulkDeploymentStatusInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBulkDeploymentStatusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBulkDeploymentStatusInput"} + if s.BulkDeploymentId == nil { + invalidParams.Add(request.NewErrParamRequired("BulkDeploymentId")) + } + if s.BulkDeploymentId != nil && len(*s.BulkDeploymentId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("BulkDeploymentId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBulkDeploymentId sets the BulkDeploymentId field's value. +func (s *GetBulkDeploymentStatusInput) SetBulkDeploymentId(v string) *GetBulkDeploymentStatusInput { + s.BulkDeploymentId = &v + return s +} + +// Information about the status of a bulk deployment at the time of the request. +type GetBulkDeploymentStatusOutput struct { + _ struct{} `type:"structure"` + + // Relevant metrics on input records processed during bulk deployment. + BulkDeploymentMetrics *BulkDeploymentMetrics `type:"structure"` + + // The status of the bulk deployment. + BulkDeploymentStatus *string `type:"string" enum:"BulkDeploymentStatus"` + + // The time, in ISO format, when the deployment was created. + CreatedAt *string `type:"string"` + + // Error details + ErrorDetails []*ErrorDetail `type:"list"` + + // Error message + ErrorMessage *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s GetBulkDeploymentStatusOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBulkDeploymentStatusOutput) GoString() string { + return s.String() +} + +// SetBulkDeploymentMetrics sets the BulkDeploymentMetrics field's value. +func (s *GetBulkDeploymentStatusOutput) SetBulkDeploymentMetrics(v *BulkDeploymentMetrics) *GetBulkDeploymentStatusOutput { + s.BulkDeploymentMetrics = v + return s +} + +// SetBulkDeploymentStatus sets the BulkDeploymentStatus field's value. +func (s *GetBulkDeploymentStatusOutput) SetBulkDeploymentStatus(v string) *GetBulkDeploymentStatusOutput { + s.BulkDeploymentStatus = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *GetBulkDeploymentStatusOutput) SetCreatedAt(v string) *GetBulkDeploymentStatusOutput { + s.CreatedAt = &v + return s +} + +// SetErrorDetails sets the ErrorDetails field's value. +func (s *GetBulkDeploymentStatusOutput) SetErrorDetails(v []*ErrorDetail) *GetBulkDeploymentStatusOutput { + s.ErrorDetails = v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *GetBulkDeploymentStatusOutput) SetErrorMessage(v string) *GetBulkDeploymentStatusOutput { + s.ErrorMessage = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *GetBulkDeploymentStatusOutput) SetTags(v map[string]*string) *GetBulkDeploymentStatusOutput { + s.Tags = v + return s +} + +type GetConnectivityInfoInput struct { + _ struct{} `type:"structure"` + + // ThingName is a required field + ThingName *string `location:"uri" locationName:"ThingName" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetConnectivityInfoInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetConnectivityInfoInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetConnectivityInfoInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetConnectivityInfoInput"} + if s.ThingName == nil { + invalidParams.Add(request.NewErrParamRequired("ThingName")) + } + if s.ThingName != nil && len(*s.ThingName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ThingName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetThingName sets the ThingName field's value. +func (s *GetConnectivityInfoInput) SetThingName(v string) *GetConnectivityInfoInput { + s.ThingName = &v + return s +} + +// Information about a Greengrass core's connectivity. +type GetConnectivityInfoOutput struct { + _ struct{} `type:"structure"` + + // Connectivity info list. + ConnectivityInfo []*ConnectivityInfo `type:"list"` + + // A message about the connectivity info request. + Message *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s GetConnectivityInfoOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetConnectivityInfoOutput) GoString() string { + return s.String() +} + +// SetConnectivityInfo sets the ConnectivityInfo field's value. +func (s *GetConnectivityInfoOutput) SetConnectivityInfo(v []*ConnectivityInfo) *GetConnectivityInfoOutput { + s.ConnectivityInfo = v + return s +} + +// SetMessage sets the Message field's value. +func (s *GetConnectivityInfoOutput) SetMessage(v string) *GetConnectivityInfoOutput { + s.Message = &v + return s +} + +type GetConnectorDefinitionInput struct { + _ struct{} `type:"structure"` + + // ConnectorDefinitionId is a required field + ConnectorDefinitionId *string `location:"uri" locationName:"ConnectorDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetConnectorDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetConnectorDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetConnectorDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetConnectorDefinitionInput"} + if s.ConnectorDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("ConnectorDefinitionId")) + } + if s.ConnectorDefinitionId != nil && len(*s.ConnectorDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConnectorDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConnectorDefinitionId sets the ConnectorDefinitionId field's value. +func (s *GetConnectorDefinitionInput) SetConnectorDefinitionId(v string) *GetConnectorDefinitionInput { + s.ConnectorDefinitionId = &v + return s +} + +type GetConnectorDefinitionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s GetConnectorDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetConnectorDefinitionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetConnectorDefinitionOutput) SetArn(v string) *GetConnectorDefinitionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetConnectorDefinitionOutput) SetCreationTimestamp(v string) *GetConnectorDefinitionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *GetConnectorDefinitionOutput) SetId(v string) *GetConnectorDefinitionOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *GetConnectorDefinitionOutput) SetLastUpdatedTimestamp(v string) *GetConnectorDefinitionOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *GetConnectorDefinitionOutput) SetLatestVersion(v string) *GetConnectorDefinitionOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *GetConnectorDefinitionOutput) SetLatestVersionArn(v string) *GetConnectorDefinitionOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *GetConnectorDefinitionOutput) SetName(v string) *GetConnectorDefinitionOutput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *GetConnectorDefinitionOutput) SetTags(v map[string]*string) *GetConnectorDefinitionOutput { + s.Tags = v + return s +} + +type GetConnectorDefinitionVersionInput struct { + _ struct{} `type:"structure"` + + // ConnectorDefinitionId is a required field + ConnectorDefinitionId *string `location:"uri" locationName:"ConnectorDefinitionId" type:"string" required:"true"` + + // ConnectorDefinitionVersionId is a required field + ConnectorDefinitionVersionId *string `location:"uri" locationName:"ConnectorDefinitionVersionId" type:"string" required:"true"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s GetConnectorDefinitionVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetConnectorDefinitionVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetConnectorDefinitionVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetConnectorDefinitionVersionInput"} + if s.ConnectorDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("ConnectorDefinitionId")) + } + if s.ConnectorDefinitionId != nil && len(*s.ConnectorDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConnectorDefinitionId", 1)) + } + if s.ConnectorDefinitionVersionId == nil { + invalidParams.Add(request.NewErrParamRequired("ConnectorDefinitionVersionId")) + } + if s.ConnectorDefinitionVersionId != nil && len(*s.ConnectorDefinitionVersionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConnectorDefinitionVersionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConnectorDefinitionId sets the ConnectorDefinitionId field's value. +func (s *GetConnectorDefinitionVersionInput) SetConnectorDefinitionId(v string) *GetConnectorDefinitionVersionInput { + s.ConnectorDefinitionId = &v + return s +} + +// SetConnectorDefinitionVersionId sets the ConnectorDefinitionVersionId field's value. +func (s *GetConnectorDefinitionVersionInput) SetConnectorDefinitionVersionId(v string) *GetConnectorDefinitionVersionInput { + s.ConnectorDefinitionVersionId = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetConnectorDefinitionVersionInput) SetNextToken(v string) *GetConnectorDefinitionVersionInput { + s.NextToken = &v + return s +} + +// Information about a connector definition version. +type GetConnectorDefinitionVersionOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the connector definition version. + Arn *string `type:"string"` + + // The time, in milliseconds since the epoch, when the connector definition + // version was created. + CreationTimestamp *string `type:"string"` + + // Information about the connector definition version. + Definition *ConnectorDefinitionVersion `type:"structure"` + + // The ID of the connector definition version. + Id *string `type:"string"` + + // The token for the next set of results, or ''null'' if there are no additional + // results. + NextToken *string `type:"string"` + + // The version of the connector definition version. + Version *string `type:"string"` +} + +// String returns the string representation +func (s GetConnectorDefinitionVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetConnectorDefinitionVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetConnectorDefinitionVersionOutput) SetArn(v string) *GetConnectorDefinitionVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetConnectorDefinitionVersionOutput) SetCreationTimestamp(v string) *GetConnectorDefinitionVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetDefinition sets the Definition field's value. +func (s *GetConnectorDefinitionVersionOutput) SetDefinition(v *ConnectorDefinitionVersion) *GetConnectorDefinitionVersionOutput { + s.Definition = v + return s +} + +// SetId sets the Id field's value. +func (s *GetConnectorDefinitionVersionOutput) SetId(v string) *GetConnectorDefinitionVersionOutput { + s.Id = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetConnectorDefinitionVersionOutput) SetNextToken(v string) *GetConnectorDefinitionVersionOutput { + s.NextToken = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *GetConnectorDefinitionVersionOutput) SetVersion(v string) *GetConnectorDefinitionVersionOutput { + s.Version = &v + return s +} + +type GetCoreDefinitionInput struct { + _ struct{} `type:"structure"` + + // CoreDefinitionId is a required field + CoreDefinitionId *string `location:"uri" locationName:"CoreDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetCoreDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCoreDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetCoreDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetCoreDefinitionInput"} + if s.CoreDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("CoreDefinitionId")) + } + if s.CoreDefinitionId != nil && len(*s.CoreDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CoreDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCoreDefinitionId sets the CoreDefinitionId field's value. +func (s *GetCoreDefinitionInput) SetCoreDefinitionId(v string) *GetCoreDefinitionInput { + s.CoreDefinitionId = &v + return s +} + +type GetCoreDefinitionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s GetCoreDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCoreDefinitionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetCoreDefinitionOutput) SetArn(v string) *GetCoreDefinitionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetCoreDefinitionOutput) SetCreationTimestamp(v string) *GetCoreDefinitionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *GetCoreDefinitionOutput) SetId(v string) *GetCoreDefinitionOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *GetCoreDefinitionOutput) SetLastUpdatedTimestamp(v string) *GetCoreDefinitionOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *GetCoreDefinitionOutput) SetLatestVersion(v string) *GetCoreDefinitionOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *GetCoreDefinitionOutput) SetLatestVersionArn(v string) *GetCoreDefinitionOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *GetCoreDefinitionOutput) SetName(v string) *GetCoreDefinitionOutput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *GetCoreDefinitionOutput) SetTags(v map[string]*string) *GetCoreDefinitionOutput { + s.Tags = v + return s +} + +type GetCoreDefinitionVersionInput struct { + _ struct{} `type:"structure"` + + // CoreDefinitionId is a required field + CoreDefinitionId *string `location:"uri" locationName:"CoreDefinitionId" type:"string" required:"true"` + + // CoreDefinitionVersionId is a required field + CoreDefinitionVersionId *string `location:"uri" locationName:"CoreDefinitionVersionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetCoreDefinitionVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCoreDefinitionVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetCoreDefinitionVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetCoreDefinitionVersionInput"} + if s.CoreDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("CoreDefinitionId")) + } + if s.CoreDefinitionId != nil && len(*s.CoreDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CoreDefinitionId", 1)) + } + if s.CoreDefinitionVersionId == nil { + invalidParams.Add(request.NewErrParamRequired("CoreDefinitionVersionId")) + } + if s.CoreDefinitionVersionId != nil && len(*s.CoreDefinitionVersionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CoreDefinitionVersionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCoreDefinitionId sets the CoreDefinitionId field's value. +func (s *GetCoreDefinitionVersionInput) SetCoreDefinitionId(v string) *GetCoreDefinitionVersionInput { + s.CoreDefinitionId = &v + return s +} + +// SetCoreDefinitionVersionId sets the CoreDefinitionVersionId field's value. +func (s *GetCoreDefinitionVersionInput) SetCoreDefinitionVersionId(v string) *GetCoreDefinitionVersionInput { + s.CoreDefinitionVersionId = &v + return s +} + +type GetCoreDefinitionVersionOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the core definition version. + Arn *string `type:"string"` + + // The time, in milliseconds since the epoch, when the core definition version + // was created. + CreationTimestamp *string `type:"string"` + + // Information about the core definition version. + Definition *CoreDefinitionVersion `type:"structure"` + + // The ID of the core definition version. + Id *string `type:"string"` + + // The token for the next set of results, or ''null'' if there are no additional + // results. + NextToken *string `type:"string"` + + // The version of the core definition version. + Version *string `type:"string"` +} + +// String returns the string representation +func (s GetCoreDefinitionVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCoreDefinitionVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetCoreDefinitionVersionOutput) SetArn(v string) *GetCoreDefinitionVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetCoreDefinitionVersionOutput) SetCreationTimestamp(v string) *GetCoreDefinitionVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetDefinition sets the Definition field's value. +func (s *GetCoreDefinitionVersionOutput) SetDefinition(v *CoreDefinitionVersion) *GetCoreDefinitionVersionOutput { + s.Definition = v + return s +} + +// SetId sets the Id field's value. +func (s *GetCoreDefinitionVersionOutput) SetId(v string) *GetCoreDefinitionVersionOutput { + s.Id = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetCoreDefinitionVersionOutput) SetNextToken(v string) *GetCoreDefinitionVersionOutput { + s.NextToken = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *GetCoreDefinitionVersionOutput) SetVersion(v string) *GetCoreDefinitionVersionOutput { + s.Version = &v + return s +} + +type GetDeploymentStatusInput struct { + _ struct{} `type:"structure"` + + // DeploymentId is a required field + DeploymentId *string `location:"uri" locationName:"DeploymentId" type:"string" required:"true"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetDeploymentStatusInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDeploymentStatusInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetDeploymentStatusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetDeploymentStatusInput"} + if s.DeploymentId == nil { + invalidParams.Add(request.NewErrParamRequired("DeploymentId")) + } + if s.DeploymentId != nil && len(*s.DeploymentId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DeploymentId", 1)) + } + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDeploymentId sets the DeploymentId field's value. +func (s *GetDeploymentStatusInput) SetDeploymentId(v string) *GetDeploymentStatusInput { + s.DeploymentId = &v + return s +} + +// SetGroupId sets the GroupId field's value. +func (s *GetDeploymentStatusInput) SetGroupId(v string) *GetDeploymentStatusInput { + s.GroupId = &v + return s +} + +// Information about the status of a deployment for a group. +type GetDeploymentStatusOutput struct { + _ struct{} `type:"structure"` + + // The status of the deployment: ''InProgress'', ''Building'', ''Success'', + // or ''Failure''. + DeploymentStatus *string `type:"string"` + + // The type of the deployment. + DeploymentType *string `type:"string" enum:"DeploymentType"` + + // Error details + ErrorDetails []*ErrorDetail `type:"list"` + + // Error message + ErrorMessage *string `type:"string"` + + // The time, in milliseconds since the epoch, when the deployment status was + // updated. + UpdatedAt *string `type:"string"` +} + +// String returns the string representation +func (s GetDeploymentStatusOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDeploymentStatusOutput) GoString() string { + return s.String() +} + +// SetDeploymentStatus sets the DeploymentStatus field's value. +func (s *GetDeploymentStatusOutput) SetDeploymentStatus(v string) *GetDeploymentStatusOutput { + s.DeploymentStatus = &v + return s +} + +// SetDeploymentType sets the DeploymentType field's value. +func (s *GetDeploymentStatusOutput) SetDeploymentType(v string) *GetDeploymentStatusOutput { + s.DeploymentType = &v + return s +} + +// SetErrorDetails sets the ErrorDetails field's value. +func (s *GetDeploymentStatusOutput) SetErrorDetails(v []*ErrorDetail) *GetDeploymentStatusOutput { + s.ErrorDetails = v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *GetDeploymentStatusOutput) SetErrorMessage(v string) *GetDeploymentStatusOutput { + s.ErrorMessage = &v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *GetDeploymentStatusOutput) SetUpdatedAt(v string) *GetDeploymentStatusOutput { + s.UpdatedAt = &v + return s +} + +type GetDeviceDefinitionInput struct { + _ struct{} `type:"structure"` + + // DeviceDefinitionId is a required field + DeviceDefinitionId *string `location:"uri" locationName:"DeviceDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetDeviceDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDeviceDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetDeviceDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetDeviceDefinitionInput"} + if s.DeviceDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("DeviceDefinitionId")) + } + if s.DeviceDefinitionId != nil && len(*s.DeviceDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DeviceDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDeviceDefinitionId sets the DeviceDefinitionId field's value. +func (s *GetDeviceDefinitionInput) SetDeviceDefinitionId(v string) *GetDeviceDefinitionInput { + s.DeviceDefinitionId = &v + return s +} + +type GetDeviceDefinitionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s GetDeviceDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDeviceDefinitionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetDeviceDefinitionOutput) SetArn(v string) *GetDeviceDefinitionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetDeviceDefinitionOutput) SetCreationTimestamp(v string) *GetDeviceDefinitionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *GetDeviceDefinitionOutput) SetId(v string) *GetDeviceDefinitionOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *GetDeviceDefinitionOutput) SetLastUpdatedTimestamp(v string) *GetDeviceDefinitionOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *GetDeviceDefinitionOutput) SetLatestVersion(v string) *GetDeviceDefinitionOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *GetDeviceDefinitionOutput) SetLatestVersionArn(v string) *GetDeviceDefinitionOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *GetDeviceDefinitionOutput) SetName(v string) *GetDeviceDefinitionOutput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *GetDeviceDefinitionOutput) SetTags(v map[string]*string) *GetDeviceDefinitionOutput { + s.Tags = v + return s +} + +type GetDeviceDefinitionVersionInput struct { + _ struct{} `type:"structure"` + + // DeviceDefinitionId is a required field + DeviceDefinitionId *string `location:"uri" locationName:"DeviceDefinitionId" type:"string" required:"true"` + + // DeviceDefinitionVersionId is a required field + DeviceDefinitionVersionId *string `location:"uri" locationName:"DeviceDefinitionVersionId" type:"string" required:"true"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s GetDeviceDefinitionVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDeviceDefinitionVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetDeviceDefinitionVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetDeviceDefinitionVersionInput"} + if s.DeviceDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("DeviceDefinitionId")) + } + if s.DeviceDefinitionId != nil && len(*s.DeviceDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DeviceDefinitionId", 1)) + } + if s.DeviceDefinitionVersionId == nil { + invalidParams.Add(request.NewErrParamRequired("DeviceDefinitionVersionId")) + } + if s.DeviceDefinitionVersionId != nil && len(*s.DeviceDefinitionVersionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DeviceDefinitionVersionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDeviceDefinitionId sets the DeviceDefinitionId field's value. +func (s *GetDeviceDefinitionVersionInput) SetDeviceDefinitionId(v string) *GetDeviceDefinitionVersionInput { + s.DeviceDefinitionId = &v + return s +} + +// SetDeviceDefinitionVersionId sets the DeviceDefinitionVersionId field's value. +func (s *GetDeviceDefinitionVersionInput) SetDeviceDefinitionVersionId(v string) *GetDeviceDefinitionVersionInput { + s.DeviceDefinitionVersionId = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetDeviceDefinitionVersionInput) SetNextToken(v string) *GetDeviceDefinitionVersionInput { + s.NextToken = &v + return s +} + +type GetDeviceDefinitionVersionOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the device definition version. + Arn *string `type:"string"` + + // The time, in milliseconds since the epoch, when the device definition version + // was created. + CreationTimestamp *string `type:"string"` + + // Information about the device definition version. + Definition *DeviceDefinitionVersion `type:"structure"` + + // The ID of the device definition version. + Id *string `type:"string"` + + // The token for the next set of results, or ''null'' if there are no additional + // results. + NextToken *string `type:"string"` + + // The version of the device definition version. + Version *string `type:"string"` +} + +// String returns the string representation +func (s GetDeviceDefinitionVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDeviceDefinitionVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetDeviceDefinitionVersionOutput) SetArn(v string) *GetDeviceDefinitionVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetDeviceDefinitionVersionOutput) SetCreationTimestamp(v string) *GetDeviceDefinitionVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetDefinition sets the Definition field's value. +func (s *GetDeviceDefinitionVersionOutput) SetDefinition(v *DeviceDefinitionVersion) *GetDeviceDefinitionVersionOutput { + s.Definition = v + return s +} + +// SetId sets the Id field's value. +func (s *GetDeviceDefinitionVersionOutput) SetId(v string) *GetDeviceDefinitionVersionOutput { + s.Id = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetDeviceDefinitionVersionOutput) SetNextToken(v string) *GetDeviceDefinitionVersionOutput { + s.NextToken = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *GetDeviceDefinitionVersionOutput) SetVersion(v string) *GetDeviceDefinitionVersionOutput { + s.Version = &v + return s +} + +type GetFunctionDefinitionInput struct { + _ struct{} `type:"structure"` + + // FunctionDefinitionId is a required field + FunctionDefinitionId *string `location:"uri" locationName:"FunctionDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetFunctionDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFunctionDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetFunctionDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetFunctionDefinitionInput"} + if s.FunctionDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("FunctionDefinitionId")) + } + if s.FunctionDefinitionId != nil && len(*s.FunctionDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FunctionDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFunctionDefinitionId sets the FunctionDefinitionId field's value. +func (s *GetFunctionDefinitionInput) SetFunctionDefinitionId(v string) *GetFunctionDefinitionInput { + s.FunctionDefinitionId = &v + return s +} + +type GetFunctionDefinitionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s GetFunctionDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFunctionDefinitionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetFunctionDefinitionOutput) SetArn(v string) *GetFunctionDefinitionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetFunctionDefinitionOutput) SetCreationTimestamp(v string) *GetFunctionDefinitionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *GetFunctionDefinitionOutput) SetId(v string) *GetFunctionDefinitionOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *GetFunctionDefinitionOutput) SetLastUpdatedTimestamp(v string) *GetFunctionDefinitionOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *GetFunctionDefinitionOutput) SetLatestVersion(v string) *GetFunctionDefinitionOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *GetFunctionDefinitionOutput) SetLatestVersionArn(v string) *GetFunctionDefinitionOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *GetFunctionDefinitionOutput) SetName(v string) *GetFunctionDefinitionOutput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *GetFunctionDefinitionOutput) SetTags(v map[string]*string) *GetFunctionDefinitionOutput { + s.Tags = v + return s +} + +type GetFunctionDefinitionVersionInput struct { + _ struct{} `type:"structure"` + + // FunctionDefinitionId is a required field + FunctionDefinitionId *string `location:"uri" locationName:"FunctionDefinitionId" type:"string" required:"true"` + + // FunctionDefinitionVersionId is a required field + FunctionDefinitionVersionId *string `location:"uri" locationName:"FunctionDefinitionVersionId" type:"string" required:"true"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s GetFunctionDefinitionVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFunctionDefinitionVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetFunctionDefinitionVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetFunctionDefinitionVersionInput"} + if s.FunctionDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("FunctionDefinitionId")) + } + if s.FunctionDefinitionId != nil && len(*s.FunctionDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FunctionDefinitionId", 1)) + } + if s.FunctionDefinitionVersionId == nil { + invalidParams.Add(request.NewErrParamRequired("FunctionDefinitionVersionId")) + } + if s.FunctionDefinitionVersionId != nil && len(*s.FunctionDefinitionVersionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FunctionDefinitionVersionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFunctionDefinitionId sets the FunctionDefinitionId field's value. +func (s *GetFunctionDefinitionVersionInput) SetFunctionDefinitionId(v string) *GetFunctionDefinitionVersionInput { + s.FunctionDefinitionId = &v + return s +} + +// SetFunctionDefinitionVersionId sets the FunctionDefinitionVersionId field's value. +func (s *GetFunctionDefinitionVersionInput) SetFunctionDefinitionVersionId(v string) *GetFunctionDefinitionVersionInput { + s.FunctionDefinitionVersionId = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetFunctionDefinitionVersionInput) SetNextToken(v string) *GetFunctionDefinitionVersionInput { + s.NextToken = &v + return s +} + +// Information about a function definition version. +type GetFunctionDefinitionVersionOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the function definition version. + Arn *string `type:"string"` + + // The time, in milliseconds since the epoch, when the function definition version + // was created. + CreationTimestamp *string `type:"string"` + + // Information on the definition. + Definition *FunctionDefinitionVersion `type:"structure"` + + // The ID of the function definition version. + Id *string `type:"string"` + + // The token for the next set of results, or ''null'' if there are no additional + // results. + NextToken *string `type:"string"` + + // The version of the function definition version. + Version *string `type:"string"` +} + +// String returns the string representation +func (s GetFunctionDefinitionVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFunctionDefinitionVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetFunctionDefinitionVersionOutput) SetArn(v string) *GetFunctionDefinitionVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetFunctionDefinitionVersionOutput) SetCreationTimestamp(v string) *GetFunctionDefinitionVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetDefinition sets the Definition field's value. +func (s *GetFunctionDefinitionVersionOutput) SetDefinition(v *FunctionDefinitionVersion) *GetFunctionDefinitionVersionOutput { + s.Definition = v + return s +} + +// SetId sets the Id field's value. +func (s *GetFunctionDefinitionVersionOutput) SetId(v string) *GetFunctionDefinitionVersionOutput { + s.Id = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetFunctionDefinitionVersionOutput) SetNextToken(v string) *GetFunctionDefinitionVersionOutput { + s.NextToken = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *GetFunctionDefinitionVersionOutput) SetVersion(v string) *GetFunctionDefinitionVersionOutput { + s.Version = &v + return s +} + +type GetGroupCertificateAuthorityInput struct { + _ struct{} `type:"structure"` + + // CertificateAuthorityId is a required field + CertificateAuthorityId *string `location:"uri" locationName:"CertificateAuthorityId" type:"string" required:"true"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetGroupCertificateAuthorityInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupCertificateAuthorityInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetGroupCertificateAuthorityInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetGroupCertificateAuthorityInput"} + if s.CertificateAuthorityId == nil { + invalidParams.Add(request.NewErrParamRequired("CertificateAuthorityId")) + } + if s.CertificateAuthorityId != nil && len(*s.CertificateAuthorityId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CertificateAuthorityId", 1)) + } + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCertificateAuthorityId sets the CertificateAuthorityId field's value. +func (s *GetGroupCertificateAuthorityInput) SetCertificateAuthorityId(v string) *GetGroupCertificateAuthorityInput { + s.CertificateAuthorityId = &v + return s +} + +// SetGroupId sets the GroupId field's value. +func (s *GetGroupCertificateAuthorityInput) SetGroupId(v string) *GetGroupCertificateAuthorityInput { + s.GroupId = &v + return s +} + +// Information about a certificate authority for a group. +type GetGroupCertificateAuthorityOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the certificate authority for the group. + GroupCertificateAuthorityArn *string `type:"string"` + + // The ID of the certificate authority for the group. + GroupCertificateAuthorityId *string `type:"string"` + + // The PEM encoded certificate for the group. + PemEncodedCertificate *string `type:"string"` +} + +// String returns the string representation +func (s GetGroupCertificateAuthorityOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupCertificateAuthorityOutput) GoString() string { + return s.String() +} + +// SetGroupCertificateAuthorityArn sets the GroupCertificateAuthorityArn field's value. +func (s *GetGroupCertificateAuthorityOutput) SetGroupCertificateAuthorityArn(v string) *GetGroupCertificateAuthorityOutput { + s.GroupCertificateAuthorityArn = &v + return s +} + +// SetGroupCertificateAuthorityId sets the GroupCertificateAuthorityId field's value. +func (s *GetGroupCertificateAuthorityOutput) SetGroupCertificateAuthorityId(v string) *GetGroupCertificateAuthorityOutput { + s.GroupCertificateAuthorityId = &v + return s +} + +// SetPemEncodedCertificate sets the PemEncodedCertificate field's value. +func (s *GetGroupCertificateAuthorityOutput) SetPemEncodedCertificate(v string) *GetGroupCertificateAuthorityOutput { + s.PemEncodedCertificate = &v + return s +} + +type GetGroupCertificateConfigurationInput struct { + _ struct{} `type:"structure"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetGroupCertificateConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupCertificateConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetGroupCertificateConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetGroupCertificateConfigurationInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *GetGroupCertificateConfigurationInput) SetGroupId(v string) *GetGroupCertificateConfigurationInput { + s.GroupId = &v + return s +} + +type GetGroupCertificateConfigurationOutput struct { + _ struct{} `type:"structure"` + + CertificateAuthorityExpiryInMilliseconds *string `type:"string"` + + CertificateExpiryInMilliseconds *string `type:"string"` + + GroupId *string `type:"string"` +} + +// String returns the string representation +func (s GetGroupCertificateConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupCertificateConfigurationOutput) GoString() string { + return s.String() +} + +// SetCertificateAuthorityExpiryInMilliseconds sets the CertificateAuthorityExpiryInMilliseconds field's value. +func (s *GetGroupCertificateConfigurationOutput) SetCertificateAuthorityExpiryInMilliseconds(v string) *GetGroupCertificateConfigurationOutput { + s.CertificateAuthorityExpiryInMilliseconds = &v + return s +} + +// SetCertificateExpiryInMilliseconds sets the CertificateExpiryInMilliseconds field's value. +func (s *GetGroupCertificateConfigurationOutput) SetCertificateExpiryInMilliseconds(v string) *GetGroupCertificateConfigurationOutput { + s.CertificateExpiryInMilliseconds = &v + return s +} + +// SetGroupId sets the GroupId field's value. +func (s *GetGroupCertificateConfigurationOutput) SetGroupId(v string) *GetGroupCertificateConfigurationOutput { + s.GroupId = &v + return s +} + +type GetGroupInput struct { + _ struct{} `type:"structure"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` +} + +// 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.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *GetGroupInput) SetGroupId(v string) *GetGroupInput { + s.GroupId = &v + return s +} + +type GetGroupOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// 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() +} + +// SetArn sets the Arn field's value. +func (s *GetGroupOutput) SetArn(v string) *GetGroupOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetGroupOutput) SetCreationTimestamp(v string) *GetGroupOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *GetGroupOutput) SetId(v string) *GetGroupOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *GetGroupOutput) SetLastUpdatedTimestamp(v string) *GetGroupOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *GetGroupOutput) SetLatestVersion(v string) *GetGroupOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *GetGroupOutput) SetLatestVersionArn(v string) *GetGroupOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *GetGroupOutput) SetName(v string) *GetGroupOutput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *GetGroupOutput) SetTags(v map[string]*string) *GetGroupOutput { + s.Tags = v + return s +} + +type GetGroupVersionInput struct { + _ struct{} `type:"structure"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` + + // GroupVersionId is a required field + GroupVersionId *string `location:"uri" locationName:"GroupVersionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetGroupVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetGroupVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetGroupVersionInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + if s.GroupVersionId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupVersionId")) + } + if s.GroupVersionId != nil && len(*s.GroupVersionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupVersionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *GetGroupVersionInput) SetGroupId(v string) *GetGroupVersionInput { + s.GroupId = &v + return s +} + +// SetGroupVersionId sets the GroupVersionId field's value. +func (s *GetGroupVersionInput) SetGroupVersionId(v string) *GetGroupVersionInput { + s.GroupVersionId = &v + return s +} + +// Information about a group version. +type GetGroupVersionOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the group version. + Arn *string `type:"string"` + + // The time, in milliseconds since the epoch, when the group version was created. + CreationTimestamp *string `type:"string"` + + // Information about the group version definition. + Definition *GroupVersion `type:"structure"` + + // The ID of the group that the version is associated with. + Id *string `type:"string"` + + // The ID of the group version. + Version *string `type:"string"` +} + +// String returns the string representation +func (s GetGroupVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGroupVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetGroupVersionOutput) SetArn(v string) *GetGroupVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetGroupVersionOutput) SetCreationTimestamp(v string) *GetGroupVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetDefinition sets the Definition field's value. +func (s *GetGroupVersionOutput) SetDefinition(v *GroupVersion) *GetGroupVersionOutput { + s.Definition = v + return s +} + +// SetId sets the Id field's value. +func (s *GetGroupVersionOutput) SetId(v string) *GetGroupVersionOutput { + s.Id = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *GetGroupVersionOutput) SetVersion(v string) *GetGroupVersionOutput { + s.Version = &v + return s +} + +type GetLoggerDefinitionInput struct { + _ struct{} `type:"structure"` + + // LoggerDefinitionId is a required field + LoggerDefinitionId *string `location:"uri" locationName:"LoggerDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetLoggerDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetLoggerDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetLoggerDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetLoggerDefinitionInput"} + if s.LoggerDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("LoggerDefinitionId")) + } + if s.LoggerDefinitionId != nil && len(*s.LoggerDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LoggerDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoggerDefinitionId sets the LoggerDefinitionId field's value. +func (s *GetLoggerDefinitionInput) SetLoggerDefinitionId(v string) *GetLoggerDefinitionInput { + s.LoggerDefinitionId = &v + return s +} + +type GetLoggerDefinitionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s GetLoggerDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetLoggerDefinitionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetLoggerDefinitionOutput) SetArn(v string) *GetLoggerDefinitionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetLoggerDefinitionOutput) SetCreationTimestamp(v string) *GetLoggerDefinitionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *GetLoggerDefinitionOutput) SetId(v string) *GetLoggerDefinitionOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *GetLoggerDefinitionOutput) SetLastUpdatedTimestamp(v string) *GetLoggerDefinitionOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *GetLoggerDefinitionOutput) SetLatestVersion(v string) *GetLoggerDefinitionOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *GetLoggerDefinitionOutput) SetLatestVersionArn(v string) *GetLoggerDefinitionOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *GetLoggerDefinitionOutput) SetName(v string) *GetLoggerDefinitionOutput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *GetLoggerDefinitionOutput) SetTags(v map[string]*string) *GetLoggerDefinitionOutput { + s.Tags = v + return s +} + +type GetLoggerDefinitionVersionInput struct { + _ struct{} `type:"structure"` + + // LoggerDefinitionId is a required field + LoggerDefinitionId *string `location:"uri" locationName:"LoggerDefinitionId" type:"string" required:"true"` + + // LoggerDefinitionVersionId is a required field + LoggerDefinitionVersionId *string `location:"uri" locationName:"LoggerDefinitionVersionId" type:"string" required:"true"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s GetLoggerDefinitionVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetLoggerDefinitionVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetLoggerDefinitionVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetLoggerDefinitionVersionInput"} + if s.LoggerDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("LoggerDefinitionId")) + } + if s.LoggerDefinitionId != nil && len(*s.LoggerDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LoggerDefinitionId", 1)) + } + if s.LoggerDefinitionVersionId == nil { + invalidParams.Add(request.NewErrParamRequired("LoggerDefinitionVersionId")) + } + if s.LoggerDefinitionVersionId != nil && len(*s.LoggerDefinitionVersionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LoggerDefinitionVersionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoggerDefinitionId sets the LoggerDefinitionId field's value. +func (s *GetLoggerDefinitionVersionInput) SetLoggerDefinitionId(v string) *GetLoggerDefinitionVersionInput { + s.LoggerDefinitionId = &v + return s +} + +// SetLoggerDefinitionVersionId sets the LoggerDefinitionVersionId field's value. +func (s *GetLoggerDefinitionVersionInput) SetLoggerDefinitionVersionId(v string) *GetLoggerDefinitionVersionInput { + s.LoggerDefinitionVersionId = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetLoggerDefinitionVersionInput) SetNextToken(v string) *GetLoggerDefinitionVersionInput { + s.NextToken = &v + return s +} + +// Information about a logger definition version. +type GetLoggerDefinitionVersionOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the logger definition version. + Arn *string `type:"string"` + + // The time, in milliseconds since the epoch, when the logger definition version + // was created. + CreationTimestamp *string `type:"string"` + + // Information about the logger definition version. + Definition *LoggerDefinitionVersion `type:"structure"` + + // The ID of the logger definition version. + Id *string `type:"string"` + + // The version of the logger definition version. + Version *string `type:"string"` +} + +// String returns the string representation +func (s GetLoggerDefinitionVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetLoggerDefinitionVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetLoggerDefinitionVersionOutput) SetArn(v string) *GetLoggerDefinitionVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetLoggerDefinitionVersionOutput) SetCreationTimestamp(v string) *GetLoggerDefinitionVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetDefinition sets the Definition field's value. +func (s *GetLoggerDefinitionVersionOutput) SetDefinition(v *LoggerDefinitionVersion) *GetLoggerDefinitionVersionOutput { + s.Definition = v + return s +} + +// SetId sets the Id field's value. +func (s *GetLoggerDefinitionVersionOutput) SetId(v string) *GetLoggerDefinitionVersionOutput { + s.Id = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *GetLoggerDefinitionVersionOutput) SetVersion(v string) *GetLoggerDefinitionVersionOutput { + s.Version = &v + return s +} + +type GetResourceDefinitionInput struct { + _ struct{} `type:"structure"` + + // ResourceDefinitionId is a required field + ResourceDefinitionId *string `location:"uri" locationName:"ResourceDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetResourceDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetResourceDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetResourceDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetResourceDefinitionInput"} + if s.ResourceDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceDefinitionId")) + } + if s.ResourceDefinitionId != nil && len(*s.ResourceDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceDefinitionId sets the ResourceDefinitionId field's value. +func (s *GetResourceDefinitionInput) SetResourceDefinitionId(v string) *GetResourceDefinitionInput { + s.ResourceDefinitionId = &v + return s +} + +type GetResourceDefinitionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s GetResourceDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetResourceDefinitionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetResourceDefinitionOutput) SetArn(v string) *GetResourceDefinitionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetResourceDefinitionOutput) SetCreationTimestamp(v string) *GetResourceDefinitionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *GetResourceDefinitionOutput) SetId(v string) *GetResourceDefinitionOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *GetResourceDefinitionOutput) SetLastUpdatedTimestamp(v string) *GetResourceDefinitionOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *GetResourceDefinitionOutput) SetLatestVersion(v string) *GetResourceDefinitionOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *GetResourceDefinitionOutput) SetLatestVersionArn(v string) *GetResourceDefinitionOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *GetResourceDefinitionOutput) SetName(v string) *GetResourceDefinitionOutput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *GetResourceDefinitionOutput) SetTags(v map[string]*string) *GetResourceDefinitionOutput { + s.Tags = v + return s +} + +type GetResourceDefinitionVersionInput struct { + _ struct{} `type:"structure"` + + // ResourceDefinitionId is a required field + ResourceDefinitionId *string `location:"uri" locationName:"ResourceDefinitionId" type:"string" required:"true"` + + // ResourceDefinitionVersionId is a required field + ResourceDefinitionVersionId *string `location:"uri" locationName:"ResourceDefinitionVersionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetResourceDefinitionVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetResourceDefinitionVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetResourceDefinitionVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetResourceDefinitionVersionInput"} + if s.ResourceDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceDefinitionId")) + } + if s.ResourceDefinitionId != nil && len(*s.ResourceDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceDefinitionId", 1)) + } + if s.ResourceDefinitionVersionId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceDefinitionVersionId")) + } + if s.ResourceDefinitionVersionId != nil && len(*s.ResourceDefinitionVersionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceDefinitionVersionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceDefinitionId sets the ResourceDefinitionId field's value. +func (s *GetResourceDefinitionVersionInput) SetResourceDefinitionId(v string) *GetResourceDefinitionVersionInput { + s.ResourceDefinitionId = &v + return s +} + +// SetResourceDefinitionVersionId sets the ResourceDefinitionVersionId field's value. +func (s *GetResourceDefinitionVersionInput) SetResourceDefinitionVersionId(v string) *GetResourceDefinitionVersionInput { + s.ResourceDefinitionVersionId = &v + return s +} + +// Information about a resource definition version. +type GetResourceDefinitionVersionOutput struct { + _ struct{} `type:"structure"` + + // Arn of the resource definition version. + Arn *string `type:"string"` + + // The time, in milliseconds since the epoch, when the resource definition version + // was created. + CreationTimestamp *string `type:"string"` + + // Information about the definition. + Definition *ResourceDefinitionVersion `type:"structure"` + + // The ID of the resource definition version. + Id *string `type:"string"` + + // The version of the resource definition version. + Version *string `type:"string"` +} + +// String returns the string representation +func (s GetResourceDefinitionVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetResourceDefinitionVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetResourceDefinitionVersionOutput) SetArn(v string) *GetResourceDefinitionVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetResourceDefinitionVersionOutput) SetCreationTimestamp(v string) *GetResourceDefinitionVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetDefinition sets the Definition field's value. +func (s *GetResourceDefinitionVersionOutput) SetDefinition(v *ResourceDefinitionVersion) *GetResourceDefinitionVersionOutput { + s.Definition = v + return s +} + +// SetId sets the Id field's value. +func (s *GetResourceDefinitionVersionOutput) SetId(v string) *GetResourceDefinitionVersionOutput { + s.Id = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *GetResourceDefinitionVersionOutput) SetVersion(v string) *GetResourceDefinitionVersionOutput { + s.Version = &v + return s +} + +type GetServiceRoleForAccountInput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s GetServiceRoleForAccountInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetServiceRoleForAccountInput) GoString() string { + return s.String() +} + +type GetServiceRoleForAccountOutput struct { + _ struct{} `type:"structure"` + + // The time when the service role was associated with the account. + AssociatedAt *string `type:"string"` + + // The ARN of the role which is associated with the account. + RoleArn *string `type:"string"` +} + +// String returns the string representation +func (s GetServiceRoleForAccountOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetServiceRoleForAccountOutput) GoString() string { + return s.String() +} + +// SetAssociatedAt sets the AssociatedAt field's value. +func (s *GetServiceRoleForAccountOutput) SetAssociatedAt(v string) *GetServiceRoleForAccountOutput { + s.AssociatedAt = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *GetServiceRoleForAccountOutput) SetRoleArn(v string) *GetServiceRoleForAccountOutput { + s.RoleArn = &v + return s +} + +type GetSubscriptionDefinitionInput struct { + _ struct{} `type:"structure"` + + // SubscriptionDefinitionId is a required field + SubscriptionDefinitionId *string `location:"uri" locationName:"SubscriptionDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetSubscriptionDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSubscriptionDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetSubscriptionDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSubscriptionDefinitionInput"} + if s.SubscriptionDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("SubscriptionDefinitionId")) + } + if s.SubscriptionDefinitionId != nil && len(*s.SubscriptionDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SubscriptionDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSubscriptionDefinitionId sets the SubscriptionDefinitionId field's value. +func (s *GetSubscriptionDefinitionInput) SetSubscriptionDefinitionId(v string) *GetSubscriptionDefinitionInput { + s.SubscriptionDefinitionId = &v + return s +} + +type GetSubscriptionDefinitionOutput struct { + _ struct{} `type:"structure"` + + Arn *string `type:"string"` + + CreationTimestamp *string `type:"string"` + + Id *string `type:"string"` + + LastUpdatedTimestamp *string `type:"string"` + + LatestVersion *string `type:"string"` + + LatestVersionArn *string `type:"string"` + + Name *string `type:"string"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s GetSubscriptionDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSubscriptionDefinitionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetSubscriptionDefinitionOutput) SetArn(v string) *GetSubscriptionDefinitionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetSubscriptionDefinitionOutput) SetCreationTimestamp(v string) *GetSubscriptionDefinitionOutput { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *GetSubscriptionDefinitionOutput) SetId(v string) *GetSubscriptionDefinitionOutput { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *GetSubscriptionDefinitionOutput) SetLastUpdatedTimestamp(v string) *GetSubscriptionDefinitionOutput { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *GetSubscriptionDefinitionOutput) SetLatestVersion(v string) *GetSubscriptionDefinitionOutput { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *GetSubscriptionDefinitionOutput) SetLatestVersionArn(v string) *GetSubscriptionDefinitionOutput { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *GetSubscriptionDefinitionOutput) SetName(v string) *GetSubscriptionDefinitionOutput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *GetSubscriptionDefinitionOutput) SetTags(v map[string]*string) *GetSubscriptionDefinitionOutput { + s.Tags = v + return s +} + +type GetSubscriptionDefinitionVersionInput struct { + _ struct{} `type:"structure"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` + + // SubscriptionDefinitionId is a required field + SubscriptionDefinitionId *string `location:"uri" locationName:"SubscriptionDefinitionId" type:"string" required:"true"` + + // SubscriptionDefinitionVersionId is a required field + SubscriptionDefinitionVersionId *string `location:"uri" locationName:"SubscriptionDefinitionVersionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetSubscriptionDefinitionVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSubscriptionDefinitionVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetSubscriptionDefinitionVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSubscriptionDefinitionVersionInput"} + if s.SubscriptionDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("SubscriptionDefinitionId")) + } + if s.SubscriptionDefinitionId != nil && len(*s.SubscriptionDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SubscriptionDefinitionId", 1)) + } + if s.SubscriptionDefinitionVersionId == nil { + invalidParams.Add(request.NewErrParamRequired("SubscriptionDefinitionVersionId")) + } + if s.SubscriptionDefinitionVersionId != nil && len(*s.SubscriptionDefinitionVersionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SubscriptionDefinitionVersionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNextToken sets the NextToken field's value. +func (s *GetSubscriptionDefinitionVersionInput) SetNextToken(v string) *GetSubscriptionDefinitionVersionInput { + s.NextToken = &v + return s +} + +// SetSubscriptionDefinitionId sets the SubscriptionDefinitionId field's value. +func (s *GetSubscriptionDefinitionVersionInput) SetSubscriptionDefinitionId(v string) *GetSubscriptionDefinitionVersionInput { + s.SubscriptionDefinitionId = &v + return s +} + +// SetSubscriptionDefinitionVersionId sets the SubscriptionDefinitionVersionId field's value. +func (s *GetSubscriptionDefinitionVersionInput) SetSubscriptionDefinitionVersionId(v string) *GetSubscriptionDefinitionVersionInput { + s.SubscriptionDefinitionVersionId = &v + return s +} + +// Information about a subscription definition version. +type GetSubscriptionDefinitionVersionOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the subscription definition version. + Arn *string `type:"string"` + + // The time, in milliseconds since the epoch, when the subscription definition + // version was created. + CreationTimestamp *string `type:"string"` + + // Information about the subscription definition version. + Definition *SubscriptionDefinitionVersion `type:"structure"` + + // The ID of the subscription definition version. + Id *string `type:"string"` + + // The token for the next set of results, or ''null'' if there are no additional + // results. + NextToken *string `type:"string"` + + // The version of the subscription definition version. + Version *string `type:"string"` +} + +// String returns the string representation +func (s GetSubscriptionDefinitionVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSubscriptionDefinitionVersionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GetSubscriptionDefinitionVersionOutput) SetArn(v string) *GetSubscriptionDefinitionVersionOutput { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GetSubscriptionDefinitionVersionOutput) SetCreationTimestamp(v string) *GetSubscriptionDefinitionVersionOutput { + s.CreationTimestamp = &v + return s +} + +// SetDefinition sets the Definition field's value. +func (s *GetSubscriptionDefinitionVersionOutput) SetDefinition(v *SubscriptionDefinitionVersion) *GetSubscriptionDefinitionVersionOutput { + s.Definition = v + return s +} + +// SetId sets the Id field's value. +func (s *GetSubscriptionDefinitionVersionOutput) SetId(v string) *GetSubscriptionDefinitionVersionOutput { + s.Id = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *GetSubscriptionDefinitionVersionOutput) SetNextToken(v string) *GetSubscriptionDefinitionVersionOutput { + s.NextToken = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *GetSubscriptionDefinitionVersionOutput) SetVersion(v string) *GetSubscriptionDefinitionVersionOutput { + s.Version = &v + return s +} + +// Information about a certificate authority for a group. +type GroupCertificateAuthorityProperties struct { + _ struct{} `type:"structure"` + + // The ARN of the certificate authority for the group. + GroupCertificateAuthorityArn *string `type:"string"` + + // The ID of the certificate authority for the group. + GroupCertificateAuthorityId *string `type:"string"` +} + +// String returns the string representation +func (s GroupCertificateAuthorityProperties) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GroupCertificateAuthorityProperties) GoString() string { + return s.String() +} + +// SetGroupCertificateAuthorityArn sets the GroupCertificateAuthorityArn field's value. +func (s *GroupCertificateAuthorityProperties) SetGroupCertificateAuthorityArn(v string) *GroupCertificateAuthorityProperties { + s.GroupCertificateAuthorityArn = &v + return s +} + +// SetGroupCertificateAuthorityId sets the GroupCertificateAuthorityId field's value. +func (s *GroupCertificateAuthorityProperties) SetGroupCertificateAuthorityId(v string) *GroupCertificateAuthorityProperties { + s.GroupCertificateAuthorityId = &v + return s +} + +// Information about a group. +type GroupInformation struct { + _ struct{} `type:"structure"` + + // The ARN of the group. + Arn *string `type:"string"` + + // The time, in milliseconds since the epoch, when the group was created. + CreationTimestamp *string `type:"string"` + + // The ID of the group. + Id *string `type:"string"` + + // The time, in milliseconds since the epoch, when the group was last updated. + LastUpdatedTimestamp *string `type:"string"` + + // The ID of the latest version associated with the group. + LatestVersion *string `type:"string"` + + // The ARN of the latest version associated with the group. + LatestVersionArn *string `type:"string"` + + // The name of the group. + Name *string `type:"string"` +} + +// String returns the string representation +func (s GroupInformation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GroupInformation) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GroupInformation) SetArn(v string) *GroupInformation { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *GroupInformation) SetCreationTimestamp(v string) *GroupInformation { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *GroupInformation) SetId(v string) *GroupInformation { + s.Id = &v + return s +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *GroupInformation) SetLastUpdatedTimestamp(v string) *GroupInformation { + s.LastUpdatedTimestamp = &v + return s +} + +// SetLatestVersion sets the LatestVersion field's value. +func (s *GroupInformation) SetLatestVersion(v string) *GroupInformation { + s.LatestVersion = &v + return s +} + +// SetLatestVersionArn sets the LatestVersionArn field's value. +func (s *GroupInformation) SetLatestVersionArn(v string) *GroupInformation { + s.LatestVersionArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *GroupInformation) SetName(v string) *GroupInformation { + s.Name = &v + return s +} + +// Group owner related settings for local resources. +type GroupOwnerSetting struct { + _ struct{} `type:"structure"` + + // If true, AWS IoT Greengrass automatically adds the specified Linux OS group + // owner of the resource to the Lambda process privileges. Thus the Lambda process + // will have the file access permissions of the added Linux group. + AutoAddGroupOwner *bool `type:"boolean"` + + // The name of the Linux OS group whose privileges will be added to the Lambda + // process. This field is optional. + GroupOwner *string `type:"string"` +} + +// String returns the string representation +func (s GroupOwnerSetting) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GroupOwnerSetting) GoString() string { + return s.String() +} + +// SetAutoAddGroupOwner sets the AutoAddGroupOwner field's value. +func (s *GroupOwnerSetting) SetAutoAddGroupOwner(v bool) *GroupOwnerSetting { + s.AutoAddGroupOwner = &v + return s +} + +// SetGroupOwner sets the GroupOwner field's value. +func (s *GroupOwnerSetting) SetGroupOwner(v string) *GroupOwnerSetting { + s.GroupOwner = &v + return s +} + +// Information about a group version. +type GroupVersion struct { + _ struct{} `type:"structure"` + + // The ARN of the connector definition version for this group. + ConnectorDefinitionVersionArn *string `type:"string"` + + // The ARN of the core definition version for this group. + CoreDefinitionVersionArn *string `type:"string"` + + // The ARN of the device definition version for this group. + DeviceDefinitionVersionArn *string `type:"string"` + + // The ARN of the function definition version for this group. + FunctionDefinitionVersionArn *string `type:"string"` + + // The ARN of the logger definition version for this group. + LoggerDefinitionVersionArn *string `type:"string"` + + // The ARN of the resource definition version for this group. + ResourceDefinitionVersionArn *string `type:"string"` + + // The ARN of the subscription definition version for this group. + SubscriptionDefinitionVersionArn *string `type:"string"` +} + +// String returns the string representation +func (s GroupVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GroupVersion) GoString() string { + return s.String() +} + +// SetConnectorDefinitionVersionArn sets the ConnectorDefinitionVersionArn field's value. +func (s *GroupVersion) SetConnectorDefinitionVersionArn(v string) *GroupVersion { + s.ConnectorDefinitionVersionArn = &v + return s +} + +// SetCoreDefinitionVersionArn sets the CoreDefinitionVersionArn field's value. +func (s *GroupVersion) SetCoreDefinitionVersionArn(v string) *GroupVersion { + s.CoreDefinitionVersionArn = &v + return s +} + +// SetDeviceDefinitionVersionArn sets the DeviceDefinitionVersionArn field's value. +func (s *GroupVersion) SetDeviceDefinitionVersionArn(v string) *GroupVersion { + s.DeviceDefinitionVersionArn = &v + return s +} + +// SetFunctionDefinitionVersionArn sets the FunctionDefinitionVersionArn field's value. +func (s *GroupVersion) SetFunctionDefinitionVersionArn(v string) *GroupVersion { + s.FunctionDefinitionVersionArn = &v + return s +} + +// SetLoggerDefinitionVersionArn sets the LoggerDefinitionVersionArn field's value. +func (s *GroupVersion) SetLoggerDefinitionVersionArn(v string) *GroupVersion { + s.LoggerDefinitionVersionArn = &v + return s +} + +// SetResourceDefinitionVersionArn sets the ResourceDefinitionVersionArn field's value. +func (s *GroupVersion) SetResourceDefinitionVersionArn(v string) *GroupVersion { + s.ResourceDefinitionVersionArn = &v + return s +} + +// SetSubscriptionDefinitionVersionArn sets the SubscriptionDefinitionVersionArn field's value. +func (s *GroupVersion) SetSubscriptionDefinitionVersionArn(v string) *GroupVersion { + s.SubscriptionDefinitionVersionArn = &v + return s +} + +// General error information. +type InternalServerErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A list of error details. + ErrorDetails []*ErrorDetail `type:"list"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalServerErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerErrorException) GoString() string { + return s.String() +} + +func newErrorInternalServerErrorException(v protocol.ResponseMetadata) error { + return &InternalServerErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerErrorException) Code() string { + return "InternalServerErrorException" +} + +// Message returns the exception's message. +func (s InternalServerErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerErrorException) OrigErr() error { + return nil +} + +func (s InternalServerErrorException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +type ListBulkDeploymentDetailedReportsInput struct { + _ struct{} `type:"structure"` + + // BulkDeploymentId is a required field + BulkDeploymentId *string `location:"uri" locationName:"BulkDeploymentId" type:"string" required:"true"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s ListBulkDeploymentDetailedReportsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListBulkDeploymentDetailedReportsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListBulkDeploymentDetailedReportsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListBulkDeploymentDetailedReportsInput"} + if s.BulkDeploymentId == nil { + invalidParams.Add(request.NewErrParamRequired("BulkDeploymentId")) + } + if s.BulkDeploymentId != nil && len(*s.BulkDeploymentId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("BulkDeploymentId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBulkDeploymentId sets the BulkDeploymentId field's value. +func (s *ListBulkDeploymentDetailedReportsInput) SetBulkDeploymentId(v string) *ListBulkDeploymentDetailedReportsInput { + s.BulkDeploymentId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListBulkDeploymentDetailedReportsInput) SetMaxResults(v string) *ListBulkDeploymentDetailedReportsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListBulkDeploymentDetailedReportsInput) SetNextToken(v string) *ListBulkDeploymentDetailedReportsInput { + s.NextToken = &v + return s +} + +type ListBulkDeploymentDetailedReportsOutput struct { + _ struct{} `type:"structure"` + + // A list of the individual group deployments in the bulk deployment operation. + Deployments []*BulkDeploymentResult `type:"list"` + + // The token for the next set of results, or ''null'' if there are no additional + // results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListBulkDeploymentDetailedReportsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListBulkDeploymentDetailedReportsOutput) GoString() string { + return s.String() +} + +// SetDeployments sets the Deployments field's value. +func (s *ListBulkDeploymentDetailedReportsOutput) SetDeployments(v []*BulkDeploymentResult) *ListBulkDeploymentDetailedReportsOutput { + s.Deployments = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListBulkDeploymentDetailedReportsOutput) SetNextToken(v string) *ListBulkDeploymentDetailedReportsOutput { + s.NextToken = &v + return s +} + +type ListBulkDeploymentsInput struct { + _ struct{} `type:"structure"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s ListBulkDeploymentsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListBulkDeploymentsInput) GoString() string { + return s.String() +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListBulkDeploymentsInput) SetMaxResults(v string) *ListBulkDeploymentsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListBulkDeploymentsInput) SetNextToken(v string) *ListBulkDeploymentsInput { + s.NextToken = &v + return s +} + +type ListBulkDeploymentsOutput struct { + _ struct{} `type:"structure"` + + // A list of bulk deployments. + BulkDeployments []*BulkDeployment `type:"list"` + + // The token for the next set of results, or ''null'' if there are no additional + // results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListBulkDeploymentsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListBulkDeploymentsOutput) GoString() string { + return s.String() +} + +// SetBulkDeployments sets the BulkDeployments field's value. +func (s *ListBulkDeploymentsOutput) SetBulkDeployments(v []*BulkDeployment) *ListBulkDeploymentsOutput { + s.BulkDeployments = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListBulkDeploymentsOutput) SetNextToken(v string) *ListBulkDeploymentsOutput { + s.NextToken = &v + return s +} + +type ListConnectorDefinitionVersionsInput struct { + _ struct{} `type:"structure"` + + // ConnectorDefinitionId is a required field + ConnectorDefinitionId *string `location:"uri" locationName:"ConnectorDefinitionId" type:"string" required:"true"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s ListConnectorDefinitionVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListConnectorDefinitionVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListConnectorDefinitionVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListConnectorDefinitionVersionsInput"} + if s.ConnectorDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("ConnectorDefinitionId")) + } + if s.ConnectorDefinitionId != nil && len(*s.ConnectorDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConnectorDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConnectorDefinitionId sets the ConnectorDefinitionId field's value. +func (s *ListConnectorDefinitionVersionsInput) SetConnectorDefinitionId(v string) *ListConnectorDefinitionVersionsInput { + s.ConnectorDefinitionId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListConnectorDefinitionVersionsInput) SetMaxResults(v string) *ListConnectorDefinitionVersionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListConnectorDefinitionVersionsInput) SetNextToken(v string) *ListConnectorDefinitionVersionsInput { + s.NextToken = &v + return s +} + +type ListConnectorDefinitionVersionsOutput struct { + _ struct{} `type:"structure"` + + NextToken *string `type:"string"` + + Versions []*VersionInformation `type:"list"` +} + +// String returns the string representation +func (s ListConnectorDefinitionVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListConnectorDefinitionVersionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListConnectorDefinitionVersionsOutput) SetNextToken(v string) *ListConnectorDefinitionVersionsOutput { + s.NextToken = &v + return s +} + +// SetVersions sets the Versions field's value. +func (s *ListConnectorDefinitionVersionsOutput) SetVersions(v []*VersionInformation) *ListConnectorDefinitionVersionsOutput { + s.Versions = v + return s +} + +type ListConnectorDefinitionsInput struct { + _ struct{} `type:"structure"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s ListConnectorDefinitionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListConnectorDefinitionsInput) GoString() string { + return s.String() +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListConnectorDefinitionsInput) SetMaxResults(v string) *ListConnectorDefinitionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListConnectorDefinitionsInput) SetNextToken(v string) *ListConnectorDefinitionsInput { + s.NextToken = &v + return s +} + +type ListConnectorDefinitionsOutput struct { + _ struct{} `type:"structure"` + + Definitions []*DefinitionInformation `type:"list"` + + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListConnectorDefinitionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListConnectorDefinitionsOutput) GoString() string { + return s.String() +} + +// SetDefinitions sets the Definitions field's value. +func (s *ListConnectorDefinitionsOutput) SetDefinitions(v []*DefinitionInformation) *ListConnectorDefinitionsOutput { + s.Definitions = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListConnectorDefinitionsOutput) SetNextToken(v string) *ListConnectorDefinitionsOutput { + s.NextToken = &v + return s +} + +type ListCoreDefinitionVersionsInput struct { + _ struct{} `type:"structure"` + + // CoreDefinitionId is a required field + CoreDefinitionId *string `location:"uri" locationName:"CoreDefinitionId" type:"string" required:"true"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s ListCoreDefinitionVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListCoreDefinitionVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListCoreDefinitionVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListCoreDefinitionVersionsInput"} + if s.CoreDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("CoreDefinitionId")) + } + if s.CoreDefinitionId != nil && len(*s.CoreDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CoreDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCoreDefinitionId sets the CoreDefinitionId field's value. +func (s *ListCoreDefinitionVersionsInput) SetCoreDefinitionId(v string) *ListCoreDefinitionVersionsInput { + s.CoreDefinitionId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListCoreDefinitionVersionsInput) SetMaxResults(v string) *ListCoreDefinitionVersionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListCoreDefinitionVersionsInput) SetNextToken(v string) *ListCoreDefinitionVersionsInput { + s.NextToken = &v + return s +} + +type ListCoreDefinitionVersionsOutput struct { + _ struct{} `type:"structure"` + + NextToken *string `type:"string"` + + Versions []*VersionInformation `type:"list"` +} + +// String returns the string representation +func (s ListCoreDefinitionVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListCoreDefinitionVersionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListCoreDefinitionVersionsOutput) SetNextToken(v string) *ListCoreDefinitionVersionsOutput { + s.NextToken = &v + return s +} + +// SetVersions sets the Versions field's value. +func (s *ListCoreDefinitionVersionsOutput) SetVersions(v []*VersionInformation) *ListCoreDefinitionVersionsOutput { + s.Versions = v + return s +} + +type ListCoreDefinitionsInput struct { + _ struct{} `type:"structure"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s ListCoreDefinitionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListCoreDefinitionsInput) GoString() string { + return s.String() +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListCoreDefinitionsInput) SetMaxResults(v string) *ListCoreDefinitionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListCoreDefinitionsInput) SetNextToken(v string) *ListCoreDefinitionsInput { + s.NextToken = &v + return s +} + +type ListCoreDefinitionsOutput struct { + _ struct{} `type:"structure"` + + Definitions []*DefinitionInformation `type:"list"` + + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListCoreDefinitionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListCoreDefinitionsOutput) GoString() string { + return s.String() +} + +// SetDefinitions sets the Definitions field's value. +func (s *ListCoreDefinitionsOutput) SetDefinitions(v []*DefinitionInformation) *ListCoreDefinitionsOutput { + s.Definitions = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListCoreDefinitionsOutput) SetNextToken(v string) *ListCoreDefinitionsOutput { + s.NextToken = &v + return s +} + +type ListDeploymentsInput struct { + _ struct{} `type:"structure"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" 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.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *ListDeploymentsInput) SetGroupId(v string) *ListDeploymentsInput { + s.GroupId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListDeploymentsInput) SetMaxResults(v string) *ListDeploymentsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDeploymentsInput) SetNextToken(v string) *ListDeploymentsInput { + s.NextToken = &v + return s +} + +type ListDeploymentsOutput struct { + _ struct{} `type:"structure"` + + // A list of deployments for the requested groups. + Deployments []*Deployment `type:"list"` + + // The token for the next set of results, or ''null'' if there are no additional + // results. + NextToken *string `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 []*Deployment) *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 +} + +type ListDeviceDefinitionVersionsInput struct { + _ struct{} `type:"structure"` + + // DeviceDefinitionId is a required field + DeviceDefinitionId *string `location:"uri" locationName:"DeviceDefinitionId" type:"string" required:"true"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s ListDeviceDefinitionVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDeviceDefinitionVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListDeviceDefinitionVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListDeviceDefinitionVersionsInput"} + if s.DeviceDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("DeviceDefinitionId")) + } + if s.DeviceDefinitionId != nil && len(*s.DeviceDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DeviceDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDeviceDefinitionId sets the DeviceDefinitionId field's value. +func (s *ListDeviceDefinitionVersionsInput) SetDeviceDefinitionId(v string) *ListDeviceDefinitionVersionsInput { + s.DeviceDefinitionId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListDeviceDefinitionVersionsInput) SetMaxResults(v string) *ListDeviceDefinitionVersionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDeviceDefinitionVersionsInput) SetNextToken(v string) *ListDeviceDefinitionVersionsInput { + s.NextToken = &v + return s +} + +type ListDeviceDefinitionVersionsOutput struct { + _ struct{} `type:"structure"` + + NextToken *string `type:"string"` + + Versions []*VersionInformation `type:"list"` +} + +// String returns the string representation +func (s ListDeviceDefinitionVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDeviceDefinitionVersionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDeviceDefinitionVersionsOutput) SetNextToken(v string) *ListDeviceDefinitionVersionsOutput { + s.NextToken = &v + return s +} + +// SetVersions sets the Versions field's value. +func (s *ListDeviceDefinitionVersionsOutput) SetVersions(v []*VersionInformation) *ListDeviceDefinitionVersionsOutput { + s.Versions = v + return s +} + +type ListDeviceDefinitionsInput struct { + _ struct{} `type:"structure"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s ListDeviceDefinitionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDeviceDefinitionsInput) GoString() string { + return s.String() +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListDeviceDefinitionsInput) SetMaxResults(v string) *ListDeviceDefinitionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDeviceDefinitionsInput) SetNextToken(v string) *ListDeviceDefinitionsInput { + s.NextToken = &v + return s +} + +type ListDeviceDefinitionsOutput struct { + _ struct{} `type:"structure"` + + Definitions []*DefinitionInformation `type:"list"` + + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListDeviceDefinitionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDeviceDefinitionsOutput) GoString() string { + return s.String() +} + +// SetDefinitions sets the Definitions field's value. +func (s *ListDeviceDefinitionsOutput) SetDefinitions(v []*DefinitionInformation) *ListDeviceDefinitionsOutput { + s.Definitions = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDeviceDefinitionsOutput) SetNextToken(v string) *ListDeviceDefinitionsOutput { + s.NextToken = &v + return s +} + +type ListFunctionDefinitionVersionsInput struct { + _ struct{} `type:"structure"` + + // FunctionDefinitionId is a required field + FunctionDefinitionId *string `location:"uri" locationName:"FunctionDefinitionId" type:"string" required:"true"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s ListFunctionDefinitionVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListFunctionDefinitionVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListFunctionDefinitionVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListFunctionDefinitionVersionsInput"} + if s.FunctionDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("FunctionDefinitionId")) + } + if s.FunctionDefinitionId != nil && len(*s.FunctionDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FunctionDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFunctionDefinitionId sets the FunctionDefinitionId field's value. +func (s *ListFunctionDefinitionVersionsInput) SetFunctionDefinitionId(v string) *ListFunctionDefinitionVersionsInput { + s.FunctionDefinitionId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListFunctionDefinitionVersionsInput) SetMaxResults(v string) *ListFunctionDefinitionVersionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListFunctionDefinitionVersionsInput) SetNextToken(v string) *ListFunctionDefinitionVersionsInput { + s.NextToken = &v + return s +} + +type ListFunctionDefinitionVersionsOutput struct { + _ struct{} `type:"structure"` + + NextToken *string `type:"string"` + + Versions []*VersionInformation `type:"list"` +} + +// String returns the string representation +func (s ListFunctionDefinitionVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListFunctionDefinitionVersionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListFunctionDefinitionVersionsOutput) SetNextToken(v string) *ListFunctionDefinitionVersionsOutput { + s.NextToken = &v + return s +} + +// SetVersions sets the Versions field's value. +func (s *ListFunctionDefinitionVersionsOutput) SetVersions(v []*VersionInformation) *ListFunctionDefinitionVersionsOutput { + s.Versions = v + return s +} + +type ListFunctionDefinitionsInput struct { + _ struct{} `type:"structure"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s ListFunctionDefinitionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListFunctionDefinitionsInput) GoString() string { + return s.String() +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListFunctionDefinitionsInput) SetMaxResults(v string) *ListFunctionDefinitionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListFunctionDefinitionsInput) SetNextToken(v string) *ListFunctionDefinitionsInput { + s.NextToken = &v + return s +} + +type ListFunctionDefinitionsOutput struct { + _ struct{} `type:"structure"` + + Definitions []*DefinitionInformation `type:"list"` + + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListFunctionDefinitionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListFunctionDefinitionsOutput) GoString() string { + return s.String() +} + +// SetDefinitions sets the Definitions field's value. +func (s *ListFunctionDefinitionsOutput) SetDefinitions(v []*DefinitionInformation) *ListFunctionDefinitionsOutput { + s.Definitions = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListFunctionDefinitionsOutput) SetNextToken(v string) *ListFunctionDefinitionsOutput { + s.NextToken = &v + return s +} + +type ListGroupCertificateAuthoritiesInput struct { + _ struct{} `type:"structure"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListGroupCertificateAuthoritiesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGroupCertificateAuthoritiesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListGroupCertificateAuthoritiesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListGroupCertificateAuthoritiesInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *ListGroupCertificateAuthoritiesInput) SetGroupId(v string) *ListGroupCertificateAuthoritiesInput { + s.GroupId = &v + return s +} + +type ListGroupCertificateAuthoritiesOutput struct { + _ struct{} `type:"structure"` + + // A list of certificate authorities associated with the group. + GroupCertificateAuthorities []*GroupCertificateAuthorityProperties `type:"list"` +} + +// String returns the string representation +func (s ListGroupCertificateAuthoritiesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGroupCertificateAuthoritiesOutput) GoString() string { + return s.String() +} + +// SetGroupCertificateAuthorities sets the GroupCertificateAuthorities field's value. +func (s *ListGroupCertificateAuthoritiesOutput) SetGroupCertificateAuthorities(v []*GroupCertificateAuthorityProperties) *ListGroupCertificateAuthoritiesOutput { + s.GroupCertificateAuthorities = v + return s +} + +type ListGroupVersionsInput struct { + _ struct{} `type:"structure"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s ListGroupVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGroupVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListGroupVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListGroupVersionsInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *ListGroupVersionsInput) SetGroupId(v string) *ListGroupVersionsInput { + s.GroupId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListGroupVersionsInput) SetMaxResults(v string) *ListGroupVersionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListGroupVersionsInput) SetNextToken(v string) *ListGroupVersionsInput { + s.NextToken = &v + return s +} + +type ListGroupVersionsOutput struct { + _ struct{} `type:"structure"` + + NextToken *string `type:"string"` + + Versions []*VersionInformation `type:"list"` +} + +// String returns the string representation +func (s ListGroupVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGroupVersionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListGroupVersionsOutput) SetNextToken(v string) *ListGroupVersionsOutput { + s.NextToken = &v + return s +} + +// SetVersions sets the Versions field's value. +func (s *ListGroupVersionsOutput) SetVersions(v []*VersionInformation) *ListGroupVersionsOutput { + s.Versions = v + return s +} + +type ListGroupsInput struct { + _ struct{} `type:"structure"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" 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() +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListGroupsInput) SetMaxResults(v string) *ListGroupsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListGroupsInput) SetNextToken(v string) *ListGroupsInput { + s.NextToken = &v + return s +} + +type ListGroupsOutput struct { + _ struct{} `type:"structure"` + + // Information about a group. + Groups []*GroupInformation `type:"list"` + + // The token for the next set of results, or ''null'' if there are no additional + // results. + NextToken *string `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 []*GroupInformation) *ListGroupsOutput { + s.Groups = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListGroupsOutput) SetNextToken(v string) *ListGroupsOutput { + s.NextToken = &v + return s +} + +type ListLoggerDefinitionVersionsInput struct { + _ struct{} `type:"structure"` + + // LoggerDefinitionId is a required field + LoggerDefinitionId *string `location:"uri" locationName:"LoggerDefinitionId" type:"string" required:"true"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s ListLoggerDefinitionVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListLoggerDefinitionVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListLoggerDefinitionVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListLoggerDefinitionVersionsInput"} + if s.LoggerDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("LoggerDefinitionId")) + } + if s.LoggerDefinitionId != nil && len(*s.LoggerDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LoggerDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoggerDefinitionId sets the LoggerDefinitionId field's value. +func (s *ListLoggerDefinitionVersionsInput) SetLoggerDefinitionId(v string) *ListLoggerDefinitionVersionsInput { + s.LoggerDefinitionId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListLoggerDefinitionVersionsInput) SetMaxResults(v string) *ListLoggerDefinitionVersionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListLoggerDefinitionVersionsInput) SetNextToken(v string) *ListLoggerDefinitionVersionsInput { + s.NextToken = &v + return s +} + +type ListLoggerDefinitionVersionsOutput struct { + _ struct{} `type:"structure"` + + NextToken *string `type:"string"` + + Versions []*VersionInformation `type:"list"` +} + +// String returns the string representation +func (s ListLoggerDefinitionVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListLoggerDefinitionVersionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListLoggerDefinitionVersionsOutput) SetNextToken(v string) *ListLoggerDefinitionVersionsOutput { + s.NextToken = &v + return s +} + +// SetVersions sets the Versions field's value. +func (s *ListLoggerDefinitionVersionsOutput) SetVersions(v []*VersionInformation) *ListLoggerDefinitionVersionsOutput { + s.Versions = v + return s +} + +type ListLoggerDefinitionsInput struct { + _ struct{} `type:"structure"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s ListLoggerDefinitionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListLoggerDefinitionsInput) GoString() string { + return s.String() +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListLoggerDefinitionsInput) SetMaxResults(v string) *ListLoggerDefinitionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListLoggerDefinitionsInput) SetNextToken(v string) *ListLoggerDefinitionsInput { + s.NextToken = &v + return s +} + +type ListLoggerDefinitionsOutput struct { + _ struct{} `type:"structure"` + + Definitions []*DefinitionInformation `type:"list"` + + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListLoggerDefinitionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListLoggerDefinitionsOutput) GoString() string { + return s.String() +} + +// SetDefinitions sets the Definitions field's value. +func (s *ListLoggerDefinitionsOutput) SetDefinitions(v []*DefinitionInformation) *ListLoggerDefinitionsOutput { + s.Definitions = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListLoggerDefinitionsOutput) SetNextToken(v string) *ListLoggerDefinitionsOutput { + s.NextToken = &v + return s +} + +type ListResourceDefinitionVersionsInput struct { + _ struct{} `type:"structure"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` + + // ResourceDefinitionId is a required field + ResourceDefinitionId *string `location:"uri" locationName:"ResourceDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListResourceDefinitionVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourceDefinitionVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListResourceDefinitionVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListResourceDefinitionVersionsInput"} + if s.ResourceDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceDefinitionId")) + } + if s.ResourceDefinitionId != nil && len(*s.ResourceDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListResourceDefinitionVersionsInput) SetMaxResults(v string) *ListResourceDefinitionVersionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListResourceDefinitionVersionsInput) SetNextToken(v string) *ListResourceDefinitionVersionsInput { + s.NextToken = &v + return s +} + +// SetResourceDefinitionId sets the ResourceDefinitionId field's value. +func (s *ListResourceDefinitionVersionsInput) SetResourceDefinitionId(v string) *ListResourceDefinitionVersionsInput { + s.ResourceDefinitionId = &v + return s +} + +type ListResourceDefinitionVersionsOutput struct { + _ struct{} `type:"structure"` + + NextToken *string `type:"string"` + + Versions []*VersionInformation `type:"list"` +} + +// String returns the string representation +func (s ListResourceDefinitionVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourceDefinitionVersionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListResourceDefinitionVersionsOutput) SetNextToken(v string) *ListResourceDefinitionVersionsOutput { + s.NextToken = &v + return s +} + +// SetVersions sets the Versions field's value. +func (s *ListResourceDefinitionVersionsOutput) SetVersions(v []*VersionInformation) *ListResourceDefinitionVersionsOutput { + s.Versions = v + return s +} + +type ListResourceDefinitionsInput struct { + _ struct{} `type:"structure"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s ListResourceDefinitionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourceDefinitionsInput) GoString() string { + return s.String() +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListResourceDefinitionsInput) SetMaxResults(v string) *ListResourceDefinitionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListResourceDefinitionsInput) SetNextToken(v string) *ListResourceDefinitionsInput { + s.NextToken = &v + return s +} + +type ListResourceDefinitionsOutput struct { + _ struct{} `type:"structure"` + + Definitions []*DefinitionInformation `type:"list"` + + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListResourceDefinitionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourceDefinitionsOutput) GoString() string { + return s.String() +} + +// SetDefinitions sets the Definitions field's value. +func (s *ListResourceDefinitionsOutput) SetDefinitions(v []*DefinitionInformation) *ListResourceDefinitionsOutput { + s.Definitions = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListResourceDefinitionsOutput) SetNextToken(v string) *ListResourceDefinitionsOutput { + s.NextToken = &v + return s +} + +type ListSubscriptionDefinitionVersionsInput struct { + _ struct{} `type:"structure"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` + + // SubscriptionDefinitionId is a required field + SubscriptionDefinitionId *string `location:"uri" locationName:"SubscriptionDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListSubscriptionDefinitionVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListSubscriptionDefinitionVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListSubscriptionDefinitionVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListSubscriptionDefinitionVersionsInput"} + if s.SubscriptionDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("SubscriptionDefinitionId")) + } + if s.SubscriptionDefinitionId != nil && len(*s.SubscriptionDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SubscriptionDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListSubscriptionDefinitionVersionsInput) SetMaxResults(v string) *ListSubscriptionDefinitionVersionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListSubscriptionDefinitionVersionsInput) SetNextToken(v string) *ListSubscriptionDefinitionVersionsInput { + s.NextToken = &v + return s +} + +// SetSubscriptionDefinitionId sets the SubscriptionDefinitionId field's value. +func (s *ListSubscriptionDefinitionVersionsInput) SetSubscriptionDefinitionId(v string) *ListSubscriptionDefinitionVersionsInput { + s.SubscriptionDefinitionId = &v + return s +} + +type ListSubscriptionDefinitionVersionsOutput struct { + _ struct{} `type:"structure"` + + NextToken *string `type:"string"` + + Versions []*VersionInformation `type:"list"` +} + +// String returns the string representation +func (s ListSubscriptionDefinitionVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListSubscriptionDefinitionVersionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListSubscriptionDefinitionVersionsOutput) SetNextToken(v string) *ListSubscriptionDefinitionVersionsOutput { + s.NextToken = &v + return s +} + +// SetVersions sets the Versions field's value. +func (s *ListSubscriptionDefinitionVersionsOutput) SetVersions(v []*VersionInformation) *ListSubscriptionDefinitionVersionsOutput { + s.Versions = v + return s +} + +type ListSubscriptionDefinitionsInput struct { + _ struct{} `type:"structure"` + + MaxResults *string `location:"querystring" locationName:"MaxResults" type:"string"` + + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s ListSubscriptionDefinitionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListSubscriptionDefinitionsInput) GoString() string { + return s.String() +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListSubscriptionDefinitionsInput) SetMaxResults(v string) *ListSubscriptionDefinitionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListSubscriptionDefinitionsInput) SetNextToken(v string) *ListSubscriptionDefinitionsInput { + s.NextToken = &v + return s +} + +type ListSubscriptionDefinitionsOutput struct { + _ struct{} `type:"structure"` + + Definitions []*DefinitionInformation `type:"list"` + + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListSubscriptionDefinitionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListSubscriptionDefinitionsOutput) GoString() string { + return s.String() +} + +// SetDefinitions sets the Definitions field's value. +func (s *ListSubscriptionDefinitionsOutput) SetDefinitions(v []*DefinitionInformation) *ListSubscriptionDefinitionsOutput { + s.Definitions = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListSubscriptionDefinitionsOutput) SetNextToken(v string) *ListSubscriptionDefinitionsOutput { + s.NextToken = &v + return s +} + +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resource-arn" 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 +} + +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// 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 map[string]*string) *ListTagsForResourceOutput { + s.Tags = v + return s +} + +// Attributes that define a local device resource. +type LocalDeviceResourceData struct { + _ struct{} `type:"structure"` + + // Group/owner related settings for local resources. + GroupOwnerSetting *GroupOwnerSetting `type:"structure"` + + // The local absolute path of the device resource. The source path for a device + // resource can refer only to a character device or block device under ''/dev''. + SourcePath *string `type:"string"` +} + +// String returns the string representation +func (s LocalDeviceResourceData) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LocalDeviceResourceData) GoString() string { + return s.String() +} + +// SetGroupOwnerSetting sets the GroupOwnerSetting field's value. +func (s *LocalDeviceResourceData) SetGroupOwnerSetting(v *GroupOwnerSetting) *LocalDeviceResourceData { + s.GroupOwnerSetting = v + return s +} + +// SetSourcePath sets the SourcePath field's value. +func (s *LocalDeviceResourceData) SetSourcePath(v string) *LocalDeviceResourceData { + s.SourcePath = &v + return s +} + +// Attributes that define a local volume resource. +type LocalVolumeResourceData struct { + _ struct{} `type:"structure"` + + // The absolute local path of the resource inside the Lambda environment. + DestinationPath *string `type:"string"` + + // Allows you to configure additional group privileges for the Lambda process. + // This field is optional. + GroupOwnerSetting *GroupOwnerSetting `type:"structure"` + + // The local absolute path of the volume resource on the host. The source path + // for a volume resource type cannot start with ''/sys''. + SourcePath *string `type:"string"` +} + +// String returns the string representation +func (s LocalVolumeResourceData) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LocalVolumeResourceData) GoString() string { + return s.String() +} + +// SetDestinationPath sets the DestinationPath field's value. +func (s *LocalVolumeResourceData) SetDestinationPath(v string) *LocalVolumeResourceData { + s.DestinationPath = &v + return s +} + +// SetGroupOwnerSetting sets the GroupOwnerSetting field's value. +func (s *LocalVolumeResourceData) SetGroupOwnerSetting(v *GroupOwnerSetting) *LocalVolumeResourceData { + s.GroupOwnerSetting = v + return s +} + +// SetSourcePath sets the SourcePath field's value. +func (s *LocalVolumeResourceData) SetSourcePath(v string) *LocalVolumeResourceData { + s.SourcePath = &v + return s +} + +// Information about a logger +type Logger struct { + _ struct{} `type:"structure"` + + // The component that will be subject to logging. + // + // Component is a required field + Component *string `type:"string" required:"true" enum:"LoggerComponent"` + + // A descriptive or arbitrary ID for the logger. This value must be unique within + // the logger definition version. Max length is 128 characters with pattern + // ''[a-zA-Z0-9:_-]+''. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // The level of the logs. + // + // Level is a required field + Level *string `type:"string" required:"true" enum:"LoggerLevel"` + + // The amount of file space, in KB, to use if the local file system is used + // for logging purposes. + Space *int64 `type:"integer"` + + // The type of log output which will be used. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"LoggerType"` +} + +// String returns the string representation +func (s Logger) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Logger) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Logger) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Logger"} + if s.Component == nil { + invalidParams.Add(request.NewErrParamRequired("Component")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Level == nil { + invalidParams.Add(request.NewErrParamRequired("Level")) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComponent sets the Component field's value. +func (s *Logger) SetComponent(v string) *Logger { + s.Component = &v + return s +} + +// SetId sets the Id field's value. +func (s *Logger) SetId(v string) *Logger { + s.Id = &v + return s +} + +// SetLevel sets the Level field's value. +func (s *Logger) SetLevel(v string) *Logger { + s.Level = &v + return s +} + +// SetSpace sets the Space field's value. +func (s *Logger) SetSpace(v int64) *Logger { + s.Space = &v + return s +} + +// SetType sets the Type field's value. +func (s *Logger) SetType(v string) *Logger { + s.Type = &v + return s +} + +// Information about a logger definition version. +type LoggerDefinitionVersion struct { + _ struct{} `type:"structure"` + + // A list of loggers. + Loggers []*Logger `type:"list"` +} + +// String returns the string representation +func (s LoggerDefinitionVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LoggerDefinitionVersion) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LoggerDefinitionVersion) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LoggerDefinitionVersion"} + if s.Loggers != nil { + for i, v := range s.Loggers { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Loggers", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoggers sets the Loggers field's value. +func (s *LoggerDefinitionVersion) SetLoggers(v []*Logger) *LoggerDefinitionVersion { + s.Loggers = v + return s +} + +// Information about a group reset request. +type ResetDeploymentsInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // If true, performs a best-effort only core reset. + Force *bool `type:"boolean"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` +} + +// String returns the string representation +func (s ResetDeploymentsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetDeploymentsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResetDeploymentsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResetDeploymentsInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *ResetDeploymentsInput) SetAmznClientToken(v string) *ResetDeploymentsInput { + s.AmznClientToken = &v + return s +} + +// SetForce sets the Force field's value. +func (s *ResetDeploymentsInput) SetForce(v bool) *ResetDeploymentsInput { + s.Force = &v + return s +} + +// SetGroupId sets the GroupId field's value. +func (s *ResetDeploymentsInput) SetGroupId(v string) *ResetDeploymentsInput { + s.GroupId = &v + return s +} + +type ResetDeploymentsOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the deployment. + DeploymentArn *string `type:"string"` + + // The ID of the deployment. + DeploymentId *string `type:"string"` +} + +// String returns the string representation +func (s ResetDeploymentsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetDeploymentsOutput) GoString() string { + return s.String() +} + +// SetDeploymentArn sets the DeploymentArn field's value. +func (s *ResetDeploymentsOutput) SetDeploymentArn(v string) *ResetDeploymentsOutput { + s.DeploymentArn = &v + return s +} + +// SetDeploymentId sets the DeploymentId field's value. +func (s *ResetDeploymentsOutput) SetDeploymentId(v string) *ResetDeploymentsOutput { + s.DeploymentId = &v + return s +} + +// Information about a resource. +type Resource struct { + _ struct{} `type:"structure"` + + // The resource ID, used to refer to a resource in the Lambda function configuration. + // Max length is 128 characters with pattern ''[a-zA-Z0-9:_-]+''. This must + // be unique within a Greengrass group. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // The descriptive resource name, which is displayed on the AWS IoT Greengrass + // console. Max length 128 characters with pattern ''[a-zA-Z0-9:_-]+''. This + // must be unique within a Greengrass group. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // A container of data for all resource types. + // + // ResourceDataContainer is a required field + ResourceDataContainer *ResourceDataContainer `type:"structure" required:"true"` +} + +// 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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Resource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Resource"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.ResourceDataContainer == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceDataContainer")) + } + if s.ResourceDataContainer != nil { + if err := s.ResourceDataContainer.Validate(); err != nil { + invalidParams.AddNested("ResourceDataContainer", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *Resource) SetId(v string) *Resource { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *Resource) SetName(v string) *Resource { + s.Name = &v + return s +} + +// SetResourceDataContainer sets the ResourceDataContainer field's value. +func (s *Resource) SetResourceDataContainer(v *ResourceDataContainer) *Resource { + s.ResourceDataContainer = v + return s +} + +// A policy used by the function to access a resource. +type ResourceAccessPolicy struct { + _ struct{} `type:"structure"` + + // The permissions that the Lambda function has to the resource. Can be one + // of ''rw'' (read/write) or ''ro'' (read-only). + Permission *string `type:"string" enum:"Permission"` + + // The ID of the resource. (This ID is assigned to the resource when you create + // the resource definiton.) + // + // ResourceId is a required field + ResourceId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ResourceAccessPolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAccessPolicy) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResourceAccessPolicy) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResourceAccessPolicy"} + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPermission sets the Permission field's value. +func (s *ResourceAccessPolicy) SetPermission(v string) *ResourceAccessPolicy { + s.Permission = &v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *ResourceAccessPolicy) SetResourceId(v string) *ResourceAccessPolicy { + s.ResourceId = &v + return s +} + +// A container for resource data. The container takes only one of the following +// supported resource data types: ''LocalDeviceResourceData'', ''LocalVolumeResourceData'', +// ''SageMakerMachineLearningModelResourceData'', ''S3MachineLearningModelResourceData'', +// ''SecretsManagerSecretResourceData''. +type ResourceDataContainer struct { + _ struct{} `type:"structure"` + + // Attributes that define the local device resource. + LocalDeviceResourceData *LocalDeviceResourceData `type:"structure"` + + // Attributes that define the local volume resource. + LocalVolumeResourceData *LocalVolumeResourceData `type:"structure"` + + // Attributes that define an Amazon S3 machine learning resource. + S3MachineLearningModelResourceData *S3MachineLearningModelResourceData `type:"structure"` + + // Attributes that define an Amazon SageMaker machine learning resource. + SageMakerMachineLearningModelResourceData *SageMakerMachineLearningModelResourceData `type:"structure"` + + // Attributes that define a secret resource, which references a secret from + // AWS Secrets Manager. + SecretsManagerSecretResourceData *SecretsManagerSecretResourceData `type:"structure"` +} + +// String returns the string representation +func (s ResourceDataContainer) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceDataContainer) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResourceDataContainer) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResourceDataContainer"} + if s.S3MachineLearningModelResourceData != nil { + if err := s.S3MachineLearningModelResourceData.Validate(); err != nil { + invalidParams.AddNested("S3MachineLearningModelResourceData", err.(request.ErrInvalidParams)) + } + } + if s.SageMakerMachineLearningModelResourceData != nil { + if err := s.SageMakerMachineLearningModelResourceData.Validate(); err != nil { + invalidParams.AddNested("SageMakerMachineLearningModelResourceData", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLocalDeviceResourceData sets the LocalDeviceResourceData field's value. +func (s *ResourceDataContainer) SetLocalDeviceResourceData(v *LocalDeviceResourceData) *ResourceDataContainer { + s.LocalDeviceResourceData = v + return s +} + +// SetLocalVolumeResourceData sets the LocalVolumeResourceData field's value. +func (s *ResourceDataContainer) SetLocalVolumeResourceData(v *LocalVolumeResourceData) *ResourceDataContainer { + s.LocalVolumeResourceData = v + return s +} + +// SetS3MachineLearningModelResourceData sets the S3MachineLearningModelResourceData field's value. +func (s *ResourceDataContainer) SetS3MachineLearningModelResourceData(v *S3MachineLearningModelResourceData) *ResourceDataContainer { + s.S3MachineLearningModelResourceData = v + return s +} + +// SetSageMakerMachineLearningModelResourceData sets the SageMakerMachineLearningModelResourceData field's value. +func (s *ResourceDataContainer) SetSageMakerMachineLearningModelResourceData(v *SageMakerMachineLearningModelResourceData) *ResourceDataContainer { + s.SageMakerMachineLearningModelResourceData = v + return s +} + +// SetSecretsManagerSecretResourceData sets the SecretsManagerSecretResourceData field's value. +func (s *ResourceDataContainer) SetSecretsManagerSecretResourceData(v *SecretsManagerSecretResourceData) *ResourceDataContainer { + s.SecretsManagerSecretResourceData = v + return s +} + +// Information about a resource definition version. +type ResourceDefinitionVersion struct { + _ struct{} `type:"structure"` + + // A list of resources. + Resources []*Resource `type:"list"` +} + +// String returns the string representation +func (s ResourceDefinitionVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceDefinitionVersion) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResourceDefinitionVersion) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResourceDefinitionVersion"} + if s.Resources != nil { + for i, v := range s.Resources { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Resources", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResources sets the Resources field's value. +func (s *ResourceDefinitionVersion) SetResources(v []*Resource) *ResourceDefinitionVersion { + s.Resources = v + return s +} + +// The owner setting for downloaded machine learning resources. +type ResourceDownloadOwnerSetting struct { + _ struct{} `type:"structure"` + + // The group owner of the resource. This is the name of an existing Linux OS + // group on the system or a GID. The group's permissions are added to the Lambda + // process. + // + // GroupOwner is a required field + GroupOwner *string `type:"string" required:"true"` + + // The permissions that the group owner has to the resource. Valid values are + // ''rw'' (read/write) or ''ro'' (read-only). + // + // GroupPermission is a required field + GroupPermission *string `type:"string" required:"true" enum:"Permission"` +} + +// String returns the string representation +func (s ResourceDownloadOwnerSetting) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceDownloadOwnerSetting) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResourceDownloadOwnerSetting) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResourceDownloadOwnerSetting"} + if s.GroupOwner == nil { + invalidParams.Add(request.NewErrParamRequired("GroupOwner")) + } + if s.GroupPermission == nil { + invalidParams.Add(request.NewErrParamRequired("GroupPermission")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupOwner sets the GroupOwner field's value. +func (s *ResourceDownloadOwnerSetting) SetGroupOwner(v string) *ResourceDownloadOwnerSetting { + s.GroupOwner = &v + return s +} + +// SetGroupPermission sets the GroupPermission field's value. +func (s *ResourceDownloadOwnerSetting) SetGroupPermission(v string) *ResourceDownloadOwnerSetting { + s.GroupPermission = &v + return s +} + +// Attributes that define an Amazon S3 machine learning resource. +type S3MachineLearningModelResourceData struct { + _ struct{} `type:"structure"` + + // The absolute local path of the resource inside the Lambda environment. + DestinationPath *string `type:"string"` + + // The owner setting for downloaded machine learning resources. + OwnerSetting *ResourceDownloadOwnerSetting `type:"structure"` + + // The URI of the source model in an S3 bucket. The model package must be in + // tar.gz or .zip format. + S3Uri *string `type:"string"` +} + +// String returns the string representation +func (s S3MachineLearningModelResourceData) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s S3MachineLearningModelResourceData) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *S3MachineLearningModelResourceData) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "S3MachineLearningModelResourceData"} + if s.OwnerSetting != nil { + if err := s.OwnerSetting.Validate(); err != nil { + invalidParams.AddNested("OwnerSetting", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDestinationPath sets the DestinationPath field's value. +func (s *S3MachineLearningModelResourceData) SetDestinationPath(v string) *S3MachineLearningModelResourceData { + s.DestinationPath = &v + return s +} + +// SetOwnerSetting sets the OwnerSetting field's value. +func (s *S3MachineLearningModelResourceData) SetOwnerSetting(v *ResourceDownloadOwnerSetting) *S3MachineLearningModelResourceData { + s.OwnerSetting = v + return s +} + +// SetS3Uri sets the S3Uri field's value. +func (s *S3MachineLearningModelResourceData) SetS3Uri(v string) *S3MachineLearningModelResourceData { + s.S3Uri = &v + return s +} + +// Attributes that define an Amazon SageMaker machine learning resource. +type SageMakerMachineLearningModelResourceData struct { + _ struct{} `type:"structure"` + + // The absolute local path of the resource inside the Lambda environment. + DestinationPath *string `type:"string"` + + // The owner setting for downloaded machine learning resources. + OwnerSetting *ResourceDownloadOwnerSetting `type:"structure"` + + // The ARN of the Amazon SageMaker training job that represents the source model. + SageMakerJobArn *string `type:"string"` +} + +// String returns the string representation +func (s SageMakerMachineLearningModelResourceData) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SageMakerMachineLearningModelResourceData) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SageMakerMachineLearningModelResourceData) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SageMakerMachineLearningModelResourceData"} + if s.OwnerSetting != nil { + if err := s.OwnerSetting.Validate(); err != nil { + invalidParams.AddNested("OwnerSetting", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDestinationPath sets the DestinationPath field's value. +func (s *SageMakerMachineLearningModelResourceData) SetDestinationPath(v string) *SageMakerMachineLearningModelResourceData { + s.DestinationPath = &v + return s +} + +// SetOwnerSetting sets the OwnerSetting field's value. +func (s *SageMakerMachineLearningModelResourceData) SetOwnerSetting(v *ResourceDownloadOwnerSetting) *SageMakerMachineLearningModelResourceData { + s.OwnerSetting = v + return s +} + +// SetSageMakerJobArn sets the SageMakerJobArn field's value. +func (s *SageMakerMachineLearningModelResourceData) SetSageMakerJobArn(v string) *SageMakerMachineLearningModelResourceData { + s.SageMakerJobArn = &v + return s +} + +// Attributes that define a secret resource, which references a secret from +// AWS Secrets Manager. AWS IoT Greengrass stores a local, encrypted copy of +// the secret on the Greengrass core, where it can be securely accessed by connectors +// and Lambda functions. +type SecretsManagerSecretResourceData struct { + _ struct{} `type:"structure"` + + // The ARN of the Secrets Manager secret to make available on the core. The + // value of the secret's latest version (represented by the ''AWSCURRENT'' staging + // label) is included by default. + ARN *string `type:"string"` + + // Optional. The staging labels whose values you want to make available on the + // core, in addition to ''AWSCURRENT''. + AdditionalStagingLabelsToDownload []*string `type:"list"` +} + +// String returns the string representation +func (s SecretsManagerSecretResourceData) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SecretsManagerSecretResourceData) GoString() string { + return s.String() +} + +// SetARN sets the ARN field's value. +func (s *SecretsManagerSecretResourceData) SetARN(v string) *SecretsManagerSecretResourceData { + s.ARN = &v + return s +} + +// SetAdditionalStagingLabelsToDownload sets the AdditionalStagingLabelsToDownload field's value. +func (s *SecretsManagerSecretResourceData) SetAdditionalStagingLabelsToDownload(v []*string) *SecretsManagerSecretResourceData { + s.AdditionalStagingLabelsToDownload = v + return s +} + +// Information about a bulk deployment. You cannot start a new bulk deployment +// while another one is still running or in a non-terminal state. +type StartBulkDeploymentInput struct { + _ struct{} `type:"structure"` + + AmznClientToken *string `location:"header" locationName:"X-Amzn-Client-Token" type:"string"` + + // The ARN of the execution role to associate with the bulk deployment operation. + // This IAM role must allow the ''greengrass:CreateDeployment'' action for all + // group versions that are listed in the input file. This IAM role must have + // access to the S3 bucket containing the input file. + // + // ExecutionRoleArn is a required field + ExecutionRoleArn *string `type:"string" required:"true"` + + // The URI of the input file contained in the S3 bucket. The execution role + // must have ''getObject'' permissions on this bucket to access the input file. + // The input file is a JSON-serialized, line delimited file with UTF-8 encoding + // that provides a list of group and version IDs and the deployment type. This + // file must be less than 100 MB. Currently, AWS IoT Greengrass supports only + // ''NewDeployment'' deployment types. + // + // InputFileUri is a required field + InputFileUri *string `type:"string" required:"true"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s StartBulkDeploymentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartBulkDeploymentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartBulkDeploymentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartBulkDeploymentInput"} + if s.ExecutionRoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("ExecutionRoleArn")) + } + if s.InputFileUri == nil { + invalidParams.Add(request.NewErrParamRequired("InputFileUri")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmznClientToken sets the AmznClientToken field's value. +func (s *StartBulkDeploymentInput) SetAmznClientToken(v string) *StartBulkDeploymentInput { + s.AmznClientToken = &v + return s +} + +// SetExecutionRoleArn sets the ExecutionRoleArn field's value. +func (s *StartBulkDeploymentInput) SetExecutionRoleArn(v string) *StartBulkDeploymentInput { + s.ExecutionRoleArn = &v + return s +} + +// SetInputFileUri sets the InputFileUri field's value. +func (s *StartBulkDeploymentInput) SetInputFileUri(v string) *StartBulkDeploymentInput { + s.InputFileUri = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *StartBulkDeploymentInput) SetTags(v map[string]*string) *StartBulkDeploymentInput { + s.Tags = v + return s +} + +type StartBulkDeploymentOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the bulk deployment. + BulkDeploymentArn *string `type:"string"` + + // The ID of the bulk deployment. + BulkDeploymentId *string `type:"string"` +} + +// String returns the string representation +func (s StartBulkDeploymentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartBulkDeploymentOutput) GoString() string { + return s.String() +} + +// SetBulkDeploymentArn sets the BulkDeploymentArn field's value. +func (s *StartBulkDeploymentOutput) SetBulkDeploymentArn(v string) *StartBulkDeploymentOutput { + s.BulkDeploymentArn = &v + return s +} + +// SetBulkDeploymentId sets the BulkDeploymentId field's value. +func (s *StartBulkDeploymentOutput) SetBulkDeploymentId(v string) *StartBulkDeploymentOutput { + s.BulkDeploymentId = &v + return s +} + +type StopBulkDeploymentInput struct { + _ struct{} `type:"structure"` + + // BulkDeploymentId is a required field + BulkDeploymentId *string `location:"uri" locationName:"BulkDeploymentId" type:"string" required:"true"` +} + +// String returns the string representation +func (s StopBulkDeploymentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopBulkDeploymentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StopBulkDeploymentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopBulkDeploymentInput"} + if s.BulkDeploymentId == nil { + invalidParams.Add(request.NewErrParamRequired("BulkDeploymentId")) + } + if s.BulkDeploymentId != nil && len(*s.BulkDeploymentId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("BulkDeploymentId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBulkDeploymentId sets the BulkDeploymentId field's value. +func (s *StopBulkDeploymentInput) SetBulkDeploymentId(v string) *StopBulkDeploymentInput { + s.BulkDeploymentId = &v + return s +} + +type StopBulkDeploymentOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s StopBulkDeploymentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopBulkDeploymentOutput) GoString() string { + return s.String() +} + +// Information about a subscription. +type Subscription struct { + _ struct{} `type:"structure"` + + // A descriptive or arbitrary ID for the subscription. This value must be unique + // within the subscription definition version. Max length is 128 characters + // with pattern ''[a-zA-Z0-9:_-]+''. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // The source of the subscription. Can be a thing ARN, a Lambda function ARN, + // a connector ARN, 'cloud' (which represents the AWS IoT cloud), or 'GGShadowService'. + // + // Source is a required field + Source *string `type:"string" required:"true"` + + // The MQTT topic used to route the message. + // + // Subject is a required field + Subject *string `type:"string" required:"true"` + + // Where the message is sent to. Can be a thing ARN, a Lambda function ARN, + // a connector ARN, 'cloud' (which represents the AWS IoT cloud), or 'GGShadowService'. + // + // Target is a required field + Target *string `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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Subscription) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Subscription"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Source == nil { + invalidParams.Add(request.NewErrParamRequired("Source")) + } + if s.Subject == nil { + invalidParams.Add(request.NewErrParamRequired("Subject")) + } + if s.Target == nil { + invalidParams.Add(request.NewErrParamRequired("Target")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *Subscription) SetId(v string) *Subscription { + s.Id = &v + return s +} + +// SetSource sets the Source field's value. +func (s *Subscription) SetSource(v string) *Subscription { + s.Source = &v + return s +} + +// SetSubject sets the Subject field's value. +func (s *Subscription) SetSubject(v string) *Subscription { + s.Subject = &v + return s +} + +// SetTarget sets the Target field's value. +func (s *Subscription) SetTarget(v string) *Subscription { + s.Target = &v + return s +} + +// Information about a subscription definition version. +type SubscriptionDefinitionVersion struct { + _ struct{} `type:"structure"` + + // A list of subscriptions. + Subscriptions []*Subscription `type:"list"` +} + +// String returns the string representation +func (s SubscriptionDefinitionVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SubscriptionDefinitionVersion) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SubscriptionDefinitionVersion) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SubscriptionDefinitionVersion"} + if s.Subscriptions != nil { + for i, v := range s.Subscriptions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Subscriptions", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSubscriptions sets the Subscriptions field's value. +func (s *SubscriptionDefinitionVersion) SetSubscriptions(v []*Subscription) *SubscriptionDefinitionVersion { + s.Subscriptions = v + return s +} + +type TagResourceInput struct { + _ struct{} `type:"structure"` + + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` + + // The key-value pair for the resource tag. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// 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 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 map[string]*string) *TagResourceInput { + s.Tags = v + return s +} + +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() +} + +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` + + // TagKeys is a required field + TagKeys []*string `location:"querystring" locationName:"tagKeys" 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 +} + +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() +} + +// Information required to update a Greengrass core's connectivity. +type UpdateConnectivityInfoInput struct { + _ struct{} `type:"structure"` + + // A list of connectivity info. + ConnectivityInfo []*ConnectivityInfo `type:"list"` + + // ThingName is a required field + ThingName *string `location:"uri" locationName:"ThingName" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateConnectivityInfoInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateConnectivityInfoInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateConnectivityInfoInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateConnectivityInfoInput"} + if s.ThingName == nil { + invalidParams.Add(request.NewErrParamRequired("ThingName")) + } + if s.ThingName != nil && len(*s.ThingName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ThingName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConnectivityInfo sets the ConnectivityInfo field's value. +func (s *UpdateConnectivityInfoInput) SetConnectivityInfo(v []*ConnectivityInfo) *UpdateConnectivityInfoInput { + s.ConnectivityInfo = v + return s +} + +// SetThingName sets the ThingName field's value. +func (s *UpdateConnectivityInfoInput) SetThingName(v string) *UpdateConnectivityInfoInput { + s.ThingName = &v + return s +} + +type UpdateConnectivityInfoOutput struct { + _ struct{} `type:"structure"` + + // A message about the connectivity info update request. + Message *string `locationName:"message" type:"string"` + + // The new version of the connectivity info. + Version *string `type:"string"` +} + +// String returns the string representation +func (s UpdateConnectivityInfoOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateConnectivityInfoOutput) GoString() string { + return s.String() +} + +// SetMessage sets the Message field's value. +func (s *UpdateConnectivityInfoOutput) SetMessage(v string) *UpdateConnectivityInfoOutput { + s.Message = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *UpdateConnectivityInfoOutput) SetVersion(v string) *UpdateConnectivityInfoOutput { + s.Version = &v + return s +} + +type UpdateConnectorDefinitionInput struct { + _ struct{} `type:"structure"` + + // ConnectorDefinitionId is a required field + ConnectorDefinitionId *string `location:"uri" locationName:"ConnectorDefinitionId" type:"string" required:"true"` + + Name *string `type:"string"` +} + +// String returns the string representation +func (s UpdateConnectorDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateConnectorDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateConnectorDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateConnectorDefinitionInput"} + if s.ConnectorDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("ConnectorDefinitionId")) + } + if s.ConnectorDefinitionId != nil && len(*s.ConnectorDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConnectorDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConnectorDefinitionId sets the ConnectorDefinitionId field's value. +func (s *UpdateConnectorDefinitionInput) SetConnectorDefinitionId(v string) *UpdateConnectorDefinitionInput { + s.ConnectorDefinitionId = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateConnectorDefinitionInput) SetName(v string) *UpdateConnectorDefinitionInput { + s.Name = &v + return s +} + +type UpdateConnectorDefinitionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateConnectorDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateConnectorDefinitionOutput) GoString() string { + return s.String() +} + +type UpdateCoreDefinitionInput struct { + _ struct{} `type:"structure"` + + // CoreDefinitionId is a required field + CoreDefinitionId *string `location:"uri" locationName:"CoreDefinitionId" type:"string" required:"true"` + + Name *string `type:"string"` +} + +// String returns the string representation +func (s UpdateCoreDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateCoreDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateCoreDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateCoreDefinitionInput"} + if s.CoreDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("CoreDefinitionId")) + } + if s.CoreDefinitionId != nil && len(*s.CoreDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CoreDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCoreDefinitionId sets the CoreDefinitionId field's value. +func (s *UpdateCoreDefinitionInput) SetCoreDefinitionId(v string) *UpdateCoreDefinitionInput { + s.CoreDefinitionId = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateCoreDefinitionInput) SetName(v string) *UpdateCoreDefinitionInput { + s.Name = &v + return s +} + +type UpdateCoreDefinitionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateCoreDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateCoreDefinitionOutput) GoString() string { + return s.String() +} + +type UpdateDeviceDefinitionInput struct { + _ struct{} `type:"structure"` + + // DeviceDefinitionId is a required field + DeviceDefinitionId *string `location:"uri" locationName:"DeviceDefinitionId" type:"string" required:"true"` + + Name *string `type:"string"` +} + +// String returns the string representation +func (s UpdateDeviceDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateDeviceDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateDeviceDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateDeviceDefinitionInput"} + if s.DeviceDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("DeviceDefinitionId")) + } + if s.DeviceDefinitionId != nil && len(*s.DeviceDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DeviceDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDeviceDefinitionId sets the DeviceDefinitionId field's value. +func (s *UpdateDeviceDefinitionInput) SetDeviceDefinitionId(v string) *UpdateDeviceDefinitionInput { + s.DeviceDefinitionId = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateDeviceDefinitionInput) SetName(v string) *UpdateDeviceDefinitionInput { + s.Name = &v + return s +} + +type UpdateDeviceDefinitionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateDeviceDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateDeviceDefinitionOutput) GoString() string { + return s.String() +} + +type UpdateFunctionDefinitionInput struct { + _ struct{} `type:"structure"` + + // FunctionDefinitionId is a required field + FunctionDefinitionId *string `location:"uri" locationName:"FunctionDefinitionId" type:"string" required:"true"` + + Name *string `type:"string"` +} + +// String returns the string representation +func (s UpdateFunctionDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateFunctionDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateFunctionDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateFunctionDefinitionInput"} + if s.FunctionDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("FunctionDefinitionId")) + } + if s.FunctionDefinitionId != nil && len(*s.FunctionDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FunctionDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFunctionDefinitionId sets the FunctionDefinitionId field's value. +func (s *UpdateFunctionDefinitionInput) SetFunctionDefinitionId(v string) *UpdateFunctionDefinitionInput { + s.FunctionDefinitionId = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateFunctionDefinitionInput) SetName(v string) *UpdateFunctionDefinitionInput { + s.Name = &v + return s +} + +type UpdateFunctionDefinitionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateFunctionDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateFunctionDefinitionOutput) GoString() string { + return s.String() +} + +type UpdateGroupCertificateConfigurationInput struct { + _ struct{} `type:"structure"` + + // The amount of time remaining before the certificate expires, in milliseconds. + CertificateExpiryInMilliseconds *string `type:"string"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateGroupCertificateConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateGroupCertificateConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateGroupCertificateConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateGroupCertificateConfigurationInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCertificateExpiryInMilliseconds sets the CertificateExpiryInMilliseconds field's value. +func (s *UpdateGroupCertificateConfigurationInput) SetCertificateExpiryInMilliseconds(v string) *UpdateGroupCertificateConfigurationInput { + s.CertificateExpiryInMilliseconds = &v + return s +} + +// SetGroupId sets the GroupId field's value. +func (s *UpdateGroupCertificateConfigurationInput) SetGroupId(v string) *UpdateGroupCertificateConfigurationInput { + s.GroupId = &v + return s +} + +type UpdateGroupCertificateConfigurationOutput struct { + _ struct{} `type:"structure"` + + CertificateAuthorityExpiryInMilliseconds *string `type:"string"` + + CertificateExpiryInMilliseconds *string `type:"string"` + + GroupId *string `type:"string"` +} + +// String returns the string representation +func (s UpdateGroupCertificateConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateGroupCertificateConfigurationOutput) GoString() string { + return s.String() +} + +// SetCertificateAuthorityExpiryInMilliseconds sets the CertificateAuthorityExpiryInMilliseconds field's value. +func (s *UpdateGroupCertificateConfigurationOutput) SetCertificateAuthorityExpiryInMilliseconds(v string) *UpdateGroupCertificateConfigurationOutput { + s.CertificateAuthorityExpiryInMilliseconds = &v + return s +} + +// SetCertificateExpiryInMilliseconds sets the CertificateExpiryInMilliseconds field's value. +func (s *UpdateGroupCertificateConfigurationOutput) SetCertificateExpiryInMilliseconds(v string) *UpdateGroupCertificateConfigurationOutput { + s.CertificateExpiryInMilliseconds = &v + return s +} + +// SetGroupId sets the GroupId field's value. +func (s *UpdateGroupCertificateConfigurationOutput) SetGroupId(v string) *UpdateGroupCertificateConfigurationOutput { + s.GroupId = &v + return s +} + +type UpdateGroupInput struct { + _ struct{} `type:"structure"` + + // GroupId is a required field + GroupId *string `location:"uri" locationName:"GroupId" type:"string" required:"true"` + + Name *string `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.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *UpdateGroupInput) SetGroupId(v string) *UpdateGroupInput { + s.GroupId = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateGroupInput) SetName(v string) *UpdateGroupInput { + s.Name = &v + return s +} + +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() +} + +type UpdateLoggerDefinitionInput struct { + _ struct{} `type:"structure"` + + // LoggerDefinitionId is a required field + LoggerDefinitionId *string `location:"uri" locationName:"LoggerDefinitionId" type:"string" required:"true"` + + Name *string `type:"string"` +} + +// String returns the string representation +func (s UpdateLoggerDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateLoggerDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateLoggerDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateLoggerDefinitionInput"} + if s.LoggerDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("LoggerDefinitionId")) + } + if s.LoggerDefinitionId != nil && len(*s.LoggerDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LoggerDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoggerDefinitionId sets the LoggerDefinitionId field's value. +func (s *UpdateLoggerDefinitionInput) SetLoggerDefinitionId(v string) *UpdateLoggerDefinitionInput { + s.LoggerDefinitionId = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateLoggerDefinitionInput) SetName(v string) *UpdateLoggerDefinitionInput { + s.Name = &v + return s +} + +type UpdateLoggerDefinitionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateLoggerDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateLoggerDefinitionOutput) GoString() string { + return s.String() +} + +type UpdateResourceDefinitionInput struct { + _ struct{} `type:"structure"` + + Name *string `type:"string"` + + // ResourceDefinitionId is a required field + ResourceDefinitionId *string `location:"uri" locationName:"ResourceDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateResourceDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateResourceDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateResourceDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateResourceDefinitionInput"} + if s.ResourceDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceDefinitionId")) + } + if s.ResourceDefinitionId != nil && len(*s.ResourceDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *UpdateResourceDefinitionInput) SetName(v string) *UpdateResourceDefinitionInput { + s.Name = &v + return s +} + +// SetResourceDefinitionId sets the ResourceDefinitionId field's value. +func (s *UpdateResourceDefinitionInput) SetResourceDefinitionId(v string) *UpdateResourceDefinitionInput { + s.ResourceDefinitionId = &v + return s +} + +type UpdateResourceDefinitionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateResourceDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateResourceDefinitionOutput) GoString() string { + return s.String() +} + +type UpdateSubscriptionDefinitionInput struct { + _ struct{} `type:"structure"` + + Name *string `type:"string"` + + // SubscriptionDefinitionId is a required field + SubscriptionDefinitionId *string `location:"uri" locationName:"SubscriptionDefinitionId" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateSubscriptionDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSubscriptionDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateSubscriptionDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateSubscriptionDefinitionInput"} + if s.SubscriptionDefinitionId == nil { + invalidParams.Add(request.NewErrParamRequired("SubscriptionDefinitionId")) + } + if s.SubscriptionDefinitionId != nil && len(*s.SubscriptionDefinitionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SubscriptionDefinitionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *UpdateSubscriptionDefinitionInput) SetName(v string) *UpdateSubscriptionDefinitionInput { + s.Name = &v + return s +} + +// SetSubscriptionDefinitionId sets the SubscriptionDefinitionId field's value. +func (s *UpdateSubscriptionDefinitionInput) SetSubscriptionDefinitionId(v string) *UpdateSubscriptionDefinitionInput { + s.SubscriptionDefinitionId = &v + return s +} + +type UpdateSubscriptionDefinitionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateSubscriptionDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSubscriptionDefinitionOutput) GoString() string { + return s.String() +} + +// Information about a version. +type VersionInformation struct { + _ struct{} `type:"structure"` + + // The ARN of the version. + Arn *string `type:"string"` + + // The time, in milliseconds since the epoch, when the version was created. + CreationTimestamp *string `type:"string"` + + // The ID of the parent definition that the version is associated with. + Id *string `type:"string"` + + // The ID of the version. + Version *string `type:"string"` +} + +// String returns the string representation +func (s VersionInformation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VersionInformation) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *VersionInformation) SetArn(v string) *VersionInformation { + s.Arn = &v + return s +} + +// SetCreationTimestamp sets the CreationTimestamp field's value. +func (s *VersionInformation) SetCreationTimestamp(v string) *VersionInformation { + s.CreationTimestamp = &v + return s +} + +// SetId sets the Id field's value. +func (s *VersionInformation) SetId(v string) *VersionInformation { + s.Id = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *VersionInformation) SetVersion(v string) *VersionInformation { + s.Version = &v + return s +} + +// The current status of the bulk deployment. +const ( + // BulkDeploymentStatusInitializing is a BulkDeploymentStatus enum value + BulkDeploymentStatusInitializing = "Initializing" + + // BulkDeploymentStatusRunning is a BulkDeploymentStatus enum value + BulkDeploymentStatusRunning = "Running" + + // BulkDeploymentStatusCompleted is a BulkDeploymentStatus enum value + BulkDeploymentStatusCompleted = "Completed" + + // BulkDeploymentStatusStopping is a BulkDeploymentStatus enum value + BulkDeploymentStatusStopping = "Stopping" + + // BulkDeploymentStatusStopped is a BulkDeploymentStatus enum value + BulkDeploymentStatusStopped = "Stopped" + + // BulkDeploymentStatusFailed is a BulkDeploymentStatus enum value + BulkDeploymentStatusFailed = "Failed" +) + +// The type of deployment. When used for ''CreateDeployment'', only ''NewDeployment'' +// and ''Redeployment'' are valid. +const ( + // DeploymentTypeNewDeployment is a DeploymentType enum value + DeploymentTypeNewDeployment = "NewDeployment" + + // DeploymentTypeRedeployment is a DeploymentType enum value + DeploymentTypeRedeployment = "Redeployment" + + // DeploymentTypeResetDeployment is a DeploymentType enum value + DeploymentTypeResetDeployment = "ResetDeployment" + + // DeploymentTypeForceResetDeployment is a DeploymentType enum value + DeploymentTypeForceResetDeployment = "ForceResetDeployment" +) + +const ( + // EncodingTypeBinary is a EncodingType enum value + EncodingTypeBinary = "binary" + + // EncodingTypeJson is a EncodingType enum value + EncodingTypeJson = "json" +) + +// Specifies whether the Lambda function runs in a Greengrass container (default) +// or without containerization. Unless your scenario requires that you run without +// containerization, we recommend that you run in a Greengrass container. Omit +// this value to run the Lambda function with the default containerization for +// the group. +const ( + // FunctionIsolationModeGreengrassContainer is a FunctionIsolationMode enum value + FunctionIsolationModeGreengrassContainer = "GreengrassContainer" + + // FunctionIsolationModeNoContainer is a FunctionIsolationMode enum value + FunctionIsolationModeNoContainer = "NoContainer" +) + +const ( + // LoggerComponentGreengrassSystem is a LoggerComponent enum value + LoggerComponentGreengrassSystem = "GreengrassSystem" + + // LoggerComponentLambda is a LoggerComponent enum value + LoggerComponentLambda = "Lambda" +) + +const ( + // LoggerLevelDebug is a LoggerLevel enum value + LoggerLevelDebug = "DEBUG" + + // LoggerLevelInfo is a LoggerLevel enum value + LoggerLevelInfo = "INFO" + + // LoggerLevelWarn is a LoggerLevel enum value + LoggerLevelWarn = "WARN" + + // LoggerLevelError is a LoggerLevel enum value + LoggerLevelError = "ERROR" + + // LoggerLevelFatal is a LoggerLevel enum value + LoggerLevelFatal = "FATAL" +) + +const ( + // LoggerTypeFileSystem is a LoggerType enum value + LoggerTypeFileSystem = "FileSystem" + + // LoggerTypeAwscloudWatch is a LoggerType enum value + LoggerTypeAwscloudWatch = "AWSCloudWatch" +) + +// The type of permission a function has to access a resource. +const ( + // PermissionRo is a Permission enum value + PermissionRo = "ro" + + // PermissionRw is a Permission enum value + PermissionRw = "rw" +) + +// The piece of software on the Greengrass core that will be updated. +const ( + // SoftwareToUpdateCore is a SoftwareToUpdate enum value + SoftwareToUpdateCore = "core" + + // SoftwareToUpdateOtaAgent is a SoftwareToUpdate enum value + SoftwareToUpdateOtaAgent = "ota_agent" +) + +// The minimum level of log statements that should be logged by the OTA Agent +// during an update. +const ( + // UpdateAgentLogLevelNone is a UpdateAgentLogLevel enum value + UpdateAgentLogLevelNone = "NONE" + + // UpdateAgentLogLevelTrace is a UpdateAgentLogLevel enum value + UpdateAgentLogLevelTrace = "TRACE" + + // UpdateAgentLogLevelDebug is a UpdateAgentLogLevel enum value + UpdateAgentLogLevelDebug = "DEBUG" + + // UpdateAgentLogLevelVerbose is a UpdateAgentLogLevel enum value + UpdateAgentLogLevelVerbose = "VERBOSE" + + // UpdateAgentLogLevelInfo is a UpdateAgentLogLevel enum value + UpdateAgentLogLevelInfo = "INFO" + + // UpdateAgentLogLevelWarn is a UpdateAgentLogLevel enum value + UpdateAgentLogLevelWarn = "WARN" + + // UpdateAgentLogLevelError is a UpdateAgentLogLevel enum value + UpdateAgentLogLevelError = "ERROR" + + // UpdateAgentLogLevelFatal is a UpdateAgentLogLevel enum value + UpdateAgentLogLevelFatal = "FATAL" +) + +// The architecture of the cores which are the targets of an update. +const ( + // UpdateTargetsArchitectureArmv6l is a UpdateTargetsArchitecture enum value + UpdateTargetsArchitectureArmv6l = "armv6l" + + // UpdateTargetsArchitectureArmv7l is a UpdateTargetsArchitecture enum value + UpdateTargetsArchitectureArmv7l = "armv7l" + + // UpdateTargetsArchitectureX8664 is a UpdateTargetsArchitecture enum value + UpdateTargetsArchitectureX8664 = "x86_64" + + // UpdateTargetsArchitectureAarch64 is a UpdateTargetsArchitecture enum value + UpdateTargetsArchitectureAarch64 = "aarch64" +) + +// The operating system of the cores which are the targets of an update. +const ( + // UpdateTargetsOperatingSystemUbuntu is a UpdateTargetsOperatingSystem enum value + UpdateTargetsOperatingSystemUbuntu = "ubuntu" + + // UpdateTargetsOperatingSystemRaspbian is a UpdateTargetsOperatingSystem enum value + UpdateTargetsOperatingSystemRaspbian = "raspbian" + + // UpdateTargetsOperatingSystemAmazonLinux is a UpdateTargetsOperatingSystem enum value + UpdateTargetsOperatingSystemAmazonLinux = "amazon_linux" + + // UpdateTargetsOperatingSystemOpenwrt is a UpdateTargetsOperatingSystem enum value + UpdateTargetsOperatingSystemOpenwrt = "openwrt" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/greengrass/doc.go b/vendor/github.com/aws/aws-sdk-go/service/greengrass/doc.go new file mode 100644 index 00000000000..c4b86ff1f29 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/greengrass/doc.go @@ -0,0 +1,33 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package greengrass provides the client and types for making API +// requests to AWS Greengrass. +// +// AWS IoT Greengrass seamlessly extends AWS onto physical devices so they can +// act locally on the data they generate, while still using the cloud for management, +// analytics, and durable storage. AWS IoT Greengrass ensures your devices can +// respond quickly to local events and operate with intermittent connectivity. +// AWS IoT Greengrass minimizes the cost of transmitting data to the cloud by +// allowing you to author AWS Lambda functions that execute locally. +// +// See https://docs.aws.amazon.com/goto/WebAPI/greengrass-2017-06-07 for more information on this service. +// +// See greengrass package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/greengrass/ +// +// Using the Client +// +// To contact AWS Greengrass 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 Greengrass client Greengrass for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/greengrass/#New +package greengrass diff --git a/vendor/github.com/aws/aws-sdk-go/service/greengrass/errors.go b/vendor/github.com/aws/aws-sdk-go/service/greengrass/errors.go new file mode 100644 index 00000000000..efca7778c95 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/greengrass/errors.go @@ -0,0 +1,27 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package greengrass + +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + +const ( + + // ErrCodeBadRequestException for service response error code + // "BadRequestException". + // + // General error information. + ErrCodeBadRequestException = "BadRequestException" + + // ErrCodeInternalServerErrorException for service response error code + // "InternalServerErrorException". + // + // General error information. + ErrCodeInternalServerErrorException = "InternalServerErrorException" +) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadRequestException": newErrorBadRequestException, + "InternalServerErrorException": newErrorInternalServerErrorException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/greengrass/service.go b/vendor/github.com/aws/aws-sdk-go/service/greengrass/service.go new file mode 100644 index 00000000000..6d47a15c69a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/greengrass/service.go @@ -0,0 +1,104 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package greengrass + +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" + "github.com/aws/aws-sdk-go/private/protocol/restjson" +) + +// Greengrass provides the API operation methods for making requests to +// AWS Greengrass. See this package's package overview docs +// for details on the service. +// +// Greengrass methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type Greengrass 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 = "greengrass" // Name of service. + EndpointsID = ServiceName // ID to lookup a service endpoint with. + ServiceID = "Greengrass" // ServiceID is a unique identifier of a specific service. +) + +// New creates a new instance of the Greengrass client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// mySession := session.Must(session.NewSession()) +// +// // Create a Greengrass client from just a session. +// svc := greengrass.New(mySession) +// +// // Create a Greengrass client with additional configuration +// svc := greengrass.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *Greengrass { + c := p.ClientConfig(EndpointsID, cfgs...) + if c.SigningNameDerived || len(c.SigningName) == 0 { + c.SigningName = "greengrass" + } + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Greengrass { + svc := &Greengrass{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + PartitionID: partitionID, + Endpoint: endpoint, + APIVersion: "2017-06-07", + }, + 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( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a Greengrass operation and runs any +// custom request initialization. +func (c *Greengrass) 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/guardduty/api.go b/vendor/github.com/aws/aws-sdk-go/service/guardduty/api.go index a7d9696869b..f5b30ccee0f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/guardduty/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/guardduty/api.go @@ -66,11 +66,11 @@ func (c *GuardDuty) AcceptInvitationRequest(input *AcceptInvitationInput) (req * // See the AWS API reference guide for Amazon GuardDuty's // API operation AcceptInvitation for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/AcceptInvitation @@ -152,11 +152,11 @@ func (c *GuardDuty) ArchiveFindingsRequest(input *ArchiveFindingsInput) (req *re // See the AWS API reference guide for Amazon GuardDuty's // API operation ArchiveFindings for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ArchiveFindings @@ -237,11 +237,11 @@ func (c *GuardDuty) CreateDetectorRequest(input *CreateDetectorInput) (req *requ // See the AWS API reference guide for Amazon GuardDuty's // API operation CreateDetector for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/CreateDetector @@ -319,11 +319,11 @@ func (c *GuardDuty) CreateFilterRequest(input *CreateFilterInput) (req *request. // See the AWS API reference guide for Amazon GuardDuty's // API operation CreateFilter for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/CreateFilter @@ -392,8 +392,11 @@ func (c *GuardDuty) CreateIPSetRequest(input *CreateIPSetInput) (req *request.Re // CreateIPSet API operation for Amazon GuardDuty. // -// Creates a new IPSet - a list of trusted IP addresses that have been whitelisted -// for secure communication with AWS infrastructure and applications. +// Creates a new IPSet, called Trusted IP list in the consoler user interface. +// An IPSet is a list IP addresses trusted for secure communication with AWS +// infrastructure and applications. GuardDuty does not generate findings for +// IP addresses included in IPSets. Only users from the master account can use +// 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 @@ -402,11 +405,11 @@ func (c *GuardDuty) CreateIPSetRequest(input *CreateIPSetInput) (req *request.Re // See the AWS API reference guide for Amazon GuardDuty's // API operation CreateIPSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/CreateIPSet @@ -486,11 +489,11 @@ func (c *GuardDuty) CreateMembersRequest(input *CreateMembersInput) (req *reques // See the AWS API reference guide for Amazon GuardDuty's // API operation CreateMembers for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/CreateMembers @@ -515,6 +518,89 @@ func (c *GuardDuty) CreateMembersWithContext(ctx aws.Context, input *CreateMembe return out, req.Send() } +const opCreatePublishingDestination = "CreatePublishingDestination" + +// CreatePublishingDestinationRequest generates a "aws/request.Request" representing the +// client's request for the CreatePublishingDestination operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreatePublishingDestination for more information on using the CreatePublishingDestination +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreatePublishingDestinationRequest method. +// req, resp := client.CreatePublishingDestinationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/CreatePublishingDestination +func (c *GuardDuty) CreatePublishingDestinationRequest(input *CreatePublishingDestinationInput) (req *request.Request, output *CreatePublishingDestinationOutput) { + op := &request.Operation{ + Name: opCreatePublishingDestination, + HTTPMethod: "POST", + HTTPPath: "/detector/{detectorId}/publishingDestination", + } + + if input == nil { + input = &CreatePublishingDestinationInput{} + } + + output = &CreatePublishingDestinationOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreatePublishingDestination API operation for Amazon GuardDuty. +// +// Creates a publishing destination to send findings to. The resource to send +// findings to must exist before you use 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 GuardDuty's +// API operation CreatePublishingDestination for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Bad request exception object. +// +// * InternalServerErrorException +// Internal server error exception object. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/CreatePublishingDestination +func (c *GuardDuty) CreatePublishingDestination(input *CreatePublishingDestinationInput) (*CreatePublishingDestinationOutput, error) { + req, out := c.CreatePublishingDestinationRequest(input) + return out, req.Send() +} + +// CreatePublishingDestinationWithContext is the same as CreatePublishingDestination with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePublishingDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GuardDuty) CreatePublishingDestinationWithContext(ctx aws.Context, input *CreatePublishingDestinationInput, opts ...request.Option) (*CreatePublishingDestinationOutput, error) { + req, out := c.CreatePublishingDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateSampleFindings = "CreateSampleFindings" // CreateSampleFindingsRequest generates a "aws/request.Request" representing the @@ -571,11 +657,11 @@ func (c *GuardDuty) CreateSampleFindingsRequest(input *CreateSampleFindingsInput // See the AWS API reference guide for Amazon GuardDuty's // API operation CreateSampleFindings for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/CreateSampleFindings @@ -645,7 +731,8 @@ func (c *GuardDuty) CreateThreatIntelSetRequest(input *CreateThreatIntelSetInput // CreateThreatIntelSet API operation for Amazon GuardDuty. // // Create a new ThreatIntelSet. ThreatIntelSets consist of known malicious IP -// addresses. GuardDuty generates findings based on ThreatIntelSets. +// addresses. GuardDuty generates findings based on ThreatIntelSets. Only users +// of the master account can use 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 @@ -654,11 +741,11 @@ func (c *GuardDuty) CreateThreatIntelSetRequest(input *CreateThreatIntelSetInput // See the AWS API reference guide for Amazon GuardDuty's // API operation CreateThreatIntelSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/CreateThreatIntelSet @@ -737,11 +824,11 @@ func (c *GuardDuty) DeclineInvitationsRequest(input *DeclineInvitationsInput) (r // See the AWS API reference guide for Amazon GuardDuty's // API operation DeclineInvitations for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/DeclineInvitations @@ -820,11 +907,11 @@ func (c *GuardDuty) DeleteDetectorRequest(input *DeleteDetectorInput) (req *requ // See the AWS API reference guide for Amazon GuardDuty's // API operation DeleteDetector for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/DeleteDetector @@ -903,11 +990,11 @@ func (c *GuardDuty) DeleteFilterRequest(input *DeleteFilterInput) (req *request. // See the AWS API reference guide for Amazon GuardDuty's // API operation DeleteFilter for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/DeleteFilter @@ -977,7 +1064,8 @@ func (c *GuardDuty) DeleteIPSetRequest(input *DeleteIPSetInput) (req *request.Re // DeleteIPSet API operation for Amazon GuardDuty. // -// Deletes the IPSet specified by the IPSet ID. +// Deletes the IPSet specified by the ipSetId. IPSets are called Trusted IP +// lists in the console user 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 @@ -986,11 +1074,11 @@ func (c *GuardDuty) DeleteIPSetRequest(input *DeleteIPSetInput) (req *request.Re // See the AWS API reference guide for Amazon GuardDuty's // API operation DeleteIPSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/DeleteIPSet @@ -1069,11 +1157,11 @@ func (c *GuardDuty) DeleteInvitationsRequest(input *DeleteInvitationsInput) (req // See the AWS API reference guide for Amazon GuardDuty's // API operation DeleteInvitations for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/DeleteInvitations @@ -1152,11 +1240,11 @@ func (c *GuardDuty) DeleteMembersRequest(input *DeleteMembersInput) (req *reques // See the AWS API reference guide for Amazon GuardDuty's // API operation DeleteMembers for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/DeleteMembers @@ -1181,6 +1269,89 @@ func (c *GuardDuty) DeleteMembersWithContext(ctx aws.Context, input *DeleteMembe return out, req.Send() } +const opDeletePublishingDestination = "DeletePublishingDestination" + +// DeletePublishingDestinationRequest generates a "aws/request.Request" representing the +// client's request for the DeletePublishingDestination operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeletePublishingDestination for more information on using the DeletePublishingDestination +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeletePublishingDestinationRequest method. +// req, resp := client.DeletePublishingDestinationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/DeletePublishingDestination +func (c *GuardDuty) DeletePublishingDestinationRequest(input *DeletePublishingDestinationInput) (req *request.Request, output *DeletePublishingDestinationOutput) { + op := &request.Operation{ + Name: opDeletePublishingDestination, + HTTPMethod: "DELETE", + HTTPPath: "/detector/{detectorId}/publishingDestination/{destinationId}", + } + + if input == nil { + input = &DeletePublishingDestinationInput{} + } + + output = &DeletePublishingDestinationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeletePublishingDestination API operation for Amazon GuardDuty. +// +// Deletes the publishing definition with the specified destinationId. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon GuardDuty's +// API operation DeletePublishingDestination for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Bad request exception object. +// +// * InternalServerErrorException +// Internal server error exception object. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/DeletePublishingDestination +func (c *GuardDuty) DeletePublishingDestination(input *DeletePublishingDestinationInput) (*DeletePublishingDestinationOutput, error) { + req, out := c.DeletePublishingDestinationRequest(input) + return out, req.Send() +} + +// DeletePublishingDestinationWithContext is the same as DeletePublishingDestination with the addition of +// the ability to pass a context and additional request options. +// +// See DeletePublishingDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GuardDuty) DeletePublishingDestinationWithContext(ctx aws.Context, input *DeletePublishingDestinationInput, opts ...request.Option) (*DeletePublishingDestinationOutput, error) { + req, out := c.DeletePublishingDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteThreatIntelSet = "DeleteThreatIntelSet" // DeleteThreatIntelSetRequest generates a "aws/request.Request" representing the @@ -1235,11 +1406,11 @@ func (c *GuardDuty) DeleteThreatIntelSetRequest(input *DeleteThreatIntelSetInput // See the AWS API reference guide for Amazon GuardDuty's // API operation DeleteThreatIntelSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/DeleteThreatIntelSet @@ -1264,6 +1435,89 @@ func (c *GuardDuty) DeleteThreatIntelSetWithContext(ctx aws.Context, input *Dele return out, req.Send() } +const opDescribePublishingDestination = "DescribePublishingDestination" + +// DescribePublishingDestinationRequest generates a "aws/request.Request" representing the +// client's request for the DescribePublishingDestination operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribePublishingDestination for more information on using the DescribePublishingDestination +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribePublishingDestinationRequest method. +// req, resp := client.DescribePublishingDestinationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/DescribePublishingDestination +func (c *GuardDuty) DescribePublishingDestinationRequest(input *DescribePublishingDestinationInput) (req *request.Request, output *DescribePublishingDestinationOutput) { + op := &request.Operation{ + Name: opDescribePublishingDestination, + HTTPMethod: "GET", + HTTPPath: "/detector/{detectorId}/publishingDestination/{destinationId}", + } + + if input == nil { + input = &DescribePublishingDestinationInput{} + } + + output = &DescribePublishingDestinationOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribePublishingDestination API operation for Amazon GuardDuty. +// +// Returns information about the publishing destination specified by the provided +// destinationId. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon GuardDuty's +// API operation DescribePublishingDestination for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Bad request exception object. +// +// * InternalServerErrorException +// Internal server error exception object. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/DescribePublishingDestination +func (c *GuardDuty) DescribePublishingDestination(input *DescribePublishingDestinationInput) (*DescribePublishingDestinationOutput, error) { + req, out := c.DescribePublishingDestinationRequest(input) + return out, req.Send() +} + +// DescribePublishingDestinationWithContext is the same as DescribePublishingDestination with the addition of +// the ability to pass a context and additional request options. +// +// See DescribePublishingDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GuardDuty) DescribePublishingDestinationWithContext(ctx aws.Context, input *DescribePublishingDestinationInput, opts ...request.Option) (*DescribePublishingDestinationOutput, error) { + req, out := c.DescribePublishingDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDisassociateFromMasterAccount = "DisassociateFromMasterAccount" // DisassociateFromMasterAccountRequest generates a "aws/request.Request" representing the @@ -1318,11 +1572,11 @@ func (c *GuardDuty) DisassociateFromMasterAccountRequest(input *DisassociateFrom // See the AWS API reference guide for Amazon GuardDuty's // API operation DisassociateFromMasterAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/DisassociateFromMasterAccount @@ -1401,11 +1655,11 @@ func (c *GuardDuty) DisassociateMembersRequest(input *DisassociateMembersInput) // See the AWS API reference guide for Amazon GuardDuty's // API operation DisassociateMembers for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/DisassociateMembers @@ -1483,11 +1737,11 @@ func (c *GuardDuty) GetDetectorRequest(input *GetDetectorInput) (req *request.Re // See the AWS API reference guide for Amazon GuardDuty's // API operation GetDetector for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/GetDetector @@ -1565,11 +1819,11 @@ func (c *GuardDuty) GetFilterRequest(input *GetFilterInput) (req *request.Reques // See the AWS API reference guide for Amazon GuardDuty's // API operation GetFilter for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/GetFilter @@ -1647,11 +1901,11 @@ func (c *GuardDuty) GetFindingsRequest(input *GetFindingsInput) (req *request.Re // See the AWS API reference guide for Amazon GuardDuty's // API operation GetFindings for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/GetFindings @@ -1729,11 +1983,11 @@ func (c *GuardDuty) GetFindingsStatisticsRequest(input *GetFindingsStatisticsInp // See the AWS API reference guide for Amazon GuardDuty's // API operation GetFindingsStatistics for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/GetFindingsStatistics @@ -1802,7 +2056,7 @@ func (c *GuardDuty) GetIPSetRequest(input *GetIPSetInput) (req *request.Request, // GetIPSet API operation for Amazon GuardDuty. // -// Retrieves the IPSet specified by the IPSet ID. +// Retrieves the IPSet specified by the 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 @@ -1811,11 +2065,11 @@ func (c *GuardDuty) GetIPSetRequest(input *GetIPSetInput) (req *request.Request, // See the AWS API reference guide for Amazon GuardDuty's // API operation GetIPSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/GetIPSet @@ -1894,11 +2148,11 @@ func (c *GuardDuty) GetInvitationsCountRequest(input *GetInvitationsCountInput) // See the AWS API reference guide for Amazon GuardDuty's // API operation GetInvitationsCount for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/GetInvitationsCount @@ -1977,11 +2231,11 @@ func (c *GuardDuty) GetMasterAccountRequest(input *GetMasterAccountInput) (req * // See the AWS API reference guide for Amazon GuardDuty's // API operation GetMasterAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/GetMasterAccount @@ -2060,11 +2314,11 @@ func (c *GuardDuty) GetMembersRequest(input *GetMembersInput) (req *request.Requ // See the AWS API reference guide for Amazon GuardDuty's // API operation GetMembers for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/GetMembers @@ -2142,11 +2396,11 @@ func (c *GuardDuty) GetThreatIntelSetRequest(input *GetThreatIntelSetInput) (req // See the AWS API reference guide for Amazon GuardDuty's // API operation GetThreatIntelSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/GetThreatIntelSet @@ -2227,11 +2481,11 @@ func (c *GuardDuty) InviteMembersRequest(input *InviteMembersInput) (req *reques // See the AWS API reference guide for Amazon GuardDuty's // API operation InviteMembers for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/InviteMembers @@ -2315,11 +2569,11 @@ func (c *GuardDuty) ListDetectorsRequest(input *ListDetectorsInput) (req *reques // See the AWS API reference guide for Amazon GuardDuty's // API operation ListDetectors for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ListDetectors @@ -2387,10 +2641,12 @@ func (c *GuardDuty) ListDetectorsPagesWithContext(ctx aws.Context, input *ListDe }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDetectorsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDetectorsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2453,11 +2709,11 @@ func (c *GuardDuty) ListFiltersRequest(input *ListFiltersInput) (req *request.Re // See the AWS API reference guide for Amazon GuardDuty's // API operation ListFilters for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ListFilters @@ -2525,10 +2781,12 @@ func (c *GuardDuty) ListFiltersPagesWithContext(ctx aws.Context, input *ListFilt }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListFiltersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListFiltersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2591,11 +2849,11 @@ func (c *GuardDuty) ListFindingsRequest(input *ListFindingsInput) (req *request. // See the AWS API reference guide for Amazon GuardDuty's // API operation ListFindings for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ListFindings @@ -2663,10 +2921,12 @@ func (c *GuardDuty) ListFindingsPagesWithContext(ctx aws.Context, input *ListFin }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListFindingsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListFindingsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2720,7 +2980,9 @@ func (c *GuardDuty) ListIPSetsRequest(input *ListIPSetsInput) (req *request.Requ // ListIPSets API operation for Amazon GuardDuty. // -// Lists the IPSets of the GuardDuty service specified by the detector ID. +// Lists the IPSets of the GuardDuty service specified by the detector ID. If +// you use this operation from a member account, the IPSets returned are the +// IPSets from the associated master 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 @@ -2729,11 +2991,11 @@ func (c *GuardDuty) ListIPSetsRequest(input *ListIPSetsInput) (req *request.Requ // See the AWS API reference guide for Amazon GuardDuty's // API operation ListIPSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ListIPSets @@ -2801,10 +3063,12 @@ func (c *GuardDuty) ListIPSetsPagesWithContext(ctx aws.Context, input *ListIPSet }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListIPSetsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListIPSetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2868,11 +3132,11 @@ func (c *GuardDuty) ListInvitationsRequest(input *ListInvitationsInput) (req *re // See the AWS API reference guide for Amazon GuardDuty's // API operation ListInvitations for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ListInvitations @@ -2940,10 +3204,12 @@ func (c *GuardDuty) ListInvitationsPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInvitationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListInvitationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3007,11 +3273,11 @@ func (c *GuardDuty) ListMembersRequest(input *ListMembersInput) (req *request.Re // See the AWS API reference guide for Amazon GuardDuty's // API operation ListMembers for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ListMembers @@ -3079,133 +3345,275 @@ func (c *GuardDuty) ListMembersPagesWithContext(ctx aws.Context, input *ListMemb }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListMembersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListMembersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opListTagsForResource = "ListTagsForResource" +const opListPublishingDestinations = "ListPublishingDestinations" -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource operation. The "output" return +// ListPublishingDestinationsRequest generates a "aws/request.Request" representing the +// client's request for the ListPublishingDestinations operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListTagsForResource for more information on using the ListTagsForResource +// See ListPublishingDestinations for more information on using the ListPublishingDestinations // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) +// // Example sending a request using the ListPublishingDestinationsRequest method. +// req, resp := client.ListPublishingDestinationsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ListTagsForResource -func (c *GuardDuty) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ListPublishingDestinations +func (c *GuardDuty) ListPublishingDestinationsRequest(input *ListPublishingDestinationsInput) (req *request.Request, output *ListPublishingDestinationsOutput) { op := &request.Operation{ - Name: opListTagsForResource, + Name: opListPublishingDestinations, HTTPMethod: "GET", - HTTPPath: "/tags/{resourceArn}", + HTTPPath: "/detector/{detectorId}/publishingDestination", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &ListTagsForResourceInput{} + input = &ListPublishingDestinationsInput{} } - output = &ListTagsForResourceOutput{} + output = &ListPublishingDestinationsOutput{} req = c.newRequest(op, input, output) return } -// ListTagsForResource API operation for Amazon GuardDuty. +// ListPublishingDestinations API operation for Amazon GuardDuty. // -// Lists tags for a resource. Tagging is currently supported for detectors, -// finding filters, IP sets, and Threat Intel sets, with a limit of 50 tags -// per resource. When invoked, this operation returns all assigned tags for -// a given resource.. +// Returns a list of publishing destinations associated with the specified dectectorId. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon GuardDuty's -// API operation ListTagsForResource for usage and error information. +// API operation ListPublishingDestinations for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ListTagsForResource -func (c *GuardDuty) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ListPublishingDestinations +func (c *GuardDuty) ListPublishingDestinations(input *ListPublishingDestinationsInput) (*ListPublishingDestinationsOutput, error) { + req, out := c.ListPublishingDestinationsRequest(input) return out, req.Send() } -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// ListPublishingDestinationsWithContext is the same as ListPublishingDestinations with the addition of // the ability to pass a context and additional request options. // -// See ListTagsForResource for details on how to use this API operation. +// See ListPublishingDestinations for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *GuardDuty) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) +func (c *GuardDuty) ListPublishingDestinationsWithContext(ctx aws.Context, input *ListPublishingDestinationsInput, opts ...request.Option) (*ListPublishingDestinationsOutput, error) { + req, out := c.ListPublishingDestinationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListThreatIntelSets = "ListThreatIntelSets" - -// ListThreatIntelSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListThreatIntelSets operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListThreatIntelSets for more information on using the ListThreatIntelSets -// API call, and error handling. +// ListPublishingDestinationsPages iterates over the pages of a ListPublishingDestinations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. // -// 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. +// See ListPublishingDestinations method for more information on how to use this operation. // +// Note: This operation can generate multiple requests to a service. // -// // Example sending a request using the ListThreatIntelSetsRequest method. -// req, resp := client.ListThreatIntelSetsRequest(params) +// // Example iterating over at most 3 pages of a ListPublishingDestinations operation. +// pageNum := 0 +// err := client.ListPublishingDestinationsPages(params, +// func(page *guardduty.ListPublishingDestinationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) // -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } +func (c *GuardDuty) ListPublishingDestinationsPages(input *ListPublishingDestinationsInput, fn func(*ListPublishingDestinationsOutput, bool) bool) error { + return c.ListPublishingDestinationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListPublishingDestinationsPagesWithContext same as ListPublishingDestinationsPages except +// it takes a Context and allows setting request options on the pages. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ListThreatIntelSets -func (c *GuardDuty) ListThreatIntelSetsRequest(input *ListThreatIntelSetsInput) (req *request.Request, output *ListThreatIntelSetsOutput) { - op := &request.Operation{ - Name: opListThreatIntelSets, - HTTPMethod: "GET", - HTTPPath: "/detector/{detectorId}/threatintelset", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GuardDuty) ListPublishingDestinationsPagesWithContext(ctx aws.Context, input *ListPublishingDestinationsInput, fn func(*ListPublishingDestinationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListPublishingDestinationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListPublishingDestinationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListPublishingDestinationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ListTagsForResource +func (c *GuardDuty) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { + op := &request.Operation{ + Name: opListTagsForResource, + HTTPMethod: "GET", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &ListTagsForResourceInput{} + } + + output = &ListTagsForResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTagsForResource API operation for Amazon GuardDuty. +// +// Lists tags for a resource. Tagging is currently supported for detectors, +// finding filters, IP sets, and Threat Intel sets, with a limit of 50 tags +// per resource. When invoked, this operation returns all assigned tags for +// a given 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 GuardDuty's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Bad request exception object. +// +// * InternalServerErrorException +// Internal server error exception object. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ListTagsForResource +func (c *GuardDuty) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GuardDuty) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListThreatIntelSets = "ListThreatIntelSets" + +// ListThreatIntelSetsRequest generates a "aws/request.Request" representing the +// client's request for the ListThreatIntelSets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListThreatIntelSets for more information on using the ListThreatIntelSets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListThreatIntelSetsRequest method. +// req, resp := client.ListThreatIntelSetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ListThreatIntelSets +func (c *GuardDuty) ListThreatIntelSetsRequest(input *ListThreatIntelSetsInput) (req *request.Request, output *ListThreatIntelSetsOutput) { + op := &request.Operation{ + Name: opListThreatIntelSets, + HTTPMethod: "GET", + HTTPPath: "/detector/{detectorId}/threatintelset", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", TruncationToken: "", }, } @@ -3222,7 +3630,8 @@ func (c *GuardDuty) ListThreatIntelSetsRequest(input *ListThreatIntelSetsInput) // ListThreatIntelSets API operation for Amazon GuardDuty. // // Lists the ThreatIntelSets of the GuardDuty service specified by the detector -// ID. +// ID. If you use this operation from a member account, the ThreatIntelSets +// associated with the master account 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 @@ -3231,11 +3640,11 @@ func (c *GuardDuty) ListThreatIntelSetsRequest(input *ListThreatIntelSetsInput) // See the AWS API reference guide for Amazon GuardDuty's // API operation ListThreatIntelSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/ListThreatIntelSets @@ -3303,10 +3712,12 @@ func (c *GuardDuty) ListThreatIntelSetsPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListThreatIntelSetsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListThreatIntelSetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3354,9 +3765,9 @@ func (c *GuardDuty) StartMonitoringMembersRequest(input *StartMonitoringMembersI // StartMonitoringMembers API operation for Amazon GuardDuty. // -// Re-enables GuardDuty to monitor findings of the member accounts specified -// by the account IDs. A master GuardDuty account can run this command after -// disabling GuardDuty from monitoring these members' findings by running StopMonitoringMembers. +// Turns on GuardDuty monitoring of the specified member accounts. Use this +// operation to restart monitoring of accounts that you stopped monitoring with +// the StopMonitoringMembers 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 @@ -3365,11 +3776,11 @@ func (c *GuardDuty) StartMonitoringMembersRequest(input *StartMonitoringMembersI // See the AWS API reference guide for Amazon GuardDuty's // API operation StartMonitoringMembers for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/StartMonitoringMembers @@ -3438,10 +3849,8 @@ func (c *GuardDuty) StopMonitoringMembersRequest(input *StopMonitoringMembersInp // StopMonitoringMembers API operation for Amazon GuardDuty. // -// Disables GuardDuty from monitoring findings of the member accounts specified -// by the account IDs. After running this command, a master GuardDuty account -// can run StartMonitoringMembers to re-enable GuardDuty to monitor these members’ -// findings. +// Stops GuardDuty monitoring for the specified member accounnts. Use the StartMonitoringMembers +// to restart monitoring for those 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 @@ -3450,11 +3859,11 @@ func (c *GuardDuty) StopMonitoringMembersRequest(input *StopMonitoringMembersInp // See the AWS API reference guide for Amazon GuardDuty's // API operation StopMonitoringMembers for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/StopMonitoringMembers @@ -3533,11 +3942,11 @@ func (c *GuardDuty) TagResourceRequest(input *TagResourceInput) (req *request.Re // See the AWS API reference guide for Amazon GuardDuty's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/TagResource @@ -3607,7 +4016,7 @@ func (c *GuardDuty) UnarchiveFindingsRequest(input *UnarchiveFindingsInput) (req // UnarchiveFindings API operation for Amazon GuardDuty. // -// Unarchives Amazon GuardDuty findings specified by the list of finding IDs. +// Unarchives GuardDuty findings specified by the findingIds. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3616,11 +4025,11 @@ func (c *GuardDuty) UnarchiveFindingsRequest(input *UnarchiveFindingsInput) (req // See the AWS API reference guide for Amazon GuardDuty's // API operation UnarchiveFindings for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/UnarchiveFindings @@ -3699,11 +4108,11 @@ func (c *GuardDuty) UntagResourceRequest(input *UntagResourceInput) (req *reques // See the AWS API reference guide for Amazon GuardDuty's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/UntagResource @@ -3773,7 +4182,7 @@ func (c *GuardDuty) UpdateDetectorRequest(input *UpdateDetectorInput) (req *requ // UpdateDetector API operation for Amazon GuardDuty. // -// Updates an Amazon GuardDuty detector specified by the detectorId. +// Updates the Amazon GuardDuty detector specified by the detectorId. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3782,11 +4191,11 @@ func (c *GuardDuty) UpdateDetectorRequest(input *UpdateDetectorInput) (req *requ // See the AWS API reference guide for Amazon GuardDuty's // API operation UpdateDetector for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/UpdateDetector @@ -3864,11 +4273,11 @@ func (c *GuardDuty) UpdateFilterRequest(input *UpdateFilterInput) (req *request. // See the AWS API reference guide for Amazon GuardDuty's // API operation UpdateFilter for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/UpdateFilter @@ -3938,7 +4347,7 @@ func (c *GuardDuty) UpdateFindingsFeedbackRequest(input *UpdateFindingsFeedbackI // UpdateFindingsFeedback API operation for Amazon GuardDuty. // -// Marks specified Amazon GuardDuty findings as useful or not useful. +// Marks the specified GuardDuty findings as useful or not useful. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3947,11 +4356,11 @@ func (c *GuardDuty) UpdateFindingsFeedbackRequest(input *UpdateFindingsFeedbackI // See the AWS API reference guide for Amazon GuardDuty's // API operation UpdateFindingsFeedback for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/UpdateFindingsFeedback @@ -4030,11 +4439,11 @@ func (c *GuardDuty) UpdateIPSetRequest(input *UpdateIPSetInput) (req *request.Re // See the AWS API reference guide for Amazon GuardDuty's // API operation UpdateIPSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/UpdateIPSet @@ -4059,6 +4468,89 @@ func (c *GuardDuty) UpdateIPSetWithContext(ctx aws.Context, input *UpdateIPSetIn return out, req.Send() } +const opUpdatePublishingDestination = "UpdatePublishingDestination" + +// UpdatePublishingDestinationRequest generates a "aws/request.Request" representing the +// client's request for the UpdatePublishingDestination operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdatePublishingDestination for more information on using the UpdatePublishingDestination +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdatePublishingDestinationRequest method. +// req, resp := client.UpdatePublishingDestinationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/UpdatePublishingDestination +func (c *GuardDuty) UpdatePublishingDestinationRequest(input *UpdatePublishingDestinationInput) (req *request.Request, output *UpdatePublishingDestinationOutput) { + op := &request.Operation{ + Name: opUpdatePublishingDestination, + HTTPMethod: "POST", + HTTPPath: "/detector/{detectorId}/publishingDestination/{destinationId}", + } + + if input == nil { + input = &UpdatePublishingDestinationInput{} + } + + output = &UpdatePublishingDestinationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdatePublishingDestination API operation for Amazon GuardDuty. +// +// Updates information about the publishing destination specified by the destinationId. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon GuardDuty's +// API operation UpdatePublishingDestination for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Bad request exception object. +// +// * InternalServerErrorException +// Internal server error exception object. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/UpdatePublishingDestination +func (c *GuardDuty) UpdatePublishingDestination(input *UpdatePublishingDestinationInput) (*UpdatePublishingDestinationOutput, error) { + req, out := c.UpdatePublishingDestinationRequest(input) + return out, req.Send() +} + +// UpdatePublishingDestinationWithContext is the same as UpdatePublishingDestination with the addition of +// the ability to pass a context and additional request options. +// +// See UpdatePublishingDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *GuardDuty) UpdatePublishingDestinationWithContext(ctx aws.Context, input *UpdatePublishingDestinationInput, opts ...request.Option) (*UpdatePublishingDestinationOutput, error) { + req, out := c.UpdatePublishingDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opUpdateThreatIntelSet = "UpdateThreatIntelSet" // UpdateThreatIntelSetRequest generates a "aws/request.Request" representing the @@ -4113,11 +4605,11 @@ func (c *GuardDuty) UpdateThreatIntelSetRequest(input *UpdateThreatIntelSetInput // See the AWS API reference guide for Amazon GuardDuty's // API operation UpdateThreatIntelSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Bad request exception object. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Internal server error exception object. // // See also, https://docs.aws.amazon.com/goto/WebAPI/guardduty-2017-11-28/UpdateThreatIntelSet @@ -4525,6 +5017,66 @@ func (s *AwsApiCallAction) SetServiceName(v string) *AwsApiCallAction { return s } +// Bad request exception object. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message. + Message_ *string `locationName:"message" type:"string"` + + // The error type. + Type *string `locationName:"__type" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains information about the city associated with the IP address. type City struct { _ struct{} `type:"structure"` @@ -4553,8 +5105,8 @@ func (s *City) SetCityName(v string) *City { type Condition struct { _ struct{} `type:"structure"` - // Deprecated. Represents the equal condition to be applied to a single field - // when querying for findings. + // Represents the equal condition to be applied to a single field when querying + // for findings. // // Deprecated: Eq has been deprecated Eq []*string `locationName:"eq" deprecated:"true" type:"list"` @@ -4571,14 +5123,14 @@ type Condition struct { // when querying for findings. GreaterThanOrEqual *int64 `locationName:"greaterThanOrEqual" type:"long"` - // Deprecated. Represents a greater than condition to be applied to a single - // field when querying for findings. + // Represents a greater than condition to be applied to a single field when + // querying for findings. // // Deprecated: Gt has been deprecated Gt *int64 `locationName:"gt" deprecated:"true" type:"integer"` - // Deprecated. Represents a greater than equal condition to be applied to a - // single field when querying for findings. + // Represents a greater than equal condition to be applied to a single field + // when querying for findings. // // Deprecated: Gte has been deprecated Gte *int64 `locationName:"gte" deprecated:"true" type:"integer"` @@ -4591,20 +5143,20 @@ type Condition struct { // querying for findings. LessThanOrEqual *int64 `locationName:"lessThanOrEqual" type:"long"` - // Deprecated. Represents a less than condition to be applied to a single field - // when querying for findings. + // Represents a less than condition to be applied to a single field when querying + // for findings. // // Deprecated: Lt has been deprecated Lt *int64 `locationName:"lt" deprecated:"true" type:"integer"` - // Deprecated. Represents a less than equal condition to be applied to a single - // field when querying for findings. + // Represents a less than equal condition to be applied to a single field when + // querying for findings. // // Deprecated: Lte has been deprecated Lte *int64 `locationName:"lte" deprecated:"true" type:"integer"` - // Deprecated. Represents the not equal condition to be applied to a single - // field when querying for findings. + // Represents the not equal condition to be applied to a single field when querying + // for findings. // // Deprecated: Neq has been deprecated Neq []*string `locationName:"neq" deprecated:"true" type:"list"` @@ -4696,7 +5248,8 @@ func (s *Condition) SetNotEquals(v []*string) *Condition { return s } -// Contains information about the country. +// Contains information about the country in which the remote IP address is +// located. type Country struct { _ struct{} `type:"structure"` @@ -5226,6 +5779,114 @@ func (s *CreateMembersOutput) SetUnprocessedAccounts(v []*UnprocessedAccount) *C return s } +type CreatePublishingDestinationInput struct { + _ struct{} `type:"structure"` + + // The idempotency token for the request. + ClientToken *string `locationName:"clientToken" type:"string" idempotencyToken:"true"` + + // Properties of the publishing destination, including the ARNs for the destination + // and the KMS key used for encryption. + // + // DestinationProperties is a required field + DestinationProperties *DestinationProperties `locationName:"destinationProperties" type:"structure" required:"true"` + + // The type of resource for the publishing destination. Currently only S3 is + // supported. + // + // DestinationType is a required field + DestinationType *string `locationName:"destinationType" min:"1" type:"string" required:"true" enum:"DestinationType"` + + // The ID of the GuardDuty detector associated with the publishing destination. + // + // DetectorId is a required field + DetectorId *string `location:"uri" locationName:"detectorId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreatePublishingDestinationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePublishingDestinationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreatePublishingDestinationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreatePublishingDestinationInput"} + if s.DestinationProperties == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationProperties")) + } + if s.DestinationType == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationType")) + } + if s.DestinationType != nil && len(*s.DestinationType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DestinationType", 1)) + } + if s.DetectorId == nil { + invalidParams.Add(request.NewErrParamRequired("DetectorId")) + } + if s.DetectorId != nil && len(*s.DetectorId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DetectorId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreatePublishingDestinationInput) SetClientToken(v string) *CreatePublishingDestinationInput { + s.ClientToken = &v + return s +} + +// SetDestinationProperties sets the DestinationProperties field's value. +func (s *CreatePublishingDestinationInput) SetDestinationProperties(v *DestinationProperties) *CreatePublishingDestinationInput { + s.DestinationProperties = v + return s +} + +// SetDestinationType sets the DestinationType field's value. +func (s *CreatePublishingDestinationInput) SetDestinationType(v string) *CreatePublishingDestinationInput { + s.DestinationType = &v + return s +} + +// SetDetectorId sets the DetectorId field's value. +func (s *CreatePublishingDestinationInput) SetDetectorId(v string) *CreatePublishingDestinationInput { + s.DetectorId = &v + return s +} + +type CreatePublishingDestinationOutput struct { + _ struct{} `type:"structure"` + + // The ID of the publishing destination created. + // + // DestinationId is a required field + DestinationId *string `locationName:"destinationId" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreatePublishingDestinationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePublishingDestinationOutput) GoString() string { + return s.String() +} + +// SetDestinationId sets the DestinationId field's value. +func (s *CreatePublishingDestinationOutput) SetDestinationId(v string) *CreatePublishingDestinationOutput { + s.DestinationId = &v + return s +} + type CreateSampleFindingsInput struct { _ struct{} `type:"structure"` @@ -5234,7 +5895,7 @@ type CreateSampleFindingsInput struct { // DetectorId is a required field DetectorId *string `location:"uri" locationName:"detectorId" min:"1" type:"string" required:"true"` - // Types of sample findings that you want to generate. + // Types of sample findings to generate. FindingTypes []*string `locationName:"findingTypes" type:"list"` } @@ -5643,12 +6304,12 @@ func (s DeleteFilterOutput) GoString() string { type DeleteIPSetInput struct { _ struct{} `type:"structure"` - // The unique ID of the detector the ipSet is associated with. + // The unique ID of the detector associated with the IPSet. // // DetectorId is a required field DetectorId *string `location:"uri" locationName:"detectorId" min:"1" type:"string" required:"true"` - // The unique ID of the ipSet you want to delete. + // The unique ID of the IPSet to delete. // // IpSetId is a required field IpSetId *string `location:"uri" locationName:"ipSetId" type:"string" required:"true"` @@ -5864,6 +6525,79 @@ func (s *DeleteMembersOutput) SetUnprocessedAccounts(v []*UnprocessedAccount) *D return s } +type DeletePublishingDestinationInput struct { + _ struct{} `type:"structure"` + + // The ID of the publishing destination to delete. + // + // DestinationId is a required field + DestinationId *string `location:"uri" locationName:"destinationId" type:"string" required:"true"` + + // The unique ID of the detector associated with the publishing destination + // to delete. + // + // DetectorId is a required field + DetectorId *string `location:"uri" locationName:"detectorId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeletePublishingDestinationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePublishingDestinationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeletePublishingDestinationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeletePublishingDestinationInput"} + 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.DetectorId == nil { + invalidParams.Add(request.NewErrParamRequired("DetectorId")) + } + if s.DetectorId != nil && len(*s.DetectorId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DetectorId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDestinationId sets the DestinationId field's value. +func (s *DeletePublishingDestinationInput) SetDestinationId(v string) *DeletePublishingDestinationInput { + s.DestinationId = &v + return s +} + +// SetDetectorId sets the DetectorId field's value. +func (s *DeletePublishingDestinationInput) SetDetectorId(v string) *DeletePublishingDestinationInput { + s.DetectorId = &v + return s +} + +type DeletePublishingDestinationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeletePublishingDestinationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePublishingDestinationOutput) GoString() string { + return s.String() +} + type DeleteThreatIntelSetInput struct { _ struct{} `type:"structure"` @@ -5910,32 +6644,246 @@ func (s *DeleteThreatIntelSetInput) Validate() error { return nil } -// SetDetectorId sets the DetectorId field's value. -func (s *DeleteThreatIntelSetInput) SetDetectorId(v string) *DeleteThreatIntelSetInput { - s.DetectorId = &v +// SetDetectorId sets the DetectorId field's value. +func (s *DeleteThreatIntelSetInput) SetDetectorId(v string) *DeleteThreatIntelSetInput { + s.DetectorId = &v + return s +} + +// SetThreatIntelSetId sets the ThreatIntelSetId field's value. +func (s *DeleteThreatIntelSetInput) SetThreatIntelSetId(v string) *DeleteThreatIntelSetInput { + s.ThreatIntelSetId = &v + return s +} + +type DeleteThreatIntelSetOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteThreatIntelSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteThreatIntelSetOutput) GoString() string { + return s.String() +} + +type DescribePublishingDestinationInput struct { + _ struct{} `type:"structure"` + + // The ID of the publishing destination to retrieve. + // + // DestinationId is a required field + DestinationId *string `location:"uri" locationName:"destinationId" type:"string" required:"true"` + + // The unique ID of the detector associated with the publishing destination + // to retrieve. + // + // DetectorId is a required field + DetectorId *string `location:"uri" locationName:"detectorId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribePublishingDestinationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribePublishingDestinationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribePublishingDestinationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribePublishingDestinationInput"} + 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.DetectorId == nil { + invalidParams.Add(request.NewErrParamRequired("DetectorId")) + } + if s.DetectorId != nil && len(*s.DetectorId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DetectorId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDestinationId sets the DestinationId field's value. +func (s *DescribePublishingDestinationInput) SetDestinationId(v string) *DescribePublishingDestinationInput { + s.DestinationId = &v + return s +} + +// SetDetectorId sets the DetectorId field's value. +func (s *DescribePublishingDestinationInput) SetDetectorId(v string) *DescribePublishingDestinationInput { + s.DetectorId = &v + return s +} + +type DescribePublishingDestinationOutput struct { + _ struct{} `type:"structure"` + + // The ID of the publishing destination. + // + // DestinationId is a required field + DestinationId *string `locationName:"destinationId" type:"string" required:"true"` + + // A DestinationProperties object that includes the DestinationArn and KmsKeyArn + // of the publishing destination. + // + // DestinationProperties is a required field + DestinationProperties *DestinationProperties `locationName:"destinationProperties" type:"structure" required:"true"` + + // The type of the publishing destination. Currently, only S3 is supported. + // + // DestinationType is a required field + DestinationType *string `locationName:"destinationType" min:"1" type:"string" required:"true" enum:"DestinationType"` + + // The time, in epoch millisecond format, at which GuardDuty was first unable + // to publish findings to the destination. + // + // PublishingFailureStartTimestamp is a required field + PublishingFailureStartTimestamp *int64 `locationName:"publishingFailureStartTimestamp" type:"long" required:"true"` + + // The status of the publishing destination. + // + // Status is a required field + Status *string `locationName:"status" min:"1" type:"string" required:"true" enum:"PublishingStatus"` +} + +// String returns the string representation +func (s DescribePublishingDestinationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribePublishingDestinationOutput) GoString() string { + return s.String() +} + +// SetDestinationId sets the DestinationId field's value. +func (s *DescribePublishingDestinationOutput) SetDestinationId(v string) *DescribePublishingDestinationOutput { + s.DestinationId = &v + return s +} + +// SetDestinationProperties sets the DestinationProperties field's value. +func (s *DescribePublishingDestinationOutput) SetDestinationProperties(v *DestinationProperties) *DescribePublishingDestinationOutput { + s.DestinationProperties = v + return s +} + +// SetDestinationType sets the DestinationType field's value. +func (s *DescribePublishingDestinationOutput) SetDestinationType(v string) *DescribePublishingDestinationOutput { + s.DestinationType = &v + return s +} + +// SetPublishingFailureStartTimestamp sets the PublishingFailureStartTimestamp field's value. +func (s *DescribePublishingDestinationOutput) SetPublishingFailureStartTimestamp(v int64) *DescribePublishingDestinationOutput { + s.PublishingFailureStartTimestamp = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribePublishingDestinationOutput) SetStatus(v string) *DescribePublishingDestinationOutput { + s.Status = &v + return s +} + +// Contains information about a publishing destination, including the ID, type, +// and status. +type Destination struct { + _ struct{} `type:"structure"` + + // The unique ID of the publishing destination. + // + // DestinationId is a required field + DestinationId *string `locationName:"destinationId" type:"string" required:"true"` + + // The type of resource used for the publishing destination. Currently, only + // S3 is supported. + // + // DestinationType is a required field + DestinationType *string `locationName:"destinationType" min:"1" type:"string" required:"true" enum:"DestinationType"` + + // The status of the publishing destination. + // + // Status is a required field + Status *string `locationName:"status" min:"1" type:"string" required:"true" enum:"PublishingStatus"` +} + +// 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() +} + +// SetDestinationId sets the DestinationId field's value. +func (s *Destination) SetDestinationId(v string) *Destination { + s.DestinationId = &v return s } -// SetThreatIntelSetId sets the ThreatIntelSetId field's value. -func (s *DeleteThreatIntelSetInput) SetThreatIntelSetId(v string) *DeleteThreatIntelSetInput { - s.ThreatIntelSetId = &v +// SetDestinationType sets the DestinationType field's value. +func (s *Destination) SetDestinationType(v string) *Destination { + s.DestinationType = &v return s } -type DeleteThreatIntelSetOutput struct { +// SetStatus sets the Status field's value. +func (s *Destination) SetStatus(v string) *Destination { + s.Status = &v + return s +} + +// Contains the ARN of the resource to publish to, such as an S3 bucket, and +// the ARN of the KMS key to use to encrypt published findings. +type DestinationProperties struct { _ struct{} `type:"structure"` + + // The ARN of the resource to publish to. + DestinationArn *string `locationName:"destinationArn" type:"string"` + + // The ARN of the KMS key to use for encryption. + KmsKeyArn *string `locationName:"kmsKeyArn" type:"string"` } // String returns the string representation -func (s DeleteThreatIntelSetOutput) String() string { +func (s DestinationProperties) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteThreatIntelSetOutput) GoString() string { +func (s DestinationProperties) GoString() string { return s.String() } +// SetDestinationArn sets the DestinationArn field's value. +func (s *DestinationProperties) SetDestinationArn(v string) *DestinationProperties { + s.DestinationArn = &v + return s +} + +// SetKmsKeyArn sets the KmsKeyArn field's value. +func (s *DestinationProperties) SetKmsKeyArn(v string) *DestinationProperties { + s.KmsKeyArn = &v + return s +} + type DisassociateFromMasterAccountInput struct { _ struct{} `type:"structure"` @@ -6077,11 +7025,11 @@ func (s *DisassociateMembersOutput) SetUnprocessedAccounts(v []*UnprocessedAccou return s } -// Contains information about the DNS request. +// Contains information about the DNS_REQUEST action described in this finding. type DnsRequestAction struct { _ struct{} `type:"structure"` - // Domain information for the DNS request. + // Domain information for the API request. Domain *string `locationName:"domain" type:"string"` } @@ -6149,7 +7097,8 @@ func (s *Evidence) SetThreatIntelligenceDetails(v []*ThreatIntelligenceDetail) * return s } -// Contains information about the finding. +// Contains information about the finding, which is generated when abnormal +// or suspicious activity is detected. type Finding struct { _ struct{} `type:"structure"` @@ -6187,7 +7136,8 @@ type Finding struct { // Region is a required field Region *string `locationName:"region" type:"string" required:"true"` - // Contains information about the resource. + // Contains information about the AWS resource associated with the activity + // that prompted GuardDuty to generate a finding. // // Resource is a required field Resource *Resource `locationName:"resource" type:"structure" required:"true"` @@ -6197,7 +7147,7 @@ type Finding struct { // SchemaVersion is a required field SchemaVersion *string `locationName:"schemaVersion" type:"string" required:"true"` - // Contains information about the service. + // Contains additional information about the generated finding. Service *Service `locationName:"service" type:"structure"` // The severity of the finding. @@ -6319,7 +7269,7 @@ func (s *Finding) SetUpdatedAt(v string) *Finding { return s } -// Contains finding criteria information. +// Contains information about the criteria used for querying findings. type FindingCriteria struct { _ struct{} `type:"structure"` @@ -6368,7 +7318,7 @@ func (s *FindingStatistics) SetCountBySeverity(v map[string]*int64) *FindingStat return s } -// Contains information about the +// Contains information about the location of the remote IP address. type GeoLocation struct { _ struct{} `type:"structure"` @@ -6836,7 +7786,7 @@ type GetIPSetInput struct { // DetectorId is a required field DetectorId *string `location:"uri" locationName:"detectorId" min:"1" type:"string" required:"true"` - // The unique ID of the ipSet you want to get. + // The unique ID of the IPSet to retrieve. // // IpSetId is a required field IpSetId *string `location:"uri" locationName:"ipSetId" type:"string" required:"true"` @@ -6899,9 +7849,7 @@ type GetIPSetOutput struct { // Location is a required field Location *string `locationName:"location" min:"1" type:"string" required:"true"` - // The user friendly name to identify the IPSet. This name is displayed in all - // findings that are triggered by activity that involves IP addresses included - // in this IPSet. + // The user friendly name for the IPSet. // // Name is a required field Name *string `locationName:"name" min:"1" type:"string" required:"true"` @@ -7280,7 +8228,7 @@ func (s *GetThreatIntelSetOutput) SetTags(v map[string]*string) *GetThreatIntelS return s } -// Contains information about the instance profile. +// Contains information about the EC2 instance profile. type IamInstanceProfile struct { _ struct{} `type:"structure"` @@ -7436,17 +8384,78 @@ func (s *InstanceDetails) SetTags(v []*Tag) *InstanceDetails { return s } -// Contains information about the invitation. +// Internal server error exception object. +type InternalServerErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The error message. + Message_ *string `locationName:"message" type:"string"` + + // The error type. + Type *string `locationName:"__type" type:"string"` +} + +// String returns the string representation +func (s InternalServerErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerErrorException) GoString() string { + return s.String() +} + +func newErrorInternalServerErrorException(v protocol.ResponseMetadata) error { + return &InternalServerErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerErrorException) Code() string { + return "InternalServerErrorException" +} + +// Message returns the exception's message. +func (s InternalServerErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerErrorException) OrigErr() error { + return nil +} + +func (s InternalServerErrorException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// Contains information about the invitation to become a member account. type Invitation struct { _ struct{} `type:"structure"` - // Inviter account ID + // The ID of the account from which the invitations was sent. AccountId *string `locationName:"accountId" min:"12" type:"string"` - // This value is used to validate the inviter account to the member account. + // The ID of the invitation. This value is used to validate the inviter account + // to the member account. InvitationId *string `locationName:"invitationId" type:"string"` - // Timestamp at which the invitation was sent + // Timestamp at which the invitation was sent. InvitedAt *string `locationName:"invitedAt" type:"string"` // The status of the relationship between the inviter and invitee accounts. @@ -7787,7 +8796,108 @@ type ListFindingsInput struct { // DetectorId is a required field DetectorId *string `location:"uri" locationName:"detectorId" min:"1" type:"string" required:"true"` - // Represents the criteria used for querying findings. + // Represents the criteria used for querying findings. Valid values include: + // + // * JSON field name + // + // * accountId + // + // * region + // + // * confidence + // + // * id + // + // * resource.accessKeyDetails.accessKeyId + // + // * resource.accessKeyDetails.principalId + // + // * resource.accessKeyDetails.userName + // + // * resource.accessKeyDetails.userType + // + // * resource.instanceDetails.iamInstanceProfile.id + // + // * resource.instanceDetails.imageId + // + // * resource.instanceDetails.instanceId + // + // * resource.instanceDetails.networkInterfaces.ipv6Addresses + // + // * resource.instanceDetails.networkInterfaces.privateIpAddresses.privateIpAddress + // + // * resource.instanceDetails.networkInterfaces.publicDnsName + // + // * resource.instanceDetails.networkInterfaces.publicIp + // + // * resource.instanceDetails.networkInterfaces.securityGroups.groupId + // + // * resource.instanceDetails.networkInterfaces.securityGroups.groupName + // + // * resource.instanceDetails.networkInterfaces.subnetId + // + // * resource.instanceDetails.networkInterfaces.vpcId + // + // * resource.instanceDetails.tags.key + // + // * resource.instanceDetails.tags.value + // + // * resource.resourceType + // + // * service.action.actionType + // + // * service.action.awsApiCallAction.api + // + // * service.action.awsApiCallAction.callerType + // + // * service.action.awsApiCallAction.remoteIpDetails.city.cityName + // + // * service.action.awsApiCallAction.remoteIpDetails.country.countryName + // + // * service.action.awsApiCallAction.remoteIpDetails.ipAddressV4 + // + // * service.action.awsApiCallAction.remoteIpDetails.organization.asn + // + // * service.action.awsApiCallAction.remoteIpDetails.organization.asnOrg + // + // * service.action.awsApiCallAction.serviceName + // + // * service.action.dnsRequestAction.domain + // + // * service.action.networkConnectionAction.blocked + // + // * service.action.networkConnectionAction.connectionDirection + // + // * service.action.networkConnectionAction.localPortDetails.port + // + // * service.action.networkConnectionAction.protocol + // + // * service.action.networkConnectionAction.remoteIpDetails.city.cityName + // + // * service.action.networkConnectionAction.remoteIpDetails.country.countryName + // + // * service.action.networkConnectionAction.remoteIpDetails.ipAddressV4 + // + // * service.action.networkConnectionAction.remoteIpDetails.organization.asn + // + // * service.action.networkConnectionAction.remoteIpDetails.organization.asnOrg + // + // * service.action.networkConnectionAction.remotePortDetails.port + // + // * service.additionalInfo.threatListName + // + // * service.archived When this attribute is set to 'true', only archived + // findings are listed. When it's set to 'false', only unarchived findings + // are listed. When this attribute is not set, all existing findings are + // listed. + // + // * service.resourceRole + // + // * severity + // + // * type + // + // * updatedAt Type: Timestamp in Unix Epoch millisecond format: 1486685375000 FindingCriteria *FindingCriteria `locationName:"findingCriteria" type:"structure"` // You can use this parameter to indicate the maximum number of items you want @@ -8190,6 +9300,109 @@ func (s *ListMembersOutput) SetNextToken(v string) *ListMembersOutput { return s } +type ListPublishingDestinationsInput struct { + _ struct{} `type:"structure"` + + // The ID of the detector to retrieve publishing destinations for. + // + // DetectorId is a required field + DetectorId *string `location:"uri" locationName:"detectorId" min:"1" type:"string" required:"true"` + + // The maximum number of results to return in the response. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // A token to use for paginating results returned in the repsonse. Set the value + // of this parameter to null for the first request to a list action. For subsequent + // calls, use the NextToken value returned from the previous request to continue + // listing results after the first page. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListPublishingDestinationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPublishingDestinationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListPublishingDestinationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListPublishingDestinationsInput"} + if s.DetectorId == nil { + invalidParams.Add(request.NewErrParamRequired("DetectorId")) + } + if s.DetectorId != nil && len(*s.DetectorId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DetectorId", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDetectorId sets the DetectorId field's value. +func (s *ListPublishingDestinationsInput) SetDetectorId(v string) *ListPublishingDestinationsInput { + s.DetectorId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListPublishingDestinationsInput) SetMaxResults(v int64) *ListPublishingDestinationsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListPublishingDestinationsInput) SetNextToken(v string) *ListPublishingDestinationsInput { + s.NextToken = &v + return s +} + +type ListPublishingDestinationsOutput struct { + _ struct{} `type:"structure"` + + // A Destinations obect that includes information about each publishing destination + // returned. + // + // Destinations is a required field + Destinations []*Destination `locationName:"destinations" type:"list" required:"true"` + + // A token to use for paginating results returned in the repsonse. Set the value + // of this parameter to null for the first request to a list action. For subsequent + // calls, use the NextToken value returned from the previous request to continue + // listing results after the first page. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListPublishingDestinationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPublishingDestinationsOutput) GoString() string { + return s.String() +} + +// SetDestinations sets the Destinations field's value. +func (s *ListPublishingDestinationsOutput) SetDestinations(v []*Destination) *ListPublishingDestinationsOutput { + s.Destinations = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListPublishingDestinationsOutput) SetNextToken(v string) *ListPublishingDestinationsOutput { + s.NextToken = &v + return s +} + type ListTagsForResourceInput struct { _ struct{} `type:"structure"` @@ -8266,10 +9479,10 @@ type ListThreatIntelSetsInput struct { // in the response. The default value is 50. The maximum value is 50. MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - // You can use this parameter when paginating results. Set the value of this - // parameter to null on your first call to the list action. For subsequent calls - // to the action fill nextToken in the request with the value of NextToken from - // the previous response to continue listing data. + // You can use this parameter to paginate results in the response. Set the value + // of this parameter to null on your first call to the list action. For 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 `location:"querystring" locationName:"nextToken" type:"string"` } @@ -8527,7 +9740,8 @@ func (s *Member) SetUpdatedAt(v string) *Member { return s } -// Contains information about the network connection. +// Contains information about the NETWORK_CONNECTION action described in the +// finding. type NetworkConnectionAction struct { _ struct{} `type:"structure"` @@ -8596,7 +9810,7 @@ func (s *NetworkConnectionAction) SetRemotePortDetails(v *RemotePortDetails) *Ne return s } -// Contains information about the network interface. +// Contains information about the network interface of the Ec2 instance. type NetworkInterface struct { _ struct{} `type:"structure"` @@ -8701,7 +9915,7 @@ func (s *NetworkInterface) SetVpcId(v string) *NetworkInterface { return s } -// Continas information about the organization. +// Continas information about the ISP organization of the remote IP address. type Organization struct { _ struct{} `type:"structure"` @@ -8752,7 +9966,7 @@ func (s *Organization) SetOrg(v string) *Organization { return s } -// Contains information about the port probe. +// Contains information about the PORT_PROBE action described in the finding. type PortProbeAction struct { _ struct{} `type:"structure"` @@ -8818,7 +10032,7 @@ func (s *PortProbeDetail) SetRemoteIpDetails(v *RemoteIpDetails) *PortProbeDetai return s } -// Contains information about the private IP address. +// Contains other private IP address information of the EC2 instance. type PrivateIpAddressDetails struct { _ struct{} `type:"structure"` @@ -8851,7 +10065,7 @@ func (s *PrivateIpAddressDetails) SetPrivateIpAddress(v string) *PrivateIpAddres return s } -// Contains information about the product code. +// Contains information about the product code for the Ec2 instance. type ProductCode struct { _ struct{} `type:"structure"` @@ -8884,7 +10098,7 @@ func (s *ProductCode) SetProductType(v string) *ProductCode { return s } -// Continas information about the remote IP address. +// Continas information about the remote IP address of the connection. type RemoteIpDetails struct { _ struct{} `type:"structure"` @@ -8977,7 +10191,8 @@ func (s *RemotePortDetails) SetPortName(v string) *RemotePortDetails { return s } -// Contains information about the resource. +// Contains information about the AWS resource associated with the activity +// that prompted GuardDuty to generate a finding. type Resource struct { _ struct{} `type:"structure"` @@ -9021,7 +10236,7 @@ func (s *Resource) SetResourceType(v string) *Resource { return s } -// Contains information about the security group. +// Contains information about the security groups associated with the EC2 instance. type SecurityGroup struct { _ struct{} `type:"structure"` @@ -9054,7 +10269,7 @@ func (s *SecurityGroup) SetGroupName(v string) *SecurityGroup { return s } -// Contains information about the service. +// Contains additional information about the generated finding. type Service struct { _ struct{} `type:"structure"` @@ -9161,7 +10376,7 @@ func (s *Service) SetUserFeedback(v string) *Service { return s } -// Contains information about the criteria for sorting. +// Contains information about the criteria used for sorting findings. type SortCriteria struct { _ struct{} `type:"structure"` @@ -9198,14 +10413,13 @@ func (s *SortCriteria) SetOrderBy(v string) *SortCriteria { type StartMonitoringMembersInput struct { _ struct{} `type:"structure"` - // A list of account IDs of the GuardDuty member accounts whose findings you - // want the master account to monitor. + // A list of account IDs of the GuardDuty member accounts to start monitoring. // // AccountIds is a required field AccountIds []*string `locationName:"accountIds" min:"1" type:"list" required:"true"` - // The unique ID of the detector of the GuardDuty account whom you want to re-enable - // to monitor members' findings. + // The unique ID of the detector of the GuardDuty master account associated + // with the member accounts to monitor. // // DetectorId is a required field DetectorId *string `location:"uri" locationName:"detectorId" min:"1" type:"string" required:"true"` @@ -9367,7 +10581,7 @@ func (s *StopMonitoringMembersOutput) SetUnprocessedAccounts(v []*UnprocessedAcc return s } -// Contains information about the tag associated with the resource. +// Contains information about a tag associated with the Ec2 instance. type Tag struct { _ struct{} `type:"structure"` @@ -9403,7 +10617,8 @@ func (s *Tag) SetValue(v string) *Tag { type TagResourceInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) for the given GuardDuty resource + // The Amazon Resource Name (ARN) for the GuardDuty resource to apply a tag + // to. // // ResourceArn is a required field ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` @@ -9510,13 +10725,12 @@ func (s *ThreatIntelligenceDetail) SetThreatNames(v []*string) *ThreatIntelligen type UnarchiveFindingsInput struct { _ struct{} `type:"structure"` - // The ID of the detector that specifies the GuardDuty service whose findings - // you want to unarchive. + // The ID of the detector associated with the findings to unarchive. // // DetectorId is a required field DetectorId *string `location:"uri" locationName:"detectorId" min:"1" type:"string" required:"true"` - // IDs of the findings that you want to unarchive. + // IDs of the findings to unarchive. // // FindingIds is a required field FindingIds []*string `locationName:"findingIds" type:"list" required:"true"` @@ -9617,12 +10831,12 @@ func (s *UnprocessedAccount) SetResult(v string) *UnprocessedAccount { type UntagResourceInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) for the given GuardDuty resource + // The Amazon Resource Name (ARN) for the resource to remove tags from. // // ResourceArn is a required field ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` - // The tag keys to remove from a resource. + // The tag keys to remove from the resource. // // TagKeys is a required field TagKeys []*string `location:"querystring" locationName:"tagKeys" min:"1" type:"list" required:"true"` @@ -9689,16 +10903,16 @@ func (s UntagResourceOutput) GoString() string { type UpdateDetectorInput struct { _ struct{} `type:"structure"` - // The unique ID of the detector that you want to update. + // The unique ID of the detector to update. // // DetectorId is a required field DetectorId *string `location:"uri" locationName:"detectorId" min:"1" type:"string" required:"true"` - // Updated boolean value for the detector that specifies whether the detector - // is enabled. + // Specifies whether the detector is enabled or not enabled. Enable *bool `locationName:"enable" type:"boolean"` - // A enum value that specifies how frequently customer got Finding updates published. + // A enum value that specifies how frequently findings are exported, such as + // to CloudWatch Events. FindingPublishingFrequency *string `locationName:"findingPublishingFrequency" type:"string" enum:"FindingPublishingFrequency"` } @@ -9894,13 +11108,12 @@ type UpdateFindingsFeedbackInput struct { // Additional feedback about the GuardDuty findings. Comments *string `locationName:"comments" type:"string"` - // The ID of the detector that specifies the GuardDuty service whose findings - // you want to mark as useful or not useful. + // The ID of the detector associated with the findings to update feedback for. // // DetectorId is a required field DetectorId *string `location:"uri" locationName:"detectorId" min:"1" type:"string" required:"true"` - // Valid values: USEFUL | NOT_USEFUL + // The feedback for the finding. // // Feedback is a required field Feedback *string `locationName:"feedback" type:"string" required:"true" enum:"Feedback"` @@ -10087,6 +11300,88 @@ func (s UpdateIPSetOutput) GoString() string { return s.String() } +type UpdatePublishingDestinationInput struct { + _ struct{} `type:"structure"` + + // The ID of the detector associated with the publishing destinations to update. + // + // DestinationId is a required field + DestinationId *string `location:"uri" locationName:"destinationId" type:"string" required:"true"` + + // A DestinationProperties object that includes the DestinationArn and KmsKeyArn + // of the publishing destination. + DestinationProperties *DestinationProperties `locationName:"destinationProperties" type:"structure"` + + // The ID of the + // + // DetectorId is a required field + DetectorId *string `location:"uri" locationName:"detectorId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdatePublishingDestinationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdatePublishingDestinationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdatePublishingDestinationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdatePublishingDestinationInput"} + 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.DetectorId == nil { + invalidParams.Add(request.NewErrParamRequired("DetectorId")) + } + if s.DetectorId != nil && len(*s.DetectorId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DetectorId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDestinationId sets the DestinationId field's value. +func (s *UpdatePublishingDestinationInput) SetDestinationId(v string) *UpdatePublishingDestinationInput { + s.DestinationId = &v + return s +} + +// SetDestinationProperties sets the DestinationProperties field's value. +func (s *UpdatePublishingDestinationInput) SetDestinationProperties(v *DestinationProperties) *UpdatePublishingDestinationInput { + s.DestinationProperties = v + return s +} + +// SetDetectorId sets the DetectorId field's value. +func (s *UpdatePublishingDestinationInput) SetDetectorId(v string) *UpdatePublishingDestinationInput { + s.DetectorId = &v + return s +} + +type UpdatePublishingDestinationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdatePublishingDestinationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdatePublishingDestinationOutput) GoString() string { + return s.String() +} + type UpdateThreatIntelSetInput struct { _ struct{} `type:"structure"` @@ -10195,6 +11490,11 @@ func (s UpdateThreatIntelSetOutput) GoString() string { return s.String() } +const ( + // DestinationTypeS3 is a DestinationType enum value + DestinationTypeS3 = "S3" +) + const ( // DetectorStatusEnabled is a DetectorStatus enum value DetectorStatusEnabled = "ENABLED" @@ -10286,6 +11586,20 @@ const ( OrderByDesc = "DESC" ) +const ( + // PublishingStatusPendingVerification is a PublishingStatus enum value + PublishingStatusPendingVerification = "PENDING_VERIFICATION" + + // PublishingStatusPublishing is a PublishingStatus enum value + PublishingStatusPublishing = "PUBLISHING" + + // PublishingStatusUnableToPublishFixDestinationProperty is a PublishingStatus enum value + PublishingStatusUnableToPublishFixDestinationProperty = "UNABLE_TO_PUBLISH_FIX_DESTINATION_PROPERTY" + + // PublishingStatusStopped is a PublishingStatus enum value + PublishingStatusStopped = "STOPPED" +) + const ( // ThreatIntelSetFormatTxt is a ThreatIntelSetFormat enum value ThreatIntelSetFormatTxt = "TXT" diff --git a/vendor/github.com/aws/aws-sdk-go/service/guardduty/errors.go b/vendor/github.com/aws/aws-sdk-go/service/guardduty/errors.go index 6d2c4ea610a..63b0c1f7db7 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/guardduty/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/guardduty/errors.go @@ -2,6 +2,10 @@ package guardduty +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadRequestException for service response error code @@ -16,3 +20,8 @@ const ( // Internal server error exception object. ErrCodeInternalServerErrorException = "InternalServerErrorException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadRequestException": newErrorBadRequestException, + "InternalServerErrorException": newErrorInternalServerErrorException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/guardduty/service.go b/vendor/github.com/aws/aws-sdk-go/service/guardduty/service.go index 1c9835a9161..024e6557322 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/guardduty/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/guardduty/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "guardduty" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "GuardDuty" // ServiceID is a unique identifer of a specific service. + ServiceID = "GuardDuty" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the GuardDuty client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a GuardDuty client from just a session. // svc := guardduty.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *GuardDuty { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "guardduty" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *GuardDuty { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *GuardDuty { svc := &GuardDuty{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-11-28", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 64f25432642..a17131ac18f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iam/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iam/api.go @@ -1284,7 +1284,8 @@ func (c *IAM) CreateOpenIDConnectProviderRequest(input *CreateOpenIDConnectProvi // * A list of client IDs (also known as audiences) that identify the application // or applications that are allowed to authenticate using the OIDC provider // -// * A list of thumbprints of the server certificate(s) that the IdP uses +// * A list of thumbprints of one or more server certificates that the IdP +// uses // // You get all of this information from the OIDC IdP that you want to use to // access AWS. @@ -5583,10 +5584,12 @@ func (c *IAM) GetAccountAuthorizationDetailsPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetAccountAuthorizationDetailsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetAccountAuthorizationDetailsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6178,10 +6181,12 @@ func (c *IAM) GetGroupPagesWithContext(ctx aws.Context, input *GetGroupInput, fn }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetGroupOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetGroupOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7973,10 +7978,12 @@ func (c *IAM) ListAccessKeysPagesWithContext(ctx aws.Context, input *ListAccessK }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAccessKeysOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAccessKeysOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8112,10 +8119,12 @@ func (c *IAM) ListAccountAliasesPagesWithContext(ctx aws.Context, input *ListAcc }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAccountAliasesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAccountAliasesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8267,10 +8276,12 @@ func (c *IAM) ListAttachedGroupPoliciesPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAttachedGroupPoliciesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAttachedGroupPoliciesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8422,10 +8433,12 @@ func (c *IAM) ListAttachedRolePoliciesPagesWithContext(ctx aws.Context, input *L }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAttachedRolePoliciesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAttachedRolePoliciesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8577,10 +8590,12 @@ func (c *IAM) ListAttachedUserPoliciesPagesWithContext(ctx aws.Context, input *L }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAttachedUserPoliciesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAttachedUserPoliciesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8729,10 +8744,12 @@ func (c *IAM) ListEntitiesForPolicyPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEntitiesForPolicyOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListEntitiesForPolicyOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8880,10 +8897,12 @@ func (c *IAM) ListGroupPoliciesPagesWithContext(ctx aws.Context, input *ListGrou }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGroupPoliciesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListGroupPoliciesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -9018,10 +9037,12 @@ func (c *IAM) ListGroupsPagesWithContext(ctx aws.Context, input *ListGroupsInput }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -9160,10 +9181,12 @@ func (c *IAM) ListGroupsForUserPagesWithContext(ctx aws.Context, input *ListGrou }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGroupsForUserOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListGroupsForUserOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -9300,10 +9323,12 @@ func (c *IAM) ListInstanceProfilesPagesWithContext(ctx aws.Context, input *ListI }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInstanceProfilesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListInstanceProfilesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -9444,10 +9469,12 @@ func (c *IAM) ListInstanceProfilesForRolePagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInstanceProfilesForRoleOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListInstanceProfilesForRoleOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -9589,10 +9616,12 @@ func (c *IAM) ListMFADevicesPagesWithContext(ctx aws.Context, input *ListMFADevi }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListMFADevicesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListMFADevicesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -9818,10 +9847,12 @@ func (c *IAM) ListPoliciesPagesWithContext(ctx aws.Context, input *ListPoliciesI }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPoliciesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPoliciesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -10085,10 +10116,12 @@ func (c *IAM) ListPolicyVersionsPagesWithContext(ctx aws.Context, input *ListPol }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPolicyVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPolicyVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -10235,10 +10268,12 @@ func (c *IAM) ListRolePoliciesPagesWithContext(ctx aws.Context, input *ListRoleP }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRolePoliciesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListRolePoliciesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -10462,10 +10497,12 @@ func (c *IAM) ListRolesPagesWithContext(ctx aws.Context, input *ListRolesInput, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRolesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListRolesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -10690,10 +10727,12 @@ func (c *IAM) ListSSHPublicKeysPagesWithContext(ctx aws.Context, input *ListSSHP }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSSHPublicKeysOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListSSHPublicKeysOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -10834,10 +10873,12 @@ func (c *IAM) ListServerCertificatesPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListServerCertificatesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListServerCertificatesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -11073,10 +11114,12 @@ func (c *IAM) ListSigningCertificatesPagesWithContext(ctx aws.Context, input *Li }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSigningCertificatesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListSigningCertificatesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -11222,10 +11265,12 @@ func (c *IAM) ListUserPoliciesPagesWithContext(ctx aws.Context, input *ListUserP }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListUserPoliciesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListUserPoliciesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -11449,10 +11494,12 @@ func (c *IAM) ListUsersPagesWithContext(ctx aws.Context, input *ListUsersInput, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListUsersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListUsersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -11584,10 +11631,12 @@ func (c *IAM) ListVirtualMFADevicesPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListVirtualMFADevicesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListVirtualMFADevicesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -12873,13 +12922,14 @@ func (c *IAM) SimulateCustomPolicyRequest(input *SimulateCustomPolicyInput) (req // The simulation does not perform the API operations; it only checks the authorization // to determine if the simulated policies allow or deny the operations. // -// If you want to simulate existing policies attached to an IAM user, group, -// or role, use SimulatePrincipalPolicy instead. +// If you want to simulate existing policies that are 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. +// Context keys are variables that are maintained by AWS and its services and +// which 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. @@ -12965,10 +13015,12 @@ func (c *IAM) SimulateCustomPolicyPagesWithContext(ctx aws.Context, input *Simul }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SimulatePolicyResponse), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*SimulatePolicyResponse), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -13135,10 +13187,12 @@ func (c *IAM) SimulatePrincipalPolicyPagesWithContext(ctx aws.Context, input *Si }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SimulatePolicyResponse), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*SimulatePolicyResponse), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -15453,7 +15507,7 @@ type AccessKey struct { // calls, while Inactive means it is not. // // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` + Status *string `type:"string" required:"true" enum:"StatusType"` // The name of the IAM user that the access key is associated with. // @@ -15595,7 +15649,7 @@ type AccessKeyMetadata struct { // The status of the access key. Active means that the key is valid for API // calls; Inactive means it is not. - Status *string `type:"string" enum:"statusType"` + Status *string `type:"string" enum:"StatusType"` // The name of the IAM user that the key is associated with. UserName *string `min:"1" type:"string"` @@ -16162,7 +16216,7 @@ func (s *AttachedPermissionsBoundary) SetPermissionsBoundaryType(v string) *Atta // // For more information about managed policies, refer to Managed Policies and // Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the Using IAM guide. +// in the IAM User Guide. type AttachedPolicy struct { _ struct{} `type:"structure"` @@ -19929,13 +19983,13 @@ type EntityInfo struct { // The path to the entity (user or role). For more information about paths, // see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. Path *string `min:"1" type:"string"` // The type of entity (user or role). // // Type is a required field - Type *string `type:"string" required:"true" enum:"policyOwnerEntityType"` + Type *string `type:"string" required:"true" enum:"PolicyOwnerEntityType"` } // String returns the string representation @@ -20036,12 +20090,24 @@ type EvaluationResult struct { // 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 (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_compare-resource-policies.html) + // Additional details about the results of the cross-account evaluation decision. + // This parameter is populated for only cross-account simulations. It contains + // a brief summary of how each policy type contributes to the final evaluation + // decision. + // + // If the simulation evaluates policies within the same account and includes + // a resource ARN, then the parameter is present but the response is empty. + // If the simulation evaluates policies within the same account and specifies + // all resources (*), then the parameter is not returned. + // + // When you make a cross-account request, AWS evaluates the request in the trusting + // account and the trusted account. The request is allowed only if both evaluations + // return true. For more information about how policies are evaluated, see Evaluating + // Policies Within a Single Account (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_evaluation-logic.html#policy-eval-basics). + // + // If an AWS Organizations SCP included in the evaluation denies access, the + // simulation ends. In this case, policy evaluation does not proceed any further + // and this parameter is not returned. EvalDecisionDetails map[string]*string `type:"map"` // The ARN of the resource that the indicated API operation was tested on. @@ -20068,6 +20134,10 @@ type EvaluationResult struct { // account is part of an organization. OrganizationsDecisionDetail *OrganizationsDecisionDetail `type:"structure"` + // Contains information about the effect that a permissions boundary has on + // a policy simulation when the boundary is applied to an IAM entity. + PermissionsBoundaryDecisionDetail *PermissionsBoundaryDecisionDetail `type:"structure"` + // The individual results of the simulation of the API operation specified in // EvalActionName on each resource. ResourceSpecificResults []*ResourceSpecificResult `type:"list"` @@ -20125,6 +20195,12 @@ func (s *EvaluationResult) SetOrganizationsDecisionDetail(v *OrganizationsDecisi return s } +// SetPermissionsBoundaryDecisionDetail sets the PermissionsBoundaryDecisionDetail field's value. +func (s *EvaluationResult) SetPermissionsBoundaryDecisionDetail(v *PermissionsBoundaryDecisionDetail) *EvaluationResult { + s.PermissionsBoundaryDecisionDetail = v + return s +} + // SetResourceSpecificResults sets the ResourceSpecificResults field's value. func (s *EvaluationResult) SetResourceSpecificResults(v []*ResourceSpecificResult) *EvaluationResult { s.ResourceSpecificResults = v @@ -21376,7 +21452,7 @@ type GetOrganizationsAccessReportInput struct { // The key that is used to sort the results. If you choose the namespace key, // the results are returned in alphabetical order. If you choose the time key, // the results are sorted numerically by the date and time. - SortKey *string `type:"string" enum:"sortKeyType"` + SortKey *string `type:"string" enum:"SortKeyType"` } // String returns the string representation @@ -21473,7 +21549,7 @@ type GetOrganizationsAccessReportOutput struct { // The status of the job. // // JobStatus is a required field - JobStatus *string `type:"string" required:"true" enum:"jobStatusType"` + JobStatus *string `type:"string" required:"true" enum:"JobStatusType"` // When IsTruncated is true, this element is present and contains the value // to use for the Marker parameter in a subsequent pagination request. @@ -21996,7 +22072,7 @@ type GetSSHPublicKeyInput struct { // PEM format, use PEM. // // Encoding is a required field - Encoding *string `type:"string" required:"true" enum:"encodingType"` + Encoding *string `type:"string" required:"true" enum:"EncodingType"` // The unique identifier for the SSH public key. // @@ -22274,7 +22350,7 @@ type GetServiceLastAccessedDetailsOutput struct { // The status of the job. // // JobStatus is a required field - JobStatus *string `type:"string" required:"true" enum:"jobStatusType"` + JobStatus *string `type:"string" required:"true" enum:"JobStatusType"` // When IsTruncated is true, this element is present and contains the value // to use for the Marker parameter in a subsequent pagination request. @@ -22481,7 +22557,7 @@ type GetServiceLastAccessedDetailsWithEntitiesOutput struct { // The status of the job. // // JobStatus is a required field - JobStatus *string `type:"string" required:"true" enum:"jobStatusType"` + JobStatus *string `type:"string" required:"true" enum:"JobStatusType"` // When IsTruncated is true, this element is present and contains the value // to use for the Marker parameter in a subsequent pagination request. @@ -22832,7 +22908,7 @@ type Group struct { // The Amazon Resource Name (ARN) specifying the group. For more information // about ARNs and how to use them in policies, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. // // Arn is a required field Arn *string `min:"20" type:"string" required:"true"` @@ -22845,7 +22921,7 @@ type Group struct { // The stable and unique string identifying the group. For more information // about IDs, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. // // GroupId is a required field GroupId *string `min:"16" type:"string" required:"true"` @@ -22857,7 +22933,7 @@ type Group struct { // The path to the group. For more information about paths, see IAM Identifiers // (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. // // Path is a required field Path *string `min:"1" type:"string" required:"true"` @@ -22926,7 +23002,7 @@ type GroupDetail struct { // The stable and unique string identifying the group. For more information // about IDs, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. GroupId *string `min:"16" type:"string"` // The friendly name that identifies the group. @@ -22937,7 +23013,7 @@ type GroupDetail struct { // The path to the group. For more information about paths, see IAM Identifiers // (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. Path *string `min:"1" type:"string"` } @@ -23010,7 +23086,7 @@ type InstanceProfile struct { // The Amazon Resource Name (ARN) specifying the instance profile. For more // information about ARNs and how to use them in policies, see IAM Identifiers // (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. // // Arn is a required field Arn *string `min:"20" type:"string" required:"true"` @@ -23022,7 +23098,7 @@ type InstanceProfile struct { // The stable and unique string identifying the instance profile. For more information // about IDs, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. // // InstanceProfileId is a required field InstanceProfileId *string `min:"16" type:"string" required:"true"` @@ -23034,7 +23110,7 @@ type InstanceProfile struct { // The path to the instance profile. For more information about paths, see IAM // Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. // // Path is a required field Path *string `min:"1" type:"string" required:"true"` @@ -25013,7 +25089,7 @@ type ListPoliciesInput struct { // // 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"` + Scope *string `type:"string" enum:"PolicyScopeType"` } // String returns the string representation @@ -26544,7 +26620,7 @@ type ListVirtualMFADevicesInput struct { // The status (Unassigned or Assigned) of the devices to list. If you do not // specify an AssignmentStatus, the operation defaults to Any, which lists both // assigned and unassigned virtual MFA devices., - AssignmentStatus *string `type:"string" enum:"assignmentStatusType"` + 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 @@ -26769,7 +26845,7 @@ func (s *MFADevice) SetUserName(v string) *MFADevice { // // For more information about managed policies, see Managed Policies and Inline // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the Using IAM guide. +// in the IAM User Guide. type ManagedPolicyDetail struct { _ struct{} `type:"structure"` @@ -26793,7 +26869,7 @@ type ManagedPolicyDetail struct { // // For more information about policy versions, see Versioning for Managed Policies // (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-versions.html) - // in the Using IAM guide. + // in the IAM User Guide. DefaultVersionId *string `type:"string"` // A friendly description of the policy. @@ -26805,7 +26881,7 @@ type ManagedPolicyDetail struct { // The path to the policy. // // For more information about paths, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. Path *string `min:"1" type:"string"` // The number of entities (users and roles) for which the policy is used as @@ -26819,7 +26895,7 @@ type ManagedPolicyDetail struct { // The stable and unique string identifying the policy. // // For more information about IDs, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. PolicyId *string `min:"16" type:"string"` // The friendly name (not ARN) identifying the policy. @@ -27086,6 +27162,38 @@ func (s *PasswordPolicy) SetRequireUppercaseCharacters(v bool) *PasswordPolicy { return s } +// Contains information about the effect that a permissions boundary has on +// a policy simulation when the boundary is applied to an IAM entity. +type PermissionsBoundaryDecisionDetail struct { + _ struct{} `type:"structure"` + + // Specifies whether an action is allowed by a permissions boundary that is + // applied to an IAM entity (user or role). A value of true means that the permissions + // boundary does not deny the action. This means that the policy includes an + // Allow statement that matches the request. In this case, if an identity-based + // policy also allows the action, the request is allowed. A value of false means + // that either the requested action is not allowed (implicitly denied) or that + // the action is explicitly denied by the permissions boundary. In both of these + // cases, the action is not allowed, regardless of the identity-based policy. + AllowedByPermissionsBoundary *bool `type:"boolean"` +} + +// String returns the string representation +func (s PermissionsBoundaryDecisionDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PermissionsBoundaryDecisionDetail) GoString() string { + return s.String() +} + +// SetAllowedByPermissionsBoundary sets the AllowedByPermissionsBoundary field's value. +func (s *PermissionsBoundaryDecisionDetail) SetAllowedByPermissionsBoundary(v bool) *PermissionsBoundaryDecisionDetail { + s.AllowedByPermissionsBoundary = &v + return s +} + // Contains information about a managed policy. // // This data type is used as a response element in the CreatePolicy, GetPolicy, @@ -27093,7 +27201,7 @@ func (s *PasswordPolicy) SetRequireUppercaseCharacters(v bool) *PasswordPolicy { // // For more information about managed policies, refer to Managed Policies and // Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the Using IAM guide. +// in the IAM User Guide. type Policy struct { _ struct{} `type:"structure"` @@ -27127,7 +27235,7 @@ type Policy struct { // The path to the policy. // // For more information about paths, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. Path *string `min:"1" type:"string"` // The number of entities (users and roles) for which the policy is used to @@ -27141,7 +27249,7 @@ type Policy struct { // The stable and unique string identifying the policy. // // For more information about IDs, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. PolicyId *string `min:"16" type:"string"` // The friendly name (not ARN) identifying the policy. @@ -27290,7 +27398,7 @@ type PolicyGrantingServiceAccess struct { // This field is null for managed policies. For more information about these // policy types, see Managed Policies and Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html) // in the IAM User Guide. - EntityType *string `type:"string" enum:"policyOwnerEntityType"` + EntityType *string `type:"string" enum:"PolicyOwnerEntityType"` // The Amazon Resource Name (ARN). ARNs are unique identifiers for AWS resources. // @@ -27309,7 +27417,7 @@ type PolicyGrantingServiceAccess struct { // in the IAM User Guide. // // PolicyType is a required field - PolicyType *string `type:"string" required:"true" enum:"policyType"` + PolicyType *string `type:"string" required:"true" enum:"PolicyType"` } // String returns the string representation @@ -27359,7 +27467,7 @@ func (s *PolicyGrantingServiceAccess) SetPolicyType(v string) *PolicyGrantingSer // // For more information about managed policies, refer to Managed Policies and // Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the Using IAM guide. +// in the IAM User Guide. type PolicyGroup struct { _ struct{} `type:"structure"` @@ -27401,7 +27509,7 @@ func (s *PolicyGroup) SetGroupName(v string) *PolicyGroup { // // For more information about managed policies, refer to Managed Policies and // Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the Using IAM guide. +// in the IAM User Guide. type PolicyRole struct { _ struct{} `type:"structure"` @@ -27443,7 +27551,7 @@ func (s *PolicyRole) SetRoleName(v string) *PolicyRole { // // For more information about managed policies, refer to Managed Policies and // Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the Using IAM guide. +// in the IAM User Guide. type PolicyUser struct { _ struct{} `type:"structure"` @@ -27486,7 +27594,7 @@ func (s *PolicyUser) SetUserName(v string) *PolicyUser { // // For more information about managed policies, refer to Managed Policies and // Inline Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/policies-managed-vs-inline.html) -// in the Using IAM guide. +// in the IAM User Guide. type PolicyVersion struct { _ struct{} `type:"structure"` @@ -28413,11 +28521,10 @@ func (s *ResetServiceSpecificCredentialOutput) SetServiceSpecificCredential(v *S 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. + // Additional details about the results of the evaluation decision on a single + // resource. This parameter is returned only for cross-account simulations. + // This parameter explains how each policy type contributes to the resource-specific + // evaluation decision. EvalDecisionDetails map[string]*string `type:"map"` // The result of the simulation of the simulated API operation on the resource @@ -28447,6 +28554,10 @@ type ResourceSpecificResult struct { // the context keys used by a set of policies, you can call GetContextKeysForCustomPolicy // or GetContextKeysForPrincipalPolicy. MissingContextValues []*string `type:"list"` + + // Contains information about the effect that a permissions boundary has on + // a policy simulation when that boundary is applied to an IAM entity. + PermissionsBoundaryDecisionDetail *PermissionsBoundaryDecisionDetail `type:"structure"` } // String returns the string representation @@ -28489,6 +28600,12 @@ func (s *ResourceSpecificResult) SetMissingContextValues(v []*string) *ResourceS return s } +// SetPermissionsBoundaryDecisionDetail sets the PermissionsBoundaryDecisionDetail field's value. +func (s *ResourceSpecificResult) SetPermissionsBoundaryDecisionDetail(v *PermissionsBoundaryDecisionDetail) *ResourceSpecificResult { + s.PermissionsBoundaryDecisionDetail = v + return s +} + type ResyncMFADeviceInput struct { _ struct{} `type:"structure"` @@ -28639,7 +28756,7 @@ type Role struct { // The path to the role. For more information about paths, see IAM Identifiers // (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. // // Path is a required field Path *string `min:"1" type:"string" required:"true"` @@ -28653,11 +28770,20 @@ type Role struct { // The stable and unique string identifying the role. For more information about // IDs, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. // // RoleId is a required field RoleId *string `min:"16" type:"string" required:"true"` + // Contains information about the last time that an IAM role was used. This + // includes the date and time and the Region in which the role was last used. + // Activity is only reported for the trailing 400 days. This period can be shorter + // if your Region began supporting these features within the last year. The + // role might have been used more than 400 days ago. For more information, see + // Regions Where Data Is Tracked (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period) + // in the IAM User Guide. + RoleLastUsed *RoleLastUsed `type:"structure"` + // The friendly name that identifies the role. // // RoleName is a required field @@ -28727,6 +28853,12 @@ func (s *Role) SetRoleId(v string) *Role { return s } +// SetRoleLastUsed sets the RoleLastUsed field's value. +func (s *Role) SetRoleLastUsed(v *RoleLastUsed) *Role { + s.RoleLastUsed = v + return s +} + // SetRoleName sets the RoleName field's value. func (s *Role) SetRoleName(v string) *Role { s.RoleName = &v @@ -28769,7 +28901,7 @@ type RoleDetail struct { // The path to the role. For more information about paths, see IAM Identifiers // (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. Path *string `min:"1" type:"string"` // The ARN of the policy used to set the permissions boundary for the role. @@ -28781,9 +28913,18 @@ type RoleDetail struct { // The stable and unique string identifying the role. For more information about // IDs, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. RoleId *string `min:"16" type:"string"` + // Contains information about the last time that an IAM role was used. This + // includes the date and time and the Region in which the role was last used. + // Activity is only reported for the trailing 400 days. This period can be shorter + // if your Region began supporting these features within the last year. The + // role might have been used more than 400 days ago. For more information, see + // Regions Where Data Is Tracked (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period) + // in the IAM User Guide. + RoleLastUsed *RoleLastUsed `type:"structure"` + // The friendly name that identifies the role. RoleName *string `min:"1" type:"string"` @@ -28855,6 +28996,12 @@ func (s *RoleDetail) SetRoleId(v string) *RoleDetail { return s } +// SetRoleLastUsed sets the RoleLastUsed field's value. +func (s *RoleDetail) SetRoleLastUsed(v *RoleLastUsed) *RoleDetail { + s.RoleLastUsed = v + return s +} + // SetRoleName sets the RoleName field's value. func (s *RoleDetail) SetRoleName(v string) *RoleDetail { s.RoleName = &v @@ -28873,6 +29020,54 @@ func (s *RoleDetail) SetTags(v []*Tag) *RoleDetail { return s } +// Contains information about the last time that an IAM role was used. This +// includes the date and time and the Region in which the role was last used. +// Activity is only reported for the trailing 400 days. This period can be shorter +// if your Region began supporting these features within the last year. The +// role might have been used more than 400 days ago. For more information, see +// Regions Where Data Is Tracked (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period) +// in the IAM User Guide. +// +// This data type is returned as a response element in the GetRole and GetAccountAuthorizationDetails +// operations. +type RoleLastUsed struct { + _ struct{} `type:"structure"` + + // The date and time, in ISO 8601 date-time format (http://www.iso.org/iso/iso8601) + // that the role was last used. + // + // This field is null if the role has not been used within the IAM tracking + // period. For more information about the tracking period, see Regions Where + // Data Is Tracked (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_access-advisor.html#access-advisor_tracking-period) + // in the IAM User Guide. + LastUsedDate *time.Time `type:"timestamp"` + + // The name of the AWS Region in which the role was last used. + Region *string `type:"string"` +} + +// String returns the string representation +func (s RoleLastUsed) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RoleLastUsed) GoString() string { + return s.String() +} + +// SetLastUsedDate sets the LastUsedDate field's value. +func (s *RoleLastUsed) SetLastUsedDate(v time.Time) *RoleLastUsed { + s.LastUsedDate = &v + return s +} + +// SetRegion sets the Region field's value. +func (s *RoleLastUsed) SetRegion(v string) *RoleLastUsed { + s.Region = &v + return s +} + // An object that contains details about how a service-linked role is used, // if that information is returned by the service. // @@ -28979,7 +29174,7 @@ type SSHPublicKey struct { // key cannot be used. // // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` + 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. @@ -29053,7 +29248,7 @@ type SSHPublicKeyMetadata struct { // key cannot be used. // // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` + 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. @@ -29162,7 +29357,7 @@ type ServerCertificateMetadata struct { // The Amazon Resource Name (ARN) specifying the server certificate. For more // information about ARNs and how to use them in policies, see IAM Identifiers // (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. // // Arn is a required field Arn *string `min:"20" type:"string" required:"true"` @@ -29172,14 +29367,14 @@ type ServerCertificateMetadata struct { // The path to the server certificate. For more information about paths, see // IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User 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 (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. // // ServerCertificateId is a required field ServerCertificateId *string `min:"16" type:"string" required:"true"` @@ -29364,7 +29559,7 @@ type ServiceSpecificCredential struct { // is valid for API calls, while Inactive means it is not. // // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` + Status *string `type:"string" required:"true" enum:"StatusType"` // The name of the IAM user associated with the service-specific credential. // @@ -29453,7 +29648,7 @@ type ServiceSpecificCredentialMetadata struct { // is valid for API calls, while Inactive means it is not. // // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` + Status *string `type:"string" required:"true" enum:"StatusType"` // The name of the IAM user associated with the service-specific credential. // @@ -29598,7 +29793,7 @@ type SetSecurityTokenServicePreferencesInput struct { // in the IAM User Guide. // // GlobalEndpointTokenVersion is a required field - GlobalEndpointTokenVersion *string `type:"string" required:"true" enum:"globalEndpointTokenVersion"` + GlobalEndpointTokenVersion *string `type:"string" required:"true" enum:"GlobalEndpointTokenVersion"` } // String returns the string representation @@ -29665,7 +29860,7 @@ type SigningCertificate struct { // for API calls, while Inactive means it is not. // // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` + Status *string `type:"string" required:"true" enum:"StatusType"` // The date when the signing certificate was uploaded. UploadDate *time.Time `type:"timestamp"` @@ -29758,6 +29953,27 @@ type SimulateCustomPolicyInput struct { // service where to continue from. MaxItems *int64 `min:"1" type:"integer"` + // The IAM permissions boundary policy to simulate. The permissions boundary + // sets the maximum permissions that an IAM entity can have. You can input only + // one permissions boundary when you pass a policy to this operation. For more + // information about permissions boundaries, see Permissions Boundaries for + // IAM Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) + // in the IAM User Guide. The policy input is specified as a string that contains + // the complete, valid JSON text of a permissions boundary policy. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + PermissionsBoundaryPolicyInputList []*string `type:"list"` + // 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 @@ -29949,6 +30165,12 @@ func (s *SimulateCustomPolicyInput) SetMaxItems(v int64) *SimulateCustomPolicyIn return s } +// SetPermissionsBoundaryPolicyInputList sets the PermissionsBoundaryPolicyInputList field's value. +func (s *SimulateCustomPolicyInput) SetPermissionsBoundaryPolicyInputList(v []*string) *SimulateCustomPolicyInput { + s.PermissionsBoundaryPolicyInputList = v + return s +} + // SetPolicyInputList sets the PolicyInputList field's value. func (s *SimulateCustomPolicyInput) SetPolicyInputList(v []*string) *SimulateCustomPolicyInput { s.PolicyInputList = v @@ -30080,6 +30302,30 @@ type SimulatePrincipalPolicyInput struct { // service where to continue from. MaxItems *int64 `min:"1" type:"integer"` + // The IAM permissions boundary policy to simulate. The permissions boundary + // sets the maximum permissions that the entity can have. You can input only + // one permissions boundary when you pass a policy to this operation. An IAM + // entity can only have one permissions boundary in effect at a time. For example, + // if a permissions boundary is attached to an entity and you pass in a different + // permissions boundary policy using this parameter, then the new permission + // boundary policy is used for the simulation. For more information about permissions + // boundaries, see Permissions Boundaries for IAM Entities (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_boundaries.html) + // in the IAM User Guide. The policy input is specified as a string containing + // the complete, valid JSON text of a permissions boundary policy. + // + // The regex pattern (http://wikipedia.org/wiki/regex) used to validate this + // parameter is a string of characters consisting of the following: + // + // * Any printable ASCII character ranging from the space character (\u0020) + // through the end of the ASCII character range + // + // * The printable characters in the Basic Latin and Latin-1 Supplement character + // set (through \u00FF) + // + // * The special characters tab (\u0009), line feed (\u000A), and carriage + // return (\u000D) + PermissionsBoundaryPolicyInputList []*string `type:"list"` + // 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. @@ -30272,6 +30518,12 @@ func (s *SimulatePrincipalPolicyInput) SetMaxItems(v int64) *SimulatePrincipalPo return s } +// SetPermissionsBoundaryPolicyInputList sets the PermissionsBoundaryPolicyInputList field's value. +func (s *SimulatePrincipalPolicyInput) SetPermissionsBoundaryPolicyInputList(v []*string) *SimulatePrincipalPolicyInput { + s.PermissionsBoundaryPolicyInputList = v + return s +} + // SetPolicyInputList sets the PolicyInputList field's value. func (s *SimulatePrincipalPolicyInput) SetPolicyInputList(v []*string) *SimulatePrincipalPolicyInput { s.PolicyInputList = v @@ -30764,7 +31016,7 @@ type UpdateAccessKeyInput struct { // cannot be used. // // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` + Status *string `type:"string" required:"true" enum:"StatusType"` // The name of the user whose key you want to update. // @@ -31646,7 +31898,7 @@ type UpdateSSHPublicKeyInput struct { // that the key cannot be used. // // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` + Status *string `type:"string" required:"true" enum:"StatusType"` // The name of the IAM user associated with the SSH public key. // @@ -31837,7 +32089,7 @@ type UpdateServiceSpecificCredentialInput struct { // The status to be assigned to the service-specific credential. // // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` + 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 @@ -31930,7 +32182,7 @@ type UpdateSigningCertificateInput struct { // be used. // // Status is a required field - Status *string `type:"string" required:"true" enum:"statusType"` + Status *string `type:"string" required:"true" enum:"StatusType"` // The name of the IAM user the signing certificate belongs to. // @@ -32492,7 +32744,7 @@ type User struct { // The Amazon Resource Name (ARN) that identifies the user. For more information // about ARNs and how to use ARNs in policies, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. // // Arn is a required field Arn *string `min:"20" type:"string" required:"true"` @@ -32507,7 +32759,7 @@ type User struct { // 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 (https://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 + // topic in the IAM User Guide. If a password is used more than once in a five-minute // span, only the first use is returned in this field. If the field is null // (no value), then it indicates that they never signed in with a password. // This can be because: @@ -32518,7 +32770,7 @@ type User struct { // information on October 20, 2014. // // A null value does not mean that the user never had a password. Also, if the - // user does not currently have a password, but had one in the past, then this + // user does not currently have a password but had one in the past, then this // field contains the date and time the most recent password was used. // // This value is returned only in the GetUser and ListUsers operations. @@ -32526,7 +32778,7 @@ type User struct { // The path to the user. For more information about paths, see IAM Identifiers // (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. // // Path is a required field Path *string `min:"1" type:"string" required:"true"` @@ -32545,7 +32797,7 @@ type User struct { // The stable and unique string identifying the user. For more information about // IDs, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. // // UserId is a required field UserId *string `min:"16" type:"string" required:"true"` @@ -32641,7 +32893,7 @@ type UserDetail struct { // The path to the user. For more information about paths, see IAM Identifiers // (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. Path *string `min:"1" type:"string"` // The ARN of the policy used to set the permissions boundary for the user. @@ -32658,7 +32910,7 @@ type UserDetail struct { // The stable and unique string identifying the user. For more information about // IDs, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/Using_Identifiers.html) - // in the Using IAM guide. + // in the IAM User Guide. UserId *string `min:"16" type:"string"` // The friendly name identifying the user. @@ -32808,6 +33060,17 @@ func (s *VirtualMFADevice) SetUser(v *User) *VirtualMFADevice { return s } +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 ( // ContextKeyTypeEnumString is a ContextKeyTypeEnum enum value ContextKeyTypeEnumString = "string" @@ -32860,6 +33123,14 @@ const ( DeletionTaskStatusTypeNotStarted = "NOT_STARTED" ) +const ( + // EncodingTypeSsh is a EncodingType enum value + EncodingTypeSsh = "SSH" + + // EncodingTypePem is a EncodingType enum value + EncodingTypePem = "PEM" +) + const ( // EntityTypeUser is a EntityType enum value EntityTypeUser = "User" @@ -32877,6 +33148,25 @@ const ( EntityTypeAwsmanagedPolicy = "AWSManagedPolicy" ) +const ( + // GlobalEndpointTokenVersionV1token is a GlobalEndpointTokenVersion enum value + GlobalEndpointTokenVersionV1token = "v1Token" + + // GlobalEndpointTokenVersionV2token is a GlobalEndpointTokenVersion enum value + GlobalEndpointTokenVersionV2token = "v2Token" +) + +const ( + // JobStatusTypeInProgress is a JobStatusType enum value + JobStatusTypeInProgress = "IN_PROGRESS" + + // JobStatusTypeCompleted is a JobStatusType enum value + JobStatusTypeCompleted = "COMPLETED" + + // JobStatusTypeFailed is a JobStatusType enum value + JobStatusTypeFailed = "FAILED" +) + const ( // PermissionsBoundaryAttachmentTypePermissionsBoundaryPolicy is a PermissionsBoundaryAttachmentType enum value PermissionsBoundaryAttachmentTypePermissionsBoundaryPolicy = "PermissionsBoundaryPolicy" @@ -32893,6 +33183,28 @@ const ( PolicyEvaluationDecisionTypeImplicitDeny = "implicitDeny" ) +const ( + // PolicyOwnerEntityTypeUser is a PolicyOwnerEntityType enum value + PolicyOwnerEntityTypeUser = "USER" + + // PolicyOwnerEntityTypeRole is a PolicyOwnerEntityType enum value + PolicyOwnerEntityTypeRole = "ROLE" + + // PolicyOwnerEntityTypeGroup is a PolicyOwnerEntityType enum value + PolicyOwnerEntityTypeGroup = "GROUP" +) + +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 ( // PolicySourceTypeUser is a PolicySourceType enum value PolicySourceTypeUser = "user" @@ -32916,6 +33228,14 @@ const ( PolicySourceTypeNone = "none" ) +const ( + // PolicyTypeInline is a PolicyType enum value + PolicyTypeInline = "INLINE" + + // PolicyTypeManaged is a PolicyType enum value + PolicyTypeManaged = "MANAGED" +) + // The policy usage type that indicates whether the policy is used as a permissions // policy or as the permissions boundary for an entity. // @@ -32947,171 +33267,103 @@ const ( ) 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 ( - // GlobalEndpointTokenVersionV1token is a globalEndpointTokenVersion enum value - GlobalEndpointTokenVersionV1token = "v1Token" - - // GlobalEndpointTokenVersionV2token is a globalEndpointTokenVersion enum value - GlobalEndpointTokenVersionV2token = "v2Token" -) - -const ( - // JobStatusTypeInProgress is a jobStatusType enum value - JobStatusTypeInProgress = "IN_PROGRESS" - - // JobStatusTypeCompleted is a jobStatusType enum value - JobStatusTypeCompleted = "COMPLETED" - - // JobStatusTypeFailed is a jobStatusType enum value - JobStatusTypeFailed = "FAILED" -) - -const ( - // PolicyOwnerEntityTypeUser is a policyOwnerEntityType enum value - PolicyOwnerEntityTypeUser = "USER" - - // PolicyOwnerEntityTypeRole is a policyOwnerEntityType enum value - PolicyOwnerEntityTypeRole = "ROLE" - - // PolicyOwnerEntityTypeGroup is a policyOwnerEntityType enum value - PolicyOwnerEntityTypeGroup = "GROUP" -) - -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 ( - // PolicyTypeInline is a policyType enum value - PolicyTypeInline = "INLINE" - - // PolicyTypeManaged is a policyType enum value - PolicyTypeManaged = "MANAGED" -) - -const ( - // SortKeyTypeServiceNamespaceAscending is a sortKeyType enum value + // SortKeyTypeServiceNamespaceAscending is a SortKeyType enum value SortKeyTypeServiceNamespaceAscending = "SERVICE_NAMESPACE_ASCENDING" - // SortKeyTypeServiceNamespaceDescending is a sortKeyType enum value + // SortKeyTypeServiceNamespaceDescending is a SortKeyType enum value SortKeyTypeServiceNamespaceDescending = "SERVICE_NAMESPACE_DESCENDING" - // SortKeyTypeLastAuthenticatedTimeAscending is a sortKeyType enum value + // SortKeyTypeLastAuthenticatedTimeAscending is a SortKeyType enum value SortKeyTypeLastAuthenticatedTimeAscending = "LAST_AUTHENTICATED_TIME_ASCENDING" - // SortKeyTypeLastAuthenticatedTimeDescending is a sortKeyType enum value + // SortKeyTypeLastAuthenticatedTimeDescending is a SortKeyType enum value SortKeyTypeLastAuthenticatedTimeDescending = "LAST_AUTHENTICATED_TIME_DESCENDING" ) const ( - // StatusTypeActive is a statusType enum value + // StatusTypeActive is a StatusType enum value StatusTypeActive = "Active" - // StatusTypeInactive is a statusType enum value + // StatusTypeInactive is a StatusType enum value StatusTypeInactive = "Inactive" ) const ( - // SummaryKeyTypeUsers is a summaryKeyType enum value + // SummaryKeyTypeUsers is a SummaryKeyType enum value SummaryKeyTypeUsers = "Users" - // SummaryKeyTypeUsersQuota is a summaryKeyType enum value + // SummaryKeyTypeUsersQuota is a SummaryKeyType enum value SummaryKeyTypeUsersQuota = "UsersQuota" - // SummaryKeyTypeGroups is a summaryKeyType enum value + // SummaryKeyTypeGroups is a SummaryKeyType enum value SummaryKeyTypeGroups = "Groups" - // SummaryKeyTypeGroupsQuota is a summaryKeyType enum value + // SummaryKeyTypeGroupsQuota is a SummaryKeyType enum value SummaryKeyTypeGroupsQuota = "GroupsQuota" - // SummaryKeyTypeServerCertificates is a summaryKeyType enum value + // SummaryKeyTypeServerCertificates is a SummaryKeyType enum value SummaryKeyTypeServerCertificates = "ServerCertificates" - // SummaryKeyTypeServerCertificatesQuota is a summaryKeyType enum value + // SummaryKeyTypeServerCertificatesQuota is a SummaryKeyType enum value SummaryKeyTypeServerCertificatesQuota = "ServerCertificatesQuota" - // SummaryKeyTypeUserPolicySizeQuota is a summaryKeyType enum value + // SummaryKeyTypeUserPolicySizeQuota is a SummaryKeyType enum value SummaryKeyTypeUserPolicySizeQuota = "UserPolicySizeQuota" - // SummaryKeyTypeGroupPolicySizeQuota is a summaryKeyType enum value + // SummaryKeyTypeGroupPolicySizeQuota is a SummaryKeyType enum value SummaryKeyTypeGroupPolicySizeQuota = "GroupPolicySizeQuota" - // SummaryKeyTypeGroupsPerUserQuota is a summaryKeyType enum value + // SummaryKeyTypeGroupsPerUserQuota is a SummaryKeyType enum value SummaryKeyTypeGroupsPerUserQuota = "GroupsPerUserQuota" - // SummaryKeyTypeSigningCertificatesPerUserQuota is a summaryKeyType enum value + // SummaryKeyTypeSigningCertificatesPerUserQuota is a SummaryKeyType enum value SummaryKeyTypeSigningCertificatesPerUserQuota = "SigningCertificatesPerUserQuota" - // SummaryKeyTypeAccessKeysPerUserQuota is a summaryKeyType enum value + // SummaryKeyTypeAccessKeysPerUserQuota is a SummaryKeyType enum value SummaryKeyTypeAccessKeysPerUserQuota = "AccessKeysPerUserQuota" - // SummaryKeyTypeMfadevices is a summaryKeyType enum value + // SummaryKeyTypeMfadevices is a SummaryKeyType enum value SummaryKeyTypeMfadevices = "MFADevices" - // SummaryKeyTypeMfadevicesInUse is a summaryKeyType enum value + // SummaryKeyTypeMfadevicesInUse is a SummaryKeyType enum value SummaryKeyTypeMfadevicesInUse = "MFADevicesInUse" - // SummaryKeyTypeAccountMfaenabled is a summaryKeyType enum value + // SummaryKeyTypeAccountMfaenabled is a SummaryKeyType enum value SummaryKeyTypeAccountMfaenabled = "AccountMFAEnabled" - // SummaryKeyTypeAccountAccessKeysPresent is a summaryKeyType enum value + // SummaryKeyTypeAccountAccessKeysPresent is a SummaryKeyType enum value SummaryKeyTypeAccountAccessKeysPresent = "AccountAccessKeysPresent" - // SummaryKeyTypeAccountSigningCertificatesPresent is a summaryKeyType enum value + // SummaryKeyTypeAccountSigningCertificatesPresent is a SummaryKeyType enum value SummaryKeyTypeAccountSigningCertificatesPresent = "AccountSigningCertificatesPresent" - // SummaryKeyTypeAttachedPoliciesPerGroupQuota is a summaryKeyType enum value + // SummaryKeyTypeAttachedPoliciesPerGroupQuota is a SummaryKeyType enum value SummaryKeyTypeAttachedPoliciesPerGroupQuota = "AttachedPoliciesPerGroupQuota" - // SummaryKeyTypeAttachedPoliciesPerRoleQuota is a summaryKeyType enum value + // SummaryKeyTypeAttachedPoliciesPerRoleQuota is a SummaryKeyType enum value SummaryKeyTypeAttachedPoliciesPerRoleQuota = "AttachedPoliciesPerRoleQuota" - // SummaryKeyTypeAttachedPoliciesPerUserQuota is a summaryKeyType enum value + // SummaryKeyTypeAttachedPoliciesPerUserQuota is a SummaryKeyType enum value SummaryKeyTypeAttachedPoliciesPerUserQuota = "AttachedPoliciesPerUserQuota" - // SummaryKeyTypePolicies is a summaryKeyType enum value + // SummaryKeyTypePolicies is a SummaryKeyType enum value SummaryKeyTypePolicies = "Policies" - // SummaryKeyTypePoliciesQuota is a summaryKeyType enum value + // SummaryKeyTypePoliciesQuota is a SummaryKeyType enum value SummaryKeyTypePoliciesQuota = "PoliciesQuota" - // SummaryKeyTypePolicySizeQuota is a summaryKeyType enum value + // SummaryKeyTypePolicySizeQuota is a SummaryKeyType enum value SummaryKeyTypePolicySizeQuota = "PolicySizeQuota" - // SummaryKeyTypePolicyVersionsInUse is a summaryKeyType enum value + // SummaryKeyTypePolicyVersionsInUse is a SummaryKeyType enum value SummaryKeyTypePolicyVersionsInUse = "PolicyVersionsInUse" - // SummaryKeyTypePolicyVersionsInUseQuota is a summaryKeyType enum value + // SummaryKeyTypePolicyVersionsInUseQuota is a SummaryKeyType enum value SummaryKeyTypePolicyVersionsInUseQuota = "PolicyVersionsInUseQuota" - // SummaryKeyTypeVersionsPerPolicyQuota is a summaryKeyType enum value + // SummaryKeyTypeVersionsPerPolicyQuota is a SummaryKeyType enum value SummaryKeyTypeVersionsPerPolicyQuota = "VersionsPerPolicyQuota" - // SummaryKeyTypeGlobalEndpointTokenVersion is a summaryKeyType enum value + // SummaryKeyTypeGlobalEndpointTokenVersion is a SummaryKeyType enum value SummaryKeyTypeGlobalEndpointTokenVersion = "GlobalEndpointTokenVersion" ) 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 index 940b4ce3283..6e5d3713936 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iam/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iam/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "iam" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "IAM" // ServiceID is a unique identifer of a specific service. + ServiceID = "IAM" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the IAM client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a IAM client from just a session. // svc := iam.New(mySession) // @@ -46,11 +48,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *IAM { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *IAM { svc := &IAM{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2010-05-08", }, diff --git a/vendor/github.com/aws/aws-sdk-go/service/imagebuilder/api.go b/vendor/github.com/aws/aws-sdk-go/service/imagebuilder/api.go new file mode 100644 index 00000000000..02e78844c4a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/imagebuilder/api.go @@ -0,0 +1,12454 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package imagebuilder + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/restjson" +) + +const opCancelImageCreation = "CancelImageCreation" + +// CancelImageCreationRequest generates a "aws/request.Request" representing the +// client's request for the CancelImageCreation operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CancelImageCreation for more information on using the CancelImageCreation +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CancelImageCreationRequest method. +// req, resp := client.CancelImageCreationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/CancelImageCreation +func (c *Imagebuilder) CancelImageCreationRequest(input *CancelImageCreationInput) (req *request.Request, output *CancelImageCreationOutput) { + op := &request.Operation{ + Name: opCancelImageCreation, + HTTPMethod: "PUT", + HTTPPath: "/CancelImageCreation", + } + + if input == nil { + input = &CancelImageCreationInput{} + } + + output = &CancelImageCreationOutput{} + req = c.newRequest(op, input, output) + return +} + +// CancelImageCreation API operation for EC2 Image Builder. +// +// CancelImageCreation cancels the creation of Image. This operation can only +// be used on images in a non-terminal 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 EC2 Image Builder's +// API operation CancelImageCreation for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * IdempotentParameterMismatchException +// You have specified a client token for an operation using parameter values +// that differ from a previous request that used the same client token. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * ResourceInUseException +// The resource that you are trying to operate on is currently in use. Review +// the message details and retry later. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/CancelImageCreation +func (c *Imagebuilder) CancelImageCreation(input *CancelImageCreationInput) (*CancelImageCreationOutput, error) { + req, out := c.CancelImageCreationRequest(input) + return out, req.Send() +} + +// CancelImageCreationWithContext is the same as CancelImageCreation with the addition of +// the ability to pass a context and additional request options. +// +// See CancelImageCreation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) CancelImageCreationWithContext(ctx aws.Context, input *CancelImageCreationInput, opts ...request.Option) (*CancelImageCreationOutput, error) { + req, out := c.CancelImageCreationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateComponent = "CreateComponent" + +// CreateComponentRequest generates a "aws/request.Request" representing the +// client's request for the CreateComponent operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateComponent for more information on using the CreateComponent +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateComponentRequest method. +// req, resp := client.CreateComponentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/CreateComponent +func (c *Imagebuilder) CreateComponentRequest(input *CreateComponentInput) (req *request.Request, output *CreateComponentOutput) { + op := &request.Operation{ + Name: opCreateComponent, + HTTPMethod: "PUT", + HTTPPath: "/CreateComponent", + } + + if input == nil { + input = &CreateComponentInput{} + } + + output = &CreateComponentOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateComponent API operation for EC2 Image Builder. +// +// Creates a new component that can be used to build, validate, test, and assess +// your 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 EC2 Image Builder's +// API operation CreateComponent for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * IdempotentParameterMismatchException +// You have specified a client token for an operation using parameter values +// that differ from a previous request that used the same client token. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * InvalidVersionNumberException +// Your version number is out of bounds or does not follow the required syntax. +// +// * ResourceInUseException +// The resource that you are trying to operate on is currently in use. Review +// the message details and retry later. +// +// * InvalidParameterCombinationException +// You have specified two or more mutually exclusive parameters. Review the +// error message for details. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/CreateComponent +func (c *Imagebuilder) CreateComponent(input *CreateComponentInput) (*CreateComponentOutput, error) { + req, out := c.CreateComponentRequest(input) + return out, req.Send() +} + +// CreateComponentWithContext is the same as CreateComponent with the addition of +// the ability to pass a context and additional request options. +// +// See CreateComponent for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) CreateComponentWithContext(ctx aws.Context, input *CreateComponentInput, opts ...request.Option) (*CreateComponentOutput, error) { + req, out := c.CreateComponentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateDistributionConfiguration = "CreateDistributionConfiguration" + +// CreateDistributionConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the CreateDistributionConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateDistributionConfiguration for more information on using the CreateDistributionConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateDistributionConfigurationRequest method. +// req, resp := client.CreateDistributionConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/CreateDistributionConfiguration +func (c *Imagebuilder) CreateDistributionConfigurationRequest(input *CreateDistributionConfigurationInput) (req *request.Request, output *CreateDistributionConfigurationOutput) { + op := &request.Operation{ + Name: opCreateDistributionConfiguration, + HTTPMethod: "PUT", + HTTPPath: "/CreateDistributionConfiguration", + } + + if input == nil { + input = &CreateDistributionConfigurationInput{} + } + + output = &CreateDistributionConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateDistributionConfiguration API operation for EC2 Image Builder. +// +// Creates a new distribution configuration. Distribution configurations define +// and configure the outputs of your 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 EC2 Image Builder's +// API operation CreateDistributionConfiguration for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * IdempotentParameterMismatchException +// You have specified a client token for an operation using parameter values +// that differ from a previous request that used the same client token. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * ResourceInUseException +// The resource that you are trying to operate on is currently in use. Review +// the message details and retry later. +// +// * ResourceAlreadyExistsException +// The resource that you are trying to create already exists. +// +// * InvalidParameterCombinationException +// You have specified two or more mutually exclusive parameters. Review the +// error message for details. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/CreateDistributionConfiguration +func (c *Imagebuilder) CreateDistributionConfiguration(input *CreateDistributionConfigurationInput) (*CreateDistributionConfigurationOutput, error) { + req, out := c.CreateDistributionConfigurationRequest(input) + return out, req.Send() +} + +// CreateDistributionConfigurationWithContext is the same as CreateDistributionConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDistributionConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) CreateDistributionConfigurationWithContext(ctx aws.Context, input *CreateDistributionConfigurationInput, opts ...request.Option) (*CreateDistributionConfigurationOutput, error) { + req, out := c.CreateDistributionConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateImage = "CreateImage" + +// CreateImageRequest generates a "aws/request.Request" representing the +// client's request for the CreateImage operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateImage for more information on using the CreateImage +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateImageRequest method. +// req, resp := client.CreateImageRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/CreateImage +func (c *Imagebuilder) CreateImageRequest(input *CreateImageInput) (req *request.Request, output *CreateImageOutput) { + op := &request.Operation{ + Name: opCreateImage, + HTTPMethod: "PUT", + HTTPPath: "/CreateImage", + } + + if input == nil { + input = &CreateImageInput{} + } + + output = &CreateImageOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateImage API operation for EC2 Image Builder. +// +// Creates a new image. This request will create a new image along with all +// of the configured output resources defined in 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 EC2 Image Builder's +// API operation CreateImage for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * IdempotentParameterMismatchException +// You have specified a client token for an operation using parameter values +// that differ from a previous request that used the same client token. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * ResourceInUseException +// The resource that you are trying to operate on is currently in use. Review +// the message details and retry later. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/CreateImage +func (c *Imagebuilder) CreateImage(input *CreateImageInput) (*CreateImageOutput, error) { + req, out := c.CreateImageRequest(input) + return out, req.Send() +} + +// CreateImageWithContext is the same as CreateImage with the addition of +// the ability to pass a context and additional request options. +// +// See CreateImage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) CreateImageWithContext(ctx aws.Context, input *CreateImageInput, opts ...request.Option) (*CreateImageOutput, error) { + req, out := c.CreateImageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateImagePipeline = "CreateImagePipeline" + +// CreateImagePipelineRequest generates a "aws/request.Request" representing the +// client's request for the CreateImagePipeline operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateImagePipeline for more information on using the CreateImagePipeline +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateImagePipelineRequest method. +// req, resp := client.CreateImagePipelineRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/CreateImagePipeline +func (c *Imagebuilder) CreateImagePipelineRequest(input *CreateImagePipelineInput) (req *request.Request, output *CreateImagePipelineOutput) { + op := &request.Operation{ + Name: opCreateImagePipeline, + HTTPMethod: "PUT", + HTTPPath: "/CreateImagePipeline", + } + + if input == nil { + input = &CreateImagePipelineInput{} + } + + output = &CreateImagePipelineOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateImagePipeline API operation for EC2 Image Builder. +// +// Creates a new image pipeline. Image pipelines enable you to automate the +// creation and distribution of 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 EC2 Image Builder's +// API operation CreateImagePipeline for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * IdempotentParameterMismatchException +// You have specified a client token for an operation using parameter values +// that differ from a previous request that used the same client token. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * ResourceInUseException +// The resource that you are trying to operate on is currently in use. Review +// the message details and retry later. +// +// * ResourceAlreadyExistsException +// The resource that you are trying to create already exists. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/CreateImagePipeline +func (c *Imagebuilder) CreateImagePipeline(input *CreateImagePipelineInput) (*CreateImagePipelineOutput, error) { + req, out := c.CreateImagePipelineRequest(input) + return out, req.Send() +} + +// CreateImagePipelineWithContext is the same as CreateImagePipeline with the addition of +// the ability to pass a context and additional request options. +// +// See CreateImagePipeline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) CreateImagePipelineWithContext(ctx aws.Context, input *CreateImagePipelineInput, opts ...request.Option) (*CreateImagePipelineOutput, error) { + req, out := c.CreateImagePipelineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateImageRecipe = "CreateImageRecipe" + +// CreateImageRecipeRequest generates a "aws/request.Request" representing the +// client's request for the CreateImageRecipe operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateImageRecipe for more information on using the CreateImageRecipe +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateImageRecipeRequest method. +// req, resp := client.CreateImageRecipeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/CreateImageRecipe +func (c *Imagebuilder) CreateImageRecipeRequest(input *CreateImageRecipeInput) (req *request.Request, output *CreateImageRecipeOutput) { + op := &request.Operation{ + Name: opCreateImageRecipe, + HTTPMethod: "PUT", + HTTPPath: "/CreateImageRecipe", + } + + if input == nil { + input = &CreateImageRecipeInput{} + } + + output = &CreateImageRecipeOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateImageRecipe API operation for EC2 Image Builder. +// +// Creates a new image recipe. Image recipes define how images are configured, +// tested, and assessed. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for EC2 Image Builder's +// API operation CreateImageRecipe for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * IdempotentParameterMismatchException +// You have specified a client token for an operation using parameter values +// that differ from a previous request that used the same client token. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * InvalidVersionNumberException +// Your version number is out of bounds or does not follow the required syntax. +// +// * ResourceInUseException +// The resource that you are trying to operate on is currently in use. Review +// the message details and retry later. +// +// * ResourceAlreadyExistsException +// The resource that you are trying to create already exists. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/CreateImageRecipe +func (c *Imagebuilder) CreateImageRecipe(input *CreateImageRecipeInput) (*CreateImageRecipeOutput, error) { + req, out := c.CreateImageRecipeRequest(input) + return out, req.Send() +} + +// CreateImageRecipeWithContext is the same as CreateImageRecipe with the addition of +// the ability to pass a context and additional request options. +// +// See CreateImageRecipe for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) CreateImageRecipeWithContext(ctx aws.Context, input *CreateImageRecipeInput, opts ...request.Option) (*CreateImageRecipeOutput, error) { + req, out := c.CreateImageRecipeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateInfrastructureConfiguration = "CreateInfrastructureConfiguration" + +// CreateInfrastructureConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the CreateInfrastructureConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateInfrastructureConfiguration for more information on using the CreateInfrastructureConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateInfrastructureConfigurationRequest method. +// req, resp := client.CreateInfrastructureConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/CreateInfrastructureConfiguration +func (c *Imagebuilder) CreateInfrastructureConfigurationRequest(input *CreateInfrastructureConfigurationInput) (req *request.Request, output *CreateInfrastructureConfigurationOutput) { + op := &request.Operation{ + Name: opCreateInfrastructureConfiguration, + HTTPMethod: "PUT", + HTTPPath: "/CreateInfrastructureConfiguration", + } + + if input == nil { + input = &CreateInfrastructureConfigurationInput{} + } + + output = &CreateInfrastructureConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateInfrastructureConfiguration API operation for EC2 Image Builder. +// +// Creates a new infrastructure configuration. An infrastructure configuration +// defines the environment in which your image will be built and tested. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for EC2 Image Builder's +// API operation CreateInfrastructureConfiguration for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * IdempotentParameterMismatchException +// You have specified a client token for an operation using parameter values +// that differ from a previous request that used the same client token. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * ResourceInUseException +// The resource that you are trying to operate on is currently in use. Review +// the message details and retry later. +// +// * ResourceAlreadyExistsException +// The resource that you are trying to create already exists. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/CreateInfrastructureConfiguration +func (c *Imagebuilder) CreateInfrastructureConfiguration(input *CreateInfrastructureConfigurationInput) (*CreateInfrastructureConfigurationOutput, error) { + req, out := c.CreateInfrastructureConfigurationRequest(input) + return out, req.Send() +} + +// CreateInfrastructureConfigurationWithContext is the same as CreateInfrastructureConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See CreateInfrastructureConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) CreateInfrastructureConfigurationWithContext(ctx aws.Context, input *CreateInfrastructureConfigurationInput, opts ...request.Option) (*CreateInfrastructureConfigurationOutput, error) { + req, out := c.CreateInfrastructureConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteComponent = "DeleteComponent" + +// DeleteComponentRequest generates a "aws/request.Request" representing the +// client's request for the DeleteComponent operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteComponent for more information on using the DeleteComponent +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteComponentRequest method. +// req, resp := client.DeleteComponentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/DeleteComponent +func (c *Imagebuilder) DeleteComponentRequest(input *DeleteComponentInput) (req *request.Request, output *DeleteComponentOutput) { + op := &request.Operation{ + Name: opDeleteComponent, + HTTPMethod: "DELETE", + HTTPPath: "/DeleteComponent", + } + + if input == nil { + input = &DeleteComponentInput{} + } + + output = &DeleteComponentOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteComponent API operation for EC2 Image Builder. +// +// Deletes a component build 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 EC2 Image Builder's +// API operation DeleteComponent for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * ResourceDependencyException +// You have attempted to mutate or delete a resource with a dependency that +// prohibits this action. See the error message for more details. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/DeleteComponent +func (c *Imagebuilder) DeleteComponent(input *DeleteComponentInput) (*DeleteComponentOutput, error) { + req, out := c.DeleteComponentRequest(input) + return out, req.Send() +} + +// DeleteComponentWithContext is the same as DeleteComponent with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteComponent for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) DeleteComponentWithContext(ctx aws.Context, input *DeleteComponentInput, opts ...request.Option) (*DeleteComponentOutput, error) { + req, out := c.DeleteComponentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteDistributionConfiguration = "DeleteDistributionConfiguration" + +// DeleteDistributionConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteDistributionConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteDistributionConfiguration for more information on using the DeleteDistributionConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteDistributionConfigurationRequest method. +// req, resp := client.DeleteDistributionConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/DeleteDistributionConfiguration +func (c *Imagebuilder) DeleteDistributionConfigurationRequest(input *DeleteDistributionConfigurationInput) (req *request.Request, output *DeleteDistributionConfigurationOutput) { + op := &request.Operation{ + Name: opDeleteDistributionConfiguration, + HTTPMethod: "DELETE", + HTTPPath: "/DeleteDistributionConfiguration", + } + + if input == nil { + input = &DeleteDistributionConfigurationInput{} + } + + output = &DeleteDistributionConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteDistributionConfiguration API operation for EC2 Image Builder. +// +// Deletes a 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 EC2 Image Builder's +// API operation DeleteDistributionConfiguration for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * ResourceDependencyException +// You have attempted to mutate or delete a resource with a dependency that +// prohibits this action. See the error message for more details. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/DeleteDistributionConfiguration +func (c *Imagebuilder) DeleteDistributionConfiguration(input *DeleteDistributionConfigurationInput) (*DeleteDistributionConfigurationOutput, error) { + req, out := c.DeleteDistributionConfigurationRequest(input) + return out, req.Send() +} + +// DeleteDistributionConfigurationWithContext is the same as DeleteDistributionConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDistributionConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) DeleteDistributionConfigurationWithContext(ctx aws.Context, input *DeleteDistributionConfigurationInput, opts ...request.Option) (*DeleteDistributionConfigurationOutput, error) { + req, out := c.DeleteDistributionConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteImage = "DeleteImage" + +// DeleteImageRequest generates a "aws/request.Request" representing the +// client's request for the DeleteImage operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteImage for more information on using the DeleteImage +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteImageRequest method. +// req, resp := client.DeleteImageRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/DeleteImage +func (c *Imagebuilder) DeleteImageRequest(input *DeleteImageInput) (req *request.Request, output *DeleteImageOutput) { + op := &request.Operation{ + Name: opDeleteImage, + HTTPMethod: "DELETE", + HTTPPath: "/DeleteImage", + } + + if input == nil { + input = &DeleteImageInput{} + } + + output = &DeleteImageOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteImage API operation for EC2 Image Builder. +// +// Deletes an 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 EC2 Image Builder's +// API operation DeleteImage for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * ResourceDependencyException +// You have attempted to mutate or delete a resource with a dependency that +// prohibits this action. See the error message for more details. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/DeleteImage +func (c *Imagebuilder) DeleteImage(input *DeleteImageInput) (*DeleteImageOutput, error) { + req, out := c.DeleteImageRequest(input) + return out, req.Send() +} + +// DeleteImageWithContext is the same as DeleteImage with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteImage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) DeleteImageWithContext(ctx aws.Context, input *DeleteImageInput, opts ...request.Option) (*DeleteImageOutput, error) { + req, out := c.DeleteImageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteImagePipeline = "DeleteImagePipeline" + +// DeleteImagePipelineRequest generates a "aws/request.Request" representing the +// client's request for the DeleteImagePipeline operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteImagePipeline for more information on using the DeleteImagePipeline +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteImagePipelineRequest method. +// req, resp := client.DeleteImagePipelineRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/DeleteImagePipeline +func (c *Imagebuilder) DeleteImagePipelineRequest(input *DeleteImagePipelineInput) (req *request.Request, output *DeleteImagePipelineOutput) { + op := &request.Operation{ + Name: opDeleteImagePipeline, + HTTPMethod: "DELETE", + HTTPPath: "/DeleteImagePipeline", + } + + if input == nil { + input = &DeleteImagePipelineInput{} + } + + output = &DeleteImagePipelineOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteImagePipeline API operation for EC2 Image Builder. +// +// Deletes an image 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 EC2 Image Builder's +// API operation DeleteImagePipeline for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * ResourceDependencyException +// You have attempted to mutate or delete a resource with a dependency that +// prohibits this action. See the error message for more details. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/DeleteImagePipeline +func (c *Imagebuilder) DeleteImagePipeline(input *DeleteImagePipelineInput) (*DeleteImagePipelineOutput, error) { + req, out := c.DeleteImagePipelineRequest(input) + return out, req.Send() +} + +// DeleteImagePipelineWithContext is the same as DeleteImagePipeline with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteImagePipeline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) DeleteImagePipelineWithContext(ctx aws.Context, input *DeleteImagePipelineInput, opts ...request.Option) (*DeleteImagePipelineOutput, error) { + req, out := c.DeleteImagePipelineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteImageRecipe = "DeleteImageRecipe" + +// DeleteImageRecipeRequest generates a "aws/request.Request" representing the +// client's request for the DeleteImageRecipe operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteImageRecipe for more information on using the DeleteImageRecipe +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteImageRecipeRequest method. +// req, resp := client.DeleteImageRecipeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/DeleteImageRecipe +func (c *Imagebuilder) DeleteImageRecipeRequest(input *DeleteImageRecipeInput) (req *request.Request, output *DeleteImageRecipeOutput) { + op := &request.Operation{ + Name: opDeleteImageRecipe, + HTTPMethod: "DELETE", + HTTPPath: "/DeleteImageRecipe", + } + + if input == nil { + input = &DeleteImageRecipeInput{} + } + + output = &DeleteImageRecipeOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteImageRecipe API operation for EC2 Image Builder. +// +// Deletes an image recipe. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for EC2 Image Builder's +// API operation DeleteImageRecipe for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * ResourceDependencyException +// You have attempted to mutate or delete a resource with a dependency that +// prohibits this action. See the error message for more details. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/DeleteImageRecipe +func (c *Imagebuilder) DeleteImageRecipe(input *DeleteImageRecipeInput) (*DeleteImageRecipeOutput, error) { + req, out := c.DeleteImageRecipeRequest(input) + return out, req.Send() +} + +// DeleteImageRecipeWithContext is the same as DeleteImageRecipe with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteImageRecipe for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) DeleteImageRecipeWithContext(ctx aws.Context, input *DeleteImageRecipeInput, opts ...request.Option) (*DeleteImageRecipeOutput, error) { + req, out := c.DeleteImageRecipeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteInfrastructureConfiguration = "DeleteInfrastructureConfiguration" + +// DeleteInfrastructureConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteInfrastructureConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteInfrastructureConfiguration for more information on using the DeleteInfrastructureConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteInfrastructureConfigurationRequest method. +// req, resp := client.DeleteInfrastructureConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/DeleteInfrastructureConfiguration +func (c *Imagebuilder) DeleteInfrastructureConfigurationRequest(input *DeleteInfrastructureConfigurationInput) (req *request.Request, output *DeleteInfrastructureConfigurationOutput) { + op := &request.Operation{ + Name: opDeleteInfrastructureConfiguration, + HTTPMethod: "DELETE", + HTTPPath: "/DeleteInfrastructureConfiguration", + } + + if input == nil { + input = &DeleteInfrastructureConfigurationInput{} + } + + output = &DeleteInfrastructureConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteInfrastructureConfiguration API operation for EC2 Image Builder. +// +// Deletes an infrastructure 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 EC2 Image Builder's +// API operation DeleteInfrastructureConfiguration for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * ResourceDependencyException +// You have attempted to mutate or delete a resource with a dependency that +// prohibits this action. See the error message for more details. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/DeleteInfrastructureConfiguration +func (c *Imagebuilder) DeleteInfrastructureConfiguration(input *DeleteInfrastructureConfigurationInput) (*DeleteInfrastructureConfigurationOutput, error) { + req, out := c.DeleteInfrastructureConfigurationRequest(input) + return out, req.Send() +} + +// DeleteInfrastructureConfigurationWithContext is the same as DeleteInfrastructureConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteInfrastructureConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) DeleteInfrastructureConfigurationWithContext(ctx aws.Context, input *DeleteInfrastructureConfigurationInput, opts ...request.Option) (*DeleteInfrastructureConfigurationOutput, error) { + req, out := c.DeleteInfrastructureConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetComponent = "GetComponent" + +// GetComponentRequest generates a "aws/request.Request" representing the +// client's request for the GetComponent operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetComponent for more information on using the GetComponent +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetComponentRequest method. +// req, resp := client.GetComponentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetComponent +func (c *Imagebuilder) GetComponentRequest(input *GetComponentInput) (req *request.Request, output *GetComponentOutput) { + op := &request.Operation{ + Name: opGetComponent, + HTTPMethod: "GET", + HTTPPath: "/GetComponent", + } + + if input == nil { + input = &GetComponentInput{} + } + + output = &GetComponentOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetComponent API operation for EC2 Image Builder. +// +// Gets a component object. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for EC2 Image Builder's +// API operation GetComponent for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetComponent +func (c *Imagebuilder) GetComponent(input *GetComponentInput) (*GetComponentOutput, error) { + req, out := c.GetComponentRequest(input) + return out, req.Send() +} + +// GetComponentWithContext is the same as GetComponent with the addition of +// the ability to pass a context and additional request options. +// +// See GetComponent for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) GetComponentWithContext(ctx aws.Context, input *GetComponentInput, opts ...request.Option) (*GetComponentOutput, error) { + req, out := c.GetComponentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetComponentPolicy = "GetComponentPolicy" + +// GetComponentPolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetComponentPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetComponentPolicy for more information on using the GetComponentPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetComponentPolicyRequest method. +// req, resp := client.GetComponentPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetComponentPolicy +func (c *Imagebuilder) GetComponentPolicyRequest(input *GetComponentPolicyInput) (req *request.Request, output *GetComponentPolicyOutput) { + op := &request.Operation{ + Name: opGetComponentPolicy, + HTTPMethod: "GET", + HTTPPath: "/GetComponentPolicy", + } + + if input == nil { + input = &GetComponentPolicyInput{} + } + + output = &GetComponentPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetComponentPolicy API operation for EC2 Image Builder. +// +// Gets a component 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 EC2 Image Builder's +// API operation GetComponentPolicy for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * ResourceNotFoundException +// At least one of the resources referenced by your request does not exist. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetComponentPolicy +func (c *Imagebuilder) GetComponentPolicy(input *GetComponentPolicyInput) (*GetComponentPolicyOutput, error) { + req, out := c.GetComponentPolicyRequest(input) + return out, req.Send() +} + +// GetComponentPolicyWithContext is the same as GetComponentPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetComponentPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) GetComponentPolicyWithContext(ctx aws.Context, input *GetComponentPolicyInput, opts ...request.Option) (*GetComponentPolicyOutput, error) { + req, out := c.GetComponentPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetDistributionConfiguration = "GetDistributionConfiguration" + +// GetDistributionConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the GetDistributionConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetDistributionConfiguration for more information on using the GetDistributionConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetDistributionConfigurationRequest method. +// req, resp := client.GetDistributionConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetDistributionConfiguration +func (c *Imagebuilder) GetDistributionConfigurationRequest(input *GetDistributionConfigurationInput) (req *request.Request, output *GetDistributionConfigurationOutput) { + op := &request.Operation{ + Name: opGetDistributionConfiguration, + HTTPMethod: "GET", + HTTPPath: "/GetDistributionConfiguration", + } + + if input == nil { + input = &GetDistributionConfigurationInput{} + } + + output = &GetDistributionConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetDistributionConfiguration API operation for EC2 Image Builder. +// +// Gets a 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 EC2 Image Builder's +// API operation GetDistributionConfiguration for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetDistributionConfiguration +func (c *Imagebuilder) GetDistributionConfiguration(input *GetDistributionConfigurationInput) (*GetDistributionConfigurationOutput, error) { + req, out := c.GetDistributionConfigurationRequest(input) + return out, req.Send() +} + +// GetDistributionConfigurationWithContext is the same as GetDistributionConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetDistributionConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) GetDistributionConfigurationWithContext(ctx aws.Context, input *GetDistributionConfigurationInput, opts ...request.Option) (*GetDistributionConfigurationOutput, error) { + req, out := c.GetDistributionConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetImage = "GetImage" + +// GetImageRequest generates a "aws/request.Request" representing the +// client's request for the GetImage operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetImage for more information on using the GetImage +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetImageRequest method. +// req, resp := client.GetImageRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetImage +func (c *Imagebuilder) GetImageRequest(input *GetImageInput) (req *request.Request, output *GetImageOutput) { + op := &request.Operation{ + Name: opGetImage, + HTTPMethod: "GET", + HTTPPath: "/GetImage", + } + + if input == nil { + input = &GetImageInput{} + } + + output = &GetImageOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetImage API operation for EC2 Image Builder. +// +// Gets an 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 EC2 Image Builder's +// API operation GetImage for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetImage +func (c *Imagebuilder) GetImage(input *GetImageInput) (*GetImageOutput, error) { + req, out := c.GetImageRequest(input) + return out, req.Send() +} + +// GetImageWithContext is the same as GetImage with the addition of +// the ability to pass a context and additional request options. +// +// See GetImage for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) GetImageWithContext(ctx aws.Context, input *GetImageInput, opts ...request.Option) (*GetImageOutput, error) { + req, out := c.GetImageRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetImagePipeline = "GetImagePipeline" + +// GetImagePipelineRequest generates a "aws/request.Request" representing the +// client's request for the GetImagePipeline operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetImagePipeline for more information on using the GetImagePipeline +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetImagePipelineRequest method. +// req, resp := client.GetImagePipelineRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetImagePipeline +func (c *Imagebuilder) GetImagePipelineRequest(input *GetImagePipelineInput) (req *request.Request, output *GetImagePipelineOutput) { + op := &request.Operation{ + Name: opGetImagePipeline, + HTTPMethod: "GET", + HTTPPath: "/GetImagePipeline", + } + + if input == nil { + input = &GetImagePipelineInput{} + } + + output = &GetImagePipelineOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetImagePipeline API operation for EC2 Image Builder. +// +// Gets an image 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 EC2 Image Builder's +// API operation GetImagePipeline for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetImagePipeline +func (c *Imagebuilder) GetImagePipeline(input *GetImagePipelineInput) (*GetImagePipelineOutput, error) { + req, out := c.GetImagePipelineRequest(input) + return out, req.Send() +} + +// GetImagePipelineWithContext is the same as GetImagePipeline with the addition of +// the ability to pass a context and additional request options. +// +// See GetImagePipeline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) GetImagePipelineWithContext(ctx aws.Context, input *GetImagePipelineInput, opts ...request.Option) (*GetImagePipelineOutput, error) { + req, out := c.GetImagePipelineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetImagePolicy = "GetImagePolicy" + +// GetImagePolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetImagePolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetImagePolicy for more information on using the GetImagePolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetImagePolicyRequest method. +// req, resp := client.GetImagePolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetImagePolicy +func (c *Imagebuilder) GetImagePolicyRequest(input *GetImagePolicyInput) (req *request.Request, output *GetImagePolicyOutput) { + op := &request.Operation{ + Name: opGetImagePolicy, + HTTPMethod: "GET", + HTTPPath: "/GetImagePolicy", + } + + if input == nil { + input = &GetImagePolicyInput{} + } + + output = &GetImagePolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetImagePolicy API operation for EC2 Image Builder. +// +// Gets an image 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 EC2 Image Builder's +// API operation GetImagePolicy for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * ResourceNotFoundException +// At least one of the resources referenced by your request does not exist. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetImagePolicy +func (c *Imagebuilder) GetImagePolicy(input *GetImagePolicyInput) (*GetImagePolicyOutput, error) { + req, out := c.GetImagePolicyRequest(input) + return out, req.Send() +} + +// GetImagePolicyWithContext is the same as GetImagePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetImagePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) GetImagePolicyWithContext(ctx aws.Context, input *GetImagePolicyInput, opts ...request.Option) (*GetImagePolicyOutput, error) { + req, out := c.GetImagePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetImageRecipe = "GetImageRecipe" + +// GetImageRecipeRequest generates a "aws/request.Request" representing the +// client's request for the GetImageRecipe operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetImageRecipe for more information on using the GetImageRecipe +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetImageRecipeRequest method. +// req, resp := client.GetImageRecipeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetImageRecipe +func (c *Imagebuilder) GetImageRecipeRequest(input *GetImageRecipeInput) (req *request.Request, output *GetImageRecipeOutput) { + op := &request.Operation{ + Name: opGetImageRecipe, + HTTPMethod: "GET", + HTTPPath: "/GetImageRecipe", + } + + if input == nil { + input = &GetImageRecipeInput{} + } + + output = &GetImageRecipeOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetImageRecipe API operation for EC2 Image Builder. +// +// Gets an image recipe. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for EC2 Image Builder's +// API operation GetImageRecipe for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetImageRecipe +func (c *Imagebuilder) GetImageRecipe(input *GetImageRecipeInput) (*GetImageRecipeOutput, error) { + req, out := c.GetImageRecipeRequest(input) + return out, req.Send() +} + +// GetImageRecipeWithContext is the same as GetImageRecipe with the addition of +// the ability to pass a context and additional request options. +// +// See GetImageRecipe for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) GetImageRecipeWithContext(ctx aws.Context, input *GetImageRecipeInput, opts ...request.Option) (*GetImageRecipeOutput, error) { + req, out := c.GetImageRecipeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetImageRecipePolicy = "GetImageRecipePolicy" + +// GetImageRecipePolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetImageRecipePolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetImageRecipePolicy for more information on using the GetImageRecipePolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetImageRecipePolicyRequest method. +// req, resp := client.GetImageRecipePolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetImageRecipePolicy +func (c *Imagebuilder) GetImageRecipePolicyRequest(input *GetImageRecipePolicyInput) (req *request.Request, output *GetImageRecipePolicyOutput) { + op := &request.Operation{ + Name: opGetImageRecipePolicy, + HTTPMethod: "GET", + HTTPPath: "/GetImageRecipePolicy", + } + + if input == nil { + input = &GetImageRecipePolicyInput{} + } + + output = &GetImageRecipePolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetImageRecipePolicy API operation for EC2 Image Builder. +// +// Gets an image recipe 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 EC2 Image Builder's +// API operation GetImageRecipePolicy for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ResourceNotFoundException +// At least one of the resources referenced by your request does not exist. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetImageRecipePolicy +func (c *Imagebuilder) GetImageRecipePolicy(input *GetImageRecipePolicyInput) (*GetImageRecipePolicyOutput, error) { + req, out := c.GetImageRecipePolicyRequest(input) + return out, req.Send() +} + +// GetImageRecipePolicyWithContext is the same as GetImageRecipePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See GetImageRecipePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) GetImageRecipePolicyWithContext(ctx aws.Context, input *GetImageRecipePolicyInput, opts ...request.Option) (*GetImageRecipePolicyOutput, error) { + req, out := c.GetImageRecipePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetInfrastructureConfiguration = "GetInfrastructureConfiguration" + +// GetInfrastructureConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the GetInfrastructureConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetInfrastructureConfiguration for more information on using the GetInfrastructureConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetInfrastructureConfigurationRequest method. +// req, resp := client.GetInfrastructureConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetInfrastructureConfiguration +func (c *Imagebuilder) GetInfrastructureConfigurationRequest(input *GetInfrastructureConfigurationInput) (req *request.Request, output *GetInfrastructureConfigurationOutput) { + op := &request.Operation{ + Name: opGetInfrastructureConfiguration, + HTTPMethod: "GET", + HTTPPath: "/GetInfrastructureConfiguration", + } + + if input == nil { + input = &GetInfrastructureConfigurationInput{} + } + + output = &GetInfrastructureConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetInfrastructureConfiguration API operation for EC2 Image Builder. +// +// Gets an infrastructure 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 EC2 Image Builder's +// API operation GetInfrastructureConfiguration for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/GetInfrastructureConfiguration +func (c *Imagebuilder) GetInfrastructureConfiguration(input *GetInfrastructureConfigurationInput) (*GetInfrastructureConfigurationOutput, error) { + req, out := c.GetInfrastructureConfigurationRequest(input) + return out, req.Send() +} + +// GetInfrastructureConfigurationWithContext is the same as GetInfrastructureConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetInfrastructureConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) GetInfrastructureConfigurationWithContext(ctx aws.Context, input *GetInfrastructureConfigurationInput, opts ...request.Option) (*GetInfrastructureConfigurationOutput, error) { + req, out := c.GetInfrastructureConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opImportComponent = "ImportComponent" + +// ImportComponentRequest generates a "aws/request.Request" representing the +// client's request for the ImportComponent operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ImportComponent for more information on using the ImportComponent +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ImportComponentRequest method. +// req, resp := client.ImportComponentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ImportComponent +func (c *Imagebuilder) ImportComponentRequest(input *ImportComponentInput) (req *request.Request, output *ImportComponentOutput) { + op := &request.Operation{ + Name: opImportComponent, + HTTPMethod: "PUT", + HTTPPath: "/ImportComponent", + } + + if input == nil { + input = &ImportComponentInput{} + } + + output = &ImportComponentOutput{} + req = c.newRequest(op, input, output) + return +} + +// ImportComponent API operation for EC2 Image Builder. +// +// Imports a component and transforms its data into a component 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 EC2 Image Builder's +// API operation ImportComponent for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * IdempotentParameterMismatchException +// You have specified a client token for an operation using parameter values +// that differ from a previous request that used the same client token. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * InvalidVersionNumberException +// Your version number is out of bounds or does not follow the required syntax. +// +// * ResourceInUseException +// The resource that you are trying to operate on is currently in use. Review +// the message details and retry later. +// +// * InvalidParameterCombinationException +// You have specified two or more mutually exclusive parameters. Review the +// error message for details. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ImportComponent +func (c *Imagebuilder) ImportComponent(input *ImportComponentInput) (*ImportComponentOutput, error) { + req, out := c.ImportComponentRequest(input) + return out, req.Send() +} + +// ImportComponentWithContext is the same as ImportComponent with the addition of +// the ability to pass a context and additional request options. +// +// See ImportComponent for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) ImportComponentWithContext(ctx aws.Context, input *ImportComponentInput, opts ...request.Option) (*ImportComponentOutput, error) { + req, out := c.ImportComponentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListComponentBuildVersions = "ListComponentBuildVersions" + +// ListComponentBuildVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListComponentBuildVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListComponentBuildVersions for more information on using the ListComponentBuildVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListComponentBuildVersionsRequest method. +// req, resp := client.ListComponentBuildVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListComponentBuildVersions +func (c *Imagebuilder) ListComponentBuildVersionsRequest(input *ListComponentBuildVersionsInput) (req *request.Request, output *ListComponentBuildVersionsOutput) { + op := &request.Operation{ + Name: opListComponentBuildVersions, + HTTPMethod: "POST", + HTTPPath: "/ListComponentBuildVersions", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListComponentBuildVersionsInput{} + } + + output = &ListComponentBuildVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListComponentBuildVersions API operation for EC2 Image Builder. +// +// Returns the list of component build versions for the specified semantic 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 EC2 Image Builder's +// API operation ListComponentBuildVersions for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * InvalidPaginationTokenException +// You have provided an invalid pagination token in your request. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListComponentBuildVersions +func (c *Imagebuilder) ListComponentBuildVersions(input *ListComponentBuildVersionsInput) (*ListComponentBuildVersionsOutput, error) { + req, out := c.ListComponentBuildVersionsRequest(input) + return out, req.Send() +} + +// ListComponentBuildVersionsWithContext is the same as ListComponentBuildVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListComponentBuildVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) ListComponentBuildVersionsWithContext(ctx aws.Context, input *ListComponentBuildVersionsInput, opts ...request.Option) (*ListComponentBuildVersionsOutput, error) { + req, out := c.ListComponentBuildVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListComponentBuildVersionsPages iterates over the pages of a ListComponentBuildVersions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListComponentBuildVersions 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 ListComponentBuildVersions operation. +// pageNum := 0 +// err := client.ListComponentBuildVersionsPages(params, +// func(page *imagebuilder.ListComponentBuildVersionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Imagebuilder) ListComponentBuildVersionsPages(input *ListComponentBuildVersionsInput, fn func(*ListComponentBuildVersionsOutput, bool) bool) error { + return c.ListComponentBuildVersionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListComponentBuildVersionsPagesWithContext same as ListComponentBuildVersionsPages 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 *Imagebuilder) ListComponentBuildVersionsPagesWithContext(ctx aws.Context, input *ListComponentBuildVersionsInput, fn func(*ListComponentBuildVersionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListComponentBuildVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListComponentBuildVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListComponentBuildVersionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListComponents = "ListComponents" + +// ListComponentsRequest generates a "aws/request.Request" representing the +// client's request for the ListComponents operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListComponents for more information on using the ListComponents +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListComponentsRequest method. +// req, resp := client.ListComponentsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListComponents +func (c *Imagebuilder) ListComponentsRequest(input *ListComponentsInput) (req *request.Request, output *ListComponentsOutput) { + op := &request.Operation{ + Name: opListComponents, + HTTPMethod: "POST", + HTTPPath: "/ListComponents", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListComponentsInput{} + } + + output = &ListComponentsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListComponents API operation for EC2 Image Builder. +// +// Returns the list of component build versions for the specified semantic 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 EC2 Image Builder's +// API operation ListComponents for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * InvalidPaginationTokenException +// You have provided an invalid pagination token in your request. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListComponents +func (c *Imagebuilder) ListComponents(input *ListComponentsInput) (*ListComponentsOutput, error) { + req, out := c.ListComponentsRequest(input) + return out, req.Send() +} + +// ListComponentsWithContext is the same as ListComponents with the addition of +// the ability to pass a context and additional request options. +// +// See ListComponents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) ListComponentsWithContext(ctx aws.Context, input *ListComponentsInput, opts ...request.Option) (*ListComponentsOutput, error) { + req, out := c.ListComponentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListComponentsPages iterates over the pages of a ListComponents operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListComponents 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 ListComponents operation. +// pageNum := 0 +// err := client.ListComponentsPages(params, +// func(page *imagebuilder.ListComponentsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Imagebuilder) ListComponentsPages(input *ListComponentsInput, fn func(*ListComponentsOutput, bool) bool) error { + return c.ListComponentsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListComponentsPagesWithContext same as ListComponentsPages 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 *Imagebuilder) ListComponentsPagesWithContext(ctx aws.Context, input *ListComponentsInput, fn func(*ListComponentsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListComponentsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListComponentsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListComponentsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListDistributionConfigurations = "ListDistributionConfigurations" + +// ListDistributionConfigurationsRequest generates a "aws/request.Request" representing the +// client's request for the ListDistributionConfigurations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListDistributionConfigurations for more information on using the ListDistributionConfigurations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListDistributionConfigurationsRequest method. +// req, resp := client.ListDistributionConfigurationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListDistributionConfigurations +func (c *Imagebuilder) ListDistributionConfigurationsRequest(input *ListDistributionConfigurationsInput) (req *request.Request, output *ListDistributionConfigurationsOutput) { + op := &request.Operation{ + Name: opListDistributionConfigurations, + HTTPMethod: "POST", + HTTPPath: "/ListDistributionConfigurations", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListDistributionConfigurationsInput{} + } + + output = &ListDistributionConfigurationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListDistributionConfigurations API operation for EC2 Image Builder. +// +// Returns a list of distribution 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 EC2 Image Builder's +// API operation ListDistributionConfigurations for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * InvalidPaginationTokenException +// You have provided an invalid pagination token in your request. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListDistributionConfigurations +func (c *Imagebuilder) ListDistributionConfigurations(input *ListDistributionConfigurationsInput) (*ListDistributionConfigurationsOutput, error) { + req, out := c.ListDistributionConfigurationsRequest(input) + return out, req.Send() +} + +// ListDistributionConfigurationsWithContext is the same as ListDistributionConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See ListDistributionConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) ListDistributionConfigurationsWithContext(ctx aws.Context, input *ListDistributionConfigurationsInput, opts ...request.Option) (*ListDistributionConfigurationsOutput, error) { + req, out := c.ListDistributionConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListDistributionConfigurationsPages iterates over the pages of a ListDistributionConfigurations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListDistributionConfigurations 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 ListDistributionConfigurations operation. +// pageNum := 0 +// err := client.ListDistributionConfigurationsPages(params, +// func(page *imagebuilder.ListDistributionConfigurationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Imagebuilder) ListDistributionConfigurationsPages(input *ListDistributionConfigurationsInput, fn func(*ListDistributionConfigurationsOutput, bool) bool) error { + return c.ListDistributionConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListDistributionConfigurationsPagesWithContext same as ListDistributionConfigurationsPages 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 *Imagebuilder) ListDistributionConfigurationsPagesWithContext(ctx aws.Context, input *ListDistributionConfigurationsInput, fn func(*ListDistributionConfigurationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDistributionConfigurationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDistributionConfigurationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListDistributionConfigurationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListImageBuildVersions = "ListImageBuildVersions" + +// ListImageBuildVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListImageBuildVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListImageBuildVersions for more information on using the ListImageBuildVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListImageBuildVersionsRequest method. +// req, resp := client.ListImageBuildVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListImageBuildVersions +func (c *Imagebuilder) ListImageBuildVersionsRequest(input *ListImageBuildVersionsInput) (req *request.Request, output *ListImageBuildVersionsOutput) { + op := &request.Operation{ + Name: opListImageBuildVersions, + HTTPMethod: "POST", + HTTPPath: "/ListImageBuildVersions", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListImageBuildVersionsInput{} + } + + output = &ListImageBuildVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListImageBuildVersions API operation for EC2 Image Builder. +// +// Returns a list of distribution 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 EC2 Image Builder's +// API operation ListImageBuildVersions for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * InvalidPaginationTokenException +// You have provided an invalid pagination token in your request. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListImageBuildVersions +func (c *Imagebuilder) ListImageBuildVersions(input *ListImageBuildVersionsInput) (*ListImageBuildVersionsOutput, error) { + req, out := c.ListImageBuildVersionsRequest(input) + return out, req.Send() +} + +// ListImageBuildVersionsWithContext is the same as ListImageBuildVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListImageBuildVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) ListImageBuildVersionsWithContext(ctx aws.Context, input *ListImageBuildVersionsInput, opts ...request.Option) (*ListImageBuildVersionsOutput, error) { + req, out := c.ListImageBuildVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListImageBuildVersionsPages iterates over the pages of a ListImageBuildVersions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListImageBuildVersions 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 ListImageBuildVersions operation. +// pageNum := 0 +// err := client.ListImageBuildVersionsPages(params, +// func(page *imagebuilder.ListImageBuildVersionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Imagebuilder) ListImageBuildVersionsPages(input *ListImageBuildVersionsInput, fn func(*ListImageBuildVersionsOutput, bool) bool) error { + return c.ListImageBuildVersionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListImageBuildVersionsPagesWithContext same as ListImageBuildVersionsPages 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 *Imagebuilder) ListImageBuildVersionsPagesWithContext(ctx aws.Context, input *ListImageBuildVersionsInput, fn func(*ListImageBuildVersionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListImageBuildVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListImageBuildVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListImageBuildVersionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListImagePipelineImages = "ListImagePipelineImages" + +// ListImagePipelineImagesRequest generates a "aws/request.Request" representing the +// client's request for the ListImagePipelineImages operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListImagePipelineImages for more information on using the ListImagePipelineImages +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListImagePipelineImagesRequest method. +// req, resp := client.ListImagePipelineImagesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListImagePipelineImages +func (c *Imagebuilder) ListImagePipelineImagesRequest(input *ListImagePipelineImagesInput) (req *request.Request, output *ListImagePipelineImagesOutput) { + op := &request.Operation{ + Name: opListImagePipelineImages, + HTTPMethod: "POST", + HTTPPath: "/ListImagePipelineImages", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListImagePipelineImagesInput{} + } + + output = &ListImagePipelineImagesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListImagePipelineImages API operation for EC2 Image Builder. +// +// Returns a list of images created by 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 EC2 Image Builder's +// API operation ListImagePipelineImages for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * InvalidPaginationTokenException +// You have provided an invalid pagination token in your request. +// +// * ResourceNotFoundException +// At least one of the resources referenced by your request does not exist. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListImagePipelineImages +func (c *Imagebuilder) ListImagePipelineImages(input *ListImagePipelineImagesInput) (*ListImagePipelineImagesOutput, error) { + req, out := c.ListImagePipelineImagesRequest(input) + return out, req.Send() +} + +// ListImagePipelineImagesWithContext is the same as ListImagePipelineImages with the addition of +// the ability to pass a context and additional request options. +// +// See ListImagePipelineImages for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) ListImagePipelineImagesWithContext(ctx aws.Context, input *ListImagePipelineImagesInput, opts ...request.Option) (*ListImagePipelineImagesOutput, error) { + req, out := c.ListImagePipelineImagesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListImagePipelineImagesPages iterates over the pages of a ListImagePipelineImages operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListImagePipelineImages 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 ListImagePipelineImages operation. +// pageNum := 0 +// err := client.ListImagePipelineImagesPages(params, +// func(page *imagebuilder.ListImagePipelineImagesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Imagebuilder) ListImagePipelineImagesPages(input *ListImagePipelineImagesInput, fn func(*ListImagePipelineImagesOutput, bool) bool) error { + return c.ListImagePipelineImagesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListImagePipelineImagesPagesWithContext same as ListImagePipelineImagesPages 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 *Imagebuilder) ListImagePipelineImagesPagesWithContext(ctx aws.Context, input *ListImagePipelineImagesInput, fn func(*ListImagePipelineImagesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListImagePipelineImagesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListImagePipelineImagesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListImagePipelineImagesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListImagePipelines = "ListImagePipelines" + +// ListImagePipelinesRequest generates a "aws/request.Request" representing the +// client's request for the ListImagePipelines operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListImagePipelines for more information on using the ListImagePipelines +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListImagePipelinesRequest method. +// req, resp := client.ListImagePipelinesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListImagePipelines +func (c *Imagebuilder) ListImagePipelinesRequest(input *ListImagePipelinesInput) (req *request.Request, output *ListImagePipelinesOutput) { + op := &request.Operation{ + Name: opListImagePipelines, + HTTPMethod: "POST", + HTTPPath: "/ListImagePipelines", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListImagePipelinesInput{} + } + + output = &ListImagePipelinesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListImagePipelines API operation for EC2 Image Builder. +// +// Returns a list of image pipelines. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for EC2 Image Builder's +// API operation ListImagePipelines for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * InvalidPaginationTokenException +// You have provided an invalid pagination token in your request. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListImagePipelines +func (c *Imagebuilder) ListImagePipelines(input *ListImagePipelinesInput) (*ListImagePipelinesOutput, error) { + req, out := c.ListImagePipelinesRequest(input) + return out, req.Send() +} + +// ListImagePipelinesWithContext is the same as ListImagePipelines with the addition of +// the ability to pass a context and additional request options. +// +// See ListImagePipelines for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) ListImagePipelinesWithContext(ctx aws.Context, input *ListImagePipelinesInput, opts ...request.Option) (*ListImagePipelinesOutput, error) { + req, out := c.ListImagePipelinesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListImagePipelinesPages iterates over the pages of a ListImagePipelines operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListImagePipelines 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 ListImagePipelines operation. +// pageNum := 0 +// err := client.ListImagePipelinesPages(params, +// func(page *imagebuilder.ListImagePipelinesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Imagebuilder) ListImagePipelinesPages(input *ListImagePipelinesInput, fn func(*ListImagePipelinesOutput, bool) bool) error { + return c.ListImagePipelinesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListImagePipelinesPagesWithContext same as ListImagePipelinesPages 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 *Imagebuilder) ListImagePipelinesPagesWithContext(ctx aws.Context, input *ListImagePipelinesInput, fn func(*ListImagePipelinesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListImagePipelinesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListImagePipelinesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListImagePipelinesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListImageRecipes = "ListImageRecipes" + +// ListImageRecipesRequest generates a "aws/request.Request" representing the +// client's request for the ListImageRecipes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListImageRecipes for more information on using the ListImageRecipes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListImageRecipesRequest method. +// req, resp := client.ListImageRecipesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListImageRecipes +func (c *Imagebuilder) ListImageRecipesRequest(input *ListImageRecipesInput) (req *request.Request, output *ListImageRecipesOutput) { + op := &request.Operation{ + Name: opListImageRecipes, + HTTPMethod: "POST", + HTTPPath: "/ListImageRecipes", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListImageRecipesInput{} + } + + output = &ListImageRecipesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListImageRecipes API operation for EC2 Image Builder. +// +// Returns a list of image recipes. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for EC2 Image Builder's +// API operation ListImageRecipes for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * InvalidPaginationTokenException +// You have provided an invalid pagination token in your request. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListImageRecipes +func (c *Imagebuilder) ListImageRecipes(input *ListImageRecipesInput) (*ListImageRecipesOutput, error) { + req, out := c.ListImageRecipesRequest(input) + return out, req.Send() +} + +// ListImageRecipesWithContext is the same as ListImageRecipes with the addition of +// the ability to pass a context and additional request options. +// +// See ListImageRecipes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) ListImageRecipesWithContext(ctx aws.Context, input *ListImageRecipesInput, opts ...request.Option) (*ListImageRecipesOutput, error) { + req, out := c.ListImageRecipesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListImageRecipesPages iterates over the pages of a ListImageRecipes operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListImageRecipes 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 ListImageRecipes operation. +// pageNum := 0 +// err := client.ListImageRecipesPages(params, +// func(page *imagebuilder.ListImageRecipesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Imagebuilder) ListImageRecipesPages(input *ListImageRecipesInput, fn func(*ListImageRecipesOutput, bool) bool) error { + return c.ListImageRecipesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListImageRecipesPagesWithContext same as ListImageRecipesPages 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 *Imagebuilder) ListImageRecipesPagesWithContext(ctx aws.Context, input *ListImageRecipesInput, fn func(*ListImageRecipesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListImageRecipesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListImageRecipesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListImageRecipesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListImages = "ListImages" + +// ListImagesRequest generates a "aws/request.Request" representing the +// client's request for the ListImages operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListImages for more information on using the ListImages +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListImagesRequest method. +// req, resp := client.ListImagesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListImages +func (c *Imagebuilder) ListImagesRequest(input *ListImagesInput) (req *request.Request, output *ListImagesOutput) { + op := &request.Operation{ + Name: opListImages, + HTTPMethod: "POST", + HTTPPath: "/ListImages", + 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 EC2 Image Builder. +// +// Returns the list of image build versions for the specified semantic 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 EC2 Image Builder's +// API operation ListImages for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * InvalidPaginationTokenException +// You have provided an invalid pagination token in your request. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListImages +func (c *Imagebuilder) ListImages(input *ListImagesInput) (*ListImagesOutput, error) { + req, out := c.ListImagesRequest(input) + return out, req.Send() +} + +// ListImagesWithContext is the same as ListImages with the addition of +// the ability to pass a context and additional request options. +// +// See ListImages for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) ListImagesWithContext(ctx aws.Context, input *ListImagesInput, opts ...request.Option) (*ListImagesOutput, error) { + req, out := c.ListImagesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// 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 *imagebuilder.ListImagesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Imagebuilder) ListImagesPages(input *ListImagesInput, fn func(*ListImagesOutput, bool) bool) error { + return c.ListImagesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListImagesPagesWithContext same as ListImagesPages 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 *Imagebuilder) ListImagesPagesWithContext(ctx aws.Context, input *ListImagesInput, fn func(*ListImagesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListImagesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListImagesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListImagesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListInfrastructureConfigurations = "ListInfrastructureConfigurations" + +// ListInfrastructureConfigurationsRequest generates a "aws/request.Request" representing the +// client's request for the ListInfrastructureConfigurations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListInfrastructureConfigurations for more information on using the ListInfrastructureConfigurations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListInfrastructureConfigurationsRequest method. +// req, resp := client.ListInfrastructureConfigurationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListInfrastructureConfigurations +func (c *Imagebuilder) ListInfrastructureConfigurationsRequest(input *ListInfrastructureConfigurationsInput) (req *request.Request, output *ListInfrastructureConfigurationsOutput) { + op := &request.Operation{ + Name: opListInfrastructureConfigurations, + HTTPMethod: "POST", + HTTPPath: "/ListInfrastructureConfigurations", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListInfrastructureConfigurationsInput{} + } + + output = &ListInfrastructureConfigurationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListInfrastructureConfigurations API operation for EC2 Image Builder. +// +// Returns a list of infrastructure 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 EC2 Image Builder's +// API operation ListInfrastructureConfigurations for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * InvalidPaginationTokenException +// You have provided an invalid pagination token in your request. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListInfrastructureConfigurations +func (c *Imagebuilder) ListInfrastructureConfigurations(input *ListInfrastructureConfigurationsInput) (*ListInfrastructureConfigurationsOutput, error) { + req, out := c.ListInfrastructureConfigurationsRequest(input) + return out, req.Send() +} + +// ListInfrastructureConfigurationsWithContext is the same as ListInfrastructureConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See ListInfrastructureConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) ListInfrastructureConfigurationsWithContext(ctx aws.Context, input *ListInfrastructureConfigurationsInput, opts ...request.Option) (*ListInfrastructureConfigurationsOutput, error) { + req, out := c.ListInfrastructureConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListInfrastructureConfigurationsPages iterates over the pages of a ListInfrastructureConfigurations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListInfrastructureConfigurations 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 ListInfrastructureConfigurations operation. +// pageNum := 0 +// err := client.ListInfrastructureConfigurationsPages(params, +// func(page *imagebuilder.ListInfrastructureConfigurationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Imagebuilder) ListInfrastructureConfigurationsPages(input *ListInfrastructureConfigurationsInput, fn func(*ListInfrastructureConfigurationsOutput, bool) bool) error { + return c.ListInfrastructureConfigurationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListInfrastructureConfigurationsPagesWithContext same as ListInfrastructureConfigurationsPages 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 *Imagebuilder) ListInfrastructureConfigurationsPagesWithContext(ctx aws.Context, input *ListInfrastructureConfigurationsInput, fn func(*ListInfrastructureConfigurationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListInfrastructureConfigurationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListInfrastructureConfigurationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListInfrastructureConfigurationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListTagsForResource +func (c *Imagebuilder) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { + op := &request.Operation{ + Name: opListTagsForResource, + HTTPMethod: "GET", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &ListTagsForResourceInput{} + } + + output = &ListTagsForResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTagsForResource API operation for EC2 Image Builder. +// +// Returns the list of tags for 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 EC2 Image Builder's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ResourceNotFoundException +// At least one of the resources referenced by your request does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/ListTagsForResource +func (c *Imagebuilder) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutComponentPolicy = "PutComponentPolicy" + +// PutComponentPolicyRequest generates a "aws/request.Request" representing the +// client's request for the PutComponentPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutComponentPolicy for more information on using the PutComponentPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutComponentPolicyRequest method. +// req, resp := client.PutComponentPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/PutComponentPolicy +func (c *Imagebuilder) PutComponentPolicyRequest(input *PutComponentPolicyInput) (req *request.Request, output *PutComponentPolicyOutput) { + op := &request.Operation{ + Name: opPutComponentPolicy, + HTTPMethod: "PUT", + HTTPPath: "/PutComponentPolicy", + } + + if input == nil { + input = &PutComponentPolicyInput{} + } + + output = &PutComponentPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutComponentPolicy API operation for EC2 Image Builder. +// +// Applies a policy to a component. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for EC2 Image Builder's +// API operation PutComponentPolicy for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * InvalidParameterValueException +// The value that you provided for the specified parameter is invalid. +// +// * ResourceNotFoundException +// At least one of the resources referenced by your request does not exist. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/PutComponentPolicy +func (c *Imagebuilder) PutComponentPolicy(input *PutComponentPolicyInput) (*PutComponentPolicyOutput, error) { + req, out := c.PutComponentPolicyRequest(input) + return out, req.Send() +} + +// PutComponentPolicyWithContext is the same as PutComponentPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutComponentPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) PutComponentPolicyWithContext(ctx aws.Context, input *PutComponentPolicyInput, opts ...request.Option) (*PutComponentPolicyOutput, error) { + req, out := c.PutComponentPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutImagePolicy = "PutImagePolicy" + +// PutImagePolicyRequest generates a "aws/request.Request" representing the +// client's request for the PutImagePolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutImagePolicy for more information on using the PutImagePolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutImagePolicyRequest method. +// req, resp := client.PutImagePolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/PutImagePolicy +func (c *Imagebuilder) PutImagePolicyRequest(input *PutImagePolicyInput) (req *request.Request, output *PutImagePolicyOutput) { + op := &request.Operation{ + Name: opPutImagePolicy, + HTTPMethod: "PUT", + HTTPPath: "/PutImagePolicy", + } + + if input == nil { + input = &PutImagePolicyInput{} + } + + output = &PutImagePolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutImagePolicy API operation for EC2 Image Builder. +// +// Applies a policy to an 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 EC2 Image Builder's +// API operation PutImagePolicy for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * InvalidParameterValueException +// The value that you provided for the specified parameter is invalid. +// +// * ResourceNotFoundException +// At least one of the resources referenced by your request does not exist. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/PutImagePolicy +func (c *Imagebuilder) PutImagePolicy(input *PutImagePolicyInput) (*PutImagePolicyOutput, error) { + req, out := c.PutImagePolicyRequest(input) + return out, req.Send() +} + +// PutImagePolicyWithContext is the same as PutImagePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutImagePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) PutImagePolicyWithContext(ctx aws.Context, input *PutImagePolicyInput, opts ...request.Option) (*PutImagePolicyOutput, error) { + req, out := c.PutImagePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutImageRecipePolicy = "PutImageRecipePolicy" + +// PutImageRecipePolicyRequest generates a "aws/request.Request" representing the +// client's request for the PutImageRecipePolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutImageRecipePolicy for more information on using the PutImageRecipePolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutImageRecipePolicyRequest method. +// req, resp := client.PutImageRecipePolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/PutImageRecipePolicy +func (c *Imagebuilder) PutImageRecipePolicyRequest(input *PutImageRecipePolicyInput) (req *request.Request, output *PutImageRecipePolicyOutput) { + op := &request.Operation{ + Name: opPutImageRecipePolicy, + HTTPMethod: "PUT", + HTTPPath: "/PutImageRecipePolicy", + } + + if input == nil { + input = &PutImageRecipePolicyInput{} + } + + output = &PutImageRecipePolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutImageRecipePolicy API operation for EC2 Image Builder. +// +// Applies a policy to an image recipe. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for EC2 Image Builder's +// API operation PutImageRecipePolicy for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * InvalidParameterValueException +// The value that you provided for the specified parameter is invalid. +// +// * ResourceNotFoundException +// At least one of the resources referenced by your request does not exist. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/PutImageRecipePolicy +func (c *Imagebuilder) PutImageRecipePolicy(input *PutImageRecipePolicyInput) (*PutImageRecipePolicyOutput, error) { + req, out := c.PutImageRecipePolicyRequest(input) + return out, req.Send() +} + +// PutImageRecipePolicyWithContext is the same as PutImageRecipePolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutImageRecipePolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) PutImageRecipePolicyWithContext(ctx aws.Context, input *PutImageRecipePolicyInput, opts ...request.Option) (*PutImageRecipePolicyOutput, error) { + req, out := c.PutImageRecipePolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartImagePipelineExecution = "StartImagePipelineExecution" + +// StartImagePipelineExecutionRequest generates a "aws/request.Request" representing the +// client's request for the StartImagePipelineExecution operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartImagePipelineExecution for more information on using the StartImagePipelineExecution +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartImagePipelineExecutionRequest method. +// req, resp := client.StartImagePipelineExecutionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/StartImagePipelineExecution +func (c *Imagebuilder) StartImagePipelineExecutionRequest(input *StartImagePipelineExecutionInput) (req *request.Request, output *StartImagePipelineExecutionOutput) { + op := &request.Operation{ + Name: opStartImagePipelineExecution, + HTTPMethod: "PUT", + HTTPPath: "/StartImagePipelineExecution", + } + + if input == nil { + input = &StartImagePipelineExecutionInput{} + } + + output = &StartImagePipelineExecutionOutput{} + req = c.newRequest(op, input, output) + return +} + +// StartImagePipelineExecution API operation for EC2 Image Builder. +// +// Manually triggers a pipeline to create an 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 EC2 Image Builder's +// API operation StartImagePipelineExecution for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * ResourceNotFoundException +// At least one of the resources referenced by your request does not exist. +// +// * IdempotentParameterMismatchException +// You have specified a client token for an operation using parameter values +// that differ from a previous request that used the same client token. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * ResourceInUseException +// The resource that you are trying to operate on is currently in use. Review +// the message details and retry later. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/StartImagePipelineExecution +func (c *Imagebuilder) StartImagePipelineExecution(input *StartImagePipelineExecutionInput) (*StartImagePipelineExecutionOutput, error) { + req, out := c.StartImagePipelineExecutionRequest(input) + return out, req.Send() +} + +// StartImagePipelineExecutionWithContext is the same as StartImagePipelineExecution with the addition of +// the ability to pass a context and additional request options. +// +// See StartImagePipelineExecution for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) StartImagePipelineExecutionWithContext(ctx aws.Context, input *StartImagePipelineExecutionInput, opts ...request.Option) (*StartImagePipelineExecutionOutput, error) { + req, out := c.StartImagePipelineExecutionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/TagResource +func (c *Imagebuilder) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { + op := &request.Operation{ + Name: opTagResource, + HTTPMethod: "POST", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &TagResourceInput{} + } + + output = &TagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for EC2 Image Builder. +// +// Adds a tag to 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 EC2 Image Builder's +// API operation TagResource for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ResourceNotFoundException +// At least one of the resources referenced by your request does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/TagResource +func (c *Imagebuilder) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/UntagResource +func (c *Imagebuilder) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { + op := &request.Operation{ + Name: opUntagResource, + HTTPMethod: "DELETE", + HTTPPath: "/tags/{resourceArn}", + } + + if input == nil { + input = &UntagResourceInput{} + } + + output = &UntagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for EC2 Image Builder. +// +// Removes a tag from 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 EC2 Image Builder's +// API operation UntagResource for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * InvalidParameterException +// The specified parameter is invalid. Review the available parameters for the +// API request. +// +// * ResourceNotFoundException +// At least one of the resources referenced by your request does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/UntagResource +func (c *Imagebuilder) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateDistributionConfiguration = "UpdateDistributionConfiguration" + +// UpdateDistributionConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDistributionConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateDistributionConfiguration for more information on using the UpdateDistributionConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateDistributionConfigurationRequest method. +// req, resp := client.UpdateDistributionConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/UpdateDistributionConfiguration +func (c *Imagebuilder) UpdateDistributionConfigurationRequest(input *UpdateDistributionConfigurationInput) (req *request.Request, output *UpdateDistributionConfigurationOutput) { + op := &request.Operation{ + Name: opUpdateDistributionConfiguration, + HTTPMethod: "PUT", + HTTPPath: "/UpdateDistributionConfiguration", + } + + if input == nil { + input = &UpdateDistributionConfigurationInput{} + } + + output = &UpdateDistributionConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateDistributionConfiguration API operation for EC2 Image Builder. +// +// Updates a new distribution configuration. Distribution configurations define +// and configure the outputs of your 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 EC2 Image Builder's +// API operation UpdateDistributionConfiguration for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * IdempotentParameterMismatchException +// You have specified a client token for an operation using parameter values +// that differ from a previous request that used the same client token. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * ResourceInUseException +// The resource that you are trying to operate on is currently in use. Review +// the message details and retry later. +// +// * InvalidParameterCombinationException +// You have specified two or more mutually exclusive parameters. Review the +// error message for details. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/UpdateDistributionConfiguration +func (c *Imagebuilder) UpdateDistributionConfiguration(input *UpdateDistributionConfigurationInput) (*UpdateDistributionConfigurationOutput, error) { + req, out := c.UpdateDistributionConfigurationRequest(input) + return out, req.Send() +} + +// UpdateDistributionConfigurationWithContext is the same as UpdateDistributionConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDistributionConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) UpdateDistributionConfigurationWithContext(ctx aws.Context, input *UpdateDistributionConfigurationInput, opts ...request.Option) (*UpdateDistributionConfigurationOutput, error) { + req, out := c.UpdateDistributionConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateImagePipeline = "UpdateImagePipeline" + +// UpdateImagePipelineRequest generates a "aws/request.Request" representing the +// client's request for the UpdateImagePipeline operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateImagePipeline for more information on using the UpdateImagePipeline +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateImagePipelineRequest method. +// req, resp := client.UpdateImagePipelineRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/UpdateImagePipeline +func (c *Imagebuilder) UpdateImagePipelineRequest(input *UpdateImagePipelineInput) (req *request.Request, output *UpdateImagePipelineOutput) { + op := &request.Operation{ + Name: opUpdateImagePipeline, + HTTPMethod: "PUT", + HTTPPath: "/UpdateImagePipeline", + } + + if input == nil { + input = &UpdateImagePipelineInput{} + } + + output = &UpdateImagePipelineOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateImagePipeline API operation for EC2 Image Builder. +// +// Updates a new image pipeline. Image pipelines enable you to automate the +// creation and distribution of 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 EC2 Image Builder's +// API operation UpdateImagePipeline for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * IdempotentParameterMismatchException +// You have specified a client token for an operation using parameter values +// that differ from a previous request that used the same client token. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * ResourceInUseException +// The resource that you are trying to operate on is currently in use. Review +// the message details and retry later. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/UpdateImagePipeline +func (c *Imagebuilder) UpdateImagePipeline(input *UpdateImagePipelineInput) (*UpdateImagePipelineOutput, error) { + req, out := c.UpdateImagePipelineRequest(input) + return out, req.Send() +} + +// UpdateImagePipelineWithContext is the same as UpdateImagePipeline with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateImagePipeline for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) UpdateImagePipelineWithContext(ctx aws.Context, input *UpdateImagePipelineInput, opts ...request.Option) (*UpdateImagePipelineOutput, error) { + req, out := c.UpdateImagePipelineRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateInfrastructureConfiguration = "UpdateInfrastructureConfiguration" + +// UpdateInfrastructureConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the UpdateInfrastructureConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateInfrastructureConfiguration for more information on using the UpdateInfrastructureConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateInfrastructureConfigurationRequest method. +// req, resp := client.UpdateInfrastructureConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/UpdateInfrastructureConfiguration +func (c *Imagebuilder) UpdateInfrastructureConfigurationRequest(input *UpdateInfrastructureConfigurationInput) (req *request.Request, output *UpdateInfrastructureConfigurationOutput) { + op := &request.Operation{ + Name: opUpdateInfrastructureConfiguration, + HTTPMethod: "PUT", + HTTPPath: "/UpdateInfrastructureConfiguration", + } + + if input == nil { + input = &UpdateInfrastructureConfigurationInput{} + } + + output = &UpdateInfrastructureConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateInfrastructureConfiguration API operation for EC2 Image Builder. +// +// Updates a new infrastructure configuration. An infrastructure configuration +// defines the environment in which your image will be built and tested. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for EC2 Image Builder's +// API operation UpdateInfrastructureConfiguration for usage and error information. +// +// Returned Error Types: +// * ServiceException +// This exception is thrown when the service encounters an unrecoverable exception. +// +// * 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +// +// * ServiceUnavailableException +// The service is unable to process your request at this time. +// +// * InvalidRequestException +// You have made a request for an action that is not supported by the service. +// +// * IdempotentParameterMismatchException +// You have specified a client token for an operation using parameter values +// that differ from a previous request that used the same client token. +// +// * ForbiddenException +// You are not authorized to perform the requested operation. +// +// * CallRateLimitExceededException +// You have exceeded the permitted request rate for the specific operation. +// +// * ResourceInUseException +// The resource that you are trying to operate on is currently in use. Review +// the message details and retry later. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02/UpdateInfrastructureConfiguration +func (c *Imagebuilder) UpdateInfrastructureConfiguration(input *UpdateInfrastructureConfigurationInput) (*UpdateInfrastructureConfigurationOutput, error) { + req, out := c.UpdateInfrastructureConfigurationRequest(input) + return out, req.Send() +} + +// UpdateInfrastructureConfigurationWithContext is the same as UpdateInfrastructureConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateInfrastructureConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Imagebuilder) UpdateInfrastructureConfigurationWithContext(ctx aws.Context, input *UpdateInfrastructureConfigurationInput, opts ...request.Option) (*UpdateInfrastructureConfigurationOutput, error) { + req, out := c.UpdateInfrastructureConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Details of an EC2 AMI. +type Ami struct { + _ struct{} `type:"structure"` + + // The description of the EC2 AMI. + Description *string `locationName:"description" min:"1" type:"string"` + + // The AMI ID of the EC2 AMI. + Image *string `locationName:"image" min:"1" type:"string"` + + // The name of the EC2 AMI. + Name *string `locationName:"name" min:"1" type:"string"` + + // The AWS Region of the EC2 AMI. + Region *string `locationName:"region" min:"1" type:"string"` + + // Image state shows the image status and the reason for that status. + State *ImageState `locationName:"state" type:"structure"` +} + +// String returns the string representation +func (s Ami) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Ami) GoString() string { + return s.String() +} + +// SetDescription sets the Description field's value. +func (s *Ami) SetDescription(v string) *Ami { + s.Description = &v + return s +} + +// SetImage sets the Image field's value. +func (s *Ami) SetImage(v string) *Ami { + s.Image = &v + return s +} + +// SetName sets the Name field's value. +func (s *Ami) SetName(v string) *Ami { + s.Name = &v + return s +} + +// SetRegion sets the Region field's value. +func (s *Ami) SetRegion(v string) *Ami { + s.Region = &v + return s +} + +// SetState sets the State field's value. +func (s *Ami) SetState(v *ImageState) *Ami { + s.State = v + return s +} + +// Define and configure the output AMIs of the pipeline. +type AmiDistributionConfiguration struct { + _ struct{} `type:"structure"` + + // The tags to apply to AMIs distributed to this Region. + AmiTags map[string]*string `locationName:"amiTags" min:"1" type:"map"` + + // The description of the distribution configuration. + Description *string `locationName:"description" min:"1" type:"string"` + + // Launch permissions can be used to configure which AWS accounts can use the + // AMI to launch instances. + LaunchPermission *LaunchPermissionConfiguration `locationName:"launchPermission" type:"structure"` + + // The name of the distribution configuration. + Name *string `locationName:"name" min:"1" type:"string"` +} + +// String returns the string representation +func (s AmiDistributionConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AmiDistributionConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AmiDistributionConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AmiDistributionConfiguration"} + if s.AmiTags != nil && len(s.AmiTags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AmiTags", 1)) + } + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 1)) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmiTags sets the AmiTags field's value. +func (s *AmiDistributionConfiguration) SetAmiTags(v map[string]*string) *AmiDistributionConfiguration { + s.AmiTags = v + return s +} + +// SetDescription sets the Description field's value. +func (s *AmiDistributionConfiguration) SetDescription(v string) *AmiDistributionConfiguration { + s.Description = &v + return s +} + +// SetLaunchPermission sets the LaunchPermission field's value. +func (s *AmiDistributionConfiguration) SetLaunchPermission(v *LaunchPermissionConfiguration) *AmiDistributionConfiguration { + s.LaunchPermission = v + return s +} + +// SetName sets the Name field's value. +func (s *AmiDistributionConfiguration) SetName(v string) *AmiDistributionConfiguration { + s.Name = &v + return s +} + +// You have exceeded the permitted request rate for the specific operation. +type CallRateLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CallRateLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CallRateLimitExceededException) GoString() string { + return s.String() +} + +func newErrorCallRateLimitExceededException(v protocol.ResponseMetadata) error { + return &CallRateLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CallRateLimitExceededException) Code() string { + return "CallRateLimitExceededException" +} + +// Message returns the exception's message. +func (s CallRateLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CallRateLimitExceededException) OrigErr() error { + return nil +} + +func (s CallRateLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CallRateLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CallRateLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +type CancelImageCreationInput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` + + // The Amazon Resource Name (ARN) of the image whose creation you want to cancel. + // + // ImageBuildVersionArn is a required field + ImageBuildVersionArn *string `locationName:"imageBuildVersionArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s CancelImageCreationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelImageCreationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CancelImageCreationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CancelImageCreationInput"} + if s.ClientToken != nil && len(*s.ClientToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) + } + if s.ImageBuildVersionArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImageBuildVersionArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *CancelImageCreationInput) SetClientToken(v string) *CancelImageCreationInput { + s.ClientToken = &v + return s +} + +// SetImageBuildVersionArn sets the ImageBuildVersionArn field's value. +func (s *CancelImageCreationInput) SetImageBuildVersionArn(v string) *CancelImageCreationInput { + s.ImageBuildVersionArn = &v + return s +} + +type CancelImageCreationOutput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the image whose creation has been cancelled. + ImageBuildVersionArn *string `locationName:"imageBuildVersionArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s CancelImageCreationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelImageCreationOutput) GoString() string { + return s.String() +} + +// SetClientToken sets the ClientToken field's value. +func (s *CancelImageCreationOutput) SetClientToken(v string) *CancelImageCreationOutput { + s.ClientToken = &v + return s +} + +// SetImageBuildVersionArn sets the ImageBuildVersionArn field's value. +func (s *CancelImageCreationOutput) SetImageBuildVersionArn(v string) *CancelImageCreationOutput { + s.ImageBuildVersionArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CancelImageCreationOutput) SetRequestId(v string) *CancelImageCreationOutput { + s.RequestId = &v + return s +} + +// 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 permissions to use the +// action or resource, or specifying an invalid resource identifier. +type ClientException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ClientException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClientException) GoString() string { + return s.String() +} + +func newErrorClientException(v protocol.ResponseMetadata) error { + return &ClientException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ClientException) Code() string { + return "ClientException" +} + +// Message returns the exception's message. +func (s ClientException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ClientException) OrigErr() error { + return nil +} + +func (s ClientException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ClientException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ClientException) RequestID() string { + return s.respMetadata.RequestID +} + +// A detailed view of a component. +type Component struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the component. + Arn *string `locationName:"arn" type:"string"` + + // The change description of the component. + ChangeDescription *string `locationName:"changeDescription" min:"1" type:"string"` + + // The data of the component. + Data *string `locationName:"data" type:"string"` + + // The date that the component was created. + DateCreated *string `locationName:"dateCreated" type:"string"` + + // The description of the component. + Description *string `locationName:"description" min:"1" type:"string"` + + // The encryption status of the component. + Encrypted *bool `locationName:"encrypted" type:"boolean"` + + // The KMS key identifier used to encrypt the component. + KmsKeyId *string `locationName:"kmsKeyId" min:"1" type:"string"` + + // The name of the component. + Name *string `locationName:"name" type:"string"` + + // The owner of the component. + Owner *string `locationName:"owner" min:"1" type:"string"` + + // The platform of the component. + Platform *string `locationName:"platform" type:"string" enum:"Platform"` + + // The tags associated with the component. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The type of the component denotes whether the component is used to build + // the image or only to test it. + Type *string `locationName:"type" type:"string" enum:"ComponentType"` + + // The version of the component. + Version *string `locationName:"version" type:"string"` +} + +// String returns the string representation +func (s Component) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Component) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *Component) SetArn(v string) *Component { + s.Arn = &v + return s +} + +// SetChangeDescription sets the ChangeDescription field's value. +func (s *Component) SetChangeDescription(v string) *Component { + s.ChangeDescription = &v + return s +} + +// SetData sets the Data field's value. +func (s *Component) SetData(v string) *Component { + s.Data = &v + return s +} + +// SetDateCreated sets the DateCreated field's value. +func (s *Component) SetDateCreated(v string) *Component { + s.DateCreated = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *Component) SetDescription(v string) *Component { + s.Description = &v + return s +} + +// SetEncrypted sets the Encrypted field's value. +func (s *Component) SetEncrypted(v bool) *Component { + s.Encrypted = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *Component) SetKmsKeyId(v string) *Component { + s.KmsKeyId = &v + return s +} + +// SetName sets the Name field's value. +func (s *Component) SetName(v string) *Component { + s.Name = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *Component) SetOwner(v string) *Component { + s.Owner = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *Component) SetPlatform(v string) *Component { + s.Platform = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *Component) SetTags(v map[string]*string) *Component { + s.Tags = v + return s +} + +// SetType sets the Type field's value. +func (s *Component) SetType(v string) *Component { + s.Type = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *Component) SetVersion(v string) *Component { + s.Version = &v + return s +} + +// Configuration details of the component. +type ComponentConfiguration struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the component. + // + // ComponentArn is a required field + ComponentArn *string `locationName:"componentArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s ComponentConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ComponentConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ComponentConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ComponentConfiguration"} + if s.ComponentArn == nil { + invalidParams.Add(request.NewErrParamRequired("ComponentArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComponentArn sets the ComponentArn field's value. +func (s *ComponentConfiguration) SetComponentArn(v string) *ComponentConfiguration { + s.ComponentArn = &v + return s +} + +// A high-level summary of a component. +type ComponentSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the component. + Arn *string `locationName:"arn" type:"string"` + + // The change description of the component. + ChangeDescription *string `locationName:"changeDescription" min:"1" type:"string"` + + // The date that the component was created. + DateCreated *string `locationName:"dateCreated" type:"string"` + + // The description of the component. + Description *string `locationName:"description" min:"1" type:"string"` + + // The name of the component. + Name *string `locationName:"name" type:"string"` + + // The owner of the component. + Owner *string `locationName:"owner" min:"1" type:"string"` + + // The platform of the component. + Platform *string `locationName:"platform" type:"string" enum:"Platform"` + + // The tags associated with the component. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The type of the component denotes whether the component is used to build + // the image or only to test it. + Type *string `locationName:"type" type:"string" enum:"ComponentType"` + + // The version of the component. + Version *string `locationName:"version" type:"string"` +} + +// String returns the string representation +func (s ComponentSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ComponentSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *ComponentSummary) SetArn(v string) *ComponentSummary { + s.Arn = &v + return s +} + +// SetChangeDescription sets the ChangeDescription field's value. +func (s *ComponentSummary) SetChangeDescription(v string) *ComponentSummary { + s.ChangeDescription = &v + return s +} + +// SetDateCreated sets the DateCreated field's value. +func (s *ComponentSummary) SetDateCreated(v string) *ComponentSummary { + s.DateCreated = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *ComponentSummary) SetDescription(v string) *ComponentSummary { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *ComponentSummary) SetName(v string) *ComponentSummary { + s.Name = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *ComponentSummary) SetOwner(v string) *ComponentSummary { + s.Owner = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *ComponentSummary) SetPlatform(v string) *ComponentSummary { + s.Platform = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *ComponentSummary) SetTags(v map[string]*string) *ComponentSummary { + s.Tags = v + return s +} + +// SetType sets the Type field's value. +func (s *ComponentSummary) SetType(v string) *ComponentSummary { + s.Type = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *ComponentSummary) SetVersion(v string) *ComponentSummary { + s.Version = &v + return s +} + +// A high-level overview of a component semantic version. +type ComponentVersion struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the component. + Arn *string `locationName:"arn" type:"string"` + + // The date that the component was created. + DateCreated *string `locationName:"dateCreated" type:"string"` + + // The description of the component. + Description *string `locationName:"description" min:"1" type:"string"` + + // The name of the component. + Name *string `locationName:"name" type:"string"` + + // The owner of the component. + Owner *string `locationName:"owner" min:"1" type:"string"` + + // The platform of the component. + Platform *string `locationName:"platform" type:"string" enum:"Platform"` + + // The type of the component denotes whether the component is used to build + // the image or only to test it. + Type *string `locationName:"type" type:"string" enum:"ComponentType"` + + // The semantic version of the component. + Version *string `locationName:"version" type:"string"` +} + +// String returns the string representation +func (s ComponentVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ComponentVersion) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *ComponentVersion) SetArn(v string) *ComponentVersion { + s.Arn = &v + return s +} + +// SetDateCreated sets the DateCreated field's value. +func (s *ComponentVersion) SetDateCreated(v string) *ComponentVersion { + s.DateCreated = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *ComponentVersion) SetDescription(v string) *ComponentVersion { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *ComponentVersion) SetName(v string) *ComponentVersion { + s.Name = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *ComponentVersion) SetOwner(v string) *ComponentVersion { + s.Owner = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *ComponentVersion) SetPlatform(v string) *ComponentVersion { + s.Platform = &v + return s +} + +// SetType sets the Type field's value. +func (s *ComponentVersion) SetType(v string) *ComponentVersion { + s.Type = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *ComponentVersion) SetVersion(v string) *ComponentVersion { + s.Version = &v + return s +} + +type CreateComponentInput struct { + _ struct{} `type:"structure"` + + // The change description of the component. Describes what change has been made + // in this version, or what makes this version different from other versions + // of this component. + ChangeDescription *string `locationName:"changeDescription" min:"1" type:"string"` + + // The idempotency token of the component. + ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` + + // The data of the component. Used to specify the data inline. Either data or + // uri can be used to specify the data within the component. + Data *string `locationName:"data" min:"1" type:"string"` + + // The description of the component. Describes the contents of the component. + Description *string `locationName:"description" min:"1" type:"string"` + + // The ID of the KMS key that should be used to encrypt this component. + KmsKeyId *string `locationName:"kmsKeyId" min:"1" type:"string"` + + // The name of the component. + // + // Name is a required field + Name *string `locationName:"name" type:"string" required:"true"` + + // The platform of the component. + // + // Platform is a required field + Platform *string `locationName:"platform" type:"string" required:"true" enum:"Platform"` + + // The semantic version of the component. This version follows the semantic + // version syntax. For example, major.minor.patch. This could be versioned like + // software (2.0.1) or like a date (2019.12.01). + // + // SemanticVersion is a required field + SemanticVersion *string `locationName:"semanticVersion" type:"string" required:"true"` + + // The tags of the component. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The uri of the component. Must be an S3 URL and the requester must have permission + // to access the S3 bucket. If you use S3, you can specify component content + // up to your service quota. Either data or uri can be used to specify the data + // within the component. + Uri *string `locationName:"uri" type:"string"` +} + +// String returns the string representation +func (s CreateComponentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateComponentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateComponentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateComponentInput"} + if s.ChangeDescription != nil && len(*s.ChangeDescription) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChangeDescription", 1)) + } + if s.ClientToken != nil && len(*s.ClientToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) + } + if s.Data != nil && len(*s.Data) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Data", 1)) + } + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 1)) + } + if s.KmsKeyId != nil && len(*s.KmsKeyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("KmsKeyId", 1)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Platform == nil { + invalidParams.Add(request.NewErrParamRequired("Platform")) + } + if s.SemanticVersion == nil { + invalidParams.Add(request.NewErrParamRequired("SemanticVersion")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetChangeDescription sets the ChangeDescription field's value. +func (s *CreateComponentInput) SetChangeDescription(v string) *CreateComponentInput { + s.ChangeDescription = &v + return s +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateComponentInput) SetClientToken(v string) *CreateComponentInput { + s.ClientToken = &v + return s +} + +// SetData sets the Data field's value. +func (s *CreateComponentInput) SetData(v string) *CreateComponentInput { + s.Data = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateComponentInput) SetDescription(v string) *CreateComponentInput { + s.Description = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *CreateComponentInput) SetKmsKeyId(v string) *CreateComponentInput { + s.KmsKeyId = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateComponentInput) SetName(v string) *CreateComponentInput { + s.Name = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *CreateComponentInput) SetPlatform(v string) *CreateComponentInput { + s.Platform = &v + return s +} + +// SetSemanticVersion sets the SemanticVersion field's value. +func (s *CreateComponentInput) SetSemanticVersion(v string) *CreateComponentInput { + s.SemanticVersion = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateComponentInput) SetTags(v map[string]*string) *CreateComponentInput { + s.Tags = v + return s +} + +// SetUri sets the Uri field's value. +func (s *CreateComponentInput) SetUri(v string) *CreateComponentInput { + s.Uri = &v + return s +} + +type CreateComponentOutput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the component that was created by this + // request. + ComponentBuildVersionArn *string `locationName:"componentBuildVersionArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateComponentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateComponentOutput) GoString() string { + return s.String() +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateComponentOutput) SetClientToken(v string) *CreateComponentOutput { + s.ClientToken = &v + return s +} + +// SetComponentBuildVersionArn sets the ComponentBuildVersionArn field's value. +func (s *CreateComponentOutput) SetComponentBuildVersionArn(v string) *CreateComponentOutput { + s.ComponentBuildVersionArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateComponentOutput) SetRequestId(v string) *CreateComponentOutput { + s.RequestId = &v + return s +} + +type CreateDistributionConfigurationInput struct { + _ struct{} `type:"structure"` + + // The idempotency token of the distribution configuration. + ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` + + // The description of the distribution configuration. + Description *string `locationName:"description" min:"1" type:"string"` + + // The distributions of the distribution configuration. + // + // Distributions is a required field + Distributions []*Distribution `locationName:"distributions" type:"list" required:"true"` + + // The name of the distribution configuration. + // + // Name is a required field + Name *string `locationName:"name" type:"string" required:"true"` + + // The tags of the distribution configuration. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +} + +// String returns the string representation +func (s CreateDistributionConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDistributionConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateDistributionConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateDistributionConfigurationInput"} + 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.Distributions == nil { + invalidParams.Add(request.NewErrParamRequired("Distributions")) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + if s.Distributions != nil { + for i, v := range s.Distributions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Distributions", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateDistributionConfigurationInput) SetClientToken(v string) *CreateDistributionConfigurationInput { + s.ClientToken = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateDistributionConfigurationInput) SetDescription(v string) *CreateDistributionConfigurationInput { + s.Description = &v + return s +} + +// SetDistributions sets the Distributions field's value. +func (s *CreateDistributionConfigurationInput) SetDistributions(v []*Distribution) *CreateDistributionConfigurationInput { + s.Distributions = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateDistributionConfigurationInput) SetName(v string) *CreateDistributionConfigurationInput { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateDistributionConfigurationInput) SetTags(v map[string]*string) *CreateDistributionConfigurationInput { + s.Tags = v + return s +} + +type CreateDistributionConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the distribution configuration that was + // created by this request. + DistributionConfigurationArn *string `locationName:"distributionConfigurationArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateDistributionConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDistributionConfigurationOutput) GoString() string { + return s.String() +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateDistributionConfigurationOutput) SetClientToken(v string) *CreateDistributionConfigurationOutput { + s.ClientToken = &v + return s +} + +// SetDistributionConfigurationArn sets the DistributionConfigurationArn field's value. +func (s *CreateDistributionConfigurationOutput) SetDistributionConfigurationArn(v string) *CreateDistributionConfigurationOutput { + s.DistributionConfigurationArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateDistributionConfigurationOutput) SetRequestId(v string) *CreateDistributionConfigurationOutput { + s.RequestId = &v + return s +} + +type CreateImageInput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` + + // The Amazon Resource Name (ARN) of the distribution configuration that defines + // and configures the outputs of your pipeline. + DistributionConfigurationArn *string `locationName:"distributionConfigurationArn" type:"string"` + + // The Amazon Resource Name (ARN) of the image recipe that defines how images + // are configured, tested, and assessed. + // + // ImageRecipeArn is a required field + ImageRecipeArn *string `locationName:"imageRecipeArn" type:"string" required:"true"` + + // The image tests configuration of the image. + ImageTestsConfiguration *ImageTestsConfiguration `locationName:"imageTestsConfiguration" type:"structure"` + + // The Amazon Resource Name (ARN) of the infrastructure configuration that defines + // the environment in which your image will be built and tested. + // + // InfrastructureConfigurationArn is a required field + InfrastructureConfigurationArn *string `locationName:"infrastructureConfigurationArn" type:"string" required:"true"` + + // The tags of the image. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +} + +// 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.ClientToken != nil && len(*s.ClientToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) + } + if s.ImageRecipeArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImageRecipeArn")) + } + if s.InfrastructureConfigurationArn == nil { + invalidParams.Add(request.NewErrParamRequired("InfrastructureConfigurationArn")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + if s.ImageTestsConfiguration != nil { + if err := s.ImageTestsConfiguration.Validate(); err != nil { + invalidParams.AddNested("ImageTestsConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateImageInput) SetClientToken(v string) *CreateImageInput { + s.ClientToken = &v + return s +} + +// SetDistributionConfigurationArn sets the DistributionConfigurationArn field's value. +func (s *CreateImageInput) SetDistributionConfigurationArn(v string) *CreateImageInput { + s.DistributionConfigurationArn = &v + return s +} + +// SetImageRecipeArn sets the ImageRecipeArn field's value. +func (s *CreateImageInput) SetImageRecipeArn(v string) *CreateImageInput { + s.ImageRecipeArn = &v + return s +} + +// SetImageTestsConfiguration sets the ImageTestsConfiguration field's value. +func (s *CreateImageInput) SetImageTestsConfiguration(v *ImageTestsConfiguration) *CreateImageInput { + s.ImageTestsConfiguration = v + return s +} + +// SetInfrastructureConfigurationArn sets the InfrastructureConfigurationArn field's value. +func (s *CreateImageInput) SetInfrastructureConfigurationArn(v string) *CreateImageInput { + s.InfrastructureConfigurationArn = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateImageInput) SetTags(v map[string]*string) *CreateImageInput { + s.Tags = v + return s +} + +type CreateImageOutput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the image that was created by this request. + ImageBuildVersionArn *string `locationName:"imageBuildVersionArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" 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() +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateImageOutput) SetClientToken(v string) *CreateImageOutput { + s.ClientToken = &v + return s +} + +// SetImageBuildVersionArn sets the ImageBuildVersionArn field's value. +func (s *CreateImageOutput) SetImageBuildVersionArn(v string) *CreateImageOutput { + s.ImageBuildVersionArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateImageOutput) SetRequestId(v string) *CreateImageOutput { + s.RequestId = &v + return s +} + +type CreateImagePipelineInput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` + + // The description of the image pipeline. + Description *string `locationName:"description" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the distribution configuration that will + // be used to configure and distribute images created by this image pipeline. + DistributionConfigurationArn *string `locationName:"distributionConfigurationArn" type:"string"` + + // The Amazon Resource Name (ARN) of the image recipe that will be used to configure + // images created by this image pipeline. + // + // ImageRecipeArn is a required field + ImageRecipeArn *string `locationName:"imageRecipeArn" type:"string" required:"true"` + + // The image test configuration of the image pipeline. + ImageTestsConfiguration *ImageTestsConfiguration `locationName:"imageTestsConfiguration" type:"structure"` + + // The Amazon Resource Name (ARN) of the infrastructure configuration that will + // be used to build images created by this image pipeline. + // + // InfrastructureConfigurationArn is a required field + InfrastructureConfigurationArn *string `locationName:"infrastructureConfigurationArn" type:"string" required:"true"` + + // The name of the image pipeline. + // + // Name is a required field + Name *string `locationName:"name" type:"string" required:"true"` + + // The schedule of the image pipeline. + Schedule *Schedule `locationName:"schedule" type:"structure"` + + // The status of the image pipeline. + Status *string `locationName:"status" type:"string" enum:"PipelineStatus"` + + // The tags of the image pipeline. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +} + +// String returns the string representation +func (s CreateImagePipelineInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateImagePipelineInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateImagePipelineInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateImagePipelineInput"} + 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.ImageRecipeArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImageRecipeArn")) + } + if s.InfrastructureConfigurationArn == nil { + invalidParams.Add(request.NewErrParamRequired("InfrastructureConfigurationArn")) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + if s.ImageTestsConfiguration != nil { + if err := s.ImageTestsConfiguration.Validate(); err != nil { + invalidParams.AddNested("ImageTestsConfiguration", err.(request.ErrInvalidParams)) + } + } + if s.Schedule != nil { + if err := s.Schedule.Validate(); err != nil { + invalidParams.AddNested("Schedule", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateImagePipelineInput) SetClientToken(v string) *CreateImagePipelineInput { + s.ClientToken = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateImagePipelineInput) SetDescription(v string) *CreateImagePipelineInput { + s.Description = &v + return s +} + +// SetDistributionConfigurationArn sets the DistributionConfigurationArn field's value. +func (s *CreateImagePipelineInput) SetDistributionConfigurationArn(v string) *CreateImagePipelineInput { + s.DistributionConfigurationArn = &v + return s +} + +// SetImageRecipeArn sets the ImageRecipeArn field's value. +func (s *CreateImagePipelineInput) SetImageRecipeArn(v string) *CreateImagePipelineInput { + s.ImageRecipeArn = &v + return s +} + +// SetImageTestsConfiguration sets the ImageTestsConfiguration field's value. +func (s *CreateImagePipelineInput) SetImageTestsConfiguration(v *ImageTestsConfiguration) *CreateImagePipelineInput { + s.ImageTestsConfiguration = v + return s +} + +// SetInfrastructureConfigurationArn sets the InfrastructureConfigurationArn field's value. +func (s *CreateImagePipelineInput) SetInfrastructureConfigurationArn(v string) *CreateImagePipelineInput { + s.InfrastructureConfigurationArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateImagePipelineInput) SetName(v string) *CreateImagePipelineInput { + s.Name = &v + return s +} + +// SetSchedule sets the Schedule field's value. +func (s *CreateImagePipelineInput) SetSchedule(v *Schedule) *CreateImagePipelineInput { + s.Schedule = v + return s +} + +// SetStatus sets the Status field's value. +func (s *CreateImagePipelineInput) SetStatus(v string) *CreateImagePipelineInput { + s.Status = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateImagePipelineInput) SetTags(v map[string]*string) *CreateImagePipelineInput { + s.Tags = v + return s +} + +type CreateImagePipelineOutput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the image pipeline that was created by + // this request. + ImagePipelineArn *string `locationName:"imagePipelineArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateImagePipelineOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateImagePipelineOutput) GoString() string { + return s.String() +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateImagePipelineOutput) SetClientToken(v string) *CreateImagePipelineOutput { + s.ClientToken = &v + return s +} + +// SetImagePipelineArn sets the ImagePipelineArn field's value. +func (s *CreateImagePipelineOutput) SetImagePipelineArn(v string) *CreateImagePipelineOutput { + s.ImagePipelineArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateImagePipelineOutput) SetRequestId(v string) *CreateImagePipelineOutput { + s.RequestId = &v + return s +} + +type CreateImageRecipeInput struct { + _ struct{} `type:"structure"` + + // The block device mappings of the image recipe. + BlockDeviceMappings []*InstanceBlockDeviceMapping `locationName:"blockDeviceMappings" type:"list"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` + + // The components of the image recipe. + // + // Components is a required field + Components []*ComponentConfiguration `locationName:"components" min:"1" type:"list" required:"true"` + + // The description of the image recipe. + Description *string `locationName:"description" min:"1" type:"string"` + + // The name of the image recipe. + // + // Name is a required field + Name *string `locationName:"name" type:"string" required:"true"` + + // The parent image of the image recipe. + // + // ParentImage is a required field + ParentImage *string `locationName:"parentImage" min:"1" type:"string" required:"true"` + + // The semantic version of the image recipe. + // + // SemanticVersion is a required field + SemanticVersion *string `locationName:"semanticVersion" type:"string" required:"true"` + + // The tags of the image recipe. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +} + +// String returns the string representation +func (s CreateImageRecipeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateImageRecipeInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateImageRecipeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateImageRecipeInput"} + if s.ClientToken != nil && len(*s.ClientToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) + } + if s.Components == nil { + invalidParams.Add(request.NewErrParamRequired("Components")) + } + if s.Components != nil && len(s.Components) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Components", 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.ParentImage == nil { + invalidParams.Add(request.NewErrParamRequired("ParentImage")) + } + if s.ParentImage != nil && len(*s.ParentImage) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ParentImage", 1)) + } + if s.SemanticVersion == nil { + invalidParams.Add(request.NewErrParamRequired("SemanticVersion")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 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 s.Components != nil { + for i, v := range s.Components { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Components", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. +func (s *CreateImageRecipeInput) SetBlockDeviceMappings(v []*InstanceBlockDeviceMapping) *CreateImageRecipeInput { + s.BlockDeviceMappings = v + return s +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateImageRecipeInput) SetClientToken(v string) *CreateImageRecipeInput { + s.ClientToken = &v + return s +} + +// SetComponents sets the Components field's value. +func (s *CreateImageRecipeInput) SetComponents(v []*ComponentConfiguration) *CreateImageRecipeInput { + s.Components = v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateImageRecipeInput) SetDescription(v string) *CreateImageRecipeInput { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateImageRecipeInput) SetName(v string) *CreateImageRecipeInput { + s.Name = &v + return s +} + +// SetParentImage sets the ParentImage field's value. +func (s *CreateImageRecipeInput) SetParentImage(v string) *CreateImageRecipeInput { + s.ParentImage = &v + return s +} + +// SetSemanticVersion sets the SemanticVersion field's value. +func (s *CreateImageRecipeInput) SetSemanticVersion(v string) *CreateImageRecipeInput { + s.SemanticVersion = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateImageRecipeInput) SetTags(v map[string]*string) *CreateImageRecipeInput { + s.Tags = v + return s +} + +type CreateImageRecipeOutput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the image recipe that was created by this + // request. + ImageRecipeArn *string `locationName:"imageRecipeArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateImageRecipeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateImageRecipeOutput) GoString() string { + return s.String() +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateImageRecipeOutput) SetClientToken(v string) *CreateImageRecipeOutput { + s.ClientToken = &v + return s +} + +// SetImageRecipeArn sets the ImageRecipeArn field's value. +func (s *CreateImageRecipeOutput) SetImageRecipeArn(v string) *CreateImageRecipeOutput { + s.ImageRecipeArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateImageRecipeOutput) SetRequestId(v string) *CreateImageRecipeOutput { + s.RequestId = &v + return s +} + +type CreateInfrastructureConfigurationInput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` + + // The description of the infrastructure configuration. + Description *string `locationName:"description" min:"1" type:"string"` + + // The instance profile to associate with the instance used to customize your + // EC2 AMI. + // + // InstanceProfileName is a required field + InstanceProfileName *string `locationName:"instanceProfileName" min:"1" type:"string" required:"true"` + + // The instance types of the infrastructure configuration. You can specify one + // or more instance types to use for this build. The service will pick one of + // these instance types based on availability. + InstanceTypes []*string `locationName:"instanceTypes" type:"list"` + + // The key pair of the infrastructure configuration. This can be used to log + // on to and debug the instance used to create your image. + KeyPair *string `locationName:"keyPair" min:"1" type:"string"` + + // The logging configuration of the infrastructure configuration. + Logging *Logging `locationName:"logging" type:"structure"` + + // The name of the infrastructure configuration. + // + // Name is a required field + Name *string `locationName:"name" type:"string" required:"true"` + + // The security group IDs to associate with the instance used to customize your + // EC2 AMI. + SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` + + // The SNS topic on which to send image build events. + SnsTopicArn *string `locationName:"snsTopicArn" type:"string"` + + // The subnet ID in which to place the instance used to customize your EC2 AMI. + SubnetId *string `locationName:"subnetId" min:"1" type:"string"` + + // The tags of the infrastructure configuration. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The terminate instance on failure setting of the infrastructure configuration. + // Set to false if you want Image Builder to retain the instance used to configure + // your AMI if the build or test phase of your workflow fails. + TerminateInstanceOnFailure *bool `locationName:"terminateInstanceOnFailure" type:"boolean"` +} + +// String returns the string representation +func (s CreateInfrastructureConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateInfrastructureConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateInfrastructureConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateInfrastructureConfigurationInput"} + 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.InstanceProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceProfileName")) + } + if s.InstanceProfileName != nil && len(*s.InstanceProfileName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InstanceProfileName", 1)) + } + if s.KeyPair != nil && len(*s.KeyPair) < 1 { + invalidParams.Add(request.NewErrParamMinLen("KeyPair", 1)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.SubnetId != nil && len(*s.SubnetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SubnetId", 1)) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + if s.Logging != nil { + if err := s.Logging.Validate(); err != nil { + invalidParams.AddNested("Logging", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateInfrastructureConfigurationInput) SetClientToken(v string) *CreateInfrastructureConfigurationInput { + s.ClientToken = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateInfrastructureConfigurationInput) SetDescription(v string) *CreateInfrastructureConfigurationInput { + s.Description = &v + return s +} + +// SetInstanceProfileName sets the InstanceProfileName field's value. +func (s *CreateInfrastructureConfigurationInput) SetInstanceProfileName(v string) *CreateInfrastructureConfigurationInput { + s.InstanceProfileName = &v + return s +} + +// SetInstanceTypes sets the InstanceTypes field's value. +func (s *CreateInfrastructureConfigurationInput) SetInstanceTypes(v []*string) *CreateInfrastructureConfigurationInput { + s.InstanceTypes = v + return s +} + +// SetKeyPair sets the KeyPair field's value. +func (s *CreateInfrastructureConfigurationInput) SetKeyPair(v string) *CreateInfrastructureConfigurationInput { + s.KeyPair = &v + return s +} + +// SetLogging sets the Logging field's value. +func (s *CreateInfrastructureConfigurationInput) SetLogging(v *Logging) *CreateInfrastructureConfigurationInput { + s.Logging = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateInfrastructureConfigurationInput) SetName(v string) *CreateInfrastructureConfigurationInput { + s.Name = &v + return s +} + +// SetSecurityGroupIds sets the SecurityGroupIds field's value. +func (s *CreateInfrastructureConfigurationInput) SetSecurityGroupIds(v []*string) *CreateInfrastructureConfigurationInput { + s.SecurityGroupIds = v + return s +} + +// SetSnsTopicArn sets the SnsTopicArn field's value. +func (s *CreateInfrastructureConfigurationInput) SetSnsTopicArn(v string) *CreateInfrastructureConfigurationInput { + s.SnsTopicArn = &v + return s +} + +// SetSubnetId sets the SubnetId field's value. +func (s *CreateInfrastructureConfigurationInput) SetSubnetId(v string) *CreateInfrastructureConfigurationInput { + s.SubnetId = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateInfrastructureConfigurationInput) SetTags(v map[string]*string) *CreateInfrastructureConfigurationInput { + s.Tags = v + return s +} + +// SetTerminateInstanceOnFailure sets the TerminateInstanceOnFailure field's value. +func (s *CreateInfrastructureConfigurationInput) SetTerminateInstanceOnFailure(v bool) *CreateInfrastructureConfigurationInput { + s.TerminateInstanceOnFailure = &v + return s +} + +type CreateInfrastructureConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the infrastructure configuration that was + // created by this request. + InfrastructureConfigurationArn *string `locationName:"infrastructureConfigurationArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateInfrastructureConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateInfrastructureConfigurationOutput) GoString() string { + return s.String() +} + +// SetClientToken sets the ClientToken field's value. +func (s *CreateInfrastructureConfigurationOutput) SetClientToken(v string) *CreateInfrastructureConfigurationOutput { + s.ClientToken = &v + return s +} + +// SetInfrastructureConfigurationArn sets the InfrastructureConfigurationArn field's value. +func (s *CreateInfrastructureConfigurationOutput) SetInfrastructureConfigurationArn(v string) *CreateInfrastructureConfigurationOutput { + s.InfrastructureConfigurationArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateInfrastructureConfigurationOutput) SetRequestId(v string) *CreateInfrastructureConfigurationOutput { + s.RequestId = &v + return s +} + +type DeleteComponentInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the component build version to delete. + // + // ComponentBuildVersionArn is a required field + ComponentBuildVersionArn *string `location:"querystring" locationName:"componentBuildVersionArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteComponentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteComponentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteComponentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteComponentInput"} + if s.ComponentBuildVersionArn == nil { + invalidParams.Add(request.NewErrParamRequired("ComponentBuildVersionArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComponentBuildVersionArn sets the ComponentBuildVersionArn field's value. +func (s *DeleteComponentInput) SetComponentBuildVersionArn(v string) *DeleteComponentInput { + s.ComponentBuildVersionArn = &v + return s +} + +type DeleteComponentOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the component build version that was deleted. + ComponentBuildVersionArn *string `locationName:"componentBuildVersionArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s DeleteComponentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteComponentOutput) GoString() string { + return s.String() +} + +// SetComponentBuildVersionArn sets the ComponentBuildVersionArn field's value. +func (s *DeleteComponentOutput) SetComponentBuildVersionArn(v string) *DeleteComponentOutput { + s.ComponentBuildVersionArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteComponentOutput) SetRequestId(v string) *DeleteComponentOutput { + s.RequestId = &v + return s +} + +type DeleteDistributionConfigurationInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the distribution configuration to delete. + // + // DistributionConfigurationArn is a required field + DistributionConfigurationArn *string `location:"querystring" locationName:"distributionConfigurationArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteDistributionConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDistributionConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteDistributionConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteDistributionConfigurationInput"} + if s.DistributionConfigurationArn == nil { + invalidParams.Add(request.NewErrParamRequired("DistributionConfigurationArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDistributionConfigurationArn sets the DistributionConfigurationArn field's value. +func (s *DeleteDistributionConfigurationInput) SetDistributionConfigurationArn(v string) *DeleteDistributionConfigurationInput { + s.DistributionConfigurationArn = &v + return s +} + +type DeleteDistributionConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the distribution configuration that was + // deleted. + DistributionConfigurationArn *string `locationName:"distributionConfigurationArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s DeleteDistributionConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDistributionConfigurationOutput) GoString() string { + return s.String() +} + +// SetDistributionConfigurationArn sets the DistributionConfigurationArn field's value. +func (s *DeleteDistributionConfigurationOutput) SetDistributionConfigurationArn(v string) *DeleteDistributionConfigurationOutput { + s.DistributionConfigurationArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteDistributionConfigurationOutput) SetRequestId(v string) *DeleteDistributionConfigurationOutput { + s.RequestId = &v + return s +} + +type DeleteImageInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image to delete. + // + // ImageBuildVersionArn is a required field + ImageBuildVersionArn *string `location:"querystring" locationName:"imageBuildVersionArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteImageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteImageInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteImageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteImageInput"} + if s.ImageBuildVersionArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImageBuildVersionArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetImageBuildVersionArn sets the ImageBuildVersionArn field's value. +func (s *DeleteImageInput) SetImageBuildVersionArn(v string) *DeleteImageInput { + s.ImageBuildVersionArn = &v + return s +} + +type DeleteImageOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image that was deleted. + ImageBuildVersionArn *string `locationName:"imageBuildVersionArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s DeleteImageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteImageOutput) GoString() string { + return s.String() +} + +// SetImageBuildVersionArn sets the ImageBuildVersionArn field's value. +func (s *DeleteImageOutput) SetImageBuildVersionArn(v string) *DeleteImageOutput { + s.ImageBuildVersionArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteImageOutput) SetRequestId(v string) *DeleteImageOutput { + s.RequestId = &v + return s +} + +type DeleteImagePipelineInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image pipeline to delete. + // + // ImagePipelineArn is a required field + ImagePipelineArn *string `location:"querystring" locationName:"imagePipelineArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteImagePipelineInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteImagePipelineInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteImagePipelineInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteImagePipelineInput"} + if s.ImagePipelineArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImagePipelineArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetImagePipelineArn sets the ImagePipelineArn field's value. +func (s *DeleteImagePipelineInput) SetImagePipelineArn(v string) *DeleteImagePipelineInput { + s.ImagePipelineArn = &v + return s +} + +type DeleteImagePipelineOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image pipeline that was deleted. + ImagePipelineArn *string `locationName:"imagePipelineArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s DeleteImagePipelineOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteImagePipelineOutput) GoString() string { + return s.String() +} + +// SetImagePipelineArn sets the ImagePipelineArn field's value. +func (s *DeleteImagePipelineOutput) SetImagePipelineArn(v string) *DeleteImagePipelineOutput { + s.ImagePipelineArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteImagePipelineOutput) SetRequestId(v string) *DeleteImagePipelineOutput { + s.RequestId = &v + return s +} + +type DeleteImageRecipeInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image recipe to delete. + // + // ImageRecipeArn is a required field + ImageRecipeArn *string `location:"querystring" locationName:"imageRecipeArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteImageRecipeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteImageRecipeInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteImageRecipeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteImageRecipeInput"} + if s.ImageRecipeArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImageRecipeArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetImageRecipeArn sets the ImageRecipeArn field's value. +func (s *DeleteImageRecipeInput) SetImageRecipeArn(v string) *DeleteImageRecipeInput { + s.ImageRecipeArn = &v + return s +} + +type DeleteImageRecipeOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image recipe that was deleted. + ImageRecipeArn *string `locationName:"imageRecipeArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s DeleteImageRecipeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteImageRecipeOutput) GoString() string { + return s.String() +} + +// SetImageRecipeArn sets the ImageRecipeArn field's value. +func (s *DeleteImageRecipeOutput) SetImageRecipeArn(v string) *DeleteImageRecipeOutput { + s.ImageRecipeArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteImageRecipeOutput) SetRequestId(v string) *DeleteImageRecipeOutput { + s.RequestId = &v + return s +} + +type DeleteInfrastructureConfigurationInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the infrastructure configuration to delete. + // + // InfrastructureConfigurationArn is a required field + InfrastructureConfigurationArn *string `location:"querystring" locationName:"infrastructureConfigurationArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteInfrastructureConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteInfrastructureConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteInfrastructureConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteInfrastructureConfigurationInput"} + if s.InfrastructureConfigurationArn == nil { + invalidParams.Add(request.NewErrParamRequired("InfrastructureConfigurationArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInfrastructureConfigurationArn sets the InfrastructureConfigurationArn field's value. +func (s *DeleteInfrastructureConfigurationInput) SetInfrastructureConfigurationArn(v string) *DeleteInfrastructureConfigurationInput { + s.InfrastructureConfigurationArn = &v + return s +} + +type DeleteInfrastructureConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the infrastructure configuration that was + // deleted. + InfrastructureConfigurationArn *string `locationName:"infrastructureConfigurationArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s DeleteInfrastructureConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteInfrastructureConfigurationOutput) GoString() string { + return s.String() +} + +// SetInfrastructureConfigurationArn sets the InfrastructureConfigurationArn field's value. +func (s *DeleteInfrastructureConfigurationOutput) SetInfrastructureConfigurationArn(v string) *DeleteInfrastructureConfigurationOutput { + s.InfrastructureConfigurationArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteInfrastructureConfigurationOutput) SetRequestId(v string) *DeleteInfrastructureConfigurationOutput { + s.RequestId = &v + return s +} + +// Defines the settings for a specific Region. +type Distribution struct { + _ struct{} `type:"structure"` + + // The specific AMI settings (for example, launch permissions, AMI tags). + AmiDistributionConfiguration *AmiDistributionConfiguration `locationName:"amiDistributionConfiguration" type:"structure"` + + // The License Manager Configuration to associate with the AMI in the specified + // Region. + LicenseConfigurationArns []*string `locationName:"licenseConfigurationArns" type:"list"` + + // The target Region. + // + // Region is a required field + Region *string `locationName:"region" min:"1" 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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Distribution) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Distribution"} + if s.Region == nil { + invalidParams.Add(request.NewErrParamRequired("Region")) + } + if s.Region != nil && len(*s.Region) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Region", 1)) + } + if s.AmiDistributionConfiguration != nil { + if err := s.AmiDistributionConfiguration.Validate(); err != nil { + invalidParams.AddNested("AmiDistributionConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmiDistributionConfiguration sets the AmiDistributionConfiguration field's value. +func (s *Distribution) SetAmiDistributionConfiguration(v *AmiDistributionConfiguration) *Distribution { + s.AmiDistributionConfiguration = v + return s +} + +// SetLicenseConfigurationArns sets the LicenseConfigurationArns field's value. +func (s *Distribution) SetLicenseConfigurationArns(v []*string) *Distribution { + s.LicenseConfigurationArns = v + return s +} + +// SetRegion sets the Region field's value. +func (s *Distribution) SetRegion(v string) *Distribution { + s.Region = &v + return s +} + +// A distribution configuration. +type DistributionConfiguration struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the distribution configuration. + Arn *string `locationName:"arn" type:"string"` + + // The date on which this distribution configuration was created. + DateCreated *string `locationName:"dateCreated" type:"string"` + + // The date on which this distribution configuration was last updated. + DateUpdated *string `locationName:"dateUpdated" type:"string"` + + // The description of the distribution configuration. + Description *string `locationName:"description" min:"1" type:"string"` + + // The distributions of the distribution configuration. + Distributions []*Distribution `locationName:"distributions" type:"list"` + + // The name of the distribution configuration. + Name *string `locationName:"name" type:"string"` + + // The tags of the distribution configuration. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The maximum duration in minutes for this distribution configuration. + // + // TimeoutMinutes is a required field + TimeoutMinutes *int64 `locationName:"timeoutMinutes" min:"30" type:"integer" required:"true"` +} + +// String returns the string representation +func (s DistributionConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DistributionConfiguration) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DistributionConfiguration) SetArn(v string) *DistributionConfiguration { + s.Arn = &v + return s +} + +// SetDateCreated sets the DateCreated field's value. +func (s *DistributionConfiguration) SetDateCreated(v string) *DistributionConfiguration { + s.DateCreated = &v + return s +} + +// SetDateUpdated sets the DateUpdated field's value. +func (s *DistributionConfiguration) SetDateUpdated(v string) *DistributionConfiguration { + s.DateUpdated = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *DistributionConfiguration) SetDescription(v string) *DistributionConfiguration { + s.Description = &v + return s +} + +// SetDistributions sets the Distributions field's value. +func (s *DistributionConfiguration) SetDistributions(v []*Distribution) *DistributionConfiguration { + s.Distributions = v + return s +} + +// SetName sets the Name field's value. +func (s *DistributionConfiguration) SetName(v string) *DistributionConfiguration { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *DistributionConfiguration) SetTags(v map[string]*string) *DistributionConfiguration { + s.Tags = v + return s +} + +// SetTimeoutMinutes sets the TimeoutMinutes field's value. +func (s *DistributionConfiguration) SetTimeoutMinutes(v int64) *DistributionConfiguration { + s.TimeoutMinutes = &v + return s +} + +// A high-level overview of a distribution configuration. +type DistributionConfigurationSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the distribution configuration. + Arn *string `locationName:"arn" type:"string"` + + // The date on which the distribution configuration was created. + DateCreated *string `locationName:"dateCreated" type:"string"` + + // The date on which the distribution configuration was updated. + DateUpdated *string `locationName:"dateUpdated" type:"string"` + + // The description of the distribution configuration. + Description *string `locationName:"description" min:"1" type:"string"` + + // The name of the distribution configuration. + Name *string `locationName:"name" type:"string"` + + // The tags associated with the distribution configuration. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +} + +// String returns the string representation +func (s DistributionConfigurationSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DistributionConfigurationSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DistributionConfigurationSummary) SetArn(v string) *DistributionConfigurationSummary { + s.Arn = &v + return s +} + +// SetDateCreated sets the DateCreated field's value. +func (s *DistributionConfigurationSummary) SetDateCreated(v string) *DistributionConfigurationSummary { + s.DateCreated = &v + return s +} + +// SetDateUpdated sets the DateUpdated field's value. +func (s *DistributionConfigurationSummary) SetDateUpdated(v string) *DistributionConfigurationSummary { + s.DateUpdated = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *DistributionConfigurationSummary) SetDescription(v string) *DistributionConfigurationSummary { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *DistributionConfigurationSummary) SetName(v string) *DistributionConfigurationSummary { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *DistributionConfigurationSummary) SetTags(v map[string]*string) *DistributionConfigurationSummary { + s.Tags = v + return s +} + +// Amazon EBS-specific block device mapping specifications. +type EbsInstanceBlockDeviceSpecification struct { + _ struct{} `type:"structure"` + + // Use to configure delete on termination of the associated device. + DeleteOnTermination *bool `locationName:"deleteOnTermination" type:"boolean"` + + // Use to configure device encryption. + Encrypted *bool `locationName:"encrypted" type:"boolean"` + + // Use to configure device IOPS. + Iops *int64 `locationName:"iops" min:"100" type:"integer"` + + // Use to configure the KMS key to use when encrypting the device. + KmsKeyId *string `locationName:"kmsKeyId" min:"1" type:"string"` + + // The snapshot that defines the device contents. + SnapshotId *string `locationName:"snapshotId" min:"1" type:"string"` + + // Use to override the device's volume size. + VolumeSize *int64 `locationName:"volumeSize" min:"1" type:"integer"` + + // Use to override the device's volume type. + VolumeType *string `locationName:"volumeType" type:"string" enum:"EbsVolumeType"` +} + +// 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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EbsInstanceBlockDeviceSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EbsInstanceBlockDeviceSpecification"} + if s.Iops != nil && *s.Iops < 100 { + invalidParams.Add(request.NewErrParamMinValue("Iops", 100)) + } + if s.KmsKeyId != nil && len(*s.KmsKeyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("KmsKeyId", 1)) + } + 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 invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDeleteOnTermination sets the DeleteOnTermination field's value. +func (s *EbsInstanceBlockDeviceSpecification) SetDeleteOnTermination(v bool) *EbsInstanceBlockDeviceSpecification { + s.DeleteOnTermination = &v + return s +} + +// SetEncrypted sets the Encrypted field's value. +func (s *EbsInstanceBlockDeviceSpecification) SetEncrypted(v bool) *EbsInstanceBlockDeviceSpecification { + s.Encrypted = &v + return s +} + +// SetIops sets the Iops field's value. +func (s *EbsInstanceBlockDeviceSpecification) SetIops(v int64) *EbsInstanceBlockDeviceSpecification { + s.Iops = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *EbsInstanceBlockDeviceSpecification) SetKmsKeyId(v string) *EbsInstanceBlockDeviceSpecification { + s.KmsKeyId = &v + return s +} + +// SetSnapshotId sets the SnapshotId field's value. +func (s *EbsInstanceBlockDeviceSpecification) SetSnapshotId(v string) *EbsInstanceBlockDeviceSpecification { + s.SnapshotId = &v + return s +} + +// SetVolumeSize sets the VolumeSize field's value. +func (s *EbsInstanceBlockDeviceSpecification) SetVolumeSize(v int64) *EbsInstanceBlockDeviceSpecification { + s.VolumeSize = &v + return s +} + +// SetVolumeType sets the VolumeType field's value. +func (s *EbsInstanceBlockDeviceSpecification) SetVolumeType(v string) *EbsInstanceBlockDeviceSpecification { + s.VolumeType = &v + return s +} + +// A filter name and value pair that is used to return a more specific list +// of results from a list operation. Filters can be used to match a set of resources +// by specific criteria, such as tags, attributes, or IDs. +type Filter struct { + _ struct{} `type:"structure"` + + // The name of the filter. Filter names are case-sensitive. + Name *string `locationName:"name" type:"string"` + + // The filter values. Filter values are case-sensitive. + Values []*string `locationName:"values" min:"1" 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() +} + +// 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.Values != nil && len(s.Values) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Values", 1)) + } + + 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 +} + +// You are not authorized to perform the requested operation. +type ForbiddenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ForbiddenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ForbiddenException) GoString() string { + return s.String() +} + +func newErrorForbiddenException(v protocol.ResponseMetadata) error { + return &ForbiddenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ForbiddenException) Code() string { + return "ForbiddenException" +} + +// Message returns the exception's message. +func (s ForbiddenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ForbiddenException) OrigErr() error { + return nil +} + +func (s ForbiddenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ForbiddenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ForbiddenException) RequestID() string { + return s.respMetadata.RequestID +} + +type GetComponentInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the component that you want to retrieve. + // Regex requires "/\d+$" suffix. + // + // ComponentBuildVersionArn is a required field + ComponentBuildVersionArn *string `location:"querystring" locationName:"componentBuildVersionArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetComponentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetComponentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetComponentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetComponentInput"} + if s.ComponentBuildVersionArn == nil { + invalidParams.Add(request.NewErrParamRequired("ComponentBuildVersionArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComponentBuildVersionArn sets the ComponentBuildVersionArn field's value. +func (s *GetComponentInput) SetComponentBuildVersionArn(v string) *GetComponentInput { + s.ComponentBuildVersionArn = &v + return s +} + +type GetComponentOutput struct { + _ struct{} `type:"structure"` + + // The component object associated with the specified ARN. + Component *Component `locationName:"component" type:"structure"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s GetComponentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetComponentOutput) GoString() string { + return s.String() +} + +// SetComponent sets the Component field's value. +func (s *GetComponentOutput) SetComponent(v *Component) *GetComponentOutput { + s.Component = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *GetComponentOutput) SetRequestId(v string) *GetComponentOutput { + s.RequestId = &v + return s +} + +type GetComponentPolicyInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the component whose policy you want to + // retrieve. + // + // ComponentArn is a required field + ComponentArn *string `location:"querystring" locationName:"componentArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetComponentPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetComponentPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetComponentPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetComponentPolicyInput"} + if s.ComponentArn == nil { + invalidParams.Add(request.NewErrParamRequired("ComponentArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComponentArn sets the ComponentArn field's value. +func (s *GetComponentPolicyInput) SetComponentArn(v string) *GetComponentPolicyInput { + s.ComponentArn = &v + return s +} + +type GetComponentPolicyOutput struct { + _ struct{} `type:"structure"` + + // The component policy. + Policy *string `locationName:"policy" min:"1" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s GetComponentPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetComponentPolicyOutput) GoString() string { + return s.String() +} + +// SetPolicy sets the Policy field's value. +func (s *GetComponentPolicyOutput) SetPolicy(v string) *GetComponentPolicyOutput { + s.Policy = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *GetComponentPolicyOutput) SetRequestId(v string) *GetComponentPolicyOutput { + s.RequestId = &v + return s +} + +type GetDistributionConfigurationInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the distribution configuration that you + // want to retrieve. + // + // DistributionConfigurationArn is a required field + DistributionConfigurationArn *string `location:"querystring" locationName:"distributionConfigurationArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetDistributionConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDistributionConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetDistributionConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetDistributionConfigurationInput"} + if s.DistributionConfigurationArn == nil { + invalidParams.Add(request.NewErrParamRequired("DistributionConfigurationArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDistributionConfigurationArn sets the DistributionConfigurationArn field's value. +func (s *GetDistributionConfigurationInput) SetDistributionConfigurationArn(v string) *GetDistributionConfigurationInput { + s.DistributionConfigurationArn = &v + return s +} + +type GetDistributionConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The distribution configuration object. + DistributionConfiguration *DistributionConfiguration `locationName:"distributionConfiguration" type:"structure"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s GetDistributionConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDistributionConfigurationOutput) GoString() string { + return s.String() +} + +// SetDistributionConfiguration sets the DistributionConfiguration field's value. +func (s *GetDistributionConfigurationOutput) SetDistributionConfiguration(v *DistributionConfiguration) *GetDistributionConfigurationOutput { + s.DistributionConfiguration = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *GetDistributionConfigurationOutput) SetRequestId(v string) *GetDistributionConfigurationOutput { + s.RequestId = &v + return s +} + +type GetImageInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image that you want to retrieve. + // + // ImageBuildVersionArn is a required field + ImageBuildVersionArn *string `location:"querystring" locationName:"imageBuildVersionArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetImageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetImageInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetImageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetImageInput"} + if s.ImageBuildVersionArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImageBuildVersionArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetImageBuildVersionArn sets the ImageBuildVersionArn field's value. +func (s *GetImageInput) SetImageBuildVersionArn(v string) *GetImageInput { + s.ImageBuildVersionArn = &v + return s +} + +type GetImageOutput struct { + _ struct{} `type:"structure"` + + // The image object. + Image *Image `locationName:"image" type:"structure"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s GetImageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetImageOutput) GoString() string { + return s.String() +} + +// SetImage sets the Image field's value. +func (s *GetImageOutput) SetImage(v *Image) *GetImageOutput { + s.Image = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *GetImageOutput) SetRequestId(v string) *GetImageOutput { + s.RequestId = &v + return s +} + +type GetImagePipelineInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image pipeline that you want to retrieve. + // + // ImagePipelineArn is a required field + ImagePipelineArn *string `location:"querystring" locationName:"imagePipelineArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetImagePipelineInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetImagePipelineInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetImagePipelineInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetImagePipelineInput"} + if s.ImagePipelineArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImagePipelineArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetImagePipelineArn sets the ImagePipelineArn field's value. +func (s *GetImagePipelineInput) SetImagePipelineArn(v string) *GetImagePipelineInput { + s.ImagePipelineArn = &v + return s +} + +type GetImagePipelineOutput struct { + _ struct{} `type:"structure"` + + // The image pipeline object. + ImagePipeline *ImagePipeline `locationName:"imagePipeline" type:"structure"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s GetImagePipelineOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetImagePipelineOutput) GoString() string { + return s.String() +} + +// SetImagePipeline sets the ImagePipeline field's value. +func (s *GetImagePipelineOutput) SetImagePipeline(v *ImagePipeline) *GetImagePipelineOutput { + s.ImagePipeline = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *GetImagePipelineOutput) SetRequestId(v string) *GetImagePipelineOutput { + s.RequestId = &v + return s +} + +type GetImagePolicyInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image whose policy you want to retrieve. + // + // ImageArn is a required field + ImageArn *string `location:"querystring" locationName:"imageArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetImagePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetImagePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetImagePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetImagePolicyInput"} + if s.ImageArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImageArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetImageArn sets the ImageArn field's value. +func (s *GetImagePolicyInput) SetImageArn(v string) *GetImagePolicyInput { + s.ImageArn = &v + return s +} + +type GetImagePolicyOutput struct { + _ struct{} `type:"structure"` + + // The image policy object. + Policy *string `locationName:"policy" min:"1" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s GetImagePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetImagePolicyOutput) GoString() string { + return s.String() +} + +// SetPolicy sets the Policy field's value. +func (s *GetImagePolicyOutput) SetPolicy(v string) *GetImagePolicyOutput { + s.Policy = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *GetImagePolicyOutput) SetRequestId(v string) *GetImagePolicyOutput { + s.RequestId = &v + return s +} + +type GetImageRecipeInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image recipe that you want to retrieve. + // + // ImageRecipeArn is a required field + ImageRecipeArn *string `location:"querystring" locationName:"imageRecipeArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetImageRecipeInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetImageRecipeInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetImageRecipeInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetImageRecipeInput"} + if s.ImageRecipeArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImageRecipeArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetImageRecipeArn sets the ImageRecipeArn field's value. +func (s *GetImageRecipeInput) SetImageRecipeArn(v string) *GetImageRecipeInput { + s.ImageRecipeArn = &v + return s +} + +type GetImageRecipeOutput struct { + _ struct{} `type:"structure"` + + // The image recipe object. + ImageRecipe *ImageRecipe `locationName:"imageRecipe" type:"structure"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s GetImageRecipeOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetImageRecipeOutput) GoString() string { + return s.String() +} + +// SetImageRecipe sets the ImageRecipe field's value. +func (s *GetImageRecipeOutput) SetImageRecipe(v *ImageRecipe) *GetImageRecipeOutput { + s.ImageRecipe = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *GetImageRecipeOutput) SetRequestId(v string) *GetImageRecipeOutput { + s.RequestId = &v + return s +} + +type GetImageRecipePolicyInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image recipe whose policy you want + // to retrieve. + // + // ImageRecipeArn is a required field + ImageRecipeArn *string `location:"querystring" locationName:"imageRecipeArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetImageRecipePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetImageRecipePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetImageRecipePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetImageRecipePolicyInput"} + if s.ImageRecipeArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImageRecipeArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetImageRecipeArn sets the ImageRecipeArn field's value. +func (s *GetImageRecipePolicyInput) SetImageRecipeArn(v string) *GetImageRecipePolicyInput { + s.ImageRecipeArn = &v + return s +} + +type GetImageRecipePolicyOutput struct { + _ struct{} `type:"structure"` + + // The image recipe policy object. + Policy *string `locationName:"policy" min:"1" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s GetImageRecipePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetImageRecipePolicyOutput) GoString() string { + return s.String() +} + +// SetPolicy sets the Policy field's value. +func (s *GetImageRecipePolicyOutput) SetPolicy(v string) *GetImageRecipePolicyOutput { + s.Policy = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *GetImageRecipePolicyOutput) SetRequestId(v string) *GetImageRecipePolicyOutput { + s.RequestId = &v + return s +} + +// GetInfrastructureConfiguration request object. +type GetInfrastructureConfigurationInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the infrastructure configuration that you + // want to retrieve. + // + // InfrastructureConfigurationArn is a required field + InfrastructureConfigurationArn *string `location:"querystring" locationName:"infrastructureConfigurationArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetInfrastructureConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetInfrastructureConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetInfrastructureConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetInfrastructureConfigurationInput"} + if s.InfrastructureConfigurationArn == nil { + invalidParams.Add(request.NewErrParamRequired("InfrastructureConfigurationArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInfrastructureConfigurationArn sets the InfrastructureConfigurationArn field's value. +func (s *GetInfrastructureConfigurationInput) SetInfrastructureConfigurationArn(v string) *GetInfrastructureConfigurationInput { + s.InfrastructureConfigurationArn = &v + return s +} + +// GetInfrastructureConfiguration response object. +type GetInfrastructureConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The infrastructure configuration object. + InfrastructureConfiguration *InfrastructureConfiguration `locationName:"infrastructureConfiguration" type:"structure"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s GetInfrastructureConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetInfrastructureConfigurationOutput) GoString() string { + return s.String() +} + +// SetInfrastructureConfiguration sets the InfrastructureConfiguration field's value. +func (s *GetInfrastructureConfigurationOutput) SetInfrastructureConfiguration(v *InfrastructureConfiguration) *GetInfrastructureConfigurationOutput { + s.InfrastructureConfiguration = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *GetInfrastructureConfigurationOutput) SetRequestId(v string) *GetInfrastructureConfigurationOutput { + s.RequestId = &v + return s +} + +// You have specified a client token for an operation using parameter values +// that differ from a previous request that used the same client token. +type IdempotentParameterMismatchException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s IdempotentParameterMismatchException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IdempotentParameterMismatchException) GoString() string { + return s.String() +} + +func newErrorIdempotentParameterMismatchException(v protocol.ResponseMetadata) error { + return &IdempotentParameterMismatchException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IdempotentParameterMismatchException) Code() string { + return "IdempotentParameterMismatchException" +} + +// Message returns the exception's message. +func (s IdempotentParameterMismatchException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IdempotentParameterMismatchException) OrigErr() error { + return nil +} + +func (s IdempotentParameterMismatchException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IdempotentParameterMismatchException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IdempotentParameterMismatchException) RequestID() string { + return s.respMetadata.RequestID +} + +// An image build version. +type Image struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image. + Arn *string `locationName:"arn" type:"string"` + + // The date on which this image was created. + DateCreated *string `locationName:"dateCreated" type:"string"` + + // The distribution configuration used when creating this image. + DistributionConfiguration *DistributionConfiguration `locationName:"distributionConfiguration" type:"structure"` + + // The image recipe used when creating the image. + ImageRecipe *ImageRecipe `locationName:"imageRecipe" type:"structure"` + + // The image tests configuration used when creating this image. + ImageTestsConfiguration *ImageTestsConfiguration `locationName:"imageTestsConfiguration" type:"structure"` + + // The infrastructure used when creating this image. + InfrastructureConfiguration *InfrastructureConfiguration `locationName:"infrastructureConfiguration" type:"structure"` + + // The name of the image. + Name *string `locationName:"name" type:"string"` + + // The output resources produced when creating this image. + OutputResources *OutputResources `locationName:"outputResources" type:"structure"` + + // The platform of the image. + Platform *string `locationName:"platform" type:"string" enum:"Platform"` + + // The Amazon Resource Name (ARN) of the image pipeline that created this image. + SourcePipelineArn *string `locationName:"sourcePipelineArn" type:"string"` + + // The name of the image pipeline that created this image. + SourcePipelineName *string `locationName:"sourcePipelineName" type:"string"` + + // The state of the image. + State *ImageState `locationName:"state" type:"structure"` + + // The tags of the image. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The semantic version of the image. + Version *string `locationName:"version" 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() +} + +// SetArn sets the Arn field's value. +func (s *Image) SetArn(v string) *Image { + s.Arn = &v + return s +} + +// SetDateCreated sets the DateCreated field's value. +func (s *Image) SetDateCreated(v string) *Image { + s.DateCreated = &v + return s +} + +// SetDistributionConfiguration sets the DistributionConfiguration field's value. +func (s *Image) SetDistributionConfiguration(v *DistributionConfiguration) *Image { + s.DistributionConfiguration = v + return s +} + +// SetImageRecipe sets the ImageRecipe field's value. +func (s *Image) SetImageRecipe(v *ImageRecipe) *Image { + s.ImageRecipe = v + return s +} + +// SetImageTestsConfiguration sets the ImageTestsConfiguration field's value. +func (s *Image) SetImageTestsConfiguration(v *ImageTestsConfiguration) *Image { + s.ImageTestsConfiguration = v + return s +} + +// SetInfrastructureConfiguration sets the InfrastructureConfiguration field's value. +func (s *Image) SetInfrastructureConfiguration(v *InfrastructureConfiguration) *Image { + s.InfrastructureConfiguration = v + return s +} + +// SetName sets the Name field's value. +func (s *Image) SetName(v string) *Image { + s.Name = &v + return s +} + +// SetOutputResources sets the OutputResources field's value. +func (s *Image) SetOutputResources(v *OutputResources) *Image { + s.OutputResources = v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *Image) SetPlatform(v string) *Image { + s.Platform = &v + return s +} + +// SetSourcePipelineArn sets the SourcePipelineArn field's value. +func (s *Image) SetSourcePipelineArn(v string) *Image { + s.SourcePipelineArn = &v + return s +} + +// SetSourcePipelineName sets the SourcePipelineName field's value. +func (s *Image) SetSourcePipelineName(v string) *Image { + s.SourcePipelineName = &v + return s +} + +// SetState sets the State field's value. +func (s *Image) SetState(v *ImageState) *Image { + s.State = v + return s +} + +// SetTags sets the Tags field's value. +func (s *Image) SetTags(v map[string]*string) *Image { + s.Tags = v + return s +} + +// SetVersion sets the Version field's value. +func (s *Image) SetVersion(v string) *Image { + s.Version = &v + return s +} + +// Details of an image pipeline. +type ImagePipeline struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image pipeline. + Arn *string `locationName:"arn" type:"string"` + + // The date on which this image pipeline was created. + DateCreated *string `locationName:"dateCreated" type:"string"` + + // The date on which this image pipeline was last run. + DateLastRun *string `locationName:"dateLastRun" type:"string"` + + // The date on which this image pipeline will next be run. + DateNextRun *string `locationName:"dateNextRun" type:"string"` + + // The date on which this image pipeline was last updated. + DateUpdated *string `locationName:"dateUpdated" type:"string"` + + // The description of the image pipeline. + Description *string `locationName:"description" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the distribution configuration associated + // with this image pipeline. + DistributionConfigurationArn *string `locationName:"distributionConfigurationArn" type:"string"` + + // The Amazon Resource Name (ARN) of the image recipe associated with this image + // pipeline. + ImageRecipeArn *string `locationName:"imageRecipeArn" type:"string"` + + // The image tests configuration of the image pipeline. + ImageTestsConfiguration *ImageTestsConfiguration `locationName:"imageTestsConfiguration" type:"structure"` + + // The Amazon Resource Name (ARN) of the infrastructure configuration associated + // with this image pipeline. + InfrastructureConfigurationArn *string `locationName:"infrastructureConfigurationArn" type:"string"` + + // The name of the image pipeline. + Name *string `locationName:"name" type:"string"` + + // The platform of the image pipeline. + Platform *string `locationName:"platform" type:"string" enum:"Platform"` + + // The schedule of the image pipeline. + Schedule *Schedule `locationName:"schedule" type:"structure"` + + // The status of the image pipeline. + Status *string `locationName:"status" type:"string" enum:"PipelineStatus"` + + // The tags of this image pipeline. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +} + +// String returns the string representation +func (s ImagePipeline) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImagePipeline) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *ImagePipeline) SetArn(v string) *ImagePipeline { + s.Arn = &v + return s +} + +// SetDateCreated sets the DateCreated field's value. +func (s *ImagePipeline) SetDateCreated(v string) *ImagePipeline { + s.DateCreated = &v + return s +} + +// SetDateLastRun sets the DateLastRun field's value. +func (s *ImagePipeline) SetDateLastRun(v string) *ImagePipeline { + s.DateLastRun = &v + return s +} + +// SetDateNextRun sets the DateNextRun field's value. +func (s *ImagePipeline) SetDateNextRun(v string) *ImagePipeline { + s.DateNextRun = &v + return s +} + +// SetDateUpdated sets the DateUpdated field's value. +func (s *ImagePipeline) SetDateUpdated(v string) *ImagePipeline { + s.DateUpdated = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *ImagePipeline) SetDescription(v string) *ImagePipeline { + s.Description = &v + return s +} + +// SetDistributionConfigurationArn sets the DistributionConfigurationArn field's value. +func (s *ImagePipeline) SetDistributionConfigurationArn(v string) *ImagePipeline { + s.DistributionConfigurationArn = &v + return s +} + +// SetImageRecipeArn sets the ImageRecipeArn field's value. +func (s *ImagePipeline) SetImageRecipeArn(v string) *ImagePipeline { + s.ImageRecipeArn = &v + return s +} + +// SetImageTestsConfiguration sets the ImageTestsConfiguration field's value. +func (s *ImagePipeline) SetImageTestsConfiguration(v *ImageTestsConfiguration) *ImagePipeline { + s.ImageTestsConfiguration = v + return s +} + +// SetInfrastructureConfigurationArn sets the InfrastructureConfigurationArn field's value. +func (s *ImagePipeline) SetInfrastructureConfigurationArn(v string) *ImagePipeline { + s.InfrastructureConfigurationArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *ImagePipeline) SetName(v string) *ImagePipeline { + s.Name = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *ImagePipeline) SetPlatform(v string) *ImagePipeline { + s.Platform = &v + return s +} + +// SetSchedule sets the Schedule field's value. +func (s *ImagePipeline) SetSchedule(v *Schedule) *ImagePipeline { + s.Schedule = v + return s +} + +// SetStatus sets the Status field's value. +func (s *ImagePipeline) SetStatus(v string) *ImagePipeline { + s.Status = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *ImagePipeline) SetTags(v map[string]*string) *ImagePipeline { + s.Tags = v + return s +} + +// An image recipe. +type ImageRecipe struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image recipe. + Arn *string `locationName:"arn" type:"string"` + + // The block device mappings to apply when creating images from this recipe. + BlockDeviceMappings []*InstanceBlockDeviceMapping `locationName:"blockDeviceMappings" type:"list"` + + // The components of the image recipe. + Components []*ComponentConfiguration `locationName:"components" min:"1" type:"list"` + + // The date on which this image recipe was created. + DateCreated *string `locationName:"dateCreated" type:"string"` + + // The description of the image recipe. + Description *string `locationName:"description" min:"1" type:"string"` + + // The name of the image recipe. + Name *string `locationName:"name" type:"string"` + + // The owner of the image recipe. + Owner *string `locationName:"owner" min:"1" type:"string"` + + // The parent image of the image recipe. + ParentImage *string `locationName:"parentImage" min:"1" type:"string"` + + // The platform of the image recipe. + Platform *string `locationName:"platform" type:"string" enum:"Platform"` + + // The tags of the image recipe. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The version of the image recipe. + Version *string `locationName:"version" type:"string"` +} + +// String returns the string representation +func (s ImageRecipe) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImageRecipe) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *ImageRecipe) SetArn(v string) *ImageRecipe { + s.Arn = &v + return s +} + +// SetBlockDeviceMappings sets the BlockDeviceMappings field's value. +func (s *ImageRecipe) SetBlockDeviceMappings(v []*InstanceBlockDeviceMapping) *ImageRecipe { + s.BlockDeviceMappings = v + return s +} + +// SetComponents sets the Components field's value. +func (s *ImageRecipe) SetComponents(v []*ComponentConfiguration) *ImageRecipe { + s.Components = v + return s +} + +// SetDateCreated sets the DateCreated field's value. +func (s *ImageRecipe) SetDateCreated(v string) *ImageRecipe { + s.DateCreated = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *ImageRecipe) SetDescription(v string) *ImageRecipe { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *ImageRecipe) SetName(v string) *ImageRecipe { + s.Name = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *ImageRecipe) SetOwner(v string) *ImageRecipe { + s.Owner = &v + return s +} + +// SetParentImage sets the ParentImage field's value. +func (s *ImageRecipe) SetParentImage(v string) *ImageRecipe { + s.ParentImage = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *ImageRecipe) SetPlatform(v string) *ImageRecipe { + s.Platform = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *ImageRecipe) SetTags(v map[string]*string) *ImageRecipe { + s.Tags = v + return s +} + +// SetVersion sets the Version field's value. +func (s *ImageRecipe) SetVersion(v string) *ImageRecipe { + s.Version = &v + return s +} + +// A summary of an image recipe. +type ImageRecipeSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image recipe. + Arn *string `locationName:"arn" type:"string"` + + // The date on which this image recipe was created. + DateCreated *string `locationName:"dateCreated" type:"string"` + + // The name of the image recipe. + Name *string `locationName:"name" type:"string"` + + // The owner of the image recipe. + Owner *string `locationName:"owner" min:"1" type:"string"` + + // The parent image of the image recipe. + ParentImage *string `locationName:"parentImage" min:"1" type:"string"` + + // The platform of the image recipe. + Platform *string `locationName:"platform" type:"string" enum:"Platform"` + + // The tags of the image recipe. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +} + +// String returns the string representation +func (s ImageRecipeSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImageRecipeSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *ImageRecipeSummary) SetArn(v string) *ImageRecipeSummary { + s.Arn = &v + return s +} + +// SetDateCreated sets the DateCreated field's value. +func (s *ImageRecipeSummary) SetDateCreated(v string) *ImageRecipeSummary { + s.DateCreated = &v + return s +} + +// SetName sets the Name field's value. +func (s *ImageRecipeSummary) SetName(v string) *ImageRecipeSummary { + s.Name = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *ImageRecipeSummary) SetOwner(v string) *ImageRecipeSummary { + s.Owner = &v + return s +} + +// SetParentImage sets the ParentImage field's value. +func (s *ImageRecipeSummary) SetParentImage(v string) *ImageRecipeSummary { + s.ParentImage = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *ImageRecipeSummary) SetPlatform(v string) *ImageRecipeSummary { + s.Platform = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *ImageRecipeSummary) SetTags(v map[string]*string) *ImageRecipeSummary { + s.Tags = v + return s +} + +// Image state shows the image status and the reason for that status. +type ImageState struct { + _ struct{} `type:"structure"` + + // The reason for the image's status. + Reason *string `locationName:"reason" min:"1" type:"string"` + + // The status of the image. + Status *string `locationName:"status" type:"string" enum:"ImageStatus"` +} + +// String returns the string representation +func (s ImageState) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImageState) GoString() string { + return s.String() +} + +// SetReason sets the Reason field's value. +func (s *ImageState) SetReason(v string) *ImageState { + s.Reason = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ImageState) SetStatus(v string) *ImageState { + s.Status = &v + return s +} + +// An image summary. +type ImageSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image. + Arn *string `locationName:"arn" type:"string"` + + // The date on which this image was created. + DateCreated *string `locationName:"dateCreated" type:"string"` + + // The name of the image. + Name *string `locationName:"name" type:"string"` + + // The output resources produced when creating this image. + OutputResources *OutputResources `locationName:"outputResources" type:"structure"` + + // The owner of the image. + Owner *string `locationName:"owner" min:"1" type:"string"` + + // The platform of the image. + Platform *string `locationName:"platform" type:"string" enum:"Platform"` + + // The state of the image. + State *ImageState `locationName:"state" type:"structure"` + + // The tags of the image. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The version of the image. + Version *string `locationName:"version" type:"string"` +} + +// String returns the string representation +func (s ImageSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImageSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *ImageSummary) SetArn(v string) *ImageSummary { + s.Arn = &v + return s +} + +// SetDateCreated sets the DateCreated field's value. +func (s *ImageSummary) SetDateCreated(v string) *ImageSummary { + s.DateCreated = &v + return s +} + +// SetName sets the Name field's value. +func (s *ImageSummary) SetName(v string) *ImageSummary { + s.Name = &v + return s +} + +// SetOutputResources sets the OutputResources field's value. +func (s *ImageSummary) SetOutputResources(v *OutputResources) *ImageSummary { + s.OutputResources = v + return s +} + +// SetOwner sets the Owner field's value. +func (s *ImageSummary) SetOwner(v string) *ImageSummary { + s.Owner = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *ImageSummary) SetPlatform(v string) *ImageSummary { + s.Platform = &v + return s +} + +// SetState sets the State field's value. +func (s *ImageSummary) SetState(v *ImageState) *ImageSummary { + s.State = v + return s +} + +// SetTags sets the Tags field's value. +func (s *ImageSummary) SetTags(v map[string]*string) *ImageSummary { + s.Tags = v + return s +} + +// SetVersion sets the Version field's value. +func (s *ImageSummary) SetVersion(v string) *ImageSummary { + s.Version = &v + return s +} + +// Image tests configuration. +type ImageTestsConfiguration struct { + _ struct{} `type:"structure"` + + // Defines if tests should be executed when building this image. + ImageTestsEnabled *bool `locationName:"imageTestsEnabled" type:"boolean"` + + // The maximum time in minutes that tests are permitted to run. + TimeoutMinutes *int64 `locationName:"timeoutMinutes" min:"60" type:"integer"` +} + +// String returns the string representation +func (s ImageTestsConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImageTestsConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ImageTestsConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ImageTestsConfiguration"} + if s.TimeoutMinutes != nil && *s.TimeoutMinutes < 60 { + invalidParams.Add(request.NewErrParamMinValue("TimeoutMinutes", 60)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetImageTestsEnabled sets the ImageTestsEnabled field's value. +func (s *ImageTestsConfiguration) SetImageTestsEnabled(v bool) *ImageTestsConfiguration { + s.ImageTestsEnabled = &v + return s +} + +// SetTimeoutMinutes sets the TimeoutMinutes field's value. +func (s *ImageTestsConfiguration) SetTimeoutMinutes(v int64) *ImageTestsConfiguration { + s.TimeoutMinutes = &v + return s +} + +// An image semantic version. +type ImageVersion struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image semantic version. + Arn *string `locationName:"arn" type:"string"` + + // The date at which this image semantic version was created. + DateCreated *string `locationName:"dateCreated" type:"string"` + + // The name of the image semantic version. + Name *string `locationName:"name" type:"string"` + + // The owner of the image semantic version. + Owner *string `locationName:"owner" min:"1" type:"string"` + + // The platform of the image semantic version. + Platform *string `locationName:"platform" type:"string" enum:"Platform"` + + // The semantic version of the image semantic version. + Version *string `locationName:"version" type:"string"` +} + +// String returns the string representation +func (s ImageVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImageVersion) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *ImageVersion) SetArn(v string) *ImageVersion { + s.Arn = &v + return s +} + +// SetDateCreated sets the DateCreated field's value. +func (s *ImageVersion) SetDateCreated(v string) *ImageVersion { + s.DateCreated = &v + return s +} + +// SetName sets the Name field's value. +func (s *ImageVersion) SetName(v string) *ImageVersion { + s.Name = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *ImageVersion) SetOwner(v string) *ImageVersion { + s.Owner = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *ImageVersion) SetPlatform(v string) *ImageVersion { + s.Platform = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *ImageVersion) SetVersion(v string) *ImageVersion { + s.Version = &v + return s +} + +type ImportComponentInput struct { + _ struct{} `type:"structure"` + + // The change description of the component. Describes what change has been made + // in this version, or what makes this version different from other versions + // of this component. + ChangeDescription *string `locationName:"changeDescription" min:"1" type:"string"` + + // The idempotency token of the component. + ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` + + // The data of the component. Used to specify the data inline. Either data or + // uri can be used to specify the data within the component. + Data *string `locationName:"data" min:"1" type:"string"` + + // The description of the component. Describes the contents of the component. + Description *string `locationName:"description" min:"1" type:"string"` + + // The format of the resource that you want to import as a component. + // + // Format is a required field + Format *string `locationName:"format" type:"string" required:"true" enum:"ComponentFormat"` + + // The ID of the KMS key that should be used to encrypt this component. + KmsKeyId *string `locationName:"kmsKeyId" min:"1" type:"string"` + + // The name of the component. + // + // Name is a required field + Name *string `locationName:"name" type:"string" required:"true"` + + // The platform of the component. + // + // Platform is a required field + Platform *string `locationName:"platform" type:"string" required:"true" enum:"Platform"` + + // The semantic version of the component. This version follows the semantic + // version syntax. For example, major.minor.patch. This could be versioned like + // software (2.0.1) or like a date (2019.12.01). + // + // SemanticVersion is a required field + SemanticVersion *string `locationName:"semanticVersion" type:"string" required:"true"` + + // The tags of the component. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The type of the component denotes whether the component is used to build + // the image or only to test it. + // + // Type is a required field + Type *string `locationName:"type" type:"string" required:"true" enum:"ComponentType"` + + // The uri of the component. Must be an S3 URL and the requester must have permission + // to access the S3 bucket. If you use S3, you can specify component content + // up to your service quota. Either data or uri can be used to specify the data + // within the component. + Uri *string `locationName:"uri" type:"string"` +} + +// String returns the string representation +func (s ImportComponentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportComponentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ImportComponentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ImportComponentInput"} + if s.ChangeDescription != nil && len(*s.ChangeDescription) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChangeDescription", 1)) + } + if s.ClientToken != nil && len(*s.ClientToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) + } + if s.Data != nil && len(*s.Data) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Data", 1)) + } + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 1)) + } + if s.Format == nil { + invalidParams.Add(request.NewErrParamRequired("Format")) + } + if s.KmsKeyId != nil && len(*s.KmsKeyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("KmsKeyId", 1)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Platform == nil { + invalidParams.Add(request.NewErrParamRequired("Platform")) + } + if s.SemanticVersion == nil { + invalidParams.Add(request.NewErrParamRequired("SemanticVersion")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetChangeDescription sets the ChangeDescription field's value. +func (s *ImportComponentInput) SetChangeDescription(v string) *ImportComponentInput { + s.ChangeDescription = &v + return s +} + +// SetClientToken sets the ClientToken field's value. +func (s *ImportComponentInput) SetClientToken(v string) *ImportComponentInput { + s.ClientToken = &v + return s +} + +// SetData sets the Data field's value. +func (s *ImportComponentInput) SetData(v string) *ImportComponentInput { + s.Data = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *ImportComponentInput) SetDescription(v string) *ImportComponentInput { + s.Description = &v + return s +} + +// SetFormat sets the Format field's value. +func (s *ImportComponentInput) SetFormat(v string) *ImportComponentInput { + s.Format = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *ImportComponentInput) SetKmsKeyId(v string) *ImportComponentInput { + s.KmsKeyId = &v + return s +} + +// SetName sets the Name field's value. +func (s *ImportComponentInput) SetName(v string) *ImportComponentInput { + s.Name = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *ImportComponentInput) SetPlatform(v string) *ImportComponentInput { + s.Platform = &v + return s +} + +// SetSemanticVersion sets the SemanticVersion field's value. +func (s *ImportComponentInput) SetSemanticVersion(v string) *ImportComponentInput { + s.SemanticVersion = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *ImportComponentInput) SetTags(v map[string]*string) *ImportComponentInput { + s.Tags = v + return s +} + +// SetType sets the Type field's value. +func (s *ImportComponentInput) SetType(v string) *ImportComponentInput { + s.Type = &v + return s +} + +// SetUri sets the Uri field's value. +func (s *ImportComponentInput) SetUri(v string) *ImportComponentInput { + s.Uri = &v + return s +} + +type ImportComponentOutput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the imported component. + ComponentBuildVersionArn *string `locationName:"componentBuildVersionArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s ImportComponentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportComponentOutput) GoString() string { + return s.String() +} + +// SetClientToken sets the ClientToken field's value. +func (s *ImportComponentOutput) SetClientToken(v string) *ImportComponentOutput { + s.ClientToken = &v + return s +} + +// SetComponentBuildVersionArn sets the ComponentBuildVersionArn field's value. +func (s *ImportComponentOutput) SetComponentBuildVersionArn(v string) *ImportComponentOutput { + s.ComponentBuildVersionArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ImportComponentOutput) SetRequestId(v string) *ImportComponentOutput { + s.RequestId = &v + return s +} + +// Details of the infrastructure configuration. +type InfrastructureConfiguration struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the infrastructure configuration. + Arn *string `locationName:"arn" type:"string"` + + // The date on which the infrastructure configuration was created. + DateCreated *string `locationName:"dateCreated" type:"string"` + + // The date on which the infrastructure configuration was last updated. + DateUpdated *string `locationName:"dateUpdated" type:"string"` + + // The description of the infrastructure configuration. + Description *string `locationName:"description" min:"1" type:"string"` + + // The instance profile of the infrastructure configuration. + InstanceProfileName *string `locationName:"instanceProfileName" min:"1" type:"string"` + + // The instance types of the infrastructure configuration. + InstanceTypes []*string `locationName:"instanceTypes" type:"list"` + + // The EC2 key pair of the infrastructure configuration. + KeyPair *string `locationName:"keyPair" min:"1" type:"string"` + + // The logging configuration of the infrastructure configuration. + Logging *Logging `locationName:"logging" type:"structure"` + + // The name of the infrastructure configuration. + Name *string `locationName:"name" type:"string"` + + // The security group IDs of the infrastructure configuration. + SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` + + // The SNS topic Amazon Resource Name (ARN) of the infrastructure configuration. + SnsTopicArn *string `locationName:"snsTopicArn" min:"1" type:"string"` + + // The subnet ID of the infrastructure configuration. + SubnetId *string `locationName:"subnetId" min:"1" type:"string"` + + // The tags of the infrastructure configuration. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` + + // The terminate instance on failure configuration of the infrastructure configuration. + TerminateInstanceOnFailure *bool `locationName:"terminateInstanceOnFailure" type:"boolean"` +} + +// String returns the string representation +func (s InfrastructureConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InfrastructureConfiguration) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *InfrastructureConfiguration) SetArn(v string) *InfrastructureConfiguration { + s.Arn = &v + return s +} + +// SetDateCreated sets the DateCreated field's value. +func (s *InfrastructureConfiguration) SetDateCreated(v string) *InfrastructureConfiguration { + s.DateCreated = &v + return s +} + +// SetDateUpdated sets the DateUpdated field's value. +func (s *InfrastructureConfiguration) SetDateUpdated(v string) *InfrastructureConfiguration { + s.DateUpdated = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *InfrastructureConfiguration) SetDescription(v string) *InfrastructureConfiguration { + s.Description = &v + return s +} + +// SetInstanceProfileName sets the InstanceProfileName field's value. +func (s *InfrastructureConfiguration) SetInstanceProfileName(v string) *InfrastructureConfiguration { + s.InstanceProfileName = &v + return s +} + +// SetInstanceTypes sets the InstanceTypes field's value. +func (s *InfrastructureConfiguration) SetInstanceTypes(v []*string) *InfrastructureConfiguration { + s.InstanceTypes = v + return s +} + +// SetKeyPair sets the KeyPair field's value. +func (s *InfrastructureConfiguration) SetKeyPair(v string) *InfrastructureConfiguration { + s.KeyPair = &v + return s +} + +// SetLogging sets the Logging field's value. +func (s *InfrastructureConfiguration) SetLogging(v *Logging) *InfrastructureConfiguration { + s.Logging = v + return s +} + +// SetName sets the Name field's value. +func (s *InfrastructureConfiguration) SetName(v string) *InfrastructureConfiguration { + s.Name = &v + return s +} + +// SetSecurityGroupIds sets the SecurityGroupIds field's value. +func (s *InfrastructureConfiguration) SetSecurityGroupIds(v []*string) *InfrastructureConfiguration { + s.SecurityGroupIds = v + return s +} + +// SetSnsTopicArn sets the SnsTopicArn field's value. +func (s *InfrastructureConfiguration) SetSnsTopicArn(v string) *InfrastructureConfiguration { + s.SnsTopicArn = &v + return s +} + +// SetSubnetId sets the SubnetId field's value. +func (s *InfrastructureConfiguration) SetSubnetId(v string) *InfrastructureConfiguration { + s.SubnetId = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *InfrastructureConfiguration) SetTags(v map[string]*string) *InfrastructureConfiguration { + s.Tags = v + return s +} + +// SetTerminateInstanceOnFailure sets the TerminateInstanceOnFailure field's value. +func (s *InfrastructureConfiguration) SetTerminateInstanceOnFailure(v bool) *InfrastructureConfiguration { + s.TerminateInstanceOnFailure = &v + return s +} + +// The infrastructure used when building EC2 AMIs. +type InfrastructureConfigurationSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the infrastructure configuration. + Arn *string `locationName:"arn" type:"string"` + + // The date on which the infrastructure configuration was created. + DateCreated *string `locationName:"dateCreated" type:"string"` + + // The date on which the infrastructure configuration was last updated. + DateUpdated *string `locationName:"dateUpdated" type:"string"` + + // The description of the infrastructure configuration. + Description *string `locationName:"description" min:"1" type:"string"` + + // The name of the infrastructure configuration. + Name *string `locationName:"name" type:"string"` + + // The tags of the infrastructure configuration. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +} + +// String returns the string representation +func (s InfrastructureConfigurationSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InfrastructureConfigurationSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *InfrastructureConfigurationSummary) SetArn(v string) *InfrastructureConfigurationSummary { + s.Arn = &v + return s +} + +// SetDateCreated sets the DateCreated field's value. +func (s *InfrastructureConfigurationSummary) SetDateCreated(v string) *InfrastructureConfigurationSummary { + s.DateCreated = &v + return s +} + +// SetDateUpdated sets the DateUpdated field's value. +func (s *InfrastructureConfigurationSummary) SetDateUpdated(v string) *InfrastructureConfigurationSummary { + s.DateUpdated = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *InfrastructureConfigurationSummary) SetDescription(v string) *InfrastructureConfigurationSummary { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *InfrastructureConfigurationSummary) SetName(v string) *InfrastructureConfigurationSummary { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *InfrastructureConfigurationSummary) SetTags(v map[string]*string) *InfrastructureConfigurationSummary { + s.Tags = v + return s +} + +// Defines block device mappings for the instance used to configure your image. +type InstanceBlockDeviceMapping struct { + _ struct{} `type:"structure"` + + // The device to which these mappings apply. + DeviceName *string `locationName:"deviceName" min:"1" type:"string"` + + // Use to manage Amazon EBS-specific configuration for this mapping. + Ebs *EbsInstanceBlockDeviceSpecification `locationName:"ebs" type:"structure"` + + // Use to remove a mapping from the parent image. + NoDevice *string `locationName:"noDevice" type:"string"` + + // Use to manage instance ephemeral devices. + VirtualName *string `locationName:"virtualName" min:"1" type:"string"` +} + +// 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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *InstanceBlockDeviceMapping) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InstanceBlockDeviceMapping"} + 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 *InstanceBlockDeviceMapping) SetDeviceName(v string) *InstanceBlockDeviceMapping { + s.DeviceName = &v + return s +} + +// SetEbs sets the Ebs field's value. +func (s *InstanceBlockDeviceMapping) SetEbs(v *EbsInstanceBlockDeviceSpecification) *InstanceBlockDeviceMapping { + s.Ebs = v + return s +} + +// SetNoDevice sets the NoDevice field's value. +func (s *InstanceBlockDeviceMapping) SetNoDevice(v string) *InstanceBlockDeviceMapping { + s.NoDevice = &v + return s +} + +// SetVirtualName sets the VirtualName field's value. +func (s *InstanceBlockDeviceMapping) SetVirtualName(v string) *InstanceBlockDeviceMapping { + s.VirtualName = &v + return s +} + +// You have provided an invalid pagination token in your request. +type InvalidPaginationTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidPaginationTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPaginationTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidPaginationTokenException(v protocol.ResponseMetadata) error { + return &InvalidPaginationTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPaginationTokenException) Code() string { + return "InvalidPaginationTokenException" +} + +// Message returns the exception's message. +func (s InvalidPaginationTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPaginationTokenException) OrigErr() error { + return nil +} + +func (s InvalidPaginationTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPaginationTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPaginationTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// You have specified two or more mutually exclusive parameters. Review the +// error message for details. +type InvalidParameterCombinationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterCombinationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterCombinationException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterCombinationException(v protocol.ResponseMetadata) error { + return &InvalidParameterCombinationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterCombinationException) Code() string { + return "InvalidParameterCombinationException" +} + +// Message returns the exception's message. +func (s InvalidParameterCombinationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterCombinationException) OrigErr() error { + return nil +} + +func (s InvalidParameterCombinationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterCombinationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterCombinationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified parameter is invalid. Review the available parameters for the +// API request. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} + +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// The value that you provided for the specified parameter is invalid. +type InvalidParameterValueException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterValueException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterValueException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterValueException(v protocol.ResponseMetadata) error { + return &InvalidParameterValueException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterValueException) Code() string { + return "InvalidParameterValueException" +} + +// Message returns the exception's message. +func (s InvalidParameterValueException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterValueException) OrigErr() error { + return nil +} + +func (s InvalidParameterValueException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterValueException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterValueException) RequestID() string { + return s.respMetadata.RequestID +} + +// You have made a request for an action that is not supported by the service. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// Your version number is out of bounds or does not follow the required syntax. +type InvalidVersionNumberException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidVersionNumberException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidVersionNumberException) GoString() string { + return s.String() +} + +func newErrorInvalidVersionNumberException(v protocol.ResponseMetadata) error { + return &InvalidVersionNumberException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidVersionNumberException) Code() string { + return "InvalidVersionNumberException" +} + +// Message returns the exception's message. +func (s InvalidVersionNumberException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidVersionNumberException) OrigErr() error { + return nil +} + +func (s InvalidVersionNumberException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidVersionNumberException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidVersionNumberException) RequestID() string { + return s.respMetadata.RequestID +} + +// Describes the configuration for a launch permission. The launch permission +// modification request is sent to the EC2 ModifyImageAttribute (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_ModifyImageAttribute.html) +// API on behalf of the user for each Region they have selected to distribute +// the AMI. +type LaunchPermissionConfiguration struct { + _ struct{} `type:"structure"` + + // The name of the group. + UserGroups []*string `locationName:"userGroups" type:"list"` + + // The AWS account ID. + UserIds []*string `locationName:"userIds" type:"list"` +} + +// String returns the string representation +func (s LaunchPermissionConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LaunchPermissionConfiguration) GoString() string { + return s.String() +} + +// SetUserGroups sets the UserGroups field's value. +func (s *LaunchPermissionConfiguration) SetUserGroups(v []*string) *LaunchPermissionConfiguration { + s.UserGroups = v + return s +} + +// SetUserIds sets the UserIds field's value. +func (s *LaunchPermissionConfiguration) SetUserIds(v []*string) *LaunchPermissionConfiguration { + s.UserIds = v + return s +} + +type ListComponentBuildVersionsInput struct { + _ struct{} `type:"structure"` + + // The component version Amazon Resource Name (ARN) whose versions you want + // to list. + // + // ComponentVersionArn is a required field + ComponentVersionArn *string `locationName:"componentVersionArn" type:"string" required:"true"` + + // The maximum items to return in a request. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // A token to specify where to start paginating. This is the NextToken from + // a previously truncated response. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListComponentBuildVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListComponentBuildVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListComponentBuildVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListComponentBuildVersionsInput"} + if s.ComponentVersionArn == nil { + invalidParams.Add(request.NewErrParamRequired("ComponentVersionArn")) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComponentVersionArn sets the ComponentVersionArn field's value. +func (s *ListComponentBuildVersionsInput) SetComponentVersionArn(v string) *ListComponentBuildVersionsInput { + s.ComponentVersionArn = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListComponentBuildVersionsInput) SetMaxResults(v int64) *ListComponentBuildVersionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListComponentBuildVersionsInput) SetNextToken(v string) *ListComponentBuildVersionsInput { + s.NextToken = &v + return s +} + +type ListComponentBuildVersionsOutput struct { + _ struct{} `type:"structure"` + + // The list of component summaries for the specified semantic version. + ComponentSummaryList []*ComponentSummary `locationName:"componentSummaryList" type:"list"` + + // The next token used for paginated responses. When this is not empty, there + // are additional elements that the service has not included in this request. + // Use this token with the next request to retrieve additional objects. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListComponentBuildVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListComponentBuildVersionsOutput) GoString() string { + return s.String() +} + +// SetComponentSummaryList sets the ComponentSummaryList field's value. +func (s *ListComponentBuildVersionsOutput) SetComponentSummaryList(v []*ComponentSummary) *ListComponentBuildVersionsOutput { + s.ComponentSummaryList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListComponentBuildVersionsOutput) SetNextToken(v string) *ListComponentBuildVersionsOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListComponentBuildVersionsOutput) SetRequestId(v string) *ListComponentBuildVersionsOutput { + s.RequestId = &v + return s +} + +type ListComponentsInput struct { + _ struct{} `type:"structure"` + + // The filters. + Filters []*Filter `locationName:"filters" min:"1" type:"list"` + + // The maximum items to return in a request. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // A token to specify where to start paginating. This is the NextToken from + // a previously truncated response. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` + + // The owner defines which components you want to list. By default, this request + // will only show components owned by your account. You can use this field to + // specify if you want to view components owned by yourself, by Amazon, or those + // components that have been shared with you by other customers. + Owner *string `locationName:"owner" type:"string" enum:"Ownership"` +} + +// String returns the string representation +func (s ListComponentsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListComponentsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListComponentsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListComponentsInput"} + 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.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 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 *ListComponentsInput) SetFilters(v []*Filter) *ListComponentsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListComponentsInput) SetMaxResults(v int64) *ListComponentsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListComponentsInput) SetNextToken(v string) *ListComponentsInput { + s.NextToken = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *ListComponentsInput) SetOwner(v string) *ListComponentsInput { + s.Owner = &v + return s +} + +type ListComponentsOutput struct { + _ struct{} `type:"structure"` + + // The list of component semantic versions. + ComponentVersionList []*ComponentVersion `locationName:"componentVersionList" type:"list"` + + // The next token used for paginated responses. When this is not empty, there + // are additional elements that the service has not included in this request. + // Use this token with the next request to retrieve additional objects. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListComponentsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListComponentsOutput) GoString() string { + return s.String() +} + +// SetComponentVersionList sets the ComponentVersionList field's value. +func (s *ListComponentsOutput) SetComponentVersionList(v []*ComponentVersion) *ListComponentsOutput { + s.ComponentVersionList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListComponentsOutput) SetNextToken(v string) *ListComponentsOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListComponentsOutput) SetRequestId(v string) *ListComponentsOutput { + s.RequestId = &v + return s +} + +type ListDistributionConfigurationsInput struct { + _ struct{} `type:"structure"` + + // The filters. + Filters []*Filter `locationName:"filters" min:"1" type:"list"` + + // The maximum items to return in a request. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // A token to specify where to start paginating. This is the NextToken from + // a previously truncated response. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListDistributionConfigurationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDistributionConfigurationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListDistributionConfigurationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListDistributionConfigurationsInput"} + 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.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 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 *ListDistributionConfigurationsInput) SetFilters(v []*Filter) *ListDistributionConfigurationsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListDistributionConfigurationsInput) SetMaxResults(v int64) *ListDistributionConfigurationsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDistributionConfigurationsInput) SetNextToken(v string) *ListDistributionConfigurationsInput { + s.NextToken = &v + return s +} + +type ListDistributionConfigurationsOutput struct { + _ struct{} `type:"structure"` + + // The list of distributions. + DistributionConfigurationSummaryList []*DistributionConfigurationSummary `locationName:"distributionConfigurationSummaryList" type:"list"` + + // The next token used for paginated responses. When this is not empty, there + // are additional elements that the service has not included in this request. + // Use this token with the next request to retrieve additional objects. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListDistributionConfigurationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDistributionConfigurationsOutput) GoString() string { + return s.String() +} + +// SetDistributionConfigurationSummaryList sets the DistributionConfigurationSummaryList field's value. +func (s *ListDistributionConfigurationsOutput) SetDistributionConfigurationSummaryList(v []*DistributionConfigurationSummary) *ListDistributionConfigurationsOutput { + s.DistributionConfigurationSummaryList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDistributionConfigurationsOutput) SetNextToken(v string) *ListDistributionConfigurationsOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListDistributionConfigurationsOutput) SetRequestId(v string) *ListDistributionConfigurationsOutput { + s.RequestId = &v + return s +} + +type ListImageBuildVersionsInput struct { + _ struct{} `type:"structure"` + + // The filters. + Filters []*Filter `locationName:"filters" min:"1" type:"list"` + + // The Amazon Resource Name (ARN) of the image whose build versions you want + // to retrieve. + // + // ImageVersionArn is a required field + ImageVersionArn *string `locationName:"imageVersionArn" type:"string" required:"true"` + + // The maximum items to return in a request. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // A token to specify where to start paginating. This is the NextToken from + // a previously truncated response. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListImageBuildVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListImageBuildVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListImageBuildVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListImageBuildVersionsInput"} + if s.Filters != nil && len(s.Filters) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Filters", 1)) + } + if s.ImageVersionArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImageVersionArn")) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 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 *ListImageBuildVersionsInput) SetFilters(v []*Filter) *ListImageBuildVersionsInput { + s.Filters = v + return s +} + +// SetImageVersionArn sets the ImageVersionArn field's value. +func (s *ListImageBuildVersionsInput) SetImageVersionArn(v string) *ListImageBuildVersionsInput { + s.ImageVersionArn = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListImageBuildVersionsInput) SetMaxResults(v int64) *ListImageBuildVersionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListImageBuildVersionsInput) SetNextToken(v string) *ListImageBuildVersionsInput { + s.NextToken = &v + return s +} + +type ListImageBuildVersionsOutput struct { + _ struct{} `type:"structure"` + + // The list of image build versions. + ImageSummaryList []*ImageSummary `locationName:"imageSummaryList" type:"list"` + + // The next token used for paginated responses. When this is not empty, there + // are additional elements that the service has not included in this request. + // Use this token with the next request to retrieve additional objects. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListImageBuildVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListImageBuildVersionsOutput) GoString() string { + return s.String() +} + +// SetImageSummaryList sets the ImageSummaryList field's value. +func (s *ListImageBuildVersionsOutput) SetImageSummaryList(v []*ImageSummary) *ListImageBuildVersionsOutput { + s.ImageSummaryList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListImageBuildVersionsOutput) SetNextToken(v string) *ListImageBuildVersionsOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListImageBuildVersionsOutput) SetRequestId(v string) *ListImageBuildVersionsOutput { + s.RequestId = &v + return s +} + +type ListImagePipelineImagesInput struct { + _ struct{} `type:"structure"` + + // The filters. + Filters []*Filter `locationName:"filters" min:"1" type:"list"` + + // The Amazon Resource Name (ARN) of the image pipeline whose images you want + // to view. + // + // ImagePipelineArn is a required field + ImagePipelineArn *string `locationName:"imagePipelineArn" type:"string" required:"true"` + + // The maximum items to return in a request. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // A token to specify where to start paginating. This is the NextToken from + // a previously truncated response. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListImagePipelineImagesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListImagePipelineImagesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListImagePipelineImagesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListImagePipelineImagesInput"} + if s.Filters != nil && len(s.Filters) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Filters", 1)) + } + if s.ImagePipelineArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImagePipelineArn")) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 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 *ListImagePipelineImagesInput) SetFilters(v []*Filter) *ListImagePipelineImagesInput { + s.Filters = v + return s +} + +// SetImagePipelineArn sets the ImagePipelineArn field's value. +func (s *ListImagePipelineImagesInput) SetImagePipelineArn(v string) *ListImagePipelineImagesInput { + s.ImagePipelineArn = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListImagePipelineImagesInput) SetMaxResults(v int64) *ListImagePipelineImagesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListImagePipelineImagesInput) SetNextToken(v string) *ListImagePipelineImagesInput { + s.NextToken = &v + return s +} + +type ListImagePipelineImagesOutput struct { + _ struct{} `type:"structure"` + + // The list of images built by this pipeline. + ImageSummaryList []*ImageSummary `locationName:"imageSummaryList" type:"list"` + + // The next token used for paginated responses. When this is not empty, there + // are additional elements that the service has not included in this request. + // Use this token with the next request to retrieve additional objects. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListImagePipelineImagesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListImagePipelineImagesOutput) GoString() string { + return s.String() +} + +// SetImageSummaryList sets the ImageSummaryList field's value. +func (s *ListImagePipelineImagesOutput) SetImageSummaryList(v []*ImageSummary) *ListImagePipelineImagesOutput { + s.ImageSummaryList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListImagePipelineImagesOutput) SetNextToken(v string) *ListImagePipelineImagesOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListImagePipelineImagesOutput) SetRequestId(v string) *ListImagePipelineImagesOutput { + s.RequestId = &v + return s +} + +type ListImagePipelinesInput struct { + _ struct{} `type:"structure"` + + // The filters. + Filters []*Filter `locationName:"filters" min:"1" type:"list"` + + // The maximum items to return in a request. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // A token to specify where to start paginating. This is the NextToken from + // a previously truncated response. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListImagePipelinesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListImagePipelinesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListImagePipelinesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListImagePipelinesInput"} + 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.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 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 *ListImagePipelinesInput) SetFilters(v []*Filter) *ListImagePipelinesInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListImagePipelinesInput) SetMaxResults(v int64) *ListImagePipelinesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListImagePipelinesInput) SetNextToken(v string) *ListImagePipelinesInput { + s.NextToken = &v + return s +} + +type ListImagePipelinesOutput struct { + _ struct{} `type:"structure"` + + // The list of image pipelines. + ImagePipelineList []*ImagePipeline `locationName:"imagePipelineList" type:"list"` + + // The next token used for paginated responses. When this is not empty, there + // are additional elements that the service has not included in this request. + // Use this token with the next request to retrieve additional objects. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListImagePipelinesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListImagePipelinesOutput) GoString() string { + return s.String() +} + +// SetImagePipelineList sets the ImagePipelineList field's value. +func (s *ListImagePipelinesOutput) SetImagePipelineList(v []*ImagePipeline) *ListImagePipelinesOutput { + s.ImagePipelineList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListImagePipelinesOutput) SetNextToken(v string) *ListImagePipelinesOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListImagePipelinesOutput) SetRequestId(v string) *ListImagePipelinesOutput { + s.RequestId = &v + return s +} + +type ListImageRecipesInput struct { + _ struct{} `type:"structure"` + + // The filters. + Filters []*Filter `locationName:"filters" min:"1" type:"list"` + + // The maximum items to return in a request. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // A token to specify where to start paginating. This is the NextToken from + // a previously truncated response. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` + + // The owner defines which image recipes you want to list. By default, this + // request will only show image recipes owned by your account. You can use this + // field to specify if you want to view image recipes owned by yourself, by + // Amazon, or those image recipes that have been shared with you by other customers. + Owner *string `locationName:"owner" type:"string" enum:"Ownership"` +} + +// String returns the string representation +func (s ListImageRecipesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListImageRecipesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListImageRecipesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListImageRecipesInput"} + 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.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 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 *ListImageRecipesInput) SetFilters(v []*Filter) *ListImageRecipesInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListImageRecipesInput) SetMaxResults(v int64) *ListImageRecipesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListImageRecipesInput) SetNextToken(v string) *ListImageRecipesInput { + s.NextToken = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *ListImageRecipesInput) SetOwner(v string) *ListImageRecipesInput { + s.Owner = &v + return s +} + +type ListImageRecipesOutput struct { + _ struct{} `type:"structure"` + + // The list of image pipelines. + ImageRecipeSummaryList []*ImageRecipeSummary `locationName:"imageRecipeSummaryList" type:"list"` + + // The next token used for paginated responses. When this is not empty, there + // are additional elements that the service has not included in this request. + // Use this token with the next request to retrieve additional objects. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListImageRecipesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListImageRecipesOutput) GoString() string { + return s.String() +} + +// SetImageRecipeSummaryList sets the ImageRecipeSummaryList field's value. +func (s *ListImageRecipesOutput) SetImageRecipeSummaryList(v []*ImageRecipeSummary) *ListImageRecipesOutput { + s.ImageRecipeSummaryList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListImageRecipesOutput) SetNextToken(v string) *ListImageRecipesOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListImageRecipesOutput) SetRequestId(v string) *ListImageRecipesOutput { + s.RequestId = &v + return s +} + +type ListImagesInput struct { + _ struct{} `type:"structure"` + + // The filters. + Filters []*Filter `locationName:"filters" min:"1" type:"list"` + + // The maximum items to return in a request. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // A token to specify where to start paginating. This is the NextToken from + // a previously truncated response. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` + + // The owner defines which images you want to list. By default, this request + // will only show images owned by your account. You can use this field to specify + // if you want to view images owned by yourself, by Amazon, or those images + // that have been shared with you by other customers. + Owner *string `locationName:"owner" type:"string" enum:"Ownership"` +} + +// 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.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.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 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 *ListImagesInput) SetFilters(v []*Filter) *ListImagesInput { + s.Filters = 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 +} + +// SetOwner sets the Owner field's value. +func (s *ListImagesInput) SetOwner(v string) *ListImagesInput { + s.Owner = &v + return s +} + +type ListImagesOutput struct { + _ struct{} `type:"structure"` + + // The list of image semantic versions. + ImageVersionList []*ImageVersion `locationName:"imageVersionList" type:"list"` + + // The next token used for paginated responses. When this is not empty, there + // are additional elements that the service has not included in this request. + // Use this token with the next request to retrieve additional objects. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" 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() +} + +// SetImageVersionList sets the ImageVersionList field's value. +func (s *ListImagesOutput) SetImageVersionList(v []*ImageVersion) *ListImagesOutput { + s.ImageVersionList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListImagesOutput) SetNextToken(v string) *ListImagesOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListImagesOutput) SetRequestId(v string) *ListImagesOutput { + s.RequestId = &v + return s +} + +type ListInfrastructureConfigurationsInput struct { + _ struct{} `type:"structure"` + + // The filters. + Filters []*Filter `locationName:"filters" min:"1" type:"list"` + + // The maximum items to return in a request. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // A token to specify where to start paginating. This is the NextToken from + // a previously truncated response. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListInfrastructureConfigurationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListInfrastructureConfigurationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListInfrastructureConfigurationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListInfrastructureConfigurationsInput"} + 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.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 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 *ListInfrastructureConfigurationsInput) SetFilters(v []*Filter) *ListInfrastructureConfigurationsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListInfrastructureConfigurationsInput) SetMaxResults(v int64) *ListInfrastructureConfigurationsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListInfrastructureConfigurationsInput) SetNextToken(v string) *ListInfrastructureConfigurationsInput { + s.NextToken = &v + return s +} + +type ListInfrastructureConfigurationsOutput struct { + _ struct{} `type:"structure"` + + // The list of infrastructure configurations. + InfrastructureConfigurationSummaryList []*InfrastructureConfigurationSummary `locationName:"infrastructureConfigurationSummaryList" type:"list"` + + // The next token used for paginated responses. When this is not empty, there + // are additional elements that the service has not included in this request. + // Use this token with the next request to retrieve additional objects. + NextToken *string `locationName:"nextToken" min:"1" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListInfrastructureConfigurationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListInfrastructureConfigurationsOutput) GoString() string { + return s.String() +} + +// SetInfrastructureConfigurationSummaryList sets the InfrastructureConfigurationSummaryList field's value. +func (s *ListInfrastructureConfigurationsOutput) SetInfrastructureConfigurationSummaryList(v []*InfrastructureConfigurationSummary) *ListInfrastructureConfigurationsOutput { + s.InfrastructureConfigurationSummaryList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListInfrastructureConfigurationsOutput) SetNextToken(v string) *ListInfrastructureConfigurationsOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListInfrastructureConfigurationsOutput) SetRequestId(v string) *ListInfrastructureConfigurationsOutput { + s.RequestId = &v + return s +} + +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource whose tags you want to retrieve. + // + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resourceArn" 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 +} + +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // The tags for the specified resource. + Tags map[string]*string `locationName:"tags" min:"1" type:"map"` +} + +// 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 map[string]*string) *ListTagsForResourceOutput { + s.Tags = v + return s +} + +// Logging configuration defines where Image Builder uploads your logs. +type Logging struct { + _ struct{} `type:"structure"` + + // The Amazon S3 logging configuration. + S3Logs *S3Logs `locationName:"s3Logs" type:"structure"` +} + +// String returns the string representation +func (s Logging) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Logging) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Logging) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Logging"} + if s.S3Logs != nil { + if err := s.S3Logs.Validate(); err != nil { + invalidParams.AddNested("S3Logs", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetS3Logs sets the S3Logs field's value. +func (s *Logging) SetS3Logs(v *S3Logs) *Logging { + s.S3Logs = v + return s +} + +// The resources produced by this image. +type OutputResources struct { + _ struct{} `type:"structure"` + + // The EC2 AMIs created by this image. + Amis []*Ami `locationName:"amis" type:"list"` +} + +// String returns the string representation +func (s OutputResources) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OutputResources) GoString() string { + return s.String() +} + +// SetAmis sets the Amis field's value. +func (s *OutputResources) SetAmis(v []*Ami) *OutputResources { + s.Amis = v + return s +} + +type PutComponentPolicyInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the component that this policy should be + // applied to. + // + // ComponentArn is a required field + ComponentArn *string `locationName:"componentArn" type:"string" required:"true"` + + // The policy to apply. + // + // Policy is a required field + Policy *string `locationName:"policy" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s PutComponentPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutComponentPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutComponentPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutComponentPolicyInput"} + if s.ComponentArn == nil { + invalidParams.Add(request.NewErrParamRequired("ComponentArn")) + } + if s.Policy == nil { + invalidParams.Add(request.NewErrParamRequired("Policy")) + } + if s.Policy != nil && len(*s.Policy) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComponentArn sets the ComponentArn field's value. +func (s *PutComponentPolicyInput) SetComponentArn(v string) *PutComponentPolicyInput { + s.ComponentArn = &v + return s +} + +// SetPolicy sets the Policy field's value. +func (s *PutComponentPolicyInput) SetPolicy(v string) *PutComponentPolicyInput { + s.Policy = &v + return s +} + +type PutComponentPolicyOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the component that this policy was applied + // to. + ComponentArn *string `locationName:"componentArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s PutComponentPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutComponentPolicyOutput) GoString() string { + return s.String() +} + +// SetComponentArn sets the ComponentArn field's value. +func (s *PutComponentPolicyOutput) SetComponentArn(v string) *PutComponentPolicyOutput { + s.ComponentArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *PutComponentPolicyOutput) SetRequestId(v string) *PutComponentPolicyOutput { + s.RequestId = &v + return s +} + +type PutImagePolicyInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image that this policy should be applied + // to. + // + // ImageArn is a required field + ImageArn *string `locationName:"imageArn" type:"string" required:"true"` + + // The policy to apply. + // + // Policy is a required field + Policy *string `locationName:"policy" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s PutImagePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutImagePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutImagePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutImagePolicyInput"} + if s.ImageArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImageArn")) + } + if s.Policy == nil { + invalidParams.Add(request.NewErrParamRequired("Policy")) + } + if s.Policy != nil && len(*s.Policy) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetImageArn sets the ImageArn field's value. +func (s *PutImagePolicyInput) SetImageArn(v string) *PutImagePolicyInput { + s.ImageArn = &v + return s +} + +// SetPolicy sets the Policy field's value. +func (s *PutImagePolicyInput) SetPolicy(v string) *PutImagePolicyInput { + s.Policy = &v + return s +} + +type PutImagePolicyOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image that this policy was applied + // to. + ImageArn *string `locationName:"imageArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s PutImagePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutImagePolicyOutput) GoString() string { + return s.String() +} + +// SetImageArn sets the ImageArn field's value. +func (s *PutImagePolicyOutput) SetImageArn(v string) *PutImagePolicyOutput { + s.ImageArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *PutImagePolicyOutput) SetRequestId(v string) *PutImagePolicyOutput { + s.RequestId = &v + return s +} + +type PutImageRecipePolicyInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image recipe that this policy should + // be applied to. + // + // ImageRecipeArn is a required field + ImageRecipeArn *string `locationName:"imageRecipeArn" type:"string" required:"true"` + + // The policy to apply. + // + // Policy is a required field + Policy *string `locationName:"policy" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s PutImageRecipePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutImageRecipePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutImageRecipePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutImageRecipePolicyInput"} + if s.ImageRecipeArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImageRecipeArn")) + } + if s.Policy == nil { + invalidParams.Add(request.NewErrParamRequired("Policy")) + } + if s.Policy != nil && len(*s.Policy) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Policy", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetImageRecipeArn sets the ImageRecipeArn field's value. +func (s *PutImageRecipePolicyInput) SetImageRecipeArn(v string) *PutImageRecipePolicyInput { + s.ImageRecipeArn = &v + return s +} + +// SetPolicy sets the Policy field's value. +func (s *PutImageRecipePolicyInput) SetPolicy(v string) *PutImageRecipePolicyInput { + s.Policy = &v + return s +} + +type PutImageRecipePolicyOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the image recipe that this policy was applied + // to. + ImageRecipeArn *string `locationName:"imageRecipeArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s PutImageRecipePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutImageRecipePolicyOutput) GoString() string { + return s.String() +} + +// SetImageRecipeArn sets the ImageRecipeArn field's value. +func (s *PutImageRecipePolicyOutput) SetImageRecipeArn(v string) *PutImageRecipePolicyOutput { + s.ImageRecipeArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *PutImageRecipePolicyOutput) SetRequestId(v string) *PutImageRecipePolicyOutput { + s.RequestId = &v + return s +} + +// The resource that you are trying to create already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// You have attempted to mutate or delete a resource with a dependency that +// prohibits this action. See the error message for more details. +type ResourceDependencyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceDependencyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceDependencyException) GoString() string { + return s.String() +} + +func newErrorResourceDependencyException(v protocol.ResponseMetadata) error { + return &ResourceDependencyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceDependencyException) Code() string { + return "ResourceDependencyException" +} + +// Message returns the exception's message. +func (s ResourceDependencyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceDependencyException) OrigErr() error { + return nil +} + +func (s ResourceDependencyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceDependencyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceDependencyException) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource that you are trying to operate on is currently in use. Review +// the message details and retry later. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// At least one of the resources referenced by your request does not exist. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Amazon S3 logging configuration. +type S3Logs struct { + _ struct{} `type:"structure"` + + // The Amazon S3 bucket in which to store the logs. + S3BucketName *string `locationName:"s3BucketName" min:"1" type:"string"` + + // The Amazon S3 path in which to store the logs. + S3KeyPrefix *string `locationName:"s3KeyPrefix" min:"1" type:"string"` +} + +// String returns the string representation +func (s S3Logs) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s S3Logs) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *S3Logs) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "S3Logs"} + if s.S3BucketName != nil && len(*s.S3BucketName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("S3BucketName", 1)) + } + if s.S3KeyPrefix != nil && len(*s.S3KeyPrefix) < 1 { + invalidParams.Add(request.NewErrParamMinLen("S3KeyPrefix", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetS3BucketName sets the S3BucketName field's value. +func (s *S3Logs) SetS3BucketName(v string) *S3Logs { + s.S3BucketName = &v + return s +} + +// SetS3KeyPrefix sets the S3KeyPrefix field's value. +func (s *S3Logs) SetS3KeyPrefix(v string) *S3Logs { + s.S3KeyPrefix = &v + return s +} + +// A schedule configures how often and when a pipeline will automatically create +// a new image. +type Schedule struct { + _ struct{} `type:"structure"` + + // The condition configures when the pipeline should trigger a new image build. + // When the pipelineExecutionStartCondition is set to EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE, + // EC2 Image Builder will build a new image only when there are known changes + // pending. When it is set to EXPRESSION_MATCH_ONLY, it will build a new image + // every time the CRON expression matches the current time. + PipelineExecutionStartCondition *string `locationName:"pipelineExecutionStartCondition" type:"string" enum:"PipelineExecutionStartCondition"` + + // The expression determines how often EC2 Image Builder evaluates your pipelineExecutionStartCondition. + ScheduleExpression *string `locationName:"scheduleExpression" min:"1" type:"string"` +} + +// String returns the string representation +func (s Schedule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Schedule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Schedule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Schedule"} + if s.ScheduleExpression != nil && len(*s.ScheduleExpression) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ScheduleExpression", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPipelineExecutionStartCondition sets the PipelineExecutionStartCondition field's value. +func (s *Schedule) SetPipelineExecutionStartCondition(v string) *Schedule { + s.PipelineExecutionStartCondition = &v + return s +} + +// SetScheduleExpression sets the ScheduleExpression field's value. +func (s *Schedule) SetScheduleExpression(v string) *Schedule { + s.ScheduleExpression = &v + return s +} + +// This exception is thrown when the service encounters an unrecoverable exception. +type ServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceException) GoString() string { + return s.String() +} + +func newErrorServiceException(v protocol.ResponseMetadata) error { + return &ServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceException) Code() string { + return "ServiceException" +} + +// Message returns the exception's message. +func (s ServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceException) OrigErr() error { + return nil +} + +func (s ServiceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceException) RequestID() string { + return s.respMetadata.RequestID +} + +// The service is unable to process your request at this time. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + +type StartImagePipelineExecutionInput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` + + // The Amazon Resource Name (ARN) of the image pipeline that you want to manually + // invoke. + // + // ImagePipelineArn is a required field + ImagePipelineArn *string `locationName:"imagePipelineArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s StartImagePipelineExecutionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartImagePipelineExecutionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartImagePipelineExecutionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartImagePipelineExecutionInput"} + if s.ClientToken != nil && len(*s.ClientToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientToken", 1)) + } + if s.ImagePipelineArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImagePipelineArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *StartImagePipelineExecutionInput) SetClientToken(v string) *StartImagePipelineExecutionInput { + s.ClientToken = &v + return s +} + +// SetImagePipelineArn sets the ImagePipelineArn field's value. +func (s *StartImagePipelineExecutionInput) SetImagePipelineArn(v string) *StartImagePipelineExecutionInput { + s.ImagePipelineArn = &v + return s +} + +type StartImagePipelineExecutionOutput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the image that was created by this request. + ImageBuildVersionArn *string `locationName:"imageBuildVersionArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s StartImagePipelineExecutionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartImagePipelineExecutionOutput) GoString() string { + return s.String() +} + +// SetClientToken sets the ClientToken field's value. +func (s *StartImagePipelineExecutionOutput) SetClientToken(v string) *StartImagePipelineExecutionOutput { + s.ClientToken = &v + return s +} + +// SetImageBuildVersionArn sets the ImageBuildVersionArn field's value. +func (s *StartImagePipelineExecutionOutput) SetImageBuildVersionArn(v string) *StartImagePipelineExecutionOutput { + s.ImageBuildVersionArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *StartImagePipelineExecutionOutput) SetRequestId(v string) *StartImagePipelineExecutionOutput { + s.RequestId = &v + return s +} + +type TagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource that you want to tag. + // + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` + + // The tags to apply to the resource. + // + // Tags is a required field + Tags map[string]*string `locationName:"tags" min:"1" type:"map" 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 && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + + 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 map[string]*string) *TagResourceInput { + s.Tags = v + return s +} + +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() +} + +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource that you want to untag. + // + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resourceArn" type:"string" required:"true"` + + // The tag keys to remove from the resource. + // + // TagKeys is a required field + TagKeys []*string `location:"querystring" locationName:"tagKeys" min:"1" 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 s.TagKeys != nil && len(s.TagKeys) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TagKeys", 1)) + } + + 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 +} + +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() +} + +type UpdateDistributionConfigurationInput struct { + _ struct{} `type:"structure"` + + // The idempotency token of the distribution configuration. + ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` + + // The description of the distribution configuration. + Description *string `locationName:"description" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the distribution configuration that you + // want to update. + // + // DistributionConfigurationArn is a required field + DistributionConfigurationArn *string `locationName:"distributionConfigurationArn" type:"string" required:"true"` + + // The distributions of the distribution configuration. + // + // Distributions is a required field + Distributions []*Distribution `locationName:"distributions" type:"list" required:"true"` +} + +// String returns the string representation +func (s UpdateDistributionConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateDistributionConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateDistributionConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateDistributionConfigurationInput"} + 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.DistributionConfigurationArn == nil { + invalidParams.Add(request.NewErrParamRequired("DistributionConfigurationArn")) + } + if s.Distributions == nil { + invalidParams.Add(request.NewErrParamRequired("Distributions")) + } + if s.Distributions != nil { + for i, v := range s.Distributions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Distributions", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *UpdateDistributionConfigurationInput) SetClientToken(v string) *UpdateDistributionConfigurationInput { + s.ClientToken = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *UpdateDistributionConfigurationInput) SetDescription(v string) *UpdateDistributionConfigurationInput { + s.Description = &v + return s +} + +// SetDistributionConfigurationArn sets the DistributionConfigurationArn field's value. +func (s *UpdateDistributionConfigurationInput) SetDistributionConfigurationArn(v string) *UpdateDistributionConfigurationInput { + s.DistributionConfigurationArn = &v + return s +} + +// SetDistributions sets the Distributions field's value. +func (s *UpdateDistributionConfigurationInput) SetDistributions(v []*Distribution) *UpdateDistributionConfigurationInput { + s.Distributions = v + return s +} + +type UpdateDistributionConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the distribution configuration that was + // updated by this request. + DistributionConfigurationArn *string `locationName:"distributionConfigurationArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateDistributionConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateDistributionConfigurationOutput) GoString() string { + return s.String() +} + +// SetClientToken sets the ClientToken field's value. +func (s *UpdateDistributionConfigurationOutput) SetClientToken(v string) *UpdateDistributionConfigurationOutput { + s.ClientToken = &v + return s +} + +// SetDistributionConfigurationArn sets the DistributionConfigurationArn field's value. +func (s *UpdateDistributionConfigurationOutput) SetDistributionConfigurationArn(v string) *UpdateDistributionConfigurationOutput { + s.DistributionConfigurationArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *UpdateDistributionConfigurationOutput) SetRequestId(v string) *UpdateDistributionConfigurationOutput { + s.RequestId = &v + return s +} + +type UpdateImagePipelineInput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` + + // The description of the image pipeline. + Description *string `locationName:"description" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the distribution configuration that will + // be used to configure and distribute images updated by this image pipeline. + DistributionConfigurationArn *string `locationName:"distributionConfigurationArn" type:"string"` + + // The Amazon Resource Name (ARN) of the image pipeline that you want to update. + // + // ImagePipelineArn is a required field + ImagePipelineArn *string `locationName:"imagePipelineArn" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the image recipe that will be used to configure + // images updated by this image pipeline. + // + // ImageRecipeArn is a required field + ImageRecipeArn *string `locationName:"imageRecipeArn" type:"string" required:"true"` + + // The image test configuration of the image pipeline. + ImageTestsConfiguration *ImageTestsConfiguration `locationName:"imageTestsConfiguration" type:"structure"` + + // The Amazon Resource Name (ARN) of the infrastructure configuration that will + // be used to build images updated by this image pipeline. + // + // InfrastructureConfigurationArn is a required field + InfrastructureConfigurationArn *string `locationName:"infrastructureConfigurationArn" type:"string" required:"true"` + + // The schedule of the image pipeline. + Schedule *Schedule `locationName:"schedule" type:"structure"` + + // The status of the image pipeline. + Status *string `locationName:"status" type:"string" enum:"PipelineStatus"` +} + +// String returns the string representation +func (s UpdateImagePipelineInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateImagePipelineInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateImagePipelineInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateImagePipelineInput"} + 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.ImagePipelineArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImagePipelineArn")) + } + if s.ImageRecipeArn == nil { + invalidParams.Add(request.NewErrParamRequired("ImageRecipeArn")) + } + if s.InfrastructureConfigurationArn == nil { + invalidParams.Add(request.NewErrParamRequired("InfrastructureConfigurationArn")) + } + if s.ImageTestsConfiguration != nil { + if err := s.ImageTestsConfiguration.Validate(); err != nil { + invalidParams.AddNested("ImageTestsConfiguration", err.(request.ErrInvalidParams)) + } + } + if s.Schedule != nil { + if err := s.Schedule.Validate(); err != nil { + invalidParams.AddNested("Schedule", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *UpdateImagePipelineInput) SetClientToken(v string) *UpdateImagePipelineInput { + s.ClientToken = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *UpdateImagePipelineInput) SetDescription(v string) *UpdateImagePipelineInput { + s.Description = &v + return s +} + +// SetDistributionConfigurationArn sets the DistributionConfigurationArn field's value. +func (s *UpdateImagePipelineInput) SetDistributionConfigurationArn(v string) *UpdateImagePipelineInput { + s.DistributionConfigurationArn = &v + return s +} + +// SetImagePipelineArn sets the ImagePipelineArn field's value. +func (s *UpdateImagePipelineInput) SetImagePipelineArn(v string) *UpdateImagePipelineInput { + s.ImagePipelineArn = &v + return s +} + +// SetImageRecipeArn sets the ImageRecipeArn field's value. +func (s *UpdateImagePipelineInput) SetImageRecipeArn(v string) *UpdateImagePipelineInput { + s.ImageRecipeArn = &v + return s +} + +// SetImageTestsConfiguration sets the ImageTestsConfiguration field's value. +func (s *UpdateImagePipelineInput) SetImageTestsConfiguration(v *ImageTestsConfiguration) *UpdateImagePipelineInput { + s.ImageTestsConfiguration = v + return s +} + +// SetInfrastructureConfigurationArn sets the InfrastructureConfigurationArn field's value. +func (s *UpdateImagePipelineInput) SetInfrastructureConfigurationArn(v string) *UpdateImagePipelineInput { + s.InfrastructureConfigurationArn = &v + return s +} + +// SetSchedule sets the Schedule field's value. +func (s *UpdateImagePipelineInput) SetSchedule(v *Schedule) *UpdateImagePipelineInput { + s.Schedule = v + return s +} + +// SetStatus sets the Status field's value. +func (s *UpdateImagePipelineInput) SetStatus(v string) *UpdateImagePipelineInput { + s.Status = &v + return s +} + +type UpdateImagePipelineOutput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the image pipeline that was updated by + // this request. + ImagePipelineArn *string `locationName:"imagePipelineArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateImagePipelineOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateImagePipelineOutput) GoString() string { + return s.String() +} + +// SetClientToken sets the ClientToken field's value. +func (s *UpdateImagePipelineOutput) SetClientToken(v string) *UpdateImagePipelineOutput { + s.ClientToken = &v + return s +} + +// SetImagePipelineArn sets the ImagePipelineArn field's value. +func (s *UpdateImagePipelineOutput) SetImagePipelineArn(v string) *UpdateImagePipelineOutput { + s.ImagePipelineArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *UpdateImagePipelineOutput) SetRequestId(v string) *UpdateImagePipelineOutput { + s.RequestId = &v + return s +} + +type UpdateInfrastructureConfigurationInput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string" idempotencyToken:"true"` + + // The description of the infrastructure configuration. + Description *string `locationName:"description" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the infrastructure configuration that you + // want to update. + // + // InfrastructureConfigurationArn is a required field + InfrastructureConfigurationArn *string `locationName:"infrastructureConfigurationArn" type:"string" required:"true"` + + // The instance profile to associate with the instance used to customize your + // EC2 AMI. + // + // InstanceProfileName is a required field + InstanceProfileName *string `locationName:"instanceProfileName" min:"1" type:"string" required:"true"` + + // The instance types of the infrastructure configuration. You can specify one + // or more instance types to use for this build. The service will pick one of + // these instance types based on availability. + InstanceTypes []*string `locationName:"instanceTypes" type:"list"` + + // The key pair of the infrastructure configuration. This can be used to log + // on to and debug the instance used to create your image. + KeyPair *string `locationName:"keyPair" min:"1" type:"string"` + + // The logging configuration of the infrastructure configuration. + Logging *Logging `locationName:"logging" type:"structure"` + + // The security group IDs to associate with the instance used to customize your + // EC2 AMI. + SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` + + // The SNS topic on which to send image build events. + SnsTopicArn *string `locationName:"snsTopicArn" type:"string"` + + // The subnet ID to place the instance used to customize your EC2 AMI in. + SubnetId *string `locationName:"subnetId" min:"1" type:"string"` + + // The terminate instance on failure setting of the infrastructure configuration. + // Set to false if you want Image Builder to retain the instance used to configure + // your AMI if the build or test phase of your workflow fails. + TerminateInstanceOnFailure *bool `locationName:"terminateInstanceOnFailure" type:"boolean"` +} + +// String returns the string representation +func (s UpdateInfrastructureConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateInfrastructureConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateInfrastructureConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateInfrastructureConfigurationInput"} + 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.InfrastructureConfigurationArn == nil { + invalidParams.Add(request.NewErrParamRequired("InfrastructureConfigurationArn")) + } + 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.KeyPair != nil && len(*s.KeyPair) < 1 { + invalidParams.Add(request.NewErrParamMinLen("KeyPair", 1)) + } + if s.SubnetId != nil && len(*s.SubnetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SubnetId", 1)) + } + if s.Logging != nil { + if err := s.Logging.Validate(); err != nil { + invalidParams.AddNested("Logging", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *UpdateInfrastructureConfigurationInput) SetClientToken(v string) *UpdateInfrastructureConfigurationInput { + s.ClientToken = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *UpdateInfrastructureConfigurationInput) SetDescription(v string) *UpdateInfrastructureConfigurationInput { + s.Description = &v + return s +} + +// SetInfrastructureConfigurationArn sets the InfrastructureConfigurationArn field's value. +func (s *UpdateInfrastructureConfigurationInput) SetInfrastructureConfigurationArn(v string) *UpdateInfrastructureConfigurationInput { + s.InfrastructureConfigurationArn = &v + return s +} + +// SetInstanceProfileName sets the InstanceProfileName field's value. +func (s *UpdateInfrastructureConfigurationInput) SetInstanceProfileName(v string) *UpdateInfrastructureConfigurationInput { + s.InstanceProfileName = &v + return s +} + +// SetInstanceTypes sets the InstanceTypes field's value. +func (s *UpdateInfrastructureConfigurationInput) SetInstanceTypes(v []*string) *UpdateInfrastructureConfigurationInput { + s.InstanceTypes = v + return s +} + +// SetKeyPair sets the KeyPair field's value. +func (s *UpdateInfrastructureConfigurationInput) SetKeyPair(v string) *UpdateInfrastructureConfigurationInput { + s.KeyPair = &v + return s +} + +// SetLogging sets the Logging field's value. +func (s *UpdateInfrastructureConfigurationInput) SetLogging(v *Logging) *UpdateInfrastructureConfigurationInput { + s.Logging = v + return s +} + +// SetSecurityGroupIds sets the SecurityGroupIds field's value. +func (s *UpdateInfrastructureConfigurationInput) SetSecurityGroupIds(v []*string) *UpdateInfrastructureConfigurationInput { + s.SecurityGroupIds = v + return s +} + +// SetSnsTopicArn sets the SnsTopicArn field's value. +func (s *UpdateInfrastructureConfigurationInput) SetSnsTopicArn(v string) *UpdateInfrastructureConfigurationInput { + s.SnsTopicArn = &v + return s +} + +// SetSubnetId sets the SubnetId field's value. +func (s *UpdateInfrastructureConfigurationInput) SetSubnetId(v string) *UpdateInfrastructureConfigurationInput { + s.SubnetId = &v + return s +} + +// SetTerminateInstanceOnFailure sets the TerminateInstanceOnFailure field's value. +func (s *UpdateInfrastructureConfigurationInput) SetTerminateInstanceOnFailure(v bool) *UpdateInfrastructureConfigurationInput { + s.TerminateInstanceOnFailure = &v + return s +} + +type UpdateInfrastructureConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The idempotency token used to make this request idempotent. + ClientToken *string `locationName:"clientToken" min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the infrastructure configuration that was + // updated by this request. + InfrastructureConfigurationArn *string `locationName:"infrastructureConfigurationArn" type:"string"` + + // The request ID that uniquely identifies this request. + RequestId *string `locationName:"requestId" min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateInfrastructureConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateInfrastructureConfigurationOutput) GoString() string { + return s.String() +} + +// SetClientToken sets the ClientToken field's value. +func (s *UpdateInfrastructureConfigurationOutput) SetClientToken(v string) *UpdateInfrastructureConfigurationOutput { + s.ClientToken = &v + return s +} + +// SetInfrastructureConfigurationArn sets the InfrastructureConfigurationArn field's value. +func (s *UpdateInfrastructureConfigurationOutput) SetInfrastructureConfigurationArn(v string) *UpdateInfrastructureConfigurationOutput { + s.InfrastructureConfigurationArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *UpdateInfrastructureConfigurationOutput) SetRequestId(v string) *UpdateInfrastructureConfigurationOutput { + s.RequestId = &v + return s +} + +const ( + // ComponentFormatShell is a ComponentFormat enum value + ComponentFormatShell = "SHELL" +) + +const ( + // ComponentTypeBuild is a ComponentType enum value + ComponentTypeBuild = "BUILD" + + // ComponentTypeTest is a ComponentType enum value + ComponentTypeTest = "TEST" +) + +const ( + // EbsVolumeTypeStandard is a EbsVolumeType enum value + EbsVolumeTypeStandard = "standard" + + // EbsVolumeTypeIo1 is a EbsVolumeType enum value + EbsVolumeTypeIo1 = "io1" + + // EbsVolumeTypeGp2 is a EbsVolumeType enum value + EbsVolumeTypeGp2 = "gp2" + + // EbsVolumeTypeSc1 is a EbsVolumeType enum value + EbsVolumeTypeSc1 = "sc1" + + // EbsVolumeTypeSt1 is a EbsVolumeType enum value + EbsVolumeTypeSt1 = "st1" +) + +const ( + // ImageStatusPending is a ImageStatus enum value + ImageStatusPending = "PENDING" + + // ImageStatusCreating is a ImageStatus enum value + ImageStatusCreating = "CREATING" + + // ImageStatusBuilding is a ImageStatus enum value + ImageStatusBuilding = "BUILDING" + + // ImageStatusTesting is a ImageStatus enum value + ImageStatusTesting = "TESTING" + + // ImageStatusDistributing is a ImageStatus enum value + ImageStatusDistributing = "DISTRIBUTING" + + // ImageStatusIntegrating is a ImageStatus enum value + ImageStatusIntegrating = "INTEGRATING" + + // ImageStatusAvailable is a ImageStatus enum value + ImageStatusAvailable = "AVAILABLE" + + // ImageStatusCancelled is a ImageStatus enum value + ImageStatusCancelled = "CANCELLED" + + // ImageStatusFailed is a ImageStatus enum value + ImageStatusFailed = "FAILED" + + // ImageStatusDeprecated is a ImageStatus enum value + ImageStatusDeprecated = "DEPRECATED" + + // ImageStatusDeleted is a ImageStatus enum value + ImageStatusDeleted = "DELETED" +) + +const ( + // OwnershipSelf is a Ownership enum value + OwnershipSelf = "Self" + + // OwnershipShared is a Ownership enum value + OwnershipShared = "Shared" + + // OwnershipAmazon is a Ownership enum value + OwnershipAmazon = "Amazon" +) + +const ( + // PipelineExecutionStartConditionExpressionMatchOnly is a PipelineExecutionStartCondition enum value + PipelineExecutionStartConditionExpressionMatchOnly = "EXPRESSION_MATCH_ONLY" + + // PipelineExecutionStartConditionExpressionMatchAndDependencyUpdatesAvailable is a PipelineExecutionStartCondition enum value + PipelineExecutionStartConditionExpressionMatchAndDependencyUpdatesAvailable = "EXPRESSION_MATCH_AND_DEPENDENCY_UPDATES_AVAILABLE" +) + +const ( + // PipelineStatusDisabled is a PipelineStatus enum value + PipelineStatusDisabled = "DISABLED" + + // PipelineStatusEnabled is a PipelineStatus enum value + PipelineStatusEnabled = "ENABLED" +) + +const ( + // PlatformWindows is a Platform enum value + PlatformWindows = "Windows" + + // PlatformLinux is a Platform enum value + PlatformLinux = "Linux" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/imagebuilder/doc.go b/vendor/github.com/aws/aws-sdk-go/service/imagebuilder/doc.go new file mode 100644 index 00000000000..b8fd6be903e --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/imagebuilder/doc.go @@ -0,0 +1,31 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package imagebuilder provides the client and types for making API +// requests to EC2 Image Builder. +// +// EC2 Image Builder is a fully managed AWS service that makes it easier to +// automate the creation, management, and deployment of customized, secure, +// and up-to-date “golden” server images that are pre-installed and pre-configured +// with software and settings to meet specific IT standards. +// +// See https://docs.aws.amazon.com/goto/WebAPI/imagebuilder-2019-12-02 for more information on this service. +// +// See imagebuilder package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/imagebuilder/ +// +// Using the Client +// +// To contact EC2 Image Builder 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 EC2 Image Builder client Imagebuilder for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/imagebuilder/#New +package imagebuilder diff --git a/vendor/github.com/aws/aws-sdk-go/service/imagebuilder/errors.go b/vendor/github.com/aws/aws-sdk-go/service/imagebuilder/errors.go new file mode 100644 index 00000000000..3f688043e53 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/imagebuilder/errors.go @@ -0,0 +1,132 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package imagebuilder + +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + +const ( + + // ErrCodeCallRateLimitExceededException for service response error code + // "CallRateLimitExceededException". + // + // You have exceeded the permitted request rate for the specific operation. + ErrCodeCallRateLimitExceededException = "CallRateLimitExceededException" + + // 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 permissions to use the + // action or resource, or specifying an invalid resource identifier. + ErrCodeClientException = "ClientException" + + // ErrCodeForbiddenException for service response error code + // "ForbiddenException". + // + // You are not authorized to perform the requested operation. + ErrCodeForbiddenException = "ForbiddenException" + + // ErrCodeIdempotentParameterMismatchException for service response error code + // "IdempotentParameterMismatchException". + // + // You have specified a client token for an operation using parameter values + // that differ from a previous request that used the same client token. + ErrCodeIdempotentParameterMismatchException = "IdempotentParameterMismatchException" + + // ErrCodeInvalidPaginationTokenException for service response error code + // "InvalidPaginationTokenException". + // + // You have provided an invalid pagination token in your request. + ErrCodeInvalidPaginationTokenException = "InvalidPaginationTokenException" + + // ErrCodeInvalidParameterCombinationException for service response error code + // "InvalidParameterCombinationException". + // + // You have specified two or more mutually exclusive parameters. Review the + // error message for details. + ErrCodeInvalidParameterCombinationException = "InvalidParameterCombinationException" + + // ErrCodeInvalidParameterException for service response error code + // "InvalidParameterException". + // + // The specified parameter is invalid. Review the available parameters for the + // API request. + ErrCodeInvalidParameterException = "InvalidParameterException" + + // ErrCodeInvalidParameterValueException for service response error code + // "InvalidParameterValueException". + // + // The value that you provided for the specified parameter is invalid. + ErrCodeInvalidParameterValueException = "InvalidParameterValueException" + + // ErrCodeInvalidRequestException for service response error code + // "InvalidRequestException". + // + // You have made a request for an action that is not supported by the service. + ErrCodeInvalidRequestException = "InvalidRequestException" + + // ErrCodeInvalidVersionNumberException for service response error code + // "InvalidVersionNumberException". + // + // Your version number is out of bounds or does not follow the required syntax. + ErrCodeInvalidVersionNumberException = "InvalidVersionNumberException" + + // ErrCodeResourceAlreadyExistsException for service response error code + // "ResourceAlreadyExistsException". + // + // The resource that you are trying to create already exists. + ErrCodeResourceAlreadyExistsException = "ResourceAlreadyExistsException" + + // ErrCodeResourceDependencyException for service response error code + // "ResourceDependencyException". + // + // You have attempted to mutate or delete a resource with a dependency that + // prohibits this action. See the error message for more details. + ErrCodeResourceDependencyException = "ResourceDependencyException" + + // ErrCodeResourceInUseException for service response error code + // "ResourceInUseException". + // + // The resource that you are trying to operate on is currently in use. Review + // the message details and retry later. + ErrCodeResourceInUseException = "ResourceInUseException" + + // ErrCodeResourceNotFoundException for service response error code + // "ResourceNotFoundException". + // + // At least one of the resources referenced by your request does not exist. + ErrCodeResourceNotFoundException = "ResourceNotFoundException" + + // ErrCodeServiceException for service response error code + // "ServiceException". + // + // This exception is thrown when the service encounters an unrecoverable exception. + ErrCodeServiceException = "ServiceException" + + // ErrCodeServiceUnavailableException for service response error code + // "ServiceUnavailableException". + // + // The service is unable to process your request at this time. + ErrCodeServiceUnavailableException = "ServiceUnavailableException" +) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "CallRateLimitExceededException": newErrorCallRateLimitExceededException, + "ClientException": newErrorClientException, + "ForbiddenException": newErrorForbiddenException, + "IdempotentParameterMismatchException": newErrorIdempotentParameterMismatchException, + "InvalidPaginationTokenException": newErrorInvalidPaginationTokenException, + "InvalidParameterCombinationException": newErrorInvalidParameterCombinationException, + "InvalidParameterException": newErrorInvalidParameterException, + "InvalidParameterValueException": newErrorInvalidParameterValueException, + "InvalidRequestException": newErrorInvalidRequestException, + "InvalidVersionNumberException": newErrorInvalidVersionNumberException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceDependencyException": newErrorResourceDependencyException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ServiceException": newErrorServiceException, + "ServiceUnavailableException": newErrorServiceUnavailableException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/imagebuilder/service.go b/vendor/github.com/aws/aws-sdk-go/service/imagebuilder/service.go new file mode 100644 index 00000000000..83f68a77f15 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/imagebuilder/service.go @@ -0,0 +1,104 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package imagebuilder + +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" + "github.com/aws/aws-sdk-go/private/protocol/restjson" +) + +// Imagebuilder provides the API operation methods for making requests to +// EC2 Image Builder. See this package's package overview docs +// for details on the service. +// +// Imagebuilder methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type Imagebuilder 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 = "imagebuilder" // Name of service. + EndpointsID = ServiceName // ID to lookup a service endpoint with. + ServiceID = "imagebuilder" // ServiceID is a unique identifier of a specific service. +) + +// New creates a new instance of the Imagebuilder client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// mySession := session.Must(session.NewSession()) +// +// // Create a Imagebuilder client from just a session. +// svc := imagebuilder.New(mySession) +// +// // Create a Imagebuilder client with additional configuration +// svc := imagebuilder.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *Imagebuilder { + c := p.ClientConfig(EndpointsID, cfgs...) + if c.SigningNameDerived || len(c.SigningName) == 0 { + c.SigningName = "imagebuilder" + } + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Imagebuilder { + svc := &Imagebuilder{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + PartitionID: partitionID, + Endpoint: endpoint, + APIVersion: "2019-12-02", + }, + 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( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a Imagebuilder operation and runs any +// custom request initialization. +func (c *Imagebuilder) 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/inspector/api.go b/vendor/github.com/aws/aws-sdk-go/service/inspector/api.go index 285bd3b6b8b..14961577ca9 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/inspector/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/inspector/api.go @@ -67,22 +67,22 @@ func (c *Inspector) AddAttributesToFindingsRequest(input *AddAttributesToFinding // See the AWS API reference guide for Amazon Inspector's // API operation AddAttributesToFindings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/AddAttributesToFindings @@ -168,30 +168,30 @@ func (c *Inspector) CreateAssessmentTargetRequest(input *CreateAssessmentTargetI // See the AWS API reference guide for Amazon Inspector's // API operation CreateAssessmentTarget for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * 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" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeInvalidCrossAccountRoleException "InvalidCrossAccountRoleException" +// * InvalidCrossAccountRoleException // Amazon Inspector cannot assume the cross-account role that it needs to list // your EC2 instances during the assessment run. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTarget @@ -273,26 +273,26 @@ func (c *Inspector) CreateAssessmentTemplateRequest(input *CreateAssessmentTempl // See the AWS API reference guide for Amazon Inspector's // API operation CreateAssessmentTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * 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" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateAssessmentTemplate @@ -372,26 +372,26 @@ func (c *Inspector) CreateExclusionsPreviewRequest(input *CreateExclusionsPrevie // See the AWS API reference guide for Amazon Inspector's // API operation CreateExclusionsPreview for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodePreviewGenerationInProgressException "PreviewGenerationInProgressException" +// * PreviewGenerationInProgressException // The request is rejected. The specified assessment template is currently generating // an exclusions preview. // -// * ErrCodeInternalException "InternalException" +// * InternalException // Internal server error. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateExclusionsPreview @@ -472,22 +472,22 @@ func (c *Inspector) CreateResourceGroupRequest(input *CreateResourceGroupInput) // See the AWS API reference guide for Amazon Inspector's // API operation CreateResourceGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * 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" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/CreateResourceGroup @@ -567,26 +567,26 @@ func (c *Inspector) DeleteAssessmentRunRequest(input *DeleteAssessmentRunInput) // See the AWS API reference guide for Amazon Inspector's // API operation DeleteAssessmentRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAssessmentRunInProgressException "AssessmentRunInProgressException" +// * AssessmentRunInProgressException // You cannot perform a specified action if an assessment run is currently in // progress. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentRun @@ -666,26 +666,26 @@ func (c *Inspector) DeleteAssessmentTargetRequest(input *DeleteAssessmentTargetI // See the AWS API reference guide for Amazon Inspector's // API operation DeleteAssessmentTarget for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAssessmentRunInProgressException "AssessmentRunInProgressException" +// * AssessmentRunInProgressException // You cannot perform a specified action if an assessment run is currently in // progress. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTarget @@ -765,26 +765,26 @@ func (c *Inspector) DeleteAssessmentTemplateRequest(input *DeleteAssessmentTempl // See the AWS API reference guide for Amazon Inspector's // API operation DeleteAssessmentTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAssessmentRunInProgressException "AssessmentRunInProgressException" +// * AssessmentRunInProgressException // You cannot perform a specified action if an assessment run is currently in // progress. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DeleteAssessmentTemplate @@ -863,11 +863,11 @@ func (c *Inspector) DescribeAssessmentRunsRequest(input *DescribeAssessmentRunsI // See the AWS API reference guide for Amazon Inspector's // API operation DescribeAssessmentRuns for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // @@ -947,11 +947,11 @@ func (c *Inspector) DescribeAssessmentTargetsRequest(input *DescribeAssessmentTa // See the AWS API reference guide for Amazon Inspector's // API operation DescribeAssessmentTargets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // @@ -1031,11 +1031,11 @@ func (c *Inspector) DescribeAssessmentTemplatesRequest(input *DescribeAssessment // See the AWS API reference guide for Amazon Inspector's // API operation DescribeAssessmentTemplates for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // @@ -1114,8 +1114,8 @@ func (c *Inspector) DescribeCrossAccountAccessRoleRequest(input *DescribeCrossAc // See the AWS API reference guide for Amazon Inspector's // API operation DescribeCrossAccountAccessRole for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/DescribeCrossAccountAccessRole @@ -1193,11 +1193,11 @@ func (c *Inspector) DescribeExclusionsRequest(input *DescribeExclusionsInput) (r // See the AWS API reference guide for Amazon Inspector's // API operation DescribeExclusions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // @@ -1276,11 +1276,11 @@ func (c *Inspector) DescribeFindingsRequest(input *DescribeFindingsInput) (req * // See the AWS API reference guide for Amazon Inspector's // API operation DescribeFindings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // @@ -1360,11 +1360,11 @@ func (c *Inspector) DescribeResourceGroupsRequest(input *DescribeResourceGroupsI // See the AWS API reference guide for Amazon Inspector's // API operation DescribeResourceGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // @@ -1444,11 +1444,11 @@ func (c *Inspector) DescribeRulesPackagesRequest(input *DescribeRulesPackagesInp // See the AWS API reference guide for Amazon Inspector's // API operation DescribeRulesPackages for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // @@ -1528,33 +1528,33 @@ func (c *Inspector) GetAssessmentReportRequest(input *GetAssessmentReportInput) // See the AWS API reference guide for Amazon Inspector's // API operation GetAssessmentReport for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeAssessmentRunInProgressException "AssessmentRunInProgressException" +// * AssessmentRunInProgressException // You cannot perform a specified action if an assessment run is currently in // progress. // -// * ErrCodeUnsupportedFeatureException "UnsupportedFeatureException" +// * UnsupportedFeatureException // Used by the GetAssessmentReport API. The request was rejected because you // tried to generate a report for an assessment run that existed before reporting // was supported in Amazon Inspector. You can only generate reports for assessment // runs that took place or will take place after generating reports in Amazon // Inspector became available. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/GetAssessmentReport @@ -1640,18 +1640,18 @@ func (c *Inspector) GetExclusionsPreviewRequest(input *GetExclusionsPreviewInput // See the AWS API reference guide for Amazon Inspector's // API operation GetExclusionsPreview for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeInternalException "InternalException" +// * InternalException // Internal server error. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // @@ -1720,10 +1720,12 @@ func (c *Inspector) GetExclusionsPreviewPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetExclusionsPreviewOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetExclusionsPreviewOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1781,18 +1783,18 @@ func (c *Inspector) GetTelemetryMetadataRequest(input *GetTelemetryMetadataInput // See the AWS API reference guide for Amazon Inspector's // API operation GetTelemetryMetadata for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // @@ -1878,18 +1880,18 @@ func (c *Inspector) ListAssessmentRunAgentsRequest(input *ListAssessmentRunAgent // See the AWS API reference guide for Amazon Inspector's // API operation ListAssessmentRunAgents for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // @@ -1958,10 +1960,12 @@ func (c *Inspector) ListAssessmentRunAgentsPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAssessmentRunAgentsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAssessmentRunAgentsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2025,18 +2029,18 @@ func (c *Inspector) ListAssessmentRunsRequest(input *ListAssessmentRunsInput) (r // See the AWS API reference guide for Amazon Inspector's // API operation ListAssessmentRuns for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // @@ -2105,10 +2109,12 @@ func (c *Inspector) ListAssessmentRunsPagesWithContext(ctx aws.Context, input *L }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAssessmentRunsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAssessmentRunsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2173,15 +2179,15 @@ func (c *Inspector) ListAssessmentTargetsRequest(input *ListAssessmentTargetsInp // See the AWS API reference guide for Amazon Inspector's // API operation ListAssessmentTargets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListAssessmentTargets @@ -2249,10 +2255,12 @@ func (c *Inspector) ListAssessmentTargetsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAssessmentTargetsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAssessmentTargetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2316,18 +2324,18 @@ func (c *Inspector) ListAssessmentTemplatesRequest(input *ListAssessmentTemplate // See the AWS API reference guide for Amazon Inspector's // API operation ListAssessmentTemplates for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // @@ -2396,10 +2404,12 @@ func (c *Inspector) ListAssessmentTemplatesPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAssessmentTemplatesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAssessmentTemplatesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2464,18 +2474,18 @@ func (c *Inspector) ListEventSubscriptionsRequest(input *ListEventSubscriptionsI // See the AWS API reference guide for Amazon Inspector's // API operation ListEventSubscriptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // @@ -2544,10 +2554,12 @@ func (c *Inspector) ListEventSubscriptionsPagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEventSubscriptionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListEventSubscriptionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2610,18 +2622,18 @@ func (c *Inspector) ListExclusionsRequest(input *ListExclusionsInput) (req *requ // See the AWS API reference guide for Amazon Inspector's // API operation ListExclusions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // @@ -2690,10 +2702,12 @@ func (c *Inspector) ListExclusionsPagesWithContext(ctx aws.Context, input *ListE }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListExclusionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListExclusionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2757,18 +2771,18 @@ func (c *Inspector) ListFindingsRequest(input *ListFindingsInput) (req *request. // See the AWS API reference guide for Amazon Inspector's // API operation ListFindings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // @@ -2837,10 +2851,12 @@ func (c *Inspector) ListFindingsPagesWithContext(ctx aws.Context, input *ListFin }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListFindingsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListFindingsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2903,15 +2919,15 @@ func (c *Inspector) ListRulesPackagesRequest(input *ListRulesPackagesInput) (req // See the AWS API reference guide for Amazon Inspector's // API operation ListRulesPackages for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/ListRulesPackages @@ -2979,10 +2995,12 @@ func (c *Inspector) ListRulesPackagesPagesWithContext(ctx aws.Context, input *Li }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRulesPackagesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListRulesPackagesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3039,18 +3057,18 @@ func (c *Inspector) ListTagsForResourceRequest(input *ListTagsForResourceInput) // See the AWS API reference guide for Amazon Inspector's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // @@ -3136,22 +3154,22 @@ func (c *Inspector) PreviewAgentsRequest(input *PreviewAgentsInput) (req *reques // See the AWS API reference guide for Amazon Inspector's // API operation PreviewAgents for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeInvalidCrossAccountRoleException "InvalidCrossAccountRoleException" +// * InvalidCrossAccountRoleException // Amazon Inspector cannot assume the cross-account role that it needs to list // your EC2 instances during the assessment run. // @@ -3220,10 +3238,12 @@ func (c *Inspector) PreviewAgentsPagesWithContext(ctx aws.Context, input *Previe }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*PreviewAgentsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*PreviewAgentsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3282,22 +3302,22 @@ func (c *Inspector) RegisterCrossAccountAccessRoleRequest(input *RegisterCrossAc // See the AWS API reference guide for Amazon Inspector's // API operation RegisterCrossAccountAccessRole for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeInvalidCrossAccountRoleException "InvalidCrossAccountRoleException" +// * InvalidCrossAccountRoleException // Amazon Inspector cannot assume the cross-account role that it needs to list // your EC2 instances during the assessment run. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RegisterCrossAccountAccessRole @@ -3377,22 +3397,22 @@ func (c *Inspector) RemoveAttributesFromFindingsRequest(input *RemoveAttributesF // See the AWS API reference guide for Amazon Inspector's // API operation RemoveAttributesFromFindings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/RemoveAttributesFromFindings @@ -3472,22 +3492,22 @@ func (c *Inspector) SetTagsForResourceRequest(input *SetTagsForResourceInput) (r // See the AWS API reference guide for Amazon Inspector's // API operation SetTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SetTagsForResource @@ -3567,34 +3587,34 @@ func (c *Inspector) StartAssessmentRunRequest(input *StartAssessmentRunInput) (r // See the AWS API reference guide for Amazon Inspector's // API operation StartAssessmentRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * 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" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeInvalidCrossAccountRoleException "InvalidCrossAccountRoleException" +// * InvalidCrossAccountRoleException // Amazon Inspector cannot assume the cross-account role that it needs to list // your EC2 instances during the assessment run. // -// * ErrCodeAgentsAlreadyRunningAssessmentException "AgentsAlreadyRunningAssessmentException" +// * AgentsAlreadyRunningAssessmentException // You started an assessment run, but one of the instances is already participating // in another assessment run. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StartAssessmentRun @@ -3673,22 +3693,22 @@ func (c *Inspector) StopAssessmentRunRequest(input *StopAssessmentRunInput) (req // See the AWS API reference guide for Amazon Inspector's // API operation StopAssessmentRun for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/StopAssessmentRun @@ -3768,26 +3788,26 @@ func (c *Inspector) SubscribeToEventRequest(input *SubscribeToEventInput) (req * // See the AWS API reference guide for Amazon Inspector's // API operation SubscribeToEvent for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * 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" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/SubscribeToEvent @@ -3867,22 +3887,22 @@ func (c *Inspector) UnsubscribeFromEventRequest(input *UnsubscribeFromEventInput // See the AWS API reference guide for Amazon Inspector's // API operation UnsubscribeFromEvent for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UnsubscribeFromEvent @@ -3965,22 +3985,22 @@ func (c *Inspector) UpdateAssessmentTargetRequest(input *UpdateAssessmentTargetI // See the AWS API reference guide for Amazon Inspector's // API operation UpdateAssessmentTarget for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeNoSuchEntityException "NoSuchEntityException" +// * NoSuchEntityException // The request was rejected because it referenced an entity that does not exist. // The error code describes the entity. // -// * ErrCodeServiceTemporarilyUnavailableException "ServiceTemporarilyUnavailableException" +// * ServiceTemporarilyUnavailableException // The serice is temporary unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/inspector-2016-02-16/UpdateAssessmentTarget @@ -4005,6 +4025,73 @@ func (c *Inspector) UpdateAssessmentTargetWithContext(ctx aws.Context, input *Up return out, req.Send() } +// You do not have required permissions to access the requested resource. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // You can immediately retry your request. + // + // CanRetry is a required field + CanRetry *bool `locationName:"canRetry" type:"boolean" required:"true"` + + // Code that indicates the type of error that is generated. + // + // ErrorCode is a required field + ErrorCode *string `locationName:"errorCode" type:"string" required:"true" enum:"AccessDeniedErrorCode"` + + // Details of the exception error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + type AddAttributesToFindingsInput struct { _ struct{} `type:"structure"` @@ -4283,6 +4370,75 @@ func (s *AgentPreview) SetOperatingSystem(v string) *AgentPreview { return s } +// You started an assessment run, but one of the instances is already participating +// in another assessment run. +type AgentsAlreadyRunningAssessmentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Agents is a required field + Agents []*AgentAlreadyRunningAssessment `locationName:"agents" min:"1" type:"list" required:"true"` + + // AgentsTruncated is a required field + AgentsTruncated *bool `locationName:"agentsTruncated" type:"boolean" required:"true"` + + // You can immediately retry your request. + // + // CanRetry is a required field + CanRetry *bool `locationName:"canRetry" type:"boolean" required:"true"` + + // Details of the exception error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AgentsAlreadyRunningAssessmentException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AgentsAlreadyRunningAssessmentException) GoString() string { + return s.String() +} + +func newErrorAgentsAlreadyRunningAssessmentException(v protocol.ResponseMetadata) error { + return &AgentsAlreadyRunningAssessmentException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AgentsAlreadyRunningAssessmentException) Code() string { + return "AgentsAlreadyRunningAssessmentException" +} + +// Message returns the exception's message. +func (s AgentsAlreadyRunningAssessmentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AgentsAlreadyRunningAssessmentException) OrigErr() error { + return nil +} + +func (s AgentsAlreadyRunningAssessmentException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AgentsAlreadyRunningAssessmentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AgentsAlreadyRunningAssessmentException) RequestID() string { + return s.respMetadata.RequestID +} + // A snapshot of an Amazon Inspector assessment run that contains the findings // of the assessment run . // @@ -4668,6 +4824,80 @@ func (s *AssessmentRunFilter) SetStates(v []*string) *AssessmentRunFilter { return s } +// You cannot perform a specified action if an assessment run is currently in +// progress. +type AssessmentRunInProgressException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The ARNs of the assessment runs that are currently in progress. + // + // AssessmentRunArns is a required field + AssessmentRunArns []*string `locationName:"assessmentRunArns" min:"1" type:"list" required:"true"` + + // Boolean value that indicates whether the ARN list of the assessment runs + // is truncated. + // + // AssessmentRunArnsTruncated is a required field + AssessmentRunArnsTruncated *bool `locationName:"assessmentRunArnsTruncated" type:"boolean" required:"true"` + + // You can immediately retry your request. + // + // CanRetry is a required field + CanRetry *bool `locationName:"canRetry" type:"boolean" required:"true"` + + // Details of the exception error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AssessmentRunInProgressException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssessmentRunInProgressException) GoString() string { + return s.String() +} + +func newErrorAssessmentRunInProgressException(v protocol.ResponseMetadata) error { + return &AssessmentRunInProgressException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AssessmentRunInProgressException) Code() string { + return "AssessmentRunInProgressException" +} + +// Message returns the exception's message. +func (s AssessmentRunInProgressException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AssessmentRunInProgressException) OrigErr() error { + return nil +} + +func (s AssessmentRunInProgressException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AssessmentRunInProgressException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AssessmentRunInProgressException) RequestID() string { + return s.respMetadata.RequestID +} + // Used as one of the elements of the AssessmentRun data type. type AssessmentRunNotification struct { _ struct{} `type:"structure"` @@ -7297,6 +7527,272 @@ func (s *GetTelemetryMetadataOutput) SetTelemetryMetadata(v []*TelemetryMetadata return s } +// Internal server error. +type InternalException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // You can immediately retry your request. + // + // CanRetry is a required field + CanRetry *bool `locationName:"canRetry" type:"boolean" required:"true"` + + // Details of the exception error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalException) GoString() string { + return s.String() +} + +func newErrorInternalException(v protocol.ResponseMetadata) error { + return &InternalException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalException) Code() string { + return "InternalException" +} + +// Message returns the exception's message. +func (s InternalException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalException) OrigErr() error { + return nil +} + +func (s InternalException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalException) RequestID() string { + return s.respMetadata.RequestID +} + +// Amazon Inspector cannot assume the cross-account role that it needs to list +// your EC2 instances during the assessment run. +type InvalidCrossAccountRoleException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // You can immediately retry your request. + // + // CanRetry is a required field + CanRetry *bool `locationName:"canRetry" type:"boolean" required:"true"` + + // Code that indicates the type of error that is generated. + // + // ErrorCode is a required field + ErrorCode *string `locationName:"errorCode" type:"string" required:"true" enum:"InvalidCrossAccountRoleErrorCode"` + + // Details of the exception error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidCrossAccountRoleException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidCrossAccountRoleException) GoString() string { + return s.String() +} + +func newErrorInvalidCrossAccountRoleException(v protocol.ResponseMetadata) error { + return &InvalidCrossAccountRoleException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidCrossAccountRoleException) Code() string { + return "InvalidCrossAccountRoleException" +} + +// Message returns the exception's message. +func (s InvalidCrossAccountRoleException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidCrossAccountRoleException) OrigErr() error { + return nil +} + +func (s InvalidCrossAccountRoleException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidCrossAccountRoleException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidCrossAccountRoleException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +type InvalidInputException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // You can immediately retry your request. + // + // CanRetry is a required field + CanRetry *bool `locationName:"canRetry" type:"boolean" required:"true"` + + // Code that indicates the type of error that is generated. + // + // ErrorCode is a required field + ErrorCode *string `locationName:"errorCode" type:"string" required:"true" enum:"InvalidInputErrorCode"` + + // Details of the exception error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidInputException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInputException) GoString() string { + return s.String() +} + +func newErrorInvalidInputException(v protocol.ResponseMetadata) error { + return &InvalidInputException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInputException) Code() string { + return "InvalidInputException" +} + +// Message returns the exception's message. +func (s InvalidInputException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInputException) OrigErr() error { + return nil +} + +func (s InvalidInputException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInputException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInputException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error code describes the limit exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // You can immediately retry your request. + // + // CanRetry is a required field + CanRetry *bool `locationName:"canRetry" type:"boolean" required:"true"` + + // Code that indicates the type of error that is generated. + // + // ErrorCode is a required field + ErrorCode *string `locationName:"errorCode" type:"string" required:"true" enum:"LimitExceededErrorCode"` + + // Details of the exception error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListAssessmentRunAgentsInput struct { _ struct{} `type:"structure"` @@ -8335,6 +8831,74 @@ func (s *NetworkInterface) SetVpcId(v string) *NetworkInterface { return s } +// The request was rejected because it referenced an entity that does not exist. +// The error code describes the entity. +type NoSuchEntityException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // You can immediately retry your request. + // + // CanRetry is a required field + CanRetry *bool `locationName:"canRetry" type:"boolean" required:"true"` + + // Code that indicates the type of error that is generated. + // + // ErrorCode is a required field + ErrorCode *string `locationName:"errorCode" type:"string" required:"true" enum:"NoSuchEntityErrorCode"` + + // Details of the exception error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NoSuchEntityException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NoSuchEntityException) GoString() string { + return s.String() +} + +func newErrorNoSuchEntityException(v protocol.ResponseMetadata) error { + return &NoSuchEntityException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NoSuchEntityException) Code() string { + return "NoSuchEntityException" +} + +// Message returns the exception's message. +func (s NoSuchEntityException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoSuchEntityException) OrigErr() error { + return nil +} + +func (s NoSuchEntityException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NoSuchEntityException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NoSuchEntityException) RequestID() string { + return s.respMetadata.RequestID +} + type PreviewAgentsInput struct { _ struct{} `type:"structure"` @@ -8438,6 +9002,63 @@ func (s *PreviewAgentsOutput) SetNextToken(v string) *PreviewAgentsOutput { return s } +// The request is rejected. The specified assessment template is currently generating +// an exclusions preview. +type PreviewGenerationInProgressException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PreviewGenerationInProgressException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PreviewGenerationInProgressException) GoString() string { + return s.String() +} + +func newErrorPreviewGenerationInProgressException(v protocol.ResponseMetadata) error { + return &PreviewGenerationInProgressException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PreviewGenerationInProgressException) Code() string { + return "PreviewGenerationInProgressException" +} + +// Message returns the exception's message. +func (s PreviewGenerationInProgressException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PreviewGenerationInProgressException) OrigErr() error { + return nil +} + +func (s PreviewGenerationInProgressException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PreviewGenerationInProgressException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PreviewGenerationInProgressException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains information about a private IP address associated with a network // interface. This data type is used as a response element in the DescribeFindings // action. @@ -8897,6 +9518,68 @@ func (s *ServiceAttributes) SetSchemaVersion(v int64) *ServiceAttributes { return s } +// The serice is temporary unavailable. +type ServiceTemporarilyUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // You can wait and then retry your request. + // + // CanRetry is a required field + CanRetry *bool `locationName:"canRetry" type:"boolean" required:"true"` + + // Details of the exception error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceTemporarilyUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceTemporarilyUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceTemporarilyUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceTemporarilyUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceTemporarilyUnavailableException) Code() string { + return "ServiceTemporarilyUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceTemporarilyUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceTemporarilyUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceTemporarilyUnavailableException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceTemporarilyUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceTemporarilyUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + type SetTagsForResourceInput struct { _ struct{} `type:"structure"` @@ -9482,6 +10165,69 @@ func (s UnsubscribeFromEventOutput) GoString() string { return s.String() } +// Used by the GetAssessmentReport API. The request was rejected because you +// tried to generate a report for an assessment run that existed before reporting +// was supported in Amazon Inspector. You can only generate reports for assessment +// runs that took place or will take place after generating reports in Amazon +// Inspector became available. +type UnsupportedFeatureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // CanRetry is a required field + CanRetry *bool `locationName:"canRetry" type:"boolean" required:"true"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedFeatureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedFeatureException) GoString() string { + return s.String() +} + +func newErrorUnsupportedFeatureException(v protocol.ResponseMetadata) error { + return &UnsupportedFeatureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedFeatureException) Code() string { + return "UnsupportedFeatureException" +} + +// Message returns the exception's message. +func (s UnsupportedFeatureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedFeatureException) OrigErr() error { + return nil +} + +func (s UnsupportedFeatureException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedFeatureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedFeatureException) RequestID() string { + return s.respMetadata.RequestID +} + type UpdateAssessmentTargetInput struct { _ struct{} `type:"structure"` 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 index 9e106a58743..6fd98d37f6c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/inspector/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/inspector/errors.go @@ -2,6 +2,10 @@ package inspector +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccessDeniedException for service response error code @@ -81,3 +85,17 @@ const ( // Inspector became available. ErrCodeUnsupportedFeatureException = "UnsupportedFeatureException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "AgentsAlreadyRunningAssessmentException": newErrorAgentsAlreadyRunningAssessmentException, + "AssessmentRunInProgressException": newErrorAssessmentRunInProgressException, + "InternalException": newErrorInternalException, + "InvalidCrossAccountRoleException": newErrorInvalidCrossAccountRoleException, + "InvalidInputException": newErrorInvalidInputException, + "LimitExceededException": newErrorLimitExceededException, + "NoSuchEntityException": newErrorNoSuchEntityException, + "PreviewGenerationInProgressException": newErrorPreviewGenerationInProgressException, + "ServiceTemporarilyUnavailableException": newErrorServiceTemporarilyUnavailableException, + "UnsupportedFeatureException": newErrorUnsupportedFeatureException, +} 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 index 2e68b4e4d23..e3d77114af2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/inspector/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/inspector/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "inspector" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Inspector" // ServiceID is a unique identifer of a specific service. + ServiceID = "Inspector" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Inspector client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Inspector client from just a session. // svc := inspector.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Inspector { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Inspector { svc := &Inspector{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-02-16", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/iot/api.go b/vendor/github.com/aws/aws-sdk-go/service/iot/api.go index 3e371ea9820..2d3ff733cd8 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iot/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iot/api.go @@ -69,27 +69,27 @@ func (c *IoT) AcceptCertificateTransferRequest(input *AcceptCertificateTransferI // See the AWS API reference guide for AWS IoT's // API operation AcceptCertificateTransfer for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeTransferAlreadyCompletedException "TransferAlreadyCompletedException" +// * TransferAlreadyCompletedException // You can't revert the certificate transfer because the transfer is already // complete. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) AcceptCertificateTransfer(input *AcceptCertificateTransferInput) (*AcceptCertificateTransferOutput, error) { @@ -165,17 +165,17 @@ func (c *IoT) AddThingToBillingGroupRequest(input *AddThingToBillingGroupInput) // See the AWS API reference guide for AWS IoT's // API operation AddThingToBillingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) AddThingToBillingGroup(input *AddThingToBillingGroupInput) (*AddThingToBillingGroupOutput, error) { @@ -251,17 +251,17 @@ func (c *IoT) AddThingToThingGroupRequest(input *AddThingToThingGroupInput) (req // See the AWS API reference guide for AWS IoT's // API operation AddThingToThingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) AddThingToThingGroup(input *AddThingToThingGroupInput) (*AddThingToThingGroupOutput, error) { @@ -344,20 +344,20 @@ func (c *IoT) AssociateTargetsWithJobRequest(input *AssociateTargetsWithJobInput // See the AWS API reference guide for AWS IoT's // API operation AssociateTargetsWithJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) AssociateTargetsWithJob(input *AssociateTargetsWithJobInput) (*AssociateTargetsWithJobOutput, error) { @@ -433,26 +433,26 @@ func (c *IoT) AttachPolicyRequest(input *AttachPolicyInput) (req *request.Reques // See the AWS API reference guide for AWS IoT's // API operation AttachPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // func (c *IoT) AttachPolicy(input *AttachPolicyInput) (*AttachPolicyOutput, error) { @@ -536,26 +536,26 @@ func (c *IoT) AttachPrincipalPolicyRequest(input *AttachPrincipalPolicyInput) (r // See the AWS API reference guide for AWS IoT's // API operation AttachPrincipalPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // // @@ -637,24 +637,24 @@ func (c *IoT) AttachSecurityProfileRequest(input *AttachSecurityProfileInput) (r // See the AWS API reference guide for AWS IoT's // API operation AttachSecurityProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // -// * ErrCodeVersionConflictException "VersionConflictException" +// * VersionConflictException // An exception thrown when the version of an entity specified with the expectedVersion // parameter does not match the latest version in the system. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) AttachSecurityProfile(input *AttachSecurityProfileInput) (*AttachSecurityProfileOutput, error) { @@ -732,23 +732,23 @@ func (c *IoT) AttachThingPrincipalRequest(input *AttachThingPrincipalInput) (req // See the AWS API reference guide for AWS IoT's // API operation AttachThingPrincipal for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) AttachThingPrincipal(input *AttachThingPrincipalInput) (*AttachThingPrincipalOutput, error) { @@ -825,17 +825,17 @@ func (c *IoT) CancelAuditMitigationActionsTaskRequest(input *CancelAuditMitigati // See the AWS API reference guide for AWS IoT's // API operation CancelAuditMitigationActionsTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) CancelAuditMitigationActionsTask(input *CancelAuditMitigationActionsTaskInput) (*CancelAuditMitigationActionsTaskOutput, error) { @@ -913,17 +913,17 @@ func (c *IoT) CancelAuditTaskRequest(input *CancelAuditTaskInput) (req *request. // See the AWS API reference guide for AWS IoT's // API operation CancelAuditTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) CancelAuditTask(input *CancelAuditTaskInput) (*CancelAuditTaskOutput, error) { @@ -1008,27 +1008,27 @@ func (c *IoT) CancelCertificateTransferRequest(input *CancelCertificateTransferI // See the AWS API reference guide for AWS IoT's // API operation CancelCertificateTransfer for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeTransferAlreadyCompletedException "TransferAlreadyCompletedException" +// * TransferAlreadyCompletedException // You can't revert the certificate transfer because the transfer is already // complete. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) CancelCertificateTransfer(input *CancelCertificateTransferInput) (*CancelCertificateTransferOutput, error) { @@ -1103,17 +1103,17 @@ func (c *IoT) CancelJobRequest(input *CancelJobInput) (req *request.Request, out // See the AWS API reference guide for AWS IoT's // API operation CancelJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) CancelJob(input *CancelJobInput) (*CancelJobOutput, error) { @@ -1189,25 +1189,25 @@ func (c *IoT) CancelJobExecutionRequest(input *CancelJobExecutionInput) (req *re // See the AWS API reference guide for AWS IoT's // API operation CancelJobExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeInvalidStateTransitionException "InvalidStateTransitionException" +// * InvalidStateTransitionException // An attempt was made to change to an invalid state, for example by deleting // a job or a job execution which is "IN_PROGRESS" without setting the force // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeVersionConflictException "VersionConflictException" +// * VersionConflictException // An exception thrown when the version of an entity specified with the expectedVersion // parameter does not match the latest version in the system. // @@ -1284,23 +1284,23 @@ func (c *IoT) ClearDefaultAuthorizerRequest(input *ClearDefaultAuthorizerInput) // See the AWS API reference guide for AWS IoT's // API operation ClearDefaultAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ClearDefaultAuthorizer(input *ClearDefaultAuthorizerInput) (*ClearDefaultAuthorizerOutput, error) { @@ -1324,6 +1324,99 @@ func (c *IoT) ClearDefaultAuthorizerWithContext(ctx aws.Context, input *ClearDef return out, req.Send() } +const opConfirmTopicRuleDestination = "ConfirmTopicRuleDestination" + +// ConfirmTopicRuleDestinationRequest generates a "aws/request.Request" representing the +// client's request for the ConfirmTopicRuleDestination operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ConfirmTopicRuleDestination for more information on using the ConfirmTopicRuleDestination +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ConfirmTopicRuleDestinationRequest method. +// req, resp := client.ConfirmTopicRuleDestinationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) ConfirmTopicRuleDestinationRequest(input *ConfirmTopicRuleDestinationInput) (req *request.Request, output *ConfirmTopicRuleDestinationOutput) { + op := &request.Operation{ + Name: opConfirmTopicRuleDestination, + HTTPMethod: "GET", + HTTPPath: "/confirmdestination/{confirmationToken+}", + } + + if input == nil { + input = &ConfirmTopicRuleDestinationInput{} + } + + output = &ConfirmTopicRuleDestinationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// ConfirmTopicRuleDestination API operation for AWS IoT. +// +// Confirms a topic rule destination. When you create a rule requiring a destination, +// AWS IoT sends a confirmation message to the endpoint or base address you +// specify. The message includes a token which you pass back when calling ConfirmTopicRuleDestination +// to confirm that you own or have access to 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 IoT's +// API operation ConfirmTopicRuleDestination for usage and error information. +// +// Returned Error Types: +// * InternalException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * ServiceUnavailableException +// The service is temporarily unavailable. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * ConflictingResourceUpdateException +// A conflicting resource update exception. This exception is thrown when two +// pending updates cause a conflict. +// +func (c *IoT) ConfirmTopicRuleDestination(input *ConfirmTopicRuleDestinationInput) (*ConfirmTopicRuleDestinationOutput, error) { + req, out := c.ConfirmTopicRuleDestinationRequest(input) + return out, req.Send() +} + +// ConfirmTopicRuleDestinationWithContext is the same as ConfirmTopicRuleDestination with the addition of +// the ability to pass a context and additional request options. +// +// See ConfirmTopicRuleDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) ConfirmTopicRuleDestinationWithContext(ctx aws.Context, input *ConfirmTopicRuleDestinationInput, opts ...request.Option) (*ConfirmTopicRuleDestinationOutput, error) { + req, out := c.ConfirmTopicRuleDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateAuthorizer = "CreateAuthorizer" // CreateAuthorizerRequest generates a "aws/request.Request" representing the @@ -1375,26 +1468,26 @@ func (c *IoT) CreateAuthorizerRequest(input *CreateAuthorizerInput) (req *reques // See the AWS API reference guide for AWS IoT's // API operation CreateAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// Returned Error Types: +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) CreateAuthorizer(input *CreateAuthorizerInput) (*CreateAuthorizerOutput, error) { @@ -1469,17 +1562,17 @@ func (c *IoT) CreateBillingGroupRequest(input *CreateBillingGroupInput) (req *re // See the AWS API reference guide for AWS IoT's // API operation CreateBillingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) CreateBillingGroup(input *CreateBillingGroupInput) (*CreateBillingGroupOutput, error) { @@ -1595,20 +1688,20 @@ func (c *IoT) CreateCertificateFromCsrRequest(input *CreateCertificateFromCsrInp // See the AWS API reference guide for AWS IoT's // API operation CreateCertificateFromCsr for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) CreateCertificateFromCsr(input *CreateCertificateFromCsrInput) (*CreateCertificateFromCsrOutput, error) { @@ -1632,6 +1725,105 @@ func (c *IoT) CreateCertificateFromCsrWithContext(ctx aws.Context, input *Create return out, req.Send() } +const opCreateDomainConfiguration = "CreateDomainConfiguration" + +// CreateDomainConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the CreateDomainConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateDomainConfiguration for more information on using the CreateDomainConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateDomainConfigurationRequest method. +// req, resp := client.CreateDomainConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) CreateDomainConfigurationRequest(input *CreateDomainConfigurationInput) (req *request.Request, output *CreateDomainConfigurationOutput) { + op := &request.Operation{ + Name: opCreateDomainConfiguration, + HTTPMethod: "POST", + HTTPPath: "/domainConfigurations/{domainConfigurationName}", + } + + if input == nil { + input = &CreateDomainConfigurationInput{} + } + + output = &CreateDomainConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateDomainConfiguration API operation for AWS IoT. +// +// Creates a domain configuration. +// +// The domain configuration feature is in public preview and is subject to 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 IoT's +// API operation CreateDomainConfiguration for usage and error information. +// +// Returned Error Types: +// * LimitExceededException +// A limit has been exceeded. +// +// * CertificateValidationException +// The certificate is invalid. +// +// * ResourceAlreadyExistsException +// The resource already exists. +// +// * ServiceUnavailableException +// The service is temporarily unavailable. +// +// * InternalFailureException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * ThrottlingException +// The rate exceeds the limit. +// +func (c *IoT) CreateDomainConfiguration(input *CreateDomainConfigurationInput) (*CreateDomainConfigurationOutput, error) { + req, out := c.CreateDomainConfigurationRequest(input) + return out, req.Send() +} + +// CreateDomainConfigurationWithContext is the same as CreateDomainConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDomainConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) CreateDomainConfigurationWithContext(ctx aws.Context, input *CreateDomainConfigurationInput, opts ...request.Option) (*CreateDomainConfigurationOutput, error) { + req, out := c.CreateDomainConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateDynamicThingGroup = "CreateDynamicThingGroup" // CreateDynamicThingGroupRequest generates a "aws/request.Request" representing the @@ -1683,26 +1875,26 @@ func (c *IoT) CreateDynamicThingGroupRequest(input *CreateDynamicThingGroupInput // See the AWS API reference guide for AWS IoT's // API operation CreateDynamicThingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeInvalidQueryException "InvalidQueryException" +// * InvalidQueryException // The query is invalid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // func (c *IoT) CreateDynamicThingGroup(input *CreateDynamicThingGroupInput) (*CreateDynamicThingGroupOutput, error) { @@ -1777,23 +1969,23 @@ func (c *IoT) CreateJobRequest(input *CreateJobInput) (req *request.Request, out // See the AWS API reference guide for AWS IoT's // API operation CreateJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) CreateJob(input *CreateJobInput) (*CreateJobOutput, error) { @@ -1860,7 +2052,8 @@ func (c *IoT) CreateKeysAndCertificateRequest(input *CreateKeysAndCertificateInp // CreateKeysAndCertificate API operation for AWS IoT. // // Creates a 2048-bit RSA key pair and issues an X.509 certificate using the -// issued public key. +// issued public key. You can also call CreateKeysAndCertificate over MQTT from +// a device, for more information, see Provisioning MQTT API (https://docs.aws.amazon.com/iot/latest/developerguide/provision-wo-cert.html#provision-mqtt-api). // // Note This is the only time AWS IoT issues the private key for this certificate, // so it is important to keep it in a secure location. @@ -1872,20 +2065,20 @@ func (c *IoT) CreateKeysAndCertificateRequest(input *CreateKeysAndCertificateInp // See the AWS API reference guide for AWS IoT's // API operation CreateKeysAndCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) CreateKeysAndCertificate(input *CreateKeysAndCertificateInput) (*CreateKeysAndCertificateOutput, error) { @@ -1961,20 +2154,20 @@ func (c *IoT) CreateMitigationActionRequest(input *CreateMitigationActionInput) // See the AWS API reference guide for AWS IoT's // API operation CreateMitigationAction for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) CreateMitigationAction(input *CreateMitigationActionInput) (*CreateMitigationActionOutput, error) { @@ -2049,29 +2242,29 @@ func (c *IoT) CreateOTAUpdateRequest(input *CreateOTAUpdateInput) (req *request. // See the AWS API reference guide for AWS IoT's // API operation CreateOTAUpdate for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) CreateOTAUpdate(input *CreateOTAUpdateInput) (*CreateOTAUpdateOutput, error) { @@ -2150,26 +2343,26 @@ func (c *IoT) CreatePolicyRequest(input *CreatePolicyInput) (req *request.Reques // See the AWS API reference guide for AWS IoT's // API operation CreatePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// Returned Error Types: +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeMalformedPolicyException "MalformedPolicyException" +// * MalformedPolicyException // The policy documentation is not valid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) CreatePolicy(input *CreatePolicyInput) (*CreatePolicyOutput, error) { @@ -2251,29 +2444,29 @@ func (c *IoT) CreatePolicyVersionRequest(input *CreatePolicyVersionInput) (req * // See the AWS API reference guide for AWS IoT's // API operation CreatePolicyVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeMalformedPolicyException "MalformedPolicyException" +// * MalformedPolicyException // The policy documentation is not valid. // -// * ErrCodeVersionsLimitExceededException "VersionsLimitExceededException" +// * VersionsLimitExceededException // The number of policy versions exceeds the limit. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) CreatePolicyVersion(input *CreatePolicyVersionInput) (*CreatePolicyVersionOutput, error) { @@ -2297,6 +2490,283 @@ func (c *IoT) CreatePolicyVersionWithContext(ctx aws.Context, input *CreatePolic return out, req.Send() } +const opCreateProvisioningClaim = "CreateProvisioningClaim" + +// CreateProvisioningClaimRequest generates a "aws/request.Request" representing the +// client's request for the CreateProvisioningClaim operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateProvisioningClaim for more information on using the CreateProvisioningClaim +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateProvisioningClaimRequest method. +// req, resp := client.CreateProvisioningClaimRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) CreateProvisioningClaimRequest(input *CreateProvisioningClaimInput) (req *request.Request, output *CreateProvisioningClaimOutput) { + op := &request.Operation{ + Name: opCreateProvisioningClaim, + HTTPMethod: "POST", + HTTPPath: "/provisioning-templates/{templateName}/provisioning-claim", + } + + if input == nil { + input = &CreateProvisioningClaimInput{} + } + + output = &CreateProvisioningClaimOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateProvisioningClaim API operation for AWS IoT. +// +// Creates a provisioning claim. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS IoT's +// API operation CreateProvisioningClaim for usage and error information. +// +// Returned Error Types: +// * InvalidRequestException +// The request is not valid. +// +// * ResourceNotFoundException +// The specified resource does not exist. +// +// * ThrottlingException +// The rate exceeds the limit. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * ServiceUnavailableException +// The service is temporarily unavailable. +// +// * InternalFailureException +// An unexpected error has occurred. +// +func (c *IoT) CreateProvisioningClaim(input *CreateProvisioningClaimInput) (*CreateProvisioningClaimOutput, error) { + req, out := c.CreateProvisioningClaimRequest(input) + return out, req.Send() +} + +// CreateProvisioningClaimWithContext is the same as CreateProvisioningClaim with the addition of +// the ability to pass a context and additional request options. +// +// See CreateProvisioningClaim for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) CreateProvisioningClaimWithContext(ctx aws.Context, input *CreateProvisioningClaimInput, opts ...request.Option) (*CreateProvisioningClaimOutput, error) { + req, out := c.CreateProvisioningClaimRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateProvisioningTemplate = "CreateProvisioningTemplate" + +// CreateProvisioningTemplateRequest generates a "aws/request.Request" representing the +// client's request for the CreateProvisioningTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateProvisioningTemplate for more information on using the CreateProvisioningTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateProvisioningTemplateRequest method. +// req, resp := client.CreateProvisioningTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) CreateProvisioningTemplateRequest(input *CreateProvisioningTemplateInput) (req *request.Request, output *CreateProvisioningTemplateOutput) { + op := &request.Operation{ + Name: opCreateProvisioningTemplate, + HTTPMethod: "POST", + HTTPPath: "/provisioning-templates", + } + + if input == nil { + input = &CreateProvisioningTemplateInput{} + } + + output = &CreateProvisioningTemplateOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateProvisioningTemplate API operation for AWS IoT. +// +// Creates a fleet provisioning 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 IoT's +// API operation CreateProvisioningTemplate for usage and error information. +// +// Returned Error Types: +// * InternalFailureException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * LimitExceededException +// A limit has been exceeded. +// +// * ThrottlingException +// The rate exceeds the limit. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * ResourceAlreadyExistsException +// The resource already exists. +// +func (c *IoT) CreateProvisioningTemplate(input *CreateProvisioningTemplateInput) (*CreateProvisioningTemplateOutput, error) { + req, out := c.CreateProvisioningTemplateRequest(input) + return out, req.Send() +} + +// CreateProvisioningTemplateWithContext is the same as CreateProvisioningTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See CreateProvisioningTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) CreateProvisioningTemplateWithContext(ctx aws.Context, input *CreateProvisioningTemplateInput, opts ...request.Option) (*CreateProvisioningTemplateOutput, error) { + req, out := c.CreateProvisioningTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateProvisioningTemplateVersion = "CreateProvisioningTemplateVersion" + +// CreateProvisioningTemplateVersionRequest generates a "aws/request.Request" representing the +// client's request for the CreateProvisioningTemplateVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateProvisioningTemplateVersion for more information on using the CreateProvisioningTemplateVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateProvisioningTemplateVersionRequest method. +// req, resp := client.CreateProvisioningTemplateVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) CreateProvisioningTemplateVersionRequest(input *CreateProvisioningTemplateVersionInput) (req *request.Request, output *CreateProvisioningTemplateVersionOutput) { + op := &request.Operation{ + Name: opCreateProvisioningTemplateVersion, + HTTPMethod: "POST", + HTTPPath: "/provisioning-templates/{templateName}/versions", + } + + if input == nil { + input = &CreateProvisioningTemplateVersionInput{} + } + + output = &CreateProvisioningTemplateVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateProvisioningTemplateVersion API operation for AWS IoT. +// +// Creates a new version of a fleet provisioning 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 IoT's +// API operation CreateProvisioningTemplateVersion for usage and error information. +// +// Returned Error Types: +// * VersionsLimitExceededException +// The number of policy versions exceeds the limit. +// +// * InternalFailureException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * ThrottlingException +// The rate exceeds the limit. +// +// * ResourceNotFoundException +// The specified resource does not exist. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * ConflictingResourceUpdateException +// A conflicting resource update exception. This exception is thrown when two +// pending updates cause a conflict. +// +func (c *IoT) CreateProvisioningTemplateVersion(input *CreateProvisioningTemplateVersionInput) (*CreateProvisioningTemplateVersionOutput, error) { + req, out := c.CreateProvisioningTemplateVersionRequest(input) + return out, req.Send() +} + +// CreateProvisioningTemplateVersionWithContext is the same as CreateProvisioningTemplateVersion with the addition of +// the ability to pass a context and additional request options. +// +// See CreateProvisioningTemplateVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) CreateProvisioningTemplateVersionWithContext(ctx aws.Context, input *CreateProvisioningTemplateVersionInput, opts ...request.Option) (*CreateProvisioningTemplateVersionOutput, error) { + req, out := c.CreateProvisioningTemplateVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateRoleAlias = "CreateRoleAlias" // CreateRoleAliasRequest generates a "aws/request.Request" representing the @@ -2348,26 +2818,26 @@ func (c *IoT) CreateRoleAliasRequest(input *CreateRoleAliasInput) (req *request. // See the AWS API reference guide for AWS IoT's // API operation CreateRoleAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// Returned Error Types: +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) CreateRoleAlias(input *CreateRoleAliasInput) (*CreateRoleAliasOutput, error) { @@ -2442,20 +2912,20 @@ func (c *IoT) CreateScheduledAuditRequest(input *CreateScheduledAuditInput) (req // See the AWS API reference guide for AWS IoT's // API operation CreateScheduledAudit for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // func (c *IoT) CreateScheduledAudit(input *CreateScheduledAuditInput) (*CreateScheduledAuditOutput, error) { @@ -2530,17 +3000,17 @@ func (c *IoT) CreateSecurityProfileRequest(input *CreateSecurityProfileInput) (r // See the AWS API reference guide for AWS IoT's // API operation CreateSecurityProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) CreateSecurityProfile(input *CreateSecurityProfileInput) (*CreateSecurityProfileOutput, error) { @@ -2609,10 +3079,6 @@ func (c *IoT) CreateStreamRequest(input *CreateStreamInput) (req *request.Reques // Creates a stream for delivering one or more large files in chunks over MQTT. // A stream transports data bytes in chunks or blocks packaged as MQTT messages // from a source like S3. You can have one or more files associated with a stream. -// The total size of a file associated with the stream cannot exceed more than -// 2 MB. The stream will be created with version 0. If a stream is created with -// the same streamID as a stream that existed and was deleted within last 90 -// days, we will resurrect that old stream by incrementing the version 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 @@ -2621,29 +3087,29 @@ func (c *IoT) CreateStreamRequest(input *CreateStreamInput) (req *request.Reques // See the AWS API reference guide for AWS IoT's // API operation CreateStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) CreateStream(input *CreateStreamInput) (*CreateStreamOutput, error) { @@ -2724,26 +3190,26 @@ func (c *IoT) CreateThingRequest(input *CreateThingInput) (req *request.Request, // See the AWS API reference guide for AWS IoT's // API operation CreateThing for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) CreateThing(input *CreateThingInput) (*CreateThingOutput, error) { @@ -2821,17 +3287,17 @@ func (c *IoT) CreateThingGroupRequest(input *CreateThingGroupInput) (req *reques // See the AWS API reference guide for AWS IoT's // API operation CreateThingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) CreateThingGroup(input *CreateThingGroupInput) (*CreateThingGroupOutput, error) { @@ -2906,23 +3372,23 @@ func (c *IoT) CreateThingTypeRequest(input *CreateThingTypeInput) (req *request. // See the AWS API reference guide for AWS IoT's // API operation CreateThingType for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // func (c *IoT) CreateThingType(input *CreateThingTypeInput) (*CreateThingTypeOutput, error) { @@ -3000,23 +3466,23 @@ func (c *IoT) CreateTopicRuleRequest(input *CreateTopicRuleInput) (req *request. // See the AWS API reference guide for AWS IoT's // API operation CreateTopicRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeSqlParseException "SqlParseException" +// Returned Error Types: +// * SqlParseException // The Rule-SQL expression can't be parsed correctly. // -// * ErrCodeInternalException "InternalException" +// * InternalException // An unexpected error has occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeConflictingResourceUpdateException "ConflictingResourceUpdateException" +// * ConflictingResourceUpdateException // A conflicting resource update exception. This exception is thrown when two // pending updates cause a conflict. // @@ -3041,6 +3507,96 @@ func (c *IoT) CreateTopicRuleWithContext(ctx aws.Context, input *CreateTopicRule return out, req.Send() } +const opCreateTopicRuleDestination = "CreateTopicRuleDestination" + +// CreateTopicRuleDestinationRequest generates a "aws/request.Request" representing the +// client's request for the CreateTopicRuleDestination operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateTopicRuleDestination for more information on using the CreateTopicRuleDestination +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateTopicRuleDestinationRequest method. +// req, resp := client.CreateTopicRuleDestinationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) CreateTopicRuleDestinationRequest(input *CreateTopicRuleDestinationInput) (req *request.Request, output *CreateTopicRuleDestinationOutput) { + op := &request.Operation{ + Name: opCreateTopicRuleDestination, + HTTPMethod: "POST", + HTTPPath: "/destinations", + } + + if input == nil { + input = &CreateTopicRuleDestinationInput{} + } + + output = &CreateTopicRuleDestinationOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateTopicRuleDestination API operation for AWS IoT. +// +// Creates a topic rule destination. The destination must be confirmed prior +// to 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 IoT's +// API operation CreateTopicRuleDestination for usage and error information. +// +// Returned Error Types: +// * InternalException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * ResourceAlreadyExistsException +// The resource already exists. +// +// * ServiceUnavailableException +// The service is temporarily unavailable. +// +// * ConflictingResourceUpdateException +// A conflicting resource update exception. This exception is thrown when two +// pending updates cause a conflict. +// +func (c *IoT) CreateTopicRuleDestination(input *CreateTopicRuleDestinationInput) (*CreateTopicRuleDestinationOutput, error) { + req, out := c.CreateTopicRuleDestinationRequest(input) + return out, req.Send() +} + +// CreateTopicRuleDestinationWithContext is the same as CreateTopicRuleDestination with the addition of +// the ability to pass a context and additional request options. +// +// See CreateTopicRuleDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) CreateTopicRuleDestinationWithContext(ctx aws.Context, input *CreateTopicRuleDestinationInput, opts ...request.Option) (*CreateTopicRuleDestinationOutput, error) { + req, out := c.CreateTopicRuleDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteAccountAuditConfiguration = "DeleteAccountAuditConfiguration" // DeleteAccountAuditConfigurationRequest generates a "aws/request.Request" representing the @@ -3095,17 +3651,17 @@ func (c *IoT) DeleteAccountAuditConfigurationRequest(input *DeleteAccountAuditCo // See the AWS API reference guide for AWS IoT's // API operation DeleteAccountAuditConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DeleteAccountAuditConfiguration(input *DeleteAccountAuditConfigurationInput) (*DeleteAccountAuditConfigurationOutput, error) { @@ -3181,26 +3737,26 @@ func (c *IoT) DeleteAuthorizerRequest(input *DeleteAuthorizerInput) (req *reques // See the AWS API reference guide for AWS IoT's // API operation DeleteAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeDeleteConflictException "DeleteConflictException" +// Returned Error Types: +// * DeleteConflictException // You can't delete the resource because it is attached to one or more resources. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DeleteAuthorizer(input *DeleteAuthorizerInput) (*DeleteAuthorizerOutput, error) { @@ -3276,18 +3832,18 @@ func (c *IoT) DeleteBillingGroupRequest(input *DeleteBillingGroupInput) (req *re // See the AWS API reference guide for AWS IoT's // API operation DeleteBillingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeVersionConflictException "VersionConflictException" +// * VersionConflictException // An exception thrown when the version of an entity specified with the expectedVersion // parameter does not match the latest version in the system. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DeleteBillingGroup(input *DeleteBillingGroupInput) (*DeleteBillingGroupOutput, error) { @@ -3363,26 +3919,26 @@ func (c *IoT) DeleteCACertificateRequest(input *DeleteCACertificateInput) (req * // See the AWS API reference guide for AWS IoT's // API operation DeleteCACertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeCertificateStateException "CertificateStateException" +// * CertificateStateException // The certificate operation is not allowed. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) DeleteCACertificate(input *DeleteCACertificateInput) (*DeleteCACertificateOutput, error) { @@ -3463,29 +4019,29 @@ func (c *IoT) DeleteCertificateRequest(input *DeleteCertificateInput) (req *requ // See the AWS API reference guide for AWS IoT's // API operation DeleteCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeCertificateStateException "CertificateStateException" +// Returned Error Types: +// * CertificateStateException // The certificate operation is not allowed. // -// * ErrCodeDeleteConflictException "DeleteConflictException" +// * DeleteConflictException // You can't delete the resource because it is attached to one or more resources. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) DeleteCertificate(input *DeleteCertificateInput) (*DeleteCertificateOutput, error) { @@ -3509,6 +4065,100 @@ func (c *IoT) DeleteCertificateWithContext(ctx aws.Context, input *DeleteCertifi return out, req.Send() } +const opDeleteDomainConfiguration = "DeleteDomainConfiguration" + +// DeleteDomainConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteDomainConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteDomainConfiguration for more information on using the DeleteDomainConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteDomainConfigurationRequest method. +// req, resp := client.DeleteDomainConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) DeleteDomainConfigurationRequest(input *DeleteDomainConfigurationInput) (req *request.Request, output *DeleteDomainConfigurationOutput) { + op := &request.Operation{ + Name: opDeleteDomainConfiguration, + HTTPMethod: "DELETE", + HTTPPath: "/domainConfigurations/{domainConfigurationName}", + } + + if input == nil { + input = &DeleteDomainConfigurationInput{} + } + + output = &DeleteDomainConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteDomainConfiguration API operation for AWS IoT. +// +// Deletes the specified domain configuration. +// +// The domain configuration feature is in public preview and is subject to 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 IoT's +// API operation DeleteDomainConfiguration for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource does not exist. +// +// * ThrottlingException +// The rate exceeds the limit. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * ServiceUnavailableException +// The service is temporarily unavailable. +// +// * InternalFailureException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +func (c *IoT) DeleteDomainConfiguration(input *DeleteDomainConfigurationInput) (*DeleteDomainConfigurationOutput, error) { + req, out := c.DeleteDomainConfigurationRequest(input) + return out, req.Send() +} + +// DeleteDomainConfigurationWithContext is the same as DeleteDomainConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDomainConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) DeleteDomainConfigurationWithContext(ctx aws.Context, input *DeleteDomainConfigurationInput, opts ...request.Option) (*DeleteDomainConfigurationOutput, error) { + req, out := c.DeleteDomainConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteDynamicThingGroup = "DeleteDynamicThingGroup" // DeleteDynamicThingGroupRequest generates a "aws/request.Request" representing the @@ -3561,18 +4211,18 @@ func (c *IoT) DeleteDynamicThingGroupRequest(input *DeleteDynamicThingGroupInput // See the AWS API reference guide for AWS IoT's // API operation DeleteDynamicThingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeVersionConflictException "VersionConflictException" +// * VersionConflictException // An exception thrown when the version of an entity specified with the expectedVersion // parameter does not match the latest version in the system. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DeleteDynamicThingGroup(input *DeleteDynamicThingGroupInput) (*DeleteDynamicThingGroupOutput, error) { @@ -3657,25 +4307,25 @@ func (c *IoT) DeleteJobRequest(input *DeleteJobInput) (req *request.Request, out // See the AWS API reference guide for AWS IoT's // API operation DeleteJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeInvalidStateTransitionException "InvalidStateTransitionException" +// * InvalidStateTransitionException // An attempt was made to change to an invalid state, for example by deleting // a job or a job execution which is "IN_PROGRESS" without setting the force // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) DeleteJob(input *DeleteJobInput) (*DeleteJobOutput, error) { @@ -3751,22 +4401,22 @@ func (c *IoT) DeleteJobExecutionRequest(input *DeleteJobExecutionInput) (req *re // See the AWS API reference guide for AWS IoT's // API operation DeleteJobExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeInvalidStateTransitionException "InvalidStateTransitionException" +// * InvalidStateTransitionException // An attempt was made to change to an invalid state, for example by deleting // a job or a job execution which is "IN_PROGRESS" without setting the force // parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) DeleteJobExecution(input *DeleteJobExecutionInput) (*DeleteJobExecutionOutput, error) { @@ -3842,14 +4492,14 @@ func (c *IoT) DeleteMitigationActionRequest(input *DeleteMitigationActionInput) // See the AWS API reference guide for AWS IoT's // API operation DeleteMitigationAction for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DeleteMitigationAction(input *DeleteMitigationActionInput) (*DeleteMitigationActionOutput, error) { @@ -3925,26 +4575,26 @@ func (c *IoT) DeleteOTAUpdateRequest(input *DeleteOTAUpdateInput) (req *request. // See the AWS API reference guide for AWS IoT's // API operation DeleteOTAUpdate for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeVersionConflictException "VersionConflictException" +// * VersionConflictException // An exception thrown when the version of an entity specified with the expectedVersion // parameter does not match the latest version in the system. // @@ -4031,26 +4681,26 @@ func (c *IoT) DeletePolicyRequest(input *DeletePolicyInput) (req *request.Reques // See the AWS API reference guide for AWS IoT's // API operation DeletePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeDeleteConflictException "DeleteConflictException" +// Returned Error Types: +// * DeleteConflictException // You can't delete the resource because it is attached to one or more resources. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DeletePolicy(input *DeletePolicyInput) (*DeletePolicyOutput, error) { @@ -4129,26 +4779,26 @@ func (c *IoT) DeletePolicyVersionRequest(input *DeletePolicyVersionInput) (req * // See the AWS API reference guide for AWS IoT's // API operation DeletePolicyVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeDeleteConflictException "DeleteConflictException" +// Returned Error Types: +// * DeleteConflictException // You can't delete the resource because it is attached to one or more resources. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DeletePolicyVersion(input *DeletePolicyVersionInput) (*DeletePolicyVersionOutput, error) { @@ -4172,6 +4822,190 @@ func (c *IoT) DeletePolicyVersionWithContext(ctx aws.Context, input *DeletePolic return out, req.Send() } +const opDeleteProvisioningTemplate = "DeleteProvisioningTemplate" + +// DeleteProvisioningTemplateRequest generates a "aws/request.Request" representing the +// client's request for the DeleteProvisioningTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteProvisioningTemplate for more information on using the DeleteProvisioningTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteProvisioningTemplateRequest method. +// req, resp := client.DeleteProvisioningTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) DeleteProvisioningTemplateRequest(input *DeleteProvisioningTemplateInput) (req *request.Request, output *DeleteProvisioningTemplateOutput) { + op := &request.Operation{ + Name: opDeleteProvisioningTemplate, + HTTPMethod: "DELETE", + HTTPPath: "/provisioning-templates/{templateName}", + } + + if input == nil { + input = &DeleteProvisioningTemplateInput{} + } + + output = &DeleteProvisioningTemplateOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteProvisioningTemplate API operation for AWS IoT. +// +// Deletes a fleet provisioning 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 IoT's +// API operation DeleteProvisioningTemplate for usage and error information. +// +// Returned Error Types: +// * InternalFailureException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * ResourceNotFoundException +// The specified resource does not exist. +// +// * DeleteConflictException +// You can't delete the resource because it is attached to one or more resources. +// +// * ThrottlingException +// The rate exceeds the limit. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +func (c *IoT) DeleteProvisioningTemplate(input *DeleteProvisioningTemplateInput) (*DeleteProvisioningTemplateOutput, error) { + req, out := c.DeleteProvisioningTemplateRequest(input) + return out, req.Send() +} + +// DeleteProvisioningTemplateWithContext is the same as DeleteProvisioningTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteProvisioningTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) DeleteProvisioningTemplateWithContext(ctx aws.Context, input *DeleteProvisioningTemplateInput, opts ...request.Option) (*DeleteProvisioningTemplateOutput, error) { + req, out := c.DeleteProvisioningTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteProvisioningTemplateVersion = "DeleteProvisioningTemplateVersion" + +// DeleteProvisioningTemplateVersionRequest generates a "aws/request.Request" representing the +// client's request for the DeleteProvisioningTemplateVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteProvisioningTemplateVersion for more information on using the DeleteProvisioningTemplateVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteProvisioningTemplateVersionRequest method. +// req, resp := client.DeleteProvisioningTemplateVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) DeleteProvisioningTemplateVersionRequest(input *DeleteProvisioningTemplateVersionInput) (req *request.Request, output *DeleteProvisioningTemplateVersionOutput) { + op := &request.Operation{ + Name: opDeleteProvisioningTemplateVersion, + HTTPMethod: "DELETE", + HTTPPath: "/provisioning-templates/{templateName}/versions/{versionId}", + } + + if input == nil { + input = &DeleteProvisioningTemplateVersionInput{} + } + + output = &DeleteProvisioningTemplateVersionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteProvisioningTemplateVersion API operation for AWS IoT. +// +// Deletes a fleet provisioning template 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 IoT's +// API operation DeleteProvisioningTemplateVersion for usage and error information. +// +// Returned Error Types: +// * InternalFailureException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * ThrottlingException +// The rate exceeds the limit. +// +// * ResourceNotFoundException +// The specified resource does not exist. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * DeleteConflictException +// You can't delete the resource because it is attached to one or more resources. +// +func (c *IoT) DeleteProvisioningTemplateVersion(input *DeleteProvisioningTemplateVersionInput) (*DeleteProvisioningTemplateVersionOutput, error) { + req, out := c.DeleteProvisioningTemplateVersionRequest(input) + return out, req.Send() +} + +// DeleteProvisioningTemplateVersionWithContext is the same as DeleteProvisioningTemplateVersion with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteProvisioningTemplateVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) DeleteProvisioningTemplateVersionWithContext(ctx aws.Context, input *DeleteProvisioningTemplateVersionInput, opts ...request.Option) (*DeleteProvisioningTemplateVersionOutput, error) { + req, out := c.DeleteProvisioningTemplateVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteRegistrationCode = "DeleteRegistrationCode" // DeleteRegistrationCodeRequest generates a "aws/request.Request" representing the @@ -4224,20 +5058,20 @@ func (c *IoT) DeleteRegistrationCodeRequest(input *DeleteRegistrationCodeInput) // See the AWS API reference guide for AWS IoT's // API operation DeleteRegistrationCode for usage and error information. // -// Returned Error Codes: -// * ErrCodeThrottlingException "ThrottlingException" +// Returned Error Types: +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DeleteRegistrationCode(input *DeleteRegistrationCodeInput) (*DeleteRegistrationCodeOutput, error) { @@ -4313,26 +5147,26 @@ func (c *IoT) DeleteRoleAliasRequest(input *DeleteRoleAliasInput) (req *request. // See the AWS API reference guide for AWS IoT's // API operation DeleteRoleAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeDeleteConflictException "DeleteConflictException" +// Returned Error Types: +// * DeleteConflictException // You can't delete the resource because it is attached to one or more resources. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) DeleteRoleAlias(input *DeleteRoleAliasInput) (*DeleteRoleAliasOutput, error) { @@ -4408,17 +5242,17 @@ func (c *IoT) DeleteScheduledAuditRequest(input *DeleteScheduledAuditInput) (req // See the AWS API reference guide for AWS IoT's // API operation DeleteScheduledAudit for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DeleteScheduledAudit(input *DeleteScheduledAuditInput) (*DeleteScheduledAuditOutput, error) { @@ -4494,17 +5328,17 @@ func (c *IoT) DeleteSecurityProfileRequest(input *DeleteSecurityProfileInput) (r // See the AWS API reference guide for AWS IoT's // API operation DeleteSecurityProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeVersionConflictException "VersionConflictException" +// * VersionConflictException // An exception thrown when the version of an entity specified with the expectedVersion // parameter does not match the latest version in the system. // @@ -4581,26 +5415,26 @@ func (c *IoT) DeleteStreamRequest(input *DeleteStreamInput) (req *request.Reques // See the AWS API reference guide for AWS IoT's // API operation DeleteStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeDeleteConflictException "DeleteConflictException" +// * DeleteConflictException // You can't delete the resource because it is attached to one or more resources. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DeleteStream(input *DeleteStreamInput) (*DeleteStreamOutput, error) { @@ -4677,27 +5511,27 @@ func (c *IoT) DeleteThingRequest(input *DeleteThingInput) (req *request.Request, // See the AWS API reference guide for AWS IoT's // API operation DeleteThing for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeVersionConflictException "VersionConflictException" +// * VersionConflictException // An exception thrown when the version of an entity specified with the expectedVersion // parameter does not match the latest version in the system. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DeleteThing(input *DeleteThingInput) (*DeleteThingOutput, error) { @@ -4773,18 +5607,18 @@ func (c *IoT) DeleteThingGroupRequest(input *DeleteThingGroupInput) (req *reques // See the AWS API reference guide for AWS IoT's // API operation DeleteThingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeVersionConflictException "VersionConflictException" +// * VersionConflictException // An exception thrown when the version of an entity specified with the expectedVersion // parameter does not match the latest version in the system. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DeleteThingGroup(input *DeleteThingGroupInput) (*DeleteThingGroupOutput, error) { @@ -4864,23 +5698,23 @@ func (c *IoT) DeleteThingTypeRequest(input *DeleteThingTypeInput) (req *request. // See the AWS API reference guide for AWS IoT's // API operation DeleteThingType for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DeleteThingType(input *DeleteThingTypeInput) (*DeleteThingTypeOutput, error) { @@ -4956,20 +5790,20 @@ func (c *IoT) DeleteTopicRuleRequest(input *DeleteTopicRuleInput) (req *request. // See the AWS API reference guide for AWS IoT's // API operation DeleteTopicRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // An unexpected error has occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeConflictingResourceUpdateException "ConflictingResourceUpdateException" +// * ConflictingResourceUpdateException // A conflicting resource update exception. This exception is thrown when two // pending updates cause a conflict. // @@ -4994,6 +5828,96 @@ func (c *IoT) DeleteTopicRuleWithContext(ctx aws.Context, input *DeleteTopicRule return out, req.Send() } +const opDeleteTopicRuleDestination = "DeleteTopicRuleDestination" + +// DeleteTopicRuleDestinationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTopicRuleDestination operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteTopicRuleDestination for more information on using the DeleteTopicRuleDestination +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteTopicRuleDestinationRequest method. +// req, resp := client.DeleteTopicRuleDestinationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) DeleteTopicRuleDestinationRequest(input *DeleteTopicRuleDestinationInput) (req *request.Request, output *DeleteTopicRuleDestinationOutput) { + op := &request.Operation{ + Name: opDeleteTopicRuleDestination, + HTTPMethod: "DELETE", + HTTPPath: "/destinations/{arn+}", + } + + if input == nil { + input = &DeleteTopicRuleDestinationInput{} + } + + output = &DeleteTopicRuleDestinationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteTopicRuleDestination API operation for AWS IoT. +// +// Deletes a topic rule 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 AWS IoT's +// API operation DeleteTopicRuleDestination for usage and error information. +// +// Returned Error Types: +// * InternalException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * ServiceUnavailableException +// The service is temporarily unavailable. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * ConflictingResourceUpdateException +// A conflicting resource update exception. This exception is thrown when two +// pending updates cause a conflict. +// +func (c *IoT) DeleteTopicRuleDestination(input *DeleteTopicRuleDestinationInput) (*DeleteTopicRuleDestinationOutput, error) { + req, out := c.DeleteTopicRuleDestinationRequest(input) + return out, req.Send() +} + +// DeleteTopicRuleDestinationWithContext is the same as DeleteTopicRuleDestination with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTopicRuleDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) DeleteTopicRuleDestinationWithContext(ctx aws.Context, input *DeleteTopicRuleDestinationInput, opts ...request.Option) (*DeleteTopicRuleDestinationOutput, error) { + req, out := c.DeleteTopicRuleDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteV2LoggingLevel = "DeleteV2LoggingLevel" // DeleteV2LoggingLevelRequest generates a "aws/request.Request" representing the @@ -5046,14 +5970,14 @@ func (c *IoT) DeleteV2LoggingLevelRequest(input *DeleteV2LoggingLevelInput) (req // See the AWS API reference guide for AWS IoT's // API operation DeleteV2LoggingLevel for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // An unexpected error has occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) DeleteV2LoggingLevel(input *DeleteV2LoggingLevelInput) (*DeleteV2LoggingLevelOutput, error) { @@ -5130,23 +6054,23 @@ func (c *IoT) DeprecateThingTypeRequest(input *DeprecateThingTypeInput) (req *re // See the AWS API reference guide for AWS IoT's // API operation DeprecateThingType for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DeprecateThingType(input *DeprecateThingTypeInput) (*DeprecateThingTypeOutput, error) { @@ -5223,11 +6147,11 @@ func (c *IoT) DescribeAccountAuditConfigurationRequest(input *DescribeAccountAud // See the AWS API reference guide for AWS IoT's // API operation DescribeAccountAuditConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeThrottlingException "ThrottlingException" +// Returned Error Types: +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DescribeAccountAuditConfiguration(input *DescribeAccountAuditConfigurationInput) (*DescribeAccountAuditConfigurationOutput, error) { @@ -5304,17 +6228,17 @@ func (c *IoT) DescribeAuditFindingRequest(input *DescribeAuditFindingInput) (req // See the AWS API reference guide for AWS IoT's // API operation DescribeAuditFinding for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DescribeAuditFinding(input *DescribeAuditFindingInput) (*DescribeAuditFindingOutput, error) { @@ -5392,17 +6316,17 @@ func (c *IoT) DescribeAuditMitigationActionsTaskRequest(input *DescribeAuditMiti // See the AWS API reference guide for AWS IoT's // API operation DescribeAuditMitigationActionsTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DescribeAuditMitigationActionsTask(input *DescribeAuditMitigationActionsTaskInput) (*DescribeAuditMitigationActionsTaskOutput, error) { @@ -5477,17 +6401,17 @@ func (c *IoT) DescribeAuditTaskRequest(input *DescribeAuditTaskInput) (req *requ // See the AWS API reference guide for AWS IoT's // API operation DescribeAuditTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DescribeAuditTask(input *DescribeAuditTaskInput) (*DescribeAuditTaskOutput, error) { @@ -5562,23 +6486,23 @@ func (c *IoT) DescribeAuthorizerRequest(input *DescribeAuthorizerInput) (req *re // See the AWS API reference guide for AWS IoT's // API operation DescribeAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DescribeAuthorizer(input *DescribeAuthorizerInput) (*DescribeAuthorizerOutput, error) { @@ -5653,17 +6577,17 @@ func (c *IoT) DescribeBillingGroupRequest(input *DescribeBillingGroupInput) (req // See the AWS API reference guide for AWS IoT's // API operation DescribeBillingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) DescribeBillingGroup(input *DescribeBillingGroupInput) (*DescribeBillingGroupOutput, error) { @@ -5738,23 +6662,23 @@ func (c *IoT) DescribeCACertificateRequest(input *DescribeCACertificateInput) (r // See the AWS API reference guide for AWS IoT's // API operation DescribeCACertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) DescribeCACertificate(input *DescribeCACertificateInput) (*DescribeCACertificateOutput, error) { @@ -5829,23 +6753,23 @@ func (c *IoT) DescribeCertificateRequest(input *DescribeCertificateInput) (req * // See the AWS API reference guide for AWS IoT's // API operation DescribeCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) DescribeCertificate(input *DescribeCertificateInput) (*DescribeCertificateOutput, error) { @@ -5920,23 +6844,23 @@ func (c *IoT) DescribeDefaultAuthorizerRequest(input *DescribeDefaultAuthorizerI // See the AWS API reference guide for AWS IoT's // API operation DescribeDefaultAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DescribeDefaultAuthorizer(input *DescribeDefaultAuthorizerInput) (*DescribeDefaultAuthorizerOutput, error) { @@ -5960,6 +6884,96 @@ func (c *IoT) DescribeDefaultAuthorizerWithContext(ctx aws.Context, input *Descr return out, req.Send() } +const opDescribeDomainConfiguration = "DescribeDomainConfiguration" + +// DescribeDomainConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the DescribeDomainConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeDomainConfiguration for more information on using the DescribeDomainConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeDomainConfigurationRequest method. +// req, resp := client.DescribeDomainConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) DescribeDomainConfigurationRequest(input *DescribeDomainConfigurationInput) (req *request.Request, output *DescribeDomainConfigurationOutput) { + op := &request.Operation{ + Name: opDescribeDomainConfiguration, + HTTPMethod: "GET", + HTTPPath: "/domainConfigurations/{domainConfigurationName}", + } + + if input == nil { + input = &DescribeDomainConfigurationInput{} + } + + output = &DescribeDomainConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeDomainConfiguration API operation for AWS IoT. +// +// Gets summary information about a domain configuration. +// +// The domain configuration feature is in public preview and is subject to 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 IoT's +// API operation DescribeDomainConfiguration for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource does not exist. +// +// * ThrottlingException +// The rate exceeds the limit. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * ServiceUnavailableException +// The service is temporarily unavailable. +// +// * InternalFailureException +// An unexpected error has occurred. +// +func (c *IoT) DescribeDomainConfiguration(input *DescribeDomainConfigurationInput) (*DescribeDomainConfigurationOutput, error) { + req, out := c.DescribeDomainConfigurationRequest(input) + return out, req.Send() +} + +// DescribeDomainConfigurationWithContext is the same as DescribeDomainConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDomainConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) DescribeDomainConfigurationWithContext(ctx aws.Context, input *DescribeDomainConfigurationInput, opts ...request.Option) (*DescribeDomainConfigurationOutput, error) { + req, out := c.DescribeDomainConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeEndpoint = "DescribeEndpoint" // DescribeEndpointRequest generates a "aws/request.Request" representing the @@ -6011,17 +7025,17 @@ func (c *IoT) DescribeEndpointRequest(input *DescribeEndpointInput) (req *reques // See the AWS API reference guide for AWS IoT's // API operation DescribeEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalFailureException "InternalFailureException" +// Returned Error Types: +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // func (c *IoT) DescribeEndpoint(input *DescribeEndpointInput) (*DescribeEndpointOutput, error) { @@ -6096,11 +7110,11 @@ func (c *IoT) DescribeEventConfigurationsRequest(input *DescribeEventConfigurati // See the AWS API reference guide for AWS IoT's // API operation DescribeEventConfigurations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalFailureException "InternalFailureException" +// Returned Error Types: +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // func (c *IoT) DescribeEventConfigurations(input *DescribeEventConfigurationsInput) (*DescribeEventConfigurationsOutput, error) { @@ -6175,23 +7189,23 @@ func (c *IoT) DescribeIndexRequest(input *DescribeIndexInput) (req *request.Requ // See the AWS API reference guide for AWS IoT's // API operation DescribeIndex for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) DescribeIndex(input *DescribeIndexInput) (*DescribeIndexOutput, error) { @@ -6266,17 +7280,17 @@ func (c *IoT) DescribeJobRequest(input *DescribeJobInput) (req *request.Request, // See the AWS API reference guide for AWS IoT's // API operation DescribeJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) DescribeJob(input *DescribeJobInput) (*DescribeJobOutput, error) { @@ -6351,17 +7365,17 @@ func (c *IoT) DescribeJobExecutionRequest(input *DescribeJobExecutionInput) (req // See the AWS API reference guide for AWS IoT's // API operation DescribeJobExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) DescribeJobExecution(input *DescribeJobExecutionInput) (*DescribeJobExecutionOutput, error) { @@ -6436,17 +7450,17 @@ func (c *IoT) DescribeMitigationActionRequest(input *DescribeMitigationActionInp // See the AWS API reference guide for AWS IoT's // API operation DescribeMitigationAction for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DescribeMitigationAction(input *DescribeMitigationActionInput) (*DescribeMitigationActionOutput, error) { @@ -6470,6 +7484,182 @@ func (c *IoT) DescribeMitigationActionWithContext(ctx aws.Context, input *Descri return out, req.Send() } +const opDescribeProvisioningTemplate = "DescribeProvisioningTemplate" + +// DescribeProvisioningTemplateRequest generates a "aws/request.Request" representing the +// client's request for the DescribeProvisioningTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeProvisioningTemplate for more information on using the DescribeProvisioningTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeProvisioningTemplateRequest method. +// req, resp := client.DescribeProvisioningTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) DescribeProvisioningTemplateRequest(input *DescribeProvisioningTemplateInput) (req *request.Request, output *DescribeProvisioningTemplateOutput) { + op := &request.Operation{ + Name: opDescribeProvisioningTemplate, + HTTPMethod: "GET", + HTTPPath: "/provisioning-templates/{templateName}", + } + + if input == nil { + input = &DescribeProvisioningTemplateInput{} + } + + output = &DescribeProvisioningTemplateOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeProvisioningTemplate API operation for AWS IoT. +// +// Returns information about a fleet provisioning 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 IoT's +// API operation DescribeProvisioningTemplate for usage and error information. +// +// Returned Error Types: +// * InternalFailureException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * ResourceNotFoundException +// The specified resource does not exist. +// +// * ThrottlingException +// The rate exceeds the limit. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +func (c *IoT) DescribeProvisioningTemplate(input *DescribeProvisioningTemplateInput) (*DescribeProvisioningTemplateOutput, error) { + req, out := c.DescribeProvisioningTemplateRequest(input) + return out, req.Send() +} + +// DescribeProvisioningTemplateWithContext is the same as DescribeProvisioningTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeProvisioningTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) DescribeProvisioningTemplateWithContext(ctx aws.Context, input *DescribeProvisioningTemplateInput, opts ...request.Option) (*DescribeProvisioningTemplateOutput, error) { + req, out := c.DescribeProvisioningTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeProvisioningTemplateVersion = "DescribeProvisioningTemplateVersion" + +// DescribeProvisioningTemplateVersionRequest generates a "aws/request.Request" representing the +// client's request for the DescribeProvisioningTemplateVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeProvisioningTemplateVersion for more information on using the DescribeProvisioningTemplateVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeProvisioningTemplateVersionRequest method. +// req, resp := client.DescribeProvisioningTemplateVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) DescribeProvisioningTemplateVersionRequest(input *DescribeProvisioningTemplateVersionInput) (req *request.Request, output *DescribeProvisioningTemplateVersionOutput) { + op := &request.Operation{ + Name: opDescribeProvisioningTemplateVersion, + HTTPMethod: "GET", + HTTPPath: "/provisioning-templates/{templateName}/versions/{versionId}", + } + + if input == nil { + input = &DescribeProvisioningTemplateVersionInput{} + } + + output = &DescribeProvisioningTemplateVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeProvisioningTemplateVersion API operation for AWS IoT. +// +// Returns information about a fleet provisioning template 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 IoT's +// API operation DescribeProvisioningTemplateVersion for usage and error information. +// +// Returned Error Types: +// * InternalFailureException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * ThrottlingException +// The rate exceeds the limit. +// +// * ResourceNotFoundException +// The specified resource does not exist. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +func (c *IoT) DescribeProvisioningTemplateVersion(input *DescribeProvisioningTemplateVersionInput) (*DescribeProvisioningTemplateVersionOutput, error) { + req, out := c.DescribeProvisioningTemplateVersionRequest(input) + return out, req.Send() +} + +// DescribeProvisioningTemplateVersionWithContext is the same as DescribeProvisioningTemplateVersion with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeProvisioningTemplateVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) DescribeProvisioningTemplateVersionWithContext(ctx aws.Context, input *DescribeProvisioningTemplateVersionInput, opts ...request.Option) (*DescribeProvisioningTemplateVersionOutput, error) { + req, out := c.DescribeProvisioningTemplateVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeRoleAlias = "DescribeRoleAlias" // DescribeRoleAliasRequest generates a "aws/request.Request" representing the @@ -6521,23 +7711,23 @@ func (c *IoT) DescribeRoleAliasRequest(input *DescribeRoleAliasInput) (req *requ // See the AWS API reference guide for AWS IoT's // API operation DescribeRoleAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) DescribeRoleAlias(input *DescribeRoleAliasInput) (*DescribeRoleAliasOutput, error) { @@ -6612,17 +7802,17 @@ func (c *IoT) DescribeScheduledAuditRequest(input *DescribeScheduledAuditInput) // See the AWS API reference guide for AWS IoT's // API operation DescribeScheduledAudit for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DescribeScheduledAudit(input *DescribeScheduledAuditInput) (*DescribeScheduledAuditOutput, error) { @@ -6697,17 +7887,17 @@ func (c *IoT) DescribeSecurityProfileRequest(input *DescribeSecurityProfileInput // See the AWS API reference guide for AWS IoT's // API operation DescribeSecurityProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DescribeSecurityProfile(input *DescribeSecurityProfileInput) (*DescribeSecurityProfileOutput, error) { @@ -6782,23 +7972,23 @@ func (c *IoT) DescribeStreamRequest(input *DescribeStreamInput) (req *request.Re // See the AWS API reference guide for AWS IoT's // API operation DescribeStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DescribeStream(input *DescribeStreamInput) (*DescribeStreamOutput, error) { @@ -6873,23 +8063,23 @@ func (c *IoT) DescribeThingRequest(input *DescribeThingInput) (req *request.Requ // See the AWS API reference guide for AWS IoT's // API operation DescribeThing for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DescribeThing(input *DescribeThingInput) (*DescribeThingOutput, error) { @@ -6964,17 +8154,17 @@ func (c *IoT) DescribeThingGroupRequest(input *DescribeThingGroupInput) (req *re // See the AWS API reference guide for AWS IoT's // API operation DescribeThingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) DescribeThingGroup(input *DescribeThingGroupInput) (*DescribeThingGroupOutput, error) { @@ -7049,20 +8239,20 @@ func (c *IoT) DescribeThingRegistrationTaskRequest(input *DescribeThingRegistrat // See the AWS API reference guide for AWS IoT's // API operation DescribeThingRegistrationTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) DescribeThingRegistrationTask(input *DescribeThingRegistrationTaskInput) (*DescribeThingRegistrationTaskOutput, error) { @@ -7137,23 +8327,23 @@ func (c *IoT) DescribeThingTypeRequest(input *DescribeThingTypeInput) (req *requ // See the AWS API reference guide for AWS IoT's // API operation DescribeThingType for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DescribeThingType(input *DescribeThingTypeInput) (*DescribeThingTypeOutput, error) { @@ -7229,23 +8419,23 @@ func (c *IoT) DetachPolicyRequest(input *DetachPolicyInput) (req *request.Reques // See the AWS API reference guide for AWS IoT's // API operation DetachPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // func (c *IoT) DetachPolicy(input *DetachPolicyInput) (*DetachPolicyOutput, error) { @@ -7328,23 +8518,23 @@ func (c *IoT) DetachPrincipalPolicyRequest(input *DetachPrincipalPolicyInput) (r // See the AWS API reference guide for AWS IoT's // API operation DetachPrincipalPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // // @@ -7425,17 +8615,17 @@ func (c *IoT) DetachSecurityProfileRequest(input *DetachSecurityProfileInput) (r // See the AWS API reference guide for AWS IoT's // API operation DetachSecurityProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DetachSecurityProfile(input *DetachSecurityProfileInput) (*DetachSecurityProfileOutput, error) { @@ -7516,23 +8706,23 @@ func (c *IoT) DetachThingPrincipalRequest(input *DetachThingPrincipalInput) (req // See the AWS API reference guide for AWS IoT's // API operation DetachThingPrincipal for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) DetachThingPrincipal(input *DetachThingPrincipalInput) (*DetachThingPrincipalOutput, error) { @@ -7608,20 +8798,20 @@ func (c *IoT) DisableTopicRuleRequest(input *DisableTopicRuleInput) (req *reques // See the AWS API reference guide for AWS IoT's // API operation DisableTopicRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // An unexpected error has occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeConflictingResourceUpdateException "ConflictingResourceUpdateException" +// * ConflictingResourceUpdateException // A conflicting resource update exception. This exception is thrown when two // pending updates cause a conflict. // @@ -7698,20 +8888,20 @@ func (c *IoT) EnableTopicRuleRequest(input *EnableTopicRuleInput) (req *request. // See the AWS API reference guide for AWS IoT's // API operation EnableTopicRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // An unexpected error has occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeConflictingResourceUpdateException "ConflictingResourceUpdateException" +// * ConflictingResourceUpdateException // A conflicting resource update exception. This exception is thrown when two // pending updates cause a conflict. // @@ -7736,6 +8926,106 @@ func (c *IoT) EnableTopicRuleWithContext(ctx aws.Context, input *EnableTopicRule return out, req.Send() } +const opGetCardinality = "GetCardinality" + +// GetCardinalityRequest generates a "aws/request.Request" representing the +// client's request for the GetCardinality operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetCardinality for more information on using the GetCardinality +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetCardinalityRequest method. +// req, resp := client.GetCardinalityRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) GetCardinalityRequest(input *GetCardinalityInput) (req *request.Request, output *GetCardinalityOutput) { + op := &request.Operation{ + Name: opGetCardinality, + HTTPMethod: "POST", + HTTPPath: "/indices/cardinality", + } + + if input == nil { + input = &GetCardinalityInput{} + } + + output = &GetCardinalityOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetCardinality API operation for AWS IoT. +// +// Returns the approximate count of unique values that match the query. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS IoT's +// API operation GetCardinality for usage and error information. +// +// Returned Error Types: +// * InvalidRequestException +// The request is not valid. +// +// * ThrottlingException +// The rate exceeds the limit. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * ServiceUnavailableException +// The service is temporarily unavailable. +// +// * InternalFailureException +// An unexpected error has occurred. +// +// * ResourceNotFoundException +// The specified resource does not exist. +// +// * InvalidQueryException +// The query is invalid. +// +// * InvalidAggregationException +// The aggregation is invalid. +// +// * IndexNotReadyException +// The index is not ready. +// +func (c *IoT) GetCardinality(input *GetCardinalityInput) (*GetCardinalityOutput, error) { + req, out := c.GetCardinalityRequest(input) + return out, req.Send() +} + +// GetCardinalityWithContext is the same as GetCardinality with the addition of +// the ability to pass a context and additional request options. +// +// See GetCardinality for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) GetCardinalityWithContext(ctx aws.Context, input *GetCardinalityInput, opts ...request.Option) (*GetCardinalityOutput, error) { + req, out := c.GetCardinalityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetEffectivePolicies = "GetEffectivePolicies" // GetEffectivePoliciesRequest generates a "aws/request.Request" representing the @@ -7788,26 +9078,26 @@ func (c *IoT) GetEffectivePoliciesRequest(input *GetEffectivePoliciesInput) (req // See the AWS API reference guide for AWS IoT's // API operation GetEffectivePolicies for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // func (c *IoT) GetEffectivePolicies(input *GetEffectivePoliciesInput) (*GetEffectivePoliciesOutput, error) { @@ -7873,7 +9163,7 @@ func (c *IoT) GetIndexingConfigurationRequest(input *GetIndexingConfigurationInp // GetIndexingConfiguration API operation for AWS IoT. // -// Gets the search configuration. +// Gets the indexing 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 @@ -7882,20 +9172,20 @@ func (c *IoT) GetIndexingConfigurationRequest(input *GetIndexingConfigurationInp // See the AWS API reference guide for AWS IoT's // API operation GetIndexingConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) GetIndexingConfiguration(input *GetIndexingConfigurationInput) (*GetIndexingConfigurationOutput, error) { @@ -7970,17 +9260,17 @@ func (c *IoT) GetJobDocumentRequest(input *GetJobDocumentInput) (req *request.Re // See the AWS API reference guide for AWS IoT's // API operation GetJobDocument for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) GetJobDocument(input *GetJobDocumentInput) (*GetJobDocumentOutput, error) { @@ -8057,14 +9347,14 @@ func (c *IoT) GetLoggingOptionsRequest(input *GetLoggingOptionsInput) (req *requ // See the AWS API reference guide for AWS IoT's // API operation GetLoggingOptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // An unexpected error has occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) GetLoggingOptions(input *GetLoggingOptionsInput) (*GetLoggingOptionsOutput, error) { @@ -8139,23 +9429,23 @@ func (c *IoT) GetOTAUpdateRequest(input *GetOTAUpdateInput) (req *request.Reques // See the AWS API reference guide for AWS IoT's // API operation GetOTAUpdate for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) GetOTAUpdate(input *GetOTAUpdateInput) (*GetOTAUpdateOutput, error) { @@ -8179,6 +9469,115 @@ func (c *IoT) GetOTAUpdateWithContext(ctx aws.Context, input *GetOTAUpdateInput, return out, req.Send() } +const opGetPercentiles = "GetPercentiles" + +// GetPercentilesRequest generates a "aws/request.Request" representing the +// client's request for the GetPercentiles operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetPercentiles for more information on using the GetPercentiles +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetPercentilesRequest method. +// req, resp := client.GetPercentilesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) GetPercentilesRequest(input *GetPercentilesInput) (req *request.Request, output *GetPercentilesOutput) { + op := &request.Operation{ + Name: opGetPercentiles, + HTTPMethod: "POST", + HTTPPath: "/indices/percentiles", + } + + if input == nil { + input = &GetPercentilesInput{} + } + + output = &GetPercentilesOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetPercentiles API operation for AWS IoT. +// +// Groups the aggregated values that match the query into percentile groupings. +// The default percentile groupings are: 1,5,25,50,75,95,99, although you can +// specify your own when you call GetPercentiles. This function returns a value +// for each percentile group specified (or the default percentile groupings). +// The percentile group "1" contains the aggregated field value that occurs +// in approximately one percent of the values that match the query. The percentile +// group "5" contains the aggregated field value that occurs in approximately +// five percent of the values that match the query, and so on. The result is +// an approximation, the more values that match the query, the more accurate +// the percentile 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 IoT's +// API operation GetPercentiles for usage and error information. +// +// Returned Error Types: +// * InvalidRequestException +// The request is not valid. +// +// * ThrottlingException +// The rate exceeds the limit. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * ServiceUnavailableException +// The service is temporarily unavailable. +// +// * InternalFailureException +// An unexpected error has occurred. +// +// * ResourceNotFoundException +// The specified resource does not exist. +// +// * InvalidQueryException +// The query is invalid. +// +// * InvalidAggregationException +// The aggregation is invalid. +// +// * IndexNotReadyException +// The index is not ready. +// +func (c *IoT) GetPercentiles(input *GetPercentilesInput) (*GetPercentilesOutput, error) { + req, out := c.GetPercentilesRequest(input) + return out, req.Send() +} + +// GetPercentilesWithContext is the same as GetPercentiles with the addition of +// the ability to pass a context and additional request options. +// +// See GetPercentiles for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) GetPercentilesWithContext(ctx aws.Context, input *GetPercentilesInput, opts ...request.Option) (*GetPercentilesOutput, error) { + req, out := c.GetPercentilesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetPolicy = "GetPolicy" // GetPolicyRequest generates a "aws/request.Request" representing the @@ -8231,23 +9630,23 @@ func (c *IoT) GetPolicyRequest(input *GetPolicyInput) (req *request.Request, out // See the AWS API reference guide for AWS IoT's // API operation GetPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) GetPolicy(input *GetPolicyInput) (*GetPolicyOutput, error) { @@ -8322,23 +9721,23 @@ func (c *IoT) GetPolicyVersionRequest(input *GetPolicyVersionInput) (req *reques // See the AWS API reference guide for AWS IoT's // API operation GetPolicyVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) GetPolicyVersion(input *GetPolicyVersionInput) (*GetPolicyVersionOutput, error) { @@ -8413,20 +9812,20 @@ func (c *IoT) GetRegistrationCodeRequest(input *GetRegistrationCodeInput) (req * // See the AWS API reference guide for AWS IoT's // API operation GetRegistrationCode for usage and error information. // -// Returned Error Codes: -// * ErrCodeThrottlingException "ThrottlingException" +// Returned Error Types: +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // func (c *IoT) GetRegistrationCode(input *GetRegistrationCodeInput) (*GetRegistrationCodeOutput, error) { @@ -8492,7 +9891,9 @@ func (c *IoT) GetStatisticsRequest(input *GetStatisticsInput) (req *request.Requ // GetStatistics API operation for AWS IoT. // -// Gets statistics about things that match the specified query. +// Returns the count, average, sum, minimum, maximum, sum of squares, variance, +// and standard deviation for the specified aggregated field. If the aggregation +// field is of type String, only the count statistic 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 @@ -8501,32 +9902,32 @@ func (c *IoT) GetStatisticsRequest(input *GetStatisticsInput) (req *request.Requ // See the AWS API reference guide for AWS IoT's // API operation GetStatistics for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidQueryException "InvalidQueryException" +// * InvalidQueryException // The query is invalid. // -// * ErrCodeInvalidAggregationException "InvalidAggregationException" +// * InvalidAggregationException // The aggregation is invalid. // -// * ErrCodeIndexNotReadyException "IndexNotReadyException" +// * IndexNotReadyException // The index is not ready. // func (c *IoT) GetStatistics(input *GetStatisticsInput) (*GetStatisticsOutput, error) { @@ -8601,17 +10002,17 @@ func (c *IoT) GetTopicRuleRequest(input *GetTopicRuleInput) (req *request.Reques // See the AWS API reference guide for AWS IoT's // API operation GetTopicRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // An unexpected error has occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // func (c *IoT) GetTopicRule(input *GetTopicRuleInput) (*GetTopicRuleOutput, error) { @@ -8635,6 +10036,91 @@ func (c *IoT) GetTopicRuleWithContext(ctx aws.Context, input *GetTopicRuleInput, return out, req.Send() } +const opGetTopicRuleDestination = "GetTopicRuleDestination" + +// GetTopicRuleDestinationRequest generates a "aws/request.Request" representing the +// client's request for the GetTopicRuleDestination operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetTopicRuleDestination for more information on using the GetTopicRuleDestination +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetTopicRuleDestinationRequest method. +// req, resp := client.GetTopicRuleDestinationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) GetTopicRuleDestinationRequest(input *GetTopicRuleDestinationInput) (req *request.Request, output *GetTopicRuleDestinationOutput) { + op := &request.Operation{ + Name: opGetTopicRuleDestination, + HTTPMethod: "GET", + HTTPPath: "/destinations/{arn+}", + } + + if input == nil { + input = &GetTopicRuleDestinationInput{} + } + + output = &GetTopicRuleDestinationOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetTopicRuleDestination API operation for AWS IoT. +// +// Gets information about a topic rule 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 AWS IoT's +// API operation GetTopicRuleDestination for usage and error information. +// +// Returned Error Types: +// * InternalException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * ServiceUnavailableException +// The service is temporarily unavailable. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +func (c *IoT) GetTopicRuleDestination(input *GetTopicRuleDestinationInput) (*GetTopicRuleDestinationOutput, error) { + req, out := c.GetTopicRuleDestinationRequest(input) + return out, req.Send() +} + +// GetTopicRuleDestinationWithContext is the same as GetTopicRuleDestination with the addition of +// the ability to pass a context and additional request options. +// +// See GetTopicRuleDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) GetTopicRuleDestinationWithContext(ctx aws.Context, input *GetTopicRuleDestinationInput, opts ...request.Option) (*GetTopicRuleDestinationOutput, error) { + req, out := c.GetTopicRuleDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetV2LoggingOptions = "GetV2LoggingOptions" // GetV2LoggingOptionsRequest generates a "aws/request.Request" representing the @@ -8686,14 +10172,14 @@ func (c *IoT) GetV2LoggingOptionsRequest(input *GetV2LoggingOptionsInput) (req * // See the AWS API reference guide for AWS IoT's // API operation GetV2LoggingOptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // An unexpected error has occurred. // -// * ErrCodeNotConfiguredException "NotConfiguredException" +// * NotConfiguredException // The resource is not configured. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) GetV2LoggingOptions(input *GetV2LoggingOptionsInput) (*GetV2LoggingOptionsOutput, error) { @@ -8768,17 +10254,17 @@ func (c *IoT) ListActiveViolationsRequest(input *ListActiveViolationsInput) (req // See the AWS API reference guide for AWS IoT's // API operation ListActiveViolations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListActiveViolations(input *ListActiveViolationsInput) (*ListActiveViolationsOutput, error) { @@ -8853,26 +10339,26 @@ func (c *IoT) ListAttachedPoliciesRequest(input *ListAttachedPoliciesInput) (req // See the AWS API reference guide for AWS IoT's // API operation ListAttachedPolicies for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // func (c *IoT) ListAttachedPolicies(input *ListAttachedPoliciesInput) (*ListAttachedPoliciesOutput, error) { @@ -8949,14 +10435,14 @@ func (c *IoT) ListAuditFindingsRequest(input *ListAuditFindingsInput) (req *requ // See the AWS API reference guide for AWS IoT's // API operation ListAuditFindings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListAuditFindings(input *ListAuditFindingsInput) (*ListAuditFindingsOutput, error) { @@ -9031,14 +10517,14 @@ func (c *IoT) ListAuditMitigationActionsExecutionsRequest(input *ListAuditMitiga // See the AWS API reference guide for AWS IoT's // API operation ListAuditMitigationActionsExecutions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListAuditMitigationActionsExecutions(input *ListAuditMitigationActionsExecutionsInput) (*ListAuditMitigationActionsExecutionsOutput, error) { @@ -9113,14 +10599,14 @@ func (c *IoT) ListAuditMitigationActionsTasksRequest(input *ListAuditMitigationA // See the AWS API reference guide for AWS IoT's // API operation ListAuditMitigationActionsTasks for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListAuditMitigationActionsTasks(input *ListAuditMitigationActionsTasksInput) (*ListAuditMitigationActionsTasksOutput, error) { @@ -9196,14 +10682,14 @@ func (c *IoT) ListAuditTasksRequest(input *ListAuditTasksInput) (req *request.Re // See the AWS API reference guide for AWS IoT's // API operation ListAuditTasks for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListAuditTasks(input *ListAuditTasksInput) (*ListAuditTasksOutput, error) { @@ -9278,20 +10764,20 @@ func (c *IoT) ListAuthorizersRequest(input *ListAuthorizersInput) (req *request. // See the AWS API reference guide for AWS IoT's // API operation ListAuthorizers for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListAuthorizers(input *ListAuthorizersInput) (*ListAuthorizersOutput, error) { @@ -9366,17 +10852,17 @@ func (c *IoT) ListBillingGroupsRequest(input *ListBillingGroupsInput) (req *requ // See the AWS API reference guide for AWS IoT's // API operation ListBillingGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // func (c *IoT) ListBillingGroups(input *ListBillingGroupsInput) (*ListBillingGroupsOutput, error) { @@ -9454,20 +10940,20 @@ func (c *IoT) ListCACertificatesRequest(input *ListCACertificatesInput) (req *re // See the AWS API reference guide for AWS IoT's // API operation ListCACertificates for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListCACertificates(input *ListCACertificatesInput) (*ListCACertificatesOutput, error) { @@ -9545,20 +11031,20 @@ func (c *IoT) ListCertificatesRequest(input *ListCertificatesInput) (req *reques // See the AWS API reference guide for AWS IoT's // API operation ListCertificates for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListCertificates(input *ListCertificatesInput) (*ListCertificatesOutput, error) { @@ -9633,20 +11119,20 @@ func (c *IoT) ListCertificatesByCARequest(input *ListCertificatesByCAInput) (req // See the AWS API reference guide for AWS IoT's // API operation ListCertificatesByCA for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListCertificatesByCA(input *ListCertificatesByCAInput) (*ListCertificatesByCAOutput, error) { @@ -9670,6 +11156,97 @@ func (c *IoT) ListCertificatesByCAWithContext(ctx aws.Context, input *ListCertif return out, req.Send() } +const opListDomainConfigurations = "ListDomainConfigurations" + +// ListDomainConfigurationsRequest generates a "aws/request.Request" representing the +// client's request for the ListDomainConfigurations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListDomainConfigurations for more information on using the ListDomainConfigurations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListDomainConfigurationsRequest method. +// req, resp := client.ListDomainConfigurationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) ListDomainConfigurationsRequest(input *ListDomainConfigurationsInput) (req *request.Request, output *ListDomainConfigurationsOutput) { + op := &request.Operation{ + Name: opListDomainConfigurations, + HTTPMethod: "GET", + HTTPPath: "/domainConfigurations", + } + + if input == nil { + input = &ListDomainConfigurationsInput{} + } + + output = &ListDomainConfigurationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListDomainConfigurations API operation for AWS IoT. +// +// Gets a list of domain configurations for the user. This list is sorted alphabetically +// by domain configuration name. +// +// The domain configuration feature is in public preview and is subject to 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 IoT's +// API operation ListDomainConfigurations for usage and error information. +// +// Returned Error Types: +// * InvalidRequestException +// The request is not valid. +// +// * ThrottlingException +// The rate exceeds the limit. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * ServiceUnavailableException +// The service is temporarily unavailable. +// +// * InternalFailureException +// An unexpected error has occurred. +// +func (c *IoT) ListDomainConfigurations(input *ListDomainConfigurationsInput) (*ListDomainConfigurationsOutput, error) { + req, out := c.ListDomainConfigurationsRequest(input) + return out, req.Send() +} + +// ListDomainConfigurationsWithContext is the same as ListDomainConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See ListDomainConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) ListDomainConfigurationsWithContext(ctx aws.Context, input *ListDomainConfigurationsInput, opts ...request.Option) (*ListDomainConfigurationsOutput, error) { + req, out := c.ListDomainConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opListIndices = "ListIndices" // ListIndicesRequest generates a "aws/request.Request" representing the @@ -9721,20 +11298,20 @@ func (c *IoT) ListIndicesRequest(input *ListIndicesInput) (req *request.Request, // See the AWS API reference guide for AWS IoT's // API operation ListIndices for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListIndices(input *ListIndicesInput) (*ListIndicesOutput, error) { @@ -9809,17 +11386,17 @@ func (c *IoT) ListJobExecutionsForJobRequest(input *ListJobExecutionsForJobInput // See the AWS API reference guide for AWS IoT's // API operation ListJobExecutionsForJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) ListJobExecutionsForJob(input *ListJobExecutionsForJobInput) (*ListJobExecutionsForJobOutput, error) { @@ -9894,17 +11471,17 @@ func (c *IoT) ListJobExecutionsForThingRequest(input *ListJobExecutionsForThingI // See the AWS API reference guide for AWS IoT's // API operation ListJobExecutionsForThing for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) ListJobExecutionsForThing(input *ListJobExecutionsForThingInput) (*ListJobExecutionsForThingOutput, error) { @@ -9979,17 +11556,17 @@ func (c *IoT) ListJobsRequest(input *ListJobsInput) (req *request.Request, outpu // See the AWS API reference guide for AWS IoT's // API operation ListJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) ListJobs(input *ListJobsInput) (*ListJobsOutput, error) { @@ -10064,14 +11641,14 @@ func (c *IoT) ListMitigationActionsRequest(input *ListMitigationActionsInput) (r // See the AWS API reference guide for AWS IoT's // API operation ListMitigationActions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListMitigationActions(input *ListMitigationActionsInput) (*ListMitigationActionsOutput, error) { @@ -10146,20 +11723,20 @@ func (c *IoT) ListOTAUpdatesRequest(input *ListOTAUpdatesInput) (req *request.Re // See the AWS API reference guide for AWS IoT's // API operation ListOTAUpdates for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) ListOTAUpdates(input *ListOTAUpdatesInput) (*ListOTAUpdatesOutput, error) { @@ -10234,20 +11811,20 @@ func (c *IoT) ListOutgoingCertificatesRequest(input *ListOutgoingCertificatesInp // See the AWS API reference guide for AWS IoT's // API operation ListOutgoingCertificates for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListOutgoingCertificates(input *ListOutgoingCertificatesInput) (*ListOutgoingCertificatesOutput, error) { @@ -10322,20 +11899,20 @@ func (c *IoT) ListPoliciesRequest(input *ListPoliciesInput) (req *request.Reques // See the AWS API reference guide for AWS IoT's // API operation ListPolicies for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListPolicies(input *ListPoliciesInput) (*ListPoliciesOutput, error) { @@ -10417,23 +11994,23 @@ func (c *IoT) ListPolicyPrincipalsRequest(input *ListPolicyPrincipalsInput) (req // See the AWS API reference guide for AWS IoT's // API operation ListPolicyPrincipals for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // // @@ -10512,23 +12089,23 @@ func (c *IoT) ListPolicyVersionsRequest(input *ListPolicyVersionsInput) (req *re // See the AWS API reference guide for AWS IoT's // API operation ListPolicyVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListPolicyVersions(input *ListPolicyVersionsInput) (*ListPolicyVersionsOutput, error) { @@ -10611,23 +12188,23 @@ func (c *IoT) ListPrincipalPoliciesRequest(input *ListPrincipalPoliciesInput) (r // See the AWS API reference guide for AWS IoT's // API operation ListPrincipalPolicies for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // // @@ -10708,23 +12285,23 @@ func (c *IoT) ListPrincipalThingsRequest(input *ListPrincipalThingsInput) (req * // See the AWS API reference guide for AWS IoT's // API operation ListPrincipalThings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) ListPrincipalThings(input *ListPrincipalThingsInput) (*ListPrincipalThingsOutput, error) { @@ -10748,6 +12325,179 @@ func (c *IoT) ListPrincipalThingsWithContext(ctx aws.Context, input *ListPrincip return out, req.Send() } +const opListProvisioningTemplateVersions = "ListProvisioningTemplateVersions" + +// ListProvisioningTemplateVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListProvisioningTemplateVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListProvisioningTemplateVersions for more information on using the ListProvisioningTemplateVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListProvisioningTemplateVersionsRequest method. +// req, resp := client.ListProvisioningTemplateVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) ListProvisioningTemplateVersionsRequest(input *ListProvisioningTemplateVersionsInput) (req *request.Request, output *ListProvisioningTemplateVersionsOutput) { + op := &request.Operation{ + Name: opListProvisioningTemplateVersions, + HTTPMethod: "GET", + HTTPPath: "/provisioning-templates/{templateName}/versions", + } + + if input == nil { + input = &ListProvisioningTemplateVersionsInput{} + } + + output = &ListProvisioningTemplateVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListProvisioningTemplateVersions API operation for AWS IoT. +// +// A list of fleet provisioning template 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 IoT's +// API operation ListProvisioningTemplateVersions for usage and error information. +// +// Returned Error Types: +// * InternalFailureException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * ThrottlingException +// The rate exceeds the limit. +// +// * ResourceNotFoundException +// The specified resource does not exist. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +func (c *IoT) ListProvisioningTemplateVersions(input *ListProvisioningTemplateVersionsInput) (*ListProvisioningTemplateVersionsOutput, error) { + req, out := c.ListProvisioningTemplateVersionsRequest(input) + return out, req.Send() +} + +// ListProvisioningTemplateVersionsWithContext is the same as ListProvisioningTemplateVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListProvisioningTemplateVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) ListProvisioningTemplateVersionsWithContext(ctx aws.Context, input *ListProvisioningTemplateVersionsInput, opts ...request.Option) (*ListProvisioningTemplateVersionsOutput, error) { + req, out := c.ListProvisioningTemplateVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListProvisioningTemplates = "ListProvisioningTemplates" + +// ListProvisioningTemplatesRequest generates a "aws/request.Request" representing the +// client's request for the ListProvisioningTemplates operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListProvisioningTemplates for more information on using the ListProvisioningTemplates +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListProvisioningTemplatesRequest method. +// req, resp := client.ListProvisioningTemplatesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) ListProvisioningTemplatesRequest(input *ListProvisioningTemplatesInput) (req *request.Request, output *ListProvisioningTemplatesOutput) { + op := &request.Operation{ + Name: opListProvisioningTemplates, + HTTPMethod: "GET", + HTTPPath: "/provisioning-templates", + } + + if input == nil { + input = &ListProvisioningTemplatesInput{} + } + + output = &ListProvisioningTemplatesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListProvisioningTemplates API operation for AWS IoT. +// +// Lists the fleet provisioning templates 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 IoT's +// API operation ListProvisioningTemplates for usage and error information. +// +// Returned Error Types: +// * InternalFailureException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * ThrottlingException +// The rate exceeds the limit. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +func (c *IoT) ListProvisioningTemplates(input *ListProvisioningTemplatesInput) (*ListProvisioningTemplatesOutput, error) { + req, out := c.ListProvisioningTemplatesRequest(input) + return out, req.Send() +} + +// ListProvisioningTemplatesWithContext is the same as ListProvisioningTemplates with the addition of +// the ability to pass a context and additional request options. +// +// See ListProvisioningTemplates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) ListProvisioningTemplatesWithContext(ctx aws.Context, input *ListProvisioningTemplatesInput, opts ...request.Option) (*ListProvisioningTemplatesOutput, error) { + req, out := c.ListProvisioningTemplatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opListRoleAliases = "ListRoleAliases" // ListRoleAliasesRequest generates a "aws/request.Request" representing the @@ -10799,20 +12549,20 @@ func (c *IoT) ListRoleAliasesRequest(input *ListRoleAliasesInput) (req *request. // See the AWS API reference guide for AWS IoT's // API operation ListRoleAliases for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListRoleAliases(input *ListRoleAliasesInput) (*ListRoleAliasesOutput, error) { @@ -10887,14 +12637,14 @@ func (c *IoT) ListScheduledAuditsRequest(input *ListScheduledAuditsInput) (req * // See the AWS API reference guide for AWS IoT's // API operation ListScheduledAudits for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListScheduledAudits(input *ListScheduledAuditsInput) (*ListScheduledAuditsOutput, error) { @@ -10971,14 +12721,14 @@ func (c *IoT) ListSecurityProfilesRequest(input *ListSecurityProfilesInput) (req // See the AWS API reference guide for AWS IoT's // API operation ListSecurityProfiles for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListSecurityProfiles(input *ListSecurityProfilesInput) (*ListSecurityProfilesOutput, error) { @@ -11053,17 +12803,17 @@ func (c *IoT) ListSecurityProfilesForTargetRequest(input *ListSecurityProfilesFo // See the AWS API reference guide for AWS IoT's // API operation ListSecurityProfilesForTarget for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) ListSecurityProfilesForTarget(input *ListSecurityProfilesForTargetInput) (*ListSecurityProfilesForTargetOutput, error) { @@ -11138,20 +12888,20 @@ func (c *IoT) ListStreamsRequest(input *ListStreamsInput) (req *request.Request, // See the AWS API reference guide for AWS IoT's // API operation ListStreams for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListStreams(input *ListStreamsInput) (*ListStreamsOutput, error) { @@ -11226,17 +12976,17 @@ func (c *IoT) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req * // See the AWS API reference guide for AWS IoT's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // func (c *IoT) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { @@ -11311,26 +13061,26 @@ func (c *IoT) ListTargetsForPolicyRequest(input *ListTargetsForPolicyInput) (req // See the AWS API reference guide for AWS IoT's // API operation ListTargetsForPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // func (c *IoT) ListTargetsForPolicy(input *ListTargetsForPolicyInput) (*ListTargetsForPolicyOutput, error) { @@ -11406,17 +13156,17 @@ func (c *IoT) ListTargetsForSecurityProfileRequest(input *ListTargetsForSecurity // See the AWS API reference guide for AWS IoT's // API operation ListTargetsForSecurityProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListTargetsForSecurityProfile(input *ListTargetsForSecurityProfileInput) (*ListTargetsForSecurityProfileOutput, error) { @@ -11491,14 +13241,14 @@ func (c *IoT) ListThingGroupsRequest(input *ListThingGroupsInput) (req *request. // See the AWS API reference guide for AWS IoT's // API operation ListThingGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) ListThingGroups(input *ListThingGroupsInput) (*ListThingGroupsOutput, error) { @@ -11573,14 +13323,14 @@ func (c *IoT) ListThingGroupsForThingRequest(input *ListThingGroupsForThingInput // See the AWS API reference guide for AWS IoT's // API operation ListThingGroupsForThing for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) ListThingGroupsForThing(input *ListThingGroupsForThingInput) (*ListThingGroupsForThingOutput, error) { @@ -11657,23 +13407,23 @@ func (c *IoT) ListThingPrincipalsRequest(input *ListThingPrincipalsInput) (req * // See the AWS API reference guide for AWS IoT's // API operation ListThingPrincipals for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) ListThingPrincipals(input *ListThingPrincipalsInput) (*ListThingPrincipalsOutput, error) { @@ -11748,17 +13498,17 @@ func (c *IoT) ListThingRegistrationTaskReportsRequest(input *ListThingRegistrati // See the AWS API reference guide for AWS IoT's // API operation ListThingRegistrationTaskReports for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListThingRegistrationTaskReports(input *ListThingRegistrationTaskReportsInput) (*ListThingRegistrationTaskReportsOutput, error) { @@ -11833,17 +13583,17 @@ func (c *IoT) ListThingRegistrationTasksRequest(input *ListThingRegistrationTask // See the AWS API reference guide for AWS IoT's // API operation ListThingRegistrationTasks for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListThingRegistrationTasks(input *ListThingRegistrationTasksInput) (*ListThingRegistrationTasksOutput, error) { @@ -11918,20 +13668,20 @@ func (c *IoT) ListThingTypesRequest(input *ListThingTypesInput) (req *request.Re // See the AWS API reference guide for AWS IoT's // API operation ListThingTypes for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListThingTypes(input *ListThingTypesInput) (*ListThingTypesOutput, error) { @@ -12009,20 +13759,20 @@ func (c *IoT) ListThingsRequest(input *ListThingsInput) (req *request.Request, o // See the AWS API reference guide for AWS IoT's // API operation ListThings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListThings(input *ListThingsInput) (*ListThingsOutput, error) { @@ -12097,17 +13847,17 @@ func (c *IoT) ListThingsInBillingGroupRequest(input *ListThingsInBillingGroupInp // See the AWS API reference guide for AWS IoT's // API operation ListThingsInBillingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // func (c *IoT) ListThingsInBillingGroup(input *ListThingsInBillingGroupInput) (*ListThingsInBillingGroupOutput, error) { @@ -12182,14 +13932,14 @@ func (c *IoT) ListThingsInThingGroupRequest(input *ListThingsInThingGroupInput) // See the AWS API reference guide for AWS IoT's // API operation ListThingsInThingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) ListThingsInThingGroup(input *ListThingsInThingGroupInput) (*ListThingsInThingGroupOutput, error) { @@ -12213,6 +13963,91 @@ func (c *IoT) ListThingsInThingGroupWithContext(ctx aws.Context, input *ListThin return out, req.Send() } +const opListTopicRuleDestinations = "ListTopicRuleDestinations" + +// ListTopicRuleDestinationsRequest generates a "aws/request.Request" representing the +// client's request for the ListTopicRuleDestinations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTopicRuleDestinations for more information on using the ListTopicRuleDestinations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTopicRuleDestinationsRequest method. +// req, resp := client.ListTopicRuleDestinationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) ListTopicRuleDestinationsRequest(input *ListTopicRuleDestinationsInput) (req *request.Request, output *ListTopicRuleDestinationsOutput) { + op := &request.Operation{ + Name: opListTopicRuleDestinations, + HTTPMethod: "GET", + HTTPPath: "/destinations", + } + + if input == nil { + input = &ListTopicRuleDestinationsInput{} + } + + output = &ListTopicRuleDestinationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTopicRuleDestinations API operation for AWS IoT. +// +// Lists all the topic rule destinations 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 IoT's +// API operation ListTopicRuleDestinations for usage and error information. +// +// Returned Error Types: +// * InternalException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * ServiceUnavailableException +// The service is temporarily unavailable. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +func (c *IoT) ListTopicRuleDestinations(input *ListTopicRuleDestinationsInput) (*ListTopicRuleDestinationsOutput, error) { + req, out := c.ListTopicRuleDestinationsRequest(input) + return out, req.Send() +} + +// ListTopicRuleDestinationsWithContext is the same as ListTopicRuleDestinations with the addition of +// the ability to pass a context and additional request options. +// +// See ListTopicRuleDestinations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) ListTopicRuleDestinationsWithContext(ctx aws.Context, input *ListTopicRuleDestinationsInput, opts ...request.Option) (*ListTopicRuleDestinationsOutput, error) { + req, out := c.ListTopicRuleDestinationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opListTopicRules = "ListTopicRules" // ListTopicRulesRequest generates a "aws/request.Request" representing the @@ -12264,14 +14099,14 @@ func (c *IoT) ListTopicRulesRequest(input *ListTopicRulesInput) (req *request.Re // See the AWS API reference guide for AWS IoT's // API operation ListTopicRules for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // An unexpected error has occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) ListTopicRules(input *ListTopicRulesInput) (*ListTopicRulesOutput, error) { @@ -12346,17 +14181,17 @@ func (c *IoT) ListV2LoggingLevelsRequest(input *ListV2LoggingLevelsInput) (req * // See the AWS API reference guide for AWS IoT's // API operation ListV2LoggingLevels for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // An unexpected error has occurred. // -// * ErrCodeNotConfiguredException "NotConfiguredException" +// * NotConfiguredException // The resource is not configured. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) ListV2LoggingLevels(input *ListV2LoggingLevelsInput) (*ListV2LoggingLevelsOutput, error) { @@ -12433,14 +14268,14 @@ func (c *IoT) ListViolationEventsRequest(input *ListViolationEventsInput) (req * // See the AWS API reference guide for AWS IoT's // API operation ListViolationEvents for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ListViolationEvents(input *ListViolationEventsInput) (*ListViolationEventsOutput, error) { @@ -12521,32 +14356,32 @@ func (c *IoT) RegisterCACertificateRequest(input *RegisterCACertificateInput) (r // See the AWS API reference guide for AWS IoT's // API operation RegisterCACertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// Returned Error Types: +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeRegistrationCodeValidationException "RegistrationCodeValidationException" +// * RegistrationCodeValidationException // The registration code is invalid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeCertificateValidationException "CertificateValidationException" +// * CertificateValidationException // The certificate is invalid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) RegisterCACertificate(input *RegisterCACertificateInput) (*RegisterCACertificateOutput, error) { @@ -12623,34 +14458,34 @@ func (c *IoT) RegisterCertificateRequest(input *RegisterCertificateInput) (req * // See the AWS API reference guide for AWS IoT's // API operation RegisterCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// Returned Error Types: +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeCertificateValidationException "CertificateValidationException" +// * CertificateValidationException // The certificate is invalid. // -// * ErrCodeCertificateStateException "CertificateStateException" +// * CertificateStateException // The certificate operation is not allowed. // -// * ErrCodeCertificateConflictException "CertificateConflictException" +// * CertificateConflictException // Unable to verify the CA certificate used to sign the device certificate you // are attempting to register. This is happens when you have registered more // than one CA certificate that has the same subject field and public key. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) RegisterCertificate(input *RegisterCertificateInput) (*RegisterCertificateOutput, error) { @@ -12716,7 +14551,11 @@ func (c *IoT) RegisterThingRequest(input *RegisterThingInput) (req *request.Requ // RegisterThing API operation for AWS IoT. // -// Provisions a thing. +// Provisions a thing in the device registry. RegisterThing calls other AWS +// IoT control plane APIs. These calls might exceed your account level AWS IoT +// Throttling Limits (https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_iot) +// and cause throttle errors. Please contact AWS Customer Support (https://console.aws.amazon.com/support/home) +// to raise your throttling limits 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 @@ -12725,27 +14564,27 @@ func (c *IoT) RegisterThingRequest(input *RegisterThingInput) (req *request.Requ // See the AWS API reference guide for AWS IoT's // API operation RegisterThing for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalFailureException "InternalFailureException" +// Returned Error Types: +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeConflictingResourceUpdateException "ConflictingResourceUpdateException" +// * ConflictingResourceUpdateException // A conflicting resource update exception. This exception is thrown when two // pending updates cause a conflict. // -// * ErrCodeResourceRegistrationFailureException "ResourceRegistrationFailureException" +// * ResourceRegistrationFailureException // The resource registration failed. // func (c *IoT) RegisterThing(input *RegisterThingInput) (*RegisterThingOutput, error) { @@ -12829,27 +14668,27 @@ func (c *IoT) RejectCertificateTransferRequest(input *RejectCertificateTransferI // See the AWS API reference guide for AWS IoT's // API operation RejectCertificateTransfer for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeTransferAlreadyCompletedException "TransferAlreadyCompletedException" +// * TransferAlreadyCompletedException // You can't revert the certificate transfer because the transfer is already // complete. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) RejectCertificateTransfer(input *RejectCertificateTransferInput) (*RejectCertificateTransferOutput, error) { @@ -12925,17 +14764,17 @@ func (c *IoT) RemoveThingFromBillingGroupRequest(input *RemoveThingFromBillingGr // See the AWS API reference guide for AWS IoT's // API operation RemoveThingFromBillingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) RemoveThingFromBillingGroup(input *RemoveThingFromBillingGroupInput) (*RemoveThingFromBillingGroupOutput, error) { @@ -13011,17 +14850,17 @@ func (c *IoT) RemoveThingFromThingGroupRequest(input *RemoveThingFromThingGroupI // See the AWS API reference guide for AWS IoT's // API operation RemoveThingFromThingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) RemoveThingFromThingGroup(input *RemoveThingFromThingGroupInput) (*RemoveThingFromThingGroupOutput, error) { @@ -13099,23 +14938,23 @@ func (c *IoT) ReplaceTopicRuleRequest(input *ReplaceTopicRuleInput) (req *reques // See the AWS API reference guide for AWS IoT's // API operation ReplaceTopicRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeSqlParseException "SqlParseException" +// Returned Error Types: +// * SqlParseException // The Rule-SQL expression can't be parsed correctly. // -// * ErrCodeInternalException "InternalException" +// * InternalException // An unexpected error has occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeConflictingResourceUpdateException "ConflictingResourceUpdateException" +// * ConflictingResourceUpdateException // A conflicting resource update exception. This exception is thrown when two // pending updates cause a conflict. // @@ -13191,29 +15030,29 @@ func (c *IoT) SearchIndexRequest(input *SearchIndexInput) (req *request.Request, // See the AWS API reference guide for AWS IoT's // API operation SearchIndex for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidQueryException "InvalidQueryException" +// * InvalidQueryException // The query is invalid. // -// * ErrCodeIndexNotReadyException "IndexNotReadyException" +// * IndexNotReadyException // The index is not ready. // func (c *IoT) SearchIndex(input *SearchIndexInput) (*SearchIndexOutput, error) { @@ -13289,26 +15128,26 @@ func (c *IoT) SetDefaultAuthorizerRequest(input *SetDefaultAuthorizerInput) (req // See the AWS API reference guide for AWS IoT's // API operation SetDefaultAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // func (c *IoT) SetDefaultAuthorizer(input *SetDefaultAuthorizerInput) (*SetDefaultAuthorizerOutput, error) { @@ -13387,23 +15226,23 @@ func (c *IoT) SetDefaultPolicyVersionRequest(input *SetDefaultPolicyVersionInput // See the AWS API reference guide for AWS IoT's // API operation SetDefaultPolicyVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) SetDefaultPolicyVersion(input *SetDefaultPolicyVersionInput) (*SetDefaultPolicyVersionOutput, error) { @@ -13481,14 +15320,14 @@ func (c *IoT) SetLoggingOptionsRequest(input *SetLoggingOptionsInput) (req *requ // See the AWS API reference guide for AWS IoT's // API operation SetLoggingOptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // An unexpected error has occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) SetLoggingOptions(input *SetLoggingOptionsInput) (*SetLoggingOptionsOutput, error) { @@ -13564,17 +15403,17 @@ func (c *IoT) SetV2LoggingLevelRequest(input *SetV2LoggingLevelInput) (req *requ // See the AWS API reference guide for AWS IoT's // API operation SetV2LoggingLevel for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // An unexpected error has occurred. // -// * ErrCodeNotConfiguredException "NotConfiguredException" +// * NotConfiguredException // The resource is not configured. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) SetV2LoggingLevel(input *SetV2LoggingLevelInput) (*SetV2LoggingLevelOutput, error) { @@ -13650,14 +15489,14 @@ func (c *IoT) SetV2LoggingOptionsRequest(input *SetV2LoggingOptionsInput) (req * // See the AWS API reference guide for AWS IoT's // API operation SetV2LoggingOptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // An unexpected error has occurred. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) SetV2LoggingOptions(input *SetV2LoggingOptionsInput) (*SetV2LoggingOptionsOutput, error) { @@ -13732,21 +15571,21 @@ func (c *IoT) StartAuditMitigationActionsTaskRequest(input *StartAuditMitigation // See the AWS API reference guide for AWS IoT's // API operation StartAuditMitigationActionsTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeTaskAlreadyExistsException "TaskAlreadyExistsException" +// * TaskAlreadyExistsException // This exception occurs if you attempt to start a task with the same task-id // as an existing task but with a different clientRequestToken. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) StartAuditMitigationActionsTask(input *StartAuditMitigationActionsTaskInput) (*StartAuditMitigationActionsTaskOutput, error) { @@ -13821,17 +15660,17 @@ func (c *IoT) StartOnDemandAuditTaskRequest(input *StartOnDemandAuditTaskInput) // See the AWS API reference guide for AWS IoT's // API operation StartOnDemandAuditTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // func (c *IoT) StartOnDemandAuditTask(input *StartOnDemandAuditTaskInput) (*StartOnDemandAuditTaskOutput, error) { @@ -13906,17 +15745,17 @@ func (c *IoT) StartThingRegistrationTaskRequest(input *StartThingRegistrationTas // See the AWS API reference guide for AWS IoT's // API operation StartThingRegistrationTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) StartThingRegistrationTask(input *StartThingRegistrationTaskInput) (*StartThingRegistrationTaskOutput, error) { @@ -13992,20 +15831,20 @@ func (c *IoT) StopThingRegistrationTaskRequest(input *StopThingRegistrationTaskI // See the AWS API reference guide for AWS IoT's // API operation StopThingRegistrationTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) StopThingRegistrationTask(input *StopThingRegistrationTaskInput) (*StopThingRegistrationTaskOutput, error) { @@ -14082,20 +15921,20 @@ func (c *IoT) TagResourceRequest(input *TagResourceInput) (req *request.Request, // See the AWS API reference guide for AWS IoT's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // func (c *IoT) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { @@ -14172,26 +16011,26 @@ func (c *IoT) TestAuthorizationRequest(input *TestAuthorizationInput) (req *requ // See the AWS API reference guide for AWS IoT's // API operation TestAuthorization for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // func (c *IoT) TestAuthorization(input *TestAuthorizationInput) (*TestAuthorizationOutput, error) { @@ -14268,26 +16107,26 @@ func (c *IoT) TestInvokeAuthorizerRequest(input *TestInvokeAuthorizerInput) (req // See the AWS API reference guide for AWS IoT's // API operation TestInvokeAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeInvalidResponseException "InvalidResponseException" +// * InvalidResponseException // The response is invalid. // func (c *IoT) TestInvokeAuthorizer(input *TestInvokeAuthorizerInput) (*TestInvokeAuthorizerOutput, error) { @@ -14373,30 +16212,30 @@ func (c *IoT) TransferCertificateRequest(input *TransferCertificateInput) (req * // See the AWS API reference guide for AWS IoT's // API operation TransferCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeCertificateStateException "CertificateStateException" +// * CertificateStateException // The certificate operation is not allowed. // -// * ErrCodeTransferConflictException "TransferConflictException" +// * TransferConflictException // You can't transfer the certificate because authorization policies are still // attached. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) TransferCertificate(input *TransferCertificateInput) (*TransferCertificateOutput, error) { @@ -14472,17 +16311,17 @@ func (c *IoT) UntagResourceRequest(input *UntagResourceInput) (req *request.Requ // See the AWS API reference guide for AWS IoT's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // func (c *IoT) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { @@ -14560,14 +16399,14 @@ func (c *IoT) UpdateAccountAuditConfigurationRequest(input *UpdateAccountAuditCo // See the AWS API reference guide for AWS IoT's // API operation UpdateAccountAuditConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) UpdateAccountAuditConfiguration(input *UpdateAccountAuditConfigurationInput) (*UpdateAccountAuditConfigurationOutput, error) { @@ -14642,26 +16481,26 @@ func (c *IoT) UpdateAuthorizerRequest(input *UpdateAuthorizerInput) (req *reques // See the AWS API reference guide for AWS IoT's // API operation UpdateAuthorizer for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit has been exceeded. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) UpdateAuthorizer(input *UpdateAuthorizerInput) (*UpdateAuthorizerOutput, error) { @@ -14736,21 +16575,21 @@ func (c *IoT) UpdateBillingGroupRequest(input *UpdateBillingGroupInput) (req *re // See the AWS API reference guide for AWS IoT's // API operation UpdateBillingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeVersionConflictException "VersionConflictException" +// * VersionConflictException // An exception thrown when the version of an entity specified with the expectedVersion // parameter does not match the latest version in the system. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) UpdateBillingGroup(input *UpdateBillingGroupInput) (*UpdateBillingGroupOutput, error) { @@ -14826,23 +16665,23 @@ func (c *IoT) UpdateCACertificateRequest(input *UpdateCACertificateInput) (req * // See the AWS API reference guide for AWS IoT's // API operation UpdateCACertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) UpdateCACertificate(input *UpdateCACertificateInput) (*UpdateCACertificateOutput, error) { @@ -14924,26 +16763,26 @@ func (c *IoT) UpdateCertificateRequest(input *UpdateCertificateInput) (req *requ // See the AWS API reference guide for AWS IoT's // API operation UpdateCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeCertificateStateException "CertificateStateException" +// * CertificateStateException // The certificate operation is not allowed. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) UpdateCertificate(input *UpdateCertificateInput) (*UpdateCertificateOutput, error) { @@ -14967,6 +16806,103 @@ func (c *IoT) UpdateCertificateWithContext(ctx aws.Context, input *UpdateCertifi return out, req.Send() } +const opUpdateDomainConfiguration = "UpdateDomainConfiguration" + +// UpdateDomainConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDomainConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateDomainConfiguration for more information on using the UpdateDomainConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateDomainConfigurationRequest method. +// req, resp := client.UpdateDomainConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) UpdateDomainConfigurationRequest(input *UpdateDomainConfigurationInput) (req *request.Request, output *UpdateDomainConfigurationOutput) { + op := &request.Operation{ + Name: opUpdateDomainConfiguration, + HTTPMethod: "PUT", + HTTPPath: "/domainConfigurations/{domainConfigurationName}", + } + + if input == nil { + input = &UpdateDomainConfigurationInput{} + } + + output = &UpdateDomainConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateDomainConfiguration API operation for AWS IoT. +// +// Updates values stored in the domain configuration. Domain configurations +// for default endpoints can't be updated. +// +// The domain configuration feature is in public preview and is subject to 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 IoT's +// API operation UpdateDomainConfiguration for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The specified resource does not exist. +// +// * CertificateValidationException +// The certificate is invalid. +// +// * InvalidRequestException +// The request is not valid. +// +// * ThrottlingException +// The rate exceeds the limit. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * ServiceUnavailableException +// The service is temporarily unavailable. +// +// * InternalFailureException +// An unexpected error has occurred. +// +func (c *IoT) UpdateDomainConfiguration(input *UpdateDomainConfigurationInput) (*UpdateDomainConfigurationOutput, error) { + req, out := c.UpdateDomainConfigurationRequest(input) + return out, req.Send() +} + +// UpdateDomainConfigurationWithContext is the same as UpdateDomainConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDomainConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) UpdateDomainConfigurationWithContext(ctx aws.Context, input *UpdateDomainConfigurationInput, opts ...request.Option) (*UpdateDomainConfigurationOutput, error) { + req, out := c.UpdateDomainConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opUpdateDynamicThingGroup = "UpdateDynamicThingGroup" // UpdateDynamicThingGroupRequest generates a "aws/request.Request" representing the @@ -15018,24 +16954,24 @@ func (c *IoT) UpdateDynamicThingGroupRequest(input *UpdateDynamicThingGroupInput // See the AWS API reference guide for AWS IoT's // API operation UpdateDynamicThingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeVersionConflictException "VersionConflictException" +// * VersionConflictException // An exception thrown when the version of an entity specified with the expectedVersion // parameter does not match the latest version in the system. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidQueryException "InvalidQueryException" +// * InvalidQueryException // The query is invalid. // func (c *IoT) UpdateDynamicThingGroup(input *UpdateDynamicThingGroupInput) (*UpdateDynamicThingGroupOutput, error) { @@ -15111,14 +17047,14 @@ func (c *IoT) UpdateEventConfigurationsRequest(input *UpdateEventConfigurationsI // See the AWS API reference guide for AWS IoT's // API operation UpdateEventConfigurations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // func (c *IoT) UpdateEventConfigurations(input *UpdateEventConfigurationsInput) (*UpdateEventConfigurationsOutput, error) { @@ -15194,20 +17130,20 @@ func (c *IoT) UpdateIndexingConfigurationRequest(input *UpdateIndexingConfigurat // See the AWS API reference guide for AWS IoT's // API operation UpdateIndexingConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) UpdateIndexingConfiguration(input *UpdateIndexingConfigurationInput) (*UpdateIndexingConfigurationOutput, error) { @@ -15283,17 +17219,17 @@ func (c *IoT) UpdateJobRequest(input *UpdateJobInput) (req *request.Request, out // See the AWS API reference guide for AWS IoT's // API operation UpdateJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // func (c *IoT) UpdateJob(input *UpdateJobInput) (*UpdateJobOutput, error) { @@ -15368,17 +17304,17 @@ func (c *IoT) UpdateMitigationActionRequest(input *UpdateMitigationActionInput) // See the AWS API reference guide for AWS IoT's // API operation UpdateMitigationAction for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) UpdateMitigationAction(input *UpdateMitigationActionInput) (*UpdateMitigationActionOutput, error) { @@ -15402,6 +17338,96 @@ func (c *IoT) UpdateMitigationActionWithContext(ctx aws.Context, input *UpdateMi return out, req.Send() } +const opUpdateProvisioningTemplate = "UpdateProvisioningTemplate" + +// UpdateProvisioningTemplateRequest generates a "aws/request.Request" representing the +// client's request for the UpdateProvisioningTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateProvisioningTemplate for more information on using the UpdateProvisioningTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateProvisioningTemplateRequest method. +// req, resp := client.UpdateProvisioningTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) UpdateProvisioningTemplateRequest(input *UpdateProvisioningTemplateInput) (req *request.Request, output *UpdateProvisioningTemplateOutput) { + op := &request.Operation{ + Name: opUpdateProvisioningTemplate, + HTTPMethod: "PATCH", + HTTPPath: "/provisioning-templates/{templateName}", + } + + if input == nil { + input = &UpdateProvisioningTemplateInput{} + } + + output = &UpdateProvisioningTemplateOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateProvisioningTemplate API operation for AWS IoT. +// +// Updates a fleet provisioning 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 IoT's +// API operation UpdateProvisioningTemplate for usage and error information. +// +// Returned Error Types: +// * InternalFailureException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * ResourceNotFoundException +// The specified resource does not exist. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * ConflictingResourceUpdateException +// A conflicting resource update exception. This exception is thrown when two +// pending updates cause a conflict. +// +func (c *IoT) UpdateProvisioningTemplate(input *UpdateProvisioningTemplateInput) (*UpdateProvisioningTemplateOutput, error) { + req, out := c.UpdateProvisioningTemplateRequest(input) + return out, req.Send() +} + +// UpdateProvisioningTemplateWithContext is the same as UpdateProvisioningTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateProvisioningTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) UpdateProvisioningTemplateWithContext(ctx aws.Context, input *UpdateProvisioningTemplateInput, opts ...request.Option) (*UpdateProvisioningTemplateOutput, error) { + req, out := c.UpdateProvisioningTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opUpdateRoleAlias = "UpdateRoleAlias" // UpdateRoleAliasRequest generates a "aws/request.Request" representing the @@ -15453,23 +17479,23 @@ func (c *IoT) UpdateRoleAliasRequest(input *UpdateRoleAliasInput) (req *request. // See the AWS API reference guide for AWS IoT's // API operation UpdateRoleAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) UpdateRoleAlias(input *UpdateRoleAliasInput) (*UpdateRoleAliasOutput, error) { @@ -15545,17 +17571,17 @@ func (c *IoT) UpdateScheduledAuditRequest(input *UpdateScheduledAuditInput) (req // See the AWS API reference guide for AWS IoT's // API operation UpdateScheduledAudit for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) UpdateScheduledAudit(input *UpdateScheduledAuditInput) (*UpdateScheduledAuditOutput, error) { @@ -15630,21 +17656,21 @@ func (c *IoT) UpdateSecurityProfileRequest(input *UpdateSecurityProfileInput) (r // See the AWS API reference guide for AWS IoT's // API operation UpdateSecurityProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeVersionConflictException "VersionConflictException" +// * VersionConflictException // An exception thrown when the version of an entity specified with the expectedVersion // parameter does not match the latest version in the system. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) UpdateSecurityProfile(input *UpdateSecurityProfileInput) (*UpdateSecurityProfileOutput, error) { @@ -15719,23 +17745,23 @@ func (c *IoT) UpdateStreamRequest(input *UpdateStreamInput) (req *request.Reques // See the AWS API reference guide for AWS IoT's // API operation UpdateStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) UpdateStream(input *UpdateStreamInput) (*UpdateStreamOutput, error) { @@ -15811,27 +17837,27 @@ func (c *IoT) UpdateThingRequest(input *UpdateThingInput) (req *request.Request, // See the AWS API reference guide for AWS IoT's // API operation UpdateThing for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeVersionConflictException "VersionConflictException" +// * VersionConflictException // An exception thrown when the version of an entity specified with the expectedVersion // parameter does not match the latest version in the system. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // You are not authorized to perform this operation. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) UpdateThing(input *UpdateThingInput) (*UpdateThingOutput, error) { @@ -15906,21 +17932,21 @@ func (c *IoT) UpdateThingGroupRequest(input *UpdateThingGroupInput) (req *reques // See the AWS API reference guide for AWS IoT's // API operation UpdateThingGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeVersionConflictException "VersionConflictException" +// * VersionConflictException // An exception thrown when the version of an entity specified with the expectedVersion // parameter does not match the latest version in the system. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) UpdateThingGroup(input *UpdateThingGroupInput) (*UpdateThingGroupOutput, error) { @@ -15996,17 +18022,17 @@ func (c *IoT) UpdateThingGroupsForThingRequest(input *UpdateThingGroupsForThingI // See the AWS API reference guide for AWS IoT's // API operation UpdateThingGroupsForThing for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource does not exist. // func (c *IoT) UpdateThingGroupsForThing(input *UpdateThingGroupsForThingInput) (*UpdateThingGroupsForThingOutput, error) { @@ -16030,6 +18056,97 @@ func (c *IoT) UpdateThingGroupsForThingWithContext(ctx aws.Context, input *Updat return out, req.Send() } +const opUpdateTopicRuleDestination = "UpdateTopicRuleDestination" + +// UpdateTopicRuleDestinationRequest generates a "aws/request.Request" representing the +// client's request for the UpdateTopicRuleDestination operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateTopicRuleDestination for more information on using the UpdateTopicRuleDestination +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateTopicRuleDestinationRequest method. +// req, resp := client.UpdateTopicRuleDestinationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +func (c *IoT) UpdateTopicRuleDestinationRequest(input *UpdateTopicRuleDestinationInput) (req *request.Request, output *UpdateTopicRuleDestinationOutput) { + op := &request.Operation{ + Name: opUpdateTopicRuleDestination, + HTTPMethod: "PATCH", + HTTPPath: "/destinations", + } + + if input == nil { + input = &UpdateTopicRuleDestinationInput{} + } + + output = &UpdateTopicRuleDestinationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateTopicRuleDestination API operation for AWS IoT. +// +// Updates a topic rule destination. You use this to change the status, endpoint +// URL, or confirmation URL of 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 AWS IoT's +// API operation UpdateTopicRuleDestination for usage and error information. +// +// Returned Error Types: +// * InternalException +// An unexpected error has occurred. +// +// * InvalidRequestException +// The request is not valid. +// +// * ServiceUnavailableException +// The service is temporarily unavailable. +// +// * UnauthorizedException +// You are not authorized to perform this operation. +// +// * ConflictingResourceUpdateException +// A conflicting resource update exception. This exception is thrown when two +// pending updates cause a conflict. +// +func (c *IoT) UpdateTopicRuleDestination(input *UpdateTopicRuleDestinationInput) (*UpdateTopicRuleDestinationOutput, error) { + req, out := c.UpdateTopicRuleDestinationRequest(input) + return out, req.Send() +} + +// UpdateTopicRuleDestinationWithContext is the same as UpdateTopicRuleDestination with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTopicRuleDestination for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *IoT) UpdateTopicRuleDestinationWithContext(ctx aws.Context, input *UpdateTopicRuleDestinationInput, opts ...request.Option) (*UpdateTopicRuleDestinationOutput, error) { + req, out := c.UpdateTopicRuleDestinationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opValidateSecurityProfileBehaviors = "ValidateSecurityProfileBehaviors" // ValidateSecurityProfileBehaviorsRequest generates a "aws/request.Request" representing the @@ -16081,14 +18198,14 @@ func (c *IoT) ValidateSecurityProfileBehaviorsRequest(input *ValidateSecurityPro // See the AWS API reference guide for AWS IoT's // API operation ValidateSecurityProfileBehaviors for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is not valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The rate exceeds the limit. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An unexpected error has occurred. // func (c *IoT) ValidateSecurityProfileBehaviors(input *ValidateSecurityProfileBehaviorsInput) (*ValidateSecurityProfileBehaviorsOutput, error) { @@ -16342,12 +18459,19 @@ type Action struct { // Write to an Amazon Kinesis Firehose stream. Firehose *FirehoseAction `locationName:"firehose" type:"structure"` + // Send data to an HTTPS endpoint. + Http *HttpAction `locationName:"http" type:"structure"` + // Sends message data to an AWS IoT Analytics channel. IotAnalytics *IotAnalyticsAction `locationName:"iotAnalytics" type:"structure"` // Sends an input to an AWS IoT Events detector. IotEvents *IotEventsAction `locationName:"iotEvents" type:"structure"` + // Sends data from the MQTT message that triggered the rule to AWS IoT SiteWise + // asset properties. + IotSiteWise *IotSiteWiseAction `locationName:"iotSiteWise" type:"structure"` + // Write data to an Amazon Kinesis stream. Kinesis *KinesisAction `locationName:"kinesis" type:"structure"` @@ -16416,11 +18540,21 @@ func (s *Action) Validate() error { invalidParams.AddNested("Firehose", err.(request.ErrInvalidParams)) } } + if s.Http != nil { + if err := s.Http.Validate(); err != nil { + invalidParams.AddNested("Http", err.(request.ErrInvalidParams)) + } + } if s.IotEvents != nil { if err := s.IotEvents.Validate(); err != nil { invalidParams.AddNested("IotEvents", err.(request.ErrInvalidParams)) } } + if s.IotSiteWise != nil { + if err := s.IotSiteWise.Validate(); err != nil { + invalidParams.AddNested("IotSiteWise", err.(request.ErrInvalidParams)) + } + } if s.Kinesis != nil { if err := s.Kinesis.Validate(); err != nil { invalidParams.AddNested("Kinesis", err.(request.ErrInvalidParams)) @@ -16504,6 +18638,12 @@ func (s *Action) SetFirehose(v *FirehoseAction) *Action { return s } +// SetHttp sets the Http field's value. +func (s *Action) SetHttp(v *HttpAction) *Action { + s.Http = v + return s +} + // SetIotAnalytics sets the IotAnalytics field's value. func (s *Action) SetIotAnalytics(v *IotAnalyticsAction) *Action { s.IotAnalytics = v @@ -16516,6 +18656,12 @@ func (s *Action) SetIotEvents(v *IotEventsAction) *Action { return s } +// SetIotSiteWise sets the IotSiteWise field's value. +func (s *Action) SetIotSiteWise(v *IotSiteWiseAction) *Action { + s.IotSiteWise = v + return s +} + // SetKinesis sets the Kinesis field's value. func (s *Action) SetKinesis(v *KinesisAction) *Action { s.Kinesis = v @@ -16950,6 +19096,196 @@ func (s *Allowed) SetPolicies(v []*Policy) *Allowed { return s } +// An asset property timestamp entry containing the following information. +type AssetPropertyTimestamp struct { + _ struct{} `type:"structure"` + + // Optional. A string that contains the nanosecond time offset. Accepts substitution + // templates. + OffsetInNanos *string `locationName:"offsetInNanos" type:"string"` + + // A string that contains the time in seconds since epoch. Accepts substitution + // templates. + // + // TimeInSeconds is a required field + TimeInSeconds *string `locationName:"timeInSeconds" type:"string" required:"true"` +} + +// String returns the string representation +func (s AssetPropertyTimestamp) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssetPropertyTimestamp) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssetPropertyTimestamp) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssetPropertyTimestamp"} + if s.TimeInSeconds == nil { + invalidParams.Add(request.NewErrParamRequired("TimeInSeconds")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOffsetInNanos sets the OffsetInNanos field's value. +func (s *AssetPropertyTimestamp) SetOffsetInNanos(v string) *AssetPropertyTimestamp { + s.OffsetInNanos = &v + return s +} + +// SetTimeInSeconds sets the TimeInSeconds field's value. +func (s *AssetPropertyTimestamp) SetTimeInSeconds(v string) *AssetPropertyTimestamp { + s.TimeInSeconds = &v + return s +} + +// An asset property value entry containing the following information. +type AssetPropertyValue struct { + _ struct{} `type:"structure"` + + // Optional. A string that describes the quality of the value. Accepts substitution + // templates. Must be GOOD, BAD, or UNCERTAIN. + Quality *string `locationName:"quality" type:"string"` + + // The asset property value timestamp. + // + // Timestamp is a required field + Timestamp *AssetPropertyTimestamp `locationName:"timestamp" type:"structure" required:"true"` + + // The value of the asset property. + // + // Value is a required field + Value *AssetPropertyVariant `locationName:"value" type:"structure" required:"true"` +} + +// String returns the string representation +func (s AssetPropertyValue) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssetPropertyValue) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssetPropertyValue) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssetPropertyValue"} + if s.Timestamp == nil { + invalidParams.Add(request.NewErrParamRequired("Timestamp")) + } + if s.Value == nil { + invalidParams.Add(request.NewErrParamRequired("Value")) + } + if s.Timestamp != nil { + if err := s.Timestamp.Validate(); err != nil { + invalidParams.AddNested("Timestamp", err.(request.ErrInvalidParams)) + } + } + if s.Value != nil { + if err := s.Value.Validate(); err != nil { + invalidParams.AddNested("Value", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetQuality sets the Quality field's value. +func (s *AssetPropertyValue) SetQuality(v string) *AssetPropertyValue { + s.Quality = &v + return s +} + +// SetTimestamp sets the Timestamp field's value. +func (s *AssetPropertyValue) SetTimestamp(v *AssetPropertyTimestamp) *AssetPropertyValue { + s.Timestamp = v + return s +} + +// SetValue sets the Value field's value. +func (s *AssetPropertyValue) SetValue(v *AssetPropertyVariant) *AssetPropertyValue { + s.Value = v + return s +} + +// Contains an asset property value (of a single type). +type AssetPropertyVariant struct { + _ struct{} `type:"structure"` + + // Optional. A string that contains the boolean value (true or false) of the + // value entry. Accepts substitution templates. + BooleanValue *string `locationName:"booleanValue" type:"string"` + + // Optional. A string that contains the double value of the value entry. Accepts + // substitution templates. + DoubleValue *string `locationName:"doubleValue" type:"string"` + + // Optional. A string that contains the integer value of the value entry. Accepts + // substitution templates. + IntegerValue *string `locationName:"integerValue" type:"string"` + + // Optional. The string value of the value entry. Accepts substitution templates. + StringValue *string `locationName:"stringValue" min:"1" type:"string"` +} + +// String returns the string representation +func (s AssetPropertyVariant) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssetPropertyVariant) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssetPropertyVariant) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssetPropertyVariant"} + if s.StringValue != nil && len(*s.StringValue) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StringValue", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBooleanValue sets the BooleanValue field's value. +func (s *AssetPropertyVariant) SetBooleanValue(v string) *AssetPropertyVariant { + s.BooleanValue = &v + return s +} + +// SetDoubleValue sets the DoubleValue field's value. +func (s *AssetPropertyVariant) SetDoubleValue(v string) *AssetPropertyVariant { + s.DoubleValue = &v + return s +} + +// SetIntegerValue sets the IntegerValue field's value. +func (s *AssetPropertyVariant) SetIntegerValue(v string) *AssetPropertyVariant { + s.IntegerValue = &v + return s +} + +// SetStringValue sets the StringValue field's value. +func (s *AssetPropertyVariant) SetStringValue(v string) *AssetPropertyVariant { + s.StringValue = &v + return s +} + type AssociateTargetsWithJobInput struct { _ struct{} `type:"structure"` @@ -17273,7 +19609,8 @@ func (s AttachSecurityProfileOutput) GoString() string { type AttachThingPrincipalInput struct { _ struct{} `type:"structure"` - // The principal, such as a certificate or other credential. + // The principal, which can be a certificate ARN (as returned from the CreateCertificate + // operation) or an Amazon Cognito ID. // // Principal is a required field Principal *string `location:"header" locationName:"x-amzn-principal" type:"string" required:"true"` @@ -17981,6 +20318,53 @@ func (s *AuthResult) SetMissingContextValues(v []*string) *AuthResult { return s } +// An object that specifies the authorization service for a domain. +type AuthorizerConfig struct { + _ struct{} `type:"structure"` + + // A Boolean that specifies whether the domain configuration's authorization + // service can be overridden. + AllowAuthorizerOverride *bool `locationName:"allowAuthorizerOverride" type:"boolean"` + + // The name of the authorization service for a domain configuration. + DefaultAuthorizerName *string `locationName:"defaultAuthorizerName" min:"1" type:"string"` +} + +// String returns the string representation +func (s AuthorizerConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AuthorizerConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AuthorizerConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AuthorizerConfig"} + if s.DefaultAuthorizerName != nil && len(*s.DefaultAuthorizerName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DefaultAuthorizerName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAllowAuthorizerOverride sets the AllowAuthorizerOverride field's value. +func (s *AuthorizerConfig) SetAllowAuthorizerOverride(v bool) *AuthorizerConfig { + s.AllowAuthorizerOverride = &v + return s +} + +// SetDefaultAuthorizerName sets the DefaultAuthorizerName field's value. +func (s *AuthorizerConfig) SetDefaultAuthorizerName(v string) *AuthorizerConfig { + s.DefaultAuthorizerName = &v + return s +} + // The authorizer description. type AuthorizerDescription struct { _ struct{} `type:"structure"` @@ -18000,6 +20384,10 @@ type AuthorizerDescription struct { // The UNIX timestamp of when the authorizer was last updated. LastModifiedDate *time.Time `locationName:"lastModifiedDate" type:"timestamp"` + // Specifies whether AWS IoT validates the token signature in an authorization + // request. + SigningDisabled *bool `locationName:"signingDisabled" type:"boolean"` + // The status of the authorizer. Status *string `locationName:"status" type:"string" enum:"AuthorizerStatus"` @@ -18051,6 +20439,12 @@ func (s *AuthorizerDescription) SetLastModifiedDate(v time.Time) *AuthorizerDesc return s } +// SetSigningDisabled sets the SigningDisabled field's value. +func (s *AuthorizerDescription) SetSigningDisabled(v bool) *AuthorizerDescription { + s.SigningDisabled = &v + return s +} + // SetStatus sets the Status field's value. func (s *AuthorizerDescription) SetStatus(v string) *AuthorizerDescription { s.Status = &v @@ -18139,6 +20533,33 @@ func (s *AwsJobExecutionsRolloutConfig) SetMaximumPerMinute(v int64) *AwsJobExec return s } +// Configuration information for pre-signed URLs. Valid when protocols contains +// HTTP. +type AwsJobPresignedUrlConfig struct { + _ struct{} `type:"structure"` + + // How long (in seconds) pre-signed URLs are valid. Valid values are 60 - 3600, + // the default value is 1800 seconds. Pre-signed URLs are generated when a request + // for the job document is received. + ExpiresInSec *int64 `locationName:"expiresInSec" type:"long"` +} + +// String returns the string representation +func (s AwsJobPresignedUrlConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsJobPresignedUrlConfig) GoString() string { + return s.String() +} + +// SetExpiresInSec sets the ExpiresInSec field's value. +func (s *AwsJobPresignedUrlConfig) SetExpiresInSec(v int64) *AwsJobPresignedUrlConfig { + s.ExpiresInSec = &v + return s +} + // A Device Defender security profile behavior. type Behavior struct { _ struct{} `type:"structure"` @@ -18969,6 +21390,65 @@ func (s *Certificate) SetStatus(v string) *Certificate { return s } +// Unable to verify the CA certificate used to sign the device certificate you +// are attempting to register. This is happens when you have registered more +// than one CA certificate that has the same subject field and public key. +type CertificateConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CertificateConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CertificateConflictException) GoString() string { + return s.String() +} + +func newErrorCertificateConflictException(v protocol.ResponseMetadata) error { + return &CertificateConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CertificateConflictException) Code() string { + return "CertificateConflictException" +} + +// Message returns the exception's message. +func (s CertificateConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CertificateConflictException) OrigErr() error { + return nil +} + +func (s CertificateConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CertificateConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CertificateConflictException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes a certificate. type CertificateDescription struct { _ struct{} `type:"structure"` @@ -19101,6 +21581,120 @@ func (s *CertificateDescription) SetValidity(v *CertificateValidity) *Certificat return s } +// The certificate operation is not allowed. +type CertificateStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CertificateStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CertificateStateException) GoString() string { + return s.String() +} + +func newErrorCertificateStateException(v protocol.ResponseMetadata) error { + return &CertificateStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CertificateStateException) Code() string { + return "CertificateStateException" +} + +// Message returns the exception's message. +func (s CertificateStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CertificateStateException) OrigErr() error { + return nil +} + +func (s CertificateStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CertificateStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CertificateStateException) RequestID() string { + return s.respMetadata.RequestID +} + +// The certificate is invalid. +type CertificateValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Additional information about the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CertificateValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CertificateValidationException) GoString() string { + return s.String() +} + +func newErrorCertificateValidationException(v protocol.ResponseMetadata) error { + return &CertificateValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CertificateValidationException) Code() string { + return "CertificateValidationException" +} + +// Message returns the exception's message. +func (s CertificateValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CertificateValidationException) OrigErr() error { + return nil +} + +func (s CertificateValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CertificateValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CertificateValidationException) RequestID() string { + return s.respMetadata.RequestID +} + // When the certificate is valid. type CertificateValidity struct { _ struct{} `type:"structure"` @@ -19488,6 +22082,120 @@ func (s *Configuration) SetEnabled(v bool) *Configuration { return s } +type ConfirmTopicRuleDestinationInput struct { + _ struct{} `type:"structure"` + + // The token used to confirm ownership or access to the topic rule confirmation + // URL. + // + // ConfirmationToken is a required field + ConfirmationToken *string `location:"uri" locationName:"confirmationToken" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ConfirmTopicRuleDestinationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConfirmTopicRuleDestinationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ConfirmTopicRuleDestinationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConfirmTopicRuleDestinationInput"} + if s.ConfirmationToken == nil { + invalidParams.Add(request.NewErrParamRequired("ConfirmationToken")) + } + if s.ConfirmationToken != nil && len(*s.ConfirmationToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConfirmationToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConfirmationToken sets the ConfirmationToken field's value. +func (s *ConfirmTopicRuleDestinationInput) SetConfirmationToken(v string) *ConfirmTopicRuleDestinationInput { + s.ConfirmationToken = &v + return s +} + +type ConfirmTopicRuleDestinationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ConfirmTopicRuleDestinationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConfirmTopicRuleDestinationOutput) GoString() string { + return s.String() +} + +// A conflicting resource update exception. This exception is thrown when two +// pending updates cause a conflict. +type ConflictingResourceUpdateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConflictingResourceUpdateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictingResourceUpdateException) GoString() string { + return s.String() +} + +func newErrorConflictingResourceUpdateException(v protocol.ResponseMetadata) error { + return &ConflictingResourceUpdateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConflictingResourceUpdateException) Code() string { + return "ConflictingResourceUpdateException" +} + +// Message returns the exception's message. +func (s ConflictingResourceUpdateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictingResourceUpdateException) OrigErr() error { + return nil +} + +func (s ConflictingResourceUpdateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictingResourceUpdateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictingResourceUpdateException) RequestID() string { + return s.respMetadata.RequestID +} + type CreateAuthorizerInput struct { _ struct{} `type:"structure"` @@ -19501,19 +22209,19 @@ type CreateAuthorizerInput struct { // AuthorizerName is a required field AuthorizerName *string `location:"uri" locationName:"authorizerName" min:"1" type:"string" required:"true"` + // Specifies whether AWS IoT validates the token signature in an authorization + // request. + SigningDisabled *bool `locationName:"signingDisabled" type:"boolean"` + // The status of the create authorizer request. Status *string `locationName:"status" type:"string" enum:"AuthorizerStatus"` // The name of the token key used to extract the token from the HTTP headers. - // - // TokenKeyName is a required field - TokenKeyName *string `locationName:"tokenKeyName" min:"1" type:"string" required:"true"` + TokenKeyName *string `locationName:"tokenKeyName" min:"1" type:"string"` // The public keys used to verify the digital signature returned by your custom // authentication service. - // - // TokenSigningPublicKeys is a required field - TokenSigningPublicKeys map[string]*string `locationName:"tokenSigningPublicKeys" type:"map" required:"true"` + TokenSigningPublicKeys map[string]*string `locationName:"tokenSigningPublicKeys" type:"map"` } // String returns the string representation @@ -19538,15 +22246,9 @@ func (s *CreateAuthorizerInput) Validate() error { if s.AuthorizerName != nil && len(*s.AuthorizerName) < 1 { invalidParams.Add(request.NewErrParamMinLen("AuthorizerName", 1)) } - if s.TokenKeyName == nil { - invalidParams.Add(request.NewErrParamRequired("TokenKeyName")) - } if s.TokenKeyName != nil && len(*s.TokenKeyName) < 1 { invalidParams.Add(request.NewErrParamMinLen("TokenKeyName", 1)) } - if s.TokenSigningPublicKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TokenSigningPublicKeys")) - } if invalidParams.Len() > 0 { return invalidParams @@ -19566,6 +22268,12 @@ func (s *CreateAuthorizerInput) SetAuthorizerName(v string) *CreateAuthorizerInp return s } +// SetSigningDisabled sets the SigningDisabled field's value. +func (s *CreateAuthorizerInput) SetSigningDisabled(v bool) *CreateAuthorizerInput { + s.SigningDisabled = &v + return s +} + // SetStatus sets the Status field's value. func (s *CreateAuthorizerInput) SetStatus(v string) *CreateAuthorizerInput { s.Status = &v @@ -19811,6 +22519,139 @@ func (s *CreateCertificateFromCsrOutput) SetCertificatePem(v string) *CreateCert return s } +type CreateDomainConfigurationInput struct { + _ struct{} `type:"structure"` + + // An object that specifies the authorization service for a domain. + AuthorizerConfig *AuthorizerConfig `locationName:"authorizerConfig" type:"structure"` + + // The name of the domain configuration. This value must be unique to a region. + // + // DomainConfigurationName is a required field + DomainConfigurationName *string `location:"uri" locationName:"domainConfigurationName" min:"1" type:"string" required:"true"` + + // The name of the domain. + DomainName *string `locationName:"domainName" min:"1" type:"string"` + + // The ARNs of the certificates that AWS IoT passes to the device during the + // TLS handshake. Currently you can specify only one certificate ARN. This value + // is not required for AWS-managed domains. + ServerCertificateArns []*string `locationName:"serverCertificateArns" type:"list"` + + // The type of service delivered by the endpoint. + ServiceType *string `locationName:"serviceType" type:"string" enum:"ServiceType"` + + // The certificate used to validate the server certificate and prove domain + // name ownership. This certificate must be signed by a public certificate authority. + // This value is not required for AWS-managed domains. + ValidationCertificateArn *string `locationName:"validationCertificateArn" min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateDomainConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDomainConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateDomainConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateDomainConfigurationInput"} + if s.DomainConfigurationName == nil { + invalidParams.Add(request.NewErrParamRequired("DomainConfigurationName")) + } + if s.DomainConfigurationName != nil && len(*s.DomainConfigurationName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DomainConfigurationName", 1)) + } + if s.DomainName != nil && len(*s.DomainName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DomainName", 1)) + } + if s.ValidationCertificateArn != nil && len(*s.ValidationCertificateArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ValidationCertificateArn", 1)) + } + if s.AuthorizerConfig != nil { + if err := s.AuthorizerConfig.Validate(); err != nil { + invalidParams.AddNested("AuthorizerConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuthorizerConfig sets the AuthorizerConfig field's value. +func (s *CreateDomainConfigurationInput) SetAuthorizerConfig(v *AuthorizerConfig) *CreateDomainConfigurationInput { + s.AuthorizerConfig = v + return s +} + +// SetDomainConfigurationName sets the DomainConfigurationName field's value. +func (s *CreateDomainConfigurationInput) SetDomainConfigurationName(v string) *CreateDomainConfigurationInput { + s.DomainConfigurationName = &v + return s +} + +// SetDomainName sets the DomainName field's value. +func (s *CreateDomainConfigurationInput) SetDomainName(v string) *CreateDomainConfigurationInput { + s.DomainName = &v + return s +} + +// SetServerCertificateArns sets the ServerCertificateArns field's value. +func (s *CreateDomainConfigurationInput) SetServerCertificateArns(v []*string) *CreateDomainConfigurationInput { + s.ServerCertificateArns = v + return s +} + +// SetServiceType sets the ServiceType field's value. +func (s *CreateDomainConfigurationInput) SetServiceType(v string) *CreateDomainConfigurationInput { + s.ServiceType = &v + return s +} + +// SetValidationCertificateArn sets the ValidationCertificateArn field's value. +func (s *CreateDomainConfigurationInput) SetValidationCertificateArn(v string) *CreateDomainConfigurationInput { + s.ValidationCertificateArn = &v + return s +} + +type CreateDomainConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the domain configuration. + DomainConfigurationArn *string `locationName:"domainConfigurationArn" type:"string"` + + // The name of the domain configuration. + DomainConfigurationName *string `locationName:"domainConfigurationName" min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateDomainConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDomainConfigurationOutput) GoString() string { + return s.String() +} + +// SetDomainConfigurationArn sets the DomainConfigurationArn field's value. +func (s *CreateDomainConfigurationOutput) SetDomainConfigurationArn(v string) *CreateDomainConfigurationOutput { + s.DomainConfigurationArn = &v + return s +} + +// SetDomainConfigurationName sets the DomainConfigurationName field's value. +func (s *CreateDomainConfigurationOutput) SetDomainConfigurationName(v string) *CreateDomainConfigurationOutput { + s.DomainConfigurationName = &v + return s +} + type CreateDynamicThingGroupInput struct { _ struct{} `type:"structure"` @@ -20405,6 +23246,9 @@ type CreateOTAUpdateInput struct { // Configuration for the rollout of OTA updates. AwsJobExecutionsRolloutConfig *AwsJobExecutionsRolloutConfig `locationName:"awsJobExecutionsRolloutConfig" type:"structure"` + // Configuration information for pre-signed URLs. + AwsJobPresignedUrlConfig *AwsJobPresignedUrlConfig `locationName:"awsJobPresignedUrlConfig" type:"structure"` + // The description of the OTA update. Description *string `locationName:"description" type:"string"` @@ -20418,6 +23262,11 @@ type CreateOTAUpdateInput struct { // OtaUpdateId is a required field OtaUpdateId *string `location:"uri" locationName:"otaUpdateId" min:"1" type:"string" required:"true"` + // The protocol used to transfer the OTA update image. Valid values are [HTTP], + // [MQTT], [HTTP, MQTT]. When both HTTP and MQTT are specified, the target device + // can choose the protocol. + Protocols []*string `locationName:"protocols" min:"1" type:"list"` + // The IAM role that allows access to the AWS IoT Jobs service. // // RoleArn is a required field @@ -20465,6 +23314,9 @@ func (s *CreateOTAUpdateInput) Validate() error { if s.OtaUpdateId != nil && len(*s.OtaUpdateId) < 1 { invalidParams.Add(request.NewErrParamMinLen("OtaUpdateId", 1)) } + if s.Protocols != nil && len(s.Protocols) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Protocols", 1)) + } if s.RoleArn == nil { invalidParams.Add(request.NewErrParamRequired("RoleArn")) } @@ -20511,6 +23363,12 @@ func (s *CreateOTAUpdateInput) SetAwsJobExecutionsRolloutConfig(v *AwsJobExecuti return s } +// SetAwsJobPresignedUrlConfig sets the AwsJobPresignedUrlConfig field's value. +func (s *CreateOTAUpdateInput) SetAwsJobPresignedUrlConfig(v *AwsJobPresignedUrlConfig) *CreateOTAUpdateInput { + s.AwsJobPresignedUrlConfig = v + return s +} + // SetDescription sets the Description field's value. func (s *CreateOTAUpdateInput) SetDescription(v string) *CreateOTAUpdateInput { s.Description = &v @@ -20529,6 +23387,12 @@ func (s *CreateOTAUpdateInput) SetOtaUpdateId(v string) *CreateOTAUpdateInput { return s } +// SetProtocols sets the Protocols field's value. +func (s *CreateOTAUpdateInput) SetProtocols(v []*string) *CreateOTAUpdateInput { + s.Protocols = v + return s +} + // SetRoleArn sets the RoleArn field's value. func (s *CreateOTAUpdateInput) SetRoleArn(v string) *CreateOTAUpdateInput { s.RoleArn = &v @@ -20839,6 +23703,359 @@ func (s *CreatePolicyVersionOutput) SetPolicyVersionId(v string) *CreatePolicyVe return s } +type CreateProvisioningClaimInput struct { + _ struct{} `type:"structure"` + + // The name of the provisioning template to use. + // + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"templateName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateProvisioningClaimInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateProvisioningClaimInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateProvisioningClaimInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateProvisioningClaimInput"} + 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 +} + +// SetTemplateName sets the TemplateName field's value. +func (s *CreateProvisioningClaimInput) SetTemplateName(v string) *CreateProvisioningClaimInput { + s.TemplateName = &v + return s +} + +type CreateProvisioningClaimOutput struct { + _ struct{} `type:"structure"` + + // The ID of the certificate. + CertificateId *string `locationName:"certificateId" min:"64" type:"string"` + + // The provisioning claim certificate. + CertificatePem *string `locationName:"certificatePem" min:"1" type:"string"` + + // The provisioning claim expiration time. + Expiration *time.Time `locationName:"expiration" type:"timestamp"` + + // The provisioning claim key pair. + KeyPair *KeyPair `locationName:"keyPair" type:"structure"` +} + +// String returns the string representation +func (s CreateProvisioningClaimOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateProvisioningClaimOutput) GoString() string { + return s.String() +} + +// SetCertificateId sets the CertificateId field's value. +func (s *CreateProvisioningClaimOutput) SetCertificateId(v string) *CreateProvisioningClaimOutput { + s.CertificateId = &v + return s +} + +// SetCertificatePem sets the CertificatePem field's value. +func (s *CreateProvisioningClaimOutput) SetCertificatePem(v string) *CreateProvisioningClaimOutput { + s.CertificatePem = &v + return s +} + +// SetExpiration sets the Expiration field's value. +func (s *CreateProvisioningClaimOutput) SetExpiration(v time.Time) *CreateProvisioningClaimOutput { + s.Expiration = &v + return s +} + +// SetKeyPair sets the KeyPair field's value. +func (s *CreateProvisioningClaimOutput) SetKeyPair(v *KeyPair) *CreateProvisioningClaimOutput { + s.KeyPair = v + return s +} + +type CreateProvisioningTemplateInput struct { + _ struct{} `type:"structure"` + + // The description of the fleet provisioning template. + Description *string `locationName:"description" type:"string"` + + // True to enable the fleet provisioning template, otherwise false. + Enabled *bool `locationName:"enabled" type:"boolean"` + + // The role ARN for the role associated with the fleet provisioning template. + // This IoT role grants permission to provision a device. + // + // ProvisioningRoleArn is a required field + ProvisioningRoleArn *string `locationName:"provisioningRoleArn" min:"20" type:"string" required:"true"` + + // Metadata which can be used to manage the fleet provisioning template. + // + // For URI Request parameters use format: ...key1=value1&key2=value2... + // + // For the CLI command-line parameter use format: &&tags "key1=value1&key2=value2..." + // + // For the cli-input-json file use format: "tags": "key1=value1&key2=value2..." + Tags []*Tag `locationName:"tags" type:"list"` + + // The JSON formatted contents of the fleet provisioning template. + // + // TemplateBody is a required field + TemplateBody *string `locationName:"templateBody" type:"string" required:"true"` + + // The name of the fleet provisioning template. + // + // TemplateName is a required field + TemplateName *string `locationName:"templateName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateProvisioningTemplateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateProvisioningTemplateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateProvisioningTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateProvisioningTemplateInput"} + if s.ProvisioningRoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("ProvisioningRoleArn")) + } + if s.ProvisioningRoleArn != nil && len(*s.ProvisioningRoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ProvisioningRoleArn", 20)) + } + if s.TemplateBody == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateBody")) + } + 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 +} + +// SetDescription sets the Description field's value. +func (s *CreateProvisioningTemplateInput) SetDescription(v string) *CreateProvisioningTemplateInput { + s.Description = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *CreateProvisioningTemplateInput) SetEnabled(v bool) *CreateProvisioningTemplateInput { + s.Enabled = &v + return s +} + +// SetProvisioningRoleArn sets the ProvisioningRoleArn field's value. +func (s *CreateProvisioningTemplateInput) SetProvisioningRoleArn(v string) *CreateProvisioningTemplateInput { + s.ProvisioningRoleArn = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateProvisioningTemplateInput) SetTags(v []*Tag) *CreateProvisioningTemplateInput { + s.Tags = v + return s +} + +// SetTemplateBody sets the TemplateBody field's value. +func (s *CreateProvisioningTemplateInput) SetTemplateBody(v string) *CreateProvisioningTemplateInput { + s.TemplateBody = &v + return s +} + +// SetTemplateName sets the TemplateName field's value. +func (s *CreateProvisioningTemplateInput) SetTemplateName(v string) *CreateProvisioningTemplateInput { + s.TemplateName = &v + return s +} + +type CreateProvisioningTemplateOutput struct { + _ struct{} `type:"structure"` + + // The default version of the fleet provisioning template. + DefaultVersionId *int64 `locationName:"defaultVersionId" type:"integer"` + + // The ARN that identifies the provisioning template. + TemplateArn *string `locationName:"templateArn" type:"string"` + + // The name of the fleet provisioning template. + TemplateName *string `locationName:"templateName" min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateProvisioningTemplateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateProvisioningTemplateOutput) GoString() string { + return s.String() +} + +// SetDefaultVersionId sets the DefaultVersionId field's value. +func (s *CreateProvisioningTemplateOutput) SetDefaultVersionId(v int64) *CreateProvisioningTemplateOutput { + s.DefaultVersionId = &v + return s +} + +// SetTemplateArn sets the TemplateArn field's value. +func (s *CreateProvisioningTemplateOutput) SetTemplateArn(v string) *CreateProvisioningTemplateOutput { + s.TemplateArn = &v + return s +} + +// SetTemplateName sets the TemplateName field's value. +func (s *CreateProvisioningTemplateOutput) SetTemplateName(v string) *CreateProvisioningTemplateOutput { + s.TemplateName = &v + return s +} + +type CreateProvisioningTemplateVersionInput struct { + _ struct{} `type:"structure"` + + // Sets a fleet provision template version as the default version. + SetAsDefault *bool `location:"querystring" locationName:"setAsDefault" type:"boolean"` + + // The JSON formatted contents of the fleet provisioning template. + // + // TemplateBody is a required field + TemplateBody *string `locationName:"templateBody" type:"string" required:"true"` + + // The name of the fleet provisioning template. + // + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"templateName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateProvisioningTemplateVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateProvisioningTemplateVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateProvisioningTemplateVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateProvisioningTemplateVersionInput"} + if s.TemplateBody == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateBody")) + } + 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 +} + +// SetSetAsDefault sets the SetAsDefault field's value. +func (s *CreateProvisioningTemplateVersionInput) SetSetAsDefault(v bool) *CreateProvisioningTemplateVersionInput { + s.SetAsDefault = &v + return s +} + +// SetTemplateBody sets the TemplateBody field's value. +func (s *CreateProvisioningTemplateVersionInput) SetTemplateBody(v string) *CreateProvisioningTemplateVersionInput { + s.TemplateBody = &v + return s +} + +// SetTemplateName sets the TemplateName field's value. +func (s *CreateProvisioningTemplateVersionInput) SetTemplateName(v string) *CreateProvisioningTemplateVersionInput { + s.TemplateName = &v + return s +} + +type CreateProvisioningTemplateVersionOutput struct { + _ struct{} `type:"structure"` + + // True if the fleet provisioning template version is the default version, otherwise + // false. + IsDefaultVersion *bool `locationName:"isDefaultVersion" type:"boolean"` + + // The ARN that identifies the provisioning template. + TemplateArn *string `locationName:"templateArn" type:"string"` + + // The name of the fleet provisioning template. + TemplateName *string `locationName:"templateName" min:"1" type:"string"` + + // The version of the fleet provisioning template. + VersionId *int64 `locationName:"versionId" type:"integer"` +} + +// String returns the string representation +func (s CreateProvisioningTemplateVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateProvisioningTemplateVersionOutput) GoString() string { + return s.String() +} + +// SetIsDefaultVersion sets the IsDefaultVersion field's value. +func (s *CreateProvisioningTemplateVersionOutput) SetIsDefaultVersion(v bool) *CreateProvisioningTemplateVersionOutput { + s.IsDefaultVersion = &v + return s +} + +// SetTemplateArn sets the TemplateArn field's value. +func (s *CreateProvisioningTemplateVersionOutput) SetTemplateArn(v string) *CreateProvisioningTemplateVersionOutput { + s.TemplateArn = &v + return s +} + +// SetTemplateName sets the TemplateName field's value. +func (s *CreateProvisioningTemplateVersionOutput) SetTemplateName(v string) *CreateProvisioningTemplateVersionOutput { + s.TemplateName = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *CreateProvisioningTemplateVersionOutput) SetVersionId(v int64) *CreateProvisioningTemplateVersionOutput { + s.VersionId = &v + return s +} + type CreateRoleAliasInput struct { _ struct{} `type:"structure"` @@ -20917,7 +24134,7 @@ type CreateRoleAliasOutput struct { RoleAlias *string `locationName:"roleAlias" min:"1" type:"string"` // The role alias ARN. - RoleAliasArn *string `locationName:"roleAliasArn" type:"string"` + RoleAliasArn *string `locationName:"roleAliasArn" min:"1" type:"string"` } // String returns the string representation @@ -21703,6 +24920,72 @@ func (s *CreateThingTypeOutput) SetThingTypeName(v string) *CreateThingTypeOutpu return s } +type CreateTopicRuleDestinationInput struct { + _ struct{} `type:"structure"` + + // The topic rule destination configuration. + // + // DestinationConfiguration is a required field + DestinationConfiguration *TopicRuleDestinationConfiguration `locationName:"destinationConfiguration" type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateTopicRuleDestinationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTopicRuleDestinationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTopicRuleDestinationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTopicRuleDestinationInput"} + if s.DestinationConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationConfiguration")) + } + if s.DestinationConfiguration != nil { + if err := s.DestinationConfiguration.Validate(); err != nil { + invalidParams.AddNested("DestinationConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDestinationConfiguration sets the DestinationConfiguration field's value. +func (s *CreateTopicRuleDestinationInput) SetDestinationConfiguration(v *TopicRuleDestinationConfiguration) *CreateTopicRuleDestinationInput { + s.DestinationConfiguration = v + return s +} + +type CreateTopicRuleDestinationOutput struct { + _ struct{} `type:"structure"` + + // The topic rule destination. + TopicRuleDestination *TopicRuleDestination `locationName:"topicRuleDestination" type:"structure"` +} + +// String returns the string representation +func (s CreateTopicRuleDestinationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTopicRuleDestinationOutput) GoString() string { + return s.String() +} + +// SetTopicRuleDestination sets the TopicRuleDestination field's value. +func (s *CreateTopicRuleDestinationOutput) SetTopicRuleDestination(v *TopicRuleDestination) *CreateTopicRuleDestinationOutput { + s.TopicRuleDestination = v + return s +} + // The input for the CreateTopicRule operation. type CreateTopicRuleInput struct { _ struct{} `type:"structure" payload:"TopicRulePayload"` @@ -22127,6 +25410,118 @@ func (s DeleteCertificateOutput) GoString() string { return s.String() } +// You can't delete the resource because it is attached to one or more resources. +type DeleteConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DeleteConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteConflictException) GoString() string { + return s.String() +} + +func newErrorDeleteConflictException(v protocol.ResponseMetadata) error { + return &DeleteConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DeleteConflictException) Code() string { + return "DeleteConflictException" +} + +// Message returns the exception's message. +func (s DeleteConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeleteConflictException) OrigErr() error { + return nil +} + +func (s DeleteConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DeleteConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DeleteConflictException) RequestID() string { + return s.respMetadata.RequestID +} + +type DeleteDomainConfigurationInput struct { + _ struct{} `type:"structure"` + + // The name of the domain configuration to be deleted. + // + // DomainConfigurationName is a required field + DomainConfigurationName *string `location:"uri" locationName:"domainConfigurationName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteDomainConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDomainConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteDomainConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteDomainConfigurationInput"} + if s.DomainConfigurationName == nil { + invalidParams.Add(request.NewErrParamRequired("DomainConfigurationName")) + } + if s.DomainConfigurationName != nil && len(*s.DomainConfigurationName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DomainConfigurationName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDomainConfigurationName sets the DomainConfigurationName field's value. +func (s *DeleteDomainConfigurationInput) SetDomainConfigurationName(v string) *DeleteDomainConfigurationInput { + s.DomainConfigurationName = &v + return s +} + +type DeleteDomainConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteDomainConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDomainConfigurationOutput) GoString() string { + return s.String() +} + type DeleteDynamicThingGroupInput struct { _ struct{} `type:"structure"` @@ -22631,6 +26026,130 @@ func (s DeletePolicyVersionOutput) GoString() string { return s.String() } +type DeleteProvisioningTemplateInput struct { + _ struct{} `type:"structure"` + + // The name of the fleet provision template to delete. + // + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"templateName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteProvisioningTemplateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteProvisioningTemplateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteProvisioningTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteProvisioningTemplateInput"} + 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 +} + +// SetTemplateName sets the TemplateName field's value. +func (s *DeleteProvisioningTemplateInput) SetTemplateName(v string) *DeleteProvisioningTemplateInput { + s.TemplateName = &v + return s +} + +type DeleteProvisioningTemplateOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteProvisioningTemplateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteProvisioningTemplateOutput) GoString() string { + return s.String() +} + +type DeleteProvisioningTemplateVersionInput struct { + _ struct{} `type:"structure"` + + // The name of the fleet provisioning template version to delete. + // + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"templateName" min:"1" type:"string" required:"true"` + + // The fleet provisioning template version ID to delete. + // + // VersionId is a required field + VersionId *int64 `location:"uri" locationName:"versionId" type:"integer" required:"true"` +} + +// String returns the string representation +func (s DeleteProvisioningTemplateVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteProvisioningTemplateVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteProvisioningTemplateVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteProvisioningTemplateVersionInput"} + 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.VersionId == nil { + invalidParams.Add(request.NewErrParamRequired("VersionId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTemplateName sets the TemplateName field's value. +func (s *DeleteProvisioningTemplateVersionInput) SetTemplateName(v string) *DeleteProvisioningTemplateVersionInput { + s.TemplateName = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *DeleteProvisioningTemplateVersionInput) SetVersionId(v int64) *DeleteProvisioningTemplateVersionInput { + s.VersionId = &v + return s +} + +type DeleteProvisioningTemplateVersionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteProvisioningTemplateVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteProvisioningTemplateVersionOutput) GoString() string { + return s.String() +} + // The input for the DeleteRegistrationCode operation. type DeleteRegistrationCodeInput struct { _ struct{} `type:"structure"` @@ -23081,6 +26600,61 @@ func (s DeleteThingTypeOutput) GoString() string { return s.String() } +type DeleteTopicRuleDestinationInput struct { + _ struct{} `type:"structure"` + + // The ARN of the topic rule destination to delete. + // + // Arn is a required field + Arn *string `location:"uri" locationName:"arn" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteTopicRuleDestinationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTopicRuleDestinationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteTopicRuleDestinationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTopicRuleDestinationInput"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.Arn != nil && len(*s.Arn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *DeleteTopicRuleDestinationInput) SetArn(v string) *DeleteTopicRuleDestinationInput { + s.Arn = &v + return s +} + +type DeleteTopicRuleDestinationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteTopicRuleDestinationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTopicRuleDestinationOutput) GoString() string { + return s.String() +} + // The input for the DeleteTopicRule operation. type DeleteTopicRuleInput struct { _ struct{} `type:"structure"` @@ -24014,6 +27588,134 @@ func (s *DescribeDefaultAuthorizerOutput) SetAuthorizerDescription(v *Authorizer return s } +type DescribeDomainConfigurationInput struct { + _ struct{} `type:"structure"` + + // The name of the domain configuration. + // + // DomainConfigurationName is a required field + DomainConfigurationName *string `location:"uri" locationName:"domainConfigurationName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeDomainConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDomainConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeDomainConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeDomainConfigurationInput"} + if s.DomainConfigurationName == nil { + invalidParams.Add(request.NewErrParamRequired("DomainConfigurationName")) + } + if s.DomainConfigurationName != nil && len(*s.DomainConfigurationName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DomainConfigurationName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDomainConfigurationName sets the DomainConfigurationName field's value. +func (s *DescribeDomainConfigurationInput) SetDomainConfigurationName(v string) *DescribeDomainConfigurationInput { + s.DomainConfigurationName = &v + return s +} + +type DescribeDomainConfigurationOutput struct { + _ struct{} `type:"structure"` + + // An object that specifies the authorization service for a domain. + AuthorizerConfig *AuthorizerConfig `locationName:"authorizerConfig" type:"structure"` + + // The ARN of the domain configuration. + DomainConfigurationArn *string `locationName:"domainConfigurationArn" type:"string"` + + // The name of the domain configuration. + DomainConfigurationName *string `locationName:"domainConfigurationName" min:"1" type:"string"` + + // A Boolean value that specifies the current state of the domain configuration. + DomainConfigurationStatus *string `locationName:"domainConfigurationStatus" type:"string" enum:"DomainConfigurationStatus"` + + // The name of the domain. + DomainName *string `locationName:"domainName" min:"1" type:"string"` + + // The type of the domain. + DomainType *string `locationName:"domainType" type:"string" enum:"DomainType"` + + // A list containing summary information about the server certificate included + // in the domain configuration. + ServerCertificates []*ServerCertificateSummary `locationName:"serverCertificates" type:"list"` + + // The type of service delivered by the endpoint. + ServiceType *string `locationName:"serviceType" type:"string" enum:"ServiceType"` +} + +// String returns the string representation +func (s DescribeDomainConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDomainConfigurationOutput) GoString() string { + return s.String() +} + +// SetAuthorizerConfig sets the AuthorizerConfig field's value. +func (s *DescribeDomainConfigurationOutput) SetAuthorizerConfig(v *AuthorizerConfig) *DescribeDomainConfigurationOutput { + s.AuthorizerConfig = v + return s +} + +// SetDomainConfigurationArn sets the DomainConfigurationArn field's value. +func (s *DescribeDomainConfigurationOutput) SetDomainConfigurationArn(v string) *DescribeDomainConfigurationOutput { + s.DomainConfigurationArn = &v + return s +} + +// SetDomainConfigurationName sets the DomainConfigurationName field's value. +func (s *DescribeDomainConfigurationOutput) SetDomainConfigurationName(v string) *DescribeDomainConfigurationOutput { + s.DomainConfigurationName = &v + return s +} + +// SetDomainConfigurationStatus sets the DomainConfigurationStatus field's value. +func (s *DescribeDomainConfigurationOutput) SetDomainConfigurationStatus(v string) *DescribeDomainConfigurationOutput { + s.DomainConfigurationStatus = &v + return s +} + +// SetDomainName sets the DomainName field's value. +func (s *DescribeDomainConfigurationOutput) SetDomainName(v string) *DescribeDomainConfigurationOutput { + s.DomainName = &v + return s +} + +// SetDomainType sets the DomainType field's value. +func (s *DescribeDomainConfigurationOutput) SetDomainType(v string) *DescribeDomainConfigurationOutput { + s.DomainType = &v + return s +} + +// SetServerCertificates sets the ServerCertificates field's value. +func (s *DescribeDomainConfigurationOutput) SetServerCertificates(v []*ServerCertificateSummary) *DescribeDomainConfigurationOutput { + s.ServerCertificates = v + return s +} + +// SetServiceType sets the ServiceType field's value. +func (s *DescribeDomainConfigurationOutput) SetServiceType(v string) *DescribeDomainConfigurationOutput { + s.ServiceType = &v + return s +} + // The input for the DescribeEndpoint operation. type DescribeEndpointInput struct { _ struct{} `type:"structure"` @@ -24512,6 +28214,248 @@ func (s *DescribeMitigationActionOutput) SetRoleArn(v string) *DescribeMitigatio return s } +type DescribeProvisioningTemplateInput struct { + _ struct{} `type:"structure"` + + // The name of the fleet provisioning template. + // + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"templateName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeProvisioningTemplateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeProvisioningTemplateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeProvisioningTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeProvisioningTemplateInput"} + 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 +} + +// SetTemplateName sets the TemplateName field's value. +func (s *DescribeProvisioningTemplateInput) SetTemplateName(v string) *DescribeProvisioningTemplateInput { + s.TemplateName = &v + return s +} + +type DescribeProvisioningTemplateOutput struct { + _ struct{} `type:"structure"` + + // The date when the fleet provisioning template was created. + CreationDate *time.Time `locationName:"creationDate" type:"timestamp"` + + // The default fleet template version ID. + DefaultVersionId *int64 `locationName:"defaultVersionId" type:"integer"` + + // The description of the fleet provisioning template. + Description *string `locationName:"description" type:"string"` + + // True if the fleet provisioning template is enabled, otherwise false. + Enabled *bool `locationName:"enabled" type:"boolean"` + + // The date when the fleet provisioning template was last modified. + LastModifiedDate *time.Time `locationName:"lastModifiedDate" type:"timestamp"` + + // The ARN of the role associated with the provisioning template. This IoT role + // grants permission to provision a device. + ProvisioningRoleArn *string `locationName:"provisioningRoleArn" min:"20" type:"string"` + + // The ARN of the fleet provisioning template. + TemplateArn *string `locationName:"templateArn" type:"string"` + + // The JSON formatted contents of the fleet provisioning template. + TemplateBody *string `locationName:"templateBody" type:"string"` + + // The name of the fleet provisioning template. + TemplateName *string `locationName:"templateName" min:"1" type:"string"` +} + +// String returns the string representation +func (s DescribeProvisioningTemplateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeProvisioningTemplateOutput) GoString() string { + return s.String() +} + +// SetCreationDate sets the CreationDate field's value. +func (s *DescribeProvisioningTemplateOutput) SetCreationDate(v time.Time) *DescribeProvisioningTemplateOutput { + s.CreationDate = &v + return s +} + +// SetDefaultVersionId sets the DefaultVersionId field's value. +func (s *DescribeProvisioningTemplateOutput) SetDefaultVersionId(v int64) *DescribeProvisioningTemplateOutput { + s.DefaultVersionId = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *DescribeProvisioningTemplateOutput) SetDescription(v string) *DescribeProvisioningTemplateOutput { + s.Description = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *DescribeProvisioningTemplateOutput) SetEnabled(v bool) *DescribeProvisioningTemplateOutput { + s.Enabled = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *DescribeProvisioningTemplateOutput) SetLastModifiedDate(v time.Time) *DescribeProvisioningTemplateOutput { + s.LastModifiedDate = &v + return s +} + +// SetProvisioningRoleArn sets the ProvisioningRoleArn field's value. +func (s *DescribeProvisioningTemplateOutput) SetProvisioningRoleArn(v string) *DescribeProvisioningTemplateOutput { + s.ProvisioningRoleArn = &v + return s +} + +// SetTemplateArn sets the TemplateArn field's value. +func (s *DescribeProvisioningTemplateOutput) SetTemplateArn(v string) *DescribeProvisioningTemplateOutput { + s.TemplateArn = &v + return s +} + +// SetTemplateBody sets the TemplateBody field's value. +func (s *DescribeProvisioningTemplateOutput) SetTemplateBody(v string) *DescribeProvisioningTemplateOutput { + s.TemplateBody = &v + return s +} + +// SetTemplateName sets the TemplateName field's value. +func (s *DescribeProvisioningTemplateOutput) SetTemplateName(v string) *DescribeProvisioningTemplateOutput { + s.TemplateName = &v + return s +} + +type DescribeProvisioningTemplateVersionInput struct { + _ struct{} `type:"structure"` + + // The template name. + // + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"templateName" min:"1" type:"string" required:"true"` + + // The fleet provisioning template version ID. + // + // VersionId is a required field + VersionId *int64 `location:"uri" locationName:"versionId" type:"integer" required:"true"` +} + +// String returns the string representation +func (s DescribeProvisioningTemplateVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeProvisioningTemplateVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeProvisioningTemplateVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeProvisioningTemplateVersionInput"} + 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.VersionId == nil { + invalidParams.Add(request.NewErrParamRequired("VersionId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTemplateName sets the TemplateName field's value. +func (s *DescribeProvisioningTemplateVersionInput) SetTemplateName(v string) *DescribeProvisioningTemplateVersionInput { + s.TemplateName = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *DescribeProvisioningTemplateVersionInput) SetVersionId(v int64) *DescribeProvisioningTemplateVersionInput { + s.VersionId = &v + return s +} + +type DescribeProvisioningTemplateVersionOutput struct { + _ struct{} `type:"structure"` + + // The date when the fleet provisioning template version was created. + CreationDate *time.Time `locationName:"creationDate" type:"timestamp"` + + // True if the fleet provisioning template version is the default version. + IsDefaultVersion *bool `locationName:"isDefaultVersion" type:"boolean"` + + // The JSON formatted contents of the fleet provisioning template version. + TemplateBody *string `locationName:"templateBody" type:"string"` + + // The fleet provisioning template version ID. + VersionId *int64 `locationName:"versionId" type:"integer"` +} + +// String returns the string representation +func (s DescribeProvisioningTemplateVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeProvisioningTemplateVersionOutput) GoString() string { + return s.String() +} + +// SetCreationDate sets the CreationDate field's value. +func (s *DescribeProvisioningTemplateVersionOutput) SetCreationDate(v time.Time) *DescribeProvisioningTemplateVersionOutput { + s.CreationDate = &v + return s +} + +// SetIsDefaultVersion sets the IsDefaultVersion field's value. +func (s *DescribeProvisioningTemplateVersionOutput) SetIsDefaultVersion(v bool) *DescribeProvisioningTemplateVersionOutput { + s.IsDefaultVersion = &v + return s +} + +// SetTemplateBody sets the TemplateBody field's value. +func (s *DescribeProvisioningTemplateVersionOutput) SetTemplateBody(v string) *DescribeProvisioningTemplateVersionOutput { + s.TemplateBody = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *DescribeProvisioningTemplateVersionOutput) SetVersionId(v int64) *DescribeProvisioningTemplateVersionOutput { + s.VersionId = &v + return s +} + type DescribeRoleAliasInput struct { _ struct{} `type:"structure"` @@ -25822,6 +29766,59 @@ func (s DisableTopicRuleOutput) GoString() string { return s.String() } +// The summary of a domain configuration. A domain configuration specifies custom +// IoT-specific information about a domain. A domain configuration can be associated +// with an AWS-managed domain (for example, dbc123defghijk.iot.us-west-2.amazonaws.com), +// a customer managed domain, or a default endpoint. +// +// * Data +// +// * Jobs +// +// * CredentialProvider +// +// The domain configuration feature is in public preview and is subject to change. +type DomainConfigurationSummary struct { + _ struct{} `type:"structure"` + + // The ARN of the domain configuration. + DomainConfigurationArn *string `locationName:"domainConfigurationArn" type:"string"` + + // The name of the domain configuration. This value must be unique to a region. + DomainConfigurationName *string `locationName:"domainConfigurationName" min:"1" type:"string"` + + // The type of service delivered by the endpoint. + ServiceType *string `locationName:"serviceType" type:"string" enum:"ServiceType"` +} + +// String returns the string representation +func (s DomainConfigurationSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DomainConfigurationSummary) GoString() string { + return s.String() +} + +// SetDomainConfigurationArn sets the DomainConfigurationArn field's value. +func (s *DomainConfigurationSummary) SetDomainConfigurationArn(v string) *DomainConfigurationSummary { + s.DomainConfigurationArn = &v + return s +} + +// SetDomainConfigurationName sets the DomainConfigurationName field's value. +func (s *DomainConfigurationSummary) SetDomainConfigurationName(v string) *DomainConfigurationSummary { + s.DomainConfigurationName = &v + return s +} + +// SetServiceType sets the ServiceType field's value. +func (s *DomainConfigurationSummary) SetServiceType(v string) *DomainConfigurationSummary { + s.ServiceType = &v + return s +} + // Describes an action to write to a DynamoDB table. // // The tableName, hashKeyField, and rangeKeyField values must match the values @@ -26432,6 +30429,39 @@ func (s *ExponentialRolloutRate) SetRateIncreaseCriteria(v *RateIncreaseCriteria return s } +// Describes the name and data type at a field. +type Field struct { + _ struct{} `type:"structure"` + + // The name of the field. + Name *string `locationName:"name" type:"string"` + + // The datatype of the field. + Type *string `locationName:"type" type:"string" enum:"FieldType"` +} + +// String returns the string representation +func (s Field) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Field) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *Field) SetName(v string) *Field { + s.Name = &v + return s +} + +// SetType sets the Type field's value. +func (s *Field) SetType(v string) *Field { + s.Type = &v + return s +} + // The location of the OTA update. type FileLocation struct { _ struct{} `type:"structure"` @@ -26549,6 +30579,103 @@ func (s *FirehoseAction) SetSeparator(v string) *FirehoseAction { return s } +type GetCardinalityInput struct { + _ struct{} `type:"structure"` + + // The field to aggregate. + AggregationField *string `locationName:"aggregationField" min:"1" type:"string"` + + // The name of the index to search. + IndexName *string `locationName:"indexName" min:"1" type:"string"` + + // The search query. + // + // QueryString is a required field + QueryString *string `locationName:"queryString" min:"1" type:"string" required:"true"` + + // The query version. + QueryVersion *string `locationName:"queryVersion" type:"string"` +} + +// String returns the string representation +func (s GetCardinalityInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCardinalityInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetCardinalityInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetCardinalityInput"} + if s.AggregationField != nil && len(*s.AggregationField) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AggregationField", 1)) + } + if s.IndexName != nil && len(*s.IndexName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("IndexName", 1)) + } + if s.QueryString == nil { + invalidParams.Add(request.NewErrParamRequired("QueryString")) + } + if s.QueryString != nil && len(*s.QueryString) < 1 { + invalidParams.Add(request.NewErrParamMinLen("QueryString", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAggregationField sets the AggregationField field's value. +func (s *GetCardinalityInput) SetAggregationField(v string) *GetCardinalityInput { + s.AggregationField = &v + return s +} + +// SetIndexName sets the IndexName field's value. +func (s *GetCardinalityInput) SetIndexName(v string) *GetCardinalityInput { + s.IndexName = &v + return s +} + +// SetQueryString sets the QueryString field's value. +func (s *GetCardinalityInput) SetQueryString(v string) *GetCardinalityInput { + s.QueryString = &v + return s +} + +// SetQueryVersion sets the QueryVersion field's value. +func (s *GetCardinalityInput) SetQueryVersion(v string) *GetCardinalityInput { + s.QueryVersion = &v + return s +} + +type GetCardinalityOutput struct { + _ struct{} `type:"structure"` + + // The approximate count of unique values that match the query. + Cardinality *int64 `locationName:"cardinality" type:"integer"` +} + +// String returns the string representation +func (s GetCardinalityOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCardinalityOutput) GoString() string { + return s.String() +} + +// SetCardinality sets the Cardinality field's value. +func (s *GetCardinalityOutput) SetCardinality(v int64) *GetCardinalityOutput { + s.Cardinality = &v + return s +} + type GetEffectivePoliciesInput struct { _ struct{} `type:"structure"` @@ -26848,6 +30975,112 @@ func (s *GetOTAUpdateOutput) SetOtaUpdateInfo(v *OTAUpdateInfo) *GetOTAUpdateOut return s } +type GetPercentilesInput struct { + _ struct{} `type:"structure"` + + // The field to aggregate. + AggregationField *string `locationName:"aggregationField" min:"1" type:"string"` + + // The name of the index to search. + IndexName *string `locationName:"indexName" min:"1" type:"string"` + + // The percentile groups returned. + Percents []*float64 `locationName:"percents" type:"list"` + + // The query string. + // + // QueryString is a required field + QueryString *string `locationName:"queryString" min:"1" type:"string" required:"true"` + + // The query version. + QueryVersion *string `locationName:"queryVersion" type:"string"` +} + +// String returns the string representation +func (s GetPercentilesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPercentilesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetPercentilesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetPercentilesInput"} + if s.AggregationField != nil && len(*s.AggregationField) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AggregationField", 1)) + } + if s.IndexName != nil && len(*s.IndexName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("IndexName", 1)) + } + if s.QueryString == nil { + invalidParams.Add(request.NewErrParamRequired("QueryString")) + } + if s.QueryString != nil && len(*s.QueryString) < 1 { + invalidParams.Add(request.NewErrParamMinLen("QueryString", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAggregationField sets the AggregationField field's value. +func (s *GetPercentilesInput) SetAggregationField(v string) *GetPercentilesInput { + s.AggregationField = &v + return s +} + +// SetIndexName sets the IndexName field's value. +func (s *GetPercentilesInput) SetIndexName(v string) *GetPercentilesInput { + s.IndexName = &v + return s +} + +// SetPercents sets the Percents field's value. +func (s *GetPercentilesInput) SetPercents(v []*float64) *GetPercentilesInput { + s.Percents = v + return s +} + +// SetQueryString sets the QueryString field's value. +func (s *GetPercentilesInput) SetQueryString(v string) *GetPercentilesInput { + s.QueryString = &v + return s +} + +// SetQueryVersion sets the QueryVersion field's value. +func (s *GetPercentilesInput) SetQueryVersion(v string) *GetPercentilesInput { + s.QueryVersion = &v + return s +} + +type GetPercentilesOutput struct { + _ struct{} `type:"structure"` + + // The percentile values of the aggregated fields. + Percentiles []*PercentPair `locationName:"percentiles" type:"list"` +} + +// String returns the string representation +func (s GetPercentilesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPercentilesOutput) GoString() string { + return s.String() +} + +// SetPercentiles sets the Percentiles field's value. +func (s *GetPercentilesOutput) SetPercentiles(v []*PercentPair) *GetPercentilesOutput { + s.Percentiles = v + return s +} + // The input for the GetPolicy operation. type GetPolicyInput struct { _ struct{} `type:"structure"` @@ -27031,7 +31264,7 @@ func (s *GetPolicyVersionInput) SetPolicyVersionId(v string) *GetPolicyVersionIn type GetPolicyVersionOutput struct { _ struct{} `type:"structure"` - // The date the policy version was created. + // The date the policy was created. CreationDate *time.Time `locationName:"creationDate" type:"timestamp"` // The generation ID of the policy version. @@ -27040,7 +31273,7 @@ type GetPolicyVersionOutput struct { // Specifies whether the policy version is the default. IsDefaultVersion *bool `locationName:"isDefaultVersion" type:"boolean"` - // The date the policy version was last modified. + // The date the policy was last modified. LastModifiedDate *time.Time `locationName:"lastModifiedDate" type:"timestamp"` // The policy ARN. @@ -27156,7 +31389,7 @@ func (s *GetRegistrationCodeOutput) SetRegistrationCode(v string) *GetRegistrati type GetStatisticsInput struct { _ struct{} `type:"structure"` - // The aggregation field name. Currently not supported. + // The aggregation field name. AggregationField *string `locationName:"aggregationField" min:"1" type:"string"` // The name of the index to search. The default value is AWS_Things. @@ -27252,6 +31485,70 @@ func (s *GetStatisticsOutput) SetStatistics(v *Statistics) *GetStatisticsOutput return s } +type GetTopicRuleDestinationInput struct { + _ struct{} `type:"structure"` + + // The ARN of the topic rule destination. + // + // Arn is a required field + Arn *string `location:"uri" locationName:"arn" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetTopicRuleDestinationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTopicRuleDestinationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetTopicRuleDestinationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetTopicRuleDestinationInput"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.Arn != nil && len(*s.Arn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Arn", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *GetTopicRuleDestinationInput) SetArn(v string) *GetTopicRuleDestinationInput { + s.Arn = &v + return s +} + +type GetTopicRuleDestinationOutput struct { + _ struct{} `type:"structure"` + + // The topic rule destination. + TopicRuleDestination *TopicRuleDestination `locationName:"topicRuleDestination" type:"structure"` +} + +// String returns the string representation +func (s GetTopicRuleDestinationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetTopicRuleDestinationOutput) GoString() string { + return s.String() +} + +// SetTopicRuleDestination sets the TopicRuleDestination field's value. +func (s *GetTopicRuleDestinationOutput) SetTopicRuleDestination(v *TopicRuleDestination) *GetTopicRuleDestinationOutput { + s.TopicRuleDestination = v + return s +} + // The input for the GetTopicRule operation. type GetTopicRuleInput struct { _ struct{} `type:"structure"` @@ -27415,6 +31712,325 @@ func (s *GroupNameAndArn) SetGroupName(v string) *GroupNameAndArn { return s } +// Send data to an HTTPS endpoint. +type HttpAction struct { + _ struct{} `type:"structure"` + + // The authentication method to use when sending data to an HTTPS endpoint. + Auth *HttpAuthorization `locationName:"auth" type:"structure"` + + // The URL to which AWS IoT sends a confirmation message. The value of the confirmation + // URL must be a prefix of the endpoint URL. If you do not specify a confirmation + // URL AWS IoT uses the endpoint URL as the confirmation URL. If you use substitution + // templates in the confirmationUrl, you must create and enable topic rule destinations + // that match each possible value of the substituion template before traffic + // is allowed to your endpoint URL. + ConfirmationUrl *string `locationName:"confirmationUrl" type:"string"` + + // The HTTP headers to send with the message data. + Headers []*HttpActionHeader `locationName:"headers" type:"list"` + + // The endpoint URL. If substitution templates are used in the URL, you must + // also specify a confirmationUrl. If this is a new destination, a new TopicRuleDestination + // is created if possible. + // + // Url is a required field + Url *string `locationName:"url" type:"string" required:"true"` +} + +// String returns the string representation +func (s HttpAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HttpAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *HttpAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HttpAction"} + if s.Url == nil { + invalidParams.Add(request.NewErrParamRequired("Url")) + } + if s.Auth != nil { + if err := s.Auth.Validate(); err != nil { + invalidParams.AddNested("Auth", err.(request.ErrInvalidParams)) + } + } + if s.Headers != nil { + for i, v := range s.Headers { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Headers", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuth sets the Auth field's value. +func (s *HttpAction) SetAuth(v *HttpAuthorization) *HttpAction { + s.Auth = v + return s +} + +// SetConfirmationUrl sets the ConfirmationUrl field's value. +func (s *HttpAction) SetConfirmationUrl(v string) *HttpAction { + s.ConfirmationUrl = &v + return s +} + +// SetHeaders sets the Headers field's value. +func (s *HttpAction) SetHeaders(v []*HttpActionHeader) *HttpAction { + s.Headers = v + return s +} + +// SetUrl sets the Url field's value. +func (s *HttpAction) SetUrl(v string) *HttpAction { + s.Url = &v + return s +} + +// The HTTP action header. +type HttpActionHeader struct { + _ struct{} `type:"structure"` + + // The HTTP header key. + // + // Key is a required field + Key *string `locationName:"key" min:"1" type:"string" required:"true"` + + // The HTTP header value. Substitution templates are supported. + // + // Value is a required field + Value *string `locationName:"value" type:"string" required:"true"` +} + +// String returns the string representation +func (s HttpActionHeader) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HttpActionHeader) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *HttpActionHeader) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HttpActionHeader"} + 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 *HttpActionHeader) SetKey(v string) *HttpActionHeader { + s.Key = &v + return s +} + +// SetValue sets the Value field's value. +func (s *HttpActionHeader) SetValue(v string) *HttpActionHeader { + s.Value = &v + return s +} + +// The authorization method used to send messages. +type HttpAuthorization struct { + _ struct{} `type:"structure"` + + // Use Sig V4 authorization. For more information, see Signature Version 4 Signing + // Process (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). + Sigv4 *SigV4Authorization `locationName:"sigv4" type:"structure"` +} + +// String returns the string representation +func (s HttpAuthorization) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HttpAuthorization) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *HttpAuthorization) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HttpAuthorization"} + if s.Sigv4 != nil { + if err := s.Sigv4.Validate(); err != nil { + invalidParams.AddNested("Sigv4", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSigv4 sets the Sigv4 field's value. +func (s *HttpAuthorization) SetSigv4(v *SigV4Authorization) *HttpAuthorization { + s.Sigv4 = v + return s +} + +// Specifies the HTTP context to use for the test authorizer request. +type HttpContext struct { + _ struct{} `type:"structure"` + + // The header keys and values in an HTTP authorization request. + Headers map[string]*string `locationName:"headers" type:"map"` + + // The query string keys and values in an HTTP authorization request. + QueryString *string `locationName:"queryString" min:"1" type:"string"` +} + +// String returns the string representation +func (s HttpContext) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HttpContext) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *HttpContext) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HttpContext"} + if s.QueryString != nil && len(*s.QueryString) < 1 { + invalidParams.Add(request.NewErrParamMinLen("QueryString", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHeaders sets the Headers field's value. +func (s *HttpContext) SetHeaders(v map[string]*string) *HttpContext { + s.Headers = v + return s +} + +// SetQueryString sets the QueryString field's value. +func (s *HttpContext) SetQueryString(v string) *HttpContext { + s.QueryString = &v + return s +} + +// HTTP URL destination configuration used by the topic rule's HTTP action. +type HttpUrlDestinationConfiguration struct { + _ struct{} `type:"structure"` + + // The URL AWS IoT uses to confirm ownership of or access to the topic rule + // destination URL. + // + // ConfirmationUrl is a required field + ConfirmationUrl *string `locationName:"confirmationUrl" type:"string" required:"true"` +} + +// String returns the string representation +func (s HttpUrlDestinationConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HttpUrlDestinationConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *HttpUrlDestinationConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HttpUrlDestinationConfiguration"} + if s.ConfirmationUrl == nil { + invalidParams.Add(request.NewErrParamRequired("ConfirmationUrl")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConfirmationUrl sets the ConfirmationUrl field's value. +func (s *HttpUrlDestinationConfiguration) SetConfirmationUrl(v string) *HttpUrlDestinationConfiguration { + s.ConfirmationUrl = &v + return s +} + +// HTTP URL destination properties. +type HttpUrlDestinationProperties struct { + _ struct{} `type:"structure"` + + // The URL used to confirm the HTTP topic rule destination URL. + ConfirmationUrl *string `locationName:"confirmationUrl" type:"string"` +} + +// String returns the string representation +func (s HttpUrlDestinationProperties) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HttpUrlDestinationProperties) GoString() string { + return s.String() +} + +// SetConfirmationUrl sets the ConfirmationUrl field's value. +func (s *HttpUrlDestinationProperties) SetConfirmationUrl(v string) *HttpUrlDestinationProperties { + s.ConfirmationUrl = &v + return s +} + +// Information about an HTTP URL destination. +type HttpUrlDestinationSummary struct { + _ struct{} `type:"structure"` + + // The URL used to confirm ownership of or access to the HTTP topic rule destination + // URL. + ConfirmationUrl *string `locationName:"confirmationUrl" type:"string"` +} + +// String returns the string representation +func (s HttpUrlDestinationSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HttpUrlDestinationSummary) GoString() string { + return s.String() +} + +// SetConfirmationUrl sets the ConfirmationUrl field's value. +func (s *HttpUrlDestinationSummary) SetConfirmationUrl(v string) *HttpUrlDestinationSummary { + s.ConfirmationUrl = &v + return s +} + // Information that implicitly denies authorization. When policy doesn't explicitly // deny or allow an action on a resource it is considered an implicit deny. type ImplicitDeny struct { @@ -27441,6 +32057,463 @@ func (s *ImplicitDeny) SetPolicies(v []*Policy) *ImplicitDeny { return s } +// The index is not ready. +type IndexNotReadyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s IndexNotReadyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IndexNotReadyException) GoString() string { + return s.String() +} + +func newErrorIndexNotReadyException(v protocol.ResponseMetadata) error { + return &IndexNotReadyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IndexNotReadyException) Code() string { + return "IndexNotReadyException" +} + +// Message returns the exception's message. +func (s IndexNotReadyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IndexNotReadyException) OrigErr() error { + return nil +} + +func (s IndexNotReadyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IndexNotReadyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IndexNotReadyException) RequestID() string { + return s.respMetadata.RequestID +} + +// An unexpected error has occurred. +type InternalException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalException) GoString() string { + return s.String() +} + +func newErrorInternalException(v protocol.ResponseMetadata) error { + return &InternalException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalException) Code() string { + return "InternalException" +} + +// Message returns the exception's message. +func (s InternalException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalException) OrigErr() error { + return nil +} + +func (s InternalException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalException) RequestID() string { + return s.respMetadata.RequestID +} + +// An unexpected error has occurred. +type InternalFailureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalFailureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalFailureException) GoString() string { + return s.String() +} + +func newErrorInternalFailureException(v protocol.ResponseMetadata) error { + return &InternalFailureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalFailureException) Code() string { + return "InternalFailureException" +} + +// Message returns the exception's message. +func (s InternalFailureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalFailureException) OrigErr() error { + return nil +} + +func (s InternalFailureException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalFailureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalFailureException) RequestID() string { + return s.respMetadata.RequestID +} + +// The aggregation is invalid. +type InvalidAggregationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidAggregationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidAggregationException) GoString() string { + return s.String() +} + +func newErrorInvalidAggregationException(v protocol.ResponseMetadata) error { + return &InvalidAggregationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidAggregationException) Code() string { + return "InvalidAggregationException" +} + +// Message returns the exception's message. +func (s InvalidAggregationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAggregationException) OrigErr() error { + return nil +} + +func (s InvalidAggregationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAggregationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAggregationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The query is invalid. +type InvalidQueryException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidQueryException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidQueryException) GoString() string { + return s.String() +} + +func newErrorInvalidQueryException(v protocol.ResponseMetadata) error { + return &InvalidQueryException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidQueryException) Code() string { + return "InvalidQueryException" +} + +// Message returns the exception's message. +func (s InvalidQueryException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidQueryException) OrigErr() error { + return nil +} + +func (s InvalidQueryException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidQueryException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidQueryException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request is not valid. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// The response is invalid. +type InvalidResponseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidResponseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidResponseException) GoString() string { + return s.String() +} + +func newErrorInvalidResponseException(v protocol.ResponseMetadata) error { + return &InvalidResponseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidResponseException) Code() string { + return "InvalidResponseException" +} + +// Message returns the exception's message. +func (s InvalidResponseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidResponseException) OrigErr() error { + return nil +} + +func (s InvalidResponseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidResponseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidResponseException) RequestID() string { + return s.respMetadata.RequestID +} + +// An attempt was made to change to an invalid state, for example by deleting +// a job or a job execution which is "IN_PROGRESS" without setting the force +// parameter. +type InvalidStateTransitionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidStateTransitionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidStateTransitionException) GoString() string { + return s.String() +} + +func newErrorInvalidStateTransitionException(v protocol.ResponseMetadata) error { + return &InvalidStateTransitionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidStateTransitionException) Code() string { + return "InvalidStateTransitionException" +} + +// Message returns the exception's message. +func (s InvalidStateTransitionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidStateTransitionException) OrigErr() error { + return nil +} + +func (s InvalidStateTransitionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidStateTransitionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidStateTransitionException) RequestID() string { + return s.respMetadata.RequestID +} + // Sends message data to an AWS IoT Analytics channel. type IotAnalyticsAction struct { _ struct{} `type:"structure"` @@ -27552,6 +32625,75 @@ func (s *IotEventsAction) SetRoleArn(v string) *IotEventsAction { return s } +// Describes an action to send data from an MQTT message that triggered the +// rule to AWS IoT SiteWise asset properties. +type IotSiteWiseAction struct { + _ struct{} `type:"structure"` + + // A list of asset property value entries. + // + // PutAssetPropertyValueEntries is a required field + PutAssetPropertyValueEntries []*PutAssetPropertyValueEntry `locationName:"putAssetPropertyValueEntries" min:"1" type:"list" required:"true"` + + // The ARN of the role that grants AWS IoT permission to send an asset property + // value to AWS IoTSiteWise. ("Action": "iotsitewise:BatchPutAssetPropertyValue"). + // The trust policy can restrict access to specific asset hierarchy paths. + // + // RoleArn is a required field + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s IotSiteWiseAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IotSiteWiseAction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *IotSiteWiseAction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "IotSiteWiseAction"} + if s.PutAssetPropertyValueEntries == nil { + invalidParams.Add(request.NewErrParamRequired("PutAssetPropertyValueEntries")) + } + if s.PutAssetPropertyValueEntries != nil && len(s.PutAssetPropertyValueEntries) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PutAssetPropertyValueEntries", 1)) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.PutAssetPropertyValueEntries != nil { + for i, v := range s.PutAssetPropertyValueEntries { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PutAssetPropertyValueEntries", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPutAssetPropertyValueEntries sets the PutAssetPropertyValueEntries field's value. +func (s *IotSiteWiseAction) SetPutAssetPropertyValueEntries(v []*PutAssetPropertyValueEntry) *IotSiteWiseAction { + s.PutAssetPropertyValueEntries = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *IotSiteWiseAction) SetRoleArn(v string) *IotSiteWiseAction { + s.RoleArn = &v + return s +} + // The Job object contains details about a job. type Job struct { _ struct{} `type:"structure"` @@ -28385,6 +33527,63 @@ func (s *LambdaAction) SetFunctionArn(v string) *LambdaAction { return s } +// A limit has been exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListActiveViolationsInput struct { _ struct{} `type:"structure"` @@ -29590,6 +34789,93 @@ func (s *ListCertificatesOutput) SetNextMarker(v string) *ListCertificatesOutput return s } +type ListDomainConfigurationsInput struct { + _ struct{} `type:"structure"` + + // The marker for the next set of results. + Marker *string `location:"querystring" locationName:"marker" type:"string"` + + // The result page size. + PageSize *int64 `location:"querystring" locationName:"pageSize" min:"1" type:"integer"` + + // The type of service delivered by the endpoint. + ServiceType *string `location:"querystring" locationName:"serviceType" type:"string" enum:"ServiceType"` +} + +// String returns the string representation +func (s ListDomainConfigurationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDomainConfigurationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListDomainConfigurationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListDomainConfigurationsInput"} + 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 *ListDomainConfigurationsInput) SetMarker(v string) *ListDomainConfigurationsInput { + s.Marker = &v + return s +} + +// SetPageSize sets the PageSize field's value. +func (s *ListDomainConfigurationsInput) SetPageSize(v int64) *ListDomainConfigurationsInput { + s.PageSize = &v + return s +} + +// SetServiceType sets the ServiceType field's value. +func (s *ListDomainConfigurationsInput) SetServiceType(v string) *ListDomainConfigurationsInput { + s.ServiceType = &v + return s +} + +type ListDomainConfigurationsOutput struct { + _ struct{} `type:"structure"` + + // A list of objects that contain summary information about the user's domain + // configurations. + DomainConfigurations []*DomainConfigurationSummary `locationName:"domainConfigurations" type:"list"` + + // The marker for the next set of results. + NextMarker *string `locationName:"nextMarker" type:"string"` +} + +// String returns the string representation +func (s ListDomainConfigurationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDomainConfigurationsOutput) GoString() string { + return s.String() +} + +// SetDomainConfigurations sets the DomainConfigurations field's value. +func (s *ListDomainConfigurationsOutput) SetDomainConfigurations(v []*DomainConfigurationSummary) *ListDomainConfigurationsOutput { + s.DomainConfigurations = v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListDomainConfigurationsOutput) SetNextMarker(v string) *ListDomainConfigurationsOutput { + s.NextMarker = &v + return s +} + type ListIndicesInput struct { _ struct{} `type:"structure"` @@ -30727,6 +36013,177 @@ func (s *ListPrincipalThingsOutput) SetThings(v []*string) *ListPrincipalThingsO return s } +type ListProvisioningTemplateVersionsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of results to return at one time. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // A token to retrieve the next set of results. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + + // The name of the fleet provisioning template. + // + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"templateName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListProvisioningTemplateVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListProvisioningTemplateVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListProvisioningTemplateVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListProvisioningTemplateVersionsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 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 +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListProvisioningTemplateVersionsInput) SetMaxResults(v int64) *ListProvisioningTemplateVersionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListProvisioningTemplateVersionsInput) SetNextToken(v string) *ListProvisioningTemplateVersionsInput { + s.NextToken = &v + return s +} + +// SetTemplateName sets the TemplateName field's value. +func (s *ListProvisioningTemplateVersionsInput) SetTemplateName(v string) *ListProvisioningTemplateVersionsInput { + s.TemplateName = &v + return s +} + +type ListProvisioningTemplateVersionsOutput struct { + _ struct{} `type:"structure"` + + // A token to retrieve the next set of results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The list of fleet provisioning template versions. + Versions []*ProvisioningTemplateVersionSummary `locationName:"versions" type:"list"` +} + +// String returns the string representation +func (s ListProvisioningTemplateVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListProvisioningTemplateVersionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListProvisioningTemplateVersionsOutput) SetNextToken(v string) *ListProvisioningTemplateVersionsOutput { + s.NextToken = &v + return s +} + +// SetVersions sets the Versions field's value. +func (s *ListProvisioningTemplateVersionsOutput) SetVersions(v []*ProvisioningTemplateVersionSummary) *ListProvisioningTemplateVersionsOutput { + s.Versions = v + return s +} + +type ListProvisioningTemplatesInput struct { + _ struct{} `type:"structure"` + + // The maximum number of results to return at one time. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // A token to retrieve the next set of results. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListProvisioningTemplatesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListProvisioningTemplatesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListProvisioningTemplatesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListProvisioningTemplatesInput"} + 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 *ListProvisioningTemplatesInput) SetMaxResults(v int64) *ListProvisioningTemplatesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListProvisioningTemplatesInput) SetNextToken(v string) *ListProvisioningTemplatesInput { + s.NextToken = &v + return s +} + +type ListProvisioningTemplatesOutput struct { + _ struct{} `type:"structure"` + + // A token to retrieve the next set of results. + NextToken *string `locationName:"nextToken" type:"string"` + + // A list of fleet provisioning templates + Templates []*ProvisioningTemplateSummary `locationName:"templates" type:"list"` +} + +// String returns the string representation +func (s ListProvisioningTemplatesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListProvisioningTemplatesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListProvisioningTemplatesOutput) SetNextToken(v string) *ListProvisioningTemplatesOutput { + s.NextToken = &v + return s +} + +// SetTemplates sets the Templates field's value. +func (s *ListProvisioningTemplatesOutput) SetTemplates(v []*ProvisioningTemplateSummary) *ListProvisioningTemplatesOutput { + s.Templates = v + return s +} + type ListRoleAliasesInput struct { _ struct{} `type:"structure"` @@ -32304,6 +37761,83 @@ func (s *ListThingsOutput) SetThings(v []*ThingAttribute) *ListThingsOutput { return s } +type ListTopicRuleDestinationsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of results to return at one time. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // The token to retrieve the next set of results. + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListTopicRuleDestinationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTopicRuleDestinationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTopicRuleDestinationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTopicRuleDestinationsInput"} + 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 *ListTopicRuleDestinationsInput) SetMaxResults(v int64) *ListTopicRuleDestinationsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTopicRuleDestinationsInput) SetNextToken(v string) *ListTopicRuleDestinationsInput { + s.NextToken = &v + return s +} + +type ListTopicRuleDestinationsOutput struct { + _ struct{} `type:"structure"` + + // Information about a topic rule destination. + DestinationSummaries []*TopicRuleDestinationSummary `locationName:"destinationSummaries" type:"list"` + + // The token to retrieve the next set of results. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListTopicRuleDestinationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTopicRuleDestinationsOutput) GoString() string { + return s.String() +} + +// SetDestinationSummaries sets the DestinationSummaries field's value. +func (s *ListTopicRuleDestinationsOutput) SetDestinationSummaries(v []*TopicRuleDestinationSummary) *ListTopicRuleDestinationsOutput { + s.DestinationSummaries = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTopicRuleDestinationsOutput) SetNextToken(v string) *ListTopicRuleDestinationsOutput { + s.NextToken = &v + return s +} + // The input for the ListTopicRules operation. type ListTopicRulesInput struct { _ struct{} `type:"structure"` @@ -32751,6 +38285,63 @@ func (s *LoggingOptionsPayload) SetRoleArn(v string) *LoggingOptionsPayload { return s } +// The policy documentation is not valid. +type MalformedPolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s MalformedPolicyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MalformedPolicyException) GoString() string { + return s.String() +} + +func newErrorMalformedPolicyException(v protocol.ResponseMetadata) error { + return &MalformedPolicyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MalformedPolicyException) Code() string { + return "MalformedPolicyException" +} + +// Message returns the exception's message. +func (s MalformedPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MalformedPolicyException) OrigErr() error { + return nil +} + +func (s MalformedPolicyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MalformedPolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MalformedPolicyException) RequestID() string { + return s.respMetadata.RequestID +} + // The value to be compared with the metric. type MetricValue struct { _ struct{} `type:"structure"` @@ -33009,6 +38600,69 @@ func (s *MitigationActionParams) SetUpdateDeviceCertificateParams(v *UpdateDevic return s } +// Specifies the MQTT context to use for the test authorizer request +type MqttContext struct { + _ struct{} `type:"structure"` + + // The value of the clientId key in an MQTT authorization request. + ClientId *string `locationName:"clientId" min:"1" type:"string"` + + // The value of the password key in an MQTT authorization request. + // + // Password is automatically base64 encoded/decoded by the SDK. + Password []byte `locationName:"password" min:"1" type:"blob"` + + // The value of the username key in an MQTT authorization request. + Username *string `locationName:"username" min:"1" type:"string"` +} + +// String returns the string representation +func (s MqttContext) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MqttContext) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *MqttContext) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MqttContext"} + if s.ClientId != nil && len(*s.ClientId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientId", 1)) + } + 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 +} + +// SetClientId sets the ClientId field's value. +func (s *MqttContext) SetClientId(v string) *MqttContext { + s.ClientId = &v + return s +} + +// SetPassword sets the Password field's value. +func (s *MqttContext) SetPassword(v []byte) *MqttContext { + s.Password = v + return s +} + +// SetUsername sets the Username field's value. +func (s *MqttContext) SetUsername(v string) *MqttContext { + s.Username = &v + return s +} + // Information about the resource that was noncompliant with the audit check. type NonCompliantResource struct { _ struct{} `type:"structure"` @@ -33051,6 +38705,63 @@ func (s *NonCompliantResource) SetResourceType(v string) *NonCompliantResource { return s } +// The resource is not configured. +type NotConfiguredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotConfiguredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotConfiguredException) GoString() string { + return s.String() +} + +func newErrorNotConfiguredException(v protocol.ResponseMetadata) error { + return &NotConfiguredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotConfiguredException) Code() string { + return "NotConfiguredException" +} + +// Message returns the exception's message. +func (s NotConfiguredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotConfiguredException) OrigErr() error { + return nil +} + +func (s NotConfiguredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotConfiguredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotConfiguredException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes a file to be associated with an OTA update. type OTAUpdateFile struct { _ struct{} `type:"structure"` @@ -33147,6 +38858,10 @@ type OTAUpdateInfo struct { // Configuration for the rollout of OTA updates. AwsJobExecutionsRolloutConfig *AwsJobExecutionsRolloutConfig `locationName:"awsJobExecutionsRolloutConfig" type:"structure"` + // Configuration information for pre-signed URLs. Valid when protocols contains + // HTTP. + AwsJobPresignedUrlConfig *AwsJobPresignedUrlConfig `locationName:"awsJobPresignedUrlConfig" type:"structure"` + // The date when the OTA update was created. CreationDate *time.Time `locationName:"creationDate" type:"timestamp"` @@ -33171,6 +38886,11 @@ type OTAUpdateInfo struct { // The status of the OTA update. OtaUpdateStatus *string `locationName:"otaUpdateStatus" type:"string" enum:"OTAUpdateStatus"` + // The protocol used to transfer the OTA update image. Valid values are [HTTP], + // [MQTT], [HTTP, MQTT]. When both HTTP and MQTT are specified, the target device + // can choose the protocol. + Protocols []*string `locationName:"protocols" min:"1" type:"list"` + // Specifies whether the OTA update will continue to run (CONTINUOUS), or will // be complete after all those things specified as targets have completed the // OTA update (SNAPSHOT). If continuous, the OTA update may also be run on a @@ -33217,6 +38937,12 @@ func (s *OTAUpdateInfo) SetAwsJobExecutionsRolloutConfig(v *AwsJobExecutionsRoll return s } +// SetAwsJobPresignedUrlConfig sets the AwsJobPresignedUrlConfig field's value. +func (s *OTAUpdateInfo) SetAwsJobPresignedUrlConfig(v *AwsJobPresignedUrlConfig) *OTAUpdateInfo { + s.AwsJobPresignedUrlConfig = v + return s +} + // SetCreationDate sets the CreationDate field's value. func (s *OTAUpdateInfo) SetCreationDate(v time.Time) *OTAUpdateInfo { s.CreationDate = &v @@ -33265,6 +38991,12 @@ func (s *OTAUpdateInfo) SetOtaUpdateStatus(v string) *OTAUpdateInfo { return s } +// SetProtocols sets the Protocols field's value. +func (s *OTAUpdateInfo) SetProtocols(v []*string) *OTAUpdateInfo { + s.Protocols = v + return s +} + // SetTargetSelection sets the TargetSelection field's value. func (s *OTAUpdateInfo) SetTargetSelection(v string) *OTAUpdateInfo { s.TargetSelection = &v @@ -33388,6 +39120,39 @@ func (s *OutgoingCertificate) SetTransferredTo(v string) *OutgoingCertificate { return s } +// Describes the percentile and percentile value. +type PercentPair struct { + _ struct{} `type:"structure"` + + // The percentile. + Percent *float64 `locationName:"percent" type:"double"` + + // The value of the percentile. + Value *float64 `locationName:"value" type:"double"` +} + +// String returns the string representation +func (s PercentPair) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PercentPair) GoString() string { + return s.String() +} + +// SetPercent sets the Percent field's value. +func (s *PercentPair) SetPercent(v float64) *PercentPair { + s.Percent = &v + return s +} + +// SetValue sets the Value field's value. +func (s *PercentPair) SetValue(v float64) *PercentPair { + s.Value = &v + return s +} + // Describes an AWS IoT policy. type Policy struct { _ struct{} `type:"structure"` @@ -33562,6 +39327,118 @@ func (s *PresignedUrlConfig) SetRoleArn(v string) *PresignedUrlConfig { return s } +// A summary of information about a fleet provisioning template. +type ProvisioningTemplateSummary struct { + _ struct{} `type:"structure"` + + // The date when the fleet provisioning template summary was created. + CreationDate *time.Time `locationName:"creationDate" type:"timestamp"` + + // The description of the fleet provisioning template. + Description *string `locationName:"description" type:"string"` + + // True if the fleet provision template is enabled, otherwise false. + Enabled *bool `locationName:"enabled" type:"boolean"` + + // The date when the fleet provisioning template summary was last modified. + LastModifiedDate *time.Time `locationName:"lastModifiedDate" type:"timestamp"` + + // The ARN of the fleet provisioning template. + TemplateArn *string `locationName:"templateArn" type:"string"` + + // The name of the fleet provisioning template. + TemplateName *string `locationName:"templateName" min:"1" type:"string"` +} + +// String returns the string representation +func (s ProvisioningTemplateSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ProvisioningTemplateSummary) GoString() string { + return s.String() +} + +// SetCreationDate sets the CreationDate field's value. +func (s *ProvisioningTemplateSummary) SetCreationDate(v time.Time) *ProvisioningTemplateSummary { + s.CreationDate = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *ProvisioningTemplateSummary) SetDescription(v string) *ProvisioningTemplateSummary { + s.Description = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *ProvisioningTemplateSummary) SetEnabled(v bool) *ProvisioningTemplateSummary { + s.Enabled = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *ProvisioningTemplateSummary) SetLastModifiedDate(v time.Time) *ProvisioningTemplateSummary { + s.LastModifiedDate = &v + return s +} + +// SetTemplateArn sets the TemplateArn field's value. +func (s *ProvisioningTemplateSummary) SetTemplateArn(v string) *ProvisioningTemplateSummary { + s.TemplateArn = &v + return s +} + +// SetTemplateName sets the TemplateName field's value. +func (s *ProvisioningTemplateSummary) SetTemplateName(v string) *ProvisioningTemplateSummary { + s.TemplateName = &v + return s +} + +// A summary of information about a fleet provision template version. +type ProvisioningTemplateVersionSummary struct { + _ struct{} `type:"structure"` + + // The date when the fleet provisioning template version was created + CreationDate *time.Time `locationName:"creationDate" type:"timestamp"` + + // True if the fleet provisioning template version is the default version, otherwise + // false. + IsDefaultVersion *bool `locationName:"isDefaultVersion" type:"boolean"` + + // The ID of the fleet privisioning template version. + VersionId *int64 `locationName:"versionId" type:"integer"` +} + +// String returns the string representation +func (s ProvisioningTemplateVersionSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ProvisioningTemplateVersionSummary) GoString() string { + return s.String() +} + +// SetCreationDate sets the CreationDate field's value. +func (s *ProvisioningTemplateVersionSummary) SetCreationDate(v time.Time) *ProvisioningTemplateVersionSummary { + s.CreationDate = &v + return s +} + +// SetIsDefaultVersion sets the IsDefaultVersion field's value. +func (s *ProvisioningTemplateVersionSummary) SetIsDefaultVersion(v bool) *ProvisioningTemplateVersionSummary { + s.IsDefaultVersion = &v + return s +} + +// SetVersionId sets the VersionId field's value. +func (s *ProvisioningTemplateVersionSummary) SetVersionId(v int64) *ProvisioningTemplateVersionSummary { + s.VersionId = &v + return s +} + // Parameters to define a mitigation action that publishes findings to Amazon // SNS. You can implement your own custom actions in response to the Amazon // SNS messages. @@ -33603,6 +39480,104 @@ func (s *PublishFindingToSnsParams) SetTopicArn(v string) *PublishFindingToSnsPa return s } +// An asset property value entry containing the following information. +type PutAssetPropertyValueEntry struct { + _ struct{} `type:"structure"` + + // The ID of the AWS IoT SiteWise asset. You must specify either a propertyAlias + // or both an aliasId and a propertyId. Accepts substitution templates. + AssetId *string `locationName:"assetId" type:"string"` + + // Optional. A unique identifier for this entry that you can define to better + // track which message caused an error in case of failure. Accepts substitution + // templates. Defaults to a new UUID. + EntryId *string `locationName:"entryId" type:"string"` + + // The name of the property alias associated with your asset property. You must + // specify either a propertyAlias or both an aliasId and a propertyId. Accepts + // substitution templates. + PropertyAlias *string `locationName:"propertyAlias" min:"1" type:"string"` + + // The ID of the asset's property. You must specify either a propertyAlias or + // both an aliasId and a propertyId. Accepts substitution templates. + PropertyId *string `locationName:"propertyId" type:"string"` + + // A list of property values to insert that each contain timestamp, quality, + // and value (TQV) information. + // + // PropertyValues is a required field + PropertyValues []*AssetPropertyValue `locationName:"propertyValues" min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s PutAssetPropertyValueEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutAssetPropertyValueEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutAssetPropertyValueEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutAssetPropertyValueEntry"} + if s.PropertyAlias != nil && len(*s.PropertyAlias) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PropertyAlias", 1)) + } + if s.PropertyValues == nil { + invalidParams.Add(request.NewErrParamRequired("PropertyValues")) + } + if s.PropertyValues != nil && len(s.PropertyValues) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PropertyValues", 1)) + } + if s.PropertyValues != nil { + for i, v := range s.PropertyValues { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PropertyValues", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssetId sets the AssetId field's value. +func (s *PutAssetPropertyValueEntry) SetAssetId(v string) *PutAssetPropertyValueEntry { + s.AssetId = &v + return s +} + +// SetEntryId sets the EntryId field's value. +func (s *PutAssetPropertyValueEntry) SetEntryId(v string) *PutAssetPropertyValueEntry { + s.EntryId = &v + return s +} + +// SetPropertyAlias sets the PropertyAlias field's value. +func (s *PutAssetPropertyValueEntry) SetPropertyAlias(v string) *PutAssetPropertyValueEntry { + s.PropertyAlias = &v + return s +} + +// SetPropertyId sets the PropertyId field's value. +func (s *PutAssetPropertyValueEntry) SetPropertyId(v string) *PutAssetPropertyValueEntry { + s.PropertyId = &v + return s +} + +// SetPropertyValues sets the PropertyValues field's value. +func (s *PutAssetPropertyValueEntry) SetPropertyValues(v []*AssetPropertyValue) *PutAssetPropertyValueEntry { + s.PropertyValues = v + return s +} + // The input for the DynamoActionVS action that specifies the DynamoDB table // to which the message data will be written. type PutItemInput struct { @@ -34007,6 +39982,63 @@ func (s *RegisterThingOutput) SetResourceArns(v map[string]*string) *RegisterThi return s } +// The registration code is invalid. +type RegistrationCodeValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Additional information about the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s RegistrationCodeValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegistrationCodeValidationException) GoString() string { + return s.String() +} + +func newErrorRegistrationCodeValidationException(v protocol.ResponseMetadata) error { + return &RegistrationCodeValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RegistrationCodeValidationException) Code() string { + return "RegistrationCodeValidationException" +} + +// Message returns the exception's message. +func (s RegistrationCodeValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RegistrationCodeValidationException) OrigErr() error { + return nil +} + +func (s RegistrationCodeValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RegistrationCodeValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RegistrationCodeValidationException) RequestID() string { + return s.respMetadata.RequestID +} + // The registration configuration. type RegistrationConfig struct { _ struct{} `type:"structure"` @@ -34440,7 +40472,8 @@ func (s ReplaceTopicRuleOutput) GoString() string { type RepublishAction struct { _ struct{} `type:"structure"` - // The Quality of Service (QoS) level to use when republishing messages. + // The Quality of Service (QoS) level to use when republishing messages. The + // default value is 0. Qos *int64 `locationName:"qos" type:"integer"` // The ARN of the IAM role that grants access. @@ -34498,6 +40531,69 @@ func (s *RepublishAction) SetTopic(v string) *RepublishAction { return s } +// The resource already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` + + // The ARN of the resource that caused the exception. + ResourceArn *string `locationName:"resourceArn" type:"string"` + + // The ID of the resource that caused the exception. + ResourceId *string `locationName:"resourceId" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + // Information that identifies the noncompliant resource. type ResourceIdentifier struct { _ struct{} `type:"structure"` @@ -34517,8 +40613,14 @@ type ResourceIdentifier struct { // The ID of the certificate attached to the resource. DeviceCertificateId *string `locationName:"deviceCertificateId" min:"64" type:"string"` + // The ARN of the IAM role that has overly permissive actions. + IamRoleArn *string `locationName:"iamRoleArn" min:"20" type:"string"` + // The version of the policy associated with the resource. PolicyVersionIdentifier *PolicyVersionIdentifier `locationName:"policyVersionIdentifier" type:"structure"` + + // The ARN of the role alias that has overly permissive actions. + RoleAliasArn *string `locationName:"roleAliasArn" min:"1" type:"string"` } // String returns the string representation @@ -34543,6 +40645,12 @@ func (s *ResourceIdentifier) Validate() error { if s.DeviceCertificateId != nil && len(*s.DeviceCertificateId) < 64 { invalidParams.Add(request.NewErrParamMinLen("DeviceCertificateId", 64)) } + if s.IamRoleArn != nil && len(*s.IamRoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("IamRoleArn", 20)) + } + if s.RoleAliasArn != nil && len(*s.RoleAliasArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RoleAliasArn", 1)) + } if s.PolicyVersionIdentifier != nil { if err := s.PolicyVersionIdentifier.Validate(); err != nil { invalidParams.AddNested("PolicyVersionIdentifier", err.(request.ErrInvalidParams)) @@ -34585,12 +40693,138 @@ func (s *ResourceIdentifier) SetDeviceCertificateId(v string) *ResourceIdentifie return s } +// SetIamRoleArn sets the IamRoleArn field's value. +func (s *ResourceIdentifier) SetIamRoleArn(v string) *ResourceIdentifier { + s.IamRoleArn = &v + return s +} + // SetPolicyVersionIdentifier sets the PolicyVersionIdentifier field's value. func (s *ResourceIdentifier) SetPolicyVersionIdentifier(v *PolicyVersionIdentifier) *ResourceIdentifier { s.PolicyVersionIdentifier = v return s } +// SetRoleAliasArn sets the RoleAliasArn field's value. +func (s *ResourceIdentifier) SetRoleAliasArn(v string) *ResourceIdentifier { + s.RoleAliasArn = &v + return s +} + +// The specified resource does not exist. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource registration failed. +type ResourceRegistrationFailureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceRegistrationFailureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceRegistrationFailureException) GoString() string { + return s.String() +} + +func newErrorResourceRegistrationFailureException(v protocol.ResponseMetadata) error { + return &ResourceRegistrationFailureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceRegistrationFailureException) Code() string { + return "ResourceRegistrationFailureException" +} + +// Message returns the exception's message. +func (s ResourceRegistrationFailureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceRegistrationFailureException) OrigErr() error { + return nil +} + +func (s ResourceRegistrationFailureException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceRegistrationFailureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceRegistrationFailureException) RequestID() string { + return s.respMetadata.RequestID +} + // Role alias description. type RoleAliasDescription struct { _ struct{} `type:"structure"` @@ -34611,7 +40845,7 @@ type RoleAliasDescription struct { RoleAlias *string `locationName:"roleAlias" min:"1" type:"string"` // The ARN of the role alias. - RoleAliasArn *string `locationName:"roleAliasArn" type:"string"` + RoleAliasArn *string `locationName:"roleAliasArn" min:"1" type:"string"` // The role ARN. RoleArn *string `locationName:"roleArn" min:"20" type:"string"` @@ -35194,6 +41428,105 @@ func (s *SecurityProfileTargetMapping) SetTarget(v *SecurityProfileTarget) *Secu return s } +// An object that contains information about a server certificate. +type ServerCertificateSummary struct { + _ struct{} `type:"structure"` + + // The ARN of the server certificate. + ServerCertificateArn *string `locationName:"serverCertificateArn" min:"1" type:"string"` + + // The status of the server certificate. + ServerCertificateStatus *string `locationName:"serverCertificateStatus" type:"string" enum:"ServerCertificateStatus"` + + // Details that explain the status of the server certificate. + ServerCertificateStatusDetail *string `locationName:"serverCertificateStatusDetail" type:"string"` +} + +// String returns the string representation +func (s ServerCertificateSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServerCertificateSummary) GoString() string { + return s.String() +} + +// SetServerCertificateArn sets the ServerCertificateArn field's value. +func (s *ServerCertificateSummary) SetServerCertificateArn(v string) *ServerCertificateSummary { + s.ServerCertificateArn = &v + return s +} + +// SetServerCertificateStatus sets the ServerCertificateStatus field's value. +func (s *ServerCertificateSummary) SetServerCertificateStatus(v string) *ServerCertificateSummary { + s.ServerCertificateStatus = &v + return s +} + +// SetServerCertificateStatusDetail sets the ServerCertificateStatusDetail field's value. +func (s *ServerCertificateSummary) SetServerCertificateStatusDetail(v string) *ServerCertificateSummary { + s.ServerCertificateStatusDetail = &v + return s +} + +// The service is temporarily unavailable. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + type SetDefaultAuthorizerInput struct { _ struct{} `type:"structure"` @@ -35524,6 +41857,73 @@ func (s SetV2LoggingOptionsOutput) GoString() string { return s.String() } +// Use Sig V4 authorization. +type SigV4Authorization struct { + _ struct{} `type:"structure"` + + // The ARN of the signing role. + // + // RoleArn is a required field + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` + + // The service name to use while signing with Sig V4. + // + // ServiceName is a required field + ServiceName *string `locationName:"serviceName" type:"string" required:"true"` + + // The signing region. + // + // SigningRegion is a required field + SigningRegion *string `locationName:"signingRegion" type:"string" required:"true"` +} + +// String returns the string representation +func (s SigV4Authorization) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SigV4Authorization) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SigV4Authorization) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SigV4Authorization"} + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.ServiceName == nil { + invalidParams.Add(request.NewErrParamRequired("ServiceName")) + } + if s.SigningRegion == nil { + invalidParams.Add(request.NewErrParamRequired("SigningRegion")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRoleArn sets the RoleArn field's value. +func (s *SigV4Authorization) SetRoleArn(v string) *SigV4Authorization { + s.RoleArn = &v + return s +} + +// SetServiceName sets the ServiceName field's value. +func (s *SigV4Authorization) SetServiceName(v string) *SigV4Authorization { + s.ServiceName = &v + return s +} + +// SetSigningRegion sets the SigningRegion field's value. +func (s *SigV4Authorization) SetSigningRegion(v string) *SigV4Authorization { + s.SigningRegion = &v + return s +} + // Describes the code-signing profile. type SigningProfileParameter struct { _ struct{} `type:"structure"` @@ -35633,6 +42033,63 @@ func (s *SnsAction) SetTargetArn(v string) *SnsAction { return s } +// The Rule-SQL expression can't be parsed correctly. +type SqlParseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s SqlParseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SqlParseException) GoString() string { + return s.String() +} + +func newErrorSqlParseException(v protocol.ResponseMetadata) error { + return &SqlParseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SqlParseException) Code() string { + return "SqlParseException" +} + +// Message returns the exception's message. +func (s SqlParseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SqlParseException) OrigErr() error { + return nil +} + +func (s SqlParseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SqlParseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SqlParseException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes an action to publish data to an Amazon SQS queue. type SqsAction struct { _ struct{} `type:"structure"` @@ -36084,8 +42541,29 @@ func (s *StatisticalThreshold) SetStatistic(v string) *StatisticalThreshold { type Statistics struct { _ struct{} `type:"structure"` + // The average of the aggregated field values. + Average *float64 `locationName:"average" type:"double"` + // The count of things that match the query. Count *int64 `locationName:"count" type:"integer"` + + // The maximum aggregated field value. + Maximum *float64 `locationName:"maximum" type:"double"` + + // The minimum aggregated field value. + Minimum *float64 `locationName:"minimum" type:"double"` + + // The standard deviation of the aggregated field values. + StdDeviation *float64 `locationName:"stdDeviation" type:"double"` + + // The sum of the aggregated field values. + Sum *float64 `locationName:"sum" type:"double"` + + // The sum of the squares of the aggregated field values. + SumOfSquares *float64 `locationName:"sumOfSquares" type:"double"` + + // The variance of the aggregated field values. + Variance *float64 `locationName:"variance" type:"double"` } // String returns the string representation @@ -36098,12 +42576,54 @@ func (s Statistics) GoString() string { return s.String() } +// SetAverage sets the Average field's value. +func (s *Statistics) SetAverage(v float64) *Statistics { + s.Average = &v + return s +} + // SetCount sets the Count field's value. func (s *Statistics) SetCount(v int64) *Statistics { s.Count = &v return s } +// SetMaximum sets the Maximum field's value. +func (s *Statistics) SetMaximum(v float64) *Statistics { + s.Maximum = &v + return s +} + +// SetMinimum sets the Minimum field's value. +func (s *Statistics) SetMinimum(v float64) *Statistics { + s.Minimum = &v + return s +} + +// SetStdDeviation sets the StdDeviation field's value. +func (s *Statistics) SetStdDeviation(v float64) *Statistics { + s.StdDeviation = &v + return s +} + +// SetSum sets the Sum field's value. +func (s *Statistics) SetSum(v float64) *Statistics { + s.Sum = &v + return s +} + +// SetSumOfSquares sets the SumOfSquares field's value. +func (s *Statistics) SetSumOfSquares(v float64) *Statistics { + s.SumOfSquares = &v + return s +} + +// SetVariance sets the Variance field's value. +func (s *Statistics) SetVariance(v float64) *Statistics { + s.Variance = &v + return s +} + // Starts execution of a Step Functions state machine. type StepFunctionsAction struct { _ struct{} `type:"structure"` @@ -36555,6 +43075,63 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// This exception occurs if you attempt to start a task with the same task-id +// as an existing task but with a different clientRequestToken. +type TaskAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TaskAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TaskAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorTaskAlreadyExistsException(v protocol.ResponseMetadata) error { + return &TaskAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TaskAlreadyExistsException) Code() string { + return "TaskAlreadyExistsException" +} + +// Message returns the exception's message. +func (s TaskAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TaskAlreadyExistsException) OrigErr() error { + return nil +} + +func (s TaskAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TaskAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TaskAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + // Statistics for the checks performed during the audit. type TaskStatistics struct { _ struct{} `type:"structure"` @@ -36817,16 +43394,21 @@ type TestInvokeAuthorizerInput struct { // AuthorizerName is a required field AuthorizerName *string `location:"uri" locationName:"authorizerName" min:"1" type:"string" required:"true"` + // Specifies a test HTTP authorization request. + HttpContext *HttpContext `locationName:"httpContext" type:"structure"` + + // Specifies a test MQTT authorization request. + MqttContext *MqttContext `locationName:"mqttContext" type:"structure"` + + // Specifies a test TLS authorization request. + TlsContext *TlsContext `locationName:"tlsContext" type:"structure"` + // The token returned by your custom authentication service. - // - // Token is a required field - Token *string `locationName:"token" min:"1" type:"string" required:"true"` + Token *string `locationName:"token" min:"1" type:"string"` // The signature made with the token and your custom authentication service's // private key. - // - // TokenSignature is a required field - TokenSignature *string `locationName:"tokenSignature" min:"1" type:"string" required:"true"` + TokenSignature *string `locationName:"tokenSignature" min:"1" type:"string"` } // String returns the string representation @@ -36848,18 +43430,27 @@ func (s *TestInvokeAuthorizerInput) Validate() error { if s.AuthorizerName != nil && len(*s.AuthorizerName) < 1 { invalidParams.Add(request.NewErrParamMinLen("AuthorizerName", 1)) } - if s.Token == nil { - invalidParams.Add(request.NewErrParamRequired("Token")) - } if s.Token != nil && len(*s.Token) < 1 { invalidParams.Add(request.NewErrParamMinLen("Token", 1)) } - if s.TokenSignature == nil { - invalidParams.Add(request.NewErrParamRequired("TokenSignature")) - } if s.TokenSignature != nil && len(*s.TokenSignature) < 1 { invalidParams.Add(request.NewErrParamMinLen("TokenSignature", 1)) } + if s.HttpContext != nil { + if err := s.HttpContext.Validate(); err != nil { + invalidParams.AddNested("HttpContext", err.(request.ErrInvalidParams)) + } + } + if s.MqttContext != nil { + if err := s.MqttContext.Validate(); err != nil { + invalidParams.AddNested("MqttContext", err.(request.ErrInvalidParams)) + } + } + if s.TlsContext != nil { + if err := s.TlsContext.Validate(); err != nil { + invalidParams.AddNested("TlsContext", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -36873,6 +43464,24 @@ func (s *TestInvokeAuthorizerInput) SetAuthorizerName(v string) *TestInvokeAutho return s } +// SetHttpContext sets the HttpContext field's value. +func (s *TestInvokeAuthorizerInput) SetHttpContext(v *HttpContext) *TestInvokeAuthorizerInput { + s.HttpContext = v + return s +} + +// SetMqttContext sets the MqttContext field's value. +func (s *TestInvokeAuthorizerInput) SetMqttContext(v *MqttContext) *TestInvokeAuthorizerInput { + s.MqttContext = v + return s +} + +// SetTlsContext sets the TlsContext field's value. +func (s *TestInvokeAuthorizerInput) SetTlsContext(v *TlsContext) *TestInvokeAuthorizerInput { + s.TlsContext = v + return s +} + // SetToken sets the Token field's value. func (s *TestInvokeAuthorizerInput) SetToken(v string) *TestInvokeAuthorizerInput { s.Token = &v @@ -37183,6 +43792,16 @@ func (s *ThingGroupDocument) SetThingGroupName(v string) *ThingGroupDocument { type ThingGroupIndexingConfiguration struct { _ struct{} `type:"structure"` + // A list of thing group fields to index. This list cannot contain any managed + // fields. Use the GetIndexingConfiguration API to get a list of managed fields. + // + // Contains custom field names and their data type. + CustomFields []*Field `locationName:"customFields" type:"list"` + + // Contains fields that are indexed and whose types are already known by the + // Fleet Indexing service. + ManagedFields []*Field `locationName:"managedFields" type:"list"` + // Thing group indexing mode. // // ThingGroupIndexingMode is a required field @@ -37212,6 +43831,18 @@ func (s *ThingGroupIndexingConfiguration) Validate() error { return nil } +// SetCustomFields sets the CustomFields field's value. +func (s *ThingGroupIndexingConfiguration) SetCustomFields(v []*Field) *ThingGroupIndexingConfiguration { + s.CustomFields = v + return s +} + +// SetManagedFields sets the ManagedFields field's value. +func (s *ThingGroupIndexingConfiguration) SetManagedFields(v []*Field) *ThingGroupIndexingConfiguration { + s.ManagedFields = v + return s +} + // SetThingGroupIndexingMode sets the ThingGroupIndexingMode field's value. func (s *ThingGroupIndexingConfiguration) SetThingGroupIndexingMode(v string) *ThingGroupIndexingConfiguration { s.ThingGroupIndexingMode = &v @@ -37298,6 +43929,13 @@ func (s *ThingGroupProperties) SetThingGroupDescription(v string) *ThingGroupPro type ThingIndexingConfiguration struct { _ struct{} `type:"structure"` + // Contains custom field names and their data type. + CustomFields []*Field `locationName:"customFields" type:"list"` + + // Contains fields that are indexed and whose types are already known by the + // Fleet Indexing service. + ManagedFields []*Field `locationName:"managedFields" type:"list"` + // Thing connectivity indexing mode. Valid values are: // // * STATUS – Your thing index contains connectivity status. To enable @@ -37342,6 +43980,18 @@ func (s *ThingIndexingConfiguration) Validate() error { return nil } +// SetCustomFields sets the CustomFields field's value. +func (s *ThingIndexingConfiguration) SetCustomFields(v []*Field) *ThingIndexingConfiguration { + s.CustomFields = v + return s +} + +// SetManagedFields sets the ManagedFields field's value. +func (s *ThingIndexingConfiguration) SetManagedFields(v []*Field) *ThingIndexingConfiguration { + s.ManagedFields = v + return s +} + // SetThingConnectivityIndexingMode sets the ThingConnectivityIndexingMode field's value. func (s *ThingIndexingConfiguration) SetThingConnectivityIndexingMode(v string) *ThingIndexingConfiguration { s.ThingConnectivityIndexingMode = &v @@ -37486,6 +44136,63 @@ func (s *ThingTypeProperties) SetThingTypeDescription(v string) *ThingTypeProper return s } +// The rate exceeds the limit. +type ThrottlingException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ThrottlingException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ThrottlingException) GoString() string { + return s.String() +} + +func newErrorThrottlingException(v protocol.ResponseMetadata) error { + return &ThrottlingException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ThrottlingException) Code() string { + return "ThrottlingException" +} + +// Message returns the exception's message. +func (s ThrottlingException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ThrottlingException) OrigErr() error { + return nil +} + +func (s ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ThrottlingException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ThrottlingException) RequestID() string { + return s.respMetadata.RequestID +} + // Specifies the amount of time each device has to finish its execution of the // job. A timer is started when the job execution status is set to IN_PROGRESS. // If the job execution status is not set to another terminal state before the @@ -37518,6 +44225,43 @@ func (s *TimeoutConfig) SetInProgressTimeoutInMinutes(v int64) *TimeoutConfig { return s } +// Specifies the TLS context to use for the test authorizer request. +type TlsContext struct { + _ struct{} `type:"structure"` + + // The value of the serverName key in a TLS authorization request. + ServerName *string `locationName:"serverName" min:"1" type:"string"` +} + +// String returns the string representation +func (s TlsContext) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TlsContext) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TlsContext) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TlsContext"} + if s.ServerName != nil && len(*s.ServerName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ServerName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetServerName sets the ServerName field's value. +func (s *TlsContext) SetServerName(v string) *TlsContext { + s.ServerName = &v + return s +} + // Describes a rule. type TopicRule struct { _ struct{} `type:"structure"` @@ -37606,6 +44350,198 @@ func (s *TopicRule) SetSql(v string) *TopicRule { return s } +// A topic rule destination. +type TopicRuleDestination struct { + _ struct{} `type:"structure"` + + // The topic rule destination URL. + Arn *string `locationName:"arn" type:"string"` + + // Properties of the HTTP URL. + HttpUrlProperties *HttpUrlDestinationProperties `locationName:"httpUrlProperties" type:"structure"` + + // The status of the topic rule destination. Valid values are: + // + // IN_PROGRESS + // + // A topic rule destination was created but has not been confirmed. You can + // set status to IN_PROGRESS by calling UpdateTopicRuleDestination. Calling + // UpdateTopicRuleDestination causes a new confirmation challenge to be sent + // to your confirmation endpoint. + // + // ENABLED + // + // Confirmation was completed, and traffic to this destination is allowed. You + // can set status to DISABLED by calling UpdateTopicRuleDestination. + // + // DISABLED + // + // Confirmation was completed, and traffic to this destination is not allowed. + // You can set status to ENABLED by calling UpdateTopicRuleDestination. + // + // ERROR + // + // Confirmation could not be completed, for example if the confirmation timed + // out. You can call GetTopicRuleDestination for details about the error. You + // can set status to IN_PROGRESS by calling UpdateTopicRuleDestination. Calling + // UpdateTopicRuleDestination causes a new confirmation challenge to be sent + // to your confirmation endpoint. + Status *string `locationName:"status" type:"string" enum:"TopicRuleDestinationStatus"` + + // Additional details or reason why the topic rule destination is in the current + // status. + StatusReason *string `locationName:"statusReason" type:"string"` +} + +// String returns the string representation +func (s TopicRuleDestination) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TopicRuleDestination) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *TopicRuleDestination) SetArn(v string) *TopicRuleDestination { + s.Arn = &v + return s +} + +// SetHttpUrlProperties sets the HttpUrlProperties field's value. +func (s *TopicRuleDestination) SetHttpUrlProperties(v *HttpUrlDestinationProperties) *TopicRuleDestination { + s.HttpUrlProperties = v + return s +} + +// SetStatus sets the Status field's value. +func (s *TopicRuleDestination) SetStatus(v string) *TopicRuleDestination { + s.Status = &v + return s +} + +// SetStatusReason sets the StatusReason field's value. +func (s *TopicRuleDestination) SetStatusReason(v string) *TopicRuleDestination { + s.StatusReason = &v + return s +} + +// Configuration of the topic rule destination. +type TopicRuleDestinationConfiguration struct { + _ struct{} `type:"structure"` + + // Configuration of the HTTP URL. + HttpUrlConfiguration *HttpUrlDestinationConfiguration `locationName:"httpUrlConfiguration" type:"structure"` +} + +// String returns the string representation +func (s TopicRuleDestinationConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TopicRuleDestinationConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TopicRuleDestinationConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TopicRuleDestinationConfiguration"} + if s.HttpUrlConfiguration != nil { + if err := s.HttpUrlConfiguration.Validate(); err != nil { + invalidParams.AddNested("HttpUrlConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHttpUrlConfiguration sets the HttpUrlConfiguration field's value. +func (s *TopicRuleDestinationConfiguration) SetHttpUrlConfiguration(v *HttpUrlDestinationConfiguration) *TopicRuleDestinationConfiguration { + s.HttpUrlConfiguration = v + return s +} + +// Information about the topic rule destination. +type TopicRuleDestinationSummary struct { + _ struct{} `type:"structure"` + + // The topic rule destination ARN. + Arn *string `locationName:"arn" type:"string"` + + // Information about the HTTP URL. + HttpUrlSummary *HttpUrlDestinationSummary `locationName:"httpUrlSummary" type:"structure"` + + // The status of the topic rule destination. Valid values are: + // + // IN_PROGRESS + // + // A topic rule destination was created but has not been confirmed. You can + // set status to IN_PROGRESS by calling UpdateTopicRuleDestination. Calling + // UpdateTopicRuleDestination causes a new confirmation challenge to be sent + // to your confirmation endpoint. + // + // ENABLED + // + // Confirmation was completed, and traffic to this destination is allowed. You + // can set status to DISABLED by calling UpdateTopicRuleDestination. + // + // DISABLED + // + // Confirmation was completed, and traffic to this destination is not allowed. + // You can set status to ENABLED by calling UpdateTopicRuleDestination. + // + // ERROR + // + // Confirmation could not be completed, for example if the confirmation timed + // out. You can call GetTopicRuleDestination for details about the error. You + // can set status to IN_PROGRESS by calling UpdateTopicRuleDestination. Calling + // UpdateTopicRuleDestination causes a new confirmation challenge to be sent + // to your confirmation endpoint. + Status *string `locationName:"status" type:"string" enum:"TopicRuleDestinationStatus"` + + // The reason the topic rule destination is in the current status. + StatusReason *string `locationName:"statusReason" type:"string"` +} + +// String returns the string representation +func (s TopicRuleDestinationSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TopicRuleDestinationSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *TopicRuleDestinationSummary) SetArn(v string) *TopicRuleDestinationSummary { + s.Arn = &v + return s +} + +// SetHttpUrlSummary sets the HttpUrlSummary field's value. +func (s *TopicRuleDestinationSummary) SetHttpUrlSummary(v *HttpUrlDestinationSummary) *TopicRuleDestinationSummary { + s.HttpUrlSummary = v + return s +} + +// SetStatus sets the Status field's value. +func (s *TopicRuleDestinationSummary) SetStatus(v string) *TopicRuleDestinationSummary { + s.Status = &v + return s +} + +// SetStatusReason sets the StatusReason field's value. +func (s *TopicRuleDestinationSummary) SetStatusReason(v string) *TopicRuleDestinationSummary { + s.StatusReason = &v + return s +} + // Describes a rule. type TopicRuleListItem struct { _ struct{} `type:"structure"` @@ -37772,6 +44708,64 @@ func (s *TopicRulePayload) SetSql(v string) *TopicRulePayload { return s } +// You can't revert the certificate transfer because the transfer is already +// complete. +type TransferAlreadyCompletedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TransferAlreadyCompletedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransferAlreadyCompletedException) GoString() string { + return s.String() +} + +func newErrorTransferAlreadyCompletedException(v protocol.ResponseMetadata) error { + return &TransferAlreadyCompletedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TransferAlreadyCompletedException) Code() string { + return "TransferAlreadyCompletedException" +} + +// Message returns the exception's message. +func (s TransferAlreadyCompletedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TransferAlreadyCompletedException) OrigErr() error { + return nil +} + +func (s TransferAlreadyCompletedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TransferAlreadyCompletedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TransferAlreadyCompletedException) RequestID() string { + return s.respMetadata.RequestID +} + // The input for the TransferCertificate operation. type TransferCertificateInput struct { _ struct{} `type:"structure"` @@ -37865,6 +44859,64 @@ func (s *TransferCertificateOutput) SetTransferredCertificateArn(v string) *Tran return s } +// You can't transfer the certificate because authorization policies are still +// attached. +type TransferConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TransferConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TransferConflictException) GoString() string { + return s.String() +} + +func newErrorTransferConflictException(v protocol.ResponseMetadata) error { + return &TransferConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TransferConflictException) Code() string { + return "TransferConflictException" +} + +// Message returns the exception's message. +func (s TransferConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TransferConflictException) OrigErr() error { + return nil +} + +func (s TransferConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TransferConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TransferConflictException) RequestID() string { + return s.respMetadata.RequestID +} + // Data used to transfer a certificate to an AWS account. type TransferData struct { _ struct{} `type:"structure"` @@ -37925,6 +44977,63 @@ func (s *TransferData) SetTransferMessage(v string) *TransferData { return s } +// You are not authorized to perform this operation. +type UnauthorizedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnauthorizedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnauthorizedException) GoString() string { + return s.String() +} + +func newErrorUnauthorizedException(v protocol.ResponseMetadata) error { + return &UnauthorizedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnauthorizedException) Code() string { + return "UnauthorizedException" +} + +// Message returns the exception's message. +func (s UnauthorizedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnauthorizedException) OrigErr() error { + return nil +} + +func (s UnauthorizedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnauthorizedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnauthorizedException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -38546,6 +45655,111 @@ func (s *UpdateDeviceCertificateParams) SetAction(v string) *UpdateDeviceCertifi return s } +type UpdateDomainConfigurationInput struct { + _ struct{} `type:"structure"` + + // An object that specifies the authorization service for a domain. + AuthorizerConfig *AuthorizerConfig `locationName:"authorizerConfig" type:"structure"` + + // The name of the domain configuration to be updated. + // + // DomainConfigurationName is a required field + DomainConfigurationName *string `location:"uri" locationName:"domainConfigurationName" min:"1" type:"string" required:"true"` + + // The status to which the domain configuration should be updated. + DomainConfigurationStatus *string `locationName:"domainConfigurationStatus" type:"string" enum:"DomainConfigurationStatus"` + + // Removes the authorization configuration from a domain. + RemoveAuthorizerConfig *bool `locationName:"removeAuthorizerConfig" type:"boolean"` +} + +// String returns the string representation +func (s UpdateDomainConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateDomainConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateDomainConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateDomainConfigurationInput"} + if s.DomainConfigurationName == nil { + invalidParams.Add(request.NewErrParamRequired("DomainConfigurationName")) + } + if s.DomainConfigurationName != nil && len(*s.DomainConfigurationName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DomainConfigurationName", 1)) + } + if s.AuthorizerConfig != nil { + if err := s.AuthorizerConfig.Validate(); err != nil { + invalidParams.AddNested("AuthorizerConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuthorizerConfig sets the AuthorizerConfig field's value. +func (s *UpdateDomainConfigurationInput) SetAuthorizerConfig(v *AuthorizerConfig) *UpdateDomainConfigurationInput { + s.AuthorizerConfig = v + return s +} + +// SetDomainConfigurationName sets the DomainConfigurationName field's value. +func (s *UpdateDomainConfigurationInput) SetDomainConfigurationName(v string) *UpdateDomainConfigurationInput { + s.DomainConfigurationName = &v + return s +} + +// SetDomainConfigurationStatus sets the DomainConfigurationStatus field's value. +func (s *UpdateDomainConfigurationInput) SetDomainConfigurationStatus(v string) *UpdateDomainConfigurationInput { + s.DomainConfigurationStatus = &v + return s +} + +// SetRemoveAuthorizerConfig sets the RemoveAuthorizerConfig field's value. +func (s *UpdateDomainConfigurationInput) SetRemoveAuthorizerConfig(v bool) *UpdateDomainConfigurationInput { + s.RemoveAuthorizerConfig = &v + return s +} + +type UpdateDomainConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the domain configuration that was updated. + DomainConfigurationArn *string `locationName:"domainConfigurationArn" type:"string"` + + // The name of the domain configuration that was updated. + DomainConfigurationName *string `locationName:"domainConfigurationName" min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateDomainConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateDomainConfigurationOutput) GoString() string { + return s.String() +} + +// SetDomainConfigurationArn sets the DomainConfigurationArn field's value. +func (s *UpdateDomainConfigurationOutput) SetDomainConfigurationArn(v string) *UpdateDomainConfigurationOutput { + s.DomainConfigurationArn = &v + return s +} + +// SetDomainConfigurationName sets the DomainConfigurationName field's value. +func (s *UpdateDomainConfigurationOutput) SetDomainConfigurationName(v string) *UpdateDomainConfigurationOutput { + s.DomainConfigurationName = &v + return s +} + type UpdateDynamicThingGroupInput struct { _ struct{} `type:"structure"` @@ -38993,6 +46207,101 @@ func (s *UpdateMitigationActionOutput) SetActionId(v string) *UpdateMitigationAc return s } +type UpdateProvisioningTemplateInput struct { + _ struct{} `type:"structure"` + + // The ID of the default provisioning template version. + DefaultVersionId *int64 `locationName:"defaultVersionId" type:"integer"` + + // The description of the fleet provisioning template. + Description *string `locationName:"description" type:"string"` + + // True to enable the fleet provisioning template, otherwise false. + Enabled *bool `locationName:"enabled" type:"boolean"` + + // The ARN of the role associated with the provisioning template. This IoT role + // grants permission to provision a device. + ProvisioningRoleArn *string `locationName:"provisioningRoleArn" min:"20" type:"string"` + + // The name of the fleet provisioning template. + // + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"templateName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateProvisioningTemplateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateProvisioningTemplateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateProvisioningTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateProvisioningTemplateInput"} + if s.ProvisioningRoleArn != nil && len(*s.ProvisioningRoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ProvisioningRoleArn", 20)) + } + 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 +} + +// SetDefaultVersionId sets the DefaultVersionId field's value. +func (s *UpdateProvisioningTemplateInput) SetDefaultVersionId(v int64) *UpdateProvisioningTemplateInput { + s.DefaultVersionId = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *UpdateProvisioningTemplateInput) SetDescription(v string) *UpdateProvisioningTemplateInput { + s.Description = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *UpdateProvisioningTemplateInput) SetEnabled(v bool) *UpdateProvisioningTemplateInput { + s.Enabled = &v + return s +} + +// SetProvisioningRoleArn sets the ProvisioningRoleArn field's value. +func (s *UpdateProvisioningTemplateInput) SetProvisioningRoleArn(v string) *UpdateProvisioningTemplateInput { + s.ProvisioningRoleArn = &v + return s +} + +// SetTemplateName sets the TemplateName field's value. +func (s *UpdateProvisioningTemplateInput) SetTemplateName(v string) *UpdateProvisioningTemplateInput { + s.TemplateName = &v + return s +} + +type UpdateProvisioningTemplateOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateProvisioningTemplateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateProvisioningTemplateOutput) GoString() string { + return s.String() +} + type UpdateRoleAliasInput struct { _ struct{} `type:"structure"` @@ -39065,7 +46374,7 @@ type UpdateRoleAliasOutput struct { RoleAlias *string `locationName:"roleAlias" min:"1" type:"string"` // The role alias ARN. - RoleAliasArn *string `locationName:"roleAliasArn" type:"string"` + RoleAliasArn *string `locationName:"roleAliasArn" min:"1" type:"string"` } // String returns the string representation @@ -39846,6 +47155,97 @@ func (s UpdateThingOutput) GoString() string { return s.String() } +type UpdateTopicRuleDestinationInput struct { + _ struct{} `type:"structure"` + + // The ARN of the topic rule destination. + // + // Arn is a required field + Arn *string `locationName:"arn" type:"string" required:"true"` + + // The status of the topic rule destination. Valid values are: + // + // IN_PROGRESS + // + // A topic rule destination was created but has not been confirmed. You can + // set status to IN_PROGRESS by calling UpdateTopicRuleDestination. Calling + // UpdateTopicRuleDestination causes a new confirmation challenge to be sent + // to your confirmation endpoint. + // + // ENABLED + // + // Confirmation was completed, and traffic to this destination is allowed. You + // can set status to DISABLED by calling UpdateTopicRuleDestination. + // + // DISABLED + // + // Confirmation was completed, and traffic to this destination is not allowed. + // You can set status to ENABLED by calling UpdateTopicRuleDestination. + // + // ERROR + // + // Confirmation could not be completed, for example if the confirmation timed + // out. You can call GetTopicRuleDestination for details about the error. You + // can set status to IN_PROGRESS by calling UpdateTopicRuleDestination. Calling + // UpdateTopicRuleDestination causes a new confirmation challenge to be sent + // to your confirmation endpoint. + // + // Status is a required field + Status *string `locationName:"status" type:"string" required:"true" enum:"TopicRuleDestinationStatus"` +} + +// String returns the string representation +func (s UpdateTopicRuleDestinationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTopicRuleDestinationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateTopicRuleDestinationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateTopicRuleDestinationInput"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.Status == nil { + invalidParams.Add(request.NewErrParamRequired("Status")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *UpdateTopicRuleDestinationInput) SetArn(v string) *UpdateTopicRuleDestinationInput { + s.Arn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *UpdateTopicRuleDestinationInput) SetStatus(v string) *UpdateTopicRuleDestinationInput { + s.Status = &v + return s +} + +type UpdateTopicRuleDestinationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateTopicRuleDestinationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTopicRuleDestinationOutput) GoString() string { + return s.String() +} + type ValidateSecurityProfileBehaviorsInput struct { _ struct{} `type:"structure"` @@ -39951,6 +47351,121 @@ func (s *ValidationError) SetErrorMessage(v string) *ValidationError { return s } +// An exception thrown when the version of an entity specified with the expectedVersion +// parameter does not match the latest version in the system. +type VersionConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s VersionConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VersionConflictException) GoString() string { + return s.String() +} + +func newErrorVersionConflictException(v protocol.ResponseMetadata) error { + return &VersionConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s VersionConflictException) Code() string { + return "VersionConflictException" +} + +// Message returns the exception's message. +func (s VersionConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s VersionConflictException) OrigErr() error { + return nil +} + +func (s VersionConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s VersionConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s VersionConflictException) RequestID() string { + return s.respMetadata.RequestID +} + +// The number of policy versions exceeds the limit. +type VersionsLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s VersionsLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VersionsLimitExceededException) GoString() string { + return s.String() +} + +func newErrorVersionsLimitExceededException(v protocol.ResponseMetadata) error { + return &VersionsLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s VersionsLimitExceededException) Code() string { + return "VersionsLimitExceededException" +} + +// Message returns the exception's message. +func (s VersionsLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s VersionsLimitExceededException) OrigErr() error { + return nil +} + +func (s VersionsLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s VersionsLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s VersionsLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Information about a Device Defender security profile behavior violation. type ViolationEvent struct { _ struct{} `type:"structure"` @@ -40303,6 +47818,25 @@ const ( DeviceCertificateUpdateActionDeactivate = "DEACTIVATE" ) +const ( + // DomainConfigurationStatusEnabled is a DomainConfigurationStatus enum value + DomainConfigurationStatusEnabled = "ENABLED" + + // DomainConfigurationStatusDisabled is a DomainConfigurationStatus enum value + DomainConfigurationStatusDisabled = "DISABLED" +) + +const ( + // DomainTypeEndpoint is a DomainType enum value + DomainTypeEndpoint = "ENDPOINT" + + // DomainTypeAwsManaged is a DomainType enum value + DomainTypeAwsManaged = "AWS_MANAGED" + + // DomainTypeCustomerManaged is a DomainType enum value + DomainTypeCustomerManaged = "CUSTOMER_MANAGED" +) + const ( // DynamicGroupStatusActive is a DynamicGroupStatus enum value DynamicGroupStatusActive = "ACTIVE" @@ -40357,6 +47891,17 @@ const ( EventTypeCaCertificate = "CA_CERTIFICATE" ) +const ( + // FieldTypeNumber is a FieldType enum value + FieldTypeNumber = "Number" + + // FieldTypeString is a FieldType enum value + FieldTypeString = "String" + + // FieldTypeBoolean is a FieldType enum value + FieldTypeBoolean = "Boolean" +) + const ( // IndexStatusActive is a IndexStatus enum value IndexStatusActive = "ACTIVE" @@ -40494,6 +48039,14 @@ const ( PolicyTemplateNameBlankPolicy = "BLANK_POLICY" ) +const ( + // ProtocolMqtt is a Protocol enum value + ProtocolMqtt = "MQTT" + + // ProtocolHttp is a Protocol enum value + ProtocolHttp = "HTTP" +) + const ( // ReportTypeErrors is a ReportType enum value ReportTypeErrors = "ERRORS" @@ -40520,6 +48073,31 @@ const ( // ResourceTypeAccountSettings is a ResourceType enum value ResourceTypeAccountSettings = "ACCOUNT_SETTINGS" + + // ResourceTypeRoleAlias is a ResourceType enum value + ResourceTypeRoleAlias = "ROLE_ALIAS" + + // ResourceTypeIamRole is a ResourceType enum value + ResourceTypeIamRole = "IAM_ROLE" +) + +const ( + // ServerCertificateStatusInvalid is a ServerCertificateStatus enum value + ServerCertificateStatusInvalid = "INVALID" + + // ServerCertificateStatusValid is a ServerCertificateStatus enum value + ServerCertificateStatusValid = "VALID" +) + +const ( + // ServiceTypeData is a ServiceType enum value + ServiceTypeData = "DATA" + + // ServiceTypeCredentialProvider is a ServiceType enum value + ServiceTypeCredentialProvider = "CREDENTIAL_PROVIDER" + + // ServiceTypeJobs is a ServiceType enum value + ServiceTypeJobs = "JOBS" ) const ( @@ -40574,6 +48152,20 @@ const ( ThingIndexingModeRegistryAndShadow = "REGISTRY_AND_SHADOW" ) +const ( + // TopicRuleDestinationStatusEnabled is a TopicRuleDestinationStatus enum value + TopicRuleDestinationStatusEnabled = "ENABLED" + + // TopicRuleDestinationStatusInProgress is a TopicRuleDestinationStatus enum value + TopicRuleDestinationStatusInProgress = "IN_PROGRESS" + + // TopicRuleDestinationStatusDisabled is a TopicRuleDestinationStatus enum value + TopicRuleDestinationStatusDisabled = "DISABLED" + + // TopicRuleDestinationStatusError is a TopicRuleDestinationStatus enum value + TopicRuleDestinationStatusError = "ERROR" +) + const ( // ViolationEventTypeInAlarm is a ViolationEventType enum value ViolationEventTypeInAlarm = "in-alarm" diff --git a/vendor/github.com/aws/aws-sdk-go/service/iot/errors.go b/vendor/github.com/aws/aws-sdk-go/service/iot/errors.go index b4e8556c217..33b542d0c82 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iot/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iot/errors.go @@ -2,6 +2,10 @@ package iot +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeCertificateConflictException for service response error code @@ -187,3 +191,35 @@ const ( // The number of policy versions exceeds the limit. ErrCodeVersionsLimitExceededException = "VersionsLimitExceededException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "CertificateConflictException": newErrorCertificateConflictException, + "CertificateStateException": newErrorCertificateStateException, + "CertificateValidationException": newErrorCertificateValidationException, + "ConflictingResourceUpdateException": newErrorConflictingResourceUpdateException, + "DeleteConflictException": newErrorDeleteConflictException, + "IndexNotReadyException": newErrorIndexNotReadyException, + "InternalException": newErrorInternalException, + "InternalFailureException": newErrorInternalFailureException, + "InvalidAggregationException": newErrorInvalidAggregationException, + "InvalidQueryException": newErrorInvalidQueryException, + "InvalidRequestException": newErrorInvalidRequestException, + "InvalidResponseException": newErrorInvalidResponseException, + "InvalidStateTransitionException": newErrorInvalidStateTransitionException, + "LimitExceededException": newErrorLimitExceededException, + "MalformedPolicyException": newErrorMalformedPolicyException, + "NotConfiguredException": newErrorNotConfiguredException, + "RegistrationCodeValidationException": newErrorRegistrationCodeValidationException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ResourceRegistrationFailureException": newErrorResourceRegistrationFailureException, + "ServiceUnavailableException": newErrorServiceUnavailableException, + "SqlParseException": newErrorSqlParseException, + "TaskAlreadyExistsException": newErrorTaskAlreadyExistsException, + "ThrottlingException": newErrorThrottlingException, + "TransferAlreadyCompletedException": newErrorTransferAlreadyCompletedException, + "TransferConflictException": newErrorTransferConflictException, + "UnauthorizedException": newErrorUnauthorizedException, + "VersionConflictException": newErrorVersionConflictException, + "VersionsLimitExceededException": newErrorVersionsLimitExceededException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/iot/service.go b/vendor/github.com/aws/aws-sdk-go/service/iot/service.go index 10a95d5607c..1b26fbf3798 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iot/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iot/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "iot" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "IoT" // ServiceID is a unique identifer of a specific service. + ServiceID = "IoT" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the IoT client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a IoT client from just a session. // svc := iot.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *IoT { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "execute-api" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *IoT { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *IoT { svc := &IoT{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-05-28", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/iotanalytics/api.go b/vendor/github.com/aws/aws-sdk-go/service/iotanalytics/api.go index 6b1d7f271b1..b101fafeb1a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iotanalytics/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iotanalytics/api.go @@ -66,20 +66,20 @@ func (c *IoTAnalytics) BatchPutMessageRequest(input *BatchPutMessageInput) (req // See the AWS API reference guide for AWS IoT Analytics's // API operation BatchPutMessage for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/BatchPutMessage @@ -158,20 +158,20 @@ func (c *IoTAnalytics) CancelPipelineReprocessingRequest(input *CancelPipelineRe // See the AWS API reference guide for AWS IoT Analytics's // API operation CancelPipelineReprocessing for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/CancelPipelineReprocessing @@ -250,23 +250,23 @@ func (c *IoTAnalytics) CreateChannelRequest(input *CreateChannelInput) (req *req // See the AWS API reference guide for AWS IoT Analytics's // API operation CreateChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // A resource with the same name already exists. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The command caused an internal limit to be exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/CreateChannel @@ -348,23 +348,23 @@ func (c *IoTAnalytics) CreateDatasetRequest(input *CreateDatasetInput) (req *req // See the AWS API reference guide for AWS IoT Analytics's // API operation CreateDataset for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // A resource with the same name already exists. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The command caused an internal limit to be exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/CreateDataset @@ -443,20 +443,20 @@ func (c *IoTAnalytics) CreateDatasetContentRequest(input *CreateDatasetContentIn // See the AWS API reference guide for AWS IoT Analytics's // API operation CreateDatasetContent for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/CreateDatasetContent @@ -534,23 +534,23 @@ func (c *IoTAnalytics) CreateDatastoreRequest(input *CreateDatastoreInput) (req // See the AWS API reference guide for AWS IoT Analytics's // API operation CreateDatastore for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // A resource with the same name already exists. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The command caused an internal limit to be exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/CreateDatastore @@ -619,10 +619,10 @@ func (c *IoTAnalytics) CreatePipelineRequest(input *CreatePipelineInput) (req *r // CreatePipeline API operation for AWS IoT Analytics. // -// Creates a pipeline. A pipeline consumes messages from one or more channels -// and allows you to process the messages before storing them in a data store. -// You must specify both a channel and a datastore activity and, optionally, -// as many as 23 additional activities in the pipelineActivities array. +// Creates a pipeline. A pipeline consumes messages from a channel and allows +// you to process the messages before storing them in a data store. You must +// specify both a channel and a datastore activity and, optionally, as many +// as 23 additional activities in the pipelineActivities array. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -631,23 +631,23 @@ func (c *IoTAnalytics) CreatePipelineRequest(input *CreatePipelineInput) (req *r // See the AWS API reference guide for AWS IoT Analytics's // API operation CreatePipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // A resource with the same name already exists. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The command caused an internal limit to be exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/CreatePipeline @@ -726,20 +726,20 @@ func (c *IoTAnalytics) DeleteChannelRequest(input *DeleteChannelInput) (req *req // See the AWS API reference guide for AWS IoT Analytics's // API operation DeleteChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/DeleteChannel @@ -821,20 +821,20 @@ func (c *IoTAnalytics) DeleteDatasetRequest(input *DeleteDatasetInput) (req *req // See the AWS API reference guide for AWS IoT Analytics's // API operation DeleteDataset for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/DeleteDataset @@ -913,20 +913,20 @@ func (c *IoTAnalytics) DeleteDatasetContentRequest(input *DeleteDatasetContentIn // See the AWS API reference guide for AWS IoT Analytics's // API operation DeleteDatasetContent for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/DeleteDatasetContent @@ -1005,20 +1005,20 @@ func (c *IoTAnalytics) DeleteDatastoreRequest(input *DeleteDatastoreInput) (req // See the AWS API reference guide for AWS IoT Analytics's // API operation DeleteDatastore for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/DeleteDatastore @@ -1097,20 +1097,20 @@ func (c *IoTAnalytics) DeletePipelineRequest(input *DeletePipelineInput) (req *r // See the AWS API reference guide for AWS IoT Analytics's // API operation DeletePipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/DeletePipeline @@ -1188,20 +1188,20 @@ func (c *IoTAnalytics) DescribeChannelRequest(input *DescribeChannelInput) (req // See the AWS API reference guide for AWS IoT Analytics's // API operation DescribeChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/DescribeChannel @@ -1279,20 +1279,20 @@ func (c *IoTAnalytics) DescribeDatasetRequest(input *DescribeDatasetInput) (req // See the AWS API reference guide for AWS IoT Analytics's // API operation DescribeDataset for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/DescribeDataset @@ -1370,20 +1370,20 @@ func (c *IoTAnalytics) DescribeDatastoreRequest(input *DescribeDatastoreInput) ( // See the AWS API reference guide for AWS IoT Analytics's // API operation DescribeDatastore for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/DescribeDatastore @@ -1461,20 +1461,20 @@ func (c *IoTAnalytics) DescribeLoggingOptionsRequest(input *DescribeLoggingOptio // See the AWS API reference guide for AWS IoT Analytics's // API operation DescribeLoggingOptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/DescribeLoggingOptions @@ -1552,20 +1552,20 @@ func (c *IoTAnalytics) DescribePipelineRequest(input *DescribePipelineInput) (re // See the AWS API reference guide for AWS IoT Analytics's // API operation DescribePipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/DescribePipeline @@ -1643,20 +1643,20 @@ func (c *IoTAnalytics) GetDatasetContentRequest(input *GetDatasetContentInput) ( // See the AWS API reference guide for AWS IoT Analytics's // API operation GetDatasetContent for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/GetDatasetContent @@ -1740,17 +1740,17 @@ func (c *IoTAnalytics) ListChannelsRequest(input *ListChannelsInput) (req *reque // See the AWS API reference guide for AWS IoT Analytics's // API operation ListChannels for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/ListChannels @@ -1818,10 +1818,12 @@ func (c *IoTAnalytics) ListChannelsPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListChannelsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListChannelsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1884,20 +1886,20 @@ func (c *IoTAnalytics) ListDatasetContentsRequest(input *ListDatasetContentsInpu // See the AWS API reference guide for AWS IoT Analytics's // API operation ListDatasetContents for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/ListDatasetContents @@ -1965,10 +1967,12 @@ func (c *IoTAnalytics) ListDatasetContentsPagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDatasetContentsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDatasetContentsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2031,17 +2035,17 @@ func (c *IoTAnalytics) ListDatasetsRequest(input *ListDatasetsInput) (req *reque // See the AWS API reference guide for AWS IoT Analytics's // API operation ListDatasets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/ListDatasets @@ -2109,10 +2113,12 @@ func (c *IoTAnalytics) ListDatasetsPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDatasetsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDatasetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2175,17 +2181,17 @@ func (c *IoTAnalytics) ListDatastoresRequest(input *ListDatastoresInput) (req *r // See the AWS API reference guide for AWS IoT Analytics's // API operation ListDatastores for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/ListDatastores @@ -2253,10 +2259,12 @@ func (c *IoTAnalytics) ListDatastoresPagesWithContext(ctx aws.Context, input *Li }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDatastoresOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDatastoresOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2319,17 +2327,17 @@ func (c *IoTAnalytics) ListPipelinesRequest(input *ListPipelinesInput) (req *req // See the AWS API reference guide for AWS IoT Analytics's // API operation ListPipelines for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/ListPipelines @@ -2397,10 +2405,12 @@ func (c *IoTAnalytics) ListPipelinesPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPipelinesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPipelinesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2457,23 +2467,23 @@ func (c *IoTAnalytics) ListTagsForResourceRequest(input *ListTagsForResourceInpu // See the AWS API reference guide for AWS IoT Analytics's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The command caused an internal limit to be exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/ListTagsForResource @@ -2558,17 +2568,17 @@ func (c *IoTAnalytics) PutLoggingOptionsRequest(input *PutLoggingOptionsInput) ( // See the AWS API reference guide for AWS IoT Analytics's // API operation PutLoggingOptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/PutLoggingOptions @@ -2646,17 +2656,17 @@ func (c *IoTAnalytics) RunPipelineActivityRequest(input *RunPipelineActivityInpu // See the AWS API reference guide for AWS IoT Analytics's // API operation RunPipelineActivity for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/RunPipelineActivity @@ -2735,20 +2745,20 @@ func (c *IoTAnalytics) SampleChannelDataRequest(input *SampleChannelDataInput) ( // See the AWS API reference guide for AWS IoT Analytics's // API operation SampleChannelData for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/SampleChannelData @@ -2826,23 +2836,23 @@ func (c *IoTAnalytics) StartPipelineReprocessingRequest(input *StartPipelineRepr // See the AWS API reference guide for AWS IoT Analytics's // API operation StartPipelineReprocessing for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // A resource with the same name already exists. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request was not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/StartPipelineReprocessing @@ -2922,23 +2932,23 @@ func (c *IoTAnalytics) TagResourceRequest(input *TagResourceInput) (req *request // See the AWS API reference guide for AWS IoT Analytics's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The command caused an internal limit to be exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/TagResource @@ -3017,23 +3027,23 @@ func (c *IoTAnalytics) UntagResourceRequest(input *UntagResourceInput) (req *req // See the AWS API reference guide for AWS IoT Analytics's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The command caused an internal limit to be exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/UntagResource @@ -3112,20 +3122,20 @@ func (c *IoTAnalytics) UpdateChannelRequest(input *UpdateChannelInput) (req *req // See the AWS API reference guide for AWS IoT Analytics's // API operation UpdateChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/UpdateChannel @@ -3204,20 +3214,20 @@ func (c *IoTAnalytics) UpdateDatasetRequest(input *UpdateDatasetInput) (req *req // See the AWS API reference guide for AWS IoT Analytics's // API operation UpdateDataset for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/UpdateDataset @@ -3296,20 +3306,20 @@ func (c *IoTAnalytics) UpdateDatastoreRequest(input *UpdateDatastoreInput) (req // See the AWS API reference guide for AWS IoT Analytics's // API operation UpdateDatastore for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/UpdateDatastore @@ -3390,23 +3400,23 @@ func (c *IoTAnalytics) UpdatePipelineRequest(input *UpdatePipelineInput) (req *r // See the AWS API reference guide for AWS IoT Analytics's // API operation UpdatePipeline for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A resource with the specified name could not be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // There was an internal failure. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is temporarily unavailable. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was denied due to request throttling. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The command caused an internal limit to be exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotanalytics-2017-11-27/UpdatePipeline @@ -3754,7 +3764,9 @@ type Channel struct { // The status of the channel. Status *string `locationName:"status" type:"string" enum:"ChannelStatus"` - // Where channel data is stored. + // Where channel data is stored. You may choose one of "serviceManagedS3" or + // "customerManagedS3" storage. If not specified, the default is "serviceManagedS3". + // This cannot be changed after creation of the channel. Storage *ChannelStorage `locationName:"storage" type:"structure"` } @@ -3905,15 +3917,21 @@ func (s *ChannelStatistics) SetSize(v *EstimatedResourceSize) *ChannelStatistics return s } -// Where channel data is stored. +// Where channel data is stored. You may choose one of "serviceManagedS3" or +// "customerManagedS3" storage. If not specified, the default is "serviceManagedS3". +// This cannot be changed after creation of the channel. type ChannelStorage struct { _ struct{} `type:"structure"` - // Use this to store channel data in an S3 bucket that you manage. + // Use this to store channel data in an S3 bucket that you manage. If customer + // managed storage is selected, the "retentionPeriod" parameter is ignored. + // The choice of service-managed or customer-managed S3 storage cannot be changed + // after creation of the channel. CustomerManagedS3 *CustomerManagedChannelS3Storage `locationName:"customerManagedS3" type:"structure"` // Use this to store channel data in an S3 bucket managed by the AWS IoT Analytics - // service. + // service. The choice of service-managed or customer-managed S3 storage cannot + // be changed after creation of the channel. ServiceManagedS3 *ServiceManagedChannelS3Storage `locationName:"serviceManagedS3" type:"structure"` } @@ -4158,10 +4176,13 @@ type CreateChannelInput struct { // ChannelName is a required field ChannelName *string `locationName:"channelName" min:"1" type:"string" required:"true"` - // Where channel data is stored. + // Where channel data is stored. You may choose one of "serviceManagedS3" or + // "customerManagedS3" storage. If not specified, the default is "serviceManagedS3". + // This cannot be changed after creation of the channel. ChannelStorage *ChannelStorage `locationName:"channelStorage" type:"structure"` - // How long, in days, message data is kept for the channel. + // How long, in days, message data is kept for the channel. When "customerManagedS3" + // storage is selected, this parameter is ignored. RetentionPeriod *RetentionPeriod `locationName:"retentionPeriod" type:"structure"` // Metadata which can be used to manage the channel. @@ -4561,10 +4582,13 @@ type CreateDatastoreInput struct { // DatastoreName is a required field DatastoreName *string `locationName:"datastoreName" min:"1" type:"string" required:"true"` - // Where data store data is stored. + // Where data store data is stored. You may choose one of "serviceManagedS3" + // or "customerManagedS3" storage. If not specified, the default is "serviceManagedS3". + // This cannot be changed after the data store is created. DatastoreStorage *DatastoreStorage `locationName:"datastoreStorage" type:"structure"` - // How long, in days, message data is kept for the data store. + // How long, in days, message data is kept for the data store. When "customerManagedS3" + // storage is selected, this parameter is ignored. RetentionPeriod *RetentionPeriod `locationName:"retentionPeriod" type:"structure"` // Metadata which can be used to manage the data store. @@ -4818,7 +4842,10 @@ func (s *CreatePipelineOutput) SetPipelineName(v string) *CreatePipelineOutput { return s } -// Use this to store channel data in an S3 bucket that you manage. +// Use this to store channel data in an S3 bucket that you manage. If customer +// managed storage is selected, the "retentionPeriod" parameter is ignored. +// The choice of service-managed or customer-managed S3 storage cannot be changed +// after creation of the channel. type CustomerManagedChannelS3Storage struct { _ struct{} `type:"structure"` @@ -4827,9 +4854,10 @@ type CustomerManagedChannelS3Storage struct { // Bucket is a required field Bucket *string `locationName:"bucket" min:"3" type:"string" required:"true"` - // The prefix used to create the keys of the channel data objects. Each object - // in an Amazon S3 bucket has a key that is its unique identifier within the - // bucket (each object in a bucket has exactly one key). + // [Optional] The prefix used to create the keys of the channel data objects. + // Each object in an Amazon S3 bucket has a key that is its unique identifier + // within the bucket (each object in a bucket has exactly one key). The prefix + // must end with a '/'. KeyPrefix *string `locationName:"keyPrefix" min:"1" type:"string"` // The ARN of the role which grants AWS IoT Analytics permission to interact @@ -4899,9 +4927,10 @@ type CustomerManagedChannelS3StorageSummary struct { // The name of the Amazon S3 bucket in which channel data is stored. Bucket *string `locationName:"bucket" min:"3" type:"string"` - // The prefix used to create the keys of the channel data objects. Each object - // in an Amazon S3 bucket has a key that is its unique identifier within the - // bucket (each object in a bucket has exactly one key). + // [Optional] The prefix used to create the keys of the channel data objects. + // Each object in an Amazon S3 bucket has a key that is its unique identifier + // within the bucket (each object in a bucket has exactly one key). The prefix + // must end with a '/'. KeyPrefix *string `locationName:"keyPrefix" min:"1" type:"string"` // The ARN of the role which grants AWS IoT Analytics permission to interact @@ -4937,7 +4966,10 @@ func (s *CustomerManagedChannelS3StorageSummary) SetRoleArn(v string) *CustomerM return s } -// Use this to store data store data in an S3 bucket that you manage. +// Use this to store data store data in an S3 bucket that you manage. When customer +// managed storage is selected, the "retentionPeriod" parameter is ignored. +// The choice of service-managed or customer-managed S3 storage cannot be changed +// after creation of the data store. type CustomerManagedDatastoreS3Storage struct { _ struct{} `type:"structure"` @@ -4946,9 +4978,10 @@ type CustomerManagedDatastoreS3Storage struct { // Bucket is a required field Bucket *string `locationName:"bucket" min:"3" type:"string" required:"true"` - // The prefix used to create the keys of the data store data objects. Each object - // in an Amazon S3 bucket has a key that is its unique identifier within the - // bucket (each object in a bucket has exactly one key). + // [Optional] The prefix used to create the keys of the data store data objects. + // Each object in an Amazon S3 bucket has a key that is its unique identifier + // within the bucket (each object in a bucket has exactly one key). The prefix + // must end with a '/'. KeyPrefix *string `locationName:"keyPrefix" min:"1" type:"string"` // The ARN of the role which grants AWS IoT Analytics permission to interact @@ -5018,9 +5051,10 @@ type CustomerManagedDatastoreS3StorageSummary struct { // The name of the Amazon S3 bucket in which data store data is stored. Bucket *string `locationName:"bucket" min:"3" type:"string"` - // The prefix used to create the keys of the data store data objects. Each object - // in an Amazon S3 bucket has a key that is its unique identifier within the - // bucket (each object in a bucket has exactly one key). + // [Optional] The prefix used to create the keys of the data store data objects. + // Each object in an Amazon S3 bucket has a key that is its unique identifier + // within the bucket (each object in a bucket has exactly one key). The prefix + // must end with a '/'. KeyPrefix *string `locationName:"keyPrefix" min:"1" type:"string"` // The ARN of the role which grants AWS IoT Analytics permission to interact @@ -5414,6 +5448,9 @@ func (s *DatasetContentStatus) SetState(v string) *DatasetContentStatus { type DatasetContentSummary struct { _ struct{} `type:"structure"` + // The time the dataset content status was updated to SUCCEEDED or FAILED. + CompletionTime *time.Time `locationName:"completionTime" type:"timestamp"` + // The actual time the creation of the data set contents was started. CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` @@ -5437,6 +5474,12 @@ func (s DatasetContentSummary) GoString() string { return s.String() } +// SetCompletionTime sets the CompletionTime field's value. +func (s *DatasetContentSummary) SetCompletionTime(v time.Time) *DatasetContentSummary { + s.CompletionTime = &v + return s +} + // SetCreationTime sets the CreationTime field's value. func (s *DatasetContentSummary) SetCreationTime(v time.Time) *DatasetContentSummary { s.CreationTime = &v @@ -5673,7 +5716,8 @@ type Datastore struct { // The name of the data store. Name *string `locationName:"name" min:"1" type:"string"` - // How long, in days, message data is kept for the data store. + // How long, in days, message data is kept for the data store. When "customerManagedS3" + // storage is selected, this parameter is ignored. RetentionPeriod *RetentionPeriod `locationName:"retentionPeriod" type:"structure"` // The status of a data store: @@ -5691,7 +5735,9 @@ type Datastore struct { // The data store is being deleted. Status *string `locationName:"status" type:"string" enum:"DatastoreStatus"` - // Where data store data is stored. + // Where data store data is stored. You may choose one of "serviceManagedS3" + // or "customerManagedS3" storage. If not specified, the default is "serviceManagedS3". + // This cannot be changed after the data store is created. Storage *DatastoreStorage `locationName:"storage" type:"structure"` } @@ -5830,15 +5876,21 @@ func (s *DatastoreStatistics) SetSize(v *EstimatedResourceSize) *DatastoreStatis return s } -// Where data store data is stored. +// Where data store data is stored. You may choose one of "serviceManagedS3" +// or "customerManagedS3" storage. If not specified, the default is "serviceManagedS3". +// This cannot be changed after the data store is created. type DatastoreStorage struct { _ struct{} `type:"structure"` - // Use this to store data store data in an S3 bucket that you manage. + // Use this to store data store data in an S3 bucket that you manage. When customer + // managed storage is selected, the "retentionPeriod" parameter is ignored. + // The choice of service-managed or customer-managed S3 storage cannot be changed + // after creation of the data store. CustomerManagedS3 *CustomerManagedDatastoreS3Storage `locationName:"customerManagedS3" type:"structure"` // Use this to store data store data in an S3 bucket managed by the AWS IoT - // Analytics service. + // Analytics service. The choice of service-managed or customer-managed S3 storage + // cannot be changed after creation of the data store. ServiceManagedS3 *ServiceManagedDatastoreS3Storage `locationName:"serviceManagedS3" type:"structure"` } @@ -6335,7 +6387,8 @@ type DescribeChannelInput struct { ChannelName *string `location:"uri" locationName:"channelName" min:"1" type:"string" required:"true"` // If true, additional statistical information about the channel is included - // in the response. + // in the response. This feature cannot be used with a channel whose S3 storage + // is customer-managed. IncludeStatistics *bool `location:"querystring" locationName:"includeStatistics" type:"boolean"` } @@ -6482,8 +6535,9 @@ type DescribeDatastoreInput struct { // DatastoreName is a required field DatastoreName *string `location:"uri" locationName:"datastoreName" min:"1" type:"string" required:"true"` - // If true, additional statistical information about the datastore is included - // in the response. + // If true, additional statistical information about the data store is included + // in the response. This feature cannot be used with a data store whose S3 storage + // is customer-managed. IncludeStatistics *bool `location:"querystring" locationName:"includeStatistics" type:"boolean"` } @@ -7135,6 +7189,118 @@ func (s *GlueConfiguration) SetTableName(v string) *GlueConfiguration { return s } +// There was an internal failure. +type InternalFailureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalFailureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalFailureException) GoString() string { + return s.String() +} + +func newErrorInternalFailureException(v protocol.ResponseMetadata) error { + return &InternalFailureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalFailureException) Code() string { + return "InternalFailureException" +} + +// Message returns the exception's message. +func (s InternalFailureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalFailureException) OrigErr() error { + return nil +} + +func (s InternalFailureException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalFailureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalFailureException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was not valid. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // Configuration information for delivery of data set contents to AWS IoT Events. type IotEventsDestinationConfiguration struct { _ struct{} `type:"structure"` @@ -7286,6 +7452,62 @@ func (s *LambdaActivity) SetNext(v string) *LambdaActivity { return s } +// The command caused an internal limit to be exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListChannelsInput struct { _ struct{} `type:"structure"` @@ -8546,6 +8768,68 @@ func (s *ReprocessingSummary) SetStatus(v string) *ReprocessingSummary { return s } +// A resource with the same name already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + // The ARN of the resource. + ResourceArn *string `locationName:"resourceArn" type:"string"` + + // The ID of the resource. + ResourceId *string `locationName:"resourceId" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + // The configuration of the resource used to execute the "containerAction". type ResourceConfiguration struct { _ struct{} `type:"structure"` @@ -8604,6 +8888,62 @@ func (s *ResourceConfiguration) SetVolumeSizeInGB(v int64) *ResourceConfiguratio return s } +// A resource with the specified name could not be found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // How long, in days, message data is kept. type RetentionPeriod struct { _ struct{} `type:"structure"` @@ -8764,7 +9104,9 @@ type S3DestinationConfiguration struct { // The key of the data set contents object. Each object in an Amazon S3 bucket // has a key that is its unique identifier within the bucket (each object in - // a bucket has exactly one key). + // a bucket has exactly one key). To produce a unique key, you can use "!{iotanalytics:scheduledTime}" + // to insert the time of the scheduled SQL query run, or "!{iotanalytics:versioned} + // to insert a unique hash identifying the data set, for example: "/DataSet/!{iotanalytics:scheduledTime}/!{iotanalytics:versioned}.csv". // // Key is a required field Key *string `locationName:"key" min:"1" type:"string" required:"true"` @@ -9038,7 +9380,8 @@ func (s *SelectAttributesActivity) SetNext(v string) *SelectAttributesActivity { } // Use this to store channel data in an S3 bucket managed by the AWS IoT Analytics -// service. +// service. The choice of service-managed or customer-managed S3 storage cannot +// be changed after creation of the channel. type ServiceManagedChannelS3Storage struct { _ struct{} `type:"structure"` } @@ -9070,7 +9413,8 @@ func (s ServiceManagedChannelS3StorageSummary) GoString() string { } // Use this to store data store data in an S3 bucket managed by the AWS IoT -// Analytics service. +// Analytics service. The choice of service-managed or customer-managed S3 storage +// cannot be changed after creation of the data store. type ServiceManagedDatastoreS3Storage struct { _ struct{} `type:"structure"` } @@ -9101,6 +9445,62 @@ func (s ServiceManagedDatastoreS3StorageSummary) GoString() string { return s.String() } +// The service is temporarily unavailable. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + // The SQL query to modify the message. type SqlQueryDatasetAction struct { _ struct{} `type:"structure"` @@ -9382,6 +9782,62 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// The request was denied due to request throttling. +type ThrottlingException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ThrottlingException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ThrottlingException) GoString() string { + return s.String() +} + +func newErrorThrottlingException(v protocol.ResponseMetadata) error { + return &ThrottlingException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ThrottlingException) Code() string { + return "ThrottlingException" +} + +// Message returns the exception's message. +func (s ThrottlingException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ThrottlingException) OrigErr() error { + return nil +} + +func (s ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ThrottlingException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ThrottlingException) RequestID() string { + return s.respMetadata.RequestID +} + // Information about the data set whose content generation triggers the new // data set content generation. type TriggeringDataset struct { @@ -9506,10 +9962,13 @@ type UpdateChannelInput struct { // ChannelName is a required field ChannelName *string `location:"uri" locationName:"channelName" min:"1" type:"string" required:"true"` - // Where channel data is stored. + // Where channel data is stored. You may choose one of "serviceManagedS3" or + // "customerManagedS3" storage. If not specified, the default is "serviceManagedS3". + // This cannot be changed after creation of the channel. ChannelStorage *ChannelStorage `locationName:"channelStorage" type:"structure"` - // How long, in days, message data is kept for the channel. + // How long, in days, message data is kept for the channel. The retention period + // cannot be updated if the channel's S3 storage is customer-managed. RetentionPeriod *RetentionPeriod `locationName:"retentionPeriod" type:"structure"` } @@ -9742,10 +10201,13 @@ type UpdateDatastoreInput struct { // DatastoreName is a required field DatastoreName *string `location:"uri" locationName:"datastoreName" min:"1" type:"string" required:"true"` - // Where data store data is stored. + // Where data store data is stored. You may choose one of "serviceManagedS3" + // or "customerManagedS3" storage. If not specified, the default is "serviceManagedS3". + // This cannot be changed after the data store is created. DatastoreStorage *DatastoreStorage `locationName:"datastoreStorage" type:"structure"` - // How long, in days, message data is kept for the data store. + // How long, in days, message data is kept for the data store. The retention + // period cannot be updated if the data store's S3 storage is customer-managed. RetentionPeriod *RetentionPeriod `locationName:"retentionPeriod" type:"structure"` } diff --git a/vendor/github.com/aws/aws-sdk-go/service/iotanalytics/errors.go b/vendor/github.com/aws/aws-sdk-go/service/iotanalytics/errors.go index 790e802f3bf..2dd14ba7a7a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iotanalytics/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iotanalytics/errors.go @@ -2,6 +2,10 @@ package iotanalytics +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInternalFailureException for service response error code @@ -46,3 +50,13 @@ const ( // The request was denied due to request throttling. ErrCodeThrottlingException = "ThrottlingException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InternalFailureException": newErrorInternalFailureException, + "InvalidRequestException": newErrorInvalidRequestException, + "LimitExceededException": newErrorLimitExceededException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ServiceUnavailableException": newErrorServiceUnavailableException, + "ThrottlingException": newErrorThrottlingException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/iotanalytics/service.go b/vendor/github.com/aws/aws-sdk-go/service/iotanalytics/service.go index 54edbd56f34..eeeceecff0c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iotanalytics/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iotanalytics/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "iotanalytics" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "IoTAnalytics" // ServiceID is a unique identifer of a specific service. + ServiceID = "IoTAnalytics" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the IoTAnalytics client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a IoTAnalytics client from just a session. // svc := iotanalytics.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *IoTAnalytics { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "iotanalytics" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *IoTAnalytics { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *IoTAnalytics { svc := &IoTAnalytics{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-11-27", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/iotevents/api.go b/vendor/github.com/aws/aws-sdk-go/service/iotevents/api.go index 551a03fef98..5dd9219ab5e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iotevents/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iotevents/api.go @@ -66,26 +66,26 @@ func (c *IoTEvents) CreateDetectorModelRequest(input *CreateDetectorModelInput) // See the AWS API reference guide for AWS IoT Events's // API operation CreateDetectorModel for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is in use. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is currently unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/CreateDetectorModel @@ -163,20 +163,20 @@ func (c *IoTEvents) CreateInputRequest(input *CreateInputInput) (req *request.Re // See the AWS API reference guide for AWS IoT Events's // API operation CreateInput for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is currently unavailable. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/CreateInput @@ -256,23 +256,23 @@ func (c *IoTEvents) DeleteDetectorModelRequest(input *DeleteDetectorModelInput) // See the AWS API reference guide for AWS IoT Events's // API operation DeleteDetectorModel for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is in use. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource was not found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is currently unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/DeleteDetectorModel @@ -351,23 +351,23 @@ func (c *IoTEvents) DeleteInputRequest(input *DeleteInputInput) (req *request.Re // See the AWS API reference guide for AWS IoT Events's // API operation DeleteInput for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource was not found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is currently unavailable. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/DeleteInput @@ -436,8 +436,8 @@ func (c *IoTEvents) DescribeDetectorModelRequest(input *DescribeDetectorModelInp // DescribeDetectorModel API operation for AWS IoT Events. // -// Describes a detector model. If the "version" parameter is not specified, -// information about the latest version is returned. +// Describes a detector model. If the version parameter is not specified, information +// about the latest version 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 @@ -446,20 +446,20 @@ func (c *IoTEvents) DescribeDetectorModelRequest(input *DescribeDetectorModelInp // See the AWS API reference guide for AWS IoT Events's // API operation DescribeDetectorModel for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource was not found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is currently unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/DescribeDetectorModel @@ -537,20 +537,20 @@ func (c *IoTEvents) DescribeInputRequest(input *DescribeInputInput) (req *reques // See the AWS API reference guide for AWS IoT Events's // API operation DescribeInput for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource was not found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is currently unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/DescribeInput @@ -628,23 +628,23 @@ func (c *IoTEvents) DescribeLoggingOptionsRequest(input *DescribeLoggingOptionsI // See the AWS API reference guide for AWS IoT Events's // API operation DescribeLoggingOptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource was not found. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is currently unavailable. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The requested operation is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/DescribeLoggingOptions @@ -723,20 +723,20 @@ func (c *IoTEvents) ListDetectorModelVersionsRequest(input *ListDetectorModelVer // See the AWS API reference guide for AWS IoT Events's // API operation ListDetectorModelVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource was not found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is currently unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/ListDetectorModelVersions @@ -815,17 +815,17 @@ func (c *IoTEvents) ListDetectorModelsRequest(input *ListDetectorModelsInput) (r // See the AWS API reference guide for AWS IoT Events's // API operation ListDetectorModels for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is currently unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/ListDetectorModels @@ -903,17 +903,17 @@ func (c *IoTEvents) ListInputsRequest(input *ListInputsInput) (req *request.Requ // See the AWS API reference guide for AWS IoT Events's // API operation ListInputs for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is currently unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/ListInputs @@ -991,20 +991,20 @@ func (c *IoTEvents) ListTagsForResourceRequest(input *ListTagsForResourceInput) // See the AWS API reference guide for AWS IoT Events's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource was not found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is in use. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/ListTagsForResource @@ -1076,10 +1076,10 @@ func (c *IoTEvents) PutLoggingOptionsRequest(input *PutLoggingOptionsInput) (req // // Sets or updates the AWS IoT Events logging options. // -// If you update the value of any "loggingOptions" field, it takes up to one -// minute for the change to take effect. Also, if you change the policy attached -// to the role you specified in the "roleArn" field (for example, to correct -// an invalid policy) it takes up to five minutes for that change to take effect. +// If you update the value of any loggingOptions field, it takes up to one minute +// for the change to take effect. If you change the policy attached to the role +// you specified in the roleArn field (for example, to correct an invalid policy), +// it takes up to five minutes for that change 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 @@ -1088,23 +1088,23 @@ func (c *IoTEvents) PutLoggingOptionsRequest(input *PutLoggingOptionsInput) (req // See the AWS API reference guide for AWS IoT Events's // API operation PutLoggingOptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is currently unavailable. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The requested operation is not supported. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/PutLoggingOptions @@ -1184,23 +1184,23 @@ func (c *IoTEvents) TagResourceRequest(input *TagResourceInput) (req *request.Re // See the AWS API reference guide for AWS IoT Events's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource was not found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is in use. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A limit was exceeded. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/TagResource @@ -1279,20 +1279,20 @@ func (c *IoTEvents) UntagResourceRequest(input *UntagResourceInput) (req *reques // See the AWS API reference guide for AWS IoT Events's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource was not found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is in use. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/UntagResource @@ -1371,23 +1371,23 @@ func (c *IoTEvents) UpdateDetectorModelRequest(input *UpdateDetectorModelInput) // See the AWS API reference guide for AWS IoT Events's // API operation UpdateDetectorModel for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is in use. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource was not found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is currently unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/UpdateDetectorModel @@ -1465,23 +1465,23 @@ func (c *IoTEvents) UpdateInputRequest(input *UpdateInputInput) (req *request.Re // See the AWS API reference guide for AWS IoT Events's // API operation UpdateInput for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request was invalid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request could not be completed due to throttling. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource was not found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is currently unavailable. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27/UpdateInput @@ -1506,8 +1506,8 @@ func (c *IoTEvents) UpdateInputWithContext(ctx aws.Context, input *UpdateInputIn return out, req.Send() } -// Sends an IoT Events input, passing in information about the detector model -// instance and the event which triggered the action. +// Sends an AWS IoT Events input, passing in information about the detector +// model instance and the event that triggered the action. type Action struct { _ struct{} `type:"structure"` @@ -1549,26 +1549,26 @@ func (s *Action) SetInputName(v string) *Action { return s } -// An action to be performed when the "condition" is TRUE. +// An action to be performed when the condition is TRUE. type ActionData struct { _ struct{} `type:"structure"` // Information needed to clear the timer. ClearTimer *ClearTimerAction `locationName:"clearTimer" type:"structure"` - // Sends information about the detector model instance and the event which triggered - // the action to a Kinesis Data Firehose stream. + // Sends information about the detector model instance and the event that triggered + // the action to an Amazon Kinesis Data Firehose delivery stream. Firehose *FirehoseAction `locationName:"firehose" type:"structure"` - // Sends an IoT Events input, passing in information about the detector model - // instance and the event which triggered the action. + // Sends an AWS IoT Events input, passing in information about the detector + // model instance and the event that triggered the action. IotEvents *Action `locationName:"iotEvents" type:"structure"` // Publishes an MQTT message with the given topic to the AWS IoT message broker. IotTopicPublish *IotTopicPublishAction `locationName:"iotTopicPublish" type:"structure"` // Calls a Lambda function, passing in information about the detector model - // instance and the event which triggered the action. + // instance and the event that triggered the action. Lambda *LambdaAction `locationName:"lambda" type:"structure"` // Information needed to reset the timer. @@ -1583,8 +1583,8 @@ type ActionData struct { // Sends an Amazon SNS message. Sns *SNSTopicPublishAction `locationName:"sns" type:"structure"` - // Sends information about the detector model instance and the event which triggered - // the action to an AWS SQS queue. + // Sends information about the detector model instance and the event that triggered + // the action to an Amazon SQS queue. Sqs *SqsAction `locationName:"sqs" type:"structure"` } @@ -1720,7 +1720,7 @@ func (s *ActionData) SetSqs(v *SqsAction) *ActionData { // The attributes from the JSON payload that are made available by the input. // Inputs are derived from messages sent to the AWS IoT Events system using -// BatchPutMessage. Each such message contains a JSON payload, and those attributes +// BatchPutMessage. Each such message contains a JSON payload. Those attributes // (and their paired values) specified here are available for use in the condition // expressions used by detectors. type Attribute struct { @@ -1728,10 +1728,10 @@ type Attribute struct { // An expression that specifies an attribute-value pair in a JSON structure. // Use this to specify an attribute from the JSON payload that is made available - // by the input. Inputs are derived from messages sent to the AWS IoT Events - // system (BatchPutMessage). Each such message contains a JSON payload, and - // the attribute (and its paired value) specified here are available for use - // in the "condition" expressions used by detectors. + // by the input. Inputs are derived from messages sent to AWS IoT Events (BatchPutMessage). + // Each such message contains a JSON payload. The attribute (and its paired + // value) specified here are available for use in the condition expressions + // used by detectors. // // Syntax: .... // @@ -1829,11 +1829,15 @@ type CreateDetectorModelInput struct { // DetectorModelName is a required field DetectorModelName *string `locationName:"detectorModelName" min:"1" type:"string" required:"true"` - // The input attribute key used to identify a device or system in order to create - // a detector (an instance of the detector model) and then to route each input - // received to the appropriate detector (instance). This parameter uses a JSON-path - // expression to specify the attribute-value pair in the message payload of - // each input that is used to identify the device associated with the input. + // Information about the order in which events are evaluated and how actions + // are executed. + EvaluationMethod *string `locationName:"evaluationMethod" type:"string" enum:"EvaluationMethod"` + + // The input attribute key used to identify a device or system to create a detector + // (an instance of the detector model) and then to route each input received + // to the appropriate detector (instance). This parameter uses a JSON-path expression + // in the message payload of each input to specify the attribute-value pair + // that is used to identify the device associated with the input. Key *string `locationName:"key" min:"1" type:"string"` // The ARN of the role that grants permission to AWS IoT Events to perform its @@ -1917,6 +1921,12 @@ func (s *CreateDetectorModelInput) SetDetectorModelName(v string) *CreateDetecto return s } +// SetEvaluationMethod sets the EvaluationMethod field's value. +func (s *CreateDetectorModelInput) SetEvaluationMethod(v string) *CreateDetectorModelInput { + s.EvaluationMethod = &v + return s +} + // SetKey sets the Key field's value. func (s *CreateDetectorModelInput) SetKey(v string) *CreateDetectorModelInput { s.Key = &v @@ -2464,11 +2474,15 @@ type DetectorModelConfiguration struct { // The version of the detector model. DetectorModelVersion *string `locationName:"detectorModelVersion" min:"1" type:"string"` - // The input attribute key used to identify a device or system in order to create - // a detector (an instance of the detector model) and then to route each input - // received to the appropriate detector (instance). This parameter uses a JSON-path - // expression to specify the attribute-value pair in the message payload of - // each input that is used to identify the device associated with the input. + // Information about the order in which events are evaluated and how actions + // are executed. + EvaluationMethod *string `locationName:"evaluationMethod" type:"string" enum:"EvaluationMethod"` + + // The input attribute key used to identify a device or system to create a detector + // (an instance of the detector model) and then to route each input received + // to the appropriate detector (instance). This parameter uses a JSON-path expression + // in the message payload of each input to specify the attribute-value pair + // that is used to identify the device associated with the input. Key *string `locationName:"key" min:"1" type:"string"` // The time the detector model was last updated. @@ -2522,6 +2536,12 @@ func (s *DetectorModelConfiguration) SetDetectorModelVersion(v string) *Detector return s } +// SetEvaluationMethod sets the EvaluationMethod field's value. +func (s *DetectorModelConfiguration) SetEvaluationMethod(v string) *DetectorModelConfiguration { + s.EvaluationMethod = &v + return s +} + // SetKey sets the Key field's value. func (s *DetectorModelConfiguration) SetKey(v string) *DetectorModelConfiguration { s.Key = &v @@ -2673,6 +2693,10 @@ type DetectorModelVersionSummary struct { // The ID of the detector model version. DetectorModelVersion *string `locationName:"detectorModelVersion" min:"1" type:"string"` + // Information about the order in which events are evaluated and how actions + // are executed. + EvaluationMethod *string `locationName:"evaluationMethod" type:"string" enum:"EvaluationMethod"` + // The last time the detector model version was updated. LastUpdateTime *time.Time `locationName:"lastUpdateTime" type:"timestamp"` @@ -2718,6 +2742,12 @@ func (s *DetectorModelVersionSummary) SetDetectorModelVersion(v string) *Detecto return s } +// SetEvaluationMethod sets the EvaluationMethod field's value. +func (s *DetectorModelVersionSummary) SetEvaluationMethod(v string) *DetectorModelVersionSummary { + s.EvaluationMethod = &v + return s +} + // SetLastUpdateTime sets the LastUpdateTime field's value. func (s *DetectorModelVersionSummary) SetLastUpdateTime(v time.Time) *DetectorModelVersionSummary { s.LastUpdateTime = &v @@ -2736,17 +2766,16 @@ func (s *DetectorModelVersionSummary) SetStatus(v string) *DetectorModelVersionS return s } -// Specifies the "actions" to be performed when the "condition" evaluates to -// TRUE. +// Specifies the actions to be performed when the condition evaluates to TRUE. type Event struct { _ struct{} `type:"structure"` // The actions to be performed. Actions []*ActionData `locationName:"actions" type:"list"` - // [Optional] The Boolean expression that when TRUE causes the "actions" to - // be performed. If not present, the actions are performed (=TRUE); if the expression - // result is not a Boolean value, the actions are NOT performed (=FALSE). + // Optional. The Boolean expression that, when TRUE, causes the actions to be + // performed. If not present, the actions are performed (=TRUE). If the expression + // result is not a Boolean value, the actions are not performed (=FALSE). Condition *string `locationName:"condition" type:"string"` // The name of the event. @@ -2806,19 +2835,19 @@ func (s *Event) SetEventName(v string) *Event { return s } -// Sends information about the detector model instance and the event which triggered -// the action to a Kinesis Data Firehose stream. +// Sends information about the detector model instance and the event that triggered +// the action to an Amazon Kinesis Data Firehose delivery stream. type FirehoseAction struct { _ struct{} `type:"structure"` - // The name of the Kinesis Data Firehose stream where the data is written. + // The name of the Kinesis Data Firehose delivery stream where the data is written. // // DeliveryStreamName is a required field DeliveryStreamName *string `locationName:"deliveryStreamName" type:"string" required:"true"` // A character separator that is used to separate records written to the Kinesis - // Data Firehose stream. Valid values are: '\n' (newline), '\t' (tab), '\r\n' - // (Windows newline), ',' (comma). + // Data Firehose delivery stream. Valid values are: '\n' (newline), '\t' (tab), + // '\r\n' (Windows newline), ',' (comma). Separator *string `locationName:"separator" type:"string"` } @@ -2976,7 +3005,7 @@ type InputDefinition struct { // The attributes from the JSON payload that are made available by the input. // Inputs are derived from messages sent to the AWS IoT Events system using // BatchPutMessage. Each such message contains a JSON payload, and those attributes - // (and their paired values) specified here are available for use in the "condition" + // (and their paired values) specified here are available for use in the condition // expressions used by detectors that monitor this input. // // Attributes is a required field @@ -3094,12 +3123,128 @@ func (s *InputSummary) SetStatus(v string) *InputSummary { return s } -// Information required to publish the MQTT message via the AWS IoT message +// An internal failure occurred. +type InternalFailureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalFailureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalFailureException) GoString() string { + return s.String() +} + +func newErrorInternalFailureException(v protocol.ResponseMetadata) error { + return &InternalFailureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalFailureException) Code() string { + return "InternalFailureException" +} + +// Message returns the exception's message. +func (s InternalFailureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalFailureException) OrigErr() error { + return nil +} + +func (s InternalFailureException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalFailureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalFailureException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was invalid. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information required to publish the MQTT message through the AWS IoT message // broker. type IotTopicPublishAction struct { _ struct{} `type:"structure"` - // The MQTT topic of the message. + // The MQTT topic of the message. You can use a string expression that includes + // variables ($variable.) and input values ($input..) + // as the topic string. // // MqttTopic is a required field MqttTopic *string `locationName:"mqttTopic" min:"1" type:"string" required:"true"` @@ -3138,11 +3283,11 @@ func (s *IotTopicPublishAction) SetMqttTopic(v string) *IotTopicPublishAction { } // Calls a Lambda function, passing in information about the detector model -// instance and the event which triggered the action. +// instance and the event that triggered the action. type LambdaAction struct { _ struct{} `type:"structure"` - // The ARN of the Lambda function which is executed. + // The ARN of the Lambda function that is executed. // // FunctionArn is a required field FunctionArn *string `locationName:"functionArn" min:"1" type:"string" required:"true"` @@ -3180,6 +3325,63 @@ func (s *LambdaAction) SetFunctionArn(v string) *LambdaAction { return s } +// A limit was exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListDetectorModelVersionsInput struct { _ struct{} `type:"structure"` @@ -3593,7 +3795,7 @@ type OnEnterLifecycle struct { _ struct{} `type:"structure"` // Specifies the actions that are performed when the state is entered and the - // "condition" is TRUE. + // condition is TRUE. Events []*Event `locationName:"events" type:"list"` } @@ -3633,13 +3835,13 @@ func (s *OnEnterLifecycle) SetEvents(v []*Event) *OnEnterLifecycle { return s } -// When exiting this state, perform these "actions" if the specified "condition" +// When exiting this state, perform these actions if the specified condition // is TRUE. type OnExitLifecycle struct { _ struct{} `type:"structure"` - // Specifies the "actions" that are performed when the state is exited and the - // "condition" is TRUE. + // Specifies the actions that are performed when the state is exited and the + // condition is TRUE. Events []*Event `locationName:"events" type:"list"` } @@ -3679,14 +3881,14 @@ func (s *OnExitLifecycle) SetEvents(v []*Event) *OnExitLifecycle { return s } -// Specifies the actions performed when the "condition" evaluates to TRUE. +// Specifies the actions performed when the condition evaluates to TRUE. type OnInputLifecycle struct { _ struct{} `type:"structure"` - // Specifies the actions performed when the "condition" evaluates to TRUE. + // Specifies the actions performed when the condition evaluates to TRUE. Events []*Event `locationName:"events" type:"list"` - // Specifies the actions performed, and the next state entered, when a "condition" + // Specifies the actions performed, and the next state entered, when a condition // evaluates to TRUE. TransitionEvents []*TransitionEvent `locationName:"transitionEvents" type:"list"` } @@ -3842,6 +4044,183 @@ func (s *ResetTimerAction) SetTimerName(v string) *ResetTimerAction { return s } +// The resource already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` + + // The ARN of the resource. + ResourceArn *string `locationName:"resourceArn" type:"string"` + + // The ID of the resource. + ResourceId *string `locationName:"resourceId" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource is in use. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource was not found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Information required to publish the Amazon SNS message. type SNSTopicPublishAction struct { _ struct{} `type:"structure"` @@ -3884,12 +4263,69 @@ func (s *SNSTopicPublishAction) SetTargetArn(v string) *SNSTopicPublishAction { return s } +// The service is currently unavailable. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + // Information needed to set the timer. type SetTimerAction struct { _ struct{} `type:"structure"` // The number of seconds until the timer expires. The minimum value is 60 seconds - // to ensure accuracy. + // to ensure accuracy. The maximum value is 31622400 seconds. // // Seconds is a required field Seconds *int64 `locationName:"seconds" type:"integer" required:"true"` @@ -4000,8 +4436,8 @@ func (s *SetVariableAction) SetVariableName(v string) *SetVariableAction { return s } -// Sends information about the detector model instance and the event which triggered -// the action to an AWS SQS queue. +// Sends information about the detector model instance and the event that triggered +// the action to an Amazon SQS queue. type SqsAction struct { _ struct{} `type:"structure"` @@ -4010,7 +4446,7 @@ type SqsAction struct { // QueueUrl is a required field QueueUrl *string `locationName:"queueUrl" type:"string" required:"true"` - // Set this to TRUE if you want the data to be Base-64 encoded before it is + // Set this to TRUE if you want the data to be base-64 encoded before it is // written to the queue. Otherwise, set this to FALSE. UseBase64 *bool `locationName:"useBase64" type:"boolean"` } @@ -4054,15 +4490,15 @@ func (s *SqsAction) SetUseBase64(v bool) *SqsAction { type State struct { _ struct{} `type:"structure"` - // When entering this state, perform these "actions" if the "condition" is TRUE. + // When entering this state, perform these actions if the condition is TRUE. OnEnter *OnEnterLifecycle `locationName:"onEnter" type:"structure"` - // When exiting this state, perform these "actions" if the specified "condition" + // When exiting this state, perform these actions if the specified condition // is TRUE. OnExit *OnExitLifecycle `locationName:"onExit" type:"structure"` - // When an input is received and the "condition" is TRUE, perform the specified - // "actions". + // When an input is received and the condition is TRUE, perform the specified + // actions. OnInput *OnInputLifecycle `locationName:"onInput" type:"structure"` // The name of the state. @@ -4271,7 +4707,64 @@ func (s TagResourceOutput) GoString() string { return s.String() } -// Specifies the actions performed and the next state entered when a "condition" +// The request could not be completed due to throttling. +type ThrottlingException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ThrottlingException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ThrottlingException) GoString() string { + return s.String() +} + +func newErrorThrottlingException(v protocol.ResponseMetadata) error { + return &ThrottlingException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ThrottlingException) Code() string { + return "ThrottlingException" +} + +// Message returns the exception's message. +func (s ThrottlingException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ThrottlingException) OrigErr() error { + return nil +} + +func (s ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ThrottlingException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ThrottlingException) RequestID() string { + return s.respMetadata.RequestID +} + +// Specifies the actions performed and the next state entered when a condition // evaluates to TRUE. type TransitionEvent struct { _ struct{} `type:"structure"` @@ -4279,8 +4772,8 @@ type TransitionEvent struct { // The actions to be performed. Actions []*ActionData `locationName:"actions" type:"list"` - // [Required] A Boolean expression that when TRUE causes the actions to be performed - // and the "nextState" to be entered. + // Required. A Boolean expression that when TRUE causes the actions to be performed + // and the nextState to be entered. // // Condition is a required field Condition *string `locationName:"condition" type:"string" required:"true"` @@ -4362,6 +4855,63 @@ func (s *TransitionEvent) SetNextState(v string) *TransitionEvent { return s } +// The requested operation is not supported. +type UnsupportedOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The message for the exception. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedOperationException) GoString() string { + return s.String() +} + +func newErrorUnsupportedOperationException(v protocol.ResponseMetadata) error { + return &UnsupportedOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedOperationException) Code() string { + return "UnsupportedOperationException" +} + +// Message returns the exception's message. +func (s UnsupportedOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedOperationException) OrigErr() error { + return nil +} + +func (s UnsupportedOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedOperationException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -4447,6 +4997,10 @@ type UpdateDetectorModelInput struct { // DetectorModelName is a required field DetectorModelName *string `location:"uri" locationName:"detectorModelName" min:"1" type:"string" required:"true"` + // Information about the order in which events are evaluated and how actions + // are executed. + EvaluationMethod *string `locationName:"evaluationMethod" type:"string" enum:"EvaluationMethod"` + // The ARN of the role that grants permission to AWS IoT Events to perform its // operations. // @@ -4512,6 +5066,12 @@ func (s *UpdateDetectorModelInput) SetDetectorModelName(v string) *UpdateDetecto return s } +// SetEvaluationMethod sets the EvaluationMethod field's value. +func (s *UpdateDetectorModelInput) SetEvaluationMethod(v string) *UpdateDetectorModelInput { + s.EvaluationMethod = &v + return s +} + // SetRoleArn sets the RoleArn field's value. func (s *UpdateDetectorModelInput) SetRoleArn(v string) *UpdateDetectorModelInput { s.RoleArn = &v @@ -4656,6 +5216,14 @@ const ( DetectorModelVersionStatusFailed = "FAILED" ) +const ( + // EvaluationMethodBatch is a EvaluationMethod enum value + EvaluationMethodBatch = "BATCH" + + // EvaluationMethodSerial is a EvaluationMethod enum value + EvaluationMethodSerial = "SERIAL" +) + const ( // InputStatusCreating is a InputStatus enum value InputStatusCreating = "CREATING" diff --git a/vendor/github.com/aws/aws-sdk-go/service/iotevents/doc.go b/vendor/github.com/aws/aws-sdk-go/service/iotevents/doc.go index e1b69a693bb..96fb49ba7e5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iotevents/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iotevents/doc.go @@ -4,8 +4,8 @@ // requests to AWS IoT Events. // // AWS IoT Events monitors your equipment or device fleets for failures or changes -// in operation, and triggers actions when such events occur. AWS IoT Events -// API commands enable you to create, read, update and delete inputs and detector +// in operation, and triggers actions when such events occur. You can use AWS +// IoT Events API commands to create, read, update, and delete inputs and detector // models, and to list their versions. // // See https://docs.aws.amazon.com/goto/WebAPI/iotevents-2018-07-27 for more information on this service. diff --git a/vendor/github.com/aws/aws-sdk-go/service/iotevents/errors.go b/vendor/github.com/aws/aws-sdk-go/service/iotevents/errors.go index e36954c548f..b7a246810a3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iotevents/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iotevents/errors.go @@ -2,6 +2,10 @@ package iotevents +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInternalFailureException for service response error code @@ -58,3 +62,15 @@ const ( // The requested operation is not supported. ErrCodeUnsupportedOperationException = "UnsupportedOperationException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InternalFailureException": newErrorInternalFailureException, + "InvalidRequestException": newErrorInvalidRequestException, + "LimitExceededException": newErrorLimitExceededException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ServiceUnavailableException": newErrorServiceUnavailableException, + "ThrottlingException": newErrorThrottlingException, + "UnsupportedOperationException": newErrorUnsupportedOperationException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/iotevents/service.go b/vendor/github.com/aws/aws-sdk-go/service/iotevents/service.go index af03d02a01a..7dd170dd819 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/iotevents/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/iotevents/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "IoT Events" // Name of service. EndpointsID = "iotevents" // ID to lookup a service endpoint with. - ServiceID = "IoT Events" // ServiceID is a unique identifer of a specific service. + ServiceID = "IoT Events" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the IoTEvents client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a IoTEvents client from just a session. // svc := iotevents.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *IoTEvents { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "iotevents" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *IoTEvents { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *IoTEvents { svc := &IoTEvents{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-07-27", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/kafka/api.go b/vendor/github.com/aws/aws-sdk-go/service/kafka/api.go index bef73a71c73..620d2a10c85 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kafka/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kafka/api.go @@ -66,26 +66,26 @@ func (c *Kafka) CreateClusterRequest(input *CreateClusterInput) (req *request.Re // See the AWS API reference guide for Managed Streaming for Kafka's // API operation CreateCluster for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returns information about an error. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Returns information about an error. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/CreateCluster @@ -163,26 +163,26 @@ func (c *Kafka) CreateConfigurationRequest(input *CreateConfigurationInput) (req // See the AWS API reference guide for Managed Streaming for Kafka's // API operation CreateConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returns information about an error. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Returns information about an error. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/CreateConfiguration @@ -261,17 +261,17 @@ func (c *Kafka) DeleteClusterRequest(input *DeleteClusterInput) (req *request.Re // See the AWS API reference guide for Managed Streaming for Kafka's // API operation DeleteCluster for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/DeleteCluster @@ -350,20 +350,20 @@ func (c *Kafka) DescribeClusterRequest(input *DescribeClusterInput) (req *reques // See the AWS API reference guide for Managed Streaming for Kafka's // API operation DescribeCluster for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/DescribeCluster @@ -441,20 +441,20 @@ func (c *Kafka) DescribeClusterOperationRequest(input *DescribeClusterOperationI // See the AWS API reference guide for Managed Streaming for Kafka's // API operation DescribeClusterOperation for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/DescribeClusterOperation @@ -532,23 +532,23 @@ func (c *Kafka) DescribeConfigurationRequest(input *DescribeConfigurationInput) // See the AWS API reference guide for Managed Streaming for Kafka's // API operation DescribeConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Returns information about an error. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Returns information about an error. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/DescribeConfiguration @@ -626,23 +626,23 @@ func (c *Kafka) DescribeConfigurationRevisionRequest(input *DescribeConfiguratio // See the AWS API reference guide for Managed Streaming for Kafka's // API operation DescribeConfigurationRevision for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Returns information about an error. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Returns information about an error. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/DescribeConfigurationRevision @@ -720,20 +720,20 @@ func (c *Kafka) GetBootstrapBrokersRequest(input *GetBootstrapBrokersInput) (req // See the AWS API reference guide for Managed Streaming for Kafka's // API operation GetBootstrapBrokers for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Returns information about an error. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/GetBootstrapBrokers @@ -818,17 +818,17 @@ func (c *Kafka) ListClusterOperationsRequest(input *ListClusterOperationsInput) // See the AWS API reference guide for Managed Streaming for Kafka's // API operation ListClusterOperations for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/ListClusterOperations @@ -896,10 +896,12 @@ func (c *Kafka) ListClusterOperationsPagesWithContext(ctx aws.Context, input *Li }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListClusterOperationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListClusterOperationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -962,17 +964,17 @@ func (c *Kafka) ListClustersRequest(input *ListClustersInput) (req *request.Requ // See the AWS API reference guide for Managed Streaming for Kafka's // API operation ListClusters for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/ListClusters @@ -1040,10 +1042,12 @@ func (c *Kafka) ListClustersPagesWithContext(ctx aws.Context, input *ListCluster }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListClustersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListClustersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1097,7 +1101,7 @@ func (c *Kafka) ListConfigurationRevisionsRequest(input *ListConfigurationRevisi // ListConfigurationRevisions API operation for Managed Streaming for Kafka. // -// Returns a list of all the MSK configurations in this Region. +// Returns a list of all the revisions of an MSK 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 @@ -1106,23 +1110,23 @@ func (c *Kafka) ListConfigurationRevisionsRequest(input *ListConfigurationRevisi // See the AWS API reference guide for Managed Streaming for Kafka's // API operation ListConfigurationRevisions for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Returns information about an error. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Returns information about an error. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/ListConfigurationRevisions @@ -1190,10 +1194,12 @@ func (c *Kafka) ListConfigurationRevisionsPagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListConfigurationRevisionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListConfigurationRevisionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1256,20 +1262,20 @@ func (c *Kafka) ListConfigurationsRequest(input *ListConfigurationsInput) (req * // See the AWS API reference guide for Managed Streaming for Kafka's // API operation ListConfigurations for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/ListConfigurations @@ -1337,10 +1343,158 @@ func (c *Kafka) ListConfigurationsPagesWithContext(ctx aws.Context, input *ListC }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListConfigurationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListConfigurationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListKafkaVersions = "ListKafkaVersions" + +// ListKafkaVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListKafkaVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListKafkaVersions for more information on using the ListKafkaVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListKafkaVersionsRequest method. +// req, resp := client.ListKafkaVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/ListKafkaVersions +func (c *Kafka) ListKafkaVersionsRequest(input *ListKafkaVersionsInput) (req *request.Request, output *ListKafkaVersionsOutput) { + op := &request.Operation{ + Name: opListKafkaVersions, + HTTPMethod: "GET", + HTTPPath: "/v1/kafka-versions", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListKafkaVersionsInput{} + } + + output = &ListKafkaVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListKafkaVersions API operation for Managed Streaming for Kafka. +// +// Returns a list of Kafka 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 Managed Streaming for Kafka's +// API operation ListKafkaVersions for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Returns information about an error. +// +// * UnauthorizedException +// Returns information about an error. +// +// * InternalServerErrorException +// Returns information about an error. +// +// * ForbiddenException +// Returns information about an error. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/ListKafkaVersions +func (c *Kafka) ListKafkaVersions(input *ListKafkaVersionsInput) (*ListKafkaVersionsOutput, error) { + req, out := c.ListKafkaVersionsRequest(input) + return out, req.Send() +} + +// ListKafkaVersionsWithContext is the same as ListKafkaVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListKafkaVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Kafka) ListKafkaVersionsWithContext(ctx aws.Context, input *ListKafkaVersionsInput, opts ...request.Option) (*ListKafkaVersionsOutput, error) { + req, out := c.ListKafkaVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListKafkaVersionsPages iterates over the pages of a ListKafkaVersions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListKafkaVersions 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 ListKafkaVersions operation. +// pageNum := 0 +// err := client.ListKafkaVersionsPages(params, +// func(page *kafka.ListKafkaVersionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Kafka) ListKafkaVersionsPages(input *ListKafkaVersionsInput, fn func(*ListKafkaVersionsOutput, bool) bool) error { + return c.ListKafkaVersionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListKafkaVersionsPagesWithContext same as ListKafkaVersionsPages 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 *Kafka) ListKafkaVersionsPagesWithContext(ctx aws.Context, input *ListKafkaVersionsInput, fn func(*ListKafkaVersionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListKafkaVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListKafkaVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListKafkaVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1403,17 +1557,17 @@ func (c *Kafka) ListNodesRequest(input *ListNodesInput) (req *request.Request, o // See the AWS API reference guide for Managed Streaming for Kafka's // API operation ListNodes for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/ListNodes @@ -1481,10 +1635,12 @@ func (c *Kafka) ListNodesPagesWithContext(ctx aws.Context, input *ListNodesInput }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListNodesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListNodesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1541,14 +1697,14 @@ func (c *Kafka) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req // See the AWS API reference guide for Managed Streaming for Kafka's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/ListTagsForResource @@ -1627,14 +1783,14 @@ func (c *Kafka) TagResourceRequest(input *TagResourceInput) (req *request.Reques // See the AWS API reference guide for Managed Streaming for Kafka's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/TagResource @@ -1713,14 +1869,14 @@ func (c *Kafka) UntagResourceRequest(input *UntagResourceInput) (req *request.Re // See the AWS API reference guide for Managed Streaming for Kafka's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/UntagResource @@ -1745,6 +1901,99 @@ func (c *Kafka) UntagResourceWithContext(ctx aws.Context, input *UntagResourceIn return out, req.Send() } +const opUpdateBrokerCount = "UpdateBrokerCount" + +// UpdateBrokerCountRequest generates a "aws/request.Request" representing the +// client's request for the UpdateBrokerCount operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateBrokerCount for more information on using the UpdateBrokerCount +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateBrokerCountRequest method. +// req, resp := client.UpdateBrokerCountRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/UpdateBrokerCount +func (c *Kafka) UpdateBrokerCountRequest(input *UpdateBrokerCountInput) (req *request.Request, output *UpdateBrokerCountOutput) { + op := &request.Operation{ + Name: opUpdateBrokerCount, + HTTPMethod: "PUT", + HTTPPath: "/v1/clusters/{clusterArn}/nodes/count", + } + + if input == nil { + input = &UpdateBrokerCountInput{} + } + + output = &UpdateBrokerCountOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateBrokerCount API operation for Managed Streaming for Kafka. +// +// Updates the number of broker nodes in the cluster. You can use this operation +// to increase the number of brokers in an existing cluster. You can't decrease +// the number of brokers. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Managed Streaming for Kafka's +// API operation UpdateBrokerCount for usage and error information. +// +// Returned Error Types: +// * ServiceUnavailableException +// Returns information about an error. +// +// * BadRequestException +// Returns information about an error. +// +// * UnauthorizedException +// Returns information about an error. +// +// * InternalServerErrorException +// Returns information about an error. +// +// * ForbiddenException +// Returns information about an error. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/UpdateBrokerCount +func (c *Kafka) UpdateBrokerCount(input *UpdateBrokerCountInput) (*UpdateBrokerCountOutput, error) { + req, out := c.UpdateBrokerCountRequest(input) + return out, req.Send() +} + +// UpdateBrokerCountWithContext is the same as UpdateBrokerCount with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateBrokerCount for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Kafka) UpdateBrokerCountWithContext(ctx aws.Context, input *UpdateBrokerCountInput, opts ...request.Option) (*UpdateBrokerCountOutput, error) { + req, out := c.UpdateBrokerCountRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opUpdateBrokerStorage = "UpdateBrokerStorage" // UpdateBrokerStorageRequest generates a "aws/request.Request" representing the @@ -1798,20 +2047,20 @@ func (c *Kafka) UpdateBrokerStorageRequest(input *UpdateBrokerStorageInput) (req // See the AWS API reference guide for Managed Streaming for Kafka's // API operation UpdateBrokerStorage for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/UpdateBrokerStorage @@ -1890,23 +2139,23 @@ func (c *Kafka) UpdateClusterConfigurationRequest(input *UpdateClusterConfigurat // See the AWS API reference guide for Managed Streaming for Kafka's // API operation UpdateClusterConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Returns information about an error. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Returns information about an error. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/UpdateClusterConfiguration @@ -1931,25 +2180,176 @@ func (c *Kafka) UpdateClusterConfigurationWithContext(ctx aws.Context, input *Up return out, req.Send() } -// Specifies the EBS volume upgrade information. The broker identifier must -// be set to the keyword ALL. This means the changes apply to all the brokers -// in the cluster. -type BrokerEBSVolumeInfo struct { - _ struct{} `type:"structure"` +const opUpdateMonitoring = "UpdateMonitoring" - // The ID of the broker to update. - // - // KafkaBrokerNodeId is a required field - KafkaBrokerNodeId *string `locationName:"kafkaBrokerNodeId" type:"string" required:"true"` +// UpdateMonitoringRequest generates a "aws/request.Request" representing the +// client's request for the UpdateMonitoring operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateMonitoring for more information on using the UpdateMonitoring +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateMonitoringRequest method. +// req, resp := client.UpdateMonitoringRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/UpdateMonitoring +func (c *Kafka) UpdateMonitoringRequest(input *UpdateMonitoringInput) (req *request.Request, output *UpdateMonitoringOutput) { + op := &request.Operation{ + Name: opUpdateMonitoring, + HTTPMethod: "PUT", + HTTPPath: "/v1/clusters/{clusterArn}/monitoring", + } - // Size of the EBS volume to update. - // - // VolumeSizeGB is a required field - VolumeSizeGB *int64 `locationName:"volumeSizeGB" type:"integer" required:"true"` + if input == nil { + input = &UpdateMonitoringInput{} + } + + output = &UpdateMonitoringOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateMonitoring API operation for Managed Streaming for Kafka. +// +// Updates the monitoring settings for the cluster. You can use this operation +// to specify which Apache Kafka metrics you want Amazon MSK to send to Amazon +// CloudWatch. You can also specify settings for open monitoring with Prometheus. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Managed Streaming for Kafka's +// API operation UpdateMonitoring for usage and error information. +// +// Returned Error Types: +// * ServiceUnavailableException +// Returns information about an error. +// +// * BadRequestException +// Returns information about an error. +// +// * UnauthorizedException +// Returns information about an error. +// +// * InternalServerErrorException +// Returns information about an error. +// +// * ForbiddenException +// Returns information about an error. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kafka-2018-11-14/UpdateMonitoring +func (c *Kafka) UpdateMonitoring(input *UpdateMonitoringInput) (*UpdateMonitoringOutput, error) { + req, out := c.UpdateMonitoringRequest(input) + return out, req.Send() +} + +// UpdateMonitoringWithContext is the same as UpdateMonitoring with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateMonitoring for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Kafka) UpdateMonitoringWithContext(ctx aws.Context, input *UpdateMonitoringInput, opts ...request.Option) (*UpdateMonitoringOutput, error) { + req, out := c.UpdateMonitoringRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Returns information about an error. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + InvalidParameter *string `locationName:"invalidParameter" type:"string"` + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s BrokerEBSVolumeInfo) String() string { +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// Specifies the EBS volume upgrade information. The broker identifier must +// be set to the keyword ALL. This means the changes apply to all the brokers +// in the cluster. +type BrokerEBSVolumeInfo struct { + _ struct{} `type:"structure"` + + // The ID of the broker to update. + // + // KafkaBrokerNodeId is a required field + KafkaBrokerNodeId *string `locationName:"kafkaBrokerNodeId" type:"string" required:"true"` + + // Size of the EBS volume to update. + // + // VolumeSizeGB is a required field + VolumeSizeGB *int64 `locationName:"volumeSizeGB" type:"integer" required:"true"` +} + +// String returns the string representation +func (s BrokerEBSVolumeInfo) String() string { return awsutil.Prettify(s) } @@ -1986,6 +2386,74 @@ func (s *BrokerEBSVolumeInfo) SetVolumeSizeGB(v int64) *BrokerEBSVolumeInfo { return s } +// The broker logs configuration for this MSK cluster. +type BrokerLogs struct { + _ struct{} `type:"structure"` + + // Details of the CloudWatch Logs destination for broker logs. + CloudWatchLogs *CloudWatchLogs `locationName:"cloudWatchLogs" type:"structure"` + + // Details of the Kinesis Data Firehose delivery stream that is the destination + // for broker logs. + Firehose *Firehose `locationName:"firehose" type:"structure"` + + // Details of the Amazon S3 destination for broker logs. + S3 *S3 `locationName:"s3" type:"structure"` +} + +// String returns the string representation +func (s BrokerLogs) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BrokerLogs) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BrokerLogs) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BrokerLogs"} + if s.CloudWatchLogs != nil { + if err := s.CloudWatchLogs.Validate(); err != nil { + invalidParams.AddNested("CloudWatchLogs", err.(request.ErrInvalidParams)) + } + } + if s.Firehose != nil { + if err := s.Firehose.Validate(); err != nil { + invalidParams.AddNested("Firehose", err.(request.ErrInvalidParams)) + } + } + if s.S3 != nil { + if err := s.S3.Validate(); err != nil { + invalidParams.AddNested("S3", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCloudWatchLogs sets the CloudWatchLogs field's value. +func (s *BrokerLogs) SetCloudWatchLogs(v *CloudWatchLogs) *BrokerLogs { + s.CloudWatchLogs = v + return s +} + +// SetFirehose sets the Firehose field's value. +func (s *BrokerLogs) SetFirehose(v *Firehose) *BrokerLogs { + s.Firehose = v + return s +} + +// SetS3 sets the S3 field's value. +func (s *BrokerLogs) SetS3(v *S3) *BrokerLogs { + s.S3 = v + return s +} + // Describes the setup to be used for Kafka broker nodes in the cluster. type BrokerNodeGroupInfo struct { _ struct{} `type:"structure"` @@ -2002,8 +2470,8 @@ type BrokerNodeGroupInfo struct { ClientSubnets []*string `locationName:"clientSubnets" type:"list" required:"true"` // The type of Amazon EC2 instances to use for Kafka brokers. The following - // instance types are allowed: kafka.m5.large, kafka.m5.xlarge, kafka.m5.2xlarge,kafka.m5.4xlarge, - // kafka.m5.12xlarge, and kafka.m5.24xlarge. + // instance types are allowed: kafka.m5.large, kafka.m5.xlarge, kafka.m5.2xlarge, + // kafka.m5.4xlarge, kafka.m5.12xlarge, and kafka.m5.24xlarge. // // InstanceType is a required field InstanceType *string `locationName:"instanceType" min:"5" type:"string" required:"true"` @@ -2011,7 +2479,9 @@ type BrokerNodeGroupInfo struct { // The AWS security groups to associate with the elastic network interfaces // in order to specify who can connect to and communicate with the Amazon MSK // cluster. If you don't specify a security group, Amazon MSK uses the default - // security group associated with the VPC. + // security group associated with the VPC. If you specify security groups that + // were shared with you, you must ensure that you have permissions to them. + // Specifically, you need the ec2:DescribeSecurityGroups permission. SecurityGroups []*string `locationName:"securityGroups" type:"list"` // Contains information about storage volumes attached to MSK broker nodes. @@ -2220,6 +2690,54 @@ func (s *ClientAuthentication) SetTls(v *Tls) *ClientAuthentication { return s } +// Details of the CloudWatch Logs destination for broker logs. +type CloudWatchLogs struct { + _ struct{} `type:"structure"` + + // Specifies whether broker logs get sent to the specified CloudWatch Logs destination. + // + // Enabled is a required field + Enabled *bool `locationName:"enabled" type:"boolean" required:"true"` + + // The CloudWatch log group that is the destination for broker logs. + LogGroup *string `locationName:"logGroup" type:"string"` +} + +// String returns the string representation +func (s CloudWatchLogs) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudWatchLogs) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CloudWatchLogs) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CloudWatchLogs"} + 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 *CloudWatchLogs) SetEnabled(v bool) *CloudWatchLogs { + s.Enabled = &v + return s +} + +// SetLogGroup sets the LogGroup field's value. +func (s *CloudWatchLogs) SetLogGroup(v string) *CloudWatchLogs { + s.LogGroup = &v + return s +} + // Returns information about a cluster. type ClusterInfo struct { _ struct{} `type:"structure"` @@ -2246,7 +2764,9 @@ type ClusterInfo struct { // brokers in the cluster. CurrentBrokerSoftwareInfo *BrokerSoftwareInfo `locationName:"currentBrokerSoftwareInfo" type:"structure"` - // The current version of the MSK cluster. + // The current version of the MSK cluster. Cluster versions aren't simple integers. + // You can obtain the current version by describing the cluster. An example + // version is KTVPDKIKX0DER. CurrentVersion *string `locationName:"currentVersion" type:"string"` // Includes all encryption-related information. @@ -2258,9 +2778,17 @@ type ClusterInfo struct { // see Monitoring (https://docs.aws.amazon.com/msk/latest/developerguide/monitoring.html). EnhancedMonitoring *string `locationName:"enhancedMonitoring" type:"string" enum:"EnhancedMonitoring"` + // You can configure your MSK cluster to send broker logs to different destination + // types. This is a container for the configuration details related to broker + // logs. + LoggingInfo *LoggingInfo `locationName:"loggingInfo" type:"structure"` + // The number of broker nodes in the cluster. NumberOfBrokerNodes *int64 `locationName:"numberOfBrokerNodes" type:"integer"` + // Settings for open monitoring using Prometheus. + OpenMonitoring *OpenMonitoring `locationName:"openMonitoring" type:"structure"` + // The state of the cluster. The possible states are CREATING, ACTIVE, and FAILED. State *string `locationName:"state" type:"string" enum:"ClusterState"` @@ -2341,12 +2869,24 @@ func (s *ClusterInfo) SetEnhancedMonitoring(v string) *ClusterInfo { return s } +// SetLoggingInfo sets the LoggingInfo field's value. +func (s *ClusterInfo) SetLoggingInfo(v *LoggingInfo) *ClusterInfo { + s.LoggingInfo = v + return s +} + // SetNumberOfBrokerNodes sets the NumberOfBrokerNodes field's value. func (s *ClusterInfo) SetNumberOfBrokerNodes(v int64) *ClusterInfo { s.NumberOfBrokerNodes = &v return s } +// SetOpenMonitoring sets the OpenMonitoring field's value. +func (s *ClusterInfo) SetOpenMonitoring(v *OpenMonitoring) *ClusterInfo { + s.OpenMonitoring = v + return s +} + // SetState sets the State field's value. func (s *ClusterInfo) SetState(v string) *ClusterInfo { s.State = &v @@ -2499,7 +3039,8 @@ type Configuration struct { // LatestRevision is a required field LatestRevision *ConfigurationRevision `locationName:"latestRevision" type:"structure" required:"true"` - // The name of the configuration. + // The name of the configuration. Configuration names are strings that match + // the regex "^[0-9A-Za-z-]+$". // // Name is a required field Name *string `locationName:"name" type:"string" required:"true"` @@ -2650,6 +3191,64 @@ func (s *ConfigurationRevision) SetRevision(v int64) *ConfigurationRevision { return s } +// Returns information about an error. +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + InvalidParameter *string `locationName:"invalidParameter" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictException) GoString() string { + return s.String() +} + +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" +} + +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil +} + +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID +} + // Creates a cluster. type CreateClusterInput struct { _ struct{} `type:"structure"` @@ -2667,8 +3266,7 @@ type CreateClusterInput struct { // ClusterName is a required field ClusterName *string `locationName:"clusterName" min:"1" type:"string" required:"true"` - // Represents the configuration that you want MSK to use for the brokers in - // a cluster. + // Represents the configuration that you want MSK to use for the cluster. ConfigurationInfo *ConfigurationInfo `locationName:"configurationInfo" type:"structure"` // Includes all encryption-related information. @@ -2683,11 +3281,17 @@ type CreateClusterInput struct { // KafkaVersion is a required field KafkaVersion *string `locationName:"kafkaVersion" min:"1" type:"string" required:"true"` + // LoggingInfo details. + LoggingInfo *LoggingInfo `locationName:"loggingInfo" type:"structure"` + // The number of Kafka broker nodes in the Amazon MSK cluster. // // NumberOfBrokerNodes is a required field NumberOfBrokerNodes *int64 `locationName:"numberOfBrokerNodes" min:"1" type:"integer" required:"true"` + // The settings for open monitoring. + OpenMonitoring *OpenMonitoringInfo `locationName:"openMonitoring" type:"structure"` + // Create tags when creating the cluster. Tags map[string]*string `locationName:"tags" type:"map"` } @@ -2741,6 +3345,16 @@ func (s *CreateClusterInput) Validate() error { invalidParams.AddNested("EncryptionInfo", err.(request.ErrInvalidParams)) } } + if s.LoggingInfo != nil { + if err := s.LoggingInfo.Validate(); err != nil { + invalidParams.AddNested("LoggingInfo", err.(request.ErrInvalidParams)) + } + } + if s.OpenMonitoring != nil { + if err := s.OpenMonitoring.Validate(); err != nil { + invalidParams.AddNested("OpenMonitoring", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -2790,12 +3404,24 @@ func (s *CreateClusterInput) SetKafkaVersion(v string) *CreateClusterInput { return s } +// SetLoggingInfo sets the LoggingInfo field's value. +func (s *CreateClusterInput) SetLoggingInfo(v *LoggingInfo) *CreateClusterInput { + s.LoggingInfo = v + return s +} + // SetNumberOfBrokerNodes sets the NumberOfBrokerNodes field's value. func (s *CreateClusterInput) SetNumberOfBrokerNodes(v int64) *CreateClusterInput { s.NumberOfBrokerNodes = &v return s } +// SetOpenMonitoring sets the OpenMonitoring field's value. +func (s *CreateClusterInput) SetOpenMonitoring(v *OpenMonitoringInfo) *CreateClusterInput { + s.OpenMonitoring = v + return s +} + // SetTags sets the Tags field's value. func (s *CreateClusterInput) SetTags(v map[string]*string) *CreateClusterInput { s.Tags = v @@ -2856,7 +3482,8 @@ type CreateConfigurationInput struct { // KafkaVersions is a required field KafkaVersions []*string `locationName:"kafkaVersions" type:"list" required:"true"` - // The name of the configuration. + // The name of the configuration. Configuration names are strings that match + // the regex "^[0-9A-Za-z-]+$". // // Name is a required field Name *string `locationName:"name" type:"string" required:"true"` @@ -2933,7 +3560,8 @@ type CreateConfigurationOutput struct { // Latest revision of the configuration. LatestRevision *ConfigurationRevision `locationName:"latestRevision" type:"structure"` - // The name of the configuration. + // The name of the configuration. Configuration names are strings that match + // the regex "^[0-9A-Za-z-]+$". Name *string `locationName:"name" type:"string"` } @@ -3235,7 +3863,8 @@ type DescribeConfigurationOutput struct { // Latest revision of the configuration. LatestRevision *ConfigurationRevision `locationName:"latestRevision" type:"structure"` - // The name of the configuration. + // The name of the configuration. Configuration names are strings that match + // the regex "^[0-9A-Za-z-]+$". Name *string `locationName:"name" type:"string"` } @@ -3479,7 +4108,7 @@ type EncryptionInTransit struct { _ struct{} `type:"structure"` // Indicates the encryption setting for data in transit between clients and - // brokers. The following are the possible values. + // brokers. You must set it to one of the following values. // // TLS means that client-broker communication is enabled with TLS only. // @@ -3489,7 +4118,7 @@ type EncryptionInTransit struct { // PLAINTEXT means that client-broker communication is enabled in plaintext // only. // - // The default value is TLS_PLAINTEXT. + // The default value is TLS. ClientBroker *string `locationName:"clientBroker" type:"string" enum:"ClientBroker"` // When set to true, it indicates that data communication among the broker nodes @@ -3605,6 +4234,114 @@ func (s *ErrorInfo) SetErrorString(v string) *ErrorInfo { return s } +// Firehose details for BrokerLogs. +type Firehose struct { + _ struct{} `type:"structure"` + + // The Kinesis Data Firehose delivery stream that is the destination for broker + // logs. + DeliveryStream *string `locationName:"deliveryStream" type:"string"` + + // Specifies whether broker logs get sent to the specified Kinesis Data Firehose + // delivery stream. + // + // Enabled is a required field + Enabled *bool `locationName:"enabled" type:"boolean" required:"true"` +} + +// String returns the string representation +func (s Firehose) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Firehose) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Firehose) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Firehose"} + if s.Enabled == nil { + invalidParams.Add(request.NewErrParamRequired("Enabled")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDeliveryStream sets the DeliveryStream field's value. +func (s *Firehose) SetDeliveryStream(v string) *Firehose { + s.DeliveryStream = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *Firehose) SetEnabled(v bool) *Firehose { + s.Enabled = &v + return s +} + +// Returns information about an error. +type ForbiddenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + InvalidParameter *string `locationName:"invalidParameter" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ForbiddenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ForbiddenException) GoString() string { + return s.String() +} + +func newErrorForbiddenException(v protocol.ResponseMetadata) error { + return &ForbiddenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ForbiddenException) Code() string { + return "ForbiddenException" +} + +// Message returns the exception's message. +func (s ForbiddenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ForbiddenException) OrigErr() error { + return nil +} + +func (s ForbiddenException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ForbiddenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ForbiddenException) RequestID() string { + return s.respMetadata.RequestID +} + type GetBootstrapBrokersInput struct { _ struct{} `type:"structure"` @@ -3651,7 +4388,9 @@ type GetBootstrapBrokersOutput struct { // A string containing one or more hostname:port pairs. BootstrapBrokerString *string `locationName:"bootstrapBrokerString" type:"string"` - // A string containing one or more DNS names (or IP) and TLS port pairs. + // A string containing one or more DNS names (or IP) and TLS port pairs. The + // following is an example. + // { "BootstrapBrokerStringTls": "b-3.exampleClusterName.abcde.c2.kafka.us-east-1.amazonaws.com:9094,b-1.exampleClusterName.abcde.c2.kafka.us-east-1.amazonaws.com:9094,b-2.exampleClusterName.abcde.c2.kafka.us-east-1.amazonaws.com:9094"} BootstrapBrokerStringTls *string `locationName:"bootstrapBrokerStringTls" type:"string"` } @@ -3677,65 +4416,221 @@ func (s *GetBootstrapBrokersOutput) SetBootstrapBrokerStringTls(v string) *GetBo return s } -type ListClusterOperationsInput struct { - _ struct{} `type:"structure"` - - // ClusterArn is a required field - ClusterArn *string `location:"uri" locationName:"clusterArn" type:"string" required:"true"` +// Returns information about an error. +type InternalServerErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + InvalidParameter *string `locationName:"invalidParameter" type:"string"` - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListClusterOperationsInput) String() string { +func (s InternalServerErrorException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListClusterOperationsInput) GoString() string { +func (s InternalServerErrorException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListClusterOperationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListClusterOperationsInput"} - if s.ClusterArn == nil { - invalidParams.Add(request.NewErrParamRequired("ClusterArn")) - } - if s.ClusterArn != nil && len(*s.ClusterArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClusterArn", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func newErrorInternalServerErrorException(v protocol.ResponseMetadata) error { + return &InternalServerErrorException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InternalServerErrorException) Code() string { + return "InternalServerErrorException" +} + +// Message returns the exception's message. +func (s InternalServerErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerErrorException) OrigErr() error { return nil } -// SetClusterArn sets the ClusterArn field's value. -func (s *ListClusterOperationsInput) SetClusterArn(v string) *ListClusterOperationsInput { - s.ClusterArn = &v - return s +func (s InternalServerErrorException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetMaxResults sets the MaxResults field's value. -func (s *ListClusterOperationsInput) SetMaxResults(v int64) *ListClusterOperationsInput { - s.MaxResults = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerErrorException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetNextToken sets the NextToken field's value. -func (s *ListClusterOperationsInput) SetNextToken(v string) *ListClusterOperationsInput { - s.NextToken = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InternalServerErrorException) RequestID() string { + return s.respMetadata.RequestID } -// The response contains an array containing cluster operation information and +// Indicates whether you want to enable or disable the JMX Exporter. +type JmxExporter struct { + _ struct{} `type:"structure"` + + // Indicates whether you want to enable or disable the JMX Exporter. + // + // EnabledInBroker is a required field + EnabledInBroker *bool `locationName:"enabledInBroker" type:"boolean" required:"true"` +} + +// String returns the string representation +func (s JmxExporter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s JmxExporter) GoString() string { + return s.String() +} + +// SetEnabledInBroker sets the EnabledInBroker field's value. +func (s *JmxExporter) SetEnabledInBroker(v bool) *JmxExporter { + s.EnabledInBroker = &v + return s +} + +// Indicates whether you want to enable or disable the JMX Exporter. +type JmxExporterInfo struct { + _ struct{} `type:"structure"` + + // JMX Exporter being enabled in broker. + // + // EnabledInBroker is a required field + EnabledInBroker *bool `locationName:"enabledInBroker" type:"boolean" required:"true"` +} + +// String returns the string representation +func (s JmxExporterInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s JmxExporterInfo) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *JmxExporterInfo) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "JmxExporterInfo"} + if s.EnabledInBroker == nil { + invalidParams.Add(request.NewErrParamRequired("EnabledInBroker")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEnabledInBroker sets the EnabledInBroker field's value. +func (s *JmxExporterInfo) SetEnabledInBroker(v bool) *JmxExporterInfo { + s.EnabledInBroker = &v + return s +} + +// Information about a Kafka version. +type KafkaVersion struct { + _ struct{} `type:"structure"` + + // The status of the Apache Kafka version. + Status *string `locationName:"status" type:"string" enum:"KafkaVersionStatus"` + + // The Kafka version. + Version *string `locationName:"version" type:"string"` +} + +// String returns the string representation +func (s KafkaVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KafkaVersion) GoString() string { + return s.String() +} + +// SetStatus sets the Status field's value. +func (s *KafkaVersion) SetStatus(v string) *KafkaVersion { + s.Status = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *KafkaVersion) SetVersion(v string) *KafkaVersion { + s.Version = &v + return s +} + +type ListClusterOperationsInput struct { + _ struct{} `type:"structure"` + + // ClusterArn is a required field + ClusterArn *string `location:"uri" locationName:"clusterArn" type:"string" required:"true"` + + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListClusterOperationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListClusterOperationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListClusterOperationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListClusterOperationsInput"} + if s.ClusterArn == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterArn")) + } + if s.ClusterArn != nil && len(*s.ClusterArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterArn", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterArn sets the ClusterArn field's value. +func (s *ListClusterOperationsInput) SetClusterArn(v string) *ListClusterOperationsInput { + s.ClusterArn = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListClusterOperationsInput) SetMaxResults(v int64) *ListClusterOperationsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListClusterOperationsInput) SetNextToken(v string) *ListClusterOperationsInput { + s.NextToken = &v + return s +} + +// The response contains an array containing cluster operation information and // a next token if the response is truncated. type ListClusterOperationsOutput struct { _ struct{} `type:"structure"` @@ -4028,6 +4923,82 @@ func (s *ListConfigurationsOutput) SetNextToken(v string) *ListConfigurationsOut return s } +type ListKafkaVersionsInput struct { + _ struct{} `type:"structure"` + + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListKafkaVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListKafkaVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListKafkaVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListKafkaVersionsInput"} + 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 *ListKafkaVersionsInput) SetMaxResults(v int64) *ListKafkaVersionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListKafkaVersionsInput) SetNextToken(v string) *ListKafkaVersionsInput { + s.NextToken = &v + return s +} + +// Response for ListKafkaVersions. +type ListKafkaVersionsOutput struct { + _ struct{} `type:"structure"` + + // An array of Kafka version objects. + KafkaVersions []*KafkaVersion `locationName:"kafkaVersions" type:"list"` + + // Paginated results marker. + NextToken *string `locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListKafkaVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListKafkaVersionsOutput) GoString() string { + return s.String() +} + +// SetKafkaVersions sets the KafkaVersions field's value. +func (s *ListKafkaVersionsOutput) SetKafkaVersions(v []*KafkaVersion) *ListKafkaVersionsOutput { + s.KafkaVersions = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListKafkaVersionsOutput) SetNextToken(v string) *ListKafkaVersionsOutput { + s.NextToken = &v + return s +} + type ListNodesInput struct { _ struct{} `type:"structure"` @@ -4184,6 +5155,53 @@ func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForRe return s } +// You can configure your MSK cluster to send broker logs to different destination +// types. This is a container for the configuration details related to broker +// logs. +type LoggingInfo struct { + _ struct{} `type:"structure"` + + // You can configure your MSK cluster to send broker logs to different destination + // types. This configuration specifies the details of these destinations. + // + // BrokerLogs is a required field + BrokerLogs *BrokerLogs `locationName:"brokerLogs" type:"structure" 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.BrokerLogs == nil { + invalidParams.Add(request.NewErrParamRequired("BrokerLogs")) + } + if s.BrokerLogs != nil { + if err := s.BrokerLogs.Validate(); err != nil { + invalidParams.AddNested("BrokerLogs", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBrokerLogs sets the BrokerLogs field's value. +func (s *LoggingInfo) SetBrokerLogs(v *BrokerLogs) *LoggingInfo { + s.BrokerLogs = v + return s +} + // Information about cluster attributes that can be updated via update APIs. type MutableClusterInfo struct { _ struct{} `type:"structure"` @@ -4194,8 +5212,18 @@ type MutableClusterInfo struct { // Information about the changes in the configuration of the brokers. ConfigurationInfo *ConfigurationInfo `locationName:"configurationInfo" type:"structure"` + // Specifies which Apache Kafka metrics Amazon MSK gathers and sends to Amazon + // CloudWatch for this cluster. + EnhancedMonitoring *string `locationName:"enhancedMonitoring" type:"string" enum:"EnhancedMonitoring"` + + // LoggingInfo details. + LoggingInfo *LoggingInfo `locationName:"loggingInfo" type:"structure"` + // The number of broker nodes in the cluster. NumberOfBrokerNodes *int64 `locationName:"numberOfBrokerNodes" type:"integer"` + + // Settings for open monitoring using Prometheus. + OpenMonitoring *OpenMonitoring `locationName:"openMonitoring" type:"structure"` } // String returns the string representation @@ -4220,12 +5248,95 @@ func (s *MutableClusterInfo) SetConfigurationInfo(v *ConfigurationInfo) *Mutable return s } +// SetEnhancedMonitoring sets the EnhancedMonitoring field's value. +func (s *MutableClusterInfo) SetEnhancedMonitoring(v string) *MutableClusterInfo { + s.EnhancedMonitoring = &v + return s +} + +// SetLoggingInfo sets the LoggingInfo field's value. +func (s *MutableClusterInfo) SetLoggingInfo(v *LoggingInfo) *MutableClusterInfo { + s.LoggingInfo = v + return s +} + // SetNumberOfBrokerNodes sets the NumberOfBrokerNodes field's value. func (s *MutableClusterInfo) SetNumberOfBrokerNodes(v int64) *MutableClusterInfo { s.NumberOfBrokerNodes = &v return s } +// SetOpenMonitoring sets the OpenMonitoring field's value. +func (s *MutableClusterInfo) SetOpenMonitoring(v *OpenMonitoring) *MutableClusterInfo { + s.OpenMonitoring = v + return s +} + +// Indicates whether you want to enable or disable the Node Exporter. +type NodeExporter struct { + _ struct{} `type:"structure"` + + // Indicates whether you want to enable or disable the Node Exporter. + // + // EnabledInBroker is a required field + EnabledInBroker *bool `locationName:"enabledInBroker" type:"boolean" required:"true"` +} + +// String returns the string representation +func (s NodeExporter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NodeExporter) GoString() string { + return s.String() +} + +// SetEnabledInBroker sets the EnabledInBroker field's value. +func (s *NodeExporter) SetEnabledInBroker(v bool) *NodeExporter { + s.EnabledInBroker = &v + return s +} + +// Indicates whether you want to enable or disable the Node Exporter. +type NodeExporterInfo struct { + _ struct{} `type:"structure"` + + // Node Exporter being enabled in broker. + // + // EnabledInBroker is a required field + EnabledInBroker *bool `locationName:"enabledInBroker" type:"boolean" required:"true"` +} + +// String returns the string representation +func (s NodeExporterInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NodeExporterInfo) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *NodeExporterInfo) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "NodeExporterInfo"} + if s.EnabledInBroker == nil { + invalidParams.Add(request.NewErrParamRequired("EnabledInBroker")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEnabledInBroker sets the EnabledInBroker field's value. +func (s *NodeExporterInfo) SetEnabledInBroker(v bool) *NodeExporterInfo { + s.EnabledInBroker = &v + return s +} + // The node information object. type NodeInfo struct { _ struct{} `type:"structure"` @@ -4271,28 +5382,357 @@ func (s *NodeInfo) SetBrokerNodeInfo(v *BrokerNodeInfo) *NodeInfo { return s } -// SetInstanceType sets the InstanceType field's value. -func (s *NodeInfo) SetInstanceType(v string) *NodeInfo { - s.InstanceType = &v - return s +// SetInstanceType sets the InstanceType field's value. +func (s *NodeInfo) SetInstanceType(v string) *NodeInfo { + s.InstanceType = &v + return s +} + +// SetNodeARN sets the NodeARN field's value. +func (s *NodeInfo) SetNodeARN(v string) *NodeInfo { + s.NodeARN = &v + return s +} + +// SetNodeType sets the NodeType field's value. +func (s *NodeInfo) SetNodeType(v string) *NodeInfo { + s.NodeType = &v + return s +} + +// SetZookeeperNodeInfo sets the ZookeeperNodeInfo field's value. +func (s *NodeInfo) SetZookeeperNodeInfo(v *ZookeeperNodeInfo) *NodeInfo { + s.ZookeeperNodeInfo = v + return s +} + +// Returns information about an error. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + InvalidParameter *string `locationName:"invalidParameter" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// JMX and Node monitoring for the MSK cluster. +type OpenMonitoring struct { + _ struct{} `type:"structure"` + + // Prometheus settings. + // + // Prometheus is a required field + Prometheus *Prometheus `locationName:"prometheus" type:"structure" required:"true"` +} + +// String returns the string representation +func (s OpenMonitoring) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OpenMonitoring) GoString() string { + return s.String() +} + +// SetPrometheus sets the Prometheus field's value. +func (s *OpenMonitoring) SetPrometheus(v *Prometheus) *OpenMonitoring { + s.Prometheus = v + return s +} + +// JMX and Node monitoring for the MSK cluster. +type OpenMonitoringInfo struct { + _ struct{} `type:"structure"` + + // Prometheus settings. + // + // Prometheus is a required field + Prometheus *PrometheusInfo `locationName:"prometheus" type:"structure" required:"true"` +} + +// String returns the string representation +func (s OpenMonitoringInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OpenMonitoringInfo) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *OpenMonitoringInfo) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "OpenMonitoringInfo"} + if s.Prometheus == nil { + invalidParams.Add(request.NewErrParamRequired("Prometheus")) + } + if s.Prometheus != nil { + if err := s.Prometheus.Validate(); err != nil { + invalidParams.AddNested("Prometheus", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPrometheus sets the Prometheus field's value. +func (s *OpenMonitoringInfo) SetPrometheus(v *PrometheusInfo) *OpenMonitoringInfo { + s.Prometheus = v + return s +} + +// Prometheus settings for open monitoring. +type Prometheus struct { + _ struct{} `type:"structure"` + + // Indicates whether you want to enable or disable the JMX Exporter. + JmxExporter *JmxExporter `locationName:"jmxExporter" type:"structure"` + + // Indicates whether you want to enable or disable the Node Exporter. + NodeExporter *NodeExporter `locationName:"nodeExporter" type:"structure"` +} + +// String returns the string representation +func (s Prometheus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Prometheus) GoString() string { + return s.String() +} + +// SetJmxExporter sets the JmxExporter field's value. +func (s *Prometheus) SetJmxExporter(v *JmxExporter) *Prometheus { + s.JmxExporter = v + return s +} + +// SetNodeExporter sets the NodeExporter field's value. +func (s *Prometheus) SetNodeExporter(v *NodeExporter) *Prometheus { + s.NodeExporter = v + return s +} + +// Prometheus settings. +type PrometheusInfo struct { + _ struct{} `type:"structure"` + + // JMX Exporter settings. + JmxExporter *JmxExporterInfo `locationName:"jmxExporter" type:"structure"` + + // Node Exporter settings. + NodeExporter *NodeExporterInfo `locationName:"nodeExporter" type:"structure"` +} + +// String returns the string representation +func (s PrometheusInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PrometheusInfo) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PrometheusInfo) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PrometheusInfo"} + if s.JmxExporter != nil { + if err := s.JmxExporter.Validate(); err != nil { + invalidParams.AddNested("JmxExporter", err.(request.ErrInvalidParams)) + } + } + if s.NodeExporter != nil { + if err := s.NodeExporter.Validate(); err != nil { + invalidParams.AddNested("NodeExporter", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetJmxExporter sets the JmxExporter field's value. +func (s *PrometheusInfo) SetJmxExporter(v *JmxExporterInfo) *PrometheusInfo { + s.JmxExporter = v + return s +} + +// SetNodeExporter sets the NodeExporter field's value. +func (s *PrometheusInfo) SetNodeExporter(v *NodeExporterInfo) *PrometheusInfo { + s.NodeExporter = v + return s +} + +// The details of the Amazon S3 destination for broker logs. +type S3 struct { + _ struct{} `type:"structure"` + + // The name of the S3 bucket that is the destination for broker logs. + Bucket *string `locationName:"bucket" type:"string"` + + // Specifies whether broker logs get sent to the specified Amazon S3 destination. + // + // Enabled is a required field + Enabled *bool `locationName:"enabled" type:"boolean" required:"true"` + + // The S3 prefix that is the destination for broker logs. + Prefix *string `locationName:"prefix" type:"string"` +} + +// String returns the string representation +func (s S3) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s S3) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *S3) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "S3"} + if s.Enabled == nil { + invalidParams.Add(request.NewErrParamRequired("Enabled")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *S3) SetBucket(v string) *S3 { + s.Bucket = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *S3) SetEnabled(v bool) *S3 { + s.Enabled = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *S3) SetPrefix(v string) *S3 { + s.Prefix = &v + return s +} + +// Returns information about an error. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + InvalidParameter *string `locationName:"invalidParameter" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetNodeARN sets the NodeARN field's value. -func (s *NodeInfo) SetNodeARN(v string) *NodeInfo { - s.NodeARN = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil } -// SetNodeType sets the NodeType field's value. -func (s *NodeInfo) SetNodeType(v string) *NodeInfo { - s.NodeType = &v - return s +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetZookeeperNodeInfo sets the ZookeeperNodeInfo field's value. -func (s *NodeInfo) SetZookeeperNodeInfo(v *ZookeeperNodeInfo) *NodeInfo { - s.ZookeeperNodeInfo = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID } // Contains information about storage volumes attached to MSK broker nodes. @@ -4426,6 +5866,122 @@ func (s *Tls) SetCertificateAuthorityArnList(v []*string) *Tls { return s } +// Returns information about an error. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + InvalidParameter *string `locationName:"invalidParameter" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returns information about an error. +type UnauthorizedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + InvalidParameter *string `locationName:"invalidParameter" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnauthorizedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnauthorizedException) GoString() string { + return s.String() +} + +func newErrorUnauthorizedException(v protocol.ResponseMetadata) error { + return &UnauthorizedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnauthorizedException) Code() string { + return "UnauthorizedException" +} + +// Message returns the exception's message. +func (s UnauthorizedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnauthorizedException) OrigErr() error { + return nil +} + +func (s UnauthorizedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnauthorizedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnauthorizedException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -4491,6 +6047,111 @@ func (s UntagResourceOutput) GoString() string { return s.String() } +// Request body for UpdateBrokerCount. +type UpdateBrokerCountInput struct { + _ struct{} `type:"structure"` + + // ClusterArn is a required field + ClusterArn *string `location:"uri" locationName:"clusterArn" type:"string" required:"true"` + + // The current version of the cluster. + // + // CurrentVersion is a required field + CurrentVersion *string `locationName:"currentVersion" type:"string" required:"true"` + + // The number of broker nodes that you want the cluster to have after this operation + // completes successfully. + // + // TargetNumberOfBrokerNodes is a required field + TargetNumberOfBrokerNodes *int64 `locationName:"targetNumberOfBrokerNodes" min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s UpdateBrokerCountInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateBrokerCountInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateBrokerCountInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateBrokerCountInput"} + if s.ClusterArn == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterArn")) + } + if s.ClusterArn != nil && len(*s.ClusterArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterArn", 1)) + } + if s.CurrentVersion == nil { + invalidParams.Add(request.NewErrParamRequired("CurrentVersion")) + } + if s.TargetNumberOfBrokerNodes == nil { + invalidParams.Add(request.NewErrParamRequired("TargetNumberOfBrokerNodes")) + } + if s.TargetNumberOfBrokerNodes != nil && *s.TargetNumberOfBrokerNodes < 1 { + invalidParams.Add(request.NewErrParamMinValue("TargetNumberOfBrokerNodes", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterArn sets the ClusterArn field's value. +func (s *UpdateBrokerCountInput) SetClusterArn(v string) *UpdateBrokerCountInput { + s.ClusterArn = &v + return s +} + +// SetCurrentVersion sets the CurrentVersion field's value. +func (s *UpdateBrokerCountInput) SetCurrentVersion(v string) *UpdateBrokerCountInput { + s.CurrentVersion = &v + return s +} + +// SetTargetNumberOfBrokerNodes sets the TargetNumberOfBrokerNodes field's value. +func (s *UpdateBrokerCountInput) SetTargetNumberOfBrokerNodes(v int64) *UpdateBrokerCountInput { + s.TargetNumberOfBrokerNodes = &v + return s +} + +// Response body for UpdateBrokerCount. +type UpdateBrokerCountOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the cluster. + ClusterArn *string `locationName:"clusterArn" type:"string"` + + // The Amazon Resource Name (ARN) of the cluster operation. + ClusterOperationArn *string `locationName:"clusterOperationArn" type:"string"` +} + +// String returns the string representation +func (s UpdateBrokerCountOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateBrokerCountOutput) GoString() string { + return s.String() +} + +// SetClusterArn sets the ClusterArn field's value. +func (s *UpdateBrokerCountOutput) SetClusterArn(v string) *UpdateBrokerCountOutput { + s.ClusterArn = &v + return s +} + +// SetClusterOperationArn sets the ClusterOperationArn field's value. +func (s *UpdateBrokerCountOutput) SetClusterOperationArn(v string) *UpdateBrokerCountOutput { + s.ClusterOperationArn = &v + return s +} + // Request object for UpdateBrokerStorage. type UpdateBrokerStorageInput struct { _ struct{} `type:"structure"` @@ -4507,6 +6168,11 @@ type UpdateBrokerStorageInput struct { // Describes the target volume size and the ID of the broker to apply the update // to. // + // The value you specify for Target-Volume-in-GiB must be a whole number that + // is greater than 100 GiB. + // + // The storage per broker after the update operation can't exceed 16384 GiB. + // // TargetBrokerEBSVolumeInfo is a required field TargetBrokerEBSVolumeInfo []*BrokerEBSVolumeInfo `locationName:"targetBrokerEBSVolumeInfo" type:"list" required:"true"` } @@ -4611,13 +6277,12 @@ type UpdateClusterConfigurationInput struct { // ClusterArn is a required field ClusterArn *string `location:"uri" locationName:"clusterArn" type:"string" required:"true"` - // Represents the configuration that you want MSK to use for the brokers in - // a cluster. + // Represents the configuration that you want MSK to use for the cluster. // // ConfigurationInfo is a required field ConfigurationInfo *ConfigurationInfo `locationName:"configurationInfo" type:"structure" required:"true"` - // The version of the cluster that needs to be updated. + // The version of the cluster that you want to update. // // CurrentVersion is a required field CurrentVersion *string `locationName:"currentVersion" type:"string" required:"true"` @@ -4711,6 +6376,132 @@ func (s *UpdateClusterConfigurationOutput) SetClusterOperationArn(v string) *Upd return s } +// Request body for UpdateMonitoring. +type UpdateMonitoringInput struct { + _ struct{} `type:"structure"` + + // ClusterArn is a required field + ClusterArn *string `location:"uri" locationName:"clusterArn" type:"string" required:"true"` + + // The version of cluster to update from. A successful operation will then generate + // a new version. + // + // CurrentVersion is a required field + CurrentVersion *string `locationName:"currentVersion" type:"string" required:"true"` + + // Specifies which Apache Kafka metrics Amazon MSK gathers and sends to Amazon + // CloudWatch for this cluster. + EnhancedMonitoring *string `locationName:"enhancedMonitoring" type:"string" enum:"EnhancedMonitoring"` + + // LoggingInfo details. + LoggingInfo *LoggingInfo `locationName:"loggingInfo" type:"structure"` + + // The settings for open monitoring. + OpenMonitoring *OpenMonitoringInfo `locationName:"openMonitoring" type:"structure"` +} + +// String returns the string representation +func (s UpdateMonitoringInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateMonitoringInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateMonitoringInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateMonitoringInput"} + if s.ClusterArn == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterArn")) + } + if s.ClusterArn != nil && len(*s.ClusterArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterArn", 1)) + } + if s.CurrentVersion == nil { + invalidParams.Add(request.NewErrParamRequired("CurrentVersion")) + } + if s.LoggingInfo != nil { + if err := s.LoggingInfo.Validate(); err != nil { + invalidParams.AddNested("LoggingInfo", err.(request.ErrInvalidParams)) + } + } + if s.OpenMonitoring != nil { + if err := s.OpenMonitoring.Validate(); err != nil { + invalidParams.AddNested("OpenMonitoring", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterArn sets the ClusterArn field's value. +func (s *UpdateMonitoringInput) SetClusterArn(v string) *UpdateMonitoringInput { + s.ClusterArn = &v + return s +} + +// SetCurrentVersion sets the CurrentVersion field's value. +func (s *UpdateMonitoringInput) SetCurrentVersion(v string) *UpdateMonitoringInput { + s.CurrentVersion = &v + return s +} + +// SetEnhancedMonitoring sets the EnhancedMonitoring field's value. +func (s *UpdateMonitoringInput) SetEnhancedMonitoring(v string) *UpdateMonitoringInput { + s.EnhancedMonitoring = &v + return s +} + +// SetLoggingInfo sets the LoggingInfo field's value. +func (s *UpdateMonitoringInput) SetLoggingInfo(v *LoggingInfo) *UpdateMonitoringInput { + s.LoggingInfo = v + return s +} + +// SetOpenMonitoring sets the OpenMonitoring field's value. +func (s *UpdateMonitoringInput) SetOpenMonitoring(v *OpenMonitoringInfo) *UpdateMonitoringInput { + s.OpenMonitoring = v + return s +} + +// Response body for UpdateMonitoring. +type UpdateMonitoringOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the cluster. + ClusterArn *string `locationName:"clusterArn" type:"string"` + + // The Amazon Resource Name (ARN) of the cluster operation. + ClusterOperationArn *string `locationName:"clusterOperationArn" type:"string"` +} + +// String returns the string representation +func (s UpdateMonitoringOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateMonitoringOutput) GoString() string { + return s.String() +} + +// SetClusterArn sets the ClusterArn field's value. +func (s *UpdateMonitoringOutput) SetClusterArn(v string) *UpdateMonitoringOutput { + s.ClusterArn = &v + return s +} + +// SetClusterOperationArn sets the ClusterOperationArn field's value. +func (s *UpdateMonitoringOutput) SetClusterOperationArn(v string) *UpdateMonitoringOutput { + s.ClusterOperationArn = &v + return s +} + // Zookeeper node information. type ZookeeperNodeInfo struct { _ struct{} `type:"structure"` @@ -4772,8 +6563,8 @@ func (s *ZookeeperNodeInfo) SetZookeeperVersion(v string) *ZookeeperNodeInfo { } // The distribution of broker nodes across Availability Zones. By default, broker -// nodes are distributed among three Availability Zones. Currently, the only -// supported value is DEFAULT. You can either specify this value explicitly +// nodes are distributed among the Availability Zones of your Region. Currently, +// the only supported value is DEFAULT. You can either specify this value explicitly // or leave it out. const ( // BrokerAZDistributionDefault is a BrokerAZDistribution enum value @@ -4825,6 +6616,15 @@ const ( EnhancedMonitoringPerTopicPerBroker = "PER_TOPIC_PER_BROKER" ) +// The status of a Kafka version. +const ( + // KafkaVersionStatusActive is a KafkaVersionStatus enum value + KafkaVersionStatusActive = "ACTIVE" + + // KafkaVersionStatusDeprecated is a KafkaVersionStatus enum value + KafkaVersionStatusDeprecated = "DEPRECATED" +) + // The broker or Zookeeper node. const ( // NodeTypeBroker is a NodeType enum value diff --git a/vendor/github.com/aws/aws-sdk-go/service/kafka/errors.go b/vendor/github.com/aws/aws-sdk-go/service/kafka/errors.go index 2927a1714de..d26e1527344 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kafka/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kafka/errors.go @@ -2,6 +2,10 @@ package kafka +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadRequestException for service response error code @@ -52,3 +56,14 @@ const ( // Returns information about an error. ErrCodeUnauthorizedException = "UnauthorizedException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadRequestException": newErrorBadRequestException, + "ConflictException": newErrorConflictException, + "ForbiddenException": newErrorForbiddenException, + "InternalServerErrorException": newErrorInternalServerErrorException, + "NotFoundException": newErrorNotFoundException, + "ServiceUnavailableException": newErrorServiceUnavailableException, + "TooManyRequestsException": newErrorTooManyRequestsException, + "UnauthorizedException": newErrorUnauthorizedException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/kafka/service.go b/vendor/github.com/aws/aws-sdk-go/service/kafka/service.go index 577c3777e17..9599276910f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kafka/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kafka/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "Kafka" // Name of service. EndpointsID = "kafka" // ID to lookup a service endpoint with. - ServiceID = "Kafka" // ServiceID is a unique identifer of a specific service. + ServiceID = "Kafka" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Kafka client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Kafka client from just a session. // svc := kafka.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *Kafka { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "kafka" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Kafka { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Kafka { svc := &Kafka{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-11-14", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 888f7a4363f..96c089e5897 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesis/api.go @@ -7,7 +7,6 @@ import ( "fmt" "io" "sync" - "sync/atomic" "time" "github.com/aws/aws-sdk-go/aws" @@ -84,20 +83,20 @@ func (c *Kinesis) AddTagsToStreamRequest(input *AddTagsToStreamInput) (req *requ // See the AWS API reference guide for Amazon Kinesis's // API operation AddTagsToStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // @@ -215,16 +214,16 @@ func (c *Kinesis) CreateStreamRequest(input *CreateStreamInput) (req *request.Re // See the AWS API reference guide for Amazon Kinesis's // API operation CreateStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // @@ -310,20 +309,20 @@ func (c *Kinesis) DecreaseStreamRetentionPeriodRequest(input *DecreaseStreamRete // See the AWS API reference guide for Amazon Kinesis's // API operation DecreaseStreamRetentionPeriod for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // @@ -422,16 +421,16 @@ func (c *Kinesis) DeleteStreamRequest(input *DeleteStreamInput) (req *request.Re // See the AWS API reference guide for Amazon Kinesis's // API operation DeleteStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // @@ -520,16 +519,16 @@ func (c *Kinesis) DeregisterStreamConsumerRequest(input *DeregisterStreamConsume // See the AWS API reference guide for Amazon Kinesis's // API operation DeregisterStreamConsumer for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // @@ -613,8 +612,8 @@ func (c *Kinesis) DescribeLimitsRequest(input *DescribeLimitsInput) (req *reques // See the AWS API reference guide for Amazon Kinesis's // API operation DescribeLimits for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // @@ -717,12 +716,12 @@ func (c *Kinesis) DescribeStreamRequest(input *DescribeStreamInput) (req *reques // See the AWS API reference guide for Amazon Kinesis's // API operation DescribeStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // @@ -791,10 +790,12 @@ func (c *Kinesis) DescribeStreamPagesWithContext(ctx aws.Context, input *Describ }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeStreamOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeStreamOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -859,16 +860,16 @@ func (c *Kinesis) DescribeStreamConsumerRequest(input *DescribeStreamConsumerInp // See the AWS API reference guide for Amazon Kinesis's // API operation DescribeStreamConsumer for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // @@ -952,12 +953,12 @@ func (c *Kinesis) DescribeStreamSummaryRequest(input *DescribeStreamSummaryInput // See the AWS API reference guide for Amazon Kinesis's // API operation DescribeStreamSummary for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // @@ -1036,20 +1037,20 @@ func (c *Kinesis) DisableEnhancedMonitoringRequest(input *DisableEnhancedMonitor // See the AWS API reference guide for Amazon Kinesis's // API operation DisableEnhancedMonitoring for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // @@ -1128,20 +1129,20 @@ func (c *Kinesis) EnableEnhancedMonitoringRequest(input *EnableEnhancedMonitorin // See the AWS API reference guide for Amazon Kinesis's // API operation EnableEnhancedMonitoring for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // @@ -1275,16 +1276,16 @@ func (c *Kinesis) GetRecordsRequest(input *GetRecordsInput) (req *request.Reques // See the AWS API reference guide for Amazon Kinesis's // API operation GetRecords for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" +// * 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) @@ -1292,31 +1293,31 @@ func (c *Kinesis) GetRecordsRequest(input *GetRecordsInput) (req *request.Reques // Exponential Backoff in AWS (http://docs.aws.amazon.com/general/latest/gr/api-retries.html) // in the AWS General Reference. // -// * ErrCodeExpiredIteratorException "ExpiredIteratorException" +// * ExpiredIteratorException // The provided iterator exceeds the maximum age allowed. // -// * ErrCodeKMSDisabledException "KMSDisabledException" +// * KMSDisabledException // The request was rejected because the specified customer master key (CMK) // isn't enabled. // -// * ErrCodeKMSInvalidStateException "KMSInvalidStateException" +// * KMSInvalidStateException // The request was rejected because the state of the specified resource isn't // valid for this request. For more information, 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. // -// * ErrCodeKMSAccessDeniedException "KMSAccessDeniedException" +// * KMSAccessDeniedException // The ciphertext references a key that doesn't exist or that you don't have // access to. // -// * ErrCodeKMSNotFoundException "KMSNotFoundException" +// * KMSNotFoundException // The request was rejected because the specified entity or resource can't be // found. // -// * ErrCodeKMSOptInRequired "KMSOptInRequired" +// * KMSOptInRequired // The AWS access key ID needs a subscription for the service. // -// * ErrCodeKMSThrottlingException "KMSThrottlingException" +// * KMSThrottlingException // The request was denied due to request throttling. For more information about // throttling, see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second) // in the AWS Key Management Service Developer Guide. @@ -1434,16 +1435,16 @@ func (c *Kinesis) GetShardIteratorRequest(input *GetShardIteratorInput) (req *re // See the AWS API reference guide for Amazon Kinesis's // API operation GetShardIterator for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" +// * 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) @@ -1537,20 +1538,20 @@ func (c *Kinesis) IncreaseStreamRetentionPeriodRequest(input *IncreaseStreamRete // See the AWS API reference guide for Amazon Kinesis's // API operation IncreaseStreamRetentionPeriod for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // @@ -1636,23 +1637,23 @@ func (c *Kinesis) ListShardsRequest(input *ListShardsInput) (req *request.Reques // See the AWS API reference guide for Amazon Kinesis's // API operation ListShards for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // -// * ErrCodeExpiredNextTokenException "ExpiredNextTokenException" +// * ExpiredNextTokenException // The pagination token passed to the operation is expired. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // @@ -1740,23 +1741,23 @@ func (c *Kinesis) ListStreamConsumersRequest(input *ListStreamConsumersInput) (r // See the AWS API reference guide for Amazon Kinesis's // API operation ListStreamConsumers for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // -// * ErrCodeExpiredNextTokenException "ExpiredNextTokenException" +// * ExpiredNextTokenException // The pagination token passed to the operation is expired. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // @@ -1825,10 +1826,12 @@ func (c *Kinesis) ListStreamConsumersPagesWithContext(ctx aws.Context, input *Li }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStreamConsumersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListStreamConsumersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1906,8 +1909,8 @@ func (c *Kinesis) ListStreamsRequest(input *ListStreamsInput) (req *request.Requ // See the AWS API reference guide for Amazon Kinesis's // API operation ListStreams for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // @@ -1976,10 +1979,12 @@ func (c *Kinesis) ListStreamsPagesWithContext(ctx aws.Context, input *ListStream }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStreamsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListStreamsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2037,16 +2042,16 @@ func (c *Kinesis) ListTagsForStreamRequest(input *ListTagsForStreamInput) (req * // See the AWS API reference guide for Amazon Kinesis's // API operation ListTagsForStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // @@ -2161,20 +2166,20 @@ func (c *Kinesis) MergeShardsRequest(input *MergeShardsInput) (req *request.Requ // See the AWS API reference guide for Amazon Kinesis's // API operation MergeShards for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // @@ -2291,16 +2296,16 @@ func (c *Kinesis) PutRecordRequest(input *PutRecordInput) (req *request.Request, // See the AWS API reference guide for Amazon Kinesis's // API operation PutRecord for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" +// * 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) @@ -2308,28 +2313,28 @@ func (c *Kinesis) PutRecordRequest(input *PutRecordInput) (req *request.Request, // Exponential Backoff in AWS (http://docs.aws.amazon.com/general/latest/gr/api-retries.html) // in the AWS General Reference. // -// * ErrCodeKMSDisabledException "KMSDisabledException" +// * KMSDisabledException // The request was rejected because the specified customer master key (CMK) // isn't enabled. // -// * ErrCodeKMSInvalidStateException "KMSInvalidStateException" +// * KMSInvalidStateException // The request was rejected because the state of the specified resource isn't // valid for this request. For more information, 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. // -// * ErrCodeKMSAccessDeniedException "KMSAccessDeniedException" +// * KMSAccessDeniedException // The ciphertext references a key that doesn't exist or that you don't have // access to. // -// * ErrCodeKMSNotFoundException "KMSNotFoundException" +// * KMSNotFoundException // The request was rejected because the specified entity or resource can't be // found. // -// * ErrCodeKMSOptInRequired "KMSOptInRequired" +// * KMSOptInRequired // The AWS access key ID needs a subscription for the service. // -// * ErrCodeKMSThrottlingException "KMSThrottlingException" +// * KMSThrottlingException // The request was denied due to request throttling. For more information about // throttling, see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second) // in the AWS Key Management Service Developer Guide. @@ -2467,16 +2472,16 @@ func (c *Kinesis) PutRecordsRequest(input *PutRecordsInput) (req *request.Reques // See the AWS API reference guide for Amazon Kinesis's // API operation PutRecords for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeProvisionedThroughputExceededException "ProvisionedThroughputExceededException" +// * 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) @@ -2484,28 +2489,28 @@ func (c *Kinesis) PutRecordsRequest(input *PutRecordsInput) (req *request.Reques // Exponential Backoff in AWS (http://docs.aws.amazon.com/general/latest/gr/api-retries.html) // in the AWS General Reference. // -// * ErrCodeKMSDisabledException "KMSDisabledException" +// * KMSDisabledException // The request was rejected because the specified customer master key (CMK) // isn't enabled. // -// * ErrCodeKMSInvalidStateException "KMSInvalidStateException" +// * KMSInvalidStateException // The request was rejected because the state of the specified resource isn't // valid for this request. For more information, 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. // -// * ErrCodeKMSAccessDeniedException "KMSAccessDeniedException" +// * KMSAccessDeniedException // The ciphertext references a key that doesn't exist or that you don't have // access to. // -// * ErrCodeKMSNotFoundException "KMSNotFoundException" +// * KMSNotFoundException // The request was rejected because the specified entity or resource can't be // found. // -// * ErrCodeKMSOptInRequired "KMSOptInRequired" +// * KMSOptInRequired // The AWS access key ID needs a subscription for the service. // -// * ErrCodeKMSThrottlingException "KMSThrottlingException" +// * KMSThrottlingException // The request was denied due to request throttling. For more information about // throttling, see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second) // in the AWS Key Management Service Developer Guide. @@ -2593,20 +2598,20 @@ func (c *Kinesis) RegisterStreamConsumerRequest(input *RegisterStreamConsumerInp // See the AWS API reference guide for Amazon Kinesis's // API operation RegisterStreamConsumer for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // @@ -2691,20 +2696,20 @@ func (c *Kinesis) RemoveTagsFromStreamRequest(input *RemoveTagsFromStreamInput) // See the AWS API reference guide for Amazon Kinesis's // API operation RemoveTagsFromStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // @@ -2829,20 +2834,20 @@ func (c *Kinesis) SplitShardRequest(input *SplitShardInput) (req *request.Reques // See the AWS API reference guide for Amazon Kinesis's // API operation SplitShard for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // @@ -2940,45 +2945,45 @@ func (c *Kinesis) StartStreamEncryptionRequest(input *StartStreamEncryptionInput // See the AWS API reference guide for Amazon Kinesis's // API operation StartStreamEncryption for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeKMSDisabledException "KMSDisabledException" +// * KMSDisabledException // The request was rejected because the specified customer master key (CMK) // isn't enabled. // -// * ErrCodeKMSInvalidStateException "KMSInvalidStateException" +// * KMSInvalidStateException // The request was rejected because the state of the specified resource isn't // valid for this request. For more information, 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. // -// * ErrCodeKMSAccessDeniedException "KMSAccessDeniedException" +// * KMSAccessDeniedException // The ciphertext references a key that doesn't exist or that you don't have // access to. // -// * ErrCodeKMSNotFoundException "KMSNotFoundException" +// * KMSNotFoundException // The request was rejected because the specified entity or resource can't be // found. // -// * ErrCodeKMSOptInRequired "KMSOptInRequired" +// * KMSOptInRequired // The AWS access key ID needs a subscription for the service. // -// * ErrCodeKMSThrottlingException "KMSThrottlingException" +// * KMSThrottlingException // The request was denied due to request throttling. For more information about // throttling, see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second) // in the AWS Key Management Service Developer Guide. @@ -3076,20 +3081,20 @@ func (c *Kinesis) StopStreamEncryptionRequest(input *StopStreamEncryptionInput) // See the AWS API reference guide for Amazon Kinesis's // API operation StopStreamEncryption for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // @@ -3154,10 +3159,17 @@ func (c *Kinesis) SubscribeToShardRequest(input *SubscribeToShardInput) (req *re output = &SubscribeToShardOutput{} req = c.newRequest(op, input, output) + + es := newSubscribeToShardEventStream() + req.Handlers.Unmarshal.PushBack(es.setStreamCloser) + output.EventStream = es + req.Handlers.Send.Swap(client.LogHTTPResponseHandler.Name, client.LogHTTPResponseHeaderHandler) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, rest.UnmarshalHandler) - req.Handlers.Unmarshal.PushBack(output.runEventStreamLoop) - req.Handlers.Unmarshal.PushBack(output.unmarshalInitialResponse) + req.Handlers.Unmarshal.PushBack(es.runOutputStream) + es.output = output + req.Handlers.Unmarshal.PushBack(es.recvInitialEvent) + req.Handlers.Unmarshal.PushBack(es.runOnStreamPartClose) return } @@ -3182,20 +3194,20 @@ func (c *Kinesis) SubscribeToShardRequest(input *SubscribeToShardInput) (req *re // See the AWS API reference guide for Amazon Kinesis's // API operation SubscribeToShard for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // @@ -3221,6 +3233,184 @@ func (c *Kinesis) SubscribeToShardWithContext(ctx aws.Context, input *SubscribeT return out, req.Send() } +// SubscribeToShardEventStream provides the event stream handling for the SubscribeToShard. +type SubscribeToShardEventStream struct { + + // Reader is the EventStream reader for the SubscribeToShardEventStream + // events. This value is automatically set by the SDK when the API call is made + // Use this member when unit testing your code with the SDK to mock out the + // EventStream Reader. + // + // Must not be nil. + Reader SubscribeToShardEventStreamReader + + outputReader io.ReadCloser + output *SubscribeToShardOutput + + // StreamCloser is the io.Closer for the EventStream connection. For HTTP + // EventStream this is the response Body. The stream will be closed when + // the Close method of the EventStream is called. + StreamCloser io.Closer + + done chan struct{} + closeOnce sync.Once + err *eventstreamapi.OnceError +} + +func newSubscribeToShardEventStream() *SubscribeToShardEventStream { + return &SubscribeToShardEventStream{ + done: make(chan struct{}), + err: eventstreamapi.NewOnceError(), + } +} + +func (es *SubscribeToShardEventStream) setStreamCloser(r *request.Request) { + es.StreamCloser = r.HTTPResponse.Body +} + +func (es *SubscribeToShardEventStream) runOnStreamPartClose(r *request.Request) { + if es.done == nil { + return + } + go es.waitStreamPartClose() + +} + +func (es *SubscribeToShardEventStream) waitStreamPartClose() { + var outputErrCh <-chan struct{} + if v, ok := es.Reader.(interface{ ErrorSet() <-chan struct{} }); ok { + outputErrCh = v.ErrorSet() + } + var outputClosedCh <-chan struct{} + if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok { + outputClosedCh = v.Closed() + } + + select { + case <-es.done: + case <-outputErrCh: + es.err.SetError(es.Reader.Err()) + es.Close() + case <-outputClosedCh: + if err := es.Reader.Err(); err != nil { + es.err.SetError(es.Reader.Err()) + } + es.Close() + } +} + +type eventTypeForSubscribeToShardEventStreamOutputEvent struct { + unmarshalerForEvent func(string) (eventstreamapi.Unmarshaler, error) + output *SubscribeToShardOutput +} + +func (e eventTypeForSubscribeToShardEventStreamOutputEvent) UnmarshalerForEventName(eventType string) (eventstreamapi.Unmarshaler, error) { + if eventType == "initial-response" { + return e.output, nil + } + return e.unmarshalerForEvent(eventType) +} + +// Events returns a channel to read events from. +// +// These events are: +// +// * SubscribeToShardEvent +func (es *SubscribeToShardEventStream) Events() <-chan SubscribeToShardEventStreamEvent { + return es.Reader.Events() +} + +func (es *SubscribeToShardEventStream) runOutputStream(r *request.Request) { + var opts []func(*eventstream.Decoder) + if r.Config.Logger != nil && r.Config.LogLevel.Matches(aws.LogDebugWithEventStreamBody) { + opts = append(opts, eventstream.DecodeWithLogger(r.Config.Logger)) + } + + unmarshalerForEvent := unmarshalerForSubscribeToShardEventStreamEvent{ + metadata: protocol.ResponseMetadata{ + StatusCode: r.HTTPResponse.StatusCode, + RequestID: r.RequestID, + }, + }.UnmarshalerForEventName + unmarshalerForEvent = eventTypeForSubscribeToShardEventStreamOutputEvent{ + unmarshalerForEvent: unmarshalerForEvent, + output: es.output, + }.UnmarshalerForEventName + + decoder := eventstream.NewDecoder(r.HTTPResponse.Body, opts...) + eventReader := eventstreamapi.NewEventReader(decoder, + protocol.HandlerPayloadUnmarshal{ + Unmarshalers: r.Handlers.UnmarshalStream, + }, + unmarshalerForEvent, + ) + + es.outputReader = r.HTTPResponse.Body + es.Reader = newReadSubscribeToShardEventStream(eventReader) +} +func (es *SubscribeToShardEventStream) recvInitialEvent(r *request.Request) { + // Wait for the initial response event, which must be the first + // event to be received from the API. + select { + case event, ok := <-es.Events(): + if !ok { + return + } + + v, ok := event.(*SubscribeToShardOutput) + if !ok || v == nil { + r.Error = awserr.New( + request.ErrCodeSerialization, + fmt.Sprintf("invalid event, %T, expect %T, %v", + event, (*SubscribeToShardOutput)(nil), v), + nil, + ) + return + } + + *es.output = *v + es.output.EventStream = es + } +} + +// Close closes the stream. This will also cause the stream to be closed. +// Close must be called when done using the stream API. Not calling Close +// may result in resource leaks. +// +// You can use the closing of the Reader's Events channel to terminate your +// application's read from the API's stream. +// +func (es *SubscribeToShardEventStream) Close() (err error) { + es.closeOnce.Do(es.safeClose) + return es.Err() +} + +func (es *SubscribeToShardEventStream) safeClose() { + if es.done != nil { + close(es.done) + } + + es.Reader.Close() + if es.outputReader != nil { + es.outputReader.Close() + } + + es.StreamCloser.Close() +} + +// Err returns any error that occurred while reading or writing EventStream +// Events from the service API's response. Returns nil if there were no errors. +func (es *SubscribeToShardEventStream) Err() error { + if err := es.err.Err(); err != nil { + return err + } + if err := es.Reader.Err(); err != nil { + return err + } + + return nil +} + const opUpdateShardCount = "UpdateShardCount" // UpdateShardCountRequest generates a "aws/request.Request" representing the @@ -3308,20 +3498,20 @@ func (c *Kinesis) UpdateShardCountRequest(input *UpdateShardCountInput) (req *re // See the AWS API reference guide for Amazon Kinesis's // API operation UpdateShardCount for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // A specified parameter exceeds its restrictions, is not supported, or can't // be used. For more information, see the returned message. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The requested resource exceeds the maximum number allowed, or the number // of concurrent stream requests exceeds the maximum number allowed. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource could not be found. The stream might not be specified // correctly. // @@ -4411,6 +4601,119 @@ func (s *EnhancedMonitoringOutput) SetStreamName(v string) *EnhancedMonitoringOu return s } +// The provided iterator exceeds the maximum age allowed. +type ExpiredIteratorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message that provides information about the error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ExpiredIteratorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExpiredIteratorException) GoString() string { + return s.String() +} + +func newErrorExpiredIteratorException(v protocol.ResponseMetadata) error { + return &ExpiredIteratorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ExpiredIteratorException) Code() string { + return "ExpiredIteratorException" +} + +// Message returns the exception's message. +func (s ExpiredIteratorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ExpiredIteratorException) OrigErr() error { + return nil +} + +func (s ExpiredIteratorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ExpiredIteratorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ExpiredIteratorException) RequestID() string { + return s.respMetadata.RequestID +} + +// The pagination token passed to the operation is expired. +type ExpiredNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ExpiredNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExpiredNextTokenException) GoString() string { + return s.String() +} + +func newErrorExpiredNextTokenException(v protocol.ResponseMetadata) error { + return &ExpiredNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ExpiredNextTokenException) Code() string { + return "ExpiredNextTokenException" +} + +// Message returns the exception's message. +func (s ExpiredNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ExpiredNextTokenException) OrigErr() error { + return nil +} + +func (s ExpiredNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ExpiredNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ExpiredNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents the input for GetRecords. type GetRecordsInput struct { _ struct{} `type:"structure"` @@ -4772,7 +5075,8 @@ func (s IncreaseStreamRetentionPeriodOutput) GoString() string { } type InternalFailureException struct { - _ struct{} `type:"structure"` + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata Message_ *string `locationName:"message" type:"string"` } @@ -4804,6 +5108,22 @@ func (s *InternalFailureException) UnmarshalEvent( return nil } +func (s *InternalFailureException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +func newErrorInternalFailureException(v protocol.ResponseMetadata) error { + return &InternalFailureException{ + respMetadata: v, + } +} + // Code returns the exception type name. func (s InternalFailureException) Code() string { return "InternalFailureException" @@ -4811,7 +5131,10 @@ func (s InternalFailureException) Code() string { // Message returns the exception's message. func (s InternalFailureException) Message() string { - return *s.Message_ + if s.Message_ != nil { + return *s.Message_ + } + return "" } // OrigErr always returns nil, satisfies awserr.Error interface. @@ -4823,10 +5146,79 @@ func (s InternalFailureException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } +// Status code returns the HTTP status code for the request's response error. +func (s InternalFailureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalFailureException) RequestID() string { + return s.respMetadata.RequestID +} + +// A specified parameter exceeds its restrictions, is not supported, or can't +// be used. For more information, see the returned message. +type InvalidArgumentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message that provides information about the error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidArgumentException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidArgumentException) GoString() string { + return s.String() +} + +func newErrorInvalidArgumentException(v protocol.ResponseMetadata) error { + return &InvalidArgumentException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidArgumentException) Code() string { + return "InvalidArgumentException" +} + +// Message returns the exception's message. +func (s InvalidArgumentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidArgumentException) OrigErr() error { + return nil +} + +func (s InvalidArgumentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidArgumentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidArgumentException) RequestID() string { + return s.respMetadata.RequestID +} + // The ciphertext references a key that doesn't exist or that you don't have // access to. type KMSAccessDeniedException struct { - _ struct{} `type:"structure"` + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata // A message that provides information about the error. Message_ *string `locationName:"message" type:"string"` @@ -4859,6 +5251,22 @@ func (s *KMSAccessDeniedException) UnmarshalEvent( return nil } +func (s *KMSAccessDeniedException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +func newErrorKMSAccessDeniedException(v protocol.ResponseMetadata) error { + return &KMSAccessDeniedException{ + respMetadata: v, + } +} + // Code returns the exception type name. func (s KMSAccessDeniedException) Code() string { return "KMSAccessDeniedException" @@ -4866,7 +5274,10 @@ func (s KMSAccessDeniedException) Code() string { // Message returns the exception's message. func (s KMSAccessDeniedException) Message() string { - return *s.Message_ + if s.Message_ != nil { + return *s.Message_ + } + return "" } // OrigErr always returns nil, satisfies awserr.Error interface. @@ -4878,10 +5289,21 @@ func (s KMSAccessDeniedException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } +// Status code returns the HTTP status code for the request's response error. +func (s KMSAccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSAccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + // The request was rejected because the specified customer master key (CMK) // isn't enabled. type KMSDisabledException struct { - _ struct{} `type:"structure"` + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata // A message that provides information about the error. Message_ *string `locationName:"message" type:"string"` @@ -4914,6 +5336,22 @@ func (s *KMSDisabledException) UnmarshalEvent( return nil } +func (s *KMSDisabledException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +func newErrorKMSDisabledException(v protocol.ResponseMetadata) error { + return &KMSDisabledException{ + respMetadata: v, + } +} + // Code returns the exception type name. func (s KMSDisabledException) Code() string { return "KMSDisabledException" @@ -4921,7 +5359,10 @@ func (s KMSDisabledException) Code() string { // Message returns the exception's message. func (s KMSDisabledException) Message() string { - return *s.Message_ + if s.Message_ != nil { + return *s.Message_ + } + return "" } // OrigErr always returns nil, satisfies awserr.Error interface. @@ -4933,12 +5374,23 @@ func (s KMSDisabledException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } +// Status code returns the HTTP status code for the request's response error. +func (s KMSDisabledException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSDisabledException) RequestID() string { + return s.respMetadata.RequestID +} + // The request was rejected because the state of the specified resource isn't // valid for this request. For more information, 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. type KMSInvalidStateException struct { - _ struct{} `type:"structure"` + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata // A message that provides information about the error. Message_ *string `locationName:"message" type:"string"` @@ -4971,6 +5423,22 @@ func (s *KMSInvalidStateException) UnmarshalEvent( return nil } +func (s *KMSInvalidStateException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +func newErrorKMSInvalidStateException(v protocol.ResponseMetadata) error { + return &KMSInvalidStateException{ + respMetadata: v, + } +} + // Code returns the exception type name. func (s KMSInvalidStateException) Code() string { return "KMSInvalidStateException" @@ -4978,7 +5446,10 @@ func (s KMSInvalidStateException) Code() string { // Message returns the exception's message. func (s KMSInvalidStateException) Message() string { - return *s.Message_ + if s.Message_ != nil { + return *s.Message_ + } + return "" } // OrigErr always returns nil, satisfies awserr.Error interface. @@ -4990,10 +5461,21 @@ func (s KMSInvalidStateException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } +// Status code returns the HTTP status code for the request's response error. +func (s KMSInvalidStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSInvalidStateException) RequestID() string { + return s.respMetadata.RequestID +} + // The request was rejected because the specified entity or resource can't be // found. type KMSNotFoundException struct { - _ struct{} `type:"structure"` + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata // A message that provides information about the error. Message_ *string `locationName:"message" type:"string"` @@ -5026,6 +5508,22 @@ func (s *KMSNotFoundException) UnmarshalEvent( return nil } +func (s *KMSNotFoundException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +func newErrorKMSNotFoundException(v protocol.ResponseMetadata) error { + return &KMSNotFoundException{ + respMetadata: v, + } +} + // Code returns the exception type name. func (s KMSNotFoundException) Code() string { return "KMSNotFoundException" @@ -5033,7 +5531,10 @@ func (s KMSNotFoundException) Code() string { // Message returns the exception's message. func (s KMSNotFoundException) Message() string { - return *s.Message_ + if s.Message_ != nil { + return *s.Message_ + } + return "" } // OrigErr always returns nil, satisfies awserr.Error interface. @@ -5045,9 +5546,20 @@ func (s KMSNotFoundException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } +// Status code returns the HTTP status code for the request's response error. +func (s KMSNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // The AWS access key ID needs a subscription for the service. type KMSOptInRequired struct { - _ struct{} `type:"structure"` + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata // A message that provides information about the error. Message_ *string `locationName:"message" type:"string"` @@ -5080,6 +5592,22 @@ func (s *KMSOptInRequired) UnmarshalEvent( return nil } +func (s *KMSOptInRequired) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +func newErrorKMSOptInRequired(v protocol.ResponseMetadata) error { + return &KMSOptInRequired{ + respMetadata: v, + } +} + // Code returns the exception type name. func (s KMSOptInRequired) Code() string { return "KMSOptInRequired" @@ -5087,7 +5615,10 @@ func (s KMSOptInRequired) Code() string { // Message returns the exception's message. func (s KMSOptInRequired) Message() string { - return *s.Message_ + if s.Message_ != nil { + return *s.Message_ + } + return "" } // OrigErr always returns nil, satisfies awserr.Error interface. @@ -5099,11 +5630,22 @@ func (s KMSOptInRequired) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } +// Status code returns the HTTP status code for the request's response error. +func (s KMSOptInRequired) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSOptInRequired) RequestID() string { + return s.respMetadata.RequestID +} + // The request was denied due to request throttling. For more information about // throttling, see Limits (http://docs.aws.amazon.com/kms/latest/developerguide/limits.html#requests-per-second) // in the AWS Key Management Service Developer Guide. type KMSThrottlingException struct { - _ struct{} `type:"structure"` + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata // A message that provides information about the error. Message_ *string `locationName:"message" type:"string"` @@ -5136,6 +5678,22 @@ func (s *KMSThrottlingException) UnmarshalEvent( return nil } +func (s *KMSThrottlingException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +func newErrorKMSThrottlingException(v protocol.ResponseMetadata) error { + return &KMSThrottlingException{ + respMetadata: v, + } +} + // Code returns the exception type name. func (s KMSThrottlingException) Code() string { return "KMSThrottlingException" @@ -5143,7 +5701,10 @@ func (s KMSThrottlingException) Code() string { // Message returns the exception's message. func (s KMSThrottlingException) Message() string { - return *s.Message_ + if s.Message_ != nil { + return *s.Message_ + } + return "" } // OrigErr always returns nil, satisfies awserr.Error interface. @@ -5155,6 +5716,74 @@ func (s KMSThrottlingException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } +// Status code returns the HTTP status code for the request's response error. +func (s KMSThrottlingException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSThrottlingException) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested resource exceeds the maximum number allowed, or the number +// of concurrent stream requests exceeds the maximum number allowed. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message that provides information about the error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListShardsInput struct { _ struct{} `type:"structure"` @@ -5751,6 +6380,68 @@ func (s MergeShardsOutput) GoString() string { return s.String() } +// 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 Data 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. +type ProvisionedThroughputExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message that provides information about the error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ProvisionedThroughputExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ProvisionedThroughputExceededException) GoString() string { + return s.String() +} + +func newErrorProvisionedThroughputExceededException(v protocol.ResponseMetadata) error { + return &ProvisionedThroughputExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ProvisionedThroughputExceededException) Code() string { + return "ProvisionedThroughputExceededException" +} + +// Message returns the exception's message. +func (s ProvisionedThroughputExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ProvisionedThroughputExceededException) OrigErr() error { + return nil +} + +func (s ProvisionedThroughputExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ProvisionedThroughputExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ProvisionedThroughputExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Represents the input for PutRecord. type PutRecordInput struct { _ struct{} `type:"structure"` @@ -6416,7 +7107,8 @@ func (s RemoveTagsFromStreamOutput) GoString() string { // The resource is not available for this operation. For successful operation, // the resource must be in the ACTIVE state. type ResourceInUseException struct { - _ struct{} `type:"structure"` + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata // A message that provides information about the error. Message_ *string `locationName:"message" type:"string"` @@ -6449,6 +7141,22 @@ func (s *ResourceInUseException) UnmarshalEvent( return nil } +func (s *ResourceInUseException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + // Code returns the exception type name. func (s ResourceInUseException) Code() string { return "ResourceInUseException" @@ -6456,7 +7164,10 @@ func (s ResourceInUseException) Code() string { // Message returns the exception's message. func (s ResourceInUseException) Message() string { - return *s.Message_ + if s.Message_ != nil { + return *s.Message_ + } + return "" } // OrigErr always returns nil, satisfies awserr.Error interface. @@ -6468,10 +7179,21 @@ func (s ResourceInUseException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + // The requested resource could not be found. The stream might not be specified // correctly. type ResourceNotFoundException struct { - _ struct{} `type:"structure"` + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata // A message that provides information about the error. Message_ *string `locationName:"message" type:"string"` @@ -6504,6 +7226,22 @@ func (s *ResourceNotFoundException) UnmarshalEvent( return nil } +func (s *ResourceNotFoundException) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.ExceptionMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + // Code returns the exception type name. func (s ResourceNotFoundException) Code() string { return "ResourceNotFoundException" @@ -6511,7 +7249,10 @@ func (s ResourceNotFoundException) Code() string { // Message returns the exception's message. func (s ResourceNotFoundException) Message() string { - return *s.Message_ + if s.Message_ != nil { + return *s.Message_ + } + return "" } // OrigErr always returns nil, satisfies awserr.Error interface. @@ -6523,6 +7264,16 @@ func (s ResourceNotFoundException) Error() string { return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // The range of possible sequence numbers for the shard. type SequenceNumberRange struct { _ struct{} `type:"structure"` @@ -7344,78 +8095,30 @@ func (s *SubscribeToShardEvent) UnmarshalEvent( return nil } -// SubscribeToShardEventStream provides handling of EventStreams for -// the SubscribeToShard API. -// -// Use this type to receive SubscribeToShardEventStream events. The events -// can be read from the Events channel member. -// -// The events that can be received are: -// -// * SubscribeToShardEvent -type SubscribeToShardEventStream struct { - // Reader is the EventStream reader for the SubscribeToShardEventStream - // events. This value is automatically set by the SDK when the API call is made - // Use this member when unit testing your code with the SDK to mock out the - // EventStream Reader. - // - // Must not be nil. - Reader SubscribeToShardEventStreamReader - - // StreamCloser is the io.Closer for the EventStream connection. For HTTP - // EventStream this is the response Body. The stream will be closed when - // the Close method of the EventStream is called. - StreamCloser io.Closer -} - -// Close closes the EventStream. This will also cause the Events channel to be -// closed. You can use the closing of the Events channel to terminate your -// application's read from the API's EventStream. -// -// Will close the underlying EventStream reader. For EventStream over HTTP -// connection this will also close the HTTP connection. -// -// Close must be called when done using the EventStream API. Not calling Close -// may result in resource leaks. -func (es *SubscribeToShardEventStream) Close() (err error) { - es.Reader.Close() - return es.Err() -} - -// Err returns any error that occurred while reading EventStream Events from -// the service API's response. Returns nil if there were no errors. -func (es *SubscribeToShardEventStream) Err() error { - if err := es.Reader.Err(); err != nil { - return err +func (s *SubscribeToShardEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err } - es.StreamCloser.Close() - - return nil -} - -// Events returns a channel to read EventStream Events from the -// SubscribeToShard API. -// -// These events are: -// -// * SubscribeToShardEvent -func (es *SubscribeToShardEventStream) Events() <-chan SubscribeToShardEventStreamEvent { - return es.Reader.Events() + msg.Payload = buf.Bytes() + return msg, err } // SubscribeToShardEventStreamEvent groups together all EventStream -// events read from the SubscribeToShard API. +// events writes for SubscribeToShardEventStream. // // These events are: // // * SubscribeToShardEvent type SubscribeToShardEventStreamEvent interface { eventSubscribeToShardEventStream() + eventstreamapi.Marshaler + eventstreamapi.Unmarshaler } -// SubscribeToShardEventStreamReader provides the interface for reading EventStream -// Events from the SubscribeToShard API. The -// default implementation for this interface will be SubscribeToShardEventStream. +// SubscribeToShardEventStreamReader provides the interface for reading to the stream. The +// default implementation for this interface will be SubscribeToShardEventStreamData. // // The reader's Close method must allow multiple concurrent calls. // @@ -7426,8 +8129,7 @@ type SubscribeToShardEventStreamReader interface { // Returns a channel of events as they are read from the event stream. Events() <-chan SubscribeToShardEventStreamEvent - // Close will close the underlying event stream reader. For event stream over - // HTTP this will also close the HTTP connection. + // Close will stop the reader reading events from the stream. Close() error // Returns any error that has occurred while reading from the event stream. @@ -7437,61 +8139,44 @@ type SubscribeToShardEventStreamReader interface { type readSubscribeToShardEventStream struct { eventReader *eventstreamapi.EventReader stream chan SubscribeToShardEventStreamEvent - errVal atomic.Value + err *eventstreamapi.OnceError done chan struct{} closeOnce sync.Once - - initResp eventstreamapi.Unmarshaler } -func newReadSubscribeToShardEventStream( - reader io.ReadCloser, - unmarshalers request.HandlerList, - logger aws.Logger, - logLevel aws.LogLevelType, - initResp eventstreamapi.Unmarshaler, -) *readSubscribeToShardEventStream { +func newReadSubscribeToShardEventStream(eventReader *eventstreamapi.EventReader) *readSubscribeToShardEventStream { r := &readSubscribeToShardEventStream{ - stream: make(chan SubscribeToShardEventStreamEvent), - done: make(chan struct{}), - initResp: initResp, + eventReader: eventReader, + stream: make(chan SubscribeToShardEventStreamEvent), + done: make(chan struct{}), + err: eventstreamapi.NewOnceError(), } - - r.eventReader = eventstreamapi.NewEventReader( - reader, - protocol.HandlerPayloadUnmarshal{ - Unmarshalers: unmarshalers, - }, - r.unmarshalerForEventType, - ) - r.eventReader.UseLogger(logger, logLevel) + go r.readEventStream() return r } -// Close will close the underlying event stream reader. For EventStream over -// HTTP this will also close the HTTP connection. +// Close will close the underlying event stream reader. func (r *readSubscribeToShardEventStream) Close() error { r.closeOnce.Do(r.safeClose) - return r.Err() } +func (r *readSubscribeToShardEventStream) ErrorSet() <-chan struct{} { + return r.err.ErrorSet() +} + +func (r *readSubscribeToShardEventStream) Closed() <-chan struct{} { + return r.done +} + func (r *readSubscribeToShardEventStream) safeClose() { close(r.done) - err := r.eventReader.Close() - if err != nil { - r.errVal.Store(err) - } } func (r *readSubscribeToShardEventStream) Err() error { - if v := r.errVal.Load(); v != nil { - return v.(error) - } - - return nil + return r.err.Err() } func (r *readSubscribeToShardEventStream) Events() <-chan SubscribeToShardEventStreamEvent { @@ -7499,6 +8184,7 @@ func (r *readSubscribeToShardEventStream) Events() <-chan SubscribeToShardEventS } func (r *readSubscribeToShardEventStream) readEventStream() { + defer r.Close() defer close(r.stream) for { @@ -7513,7 +8199,7 @@ func (r *readSubscribeToShardEventStream) readEventStream() { return default: } - r.errVal.Store(err) + r.err.SetError(err) return } @@ -7525,42 +8211,32 @@ func (r *readSubscribeToShardEventStream) readEventStream() { } } -func (r *readSubscribeToShardEventStream) unmarshalerForEventType( - eventType string, -) (eventstreamapi.Unmarshaler, error) { - switch eventType { - case "initial-response": - return r.initResp, nil +type unmarshalerForSubscribeToShardEventStreamEvent struct { + metadata protocol.ResponseMetadata +} +func (u unmarshalerForSubscribeToShardEventStreamEvent) UnmarshalerForEventName(eventType string) (eventstreamapi.Unmarshaler, error) { + switch eventType { case "SubscribeToShardEvent": return &SubscribeToShardEvent{}, nil - case "InternalFailureException": - return &InternalFailureException{}, nil - + return newErrorInternalFailureException(u.metadata).(eventstreamapi.Unmarshaler), nil case "KMSAccessDeniedException": - return &KMSAccessDeniedException{}, nil - + return newErrorKMSAccessDeniedException(u.metadata).(eventstreamapi.Unmarshaler), nil case "KMSDisabledException": - return &KMSDisabledException{}, nil - + return newErrorKMSDisabledException(u.metadata).(eventstreamapi.Unmarshaler), nil case "KMSInvalidStateException": - return &KMSInvalidStateException{}, nil - + return newErrorKMSInvalidStateException(u.metadata).(eventstreamapi.Unmarshaler), nil case "KMSNotFoundException": - return &KMSNotFoundException{}, nil - + return newErrorKMSNotFoundException(u.metadata).(eventstreamapi.Unmarshaler), nil case "KMSOptInRequired": - return &KMSOptInRequired{}, nil - + return newErrorKMSOptInRequired(u.metadata).(eventstreamapi.Unmarshaler), nil case "KMSThrottlingException": - return &KMSThrottlingException{}, nil - + return newErrorKMSThrottlingException(u.metadata).(eventstreamapi.Unmarshaler), nil case "ResourceInUseException": - return &ResourceInUseException{}, nil - + return newErrorResourceInUseException(u.metadata).(eventstreamapi.Unmarshaler), nil case "ResourceNotFoundException": - return &ResourceNotFoundException{}, nil + return newErrorResourceNotFoundException(u.metadata).(eventstreamapi.Unmarshaler), nil default: return nil, awserr.New( request.ErrCodeSerialization, @@ -7649,10 +8325,7 @@ func (s *SubscribeToShardInput) SetStartingPosition(v *StartingPosition) *Subscr type SubscribeToShardOutput struct { _ struct{} `type:"structure"` - // Use EventStream to use the API's stream. - // - // EventStream is a required field - EventStream *SubscribeToShardEventStream `type:"structure" required:"true"` + EventStream *SubscribeToShardEventStream } // String returns the string representation @@ -7665,53 +8338,17 @@ func (s SubscribeToShardOutput) GoString() string { return s.String() } -// SetEventStream sets the EventStream field's value. func (s *SubscribeToShardOutput) SetEventStream(v *SubscribeToShardEventStream) *SubscribeToShardOutput { s.EventStream = v return s } - -func (s *SubscribeToShardOutput) runEventStreamLoop(r *request.Request) { - if r.Error != nil { - return - } - reader := newReadSubscribeToShardEventStream( - r.HTTPResponse.Body, - r.Handlers.UnmarshalStream, - r.Config.Logger, - r.Config.LogLevel.Value(), - s, - ) - go reader.readEventStream() - - eventStream := &SubscribeToShardEventStream{ - StreamCloser: r.HTTPResponse.Body, - Reader: reader, - } - s.EventStream = eventStream +func (s *SubscribeToShardOutput) GetEventStream() *SubscribeToShardEventStream { + return s.EventStream } -func (s *SubscribeToShardOutput) unmarshalInitialResponse(r *request.Request) { - // Wait for the initial response event, which must be the first event to be - // received from the API. - select { - case event, ok := <-s.EventStream.Events(): - if !ok { - return - } - es := s.EventStream - v, ok := event.(*SubscribeToShardOutput) - if !ok || v == nil { - r.Error = awserr.New( - request.ErrCodeSerialization, - fmt.Sprintf("invalid event, %T, expect *SubscribeToShardOutput, %v", event, v), - nil, - ) - return - } - *s = *v - s.EventStream = es - } +// GetStream returns the type to interact with the event stream. +func (s *SubscribeToShardOutput) GetStream() *SubscribeToShardEventStream { + return s.EventStream } // The SubscribeToShardOutput is and event in the SubscribeToShardEventStream group of events. @@ -7731,6 +8368,16 @@ func (s *SubscribeToShardOutput) UnmarshalEvent( return nil } +func (s *SubscribeToShardOutput) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + // Metadata assigned to the stream, consisting of a key-value pair. type Tag struct { _ struct{} `type:"structure"` 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 index fc83d457e72..ba7c89dbaee 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesis/errors.go @@ -2,6 +2,10 @@ package kinesis +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeExpiredIteratorException for service response error code @@ -103,3 +107,20 @@ const ( // correctly. ErrCodeResourceNotFoundException = "ResourceNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ExpiredIteratorException": newErrorExpiredIteratorException, + "ExpiredNextTokenException": newErrorExpiredNextTokenException, + "InternalFailureException": newErrorInternalFailureException, + "InvalidArgumentException": newErrorInvalidArgumentException, + "KMSAccessDeniedException": newErrorKMSAccessDeniedException, + "KMSDisabledException": newErrorKMSDisabledException, + "KMSInvalidStateException": newErrorKMSInvalidStateException, + "KMSNotFoundException": newErrorKMSNotFoundException, + "KMSOptInRequired": newErrorKMSOptInRequired, + "KMSThrottlingException": newErrorKMSThrottlingException, + "LimitExceededException": newErrorLimitExceededException, + "ProvisionedThroughputExceededException": newErrorProvisionedThroughputExceededException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, +} 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 index 7c3e8c48a28..71f51b32870 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesis/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesis/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "kinesis" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Kinesis" // ServiceID is a unique identifer of a specific service. + ServiceID = "Kinesis" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Kinesis client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Kinesis client from just a session. // svc := kinesis.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Kinesis { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Kinesis { svc := &Kinesis{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2013-12-02", JSONVersion: "1.1", @@ -73,8 +77,11 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) + svc.Handlers.BuildStream.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.UnmarshalStream.PushBackNamed(jsonrpc.UnmarshalHandler) // Run custom client initialization if present diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesisanalytics/api.go b/vendor/github.com/aws/aws-sdk-go/service/kinesisanalytics/api.go index d536e7b1470..7e8df003f38 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesisanalytics/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesisanalytics/api.go @@ -75,22 +75,22 @@ func (c *KinesisAnalytics) AddApplicationCloudWatchLoggingOptionRequest(input *A // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation AddApplicationCloudWatchLoggingOption for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modification to an application. // For example, two individuals attempting to edit the same application at the // same time. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -189,26 +189,26 @@ func (c *KinesisAnalytics) AddApplicationInputRequest(input *AddApplicationInput // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation AddApplicationInput for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modification to an application. // For example, two individuals attempting to edit the same application at the // same time. // -// * ErrCodeCodeValidationException "CodeValidationException" +// * CodeValidationException // User-provided application code (query) is invalid. This can be a simple syntax // error. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -297,22 +297,22 @@ func (c *KinesisAnalytics) AddApplicationInputProcessingConfigurationRequest(inp // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation AddApplicationInputProcessingConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modification to an application. // For example, two individuals attempting to edit the same application at the // same time. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -421,22 +421,22 @@ func (c *KinesisAnalytics) AddApplicationOutputRequest(input *AddApplicationOutp // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation AddApplicationOutput for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modification to an application. // For example, two individuals attempting to edit the same application at the // same time. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -536,22 +536,22 @@ func (c *KinesisAnalytics) AddApplicationReferenceDataSourceRequest(input *AddAp // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation AddApplicationReferenceDataSource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modification to an application. // For example, two individuals attempting to edit the same application at the // same time. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -660,26 +660,26 @@ func (c *KinesisAnalytics) CreateApplicationRequest(input *CreateApplicationInpu // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation CreateApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeCodeValidationException "CodeValidationException" +// Returned Error Types: +// * CodeValidationException // User-provided application code (query) is invalid. This can be a simple syntax // error. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // Exceeded the number of applications allowed. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // Application created with too many tags, or too many tags added to an application. // Note that the maximum number of application tags includes system tags. The // maximum number of user-defined application tags is 50. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modification to an application. // For example, two individuals attempting to edit the same application at the // same time. @@ -771,19 +771,19 @@ func (c *KinesisAnalytics) DeleteApplicationRequest(input *DeleteApplicationInpu // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DeleteApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// Returned Error Types: +// * ConcurrentModificationException // Exception thrown as a result of concurrent modification to an application. // For example, two individuals attempting to edit the same application at the // same time. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -871,22 +871,22 @@ func (c *KinesisAnalytics) DeleteApplicationCloudWatchLoggingOptionRequest(input // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DeleteApplicationCloudWatchLoggingOption for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modification to an application. // For example, two individuals attempting to edit the same application at the // same time. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -973,22 +973,22 @@ func (c *KinesisAnalytics) DeleteApplicationInputProcessingConfigurationRequest( // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DeleteApplicationInputProcessingConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modification to an application. // For example, two individuals attempting to edit the same application at the // same time. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -1079,22 +1079,22 @@ func (c *KinesisAnalytics) DeleteApplicationOutputRequest(input *DeleteApplicati // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DeleteApplicationOutput for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modification to an application. // For example, two individuals attempting to edit the same application at the // same time. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -1189,22 +1189,22 @@ func (c *KinesisAnalytics) DeleteApplicationReferenceDataSourceRequest(input *De // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DeleteApplicationReferenceDataSource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modification to an application. // For example, two individuals attempting to edit the same application at the // same time. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -1297,11 +1297,11 @@ func (c *KinesisAnalytics) DescribeApplicationRequest(input *DescribeApplication // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DescribeApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -1399,21 +1399,21 @@ func (c *KinesisAnalytics) DiscoverInputSchemaRequest(input *DiscoverInputSchema // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DiscoverInputSchema for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeUnableToDetectSchemaException "UnableToDetectSchemaException" +// * UnableToDetectSchemaException // Data format is not valid. Amazon Kinesis Analytics is not able to detect // schema for the given streaming source. // -// * ErrCodeResourceProvisionedThroughputExceededException "ResourceProvisionedThroughputExceededException" +// * ResourceProvisionedThroughputExceededException // Discovery failed to get a record from the streaming source because of the // Amazon Kinesis Streams ProvisionedThroughputExceededException. For more information, // see GetRecords (https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetRecords.html) // in the Amazon Kinesis Streams API Reference. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is unavailable. Back off and retry the operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalytics-2015-08-14/DiscoverInputSchema @@ -1583,14 +1583,14 @@ func (c *KinesisAnalytics) ListTagsForResourceRequest(input *ListTagsForResource // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modification to an application. // For example, two individuals attempting to edit the same application at the // same time. @@ -1693,20 +1693,20 @@ func (c *KinesisAnalytics) StartApplicationRequest(input *StartApplicationInput) // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation StartApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeInvalidApplicationConfigurationException "InvalidApplicationConfigurationException" +// * InvalidApplicationConfigurationException // User-provided application configuration is not valid. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -1799,14 +1799,14 @@ func (c *KinesisAnalytics) StopApplicationRequest(input *StopApplicationInput) ( // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation StopApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -1889,22 +1889,22 @@ func (c *KinesisAnalytics) TagResourceRequest(input *TagResourceInput) (req *req // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // Application created with too many tags, or too many tags added to an application. // Note that the maximum number of application tags includes system tags. The // maximum number of user-defined application tags is 50. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modification to an application. // For example, two individuals attempting to edit the same application at the // same time. @@ -1986,22 +1986,22 @@ func (c *KinesisAnalytics) UntagResourceRequest(input *UntagResourceInput) (req // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // Application created with too many tags, or too many tags added to an application. // Note that the maximum number of application tags includes system tags. The // maximum number of user-defined application tags is 50. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modification to an application. // For example, two individuals attempting to edit the same application at the // same time. @@ -2095,26 +2095,26 @@ func (c *KinesisAnalytics) UpdateApplicationRequest(input *UpdateApplicationInpu // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation UpdateApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeCodeValidationException "CodeValidationException" +// Returned Error Types: +// * CodeValidationException // User-provided application code (query) is invalid. This can be a simple syntax // error. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // Application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // Specified input parameter value is invalid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modification to an application. // For example, two individuals attempting to edit the same application at the // same time. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -3194,6 +3194,122 @@ func (s *CloudWatchLoggingOptionUpdate) SetRoleARNUpdate(v string) *CloudWatchLo return s } +// User-provided application code (query) is invalid. This can be a simple syntax +// error. +type CodeValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Test + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CodeValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CodeValidationException) GoString() string { + return s.String() +} + +func newErrorCodeValidationException(v protocol.ResponseMetadata) error { + return &CodeValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CodeValidationException) Code() string { + return "CodeValidationException" +} + +// Message returns the exception's message. +func (s CodeValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CodeValidationException) OrigErr() error { + return nil +} + +func (s CodeValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CodeValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CodeValidationException) RequestID() string { + return s.respMetadata.RequestID +} + +// Exception thrown as a result of concurrent modification to an application. +// For example, two individuals attempting to edit the same application at the +// same time. +type ConcurrentModificationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentModificationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentModificationException) GoString() string { + return s.String() +} + +func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { + return &ConcurrentModificationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentModificationException) Code() string { + return "ConcurrentModificationException" +} + +// Message returns the exception's message. +func (s ConcurrentModificationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentModificationException) OrigErr() error { + return nil +} + +func (s ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentModificationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentModificationException) RequestID() string { + return s.respMetadata.RequestID +} + // TBD type CreateApplicationInput struct { _ struct{} `type:"structure"` @@ -5007,6 +5123,119 @@ func (s *InputUpdate) SetNamePrefixUpdate(v string) *InputUpdate { return s } +// User-provided application configuration is not valid. +type InvalidApplicationConfigurationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // test + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidApplicationConfigurationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidApplicationConfigurationException) GoString() string { + return s.String() +} + +func newErrorInvalidApplicationConfigurationException(v protocol.ResponseMetadata) error { + return &InvalidApplicationConfigurationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidApplicationConfigurationException) Code() string { + return "InvalidApplicationConfigurationException" +} + +// Message returns the exception's message. +func (s InvalidApplicationConfigurationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidApplicationConfigurationException) OrigErr() error { + return nil +} + +func (s InvalidApplicationConfigurationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidApplicationConfigurationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidApplicationConfigurationException) RequestID() string { + return s.respMetadata.RequestID +} + +// Specified input parameter value is invalid. +type InvalidArgumentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidArgumentException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidArgumentException) GoString() string { + return s.String() +} + +func newErrorInvalidArgumentException(v protocol.ResponseMetadata) error { + return &InvalidArgumentException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidArgumentException) Code() string { + return "InvalidArgumentException" +} + +// Message returns the exception's message. +func (s InvalidArgumentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidArgumentException) OrigErr() error { + return nil +} + +func (s InvalidArgumentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidArgumentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidArgumentException) RequestID() string { + return s.respMetadata.RequestID +} + // Provides additional mapping information when JSON is the record format on // the streaming source. type JSONMappingParameters struct { @@ -5816,6 +6045,62 @@ func (s *LambdaOutputUpdate) SetRoleARNUpdate(v string) *LambdaOutputUpdate { return s } +// Exceeded the number of applications allowed. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListApplicationsInput struct { _ struct{} `type:"structure"` @@ -6689,6 +6974,177 @@ func (s *ReferenceDataSourceUpdate) SetTableNameUpdate(v string) *ReferenceDataS return s } +// Application is not available for this operation. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// Specified application can't be found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Discovery failed to get a record from the streaming source because of the +// Amazon Kinesis Streams ProvisionedThroughputExceededException. For more information, +// see GetRecords (https://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetRecords.html) +// in the Amazon Kinesis Streams API Reference. +type ResourceProvisionedThroughputExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceProvisionedThroughputExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceProvisionedThroughputExceededException) GoString() string { + return s.String() +} + +func newErrorResourceProvisionedThroughputExceededException(v protocol.ResponseMetadata) error { + return &ResourceProvisionedThroughputExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceProvisionedThroughputExceededException) Code() string { + return "ResourceProvisionedThroughputExceededException" +} + +// Message returns the exception's message. +func (s ResourceProvisionedThroughputExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceProvisionedThroughputExceededException) OrigErr() error { + return nil +} + +func (s ResourceProvisionedThroughputExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceProvisionedThroughputExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceProvisionedThroughputExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Provides a description of an Amazon S3 data source, including the Amazon // Resource Name (ARN) of the S3 bucket, the ARN of the IAM role that is used // to access the bucket, and the name of the Amazon S3 object that contains @@ -6967,6 +7423,62 @@ func (s *S3ReferenceDataSourceUpdate) SetReferenceRoleARNUpdate(v string) *S3Ref return s } +// The service is unavailable. Back off and retry the operation. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes the format of the data in the streaming source, and how each data // element maps to corresponding columns created in the in-application stream. type SourceSchema struct { @@ -7323,6 +7835,182 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// Application created with too many tags, or too many tags added to an application. +// Note that the maximum number of application tags includes system tags. The +// maximum number of user-defined application tags is 50. +type TooManyTagsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyTagsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyTagsException) GoString() string { + return s.String() +} + +func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { + return &TooManyTagsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyTagsException) Code() string { + return "TooManyTagsException" +} + +// Message returns the exception's message. +func (s TooManyTagsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTagsException) OrigErr() error { + return nil +} + +func (s TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTagsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyTagsException) RequestID() string { + return s.respMetadata.RequestID +} + +// Data format is not valid. Amazon Kinesis Analytics is not able to detect +// schema for the given streaming source. +type UnableToDetectSchemaException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + ProcessedInputRecords []*string `type:"list"` + + RawInputRecords []*string `type:"list"` +} + +// String returns the string representation +func (s UnableToDetectSchemaException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnableToDetectSchemaException) GoString() string { + return s.String() +} + +func newErrorUnableToDetectSchemaException(v protocol.ResponseMetadata) error { + return &UnableToDetectSchemaException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnableToDetectSchemaException) Code() string { + return "UnableToDetectSchemaException" +} + +// Message returns the exception's message. +func (s UnableToDetectSchemaException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnableToDetectSchemaException) OrigErr() error { + return nil +} + +func (s UnableToDetectSchemaException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnableToDetectSchemaException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnableToDetectSchemaException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because a specified parameter is not supported or +// a specified resource is not valid for this operation. +type UnsupportedOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedOperationException) GoString() string { + return s.String() +} + +func newErrorUnsupportedOperationException(v protocol.ResponseMetadata) error { + return &UnsupportedOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedOperationException) Code() string { + return "UnsupportedOperationException" +} + +// Message returns the exception's message. +func (s UnsupportedOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedOperationException) OrigErr() error { + return nil +} + +func (s UnsupportedOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedOperationException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesisanalytics/errors.go b/vendor/github.com/aws/aws-sdk-go/service/kinesisanalytics/errors.go index 812bac82658..73557f998aa 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesisanalytics/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesisanalytics/errors.go @@ -2,6 +2,10 @@ package kinesisanalytics +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeCodeValidationException for service response error code @@ -86,3 +90,18 @@ const ( // a specified resource is not valid for this operation. ErrCodeUnsupportedOperationException = "UnsupportedOperationException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "CodeValidationException": newErrorCodeValidationException, + "ConcurrentModificationException": newErrorConcurrentModificationException, + "InvalidApplicationConfigurationException": newErrorInvalidApplicationConfigurationException, + "InvalidArgumentException": newErrorInvalidArgumentException, + "LimitExceededException": newErrorLimitExceededException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ResourceProvisionedThroughputExceededException": newErrorResourceProvisionedThroughputExceededException, + "ServiceUnavailableException": newErrorServiceUnavailableException, + "TooManyTagsException": newErrorTooManyTagsException, + "UnableToDetectSchemaException": newErrorUnableToDetectSchemaException, + "UnsupportedOperationException": newErrorUnsupportedOperationException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesisanalytics/service.go b/vendor/github.com/aws/aws-sdk-go/service/kinesisanalytics/service.go index 153daad6eba..7de10edf91c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesisanalytics/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesisanalytics/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "kinesisanalytics" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Kinesis Analytics" // ServiceID is a unique identifer of a specific service. + ServiceID = "Kinesis Analytics" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the KinesisAnalytics client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a KinesisAnalytics client from just a session. // svc := kinesisanalytics.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := kinesisanalytics.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *KinesisAnalytics { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *KinesisAnalytics { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *KinesisAnalytics { svc := &KinesisAnalytics{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-08-14", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesisanalyticsv2/api.go b/vendor/github.com/aws/aws-sdk-go/service/kinesisanalyticsv2/api.go index f547bd1d544..1428e9372f8 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesisanalyticsv2/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesisanalyticsv2/api.go @@ -67,25 +67,25 @@ func (c *KinesisAnalyticsV2) AddApplicationCloudWatchLoggingOptionRequest(input // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation AddApplicationCloudWatchLoggingOption for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modifications to an application. // This error can be the result of attempting to modify an application without // using the current application ID. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // -// * ErrCodeInvalidApplicationConfigurationException "InvalidApplicationConfigurationException" +// * InvalidApplicationConfigurationException // The user-provided application configuration is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/AddApplicationCloudWatchLoggingOption @@ -171,26 +171,26 @@ func (c *KinesisAnalyticsV2) AddApplicationInputRequest(input *AddApplicationInp // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation AddApplicationInput for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modifications to an application. // This error can be the result of attempting to modify an application without // using the current application ID. // -// * ErrCodeCodeValidationException "CodeValidationException" +// * CodeValidationException // The user-provided application code (query) is not valid. This can be a simple // syntax error. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/AddApplicationInput @@ -271,22 +271,22 @@ func (c *KinesisAnalyticsV2) AddApplicationInputProcessingConfigurationRequest(i // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation AddApplicationInputProcessingConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modifications to an application. // This error can be the result of attempting to modify an application without // using the current application ID. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/AddApplicationInputProcessingConfiguration @@ -379,22 +379,22 @@ func (c *KinesisAnalyticsV2) AddApplicationOutputRequest(input *AddApplicationOu // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation AddApplicationOutput for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modifications to an application. // This error can be the result of attempting to modify an application without // using the current application ID. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/AddApplicationOutput @@ -480,22 +480,22 @@ func (c *KinesisAnalyticsV2) AddApplicationReferenceDataSourceRequest(input *Add // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation AddApplicationReferenceDataSource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modifications to an application. // This error can be the result of attempting to modify an application without // using the current application ID. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/AddApplicationReferenceDataSource @@ -520,6 +520,105 @@ func (c *KinesisAnalyticsV2) AddApplicationReferenceDataSourceWithContext(ctx aw return out, req.Send() } +const opAddApplicationVpcConfiguration = "AddApplicationVpcConfiguration" + +// AddApplicationVpcConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the AddApplicationVpcConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AddApplicationVpcConfiguration for more information on using the AddApplicationVpcConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AddApplicationVpcConfigurationRequest method. +// req, resp := client.AddApplicationVpcConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/AddApplicationVpcConfiguration +func (c *KinesisAnalyticsV2) AddApplicationVpcConfigurationRequest(input *AddApplicationVpcConfigurationInput) (req *request.Request, output *AddApplicationVpcConfigurationOutput) { + op := &request.Operation{ + Name: opAddApplicationVpcConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AddApplicationVpcConfigurationInput{} + } + + output = &AddApplicationVpcConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// AddApplicationVpcConfiguration API operation for Amazon Kinesis Analytics. +// +// Adds a Virtual Private Cloud (VPC) configuration to the application. Applications +// can use VPCs to store and access resources securely. +// +// Note the following about VPC configurations for Kinesis Data Analytics applications: +// +// * VPC configurations are not supported for SQL applications. +// +// * When a VPC is added to a Kinesis Data Analytics application, the application +// can no longer be accessed from the Internet directly. To enable Internet +// access to the application, add an Internet gateway to your 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 Kinesis Analytics's +// API operation AddApplicationVpcConfiguration for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// Specified application can't be found. +// +// * ResourceInUseException +// The application is not available for this operation. +// +// * InvalidArgumentException +// The specified input parameter value is not valid. +// +// * ConcurrentModificationException +// Exception thrown as a result of concurrent modifications to an application. +// This error can be the result of attempting to modify an application without +// using the current application ID. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/AddApplicationVpcConfiguration +func (c *KinesisAnalyticsV2) AddApplicationVpcConfiguration(input *AddApplicationVpcConfigurationInput) (*AddApplicationVpcConfigurationOutput, error) { + req, out := c.AddApplicationVpcConfigurationRequest(input) + return out, req.Send() +} + +// AddApplicationVpcConfigurationWithContext is the same as AddApplicationVpcConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See AddApplicationVpcConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KinesisAnalyticsV2) AddApplicationVpcConfigurationWithContext(ctx aws.Context, input *AddApplicationVpcConfigurationInput, opts ...request.Option) (*AddApplicationVpcConfigurationOutput, error) { + req, out := c.AddApplicationVpcConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateApplication = "CreateApplication" // CreateApplicationRequest generates a "aws/request.Request" representing the @@ -575,29 +674,29 @@ func (c *KinesisAnalyticsV2) CreateApplicationRequest(input *CreateApplicationIn // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation CreateApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeCodeValidationException "CodeValidationException" +// Returned Error Types: +// * CodeValidationException // The user-provided application code (query) is not valid. This can be a simple // syntax error. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The number of allowed resources has been exceeded. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // Application created with too many tags, or too many tags added to an application. // Note that the maximum number of application tags includes system tags. The // maximum number of user-defined application tags is 50. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modifications to an application. // This error can be the result of attempting to modify an application without // using the current application ID. @@ -678,24 +777,24 @@ func (c *KinesisAnalyticsV2) CreateApplicationSnapshotRequest(input *CreateAppli // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation CreateApplicationSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The number of allowed resources has been exceeded. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/CreateApplicationSnapshot @@ -775,25 +874,25 @@ func (c *KinesisAnalyticsV2) DeleteApplicationRequest(input *DeleteApplicationIn // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DeleteApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// Returned Error Types: +// * ConcurrentModificationException // Exception thrown as a result of concurrent modifications to an application. // This error can be the result of attempting to modify an application without // using the current application ID. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // -// * ErrCodeInvalidApplicationConfigurationException "InvalidApplicationConfigurationException" +// * InvalidApplicationConfigurationException // The user-provided application configuration is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/DeleteApplication @@ -872,25 +971,25 @@ func (c *KinesisAnalyticsV2) DeleteApplicationCloudWatchLoggingOptionRequest(inp // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DeleteApplicationCloudWatchLoggingOption for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modifications to an application. // This error can be the result of attempting to modify an application without // using the current application ID. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // -// * ErrCodeInvalidApplicationConfigurationException "InvalidApplicationConfigurationException" +// * InvalidApplicationConfigurationException // The user-provided application configuration is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/DeleteApplicationCloudWatchLoggingOption @@ -968,22 +1067,22 @@ func (c *KinesisAnalyticsV2) DeleteApplicationInputProcessingConfigurationReques // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DeleteApplicationInputProcessingConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modifications to an application. // This error can be the result of attempting to modify an application without // using the current application ID. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/DeleteApplicationInputProcessingConfiguration @@ -1064,22 +1163,22 @@ func (c *KinesisAnalyticsV2) DeleteApplicationOutputRequest(input *DeleteApplica // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DeleteApplicationOutput for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modifications to an application. // This error can be the result of attempting to modify an application without // using the current application ID. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/DeleteApplicationOutput @@ -1162,22 +1261,22 @@ func (c *KinesisAnalyticsV2) DeleteApplicationReferenceDataSourceRequest(input * // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DeleteApplicationReferenceDataSource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modifications to an application. // This error can be the result of attempting to modify an application without // using the current application ID. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/DeleteApplicationReferenceDataSource @@ -1256,21 +1355,21 @@ func (c *KinesisAnalyticsV2) DeleteApplicationSnapshotRequest(input *DeleteAppli // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DeleteApplicationSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUseException "ResourceInUseException" +// Returned Error Types: +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Specified application can't be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/DeleteApplicationSnapshot @@ -1295,6 +1394,96 @@ func (c *KinesisAnalyticsV2) DeleteApplicationSnapshotWithContext(ctx aws.Contex return out, req.Send() } +const opDeleteApplicationVpcConfiguration = "DeleteApplicationVpcConfiguration" + +// DeleteApplicationVpcConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteApplicationVpcConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteApplicationVpcConfiguration for more information on using the DeleteApplicationVpcConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteApplicationVpcConfigurationRequest method. +// req, resp := client.DeleteApplicationVpcConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/DeleteApplicationVpcConfiguration +func (c *KinesisAnalyticsV2) DeleteApplicationVpcConfigurationRequest(input *DeleteApplicationVpcConfigurationInput) (req *request.Request, output *DeleteApplicationVpcConfigurationOutput) { + op := &request.Operation{ + Name: opDeleteApplicationVpcConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteApplicationVpcConfigurationInput{} + } + + output = &DeleteApplicationVpcConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteApplicationVpcConfiguration API operation for Amazon Kinesis Analytics. +// +// Removes a VPC configuration from a Kinesis Data Analytics 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 Amazon Kinesis Analytics's +// API operation DeleteApplicationVpcConfiguration for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// Specified application can't be found. +// +// * ResourceInUseException +// The application is not available for this operation. +// +// * InvalidArgumentException +// The specified input parameter value is not valid. +// +// * ConcurrentModificationException +// Exception thrown as a result of concurrent modifications to an application. +// This error can be the result of attempting to modify an application without +// using the current application ID. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/DeleteApplicationVpcConfiguration +func (c *KinesisAnalyticsV2) DeleteApplicationVpcConfiguration(input *DeleteApplicationVpcConfigurationInput) (*DeleteApplicationVpcConfigurationOutput, error) { + req, out := c.DeleteApplicationVpcConfigurationRequest(input) + return out, req.Send() +} + +// DeleteApplicationVpcConfigurationWithContext is the same as DeleteApplicationVpcConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteApplicationVpcConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KinesisAnalyticsV2) DeleteApplicationVpcConfigurationWithContext(ctx aws.Context, input *DeleteApplicationVpcConfigurationInput, opts ...request.Option) (*DeleteApplicationVpcConfigurationOutput, error) { + req, out := c.DeleteApplicationVpcConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeApplication = "DescribeApplication" // DescribeApplicationRequest generates a "aws/request.Request" representing the @@ -1351,14 +1540,14 @@ func (c *KinesisAnalyticsV2) DescribeApplicationRequest(input *DescribeApplicati // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DescribeApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/DescribeApplication @@ -1436,14 +1625,14 @@ func (c *KinesisAnalyticsV2) DescribeApplicationSnapshotRequest(input *DescribeA // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DescribeApplicationSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -1531,24 +1720,24 @@ func (c *KinesisAnalyticsV2) DiscoverInputSchemaRequest(input *DiscoverInputSche // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation DiscoverInputSchema for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeUnableToDetectSchemaException "UnableToDetectSchemaException" +// * UnableToDetectSchemaException // The data format is not valid. Amazon Kinesis Data Analytics cannot detect // the schema for the given streaming source. // -// * ErrCodeResourceProvisionedThroughputExceededException "ResourceProvisionedThroughputExceededException" +// * ResourceProvisionedThroughputExceededException // Discovery failed to get a record from the streaming source because of the // Amazon Kinesis Streams ProvisionedThroughputExceededException. For more information, // see GetRecords (http://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetRecords.html) // in the Amazon Kinesis Streams API Reference. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service cannot complete the request. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/DiscoverInputSchema @@ -1626,11 +1815,11 @@ func (c *KinesisAnalyticsV2) ListApplicationSnapshotsRequest(input *ListApplicat // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation ListApplicationSnapshots for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -1713,8 +1902,8 @@ func (c *KinesisAnalyticsV2) ListApplicationsRequest(input *ListApplicationsInpu // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation ListApplications for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request JSON is not valid for the operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/ListApplications @@ -1783,7 +1972,8 @@ func (c *KinesisAnalyticsV2) ListTagsForResourceRequest(input *ListTagsForResour // ListTagsForResource API operation for Amazon Kinesis Analytics. // -// Retrieves the list of key-value tags assigned to the application. +// Retrieves the list of key-value tags assigned to the application. For more +// information, see Using Tagging (https://docs.aws.amazon.com/kinesisanalytics/latest/java/how-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 @@ -1792,14 +1982,14 @@ func (c *KinesisAnalyticsV2) ListTagsForResourceRequest(input *ListTagsForResour // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modifications to an application. // This error can be the result of attempting to modify an application without // using the current application ID. @@ -1881,20 +2071,20 @@ func (c *KinesisAnalyticsV2) StartApplicationRequest(input *StartApplicationInpu // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation StartApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeInvalidApplicationConfigurationException "InvalidApplicationConfigurationException" +// * InvalidApplicationConfigurationException // The user-provided application configuration is not valid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/StartApplication @@ -1975,20 +2165,20 @@ func (c *KinesisAnalyticsV2) StopApplicationRequest(input *StopApplicationInput) // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation StopApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // -// * ErrCodeInvalidApplicationConfigurationException "InvalidApplicationConfigurationException" +// * InvalidApplicationConfigurationException // The user-provided application configuration is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/StopApplication @@ -2060,7 +2250,8 @@ func (c *KinesisAnalyticsV2) TagResourceRequest(input *TagResourceInput) (req *r // // Adds one or more key-value tags to a Kinesis Analytics application. Note // that the maximum number of application tags includes system tags. The maximum -// number of user-defined application tags is 50. +// number of user-defined application tags is 50. For more information, see +// Using Tagging (https://docs.aws.amazon.com/kinesisanalytics/latest/java/how-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 @@ -2069,22 +2260,22 @@ func (c *KinesisAnalyticsV2) TagResourceRequest(input *TagResourceInput) (req *r // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // Application created with too many tags, or too many tags added to an application. // Note that the maximum number of application tags includes system tags. The // maximum number of user-defined application tags is 50. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modifications to an application. // This error can be the result of attempting to modify an application without // using the current application ID. @@ -2156,7 +2347,8 @@ func (c *KinesisAnalyticsV2) UntagResourceRequest(input *UntagResourceInput) (re // UntagResource API operation for Amazon Kinesis Analytics. // -// Removes one or more tags from a Kinesis Analytics application. +// Removes one or more tags from a Kinesis Analytics application. For more information, +// see Using Tagging (https://docs.aws.amazon.com/kinesisanalytics/latest/java/how-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 @@ -2165,22 +2357,22 @@ func (c *KinesisAnalyticsV2) UntagResourceRequest(input *UntagResourceInput) (re // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeTooManyTagsException "TooManyTagsException" +// * TooManyTagsException // Application created with too many tags, or too many tags added to an application. // Note that the maximum number of application tags includes system tags. The // maximum number of user-defined application tags is 50. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modifications to an application. // This error can be the result of attempting to modify an application without // using the current application ID. @@ -2265,29 +2457,29 @@ func (c *KinesisAnalyticsV2) UpdateApplicationRequest(input *UpdateApplicationIn // See the AWS API reference guide for Amazon Kinesis Analytics's // API operation UpdateApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeCodeValidationException "CodeValidationException" +// Returned Error Types: +// * CodeValidationException // The user-provided application code (query) is not valid. This can be a simple // syntax error. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Specified application can't be found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The application is not available for this operation. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The specified input parameter value is not valid. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // Exception thrown as a result of concurrent modifications to an application. // This error can be the result of attempting to modify an application without // using the current application ID. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request JSON is not valid for the operation. // -// * ErrCodeInvalidApplicationConfigurationException "InvalidApplicationConfigurationException" +// * InvalidApplicationConfigurationException // The user-provided application configuration is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisanalyticsv2-2018-05-23/UpdateApplication @@ -2959,6 +3151,128 @@ func (s *AddApplicationReferenceDataSourceOutput) SetReferenceDataSourceDescript return s } +type AddApplicationVpcConfigurationInput struct { + _ struct{} `type:"structure"` + + // The name of an existing application. + // + // ApplicationName is a required field + ApplicationName *string `min:"1" type:"string" required:"true"` + + // The version of the application to which you want to add the input processing + // configuration. You can use the DescribeApplication operation to get the current + // application version. If the version specified is not the current version, + // the ConcurrentModificationException is returned. + // + // CurrentApplicationVersionId is a required field + CurrentApplicationVersionId *int64 `min:"1" type:"long" required:"true"` + + // Description of the VPC to add to the application. + // + // VpcConfiguration is a required field + VpcConfiguration *VpcConfiguration `type:"structure" required:"true"` +} + +// String returns the string representation +func (s AddApplicationVpcConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddApplicationVpcConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AddApplicationVpcConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AddApplicationVpcConfigurationInput"} + 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.CurrentApplicationVersionId == nil { + invalidParams.Add(request.NewErrParamRequired("CurrentApplicationVersionId")) + } + if s.CurrentApplicationVersionId != nil && *s.CurrentApplicationVersionId < 1 { + invalidParams.Add(request.NewErrParamMinValue("CurrentApplicationVersionId", 1)) + } + if s.VpcConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("VpcConfiguration")) + } + if s.VpcConfiguration != nil { + if err := s.VpcConfiguration.Validate(); err != nil { + invalidParams.AddNested("VpcConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApplicationName sets the ApplicationName field's value. +func (s *AddApplicationVpcConfigurationInput) SetApplicationName(v string) *AddApplicationVpcConfigurationInput { + s.ApplicationName = &v + return s +} + +// SetCurrentApplicationVersionId sets the CurrentApplicationVersionId field's value. +func (s *AddApplicationVpcConfigurationInput) SetCurrentApplicationVersionId(v int64) *AddApplicationVpcConfigurationInput { + s.CurrentApplicationVersionId = &v + return s +} + +// SetVpcConfiguration sets the VpcConfiguration field's value. +func (s *AddApplicationVpcConfigurationInput) SetVpcConfiguration(v *VpcConfiguration) *AddApplicationVpcConfigurationInput { + s.VpcConfiguration = v + return s +} + +type AddApplicationVpcConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the application. + ApplicationARN *string `min:"1" type:"string"` + + // Provides the current application version. Kinesis Data Analytics updates + // the ApplicationVersionId each time you update the application. + ApplicationVersionId *int64 `min:"1" type:"long"` + + // The parameters of the new VPC configuration. + VpcConfigurationDescription *VpcConfigurationDescription `type:"structure"` +} + +// String returns the string representation +func (s AddApplicationVpcConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddApplicationVpcConfigurationOutput) GoString() string { + return s.String() +} + +// SetApplicationARN sets the ApplicationARN field's value. +func (s *AddApplicationVpcConfigurationOutput) SetApplicationARN(v string) *AddApplicationVpcConfigurationOutput { + s.ApplicationARN = &v + return s +} + +// SetApplicationVersionId sets the ApplicationVersionId field's value. +func (s *AddApplicationVpcConfigurationOutput) SetApplicationVersionId(v int64) *AddApplicationVpcConfigurationOutput { + s.ApplicationVersionId = &v + return s +} + +// SetVpcConfigurationDescription sets the VpcConfigurationDescription field's value. +func (s *AddApplicationVpcConfigurationOutput) SetVpcConfigurationDescription(v *VpcConfigurationDescription) *AddApplicationVpcConfigurationOutput { + s.VpcConfigurationDescription = v + return s +} + // Describes code configuration for a Java-based Kinesis Data Analytics application. type ApplicationCodeConfiguration struct { _ struct{} `type:"structure"` @@ -3119,6 +3433,9 @@ type ApplicationConfiguration struct { // The creation and update parameters for an SQL-based Kinesis Data Analytics // application. SqlApplicationConfiguration *SqlApplicationConfiguration `type:"structure"` + + // The array of descriptions of VPC configurations available to the application. + VpcConfigurations []*VpcConfiguration `type:"list"` } // String returns the string representation @@ -3162,6 +3479,16 @@ func (s *ApplicationConfiguration) Validate() error { invalidParams.AddNested("SqlApplicationConfiguration", err.(request.ErrInvalidParams)) } } + if s.VpcConfigurations != nil { + for i, v := range s.VpcConfigurations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "VpcConfigurations", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -3199,6 +3526,12 @@ func (s *ApplicationConfiguration) SetSqlApplicationConfiguration(v *SqlApplicat return s } +// SetVpcConfigurations sets the VpcConfigurations field's value. +func (s *ApplicationConfiguration) SetVpcConfigurations(v []*VpcConfiguration) *ApplicationConfiguration { + s.VpcConfigurations = v + return s +} + // Describes details about the application code and starting parameters for // an Amazon Kinesis Data Analytics application. type ApplicationConfigurationDescription struct { @@ -3224,6 +3557,9 @@ type ApplicationConfigurationDescription struct { // The details about inputs, outputs, and reference data sources for an SQL-based // Kinesis Data Analytics application. SqlApplicationConfigurationDescription *SqlApplicationConfigurationDescription `type:"structure"` + + // The array of descriptions of VPC configurations available to the application. + VpcConfigurationDescriptions []*VpcConfigurationDescription `type:"list"` } // String returns the string representation @@ -3272,6 +3608,12 @@ func (s *ApplicationConfigurationDescription) SetSqlApplicationConfigurationDesc return s } +// SetVpcConfigurationDescriptions sets the VpcConfigurationDescriptions field's value. +func (s *ApplicationConfigurationDescription) SetVpcConfigurationDescriptions(v []*VpcConfigurationDescription) *ApplicationConfigurationDescription { + s.VpcConfigurationDescriptions = v + return s +} + // Describes updates to an application's configuration. type ApplicationConfigurationUpdate struct { _ struct{} `type:"structure"` @@ -3293,6 +3635,10 @@ type ApplicationConfigurationUpdate struct { // Describes updates to an SQL-based Kinesis Data Analytics application's configuration. SqlApplicationConfigurationUpdate *SqlApplicationConfigurationUpdate `type:"structure"` + + // Updates to the array of descriptions of VPC configurations available to the + // application. + VpcConfigurationUpdates []*VpcConfigurationUpdate `type:"list"` } // String returns the string representation @@ -3333,6 +3679,16 @@ func (s *ApplicationConfigurationUpdate) Validate() error { invalidParams.AddNested("SqlApplicationConfigurationUpdate", err.(request.ErrInvalidParams)) } } + if s.VpcConfigurationUpdates != nil { + for i, v := range s.VpcConfigurationUpdates { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "VpcConfigurationUpdates", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -3370,6 +3726,12 @@ func (s *ApplicationConfigurationUpdate) SetSqlApplicationConfigurationUpdate(v return s } +// SetVpcConfigurationUpdates sets the VpcConfigurationUpdates field's value. +func (s *ApplicationConfigurationUpdate) SetVpcConfigurationUpdates(v []*VpcConfigurationUpdate) *ApplicationConfigurationUpdate { + s.VpcConfigurationUpdates = v + return s +} + // Describes the application, including the application Amazon Resource Name // (ARN), status, latest version, and input and output configurations. type ApplicationDetail struct { @@ -3807,23 +4169,46 @@ type CheckpointConfiguration struct { _ struct{} `type:"structure"` // Describes the interval in milliseconds between checkpoint operations. - CheckpointInterval *int64 `type:"long"` + // + // If CheckpointConfiguration.ConfigurationType is DEFAULT, the application + // will use a CheckpointInterval vaue of 60000, even if this value is set to + // another value using this API or in application code. + CheckpointInterval *int64 `min:"1" type:"long"` // Describes whether checkpointing is enabled for a Java-based Kinesis Data // Analytics application. + // + // If CheckpointConfiguration.ConfigurationType is DEFAULT, the application + // will use a CheckpointingEnabled value of true, even if this value is set + // to another value using this API or in application code. CheckpointingEnabled *bool `type:"boolean"` // Describes whether the application uses Amazon Kinesis Data Analytics' default - // checkpointing behavior. + // checkpointing behavior. You must set this property to CUSTOM in order to + // set the CheckpointingEnabled, CheckpointInterval, or MinPauseBetweenCheckpoints + // parameters. // - // ConfigurationType is a required field - ConfigurationType *string `type:"string" required:"true" enum:"ConfigurationType"` + // If this value is set to DEFAULT, the application will use the following values, + // even if they are set to other values using APIs or application code: + // + // * CheckpointingEnabled: true + // + // * CheckpointInterval: 60000 + // + // * MinPauseBetweenCheckpoints: 5000 + // + // ConfigurationType is a required field + ConfigurationType *string `type:"string" required:"true" enum:"ConfigurationType"` // Describes the minimum time in milliseconds after a checkpoint operation completes // that a new checkpoint operation can start. If a checkpoint operation takes // longer than the CheckpointInterval, the application otherwise performs continual // checkpoint operations. For more information, see Tuning Checkpointing (https://ci.apache.org/projects/flink/flink-docs-stable/ops/state/large_state_tuning.html#tuning-checkpointing) // in the Apache Flink Documentation (https://ci.apache.org/projects/flink/flink-docs-release-1.6/). + // + // If CheckpointConfiguration.ConfigurationType is DEFAULT, the application + // will use a MinPauseBetweenCheckpoints value of 5000, even if this value is + // set using this API or in application code. MinPauseBetweenCheckpoints *int64 `type:"long"` } @@ -3840,6 +4225,9 @@ func (s CheckpointConfiguration) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *CheckpointConfiguration) Validate() error { invalidParams := request.ErrInvalidParams{Context: "CheckpointConfiguration"} + if s.CheckpointInterval != nil && *s.CheckpointInterval < 1 { + invalidParams.Add(request.NewErrParamMinValue("CheckpointInterval", 1)) + } if s.ConfigurationType == nil { invalidParams.Add(request.NewErrParamRequired("ConfigurationType")) } @@ -3880,18 +4268,39 @@ type CheckpointConfigurationDescription struct { _ struct{} `type:"structure"` // Describes the interval in milliseconds between checkpoint operations. - CheckpointInterval *int64 `type:"long"` + // + // If CheckpointConfiguration.ConfigurationType is DEFAULT, the application + // will use a CheckpointInterval vaue of 60000, even if this value is set to + // another value using this API or in application code. + CheckpointInterval *int64 `min:"1" type:"long"` // Describes whether checkpointing is enabled for a Java-based Kinesis Data // Analytics application. + // + // If CheckpointConfiguration.ConfigurationType is DEFAULT, the application + // will use a CheckpointingEnabled value of true, even if this value is set + // to another value using this API or in application code. CheckpointingEnabled *bool `type:"boolean"` // Describes whether the application uses the default checkpointing behavior // in Kinesis Data Analytics. + // + // If this value is set to DEFAULT, the application will use the following values, + // even if they are set to other values using APIs or application code: + // + // * CheckpointingEnabled: true + // + // * CheckpointInterval: 60000 + // + // * MinPauseBetweenCheckpoints: 5000 ConfigurationType *string `type:"string" enum:"ConfigurationType"` // Describes the minimum time in milliseconds after a checkpoint operation completes // that a new checkpoint operation can start. + // + // If CheckpointConfiguration.ConfigurationType is DEFAULT, the application + // will use a MinPauseBetweenCheckpoints value of 5000, even if this value is + // set using this API or in application code. MinPauseBetweenCheckpoints *int64 `type:"long"` } @@ -3935,17 +4344,40 @@ type CheckpointConfigurationUpdate struct { _ struct{} `type:"structure"` // Describes updates to the interval in milliseconds between checkpoint operations. - CheckpointIntervalUpdate *int64 `type:"long"` + // + // If CheckpointConfiguration.ConfigurationType is DEFAULT, the application + // will use a CheckpointInterval vaue of 60000, even if this value is set to + // another value using this API or in application code. + CheckpointIntervalUpdate *int64 `min:"1" type:"long"` // Describes updates to whether checkpointing is enabled for an application. + // + // If CheckpointConfiguration.ConfigurationType is DEFAULT, the application + // will use a CheckpointingEnabled value of true, even if this value is set + // to another value using this API or in application code. CheckpointingEnabledUpdate *bool `type:"boolean"` // Describes updates to whether the application uses the default checkpointing - // behavior of Kinesis Data Analytics. + // behavior of Kinesis Data Analytics. You must set this property to CUSTOM + // in order to set the CheckpointingEnabled, CheckpointInterval, or MinPauseBetweenCheckpoints + // parameters. + // + // If this value is set to DEFAULT, the application will use the following values, + // even if they are set to other values using APIs or application code: + // + // * CheckpointingEnabled: true + // + // * CheckpointInterval: 60000 + // + // * MinPauseBetweenCheckpoints: 5000 ConfigurationTypeUpdate *string `type:"string" enum:"ConfigurationType"` // Describes updates to the minimum time in milliseconds after a checkpoint // operation completes that a new checkpoint operation can start. + // + // If CheckpointConfiguration.ConfigurationType is DEFAULT, the application + // will use a MinPauseBetweenCheckpoints value of 5000, even if this value is + // set using this API or in application code. MinPauseBetweenCheckpointsUpdate *int64 `type:"long"` } @@ -3959,6 +4391,19 @@ func (s CheckpointConfigurationUpdate) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *CheckpointConfigurationUpdate) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CheckpointConfigurationUpdate"} + if s.CheckpointIntervalUpdate != nil && *s.CheckpointIntervalUpdate < 1 { + invalidParams.Add(request.NewErrParamMinValue("CheckpointIntervalUpdate", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetCheckpointIntervalUpdate sets the CheckpointIntervalUpdate field's value. func (s *CheckpointConfigurationUpdate) SetCheckpointIntervalUpdate(v int64) *CheckpointConfigurationUpdate { s.CheckpointIntervalUpdate = &v @@ -4303,6 +4748,121 @@ func (s *CodeContentUpdate) SetZipFileContentUpdate(v []byte) *CodeContentUpdate return s } +// The user-provided application code (query) is not valid. This can be a simple +// syntax error. +type CodeValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s CodeValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CodeValidationException) GoString() string { + return s.String() +} + +func newErrorCodeValidationException(v protocol.ResponseMetadata) error { + return &CodeValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CodeValidationException) Code() string { + return "CodeValidationException" +} + +// Message returns the exception's message. +func (s CodeValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CodeValidationException) OrigErr() error { + return nil +} + +func (s CodeValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CodeValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CodeValidationException) RequestID() string { + return s.respMetadata.RequestID +} + +// Exception thrown as a result of concurrent modifications to an application. +// This error can be the result of attempting to modify an application without +// using the current application ID. +type ConcurrentModificationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentModificationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentModificationException) GoString() string { + return s.String() +} + +func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { + return &ConcurrentModificationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentModificationException) Code() string { + return "ConcurrentModificationException" +} + +// Message returns the exception's message. +func (s ConcurrentModificationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentModificationException) OrigErr() error { + return nil +} + +func (s ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentModificationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentModificationException) RequestID() string { + return s.respMetadata.RequestID +} + type CreateApplicationInput struct { _ struct{} `type:"structure"` @@ -4335,8 +4895,7 @@ type CreateApplicationInput struct { // A list of one or more tags to assign to the application. A tag is a key-value // pair that identifies an application. Note that the maximum number of application // tags includes system tags. The maximum number of user-defined application - // tags is 50. For more information, see Using Cost Allocation Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) - // in the AWS Billing and Cost Management Guide. + // tags is 50. For more information, see Using Tagging (https://docs.aws.amazon.com/kinesisanalytics/latest/java/how-tagging.html). Tags []*Tag `min:"1" type:"list"` } @@ -5156,6 +5715,114 @@ func (s DeleteApplicationSnapshotOutput) GoString() string { return s.String() } +type DeleteApplicationVpcConfigurationInput struct { + _ struct{} `type:"structure"` + + // The name of an existing application. + // + // ApplicationName is a required field + ApplicationName *string `min:"1" type:"string" required:"true"` + + // The current application version ID. You can retrieve the application version + // ID using DescribeApplication. + // + // CurrentApplicationVersionId is a required field + CurrentApplicationVersionId *int64 `min:"1" type:"long" required:"true"` + + // The ID of the VPC configuration to delete. + // + // VpcConfigurationId is a required field + VpcConfigurationId *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteApplicationVpcConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteApplicationVpcConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteApplicationVpcConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteApplicationVpcConfigurationInput"} + 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.CurrentApplicationVersionId == nil { + invalidParams.Add(request.NewErrParamRequired("CurrentApplicationVersionId")) + } + if s.CurrentApplicationVersionId != nil && *s.CurrentApplicationVersionId < 1 { + invalidParams.Add(request.NewErrParamMinValue("CurrentApplicationVersionId", 1)) + } + if s.VpcConfigurationId == nil { + invalidParams.Add(request.NewErrParamRequired("VpcConfigurationId")) + } + if s.VpcConfigurationId != nil && len(*s.VpcConfigurationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VpcConfigurationId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApplicationName sets the ApplicationName field's value. +func (s *DeleteApplicationVpcConfigurationInput) SetApplicationName(v string) *DeleteApplicationVpcConfigurationInput { + s.ApplicationName = &v + return s +} + +// SetCurrentApplicationVersionId sets the CurrentApplicationVersionId field's value. +func (s *DeleteApplicationVpcConfigurationInput) SetCurrentApplicationVersionId(v int64) *DeleteApplicationVpcConfigurationInput { + s.CurrentApplicationVersionId = &v + return s +} + +// SetVpcConfigurationId sets the VpcConfigurationId field's value. +func (s *DeleteApplicationVpcConfigurationInput) SetVpcConfigurationId(v string) *DeleteApplicationVpcConfigurationInput { + s.VpcConfigurationId = &v + return s +} + +type DeleteApplicationVpcConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the Kinesis Data Analytics application. + ApplicationARN *string `min:"1" type:"string"` + + // The updated version ID of the application. + ApplicationVersionId *int64 `min:"1" type:"long"` +} + +// String returns the string representation +func (s DeleteApplicationVpcConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteApplicationVpcConfigurationOutput) GoString() string { + return s.String() +} + +// SetApplicationARN sets the ApplicationARN field's value. +func (s *DeleteApplicationVpcConfigurationOutput) SetApplicationARN(v string) *DeleteApplicationVpcConfigurationOutput { + s.ApplicationARN = &v + return s +} + +// SetApplicationVersionId sets the ApplicationVersionId field's value. +func (s *DeleteApplicationVpcConfigurationOutput) SetApplicationVersionId(v int64) *DeleteApplicationVpcConfigurationOutput { + s.ApplicationVersionId = &v + return s +} + type DescribeApplicationInput struct { _ struct{} `type:"structure"` @@ -5785,6 +6452,11 @@ func (s FlinkApplicationConfigurationUpdate) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *FlinkApplicationConfigurationUpdate) Validate() error { invalidParams := request.ErrInvalidParams{Context: "FlinkApplicationConfigurationUpdate"} + if s.CheckpointConfigurationUpdate != nil { + if err := s.CheckpointConfigurationUpdate.Validate(); err != nil { + invalidParams.AddNested("CheckpointConfigurationUpdate", err.(request.ErrInvalidParams)) + } + } if s.ParallelismConfigurationUpdate != nil { if err := s.ParallelismConfigurationUpdate.Validate(); err != nil { invalidParams.AddNested("ParallelismConfigurationUpdate", err.(request.ErrInvalidParams)) @@ -5815,6 +6487,36 @@ func (s *FlinkApplicationConfigurationUpdate) SetParallelismConfigurationUpdate( return s } +// Describes the starting parameters for an Apache Flink-based Kinesis Data +// Analytics application. +type FlinkRunConfiguration struct { + _ struct{} `type:"structure"` + + // When restoring from a savepoint, specifies whether the runtime is allowed + // to skip a state that cannot be mapped to the new program. This will happen + // if the program is updated between savepoints to remove stateful parameters, + // and state data in the savepoint no longer corresponds to valid application + // data. For more information, see Allowing Non-Restored State (https://ci.apache.org/projects/flink/flink-docs-release-1.8/ops/state/savepoints.html#allowing-non-restored-state) + // in the Apache Flink documentation (https://ci.apache.org/projects/flink/flink-docs-release-1.8/). + AllowNonRestoredState *bool `type:"boolean"` +} + +// String returns the string representation +func (s FlinkRunConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FlinkRunConfiguration) GoString() string { + return s.String() +} + +// SetAllowNonRestoredState sets the AllowNonRestoredState field's value. +func (s *FlinkRunConfiguration) SetAllowNonRestoredState(v bool) *FlinkRunConfiguration { + s.AllowNonRestoredState = &v + return s +} + // When you configure the application input for an SQL-based Amazon Kinesis // Data Analytics application, you specify the streaming source, the in-application // stream name that is created, and the mapping between the two. @@ -6635,96 +7337,264 @@ func (s *InputUpdate) SetNamePrefixUpdate(v string) *InputUpdate { return s } -// For an SQL-based Amazon Kinesis Data Analytics application, provides additional -// mapping information when JSON is the record format on the streaming source. -type JSONMappingParameters struct { - _ struct{} `type:"structure"` +// The user-provided application configuration is not valid. +type InvalidApplicationConfigurationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The path to the top-level parent that contains the records. - // - // RecordRowPath is a required field - RecordRowPath *string `min:"1" type:"string" required:"true"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s JSONMappingParameters) String() string { +func (s InvalidApplicationConfigurationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s JSONMappingParameters) GoString() string { +func (s InvalidApplicationConfigurationException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *JSONMappingParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "JSONMappingParameters"} - if s.RecordRowPath == nil { - invalidParams.Add(request.NewErrParamRequired("RecordRowPath")) - } - if s.RecordRowPath != nil && len(*s.RecordRowPath) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RecordRowPath", 1)) +func newErrorInvalidApplicationConfigurationException(v protocol.ResponseMetadata) error { + return &InvalidApplicationConfigurationException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidApplicationConfigurationException) Code() string { + return "InvalidApplicationConfigurationException" +} + +// Message returns the exception's message. +func (s InvalidApplicationConfigurationException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidApplicationConfigurationException) OrigErr() error { return nil } -// SetRecordRowPath sets the RecordRowPath field's value. -func (s *JSONMappingParameters) SetRecordRowPath(v string) *JSONMappingParameters { - s.RecordRowPath = &v - return s +func (s InvalidApplicationConfigurationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// For an SQL-based Amazon Kinesis Data Analytics application, identifies a -// Kinesis Data Firehose delivery stream as the streaming source. You provide -// the delivery stream's Amazon Resource Name (ARN). -type KinesisFirehoseInput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidApplicationConfigurationException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The Amazon Resource Name (ARN) of the delivery stream. - // - // ResourceARN is a required field - ResourceARN *string `min:"1" type:"string" required:"true"` +// RequestID returns the service's response RequestID for request. +func (s InvalidApplicationConfigurationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified input parameter value is not valid. +type InvalidArgumentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s KinesisFirehoseInput) String() string { +func (s InvalidArgumentException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s KinesisFirehoseInput) GoString() string { +func (s InvalidArgumentException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *KinesisFirehoseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KinesisFirehoseInput"} - if s.ResourceARN == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARN")) - } - if s.ResourceARN != nil && len(*s.ResourceARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 1)) +func newErrorInvalidArgumentException(v protocol.ResponseMetadata) error { + return &InvalidArgumentException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidArgumentException) Code() string { + return "InvalidArgumentException" +} + +// Message returns the exception's message. +func (s InvalidArgumentException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidArgumentException) OrigErr() error { return nil } -// SetResourceARN sets the ResourceARN field's value. -func (s *KinesisFirehoseInput) SetResourceARN(v string) *KinesisFirehoseInput { - s.ResourceARN = &v - return s +func (s InvalidArgumentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// Describes the Amazon Kinesis Data Firehose delivery stream that is configured -// as the streaming source in the application input configuration. -type KinesisFirehoseInputDescription struct { +// Status code returns the HTTP status code for the request's response error. +func (s InvalidArgumentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidArgumentException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request JSON is not valid for the operation. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// For an SQL-based Amazon Kinesis Data Analytics application, provides additional +// mapping information when JSON is the record format on the streaming source. +type JSONMappingParameters struct { + _ struct{} `type:"structure"` + + // The path to the top-level parent that contains the records. + // + // RecordRowPath is a required field + RecordRowPath *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s JSONMappingParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s JSONMappingParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *JSONMappingParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "JSONMappingParameters"} + if s.RecordRowPath == nil { + invalidParams.Add(request.NewErrParamRequired("RecordRowPath")) + } + if s.RecordRowPath != nil && len(*s.RecordRowPath) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RecordRowPath", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRecordRowPath sets the RecordRowPath field's value. +func (s *JSONMappingParameters) SetRecordRowPath(v string) *JSONMappingParameters { + s.RecordRowPath = &v + return s +} + +// For an SQL-based Amazon Kinesis Data Analytics application, identifies a +// Kinesis Data Firehose delivery stream as the streaming source. You provide +// the delivery stream's Amazon Resource Name (ARN). +type KinesisFirehoseInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the delivery stream. + // + // ResourceARN is a required field + ResourceARN *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s KinesisFirehoseInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KinesisFirehoseInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *KinesisFirehoseInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "KinesisFirehoseInput"} + 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 *KinesisFirehoseInput) SetResourceARN(v string) *KinesisFirehoseInput { + s.ResourceARN = &v + return s +} + +// Describes the Amazon Kinesis Data Firehose delivery stream that is configured +// as the streaming source in the application input configuration. +type KinesisFirehoseInputDescription struct { _ struct{} `type:"structure"` // The Amazon Resource Name (ARN) of the delivery stream. @@ -7334,6 +8204,62 @@ func (s *LambdaOutputUpdate) SetResourceARNUpdate(v string) *LambdaOutputUpdate return s } +// The number of allowed resources has been exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListApplicationSnapshotsInput struct { _ struct{} `type:"structure"` @@ -7651,7 +8577,8 @@ type MonitoringConfiguration struct { _ struct{} `type:"structure"` // Describes whether to use the default CloudWatch logging configuration for - // an application. + // an application. You must set this property to CUSTOM in order to set the + // LogLevel or MetricsLevel parameters. // // ConfigurationType is a required field ConfigurationType *string `type:"string" required:"true" enum:"ConfigurationType"` @@ -7754,7 +8681,8 @@ type MonitoringConfigurationUpdate struct { _ struct{} `type:"structure"` // Describes updates to whether to use the default CloudWatch logging configuration - // for an application. + // for an application. You must set this property to CUSTOM in order to set + // the LogLevel or MetricsLevel parameters. ConfigurationTypeUpdate *string `type:"string" enum:"ConfigurationType"` // Describes updates to the verbosity of the CloudWatch Logs for an application. @@ -8098,15 +9026,22 @@ type ParallelismConfiguration struct { AutoScalingEnabled *bool `type:"boolean"` // Describes whether the application uses the default parallelism for the Kinesis - // Data Analytics service. + // Data Analytics service. You must set this property to CUSTOM in order to + // change your application's AutoScalingEnabled, Parallelism, or ParallelismPerKPU + // properties. // // ConfigurationType is a required field ConfigurationType *string `type:"string" required:"true" enum:"ConfigurationType"` // Describes the initial number of parallel tasks that a Java-based Kinesis - // Data Analytics application can perform. The Kinesis Data Analytics service - // can increase this number automatically if ParallelismConfiguration$AutoScalingEnabled - // is set to true. + // Data Analytics application can perform. If AutoScalingEnabled is set to True, + // Kinesis Data Analytics increases the CurrentParallelism value in response + // to application load. The service can increase the CurrentParallelism value + // up to the maximum parallelism, which is ParalellismPerKPU times the maximum + // KPUs for the application. The maximum KPUs for an application is 32 by default, + // and can be increased by requesting a limit increase. If application load + // is reduced, the service can reduce the CurrentParallelism value down to the + // Parallelism setting. Parallelism *int64 `min:"1" type:"integer"` // Describes the number of parallel tasks that a Java-based Kinesis Data Analytics @@ -8183,11 +9118,24 @@ type ParallelismConfigurationDescription struct { ConfigurationType *string `type:"string" enum:"ConfigurationType"` // Describes the current number of parallel tasks that a Java-based Kinesis - // Data Analytics application can perform. + // Data Analytics application can perform. If AutoScalingEnabled is set to True, + // Kinesis Data Analytics can increase this value in response to application + // load. The service can increase this value up to the maximum parallelism, + // which is ParalellismPerKPU times the maximum KPUs for the application. The + // maximum KPUs for an application is 32 by default, and can be increased by + // requesting a limit increase. If application load is reduced, the service + // can reduce the CurrentParallelism value down to the Parallelism setting. CurrentParallelism *int64 `min:"1" type:"integer"` // Describes the initial number of parallel tasks that a Java-based Kinesis - // Data Analytics application can perform. + // Data Analytics application can perform. If AutoScalingEnabled is set to True, + // then Kinesis Data Analytics can increase the CurrentParallelism value in + // response to application load. The service can increase CurrentParallelism + // up to the maximum parallelism, which is ParalellismPerKPU times the maximum + // KPUs for the application. The maximum KPUs for an application is 32 by default, + // and can be increased by requesting a limit increase. If application load + // is reduced, the service can reduce the CurrentParallelism value down to the + // Parallelism setting. Parallelism *int64 `min:"1" type:"integer"` // Describes the number of parallel tasks that a Java-based Kinesis Data Analytics @@ -8246,6 +9194,8 @@ type ParallelismConfigurationUpdate struct { // Describes updates to whether the application uses the default parallelism // for the Kinesis Data Analytics service, or if a custom parallelism is used. + // You must set this property to CUSTOM in order to change your application's + // AutoScalingEnabled, Parallelism, or ParallelismPerKPU properties. ConfigurationTypeUpdate *string `type:"string" enum:"ConfigurationType"` // Describes updates to the number of parallel tasks an application can perform @@ -8253,7 +9203,13 @@ type ParallelismConfigurationUpdate struct { ParallelismPerKPUUpdate *int64 `min:"1" type:"integer"` // Describes updates to the initial number of parallel tasks an application - // can perform. + // can perform. If AutoScalingEnabled is set to True, then Kinesis Data Analytics + // can increase the CurrentParallelism value in response to application load. + // The service can increase CurrentParallelism up to the maximum parallelism, + // which is ParalellismPerKPU times the maximum KPUs for the application. The + // maximum KPUs for an application is 32 by default, and can be increased by + // requesting a limit increase. If application load is reduced, the service + // will reduce CurrentParallelism down to the Parallelism setting. ParallelismUpdate *int64 `min:"1" type:"integer"` } @@ -8734,6 +9690,177 @@ func (s *ReferenceDataSourceUpdate) SetTableNameUpdate(v string) *ReferenceDataS return s } +// The application is not available for this operation. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// Specified application can't be found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Discovery failed to get a record from the streaming source because of the +// Amazon Kinesis Streams ProvisionedThroughputExceededException. For more information, +// see GetRecords (http://docs.aws.amazon.com/kinesis/latest/APIReference/API_GetRecords.html) +// in the Amazon Kinesis Streams API Reference. +type ResourceProvisionedThroughputExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceProvisionedThroughputExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceProvisionedThroughputExceededException) GoString() string { + return s.String() +} + +func newErrorResourceProvisionedThroughputExceededException(v protocol.ResponseMetadata) error { + return &ResourceProvisionedThroughputExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceProvisionedThroughputExceededException) Code() string { + return "ResourceProvisionedThroughputExceededException" +} + +// Message returns the exception's message. +func (s ResourceProvisionedThroughputExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceProvisionedThroughputExceededException) OrigErr() error { + return nil +} + +func (s ResourceProvisionedThroughputExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceProvisionedThroughputExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceProvisionedThroughputExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes the starting parameters for an Amazon Kinesis Data Analytics application. type RunConfiguration struct { _ struct{} `type:"structure"` @@ -8741,6 +9868,10 @@ type RunConfiguration struct { // Describes the restore behavior of a restarting application. ApplicationRestoreConfiguration *ApplicationRestoreConfiguration `type:"structure"` + // Describes the starting parameters for an Apache Flink-based Kinesis Data + // Analytics application. + FlinkRunConfiguration *FlinkRunConfiguration `type:"structure"` + // Describes the starting parameters for an SQL-based Kinesis Data Analytics // application. SqlRunConfigurations []*SqlRunConfiguration `type:"list"` @@ -8787,6 +9918,12 @@ func (s *RunConfiguration) SetApplicationRestoreConfiguration(v *ApplicationRest return s } +// SetFlinkRunConfiguration sets the FlinkRunConfiguration field's value. +func (s *RunConfiguration) SetFlinkRunConfiguration(v *FlinkRunConfiguration) *RunConfiguration { + s.FlinkRunConfiguration = v + return s +} + // SetSqlRunConfigurations sets the SqlRunConfigurations field's value. func (s *RunConfiguration) SetSqlRunConfigurations(v []*SqlRunConfiguration) *RunConfiguration { s.SqlRunConfigurations = v @@ -8824,6 +9961,10 @@ type RunConfigurationUpdate struct { // Describes updates to the restore behavior of a restarting application. ApplicationRestoreConfiguration *ApplicationRestoreConfiguration `type:"structure"` + + // Describes the starting parameters for an Apache Flink-based Kinesis Data + // Analytics application. + FlinkRunConfiguration *FlinkRunConfiguration `type:"structure"` } // String returns the string representation @@ -8857,6 +9998,12 @@ func (s *RunConfigurationUpdate) SetApplicationRestoreConfiguration(v *Applicati return s } +// SetFlinkRunConfiguration sets the FlinkRunConfiguration field's value. +func (s *RunConfigurationUpdate) SetFlinkRunConfiguration(v *FlinkRunConfiguration) *RunConfigurationUpdate { + s.FlinkRunConfiguration = v + return s +} + // Describes the location of a Java-based Amazon Kinesis Data Analytics application's // code stored in an S3 bucket. type S3ApplicationCodeLocationDescription struct { @@ -9256,6 +10403,62 @@ func (s *S3ReferenceDataSourceUpdate) SetFileKeyUpdate(v string) *S3ReferenceDat return s } +// The service cannot complete the request. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + // Provides details about a snapshot of application state. type SnapshotDetails struct { _ struct{} `type:"structure"` @@ -9806,9 +11009,7 @@ func (s StopApplicationOutput) GoString() string { // AWS resources. If you specify a tag that already exists, the tag value is // replaced with the value that you specify in the request. Note that the maximum // number of application tags includes system tags. The maximum number of user-defined -// application tags is 50. For more information, see Using Cost Allocation Tags -// (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) -// in the AWS Billing and Cost Management Guide. +// application tags is 50. For more information, see Using Tagging (https://docs.aws.amazon.com/kinesisanalytics/latest/java/how-tagging.html). type Tag struct { _ struct{} `type:"structure"` @@ -9941,6 +11142,185 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// Application created with too many tags, or too many tags added to an application. +// Note that the maximum number of application tags includes system tags. The +// maximum number of user-defined application tags is 50. +type TooManyTagsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyTagsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyTagsException) GoString() string { + return s.String() +} + +func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { + return &TooManyTagsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyTagsException) Code() string { + return "TooManyTagsException" +} + +// Message returns the exception's message. +func (s TooManyTagsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTagsException) OrigErr() error { + return nil +} + +func (s TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTagsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyTagsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The data format is not valid. Amazon Kinesis Data Analytics cannot detect +// the schema for the given streaming source. +type UnableToDetectSchemaException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // Stream data that was modified by the processor specified in the InputProcessingConfiguration + // parameter. + ProcessedInputRecords []*string `type:"list"` + + // Raw stream data that was sampled to infer the schema. + RawInputRecords []*string `type:"list"` +} + +// String returns the string representation +func (s UnableToDetectSchemaException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnableToDetectSchemaException) GoString() string { + return s.String() +} + +func newErrorUnableToDetectSchemaException(v protocol.ResponseMetadata) error { + return &UnableToDetectSchemaException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnableToDetectSchemaException) Code() string { + return "UnableToDetectSchemaException" +} + +// Message returns the exception's message. +func (s UnableToDetectSchemaException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnableToDetectSchemaException) OrigErr() error { + return nil +} + +func (s UnableToDetectSchemaException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnableToDetectSchemaException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnableToDetectSchemaException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because a specified parameter is not supported or +// a specified resource is not valid for this operation. +type UnsupportedOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedOperationException) GoString() string { + return s.String() +} + +func newErrorUnsupportedOperationException(v protocol.ResponseMetadata) error { + return &UnsupportedOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedOperationException) Code() string { + return "UnsupportedOperationException" +} + +// Message returns the exception's message. +func (s UnsupportedOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedOperationException) OrigErr() error { + return nil +} + +func (s UnsupportedOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedOperationException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -10158,6 +11538,196 @@ func (s *UpdateApplicationOutput) SetApplicationDetail(v *ApplicationDetail) *Up return s } +// Describes the parameters of a VPC used by the application. +type VpcConfiguration struct { + _ struct{} `type:"structure"` + + // The array of SecurityGroup (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SecurityGroup.html) + // IDs used by the VPC configuration. + // + // SecurityGroupIds is a required field + SecurityGroupIds []*string `min:"1" type:"list" required:"true"` + + // The array of Subnet (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Subnet.html) + // IDs used by the VPC configuration. + // + // SubnetIds is a required field + SubnetIds []*string `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s VpcConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *VpcConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "VpcConfiguration"} + if s.SecurityGroupIds == nil { + invalidParams.Add(request.NewErrParamRequired("SecurityGroupIds")) + } + if s.SecurityGroupIds != nil && len(s.SecurityGroupIds) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SecurityGroupIds", 1)) + } + if s.SubnetIds == nil { + invalidParams.Add(request.NewErrParamRequired("SubnetIds")) + } + if s.SubnetIds != nil && len(s.SubnetIds) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SubnetIds", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSecurityGroupIds sets the SecurityGroupIds field's value. +func (s *VpcConfiguration) SetSecurityGroupIds(v []*string) *VpcConfiguration { + s.SecurityGroupIds = v + return s +} + +// SetSubnetIds sets the SubnetIds field's value. +func (s *VpcConfiguration) SetSubnetIds(v []*string) *VpcConfiguration { + s.SubnetIds = v + return s +} + +// Describes the parameters of a VPC used by the application. +type VpcConfigurationDescription struct { + _ struct{} `type:"structure"` + + // The array of SecurityGroup (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SecurityGroup.html) + // IDs used by the VPC configuration. + // + // SecurityGroupIds is a required field + SecurityGroupIds []*string `min:"1" type:"list" required:"true"` + + // The array of Subnet (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Subnet.html) + // IDs used by the VPC configuration. + // + // SubnetIds is a required field + SubnetIds []*string `min:"1" type:"list" required:"true"` + + // The ID of the VPC configuration. + // + // VpcConfigurationId is a required field + VpcConfigurationId *string `min:"1" type:"string" required:"true"` + + // The ID of the associated VPC. + // + // VpcId is a required field + VpcId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s VpcConfigurationDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcConfigurationDescription) GoString() string { + return s.String() +} + +// SetSecurityGroupIds sets the SecurityGroupIds field's value. +func (s *VpcConfigurationDescription) SetSecurityGroupIds(v []*string) *VpcConfigurationDescription { + s.SecurityGroupIds = v + return s +} + +// SetSubnetIds sets the SubnetIds field's value. +func (s *VpcConfigurationDescription) SetSubnetIds(v []*string) *VpcConfigurationDescription { + s.SubnetIds = v + return s +} + +// SetVpcConfigurationId sets the VpcConfigurationId field's value. +func (s *VpcConfigurationDescription) SetVpcConfigurationId(v string) *VpcConfigurationDescription { + s.VpcConfigurationId = &v + return s +} + +// SetVpcId sets the VpcId field's value. +func (s *VpcConfigurationDescription) SetVpcId(v string) *VpcConfigurationDescription { + s.VpcId = &v + return s +} + +// Describes updates to the VPC configuration used by the application. +type VpcConfigurationUpdate struct { + _ struct{} `type:"structure"` + + // Describes updates to the array of SecurityGroup (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_SecurityGroup.html) + // IDs used by the VPC configuration. + SecurityGroupIdUpdates []*string `min:"1" type:"list"` + + // Describes updates to the array of Subnet (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_Subnet.html) + // IDs used by the VPC configuration. + SubnetIdUpdates []*string `min:"1" type:"list"` + + // Describes an update to the ID of the VPC configuration. + // + // VpcConfigurationId is a required field + VpcConfigurationId *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s VpcConfigurationUpdate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcConfigurationUpdate) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *VpcConfigurationUpdate) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "VpcConfigurationUpdate"} + if s.SecurityGroupIdUpdates != nil && len(s.SecurityGroupIdUpdates) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SecurityGroupIdUpdates", 1)) + } + if s.SubnetIdUpdates != nil && len(s.SubnetIdUpdates) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SubnetIdUpdates", 1)) + } + if s.VpcConfigurationId == nil { + invalidParams.Add(request.NewErrParamRequired("VpcConfigurationId")) + } + if s.VpcConfigurationId != nil && len(*s.VpcConfigurationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VpcConfigurationId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSecurityGroupIdUpdates sets the SecurityGroupIdUpdates field's value. +func (s *VpcConfigurationUpdate) SetSecurityGroupIdUpdates(v []*string) *VpcConfigurationUpdate { + s.SecurityGroupIdUpdates = v + return s +} + +// SetSubnetIdUpdates sets the SubnetIdUpdates field's value. +func (s *VpcConfigurationUpdate) SetSubnetIdUpdates(v []*string) *VpcConfigurationUpdate { + s.SubnetIdUpdates = v + return s +} + +// SetVpcConfigurationId sets the VpcConfigurationId field's value. +func (s *VpcConfigurationUpdate) SetVpcConfigurationId(v string) *VpcConfigurationUpdate { + s.VpcConfigurationId = &v + return s +} + const ( // ApplicationRestoreTypeSkipRestoreFromSnapshot is a ApplicationRestoreType enum value ApplicationRestoreTypeSkipRestoreFromSnapshot = "SKIP_RESTORE_FROM_SNAPSHOT" @@ -10258,6 +11828,9 @@ const ( // RuntimeEnvironmentFlink16 is a RuntimeEnvironment enum value RuntimeEnvironmentFlink16 = "FLINK-1_6" + + // RuntimeEnvironmentFlink18 is a RuntimeEnvironment enum value + RuntimeEnvironmentFlink18 = "FLINK-1_8" ) const ( diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesisanalyticsv2/errors.go b/vendor/github.com/aws/aws-sdk-go/service/kinesisanalyticsv2/errors.go index f4cac8577d0..85229629717 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesisanalyticsv2/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesisanalyticsv2/errors.go @@ -2,6 +2,10 @@ package kinesisanalyticsv2 +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeCodeValidationException for service response error code @@ -92,3 +96,19 @@ const ( // a specified resource is not valid for this operation. ErrCodeUnsupportedOperationException = "UnsupportedOperationException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "CodeValidationException": newErrorCodeValidationException, + "ConcurrentModificationException": newErrorConcurrentModificationException, + "InvalidApplicationConfigurationException": newErrorInvalidApplicationConfigurationException, + "InvalidArgumentException": newErrorInvalidArgumentException, + "InvalidRequestException": newErrorInvalidRequestException, + "LimitExceededException": newErrorLimitExceededException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ResourceProvisionedThroughputExceededException": newErrorResourceProvisionedThroughputExceededException, + "ServiceUnavailableException": newErrorServiceUnavailableException, + "TooManyTagsException": newErrorTooManyTagsException, + "UnableToDetectSchemaException": newErrorUnableToDetectSchemaException, + "UnsupportedOperationException": newErrorUnsupportedOperationException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesisanalyticsv2/service.go b/vendor/github.com/aws/aws-sdk-go/service/kinesisanalyticsv2/service.go index d066c2e6c70..9dc20825058 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesisanalyticsv2/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesisanalyticsv2/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "Kinesis Analytics V2" // Name of service. EndpointsID = "kinesisanalytics" // ID to lookup a service endpoint with. - ServiceID = "Kinesis Analytics V2" // ServiceID is a unique identifer of a specific service. + ServiceID = "Kinesis Analytics V2" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the KinesisAnalyticsV2 client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a KinesisAnalyticsV2 client from just a session. // svc := kinesisanalyticsv2.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *KinesisAnalyticsV2 { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "kinesisanalytics" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *KinesisAnalyticsV2 { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *KinesisAnalyticsV2 { svc := &KinesisAnalyticsV2{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-05-23", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesisvideo/api.go b/vendor/github.com/aws/aws-sdk-go/service/kinesisvideo/api.go index 7f7f8b44d89..8266d661e4f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesisvideo/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesisvideo/api.go @@ -3,6 +3,7 @@ package kinesisvideo import ( + "fmt" "time" "github.com/aws/aws-sdk-go/aws" @@ -12,6 +13,105 @@ import ( "github.com/aws/aws-sdk-go/private/protocol/restjson" ) +const opCreateSignalingChannel = "CreateSignalingChannel" + +// CreateSignalingChannelRequest generates a "aws/request.Request" representing the +// client's request for the CreateSignalingChannel operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateSignalingChannel for more information on using the CreateSignalingChannel +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateSignalingChannelRequest method. +// req, resp := client.CreateSignalingChannelRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/CreateSignalingChannel +func (c *KinesisVideo) CreateSignalingChannelRequest(input *CreateSignalingChannelInput) (req *request.Request, output *CreateSignalingChannelOutput) { + op := &request.Operation{ + Name: opCreateSignalingChannel, + HTTPMethod: "POST", + HTTPPath: "/createSignalingChannel", + } + + if input == nil { + input = &CreateSignalingChannelInput{} + } + + output = &CreateSignalingChannelOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateSignalingChannel API operation for Amazon Kinesis Video Streams. +// +// Creates a signaling channel. +// +// CreateSignalingChannel is an asynchronous 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 Kinesis Video Streams's +// API operation CreateSignalingChannel for usage and error information. +// +// Returned Error Types: +// * InvalidArgumentException +// The value for this input parameter is invalid. +// +// * ClientLimitExceededException +// Kinesis Video Streams has throttled the request because you have exceeded +// the limit of allowed client calls. Try making the call later. +// +// * AccountChannelLimitExceededException +// You have reached the maximum limit of active signaling channels for this +// AWS account in this region. +// +// * ResourceInUseException +// The stream is currently not available for this operation. +// +// * AccessDeniedException +// You do not have required permissions to perform this operation. +// +// * TagsPerResourceExceededLimitException +// You have exceeded the limit of tags that you can associate with the resource. +// Kinesis video streams support up to 50 tags. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/CreateSignalingChannel +func (c *KinesisVideo) CreateSignalingChannel(input *CreateSignalingChannelInput) (*CreateSignalingChannelOutput, error) { + req, out := c.CreateSignalingChannelRequest(input) + return out, req.Send() +} + +// CreateSignalingChannelWithContext is the same as CreateSignalingChannel with the addition of +// the ability to pass a context and additional request options. +// +// See CreateSignalingChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KinesisVideo) CreateSignalingChannelWithContext(ctx aws.Context, input *CreateSignalingChannelInput, opts ...request.Option) (*CreateSignalingChannelOutput, error) { + req, out := c.CreateSignalingChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateStream = "CreateStream" // CreateStreamRequest generates a "aws/request.Request" representing the @@ -75,27 +175,27 @@ func (c *KinesisVideo) CreateStreamRequest(input *CreateStreamInput) (req *reque // See the AWS API reference guide for Amazon Kinesis Video Streams's // API operation CreateStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccountStreamLimitExceededException "AccountStreamLimitExceededException" +// Returned Error Types: +// * AccountStreamLimitExceededException // The number of streams created for the account is too high. // -// * ErrCodeDeviceStreamLimitExceededException "DeviceStreamLimitExceededException" +// * DeviceStreamLimitExceededException // Not implemented. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The stream is currently not available for this operation. // -// * ErrCodeInvalidDeviceException "InvalidDeviceException" +// * InvalidDeviceException // Not implemented. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The value for this input parameter is invalid. // -// * ErrCodeClientLimitExceededException "ClientLimitExceededException" +// * ClientLimitExceededException // Kinesis Video Streams has throttled the request because you have exceeded // the limit of allowed client calls. Try making the call later. // -// * ErrCodeTagsPerResourceExceededLimitException "TagsPerResourceExceededLimitException" +// * TagsPerResourceExceededLimitException // You have exceeded the limit of tags that you can associate with the resource. // Kinesis video streams support up to 50 tags. // @@ -121,6 +221,103 @@ func (c *KinesisVideo) CreateStreamWithContext(ctx aws.Context, input *CreateStr return out, req.Send() } +const opDeleteSignalingChannel = "DeleteSignalingChannel" + +// DeleteSignalingChannelRequest generates a "aws/request.Request" representing the +// client's request for the DeleteSignalingChannel operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteSignalingChannel for more information on using the DeleteSignalingChannel +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteSignalingChannelRequest method. +// req, resp := client.DeleteSignalingChannelRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/DeleteSignalingChannel +func (c *KinesisVideo) DeleteSignalingChannelRequest(input *DeleteSignalingChannelInput) (req *request.Request, output *DeleteSignalingChannelOutput) { + op := &request.Operation{ + Name: opDeleteSignalingChannel, + HTTPMethod: "POST", + HTTPPath: "/deleteSignalingChannel", + } + + if input == nil { + input = &DeleteSignalingChannelInput{} + } + + output = &DeleteSignalingChannelOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteSignalingChannel API operation for Amazon Kinesis Video Streams. +// +// Deletes a specified signaling channel. DeleteSignalingChannel is an asynchronous +// operation. If you don't specify the channel's current version, the most recent +// version is 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 Kinesis Video Streams's +// API operation DeleteSignalingChannel for usage and error information. +// +// Returned Error Types: +// * InvalidArgumentException +// The value for this input parameter is invalid. +// +// * ClientLimitExceededException +// Kinesis Video Streams has throttled the request because you have exceeded +// the limit of allowed client calls. Try making the call later. +// +// * ResourceNotFoundException +// Amazon Kinesis Video Streams can't find the stream that you specified. +// +// * AccessDeniedException +// You do not have required permissions to perform this operation. +// +// * VersionMismatchException +// The stream version that you specified is not the latest version. To get the +// latest version, use the DescribeStream (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_DescribeStream.html) +// API. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/DeleteSignalingChannel +func (c *KinesisVideo) DeleteSignalingChannel(input *DeleteSignalingChannelInput) (*DeleteSignalingChannelOutput, error) { + req, out := c.DeleteSignalingChannelRequest(input) + return out, req.Send() +} + +// DeleteSignalingChannelWithContext is the same as DeleteSignalingChannel with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteSignalingChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KinesisVideo) DeleteSignalingChannelWithContext(ctx aws.Context, input *DeleteSignalingChannelInput, opts ...request.Option) (*DeleteSignalingChannelOutput, error) { + req, out := c.DeleteSignalingChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteStream = "DeleteStream" // DeleteStreamRequest generates a "aws/request.Request" representing the @@ -186,21 +383,21 @@ func (c *KinesisVideo) DeleteStreamRequest(input *DeleteStreamInput) (req *reque // See the AWS API reference guide for Amazon Kinesis Video Streams's // API operation DeleteStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientLimitExceededException "ClientLimitExceededException" +// Returned Error Types: +// * ClientLimitExceededException // Kinesis Video Streams has throttled the request because you have exceeded // the limit of allowed client calls. Try making the call later. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The value for this input parameter is invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Amazon Kinesis Video Streams can't find the stream that you specified. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // The caller is not authorized to perform this operation. // -// * ErrCodeVersionMismatchException "VersionMismatchException" +// * VersionMismatchException // The stream version that you specified is not the latest version. To get the // latest version, use the DescribeStream (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_DescribeStream.html) // API. @@ -227,6 +424,96 @@ func (c *KinesisVideo) DeleteStreamWithContext(ctx aws.Context, input *DeleteStr return out, req.Send() } +const opDescribeSignalingChannel = "DescribeSignalingChannel" + +// DescribeSignalingChannelRequest generates a "aws/request.Request" representing the +// client's request for the DescribeSignalingChannel operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeSignalingChannel for more information on using the DescribeSignalingChannel +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeSignalingChannelRequest method. +// req, resp := client.DescribeSignalingChannelRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/DescribeSignalingChannel +func (c *KinesisVideo) DescribeSignalingChannelRequest(input *DescribeSignalingChannelInput) (req *request.Request, output *DescribeSignalingChannelOutput) { + op := &request.Operation{ + Name: opDescribeSignalingChannel, + HTTPMethod: "POST", + HTTPPath: "/describeSignalingChannel", + } + + if input == nil { + input = &DescribeSignalingChannelInput{} + } + + output = &DescribeSignalingChannelOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeSignalingChannel API operation for Amazon Kinesis Video Streams. +// +// Returns the most current information about the signaling channel. You must +// specify either the name or the ARN of the channel that you want to describe. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Video Streams's +// API operation DescribeSignalingChannel for usage and error information. +// +// Returned Error Types: +// * InvalidArgumentException +// The value for this input parameter is invalid. +// +// * ClientLimitExceededException +// Kinesis Video Streams has throttled the request because you have exceeded +// the limit of allowed client calls. Try making the call later. +// +// * ResourceNotFoundException +// Amazon Kinesis Video Streams can't find the stream that you specified. +// +// * AccessDeniedException +// You do not have required permissions to perform this operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/DescribeSignalingChannel +func (c *KinesisVideo) DescribeSignalingChannel(input *DescribeSignalingChannelInput) (*DescribeSignalingChannelOutput, error) { + req, out := c.DescribeSignalingChannelRequest(input) + return out, req.Send() +} + +// DescribeSignalingChannelWithContext is the same as DescribeSignalingChannel with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSignalingChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KinesisVideo) DescribeSignalingChannelWithContext(ctx aws.Context, input *DescribeSignalingChannelInput, opts ...request.Option) (*DescribeSignalingChannelOutput, error) { + req, out := c.DescribeSignalingChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeStream = "DescribeStream" // DescribeStreamRequest generates a "aws/request.Request" representing the @@ -281,18 +568,18 @@ func (c *KinesisVideo) DescribeStreamRequest(input *DescribeStreamInput) (req *r // See the AWS API reference guide for Amazon Kinesis Video Streams's // API operation DescribeStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // The value for this input parameter is invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Amazon Kinesis Video Streams can't find the stream that you specified. // -// * ErrCodeClientLimitExceededException "ClientLimitExceededException" +// * ClientLimitExceededException // Kinesis Video Streams has throttled the request because you have exceeded // the limit of allowed client calls. Try making the call later. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // The caller is not authorized to perform this operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/DescribeStream @@ -378,18 +665,18 @@ func (c *KinesisVideo) GetDataEndpointRequest(input *GetDataEndpointInput) (req // See the AWS API reference guide for Amazon Kinesis Video Streams's // API operation GetDataEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// Returned Error Types: +// * InvalidArgumentException // The value for this input parameter is invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Amazon Kinesis Video Streams can't find the stream that you specified. // -// * ErrCodeClientLimitExceededException "ClientLimitExceededException" +// * ClientLimitExceededException // Kinesis Video Streams has throttled the request because you have exceeded // the limit of allowed client calls. Try making the call later. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // The caller is not authorized to perform this operation. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/GetDataEndpoint @@ -414,754 +701,2090 @@ func (c *KinesisVideo) GetDataEndpointWithContext(ctx aws.Context, input *GetDat return out, req.Send() } -const opListStreams = "ListStreams" +const opGetSignalingChannelEndpoint = "GetSignalingChannelEndpoint" -// ListStreamsRequest generates a "aws/request.Request" representing the -// client's request for the ListStreams operation. The "output" return +// GetSignalingChannelEndpointRequest generates a "aws/request.Request" representing the +// client's request for the GetSignalingChannelEndpoint operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListStreams for more information on using the ListStreams +// See GetSignalingChannelEndpoint for more information on using the GetSignalingChannelEndpoint // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListStreamsRequest method. -// req, resp := client.ListStreamsRequest(params) +// // Example sending a request using the GetSignalingChannelEndpointRequest method. +// req, resp := client.GetSignalingChannelEndpointRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/ListStreams -func (c *KinesisVideo) ListStreamsRequest(input *ListStreamsInput) (req *request.Request, output *ListStreamsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/GetSignalingChannelEndpoint +func (c *KinesisVideo) GetSignalingChannelEndpointRequest(input *GetSignalingChannelEndpointInput) (req *request.Request, output *GetSignalingChannelEndpointOutput) { op := &request.Operation{ - Name: opListStreams, + Name: opGetSignalingChannelEndpoint, HTTPMethod: "POST", - HTTPPath: "/listStreams", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, + HTTPPath: "/getSignalingChannelEndpoint", } if input == nil { - input = &ListStreamsInput{} + input = &GetSignalingChannelEndpointInput{} } - output = &ListStreamsOutput{} + output = &GetSignalingChannelEndpointOutput{} req = c.newRequest(op, input, output) return } -// ListStreams API operation for Amazon Kinesis Video Streams. +// GetSignalingChannelEndpoint API operation for Amazon Kinesis Video Streams. // -// Returns an array of StreamInfo objects. Each object describes a stream. To -// retrieve only streams that satisfy a specific condition, you can specify -// a StreamNameCondition. +// Provides an endpoint for the specified signaling channel to send and receive +// messages. This API uses the SingleMasterChannelEndpointConfiguration input +// parameter, which consists of the Protocols and Role properties. +// +// Protocols is used to determine the communication mechanism. For example, +// specifying WSS as the protocol, results in this API producing a secure websocket +// endpoint, and specifying HTTPS as the protocol, results in this API generating +// an HTTPS endpoint. +// +// Role determines the messaging permissions. A MASTER role results in this +// API generating an endpoint that a client can use to communicate with any +// of the viewers on the channel. A VIEWER role results in this API generating +// an endpoint that a client can use to communicate only with a MASTER. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 Video Streams's -// API operation ListStreams for usage and error information. +// API operation GetSignalingChannelEndpoint for usage and error information. +// +// Returned Error Types: +// * InvalidArgumentException +// The value for this input parameter is invalid. // -// Returned Error Codes: -// * ErrCodeClientLimitExceededException "ClientLimitExceededException" +// * ClientLimitExceededException // Kinesis Video Streams has throttled the request because you have exceeded // the limit of allowed client calls. Try making the call later. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// The value for this input parameter is invalid. +// * ResourceNotFoundException +// Amazon Kinesis Video Streams can't find the stream that you specified. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/ListStreams -func (c *KinesisVideo) ListStreams(input *ListStreamsInput) (*ListStreamsOutput, error) { - req, out := c.ListStreamsRequest(input) +// * ResourceInUseException +// The stream is currently not available for this operation. +// +// * AccessDeniedException +// You do not have required permissions to perform this operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/GetSignalingChannelEndpoint +func (c *KinesisVideo) GetSignalingChannelEndpoint(input *GetSignalingChannelEndpointInput) (*GetSignalingChannelEndpointOutput, error) { + req, out := c.GetSignalingChannelEndpointRequest(input) return out, req.Send() } -// ListStreamsWithContext is the same as ListStreams with the addition of +// GetSignalingChannelEndpointWithContext is the same as GetSignalingChannelEndpoint with the addition of // the ability to pass a context and additional request options. // -// See ListStreams for details on how to use this API operation. +// See GetSignalingChannelEndpoint for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *KinesisVideo) ListStreamsWithContext(ctx aws.Context, input *ListStreamsInput, opts ...request.Option) (*ListStreamsOutput, error) { - req, out := c.ListStreamsRequest(input) +func (c *KinesisVideo) GetSignalingChannelEndpointWithContext(ctx aws.Context, input *GetSignalingChannelEndpointInput, opts ...request.Option) (*GetSignalingChannelEndpointOutput, error) { + req, out := c.GetSignalingChannelEndpointRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListStreamsPages iterates over the pages of a ListStreams operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. +const opListSignalingChannels = "ListSignalingChannels" + +// ListSignalingChannelsRequest generates a "aws/request.Request" representing the +// client's request for the ListSignalingChannels operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. // -// See ListStreams method for more information on how to use this operation. +// 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. // -// Note: This operation can generate multiple requests to a service. +// See ListSignalingChannels for more information on using the ListSignalingChannels +// API call, and error handling. // -// // Example iterating over at most 3 pages of a ListStreams operation. -// pageNum := 0 -// err := client.ListStreamsPages(params, -// func(page *kinesisvideo.ListStreamsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// 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. // -func (c *KinesisVideo) ListStreamsPages(input *ListStreamsInput, fn func(*ListStreamsOutput, bool) bool) error { - return c.ListStreamsPagesWithContext(aws.BackgroundContext(), input, fn) -} +// +// // Example sending a request using the ListSignalingChannelsRequest method. +// req, resp := client.ListSignalingChannelsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/ListSignalingChannels +func (c *KinesisVideo) ListSignalingChannelsRequest(input *ListSignalingChannelsInput) (req *request.Request, output *ListSignalingChannelsOutput) { + op := &request.Operation{ + Name: opListSignalingChannels, + HTTPMethod: "POST", + HTTPPath: "/listSignalingChannels", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } -// ListStreamsPagesWithContext same as ListStreamsPages except + if input == nil { + input = &ListSignalingChannelsInput{} + } + + output = &ListSignalingChannelsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListSignalingChannels API operation for Amazon Kinesis Video Streams. +// +// Returns an array of ChannelInfo objects. Each object describes a signaling +// channel. To retrieve only those channels that satisfy a specific condition, +// you can specify a ChannelNameCondition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Video Streams's +// API operation ListSignalingChannels for usage and error information. +// +// Returned Error Types: +// * InvalidArgumentException +// The value for this input parameter is invalid. +// +// * ClientLimitExceededException +// Kinesis Video Streams has throttled the request because you have exceeded +// the limit of allowed client calls. Try making the call later. +// +// * AccessDeniedException +// You do not have required permissions to perform this operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/ListSignalingChannels +func (c *KinesisVideo) ListSignalingChannels(input *ListSignalingChannelsInput) (*ListSignalingChannelsOutput, error) { + req, out := c.ListSignalingChannelsRequest(input) + return out, req.Send() +} + +// ListSignalingChannelsWithContext is the same as ListSignalingChannels with the addition of +// the ability to pass a context and additional request options. +// +// See ListSignalingChannels for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KinesisVideo) ListSignalingChannelsWithContext(ctx aws.Context, input *ListSignalingChannelsInput, opts ...request.Option) (*ListSignalingChannelsOutput, error) { + req, out := c.ListSignalingChannelsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListSignalingChannelsPages iterates over the pages of a ListSignalingChannels operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListSignalingChannels 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 ListSignalingChannels operation. +// pageNum := 0 +// err := client.ListSignalingChannelsPages(params, +// func(page *kinesisvideo.ListSignalingChannelsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *KinesisVideo) ListSignalingChannelsPages(input *ListSignalingChannelsInput, fn func(*ListSignalingChannelsOutput, bool) bool) error { + return c.ListSignalingChannelsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListSignalingChannelsPagesWithContext same as ListSignalingChannelsPages 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 *KinesisVideo) ListStreamsPagesWithContext(ctx aws.Context, input *ListStreamsInput, fn func(*ListStreamsOutput, bool) bool, opts ...request.Option) error { +func (c *KinesisVideo) ListSignalingChannelsPagesWithContext(ctx aws.Context, input *ListSignalingChannelsInput, fn func(*ListSignalingChannelsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *ListStreamsInput + var inCpy *ListSignalingChannelsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.ListStreamsRequest(inCpy) + req, _ := c.ListSignalingChannelsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStreamsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListSignalingChannelsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opListTagsForStream = "ListTagsForStream" +const opListStreams = "ListStreams" -// ListTagsForStreamRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForStream operation. The "output" return +// ListStreamsRequest generates a "aws/request.Request" representing the +// client's request for the ListStreams operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListTagsForStream for more information on using the ListTagsForStream +// See ListStreams for more information on using the ListStreams // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListTagsForStreamRequest method. -// req, resp := client.ListTagsForStreamRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/ListTagsForStream -func (c *KinesisVideo) ListTagsForStreamRequest(input *ListTagsForStreamInput) (req *request.Request, output *ListTagsForStreamOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/ListStreams +func (c *KinesisVideo) ListStreamsRequest(input *ListStreamsInput) (req *request.Request, output *ListStreamsOutput) { op := &request.Operation{ - Name: opListTagsForStream, + Name: opListStreams, HTTPMethod: "POST", - HTTPPath: "/listTagsForStream", + HTTPPath: "/listStreams", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &ListTagsForStreamInput{} + input = &ListStreamsInput{} } - output = &ListTagsForStreamOutput{} + output = &ListStreamsOutput{} req = c.newRequest(op, input, output) return } -// ListTagsForStream API operation for Amazon Kinesis Video Streams. -// -// Returns a list of tags associated with the specified stream. +// ListStreams API operation for Amazon Kinesis Video Streams. // -// In the request, you must specify either the StreamName or the StreamARN. +// Returns an array of StreamInfo objects. Each object describes a stream. To +// retrieve only streams that satisfy a specific condition, you can specify +// a StreamNameCondition. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 Video Streams's -// API operation ListTagsForStream for usage and error information. +// API operation ListStreams for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientLimitExceededException "ClientLimitExceededException" +// Returned Error Types: +// * ClientLimitExceededException // Kinesis Video Streams has throttled the request because you have exceeded // the limit of allowed client calls. Try making the call later. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The value for this input parameter is invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// Amazon Kinesis Video Streams can't find the stream that you specified. -// -// * ErrCodeNotAuthorizedException "NotAuthorizedException" -// The caller is not authorized to perform this operation. -// -// * ErrCodeInvalidResourceFormatException "InvalidResourceFormatException" -// The format of the StreamARN is invalid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/ListTagsForStream -func (c *KinesisVideo) ListTagsForStream(input *ListTagsForStreamInput) (*ListTagsForStreamOutput, error) { - req, out := c.ListTagsForStreamRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/ListStreams +func (c *KinesisVideo) ListStreams(input *ListStreamsInput) (*ListStreamsOutput, error) { + req, out := c.ListStreamsRequest(input) return out, req.Send() } -// ListTagsForStreamWithContext is the same as ListTagsForStream with the addition of +// ListStreamsWithContext is the same as ListStreams with the addition of // the ability to pass a context and additional request options. // -// See ListTagsForStream for details on how to use this API operation. +// See ListStreams for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *KinesisVideo) ListTagsForStreamWithContext(ctx aws.Context, input *ListTagsForStreamInput, opts ...request.Option) (*ListTagsForStreamOutput, error) { - req, out := c.ListTagsForStreamRequest(input) +func (c *KinesisVideo) ListStreamsWithContext(ctx aws.Context, input *ListStreamsInput, opts ...request.Option) (*ListStreamsOutput, error) { + req, out := c.ListStreamsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opTagStream = "TagStream" +// 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 *kinesisvideo.ListStreamsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *KinesisVideo) ListStreamsPages(input *ListStreamsInput, fn func(*ListStreamsOutput, bool) bool) error { + return c.ListStreamsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// TagStreamRequest generates a "aws/request.Request" representing the -// client's request for the TagStream operation. The "output" return +// ListStreamsPagesWithContext same as ListStreamsPages except +// it takes a Context and allows setting request options on the pages. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KinesisVideo) ListStreamsPagesWithContext(ctx aws.Context, input *ListStreamsInput, fn func(*ListStreamsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListStreamsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListStreamsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListStreamsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See TagStream for more information on using the TagStream +// See ListTagsForResource for more information on using the ListTagsForResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the TagStreamRequest method. -// req, resp := client.TagStreamRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/TagStream -func (c *KinesisVideo) TagStreamRequest(input *TagStreamInput) (req *request.Request, output *TagStreamOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/ListTagsForResource +func (c *KinesisVideo) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { op := &request.Operation{ - Name: opTagStream, + Name: opListTagsForResource, HTTPMethod: "POST", - HTTPPath: "/tagStream", + HTTPPath: "/ListTagsForResource", } if input == nil { - input = &TagStreamInput{} + input = &ListTagsForResourceInput{} } - output = &TagStreamOutput{} + output = &ListTagsForResourceOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// TagStream API operation for Amazon Kinesis Video Streams. -// -// Adds one or more tags to a stream. A tag is a key-value pair (the value is -// optional) that you can define and assign to AWS resources. If you specify -// a tag that already exists, the tag value is replaced with the value that -// you specify in the request. For more information, see Using Cost Allocation -// Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) -// in the AWS Billing and Cost Management User Guide. -// -// You must provide either the StreamName or the StreamARN. +// ListTagsForResource API operation for Amazon Kinesis Video Streams. // -// This operation requires permission for the KinesisVideo:TagStream action. -// -// Kinesis video streams support up to 50 tags. +// Returns a list of tags associated with the specified signaling channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 Video Streams's -// API operation TagStream for usage and error information. +// API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientLimitExceededException "ClientLimitExceededException" +// Returned Error Types: +// * InvalidArgumentException +// The value for this input parameter is invalid. +// +// * ClientLimitExceededException // Kinesis Video Streams has throttled the request because you have exceeded // the limit of allowed client calls. Try making the call later. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// The value for this input parameter is invalid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Amazon Kinesis Video Streams can't find the stream that you specified. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" -// The caller is not authorized to perform this operation. -// -// * ErrCodeInvalidResourceFormatException "InvalidResourceFormatException" -// The format of the StreamARN is invalid. -// -// * ErrCodeTagsPerResourceExceededLimitException "TagsPerResourceExceededLimitException" -// You have exceeded the limit of tags that you can associate with the resource. -// Kinesis video streams support up to 50 tags. +// * AccessDeniedException +// You do not have required permissions to perform this operation. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/TagStream -func (c *KinesisVideo) TagStream(input *TagStreamInput) (*TagStreamOutput, error) { - req, out := c.TagStreamRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/ListTagsForResource +func (c *KinesisVideo) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) return out, req.Send() } -// TagStreamWithContext is the same as TagStream with the addition of +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of // the ability to pass a context and additional request options. // -// See TagStream for details on how to use this API operation. +// See ListTagsForResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *KinesisVideo) TagStreamWithContext(ctx aws.Context, input *TagStreamInput, opts ...request.Option) (*TagStreamOutput, error) { - req, out := c.TagStreamRequest(input) +func (c *KinesisVideo) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUntagStream = "UntagStream" +const opListTagsForStream = "ListTagsForStream" -// UntagStreamRequest generates a "aws/request.Request" representing the -// client's request for the UntagStream operation. The "output" return +// ListTagsForStreamRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForStream operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UntagStream for more information on using the UntagStream +// See ListTagsForStream for more information on using the ListTagsForStream // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UntagStreamRequest method. -// req, resp := client.UntagStreamRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UntagStream -func (c *KinesisVideo) UntagStreamRequest(input *UntagStreamInput) (req *request.Request, output *UntagStreamOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/ListTagsForStream +func (c *KinesisVideo) ListTagsForStreamRequest(input *ListTagsForStreamInput) (req *request.Request, output *ListTagsForStreamOutput) { op := &request.Operation{ - Name: opUntagStream, + Name: opListTagsForStream, HTTPMethod: "POST", - HTTPPath: "/untagStream", + HTTPPath: "/listTagsForStream", } if input == nil { - input = &UntagStreamInput{} + input = &ListTagsForStreamInput{} } - output = &UntagStreamOutput{} + output = &ListTagsForStreamOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UntagStream API operation for Amazon Kinesis Video Streams. +// ListTagsForStream API operation for Amazon Kinesis Video Streams. // -// Removes one or more tags from a stream. In the request, specify only a tag -// key or keys; don't specify the value. If you specify a tag key that does -// not exist, it's ignored. +// Returns a list of tags associated with the specified stream. // -// In the request, you must provide the StreamName or StreamARN. +// In the request, you must specify either the StreamName or the StreamARN. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 Video Streams's -// API operation UntagStream for usage and error information. +// API operation ListTagsForStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientLimitExceededException "ClientLimitExceededException" +// Returned Error Types: +// * ClientLimitExceededException // Kinesis Video Streams has throttled the request because you have exceeded // the limit of allowed client calls. Try making the call later. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The value for this input parameter is invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Amazon Kinesis Video Streams can't find the stream that you specified. // -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // The caller is not authorized to perform this operation. // -// * ErrCodeInvalidResourceFormatException "InvalidResourceFormatException" +// * InvalidResourceFormatException // The format of the StreamARN is invalid. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UntagStream -func (c *KinesisVideo) UntagStream(input *UntagStreamInput) (*UntagStreamOutput, error) { - req, out := c.UntagStreamRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/ListTagsForStream +func (c *KinesisVideo) ListTagsForStream(input *ListTagsForStreamInput) (*ListTagsForStreamOutput, error) { + req, out := c.ListTagsForStreamRequest(input) return out, req.Send() } -// UntagStreamWithContext is the same as UntagStream with the addition of +// ListTagsForStreamWithContext is the same as ListTagsForStream with the addition of // the ability to pass a context and additional request options. // -// See UntagStream for details on how to use this API operation. +// See ListTagsForStream for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *KinesisVideo) UntagStreamWithContext(ctx aws.Context, input *UntagStreamInput, opts ...request.Option) (*UntagStreamOutput, error) { - req, out := c.UntagStreamRequest(input) +func (c *KinesisVideo) ListTagsForStreamWithContext(ctx aws.Context, input *ListTagsForStreamInput, opts ...request.Option) (*ListTagsForStreamOutput, error) { + req, out := c.ListTagsForStreamRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateDataRetention = "UpdateDataRetention" +const opTagResource = "TagResource" -// UpdateDataRetentionRequest generates a "aws/request.Request" representing the -// client's request for the UpdateDataRetention operation. The "output" return +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateDataRetention for more information on using the UpdateDataRetention +// See TagResource for more information on using the TagResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateDataRetentionRequest method. -// req, resp := client.UpdateDataRetentionRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UpdateDataRetention -func (c *KinesisVideo) UpdateDataRetentionRequest(input *UpdateDataRetentionInput) (req *request.Request, output *UpdateDataRetentionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/TagResource +func (c *KinesisVideo) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { op := &request.Operation{ - Name: opUpdateDataRetention, + Name: opTagResource, HTTPMethod: "POST", - HTTPPath: "/updateDataRetention", + HTTPPath: "/TagResource", } if input == nil { - input = &UpdateDataRetentionInput{} + input = &TagResourceInput{} } - output = &UpdateDataRetentionOutput{} + output = &TagResourceOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateDataRetention API operation for Amazon Kinesis Video Streams. -// -// Increases or decreases the stream's data retention period by the value that -// you specify. To indicate whether you want to increase or decrease the data -// retention period, specify the Operation parameter in the request body. In -// the request, you must specify either the StreamName or the StreamARN. -// -// The retention period that you specify replaces the current value. -// -// This operation requires permission for the KinesisVideo:UpdateDataRetention -// action. -// -// Changing the data retention period affects the data in the stream as follows: -// -// * If the data retention period is increased, existing data is retained -// for the new retention period. For example, if the data retention period -// is increased from one hour to seven hours, all existing data is retained -// for seven hours. +// TagResource API operation for Amazon Kinesis Video Streams. // -// * If the data retention period is decreased, existing data is retained -// for the new retention period. For example, if the data retention period -// is decreased from seven hours to one hour, all existing data is retained -// for one hour, and any data older than one hour is deleted immediately. +// Adds one or more tags to a signaling channel. A tag is a key-value pair (the +// value is optional) that you can define and assign to AWS resources. If you +// specify a tag that already exists, the tag value is replaced with the value +// that you specify in the request. For more information, see Using Cost Allocation +// Tags (https://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 Kinesis Video Streams's -// API operation UpdateDataRetention for usage and error information. +// API operation TagResource for usage and error information. +// +// Returned Error Types: +// * InvalidArgumentException +// The value for this input parameter is invalid. // -// Returned Error Codes: -// * ErrCodeClientLimitExceededException "ClientLimitExceededException" +// * ClientLimitExceededException // Kinesis Video Streams has throttled the request because you have exceeded // the limit of allowed client calls. Try making the call later. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" -// The value for this input parameter is invalid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Amazon Kinesis Video Streams can't find the stream that you specified. // -// * ErrCodeResourceInUseException "ResourceInUseException" -// The stream is currently not available for this operation. -// -// * ErrCodeNotAuthorizedException "NotAuthorizedException" -// The caller is not authorized to perform this operation. +// * AccessDeniedException +// You do not have required permissions to perform this operation. // -// * ErrCodeVersionMismatchException "VersionMismatchException" -// The stream version that you specified is not the latest version. To get the -// latest version, use the DescribeStream (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_DescribeStream.html) -// API. +// * TagsPerResourceExceededLimitException +// You have exceeded the limit of tags that you can associate with the resource. +// Kinesis video streams support up to 50 tags. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UpdateDataRetention -func (c *KinesisVideo) UpdateDataRetention(input *UpdateDataRetentionInput) (*UpdateDataRetentionOutput, error) { - req, out := c.UpdateDataRetentionRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/TagResource +func (c *KinesisVideo) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) return out, req.Send() } -// UpdateDataRetentionWithContext is the same as UpdateDataRetention with the addition of +// TagResourceWithContext is the same as TagResource with the addition of // the ability to pass a context and additional request options. // -// See UpdateDataRetention for details on how to use this API operation. +// See TagResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *KinesisVideo) UpdateDataRetentionWithContext(ctx aws.Context, input *UpdateDataRetentionInput, opts ...request.Option) (*UpdateDataRetentionOutput, error) { - req, out := c.UpdateDataRetentionRequest(input) +func (c *KinesisVideo) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateStream = "UpdateStream" +const opTagStream = "TagStream" -// UpdateStreamRequest generates a "aws/request.Request" representing the -// client's request for the UpdateStream operation. The "output" return +// TagStreamRequest generates a "aws/request.Request" representing the +// client's request for the TagStream operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateStream for more information on using the UpdateStream +// See TagStream for more information on using the TagStream // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateStreamRequest method. -// req, resp := client.UpdateStreamRequest(params) +// // Example sending a request using the TagStreamRequest method. +// req, resp := client.TagStreamRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UpdateStream -func (c *KinesisVideo) UpdateStreamRequest(input *UpdateStreamInput) (req *request.Request, output *UpdateStreamOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/TagStream +func (c *KinesisVideo) TagStreamRequest(input *TagStreamInput) (req *request.Request, output *TagStreamOutput) { op := &request.Operation{ - Name: opUpdateStream, + Name: opTagStream, HTTPMethod: "POST", - HTTPPath: "/updateStream", + HTTPPath: "/tagStream", } if input == nil { - input = &UpdateStreamInput{} + input = &TagStreamInput{} } - output = &UpdateStreamOutput{} + output = &TagStreamOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateStream API operation for Amazon Kinesis Video Streams. +// TagStream API operation for Amazon Kinesis Video Streams. // -// Updates stream metadata, such as the device name and media type. +// Adds one or more tags to a stream. A tag is a key-value pair (the value is +// optional) that you can define and assign to AWS resources. If you specify +// a tag that already exists, the tag value is replaced with the value that +// you specify in the request. For more information, see Using Cost Allocation +// Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) +// in the AWS Billing and Cost Management User Guide. // -// You must provide the stream name or the Amazon Resource Name (ARN) of the -// stream. +// You must provide either the StreamName or the StreamARN. // -// To make sure that you have the latest version of the stream before updating -// it, you can specify the stream version. Kinesis Video Streams assigns a version -// to each stream. When you update a stream, Kinesis Video Streams assigns a -// new version number. To get the latest stream version, use the DescribeStream -// API. +// This operation requires permission for the KinesisVideo:TagStream action. // -// UpdateStream is an asynchronous operation, and takes time to complete. +// Kinesis video streams support up to 50 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 Kinesis Video Streams's -// API operation UpdateStream for usage and error information. +// API operation TagStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeClientLimitExceededException "ClientLimitExceededException" +// Returned Error Types: +// * ClientLimitExceededException // Kinesis Video Streams has throttled the request because you have exceeded // the limit of allowed client calls. Try making the call later. // -// * ErrCodeInvalidArgumentException "InvalidArgumentException" +// * InvalidArgumentException // The value for this input parameter is invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Amazon Kinesis Video Streams can't find the stream that you specified. // -// * ErrCodeResourceInUseException "ResourceInUseException" -// The stream is currently not available for this operation. -// -// * ErrCodeNotAuthorizedException "NotAuthorizedException" +// * NotAuthorizedException // The caller is not authorized to perform this operation. // -// * ErrCodeVersionMismatchException "VersionMismatchException" -// The stream version that you specified is not the latest version. To get the -// latest version, use the DescribeStream (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_DescribeStream.html) -// API. +// * InvalidResourceFormatException +// The format of the StreamARN is invalid. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UpdateStream -func (c *KinesisVideo) UpdateStream(input *UpdateStreamInput) (*UpdateStreamOutput, error) { - req, out := c.UpdateStreamRequest(input) +// * TagsPerResourceExceededLimitException +// You have exceeded the limit of tags that you can associate with the resource. +// Kinesis video streams support up to 50 tags. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/TagStream +func (c *KinesisVideo) TagStream(input *TagStreamInput) (*TagStreamOutput, error) { + req, out := c.TagStreamRequest(input) return out, req.Send() } -// UpdateStreamWithContext is the same as UpdateStream with the addition of +// TagStreamWithContext is the same as TagStream with the addition of // the ability to pass a context and additional request options. // -// See UpdateStream for details on how to use this API operation. +// See TagStream for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *KinesisVideo) UpdateStreamWithContext(ctx aws.Context, input *UpdateStreamInput, opts ...request.Option) (*UpdateStreamOutput, error) { - req, out := c.UpdateStreamRequest(input) +func (c *KinesisVideo) TagStreamWithContext(ctx aws.Context, input *TagStreamInput, opts ...request.Option) (*TagStreamOutput, error) { + req, out := c.TagStreamRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -type CreateStreamInput struct { - _ struct{} `type:"structure"` - - // The number of hours that you want to retain the data in the stream. Kinesis - // Video Streams retains the data in a data store that is associated with the - // stream. - // - // The default value is 0, indicating that the stream does not persist data. - // - // When the DataRetentionInHours value is 0, consumers can still consume the - // fragments that remain in the service host buffer, which has a retention time - // limit of 5 minutes and a retention memory limit of 200 MB. Fragments are - // removed from the buffer when either limit is reached. - DataRetentionInHours *int64 `type:"integer"` - - // The name of the device that is writing to the stream. - // - // In the current implementation, Kinesis Video Streams does not use this name. - DeviceName *string `min:"1" type:"string"` - - // The ID of the AWS Key Management Service (AWS KMS) key that you want Kinesis - // Video Streams to use to encrypt stream data. - // - // If no key ID is specified, the default, Kinesis Video-managed key (aws/kinesisvideo) - // is used. - // - // For more information, see DescribeKey (https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters). - KmsKeyId *string `min:"1" type:"string"` +const opUntagResource = "UntagResource" - // The media type of the stream. Consumers of the stream can use this information - // when processing the stream. For more information about media types, see Media - // Types (http://www.iana.org/assignments/media-types/media-types.xhtml). If - // you choose to specify the MediaType, see Naming Requirements (https://tools.ietf.org/html/rfc6838#section-4.2) - // for guidelines. - // - // This parameter is optional; the default value is null (or empty in JSON). - MediaType *string `min:"1" type:"string"` +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UntagResource +func (c *KinesisVideo) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { + op := &request.Operation{ + Name: opUntagResource, + HTTPMethod: "POST", + HTTPPath: "/UntagResource", + } - // A name for the stream that you are creating. - // - // The stream name is an identifier for the stream, and must be unique for each - // account and region. - // - // StreamName is a required field - StreamName *string `min:"1" type:"string" required:"true"` + if input == nil { + input = &UntagResourceInput{} + } - // A list of tags to associate with the specified stream. Each tag is a key-value - // pair (the value is optional). - Tags map[string]*string `min:"1" type:"map"` + output = &UntagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return } -// String returns the string representation -func (s CreateStreamInput) String() string { - return awsutil.Prettify(s) +// UntagResource API operation for Amazon Kinesis Video Streams. +// +// Removes one or more tags from a signaling channel. In the request, specify +// only a tag key or keys; don't specify the value. If you specify a tag key +// that does not exist, it's 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 Video Streams's +// API operation UntagResource for usage and error information. +// +// Returned Error Types: +// * InvalidArgumentException +// The value for this input parameter is invalid. +// +// * ClientLimitExceededException +// Kinesis Video Streams has throttled the request because you have exceeded +// the limit of allowed client calls. Try making the call later. +// +// * ResourceNotFoundException +// Amazon Kinesis Video Streams can't find the stream that you specified. +// +// * AccessDeniedException +// You do not have required permissions to perform this operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UntagResource +func (c *KinesisVideo) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() } -// GoString returns the string representation -func (s CreateStreamInput) GoString() string { - return s.String() +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KinesisVideo) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -// 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.DeviceName != nil && len(*s.DeviceName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DeviceName", 1)) - } - if s.KmsKeyId != nil && len(*s.KmsKeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyId", 1)) +const opUntagStream = "UntagStream" + +// UntagStreamRequest generates a "aws/request.Request" representing the +// client's request for the UntagStream operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagStream for more information on using the UntagStream +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagStreamRequest method. +// req, resp := client.UntagStreamRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UntagStream +func (c *KinesisVideo) UntagStreamRequest(input *UntagStreamInput) (req *request.Request, output *UntagStreamOutput) { + op := &request.Operation{ + Name: opUntagStream, + HTTPMethod: "POST", + HTTPPath: "/untagStream", + } + + if input == nil { + input = &UntagStreamInput{} + } + + output = &UntagStreamOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagStream API operation for Amazon Kinesis Video Streams. +// +// Removes one or more tags from a stream. In the request, specify only a tag +// key or keys; don't specify the value. If you specify a tag key that does +// not exist, it's ignored. +// +// In the request, you must provide the StreamName or StreamARN. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Video Streams's +// API operation UntagStream for usage and error information. +// +// Returned Error Types: +// * ClientLimitExceededException +// Kinesis Video Streams has throttled the request because you have exceeded +// the limit of allowed client calls. Try making the call later. +// +// * InvalidArgumentException +// The value for this input parameter is invalid. +// +// * ResourceNotFoundException +// Amazon Kinesis Video Streams can't find the stream that you specified. +// +// * NotAuthorizedException +// The caller is not authorized to perform this operation. +// +// * InvalidResourceFormatException +// The format of the StreamARN is invalid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UntagStream +func (c *KinesisVideo) UntagStream(input *UntagStreamInput) (*UntagStreamOutput, error) { + req, out := c.UntagStreamRequest(input) + return out, req.Send() +} + +// UntagStreamWithContext is the same as UntagStream with the addition of +// the ability to pass a context and additional request options. +// +// See UntagStream for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KinesisVideo) UntagStreamWithContext(ctx aws.Context, input *UntagStreamInput, opts ...request.Option) (*UntagStreamOutput, error) { + req, out := c.UntagStreamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateDataRetention = "UpdateDataRetention" + +// UpdateDataRetentionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDataRetention operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateDataRetention for more information on using the UpdateDataRetention +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateDataRetentionRequest method. +// req, resp := client.UpdateDataRetentionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UpdateDataRetention +func (c *KinesisVideo) UpdateDataRetentionRequest(input *UpdateDataRetentionInput) (req *request.Request, output *UpdateDataRetentionOutput) { + op := &request.Operation{ + Name: opUpdateDataRetention, + HTTPMethod: "POST", + HTTPPath: "/updateDataRetention", + } + + if input == nil { + input = &UpdateDataRetentionInput{} + } + + output = &UpdateDataRetentionOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateDataRetention API operation for Amazon Kinesis Video Streams. +// +// Increases or decreases the stream's data retention period by the value that +// you specify. To indicate whether you want to increase or decrease the data +// retention period, specify the Operation parameter in the request body. In +// the request, you must specify either the StreamName or the StreamARN. +// +// The retention period that you specify replaces the current value. +// +// This operation requires permission for the KinesisVideo:UpdateDataRetention +// action. +// +// Changing the data retention period affects the data in the stream as follows: +// +// * If the data retention period is increased, existing data is retained +// for the new retention period. For example, if the data retention period +// is increased from one hour to seven hours, all existing data is retained +// for seven hours. +// +// * If the data retention period is decreased, existing data is retained +// for the new retention period. For example, if the data retention period +// is decreased from seven hours to one hour, all existing data is retained +// for one hour, and any data older than one hour is deleted 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 Amazon Kinesis Video Streams's +// API operation UpdateDataRetention for usage and error information. +// +// Returned Error Types: +// * ClientLimitExceededException +// Kinesis Video Streams has throttled the request because you have exceeded +// the limit of allowed client calls. Try making the call later. +// +// * InvalidArgumentException +// The value for this input parameter is invalid. +// +// * ResourceNotFoundException +// Amazon Kinesis Video Streams can't find the stream that you specified. +// +// * ResourceInUseException +// The stream is currently not available for this operation. +// +// * NotAuthorizedException +// The caller is not authorized to perform this operation. +// +// * VersionMismatchException +// The stream version that you specified is not the latest version. To get the +// latest version, use the DescribeStream (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_DescribeStream.html) +// API. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UpdateDataRetention +func (c *KinesisVideo) UpdateDataRetention(input *UpdateDataRetentionInput) (*UpdateDataRetentionOutput, error) { + req, out := c.UpdateDataRetentionRequest(input) + return out, req.Send() +} + +// UpdateDataRetentionWithContext is the same as UpdateDataRetention with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDataRetention for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KinesisVideo) UpdateDataRetentionWithContext(ctx aws.Context, input *UpdateDataRetentionInput, opts ...request.Option) (*UpdateDataRetentionOutput, error) { + req, out := c.UpdateDataRetentionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateSignalingChannel = "UpdateSignalingChannel" + +// UpdateSignalingChannelRequest generates a "aws/request.Request" representing the +// client's request for the UpdateSignalingChannel operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateSignalingChannel for more information on using the UpdateSignalingChannel +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateSignalingChannelRequest method. +// req, resp := client.UpdateSignalingChannelRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UpdateSignalingChannel +func (c *KinesisVideo) UpdateSignalingChannelRequest(input *UpdateSignalingChannelInput) (req *request.Request, output *UpdateSignalingChannelOutput) { + op := &request.Operation{ + Name: opUpdateSignalingChannel, + HTTPMethod: "POST", + HTTPPath: "/updateSignalingChannel", + } + + if input == nil { + input = &UpdateSignalingChannelInput{} + } + + output = &UpdateSignalingChannelOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateSignalingChannel API operation for Amazon Kinesis Video Streams. +// +// Updates the existing signaling channel. This is an asynchronous operation +// and takes time to complete. +// +// If the MessageTtlSeconds value is updated (either increased or reduced), +// then it only applies to new messages sent via this channel after it's been +// updated. Existing messages are still expire as per the previous MessageTtlSeconds +// 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 Kinesis Video Streams's +// API operation UpdateSignalingChannel for usage and error information. +// +// Returned Error Types: +// * InvalidArgumentException +// The value for this input parameter is invalid. +// +// * ClientLimitExceededException +// Kinesis Video Streams has throttled the request because you have exceeded +// the limit of allowed client calls. Try making the call later. +// +// * ResourceNotFoundException +// Amazon Kinesis Video Streams can't find the stream that you specified. +// +// * ResourceInUseException +// The stream is currently not available for this operation. +// +// * AccessDeniedException +// You do not have required permissions to perform this operation. +// +// * VersionMismatchException +// The stream version that you specified is not the latest version. To get the +// latest version, use the DescribeStream (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_DescribeStream.html) +// API. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UpdateSignalingChannel +func (c *KinesisVideo) UpdateSignalingChannel(input *UpdateSignalingChannelInput) (*UpdateSignalingChannelOutput, error) { + req, out := c.UpdateSignalingChannelRequest(input) + return out, req.Send() +} + +// UpdateSignalingChannelWithContext is the same as UpdateSignalingChannel with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSignalingChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KinesisVideo) UpdateSignalingChannelWithContext(ctx aws.Context, input *UpdateSignalingChannelInput, opts ...request.Option) (*UpdateSignalingChannelOutput, error) { + req, out := c.UpdateSignalingChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateStream = "UpdateStream" + +// UpdateStreamRequest generates a "aws/request.Request" representing the +// client's request for the UpdateStream operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateStream for more information on using the UpdateStream +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateStreamRequest method. +// req, resp := client.UpdateStreamRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UpdateStream +func (c *KinesisVideo) UpdateStreamRequest(input *UpdateStreamInput) (req *request.Request, output *UpdateStreamOutput) { + op := &request.Operation{ + Name: opUpdateStream, + HTTPMethod: "POST", + HTTPPath: "/updateStream", + } + + if input == nil { + input = &UpdateStreamInput{} + } + + output = &UpdateStreamOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateStream API operation for Amazon Kinesis Video Streams. +// +// Updates stream metadata, such as the device name and media type. +// +// You must provide the stream name or the Amazon Resource Name (ARN) of the +// stream. +// +// To make sure that you have the latest version of the stream before updating +// it, you can specify the stream version. Kinesis Video Streams assigns a version +// to each stream. When you update a stream, Kinesis Video Streams assigns a +// new version number. To get the latest stream version, use the DescribeStream +// API. +// +// UpdateStream is an asynchronous operation, and takes time 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 Amazon Kinesis Video Streams's +// API operation UpdateStream for usage and error information. +// +// Returned Error Types: +// * ClientLimitExceededException +// Kinesis Video Streams has throttled the request because you have exceeded +// the limit of allowed client calls. Try making the call later. +// +// * InvalidArgumentException +// The value for this input parameter is invalid. +// +// * ResourceNotFoundException +// Amazon Kinesis Video Streams can't find the stream that you specified. +// +// * ResourceInUseException +// The stream is currently not available for this operation. +// +// * NotAuthorizedException +// The caller is not authorized to perform this operation. +// +// * VersionMismatchException +// The stream version that you specified is not the latest version. To get the +// latest version, use the DescribeStream (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_DescribeStream.html) +// API. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kinesisvideo-2017-09-30/UpdateStream +func (c *KinesisVideo) UpdateStream(input *UpdateStreamInput) (*UpdateStreamOutput, error) { + req, out := c.UpdateStreamRequest(input) + return out, req.Send() +} + +// UpdateStreamWithContext is the same as UpdateStream with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateStream for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KinesisVideo) UpdateStreamWithContext(ctx aws.Context, input *UpdateStreamInput, opts ...request.Option) (*UpdateStreamOutput, error) { + req, out := c.UpdateStreamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// You do not have required permissions to perform this operation. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +// You have reached the maximum limit of active signaling channels for this +// AWS account in this region. +type AccountChannelLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccountChannelLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountChannelLimitExceededException) GoString() string { + return s.String() +} + +func newErrorAccountChannelLimitExceededException(v protocol.ResponseMetadata) error { + return &AccountChannelLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccountChannelLimitExceededException) Code() string { + return "AccountChannelLimitExceededException" +} + +// Message returns the exception's message. +func (s AccountChannelLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccountChannelLimitExceededException) OrigErr() error { + return nil +} + +func (s AccountChannelLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccountChannelLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccountChannelLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The number of streams created for the account is too high. +type AccountStreamLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccountStreamLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountStreamLimitExceededException) GoString() string { + return s.String() +} + +func newErrorAccountStreamLimitExceededException(v protocol.ResponseMetadata) error { + return &AccountStreamLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccountStreamLimitExceededException) Code() string { + return "AccountStreamLimitExceededException" +} + +// Message returns the exception's message. +func (s AccountStreamLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccountStreamLimitExceededException) OrigErr() error { + return nil +} + +func (s AccountStreamLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccountStreamLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccountStreamLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// A structure that encapsulates a signaling channel's metadata and properties. +type ChannelInfo struct { + _ struct{} `type:"structure"` + + // The ARN of the signaling channel. + ChannelARN *string `min:"1" type:"string"` + + // The name of the signaling channel. + ChannelName *string `min:"1" type:"string"` + + // Current status of the signaling channel. + ChannelStatus *string `type:"string" enum:"Status"` + + // The type of the signaling channel. + ChannelType *string `type:"string" enum:"ChannelType"` + + // The time at which the signaling channel was created. + CreationTime *time.Time `type:"timestamp"` + + // A structure that contains the configuration for the SINGLE_MASTER channel + // type. + SingleMasterConfiguration *SingleMasterConfiguration `type:"structure"` + + // The current version of the signaling channel. + Version *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ChannelInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChannelInfo) GoString() string { + return s.String() +} + +// SetChannelARN sets the ChannelARN field's value. +func (s *ChannelInfo) SetChannelARN(v string) *ChannelInfo { + s.ChannelARN = &v + return s +} + +// SetChannelName sets the ChannelName field's value. +func (s *ChannelInfo) SetChannelName(v string) *ChannelInfo { + s.ChannelName = &v + return s +} + +// SetChannelStatus sets the ChannelStatus field's value. +func (s *ChannelInfo) SetChannelStatus(v string) *ChannelInfo { + s.ChannelStatus = &v + return s +} + +// SetChannelType sets the ChannelType field's value. +func (s *ChannelInfo) SetChannelType(v string) *ChannelInfo { + s.ChannelType = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *ChannelInfo) SetCreationTime(v time.Time) *ChannelInfo { + s.CreationTime = &v + return s +} + +// SetSingleMasterConfiguration sets the SingleMasterConfiguration field's value. +func (s *ChannelInfo) SetSingleMasterConfiguration(v *SingleMasterConfiguration) *ChannelInfo { + s.SingleMasterConfiguration = v + return s +} + +// SetVersion sets the Version field's value. +func (s *ChannelInfo) SetVersion(v string) *ChannelInfo { + s.Version = &v + return s +} + +// An optional input parameter for the ListSignalingChannels API. When this +// parameter is specified while invoking ListSignalingChannels, the API returns +// only the channels that satisfy a condition specified in ChannelNameCondition. +type ChannelNameCondition struct { + _ struct{} `type:"structure"` + + // A comparison operator. Currently, you can only specify the BEGINS_WITH operator, + // which finds signaling channels whose names begin with a given prefix. + ComparisonOperator *string `type:"string" enum:"ComparisonOperator"` + + // A value to compare. + ComparisonValue *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ChannelNameCondition) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChannelNameCondition) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ChannelNameCondition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ChannelNameCondition"} + if s.ComparisonValue != nil && len(*s.ComparisonValue) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ComparisonValue", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComparisonOperator sets the ComparisonOperator field's value. +func (s *ChannelNameCondition) SetComparisonOperator(v string) *ChannelNameCondition { + s.ComparisonOperator = &v + return s +} + +// SetComparisonValue sets the ComparisonValue field's value. +func (s *ChannelNameCondition) SetComparisonValue(v string) *ChannelNameCondition { + s.ComparisonValue = &v + return s +} + +// Kinesis Video Streams has throttled the request because you have exceeded +// the limit of allowed client calls. Try making the call later. +type ClientLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ClientLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClientLimitExceededException) GoString() string { + return s.String() +} + +func newErrorClientLimitExceededException(v protocol.ResponseMetadata) error { + return &ClientLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ClientLimitExceededException) Code() string { + return "ClientLimitExceededException" +} + +// Message returns the exception's message. +func (s ClientLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ClientLimitExceededException) OrigErr() error { + return nil +} + +func (s ClientLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ClientLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ClientLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +type CreateSignalingChannelInput struct { + _ struct{} `type:"structure"` + + // A name for the signaling channel that you are creating. It must be unique + // for each account and region. + // + // ChannelName is a required field + ChannelName *string `min:"1" type:"string" required:"true"` + + // A type of the signaling channel that you are creating. Currently, SINGLE_MASTER + // is the only supported channel type. + ChannelType *string `type:"string" enum:"ChannelType"` + + // A structure containing the configuration for the SINGLE_MASTER channel type. + SingleMasterConfiguration *SingleMasterConfiguration `type:"structure"` + + // A set of tags (key/value pairs) that you want to associate with this channel. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s CreateSignalingChannelInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSignalingChannelInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateSignalingChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateSignalingChannelInput"} + if s.ChannelName == nil { + invalidParams.Add(request.NewErrParamRequired("ChannelName")) + } + if s.ChannelName != nil && len(*s.ChannelName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) + } + if s.SingleMasterConfiguration != nil { + if err := s.SingleMasterConfiguration.Validate(); err != nil { + invalidParams.AddNested("SingleMasterConfiguration", 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 +} + +// SetChannelName sets the ChannelName field's value. +func (s *CreateSignalingChannelInput) SetChannelName(v string) *CreateSignalingChannelInput { + s.ChannelName = &v + return s +} + +// SetChannelType sets the ChannelType field's value. +func (s *CreateSignalingChannelInput) SetChannelType(v string) *CreateSignalingChannelInput { + s.ChannelType = &v + return s +} + +// SetSingleMasterConfiguration sets the SingleMasterConfiguration field's value. +func (s *CreateSignalingChannelInput) SetSingleMasterConfiguration(v *SingleMasterConfiguration) *CreateSignalingChannelInput { + s.SingleMasterConfiguration = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateSignalingChannelInput) SetTags(v []*Tag) *CreateSignalingChannelInput { + s.Tags = v + return s +} + +type CreateSignalingChannelOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the created channel. + ChannelARN *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateSignalingChannelOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSignalingChannelOutput) GoString() string { + return s.String() +} + +// SetChannelARN sets the ChannelARN field's value. +func (s *CreateSignalingChannelOutput) SetChannelARN(v string) *CreateSignalingChannelOutput { + s.ChannelARN = &v + return s +} + +type CreateStreamInput struct { + _ struct{} `type:"structure"` + + // The number of hours that you want to retain the data in the stream. Kinesis + // Video Streams retains the data in a data store that is associated with the + // stream. + // + // The default value is 0, indicating that the stream does not persist data. + // + // When the DataRetentionInHours value is 0, consumers can still consume the + // fragments that remain in the service host buffer, which has a retention time + // limit of 5 minutes and a retention memory limit of 200 MB. Fragments are + // removed from the buffer when either limit is reached. + DataRetentionInHours *int64 `type:"integer"` + + // The name of the device that is writing to the stream. + // + // In the current implementation, Kinesis Video Streams does not use this name. + DeviceName *string `min:"1" type:"string"` + + // The ID of the AWS Key Management Service (AWS KMS) key that you want Kinesis + // Video Streams to use to encrypt stream data. + // + // If no key ID is specified, the default, Kinesis Video-managed key (aws/kinesisvideo) + // is used. + // + // For more information, see DescribeKey (https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters). + KmsKeyId *string `min:"1" type:"string"` + + // The media type of the stream. Consumers of the stream can use this information + // when processing the stream. For more information about media types, see Media + // Types (http://www.iana.org/assignments/media-types/media-types.xhtml). If + // you choose to specify the MediaType, see Naming Requirements (https://tools.ietf.org/html/rfc6838#section-4.2) + // for guidelines. + // + // Example valid values include "video/h264" and "video/h264,audio/aac". + // + // This parameter is optional; the default value is null (or empty in JSON). + MediaType *string `min:"1" type:"string"` + + // A name for the stream that you are creating. + // + // The stream name is an identifier for the stream, and must be unique for each + // account and region. + // + // StreamName is a required field + StreamName *string `min:"1" type:"string" required:"true"` + + // A list of tags to associate with the specified stream. Each tag is a key-value + // pair (the value is optional). + Tags map[string]*string `min:"1" type:"map"` +} + +// 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.DeviceName != nil && len(*s.DeviceName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DeviceName", 1)) + } + if s.KmsKeyId != nil && len(*s.KmsKeyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("KmsKeyId", 1)) + } + if s.MediaType != nil && len(*s.MediaType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MediaType", 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.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDataRetentionInHours sets the DataRetentionInHours field's value. +func (s *CreateStreamInput) SetDataRetentionInHours(v int64) *CreateStreamInput { + s.DataRetentionInHours = &v + return s +} + +// SetDeviceName sets the DeviceName field's value. +func (s *CreateStreamInput) SetDeviceName(v string) *CreateStreamInput { + s.DeviceName = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *CreateStreamInput) SetKmsKeyId(v string) *CreateStreamInput { + s.KmsKeyId = &v + return s +} + +// SetMediaType sets the MediaType field's value. +func (s *CreateStreamInput) SetMediaType(v string) *CreateStreamInput { + s.MediaType = &v + return s +} + +// SetStreamName sets the StreamName field's value. +func (s *CreateStreamInput) SetStreamName(v string) *CreateStreamInput { + s.StreamName = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateStreamInput) SetTags(v map[string]*string) *CreateStreamInput { + s.Tags = v + return s +} + +type CreateStreamOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the stream. + StreamARN *string `min:"1" type:"string"` +} + +// 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() +} + +// SetStreamARN sets the StreamARN field's value. +func (s *CreateStreamOutput) SetStreamARN(v string) *CreateStreamOutput { + s.StreamARN = &v + return s +} + +type DeleteSignalingChannelInput struct { + _ struct{} `type:"structure"` + + // The ARN of the signaling channel that you want to delete. + // + // ChannelARN is a required field + ChannelARN *string `min:"1" type:"string" required:"true"` + + // The current version of the signaling channel that you want to delete. You + // can obtain the current version by invoking the DescribeSignalingChannel or + // ListSignalingChannels APIs. + CurrentVersion *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DeleteSignalingChannelInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSignalingChannelInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteSignalingChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteSignalingChannelInput"} + if s.ChannelARN == nil { + invalidParams.Add(request.NewErrParamRequired("ChannelARN")) + } + if s.ChannelARN != nil && len(*s.ChannelARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChannelARN", 1)) + } + if s.CurrentVersion != nil && len(*s.CurrentVersion) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CurrentVersion", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetChannelARN sets the ChannelARN field's value. +func (s *DeleteSignalingChannelInput) SetChannelARN(v string) *DeleteSignalingChannelInput { + s.ChannelARN = &v + return s +} + +// SetCurrentVersion sets the CurrentVersion field's value. +func (s *DeleteSignalingChannelInput) SetCurrentVersion(v string) *DeleteSignalingChannelInput { + s.CurrentVersion = &v + return s +} + +type DeleteSignalingChannelOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteSignalingChannelOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteSignalingChannelOutput) GoString() string { + return s.String() +} + +type DeleteStreamInput struct { + _ struct{} `type:"structure"` + + // Optional: The version of the stream that you want to delete. + // + // Specify the version as a safeguard to ensure that your are deleting the correct + // stream. To get the stream version, use the DescribeStream API. + // + // If not specified, only the CreationTime is checked before deleting the stream. + CurrentVersion *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the stream that you want to delete. + // + // StreamARN is a required field + StreamARN *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.CurrentVersion != nil && len(*s.CurrentVersion) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CurrentVersion", 1)) } - if s.MediaType != nil && len(*s.MediaType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MediaType", 1)) + if s.StreamARN == nil { + invalidParams.Add(request.NewErrParamRequired("StreamARN")) } - if s.StreamName == nil { - invalidParams.Add(request.NewErrParamRequired("StreamName")) + if s.StreamARN != nil && len(*s.StreamARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StreamARN", 1)) } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) + + if invalidParams.Len() > 0 { + return invalidParams } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + return nil +} + +// SetCurrentVersion sets the CurrentVersion field's value. +func (s *DeleteStreamInput) SetCurrentVersion(v string) *DeleteStreamInput { + s.CurrentVersion = &v + return s +} + +// SetStreamARN sets the StreamARN field's value. +func (s *DeleteStreamInput) SetStreamARN(v string) *DeleteStreamInput { + s.StreamARN = &v + return s +} + +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() +} + +type DescribeSignalingChannelInput struct { + _ struct{} `type:"structure"` + + // The ARN of the signaling channel that you want to describe. + ChannelARN *string `min:"1" type:"string"` + + // The name of the signaling channel that you want to describe. + ChannelName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DescribeSignalingChannelInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSignalingChannelInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeSignalingChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeSignalingChannelInput"} + if s.ChannelARN != nil && len(*s.ChannelARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChannelARN", 1)) + } + if s.ChannelName != nil && len(*s.ChannelName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) } if invalidParams.Len() > 0 { @@ -1170,103 +2793,293 @@ func (s *CreateStreamInput) Validate() error { return nil } -// SetDataRetentionInHours sets the DataRetentionInHours field's value. -func (s *CreateStreamInput) SetDataRetentionInHours(v int64) *CreateStreamInput { - s.DataRetentionInHours = &v +// SetChannelARN sets the ChannelARN field's value. +func (s *DescribeSignalingChannelInput) SetChannelARN(v string) *DescribeSignalingChannelInput { + s.ChannelARN = &v return s } -// SetDeviceName sets the DeviceName field's value. -func (s *CreateStreamInput) SetDeviceName(v string) *CreateStreamInput { - s.DeviceName = &v +// SetChannelName sets the ChannelName field's value. +func (s *DescribeSignalingChannelInput) SetChannelName(v string) *DescribeSignalingChannelInput { + s.ChannelName = &v return s } -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateStreamInput) SetKmsKeyId(v string) *CreateStreamInput { - s.KmsKeyId = &v +type DescribeSignalingChannelOutput struct { + _ struct{} `type:"structure"` + + // A structure that encapsulates the specified signaling channel's metadata + // and properties. + ChannelInfo *ChannelInfo `type:"structure"` +} + +// String returns the string representation +func (s DescribeSignalingChannelOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSignalingChannelOutput) GoString() string { + return s.String() +} + +// SetChannelInfo sets the ChannelInfo field's value. +func (s *DescribeSignalingChannelOutput) SetChannelInfo(v *ChannelInfo) *DescribeSignalingChannelOutput { + s.ChannelInfo = v return s } -// SetMediaType sets the MediaType field's value. -func (s *CreateStreamInput) SetMediaType(v string) *CreateStreamInput { - s.MediaType = &v +type DescribeStreamInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the stream. + StreamARN *string `min:"1" type:"string"` + + // The name of the stream. + StreamName *string `min:"1" type:"string"` +} + +// 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.StreamARN != nil && len(*s.StreamARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StreamARN", 1)) + } + if s.StreamName != nil && len(*s.StreamName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetStreamARN sets the StreamARN field's value. +func (s *DescribeStreamInput) SetStreamARN(v string) *DescribeStreamInput { + s.StreamARN = &v return s } // SetStreamName sets the StreamName field's value. -func (s *CreateStreamInput) SetStreamName(v string) *CreateStreamInput { +func (s *DescribeStreamInput) SetStreamName(v string) *DescribeStreamInput { s.StreamName = &v return s } -// SetTags sets the Tags field's value. -func (s *CreateStreamInput) SetTags(v map[string]*string) *CreateStreamInput { - s.Tags = v +type DescribeStreamOutput struct { + _ struct{} `type:"structure"` + + // An object that describes the stream. + StreamInfo *StreamInfo `type:"structure"` +} + +// 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() +} + +// SetStreamInfo sets the StreamInfo field's value. +func (s *DescribeStreamOutput) SetStreamInfo(v *StreamInfo) *DescribeStreamOutput { + s.StreamInfo = v return s } -type CreateStreamOutput struct { +// Not implemented. +type DeviceStreamLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DeviceStreamLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeviceStreamLimitExceededException) GoString() string { + return s.String() +} + +func newErrorDeviceStreamLimitExceededException(v protocol.ResponseMetadata) error { + return &DeviceStreamLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DeviceStreamLimitExceededException) Code() string { + return "DeviceStreamLimitExceededException" +} + +// Message returns the exception's message. +func (s DeviceStreamLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DeviceStreamLimitExceededException) OrigErr() error { + return nil +} + +func (s DeviceStreamLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DeviceStreamLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DeviceStreamLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +type GetDataEndpointInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the stream. + // The name of the API action for which to get an endpoint. + // + // APIName is a required field + APIName *string `type:"string" required:"true" enum:"APIName"` + + // The Amazon Resource Name (ARN) of the stream that you want to get the endpoint + // for. You must specify either this parameter or a StreamName in the request. StreamARN *string `min:"1" type:"string"` + + // The name of the stream that you want to get the endpoint for. You must specify + // either this parameter or a StreamARN in the request. + StreamName *string `min:"1" type:"string"` } // String returns the string representation -func (s CreateStreamOutput) String() string { +func (s GetDataEndpointInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDataEndpointInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetDataEndpointInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetDataEndpointInput"} + if s.APIName == nil { + invalidParams.Add(request.NewErrParamRequired("APIName")) + } + if s.StreamARN != nil && len(*s.StreamARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StreamARN", 1)) + } + if s.StreamName != nil && len(*s.StreamName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAPIName sets the APIName field's value. +func (s *GetDataEndpointInput) SetAPIName(v string) *GetDataEndpointInput { + s.APIName = &v + return s +} + +// SetStreamARN sets the StreamARN field's value. +func (s *GetDataEndpointInput) SetStreamARN(v string) *GetDataEndpointInput { + s.StreamARN = &v + return s +} + +// SetStreamName sets the StreamName field's value. +func (s *GetDataEndpointInput) SetStreamName(v string) *GetDataEndpointInput { + s.StreamName = &v + return s +} + +type GetDataEndpointOutput struct { + _ struct{} `type:"structure"` + + // The endpoint value. To read data from the stream or to write data to it, + // specify this endpoint in your application. + DataEndpoint *string `type:"string"` +} + +// String returns the string representation +func (s GetDataEndpointOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateStreamOutput) GoString() string { +func (s GetDataEndpointOutput) GoString() string { return s.String() } -// SetStreamARN sets the StreamARN field's value. -func (s *CreateStreamOutput) SetStreamARN(v string) *CreateStreamOutput { - s.StreamARN = &v +// SetDataEndpoint sets the DataEndpoint field's value. +func (s *GetDataEndpointOutput) SetDataEndpoint(v string) *GetDataEndpointOutput { + s.DataEndpoint = &v return s } -type DeleteStreamInput struct { +type GetSignalingChannelEndpointInput struct { _ struct{} `type:"structure"` - // Optional: The version of the stream that you want to delete. - // - // Specify the version as a safeguard to ensure that your are deleting the correct - // stream. To get the stream version, use the DescribeStream API. + // The ARN of the signalling channel for which you want to get an endpoint. // - // If not specified, only the CreationTime is checked before deleting the stream. - CurrentVersion *string `min:"1" type:"string"` + // ChannelARN is a required field + ChannelARN *string `min:"1" type:"string" required:"true"` - // The Amazon Resource Name (ARN) of the stream that you want to delete. - // - // StreamARN is a required field - StreamARN *string `min:"1" type:"string" required:"true"` + // A structure containing the endpoint configuration for the SINGLE_MASTER channel + // type. + SingleMasterChannelEndpointConfiguration *SingleMasterChannelEndpointConfiguration `type:"structure"` } // String returns the string representation -func (s DeleteStreamInput) String() string { +func (s GetSignalingChannelEndpointInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteStreamInput) GoString() string { +func (s GetSignalingChannelEndpointInput) 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.CurrentVersion != nil && len(*s.CurrentVersion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CurrentVersion", 1)) +func (s *GetSignalingChannelEndpointInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSignalingChannelEndpointInput"} + if s.ChannelARN == nil { + invalidParams.Add(request.NewErrParamRequired("ChannelARN")) } - if s.StreamARN == nil { - invalidParams.Add(request.NewErrParamRequired("StreamARN")) + if s.ChannelARN != nil && len(*s.ChannelARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChannelARN", 1)) } - if s.StreamARN != nil && len(*s.StreamARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamARN", 1)) + if s.SingleMasterChannelEndpointConfiguration != nil { + if err := s.SingleMasterChannelEndpointConfiguration.Validate(); err != nil { + invalidParams.AddNested("SingleMasterChannelEndpointConfiguration", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -1275,141 +3088,245 @@ func (s *DeleteStreamInput) Validate() error { return nil } -// SetCurrentVersion sets the CurrentVersion field's value. -func (s *DeleteStreamInput) SetCurrentVersion(v string) *DeleteStreamInput { - s.CurrentVersion = &v +// SetChannelARN sets the ChannelARN field's value. +func (s *GetSignalingChannelEndpointInput) SetChannelARN(v string) *GetSignalingChannelEndpointInput { + s.ChannelARN = &v return s } -// SetStreamARN sets the StreamARN field's value. -func (s *DeleteStreamInput) SetStreamARN(v string) *DeleteStreamInput { - s.StreamARN = &v +// SetSingleMasterChannelEndpointConfiguration sets the SingleMasterChannelEndpointConfiguration field's value. +func (s *GetSignalingChannelEndpointInput) SetSingleMasterChannelEndpointConfiguration(v *SingleMasterChannelEndpointConfiguration) *GetSignalingChannelEndpointInput { + s.SingleMasterChannelEndpointConfiguration = v return s } -type DeleteStreamOutput struct { +type GetSignalingChannelEndpointOutput struct { _ struct{} `type:"structure"` + + // A list of endpoints for the specified signaling channel. + ResourceEndpointList []*ResourceEndpointListItem `type:"list"` } // String returns the string representation -func (s DeleteStreamOutput) String() string { +func (s GetSignalingChannelEndpointOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteStreamOutput) GoString() string { +func (s GetSignalingChannelEndpointOutput) GoString() string { return s.String() } -type DescribeStreamInput struct { - _ struct{} `type:"structure"` +// SetResourceEndpointList sets the ResourceEndpointList field's value. +func (s *GetSignalingChannelEndpointOutput) SetResourceEndpointList(v []*ResourceEndpointListItem) *GetSignalingChannelEndpointOutput { + s.ResourceEndpointList = v + return s +} - // The Amazon Resource Name (ARN) of the stream. - StreamARN *string `min:"1" type:"string"` +// The value for this input parameter is invalid. +type InvalidArgumentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The name of the stream. - StreamName *string `min:"1" type:"string"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s DescribeStreamInput) String() string { +func (s InvalidArgumentException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStreamInput) GoString() string { +func (s InvalidArgumentException) 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.StreamARN != nil && len(*s.StreamARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamARN", 1)) +func newErrorInvalidArgumentException(v protocol.ResponseMetadata) error { + return &InvalidArgumentException{ + respMetadata: v, } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) +} + +// Code returns the exception type name. +func (s InvalidArgumentException) Code() string { + return "InvalidArgumentException" +} + +// Message returns the exception's message. +func (s InvalidArgumentException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} - if invalidParams.Len() > 0 { - return invalidParams +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidArgumentException) OrigErr() error { + return nil +} + +func (s InvalidArgumentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidArgumentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidArgumentException) RequestID() string { + return s.respMetadata.RequestID +} + +// Not implemented. +type InvalidDeviceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidDeviceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDeviceException) GoString() string { + return s.String() +} + +func newErrorInvalidDeviceException(v protocol.ResponseMetadata) error { + return &InvalidDeviceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDeviceException) Code() string { + return "InvalidDeviceException" +} + +// Message returns the exception's message. +func (s InvalidDeviceException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDeviceException) OrigErr() error { return nil } -// SetStreamARN sets the StreamARN field's value. -func (s *DescribeStreamInput) SetStreamARN(v string) *DescribeStreamInput { - s.StreamARN = &v - return s +func (s InvalidDeviceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetStreamName sets the StreamName field's value. -func (s *DescribeStreamInput) SetStreamName(v string) *DescribeStreamInput { - s.StreamName = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDeviceException) StatusCode() int { + return s.respMetadata.StatusCode } -type DescribeStreamOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidDeviceException) RequestID() string { + return s.respMetadata.RequestID +} - // An object that describes the stream. - StreamInfo *StreamInfo `type:"structure"` +// The format of the StreamARN is invalid. +type InvalidResourceFormatException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s DescribeStreamOutput) String() string { +func (s InvalidResourceFormatException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeStreamOutput) GoString() string { +func (s InvalidResourceFormatException) GoString() string { return s.String() } -// SetStreamInfo sets the StreamInfo field's value. -func (s *DescribeStreamOutput) SetStreamInfo(v *StreamInfo) *DescribeStreamOutput { - s.StreamInfo = v - return s +func newErrorInvalidResourceFormatException(v protocol.ResponseMetadata) error { + return &InvalidResourceFormatException{ + respMetadata: v, + } } -type GetDataEndpointInput struct { +// Code returns the exception type name. +func (s InvalidResourceFormatException) Code() string { + return "InvalidResourceFormatException" +} + +// Message returns the exception's message. +func (s InvalidResourceFormatException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidResourceFormatException) OrigErr() error { + return nil +} + +func (s InvalidResourceFormatException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidResourceFormatException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidResourceFormatException) RequestID() string { + return s.respMetadata.RequestID +} + +type ListSignalingChannelsInput struct { _ struct{} `type:"structure"` - // The name of the API action for which to get an endpoint. - // - // APIName is a required field - APIName *string `type:"string" required:"true" enum:"APIName"` + // Optional: Returns only the channels that satisfy a specific condition. + ChannelNameCondition *ChannelNameCondition `type:"structure"` - // The Amazon Resource Name (ARN) of the stream that you want to get the endpoint - // for. You must specify either this parameter or a StreamName in the request. - StreamARN *string `min:"1" type:"string"` + // The maximum number of channels to return in the response. The default is + // 500. + MaxResults *int64 `min:"1" type:"integer"` - // The name of the stream that you want to get the endpoint for. You must specify - // either this parameter or a StreamARN in the request. - StreamName *string `min:"1" type:"string"` + // If you specify this parameter, when the result of a ListSignalingChannels + // operation is truncated, the call returns the NextToken in the response. To + // get another batch of channels, provide this token in your next request. + NextToken *string `type:"string"` } // String returns the string representation -func (s GetDataEndpointInput) String() string { +func (s ListSignalingChannelsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDataEndpointInput) GoString() string { +func (s ListSignalingChannelsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetDataEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDataEndpointInput"} - if s.APIName == nil { - invalidParams.Add(request.NewErrParamRequired("APIName")) - } - if s.StreamARN != nil && len(*s.StreamARN) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamARN", 1)) +func (s *ListSignalingChannelsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListSignalingChannelsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } - if s.StreamName != nil && len(*s.StreamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StreamName", 1)) + if s.ChannelNameCondition != nil { + if err := s.ChannelNameCondition.Validate(); err != nil { + invalidParams.AddNested("ChannelNameCondition", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -1418,45 +3335,54 @@ func (s *GetDataEndpointInput) Validate() error { return nil } -// SetAPIName sets the APIName field's value. -func (s *GetDataEndpointInput) SetAPIName(v string) *GetDataEndpointInput { - s.APIName = &v +// SetChannelNameCondition sets the ChannelNameCondition field's value. +func (s *ListSignalingChannelsInput) SetChannelNameCondition(v *ChannelNameCondition) *ListSignalingChannelsInput { + s.ChannelNameCondition = v return s } -// SetStreamARN sets the StreamARN field's value. -func (s *GetDataEndpointInput) SetStreamARN(v string) *GetDataEndpointInput { - s.StreamARN = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListSignalingChannelsInput) SetMaxResults(v int64) *ListSignalingChannelsInput { + s.MaxResults = &v return s } -// SetStreamName sets the StreamName field's value. -func (s *GetDataEndpointInput) SetStreamName(v string) *GetDataEndpointInput { - s.StreamName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListSignalingChannelsInput) SetNextToken(v string) *ListSignalingChannelsInput { + s.NextToken = &v return s } -type GetDataEndpointOutput struct { +type ListSignalingChannelsOutput struct { _ struct{} `type:"structure"` - // The endpoint value. To read data from the stream or to write data to it, - // specify this endpoint in your application. - DataEndpoint *string `type:"string"` + // An array of ChannelInfo objects. + ChannelInfoList []*ChannelInfo `type:"list"` + + // If the response is truncated, the call returns this element with a token. + // To get the next batch of streams, use this token in your next request. + NextToken *string `type:"string"` } // String returns the string representation -func (s GetDataEndpointOutput) String() string { +func (s ListSignalingChannelsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDataEndpointOutput) GoString() string { +func (s ListSignalingChannelsOutput) GoString() string { return s.String() } -// SetDataEndpoint sets the DataEndpoint field's value. -func (s *GetDataEndpointOutput) SetDataEndpoint(v string) *GetDataEndpointOutput { - s.DataEndpoint = &v +// SetChannelInfoList sets the ChannelInfoList field's value. +func (s *ListSignalingChannelsOutput) SetChannelInfoList(v []*ChannelInfo) *ListSignalingChannelsOutput { + s.ChannelInfoList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListSignalingChannelsOutput) SetNextToken(v string) *ListSignalingChannelsOutput { + s.NextToken = &v return s } @@ -1516,42 +3442,128 @@ func (s *ListStreamsInput) SetNextToken(v string) *ListStreamsInput { return s } -// SetStreamNameCondition sets the StreamNameCondition field's value. -func (s *ListStreamsInput) SetStreamNameCondition(v *StreamNameCondition) *ListStreamsInput { - s.StreamNameCondition = v +// SetStreamNameCondition sets the StreamNameCondition field's value. +func (s *ListStreamsInput) SetStreamNameCondition(v *StreamNameCondition) *ListStreamsInput { + s.StreamNameCondition = v + return s +} + +type ListStreamsOutput struct { + _ struct{} `type:"structure"` + + // If the response is truncated, the call returns this element with a token. + // To get the next batch of streams, use this token in your next request. + NextToken *string `type:"string"` + + // An array of StreamInfo objects. + StreamInfoList []*StreamInfo `type:"list"` +} + +// 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() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListStreamsOutput) SetNextToken(v string) *ListStreamsOutput { + s.NextToken = &v + return s +} + +// SetStreamInfoList sets the StreamInfoList field's value. +func (s *ListStreamsOutput) SetStreamInfoList(v []*StreamInfo) *ListStreamsOutput { + s.StreamInfoList = v + return s +} + +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // If you specify this parameter and the result of a ListTagsForResource call + // is truncated, the response includes a token that you can use in the next + // request to fetch the next batch of tags. + NextToken *string `type:"string"` + + // The ARN of the signaling channel for which you want to list tags. + // + // ResourceARN is a required field + ResourceARN *string `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 +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTagsForResourceInput) SetNextToken(v string) *ListTagsForResourceInput { + s.NextToken = &v + return s +} + +// SetResourceARN sets the ResourceARN field's value. +func (s *ListTagsForResourceInput) SetResourceARN(v string) *ListTagsForResourceInput { + s.ResourceARN = &v return s } -type ListStreamsOutput struct { +type ListTagsForResourceOutput struct { _ struct{} `type:"structure"` - // If the response is truncated, the call returns this element with a token. - // To get the next batch of streams, use this token in your next request. + // If you specify this parameter and the result of a ListTagsForResource call + // is truncated, the response includes a token that you can use in the next + // request to fetch the next set of tags. NextToken *string `type:"string"` - // An array of StreamInfo objects. - StreamInfoList []*StreamInfo `type:"list"` + // A map of tag keys and values associated with the specified signaling channel. + Tags map[string]*string `min:"1" type:"map"` } // String returns the string representation -func (s ListStreamsOutput) String() string { +func (s ListTagsForResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListStreamsOutput) GoString() string { +func (s ListTagsForResourceOutput) GoString() string { return s.String() } // SetNextToken sets the NextToken field's value. -func (s *ListStreamsOutput) SetNextToken(v string) *ListStreamsOutput { +func (s *ListTagsForResourceOutput) SetNextToken(v string) *ListTagsForResourceOutput { s.NextToken = &v return s } -// SetStreamInfoList sets the StreamInfoList field's value. -func (s *ListStreamsOutput) SetStreamInfoList(v []*StreamInfo) *ListStreamsOutput { - s.StreamInfoList = v +// SetTags sets the Tags field's value. +func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { + s.Tags = v return s } @@ -1648,6 +3660,303 @@ func (s *ListTagsForStreamOutput) SetTags(v map[string]*string) *ListTagsForStre return s } +// The caller is not authorized to perform this operation. +type NotAuthorizedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s NotAuthorizedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotAuthorizedException) GoString() string { + return s.String() +} + +func newErrorNotAuthorizedException(v protocol.ResponseMetadata) error { + return &NotAuthorizedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotAuthorizedException) Code() string { + return "NotAuthorizedException" +} + +// Message returns the exception's message. +func (s NotAuthorizedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotAuthorizedException) OrigErr() error { + return nil +} + +func (s NotAuthorizedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotAuthorizedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotAuthorizedException) RequestID() string { + return s.respMetadata.RequestID +} + +// An object that describes the endpoint of the signaling channel returned by +// the GetSignalingChannelEndpoint API. +type ResourceEndpointListItem struct { + _ struct{} `type:"structure"` + + // The protocol of the signaling channel returned by the GetSignalingChannelEndpoint + // API. + Protocol *string `type:"string" enum:"ChannelProtocol"` + + // The endpoint of the signaling channel returned by the GetSignalingChannelEndpoint + // API. + ResourceEndpoint *string `type:"string"` +} + +// String returns the string representation +func (s ResourceEndpointListItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceEndpointListItem) GoString() string { + return s.String() +} + +// SetProtocol sets the Protocol field's value. +func (s *ResourceEndpointListItem) SetProtocol(v string) *ResourceEndpointListItem { + s.Protocol = &v + return s +} + +// SetResourceEndpoint sets the ResourceEndpoint field's value. +func (s *ResourceEndpointListItem) SetResourceEndpoint(v string) *ResourceEndpointListItem { + s.ResourceEndpoint = &v + return s +} + +// The stream is currently not available for this operation. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// Amazon Kinesis Video Streams can't find the stream that you specified. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// An object that contains the endpoint configuration for the SINGLE_MASTER +// channel type. +type SingleMasterChannelEndpointConfiguration struct { + _ struct{} `type:"structure"` + + // This property is used to determine the nature of communication over this + // SINGLE_MASTER signaling channel. If WSS is specified, this API returns a + // websocket endpoint. If HTTPS is specified, this API returns an HTTPS endpoint. + Protocols []*string `min:"1" type:"list"` + + // This property is used to determine messaging permissions in this SINGLE_MASTER + // signaling channel. If MASTER is specified, this API returns an endpoint that + // a client can use to receive offers from and send answers to any of the viewers + // on this signaling channel. If VIEWER is specified, this API returns an endpoint + // that a client can use only to send offers to another MASTER client on this + // signaling channel. + Role *string `type:"string" enum:"ChannelRole"` +} + +// String returns the string representation +func (s SingleMasterChannelEndpointConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SingleMasterChannelEndpointConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SingleMasterChannelEndpointConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SingleMasterChannelEndpointConfiguration"} + if s.Protocols != nil && len(s.Protocols) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Protocols", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetProtocols sets the Protocols field's value. +func (s *SingleMasterChannelEndpointConfiguration) SetProtocols(v []*string) *SingleMasterChannelEndpointConfiguration { + s.Protocols = v + return s +} + +// SetRole sets the Role field's value. +func (s *SingleMasterChannelEndpointConfiguration) SetRole(v string) *SingleMasterChannelEndpointConfiguration { + s.Role = &v + return s +} + +// A structure that contains the configuration for the SINGLE_MASTER channel +// type. +type SingleMasterConfiguration struct { + _ struct{} `type:"structure"` + + // The period of time a signaling channel retains underlivered messages before + // they are discarded. + MessageTtlSeconds *int64 `min:"5" type:"integer"` +} + +// String returns the string representation +func (s SingleMasterConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SingleMasterConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SingleMasterConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SingleMasterConfiguration"} + if s.MessageTtlSeconds != nil && *s.MessageTtlSeconds < 5 { + invalidParams.Add(request.NewErrParamMinValue("MessageTtlSeconds", 5)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMessageTtlSeconds sets the MessageTtlSeconds field's value. +func (s *SingleMasterConfiguration) SetMessageTtlSeconds(v int64) *SingleMasterConfiguration { + s.MessageTtlSeconds = &v + return s +} + // An object describing a Kinesis video stream. type StreamInfo struct { _ struct{} `type:"structure"` @@ -1721,60 +4030,185 @@ func (s *StreamInfo) SetMediaType(v string) *StreamInfo { return s } -// SetStatus sets the Status field's value. -func (s *StreamInfo) SetStatus(v string) *StreamInfo { - s.Status = &v - return s +// SetStatus sets the Status field's value. +func (s *StreamInfo) SetStatus(v string) *StreamInfo { + s.Status = &v + return s +} + +// SetStreamARN sets the StreamARN field's value. +func (s *StreamInfo) SetStreamARN(v string) *StreamInfo { + s.StreamARN = &v + return s +} + +// SetStreamName sets the StreamName field's value. +func (s *StreamInfo) SetStreamName(v string) *StreamInfo { + s.StreamName = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *StreamInfo) SetVersion(v string) *StreamInfo { + s.Version = &v + return s +} + +// Specifies the condition that streams must satisfy to be returned when you +// list streams (see the ListStreams API). A condition has a comparison operation +// and a value. Currently, you can specify only the BEGINS_WITH operator, which +// finds streams whose names start with a given prefix. +type StreamNameCondition struct { + _ struct{} `type:"structure"` + + // A comparison operator. Currently, you can specify only the BEGINS_WITH operator, + // which finds streams whose names start with a given prefix. + ComparisonOperator *string `type:"string" enum:"ComparisonOperator"` + + // A value to compare. + ComparisonValue *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s StreamNameCondition) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StreamNameCondition) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StreamNameCondition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StreamNameCondition"} + if s.ComparisonValue != nil && len(*s.ComparisonValue) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ComparisonValue", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComparisonOperator sets the ComparisonOperator field's value. +func (s *StreamNameCondition) SetComparisonOperator(v string) *StreamNameCondition { + s.ComparisonOperator = &v + return s +} + +// SetComparisonValue sets the ComparisonValue field's value. +func (s *StreamNameCondition) SetComparisonValue(v string) *StreamNameCondition { + s.ComparisonValue = &v + return s +} + +// A key and value pair that is associated with the specified signaling channel. +type Tag struct { + _ struct{} `type:"structure"` + + // The key of the tag that is associated with the specified signaling channel. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // The value of the tag that is associated with the specified signaling channel. + // + // 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() } -// SetStreamARN sets the StreamARN field's value. -func (s *StreamInfo) SetStreamARN(v string) *StreamInfo { - s.StreamARN = &v - return s +// 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 } -// SetStreamName sets the StreamName field's value. -func (s *StreamInfo) SetStreamName(v string) *StreamInfo { - s.StreamName = &v +// SetKey sets the Key field's value. +func (s *Tag) SetKey(v string) *Tag { + s.Key = &v return s } -// SetVersion sets the Version field's value. -func (s *StreamInfo) SetVersion(v string) *StreamInfo { - s.Version = &v +// SetValue sets the Value field's value. +func (s *Tag) SetValue(v string) *Tag { + s.Value = &v return s } -// Specifies the condition that streams must satisfy to be returned when you -// list streams (see the ListStreams API). A condition has a comparison operation -// and a value. Currently, you can specify only the BEGINS_WITH operator, which -// finds streams whose names start with a given prefix. -type StreamNameCondition struct { +type TagResourceInput struct { _ struct{} `type:"structure"` - // A comparison operator. Currently, you can specify only the BEGINS_WITH operator, - // which finds streams whose names start with a given prefix. - ComparisonOperator *string `type:"string" enum:"ComparisonOperator"` + // The ARN of the signaling channel to which you want to add tags. + // + // ResourceARN is a required field + ResourceARN *string `min:"1" type:"string" required:"true"` - // A value to compare. - ComparisonValue *string `min:"1" type:"string"` + // A list of tags to associate with the specified signaling channel. Each tag + // is a key-value pair. + // + // Tags is a required field + Tags []*Tag `min:"1" type:"list" required:"true"` } // String returns the string representation -func (s StreamNameCondition) String() string { +func (s TagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s StreamNameCondition) GoString() string { +func (s TagResourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *StreamNameCondition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StreamNameCondition"} - if s.ComparisonValue != nil && len(*s.ComparisonValue) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ComparisonValue", 1)) +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 && 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 { @@ -1783,18 +4217,32 @@ func (s *StreamNameCondition) Validate() error { return nil } -// SetComparisonOperator sets the ComparisonOperator field's value. -func (s *StreamNameCondition) SetComparisonOperator(v string) *StreamNameCondition { - s.ComparisonOperator = &v +// SetResourceARN sets the ResourceARN field's value. +func (s *TagResourceInput) SetResourceARN(v string) *TagResourceInput { + s.ResourceARN = &v return s } -// SetComparisonValue sets the ComparisonValue field's value. -func (s *StreamNameCondition) SetComparisonValue(v string) *StreamNameCondition { - s.ComparisonValue = &v +// SetTags sets the Tags field's value. +func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { + s.Tags = v return s } +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() +} + type TagStreamInput struct { _ struct{} `type:"structure"` @@ -1876,6 +4324,135 @@ func (s TagStreamOutput) GoString() string { return s.String() } +// You have exceeded the limit of tags that you can associate with the resource. +// Kinesis video streams support up to 50 tags. +type TagsPerResourceExceededLimitException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s TagsPerResourceExceededLimitException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagsPerResourceExceededLimitException) GoString() string { + return s.String() +} + +func newErrorTagsPerResourceExceededLimitException(v protocol.ResponseMetadata) error { + return &TagsPerResourceExceededLimitException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagsPerResourceExceededLimitException) Code() string { + return "TagsPerResourceExceededLimitException" +} + +// Message returns the exception's message. +func (s TagsPerResourceExceededLimitException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagsPerResourceExceededLimitException) OrigErr() error { + return nil +} + +func (s TagsPerResourceExceededLimitException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagsPerResourceExceededLimitException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagsPerResourceExceededLimitException) RequestID() string { + return s.respMetadata.RequestID +} + +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // The ARN of the signaling channel from which you want to remove tags. + // + // ResourceARN is a required field + ResourceARN *string `min:"1" type:"string" required:"true"` + + // A list of the keys of the tags that you want to remove. + // + // TagKeyList is a required field + TagKeyList []*string `min:"1" 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.TagKeyList == nil { + invalidParams.Add(request.NewErrParamRequired("TagKeyList")) + } + if s.TagKeyList != nil && len(s.TagKeyList) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TagKeyList", 1)) + } + + 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 +} + +// SetTagKeyList sets the TagKeyList field's value. +func (s *UntagResourceInput) SetTagKeyList(v []*string) *UntagResourceInput { + s.TagKeyList = v + return s +} + +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() +} + type UntagStreamInput struct { _ struct{} `type:"structure"` @@ -2069,6 +4646,93 @@ func (s UpdateDataRetentionOutput) GoString() string { return s.String() } +type UpdateSignalingChannelInput struct { + _ struct{} `type:"structure"` + + // The ARN of the signaling channel that you want to update. + // + // ChannelARN is a required field + ChannelARN *string `min:"1" type:"string" required:"true"` + + // The current version of the signaling channel that you want to update. + // + // CurrentVersion is a required field + CurrentVersion *string `min:"1" type:"string" required:"true"` + + // The structure containing the configuration for the SINGLE_MASTER type of + // the signaling channel that you want to update. + SingleMasterConfiguration *SingleMasterConfiguration `type:"structure"` +} + +// String returns the string representation +func (s UpdateSignalingChannelInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSignalingChannelInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateSignalingChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateSignalingChannelInput"} + if s.ChannelARN == nil { + invalidParams.Add(request.NewErrParamRequired("ChannelARN")) + } + if s.ChannelARN != nil && len(*s.ChannelARN) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChannelARN", 1)) + } + if s.CurrentVersion == nil { + invalidParams.Add(request.NewErrParamRequired("CurrentVersion")) + } + if s.CurrentVersion != nil && len(*s.CurrentVersion) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CurrentVersion", 1)) + } + if s.SingleMasterConfiguration != nil { + if err := s.SingleMasterConfiguration.Validate(); err != nil { + invalidParams.AddNested("SingleMasterConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetChannelARN sets the ChannelARN field's value. +func (s *UpdateSignalingChannelInput) SetChannelARN(v string) *UpdateSignalingChannelInput { + s.ChannelARN = &v + return s +} + +// SetCurrentVersion sets the CurrentVersion field's value. +func (s *UpdateSignalingChannelInput) SetCurrentVersion(v string) *UpdateSignalingChannelInput { + s.CurrentVersion = &v + return s +} + +// SetSingleMasterConfiguration sets the SingleMasterConfiguration field's value. +func (s *UpdateSignalingChannelInput) SetSingleMasterConfiguration(v *SingleMasterConfiguration) *UpdateSignalingChannelInput { + s.SingleMasterConfiguration = v + return s +} + +type UpdateSignalingChannelOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateSignalingChannelOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSignalingChannelOutput) GoString() string { + return s.String() +} + type UpdateStreamInput struct { _ struct{} `type:"structure"` @@ -2183,6 +4847,64 @@ func (s UpdateStreamOutput) GoString() string { return s.String() } +// The stream version that you specified is not the latest version. To get the +// latest version, use the DescribeStream (https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/API_DescribeStream.html) +// API. +type VersionMismatchException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s VersionMismatchException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VersionMismatchException) GoString() string { + return s.String() +} + +func newErrorVersionMismatchException(v protocol.ResponseMetadata) error { + return &VersionMismatchException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s VersionMismatchException) Code() string { + return "VersionMismatchException" +} + +// Message returns the exception's message. +func (s VersionMismatchException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s VersionMismatchException) OrigErr() error { + return nil +} + +func (s VersionMismatchException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s VersionMismatchException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s VersionMismatchException) RequestID() string { + return s.respMetadata.RequestID +} + const ( // APINamePutMedia is a APIName enum value APINamePutMedia = "PUT_MEDIA" @@ -2203,6 +4925,27 @@ const ( APINameGetDashStreamingSessionUrl = "GET_DASH_STREAMING_SESSION_URL" ) +const ( + // ChannelProtocolWss is a ChannelProtocol enum value + ChannelProtocolWss = "WSS" + + // ChannelProtocolHttps is a ChannelProtocol enum value + ChannelProtocolHttps = "HTTPS" +) + +const ( + // ChannelRoleMaster is a ChannelRole enum value + ChannelRoleMaster = "MASTER" + + // ChannelRoleViewer is a ChannelRole enum value + ChannelRoleViewer = "VIEWER" +) + +const ( + // ChannelTypeSingleMaster is a ChannelType enum value + ChannelTypeSingleMaster = "SINGLE_MASTER" +) + const ( // ComparisonOperatorBeginsWith is a ComparisonOperator enum value ComparisonOperatorBeginsWith = "BEGINS_WITH" diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesisvideo/errors.go b/vendor/github.com/aws/aws-sdk-go/service/kinesisvideo/errors.go index 5eaf166f3da..57993f66a76 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesisvideo/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesisvideo/errors.go @@ -2,8 +2,25 @@ package kinesisvideo +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( + // ErrCodeAccessDeniedException for service response error code + // "AccessDeniedException". + // + // You do not have required permissions to perform this operation. + ErrCodeAccessDeniedException = "AccessDeniedException" + + // ErrCodeAccountChannelLimitExceededException for service response error code + // "AccountChannelLimitExceededException". + // + // You have reached the maximum limit of active signaling channels for this + // AWS account in this region. + ErrCodeAccountChannelLimitExceededException = "AccountChannelLimitExceededException" + // ErrCodeAccountStreamLimitExceededException for service response error code // "AccountStreamLimitExceededException". // @@ -74,3 +91,19 @@ const ( // API. ErrCodeVersionMismatchException = "VersionMismatchException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "AccountChannelLimitExceededException": newErrorAccountChannelLimitExceededException, + "AccountStreamLimitExceededException": newErrorAccountStreamLimitExceededException, + "ClientLimitExceededException": newErrorClientLimitExceededException, + "DeviceStreamLimitExceededException": newErrorDeviceStreamLimitExceededException, + "InvalidArgumentException": newErrorInvalidArgumentException, + "InvalidDeviceException": newErrorInvalidDeviceException, + "InvalidResourceFormatException": newErrorInvalidResourceFormatException, + "NotAuthorizedException": newErrorNotAuthorizedException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "TagsPerResourceExceededLimitException": newErrorTagsPerResourceExceededLimitException, + "VersionMismatchException": newErrorVersionMismatchException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/kinesisvideo/service.go b/vendor/github.com/aws/aws-sdk-go/service/kinesisvideo/service.go index a723794cd00..3694f941e7a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kinesisvideo/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kinesisvideo/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "kinesisvideo" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Kinesis Video" // ServiceID is a unique identifer of a specific service. + ServiceID = "Kinesis Video" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the KinesisVideo client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a KinesisVideo client from just a session. // svc := kinesisvideo.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := kinesisvideo.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *KinesisVideo { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *KinesisVideo { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *KinesisVideo { svc := &KinesisVideo{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-09-30", }, @@ -71,7 +75,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 3978e852ff8..725da920645 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kms/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kms/api.go @@ -58,16 +58,15 @@ func (c *KMS) CancelKeyDeletionRequest(input *CancelKeyDeletionInput) (req *requ // 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. You cannot perform this operation on a CMK in a different AWS -// account. +// succeeds, the key state of the CMK is Disabled. To enable the CMK, use EnableKey. +// You cannot perform this operation on a CMK in a different AWS account. // // For more information about scheduling and canceling deletion of a CMK, see // Deleting Customer Master Keys (https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) // in the AWS Key Management Service Developer Guide. // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -77,30 +76,30 @@ func (c *KMS) CancelKeyDeletionRequest(input *CancelKeyDeletionInput) (req *requ // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CancelKeyDeletion func (c *KMS) CancelKeyDeletion(input *CancelKeyDeletionInput) (*CancelKeyDeletionOutput, error) { @@ -180,7 +179,9 @@ func (c *KMS) ConnectCustomKeyStoreRequest(input *ConnectCustomKeyStoreInput) (r // at least one active HSM. To get the number of active HSMs in a cluster, use // the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) // operation. To add HSMs to the cluster, use the CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html) -// operation. +// operation. Also, the kmsuser crypto user (https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser) +// (CU) must not be logged into the cluster. This prevents AWS KMS from using +// this account to log in. // // The connection process can take an extended amount of time to complete; up // to 20 minutes. This operation starts the connection process, but it does @@ -193,8 +194,7 @@ func (c *KMS) ConnectCustomKeyStoreRequest(input *ConnectCustomKeyStoreInput) (r // During the connection process, AWS KMS finds the AWS CloudHSM cluster that // is associated with the custom key store, creates the connection infrastructure, // connects to the cluster, logs into the AWS CloudHSM client as the kmsuser -// crypto user (https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser) -// (CU), and rotates its password. +// CU, and rotates its password. // // The ConnectCustomKeyStore operation might fail for various reasons. To find // the reason, use the DescribeCustomKeyStores operation and see the ConnectionErrorCode @@ -215,15 +215,15 @@ func (c *KMS) ConnectCustomKeyStoreRequest(input *ConnectCustomKeyStoreInput) (r // See the AWS API reference guide for AWS Key Management Service's // API operation ConnectCustomKeyStore for usage and error information. // -// Returned Error Codes: -// * ErrCodeCloudHsmClusterNotActiveException "CloudHsmClusterNotActiveException" +// Returned Error Types: +// * CloudHsmClusterNotActiveException // The request was rejected because the AWS CloudHSM cluster that is associated // with the custom key store is not active. Initialize and activate the cluster // and try the command again. For detailed instructions, see Getting Started // (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html) // in the AWS CloudHSM User Guide. // -// * ErrCodeCustomKeyStoreInvalidStateException "CustomKeyStoreInvalidStateException" +// * CustomKeyStoreInvalidStateException // The request was rejected because of the ConnectionState of the custom key // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores // operation. @@ -242,15 +242,15 @@ func (c *KMS) ConnectCustomKeyStoreRequest(input *ConnectCustomKeyStoreInput) (r // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid // for all other ConnectionState values. // -// * ErrCodeCustomKeyStoreNotFoundException "CustomKeyStoreNotFoundException" +// * CustomKeyStoreNotFoundException // The request was rejected because AWS KMS cannot find a custom key store with // the specified key store name or ID. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeCloudHsmClusterInvalidConfigurationException "CloudHsmClusterInvalidConfigurationException" +// * CloudHsmClusterInvalidConfigurationException // The request was rejected because the associated AWS CloudHSM cluster did // not meet the configuration requirements for a custom key store. // @@ -350,32 +350,68 @@ func (c *KMS) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, // CreateAlias API operation for AWS Key Management Service. // // Creates a display name for a customer managed customer master key (CMK). -// You can use an alias to identify a CMK in selected operations, such as Encrypt -// and GenerateDataKey. +// You can use an alias to identify a CMK in cryptographic operations, such +// as Encrypt and GenerateDataKey. You can change the CMK associated with the +// alias at any time. +// +// Aliases are easier to remember than key IDs. They can also help to simplify +// your applications. For example, if you use an alias in your code, you can +// change the CMK your code uses by associating a given alias with a different +// CMK. +// +// To run the same code in multiple AWS regions, use an alias in your code, +// such as alias/ApplicationKey. Then, in each AWS Region, create an alias/ApplicationKey +// alias that is associated with a CMK in that Region. When you run your code, +// it uses the alias/ApplicationKey CMK for that AWS Region without any Region-specific +// code. +// +// This operation does not return a response. To get the alias that you created, +// use the ListAliases operation. // -// Each CMK can have multiple aliases, but each alias points to only one CMK. -// The alias name must be unique in the AWS account and region. To simplify -// code that runs in multiple regions, use the same alias name, but point it -// to a different CMK in each region. +// To use aliases successfully, be aware of the following information. // -// Because an alias is not a property of a CMK, you can delete and change the -// aliases of a CMK without affecting the CMK. Also, aliases do not appear in -// the response from the DescribeKey operation. To get the aliases of all CMKs, -// use the ListAliases operation. +// * Each alias points to only one CMK at a time, although a single CMK can +// have multiple aliases. The alias and its associated CMK must be in the +// same AWS account and Region. // -// The alias name must begin with alias/ followed by a name, such as alias/ExampleAlias. -// It can contain only alphanumeric characters, forward slashes (/), underscores -// (_), and dashes (-). The alias name cannot begin with alias/aws/. The alias/aws/ -// prefix is reserved for AWS managed CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). +// * You can associate an alias with any customer managed CMK in the same +// AWS account and Region. However, you do not have permission to associate +// an alias with an AWS managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) +// or an AWS owned CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk). // -// The alias and the CMK it is mapped to must be in the same AWS account and -// the same region. You cannot perform this operation on an alias in a different -// AWS account. +// * To change the CMK associated with an alias, use the UpdateAlias operation. +// The current CMK and the new CMK must be the same type (both symmetric +// or both asymmetric) and they must have the same key usage (ENCRYPT_DECRYPT +// or SIGN_VERIFY). This restriction prevents cryptographic errors in code +// that uses aliases. +// +// * The alias name must begin with alias/ followed by a name, such as alias/ExampleAlias. +// It can contain only alphanumeric characters, forward slashes (/), underscores +// (_), and dashes (-). The alias name cannot begin with alias/aws/. The +// alias/aws/ prefix is reserved for AWS managed CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). +// +// * The alias name must be unique within an AWS Region. However, you can +// use the same alias name in multiple Regions of the same AWS account. Each +// instance of the alias is associated with a CMK in its Region. +// +// * After you create an alias, you cannot change its alias name. However, +// you can use the DeleteAlias operation to delete the alias and then create +// a new alias with the desired name. // -// To map an existing alias to a different CMK, call UpdateAlias. +// * You can use an alias name or alias ARN to identify a CMK in AWS KMS +// cryptographic operations and in the DescribeKey operation. However, you +// cannot use alias names or alias ARNs in API operations that manage CMKs, +// such as DisableKey or GetKeyPolicy. For information about the valid CMK +// identifiers for each AWS KMS API operation, see the descriptions of the +// KeyId parameter in the API operation documentation. // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// Because an alias is not a property of a CMK, you can delete and change the +// aliases of a CMK without affecting the CMK. Also, aliases do not appear in +// the response from the DescribeKey operation. To get the aliases and alias +// ARNs of CMKs in each AWS account and Region, use the ListAliases operation. +// +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -385,38 +421,38 @@ func (c *KMS) CreateAliasRequest(input *CreateAliasInput) (req *request.Request, // 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" +// Returned Error Types: +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// * AlreadyExistsException // The request was rejected because it attempted to create a resource that already // exists. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInvalidAliasNameException "InvalidAliasNameException" +// * InvalidAliasNameException // The request was rejected because the specified alias name is not valid. // -// * ErrCodeInternalException "KMSInternalException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) +// * LimitExceededException +// The request was rejected because a quota was exceeded. For more information, +// see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) // in the AWS Key Management Service Developer Guide. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateAlias func (c *KMS) CreateAlias(input *CreateAliasInput) (*CreateAliasOutput, error) { @@ -515,8 +551,8 @@ func (c *KMS) CreateCustomKeyStoreRequest(input *CreateCustomKeyStoreInput) (req // See the AWS API reference guide for AWS Key Management Service's // API operation CreateCustomKeyStore for usage and error information. // -// Returned Error Codes: -// * ErrCodeCloudHsmClusterInUseException "CloudHsmClusterInUseException" +// Returned Error Types: +// * CloudHsmClusterInUseException // The request was rejected because the specified AWS CloudHSM cluster is already // associated with a custom key store or it shares a backup history with a cluster // that is associated with a custom key store. Each custom key store must be @@ -526,28 +562,28 @@ func (c *KMS) CreateCustomKeyStoreRequest(input *CreateCustomKeyStoreInput) (req // view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) // operation. // -// * ErrCodeCustomKeyStoreNameInUseException "CustomKeyStoreNameInUseException" +// * CustomKeyStoreNameInUseException // The request was rejected because the specified custom key store name is already // assigned to another custom key store in the account. Try again with a custom // key store name that is unique in the account. // -// * ErrCodeCloudHsmClusterNotFoundException "CloudHsmClusterNotFoundException" +// * CloudHsmClusterNotFoundException // The request was rejected because AWS KMS cannot find the AWS CloudHSM cluster // with the specified cluster ID. Retry the request with a different cluster // ID. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeCloudHsmClusterNotActiveException "CloudHsmClusterNotActiveException" +// * CloudHsmClusterNotActiveException // The request was rejected because the AWS CloudHSM cluster that is associated // with the custom key store is not active. Initialize and activate the cluster // and try the command again. For detailed instructions, see Getting Started // (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html) // in the AWS CloudHSM User Guide. // -// * ErrCodeIncorrectTrustAnchorException "IncorrectTrustAnchorException" +// * IncorrectTrustAnchorException // The request was rejected because the trust anchor certificate in the request // is not the trust anchor certificate for the specified AWS CloudHSM cluster. // @@ -555,7 +591,7 @@ func (c *KMS) CreateCustomKeyStoreRequest(input *CreateCustomKeyStoreInput) (req // you create the trust anchor certificate and save it in the customerCA.crt // file. // -// * ErrCodeCloudHsmClusterInvalidConfigurationException "CloudHsmClusterInvalidConfigurationException" +// * CloudHsmClusterInvalidConfigurationException // The request was rejected because the associated AWS CloudHSM cluster did // not meet the configuration requirements for a custom key store. // @@ -657,17 +693,44 @@ func (c *KMS) CreateGrantRequest(input *CreateGrantInput) (req *request.Request, // principal to use the CMK when the conditions specified in the grant are met. // When setting permissions, grants are an alternative to key policies. // -// To create a grant that allows a cryptographic operation only when the encryption -// context in the operation request matches or includes a specified encryption -// context, use the Constraints parameter. For details, see GrantConstraints. +// To create a grant that allows a cryptographic operation only when the request +// includes a particular encryption context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context), +// use the Constraints parameter. For details, see GrantConstraints. +// +// You can create grants on symmetric and asymmetric CMKs. However, if the grant +// allows an operation that the CMK does not support, CreateGrant fails with +// a ValidationException. +// +// * Grants for symmetric CMKs cannot allow operations that are not supported +// for symmetric CMKs, including Sign, Verify, and GetPublicKey. (There are +// limited exceptions to this rule for legacy operations, but you should +// not create a grant for an operation that AWS KMS does not support.) +// +// * Grants for asymmetric CMKs cannot allow operations that are not supported +// for asymmetric CMKs, including operations that generate data keys (https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKey) +// or data key pairs (https://docs.aws.amazon.com/kms/latest/APIReference/API_GenerateDataKeyPair), +// or operations related to automatic key rotation (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html), +// imported key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html), +// or CMKs in custom key stores (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). +// +// * Grants for asymmetric CMKs with a KeyUsage of ENCRYPT_DECRYPT cannot +// allow the Sign or Verify operations. Grants for asymmetric CMKs with a +// KeyUsage of SIGN_VERIFY cannot allow the Encrypt or Decrypt operations. +// +// * Grants for asymmetric CMKs cannot include an encryption context grant +// constraint. An encryption context is not supported on asymmetric CMKs. +// +// For information about symmetric and asymmetric CMKs, see Using Symmetric +// and Asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the AWS Key Management Service Developer Guide. // // To perform this operation on a CMK in a different AWS account, specify the // key ARN in the value of the KeyId parameter. For more information about grants, // see Grants (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) // in the AWS Key Management Service Developer Guide . // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -677,41 +740,41 @@ func (c *KMS) CreateGrantRequest(input *CreateGrantInput) (req *request.Request, // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeDisabledException "DisabledException" +// * DisabledException // The request was rejected because the specified CMK is not enabled. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidGrantTokenException "InvalidGrantTokenException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) +// * LimitExceededException +// The request was rejected because a quota was exceeded. For more information, +// see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) // in the AWS Key Management Service Developer Guide. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/CreateGrant func (c *KMS) CreateGrant(input *CreateGrantInput) (*CreateGrantOutput, error) { @@ -779,23 +842,68 @@ func (c *KMS) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, out // CreateKey API operation for AWS Key Management Service. // -// Creates a customer managed customer master key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys) -// (CMK) in your AWS account. +// Creates a unique customer managed customer master key (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master-keys) +// (CMK) in your AWS account and Region. You cannot use this operation to create +// a CMK in a different AWS account. +// +// You can use the CreateKey operation to create symmetric or asymmetric CMKs. +// +// * Symmetric CMKs contain a 256-bit symmetric key that never leaves AWS +// KMS unencrypted. To use the CMK, you must call AWS KMS. You can use a +// symmetric CMK to encrypt and decrypt small amounts of data, but they are +// typically used to generate data keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) +// and data keys pairs (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-key-pairs). +// For details, see GenerateDataKey and GenerateDataKeyPair. +// +// * Asymmetric CMKs can contain an RSA key pair or an Elliptic Curve (ECC) +// key pair. The private key in an asymmetric CMK never leaves AWS KMS unencrypted. +// However, you can use the GetPublicKey operation to download the public +// key so it can be used outside of AWS KMS. CMKs with RSA key pairs can +// be used to encrypt or decrypt data or sign and verify messages (but not +// both). CMKs with ECC key pairs can be used only to sign and verify messages. +// +// For information about symmetric and asymmetric CMKs, see Using Symmetric +// and Asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the AWS Key Management Service Developer Guide. +// +// To create different types of CMKs, use the following guidance: +// +// Asymmetric CMKs // -// You can use a CMK to encrypt small amounts of data (up to 4096 bytes) directly. -// But CMKs are more commonly used to encrypt the data keys (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) -// that are used to encrypt data. +// To create an asymmetric CMK, use the CustomerMasterKeySpec parameter to specify +// the type of key material in the CMK. Then, use the KeyUsage parameter to +// determine whether the CMK will be used to encrypt and decrypt or sign and +// verify. You can't change these properties after the CMK is created. // -// To create a CMK for imported key material, use the Origin parameter with -// a value of EXTERNAL. +// Symmetric CMKs // -// To create a CMK in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html), +// When creating a symmetric CMK, you don't need to specify the CustomerMasterKeySpec +// or KeyUsage parameters. The default value for CustomerMasterKeySpec, SYMMETRIC_DEFAULT, +// and the default value for KeyUsage, ENCRYPT_DECRYPT, are the only valid values +// for symmetric CMKs. +// +// Imported Key Material +// +// To import your own key material, begin by creating a symmetric CMK with no +// key material. To do this, use the Origin parameter of CreateKey with a value +// of EXTERNAL. Next, use GetParametersForImport operation to get a public key +// and import token, and use the public key to encrypt your key material. Then, +// use ImportKeyMaterial with your import token to import the key material. +// For step-by-step instructions, see Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) +// in the AWS Key Management Service Developer Guide . You cannot import the +// key material into an asymmetric CMK. +// +// Custom Key Stores +// +// To create a symmetric CMK in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html), // use the CustomKeyStoreId parameter to specify the custom key store. You must // also use the Origin parameter with a value of AWS_CLOUDHSM. The AWS CloudHSM // cluster that is associated with the custom key store must have at least two // active HSMs in different Availability Zones in the AWS Region. // -// You cannot use this operation to create a CMK in a different AWS account. +// You cannot create an asymmetric CMK in a custom key store. For information +// about custom key stores in AWS KMS see Using Custom Key Stores (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.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 @@ -804,40 +912,40 @@ func (c *KMS) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, out // 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" +// Returned Error Types: +// * MalformedPolicyDocumentException // The request was rejected because the specified policy is not syntactically // or semantically correct. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // -// * ErrCodeInternalException "KMSInternalException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) +// * LimitExceededException +// The request was rejected because a quota was exceeded. For more information, +// see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) // in the AWS Key Management Service Developer Guide. // -// * ErrCodeTagException "TagException" +// * TagException // The request was rejected because one or more tags are not valid. // -// * ErrCodeCustomKeyStoreNotFoundException "CustomKeyStoreNotFoundException" +// * CustomKeyStoreNotFoundException // The request was rejected because AWS KMS cannot find a custom key store with // the specified key store name or ID. // -// * ErrCodeCustomKeyStoreInvalidStateException "CustomKeyStoreInvalidStateException" +// * CustomKeyStoreInvalidStateException // The request was rejected because of the ConnectionState of the custom key // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores // operation. @@ -856,7 +964,7 @@ func (c *KMS) CreateKeyRequest(input *CreateKeyInput) (req *request.Request, out // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid // for all other ConnectionState values. // -// * ErrCodeCloudHsmClusterInvalidConfigurationException "CloudHsmClusterInvalidConfigurationException" +// * CloudHsmClusterInvalidConfigurationException // The request was rejected because the associated AWS CloudHSM cluster did // not meet the configuration requirements for a custom key store. // @@ -954,25 +1062,51 @@ func (c *KMS) DecryptRequest(input *DecryptInput) (req *request.Request, output // Decrypt API operation for AWS Key Management Service. // -// Decrypts ciphertext. Ciphertext is plaintext that has been previously encrypted -// by using any of the following operations: +// Decrypts ciphertext that was encrypted by a AWS KMS customer master key (CMK) +// using any of the following operations: +// +// * Encrypt // // * GenerateDataKey // +// * GenerateDataKeyPair +// // * GenerateDataKeyWithoutPlaintext // -// * Encrypt +// * GenerateDataKeyPairWithoutPlaintext +// +// You can use this operation to decrypt ciphertext that was encrypted under +// a symmetric or asymmetric CMK. When the CMK is asymmetric, you must specify +// the CMK and the encryption algorithm that was used to encrypt the ciphertext. +// For information about symmetric and asymmetric CMKs, see Using Symmetric +// and Asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the AWS Key Management Service Developer Guide. +// +// The Decrypt operation also decrypts ciphertext that was encrypted outside +// of AWS KMS by the public key in an AWS KMS asymmetric CMK. However, it cannot +// decrypt ciphertext produced by other libraries, such as the AWS Encryption +// SDK (https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/) +// or Amazon S3 client-side encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html). +// These libraries return a ciphertext format that is incompatible with AWS +// KMS. +// +// If the ciphertext was encrypted under a symmetric CMK, you do not need to +// specify the CMK or the encryption algorithm. AWS KMS can get this information +// from metadata that it adds to the symmetric ciphertext blob. However, if +// you prefer, you can specify the KeyId to ensure that a particular CMK is +// used to decrypt the ciphertext. If you specify a different CMK than the one +// used to encrypt the ciphertext, the Decrypt operation fails. // // Whenever possible, use key policies to give users permission to call the -// Decrypt operation on the CMK, instead of IAM policies. Otherwise, you might -// create an IAM user policy that gives the user Decrypt permission on all CMKs. -// This user could decrypt ciphertext that was encrypted by CMKs in other accounts -// if the key policy for the cross-account CMK permits it. If you must use an -// IAM policy for Decrypt permissions, limit the user to particular CMKs or -// particular trusted accounts. -// -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// Decrypt operation on a particular CMK, instead of using IAM policies. Otherwise, +// you might create an IAM user policy that gives the user Decrypt permission +// on all CMKs. This user could decrypt ciphertext that was encrypted by CMKs +// in other accounts if the key policy for the cross-account CMK permits it. +// If you must use an IAM policy for Decrypt permissions, limit the user to +// particular CMKs or particular trusted accounts. +// +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -982,41 +1116,65 @@ func (c *KMS) DecryptRequest(input *DecryptInput) (req *request.Request, output // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeDisabledException "DisabledException" +// * DisabledException // The request was rejected because the specified CMK is not enabled. // -// * ErrCodeInvalidCiphertextException "InvalidCiphertextException" -// The request was rejected because the specified ciphertext, or additional -// authenticated data incorporated into the ciphertext, such as the encryption -// context, is corrupted, missing, or otherwise invalid. +// * InvalidCiphertextException +// From the Decrypt or ReEncrypt operation, the request was rejected because +// the specified ciphertext, or additional authenticated data incorporated into +// the ciphertext, such as the encryption context, is corrupted, missing, or +// otherwise invalid. +// +// From the ImportKeyMaterial operation, the request was rejected because AWS +// KMS could not decrypt the encrypted (wrapped) key material. +// +// * KeyUnavailableException +// The request was rejected because the specified CMK was not available. You +// can retry the request. +// +// * IncorrectKeyException +// The request was rejected because the specified CMK cannot decrypt the data. +// The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request +// must identify the same CMK that was used to encrypt the ciphertext. +// +// * InvalidKeyUsageException +// The request was rejected for one of the following reasons: // -// * ErrCodeKeyUnavailableException "KeyUnavailableException" -// The request was rejected because the specified CMK was not available. The -// request can be retried. +// * The KeyUsage value of the CMK is incompatible with the API operation. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * The encryption algorithm or signing algorithm specified for the operation +// is incompatible with the type of key material in the CMK (CustomerMasterKeySpec). +// +// For encrypting, decrypting, re-encrypting, and generating data keys, the +// KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage +// must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation. +// +// To find the encryption or signing algorithms supported for a particular CMK, +// use the DescribeKey operation. +// +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInvalidGrantTokenException "InvalidGrantTokenException" +// * InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Decrypt func (c *KMS) Decrypt(input *DecryptInput) (*DecryptOutput, error) { @@ -1104,26 +1262,26 @@ func (c *KMS) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Request, // 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" +// Returned Error Types: +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteAlias func (c *KMS) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error) { @@ -1229,14 +1387,14 @@ func (c *KMS) DeleteCustomKeyStoreRequest(input *DeleteCustomKeyStoreInput) (req // See the AWS API reference guide for AWS Key Management Service's // API operation DeleteCustomKeyStore for usage and error information. // -// Returned Error Codes: -// * ErrCodeCustomKeyStoreHasCMKsException "CustomKeyStoreHasCMKsException" +// Returned Error Types: +// * CustomKeyStoreHasCMKsException // The request was rejected because the custom key store contains AWS KMS customer // master keys (CMKs). After verifying that you do not need to use the CMKs, // use the ScheduleKeyDeletion operation to delete the CMKs. After they are // deleted, you can delete the custom key store. // -// * ErrCodeCustomKeyStoreInvalidStateException "CustomKeyStoreInvalidStateException" +// * CustomKeyStoreInvalidStateException // The request was rejected because of the ConnectionState of the custom key // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores // operation. @@ -1255,11 +1413,11 @@ func (c *KMS) DeleteCustomKeyStoreRequest(input *DeleteCustomKeyStoreInput) (req // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid // for all other ConnectionState values. // -// * ErrCodeCustomKeyStoreNotFoundException "CustomKeyStoreNotFoundException" +// * CustomKeyStoreNotFoundException // The request was rejected because AWS KMS cannot find a custom key store with // the specified key store name or ID. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // @@ -1342,8 +1500,8 @@ func (c *KMS) DeleteImportedKeyMaterialRequest(input *DeleteImportedKeyMaterialI // After you delete key material, you can use ImportKeyMaterial to reimport // the same key material into the CMK. // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -1353,34 +1511,34 @@ func (c *KMS) DeleteImportedKeyMaterialRequest(input *DeleteImportedKeyMaterialI // 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" +// Returned Error Types: +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DeleteImportedKeyMaterial func (c *KMS) DeleteImportedKeyMaterial(input *DeleteImportedKeyMaterialInput) (*DeleteImportedKeyMaterialOutput, error) { @@ -1483,12 +1641,12 @@ func (c *KMS) DescribeCustomKeyStoresRequest(input *DescribeCustomKeyStoresInput // See the AWS API reference guide for AWS Key Management Service's // API operation DescribeCustomKeyStores for usage and error information. // -// Returned Error Codes: -// * ErrCodeCustomKeyStoreNotFoundException "CustomKeyStoreNotFoundException" +// Returned Error Types: +// * CustomKeyStoreNotFoundException // The request was rejected because AWS KMS cannot find a custom key store with // the specified key store name or ID. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // @@ -1558,12 +1716,38 @@ func (c *KMS) DescribeKeyRequest(input *DescribeKeyInput) (req *request.Request, // DescribeKey API operation for AWS Key Management Service. // -// Provides detailed information about the specified customer master key (CMK). +// Provides detailed information about a customer master key (CMK). You can +// run DescribeKey on a customer managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) +// or an AWS managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). +// +// This detailed information includes the key ARN, creation date (and deletion +// date, if applicable), the key state, and the origin and expiration date (if +// any) of the key material. For CMKs in custom key stores, it includes information +// about the custom key store, such as the key store ID and the AWS CloudHSM +// cluster ID. It includes fields, like KeySpec, that help you distinguish symmetric +// from asymmetric CMKs. It also provides information that is particularly important +// to asymmetric CMKs, such as the key usage (encryption or signing) and the +// encryption algorithms or signing algorithms that the CMK supports. +// +// DescribeKey does not return the following information: // -// You can use DescribeKey on a predefined AWS alias, that is, an AWS alias -// with no key ID. When you do, AWS KMS associates the alias with an AWS managed -// CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys) -// and returns its KeyId and Arn in the response. +// * Aliases associated with the CMK. To get this information, use ListAliases. +// +// * Whether automatic key rotation is enabled on the CMK. To get this information, +// use GetKeyRotationStatus. Also, some key states prevent a CMK from being +// automatically rotated. For details, see How Automatic Key Rotation Works +// (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotate-keys-how-it-works) +// in AWS Key Management Service Developer Guide. +// +// * Tags on the CMK. To get this information, use ListResourceTags. +// +// * Key policies and grants on the CMK. To get this information, use GetKeyPolicy +// and ListGrants. +// +// If you call the DescribeKey operation on a predefined AWS alias, that is, +// an AWS alias with no key ID, AWS KMS creates an AWS managed CMK (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys). +// Then, it associates the alias with the new CMK, and returns the KeyId and +// Arn of the new CMK in the response. // // To perform this operation on a CMK in a different AWS account, specify the // key ARN or alias ARN in the value of the KeyId parameter. @@ -1575,20 +1759,20 @@ func (c *KMS) DescribeKeyRequest(input *DescribeKeyInput) (req *request.Request, // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // @@ -1667,8 +1851,8 @@ func (c *KMS) DisableKeyRequest(input *DisableKeyInput) (req *request.Request, o // Key State Affects the Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide . // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -1678,30 +1862,30 @@ func (c *KMS) DisableKeyRequest(input *DisableKeyInput) (req *request.Request, o // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/DisableKey func (c *KMS) DisableKey(input *DisableKeyInput) (*DisableKeyOutput, error) { @@ -1771,11 +1955,14 @@ func (c *KMS) DisableKeyRotationRequest(input *DisableKeyRotationInput) (req *re // DisableKeyRotation API operation for AWS Key Management Service. // // Disables automatic rotation of the key material (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) -// for the specified customer master key (CMK). You cannot perform this operation -// on a CMK in a different AWS account. +// for the specified symmetric customer master key (CMK). +// +// You cannot enable automatic rotation of asymmetric CMKs, CMKs with imported +// key material, or CMKs in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). +// You cannot perform this operation on a CMK in a different AWS account. // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -1785,35 +1972,35 @@ func (c *KMS) DisableKeyRotationRequest(input *DisableKeyRotationInput) (req *re // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeDisabledException "DisabledException" +// * DisabledException // The request was rejected because the specified CMK is not enabled. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -1912,8 +2099,8 @@ func (c *KMS) DisconnectCustomKeyStoreRequest(input *DisconnectCustomKeyStoreInp // See the AWS API reference guide for AWS Key Management Service's // API operation DisconnectCustomKeyStore for usage and error information. // -// Returned Error Codes: -// * ErrCodeCustomKeyStoreInvalidStateException "CustomKeyStoreInvalidStateException" +// Returned Error Types: +// * CustomKeyStoreInvalidStateException // The request was rejected because of the ConnectionState of the custom key // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores // operation. @@ -1932,11 +2119,11 @@ func (c *KMS) DisconnectCustomKeyStoreRequest(input *DisconnectCustomKeyStoreInp // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid // for all other ConnectionState values. // -// * ErrCodeCustomKeyStoreNotFoundException "CustomKeyStoreNotFoundException" +// * CustomKeyStoreNotFoundException // The request was rejected because AWS KMS cannot find a custom key store with // the specified key store name or ID. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // @@ -2011,8 +2198,8 @@ func (c *KMS) EnableKeyRequest(input *EnableKeyInput) (req *request.Request, out // you to use the CMK for cryptographic operations. You cannot perform this // operation on a CMK in a different AWS account. // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -2022,35 +2209,35 @@ func (c *KMS) EnableKeyRequest(input *EnableKeyInput) (req *request.Request, out // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInternalException "KMSInternalException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) +// * LimitExceededException +// The request was rejected because a quota was exceeded. For more information, +// see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) // in the AWS Key Management Service Developer Guide. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/EnableKey func (c *KMS) EnableKey(input *EnableKeyInput) (*EnableKeyOutput, error) { @@ -2120,14 +2307,14 @@ func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) (req *requ // EnableKeyRotation API operation for AWS Key Management Service. // // Enables automatic rotation of the key material (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) -// for the specified customer master key (CMK). You cannot perform this operation -// on a CMK in a different AWS account. +// for the specified symmetric customer master key (CMK). You cannot perform +// this operation on a CMK in a different AWS account. // -// You cannot enable automatic rotation of CMKs with imported key material or -// CMKs in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). +// You cannot enable automatic rotation of asymmetric CMKs, CMKs with imported +// key material, or CMKs in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -2137,35 +2324,35 @@ func (c *KMS) EnableKeyRotationRequest(input *EnableKeyRotationInput) (req *requ // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeDisabledException "DisabledException" +// * DisabledException // The request was rejected because the specified CMK is not enabled. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -2238,8 +2425,8 @@ func (c *KMS) EncryptRequest(input *EncryptInput) (req *request.Request, output // Encrypts plaintext into ciphertext by using a customer master key (CMK). // The Encrypt operation has two primary use cases: // -// * You can encrypt up to 4 kilobytes (4096 bytes) of arbitrary data such -// as an RSA key, a database password, or other sensitive information. +// * You can encrypt small amounts of arbitrary data, such as a personal +// identifier or database password, or other sensitive information. // // * You can use the Encrypt operation to move encrypted data from one AWS // region to another. In the first region, generate a data key and use the @@ -2248,16 +2435,50 @@ func (c *KMS) EncryptRequest(input *EncryptInput) (req *request.Request, output // data and encrypted data key to the new region, and decrypt in the new // region when necessary. // -// You don't need use this operation to encrypt a data key within a region. -// The GenerateDataKey and GenerateDataKeyWithoutPlaintext operations return -// an encrypted data key. +// You don't need to use the Encrypt operation to encrypt a data key. The GenerateDataKey +// and GenerateDataKeyPair operations return a plaintext data key and an encrypted +// copy of that data key. +// +// When you encrypt data, you must specify a symmetric or asymmetric CMK to +// use in the encryption operation. The CMK must have a KeyUsage value of ENCRYPT_DECRYPT. +// To find the KeyUsage of a CMK, use the DescribeKey operation. +// +// If you use a symmetric CMK, you can use an encryption context to add additional +// security to your encryption operation. If you specify an EncryptionContext +// when encrypting data, you must specify the same encryption context (a case-sensitive +// exact match) when decrypting the data. Otherwise, the request to decrypt +// fails with an InvalidCiphertextException. For more information, see Encryption +// Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) +// in the AWS Key Management Service Developer Guide. +// +// If you specify an asymmetric CMK, you must also specify the encryption algorithm. +// The algorithm must be compatible with the CMK type. +// +// When you use an asymmetric CMK to encrypt or reencrypt data, be sure to record +// the CMK and encryption algorithm that you choose. You will be required to +// provide the same CMK and encryption algorithm when you decrypt the data. +// If the CMK and algorithm do not match the values used to encrypt the data, +// the decrypt operation fails. +// +// You are not required to supply the CMK ID and encryption algorithm when you +// decrypt with symmetric CMKs because AWS KMS stores this information in the +// ciphertext blob. AWS KMS cannot store metadata in ciphertext generated with +// asymmetric keys. The standard format for asymmetric key ciphertext does not +// include configurable fields. // -// Also, you don't need to use this operation to encrypt data in your application. -// You can use the plaintext and encrypted data keys that the GenerateDataKey -// operation returns. +// The maximum size of the data that you can encrypt varies with the type of +// CMK and the encryption algorithm that you choose. // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// * Symmetric CMKs SYMMETRIC_DEFAULT: 4096 bytes +// +// * RSA_2048 RSAES_OAEP_SHA_1: 214 bytes RSAES_OAEP_SHA_256: 190 bytes +// +// * RSA_3072 RSAES_OAEP_SHA_1: 342 bytes RSAES_OAEP_SHA_256: 318 bytes +// +// * RSA_4096 RSAES_OAEP_SHA_1: 470 bytes RSAES_OAEP_SHA_256: 446 bytes +// +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // // To perform this operation on a CMK in a different AWS account, specify the @@ -2270,39 +2491,51 @@ func (c *KMS) EncryptRequest(input *EncryptInput) (req *request.Request, output // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeDisabledException "DisabledException" +// * 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. +// * KeyUnavailableException +// The request was rejected because the specified CMK was not available. You +// can retry the request. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * 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. +// * InvalidKeyUsageException +// The request was rejected for one of the following reasons: +// +// * The KeyUsage value of the CMK is incompatible with the API operation. +// +// * The encryption algorithm or signing algorithm specified for the operation +// is incompatible with the type of key material in the CMK (CustomerMasterKeySpec). +// +// For encrypting, decrypting, re-encrypting, and generating data keys, the +// KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage +// must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation. +// +// To find the encryption or signing algorithms supported for a particular CMK, +// use the DescribeKey operation. // -// * ErrCodeInvalidGrantTokenException "InvalidGrantTokenException" +// * InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Encrypt func (c *KMS) Encrypt(input *EncryptInput) (*EncryptOutput, error) { @@ -2370,26 +2603,43 @@ func (c *KMS) GenerateDataKeyRequest(input *GenerateDataKeyInput) (req *request. // GenerateDataKey API operation for AWS Key Management Service. // -// Generates a unique data key. This operation returns a plaintext copy of the -// data key and a copy that is encrypted under a customer master key (CMK) that -// you specify. You can use the plaintext key to encrypt your data outside of -// KMS and store the encrypted data key with the encrypted data. +// Generates a unique symmetric data key. This operation returns a plaintext +// copy of the data key and a copy that is encrypted under a customer master +// key (CMK) that you specify. You can use the plaintext key to encrypt your +// data outside of AWS KMS and store the encrypted data key with the encrypted +// data. // // GenerateDataKey returns a unique data key for each request. The bytes in // the key are not related to the caller or CMK that is used to encrypt the // data key. // -// To generate a data key, you need to specify the customer master key (CMK) -// that will be used to encrypt the data key. You must also specify the length -// of the data key using either the KeySpec or NumberOfBytes field (but not -// both). For common key lengths (128-bit and 256-bit symmetric keys), we recommend -// that you use KeySpec. To perform this operation on a CMK in a different AWS -// account, specify the key ARN or alias ARN in the value of the KeyId parameter. +// To generate a data key, specify the symmetric CMK that will be used to encrypt +// the data key. You cannot use an asymmetric CMK to generate data keys. To +// get the type of your CMK, use the DescribeKey operation. +// +// You must also specify the length of the data key. Use either the KeySpec +// or NumberOfBytes parameters (but not both). For 128-bit and 256-bit data +// keys, use the KeySpec parameter. // -// You will find the plaintext copy of the data key in the Plaintext field of -// the response, and the encrypted copy of the data key in the CiphertextBlob +// If the operation succeeds, the plaintext copy of the data key is in the Plaintext +// field of the response, and the encrypted copy of the data key in the CiphertextBlob // field. // +// To get only an encrypted copy of the data key, use GenerateDataKeyWithoutPlaintext. +// To generate an asymmetric data key pair, use the GenerateDataKeyPair or GenerateDataKeyPairWithoutPlaintext +// operation. To get a cryptographically secure random byte string, use GenerateRandom. +// +// You can use the optional encryption context to add additional security to +// the encryption operation. If you specify an EncryptionContext, you must specify +// the same encryption context (a case-sensitive exact match) when decrypting +// the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException. +// For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) +// in the AWS Key Management Service Developer Guide. +// +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the AWS Key Management Service Developer Guide. +// // We recommend that you use the following pattern to encrypt data locally in // your application: // @@ -2409,21 +2659,6 @@ func (c *KMS) GenerateDataKeyRequest(input *GenerateDataKeyInput) (req *request. // Use the plaintext data key to decrypt data locally, then erase the plaintext // data key from memory. // -// To get only an encrypted copy of the data key, use GenerateDataKeyWithoutPlaintext. -// To get a cryptographically secure random byte string, use GenerateRandom. -// -// You can use the optional encryption context to add additional security to -// your encryption operation. When you specify an EncryptionContext in the GenerateDataKey -// operation, you must specify the same encryption context (a case-sensitive -// exact match) in your request to Decrypt the data key. Otherwise, the request -// to decrypt fails with an InvalidCiphertextException. For more information, -// see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) -// in the AWS Key Management Service Developer Guide . -// -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://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. @@ -2431,39 +2666,51 @@ func (c *KMS) GenerateDataKeyRequest(input *GenerateDataKeyInput) (req *request. // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeDisabledException "DisabledException" +// * 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. +// * KeyUnavailableException +// The request was rejected because the specified CMK was not available. You +// can retry the request. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * 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. +// * InvalidKeyUsageException +// The request was rejected for one of the following reasons: // -// * ErrCodeInvalidGrantTokenException "InvalidGrantTokenException" +// * The KeyUsage value of the CMK is incompatible with the API operation. +// +// * The encryption algorithm or signing algorithm specified for the operation +// is incompatible with the type of key material in the CMK (CustomerMasterKeySpec). +// +// For encrypting, decrypting, re-encrypting, and generating data keys, the +// KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage +// must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation. +// +// To find the encryption or signing algorithms supported for a particular CMK, +// use the DescribeKey operation. +// +// * InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKey func (c *KMS) GenerateDataKey(input *GenerateDataKeyInput) (*GenerateDataKeyOutput, error) { @@ -2487,74 +2734,85 @@ func (c *KMS) GenerateDataKeyWithContext(ctx aws.Context, input *GenerateDataKey return out, req.Send() } -const opGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext" +const opGenerateDataKeyPair = "GenerateDataKeyPair" -// GenerateDataKeyWithoutPlaintextRequest generates a "aws/request.Request" representing the -// client's request for the GenerateDataKeyWithoutPlaintext operation. The "output" return +// GenerateDataKeyPairRequest generates a "aws/request.Request" representing the +// client's request for the GenerateDataKeyPair operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GenerateDataKeyWithoutPlaintext for more information on using the GenerateDataKeyWithoutPlaintext +// See GenerateDataKeyPair for more information on using the GenerateDataKeyPair // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GenerateDataKeyWithoutPlaintextRequest method. -// req, resp := client.GenerateDataKeyWithoutPlaintextRequest(params) +// // Example sending a request using the GenerateDataKeyPairRequest method. +// req, resp := client.GenerateDataKeyPairRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyWithoutPlaintext -func (c *KMS) GenerateDataKeyWithoutPlaintextRequest(input *GenerateDataKeyWithoutPlaintextInput) (req *request.Request, output *GenerateDataKeyWithoutPlaintextOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPair +func (c *KMS) GenerateDataKeyPairRequest(input *GenerateDataKeyPairInput) (req *request.Request, output *GenerateDataKeyPairOutput) { op := &request.Operation{ - Name: opGenerateDataKeyWithoutPlaintext, + Name: opGenerateDataKeyPair, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GenerateDataKeyWithoutPlaintextInput{} + input = &GenerateDataKeyPairInput{} } - output = &GenerateDataKeyWithoutPlaintextOutput{} + output = &GenerateDataKeyPairOutput{} req = c.newRequest(op, input, output) return } -// GenerateDataKeyWithoutPlaintext API operation for AWS Key Management Service. +// GenerateDataKeyPair API operation for AWS Key Management Service. // -// Generates a unique data key. This operation returns a data key that is encrypted -// under a customer master key (CMK) that you specify. GenerateDataKeyWithoutPlaintext -// is identical to GenerateDataKey except that returns only the encrypted copy -// of the data key. +// Generates a unique asymmetric data key pair. The GenerateDataKeyPair operation +// returns a plaintext public key, a plaintext private key, and a copy of the +// private key that is encrypted under the symmetric CMK you specify. You can +// use the data key pair to perform asymmetric cryptography outside of AWS KMS. // -// Like GenerateDataKey, GenerateDataKeyWithoutPlaintext returns a unique data -// key for each request. The bytes in the key are not related to the caller -// or CMK that is used to encrypt the data key. +// GenerateDataKeyPair returns a unique data key pair for each request. The +// bytes in the keys are not related to the caller or the CMK that is used to +// encrypt the private key. // -// This operation is useful for systems that need to encrypt data at some point, -// but not immediately. When you need to encrypt the data, you call the Decrypt -// operation on the encrypted copy of the key. +// You can use the public key that GenerateDataKeyPair returns to encrypt data +// or verify a signature outside of AWS KMS. Then, store the encrypted private +// key with the data. When you are ready to decrypt data or sign a message, +// you can use the Decrypt operation to decrypt the encrypted private key. // -// It's also useful in distributed systems with different levels of trust. For -// example, you might store encrypted data in containers. One component of your -// system creates new containers and stores an encrypted data key with each -// container. Then, a different component puts the data into the containers. -// That component first decrypts the data key, uses the plaintext data key to -// encrypt data, puts the encrypted data into the container, and then destroys -// the plaintext data key. In this system, the component that creates the containers -// never sees the plaintext data key. +// To generate a data key pair, you must specify a symmetric customer master +// key (CMK) to encrypt the private key in a data key pair. You cannot use an +// asymmetric CMK. To get the type of your CMK, use the DescribeKey operation. +// +// If you are using the data key pair to encrypt data, or for any operation +// where you don't immediately need a private key, consider using the GenerateDataKeyPairWithoutPlaintext +// operation. GenerateDataKeyPairWithoutPlaintext returns a plaintext public +// key and an encrypted private key, but omits the plaintext private key that +// you need only to decrypt ciphertext or sign a message. Later, when you need +// to decrypt the data or sign a message, use the Decrypt operation to decrypt +// the encrypted private key in the data key pair. +// +// You can use the optional encryption context to add additional security to +// the encryption operation. If you specify an EncryptionContext, you must specify +// the same encryption context (a case-sensitive exact match) when decrypting +// the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException. +// For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) +// in the AWS Key Management Service Developer Guide. // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -2562,258 +2820,582 @@ func (c *KMS) GenerateDataKeyWithoutPlaintextRequest(input *GenerateDataKeyWitho // the error. // // See the AWS API reference guide for AWS Key Management Service's -// API operation GenerateDataKeyWithoutPlaintext for usage and error information. +// API operation GenerateDataKeyPair for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeDisabledException "DisabledException" +// * 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. +// * KeyUnavailableException +// The request was rejected because the specified CMK was not available. You +// can retry the request. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * 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. +// * InvalidKeyUsageException +// The request was rejected for one of the following reasons: +// +// * The KeyUsage value of the CMK is incompatible with the API operation. +// +// * The encryption algorithm or signing algorithm specified for the operation +// is incompatible with the type of key material in the CMK (CustomerMasterKeySpec). // -// * ErrCodeInvalidGrantTokenException "InvalidGrantTokenException" +// For encrypting, decrypting, re-encrypting, and generating data keys, the +// KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage +// must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation. +// +// To find the encryption or signing algorithms supported for a particular CMK, +// use the DescribeKey operation. +// +// * InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPair +func (c *KMS) GenerateDataKeyPair(input *GenerateDataKeyPairInput) (*GenerateDataKeyPairOutput, error) { + req, out := c.GenerateDataKeyPairRequest(input) return out, req.Send() } -// GenerateDataKeyWithoutPlaintextWithContext is the same as GenerateDataKeyWithoutPlaintext with the addition of +// GenerateDataKeyPairWithContext is the same as GenerateDataKeyPair with the addition of // the ability to pass a context and additional request options. // -// See GenerateDataKeyWithoutPlaintext for details on how to use this API operation. +// See GenerateDataKeyPair for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *KMS) GenerateDataKeyWithoutPlaintextWithContext(ctx aws.Context, input *GenerateDataKeyWithoutPlaintextInput, opts ...request.Option) (*GenerateDataKeyWithoutPlaintextOutput, error) { - req, out := c.GenerateDataKeyWithoutPlaintextRequest(input) +func (c *KMS) GenerateDataKeyPairWithContext(ctx aws.Context, input *GenerateDataKeyPairInput, opts ...request.Option) (*GenerateDataKeyPairOutput, error) { + req, out := c.GenerateDataKeyPairRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGenerateRandom = "GenerateRandom" +const opGenerateDataKeyPairWithoutPlaintext = "GenerateDataKeyPairWithoutPlaintext" -// GenerateRandomRequest generates a "aws/request.Request" representing the -// client's request for the GenerateRandom operation. The "output" return +// GenerateDataKeyPairWithoutPlaintextRequest generates a "aws/request.Request" representing the +// client's request for the GenerateDataKeyPairWithoutPlaintext operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GenerateRandom for more information on using the GenerateRandom +// See GenerateDataKeyPairWithoutPlaintext for more information on using the GenerateDataKeyPairWithoutPlaintext // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GenerateRandomRequest method. -// req, resp := client.GenerateRandomRequest(params) +// // Example sending a request using the GenerateDataKeyPairWithoutPlaintextRequest method. +// req, resp := client.GenerateDataKeyPairWithoutPlaintextRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateRandom -func (c *KMS) GenerateRandomRequest(input *GenerateRandomInput) (req *request.Request, output *GenerateRandomOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPairWithoutPlaintext +func (c *KMS) GenerateDataKeyPairWithoutPlaintextRequest(input *GenerateDataKeyPairWithoutPlaintextInput) (req *request.Request, output *GenerateDataKeyPairWithoutPlaintextOutput) { op := &request.Operation{ - Name: opGenerateRandom, + Name: opGenerateDataKeyPairWithoutPlaintext, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GenerateRandomInput{} + input = &GenerateDataKeyPairWithoutPlaintextInput{} } - output = &GenerateRandomOutput{} + output = &GenerateDataKeyPairWithoutPlaintextOutput{} req = c.newRequest(op, input, output) return } -// GenerateRandom API operation for AWS Key Management Service. +// GenerateDataKeyPairWithoutPlaintext API operation for AWS Key Management Service. // -// Returns a random byte string that is cryptographically secure. +// Generates a unique asymmetric data key pair. The GenerateDataKeyPairWithoutPlaintext +// operation returns a plaintext public key and a copy of the private key that +// is encrypted under the symmetric CMK you specify. Unlike GenerateDataKeyPair, +// this operation does not return a plaintext private key. // -// By default, the random byte string is generated in AWS KMS. To generate the -// byte string in the AWS CloudHSM cluster that is associated with a custom -// key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html), -// specify the custom key store ID. +// To generate a data key pair, you must specify a symmetric customer master +// key (CMK) to encrypt the private key in the data key pair. You cannot use +// an asymmetric CMK. To get the type of your CMK, use the KeySpec field in +// the DescribeKey response. // -// For more information about entropy and random number generation, see the -// AWS Key Management Service Cryptographic Details (https://d0.awsstatic.com/whitepapers/KMS-Cryptographic-Details.pdf) -// whitepaper. +// You can use the public key that GenerateDataKeyPairWithoutPlaintext returns +// to encrypt data or verify a signature outside of AWS KMS. Then, store the +// encrypted private key with the data. When you are ready to decrypt data or +// sign a message, you can use the Decrypt operation to decrypt the encrypted +// private key. +// +// GenerateDataKeyPairWithoutPlaintext returns a unique data key pair for each +// request. The bytes in the key are not related to the caller or CMK that is +// used to encrypt the private key. +// +// You can use the optional encryption context to add additional security to +// the encryption operation. If you specify an EncryptionContext, you must specify +// the same encryption context (a case-sensitive exact match) when decrypting +// the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException. +// For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) +// in the AWS Key Management Service Developer Guide. +// +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 GenerateRandom for usage and error information. +// API operation GenerateDataKeyPairWithoutPlaintext for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// The request was rejected because the specified entity or resource could not +// be found. // -// Returned Error Codes: -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DisabledException +// The request was rejected because the specified CMK is not enabled. +// +// * KeyUnavailableException +// The request was rejected because the specified CMK was not available. You +// can retry the request. +// +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInternalException "KMSInternalException" -// The request was rejected because an internal exception occurred. The request -// can be retried. +// * InvalidKeyUsageException +// The request was rejected for one of the following reasons: // -// * ErrCodeCustomKeyStoreNotFoundException "CustomKeyStoreNotFoundException" -// The request was rejected because AWS KMS cannot find a custom key store with -// the specified key store name or ID. +// * The KeyUsage value of the CMK is incompatible with the API operation. // -// * ErrCodeCustomKeyStoreInvalidStateException "CustomKeyStoreInvalidStateException" -// The request was rejected because of the ConnectionState of the custom key -// store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores -// operation. +// * The encryption algorithm or signing algorithm specified for the operation +// is incompatible with the type of key material in the CMK (CustomerMasterKeySpec). // -// This exception is thrown under the following conditions: +// For encrypting, decrypting, re-encrypting, and generating data keys, the +// KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage +// must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation. // -// * You requested the CreateKey or GenerateRandom operation in a custom -// key store that is not connected. These operations are valid only when -// the custom key store ConnectionState is CONNECTED. +// To find the encryption or signing algorithms supported for a particular CMK, +// use the DescribeKey operation. // -// * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation -// on a custom key store that is not disconnected. This operation is valid -// only when the custom key store ConnectionState is DISCONNECTED. +// * InvalidGrantTokenException +// The request was rejected because the specified grant token is not valid. // -// * You requested the ConnectCustomKeyStore operation on a custom key store -// with a ConnectionState of DISCONNECTING or FAILED. This operation is valid -// for all other ConnectionState values. +// * InternalException +// The request was rejected because an internal exception occurred. The request +// can be retried. // -// See also, 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) +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the AWS Key Management Service Developer Guide . +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GenerateDataKeyPairWithoutPlaintext +func (c *KMS) GenerateDataKeyPairWithoutPlaintext(input *GenerateDataKeyPairWithoutPlaintextInput) (*GenerateDataKeyPairWithoutPlaintextOutput, error) { + req, out := c.GenerateDataKeyPairWithoutPlaintextRequest(input) return out, req.Send() } -// GenerateRandomWithContext is the same as GenerateRandom with the addition of +// GenerateDataKeyPairWithoutPlaintextWithContext is the same as GenerateDataKeyPairWithoutPlaintext with the addition of // the ability to pass a context and additional request options. // -// See GenerateRandom for details on how to use this API operation. +// See GenerateDataKeyPairWithoutPlaintext for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *KMS) GenerateRandomWithContext(ctx aws.Context, input *GenerateRandomInput, opts ...request.Option) (*GenerateRandomOutput, error) { - req, out := c.GenerateRandomRequest(input) +func (c *KMS) GenerateDataKeyPairWithoutPlaintextWithContext(ctx aws.Context, input *GenerateDataKeyPairWithoutPlaintextInput, opts ...request.Option) (*GenerateDataKeyPairWithoutPlaintextOutput, error) { + req, out := c.GenerateDataKeyPairWithoutPlaintextRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetKeyPolicy = "GetKeyPolicy" +const opGenerateDataKeyWithoutPlaintext = "GenerateDataKeyWithoutPlaintext" -// GetKeyPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetKeyPolicy operation. The "output" return +// GenerateDataKeyWithoutPlaintextRequest generates a "aws/request.Request" representing the +// client's request for the GenerateDataKeyWithoutPlaintext operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetKeyPolicy for more information on using the GetKeyPolicy +// See GenerateDataKeyWithoutPlaintext for more information on using the GenerateDataKeyWithoutPlaintext // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetKeyPolicyRequest method. -// req, resp := client.GetKeyPolicyRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyPolicy -func (c *KMS) GetKeyPolicyRequest(input *GetKeyPolicyInput) (req *request.Request, output *GetKeyPolicyOutput) { +// See also, 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: opGetKeyPolicy, + Name: opGenerateDataKeyWithoutPlaintext, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetKeyPolicyInput{} + input = &GenerateDataKeyWithoutPlaintextInput{} } - output = &GetKeyPolicyOutput{} + output = &GenerateDataKeyWithoutPlaintextOutput{} req = c.newRequest(op, input, output) return } -// GetKeyPolicy API operation for AWS Key Management Service. +// GenerateDataKeyWithoutPlaintext API operation for AWS Key Management Service. // -// Gets a key policy attached to the specified customer master key (CMK). You -// cannot perform this operation on a CMK in a different AWS account. +// Generates a unique symmetric data key. This operation returns a data key +// that is encrypted under a customer master key (CMK) that you specify. To +// request an asymmetric data key pair, use the GenerateDataKeyPair or GenerateDataKeyPairWithoutPlaintext +// operations. +// +// GenerateDataKeyWithoutPlaintext is identical to the GenerateDataKey operation +// except that returns only the encrypted copy of the data key. This operation +// is useful for systems that need to encrypt data at some point, but not immediately. +// When you need to encrypt the data, you call the Decrypt operation on the +// encrypted copy of the key. +// +// It's also useful in distributed systems with different levels of trust. For +// example, you might store encrypted data in containers. One component of your +// system creates new containers and stores an encrypted data key with each +// container. Then, a different component puts the data into the containers. +// That component first decrypts the data key, uses the plaintext data key to +// encrypt data, puts the encrypted data into the container, and then destroys +// the plaintext data key. In this system, the component that creates the containers +// never sees the plaintext data key. +// +// GenerateDataKeyWithoutPlaintext returns a unique data key for each request. +// The bytes in the keys are not related to the caller or CMK that is used to +// encrypt the private key. +// +// To generate a data key, you must specify the symmetric customer master key +// (CMK) that is used to encrypt the data key. You cannot use an asymmetric +// CMK to generate a data key. To get the type of your CMK, use the DescribeKey +// operation. +// +// If the operation succeeds, you will find the encrypted copy of the data key +// in the CiphertextBlob field. +// +// You can use the optional encryption context to add additional security to +// the encryption operation. If you specify an EncryptionContext, you must specify +// the same encryption context (a case-sensitive exact match) when decrypting +// the encrypted data key. Otherwise, the request to decrypt fails with an InvalidCiphertextException. +// For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) +// in the AWS Key Management Service Developer Guide. +// +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 GetKeyPolicy for usage and error information. +// API operation GenerateDataKeyWithoutPlaintext for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * 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, or an ARN in a key policy, -// is not valid. +// * DisabledException +// The request was rejected because the specified CMK is not enabled. +// +// * KeyUnavailableException +// The request was rejected because the specified CMK was not available. You +// can retry the request. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInternalException "KMSInternalException" +// * InvalidKeyUsageException +// The request was rejected for one of the following reasons: +// +// * The KeyUsage value of the CMK is incompatible with the API operation. +// +// * The encryption algorithm or signing algorithm specified for the operation +// is incompatible with the type of key material in the CMK (CustomerMasterKeySpec). +// +// For encrypting, decrypting, re-encrypting, and generating data keys, the +// KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage +// must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation. +// +// To find the encryption or signing algorithms supported for a particular CMK, +// use the DescribeKey operation. +// +// * InvalidGrantTokenException +// The request was rejected because the specified grant token is not valid. +// +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . +// +// See also, 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) + return out, req.Send() +} + +// GenerateDataKeyWithoutPlaintextWithContext is the same as GenerateDataKeyWithoutPlaintext with the addition of +// the ability to pass a context and additional request options. +// +// See GenerateDataKeyWithoutPlaintext for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KMS) GenerateDataKeyWithoutPlaintextWithContext(ctx aws.Context, input *GenerateDataKeyWithoutPlaintextInput, opts ...request.Option) (*GenerateDataKeyWithoutPlaintextOutput, error) { + req, out := c.GenerateDataKeyWithoutPlaintextRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGenerateRandom = "GenerateRandom" + +// GenerateRandomRequest generates a "aws/request.Request" representing the +// client's request for the GenerateRandom operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GenerateRandom for more information on using the GenerateRandom +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GenerateRandomRequest method. +// req, resp := client.GenerateRandomRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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. +// +// Returns a random byte string that is cryptographically secure. +// +// By default, the random byte string is generated in AWS KMS. To generate the +// byte string in the AWS CloudHSM cluster that is associated with a custom +// key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html), +// specify the custom key store ID. +// +// For more information about entropy and random number generation, see the +// AWS Key Management Service Cryptographic Details (https://d0.awsstatic.com/whitepapers/KMS-Cryptographic-Details.pdf) +// whitepaper. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Types: +// * DependencyTimeoutException +// The system timed out while trying to fulfill the request. The request can +// be retried. +// +// * InternalException +// The request was rejected because an internal exception occurred. The request +// can be retried. +// +// * CustomKeyStoreNotFoundException +// The request was rejected because AWS KMS cannot find a custom key store with +// the specified key store name or ID. +// +// * CustomKeyStoreInvalidStateException +// The request was rejected because of the ConnectionState of the custom key +// store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores +// operation. +// +// This exception is thrown under the following conditions: +// +// * You requested the CreateKey or GenerateRandom operation in a custom +// key store that is not connected. These operations are valid only when +// the custom key store ConnectionState is CONNECTED. +// +// * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation +// on a custom key store that is not disconnected. This operation is valid +// only when the custom key store ConnectionState is DISCONNECTED. +// +// * You requested the ConnectCustomKeyStore operation on a custom key store +// with a ConnectionState of DISCONNECTING or FAILED. This operation is valid +// for all other ConnectionState values. +// +// See also, 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) + return out, req.Send() +} + +// GenerateRandomWithContext is the same as GenerateRandom with the addition of +// the ability to pass a context and additional request options. +// +// See GenerateRandom for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KMS) GenerateRandomWithContext(ctx aws.Context, input *GenerateRandomInput, opts ...request.Option) (*GenerateRandomOutput, error) { + req, out := c.GenerateRandomRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetKeyPolicy = "GetKeyPolicy" + +// GetKeyPolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetKeyPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetKeyPolicy for more information on using the GetKeyPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetKeyPolicyRequest method. +// req, resp := client.GetKeyPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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. +// +// Gets a key policy attached to the specified customer master key (CMK). You +// cannot perform this operation on a CMK in a different 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 Key Management Service's +// API operation GetKeyPolicy for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// The request was rejected because the specified entity or resource could not +// be found. +// +// * InvalidArnException +// The request was rejected because a specified ARN, or an ARN in a key policy, +// is not valid. +// +// * DependencyTimeoutException +// The system timed out while trying to fulfill the request. The request can +// be retried. +// +// * InternalException +// The request was rejected because an internal exception occurred. The request +// can be retried. +// +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetKeyPolicy func (c *KMS) GetKeyPolicy(input *GetKeyPolicyInput) (*GetKeyPolicyOutput, error) { @@ -2885,8 +3467,12 @@ func (c *KMS) GetKeyRotationStatusRequest(input *GetKeyRotationStatusInput) (req // material (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) // is enabled for the specified customer master key (CMK). // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// You cannot enable automatic rotation of asymmetric CMKs, CMKs with imported +// key material, or CMKs in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). +// The key rotation status for these CMKs is always false. +// +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) // in the AWS Key Management Service Developer Guide. // // * Disabled: The key rotation status does not change when you disable a @@ -2907,32 +3493,32 @@ func (c *KMS) GetKeyRotationStatusRequest(input *GetKeyRotationStatusInput) (req // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // @@ -3002,26 +3588,29 @@ func (c *KMS) GetParametersForImportRequest(input *GetParametersForImportInput) // 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 (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) +// Returns the items you need to import key material into a symmetric, customer +// managed customer master key (CMK). For more information about importing key +// material into AWS KMS, see Importing Key Material (https://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. You cannot perform this operation -// on a CMK in a different AWS account. -// // 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. When -// they expire, they cannot be used for a subsequent ImportKeyMaterial request. -// To get new ones, send another GetParametersForImport request. -// -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// to encrypt the symmetric key material. Store the import token to send with +// a subsequent ImportKeyMaterial request. +// +// You must specify the key ID of the symmetric 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. You cannot perform this operation on an asymmetric +// CMK or on any CMK in a different AWS account. +// +// To import key material, you must use the public key and import token from +// the same response. These items are valid for 24 hours. The expiration date +// and time appear in the GetParametersForImport response. You cannot use an +// expired token in an ImportKeyMaterial request. If your key and token expire, +// send another GetParametersForImport request. +// +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -3031,34 +3620,34 @@ func (c *KMS) GetParametersForImportRequest(input *GetParametersForImportInput) // 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" +// Returned Error Types: +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetParametersForImport func (c *KMS) GetParametersForImport(input *GetParametersForImportInput) (*GetParametersForImportOutput, error) { @@ -3082,89 +3671,90 @@ func (c *KMS) GetParametersForImportWithContext(ctx aws.Context, input *GetParam return out, req.Send() } -const opImportKeyMaterial = "ImportKeyMaterial" +const opGetPublicKey = "GetPublicKey" -// ImportKeyMaterialRequest generates a "aws/request.Request" representing the -// client's request for the ImportKeyMaterial operation. The "output" return +// GetPublicKeyRequest generates a "aws/request.Request" representing the +// client's request for the GetPublicKey operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ImportKeyMaterial for more information on using the ImportKeyMaterial +// See GetPublicKey for more information on using the GetPublicKey // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ImportKeyMaterialRequest method. -// req, resp := client.ImportKeyMaterialRequest(params) +// // Example sending a request using the GetPublicKeyRequest method. +// req, resp := client.GetPublicKeyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ImportKeyMaterial -func (c *KMS) ImportKeyMaterialRequest(input *ImportKeyMaterialInput) (req *request.Request, output *ImportKeyMaterialOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetPublicKey +func (c *KMS) GetPublicKeyRequest(input *GetPublicKeyInput) (req *request.Request, output *GetPublicKeyOutput) { op := &request.Operation{ - Name: opImportKeyMaterial, + Name: opGetPublicKey, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ImportKeyMaterialInput{} + input = &GetPublicKeyInput{} } - output = &ImportKeyMaterialOutput{} + output = &GetPublicKeyOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ImportKeyMaterial API operation for AWS Key Management Service. +// GetPublicKey API operation for AWS Key Management Service. // -// Imports key material into an existing AWS KMS customer master key (CMK) that -// was created without key material. You cannot perform this operation on a -// CMK in a different AWS account. For more information about creating CMKs -// with no key material and then importing key material, see Importing Key Material -// (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) +// Returns the public key of an asymmetric CMK. Unlike the private key of a +// asymmetric CMK, which never leaves AWS KMS unencrypted, callers with kms:GetPublicKey +// permission can download the public key of an asymmetric CMK. You can share +// the public key to allow others to encrypt messages and verify signatures +// outside of AWS KMS. For information about symmetric and asymmetric CMKs, +// see Using Symmetric and Asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) // in the AWS Key Management Service Developer Guide. // -// Before using this operation, call GetParametersForImport. Its response includes -// a public key and an import token. Use the public key to encrypt the key material. -// Then, submit the import token from the same GetParametersForImport response. -// -// When calling this operation, you must specify the following values: +// You do not need to download the public key. Instead, you can use the public +// key within AWS KMS by calling the Encrypt, ReEncrypt, or Verify operations +// with the identifier of an asymmetric CMK. When you use the public key within +// AWS KMS, you benefit from the authentication, authorization, and logging +// that are part of every AWS KMS operation. You also reduce of risk of encrypting +// data that cannot be decrypted. These features are not effective outside of +// AWS KMS. For details, see Special Considerations for Downloading Public Keys +// (https://docs.aws.amazon.com/kms/latest/developerguide/download-public-key.html#download-public-key-considerations). // -// * The key ID or key ARN of a CMK with no key material. Its Origin must -// be EXTERNAL. To create a CMK with no key material, call CreateKey and -// set the value of its Origin parameter to EXTERNAL. To get the Origin of -// a CMK, call DescribeKey.) +// To help you use the public key safely outside of AWS KMS, GetPublicKey returns +// important information about the public key in the response, including: // -// * The encrypted key material. To get the public key to encrypt the key -// material, call GetParametersForImport. +// * CustomerMasterKeySpec (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-CustomerMasterKeySpec): +// The type of key material in the public key, such as RSA_4096 or ECC_NIST_P521. // -// * The import token that GetParametersForImport returned. This token and -// the public key used to encrypt the key material must have come from the -// same response. +// * KeyUsage (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-KeyUsage): +// Whether the key is used for encryption or signing. // -// * Whether the key material expires and if so, when. If you set an expiration -// date, you can change it only by reimporting the same key material and -// specifying a new expiration date. If the key material expires, AWS KMS -// deletes the key material and the CMK becomes unusable. To use the CMK -// again, you must reimport the same key material. +// * EncryptionAlgorithms (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-EncryptionAlgorithms) +// or SigningAlgorithms (https://docs.aws.amazon.com/kms/latest/APIReference/API_GetPublicKey.html#KMS-GetPublicKey-response-SigningAlgorithms): +// A list of the encryption algorithms or the signing algorithms for the +// key. // -// When this operation is successful, the key state of the CMK changes from -// PendingImport 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. +// Although AWS KMS cannot enforce these restrictions on external operations, +// it is crucial that you use this information to prevent the public key from +// being used improperly. For example, you can prevent a public signing key +// from being used encrypt data, or prevent a public key from being used with +// an encryption algorithm that is not supported by AWS KMS. You can also avoid +// errors, such as using the wrong signing algorithm in a verification operation. // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -3172,53 +3762,232 @@ func (c *KMS) ImportKeyMaterialRequest(input *ImportKeyMaterialInput) (req *requ // the error. // // See the AWS API reference guide for AWS Key Management Service's -// API operation ImportKeyMaterial for usage and error information. +// API operation GetPublicKey for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArnException "InvalidArnException" -// The request was rejected because a specified ARN, or an ARN in a key policy, -// is not valid. +// Returned Error Types: +// * NotFoundException +// The request was rejected because the specified entity or resource could not +// be found. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" -// The request was rejected because a specified parameter is not supported or -// a specified resource is not valid for this operation. +// * DisabledException +// The request was rejected because the specified CMK is not enabled. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * KeyUnavailableException +// The request was rejected because the specified CMK was not available. You +// can retry the request. +// +// * 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 "KMSInternalException" +// * UnsupportedOperationException +// The request was rejected because a specified parameter is not supported or +// a specified resource is not valid for this operation. +// +// * InvalidArnException +// The request was rejected because a specified ARN, or an ARN in a key policy, +// is not valid. +// +// * InvalidGrantTokenException +// The request was rejected because the specified grant token is not valid. +// +// * InvalidKeyUsageException +// The request was rejected for one of the following reasons: +// +// * The KeyUsage value of the CMK is incompatible with the API operation. +// +// * The encryption algorithm or signing algorithm specified for the operation +// is incompatible with the type of key material in the CMK (CustomerMasterKeySpec). +// +// For encrypting, decrypting, re-encrypting, and generating data keys, the +// KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage +// must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation. +// +// To find the encryption or signing algorithms supported for a particular CMK, +// use the DescribeKey operation. +// +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/GetPublicKey +func (c *KMS) GetPublicKey(input *GetPublicKeyInput) (*GetPublicKeyOutput, error) { + req, out := c.GetPublicKeyRequest(input) + return out, req.Send() +} + +// GetPublicKeyWithContext is the same as GetPublicKey with the addition of +// the ability to pass a context and additional request options. +// +// See GetPublicKey for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KMS) GetPublicKeyWithContext(ctx aws.Context, input *GetPublicKeyInput, opts ...request.Option) (*GetPublicKeyOutput, error) { + req, out := c.GetPublicKeyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opImportKeyMaterial = "ImportKeyMaterial" + +// ImportKeyMaterialRequest generates a "aws/request.Request" representing the +// client's request for the ImportKeyMaterial operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ImportKeyMaterial for more information on using the ImportKeyMaterial +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ImportKeyMaterialRequest method. +// req, resp := client.ImportKeyMaterialRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// ImportKeyMaterial API operation for AWS Key Management Service. +// +// Imports key material into an existing symmetric AWS KMS customer master key +// (CMK) that was created without key material. After you successfully import +// key material into a CMK, you can reimport the same key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#reimport-key-material) +// into that CMK, but you cannot import different key material. +// +// You cannot perform this operation on an asymmetric CMK or on any CMK in a +// different AWS account. For more information about creating CMKs with no key +// material and then importing key material, see Importing Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) +// in the AWS Key Management Service Developer Guide. +// +// Before using this operation, call GetParametersForImport. Its response includes +// a public key and an import token. Use the public key to encrypt the key material. +// Then, submit the import token from the same GetParametersForImport response. +// +// When calling this operation, you must specify the following values: +// +// * The key ID or key ARN of a CMK with no key material. Its Origin must +// be EXTERNAL. To create a CMK with no key material, call CreateKey and +// set the value of its Origin parameter to EXTERNAL. To get the Origin of +// a CMK, call DescribeKey.) +// +// * The encrypted key material. To get the public key to encrypt the key +// material, call GetParametersForImport. +// +// * The import token that GetParametersForImport returned. You must use +// a public key and token from the same GetParametersForImport response. +// +// * Whether the key material expires and if so, when. If you set an expiration +// date, AWS KMS deletes the key material from the CMK on the specified date, +// and the CMK becomes unusable. To use the CMK again, you must reimport +// the same key material. The only way to change an expiration date is by +// reimporting the same key material and specifying a new expiration date. +// +// When this operation is successful, the key state of the CMK changes from +// PendingImport to Enabled, and you can use the CMK. +// +// If this operation fails, use the exception to help determine the problem. +// If the error is related to the key material, the import token, or wrapping +// key, use GetParametersForImport to get a new public key and import token +// for the CMK and repeat the import procedure. For help, see How To Import +// Key Material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html#importing-keys-overview) +// in the AWS Key Management Service Developer Guide. +// +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 ImportKeyMaterial for usage and error information. +// +// Returned Error Types: +// * InvalidArnException +// The request was rejected because a specified ARN, or an ARN in a key policy, +// is not valid. +// +// * UnsupportedOperationException +// The request was rejected because a specified parameter is not supported or +// a specified resource is not valid for this operation. +// +// * DependencyTimeoutException +// The system timed out while trying to fulfill the request. The request can +// be retried. +// +// * NotFoundException +// The request was rejected because the specified entity or resource could not +// be found. +// +// * InternalException +// The request was rejected because an internal exception occurred. The request +// can be retried. +// +// * 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 (https://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, or additional -// authenticated data incorporated into the ciphertext, such as the encryption -// context, is corrupted, missing, or otherwise invalid. +// * InvalidCiphertextException +// From the Decrypt or ReEncrypt operation, the request was rejected because +// the specified ciphertext, or additional authenticated data incorporated into +// the ciphertext, such as the encryption context, is corrupted, missing, or +// 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). +// From the ImportKeyMaterial operation, the request was rejected because AWS +// KMS could not decrypt the encrypted (wrapped) key material. // -// * ErrCodeExpiredImportTokenException "ExpiredImportTokenException" -// The request was rejected because the provided import token is expired. Use +// * IncorrectKeyMaterialException +// The request was rejected because the key material in the request is, expired, +// invalid, or is not the same key material that was previously imported into +// this customer master key (CMK). +// +// * ExpiredImportTokenException +// The request was rejected because the specified import token is expired. Use // GetParametersForImport to get 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" +// * InvalidImportTokenException // The request was rejected because the provided import token is invalid or // is associated with a different customer master key (CMK). // @@ -3309,7 +4078,7 @@ func (c *KMS) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, // The response might also include aliases that have no TargetKeyId field. These // are predefined aliases that AWS has created but has not yet associated with // a CMK. Aliases that AWS creates in your account, including predefined aliases, -// do not count against your AWS KMS aliases limit (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html#aliases-limit). +// do not count against your AWS KMS aliases quota (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html#aliases-limit). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3318,24 +4087,24 @@ func (c *KMS) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, // 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" +// Returned Error Types: +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInvalidMarkerException "InvalidMarkerException" +// * InvalidMarkerException // The request was rejected because the marker that specifies where pagination // should next begin is not valid. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // @@ -3404,10 +4173,12 @@ func (c *KMS) ListAliasesPagesWithContext(ctx aws.Context, input *ListAliasesInp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAliasesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAliasesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3473,34 +4244,34 @@ func (c *KMS) ListGrantsRequest(input *ListGrantsInput) (req *request.Request, o // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInvalidMarkerException "InvalidMarkerException" +// * InvalidMarkerException // The request was rejected because the marker that specifies where pagination // should next begin is not valid. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListGrants func (c *KMS) ListGrants(input *ListGrantsInput) (*ListGrantsResponse, error) { @@ -3567,10 +4338,12 @@ func (c *KMS) ListGrantsPagesWithContext(ctx aws.Context, input *ListGrantsInput }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGrantsResponse), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListGrantsResponse), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3636,30 +4409,30 @@ func (c *KMS) ListKeyPoliciesRequest(input *ListKeyPoliciesInput) (req *request. // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ListKeyPolicies func (c *KMS) ListKeyPolicies(input *ListKeyPoliciesInput) (*ListKeyPoliciesOutput, error) { @@ -3726,10 +4499,12 @@ func (c *KMS) ListKeyPoliciesPagesWithContext(ctx aws.Context, input *ListKeyPol }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListKeyPoliciesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListKeyPoliciesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3784,7 +4559,7 @@ func (c *KMS) ListKeysRequest(input *ListKeysInput) (req *request.Request, outpu // ListKeys API operation for AWS Key Management Service. // // Gets a list of all customer master keys (CMKs) in the caller's AWS account -// and region. +// and 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 @@ -3793,16 +4568,16 @@ func (c *KMS) ListKeysRequest(input *ListKeysInput) (req *request.Request, outpu // 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" +// Returned Error Types: +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidMarkerException "InvalidMarkerException" +// * InvalidMarkerException // The request was rejected because the marker that specifies where pagination // should next begin is not valid. // @@ -3871,10 +4646,12 @@ func (c *KMS) ListKeysPagesWithContext(ctx aws.Context, input *ListKeysInput, fn }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListKeysOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListKeysOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3933,20 +4710,20 @@ func (c *KMS) ListResourceTagsRequest(input *ListResourceTagsInput) (req *reques // See the AWS API reference guide for AWS Key Management Service's // API operation ListResourceTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "KMSInternalException" +// Returned Error Types: +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeInvalidMarkerException "InvalidMarkerException" +// * InvalidMarkerException // The request was rejected because the marker that specifies where pagination // should next begin is not valid. // @@ -4029,24 +4806,24 @@ func (c *KMS) ListRetirableGrantsRequest(input *ListRetirableGrantsInput) (req * // 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" +// Returned Error Types: +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInvalidMarkerException "InvalidMarkerException" +// * InvalidMarkerException // The request was rejected because the marker that specifies where pagination // should next begin is not valid. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // @@ -4130,43 +4907,43 @@ func (c *KMS) PutKeyPolicyRequest(input *PutKeyPolicyInput) (req *request.Reques // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocumentException" +// * MalformedPolicyDocumentException // The request was rejected because the specified policy is not syntactically // or semantically correct. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeUnsupportedOperationException "UnsupportedOperationException" +// * UnsupportedOperationException // The request was rejected because a specified parameter is not supported or // a specified resource is not valid for this operation. // -// * ErrCodeInternalException "KMSInternalException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) +// * LimitExceededException +// The request was rejected because a quota was exceeded. For more information, +// see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) // in the AWS Key Management Service Developer Guide. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/PutKeyPolicy func (c *KMS) PutKeyPolicy(input *PutKeyPolicyInput) (*PutKeyPolicyOutput, error) { @@ -4234,23 +5011,66 @@ func (c *KMS) ReEncryptRequest(input *ReEncryptInput) (req *request.Request, out // 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. -// -// You can reencrypt data using CMKs in different AWS accounts. -// -// 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 (https://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. -// -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// Decrypts ciphertext and then reencrypts it entirely within AWS KMS. You can +// use this operation to change the customer master key (CMK) under which data +// is encrypted, such as when you manually rotate (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html#rotate-keys-manually) +// a CMK or change the CMK that protects a ciphertext. You can also use it to +// reencrypt ciphertext under the same CMK, such as to change the encryption +// context of a ciphertext. +// +// The ReEncrypt operation can decrypt ciphertext that was encrypted by using +// an AWS KMS CMK in an AWS KMS operation, such as Encrypt or GenerateDataKey. +// It can also decrypt ciphertext that was encrypted by using the public key +// of an asymmetric CMK outside of AWS KMS. However, it cannot decrypt ciphertext +// produced by other libraries, such as the AWS Encryption SDK (https://docs.aws.amazon.com/encryption-sdk/latest/developer-guide/) +// or Amazon S3 client-side encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html). +// These libraries return a ciphertext format that is incompatible with AWS +// KMS. +// +// When you use the ReEncrypt operation, you need to provide information for +// the decrypt operation and the subsequent encrypt operation. +// +// * If your ciphertext was encrypted under an asymmetric CMK, you must identify +// the source CMK, that is, the CMK that encrypted the ciphertext. You must +// also supply the encryption algorithm that was used. This information is +// required to decrypt the data. +// +// * It is optional, but you can specify a source CMK even when the ciphertext +// was encrypted under a symmetric CMK. This ensures that the ciphertext +// is decrypted only by using a particular CMK. If the CMK that you specify +// cannot decrypt the ciphertext, the ReEncrypt operation fails. +// +// * To reencrypt the data, you must specify the destination CMK, that is, +// the CMK that re-encrypts the data after it is decrypted. You can select +// a symmetric or asymmetric CMK. If the destination CMK is an asymmetric +// CMK, you must also provide the encryption algorithm. The algorithm that +// you choose must be compatible with the CMK. When you use an asymmetric +// CMK to encrypt or reencrypt data, be sure to record the CMK and encryption +// algorithm that you choose. You will be required to provide the same CMK +// and encryption algorithm when you decrypt the data. If the CMK and algorithm +// do not match the values used to encrypt the data, the decrypt operation +// fails. You are not required to supply the CMK ID and encryption algorithm +// when you decrypt with symmetric CMKs because AWS KMS stores this information +// in the ciphertext blob. AWS KMS cannot store metadata in ciphertext generated +// with asymmetric keys. The standard format for asymmetric key ciphertext +// does not include configurable fields. +// +// Unlike other AWS KMS API operations, ReEncrypt callers must have two permissions: +// +// * kms:EncryptFrom permission on the source CMK +// +// * kms:EncryptTo permission on the destination CMK +// +// To permit reencryption from +// +// or to a CMK, include the "kms:ReEncrypt*" permission in your key policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html). +// This permission is automatically included in the key policy when you use +// the console to create a CMK. But you must include it manually when you create +// a CMK programmatically or when you use the PutKeyPolicy operation set a key +// policy. +// +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -4260,44 +5080,65 @@ func (c *KMS) ReEncryptRequest(input *ReEncryptInput) (req *request.Request, out // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeDisabledException "DisabledException" +// * DisabledException // The request was rejected because the specified CMK is not enabled. // -// * ErrCodeInvalidCiphertextException "InvalidCiphertextException" -// The request was rejected because the specified ciphertext, or additional -// authenticated data incorporated into the ciphertext, such as the encryption -// context, is corrupted, missing, or otherwise invalid. +// * InvalidCiphertextException +// From the Decrypt or ReEncrypt operation, the request was rejected because +// the specified ciphertext, or additional authenticated data incorporated into +// the ciphertext, such as the encryption context, is corrupted, missing, or +// otherwise invalid. +// +// From the ImportKeyMaterial operation, the request was rejected because AWS +// KMS could not decrypt the encrypted (wrapped) key material. // -// * ErrCodeKeyUnavailableException "KeyUnavailableException" -// The request was rejected because the specified CMK was not available. The -// request can be retried. +// * KeyUnavailableException +// The request was rejected because the specified CMK was not available. You +// can retry the request. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * IncorrectKeyException +// The request was rejected because the specified CMK cannot decrypt the data. +// The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request +// must identify the same CMK that was used to encrypt the ciphertext. +// +// * 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. +// * InvalidKeyUsageException +// The request was rejected for one of the following reasons: +// +// * The KeyUsage value of the CMK is incompatible with the API operation. +// +// * The encryption algorithm or signing algorithm specified for the operation +// is incompatible with the type of key material in the CMK (CustomerMasterKeySpec). +// +// For encrypting, decrypting, re-encrypting, and generating data keys, the +// KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage +// must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation. // -// * ErrCodeInvalidGrantTokenException "InvalidGrantTokenException" +// To find the encryption or signing algorithms supported for a particular CMK, +// use the DescribeKey operation. +// +// * InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ReEncrypt func (c *KMS) ReEncrypt(input *ReEncryptInput) (*ReEncryptOutput, error) { @@ -4390,36 +5231,36 @@ func (c *KMS) RetireGrantRequest(input *RetireGrantInput) (req *request.Request, // See the AWS API reference guide for AWS Key Management Service's // API operation RetireGrant for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArnException "InvalidArnException" +// Returned Error Types: +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeInvalidGrantTokenException "InvalidGrantTokenException" +// * InvalidGrantTokenException // The request was rejected because the specified grant token is not valid. // -// * ErrCodeInvalidGrantIdException "InvalidGrantIdException" +// * InvalidGrantIdException // The request was rejected because the specified GrantId is not valid. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RetireGrant func (c *KMS) RetireGrant(input *RetireGrantInput) (*RetireGrantOutput, error) { @@ -4501,33 +5342,33 @@ func (c *KMS) RevokeGrantRequest(input *RevokeGrantInput) (req *request.Request, // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeInvalidGrantIdException "InvalidGrantIdException" +// * InvalidGrantIdException // The request was rejected because the specified GrantId is not valid. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/RevokeGrant func (c *KMS) RevokeGrant(input *RevokeGrantInput) (*RevokeGrantOutput, error) { @@ -4621,8 +5462,8 @@ func (c *KMS) ScheduleKeyDeletionRequest(input *ScheduleKeyDeletionInput) (req * // Master Keys (https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) // in the AWS Key Management Service Developer Guide. // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -4632,30 +5473,30 @@ func (c *KMS) ScheduleKeyDeletionRequest(input *ScheduleKeyDeletionInput) (req * // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/ScheduleKeyDeletion func (c *KMS) ScheduleKeyDeletion(input *ScheduleKeyDeletionInput) (*ScheduleKeyDeletionOutput, error) { @@ -4679,6 +5520,164 @@ func (c *KMS) ScheduleKeyDeletionWithContext(ctx aws.Context, input *ScheduleKey return out, req.Send() } +const opSign = "Sign" + +// SignRequest generates a "aws/request.Request" representing the +// client's request for the Sign operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See Sign for more information on using the Sign +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SignRequest method. +// req, resp := client.SignRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Sign +func (c *KMS) SignRequest(input *SignInput) (req *request.Request, output *SignOutput) { + op := &request.Operation{ + Name: opSign, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &SignInput{} + } + + output = &SignOutput{} + req = c.newRequest(op, input, output) + return +} + +// Sign API operation for AWS Key Management Service. +// +// Creates a digital signature (https://en.wikipedia.org/wiki/Digital_signature) +// for a message or message digest by using the private key in an asymmetric +// CMK. To verify the signature, use the Verify operation, or use the public +// key in the same asymmetric CMK outside of AWS KMS. For information about +// symmetric and asymmetric CMKs, see Using Symmetric and Asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the AWS Key Management Service Developer Guide. +// +// Digital signatures are generated and verified by using asymmetric key pair, +// such as an RSA or ECC pair that is represented by an asymmetric customer +// master key (CMK). The key owner (or an authorized user) uses their private +// key to sign a message. Anyone with the public key can verify that the message +// was signed with that particular private key and that the message hasn't changed +// since it was signed. +// +// To use the Sign operation, provide the following information: +// +// * Use the KeyId parameter to identify an asymmetric CMK with a KeyUsage +// value of SIGN_VERIFY. To get the KeyUsage value of a CMK, use the DescribeKey +// operation. The caller must have kms:Sign permission on the CMK. +// +// * Use the Message parameter to specify the message or message digest to +// sign. You can submit messages of up to 4096 bytes. To sign a larger message, +// generate a hash digest of the message, and then provide the hash digest +// in the Message parameter. To indicate whether the message is a full message +// or a digest, use the MessageType parameter. +// +// * Choose a signing algorithm that is compatible with the CMK. +// +// When signing a message, be sure to record the CMK and the signing algorithm. +// This information is required to verify the signature. +// +// To verify the signature that this operation generates, use the Verify operation. +// Or use the GetPublicKey operation to download the public key and then use +// the public key to verify the signature outside of AWS KMS. +// +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 Sign for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// The request was rejected because the specified entity or resource could not +// be found. +// +// * DisabledException +// The request was rejected because the specified CMK is not enabled. +// +// * KeyUnavailableException +// The request was rejected because the specified CMK was not available. You +// can retry the request. +// +// * DependencyTimeoutException +// The system timed out while trying to fulfill the request. The request can +// be retried. +// +// * InvalidKeyUsageException +// The request was rejected for one of the following reasons: +// +// * The KeyUsage value of the CMK is incompatible with the API operation. +// +// * The encryption algorithm or signing algorithm specified for the operation +// is incompatible with the type of key material in the CMK (CustomerMasterKeySpec). +// +// For encrypting, decrypting, re-encrypting, and generating data keys, the +// KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage +// must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation. +// +// To find the encryption or signing algorithms supported for a particular CMK, +// use the DescribeKey operation. +// +// * InvalidGrantTokenException +// The request was rejected because the specified grant token is not valid. +// +// * InternalException +// The request was rejected because an internal exception occurred. The request +// can be retried. +// +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the AWS Key Management Service Developer Guide . +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Sign +func (c *KMS) Sign(input *SignInput) (*SignOutput, error) { + req, out := c.SignRequest(input) + return out, req.Send() +} + +// SignWithContext is the same as Sign with the addition of +// the ability to pass a context and additional request options. +// +// See Sign for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KMS) SignWithContext(ctx aws.Context, input *SignInput, opts ...request.Option) (*SignOutput, error) { + req, out := c.SignRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opTagResource = "TagResource" // TagResourceRequest generates a "aws/request.Request" representing the @@ -4737,8 +5736,8 @@ func (c *KMS) TagResourceRequest(input *TagResourceInput) (req *request.Request, // User-Defined Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html) // in the AWS Billing and Cost Management User Guide. // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -4748,33 +5747,33 @@ func (c *KMS) TagResourceRequest(input *TagResourceInput) (req *request.Request, // See the AWS API reference guide for AWS Key Management Service's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "KMSInternalException" +// Returned Error Types: +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // -// * ErrCodeLimitExceededException "LimitExceededException" -// The request was rejected because a limit was exceeded. For more information, -// see Limits (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) +// * LimitExceededException +// The request was rejected because a quota was exceeded. For more information, +// see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) // in the AWS Key Management Service Developer Guide. // -// * ErrCodeTagException "TagException" +// * TagException // The request was rejected because one or more tags are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/TagResource @@ -4850,8 +5849,8 @@ func (c *KMS) UntagResourceRequest(input *UntagResourceInput) (req *request.Requ // To remove a tag, specify the tag key. To change the tag value of an existing // tag key, use TagResource. // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -4861,28 +5860,28 @@ func (c *KMS) UntagResourceRequest(input *UntagResourceInput) (req *request.Requ // See the AWS API reference guide for AWS Key Management Service's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "KMSInternalException" +// Returned Error Types: +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // -// * ErrCodeTagException "TagException" +// * TagException // The request was rejected because one or more tags are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UntagResource @@ -4952,27 +5951,28 @@ func (c *KMS) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, // UpdateAlias API operation for AWS Key Management Service. // -// Associates an existing alias with a different customer master key (CMK). -// Each CMK can have multiple aliases, but the aliases must be unique within -// the account and region. You cannot perform this operation on an alias in -// a different AWS account. +// Associates an existing AWS KMS alias with a different customer master key +// (CMK). Each alias is associated with only one CMK at a time, although a CMK +// can have multiple aliases. The alias and the CMK must be in the same AWS +// account and region. You cannot perform this operation on an alias in a different +// AWS account. +// +// The current and new CMK must be the same type (both symmetric or both asymmetric), +// and they must have the same key usage (ENCRYPT_DECRYPT or SIGN_VERIFY). This +// restriction prevents errors in code that uses aliases. If you must assign +// an alias to a different type of CMK, use DeleteAlias to delete the old alias +// and CreateAlias to create a new alias. // -// This operation works only on existing aliases. To change the alias of a CMK -// to a new value, use CreateAlias to create a new alias and DeleteAlias to -// delete the old alias. +// You cannot use UpdateAlias to change an alias name. To change an alias name, +// use DeleteAlias to delete the old alias and CreateAlias to create a new alias. // // Because an alias is not a property of a CMK, you can create, update, and // delete the aliases of a CMK without affecting the CMK. Also, aliases do not // appear in the response from the DescribeKey operation. To get the aliases // of all CMKs in the account, use the ListAliases operation. // -// The alias name must begin with alias/ followed by a name, such as alias/ExampleAlias. -// It can contain only alphanumeric characters, forward slashes (/), underscores -// (_), and dashes (-). The alias name cannot begin with alias/aws/. The alias/aws/ -// prefix is reserved for AWS managed CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). -// -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -4982,26 +5982,26 @@ func (c *KMS) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Request, // 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" +// Returned Error Types: +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateAlias func (c *KMS) UpdateAlias(input *UpdateAliasInput) (*UpdateAliasOutput, error) { @@ -5112,17 +6112,22 @@ func (c *KMS) UpdateCustomKeyStoreRequest(input *UpdateCustomKeyStoreInput) (req // See the AWS API reference guide for AWS Key Management Service's // API operation UpdateCustomKeyStore for usage and error information. // -// Returned Error Codes: -// * ErrCodeCustomKeyStoreNotFoundException "CustomKeyStoreNotFoundException" +// Returned Error Types: +// * CustomKeyStoreNotFoundException // The request was rejected because AWS KMS cannot find a custom key store with // the specified key store name or ID. // -// * ErrCodeCloudHsmClusterNotFoundException "CloudHsmClusterNotFoundException" +// * CustomKeyStoreNameInUseException +// The request was rejected because the specified custom key store name is already +// assigned to another custom key store in the account. Try again with a custom +// key store name that is unique in the account. +// +// * CloudHsmClusterNotFoundException // The request was rejected because AWS KMS cannot find the AWS CloudHSM cluster // with the specified cluster ID. Retry the request with a different cluster // ID. // -// * ErrCodeCloudHsmClusterNotRelatedException "CloudHsmClusterNotRelatedException" +// * CloudHsmClusterNotRelatedException // The request was rejected because the specified AWS CloudHSM cluster has a // different cluster certificate than the original cluster. You cannot use the // operation to specify an unrelated cluster. @@ -5136,7 +6141,7 @@ func (c *KMS) UpdateCustomKeyStoreRequest(input *UpdateCustomKeyStoreInput) (req // view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) // operation. // -// * ErrCodeCustomKeyStoreInvalidStateException "CustomKeyStoreInvalidStateException" +// * CustomKeyStoreInvalidStateException // The request was rejected because of the ConnectionState of the custom key // store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores // operation. @@ -5155,18 +6160,18 @@ func (c *KMS) UpdateCustomKeyStoreRequest(input *UpdateCustomKeyStoreInput) (req // with a ConnectionState of DISCONNECTING or FAILED. This operation is valid // for all other ConnectionState values. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeCloudHsmClusterNotActiveException "CloudHsmClusterNotActiveException" +// * CloudHsmClusterNotActiveException // The request was rejected because the AWS CloudHSM cluster that is associated // with the custom key store is not active. Initialize and activate the cluster // and try the command again. For detailed instructions, see Getting Started // (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html) // in the AWS CloudHSM User Guide. // -// * ErrCodeCloudHsmClusterInvalidConfigurationException "CloudHsmClusterInvalidConfigurationException" +// * CloudHsmClusterInvalidConfigurationException // The request was rejected because the associated AWS CloudHSM cluster did // not meet the configuration requirements for a custom key store. // @@ -5270,8 +6275,8 @@ func (c *KMS) UpdateKeyDescriptionRequest(input *UpdateKeyDescriptionInput) (req // // You cannot perform this operation on a CMK in a different AWS account. // -// The result of this operation varies with the key state of the CMK. For details, -// see How Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 @@ -5281,30 +6286,30 @@ func (c *KMS) UpdateKeyDescriptionRequest(input *UpdateKeyDescriptionInput) (req // 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" +// Returned Error Types: +// * NotFoundException // The request was rejected because the specified entity or resource could not // be found. // -// * ErrCodeInvalidArnException "InvalidArnException" +// * InvalidArnException // The request was rejected because a specified ARN, or an ARN in a key policy, // is not valid. // -// * ErrCodeDependencyTimeoutException "DependencyTimeoutException" +// * DependencyTimeoutException // The system timed out while trying to fulfill the request. The request can // be retried. // -// * ErrCodeInternalException "KMSInternalException" +// * InternalException // The request was rejected because an internal exception occurred. The request // can be retried. // -// * ErrCodeInvalidStateException "KMSInvalidStateException" +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide . // // See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/UpdateKeyDescription func (c *KMS) UpdateKeyDescription(input *UpdateKeyDescriptionInput) (*UpdateKeyDescriptionOutput, error) { @@ -5328,9 +6333,164 @@ func (c *KMS) UpdateKeyDescriptionWithContext(ctx aws.Context, input *UpdateKeyD return out, req.Send() } -// Contains information about an alias. -type AliasListEntry struct { - _ struct{} `type:"structure"` +const opVerify = "Verify" + +// VerifyRequest generates a "aws/request.Request" representing the +// client's request for the Verify operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See Verify for more information on using the Verify +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the VerifyRequest method. +// req, resp := client.VerifyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Verify +func (c *KMS) VerifyRequest(input *VerifyInput) (req *request.Request, output *VerifyOutput) { + op := &request.Operation{ + Name: opVerify, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &VerifyInput{} + } + + output = &VerifyOutput{} + req = c.newRequest(op, input, output) + return +} + +// Verify API operation for AWS Key Management Service. +// +// Verifies a digital signature that was generated by the Sign operation. +// +// Verification confirms that an authorized user signed the message with the +// specified CMK and signing algorithm, and the message hasn't changed since +// it was signed. If the signature is verified, the value of the SignatureValid +// field in the response is True. If the signature verification fails, the Verify +// operation fails with an KMSInvalidSignatureException exception. +// +// A digital signature is generated by using the private key in an asymmetric +// CMK. The signature is verified by using the public key in the same asymmetric +// CMK. For information about symmetric and asymmetric CMKs, see Using Symmetric +// and Asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the AWS Key Management Service Developer Guide. +// +// To verify a digital signature, you can use the Verify operation. Specify +// the same asymmetric CMK, message, and signing algorithm that were used to +// produce the signature. +// +// You can also verify the digital signature by using the public key of the +// CMK outside of AWS KMS. Use the GetPublicKey operation to download the public +// key in the asymmetric CMK and then use the public key to verify the signature +// outside of AWS KMS. The advantage of using the Verify operation is that it +// is performed within AWS KMS. As a result, it's easy to call, the operation +// is performed within the FIPS boundary, it is logged in AWS CloudTrail, and +// you can use key policy and IAM policy to determine who is authorized to use +// the CMK to verify signatures. +// +// The CMK that you use for this operation must be in a compatible key state. +// For details, see How Key State Affects Use of a Customer Master Key (https://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 Verify for usage and error information. +// +// Returned Error Types: +// * NotFoundException +// The request was rejected because the specified entity or resource could not +// be found. +// +// * DisabledException +// The request was rejected because the specified CMK is not enabled. +// +// * KeyUnavailableException +// The request was rejected because the specified CMK was not available. You +// can retry the request. +// +// * DependencyTimeoutException +// The system timed out while trying to fulfill the request. The request can +// be retried. +// +// * InvalidKeyUsageException +// The request was rejected for one of the following reasons: +// +// * The KeyUsage value of the CMK is incompatible with the API operation. +// +// * The encryption algorithm or signing algorithm specified for the operation +// is incompatible with the type of key material in the CMK (CustomerMasterKeySpec). +// +// For encrypting, decrypting, re-encrypting, and generating data keys, the +// KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage +// must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation. +// +// To find the encryption or signing algorithms supported for a particular CMK, +// use the DescribeKey operation. +// +// * InvalidGrantTokenException +// The request was rejected because the specified grant token is not valid. +// +// * InternalException +// The request was rejected because an internal exception occurred. The request +// can be retried. +// +// * 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the AWS Key Management Service Developer Guide . +// +// * KMSInvalidSignatureException +// The request was rejected because the signature verification failed. Signature +// verification fails when it cannot confirm that signature was produced by +// signing the specified message with the specified CMK and signing algorithm. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/kms-2014-11-01/Verify +func (c *KMS) Verify(input *VerifyInput) (*VerifyOutput, error) { + req, out := c.VerifyRequest(input) + return out, req.Send() +} + +// VerifyWithContext is the same as Verify with the addition of +// the ability to pass a context and additional request options. +// +// See Verify for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *KMS) VerifyWithContext(ctx aws.Context, input *VerifyInput, opts ...request.Option) (*VerifyOutput, error) { + req, out := c.VerifyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Contains information about an alias. +type AliasListEntry struct { + _ struct{} `type:"structure"` // String that contains the key ARN. AliasArn *string `min:"20" type:"string"` @@ -5370,6 +6530,63 @@ func (s *AliasListEntry) SetTargetKeyId(v string) *AliasListEntry { return s } +// The request was rejected because it attempted to create a resource that already +// exists. +type AlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorAlreadyExistsException(v protocol.ResponseMetadata) error { + return &AlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AlreadyExistsException) Code() string { + return "AlreadyExistsException" +} + +// Message returns the exception's message. +func (s AlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AlreadyExistsException) OrigErr() error { + return nil +} + +func (s AlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + type CancelKeyDeletionInput struct { _ struct{} `type:"structure"` @@ -5445,181 +6662,516 @@ func (s *CancelKeyDeletionOutput) SetKeyId(v string) *CancelKeyDeletionOutput { return s } -type ConnectCustomKeyStoreInput struct { - _ struct{} `type:"structure"` +// The request was rejected because the specified AWS CloudHSM cluster is already +// associated with a custom key store or it shares a backup history with a cluster +// that is associated with a custom key store. Each custom key store must be +// associated with a different AWS CloudHSM cluster. +// +// Clusters that share a backup history have the same cluster certificate. To +// view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) +// operation. +type CloudHsmClusterInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Enter the key store ID of the custom key store that you want to connect. - // To find the ID of a custom key store, use the DescribeCustomKeyStores operation. - // - // CustomKeyStoreId is a required field - CustomKeyStoreId *string `min:"1" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ConnectCustomKeyStoreInput) String() string { +func (s CloudHsmClusterInUseException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ConnectCustomKeyStoreInput) GoString() string { +func (s CloudHsmClusterInUseException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ConnectCustomKeyStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ConnectCustomKeyStoreInput"} - if s.CustomKeyStoreId == nil { - invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreId")) - } - if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) +func newErrorCloudHsmClusterInUseException(v protocol.ResponseMetadata) error { + return &CloudHsmClusterInUseException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// Code returns the exception type name. +func (s CloudHsmClusterInUseException) Code() string { + return "CloudHsmClusterInUseException" } -// SetCustomKeyStoreId sets the CustomKeyStoreId field's value. -func (s *ConnectCustomKeyStoreInput) SetCustomKeyStoreId(v string) *ConnectCustomKeyStoreInput { - s.CustomKeyStoreId = &v - return s +// Message returns the exception's message. +func (s CloudHsmClusterInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type ConnectCustomKeyStoreOutput struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CloudHsmClusterInUseException) OrigErr() error { + return nil } -// String returns the string representation -func (s ConnectCustomKeyStoreOutput) String() string { - return awsutil.Prettify(s) +func (s CloudHsmClusterInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// GoString returns the string representation -func (s ConnectCustomKeyStoreOutput) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s CloudHsmClusterInUseException) StatusCode() int { + return s.respMetadata.StatusCode } -type CreateAliasInput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s CloudHsmClusterInUseException) RequestID() string { + return s.respMetadata.RequestID +} - // Specifies the alias name. This value must begin with alias/ followed by a - // name, such as alias/ExampleAlias. The alias name cannot begin with alias/aws/. - // The alias/aws/ prefix is reserved for AWS managed CMKs. - // - // AliasName is a required field - AliasName *string `min:"1" type:"string" required:"true"` +// The request was rejected because the associated AWS CloudHSM cluster did +// not meet the configuration requirements for a custom key store. +// +// * The cluster must be configured with private subnets in at least two +// different Availability Zones in the Region. +// +// * The security group for the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html) +// (cloudhsm-cluster--sg) must include inbound rules and outbound +// rules that allow TCP traffic on ports 2223-2225. The Source in the inbound +// rules and the Destination in the outbound rules must match the security +// group ID. These rules are set by default when you create the cluster. +// Do not delete or change them. To get information about a particular security +// group, use the DescribeSecurityGroups (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeSecurityGroups.html) +// operation. +// +// * The cluster must contain at least as many HSMs as the operation requires. +// To add HSMs, use the AWS CloudHSM CreateHsm (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_CreateHsm.html) +// operation. For the CreateCustomKeyStore, UpdateCustomKeyStore, and CreateKey +// operations, the AWS CloudHSM cluster must have at least two active HSMs, +// each in a different Availability Zone. For the ConnectCustomKeyStore operation, +// the AWS CloudHSM must contain at least one active HSM. +// +// For information about the requirements for an AWS CloudHSM cluster that is +// associated with a custom key store, see Assemble the Prerequisites (https://docs.aws.amazon.com/kms/latest/developerguide/create-keystore.html#before-keystore) +// in the AWS Key Management Service Developer Guide. For information about +// creating a private subnet for an AWS CloudHSM cluster, see Create a Private +// Subnet (https://docs.aws.amazon.com/cloudhsm/latest/userguide/create-subnets.html) +// in the AWS CloudHSM User Guide. For information about cluster security groups, +// see Configure a Default Security Group (https://docs.aws.amazon.com/cloudhsm/latest/userguide/configure-sg.html) +// in the AWS CloudHSM User Guide . +type CloudHsmClusterInvalidConfigurationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Identifies the CMK to which the alias refers. Specify the key ID or the Amazon - // Resource Name (ARN) of the CMK. You cannot specify another alias. For help - // finding the key ID and ARN, see Finding the Key ID and ARN (https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html#find-cmk-id-arn) - // in the AWS Key Management Service Developer Guide. - // - // TargetKeyId is a required field - TargetKeyId *string `min:"1" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s CreateAliasInput) String() string { +func (s CloudHsmClusterInvalidConfigurationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateAliasInput) GoString() string { +func (s CloudHsmClusterInvalidConfigurationException) 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)) +func newErrorCloudHsmClusterInvalidConfigurationException(v protocol.ResponseMetadata) error { + return &CloudHsmClusterInvalidConfigurationException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s CloudHsmClusterInvalidConfigurationException) Code() string { + return "CloudHsmClusterInvalidConfigurationException" +} + +// Message returns the exception's message. +func (s CloudHsmClusterInvalidConfigurationException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CloudHsmClusterInvalidConfigurationException) OrigErr() error { return nil } -// SetAliasName sets the AliasName field's value. -func (s *CreateAliasInput) SetAliasName(v string) *CreateAliasInput { - s.AliasName = &v - return s +func (s CloudHsmClusterInvalidConfigurationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetTargetKeyId sets the TargetKeyId field's value. -func (s *CreateAliasInput) SetTargetKeyId(v string) *CreateAliasInput { - s.TargetKeyId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s CloudHsmClusterInvalidConfigurationException) StatusCode() int { + return s.respMetadata.StatusCode } -type CreateAliasOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s CloudHsmClusterInvalidConfigurationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because the AWS CloudHSM cluster that is associated +// with the custom key store is not active. Initialize and activate the cluster +// and try the command again. For detailed instructions, see Getting Started +// (https://docs.aws.amazon.com/cloudhsm/latest/userguide/getting-started.html) +// in the AWS CloudHSM User Guide. +type CloudHsmClusterNotActiveException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s CreateAliasOutput) String() string { +func (s CloudHsmClusterNotActiveException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateAliasOutput) GoString() string { +func (s CloudHsmClusterNotActiveException) GoString() string { return s.String() } -type CreateCustomKeyStoreInput struct { - _ struct{} `type:"structure"` +func newErrorCloudHsmClusterNotActiveException(v protocol.ResponseMetadata) error { + return &CloudHsmClusterNotActiveException{ + respMetadata: v, + } +} - // Identifies the AWS CloudHSM cluster for the custom key store. Enter the cluster - // ID of any active AWS CloudHSM cluster that is not already associated with - // a custom key store. To find the cluster ID, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) - // operation. - // - // CloudHsmClusterId is a required field - CloudHsmClusterId *string `min:"19" type:"string" required:"true"` +// Code returns the exception type name. +func (s CloudHsmClusterNotActiveException) Code() string { + return "CloudHsmClusterNotActiveException" +} - // Specifies a friendly name for the custom key store. The name must be unique - // in your AWS account. - // - // CustomKeyStoreName is a required field - CustomKeyStoreName *string `min:"1" type:"string" required:"true"` +// Message returns the exception's message. +func (s CloudHsmClusterNotActiveException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Enter the password of the kmsuser crypto user (CU) account (https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser) - // in the specified AWS CloudHSM cluster. AWS KMS logs into the cluster as this - // user to manage key material on your behalf. - // - // This parameter tells AWS KMS the kmsuser account password; it does not change - // the password in the AWS CloudHSM cluster. - // - // KeyStorePassword is a required field - KeyStorePassword *string `min:"1" type:"string" required:"true" sensitive:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CloudHsmClusterNotActiveException) OrigErr() error { + return nil +} - // Enter the content of the trust anchor certificate for the cluster. This is - // the content of the customerCA.crt file that you created when you initialized - // the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html). - // - // TrustAnchorCertificate is a required field - TrustAnchorCertificate *string `min:"1" type:"string" required:"true"` +func (s CloudHsmClusterNotActiveException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CloudHsmClusterNotActiveException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CloudHsmClusterNotActiveException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because AWS KMS cannot find the AWS CloudHSM cluster +// with the specified cluster ID. Retry the request with a different cluster +// ID. +type CloudHsmClusterNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s CreateCustomKeyStoreInput) String() string { +func (s CloudHsmClusterNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateCustomKeyStoreInput) GoString() string { +func (s CloudHsmClusterNotFoundException) GoString() string { + return s.String() +} + +func newErrorCloudHsmClusterNotFoundException(v protocol.ResponseMetadata) error { + return &CloudHsmClusterNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CloudHsmClusterNotFoundException) Code() string { + return "CloudHsmClusterNotFoundException" +} + +// Message returns the exception's message. +func (s CloudHsmClusterNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CloudHsmClusterNotFoundException) OrigErr() error { + return nil +} + +func (s CloudHsmClusterNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CloudHsmClusterNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CloudHsmClusterNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because the specified AWS CloudHSM cluster has a +// different cluster certificate than the original cluster. You cannot use the +// operation to specify an unrelated cluster. +// +// Specify a cluster that shares a backup history with the original cluster. +// This includes clusters that were created from a backup of the current cluster, +// and clusters that were created from the same backup that produced the current +// cluster. +// +// Clusters that share a backup history have the same cluster certificate. To +// view the cluster certificate of a cluster, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) +// operation. +type CloudHsmClusterNotRelatedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CloudHsmClusterNotRelatedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudHsmClusterNotRelatedException) GoString() string { + return s.String() +} + +func newErrorCloudHsmClusterNotRelatedException(v protocol.ResponseMetadata) error { + return &CloudHsmClusterNotRelatedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CloudHsmClusterNotRelatedException) Code() string { + return "CloudHsmClusterNotRelatedException" +} + +// Message returns the exception's message. +func (s CloudHsmClusterNotRelatedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CloudHsmClusterNotRelatedException) OrigErr() error { + return nil +} + +func (s CloudHsmClusterNotRelatedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CloudHsmClusterNotRelatedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CloudHsmClusterNotRelatedException) RequestID() string { + return s.respMetadata.RequestID +} + +type ConnectCustomKeyStoreInput struct { + _ struct{} `type:"structure"` + + // Enter the key store ID of the custom key store that you want to connect. + // To find the ID of a custom key store, use the DescribeCustomKeyStores operation. + // + // CustomKeyStoreId is a required field + CustomKeyStoreId *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ConnectCustomKeyStoreInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectCustomKeyStoreInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ConnectCustomKeyStoreInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConnectCustomKeyStoreInput"} + if s.CustomKeyStoreId == nil { + invalidParams.Add(request.NewErrParamRequired("CustomKeyStoreId")) + } + if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCustomKeyStoreId sets the CustomKeyStoreId field's value. +func (s *ConnectCustomKeyStoreInput) SetCustomKeyStoreId(v string) *ConnectCustomKeyStoreInput { + s.CustomKeyStoreId = &v + return s +} + +type ConnectCustomKeyStoreOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ConnectCustomKeyStoreOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectCustomKeyStoreOutput) GoString() string { + return s.String() +} + +type CreateAliasInput struct { + _ struct{} `type:"structure"` + + // Specifies the alias name. This value must begin with alias/ followed by a + // name, such as alias/ExampleAlias. The alias name cannot begin with alias/aws/. + // The alias/aws/ prefix is reserved for AWS managed CMKs. + // + // AliasName is a required field + AliasName *string `min:"1" type:"string" required:"true"` + + // Identifies the CMK to which the alias refers. Specify the key ID or the Amazon + // Resource Name (ARN) of the CMK. You cannot specify another alias. For help + // finding the key ID and ARN, see Finding the Key ID and ARN (https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html#find-cmk-id-arn) + // in the AWS Key Management Service Developer Guide. + // + // 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 +} + +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() +} + +type CreateCustomKeyStoreInput struct { + _ struct{} `type:"structure"` + + // Identifies the AWS CloudHSM cluster for the custom key store. Enter the cluster + // ID of any active AWS CloudHSM cluster that is not already associated with + // a custom key store. To find the cluster ID, use the DescribeClusters (https://docs.aws.amazon.com/cloudhsm/latest/APIReference/API_DescribeClusters.html) + // operation. + // + // CloudHsmClusterId is a required field + CloudHsmClusterId *string `min:"19" type:"string" required:"true"` + + // Specifies a friendly name for the custom key store. The name must be unique + // in your AWS account. + // + // CustomKeyStoreName is a required field + CustomKeyStoreName *string `min:"1" type:"string" required:"true"` + + // Enter the password of the kmsuser crypto user (CU) account (https://docs.aws.amazon.com/kms/latest/developerguide/key-store-concepts.html#concept-kmsuser) + // in the specified AWS CloudHSM cluster. AWS KMS logs into the cluster as this + // user to manage key material on your behalf. + // + // The password must be a string of 7 to 32 characters. Its value is case sensitive. + // + // This parameter tells AWS KMS the kmsuser account password; it does not change + // the password in the AWS CloudHSM cluster. + // + // KeyStorePassword is a required field + KeyStorePassword *string `min:"7" type:"string" required:"true" sensitive:"true"` + + // Enter the content of the trust anchor certificate for the cluster. This is + // the content of the customerCA.crt file that you created when you initialized + // the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html). + // + // TrustAnchorCertificate is a required field + TrustAnchorCertificate *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateCustomKeyStoreInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCustomKeyStoreInput) GoString() string { return s.String() } @@ -5641,8 +7193,8 @@ func (s *CreateCustomKeyStoreInput) Validate() error { if s.KeyStorePassword == nil { invalidParams.Add(request.NewErrParamRequired("KeyStorePassword")) } - if s.KeyStorePassword != nil && len(*s.KeyStorePassword) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyStorePassword", 1)) + if s.KeyStorePassword != nil && len(*s.KeyStorePassword) < 7 { + invalidParams.Add(request.NewErrParamMinLen("KeyStorePassword", 7)) } if s.TrustAnchorCertificate == nil { invalidParams.Add(request.NewErrParamRequired("TrustAnchorCertificate")) @@ -5925,6 +7477,9 @@ type CreateKeyInput struct { // the custom key store must have at least two active HSMs, each in a different // Availability Zone in the Region. // + // This parameter is valid only for symmetric CMKs. You cannot create an asymmetric + // CMK in a custom key store. + // // To find the ID of a custom key store, use the DescribeCustomKeyStores operation. // // The response includes the custom key store ID and the ID of the AWS CloudHSM @@ -5935,33 +7490,76 @@ type CreateKeyInput struct { // of AWS KMS with the isolation and control of a single-tenant key store. CustomKeyStoreId *string `min:"1" type:"string"` + // Specifies the type of CMK to create. The default value, SYMMETRIC_DEFAULT, + // creates a CMK with a 256-bit symmetric key for encryption and decryption. + // For help choosing a key spec for your CMK, see How to Choose Your CMK Configuration + // (https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-choose.html) + // in the AWS Key Management Service Developer Guide. + // + // The CustomerMasterKeySpec determines whether the CMK contains a symmetric + // key or an asymmetric key pair. It also determines the encryption algorithms + // or signing algorithms that the CMK supports. You can't change the CustomerMasterKeySpec + // after the CMK is created. To further restrict the algorithms that can be + // used with the CMK, use a condition key in its key policy or IAM policy. For + // more information, see kms:EncryptionAlgorithm (https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-algorithm) + // or kms:Signing Algorithm (https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-signing-algorithm) + // in the AWS Key Management Service Developer Guide. + // + // AWS services that are integrated with AWS KMS (http://aws.amazon.com/kms/features/#AWS_Service_Integration) + // use symmetric CMKs to protect your data. These services do not support asymmetric + // CMKs. For help determining whether a CMK is symmetric or asymmetric, see + // Identifying Symmetric and Asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/find-symm-asymm.html) + // in the AWS Key Management Service Developer Guide. + // + // AWS KMS supports the following key specs for CMKs: + // + // * Symmetric key (default) SYMMETRIC_DEFAULT (AES-256-GCM) + // + // * Asymmetric RSA key pairs RSA_2048 RSA_3072 RSA_4096 + // + // * Asymmetric NIST-recommended elliptic curve key pairs ECC_NIST_P256 (secp256r1) + // ECC_NIST_P384 (secp384r1) ECC_NIST_P521 (secp521r1) + // + // * Other asymmetric elliptic curve key pairs ECC_SECG_P256K1 (secp256k1), + // commonly used for cryptocurrencies. + CustomerMasterKeySpec *string `type:"string" enum:"CustomerMasterKeySpec"` + // 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 cryptographic operations for which you can use the CMK. The only valid - // value is ENCRYPT_DECRYPT, which means you can use the CMK to encrypt and - // decrypt data. + // Determines the cryptographic operations for which you can use the CMK. The + // default value is ENCRYPT_DECRYPT. This parameter is required only for asymmetric + // CMKs. You can't change the KeyUsage value after the CMK is created. + // + // Select only one valid value. + // + // * For symmetric CMKs, omit the parameter or specify ENCRYPT_DECRYPT. + // + // * For asymmetric CMKs with RSA key material, specify ENCRYPT_DECRYPT or + // SIGN_VERIFY. + // + // * For asymmetric CMKs with ECC key material, specify SIGN_VERIFY. KeyUsage *string `type:"string" enum:"KeyUsageType"` // The source of the key material for the CMK. You cannot change the origin - // after you create the CMK. - // - // The default is AWS_KMS, which means AWS KMS creates the key material in its - // own key store. + // after you create the CMK. The default is AWS_KMS, which means AWS KMS creates + // the key material. // // When the parameter value is EXTERNAL, AWS KMS 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 (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) - // in the AWS Key Management Service Developer Guide. + // in the AWS Key Management Service Developer Guide. This value is valid only + // for symmetric CMKs. // // When the parameter value is AWS_CLOUDHSM, AWS KMS creates the CMK in an AWS // KMS custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) // and creates its key material in the associated AWS CloudHSM cluster. You // must also use the CustomKeyStoreId parameter to identify the custom key store. + // This value is valid only for symmetric CMKs. Origin *string `type:"string" enum:"OriginType"` // The key policy to attach to the CMK. @@ -5988,14 +7586,19 @@ type CreateKeyInput struct { // to the CMK. For more information, see Default Key Policy (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) // in the AWS Key Management Service Developer Guide. // - // The key policy size limit is 32 kilobytes (32768 bytes). + // The key policy size quota is 32 kilobytes (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. + // One or more tags. Each tag consists of a tag key and a tag value. Both the + // tag key and the tag value are required, but the tag value can be an empty + // (null) string. // - // 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. + // When you add tags to an AWS resource, AWS generates a cost allocation report + // with usage and costs aggregated by tags. For information about adding, changing, + // deleting and listing tags for CMKs, see Tagging Keys (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html). + // + // Use this parameter to tag the CMK when it is created. To add tags to an existing + // CMK, use the TagResource operation. Tags []*Tag `type:"list"` } @@ -6047,6 +7650,12 @@ func (s *CreateKeyInput) SetCustomKeyStoreId(v string) *CreateKeyInput { return s } +// SetCustomerMasterKeySpec sets the CustomerMasterKeySpec field's value. +func (s *CreateKeyInput) SetCustomerMasterKeySpec(v string) *CreateKeyInput { + s.CustomerMasterKeySpec = &v + return s +} + // SetDescription sets the Description field's value. func (s *CreateKeyInput) SetDescription(v string) *CreateKeyInput { s.Description = &v @@ -6100,16 +7709,267 @@ func (s *CreateKeyOutput) SetKeyMetadata(v *KeyMetadata) *CreateKeyOutput { return s } -// Contains information about each custom key store in the custom key store -// list. -type CustomKeyStoresListEntry struct { - _ struct{} `type:"structure"` +// The request was rejected because the custom key store contains AWS KMS customer +// master keys (CMKs). After verifying that you do not need to use the CMKs, +// use the ScheduleKeyDeletion operation to delete the CMKs. After they are +// deleted, you can delete the custom key store. +type CustomKeyStoreHasCMKsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // A unique identifier for the AWS CloudHSM cluster that is associated with - // the custom key store. - CloudHsmClusterId *string `min:"19" type:"string"` + Message_ *string `locationName:"message" type:"string"` +} - // Describes the connection error. Valid values are: +// String returns the string representation +func (s CustomKeyStoreHasCMKsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CustomKeyStoreHasCMKsException) GoString() string { + return s.String() +} + +func newErrorCustomKeyStoreHasCMKsException(v protocol.ResponseMetadata) error { + return &CustomKeyStoreHasCMKsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CustomKeyStoreHasCMKsException) Code() string { + return "CustomKeyStoreHasCMKsException" +} + +// Message returns the exception's message. +func (s CustomKeyStoreHasCMKsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CustomKeyStoreHasCMKsException) OrigErr() error { + return nil +} + +func (s CustomKeyStoreHasCMKsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CustomKeyStoreHasCMKsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CustomKeyStoreHasCMKsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because of the ConnectionState of the custom key +// store. To get the ConnectionState of a custom key store, use the DescribeCustomKeyStores +// operation. +// +// This exception is thrown under the following conditions: +// +// * You requested the CreateKey or GenerateRandom operation in a custom +// key store that is not connected. These operations are valid only when +// the custom key store ConnectionState is CONNECTED. +// +// * You requested the UpdateCustomKeyStore or DeleteCustomKeyStore operation +// on a custom key store that is not disconnected. This operation is valid +// only when the custom key store ConnectionState is DISCONNECTED. +// +// * You requested the ConnectCustomKeyStore operation on a custom key store +// with a ConnectionState of DISCONNECTING or FAILED. This operation is valid +// for all other ConnectionState values. +type CustomKeyStoreInvalidStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CustomKeyStoreInvalidStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CustomKeyStoreInvalidStateException) GoString() string { + return s.String() +} + +func newErrorCustomKeyStoreInvalidStateException(v protocol.ResponseMetadata) error { + return &CustomKeyStoreInvalidStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CustomKeyStoreInvalidStateException) Code() string { + return "CustomKeyStoreInvalidStateException" +} + +// Message returns the exception's message. +func (s CustomKeyStoreInvalidStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CustomKeyStoreInvalidStateException) OrigErr() error { + return nil +} + +func (s CustomKeyStoreInvalidStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CustomKeyStoreInvalidStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CustomKeyStoreInvalidStateException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because the specified custom key store name is already +// assigned to another custom key store in the account. Try again with a custom +// key store name that is unique in the account. +type CustomKeyStoreNameInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CustomKeyStoreNameInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CustomKeyStoreNameInUseException) GoString() string { + return s.String() +} + +func newErrorCustomKeyStoreNameInUseException(v protocol.ResponseMetadata) error { + return &CustomKeyStoreNameInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CustomKeyStoreNameInUseException) Code() string { + return "CustomKeyStoreNameInUseException" +} + +// Message returns the exception's message. +func (s CustomKeyStoreNameInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CustomKeyStoreNameInUseException) OrigErr() error { + return nil +} + +func (s CustomKeyStoreNameInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CustomKeyStoreNameInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CustomKeyStoreNameInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because AWS KMS cannot find a custom key store with +// the specified key store name or ID. +type CustomKeyStoreNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CustomKeyStoreNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CustomKeyStoreNotFoundException) GoString() string { + return s.String() +} + +func newErrorCustomKeyStoreNotFoundException(v protocol.ResponseMetadata) error { + return &CustomKeyStoreNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CustomKeyStoreNotFoundException) Code() string { + return "CustomKeyStoreNotFoundException" +} + +// Message returns the exception's message. +func (s CustomKeyStoreNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CustomKeyStoreNotFoundException) OrigErr() error { + return nil +} + +func (s CustomKeyStoreNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CustomKeyStoreNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CustomKeyStoreNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Contains information about each custom key store in the custom key store +// list. +type CustomKeyStoresListEntry struct { + _ struct{} `type:"structure"` + + // A unique identifier for the AWS CloudHSM cluster that is associated with + // the custom key store. + CloudHsmClusterId *string `min:"19" type:"string"` + + // Describes the connection error. This field appears in the response only when + // the ConnectionState is FAILED. For help resolving these errors, see How to + // Fix a Connection Failure (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-failed) + // in AWS Key Management Service Developer Guide. + // + // Valid values are: // // * CLUSTER_NOT_FOUND - AWS KMS cannot find the AWS CloudHSM cluster with // the specified cluster ID. @@ -6123,20 +7983,42 @@ type CustomKeyStoresListEntry struct { // the custom key store before trying to connect again. // // * INVALID_CREDENTIALS - AWS KMS does not have the correct password for - // the kmsuser crypto user in the AWS CloudHSM cluster. + // the kmsuser crypto user in the AWS CloudHSM cluster. Before you can connect + // your custom key store to its AWS CloudHSM cluster, you must change the + // kmsuser account password and update the key store password value for the + // custom key store. // // * NETWORK_ERRORS - Network errors are preventing AWS KMS from connecting // to the custom key store. // + // * SUBNET_NOT_FOUND - A subnet in the AWS CloudHSM cluster configuration + // was deleted. If AWS KMS cannot find all of the subnets that were configured + // for the cluster when the custom key store was created, attempts to connect + // fail. To fix this error, create a cluster from a backup and associate + // it with your custom key store. This process includes selecting a VPC and + // subnets. For details, see How to Fix a Connection Failure (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-failed) + // in the AWS Key Management Service Developer Guide. + // // * USER_LOCKED_OUT - The kmsuser CU account is locked out of the associated // AWS CloudHSM cluster due to too many failed password attempts. Before // you can connect your custom key store to its AWS CloudHSM cluster, you - // must change the kmsuser account password and update the password value - // for the custom key store. - // - // For help with connection failures, see Troubleshooting Custom Key Stores - // (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) - // in the AWS Key Management Service Developer Guide. + // must change the kmsuser account password and update the key store password + // value for the custom key store. + // + // * USER_LOGGED_IN - The kmsuser CU account is logged into the the associated + // AWS CloudHSM cluster. This prevents AWS KMS from rotating the kmsuser + // account password and logging into the cluster. Before you can connect + // your custom key store to its AWS CloudHSM cluster, you must log the kmsuser + // CU out of the cluster. If you changed the kmsuser password to log into + // the cluster, you must also and update the key store password value for + // the custom key store. For help, see How to Log Out and Reconnect (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#login-kmsuser-2) + // in the AWS Key Management Service Developer Guide. + // + // * USER_NOT_FOUND - AWS KMS cannot find a kmsuser CU account in the associated + // AWS CloudHSM cluster. Before you can connect your custom key store to + // its AWS CloudHSM cluster, you must create a kmsuser CU account in the + // cluster, and then update the key store password value for the custom key + // store. ConnectionErrorCode *string `type:"string" enum:"ConnectionErrorCodeType"` // Indicates whether the custom key store is connected to its AWS CloudHSM cluster. @@ -6151,8 +8033,9 @@ type CustomKeyStoresListEntry struct { // one active HSM. // // A value of FAILED indicates that an attempt to connect was unsuccessful. - // For help resolving a connection failure, see Troubleshooting a Custom Key - // Store (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) + // The ConnectionErrorCode field in the response indicates the cause of the + // failure. For help resolving a connection failure, see Troubleshooting a Custom + // Key Store (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) // in the AWS Key Management Service Developer Guide. ConnectionState *string `type:"string" enum:"ConnectionStateType"` @@ -6233,9 +8116,28 @@ type DecryptInput struct { // 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 (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context). + // Specifies the encryption algorithm that will be used to decrypt the ciphertext. + // Specify the same algorithm that was used to encrypt the data. If you specify + // a different algorithm, the Decrypt operation fails. + // + // This parameter is required only when the ciphertext was encrypted under an + // asymmetric CMK. The default value, SYMMETRIC_DEFAULT, represents the only + // supported algorithm that is valid for symmetric CMKs. + EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` + + // Specifies the encryption context to use when decrypting the data. An encryption + // context is valid only for cryptographic operations with a symmetric CMK. + // The standard asymmetric encryption algorithms that AWS KMS uses do not support + // an encryption context. + // + // An encryption context is a collection of non-secret key-value pairs that + // represents additional authenticated data. When you use an encryption context + // to encrypt data, you must specify the same (an exact case-sensitive match) + // encryption context to decrypt the data. An encryption context is optional + // when encrypting with a symmetric CMK, but it is highly recommended. + // + // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // in the AWS Key Management Service Developer Guide. EncryptionContext map[string]*string `type:"map"` // A list of grant tokens. @@ -6243,6 +8145,35 @@ type DecryptInput struct { // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) // in the AWS Key Management Service Developer Guide. GrantTokens []*string `type:"list"` + + // Specifies the customer master key (CMK) that AWS KMS will use to decrypt + // the ciphertext. Enter a key ID of the CMK that was used to encrypt the ciphertext. + // + // If you specify a KeyId value, the Decrypt operation succeeds only if the + // specified CMK was used to encrypt the ciphertext. + // + // This parameter is required only when the ciphertext was encrypted under an + // asymmetric CMK. Otherwise, AWS KMS uses the metadata that it adds to the + // ciphertext blob to determine which CMK was used to encrypt the ciphertext. + // However, you can use this parameter to ensure that a particular CMK (of any + // kind) is used to decrypt the ciphertext. + // + // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, + // or alias ARN. When using an alias name, prefix it with "alias/". + // + // For example: + // + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key 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 + // + // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To + // get the alias name and alias ARN, use ListAliases. + KeyId *string `min:"1" type:"string"` } // String returns the string representation @@ -6264,6 +8195,9 @@ func (s *DecryptInput) Validate() error { if s.CiphertextBlob != nil && len(s.CiphertextBlob) < 1 { invalidParams.Add(request.NewErrParamMinLen("CiphertextBlob", 1)) } + if s.KeyId != nil && len(*s.KeyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("KeyId", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -6277,6 +8211,12 @@ func (s *DecryptInput) SetCiphertextBlob(v []byte) *DecryptInput { return s } +// SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value. +func (s *DecryptInput) SetEncryptionAlgorithm(v string) *DecryptInput { + s.EncryptionAlgorithm = &v + return s +} + // SetEncryptionContext sets the EncryptionContext field's value. func (s *DecryptInput) SetEncryptionContext(v map[string]*string) *DecryptInput { s.EncryptionContext = v @@ -6289,15 +8229,23 @@ func (s *DecryptInput) SetGrantTokens(v []*string) *DecryptInput { return s } +// SetKeyId sets the KeyId field's value. +func (s *DecryptInput) SetKeyId(v string) *DecryptInput { + s.KeyId = &v + return s +} + 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. + // The encryption algorithm that was used to decrypt the ciphertext. + EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` + + // The ARN of the customer master key that was used to perform the decryption. KeyId *string `min:"1" type:"string"` // Decrypted plaintext data. When you use the HTTP API or the AWS CLI, the value - // is Base64-encoded. Otherwise, it is not encoded. + // is Base64-encoded. Otherwise, it is not Base64-encoded. // // Plaintext is automatically base64 encoded/decoded by the SDK. Plaintext []byte `min:"1" type:"blob" sensitive:"true"` @@ -6313,6 +8261,12 @@ func (s DecryptOutput) GoString() string { return s.String() } +// SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value. +func (s *DecryptOutput) SetEncryptionAlgorithm(v string) *DecryptOutput { + s.EncryptionAlgorithm = &v + return s +} + // SetKeyId sets the KeyId field's value. func (s *DecryptOutput) SetKeyId(v string) *DecryptOutput { s.KeyId = &v @@ -6503,6 +8457,63 @@ func (s DeleteImportedKeyMaterialOutput) GoString() string { return s.String() } +// The system timed out while trying to fulfill the request. The request can +// be retried. +type DependencyTimeoutException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DependencyTimeoutException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DependencyTimeoutException) GoString() string { + return s.String() +} + +func newErrorDependencyTimeoutException(v protocol.ResponseMetadata) error { + return &DependencyTimeoutException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DependencyTimeoutException) Code() string { + return "DependencyTimeoutException" +} + +// Message returns the exception's message. +func (s DependencyTimeoutException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DependencyTimeoutException) OrigErr() error { + return nil +} + +func (s DependencyTimeoutException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DependencyTimeoutException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DependencyTimeoutException) RequestID() string { + return s.respMetadata.RequestID +} + type DescribeCustomKeyStoresInput struct { _ struct{} `type:"structure"` @@ -6801,7 +8812,10 @@ func (s DisableKeyOutput) GoString() string { type DisableKeyRotationInput struct { _ struct{} `type:"structure"` - // A unique identifier for the customer master key (CMK). + // Identifies a symmetric customer master key (CMK). You cannot enable automatic + // rotation of asymmetric CMKs (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html#asymmetric-cmks), + // CMKs with imported key material (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html), + // or CMKs in a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). // // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. // @@ -6863,6 +8877,62 @@ func (s DisableKeyRotationOutput) GoString() string { return s.String() } +// The request was rejected because the specified CMK is not enabled. +type DisabledException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DisabledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisabledException) GoString() string { + return s.String() +} + +func newErrorDisabledException(v protocol.ResponseMetadata) error { + return &DisabledException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DisabledException) Code() string { + return "DisabledException" +} + +// Message returns the exception's message. +func (s DisabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DisabledException) OrigErr() error { + return nil +} + +func (s DisabledException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DisabledException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DisabledException) RequestID() string { + return s.respMetadata.RequestID +} + type DisconnectCustomKeyStoreInput struct { _ struct{} `type:"structure"` @@ -6987,7 +9057,9 @@ func (s EnableKeyOutput) GoString() string { type EnableKeyRotationInput struct { _ struct{} `type:"structure"` - // A unique identifier for the customer master key (CMK). + // Identifies a symmetric customer master key (CMK). You cannot enable automatic + // rotation of asymmetric CMKs, CMKs with imported key material, or CMKs in + // a custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). // // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. // @@ -7052,10 +9124,27 @@ func (s EnableKeyRotationOutput) GoString() string { 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 - // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context). + // Specifies the encryption algorithm that AWS KMS will use to encrypt the plaintext + // message. The algorithm must be compatible with the CMK that you specify. + // + // This parameter is required only for asymmetric CMKs. The default value, SYMMETRIC_DEFAULT, + // is the algorithm used for symmetric CMKs. If you are using an asymmetric + // CMK, we recommend RSAES_OAEP_SHA_256. + EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` + + // Specifies the encryption context that will be used to encrypt the data. An + // encryption context is valid only for cryptographic operations with a symmetric + // CMK. The standard asymmetric encryption algorithms that AWS KMS uses do not + // support an encryption context. + // + // An encryption context is a collection of non-secret key-value pairs that + // represents additional authenticated data. When you use an encryption context + // to encrypt data, you must specify the same (an exact case-sensitive match) + // encryption context to decrypt the data. An encryption context is optional + // when encrypting with a symmetric CMK, but it is highly recommended. + // + // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // in the AWS Key Management Service Developer Guide. EncryptionContext map[string]*string `type:"map"` // A list of grant tokens. @@ -7126,6 +9215,12 @@ func (s *EncryptInput) Validate() error { return nil } +// SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value. +func (s *EncryptInput) SetEncryptionAlgorithm(v string) *EncryptInput { + s.EncryptionAlgorithm = &v + return s +} + // SetEncryptionContext sets the EncryptionContext field's value. func (s *EncryptInput) SetEncryptionContext(v map[string]*string) *EncryptInput { s.EncryptionContext = v @@ -7154,11 +9249,14 @@ type EncryptOutput struct { _ struct{} `type:"structure"` // The encrypted plaintext. When you use the HTTP API or the AWS CLI, the value - // is Base64-encoded. Otherwise, it is not encoded. + // is Base64-encoded. Otherwise, it is not Base64-encoded. // // CiphertextBlob is automatically base64 encoded/decoded by the SDK. CiphertextBlob []byte `min:"1" type:"blob"` + // The encryption algorithm that was used to encrypt the plaintext. + EncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` + // The ID of the key used during encryption. KeyId *string `min:"1" type:"string"` } @@ -7179,31 +9277,102 @@ func (s *EncryptOutput) SetCiphertextBlob(v []byte) *EncryptOutput { return s } +// SetEncryptionAlgorithm sets the EncryptionAlgorithm field's value. +func (s *EncryptOutput) SetEncryptionAlgorithm(v string) *EncryptOutput { + s.EncryptionAlgorithm = &v + return s +} + // SetKeyId sets the KeyId field's value. func (s *EncryptOutput) SetKeyId(v string) *EncryptOutput { s.KeyId = &v return s } -type GenerateDataKeyInput struct { - _ struct{} `type:"structure"` +// The request was rejected because the specified import token is expired. Use +// GetParametersForImport to get a new import token and public key, use the +// new public key to encrypt the key material, and then try the request again. +type ExpiredImportTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // A set of key-value pairs that represents additional authenticated data. - // - // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) - // in the AWS Key Management Service Developer Guide. - EncryptionContext map[string]*string `type:"map"` + Message_ *string `locationName:"message" type:"string"` +} - // A list of grant tokens. - // - // For more information, see Grant Tokens (https://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 ExpiredImportTokenException) String() string { + return awsutil.Prettify(s) +} - // An identifier for the CMK that encrypts the data key. - // - // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, - // or alias ARN. When using an alias name, prefix it with "alias/". To specify +// GoString returns the string representation +func (s ExpiredImportTokenException) GoString() string { + return s.String() +} + +func newErrorExpiredImportTokenException(v protocol.ResponseMetadata) error { + return &ExpiredImportTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ExpiredImportTokenException) Code() string { + return "ExpiredImportTokenException" +} + +// Message returns the exception's message. +func (s ExpiredImportTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ExpiredImportTokenException) OrigErr() error { + return nil +} + +func (s ExpiredImportTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ExpiredImportTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ExpiredImportTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +type GenerateDataKeyInput struct { + _ struct{} `type:"structure"` + + // Specifies the encryption context that will be used when encrypting the data + // key. + // + // An encryption context is a collection of non-secret key-value pairs that + // represents additional authenticated data. When you use an encryption context + // to encrypt data, you must specify the same (an exact case-sensitive match) + // encryption context to decrypt the data. An encryption context is optional + // when encrypting with a symmetric CMK, but it is highly recommended. + // + // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // 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 (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) + // in the AWS Key Management Service Developer Guide. + GrantTokens []*string `type:"list"` + + // Identifies the symmetric CMK that encrypts the data key. + // + // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, + // or alias ARN. When using an alias name, prefix it with "alias/". To specify // a CMK in a different AWS account, you must use the key ARN or alias ARN. // // For example: @@ -7222,14 +9391,19 @@ type GenerateDataKeyInput struct { // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` - // The length of the data key. Use AES_128 to generate a 128-bit symmetric key, - // or AES_256 to generate a 256-bit symmetric key. + // Specifies the length of the data key. Use AES_128 to generate a 128-bit symmetric + // key, or AES_256 to generate a 256-bit symmetric key. + // + // You must specify either the KeySpec or the NumberOfBytes parameter (but not + // both) in every GenerateDataKey request. KeySpec *string `type:"string" enum:"DataKeySpec"` - // The length of the data 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. + // Specifies the length of the data key in bytes. For example, use the value + // 64 to generate a 512-bit data key (64 bytes is 512 bits). For 128-bit (16-byte) + // and 256-bit (32-byte) data keys, use the KeySpec parameter. + // + // You must specify either the KeySpec or the NumberOfBytes parameter (but not + // both) in every GenerateDataKey request. NumberOfBytes *int64 `min:"1" type:"integer"` } @@ -7296,7 +9470,7 @@ type GenerateDataKeyOutput struct { _ struct{} `type:"structure"` // The encrypted copy of the data key. When you use the HTTP API or the AWS - // CLI, the value is Base64-encoded. Otherwise, it is not encoded. + // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. // // CiphertextBlob is automatically base64 encoded/decoded by the SDK. CiphertextBlob []byte `min:"1" type:"blob"` @@ -7305,8 +9479,9 @@ type GenerateDataKeyOutput struct { KeyId *string `min:"1" type:"string"` // The plaintext data key. When you use the HTTP API or the AWS CLI, the value - // is Base64-encoded. Otherwise, it is not encoded. Use this data key to encrypt - // your data outside of KMS. Then, remove it from memory as soon as possible. + // is Base64-encoded. Otherwise, it is not Base64-encoded. Use this data key + // to encrypt your data outside of KMS. Then, remove it from memory as soon + // as possible. // // Plaintext is automatically base64 encoded/decoded by the SDK. Plaintext []byte `min:"1" type:"blob" sensitive:"true"` @@ -7340,10 +9515,17 @@ func (s *GenerateDataKeyOutput) SetPlaintext(v []byte) *GenerateDataKeyOutput { return s } -type GenerateDataKeyWithoutPlaintextInput struct { +type GenerateDataKeyPairInput struct { _ struct{} `type:"structure"` - // A set of key-value pairs that represents additional authenticated data. + // Specifies the encryption context that will be used when encrypting the private + // key in the data key pair. + // + // An encryption context is a collection of non-secret key-value pairs that + // represents additional authenticated data. When you use an encryption context + // to encrypt data, you must specify the same (an exact case-sensitive match) + // encryption context to decrypt the data. An encryption context is optional + // when encrypting with a symmetric CMK, but it is highly recommended. // // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) // in the AWS Key Management Service Developer Guide. @@ -7355,7 +9537,8 @@ type GenerateDataKeyWithoutPlaintextInput struct { // in the AWS Key Management Service Developer Guide. GrantTokens []*string `type:"list"` - // The identifier of the customer master key (CMK) that encrypts the data key. + // Specifies the symmetric CMK that encrypts the private key in the data key + // pair. You cannot specify an asymmetric CMKs. // // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, // or alias ARN. When using an alias name, prefix it with "alias/". To specify @@ -7377,38 +9560,38 @@ type GenerateDataKeyWithoutPlaintextInput struct { // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` - // The length of the data 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 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"` + // Determines the type of data key pair that is generated. + // + // The AWS KMS rule that restricts the use of asymmetric RSA CMKs to encrypt + // and decrypt or to sign and verify (but not both), and the rule that permits + // you to use ECC CMKs only to sign and verify, are not effective outside of + // AWS KMS. + // + // KeyPairSpec is a required field + KeyPairSpec *string `type:"string" required:"true" enum:"DataKeyPairSpec"` } // String returns the string representation -func (s GenerateDataKeyWithoutPlaintextInput) String() string { +func (s GenerateDataKeyPairInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GenerateDataKeyWithoutPlaintextInput) GoString() string { +func (s GenerateDataKeyPairInput) 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"} +func (s *GenerateDataKeyPairInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyPairInput"} 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 s.KeyPairSpec == nil { + invalidParams.Add(request.NewErrParamRequired("KeyPairSpec")) } if invalidParams.Len() > 0 { @@ -7418,152 +9601,124 @@ func (s *GenerateDataKeyWithoutPlaintextInput) Validate() error { } // SetEncryptionContext sets the EncryptionContext field's value. -func (s *GenerateDataKeyWithoutPlaintextInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyWithoutPlaintextInput { +func (s *GenerateDataKeyPairInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyPairInput { s.EncryptionContext = v return s } // SetGrantTokens sets the GrantTokens field's value. -func (s *GenerateDataKeyWithoutPlaintextInput) SetGrantTokens(v []*string) *GenerateDataKeyWithoutPlaintextInput { +func (s *GenerateDataKeyPairInput) SetGrantTokens(v []*string) *GenerateDataKeyPairInput { s.GrantTokens = v return s } // SetKeyId sets the KeyId field's value. -func (s *GenerateDataKeyWithoutPlaintextInput) SetKeyId(v string) *GenerateDataKeyWithoutPlaintextInput { +func (s *GenerateDataKeyPairInput) SetKeyId(v string) *GenerateDataKeyPairInput { 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 +// SetKeyPairSpec sets the KeyPairSpec field's value. +func (s *GenerateDataKeyPairInput) SetKeyPairSpec(v string) *GenerateDataKeyPairInput { + s.KeyPairSpec = &v return s } -type GenerateDataKeyWithoutPlaintextOutput struct { +type GenerateDataKeyPairOutput struct { _ struct{} `type:"structure"` - // The encrypted data key. When you use the HTTP API or the AWS CLI, the value - // is Base64-encoded. Otherwise, it is not encoded. + // The identifier of the CMK that encrypted the private key. + KeyId *string `min:"1" type:"string"` + + // The type of data key pair that was generated. + KeyPairSpec *string `type:"string" enum:"DataKeyPairSpec"` + + // The encrypted copy of the private key. When you use the HTTP API or the AWS + // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. // - // CiphertextBlob is automatically base64 encoded/decoded by the SDK. - CiphertextBlob []byte `min:"1" type:"blob"` + // PrivateKeyCiphertextBlob is automatically base64 encoded/decoded by the SDK. + PrivateKeyCiphertextBlob []byte `min:"1" type:"blob"` - // The identifier of the CMK that encrypted the data key. - KeyId *string `min:"1" type:"string"` + // The plaintext copy of the private key. When you use the HTTP API or the AWS + // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. + // + // PrivateKeyPlaintext is automatically base64 encoded/decoded by the SDK. + PrivateKeyPlaintext []byte `min:"1" type:"blob" sensitive:"true"` + + // The public key (in plaintext). + // + // PublicKey is automatically base64 encoded/decoded by the SDK. + PublicKey []byte `min:"1" type:"blob"` } // String returns the string representation -func (s GenerateDataKeyWithoutPlaintextOutput) String() string { +func (s GenerateDataKeyPairOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GenerateDataKeyWithoutPlaintextOutput) GoString() string { +func (s GenerateDataKeyPairOutput) 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 { +func (s *GenerateDataKeyPairOutput) SetKeyId(v string) *GenerateDataKeyPairOutput { s.KeyId = &v return s } -type GenerateRandomInput struct { - _ struct{} `type:"structure"` - - // Generates the random byte string in the AWS CloudHSM cluster that is associated - // with the specified custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). - // To find the ID of a custom key store, use the DescribeCustomKeyStores operation. - CustomKeyStoreId *string `min:"1" type:"string"` - - // 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() +// SetKeyPairSpec sets the KeyPairSpec field's value. +func (s *GenerateDataKeyPairOutput) SetKeyPairSpec(v string) *GenerateDataKeyPairOutput { + s.KeyPairSpec = &v + return s } -// 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.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) - } - if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 { - invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetPrivateKeyCiphertextBlob sets the PrivateKeyCiphertextBlob field's value. +func (s *GenerateDataKeyPairOutput) SetPrivateKeyCiphertextBlob(v []byte) *GenerateDataKeyPairOutput { + s.PrivateKeyCiphertextBlob = v + return s } -// SetCustomKeyStoreId sets the CustomKeyStoreId field's value. -func (s *GenerateRandomInput) SetCustomKeyStoreId(v string) *GenerateRandomInput { - s.CustomKeyStoreId = &v +// SetPrivateKeyPlaintext sets the PrivateKeyPlaintext field's value. +func (s *GenerateDataKeyPairOutput) SetPrivateKeyPlaintext(v []byte) *GenerateDataKeyPairOutput { + s.PrivateKeyPlaintext = v return s } -// SetNumberOfBytes sets the NumberOfBytes field's value. -func (s *GenerateRandomInput) SetNumberOfBytes(v int64) *GenerateRandomInput { - s.NumberOfBytes = &v +// SetPublicKey sets the PublicKey field's value. +func (s *GenerateDataKeyPairOutput) SetPublicKey(v []byte) *GenerateDataKeyPairOutput { + s.PublicKey = v return s } -type GenerateRandomOutput struct { +type GenerateDataKeyPairWithoutPlaintextInput struct { _ struct{} `type:"structure"` - // The random byte string. When you use the HTTP API or the AWS CLI, the value - // is Base64-encoded. Otherwise, it is not encoded. + // Specifies the encryption context that will be used when encrypting the private + // key in the data key pair. // - // Plaintext is automatically base64 encoded/decoded by the SDK. - Plaintext []byte `min:"1" type:"blob" sensitive:"true"` -} - -// 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 -} + // An encryption context is a collection of non-secret key-value pairs that + // represents additional authenticated data. When you use an encryption context + // to encrypt data, you must specify the same (an exact case-sensitive match) + // encryption context to decrypt the data. An encryption context is optional + // when encrypting with a symmetric CMK, but it is highly recommended. + // + // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // in the AWS Key Management Service Developer Guide. + EncryptionContext map[string]*string `type:"map"` -type GetKeyPolicyInput struct { - _ struct{} `type:"structure"` + // A list of grant tokens. + // + // For more information, see Grant Tokens (https://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 (CMK). + // Specifies the CMK that encrypts the private key in the data key pair. You + // must specify a symmetric CMK. You cannot use an asymmetric CMK. To get the + // type of your CMK, use the DescribeKey operation. // - // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. + // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, + // or alias ARN. When using an alias name, prefix it with "alias/". // // For example: // @@ -7571,42 +9726,48 @@ type GetKeyPolicyInput struct { // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // - // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. + // * Alias name: alias/ExampleAlias + // + // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias + // + // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To + // get the alias name and alias ARN, use ListAliases. // // KeyId is a required field KeyId *string `min:"1" type:"string" required:"true"` - // Specifies the name of the key policy. The only valid name is default. To - // get the names of key policies, use ListKeyPolicies. + // Determines the type of data key pair that is generated. // - // PolicyName is a required field - PolicyName *string `min:"1" type:"string" required:"true"` + // The AWS KMS rule that restricts the use of asymmetric RSA CMKs to encrypt + // and decrypt or to sign and verify (but not both), and the rule that permits + // you to use ECC CMKs only to sign and verify, are not effective outside of + // AWS KMS. + // + // KeyPairSpec is a required field + KeyPairSpec *string `type:"string" required:"true" enum:"DataKeyPairSpec"` } // String returns the string representation -func (s GetKeyPolicyInput) String() string { +func (s GenerateDataKeyPairWithoutPlaintextInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetKeyPolicyInput) GoString() string { +func (s GenerateDataKeyPairWithoutPlaintextInput) 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"} +func (s *GenerateDataKeyPairWithoutPlaintextInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GenerateDataKeyPairWithoutPlaintextInput"} 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 s.KeyPairSpec == nil { + invalidParams.Add(request.NewErrParamRequired("KeyPairSpec")) } if invalidParams.Len() > 0 { @@ -7615,48 +9776,39 @@ func (s *GetKeyPolicyInput) Validate() error { return nil } -// SetKeyId sets the KeyId field's value. -func (s *GetKeyPolicyInput) SetKeyId(v string) *GetKeyPolicyInput { - s.KeyId = &v +// SetEncryptionContext sets the EncryptionContext field's value. +func (s *GenerateDataKeyPairWithoutPlaintextInput) SetEncryptionContext(v map[string]*string) *GenerateDataKeyPairWithoutPlaintextInput { + s.EncryptionContext = v return s } -// SetPolicyName sets the PolicyName field's value. -func (s *GetKeyPolicyInput) SetPolicyName(v string) *GetKeyPolicyInput { - s.PolicyName = &v +// SetGrantTokens sets the GrantTokens field's value. +func (s *GenerateDataKeyPairWithoutPlaintextInput) SetGrantTokens(v []*string) *GenerateDataKeyPairWithoutPlaintextInput { + s.GrantTokens = v return s } -type GetKeyPolicyOutput struct { - _ struct{} `type:"structure"` - - // A key 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() +// SetKeyId sets the KeyId field's value. +func (s *GenerateDataKeyPairWithoutPlaintextInput) SetKeyId(v string) *GenerateDataKeyPairWithoutPlaintextInput { + s.KeyId = &v + return s } -// SetPolicy sets the Policy field's value. -func (s *GetKeyPolicyOutput) SetPolicy(v string) *GetKeyPolicyOutput { - s.Policy = &v +// SetKeyPairSpec sets the KeyPairSpec field's value. +func (s *GenerateDataKeyPairWithoutPlaintextInput) SetKeyPairSpec(v string) *GenerateDataKeyPairWithoutPlaintextInput { + s.KeyPairSpec = &v return s } -type GetKeyRotationStatusInput struct { +type GenerateDataKeyPairWithoutPlaintextOutput struct { _ struct{} `type:"structure"` - // A unique identifier for the customer master key (CMK). + // Specifies the CMK that encrypted the private key in the data key pair. You + // must specify a symmetric CMK. You cannot use an asymmetric CMK. To get the + // type of your CMK, use the DescribeKey operation. // - // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify - // a CMK in a different AWS account, you must use the key ARN. + // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, + // or alias ARN. When using an alias name, prefix it with "alias/". // // For example: // @@ -7664,74 +9816,91 @@ type GetKeyRotationStatusInput struct { // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // - // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. + // * Alias name: alias/ExampleAlias // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` + // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias + // + // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To + // get the alias name and alias ARN, use ListAliases. + KeyId *string `min:"1" type:"string"` + + // The type of data key pair that was generated. + KeyPairSpec *string `type:"string" enum:"DataKeyPairSpec"` + + // The encrypted copy of the private key. When you use the HTTP API or the AWS + // CLI, the value is Base64-encoded. Otherwise, it is not Base64-encoded. + // + // PrivateKeyCiphertextBlob is automatically base64 encoded/decoded by the SDK. + PrivateKeyCiphertextBlob []byte `min:"1" type:"blob"` + + // The public key (in plaintext). + // + // PublicKey is automatically base64 encoded/decoded by the SDK. + PublicKey []byte `min:"1" type:"blob"` } // String returns the string representation -func (s GetKeyRotationStatusInput) String() string { +func (s GenerateDataKeyPairWithoutPlaintextOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetKeyRotationStatusInput) GoString() string { +func (s GenerateDataKeyPairWithoutPlaintextOutput) 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 { +func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetKeyId(v string) *GenerateDataKeyPairWithoutPlaintextOutput { s.KeyId = &v return s } -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) +// SetKeyPairSpec sets the KeyPairSpec field's value. +func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetKeyPairSpec(v string) *GenerateDataKeyPairWithoutPlaintextOutput { + s.KeyPairSpec = &v + return s } -// GoString returns the string representation -func (s GetKeyRotationStatusOutput) GoString() string { - return s.String() +// SetPrivateKeyCiphertextBlob sets the PrivateKeyCiphertextBlob field's value. +func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetPrivateKeyCiphertextBlob(v []byte) *GenerateDataKeyPairWithoutPlaintextOutput { + s.PrivateKeyCiphertextBlob = v + return s } -// SetKeyRotationEnabled sets the KeyRotationEnabled field's value. -func (s *GetKeyRotationStatusOutput) SetKeyRotationEnabled(v bool) *GetKeyRotationStatusOutput { - s.KeyRotationEnabled = &v +// SetPublicKey sets the PublicKey field's value. +func (s *GenerateDataKeyPairWithoutPlaintextOutput) SetPublicKey(v []byte) *GenerateDataKeyPairWithoutPlaintextOutput { + s.PublicKey = v return s } -type GetParametersForImportInput struct { +type GenerateDataKeyWithoutPlaintextInput struct { _ struct{} `type:"structure"` - // The identifier of the CMK into which you will import key material. The CMK's - // Origin must be EXTERNAL. + // Specifies the encryption context that will be used when encrypting the data + // key. // - // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. + // An encryption context is a collection of non-secret key-value pairs that + // represents additional authenticated data. When you use an encryption context + // to encrypt data, you must specify the same (an exact case-sensitive match) + // encryption context to decrypt the data. An encryption context is optional + // when encrypting with a symmetric CMK, but it is highly recommended. + // + // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // 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 (https://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 symmetric customer master key (CMK) that encrypts the + // data key. + // + // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, + // or alias ARN. When using an alias name, prefix it with "alias/". To specify + // a CMK in a different AWS account, you must use the key ARN or alias ARN. // // For example: // @@ -7739,50 +9908,48 @@ type GetParametersForImportInput struct { // // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // - // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. + // * Alias name: alias/ExampleAlias + // + // * Alias ARN: arn:aws:kms:us-east-2:111122223333:alias/ExampleAlias + // + // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To + // get the alias name and alias ARN, use ListAliases. // // 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 - // (https://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 length of the data 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 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"` + // The length of the data 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 GetParametersForImportInput) String() string { +func (s GenerateDataKeyWithoutPlaintextInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetParametersForImportInput) GoString() string { +func (s GenerateDataKeyWithoutPlaintextInput) 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"} +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.WrappingAlgorithm == nil { - invalidParams.Add(request.NewErrParamRequired("WrappingAlgorithm")) - } - if s.WrappingKeySpec == nil { - invalidParams.Add(request.NewErrParamRequired("WrappingKeySpec")) + if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 { + invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1)) } if invalidParams.Len() > 0 { @@ -7791,382 +9958,1739 @@ func (s *GetParametersForImportInput) Validate() error { 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 *GetParametersForImportInput) SetKeyId(v string) *GetParametersForImportInput { +func (s *GenerateDataKeyWithoutPlaintextInput) SetKeyId(v string) *GenerateDataKeyWithoutPlaintextInput { s.KeyId = &v return s } -// SetWrappingAlgorithm sets the WrappingAlgorithm field's value. -func (s *GetParametersForImportInput) SetWrappingAlgorithm(v string) *GetParametersForImportInput { - s.WrappingAlgorithm = &v +// SetKeySpec sets the KeySpec field's value. +func (s *GenerateDataKeyWithoutPlaintextInput) SetKeySpec(v string) *GenerateDataKeyWithoutPlaintextInput { + s.KeySpec = &v return s } -// SetWrappingKeySpec sets the WrappingKeySpec field's value. -func (s *GetParametersForImportInput) SetWrappingKeySpec(v string) *GetParametersForImportInput { - s.WrappingKeySpec = &v +// SetNumberOfBytes sets the NumberOfBytes field's value. +func (s *GenerateDataKeyWithoutPlaintextInput) SetNumberOfBytes(v int64) *GenerateDataKeyWithoutPlaintextInput { + s.NumberOfBytes = &v return s } -type GetParametersForImportOutput struct { +type GenerateDataKeyWithoutPlaintextOutput struct { _ struct{} `type:"structure"` - // The import token to send in a subsequent ImportKeyMaterial request. + // The encrypted data key. When you use the HTTP API or the AWS CLI, the value + // is Base64-encoded. Otherwise, it is not Base64-encoded. // - // ImportToken is automatically base64 encoded/decoded by the SDK. - ImportToken []byte `min:"1" type:"blob"` + // CiphertextBlob is automatically base64 encoded/decoded by the SDK. + CiphertextBlob []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. + // The identifier of the CMK that encrypted the data key. 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 get new ones. - ParametersValidTo *time.Time `type:"timestamp"` - - // 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" sensitive:"true"` } // String returns the string representation -func (s GetParametersForImportOutput) String() string { +func (s GenerateDataKeyWithoutPlaintextOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetParametersForImportOutput) GoString() string { +func (s GenerateDataKeyWithoutPlaintextOutput) GoString() string { return s.String() } -// SetImportToken sets the ImportToken field's value. -func (s *GetParametersForImportOutput) SetImportToken(v []byte) *GetParametersForImportOutput { - s.ImportToken = v +// 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 *GetParametersForImportOutput) SetKeyId(v string) *GetParametersForImportOutput { +func (s *GenerateDataKeyWithoutPlaintextOutput) SetKeyId(v string) *GenerateDataKeyWithoutPlaintextOutput { 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 -} - -// Use this structure to allow cryptographic operations in the grant only when -// the operation request includes the specified encryption context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context). -// -// AWS KMS applies the grant constraints only when the grant allows a cryptographic -// operation that accepts an encryption context as input, such as the following. -// -// * Encrypt -// -// * Decrypt -// -// * GenerateDataKey -// -// * GenerateDataKeyWithoutPlaintext -// -// * ReEncrypt -// -// AWS KMS does not apply the grant constraints to other operations, such as -// DescribeKey or ScheduleKeyDeletion. -// -// In a cryptographic operation, the encryption context in the decryption operation -// must be an exact, case-sensitive match for the keys and values in the encryption -// context of the encryption operation. Only the order of the pairs can vary. -// -// However, in a grant constraint, the key in each key-value pair is not case -// sensitive, but the value is case sensitive. -// -// To avoid confusion, do not use multiple encryption context pairs that differ -// only by case. To require a fully case-sensitive encryption context, use the -// kms:EncryptionContext: and kms:EncryptionContextKeys conditions in an IAM -// or key policy. For details, see kms:EncryptionContext: (https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-context) -// in the AWS Key Management Service Developer Guide . -type GrantConstraints struct { +type GenerateRandomInput struct { _ struct{} `type:"structure"` - // A list of key-value pairs that must match the encryption context in the cryptographic - // operation request. The grant allows the operation only when the encryption - // context in the request is the same as the encryption context specified in - // this constraint. - EncryptionContextEquals map[string]*string `type:"map"` + // Generates the random byte string in the AWS CloudHSM cluster that is associated + // with the specified custom key store (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). + // To find the ID of a custom key store, use the DescribeCustomKeyStores operation. + CustomKeyStoreId *string `min:"1" type:"string"` - // A list of key-value pairs that must be included in the encryption context - // of the cryptographic operation request. The grant allows the cryptographic - // operation only when the encryption context in the request includes the key-value - // pairs specified in this constraint, although it can include additional key-value - // pairs. - EncryptionContextSubset map[string]*string `type:"map"` + // The length of the byte string. + NumberOfBytes *int64 `min:"1" type:"integer"` } // String returns the string representation -func (s GrantConstraints) String() string { +func (s GenerateRandomInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GrantConstraints) GoString() string { +func (s GenerateRandomInput) GoString() string { return s.String() } -// SetEncryptionContextEquals sets the EncryptionContextEquals field's value. -func (s *GrantConstraints) SetEncryptionContextEquals(v map[string]*string) *GrantConstraints { - s.EncryptionContextEquals = v +// 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.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) + } + if s.NumberOfBytes != nil && *s.NumberOfBytes < 1 { + invalidParams.Add(request.NewErrParamMinValue("NumberOfBytes", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCustomKeyStoreId sets the CustomKeyStoreId field's value. +func (s *GenerateRandomInput) SetCustomKeyStoreId(v string) *GenerateRandomInput { + s.CustomKeyStoreId = &v return s } -// SetEncryptionContextSubset sets the EncryptionContextSubset field's value. -func (s *GrantConstraints) SetEncryptionContextSubset(v map[string]*string) *GrantConstraints { - s.EncryptionContextSubset = v +// SetNumberOfBytes sets the NumberOfBytes field's value. +func (s *GenerateRandomInput) SetNumberOfBytes(v int64) *GenerateRandomInput { + s.NumberOfBytes = &v return s } -// Contains information about an entry in a list of grants. -type GrantListEntry struct { +type GenerateRandomOutput struct { _ struct{} `type:"structure"` - // A list of key-value pairs that must be present in the encryption context - // of certain subsequent operations that the grant allows. - Constraints *GrantConstraints `type:"structure"` - - // The date and time when the grant was created. + // The random byte string. When you use the HTTP API or the AWS CLI, the value + // is Base64-encoded. Otherwise, it is not Base64-encoded. + // + // Plaintext is automatically base64 encoded/decoded by the SDK. + Plaintext []byte `min:"1" type:"blob" sensitive:"true"` +} + +// 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 +} + +type GetKeyPolicyInput struct { + _ struct{} `type:"structure"` + + // A unique identifier for the customer master key (CMK). + // + // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. + // + // For example: + // + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + // + // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. + // + // KeyId is a required field + KeyId *string `min:"1" type:"string" required:"true"` + + // Specifies the name of the key policy. The only valid name is default. To + // get the names of key policies, use 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 +} + +type GetKeyPolicyOutput struct { + _ struct{} `type:"structure"` + + // A key 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 +} + +type GetKeyRotationStatusInput struct { + _ struct{} `type:"structure"` + + // A unique identifier for the customer master key (CMK). + // + // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. To specify + // a CMK in a different AWS account, you must use the key ARN. + // + // For example: + // + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + // + // To get the key ID and key ARN for a 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 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 +} + +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 +} + +type GetParametersForImportInput struct { + _ struct{} `type:"structure"` + + // The identifier of the symmetric CMK into which you will import key material. + // The Origin of the CMK must be EXTERNAL. + // + // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. + // + // For example: + // + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + // + // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. + // + // 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 + // (https://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 +} + +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 get new ones. + ParametersValidTo *time.Time `type:"timestamp"` + + // 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" sensitive:"true"` +} + +// 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 +} + +type GetPublicKeyInput struct { + _ struct{} `type:"structure"` + + // A list of grant tokens. + // + // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) + // in the AWS Key Management Service Developer Guide. + GrantTokens []*string `type:"list"` + + // Identifies the asymmetric CMK that includes the public key. + // + // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, + // or alias ARN. When using an alias name, prefix it with "alias/". To specify + // a CMK in a different AWS account, you must use the key ARN or alias ARN. + // + // For example: + // + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key 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 + // + // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To + // get the alias name and alias ARN, use ListAliases. + // + // KeyId is a required field + KeyId *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetPublicKeyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPublicKeyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetPublicKeyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetPublicKeyInput"} + 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 *GetPublicKeyInput) SetGrantTokens(v []*string) *GetPublicKeyInput { + s.GrantTokens = v + return s +} + +// SetKeyId sets the KeyId field's value. +func (s *GetPublicKeyInput) SetKeyId(v string) *GetPublicKeyInput { + s.KeyId = &v + return s +} + +type GetPublicKeyOutput struct { + _ struct{} `type:"structure"` + + // The type of the of the public key that was downloaded. + CustomerMasterKeySpec *string `type:"string" enum:"CustomerMasterKeySpec"` + + // The encryption algorithms that AWS KMS supports for this key. + // + // This information is critical. If a public key encrypts data outside of AWS + // KMS by using an unsupported encryption algorithm, the ciphertext cannot be + // decrypted. + // + // This field appears in the response only when the KeyUsage of the public key + // is ENCRYPT_DECRYPT. + EncryptionAlgorithms []*string `type:"list"` + + // The identifier of the asymmetric CMK from which the public key was downloaded. + KeyId *string `min:"1" type:"string"` + + // The permitted use of the public key. Valid values are ENCRYPT_DECRYPT or + // SIGN_VERIFY. + // + // This information is critical. If a public key with SIGN_VERIFY key usage + // encrypts data outside of AWS KMS, the ciphertext cannot be decrypted. + KeyUsage *string `type:"string" enum:"KeyUsageType"` + + // The exported public key. + // + // The value is a DER-encoded X.509 public key, also known as SubjectPublicKeyInfo + // (SPKI), as defined in RFC 5280 (https://tools.ietf.org/html/rfc5280). When + // you use the HTTP API or the AWS CLI, the value is Base64-encoded. Otherwise, + // it is not Base64-encoded. + // + // PublicKey is automatically base64 encoded/decoded by the SDK. + PublicKey []byte `min:"1" type:"blob"` + + // The signing algorithms that AWS KMS supports for this key. + // + // This field appears in the response only when the KeyUsage of the public key + // is SIGN_VERIFY. + SigningAlgorithms []*string `type:"list"` +} + +// String returns the string representation +func (s GetPublicKeyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPublicKeyOutput) GoString() string { + return s.String() +} + +// SetCustomerMasterKeySpec sets the CustomerMasterKeySpec field's value. +func (s *GetPublicKeyOutput) SetCustomerMasterKeySpec(v string) *GetPublicKeyOutput { + s.CustomerMasterKeySpec = &v + return s +} + +// SetEncryptionAlgorithms sets the EncryptionAlgorithms field's value. +func (s *GetPublicKeyOutput) SetEncryptionAlgorithms(v []*string) *GetPublicKeyOutput { + s.EncryptionAlgorithms = v + return s +} + +// SetKeyId sets the KeyId field's value. +func (s *GetPublicKeyOutput) SetKeyId(v string) *GetPublicKeyOutput { + s.KeyId = &v + return s +} + +// SetKeyUsage sets the KeyUsage field's value. +func (s *GetPublicKeyOutput) SetKeyUsage(v string) *GetPublicKeyOutput { + s.KeyUsage = &v + return s +} + +// SetPublicKey sets the PublicKey field's value. +func (s *GetPublicKeyOutput) SetPublicKey(v []byte) *GetPublicKeyOutput { + s.PublicKey = v + return s +} + +// SetSigningAlgorithms sets the SigningAlgorithms field's value. +func (s *GetPublicKeyOutput) SetSigningAlgorithms(v []*string) *GetPublicKeyOutput { + s.SigningAlgorithms = v + return s +} + +// Use this structure to allow cryptographic operations in the grant only when +// the operation request includes the specified encryption context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context). +// +// AWS KMS applies the grant constraints only when the grant allows a cryptographic +// operation that accepts an encryption context as input, such as the following. +// +// * Encrypt +// +// * Decrypt +// +// * GenerateDataKey +// +// * GenerateDataKeyWithoutPlaintext +// +// * ReEncrypt +// +// AWS KMS does not apply the grant constraints to other operations, such as +// DescribeKey or ScheduleKeyDeletion. +// +// In a cryptographic operation, the encryption context in the decryption operation +// must be an exact, case-sensitive match for the keys and values in the encryption +// context of the encryption operation. Only the order of the pairs can vary. +// +// However, in a grant constraint, the key in each key-value pair is not case +// sensitive, but the value is case sensitive. +// +// To avoid confusion, do not use multiple encryption context pairs that differ +// only by case. To require a fully case-sensitive encryption context, use the +// kms:EncryptionContext: and kms:EncryptionContextKeys conditions in an IAM +// or key policy. For details, see kms:EncryptionContext: (https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-context) +// in the AWS Key Management Service Developer Guide . +type GrantConstraints struct { + _ struct{} `type:"structure"` + + // A list of key-value pairs that must match the encryption context in the cryptographic + // operation request. The grant allows the operation only when the encryption + // context in the request is the same as the encryption context specified in + // this constraint. + EncryptionContextEquals map[string]*string `type:"map"` + + // A list of key-value pairs that must be included in the encryption context + // of the cryptographic operation request. The grant allows the cryptographic + // operation only when the encryption context in the request includes the key-value + // pairs specified in this constraint, although it can include additional key-value + // pairs. + 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. +type GrantListEntry struct { + _ struct{} `type:"structure"` + + // A list of key-value pairs that must be present in the encryption context + // of certain subsequent operations that the grant allows. + Constraints *GrantConstraints `type:"structure"` + + // The date and time when the grant was created. CreationDate *time.Time `type:"timestamp"` - // The unique identifier for the grant. - GrantId *string `min:"1" type:"string"` + // 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 +} + +type ImportKeyMaterialInput struct { + _ struct{} `type:"structure"` + + // The encrypted key material to import. The key material must be encrypted + // with the public wrapping key that GetParametersForImport returned, using + // the wrapping algorithm that you specified in the same GetParametersForImport + // 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 symmetric CMK that receives the imported key material. + // The CMK's Origin must be EXTERNAL. This must be the same CMK specified in + // the KeyID parameter of the corresponding GetParametersForImport request. + // + // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. + // + // For example: + // + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + // + // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. + // + // 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"` +} + +// 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 +} + +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() +} + +// The request was rejected because the specified CMK cannot decrypt the data. +// The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request +// must identify the same CMK that was used to encrypt the ciphertext. +type IncorrectKeyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s IncorrectKeyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IncorrectKeyException) GoString() string { + return s.String() +} + +func newErrorIncorrectKeyException(v protocol.ResponseMetadata) error { + return &IncorrectKeyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IncorrectKeyException) Code() string { + return "IncorrectKeyException" +} + +// Message returns the exception's message. +func (s IncorrectKeyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IncorrectKeyException) OrigErr() error { + return nil +} + +func (s IncorrectKeyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IncorrectKeyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IncorrectKeyException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because the key material in the request is, expired, +// invalid, or is not the same key material that was previously imported into +// this customer master key (CMK). +type IncorrectKeyMaterialException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s IncorrectKeyMaterialException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IncorrectKeyMaterialException) GoString() string { + return s.String() +} + +func newErrorIncorrectKeyMaterialException(v protocol.ResponseMetadata) error { + return &IncorrectKeyMaterialException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IncorrectKeyMaterialException) Code() string { + return "IncorrectKeyMaterialException" +} + +// Message returns the exception's message. +func (s IncorrectKeyMaterialException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IncorrectKeyMaterialException) OrigErr() error { + return nil +} + +func (s IncorrectKeyMaterialException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IncorrectKeyMaterialException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IncorrectKeyMaterialException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because the trust anchor certificate in the request +// is not the trust anchor certificate for the specified AWS CloudHSM cluster. +// +// When you initialize the cluster (https://docs.aws.amazon.com/cloudhsm/latest/userguide/initialize-cluster.html#sign-csr), +// you create the trust anchor certificate and save it in the customerCA.crt +// file. +type IncorrectTrustAnchorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} - // The principal that receives the grant's permissions. - GranteePrincipal *string `min:"1" type:"string"` +// String returns the string representation +func (s IncorrectTrustAnchorException) String() string { + return awsutil.Prettify(s) +} - // The AWS account under which the grant was issued. - IssuingAccount *string `min:"1" type:"string"` +// GoString returns the string representation +func (s IncorrectTrustAnchorException) GoString() string { + return s.String() +} - // The unique identifier for the customer master key (CMK) to which the grant - // applies. - KeyId *string `min:"1" type:"string"` +func newErrorIncorrectTrustAnchorException(v protocol.ResponseMetadata) error { + return &IncorrectTrustAnchorException{ + respMetadata: v, + } +} - // 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"` +// Code returns the exception type name. +func (s IncorrectTrustAnchorException) Code() string { + return "IncorrectTrustAnchorException" +} - // The list of operations permitted by the grant. - Operations []*string `type:"list"` +// Message returns the exception's message. +func (s IncorrectTrustAnchorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The principal that can retire the grant. - RetiringPrincipal *string `min:"1" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IncorrectTrustAnchorException) OrigErr() error { + return nil +} + +func (s IncorrectTrustAnchorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IncorrectTrustAnchorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IncorrectTrustAnchorException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because an internal exception occurred. The request +// can be retried. +type InternalException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s GrantListEntry) String() string { +func (s InternalException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalException) GoString() string { + return s.String() +} + +func newErrorInternalException(v protocol.ResponseMetadata) error { + return &InternalException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalException) Code() string { + return "KMSInternalException" +} + +// Message returns the exception's message. +func (s InternalException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalException) OrigErr() error { + return nil +} + +func (s InternalException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because the specified alias name is not valid. +type InvalidAliasNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidAliasNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidAliasNameException) GoString() string { + return s.String() +} + +func newErrorInvalidAliasNameException(v protocol.ResponseMetadata) error { + return &InvalidAliasNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidAliasNameException) Code() string { + return "InvalidAliasNameException" +} + +// Message returns the exception's message. +func (s InvalidAliasNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAliasNameException) OrigErr() error { + return nil +} + +func (s InvalidAliasNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAliasNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAliasNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because a specified ARN, or an ARN in a key policy, +// is not valid. +type InvalidArnException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidArnException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidArnException) GoString() string { + return s.String() +} + +func newErrorInvalidArnException(v protocol.ResponseMetadata) error { + return &InvalidArnException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidArnException) Code() string { + return "InvalidArnException" +} + +// Message returns the exception's message. +func (s InvalidArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidArnException) OrigErr() error { + return nil +} + +func (s InvalidArnException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidArnException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidArnException) RequestID() string { + return s.respMetadata.RequestID +} + +// From the Decrypt or ReEncrypt operation, the request was rejected because +// the specified ciphertext, or additional authenticated data incorporated into +// the ciphertext, such as the encryption context, is corrupted, missing, or +// otherwise invalid. +// +// From the ImportKeyMaterial operation, the request was rejected because AWS +// KMS could not decrypt the encrypted (wrapped) key material. +type InvalidCiphertextException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidCiphertextException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidCiphertextException) GoString() string { + return s.String() +} + +func newErrorInvalidCiphertextException(v protocol.ResponseMetadata) error { + return &InvalidCiphertextException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidCiphertextException) Code() string { + return "InvalidCiphertextException" +} + +// Message returns the exception's message. +func (s InvalidCiphertextException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidCiphertextException) OrigErr() error { + return nil +} + +func (s InvalidCiphertextException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidCiphertextException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidCiphertextException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because the specified GrantId is not valid. +type InvalidGrantIdException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidGrantIdException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidGrantIdException) GoString() string { + return s.String() +} + +func newErrorInvalidGrantIdException(v protocol.ResponseMetadata) error { + return &InvalidGrantIdException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidGrantIdException) Code() string { + return "InvalidGrantIdException" +} + +// Message returns the exception's message. +func (s InvalidGrantIdException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidGrantIdException) OrigErr() error { + return nil +} + +func (s InvalidGrantIdException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidGrantIdException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidGrantIdException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because the specified grant token is not valid. +type InvalidGrantTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidGrantTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidGrantTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidGrantTokenException(v protocol.ResponseMetadata) error { + return &InvalidGrantTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidGrantTokenException) Code() string { + return "InvalidGrantTokenException" +} + +// Message returns the exception's message. +func (s InvalidGrantTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidGrantTokenException) OrigErr() error { + return nil +} + +func (s InvalidGrantTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidGrantTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidGrantTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because the provided import token is invalid or +// is associated with a different customer master key (CMK). +type InvalidImportTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidImportTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidImportTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidImportTokenException(v protocol.ResponseMetadata) error { + return &InvalidImportTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidImportTokenException) Code() string { + return "InvalidImportTokenException" +} + +// Message returns the exception's message. +func (s InvalidImportTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidImportTokenException) OrigErr() error { + return nil +} + +func (s InvalidImportTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidImportTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidImportTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected for one of the following reasons: +// +// * The KeyUsage value of the CMK is incompatible with the API operation. +// +// * The encryption algorithm or signing algorithm specified for the operation +// is incompatible with the type of key material in the CMK (CustomerMasterKeySpec). +// +// For encrypting, decrypting, re-encrypting, and generating data keys, the +// KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage +// must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation. +// +// To find the encryption or signing algorithms supported for a particular CMK, +// use the DescribeKey operation. +type InvalidKeyUsageException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidKeyUsageException) String() string { return awsutil.Prettify(s) } -// GoString returns the string representation -func (s GrantListEntry) GoString() string { - return s.String() +// GoString returns the string representation +func (s InvalidKeyUsageException) GoString() string { + return s.String() +} + +func newErrorInvalidKeyUsageException(v protocol.ResponseMetadata) error { + return &InvalidKeyUsageException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidKeyUsageException) Code() string { + return "InvalidKeyUsageException" +} + +// Message returns the exception's message. +func (s InvalidKeyUsageException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidKeyUsageException) OrigErr() error { + return nil +} + +func (s InvalidKeyUsageException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetConstraints sets the Constraints field's value. -func (s *GrantListEntry) SetConstraints(v *GrantConstraints) *GrantListEntry { - s.Constraints = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidKeyUsageException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetCreationDate sets the CreationDate field's value. -func (s *GrantListEntry) SetCreationDate(v time.Time) *GrantListEntry { - s.CreationDate = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidKeyUsageException) RequestID() string { + return s.respMetadata.RequestID } -// SetGrantId sets the GrantId field's value. -func (s *GrantListEntry) SetGrantId(v string) *GrantListEntry { - s.GrantId = &v - return s -} +// The request was rejected because the marker that specifies where pagination +// should next begin is not valid. +type InvalidMarkerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata -// SetGranteePrincipal sets the GranteePrincipal field's value. -func (s *GrantListEntry) SetGranteePrincipal(v string) *GrantListEntry { - s.GranteePrincipal = &v - return s + Message_ *string `locationName:"message" type:"string"` } -// SetIssuingAccount sets the IssuingAccount field's value. -func (s *GrantListEntry) SetIssuingAccount(v string) *GrantListEntry { - s.IssuingAccount = &v - return s +// String returns the string representation +func (s InvalidMarkerException) String() string { + return awsutil.Prettify(s) } -// SetKeyId sets the KeyId field's value. -func (s *GrantListEntry) SetKeyId(v string) *GrantListEntry { - s.KeyId = &v - return s +// GoString returns the string representation +func (s InvalidMarkerException) GoString() string { + return s.String() } -// SetName sets the Name field's value. -func (s *GrantListEntry) SetName(v string) *GrantListEntry { - s.Name = &v - return s +func newErrorInvalidMarkerException(v protocol.ResponseMetadata) error { + return &InvalidMarkerException{ + respMetadata: v, + } } -// SetOperations sets the Operations field's value. -func (s *GrantListEntry) SetOperations(v []*string) *GrantListEntry { - s.Operations = v - return s +// Code returns the exception type name. +func (s InvalidMarkerException) Code() string { + return "InvalidMarkerException" } -// SetRetiringPrincipal sets the RetiringPrincipal field's value. -func (s *GrantListEntry) SetRetiringPrincipal(v string) *GrantListEntry { - s.RetiringPrincipal = &v - return s +// Message returns the exception's message. +func (s InvalidMarkerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type ImportKeyMaterialInput struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidMarkerException) OrigErr() error { + return nil +} - // 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"` +func (s InvalidMarkerException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // 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"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidMarkerException) StatusCode() int { + return s.respMetadata.StatusCode +} - // 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"` +// RequestID returns the service's response RequestID for request. +func (s InvalidMarkerException) RequestID() string { + return s.respMetadata.RequestID +} - // The identifier of the CMK to import the key material into. The CMK's Origin - // must be EXTERNAL. - // - // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. - // - // For example: - // - // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. - // - // KeyId is a required field - KeyId *string `min:"1" type:"string" required:"true"` +// 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 (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) +// in the AWS Key Management Service Developer Guide . +type InvalidStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ImportKeyMaterialInput) String() string { +func (s InvalidStateException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ImportKeyMaterialInput) GoString() string { +func (s InvalidStateException) 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)) +func newErrorInvalidStateException(v protocol.ResponseMetadata) error { + return &InvalidStateException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// Code returns the exception type name. +func (s InvalidStateException) Code() string { + return "KMSInvalidStateException" } -// SetEncryptedKeyMaterial sets the EncryptedKeyMaterial field's value. -func (s *ImportKeyMaterialInput) SetEncryptedKeyMaterial(v []byte) *ImportKeyMaterialInput { - s.EncryptedKeyMaterial = v - return s +// Message returns the exception's message. +func (s InvalidStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetExpirationModel sets the ExpirationModel field's value. -func (s *ImportKeyMaterialInput) SetExpirationModel(v string) *ImportKeyMaterialInput { - s.ExpirationModel = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidStateException) OrigErr() error { + return nil } -// SetImportToken sets the ImportToken field's value. -func (s *ImportKeyMaterialInput) SetImportToken(v []byte) *ImportKeyMaterialInput { - s.ImportToken = v - return s +func (s InvalidStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetKeyId sets the KeyId field's value. -func (s *ImportKeyMaterialInput) SetKeyId(v string) *ImportKeyMaterialInput { - s.KeyId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidStateException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetValidTo sets the ValidTo field's value. -func (s *ImportKeyMaterialInput) SetValidTo(v time.Time) *ImportKeyMaterialInput { - s.ValidTo = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidStateException) RequestID() string { + return s.respMetadata.RequestID } -type ImportKeyMaterialOutput struct { - _ struct{} `type:"structure"` +// The request was rejected because the signature verification failed. Signature +// verification fails when it cannot confirm that signature was produced by +// signing the specified message with the specified CMK and signing algorithm. +type KMSInvalidSignatureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ImportKeyMaterialOutput) String() string { +func (s KMSInvalidSignatureException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ImportKeyMaterialOutput) GoString() string { +func (s KMSInvalidSignatureException) GoString() string { return s.String() } +func newErrorKMSInvalidSignatureException(v protocol.ResponseMetadata) error { + return &KMSInvalidSignatureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s KMSInvalidSignatureException) Code() string { + return "KMSInvalidSignatureException" +} + +// Message returns the exception's message. +func (s KMSInvalidSignatureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s KMSInvalidSignatureException) OrigErr() error { + return nil +} + +func (s KMSInvalidSignatureException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s KMSInvalidSignatureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSInvalidSignatureException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains information about each entry in the key list. type KeyListEntry struct { _ struct{} `type:"structure"` @@ -8230,6 +11754,9 @@ type KeyMetadata struct { // in a custom key store. CustomKeyStoreId *string `min:"1" type:"string"` + // Describes the type of key material in the CMK. + CustomerMasterKeySpec *string `type:"string" enum:"CustomerMasterKeySpec"` + // The date and time after which AWS KMS deletes the CMK. This value is present // only when KeyState is PendingDeletion. DeletionDate *time.Time `type:"timestamp"` @@ -8241,6 +11768,12 @@ type KeyMetadata struct { // is true, otherwise it is false. Enabled *bool `type:"boolean"` + // A list of encryption algorithms that the CMK supports. You cannot use the + // CMK with other encryption algorithms within AWS KMS. + // + // This field appears only when the KeyUsage of the CMK is ENCRYPT_DECRYPT. + EncryptionAlgorithms []*string `type:"list"` + // 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"` @@ -8263,9 +11796,7 @@ type KeyMetadata struct { // in the AWS Key Management Service Developer Guide. KeyState *string `type:"string" enum:"KeyState"` - // The cryptographic operations for which you can use the CMK. The only valid - // value is ENCRYPT_DECRYPT, which means you can use the CMK to encrypt and - // decrypt data. + // The cryptographic operations for which you can use the CMK. KeyUsage *string `type:"string" enum:"KeyUsageType"` // The source of the CMK's key material. When this value is AWS_KMS, AWS KMS @@ -8275,6 +11806,12 @@ type KeyMetadata struct { // in the AWS CloudHSM cluster associated with a custom key store. Origin *string `type:"string" enum:"OriginType"` + // A list of signing algorithms that the CMK supports. You cannot use the CMK + // with other signing algorithms within AWS KMS. + // + // This field appears only when the KeyUsage of the CMK is SIGN_VERIFY. + SigningAlgorithms []*string `type:"list"` + // 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 @@ -8322,6 +11859,12 @@ func (s *KeyMetadata) SetCustomKeyStoreId(v string) *KeyMetadata { return s } +// SetCustomerMasterKeySpec sets the CustomerMasterKeySpec field's value. +func (s *KeyMetadata) SetCustomerMasterKeySpec(v string) *KeyMetadata { + s.CustomerMasterKeySpec = &v + return s +} + // SetDeletionDate sets the DeletionDate field's value. func (s *KeyMetadata) SetDeletionDate(v time.Time) *KeyMetadata { s.DeletionDate = &v @@ -8340,46 +11883,173 @@ func (s *KeyMetadata) SetEnabled(v bool) *KeyMetadata { return s } -// SetExpirationModel sets the ExpirationModel field's value. -func (s *KeyMetadata) SetExpirationModel(v string) *KeyMetadata { - s.ExpirationModel = &v - return s +// SetEncryptionAlgorithms sets the EncryptionAlgorithms field's value. +func (s *KeyMetadata) SetEncryptionAlgorithms(v []*string) *KeyMetadata { + s.EncryptionAlgorithms = 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 +} + +// SetKeyManager sets the KeyManager field's value. +func (s *KeyMetadata) SetKeyManager(v string) *KeyMetadata { + s.KeyManager = &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 +} + +// SetSigningAlgorithms sets the SigningAlgorithms field's value. +func (s *KeyMetadata) SetSigningAlgorithms(v []*string) *KeyMetadata { + s.SigningAlgorithms = v + return s +} + +// SetValidTo sets the ValidTo field's value. +func (s *KeyMetadata) SetValidTo(v time.Time) *KeyMetadata { + s.ValidTo = &v + return s +} + +// The request was rejected because the specified CMK was not available. You +// can retry the request. +type KeyUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s KeyUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KeyUnavailableException) GoString() string { + return s.String() +} + +func newErrorKeyUnavailableException(v protocol.ResponseMetadata) error { + return &KeyUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s KeyUnavailableException) Code() string { + return "KeyUnavailableException" +} + +// Message returns the exception's message. +func (s KeyUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s KeyUnavailableException) OrigErr() error { + return nil +} + +func (s KeyUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s KeyUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KeyUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because a quota was exceeded. For more information, +// see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) +// in the AWS Key Management Service Developer Guide. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } } -// SetKeyId sets the KeyId field's value. -func (s *KeyMetadata) SetKeyId(v string) *KeyMetadata { - s.KeyId = &v - return s +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" } -// SetKeyManager sets the KeyManager field's value. -func (s *KeyMetadata) SetKeyManager(v string) *KeyMetadata { - s.KeyManager = &v - return s +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetKeyState sets the KeyState field's value. -func (s *KeyMetadata) SetKeyState(v string) *KeyMetadata { - s.KeyState = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil } -// SetKeyUsage sets the KeyUsage field's value. -func (s *KeyMetadata) SetKeyUsage(v string) *KeyMetadata { - s.KeyUsage = &v - return s +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetOrigin sets the Origin field's value. -func (s *KeyMetadata) SetOrigin(v string) *KeyMetadata { - s.Origin = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetValidTo sets the ValidTo field's value. -func (s *KeyMetadata) SetValidTo(v time.Time) *KeyMetadata { - s.ValidTo = &v - return s +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID } type ListAliasesInput struct { @@ -9067,6 +12737,120 @@ func (s *ListRetirableGrantsInput) SetRetiringPrincipal(v string) *ListRetirable return s } +// The request was rejected because the specified policy is not syntactically +// or semantically correct. +type MalformedPolicyDocumentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s MalformedPolicyDocumentException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MalformedPolicyDocumentException) GoString() string { + return s.String() +} + +func newErrorMalformedPolicyDocumentException(v protocol.ResponseMetadata) error { + return &MalformedPolicyDocumentException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MalformedPolicyDocumentException) Code() string { + return "MalformedPolicyDocumentException" +} + +// Message returns the exception's message. +func (s MalformedPolicyDocumentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MalformedPolicyDocumentException) OrigErr() error { + return nil +} + +func (s MalformedPolicyDocumentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MalformedPolicyDocumentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MalformedPolicyDocumentException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because the specified entity or resource could not +// be found. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + type PutKeyPolicyInput struct { _ struct{} `type:"structure"` @@ -9119,7 +12903,9 @@ type PutKeyPolicyInput struct { // immediately visible (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_eventual-consistency) // in the AWS Identity and Access Management User Guide. // - // The key policy size limit is 32 kilobytes (32768 bytes). + // The key policy cannot exceed 32 kilobytes (32768 bytes). For more information, + // see Resource Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/resource-limits.html) + // in the AWS Key Management Service Developer Guide. // // Policy is a required field Policy *string `min:"1" type:"string" required:"true"` @@ -9216,10 +13002,33 @@ type ReEncryptInput struct { // CiphertextBlob is a required field CiphertextBlob []byte `min:"1" type:"blob" required:"true"` - // Encryption context to use when the data is reencrypted. + // Specifies the encryption algorithm that AWS KMS will use to reecrypt the + // data after it has decrypted it. The default value, SYMMETRIC_DEFAULT, represents + // the encryption algorithm used for symmetric CMKs. + // + // This parameter is required only when the destination CMK is an asymmetric + // CMK. + DestinationEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` + + // Specifies that encryption context to use when the reencrypting the data. + // + // A destination encryption context is valid only when the destination CMK is + // a symmetric CMK. The standard ciphertext format for asymmetric CMKs does + // not include fields for metadata. + // + // An encryption context is a collection of non-secret key-value pairs that + // represents additional authenticated data. When you use an encryption context + // to encrypt data, you must specify the same (an exact case-sensitive match) + // encryption context to decrypt the data. An encryption context is optional + // when encrypting with a symmetric CMK, but it is highly recommended. + // + // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // in the AWS Key Management Service Developer Guide. DestinationEncryptionContext map[string]*string `type:"map"` - // A unique identifier for the CMK that is used to reencrypt the data. + // A unique identifier for the CMK that is used to reencrypt the data. Specify + // a symmetric or asymmetric CMK with a KeyUsage value of ENCRYPT_DECRYPT. To + // find the KeyUsage value of a CMK, use the DescribeKey operation. // // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, // or alias ARN. When using an alias name, prefix it with "alias/". To specify @@ -9247,9 +13056,58 @@ type ReEncryptInput struct { // 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. + // Specifies the encryption algorithm that AWS KMS will use to decrypt the ciphertext + // before it is reencrypted. The default value, SYMMETRIC_DEFAULT, represents + // the algorithm used for symmetric CMKs. + // + // Specify the same algorithm that was used to encrypt the ciphertext. If you + // specify a different algorithm, the decrypt attempt fails. + // + // This parameter is required only when the ciphertext was encrypted under an + // asymmetric CMK. + SourceEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` + + // Specifies the encryption context to use to decrypt the ciphertext. Enter + // the same encryption context that was used to encrypt the ciphertext. + // + // An encryption context is a collection of non-secret key-value pairs that + // represents additional authenticated data. When you use an encryption context + // to encrypt data, you must specify the same (an exact case-sensitive match) + // encryption context to decrypt the data. An encryption context is optional + // when encrypting with a symmetric CMK, but it is highly recommended. + // + // For more information, see Encryption Context (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) + // in the AWS Key Management Service Developer Guide. SourceEncryptionContext map[string]*string `type:"map"` + + // A unique identifier for the CMK that is used to decrypt the ciphertext before + // it reencrypts it using the destination CMK. + // + // This parameter is required only when the ciphertext was encrypted under an + // asymmetric CMK. Otherwise, AWS KMS uses the metadata that it adds to the + // ciphertext blob to determine which CMK was used to encrypt the ciphertext. + // However, you can use this parameter to ensure that a particular CMK (of any + // kind) is used to decrypt the ciphertext before it is reencrypted. + // + // If you specify a KeyId value, the decrypt part of the ReEncrypt operation + // succeeds only if the specified CMK was used to encrypt the ciphertext. + // + // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, + // or alias ARN. When using an alias name, prefix it with "alias/". + // + // For example: + // + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key 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 + // + // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To + // get the alias name and alias ARN, use ListAliases. + SourceKeyId *string `min:"1" type:"string"` } // String returns the string representation @@ -9277,6 +13135,9 @@ func (s *ReEncryptInput) Validate() error { if s.DestinationKeyId != nil && len(*s.DestinationKeyId) < 1 { invalidParams.Add(request.NewErrParamMinLen("DestinationKeyId", 1)) } + if s.SourceKeyId != nil && len(*s.SourceKeyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SourceKeyId", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -9290,6 +13151,12 @@ func (s *ReEncryptInput) SetCiphertextBlob(v []byte) *ReEncryptInput { return s } +// SetDestinationEncryptionAlgorithm sets the DestinationEncryptionAlgorithm field's value. +func (s *ReEncryptInput) SetDestinationEncryptionAlgorithm(v string) *ReEncryptInput { + s.DestinationEncryptionAlgorithm = &v + return s +} + // SetDestinationEncryptionContext sets the DestinationEncryptionContext field's value. func (s *ReEncryptInput) SetDestinationEncryptionContext(v map[string]*string) *ReEncryptInput { s.DestinationEncryptionContext = v @@ -9308,24 +13175,43 @@ func (s *ReEncryptInput) SetGrantTokens(v []*string) *ReEncryptInput { return s } +// SetSourceEncryptionAlgorithm sets the SourceEncryptionAlgorithm field's value. +func (s *ReEncryptInput) SetSourceEncryptionAlgorithm(v string) *ReEncryptInput { + s.SourceEncryptionAlgorithm = &v + return s +} + // SetSourceEncryptionContext sets the SourceEncryptionContext field's value. func (s *ReEncryptInput) SetSourceEncryptionContext(v map[string]*string) *ReEncryptInput { s.SourceEncryptionContext = v return s } +// SetSourceKeyId sets the SourceKeyId field's value. +func (s *ReEncryptInput) SetSourceKeyId(v string) *ReEncryptInput { + s.SourceKeyId = &v + return s +} + type ReEncryptOutput struct { _ struct{} `type:"structure"` // The reencrypted data. When you use the HTTP API or the AWS CLI, the value - // is Base64-encoded. Otherwise, it is not encoded. + // is Base64-encoded. Otherwise, it is not Base64-encoded. // // CiphertextBlob is automatically base64 encoded/decoded by the SDK. CiphertextBlob []byte `min:"1" type:"blob"` + // The encryption algorithm that was used to reencrypt the data. + DestinationEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` + // Unique identifier of the CMK used to reencrypt the data. KeyId *string `min:"1" type:"string"` + // The encryption algorithm that was used to decrypt the ciphertext before it + // was reencrypted. + SourceEncryptionAlgorithm *string `type:"string" enum:"EncryptionAlgorithmSpec"` + // Unique identifier of the CMK used to originally encrypt the data. SourceKeyId *string `min:"1" type:"string"` } @@ -9346,12 +13232,24 @@ func (s *ReEncryptOutput) SetCiphertextBlob(v []byte) *ReEncryptOutput { return s } +// SetDestinationEncryptionAlgorithm sets the DestinationEncryptionAlgorithm field's value. +func (s *ReEncryptOutput) SetDestinationEncryptionAlgorithm(v string) *ReEncryptOutput { + s.DestinationEncryptionAlgorithm = &v + return s +} + // SetKeyId sets the KeyId field's value. func (s *ReEncryptOutput) SetKeyId(v string) *ReEncryptOutput { s.KeyId = &v return s } +// SetSourceEncryptionAlgorithm sets the SourceEncryptionAlgorithm field's value. +func (s *ReEncryptOutput) SetSourceEncryptionAlgorithm(v string) *ReEncryptOutput { + s.SourceEncryptionAlgorithm = &v + return s +} + // SetSourceKeyId sets the SourceKeyId field's value. func (s *ReEncryptOutput) SetSourceKeyId(v string) *ReEncryptOutput { s.SourceKeyId = &v @@ -9576,47 +13474,226 @@ func (s *ScheduleKeyDeletionInput) Validate() error { } // SetKeyId sets the KeyId field's value. -func (s *ScheduleKeyDeletionInput) SetKeyId(v string) *ScheduleKeyDeletionInput { +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 +} + +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"` + + // 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 +} + +type SignInput struct { + _ struct{} `type:"structure"` + + // A list of grant tokens. + // + // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) + // in the AWS Key Management Service Developer Guide. + GrantTokens []*string `type:"list"` + + // Identifies an asymmetric CMK. AWS KMS uses the private key in the asymmetric + // CMK to sign the message. The KeyUsage type of the CMK must be SIGN_VERIFY. + // To find the KeyUsage of a CMK, use the DescribeKey operation. + // + // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, + // or alias ARN. When using an alias name, prefix it with "alias/". To specify + // a CMK in a different AWS account, you must use the key ARN or alias ARN. + // + // For example: + // + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key 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 + // + // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To + // get the alias name and alias ARN, use ListAliases. + // + // KeyId is a required field + KeyId *string `min:"1" type:"string" required:"true"` + + // Specifies the message or message digest to sign. Messages can be 0-4096 bytes. + // To sign a larger message, provide the message digest. + // + // If you provide a message, AWS KMS generates a hash digest of the message + // and then signs it. + // + // Message is automatically base64 encoded/decoded by the SDK. + // + // Message is a required field + Message []byte `min:"1" type:"blob" required:"true" sensitive:"true"` + + // Tells AWS KMS whether the value of the Message parameter is a message or + // message digest. The default value, RAW, indicates a message. To indicate + // a message digest, enter DIGEST. + MessageType *string `type:"string" enum:"MessageType"` + + // Specifies the signing algorithm to use when signing the message. + // + // Choose an algorithm that is compatible with the type and size of the specified + // asymmetric CMK. + // + // SigningAlgorithm is a required field + SigningAlgorithm *string `type:"string" required:"true" enum:"SigningAlgorithmSpec"` +} + +// String returns the string representation +func (s SignInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SignInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SignInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SignInput"} + 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.Message == nil { + invalidParams.Add(request.NewErrParamRequired("Message")) + } + if s.Message != nil && len(s.Message) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Message", 1)) + } + if s.SigningAlgorithm == nil { + invalidParams.Add(request.NewErrParamRequired("SigningAlgorithm")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGrantTokens sets the GrantTokens field's value. +func (s *SignInput) SetGrantTokens(v []*string) *SignInput { + s.GrantTokens = v + return s +} + +// SetKeyId sets the KeyId field's value. +func (s *SignInput) SetKeyId(v string) *SignInput { s.KeyId = &v return s } -// SetPendingWindowInDays sets the PendingWindowInDays field's value. -func (s *ScheduleKeyDeletionInput) SetPendingWindowInDays(v int64) *ScheduleKeyDeletionInput { - s.PendingWindowInDays = &v +// SetMessage sets the Message field's value. +func (s *SignInput) SetMessage(v []byte) *SignInput { + s.Message = v return s } -type ScheduleKeyDeletionOutput struct { - _ struct{} `type:"structure"` +// SetMessageType sets the MessageType field's value. +func (s *SignInput) SetMessageType(v string) *SignInput { + s.MessageType = &v + return s +} - // The date and time after which AWS KMS deletes the customer master key (CMK). - DeletionDate *time.Time `type:"timestamp"` +// SetSigningAlgorithm sets the SigningAlgorithm field's value. +func (s *SignInput) SetSigningAlgorithm(v string) *SignInput { + s.SigningAlgorithm = &v + return s +} - // The unique identifier of the customer master key (CMK) for which deletion - // is scheduled. +type SignOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the asymmetric CMK that was used to sign + // the message. KeyId *string `min:"1" type:"string"` + + // The cryptographic signature that was generated for the message. + // + // * When used with the supported RSA signing algorithms, the encoding of + // this value is defined by PKCS #1 in RFC 8017 (https://tools.ietf.org/html/rfc8017). + // + // * When used with the ECDSA_SHA_256, ECDSA_SHA_384, or ECDSA_SHA_512 signing + // algorithms, this value is a DER-encoded object as defined by ANS X9.62–2005 + // and RFC 3279 Section 2.2.3 (https://tools.ietf.org/html/rfc3279#section-2.2.3). + // This is the most commonly used signature format and is appropriate for + // most uses. + // + // When you use the HTTP API or the AWS CLI, the value is Base64-encoded. Otherwise, + // it is not Base64-encoded. + // + // Signature is automatically base64 encoded/decoded by the SDK. + Signature []byte `min:"1" type:"blob"` + + // The signing algorithm that was used to sign the message. + SigningAlgorithm *string `type:"string" enum:"SigningAlgorithmSpec"` } // String returns the string representation -func (s ScheduleKeyDeletionOutput) String() string { +func (s SignOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ScheduleKeyDeletionOutput) GoString() string { +func (s SignOutput) GoString() string { return s.String() } -// SetDeletionDate sets the DeletionDate field's value. -func (s *ScheduleKeyDeletionOutput) SetDeletionDate(v time.Time) *ScheduleKeyDeletionOutput { - s.DeletionDate = &v +// SetKeyId sets the KeyId field's value. +func (s *SignOutput) SetKeyId(v string) *SignOutput { + s.KeyId = &v return s } -// SetKeyId sets the KeyId field's value. -func (s *ScheduleKeyDeletionOutput) SetKeyId(v string) *ScheduleKeyDeletionOutput { - s.KeyId = &v +// SetSignature sets the Signature field's value. +func (s *SignOutput) SetSignature(v []byte) *SignOutput { + s.Signature = v + return s +} + +// SetSigningAlgorithm sets the SigningAlgorithm field's value. +func (s *SignOutput) SetSigningAlgorithm(v string) *SignOutput { + s.SigningAlgorithm = &v return s } @@ -9681,6 +13758,62 @@ func (s *Tag) SetTagValue(v string) *Tag { return s } +// The request was rejected because one or more tags are not valid. +type TagException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TagException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagException) GoString() string { + return s.String() +} + +func newErrorTagException(v protocol.ResponseMetadata) error { + return &TagException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagException) Code() string { + return "TagException" +} + +// Message returns the exception's message. +func (s TagException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagException) OrigErr() error { + return nil +} + +func (s TagException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagException) RequestID() string { + return s.respMetadata.RequestID +} + type TagResourceInput struct { _ struct{} `type:"structure"` @@ -9770,6 +13903,63 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// The request was rejected because a specified parameter is not supported or +// a specified resource is not valid for this operation. +type UnsupportedOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedOperationException) GoString() string { + return s.String() +} + +func newErrorUnsupportedOperationException(v protocol.ResponseMetadata) error { + return &UnsupportedOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedOperationException) Code() string { + return "UnsupportedOperationException" +} + +// Message returns the exception's message. +func (s UnsupportedOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedOperationException) OrigErr() error { + return nil +} + +func (s UnsupportedOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedOperationException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -9852,14 +14042,19 @@ func (s UntagResourceOutput) GoString() string { type UpdateAliasInput struct { _ struct{} `type:"structure"` - // Specifies the name of the alias to change. This value must begin with alias/ - // followed by the alias name, such as alias/ExampleAlias. + // Identifies the alias that is changing its CMK. This value must begin with + // alias/ followed by the alias name, such as alias/ExampleAlias. You cannot + // use UpdateAlias to change the alias name. // // AliasName is a required field AliasName *string `min:"1" type:"string" required:"true"` - // Unique identifier of the customer master key (CMK) to be mapped to the alias. - // When the update operation completes, the alias will point to this CMK. + // Identifies the CMK to associate with the alias. When the update operation + // completes, the alias will point to this CMK. + // + // The CMK must be in the same AWS account and Region as the alias. Also, the + // new target CMK must be the same type as the current target CMK (both symmetric + // or both asymmetric) and they must have the same key usage. // // Specify the key ID or the Amazon Resource Name (ARN) of the CMK. // @@ -9963,7 +14158,7 @@ type UpdateCustomKeyStoreInput struct { // This parameter tells AWS KMS the current password of the kmsuser crypto user // (CU). It does not set or change the password of any users in the AWS CloudHSM // cluster. - KeyStorePassword *string `min:"1" type:"string" sensitive:"true"` + KeyStorePassword *string `min:"7" type:"string" sensitive:"true"` // Changes the friendly name of the custom key store to the value that you specify. // The custom key store name must be unique in the AWS account. @@ -9992,8 +14187,8 @@ func (s *UpdateCustomKeyStoreInput) Validate() error { if s.CustomKeyStoreId != nil && len(*s.CustomKeyStoreId) < 1 { invalidParams.Add(request.NewErrParamMinLen("CustomKeyStoreId", 1)) } - if s.KeyStorePassword != nil && len(*s.KeyStorePassword) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KeyStorePassword", 1)) + if s.KeyStorePassword != nil && len(*s.KeyStorePassword) < 7 { + invalidParams.Add(request.NewErrParamMinLen("KeyStorePassword", 7)) } if s.NewCustomKeyStoreName != nil && len(*s.NewCustomKeyStoreName) < 1 { invalidParams.Add(request.NewErrParamMinLen("NewCustomKeyStoreName", 1)) @@ -10122,6 +14317,197 @@ func (s UpdateKeyDescriptionOutput) GoString() string { return s.String() } +type VerifyInput struct { + _ struct{} `type:"structure"` + + // A list of grant tokens. + // + // For more information, see Grant Tokens (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#grant_token) + // in the AWS Key Management Service Developer Guide. + GrantTokens []*string `type:"list"` + + // Identifies the asymmetric CMK that will be used to verify the signature. + // This must be the same CMK that was used to generate the signature. If you + // specify a different CMK, the signature verification fails. + // + // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, + // or alias ARN. When using an alias name, prefix it with "alias/". To specify + // a CMK in a different AWS account, you must use the key ARN or alias ARN. + // + // For example: + // + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key 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 + // + // To get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. To + // get the alias name and alias ARN, use ListAliases. + // + // KeyId is a required field + KeyId *string `min:"1" type:"string" required:"true"` + + // Specifies the message that was signed. You can submit a raw message of up + // to 4096 bytes, or a hash digest of the message. If you submit a digest, use + // the MessageType parameter with a value of DIGEST. + // + // If the message specified here is different from the message that was signed, + // the signature verification fails. A message and its hash digest are considered + // to be the same message. + // + // Message is automatically base64 encoded/decoded by the SDK. + // + // Message is a required field + Message []byte `min:"1" type:"blob" required:"true" sensitive:"true"` + + // Tells AWS KMS whether the value of the Message parameter is a message or + // message digest. The default value, RAW, indicates a message. To indicate + // a message digest, enter DIGEST. + // + // Use the DIGEST value only when the value of the Message parameter is a message + // digest. If you use the DIGEST value with a raw message, the security of the + // verification operation can be compromised. + MessageType *string `type:"string" enum:"MessageType"` + + // The signature that the Sign operation generated. + // + // Signature is automatically base64 encoded/decoded by the SDK. + // + // Signature is a required field + Signature []byte `min:"1" type:"blob" required:"true"` + + // The signing algorithm that was used to sign the message. If you submit a + // different algorithm, the signature verification fails. + // + // SigningAlgorithm is a required field + SigningAlgorithm *string `type:"string" required:"true" enum:"SigningAlgorithmSpec"` +} + +// String returns the string representation +func (s VerifyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VerifyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *VerifyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "VerifyInput"} + 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.Message == nil { + invalidParams.Add(request.NewErrParamRequired("Message")) + } + if s.Message != nil && len(s.Message) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Message", 1)) + } + if s.Signature == nil { + invalidParams.Add(request.NewErrParamRequired("Signature")) + } + if s.Signature != nil && len(s.Signature) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Signature", 1)) + } + if s.SigningAlgorithm == nil { + invalidParams.Add(request.NewErrParamRequired("SigningAlgorithm")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGrantTokens sets the GrantTokens field's value. +func (s *VerifyInput) SetGrantTokens(v []*string) *VerifyInput { + s.GrantTokens = v + return s +} + +// SetKeyId sets the KeyId field's value. +func (s *VerifyInput) SetKeyId(v string) *VerifyInput { + s.KeyId = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *VerifyInput) SetMessage(v []byte) *VerifyInput { + s.Message = v + return s +} + +// SetMessageType sets the MessageType field's value. +func (s *VerifyInput) SetMessageType(v string) *VerifyInput { + s.MessageType = &v + return s +} + +// SetSignature sets the Signature field's value. +func (s *VerifyInput) SetSignature(v []byte) *VerifyInput { + s.Signature = v + return s +} + +// SetSigningAlgorithm sets the SigningAlgorithm field's value. +func (s *VerifyInput) SetSigningAlgorithm(v string) *VerifyInput { + s.SigningAlgorithm = &v + return s +} + +type VerifyOutput struct { + _ struct{} `type:"structure"` + + // The unique identifier for the asymmetric CMK that was used to verify the + // signature. + KeyId *string `min:"1" type:"string"` + + // A Boolean value that indicates whether the signature was verified. A value + // of True indicates that the Signature was produced by signing the Message + // with the specified KeyID and SigningAlgorithm. If the signature is not verified, + // the Verify operation fails with a KMSInvalidSignatureException exception. + SignatureValid *bool `type:"boolean"` + + // The signing algorithm that was used to verify the signature. + SigningAlgorithm *string `type:"string" enum:"SigningAlgorithmSpec"` +} + +// String returns the string representation +func (s VerifyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VerifyOutput) GoString() string { + return s.String() +} + +// SetKeyId sets the KeyId field's value. +func (s *VerifyOutput) SetKeyId(v string) *VerifyOutput { + s.KeyId = &v + return s +} + +// SetSignatureValid sets the SignatureValid field's value. +func (s *VerifyOutput) SetSignatureValid(v bool) *VerifyOutput { + s.SignatureValid = &v + return s +} + +// SetSigningAlgorithm sets the SigningAlgorithm field's value. +func (s *VerifyOutput) SetSigningAlgorithm(v string) *VerifyOutput { + s.SigningAlgorithm = &v + return s +} + const ( // AlgorithmSpecRsaesPkcs1V15 is a AlgorithmSpec enum value AlgorithmSpecRsaesPkcs1V15 = "RSAES_PKCS1_V1_5" @@ -10151,6 +14537,15 @@ const ( // ConnectionErrorCodeTypeUserLockedOut is a ConnectionErrorCodeType enum value ConnectionErrorCodeTypeUserLockedOut = "USER_LOCKED_OUT" + + // ConnectionErrorCodeTypeUserNotFound is a ConnectionErrorCodeType enum value + ConnectionErrorCodeTypeUserNotFound = "USER_NOT_FOUND" + + // ConnectionErrorCodeTypeUserLoggedIn is a ConnectionErrorCodeType enum value + ConnectionErrorCodeTypeUserLoggedIn = "USER_LOGGED_IN" + + // ConnectionErrorCodeTypeSubnetNotFound is a ConnectionErrorCodeType enum value + ConnectionErrorCodeTypeSubnetNotFound = "SUBNET_NOT_FOUND" ) const ( @@ -10170,6 +14565,55 @@ const ( ConnectionStateTypeDisconnecting = "DISCONNECTING" ) +const ( + // CustomerMasterKeySpecRsa2048 is a CustomerMasterKeySpec enum value + CustomerMasterKeySpecRsa2048 = "RSA_2048" + + // CustomerMasterKeySpecRsa3072 is a CustomerMasterKeySpec enum value + CustomerMasterKeySpecRsa3072 = "RSA_3072" + + // CustomerMasterKeySpecRsa4096 is a CustomerMasterKeySpec enum value + CustomerMasterKeySpecRsa4096 = "RSA_4096" + + // CustomerMasterKeySpecEccNistP256 is a CustomerMasterKeySpec enum value + CustomerMasterKeySpecEccNistP256 = "ECC_NIST_P256" + + // CustomerMasterKeySpecEccNistP384 is a CustomerMasterKeySpec enum value + CustomerMasterKeySpecEccNistP384 = "ECC_NIST_P384" + + // CustomerMasterKeySpecEccNistP521 is a CustomerMasterKeySpec enum value + CustomerMasterKeySpecEccNistP521 = "ECC_NIST_P521" + + // CustomerMasterKeySpecEccSecgP256k1 is a CustomerMasterKeySpec enum value + CustomerMasterKeySpecEccSecgP256k1 = "ECC_SECG_P256K1" + + // CustomerMasterKeySpecSymmetricDefault is a CustomerMasterKeySpec enum value + CustomerMasterKeySpecSymmetricDefault = "SYMMETRIC_DEFAULT" +) + +const ( + // DataKeyPairSpecRsa2048 is a DataKeyPairSpec enum value + DataKeyPairSpecRsa2048 = "RSA_2048" + + // DataKeyPairSpecRsa3072 is a DataKeyPairSpec enum value + DataKeyPairSpecRsa3072 = "RSA_3072" + + // DataKeyPairSpecRsa4096 is a DataKeyPairSpec enum value + DataKeyPairSpecRsa4096 = "RSA_4096" + + // DataKeyPairSpecEccNistP256 is a DataKeyPairSpec enum value + DataKeyPairSpecEccNistP256 = "ECC_NIST_P256" + + // DataKeyPairSpecEccNistP384 is a DataKeyPairSpec enum value + DataKeyPairSpecEccNistP384 = "ECC_NIST_P384" + + // DataKeyPairSpecEccNistP521 is a DataKeyPairSpec enum value + DataKeyPairSpecEccNistP521 = "ECC_NIST_P521" + + // DataKeyPairSpecEccSecgP256k1 is a DataKeyPairSpec enum value + DataKeyPairSpecEccSecgP256k1 = "ECC_SECG_P256K1" +) + const ( // DataKeySpecAes256 is a DataKeySpec enum value DataKeySpecAes256 = "AES_256" @@ -10178,6 +14622,17 @@ const ( DataKeySpecAes128 = "AES_128" ) +const ( + // EncryptionAlgorithmSpecSymmetricDefault is a EncryptionAlgorithmSpec enum value + EncryptionAlgorithmSpecSymmetricDefault = "SYMMETRIC_DEFAULT" + + // EncryptionAlgorithmSpecRsaesOaepSha1 is a EncryptionAlgorithmSpec enum value + EncryptionAlgorithmSpecRsaesOaepSha1 = "RSAES_OAEP_SHA_1" + + // EncryptionAlgorithmSpecRsaesOaepSha256 is a EncryptionAlgorithmSpec enum value + EncryptionAlgorithmSpecRsaesOaepSha256 = "RSAES_OAEP_SHA_256" +) + const ( // ExpirationModelTypeKeyMaterialExpires is a ExpirationModelType enum value ExpirationModelTypeKeyMaterialExpires = "KEY_MATERIAL_EXPIRES" @@ -10205,6 +14660,15 @@ const ( // GrantOperationReEncryptTo is a GrantOperation enum value GrantOperationReEncryptTo = "ReEncryptTo" + // GrantOperationSign is a GrantOperation enum value + GrantOperationSign = "Sign" + + // GrantOperationVerify is a GrantOperation enum value + GrantOperationVerify = "Verify" + + // GrantOperationGetPublicKey is a GrantOperation enum value + GrantOperationGetPublicKey = "GetPublicKey" + // GrantOperationCreateGrant is a GrantOperation enum value GrantOperationCreateGrant = "CreateGrant" @@ -10213,6 +14677,12 @@ const ( // GrantOperationDescribeKey is a GrantOperation enum value GrantOperationDescribeKey = "DescribeKey" + + // GrantOperationGenerateDataKeyPair is a GrantOperation enum value + GrantOperationGenerateDataKeyPair = "GenerateDataKeyPair" + + // GrantOperationGenerateDataKeyPairWithoutPlaintext is a GrantOperation enum value + GrantOperationGenerateDataKeyPairWithoutPlaintext = "GenerateDataKeyPairWithoutPlaintext" ) const ( @@ -10241,10 +14711,21 @@ const ( ) const ( + // KeyUsageTypeSignVerify is a KeyUsageType enum value + KeyUsageTypeSignVerify = "SIGN_VERIFY" + // KeyUsageTypeEncryptDecrypt is a KeyUsageType enum value KeyUsageTypeEncryptDecrypt = "ENCRYPT_DECRYPT" ) +const ( + // MessageTypeRaw is a MessageType enum value + MessageTypeRaw = "RAW" + + // MessageTypeDigest is a MessageType enum value + MessageTypeDigest = "DIGEST" +) + const ( // OriginTypeAwsKms is a OriginType enum value OriginTypeAwsKms = "AWS_KMS" @@ -10256,6 +14737,35 @@ const ( OriginTypeAwsCloudhsm = "AWS_CLOUDHSM" ) +const ( + // SigningAlgorithmSpecRsassaPssSha256 is a SigningAlgorithmSpec enum value + SigningAlgorithmSpecRsassaPssSha256 = "RSASSA_PSS_SHA_256" + + // SigningAlgorithmSpecRsassaPssSha384 is a SigningAlgorithmSpec enum value + SigningAlgorithmSpecRsassaPssSha384 = "RSASSA_PSS_SHA_384" + + // SigningAlgorithmSpecRsassaPssSha512 is a SigningAlgorithmSpec enum value + SigningAlgorithmSpecRsassaPssSha512 = "RSASSA_PSS_SHA_512" + + // SigningAlgorithmSpecRsassaPkcs1V15Sha256 is a SigningAlgorithmSpec enum value + SigningAlgorithmSpecRsassaPkcs1V15Sha256 = "RSASSA_PKCS1_V1_5_SHA_256" + + // SigningAlgorithmSpecRsassaPkcs1V15Sha384 is a SigningAlgorithmSpec enum value + SigningAlgorithmSpecRsassaPkcs1V15Sha384 = "RSASSA_PKCS1_V1_5_SHA_384" + + // SigningAlgorithmSpecRsassaPkcs1V15Sha512 is a SigningAlgorithmSpec enum value + SigningAlgorithmSpecRsassaPkcs1V15Sha512 = "RSASSA_PKCS1_V1_5_SHA_512" + + // SigningAlgorithmSpecEcdsaSha256 is a SigningAlgorithmSpec enum value + SigningAlgorithmSpecEcdsaSha256 = "ECDSA_SHA_256" + + // SigningAlgorithmSpecEcdsaSha384 is a SigningAlgorithmSpec enum value + SigningAlgorithmSpecEcdsaSha384 = "ECDSA_SHA_384" + + // SigningAlgorithmSpecEcdsaSha512 is a SigningAlgorithmSpec enum value + SigningAlgorithmSpecEcdsaSha512 = "ECDSA_SHA_512" +) + 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 index e8ce42f3b9c..911bf576ebf 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kms/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kms/errors.go @@ -2,6 +2,10 @@ package kms +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAlreadyExistsException for service response error code @@ -156,17 +160,25 @@ const ( // ErrCodeExpiredImportTokenException for service response error code // "ExpiredImportTokenException". // - // The request was rejected because the provided import token is expired. Use + // The request was rejected because the specified import token is expired. Use // GetParametersForImport to get 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" + // ErrCodeIncorrectKeyException for service response error code + // "IncorrectKeyException". + // + // The request was rejected because the specified CMK cannot decrypt the data. + // The KeyId in a Decrypt request and the SourceKeyId in a ReEncrypt request + // must identify the same CMK that was used to encrypt the ciphertext. + ErrCodeIncorrectKeyException = "IncorrectKeyException" + // 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). + // The request was rejected because the key material in the request is, expired, + // invalid, or is not the same key material that was previously imported into + // this customer master key (CMK). ErrCodeIncorrectKeyMaterialException = "IncorrectKeyMaterialException" // ErrCodeIncorrectTrustAnchorException for service response error code @@ -203,9 +215,13 @@ const ( // ErrCodeInvalidCiphertextException for service response error code // "InvalidCiphertextException". // - // The request was rejected because the specified ciphertext, or additional - // authenticated data incorporated into the ciphertext, such as the encryption - // context, is corrupted, missing, or otherwise invalid. + // From the Decrypt or ReEncrypt operation, the request was rejected because + // the specified ciphertext, or additional authenticated data incorporated into + // the ciphertext, such as the encryption context, is corrupted, missing, or + // otherwise invalid. + // + // From the ImportKeyMaterial operation, the request was rejected because AWS + // KMS could not decrypt the encrypted (wrapped) key material. ErrCodeInvalidCiphertextException = "InvalidCiphertextException" // ErrCodeInvalidGrantIdException for service response error code @@ -230,7 +246,19 @@ const ( // ErrCodeInvalidKeyUsageException for service response error code // "InvalidKeyUsageException". // - // The request was rejected because the specified KeySpec value is not valid. + // The request was rejected for one of the following reasons: + // + // * The KeyUsage value of the CMK is incompatible with the API operation. + // + // * The encryption algorithm or signing algorithm specified for the operation + // is incompatible with the type of key material in the CMK (CustomerMasterKeySpec). + // + // For encrypting, decrypting, re-encrypting, and generating data keys, the + // KeyUsage must be ENCRYPT_DECRYPT. For signing and verifying, the KeyUsage + // must be SIGN_VERIFY. To find the KeyUsage of a CMK, use the DescribeKey operation. + // + // To find the encryption or signing algorithms supported for a particular CMK, + // use the DescribeKey operation. ErrCodeInvalidKeyUsageException = "InvalidKeyUsageException" // ErrCodeInvalidMarkerException for service response error code @@ -248,21 +276,29 @@ const ( // // For more information about how key state affects the use of a CMK, see How // Key State Affects Use of a Customer Master Key (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) - // in the AWS Key Management Service Developer Guide. + // in the AWS Key Management Service Developer Guide . ErrCodeInvalidStateException = "KMSInvalidStateException" + // ErrCodeKMSInvalidSignatureException for service response error code + // "KMSInvalidSignatureException". + // + // The request was rejected because the signature verification failed. Signature + // verification fails when it cannot confirm that signature was produced by + // signing the specified message with the specified CMK and signing algorithm. + ErrCodeKMSInvalidSignatureException = "KMSInvalidSignatureException" + // ErrCodeKeyUnavailableException for service response error code // "KeyUnavailableException". // - // The request was rejected because the specified CMK was not available. The - // request can be retried. + // The request was rejected because the specified CMK was not available. You + // can retry the request. ErrCodeKeyUnavailableException = "KeyUnavailableException" // ErrCodeLimitExceededException for service response error code // "LimitExceededException". // - // The request was rejected because a limit was exceeded. For more information, - // see Limits (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) + // The request was rejected because a quota was exceeded. For more information, + // see Quotas (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html) // in the AWS Key Management Service Developer Guide. ErrCodeLimitExceededException = "LimitExceededException" @@ -293,3 +329,39 @@ const ( // a specified resource is not valid for this operation. ErrCodeUnsupportedOperationException = "UnsupportedOperationException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AlreadyExistsException": newErrorAlreadyExistsException, + "CloudHsmClusterInUseException": newErrorCloudHsmClusterInUseException, + "CloudHsmClusterInvalidConfigurationException": newErrorCloudHsmClusterInvalidConfigurationException, + "CloudHsmClusterNotActiveException": newErrorCloudHsmClusterNotActiveException, + "CloudHsmClusterNotFoundException": newErrorCloudHsmClusterNotFoundException, + "CloudHsmClusterNotRelatedException": newErrorCloudHsmClusterNotRelatedException, + "CustomKeyStoreHasCMKsException": newErrorCustomKeyStoreHasCMKsException, + "CustomKeyStoreInvalidStateException": newErrorCustomKeyStoreInvalidStateException, + "CustomKeyStoreNameInUseException": newErrorCustomKeyStoreNameInUseException, + "CustomKeyStoreNotFoundException": newErrorCustomKeyStoreNotFoundException, + "DependencyTimeoutException": newErrorDependencyTimeoutException, + "DisabledException": newErrorDisabledException, + "ExpiredImportTokenException": newErrorExpiredImportTokenException, + "IncorrectKeyException": newErrorIncorrectKeyException, + "IncorrectKeyMaterialException": newErrorIncorrectKeyMaterialException, + "IncorrectTrustAnchorException": newErrorIncorrectTrustAnchorException, + "KMSInternalException": newErrorInternalException, + "InvalidAliasNameException": newErrorInvalidAliasNameException, + "InvalidArnException": newErrorInvalidArnException, + "InvalidCiphertextException": newErrorInvalidCiphertextException, + "InvalidGrantIdException": newErrorInvalidGrantIdException, + "InvalidGrantTokenException": newErrorInvalidGrantTokenException, + "InvalidImportTokenException": newErrorInvalidImportTokenException, + "InvalidKeyUsageException": newErrorInvalidKeyUsageException, + "InvalidMarkerException": newErrorInvalidMarkerException, + "KMSInvalidStateException": newErrorInvalidStateException, + "KMSInvalidSignatureException": newErrorKMSInvalidSignatureException, + "KeyUnavailableException": newErrorKeyUnavailableException, + "LimitExceededException": newErrorLimitExceededException, + "MalformedPolicyDocumentException": newErrorMalformedPolicyDocumentException, + "NotFoundException": newErrorNotFoundException, + "TagException": newErrorTagException, + "UnsupportedOperationException": newErrorUnsupportedOperationException, +} 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 index 6d062f32fc8..50ca0c092e1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/kms/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/kms/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "kms" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "KMS" // ServiceID is a unique identifer of a specific service. + ServiceID = "KMS" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the KMS client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a KMS client from just a session. // svc := kms.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *KMS { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *KMS { svc := &KMS{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2014-11-01", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/lakeformation/api.go b/vendor/github.com/aws/aws-sdk-go/service/lakeformation/api.go index 0a335997810..34a54bd9441 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lakeformation/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lakeformation/api.go @@ -66,11 +66,11 @@ func (c *LakeFormation) BatchGrantPermissionsRequest(input *BatchGrantPermission // See the AWS API reference guide for AWS Lake Formation's // API operation BatchGrantPermissions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/BatchGrantPermissions @@ -148,11 +148,11 @@ func (c *LakeFormation) BatchRevokePermissionsRequest(input *BatchRevokePermissi // See the AWS API reference guide for AWS Lake Formation's // API operation BatchRevokePermissions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/BatchRevokePermissions @@ -234,17 +234,17 @@ func (c *LakeFormation) DeregisterResourceRequest(input *DeregisterResourceInput // See the AWS API reference guide for AWS Lake Formation's // API operation DeregisterResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // // See also, https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/DeregisterResource @@ -323,17 +323,17 @@ func (c *LakeFormation) DescribeResourceRequest(input *DescribeResourceInput) (r // See the AWS API reference guide for AWS Lake Formation's // API operation DescribeResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // // See also, https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/DescribeResource @@ -411,14 +411,14 @@ func (c *LakeFormation) GetDataLakeSettingsRequest(input *GetDataLakeSettingsInp // See the AWS API reference guide for AWS Lake Formation's // API operation GetDataLakeSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // // See also, https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/GetDataLakeSettings @@ -503,17 +503,17 @@ func (c *LakeFormation) GetEffectivePermissionsForPathRequest(input *GetEffectiv // See the AWS API reference guide for AWS Lake Formation's // API operation GetEffectivePermissionsForPath for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/GetEffectivePermissionsForPath @@ -581,10 +581,12 @@ func (c *LakeFormation) GetEffectivePermissionsForPathPagesWithContext(ctx aws.C }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetEffectivePermissionsForPathOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetEffectivePermissionsForPathOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -646,14 +648,14 @@ func (c *LakeFormation) GrantPermissionsRequest(input *GrantPermissionsInput) (r // See the AWS API reference guide for AWS Lake Formation's // API operation GrantPermissions for usage and error information. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// Returned Error Types: +// * ConcurrentModificationException // Two processes are trying to modify a resource simultaneously. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/GrantPermissions @@ -744,14 +746,14 @@ func (c *LakeFormation) ListPermissionsRequest(input *ListPermissionsInput) (req // See the AWS API reference guide for AWS Lake Formation's // API operation ListPermissions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/ListPermissions @@ -819,10 +821,12 @@ func (c *LakeFormation) ListPermissionsPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPermissionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPermissionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -885,14 +889,14 @@ func (c *LakeFormation) ListResourcesRequest(input *ListResourcesInput) (req *re // See the AWS API reference guide for AWS Lake Formation's // API operation ListResources for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/ListResources @@ -960,10 +964,12 @@ func (c *LakeFormation) ListResourcesPagesWithContext(ctx aws.Context, input *Li }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListResourcesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListResourcesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1021,11 +1027,11 @@ func (c *LakeFormation) PutDataLakeSettingsRequest(input *PutDataLakeSettingsInp // See the AWS API reference guide for AWS Lake Formation's // API operation PutDataLakeSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServiceException "InternalServiceException" +// Returned Error Types: +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/PutDataLakeSettings @@ -1113,17 +1119,17 @@ func (c *LakeFormation) RegisterResourceRequest(input *RegisterResourceInput) (r // See the AWS API reference guide for AWS Lake Formation's // API operation RegisterResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeAlreadyExistsException "AlreadyExistsException" +// * AlreadyExistsException // A resource to be created or added already exists. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/RegisterResource @@ -1203,14 +1209,14 @@ func (c *LakeFormation) RevokePermissionsRequest(input *RevokePermissionsInput) // See the AWS API reference guide for AWS Lake Formation's // API operation RevokePermissions for usage and error information. // -// Returned Error Codes: -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// Returned Error Types: +// * ConcurrentModificationException // Two processes are trying to modify a resource simultaneously. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The input provided was not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/RevokePermissions @@ -1290,17 +1296,17 @@ func (c *LakeFormation) UpdateResourceRequest(input *UpdateResourceInput) (req * // See the AWS API reference guide for AWS Lake Formation's // API operation UpdateResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The input provided was not valid. // -// * ErrCodeInternalServiceException "InternalServiceException" +// * InternalServiceException // An internal service error occurred. // -// * ErrCodeOperationTimeoutException "OperationTimeoutException" +// * OperationTimeoutException // The operation timed out. // -// * ErrCodeEntityNotFoundException "EntityNotFoundException" +// * EntityNotFoundException // A specified entity does not exist // // See also, https://docs.aws.amazon.com/goto/WebAPI/lakeformation-2017-03-31/UpdateResource @@ -1325,6 +1331,63 @@ func (c *LakeFormation) UpdateResourceWithContext(ctx aws.Context, input *Update return out, req.Send() } +// A resource to be created or added already exists. +type AlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorAlreadyExistsException(v protocol.ResponseMetadata) error { + return &AlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AlreadyExistsException) Code() string { + return "AlreadyExistsException" +} + +// Message returns the exception's message. +func (s AlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AlreadyExistsException) OrigErr() error { + return nil +} + +func (s AlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + type BatchGrantPermissionsInput struct { _ struct{} `type:"structure"` @@ -1660,6 +1723,63 @@ func (s *ColumnWildcard) SetExcludedColumnNames(v []*string) *ColumnWildcard { return s } +// Two processes are trying to modify a resource simultaneously. +type ConcurrentModificationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentModificationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentModificationException) GoString() string { + return s.String() +} + +func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { + return &ConcurrentModificationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentModificationException) Code() string { + return "ConcurrentModificationException" +} + +// Message returns the exception's message. +func (s ConcurrentModificationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentModificationException) OrigErr() error { + return nil +} + +func (s ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentModificationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentModificationException) RequestID() string { + return s.respMetadata.RequestID +} + // The AWS Lake Formation principal. type DataLakePrincipal struct { _ struct{} `type:"structure"` @@ -1976,6 +2096,63 @@ func (s *DescribeResourceOutput) SetResourceInfo(v *ResourceInfo) *DescribeResou return s } +// A specified entity does not exist +type EntityNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s EntityNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EntityNotFoundException) GoString() string { + return s.String() +} + +func newErrorEntityNotFoundException(v protocol.ResponseMetadata) error { + return &EntityNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EntityNotFoundException) Code() string { + return "EntityNotFoundException" +} + +// Message returns the exception's message. +func (s EntityNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EntityNotFoundException) OrigErr() error { + return nil +} + +func (s EntityNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EntityNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EntityNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains details about an error. type ErrorDetail struct { _ struct{} `type:"structure"` @@ -2349,6 +2526,120 @@ func (s GrantPermissionsOutput) GoString() string { return s.String() } +// An internal service error occurred. +type InternalServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServiceException) GoString() string { + return s.String() +} + +func newErrorInternalServiceException(v protocol.ResponseMetadata) error { + return &InternalServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServiceException) Code() string { + return "InternalServiceException" +} + +// Message returns the exception's message. +func (s InternalServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServiceException) OrigErr() error { + return nil +} + +func (s InternalServiceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServiceException) RequestID() string { + return s.respMetadata.RequestID +} + +// The input provided was not valid. +type InvalidInputException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidInputException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInputException) GoString() string { + return s.String() +} + +func newErrorInvalidInputException(v protocol.ResponseMetadata) error { + return &InvalidInputException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInputException) Code() string { + return "InvalidInputException" +} + +// Message returns the exception's message. +func (s InvalidInputException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInputException) OrigErr() error { + return nil +} + +func (s InvalidInputException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInputException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInputException) RequestID() string { + return s.respMetadata.RequestID +} + type ListPermissionsInput struct { _ struct{} `type:"structure"` @@ -2573,6 +2864,63 @@ func (s *ListResourcesOutput) SetResourceInfoList(v []*ResourceInfo) *ListResour return s } +// The operation timed out. +type OperationTimeoutException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A message describing the problem. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s OperationTimeoutException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OperationTimeoutException) GoString() string { + return s.String() +} + +func newErrorOperationTimeoutException(v protocol.ResponseMetadata) error { + return &OperationTimeoutException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OperationTimeoutException) Code() string { + return "OperationTimeoutException" +} + +// Message returns the exception's message. +func (s OperationTimeoutException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OperationTimeoutException) OrigErr() error { + return nil +} + +func (s OperationTimeoutException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OperationTimeoutException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OperationTimeoutException) RequestID() string { + return s.respMetadata.RequestID +} + // Permissions granted to a principal. type PrincipalPermissions struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/lakeformation/errors.go b/vendor/github.com/aws/aws-sdk-go/service/lakeformation/errors.go index 1bbdaf1289d..959f989d8a3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lakeformation/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lakeformation/errors.go @@ -2,6 +2,10 @@ package lakeformation +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAlreadyExistsException for service response error code @@ -40,3 +44,12 @@ const ( // The operation timed out. ErrCodeOperationTimeoutException = "OperationTimeoutException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AlreadyExistsException": newErrorAlreadyExistsException, + "ConcurrentModificationException": newErrorConcurrentModificationException, + "EntityNotFoundException": newErrorEntityNotFoundException, + "InternalServiceException": newErrorInternalServiceException, + "InvalidInputException": newErrorInvalidInputException, + "OperationTimeoutException": newErrorOperationTimeoutException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/lakeformation/service.go b/vendor/github.com/aws/aws-sdk-go/service/lakeformation/service.go index 495ab0b69bf..4d6e49a18e6 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lakeformation/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lakeformation/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "LakeFormation" // Name of service. EndpointsID = "lakeformation" // ID to lookup a service endpoint with. - ServiceID = "LakeFormation" // ServiceID is a unique identifer of a specific service. + ServiceID = "LakeFormation" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the LakeFormation client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a LakeFormation client from just a session. // svc := lakeformation.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *LakeFormation { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "lakeformation" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *LakeFormation { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *LakeFormation { svc := &LakeFormation{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-03-31", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 4bc2b216989..13531de9260 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lambda/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lambda/api.go @@ -3,6 +3,7 @@ package lambda import ( + "fmt" "io" "time" @@ -73,29 +74,26 @@ func (c *Lambda) AddLayerVersionPermissionRequest(input *AddLayerVersionPermissi // See the AWS API reference guide for AWS Lambda's // API operation AddLayerVersionPermission for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // -// * ErrCodeResourceConflictException "ResourceConflictException" -// The resource already exists. +// * ResourceConflictException +// The resource already exists, or another operation is in progress. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodePolicyLengthExceededException "PolicyLengthExceededException" +// * PolicyLengthExceededException // The permissions policy for the resource is too large. Learn more (https://docs.aws.amazon.com/lambda/latest/dg/limits.html) // -// * ErrCodePreconditionFailedException "PreconditionFailedException" +// * PreconditionFailedException // The RevisionId provided does not match the latest RevisionId for the Lambda // function or alias. Call the GetFunction or the GetAlias API to retrieve the // latest RevisionId for your resource. @@ -180,7 +178,7 @@ func (c *Lambda) AddPermissionRequest(input *AddPermissionInput) (req *request.R // without specifying the source, other accounts could potentially configure // resources in their account to invoke your Lambda function. // -// This action adds a statement to a resource-based permission policy for the +// This action adds a statement to a resource-based permissions policy for the // function. For more information about function policies, see Lambda Function // Policies (https://docs.aws.amazon.com/lambda/latest/dg/access-control-resource-based.html). // @@ -191,29 +189,26 @@ func (c *Lambda) AddPermissionRequest(input *AddPermissionInput) (req *request.R // See the AWS API reference guide for AWS Lambda's // API operation AddPermission for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // -// * ErrCodeResourceConflictException "ResourceConflictException" -// The resource already exists. +// * ResourceConflictException +// The resource already exists, or another operation is in progress. // -// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodePolicyLengthExceededException "PolicyLengthExceededException" +// * PolicyLengthExceededException // The permissions policy for the resource is too large. Learn more (https://docs.aws.amazon.com/lambda/latest/dg/limits.html) // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodePreconditionFailedException "PreconditionFailedException" +// * PreconditionFailedException // The RevisionId provided does not match the latest RevisionId for the Lambda // function or alias. Call the GetFunction or the GetAlias API to retrieve the // latest RevisionId for your resource. @@ -299,24 +294,21 @@ func (c *Lambda) CreateAliasRequest(input *CreateAliasInput) (req *request.Reque // See the AWS API reference guide for AWS Lambda's // API operation CreateAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // -// * ErrCodeResourceConflictException "ResourceConflictException" -// The resource already exists. +// * ResourceConflictException +// The resource already exists, or another operation is in progress. // -// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/CreateAlias func (c *Lambda) CreateAlias(input *CreateAliasInput) (*AliasConfiguration, error) { @@ -389,11 +381,28 @@ func (c *Lambda) CreateEventSourceMappingRequest(input *CreateEventSourceMapping // // For details about each event source type, see the following topics. // +// * Using AWS Lambda with Amazon DynamoDB (https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html) +// // * Using AWS Lambda with Amazon Kinesis (https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html) // // * Using AWS Lambda with Amazon SQS (https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html) // -// * Using AWS Lambda with Amazon DynamoDB (https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html) +// The following error handling options are only available for stream sources +// (DynamoDB and Kinesis): +// +// * BisectBatchOnFunctionError - If the function returns an error, split +// the batch in two and retry. +// +// * DestinationConfig - Send discarded records to an Amazon SQS queue or +// Amazon SNS topic. +// +// * MaximumRecordAgeInSeconds - Discard records older than the specified +// age. +// +// * MaximumRetryAttempts - Discard records after the specified number of +// retries. +// +// * ParallelizationFactor - Process multiple batches from each shard concurrently. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -402,24 +411,21 @@ func (c *Lambda) CreateEventSourceMappingRequest(input *CreateEventSourceMapping // See the AWS API reference guide for AWS Lambda's // API operation CreateEventSourceMapping for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeResourceConflictException "ResourceConflictException" -// The resource already exists. +// * ResourceConflictException +// The resource already exists, or another operation is in progress. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/CreateEventSourceMapping func (c *Lambda) CreateEventSourceMapping(input *CreateEventSourceMappingInput) (*EventSourceMappingConfiguration, error) { @@ -494,6 +500,13 @@ func (c *Lambda) CreateFunctionRequest(input *CreateFunctionInput) (req *request // the function permission to use AWS services, such as Amazon CloudWatch Logs // for log streaming and AWS X-Ray for request tracing. // +// When you create a function, Lambda provisions an instance of the function +// and its supporting resources. If your function connects to a VPC, this process +// can take a minute or so. During this time, you can't invoke or modify the +// function. The State, StateReason, and StateReasonCode fields in the response +// from GetFunctionConfiguration indicate when the function is ready to invoke. +// For more information, see Function States (https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html). +// // A function has an unpublished version, and can have published versions and // aliases. The unpublished version changes when you update your function's // code and configuration. A published version is a snapshot of your function @@ -515,7 +528,7 @@ func (c *Lambda) CreateFunctionRequest(input *CreateFunctionInput) (req *request // To invoke your function directly, use Invoke. To invoke your function in // response to events in other AWS services, create an event source mapping // (CreateEventSourceMapping), or configure a function trigger in the other -// service. For more information, see Invoking Functions (https://docs.aws.amazon.com/lambda/latest/dg/invoking-lambda-functions.html). +// service. For more information, see Invoking Functions (https://docs.aws.amazon.com/lambda/latest/dg/lambda-invocation.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 @@ -524,26 +537,23 @@ func (c *Lambda) CreateFunctionRequest(input *CreateFunctionInput) (req *request // See the AWS API reference guide for AWS Lambda's // API operation CreateFunction for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // -// * ErrCodeResourceConflictException "ResourceConflictException" -// The resource already exists. +// * ResourceConflictException +// The resource already exists, or another operation is in progress. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodeCodeStorageExceededException "CodeStorageExceededException" +// * CodeStorageExceededException // You have exceeded your maximum total code size per account. Learn more (https://docs.aws.amazon.com/lambda/latest/dg/limits.html) // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/CreateFunction @@ -622,17 +632,18 @@ func (c *Lambda) DeleteAliasRequest(input *DeleteAliasInput) (req *request.Reque // See the AWS API reference guide for AWS Lambda's // API operation DeleteAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. +// +// * ResourceConflictException +// The resource already exists, or another operation is in progress. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/DeleteAlias func (c *Lambda) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error) { @@ -703,6 +714,9 @@ func (c *Lambda) DeleteEventSourceMappingRequest(input *DeleteEventSourceMapping // Deletes an event source mapping (https://docs.aws.amazon.com/lambda/latest/dg/intro-invocation-modes.html). // You can get the identifier of a mapping from the output of ListEventSourceMappings. // +// When you delete an event source mapping, it enters a Deleting state and might +// not be completely deleted for several seconds. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -710,23 +724,20 @@ func (c *Lambda) DeleteEventSourceMappingRequest(input *DeleteEventSourceMapping // See the AWS API reference guide for AWS Lambda's // API operation DeleteEventSourceMapping for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The operation conflicts with the resource's availability. For example, you // attempted to update an EventSource Mapping in CREATING, or tried to delete // a EventSource mapping currently in the UPDATING state. @@ -812,24 +823,21 @@ func (c *Lambda) DeleteFunctionRequest(input *DeleteFunctionInput) (req *request // See the AWS API reference guide for AWS Lambda's // API operation DeleteFunction for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeResourceConflictException "ResourceConflictException" -// The resource already exists. +// * ResourceConflictException +// The resource already exists, or another operation is in progress. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/DeleteFunction func (c *Lambda) DeleteFunction(input *DeleteFunctionInput) (*DeleteFunctionOutput, error) { @@ -907,21 +915,21 @@ func (c *Lambda) DeleteFunctionConcurrencyRequest(input *DeleteFunctionConcurren // See the AWS API reference guide for AWS Lambda's // API operation DeleteFunctionConcurrency for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource specified in the request does not exist. +// +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * 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. +// * ResourceConflictException +// The resource already exists, or another operation is in progress. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/DeleteFunctionConcurrency func (c *Lambda) DeleteFunctionConcurrency(input *DeleteFunctionConcurrencyInput) (*DeleteFunctionConcurrencyOutput, error) { @@ -945,6 +953,98 @@ func (c *Lambda) DeleteFunctionConcurrencyWithContext(ctx aws.Context, input *De return out, req.Send() } +const opDeleteFunctionEventInvokeConfig = "DeleteFunctionEventInvokeConfig" + +// DeleteFunctionEventInvokeConfigRequest generates a "aws/request.Request" representing the +// client's request for the DeleteFunctionEventInvokeConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteFunctionEventInvokeConfig for more information on using the DeleteFunctionEventInvokeConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteFunctionEventInvokeConfigRequest method. +// req, resp := client.DeleteFunctionEventInvokeConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/DeleteFunctionEventInvokeConfig +func (c *Lambda) DeleteFunctionEventInvokeConfigRequest(input *DeleteFunctionEventInvokeConfigInput) (req *request.Request, output *DeleteFunctionEventInvokeConfigOutput) { + op := &request.Operation{ + Name: opDeleteFunctionEventInvokeConfig, + HTTPMethod: "DELETE", + HTTPPath: "/2019-09-25/functions/{FunctionName}/event-invoke-config", + } + + if input == nil { + input = &DeleteFunctionEventInvokeConfigInput{} + } + + output = &DeleteFunctionEventInvokeConfigOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteFunctionEventInvokeConfig API operation for AWS Lambda. +// +// Deletes the configuration for asynchronous invocation for a function, version, +// or alias. +// +// To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 DeleteFunctionEventInvokeConfig for usage and error information. +// +// Returned Error Types: +// * ServiceException +// The AWS Lambda service encountered an internal error. +// +// * ResourceNotFoundException +// The resource specified in the request does not exist. +// +// * InvalidParameterValueException +// One of the parameters in the request is invalid. +// +// * TooManyRequestsException +// The request throughput limit was exceeded. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/DeleteFunctionEventInvokeConfig +func (c *Lambda) DeleteFunctionEventInvokeConfig(input *DeleteFunctionEventInvokeConfigInput) (*DeleteFunctionEventInvokeConfigOutput, error) { + req, out := c.DeleteFunctionEventInvokeConfigRequest(input) + return out, req.Send() +} + +// DeleteFunctionEventInvokeConfigWithContext is the same as DeleteFunctionEventInvokeConfig with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteFunctionEventInvokeConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lambda) DeleteFunctionEventInvokeConfigWithContext(ctx aws.Context, input *DeleteFunctionEventInvokeConfigInput, opts ...request.Option) (*DeleteFunctionEventInvokeConfigOutput, error) { + req, out := c.DeleteFunctionEventInvokeConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteLayerVersion = "DeleteLayerVersion" // DeleteLayerVersionRequest generates a "aws/request.Request" representing the @@ -1002,12 +1102,12 @@ func (c *Lambda) DeleteLayerVersionRequest(input *DeleteLayerVersionInput) (req // See the AWS API reference guide for AWS Lambda's // API operation DeleteLayerVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // The AWS Lambda service encountered an internal error. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/DeleteLayerVersion func (c *Lambda) DeleteLayerVersion(input *DeleteLayerVersionInput) (*DeleteLayerVersionOutput, error) { @@ -1031,6 +1131,98 @@ func (c *Lambda) DeleteLayerVersionWithContext(ctx aws.Context, input *DeleteLay return out, req.Send() } +const opDeleteProvisionedConcurrencyConfig = "DeleteProvisionedConcurrencyConfig" + +// DeleteProvisionedConcurrencyConfigRequest generates a "aws/request.Request" representing the +// client's request for the DeleteProvisionedConcurrencyConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteProvisionedConcurrencyConfig for more information on using the DeleteProvisionedConcurrencyConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteProvisionedConcurrencyConfigRequest method. +// req, resp := client.DeleteProvisionedConcurrencyConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig +func (c *Lambda) DeleteProvisionedConcurrencyConfigRequest(input *DeleteProvisionedConcurrencyConfigInput) (req *request.Request, output *DeleteProvisionedConcurrencyConfigOutput) { + op := &request.Operation{ + Name: opDeleteProvisionedConcurrencyConfig, + HTTPMethod: "DELETE", + HTTPPath: "/2019-09-30/functions/{FunctionName}/provisioned-concurrency", + } + + if input == nil { + input = &DeleteProvisionedConcurrencyConfigInput{} + } + + output = &DeleteProvisionedConcurrencyConfigOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteProvisionedConcurrencyConfig API operation for AWS Lambda. +// +// Deletes the provisioned concurrency configuration for a 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 Lambda's +// API operation DeleteProvisionedConcurrencyConfig for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValueException +// One of the parameters in the request is invalid. +// +// * ResourceConflictException +// The resource already exists, or another operation is in progress. +// +// * ResourceNotFoundException +// The resource specified in the request does not exist. +// +// * TooManyRequestsException +// The request throughput limit was exceeded. +// +// * ServiceException +// The AWS Lambda service encountered an internal error. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/DeleteProvisionedConcurrencyConfig +func (c *Lambda) DeleteProvisionedConcurrencyConfig(input *DeleteProvisionedConcurrencyConfigInput) (*DeleteProvisionedConcurrencyConfigOutput, error) { + req, out := c.DeleteProvisionedConcurrencyConfigRequest(input) + return out, req.Send() +} + +// DeleteProvisionedConcurrencyConfigWithContext is the same as DeleteProvisionedConcurrencyConfig with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteProvisionedConcurrencyConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lambda) DeleteProvisionedConcurrencyConfigWithContext(ctx aws.Context, input *DeleteProvisionedConcurrencyConfigInput, opts ...request.Option) (*DeleteProvisionedConcurrencyConfigOutput, error) { + req, out := c.DeleteProvisionedConcurrencyConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetAccountSettings = "GetAccountSettings" // GetAccountSettingsRequest generates a "aws/request.Request" representing the @@ -1085,11 +1277,11 @@ func (c *Lambda) GetAccountSettingsRequest(input *GetAccountSettingsInput) (req // See the AWS API reference guide for AWS Lambda's // API operation GetAccountSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// Returned Error Types: +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // The AWS Lambda service encountered an internal error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetAccountSettings @@ -1167,21 +1359,18 @@ func (c *Lambda) GetAliasRequest(input *GetAliasInput) (req *request.Request, ou // See the AWS API reference guide for AWS Lambda's // API operation GetAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetAlias func (c *Lambda) GetAlias(input *GetAliasInput) (*AliasConfiguration, error) { @@ -1259,21 +1448,18 @@ func (c *Lambda) GetEventSourceMappingRequest(input *GetEventSourceMappingInput) // See the AWS API reference guide for AWS Lambda's // API operation GetEventSourceMapping for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetEventSourceMapping func (c *Lambda) GetEventSourceMapping(input *GetEventSourceMappingInput) (*EventSourceMappingConfiguration, error) { @@ -1352,21 +1538,18 @@ func (c *Lambda) GetFunctionRequest(input *GetFunctionInput) (req *request.Reque // See the AWS API reference guide for AWS Lambda's // API operation GetFunction for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetFunction func (c *Lambda) GetFunction(input *GetFunctionInput) (*GetFunctionOutput, error) { @@ -1390,6 +1573,95 @@ func (c *Lambda) GetFunctionWithContext(ctx aws.Context, input *GetFunctionInput return out, req.Send() } +const opGetFunctionConcurrency = "GetFunctionConcurrency" + +// GetFunctionConcurrencyRequest generates a "aws/request.Request" representing the +// client's request for the GetFunctionConcurrency operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetFunctionConcurrency for more information on using the GetFunctionConcurrency +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetFunctionConcurrencyRequest method. +// req, resp := client.GetFunctionConcurrencyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetFunctionConcurrency +func (c *Lambda) GetFunctionConcurrencyRequest(input *GetFunctionConcurrencyInput) (req *request.Request, output *GetFunctionConcurrencyOutput) { + op := &request.Operation{ + Name: opGetFunctionConcurrency, + HTTPMethod: "GET", + HTTPPath: "/2019-09-30/functions/{FunctionName}/concurrency", + } + + if input == nil { + input = &GetFunctionConcurrencyInput{} + } + + output = &GetFunctionConcurrencyOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetFunctionConcurrency API operation for AWS Lambda. +// +// Returns details about the reserved concurrency configuration for a function. +// To set a concurrency limit for a function, use PutFunctionConcurrency. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 GetFunctionConcurrency for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValueException +// One of the parameters in the request is invalid. +// +// * ResourceNotFoundException +// The resource specified in the request does not exist. +// +// * TooManyRequestsException +// The request throughput limit was exceeded. +// +// * ServiceException +// The AWS Lambda service encountered an internal error. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetFunctionConcurrency +func (c *Lambda) GetFunctionConcurrency(input *GetFunctionConcurrencyInput) (*GetFunctionConcurrencyOutput, error) { + req, out := c.GetFunctionConcurrencyRequest(input) + return out, req.Send() +} + +// GetFunctionConcurrencyWithContext is the same as GetFunctionConcurrency with the addition of +// the ability to pass a context and additional request options. +// +// See GetFunctionConcurrency for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lambda) GetFunctionConcurrencyWithContext(ctx aws.Context, input *GetFunctionConcurrencyInput, opts ...request.Option) (*GetFunctionConcurrencyOutput, error) { + req, out := c.GetFunctionConcurrencyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetFunctionConfiguration = "GetFunctionConfiguration" // GetFunctionConfigurationRequest generates a "aws/request.Request" representing the @@ -1448,21 +1720,18 @@ func (c *Lambda) GetFunctionConfigurationRequest(input *GetFunctionConfiguration // See the AWS API reference guide for AWS Lambda's // API operation GetFunctionConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetFunctionConfiguration func (c *Lambda) GetFunctionConfiguration(input *GetFunctionConfigurationInput) (*FunctionConfiguration, error) { @@ -1486,6 +1755,97 @@ func (c *Lambda) GetFunctionConfigurationWithContext(ctx aws.Context, input *Get return out, req.Send() } +const opGetFunctionEventInvokeConfig = "GetFunctionEventInvokeConfig" + +// GetFunctionEventInvokeConfigRequest generates a "aws/request.Request" representing the +// client's request for the GetFunctionEventInvokeConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetFunctionEventInvokeConfig for more information on using the GetFunctionEventInvokeConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetFunctionEventInvokeConfigRequest method. +// req, resp := client.GetFunctionEventInvokeConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetFunctionEventInvokeConfig +func (c *Lambda) GetFunctionEventInvokeConfigRequest(input *GetFunctionEventInvokeConfigInput) (req *request.Request, output *GetFunctionEventInvokeConfigOutput) { + op := &request.Operation{ + Name: opGetFunctionEventInvokeConfig, + HTTPMethod: "GET", + HTTPPath: "/2019-09-25/functions/{FunctionName}/event-invoke-config", + } + + if input == nil { + input = &GetFunctionEventInvokeConfigInput{} + } + + output = &GetFunctionEventInvokeConfigOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetFunctionEventInvokeConfig API operation for AWS Lambda. +// +// Retrieves the configuration for asynchronous invocation for a function, version, +// or alias. +// +// To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 GetFunctionEventInvokeConfig for usage and error information. +// +// Returned Error Types: +// * ServiceException +// The AWS Lambda service encountered an internal error. +// +// * ResourceNotFoundException +// The resource specified in the request does not exist. +// +// * InvalidParameterValueException +// One of the parameters in the request is invalid. +// +// * TooManyRequestsException +// The request throughput limit was exceeded. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetFunctionEventInvokeConfig +func (c *Lambda) GetFunctionEventInvokeConfig(input *GetFunctionEventInvokeConfigInput) (*GetFunctionEventInvokeConfigOutput, error) { + req, out := c.GetFunctionEventInvokeConfigRequest(input) + return out, req.Send() +} + +// GetFunctionEventInvokeConfigWithContext is the same as GetFunctionEventInvokeConfig with the addition of +// the ability to pass a context and additional request options. +// +// See GetFunctionEventInvokeConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lambda) GetFunctionEventInvokeConfigWithContext(ctx aws.Context, input *GetFunctionEventInvokeConfigInput, opts ...request.Option) (*GetFunctionEventInvokeConfigOutput, error) { + req, out := c.GetFunctionEventInvokeConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetLayerVersion = "GetLayerVersion" // GetLayerVersionRequest generates a "aws/request.Request" representing the @@ -1540,21 +1900,18 @@ func (c *Lambda) GetLayerVersionRequest(input *GetLayerVersionInput) (req *reque // See the AWS API reference guide for AWS Lambda's // API operation GetLayerVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetLayerVersion func (c *Lambda) GetLayerVersion(input *GetLayerVersionInput) (*GetLayerVersionOutput, error) { @@ -1632,21 +1989,18 @@ func (c *Lambda) GetLayerVersionByArnRequest(input *GetLayerVersionByArnInput) ( // See the AWS API reference guide for AWS Lambda's // API operation GetLayerVersionByArn for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetLayerVersionByArn func (c *Lambda) GetLayerVersionByArn(input *GetLayerVersionByArnInput) (*GetLayerVersionByArnOutput, error) { @@ -1724,21 +2078,18 @@ func (c *Lambda) GetLayerVersionPolicyRequest(input *GetLayerVersionPolicyInput) // See the AWS API reference guide for AWS Lambda's // API operation GetLayerVersionPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetLayerVersionPolicy func (c *Lambda) GetLayerVersionPolicy(input *GetLayerVersionPolicyInput) (*GetLayerVersionPolicyOutput, error) { @@ -1816,21 +2167,18 @@ func (c *Lambda) GetPolicyRequest(input *GetPolicyInput) (req *request.Request, // See the AWS API reference guide for AWS Lambda's // API operation GetPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetPolicy func (c *Lambda) GetPolicy(input *GetPolicyInput) (*GetPolicyOutput, error) { @@ -1854,32 +2202,124 @@ func (c *Lambda) GetPolicyWithContext(ctx aws.Context, input *GetPolicyInput, op return out, req.Send() } -const opInvoke = "Invoke" +const opGetProvisionedConcurrencyConfig = "GetProvisionedConcurrencyConfig" -// InvokeRequest generates a "aws/request.Request" representing the -// client's request for the Invoke operation. The "output" return +// GetProvisionedConcurrencyConfigRequest generates a "aws/request.Request" representing the +// client's request for the GetProvisionedConcurrencyConfig operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See Invoke for more information on using the Invoke +// See GetProvisionedConcurrencyConfig for more information on using the GetProvisionedConcurrencyConfig // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the InvokeRequest method. -// req, resp := client.InvokeRequest(params) +// // Example sending a request using the GetProvisionedConcurrencyConfigRequest method. +// req, resp := client.GetProvisionedConcurrencyConfigRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/Invoke +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetProvisionedConcurrencyConfig +func (c *Lambda) GetProvisionedConcurrencyConfigRequest(input *GetProvisionedConcurrencyConfigInput) (req *request.Request, output *GetProvisionedConcurrencyConfigOutput) { + op := &request.Operation{ + Name: opGetProvisionedConcurrencyConfig, + HTTPMethod: "GET", + HTTPPath: "/2019-09-30/functions/{FunctionName}/provisioned-concurrency", + } + + if input == nil { + input = &GetProvisionedConcurrencyConfigInput{} + } + + output = &GetProvisionedConcurrencyConfigOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetProvisionedConcurrencyConfig API operation for AWS Lambda. +// +// Retrieves the provisioned concurrency configuration for a function's alias +// or 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 Lambda's +// API operation GetProvisionedConcurrencyConfig for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValueException +// One of the parameters in the request is invalid. +// +// * ResourceNotFoundException +// The resource specified in the request does not exist. +// +// * TooManyRequestsException +// The request throughput limit was exceeded. +// +// * ServiceException +// The AWS Lambda service encountered an internal error. +// +// * ProvisionedConcurrencyConfigNotFoundException +// The specified configuration does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/GetProvisionedConcurrencyConfig +func (c *Lambda) GetProvisionedConcurrencyConfig(input *GetProvisionedConcurrencyConfigInput) (*GetProvisionedConcurrencyConfigOutput, error) { + req, out := c.GetProvisionedConcurrencyConfigRequest(input) + return out, req.Send() +} + +// GetProvisionedConcurrencyConfigWithContext is the same as GetProvisionedConcurrencyConfig with the addition of +// the ability to pass a context and additional request options. +// +// See GetProvisionedConcurrencyConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lambda) GetProvisionedConcurrencyConfigWithContext(ctx aws.Context, input *GetProvisionedConcurrencyConfigInput, opts ...request.Option) (*GetProvisionedConcurrencyConfigOutput, error) { + req, out := c.GetProvisionedConcurrencyConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opInvoke = "Invoke" + +// InvokeRequest generates a "aws/request.Request" representing the +// client's request for the Invoke operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See Invoke for more information on using the Invoke +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the InvokeRequest method. +// req, resp := client.InvokeRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/Invoke func (c *Lambda) InvokeRequest(input *InvokeInput) (req *request.Request, output *InvokeOutput) { op := &request.Operation{ Name: opInvoke, @@ -1902,12 +2342,11 @@ func (c *Lambda) InvokeRequest(input *InvokeInput) (req *request.Request, output // for the response), or asynchronously. To invoke a function asynchronously, // set InvocationType to Event. // -// For synchronous invocation, details about the function response, including -// errors, are included in the response body and headers. For either invocation -// type, you can find more information in the execution log (https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions.html) -// and trace (https://docs.aws.amazon.com/lambda/latest/dg/dlq.html). To record -// function errors for asynchronous invocations, configure your function with -// a dead letter queue (https://docs.aws.amazon.com/lambda/latest/dg/dlq.html). +// For synchronous invocation (https://docs.aws.amazon.com/lambda/latest/dg/invocation-sync.html), +// details about the function response, including errors, are included in the +// response body and headers. For either invocation type, you can find more +// information in the execution log (https://docs.aws.amazon.com/lambda/latest/dg/monitoring-functions.html) +// and trace (https://docs.aws.amazon.com/lambda/latest/dg/lambda-x-ray.html). // // When an error occurs, your function may be invoked multiple times. Retry // behavior varies by error type, client, event source, and invocation type. @@ -1915,6 +2354,13 @@ func (c *Lambda) InvokeRequest(input *InvokeInput) (req *request.Request, output // Lambda executes the function up to two more times. For more information, // see Retry Behavior (https://docs.aws.amazon.com/lambda/latest/dg/retries-on-errors.html). // +// For asynchronous invocation (https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html), +// Lambda adds events to a queue before sending them to your function. If your +// function does not have enough capacity to keep up with the queue, events +// may be lost. Occasionally, your function may receive the same event multiple +// times, even if no error occurs. To retain events that were not processed, +// configure your function with a dead-letter queue (https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq). +// // The status code in the API response doesn't reflect function errors. Error // codes are reserved for errors that prevent your function from executing, // such as permissions errors, limit errors (https://docs.aws.amazon.com/lambda/latest/dg/limits.html), @@ -1937,81 +2383,85 @@ func (c *Lambda) InvokeRequest(input *InvokeInput) (req *request.Request, output // See the AWS API reference guide for AWS Lambda's // API operation Invoke for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // -// * ErrCodeInvalidRequestContentException "InvalidRequestContentException" +// * InvalidRequestContentException // The request body could not be parsed as JSON. // -// * ErrCodeRequestTooLargeException "RequestTooLargeException" +// * RequestTooLargeException // The request payload exceeded the Invoke request body JSON input limit. For // more information, see Limits (https://docs.aws.amazon.com/lambda/latest/dg/limits.html). // -// * ErrCodeUnsupportedMediaTypeException "UnsupportedMediaTypeException" +// * UnsupportedMediaTypeException // The content type of the Invoke request body is not JSON. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeEC2UnexpectedException "EC2UnexpectedException" +// * EC2UnexpectedException // AWS Lambda received an unexpected EC2 client exception while setting up for // the Lambda function. // -// * ErrCodeSubnetIPAddressLimitReachedException "SubnetIPAddressLimitReachedException" +// * 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. +// * ENILimitReachedException +// AWS Lambda was not able to create an elastic network interface in the VPC, +// specified as part of Lambda function configuration, because the limit for +// network interfaces has been reached. // -// * ErrCodeEC2ThrottledException "EC2ThrottledException" +// * EC2ThrottledException // AWS Lambda was throttled by Amazon EC2 during Lambda function initialization // using the execution role provided for the Lambda function. // -// * ErrCodeEC2AccessDeniedException "EC2AccessDeniedException" +// * EC2AccessDeniedException // Need additional permissions to configure VPC settings. // -// * ErrCodeInvalidSubnetIDException "InvalidSubnetIDException" +// * InvalidSubnetIDException // The Subnet ID provided in the Lambda function VPC configuration is invalid. // -// * ErrCodeInvalidSecurityGroupIDException "InvalidSecurityGroupIDException" +// * InvalidSecurityGroupIDException // The Security Group ID provided in the Lambda function VPC configuration is // invalid. // -// * ErrCodeInvalidZipFileException "InvalidZipFileException" +// * InvalidZipFileException // AWS Lambda could not unzip the deployment package. // -// * ErrCodeKMSDisabledException "KMSDisabledException" +// * 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" +// * 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" +// * KMSAccessDeniedException // Lambda was unable to decrypt the environment variables because KMS access // was denied. Check the Lambda function's KMS permissions. // -// * ErrCodeKMSNotFoundException "KMSNotFoundException" +// * KMSNotFoundException // Lambda was unable to decrypt the environment variables because the KMS key // was not found. Check the function's KMS key settings. // -// * ErrCodeInvalidRuntimeException "InvalidRuntimeException" +// * InvalidRuntimeException // The runtime or runtime version specified is not supported. // +// * ResourceConflictException +// The resource already exists, or another operation is in progress. +// +// * ResourceNotReadyException +// The function is inactive and its VPC connection is no longer available. Wait +// for the VPC connection to reestablish and try again. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/Invoke func (c *Lambda) Invoke(input *InvokeInput) (*InvokeOutput, error) { req, out := c.InvokeRequest(input) @@ -2095,20 +2545,22 @@ func (c *Lambda) InvokeAsyncRequest(input *InvokeAsyncInput) (req *request.Reque // See the AWS API reference guide for AWS Lambda's // API operation InvokeAsync for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // -// * ErrCodeInvalidRequestContentException "InvalidRequestContentException" +// * InvalidRequestContentException // The request body could not be parsed as JSON. // -// * ErrCodeInvalidRuntimeException "InvalidRuntimeException" +// * InvalidRuntimeException // The runtime or runtime version specified is not supported. // +// * ResourceConflictException +// The resource already exists, or another operation is in progress. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/InvokeAsync // // Deprecated: InvokeAsync has been deprecated @@ -2195,21 +2647,18 @@ func (c *Lambda) ListAliasesRequest(input *ListAliasesInput) (req *request.Reque // See the AWS API reference guide for AWS Lambda's // API operation ListAliases for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListAliases func (c *Lambda) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error) { @@ -2276,10 +2725,12 @@ func (c *Lambda) ListAliasesPagesWithContext(ctx aws.Context, input *ListAliases }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAliasesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAliasesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2343,21 +2794,18 @@ func (c *Lambda) ListEventSourceMappingsRequest(input *ListEventSourceMappingsIn // See the AWS API reference guide for AWS Lambda's // API operation ListEventSourceMappings for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListEventSourceMappings func (c *Lambda) ListEventSourceMappings(input *ListEventSourceMappingsInput) (*ListEventSourceMappingsOutput, error) { @@ -2424,10 +2872,160 @@ func (c *Lambda) ListEventSourceMappingsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEventSourceMappingsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListEventSourceMappingsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListFunctionEventInvokeConfigs = "ListFunctionEventInvokeConfigs" + +// ListFunctionEventInvokeConfigsRequest generates a "aws/request.Request" representing the +// client's request for the ListFunctionEventInvokeConfigs operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListFunctionEventInvokeConfigs for more information on using the ListFunctionEventInvokeConfigs +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListFunctionEventInvokeConfigsRequest method. +// req, resp := client.ListFunctionEventInvokeConfigsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListFunctionEventInvokeConfigs +func (c *Lambda) ListFunctionEventInvokeConfigsRequest(input *ListFunctionEventInvokeConfigsInput) (req *request.Request, output *ListFunctionEventInvokeConfigsOutput) { + op := &request.Operation{ + Name: opListFunctionEventInvokeConfigs, + HTTPMethod: "GET", + HTTPPath: "/2019-09-25/functions/{FunctionName}/event-invoke-config/list", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"NextMarker"}, + LimitToken: "MaxItems", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListFunctionEventInvokeConfigsInput{} + } + + output = &ListFunctionEventInvokeConfigsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListFunctionEventInvokeConfigs API operation for AWS Lambda. +// +// Retrieves a list of configurations for asynchronous invocation for a function. +// +// To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 ListFunctionEventInvokeConfigs for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValueException +// One of the parameters in the request is invalid. +// +// * ResourceNotFoundException +// The resource specified in the request does not exist. +// +// * TooManyRequestsException +// The request throughput limit was exceeded. +// +// * ServiceException +// The AWS Lambda service encountered an internal error. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListFunctionEventInvokeConfigs +func (c *Lambda) ListFunctionEventInvokeConfigs(input *ListFunctionEventInvokeConfigsInput) (*ListFunctionEventInvokeConfigsOutput, error) { + req, out := c.ListFunctionEventInvokeConfigsRequest(input) + return out, req.Send() +} + +// ListFunctionEventInvokeConfigsWithContext is the same as ListFunctionEventInvokeConfigs with the addition of +// the ability to pass a context and additional request options. +// +// See ListFunctionEventInvokeConfigs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lambda) ListFunctionEventInvokeConfigsWithContext(ctx aws.Context, input *ListFunctionEventInvokeConfigsInput, opts ...request.Option) (*ListFunctionEventInvokeConfigsOutput, error) { + req, out := c.ListFunctionEventInvokeConfigsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListFunctionEventInvokeConfigsPages iterates over the pages of a ListFunctionEventInvokeConfigs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListFunctionEventInvokeConfigs 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 ListFunctionEventInvokeConfigs operation. +// pageNum := 0 +// err := client.ListFunctionEventInvokeConfigsPages(params, +// func(page *lambda.ListFunctionEventInvokeConfigsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Lambda) ListFunctionEventInvokeConfigsPages(input *ListFunctionEventInvokeConfigsInput, fn func(*ListFunctionEventInvokeConfigsOutput, bool) bool) error { + return c.ListFunctionEventInvokeConfigsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListFunctionEventInvokeConfigsPagesWithContext same as ListFunctionEventInvokeConfigsPages 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 *Lambda) ListFunctionEventInvokeConfigsPagesWithContext(ctx aws.Context, input *ListFunctionEventInvokeConfigsInput, fn func(*ListFunctionEventInvokeConfigsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListFunctionEventInvokeConfigsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListFunctionEventInvokeConfigsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListFunctionEventInvokeConfigsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2482,7 +3080,7 @@ func (c *Lambda) ListFunctionsRequest(input *ListFunctionsInput) (req *request.R // ListFunctions API operation for AWS Lambda. // // Returns a list of Lambda functions, with the version-specific configuration -// of each. +// of each. Lambda returns up to 50 functions per call. // // Set FunctionVersion to ALL to include all published versions of each function // in addition to the unpublished version. To get more information about a function @@ -2495,17 +3093,15 @@ func (c *Lambda) ListFunctionsRequest(input *ListFunctionsInput) (req *request.R // See the AWS API reference guide for AWS Lambda's // API operation ListFunctions for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // The AWS Lambda service encountered an internal error. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListFunctions func (c *Lambda) ListFunctions(input *ListFunctionsInput) (*ListFunctionsOutput, error) { @@ -2572,10 +3168,12 @@ func (c *Lambda) ListFunctionsPagesWithContext(ctx aws.Context, input *ListFunct }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListFunctionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListFunctionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2641,21 +3239,18 @@ func (c *Lambda) ListLayerVersionsRequest(input *ListLayerVersionsInput) (req *r // See the AWS API reference guide for AWS Lambda's // API operation ListLayerVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListLayerVersions func (c *Lambda) ListLayerVersions(input *ListLayerVersionsInput) (*ListLayerVersionsOutput, error) { @@ -2722,10 +3317,12 @@ func (c *Lambda) ListLayerVersionsPagesWithContext(ctx aws.Context, input *ListL }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListLayerVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListLayerVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2791,17 +3388,15 @@ func (c *Lambda) ListLayersRequest(input *ListLayersInput) (req *request.Request // See the AWS API reference guide for AWS Lambda's // API operation ListLayers for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListLayers func (c *Lambda) ListLayers(input *ListLayersInput) (*ListLayersOutput, error) { @@ -2868,141 +3463,286 @@ func (c *Lambda) ListLayersPagesWithContext(ctx aws.Context, input *ListLayersIn }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListLayersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListLayersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opListTags = "ListTags" +const opListProvisionedConcurrencyConfigs = "ListProvisionedConcurrencyConfigs" -// ListTagsRequest generates a "aws/request.Request" representing the -// client's request for the ListTags operation. The "output" return +// ListProvisionedConcurrencyConfigsRequest generates a "aws/request.Request" representing the +// client's request for the ListProvisionedConcurrencyConfigs operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListTags for more information on using the ListTags +// See ListProvisionedConcurrencyConfigs for more information on using the ListProvisionedConcurrencyConfigs // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListTagsRequest method. -// req, resp := client.ListTagsRequest(params) +// // Example sending a request using the ListProvisionedConcurrencyConfigsRequest method. +// req, resp := client.ListProvisionedConcurrencyConfigsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListTags -func (c *Lambda) ListTagsRequest(input *ListTagsInput) (req *request.Request, output *ListTagsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListProvisionedConcurrencyConfigs +func (c *Lambda) ListProvisionedConcurrencyConfigsRequest(input *ListProvisionedConcurrencyConfigsInput) (req *request.Request, output *ListProvisionedConcurrencyConfigsOutput) { op := &request.Operation{ - Name: opListTags, + Name: opListProvisionedConcurrencyConfigs, HTTPMethod: "GET", - HTTPPath: "/2017-03-31/tags/{ARN}", + HTTPPath: "/2019-09-30/functions/{FunctionName}/provisioned-concurrency?List=ALL", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"NextMarker"}, + LimitToken: "MaxItems", + TruncationToken: "", + }, } if input == nil { - input = &ListTagsInput{} + input = &ListProvisionedConcurrencyConfigsInput{} } - output = &ListTagsOutput{} + output = &ListProvisionedConcurrencyConfigsOutput{} req = c.newRequest(op, input, output) return } -// ListTags API operation for AWS Lambda. +// ListProvisionedConcurrencyConfigs API operation for AWS Lambda. // -// Returns a function's tags (https://docs.aws.amazon.com/lambda/latest/dg/tagging.html). -// You can also view tags with GetFunction. +// Retrieves a list of provisioned concurrency configurations for a 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 Lambda's -// API operation ListTags for usage and error information. +// API operation ListProvisionedConcurrencyConfigs for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. +// Returned Error Types: +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. +// * ResourceNotFoundException +// The resource 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. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * ServiceException +// The AWS Lambda service encountered an internal error. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListTags -func (c *Lambda) ListTags(input *ListTagsInput) (*ListTagsOutput, error) { - req, out := c.ListTagsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListProvisionedConcurrencyConfigs +func (c *Lambda) ListProvisionedConcurrencyConfigs(input *ListProvisionedConcurrencyConfigsInput) (*ListProvisionedConcurrencyConfigsOutput, error) { + req, out := c.ListProvisionedConcurrencyConfigsRequest(input) return out, req.Send() } -// ListTagsWithContext is the same as ListTags with the addition of +// ListProvisionedConcurrencyConfigsWithContext is the same as ListProvisionedConcurrencyConfigs with the addition of // the ability to pass a context and additional request options. // -// See ListTags for details on how to use this API operation. +// See ListProvisionedConcurrencyConfigs for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Lambda) ListTagsWithContext(ctx aws.Context, input *ListTagsInput, opts ...request.Option) (*ListTagsOutput, error) { - req, out := c.ListTagsRequest(input) +func (c *Lambda) ListProvisionedConcurrencyConfigsWithContext(ctx aws.Context, input *ListProvisionedConcurrencyConfigsInput, opts ...request.Option) (*ListProvisionedConcurrencyConfigsOutput, error) { + req, out := c.ListProvisionedConcurrencyConfigsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListVersionsByFunction = "ListVersionsByFunction" - -// ListVersionsByFunctionRequest generates a "aws/request.Request" representing the -// client's request for the ListVersionsByFunction operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListVersionsByFunction for more information on using the ListVersionsByFunction -// API call, and error handling. +// ListProvisionedConcurrencyConfigsPages iterates over the pages of a ListProvisionedConcurrencyConfigs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. // -// 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. +// See ListProvisionedConcurrencyConfigs method for more information on how to use this operation. // +// Note: This operation can generate multiple requests to a service. // -// // Example sending a request using the ListVersionsByFunctionRequest method. -// req, resp := client.ListVersionsByFunctionRequest(params) +// // Example iterating over at most 3 pages of a ListProvisionedConcurrencyConfigs operation. +// pageNum := 0 +// err := client.ListProvisionedConcurrencyConfigsPages(params, +// func(page *lambda.ListProvisionedConcurrencyConfigsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) // -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } +func (c *Lambda) ListProvisionedConcurrencyConfigsPages(input *ListProvisionedConcurrencyConfigsInput, fn func(*ListProvisionedConcurrencyConfigsOutput, bool) bool) error { + return c.ListProvisionedConcurrencyConfigsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListProvisionedConcurrencyConfigsPagesWithContext same as ListProvisionedConcurrencyConfigsPages except +// it takes a Context and allows setting request options on the pages. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListVersionsByFunction -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", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker"}, - LimitToken: "MaxItems", - TruncationToken: "", +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lambda) ListProvisionedConcurrencyConfigsPagesWithContext(ctx aws.Context, input *ListProvisionedConcurrencyConfigsInput, fn func(*ListProvisionedConcurrencyConfigsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListProvisionedConcurrencyConfigsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListProvisionedConcurrencyConfigsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListProvisionedConcurrencyConfigsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTags = "ListTags" + +// ListTagsRequest generates a "aws/request.Request" representing the +// client's request for the ListTags operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTags for more information on using the ListTags +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsRequest method. +// req, resp := client.ListTagsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListTags +func (c *Lambda) ListTagsRequest(input *ListTagsInput) (req *request.Request, output *ListTagsOutput) { + op := &request.Operation{ + Name: opListTags, + HTTPMethod: "GET", + HTTPPath: "/2017-03-31/tags/{ARN}", + } + + if input == nil { + input = &ListTagsInput{} + } + + output = &ListTagsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTags API operation for AWS Lambda. +// +// Returns a function's tags (https://docs.aws.amazon.com/lambda/latest/dg/tagging.html). +// You can also view tags with GetFunction. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 ListTags for usage and error information. +// +// Returned Error Types: +// * ServiceException +// The AWS Lambda service encountered an internal error. +// +// * ResourceNotFoundException +// The resource specified in the request does not exist. +// +// * InvalidParameterValueException +// One of the parameters in the request is invalid. +// +// * TooManyRequestsException +// The request throughput limit was exceeded. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListTags +func (c *Lambda) ListTags(input *ListTagsInput) (*ListTagsOutput, error) { + req, out := c.ListTagsRequest(input) + return out, req.Send() +} + +// ListTagsWithContext is the same as ListTags with the addition of +// the ability to pass a context and additional request options. +// +// See ListTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lambda) ListTagsWithContext(ctx aws.Context, input *ListTagsInput, opts ...request.Option) (*ListTagsOutput, error) { + req, out := c.ListTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListVersionsByFunction = "ListVersionsByFunction" + +// ListVersionsByFunctionRequest generates a "aws/request.Request" representing the +// client's request for the ListVersionsByFunction operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListVersionsByFunction for more information on using the ListVersionsByFunction +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListVersionsByFunctionRequest method. +// req, resp := client.ListVersionsByFunctionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListVersionsByFunction +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", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"NextMarker"}, + LimitToken: "MaxItems", + TruncationToken: "", }, } @@ -3018,7 +3758,8 @@ func (c *Lambda) ListVersionsByFunctionRequest(input *ListVersionsByFunctionInpu // ListVersionsByFunction API operation for AWS Lambda. // // Returns a list of versions (https://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html), -// with the version-specific configuration of each. +// with the version-specific configuration of each. Lambda returns up to 50 +// versions per 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 @@ -3027,21 +3768,18 @@ func (c *Lambda) ListVersionsByFunctionRequest(input *ListVersionsByFunctionInpu // See the AWS API reference guide for AWS Lambda's // API operation ListVersionsByFunction for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/ListVersionsByFunction func (c *Lambda) ListVersionsByFunction(input *ListVersionsByFunctionInput) (*ListVersionsByFunctionOutput, error) { @@ -3108,10 +3846,12 @@ func (c *Lambda) ListVersionsByFunctionPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListVersionsByFunctionOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListVersionsByFunctionOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3161,7 +3901,7 @@ func (c *Lambda) PublishLayerVersionRequest(input *PublishLayerVersionInput) (re // // Creates an AWS Lambda layer (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) // from a ZIP archive. Each time you call PublishLayerVersion with the same -// version name, a new version is created. +// layer name, a new version is created. // // Add layers to your function with CreateFunction or UpdateFunctionConfiguration. // @@ -3172,23 +3912,20 @@ func (c *Lambda) PublishLayerVersionRequest(input *PublishLayerVersionInput) (re // See the AWS API reference guide for AWS Lambda's // API operation PublishLayerVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeCodeStorageExceededException "CodeStorageExceededException" +// * CodeStorageExceededException // You have exceeded your maximum total code size per account. Learn more (https://docs.aws.amazon.com/lambda/latest/dg/limits.html) // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/PublishLayerVersion @@ -3275,30 +4012,30 @@ func (c *Lambda) PublishVersionRequest(input *PublishVersionInput) (req *request // See the AWS API reference guide for AWS Lambda's // API operation PublishVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodeCodeStorageExceededException "CodeStorageExceededException" +// * CodeStorageExceededException // You have exceeded your maximum total code size per account. Learn more (https://docs.aws.amazon.com/lambda/latest/dg/limits.html) // -// * ErrCodePreconditionFailedException "PreconditionFailedException" +// * PreconditionFailedException // The RevisionId provided does not match the latest RevisionId for the Lambda // function or alias. Call the GetFunction or the GetAlias API to retrieve the // latest RevisionId for your resource. // +// * ResourceConflictException +// The resource already exists, or another operation is in progress. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/PublishVersion func (c *Lambda) PublishVersion(input *PublishVersionInput) (*FunctionConfiguration, error) { req, out := c.PublishVersionRequest(input) @@ -3374,7 +4111,7 @@ func (c *Lambda) PutFunctionConcurrencyRequest(input *PutFunctionConcurrencyInpu // simultaneously, and prevents it from scaling beyond that level. Use GetFunction // to see the current setting for a function. // -// Use GetAccountSettings to see your regional concurrency limit. You can reserve +// Use GetAccountSettings to see your Regional concurrency limit. You can reserve // concurrency for as many functions as you like, as long as you leave at least // 100 simultaneous executions unreserved for functions that aren't configured // with a per-function limit. For more information, see Managing Concurrency @@ -3387,21 +4124,21 @@ func (c *Lambda) PutFunctionConcurrencyRequest(input *PutFunctionConcurrencyInpu // See the AWS API reference guide for AWS Lambda's // API operation PutFunctionConcurrency for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. +// +// * ResourceConflictException +// The resource already exists, or another operation is in progress. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/PutFunctionConcurrency func (c *Lambda) PutFunctionConcurrency(input *PutFunctionConcurrencyInput) (*PutFunctionConcurrencyOutput, error) { @@ -3425,284 +4162,473 @@ func (c *Lambda) PutFunctionConcurrencyWithContext(ctx aws.Context, input *PutFu return out, req.Send() } -const opRemoveLayerVersionPermission = "RemoveLayerVersionPermission" +const opPutFunctionEventInvokeConfig = "PutFunctionEventInvokeConfig" -// RemoveLayerVersionPermissionRequest generates a "aws/request.Request" representing the -// client's request for the RemoveLayerVersionPermission operation. The "output" return +// PutFunctionEventInvokeConfigRequest generates a "aws/request.Request" representing the +// client's request for the PutFunctionEventInvokeConfig operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RemoveLayerVersionPermission for more information on using the RemoveLayerVersionPermission +// See PutFunctionEventInvokeConfig for more information on using the PutFunctionEventInvokeConfig // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RemoveLayerVersionPermissionRequest method. -// req, resp := client.RemoveLayerVersionPermissionRequest(params) +// // Example sending a request using the PutFunctionEventInvokeConfigRequest method. +// req, resp := client.PutFunctionEventInvokeConfigRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/RemoveLayerVersionPermission -func (c *Lambda) RemoveLayerVersionPermissionRequest(input *RemoveLayerVersionPermissionInput) (req *request.Request, output *RemoveLayerVersionPermissionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/PutFunctionEventInvokeConfig +func (c *Lambda) PutFunctionEventInvokeConfigRequest(input *PutFunctionEventInvokeConfigInput) (req *request.Request, output *PutFunctionEventInvokeConfigOutput) { op := &request.Operation{ - Name: opRemoveLayerVersionPermission, - HTTPMethod: "DELETE", - HTTPPath: "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy/{StatementId}", + Name: opPutFunctionEventInvokeConfig, + HTTPMethod: "PUT", + HTTPPath: "/2019-09-25/functions/{FunctionName}/event-invoke-config", } if input == nil { - input = &RemoveLayerVersionPermissionInput{} + input = &PutFunctionEventInvokeConfigInput{} } - output = &RemoveLayerVersionPermissionOutput{} + output = &PutFunctionEventInvokeConfigOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// RemoveLayerVersionPermission API operation for AWS Lambda. +// PutFunctionEventInvokeConfig API operation for AWS Lambda. // -// Removes a statement from the permissions policy for a version of an AWS Lambda -// layer (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). -// For more information, see AddLayerVersionPermission. +// Configures options for asynchronous invocation (https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html) +// on a function, version, or alias. If a configuration already exists for a +// function, version, or alias, this operation overwrites it. If you exclude +// any settings, they are removed. To set one option without affecting existing +// settings for other options, use PutFunctionEventInvokeConfig. +// +// By default, Lambda retries an asynchronous invocation twice if the function +// returns an error. It retains events in a queue for up to six hours. When +// an event fails all processing attempts or stays in the asynchronous invocation +// queue for too long, Lambda discards it. To retain discarded events, configure +// a dead-letter queue with UpdateFunctionConfiguration. +// +// To send an invocation record to a queue, topic, function, or event bus, specify +// a destination (https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations). +// You can configure separate destinations for successful invocations (on-success) +// and events that fail all processing attempts (on-failure). You can configure +// destinations in addition to or instead of a dead-letter queue. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 RemoveLayerVersionPermission for usage and error information. +// API operation PutFunctionEventInvokeConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource specified in the request does not exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodePreconditionFailedException "PreconditionFailedException" -// The RevisionId provided does not match the latest RevisionId for the Lambda -// function or alias. Call the GetFunction or the GetAlias API to retrieve the -// latest RevisionId for your resource. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/RemoveLayerVersionPermission -func (c *Lambda) RemoveLayerVersionPermission(input *RemoveLayerVersionPermissionInput) (*RemoveLayerVersionPermissionOutput, error) { - req, out := c.RemoveLayerVersionPermissionRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/PutFunctionEventInvokeConfig +func (c *Lambda) PutFunctionEventInvokeConfig(input *PutFunctionEventInvokeConfigInput) (*PutFunctionEventInvokeConfigOutput, error) { + req, out := c.PutFunctionEventInvokeConfigRequest(input) return out, req.Send() } -// RemoveLayerVersionPermissionWithContext is the same as RemoveLayerVersionPermission with the addition of +// PutFunctionEventInvokeConfigWithContext is the same as PutFunctionEventInvokeConfig with the addition of // the ability to pass a context and additional request options. // -// See RemoveLayerVersionPermission for details on how to use this API operation. +// See PutFunctionEventInvokeConfig for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Lambda) RemoveLayerVersionPermissionWithContext(ctx aws.Context, input *RemoveLayerVersionPermissionInput, opts ...request.Option) (*RemoveLayerVersionPermissionOutput, error) { - req, out := c.RemoveLayerVersionPermissionRequest(input) +func (c *Lambda) PutFunctionEventInvokeConfigWithContext(ctx aws.Context, input *PutFunctionEventInvokeConfigInput, opts ...request.Option) (*PutFunctionEventInvokeConfigOutput, error) { + req, out := c.PutFunctionEventInvokeConfigRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRemovePermission = "RemovePermission" +const opPutProvisionedConcurrencyConfig = "PutProvisionedConcurrencyConfig" -// RemovePermissionRequest generates a "aws/request.Request" representing the -// client's request for the RemovePermission operation. The "output" return +// PutProvisionedConcurrencyConfigRequest generates a "aws/request.Request" representing the +// client's request for the PutProvisionedConcurrencyConfig operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RemovePermission for more information on using the RemovePermission +// See PutProvisionedConcurrencyConfig for more information on using the PutProvisionedConcurrencyConfig // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RemovePermissionRequest method. -// req, resp := client.RemovePermissionRequest(params) +// // Example sending a request using the PutProvisionedConcurrencyConfigRequest method. +// req, resp := client.PutProvisionedConcurrencyConfigRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/RemovePermission -func (c *Lambda) RemovePermissionRequest(input *RemovePermissionInput) (req *request.Request, output *RemovePermissionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/PutProvisionedConcurrencyConfig +func (c *Lambda) PutProvisionedConcurrencyConfigRequest(input *PutProvisionedConcurrencyConfigInput) (req *request.Request, output *PutProvisionedConcurrencyConfigOutput) { op := &request.Operation{ - Name: opRemovePermission, - HTTPMethod: "DELETE", - HTTPPath: "/2015-03-31/functions/{FunctionName}/policy/{StatementId}", + Name: opPutProvisionedConcurrencyConfig, + HTTPMethod: "PUT", + HTTPPath: "/2019-09-30/functions/{FunctionName}/provisioned-concurrency", } if input == nil { - input = &RemovePermissionInput{} + input = &PutProvisionedConcurrencyConfigInput{} } - output = &RemovePermissionOutput{} + output = &PutProvisionedConcurrencyConfigOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// RemovePermission API operation for AWS Lambda. +// PutProvisionedConcurrencyConfig API operation for AWS Lambda. // -// Revokes function-use permission from an AWS service or another account. You -// can get the ID of the statement from the output of GetPolicy. +// Adds a provisioned concurrency configuration to a function's alias or 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 Lambda's -// API operation RemovePermission for usage and error information. +// API operation PutProvisionedConcurrencyConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" -// The AWS Lambda service encountered an internal error. +// Returned Error Types: +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource (for example, a Lambda function or access policy statement) -// specified in the request does not exist. +// * ResourceNotFoundException +// The resource 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. +// * ResourceConflictException +// The resource already exists, or another operation is in progress. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodePreconditionFailedException "PreconditionFailedException" -// The RevisionId provided does not match the latest RevisionId for the Lambda -// function or alias. Call the GetFunction or the GetAlias API to retrieve the -// latest RevisionId for your resource. +// * ServiceException +// The AWS Lambda service encountered an internal error. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/RemovePermission -func (c *Lambda) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) { - req, out := c.RemovePermissionRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/PutProvisionedConcurrencyConfig +func (c *Lambda) PutProvisionedConcurrencyConfig(input *PutProvisionedConcurrencyConfigInput) (*PutProvisionedConcurrencyConfigOutput, error) { + req, out := c.PutProvisionedConcurrencyConfigRequest(input) return out, req.Send() } -// RemovePermissionWithContext is the same as RemovePermission with the addition of +// PutProvisionedConcurrencyConfigWithContext is the same as PutProvisionedConcurrencyConfig with the addition of // the ability to pass a context and additional request options. // -// See RemovePermission for details on how to use this API operation. +// See PutProvisionedConcurrencyConfig for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Lambda) RemovePermissionWithContext(ctx aws.Context, input *RemovePermissionInput, opts ...request.Option) (*RemovePermissionOutput, error) { - req, out := c.RemovePermissionRequest(input) +func (c *Lambda) PutProvisionedConcurrencyConfigWithContext(ctx aws.Context, input *PutProvisionedConcurrencyConfigInput, opts ...request.Option) (*PutProvisionedConcurrencyConfigOutput, error) { + req, out := c.PutProvisionedConcurrencyConfigRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opTagResource = "TagResource" +const opRemoveLayerVersionPermission = "RemoveLayerVersionPermission" -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource operation. The "output" return +// RemoveLayerVersionPermissionRequest generates a "aws/request.Request" representing the +// client's request for the RemoveLayerVersionPermission operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See TagResource for more information on using the TagResource +// See RemoveLayerVersionPermission for more information on using the RemoveLayerVersionPermission // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) +// // Example sending a request using the RemoveLayerVersionPermissionRequest method. +// req, resp := client.RemoveLayerVersionPermissionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/TagResource -func (c *Lambda) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/RemoveLayerVersionPermission +func (c *Lambda) RemoveLayerVersionPermissionRequest(input *RemoveLayerVersionPermissionInput) (req *request.Request, output *RemoveLayerVersionPermissionOutput) { op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/2017-03-31/tags/{ARN}", + Name: opRemoveLayerVersionPermission, + HTTPMethod: "DELETE", + HTTPPath: "/2018-10-31/layers/{LayerName}/versions/{VersionNumber}/policy/{StatementId}", } if input == nil { - input = &TagResourceInput{} + input = &RemoveLayerVersionPermissionInput{} } - output = &TagResourceOutput{} + output = &RemoveLayerVersionPermissionOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// TagResource API operation for AWS Lambda. +// RemoveLayerVersionPermission API operation for AWS Lambda. // -// Adds tags (https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to -// a function. +// Removes a statement from the permissions policy for a version of an AWS Lambda +// layer (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). +// For more information, see AddLayerVersionPermission. // // Returns awserr.Error for service API and SDK errors. Use runtime type 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 TagResource for usage and error information. +// API operation RemoveLayerVersionPermission for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/TagResource -func (c *Lambda) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) +// * PreconditionFailedException +// The RevisionId provided does not match the latest RevisionId for the Lambda +// function or alias. Call the GetFunction or the GetAlias API to retrieve the +// latest RevisionId for your resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/RemoveLayerVersionPermission +func (c *Lambda) RemoveLayerVersionPermission(input *RemoveLayerVersionPermissionInput) (*RemoveLayerVersionPermissionOutput, error) { + req, out := c.RemoveLayerVersionPermissionRequest(input) return out, req.Send() } -// TagResourceWithContext is the same as TagResource with the addition of +// RemoveLayerVersionPermissionWithContext is the same as RemoveLayerVersionPermission with the addition of // the ability to pass a context and additional request options. // -// See TagResource for details on how to use this API operation. +// See RemoveLayerVersionPermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lambda) RemoveLayerVersionPermissionWithContext(ctx aws.Context, input *RemoveLayerVersionPermissionInput, opts ...request.Option) (*RemoveLayerVersionPermissionOutput, error) { + req, out := c.RemoveLayerVersionPermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRemovePermission = "RemovePermission" + +// RemovePermissionRequest generates a "aws/request.Request" representing the +// client's request for the RemovePermission operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RemovePermission for more information on using the RemovePermission +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RemovePermissionRequest method. +// req, resp := client.RemovePermissionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/RemovePermission +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.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// RemovePermission API operation for AWS Lambda. +// +// Revokes function-use permission from an AWS service or another account. You +// can get the ID of the statement from the output of GetPolicy. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 Types: +// * ServiceException +// The AWS Lambda service encountered an internal error. +// +// * ResourceNotFoundException +// The resource specified in the request does not exist. +// +// * InvalidParameterValueException +// One of the parameters in the request is invalid. +// +// * TooManyRequestsException +// The request throughput limit was exceeded. +// +// * PreconditionFailedException +// The RevisionId provided does not match the latest RevisionId for the Lambda +// function or alias. Call the GetFunction or the GetAlias API to retrieve the +// latest RevisionId for your resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/RemovePermission +func (c *Lambda) RemovePermission(input *RemovePermissionInput) (*RemovePermissionOutput, error) { + req, out := c.RemovePermissionRequest(input) + return out, req.Send() +} + +// RemovePermissionWithContext is the same as RemovePermission with the addition of +// the ability to pass a context and additional request options. +// +// See RemovePermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lambda) RemovePermissionWithContext(ctx aws.Context, input *RemovePermissionInput, opts ...request.Option) (*RemovePermissionOutput, error) { + req, out := c.RemovePermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/TagResource +func (c *Lambda) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { + op := &request.Operation{ + Name: opTagResource, + HTTPMethod: "POST", + HTTPPath: "/2017-03-31/tags/{ARN}", + } + + if input == nil { + input = &TagResourceInput{} + } + + output = &TagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for AWS Lambda. +// +// Adds tags (https://docs.aws.amazon.com/lambda/latest/dg/tagging.html) to +// a 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 Lambda's +// API operation TagResource for usage and error information. +// +// Returned Error Types: +// * ServiceException +// The AWS Lambda service encountered an internal error. +// +// * ResourceNotFoundException +// The resource specified in the request does not exist. +// +// * InvalidParameterValueException +// One of the parameters in the request is invalid. +// +// * TooManyRequestsException +// The request throughput limit was exceeded. +// +// * ResourceConflictException +// The resource already exists, or another operation is in progress. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/TagResource +func (c *Lambda) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create @@ -3770,21 +4696,21 @@ func (c *Lambda) UntagResourceRequest(input *UntagResourceInput) (req *request.R // See the AWS API reference guide for AWS Lambda's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource specified in the request does not exist. +// +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * 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. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * ResourceConflictException +// The resource already exists, or another operation is in progress. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/UntagResource func (c *Lambda) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { @@ -3861,27 +4787,27 @@ func (c *Lambda) UpdateAliasRequest(input *UpdateAliasInput) (req *request.Reque // See the AWS API reference guide for AWS Lambda's // API operation UpdateAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodePreconditionFailedException "PreconditionFailedException" +// * PreconditionFailedException // The RevisionId provided does not match the latest RevisionId for the Lambda // function or alias. Call the GetFunction or the GetAlias API to retrieve the // latest RevisionId for your resource. // +// * ResourceConflictException +// The resource already exists, or another operation is in progress. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/UpdateAlias func (c *Lambda) UpdateAlias(input *UpdateAliasInput) (*AliasConfiguration, error) { req, out := c.UpdateAliasRequest(input) @@ -3951,6 +4877,23 @@ func (c *Lambda) UpdateEventSourceMappingRequest(input *UpdateEventSourceMapping // Updates an event source mapping. You can change the function that AWS Lambda // invokes, or pause invocation and resume later from the same location. // +// The following error handling options are only available for stream sources +// (DynamoDB and Kinesis): +// +// * BisectBatchOnFunctionError - If the function returns an error, split +// the batch in two and retry. +// +// * DestinationConfig - Send discarded records to an Amazon SQS queue or +// Amazon SNS topic. +// +// * MaximumRecordAgeInSeconds - Discard records older than the specified +// age. +// +// * MaximumRetryAttempts - Discard records after the specified number of +// retries. +// +// * ParallelizationFactor - Process multiple batches from each shard concurrently. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -3958,26 +4901,23 @@ func (c *Lambda) UpdateEventSourceMappingRequest(input *UpdateEventSourceMapping // See the AWS API reference guide for AWS Lambda's // API operation UpdateEventSourceMapping for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodeResourceConflictException "ResourceConflictException" -// The resource already exists. +// * ResourceConflictException +// The resource already exists, or another operation is in progress. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The operation conflicts with the resource's availability. For example, you // attempted to update an EventSource Mapping in CREATING, or tried to delete // a EventSource mapping currently in the UPDATING state. @@ -4060,30 +5000,30 @@ func (c *Lambda) UpdateFunctionCodeRequest(input *UpdateFunctionCodeInput) (req // See the AWS API reference guide for AWS Lambda's // API operation UpdateFunctionCode for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodeCodeStorageExceededException "CodeStorageExceededException" +// * CodeStorageExceededException // You have exceeded your maximum total code size per account. Learn more (https://docs.aws.amazon.com/lambda/latest/dg/limits.html) // -// * ErrCodePreconditionFailedException "PreconditionFailedException" +// * PreconditionFailedException // The RevisionId provided does not match the latest RevisionId for the Lambda // function or alias. Call the GetFunction or the GetAlias API to retrieve the // latest RevisionId for your resource. // +// * ResourceConflictException +// The resource already exists, or another operation is in progress. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/UpdateFunctionCode func (c *Lambda) UpdateFunctionCode(input *UpdateFunctionCodeInput) (*FunctionConfiguration, error) { req, out := c.UpdateFunctionCodeRequest(input) @@ -4152,6 +5092,14 @@ func (c *Lambda) UpdateFunctionConfigurationRequest(input *UpdateFunctionConfigu // // Modify the version-specific settings of a Lambda function. // +// When you update a function, Lambda provisions an instance of the function +// and its supporting resources. If your function connects to a VPC, this process +// can take a minute. During this time, you can't modify the function, but you +// can still invoke it. The LastUpdateStatus, LastUpdateStatusReason, and LastUpdateStatusReasonCode +// fields in the response from GetFunctionConfiguration indicate when the update +// is complete and the function is processing events with the new configuration. +// For more information, see Function States (https://docs.aws.amazon.com/lambda/latest/dg/functions-states.html). +// // These settings can vary between versions of a function and are locked when // you publish a version. You can't modify the configuration of a published // version, only the unpublished version. @@ -4166,26 +5114,23 @@ func (c *Lambda) UpdateFunctionConfigurationRequest(input *UpdateFunctionConfigu // See the AWS API reference guide for AWS Lambda's // API operation UpdateFunctionConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * 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. +// * ResourceNotFoundException +// The resource 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. +// * InvalidParameterValueException +// One of the parameters in the request is invalid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Request throughput limit exceeded. +// * TooManyRequestsException +// The request throughput limit was exceeded. // -// * ErrCodeResourceConflictException "ResourceConflictException" -// The resource already exists. +// * ResourceConflictException +// The resource already exists, or another operation is in progress. // -// * ErrCodePreconditionFailedException "PreconditionFailedException" +// * PreconditionFailedException // The RevisionId provided does not match the latest RevisionId for the Lambda // function or alias. Call the GetFunction or the GetAlias API to retrieve the // latest RevisionId for your resource. @@ -4212,12 +5157,104 @@ func (c *Lambda) UpdateFunctionConfigurationWithContext(ctx aws.Context, input * return out, req.Send() } -// Limits that are related to concurrency and code storage. All file and storage +const opUpdateFunctionEventInvokeConfig = "UpdateFunctionEventInvokeConfig" + +// UpdateFunctionEventInvokeConfigRequest generates a "aws/request.Request" representing the +// client's request for the UpdateFunctionEventInvokeConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateFunctionEventInvokeConfig for more information on using the UpdateFunctionEventInvokeConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateFunctionEventInvokeConfigRequest method. +// req, resp := client.UpdateFunctionEventInvokeConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/UpdateFunctionEventInvokeConfig +func (c *Lambda) UpdateFunctionEventInvokeConfigRequest(input *UpdateFunctionEventInvokeConfigInput) (req *request.Request, output *UpdateFunctionEventInvokeConfigOutput) { + op := &request.Operation{ + Name: opUpdateFunctionEventInvokeConfig, + HTTPMethod: "POST", + HTTPPath: "/2019-09-25/functions/{FunctionName}/event-invoke-config", + } + + if input == nil { + input = &UpdateFunctionEventInvokeConfigInput{} + } + + output = &UpdateFunctionEventInvokeConfigOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateFunctionEventInvokeConfig API operation for AWS Lambda. +// +// Updates the configuration for asynchronous invocation for a function, version, +// or alias. +// +// To configure options for asynchronous invocation, use PutFunctionEventInvokeConfig. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 UpdateFunctionEventInvokeConfig for usage and error information. +// +// Returned Error Types: +// * ServiceException +// The AWS Lambda service encountered an internal error. +// +// * ResourceNotFoundException +// The resource specified in the request does not exist. +// +// * InvalidParameterValueException +// One of the parameters in the request is invalid. +// +// * TooManyRequestsException +// The request throughput limit was exceeded. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lambda-2015-03-31/UpdateFunctionEventInvokeConfig +func (c *Lambda) UpdateFunctionEventInvokeConfig(input *UpdateFunctionEventInvokeConfigInput) (*UpdateFunctionEventInvokeConfigOutput, error) { + req, out := c.UpdateFunctionEventInvokeConfigRequest(input) + return out, req.Send() +} + +// UpdateFunctionEventInvokeConfigWithContext is the same as UpdateFunctionEventInvokeConfig with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateFunctionEventInvokeConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lambda) UpdateFunctionEventInvokeConfigWithContext(ctx aws.Context, input *UpdateFunctionEventInvokeConfigInput, opts ...request.Option) (*UpdateFunctionEventInvokeConfigOutput, error) { + req, out := c.UpdateFunctionEventInvokeConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Limits that are related to concurrency and storage. All file and storage // sizes are in bytes. type AccountLimit struct { _ struct{} `type:"structure"` - // The maximum size of your function's code and layers when they're extracted. + // The maximum size of a function's deployment package and layers when they're + // extracted. CodeSizeUnzipped *int64 `type:"long"` // The maximum size of a deployment package when it's uploaded directly to AWS @@ -4741,26 +5778,85 @@ func (s *AliasRoutingConfiguration) SetAdditionalVersionWeights(v map[string]*fl return s } -type CreateAliasInput struct { - _ struct{} `type:"structure"` +// You have exceeded your maximum total code size per account. Learn more (https://docs.aws.amazon.com/lambda/latest/dg/limits.html) +type CodeStorageExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // A description of the alias. - Description *string `type:"string"` + Message_ *string `locationName:"message" type:"string"` - // The name of the Lambda function. - // - // Name formats - // - // * Function name - MyFunction. - // - // * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction. - // - // * Partial ARN - 123456789012:function:MyFunction. - // - // The length constraint applies only to the full ARN. If you specify only the - // function name, it is limited to 64 characters in length. - // - // FunctionName is a required field + // The exception type. + Type *string `type:"string"` +} + +// String returns the string representation +func (s CodeStorageExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CodeStorageExceededException) GoString() string { + return s.String() +} + +func newErrorCodeStorageExceededException(v protocol.ResponseMetadata) error { + return &CodeStorageExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CodeStorageExceededException) Code() string { + return "CodeStorageExceededException" +} + +// Message returns the exception's message. +func (s CodeStorageExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CodeStorageExceededException) OrigErr() error { + return nil +} + +func (s CodeStorageExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CodeStorageExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CodeStorageExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +type CreateAliasInput struct { + _ struct{} `type:"structure"` + + // A description of the alias. + Description *string `type:"string"` + + // The name of the Lambda function. + // + // Name formats + // + // * Function name - MyFunction. + // + // * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:MyFunction. + // + // * Partial ARN - 123456789012:function:MyFunction. + // + // The length constraint applies only to the full ARN. If you specify only the + // function name, it is limited to 64 characters in length. + // + // FunctionName is a required field FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` // The function version that the alias invokes. @@ -4858,6 +5954,13 @@ type CreateEventSourceMappingInput struct { // * Amazon Simple Queue Service - Default 10. Max 10. BatchSize *int64 `min:"1" type:"integer"` + // (Streams) If the function returns an error, split the batch in two and retry. + BisectBatchOnFunctionError *bool `type:"boolean"` + + // (Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded + // records. + DestinationConfig *DestinationConfig `type:"structure"` + // Disables the event source mapping to pause polling and invocation. Enabled *bool `type:"boolean"` @@ -4890,8 +5993,21 @@ type CreateEventSourceMappingInput struct { // FunctionName is a required field FunctionName *string `min:"1" type:"string" required:"true"` + // The maximum amount of time to gather records before invoking the function, + // in seconds. MaximumBatchingWindowInSeconds *int64 `type:"integer"` + // (Streams) The maximum age of a record that Lambda sends to a function for + // processing. + MaximumRecordAgeInSeconds *int64 `min:"60" type:"integer"` + + // (Streams) The maximum number of times to retry when the function returns + // an error. + MaximumRetryAttempts *int64 `type:"integer"` + + // (Streams) The number of batches to process from each shard concurrently. + ParallelizationFactor *int64 `min:"1" type:"integer"` + // The position in a stream from which to start reading. Required for Amazon // Kinesis and Amazon DynamoDB Streams sources. AT_TIMESTAMP is only supported // for Amazon Kinesis streams. @@ -4926,6 +6042,12 @@ func (s *CreateEventSourceMappingInput) Validate() error { if s.FunctionName != nil && len(*s.FunctionName) < 1 { invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) } + if s.MaximumRecordAgeInSeconds != nil && *s.MaximumRecordAgeInSeconds < 60 { + invalidParams.Add(request.NewErrParamMinValue("MaximumRecordAgeInSeconds", 60)) + } + if s.ParallelizationFactor != nil && *s.ParallelizationFactor < 1 { + invalidParams.Add(request.NewErrParamMinValue("ParallelizationFactor", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -4939,6 +6061,18 @@ func (s *CreateEventSourceMappingInput) SetBatchSize(v int64) *CreateEventSource return s } +// SetBisectBatchOnFunctionError sets the BisectBatchOnFunctionError field's value. +func (s *CreateEventSourceMappingInput) SetBisectBatchOnFunctionError(v bool) *CreateEventSourceMappingInput { + s.BisectBatchOnFunctionError = &v + return s +} + +// SetDestinationConfig sets the DestinationConfig field's value. +func (s *CreateEventSourceMappingInput) SetDestinationConfig(v *DestinationConfig) *CreateEventSourceMappingInput { + s.DestinationConfig = v + return s +} + // SetEnabled sets the Enabled field's value. func (s *CreateEventSourceMappingInput) SetEnabled(v bool) *CreateEventSourceMappingInput { s.Enabled = &v @@ -4963,6 +6097,24 @@ func (s *CreateEventSourceMappingInput) SetMaximumBatchingWindowInSeconds(v int6 return s } +// SetMaximumRecordAgeInSeconds sets the MaximumRecordAgeInSeconds field's value. +func (s *CreateEventSourceMappingInput) SetMaximumRecordAgeInSeconds(v int64) *CreateEventSourceMappingInput { + s.MaximumRecordAgeInSeconds = &v + return s +} + +// SetMaximumRetryAttempts sets the MaximumRetryAttempts field's value. +func (s *CreateEventSourceMappingInput) SetMaximumRetryAttempts(v int64) *CreateEventSourceMappingInput { + s.MaximumRetryAttempts = &v + return s +} + +// SetParallelizationFactor sets the ParallelizationFactor field's value. +func (s *CreateEventSourceMappingInput) SetParallelizationFactor(v int64) *CreateEventSourceMappingInput { + s.ParallelizationFactor = &v + return s +} + // SetStartingPosition sets the StartingPosition field's value. func (s *CreateEventSourceMappingInput) SetStartingPosition(v string) *CreateEventSourceMappingInput { s.StartingPosition = &v @@ -4985,7 +6137,7 @@ type CreateFunctionInput struct { // A dead letter queue configuration that specifies the queue or topic where // Lambda sends asynchronous events when they fail processing. For more information, - // see Dead Letter Queues (https://docs.aws.amazon.com/lambda/latest/dg/dlq.html). + // see Dead Letter Queues (https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq). DeadLetterConfig *DeadLetterConfig `type:"structure"` // A description of the function. @@ -5061,7 +6213,7 @@ type CreateFunctionInput struct { // For network connectivity to AWS resources in a VPC, specify a list of security // groups and subnets in the VPC. When you connect a function to a VPC, it can // only access resources and the internet through that VPC. For more information, - // see VPC Settings (https://docs.aws.amazon.com/lambda/latest/dg/vpc.html). + // see VPC Settings (https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). VpcConfig *VpcConfig `type:"structure"` } @@ -5210,7 +6362,7 @@ func (s *CreateFunctionInput) SetVpcConfig(v *VpcConfig) *CreateFunctionInput { return s } -// The dead letter queue (https://docs.aws.amazon.com/lambda/latest/dg/dlq.html) +// The dead-letter queue (https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq) // for failed asynchronous invocations. type DeadLetterConfig struct { _ struct{} `type:"structure"` @@ -5425,6 +6577,85 @@ func (s DeleteFunctionConcurrencyOutput) GoString() string { return s.String() } +type DeleteFunctionEventInvokeConfigInput struct { + _ struct{} `type:"structure"` + + // The name of the Lambda function, version, or alias. + // + // Name formats + // + // * Function name - my-function (name-only), my-function:v1 (with alias). + // + // * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function. + // + // * Partial ARN - 123456789012:function:my-function. + // + // You can append a version number or alias to any of the formats. The length + // constraint applies only to the full ARN. If you specify only the function + // name, it is limited to 64 characters in length. + // + // FunctionName is a required field + FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` + + // A version number or alias name. + Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` +} + +// String returns the string representation +func (s DeleteFunctionEventInvokeConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFunctionEventInvokeConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteFunctionEventInvokeConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteFunctionEventInvokeConfigInput"} + 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 *DeleteFunctionEventInvokeConfigInput) SetFunctionName(v string) *DeleteFunctionEventInvokeConfigInput { + s.FunctionName = &v + return s +} + +// SetQualifier sets the Qualifier field's value. +func (s *DeleteFunctionEventInvokeConfigInput) SetQualifier(v string) *DeleteFunctionEventInvokeConfigInput { + s.Qualifier = &v + return s +} + +type DeleteFunctionEventInvokeConfigOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteFunctionEventInvokeConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFunctionEventInvokeConfigOutput) GoString() string { + return s.String() +} + type DeleteFunctionInput struct { _ struct{} `type:"structure"` @@ -5574,124 +6805,502 @@ func (s DeleteLayerVersionOutput) GoString() string { return s.String() } -// A function's environment variable settings. -type Environment struct { +type DeleteProvisionedConcurrencyConfigInput struct { _ struct{} `type:"structure"` - // Environment variable key-value pairs. - Variables map[string]*string `type:"map" sensitive:"true"` + // The name of the Lambda function. + // + // Name formats + // + // * Function name - my-function. + // + // * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function. + // + // * Partial ARN - 123456789012:function:my-function. + // + // The length constraint applies only to the full ARN. If you specify only the + // function name, it is limited to 64 characters in length. + // + // FunctionName is a required field + FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` + + // The version number or alias name. + // + // Qualifier is a required field + Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string" required:"true"` } // String returns the string representation -func (s Environment) String() string { +func (s DeleteProvisionedConcurrencyConfigInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Environment) GoString() string { +func (s DeleteProvisionedConcurrencyConfigInput) GoString() string { return s.String() } -// SetVariables sets the Variables field's value. -func (s *Environment) SetVariables(v map[string]*string) *Environment { - s.Variables = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteProvisionedConcurrencyConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteProvisionedConcurrencyConfigInput"} + 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 { + invalidParams.Add(request.NewErrParamRequired("Qualifier")) + } + 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 *DeleteProvisionedConcurrencyConfigInput) SetFunctionName(v string) *DeleteProvisionedConcurrencyConfigInput { + s.FunctionName = &v return s } -// Error messages for environment variables that couldn't be applied. -type EnvironmentError struct { +// SetQualifier sets the Qualifier field's value. +func (s *DeleteProvisionedConcurrencyConfigInput) SetQualifier(v string) *DeleteProvisionedConcurrencyConfigInput { + s.Qualifier = &v + return s +} + +type DeleteProvisionedConcurrencyConfigOutput struct { _ struct{} `type:"structure"` +} - // The error code. - ErrorCode *string `type:"string"` +// String returns the string representation +func (s DeleteProvisionedConcurrencyConfigOutput) String() string { + return awsutil.Prettify(s) +} - // The error message. - Message *string `type:"string" sensitive:"true"` +// GoString returns the string representation +func (s DeleteProvisionedConcurrencyConfigOutput) GoString() string { + return s.String() +} + +// A configuration object that specifies the destination of an event after Lambda +// processes it. +type DestinationConfig struct { + _ struct{} `type:"structure"` + + // The destination configuration for failed invocations. + OnFailure *OnFailure `type:"structure"` + + // The destination configuration for successful invocations. + OnSuccess *OnSuccess `type:"structure"` } // String returns the string representation -func (s EnvironmentError) String() string { +func (s DestinationConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EnvironmentError) GoString() string { +func (s DestinationConfig) GoString() string { return s.String() } -// SetErrorCode sets the ErrorCode field's value. -func (s *EnvironmentError) SetErrorCode(v string) *EnvironmentError { - s.ErrorCode = &v +// SetOnFailure sets the OnFailure field's value. +func (s *DestinationConfig) SetOnFailure(v *OnFailure) *DestinationConfig { + s.OnFailure = v return s } -// SetMessage sets the Message field's value. -func (s *EnvironmentError) SetMessage(v string) *EnvironmentError { - s.Message = &v +// SetOnSuccess sets the OnSuccess field's value. +func (s *DestinationConfig) SetOnSuccess(v *OnSuccess) *DestinationConfig { + s.OnSuccess = v return s } -// The results of a configuration update that applied environment variables. -type EnvironmentResponse struct { - _ struct{} `type:"structure"` +// Need additional permissions to configure VPC settings. +type EC2AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Error messages for environment variables that couldn't be applied. - Error *EnvironmentError `type:"structure"` + Message_ *string `locationName:"Message" type:"string"` - // Environment variable key-value pairs. - Variables map[string]*string `type:"map" sensitive:"true"` + Type *string `type:"string"` } // String returns the string representation -func (s EnvironmentResponse) String() string { +func (s EC2AccessDeniedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EnvironmentResponse) GoString() string { +func (s EC2AccessDeniedException) GoString() string { return s.String() } -// SetError sets the Error field's value. -func (s *EnvironmentResponse) SetError(v *EnvironmentError) *EnvironmentResponse { - s.Error = v - return s +func newErrorEC2AccessDeniedException(v protocol.ResponseMetadata) error { + return &EC2AccessDeniedException{ + respMetadata: v, + } } -// SetVariables sets the Variables field's value. -func (s *EnvironmentResponse) SetVariables(v map[string]*string) *EnvironmentResponse { - s.Variables = v - return s +// Code returns the exception type name. +func (s EC2AccessDeniedException) Code() string { + return "EC2AccessDeniedException" } -// A mapping between an AWS resource and an AWS Lambda function. See CreateEventSourceMapping -// for details. -type EventSourceMappingConfiguration struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s EC2AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The maximum number of items to retrieve in a single batch. - BatchSize *int64 `min:"1" type:"integer"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EC2AccessDeniedException) OrigErr() error { + return nil +} - // The Amazon Resource Name (ARN) of the event source. - EventSourceArn *string `type:"string"` +func (s EC2AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} - // The ARN of the Lambda function. - FunctionArn *string `type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s EC2AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The date that the event source mapping was last updated. - LastModified *time.Time `type:"timestamp"` +// RequestID returns the service's response RequestID for request. +func (s EC2AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} - // The result of the last AWS Lambda invocation of your Lambda function. - LastProcessingResult *string `type:"string"` +// AWS Lambda was throttled by Amazon EC2 during Lambda function initialization +// using the execution role provided for the Lambda function. +type EC2ThrottledException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - MaximumBatchingWindowInSeconds *int64 `type:"integer"` + Message_ *string `locationName:"Message" type:"string"` - // The state of the event source mapping. It can be one of the following: Creating, - // Enabling, Enabled, Disabling, Disabled, Updating, or Deleting. - State *string `type:"string"` + Type *string `type:"string"` +} - // The cause of the last state change, either User initiated or Lambda initiated. - StateTransitionReason *string `type:"string"` +// String returns the string representation +func (s EC2ThrottledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EC2ThrottledException) GoString() string { + return s.String() +} + +func newErrorEC2ThrottledException(v protocol.ResponseMetadata) error { + return &EC2ThrottledException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EC2ThrottledException) Code() string { + return "EC2ThrottledException" +} + +// Message returns the exception's message. +func (s EC2ThrottledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EC2ThrottledException) OrigErr() error { + return nil +} + +func (s EC2ThrottledException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EC2ThrottledException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EC2ThrottledException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS Lambda received an unexpected EC2 client exception while setting up for +// the Lambda function. +type EC2UnexpectedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + EC2ErrorCode *string `type:"string"` + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s EC2UnexpectedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EC2UnexpectedException) GoString() string { + return s.String() +} + +func newErrorEC2UnexpectedException(v protocol.ResponseMetadata) error { + return &EC2UnexpectedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EC2UnexpectedException) Code() string { + return "EC2UnexpectedException" +} + +// Message returns the exception's message. +func (s EC2UnexpectedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EC2UnexpectedException) OrigErr() error { + return nil +} + +func (s EC2UnexpectedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EC2UnexpectedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EC2UnexpectedException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS Lambda was not able to create an elastic network interface in the VPC, +// specified as part of Lambda function configuration, because the limit for +// network interfaces has been reached. +type ENILimitReachedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s ENILimitReachedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ENILimitReachedException) GoString() string { + return s.String() +} + +func newErrorENILimitReachedException(v protocol.ResponseMetadata) error { + return &ENILimitReachedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ENILimitReachedException) Code() string { + return "ENILimitReachedException" +} + +// Message returns the exception's message. +func (s ENILimitReachedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ENILimitReachedException) OrigErr() error { + return nil +} + +func (s ENILimitReachedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ENILimitReachedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ENILimitReachedException) RequestID() string { + return s.respMetadata.RequestID +} + +// A function's environment variable settings. +type Environment struct { + _ struct{} `type:"structure"` + + // Environment variable key-value pairs. + Variables map[string]*string `type:"map" sensitive:"true"` +} + +// 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 +} + +// Error messages for environment variables that couldn't be applied. +type EnvironmentError struct { + _ struct{} `type:"structure"` + + // The error code. + ErrorCode *string `type:"string"` + + // The error message. + Message *string `type:"string" sensitive:"true"` +} + +// 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 results of an operation to update or read environment variables. If the +// operation is successful, the response contains the environment variables. +// If it failed, the response contains details about the error. +type EnvironmentResponse struct { + _ struct{} `type:"structure"` + + // Error messages for environment variables that couldn't be applied. + Error *EnvironmentError `type:"structure"` + + // Environment variable key-value pairs. + Variables map[string]*string `type:"map" sensitive:"true"` +} + +// 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 +} + +// A mapping between an AWS resource and an AWS Lambda function. See CreateEventSourceMapping +// for details. +type EventSourceMappingConfiguration struct { + _ struct{} `type:"structure"` + + // The maximum number of items to retrieve in a single batch. + BatchSize *int64 `min:"1" type:"integer"` + + // (Streams) If the function returns an error, split the batch in two and retry. + BisectBatchOnFunctionError *bool `type:"boolean"` + + // (Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded + // records. + DestinationConfig *DestinationConfig `type:"structure"` + + // The Amazon Resource Name (ARN) of the event source. + EventSourceArn *string `type:"string"` + + // The ARN of the Lambda function. + FunctionArn *string `type:"string"` + + // The date that the event source mapping was last updated, or its state changed. + LastModified *time.Time `type:"timestamp"` + + // The result of the last AWS Lambda invocation of your Lambda function. + LastProcessingResult *string `type:"string"` + + // The maximum amount of time to gather records before invoking the function, + // in seconds. + MaximumBatchingWindowInSeconds *int64 `type:"integer"` + + // (Streams) The maximum age of a record that Lambda sends to a function for + // processing. + MaximumRecordAgeInSeconds *int64 `min:"60" type:"integer"` + + // (Streams) The maximum number of times to retry when the function returns + // an error. + MaximumRetryAttempts *int64 `type:"integer"` + + // (Streams) The number of batches to process from each shard concurrently. + ParallelizationFactor *int64 `min:"1" type:"integer"` + + // The state of the event source mapping. It can be one of the following: Creating, + // Enabling, Enabled, Disabling, Disabled, Updating, or Deleting. + State *string `type:"string"` + + // Indicates whether the last change to the event source mapping was made by + // a user, or by the Lambda service. + StateTransitionReason *string `type:"string"` // The identifier of the event source mapping. UUID *string `type:"string"` @@ -5713,6 +7322,18 @@ func (s *EventSourceMappingConfiguration) SetBatchSize(v int64) *EventSourceMapp return s } +// SetBisectBatchOnFunctionError sets the BisectBatchOnFunctionError field's value. +func (s *EventSourceMappingConfiguration) SetBisectBatchOnFunctionError(v bool) *EventSourceMappingConfiguration { + s.BisectBatchOnFunctionError = &v + return s +} + +// SetDestinationConfig sets the DestinationConfig field's value. +func (s *EventSourceMappingConfiguration) SetDestinationConfig(v *DestinationConfig) *EventSourceMappingConfiguration { + s.DestinationConfig = v + return s +} + // SetEventSourceArn sets the EventSourceArn field's value. func (s *EventSourceMappingConfiguration) SetEventSourceArn(v string) *EventSourceMappingConfiguration { s.EventSourceArn = &v @@ -5743,6 +7364,24 @@ func (s *EventSourceMappingConfiguration) SetMaximumBatchingWindowInSeconds(v in return s } +// SetMaximumRecordAgeInSeconds sets the MaximumRecordAgeInSeconds field's value. +func (s *EventSourceMappingConfiguration) SetMaximumRecordAgeInSeconds(v int64) *EventSourceMappingConfiguration { + s.MaximumRecordAgeInSeconds = &v + return s +} + +// SetMaximumRetryAttempts sets the MaximumRetryAttempts field's value. +func (s *EventSourceMappingConfiguration) SetMaximumRetryAttempts(v int64) *EventSourceMappingConfiguration { + s.MaximumRetryAttempts = &v + return s +} + +// SetParallelizationFactor sets the ParallelizationFactor field's value. +func (s *EventSourceMappingConfiguration) SetParallelizationFactor(v int64) *EventSourceMappingConfiguration { + s.ParallelizationFactor = &v + return s +} + // SetState sets the State field's value. func (s *EventSourceMappingConfiguration) SetState(v string) *EventSourceMappingConfiguration { s.State = &v @@ -5898,13 +7537,23 @@ type FunctionConfiguration struct { Handler *string `type:"string"` // The KMS key that's used to encrypt the function's environment variables. - // This key is only returned if you've configured a customer-managed CMK. + // This key is only returned if you've configured a customer managed CMK. KMSKeyArn *string `type:"string"` // The date and time that the function was last updated, in ISO-8601 format // (https://www.w3.org/TR/NOTE-datetime) (YYYY-MM-DDThh:mm:ss.sTZD). LastModified *string `type:"string"` + // The status of the last update that was performed on the function. This is + // first set to Successful after function creation completes. + LastUpdateStatus *string `type:"string" enum:"LastUpdateStatus"` + + // The reason for the last update that was performed on the function. + LastUpdateStatusReason *string `type:"string"` + + // The reason code for the last update that was performed on the function. + LastUpdateStatusReasonCode *string `type:"string" enum:"LastUpdateStatusReasonCode"` + // The function's layers (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). Layers []*Layer `type:"list"` @@ -5923,6 +7572,17 @@ type FunctionConfiguration struct { // The runtime environment for the Lambda function. Runtime *string `type:"string" enum:"Runtime"` + // The current state of the function. When the state is Inactive, you can reactivate + // the function by invoking it. + State *string `type:"string" enum:"State"` + + // The reason for the function's current state. + StateReason *string `type:"string"` + + // The reason code for the function's current state. When the code is Creating, + // you can't invoke or modify the function. + StateReasonCode *string `type:"string" enum:"StateReasonCode"` + // The amount of time that Lambda allows a function to run before stopping it. Timeout *int64 `min:"1" type:"integer"` @@ -6006,6 +7666,24 @@ func (s *FunctionConfiguration) SetLastModified(v string) *FunctionConfiguration return s } +// SetLastUpdateStatus sets the LastUpdateStatus field's value. +func (s *FunctionConfiguration) SetLastUpdateStatus(v string) *FunctionConfiguration { + s.LastUpdateStatus = &v + return s +} + +// SetLastUpdateStatusReason sets the LastUpdateStatusReason field's value. +func (s *FunctionConfiguration) SetLastUpdateStatusReason(v string) *FunctionConfiguration { + s.LastUpdateStatusReason = &v + return s +} + +// SetLastUpdateStatusReasonCode sets the LastUpdateStatusReasonCode field's value. +func (s *FunctionConfiguration) SetLastUpdateStatusReasonCode(v string) *FunctionConfiguration { + s.LastUpdateStatusReasonCode = &v + return s +} + // SetLayers sets the Layers field's value. func (s *FunctionConfiguration) SetLayers(v []*Layer) *FunctionConfiguration { s.Layers = v @@ -6042,6 +7720,24 @@ func (s *FunctionConfiguration) SetRuntime(v string) *FunctionConfiguration { return s } +// SetState sets the State field's value. +func (s *FunctionConfiguration) SetState(v string) *FunctionConfiguration { + s.State = &v + return s +} + +// SetStateReason sets the StateReason field's value. +func (s *FunctionConfiguration) SetStateReason(v string) *FunctionConfiguration { + s.StateReason = &v + return s +} + +// SetStateReasonCode sets the StateReasonCode field's value. +func (s *FunctionConfiguration) SetStateReasonCode(v string) *FunctionConfiguration { + s.StateReasonCode = &v + return s +} + // SetTimeout sets the Timeout field's value. func (s *FunctionConfiguration) SetTimeout(v int64) *FunctionConfiguration { s.Timeout = &v @@ -6066,14 +7762,83 @@ func (s *FunctionConfiguration) SetVpcConfig(v *VpcConfigResponse) *FunctionConf return s } -type GetAccountSettingsInput struct { +type FunctionEventInvokeConfig struct { _ struct{} `type:"structure"` -} -// String returns the string representation -func (s GetAccountSettingsInput) String() string { - return awsutil.Prettify(s) -} + // A destination for events after they have been sent to a function for processing. + // + // Destinations + // + // * Function - The Amazon Resource Name (ARN) of a Lambda function. + // + // * Queue - The ARN of an SQS queue. + // + // * Topic - The ARN of an SNS topic. + // + // * Event Bus - The ARN of an Amazon EventBridge event bus. + DestinationConfig *DestinationConfig `type:"structure"` + + // The Amazon Resource Name (ARN) of the function. + FunctionArn *string `type:"string"` + + // The date and time that the configuration was last updated. + LastModified *time.Time `type:"timestamp"` + + // The maximum age of a request that Lambda sends to a function for processing. + MaximumEventAgeInSeconds *int64 `min:"60" type:"integer"` + + // The maximum number of times to retry when the function returns an error. + MaximumRetryAttempts *int64 `type:"integer"` +} + +// String returns the string representation +func (s FunctionEventInvokeConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FunctionEventInvokeConfig) GoString() string { + return s.String() +} + +// SetDestinationConfig sets the DestinationConfig field's value. +func (s *FunctionEventInvokeConfig) SetDestinationConfig(v *DestinationConfig) *FunctionEventInvokeConfig { + s.DestinationConfig = v + return s +} + +// SetFunctionArn sets the FunctionArn field's value. +func (s *FunctionEventInvokeConfig) SetFunctionArn(v string) *FunctionEventInvokeConfig { + s.FunctionArn = &v + return s +} + +// SetLastModified sets the LastModified field's value. +func (s *FunctionEventInvokeConfig) SetLastModified(v time.Time) *FunctionEventInvokeConfig { + s.LastModified = &v + return s +} + +// SetMaximumEventAgeInSeconds sets the MaximumEventAgeInSeconds field's value. +func (s *FunctionEventInvokeConfig) SetMaximumEventAgeInSeconds(v int64) *FunctionEventInvokeConfig { + s.MaximumEventAgeInSeconds = &v + return s +} + +// SetMaximumRetryAttempts sets the MaximumRetryAttempts field's value. +func (s *FunctionEventInvokeConfig) SetMaximumRetryAttempts(v int64) *FunctionEventInvokeConfig { + s.MaximumRetryAttempts = &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 { @@ -6222,6 +7987,81 @@ func (s *GetEventSourceMappingInput) SetUUID(v string) *GetEventSourceMappingInp return s } +type GetFunctionConcurrencyInput struct { + _ struct{} `type:"structure"` + + // The name of the Lambda function. + // + // Name formats + // + // * Function name - my-function. + // + // * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function. + // + // * Partial ARN - 123456789012:function:my-function. + // + // The length constraint applies only to the full ARN. If you specify only the + // function name, it is limited to 64 characters 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 GetFunctionConcurrencyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFunctionConcurrencyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetFunctionConcurrencyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetFunctionConcurrencyInput"} + 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 +} + +// SetFunctionName sets the FunctionName field's value. +func (s *GetFunctionConcurrencyInput) SetFunctionName(v string) *GetFunctionConcurrencyInput { + s.FunctionName = &v + return s +} + +type GetFunctionConcurrencyOutput struct { + _ struct{} `type:"structure"` + + // The number of simultaneous executions that are reserved for the function. + ReservedConcurrentExecutions *int64 `type:"integer"` +} + +// String returns the string representation +func (s GetFunctionConcurrencyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFunctionConcurrencyOutput) GoString() string { + return s.String() +} + +// SetReservedConcurrentExecutions sets the ReservedConcurrentExecutions field's value. +func (s *GetFunctionConcurrencyOutput) SetReservedConcurrentExecutions(v int64) *GetFunctionConcurrencyOutput { + s.ReservedConcurrentExecutions = &v + return s +} + type GetFunctionConfigurationInput struct { _ struct{} `type:"structure"` @@ -6288,6 +8128,140 @@ func (s *GetFunctionConfigurationInput) SetQualifier(v string) *GetFunctionConfi return s } +type GetFunctionEventInvokeConfigInput struct { + _ struct{} `type:"structure"` + + // The name of the Lambda function, version, or alias. + // + // Name formats + // + // * Function name - my-function (name-only), my-function:v1 (with alias). + // + // * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function. + // + // * Partial ARN - 123456789012:function:my-function. + // + // You can append a version number or alias to any of the formats. The length + // constraint applies only to the full ARN. If you specify only the function + // name, it is limited to 64 characters in length. + // + // FunctionName is a required field + FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` + + // A version number or alias name. + Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` +} + +// String returns the string representation +func (s GetFunctionEventInvokeConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFunctionEventInvokeConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetFunctionEventInvokeConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetFunctionEventInvokeConfigInput"} + 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 *GetFunctionEventInvokeConfigInput) SetFunctionName(v string) *GetFunctionEventInvokeConfigInput { + s.FunctionName = &v + return s +} + +// SetQualifier sets the Qualifier field's value. +func (s *GetFunctionEventInvokeConfigInput) SetQualifier(v string) *GetFunctionEventInvokeConfigInput { + s.Qualifier = &v + return s +} + +type GetFunctionEventInvokeConfigOutput struct { + _ struct{} `type:"structure"` + + // A destination for events after they have been sent to a function for processing. + // + // Destinations + // + // * Function - The Amazon Resource Name (ARN) of a Lambda function. + // + // * Queue - The ARN of an SQS queue. + // + // * Topic - The ARN of an SNS topic. + // + // * Event Bus - The ARN of an Amazon EventBridge event bus. + DestinationConfig *DestinationConfig `type:"structure"` + + // The Amazon Resource Name (ARN) of the function. + FunctionArn *string `type:"string"` + + // The date and time that the configuration was last updated. + LastModified *time.Time `type:"timestamp"` + + // The maximum age of a request that Lambda sends to a function for processing. + MaximumEventAgeInSeconds *int64 `min:"60" type:"integer"` + + // The maximum number of times to retry when the function returns an error. + MaximumRetryAttempts *int64 `type:"integer"` +} + +// String returns the string representation +func (s GetFunctionEventInvokeConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetFunctionEventInvokeConfigOutput) GoString() string { + return s.String() +} + +// SetDestinationConfig sets the DestinationConfig field's value. +func (s *GetFunctionEventInvokeConfigOutput) SetDestinationConfig(v *DestinationConfig) *GetFunctionEventInvokeConfigOutput { + s.DestinationConfig = v + return s +} + +// SetFunctionArn sets the FunctionArn field's value. +func (s *GetFunctionEventInvokeConfigOutput) SetFunctionArn(v string) *GetFunctionEventInvokeConfigOutput { + s.FunctionArn = &v + return s +} + +// SetLastModified sets the LastModified field's value. +func (s *GetFunctionEventInvokeConfigOutput) SetLastModified(v time.Time) *GetFunctionEventInvokeConfigOutput { + s.LastModified = &v + return s +} + +// SetMaximumEventAgeInSeconds sets the MaximumEventAgeInSeconds field's value. +func (s *GetFunctionEventInvokeConfigOutput) SetMaximumEventAgeInSeconds(v int64) *GetFunctionEventInvokeConfigOutput { + s.MaximumEventAgeInSeconds = &v + return s +} + +// SetMaximumRetryAttempts sets the MaximumRetryAttempts field's value. +func (s *GetFunctionEventInvokeConfigOutput) SetMaximumRetryAttempts(v int64) *GetFunctionEventInvokeConfigOutput { + s.MaximumRetryAttempts = &v + return s +} + type GetFunctionInput struct { _ struct{} `type:"structure"` @@ -6858,9 +8832,8 @@ func (s *GetPolicyOutput) SetRevisionId(v string) *GetPolicyOutput { return s } -// Deprecated: InvokeAsyncInput has been deprecated -type InvokeAsyncInput struct { - _ struct{} `deprecated:"true" type:"structure" payload:"InvokeArgs"` +type GetProvisionedConcurrencyConfigInput struct { + _ struct{} `type:"structure"` // The name of the Lambda function. // @@ -6878,33 +8851,36 @@ type InvokeAsyncInput struct { // FunctionName is a required field FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - // The JSON that you want to provide to your Lambda function as input. + // The version number or alias name. // - // InvokeArgs is a required field - InvokeArgs io.ReadSeeker `type:"blob" required:"true"` + // Qualifier is a required field + Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string" required:"true"` } // String returns the string representation -func (s InvokeAsyncInput) String() string { +func (s GetProvisionedConcurrencyConfigInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InvokeAsyncInput) GoString() string { +func (s GetProvisionedConcurrencyConfigInput) 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"} +func (s *GetProvisionedConcurrencyConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetProvisionedConcurrencyConfigInput"} 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 s.Qualifier == nil { + invalidParams.Add(request.NewErrParamRequired("Qualifier")) + } + if s.Qualifier != nil && len(*s.Qualifier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1)) } if invalidParams.Len() > 0 { @@ -6914,50 +8890,540 @@ func (s *InvokeAsyncInput) Validate() error { } // SetFunctionName sets the FunctionName field's value. -func (s *InvokeAsyncInput) SetFunctionName(v string) *InvokeAsyncInput { +func (s *GetProvisionedConcurrencyConfigInput) SetFunctionName(v string) *GetProvisionedConcurrencyConfigInput { s.FunctionName = &v return s } -// SetInvokeArgs sets the InvokeArgs field's value. -func (s *InvokeAsyncInput) SetInvokeArgs(v io.ReadSeeker) *InvokeAsyncInput { - s.InvokeArgs = v +// SetQualifier sets the Qualifier field's value. +func (s *GetProvisionedConcurrencyConfigInput) SetQualifier(v string) *GetProvisionedConcurrencyConfigInput { + s.Qualifier = &v return s } -// A success response (202 Accepted) indicates that the request is queued for -// invocation. -// -// Deprecated: InvokeAsyncOutput has been deprecated -type InvokeAsyncOutput struct { - _ struct{} `deprecated:"true" type:"structure"` +type GetProvisionedConcurrencyConfigOutput struct { + _ struct{} `type:"structure"` - // The status code. - Status *int64 `location:"statusCode" type:"integer"` + // The amount of provisioned concurrency allocated. + AllocatedProvisionedConcurrentExecutions *int64 `type:"integer"` + + // The amount of provisioned concurrency available. + AvailableProvisionedConcurrentExecutions *int64 `type:"integer"` + + // The date and time that a user last updated the configuration, in ISO 8601 + // format (https://www.iso.org/iso-8601-date-and-time-format.html). + LastModified *string `type:"string"` + + // The amount of provisioned concurrency requested. + RequestedProvisionedConcurrentExecutions *int64 `min:"1" type:"integer"` + + // The status of the allocation process. + Status *string `type:"string" enum:"ProvisionedConcurrencyStatusEnum"` + + // For failed allocations, the reason that provisioned concurrency could not + // be allocated. + StatusReason *string `type:"string"` } // String returns the string representation -func (s InvokeAsyncOutput) String() string { +func (s GetProvisionedConcurrencyConfigOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InvokeAsyncOutput) GoString() string { +func (s GetProvisionedConcurrencyConfigOutput) GoString() string { return s.String() } -// SetStatus sets the Status field's value. -func (s *InvokeAsyncOutput) SetStatus(v int64) *InvokeAsyncOutput { - s.Status = &v +// SetAllocatedProvisionedConcurrentExecutions sets the AllocatedProvisionedConcurrentExecutions field's value. +func (s *GetProvisionedConcurrencyConfigOutput) SetAllocatedProvisionedConcurrentExecutions(v int64) *GetProvisionedConcurrencyConfigOutput { + s.AllocatedProvisionedConcurrentExecutions = &v return s } -type InvokeInput struct { - _ struct{} `type:"structure" payload:"Payload"` - - // Up to 3583 bytes of base64-encoded data about the invoking client to pass - // to the function in the context object. - ClientContext *string `location:"header" locationName:"X-Amz-Client-Context" type:"string"` +// SetAvailableProvisionedConcurrentExecutions sets the AvailableProvisionedConcurrentExecutions field's value. +func (s *GetProvisionedConcurrencyConfigOutput) SetAvailableProvisionedConcurrentExecutions(v int64) *GetProvisionedConcurrencyConfigOutput { + s.AvailableProvisionedConcurrentExecutions = &v + return s +} + +// SetLastModified sets the LastModified field's value. +func (s *GetProvisionedConcurrencyConfigOutput) SetLastModified(v string) *GetProvisionedConcurrencyConfigOutput { + s.LastModified = &v + return s +} + +// SetRequestedProvisionedConcurrentExecutions sets the RequestedProvisionedConcurrentExecutions field's value. +func (s *GetProvisionedConcurrencyConfigOutput) SetRequestedProvisionedConcurrentExecutions(v int64) *GetProvisionedConcurrencyConfigOutput { + s.RequestedProvisionedConcurrentExecutions = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *GetProvisionedConcurrencyConfigOutput) SetStatus(v string) *GetProvisionedConcurrencyConfigOutput { + s.Status = &v + return s +} + +// SetStatusReason sets the StatusReason field's value. +func (s *GetProvisionedConcurrencyConfigOutput) SetStatusReason(v string) *GetProvisionedConcurrencyConfigOutput { + s.StatusReason = &v + return s +} + +// One of the parameters in the request is invalid. +type InvalidParameterValueException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The exception message. + Message_ *string `locationName:"message" type:"string"` + + // The exception type. + Type *string `type:"string"` +} + +// String returns the string representation +func (s InvalidParameterValueException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterValueException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterValueException(v protocol.ResponseMetadata) error { + return &InvalidParameterValueException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterValueException) Code() string { + return "InvalidParameterValueException" +} + +// Message returns the exception's message. +func (s InvalidParameterValueException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterValueException) OrigErr() error { + return nil +} + +func (s InvalidParameterValueException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterValueException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterValueException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request body could not be parsed as JSON. +type InvalidRequestContentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The exception message. + Message_ *string `locationName:"message" type:"string"` + + // The exception type. + Type *string `type:"string"` +} + +// String returns the string representation +func (s InvalidRequestContentException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestContentException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestContentException(v protocol.ResponseMetadata) error { + return &InvalidRequestContentException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestContentException) Code() string { + return "InvalidRequestContentException" +} + +// Message returns the exception's message. +func (s InvalidRequestContentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestContentException) OrigErr() error { + return nil +} + +func (s InvalidRequestContentException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestContentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestContentException) RequestID() string { + return s.respMetadata.RequestID +} + +// The runtime or runtime version specified is not supported. +type InvalidRuntimeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s InvalidRuntimeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRuntimeException) GoString() string { + return s.String() +} + +func newErrorInvalidRuntimeException(v protocol.ResponseMetadata) error { + return &InvalidRuntimeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRuntimeException) Code() string { + return "InvalidRuntimeException" +} + +// Message returns the exception's message. +func (s InvalidRuntimeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRuntimeException) OrigErr() error { + return nil +} + +func (s InvalidRuntimeException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRuntimeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRuntimeException) RequestID() string { + return s.respMetadata.RequestID +} + +// The Security Group ID provided in the Lambda function VPC configuration is +// invalid. +type InvalidSecurityGroupIDException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s InvalidSecurityGroupIDException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidSecurityGroupIDException) GoString() string { + return s.String() +} + +func newErrorInvalidSecurityGroupIDException(v protocol.ResponseMetadata) error { + return &InvalidSecurityGroupIDException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidSecurityGroupIDException) Code() string { + return "InvalidSecurityGroupIDException" +} + +// Message returns the exception's message. +func (s InvalidSecurityGroupIDException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidSecurityGroupIDException) OrigErr() error { + return nil +} + +func (s InvalidSecurityGroupIDException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidSecurityGroupIDException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidSecurityGroupIDException) RequestID() string { + return s.respMetadata.RequestID +} + +// The Subnet ID provided in the Lambda function VPC configuration is invalid. +type InvalidSubnetIDException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s InvalidSubnetIDException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidSubnetIDException) GoString() string { + return s.String() +} + +func newErrorInvalidSubnetIDException(v protocol.ResponseMetadata) error { + return &InvalidSubnetIDException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidSubnetIDException) Code() string { + return "InvalidSubnetIDException" +} + +// Message returns the exception's message. +func (s InvalidSubnetIDException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidSubnetIDException) OrigErr() error { + return nil +} + +func (s InvalidSubnetIDException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidSubnetIDException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidSubnetIDException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS Lambda could not unzip the deployment package. +type InvalidZipFileException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s InvalidZipFileException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidZipFileException) GoString() string { + return s.String() +} + +func newErrorInvalidZipFileException(v protocol.ResponseMetadata) error { + return &InvalidZipFileException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidZipFileException) Code() string { + return "InvalidZipFileException" +} + +// Message returns the exception's message. +func (s InvalidZipFileException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidZipFileException) OrigErr() error { + return nil +} + +func (s InvalidZipFileException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidZipFileException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidZipFileException) RequestID() string { + return s.respMetadata.RequestID +} + +// Deprecated: InvokeAsyncInput has been deprecated +type InvokeAsyncInput struct { + _ struct{} `deprecated:"true" type:"structure" payload:"InvokeArgs"` + + // The name of the Lambda function. + // + // Name formats + // + // * Function name - my-function. + // + // * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function. + // + // * Partial ARN - 123456789012:function:my-function. + // + // The length constraint applies only to the full ARN. If you specify only the + // function name, it is limited to 64 characters in length. + // + // FunctionName is a required field + FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` + + // The 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 +} + +// A success response (202 Accepted) indicates that the request is queued for +// invocation. +// +// Deprecated: InvokeAsyncOutput has been deprecated +type InvokeAsyncOutput struct { + _ struct{} `deprecated:"true" type:"structure"` + + // The status code. + 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"` + + // Up to 3583 bytes of base64-encoded data about the invoking client to pass + // to the function in the context object. + ClientContext *string `location:"header" locationName:"X-Amz-Client-Context" type:"string"` // The name of the Lambda function, version, or alias. // @@ -7029,110 +9495,340 @@ func (s *InvokeInput) Validate() error { return nil } -// SetClientContext sets the ClientContext field's value. -func (s *InvokeInput) SetClientContext(v string) *InvokeInput { - s.ClientContext = &v - return s +// 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 +} + +type InvokeOutput struct { + _ struct{} `type:"structure" payload:"Payload"` + + // The version of the function that executed. When you invoke a function with + // an alias, this indicates which version the alias resolved to. + ExecutedVersion *string `location:"header" locationName:"X-Amz-Executed-Version" min:"1" type:"string"` + + // If present, indicates that an error occurred during function execution. Details + // about the error are included in the response payload. + FunctionError *string `location:"header" locationName:"X-Amz-Function-Error" type:"string"` + + // The last 4 KB of the execution log, which is base64 encoded. + LogResult *string `location:"header" locationName:"X-Amz-Log-Result" type:"string"` + + // The response from the function, or an error object. + Payload []byte `type:"blob" sensitive:"true"` + + // The HTTP status code is in the 200 range for a successful request. For the + // RequestResponse invocation type, this status code is 200. For the Event invocation + // type, this status code is 202. For the DryRun invocation type, the status + // code is 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() +} + +// SetExecutedVersion sets the ExecutedVersion field's value. +func (s *InvokeOutput) SetExecutedVersion(v string) *InvokeOutput { + s.ExecutedVersion = &v + return s +} + +// 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 +} + +// Lambda was unable to decrypt the environment variables because KMS access +// was denied. Check the Lambda function's KMS permissions. +type KMSAccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s KMSAccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KMSAccessDeniedException) GoString() string { + return s.String() +} + +func newErrorKMSAccessDeniedException(v protocol.ResponseMetadata) error { + return &KMSAccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s KMSAccessDeniedException) Code() string { + return "KMSAccessDeniedException" +} + +// Message returns the exception's message. +func (s KMSAccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s KMSAccessDeniedException) OrigErr() error { + return nil +} + +func (s KMSAccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s KMSAccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSAccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Lambda was unable to decrypt the environment variables because the KMS key +// used is disabled. Check the Lambda function's KMS key settings. +type KMSDisabledException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s KMSDisabledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s KMSDisabledException) GoString() string { + return s.String() +} + +func newErrorKMSDisabledException(v protocol.ResponseMetadata) error { + return &KMSDisabledException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s KMSDisabledException) Code() string { + return "KMSDisabledException" +} + +// Message returns the exception's message. +func (s KMSDisabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s KMSDisabledException) OrigErr() error { + return nil +} + +func (s KMSDisabledException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s KMSDisabledException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSDisabledException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type KMSInvalidStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s KMSInvalidStateException) String() string { + return awsutil.Prettify(s) } -// SetFunctionName sets the FunctionName field's value. -func (s *InvokeInput) SetFunctionName(v string) *InvokeInput { - s.FunctionName = &v - return s +// GoString returns the string representation +func (s KMSInvalidStateException) GoString() string { + return s.String() } -// SetInvocationType sets the InvocationType field's value. -func (s *InvokeInput) SetInvocationType(v string) *InvokeInput { - s.InvocationType = &v - return s +func newErrorKMSInvalidStateException(v protocol.ResponseMetadata) error { + return &KMSInvalidStateException{ + respMetadata: v, + } } -// SetLogType sets the LogType field's value. -func (s *InvokeInput) SetLogType(v string) *InvokeInput { - s.LogType = &v - return s +// Code returns the exception type name. +func (s KMSInvalidStateException) Code() string { + return "KMSInvalidStateException" } -// SetPayload sets the Payload field's value. -func (s *InvokeInput) SetPayload(v []byte) *InvokeInput { - s.Payload = v - return s +// Message returns the exception's message. +func (s KMSInvalidStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetQualifier sets the Qualifier field's value. -func (s *InvokeInput) SetQualifier(v string) *InvokeInput { - s.Qualifier = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s KMSInvalidStateException) OrigErr() error { + return nil } -type InvokeOutput struct { - _ struct{} `type:"structure" payload:"Payload"` +func (s KMSInvalidStateException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} - // The version of the function that executed. When you invoke a function with - // an alias, this indicates which version the alias resolved to. - ExecutedVersion *string `location:"header" locationName:"X-Amz-Executed-Version" min:"1" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s KMSInvalidStateException) StatusCode() int { + return s.respMetadata.StatusCode +} - // If present, indicates that an error occurred during function execution. Details - // about the error are included in the response payload. - // - // * Handled - The runtime caught an error thrown by the function and formatted - // it into a JSON document. - // - // * Unhandled - The runtime didn't handle the error. For example, the function - // ran out of memory or timed out. - FunctionError *string `location:"header" locationName:"X-Amz-Function-Error" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s KMSInvalidStateException) RequestID() string { + return s.respMetadata.RequestID +} - // The last 4 KB of the execution log, which is base64 encoded. - LogResult *string `location:"header" locationName:"X-Amz-Log-Result" type:"string"` +// Lambda was unable to decrypt the environment variables because the KMS key +// was not found. Check the function's KMS key settings. +type KMSNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The response from the function, or an error object. - Payload []byte `type:"blob" sensitive:"true"` + Message_ *string `locationName:"Message" type:"string"` - // The HTTP status code is in the 200 range for a successful request. For the - // RequestResponse invocation type, this status code is 200. For the Event invocation - // type, this status code is 202. For the DryRun invocation type, the status - // code is 204. - StatusCode *int64 `location:"statusCode" type:"integer"` + Type *string `type:"string"` } // String returns the string representation -func (s InvokeOutput) String() string { +func (s KMSNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InvokeOutput) GoString() string { +func (s KMSNotFoundException) GoString() string { return s.String() } -// SetExecutedVersion sets the ExecutedVersion field's value. -func (s *InvokeOutput) SetExecutedVersion(v string) *InvokeOutput { - s.ExecutedVersion = &v - return s +func newErrorKMSNotFoundException(v protocol.ResponseMetadata) error { + return &KMSNotFoundException{ + respMetadata: v, + } } -// SetFunctionError sets the FunctionError field's value. -func (s *InvokeOutput) SetFunctionError(v string) *InvokeOutput { - s.FunctionError = &v - return s +// Code returns the exception type name. +func (s KMSNotFoundException) Code() string { + return "KMSNotFoundException" } -// SetLogResult sets the LogResult field's value. -func (s *InvokeOutput) SetLogResult(v string) *InvokeOutput { - s.LogResult = &v - return s +// Message returns the exception's message. +func (s KMSNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetPayload sets the Payload field's value. -func (s *InvokeOutput) SetPayload(v []byte) *InvokeOutput { - s.Payload = v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s KMSNotFoundException) OrigErr() error { + return nil } -// SetStatusCode sets the StatusCode field's value. -func (s *InvokeOutput) SetStatusCode(v int64) *InvokeOutput { - s.StatusCode = &v - return s +func (s KMSNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s KMSNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s KMSNotFoundException) RequestID() string { + return s.respMetadata.RequestID } // An AWS Lambda layer (https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html). @@ -7631,6 +10327,112 @@ func (s *ListEventSourceMappingsOutput) SetNextMarker(v string) *ListEventSource return s } +type ListFunctionEventInvokeConfigsInput struct { + _ struct{} `type:"structure"` + + // The name of the Lambda function. + // + // Name formats + // + // * Function name - my-function. + // + // * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function. + // + // * Partial ARN - 123456789012:function:my-function. + // + // The length constraint applies only to the full ARN. If you specify only the + // function name, it is limited to 64 characters in length. + // + // FunctionName is a required field + FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` + + // Specify the pagination token that's returned by a previous request to retrieve + // the next page of results. + Marker *string `location:"querystring" locationName:"Marker" type:"string"` + + // The maximum number of configurations to return. + MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` +} + +// String returns the string representation +func (s ListFunctionEventInvokeConfigsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListFunctionEventInvokeConfigsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListFunctionEventInvokeConfigsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListFunctionEventInvokeConfigsInput"} + 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 *ListFunctionEventInvokeConfigsInput) SetFunctionName(v string) *ListFunctionEventInvokeConfigsInput { + s.FunctionName = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListFunctionEventInvokeConfigsInput) SetMarker(v string) *ListFunctionEventInvokeConfigsInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListFunctionEventInvokeConfigsInput) SetMaxItems(v int64) *ListFunctionEventInvokeConfigsInput { + s.MaxItems = &v + return s +} + +type ListFunctionEventInvokeConfigsOutput struct { + _ struct{} `type:"structure"` + + // A list of configurations. + FunctionEventInvokeConfigs []*FunctionEventInvokeConfig `type:"list"` + + // The pagination token that's included if more results are available. + NextMarker *string `type:"string"` +} + +// String returns the string representation +func (s ListFunctionEventInvokeConfigsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListFunctionEventInvokeConfigsOutput) GoString() string { + return s.String() +} + +// SetFunctionEventInvokeConfigs sets the FunctionEventInvokeConfigs field's value. +func (s *ListFunctionEventInvokeConfigsOutput) SetFunctionEventInvokeConfigs(v []*FunctionEventInvokeConfig) *ListFunctionEventInvokeConfigsOutput { + s.FunctionEventInvokeConfigs = v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListFunctionEventInvokeConfigsOutput) SetNextMarker(v string) *ListFunctionEventInvokeConfigsOutput { + s.NextMarker = &v + return s +} + type ListFunctionsInput struct { _ struct{} `type:"structure"` @@ -7642,11 +10444,12 @@ type ListFunctionsInput struct { Marker *string `location:"querystring" locationName:"Marker" type:"string"` // For Lambda@Edge functions, the AWS Region of the master function. For example, - // us-east-2 or ALL. If specified, you must set FunctionVersion to ALL. + // us-east-1 filters the list of functions to only include Lambda@Edge functions + // replicated from a master function in US East (N. Virginia). If specified, + // you must set FunctionVersion to ALL. MasterRegion *string `location:"querystring" locationName:"MasterRegion" type:"string"` - // Specify a value between 1 and 50 to limit the number of functions in the - // response. + // The maximum number of functions to return. MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` } @@ -7783,82 +10586,188 @@ func (s *ListLayerVersionsInput) SetCompatibleRuntime(v string) *ListLayerVersio return s } -// SetLayerName sets the LayerName field's value. -func (s *ListLayerVersionsInput) SetLayerName(v string) *ListLayerVersionsInput { - s.LayerName = &v +// SetLayerName sets the LayerName field's value. +func (s *ListLayerVersionsInput) SetLayerName(v string) *ListLayerVersionsInput { + s.LayerName = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *ListLayerVersionsInput) SetMarker(v string) *ListLayerVersionsInput { + s.Marker = &v + return s +} + +// SetMaxItems sets the MaxItems field's value. +func (s *ListLayerVersionsInput) SetMaxItems(v int64) *ListLayerVersionsInput { + s.MaxItems = &v + return s +} + +type ListLayerVersionsOutput struct { + _ struct{} `type:"structure"` + + // A list of versions. + LayerVersions []*LayerVersionsListItem `type:"list"` + + // A pagination token returned when the response doesn't contain all versions. + NextMarker *string `type:"string"` +} + +// String returns the string representation +func (s ListLayerVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListLayerVersionsOutput) GoString() string { + return s.String() +} + +// SetLayerVersions sets the LayerVersions field's value. +func (s *ListLayerVersionsOutput) SetLayerVersions(v []*LayerVersionsListItem) *ListLayerVersionsOutput { + s.LayerVersions = v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListLayerVersionsOutput) SetNextMarker(v string) *ListLayerVersionsOutput { + s.NextMarker = &v + return s +} + +type ListLayersInput struct { + _ struct{} `type:"structure"` + + // A runtime identifier. For example, go1.x. + CompatibleRuntime *string `location:"querystring" locationName:"CompatibleRuntime" type:"string" enum:"Runtime"` + + // A pagination token returned by a previous call. + Marker *string `location:"querystring" locationName:"Marker" type:"string"` + + // The maximum number of layers to return. + MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` +} + +// String returns the string representation +func (s ListLayersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListLayersInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListLayersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListLayersInput"} + if s.MaxItems != nil && *s.MaxItems < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCompatibleRuntime sets the CompatibleRuntime field's value. +func (s *ListLayersInput) SetCompatibleRuntime(v string) *ListLayersInput { + s.CompatibleRuntime = &v return s } // SetMarker sets the Marker field's value. -func (s *ListLayerVersionsInput) SetMarker(v string) *ListLayerVersionsInput { +func (s *ListLayersInput) SetMarker(v string) *ListLayersInput { s.Marker = &v return s } // SetMaxItems sets the MaxItems field's value. -func (s *ListLayerVersionsInput) SetMaxItems(v int64) *ListLayerVersionsInput { +func (s *ListLayersInput) SetMaxItems(v int64) *ListLayersInput { s.MaxItems = &v return s } -type ListLayerVersionsOutput struct { +type ListLayersOutput struct { _ struct{} `type:"structure"` - // A list of versions. - LayerVersions []*LayerVersionsListItem `type:"list"` + // A list of function layers. + Layers []*LayersListItem `type:"list"` - // A pagination token returned when the response doesn't contain all versions. + // A pagination token returned when the response doesn't contain all layers. NextMarker *string `type:"string"` } // String returns the string representation -func (s ListLayerVersionsOutput) String() string { +func (s ListLayersOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListLayerVersionsOutput) GoString() string { +func (s ListLayersOutput) GoString() string { return s.String() } -// SetLayerVersions sets the LayerVersions field's value. -func (s *ListLayerVersionsOutput) SetLayerVersions(v []*LayerVersionsListItem) *ListLayerVersionsOutput { - s.LayerVersions = v +// SetLayers sets the Layers field's value. +func (s *ListLayersOutput) SetLayers(v []*LayersListItem) *ListLayersOutput { + s.Layers = v return s } // SetNextMarker sets the NextMarker field's value. -func (s *ListLayerVersionsOutput) SetNextMarker(v string) *ListLayerVersionsOutput { +func (s *ListLayersOutput) SetNextMarker(v string) *ListLayersOutput { s.NextMarker = &v return s } -type ListLayersInput struct { +type ListProvisionedConcurrencyConfigsInput struct { _ struct{} `type:"structure"` - // A runtime identifier. For example, go1.x. - CompatibleRuntime *string `location:"querystring" locationName:"CompatibleRuntime" type:"string" enum:"Runtime"` + // The name of the Lambda function. + // + // Name formats + // + // * Function name - my-function. + // + // * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function. + // + // * Partial ARN - 123456789012:function:my-function. + // + // The length constraint applies only to the full ARN. If you specify only the + // function name, it is limited to 64 characters in length. + // + // FunctionName is a required field + FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` - // A pagination token returned by a previous call. + // Specify the pagination token that's returned by a previous request to retrieve + // the next page of results. Marker *string `location:"querystring" locationName:"Marker" type:"string"` - // The maximum number of layers to return. + // Specify a number to limit the number of configurations returned. MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` } // String returns the string representation -func (s ListLayersInput) String() string { +func (s ListProvisionedConcurrencyConfigsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListLayersInput) GoString() string { +func (s ListProvisionedConcurrencyConfigsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListLayersInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListLayersInput"} +func (s *ListProvisionedConcurrencyConfigsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListProvisionedConcurrencyConfigsInput"} + 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)) } @@ -7869,53 +10778,53 @@ func (s *ListLayersInput) Validate() error { return nil } -// SetCompatibleRuntime sets the CompatibleRuntime field's value. -func (s *ListLayersInput) SetCompatibleRuntime(v string) *ListLayersInput { - s.CompatibleRuntime = &v +// SetFunctionName sets the FunctionName field's value. +func (s *ListProvisionedConcurrencyConfigsInput) SetFunctionName(v string) *ListProvisionedConcurrencyConfigsInput { + s.FunctionName = &v return s } // SetMarker sets the Marker field's value. -func (s *ListLayersInput) SetMarker(v string) *ListLayersInput { +func (s *ListProvisionedConcurrencyConfigsInput) SetMarker(v string) *ListProvisionedConcurrencyConfigsInput { s.Marker = &v return s } // SetMaxItems sets the MaxItems field's value. -func (s *ListLayersInput) SetMaxItems(v int64) *ListLayersInput { +func (s *ListProvisionedConcurrencyConfigsInput) SetMaxItems(v int64) *ListProvisionedConcurrencyConfigsInput { s.MaxItems = &v return s } -type ListLayersOutput struct { +type ListProvisionedConcurrencyConfigsOutput struct { _ struct{} `type:"structure"` - // A list of function layers. - Layers []*LayersListItem `type:"list"` - - // A pagination token returned when the response doesn't contain all layers. + // The pagination token that's included if more results are available. NextMarker *string `type:"string"` + + // A list of provisioned concurrency configurations. + ProvisionedConcurrencyConfigs []*ProvisionedConcurrencyConfigListItem `type:"list"` } // String returns the string representation -func (s ListLayersOutput) String() string { +func (s ListProvisionedConcurrencyConfigsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListLayersOutput) GoString() string { +func (s ListProvisionedConcurrencyConfigsOutput) GoString() string { return s.String() } -// SetLayers sets the Layers field's value. -func (s *ListLayersOutput) SetLayers(v []*LayersListItem) *ListLayersOutput { - s.Layers = v +// SetNextMarker sets the NextMarker field's value. +func (s *ListProvisionedConcurrencyConfigsOutput) SetNextMarker(v string) *ListProvisionedConcurrencyConfigsOutput { + s.NextMarker = &v return s } -// SetNextMarker sets the NextMarker field's value. -func (s *ListLayersOutput) SetNextMarker(v string) *ListLayersOutput { - s.NextMarker = &v +// SetProvisionedConcurrencyConfigs sets the ProvisionedConcurrencyConfigs field's value. +func (s *ListProvisionedConcurrencyConfigsOutput) SetProvisionedConcurrencyConfigs(v []*ProvisionedConcurrencyConfigListItem) *ListProvisionedConcurrencyConfigsOutput { + s.ProvisionedConcurrencyConfigs = v return s } @@ -8006,7 +10915,7 @@ type ListVersionsByFunctionInput struct { // the next page of results. Marker *string `location:"querystring" locationName:"Marker" type:"string"` - // Limit the number of versions that are returned. + // The maximum number of versions to return. MaxItems *int64 `location:"querystring" locationName:"MaxItems" min:"1" type:"integer"` } @@ -8033,60 +10942,367 @@ func (s *ListVersionsByFunctionInput) Validate() error { invalidParams.Add(request.NewErrParamMinValue("MaxItems", 1)) } - if invalidParams.Len() > 0 { - return invalidParams - } - return nil + 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"` + + // The pagination token that's included if more results are available. + 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 +} + +// A destination for events that failed processing. +type OnFailure struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the destination resource. + Destination *string `type:"string"` +} + +// String returns the string representation +func (s OnFailure) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OnFailure) GoString() string { + return s.String() +} + +// SetDestination sets the Destination field's value. +func (s *OnFailure) SetDestination(v string) *OnFailure { + s.Destination = &v + return s +} + +// A destination for events that were processed successfully. +type OnSuccess struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the destination resource. + Destination *string `type:"string"` +} + +// String returns the string representation +func (s OnSuccess) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OnSuccess) GoString() string { + return s.String() +} + +// SetDestination sets the Destination field's value. +func (s *OnSuccess) SetDestination(v string) *OnSuccess { + s.Destination = &v + return s +} + +// The permissions policy for the resource is too large. Learn more (https://docs.aws.amazon.com/lambda/latest/dg/limits.html) +type PolicyLengthExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s PolicyLengthExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyLengthExceededException) GoString() string { + return s.String() +} + +func newErrorPolicyLengthExceededException(v protocol.ResponseMetadata) error { + return &PolicyLengthExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PolicyLengthExceededException) Code() string { + return "PolicyLengthExceededException" +} + +// Message returns the exception's message. +func (s PolicyLengthExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PolicyLengthExceededException) OrigErr() error { + return nil +} + +func (s PolicyLengthExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PolicyLengthExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PolicyLengthExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The RevisionId provided does not match the latest RevisionId for the Lambda +// function or alias. Call the GetFunction or the GetAlias API to retrieve the +// latest RevisionId for your resource. +type PreconditionFailedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The exception message. + Message_ *string `locationName:"message" type:"string"` + + // The exception type. + Type *string `type:"string"` +} + +// String returns the string representation +func (s PreconditionFailedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PreconditionFailedException) GoString() string { + return s.String() +} + +func newErrorPreconditionFailedException(v protocol.ResponseMetadata) error { + return &PreconditionFailedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PreconditionFailedException) Code() string { + return "PreconditionFailedException" +} + +// Message returns the exception's message. +func (s PreconditionFailedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PreconditionFailedException) OrigErr() error { + return nil +} + +func (s PreconditionFailedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PreconditionFailedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PreconditionFailedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Details about the provisioned concurrency configuration for a function alias +// or version. +type ProvisionedConcurrencyConfigListItem struct { + _ struct{} `type:"structure"` + + // The amount of provisioned concurrency allocated. + AllocatedProvisionedConcurrentExecutions *int64 `type:"integer"` + + // The amount of provisioned concurrency available. + AvailableProvisionedConcurrentExecutions *int64 `type:"integer"` + + // The Amazon Resource Name (ARN) of the alias or version. + FunctionArn *string `type:"string"` + + // The date and time that a user last updated the configuration, in ISO 8601 + // format (https://www.iso.org/iso-8601-date-and-time-format.html). + LastModified *string `type:"string"` + + // The amount of provisioned concurrency requested. + RequestedProvisionedConcurrentExecutions *int64 `min:"1" type:"integer"` + + // The status of the allocation process. + Status *string `type:"string" enum:"ProvisionedConcurrencyStatusEnum"` + + // For failed allocations, the reason that provisioned concurrency could not + // be allocated. + StatusReason *string `type:"string"` +} + +// String returns the string representation +func (s ProvisionedConcurrencyConfigListItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ProvisionedConcurrencyConfigListItem) GoString() string { + return s.String() +} + +// SetAllocatedProvisionedConcurrentExecutions sets the AllocatedProvisionedConcurrentExecutions field's value. +func (s *ProvisionedConcurrencyConfigListItem) SetAllocatedProvisionedConcurrentExecutions(v int64) *ProvisionedConcurrencyConfigListItem { + s.AllocatedProvisionedConcurrentExecutions = &v + return s +} + +// SetAvailableProvisionedConcurrentExecutions sets the AvailableProvisionedConcurrentExecutions field's value. +func (s *ProvisionedConcurrencyConfigListItem) SetAvailableProvisionedConcurrentExecutions(v int64) *ProvisionedConcurrencyConfigListItem { + s.AvailableProvisionedConcurrentExecutions = &v + return s +} + +// SetFunctionArn sets the FunctionArn field's value. +func (s *ProvisionedConcurrencyConfigListItem) SetFunctionArn(v string) *ProvisionedConcurrencyConfigListItem { + s.FunctionArn = &v + return s } -// SetFunctionName sets the FunctionName field's value. -func (s *ListVersionsByFunctionInput) SetFunctionName(v string) *ListVersionsByFunctionInput { - s.FunctionName = &v +// SetLastModified sets the LastModified field's value. +func (s *ProvisionedConcurrencyConfigListItem) SetLastModified(v string) *ProvisionedConcurrencyConfigListItem { + s.LastModified = &v return s } -// SetMarker sets the Marker field's value. -func (s *ListVersionsByFunctionInput) SetMarker(v string) *ListVersionsByFunctionInput { - s.Marker = &v +// SetRequestedProvisionedConcurrentExecutions sets the RequestedProvisionedConcurrentExecutions field's value. +func (s *ProvisionedConcurrencyConfigListItem) SetRequestedProvisionedConcurrentExecutions(v int64) *ProvisionedConcurrencyConfigListItem { + s.RequestedProvisionedConcurrentExecutions = &v return s } -// SetMaxItems sets the MaxItems field's value. -func (s *ListVersionsByFunctionInput) SetMaxItems(v int64) *ListVersionsByFunctionInput { - s.MaxItems = &v +// SetStatus sets the Status field's value. +func (s *ProvisionedConcurrencyConfigListItem) SetStatus(v string) *ProvisionedConcurrencyConfigListItem { + s.Status = &v return s } -type ListVersionsByFunctionOutput struct { - _ struct{} `type:"structure"` +// SetStatusReason sets the StatusReason field's value. +func (s *ProvisionedConcurrencyConfigListItem) SetStatusReason(v string) *ProvisionedConcurrencyConfigListItem { + s.StatusReason = &v + return s +} - // The pagination token that's included if more results are available. - NextMarker *string `type:"string"` +// The specified configuration does not exist. +type ProvisionedConcurrencyConfigNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // A list of Lambda function versions. - Versions []*FunctionConfiguration `type:"list"` + Message_ *string `locationName:"message" type:"string"` + + Type *string `type:"string"` } // String returns the string representation -func (s ListVersionsByFunctionOutput) String() string { +func (s ProvisionedConcurrencyConfigNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListVersionsByFunctionOutput) GoString() string { +func (s ProvisionedConcurrencyConfigNotFoundException) GoString() string { return s.String() } -// SetNextMarker sets the NextMarker field's value. -func (s *ListVersionsByFunctionOutput) SetNextMarker(v string) *ListVersionsByFunctionOutput { - s.NextMarker = &v - return s +func newErrorProvisionedConcurrencyConfigNotFoundException(v protocol.ResponseMetadata) error { + return &ProvisionedConcurrencyConfigNotFoundException{ + respMetadata: v, + } } -// SetVersions sets the Versions field's value. -func (s *ListVersionsByFunctionOutput) SetVersions(v []*FunctionConfiguration) *ListVersionsByFunctionOutput { - s.Versions = v - return s +// Code returns the exception type name. +func (s ProvisionedConcurrencyConfigNotFoundException) Code() string { + return "ProvisionedConcurrencyConfigNotFoundException" +} + +// Message returns the exception's message. +func (s ProvisionedConcurrencyConfigNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ProvisionedConcurrencyConfigNotFoundException) OrigErr() error { + return nil +} + +func (s ProvisionedConcurrencyConfigNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ProvisionedConcurrencyConfigNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ProvisionedConcurrencyConfigNotFoundException) RequestID() string { + return s.respMetadata.RequestID } type PublishLayerVersionInput struct { @@ -8411,38 +11627,368 @@ func (s *PutFunctionConcurrencyInput) Validate() error { } // SetFunctionName sets the FunctionName field's value. -func (s *PutFunctionConcurrencyInput) SetFunctionName(v string) *PutFunctionConcurrencyInput { +func (s *PutFunctionConcurrencyInput) SetFunctionName(v string) *PutFunctionConcurrencyInput { + s.FunctionName = &v + return s +} + +// SetReservedConcurrentExecutions sets the ReservedConcurrentExecutions field's value. +func (s *PutFunctionConcurrencyInput) SetReservedConcurrentExecutions(v int64) *PutFunctionConcurrencyInput { + s.ReservedConcurrentExecutions = &v + return s +} + +type PutFunctionConcurrencyOutput struct { + _ struct{} `type:"structure"` + + // The number of concurrent executions that are reserved for this function. + // For more information, see Managing Concurrency (https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html). + ReservedConcurrentExecutions *int64 `type:"integer"` +} + +// String returns the string representation +func (s PutFunctionConcurrencyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutFunctionConcurrencyOutput) GoString() string { + return s.String() +} + +// SetReservedConcurrentExecutions sets the ReservedConcurrentExecutions field's value. +func (s *PutFunctionConcurrencyOutput) SetReservedConcurrentExecutions(v int64) *PutFunctionConcurrencyOutput { + s.ReservedConcurrentExecutions = &v + return s +} + +type PutFunctionEventInvokeConfigInput struct { + _ struct{} `type:"structure"` + + // A destination for events after they have been sent to a function for processing. + // + // Destinations + // + // * Function - The Amazon Resource Name (ARN) of a Lambda function. + // + // * Queue - The ARN of an SQS queue. + // + // * Topic - The ARN of an SNS topic. + // + // * Event Bus - The ARN of an Amazon EventBridge event bus. + DestinationConfig *DestinationConfig `type:"structure"` + + // The name of the Lambda function, version, or alias. + // + // Name formats + // + // * Function name - my-function (name-only), my-function:v1 (with alias). + // + // * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function. + // + // * Partial ARN - 123456789012:function:my-function. + // + // You can append a version number or alias to any of the formats. The length + // constraint applies only to the full ARN. If you specify only the function + // name, it is limited to 64 characters in length. + // + // FunctionName is a required field + FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` + + // The maximum age of a request that Lambda sends to a function for processing. + MaximumEventAgeInSeconds *int64 `min:"60" type:"integer"` + + // The maximum number of times to retry when the function returns an error. + MaximumRetryAttempts *int64 `type:"integer"` + + // A version number or alias name. + Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` +} + +// String returns the string representation +func (s PutFunctionEventInvokeConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutFunctionEventInvokeConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutFunctionEventInvokeConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutFunctionEventInvokeConfigInput"} + 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.MaximumEventAgeInSeconds != nil && *s.MaximumEventAgeInSeconds < 60 { + invalidParams.Add(request.NewErrParamMinValue("MaximumEventAgeInSeconds", 60)) + } + if s.Qualifier != nil && len(*s.Qualifier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDestinationConfig sets the DestinationConfig field's value. +func (s *PutFunctionEventInvokeConfigInput) SetDestinationConfig(v *DestinationConfig) *PutFunctionEventInvokeConfigInput { + s.DestinationConfig = v + return s +} + +// SetFunctionName sets the FunctionName field's value. +func (s *PutFunctionEventInvokeConfigInput) SetFunctionName(v string) *PutFunctionEventInvokeConfigInput { + s.FunctionName = &v + return s +} + +// SetMaximumEventAgeInSeconds sets the MaximumEventAgeInSeconds field's value. +func (s *PutFunctionEventInvokeConfigInput) SetMaximumEventAgeInSeconds(v int64) *PutFunctionEventInvokeConfigInput { + s.MaximumEventAgeInSeconds = &v + return s +} + +// SetMaximumRetryAttempts sets the MaximumRetryAttempts field's value. +func (s *PutFunctionEventInvokeConfigInput) SetMaximumRetryAttempts(v int64) *PutFunctionEventInvokeConfigInput { + s.MaximumRetryAttempts = &v + return s +} + +// SetQualifier sets the Qualifier field's value. +func (s *PutFunctionEventInvokeConfigInput) SetQualifier(v string) *PutFunctionEventInvokeConfigInput { + s.Qualifier = &v + return s +} + +type PutFunctionEventInvokeConfigOutput struct { + _ struct{} `type:"structure"` + + // A destination for events after they have been sent to a function for processing. + // + // Destinations + // + // * Function - The Amazon Resource Name (ARN) of a Lambda function. + // + // * Queue - The ARN of an SQS queue. + // + // * Topic - The ARN of an SNS topic. + // + // * Event Bus - The ARN of an Amazon EventBridge event bus. + DestinationConfig *DestinationConfig `type:"structure"` + + // The Amazon Resource Name (ARN) of the function. + FunctionArn *string `type:"string"` + + // The date and time that the configuration was last updated. + LastModified *time.Time `type:"timestamp"` + + // The maximum age of a request that Lambda sends to a function for processing. + MaximumEventAgeInSeconds *int64 `min:"60" type:"integer"` + + // The maximum number of times to retry when the function returns an error. + MaximumRetryAttempts *int64 `type:"integer"` +} + +// String returns the string representation +func (s PutFunctionEventInvokeConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutFunctionEventInvokeConfigOutput) GoString() string { + return s.String() +} + +// SetDestinationConfig sets the DestinationConfig field's value. +func (s *PutFunctionEventInvokeConfigOutput) SetDestinationConfig(v *DestinationConfig) *PutFunctionEventInvokeConfigOutput { + s.DestinationConfig = v + return s +} + +// SetFunctionArn sets the FunctionArn field's value. +func (s *PutFunctionEventInvokeConfigOutput) SetFunctionArn(v string) *PutFunctionEventInvokeConfigOutput { + s.FunctionArn = &v + return s +} + +// SetLastModified sets the LastModified field's value. +func (s *PutFunctionEventInvokeConfigOutput) SetLastModified(v time.Time) *PutFunctionEventInvokeConfigOutput { + s.LastModified = &v + return s +} + +// SetMaximumEventAgeInSeconds sets the MaximumEventAgeInSeconds field's value. +func (s *PutFunctionEventInvokeConfigOutput) SetMaximumEventAgeInSeconds(v int64) *PutFunctionEventInvokeConfigOutput { + s.MaximumEventAgeInSeconds = &v + return s +} + +// SetMaximumRetryAttempts sets the MaximumRetryAttempts field's value. +func (s *PutFunctionEventInvokeConfigOutput) SetMaximumRetryAttempts(v int64) *PutFunctionEventInvokeConfigOutput { + s.MaximumRetryAttempts = &v + return s +} + +type PutProvisionedConcurrencyConfigInput struct { + _ struct{} `type:"structure"` + + // The name of the Lambda function. + // + // Name formats + // + // * Function name - my-function. + // + // * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function. + // + // * Partial ARN - 123456789012:function:my-function. + // + // The length constraint applies only to the full ARN. If you specify only the + // function name, it is limited to 64 characters in length. + // + // FunctionName is a required field + FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` + + // The amount of provisioned concurrency to allocate for the version or alias. + // + // ProvisionedConcurrentExecutions is a required field + ProvisionedConcurrentExecutions *int64 `min:"1" type:"integer" required:"true"` + + // The version number or alias name. + // + // Qualifier is a required field + Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s PutProvisionedConcurrencyConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutProvisionedConcurrencyConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutProvisionedConcurrencyConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutProvisionedConcurrencyConfigInput"} + 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.ProvisionedConcurrentExecutions == nil { + invalidParams.Add(request.NewErrParamRequired("ProvisionedConcurrentExecutions")) + } + if s.ProvisionedConcurrentExecutions != nil && *s.ProvisionedConcurrentExecutions < 1 { + invalidParams.Add(request.NewErrParamMinValue("ProvisionedConcurrentExecutions", 1)) + } + if s.Qualifier == nil { + invalidParams.Add(request.NewErrParamRequired("Qualifier")) + } + 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 *PutProvisionedConcurrencyConfigInput) SetFunctionName(v string) *PutProvisionedConcurrencyConfigInput { s.FunctionName = &v return s } -// SetReservedConcurrentExecutions sets the ReservedConcurrentExecutions field's value. -func (s *PutFunctionConcurrencyInput) SetReservedConcurrentExecutions(v int64) *PutFunctionConcurrencyInput { - s.ReservedConcurrentExecutions = &v +// SetProvisionedConcurrentExecutions sets the ProvisionedConcurrentExecutions field's value. +func (s *PutProvisionedConcurrencyConfigInput) SetProvisionedConcurrentExecutions(v int64) *PutProvisionedConcurrencyConfigInput { + s.ProvisionedConcurrentExecutions = &v return s } -type PutFunctionConcurrencyOutput struct { +// SetQualifier sets the Qualifier field's value. +func (s *PutProvisionedConcurrencyConfigInput) SetQualifier(v string) *PutProvisionedConcurrencyConfigInput { + s.Qualifier = &v + return s +} + +type PutProvisionedConcurrencyConfigOutput struct { _ struct{} `type:"structure"` - // The number of concurrent executions that are reserved for this function. - // For more information, see Managing Concurrency (https://docs.aws.amazon.com/lambda/latest/dg/concurrent-executions.html). - ReservedConcurrentExecutions *int64 `type:"integer"` + // The amount of provisioned concurrency allocated. + AllocatedProvisionedConcurrentExecutions *int64 `type:"integer"` + + // The amount of provisioned concurrency available. + AvailableProvisionedConcurrentExecutions *int64 `type:"integer"` + + // The date and time that a user last updated the configuration, in ISO 8601 + // format (https://www.iso.org/iso-8601-date-and-time-format.html). + LastModified *string `type:"string"` + + // The amount of provisioned concurrency requested. + RequestedProvisionedConcurrentExecutions *int64 `min:"1" type:"integer"` + + // The status of the allocation process. + Status *string `type:"string" enum:"ProvisionedConcurrencyStatusEnum"` + + // For failed allocations, the reason that provisioned concurrency could not + // be allocated. + StatusReason *string `type:"string"` } // String returns the string representation -func (s PutFunctionConcurrencyOutput) String() string { +func (s PutProvisionedConcurrencyConfigOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutFunctionConcurrencyOutput) GoString() string { +func (s PutProvisionedConcurrencyConfigOutput) GoString() string { return s.String() } -// SetReservedConcurrentExecutions sets the ReservedConcurrentExecutions field's value. -func (s *PutFunctionConcurrencyOutput) SetReservedConcurrentExecutions(v int64) *PutFunctionConcurrencyOutput { - s.ReservedConcurrentExecutions = &v +// SetAllocatedProvisionedConcurrentExecutions sets the AllocatedProvisionedConcurrentExecutions field's value. +func (s *PutProvisionedConcurrencyConfigOutput) SetAllocatedProvisionedConcurrentExecutions(v int64) *PutProvisionedConcurrencyConfigOutput { + s.AllocatedProvisionedConcurrentExecutions = &v + return s +} + +// SetAvailableProvisionedConcurrentExecutions sets the AvailableProvisionedConcurrentExecutions field's value. +func (s *PutProvisionedConcurrencyConfigOutput) SetAvailableProvisionedConcurrentExecutions(v int64) *PutProvisionedConcurrencyConfigOutput { + s.AvailableProvisionedConcurrentExecutions = &v + return s +} + +// SetLastModified sets the LastModified field's value. +func (s *PutProvisionedConcurrencyConfigOutput) SetLastModified(v string) *PutProvisionedConcurrencyConfigOutput { + s.LastModified = &v + return s +} + +// SetRequestedProvisionedConcurrentExecutions sets the RequestedProvisionedConcurrentExecutions field's value. +func (s *PutProvisionedConcurrencyConfigOutput) SetRequestedProvisionedConcurrentExecutions(v int64) *PutProvisionedConcurrencyConfigOutput { + s.RequestedProvisionedConcurrentExecutions = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *PutProvisionedConcurrencyConfigOutput) SetStatus(v string) *PutProvisionedConcurrencyConfigOutput { + s.Status = &v + return s +} + +// SetStatusReason sets the StatusReason field's value. +func (s *PutProvisionedConcurrencyConfigOutput) SetStatusReason(v string) *PutProvisionedConcurrencyConfigOutput { + s.StatusReason = &v return s } @@ -8630,24 +12176,439 @@ func (s *RemovePermissionInput) SetRevisionId(v string) *RemovePermissionInput { return s } -// SetStatementId sets the StatementId field's value. -func (s *RemovePermissionInput) SetStatementId(v string) *RemovePermissionInput { - s.StatementId = &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() +} + +// The request payload exceeded the Invoke request body JSON input limit. For +// more information, see Limits (https://docs.aws.amazon.com/lambda/latest/dg/limits.html). +type RequestTooLargeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s RequestTooLargeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestTooLargeException) GoString() string { + return s.String() +} + +func newErrorRequestTooLargeException(v protocol.ResponseMetadata) error { + return &RequestTooLargeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RequestTooLargeException) Code() string { + return "RequestTooLargeException" +} + +// Message returns the exception's message. +func (s RequestTooLargeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RequestTooLargeException) OrigErr() error { + return nil +} + +func (s RequestTooLargeException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RequestTooLargeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RequestTooLargeException) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource already exists, or another operation is in progress. +type ResourceConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The exception message. + Message_ *string `locationName:"message" type:"string"` + + // The exception type. + Type *string `type:"string"` +} + +// String returns the string representation +func (s ResourceConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceConflictException) GoString() string { + return s.String() +} + +func newErrorResourceConflictException(v protocol.ResponseMetadata) error { + return &ResourceConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceConflictException) Code() string { + return "ResourceConflictException" +} + +// Message returns the exception's message. +func (s ResourceConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceConflictException) OrigErr() error { + return nil +} + +func (s ResourceConflictException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceConflictException) RequestID() string { + return s.respMetadata.RequestID +} + +// The operation conflicts with the resource's availability. For example, you +// attempted to update an EventSource Mapping in CREATING, or tried to delete +// a EventSource mapping currently in the UPDATING state. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource specified in the request does not exist. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The function is inactive and its VPC connection is no longer available. Wait +// for the VPC connection to reestablish and try again. +type ResourceNotReadyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The exception message. + Message_ *string `locationName:"message" type:"string"` + + // The exception type. + Type *string `type:"string"` +} + +// String returns the string representation +func (s ResourceNotReadyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotReadyException) GoString() string { + return s.String() +} + +func newErrorResourceNotReadyException(v protocol.ResponseMetadata) error { + return &ResourceNotReadyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotReadyException) Code() string { + return "ResourceNotReadyException" +} + +// Message returns the exception's message. +func (s ResourceNotReadyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotReadyException) OrigErr() error { + return nil +} + +func (s ResourceNotReadyException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotReadyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotReadyException) RequestID() string { + return s.respMetadata.RequestID +} + +// The AWS Lambda service encountered an internal error. +type ServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s ServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceException) GoString() string { + return s.String() +} + +func newErrorServiceException(v protocol.ResponseMetadata) error { + return &ServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceException) Code() string { + return "ServiceException" +} + +// Message returns the exception's message. +func (s ServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceException) OrigErr() error { + return nil +} + +func (s ServiceException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type SubnetIPAddressLimitReachedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s SubnetIPAddressLimitReachedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SubnetIPAddressLimitReachedException) GoString() string { + return s.String() +} + +func newErrorSubnetIPAddressLimitReachedException(v protocol.ResponseMetadata) error { + return &SubnetIPAddressLimitReachedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SubnetIPAddressLimitReachedException) Code() string { + return "SubnetIPAddressLimitReachedException" +} + +// Message returns the exception's message. +func (s SubnetIPAddressLimitReachedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SubnetIPAddressLimitReachedException) OrigErr() error { + return nil } -type RemovePermissionOutput struct { - _ struct{} `type:"structure"` +func (s SubnetIPAddressLimitReachedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// String returns the string representation -func (s RemovePermissionOutput) String() string { - return awsutil.Prettify(s) +// Status code returns the HTTP status code for the request's response error. +func (s SubnetIPAddressLimitReachedException) StatusCode() int { + return s.respMetadata.StatusCode } -// GoString returns the string representation -func (s RemovePermissionOutput) GoString() string { - return s.String() +// RequestID returns the service's response RequestID for request. +func (s SubnetIPAddressLimitReachedException) RequestID() string { + return s.respMetadata.RequestID } type TagResourceInput struct { @@ -8719,7 +12680,71 @@ func (s TagResourceOutput) GoString() string { return s.String() } -// The function's AWS X-Ray tracing configuration. +// The request throughput limit was exceeded. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + Reason *string `type:"string" enum:"ThrottleReason"` + + // The number of seconds the caller should wait before retrying. + RetryAfterSeconds *string `location:"header" locationName:"Retry-After" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The function's AWS X-Ray tracing configuration. To sample and record incoming +// requests, set Mode to Active. type TracingConfig struct { _ struct{} `type:"structure"` @@ -8767,6 +12792,64 @@ func (s *TracingConfigResponse) SetMode(v string) *TracingConfigResponse { return s } +// The content type of the Invoke request body is not JSON. +type UnsupportedMediaTypeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s UnsupportedMediaTypeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedMediaTypeException) GoString() string { + return s.String() +} + +func newErrorUnsupportedMediaTypeException(v protocol.ResponseMetadata) error { + return &UnsupportedMediaTypeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedMediaTypeException) Code() string { + return "UnsupportedMediaTypeException" +} + +// Message returns the exception's message. +func (s UnsupportedMediaTypeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedMediaTypeException) OrigErr() error { + return nil +} + +func (s UnsupportedMediaTypeException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedMediaTypeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedMediaTypeException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -8959,6 +13042,13 @@ type UpdateEventSourceMappingInput struct { // * Amazon Simple Queue Service - Default 10. Max 10. BatchSize *int64 `min:"1" type:"integer"` + // (Streams) If the function returns an error, split the batch in two and retry. + BisectBatchOnFunctionError *bool `type:"boolean"` + + // (Streams) An Amazon SQS queue or Amazon SNS topic destination for discarded + // records. + DestinationConfig *DestinationConfig `type:"structure"` + // Disables the event source mapping to pause polling and invocation. Enabled *bool `type:"boolean"` @@ -8978,8 +13068,21 @@ type UpdateEventSourceMappingInput struct { // function name, it's limited to 64 characters in length. FunctionName *string `min:"1" type:"string"` + // The maximum amount of time to gather records before invoking the function, + // in seconds. MaximumBatchingWindowInSeconds *int64 `type:"integer"` + // (Streams) The maximum age of a record that Lambda sends to a function for + // processing. + MaximumRecordAgeInSeconds *int64 `min:"60" type:"integer"` + + // (Streams) The maximum number of times to retry when the function returns + // an error. + MaximumRetryAttempts *int64 `type:"integer"` + + // (Streams) The number of batches to process from each shard concurrently. + ParallelizationFactor *int64 `min:"1" type:"integer"` + // The identifier of the event source mapping. // // UUID is a required field @@ -9005,6 +13108,12 @@ func (s *UpdateEventSourceMappingInput) Validate() error { if s.FunctionName != nil && len(*s.FunctionName) < 1 { invalidParams.Add(request.NewErrParamMinLen("FunctionName", 1)) } + if s.MaximumRecordAgeInSeconds != nil && *s.MaximumRecordAgeInSeconds < 60 { + invalidParams.Add(request.NewErrParamMinValue("MaximumRecordAgeInSeconds", 60)) + } + if s.ParallelizationFactor != nil && *s.ParallelizationFactor < 1 { + invalidParams.Add(request.NewErrParamMinValue("ParallelizationFactor", 1)) + } if s.UUID == nil { invalidParams.Add(request.NewErrParamRequired("UUID")) } @@ -9024,6 +13133,18 @@ func (s *UpdateEventSourceMappingInput) SetBatchSize(v int64) *UpdateEventSource return s } +// SetBisectBatchOnFunctionError sets the BisectBatchOnFunctionError field's value. +func (s *UpdateEventSourceMappingInput) SetBisectBatchOnFunctionError(v bool) *UpdateEventSourceMappingInput { + s.BisectBatchOnFunctionError = &v + return s +} + +// SetDestinationConfig sets the DestinationConfig field's value. +func (s *UpdateEventSourceMappingInput) SetDestinationConfig(v *DestinationConfig) *UpdateEventSourceMappingInput { + s.DestinationConfig = v + return s +} + // SetEnabled sets the Enabled field's value. func (s *UpdateEventSourceMappingInput) SetEnabled(v bool) *UpdateEventSourceMappingInput { s.Enabled = &v @@ -9042,6 +13163,24 @@ func (s *UpdateEventSourceMappingInput) SetMaximumBatchingWindowInSeconds(v int6 return s } +// SetMaximumRecordAgeInSeconds sets the MaximumRecordAgeInSeconds field's value. +func (s *UpdateEventSourceMappingInput) SetMaximumRecordAgeInSeconds(v int64) *UpdateEventSourceMappingInput { + s.MaximumRecordAgeInSeconds = &v + return s +} + +// SetMaximumRetryAttempts sets the MaximumRetryAttempts field's value. +func (s *UpdateEventSourceMappingInput) SetMaximumRetryAttempts(v int64) *UpdateEventSourceMappingInput { + s.MaximumRetryAttempts = &v + return s +} + +// SetParallelizationFactor sets the ParallelizationFactor field's value. +func (s *UpdateEventSourceMappingInput) SetParallelizationFactor(v int64) *UpdateEventSourceMappingInput { + s.ParallelizationFactor = &v + return s +} + // SetUUID sets the UUID field's value. func (s *UpdateEventSourceMappingInput) SetUUID(v string) *UpdateEventSourceMappingInput { s.UUID = &v @@ -9185,7 +13324,7 @@ type UpdateFunctionConfigurationInput struct { // A dead letter queue configuration that specifies the queue or topic where // Lambda sends asynchronous events when they fail processing. For more information, - // see Dead Letter Queues (https://docs.aws.amazon.com/lambda/latest/dg/dlq.html). + // see Dead Letter Queues (https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#dlq). DeadLetterConfig *DeadLetterConfig `type:"structure"` // A description of the function. @@ -9253,7 +13392,7 @@ type UpdateFunctionConfigurationInput struct { // For network connectivity to AWS resources in a VPC, specify a list of security // groups and subnets in the VPC. When you connect a function to a VPC, it can // only access resources and the internet through that VPC. For more information, - // see VPC Settings (https://docs.aws.amazon.com/lambda/latest/dg/vpc.html). + // see VPC Settings (https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). VpcConfig *VpcConfig `type:"structure"` } @@ -9373,7 +13512,182 @@ func (s *UpdateFunctionConfigurationInput) SetVpcConfig(v *VpcConfig) *UpdateFun return s } +type UpdateFunctionEventInvokeConfigInput struct { + _ struct{} `type:"structure"` + + // A destination for events after they have been sent to a function for processing. + // + // Destinations + // + // * Function - The Amazon Resource Name (ARN) of a Lambda function. + // + // * Queue - The ARN of an SQS queue. + // + // * Topic - The ARN of an SNS topic. + // + // * Event Bus - The ARN of an Amazon EventBridge event bus. + DestinationConfig *DestinationConfig `type:"structure"` + + // The name of the Lambda function, version, or alias. + // + // Name formats + // + // * Function name - my-function (name-only), my-function:v1 (with alias). + // + // * Function ARN - arn:aws:lambda:us-west-2:123456789012:function:my-function. + // + // * Partial ARN - 123456789012:function:my-function. + // + // You can append a version number or alias to any of the formats. The length + // constraint applies only to the full ARN. If you specify only the function + // name, it is limited to 64 characters in length. + // + // FunctionName is a required field + FunctionName *string `location:"uri" locationName:"FunctionName" min:"1" type:"string" required:"true"` + + // The maximum age of a request that Lambda sends to a function for processing. + MaximumEventAgeInSeconds *int64 `min:"60" type:"integer"` + + // The maximum number of times to retry when the function returns an error. + MaximumRetryAttempts *int64 `type:"integer"` + + // A version number or alias name. + Qualifier *string `location:"querystring" locationName:"Qualifier" min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateFunctionEventInvokeConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateFunctionEventInvokeConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateFunctionEventInvokeConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateFunctionEventInvokeConfigInput"} + 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.MaximumEventAgeInSeconds != nil && *s.MaximumEventAgeInSeconds < 60 { + invalidParams.Add(request.NewErrParamMinValue("MaximumEventAgeInSeconds", 60)) + } + if s.Qualifier != nil && len(*s.Qualifier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Qualifier", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDestinationConfig sets the DestinationConfig field's value. +func (s *UpdateFunctionEventInvokeConfigInput) SetDestinationConfig(v *DestinationConfig) *UpdateFunctionEventInvokeConfigInput { + s.DestinationConfig = v + return s +} + +// SetFunctionName sets the FunctionName field's value. +func (s *UpdateFunctionEventInvokeConfigInput) SetFunctionName(v string) *UpdateFunctionEventInvokeConfigInput { + s.FunctionName = &v + return s +} + +// SetMaximumEventAgeInSeconds sets the MaximumEventAgeInSeconds field's value. +func (s *UpdateFunctionEventInvokeConfigInput) SetMaximumEventAgeInSeconds(v int64) *UpdateFunctionEventInvokeConfigInput { + s.MaximumEventAgeInSeconds = &v + return s +} + +// SetMaximumRetryAttempts sets the MaximumRetryAttempts field's value. +func (s *UpdateFunctionEventInvokeConfigInput) SetMaximumRetryAttempts(v int64) *UpdateFunctionEventInvokeConfigInput { + s.MaximumRetryAttempts = &v + return s +} + +// SetQualifier sets the Qualifier field's value. +func (s *UpdateFunctionEventInvokeConfigInput) SetQualifier(v string) *UpdateFunctionEventInvokeConfigInput { + s.Qualifier = &v + return s +} + +type UpdateFunctionEventInvokeConfigOutput struct { + _ struct{} `type:"structure"` + + // A destination for events after they have been sent to a function for processing. + // + // Destinations + // + // * Function - The Amazon Resource Name (ARN) of a Lambda function. + // + // * Queue - The ARN of an SQS queue. + // + // * Topic - The ARN of an SNS topic. + // + // * Event Bus - The ARN of an Amazon EventBridge event bus. + DestinationConfig *DestinationConfig `type:"structure"` + + // The Amazon Resource Name (ARN) of the function. + FunctionArn *string `type:"string"` + + // The date and time that the configuration was last updated. + LastModified *time.Time `type:"timestamp"` + + // The maximum age of a request that Lambda sends to a function for processing. + MaximumEventAgeInSeconds *int64 `min:"60" type:"integer"` + + // The maximum number of times to retry when the function returns an error. + MaximumRetryAttempts *int64 `type:"integer"` +} + +// String returns the string representation +func (s UpdateFunctionEventInvokeConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateFunctionEventInvokeConfigOutput) GoString() string { + return s.String() +} + +// SetDestinationConfig sets the DestinationConfig field's value. +func (s *UpdateFunctionEventInvokeConfigOutput) SetDestinationConfig(v *DestinationConfig) *UpdateFunctionEventInvokeConfigOutput { + s.DestinationConfig = v + return s +} + +// SetFunctionArn sets the FunctionArn field's value. +func (s *UpdateFunctionEventInvokeConfigOutput) SetFunctionArn(v string) *UpdateFunctionEventInvokeConfigOutput { + s.FunctionArn = &v + return s +} + +// SetLastModified sets the LastModified field's value. +func (s *UpdateFunctionEventInvokeConfigOutput) SetLastModified(v time.Time) *UpdateFunctionEventInvokeConfigOutput { + s.LastModified = &v + return s +} + +// SetMaximumEventAgeInSeconds sets the MaximumEventAgeInSeconds field's value. +func (s *UpdateFunctionEventInvokeConfigOutput) SetMaximumEventAgeInSeconds(v int64) *UpdateFunctionEventInvokeConfigOutput { + s.MaximumEventAgeInSeconds = &v + return s +} + +// SetMaximumRetryAttempts sets the MaximumRetryAttempts field's value. +func (s *UpdateFunctionEventInvokeConfigOutput) SetMaximumRetryAttempts(v int64) *UpdateFunctionEventInvokeConfigOutput { + s.MaximumRetryAttempts = &v + return s +} + // The VPC security groups and subnets that are attached to a Lambda function. +// For more information, see VPC Settings (https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html). type VpcConfig struct { _ struct{} `type:"structure"` @@ -9475,6 +13789,40 @@ const ( InvocationTypeDryRun = "DryRun" ) +const ( + // LastUpdateStatusSuccessful is a LastUpdateStatus enum value + LastUpdateStatusSuccessful = "Successful" + + // LastUpdateStatusFailed is a LastUpdateStatus enum value + LastUpdateStatusFailed = "Failed" + + // LastUpdateStatusInProgress is a LastUpdateStatus enum value + LastUpdateStatusInProgress = "InProgress" +) + +const ( + // LastUpdateStatusReasonCodeEniLimitExceeded is a LastUpdateStatusReasonCode enum value + LastUpdateStatusReasonCodeEniLimitExceeded = "EniLimitExceeded" + + // LastUpdateStatusReasonCodeInsufficientRolePermissions is a LastUpdateStatusReasonCode enum value + LastUpdateStatusReasonCodeInsufficientRolePermissions = "InsufficientRolePermissions" + + // LastUpdateStatusReasonCodeInvalidConfiguration is a LastUpdateStatusReasonCode enum value + LastUpdateStatusReasonCodeInvalidConfiguration = "InvalidConfiguration" + + // LastUpdateStatusReasonCodeInternalError is a LastUpdateStatusReasonCode enum value + LastUpdateStatusReasonCodeInternalError = "InternalError" + + // LastUpdateStatusReasonCodeSubnetOutOfIpaddresses is a LastUpdateStatusReasonCode enum value + LastUpdateStatusReasonCodeSubnetOutOfIpaddresses = "SubnetOutOfIPAddresses" + + // LastUpdateStatusReasonCodeInvalidSubnet is a LastUpdateStatusReasonCode enum value + LastUpdateStatusReasonCodeInvalidSubnet = "InvalidSubnet" + + // LastUpdateStatusReasonCodeInvalidSecurityGroup is a LastUpdateStatusReasonCode enum value + LastUpdateStatusReasonCodeInvalidSecurityGroup = "InvalidSecurityGroup" +) + const ( // LogTypeNone is a LogType enum value LogTypeNone = "None" @@ -9483,6 +13831,17 @@ const ( LogTypeTail = "Tail" ) +const ( + // ProvisionedConcurrencyStatusEnumInProgress is a ProvisionedConcurrencyStatusEnum enum value + ProvisionedConcurrencyStatusEnumInProgress = "IN_PROGRESS" + + // ProvisionedConcurrencyStatusEnumReady is a ProvisionedConcurrencyStatusEnum enum value + ProvisionedConcurrencyStatusEnumReady = "READY" + + // ProvisionedConcurrencyStatusEnumFailed is a ProvisionedConcurrencyStatusEnum enum value + ProvisionedConcurrencyStatusEnumFailed = "FAILED" +) + const ( // RuntimeNodejs is a Runtime enum value RuntimeNodejs = "nodejs" @@ -9499,9 +13858,15 @@ const ( // RuntimeNodejs10X is a Runtime enum value RuntimeNodejs10X = "nodejs10.x" + // RuntimeNodejs12X is a Runtime enum value + RuntimeNodejs12X = "nodejs12.x" + // RuntimeJava8 is a Runtime enum value RuntimeJava8 = "java8" + // RuntimeJava11 is a Runtime enum value + RuntimeJava11 = "java11" + // RuntimePython27 is a Runtime enum value RuntimePython27 = "python2.7" @@ -9511,6 +13876,9 @@ const ( // RuntimePython37 is a Runtime enum value RuntimePython37 = "python3.7" + // RuntimePython38 is a Runtime enum value + RuntimePython38 = "python3.8" + // RuntimeDotnetcore10 is a Runtime enum value RuntimeDotnetcore10 = "dotnetcore1.0" @@ -9529,10 +13897,59 @@ const ( // RuntimeRuby25 is a Runtime enum value RuntimeRuby25 = "ruby2.5" + // RuntimeRuby27 is a Runtime enum value + RuntimeRuby27 = "ruby2.7" + // RuntimeProvided is a Runtime enum value RuntimeProvided = "provided" ) +const ( + // StatePending is a State enum value + StatePending = "Pending" + + // StateActive is a State enum value + StateActive = "Active" + + // StateInactive is a State enum value + StateInactive = "Inactive" + + // StateFailed is a State enum value + StateFailed = "Failed" +) + +const ( + // StateReasonCodeIdle is a StateReasonCode enum value + StateReasonCodeIdle = "Idle" + + // StateReasonCodeCreating is a StateReasonCode enum value + StateReasonCodeCreating = "Creating" + + // StateReasonCodeRestoring is a StateReasonCode enum value + StateReasonCodeRestoring = "Restoring" + + // StateReasonCodeEniLimitExceeded is a StateReasonCode enum value + StateReasonCodeEniLimitExceeded = "EniLimitExceeded" + + // StateReasonCodeInsufficientRolePermissions is a StateReasonCode enum value + StateReasonCodeInsufficientRolePermissions = "InsufficientRolePermissions" + + // StateReasonCodeInvalidConfiguration is a StateReasonCode enum value + StateReasonCodeInvalidConfiguration = "InvalidConfiguration" + + // StateReasonCodeInternalError is a StateReasonCode enum value + StateReasonCodeInternalError = "InternalError" + + // StateReasonCodeSubnetOutOfIpaddresses is a StateReasonCode enum value + StateReasonCodeSubnetOutOfIpaddresses = "SubnetOutOfIPAddresses" + + // StateReasonCodeInvalidSubnet is a StateReasonCode enum value + StateReasonCodeInvalidSubnet = "InvalidSubnet" + + // StateReasonCodeInvalidSecurityGroup is a StateReasonCode enum value + StateReasonCodeInvalidSecurityGroup = "InvalidSecurityGroup" +) + const ( // ThrottleReasonConcurrentInvocationLimitExceeded is a ThrottleReason enum value ThrottleReasonConcurrentInvocationLimitExceeded = "ConcurrentInvocationLimitExceeded" 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 index e062a386c34..739daeca0a5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lambda/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lambda/errors.go @@ -2,6 +2,10 @@ package lambda +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeCodeStorageExceededException for service response error code @@ -33,17 +37,15 @@ const ( // 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. + // AWS Lambda was not able to create an elastic network interface 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. + // One of the parameters in the request is invalid. ErrCodeInvalidParameterValueException = "InvalidParameterValueException" // ErrCodeInvalidRequestContentException for service response error code @@ -119,6 +121,12 @@ const ( // latest RevisionId for your resource. ErrCodePreconditionFailedException = "PreconditionFailedException" + // ErrCodeProvisionedConcurrencyConfigNotFoundException for service response error code + // "ProvisionedConcurrencyConfigNotFoundException". + // + // The specified configuration does not exist. + ErrCodeProvisionedConcurrencyConfigNotFoundException = "ProvisionedConcurrencyConfigNotFoundException" + // ErrCodeRequestTooLargeException for service response error code // "RequestTooLargeException". // @@ -129,7 +137,7 @@ const ( // ErrCodeResourceConflictException for service response error code // "ResourceConflictException". // - // The resource already exists. + // The resource already exists, or another operation is in progress. ErrCodeResourceConflictException = "ResourceConflictException" // ErrCodeResourceInUseException for service response error code @@ -143,10 +151,16 @@ const ( // 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. + // The resource specified in the request does not exist. ErrCodeResourceNotFoundException = "ResourceNotFoundException" + // ErrCodeResourceNotReadyException for service response error code + // "ResourceNotReadyException". + // + // The function is inactive and its VPC connection is no longer available. Wait + // for the VPC connection to reestablish and try again. + ErrCodeResourceNotReadyException = "ResourceNotReadyException" + // ErrCodeServiceException for service response error code // "ServiceException". // @@ -163,7 +177,7 @@ const ( // ErrCodeTooManyRequestsException for service response error code // "TooManyRequestsException". // - // Request throughput limit exceeded. + // The request throughput limit was exceeded. ErrCodeTooManyRequestsException = "TooManyRequestsException" // ErrCodeUnsupportedMediaTypeException for service response error code @@ -172,3 +186,33 @@ const ( // The content type of the Invoke request body is not JSON. ErrCodeUnsupportedMediaTypeException = "UnsupportedMediaTypeException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "CodeStorageExceededException": newErrorCodeStorageExceededException, + "EC2AccessDeniedException": newErrorEC2AccessDeniedException, + "EC2ThrottledException": newErrorEC2ThrottledException, + "EC2UnexpectedException": newErrorEC2UnexpectedException, + "ENILimitReachedException": newErrorENILimitReachedException, + "InvalidParameterValueException": newErrorInvalidParameterValueException, + "InvalidRequestContentException": newErrorInvalidRequestContentException, + "InvalidRuntimeException": newErrorInvalidRuntimeException, + "InvalidSecurityGroupIDException": newErrorInvalidSecurityGroupIDException, + "InvalidSubnetIDException": newErrorInvalidSubnetIDException, + "InvalidZipFileException": newErrorInvalidZipFileException, + "KMSAccessDeniedException": newErrorKMSAccessDeniedException, + "KMSDisabledException": newErrorKMSDisabledException, + "KMSInvalidStateException": newErrorKMSInvalidStateException, + "KMSNotFoundException": newErrorKMSNotFoundException, + "PolicyLengthExceededException": newErrorPolicyLengthExceededException, + "PreconditionFailedException": newErrorPreconditionFailedException, + "ProvisionedConcurrencyConfigNotFoundException": newErrorProvisionedConcurrencyConfigNotFoundException, + "RequestTooLargeException": newErrorRequestTooLargeException, + "ResourceConflictException": newErrorResourceConflictException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ResourceNotReadyException": newErrorResourceNotReadyException, + "ServiceException": newErrorServiceException, + "SubnetIPAddressLimitReachedException": newErrorSubnetIPAddressLimitReachedException, + "TooManyRequestsException": newErrorTooManyRequestsException, + "UnsupportedMediaTypeException": newErrorUnsupportedMediaTypeException, +} 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 index 1cccdda0842..20a8ee892f5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lambda/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lambda/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "lambda" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Lambda" // ServiceID is a unique identifer of a specific service. + ServiceID = "Lambda" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Lambda client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Lambda client from just a session. // svc := lambda.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Lambda { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Lambda { svc := &Lambda{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-03-31", }, @@ -71,7 +75,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/lambda/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/lambda/waiters.go index 8c55f9f32d1..e9ec3d44482 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lambda/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lambda/waiters.go @@ -9,6 +9,62 @@ import ( "github.com/aws/aws-sdk-go/aws/request" ) +// WaitUntilFunctionActive uses the AWS Lambda API operation +// GetFunctionConfiguration to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *Lambda) WaitUntilFunctionActive(input *GetFunctionConfigurationInput) error { + return c.WaitUntilFunctionActiveWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilFunctionActiveWithContext is an extended version of WaitUntilFunctionActive. +// 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 *Lambda) WaitUntilFunctionActiveWithContext(ctx aws.Context, input *GetFunctionConfigurationInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilFunctionActive", + MaxAttempts: 60, + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "State", + Expected: "Active", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "State", + Expected: "Failed", + }, + { + State: request.RetryWaiterState, + Matcher: request.PathWaiterMatch, Argument: "State", + Expected: "Pending", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *GetFunctionConfigurationInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetFunctionConfigurationRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + // WaitUntilFunctionExists uses the AWS Lambda API operation // GetFunction to wait for a condition to be met before returning. // If the condition is not met within the max attempt window, an error will @@ -59,3 +115,59 @@ func (c *Lambda) WaitUntilFunctionExistsWithContext(ctx aws.Context, input *GetF return w.WaitWithContext(ctx) } + +// WaitUntilFunctionUpdated uses the AWS Lambda API operation +// GetFunctionConfiguration to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *Lambda) WaitUntilFunctionUpdated(input *GetFunctionConfigurationInput) error { + return c.WaitUntilFunctionUpdatedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilFunctionUpdatedWithContext is an extended version of WaitUntilFunctionUpdated. +// 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 *Lambda) WaitUntilFunctionUpdatedWithContext(ctx aws.Context, input *GetFunctionConfigurationInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilFunctionUpdated", + MaxAttempts: 60, + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "LastUpdateStatus", + Expected: "Successful", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "LastUpdateStatus", + Expected: "Failed", + }, + { + State: request.RetryWaiterState, + Matcher: request.PathWaiterMatch, Argument: "LastUpdateStatus", + Expected: "InProgress", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *GetFunctionConfigurationInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetFunctionConfigurationRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/lexmodelbuildingservice/api.go b/vendor/github.com/aws/aws-sdk-go/service/lexmodelbuildingservice/api.go index 3c3ccc5e9ca..091401bbee8 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lexmodelbuildingservice/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lexmodelbuildingservice/api.go @@ -76,25 +76,25 @@ func (c *LexModelBuildingService) CreateBotVersionRequest(input *CreateBotVersio // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation CreateBotVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // There was a conflict processing the request. Try your request again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // -// * ErrCodePreconditionFailedException "PreconditionFailedException" +// * PreconditionFailedException // The checksum of the resource that you are trying to change does not match // the checksum in the request. Check the resource's checksum and try again. // @@ -185,25 +185,25 @@ func (c *LexModelBuildingService) CreateIntentVersionRequest(input *CreateIntent // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation CreateIntentVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // There was a conflict processing the request. Try your request again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // -// * ErrCodePreconditionFailedException "PreconditionFailedException" +// * PreconditionFailedException // The checksum of the resource that you are trying to change does not match // the checksum in the request. Check the resource's checksum and try again. // @@ -293,25 +293,25 @@ func (c *LexModelBuildingService) CreateSlotTypeVersionRequest(input *CreateSlot // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation CreateSlotTypeVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // There was a conflict processing the request. Try your request again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // -// * ErrCodePreconditionFailedException "PreconditionFailedException" +// * PreconditionFailedException // The checksum of the resource that you are trying to change does not match // the checksum in the request. Check the resource's checksum and try again. // @@ -383,7 +383,13 @@ func (c *LexModelBuildingService) DeleteBotRequest(input *DeleteBotInput) (req * // DeleteBot API operation for Amazon Lex Model Building Service. // // Deletes all versions of the bot, including the $LATEST version. To delete -// a specific version of the bot, use the DeleteBotVersion operation. +// a specific version of the bot, use the DeleteBotVersion operation. The DeleteBot +// operation doesn't immediately remove the bot schema. Instead, it is marked +// for deletion and removed later. +// +// Amazon Lex stores utterances indefinitely for improving the ability of your +// bot to respond to user inputs. These utterances are not removed when the +// bot is deleted. To remove the utterances, use the DeleteUtterances operation. // // If a bot has an alias, you can't delete it. Instead, the DeleteBot operation // returns a ResourceInUseException exception that includes a reference to the @@ -400,25 +406,25 @@ func (c *LexModelBuildingService) DeleteBotRequest(input *DeleteBotInput) (req * // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation DeleteBot for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // There was a conflict processing the request. Try your request again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource that you are attempting to delete is referred to by another // resource. Use this information to remove references to the resource that // you are trying to delete. @@ -515,25 +521,25 @@ func (c *LexModelBuildingService) DeleteBotAliasRequest(input *DeleteBotAliasInp // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation DeleteBotAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // There was a conflict processing the request. Try your request again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource that you are attempting to delete is referred to by another // resource. Use this information to remove references to the resource that // you are trying to delete. @@ -625,21 +631,21 @@ func (c *LexModelBuildingService) DeleteBotChannelAssociationRequest(input *Dele // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation DeleteBotChannelAssociation for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // There was a conflict processing the request. Try your request again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -722,25 +728,25 @@ func (c *LexModelBuildingService) DeleteBotVersionRequest(input *DeleteBotVersio // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation DeleteBotVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // There was a conflict processing the request. Try your request again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource that you are attempting to delete is referred to by another // resource. Use this information to remove references to the resource that // you are trying to delete. @@ -842,25 +848,25 @@ func (c *LexModelBuildingService) DeleteIntentRequest(input *DeleteIntentInput) // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation DeleteIntent for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // There was a conflict processing the request. Try your request again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource that you are attempting to delete is referred to by another // resource. Use this information to remove references to the resource that // you are trying to delete. @@ -952,25 +958,25 @@ func (c *LexModelBuildingService) DeleteIntentVersionRequest(input *DeleteIntent // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation DeleteIntentVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // There was a conflict processing the request. Try your request again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource that you are attempting to delete is referred to by another // resource. Use this information to remove references to the resource that // you are trying to delete. @@ -1074,25 +1080,25 @@ func (c *LexModelBuildingService) DeleteSlotTypeRequest(input *DeleteSlotTypeInp // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation DeleteSlotType for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // There was a conflict processing the request. Try your request again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource that you are attempting to delete is referred to by another // resource. Use this information to remove references to the resource that // you are trying to delete. @@ -1184,25 +1190,25 @@ func (c *LexModelBuildingService) DeleteSlotTypeVersionRequest(input *DeleteSlot // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation DeleteSlotTypeVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // There was a conflict processing the request. Try your request again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource that you are attempting to delete is referred to by another // resource. Use this information to remove references to the resource that // you are trying to delete. @@ -1289,8 +1295,11 @@ func (c *LexModelBuildingService) DeleteUtterancesRequest(input *DeleteUtterance // then stored indefinitely for use in improving the ability of your bot to // respond to user input. // -// Use the DeleteStoredUtterances operation to manually delete stored utterances -// for a specific user. +// Use the DeleteUtterances operation to manually delete stored utterances for +// a specific user. When you use the DeleteUtterances operation, utterances +// stored for improving your bot's ability to respond to user input are deleted +// immediately. Utterances stored for use with the GetUtterancesView operation +// are deleted after 15 days. // // This operation requires permissions for the lex:DeleteUtterances action. // @@ -1301,18 +1310,18 @@ func (c *LexModelBuildingService) DeleteUtterancesRequest(input *DeleteUtterance // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation DeleteUtterances for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -1394,18 +1403,18 @@ func (c *LexModelBuildingService) GetBotRequest(input *GetBotInput) (req *reques // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetBot for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -1487,18 +1496,18 @@ func (c *LexModelBuildingService) GetBotAliasRequest(input *GetBotAliasInput) (r // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetBotAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -1585,14 +1594,14 @@ func (c *LexModelBuildingService) GetBotAliasesRequest(input *GetBotAliasesInput // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetBotAliases for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -1661,10 +1670,12 @@ func (c *LexModelBuildingService) GetBotAliasesPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetBotAliasesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetBotAliasesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1725,18 +1736,18 @@ func (c *LexModelBuildingService) GetBotChannelAssociationRequest(input *GetBotC // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetBotChannelAssociation for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -1824,14 +1835,14 @@ func (c *LexModelBuildingService) GetBotChannelAssociationsRequest(input *GetBot // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetBotChannelAssociations for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -1900,10 +1911,12 @@ func (c *LexModelBuildingService) GetBotChannelAssociationsPagesWithContext(ctx }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetBotChannelAssociationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetBotChannelAssociationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1976,18 +1989,18 @@ func (c *LexModelBuildingService) GetBotVersionsRequest(input *GetBotVersionsInp // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetBotVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -2056,10 +2069,12 @@ func (c *LexModelBuildingService) GetBotVersionsPagesWithContext(ctx aws.Context }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetBotVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetBotVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2131,18 +2146,18 @@ func (c *LexModelBuildingService) GetBotsRequest(input *GetBotsInput) (req *requ // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetBots for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -2211,10 +2226,12 @@ func (c *LexModelBuildingService) GetBotsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetBotsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetBotsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2273,18 +2290,18 @@ func (c *LexModelBuildingService) GetBuiltinIntentRequest(input *GetBuiltinInten // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetBuiltinIntent for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -2371,14 +2388,14 @@ func (c *LexModelBuildingService) GetBuiltinIntentsRequest(input *GetBuiltinInte // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetBuiltinIntents for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -2447,10 +2464,12 @@ func (c *LexModelBuildingService) GetBuiltinIntentsPagesWithContext(ctx aws.Cont }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetBuiltinIntentsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetBuiltinIntentsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2518,14 +2537,14 @@ func (c *LexModelBuildingService) GetBuiltinSlotTypesRequest(input *GetBuiltinSl // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetBuiltinSlotTypes for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -2594,10 +2613,12 @@ func (c *LexModelBuildingService) GetBuiltinSlotTypesPagesWithContext(ctx aws.Co }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetBuiltinSlotTypesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetBuiltinSlotTypesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2654,18 +2675,18 @@ func (c *LexModelBuildingService) GetExportRequest(input *GetExportInput) (req * // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetExport for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -2744,18 +2765,18 @@ func (c *LexModelBuildingService) GetImportRequest(input *GetImportInput) (req * // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetImport for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -2837,18 +2858,18 @@ func (c *LexModelBuildingService) GetIntentRequest(input *GetIntentInput) (req * // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetIntent for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -2943,18 +2964,18 @@ func (c *LexModelBuildingService) GetIntentVersionsRequest(input *GetIntentVersi // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetIntentVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -3023,10 +3044,12 @@ func (c *LexModelBuildingService) GetIntentVersionsPagesWithContext(ctx aws.Cont }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetIntentVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetIntentVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3097,18 +3120,18 @@ func (c *LexModelBuildingService) GetIntentsRequest(input *GetIntentsInput) (req // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetIntents for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -3177,10 +3200,12 @@ func (c *LexModelBuildingService) GetIntentsPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetIntentsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetIntentsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3240,18 +3265,18 @@ func (c *LexModelBuildingService) GetSlotTypeRequest(input *GetSlotTypeInput) (r // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetSlotType for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -3346,18 +3371,18 @@ func (c *LexModelBuildingService) GetSlotTypeVersionsRequest(input *GetSlotTypeV // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetSlotTypeVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -3426,10 +3451,12 @@ func (c *LexModelBuildingService) GetSlotTypeVersionsPagesWithContext(ctx aws.Co }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetSlotTypeVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetSlotTypeVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3500,18 +3527,18 @@ func (c *LexModelBuildingService) GetSlotTypesRequest(input *GetSlotTypesInput) // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetSlotTypes for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource specified in the request was not found. Check the resource and // try again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -3580,10 +3607,12 @@ func (c *LexModelBuildingService) GetSlotTypesPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetSlotTypesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetSlotTypesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3647,9 +3676,13 @@ func (c *LexModelBuildingService) GetUtterancesViewRequest(input *GetUtterancesV // two versions. // // Utterance statistics are generated once a day. Data is available for the -// last 15 days. You can request information for up to 5 versions in each request. -// The response contains information about a maximum of 100 utterances for each -// version. +// last 15 days. You can request information for up to 5 versions of your bot +// in each request. Amazon Lex returns the most frequent utterances received +// by the bot in the last 15 days. The response contains information about a +// maximum of 100 utterances for each version. +// +// If you set childDirected field to true when you created your bot, or if you +// opted out of participating in improving Amazon Lex, utterances are not available. // // This operation requires permissions for the lex:GetUtterancesView action. // @@ -3660,14 +3693,14 @@ func (c *LexModelBuildingService) GetUtterancesViewRequest(input *GetUtterancesV // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation GetUtterancesView for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -3754,7 +3787,7 @@ func (c *LexModelBuildingService) PutBotRequest(input *PutBotInput) (req *reques // an exception. // // This operation requires permissions for the lex:PutBot action. For more information, -// see auth-and-access-control. +// see security-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 @@ -3763,21 +3796,21 @@ func (c *LexModelBuildingService) PutBotRequest(input *PutBotInput) (req *reques // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation PutBot for usage and error information. // -// Returned Error Codes: -// * ErrCodeConflictException "ConflictException" +// Returned Error Types: +// * ConflictException // There was a conflict processing the request. Try your request again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // -// * ErrCodePreconditionFailedException "PreconditionFailedException" +// * PreconditionFailedException // The checksum of the resource that you are trying to change does not match // the checksum in the request. Check the resource's checksum and try again. // @@ -3860,21 +3893,21 @@ func (c *LexModelBuildingService) PutBotAliasRequest(input *PutBotAliasInput) (r // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation PutBotAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeConflictException "ConflictException" +// Returned Error Types: +// * ConflictException // There was a conflict processing the request. Try your request again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // -// * ErrCodePreconditionFailedException "PreconditionFailedException" +// * PreconditionFailedException // The checksum of the resource that you are trying to change does not match // the checksum in the request. Check the resource's checksum and try again. // @@ -3997,21 +4030,21 @@ func (c *LexModelBuildingService) PutIntentRequest(input *PutIntentInput) (req * // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation PutIntent for usage and error information. // -// Returned Error Codes: -// * ErrCodeConflictException "ConflictException" +// Returned Error Types: +// * ConflictException // There was a conflict processing the request. Try your request again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // -// * ErrCodePreconditionFailedException "PreconditionFailedException" +// * PreconditionFailedException // The checksum of the resource that you are trying to change does not match // the checksum in the request. Check the resource's checksum and try again. // @@ -4103,21 +4136,21 @@ func (c *LexModelBuildingService) PutSlotTypeRequest(input *PutSlotTypeInput) (r // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation PutSlotType for usage and error information. // -// Returned Error Codes: -// * ErrCodeConflictException "ConflictException" +// Returned Error Types: +// * ConflictException // There was a conflict processing the request. Try your request again. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // -// * ErrCodePreconditionFailedException "PreconditionFailedException" +// * PreconditionFailedException // The checksum of the resource that you are trying to change does not match // the checksum in the request. Check the resource's checksum and try again. // @@ -4196,14 +4229,14 @@ func (c *LexModelBuildingService) StartImportRequest(input *StartImportInput) (r // See the AWS API reference guide for Amazon Lex Model Building Service's // API operation StartImport for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // The request exceeded a limit. Try your request again. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal Amazon Lex error occurred. Try your request again. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request is not well formed. For example, a value is invalid or a required // field is missing. Check the field values, and try again. // @@ -4229,6 +4262,63 @@ func (c *LexModelBuildingService) StartImportWithContext(ctx aws.Context, input return out, req.Send() } +// The request is not well formed. For example, a value is invalid or a required +// field is missing. Check the field values, and try again. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // Provides information about a bot alias. type BotAliasMetadata struct { _ struct{} `type:"structure"` @@ -4242,6 +4332,9 @@ type BotAliasMetadata struct { // Checksum of the bot alias. Checksum *string `locationName:"checksum" type:"string"` + // Settings that determine how Amazon Lex uses conversation logs for the alias. + ConversationLogs *ConversationLogsResponse `locationName:"conversationLogs" type:"structure"` + // The date that the bot alias was created. CreatedDate *time.Time `locationName:"createdDate" type:"timestamp"` @@ -4284,6 +4377,12 @@ func (s *BotAliasMetadata) SetChecksum(v string) *BotAliasMetadata { return s } +// SetConversationLogs sets the ConversationLogs field's value. +func (s *BotAliasMetadata) SetConversationLogs(v *ConversationLogsResponse) *BotAliasMetadata { + s.ConversationLogs = v + return s +} + // SetCreatedDate sets the CreatedDate field's value. func (s *BotAliasMetadata) SetCreatedDate(v time.Time) *BotAliasMetadata { s.CreatedDate = &v @@ -4644,6 +4743,167 @@ func (s *CodeHook) SetUri(v string) *CodeHook { return s } +// There was a conflict processing the request. Try your request again. +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictException) GoString() string { + return s.String() +} + +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" +} + +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil +} + +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID +} + +// Provides the settings needed for conversation logs. +type ConversationLogsRequest struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of an IAM role with permission to write to + // your CloudWatch Logs for text logs and your S3 bucket for audio logs. If + // audio encryption is enabled, this role also provides access permission for + // the AWS KMS key used for encrypting audio logs. For more information, see + // Creating an IAM Role and Policy for Conversation Logs (https://docs.aws.amazon.com/lex/latest/dg/conversation-logs-role-and-policy.html). + // + // IamRoleArn is a required field + IamRoleArn *string `locationName:"iamRoleArn" min:"20" type:"string" required:"true"` + + // The settings for your conversation logs. You can log the conversation text, + // conversation audio, or both. + // + // LogSettings is a required field + LogSettings []*LogSettingsRequest `locationName:"logSettings" type:"list" required:"true"` +} + +// String returns the string representation +func (s ConversationLogsRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConversationLogsRequest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ConversationLogsRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConversationLogsRequest"} + if s.IamRoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("IamRoleArn")) + } + if s.IamRoleArn != nil && len(*s.IamRoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("IamRoleArn", 20)) + } + if s.LogSettings == nil { + invalidParams.Add(request.NewErrParamRequired("LogSettings")) + } + if s.LogSettings != nil { + for i, v := range s.LogSettings { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LogSettings", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetIamRoleArn sets the IamRoleArn field's value. +func (s *ConversationLogsRequest) SetIamRoleArn(v string) *ConversationLogsRequest { + s.IamRoleArn = &v + return s +} + +// SetLogSettings sets the LogSettings field's value. +func (s *ConversationLogsRequest) SetLogSettings(v []*LogSettingsRequest) *ConversationLogsRequest { + s.LogSettings = v + return s +} + +// Contains information about conversation log settings. +type ConversationLogsResponse struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the IAM role used to write your logs to + // CloudWatch Logs or an S3 bucket. + IamRoleArn *string `locationName:"iamRoleArn" min:"20" type:"string"` + + // The settings for your conversation logs. You can log text, audio, or both. + LogSettings []*LogSettingsResponse `locationName:"logSettings" type:"list"` +} + +// String returns the string representation +func (s ConversationLogsResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConversationLogsResponse) GoString() string { + return s.String() +} + +// SetIamRoleArn sets the IamRoleArn field's value. +func (s *ConversationLogsResponse) SetIamRoleArn(v string) *ConversationLogsResponse { + s.IamRoleArn = &v + return s +} + +// SetLogSettings sets the LogSettings field's value. +func (s *ConversationLogsResponse) SetLogSettings(v []*LogSettingsResponse) *ConversationLogsResponse { + s.LogSettings = v + return s +} + type CreateBotVersionInput struct { _ struct{} `type:"structure"` @@ -4744,6 +5004,10 @@ type CreateBotVersionOutput struct { // A description of the bot. Description *string `locationName:"description" type:"string"` + // Indicates whether utterances entered by the user should be sent to Amazon + // Comprehend for sentiment analysis. + DetectSentiment *bool `locationName:"detectSentiment" type:"boolean"` + // If status is FAILED, Amazon Lex provides the reason that it failed to build // the bot. FailureReason *string `locationName:"failureReason" type:"string"` @@ -4824,6 +5088,12 @@ func (s *CreateBotVersionOutput) SetDescription(v string) *CreateBotVersionOutpu return s } +// SetDetectSentiment sets the DetectSentiment field's value. +func (s *CreateBotVersionOutput) SetDetectSentiment(v bool) *CreateBotVersionOutput { + s.DetectSentiment = &v + return s +} + // SetFailureReason sets the FailureReason field's value. func (s *CreateBotVersionOutput) SetFailureReason(v string) *CreateBotVersionOutput { s.FailureReason = &v @@ -5156,7 +5426,7 @@ type CreateSlotTypeVersionOutput struct { // A list of EnumerationValue objects that defines the values that the slot // type can take. - EnumerationValues []*EnumerationValue `locationName:"enumerationValues" min:"1" type:"list"` + EnumerationValues []*EnumerationValue `locationName:"enumerationValues" type:"list"` // The date that the slot type was updated. When you create a resource, the // creation date and last update date are the same. @@ -5165,6 +5435,12 @@ type CreateSlotTypeVersionOutput struct { // The name of the slot type. Name *string `locationName:"name" min:"1" type:"string"` + // The built-in slot type used a the parent of the slot type. + ParentSlotTypeSignature *string `locationName:"parentSlotTypeSignature" min:"1" type:"string"` + + // Configuration information that extends the parent built-in slot type. + SlotTypeConfigurations []*SlotTypeConfiguration `locationName:"slotTypeConfigurations" type:"list"` + // The strategy that Amazon Lex uses to determine the value of the slot. For // more information, see PutSlotType. ValueSelectionStrategy *string `locationName:"valueSelectionStrategy" type:"string" enum:"SlotValueSelectionStrategy"` @@ -5219,6 +5495,18 @@ func (s *CreateSlotTypeVersionOutput) SetName(v string) *CreateSlotTypeVersionOu return s } +// SetParentSlotTypeSignature sets the ParentSlotTypeSignature field's value. +func (s *CreateSlotTypeVersionOutput) SetParentSlotTypeSignature(v string) *CreateSlotTypeVersionOutput { + s.ParentSlotTypeSignature = &v + return s +} + +// SetSlotTypeConfigurations sets the SlotTypeConfigurations field's value. +func (s *CreateSlotTypeVersionOutput) SetSlotTypeConfigurations(v []*SlotTypeConfiguration) *CreateSlotTypeVersionOutput { + s.SlotTypeConfigurations = v + return s +} + // SetValueSelectionStrategy sets the ValueSelectionStrategy field's value. func (s *CreateSlotTypeVersionOutput) SetValueSelectionStrategy(v string) *CreateSlotTypeVersionOutput { s.ValueSelectionStrategy = &v @@ -6121,6 +6409,10 @@ type GetBotAliasOutput struct { // Checksum of the bot alias. Checksum *string `locationName:"checksum" type:"string"` + // The settings that determine how Amazon Lex uses conversation logs for the + // alias. + ConversationLogs *ConversationLogsResponse `locationName:"conversationLogs" type:"structure"` + // The date that the bot alias was created. CreatedDate *time.Time `locationName:"createdDate" type:"timestamp"` @@ -6163,6 +6455,12 @@ func (s *GetBotAliasOutput) SetChecksum(v string) *GetBotAliasOutput { return s } +// SetConversationLogs sets the ConversationLogs field's value. +func (s *GetBotAliasOutput) SetConversationLogs(v *ConversationLogsResponse) *GetBotAliasOutput { + s.ConversationLogs = v + return s +} + // SetCreatedDate sets the CreatedDate field's value. func (s *GetBotAliasOutput) SetCreatedDate(v time.Time) *GetBotAliasOutput { s.CreatedDate = &v @@ -6722,6 +7020,10 @@ type GetBotOutput struct { // A description of the bot. Description *string `locationName:"description" type:"string"` + // Indicates whether user utterances should be sent to Amazon Comprehend for + // sentiment analysis. + DetectSentiment *bool `locationName:"detectSentiment" type:"boolean"` + // If status is FAILED, Amazon Lex explains why it failed to build the bot. FailureReason *string `locationName:"failureReason" type:"string"` @@ -6742,10 +7044,19 @@ type GetBotOutput struct { // The name of the bot. Name *string `locationName:"name" min:"2" type:"string"` - // The status of the bot. If the bot is ready to run, the status is READY. If - // there was a problem with building the bot, the status is FAILED and the failureReason - // explains why the bot did not build. If the bot was saved but not built, the - // status is NOT BUILT. + // The status of the bot. + // + // When the status is BUILDING Amazon Lex is building the bot for testing and + // use. + // + // If the status of the bot is READY_BASIC_TESTING, you can test the bot using + // the exact utterances specified in the bot's intents. When the bot is ready + // for full testing or to run, the status is READY. + // + // If there was a problem with building the bot, the status is FAILED and the + // failureReason field explains why the bot did not build. + // + // If the bot was saved but not built, the status is NOT_BUILT. Status *string `locationName:"status" type:"string" enum:"Status"` // The version of the bot. For a new bot, the version is always $LATEST. @@ -6802,6 +7113,12 @@ func (s *GetBotOutput) SetDescription(v string) *GetBotOutput { return s } +// SetDetectSentiment sets the DetectSentiment field's value. +func (s *GetBotOutput) SetDetectSentiment(v bool) *GetBotOutput { + s.DetectSentiment = &v + return s +} + // SetFailureReason sets the FailureReason field's value. func (s *GetBotOutput) SetFailureReason(v string) *GetBotOutput { s.FailureReason = &v @@ -8121,7 +8438,7 @@ type GetSlotTypeOutput struct { // A list of EnumerationValue objects that defines the values that the slot // type can take. - EnumerationValues []*EnumerationValue `locationName:"enumerationValues" min:"1" type:"list"` + EnumerationValues []*EnumerationValue `locationName:"enumerationValues" type:"list"` // The date that the slot type was updated. When you create a resource, the // creation date and last update date are the same. @@ -8130,6 +8447,12 @@ type GetSlotTypeOutput struct { // The name of the slot type. Name *string `locationName:"name" min:"1" type:"string"` + // The built-in slot type used as a parent for the slot type. + ParentSlotTypeSignature *string `locationName:"parentSlotTypeSignature" min:"1" type:"string"` + + // Configuration information that extends the parent built-in slot type. + SlotTypeConfigurations []*SlotTypeConfiguration `locationName:"slotTypeConfigurations" type:"list"` + // The strategy that Amazon Lex uses to determine the value of the slot. For // more information, see PutSlotType. ValueSelectionStrategy *string `locationName:"valueSelectionStrategy" type:"string" enum:"SlotValueSelectionStrategy"` @@ -8184,6 +8507,18 @@ func (s *GetSlotTypeOutput) SetName(v string) *GetSlotTypeOutput { return s } +// SetParentSlotTypeSignature sets the ParentSlotTypeSignature field's value. +func (s *GetSlotTypeOutput) SetParentSlotTypeSignature(v string) *GetSlotTypeOutput { + s.ParentSlotTypeSignature = &v + return s +} + +// SetSlotTypeConfigurations sets the SlotTypeConfigurations field's value. +func (s *GetSlotTypeOutput) SetSlotTypeConfigurations(v []*SlotTypeConfiguration) *GetSlotTypeOutput { + s.SlotTypeConfigurations = v + return s +} + // SetValueSelectionStrategy sets the ValueSelectionStrategy field's value. func (s *GetSlotTypeOutput) SetValueSelectionStrategy(v string) *GetSlotTypeOutput { s.ValueSelectionStrategy = &v @@ -8409,7 +8744,7 @@ type GetUtterancesViewInput struct { // BotVersions is a required field BotVersions []*string `location:"querystring" locationName:"bot_versions" min:"1" type:"list" required:"true"` - // To return utterances that were recognized and handled, useDetected. To return + // To return utterances that were recognized and handled, use Detected. To return // utterances that were not recognized, use Missed. // // StatusType is a required field @@ -8477,7 +8812,9 @@ type GetUtterancesViewOutput struct { // An array of UtteranceList objects, each containing a list of UtteranceData // objects describing the utterances that were processed by your bot. The response - // contains a maximum of 100 UtteranceData objects for each version. + // contains a maximum of 100 UtteranceData objects for each version. Amazon + // Lex returns the most frequent utterances received by the bot in the last + // 15 days. Utterances []*UtteranceList `locationName:"utterances" type:"list"` } @@ -8623,119 +8960,499 @@ func (s *IntentMetadata) SetVersion(v string) *IntentMetadata { return s } -// The message object that provides the message text and its type. -type Message struct { - _ struct{} `type:"structure"` - - // The text of the message. - // - // Content is a required field - Content *string `locationName:"content" min:"1" type:"string" required:"true"` - - // The content type of the message string. - // - // ContentType is a required field - ContentType *string `locationName:"contentType" type:"string" required:"true" enum:"ContentType"` +// An internal Amazon Lex error occurred. Try your request again. +type InternalFailureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Identifies the message group that the message belongs to. When a group is - // assigned to a message, Amazon Lex returns one message from each group in - // the response. - GroupNumber *int64 `locationName:"groupNumber" min:"1" type:"integer"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s Message) String() string { +func (s InternalFailureException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Message) GoString() string { +func (s InternalFailureException) 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.Content == nil { - invalidParams.Add(request.NewErrParamRequired("Content")) - } - if s.Content != nil && len(*s.Content) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Content", 1)) - } - if s.ContentType == nil { - invalidParams.Add(request.NewErrParamRequired("ContentType")) - } - if s.GroupNumber != nil && *s.GroupNumber < 1 { - invalidParams.Add(request.NewErrParamMinValue("GroupNumber", 1)) +func newErrorInternalFailureException(v protocol.ResponseMetadata) error { + return &InternalFailureException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InternalFailureException) Code() string { + return "InternalFailureException" +} + +// Message returns the exception's message. +func (s InternalFailureException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetContent sets the Content field's value. -func (s *Message) SetContent(v string) *Message { - s.Content = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalFailureException) OrigErr() error { + return nil } -// SetContentType sets the ContentType field's value. -func (s *Message) SetContentType(v string) *Message { - s.ContentType = &v - return s +func (s InternalFailureException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetGroupNumber sets the GroupNumber field's value. -func (s *Message) SetGroupNumber(v int64) *Message { - s.GroupNumber = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InternalFailureException) StatusCode() int { + return s.respMetadata.StatusCode } -// Obtains information from the user. To define a prompt, provide one or more -// messages and specify the number of attempts to get information from the user. -// If you provide more than one message, Amazon Lex chooses one of the messages -// to use to prompt the user. For more information, see how-it-works. -type Prompt struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InternalFailureException) RequestID() string { + return s.respMetadata.RequestID +} - // The number of times to prompt the user for information. - // - // MaxAttempts is a required field - MaxAttempts *int64 `locationName:"maxAttempts" min:"1" type:"integer" required:"true"` +// The request exceeded a limit. Try your request again. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // An array of objects, each of which provides a message string and its type. - // You can specify the message string in plain text or in Speech Synthesis Markup - // Language (SSML). - // - // Messages is a required field - Messages []*Message `locationName:"messages" min:"1" type:"list" required:"true"` + Message_ *string `locationName:"message" type:"string"` - // A response card. Amazon Lex uses this prompt at runtime, in the PostText - // API response. It substitutes session attributes and slot values for placeholders - // in the response card. For more information, see ex-resp-card. - ResponseCard *string `locationName:"responseCard" min:"1" type:"string"` + RetryAfterSeconds *string `location:"header" locationName:"Retry-After" type:"string"` } // String returns the string representation -func (s Prompt) String() string { +func (s LimitExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Prompt) GoString() string { +func (s LimitExceededException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *Prompt) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Prompt"} - if s.MaxAttempts == nil { - invalidParams.Add(request.NewErrParamRequired("MaxAttempts")) +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, } - if s.MaxAttempts != nil && *s.MaxAttempts < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxAttempts", 1)) +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// Settings used to configure delivery mode and destination for conversation +// logs. +type LogSettingsRequest struct { + _ struct{} `type:"structure"` + + // Where the logs will be delivered. Text logs are delivered to a CloudWatch + // Logs log group. Audio logs are delivered to an S3 bucket. + // + // Destination is a required field + Destination *string `locationName:"destination" type:"string" required:"true" enum:"Destination"` + + // The Amazon Resource Name (ARN) of the AWS KMS customer managed key for encrypting + // audio logs delivered to an S3 bucket. The key does not apply to CloudWatch + // Logs and is optional for S3 buckets. + KmsKeyArn *string `locationName:"kmsKeyArn" min:"20" type:"string"` + + // The type of logging to enable. Text logs are delivered to a CloudWatch Logs + // log group. Audio logs are delivered to an S3 bucket. + // + // LogType is a required field + LogType *string `locationName:"logType" type:"string" required:"true" enum:"LogType"` + + // The Amazon Resource Name (ARN) of the CloudWatch Logs log group or S3 bucket + // where the logs should be delivered. + // + // ResourceArn is a required field + ResourceArn *string `locationName:"resourceArn" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s LogSettingsRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LogSettingsRequest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LogSettingsRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LogSettingsRequest"} + if s.Destination == nil { + invalidParams.Add(request.NewErrParamRequired("Destination")) + } + if s.KmsKeyArn != nil && len(*s.KmsKeyArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("KmsKeyArn", 20)) + } + if s.LogType == nil { + invalidParams.Add(request.NewErrParamRequired("LogType")) + } + 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 +} + +// SetDestination sets the Destination field's value. +func (s *LogSettingsRequest) SetDestination(v string) *LogSettingsRequest { + s.Destination = &v + return s +} + +// SetKmsKeyArn sets the KmsKeyArn field's value. +func (s *LogSettingsRequest) SetKmsKeyArn(v string) *LogSettingsRequest { + s.KmsKeyArn = &v + return s +} + +// SetLogType sets the LogType field's value. +func (s *LogSettingsRequest) SetLogType(v string) *LogSettingsRequest { + s.LogType = &v + return s +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *LogSettingsRequest) SetResourceArn(v string) *LogSettingsRequest { + s.ResourceArn = &v + return s +} + +// The settings for conversation logs. +type LogSettingsResponse struct { + _ struct{} `type:"structure"` + + // The destination where logs are delivered. + Destination *string `locationName:"destination" type:"string" enum:"Destination"` + + // The Amazon Resource Name (ARN) of the key used to encrypt audio logs in an + // S3 bucket. + KmsKeyArn *string `locationName:"kmsKeyArn" min:"20" type:"string"` + + // The type of logging that is enabled. + LogType *string `locationName:"logType" type:"string" enum:"LogType"` + + // The Amazon Resource Name (ARN) of the CloudWatch Logs log group or S3 bucket + // where the logs are delivered. + ResourceArn *string `locationName:"resourceArn" min:"1" type:"string"` + + // The resource prefix is the first part of the S3 object key within the S3 + // bucket that you specified to contain audio logs. For CloudWatch Logs it is + // the prefix of the log stream name within the log group that you specified. + ResourcePrefix *string `locationName:"resourcePrefix" type:"string"` +} + +// String returns the string representation +func (s LogSettingsResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LogSettingsResponse) GoString() string { + return s.String() +} + +// SetDestination sets the Destination field's value. +func (s *LogSettingsResponse) SetDestination(v string) *LogSettingsResponse { + s.Destination = &v + return s +} + +// SetKmsKeyArn sets the KmsKeyArn field's value. +func (s *LogSettingsResponse) SetKmsKeyArn(v string) *LogSettingsResponse { + s.KmsKeyArn = &v + return s +} + +// SetLogType sets the LogType field's value. +func (s *LogSettingsResponse) SetLogType(v string) *LogSettingsResponse { + s.LogType = &v + return s +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *LogSettingsResponse) SetResourceArn(v string) *LogSettingsResponse { + s.ResourceArn = &v + return s +} + +// SetResourcePrefix sets the ResourcePrefix field's value. +func (s *LogSettingsResponse) SetResourcePrefix(v string) *LogSettingsResponse { + s.ResourcePrefix = &v + return s +} + +// The message object that provides the message text and its type. +type Message struct { + _ struct{} `type:"structure"` + + // The text of the message. + // + // Content is a required field + Content *string `locationName:"content" min:"1" type:"string" required:"true"` + + // The content type of the message string. + // + // ContentType is a required field + ContentType *string `locationName:"contentType" type:"string" required:"true" enum:"ContentType"` + + // Identifies the message group that the message belongs to. When a group is + // assigned to a message, Amazon Lex returns one message from each group in + // the response. + GroupNumber *int64 `locationName:"groupNumber" min:"1" type:"integer"` +} + +// 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.Content == nil { + invalidParams.Add(request.NewErrParamRequired("Content")) + } + if s.Content != nil && len(*s.Content) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Content", 1)) + } + if s.ContentType == nil { + invalidParams.Add(request.NewErrParamRequired("ContentType")) + } + if s.GroupNumber != nil && *s.GroupNumber < 1 { + invalidParams.Add(request.NewErrParamMinValue("GroupNumber", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetContent sets the Content field's value. +func (s *Message) SetContent(v string) *Message { + s.Content = &v + return s +} + +// SetContentType sets the ContentType field's value. +func (s *Message) SetContentType(v string) *Message { + s.ContentType = &v + return s +} + +// SetGroupNumber sets the GroupNumber field's value. +func (s *Message) SetGroupNumber(v int64) *Message { + s.GroupNumber = &v + return s +} + +// The resource specified in the request was not found. Check the resource and +// try again. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The checksum of the resource that you are trying to change does not match +// the checksum in the request. Check the resource's checksum and try again. +type PreconditionFailedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PreconditionFailedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PreconditionFailedException) GoString() string { + return s.String() +} + +func newErrorPreconditionFailedException(v protocol.ResponseMetadata) error { + return &PreconditionFailedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PreconditionFailedException) Code() string { + return "PreconditionFailedException" +} + +// Message returns the exception's message. +func (s PreconditionFailedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PreconditionFailedException) OrigErr() error { + return nil +} + +func (s PreconditionFailedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PreconditionFailedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PreconditionFailedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Obtains information from the user. To define a prompt, provide one or more +// messages and specify the number of attempts to get information from the user. +// If you provide more than one message, Amazon Lex chooses one of the messages +// to use to prompt the user. For more information, see how-it-works. +type Prompt struct { + _ struct{} `type:"structure"` + + // The number of times to prompt the user for information. + // + // MaxAttempts is a required field + MaxAttempts *int64 `locationName:"maxAttempts" min:"1" type:"integer" required:"true"` + + // An array of objects, each of which provides a message string and its type. + // You can specify the message string in plain text or in Speech Synthesis Markup + // Language (SSML). + // + // Messages is a required field + Messages []*Message `locationName:"messages" min:"1" type:"list" required:"true"` + + // A response card. Amazon Lex uses this prompt at runtime, in the PostText + // API response. It substitutes session attributes and slot values for placeholders + // in the response card. For more information, see ex-resp-card. + ResponseCard *string `locationName:"responseCard" min:"1" type:"string"` +} + +// String returns the string representation +func (s Prompt) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Prompt) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Prompt) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Prompt"} + if s.MaxAttempts == nil { + invalidParams.Add(request.NewErrParamRequired("MaxAttempts")) + } + if s.MaxAttempts != nil && *s.MaxAttempts < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxAttempts", 1)) } if s.Messages == nil { invalidParams.Add(request.NewErrParamRequired("Messages")) @@ -8805,6 +9522,9 @@ type PutBotAliasInput struct { // you get a PreconditionFailedException exception. Checksum *string `locationName:"checksum" type:"string"` + // Settings for conversation logs for the alias. + ConversationLogs *ConversationLogsRequest `locationName:"conversationLogs" type:"structure"` + // A description of the alias. Description *string `locationName:"description" type:"string"` @@ -8845,6 +9565,11 @@ func (s *PutBotAliasInput) Validate() error { if s.Name != nil && len(*s.Name) < 1 { invalidParams.Add(request.NewErrParamMinLen("Name", 1)) } + if s.ConversationLogs != nil { + if err := s.ConversationLogs.Validate(); err != nil { + invalidParams.AddNested("ConversationLogs", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -8870,6 +9595,12 @@ func (s *PutBotAliasInput) SetChecksum(v string) *PutBotAliasInput { return s } +// SetConversationLogs sets the ConversationLogs field's value. +func (s *PutBotAliasInput) SetConversationLogs(v *ConversationLogsRequest) *PutBotAliasInput { + s.ConversationLogs = v + return s +} + // SetDescription sets the Description field's value. func (s *PutBotAliasInput) SetDescription(v string) *PutBotAliasInput { s.Description = &v @@ -8894,6 +9625,10 @@ type PutBotAliasOutput struct { // The checksum for the current version of the alias. Checksum *string `locationName:"checksum" type:"string"` + // The settings that determine how Amazon Lex uses conversation logs for the + // alias. + ConversationLogs *ConversationLogsResponse `locationName:"conversationLogs" type:"structure"` + // The date that the bot alias was created. CreatedDate *time.Time `locationName:"createdDate" type:"timestamp"` @@ -8936,6 +9671,12 @@ func (s *PutBotAliasOutput) SetChecksum(v string) *PutBotAliasOutput { return s } +// SetConversationLogs sets the ConversationLogs field's value. +func (s *PutBotAliasOutput) SetConversationLogs(v *ConversationLogsResponse) *PutBotAliasOutput { + s.ConversationLogs = v + return s +} + // SetCreatedDate sets the CreatedDate field's value. func (s *PutBotAliasOutput) SetCreatedDate(v time.Time) *PutBotAliasOutput { s.CreatedDate = &v @@ -8977,6 +9718,10 @@ type PutBotInput struct { // For example, in a pizza ordering application, OrderPizza might be one of // the intents. This intent might require the CrustType slot. You specify the // valueElicitationPrompt field when you create the CrustType slot. + // + // If you have defined a fallback intent the abort statement will not be sent + // to the user, the fallback intent is used instead. For more information, see + // AMAZON.FallbackIntent (https://docs.aws.amazon.com/lex/latest/dg/built-in-intent-fallback.html). AbortStatement *Statement `locationName:"abortStatement" type:"structure"` // Identifies a specific revision of the $LATEST version. @@ -9018,7 +9763,7 @@ type PutBotInput struct { ChildDirected *bool `locationName:"childDirected" type:"boolean" required:"true"` // When Amazon Lex doesn't understand the user's intent, it uses this message - // to get clarification. To specify how many times Amazon Lex should repeate + // to get clarification. To specify how many times Amazon Lex should repeat // the clarification prompt, use the maxAttempts field. If Amazon Lex still // doesn't understand, it sends the message in the abortStatement field. // @@ -9026,13 +9771,41 @@ type PutBotInput struct { // response from the user. for example, for a bot that orders pizza and drinks, // you might create this clarification prompt: "What would you like to do? You // can say 'Order a pizza' or 'Order a drink.'" + // + // If you have defined a fallback intent, it will be invoked if the clarification + // prompt is repeated the number of times defined in the maxAttempts field. + // For more information, see AMAZON.FallbackIntent (https://docs.aws.amazon.com/lex/latest/dg/built-in-intent-fallback.html). + // + // If you don't define a clarification prompt, at runtime Amazon Lex will return + // a 400 Bad Request exception in three cases: + // + // * Follow-up prompt - When the user responds to a follow-up prompt but + // does not provide an intent. For example, in response to a follow-up prompt + // that says "Would you like anything else today?" the user says "Yes." Amazon + // Lex will return a 400 Bad Request exception because it does not have a + // clarification prompt to send to the user to get an intent. + // + // * Lambda function - When using a Lambda function, you return an ElicitIntent + // dialog type. Since Amazon Lex does not have a clarification prompt to + // get an intent from the user, it returns a 400 Bad Request exception. + // + // * PutSession operation - When using the PutSession operation, you send + // an ElicitIntent dialog type. Since Amazon Lex does not have a clarification + // prompt to get an intent from the user, it returns a 400 Bad Request exception. ClarificationPrompt *Prompt `locationName:"clarificationPrompt" type:"structure"` + // When set to true a new numbered version of the bot is created. This is the + // same as calling the CreateBotVersion operation. If you don't specify createVersion, + // the default is false. CreateVersion *bool `locationName:"createVersion" type:"boolean"` // A description of the bot. Description *string `locationName:"description" type:"string"` + // When set to true user utterances are sent to Amazon Comprehend for sentiment + // analysis. If you don't specify detectSentiment, the default is false. + DetectSentiment *bool `locationName:"detectSentiment" type:"boolean"` + // The maximum time in seconds that Amazon Lex retains the data gathered in // a conversation. // @@ -9079,7 +9852,7 @@ type PutBotInput struct { // The Amazon Polly voice ID that you want Amazon Lex to use for voice interactions // with the user. The locale configured for the voice must match the locale - // of the bot. For more information, see Available Voices (http://docs.aws.amazon.com/polly/latest/dg/voicelist.html) + // of the bot. For more information, see Voices in Amazon Polly (https://docs.aws.amazon.com/polly/latest/dg/voicelist.html) // in the Amazon Polly Developer Guide. VoiceId *string `locationName:"voiceId" type:"string"` } @@ -9175,6 +9948,12 @@ func (s *PutBotInput) SetDescription(v string) *PutBotInput { return s } +// SetDetectSentiment sets the DetectSentiment field's value. +func (s *PutBotInput) SetDetectSentiment(v bool) *PutBotInput { + s.DetectSentiment = &v + return s +} + // SetIdleSessionTTLInSeconds sets the IdleSessionTTLInSeconds field's value. func (s *PutBotInput) SetIdleSessionTTLInSeconds(v int64) *PutBotInput { s.IdleSessionTTLInSeconds = &v @@ -9250,6 +10029,9 @@ type PutBotOutput struct { // For more information, see PutBot. ClarificationPrompt *Prompt `locationName:"clarificationPrompt" type:"structure"` + // True if a new version of the bot was created. If the createVersion field + // was not specified in the request, the createVersion field is set to false + // in the response. CreateVersion *bool `locationName:"createVersion" type:"boolean"` // The date that the bot was created. @@ -9258,6 +10040,11 @@ type PutBotOutput struct { // A description of the bot. Description *string `locationName:"description" type:"string"` + // true if the bot is configured to send user utterances to Amazon Comprehend + // for sentiment analysis. If the detectSentiment field was not specified in + // the request, the detectSentiment field is false in the response. + DetectSentiment *bool `locationName:"detectSentiment" type:"boolean"` + // If status is FAILED, Amazon Lex provides the reason that it failed to build // the bot. FailureReason *string `locationName:"failureReason" type:"string"` @@ -9280,13 +10067,19 @@ type PutBotOutput struct { Name *string `locationName:"name" min:"2" type:"string"` // When you send a request to create a bot with processBehavior set to BUILD, - // Amazon Lex sets the status response element to BUILDING. After Amazon Lex - // builds the bot, it sets status to READY. If Amazon Lex can't build the bot, - // Amazon Lex sets status to FAILED. Amazon Lex returns the reason for the failure - // in the failureReason response element. + // Amazon Lex sets the status response element to BUILDING. // - // When you set processBehaviorto SAVE, Amazon Lex sets the status code to NOT - // BUILT. + // In the READY_BASIC_TESTING state you can test the bot with user inputs that + // exactly match the utterances configured for the bot's intents and values + // in the slot types. + // + // If Amazon Lex can't build the bot, Amazon Lex sets status to FAILED. Amazon + // Lex returns the reason for the failure in the failureReason response element. + // + // When you set processBehavior to SAVE, Amazon Lex sets the status code to + // NOT BUILT. + // + // When the bot is in the READY state you can test and publish the bot. Status *string `locationName:"status" type:"string" enum:"Status"` // The version of the bot. For a new bot, the version is always $LATEST. @@ -9349,6 +10142,12 @@ func (s *PutBotOutput) SetDescription(v string) *PutBotOutput { return s } +// SetDetectSentiment sets the DetectSentiment field's value. +func (s *PutBotOutput) SetDetectSentiment(v bool) *PutBotOutput { + s.DetectSentiment = &v + return s +} + // SetFailureReason sets the FailureReason field's value. func (s *PutBotOutput) SetFailureReason(v string) *PutBotOutput { s.FailureReason = &v @@ -9441,6 +10240,9 @@ type PutIntentInput struct { // or neither. ConfirmationPrompt *Prompt `locationName:"confirmationPrompt" type:"structure"` + // When set to true a new numbered version of the intent is created. This is + // the same as calling the CreateIntentVersion operation. If you do not specify + // createVersion, the default is false. CreateVersion *bool `locationName:"createVersion" type:"boolean"` // A description of the intent. @@ -9682,6 +10484,9 @@ type PutIntentOutput struct { // before fulfilling it. ConfirmationPrompt *Prompt `locationName:"confirmationPrompt" type:"structure"` + // True if a new version of the intent was created. If the createVersion field + // was not specified in the request, the createVersion field is set to false + // in the response. CreateVersion *bool `locationName:"createVersion" type:"boolean"` // The date that the intent was created. @@ -9847,6 +10652,9 @@ type PutSlotTypeInput struct { // you get a PreconditionFailedException exception. Checksum *string `locationName:"checksum" type:"string"` + // When set to true a new numbered version of the slot type is created. This + // is the same as calling the CreateSlotTypeVersion operation. If you do not + // specify createVersion, the default is false. CreateVersion *bool `locationName:"createVersion" type:"boolean"` // A description of the slot type. @@ -9863,7 +10671,7 @@ type PutSlotTypeInput struct { // using a Lambda function you can choose to return the value that the user // entered or the first value in the resolution list as the slot value. The // valueSelectionStrategy field indicates the option to use. - EnumerationValues []*EnumerationValue `locationName:"enumerationValues" min:"1" type:"list"` + EnumerationValues []*EnumerationValue `locationName:"enumerationValues" type:"list"` // The name of the slot type. The name is not case sensitive. // @@ -9877,6 +10685,17 @@ type PutSlotTypeInput struct { // Name is a required field Name *string `location:"uri" locationName:"name" min:"1" type:"string" required:"true"` + // The built-in slot type used as the parent of the slot type. When you define + // a parent slot type, the new slot type has all of the same configuration as + // the parent. + // + // Only AMAZON.AlphaNumeric is supported. + ParentSlotTypeSignature *string `locationName:"parentSlotTypeSignature" min:"1" type:"string"` + + // Configuration information that extends the parent built-in slot type. The + // configuration is added to the settings for the parent slot type. + SlotTypeConfigurations []*SlotTypeConfiguration `locationName:"slotTypeConfigurations" type:"list"` + // Determines the slot resolution strategy that Amazon Lex uses to return slot // type values. The field can be set to one of the following values: // @@ -9904,15 +10723,15 @@ func (s PutSlotTypeInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *PutSlotTypeInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "PutSlotTypeInput"} - if s.EnumerationValues != nil && len(s.EnumerationValues) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EnumerationValues", 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.ParentSlotTypeSignature != nil && len(*s.ParentSlotTypeSignature) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ParentSlotTypeSignature", 1)) + } if s.EnumerationValues != nil { for i, v := range s.EnumerationValues { if v == nil { @@ -9923,6 +10742,16 @@ func (s *PutSlotTypeInput) Validate() error { } } } + if s.SlotTypeConfigurations != nil { + for i, v := range s.SlotTypeConfigurations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SlotTypeConfigurations", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -9960,6 +10789,18 @@ func (s *PutSlotTypeInput) SetName(v string) *PutSlotTypeInput { return s } +// SetParentSlotTypeSignature sets the ParentSlotTypeSignature field's value. +func (s *PutSlotTypeInput) SetParentSlotTypeSignature(v string) *PutSlotTypeInput { + s.ParentSlotTypeSignature = &v + return s +} + +// SetSlotTypeConfigurations sets the SlotTypeConfigurations field's value. +func (s *PutSlotTypeInput) SetSlotTypeConfigurations(v []*SlotTypeConfiguration) *PutSlotTypeInput { + s.SlotTypeConfigurations = v + return s +} + // SetValueSelectionStrategy sets the ValueSelectionStrategy field's value. func (s *PutSlotTypeInput) SetValueSelectionStrategy(v string) *PutSlotTypeInput { s.ValueSelectionStrategy = &v @@ -9972,6 +10813,9 @@ type PutSlotTypeOutput struct { // Checksum of the $LATEST version of the slot type. Checksum *string `locationName:"checksum" type:"string"` + // True if a new version of the slot type was created. If the createVersion + // field was not specified in the request, the createVersion field is set to + // false in the response. CreateVersion *bool `locationName:"createVersion" type:"boolean"` // The date that the slot type was created. @@ -9982,7 +10826,7 @@ type PutSlotTypeOutput struct { // A list of EnumerationValue objects that defines the values that the slot // type can take. - EnumerationValues []*EnumerationValue `locationName:"enumerationValues" min:"1" type:"list"` + EnumerationValues []*EnumerationValue `locationName:"enumerationValues" type:"list"` // The date that the slot type was updated. When you create a slot type, the // creation date and last update date are the same. @@ -9991,6 +10835,12 @@ type PutSlotTypeOutput struct { // The name of the slot type. Name *string `locationName:"name" min:"1" type:"string"` + // The built-in slot type used as the parent of the slot type. + ParentSlotTypeSignature *string `locationName:"parentSlotTypeSignature" min:"1" type:"string"` + + // Configuration information that extends the parent built-in slot type. + SlotTypeConfigurations []*SlotTypeConfiguration `locationName:"slotTypeConfigurations" type:"list"` + // The slot resolution strategy that Amazon Lex uses to determine the value // of the slot. For more information, see PutSlotType. ValueSelectionStrategy *string `locationName:"valueSelectionStrategy" type:"string" enum:"SlotValueSelectionStrategy"` @@ -10052,6 +10902,18 @@ func (s *PutSlotTypeOutput) SetName(v string) *PutSlotTypeOutput { return s } +// SetParentSlotTypeSignature sets the ParentSlotTypeSignature field's value. +func (s *PutSlotTypeOutput) SetParentSlotTypeSignature(v string) *PutSlotTypeOutput { + s.ParentSlotTypeSignature = &v + return s +} + +// SetSlotTypeConfigurations sets the SlotTypeConfigurations field's value. +func (s *PutSlotTypeOutput) SetSlotTypeConfigurations(v []*SlotTypeConfiguration) *PutSlotTypeOutput { + s.SlotTypeConfigurations = v + return s +} + // SetValueSelectionStrategy sets the ValueSelectionStrategy field's value. func (s *PutSlotTypeOutput) SetValueSelectionStrategy(v string) *PutSlotTypeOutput { s.ValueSelectionStrategy = &v @@ -10064,6 +10926,79 @@ func (s *PutSlotTypeOutput) SetVersion(v string) *PutSlotTypeOutput { return s } +// The resource that you are attempting to delete is referred to by another +// resource. Use this information to remove references to the resource that +// you are trying to delete. +// +// The body of the exception contains a JSON object that describes the resource. +// +// { "resourceType": BOT | BOTALIAS | BOTCHANNEL | INTENT, +// +// "resourceReference": { +// +// "name": string, "version": string } } +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Describes the resource that refers to the resource that you are attempting + // to delete. This object is returned as part of the ResourceInUseException + // exception. + ExampleReference *ResourceReference `locationName:"exampleReference" type:"structure"` + + Message_ *string `locationName:"message" type:"string"` + + ReferenceType *string `locationName:"referenceType" type:"string" enum:"ReferenceType"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes the resource that refers to the resource that you are attempting // to delete. This object is returned as part of the ResourceInUseException // exception. @@ -10113,6 +11048,13 @@ type Slot struct { // Name is a required field Name *string `locationName:"name" min:"1" type:"string" required:"true"` + // Determines whether a slot is obfuscated in conversation logs and stored utterances. + // When you obfuscate a slot, the value is replaced by the slot name in curly + // braces ({}). For example, if the slot name is "full_name", obfuscated values + // are replaced with "{full_name}". For more information, see Slot Obfuscation + // (https://docs.aws.amazon.com/lex/latest/dg/how-obfuscate.html). + ObfuscationSetting *string `locationName:"obfuscationSetting" type:"string" enum:"ObfuscationSetting"` + // Directs Lex the order in which to elicit this slot value from the user. For // example, if the intent has two slots with priorities 1 and 2, AWS Lex first // elicits a value for the slot with priority 1. @@ -10203,6 +11145,12 @@ func (s *Slot) SetName(v string) *Slot { return s } +// SetObfuscationSetting sets the ObfuscationSetting field's value. +func (s *Slot) SetObfuscationSetting(v string) *Slot { + s.ObfuscationSetting = &v + return s +} + // SetPriority sets the Priority field's value. func (s *Slot) SetPriority(v int64) *Slot { s.Priority = &v @@ -10245,6 +11193,45 @@ func (s *Slot) SetValueElicitationPrompt(v *Prompt) *Slot { return s } +// Provides configuration information for a slot type. +type SlotTypeConfiguration struct { + _ struct{} `type:"structure"` + + // A regular expression used to validate the value of a slot. + RegexConfiguration *SlotTypeRegexConfiguration `locationName:"regexConfiguration" type:"structure"` +} + +// String returns the string representation +func (s SlotTypeConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SlotTypeConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SlotTypeConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SlotTypeConfiguration"} + if s.RegexConfiguration != nil { + if err := s.RegexConfiguration.Validate(); err != nil { + invalidParams.AddNested("RegexConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRegexConfiguration sets the RegexConfiguration field's value. +func (s *SlotTypeConfiguration) SetRegexConfiguration(v *SlotTypeRegexConfiguration) *SlotTypeConfiguration { + s.RegexConfiguration = v + return s +} + // Provides information about a slot type.. type SlotTypeMetadata struct { _ struct{} `type:"structure"` @@ -10306,6 +11293,65 @@ func (s *SlotTypeMetadata) SetVersion(v string) *SlotTypeMetadata { return s } +// Provides a regular expression used to validate the value of a slot. +type SlotTypeRegexConfiguration struct { + _ struct{} `type:"structure"` + + // A regular expression used to validate the value of a slot. + // + // Use a standard regular expression. Amazon Lex supports the following characters + // in the regular expression: + // + // * A-Z, a-z + // + // * 0-9 + // + // * Unicode characters ("\ u") + // + // Represent Unicode characters with four digits, for example "\u0041" or "\u005A". + // + // The following regular expression operators are not supported: + // + // * Infinite repeaters: *, +, or {x,} with no upper bound. + // + // * Wild card (.) + // + // Pattern is a required field + Pattern *string `locationName:"pattern" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s SlotTypeRegexConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SlotTypeRegexConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SlotTypeRegexConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SlotTypeRegexConfiguration"} + if s.Pattern == nil { + invalidParams.Add(request.NewErrParamRequired("Pattern")) + } + if s.Pattern != nil && len(*s.Pattern) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Pattern", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPattern sets the Pattern field's value. +func (s *SlotTypeRegexConfiguration) SetPattern(v string) *SlotTypeRegexConfiguration { + s.Pattern = &v + return s +} + type StartImportInput struct { _ struct{} `type:"structure"` @@ -10659,6 +11705,14 @@ const ( ContentTypeCustomPayload = "CustomPayload" ) +const ( + // DestinationCloudwatchLogs is a Destination enum value + DestinationCloudwatchLogs = "CLOUDWATCH_LOGS" + + // DestinationS3 is a Destination enum value + DestinationS3 = "S3" +) + const ( // ExportStatusInProgress is a ExportStatus enum value ExportStatusInProgress = "IN_PROGRESS" @@ -10708,6 +11762,14 @@ const ( LocaleDeDe = "de-DE" ) +const ( + // LogTypeAudio is a LogType enum value + LogTypeAudio = "AUDIO" + + // LogTypeText is a LogType enum value + LogTypeText = "TEXT" +) + const ( // MergeStrategyOverwriteLatest is a MergeStrategy enum value MergeStrategyOverwriteLatest = "OVERWRITE_LATEST" @@ -10716,6 +11778,14 @@ const ( MergeStrategyFailOnConflict = "FAIL_ON_CONFLICT" ) +const ( + // ObfuscationSettingNone is a ObfuscationSetting enum value + ObfuscationSettingNone = "NONE" + + // ObfuscationSettingDefaultObfuscation is a ObfuscationSetting enum value + ObfuscationSettingDefaultObfuscation = "DEFAULT_OBFUSCATION" +) + const ( // ProcessBehaviorSave is a ProcessBehavior enum value ProcessBehaviorSave = "SAVE" diff --git a/vendor/github.com/aws/aws-sdk-go/service/lexmodelbuildingservice/errors.go b/vendor/github.com/aws/aws-sdk-go/service/lexmodelbuildingservice/errors.go index da3b08cb8d6..ad9e017f214 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lexmodelbuildingservice/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lexmodelbuildingservice/errors.go @@ -2,6 +2,10 @@ package lexmodelbuildingservice +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadRequestException for service response error code @@ -59,3 +63,13 @@ const ( // "name": string, "version": string } } ErrCodeResourceInUseException = "ResourceInUseException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadRequestException": newErrorBadRequestException, + "ConflictException": newErrorConflictException, + "InternalFailureException": newErrorInternalFailureException, + "LimitExceededException": newErrorLimitExceededException, + "NotFoundException": newErrorNotFoundException, + "PreconditionFailedException": newErrorPreconditionFailedException, + "ResourceInUseException": newErrorResourceInUseException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/lexmodelbuildingservice/service.go b/vendor/github.com/aws/aws-sdk-go/service/lexmodelbuildingservice/service.go index 0f9509ff725..3d811922053 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lexmodelbuildingservice/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lexmodelbuildingservice/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "models.lex" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Lex Model Building Service" // ServiceID is a unique identifer of a specific service. + ServiceID = "Lex Model Building Service" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the LexModelBuildingService client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a LexModelBuildingService client from just a session. // svc := lexmodelbuildingservice.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *LexModelBuildingService if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "lex" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *LexModelBuildingService { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *LexModelBuildingService { svc := &LexModelBuildingService{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-04-19", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/licensemanager/api.go b/vendor/github.com/aws/aws-sdk-go/service/licensemanager/api.go index d292b8956f7..6fab0ad67e7 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/licensemanager/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/licensemanager/api.go @@ -57,13 +57,14 @@ func (c *LicenseManager) CreateLicenseConfigurationRequest(input *CreateLicenseC // CreateLicenseConfiguration API operation for AWS License Manager. // -// Creates a new license configuration object. A license configuration is an -// abstraction of a customer license agreement that can be consumed and enforced -// by License Manager. Components include specifications for the license type -// (licensing by instance, socket, CPU, or VCPU), tenancy (shared tenancy, Amazon -// EC2 Dedicated Instance, Amazon EC2 Dedicated Host, or any of these), host -// affinity (how long a VM must be associated with a host), the number of licenses -// purchased and used. +// Creates a license configuration. +// +// A license configuration is an abstraction of a customer license agreement +// that can be consumed and enforced by License Manager. Components include +// specifications for the license type (licensing by instance, socket, CPU, +// or vCPU), allowed tenancy (shared tenancy, Dedicated Instance, Dedicated +// Host, or all of these), host affinity (how long a VM must be associated with +// a host), and the number of licenses purchased and used. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -72,24 +73,24 @@ func (c *LicenseManager) CreateLicenseConfigurationRequest(input *CreateLicenseC // See the AWS API reference guide for AWS License Manager's // API operation CreateLicenseConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more parameter values are not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The server experienced an internal error. Try again. // -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" +// * ResourceLimitExceededException // Your resource limits have been exceeded. // -// * ErrCodeAuthorizationException "AuthorizationException" +// * AuthorizationException // The AWS user account does not have permission to perform the action. Check // the IAM policy associated with this account. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to resource denied. // -// * ErrCodeRateLimitExceededException "RateLimitExceededException" +// * RateLimitExceededException // Too many requests have been submitted. Try again after a brief wait. // // See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/CreateLicenseConfiguration @@ -159,8 +160,9 @@ func (c *LicenseManager) DeleteLicenseConfigurationRequest(input *DeleteLicenseC // DeleteLicenseConfiguration API operation for AWS License Manager. // -// Deletes an existing license configuration. This action fails if the configuration -// is in use. +// Deletes the specified license configuration. +// +// You cannot delete a license configuration that is in 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 @@ -169,21 +171,21 @@ func (c *LicenseManager) DeleteLicenseConfigurationRequest(input *DeleteLicenseC // See the AWS API reference guide for AWS License Manager's // API operation DeleteLicenseConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more parameter values are not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The server experienced an internal error. Try again. // -// * ErrCodeAuthorizationException "AuthorizationException" +// * AuthorizationException // The AWS user account does not have permission to perform the action. Check // the IAM policy associated with this account. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to resource denied. // -// * ErrCodeRateLimitExceededException "RateLimitExceededException" +// * RateLimitExceededException // Too many requests have been submitted. Try again after a brief wait. // // See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/DeleteLicenseConfiguration @@ -252,7 +254,7 @@ func (c *LicenseManager) GetLicenseConfigurationRequest(input *GetLicenseConfigu // GetLicenseConfiguration API operation for AWS License Manager. // -// Returns a detailed description of a license configuration. +// Gets detailed information about the specified license 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 @@ -261,21 +263,21 @@ func (c *LicenseManager) GetLicenseConfigurationRequest(input *GetLicenseConfigu // See the AWS API reference guide for AWS License Manager's // API operation GetLicenseConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more parameter values are not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The server experienced an internal error. Try again. // -// * ErrCodeAuthorizationException "AuthorizationException" +// * AuthorizationException // The AWS user account does not have permission to perform the action. Check // the IAM policy associated with this account. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to resource denied. // -// * ErrCodeRateLimitExceededException "RateLimitExceededException" +// * RateLimitExceededException // Too many requests have been submitted. Try again after a brief wait. // // See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/GetLicenseConfiguration @@ -344,8 +346,7 @@ func (c *LicenseManager) GetServiceSettingsRequest(input *GetServiceSettingsInpu // GetServiceSettings API operation for AWS License Manager. // -// Gets License Manager settings for a region. Exposes the configured S3 bucket, -// SNS topic, etc., for inspection. +// Gets the License Manager settings 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 @@ -354,18 +355,18 @@ func (c *LicenseManager) GetServiceSettingsRequest(input *GetServiceSettingsInpu // See the AWS API reference guide for AWS License Manager's // API operation GetServiceSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeServerInternalException "ServerInternalException" +// Returned Error Types: +// * ServerInternalException // The server experienced an internal error. Try again. // -// * ErrCodeAuthorizationException "AuthorizationException" +// * AuthorizationException // The AWS user account does not have permission to perform the action. Check // the IAM policy associated with this account. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to resource denied. // -// * ErrCodeRateLimitExceededException "RateLimitExceededException" +// * RateLimitExceededException // Too many requests have been submitted. Try again after a brief wait. // // See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/GetServiceSettings @@ -434,11 +435,11 @@ func (c *LicenseManager) ListAssociationsForLicenseConfigurationRequest(input *L // ListAssociationsForLicenseConfiguration API operation for AWS License Manager. // -// Lists the resource associations for a license configuration. Resource associations -// need not consume licenses from a license configuration. For example, an AMI -// or a stopped instance may not consume a license (depending on the license -// rules). Use this operation to find all resources associated with a license -// configuration. +// Lists the resource associations for the specified license configuration. +// +// Resource associations need not consume licenses from a license configuration. +// For example, an AMI or a stopped instance might not consume a license (depending +// on the license 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 @@ -447,24 +448,24 @@ func (c *LicenseManager) ListAssociationsForLicenseConfigurationRequest(input *L // See the AWS API reference guide for AWS License Manager's // API operation ListAssociationsForLicenseConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more parameter values are not valid. // -// * ErrCodeFilterLimitExceededException "FilterLimitExceededException" +// * FilterLimitExceededException // The request uses too many filters or too many filter values. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The server experienced an internal error. Try again. // -// * ErrCodeAuthorizationException "AuthorizationException" +// * AuthorizationException // The AWS user account does not have permission to perform the action. Check // the IAM policy associated with this account. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to resource denied. // -// * ErrCodeRateLimitExceededException "RateLimitExceededException" +// * RateLimitExceededException // Too many requests have been submitted. Try again after a brief wait. // // See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/ListAssociationsForLicenseConfiguration @@ -489,6 +490,98 @@ func (c *LicenseManager) ListAssociationsForLicenseConfigurationWithContext(ctx return out, req.Send() } +const opListFailuresForLicenseConfigurationOperations = "ListFailuresForLicenseConfigurationOperations" + +// ListFailuresForLicenseConfigurationOperationsRequest generates a "aws/request.Request" representing the +// client's request for the ListFailuresForLicenseConfigurationOperations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListFailuresForLicenseConfigurationOperations for more information on using the ListFailuresForLicenseConfigurationOperations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListFailuresForLicenseConfigurationOperationsRequest method. +// req, resp := client.ListFailuresForLicenseConfigurationOperationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/ListFailuresForLicenseConfigurationOperations +func (c *LicenseManager) ListFailuresForLicenseConfigurationOperationsRequest(input *ListFailuresForLicenseConfigurationOperationsInput) (req *request.Request, output *ListFailuresForLicenseConfigurationOperationsOutput) { + op := &request.Operation{ + Name: opListFailuresForLicenseConfigurationOperations, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListFailuresForLicenseConfigurationOperationsInput{} + } + + output = &ListFailuresForLicenseConfigurationOperationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListFailuresForLicenseConfigurationOperations API operation for AWS License Manager. +// +// Lists the license configuration operations that 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 License Manager's +// API operation ListFailuresForLicenseConfigurationOperations for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValueException +// One or more parameter values are not valid. +// +// * ServerInternalException +// The server experienced an internal error. Try again. +// +// * AuthorizationException +// The AWS user account does not have permission to perform the action. Check +// the IAM policy associated with this account. +// +// * AccessDeniedException +// Access to resource denied. +// +// * RateLimitExceededException +// Too many requests have been submitted. Try again after a brief wait. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/ListFailuresForLicenseConfigurationOperations +func (c *LicenseManager) ListFailuresForLicenseConfigurationOperations(input *ListFailuresForLicenseConfigurationOperationsInput) (*ListFailuresForLicenseConfigurationOperationsOutput, error) { + req, out := c.ListFailuresForLicenseConfigurationOperationsRequest(input) + return out, req.Send() +} + +// ListFailuresForLicenseConfigurationOperationsWithContext is the same as ListFailuresForLicenseConfigurationOperations with the addition of +// the ability to pass a context and additional request options. +// +// See ListFailuresForLicenseConfigurationOperations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *LicenseManager) ListFailuresForLicenseConfigurationOperationsWithContext(ctx aws.Context, input *ListFailuresForLicenseConfigurationOperationsInput, opts ...request.Option) (*ListFailuresForLicenseConfigurationOperationsOutput, error) { + req, out := c.ListFailuresForLicenseConfigurationOperationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opListLicenseConfigurations = "ListLicenseConfigurations" // ListLicenseConfigurationsRequest generates a "aws/request.Request" representing the @@ -533,9 +626,7 @@ func (c *LicenseManager) ListLicenseConfigurationsRequest(input *ListLicenseConf // ListLicenseConfigurations API operation for AWS License Manager. // -// Lists license configuration objects for an account, each containing the name, -// description, license type, and other license terms modeled from a license -// agreement. +// Lists the license configurations 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 @@ -544,24 +635,24 @@ func (c *LicenseManager) ListLicenseConfigurationsRequest(input *ListLicenseConf // See the AWS API reference guide for AWS License Manager's // API operation ListLicenseConfigurations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more parameter values are not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The server experienced an internal error. Try again. // -// * ErrCodeFilterLimitExceededException "FilterLimitExceededException" +// * FilterLimitExceededException // The request uses too many filters or too many filter values. // -// * ErrCodeAuthorizationException "AuthorizationException" +// * AuthorizationException // The AWS user account does not have permission to perform the action. Check // the IAM policy associated with this account. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to resource denied. // -// * ErrCodeRateLimitExceededException "RateLimitExceededException" +// * RateLimitExceededException // Too many requests have been submitted. Try again after a brief wait. // // See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/ListLicenseConfigurations @@ -630,7 +721,7 @@ func (c *LicenseManager) ListLicenseSpecificationsForResourceRequest(input *List // ListLicenseSpecificationsForResource API operation for AWS License Manager. // -// Returns the license configuration for a resource. +// Describes the license configurations for 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 @@ -639,21 +730,21 @@ func (c *LicenseManager) ListLicenseSpecificationsForResourceRequest(input *List // See the AWS API reference guide for AWS License Manager's // API operation ListLicenseSpecificationsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more parameter values are not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The server experienced an internal error. Try again. // -// * ErrCodeAuthorizationException "AuthorizationException" +// * AuthorizationException // The AWS user account does not have permission to perform the action. Check // the IAM policy associated with this account. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to resource denied. // -// * ErrCodeRateLimitExceededException "RateLimitExceededException" +// * RateLimitExceededException // Too many requests have been submitted. Try again after a brief wait. // // See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/ListLicenseSpecificationsForResource @@ -722,7 +813,7 @@ func (c *LicenseManager) ListResourceInventoryRequest(input *ListResourceInvento // ListResourceInventory API operation for AWS License Manager. // -// Returns a detailed list of resources. +// Lists resources managed using Systems Manager inventory. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -731,27 +822,27 @@ func (c *LicenseManager) ListResourceInventoryRequest(input *ListResourceInvento // See the AWS API reference guide for AWS License Manager's // API operation ListResourceInventory for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more parameter values are not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The server experienced an internal error. Try again. // -// * ErrCodeFilterLimitExceededException "FilterLimitExceededException" +// * FilterLimitExceededException // The request uses too many filters or too many filter values. // -// * ErrCodeFailedDependencyException "FailedDependencyException" +// * FailedDependencyException // A dependency required to run the API is missing. // -// * ErrCodeAuthorizationException "AuthorizationException" +// * AuthorizationException // The AWS user account does not have permission to perform the action. Check // the IAM policy associated with this account. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to resource denied. // -// * ErrCodeRateLimitExceededException "RateLimitExceededException" +// * RateLimitExceededException // Too many requests have been submitted. Try again after a brief wait. // // See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/ListResourceInventory @@ -820,7 +911,7 @@ func (c *LicenseManager) ListTagsForResourceRequest(input *ListTagsForResourceIn // ListTagsForResource API operation for AWS License Manager. // -// Lists tags attached to a resource. +// Lists the tags for the specified license 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 @@ -829,21 +920,21 @@ func (c *LicenseManager) ListTagsForResourceRequest(input *ListTagsForResourceIn // See the AWS API reference guide for AWS License Manager's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more parameter values are not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The server experienced an internal error. Try again. // -// * ErrCodeAuthorizationException "AuthorizationException" +// * AuthorizationException // The AWS user account does not have permission to perform the action. Check // the IAM policy associated with this account. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to resource denied. // -// * ErrCodeRateLimitExceededException "RateLimitExceededException" +// * RateLimitExceededException // Too many requests have been submitted. Try again after a brief wait. // // See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/ListTagsForResource @@ -923,24 +1014,24 @@ func (c *LicenseManager) ListUsageForLicenseConfigurationRequest(input *ListUsag // See the AWS API reference guide for AWS License Manager's // API operation ListUsageForLicenseConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more parameter values are not valid. // -// * ErrCodeFilterLimitExceededException "FilterLimitExceededException" +// * FilterLimitExceededException // The request uses too many filters or too many filter values. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The server experienced an internal error. Try again. // -// * ErrCodeAuthorizationException "AuthorizationException" +// * AuthorizationException // The AWS user account does not have permission to perform the action. Check // the IAM policy associated with this account. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to resource denied. // -// * ErrCodeRateLimitExceededException "RateLimitExceededException" +// * RateLimitExceededException // Too many requests have been submitted. Try again after a brief wait. // // See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/ListUsageForLicenseConfiguration @@ -1010,7 +1101,7 @@ func (c *LicenseManager) TagResourceRequest(input *TagResourceInput) (req *reque // TagResource API operation for AWS License Manager. // -// Attach one of more tags to any resource. +// Adds the specified tags to the specified license 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 @@ -1019,21 +1110,21 @@ func (c *LicenseManager) TagResourceRequest(input *TagResourceInput) (req *reque // See the AWS API reference guide for AWS License Manager's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more parameter values are not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The server experienced an internal error. Try again. // -// * ErrCodeAuthorizationException "AuthorizationException" +// * AuthorizationException // The AWS user account does not have permission to perform the action. Check // the IAM policy associated with this account. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to resource denied. // -// * ErrCodeRateLimitExceededException "RateLimitExceededException" +// * RateLimitExceededException // Too many requests have been submitted. Try again after a brief wait. // // See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/TagResource @@ -1103,7 +1194,7 @@ func (c *LicenseManager) UntagResourceRequest(input *UntagResourceInput) (req *r // UntagResource API operation for AWS License Manager. // -// Remove tags from a resource. +// Removes the specified tags from the specified license 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 @@ -1112,21 +1203,21 @@ func (c *LicenseManager) UntagResourceRequest(input *UntagResourceInput) (req *r // See the AWS API reference guide for AWS License Manager's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more parameter values are not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The server experienced an internal error. Try again. // -// * ErrCodeAuthorizationException "AuthorizationException" +// * AuthorizationException // The AWS user account does not have permission to perform the action. Check // the IAM policy associated with this account. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to resource denied. // -// * ErrCodeRateLimitExceededException "RateLimitExceededException" +// * RateLimitExceededException // Too many requests have been submitted. Try again after a brief wait. // // See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/UntagResource @@ -1196,12 +1287,14 @@ func (c *LicenseManager) UpdateLicenseConfigurationRequest(input *UpdateLicenseC // UpdateLicenseConfiguration API operation for AWS License Manager. // -// Modifies the attributes of an existing license configuration object. A license -// configuration is an abstraction of a customer license agreement that can -// be consumed and enforced by License Manager. Components include specifications -// for the license type (Instances, cores, sockets, VCPUs), tenancy (shared -// or Dedicated Host), host affinity (how long a VM is associated with a host), -// the number of licenses purchased and used. +// Modifies the attributes of an existing license configuration. +// +// A license configuration is an abstraction of a customer license agreement +// that can be consumed and enforced by License Manager. Components include +// specifications for the license type (licensing by instance, socket, CPU, +// or vCPU), allowed tenancy (shared tenancy, Dedicated Instance, Dedicated +// Host, or all of these), host affinity (how long a VM must be associated with +// a host), and the number of licenses purchased and used. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1210,21 +1303,21 @@ func (c *LicenseManager) UpdateLicenseConfigurationRequest(input *UpdateLicenseC // See the AWS API reference guide for AWS License Manager's // API operation UpdateLicenseConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more parameter values are not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The server experienced an internal error. Try again. // -// * ErrCodeAuthorizationException "AuthorizationException" +// * AuthorizationException // The AWS user account does not have permission to perform the action. Check // the IAM policy associated with this account. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to resource denied. // -// * ErrCodeRateLimitExceededException "RateLimitExceededException" +// * RateLimitExceededException // Too many requests have been submitted. Try again after a brief wait. // // See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/UpdateLicenseConfiguration @@ -1294,11 +1387,13 @@ func (c *LicenseManager) UpdateLicenseSpecificationsForResourceRequest(input *Up // UpdateLicenseSpecificationsForResource API operation for AWS License Manager. // -// Adds or removes license configurations for a specified AWS resource. This -// operation currently supports updating the license specifications of AMIs, -// instances, and hosts. Launch templates and AWS CloudFormation templates are -// not managed from this operation as those resources send the license configurations -// directly to a resource creation operation, such as RunInstances. +// Adds or removes the specified license configurations for the specified AWS +// resource. +// +// You can update the license specifications of AMIs, instances, and hosts. +// You cannot update the license specifications for launch templates and AWS +// CloudFormation templates, as they send license configurations to the operation +// that creates the 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 @@ -1307,30 +1402,30 @@ func (c *LicenseManager) UpdateLicenseSpecificationsForResourceRequest(input *Up // See the AWS API reference guide for AWS License Manager's // API operation UpdateLicenseSpecificationsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more parameter values are not valid. // -// * ErrCodeInvalidResourceStateException "InvalidResourceStateException" +// * InvalidResourceStateException // License Manager cannot allocate a license to a resource because of its state. // // For example, you cannot allocate a license to an instance in the process // of shutting down. // -// * ErrCodeLicenseUsageException "LicenseUsageException" +// * LicenseUsageException // You do not have enough licenses available to support a new resource launch. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The server experienced an internal error. Try again. // -// * ErrCodeAuthorizationException "AuthorizationException" +// * AuthorizationException // The AWS user account does not have permission to perform the action. Check // the IAM policy associated with this account. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to resource denied. // -// * ErrCodeRateLimitExceededException "RateLimitExceededException" +// * RateLimitExceededException // Too many requests have been submitted. Try again after a brief wait. // // See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/UpdateLicenseSpecificationsForResource @@ -1400,7 +1495,7 @@ func (c *LicenseManager) UpdateServiceSettingsRequest(input *UpdateServiceSettin // UpdateServiceSettings API operation for AWS License Manager. // -// Updates License Manager service settings. +// Updates License Manager settings 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 @@ -1409,21 +1504,21 @@ func (c *LicenseManager) UpdateServiceSettingsRequest(input *UpdateServiceSettin // See the AWS API reference guide for AWS License Manager's // API operation UpdateServiceSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" +// Returned Error Types: +// * InvalidParameterValueException // One or more parameter values are not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The server experienced an internal error. Try again. // -// * ErrCodeAuthorizationException "AuthorizationException" +// * AuthorizationException // The AWS user account does not have permission to perform the action. Check // the IAM policy associated with this account. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Access to resource denied. // -// * ErrCodeRateLimitExceededException "RateLimitExceededException" +// * RateLimitExceededException // Too many requests have been submitted. Try again after a brief wait. // // See also, https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01/UpdateServiceSettings @@ -1448,14 +1543,151 @@ func (c *LicenseManager) UpdateServiceSettingsWithContext(ctx aws.Context, input return out, req.Send() } +// Access to resource denied. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The AWS user account does not have permission to perform the action. Check +// the IAM policy associated with this account. +type AuthorizationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AuthorizationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AuthorizationException) GoString() string { + return s.String() +} + +func newErrorAuthorizationException(v protocol.ResponseMetadata) error { + return &AuthorizationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AuthorizationException) Code() string { + return "AuthorizationException" +} + +// Message returns the exception's message. +func (s AuthorizationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AuthorizationException) OrigErr() error { + return nil +} + +func (s AuthorizationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AuthorizationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AuthorizationException) RequestID() string { + return s.respMetadata.RequestID +} + +// Describes automated discovery. +type AutomatedDiscoveryInformation struct { + _ struct{} `type:"structure"` + + // Time that automated discovery last ran. + LastRunTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s AutomatedDiscoveryInformation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutomatedDiscoveryInformation) GoString() string { + return s.String() +} + +// SetLastRunTime sets the LastRunTime field's value. +func (s *AutomatedDiscoveryInformation) SetLastRunTime(v time.Time) *AutomatedDiscoveryInformation { + s.LastRunTime = &v + return s +} + // Details about license consumption. type ConsumedLicenseSummary struct { _ struct{} `type:"structure"` - // Number of licenses consumed by a resource. + // Number of licenses consumed by the resource. ConsumedLicenses *int64 `type:"long"` - // Resource type of the resource consuming a license (instance, host, or AMI). + // Resource type of the resource consuming a license. ResourceType *string `type:"string" enum:"ResourceType"` } @@ -1484,22 +1716,33 @@ func (s *ConsumedLicenseSummary) SetResourceType(v string) *ConsumedLicenseSumma type CreateLicenseConfigurationInput struct { _ struct{} `type:"structure"` - // Human-friendly description of the license configuration. + // Description of the license configuration. Description *string `type:"string"` // Number of licenses managed by the license configuration. LicenseCount *int64 `type:"long"` - // Flag indicating whether hard or soft license enforcement is used. Exceeding - // a hard limit results in the blocked deployment of new instances. + // Indicates whether hard or soft license enforcement is used. Exceeding a hard + // limit blocks the launch of new instances. LicenseCountHardLimit *bool `type:"boolean"` - // Dimension to use to track the license inventory. + // Dimension used to track the license inventory. // // LicenseCountingType is a required field LicenseCountingType *string `type:"string" required:"true" enum:"LicenseCountingType"` - // Array of configured License Manager rules. + // License rules. The syntax is #name=value (for example, #allowedTenancy=EC2-DedicatedHost). + // Available rules vary by dimension. + // + // * Cores dimension: allowedTenancy | maximumCores | minimumCores + // + // * Instances dimension: allowedTenancy | maximumCores | minimumCores | + // maximumSockets | minimumSockets | maximumVcpus | minimumVcpus + // + // * Sockets dimension: allowedTenancy | maximumSockets | minimumSockets + // + // * vCPUs dimension: allowedTenancy | honorVcpuOptimization | maximumVcpus + // | minimumVcpus LicenseRules []*string `type:"list"` // Name of the license configuration. @@ -1507,10 +1750,10 @@ type CreateLicenseConfigurationInput struct { // Name is a required field Name *string `type:"string" required:"true"` - // The tags to apply to the resources during launch. You can only tag instances - // and volumes on launch. The specified tags are applied to all instances or - // volumes that are created during launch. To tag a resource after it has been - // created, see CreateTags . + // Product information. + ProductInformationList []*ProductInformation `type:"list"` + + // Tags to add to the license configuration. Tags []*Tag `type:"list"` } @@ -1533,6 +1776,16 @@ func (s *CreateLicenseConfigurationInput) Validate() error { if s.Name == nil { invalidParams.Add(request.NewErrParamRequired("Name")) } + if s.ProductInformationList != nil { + for i, v := range s.ProductInformationList { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ProductInformationList", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -1576,6 +1829,12 @@ func (s *CreateLicenseConfigurationInput) SetName(v string) *CreateLicenseConfig return s } +// SetProductInformationList sets the ProductInformationList field's value. +func (s *CreateLicenseConfigurationInput) SetProductInformationList(v []*ProductInformation) *CreateLicenseConfigurationInput { + s.ProductInformationList = v + return s +} + // SetTags sets the Tags field's value. func (s *CreateLicenseConfigurationInput) SetTags(v []*Tag) *CreateLicenseConfigurationInput { s.Tags = v @@ -1585,7 +1844,7 @@ func (s *CreateLicenseConfigurationInput) SetTags(v []*Tag) *CreateLicenseConfig type CreateLicenseConfigurationOutput struct { _ struct{} `type:"structure"` - // ARN of the license configuration object after its creation. + // Amazon Resource Name (ARN) of the license configuration. LicenseConfigurationArn *string `type:"string"` } @@ -1608,7 +1867,7 @@ func (s *CreateLicenseConfigurationOutput) SetLicenseConfigurationArn(v string) type DeleteLicenseConfigurationInput struct { _ struct{} `type:"structure"` - // Unique ID of the configuration object to delete. + // ID of the license configuration. // // LicenseConfigurationArn is a required field LicenseConfigurationArn *string `type:"string" required:"true"` @@ -1657,18 +1916,72 @@ func (s DeleteLicenseConfigurationOutput) GoString() string { return s.String() } -// A filter name and value pair that is used to return a more specific list -// of results from a describe operation. Filters can be used to match a set -// of resources by specific criteria, such as tags, attributes, or IDs. The -// filters supported by a Describe operation are documented with the Describe -// operation. +// A dependency required to run the API is missing. +type FailedDependencyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s FailedDependencyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FailedDependencyException) GoString() string { + return s.String() +} + +func newErrorFailedDependencyException(v protocol.ResponseMetadata) error { + return &FailedDependencyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FailedDependencyException) Code() string { + return "FailedDependencyException" +} + +// Message returns the exception's message. +func (s FailedDependencyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FailedDependencyException) OrigErr() error { + return nil +} + +func (s FailedDependencyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FailedDependencyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FailedDependencyException) RequestID() string { + return s.respMetadata.RequestID +} + +// A filter name and value pair that is used to return more specific results +// from a describe operation. Filters can be used to match a set of resources +// by specific criteria, such as tags, attributes, or IDs. type Filter struct { _ struct{} `type:"structure"` // Name of the filter. Filter names are case-sensitive. Name *string `type:"string"` - // One or more filter values. Filter values are case-sensitive. + // Filter values. Filter values are case-sensitive. Values []*string `type:"list"` } @@ -1694,10 +2007,66 @@ func (s *Filter) SetValues(v []*string) *Filter { return s } +// The request uses too many filters or too many filter values. +type FilterLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s FilterLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FilterLimitExceededException) GoString() string { + return s.String() +} + +func newErrorFilterLimitExceededException(v protocol.ResponseMetadata) error { + return &FilterLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FilterLimitExceededException) Code() string { + return "FilterLimitExceededException" +} + +// Message returns the exception's message. +func (s FilterLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FilterLimitExceededException) OrigErr() error { + return nil +} + +func (s FilterLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FilterLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FilterLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type GetLicenseConfigurationInput struct { _ struct{} `type:"structure"` - // ARN of the license configuration being requested. + // Amazon Resource Name (ARN) of the license configuration. // // LicenseConfigurationArn is a required field LicenseConfigurationArn *string `type:"string" required:"true"` @@ -1735,7 +2104,10 @@ func (s *GetLicenseConfigurationInput) SetLicenseConfigurationArn(v string) *Get type GetLicenseConfigurationOutput struct { _ struct{} `type:"structure"` - // List of summaries for consumed licenses used by various resources. + // Automated discovery information. + AutomatedDiscoveryInformation *AutomatedDiscoveryInformation `type:"structure"` + + // Summaries of the licenses consumed by resources. ConsumedLicenseSummaryList []*ConsumedLicenseSummary `type:"list"` // Number of licenses assigned to resources. @@ -1744,7 +2116,7 @@ type GetLicenseConfigurationOutput struct { // Description of the license configuration. Description *string `type:"string"` - // ARN of the license configuration requested. + // Amazon Resource Name (ARN) of the license configuration. LicenseConfigurationArn *string `type:"string"` // Unique ID for the license configuration. @@ -1756,26 +2128,28 @@ type GetLicenseConfigurationOutput struct { // Sets the number of available licenses as a hard limit. LicenseCountHardLimit *bool `type:"boolean"` - // Dimension on which the licenses are counted (for example, instances, cores, - // sockets, or VCPUs). + // Dimension on which the licenses are counted. LicenseCountingType *string `type:"string" enum:"LicenseCountingType"` - // List of flexible text strings designating license rules. + // License rules. LicenseRules []*string `type:"list"` - // List of summaries of managed resources. + // Summaries of the managed resources. ManagedResourceSummaryList []*ManagedResourceSummary `type:"list"` // Name of the license configuration. Name *string `type:"string"` - // Owner account ID for the license configuration. + // Account ID of the owner of the license configuration. OwnerAccountId *string `type:"string"` - // License configuration status (active, etc.). + // Product information. + ProductInformationList []*ProductInformation `type:"list"` + + // License configuration status. Status *string `type:"string"` - // List of tags attached to the license configuration. + // Tags for the license configuration. Tags []*Tag `type:"list"` } @@ -1789,6 +2163,12 @@ func (s GetLicenseConfigurationOutput) GoString() string { return s.String() } +// SetAutomatedDiscoveryInformation sets the AutomatedDiscoveryInformation field's value. +func (s *GetLicenseConfigurationOutput) SetAutomatedDiscoveryInformation(v *AutomatedDiscoveryInformation) *GetLicenseConfigurationOutput { + s.AutomatedDiscoveryInformation = v + return s +} + // SetConsumedLicenseSummaryList sets the ConsumedLicenseSummaryList field's value. func (s *GetLicenseConfigurationOutput) SetConsumedLicenseSummaryList(v []*ConsumedLicenseSummary) *GetLicenseConfigurationOutput { s.ConsumedLicenseSummaryList = v @@ -1861,6 +2241,12 @@ func (s *GetLicenseConfigurationOutput) SetOwnerAccountId(v string) *GetLicenseC return s } +// SetProductInformationList sets the ProductInformationList field's value. +func (s *GetLicenseConfigurationOutput) SetProductInformationList(v []*ProductInformation) *GetLicenseConfigurationOutput { + s.ProductInformationList = v + return s +} + // SetStatus sets the Status field's value. func (s *GetLicenseConfigurationOutput) SetStatus(v string) *GetLicenseConfigurationOutput { s.Status = &v @@ -1893,12 +2279,16 @@ type GetServiceSettingsOutput struct { // Indicates whether cross-account discovery has been enabled. EnableCrossAccountsDiscovery *bool `type:"boolean"` + // Amazon Resource Name (ARN) of the AWS resource share. The License Manager + // master account will provide member accounts with access to this share. + LicenseManagerResourceShareArn *string `type:"string"` + // Indicates whether AWS Organizations has been integrated with License Manager // for cross-account discovery. OrganizationConfiguration *OrganizationConfiguration `type:"structure"` // Regional S3 bucket path for storing reports, license trail event data, discovery - // data, etc. + // data, and so on. S3BucketArn *string `type:"string"` // SNS topic configured to receive notifications from License Manager. @@ -1921,6 +2311,12 @@ func (s *GetServiceSettingsOutput) SetEnableCrossAccountsDiscovery(v bool) *GetS return s } +// SetLicenseManagerResourceShareArn sets the LicenseManagerResourceShareArn field's value. +func (s *GetServiceSettingsOutput) SetLicenseManagerResourceShareArn(v string) *GetServiceSettingsOutput { + s.LicenseManagerResourceShareArn = &v + return s +} + // SetOrganizationConfiguration sets the OrganizationConfiguration field's value. func (s *GetServiceSettingsOutput) SetOrganizationConfiguration(v *OrganizationConfiguration) *GetServiceSettingsOutput { s.OrganizationConfiguration = v @@ -1939,45 +2335,160 @@ func (s *GetServiceSettingsOutput) SetSnsTopicArn(v string) *GetServiceSettingsO return s } -// An inventory filter object. -type InventoryFilter struct { - _ struct{} `type:"structure"` - - // The condition of the filter. - // - // Condition is a required field - Condition *string `type:"string" required:"true" enum:"InventoryFilterCondition"` - - // The name of the filter. - // - // Name is a required field - Name *string `type:"string" required:"true"` +// One or more parameter values are not valid. +type InvalidParameterValueException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Value of the filter. - Value *string `type:"string"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s InventoryFilter) String() string { +func (s InvalidParameterValueException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InventoryFilter) GoString() string { +func (s InvalidParameterValueException) 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.Condition == nil { - invalidParams.Add(request.NewErrParamRequired("Condition")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) +func newErrorInvalidParameterValueException(v protocol.ResponseMetadata) error { + return &InvalidParameterValueException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { +// Code returns the exception type name. +func (s InvalidParameterValueException) Code() string { + return "InvalidParameterValueException" +} + +// Message returns the exception's message. +func (s InvalidParameterValueException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterValueException) OrigErr() error { + return nil +} + +func (s InvalidParameterValueException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterValueException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterValueException) RequestID() string { + return s.respMetadata.RequestID +} + +// License Manager cannot allocate a license to a resource because of its state. +// +// For example, you cannot allocate a license to an instance in the process +// of shutting down. +type InvalidResourceStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidResourceStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidResourceStateException) GoString() string { + return s.String() +} + +func newErrorInvalidResourceStateException(v protocol.ResponseMetadata) error { + return &InvalidResourceStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidResourceStateException) Code() string { + return "InvalidResourceStateException" +} + +// Message returns the exception's message. +func (s InvalidResourceStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidResourceStateException) OrigErr() error { + return nil +} + +func (s InvalidResourceStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidResourceStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidResourceStateException) RequestID() string { + return s.respMetadata.RequestID +} + +// An inventory filter. +type InventoryFilter struct { + _ struct{} `type:"structure"` + + // Condition of the filter. + // + // Condition is a required field + Condition *string `type:"string" required:"true" enum:"InventoryFilterCondition"` + + // Name of the filter. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // Value of the filter. + Value *string `type:"string"` +} + +// 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.Condition == nil { + invalidParams.Add(request.NewErrParamRequired("Condition")) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + + if invalidParams.Len() > 0 { return invalidParams } return nil @@ -2004,13 +2515,16 @@ func (s *InventoryFilter) SetValue(v string) *InventoryFilter { // A license configuration is an abstraction of a customer license agreement // that can be consumed and enforced by License Manager. Components include // specifications for the license type (licensing by instance, socket, CPU, -// or VCPU), tenancy (shared tenancy, Amazon EC2 Dedicated Instance, Amazon -// EC2 Dedicated Host, or any of these), host affinity (how long a VM must be -// associated with a host), the number of licenses purchased and used. +// or vCPU), allowed tenancy (shared tenancy, Dedicated Instance, Dedicated +// Host, or all of these), host affinity (how long a VM must be associated with +// a host), and the number of licenses purchased and used. type LicenseConfiguration struct { _ struct{} `type:"structure"` - // List of summaries for licenses consumed by various resources. + // Automated discovery information. + AutomatedDiscoveryInformation *AutomatedDiscoveryInformation `type:"structure"` + + // Summaries for licenses consumed by various resources. ConsumedLicenseSummaryList []*ConsumedLicenseSummary `type:"list"` // Number of licenses consumed. @@ -2019,25 +2533,25 @@ type LicenseConfiguration struct { // Description of the license configuration. Description *string `type:"string"` - // ARN of the LicenseConfiguration object. + // Amazon Resource Name (ARN) of the license configuration. LicenseConfigurationArn *string `type:"string"` - // Unique ID of the LicenseConfiguration object. + // Unique ID of the license configuration. LicenseConfigurationId *string `type:"string"` // Number of licenses managed by the license configuration. LicenseCount *int64 `type:"long"` - // Sets the number of available licenses as a hard limit. + // Number of available licenses as a hard limit. LicenseCountHardLimit *bool `type:"boolean"` - // Dimension to use to track license inventory. + // Dimension to use to track the license inventory. LicenseCountingType *string `type:"string" enum:"LicenseCountingType"` - // Array of configured License Manager rules. + // License rules. LicenseRules []*string `type:"list"` - // List of summaries for managed resources. + // Summaries for managed resources. ManagedResourceSummaryList []*ManagedResourceSummary `type:"list"` // Name of the license configuration. @@ -2046,6 +2560,9 @@ type LicenseConfiguration struct { // Account ID of the license configuration's owner. OwnerAccountId *string `type:"string"` + // Product information. + ProductInformationList []*ProductInformation `type:"list"` + // Status of the license configuration. Status *string `type:"string"` } @@ -2060,6 +2577,12 @@ func (s LicenseConfiguration) GoString() string { return s.String() } +// SetAutomatedDiscoveryInformation sets the AutomatedDiscoveryInformation field's value. +func (s *LicenseConfiguration) SetAutomatedDiscoveryInformation(v *AutomatedDiscoveryInformation) *LicenseConfiguration { + s.AutomatedDiscoveryInformation = v + return s +} + // SetConsumedLicenseSummaryList sets the ConsumedLicenseSummaryList field's value. func (s *LicenseConfiguration) SetConsumedLicenseSummaryList(v []*ConsumedLicenseSummary) *LicenseConfiguration { s.ConsumedLicenseSummaryList = v @@ -2132,20 +2655,26 @@ func (s *LicenseConfiguration) SetOwnerAccountId(v string) *LicenseConfiguration return s } +// SetProductInformationList sets the ProductInformationList field's value. +func (s *LicenseConfiguration) SetProductInformationList(v []*ProductInformation) *LicenseConfiguration { + s.ProductInformationList = v + return s +} + // SetStatus sets the Status field's value. func (s *LicenseConfiguration) SetStatus(v string) *LicenseConfiguration { s.Status = &v return s } -// Describes a server resource that is associated with a license configuration. +// Describes an association with a license configuration. type LicenseConfigurationAssociation struct { _ struct{} `type:"structure"` // Time when the license configuration was associated with the resource. AssociationTime *time.Time `type:"timestamp"` - // ARN of the resource associated with the license configuration. + // Amazon Resource Name (ARN) of the resource. ResourceArn *string `type:"string"` // ID of the AWS account that owns the resource consuming licenses. @@ -2189,27 +2718,26 @@ func (s *LicenseConfigurationAssociation) SetResourceType(v string) *LicenseConf return s } -// Contains details of the usage of each resource from the license pool. +// Details about the usage of a resource associated with a license configuration. type LicenseConfigurationUsage struct { _ struct{} `type:"structure"` - // Time when the license configuration was initially associated with a resource. + // Time when the license configuration was initially associated with the resource. AssociationTime *time.Time `type:"timestamp"` - // Number of licenses consumed out of the total provisioned in the license configuration. + // Number of licenses consumed by the resource. ConsumedLicenses *int64 `type:"long"` - // ARN of the resource associated with a license configuration. + // Amazon Resource Name (ARN) of the resource. ResourceArn *string `type:"string"` - // ID of the account that owns a resource that is associated with the license - // configuration. + // ID of the account that owns the resource. ResourceOwnerId *string `type:"string"` - // Status of a resource associated with the license configuration. + // Status of the resource. ResourceStatus *string `type:"string"` - // Type of resource associated with athe license configuration. + // Type of resource. ResourceType *string `type:"string" enum:"ResourceType"` } @@ -2259,11 +2787,98 @@ func (s *LicenseConfigurationUsage) SetResourceType(v string) *LicenseConfigurat return s } -// Object used for associating a license configuration with a resource. +// Describes the failure of a license operation. +type LicenseOperationFailure struct { + _ struct{} `type:"structure"` + + // Error message. + ErrorMessage *string `type:"string"` + + // Failure time. + FailureTime *time.Time `type:"timestamp"` + + // Reserved. + MetadataList []*Metadata `type:"list"` + + // Name of the operation. + OperationName *string `type:"string"` + + // The requester is "License Manager Automated Discovery". + OperationRequestedBy *string `type:"string"` + + // Amazon Resource Name (ARN) of the resource. + ResourceArn *string `type:"string"` + + // ID of the AWS account that owns the resource. + ResourceOwnerId *string `type:"string"` + + // Resource type. + ResourceType *string `type:"string" enum:"ResourceType"` +} + +// String returns the string representation +func (s LicenseOperationFailure) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LicenseOperationFailure) GoString() string { + return s.String() +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *LicenseOperationFailure) SetErrorMessage(v string) *LicenseOperationFailure { + s.ErrorMessage = &v + return s +} + +// SetFailureTime sets the FailureTime field's value. +func (s *LicenseOperationFailure) SetFailureTime(v time.Time) *LicenseOperationFailure { + s.FailureTime = &v + return s +} + +// SetMetadataList sets the MetadataList field's value. +func (s *LicenseOperationFailure) SetMetadataList(v []*Metadata) *LicenseOperationFailure { + s.MetadataList = v + return s +} + +// SetOperationName sets the OperationName field's value. +func (s *LicenseOperationFailure) SetOperationName(v string) *LicenseOperationFailure { + s.OperationName = &v + return s +} + +// SetOperationRequestedBy sets the OperationRequestedBy field's value. +func (s *LicenseOperationFailure) SetOperationRequestedBy(v string) *LicenseOperationFailure { + s.OperationRequestedBy = &v + return s +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *LicenseOperationFailure) SetResourceArn(v string) *LicenseOperationFailure { + s.ResourceArn = &v + return s +} + +// SetResourceOwnerId sets the ResourceOwnerId field's value. +func (s *LicenseOperationFailure) SetResourceOwnerId(v string) *LicenseOperationFailure { + s.ResourceOwnerId = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *LicenseOperationFailure) SetResourceType(v string) *LicenseOperationFailure { + s.ResourceType = &v + return s +} + +// Details for associating a license configuration with a resource. type LicenseSpecification struct { _ struct{} `type:"structure"` - // ARN of the LicenseConfiguration object. + // Amazon Resource Name (ARN) of the license configuration. // // LicenseConfigurationArn is a required field LicenseConfigurationArn *string `type:"string" required:"true"` @@ -2298,16 +2913,71 @@ func (s *LicenseSpecification) SetLicenseConfigurationArn(v string) *LicenseSpec return s } +// You do not have enough licenses available to support a new resource launch. +type LicenseUsageException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s LicenseUsageException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LicenseUsageException) GoString() string { + return s.String() +} + +func newErrorLicenseUsageException(v protocol.ResponseMetadata) error { + return &LicenseUsageException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LicenseUsageException) Code() string { + return "LicenseUsageException" +} + +// Message returns the exception's message. +func (s LicenseUsageException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LicenseUsageException) OrigErr() error { + return nil +} + +func (s LicenseUsageException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LicenseUsageException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LicenseUsageException) RequestID() string { + return s.respMetadata.RequestID +} + type ListAssociationsForLicenseConfigurationInput struct { _ struct{} `type:"structure"` - // ARN of a LicenseConfiguration object. + // Amazon Resource Name (ARN) of a license configuration. // // LicenseConfigurationArn is a required field LicenseConfigurationArn *string `type:"string" required:"true"` - // Maximum number of results to return in a single call. To retrieve the remaining - // results, make another call with the returned NextToken value. + // Maximum number of results to return in a single call. MaxResults *int64 `type:"integer"` // Token for the next set of results. @@ -2358,9 +3028,7 @@ func (s *ListAssociationsForLicenseConfigurationInput) SetNextToken(v string) *L type ListAssociationsForLicenseConfigurationOutput struct { _ struct{} `type:"structure"` - // Lists association objects for the license configuration, each containing - // the association time, number of consumed licenses, resource ARN, resource - // ID, account ID that owns the resource, resource size, and resource type. + // Information about the associations for the license configuration. LicenseConfigurationAssociations []*LicenseConfigurationAssociation `type:"list"` // Token for the next set of results. @@ -2389,17 +3057,114 @@ func (s *ListAssociationsForLicenseConfigurationOutput) SetNextToken(v string) * return s } +type ListFailuresForLicenseConfigurationOperationsInput struct { + _ struct{} `type:"structure"` + + // Amazon Resource Name of the license configuration. + // + // LicenseConfigurationArn is a required field + LicenseConfigurationArn *string `type:"string" required:"true"` + + // Maximum number of results to return in a single call. + MaxResults *int64 `type:"integer"` + + // Token for the next set of results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListFailuresForLicenseConfigurationOperationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListFailuresForLicenseConfigurationOperationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListFailuresForLicenseConfigurationOperationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListFailuresForLicenseConfigurationOperationsInput"} + if s.LicenseConfigurationArn == nil { + invalidParams.Add(request.NewErrParamRequired("LicenseConfigurationArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLicenseConfigurationArn sets the LicenseConfigurationArn field's value. +func (s *ListFailuresForLicenseConfigurationOperationsInput) SetLicenseConfigurationArn(v string) *ListFailuresForLicenseConfigurationOperationsInput { + s.LicenseConfigurationArn = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListFailuresForLicenseConfigurationOperationsInput) SetMaxResults(v int64) *ListFailuresForLicenseConfigurationOperationsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListFailuresForLicenseConfigurationOperationsInput) SetNextToken(v string) *ListFailuresForLicenseConfigurationOperationsInput { + s.NextToken = &v + return s +} + +type ListFailuresForLicenseConfigurationOperationsOutput struct { + _ struct{} `type:"structure"` + + // License configuration operations that failed. + LicenseOperationFailureList []*LicenseOperationFailure `type:"list"` + + // Token for the next set of results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ListFailuresForLicenseConfigurationOperationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListFailuresForLicenseConfigurationOperationsOutput) GoString() string { + return s.String() +} + +// SetLicenseOperationFailureList sets the LicenseOperationFailureList field's value. +func (s *ListFailuresForLicenseConfigurationOperationsOutput) SetLicenseOperationFailureList(v []*LicenseOperationFailure) *ListFailuresForLicenseConfigurationOperationsOutput { + s.LicenseOperationFailureList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListFailuresForLicenseConfigurationOperationsOutput) SetNextToken(v string) *ListFailuresForLicenseConfigurationOperationsOutput { + s.NextToken = &v + return s +} + type ListLicenseConfigurationsInput struct { _ struct{} `type:"structure"` - // One or more filters. + // Filters to scope the results. The following filters and logical operators + // are supported: + // + // * licenseCountingType - The dimension on which licenses are counted (vCPU). + // Logical operators are EQUALS | NOT_EQUALS. + // + // * enforceLicenseCount - A Boolean value that indicates whether hard license + // enforcement is used. Logical operators are EQUALS | NOT_EQUALS. + // + // * usagelimitExceeded - A Boolean value that indicates whether the available + // licenses have been exceeded. Logical operators are EQUALS | NOT_EQUALS. Filters []*Filter `type:"list"` - // An array of ARNs for the calling account’s license configurations. + // Amazon Resource Names (ARN) of the license configurations. LicenseConfigurationArns []*string `type:"list"` - // Maximum number of results to return in a single call. To retrieve the remaining - // results, make another call with the returned NextToken value. + // Maximum number of results to return in a single call. MaxResults *int64 `type:"integer"` // Token for the next set of results. @@ -2443,7 +3208,7 @@ func (s *ListLicenseConfigurationsInput) SetNextToken(v string) *ListLicenseConf type ListLicenseConfigurationsOutput struct { _ struct{} `type:"structure"` - // Array of license configuration objects. + // Information about the license configurations. LicenseConfigurations []*LicenseConfiguration `type:"list"` // Token for the next set of results. @@ -2475,14 +3240,13 @@ func (s *ListLicenseConfigurationsOutput) SetNextToken(v string) *ListLicenseCon type ListLicenseSpecificationsForResourceInput struct { _ struct{} `type:"structure"` - // Maximum number of results to return in a single call. To retrieve the remaining - // results, make another call with the returned NextToken value. + // Maximum number of results to return in a single call. MaxResults *int64 `type:"integer"` // Token for the next set of results. NextToken *string `type:"string"` - // ARN of an AMI or Amazon EC2 instance that has an associated license configuration. + // Amazon Resource Name (ARN) of a resource that has an associated license configuration. // // ResourceArn is a required field ResourceArn *string `type:"string" required:"true"` @@ -2564,11 +3328,27 @@ func (s *ListLicenseSpecificationsForResourceOutput) SetNextToken(v string) *Lis type ListResourceInventoryInput struct { _ struct{} `type:"structure"` - // One or more filters. + // Filters to scope the results. The following filters and logical operators + // are supported: + // + // * account_id - The ID of the AWS account that owns the resource. Logical + // operators are EQUALS | NOT_EQUALS. + // + // * application_name - The name of the application. Logical operators are + // EQUALS | BEGINS_WITH. + // + // * license_included - The type of license included. Logical operators are + // EQUALS | NOT_EQUALS. Possible values are sql-server-enterprise | sql-server-standard + // | sql-server-web | windows-server-datacenter. + // + // * platform - The platform of the resource. Logical operators are EQUALS + // | BEGINS_WITH. + // + // * resource_id - The ID of the resource. Logical operators are EQUALS | + // NOT_EQUALS. Filters []*InventoryFilter `type:"list"` - // Maximum number of results to return in a single call. To retrieve the remaining - // results, make another call with the returned NextToken value. + // Maximum number of results to return in a single call. MaxResults *int64 `type:"integer"` // Token for the next set of results. @@ -2629,7 +3409,7 @@ type ListResourceInventoryOutput struct { // Token for the next set of results. NextToken *string `type:"string"` - // The detailed list of resources. + // Information about the resources. ResourceInventoryList []*ResourceInventory `type:"list"` } @@ -2658,7 +3438,7 @@ func (s *ListResourceInventoryOutput) SetResourceInventoryList(v []*ResourceInve type ListTagsForResourceInput struct { _ struct{} `type:"structure"` - // ARN for the resource. + // Amazon Resource Name (ARN) of the license configuration. // // ResourceArn is a required field ResourceArn *string `type:"string" required:"true"` @@ -2696,7 +3476,7 @@ func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResource type ListTagsForResourceOutput struct { _ struct{} `type:"structure"` - // List of tags attached to the resource. + // Information about the tags. Tags []*Tag `type:"list"` } @@ -2719,16 +3499,25 @@ func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput type ListUsageForLicenseConfigurationInput struct { _ struct{} `type:"structure"` - // List of filters to apply. + // Filters to scope the results. The following filters and logical operators + // are supported: + // + // * resourceArn - The ARN of the license configuration resource. Logical + // operators are EQUALS | NOT_EQUALS. + // + // * resourceType - The resource type (EC2_INSTANCE | EC2_HOST | EC2_AMI + // | SYSTEMS_MANAGER_MANAGED_INSTANCE). Logical operators are EQUALS | NOT_EQUALS. + // + // * resourceAccount - The ID of the account that owns the resource. Logical + // operators are EQUALS | NOT_EQUALS. Filters []*Filter `type:"list"` - // ARN of the targeted LicenseConfiguration object. + // Amazon Resource Name (ARN) of the license configuration. // // LicenseConfigurationArn is a required field LicenseConfigurationArn *string `type:"string" required:"true"` - // Maximum number of results to return in a single call. To retrieve the remaining - // results, make another call with the returned NextToken value. + // Maximum number of results to return in a single call. MaxResults *int64 `type:"integer"` // Token for the next set of results. @@ -2785,7 +3574,7 @@ func (s *ListUsageForLicenseConfigurationInput) SetNextToken(v string) *ListUsag type ListUsageForLicenseConfigurationOutput struct { _ struct{} `type:"structure"` - // An array of LicenseConfigurationUsage objects. + // Information about the license configurations. LicenseConfigurationUsageList []*LicenseConfigurationUsage `type:"list"` // Token for the next set of results. @@ -2814,14 +3603,14 @@ func (s *ListUsageForLicenseConfigurationOutput) SetNextToken(v string) *ListUsa return s } -// Summary for a resource. +// Summary information about a managed resource. type ManagedResourceSummary struct { _ struct{} `type:"structure"` // Number of resources associated with licenses. AssociationCount *int64 `type:"long"` - // Type of resource associated with a license (instance, host, or AMI). + // Type of resource associated with a license. ResourceType *string `type:"string" enum:"ResourceType"` } @@ -2847,11 +3636,44 @@ func (s *ManagedResourceSummary) SetResourceType(v string) *ManagedResourceSumma return s } -// Object containing configuration information for AWS Organizations. +// Reserved. +type Metadata struct { + _ struct{} `type:"structure"` + + // Reserved. + Name *string `type:"string"` + + // Reserved. + Value *string `type:"string"` +} + +// String returns the string representation +func (s Metadata) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Metadata) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *Metadata) SetName(v string) *Metadata { + s.Name = &v + return s +} + +// SetValue sets the Value field's value. +func (s *Metadata) SetValue(v string) *Metadata { + s.Value = &v + return s +} + +// Configuration information for AWS Organizations. type OrganizationConfiguration struct { _ struct{} `type:"structure"` - // Flag to activate AWS Organization integration. + // Enables AWS Organization integration. // // EnableIntegration is a required field EnableIntegration *bool `type:"boolean" required:"true"` @@ -2886,26 +3708,230 @@ func (s *OrganizationConfiguration) SetEnableIntegration(v bool) *OrganizationCo return s } -// A set of attributes that describe a resource. +// Describes product information for a license configuration. +type ProductInformation struct { + _ struct{} `type:"structure"` + + // Product information filters. The following filters and logical operators + // are supported: + // + // * Application Name - The name of the application. Logical operator is + // EQUALS. + // + // * Application Publisher - The publisher of the application. Logical operator + // is EQUALS. + // + // * Application Version - The version of the application. Logical operator + // is EQUALS. + // + // * Platform Name - The name of the platform. Logical operator is EQUALS. + // + // * Platform Type - The platform type. Logical operator is EQUALS. + // + // * License Included - The type of license included. Logical operators are + // EQUALS and NOT_EQUALS. Possible values are sql-server-enterprise | sql-server-standard + // | sql-server-web | windows-server-datacenter. + // + // ProductInformationFilterList is a required field + ProductInformationFilterList []*ProductInformationFilter `type:"list" required:"true"` + + // Resource type. The value is SSM_MANAGED. + // + // ResourceType is a required field + ResourceType *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ProductInformation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ProductInformation) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ProductInformation) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProductInformation"} + if s.ProductInformationFilterList == nil { + invalidParams.Add(request.NewErrParamRequired("ProductInformationFilterList")) + } + if s.ResourceType == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceType")) + } + if s.ProductInformationFilterList != nil { + for i, v := range s.ProductInformationFilterList { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ProductInformationFilterList", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetProductInformationFilterList sets the ProductInformationFilterList field's value. +func (s *ProductInformation) SetProductInformationFilterList(v []*ProductInformationFilter) *ProductInformation { + s.ProductInformationFilterList = v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ProductInformation) SetResourceType(v string) *ProductInformation { + s.ResourceType = &v + return s +} + +// Describes product information filters. +type ProductInformationFilter struct { + _ struct{} `type:"structure"` + + // Logical operator. + // + // ProductInformationFilterComparator is a required field + ProductInformationFilterComparator *string `type:"string" required:"true"` + + // Filter name. + // + // ProductInformationFilterName is a required field + ProductInformationFilterName *string `type:"string" required:"true"` + + // Filter value. + // + // ProductInformationFilterValue is a required field + ProductInformationFilterValue []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s ProductInformationFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ProductInformationFilter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ProductInformationFilter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProductInformationFilter"} + if s.ProductInformationFilterComparator == nil { + invalidParams.Add(request.NewErrParamRequired("ProductInformationFilterComparator")) + } + if s.ProductInformationFilterName == nil { + invalidParams.Add(request.NewErrParamRequired("ProductInformationFilterName")) + } + if s.ProductInformationFilterValue == nil { + invalidParams.Add(request.NewErrParamRequired("ProductInformationFilterValue")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetProductInformationFilterComparator sets the ProductInformationFilterComparator field's value. +func (s *ProductInformationFilter) SetProductInformationFilterComparator(v string) *ProductInformationFilter { + s.ProductInformationFilterComparator = &v + return s +} + +// SetProductInformationFilterName sets the ProductInformationFilterName field's value. +func (s *ProductInformationFilter) SetProductInformationFilterName(v string) *ProductInformationFilter { + s.ProductInformationFilterName = &v + return s +} + +// SetProductInformationFilterValue sets the ProductInformationFilterValue field's value. +func (s *ProductInformationFilter) SetProductInformationFilterValue(v []*string) *ProductInformationFilter { + s.ProductInformationFilterValue = v + return s +} + +// Too many requests have been submitted. Try again after a brief wait. +type RateLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s RateLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RateLimitExceededException) GoString() string { + return s.String() +} + +func newErrorRateLimitExceededException(v protocol.ResponseMetadata) error { + return &RateLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RateLimitExceededException) Code() string { + return "RateLimitExceededException" +} + +// Message returns the exception's message. +func (s RateLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RateLimitExceededException) OrigErr() error { + return nil +} + +func (s RateLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RateLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RateLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// Details about a resource. type ResourceInventory struct { _ struct{} `type:"structure"` - // The platform of the resource. + // Platform of the resource. Platform *string `type:"string"` // Platform version of the resource in the inventory. PlatformVersion *string `type:"string"` - // The ARN of the resource. + // Amazon Resource Name (ARN) of the resource. ResourceArn *string `type:"string"` - // Unique ID of the resource. + // ID of the resource. ResourceId *string `type:"string"` - // Unique ID of the account that owns the resource. + // ID of the account that owns the resource. ResourceOwningAccountId *string `type:"string"` - // The type of resource. + // Type of resource. ResourceType *string `type:"string" enum:"ResourceType"` } @@ -2955,14 +3981,126 @@ func (s *ResourceInventory) SetResourceType(v string) *ResourceInventory { return s } -// Tag for a resource in a key-value format. +// Your resource limits have been exceeded. +type ResourceLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceLimitExceededException) GoString() string { + return s.String() +} + +func newErrorResourceLimitExceededException(v protocol.ResponseMetadata) error { + return &ResourceLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceLimitExceededException) Code() string { + return "ResourceLimitExceededException" +} + +// Message returns the exception's message. +func (s ResourceLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceLimitExceededException) OrigErr() error { + return nil +} + +func (s ResourceLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The server experienced an internal error. Try again. +type ServerInternalException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ServerInternalException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServerInternalException) GoString() string { + return s.String() +} + +func newErrorServerInternalException(v protocol.ResponseMetadata) error { + return &ServerInternalException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServerInternalException) Code() string { + return "ServerInternalException" +} + +// Message returns the exception's message. +func (s ServerInternalException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServerInternalException) OrigErr() error { + return nil +} + +func (s ServerInternalException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServerInternalException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServerInternalException) RequestID() string { + return s.respMetadata.RequestID +} + +// Details about a tag for a license configuration. type Tag struct { _ struct{} `type:"structure"` - // Key for the resource tag. + // Tag key. Key *string `type:"string"` - // Value for the resource tag. + // Tag value. Value *string `type:"string"` } @@ -2991,12 +4129,12 @@ func (s *Tag) SetValue(v string) *Tag { type TagResourceInput struct { _ struct{} `type:"structure"` - // Resource of the ARN to be tagged. + // Amazon Resource Name (ARN) of the license configuration. // // ResourceArn is a required field ResourceArn *string `type:"string" required:"true"` - // Names of the tags to attach to the resource. + // One or more tags. // // Tags is a required field Tags []*Tag `type:"list" required:"true"` @@ -3057,12 +4195,12 @@ func (s TagResourceOutput) GoString() string { type UntagResourceInput struct { _ struct{} `type:"structure"` - // ARN of the resource. + // Amazon Resource Name (ARN) of the license configuration. // // ResourceArn is a required field ResourceArn *string `type:"string" required:"true"` - // List keys identifying tags to remove. + // Keys identifying the tags to remove. // // TagKeys is a required field TagKeys []*string `type:"list" required:"true"` @@ -3123,28 +4261,31 @@ func (s UntagResourceOutput) GoString() string { type UpdateLicenseConfigurationInput struct { _ struct{} `type:"structure"` - // New human-friendly description of the license configuration. + // New description of the license configuration. Description *string `type:"string"` - // ARN for a license configuration. + // Amazon Resource Name (ARN) of the license configuration. // // LicenseConfigurationArn is a required field LicenseConfigurationArn *string `type:"string" required:"true"` - // New status of the license configuration (ACTIVE or INACTIVE). + // New status of the license configuration. LicenseConfigurationStatus *string `type:"string" enum:"LicenseConfigurationStatus"` // New number of licenses managed by the license configuration. LicenseCount *int64 `type:"long"` - // Sets the number of available licenses as a hard limit. + // New hard limit of the number of available licenses. LicenseCountHardLimit *bool `type:"boolean"` - // List of flexible text strings designating license rules. + // New license rules. LicenseRules []*string `type:"list"` // New name of the license configuration. Name *string `type:"string"` + + // New product information. + ProductInformationList []*ProductInformation `type:"list"` } // String returns the string representation @@ -3163,6 +4304,16 @@ func (s *UpdateLicenseConfigurationInput) Validate() error { if s.LicenseConfigurationArn == nil { invalidParams.Add(request.NewErrParamRequired("LicenseConfigurationArn")) } + if s.ProductInformationList != nil { + for i, v := range s.ProductInformationList { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ProductInformationList", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -3212,6 +4363,12 @@ func (s *UpdateLicenseConfigurationInput) SetName(v string) *UpdateLicenseConfig return s } +// SetProductInformationList sets the ProductInformationList field's value. +func (s *UpdateLicenseConfigurationInput) SetProductInformationList(v []*ProductInformation) *UpdateLicenseConfigurationInput { + s.ProductInformationList = v + return s +} + type UpdateLicenseConfigurationOutput struct { _ struct{} `type:"structure"` } @@ -3229,13 +4386,13 @@ func (s UpdateLicenseConfigurationOutput) GoString() string { type UpdateLicenseSpecificationsForResourceInput struct { _ struct{} `type:"structure"` - // License configuration ARNs to be added to a resource. + // ARNs of the license configurations to add. AddLicenseSpecifications []*LicenseSpecification `type:"list"` - // License configuration ARNs to be removed from a resource. + // ARNs of the license configurations to remove. RemoveLicenseSpecifications []*LicenseSpecification `type:"list"` - // ARN for an AWS server resource. + // Amazon Resource Name (ARN) of the AWS resource. // // ResourceArn is a required field ResourceArn *string `type:"string" required:"true"` @@ -3322,13 +4479,15 @@ type UpdateServiceSettingsInput struct { // Activates cross-account discovery. EnableCrossAccountsDiscovery *bool `type:"boolean"` - // Integrates AWS Organizations with License Manager for cross-account discovery. + // Enables integration with AWS Organizations for cross-account discovery. OrganizationConfiguration *OrganizationConfiguration `type:"structure"` - // ARN of the Amazon S3 bucket where License Manager information is stored. + // Amazon Resource Name (ARN) of the Amazon S3 bucket where the License Manager + // information is stored. S3BucketArn *string `type:"string"` - // ARN of the Amazon SNS topic used for License Manager alerts. + // Amazon Resource Name (ARN) of the Amazon SNS topic used for License Manager + // alerts. SnsTopicArn *string `type:"string"` } @@ -3440,4 +4599,10 @@ const ( // ResourceTypeEc2Ami is a ResourceType enum value ResourceTypeEc2Ami = "EC2_AMI" + + // ResourceTypeRds is a ResourceType enum value + ResourceTypeRds = "RDS" + + // ResourceTypeSystemsManagerManagedInstance is a ResourceType enum value + ResourceTypeSystemsManagerManagedInstance = "SYSTEMS_MANAGER_MANAGED_INSTANCE" ) diff --git a/vendor/github.com/aws/aws-sdk-go/service/licensemanager/doc.go b/vendor/github.com/aws/aws-sdk-go/service/licensemanager/doc.go index 14e09f5e4fb..f03d93418b6 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/licensemanager/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/licensemanager/doc.go @@ -3,14 +3,8 @@ // Package licensemanager provides the client and types for making API // requests to AWS License Manager. // -// This is the AWS License Manager API Reference. It provides descriptions, -// syntax, and usage examples for each of the actions and data types for License -// Manager. The topic for each action shows the Query API request parameters -// and the XML response. You can also view the XML request elements in the WSDL. -// -// Alternatively, you can use one of the AWS SDKs to access an API that's tailored -// to the programming language or platform that you're using. For more information, -// see AWS SDKs (http://aws.amazon.com/tools/#SDKs). +// AWS License Manager makes it easier to manage licenses from software vendors +// across multiple AWS accounts and on-premises servers. // // See https://docs.aws.amazon.com/goto/WebAPI/license-manager-2018-08-01 for more information on this service. // diff --git a/vendor/github.com/aws/aws-sdk-go/service/licensemanager/errors.go b/vendor/github.com/aws/aws-sdk-go/service/licensemanager/errors.go index 7a6816be97e..31ef544090d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/licensemanager/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/licensemanager/errors.go @@ -2,6 +2,10 @@ package licensemanager +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccessDeniedException for service response error code @@ -68,3 +72,16 @@ const ( // The server experienced an internal error. Try again. ErrCodeServerInternalException = "ServerInternalException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "AuthorizationException": newErrorAuthorizationException, + "FailedDependencyException": newErrorFailedDependencyException, + "FilterLimitExceededException": newErrorFilterLimitExceededException, + "InvalidParameterValueException": newErrorInvalidParameterValueException, + "InvalidResourceStateException": newErrorInvalidResourceStateException, + "LicenseUsageException": newErrorLicenseUsageException, + "RateLimitExceededException": newErrorRateLimitExceededException, + "ResourceLimitExceededException": newErrorResourceLimitExceededException, + "ServerInternalException": newErrorServerInternalException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/licensemanager/service.go b/vendor/github.com/aws/aws-sdk-go/service/licensemanager/service.go index 5a8fc996539..7a4b8be0345 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/licensemanager/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/licensemanager/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "License Manager" // Name of service. EndpointsID = "license-manager" // ID to lookup a service endpoint with. - ServiceID = "License Manager" // ServiceID is a unique identifer of a specific service. + ServiceID = "License Manager" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the LicenseManager client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a LicenseManager client from just a session. // svc := licensemanager.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := licensemanager.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *LicenseManager { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *LicenseManager { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *LicenseManager { svc := &LicenseManager{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-08-01", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 84cac53bb6d..6d61ff5085d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lightsail/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lightsail/api.go @@ -9,6 +9,7 @@ import ( "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" ) const opAllocateStaticIp = "AllocateStaticIp" @@ -64,11 +65,11 @@ func (c *Lightsail) AllocateStaticIpRequest(input *AllocateStaticIpInput) (req * // See the AWS API reference guide for Amazon Lightsail's // API operation AllocateStaticIp for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -76,21 +77,21 @@ func (c *Lightsail) AllocateStaticIpRequest(input *AllocateStaticIpInput) (req * // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AllocateStaticIp @@ -173,11 +174,11 @@ func (c *Lightsail) AttachDiskRequest(input *AttachDiskInput) (req *request.Requ // See the AWS API reference guide for Amazon Lightsail's // API operation AttachDisk for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -185,21 +186,21 @@ func (c *Lightsail) AttachDiskRequest(input *AttachDiskInput) (req *request.Requ // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachDisk @@ -284,11 +285,11 @@ func (c *Lightsail) AttachInstancesToLoadBalancerRequest(input *AttachInstancesT // See the AWS API reference guide for Amazon Lightsail's // API operation AttachInstancesToLoadBalancer for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -296,21 +297,21 @@ func (c *Lightsail) AttachInstancesToLoadBalancerRequest(input *AttachInstancesT // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachInstancesToLoadBalancer @@ -384,11 +385,11 @@ func (c *Lightsail) AttachLoadBalancerTlsCertificateRequest(input *AttachLoadBal // // Once you create and validate your certificate, you can attach it to your // load balancer. You can also use this API to rotate the certificates on your -// account. Use the attach load balancer tls certificate operation with the -// non-attached certificate, and it will replace the existing one and become -// the attached certificate. +// account. Use the AttachLoadBalancerTlsCertificate action with the non-attached +// certificate, and it will replace the existing one and become the attached +// certificate. // -// The attach load balancer tls certificate operation supports tag-based access +// The AttachLoadBalancerTlsCertificate operation supports tag-based access // control via resource tags applied to the resource identified by load balancer // name. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags). // @@ -399,11 +400,11 @@ func (c *Lightsail) AttachLoadBalancerTlsCertificateRequest(input *AttachLoadBal // See the AWS API reference guide for Amazon Lightsail's // API operation AttachLoadBalancerTlsCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -411,21 +412,21 @@ func (c *Lightsail) AttachLoadBalancerTlsCertificateRequest(input *AttachLoadBal // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachLoadBalancerTlsCertificate @@ -503,11 +504,11 @@ func (c *Lightsail) AttachStaticIpRequest(input *AttachStaticIpInput) (req *requ // See the AWS API reference guide for Amazon Lightsail's // API operation AttachStaticIp for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -515,21 +516,21 @@ func (c *Lightsail) AttachStaticIpRequest(input *AttachStaticIpInput) (req *requ // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/AttachStaticIp @@ -611,11 +612,11 @@ func (c *Lightsail) CloseInstancePublicPortsRequest(input *CloseInstancePublicPo // See the AWS API reference guide for Amazon Lightsail's // API operation CloseInstancePublicPorts for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -623,21 +624,21 @@ func (c *Lightsail) CloseInstancePublicPortsRequest(input *CloseInstancePublicPo // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CloseInstancePublicPorts @@ -706,10 +707,10 @@ func (c *Lightsail) CopySnapshotRequest(input *CopySnapshotInput) (req *request. // CopySnapshot API operation for Amazon Lightsail. // -// Copies a manual instance or disk snapshot as another manual snapshot, or -// copies an automatic instance or disk snapshot as a manual snapshot. This -// operation can also be used to copy a manual or automatic snapshot of an instance -// or a disk from one AWS Region to another in Amazon Lightsail. +// Copies a manual snapshot of an instance or disk as another manual snapshot, +// or copies an automatic snapshot of an instance or disk as a manual snapshot. +// This operation can also be used to copy a manual or automatic snapshot of +// an instance or a disk from one AWS Region to another in Amazon Lightsail. // // When copying a manual snapshot, be sure to define the source region, source // snapshot name, and target snapshot name parameters. @@ -718,8 +719,6 @@ func (c *Lightsail) CopySnapshotRequest(input *CopySnapshotInput) (req *request. // source resource name, target snapshot name, and either the restore date or // the use latest restorable auto snapshot parameters. // -// Database snapshots cannot be copied at this 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. @@ -727,11 +726,11 @@ func (c *Lightsail) CopySnapshotRequest(input *CopySnapshotInput) (req *request. // See the AWS API reference guide for Amazon Lightsail's // API operation CopySnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -739,21 +738,21 @@ func (c *Lightsail) CopySnapshotRequest(input *CopySnapshotInput) (req *request. // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CopySnapshot @@ -839,11 +838,11 @@ func (c *Lightsail) CreateCloudFormationStackRequest(input *CreateCloudFormation // See the AWS API reference guide for Amazon Lightsail's // API operation CreateCloudFormationStack for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -851,21 +850,21 @@ func (c *Lightsail) CreateCloudFormationStackRequest(input *CreateCloudFormation // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateCloudFormationStack @@ -890,6 +889,112 @@ func (c *Lightsail) CreateCloudFormationStackWithContext(ctx aws.Context, input return out, req.Send() } +const opCreateContactMethod = "CreateContactMethod" + +// CreateContactMethodRequest generates a "aws/request.Request" representing the +// client's request for the CreateContactMethod operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateContactMethod for more information on using the CreateContactMethod +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateContactMethodRequest method. +// req, resp := client.CreateContactMethodRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateContactMethod +func (c *Lightsail) CreateContactMethodRequest(input *CreateContactMethodInput) (req *request.Request, output *CreateContactMethodOutput) { + op := &request.Operation{ + Name: opCreateContactMethod, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateContactMethodInput{} + } + + output = &CreateContactMethodOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateContactMethod API operation for Amazon Lightsail. +// +// Creates an email or SMS text message contact method. +// +// A contact method is used to send you notifications about your Amazon Lightsail +// resources. You can add one email address and one mobile phone number contact +// method in each AWS Region. However, SMS text messaging is not supported in +// some AWS Regions, and SMS text messages cannot be sent to some countries/regions. +// For more information, see Notifications in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-notifications). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 CreateContactMethod for usage and error information. +// +// Returned Error Types: +// * ServiceException +// A general service exception. +// +// * InvalidInputException +// Lightsail throws this exception when user input does not conform to the validation +// rules of an input field. +// +// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. +// Please set your AWS Region configuration to us-east-1 to create, view, or +// edit these resources. +// +// * NotFoundException +// Lightsail throws this exception when it cannot find a resource. +// +// * OperationFailureException +// Lightsail throws this exception when an operation fails to execute. +// +// * AccessDeniedException +// Lightsail throws this exception when the user cannot be authenticated or +// uses invalid credentials to access a resource. +// +// * UnauthenticatedException +// Lightsail throws this exception when the user has not been authenticated. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateContactMethod +func (c *Lightsail) CreateContactMethod(input *CreateContactMethodInput) (*CreateContactMethodOutput, error) { + req, out := c.CreateContactMethodRequest(input) + return out, req.Send() +} + +// CreateContactMethodWithContext is the same as CreateContactMethod with the addition of +// the ability to pass a context and additional request options. +// +// See CreateContactMethod for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) CreateContactMethodWithContext(ctx aws.Context, input *CreateContactMethodInput, opts ...request.Option) (*CreateContactMethodOutput, error) { + req, out := c.CreateContactMethodRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateDisk = "CreateDisk" // CreateDiskRequest generates a "aws/request.Request" representing the @@ -947,11 +1052,11 @@ func (c *Lightsail) CreateDiskRequest(input *CreateDiskInput) (req *request.Requ // See the AWS API reference guide for Amazon Lightsail's // API operation CreateDisk for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -959,21 +1064,21 @@ func (c *Lightsail) CreateDiskRequest(input *CreateDiskInput) (req *request.Requ // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDisk @@ -1057,11 +1162,11 @@ func (c *Lightsail) CreateDiskFromSnapshotRequest(input *CreateDiskFromSnapshotI // See the AWS API reference guide for Amazon Lightsail's // API operation CreateDiskFromSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -1069,21 +1174,21 @@ func (c *Lightsail) CreateDiskFromSnapshotRequest(input *CreateDiskFromSnapshotI // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDiskFromSnapshot @@ -1187,11 +1292,11 @@ func (c *Lightsail) CreateDiskSnapshotRequest(input *CreateDiskSnapshotInput) (r // See the AWS API reference guide for Amazon Lightsail's // API operation CreateDiskSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -1199,21 +1304,21 @@ func (c *Lightsail) CreateDiskSnapshotRequest(input *CreateDiskSnapshotInput) (r // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDiskSnapshot @@ -1294,11 +1399,11 @@ func (c *Lightsail) CreateDomainRequest(input *CreateDomainInput) (req *request. // See the AWS API reference guide for Amazon Lightsail's // API operation CreateDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -1306,21 +1411,21 @@ func (c *Lightsail) CreateDomainRequest(input *CreateDomainInput) (req *request. // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomain @@ -1404,11 +1509,11 @@ func (c *Lightsail) CreateDomainEntryRequest(input *CreateDomainEntryInput) (req // See the AWS API reference guide for Amazon Lightsail's // API operation CreateDomainEntry for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -1416,21 +1521,21 @@ func (c *Lightsail) CreateDomainEntryRequest(input *CreateDomainEntryInput) (req // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateDomainEntry @@ -1512,11 +1617,11 @@ func (c *Lightsail) CreateInstanceSnapshotRequest(input *CreateInstanceSnapshotI // See the AWS API reference guide for Amazon Lightsail's // API operation CreateInstanceSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -1524,21 +1629,21 @@ func (c *Lightsail) CreateInstanceSnapshotRequest(input *CreateInstanceSnapshotI // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstanceSnapshot @@ -1619,11 +1724,11 @@ func (c *Lightsail) CreateInstancesRequest(input *CreateInstancesInput) (req *re // See the AWS API reference guide for Amazon Lightsail's // API operation CreateInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -1631,21 +1736,21 @@ func (c *Lightsail) CreateInstancesRequest(input *CreateInstancesInput) (req *re // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstances @@ -1729,11 +1834,11 @@ func (c *Lightsail) CreateInstancesFromSnapshotRequest(input *CreateInstancesFro // See the AWS API reference guide for Amazon Lightsail's // API operation CreateInstancesFromSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -1741,21 +1846,21 @@ func (c *Lightsail) CreateInstancesFromSnapshotRequest(input *CreateInstancesFro // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateInstancesFromSnapshot @@ -1836,11 +1941,11 @@ func (c *Lightsail) CreateKeyPairRequest(input *CreateKeyPairInput) (req *reques // See the AWS API reference guide for Amazon Lightsail's // API operation CreateKeyPair for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -1848,21 +1953,21 @@ func (c *Lightsail) CreateKeyPairRequest(input *CreateKeyPairInput) (req *reques // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateKeyPair @@ -1950,11 +2055,11 @@ func (c *Lightsail) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (r // See the AWS API reference guide for Amazon Lightsail's // API operation CreateLoadBalancer for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -1962,21 +2067,21 @@ func (c *Lightsail) CreateLoadBalancerRequest(input *CreateLoadBalancerInput) (r // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateLoadBalancer @@ -2049,7 +2154,7 @@ func (c *Lightsail) CreateLoadBalancerTlsCertificateRequest(input *CreateLoadBal // // TLS is just an updated, more secure version of Secure Socket Layer (SSL). // -// The create load balancer tls certificate operation supports tag-based access +// The CreateLoadBalancerTlsCertificate operation supports tag-based access // control via resource tags applied to the resource identified by load balancer // name. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags). // @@ -2060,11 +2165,11 @@ func (c *Lightsail) CreateLoadBalancerTlsCertificateRequest(input *CreateLoadBal // See the AWS API reference guide for Amazon Lightsail's // API operation CreateLoadBalancerTlsCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -2072,21 +2177,21 @@ func (c *Lightsail) CreateLoadBalancerTlsCertificateRequest(input *CreateLoadBal // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateLoadBalancerTlsCertificate @@ -2167,11 +2272,11 @@ func (c *Lightsail) CreateRelationalDatabaseRequest(input *CreateRelationalDatab // See the AWS API reference guide for Amazon Lightsail's // API operation CreateRelationalDatabase for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -2179,21 +2284,21 @@ func (c *Lightsail) CreateRelationalDatabaseRequest(input *CreateRelationalDatab // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabase @@ -2280,11 +2385,11 @@ func (c *Lightsail) CreateRelationalDatabaseFromSnapshotRequest(input *CreateRel // See the AWS API reference guide for Amazon Lightsail's // API operation CreateRelationalDatabaseFromSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -2292,21 +2397,21 @@ func (c *Lightsail) CreateRelationalDatabaseFromSnapshotRequest(input *CreateRel // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabaseFromSnapshot @@ -2390,11 +2495,11 @@ func (c *Lightsail) CreateRelationalDatabaseSnapshotRequest(input *CreateRelatio // See the AWS API reference guide for Amazon Lightsail's // API operation CreateRelationalDatabaseSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -2402,21 +2507,21 @@ func (c *Lightsail) CreateRelationalDatabaseSnapshotRequest(input *CreateRelatio // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/CreateRelationalDatabaseSnapshot @@ -2441,6 +2546,111 @@ func (c *Lightsail) CreateRelationalDatabaseSnapshotWithContext(ctx aws.Context, return out, req.Send() } +const opDeleteAlarm = "DeleteAlarm" + +// DeleteAlarmRequest generates a "aws/request.Request" representing the +// client's request for the DeleteAlarm operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteAlarm for more information on using the DeleteAlarm +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteAlarmRequest method. +// req, resp := client.DeleteAlarmRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteAlarm +func (c *Lightsail) DeleteAlarmRequest(input *DeleteAlarmInput) (req *request.Request, output *DeleteAlarmOutput) { + op := &request.Operation{ + Name: opDeleteAlarm, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteAlarmInput{} + } + + output = &DeleteAlarmOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteAlarm API operation for Amazon Lightsail. +// +// Deletes an alarm. +// +// An alarm is used to monitor a single metric for one of your resources. When +// a metric condition is met, the alarm can notify you by email, SMS text message, +// and a banner displayed on the Amazon Lightsail console. For more information, +// see Alarms in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-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 Lightsail's +// API operation DeleteAlarm for usage and error information. +// +// Returned Error Types: +// * ServiceException +// A general service exception. +// +// * InvalidInputException +// Lightsail throws this exception when user input does not conform to the validation +// rules of an input field. +// +// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. +// Please set your AWS Region configuration to us-east-1 to create, view, or +// edit these resources. +// +// * OperationFailureException +// Lightsail throws this exception when an operation fails to execute. +// +// * UnauthenticatedException +// Lightsail throws this exception when the user has not been authenticated. +// +// * AccessDeniedException +// Lightsail throws this exception when the user cannot be authenticated or +// uses invalid credentials to access a resource. +// +// * NotFoundException +// Lightsail throws this exception when it cannot find a resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteAlarm +func (c *Lightsail) DeleteAlarm(input *DeleteAlarmInput) (*DeleteAlarmOutput, error) { + req, out := c.DeleteAlarmRequest(input) + return out, req.Send() +} + +// DeleteAlarmWithContext is the same as DeleteAlarm with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAlarm for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) DeleteAlarmWithContext(ctx aws.Context, input *DeleteAlarmInput, opts ...request.Option) (*DeleteAlarmOutput, error) { + req, out := c.DeleteAlarmRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteAutoSnapshot = "DeleteAutoSnapshot" // DeleteAutoSnapshotRequest generates a "aws/request.Request" representing the @@ -2485,7 +2695,8 @@ func (c *Lightsail) DeleteAutoSnapshotRequest(input *DeleteAutoSnapshotInput) (r // DeleteAutoSnapshot API operation for Amazon Lightsail. // -// Deletes an automatic snapshot for an instance or disk. +// Deletes an automatic snapshot of an instance or disk. For more information, +// see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2494,11 +2705,11 @@ func (c *Lightsail) DeleteAutoSnapshotRequest(input *DeleteAutoSnapshotInput) (r // See the AWS API reference guide for Amazon Lightsail's // API operation DeleteAutoSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -2506,17 +2717,17 @@ func (c *Lightsail) DeleteAutoSnapshotRequest(input *DeleteAutoSnapshotInput) (r // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteAutoSnapshot @@ -2541,6 +2752,112 @@ func (c *Lightsail) DeleteAutoSnapshotWithContext(ctx aws.Context, input *Delete return out, req.Send() } +const opDeleteContactMethod = "DeleteContactMethod" + +// DeleteContactMethodRequest generates a "aws/request.Request" representing the +// client's request for the DeleteContactMethod operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteContactMethod for more information on using the DeleteContactMethod +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteContactMethodRequest method. +// req, resp := client.DeleteContactMethodRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteContactMethod +func (c *Lightsail) DeleteContactMethodRequest(input *DeleteContactMethodInput) (req *request.Request, output *DeleteContactMethodOutput) { + op := &request.Operation{ + Name: opDeleteContactMethod, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteContactMethodInput{} + } + + output = &DeleteContactMethodOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteContactMethod API operation for Amazon Lightsail. +// +// Deletes a contact method. +// +// A contact method is used to send you notifications about your Amazon Lightsail +// resources. You can add one email address and one mobile phone number contact +// method in each AWS Region. However, SMS text messaging is not supported in +// some AWS Regions, and SMS text messages cannot be sent to some countries/regions. +// For more information, see Notifications in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-notifications). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 DeleteContactMethod for usage and error information. +// +// Returned Error Types: +// * ServiceException +// A general service exception. +// +// * InvalidInputException +// Lightsail throws this exception when user input does not conform to the validation +// rules of an input field. +// +// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. +// Please set your AWS Region configuration to us-east-1 to create, view, or +// edit these resources. +// +// * OperationFailureException +// Lightsail throws this exception when an operation fails to execute. +// +// * UnauthenticatedException +// Lightsail throws this exception when the user has not been authenticated. +// +// * AccessDeniedException +// Lightsail throws this exception when the user cannot be authenticated or +// uses invalid credentials to access a resource. +// +// * NotFoundException +// Lightsail throws this exception when it cannot find a resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteContactMethod +func (c *Lightsail) DeleteContactMethod(input *DeleteContactMethodInput) (*DeleteContactMethodOutput, error) { + req, out := c.DeleteContactMethodRequest(input) + return out, req.Send() +} + +// DeleteContactMethodWithContext is the same as DeleteContactMethod with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteContactMethod for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) DeleteContactMethodWithContext(ctx aws.Context, input *DeleteContactMethodInput, opts ...request.Option) (*DeleteContactMethodOutput, error) { + req, out := c.DeleteContactMethodRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteDisk = "DeleteDisk" // DeleteDiskRequest generates a "aws/request.Request" representing the @@ -2601,11 +2918,11 @@ func (c *Lightsail) DeleteDiskRequest(input *DeleteDiskInput) (req *request.Requ // See the AWS API reference guide for Amazon Lightsail's // API operation DeleteDisk for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -2613,21 +2930,21 @@ func (c *Lightsail) DeleteDiskRequest(input *DeleteDiskInput) (req *request.Requ // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDisk @@ -2716,11 +3033,11 @@ func (c *Lightsail) DeleteDiskSnapshotRequest(input *DeleteDiskSnapshotInput) (r // See the AWS API reference guide for Amazon Lightsail's // API operation DeleteDiskSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -2728,21 +3045,21 @@ func (c *Lightsail) DeleteDiskSnapshotRequest(input *DeleteDiskSnapshotInput) (r // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDiskSnapshot @@ -2824,11 +3141,11 @@ func (c *Lightsail) DeleteDomainRequest(input *DeleteDomainInput) (req *request. // See the AWS API reference guide for Amazon Lightsail's // API operation DeleteDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -2836,21 +3153,21 @@ func (c *Lightsail) DeleteDomainRequest(input *DeleteDomainInput) (req *request. // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomain @@ -2932,11 +3249,11 @@ func (c *Lightsail) DeleteDomainEntryRequest(input *DeleteDomainEntryInput) (req // See the AWS API reference guide for Amazon Lightsail's // API operation DeleteDomainEntry for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -2944,21 +3261,21 @@ func (c *Lightsail) DeleteDomainEntryRequest(input *DeleteDomainEntryInput) (req // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteDomainEntry @@ -3040,11 +3357,11 @@ func (c *Lightsail) DeleteInstanceRequest(input *DeleteInstanceInput) (req *requ // See the AWS API reference guide for Amazon Lightsail's // API operation DeleteInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -3052,21 +3369,21 @@ func (c *Lightsail) DeleteInstanceRequest(input *DeleteInstanceInput) (req *requ // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstance @@ -3148,11 +3465,11 @@ func (c *Lightsail) DeleteInstanceSnapshotRequest(input *DeleteInstanceSnapshotI // See the AWS API reference guide for Amazon Lightsail's // API operation DeleteInstanceSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -3160,21 +3477,21 @@ func (c *Lightsail) DeleteInstanceSnapshotRequest(input *DeleteInstanceSnapshotI // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteInstanceSnapshot @@ -3256,11 +3573,11 @@ func (c *Lightsail) DeleteKeyPairRequest(input *DeleteKeyPairInput) (req *reques // See the AWS API reference guide for Amazon Lightsail's // API operation DeleteKeyPair for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -3268,21 +3585,21 @@ func (c *Lightsail) DeleteKeyPairRequest(input *DeleteKeyPairInput) (req *reques // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteKeyPair @@ -3368,11 +3685,11 @@ func (c *Lightsail) DeleteKnownHostKeysRequest(input *DeleteKnownHostKeysInput) // See the AWS API reference guide for Amazon Lightsail's // API operation DeleteKnownHostKeys for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -3380,21 +3697,21 @@ func (c *Lightsail) DeleteKnownHostKeysRequest(input *DeleteKnownHostKeysInput) // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteKnownHostKeys @@ -3478,11 +3795,11 @@ func (c *Lightsail) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) (r // See the AWS API reference guide for Amazon Lightsail's // API operation DeleteLoadBalancer for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -3490,21 +3807,21 @@ func (c *Lightsail) DeleteLoadBalancerRequest(input *DeleteLoadBalancerInput) (r // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteLoadBalancer @@ -3575,7 +3892,7 @@ func (c *Lightsail) DeleteLoadBalancerTlsCertificateRequest(input *DeleteLoadBal // // Deletes an SSL/TLS certificate associated with a Lightsail load balancer. // -// The delete load balancer tls certificate operation supports tag-based access +// The DeleteLoadBalancerTlsCertificate operation supports tag-based access // control via resource tags applied to the resource identified by load balancer // name. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en/articles/amazon-lightsail-controlling-access-using-tags). // @@ -3586,11 +3903,11 @@ func (c *Lightsail) DeleteLoadBalancerTlsCertificateRequest(input *DeleteLoadBal // See the AWS API reference guide for Amazon Lightsail's // API operation DeleteLoadBalancerTlsCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -3598,21 +3915,21 @@ func (c *Lightsail) DeleteLoadBalancerTlsCertificateRequest(input *DeleteLoadBal // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteLoadBalancerTlsCertificate @@ -3694,11 +4011,11 @@ func (c *Lightsail) DeleteRelationalDatabaseRequest(input *DeleteRelationalDatab // See the AWS API reference guide for Amazon Lightsail's // API operation DeleteRelationalDatabase for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -3706,21 +4023,21 @@ func (c *Lightsail) DeleteRelationalDatabaseRequest(input *DeleteRelationalDatab // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteRelationalDatabase @@ -3802,11 +4119,11 @@ func (c *Lightsail) DeleteRelationalDatabaseSnapshotRequest(input *DeleteRelatio // See the AWS API reference guide for Amazon Lightsail's // API operation DeleteRelationalDatabaseSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -3814,21 +4131,21 @@ func (c *Lightsail) DeleteRelationalDatabaseSnapshotRequest(input *DeleteRelatio // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DeleteRelationalDatabaseSnapshot @@ -3912,11 +4229,11 @@ func (c *Lightsail) DetachDiskRequest(input *DetachDiskInput) (req *request.Requ // See the AWS API reference guide for Amazon Lightsail's // API operation DetachDisk for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -3924,21 +4241,21 @@ func (c *Lightsail) DetachDiskRequest(input *DetachDiskInput) (req *request.Requ // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachDisk @@ -4023,11 +4340,11 @@ func (c *Lightsail) DetachInstancesFromLoadBalancerRequest(input *DetachInstance // See the AWS API reference guide for Amazon Lightsail's // API operation DetachInstancesFromLoadBalancer for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -4035,21 +4352,21 @@ func (c *Lightsail) DetachInstancesFromLoadBalancerRequest(input *DetachInstance // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachInstancesFromLoadBalancer @@ -4127,11 +4444,11 @@ func (c *Lightsail) DetachStaticIpRequest(input *DetachStaticIpInput) (req *requ // See the AWS API reference guide for Amazon Lightsail's // API operation DetachStaticIp for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -4139,21 +4456,21 @@ func (c *Lightsail) DetachStaticIpRequest(input *DetachStaticIpInput) (req *requ // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DetachStaticIp @@ -4232,11 +4549,11 @@ func (c *Lightsail) DisableAddOnRequest(input *DisableAddOnInput) (req *request. // See the AWS API reference guide for Amazon Lightsail's // API operation DisableAddOn for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -4244,17 +4561,17 @@ func (c *Lightsail) DisableAddOnRequest(input *DisableAddOnInput) (req *request. // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DisableAddOn @@ -4332,11 +4649,11 @@ func (c *Lightsail) DownloadDefaultKeyPairRequest(input *DownloadDefaultKeyPairI // See the AWS API reference guide for Amazon Lightsail's // API operation DownloadDefaultKeyPair for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -4344,21 +4661,21 @@ func (c *Lightsail) DownloadDefaultKeyPairRequest(input *DownloadDefaultKeyPairI // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/DownloadDefaultKeyPair @@ -4437,11 +4754,11 @@ func (c *Lightsail) EnableAddOnRequest(input *EnableAddOnInput) (req *request.Re // See the AWS API reference guide for Amazon Lightsail's // API operation EnableAddOn for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -4449,17 +4766,17 @@ func (c *Lightsail) EnableAddOnRequest(input *EnableAddOnInput) (req *request.Re // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/EnableAddOn @@ -4553,11 +4870,11 @@ func (c *Lightsail) ExportSnapshotRequest(input *ExportSnapshotInput) (req *requ // See the AWS API reference guide for Amazon Lightsail's // API operation ExportSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -4565,21 +4882,21 @@ func (c *Lightsail) ExportSnapshotRequest(input *ExportSnapshotInput) (req *requ // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ExportSnapshot @@ -4657,11 +4974,11 @@ func (c *Lightsail) GetActiveNamesRequest(input *GetActiveNamesInput) (req *requ // See the AWS API reference guide for Amazon Lightsail's // API operation GetActiveNames for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -4669,21 +4986,21 @@ func (c *Lightsail) GetActiveNamesRequest(input *GetActiveNamesInput) (req *requ // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetActiveNames @@ -4708,65 +5025,71 @@ func (c *Lightsail) GetActiveNamesWithContext(ctx aws.Context, input *GetActiveN return out, req.Send() } -const opGetAutoSnapshots = "GetAutoSnapshots" +const opGetAlarms = "GetAlarms" -// GetAutoSnapshotsRequest generates a "aws/request.Request" representing the -// client's request for the GetAutoSnapshots operation. The "output" return +// GetAlarmsRequest generates a "aws/request.Request" representing the +// client's request for the GetAlarms operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetAutoSnapshots for more information on using the GetAutoSnapshots +// See GetAlarms for more information on using the GetAlarms // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetAutoSnapshotsRequest method. -// req, resp := client.GetAutoSnapshotsRequest(params) +// // Example sending a request using the GetAlarmsRequest method. +// req, resp := client.GetAlarmsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetAutoSnapshots -func (c *Lightsail) GetAutoSnapshotsRequest(input *GetAutoSnapshotsInput) (req *request.Request, output *GetAutoSnapshotsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetAlarms +func (c *Lightsail) GetAlarmsRequest(input *GetAlarmsInput) (req *request.Request, output *GetAlarmsOutput) { op := &request.Operation{ - Name: opGetAutoSnapshots, + Name: opGetAlarms, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetAutoSnapshotsInput{} + input = &GetAlarmsInput{} } - output = &GetAutoSnapshotsOutput{} + output = &GetAlarmsOutput{} req = c.newRequest(op, input, output) return } -// GetAutoSnapshots API operation for Amazon Lightsail. +// GetAlarms API operation for Amazon Lightsail. +// +// Returns information about the configured alarms. Specify an alarm name in +// your request to return information about a specific alarm, or specify a monitored +// resource name to return information about all alarms for a specific resource. // -// Returns the available automatic snapshots for the specified resource name. -// For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). +// An alarm is used to monitor a single metric for one of your resources. When +// a metric condition is met, the alarm can notify you by email, SMS text message, +// and a banner displayed on the Amazon Lightsail console. For more information, +// see Alarms in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-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 Lightsail's -// API operation GetAutoSnapshots for usage and error information. +// API operation GetAlarms for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -4774,52 +5097,153 @@ func (c *Lightsail) GetAutoSnapshotsRequest(input *GetAutoSnapshotsInput) (req * // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" -// Lightsail throws this exception when it cannot find a resource. -// -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * UnauthenticatedException +// Lightsail throws this exception when the user has not been authenticated. +// +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" -// Lightsail throws this exception when the user has not been authenticated. +// * NotFoundException +// Lightsail throws this exception when it cannot find a resource. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetAutoSnapshots -func (c *Lightsail) GetAutoSnapshots(input *GetAutoSnapshotsInput) (*GetAutoSnapshotsOutput, error) { - req, out := c.GetAutoSnapshotsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetAlarms +func (c *Lightsail) GetAlarms(input *GetAlarmsInput) (*GetAlarmsOutput, error) { + req, out := c.GetAlarmsRequest(input) return out, req.Send() } -// GetAutoSnapshotsWithContext is the same as GetAutoSnapshots with the addition of +// GetAlarmsWithContext is the same as GetAlarms with the addition of // the ability to pass a context and additional request options. // -// See GetAutoSnapshots for details on how to use this API operation. +// See GetAlarms for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Lightsail) GetAutoSnapshotsWithContext(ctx aws.Context, input *GetAutoSnapshotsInput, opts ...request.Option) (*GetAutoSnapshotsOutput, error) { - req, out := c.GetAutoSnapshotsRequest(input) +func (c *Lightsail) GetAlarmsWithContext(ctx aws.Context, input *GetAlarmsInput, opts ...request.Option) (*GetAlarmsOutput, error) { + req, out := c.GetAlarmsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetBlueprints = "GetBlueprints" +const opGetAutoSnapshots = "GetAutoSnapshots" -// GetBlueprintsRequest generates a "aws/request.Request" representing the -// client's request for the GetBlueprints operation. The "output" return +// GetAutoSnapshotsRequest generates a "aws/request.Request" representing the +// client's request for the GetAutoSnapshots operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetBlueprints for more information on using the GetBlueprints +// See GetAutoSnapshots for more information on using the GetAutoSnapshots +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetAutoSnapshotsRequest method. +// req, resp := client.GetAutoSnapshotsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetAutoSnapshots +func (c *Lightsail) GetAutoSnapshotsRequest(input *GetAutoSnapshotsInput) (req *request.Request, output *GetAutoSnapshotsOutput) { + op := &request.Operation{ + Name: opGetAutoSnapshots, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetAutoSnapshotsInput{} + } + + output = &GetAutoSnapshotsOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetAutoSnapshots API operation for Amazon Lightsail. +// +// Returns the available automatic snapshots for an instance or disk. For more +// information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 GetAutoSnapshots for usage and error information. +// +// Returned Error Types: +// * ServiceException +// A general service exception. +// +// * InvalidInputException +// Lightsail throws this exception when user input does not conform to the validation +// rules of an input field. +// +// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. +// Please set your AWS Region configuration to us-east-1 to create, view, or +// edit these resources. +// +// * NotFoundException +// Lightsail throws this exception when it cannot find a resource. +// +// * OperationFailureException +// Lightsail throws this exception when an operation fails to execute. +// +// * AccessDeniedException +// Lightsail throws this exception when the user cannot be authenticated or +// uses invalid credentials to access a resource. +// +// * UnauthenticatedException +// Lightsail throws this exception when the user has not been authenticated. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetAutoSnapshots +func (c *Lightsail) GetAutoSnapshots(input *GetAutoSnapshotsInput) (*GetAutoSnapshotsOutput, error) { + req, out := c.GetAutoSnapshotsRequest(input) + return out, req.Send() +} + +// GetAutoSnapshotsWithContext is the same as GetAutoSnapshots with the addition of +// the ability to pass a context and additional request options. +// +// See GetAutoSnapshots for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetAutoSnapshotsWithContext(ctx aws.Context, input *GetAutoSnapshotsInput, opts ...request.Option) (*GetAutoSnapshotsOutput, error) { + req, out := c.GetAutoSnapshotsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetBlueprints = "GetBlueprints" + +// GetBlueprintsRequest generates a "aws/request.Request" representing the +// client's request for the GetBlueprints operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetBlueprints for more information on using the GetBlueprints // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration @@ -4870,11 +5294,11 @@ func (c *Lightsail) GetBlueprintsRequest(input *GetBlueprintsInput) (req *reques // See the AWS API reference guide for Amazon Lightsail's // API operation GetBlueprints for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -4882,21 +5306,21 @@ func (c *Lightsail) GetBlueprintsRequest(input *GetBlueprintsInput) (req *reques // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBlueprints @@ -4975,11 +5399,11 @@ func (c *Lightsail) GetBundlesRequest(input *GetBundlesInput) (req *request.Requ // See the AWS API reference guide for Amazon Lightsail's // API operation GetBundles for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -4987,21 +5411,21 @@ func (c *Lightsail) GetBundlesRequest(input *GetBundlesInput) (req *request.Requ // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetBundles @@ -5083,11 +5507,11 @@ func (c *Lightsail) GetCloudFormationStackRecordsRequest(input *GetCloudFormatio // See the AWS API reference guide for Amazon Lightsail's // API operation GetCloudFormationStackRecords for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -5095,21 +5519,21 @@ func (c *Lightsail) GetCloudFormationStackRecordsRequest(input *GetCloudFormatio // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetCloudFormationStackRecords @@ -5134,6 +5558,113 @@ func (c *Lightsail) GetCloudFormationStackRecordsWithContext(ctx aws.Context, in return out, req.Send() } +const opGetContactMethods = "GetContactMethods" + +// GetContactMethodsRequest generates a "aws/request.Request" representing the +// client's request for the GetContactMethods operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetContactMethods for more information on using the GetContactMethods +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetContactMethodsRequest method. +// req, resp := client.GetContactMethodsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetContactMethods +func (c *Lightsail) GetContactMethodsRequest(input *GetContactMethodsInput) (req *request.Request, output *GetContactMethodsOutput) { + op := &request.Operation{ + Name: opGetContactMethods, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetContactMethodsInput{} + } + + output = &GetContactMethodsOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetContactMethods API operation for Amazon Lightsail. +// +// Returns information about the configured contact methods. Specify a protocol +// in your request to return information about a specific contact method. +// +// A contact method is used to send you notifications about your Amazon Lightsail +// resources. You can add one email address and one mobile phone number contact +// method in each AWS Region. However, SMS text messaging is not supported in +// some AWS Regions, and SMS text messages cannot be sent to some countries/regions. +// For more information, see Notifications in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-notifications). +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 GetContactMethods for usage and error information. +// +// Returned Error Types: +// * ServiceException +// A general service exception. +// +// * InvalidInputException +// Lightsail throws this exception when user input does not conform to the validation +// rules of an input field. +// +// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. +// Please set your AWS Region configuration to us-east-1 to create, view, or +// edit these resources. +// +// * NotFoundException +// Lightsail throws this exception when it cannot find a resource. +// +// * OperationFailureException +// Lightsail throws this exception when an operation fails to execute. +// +// * AccessDeniedException +// Lightsail throws this exception when the user cannot be authenticated or +// uses invalid credentials to access a resource. +// +// * UnauthenticatedException +// Lightsail throws this exception when the user has not been authenticated. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetContactMethods +func (c *Lightsail) GetContactMethods(input *GetContactMethodsInput) (*GetContactMethodsOutput, error) { + req, out := c.GetContactMethodsRequest(input) + return out, req.Send() +} + +// GetContactMethodsWithContext is the same as GetContactMethods with the addition of +// the ability to pass a context and additional request options. +// +// See GetContactMethods for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) GetContactMethodsWithContext(ctx aws.Context, input *GetContactMethodsInput, opts ...request.Option) (*GetContactMethodsOutput, error) { + req, out := c.GetContactMethodsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetDisk = "GetDisk" // GetDiskRequest generates a "aws/request.Request" representing the @@ -5187,11 +5718,11 @@ func (c *Lightsail) GetDiskRequest(input *GetDiskInput) (req *request.Request, o // See the AWS API reference guide for Amazon Lightsail's // API operation GetDisk for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -5199,21 +5730,21 @@ func (c *Lightsail) GetDiskRequest(input *GetDiskInput) (req *request.Request, o // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDisk @@ -5291,11 +5822,11 @@ func (c *Lightsail) GetDiskSnapshotRequest(input *GetDiskSnapshotInput) (req *re // See the AWS API reference guide for Amazon Lightsail's // API operation GetDiskSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -5303,21 +5834,21 @@ func (c *Lightsail) GetDiskSnapshotRequest(input *GetDiskSnapshotInput) (req *re // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDiskSnapshot @@ -5389,10 +5920,6 @@ func (c *Lightsail) GetDiskSnapshotsRequest(input *GetDiskSnapshotsInput) (req * // Returns information about all block storage disk snapshots in your AWS account // and region. // -// If you are describing a long list of disk snapshots, you can paginate the -// output to make the list more manageable. You can use the pageToken and nextPageToken -// values to retrieve the next items in the 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. @@ -5400,11 +5927,11 @@ func (c *Lightsail) GetDiskSnapshotsRequest(input *GetDiskSnapshotsInput) (req * // See the AWS API reference guide for Amazon Lightsail's // API operation GetDiskSnapshots for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -5412,21 +5939,21 @@ func (c *Lightsail) GetDiskSnapshotsRequest(input *GetDiskSnapshotsInput) (req * // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDiskSnapshots @@ -5498,10 +6025,6 @@ func (c *Lightsail) GetDisksRequest(input *GetDisksInput) (req *request.Request, // Returns information about all block storage disks in your AWS account and // region. // -// If you are describing a long list of disks, you can paginate the output to -// make the list more manageable. You can use the pageToken and nextPageToken -// values to retrieve the next items in the 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. @@ -5509,11 +6032,11 @@ func (c *Lightsail) GetDisksRequest(input *GetDisksInput) (req *request.Request, // See the AWS API reference guide for Amazon Lightsail's // API operation GetDisks for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -5521,21 +6044,21 @@ func (c *Lightsail) GetDisksRequest(input *GetDisksInput) (req *request.Request, // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDisks @@ -5613,11 +6136,11 @@ func (c *Lightsail) GetDomainRequest(input *GetDomainInput) (req *request.Reques // See the AWS API reference guide for Amazon Lightsail's // API operation GetDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -5625,21 +6148,21 @@ func (c *Lightsail) GetDomainRequest(input *GetDomainInput) (req *request.Reques // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomain @@ -5717,11 +6240,11 @@ func (c *Lightsail) GetDomainsRequest(input *GetDomainsInput) (req *request.Requ // See the AWS API reference guide for Amazon Lightsail's // API operation GetDomains for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -5729,21 +6252,21 @@ func (c *Lightsail) GetDomainsRequest(input *GetDomainsInput) (req *request.Requ // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetDomains @@ -5825,11 +6348,11 @@ func (c *Lightsail) GetExportSnapshotRecordsRequest(input *GetExportSnapshotReco // See the AWS API reference guide for Amazon Lightsail's // API operation GetExportSnapshotRecords for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -5837,21 +6360,21 @@ func (c *Lightsail) GetExportSnapshotRecordsRequest(input *GetExportSnapshotReco // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetExportSnapshotRecords @@ -5930,11 +6453,11 @@ func (c *Lightsail) GetInstanceRequest(input *GetInstanceInput) (req *request.Re // See the AWS API reference guide for Amazon Lightsail's // API operation GetInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -5942,21 +6465,21 @@ func (c *Lightsail) GetInstanceRequest(input *GetInstanceInput) (req *request.Re // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstance @@ -6039,11 +6562,11 @@ func (c *Lightsail) GetInstanceAccessDetailsRequest(input *GetInstanceAccessDeta // See the AWS API reference guide for Amazon Lightsail's // API operation GetInstanceAccessDetails for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -6051,21 +6574,21 @@ func (c *Lightsail) GetInstanceAccessDetailsRequest(input *GetInstanceAccessDeta // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceAccessDetails @@ -6144,11 +6667,11 @@ func (c *Lightsail) GetInstanceMetricDataRequest(input *GetInstanceMetricDataInp // See the AWS API reference guide for Amazon Lightsail's // API operation GetInstanceMetricData for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -6156,21 +6679,21 @@ func (c *Lightsail) GetInstanceMetricDataRequest(input *GetInstanceMetricDataInp // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceMetricData @@ -6248,11 +6771,11 @@ func (c *Lightsail) GetInstancePortStatesRequest(input *GetInstancePortStatesInp // See the AWS API reference guide for Amazon Lightsail's // API operation GetInstancePortStates for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -6260,21 +6783,21 @@ func (c *Lightsail) GetInstancePortStatesRequest(input *GetInstancePortStatesInp // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstancePortStates @@ -6352,11 +6875,11 @@ func (c *Lightsail) GetInstanceSnapshotRequest(input *GetInstanceSnapshotInput) // See the AWS API reference guide for Amazon Lightsail's // API operation GetInstanceSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -6364,21 +6887,21 @@ func (c *Lightsail) GetInstanceSnapshotRequest(input *GetInstanceSnapshotInput) // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshot @@ -6456,11 +6979,11 @@ func (c *Lightsail) GetInstanceSnapshotsRequest(input *GetInstanceSnapshotsInput // See the AWS API reference guide for Amazon Lightsail's // API operation GetInstanceSnapshots for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -6468,21 +6991,21 @@ func (c *Lightsail) GetInstanceSnapshotsRequest(input *GetInstanceSnapshotsInput // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceSnapshots @@ -6560,11 +7083,11 @@ func (c *Lightsail) GetInstanceStateRequest(input *GetInstanceStateInput) (req * // See the AWS API reference guide for Amazon Lightsail's // API operation GetInstanceState for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -6572,21 +7095,21 @@ func (c *Lightsail) GetInstanceStateRequest(input *GetInstanceStateInput) (req * // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstanceState @@ -6665,11 +7188,11 @@ func (c *Lightsail) GetInstancesRequest(input *GetInstancesInput) (req *request. // See the AWS API reference guide for Amazon Lightsail's // API operation GetInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -6677,21 +7200,21 @@ func (c *Lightsail) GetInstancesRequest(input *GetInstancesInput) (req *request. // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetInstances @@ -6769,11 +7292,11 @@ func (c *Lightsail) GetKeyPairRequest(input *GetKeyPairInput) (req *request.Requ // See the AWS API reference guide for Amazon Lightsail's // API operation GetKeyPair for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -6781,21 +7304,21 @@ func (c *Lightsail) GetKeyPairRequest(input *GetKeyPairInput) (req *request.Requ // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPair @@ -6873,11 +7396,11 @@ func (c *Lightsail) GetKeyPairsRequest(input *GetKeyPairsInput) (req *request.Re // See the AWS API reference guide for Amazon Lightsail's // API operation GetKeyPairs for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -6885,21 +7408,21 @@ func (c *Lightsail) GetKeyPairsRequest(input *GetKeyPairsInput) (req *request.Re // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetKeyPairs @@ -6977,11 +7500,11 @@ func (c *Lightsail) GetLoadBalancerRequest(input *GetLoadBalancerInput) (req *re // See the AWS API reference guide for Amazon Lightsail's // API operation GetLoadBalancer for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -6989,21 +7512,21 @@ func (c *Lightsail) GetLoadBalancerRequest(input *GetLoadBalancerInput) (req *re // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancer @@ -7081,11 +7604,11 @@ func (c *Lightsail) GetLoadBalancerMetricDataRequest(input *GetLoadBalancerMetri // See the AWS API reference guide for Amazon Lightsail's // API operation GetLoadBalancerMetricData for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -7093,21 +7616,21 @@ func (c *Lightsail) GetLoadBalancerMetricDataRequest(input *GetLoadBalancerMetri // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancerMetricData @@ -7191,11 +7714,11 @@ func (c *Lightsail) GetLoadBalancerTlsCertificatesRequest(input *GetLoadBalancer // See the AWS API reference guide for Amazon Lightsail's // API operation GetLoadBalancerTlsCertificates for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -7203,21 +7726,21 @@ func (c *Lightsail) GetLoadBalancerTlsCertificatesRequest(input *GetLoadBalancer // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancerTlsCertificates @@ -7288,10 +7811,6 @@ func (c *Lightsail) GetLoadBalancersRequest(input *GetLoadBalancersInput) (req * // // Returns information about all load balancers in an account. // -// If you are describing a long list of load balancers, you can paginate the -// output to make the list more manageable. You can use the pageToken and nextPageToken -// values to retrieve the next items in the 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. @@ -7299,11 +7818,11 @@ func (c *Lightsail) GetLoadBalancersRequest(input *GetLoadBalancersInput) (req * // See the AWS API reference guide for Amazon Lightsail's // API operation GetLoadBalancers for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -7311,21 +7830,21 @@ func (c *Lightsail) GetLoadBalancersRequest(input *GetLoadBalancersInput) (req * // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetLoadBalancers @@ -7405,11 +7924,11 @@ func (c *Lightsail) GetOperationRequest(input *GetOperationInput) (req *request. // See the AWS API reference guide for Amazon Lightsail's // API operation GetOperation for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -7417,21 +7936,21 @@ func (c *Lightsail) GetOperationRequest(input *GetOperationInput) (req *request. // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperation @@ -7513,11 +8032,11 @@ func (c *Lightsail) GetOperationsRequest(input *GetOperationsInput) (req *reques // See the AWS API reference guide for Amazon Lightsail's // API operation GetOperations for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -7525,21 +8044,21 @@ func (c *Lightsail) GetOperationsRequest(input *GetOperationsInput) (req *reques // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperations @@ -7617,11 +8136,11 @@ func (c *Lightsail) GetOperationsForResourceRequest(input *GetOperationsForResou // See the AWS API reference guide for Amazon Lightsail's // API operation GetOperationsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -7629,21 +8148,21 @@ func (c *Lightsail) GetOperationsForResourceRequest(input *GetOperationsForResou // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetOperationsForResource @@ -7722,11 +8241,11 @@ func (c *Lightsail) GetRegionsRequest(input *GetRegionsInput) (req *request.Requ // See the AWS API reference guide for Amazon Lightsail's // API operation GetRegions for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -7734,21 +8253,21 @@ func (c *Lightsail) GetRegionsRequest(input *GetRegionsInput) (req *request.Requ // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRegions @@ -7826,11 +8345,11 @@ func (c *Lightsail) GetRelationalDatabaseRequest(input *GetRelationalDatabaseInp // See the AWS API reference guide for Amazon Lightsail's // API operation GetRelationalDatabase for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -7838,21 +8357,21 @@ func (c *Lightsail) GetRelationalDatabaseRequest(input *GetRelationalDatabaseInp // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabase @@ -7934,11 +8453,11 @@ func (c *Lightsail) GetRelationalDatabaseBlueprintsRequest(input *GetRelationalD // See the AWS API reference guide for Amazon Lightsail's // API operation GetRelationalDatabaseBlueprints for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -7946,21 +8465,21 @@ func (c *Lightsail) GetRelationalDatabaseBlueprintsRequest(input *GetRelationalD // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseBlueprints @@ -8042,11 +8561,11 @@ func (c *Lightsail) GetRelationalDatabaseBundlesRequest(input *GetRelationalData // See the AWS API reference guide for Amazon Lightsail's // API operation GetRelationalDatabaseBundles for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -8054,21 +8573,21 @@ func (c *Lightsail) GetRelationalDatabaseBundlesRequest(input *GetRelationalData // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseBundles @@ -8146,11 +8665,11 @@ func (c *Lightsail) GetRelationalDatabaseEventsRequest(input *GetRelationalDatab // See the AWS API reference guide for Amazon Lightsail's // API operation GetRelationalDatabaseEvents for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -8158,21 +8677,21 @@ func (c *Lightsail) GetRelationalDatabaseEventsRequest(input *GetRelationalDatab // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseEvents @@ -8250,11 +8769,11 @@ func (c *Lightsail) GetRelationalDatabaseLogEventsRequest(input *GetRelationalDa // See the AWS API reference guide for Amazon Lightsail's // API operation GetRelationalDatabaseLogEvents for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -8262,21 +8781,21 @@ func (c *Lightsail) GetRelationalDatabaseLogEventsRequest(input *GetRelationalDa // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseLogEvents @@ -8355,11 +8874,11 @@ func (c *Lightsail) GetRelationalDatabaseLogStreamsRequest(input *GetRelationalD // See the AWS API reference guide for Amazon Lightsail's // API operation GetRelationalDatabaseLogStreams for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -8367,21 +8886,21 @@ func (c *Lightsail) GetRelationalDatabaseLogStreamsRequest(input *GetRelationalD // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseLogStreams @@ -8463,11 +8982,11 @@ func (c *Lightsail) GetRelationalDatabaseMasterUserPasswordRequest(input *GetRel // See the AWS API reference guide for Amazon Lightsail's // API operation GetRelationalDatabaseMasterUserPassword for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -8475,21 +8994,21 @@ func (c *Lightsail) GetRelationalDatabaseMasterUserPasswordRequest(input *GetRel // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseMasterUserPassword @@ -8568,11 +9087,11 @@ func (c *Lightsail) GetRelationalDatabaseMetricDataRequest(input *GetRelationalD // See the AWS API reference guide for Amazon Lightsail's // API operation GetRelationalDatabaseMetricData for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -8580,21 +9099,21 @@ func (c *Lightsail) GetRelationalDatabaseMetricDataRequest(input *GetRelationalD // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseMetricData @@ -8678,11 +9197,11 @@ func (c *Lightsail) GetRelationalDatabaseParametersRequest(input *GetRelationalD // See the AWS API reference guide for Amazon Lightsail's // API operation GetRelationalDatabaseParameters for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -8690,21 +9209,21 @@ func (c *Lightsail) GetRelationalDatabaseParametersRequest(input *GetRelationalD // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseParameters @@ -8782,11 +9301,11 @@ func (c *Lightsail) GetRelationalDatabaseSnapshotRequest(input *GetRelationalDat // See the AWS API reference guide for Amazon Lightsail's // API operation GetRelationalDatabaseSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -8794,21 +9313,21 @@ func (c *Lightsail) GetRelationalDatabaseSnapshotRequest(input *GetRelationalDat // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseSnapshot @@ -8886,11 +9405,11 @@ func (c *Lightsail) GetRelationalDatabaseSnapshotsRequest(input *GetRelationalDa // See the AWS API reference guide for Amazon Lightsail's // API operation GetRelationalDatabaseSnapshots for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -8898,21 +9417,21 @@ func (c *Lightsail) GetRelationalDatabaseSnapshotsRequest(input *GetRelationalDa // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabaseSnapshots @@ -8990,11 +9509,11 @@ func (c *Lightsail) GetRelationalDatabasesRequest(input *GetRelationalDatabasesI // See the AWS API reference guide for Amazon Lightsail's // API operation GetRelationalDatabases for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -9002,21 +9521,21 @@ func (c *Lightsail) GetRelationalDatabasesRequest(input *GetRelationalDatabasesI // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetRelationalDatabases @@ -9094,11 +9613,11 @@ func (c *Lightsail) GetStaticIpRequest(input *GetStaticIpInput) (req *request.Re // See the AWS API reference guide for Amazon Lightsail's // API operation GetStaticIp for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -9106,21 +9625,21 @@ func (c *Lightsail) GetStaticIpRequest(input *GetStaticIpInput) (req *request.Re // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIp @@ -9198,11 +9717,11 @@ func (c *Lightsail) GetStaticIpsRequest(input *GetStaticIpsInput) (req *request. // See the AWS API reference guide for Amazon Lightsail's // API operation GetStaticIps for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -9210,21 +9729,21 @@ func (c *Lightsail) GetStaticIpsRequest(input *GetStaticIpsInput) (req *request. // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/GetStaticIps @@ -9302,11 +9821,11 @@ func (c *Lightsail) ImportKeyPairRequest(input *ImportKeyPairInput) (req *reques // See the AWS API reference guide for Amazon Lightsail's // API operation ImportKeyPair for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -9314,21 +9833,21 @@ func (c *Lightsail) ImportKeyPairRequest(input *ImportKeyPairInput) (req *reques // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ImportKeyPair @@ -9406,11 +9925,11 @@ func (c *Lightsail) IsVpcPeeredRequest(input *IsVpcPeeredInput) (req *request.Re // See the AWS API reference guide for Amazon Lightsail's // API operation IsVpcPeered for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -9418,21 +9937,21 @@ func (c *Lightsail) IsVpcPeeredRequest(input *IsVpcPeeredInput) (req *request.Re // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/IsVpcPeered @@ -9514,11 +10033,11 @@ func (c *Lightsail) OpenInstancePublicPortsRequest(input *OpenInstancePublicPort // See the AWS API reference guide for Amazon Lightsail's // API operation OpenInstancePublicPorts for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -9526,21 +10045,21 @@ func (c *Lightsail) OpenInstancePublicPortsRequest(input *OpenInstancePublicPort // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/OpenInstancePublicPorts @@ -9618,11 +10137,11 @@ func (c *Lightsail) PeerVpcRequest(input *PeerVpcInput) (req *request.Request, o // See the AWS API reference guide for Amazon Lightsail's // API operation PeerVpc for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -9630,21 +10149,21 @@ func (c *Lightsail) PeerVpcRequest(input *PeerVpcInput) (req *request.Request, o // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PeerVpc @@ -9669,6 +10188,119 @@ func (c *Lightsail) PeerVpcWithContext(ctx aws.Context, input *PeerVpcInput, opt return out, req.Send() } +const opPutAlarm = "PutAlarm" + +// PutAlarmRequest generates a "aws/request.Request" representing the +// client's request for the PutAlarm operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutAlarm for more information on using the PutAlarm +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutAlarmRequest method. +// req, resp := client.PutAlarmRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PutAlarm +func (c *Lightsail) PutAlarmRequest(input *PutAlarmInput) (req *request.Request, output *PutAlarmOutput) { + op := &request.Operation{ + Name: opPutAlarm, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutAlarmInput{} + } + + output = &PutAlarmOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutAlarm API operation for Amazon Lightsail. +// +// Creates or updates an alarm, and associates it with the specified metric. +// +// An alarm is used to monitor a single metric for one of your resources. When +// a metric condition is met, the alarm can notify you by email, SMS text message, +// and a banner displayed on the Amazon Lightsail console. For more information, +// see Alarms in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-alarms). +// +// When this action creates an alarm, the alarm state is immediately set to +// INSUFFICIENT_DATA. The alarm is then evaluated and its state is set appropriately. +// Any actions associated with the new 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. The alarm +// is then evaluated with the updated 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 PutAlarm for usage and error information. +// +// Returned Error Types: +// * ServiceException +// A general service exception. +// +// * InvalidInputException +// Lightsail throws this exception when user input does not conform to the validation +// rules of an input field. +// +// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. +// Please set your AWS Region configuration to us-east-1 to create, view, or +// edit these resources. +// +// * OperationFailureException +// Lightsail throws this exception when an operation fails to execute. +// +// * AccessDeniedException +// Lightsail throws this exception when the user cannot be authenticated or +// uses invalid credentials to access a resource. +// +// * UnauthenticatedException +// Lightsail throws this exception when the user has not been authenticated. +// +// * NotFoundException +// Lightsail throws this exception when it cannot find a resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PutAlarm +func (c *Lightsail) PutAlarm(input *PutAlarmInput) (*PutAlarmOutput, error) { + req, out := c.PutAlarmRequest(input) + return out, req.Send() +} + +// PutAlarmWithContext is the same as PutAlarm with the addition of +// the ability to pass a context and additional request options. +// +// See PutAlarm for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) PutAlarmWithContext(ctx aws.Context, input *PutAlarmInput, opts ...request.Option) (*PutAlarmOutput, error) { + req, out := c.PutAlarmRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opPutInstancePublicPorts = "PutInstancePublicPorts" // PutInstancePublicPortsRequest generates a "aws/request.Request" representing the @@ -9727,11 +10359,11 @@ func (c *Lightsail) PutInstancePublicPortsRequest(input *PutInstancePublicPortsI // See the AWS API reference guide for Amazon Lightsail's // API operation PutInstancePublicPorts for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -9739,21 +10371,21 @@ func (c *Lightsail) PutInstancePublicPortsRequest(input *PutInstancePublicPortsI // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/PutInstancePublicPorts @@ -9835,11 +10467,11 @@ func (c *Lightsail) RebootInstanceRequest(input *RebootInstanceInput) (req *requ // See the AWS API reference guide for Amazon Lightsail's // API operation RebootInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -9847,21 +10479,21 @@ func (c *Lightsail) RebootInstanceRequest(input *RebootInstanceInput) (req *requ // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/RebootInstance @@ -9943,11 +10575,11 @@ func (c *Lightsail) RebootRelationalDatabaseRequest(input *RebootRelationalDatab // See the AWS API reference guide for Amazon Lightsail's // API operation RebootRelationalDatabase for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -9955,21 +10587,21 @@ func (c *Lightsail) RebootRelationalDatabaseRequest(input *RebootRelationalDatab // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/RebootRelationalDatabase @@ -10047,11 +10679,11 @@ func (c *Lightsail) ReleaseStaticIpRequest(input *ReleaseStaticIpInput) (req *re // See the AWS API reference guide for Amazon Lightsail's // API operation ReleaseStaticIp for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -10059,21 +10691,21 @@ func (c *Lightsail) ReleaseStaticIpRequest(input *ReleaseStaticIpInput) (req *re // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/ReleaseStaticIp @@ -10098,49 +10730,163 @@ func (c *Lightsail) ReleaseStaticIpWithContext(ctx aws.Context, input *ReleaseSt return out, req.Send() } -const opStartInstance = "StartInstance" +const opSendContactMethodVerification = "SendContactMethodVerification" -// StartInstanceRequest generates a "aws/request.Request" representing the -// client's request for the StartInstance operation. The "output" return +// SendContactMethodVerificationRequest generates a "aws/request.Request" representing the +// client's request for the SendContactMethodVerification operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StartInstance for more information on using the StartInstance +// See SendContactMethodVerification for more information on using the SendContactMethodVerification // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StartInstanceRequest method. -// req, resp := client.StartInstanceRequest(params) +// // Example sending a request using the SendContactMethodVerificationRequest method. +// req, resp := client.SendContactMethodVerificationRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartInstance -func (c *Lightsail) StartInstanceRequest(input *StartInstanceInput) (req *request.Request, output *StartInstanceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/SendContactMethodVerification +func (c *Lightsail) SendContactMethodVerificationRequest(input *SendContactMethodVerificationInput) (req *request.Request, output *SendContactMethodVerificationOutput) { op := &request.Operation{ - Name: opStartInstance, + Name: opSendContactMethodVerification, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StartInstanceInput{} + input = &SendContactMethodVerificationInput{} } - output = &StartInstanceOutput{} + output = &SendContactMethodVerificationOutput{} req = c.newRequest(op, input, output) return } -// StartInstance API operation for Amazon Lightsail. +// SendContactMethodVerification API operation for Amazon Lightsail. +// +// Sends a verification request to an email contact method to ensure it’s +// owned by the requester. SMS contact methods don’t need to be verified. +// +// A contact method is used to send you notifications about your Amazon Lightsail +// resources. You can add one email address and one mobile phone number contact +// method in each AWS Region. However, SMS text messaging is not supported in +// some AWS Regions, and SMS text messages cannot be sent to some countries/regions. +// For more information, see Notifications in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-notifications). +// +// A verification request is sent to the contact method when you initially create +// it. Use this action to send another verification request if a previous verification +// request was deleted, or has expired. +// +// Notifications are not sent to an email contact method until after it is verified, +// and confirmed as valid. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 SendContactMethodVerification for usage and error information. +// +// Returned Error Types: +// * ServiceException +// A general service exception. +// +// * InvalidInputException +// Lightsail throws this exception when user input does not conform to the validation +// rules of an input field. +// +// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. +// Please set your AWS Region configuration to us-east-1 to create, view, or +// edit these resources. +// +// * OperationFailureException +// Lightsail throws this exception when an operation fails to execute. +// +// * UnauthenticatedException +// Lightsail throws this exception when the user has not been authenticated. +// +// * AccessDeniedException +// Lightsail throws this exception when the user cannot be authenticated or +// uses invalid credentials to access a resource. +// +// * NotFoundException +// Lightsail throws this exception when it cannot find a resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/SendContactMethodVerification +func (c *Lightsail) SendContactMethodVerification(input *SendContactMethodVerificationInput) (*SendContactMethodVerificationOutput, error) { + req, out := c.SendContactMethodVerificationRequest(input) + return out, req.Send() +} + +// SendContactMethodVerificationWithContext is the same as SendContactMethodVerification with the addition of +// the ability to pass a context and additional request options. +// +// See SendContactMethodVerification for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) SendContactMethodVerificationWithContext(ctx aws.Context, input *SendContactMethodVerificationInput, opts ...request.Option) (*SendContactMethodVerificationOutput, error) { + req, out := c.SendContactMethodVerificationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartInstance = "StartInstance" + +// StartInstanceRequest generates a "aws/request.Request" representing the +// client's request for the StartInstance operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartInstance for more information on using the StartInstance +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartInstanceRequest method. +// req, resp := client.StartInstanceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, 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. @@ -10161,11 +10907,11 @@ func (c *Lightsail) StartInstanceRequest(input *StartInstanceInput) (req *reques // See the AWS API reference guide for Amazon Lightsail's // API operation StartInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -10173,21 +10919,21 @@ func (c *Lightsail) StartInstanceRequest(input *StartInstanceInput) (req *reques // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartInstance @@ -10270,11 +11016,11 @@ func (c *Lightsail) StartRelationalDatabaseRequest(input *StartRelationalDatabas // See the AWS API reference guide for Amazon Lightsail's // API operation StartRelationalDatabase for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -10282,21 +11028,21 @@ func (c *Lightsail) StartRelationalDatabaseRequest(input *StartRelationalDatabas // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StartRelationalDatabase @@ -10383,11 +11129,11 @@ func (c *Lightsail) StopInstanceRequest(input *StopInstanceInput) (req *request. // See the AWS API reference guide for Amazon Lightsail's // API operation StopInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -10395,21 +11141,21 @@ func (c *Lightsail) StopInstanceRequest(input *StopInstanceInput) (req *request. // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StopInstance @@ -10491,11 +11237,11 @@ func (c *Lightsail) StopRelationalDatabaseRequest(input *StopRelationalDatabaseI // See the AWS API reference guide for Amazon Lightsail's // API operation StopRelationalDatabase for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -10503,21 +11249,21 @@ func (c *Lightsail) StopRelationalDatabaseRequest(input *StopRelationalDatabaseI // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/StopRelationalDatabase @@ -10602,11 +11348,11 @@ func (c *Lightsail) TagResourceRequest(input *TagResourceInput) (req *request.Re // See the AWS API reference guide for Amazon Lightsail's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -10614,21 +11360,21 @@ func (c *Lightsail) TagResourceRequest(input *TagResourceInput) (req *request.Re // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/TagResource @@ -10653,6 +11399,114 @@ func (c *Lightsail) TagResourceWithContext(ctx aws.Context, input *TagResourceIn return out, req.Send() } +const opTestAlarm = "TestAlarm" + +// TestAlarmRequest generates a "aws/request.Request" representing the +// client's request for the TestAlarm operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TestAlarm for more information on using the TestAlarm +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TestAlarmRequest method. +// req, resp := client.TestAlarmRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/TestAlarm +func (c *Lightsail) TestAlarmRequest(input *TestAlarmInput) (req *request.Request, output *TestAlarmOutput) { + op := &request.Operation{ + Name: opTestAlarm, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &TestAlarmInput{} + } + + output = &TestAlarmOutput{} + req = c.newRequest(op, input, output) + return +} + +// TestAlarm API operation for Amazon Lightsail. +// +// Tests an alarm by displaying a banner on the Amazon Lightsail console. If +// a notification trigger is configured for the specified alarm, the test also +// sends a notification to the notification protocol (Email and/or SMS) configured +// for the alarm. +// +// An alarm is used to monitor a single metric for one of your resources. When +// a metric condition is met, the alarm can notify you by email, SMS text message, +// and a banner displayed on the Amazon Lightsail console. For more information, +// see Alarms in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-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 Lightsail's +// API operation TestAlarm for usage and error information. +// +// Returned Error Types: +// * ServiceException +// A general service exception. +// +// * InvalidInputException +// Lightsail throws this exception when user input does not conform to the validation +// rules of an input field. +// +// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. +// Please set your AWS Region configuration to us-east-1 to create, view, or +// edit these resources. +// +// * OperationFailureException +// Lightsail throws this exception when an operation fails to execute. +// +// * UnauthenticatedException +// Lightsail throws this exception when the user has not been authenticated. +// +// * AccessDeniedException +// Lightsail throws this exception when the user cannot be authenticated or +// uses invalid credentials to access a resource. +// +// * NotFoundException +// Lightsail throws this exception when it cannot find a resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/TestAlarm +func (c *Lightsail) TestAlarm(input *TestAlarmInput) (*TestAlarmOutput, error) { + req, out := c.TestAlarmRequest(input) + return out, req.Send() +} + +// TestAlarmWithContext is the same as TestAlarm with the addition of +// the ability to pass a context and additional request options. +// +// See TestAlarm for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Lightsail) TestAlarmWithContext(ctx aws.Context, input *TestAlarmInput, opts ...request.Option) (*TestAlarmOutput, error) { + req, out := c.TestAlarmRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opUnpeerVpc = "UnpeerVpc" // UnpeerVpcRequest generates a "aws/request.Request" representing the @@ -10706,11 +11560,11 @@ func (c *Lightsail) UnpeerVpcRequest(input *UnpeerVpcInput) (req *request.Reques // See the AWS API reference guide for Amazon Lightsail's // API operation UnpeerVpc for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -10718,21 +11572,21 @@ func (c *Lightsail) UnpeerVpcRequest(input *UnpeerVpcInput) (req *request.Reques // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UnpeerVpc @@ -10815,11 +11669,11 @@ func (c *Lightsail) UntagResourceRequest(input *UntagResourceInput) (req *reques // See the AWS API reference guide for Amazon Lightsail's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -10827,21 +11681,21 @@ func (c *Lightsail) UntagResourceRequest(input *UntagResourceInput) (req *reques // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UntagResource @@ -10923,11 +11777,11 @@ func (c *Lightsail) UpdateDomainEntryRequest(input *UpdateDomainEntryInput) (req // See the AWS API reference guide for Amazon Lightsail's // API operation UpdateDomainEntry for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -10935,21 +11789,21 @@ func (c *Lightsail) UpdateDomainEntryRequest(input *UpdateDomainEntryInput) (req // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateDomainEntry @@ -11032,11 +11886,11 @@ func (c *Lightsail) UpdateLoadBalancerAttributeRequest(input *UpdateLoadBalancer // See the AWS API reference guide for Amazon Lightsail's // API operation UpdateLoadBalancerAttribute for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -11044,21 +11898,21 @@ func (c *Lightsail) UpdateLoadBalancerAttributeRequest(input *UpdateLoadBalancer // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateLoadBalancerAttribute @@ -11143,11 +11997,11 @@ func (c *Lightsail) UpdateRelationalDatabaseRequest(input *UpdateRelationalDatab // See the AWS API reference guide for Amazon Lightsail's // API operation UpdateRelationalDatabase for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -11155,21 +12009,21 @@ func (c *Lightsail) UpdateRelationalDatabaseRequest(input *UpdateRelationalDatab // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateRelationalDatabase @@ -11242,7 +12096,7 @@ func (c *Lightsail) UpdateRelationalDatabaseParametersRequest(input *UpdateRelat // // Parameter updates don't cause outages; therefore, their application is not // subject to the preferred maintenance window. However, there are two ways -// in which paramater updates are applied: dynamic or pending-reboot. Parameters +// in which parameter updates are applied: dynamic or pending-reboot. Parameters // marked with a dynamic apply type are applied immediately. Parameters marked // with a pending-reboot apply type are applied only after the database is rebooted // using the reboot relational database operation. @@ -11258,11 +12112,11 @@ func (c *Lightsail) UpdateRelationalDatabaseParametersRequest(input *UpdateRelat // See the AWS API reference guide for Amazon Lightsail's // API operation UpdateRelationalDatabaseParameters for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceException "ServiceException" +// Returned Error Types: +// * ServiceException // A general service exception. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // Lightsail throws this exception when user input does not conform to the validation // rules of an input field. // @@ -11270,21 +12124,21 @@ func (c *Lightsail) UpdateRelationalDatabaseParametersRequest(input *UpdateRelat // Please set your AWS Region configuration to us-east-1 to create, view, or // edit these resources. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Lightsail throws this exception when it cannot find a resource. // -// * ErrCodeOperationFailureException "OperationFailureException" +// * OperationFailureException // Lightsail throws this exception when an operation fails to execute. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Lightsail throws this exception when the user cannot be authenticated or // uses invalid credentials to access a resource. // -// * ErrCodeAccountSetupInProgressException "AccountSetupInProgressException" +// * AccountSetupInProgressException // Lightsail throws this exception when an account is still in the setup in // progress state. // -// * ErrCodeUnauthenticatedException "UnauthenticatedException" +// * UnauthenticatedException // Lightsail throws this exception when the user has not been authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/lightsail-2016-11-28/UpdateRelationalDatabaseParameters @@ -11309,6 +12163,132 @@ func (c *Lightsail) UpdateRelationalDatabaseParametersWithContext(ctx aws.Contex return out, req.Send() } +// Lightsail throws this exception when the user cannot be authenticated or +// uses invalid credentials to access a resource. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"code" type:"string"` + + Docs *string `locationName:"docs" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + Tip *string `locationName:"tip" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Lightsail throws this exception when an account is still in the setup in +// progress state. +type AccountSetupInProgressException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"code" type:"string"` + + Docs *string `locationName:"docs" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + Tip *string `locationName:"tip" type:"string"` +} + +// String returns the string representation +func (s AccountSetupInProgressException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountSetupInProgressException) GoString() string { + return s.String() +} + +func newErrorAccountSetupInProgressException(v protocol.ResponseMetadata) error { + return &AccountSetupInProgressException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccountSetupInProgressException) Code() string { + return "AccountSetupInProgressException" +} + +// Message returns the exception's message. +func (s AccountSetupInProgressException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccountSetupInProgressException) OrigErr() error { + return nil +} + +func (s AccountSetupInProgressException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccountSetupInProgressException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccountSetupInProgressException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes an add-on that is enabled for an Amazon Lightsail resource. type AddOn struct { _ struct{} `type:"structure"` @@ -11423,6 +12403,252 @@ func (s *AddOnRequest) SetAutoSnapshotAddOnRequest(v *AutoSnapshotAddOnRequest) return s } +// Describes an alarm. +// +// An alarm is a way to monitor your Amazon Lightsail resource metrics. For +// more information, see Alarms in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-alarms). +type Alarm struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the alarm. + Arn *string `locationName:"arn" type:"string"` + + // The arithmetic operation used when comparing the specified statistic and + // threshold. + ComparisonOperator *string `locationName:"comparisonOperator" type:"string" enum:"ComparisonOperator"` + + // The contact protocols for the alarm, such as Email, SMS (text messaging), + // or both. + ContactProtocols []*string `locationName:"contactProtocols" type:"list"` + + // The timestamp when the alarm was created. + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` + + // The number of data points that must not within the specified threshold to + // trigger the alarm. + DatapointsToAlarm *int64 `locationName:"datapointsToAlarm" type:"integer"` + + // The number of periods over which data is compared to the specified threshold. + EvaluationPeriods *int64 `locationName:"evaluationPeriods" type:"integer"` + + // An object that lists information about the location of the alarm. + Location *ResourceLocation `locationName:"location" type:"structure"` + + // The name of the metric associated with the alarm. + MetricName *string `locationName:"metricName" type:"string" enum:"MetricName"` + + // An object that lists information about the resource monitored by the alarm. + MonitoredResourceInfo *MonitoredResourceInfo `locationName:"monitoredResourceInfo" type:"structure"` + + // The name of the alarm. + Name *string `locationName:"name" type:"string"` + + // Indicates whether the alarm is enabled. + NotificationEnabled *bool `locationName:"notificationEnabled" type:"boolean"` + + // The alarm states that trigger a notification. + NotificationTriggers []*string `locationName:"notificationTriggers" type:"list"` + + // The period, in seconds, over which the statistic is applied. + Period *int64 `locationName:"period" min:"60" type:"integer"` + + // The Lightsail resource type (e.g., Alarm). + ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` + + // The current state of the alarm. + // + // An alarm has the following possible states: + // + // * ALARM — The metric is outside of the defined threshold. + // + // * INSUFFICIENT_DATA — The alarm has just started, the metric is not + // available, or not enough data is available for the metric to determine + // the alarm state. + // + // * OK — The metric is within the defined threshold. + State *string `locationName:"state" type:"string" enum:"AlarmState"` + + // The statistic for the metric associated with the alarm. + // + // The following statistics are available: + // + // * Minimum — The lowest value observed during the specified period. Use + // this value to determine low volumes of activity for your application. + // + // * Maximum — The highest value observed during the specified period. + // Use this value to determine high volumes of activity for your application. + // + // * Sum — All values submitted for the matching metric added together. + // You can use this statistic to determine the total volume of a metric. + // + // * Average — The value of Sum / SampleCount during the specified period. + // By comparing this statistic with the Minimum and Maximum values, you can + // determine the full scope of a metric and how close the average use is + // to the Minimum and Maximum values. This comparison helps you to know when + // to increase or decrease your resources. + // + // * SampleCount — The count, or number, of data points used for the statistical + // calculation. + Statistic *string `locationName:"statistic" type:"string" enum:"MetricStatistic"` + + // The support code. Include this code in your email to support when you have + // questions about your Lightsail alarm. This code enables our support team + // to look up your Lightsail information more easily. + SupportCode *string `locationName:"supportCode" type:"string"` + + // The value against which the specified statistic is compared. + Threshold *float64 `locationName:"threshold" type:"double"` + + // Specifies how the alarm handles missing data points. + // + // An alarm can treat missing data in the following ways: + // + // * breaching — Assume the missing data is not within the threshold. Missing + // data counts towards the number of times the metric is not within the threshold. + // + // * notBreaching — Assume the missing data is within the threshold. Missing + // data does not count towards the number of times the metric is not within + // the threshold. + // + // * ignore — Ignore the missing data. Maintains the current alarm state. + // + // * missing — Missing data is treated as missing. + TreatMissingData *string `locationName:"treatMissingData" type:"string" enum:"TreatMissingData"` + + // The unit of the metric associated with the alarm. + Unit *string `locationName:"unit" type:"string" enum:"MetricUnit"` +} + +// 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() +} + +// SetArn sets the Arn field's value. +func (s *Alarm) SetArn(v string) *Alarm { + s.Arn = &v + return s +} + +// SetComparisonOperator sets the ComparisonOperator field's value. +func (s *Alarm) SetComparisonOperator(v string) *Alarm { + s.ComparisonOperator = &v + return s +} + +// SetContactProtocols sets the ContactProtocols field's value. +func (s *Alarm) SetContactProtocols(v []*string) *Alarm { + s.ContactProtocols = v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *Alarm) SetCreatedAt(v time.Time) *Alarm { + s.CreatedAt = &v + return s +} + +// SetDatapointsToAlarm sets the DatapointsToAlarm field's value. +func (s *Alarm) SetDatapointsToAlarm(v int64) *Alarm { + s.DatapointsToAlarm = &v + return s +} + +// SetEvaluationPeriods sets the EvaluationPeriods field's value. +func (s *Alarm) SetEvaluationPeriods(v int64) *Alarm { + s.EvaluationPeriods = &v + return s +} + +// SetLocation sets the Location field's value. +func (s *Alarm) SetLocation(v *ResourceLocation) *Alarm { + s.Location = v + return s +} + +// SetMetricName sets the MetricName field's value. +func (s *Alarm) SetMetricName(v string) *Alarm { + s.MetricName = &v + return s +} + +// SetMonitoredResourceInfo sets the MonitoredResourceInfo field's value. +func (s *Alarm) SetMonitoredResourceInfo(v *MonitoredResourceInfo) *Alarm { + s.MonitoredResourceInfo = v + return s +} + +// SetName sets the Name field's value. +func (s *Alarm) SetName(v string) *Alarm { + s.Name = &v + return s +} + +// SetNotificationEnabled sets the NotificationEnabled field's value. +func (s *Alarm) SetNotificationEnabled(v bool) *Alarm { + s.NotificationEnabled = &v + return s +} + +// SetNotificationTriggers sets the NotificationTriggers field's value. +func (s *Alarm) SetNotificationTriggers(v []*string) *Alarm { + s.NotificationTriggers = v + return s +} + +// SetPeriod sets the Period field's value. +func (s *Alarm) SetPeriod(v int64) *Alarm { + s.Period = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *Alarm) SetResourceType(v string) *Alarm { + s.ResourceType = &v + return s +} + +// SetState sets the State field's value. +func (s *Alarm) SetState(v string) *Alarm { + s.State = &v + return s +} + +// SetStatistic sets the Statistic field's value. +func (s *Alarm) SetStatistic(v string) *Alarm { + s.Statistic = &v + return s +} + +// SetSupportCode sets the SupportCode field's value. +func (s *Alarm) SetSupportCode(v string) *Alarm { + s.SupportCode = &v + return s +} + +// SetThreshold sets the Threshold field's value. +func (s *Alarm) SetThreshold(v float64) *Alarm { + s.Threshold = &v + return s +} + +// SetTreatMissingData sets the TreatMissingData field's value. +func (s *Alarm) SetTreatMissingData(v string) *Alarm { + s.TreatMissingData = &v + return s +} + +// SetUnit sets the Unit field's value. +func (s *Alarm) SetUnit(v string) *Alarm { + s.Unit = &v + return s +} + type AllocateStaticIpInput struct { _ struct{} `type:"structure"` @@ -11464,8 +12690,9 @@ func (s *AllocateStaticIpInput) SetStaticIpName(v string) *AllocateStaticIpInput type AllocateStaticIpOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the static IP address - // you allocated. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -11555,7 +12782,9 @@ func (s *AttachDiskInput) SetInstanceName(v string) *AttachDiskInput { type AttachDiskOutput struct { _ struct{} `type:"structure"` - // An object describing the API operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -11637,7 +12866,9 @@ func (s *AttachInstancesToLoadBalancerInput) SetLoadBalancerName(v string) *Atta type AttachInstancesToLoadBalancerOutput struct { _ struct{} `type:"structure"` - // An object representing the API operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -11713,7 +12944,9 @@ func (s *AttachLoadBalancerTlsCertificateInput) SetLoadBalancerName(v string) *A type AttachLoadBalancerTlsCertificateOutput struct { _ struct{} `type:"structure"` - // An object representing the API operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. // // These SSL/TLS certificates are only usable by Lightsail load balancers. You // can't get the certificate and use it for another purpose. @@ -11791,7 +13024,9 @@ func (s *AttachStaticIpInput) SetStaticIpName(v string) *AttachStaticIpInput { type AttachStaticIpOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about your API operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -12301,7 +13536,9 @@ func (s *CloseInstancePublicPortsInput) SetPortInfo(v *PortInfo) *CloseInstanceP type CloseInstancePublicPortsOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs that contains information about the operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operation *Operation `locationName:"operation" type:"structure"` } @@ -12453,19 +13690,129 @@ func (s *CloudFormationStackRecordSourceInfo) SetName(v string) *CloudFormationS return s } -// SetResourceType sets the ResourceType field's value. -func (s *CloudFormationStackRecordSourceInfo) SetResourceType(v string) *CloudFormationStackRecordSourceInfo { - s.ResourceType = &v +// SetResourceType sets the ResourceType field's value. +func (s *CloudFormationStackRecordSourceInfo) SetResourceType(v string) *CloudFormationStackRecordSourceInfo { + s.ResourceType = &v + return s +} + +// Describes a contact method. +// +// A contact method is a way to send you notifications. For more information, +// see Notifications in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-notifications). +type ContactMethod struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the contact method. + Arn *string `locationName:"arn" type:"string"` + + // The destination of the contact method, such as an email address or a mobile + // phone number. + ContactEndpoint *string `locationName:"contactEndpoint" type:"string"` + + // The timestamp when the contact method was created. + CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` + + // Describes the resource location. + Location *ResourceLocation `locationName:"location" type:"structure"` + + // The name of the contact method. + Name *string `locationName:"name" type:"string"` + + // The protocol of the contact method, such as email or SMS (text messaging). + Protocol *string `locationName:"protocol" type:"string" enum:"ContactProtocol"` + + // The Lightsail resource type (e.g., ContactMethod). + ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` + + // The current status of the contact method. + // + // A contact method has the following possible status: + // + // * PendingVerification — The contact method has not yet been verified, + // and the verification has not yet expired. + // + // * Valid — The contact method has been verified. + // + // * InValid — An attempt was made to verify the contact method, but the + // verification has expired. + Status *string `locationName:"status" type:"string" enum:"ContactMethodStatus"` + + // The support code. Include this code in your email to support when you have + // questions about your Lightsail contact method. 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 ContactMethod) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ContactMethod) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *ContactMethod) SetArn(v string) *ContactMethod { + s.Arn = &v + return s +} + +// SetContactEndpoint sets the ContactEndpoint field's value. +func (s *ContactMethod) SetContactEndpoint(v string) *ContactMethod { + s.ContactEndpoint = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *ContactMethod) SetCreatedAt(v time.Time) *ContactMethod { + s.CreatedAt = &v + return s +} + +// SetLocation sets the Location field's value. +func (s *ContactMethod) SetLocation(v *ResourceLocation) *ContactMethod { + s.Location = v + return s +} + +// SetName sets the Name field's value. +func (s *ContactMethod) SetName(v string) *ContactMethod { + s.Name = &v + return s +} + +// SetProtocol sets the Protocol field's value. +func (s *ContactMethod) SetProtocol(v string) *ContactMethod { + s.Protocol = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ContactMethod) SetResourceType(v string) *ContactMethod { + s.ResourceType = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ContactMethod) SetStatus(v string) *ContactMethod { + s.Status = &v + return s +} + +// SetSupportCode sets the SupportCode field's value. +func (s *ContactMethod) SetSupportCode(v string) *ContactMethod { + s.SupportCode = &v return s } type CopySnapshotInput struct { _ struct{} `type:"structure"` - // The date of the automatic snapshot to copy for the new manual snapshot. - // - // Use the get auto snapshots operation to identify the dates of the available - // automatic snapshots. + // The date of the source automatic snapshot to copy. Use the get auto snapshots + // operation to identify the dates of the available automatic snapshots. // // Constraints: // @@ -12475,8 +13822,8 @@ type CopySnapshotInput struct { // auto snapshot parameter. The restore date and use latest restorable auto // snapshot parameters are mutually exclusive. // - // Define this parameter only when copying an automatic snapshot as a manual - // snapshot. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). + // * Define this parameter only when copying an automatic snapshot as a manual + // snapshot. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots). RestoreDate *string `locationName:"restoreDate" type:"string"` // The AWS Region where the source manual or automatic snapshot is located. @@ -12484,32 +13831,39 @@ type CopySnapshotInput struct { // SourceRegion is a required field SourceRegion *string `locationName:"sourceRegion" type:"string" required:"true" enum:"RegionName"` - // The name of the source resource from which the automatic snapshot was created. + // The name of the source instance or disk from which the source automatic snapshot + // was created. // - // Define this parameter only when copying an automatic snapshot as a manual - // snapshot. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). + // Constraint: + // + // * Define this parameter only when copying an automatic snapshot as a manual + // snapshot. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots). SourceResourceName *string `locationName:"sourceResourceName" type:"string"` - // The name of the source instance or disk snapshot to be copied. + // The name of the source manual snapshot to copy. // - // Define this parameter only when copying a manual snapshot as another manual - // snapshot. + // Constraint: + // + // * Define this parameter only when copying a manual snapshot as another + // manual snapshot. SourceSnapshotName *string `locationName:"sourceSnapshotName" type:"string"` - // The name of the new instance or disk snapshot to be created as a copy. + // The name of the new manual snapshot to be created as a copy. // // TargetSnapshotName is a required field TargetSnapshotName *string `locationName:"targetSnapshotName" type:"string" required:"true"` // A Boolean value to indicate whether to use the latest available automatic - // snapshot. + // snapshot of the specified source instance or disk. + // + // Constraints: // - // This parameter cannot be defined together with the restore date parameter. - // The use latest restorable auto snapshot and restore date parameters are mutually - // exclusive. + // * This parameter cannot be defined together with the restore date parameter. + // The use latest restorable auto snapshot and restore date parameters are + // mutually exclusive. // - // Define this parameter only when copying an automatic snapshot as a manual - // snapshot. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). + // * Define this parameter only when copying an automatic snapshot as a manual + // snapshot. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-keeping-automatic-snapshots). UseLatestRestorableAutoSnapshot *bool `locationName:"useLatestRestorableAutoSnapshot" type:"boolean"` } @@ -12578,7 +13932,9 @@ func (s *CopySnapshotInput) SetUseLatestRestorableAutoSnapshot(v bool) *CopySnap type CopySnapshotOutput struct { _ struct{} `type:"structure"` - // A list of objects describing the API operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -12652,7 +14008,9 @@ func (s *CreateCloudFormationStackInput) SetInstances(v []*InstanceEntry) *Creat type CreateCloudFormationStackOutput struct { _ struct{} `type:"structure"` - // A list of objects describing the API operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -12672,6 +14030,116 @@ func (s *CreateCloudFormationStackOutput) SetOperations(v []*Operation) *CreateC return s } +type CreateContactMethodInput struct { + _ struct{} `type:"structure"` + + // The destination of the contact method, such as an email address or a mobile + // phone number. + // + // Use the E.164 format when specifying a mobile phone number. E.164 is a standard + // for the phone number structure used for international telecommunication. + // Phone numbers that follow this format can have a maximum of 15 digits, and + // they are prefixed with the plus character (+) and the country code. For example, + // a U.S. phone number in E.164 format would be specified as +1XXX5550100. For + // more information, see E.164 (https://en.wikipedia.org/wiki/E.164) in Wikipedia. + // + // ContactEndpoint is a required field + ContactEndpoint *string `locationName:"contactEndpoint" min:"1" type:"string" required:"true"` + + // The protocol of the contact method, such as Email or SMS (text messaging). + // + // The SMS protocol is supported only in the following AWS Regions. + // + // * US East (N. Virginia) (us-east-1) + // + // * US West (Oregon) (us-west-2) + // + // * Europe (Ireland) (eu-west-1) + // + // * Asia Pacific (Tokyo) (ap-northeast-1) + // + // * Asia Pacific (Singapore) (ap-southeast-1) + // + // * Asia Pacific (Sydney) (ap-southeast-2) + // + // For a list of countries/regions where SMS text messages can be sent, and + // the latest AWS Regions where SMS text messaging is supported, see Supported + // Regions and Countries (https://docs.aws.amazon.com/sns/latest/dg/sns-supported-regions-countries.html) + // in the Amazon SNS Developer Guide. + // + // For more information about notifications in Amazon Lightsail, see Notifications + // in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-notifications). + // + // Protocol is a required field + Protocol *string `locationName:"protocol" type:"string" required:"true" enum:"ContactProtocol"` +} + +// String returns the string representation +func (s CreateContactMethodInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateContactMethodInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateContactMethodInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateContactMethodInput"} + if s.ContactEndpoint == nil { + invalidParams.Add(request.NewErrParamRequired("ContactEndpoint")) + } + if s.ContactEndpoint != nil && len(*s.ContactEndpoint) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ContactEndpoint", 1)) + } + if s.Protocol == nil { + invalidParams.Add(request.NewErrParamRequired("Protocol")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetContactEndpoint sets the ContactEndpoint field's value. +func (s *CreateContactMethodInput) SetContactEndpoint(v string) *CreateContactMethodInput { + s.ContactEndpoint = &v + return s +} + +// SetProtocol sets the Protocol field's value. +func (s *CreateContactMethodInput) SetProtocol(v string) *CreateContactMethodInput { + s.Protocol = &v + return s +} + +type CreateContactMethodOutput struct { + _ struct{} `type:"structure"` + + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. + Operations []*Operation `locationName:"operations" type:"list"` +} + +// String returns the string representation +func (s CreateContactMethodOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateContactMethodOutput) GoString() string { + return s.String() +} + +// SetOperations sets the Operations field's value. +func (s *CreateContactMethodOutput) SetOperations(v []*Operation) *CreateContactMethodOutput { + s.Operations = v + return s +} + type CreateDiskFromSnapshotInput struct { _ struct{} `type:"structure"` @@ -12696,14 +14164,15 @@ type CreateDiskFromSnapshotInput struct { // The name of the disk snapshot (e.g., my-snapshot) from which to create the // new storage disk. // - // This parameter cannot be defined together with the source disk name parameter. - // The disk snapshot name and source disk name parameters are mutually exclusive. + // Constraint: + // + // * This parameter cannot be defined together with the source disk name + // parameter. The disk snapshot name and source disk name parameters are + // mutually exclusive. DiskSnapshotName *string `locationName:"diskSnapshotName" type:"string"` - // The date of the automatic snapshot to use for the new disk. - // - // Use the get auto snapshots operation to identify the dates of the available - // automatic snapshots. + // The date of the automatic snapshot to use for the new disk. Use the get auto + // snapshots operation to identify the dates of the available automatic snapshots. // // Constraints: // @@ -12713,8 +14182,8 @@ type CreateDiskFromSnapshotInput struct { // auto snapshot parameter. The restore date and use latest restorable auto // snapshot parameters are mutually exclusive. // - // Define this parameter only when creating a new disk from an automatic snapshot. - // For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). + // * Define this parameter only when creating a new disk from an automatic + // snapshot. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). RestoreDate *string `locationName:"restoreDate" type:"string"` // The size of the disk in GB (e.g., 32). @@ -12725,11 +14194,14 @@ type CreateDiskFromSnapshotInput struct { // The name of the source disk from which the source automatic snapshot was // created. // - // This parameter cannot be defined together with the disk snapshot name parameter. - // The source disk name and disk snapshot name parameters are mutually exclusive. + // Constraints: + // + // * This parameter cannot be defined together with the disk snapshot name + // parameter. The source disk name and disk snapshot name parameters are + // mutually exclusive. // - // Define this parameter only when creating a new disk from an automatic snapshot. - // For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). + // * Define this parameter only when creating a new disk from an automatic + // snapshot. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). SourceDiskName *string `locationName:"sourceDiskName" type:"string"` // The tag keys and optional values to add to the resource during create. @@ -12740,12 +14212,14 @@ type CreateDiskFromSnapshotInput struct { // A Boolean value to indicate whether to use the latest available automatic // snapshot. // - // This parameter cannot be defined together with the restore date parameter. - // The use latest restorable auto snapshot and restore date parameters are mutually - // exclusive. + // Constraints: + // + // * This parameter cannot be defined together with the restore date parameter. + // The use latest restorable auto snapshot and restore date parameters are + // mutually exclusive. // - // Define this parameter only when creating a new disk from an automatic snapshot. - // For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). + // * Define this parameter only when creating a new disk from an automatic + // snapshot. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). UseLatestRestorableAutoSnapshot *bool `locationName:"useLatestRestorableAutoSnapshot" type:"boolean"` } @@ -12845,7 +14319,9 @@ func (s *CreateDiskFromSnapshotInput) SetUseLatestRestorableAutoSnapshot(v bool) type CreateDiskFromSnapshotOutput struct { _ struct{} `type:"structure"` - // An object describing the API operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -12969,7 +14445,9 @@ func (s *CreateDiskInput) SetTags(v []*Tag) *CreateDiskInput { type CreateDiskOutput struct { _ struct{} `type:"structure"` - // An object describing the API operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -13067,7 +14545,9 @@ func (s *CreateDiskSnapshotInput) SetTags(v []*Tag) *CreateDiskSnapshotInput { type CreateDiskSnapshotOutput struct { _ struct{} `type:"structure"` - // An object describing the API operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -13144,7 +14624,9 @@ func (s *CreateDomainEntryInput) SetDomainName(v string) *CreateDomainEntryInput type CreateDomainEntryOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operation *Operation `locationName:"operation" type:"structure"` } @@ -13221,8 +14703,9 @@ func (s *CreateDomainInput) SetTags(v []*Tag) *CreateDomainInput { type CreateDomainOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the domain resource - // you created. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operation *Operation `locationName:"operation" type:"structure"` } @@ -13308,8 +14791,9 @@ func (s *CreateInstanceSnapshotInput) SetTags(v []*Tag) *CreateInstanceSnapshotI type CreateInstanceSnapshotOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the results of your - // create instances snapshot request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -13362,18 +14846,19 @@ type CreateInstancesFromSnapshotInput struct { // Use the get instance snapshots operation to return information about your // existing snapshots. // - // This parameter cannot be defined together with the source instance name parameter. - // The instance snapshot name and source instance name parameters are mutually - // exclusive. + // Constraint: + // + // * This parameter cannot be defined together with the source instance name + // parameter. The instance snapshot name and source instance name parameters + // are mutually exclusive. InstanceSnapshotName *string `locationName:"instanceSnapshotName" type:"string"` // The name for your key pair. KeyPairName *string `locationName:"keyPairName" type:"string"` - // The date of the automatic snapshot to use for the new instance. - // - // Use the get auto snapshots operation to identify the dates of the available - // automatic snapshots. + // The date of the automatic snapshot to use for the new instance. Use the get + // auto snapshots operation to identify the dates of the available automatic + // snapshots. // // Constraints: // @@ -13383,19 +14868,21 @@ type CreateInstancesFromSnapshotInput struct { // auto snapshot parameter. The restore date and use latest restorable auto // snapshot parameters are mutually exclusive. // - // Define this parameter only when creating a new instance from an automatic - // snapshot. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). + // * Define this parameter only when creating a new instance from an automatic + // snapshot. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). RestoreDate *string `locationName:"restoreDate" type:"string"` // The name of the source instance from which the source automatic snapshot // was created. // - // This parameter cannot be defined together with the instance snapshot name - // parameter. The source instance name and instance snapshot name parameters - // are mutually exclusive. + // Constraints: + // + // * This parameter cannot be defined together with the instance snapshot + // name parameter. The source instance name and instance snapshot name parameters + // are mutually exclusive. // - // Define this parameter only when creating a new instance from an automatic - // snapshot. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). + // * Define this parameter only when creating a new instance from an automatic + // snapshot. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). SourceInstanceName *string `locationName:"sourceInstanceName" type:"string"` // The tag keys and optional values to add to the resource during create. @@ -13406,12 +14893,14 @@ type CreateInstancesFromSnapshotInput struct { // A Boolean value to indicate whether to use the latest available automatic // snapshot. // - // This parameter cannot be defined together with the restore date parameter. - // The use latest restorable auto snapshot and restore date parameters are mutually - // exclusive. + // Constraints: + // + // * This parameter cannot be defined together with the restore date parameter. + // The use latest restorable auto snapshot and restore date parameters are + // mutually exclusive. // - // Define this parameter only when creating a new instance from an automatic - // snapshot. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). + // * Define this parameter only when creating a new instance from an automatic + // snapshot. For more information, see the Lightsail Dev Guide (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-configuring-automatic-snapshots). UseLatestRestorableAutoSnapshot *bool `locationName:"useLatestRestorableAutoSnapshot" type:"boolean"` // You can create a launch script that configures a server with additional user @@ -13538,8 +15027,9 @@ func (s *CreateInstancesFromSnapshotInput) SetUserData(v string) *CreateInstance type CreateInstancesFromSnapshotOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the results of your - // create instances from snapshot request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -13723,8 +15213,9 @@ func (s *CreateInstancesInput) SetUserData(v string) *CreateInstancesInput { type CreateInstancesOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the results of your - // create instances request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -13800,8 +15291,9 @@ type CreateKeyPairOutput struct { // 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. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operation *Operation `locationName:"operation" type:"structure"` // A base64-encoded RSA private key. @@ -13960,7 +15452,9 @@ func (s *CreateLoadBalancerInput) SetTags(v []*Tag) *CreateLoadBalancerInput { type CreateLoadBalancerOutput struct { _ struct{} `type:"structure"` - // An object containing information about the API operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -14077,7 +15571,9 @@ func (s *CreateLoadBalancerTlsCertificateInput) SetTags(v []*Tag) *CreateLoadBal type CreateLoadBalancerTlsCertificateOutput struct { _ struct{} `type:"structure"` - // An object containing information about the API operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -14250,8 +15746,9 @@ func (s *CreateRelationalDatabaseFromSnapshotInput) SetUseLatestRestorableTime(v type CreateRelationalDatabaseFromSnapshotOutput struct { _ struct{} `type:"structure"` - // An object describing the result of your create relational database from snapshot - // request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -14501,7 +15998,9 @@ func (s *CreateRelationalDatabaseInput) SetTags(v []*Tag) *CreateRelationalDatab type CreateRelationalDatabaseOutput struct { _ struct{} `type:"structure"` - // An object describing the result of your create relational database request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -14593,8 +16092,9 @@ func (s *CreateRelationalDatabaseSnapshotInput) SetTags(v []*Tag) *CreateRelatio type CreateRelationalDatabaseSnapshotOutput struct { _ struct{} `type:"structure"` - // An object describing the result of your create relational database snapshot - // request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -14614,18 +16114,81 @@ func (s *CreateRelationalDatabaseSnapshotOutput) SetOperations(v []*Operation) * return s } -type DeleteAutoSnapshotInput struct { +type DeleteAlarmInput struct { _ struct{} `type:"structure"` - // The date of the automatic snapshot to delete in YYYY-MM-DD format. + // The name of the alarm to delete. // - // Use the get auto snapshots operation to get the available automatic snapshots - // for a resource. + // AlarmName is a required field + AlarmName *string `locationName:"alarmName" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteAlarmInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAlarmInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteAlarmInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteAlarmInput"} + if s.AlarmName == nil { + invalidParams.Add(request.NewErrParamRequired("AlarmName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAlarmName sets the AlarmName field's value. +func (s *DeleteAlarmInput) SetAlarmName(v string) *DeleteAlarmInput { + s.AlarmName = &v + return s +} + +type DeleteAlarmOutput struct { + _ struct{} `type:"structure"` + + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. + Operations []*Operation `locationName:"operations" type:"list"` +} + +// String returns the string representation +func (s DeleteAlarmOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAlarmOutput) GoString() string { + return s.String() +} + +// SetOperations sets the Operations field's value. +func (s *DeleteAlarmOutput) SetOperations(v []*Operation) *DeleteAlarmOutput { + s.Operations = v + return s +} + +type DeleteAutoSnapshotInput struct { + _ struct{} `type:"structure"` + + // The date of the automatic snapshot to delete in YYYY-MM-DD format. Use the + // get auto snapshots operation to get the available automatic snapshots for + // a resource. // // Date is a required field Date *string `locationName:"date" type:"string" required:"true"` - // The name of the source resource from which to delete the automatic snapshot. + // The name of the source instance or disk from which to delete the automatic + // snapshot. // // ResourceName is a required field ResourceName *string `locationName:"resourceName" type:"string" required:"true"` @@ -14672,7 +16235,9 @@ func (s *DeleteAutoSnapshotInput) SetResourceName(v string) *DeleteAutoSnapshotI type DeleteAutoSnapshotOutput struct { _ struct{} `type:"structure"` - // An array of objects that describe the result of your request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -14692,6 +16257,72 @@ func (s *DeleteAutoSnapshotOutput) SetOperations(v []*Operation) *DeleteAutoSnap return s } +type DeleteContactMethodInput struct { + _ struct{} `type:"structure"` + + // The protocol that will be deleted, such as Email or SMS (text messaging). + // + // To delete an Email and an SMS contact method if you added both, you must + // run separate DeleteContactMethod actions to delete each protocol. + // + // Protocol is a required field + Protocol *string `locationName:"protocol" type:"string" required:"true" enum:"ContactProtocol"` +} + +// String returns the string representation +func (s DeleteContactMethodInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteContactMethodInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteContactMethodInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteContactMethodInput"} + if s.Protocol == nil { + invalidParams.Add(request.NewErrParamRequired("Protocol")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetProtocol sets the Protocol field's value. +func (s *DeleteContactMethodInput) SetProtocol(v string) *DeleteContactMethodInput { + s.Protocol = &v + return s +} + +type DeleteContactMethodOutput struct { + _ struct{} `type:"structure"` + + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. + Operations []*Operation `locationName:"operations" type:"list"` +} + +// String returns the string representation +func (s DeleteContactMethodOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteContactMethodOutput) GoString() string { + return s.String() +} + +// SetOperations sets the Operations field's value. +func (s *DeleteContactMethodOutput) SetOperations(v []*Operation) *DeleteContactMethodOutput { + s.Operations = v + return s +} + type DeleteDiskInput struct { _ struct{} `type:"structure"` @@ -14743,7 +16374,9 @@ func (s *DeleteDiskInput) SetForceDeleteAddOns(v bool) *DeleteDiskInput { type DeleteDiskOutput struct { _ struct{} `type:"structure"` - // An array of objects that describe the result of your request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -14804,7 +16437,9 @@ func (s *DeleteDiskSnapshotInput) SetDiskSnapshotName(v string) *DeleteDiskSnaps type DeleteDiskSnapshotOutput struct { _ struct{} `type:"structure"` - // An object describing the API operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -14879,8 +16514,9 @@ func (s *DeleteDomainEntryInput) SetDomainName(v string) *DeleteDomainEntryInput type DeleteDomainEntryOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the results of your - // delete domain entry request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operation *Operation `locationName:"operation" type:"structure"` } @@ -14941,8 +16577,9 @@ func (s *DeleteDomainInput) SetDomainName(v string) *DeleteDomainInput { type DeleteDomainOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the results of your - // delete domain request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operation *Operation `locationName:"operation" type:"structure"` } @@ -15013,8 +16650,9 @@ func (s *DeleteInstanceInput) SetInstanceName(v string) *DeleteInstanceInput { type DeleteInstanceOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the results of your - // delete instance request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -15075,8 +16713,9 @@ func (s *DeleteInstanceSnapshotInput) SetInstanceSnapshotName(v string) *DeleteI type DeleteInstanceSnapshotOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the results of your - // delete instance snapshot request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -15137,8 +16776,9 @@ func (s *DeleteKeyPairInput) SetKeyPairName(v string) *DeleteKeyPairInput { type DeleteKeyPairOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the results of your - // delete key pair request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operation *Operation `locationName:"operation" type:"structure"` } @@ -15199,7 +16839,9 @@ func (s *DeleteKnownHostKeysInput) SetInstanceName(v string) *DeleteKnownHostKey type DeleteKnownHostKeysOutput struct { _ struct{} `type:"structure"` - // A list of objects describing the API operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -15260,7 +16902,9 @@ func (s *DeleteLoadBalancerInput) SetLoadBalancerName(v string) *DeleteLoadBalan type DeleteLoadBalancerOutput struct { _ struct{} `type:"structure"` - // An object describing the API operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -15348,7 +16992,9 @@ func (s *DeleteLoadBalancerTlsCertificateInput) SetLoadBalancerName(v string) *D type DeleteLoadBalancerTlsCertificateOutput struct { _ struct{} `type:"structure"` - // An object describing the API operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -15444,7 +17090,9 @@ func (s *DeleteRelationalDatabaseInput) SetSkipFinalSnapshot(v bool) *DeleteRela type DeleteRelationalDatabaseOutput struct { _ struct{} `type:"structure"` - // An object describing the result of your delete relational database request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -15505,8 +17153,9 @@ func (s *DeleteRelationalDatabaseSnapshotInput) SetRelationalDatabaseSnapshotNam type DeleteRelationalDatabaseSnapshotOutput struct { _ struct{} `type:"structure"` - // An object describing the result of your delete relational database snapshot - // request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -15601,7 +17250,9 @@ func (s *DetachDiskInput) SetDiskName(v string) *DetachDiskInput { type DetachDiskOutput struct { _ struct{} `type:"structure"` - // An object describing the API operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -15677,7 +17328,9 @@ func (s *DetachInstancesFromLoadBalancerInput) SetLoadBalancerName(v string) *De type DetachInstancesFromLoadBalancerOutput struct { _ struct{} `type:"structure"` - // An object describing the API operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -15738,8 +17391,9 @@ func (s *DetachStaticIpInput) SetStaticIpName(v string) *DetachStaticIpInput { type DetachStaticIpOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the results of your - // detach static IP request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -15767,7 +17421,7 @@ type DisableAddOnInput struct { // AddOnType is a required field AddOnType *string `locationName:"addOnType" type:"string" required:"true" enum:"AddOnType"` - // The name of the source resource from which to disable the add-on. + // The name of the source resource for which to disable the add-on. // // ResourceName is a required field ResourceName *string `locationName:"resourceName" type:"string" required:"true"` @@ -15814,7 +17468,9 @@ func (s *DisableAddOnInput) SetResourceName(v string) *DisableAddOnInput { type DisableAddOnOutput struct { _ struct{} `type:"structure"` - // An array of objects that describe the result of your request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -16578,7 +18234,9 @@ func (s *EnableAddOnInput) SetResourceName(v string) *EnableAddOnInput { type EnableAddOnOutput struct { _ struct{} `type:"structure"` - // An array of objects that describe the result of your request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -16639,7 +18297,9 @@ func (s *ExportSnapshotInput) SetSourceSnapshotName(v string) *ExportSnapshotInp type ExportSnapshotOutput struct { _ struct{} `type:"structure"` - // A list of objects describing the API operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -16837,7 +18497,11 @@ func (s *ExportSnapshotRecordSourceInfo) SetResourceType(v string) *ExportSnapsh type GetActiveNamesInput struct { _ struct{} `type:"structure"` - // A token used for paginating results from your get active names request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetActiveNames request. If your results + // are paginated, the response will return a next page token that you can specify + // as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -16852,40 +18516,131 @@ func (s GetActiveNamesInput) GoString() string { } // SetPageToken sets the PageToken field's value. -func (s *GetActiveNamesInput) SetPageToken(v string) *GetActiveNamesInput { +func (s *GetActiveNamesInput) SetPageToken(v string) *GetActiveNamesInput { + s.PageToken = &v + return s +} + +type GetActiveNamesOutput struct { + _ struct{} `type:"structure"` + + // The list of active names returned by the get active names request. + ActiveNames []*string `locationName:"activeNames" type:"list"` + + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetActiveNames request and + // specify the next page token using the pageToken parameter. + 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 +} + +type GetAlarmsInput struct { + _ struct{} `type:"structure"` + + // The name of the alarm. + // + // Specify an alarm name to return information about a specific alarm. + AlarmName *string `locationName:"alarmName" type:"string"` + + // The name of the Lightsail resource being monitored by the alarm. + // + // Specify a monitored resource name to return information about all alarms + // for a specific resource. + MonitoredResourceName *string `locationName:"monitoredResourceName" type:"string"` + + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetAlarms request. If your results + // are paginated, the response will return a next page token that you can specify + // as the page token in a subsequent request. + PageToken *string `locationName:"pageToken" type:"string"` +} + +// String returns the string representation +func (s GetAlarmsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAlarmsInput) GoString() string { + return s.String() +} + +// SetAlarmName sets the AlarmName field's value. +func (s *GetAlarmsInput) SetAlarmName(v string) *GetAlarmsInput { + s.AlarmName = &v + return s +} + +// SetMonitoredResourceName sets the MonitoredResourceName field's value. +func (s *GetAlarmsInput) SetMonitoredResourceName(v string) *GetAlarmsInput { + s.MonitoredResourceName = &v + return s +} + +// SetPageToken sets the PageToken field's value. +func (s *GetAlarmsInput) SetPageToken(v string) *GetAlarmsInput { s.PageToken = &v return s } -type GetActiveNamesOutput struct { +type GetAlarmsOutput struct { _ struct{} `type:"structure"` - // The list of active names returned by the get active names request. - ActiveNames []*string `locationName:"activeNames" type:"list"` + // An array of objects that describe the alarms. + Alarms []*Alarm `locationName:"alarms" type:"list"` - // A token used for advancing to the next page of results from your get active - // names request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetAlarms request and specify + // the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` } // String returns the string representation -func (s GetActiveNamesOutput) String() string { +func (s GetAlarmsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetActiveNamesOutput) GoString() string { +func (s GetAlarmsOutput) GoString() string { return s.String() } -// SetActiveNames sets the ActiveNames field's value. -func (s *GetActiveNamesOutput) SetActiveNames(v []*string) *GetActiveNamesOutput { - s.ActiveNames = v +// SetAlarms sets the Alarms field's value. +func (s *GetAlarmsOutput) SetAlarms(v []*Alarm) *GetAlarmsOutput { + s.Alarms = v return s } // SetNextPageToken sets the NextPageToken field's value. -func (s *GetActiveNamesOutput) SetNextPageToken(v string) *GetActiveNamesOutput { +func (s *GetAlarmsOutput) SetNextPageToken(v string) *GetAlarmsOutput { s.NextPageToken = &v return s } @@ -16893,7 +18648,8 @@ func (s *GetActiveNamesOutput) SetNextPageToken(v string) *GetActiveNamesOutput type GetAutoSnapshotsInput struct { _ struct{} `type:"structure"` - // The name of the source resource from which to get automatic snapshot information. + // The name of the source instance or disk from which to get automatic snapshot + // information. // // ResourceName is a required field ResourceName *string `locationName:"resourceName" type:"string" required:"true"` @@ -16932,10 +18688,10 @@ type GetAutoSnapshotsOutput struct { _ struct{} `type:"structure"` // An array of objects that describe the automatic snapshots that are available - // for the specified source resource.asdf + // for the specified source instance or disk. AutoSnapshots []*AutoSnapshotDetails `locationName:"autoSnapshots" type:"list"` - // The name of the source resource for the automatic snapshots. + // The name of the source instance or disk for the automatic snapshots. ResourceName *string `locationName:"resourceName" type:"string"` // The resource type (e.g., Instance or Disk). @@ -16976,8 +18732,11 @@ type GetBlueprintsInput struct { // 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. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetBlueprints request. If your results + // are paginated, the response will return a next page token that you can specify + // as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -17010,8 +18769,12 @@ type GetBlueprintsOutput struct { // blueprints. Blueprints []*Blueprint `locationName:"blueprints" type:"list"` - // A token used for advancing to the next page of results from your get blueprints - // request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetBlueprints request and + // specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` } @@ -17044,8 +18807,11 @@ type GetBundlesInput struct { // 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. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetBundles request. If your results + // are paginated, the response will return a next page token that you can specify + // as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -17078,8 +18844,12 @@ type GetBundlesOutput struct { // bundles. Bundles []*Bundle `locationName:"bundles" type:"list"` - // A token used for advancing to the next page of results from your get active - // names request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetBundles request and specify + // the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` } @@ -17108,8 +18878,11 @@ func (s *GetBundlesOutput) SetNextPageToken(v string) *GetBundlesOutput { type GetCloudFormationStackRecordsInput struct { _ struct{} `type:"structure"` - // A token used for advancing to a specific page of results for your get cloud - // formation stack records request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetClouFormationStackRecords request. + // If your results are paginated, the response will return a next page token + // that you can specify as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -17135,8 +18908,12 @@ type GetCloudFormationStackRecordsOutput struct { // A list of objects describing the CloudFormation stack records. CloudFormationStackRecords []*CloudFormationStackRecord `locationName:"cloudFormationStackRecords" type:"list"` - // A token used for advancing to the next page of results of your get relational - // database bundles request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetCloudFormationStackRecords + // request and specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` } @@ -17162,6 +18939,55 @@ func (s *GetCloudFormationStackRecordsOutput) SetNextPageToken(v string) *GetClo return s } +type GetContactMethodsInput struct { + _ struct{} `type:"structure"` + + // The protocols used to send notifications, such as Email, or SMS (text messaging). + // + // Specify a protocol in your request to return information about a specific + // contact method protocol. + Protocols []*string `locationName:"protocols" type:"list"` +} + +// String returns the string representation +func (s GetContactMethodsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetContactMethodsInput) GoString() string { + return s.String() +} + +// SetProtocols sets the Protocols field's value. +func (s *GetContactMethodsInput) SetProtocols(v []*string) *GetContactMethodsInput { + s.Protocols = v + return s +} + +type GetContactMethodsOutput struct { + _ struct{} `type:"structure"` + + // An array of objects that describe the contact methods. + ContactMethods []*ContactMethod `locationName:"contactMethods" type:"list"` +} + +// String returns the string representation +func (s GetContactMethodsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetContactMethodsOutput) GoString() string { + return s.String() +} + +// SetContactMethods sets the ContactMethods field's value. +func (s *GetContactMethodsOutput) SetContactMethods(v []*ContactMethod) *GetContactMethodsOutput { + s.ContactMethods = v + return s +} + type GetDiskInput struct { _ struct{} `type:"structure"` @@ -17287,8 +19113,11 @@ func (s *GetDiskSnapshotOutput) SetDiskSnapshot(v *DiskSnapshot) *GetDiskSnapsho type GetDiskSnapshotsInput struct { _ struct{} `type:"structure"` - // A token used for advancing to the next page of results from your GetDiskSnapshots - // request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetDiskSnapshots request. If your + // results are paginated, the response will return a next page token that you + // can specify as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -17314,8 +19143,12 @@ type GetDiskSnapshotsOutput struct { // An array of objects containing information about all block storage disk snapshots. DiskSnapshots []*DiskSnapshot `locationName:"diskSnapshots" type:"list"` - // A token used for advancing to the next page of results from your GetDiskSnapshots - // request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetDiskSnapshots request + // and specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` } @@ -17344,8 +19177,11 @@ func (s *GetDiskSnapshotsOutput) SetNextPageToken(v string) *GetDiskSnapshotsOut type GetDisksInput struct { _ struct{} `type:"structure"` - // A token used for advancing to the next page of results from your GetDisks - // request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetDisks request. If your results + // are paginated, the response will return a next page token that you can specify + // as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -17371,8 +19207,12 @@ type GetDisksOutput struct { // An array of objects containing information about all block storage disks. Disks []*Disk `locationName:"disks" type:"list"` - // A token used for advancing to the next page of results from your GetDisks - // request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetDisks request and specify + // the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` } @@ -17463,8 +19303,11 @@ func (s *GetDomainOutput) SetDomain(v *Domain) *GetDomainOutput { type GetDomainsInput struct { _ struct{} `type:"structure"` - // A token used for advancing to the next page of results from your get domains - // request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetDomains request. If your results + // are paginated, the response will return a next page token that you can specify + // as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -17491,8 +19334,12 @@ type GetDomainsOutput struct { // 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. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetDomains request and specify + // the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` } @@ -17521,8 +19368,11 @@ func (s *GetDomainsOutput) SetNextPageToken(v string) *GetDomainsOutput { type GetExportSnapshotRecordsInput struct { _ struct{} `type:"structure"` - // A token used for advancing to a specific page of results for your get export - // snapshot records request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetExportSnapshotRecords request. + // If your results are paginated, the response will return a next page token + // that you can specify as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -17548,8 +19398,12 @@ type GetExportSnapshotRecordsOutput struct { // A list of objects describing the export snapshot records. ExportSnapshotRecords []*ExportSnapshotRecord `locationName:"exportSnapshotRecords" type:"list"` - // A token used for advancing to the next page of results of your get relational - // database bundles request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetExportSnapshotRecords + // request and specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` } @@ -17697,13 +19551,59 @@ type GetInstanceMetricDataInput struct { // InstanceName is a required field InstanceName *string `locationName:"instanceName" type:"string" required:"true"` - // The metric name to get data about. + // The metric for which you want to return information. + // + // Valid instance metric names are listed below, along with the most useful + // statistics to include in your request, and the published unit value. + // + // * CPUUtilization — The percentage of allocated compute units that are + // currently in use on the instance. This metric identifies the processing + // power to run the applications on the instance. Tools in your operating + // system can show a lower percentage than Lightsail when the instance is + // not allocated a full processor core. Statistics: The most useful statistics + // are Maximum and Average. Unit: The published unit is Percent. + // + // * NetworkIn — The number of bytes received on all network interfaces + // by the instance. This metric identifies the volume of incoming network + // traffic to the instance. The number reported is the number of bytes received + // during the period. Because this metric is reported in 5-minute intervals, + // divide the reported number by 300 to find Bytes/second. Statistics: The + // most useful statistic is Sum. Unit: The published unit is Bytes. + // + // * NetworkOut — The number of bytes sent out on all network interfaces + // by the instance. This metric identifies the volume of outgoing network + // traffic from the instance. The number reported is the number of bytes + // sent during the period. Because this metric is reported in 5-minute intervals, + // divide the reported number by 300 to find Bytes/second. Statistics: The + // most useful statistic is Sum. Unit: The published unit is Bytes. + // + // * StatusCheckFailed — Reports whether the instance passed or failed + // both the instance status check and the system status check. This metric + // can be either 0 (passed) or 1 (failed). This metric data is available + // in 1-minute (60 seconds) granularity. Statistics: The most useful statistic + // is Sum. Unit: The published unit is Count. + // + // * StatusCheckFailed_Instance — Reports whether the instance passed or + // failed the instance status check. This metric can be either 0 (passed) + // or 1 (failed). This metric data is available in 1-minute (60 seconds) + // granularity. Statistics: The most useful statistic is Sum. Unit: The published + // unit is Count. + // + // * StatusCheckFailed_System — Reports whether the instance passed or + // failed the system status check. This metric can be either 0 (passed) or + // 1 (failed). This metric data is available in 1-minute (60 seconds) granularity. + // Statistics: The most useful statistic is Sum. Unit: The published unit + // is Count. // // MetricName is a required field MetricName *string `locationName:"metricName" type:"string" required:"true" enum:"InstanceMetricName"` // The granularity, in seconds, of the returned data points. // + // The StatusCheckFailed, StatusCheckFailed_Instance, and StatusCheckFailed_System + // instance metric data is available in 1-minute (60 seconds) granularity. All + // other instance metric data is available in 5-minute (300 seconds) granularity. + // // Period is a required field Period *int64 `locationName:"period" min:"60" type:"integer" required:"true"` @@ -17712,12 +19612,34 @@ type GetInstanceMetricDataInput struct { // StartTime is a required field StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"` - // The instance statistics. + // The statistic for the metric. + // + // The following statistics are available: + // + // * Minimum — The lowest value observed during the specified period. Use + // this value to determine low volumes of activity for your application. + // + // * Maximum — The highest value observed during the specified period. + // Use this value to determine high volumes of activity for your application. + // + // * Sum — All values submitted for the matching metric added together. + // You can use this statistic to determine the total volume of a metric. + // + // * Average — The value of Sum / SampleCount during the specified period. + // By comparing this statistic with the Minimum and Maximum values, you can + // determine the full scope of a metric and how close the average use is + // to the Minimum and Maximum values. This comparison helps you to know when + // to increase or decrease your resources. + // + // * SampleCount — The count, or number, of data points used for the statistical + // calculation. // // Statistics is a required field Statistics []*string `locationName:"statistics" type:"list" required:"true"` - // The unit. The list of valid values is below. + // The unit for the metric data request. Valid units depend on the metric data + // being required. For the valid units with each available metric, see the metricName + // parameter. // // Unit is a required field Unit *string `locationName:"unit" type:"string" required:"true" enum:"MetricUnit"` @@ -17991,8 +19913,11 @@ func (s *GetInstanceSnapshotOutput) SetInstanceSnapshot(v *InstanceSnapshot) *Ge type GetInstanceSnapshotsInput struct { _ struct{} `type:"structure"` - // A token used for advancing to the next page of results from your get instance - // snapshots request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetInstanceSnapshots request. If + // your results are paginated, the response will return a next page token that + // you can specify as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -18019,8 +19944,12 @@ type GetInstanceSnapshotsOutput struct { // 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. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetInstanceSnapshots request + // and specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` } @@ -18110,8 +20039,11 @@ func (s *GetInstanceStateOutput) SetState(v *InstanceState) *GetInstanceStateOut type GetInstancesInput struct { _ struct{} `type:"structure"` - // A token used for advancing to the next page of results from your get instances - // request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetInstances request. If your results + // are paginated, the response will return a next page token that you can specify + // as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -18137,8 +20069,12 @@ type GetInstancesOutput struct { // 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. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetInstances request and + // specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` } @@ -18228,8 +20164,11 @@ func (s *GetKeyPairOutput) SetKeyPair(v *KeyPair) *GetKeyPairOutput { type GetKeyPairsInput struct { _ struct{} `type:"structure"` - // A token used for advancing to the next page of results from your get key - // pairs request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetKeyPairs request. If your results + // are paginated, the response will return a next page token that you can specify + // as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -18255,8 +20194,12 @@ type GetKeyPairsOutput struct { // 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. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetKeyPairs request and + // specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` } @@ -18333,67 +20276,80 @@ type GetLoadBalancerMetricDataInput struct { // LoadBalancerName is a required field LoadBalancerName *string `locationName:"loadBalancerName" type:"string" required:"true"` - // The metric about which you want to return information. Valid values are listed - // below, along with the most useful statistics to include in your request. - // - // * ClientTLSNegotiationErrorCount - The number of TLS connections initiated - // by the client that did not establish a session with the load balancer. - // Possible causes include a mismatch of ciphers or protocols. Statistics: - // The most useful statistic is Sum. + // The metric for which you want to return information. // - // * HealthyHostCount - The number of target instances that are considered - // healthy. Statistics: The most useful statistic are Average, Minimum, and - // Maximum. + // Valid load balancer metric names are listed below, along with the most useful + // statistics to include in your request, and the published unit value. // - // * UnhealthyHostCount - The number of target instances that are considered - // unhealthy. Statistics: The most useful statistic are Average, Minimum, - // and Maximum. + // * ClientTLSNegotiationErrorCount — The number of TLS connections initiated + // by the client that did not establish a session with the load balancer + // due to a TLS error generated by the load balancer. Possible causes include + // a mismatch of ciphers or protocols. Statistics: The most useful statistic + // is Sum. Unit: The published unit is Count. // - // * HTTPCode_LB_4XX_Count - The number of HTTP 4XX client error codes that - // originate from the load balancer. Client errors are generated when requests - // are malformed or incomplete. These requests have not been received by - // the target instance. This count does not include any response codes generated + // * HealthyHostCount — The number of target instances that are considered + // healthy. Statistics: The most useful statistic are Average, Minimum, and + // Maximum. Unit: The published unit is Count. + // + // * HTTPCode_Instance_2XX_Count — The number of HTTP 2XX response codes + // generated by the target instances. This does not include any response + // codes generated by the load balancer. Statistics: The most useful statistic + // is Sum. Note that Minimum, Maximum, and Average all return 1. Unit: The + // published unit is Count. + // + // * HTTPCode_Instance_3XX_Count — The number of HTTP 3XX response codes + // generated by the target instances. This does not include any response + // codes generated by the load balancer. Statistics: The most useful statistic + // is Sum. Note that Minimum, Maximum, and Average all return 1. Unit: The + // published unit is Count. + // + // * HTTPCode_Instance_4XX_Count — The number of HTTP 4XX response codes + // generated by the target instances. This does not include any response + // codes generated by the load balancer. Statistics: The most useful statistic + // is Sum. Note that Minimum, Maximum, and Average all return 1. Unit: The + // published unit is Count. + // + // * HTTPCode_Instance_5XX_Count — The number of HTTP 5XX response codes + // generated by the target instances. This does not include any response + // codes generated by the load balancer. Statistics: The most useful statistic + // is Sum. Note that Minimum, Maximum, and Average all return 1. Unit: The + // published unit is Count. + // + // * HTTPCode_LB_4XX_Count — The number of HTTP 4XX client error codes + // that originated from the load balancer. Client errors are generated when + // requests are malformed or incomplete. These requests were not received + // by the target instance. This count does not include response codes generated // by the target instances. Statistics: The most useful statistic is Sum. - // Note that Minimum, Maximum, and Average all return 1. - // - // * HTTPCode_LB_5XX_Count - The number of HTTP 5XX server error codes that - // originate from the load balancer. This count does not include any response - // codes generated by the target instances. Statistics: The most useful statistic - // is Sum. Note that Minimum, Maximum, and Average all return 1. Note that - // Minimum, Maximum, and Average all return 1. - // - // * HTTPCode_Instance_2XX_Count - The number of HTTP response codes generated - // by the target instances. This does not include any response codes generated - // by the load balancer. Statistics: The most useful statistic is Sum. Note - // that Minimum, Maximum, and Average all return 1. - // - // * HTTPCode_Instance_3XX_Count - The number of HTTP response codes generated - // by the target instances. This does not include any response codes generated - // by the load balancer. Statistics: The most useful statistic is Sum. Note - // that Minimum, Maximum, and Average all return 1. - // - // * HTTPCode_Instance_4XX_Count - The number of HTTP response codes generated - // by the target instances. This does not include any response codes generated - // by the load balancer. Statistics: The most useful statistic is Sum. Note - // that Minimum, Maximum, and Average all return 1. - // - // * HTTPCode_Instance_5XX_Count - The number of HTTP response codes generated - // by the target instances. This does not include any response codes generated - // by the load balancer. Statistics: The most useful statistic is Sum. Note - // that Minimum, Maximum, and Average all return 1. - // - // * InstanceResponseTime - The time elapsed, in seconds, after the request + // Note that Minimum, Maximum, and Average all return 1. Unit: The published + // unit is Count. + // + // * HTTPCode_LB_5XX_Count — The number of HTTP 5XX server error codes + // that originated from the load balancer. This does not include any response + // codes generated by the target instance. This metric is reported if there + // are no healthy instances attached to the load balancer, or if the request + // rate exceeds the capacity of the instances (spillover) or the load balancer. + // Statistics: The most useful statistic is Sum. Note that Minimum, Maximum, + // and Average all return 1. Unit: The published unit is Count. + // + // * InstanceResponseTime — The time elapsed, in seconds, after the request // leaves the load balancer until a response from the target instance is - // received. Statistics: The most useful statistic is Average. + // received. Statistics: The most useful statistic is Average. Unit: The + // published unit is Seconds. // - // * RejectedConnectionCount - The number of connections that were rejected + // * RejectedConnectionCount — The number of connections that were rejected // because the load balancer had reached its maximum number of connections. - // Statistics: The most useful statistic is Sum. + // Statistics: The most useful statistic is Sum. Unit: The published unit + // is Count. // - // * RequestCount - The number of requests processed over IPv4. This count + // * RequestCount — The number of requests processed over IPv4. This count // includes only the requests with a response generated by a target instance // of the load balancer. Statistics: The most useful statistic is Sum. Note - // that Minimum, Maximum, and Average all return 1. + // that Minimum, Maximum, and Average all return 1. Unit: The published unit + // is Count. + // + // * UnhealthyHostCount — The number of target instances that are considered + // unhealthy. Statistics: The most useful statistic are Average, Minimum, + // and Maximum. Unit: The published unit is Count. // // MetricName is a required field MetricName *string `locationName:"metricName" type:"string" required:"true" enum:"LoadBalancerMetricName"` @@ -18408,31 +20364,34 @@ type GetLoadBalancerMetricDataInput struct { // StartTime is a required field StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"` - // An array of statistics that you want to request metrics for. Valid values - // are listed below. + // The statistic for the metric. // - // * SampleCount - The count (number) of data points used for the statistical - // calculation. + // The following statistics are available: // - // * Average - The value of Sum / SampleCount during the specified period. - // By comparing this statistic with the Minimum and Maximum, you can determine - // the full scope of a metric and how close the average use is to the Minimum - // and Maximum. This comparison helps you to know when to increase or decrease - // your resources as needed. + // * Minimum — The lowest value observed during the specified period. Use + // this value to determine low volumes of activity for your application. // - // * Sum - All values submitted for the matching metric added together. This - // statistic can be useful for determining the total volume of a metric. + // * Maximum — The highest value observed during the specified period. + // Use this value to determine high volumes of activity for your application. // - // * Minimum - The lowest value observed during the specified period. You - // can use this value to determine low volumes of activity for your application. + // * Sum — All values submitted for the matching metric added together. + // You can use this statistic to determine the total volume of a metric. // - // * Maximum - The highest value observed during the specified period. You - // can use this value to determine high volumes of activity for your application. + // * Average — The value of Sum / SampleCount during the specified period. + // By comparing this statistic with the Minimum and Maximum values, you can + // determine the full scope of a metric and how close the average use is + // to the Minimum and Maximum values. This comparison helps you to know when + // to increase or decrease your resources. + // + // * SampleCount — The count, or number, of data points used for the statistical + // calculation. // // Statistics is a required field Statistics []*string `locationName:"statistics" type:"list" required:"true"` - // The unit for the time period request. Valid values are listed below. + // The unit for the metric data request. Valid units depend on the metric data + // being required. For the valid units with each available metric, see the metricName + // parameter. // // Unit is a required field Unit *string `locationName:"unit" type:"string" required:"true" enum:"MetricUnit"` @@ -18703,7 +20662,11 @@ func (s *GetLoadBalancerTlsCertificatesOutput) SetTlsCertificates(v []*LoadBalan type GetLoadBalancersInput struct { _ struct{} `type:"structure"` - // A token used for paginating the results from your GetLoadBalancers request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetLoadBalancers request. If your + // results are paginated, the response will return a next page token that you + // can specify as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -18729,8 +20692,12 @@ type GetLoadBalancersOutput struct { // An array of LoadBalancer objects describing your load balancers. LoadBalancers []*LoadBalancer `locationName:"loadBalancers" type:"list"` - // A token used for advancing to the next page of results from your GetLoadBalancers - // request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetLoadBalancers request + // and specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` } @@ -18797,8 +20764,9 @@ func (s *GetOperationInput) SetOperationId(v string) *GetOperationInput { type GetOperationOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the results of your - // get operation request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operation *Operation `locationName:"operation" type:"structure"` } @@ -18821,8 +20789,11 @@ func (s *GetOperationOutput) SetOperation(v *Operation) *GetOperationOutput { type GetOperationsForResourceInput struct { _ struct{} `type:"structure"` - // A token used for advancing to the next page of results from your get operations - // for resource request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetOperationsForResource request. + // If your results are paginated, the response will return a next page token + // that you can specify as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` // The name of the resource for which you are requesting information. @@ -18877,12 +20848,17 @@ type GetOperationsForResourceOutput struct { // Deprecated: NextPageCount has been deprecated NextPageCount *string `locationName:"nextPageCount" deprecated:"true" type:"string"` - // An identifier that was returned from the previous call to this operation, - // which can be used to return the next set of items in the list. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetOperationsForResource + // request and specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` - // An array of key-value pairs containing information about the results of your - // get operations for resource request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -18917,8 +20893,11 @@ func (s *GetOperationsForResourceOutput) SetOperations(v []*Operation) *GetOpera type GetOperationsInput struct { _ struct{} `type:"structure"` - // A token used for advancing to the next page of results from your get operations - // request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetOperations request. If your results + // are paginated, the response will return a next page token that you can specify + // as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -18941,12 +20920,17 @@ func (s *GetOperationsInput) SetPageToken(v string) *GetOperationsInput { type GetOperationsOutput struct { _ struct{} `type:"structure"` - // A token used for advancing to the next page of results from your get operations - // request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetOperations request and + // specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` - // An array of key-value pairs containing information about the results of your - // get operations request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -19035,8 +21019,11 @@ func (s *GetRegionsOutput) SetRegions(v []*Region) *GetRegionsOutput { type GetRelationalDatabaseBlueprintsInput struct { _ struct{} `type:"structure"` - // A token used for advancing to a specific page of results for your get relational - // database blueprints request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetRelationalDatabaseBlueprints request. + // If your results are paginated, the response will return a next page token + // that you can specify as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -19063,8 +21050,12 @@ type GetRelationalDatabaseBlueprintsOutput struct { // request. Blueprints []*RelationalDatabaseBlueprint `locationName:"blueprints" type:"list"` - // A token used for advancing to the next page of results of your get relational - // database blueprints request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetRelationalDatabaseBlueprints + // request and specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` } @@ -19093,8 +21084,11 @@ func (s *GetRelationalDatabaseBlueprintsOutput) SetNextPageToken(v string) *GetR type GetRelationalDatabaseBundlesInput struct { _ struct{} `type:"structure"` - // A token used for advancing to a specific page of results for your get relational - // database bundles request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetRelationalDatabaseBundles request. + // If your results are paginated, the response will return a next page token + // that you can specify as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -19120,8 +21114,12 @@ type GetRelationalDatabaseBundlesOutput struct { // An object describing the result of your get relational database bundles request. Bundles []*RelationalDatabaseBundle `locationName:"bundles" type:"list"` - // A token used for advancing to the next page of results of your get relational - // database bundles request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetRelationalDatabaseBundles + // request and specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` } @@ -19158,8 +21156,11 @@ type GetRelationalDatabaseEventsInput struct { // The minimum is 1 and the maximum is 14 days (20160 minutes). DurationInMinutes *int64 `locationName:"durationInMinutes" type:"integer"` - // A token used for advancing to a specific page of results from for get relational - // database events request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetRelationalDatabaseEvents request. + // If your results are paginated, the response will return a next page token + // that you can specify as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` // The name of the database from which to get events. @@ -19212,8 +21213,12 @@ func (s *GetRelationalDatabaseEventsInput) SetRelationalDatabaseName(v string) * type GetRelationalDatabaseEventsOutput struct { _ struct{} `type:"structure"` - // A token used for advancing to the next page of results from your get relational - // database events request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetRelationalDatabaseEvents + // request and specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` // An object describing the result of your get relational database events request. @@ -19302,8 +21307,12 @@ type GetRelationalDatabaseLogEventsInput struct { // LogStreamName is a required field LogStreamName *string `locationName:"logStreamName" type:"string" required:"true"` - // A token used for advancing to a specific page of results for your get relational - // database log events request. + // The token to advance to the next or previous page of results from your request. + // + // To get a page token, perform an initial GetRelationalDatabaseLogEvents request. + // If your results are paginated, the response will return a next forward token + // and/or next backward token that you can specify as the page token in a subsequent + // request. PageToken *string `locationName:"pageToken" type:"string"` // The name of your database for which to get log events. @@ -19601,13 +21610,46 @@ type GetRelationalDatabaseMetricDataInput struct { // EndTime is a required field EndTime *time.Time `locationName:"endTime" type:"timestamp" required:"true"` - // The name of the metric data to return. + // The metric for which you want to return information. + // + // Valid relational database metric names are listed below, along with the most + // useful statistics to include in your request, and the published unit value. + // All relational database metric data is available in 1-minute (60 seconds) + // granularity. + // + // * CPUUtilization — The percentage of CPU utilization currently in use + // on the database. Statistics: The most useful statistics are Maximum and + // Average. Unit: The published unit is Percent. + // + // * DatabaseConnections — The number of database connections in use. Statistics: + // The most useful statistics are Maximum and Sum. Unit: The published unit + // is Count. + // + // * DiskQueueDepth — The number of outstanding IOs (read/write requests) + // that are waiting to access the disk. Statistics: The most useful statistic + // is Sum. Unit: The published unit is Count. + // + // * FreeStorageSpace — The amount of available storage space. Statistics: + // The most useful statistic is Sum. Unit: The published unit is Bytes. + // + // * NetworkReceiveThroughput — The incoming (Receive) network traffic + // on the database, including both customer database traffic and AWS traffic + // used for monitoring and replication. Statistics: The most useful statistic + // is Average. Unit: The published unit is Bytes/Second. + // + // * NetworkTransmitThroughput — The outgoing (Transmit) network traffic + // on the database, including both customer database traffic and AWS traffic + // used for monitoring and replication. Statistics: The most useful statistic + // is Average. Unit: The published unit is Bytes/Second. // // MetricName is a required field MetricName *string `locationName:"metricName" type:"string" required:"true" enum:"RelationalDatabaseMetricName"` // The granularity, in seconds, of the returned data points. // + // All relational database metric data is available in 1-minute (60 seconds) + // granularity. + // // Period is a required field Period *int64 `locationName:"period" min:"60" type:"integer" required:"true"` @@ -19629,12 +21671,34 @@ type GetRelationalDatabaseMetricDataInput struct { // StartTime is a required field StartTime *time.Time `locationName:"startTime" type:"timestamp" required:"true"` - // The array of statistics for your metric data request. + // The statistic for the metric. + // + // The following statistics are available: + // + // * Minimum — The lowest value observed during the specified period. Use + // this value to determine low volumes of activity for your application. + // + // * Maximum — The highest value observed during the specified period. + // Use this value to determine high volumes of activity for your application. + // + // * Sum — All values submitted for the matching metric added together. + // You can use this statistic to determine the total volume of a metric. + // + // * Average — The value of Sum / SampleCount during the specified period. + // By comparing this statistic with the Minimum and Maximum values, you can + // determine the full scope of a metric and how close the average use is + // to the Minimum and Maximum values. This comparison helps you to know when + // to increase or decrease your resources. + // + // * SampleCount — The count, or number, of data points used for the statistical + // calculation. // // Statistics is a required field Statistics []*string `locationName:"statistics" type:"list" required:"true"` - // The unit for the metric data request. + // The unit for the metric data request. Valid units depend on the metric data + // being required. For the valid units with each available metric, see the metricName + // parameter. // // Unit is a required field Unit *string `locationName:"unit" type:"string" required:"true" enum:"MetricUnit"` @@ -19785,8 +21849,11 @@ func (s *GetRelationalDatabaseOutput) SetRelationalDatabase(v *RelationalDatabas type GetRelationalDatabaseParametersInput struct { _ struct{} `type:"structure"` - // A token used for advancing to a specific page of results for your get relational - // database parameters request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetRelationalDatabaseParameters request. + // If your results are paginated, the response will return a next page token + // that you can specify as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` // The name of your database for which to get parameters. @@ -19833,8 +21900,12 @@ func (s *GetRelationalDatabaseParametersInput) SetRelationalDatabaseName(v strin type GetRelationalDatabaseParametersOutput struct { _ struct{} `type:"structure"` - // A token used for advancing to the next page of results from your get static - // IPs request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetRelationalDatabaseParameters + // request and specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` // An object describing the result of your get relational database parameters @@ -19928,8 +21999,11 @@ func (s *GetRelationalDatabaseSnapshotOutput) SetRelationalDatabaseSnapshot(v *R type GetRelationalDatabaseSnapshotsInput struct { _ struct{} `type:"structure"` - // A token used for advancing to a specific page of results for your get relational - // database snapshots request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetRelationalDatabaseSnapshots request. + // If your results are paginated, the response will return a next page token + // that you can specify as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -19952,8 +22026,12 @@ func (s *GetRelationalDatabaseSnapshotsInput) SetPageToken(v string) *GetRelatio type GetRelationalDatabaseSnapshotsOutput struct { _ struct{} `type:"structure"` - // A token used for advancing to the next page of results from your get relational - // database snapshots request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetRelationalDatabaseSnapshots + // request and specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` // An object describing the result of your get relational database snapshots @@ -19986,8 +22064,11 @@ func (s *GetRelationalDatabaseSnapshotsOutput) SetRelationalDatabaseSnapshots(v type GetRelationalDatabasesInput struct { _ struct{} `type:"structure"` - // A token used for advancing to a specific page of results for your get relational - // database request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetRelationalDatabases request. If + // your results are paginated, the response will return a next page token that + // you can specify as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -20010,8 +22091,12 @@ func (s *GetRelationalDatabasesInput) SetPageToken(v string) *GetRelationalDatab type GetRelationalDatabasesOutput struct { _ struct{} `type:"structure"` - // A token used for advancing to the next page of results from your get relational - // databases request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetRelationalDatabases request + // and specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` // An object describing the result of your get relational databases request. @@ -20105,8 +22190,11 @@ func (s *GetStaticIpOutput) SetStaticIp(v *StaticIp) *GetStaticIpOutput { type GetStaticIpsInput struct { _ struct{} `type:"structure"` - // A token used for advancing to the next page of results from your get static - // IPs request. + // The token to advance to the next page of results from your request. + // + // To get a page token, perform an initial GetStaticIps request. If your results + // are paginated, the response will return a next page token that you can specify + // as the page token in a subsequent request. PageToken *string `locationName:"pageToken" type:"string"` } @@ -20129,8 +22217,12 @@ func (s *GetStaticIpsInput) SetPageToken(v string) *GetStaticIpsInput { type GetStaticIpsOutput struct { _ struct{} `type:"structure"` - // A token used for advancing to the next page of results from your get static - // IPs request. + // The token to advance to the next page of resutls from your request. + // + // A next page token is not returned if there are no more results to display. + // + // To get the next page of results, perform another GetStaticIps request and + // specify the next page token using the pageToken parameter. NextPageToken *string `locationName:"nextPageToken" type:"string"` // An array of key-value pairs containing information about your get static @@ -20308,7 +22400,9 @@ func (s *ImportKeyPairInput) SetPublicKeyBase64(v string) *ImportKeyPairInput { type ImportKeyPairOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the request operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operation *Operation `locationName:"operation" type:"structure"` } @@ -21300,33 +23394,100 @@ func (s *InstanceSnapshotInfo) SetFromDiskInfo(v []*DiskInfo) *InstanceSnapshotI type InstanceState struct { _ struct{} `type:"structure"` - // The status code for the instance. - Code *int64 `locationName:"code" type:"integer"` + // 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 +} + +// Lightsail throws this exception when user input does not conform to the validation +// rules of an input field. +// +// Domain-related APIs are only available in the N. Virginia (us-east-1) Region. +// Please set your AWS Region configuration to us-east-1 to create, view, or +// edit these resources. +type InvalidInputException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"code" type:"string"` + + Docs *string `locationName:"docs" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + Tip *string `locationName:"tip" type:"string"` +} + +// String returns the string representation +func (s InvalidInputException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInputException) GoString() string { + return s.String() +} + +func newErrorInvalidInputException(v protocol.ResponseMetadata) error { + return &InvalidInputException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInputException) Code() string { + return "InvalidInputException" +} - // The state of the instance (e.g., running or pending). - Name *string `locationName:"name" type:"string"` +// Message returns the exception's message. +func (s InvalidInputException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s InstanceState) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInputException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s InstanceState) GoString() string { - return s.String() +func (s InvalidInputException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetCode sets the Code field's value. -func (s *InstanceState) SetCode(v int64) *InstanceState { - s.Code = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInputException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetName sets the Name field's value. -func (s *InstanceState) SetName(v string) *InstanceState { - s.Name = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidInputException) RequestID() string { + return s.respMetadata.RequestID } type IsVpcPeeredInput struct { @@ -22178,6 +24339,54 @@ func (s *MetricDatapoint) SetUnit(v string) *MetricDatapoint { return s } +// Describes resource being monitored by an alarm. +// +// An alarm is a way to monitor your Amazon Lightsail resource metrics. For +// more information, see Alarms in Amazon Lightsail (https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-alarms). +type MonitoredResourceInfo struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource being monitored. + Arn *string `locationName:"arn" type:"string"` + + // The name of the Lightsail resource being monitored. + Name *string `locationName:"name" type:"string"` + + // The Lightsail resource type of the resource being monitored. + // + // Instances, load balancers, and relational databases are the only Lightsail + // resources that can currently be monitored by alarms. + ResourceType *string `locationName:"resourceType" type:"string" enum:"ResourceType"` +} + +// String returns the string representation +func (s MonitoredResourceInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MonitoredResourceInfo) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *MonitoredResourceInfo) SetArn(v string) *MonitoredResourceInfo { + s.Arn = &v + return s +} + +// SetName sets the Name field's value. +func (s *MonitoredResourceInfo) SetName(v string) *MonitoredResourceInfo { + s.Name = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *MonitoredResourceInfo) SetResourceType(v string) *MonitoredResourceInfo { + s.ResourceType = &v + return s +} + // Describes the monthly data transfer in and out of your virtual private server // (or instance). type MonthlyTransfer struct { @@ -22203,6 +24412,68 @@ func (s *MonthlyTransfer) SetGbPerMonthAllocated(v int64) *MonthlyTransfer { return s } +// Lightsail throws this exception when it cannot find a resource. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"code" type:"string"` + + Docs *string `locationName:"docs" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + Tip *string `locationName:"tip" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + type OpenInstancePublicPortsInput struct { _ struct{} `type:"structure"` @@ -22258,7 +24529,9 @@ func (s *OpenInstancePublicPortsInput) SetPortInfo(v *PortInfo) *OpenInstancePub type OpenInstancePublicPortsOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the request operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operation *Operation `locationName:"operation" type:"structure"` } @@ -22401,6 +24674,68 @@ func (s *Operation) SetStatusChangedAt(v time.Time) *Operation { return s } +// Lightsail throws this exception when an operation fails to execute. +type OperationFailureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"code" type:"string"` + + Docs *string `locationName:"docs" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + Tip *string `locationName:"tip" type:"string"` +} + +// String returns the string representation +func (s OperationFailureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OperationFailureException) GoString() string { + return s.String() +} + +func newErrorOperationFailureException(v protocol.ResponseMetadata) error { + return &OperationFailureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OperationFailureException) Code() string { + return "OperationFailureException" +} + +// Message returns the exception's message. +func (s OperationFailureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OperationFailureException) OrigErr() error { + return nil +} + +func (s OperationFailureException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OperationFailureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OperationFailureException) RequestID() string { + return s.respMetadata.RequestID +} + // The password data for the Windows Server-based instance, including the ciphertext // and the key pair name. type PasswordData struct { @@ -22470,7 +24805,9 @@ func (s PeerVpcInput) GoString() string { type PeerVpcOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the request operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operation *Operation `locationName:"operation" type:"structure"` } @@ -22590,30 +24927,295 @@ type PortInfo struct { } // String returns the string representation -func (s PortInfo) String() string { +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 +} + +type PutAlarmInput struct { + _ struct{} `type:"structure"` + + // The name for the alarm. Specify the name of an existing alarm to update, + // and overwrite the previous configuration of the alarm. + // + // AlarmName is a required field + AlarmName *string `locationName:"alarmName" type:"string" required:"true"` + + // The arithmetic operation to use when comparing the specified statistic to + // the threshold. The specified statistic value is used as the first operand. + // + // ComparisonOperator is a required field + ComparisonOperator *string `locationName:"comparisonOperator" type:"string" required:"true" enum:"ComparisonOperator"` + + // The contact protocols to use for the alarm, such as Email, SMS (text messaging), + // or both. + // + // A notification is sent via the specified contact protocol if notifications + // are enabled for the alarm, and when the alarm is triggered. + // + // A notification is not sent if a contact protocol is not specified, if the + // specified contact protocol is not configured in the AWS Region, or if notifications + // are not enabled for the alarm using the notificationEnabled paramater. + // + // Use the CreateContactMethod action to configure a contact protocol in an + // AWS Region. + ContactProtocols []*string `locationName:"contactProtocols" type:"list"` + + // The number of data points that must be not within the specified threshold + // to trigger the alarm. If you are setting an "M out of N" alarm, this value + // (datapointsToAlarm) is the M. + DatapointsToAlarm *int64 `locationName:"datapointsToAlarm" type:"integer"` + + // The number of most recent periods over which data is compared to the specified + // threshold. If you are setting an "M out of N" alarm, this value (evaluationPeriods) + // is the N. + // + // If you are setting an alarm that requires that a number of consecutive data + // points be breaching to trigger the alarm, this value specifies the rolling + // period of time in which data points are evaluated. + // + // Each evaluation period is five minutes long. For example, specify an evaluation + // period of 24 to evaluate a metric over a rolling period of two hours. + // + // You can specify a minimum valuation period of 1 (5 minutes), and a maximum + // evaluation period of 288 (24 hours). + // + // EvaluationPeriods is a required field + EvaluationPeriods *int64 `locationName:"evaluationPeriods" type:"integer" required:"true"` + + // The name of the metric to associate with the alarm. + // + // You can configure up to two alarms per metric. + // + // The following metrics are available for each resource type: + // + // * Instances: CPUUtilization, NetworkIn, NetworkOut, StatusCheckFailed, + // StatusCheckFailed_Instance, and StatusCheckFailed_System. + // + // * Load balancers: ClientTLSNegotiationErrorCount, HealthyHostCount, UnhealthyHostCount, + // HTTPCode_LB_4XX_Count, HTTPCode_LB_5XX_Count, HTTPCode_Instance_2XX_Count, + // HTTPCode_Instance_3XX_Count, HTTPCode_Instance_4XX_Count, HTTPCode_Instance_5XX_Count, + // InstanceResponseTime, RejectedConnectionCount, and RequestCount. + // + // * Relational databases: CPUUtilization, DatabaseConnections, DiskQueueDepth, + // FreeStorageSpace, NetworkReceiveThroughput, and NetworkTransmitThroughput. + // + // MetricName is a required field + MetricName *string `locationName:"metricName" type:"string" required:"true" enum:"MetricName"` + + // The name of the Lightsail resource that will be monitored. + // + // Instances, load balancers, and relational databases are the only Lightsail + // resources that can currently be monitored by alarms. + // + // MonitoredResourceName is a required field + MonitoredResourceName *string `locationName:"monitoredResourceName" type:"string" required:"true"` + + // Indicates whether the alarm is enabled. + // + // Notifications are enabled by default if you don't specify this parameter. + NotificationEnabled *bool `locationName:"notificationEnabled" type:"boolean"` + + // The alarm states that trigger a notification. + // + // An alarm has the following possible states: + // + // * ALARM — The metric is outside of the defined threshold. + // + // * INSUFFICIENT_DATA — The alarm has just started, the metric is not + // available, or not enough data is available for the metric to determine + // the alarm state. + // + // * OK — The metric is within the defined threshold. + // + // When you specify a notification trigger, the ALARM state must be specified. + // The INSUFFICIENT_DATA and OK states can be specified in addition to the ALARM + // state. + // + // * If you specify OK as an alarm trigger, a notification is sent when the + // alarm switches from an ALARM or INSUFFICIENT_DATA alarm state to an OK + // state. This can be thought of as an all clear alarm notification. + // + // * If you specify INSUFFICIENT_DATA as the alarm trigger, a notification + // is sent when the alarm switches from an OK or ALARM alarm state to an + // INSUFFICIENT_DATA state. + // + // The notification trigger defaults to ALARM if you don't specify this parameter. + NotificationTriggers []*string `locationName:"notificationTriggers" type:"list"` + + // The value against which the specified statistic is compared. + // + // Threshold is a required field + Threshold *float64 `locationName:"threshold" type:"double" required:"true"` + + // Sets how this alarm will handle missing data points. + // + // An alarm can treat missing data in the following ways: + // + // * breaching — Assume the missing data is not within the threshold. Missing + // data counts towards the number of times the metric is not within the threshold. + // + // * notBreaching — Assume the missing data is within the threshold. Missing + // data does not count towards the number of times the metric is not within + // the threshold. + // + // * ignore — Ignore the missing data. Maintains the current alarm state. + // + // * missing — Missing data is treated as missing. + // + // If treatMissingData is not specified, the default behavior of missing is + // used. + TreatMissingData *string `locationName:"treatMissingData" type:"string" enum:"TreatMissingData"` +} + +// String returns the string representation +func (s PutAlarmInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutAlarmInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutAlarmInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutAlarmInput"} + if s.AlarmName == nil { + invalidParams.Add(request.NewErrParamRequired("AlarmName")) + } + if s.ComparisonOperator == nil { + invalidParams.Add(request.NewErrParamRequired("ComparisonOperator")) + } + if s.EvaluationPeriods == nil { + invalidParams.Add(request.NewErrParamRequired("EvaluationPeriods")) + } + if s.MetricName == nil { + invalidParams.Add(request.NewErrParamRequired("MetricName")) + } + if s.MonitoredResourceName == nil { + invalidParams.Add(request.NewErrParamRequired("MonitoredResourceName")) + } + if s.Threshold == nil { + invalidParams.Add(request.NewErrParamRequired("Threshold")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAlarmName sets the AlarmName field's value. +func (s *PutAlarmInput) SetAlarmName(v string) *PutAlarmInput { + s.AlarmName = &v + return s +} + +// SetComparisonOperator sets the ComparisonOperator field's value. +func (s *PutAlarmInput) SetComparisonOperator(v string) *PutAlarmInput { + s.ComparisonOperator = &v + return s +} + +// SetContactProtocols sets the ContactProtocols field's value. +func (s *PutAlarmInput) SetContactProtocols(v []*string) *PutAlarmInput { + s.ContactProtocols = v + return s +} + +// SetDatapointsToAlarm sets the DatapointsToAlarm field's value. +func (s *PutAlarmInput) SetDatapointsToAlarm(v int64) *PutAlarmInput { + s.DatapointsToAlarm = &v + return s +} + +// SetEvaluationPeriods sets the EvaluationPeriods field's value. +func (s *PutAlarmInput) SetEvaluationPeriods(v int64) *PutAlarmInput { + s.EvaluationPeriods = &v + return s +} + +// SetMetricName sets the MetricName field's value. +func (s *PutAlarmInput) SetMetricName(v string) *PutAlarmInput { + s.MetricName = &v + return s +} + +// SetMonitoredResourceName sets the MonitoredResourceName field's value. +func (s *PutAlarmInput) SetMonitoredResourceName(v string) *PutAlarmInput { + s.MonitoredResourceName = &v + return s +} + +// SetNotificationEnabled sets the NotificationEnabled field's value. +func (s *PutAlarmInput) SetNotificationEnabled(v bool) *PutAlarmInput { + s.NotificationEnabled = &v + return s +} + +// SetNotificationTriggers sets the NotificationTriggers field's value. +func (s *PutAlarmInput) SetNotificationTriggers(v []*string) *PutAlarmInput { + s.NotificationTriggers = v + return s +} + +// SetThreshold sets the Threshold field's value. +func (s *PutAlarmInput) SetThreshold(v float64) *PutAlarmInput { + s.Threshold = &v + return s +} + +// SetTreatMissingData sets the TreatMissingData field's value. +func (s *PutAlarmInput) SetTreatMissingData(v string) *PutAlarmInput { + s.TreatMissingData = &v + return s +} + +type PutAlarmOutput struct { + _ struct{} `type:"structure"` + + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. + Operations []*Operation `locationName:"operations" type:"list"` +} + +// String returns the string representation +func (s PutAlarmOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PortInfo) GoString() string { +func (s PutAlarmOutput) 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 +// SetOperations sets the Operations field's value. +func (s *PutAlarmOutput) SetOperations(v []*Operation) *PutAlarmOutput { + s.Operations = v return s } @@ -22672,7 +25274,9 @@ func (s *PutInstancePublicPortsInput) SetPortInfos(v []*PortInfo) *PutInstancePu type PutInstancePublicPortsOutput struct { _ struct{} `type:"structure"` - // Describes metadata about the operation you just executed. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operation *Operation `locationName:"operation" type:"structure"` } @@ -22733,7 +25337,9 @@ func (s *RebootInstanceInput) SetInstanceName(v string) *RebootInstanceInput { type RebootInstanceOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the request operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -22794,7 +25400,9 @@ func (s *RebootRelationalDatabaseInput) SetRelationalDatabaseName(v string) *Reb type RebootRelationalDatabaseOutput struct { _ struct{} `type:"structure"` - // An object describing the result of your reboot relational database request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -22895,6 +25503,9 @@ type RelationalDatabase struct { // for the database. BackupRetentionEnabled *bool `locationName:"backupRetentionEnabled" type:"boolean"` + // The certificate associated with the database. + CaCertificateIdentifier *string `locationName:"caCertificateIdentifier" type:"string"` + // The timestamp when the database was created. Formatted in Unix time. CreatedAt *time.Time `locationName:"createdAt" type:"timestamp"` @@ -23000,6 +25611,12 @@ func (s *RelationalDatabase) SetBackupRetentionEnabled(v bool) *RelationalDataba return s } +// SetCaCertificateIdentifier sets the CaCertificateIdentifier field's value. +func (s *RelationalDatabase) SetCaCertificateIdentifier(v string) *RelationalDatabase { + s.CaCertificateIdentifier = &v + return s +} + // SetCreatedAt sets the CreatedAt field's value. func (s *RelationalDatabase) SetCreatedAt(v time.Time) *RelationalDatabase { s.CreatedAt = &v @@ -23718,7 +26335,9 @@ func (s *ReleaseStaticIpInput) SetStaticIpName(v string) *ReleaseStaticIpInput { type ReleaseStaticIpOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the request operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -23771,6 +26390,131 @@ func (s *ResourceLocation) SetRegionName(v string) *ResourceLocation { return s } +type SendContactMethodVerificationInput struct { + _ struct{} `type:"structure"` + + // The protocol to verify, such as Email or SMS (text messaging). + // + // Protocol is a required field + Protocol *string `locationName:"protocol" type:"string" required:"true" enum:"ContactMethodVerificationProtocol"` +} + +// String returns the string representation +func (s SendContactMethodVerificationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SendContactMethodVerificationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SendContactMethodVerificationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SendContactMethodVerificationInput"} + if s.Protocol == nil { + invalidParams.Add(request.NewErrParamRequired("Protocol")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetProtocol sets the Protocol field's value. +func (s *SendContactMethodVerificationInput) SetProtocol(v string) *SendContactMethodVerificationInput { + s.Protocol = &v + return s +} + +type SendContactMethodVerificationOutput struct { + _ struct{} `type:"structure"` + + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. + Operations []*Operation `locationName:"operations" type:"list"` +} + +// String returns the string representation +func (s SendContactMethodVerificationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SendContactMethodVerificationOutput) GoString() string { + return s.String() +} + +// SetOperations sets the Operations field's value. +func (s *SendContactMethodVerificationOutput) SetOperations(v []*Operation) *SendContactMethodVerificationOutput { + s.Operations = v + return s +} + +// A general service exception. +type ServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"code" type:"string"` + + Docs *string `locationName:"docs" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + Tip *string `locationName:"tip" type:"string"` +} + +// String returns the string representation +func (s ServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceException) GoString() string { + return s.String() +} + +func newErrorServiceException(v protocol.ResponseMetadata) error { + return &ServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceException) Code() string { + return "ServiceException" +} + +// Message returns the exception's message. +func (s ServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceException) OrigErr() error { + return nil +} + +func (s ServiceException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceException) RequestID() string { + return s.respMetadata.RequestID +} + type StartInstanceInput struct { _ struct{} `type:"structure"` @@ -23812,7 +26556,9 @@ func (s *StartInstanceInput) SetInstanceName(v string) *StartInstanceInput { type StartInstanceOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the request operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -23873,7 +26619,9 @@ func (s *StartRelationalDatabaseInput) SetRelationalDatabaseName(v string) *Star type StartRelationalDatabaseOutput struct { _ struct{} `type:"structure"` - // An object describing the result of your start relational database request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -24046,7 +26794,9 @@ func (s *StopInstanceInput) SetInstanceName(v string) *StopInstanceInput { type StopInstanceOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the request operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -24117,7 +26867,9 @@ func (s *StopRelationalDatabaseInput) SetRelationalDatabaseSnapshotName(v string type StopRelationalDatabaseOutput struct { _ struct{} `type:"structure"` - // An object describing the result of your stop relational database request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -24244,7 +26996,9 @@ func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { type TagResourceOutput struct { _ struct{} `type:"structure"` - // A list of objects describing the API operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -24264,6 +27018,155 @@ func (s *TagResourceOutput) SetOperations(v []*Operation) *TagResourceOutput { return s } +type TestAlarmInput struct { + _ struct{} `type:"structure"` + + // The name of the alarm to test. + // + // AlarmName is a required field + AlarmName *string `locationName:"alarmName" type:"string" required:"true"` + + // The alarm state to test. + // + // An alarm has the following possible states that can be tested: + // + // * ALARM — The metric is outside of the defined threshold. + // + // * INSUFFICIENT_DATA — The alarm has just started, the metric is not + // available, or not enough data is available for the metric to determine + // the alarm state. + // + // * OK — The metric is within the defined threshold. + // + // State is a required field + State *string `locationName:"state" type:"string" required:"true" enum:"AlarmState"` +} + +// String returns the string representation +func (s TestAlarmInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TestAlarmInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TestAlarmInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TestAlarmInput"} + if s.AlarmName == nil { + invalidParams.Add(request.NewErrParamRequired("AlarmName")) + } + if s.State == nil { + invalidParams.Add(request.NewErrParamRequired("State")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAlarmName sets the AlarmName field's value. +func (s *TestAlarmInput) SetAlarmName(v string) *TestAlarmInput { + s.AlarmName = &v + return s +} + +// SetState sets the State field's value. +func (s *TestAlarmInput) SetState(v string) *TestAlarmInput { + s.State = &v + return s +} + +type TestAlarmOutput struct { + _ struct{} `type:"structure"` + + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. + Operations []*Operation `locationName:"operations" type:"list"` +} + +// String returns the string representation +func (s TestAlarmOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TestAlarmOutput) GoString() string { + return s.String() +} + +// SetOperations sets the Operations field's value. +func (s *TestAlarmOutput) SetOperations(v []*Operation) *TestAlarmOutput { + s.Operations = v + return s +} + +// Lightsail throws this exception when the user has not been authenticated. +type UnauthenticatedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"code" type:"string"` + + Docs *string `locationName:"docs" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + Tip *string `locationName:"tip" type:"string"` +} + +// String returns the string representation +func (s UnauthenticatedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnauthenticatedException) GoString() string { + return s.String() +} + +func newErrorUnauthenticatedException(v protocol.ResponseMetadata) error { + return &UnauthenticatedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnauthenticatedException) Code() string { + return "UnauthenticatedException" +} + +// Message returns the exception's message. +func (s UnauthenticatedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnauthenticatedException) OrigErr() error { + return nil +} + +func (s UnauthenticatedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnauthenticatedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnauthenticatedException) RequestID() string { + return s.respMetadata.RequestID +} + type UnpeerVpcInput struct { _ struct{} `type:"structure"` } @@ -24281,7 +27184,9 @@ func (s UnpeerVpcInput) GoString() string { type UnpeerVpcOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the request operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operation *Operation `locationName:"operation" type:"structure"` } @@ -24366,7 +27271,9 @@ func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { type UntagResourceOutput struct { _ struct{} `type:"structure"` - // A list of objects describing the API operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -24441,7 +27348,9 @@ func (s *UpdateDomainEntryInput) SetDomainName(v string) *UpdateDomainEntryInput type UpdateDomainEntryOutput struct { _ struct{} `type:"structure"` - // An array of key-value pairs containing information about the request operation. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -24533,7 +27442,9 @@ func (s *UpdateLoadBalancerAttributeInput) SetLoadBalancerName(v string) *Update type UpdateLoadBalancerAttributeOutput struct { _ struct{} `type:"structure"` - // An object describing the API operations. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -24562,6 +27473,9 @@ type UpdateRelationalDatabaseInput struct { // Default: false ApplyImmediately *bool `locationName:"applyImmediately" type:"boolean"` + // Indicates the certificate that needs to be associated with the database. + CaCertificateIdentifier *string `locationName:"caCertificateIdentifier" type:"string"` + // When true, disables automated backup retention for your database. // // Disabling backup retention deletes all automated database backups. Before @@ -24664,6 +27578,12 @@ func (s *UpdateRelationalDatabaseInput) SetApplyImmediately(v bool) *UpdateRelat return s } +// SetCaCertificateIdentifier sets the CaCertificateIdentifier field's value. +func (s *UpdateRelationalDatabaseInput) SetCaCertificateIdentifier(v string) *UpdateRelationalDatabaseInput { + s.CaCertificateIdentifier = &v + return s +} + // SetDisableBackupRetention sets the DisableBackupRetention field's value. func (s *UpdateRelationalDatabaseInput) SetDisableBackupRetention(v bool) *UpdateRelationalDatabaseInput { s.DisableBackupRetention = &v @@ -24715,7 +27635,9 @@ func (s *UpdateRelationalDatabaseInput) SetRotateMasterUserPassword(v bool) *Upd type UpdateRelationalDatabaseOutput struct { _ struct{} `type:"structure"` - // An object describing the result of your update relational database request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -24790,8 +27712,9 @@ func (s *UpdateRelationalDatabaseParametersInput) SetRelationalDatabaseName(v st type UpdateRelationalDatabaseParametersOutput struct { _ struct{} `type:"structure"` - // An object describing the result of your update relational database parameters - // request. + // An array of objects that describe the result of the action, such as the status + // of the request, the time stamp of the request, and the resources affected + // by the request. Operations []*Operation `locationName:"operations" type:"list"` } @@ -24824,6 +27747,17 @@ const ( AddOnTypeAutoSnapshot = "AutoSnapshot" ) +const ( + // AlarmStateOk is a AlarmState enum value + AlarmStateOk = "OK" + + // AlarmStateAlarm is a AlarmState enum value + AlarmStateAlarm = "ALARM" + + // AlarmStateInsufficientData is a AlarmState enum value + AlarmStateInsufficientData = "INSUFFICIENT_DATA" +) + const ( // AutoSnapshotStatusSuccess is a AutoSnapshotStatus enum value AutoSnapshotStatusSuccess = "Success" @@ -24851,6 +27785,44 @@ const ( CloudFormationStackRecordSourceTypeExportSnapshotRecord = "ExportSnapshotRecord" ) +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 ( + // ContactMethodStatusPendingVerification is a ContactMethodStatus enum value + ContactMethodStatusPendingVerification = "PendingVerification" + + // ContactMethodStatusValid is a ContactMethodStatus enum value + ContactMethodStatusValid = "Valid" + + // ContactMethodStatusInvalid is a ContactMethodStatus enum value + ContactMethodStatusInvalid = "Invalid" +) + +const ( + // ContactMethodVerificationProtocolEmail is a ContactMethodVerificationProtocol enum value + ContactMethodVerificationProtocolEmail = "Email" +) + +const ( + // ContactProtocolEmail is a ContactProtocol enum value + ContactProtocolEmail = "Email" + + // ContactProtocolSms is a ContactProtocol enum value + ContactProtocolSms = "SMS" +) + const ( // DiskSnapshotStatePending is a DiskSnapshotState enum value DiskSnapshotStatePending = "pending" @@ -25166,6 +28138,77 @@ const ( LoadBalancerTlsCertificateStatusUnknown = "UNKNOWN" ) +const ( + // MetricNameCpuutilization is a MetricName enum value + MetricNameCpuutilization = "CPUUtilization" + + // MetricNameNetworkIn is a MetricName enum value + MetricNameNetworkIn = "NetworkIn" + + // MetricNameNetworkOut is a MetricName enum value + MetricNameNetworkOut = "NetworkOut" + + // MetricNameStatusCheckFailed is a MetricName enum value + MetricNameStatusCheckFailed = "StatusCheckFailed" + + // MetricNameStatusCheckFailedInstance is a MetricName enum value + MetricNameStatusCheckFailedInstance = "StatusCheckFailed_Instance" + + // MetricNameStatusCheckFailedSystem is a MetricName enum value + MetricNameStatusCheckFailedSystem = "StatusCheckFailed_System" + + // MetricNameClientTlsnegotiationErrorCount is a MetricName enum value + MetricNameClientTlsnegotiationErrorCount = "ClientTLSNegotiationErrorCount" + + // MetricNameHealthyHostCount is a MetricName enum value + MetricNameHealthyHostCount = "HealthyHostCount" + + // MetricNameUnhealthyHostCount is a MetricName enum value + MetricNameUnhealthyHostCount = "UnhealthyHostCount" + + // MetricNameHttpcodeLb4xxCount is a MetricName enum value + MetricNameHttpcodeLb4xxCount = "HTTPCode_LB_4XX_Count" + + // MetricNameHttpcodeLb5xxCount is a MetricName enum value + MetricNameHttpcodeLb5xxCount = "HTTPCode_LB_5XX_Count" + + // MetricNameHttpcodeInstance2xxCount is a MetricName enum value + MetricNameHttpcodeInstance2xxCount = "HTTPCode_Instance_2XX_Count" + + // MetricNameHttpcodeInstance3xxCount is a MetricName enum value + MetricNameHttpcodeInstance3xxCount = "HTTPCode_Instance_3XX_Count" + + // MetricNameHttpcodeInstance4xxCount is a MetricName enum value + MetricNameHttpcodeInstance4xxCount = "HTTPCode_Instance_4XX_Count" + + // MetricNameHttpcodeInstance5xxCount is a MetricName enum value + MetricNameHttpcodeInstance5xxCount = "HTTPCode_Instance_5XX_Count" + + // MetricNameInstanceResponseTime is a MetricName enum value + MetricNameInstanceResponseTime = "InstanceResponseTime" + + // MetricNameRejectedConnectionCount is a MetricName enum value + MetricNameRejectedConnectionCount = "RejectedConnectionCount" + + // MetricNameRequestCount is a MetricName enum value + MetricNameRequestCount = "RequestCount" + + // MetricNameDatabaseConnections is a MetricName enum value + MetricNameDatabaseConnections = "DatabaseConnections" + + // MetricNameDiskQueueDepth is a MetricName enum value + MetricNameDiskQueueDepth = "DiskQueueDepth" + + // MetricNameFreeStorageSpace is a MetricName enum value + MetricNameFreeStorageSpace = "FreeStorageSpace" + + // MetricNameNetworkReceiveThroughput is a MetricName enum value + MetricNameNetworkReceiveThroughput = "NetworkReceiveThroughput" + + // MetricNameNetworkTransmitThroughput is a MetricName enum value + MetricNameNetworkTransmitThroughput = "NetworkTransmitThroughput" +) + const ( // MetricStatisticMinimum is a MetricStatistic enum value MetricStatisticMinimum = "Minimum" @@ -25435,6 +28478,30 @@ const ( // OperationTypeDisableAddOn is a OperationType enum value OperationTypeDisableAddOn = "DisableAddOn" + + // OperationTypePutAlarm is a OperationType enum value + OperationTypePutAlarm = "PutAlarm" + + // OperationTypeGetAlarms is a OperationType enum value + OperationTypeGetAlarms = "GetAlarms" + + // OperationTypeDeleteAlarm is a OperationType enum value + OperationTypeDeleteAlarm = "DeleteAlarm" + + // OperationTypeTestAlarm is a OperationType enum value + OperationTypeTestAlarm = "TestAlarm" + + // OperationTypeCreateContactMethod is a OperationType enum value + OperationTypeCreateContactMethod = "CreateContactMethod" + + // OperationTypeGetContactMethods is a OperationType enum value + OperationTypeGetContactMethods = "GetContactMethods" + + // OperationTypeSendContactMethodVerification is a OperationType enum value + OperationTypeSendContactMethodVerification = "SendContactMethodVerification" + + // OperationTypeDeleteContactMethod is a OperationType enum value + OperationTypeDeleteContactMethod = "DeleteContactMethod" ) const ( @@ -25600,4 +28667,24 @@ const ( // ResourceTypeCloudFormationStackRecord is a ResourceType enum value ResourceTypeCloudFormationStackRecord = "CloudFormationStackRecord" + + // ResourceTypeAlarm is a ResourceType enum value + ResourceTypeAlarm = "Alarm" + + // ResourceTypeContactMethod is a ResourceType enum value + ResourceTypeContactMethod = "ContactMethod" +) + +const ( + // TreatMissingDataBreaching is a TreatMissingData enum value + TreatMissingDataBreaching = "breaching" + + // TreatMissingDataNotBreaching is a TreatMissingData enum value + TreatMissingDataNotBreaching = "notBreaching" + + // TreatMissingDataIgnore is a TreatMissingData enum value + TreatMissingDataIgnore = "ignore" + + // TreatMissingDataMissing is a TreatMissingData enum value + TreatMissingDataMissing = "missing" ) 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 index bda8b8a6688..dbfd78b434d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lightsail/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lightsail/errors.go @@ -2,6 +2,10 @@ package lightsail +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccessDeniedException for service response error code @@ -53,3 +57,13 @@ const ( // Lightsail throws this exception when the user has not been authenticated. ErrCodeUnauthenticatedException = "UnauthenticatedException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "AccountSetupInProgressException": newErrorAccountSetupInProgressException, + "InvalidInputException": newErrorInvalidInputException, + "NotFoundException": newErrorNotFoundException, + "OperationFailureException": newErrorOperationFailureException, + "ServiceException": newErrorServiceException, + "UnauthenticatedException": newErrorUnauthenticatedException, +} 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 index b9f97faa8a6..171dd999964 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/lightsail/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/lightsail/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "lightsail" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Lightsail" // ServiceID is a unique identifer of a specific service. + ServiceID = "Lightsail" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Lightsail client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Lightsail client from just a session. // svc := lightsail.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Lightsail { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Lightsail { svc := &Lightsail{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-11-28", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/macie/api.go b/vendor/github.com/aws/aws-sdk-go/service/macie/api.go index 1015a9f809c..615361d048f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/macie/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/macie/api.go @@ -66,16 +66,16 @@ func (c *Macie) AssociateMemberAccountRequest(input *AssociateMemberAccountInput // See the AWS API reference guide for Amazon Macie's // API operation AssociateMemberAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeInternalException "InternalException" +// * InternalException // Internal server error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/AssociateMemberAccount @@ -157,19 +157,19 @@ func (c *Macie) AssociateS3ResourcesRequest(input *AssociateS3ResourcesInput) (r // See the AWS API reference guide for Amazon Macie's // API operation AssociateS3Resources for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeInternalException "InternalException" +// * InternalException // Internal server error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/AssociateS3Resources @@ -248,12 +248,12 @@ func (c *Macie) DisassociateMemberAccountRequest(input *DisassociateMemberAccoun // See the AWS API reference guide for Amazon Macie's // API operation DisassociateMemberAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeInternalException "InternalException" +// * InternalException // Internal server error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/DisassociateMemberAccount @@ -334,15 +334,15 @@ func (c *Macie) DisassociateS3ResourcesRequest(input *DisassociateS3ResourcesInp // See the AWS API reference guide for Amazon Macie's // API operation DisassociateS3Resources for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeInternalException "InternalException" +// * InternalException // Internal server error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/DisassociateS3Resources @@ -427,11 +427,11 @@ func (c *Macie) ListMemberAccountsRequest(input *ListMemberAccountsInput) (req * // See the AWS API reference guide for Amazon Macie's // API operation ListMemberAccounts for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // @@ -500,10 +500,12 @@ func (c *Macie) ListMemberAccountsPagesWithContext(ctx aws.Context, input *ListM }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListMemberAccountsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListMemberAccountsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -570,15 +572,15 @@ func (c *Macie) ListS3ResourcesRequest(input *ListS3ResourcesInput) (req *reques // See the AWS API reference guide for Amazon Macie's // API operation ListS3Resources for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeInternalException "InternalException" +// * InternalException // Internal server error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/ListS3Resources @@ -646,10 +648,12 @@ func (c *Macie) ListS3ResourcesPagesWithContext(ctx aws.Context, input *ListS3Re }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListS3ResourcesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListS3ResourcesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -710,15 +714,15 @@ func (c *Macie) UpdateS3ResourcesRequest(input *UpdateS3ResourcesInput) (req *re // See the AWS API reference guide for Amazon Macie's // API operation UpdateS3Resources for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // The request was rejected because an invalid or out-of-range value was supplied // for an input parameter. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have required permissions to access the requested resource. // -// * ErrCodeInternalException "InternalException" +// * InternalException // Internal server error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/macie-2017-12-19/UpdateS3Resources @@ -743,6 +747,65 @@ func (c *Macie) UpdateS3ResourcesWithContext(ctx aws.Context, input *UpdateS3Res return out, req.Send() } +// You do not have required permissions to access the requested resource. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + // Resource type that caused the exception + ResourceType *string `locationName:"resourceType" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + type AssociateMemberAccountInput struct { _ struct{} `type:"structure"` @@ -1151,6 +1214,191 @@ func (s *FailedS3Resource) SetFailedItem(v *S3Resource) *FailedS3Resource { return s } +// Internal server error. +type InternalException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Error code for the exception + ErrorCode *string `locationName:"errorCode" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalException) GoString() string { + return s.String() +} + +func newErrorInternalException(v protocol.ResponseMetadata) error { + return &InternalException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalException) Code() string { + return "InternalException" +} + +// Message returns the exception's message. +func (s InternalException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalException) OrigErr() error { + return nil +} + +func (s InternalException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because an invalid or out-of-range value was supplied +// for an input parameter. +type InvalidInputException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Error code for the exception + ErrorCode *string `locationName:"errorCode" type:"string"` + + // Field that has invalid input + FieldName *string `locationName:"fieldName" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidInputException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInputException) GoString() string { + return s.String() +} + +func newErrorInvalidInputException(v protocol.ResponseMetadata) error { + return &InvalidInputException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInputException) Code() string { + return "InvalidInputException" +} + +// Message returns the exception's message. +func (s InvalidInputException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInputException) OrigErr() error { + return nil +} + +func (s InvalidInputException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInputException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInputException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error code describes the limit exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Error code for the exception + ErrorCode *string `locationName:"errorCode" type:"string"` + + Message_ *string `locationName:"message" type:"string"` + + // Resource type that caused the exception + ResourceType *string `locationName:"resourceType" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListMemberAccountsInput struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/macie/errors.go b/vendor/github.com/aws/aws-sdk-go/service/macie/errors.go index 77768d52eb5..9c265a3d1bc 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/macie/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/macie/errors.go @@ -2,6 +2,10 @@ package macie +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccessDeniedException for service response error code @@ -30,3 +34,10 @@ const ( // the current AWS account limits. The error code describes the limit exceeded. ErrCodeLimitExceededException = "LimitExceededException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "InternalException": newErrorInternalException, + "InvalidInputException": newErrorInvalidInputException, + "LimitExceededException": newErrorLimitExceededException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/macie/service.go b/vendor/github.com/aws/aws-sdk-go/service/macie/service.go index 0b38598f0fe..e4eca163c26 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/macie/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/macie/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "Macie" // Name of service. EndpointsID = "macie" // ID to lookup a service endpoint with. - ServiceID = "Macie" // ServiceID is a unique identifer of a specific service. + ServiceID = "Macie" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Macie client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Macie client from just a session. // svc := macie.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := macie.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *Macie { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Macie { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Macie { svc := &Macie{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-12-19", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/managedblockchain/api.go b/vendor/github.com/aws/aws-sdk-go/service/managedblockchain/api.go index a0bd14cbfd8..d2537bef0f0 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/managedblockchain/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/managedblockchain/api.go @@ -66,37 +66,37 @@ func (c *ManagedBlockchain) CreateMemberRequest(input *CreateMemberInput) (req * // See the AWS API reference guide for Amazon Managed Blockchain's // API operation CreateMember for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A requested resource does not exist on the network. It may have been deleted // or referenced inaccurately. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // A resource request is issued for a resource that already exists. // -// * ErrCodeResourceNotReadyException "ResourceNotReadyException" +// * ResourceNotReadyException // The requested resource exists but is not in a status that can complete the // operation. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" +// * ResourceLimitExceededException // The maximum number of resources of that type already exist. Ensure the resources // requested are within the boundaries of the service edition and your account // limits. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -175,29 +175,29 @@ func (c *ManagedBlockchain) CreateNetworkRequest(input *CreateNetworkInput) (req // See the AWS API reference guide for Amazon Managed Blockchain's // API operation CreateNetwork for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // A resource request is issued for a resource that already exists. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" +// * ResourceLimitExceededException // The maximum number of resources of that type already exist. Ensure the resources // requested are within the boundaries of the service edition and your account // limits. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -276,37 +276,37 @@ func (c *ManagedBlockchain) CreateNodeRequest(input *CreateNodeInput) (req *requ // See the AWS API reference guide for Amazon Managed Blockchain's // API operation CreateNode for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A requested resource does not exist on the network. It may have been deleted // or referenced inaccurately. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // A resource request is issued for a resource that already exists. // -// * ErrCodeResourceNotReadyException "ResourceNotReadyException" +// * ResourceNotReadyException // The requested resource exists but is not in a status that can complete the // operation. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" +// * ResourceLimitExceededException // The maximum number of resources of that type already exist. Ensure the resources // requested are within the boundaries of the service edition and your account // limits. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -387,29 +387,29 @@ func (c *ManagedBlockchain) CreateProposalRequest(input *CreateProposalInput) (r // See the AWS API reference guide for Amazon Managed Blockchain's // API operation CreateProposal for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A requested resource does not exist on the network. It may have been deleted // or referenced inaccurately. // -// * ErrCodeResourceNotReadyException "ResourceNotReadyException" +// * ResourceNotReadyException // The requested resource exists but is not in a status that can complete the // operation. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -495,29 +495,29 @@ func (c *ManagedBlockchain) DeleteMemberRequest(input *DeleteMemberInput) (req * // See the AWS API reference guide for Amazon Managed Blockchain's // API operation DeleteMember for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A requested resource does not exist on the network. It may have been deleted // or referenced inaccurately. // -// * ErrCodeResourceNotReadyException "ResourceNotReadyException" +// * ResourceNotReadyException // The requested resource exists but is not in a status that can complete the // operation. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -598,29 +598,29 @@ func (c *ManagedBlockchain) DeleteNodeRequest(input *DeleteNodeInput) (req *requ // See the AWS API reference guide for Amazon Managed Blockchain's // API operation DeleteNode for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A requested resource does not exist on the network. It may have been deleted // or referenced inaccurately. // -// * ErrCodeResourceNotReadyException "ResourceNotReadyException" +// * ResourceNotReadyException // The requested resource exists but is not in a status that can complete the // operation. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -699,25 +699,25 @@ func (c *ManagedBlockchain) GetMemberRequest(input *GetMemberInput) (req *reques // See the AWS API reference guide for Amazon Managed Blockchain's // API operation GetMember for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A requested resource does not exist on the network. It may have been deleted // or referenced inaccurately. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -796,25 +796,25 @@ func (c *ManagedBlockchain) GetNetworkRequest(input *GetNetworkInput) (req *requ // See the AWS API reference guide for Amazon Managed Blockchain's // API operation GetNetwork for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A requested resource does not exist on the network. It may have been deleted // or referenced inaccurately. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -893,25 +893,25 @@ func (c *ManagedBlockchain) GetNodeRequest(input *GetNodeInput) (req *request.Re // See the AWS API reference guide for Amazon Managed Blockchain's // API operation GetNode for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A requested resource does not exist on the network. It may have been deleted // or referenced inaccurately. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -990,25 +990,25 @@ func (c *ManagedBlockchain) GetProposalRequest(input *GetProposalInput) (req *re // See the AWS API reference guide for Amazon Managed Blockchain's // API operation GetProposal for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A requested resource does not exist on the network. It may have been deleted // or referenced inaccurately. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -1093,30 +1093,30 @@ func (c *ManagedBlockchain) ListInvitationsRequest(input *ListInvitationsInput) // See the AWS API reference guide for Amazon Managed Blockchain's // API operation ListInvitations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A requested resource does not exist on the network. It may have been deleted // or referenced inaccurately. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" +// * ResourceLimitExceededException // The maximum number of resources of that type already exist. Ensure the resources // requested are within the boundaries of the service edition and your account // limits. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -1185,10 +1185,12 @@ func (c *ManagedBlockchain) ListInvitationsPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInvitationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListInvitationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1251,21 +1253,21 @@ func (c *ManagedBlockchain) ListMembersRequest(input *ListMembersInput) (req *re // See the AWS API reference guide for Amazon Managed Blockchain's // API operation ListMembers for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -1334,10 +1336,12 @@ func (c *ManagedBlockchain) ListMembersPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListMembersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListMembersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1401,21 +1405,21 @@ func (c *ManagedBlockchain) ListNetworksRequest(input *ListNetworksInput) (req * // See the AWS API reference guide for Amazon Managed Blockchain's // API operation ListNetworks for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -1484,10 +1488,12 @@ func (c *ManagedBlockchain) ListNetworksPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListNetworksOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListNetworksOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1550,21 +1556,21 @@ func (c *ManagedBlockchain) ListNodesRequest(input *ListNodesInput) (req *reques // See the AWS API reference guide for Amazon Managed Blockchain's // API operation ListNodes for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -1633,10 +1639,12 @@ func (c *ManagedBlockchain) ListNodesPagesWithContext(ctx aws.Context, input *Li }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListNodesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListNodesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1700,21 +1708,21 @@ func (c *ManagedBlockchain) ListProposalVotesRequest(input *ListProposalVotesInp // See the AWS API reference guide for Amazon Managed Blockchain's // API operation ListProposalVotes for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -1783,10 +1791,12 @@ func (c *ManagedBlockchain) ListProposalVotesPagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListProposalVotesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListProposalVotesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1849,25 +1859,25 @@ func (c *ManagedBlockchain) ListProposalsRequest(input *ListProposalsInput) (req // See the AWS API reference guide for Amazon Managed Blockchain's // API operation ListProposals for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A requested resource does not exist on the network. It may have been deleted // or referenced inaccurately. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -1936,10 +1946,12 @@ func (c *ManagedBlockchain) ListProposalsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListProposalsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListProposalsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1999,27 +2011,27 @@ func (c *ManagedBlockchain) RejectInvitationRequest(input *RejectInvitationInput // See the AWS API reference guide for Amazon Managed Blockchain's // API operation RejectInvitation for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeIllegalActionException "IllegalActionException" +// * IllegalActionException // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A requested resource does not exist on the network. It may have been deleted // or referenced inaccurately. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -2101,27 +2113,27 @@ func (c *ManagedBlockchain) VoteOnProposalRequest(input *VoteOnProposalInput) (r // See the AWS API reference guide for Amazon Managed Blockchain's // API operation VoteOnProposal for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The action or operation requested is invalid. Verify that the action is typed // correctly. // -// * ErrCodeIllegalActionException "IllegalActionException" +// * IllegalActionException // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // A requested resource does not exist on the network. It may have been deleted // or referenced inaccurately. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request or operation could not be performed because a service is throttling // requests. The most common source of throttling errors is launching EC2 instances // such that your service limit for EC2 instances is exceeded. Request a limit // increase or delete unused resources if possible. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // The request processing has failed because of an unknown error, exception // or failure. // @@ -2147,6 +2159,62 @@ func (c *ManagedBlockchain) VoteOnProposalWithContext(ctx aws.Context, input *Vo return out, req.Send() } +// You do not have sufficient access to perform this action. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + // A policy type that defines the voting rules for the network. The rules decide // if a proposal is approved. Approval may be based on criteria such as the // percentage of YES votes and the duration of the proposal. The policy applies @@ -3244,6 +3312,175 @@ func (s *GetProposalOutput) SetProposal(v *Proposal) *GetProposalOutput { return s } +type IllegalActionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s IllegalActionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IllegalActionException) GoString() string { + return s.String() +} + +func newErrorIllegalActionException(v protocol.ResponseMetadata) error { + return &IllegalActionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IllegalActionException) Code() string { + return "IllegalActionException" +} + +// Message returns the exception's message. +func (s IllegalActionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IllegalActionException) OrigErr() error { + return nil +} + +func (s IllegalActionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IllegalActionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IllegalActionException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request processing has failed because of an unknown error, exception +// or failure. +type InternalServiceErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalServiceErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServiceErrorException) GoString() string { + return s.String() +} + +func newErrorInternalServiceErrorException(v protocol.ResponseMetadata) error { + return &InternalServiceErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServiceErrorException) Code() string { + return "InternalServiceErrorException" +} + +// Message returns the exception's message. +func (s InternalServiceErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServiceErrorException) OrigErr() error { + return nil +} + +func (s InternalServiceErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServiceErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServiceErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// The action or operation requested is invalid. Verify that the action is typed +// correctly. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // An invitation to an AWS account to create a member and join the network. type Invitation struct { _ struct{} `type:"structure"` @@ -5411,6 +5648,293 @@ func (s *RemoveAction) SetMemberId(v string) *RemoveAction { return s } +// A resource request is issued for a resource that already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The maximum number of resources of that type already exist. Ensure the resources +// requested are within the boundaries of the service edition and your account +// limits. +type ResourceLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceLimitExceededException) GoString() string { + return s.String() +} + +func newErrorResourceLimitExceededException(v protocol.ResponseMetadata) error { + return &ResourceLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceLimitExceededException) Code() string { + return "ResourceLimitExceededException" +} + +// Message returns the exception's message. +func (s ResourceLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceLimitExceededException) OrigErr() error { + return nil +} + +func (s ResourceLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// A requested resource does not exist on the network. It may have been deleted +// or referenced inaccurately. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested resource exists but is not in a status that can complete the +// operation. +type ResourceNotReadyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotReadyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotReadyException) GoString() string { + return s.String() +} + +func newErrorResourceNotReadyException(v protocol.ResponseMetadata) error { + return &ResourceNotReadyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotReadyException) Code() string { + return "ResourceNotReadyException" +} + +// Message returns the exception's message. +func (s ResourceNotReadyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotReadyException) OrigErr() error { + return nil +} + +func (s ResourceNotReadyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotReadyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotReadyException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request or operation could not be performed because a service is throttling +// requests. The most common source of throttling errors is launching EC2 instances +// such that your service limit for EC2 instances is exceeded. Request a limit +// increase or delete unused resources if possible. +type ThrottlingException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ThrottlingException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ThrottlingException) GoString() string { + return s.String() +} + +func newErrorThrottlingException(v protocol.ResponseMetadata) error { + return &ThrottlingException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ThrottlingException) Code() string { + return "ThrottlingException" +} + +// Message returns the exception's message. +func (s ThrottlingException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ThrottlingException) OrigErr() error { + return nil +} + +func (s ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ThrottlingException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ThrottlingException) RequestID() string { + return s.respMetadata.RequestID +} + type VoteOnProposalInput struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/managedblockchain/errors.go b/vendor/github.com/aws/aws-sdk-go/service/managedblockchain/errors.go index a959e22ee9d..6e803ddae39 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/managedblockchain/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/managedblockchain/errors.go @@ -2,6 +2,10 @@ package managedblockchain +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccessDeniedException for service response error code @@ -65,3 +69,15 @@ const ( // increase or delete unused resources if possible. ErrCodeThrottlingException = "ThrottlingException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "IllegalActionException": newErrorIllegalActionException, + "InternalServiceErrorException": newErrorInternalServiceErrorException, + "InvalidRequestException": newErrorInvalidRequestException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceLimitExceededException": newErrorResourceLimitExceededException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ResourceNotReadyException": newErrorResourceNotReadyException, + "ThrottlingException": newErrorThrottlingException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/managedblockchain/service.go b/vendor/github.com/aws/aws-sdk-go/service/managedblockchain/service.go index d3049e6c546..ade725afa64 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/managedblockchain/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/managedblockchain/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "ManagedBlockchain" // Name of service. EndpointsID = "managedblockchain" // ID to lookup a service endpoint with. - ServiceID = "ManagedBlockchain" // ServiceID is a unique identifer of a specific service. + ServiceID = "ManagedBlockchain" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ManagedBlockchain client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ManagedBlockchain client from just a session. // svc := managedblockchain.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *ManagedBlockchain { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "managedblockchain" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ManagedBlockchain { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ManagedBlockchain { svc := &ManagedBlockchain{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-09-24", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/marketplacecatalog/api.go b/vendor/github.com/aws/aws-sdk-go/service/marketplacecatalog/api.go new file mode 100644 index 00000000000..41c04b48ec8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/marketplacecatalog/api.go @@ -0,0 +1,2432 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package marketplacecatalog + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" +) + +const opCancelChangeSet = "CancelChangeSet" + +// CancelChangeSetRequest generates a "aws/request.Request" representing the +// client's request for the CancelChangeSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CancelChangeSet for more information on using the CancelChangeSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CancelChangeSetRequest method. +// req, resp := client.CancelChangeSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17/CancelChangeSet +func (c *MarketplaceCatalog) CancelChangeSetRequest(input *CancelChangeSetInput) (req *request.Request, output *CancelChangeSetOutput) { + op := &request.Operation{ + Name: opCancelChangeSet, + HTTPMethod: "PATCH", + HTTPPath: "/CancelChangeSet", + } + + if input == nil { + input = &CancelChangeSetInput{} + } + + output = &CancelChangeSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// CancelChangeSet API operation for AWS Marketplace Catalog Service. +// +// Used to cancel an open change request. Must be sent before the status of +// the request changes to APPLYING, the final stage of completing your change +// request. You can describe a change during the 60-day request history retention +// period for API 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 AWS Marketplace Catalog Service's +// API operation CancelChangeSet for usage and error information. +// +// Returned Error Types: +// * InternalServiceException +// There was an internal service exception. +// +// * AccessDeniedException +// Access is denied. +// +// * ValidationException +// An error occurred during validation. +// +// * ResourceNotFoundException +// The specified resource wasn't found. +// +// * ResourceInUseException +// The resource is currently in use. +// +// * ThrottlingException +// Too many requests. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17/CancelChangeSet +func (c *MarketplaceCatalog) CancelChangeSet(input *CancelChangeSetInput) (*CancelChangeSetOutput, error) { + req, out := c.CancelChangeSetRequest(input) + return out, req.Send() +} + +// CancelChangeSetWithContext is the same as CancelChangeSet with the addition of +// the ability to pass a context and additional request options. +// +// See CancelChangeSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MarketplaceCatalog) CancelChangeSetWithContext(ctx aws.Context, input *CancelChangeSetInput, opts ...request.Option) (*CancelChangeSetOutput, error) { + req, out := c.CancelChangeSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeChangeSet = "DescribeChangeSet" + +// DescribeChangeSetRequest generates a "aws/request.Request" representing the +// client's request for the DescribeChangeSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeChangeSet for more information on using the DescribeChangeSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeChangeSetRequest method. +// req, resp := client.DescribeChangeSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17/DescribeChangeSet +func (c *MarketplaceCatalog) DescribeChangeSetRequest(input *DescribeChangeSetInput) (req *request.Request, output *DescribeChangeSetOutput) { + op := &request.Operation{ + Name: opDescribeChangeSet, + HTTPMethod: "GET", + HTTPPath: "/DescribeChangeSet", + } + + if input == nil { + input = &DescribeChangeSetInput{} + } + + output = &DescribeChangeSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeChangeSet API operation for AWS Marketplace Catalog Service. +// +// Provides information about a given 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 Marketplace Catalog Service's +// API operation DescribeChangeSet for usage and error information. +// +// Returned Error Types: +// * InternalServiceException +// There was an internal service exception. +// +// * AccessDeniedException +// Access is denied. +// +// * ValidationException +// An error occurred during validation. +// +// * ResourceNotFoundException +// The specified resource wasn't found. +// +// * ThrottlingException +// Too many requests. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17/DescribeChangeSet +func (c *MarketplaceCatalog) DescribeChangeSet(input *DescribeChangeSetInput) (*DescribeChangeSetOutput, error) { + req, out := c.DescribeChangeSetRequest(input) + return out, req.Send() +} + +// DescribeChangeSetWithContext is the same as DescribeChangeSet with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeChangeSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MarketplaceCatalog) DescribeChangeSetWithContext(ctx aws.Context, input *DescribeChangeSetInput, opts ...request.Option) (*DescribeChangeSetOutput, error) { + req, out := c.DescribeChangeSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeEntity = "DescribeEntity" + +// DescribeEntityRequest generates a "aws/request.Request" representing the +// client's request for the DescribeEntity operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeEntity for more information on using the DescribeEntity +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeEntityRequest method. +// req, resp := client.DescribeEntityRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17/DescribeEntity +func (c *MarketplaceCatalog) DescribeEntityRequest(input *DescribeEntityInput) (req *request.Request, output *DescribeEntityOutput) { + op := &request.Operation{ + Name: opDescribeEntity, + HTTPMethod: "GET", + HTTPPath: "/DescribeEntity", + } + + if input == nil { + input = &DescribeEntityInput{} + } + + output = &DescribeEntityOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeEntity API operation for AWS Marketplace Catalog Service. +// +// Returns the metadata and content of the entity. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Marketplace Catalog Service's +// API operation DescribeEntity for usage and error information. +// +// Returned Error Types: +// * InternalServiceException +// There was an internal service exception. +// +// * AccessDeniedException +// Access is denied. +// +// * ValidationException +// An error occurred during validation. +// +// * ResourceNotSupportedException +// Currently, the specified resource is not supported. +// +// * ResourceNotFoundException +// The specified resource wasn't found. +// +// * ThrottlingException +// Too many requests. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17/DescribeEntity +func (c *MarketplaceCatalog) DescribeEntity(input *DescribeEntityInput) (*DescribeEntityOutput, error) { + req, out := c.DescribeEntityRequest(input) + return out, req.Send() +} + +// DescribeEntityWithContext is the same as DescribeEntity with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeEntity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MarketplaceCatalog) DescribeEntityWithContext(ctx aws.Context, input *DescribeEntityInput, opts ...request.Option) (*DescribeEntityOutput, error) { + req, out := c.DescribeEntityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListChangeSets = "ListChangeSets" + +// ListChangeSetsRequest generates a "aws/request.Request" representing the +// client's request for the ListChangeSets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListChangeSets for more information on using the ListChangeSets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListChangeSetsRequest method. +// req, resp := client.ListChangeSetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17/ListChangeSets +func (c *MarketplaceCatalog) ListChangeSetsRequest(input *ListChangeSetsInput) (req *request.Request, output *ListChangeSetsOutput) { + op := &request.Operation{ + Name: opListChangeSets, + HTTPMethod: "POST", + HTTPPath: "/ListChangeSets", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListChangeSetsInput{} + } + + output = &ListChangeSetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListChangeSets API operation for AWS Marketplace Catalog Service. +// +// Returns the list of change sets owned by the account being used to make the +// call. You can filter this list by providing any combination of entityId, +// ChangeSetName, and status. If you provide more than one filter, the API operation +// applies a logical AND between the filters. +// +// You can describe a change during the 60-day request history retention period +// for API 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 AWS Marketplace Catalog Service's +// API operation ListChangeSets for usage and error information. +// +// Returned Error Types: +// * InternalServiceException +// There was an internal service exception. +// +// * AccessDeniedException +// Access is denied. +// +// * ValidationException +// An error occurred during validation. +// +// * ThrottlingException +// Too many requests. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17/ListChangeSets +func (c *MarketplaceCatalog) ListChangeSets(input *ListChangeSetsInput) (*ListChangeSetsOutput, error) { + req, out := c.ListChangeSetsRequest(input) + return out, req.Send() +} + +// ListChangeSetsWithContext is the same as ListChangeSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListChangeSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MarketplaceCatalog) ListChangeSetsWithContext(ctx aws.Context, input *ListChangeSetsInput, opts ...request.Option) (*ListChangeSetsOutput, error) { + req, out := c.ListChangeSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListChangeSetsPages iterates over the pages of a ListChangeSets operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListChangeSets 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 ListChangeSets operation. +// pageNum := 0 +// err := client.ListChangeSetsPages(params, +// func(page *marketplacecatalog.ListChangeSetsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *MarketplaceCatalog) ListChangeSetsPages(input *ListChangeSetsInput, fn func(*ListChangeSetsOutput, bool) bool) error { + return c.ListChangeSetsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListChangeSetsPagesWithContext same as ListChangeSetsPages 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 *MarketplaceCatalog) ListChangeSetsPagesWithContext(ctx aws.Context, input *ListChangeSetsInput, fn func(*ListChangeSetsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListChangeSetsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListChangeSetsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListChangeSetsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListEntities = "ListEntities" + +// ListEntitiesRequest generates a "aws/request.Request" representing the +// client's request for the ListEntities operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListEntities for more information on using the ListEntities +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListEntitiesRequest method. +// req, resp := client.ListEntitiesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17/ListEntities +func (c *MarketplaceCatalog) ListEntitiesRequest(input *ListEntitiesInput) (req *request.Request, output *ListEntitiesOutput) { + op := &request.Operation{ + Name: opListEntities, + HTTPMethod: "POST", + HTTPPath: "/ListEntities", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListEntitiesInput{} + } + + output = &ListEntitiesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListEntities API operation for AWS Marketplace Catalog Service. +// +// Provides the list of entities of a given 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 AWS Marketplace Catalog Service's +// API operation ListEntities for usage and error information. +// +// Returned Error Types: +// * InternalServiceException +// There was an internal service exception. +// +// * AccessDeniedException +// Access is denied. +// +// * ValidationException +// An error occurred during validation. +// +// * ResourceNotFoundException +// The specified resource wasn't found. +// +// * ThrottlingException +// Too many requests. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17/ListEntities +func (c *MarketplaceCatalog) ListEntities(input *ListEntitiesInput) (*ListEntitiesOutput, error) { + req, out := c.ListEntitiesRequest(input) + return out, req.Send() +} + +// ListEntitiesWithContext is the same as ListEntities with the addition of +// the ability to pass a context and additional request options. +// +// See ListEntities for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MarketplaceCatalog) ListEntitiesWithContext(ctx aws.Context, input *ListEntitiesInput, opts ...request.Option) (*ListEntitiesOutput, error) { + req, out := c.ListEntitiesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListEntitiesPages iterates over the pages of a ListEntities operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListEntities 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 ListEntities operation. +// pageNum := 0 +// err := client.ListEntitiesPages(params, +// func(page *marketplacecatalog.ListEntitiesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *MarketplaceCatalog) ListEntitiesPages(input *ListEntitiesInput, fn func(*ListEntitiesOutput, bool) bool) error { + return c.ListEntitiesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListEntitiesPagesWithContext same as ListEntitiesPages 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 *MarketplaceCatalog) ListEntitiesPagesWithContext(ctx aws.Context, input *ListEntitiesInput, fn func(*ListEntitiesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListEntitiesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListEntitiesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListEntitiesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opStartChangeSet = "StartChangeSet" + +// StartChangeSetRequest generates a "aws/request.Request" representing the +// client's request for the StartChangeSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartChangeSet for more information on using the StartChangeSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartChangeSetRequest method. +// req, resp := client.StartChangeSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17/StartChangeSet +func (c *MarketplaceCatalog) StartChangeSetRequest(input *StartChangeSetInput) (req *request.Request, output *StartChangeSetOutput) { + op := &request.Operation{ + Name: opStartChangeSet, + HTTPMethod: "POST", + HTTPPath: "/StartChangeSet", + } + + if input == nil { + input = &StartChangeSetInput{} + } + + output = &StartChangeSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// StartChangeSet API operation for AWS Marketplace Catalog Service. +// +// This operation allows you to request changes in your entities. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Marketplace Catalog Service's +// API operation StartChangeSet for usage and error information. +// +// Returned Error Types: +// * InternalServiceException +// There was an internal service exception. +// +// * AccessDeniedException +// Access is denied. +// +// * ValidationException +// An error occurred during validation. +// +// * ResourceNotFoundException +// The specified resource wasn't found. +// +// * ResourceInUseException +// The resource is currently in use. +// +// * ThrottlingException +// Too many requests. +// +// * ServiceQuotaExceededException +// The maximum number of open requests per account has been exceeded. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17/StartChangeSet +func (c *MarketplaceCatalog) StartChangeSet(input *StartChangeSetInput) (*StartChangeSetOutput, error) { + req, out := c.StartChangeSetRequest(input) + return out, req.Send() +} + +// StartChangeSetWithContext is the same as StartChangeSet with the addition of +// the ability to pass a context and additional request options. +// +// See StartChangeSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MarketplaceCatalog) StartChangeSetWithContext(ctx aws.Context, input *StartChangeSetInput, opts ...request.Option) (*StartChangeSetOutput, error) { + req, out := c.StartChangeSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Access is denied. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +type CancelChangeSetInput struct { + _ struct{} `type:"structure"` + + // Required. The catalog related to the request. Fixed value: AWSMarketplace. + // + // Catalog is a required field + Catalog *string `location:"querystring" locationName:"catalog" min:"1" type:"string" required:"true"` + + // Required. The unique identifier of the StartChangeSet request that you want + // to cancel. + // + // ChangeSetId is a required field + ChangeSetId *string `location:"querystring" locationName:"changeSetId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CancelChangeSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelChangeSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CancelChangeSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CancelChangeSetInput"} + if s.Catalog == nil { + invalidParams.Add(request.NewErrParamRequired("Catalog")) + } + if s.Catalog != nil && len(*s.Catalog) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Catalog", 1)) + } + if s.ChangeSetId == nil { + invalidParams.Add(request.NewErrParamRequired("ChangeSetId")) + } + if s.ChangeSetId != nil && len(*s.ChangeSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChangeSetId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCatalog sets the Catalog field's value. +func (s *CancelChangeSetInput) SetCatalog(v string) *CancelChangeSetInput { + s.Catalog = &v + return s +} + +// SetChangeSetId sets the ChangeSetId field's value. +func (s *CancelChangeSetInput) SetChangeSetId(v string) *CancelChangeSetInput { + s.ChangeSetId = &v + return s +} + +type CancelChangeSetOutput struct { + _ struct{} `type:"structure"` + + // The ARN associated with the change set referenced in this request. + ChangeSetArn *string `min:"1" type:"string"` + + // The unique identifier for the change set referenced in this request. + ChangeSetId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s CancelChangeSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelChangeSetOutput) GoString() string { + return s.String() +} + +// SetChangeSetArn sets the ChangeSetArn field's value. +func (s *CancelChangeSetOutput) SetChangeSetArn(v string) *CancelChangeSetOutput { + s.ChangeSetArn = &v + return s +} + +// SetChangeSetId sets the ChangeSetId field's value. +func (s *CancelChangeSetOutput) SetChangeSetId(v string) *CancelChangeSetOutput { + s.ChangeSetId = &v + return s +} + +// An object that contains the ChangeType, Details, and Entity. +type Change struct { + _ struct{} `type:"structure"` + + // Change types are single string values that describe your intention for the + // change. Each change type is unique for each EntityType provided in the change's + // scope. + // + // ChangeType is a required field + ChangeType *string `min:"1" type:"string" required:"true"` + + // This object contains details specific to the change type of the requested + // change. + // + // Details is a required field + Details *string `min:"2" type:"string" required:"true"` + + // The entity to be changed. + // + // Entity is a required field + Entity *Entity `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.ChangeType == nil { + invalidParams.Add(request.NewErrParamRequired("ChangeType")) + } + if s.ChangeType != nil && len(*s.ChangeType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChangeType", 1)) + } + if s.Details == nil { + invalidParams.Add(request.NewErrParamRequired("Details")) + } + if s.Details != nil && len(*s.Details) < 2 { + invalidParams.Add(request.NewErrParamMinLen("Details", 2)) + } + if s.Entity == nil { + invalidParams.Add(request.NewErrParamRequired("Entity")) + } + if s.Entity != nil { + if err := s.Entity.Validate(); err != nil { + invalidParams.AddNested("Entity", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetChangeType sets the ChangeType field's value. +func (s *Change) SetChangeType(v string) *Change { + s.ChangeType = &v + return s +} + +// SetDetails sets the Details field's value. +func (s *Change) SetDetails(v string) *Change { + s.Details = &v + return s +} + +// SetEntity sets the Entity field's value. +func (s *Change) SetEntity(v *Entity) *Change { + s.Entity = v + return s +} + +// A summary of a change set returned in a list of change sets when the ListChangeSets +// action is called. +type ChangeSetSummaryListItem struct { + _ struct{} `type:"structure"` + + // The ARN associated with the unique identifier for the change set referenced + // in this request. + ChangeSetArn *string `min:"1" type:"string"` + + // The unique identifier for a change set. + ChangeSetId *string `min:"1" type:"string"` + + // The non-unique name for the change set. + ChangeSetName *string `min:"1" type:"string"` + + // The time, in ISO 8601 format (2018-02-27T13:45:22Z), when the change set + // was finished. + EndTime *string `min:"20" type:"string"` + + // This object is a list of entity IDs (string) that are a part of a change + // set. The entity ID list is a maximum of 20 entities. It must contain at least + // one entity. + EntityIdList []*string `type:"list"` + + // The time, in ISO 8601 format (2018-02-27T13:45:22Z), when the change set + // was started. + StartTime *string `min:"20" type:"string"` + + // The current status of the change set. + Status *string `type:"string" enum:"ChangeStatus"` +} + +// String returns the string representation +func (s ChangeSetSummaryListItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeSetSummaryListItem) GoString() string { + return s.String() +} + +// SetChangeSetArn sets the ChangeSetArn field's value. +func (s *ChangeSetSummaryListItem) SetChangeSetArn(v string) *ChangeSetSummaryListItem { + s.ChangeSetArn = &v + return s +} + +// SetChangeSetId sets the ChangeSetId field's value. +func (s *ChangeSetSummaryListItem) SetChangeSetId(v string) *ChangeSetSummaryListItem { + s.ChangeSetId = &v + return s +} + +// SetChangeSetName sets the ChangeSetName field's value. +func (s *ChangeSetSummaryListItem) SetChangeSetName(v string) *ChangeSetSummaryListItem { + s.ChangeSetName = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *ChangeSetSummaryListItem) SetEndTime(v string) *ChangeSetSummaryListItem { + s.EndTime = &v + return s +} + +// SetEntityIdList sets the EntityIdList field's value. +func (s *ChangeSetSummaryListItem) SetEntityIdList(v []*string) *ChangeSetSummaryListItem { + s.EntityIdList = v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *ChangeSetSummaryListItem) SetStartTime(v string) *ChangeSetSummaryListItem { + s.StartTime = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ChangeSetSummaryListItem) SetStatus(v string) *ChangeSetSummaryListItem { + s.Status = &v + return s +} + +// This object is a container for common summary information about the change. +// The summary doesn't contain the whole change structure. +type ChangeSummary struct { + _ struct{} `type:"structure"` + + // The type of the change. + ChangeType *string `min:"1" type:"string"` + + // The entity to be changed. + Entity *Entity `type:"structure"` + + // An array of ErrorDetail objects associated with the change. + ErrorDetailList []*ErrorDetail `type:"list"` +} + +// String returns the string representation +func (s ChangeSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChangeSummary) GoString() string { + return s.String() +} + +// SetChangeType sets the ChangeType field's value. +func (s *ChangeSummary) SetChangeType(v string) *ChangeSummary { + s.ChangeType = &v + return s +} + +// SetEntity sets the Entity field's value. +func (s *ChangeSummary) SetEntity(v *Entity) *ChangeSummary { + s.Entity = v + return s +} + +// SetErrorDetailList sets the ErrorDetailList field's value. +func (s *ChangeSummary) SetErrorDetailList(v []*ErrorDetail) *ChangeSummary { + s.ErrorDetailList = v + return s +} + +type DescribeChangeSetInput struct { + _ struct{} `type:"structure"` + + // Required. The catalog related to the request. Fixed value: AWSMarketplace + // + // Catalog is a required field + Catalog *string `location:"querystring" locationName:"catalog" min:"1" type:"string" required:"true"` + + // Required. The unique identifier for the StartChangeSet request that you want + // to describe the details for. + // + // ChangeSetId is a required field + ChangeSetId *string `location:"querystring" locationName:"changeSetId" min:"1" type:"string" required:"true"` +} + +// 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.Catalog == nil { + invalidParams.Add(request.NewErrParamRequired("Catalog")) + } + if s.Catalog != nil && len(*s.Catalog) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Catalog", 1)) + } + if s.ChangeSetId == nil { + invalidParams.Add(request.NewErrParamRequired("ChangeSetId")) + } + if s.ChangeSetId != nil && len(*s.ChangeSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChangeSetId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCatalog sets the Catalog field's value. +func (s *DescribeChangeSetInput) SetCatalog(v string) *DescribeChangeSetInput { + s.Catalog = &v + return s +} + +// SetChangeSetId sets the ChangeSetId field's value. +func (s *DescribeChangeSetInput) SetChangeSetId(v string) *DescribeChangeSetInput { + s.ChangeSetId = &v + return s +} + +type DescribeChangeSetOutput struct { + _ struct{} `type:"structure"` + + // An array of ChangeSummary objects. + ChangeSet []*ChangeSummary `type:"list"` + + // The ARN associated with the unique identifier for the change set referenced + // in this request. + ChangeSetArn *string `min:"1" type:"string"` + + // Required. The unique identifier for the change set referenced in this request. + ChangeSetId *string `min:"1" type:"string"` + + // The optional name provided in the StartChangeSet request. If you do not provide + // a name, one is set by default. + ChangeSetName *string `min:"1" type:"string"` + + // The date and time, in ISO 8601 format (2018-02-27T13:45:22Z), the request + // transitioned to a terminal state. The change cannot transition to a different + // state. Null if the request is not in a terminal state. + EndTime *string `min:"20" type:"string"` + + // Returned if there is a failure on the change set, but that failure is not + // related to any of the changes in the request. + FailureDescription *string `type:"string"` + + // The date and time, in ISO 8601 format (2018-02-27T13:45:22Z), the request + // started. + StartTime *string `min:"20" type:"string"` + + // The status of the change request. + Status *string `type:"string" enum:"ChangeStatus"` +} + +// 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() +} + +// SetChangeSet sets the ChangeSet field's value. +func (s *DescribeChangeSetOutput) SetChangeSet(v []*ChangeSummary) *DescribeChangeSetOutput { + s.ChangeSet = v + return s +} + +// SetChangeSetArn sets the ChangeSetArn field's value. +func (s *DescribeChangeSetOutput) SetChangeSetArn(v string) *DescribeChangeSetOutput { + s.ChangeSetArn = &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 +} + +// SetEndTime sets the EndTime field's value. +func (s *DescribeChangeSetOutput) SetEndTime(v string) *DescribeChangeSetOutput { + s.EndTime = &v + return s +} + +// SetFailureDescription sets the FailureDescription field's value. +func (s *DescribeChangeSetOutput) SetFailureDescription(v string) *DescribeChangeSetOutput { + s.FailureDescription = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *DescribeChangeSetOutput) SetStartTime(v string) *DescribeChangeSetOutput { + s.StartTime = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeChangeSetOutput) SetStatus(v string) *DescribeChangeSetOutput { + s.Status = &v + return s +} + +type DescribeEntityInput struct { + _ struct{} `type:"structure"` + + // Required. The catalog related to the request. Fixed value: AWSMarketplace + // + // Catalog is a required field + Catalog *string `location:"querystring" locationName:"catalog" min:"1" type:"string" required:"true"` + + // Required. The unique ID of the entity to describe. + // + // EntityId is a required field + EntityId *string `location:"querystring" locationName:"entityId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeEntityInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEntityInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeEntityInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeEntityInput"} + if s.Catalog == nil { + invalidParams.Add(request.NewErrParamRequired("Catalog")) + } + if s.Catalog != nil && len(*s.Catalog) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Catalog", 1)) + } + if s.EntityId == nil { + invalidParams.Add(request.NewErrParamRequired("EntityId")) + } + if s.EntityId != nil && len(*s.EntityId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EntityId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCatalog sets the Catalog field's value. +func (s *DescribeEntityInput) SetCatalog(v string) *DescribeEntityInput { + s.Catalog = &v + return s +} + +// SetEntityId sets the EntityId field's value. +func (s *DescribeEntityInput) SetEntityId(v string) *DescribeEntityInput { + s.EntityId = &v + return s +} + +type DescribeEntityOutput struct { + _ struct{} `type:"structure"` + + // This stringified JSON object includes the details of the entity. + Details *string `min:"2" type:"string"` + + // The ARN associated to the unique identifier for the change set referenced + // in this request. + EntityArn *string `min:"1" type:"string"` + + // The identifier of the entity, in the format of EntityId@RevisionId. + EntityIdentifier *string `min:"1" type:"string"` + + // The named type of the entity, in the format of EntityType@Version. + EntityType *string `min:"1" type:"string"` + + // The last modified date of the entity, in ISO 8601 format (2018-02-27T13:45:22Z). + LastModifiedDate *string `type:"string"` +} + +// String returns the string representation +func (s DescribeEntityOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEntityOutput) GoString() string { + return s.String() +} + +// SetDetails sets the Details field's value. +func (s *DescribeEntityOutput) SetDetails(v string) *DescribeEntityOutput { + s.Details = &v + return s +} + +// SetEntityArn sets the EntityArn field's value. +func (s *DescribeEntityOutput) SetEntityArn(v string) *DescribeEntityOutput { + s.EntityArn = &v + return s +} + +// SetEntityIdentifier sets the EntityIdentifier field's value. +func (s *DescribeEntityOutput) SetEntityIdentifier(v string) *DescribeEntityOutput { + s.EntityIdentifier = &v + return s +} + +// SetEntityType sets the EntityType field's value. +func (s *DescribeEntityOutput) SetEntityType(v string) *DescribeEntityOutput { + s.EntityType = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *DescribeEntityOutput) SetLastModifiedDate(v string) *DescribeEntityOutput { + s.LastModifiedDate = &v + return s +} + +// A product entity contains data that describes your product, its supported +// features, and how it can be used or launched by your customer. +type Entity struct { + _ struct{} `type:"structure"` + + // The identifier for the entity. + Identifier *string `min:"1" type:"string"` + + // The type of entity. + // + // Type is a required field + Type *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s Entity) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Entity) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Entity) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Entity"} + if s.Identifier != nil && len(*s.Identifier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Identifier", 1)) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + if s.Type != nil && len(*s.Type) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Type", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetIdentifier sets the Identifier field's value. +func (s *Entity) SetIdentifier(v string) *Entity { + s.Identifier = &v + return s +} + +// SetType sets the Type field's value. +func (s *Entity) SetType(v string) *Entity { + s.Type = &v + return s +} + +// This object is a container for common summary information about the entity. +// The summary doesn't contain the whole entity structure, but it does contain +// information common across all entities. +type EntitySummary struct { + _ struct{} `type:"structure"` + + // The ARN associated with the unique identifier for the entity. + EntityArn *string `min:"1" type:"string"` + + // The unique identifier for the entity. + EntityId *string `min:"1" type:"string"` + + // The type of the entity. + EntityType *string `min:"1" type:"string"` + + // The last time the entity was published, using ISO 8601 format (2018-02-27T13:45:22Z). + LastModifiedDate *string `type:"string"` + + // The name for the entity. This value is not unique. It is defined by the provider. + Name *string `type:"string"` + + // The visibility status of the entity to subscribers. This value can be Public + // (everyone can view the entity), Limited (the entity is visible to limited + // accounts only), or Restricted (the entity was published and then unpublished + // and only existing subscribers can view it). + Visibility *string `type:"string"` +} + +// String returns the string representation +func (s EntitySummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EntitySummary) GoString() string { + return s.String() +} + +// SetEntityArn sets the EntityArn field's value. +func (s *EntitySummary) SetEntityArn(v string) *EntitySummary { + s.EntityArn = &v + return s +} + +// SetEntityId sets the EntityId field's value. +func (s *EntitySummary) SetEntityId(v string) *EntitySummary { + s.EntityId = &v + return s +} + +// SetEntityType sets the EntityType field's value. +func (s *EntitySummary) SetEntityType(v string) *EntitySummary { + s.EntityType = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *EntitySummary) SetLastModifiedDate(v string) *EntitySummary { + s.LastModifiedDate = &v + return s +} + +// SetName sets the Name field's value. +func (s *EntitySummary) SetName(v string) *EntitySummary { + s.Name = &v + return s +} + +// SetVisibility sets the Visibility field's value. +func (s *EntitySummary) SetVisibility(v string) *EntitySummary { + s.Visibility = &v + return s +} + +// Details about the error. +type ErrorDetail struct { + _ struct{} `type:"structure"` + + // The error code that identifies the type of error. + ErrorCode *string `type:"string"` + + // The message for the error. + ErrorMessage *string `type:"string"` +} + +// String returns the string representation +func (s ErrorDetail) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ErrorDetail) GoString() string { + return s.String() +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *ErrorDetail) SetErrorCode(v string) *ErrorDetail { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *ErrorDetail) SetErrorMessage(v string) *ErrorDetail { + s.ErrorMessage = &v + return s +} + +// A filter object, used to optionally filter results from calls to the ListEntities +// and ListChangeSets actions. +type Filter struct { + _ struct{} `type:"structure"` + + // For ListEntities, the supported value for this is an EntityId. + // + // For ListChangeSets, the supported values are as follows: + Name *string `min:"1" type:"string"` + + // ListEntities - This is a list of unique EntityIds. + // + // ListChangeSets - The supported filter names and associated ValueLists is + // as follows: + // + // * ChangeSetName - The supported ValueList is a list of non-unique ChangeSetNames. + // These are defined when you call the StartChangeSet action. + // + // * Status - The supported ValueList is a list of statuses for all change + // set requests. + // + // * EntityId - The supported ValueList is a list of unique EntityIds. + // + // * BeforeStartTime - The supported ValueList is a list of all change sets + // that started before the filter value. + // + // * AfterStartTime - The supported ValueList is a list of all change sets + // that started after the filter value. + // + // * BeforeEndTime - The supported ValueList is a list of all change sets + // that ended before the filter value. + // + // * AfterEndTime - The supported ValueList is a list of all change sets + // that ended after the filter value. + ValueList []*string `min:"1" 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() +} + +// 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 && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.ValueList != nil && len(s.ValueList) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ValueList", 1)) + } + + 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 +} + +// SetValueList sets the ValueList field's value. +func (s *Filter) SetValueList(v []*string) *Filter { + s.ValueList = v + return s +} + +// There was an internal service exception. +type InternalServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServiceException) GoString() string { + return s.String() +} + +func newErrorInternalServiceException(v protocol.ResponseMetadata) error { + return &InternalServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServiceException) Code() string { + return "InternalServiceException" +} + +// Message returns the exception's message. +func (s InternalServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServiceException) OrigErr() error { + return nil +} + +func (s InternalServiceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServiceException) RequestID() string { + return s.respMetadata.RequestID +} + +type ListChangeSetsInput struct { + _ struct{} `type:"structure"` + + // The catalog related to the request. Fixed value: AWSMarketplace + // + // Catalog is a required field + Catalog *string `min:"1" type:"string" required:"true"` + + // An array of filter objects. + FilterList []*Filter `min:"1" type:"list"` + + // The maximum number of results returned by a single call. This value must + // be provided in the next call to retrieve the next set of results. By default, + // this value is 20. + MaxResults *int64 `min:"1" type:"integer"` + + // The token value retrieved from a previous call to access the next page of + // results. + NextToken *string `min:"1" type:"string"` + + // An object that contains two attributes, sortBy and sortOrder. + Sort *Sort `type:"structure"` +} + +// 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.Catalog == nil { + invalidParams.Add(request.NewErrParamRequired("Catalog")) + } + if s.Catalog != nil && len(*s.Catalog) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Catalog", 1)) + } + if s.FilterList != nil && len(s.FilterList) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FilterList", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + if s.FilterList != nil { + for i, v := range s.FilterList { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "FilterList", i), err.(request.ErrInvalidParams)) + } + } + } + if s.Sort != nil { + if err := s.Sort.Validate(); err != nil { + invalidParams.AddNested("Sort", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCatalog sets the Catalog field's value. +func (s *ListChangeSetsInput) SetCatalog(v string) *ListChangeSetsInput { + s.Catalog = &v + return s +} + +// SetFilterList sets the FilterList field's value. +func (s *ListChangeSetsInput) SetFilterList(v []*Filter) *ListChangeSetsInput { + s.FilterList = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListChangeSetsInput) SetMaxResults(v int64) *ListChangeSetsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListChangeSetsInput) SetNextToken(v string) *ListChangeSetsInput { + s.NextToken = &v + return s +} + +// SetSort sets the Sort field's value. +func (s *ListChangeSetsInput) SetSort(v *Sort) *ListChangeSetsInput { + s.Sort = v + return s +} + +type ListChangeSetsOutput struct { + _ struct{} `type:"structure"` + + // Array of ChangeSetSummaryListItem objects. + ChangeSetSummaryList []*ChangeSetSummaryListItem `type:"list"` + + // The value of the next token, if it exists. Null if there are no more results. + NextToken *string `min:"1" type:"string"` +} + +// 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() +} + +// SetChangeSetSummaryList sets the ChangeSetSummaryList field's value. +func (s *ListChangeSetsOutput) SetChangeSetSummaryList(v []*ChangeSetSummaryListItem) *ListChangeSetsOutput { + s.ChangeSetSummaryList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListChangeSetsOutput) SetNextToken(v string) *ListChangeSetsOutput { + s.NextToken = &v + return s +} + +type ListEntitiesInput struct { + _ struct{} `type:"structure"` + + // The catalog related to the request. Fixed value: AWSMarketplace + // + // Catalog is a required field + Catalog *string `min:"1" type:"string" required:"true"` + + // The type of entities to retrieve. + // + // EntityType is a required field + EntityType *string `min:"1" type:"string" required:"true"` + + // An array of filter objects. Each filter object contains two attributes, filterName + // and filterValues. + FilterList []*Filter `min:"1" type:"list"` + + // Specifies the upper limit of the elements on a single page. If a value isn't + // provided, the default value is 20. + MaxResults *int64 `min:"1" type:"integer"` + + // The value of the next token, if it exists. Null if there are no more results. + NextToken *string `min:"1" type:"string"` + + // An object that contains two attributes, sortBy and sortOrder. + Sort *Sort `type:"structure"` +} + +// String returns the string representation +func (s ListEntitiesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListEntitiesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListEntitiesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListEntitiesInput"} + if s.Catalog == nil { + invalidParams.Add(request.NewErrParamRequired("Catalog")) + } + if s.Catalog != nil && len(*s.Catalog) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Catalog", 1)) + } + if s.EntityType == nil { + invalidParams.Add(request.NewErrParamRequired("EntityType")) + } + if s.EntityType != nil && len(*s.EntityType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EntityType", 1)) + } + if s.FilterList != nil && len(s.FilterList) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FilterList", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + if s.FilterList != nil { + for i, v := range s.FilterList { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "FilterList", i), err.(request.ErrInvalidParams)) + } + } + } + if s.Sort != nil { + if err := s.Sort.Validate(); err != nil { + invalidParams.AddNested("Sort", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCatalog sets the Catalog field's value. +func (s *ListEntitiesInput) SetCatalog(v string) *ListEntitiesInput { + s.Catalog = &v + return s +} + +// SetEntityType sets the EntityType field's value. +func (s *ListEntitiesInput) SetEntityType(v string) *ListEntitiesInput { + s.EntityType = &v + return s +} + +// SetFilterList sets the FilterList field's value. +func (s *ListEntitiesInput) SetFilterList(v []*Filter) *ListEntitiesInput { + s.FilterList = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListEntitiesInput) SetMaxResults(v int64) *ListEntitiesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListEntitiesInput) SetNextToken(v string) *ListEntitiesInput { + s.NextToken = &v + return s +} + +// SetSort sets the Sort field's value. +func (s *ListEntitiesInput) SetSort(v *Sort) *ListEntitiesInput { + s.Sort = v + return s +} + +type ListEntitiesOutput struct { + _ struct{} `type:"structure"` + + // Array of EntitySummary object. + EntitySummaryList []*EntitySummary `type:"list"` + + // The value of the next token if it exists. Null if there is no more result. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListEntitiesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListEntitiesOutput) GoString() string { + return s.String() +} + +// SetEntitySummaryList sets the EntitySummaryList field's value. +func (s *ListEntitiesOutput) SetEntitySummaryList(v []*EntitySummary) *ListEntitiesOutput { + s.EntitySummaryList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListEntitiesOutput) SetNextToken(v string) *ListEntitiesOutput { + s.NextToken = &v + return s +} + +// The resource is currently in use. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource wasn't found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Currently, the specified resource is not supported. +type ResourceNotSupportedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotSupportedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotSupportedException) GoString() string { + return s.String() +} + +func newErrorResourceNotSupportedException(v protocol.ResponseMetadata) error { + return &ResourceNotSupportedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotSupportedException) Code() string { + return "ResourceNotSupportedException" +} + +// Message returns the exception's message. +func (s ResourceNotSupportedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotSupportedException) OrigErr() error { + return nil +} + +func (s ResourceNotSupportedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotSupportedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotSupportedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The maximum number of open requests per account has been exceeded. +type ServiceQuotaExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ServiceQuotaExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceQuotaExceededException) GoString() string { + return s.String() +} + +func newErrorServiceQuotaExceededException(v protocol.ResponseMetadata) error { + return &ServiceQuotaExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceQuotaExceededException) Code() string { + return "ServiceQuotaExceededException" +} + +// Message returns the exception's message. +func (s ServiceQuotaExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceQuotaExceededException) OrigErr() error { + return nil +} + +func (s ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceQuotaExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceQuotaExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// An object that contains two attributes, sortBy and sortOrder. +type Sort struct { + _ struct{} `type:"structure"` + + // For ListEntities, supported attributes include LastModifiedDate (default), + // Visibility, EntityId, and Name. + // + // For ListChangeSets, supported attributes include StartTime and EndTime. + SortBy *string `min:"1" type:"string"` + + // The sorting order. Can be ASCENDING or DESCENDING. The default value is DESCENDING. + SortOrder *string `type:"string" enum:"SortOrder"` +} + +// String returns the string representation +func (s Sort) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Sort) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Sort) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Sort"} + if s.SortBy != nil && len(*s.SortBy) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SortBy", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSortBy sets the SortBy field's value. +func (s *Sort) SetSortBy(v string) *Sort { + s.SortBy = &v + return s +} + +// SetSortOrder sets the SortOrder field's value. +func (s *Sort) SetSortOrder(v string) *Sort { + s.SortOrder = &v + return s +} + +type StartChangeSetInput struct { + _ struct{} `type:"structure"` + + // The catalog related to the request. Fixed value: AWSMarketplace + // + // Catalog is a required field + Catalog *string `min:"1" type:"string" required:"true"` + + // Array of change object. + // + // ChangeSet is a required field + ChangeSet []*Change `min:"1" type:"list" required:"true"` + + // Optional case sensitive string of up to 100 ASCII characters. The change + // set name can be used to filter the list of change sets. + ChangeSetName *string `min:"1" type:"string"` + + // A unique token to identify the request to ensure idempotency. + ClientRequestToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s StartChangeSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartChangeSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartChangeSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartChangeSetInput"} + if s.Catalog == nil { + invalidParams.Add(request.NewErrParamRequired("Catalog")) + } + if s.Catalog != nil && len(*s.Catalog) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Catalog", 1)) + } + if s.ChangeSet == nil { + invalidParams.Add(request.NewErrParamRequired("ChangeSet")) + } + if s.ChangeSet != nil && len(s.ChangeSet) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChangeSet", 1)) + } + if s.ChangeSetName != nil && len(*s.ChangeSetName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChangeSetName", 1)) + } + if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) + } + if s.ChangeSet != nil { + for i, v := range s.ChangeSet { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ChangeSet", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCatalog sets the Catalog field's value. +func (s *StartChangeSetInput) SetCatalog(v string) *StartChangeSetInput { + s.Catalog = &v + return s +} + +// SetChangeSet sets the ChangeSet field's value. +func (s *StartChangeSetInput) SetChangeSet(v []*Change) *StartChangeSetInput { + s.ChangeSet = v + return s +} + +// SetChangeSetName sets the ChangeSetName field's value. +func (s *StartChangeSetInput) SetChangeSetName(v string) *StartChangeSetInput { + s.ChangeSetName = &v + return s +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *StartChangeSetInput) SetClientRequestToken(v string) *StartChangeSetInput { + s.ClientRequestToken = &v + return s +} + +type StartChangeSetOutput struct { + _ struct{} `type:"structure"` + + // The ARN associated to the unique identifier generated for the request. + ChangeSetArn *string `min:"1" type:"string"` + + // Unique identifier generated for the request. + ChangeSetId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s StartChangeSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartChangeSetOutput) GoString() string { + return s.String() +} + +// SetChangeSetArn sets the ChangeSetArn field's value. +func (s *StartChangeSetOutput) SetChangeSetArn(v string) *StartChangeSetOutput { + s.ChangeSetArn = &v + return s +} + +// SetChangeSetId sets the ChangeSetId field's value. +func (s *StartChangeSetOutput) SetChangeSetId(v string) *StartChangeSetOutput { + s.ChangeSetId = &v + return s +} + +// Too many requests. +type ThrottlingException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ThrottlingException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ThrottlingException) GoString() string { + return s.String() +} + +func newErrorThrottlingException(v protocol.ResponseMetadata) error { + return &ThrottlingException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ThrottlingException) Code() string { + return "ThrottlingException" +} + +// Message returns the exception's message. +func (s ThrottlingException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ThrottlingException) OrigErr() error { + return nil +} + +func (s ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ThrottlingException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ThrottlingException) RequestID() string { + return s.respMetadata.RequestID +} + +// An error occurred during validation. +type ValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationException) GoString() string { + return s.String() +} + +func newErrorValidationException(v protocol.ResponseMetadata) error { + return &ValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ValidationException) Code() string { + return "ValidationException" +} + +// Message returns the exception's message. +func (s ValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ValidationException) OrigErr() error { + return nil +} + +func (s ValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ValidationException) RequestID() string { + return s.respMetadata.RequestID +} + +const ( + // ChangeStatusPreparing is a ChangeStatus enum value + ChangeStatusPreparing = "PREPARING" + + // ChangeStatusApplying is a ChangeStatus enum value + ChangeStatusApplying = "APPLYING" + + // ChangeStatusSucceeded is a ChangeStatus enum value + ChangeStatusSucceeded = "SUCCEEDED" + + // ChangeStatusCancelled is a ChangeStatus enum value + ChangeStatusCancelled = "CANCELLED" + + // ChangeStatusFailed is a ChangeStatus enum value + ChangeStatusFailed = "FAILED" +) + +const ( + // SortOrderAscending is a SortOrder enum value + SortOrderAscending = "ASCENDING" + + // SortOrderDescending is a SortOrder enum value + SortOrderDescending = "DESCENDING" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/marketplacecatalog/doc.go b/vendor/github.com/aws/aws-sdk-go/service/marketplacecatalog/doc.go new file mode 100644 index 00000000000..debadb7b02f --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/marketplacecatalog/doc.go @@ -0,0 +1,34 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package marketplacecatalog provides the client and types for making API +// requests to AWS Marketplace Catalog Service. +// +// Catalog API actions allow you to create, describe, list, and delete changes +// to your published entities. An entity is a product or an offer on AWS Marketplace. +// +// You can automate your entity update process by integrating the AWS Marketplace +// Catalog API with your AWS Marketplace product build or deployment pipelines. +// You can also create your own applications on top of the Catalog API to manage +// your products on AWS Marketplace. +// +// See https://docs.aws.amazon.com/goto/WebAPI/marketplace-catalog-2018-09-17 for more information on this service. +// +// See marketplacecatalog package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/marketplacecatalog/ +// +// Using the Client +// +// To contact AWS Marketplace Catalog 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 Marketplace Catalog Service client MarketplaceCatalog for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/marketplacecatalog/#New +package marketplacecatalog diff --git a/vendor/github.com/aws/aws-sdk-go/service/marketplacecatalog/errors.go b/vendor/github.com/aws/aws-sdk-go/service/marketplacecatalog/errors.go new file mode 100644 index 00000000000..3a789a57de2 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/marketplacecatalog/errors.go @@ -0,0 +1,69 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package marketplacecatalog + +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + +const ( + + // ErrCodeAccessDeniedException for service response error code + // "AccessDeniedException". + // + // Access is denied. + ErrCodeAccessDeniedException = "AccessDeniedException" + + // ErrCodeInternalServiceException for service response error code + // "InternalServiceException". + // + // There was an internal service exception. + ErrCodeInternalServiceException = "InternalServiceException" + + // ErrCodeResourceInUseException for service response error code + // "ResourceInUseException". + // + // The resource is currently in use. + ErrCodeResourceInUseException = "ResourceInUseException" + + // ErrCodeResourceNotFoundException for service response error code + // "ResourceNotFoundException". + // + // The specified resource wasn't found. + ErrCodeResourceNotFoundException = "ResourceNotFoundException" + + // ErrCodeResourceNotSupportedException for service response error code + // "ResourceNotSupportedException". + // + // Currently, the specified resource is not supported. + ErrCodeResourceNotSupportedException = "ResourceNotSupportedException" + + // ErrCodeServiceQuotaExceededException for service response error code + // "ServiceQuotaExceededException". + // + // The maximum number of open requests per account has been exceeded. + ErrCodeServiceQuotaExceededException = "ServiceQuotaExceededException" + + // ErrCodeThrottlingException for service response error code + // "ThrottlingException". + // + // Too many requests. + ErrCodeThrottlingException = "ThrottlingException" + + // ErrCodeValidationException for service response error code + // "ValidationException". + // + // An error occurred during validation. + ErrCodeValidationException = "ValidationException" +) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "InternalServiceException": newErrorInternalServiceException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ResourceNotSupportedException": newErrorResourceNotSupportedException, + "ServiceQuotaExceededException": newErrorServiceQuotaExceededException, + "ThrottlingException": newErrorThrottlingException, + "ValidationException": newErrorValidationException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/marketplacecatalog/service.go b/vendor/github.com/aws/aws-sdk-go/service/marketplacecatalog/service.go new file mode 100644 index 00000000000..ae4063ce913 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/marketplacecatalog/service.go @@ -0,0 +1,104 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package marketplacecatalog + +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" + "github.com/aws/aws-sdk-go/private/protocol/restjson" +) + +// MarketplaceCatalog provides the API operation methods for making requests to +// AWS Marketplace Catalog Service. See this package's package overview docs +// for details on the service. +// +// MarketplaceCatalog methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type MarketplaceCatalog 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 = "Marketplace Catalog" // Name of service. + EndpointsID = "catalog.marketplace" // ID to lookup a service endpoint with. + ServiceID = "Marketplace Catalog" // ServiceID is a unique identifier of a specific service. +) + +// New creates a new instance of the MarketplaceCatalog client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// mySession := session.Must(session.NewSession()) +// +// // Create a MarketplaceCatalog client from just a session. +// svc := marketplacecatalog.New(mySession) +// +// // Create a MarketplaceCatalog client with additional configuration +// svc := marketplacecatalog.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *MarketplaceCatalog { + c := p.ClientConfig(EndpointsID, cfgs...) + if c.SigningNameDerived || len(c.SigningName) == 0 { + c.SigningName = "aws-marketplace" + } + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *MarketplaceCatalog { + svc := &MarketplaceCatalog{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + PartitionID: partitionID, + Endpoint: endpoint, + APIVersion: "2018-09-17", + }, + 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( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a MarketplaceCatalog operation and runs any +// custom request initialization. +func (c *MarketplaceCatalog) 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/mediaconnect/api.go b/vendor/github.com/aws/aws-sdk-go/service/mediaconnect/api.go index 53ab3dfb0e7..b34602a9046 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mediaconnect/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mediaconnect/api.go @@ -65,38 +65,38 @@ func (c *MediaConnect) AddFlowOutputsRequest(input *AddFlowOutputsInput) (req *r // See the AWS API reference guide for AWS MediaConnect's // API operation AddFlowOutputs for usage and error information. // -// Returned Error Codes: -// * ErrCodeAddFlowOutputs420Exception "AddFlowOutputs420Exception" +// Returned Error Types: +// * AddFlowOutputs420Exception // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -177,33 +177,33 @@ func (c *MediaConnect) CreateFlowRequest(input *CreateFlowInput) (req *request.R // See the AWS API reference guide for AWS MediaConnect's // API operation CreateFlow for usage and error information. // -// Returned Error Codes: -// * ErrCodeCreateFlow420Exception "CreateFlow420Exception" +// Returned Error Types: +// * CreateFlow420Exception // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -283,33 +283,33 @@ func (c *MediaConnect) DeleteFlowRequest(input *DeleteFlowInput) (req *request.R // See the AWS API reference guide for AWS MediaConnect's // API operation DeleteFlow for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -391,33 +391,33 @@ func (c *MediaConnect) DescribeFlowRequest(input *DescribeFlowInput) (req *reque // See the AWS API reference guide for AWS MediaConnect's // API operation DescribeFlow for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -497,38 +497,38 @@ func (c *MediaConnect) GrantFlowEntitlementsRequest(input *GrantFlowEntitlements // See the AWS API reference guide for AWS MediaConnect's // API operation GrantFlowEntitlements for usage and error information. // -// Returned Error Codes: -// * ErrCodeGrantFlowEntitlements420Exception "GrantFlowEntitlements420Exception" +// Returned Error Types: +// * GrantFlowEntitlements420Exception // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -615,23 +615,23 @@ func (c *MediaConnect) ListEntitlementsRequest(input *ListEntitlementsInput) (re // See the AWS API reference guide for AWS MediaConnect's // API operation ListEntitlements for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -701,10 +701,12 @@ func (c *MediaConnect) ListEntitlementsPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEntitlementsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListEntitlementsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -768,23 +770,23 @@ func (c *MediaConnect) ListFlowsRequest(input *ListFlowsInput) (req *request.Req // See the AWS API reference guide for AWS MediaConnect's // API operation ListFlows for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -854,10 +856,12 @@ func (c *MediaConnect) ListFlowsPagesWithContext(ctx aws.Context, input *ListFlo }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListFlowsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListFlowsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -914,18 +918,18 @@ func (c *MediaConnect) ListTagsForResourceRequest(input *ListTagsForResourceInpu // See the AWS API reference guide for AWS MediaConnect's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -1009,33 +1013,33 @@ func (c *MediaConnect) RemoveFlowOutputRequest(input *RemoveFlowOutputInput) (re // See the AWS API reference guide for AWS MediaConnect's // API operation RemoveFlowOutput for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -1116,33 +1120,33 @@ func (c *MediaConnect) RevokeFlowEntitlementRequest(input *RevokeFlowEntitlement // See the AWS API reference guide for AWS MediaConnect's // API operation RevokeFlowEntitlement for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -1222,33 +1226,33 @@ func (c *MediaConnect) StartFlowRequest(input *StartFlowInput) (req *request.Req // See the AWS API reference guide for AWS MediaConnect's // API operation StartFlow for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -1328,33 +1332,33 @@ func (c *MediaConnect) StopFlowRequest(input *StopFlowInput) (req *request.Reque // See the AWS API reference guide for AWS MediaConnect's // API operation StopFlow for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -1438,18 +1442,18 @@ func (c *MediaConnect) TagResourceRequest(input *TagResourceInput) (req *request // See the AWS API reference guide for AWS MediaConnect's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -1530,18 +1534,18 @@ func (c *MediaConnect) UntagResourceRequest(input *UntagResourceInput) (req *req // See the AWS API reference guide for AWS MediaConnect's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -1623,33 +1627,33 @@ func (c *MediaConnect) UpdateFlowEntitlementRequest(input *UpdateFlowEntitlement // See the AWS API reference guide for AWS MediaConnect's // API operation UpdateFlowEntitlement for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -1729,33 +1733,33 @@ func (c *MediaConnect) UpdateFlowOutputRequest(input *UpdateFlowOutputInput) (re // See the AWS API reference guide for AWS MediaConnect's // API operation UpdateFlowOutput for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -1835,33 +1839,33 @@ func (c *MediaConnect) UpdateFlowSourceRequest(input *UpdateFlowSourceInput) (re // See the AWS API reference guide for AWS MediaConnect's // API operation UpdateFlowSource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Exception raised by AWS Elemental MediaConnect. See the error message and // documentation for the operation for more information on the cause of this // exception. @@ -1888,6 +1892,64 @@ func (c *MediaConnect) UpdateFlowSourceWithContext(ctx aws.Context, input *Updat return out, req.Send() } +// Exception raised by AWS Elemental MediaConnect. See the error message and +// documentation for the operation for more information on the cause of this +// exception. +type AddFlowOutputs420Exception struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AddFlowOutputs420Exception) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddFlowOutputs420Exception) GoString() string { + return s.String() +} + +func newErrorAddFlowOutputs420Exception(v protocol.ResponseMetadata) error { + return &AddFlowOutputs420Exception{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AddFlowOutputs420Exception) Code() string { + return "AddFlowOutputs420Exception" +} + +// Message returns the exception's message. +func (s AddFlowOutputs420Exception) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AddFlowOutputs420Exception) OrigErr() error { + return nil +} + +func (s AddFlowOutputs420Exception) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AddFlowOutputs420Exception) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AddFlowOutputs420Exception) RequestID() string { + return s.respMetadata.RequestID +} + // Adds outputs to an existing flow. You can create up to 20 outputs per flow. type AddFlowOutputsInput struct { _ struct{} `type:"structure"` @@ -2125,6 +2187,122 @@ func (s *AddOutputRequest) SetStreamId(v string) *AddOutputRequest { return s } +// Exception raised by AWS Elemental MediaConnect. See the error message and +// documentation for the operation for more information on the cause of this +// exception. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// Exception raised by AWS Elemental MediaConnect. See the error message and +// documentation for the operation for more information on the cause of this +// exception. +type CreateFlow420Exception struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s CreateFlow420Exception) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateFlow420Exception) GoString() string { + return s.String() +} + +func newErrorCreateFlow420Exception(v protocol.ResponseMetadata) error { + return &CreateFlow420Exception{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CreateFlow420Exception) Code() string { + return "CreateFlow420Exception" +} + +// Message returns the exception's message. +func (s CreateFlow420Exception) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CreateFlow420Exception) OrigErr() error { + return nil +} + +func (s CreateFlow420Exception) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CreateFlow420Exception) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CreateFlow420Exception) RequestID() string { + return s.respMetadata.RequestID +} + // Creates a new flow. The request must include one source. The request optionally // can include outputs (up to 20) and one entitlement. type CreateFlowInput struct { @@ -2722,6 +2900,64 @@ func (s *Flow) SetStatus(v string) *Flow { return s } +// Exception raised by AWS Elemental MediaConnect. See the error message and +// documentation for the operation for more information on the cause of this +// exception. +type ForbiddenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ForbiddenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ForbiddenException) GoString() string { + return s.String() +} + +func newErrorForbiddenException(v protocol.ResponseMetadata) error { + return &ForbiddenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ForbiddenException) Code() string { + return "ForbiddenException" +} + +// Message returns the exception's message. +func (s ForbiddenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ForbiddenException) OrigErr() error { + return nil +} + +func (s ForbiddenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ForbiddenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ForbiddenException) RequestID() string { + return s.respMetadata.RequestID +} + // The entitlements that you want to grant on a flow. type GrantEntitlementRequest struct { _ struct{} `type:"structure"` @@ -2808,6 +3044,64 @@ func (s *GrantEntitlementRequest) SetSubscribers(v []*string) *GrantEntitlementR return s } +// Exception raised by AWS Elemental MediaConnect. See the error message and +// documentation for the operation for more information on the cause of this +// exception. +type GrantFlowEntitlements420Exception struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s GrantFlowEntitlements420Exception) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GrantFlowEntitlements420Exception) GoString() string { + return s.String() +} + +func newErrorGrantFlowEntitlements420Exception(v protocol.ResponseMetadata) error { + return &GrantFlowEntitlements420Exception{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s GrantFlowEntitlements420Exception) Code() string { + return "GrantFlowEntitlements420Exception" +} + +// Message returns the exception's message. +func (s GrantFlowEntitlements420Exception) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s GrantFlowEntitlements420Exception) OrigErr() error { + return nil +} + +func (s GrantFlowEntitlements420Exception) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s GrantFlowEntitlements420Exception) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s GrantFlowEntitlements420Exception) RequestID() string { + return s.respMetadata.RequestID +} + // Grants an entitlement on a flow. type GrantFlowEntitlementsInput struct { _ struct{} `type:"structure"` @@ -2905,6 +3199,64 @@ func (s *GrantFlowEntitlementsOutput) SetFlowArn(v string) *GrantFlowEntitlement return s } +// Exception raised by AWS Elemental MediaConnect. See the error message and +// documentation for the operation for more information on the cause of this +// exception. +type InternalServerErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalServerErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerErrorException) GoString() string { + return s.String() +} + +func newErrorInternalServerErrorException(v protocol.ResponseMetadata) error { + return &InternalServerErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerErrorException) Code() string { + return "InternalServerErrorException" +} + +// Message returns the exception's message. +func (s InternalServerErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerErrorException) OrigErr() error { + return nil +} + +func (s InternalServerErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerErrorException) RequestID() string { + return s.respMetadata.RequestID +} + type ListEntitlementsInput struct { _ struct{} `type:"structure"` @@ -3289,6 +3641,64 @@ func (s *Messages) SetErrors(v []*string) *Messages { return s } +// Exception raised by AWS Elemental MediaConnect. See the error message and +// documentation for the operation for more information on the cause of this +// exception. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // The settings for an output. type Output struct { _ struct{} `type:"structure"` @@ -3578,6 +3988,64 @@ func (s *RevokeFlowEntitlementOutput) SetFlowArn(v string) *RevokeFlowEntitlemen return s } +// Exception raised by AWS Elemental MediaConnect. See the error message and +// documentation for the operation for more information on the cause of this +// exception. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + // The settings for the source of the flow. type SetSourceRequest struct { _ struct{} `type:"structure"` @@ -4033,6 +4501,64 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// Exception raised by AWS Elemental MediaConnect. See the error message and +// documentation for the operation for more information on the cause of this +// exception. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + // Attributes related to the transport stream that are used in a source or output. type Transport struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/mediaconnect/errors.go b/vendor/github.com/aws/aws-sdk-go/service/mediaconnect/errors.go index c6f36c1e53f..a63b993b383 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mediaconnect/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mediaconnect/errors.go @@ -2,6 +2,10 @@ package mediaconnect +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAddFlowOutputs420Exception for service response error code @@ -76,3 +80,15 @@ const ( // exception. ErrCodeTooManyRequestsException = "TooManyRequestsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AddFlowOutputs420Exception": newErrorAddFlowOutputs420Exception, + "BadRequestException": newErrorBadRequestException, + "CreateFlow420Exception": newErrorCreateFlow420Exception, + "ForbiddenException": newErrorForbiddenException, + "GrantFlowEntitlements420Exception": newErrorGrantFlowEntitlements420Exception, + "InternalServerErrorException": newErrorInternalServerErrorException, + "NotFoundException": newErrorNotFoundException, + "ServiceUnavailableException": newErrorServiceUnavailableException, + "TooManyRequestsException": newErrorTooManyRequestsException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/mediaconnect/service.go b/vendor/github.com/aws/aws-sdk-go/service/mediaconnect/service.go index 218d8e1905a..849797382e5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mediaconnect/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mediaconnect/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "MediaConnect" // Name of service. EndpointsID = "mediaconnect" // ID to lookup a service endpoint with. - ServiceID = "MediaConnect" // ServiceID is a unique identifer of a specific service. + ServiceID = "MediaConnect" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the MediaConnect client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a MediaConnect client from just a session. // svc := mediaconnect.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *MediaConnect { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "mediaconnect" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *MediaConnect { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *MediaConnect { svc := &MediaConnect{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-11-14", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/mediaconvert/api.go b/vendor/github.com/aws/aws-sdk-go/service/mediaconvert/api.go index d35e2e70b09..a4f1ea3060d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mediaconvert/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mediaconvert/api.go @@ -68,18 +68,18 @@ func (c *MediaConvert) AssociateCertificateRequest(input *AssociateCertificateIn // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation AssociateCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/AssociateCertificate func (c *MediaConvert) AssociateCertificate(input *AssociateCertificateInput) (*AssociateCertificateOutput, error) { @@ -158,18 +158,18 @@ func (c *MediaConvert) CancelJobRequest(input *CancelJobInput) (req *request.Req // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation CancelJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/CancelJob func (c *MediaConvert) CancelJob(input *CancelJobInput) (*CancelJobOutput, error) { @@ -247,18 +247,18 @@ func (c *MediaConvert) CreateJobRequest(input *CreateJobInput) (req *request.Req // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation CreateJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/CreateJob func (c *MediaConvert) CreateJob(input *CreateJobInput) (*CreateJobOutput, error) { @@ -336,18 +336,18 @@ func (c *MediaConvert) CreateJobTemplateRequest(input *CreateJobTemplateInput) ( // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation CreateJobTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/CreateJobTemplate func (c *MediaConvert) CreateJobTemplate(input *CreateJobTemplateInput) (*CreateJobTemplateOutput, error) { @@ -425,18 +425,18 @@ func (c *MediaConvert) CreatePresetRequest(input *CreatePresetInput) (req *reque // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation CreatePreset for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/CreatePreset func (c *MediaConvert) CreatePreset(input *CreatePresetInput) (*CreatePresetOutput, error) { @@ -514,18 +514,18 @@ func (c *MediaConvert) CreateQueueRequest(input *CreateQueueInput) (req *request // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation CreateQueue for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/CreateQueue func (c *MediaConvert) CreateQueue(input *CreateQueueInput) (*CreateQueueOutput, error) { @@ -603,18 +603,18 @@ func (c *MediaConvert) DeleteJobTemplateRequest(input *DeleteJobTemplateInput) ( // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation DeleteJobTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/DeleteJobTemplate func (c *MediaConvert) DeleteJobTemplate(input *DeleteJobTemplateInput) (*DeleteJobTemplateOutput, error) { @@ -692,18 +692,18 @@ func (c *MediaConvert) DeletePresetRequest(input *DeletePresetInput) (req *reque // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation DeletePreset for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/DeletePreset func (c *MediaConvert) DeletePreset(input *DeletePresetInput) (*DeletePresetOutput, error) { @@ -781,18 +781,18 @@ func (c *MediaConvert) DeleteQueueRequest(input *DeleteQueueInput) (req *request // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation DeleteQueue for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/DeleteQueue func (c *MediaConvert) DeleteQueue(input *DeleteQueueInput) (*DeleteQueueOutput, error) { @@ -876,18 +876,18 @@ func (c *MediaConvert) DescribeEndpointsRequest(input *DescribeEndpointsInput) ( // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation DescribeEndpoints for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/DescribeEndpoints func (c *MediaConvert) DescribeEndpoints(input *DescribeEndpointsInput) (*DescribeEndpointsOutput, error) { @@ -954,10 +954,12 @@ func (c *MediaConvert) DescribeEndpointsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEndpointsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEndpointsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1016,18 +1018,18 @@ func (c *MediaConvert) DisassociateCertificateRequest(input *DisassociateCertifi // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation DisassociateCertificate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/DisassociateCertificate func (c *MediaConvert) DisassociateCertificate(input *DisassociateCertificateInput) (*DisassociateCertificateOutput, error) { @@ -1104,18 +1106,18 @@ func (c *MediaConvert) GetJobRequest(input *GetJobInput) (req *request.Request, // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation GetJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/GetJob func (c *MediaConvert) GetJob(input *GetJobInput) (*GetJobOutput, error) { @@ -1192,18 +1194,18 @@ func (c *MediaConvert) GetJobTemplateRequest(input *GetJobTemplateInput) (req *r // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation GetJobTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/GetJobTemplate func (c *MediaConvert) GetJobTemplate(input *GetJobTemplateInput) (*GetJobTemplateOutput, error) { @@ -1280,18 +1282,18 @@ func (c *MediaConvert) GetPresetRequest(input *GetPresetInput) (req *request.Req // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation GetPreset for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/GetPreset func (c *MediaConvert) GetPreset(input *GetPresetInput) (*GetPresetOutput, error) { @@ -1368,18 +1370,18 @@ func (c *MediaConvert) GetQueueRequest(input *GetQueueInput) (req *request.Reque // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation GetQueue for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/GetQueue func (c *MediaConvert) GetQueue(input *GetQueueInput) (*GetQueueOutput, error) { @@ -1464,18 +1466,18 @@ func (c *MediaConvert) ListJobTemplatesRequest(input *ListJobTemplatesInput) (re // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation ListJobTemplates for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/ListJobTemplates func (c *MediaConvert) ListJobTemplates(input *ListJobTemplatesInput) (*ListJobTemplatesOutput, error) { @@ -1542,10 +1544,12 @@ func (c *MediaConvert) ListJobTemplatesPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobTemplatesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListJobTemplatesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1611,18 +1615,18 @@ func (c *MediaConvert) ListJobsRequest(input *ListJobsInput) (req *request.Reque // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation ListJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/ListJobs func (c *MediaConvert) ListJobs(input *ListJobsInput) (*ListJobsOutput, error) { @@ -1689,10 +1693,12 @@ func (c *MediaConvert) ListJobsPagesWithContext(ctx aws.Context, input *ListJobs }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1757,18 +1763,18 @@ func (c *MediaConvert) ListPresetsRequest(input *ListPresetsInput) (req *request // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation ListPresets for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/ListPresets func (c *MediaConvert) ListPresets(input *ListPresetsInput) (*ListPresetsOutput, error) { @@ -1835,10 +1841,12 @@ func (c *MediaConvert) ListPresetsPagesWithContext(ctx aws.Context, input *ListP }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPresetsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPresetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1903,18 +1911,18 @@ func (c *MediaConvert) ListQueuesRequest(input *ListQueuesInput) (req *request.R // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation ListQueues for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/ListQueues func (c *MediaConvert) ListQueues(input *ListQueuesInput) (*ListQueuesOutput, error) { @@ -1981,10 +1989,12 @@ func (c *MediaConvert) ListQueuesPagesWithContext(ctx aws.Context, input *ListQu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListQueuesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListQueuesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2041,18 +2051,18 @@ func (c *MediaConvert) ListTagsForResourceRequest(input *ListTagsForResourceInpu // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/ListTagsForResource func (c *MediaConvert) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { @@ -2131,18 +2141,18 @@ func (c *MediaConvert) TagResourceRequest(input *TagResourceInput) (req *request // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/TagResource func (c *MediaConvert) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { @@ -2221,18 +2231,18 @@ func (c *MediaConvert) UntagResourceRequest(input *UntagResourceInput) (req *req // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/UntagResource func (c *MediaConvert) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { @@ -2309,18 +2319,18 @@ func (c *MediaConvert) UpdateJobTemplateRequest(input *UpdateJobTemplateInput) ( // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation UpdateJobTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/UpdateJobTemplate func (c *MediaConvert) UpdateJobTemplate(input *UpdateJobTemplateInput) (*UpdateJobTemplateOutput, error) { @@ -2397,18 +2407,18 @@ func (c *MediaConvert) UpdatePresetRequest(input *UpdatePresetInput) (req *reque // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation UpdatePreset for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/UpdatePreset func (c *MediaConvert) UpdatePreset(input *UpdatePresetInput) (*UpdatePresetOutput, error) { @@ -2485,18 +2495,18 @@ func (c *MediaConvert) UpdateQueueRequest(input *UpdateQueueInput) (req *request // See the AWS API reference guide for AWS Elemental MediaConvert's // API operation UpdateQueue for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediaconvert-2017-08-29/UpdateQueue func (c *MediaConvert) UpdateQueue(input *UpdateQueueInput) (*UpdateQueueOutput, error) { @@ -2781,7 +2791,8 @@ func (s *Ac3Settings) SetSampleRate(v int64) *Ac3Settings { type AccelerationSettings struct { _ struct{} `type:"structure"` - // Acceleration configuration for the job. + // Specify the conditions when the service will run your job with accelerated + // transcoding. // // Mode is a required field Mode *string `locationName:"mode" type:"string" required:"true" enum:"AccelerationMode"` @@ -3004,8 +3015,8 @@ func (s AssociateCertificateOutput) GoString() string { // depending on the value that you choose for Audio codec (Codec). For each // codec enum that you choose, define the corresponding settings object. The // following lists the codec enum, settings object pairs. * AAC, AacSettings -// * MP2, Mp2Settings * WAV, WavSettings * AIFF, AiffSettings * AC3, Ac3Settings -// * EAC3, Eac3Settings * EAC3_ATMOS, Eac3AtmosSettings +// * MP2, Mp2Settings * MP3, Mp3Settings * WAV, WavSettings * AIFF, AiffSettings +// * AC3, Ac3Settings * EAC3, Eac3Settings * EAC3_ATMOS, Eac3AtmosSettings type AudioCodecSettings struct { _ struct{} `type:"structure"` @@ -3041,6 +3052,10 @@ type AudioCodecSettings struct { // the value MP2. Mp2Settings *Mp2Settings `locationName:"mp2Settings" type:"structure"` + // Required when you set Codec, under AudioDescriptions>CodecSettings, to the + // value MP3. + Mp3Settings *Mp3Settings `locationName:"mp3Settings" type:"structure"` + // Required when you set (Codec) under (AudioDescriptions)>(CodecSettings) to // the value WAV. WavSettings *WavSettings `locationName:"wavSettings" type:"structure"` @@ -3089,6 +3104,11 @@ func (s *AudioCodecSettings) Validate() error { invalidParams.AddNested("Mp2Settings", err.(request.ErrInvalidParams)) } } + if s.Mp3Settings != nil { + if err := s.Mp3Settings.Validate(); err != nil { + invalidParams.AddNested("Mp3Settings", err.(request.ErrInvalidParams)) + } + } if s.WavSettings != nil { if err := s.WavSettings.Validate(); err != nil { invalidParams.AddNested("WavSettings", err.(request.ErrInvalidParams)) @@ -3143,6 +3163,12 @@ func (s *AudioCodecSettings) SetMp2Settings(v *Mp2Settings) *AudioCodecSettings return s } +// SetMp3Settings sets the Mp3Settings field's value. +func (s *AudioCodecSettings) SetMp3Settings(v *Mp3Settings) *AudioCodecSettings { + s.Mp3Settings = v + return s +} + // SetWavSettings sets the WavSettings field's value. func (s *AudioCodecSettings) SetWavSettings(v *WavSettings) *AudioCodecSettings { s.WavSettings = v @@ -3187,16 +3213,20 @@ type AudioDescription struct { // depending on the value that you choose for Audio codec (Codec). For each // codec enum that you choose, define the corresponding settings object. The // following lists the codec enum, settings object pairs. * AAC, AacSettings - // * MP2, Mp2Settings * WAV, WavSettings * AIFF, AiffSettings * AC3, Ac3Settings - // * EAC3, Eac3Settings * EAC3_ATMOS, Eac3AtmosSettings + // * MP2, Mp2Settings * MP3, Mp3Settings * WAV, WavSettings * AIFF, AiffSettings + // * AC3, Ac3Settings * EAC3, Eac3Settings * EAC3_ATMOS, Eac3AtmosSettings CodecSettings *AudioCodecSettings `locationName:"codecSettings" type:"structure"` - // Specify the language for this audio output track, using the ISO 639-2 or - // ISO 639-3 three-letter language code. The language specified will be used - // when 'Follow Input Language Code' is not selected or when 'Follow Input Language - // Code' is selected but there is no ISO 639 language code specified by the - // input. - CustomLanguageCode *string `locationName:"customLanguageCode" min:"3" type:"string"` + // Specify the language for this audio output track. The service puts this language + // code into your output audio track when you set Language code control (AudioLanguageCodeControl) + // to Use configured (USE_CONFIGURED). The service also uses your specified + // custom language code when you set Language code control (AudioLanguageCodeControl) + // to Follow input (FOLLOW_INPUT), but your input file doesn't specify a language + // code. For all outputs, you can use an ISO 639-2 or ISO 639-3 code. For streaming + // outputs, you can also use any other code in the full RFC-5646 specification. + // Streaming outputs are those that are in one of the following output groups: + // CMAF, DASH ISO, Apple HLS, or Microsoft Smooth Streaming. + CustomLanguageCode *string `locationName:"customLanguageCode" type:"string"` // Indicates the language of the audio output track. The ISO 639 language specified // in the 'Language Code' drop down will be used when 'Follow Input Language @@ -3204,10 +3234,12 @@ type AudioDescription struct { // there is no ISO 639 language code specified by the input. LanguageCode *string `locationName:"languageCode" type:"string" enum:"LanguageCode"` - // Choosing FOLLOW_INPUT will cause the ISO 639 language code of the output - // to follow the ISO 639 language code of the input. The language specified - // for languageCode' will be used when USE_CONFIGURED is selected or when FOLLOW_INPUT - // is selected but there is no ISO 639 language code specified by the input. + // Specify which source for language code takes precedence for this audio track. + // When you choose Follow input (FOLLOW_INPUT), the service uses the language + // code from the input track if it's present. If there's no languge code on + // the input track, the service uses the code that you specify in the setting + // Language code (languageCode or customLanguageCode). When you choose Use configured + // (USE_CONFIGURED), the service uses the language code that you specify. LanguageCodeControl *string `locationName:"languageCodeControl" type:"string" enum:"AudioLanguageCodeControl"` // Advanced audio remixing settings. @@ -3233,9 +3265,6 @@ func (s AudioDescription) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *AudioDescription) Validate() error { invalidParams := request.ErrInvalidParams{Context: "AudioDescription"} - if s.CustomLanguageCode != nil && len(*s.CustomLanguageCode) < 3 { - invalidParams.Add(request.NewErrParamMinLen("CustomLanguageCode", 3)) - } if s.AudioNormalizationSettings != nil { if err := s.AudioNormalizationSettings.Validate(); err != nil { invalidParams.AddNested("AudioNormalizationSettings", err.(request.ErrInvalidParams)) @@ -3340,8 +3369,7 @@ type AudioNormalizationSettings struct { AlgorithmControl *string `locationName:"algorithmControl" type:"string" enum:"AudioNormalizationAlgorithmControl"` // Content measuring above this level will be corrected to the target level. - // Content measuring below this level will not be corrected. Gating only applies - // when not using real_time_correction. + // Content measuring below this level will not be corrected. CorrectionGateLevel *int64 `locationName:"correctionGateLevel" type:"integer"` // If set to LOG, log each output's audio track loudness to a CSV file. @@ -3629,6 +3657,61 @@ func (s *AvailBlanking) SetAvailBlankingImage(v string) *AvailBlanking { return s } +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // Burn-In Destination Settings. type BurninDestinationSettings struct { _ struct{} `type:"structure"` @@ -3932,13 +4015,16 @@ type CaptionDescription struct { // each input. CaptionSelectorName *string `locationName:"captionSelectorName" min:"1" type:"string"` - // Indicates the language of the caption output track, using the ISO 639-2 or - // ISO 639-3 three-letter language code. For most captions output formats, the - // encoder puts this language information in the output captions metadata. If - // your output captions format is DVB-Sub or Burn in, the encoder uses this - // language information to choose the font language for rendering the captions - // text. - CustomLanguageCode *string `locationName:"customLanguageCode" min:"3" type:"string"` + // Specify the language for this captions output track. For most captions output + // formats, the encoder puts this language information in the output captions + // metadata. If your output captions format is DVB-Sub or Burn in, the encoder + // uses this language information when automatically selecting the font script + // for rendering the captions text. For all outputs, you can use an ISO 639-2 + // or ISO 639-3 code. For streaming outputs, you can also use any other code + // in the full RFC-5646 specification. Streaming outputs are those that are + // in one of the following output groups: CMAF, DASH ISO, Apple HLS, or Microsoft + // Smooth Streaming. + CustomLanguageCode *string `locationName:"customLanguageCode" type:"string"` // Specific settings required by destination type. Note that burnin_destination_settings // are not available if the source of the caption data is Embedded or Teletext. @@ -3975,9 +4061,6 @@ func (s *CaptionDescription) Validate() error { if s.CaptionSelectorName != nil && len(*s.CaptionSelectorName) < 1 { invalidParams.Add(request.NewErrParamMinLen("CaptionSelectorName", 1)) } - if s.CustomLanguageCode != nil && len(*s.CustomLanguageCode) < 3 { - invalidParams.Add(request.NewErrParamMinLen("CustomLanguageCode", 3)) - } if s.DestinationSettings != nil { if err := s.DestinationSettings.Validate(); err != nil { invalidParams.AddNested("DestinationSettings", err.(request.ErrInvalidParams)) @@ -4024,13 +4107,16 @@ func (s *CaptionDescription) SetLanguageDescription(v string) *CaptionDescriptio type CaptionDescriptionPreset struct { _ struct{} `type:"structure"` - // Indicates the language of the caption output track, using the ISO 639-2 or - // ISO 639-3 three-letter language code. For most captions output formats, the - // encoder puts this language information in the output captions metadata. If - // your output captions format is DVB-Sub or Burn in, the encoder uses this - // language information to choose the font language for rendering the captions - // text. - CustomLanguageCode *string `locationName:"customLanguageCode" min:"3" type:"string"` + // Specify the language for this captions output track. For most captions output + // formats, the encoder puts this language information in the output captions + // metadata. If your output captions format is DVB-Sub or Burn in, the encoder + // uses this language information when automatically selecting the font script + // for rendering the captions text. For all outputs, you can use an ISO 639-2 + // or ISO 639-3 code. For streaming outputs, you can also use any other code + // in the full RFC-5646 specification. Streaming outputs are those that are + // in one of the following output groups: CMAF, DASH ISO, Apple HLS, or Microsoft + // Smooth Streaming. + CustomLanguageCode *string `locationName:"customLanguageCode" type:"string"` // Specific settings required by destination type. Note that burnin_destination_settings // are not available if the source of the caption data is Embedded or Teletext. @@ -4064,9 +4150,6 @@ func (s CaptionDescriptionPreset) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *CaptionDescriptionPreset) Validate() error { invalidParams := request.ErrInvalidParams{Context: "CaptionDescriptionPreset"} - if s.CustomLanguageCode != nil && len(*s.CustomLanguageCode) < 3 { - invalidParams.Add(request.NewErrParamMinLen("CustomLanguageCode", 3)) - } if s.DestinationSettings != nil { if err := s.DestinationSettings.Validate(); err != nil { invalidParams.AddNested("DestinationSettings", err.(request.ErrInvalidParams)) @@ -4454,6 +4537,61 @@ func (s *ChannelMapping) SetOutputChannels(v []*OutputChannelMapping) *ChannelMa return s } +// Specify the details for each pair of HLS and DASH additional manifests that +// you want the service to generate for this CMAF output group. Each pair of +// manifests can reference a different subset of outputs in the group. +type CmafAdditionalManifest struct { + _ struct{} `type:"structure"` + + // Specify a name modifier that the service adds to the name of this manifest + // to make it different from the file names of the other main manifests in the + // output group. For example, say that the default main manifest for your HLS + // group is film-name.m3u8. If you enter "-no-premium" for this setting, then + // the file name the service generates for this top-level manifest is film-name-no-premium.m3u8. + // For HLS output groups, specify a manifestNameModifier that is different from + // the nameModifier of the output. The service uses the output name modifier + // to create unique names for the individual variant manifests. + ManifestNameModifier *string `locationName:"manifestNameModifier" min:"1" type:"string"` + + // Specify the outputs that you want this additional top-level manifest to reference. + SelectedOutputs []*string `locationName:"selectedOutputs" type:"list"` +} + +// String returns the string representation +func (s CmafAdditionalManifest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CmafAdditionalManifest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CmafAdditionalManifest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CmafAdditionalManifest"} + if s.ManifestNameModifier != nil && len(*s.ManifestNameModifier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ManifestNameModifier", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetManifestNameModifier sets the ManifestNameModifier field's value. +func (s *CmafAdditionalManifest) SetManifestNameModifier(v string) *CmafAdditionalManifest { + s.ManifestNameModifier = &v + return s +} + +// SetSelectedOutputs sets the SelectedOutputs field's value. +func (s *CmafAdditionalManifest) SetSelectedOutputs(v []*string) *CmafAdditionalManifest { + s.SelectedOutputs = v + return s +} + // Settings for CMAF encryption type CmafEncryptionSettings struct { _ struct{} `type:"structure"` @@ -4549,6 +4687,14 @@ func (s *CmafEncryptionSettings) SetType(v string) *CmafEncryptionSettings { type CmafGroupSettings struct { _ struct{} `type:"structure"` + // By default, the service creates one top-level .m3u8 HLS manifest and one + // top -level .mpd DASH manifest for each CMAF output group in your job. These + // default manifests reference every output in the output group. To create additional + // top-level manifests that reference a subset of the outputs in the output + // group, specify a list of them here. For each additional manifest that you + // specify, the service creates one HLS manifest and one DASH manifest. + AdditionalManifests []*CmafAdditionalManifest `locationName:"additionalManifests" type:"list"` + // A partial URI prefix that will be put in the manifest file at the top level // BaseURL element. Can be used if streams are delivered from a different URL // than the manifest file. @@ -4608,6 +4754,14 @@ type CmafGroupSettings struct { // to 1, your final segment is 3.5 seconds. MinFinalSegmentLength *float64 `locationName:"minFinalSegmentLength" type:"double"` + // Specify whether your DASH profile is on-demand or main. When you choose Main + // profile (MAIN_PROFILE), the service signals urn:mpeg:dash:profile:isoff-main:2011 + // in your .mpd DASH manifest. When you choose On-demand (ON_DEMAND_PROFILE), + // the service signals urn:mpeg:dash:profile:isoff-on-demand:2011 in your .mpd. + // When you choose On-demand, you must also set the output group setting Segment + // control (SegmentControl) to Single file (SINGLE_FILE). + MpdProfile *string `locationName:"mpdProfile" type:"string" enum:"CmafMpdProfile"` + // When set to SINGLE_FILE, a single output file is generated, which is internally // segmented using the Fragment Length and Segment Length. When set to SEGMENTED_FILES, // separate segment files will be created. @@ -4632,6 +4786,14 @@ type CmafGroupSettings struct { // When set to ENABLED, an Apple HLS manifest will be generated for this output. WriteHlsManifest *string `locationName:"writeHlsManifest" type:"string" enum:"CmafWriteHLSManifest"` + + // When you enable Precise segment duration in DASH manifests (writeSegmentTimelineInRepresentation), + // your DASH manifest shows precise segment durations. The segment duration + // information appears inside the SegmentTimeline element, inside SegmentTemplate + // at the Representation level. When this feature isn't enabled, the segment + // durations in your DASH manifest are approximate. The segment duration information + // appears in the duration attribute of the SegmentTemplate element. + WriteSegmentTimelineInRepresentation *string `locationName:"writeSegmentTimelineInRepresentation" type:"string" enum:"CmafWriteSegmentTimelineInRepresentation"` } // String returns the string representation @@ -4653,6 +4815,16 @@ func (s *CmafGroupSettings) Validate() error { if s.SegmentLength != nil && *s.SegmentLength < 1 { invalidParams.Add(request.NewErrParamMinValue("SegmentLength", 1)) } + if s.AdditionalManifests != nil { + for i, v := range s.AdditionalManifests { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AdditionalManifests", i), err.(request.ErrInvalidParams)) + } + } + } if s.Encryption != nil { if err := s.Encryption.Validate(); err != nil { invalidParams.AddNested("Encryption", err.(request.ErrInvalidParams)) @@ -4665,6 +4837,12 @@ func (s *CmafGroupSettings) Validate() error { return nil } +// SetAdditionalManifests sets the AdditionalManifests field's value. +func (s *CmafGroupSettings) SetAdditionalManifests(v []*CmafAdditionalManifest) *CmafGroupSettings { + s.AdditionalManifests = v + return s +} + // SetBaseUrl sets the BaseUrl field's value. func (s *CmafGroupSettings) SetBaseUrl(v string) *CmafGroupSettings { s.BaseUrl = &v @@ -4731,6 +4909,12 @@ func (s *CmafGroupSettings) SetMinFinalSegmentLength(v float64) *CmafGroupSettin return s } +// SetMpdProfile sets the MpdProfile field's value. +func (s *CmafGroupSettings) SetMpdProfile(v string) *CmafGroupSettings { + s.MpdProfile = &v + return s +} + // SetSegmentControl sets the SegmentControl field's value. func (s *CmafGroupSettings) SetSegmentControl(v string) *CmafGroupSettings { s.SegmentControl = &v @@ -4761,6 +4945,51 @@ func (s *CmafGroupSettings) SetWriteHlsManifest(v string) *CmafGroupSettings { return s } +// SetWriteSegmentTimelineInRepresentation sets the WriteSegmentTimelineInRepresentation field's value. +func (s *CmafGroupSettings) SetWriteSegmentTimelineInRepresentation(v string) *CmafGroupSettings { + s.WriteSegmentTimelineInRepresentation = &v + return s +} + +// Settings for MP4 segments in CMAF +type CmfcSettings struct { + _ struct{} `type:"structure"` + + // Use this setting only when you specify SCTE-35 markers from ESAM. Choose + // INSERT to put SCTE-35 markers in this output at the insertion points that + // you specify in an ESAM XML document. Provide the document in the setting + // SCC XML (sccXml). + Scte35Esam *string `locationName:"scte35Esam" type:"string" enum:"CmfcScte35Esam"` + + // Ignore this setting unless you have SCTE-35 markers in your input video file. + // Choose Passthrough (PASSTHROUGH) if you want SCTE-35 markers that appear + // in your input to also appear in this output. Choose None (NONE) if you don't + // want those SCTE-35 markers in this output. + Scte35Source *string `locationName:"scte35Source" type:"string" enum:"CmfcScte35Source"` +} + +// String returns the string representation +func (s CmfcSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CmfcSettings) GoString() string { + return s.String() +} + +// SetScte35Esam sets the Scte35Esam field's value. +func (s *CmfcSettings) SetScte35Esam(v string) *CmfcSettings { + s.Scte35Esam = &v + return s +} + +// SetScte35Source sets the Scte35Source field's value. +func (s *CmfcSettings) SetScte35Source(v string) *CmfcSettings { + s.Scte35Source = &v + return s +} + // Settings for color correction. type ColorCorrector struct { _ struct{} `type:"structure"` @@ -4867,10 +5096,68 @@ func (s *ColorCorrector) SetSaturation(v int64) *ColorCorrector { return s } +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictException) GoString() string { + return s.String() +} + +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" +} + +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil +} + +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID +} + // Container specific settings. type ContainerSettings struct { _ struct{} `type:"structure"` + // Settings for MP4 segments in CMAF + CmfcSettings *CmfcSettings `locationName:"cmfcSettings" type:"structure"` + // Container for this output. Some containers require a container settings object. // If not specified, the default object will be created. Container *string `locationName:"container" type:"string" enum:"ContainerType"` @@ -4899,6 +5186,9 @@ type ContainerSettings struct { // Settings for MP4 container. You can create audio-only AAC outputs with this // container. Mp4Settings *Mp4Settings `locationName:"mp4Settings" type:"structure"` + + // Settings for MP4 segments in DASH + MpdSettings *MpdSettings `locationName:"mpdSettings" type:"structure"` } // String returns the string representation @@ -4931,6 +5221,12 @@ func (s *ContainerSettings) Validate() error { return nil } +// SetCmfcSettings sets the CmfcSettings field's value. +func (s *ContainerSettings) SetCmfcSettings(v *CmfcSettings) *ContainerSettings { + s.CmfcSettings = v + return s +} + // SetContainer sets the Container field's value. func (s *ContainerSettings) SetContainer(v string) *ContainerSettings { s.Container = &v @@ -4967,6 +5263,12 @@ func (s *ContainerSettings) SetMp4Settings(v *Mp4Settings) *ContainerSettings { return s } +// SetMpdSettings sets the MpdSettings field's value. +func (s *ContainerSettings) SetMpdSettings(v *MpdSettings) *ContainerSettings { + s.MpdSettings = v + return s +} + // Send your create job request with your job settings and IAM role. Optionally, // include user metadata and the ARN for the queue. type CreateJobInput struct { @@ -5027,6 +5329,10 @@ type CreateJobInput struct { // your job to the time it completes the transcode or encounters an error. StatusUpdateInterval *string `locationName:"statusUpdateInterval" type:"string" enum:"StatusUpdateInterval"` + // The tags that you want to add to the resource. You can tag resources with + // a key-value pair or with only a key. + Tags map[string]*string `locationName:"tags" type:"map"` + // User-defined metadata that you want to associate with an MediaConvert job. // You specify metadata in key/value pairs. UserMetadata map[string]*string `locationName:"userMetadata" type:"map"` @@ -5131,6 +5437,12 @@ func (s *CreateJobInput) SetStatusUpdateInterval(v string) *CreateJobInput { return s } +// SetTags sets the Tags field's value. +func (s *CreateJobInput) SetTags(v map[string]*string) *CreateJobInput { + s.Tags = v + return s +} + // SetUserMetadata sets the UserMetadata field's value. func (s *CreateJobInput) SetUserMetadata(v map[string]*string) *CreateJobInput { s.UserMetadata = v @@ -5572,6 +5884,58 @@ func (s *CreateQueueOutput) SetQueue(v *Queue) *CreateQueueOutput { return s } +// Specify the details for each additional DASH manifest that you want the service +// to generate for this output group. Each manifest can reference a different +// subset of outputs in the group. +type DashAdditionalManifest struct { + _ struct{} `type:"structure"` + + // Specify a name modifier that the service adds to the name of this manifest + // to make it different from the file names of the other main manifests in the + // output group. For example, say that the default main manifest for your DASH + // group is film-name.mpd. If you enter "-no-premium" for this setting, then + // the file name the service generates for this top-level manifest is film-name-no-premium.mpd. + ManifestNameModifier *string `locationName:"manifestNameModifier" min:"1" type:"string"` + + // Specify the outputs that you want this additional top-level manifest to reference. + SelectedOutputs []*string `locationName:"selectedOutputs" type:"list"` +} + +// String returns the string representation +func (s DashAdditionalManifest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DashAdditionalManifest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DashAdditionalManifest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DashAdditionalManifest"} + if s.ManifestNameModifier != nil && len(*s.ManifestNameModifier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ManifestNameModifier", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetManifestNameModifier sets the ManifestNameModifier field's value. +func (s *DashAdditionalManifest) SetManifestNameModifier(v string) *DashAdditionalManifest { + s.ManifestNameModifier = &v + return s +} + +// SetSelectedOutputs sets the SelectedOutputs field's value. +func (s *DashAdditionalManifest) SetSelectedOutputs(v []*string) *DashAdditionalManifest { + s.SelectedOutputs = v + return s +} + // Specifies DRM settings for DASH outputs. type DashIsoEncryptionSettings struct { _ struct{} `type:"structure"` @@ -5617,6 +5981,12 @@ func (s *DashIsoEncryptionSettings) SetSpekeKeyProvider(v *SpekeKeyProvider) *Da type DashIsoGroupSettings struct { _ struct{} `type:"structure"` + // By default, the service creates one .mpd DASH manifest for each DASH ISO + // output group in your job. This default manifest references every output in + // the output group. To create additional DASH manifests that reference a subset + // of the outputs in the output group, specify a list of them here. + AdditionalManifests []*DashAdditionalManifest `locationName:"additionalManifests" type:"list"` + // A partial URI prefix that will be put in the manifest (.mpd) file at the // top level BaseURL element. Can be used if streams are delivered from a different // URL than the manifest file. @@ -5651,6 +6021,14 @@ type DashIsoGroupSettings struct { // playout. MinBufferTime *int64 `locationName:"minBufferTime" type:"integer"` + // Specify whether your DASH profile is on-demand or main. When you choose Main + // profile (MAIN_PROFILE), the service signals urn:mpeg:dash:profile:isoff-main:2011 + // in your .mpd DASH manifest. When you choose On-demand (ON_DEMAND_PROFILE), + // the service signals urn:mpeg:dash:profile:isoff-on-demand:2011 in your .mpd. + // When you choose On-demand, you must also set the output group setting Segment + // control (SegmentControl) to Single file (SINGLE_FILE). + MpdProfile *string `locationName:"mpdProfile" type:"string" enum:"DashIsoMpdProfile"` + // When set to SINGLE_FILE, a single output file is generated, which is internally // segmented using the Fragment Length and Segment Length. When set to SEGMENTED_FILES, // separate segment files will be created. @@ -5663,12 +6041,13 @@ type DashIsoGroupSettings struct { // files as in other output types. SegmentLength *int64 `locationName:"segmentLength" min:"1" type:"integer"` - // When you enable Precise segment duration in manifests (writeSegmentTimelineInRepresentation), - // your DASH manifest shows precise segment durations. The segment duration - // information appears inside the SegmentTimeline element, inside SegmentTemplate - // at the Representation level. When this feature isn't enabled, the segment - // durations in your DASH manifest are approximate. The segment duration information - // appears in the duration attribute of the SegmentTemplate element. + // If you get an HTTP error in the 400 range when you play back your DASH output, + // enable this setting and run your transcoding job again. When you enable this + // setting, the service writes precise segment durations in the DASH manifest. + // The segment duration information appears inside the SegmentTimeline element, + // inside SegmentTemplate at the Representation level. When you don't enable + // this setting, the service writes approximate segment durations in your DASH + // manifest. WriteSegmentTimelineInRepresentation *string `locationName:"writeSegmentTimelineInRepresentation" type:"string" enum:"DashIsoWriteSegmentTimelineInRepresentation"` } @@ -5691,6 +6070,16 @@ func (s *DashIsoGroupSettings) Validate() error { if s.SegmentLength != nil && *s.SegmentLength < 1 { invalidParams.Add(request.NewErrParamMinValue("SegmentLength", 1)) } + if s.AdditionalManifests != nil { + for i, v := range s.AdditionalManifests { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AdditionalManifests", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -5698,6 +6087,12 @@ func (s *DashIsoGroupSettings) Validate() error { return nil } +// SetAdditionalManifests sets the AdditionalManifests field's value. +func (s *DashIsoGroupSettings) SetAdditionalManifests(v []*DashAdditionalManifest) *DashIsoGroupSettings { + s.AdditionalManifests = v + return s +} + // SetBaseUrl sets the BaseUrl field's value. func (s *DashIsoGroupSettings) SetBaseUrl(v string) *DashIsoGroupSettings { s.BaseUrl = &v @@ -5740,6 +6135,12 @@ func (s *DashIsoGroupSettings) SetMinBufferTime(v int64) *DashIsoGroupSettings { return s } +// SetMpdProfile sets the MpdProfile field's value. +func (s *DashIsoGroupSettings) SetMpdProfile(v string) *DashIsoGroupSettings { + s.MpdProfile = &v + return s +} + // SetSegmentControl sets the SegmentControl field's value. func (s *DashIsoGroupSettings) SetSegmentControl(v string) *DashIsoGroupSettings { s.SegmentControl = &v @@ -6155,6 +6556,88 @@ func (s DisassociateCertificateOutput) GoString() string { return s.String() } +// Settings for Dolby Vision +type DolbyVision struct { + _ struct{} `type:"structure"` + + // Use these settings when you set DolbyVisionLevel6Mode to SPECIFY to override + // the MaxCLL and MaxFALL values in your input with new values. + L6Metadata *DolbyVisionLevel6Metadata `locationName:"l6Metadata" type:"structure"` + + // Use Dolby Vision Mode to choose how the service will handle Dolby Vision + // MaxCLL and MaxFALL properies. + L6Mode *string `locationName:"l6Mode" type:"string" enum:"DolbyVisionLevel6Mode"` + + // In the current MediaConvert implementation, the Dolby Vision profile is always + // 5 (PROFILE_5). Therefore, all of your inputs must contain Dolby Vision frame + // interleaved data. + Profile *string `locationName:"profile" type:"string" enum:"DolbyVisionProfile"` +} + +// String returns the string representation +func (s DolbyVision) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DolbyVision) GoString() string { + return s.String() +} + +// SetL6Metadata sets the L6Metadata field's value. +func (s *DolbyVision) SetL6Metadata(v *DolbyVisionLevel6Metadata) *DolbyVision { + s.L6Metadata = v + return s +} + +// SetL6Mode sets the L6Mode field's value. +func (s *DolbyVision) SetL6Mode(v string) *DolbyVision { + s.L6Mode = &v + return s +} + +// SetProfile sets the Profile field's value. +func (s *DolbyVision) SetProfile(v string) *DolbyVision { + s.Profile = &v + return s +} + +// Use these settings when you set DolbyVisionLevel6Mode to SPECIFY to override +// the MaxCLL and MaxFALL values in your input with new values. +type DolbyVisionLevel6Metadata struct { + _ struct{} `type:"structure"` + + // Maximum Content Light Level. Static HDR metadata that corresponds to the + // brightest pixel in the entire stream. Measured in nits. + MaxCll *int64 `locationName:"maxCll" type:"integer"` + + // Maximum Frame-Average Light Level. Static HDR metadata that corresponds to + // the highest frame-average brightness in the entire stream. Measured in nits. + MaxFall *int64 `locationName:"maxFall" type:"integer"` +} + +// String returns the string representation +func (s DolbyVisionLevel6Metadata) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DolbyVisionLevel6Metadata) GoString() string { + return s.String() +} + +// SetMaxCll sets the MaxCll field's value. +func (s *DolbyVisionLevel6Metadata) SetMaxCll(v int64) *DolbyVisionLevel6Metadata { + s.MaxCll = &v + return s +} + +// SetMaxFall sets the MaxFall field's value. +func (s *DolbyVisionLevel6Metadata) SetMaxFall(v int64) *DolbyVisionLevel6Metadata { + s.MaxFall = &v + return s +} + // Inserts DVB Network Information Table (NIT) at the specified table repetition // interval. type DvbNitSettings struct { @@ -6374,6 +6857,11 @@ type DvbSubDestinationSettings struct { // burn-in and DVB-Sub font settings must match. ShadowYOffset *int64 `locationName:"shadowYOffset" type:"integer"` + // Specify whether your DVB subtitles are standard or for hearing impaired. + // Choose hearing impaired if your subtitles include audio descriptions and + // dialogue. Choose standard if your subtitles include only dialogue. + SubtitlingType *string `locationName:"subtitlingType" type:"string" enum:"DvbSubtitlingType"` + // Only applies to jobs with input captions in Teletext or STL formats. Specify // whether the spacing between letters in your captions is set by the captions // grid or varies depending on letter width. Choose fixed grid to conform to @@ -6513,6 +7001,12 @@ func (s *DvbSubDestinationSettings) SetShadowYOffset(v int64) *DvbSubDestination return s } +// SetSubtitlingType sets the SubtitlingType field's value. +func (s *DvbSubDestinationSettings) SetSubtitlingType(v string) *DvbSubDestinationSettings { + s.SubtitlingType = &v + return s +} + // SetTeletextSpacing sets the TeletextSpacing field's value. func (s *DvbSubDestinationSettings) SetTeletextSpacing(v string) *DvbSubDestinationSettings { s.TeletextSpacing = &v @@ -7470,6 +7964,61 @@ func (s *FileSourceSettings) SetTimeDelta(v int64) *FileSourceSettings { return s } +type ForbiddenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ForbiddenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ForbiddenException) GoString() string { + return s.String() +} + +func newErrorForbiddenException(v protocol.ResponseMetadata) error { + return &ForbiddenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ForbiddenException) Code() string { + return "ForbiddenException" +} + +// Message returns the exception's message. +func (s ForbiddenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ForbiddenException) OrigErr() error { + return nil +} + +func (s ForbiddenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ForbiddenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ForbiddenException) RequestID() string { + return s.respMetadata.RequestID +} + // Required when you set (Codec) under (VideoDescription)>(CodecSettings) to // the value FRAME_CAPTURE. type FrameCaptureSettings struct { @@ -7842,11 +8391,22 @@ type H264QvbrSettings struct { MaxAverageBitrate *int64 `locationName:"maxAverageBitrate" min:"1000" type:"integer"` // Required when you use QVBR rate control mode. That is, when you specify qvbrSettings - // within h264Settings. Specify the target quality level for this output, from - // 1 to 10. Use higher numbers for greater quality. Level 10 results in nearly - // lossless compression. The quality level for most broadcast-quality transcodes - // is between 6 and 9. + // within h264Settings. Specify the general target quality level for this output, + // from 1 to 10. Use higher numbers for greater quality. Level 10 results in + // nearly lossless compression. The quality level for most broadcast-quality + // transcodes is between 6 and 9. Optionally, to specify a value between whole + // numbers, also provide a value for the setting qvbrQualityLevelFineTune. For + // example, if you want your QVBR quality level to be 7.33, set qvbrQualityLevel + // to 7 and set qvbrQualityLevelFineTune to .33. QvbrQualityLevel *int64 `locationName:"qvbrQualityLevel" min:"1" type:"integer"` + + // Optional. Specify a value here to set the QVBR quality to a level that is + // between whole numbers. For example, if you want your QVBR quality level to + // be 7.33, set qvbrQualityLevel to 7 and set qvbrQualityLevelFineTune to .33. + // MediaConvert rounds your QVBR quality level to the nearest third of a whole + // number. For example, if you set qvbrQualityLevel to 7 and you set qvbrQualityLevelFineTune + // to .25, your actual QVBR quality level is 7.33. + QvbrQualityLevelFineTune *float64 `locationName:"qvbrQualityLevelFineTune" type:"double"` } // String returns the string representation @@ -7887,6 +8447,12 @@ func (s *H264QvbrSettings) SetQvbrQualityLevel(v int64) *H264QvbrSettings { return s } +// SetQvbrQualityLevelFineTune sets the QvbrQualityLevelFineTune field's value. +func (s *H264QvbrSettings) SetQvbrQualityLevelFineTune(v float64) *H264QvbrSettings { + s.QvbrQualityLevelFineTune = &v + return s +} + // Required when you set (Codec) under (VideoDescription)>(CodecSettings) to // the value H_264. type H264Settings struct { @@ -8382,11 +8948,22 @@ type H265QvbrSettings struct { MaxAverageBitrate *int64 `locationName:"maxAverageBitrate" min:"1000" type:"integer"` // Required when you use QVBR rate control mode. That is, when you specify qvbrSettings - // within h265Settings. Specify the target quality level for this output, from - // 1 to 10. Use higher numbers for greater quality. Level 10 results in nearly - // lossless compression. The quality level for most broadcast-quality transcodes - // is between 6 and 9. + // within h265Settings. Specify the general target quality level for this output, + // from 1 to 10. Use higher numbers for greater quality. Level 10 results in + // nearly lossless compression. The quality level for most broadcast-quality + // transcodes is between 6 and 9. Optionally, to specify a value between whole + // numbers, also provide a value for the setting qvbrQualityLevelFineTune. For + // example, if you want your QVBR quality level to be 7.33, set qvbrQualityLevel + // to 7 and set qvbrQualityLevelFineTune to .33. QvbrQualityLevel *int64 `locationName:"qvbrQualityLevel" min:"1" type:"integer"` + + // Optional. Specify a value here to set the QVBR quality to a level that is + // between whole numbers. For example, if you want your QVBR quality level to + // be 7.33, set qvbrQualityLevel to 7 and set qvbrQualityLevelFineTune to .33. + // MediaConvert rounds your QVBR quality level to the nearest third of a whole + // number. For example, if you set qvbrQualityLevel to 7 and you set qvbrQualityLevelFineTune + // to .25, your actual QVBR quality level is 7.33. + QvbrQualityLevelFineTune *float64 `locationName:"qvbrQualityLevelFineTune" type:"double"` } // String returns the string representation @@ -8427,6 +9004,12 @@ func (s *H265QvbrSettings) SetQvbrQualityLevel(v int64) *H265QvbrSettings { return s } +// SetQvbrQualityLevelFineTune sets the QvbrQualityLevelFineTune field's value. +func (s *H265QvbrSettings) SetQvbrQualityLevelFineTune(v float64) *H265QvbrSettings { + s.QvbrQualityLevelFineTune = &v + return s +} + // Settings for H265 codec type H265Settings struct { _ struct{} `type:"structure"` @@ -8623,17 +9206,17 @@ type H265Settings struct { // Inserts timecode for each frame as 4 bytes of an unregistered SEI message. UnregisteredSeiTimecode *string `locationName:"unregisteredSeiTimecode" type:"string" enum:"H265UnregisteredSeiTimecode"` - // Use this setting only for outputs encoded with H.265 that are in CMAF or - // DASH output groups. If you include writeMp4PackagingType in your JSON job - // specification for other outputs, your video might not work properly with - // downstream systems and video players. If the location of parameter set NAL - // units don't matter in your workflow, ignore this setting. The service defaults - // to marking your output as HEV1. Choose HVC1 to mark your output as HVC1. - // This makes your output compliant with this specification: ISO IECJTC1 SC29 - // N13798 Text ISO/IEC FDIS 14496-15 3rd Edition. For these outputs, the service - // stores parameter set NAL units in the sample headers but not in the samples - // directly. Keep the default HEV1 to mark your output as HEV1. For these outputs, - // the service writes parameter set NAL units directly into the samples. + // If the location of parameter set NAL units doesn't matter in your workflow, + // ignore this setting. Use this setting only with CMAF or DASH outputs, or + // with standalone file outputs in an MPEG-4 container (MP4 outputs). Choose + // HVC1 to mark your output as HVC1. This makes your output compliant with the + // following specification: ISO IECJTC1 SC29 N13798 Text ISO/IEC FDIS 14496-15 + // 3rd Edition. For these outputs, the service stores parameter set NAL units + // in the sample headers but not in the samples directly. For MP4 outputs, when + // you choose HVC1, your output video might not work properly with some downstream + // systems and video players. The service defaults to marking your output as + // HEV1. For these outputs, the service writes parameter set NAL units directly + // into the samples. WriteMp4PackagingType *string `locationName:"writeMp4PackagingType" type:"string" enum:"H265WriteMp4PackagingType"` } @@ -9069,6 +9652,61 @@ func (s *Hdr10Metadata) SetWhitePointY(v int64) *Hdr10Metadata { return s } +// Specify the details for each additional HLS manifest that you want the service +// to generate for this output group. Each manifest can reference a different +// subset of outputs in the group. +type HlsAdditionalManifest struct { + _ struct{} `type:"structure"` + + // Specify a name modifier that the service adds to the name of this manifest + // to make it different from the file names of the other main manifests in the + // output group. For example, say that the default main manifest for your HLS + // group is film-name.m3u8. If you enter "-no-premium" for this setting, then + // the file name the service generates for this top-level manifest is film-name-no-premium.m3u8. + // For HLS output groups, specify a manifestNameModifier that is different from + // the nameModifier of the output. The service uses the output name modifier + // to create unique names for the individual variant manifests. + ManifestNameModifier *string `locationName:"manifestNameModifier" min:"1" type:"string"` + + // Specify the outputs that you want this additional top-level manifest to reference. + SelectedOutputs []*string `locationName:"selectedOutputs" type:"list"` +} + +// String returns the string representation +func (s HlsAdditionalManifest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HlsAdditionalManifest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *HlsAdditionalManifest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HlsAdditionalManifest"} + if s.ManifestNameModifier != nil && len(*s.ManifestNameModifier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ManifestNameModifier", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetManifestNameModifier sets the ManifestNameModifier field's value. +func (s *HlsAdditionalManifest) SetManifestNameModifier(v string) *HlsAdditionalManifest { + s.ManifestNameModifier = &v + return s +} + +// SetSelectedOutputs sets the SelectedOutputs field's value. +func (s *HlsAdditionalManifest) SetSelectedOutputs(v []*string) *HlsAdditionalManifest { + s.SelectedOutputs = v + return s +} + // Caption Language Mapping type HlsCaptionLanguageMapping struct { _ struct{} `type:"structure"` @@ -9076,7 +9714,7 @@ type HlsCaptionLanguageMapping struct { // Caption channel. CaptionChannel *int64 `locationName:"captionChannel" type:"integer"` - // Specify the language for this caption channel, using the ISO 639-2 or ISO + // Specify the language for this captions channel, using the ISO 639-2 or ISO // 639-3 three-letter language code CustomLanguageCode *string `locationName:"customLanguageCode" min:"3" type:"string"` @@ -9247,6 +9885,12 @@ type HlsGroupSettings struct { // themselves. AdMarkers []*string `locationName:"adMarkers" type:"list"` + // By default, the service creates one top-level .m3u8 HLS manifest for each + // HLS output group in your job. This default manifest references every output + // in the output group. To create additional top-level manifests that reference + // a subset of the outputs in the output group, specify a list of them here. + AdditionalManifests []*HlsAdditionalManifest `locationName:"additionalManifests" type:"list"` + // A partial URI prefix that will be prepended to each output in the media .m3u8 // file. Can be used if base manifest is delivered from a different URL than // the main .m3u8 file. @@ -9381,6 +10025,16 @@ func (s *HlsGroupSettings) Validate() error { if s.TimestampDeltaMilliseconds != nil && *s.TimestampDeltaMilliseconds < -2.147483648e+09 { invalidParams.Add(request.NewErrParamMinValue("TimestampDeltaMilliseconds", -2.147483648e+09)) } + if s.AdditionalManifests != nil { + for i, v := range s.AdditionalManifests { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AdditionalManifests", i), err.(request.ErrInvalidParams)) + } + } + } if s.CaptionLanguageMappings != nil { for i, v := range s.CaptionLanguageMappings { if v == nil { @@ -9409,6 +10063,12 @@ func (s *HlsGroupSettings) SetAdMarkers(v []*string) *HlsGroupSettings { return s } +// SetAdditionalManifests sets the AdditionalManifests field's value. +func (s *HlsGroupSettings) SetAdditionalManifests(v []*HlsAdditionalManifest) *HlsGroupSettings { + s.AdditionalManifests = v + return s +} + // SetBaseUrl sets the BaseUrl field's value. func (s *HlsGroupSettings) SetBaseUrl(v string) *HlsGroupSettings { s.BaseUrl = &v @@ -9582,7 +10242,10 @@ type HlsSettings struct { // manifest IFrameOnlyManifest *string `locationName:"iFrameOnlyManifest" type:"string" enum:"HlsIFrameOnlyManifest"` - // String concatenated to end of segment filenames. Accepts "Format Identifiers":#format_identifier_parameters. + // Use this setting to add an identifying string to the filename of each segment. + // The service adds this string between the name modifier and segment index + // number. You can use format identifiers in the string. For more information, + // see https://docs.aws.amazon.com/mediaconvert/latest/ug/using-variables-in-your-job-settings.html SegmentModifier *string `locationName:"segmentModifier" type:"string"` } @@ -10486,8 +11149,8 @@ type InsertableImage struct { // blank. Height *int64 `locationName:"height" type:"integer"` - // Specify the Amazon S3 location of the image that you want to overlay on the - // video. Use a PNG or TGA file. + // Specify the HTTP, HTTPS, or Amazon S3 location of the image that you want + // to overlay on the video. Use a PNG or TGA file. ImageInserterInput *string `locationName:"imageInserterInput" min:"14" type:"string"` // Specify the distance, in pixels, between the inserted image and the left @@ -10608,6 +11271,61 @@ func (s *InsertableImage) SetWidth(v int64) *InsertableImage { return s } +type InternalServerErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalServerErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerErrorException) GoString() string { + return s.String() +} + +func newErrorInternalServerErrorException(v protocol.ResponseMetadata) error { + return &InternalServerErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerErrorException) Code() string { + return "InternalServerErrorException" +} + +// Message returns the exception's message. +func (s InternalServerErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerErrorException) OrigErr() error { + return nil +} + +func (s InternalServerErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerErrorException) RequestID() string { + return s.respMetadata.RequestID +} + // Each job converts an input file into an output file or files. For more information, // see the User Guide at http://docs.aws.amazon.com/mediaconvert/latest/ug/what-is.html type Job struct { @@ -10617,6 +11335,19 @@ type Job struct { // complex content. AccelerationSettings *AccelerationSettings `locationName:"accelerationSettings" type:"structure"` + // Describes whether the current job is running with accelerated transcoding. + // For jobs that have Acceleration (AccelerationMode) set to DISABLED, AccelerationStatus + // is always NOT_APPLICABLE. For jobs that have Acceleration (AccelerationMode) + // set to ENABLED or PREFERRED, AccelerationStatus is one of the other states. + // AccelerationStatus is IN_PROGRESS initially, while the service determines + // whether the input files and job settings are compatible with accelerated + // transcoding. If they are, AcclerationStatus is ACCELERATED. If your input + // files and job settings aren't compatible with accelerated transcoding, the + // service either fails your job or runs it without accelerated transcoding, + // depending on how you set Acceleration (AccelerationMode). When the service + // runs your job without accelerated transcoding, AccelerationStatus is NOT_ACCELERATED. + AccelerationStatus *string `locationName:"accelerationStatus" type:"string" enum:"AccelerationStatus"` + // An identifier for this resource that is unique within all of AWS. Arn *string `locationName:"arn" type:"string"` @@ -10657,6 +11388,10 @@ type Job struct { // template. JobTemplate *string `locationName:"jobTemplate" type:"string"` + // Provides messages from the service about jobs that you have already successfully + // submitted. + Messages *JobMessages `locationName:"messages" type:"structure"` + // List of output group details OutputGroupDetails []*OutputGroupDetail `locationName:"outputGroupDetails" type:"list"` @@ -10723,6 +11458,12 @@ func (s *Job) SetAccelerationSettings(v *AccelerationSettings) *Job { return s } +// SetAccelerationStatus sets the AccelerationStatus field's value. +func (s *Job) SetAccelerationStatus(v string) *Job { + s.AccelerationStatus = &v + return s +} + // SetArn sets the Arn field's value. func (s *Job) SetArn(v string) *Job { s.Arn = &v @@ -10777,6 +11518,12 @@ func (s *Job) SetJobTemplate(v string) *Job { return s } +// SetMessages sets the Messages field's value. +func (s *Job) SetMessages(v *JobMessages) *Job { + s.Messages = v + return s +} + // SetOutputGroupDetails sets the OutputGroupDetails field's value. func (s *Job) SetOutputGroupDetails(v []*OutputGroupDetail) *Job { s.OutputGroupDetails = v @@ -10843,6 +11590,42 @@ func (s *Job) SetUserMetadata(v map[string]*string) *Job { return s } +// Provides messages from the service about jobs that you have already successfully +// submitted. +type JobMessages struct { + _ struct{} `type:"structure"` + + // List of messages that are informational only and don't indicate a problem + // with your job. + Info []*string `locationName:"info" type:"list"` + + // List of messages that warn about conditions that might cause your job not + // to run or to fail. + Warning []*string `locationName:"warning" type:"list"` +} + +// String returns the string representation +func (s JobMessages) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s JobMessages) GoString() string { + return s.String() +} + +// SetInfo sets the Info field's value. +func (s *JobMessages) SetInfo(v []*string) *JobMessages { + s.Info = v + return s +} + +// SetWarning sets the Warning field's value. +func (s *JobMessages) SetWarning(v []*string) *JobMessages { + s.Warning = v + return s +} + // JobSettings contains all the transcode settings for a job. type JobSettings struct { _ struct{} `type:"structure"` @@ -12811,44 +13594,117 @@ func (s *MovSettings) SetReference(v string) *MovSettings { return s } -// Required when you set (Codec) under (AudioDescriptions)>(CodecSettings) to -// the value MP2. -type Mp2Settings struct { +// Required when you set (Codec) under (AudioDescriptions)>(CodecSettings) to +// the value MP2. +type Mp2Settings struct { + _ struct{} `type:"structure"` + + // Specify the average bitrate in bits per second. + Bitrate *int64 `locationName:"bitrate" min:"32000" type:"integer"` + + // Set Channels to specify the number of channels in this output audio track. + // Choosing Mono in the console will give you 1 output channel; choosing Stereo + // will give you 2. In the API, valid values are 1 and 2. + Channels *int64 `locationName:"channels" min:"1" type:"integer"` + + // Sample rate in hz. + SampleRate *int64 `locationName:"sampleRate" min:"32000" type:"integer"` +} + +// String returns the string representation +func (s Mp2Settings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Mp2Settings) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Mp2Settings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Mp2Settings"} + if s.Bitrate != nil && *s.Bitrate < 32000 { + invalidParams.Add(request.NewErrParamMinValue("Bitrate", 32000)) + } + if s.Channels != nil && *s.Channels < 1 { + invalidParams.Add(request.NewErrParamMinValue("Channels", 1)) + } + if s.SampleRate != nil && *s.SampleRate < 32000 { + invalidParams.Add(request.NewErrParamMinValue("SampleRate", 32000)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBitrate sets the Bitrate field's value. +func (s *Mp2Settings) SetBitrate(v int64) *Mp2Settings { + s.Bitrate = &v + return s +} + +// SetChannels sets the Channels field's value. +func (s *Mp2Settings) SetChannels(v int64) *Mp2Settings { + s.Channels = &v + return s +} + +// SetSampleRate sets the SampleRate field's value. +func (s *Mp2Settings) SetSampleRate(v int64) *Mp2Settings { + s.SampleRate = &v + return s +} + +// Required when you set Codec, under AudioDescriptions>CodecSettings, to the +// value MP3. +type Mp3Settings struct { _ struct{} `type:"structure"` // Specify the average bitrate in bits per second. - Bitrate *int64 `locationName:"bitrate" min:"32000" type:"integer"` + Bitrate *int64 `locationName:"bitrate" min:"16000" type:"integer"` - // Set Channels to specify the number of channels in this output audio track. - // Choosing Mono in the console will give you 1 output channel; choosing Stereo - // will give you 2. In the API, valid values are 1 and 2. + // Specify the number of channels in this output audio track. Choosing Mono + // on the console gives you 1 output channel; choosing Stereo gives you 2. In + // the API, valid values are 1 and 2. Channels *int64 `locationName:"channels" min:"1" type:"integer"` + // Specify whether the service encodes this MP3 audio output with a constant + // bitrate (CBR) or a variable bitrate (VBR). + RateControlMode *string `locationName:"rateControlMode" type:"string" enum:"Mp3RateControlMode"` + // Sample rate in hz. - SampleRate *int64 `locationName:"sampleRate" min:"32000" type:"integer"` + SampleRate *int64 `locationName:"sampleRate" min:"22050" type:"integer"` + + // Required when you set Bitrate control mode (rateControlMode) to VBR. Specify + // the audio quality of this MP3 output from 0 (highest quality) to 9 (lowest + // quality). + VbrQuality *int64 `locationName:"vbrQuality" type:"integer"` } // String returns the string representation -func (s Mp2Settings) String() string { +func (s Mp3Settings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Mp2Settings) GoString() string { +func (s Mp3Settings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *Mp2Settings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Mp2Settings"} - if s.Bitrate != nil && *s.Bitrate < 32000 { - invalidParams.Add(request.NewErrParamMinValue("Bitrate", 32000)) +func (s *Mp3Settings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Mp3Settings"} + if s.Bitrate != nil && *s.Bitrate < 16000 { + invalidParams.Add(request.NewErrParamMinValue("Bitrate", 16000)) } if s.Channels != nil && *s.Channels < 1 { invalidParams.Add(request.NewErrParamMinValue("Channels", 1)) } - if s.SampleRate != nil && *s.SampleRate < 32000 { - invalidParams.Add(request.NewErrParamMinValue("SampleRate", 32000)) + if s.SampleRate != nil && *s.SampleRate < 22050 { + invalidParams.Add(request.NewErrParamMinValue("SampleRate", 22050)) } if invalidParams.Len() > 0 { @@ -12858,23 +13714,35 @@ func (s *Mp2Settings) Validate() error { } // SetBitrate sets the Bitrate field's value. -func (s *Mp2Settings) SetBitrate(v int64) *Mp2Settings { +func (s *Mp3Settings) SetBitrate(v int64) *Mp3Settings { s.Bitrate = &v return s } // SetChannels sets the Channels field's value. -func (s *Mp2Settings) SetChannels(v int64) *Mp2Settings { +func (s *Mp3Settings) SetChannels(v int64) *Mp3Settings { s.Channels = &v return s } +// SetRateControlMode sets the RateControlMode field's value. +func (s *Mp3Settings) SetRateControlMode(v string) *Mp3Settings { + s.RateControlMode = &v + return s +} + // SetSampleRate sets the SampleRate field's value. -func (s *Mp2Settings) SetSampleRate(v int64) *Mp2Settings { +func (s *Mp3Settings) SetSampleRate(v int64) *Mp3Settings { s.SampleRate = &v return s } +// SetVbrQuality sets the VbrQuality field's value. +func (s *Mp3Settings) SetVbrQuality(v int64) *Mp3Settings { + s.VbrQuality = &v + return s +} + // Settings for MP4 container. You can create audio-only AAC outputs with this // container. type Mp4Settings struct { @@ -12886,6 +13754,14 @@ type Mp4Settings struct { // 14496-1 amendment 1. This improves compatibility with Apple players and tools. CslgAtom *string `locationName:"cslgAtom" type:"string" enum:"Mp4CslgAtom"` + // Ignore this setting unless compliance to the CTTS box version specification + // matters in your workflow. Specify a value of 1 to set your CTTS box version + // to 1 and make your output compliant with the specification. When you specify + // a value of 1, you must also set CSLG atom (cslgAtom) to the value INCLUDE. + // Keep the default value 0 to set your CTTS box version to 0. This can provide + // backward compatibility for some players and packagers. + CttsVersion *int64 `locationName:"cttsVersion" type:"integer"` + // Inserts a free-space box immediately after the moov box. FreeSpaceBox *string `locationName:"freeSpaceBox" type:"string" enum:"Mp4FreeSpaceBox"` @@ -12915,6 +13791,12 @@ func (s *Mp4Settings) SetCslgAtom(v string) *Mp4Settings { return s } +// SetCttsVersion sets the CttsVersion field's value. +func (s *Mp4Settings) SetCttsVersion(v int64) *Mp4Settings { + s.CttsVersion = &v + return s +} + // SetFreeSpaceBox sets the FreeSpaceBox field's value. func (s *Mp4Settings) SetFreeSpaceBox(v string) *Mp4Settings { s.FreeSpaceBox = &v @@ -12933,6 +13815,59 @@ func (s *Mp4Settings) SetMp4MajorBrand(v string) *Mp4Settings { return s } +// Settings for MP4 segments in DASH +type MpdSettings struct { + _ struct{} `type:"structure"` + + // Use this setting only in DASH output groups that include sidecar TTML or + // IMSC captions. You specify sidecar captions in a separate output from your + // audio and video. Choose Raw (RAW) for captions in a single XML file in a + // raw container. Choose Fragmented MPEG-4 (FRAGMENTED_MP4) for captions in + // XML format contained within fragmented MP4 files. This set of fragmented + // MP4 files is separate from your video and audio fragmented MP4 files. + CaptionContainerType *string `locationName:"captionContainerType" type:"string" enum:"MpdCaptionContainerType"` + + // Use this setting only when you specify SCTE-35 markers from ESAM. Choose + // INSERT to put SCTE-35 markers in this output at the insertion points that + // you specify in an ESAM XML document. Provide the document in the setting + // SCC XML (sccXml). + Scte35Esam *string `locationName:"scte35Esam" type:"string" enum:"MpdScte35Esam"` + + // Ignore this setting unless you have SCTE-35 markers in your input video file. + // Choose Passthrough (PASSTHROUGH) if you want SCTE-35 markers that appear + // in your input to also appear in this output. Choose None (NONE) if you don't + // want those SCTE-35 markers in this output. + Scte35Source *string `locationName:"scte35Source" type:"string" enum:"MpdScte35Source"` +} + +// String returns the string representation +func (s MpdSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MpdSettings) GoString() string { + return s.String() +} + +// SetCaptionContainerType sets the CaptionContainerType field's value. +func (s *MpdSettings) SetCaptionContainerType(v string) *MpdSettings { + s.CaptionContainerType = &v + return s +} + +// SetScte35Esam sets the Scte35Esam field's value. +func (s *MpdSettings) SetScte35Esam(v string) *MpdSettings { + s.Scte35Esam = &v + return s +} + +// SetScte35Source sets the Scte35Source field's value. +func (s *MpdSettings) SetScte35Source(v string) *MpdSettings { + s.Scte35Source = &v + return s +} + // Required when you set (Codec) under (VideoDescription)>(CodecSettings) to // the value MPEG2. type Mpeg2Settings struct { @@ -13311,6 +14246,58 @@ func (s *Mpeg2Settings) SetTemporalAdaptiveQuantization(v string) *Mpeg2Settings return s } +// Specify the details for each additional Microsoft Smooth Streaming manifest +// that you want the service to generate for this output group. Each manifest +// can reference a different subset of outputs in the group. +type MsSmoothAdditionalManifest struct { + _ struct{} `type:"structure"` + + // Specify a name modifier that the service adds to the name of this manifest + // to make it different from the file names of the other main manifests in the + // output group. For example, say that the default main manifest for your Microsoft + // Smooth group is film-name.ismv. If you enter "-no-premium" for this setting, + // then the file name the service generates for this top-level manifest is film-name-no-premium.ismv. + ManifestNameModifier *string `locationName:"manifestNameModifier" min:"1" type:"string"` + + // Specify the outputs that you want this additional top-level manifest to reference. + SelectedOutputs []*string `locationName:"selectedOutputs" type:"list"` +} + +// String returns the string representation +func (s MsSmoothAdditionalManifest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MsSmoothAdditionalManifest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *MsSmoothAdditionalManifest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MsSmoothAdditionalManifest"} + if s.ManifestNameModifier != nil && len(*s.ManifestNameModifier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ManifestNameModifier", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetManifestNameModifier sets the ManifestNameModifier field's value. +func (s *MsSmoothAdditionalManifest) SetManifestNameModifier(v string) *MsSmoothAdditionalManifest { + s.ManifestNameModifier = &v + return s +} + +// SetSelectedOutputs sets the SelectedOutputs field's value. +func (s *MsSmoothAdditionalManifest) SetSelectedOutputs(v []*string) *MsSmoothAdditionalManifest { + s.SelectedOutputs = v + return s +} + // If you are using DRM, set DRM System (MsSmoothEncryptionSettings) to specify // the value SpekeKeyProvider. type MsSmoothEncryptionSettings struct { @@ -13343,6 +14330,13 @@ func (s *MsSmoothEncryptionSettings) SetSpekeKeyProvider(v *SpekeKeyProvider) *M type MsSmoothGroupSettings struct { _ struct{} `type:"structure"` + // By default, the service creates one .ism Microsoft Smooth Streaming manifest + // for each Microsoft Smooth Streaming output group in your job. This default + // manifest references every output in the output group. To create additional + // manifests that reference a subset of the outputs in the output group, specify + // a list of them here. + AdditionalManifests []*MsSmoothAdditionalManifest `locationName:"additionalManifests" type:"list"` + // COMBINE_DUPLICATE_STREAMS combines identical audio encoding settings across // a Microsoft Smooth output group into a single audio stream. AudioDeduplication *string `locationName:"audioDeduplication" type:"string" enum:"MsSmoothAudioDeduplication"` @@ -13387,6 +14381,16 @@ func (s *MsSmoothGroupSettings) Validate() error { if s.FragmentLength != nil && *s.FragmentLength < 1 { invalidParams.Add(request.NewErrParamMinValue("FragmentLength", 1)) } + if s.AdditionalManifests != nil { + for i, v := range s.AdditionalManifests { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AdditionalManifests", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -13394,6 +14398,12 @@ func (s *MsSmoothGroupSettings) Validate() error { return nil } +// SetAdditionalManifests sets the AdditionalManifests field's value. +func (s *MsSmoothGroupSettings) SetAdditionalManifests(v []*MsSmoothAdditionalManifest) *MsSmoothGroupSettings { + s.AdditionalManifests = v + return s +} + // SetAudioDeduplication sets the AudioDeduplication field's value. func (s *MsSmoothGroupSettings) SetAudioDeduplication(v string) *MsSmoothGroupSettings { s.AudioDeduplication = &v @@ -13698,6 +14708,61 @@ func (s *NoiseReducerTemporalFilterSettings) SetStrength(v int64) *NoiseReducerT return s } +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // An output object describes the settings for a single output file or stream // in an output group. type Output struct { @@ -14952,10 +16017,41 @@ func (s *ResourceTags) SetTags(v map[string]*string) *ResourceTags { return s } +// Optional. Have MediaConvert automatically apply Amazon S3 access control +// for the outputs in this output group. When you don't use this setting, S3 +// automatically applies the default access control list PRIVATE. +type S3DestinationAccessControl struct { + _ struct{} `type:"structure"` + + // Choose an Amazon S3 canned ACL for MediaConvert to apply to this output. + CannedAcl *string `locationName:"cannedAcl" type:"string" enum:"S3ObjectCannedAcl"` +} + +// String returns the string representation +func (s S3DestinationAccessControl) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s S3DestinationAccessControl) GoString() string { + return s.String() +} + +// SetCannedAcl sets the CannedAcl field's value. +func (s *S3DestinationAccessControl) SetCannedAcl(v string) *S3DestinationAccessControl { + s.CannedAcl = &v + return s +} + // Settings associated with S3 destination type S3DestinationSettings struct { _ struct{} `type:"structure"` + // Optional. Have MediaConvert automatically apply Amazon S3 access control + // for the outputs in this output group. When you don't use this setting, S3 + // automatically applies the default access control list PRIVATE. + AccessControl *S3DestinationAccessControl `locationName:"accessControl" type:"structure"` + // Settings for how your job outputs are encrypted as they are uploaded to Amazon // S3. Encryption *S3EncryptionSettings `locationName:"encryption" type:"structure"` @@ -14971,6 +16067,12 @@ func (s S3DestinationSettings) GoString() string { return s.String() } +// SetAccessControl sets the AccessControl field's value. +func (s *S3DestinationSettings) SetAccessControl(v *S3DestinationAccessControl) *S3DestinationSettings { + s.AccessControl = v + return s +} + // SetEncryption sets the Encryption field's value. func (s *S3DestinationSettings) SetEncryption(v *S3EncryptionSettings) *S3DestinationSettings { s.Encryption = v @@ -15616,6 +16718,61 @@ func (s *Timing) SetSubmitTime(v time.Time) *Timing { return s } +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + // Settings specific to caption sources that are specified by track number. // Currently, this is only IMSC captions in an IMF package. If your caption // source is IMSC 1.1 in a separate xml file, use FileSourceSettings instead @@ -16127,9 +17284,9 @@ func (s *UpdateQueueOutput) SetQueue(v *Queue) *UpdateQueueOutput { // the group of settings related to video encoding. The settings in this group // vary depending on the value that you choose for Video codec (Codec). For // each codec enum that you choose, define the corresponding settings object. -// The following lists the codec enum, settings object pairs. * H_264, H264Settings -// * H_265, H265Settings * MPEG2, Mpeg2Settings * PRORES, ProresSettings * FRAME_CAPTURE, -// FrameCaptureSettings +// The following lists the codec enum, settings object pairs. * FRAME_CAPTURE, +// FrameCaptureSettings * H_264, H264Settings * H_265, H265Settings * MPEG2, +// Mpeg2Settings * PRORES, ProresSettings type VideoCodecSettings struct { _ struct{} `type:"structure"` @@ -16259,9 +17416,9 @@ type VideoDescription struct { // the group of settings related to video encoding. The settings in this group // vary depending on the value that you choose for Video codec (Codec). For // each codec enum that you choose, define the corresponding settings object. - // The following lists the codec enum, settings object pairs. * H_264, H264Settings - // * H_265, H265Settings * MPEG2, Mpeg2Settings * PRORES, ProresSettings * FRAME_CAPTURE, - // FrameCaptureSettings + // The following lists the codec enum, settings object pairs. * FRAME_CAPTURE, + // FrameCaptureSettings * H_264, H264Settings * H_265, H265Settings * MPEG2, + // Mpeg2Settings * PRORES, ProresSettings CodecSettings *VideoCodecSettings `locationName:"codecSettings" type:"structure"` // Choose Insert (INSERT) for this setting to include color metadata in this @@ -16527,6 +17684,9 @@ type VideoPreprocessor struct { // picture. Deinterlacer *Deinterlacer `locationName:"deinterlacer" type:"structure"` + // Enable Dolby Vision feature to produce Dolby Vision compatible video output. + DolbyVision *DolbyVision `locationName:"dolbyVision" type:"structure"` + // Enable the Image inserter (ImageInserter) feature to include a graphic overlay // on your video. Enable or disable this feature for each output individually. // This setting is disabled by default. @@ -16594,6 +17754,12 @@ func (s *VideoPreprocessor) SetDeinterlacer(v *Deinterlacer) *VideoPreprocessor return s } +// SetDolbyVision sets the DolbyVision field's value. +func (s *VideoPreprocessor) SetDolbyVision(v *DolbyVision) *VideoPreprocessor { + s.DolbyVision = v + return s +} + // SetImageInserter sets the ImageInserter field's value. func (s *VideoPreprocessor) SetImageInserter(v *ImageInserter) *VideoPreprocessor { s.ImageInserter = v @@ -16616,6 +17782,14 @@ func (s *VideoPreprocessor) SetTimecodeBurnin(v *TimecodeBurnin) *VideoPreproces type VideoSelector struct { _ struct{} `type:"structure"` + // Ignore this setting unless this input is a QuickTime animation with an alpha + // channel. Use this setting to create separate Key and Fill outputs. In each + // output, specify which part of the input MediaConvert uses. Leave this setting + // at the default value DISCARD to delete the alpha channel and preserve the + // video. Set it to REMAP_TO_LUMA to delete the video and map the alpha channel + // to the luma channel of your outputs. + AlphaBehavior *string `locationName:"alphaBehavior" type:"string" enum:"AlphaBehavior"` + // If your input video has accurate color space metadata, or if you don't know // about color space, leave this set to the default value Follow (FOLLOW). The // service will automatically detect your input color space. If your input video @@ -16699,6 +17873,12 @@ func (s *VideoSelector) Validate() error { return nil } +// SetAlphaBehavior sets the AlphaBehavior field's value. +func (s *VideoSelector) SetAlphaBehavior(v string) *VideoSelector { + s.AlphaBehavior = &v + return s +} + // SetColorSpace sets the ColorSpace field's value. func (s *VideoSelector) SetColorSpace(v string) *VideoSelector { s.ColorSpace = &v @@ -16980,14 +18160,47 @@ const ( Ac3MetadataControlUseConfigured = "USE_CONFIGURED" ) -// Enable Acceleration (AccelerationMode) on any job that you want processed -// with accelerated transcoding. +// Specify whether the service runs your job with accelerated transcoding. Choose +// DISABLED if you don't want accelerated transcoding. Choose ENABLED if you +// want your job to run with accelerated transcoding and to fail if your input +// files or your job settings aren't compatible with accelerated transcoding. +// Choose PREFERRED if you want your job to run with accelerated transcoding +// if the job is compatible with the feature and to run at standard speed if +// it's not. const ( // AccelerationModeDisabled is a AccelerationMode enum value AccelerationModeDisabled = "DISABLED" // AccelerationModeEnabled is a AccelerationMode enum value AccelerationModeEnabled = "ENABLED" + + // AccelerationModePreferred is a AccelerationMode enum value + AccelerationModePreferred = "PREFERRED" +) + +// Describes whether the current job is running with accelerated transcoding. +// For jobs that have Acceleration (AccelerationMode) set to DISABLED, AccelerationStatus +// is always NOT_APPLICABLE. For jobs that have Acceleration (AccelerationMode) +// set to ENABLED or PREFERRED, AccelerationStatus is one of the other states. +// AccelerationStatus is IN_PROGRESS initially, while the service determines +// whether the input files and job settings are compatible with accelerated +// transcoding. If they are, AcclerationStatus is ACCELERATED. If your input +// files and job settings aren't compatible with accelerated transcoding, the +// service either fails your job or runs it without accelerated transcoding, +// depending on how you set Acceleration (AccelerationMode). When the service +// runs your job without accelerated transcoding, AccelerationStatus is NOT_ACCELERATED. +const ( + // AccelerationStatusNotApplicable is a AccelerationStatus enum value + AccelerationStatusNotApplicable = "NOT_APPLICABLE" + + // AccelerationStatusInProgress is a AccelerationStatus enum value + AccelerationStatusInProgress = "IN_PROGRESS" + + // AccelerationStatusAccelerated is a AccelerationStatus enum value + AccelerationStatusAccelerated = "ACCELERATED" + + // AccelerationStatusNotAccelerated is a AccelerationStatus enum value + AccelerationStatusNotAccelerated = "NOT_ACCELERATED" ) // This setting only applies to H.264, H.265, and MPEG2 outputs. Use Insert @@ -17007,6 +18220,20 @@ const ( AfdSignalingFixed = "FIXED" ) +// Ignore this setting unless this input is a QuickTime animation with an alpha +// channel. Use this setting to create separate Key and Fill outputs. In each +// output, specify which part of the input MediaConvert uses. Leave this setting +// at the default value DISCARD to delete the alpha channel and preserve the +// video. Set it to REMAP_TO_LUMA to delete the video and map the alpha channel +// to the luma channel of your outputs. +const ( + // AlphaBehaviorDiscard is a AlphaBehavior enum value + AlphaBehaviorDiscard = "DISCARD" + + // AlphaBehaviorRemapToLuma is a AlphaBehavior enum value + AlphaBehaviorRemapToLuma = "REMAP_TO_LUMA" +) + // Specify whether this set of input captions appears in your outputs in both // 608 and 708 format. If you choose Upconvert (UPCONVERT), MediaConvert includes // the captions data in two ways: it passes the 608 data through using the 608 @@ -17050,6 +18277,9 @@ const ( // AudioCodecMp2 is a AudioCodec enum value AudioCodecMp2 = "MP2" + // AudioCodecMp3 is a AudioCodec enum value + AudioCodecMp3 = "MP3" + // AudioCodecWav is a AudioCodec enum value AudioCodecWav = "WAV" @@ -17080,10 +18310,12 @@ const ( AudioDefaultSelectionNotDefault = "NOT_DEFAULT" ) -// Choosing FOLLOW_INPUT will cause the ISO 639 language code of the output -// to follow the ISO 639 language code of the input. The language specified -// for languageCode' will be used when USE_CONFIGURED is selected or when FOLLOW_INPUT -// is selected but there is no ISO 639 language code specified by the input. +// Specify which source for language code takes precedence for this audio track. +// When you choose Follow input (FOLLOW_INPUT), the service uses the language +// code from the input track if it's present. If there's no languge code on +// the input track, the service uses the code that you specify in the setting +// Language code (languageCode or customLanguageCode). When you choose Use configured +// (USE_CONFIGURED), the service uses the language code that you specify. const ( // AudioLanguageCodeControlFollowInput is a AudioLanguageCodeControl enum value AudioLanguageCodeControlFollowInput = "FOLLOW_INPUT" @@ -17184,6 +18416,9 @@ const ( // BillingTagsSourceJobTemplate is a BillingTagsSource enum value BillingTagsSourceJobTemplate = "JOB_TEMPLATE" + + // BillingTagsSourceJob is a BillingTagsSource enum value + BillingTagsSourceJob = "JOB" ) // If no explicit x_position or y_position is provided, setting alignment to @@ -17442,6 +18677,20 @@ const ( CmafManifestDurationFormatInteger = "INTEGER" ) +// Specify whether your DASH profile is on-demand or main. When you choose Main +// profile (MAIN_PROFILE), the service signals urn:mpeg:dash:profile:isoff-main:2011 +// in your .mpd DASH manifest. When you choose On-demand (ON_DEMAND_PROFILE), +// the service signals urn:mpeg:dash:profile:isoff-on-demand:2011 in your .mpd. +// When you choose On-demand, you must also set the output group setting Segment +// control (SegmentControl) to Single file (SINGLE_FILE). +const ( + // CmafMpdProfileMainProfile is a CmafMpdProfile enum value + CmafMpdProfileMainProfile = "MAIN_PROFILE" + + // CmafMpdProfileOnDemandProfile is a CmafMpdProfile enum value + CmafMpdProfileOnDemandProfile = "ON_DEMAND_PROFILE" +) + // When set to SINGLE_FILE, a single output file is generated, which is internally // segmented using the Fragment Length and Segment Length. When set to SEGMENTED_FILES, // separate segment files will be created. @@ -17481,6 +18730,44 @@ const ( CmafWriteHLSManifestEnabled = "ENABLED" ) +// When you enable Precise segment duration in DASH manifests (writeSegmentTimelineInRepresentation), +// your DASH manifest shows precise segment durations. The segment duration +// information appears inside the SegmentTimeline element, inside SegmentTemplate +// at the Representation level. When this feature isn't enabled, the segment +// durations in your DASH manifest are approximate. The segment duration information +// appears in the duration attribute of the SegmentTemplate element. +const ( + // CmafWriteSegmentTimelineInRepresentationEnabled is a CmafWriteSegmentTimelineInRepresentation enum value + CmafWriteSegmentTimelineInRepresentationEnabled = "ENABLED" + + // CmafWriteSegmentTimelineInRepresentationDisabled is a CmafWriteSegmentTimelineInRepresentation enum value + CmafWriteSegmentTimelineInRepresentationDisabled = "DISABLED" +) + +// Use this setting only when you specify SCTE-35 markers from ESAM. Choose +// INSERT to put SCTE-35 markers in this output at the insertion points that +// you specify in an ESAM XML document. Provide the document in the setting +// SCC XML (sccXml). +const ( + // CmfcScte35EsamInsert is a CmfcScte35Esam enum value + CmfcScte35EsamInsert = "INSERT" + + // CmfcScte35EsamNone is a CmfcScte35Esam enum value + CmfcScte35EsamNone = "NONE" +) + +// Ignore this setting unless you have SCTE-35 markers in your input video file. +// Choose Passthrough (PASSTHROUGH) if you want SCTE-35 markers that appear +// in your input to also appear in this output. Choose None (NONE) if you don't +// want those SCTE-35 markers in this output. +const ( + // CmfcScte35SourcePassthrough is a CmfcScte35Source enum value + CmfcScte35SourcePassthrough = "PASSTHROUGH" + + // CmfcScte35SourceNone is a CmfcScte35Source enum value + CmfcScte35SourceNone = "NONE" +) + // Choose Insert (INSERT) for this setting to include color metadata in this // output. Choose Ignore (IGNORE) to exclude color metadata from this output. // If you don't specify a value, the service sets this to Insert by default. @@ -17605,6 +18892,20 @@ const ( DashIsoHbbtvComplianceNone = "NONE" ) +// Specify whether your DASH profile is on-demand or main. When you choose Main +// profile (MAIN_PROFILE), the service signals urn:mpeg:dash:profile:isoff-main:2011 +// in your .mpd DASH manifest. When you choose On-demand (ON_DEMAND_PROFILE), +// the service signals urn:mpeg:dash:profile:isoff-on-demand:2011 in your .mpd. +// When you choose On-demand, you must also set the output group setting Segment +// control (SegmentControl) to Single file (SINGLE_FILE). +const ( + // DashIsoMpdProfileMainProfile is a DashIsoMpdProfile enum value + DashIsoMpdProfileMainProfile = "MAIN_PROFILE" + + // DashIsoMpdProfileOnDemandProfile is a DashIsoMpdProfile enum value + DashIsoMpdProfileOnDemandProfile = "ON_DEMAND_PROFILE" +) + // This setting can improve the compatibility of your output with video players // on obsolete devices. It applies only to DASH H.264 outputs with DRM encryption. // Choose Unencrypted SEI (UNENCRYPTED_SEI) only to correct problems with playback @@ -17718,6 +19019,27 @@ const ( DescribeEndpointsModeGetOnly = "GET_ONLY" ) +// Use Dolby Vision Mode to choose how the service will handle Dolby Vision +// MaxCLL and MaxFALL properies. +const ( + // DolbyVisionLevel6ModePassthrough is a DolbyVisionLevel6Mode enum value + DolbyVisionLevel6ModePassthrough = "PASSTHROUGH" + + // DolbyVisionLevel6ModeRecalculate is a DolbyVisionLevel6Mode enum value + DolbyVisionLevel6ModeRecalculate = "RECALCULATE" + + // DolbyVisionLevel6ModeSpecify is a DolbyVisionLevel6Mode enum value + DolbyVisionLevel6ModeSpecify = "SPECIFY" +) + +// In the current MediaConvert implementation, the Dolby Vision profile is always +// 5 (PROFILE_5). Therefore, all of your inputs must contain Dolby Vision frame +// interleaved data. +const ( + // DolbyVisionProfileProfile5 is a DolbyVisionProfile enum value + DolbyVisionProfileProfile5 = "PROFILE_5" +) + // Applies only to 29.97 fps outputs. When this feature is enabled, the service // will use drop-frame timecode on outputs. If it is not possible to use drop-frame // timecode, the system will fall back to non-drop-frame. This setting is enabled @@ -17833,6 +19155,17 @@ const ( DvbSubtitleTeletextSpacingProportional = "PROPORTIONAL" ) +// Specify whether your DVB subtitles are standard or for hearing impaired. +// Choose hearing impaired if your subtitles include audio descriptions and +// dialogue. Choose standard if your subtitles include only dialogue. +const ( + // DvbSubtitlingTypeHearingImpaired is a DvbSubtitlingType enum value + DvbSubtitlingTypeHearingImpaired = "HEARING_IMPAIRED" + + // DvbSubtitlingTypeStandard is a DvbSubtitlingType enum value + DvbSubtitlingTypeStandard = "STANDARD" +) + // Specify the bitstream mode for the E-AC-3 stream that the encoder emits. // For more information about the EAC3 bitstream mode, see ATSC A/52-2012 (Annex // E). @@ -18896,17 +20229,17 @@ const ( H265UnregisteredSeiTimecodeEnabled = "ENABLED" ) -// Use this setting only for outputs encoded with H.265 that are in CMAF or -// DASH output groups. If you include writeMp4PackagingType in your JSON job -// specification for other outputs, your video might not work properly with -// downstream systems and video players. If the location of parameter set NAL -// units don't matter in your workflow, ignore this setting. The service defaults -// to marking your output as HEV1. Choose HVC1 to mark your output as HVC1. -// This makes your output compliant with this specification: ISO IECJTC1 SC29 -// N13798 Text ISO/IEC FDIS 14496-15 3rd Edition. For these outputs, the service -// stores parameter set NAL units in the sample headers but not in the samples -// directly. Keep the default HEV1 to mark your output as HEV1. For these outputs, -// the service writes parameter set NAL units directly into the samples. +// If the location of parameter set NAL units doesn't matter in your workflow, +// ignore this setting. Use this setting only with CMAF or DASH outputs, or +// with standalone file outputs in an MPEG-4 container (MP4 outputs). Choose +// HVC1 to mark your output as HVC1. This makes your output compliant with the +// following specification: ISO IECJTC1 SC29 N13798 Text ISO/IEC FDIS 14496-15 +// 3rd Edition. For these outputs, the service stores parameter set NAL units +// in the sample headers but not in the samples directly. For MP4 outputs, when +// you choose HVC1, your output video might not work properly with some downstream +// systems and video players. The service defaults to marking your output as +// HEV1. For these outputs, the service writes parameter set NAL units directly +// into the samples. const ( // H265WriteMp4PackagingTypeHvc1 is a H265WriteMp4PackagingType enum value H265WriteMp4PackagingTypeHvc1 = "HVC1" @@ -20131,6 +21464,16 @@ const ( MovReferenceExternal = "EXTERNAL" ) +// Specify whether the service encodes this MP3 audio output with a constant +// bitrate (CBR) or a variable bitrate (VBR). +const ( + // Mp3RateControlModeCbr is a Mp3RateControlMode enum value + Mp3RateControlModeCbr = "CBR" + + // Mp3RateControlModeVbr is a Mp3RateControlMode enum value + Mp3RateControlModeVbr = "VBR" +) + // When enabled, file composition times will start at zero, composition times // in the 'ctts' (composition time to sample) box for B-frames will be negative, // and a 'cslg' (composition shift least greatest) box will be included per @@ -20163,6 +21506,44 @@ const ( Mp4MoovPlacementNormal = "NORMAL" ) +// Use this setting only in DASH output groups that include sidecar TTML or +// IMSC captions. You specify sidecar captions in a separate output from your +// audio and video. Choose Raw (RAW) for captions in a single XML file in a +// raw container. Choose Fragmented MPEG-4 (FRAGMENTED_MP4) for captions in +// XML format contained within fragmented MP4 files. This set of fragmented +// MP4 files is separate from your video and audio fragmented MP4 files. +const ( + // MpdCaptionContainerTypeRaw is a MpdCaptionContainerType enum value + MpdCaptionContainerTypeRaw = "RAW" + + // MpdCaptionContainerTypeFragmentedMp4 is a MpdCaptionContainerType enum value + MpdCaptionContainerTypeFragmentedMp4 = "FRAGMENTED_MP4" +) + +// Use this setting only when you specify SCTE-35 markers from ESAM. Choose +// INSERT to put SCTE-35 markers in this output at the insertion points that +// you specify in an ESAM XML document. Provide the document in the setting +// SCC XML (sccXml). +const ( + // MpdScte35EsamInsert is a MpdScte35Esam enum value + MpdScte35EsamInsert = "INSERT" + + // MpdScte35EsamNone is a MpdScte35Esam enum value + MpdScte35EsamNone = "NONE" +) + +// Ignore this setting unless you have SCTE-35 markers in your input video file. +// Choose Passthrough (PASSTHROUGH) if you want SCTE-35 markers that appear +// in your input to also appear in this output. Choose None (NONE) if you don't +// want those SCTE-35 markers in this output. +const ( + // MpdScte35SourcePassthrough is a MpdScte35Source enum value + MpdScte35SourcePassthrough = "PASSTHROUGH" + + // MpdScte35SourceNone is a MpdScte35Source enum value + MpdScte35SourceNone = "NONE" +) + // Adaptive quantization. Allows intra-frame quantizers to vary to improve visual // quality. const ( @@ -20697,6 +22078,21 @@ const ( RespondToAfdPassthrough = "PASSTHROUGH" ) +// Choose an Amazon S3 canned ACL for MediaConvert to apply to this output. +const ( + // S3ObjectCannedAclPublicRead is a S3ObjectCannedAcl enum value + S3ObjectCannedAclPublicRead = "PUBLIC_READ" + + // S3ObjectCannedAclAuthenticatedRead is a S3ObjectCannedAcl enum value + S3ObjectCannedAclAuthenticatedRead = "AUTHENTICATED_READ" + + // S3ObjectCannedAclBucketOwnerRead is a S3ObjectCannedAcl enum value + S3ObjectCannedAclBucketOwnerRead = "BUCKET_OWNER_READ" + + // S3ObjectCannedAclBucketOwnerFullControl is a S3ObjectCannedAcl enum value + S3ObjectCannedAclBucketOwnerFullControl = "BUCKET_OWNER_FULL_CONTROL" +) + // Specify how you want your data keys managed. AWS uses data keys to encrypt // your content. AWS also encrypts the data keys themselves, using a customer // master key (CMK), and then stores the encrypted data keys alongside your @@ -20743,6 +22139,9 @@ const ( // SccDestinationFramerateFramerate24 is a SccDestinationFramerate enum value SccDestinationFramerateFramerate24 = "FRAMERATE_24" + // SccDestinationFramerateFramerate25 is a SccDestinationFramerate enum value + SccDestinationFramerateFramerate25 = "FRAMERATE_25" + // SccDestinationFramerateFramerate2997Dropframe is a SccDestinationFramerate enum value SccDestinationFramerateFramerate2997Dropframe = "FRAMERATE_29_97_DROPFRAME" diff --git a/vendor/github.com/aws/aws-sdk-go/service/mediaconvert/errors.go b/vendor/github.com/aws/aws-sdk-go/service/mediaconvert/errors.go index 7a607419d1c..bbdf25e801d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mediaconvert/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mediaconvert/errors.go @@ -2,6 +2,10 @@ package mediaconvert +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadRequestException for service response error code @@ -28,3 +32,12 @@ const ( // "TooManyRequestsException". ErrCodeTooManyRequestsException = "TooManyRequestsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadRequestException": newErrorBadRequestException, + "ConflictException": newErrorConflictException, + "ForbiddenException": newErrorForbiddenException, + "InternalServerErrorException": newErrorInternalServerErrorException, + "NotFoundException": newErrorNotFoundException, + "TooManyRequestsException": newErrorTooManyRequestsException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/mediaconvert/service.go b/vendor/github.com/aws/aws-sdk-go/service/mediaconvert/service.go index 43d8865f45f..12694bc3803 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mediaconvert/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mediaconvert/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "mediaconvert" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "MediaConvert" // ServiceID is a unique identifer of a specific service. + ServiceID = "MediaConvert" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the MediaConvert client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a MediaConvert client from just a session. // svc := mediaconvert.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *MediaConvert { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "mediaconvert" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *MediaConvert { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *MediaConvert { svc := &MediaConvert{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-08-29", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/medialive/api.go b/vendor/github.com/aws/aws-sdk-go/service/medialive/api.go index 3f18a7e0187..1da8ed50865 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/medialive/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/medialive/api.go @@ -65,22 +65,22 @@ func (c *MediaLive) BatchUpdateScheduleRequest(input *BatchUpdateScheduleInput) // See the AWS API reference guide for AWS Elemental MediaLive's // API operation BatchUpdateSchedule for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// * UnprocessableEntityException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/BatchUpdateSchedule func (c *MediaLive) BatchUpdateSchedule(input *BatchUpdateScheduleInput) (*BatchUpdateScheduleOutput, error) { @@ -157,22 +157,22 @@ func (c *MediaLive) CreateChannelRequest(input *CreateChannelInput) (req *reques // See the AWS API reference guide for AWS Elemental MediaLive's // API operation CreateChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// * UnprocessableEntityException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/CreateChannel func (c *MediaLive) CreateChannel(input *CreateChannelInput) (*CreateChannelOutput, error) { @@ -249,18 +249,18 @@ func (c *MediaLive) CreateInputRequest(input *CreateInputInput) (req *request.Re // See the AWS API reference guide for AWS Elemental MediaLive's // API operation CreateInput for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/CreateInput func (c *MediaLive) CreateInput(input *CreateInputInput) (*CreateInputOutput, error) { @@ -337,18 +337,18 @@ func (c *MediaLive) CreateInputSecurityGroupRequest(input *CreateInputSecurityGr // See the AWS API reference guide for AWS Elemental MediaLive's // API operation CreateInputSecurityGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/CreateInputSecurityGroup func (c *MediaLive) CreateInputSecurityGroup(input *CreateInputSecurityGroupInput) (*CreateInputSecurityGroupOutput, error) { @@ -372,6 +372,190 @@ func (c *MediaLive) CreateInputSecurityGroupWithContext(ctx aws.Context, input * return out, req.Send() } +const opCreateMultiplex = "CreateMultiplex" + +// CreateMultiplexRequest generates a "aws/request.Request" representing the +// client's request for the CreateMultiplex operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateMultiplex for more information on using the CreateMultiplex +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateMultiplexRequest method. +// req, resp := client.CreateMultiplexRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/CreateMultiplex +func (c *MediaLive) CreateMultiplexRequest(input *CreateMultiplexInput) (req *request.Request, output *CreateMultiplexOutput) { + op := &request.Operation{ + Name: opCreateMultiplex, + HTTPMethod: "POST", + HTTPPath: "/prod/multiplexes", + } + + if input == nil { + input = &CreateMultiplexInput{} + } + + output = &CreateMultiplexOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateMultiplex API operation for AWS Elemental MediaLive. +// +// Create a new multiplex. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Elemental MediaLive's +// API operation CreateMultiplex for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// +// * UnprocessableEntityException +// +// * InternalServerErrorException +// +// * ForbiddenException +// +// * BadGatewayException +// +// * GatewayTimeoutException +// +// * TooManyRequestsException +// +// * ConflictException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/CreateMultiplex +func (c *MediaLive) CreateMultiplex(input *CreateMultiplexInput) (*CreateMultiplexOutput, error) { + req, out := c.CreateMultiplexRequest(input) + return out, req.Send() +} + +// CreateMultiplexWithContext is the same as CreateMultiplex with the addition of +// the ability to pass a context and additional request options. +// +// See CreateMultiplex for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MediaLive) CreateMultiplexWithContext(ctx aws.Context, input *CreateMultiplexInput, opts ...request.Option) (*CreateMultiplexOutput, error) { + req, out := c.CreateMultiplexRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateMultiplexProgram = "CreateMultiplexProgram" + +// CreateMultiplexProgramRequest generates a "aws/request.Request" representing the +// client's request for the CreateMultiplexProgram operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateMultiplexProgram for more information on using the CreateMultiplexProgram +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateMultiplexProgramRequest method. +// req, resp := client.CreateMultiplexProgramRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/CreateMultiplexProgram +func (c *MediaLive) CreateMultiplexProgramRequest(input *CreateMultiplexProgramInput) (req *request.Request, output *CreateMultiplexProgramOutput) { + op := &request.Operation{ + Name: opCreateMultiplexProgram, + HTTPMethod: "POST", + HTTPPath: "/prod/multiplexes/{multiplexId}/programs", + } + + if input == nil { + input = &CreateMultiplexProgramInput{} + } + + output = &CreateMultiplexProgramOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateMultiplexProgram API operation for AWS Elemental MediaLive. +// +// Create a new program in the multiplex. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Elemental MediaLive's +// API operation CreateMultiplexProgram for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// +// * UnprocessableEntityException +// +// * InternalServerErrorException +// +// * ForbiddenException +// +// * BadGatewayException +// +// * GatewayTimeoutException +// +// * TooManyRequestsException +// +// * ConflictException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/CreateMultiplexProgram +func (c *MediaLive) CreateMultiplexProgram(input *CreateMultiplexProgramInput) (*CreateMultiplexProgramOutput, error) { + req, out := c.CreateMultiplexProgramRequest(input) + return out, req.Send() +} + +// CreateMultiplexProgramWithContext is the same as CreateMultiplexProgram with the addition of +// the ability to pass a context and additional request options. +// +// See CreateMultiplexProgram for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MediaLive) CreateMultiplexProgramWithContext(ctx aws.Context, input *CreateMultiplexProgramInput, opts ...request.Option) (*CreateMultiplexProgramOutput, error) { + req, out := c.CreateMultiplexProgramRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateTags = "CreateTags" // CreateTagsRequest generates a "aws/request.Request" representing the @@ -426,14 +610,14 @@ func (c *MediaLive) CreateTagsRequest(input *CreateTagsInput) (req *request.Requ // See the AWS API reference guide for AWS Elemental MediaLive's // API operation CreateTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/CreateTags func (c *MediaLive) CreateTags(input *CreateTagsInput) (*CreateTagsOutput, error) { @@ -510,22 +694,22 @@ func (c *MediaLive) DeleteChannelRequest(input *DeleteChannelInput) (req *reques // See the AWS API reference guide for AWS Elemental MediaLive's // API operation DeleteChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DeleteChannel func (c *MediaLive) DeleteChannel(input *DeleteChannelInput) (*DeleteChannelOutput, error) { @@ -603,22 +787,22 @@ func (c *MediaLive) DeleteInputRequest(input *DeleteInputInput) (req *request.Re // See the AWS API reference guide for AWS Elemental MediaLive's // API operation DeleteInput for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DeleteInput func (c *MediaLive) DeleteInput(input *DeleteInputInput) (*DeleteInputOutput, error) { @@ -696,20 +880,20 @@ func (c *MediaLive) DeleteInputSecurityGroupRequest(input *DeleteInputSecurityGr // See the AWS API reference guide for AWS Elemental MediaLive's // API operation DeleteInputSecurityGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DeleteInputSecurityGroup func (c *MediaLive) DeleteInputSecurityGroup(input *DeleteInputSecurityGroupInput) (*DeleteInputSecurityGroupOutput, error) { @@ -733,6 +917,190 @@ func (c *MediaLive) DeleteInputSecurityGroupWithContext(ctx aws.Context, input * return out, req.Send() } +const opDeleteMultiplex = "DeleteMultiplex" + +// DeleteMultiplexRequest generates a "aws/request.Request" representing the +// client's request for the DeleteMultiplex operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteMultiplex for more information on using the DeleteMultiplex +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteMultiplexRequest method. +// req, resp := client.DeleteMultiplexRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DeleteMultiplex +func (c *MediaLive) DeleteMultiplexRequest(input *DeleteMultiplexInput) (req *request.Request, output *DeleteMultiplexOutput) { + op := &request.Operation{ + Name: opDeleteMultiplex, + HTTPMethod: "DELETE", + HTTPPath: "/prod/multiplexes/{multiplexId}", + } + + if input == nil { + input = &DeleteMultiplexInput{} + } + + output = &DeleteMultiplexOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteMultiplex API operation for AWS Elemental MediaLive. +// +// Delete a multiplex. The multiplex must be idle. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Elemental MediaLive's +// API operation DeleteMultiplex for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// +// * InternalServerErrorException +// +// * ForbiddenException +// +// * BadGatewayException +// +// * NotFoundException +// +// * GatewayTimeoutException +// +// * TooManyRequestsException +// +// * ConflictException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DeleteMultiplex +func (c *MediaLive) DeleteMultiplex(input *DeleteMultiplexInput) (*DeleteMultiplexOutput, error) { + req, out := c.DeleteMultiplexRequest(input) + return out, req.Send() +} + +// DeleteMultiplexWithContext is the same as DeleteMultiplex with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteMultiplex for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MediaLive) DeleteMultiplexWithContext(ctx aws.Context, input *DeleteMultiplexInput, opts ...request.Option) (*DeleteMultiplexOutput, error) { + req, out := c.DeleteMultiplexRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteMultiplexProgram = "DeleteMultiplexProgram" + +// DeleteMultiplexProgramRequest generates a "aws/request.Request" representing the +// client's request for the DeleteMultiplexProgram operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteMultiplexProgram for more information on using the DeleteMultiplexProgram +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteMultiplexProgramRequest method. +// req, resp := client.DeleteMultiplexProgramRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DeleteMultiplexProgram +func (c *MediaLive) DeleteMultiplexProgramRequest(input *DeleteMultiplexProgramInput) (req *request.Request, output *DeleteMultiplexProgramOutput) { + op := &request.Operation{ + Name: opDeleteMultiplexProgram, + HTTPMethod: "DELETE", + HTTPPath: "/prod/multiplexes/{multiplexId}/programs/{programName}", + } + + if input == nil { + input = &DeleteMultiplexProgramInput{} + } + + output = &DeleteMultiplexProgramOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteMultiplexProgram API operation for AWS Elemental MediaLive. +// +// Delete a program from a multiplex. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Elemental MediaLive's +// API operation DeleteMultiplexProgram for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// +// * InternalServerErrorException +// +// * ForbiddenException +// +// * BadGatewayException +// +// * NotFoundException +// +// * GatewayTimeoutException +// +// * TooManyRequestsException +// +// * ConflictException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DeleteMultiplexProgram +func (c *MediaLive) DeleteMultiplexProgram(input *DeleteMultiplexProgramInput) (*DeleteMultiplexProgramOutput, error) { + req, out := c.DeleteMultiplexProgramRequest(input) + return out, req.Send() +} + +// DeleteMultiplexProgramWithContext is the same as DeleteMultiplexProgram with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteMultiplexProgram for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MediaLive) DeleteMultiplexProgramWithContext(ctx aws.Context, input *DeleteMultiplexProgramInput, opts ...request.Option) (*DeleteMultiplexProgramOutput, error) { + req, out := c.DeleteMultiplexProgramRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteReservation = "DeleteReservation" // DeleteReservationRequest generates a "aws/request.Request" representing the @@ -786,22 +1154,22 @@ func (c *MediaLive) DeleteReservationRequest(input *DeleteReservationInput) (req // See the AWS API reference guide for AWS Elemental MediaLive's // API operation DeleteReservation for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DeleteReservation func (c *MediaLive) DeleteReservation(input *DeleteReservationInput) (*DeleteReservationOutput, error) { @@ -879,20 +1247,20 @@ func (c *MediaLive) DeleteScheduleRequest(input *DeleteScheduleInput) (req *requ // See the AWS API reference guide for AWS Elemental MediaLive's // API operation DeleteSchedule for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DeleteSchedule func (c *MediaLive) DeleteSchedule(input *DeleteScheduleInput) (*DeleteScheduleOutput, error) { @@ -970,14 +1338,14 @@ func (c *MediaLive) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Requ // See the AWS API reference guide for AWS Elemental MediaLive's // API operation DeleteTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DeleteTags func (c *MediaLive) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { @@ -1054,20 +1422,20 @@ func (c *MediaLive) DescribeChannelRequest(input *DescribeChannelInput) (req *re // See the AWS API reference guide for AWS Elemental MediaLive's // API operation DescribeChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeChannel func (c *MediaLive) DescribeChannel(input *DescribeChannelInput) (*DescribeChannelOutput, error) { @@ -1144,20 +1512,20 @@ func (c *MediaLive) DescribeInputRequest(input *DescribeInputInput) (req *reques // See the AWS API reference guide for AWS Elemental MediaLive's // API operation DescribeInput for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeInput func (c *MediaLive) DescribeInput(input *DescribeInputInput) (*DescribeInputOutput, error) { @@ -1234,20 +1602,20 @@ func (c *MediaLive) DescribeInputSecurityGroupRequest(input *DescribeInputSecuri // See the AWS API reference guide for AWS Elemental MediaLive's // API operation DescribeInputSecurityGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeInputSecurityGroup func (c *MediaLive) DescribeInputSecurityGroup(input *DescribeInputSecurityGroupInput) (*DescribeInputSecurityGroupOutput, error) { @@ -1271,44 +1639,224 @@ func (c *MediaLive) DescribeInputSecurityGroupWithContext(ctx aws.Context, input return out, req.Send() } -const opDescribeOffering = "DescribeOffering" +const opDescribeMultiplex = "DescribeMultiplex" -// DescribeOfferingRequest generates a "aws/request.Request" representing the -// client's request for the DescribeOffering operation. The "output" return +// DescribeMultiplexRequest generates a "aws/request.Request" representing the +// client's request for the DescribeMultiplex operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeOffering for more information on using the DescribeOffering +// See DescribeMultiplex for more information on using the DescribeMultiplex // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeOfferingRequest method. -// req, resp := client.DescribeOfferingRequest(params) +// // Example sending a request using the DescribeMultiplexRequest method. +// req, resp := client.DescribeMultiplexRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeOffering -func (c *MediaLive) DescribeOfferingRequest(input *DescribeOfferingInput) (req *request.Request, output *DescribeOfferingOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeMultiplex +func (c *MediaLive) DescribeMultiplexRequest(input *DescribeMultiplexInput) (req *request.Request, output *DescribeMultiplexOutput) { op := &request.Operation{ - Name: opDescribeOffering, + Name: opDescribeMultiplex, HTTPMethod: "GET", - HTTPPath: "/prod/offerings/{offeringId}", + HTTPPath: "/prod/multiplexes/{multiplexId}", } if input == nil { - input = &DescribeOfferingInput{} + input = &DescribeMultiplexInput{} } - output = &DescribeOfferingOutput{} + output = &DescribeMultiplexOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeMultiplex API operation for AWS Elemental MediaLive. +// +// Gets details about a multiplex. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Elemental MediaLive's +// API operation DescribeMultiplex for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// +// * InternalServerErrorException +// +// * ForbiddenException +// +// * BadGatewayException +// +// * NotFoundException +// +// * GatewayTimeoutException +// +// * TooManyRequestsException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeMultiplex +func (c *MediaLive) DescribeMultiplex(input *DescribeMultiplexInput) (*DescribeMultiplexOutput, error) { + req, out := c.DescribeMultiplexRequest(input) + return out, req.Send() +} + +// DescribeMultiplexWithContext is the same as DescribeMultiplex with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeMultiplex for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MediaLive) DescribeMultiplexWithContext(ctx aws.Context, input *DescribeMultiplexInput, opts ...request.Option) (*DescribeMultiplexOutput, error) { + req, out := c.DescribeMultiplexRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeMultiplexProgram = "DescribeMultiplexProgram" + +// DescribeMultiplexProgramRequest generates a "aws/request.Request" representing the +// client's request for the DescribeMultiplexProgram operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeMultiplexProgram for more information on using the DescribeMultiplexProgram +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeMultiplexProgramRequest method. +// req, resp := client.DescribeMultiplexProgramRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeMultiplexProgram +func (c *MediaLive) DescribeMultiplexProgramRequest(input *DescribeMultiplexProgramInput) (req *request.Request, output *DescribeMultiplexProgramOutput) { + op := &request.Operation{ + Name: opDescribeMultiplexProgram, + HTTPMethod: "GET", + HTTPPath: "/prod/multiplexes/{multiplexId}/programs/{programName}", + } + + if input == nil { + input = &DescribeMultiplexProgramInput{} + } + + output = &DescribeMultiplexProgramOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeMultiplexProgram API operation for AWS Elemental MediaLive. +// +// Get the details for a program in a multiplex. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Elemental MediaLive's +// API operation DescribeMultiplexProgram for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// +// * InternalServerErrorException +// +// * ForbiddenException +// +// * BadGatewayException +// +// * NotFoundException +// +// * GatewayTimeoutException +// +// * TooManyRequestsException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeMultiplexProgram +func (c *MediaLive) DescribeMultiplexProgram(input *DescribeMultiplexProgramInput) (*DescribeMultiplexProgramOutput, error) { + req, out := c.DescribeMultiplexProgramRequest(input) + return out, req.Send() +} + +// DescribeMultiplexProgramWithContext is the same as DescribeMultiplexProgram with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeMultiplexProgram for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MediaLive) DescribeMultiplexProgramWithContext(ctx aws.Context, input *DescribeMultiplexProgramInput, opts ...request.Option) (*DescribeMultiplexProgramOutput, error) { + req, out := c.DescribeMultiplexProgramRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeOffering = "DescribeOffering" + +// DescribeOfferingRequest generates a "aws/request.Request" representing the +// client's request for the DescribeOffering operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeOffering for more information on using the DescribeOffering +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeOfferingRequest method. +// req, resp := client.DescribeOfferingRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeOffering +func (c *MediaLive) DescribeOfferingRequest(input *DescribeOfferingInput) (req *request.Request, output *DescribeOfferingOutput) { + op := &request.Operation{ + Name: opDescribeOffering, + HTTPMethod: "GET", + HTTPPath: "/prod/offerings/{offeringId}", + } + + if input == nil { + input = &DescribeOfferingInput{} + } + + output = &DescribeOfferingOutput{} req = c.newRequest(op, input, output) return } @@ -1324,20 +1872,20 @@ func (c *MediaLive) DescribeOfferingRequest(input *DescribeOfferingInput) (req * // See the AWS API reference guide for AWS Elemental MediaLive's // API operation DescribeOffering for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeOffering func (c *MediaLive) DescribeOffering(input *DescribeOfferingInput) (*DescribeOfferingOutput, error) { @@ -1414,20 +1962,20 @@ func (c *MediaLive) DescribeReservationRequest(input *DescribeReservationInput) // See the AWS API reference guide for AWS Elemental MediaLive's // API operation DescribeReservation for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeReservation func (c *MediaLive) DescribeReservation(input *DescribeReservationInput) (*DescribeReservationOutput, error) { @@ -1510,20 +2058,20 @@ func (c *MediaLive) DescribeScheduleRequest(input *DescribeScheduleInput) (req * // See the AWS API reference guide for AWS Elemental MediaLive's // API operation DescribeSchedule for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/DescribeSchedule func (c *MediaLive) DescribeSchedule(input *DescribeScheduleInput) (*DescribeScheduleOutput, error) { @@ -1590,10 +2138,12 @@ func (c *MediaLive) DescribeSchedulePagesWithContext(ctx aws.Context, input *Des }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeScheduleOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeScheduleOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1656,18 +2206,18 @@ func (c *MediaLive) ListChannelsRequest(input *ListChannelsInput) (req *request. // See the AWS API reference guide for AWS Elemental MediaLive's // API operation ListChannels for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListChannels func (c *MediaLive) ListChannels(input *ListChannelsInput) (*ListChannelsOutput, error) { @@ -1734,10 +2284,12 @@ func (c *MediaLive) ListChannelsPagesWithContext(ctx aws.Context, input *ListCha }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListChannelsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListChannelsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1800,18 +2352,18 @@ func (c *MediaLive) ListInputSecurityGroupsRequest(input *ListInputSecurityGroup // See the AWS API reference guide for AWS Elemental MediaLive's // API operation ListInputSecurityGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListInputSecurityGroups func (c *MediaLive) ListInputSecurityGroups(input *ListInputSecurityGroupsInput) (*ListInputSecurityGroupsOutput, error) { @@ -1878,10 +2430,12 @@ func (c *MediaLive) ListInputSecurityGroupsPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInputSecurityGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListInputSecurityGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1944,18 +2498,18 @@ func (c *MediaLive) ListInputsRequest(input *ListInputsInput) (req *request.Requ // See the AWS API reference guide for AWS Elemental MediaLive's // API operation ListInputs for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListInputs func (c *MediaLive) ListInputs(input *ListInputsInput) (*ListInputsOutput, error) { @@ -2022,44 +2576,46 @@ func (c *MediaLive) ListInputsPagesWithContext(ctx aws.Context, input *ListInput }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInputsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListInputsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opListOfferings = "ListOfferings" +const opListMultiplexPrograms = "ListMultiplexPrograms" -// ListOfferingsRequest generates a "aws/request.Request" representing the -// client's request for the ListOfferings operation. The "output" return +// ListMultiplexProgramsRequest generates a "aws/request.Request" representing the +// client's request for the ListMultiplexPrograms operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListOfferings for more information on using the ListOfferings +// See ListMultiplexPrograms for more information on using the ListMultiplexPrograms // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListOfferingsRequest method. -// req, resp := client.ListOfferingsRequest(params) +// // Example sending a request using the ListMultiplexProgramsRequest method. +// req, resp := client.ListMultiplexProgramsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListOfferings -func (c *MediaLive) ListOfferingsRequest(input *ListOfferingsInput) (req *request.Request, output *ListOfferingsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListMultiplexPrograms +func (c *MediaLive) ListMultiplexProgramsRequest(input *ListMultiplexProgramsInput) (req *request.Request, output *ListMultiplexProgramsOutput) { op := &request.Operation{ - Name: opListOfferings, + Name: opListMultiplexPrograms, HTTPMethod: "GET", - HTTPPath: "/prod/offerings", + HTTPPath: "/prod/multiplexes/{multiplexId}/programs", Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, @@ -2069,141 +2625,145 @@ func (c *MediaLive) ListOfferingsRequest(input *ListOfferingsInput) (req *reques } if input == nil { - input = &ListOfferingsInput{} + input = &ListMultiplexProgramsInput{} } - output = &ListOfferingsOutput{} + output = &ListMultiplexProgramsOutput{} req = c.newRequest(op, input, output) return } -// ListOfferings API operation for AWS Elemental MediaLive. +// ListMultiplexPrograms API operation for AWS Elemental MediaLive. // -// List offerings available for purchase. +// List the programs that currently exist for a specific multiplex. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Elemental MediaLive's -// API operation ListOfferings for usage and error information. +// API operation ListMultiplexPrograms for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * NotFoundException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * GatewayTimeoutException // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListOfferings -func (c *MediaLive) ListOfferings(input *ListOfferingsInput) (*ListOfferingsOutput, error) { - req, out := c.ListOfferingsRequest(input) +// * TooManyRequestsException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListMultiplexPrograms +func (c *MediaLive) ListMultiplexPrograms(input *ListMultiplexProgramsInput) (*ListMultiplexProgramsOutput, error) { + req, out := c.ListMultiplexProgramsRequest(input) return out, req.Send() } -// ListOfferingsWithContext is the same as ListOfferings with the addition of +// ListMultiplexProgramsWithContext is the same as ListMultiplexPrograms with the addition of // the ability to pass a context and additional request options. // -// See ListOfferings for details on how to use this API operation. +// See ListMultiplexPrograms for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *MediaLive) ListOfferingsWithContext(ctx aws.Context, input *ListOfferingsInput, opts ...request.Option) (*ListOfferingsOutput, error) { - req, out := c.ListOfferingsRequest(input) +func (c *MediaLive) ListMultiplexProgramsWithContext(ctx aws.Context, input *ListMultiplexProgramsInput, opts ...request.Option) (*ListMultiplexProgramsOutput, error) { + req, out := c.ListMultiplexProgramsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListOfferingsPages iterates over the pages of a ListOfferings operation, +// ListMultiplexProgramsPages iterates over the pages of a ListMultiplexPrograms operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See ListOfferings method for more information on how to use this operation. +// See ListMultiplexPrograms 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 ListOfferings operation. +// // Example iterating over at most 3 pages of a ListMultiplexPrograms operation. // pageNum := 0 -// err := client.ListOfferingsPages(params, -// func(page *medialive.ListOfferingsOutput, lastPage bool) bool { +// err := client.ListMultiplexProgramsPages(params, +// func(page *medialive.ListMultiplexProgramsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *MediaLive) ListOfferingsPages(input *ListOfferingsInput, fn func(*ListOfferingsOutput, bool) bool) error { - return c.ListOfferingsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *MediaLive) ListMultiplexProgramsPages(input *ListMultiplexProgramsInput, fn func(*ListMultiplexProgramsOutput, bool) bool) error { + return c.ListMultiplexProgramsPagesWithContext(aws.BackgroundContext(), input, fn) } -// ListOfferingsPagesWithContext same as ListOfferingsPages except +// ListMultiplexProgramsPagesWithContext same as ListMultiplexProgramsPages 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 *MediaLive) ListOfferingsPagesWithContext(ctx aws.Context, input *ListOfferingsInput, fn func(*ListOfferingsOutput, bool) bool, opts ...request.Option) error { +func (c *MediaLive) ListMultiplexProgramsPagesWithContext(ctx aws.Context, input *ListMultiplexProgramsInput, fn func(*ListMultiplexProgramsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *ListOfferingsInput + var inCpy *ListMultiplexProgramsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.ListOfferingsRequest(inCpy) + req, _ := c.ListMultiplexProgramsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOfferingsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListMultiplexProgramsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opListReservations = "ListReservations" +const opListMultiplexes = "ListMultiplexes" -// ListReservationsRequest generates a "aws/request.Request" representing the -// client's request for the ListReservations operation. The "output" return +// ListMultiplexesRequest generates a "aws/request.Request" representing the +// client's request for the ListMultiplexes operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListReservations for more information on using the ListReservations +// See ListMultiplexes for more information on using the ListMultiplexes // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListReservationsRequest method. -// req, resp := client.ListReservationsRequest(params) +// // Example sending a request using the ListMultiplexesRequest method. +// req, resp := client.ListMultiplexesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListReservations -func (c *MediaLive) ListReservationsRequest(input *ListReservationsInput) (req *request.Request, output *ListReservationsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListMultiplexes +func (c *MediaLive) ListMultiplexesRequest(input *ListMultiplexesInput) (req *request.Request, output *ListMultiplexesOutput) { op := &request.Operation{ - Name: opListReservations, + Name: opListMultiplexes, HTTPMethod: "GET", - HTTPPath: "/prod/reservations", + HTTPPath: "/prod/multiplexes", Paginator: &request.Paginator{ InputTokens: []string{"NextToken"}, OutputTokens: []string{"NextToken"}, @@ -2213,1081 +2773,3570 @@ func (c *MediaLive) ListReservationsRequest(input *ListReservationsInput) (req * } if input == nil { - input = &ListReservationsInput{} + input = &ListMultiplexesInput{} } - output = &ListReservationsOutput{} + output = &ListMultiplexesOutput{} req = c.newRequest(op, input, output) return } -// ListReservations API operation for AWS Elemental MediaLive. +// ListMultiplexes API operation for AWS Elemental MediaLive. // -// List purchased reservations. +// Retrieve a list of the existing multiplexes. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Elemental MediaLive's -// API operation ListReservations for usage and error information. +// API operation ListMultiplexes for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListReservations -func (c *MediaLive) ListReservations(input *ListReservationsInput) (*ListReservationsOutput, error) { - req, out := c.ListReservationsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListMultiplexes +func (c *MediaLive) ListMultiplexes(input *ListMultiplexesInput) (*ListMultiplexesOutput, error) { + req, out := c.ListMultiplexesRequest(input) return out, req.Send() } -// ListReservationsWithContext is the same as ListReservations with the addition of +// ListMultiplexesWithContext is the same as ListMultiplexes with the addition of // the ability to pass a context and additional request options. // -// See ListReservations for details on how to use this API operation. +// See ListMultiplexes for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *MediaLive) ListReservationsWithContext(ctx aws.Context, input *ListReservationsInput, opts ...request.Option) (*ListReservationsOutput, error) { - req, out := c.ListReservationsRequest(input) +func (c *MediaLive) ListMultiplexesWithContext(ctx aws.Context, input *ListMultiplexesInput, opts ...request.Option) (*ListMultiplexesOutput, error) { + req, out := c.ListMultiplexesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListReservationsPages iterates over the pages of a ListReservations operation, +// ListMultiplexesPages iterates over the pages of a ListMultiplexes operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See ListReservations method for more information on how to use this operation. +// See ListMultiplexes 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 ListReservations operation. +// // Example iterating over at most 3 pages of a ListMultiplexes operation. // pageNum := 0 -// err := client.ListReservationsPages(params, -// func(page *medialive.ListReservationsOutput, lastPage bool) bool { +// err := client.ListMultiplexesPages(params, +// func(page *medialive.ListMultiplexesOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *MediaLive) ListReservationsPages(input *ListReservationsInput, fn func(*ListReservationsOutput, bool) bool) error { - return c.ListReservationsPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *MediaLive) ListMultiplexesPages(input *ListMultiplexesInput, fn func(*ListMultiplexesOutput, bool) bool) error { + return c.ListMultiplexesPagesWithContext(aws.BackgroundContext(), input, fn) } -// ListReservationsPagesWithContext same as ListReservationsPages except +// ListMultiplexesPagesWithContext same as ListMultiplexesPages 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 *MediaLive) ListReservationsPagesWithContext(ctx aws.Context, input *ListReservationsInput, fn func(*ListReservationsOutput, bool) bool, opts ...request.Option) error { +func (c *MediaLive) ListMultiplexesPagesWithContext(ctx aws.Context, input *ListMultiplexesInput, fn func(*ListMultiplexesOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *ListReservationsInput + var inCpy *ListMultiplexesInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.ListReservationsRequest(inCpy) + req, _ := c.ListMultiplexesRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListReservationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListMultiplexesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opListTagsForResource = "ListTagsForResource" +const opListOfferings = "ListOfferings" -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource operation. The "output" return +// ListOfferingsRequest generates a "aws/request.Request" representing the +// client's request for the ListOfferings operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListTagsForResource for more information on using the ListTagsForResource +// See ListOfferings for more information on using the ListOfferings // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) +// // Example sending a request using the ListOfferingsRequest method. +// req, resp := client.ListOfferingsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListTagsForResource -func (c *MediaLive) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListOfferings +func (c *MediaLive) ListOfferingsRequest(input *ListOfferingsInput) (req *request.Request, output *ListOfferingsOutput) { op := &request.Operation{ - Name: opListTagsForResource, + Name: opListOfferings, HTTPMethod: "GET", - HTTPPath: "/prod/tags/{resource-arn}", + HTTPPath: "/prod/offerings", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &ListTagsForResourceInput{} + input = &ListOfferingsInput{} } - output = &ListTagsForResourceOutput{} + output = &ListOfferingsOutput{} req = c.newRequest(op, input, output) return } -// ListTagsForResource API operation for AWS Elemental MediaLive. +// ListOfferings API operation for AWS Elemental MediaLive. // -// Produces list of tags that have been created for a resource +// List offerings available for 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 AWS Elemental MediaLive's -// API operation ListTagsForResource for usage and error information. +// API operation ListOfferings for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeBadRequestException "BadRequestException" +// * InternalServerErrorException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * ForbiddenException // -// * ErrCodeForbiddenException "ForbiddenException" +// * BadGatewayException // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListTagsForResource -func (c *MediaLive) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) +// * GatewayTimeoutException +// +// * TooManyRequestsException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListOfferings +func (c *MediaLive) ListOfferings(input *ListOfferingsInput) (*ListOfferingsOutput, error) { + req, out := c.ListOfferingsRequest(input) return out, req.Send() } -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// ListOfferingsWithContext is the same as ListOfferings with the addition of // the ability to pass a context and additional request options. // -// See ListTagsForResource for details on how to use this API operation. +// See ListOfferings for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *MediaLive) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) +func (c *MediaLive) ListOfferingsWithContext(ctx aws.Context, input *ListOfferingsInput, opts ...request.Option) (*ListOfferingsOutput, error) { + req, out := c.ListOfferingsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPurchaseOffering = "PurchaseOffering" +// ListOfferingsPages iterates over the pages of a ListOfferings operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListOfferings 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 ListOfferings operation. +// pageNum := 0 +// err := client.ListOfferingsPages(params, +// func(page *medialive.ListOfferingsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *MediaLive) ListOfferingsPages(input *ListOfferingsInput, fn func(*ListOfferingsOutput, bool) bool) error { + return c.ListOfferingsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// PurchaseOfferingRequest generates a "aws/request.Request" representing the -// client's request for the PurchaseOffering operation. The "output" return +// ListOfferingsPagesWithContext same as ListOfferingsPages 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 *MediaLive) ListOfferingsPagesWithContext(ctx aws.Context, input *ListOfferingsInput, fn func(*ListOfferingsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListOfferingsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListOfferingsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListOfferingsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListReservations = "ListReservations" + +// ListReservationsRequest generates a "aws/request.Request" representing the +// client's request for the ListReservations operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PurchaseOffering for more information on using the PurchaseOffering +// See ListReservations for more information on using the ListReservations // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PurchaseOfferingRequest method. -// req, resp := client.PurchaseOfferingRequest(params) +// // Example sending a request using the ListReservationsRequest method. +// req, resp := client.ListReservationsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/PurchaseOffering -func (c *MediaLive) PurchaseOfferingRequest(input *PurchaseOfferingInput) (req *request.Request, output *PurchaseOfferingOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListReservations +func (c *MediaLive) ListReservationsRequest(input *ListReservationsInput) (req *request.Request, output *ListReservationsOutput) { op := &request.Operation{ - Name: opPurchaseOffering, - HTTPMethod: "POST", - HTTPPath: "/prod/offerings/{offeringId}/purchase", + Name: opListReservations, + HTTPMethod: "GET", + HTTPPath: "/prod/reservations", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &PurchaseOfferingInput{} + input = &ListReservationsInput{} } - output = &PurchaseOfferingOutput{} + output = &ListReservationsOutput{} req = c.newRequest(op, input, output) return } -// PurchaseOffering API operation for AWS Elemental MediaLive. +// ListReservations API operation for AWS Elemental MediaLive. // -// Purchase an offering and create a reservation. +// List purchased reservations. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Elemental MediaLive's -// API operation PurchaseOffering for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// API operation ListReservations for usage and error information. // -// * ErrCodeForbiddenException "ForbiddenException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * InternalServerErrorException // -// * ErrCodeNotFoundException "NotFoundException" +// * ForbiddenException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * BadGatewayException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * GatewayTimeoutException // -// * ErrCodeConflictException "ConflictException" +// * TooManyRequestsException // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/PurchaseOffering -func (c *MediaLive) PurchaseOffering(input *PurchaseOfferingInput) (*PurchaseOfferingOutput, error) { - req, out := c.PurchaseOfferingRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListReservations +func (c *MediaLive) ListReservations(input *ListReservationsInput) (*ListReservationsOutput, error) { + req, out := c.ListReservationsRequest(input) return out, req.Send() } -// PurchaseOfferingWithContext is the same as PurchaseOffering with the addition of +// ListReservationsWithContext is the same as ListReservations with the addition of // the ability to pass a context and additional request options. // -// See PurchaseOffering for details on how to use this API operation. +// See ListReservations for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *MediaLive) PurchaseOfferingWithContext(ctx aws.Context, input *PurchaseOfferingInput, opts ...request.Option) (*PurchaseOfferingOutput, error) { - req, out := c.PurchaseOfferingRequest(input) +func (c *MediaLive) ListReservationsWithContext(ctx aws.Context, input *ListReservationsInput, opts ...request.Option) (*ListReservationsOutput, error) { + req, out := c.ListReservationsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStartChannel = "StartChannel" +// ListReservationsPages iterates over the pages of a ListReservations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListReservations 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 ListReservations operation. +// pageNum := 0 +// err := client.ListReservationsPages(params, +// func(page *medialive.ListReservationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *MediaLive) ListReservationsPages(input *ListReservationsInput, fn func(*ListReservationsOutput, bool) bool) error { + return c.ListReservationsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// StartChannelRequest generates a "aws/request.Request" representing the -// client's request for the StartChannel operation. The "output" return +// ListReservationsPagesWithContext same as ListReservationsPages 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 *MediaLive) ListReservationsPagesWithContext(ctx aws.Context, input *ListReservationsInput, fn func(*ListReservationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListReservationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListReservationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListReservationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StartChannel for more information on using the StartChannel +// See ListTagsForResource for more information on using the ListTagsForResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StartChannelRequest method. -// req, resp := client.StartChannelRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/StartChannel -func (c *MediaLive) StartChannelRequest(input *StartChannelInput) (req *request.Request, output *StartChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListTagsForResource +func (c *MediaLive) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { op := &request.Operation{ - Name: opStartChannel, - HTTPMethod: "POST", - HTTPPath: "/prod/channels/{channelId}/start", + Name: opListTagsForResource, + HTTPMethod: "GET", + HTTPPath: "/prod/tags/{resource-arn}", } if input == nil { - input = &StartChannelInput{} + input = &ListTagsForResourceInput{} } - output = &StartChannelOutput{} + output = &ListTagsForResourceOutput{} req = c.newRequest(op, input, output) return } -// StartChannel API operation for AWS Elemental MediaLive. +// ListTagsForResource API operation for AWS Elemental MediaLive. // -// Starts an existing channel +// Produces list of tags that have been created for 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 AWS Elemental MediaLive's -// API operation StartChannel for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeInternalServerErrorException "InternalServerErrorException" -// -// * ErrCodeForbiddenException "ForbiddenException" -// -// * ErrCodeBadGatewayException "BadGatewayException" +// API operation ListTagsForResource for usage and error information. // -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * BadRequestException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * InternalServerErrorException // -// * ErrCodeConflictException "ConflictException" +// * ForbiddenException // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/StartChannel -func (c *MediaLive) StartChannel(input *StartChannelInput) (*StartChannelOutput, error) { - req, out := c.StartChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/ListTagsForResource +func (c *MediaLive) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) return out, req.Send() } -// StartChannelWithContext is the same as StartChannel with the addition of +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of // the ability to pass a context and additional request options. // -// See StartChannel for details on how to use this API operation. +// See ListTagsForResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *MediaLive) StartChannelWithContext(ctx aws.Context, input *StartChannelInput, opts ...request.Option) (*StartChannelOutput, error) { - req, out := c.StartChannelRequest(input) +func (c *MediaLive) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopChannel = "StopChannel" +const opPurchaseOffering = "PurchaseOffering" -// StopChannelRequest generates a "aws/request.Request" representing the -// client's request for the StopChannel operation. The "output" return +// PurchaseOfferingRequest generates a "aws/request.Request" representing the +// client's request for the PurchaseOffering operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopChannel for more information on using the StopChannel +// See PurchaseOffering for more information on using the PurchaseOffering // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopChannelRequest method. -// req, resp := client.StopChannelRequest(params) +// // Example sending a request using the PurchaseOfferingRequest method. +// req, resp := client.PurchaseOfferingRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/StopChannel -func (c *MediaLive) StopChannelRequest(input *StopChannelInput) (req *request.Request, output *StopChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/PurchaseOffering +func (c *MediaLive) PurchaseOfferingRequest(input *PurchaseOfferingInput) (req *request.Request, output *PurchaseOfferingOutput) { op := &request.Operation{ - Name: opStopChannel, + Name: opPurchaseOffering, HTTPMethod: "POST", - HTTPPath: "/prod/channels/{channelId}/stop", + HTTPPath: "/prod/offerings/{offeringId}/purchase", } if input == nil { - input = &StopChannelInput{} + input = &PurchaseOfferingInput{} } - output = &StopChannelOutput{} + output = &PurchaseOfferingOutput{} req = c.newRequest(op, input, output) return } -// StopChannel API operation for AWS Elemental MediaLive. +// PurchaseOffering API operation for AWS Elemental MediaLive. // -// Stops a running channel +// Purchase an offering and create a reservation. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Elemental MediaLive's -// API operation StopChannel for usage and error information. +// API operation PurchaseOffering for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/StopChannel -func (c *MediaLive) StopChannel(input *StopChannelInput) (*StopChannelOutput, error) { - req, out := c.StopChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/PurchaseOffering +func (c *MediaLive) PurchaseOffering(input *PurchaseOfferingInput) (*PurchaseOfferingOutput, error) { + req, out := c.PurchaseOfferingRequest(input) return out, req.Send() } -// StopChannelWithContext is the same as StopChannel with the addition of +// PurchaseOfferingWithContext is the same as PurchaseOffering with the addition of // the ability to pass a context and additional request options. // -// See StopChannel for details on how to use this API operation. +// See PurchaseOffering for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *MediaLive) StopChannelWithContext(ctx aws.Context, input *StopChannelInput, opts ...request.Option) (*StopChannelOutput, error) { - req, out := c.StopChannelRequest(input) +func (c *MediaLive) PurchaseOfferingWithContext(ctx aws.Context, input *PurchaseOfferingInput, opts ...request.Option) (*PurchaseOfferingOutput, error) { + req, out := c.PurchaseOfferingRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateChannel = "UpdateChannel" +const opStartChannel = "StartChannel" -// UpdateChannelRequest generates a "aws/request.Request" representing the -// client's request for the UpdateChannel operation. The "output" return +// StartChannelRequest generates a "aws/request.Request" representing the +// client's request for the StartChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateChannel for more information on using the UpdateChannel +// See StartChannel for more information on using the StartChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateChannelRequest method. -// req, resp := client.UpdateChannelRequest(params) +// // Example sending a request using the StartChannelRequest method. +// req, resp := client.StartChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateChannel -func (c *MediaLive) UpdateChannelRequest(input *UpdateChannelInput) (req *request.Request, output *UpdateChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/StartChannel +func (c *MediaLive) StartChannelRequest(input *StartChannelInput) (req *request.Request, output *StartChannelOutput) { op := &request.Operation{ - Name: opUpdateChannel, - HTTPMethod: "PUT", - HTTPPath: "/prod/channels/{channelId}", + Name: opStartChannel, + HTTPMethod: "POST", + HTTPPath: "/prod/channels/{channelId}/start", } if input == nil { - input = &UpdateChannelInput{} + input = &StartChannelInput{} } - output = &UpdateChannelOutput{} + output = &StartChannelOutput{} req = c.newRequest(op, input, output) return } -// UpdateChannel API operation for AWS Elemental MediaLive. +// StartChannel API operation for AWS Elemental MediaLive. // -// Updates a channel. +// Starts an existing channel // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Elemental MediaLive's -// API operation UpdateChannel for usage and error information. +// API operation StartChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// * InternalServerErrorException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * ForbiddenException // -// * ErrCodeForbiddenException "ForbiddenException" +// * BadGatewayException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeConflictException "ConflictException" +// * TooManyRequestsException // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateChannel -func (c *MediaLive) UpdateChannel(input *UpdateChannelInput) (*UpdateChannelOutput, error) { - req, out := c.UpdateChannelRequest(input) +// * ConflictException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/StartChannel +func (c *MediaLive) StartChannel(input *StartChannelInput) (*StartChannelOutput, error) { + req, out := c.StartChannelRequest(input) return out, req.Send() } -// UpdateChannelWithContext is the same as UpdateChannel with the addition of +// StartChannelWithContext is the same as StartChannel with the addition of // the ability to pass a context and additional request options. // -// See UpdateChannel for details on how to use this API operation. +// See StartChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *MediaLive) UpdateChannelWithContext(ctx aws.Context, input *UpdateChannelInput, opts ...request.Option) (*UpdateChannelOutput, error) { - req, out := c.UpdateChannelRequest(input) +func (c *MediaLive) StartChannelWithContext(ctx aws.Context, input *StartChannelInput, opts ...request.Option) (*StartChannelOutput, error) { + req, out := c.StartChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateChannelClass = "UpdateChannelClass" +const opStartMultiplex = "StartMultiplex" -// UpdateChannelClassRequest generates a "aws/request.Request" representing the -// client's request for the UpdateChannelClass operation. The "output" return +// StartMultiplexRequest generates a "aws/request.Request" representing the +// client's request for the StartMultiplex operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateChannelClass for more information on using the UpdateChannelClass +// See StartMultiplex for more information on using the StartMultiplex // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateChannelClassRequest method. -// req, resp := client.UpdateChannelClassRequest(params) +// // Example sending a request using the StartMultiplexRequest method. +// req, resp := client.StartMultiplexRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateChannelClass -func (c *MediaLive) UpdateChannelClassRequest(input *UpdateChannelClassInput) (req *request.Request, output *UpdateChannelClassOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/StartMultiplex +func (c *MediaLive) StartMultiplexRequest(input *StartMultiplexInput) (req *request.Request, output *StartMultiplexOutput) { op := &request.Operation{ - Name: opUpdateChannelClass, - HTTPMethod: "PUT", - HTTPPath: "/prod/channels/{channelId}/channelClass", + Name: opStartMultiplex, + HTTPMethod: "POST", + HTTPPath: "/prod/multiplexes/{multiplexId}/start", } if input == nil { - input = &UpdateChannelClassInput{} + input = &StartMultiplexInput{} } - output = &UpdateChannelClassOutput{} + output = &StartMultiplexOutput{} req = c.newRequest(op, input, output) return } -// UpdateChannelClass API operation for AWS Elemental MediaLive. +// StartMultiplex API operation for AWS Elemental MediaLive. // -// Changes the class of the channel. +// Start (run) the multiplex. Starting the multiplex does not start the channels. +// You must explicitly start each channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Elemental MediaLive's -// API operation UpdateChannelClass for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// API operation StartMultiplex for usage and error information. // -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateChannelClass -func (c *MediaLive) UpdateChannelClass(input *UpdateChannelClassInput) (*UpdateChannelClassOutput, error) { - req, out := c.UpdateChannelClassRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/StartMultiplex +func (c *MediaLive) StartMultiplex(input *StartMultiplexInput) (*StartMultiplexOutput, error) { + req, out := c.StartMultiplexRequest(input) return out, req.Send() } -// UpdateChannelClassWithContext is the same as UpdateChannelClass with the addition of +// StartMultiplexWithContext is the same as StartMultiplex with the addition of // the ability to pass a context and additional request options. // -// See UpdateChannelClass for details on how to use this API operation. +// See StartMultiplex for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *MediaLive) UpdateChannelClassWithContext(ctx aws.Context, input *UpdateChannelClassInput, opts ...request.Option) (*UpdateChannelClassOutput, error) { - req, out := c.UpdateChannelClassRequest(input) +func (c *MediaLive) StartMultiplexWithContext(ctx aws.Context, input *StartMultiplexInput, opts ...request.Option) (*StartMultiplexOutput, error) { + req, out := c.StartMultiplexRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateInput = "UpdateInput" +const opStopChannel = "StopChannel" -// UpdateInputRequest generates a "aws/request.Request" representing the -// client's request for the UpdateInput operation. The "output" return +// StopChannelRequest generates a "aws/request.Request" representing the +// client's request for the StopChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateInput for more information on using the UpdateInput +// See StopChannel for more information on using the StopChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateInputRequest method. -// req, resp := client.UpdateInputRequest(params) +// // Example sending a request using the StopChannelRequest method. +// req, resp := client.StopChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateInput -func (c *MediaLive) UpdateInputRequest(input *UpdateInputInput) (req *request.Request, output *UpdateInputOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/StopChannel +func (c *MediaLive) StopChannelRequest(input *StopChannelInput) (req *request.Request, output *StopChannelOutput) { op := &request.Operation{ - Name: opUpdateInput, - HTTPMethod: "PUT", - HTTPPath: "/prod/inputs/{inputId}", + Name: opStopChannel, + HTTPMethod: "POST", + HTTPPath: "/prod/channels/{channelId}/stop", } if input == nil { - input = &UpdateInputInput{} + input = &StopChannelInput{} } - output = &UpdateInputOutput{} + output = &StopChannelOutput{} req = c.newRequest(op, input, output) return } -// UpdateInput API operation for AWS Elemental MediaLive. +// StopChannel API operation for AWS Elemental MediaLive. // -// Updates an input. +// Stops a running channel // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Elemental MediaLive's -// API operation UpdateInput for usage and error information. +// API operation StopChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeConflictException "ConflictException" +// * TooManyRequestsException // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateInput -func (c *MediaLive) UpdateInput(input *UpdateInputInput) (*UpdateInputOutput, error) { - req, out := c.UpdateInputRequest(input) +// * ConflictException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/StopChannel +func (c *MediaLive) StopChannel(input *StopChannelInput) (*StopChannelOutput, error) { + req, out := c.StopChannelRequest(input) return out, req.Send() } -// UpdateInputWithContext is the same as UpdateInput with the addition of +// StopChannelWithContext is the same as StopChannel with the addition of // the ability to pass a context and additional request options. // -// See UpdateInput for details on how to use this API operation. +// See StopChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *MediaLive) UpdateInputWithContext(ctx aws.Context, input *UpdateInputInput, opts ...request.Option) (*UpdateInputOutput, error) { - req, out := c.UpdateInputRequest(input) +func (c *MediaLive) StopChannelWithContext(ctx aws.Context, input *StopChannelInput, opts ...request.Option) (*StopChannelOutput, error) { + req, out := c.StopChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateInputSecurityGroup = "UpdateInputSecurityGroup" +const opStopMultiplex = "StopMultiplex" -// UpdateInputSecurityGroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateInputSecurityGroup operation. The "output" return +// StopMultiplexRequest generates a "aws/request.Request" representing the +// client's request for the StopMultiplex operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateInputSecurityGroup for more information on using the UpdateInputSecurityGroup +// See StopMultiplex for more information on using the StopMultiplex // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateInputSecurityGroupRequest method. -// req, resp := client.UpdateInputSecurityGroupRequest(params) +// // Example sending a request using the StopMultiplexRequest method. +// req, resp := client.StopMultiplexRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateInputSecurityGroup -func (c *MediaLive) UpdateInputSecurityGroupRequest(input *UpdateInputSecurityGroupInput) (req *request.Request, output *UpdateInputSecurityGroupOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/StopMultiplex +func (c *MediaLive) StopMultiplexRequest(input *StopMultiplexInput) (req *request.Request, output *StopMultiplexOutput) { op := &request.Operation{ - Name: opUpdateInputSecurityGroup, - HTTPMethod: "PUT", - HTTPPath: "/prod/inputSecurityGroups/{inputSecurityGroupId}", + Name: opStopMultiplex, + HTTPMethod: "POST", + HTTPPath: "/prod/multiplexes/{multiplexId}/stop", } if input == nil { - input = &UpdateInputSecurityGroupInput{} + input = &StopMultiplexInput{} } - output = &UpdateInputSecurityGroupOutput{} + output = &StopMultiplexOutput{} req = c.newRequest(op, input, output) return } -// UpdateInputSecurityGroup API operation for AWS Elemental MediaLive. +// StopMultiplex API operation for AWS Elemental MediaLive. // -// Update an Input Security Group's Whilelists. +// Stops a running multiplex. If the multiplex isn't running, this action has +// no 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 AWS Elemental MediaLive's -// API operation UpdateInputSecurityGroup for usage and error information. +// API operation StopMultiplex for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * BadGatewayException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * GatewayTimeoutException // -// * ErrCodeConflictException "ConflictException" +// * TooManyRequestsException // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateInputSecurityGroup -func (c *MediaLive) UpdateInputSecurityGroup(input *UpdateInputSecurityGroupInput) (*UpdateInputSecurityGroupOutput, error) { - req, out := c.UpdateInputSecurityGroupRequest(input) +// * ConflictException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/StopMultiplex +func (c *MediaLive) StopMultiplex(input *StopMultiplexInput) (*StopMultiplexOutput, error) { + req, out := c.StopMultiplexRequest(input) return out, req.Send() } -// UpdateInputSecurityGroupWithContext is the same as UpdateInputSecurityGroup with the addition of +// StopMultiplexWithContext is the same as StopMultiplex with the addition of // the ability to pass a context and additional request options. // -// See UpdateInputSecurityGroup for details on how to use this API operation. +// See StopMultiplex for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *MediaLive) UpdateInputSecurityGroupWithContext(ctx aws.Context, input *UpdateInputSecurityGroupInput, opts ...request.Option) (*UpdateInputSecurityGroupOutput, error) { - req, out := c.UpdateInputSecurityGroupRequest(input) +func (c *MediaLive) StopMultiplexWithContext(ctx aws.Context, input *StopMultiplexInput, opts ...request.Option) (*StopMultiplexOutput, error) { + req, out := c.StopMultiplexRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateReservation = "UpdateReservation" +const opUpdateChannel = "UpdateChannel" -// UpdateReservationRequest generates a "aws/request.Request" representing the -// client's request for the UpdateReservation operation. The "output" return +// UpdateChannelRequest generates a "aws/request.Request" representing the +// client's request for the UpdateChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateReservation for more information on using the UpdateReservation +// See UpdateChannel for more information on using the UpdateChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateReservationRequest method. -// req, resp := client.UpdateReservationRequest(params) +// // Example sending a request using the UpdateChannelRequest method. +// req, resp := client.UpdateChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateReservation -func (c *MediaLive) UpdateReservationRequest(input *UpdateReservationInput) (req *request.Request, output *UpdateReservationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateChannel +func (c *MediaLive) UpdateChannelRequest(input *UpdateChannelInput) (req *request.Request, output *UpdateChannelOutput) { op := &request.Operation{ - Name: opUpdateReservation, + Name: opUpdateChannel, HTTPMethod: "PUT", - HTTPPath: "/prod/reservations/{reservationId}", + HTTPPath: "/prod/channels/{channelId}", } if input == nil { - input = &UpdateReservationInput{} + input = &UpdateChannelInput{} } - output = &UpdateReservationOutput{} + output = &UpdateChannelOutput{} req = c.newRequest(op, input, output) return } -// UpdateReservation API operation for AWS Elemental MediaLive. +// UpdateChannel API operation for AWS Elemental MediaLive. // -// Update reservation. +// Updates a channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Elemental MediaLive's -// API operation UpdateReservation for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// API operation UpdateChannel for usage and error information. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// Returned Error Types: +// * BadRequestException // -// * ErrCodeForbiddenException "ForbiddenException" +// * UnprocessableEntityException // -// * ErrCodeBadGatewayException "BadGatewayException" +// * InternalServerErrorException // -// * ErrCodeNotFoundException "NotFoundException" +// * ForbiddenException // -// * ErrCodeGatewayTimeoutException "GatewayTimeoutException" +// * BadGatewayException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * GatewayTimeoutException // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // -// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateReservation -func (c *MediaLive) UpdateReservation(input *UpdateReservationInput) (*UpdateReservationOutput, error) { - req, out := c.UpdateReservationRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateChannel +func (c *MediaLive) UpdateChannel(input *UpdateChannelInput) (*UpdateChannelOutput, error) { + req, out := c.UpdateChannelRequest(input) return out, req.Send() } -// UpdateReservationWithContext is the same as UpdateReservation with the addition of +// UpdateChannelWithContext is the same as UpdateChannel with the addition of // the ability to pass a context and additional request options. // -// See UpdateReservation for details on how to use this API operation. +// See UpdateChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *MediaLive) UpdateReservationWithContext(ctx aws.Context, input *UpdateReservationInput, opts ...request.Option) (*UpdateReservationOutput, error) { - req, out := c.UpdateReservationRequest(input) +func (c *MediaLive) UpdateChannelWithContext(ctx aws.Context, input *UpdateChannelInput, opts ...request.Option) (*UpdateChannelOutput, error) { + req, out := c.UpdateChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// Aac Settings -type AacSettings struct { - _ struct{} `type:"structure"` - - // Average bitrate in bits/second. Valid values depend on rate control mode - // and profile. - Bitrate *float64 `locationName:"bitrate" type:"double"` - - // Mono, Stereo, or 5.1 channel layout. Valid values depend on rate control - // mode and profile. The adReceiverMix setting receives a stereo description - // plus control track and emits a mono AAC encode of the description track, - // with control data emitted in the PES header as per ETSI TS 101 154 Annex - // E. - CodingMode *string `locationName:"codingMode" type:"string" enum:"AacCodingMode"` - - // Set to "broadcasterMixedAd" when input contains pre-mixed main audio + AD - // (narration) as a stereo pair. The Audio Type field (audioType) will be set - // to 3, which signals to downstream systems that this stream contains "broadcaster - // mixed AD". Note that the input received by the encoder must contain pre-mixed - // audio; the encoder does not perform the mixing. The values in audioTypeControl - // and audioType (in AudioDescription) are ignored when set to broadcasterMixedAd.Leave - // set to "normal" when input does not contain pre-mixed audio + AD. - InputType *string `locationName:"inputType" type:"string" enum:"AacInputType"` - - // AAC Profile. - Profile *string `locationName:"profile" type:"string" enum:"AacProfile"` +const opUpdateChannelClass = "UpdateChannelClass" - // Rate Control Mode. - RateControlMode *string `locationName:"rateControlMode" type:"string" enum:"AacRateControlMode"` +// UpdateChannelClassRequest generates a "aws/request.Request" representing the +// client's request for the UpdateChannelClass operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateChannelClass for more information on using the UpdateChannelClass +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateChannelClassRequest method. +// req, resp := client.UpdateChannelClassRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateChannelClass +func (c *MediaLive) UpdateChannelClassRequest(input *UpdateChannelClassInput) (req *request.Request, output *UpdateChannelClassOutput) { + op := &request.Operation{ + Name: opUpdateChannelClass, + HTTPMethod: "PUT", + HTTPPath: "/prod/channels/{channelId}/channelClass", + } - // Sets LATM / LOAS AAC output for raw containers. - RawFormat *string `locationName:"rawFormat" type:"string" enum:"AacRawFormat"` + if input == nil { + input = &UpdateChannelClassInput{} + } - // Sample rate in Hz. Valid values depend on rate control mode and profile. - SampleRate *float64 `locationName:"sampleRate" type:"double"` + output = &UpdateChannelClassOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateChannelClass API operation for AWS Elemental MediaLive. +// +// Changes the class of the channel. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Elemental MediaLive's +// API operation UpdateChannelClass for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// +// * UnprocessableEntityException +// +// * InternalServerErrorException +// +// * ForbiddenException +// +// * BadGatewayException +// +// * NotFoundException +// +// * GatewayTimeoutException +// +// * TooManyRequestsException +// +// * ConflictException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateChannelClass +func (c *MediaLive) UpdateChannelClass(input *UpdateChannelClassInput) (*UpdateChannelClassOutput, error) { + req, out := c.UpdateChannelClassRequest(input) + return out, req.Send() +} + +// UpdateChannelClassWithContext is the same as UpdateChannelClass with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateChannelClass for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MediaLive) UpdateChannelClassWithContext(ctx aws.Context, input *UpdateChannelClassInput, opts ...request.Option) (*UpdateChannelClassOutput, error) { + req, out := c.UpdateChannelClassRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateInput = "UpdateInput" + +// UpdateInputRequest generates a "aws/request.Request" representing the +// client's request for the UpdateInput operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateInput for more information on using the UpdateInput +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateInputRequest method. +// req, resp := client.UpdateInputRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateInput +func (c *MediaLive) UpdateInputRequest(input *UpdateInputInput) (req *request.Request, output *UpdateInputOutput) { + op := &request.Operation{ + Name: opUpdateInput, + HTTPMethod: "PUT", + HTTPPath: "/prod/inputs/{inputId}", + } + + if input == nil { + input = &UpdateInputInput{} + } + + output = &UpdateInputOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateInput API operation for AWS Elemental MediaLive. +// +// Updates an input. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Elemental MediaLive's +// API operation UpdateInput for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// +// * InternalServerErrorException +// +// * ForbiddenException +// +// * BadGatewayException +// +// * NotFoundException +// +// * GatewayTimeoutException +// +// * ConflictException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateInput +func (c *MediaLive) UpdateInput(input *UpdateInputInput) (*UpdateInputOutput, error) { + req, out := c.UpdateInputRequest(input) + return out, req.Send() +} + +// UpdateInputWithContext is the same as UpdateInput with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateInput for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MediaLive) UpdateInputWithContext(ctx aws.Context, input *UpdateInputInput, opts ...request.Option) (*UpdateInputOutput, error) { + req, out := c.UpdateInputRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateInputSecurityGroup = "UpdateInputSecurityGroup" + +// UpdateInputSecurityGroupRequest generates a "aws/request.Request" representing the +// client's request for the UpdateInputSecurityGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateInputSecurityGroup for more information on using the UpdateInputSecurityGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateInputSecurityGroupRequest method. +// req, resp := client.UpdateInputSecurityGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateInputSecurityGroup +func (c *MediaLive) UpdateInputSecurityGroupRequest(input *UpdateInputSecurityGroupInput) (req *request.Request, output *UpdateInputSecurityGroupOutput) { + op := &request.Operation{ + Name: opUpdateInputSecurityGroup, + HTTPMethod: "PUT", + HTTPPath: "/prod/inputSecurityGroups/{inputSecurityGroupId}", + } + + if input == nil { + input = &UpdateInputSecurityGroupInput{} + } + + output = &UpdateInputSecurityGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateInputSecurityGroup API operation for AWS Elemental MediaLive. +// +// Update an Input Security Group's Whilelists. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Elemental MediaLive's +// API operation UpdateInputSecurityGroup for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// +// * InternalServerErrorException +// +// * ForbiddenException +// +// * BadGatewayException +// +// * NotFoundException +// +// * GatewayTimeoutException +// +// * ConflictException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateInputSecurityGroup +func (c *MediaLive) UpdateInputSecurityGroup(input *UpdateInputSecurityGroupInput) (*UpdateInputSecurityGroupOutput, error) { + req, out := c.UpdateInputSecurityGroupRequest(input) + return out, req.Send() +} + +// UpdateInputSecurityGroupWithContext is the same as UpdateInputSecurityGroup with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateInputSecurityGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MediaLive) UpdateInputSecurityGroupWithContext(ctx aws.Context, input *UpdateInputSecurityGroupInput, opts ...request.Option) (*UpdateInputSecurityGroupOutput, error) { + req, out := c.UpdateInputSecurityGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateMultiplex = "UpdateMultiplex" + +// UpdateMultiplexRequest generates a "aws/request.Request" representing the +// client's request for the UpdateMultiplex operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateMultiplex for more information on using the UpdateMultiplex +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateMultiplexRequest method. +// req, resp := client.UpdateMultiplexRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateMultiplex +func (c *MediaLive) UpdateMultiplexRequest(input *UpdateMultiplexInput) (req *request.Request, output *UpdateMultiplexOutput) { + op := &request.Operation{ + Name: opUpdateMultiplex, + HTTPMethod: "PUT", + HTTPPath: "/prod/multiplexes/{multiplexId}", + } + + if input == nil { + input = &UpdateMultiplexInput{} + } + + output = &UpdateMultiplexOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateMultiplex API operation for AWS Elemental MediaLive. +// +// Updates a multiplex. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Elemental MediaLive's +// API operation UpdateMultiplex for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// +// * UnprocessableEntityException +// +// * InternalServerErrorException +// +// * ForbiddenException +// +// * BadGatewayException +// +// * NotFoundException +// +// * GatewayTimeoutException +// +// * ConflictException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateMultiplex +func (c *MediaLive) UpdateMultiplex(input *UpdateMultiplexInput) (*UpdateMultiplexOutput, error) { + req, out := c.UpdateMultiplexRequest(input) + return out, req.Send() +} + +// UpdateMultiplexWithContext is the same as UpdateMultiplex with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateMultiplex for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MediaLive) UpdateMultiplexWithContext(ctx aws.Context, input *UpdateMultiplexInput, opts ...request.Option) (*UpdateMultiplexOutput, error) { + req, out := c.UpdateMultiplexRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateMultiplexProgram = "UpdateMultiplexProgram" + +// UpdateMultiplexProgramRequest generates a "aws/request.Request" representing the +// client's request for the UpdateMultiplexProgram operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateMultiplexProgram for more information on using the UpdateMultiplexProgram +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateMultiplexProgramRequest method. +// req, resp := client.UpdateMultiplexProgramRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateMultiplexProgram +func (c *MediaLive) UpdateMultiplexProgramRequest(input *UpdateMultiplexProgramInput) (req *request.Request, output *UpdateMultiplexProgramOutput) { + op := &request.Operation{ + Name: opUpdateMultiplexProgram, + HTTPMethod: "PUT", + HTTPPath: "/prod/multiplexes/{multiplexId}/programs/{programName}", + } + + if input == nil { + input = &UpdateMultiplexProgramInput{} + } + + output = &UpdateMultiplexProgramOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateMultiplexProgram API operation for AWS Elemental MediaLive. +// +// Update a program in a multiplex. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Elemental MediaLive's +// API operation UpdateMultiplexProgram for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// +// * UnprocessableEntityException +// +// * InternalServerErrorException +// +// * ForbiddenException +// +// * BadGatewayException +// +// * NotFoundException +// +// * GatewayTimeoutException +// +// * ConflictException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateMultiplexProgram +func (c *MediaLive) UpdateMultiplexProgram(input *UpdateMultiplexProgramInput) (*UpdateMultiplexProgramOutput, error) { + req, out := c.UpdateMultiplexProgramRequest(input) + return out, req.Send() +} + +// UpdateMultiplexProgramWithContext is the same as UpdateMultiplexProgram with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateMultiplexProgram for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MediaLive) UpdateMultiplexProgramWithContext(ctx aws.Context, input *UpdateMultiplexProgramInput, opts ...request.Option) (*UpdateMultiplexProgramOutput, error) { + req, out := c.UpdateMultiplexProgramRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateReservation = "UpdateReservation" + +// UpdateReservationRequest generates a "aws/request.Request" representing the +// client's request for the UpdateReservation operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateReservation for more information on using the UpdateReservation +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateReservationRequest method. +// req, resp := client.UpdateReservationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateReservation +func (c *MediaLive) UpdateReservationRequest(input *UpdateReservationInput) (req *request.Request, output *UpdateReservationOutput) { + op := &request.Operation{ + Name: opUpdateReservation, + HTTPMethod: "PUT", + HTTPPath: "/prod/reservations/{reservationId}", + } + + if input == nil { + input = &UpdateReservationInput{} + } + + output = &UpdateReservationOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateReservation API operation for AWS Elemental MediaLive. +// +// Update reservation. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Elemental MediaLive's +// API operation UpdateReservation for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// +// * InternalServerErrorException +// +// * ForbiddenException +// +// * BadGatewayException +// +// * NotFoundException +// +// * GatewayTimeoutException +// +// * TooManyRequestsException +// +// * ConflictException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/medialive-2017-10-14/UpdateReservation +func (c *MediaLive) UpdateReservation(input *UpdateReservationInput) (*UpdateReservationOutput, error) { + req, out := c.UpdateReservationRequest(input) + return out, req.Send() +} + +// UpdateReservationWithContext is the same as UpdateReservation with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateReservation for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MediaLive) UpdateReservationWithContext(ctx aws.Context, input *UpdateReservationInput, opts ...request.Option) (*UpdateReservationOutput, error) { + req, out := c.UpdateReservationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Aac Settings +type AacSettings struct { + _ struct{} `type:"structure"` + + // Average bitrate in bits/second. Valid values depend on rate control mode + // and profile. + Bitrate *float64 `locationName:"bitrate" type:"double"` + + // Mono, Stereo, or 5.1 channel layout. Valid values depend on rate control + // mode and profile. The adReceiverMix setting receives a stereo description + // plus control track and emits a mono AAC encode of the description track, + // with control data emitted in the PES header as per ETSI TS 101 154 Annex + // E. + CodingMode *string `locationName:"codingMode" type:"string" enum:"AacCodingMode"` + + // Set to "broadcasterMixedAd" when input contains pre-mixed main audio + AD + // (narration) as a stereo pair. The Audio Type field (audioType) will be set + // to 3, which signals to downstream systems that this stream contains "broadcaster + // mixed AD". Note that the input received by the encoder must contain pre-mixed + // audio; the encoder does not perform the mixing. The values in audioTypeControl + // and audioType (in AudioDescription) are ignored when set to broadcasterMixedAd.Leave + // set to "normal" when input does not contain pre-mixed audio + AD. + InputType *string `locationName:"inputType" type:"string" enum:"AacInputType"` + + // AAC Profile. + Profile *string `locationName:"profile" type:"string" enum:"AacProfile"` + + // Rate Control Mode. + RateControlMode *string `locationName:"rateControlMode" type:"string" enum:"AacRateControlMode"` + + // Sets LATM / LOAS AAC output for raw containers. + RawFormat *string `locationName:"rawFormat" type:"string" enum:"AacRawFormat"` + + // Sample rate in Hz. Valid values depend on rate control mode and profile. + SampleRate *float64 `locationName:"sampleRate" type:"double"` // Use MPEG-2 AAC audio instead of MPEG-4 AAC audio for raw or MPEG-2 Transport // Stream containers. Spec *string `locationName:"spec" type:"string" enum:"AacSpec"` - // VBR Quality Level - Only used if rateControlMode is VBR. - VbrQuality *string `locationName:"vbrQuality" type:"string" enum:"AacVbrQuality"` + // VBR Quality Level - Only used if rateControlMode is VBR. + VbrQuality *string `locationName:"vbrQuality" type:"string" enum:"AacVbrQuality"` +} + +// String returns the string representation +func (s AacSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AacSettings) GoString() string { + return s.String() +} + +// SetBitrate sets the Bitrate field's value. +func (s *AacSettings) SetBitrate(v float64) *AacSettings { + s.Bitrate = &v + return s +} + +// SetCodingMode sets the CodingMode field's value. +func (s *AacSettings) SetCodingMode(v string) *AacSettings { + s.CodingMode = &v + return s +} + +// SetInputType sets the InputType field's value. +func (s *AacSettings) SetInputType(v string) *AacSettings { + s.InputType = &v + return s +} + +// SetProfile sets the Profile field's value. +func (s *AacSettings) SetProfile(v string) *AacSettings { + s.Profile = &v + return s +} + +// SetRateControlMode sets the RateControlMode field's value. +func (s *AacSettings) SetRateControlMode(v string) *AacSettings { + s.RateControlMode = &v + return s +} + +// SetRawFormat sets the RawFormat field's value. +func (s *AacSettings) SetRawFormat(v string) *AacSettings { + s.RawFormat = &v + return s +} + +// SetSampleRate sets the SampleRate field's value. +func (s *AacSettings) SetSampleRate(v float64) *AacSettings { + s.SampleRate = &v + return s +} + +// SetSpec sets the Spec field's value. +func (s *AacSettings) SetSpec(v string) *AacSettings { + s.Spec = &v + return s +} + +// SetVbrQuality sets the VbrQuality field's value. +func (s *AacSettings) SetVbrQuality(v string) *AacSettings { + s.VbrQuality = &v + return s +} + +// Ac3 Settings +type Ac3Settings struct { + _ struct{} `type:"structure"` + + // Average bitrate in bits/second. Valid bitrates depend on the coding mode. + Bitrate *float64 `locationName:"bitrate" type:"double"` + + // Specifies the bitstream mode (bsmod) for the emitted AC-3 stream. See ATSC + // A/52-2012 for background on these values. + BitstreamMode *string `locationName:"bitstreamMode" type:"string" enum:"Ac3BitstreamMode"` + + // Dolby Digital coding mode. Determines number of channels. + CodingMode *string `locationName:"codingMode" type:"string" enum:"Ac3CodingMode"` + + // Sets the dialnorm for the output. If excluded and input audio is Dolby Digital, + // dialnorm will be passed through. + Dialnorm *int64 `locationName:"dialnorm" min:"1" type:"integer"` + + // If set to filmStandard, adds dynamic range compression signaling to the output + // bitstream as defined in the Dolby Digital specification. + DrcProfile *string `locationName:"drcProfile" type:"string" enum:"Ac3DrcProfile"` + + // When set to enabled, applies a 120Hz lowpass filter to the LFE channel prior + // to encoding. Only valid in codingMode32Lfe mode. + LfeFilter *string `locationName:"lfeFilter" type:"string" enum:"Ac3LfeFilter"` + + // When set to "followInput", encoder metadata will be sourced from the DD, + // DD+, or DolbyE decoder that supplied this audio data. If audio was not supplied + // from one of these streams, then the static metadata settings will be used. + MetadataControl *string `locationName:"metadataControl" type:"string" enum:"Ac3MetadataControl"` +} + +// String returns the string representation +func (s Ac3Settings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Ac3Settings) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Ac3Settings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Ac3Settings"} + if s.Dialnorm != nil && *s.Dialnorm < 1 { + invalidParams.Add(request.NewErrParamMinValue("Dialnorm", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBitrate sets the Bitrate field's value. +func (s *Ac3Settings) SetBitrate(v float64) *Ac3Settings { + s.Bitrate = &v + return s +} + +// SetBitstreamMode sets the BitstreamMode field's value. +func (s *Ac3Settings) SetBitstreamMode(v string) *Ac3Settings { + s.BitstreamMode = &v + return s +} + +// SetCodingMode sets the CodingMode field's value. +func (s *Ac3Settings) SetCodingMode(v string) *Ac3Settings { + s.CodingMode = &v + return s +} + +// SetDialnorm sets the Dialnorm field's value. +func (s *Ac3Settings) SetDialnorm(v int64) *Ac3Settings { + s.Dialnorm = &v + return s +} + +// SetDrcProfile sets the DrcProfile field's value. +func (s *Ac3Settings) SetDrcProfile(v string) *Ac3Settings { + s.DrcProfile = &v + return s +} + +// SetLfeFilter sets the LfeFilter field's value. +func (s *Ac3Settings) SetLfeFilter(v string) *Ac3Settings { + s.LfeFilter = &v + return s +} + +// SetMetadataControl sets the MetadataControl field's value. +func (s *Ac3Settings) SetMetadataControl(v string) *Ac3Settings { + s.MetadataControl = &v + return s +} + +// Archive Container Settings +type ArchiveContainerSettings struct { + _ struct{} `type:"structure"` + + // M2ts Settings + M2tsSettings *M2tsSettings `locationName:"m2tsSettings" type:"structure"` +} + +// String returns the string representation +func (s ArchiveContainerSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ArchiveContainerSettings) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ArchiveContainerSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ArchiveContainerSettings"} + if s.M2tsSettings != nil { + if err := s.M2tsSettings.Validate(); err != nil { + invalidParams.AddNested("M2tsSettings", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetM2tsSettings sets the M2tsSettings field's value. +func (s *ArchiveContainerSettings) SetM2tsSettings(v *M2tsSettings) *ArchiveContainerSettings { + s.M2tsSettings = v + return s +} + +// Archive Group Settings +type ArchiveGroupSettings struct { + _ struct{} `type:"structure"` + + // A directory and base filename where archive files should be written. + // + // Destination is a required field + Destination *OutputLocationRef `locationName:"destination" type:"structure" required:"true"` + + // Number of seconds to write to archive file before closing and starting a + // new one. + RolloverInterval *int64 `locationName:"rolloverInterval" min:"1" type:"integer"` +} + +// String returns the string representation +func (s ArchiveGroupSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ArchiveGroupSettings) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ArchiveGroupSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ArchiveGroupSettings"} + if s.Destination == nil { + invalidParams.Add(request.NewErrParamRequired("Destination")) + } + if s.RolloverInterval != nil && *s.RolloverInterval < 1 { + invalidParams.Add(request.NewErrParamMinValue("RolloverInterval", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDestination sets the Destination field's value. +func (s *ArchiveGroupSettings) SetDestination(v *OutputLocationRef) *ArchiveGroupSettings { + s.Destination = v + return s +} + +// SetRolloverInterval sets the RolloverInterval field's value. +func (s *ArchiveGroupSettings) SetRolloverInterval(v int64) *ArchiveGroupSettings { + s.RolloverInterval = &v + return s +} + +// Archive Output Settings +type ArchiveOutputSettings struct { + _ struct{} `type:"structure"` + + // Settings specific to the container type of the file. + // + // ContainerSettings is a required field + ContainerSettings *ArchiveContainerSettings `locationName:"containerSettings" type:"structure" required:"true"` + + // Output file extension. If excluded, this will be auto-selected from the container + // type. + Extension *string `locationName:"extension" type:"string"` + + // String concatenated to the end of the destination filename. Required for + // multiple outputs of the same type. + NameModifier *string `locationName:"nameModifier" type:"string"` +} + +// String returns the string representation +func (s ArchiveOutputSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ArchiveOutputSettings) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ArchiveOutputSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ArchiveOutputSettings"} + if s.ContainerSettings == nil { + invalidParams.Add(request.NewErrParamRequired("ContainerSettings")) + } + if s.ContainerSettings != nil { + if err := s.ContainerSettings.Validate(); err != nil { + invalidParams.AddNested("ContainerSettings", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetContainerSettings sets the ContainerSettings field's value. +func (s *ArchiveOutputSettings) SetContainerSettings(v *ArchiveContainerSettings) *ArchiveOutputSettings { + s.ContainerSettings = v + return s +} + +// SetExtension sets the Extension field's value. +func (s *ArchiveOutputSettings) SetExtension(v string) *ArchiveOutputSettings { + s.Extension = &v + return s +} + +// SetNameModifier sets the NameModifier field's value. +func (s *ArchiveOutputSettings) SetNameModifier(v string) *ArchiveOutputSettings { + s.NameModifier = &v + return s +} + +// Arib Destination Settings +type AribDestinationSettings struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AribDestinationSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AribDestinationSettings) GoString() string { + return s.String() +} + +// Arib Source Settings +type AribSourceSettings struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AribSourceSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AribSourceSettings) GoString() string { + return s.String() +} + +// Audio Channel Mapping +type AudioChannelMapping struct { + _ struct{} `type:"structure"` + + // Indices and gain values for each input channel that should be remixed into + // this output channel. + // + // InputChannelLevels is a required field + InputChannelLevels []*InputChannelLevel `locationName:"inputChannelLevels" type:"list" required:"true"` + + // The index of the output channel being produced. + // + // OutputChannel is a required field + OutputChannel *int64 `locationName:"outputChannel" type:"integer" required:"true"` +} + +// String returns the string representation +func (s AudioChannelMapping) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AudioChannelMapping) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AudioChannelMapping) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AudioChannelMapping"} + if s.InputChannelLevels == nil { + invalidParams.Add(request.NewErrParamRequired("InputChannelLevels")) + } + if s.OutputChannel == nil { + invalidParams.Add(request.NewErrParamRequired("OutputChannel")) + } + if s.InputChannelLevels != nil { + for i, v := range s.InputChannelLevels { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputChannelLevels", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInputChannelLevels sets the InputChannelLevels field's value. +func (s *AudioChannelMapping) SetInputChannelLevels(v []*InputChannelLevel) *AudioChannelMapping { + s.InputChannelLevels = v + return s +} + +// SetOutputChannel sets the OutputChannel field's value. +func (s *AudioChannelMapping) SetOutputChannel(v int64) *AudioChannelMapping { + s.OutputChannel = &v + return s +} + +// Audio Codec Settings +type AudioCodecSettings struct { + _ struct{} `type:"structure"` + + // Aac Settings + AacSettings *AacSettings `locationName:"aacSettings" type:"structure"` + + // Ac3 Settings + Ac3Settings *Ac3Settings `locationName:"ac3Settings" type:"structure"` + + // Eac3 Settings + Eac3Settings *Eac3Settings `locationName:"eac3Settings" type:"structure"` + + // Mp2 Settings + Mp2Settings *Mp2Settings `locationName:"mp2Settings" type:"structure"` + + // Pass Through Settings + PassThroughSettings *PassThroughSettings `locationName:"passThroughSettings" type:"structure"` +} + +// String returns the string representation +func (s AudioCodecSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AudioCodecSettings) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AudioCodecSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AudioCodecSettings"} + if s.Ac3Settings != nil { + if err := s.Ac3Settings.Validate(); err != nil { + invalidParams.AddNested("Ac3Settings", err.(request.ErrInvalidParams)) + } + } + if s.Eac3Settings != nil { + if err := s.Eac3Settings.Validate(); err != nil { + invalidParams.AddNested("Eac3Settings", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAacSettings sets the AacSettings field's value. +func (s *AudioCodecSettings) SetAacSettings(v *AacSettings) *AudioCodecSettings { + s.AacSettings = v + return s +} + +// SetAc3Settings sets the Ac3Settings field's value. +func (s *AudioCodecSettings) SetAc3Settings(v *Ac3Settings) *AudioCodecSettings { + s.Ac3Settings = v + return s +} + +// SetEac3Settings sets the Eac3Settings field's value. +func (s *AudioCodecSettings) SetEac3Settings(v *Eac3Settings) *AudioCodecSettings { + s.Eac3Settings = v + return s +} + +// SetMp2Settings sets the Mp2Settings field's value. +func (s *AudioCodecSettings) SetMp2Settings(v *Mp2Settings) *AudioCodecSettings { + s.Mp2Settings = v + return s +} + +// SetPassThroughSettings sets the PassThroughSettings field's value. +func (s *AudioCodecSettings) SetPassThroughSettings(v *PassThroughSettings) *AudioCodecSettings { + s.PassThroughSettings = v + return s +} + +// Audio Description +type AudioDescription struct { + _ struct{} `type:"structure"` + + // Advanced audio normalization settings. + AudioNormalizationSettings *AudioNormalizationSettings `locationName:"audioNormalizationSettings" type:"structure"` + + // The name of the AudioSelector used as the source for this AudioDescription. + // + // AudioSelectorName is a required field + AudioSelectorName *string `locationName:"audioSelectorName" type:"string" required:"true"` + + // Applies only if audioTypeControl is useConfigured. The values for audioType + // are defined in ISO-IEC 13818-1. + AudioType *string `locationName:"audioType" type:"string" enum:"AudioType"` + + // Determines how audio type is determined. followInput: If the input contains + // an ISO 639 audioType, then that value is passed through to the output. If + // the input contains no ISO 639 audioType, the value in Audio Type is included + // in the output. useConfigured: The value in Audio Type is included in the + // output.Note that this field and audioType are both ignored if inputType is + // broadcasterMixedAd. + AudioTypeControl *string `locationName:"audioTypeControl" type:"string" enum:"AudioDescriptionAudioTypeControl"` + + // Audio codec settings. + CodecSettings *AudioCodecSettings `locationName:"codecSettings" type:"structure"` + + // Indicates the language of the audio output track. Only used if languageControlMode + // is useConfigured, or there is no ISO 639 language code specified in the input. + LanguageCode *string `locationName:"languageCode" min:"3" type:"string"` + + // Choosing followInput will cause the ISO 639 language code of the output to + // follow the ISO 639 language code of the input. The languageCode will be used + // when useConfigured is set, or when followInput is selected but there is no + // ISO 639 language code specified by the input. + LanguageCodeControl *string `locationName:"languageCodeControl" type:"string" enum:"AudioDescriptionLanguageCodeControl"` + + // The name of this AudioDescription. Outputs will use this name to uniquely + // identify this AudioDescription. Description names should be unique within + // this Live Event. + // + // Name is a required field + Name *string `locationName:"name" type:"string" required:"true"` + + // Settings that control how input audio channels are remixed into the output + // audio channels. + RemixSettings *RemixSettings `locationName:"remixSettings" type:"structure"` + + // Used for MS Smooth and Apple HLS outputs. Indicates the name displayed by + // the player (eg. English, or Director Commentary). + StreamName *string `locationName:"streamName" type:"string"` +} + +// String returns the string representation +func (s AudioDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AudioDescription) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AudioDescription) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AudioDescription"} + if s.AudioSelectorName == nil { + invalidParams.Add(request.NewErrParamRequired("AudioSelectorName")) + } + if s.LanguageCode != nil && len(*s.LanguageCode) < 3 { + invalidParams.Add(request.NewErrParamMinLen("LanguageCode", 3)) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.CodecSettings != nil { + if err := s.CodecSettings.Validate(); err != nil { + invalidParams.AddNested("CodecSettings", err.(request.ErrInvalidParams)) + } + } + if s.RemixSettings != nil { + if err := s.RemixSettings.Validate(); err != nil { + invalidParams.AddNested("RemixSettings", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAudioNormalizationSettings sets the AudioNormalizationSettings field's value. +func (s *AudioDescription) SetAudioNormalizationSettings(v *AudioNormalizationSettings) *AudioDescription { + s.AudioNormalizationSettings = v + return s +} + +// SetAudioSelectorName sets the AudioSelectorName field's value. +func (s *AudioDescription) SetAudioSelectorName(v string) *AudioDescription { + s.AudioSelectorName = &v + return s +} + +// SetAudioType sets the AudioType field's value. +func (s *AudioDescription) SetAudioType(v string) *AudioDescription { + s.AudioType = &v + return s +} + +// SetAudioTypeControl sets the AudioTypeControl field's value. +func (s *AudioDescription) SetAudioTypeControl(v string) *AudioDescription { + s.AudioTypeControl = &v + return s +} + +// SetCodecSettings sets the CodecSettings field's value. +func (s *AudioDescription) SetCodecSettings(v *AudioCodecSettings) *AudioDescription { + s.CodecSettings = v + return s +} + +// SetLanguageCode sets the LanguageCode field's value. +func (s *AudioDescription) SetLanguageCode(v string) *AudioDescription { + s.LanguageCode = &v + return s +} + +// SetLanguageCodeControl sets the LanguageCodeControl field's value. +func (s *AudioDescription) SetLanguageCodeControl(v string) *AudioDescription { + s.LanguageCodeControl = &v + return s +} + +// SetName sets the Name field's value. +func (s *AudioDescription) SetName(v string) *AudioDescription { + s.Name = &v + return s +} + +// SetRemixSettings sets the RemixSettings field's value. +func (s *AudioDescription) SetRemixSettings(v *RemixSettings) *AudioDescription { + s.RemixSettings = v + return s +} + +// SetStreamName sets the StreamName field's value. +func (s *AudioDescription) SetStreamName(v string) *AudioDescription { + s.StreamName = &v + return s +} + +// Audio Language Selection +type AudioLanguageSelection struct { + _ struct{} `type:"structure"` + + // Selects a specific three-letter language code from within an audio source. + // + // LanguageCode is a required field + LanguageCode *string `locationName:"languageCode" type:"string" required:"true"` + + // When set to "strict", the transport stream demux strictly identifies audio + // streams by their language descriptor. If a PMT update occurs such that an + // audio stream matching the initially selected language is no longer present + // then mute will be encoded until the language returns. If "loose", then on + // a PMT update the demux will choose another audio stream in the program with + // the same stream type if it can't find one with the same language. + LanguageSelectionPolicy *string `locationName:"languageSelectionPolicy" type:"string" enum:"AudioLanguageSelectionPolicy"` +} + +// String returns the string representation +func (s AudioLanguageSelection) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AudioLanguageSelection) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AudioLanguageSelection) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AudioLanguageSelection"} + if s.LanguageCode == nil { + invalidParams.Add(request.NewErrParamRequired("LanguageCode")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLanguageCode sets the LanguageCode field's value. +func (s *AudioLanguageSelection) SetLanguageCode(v string) *AudioLanguageSelection { + s.LanguageCode = &v + return s +} + +// SetLanguageSelectionPolicy sets the LanguageSelectionPolicy field's value. +func (s *AudioLanguageSelection) SetLanguageSelectionPolicy(v string) *AudioLanguageSelection { + s.LanguageSelectionPolicy = &v + return s +} + +// Audio Normalization Settings +type AudioNormalizationSettings struct { + _ struct{} `type:"structure"` + + // Audio normalization algorithm to use. itu17701 conforms to the CALM Act specification, + // itu17702 conforms to the EBU R-128 specification. + Algorithm *string `locationName:"algorithm" type:"string" enum:"AudioNormalizationAlgorithm"` + + // When set to correctAudio the output audio is corrected using the chosen algorithm. + // If set to measureOnly, the audio will be measured but not adjusted. + AlgorithmControl *string `locationName:"algorithmControl" type:"string" enum:"AudioNormalizationAlgorithmControl"` + + // Target LKFS(loudness) to adjust volume to. If no value is entered, a default + // value will be used according to the chosen algorithm. The CALM Act (1770-1) + // recommends a target of -24 LKFS. The EBU R-128 specification (1770-2) recommends + // a target of -23 LKFS. + TargetLkfs *float64 `locationName:"targetLkfs" type:"double"` +} + +// String returns the string representation +func (s AudioNormalizationSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AudioNormalizationSettings) GoString() string { + return s.String() +} + +// SetAlgorithm sets the Algorithm field's value. +func (s *AudioNormalizationSettings) SetAlgorithm(v string) *AudioNormalizationSettings { + s.Algorithm = &v + return s +} + +// SetAlgorithmControl sets the AlgorithmControl field's value. +func (s *AudioNormalizationSettings) SetAlgorithmControl(v string) *AudioNormalizationSettings { + s.AlgorithmControl = &v + return s +} + +// SetTargetLkfs sets the TargetLkfs field's value. +func (s *AudioNormalizationSettings) SetTargetLkfs(v float64) *AudioNormalizationSettings { + s.TargetLkfs = &v + return s +} + +// Audio Only Hls Settings +type AudioOnlyHlsSettings struct { + _ struct{} `type:"structure"` + + // Specifies the group to which the audio Rendition belongs. + AudioGroupId *string `locationName:"audioGroupId" type:"string"` + + // Optional. Specifies the .jpg or .png image to use as the cover art for an + // audio-only output. We recommend a low bit-size file because the image increases + // the output audio bandwidth.The image is attached to the audio as an ID3 tag, + // frame type APIC, picture type 0x10, as per the "ID3 tag version 2.4.0 - Native + // Frames" standard. + AudioOnlyImage *InputLocation `locationName:"audioOnlyImage" type:"structure"` + + // Four types of audio-only tracks are supported:Audio-Only Variant StreamThe + // client can play back this audio-only stream instead of video in low-bandwidth + // scenarios. Represented as an EXT-X-STREAM-INF in the HLS manifest.Alternate + // Audio, Auto Select, DefaultAlternate rendition that the client should try + // to play back by default. Represented as an EXT-X-MEDIA in the HLS manifest + // with DEFAULT=YES, AUTOSELECT=YESAlternate Audio, Auto Select, Not DefaultAlternate + // rendition that the client may try to play back by default. Represented as + // an EXT-X-MEDIA in the HLS manifest with DEFAULT=NO, AUTOSELECT=YESAlternate + // Audio, not Auto SelectAlternate rendition that the client will not try to + // play back by default. Represented as an EXT-X-MEDIA in the HLS manifest with + // DEFAULT=NO, AUTOSELECT=NO + AudioTrackType *string `locationName:"audioTrackType" type:"string" enum:"AudioOnlyHlsTrackType"` + + // Specifies the segment type. + SegmentType *string `locationName:"segmentType" type:"string" enum:"AudioOnlyHlsSegmentType"` +} + +// String returns the string representation +func (s AudioOnlyHlsSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AudioOnlyHlsSettings) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AudioOnlyHlsSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AudioOnlyHlsSettings"} + if s.AudioOnlyImage != nil { + if err := s.AudioOnlyImage.Validate(); err != nil { + invalidParams.AddNested("AudioOnlyImage", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAudioGroupId sets the AudioGroupId field's value. +func (s *AudioOnlyHlsSettings) SetAudioGroupId(v string) *AudioOnlyHlsSettings { + s.AudioGroupId = &v + return s +} + +// SetAudioOnlyImage sets the AudioOnlyImage field's value. +func (s *AudioOnlyHlsSettings) SetAudioOnlyImage(v *InputLocation) *AudioOnlyHlsSettings { + s.AudioOnlyImage = v + return s +} + +// SetAudioTrackType sets the AudioTrackType field's value. +func (s *AudioOnlyHlsSettings) SetAudioTrackType(v string) *AudioOnlyHlsSettings { + s.AudioTrackType = &v + return s +} + +// SetSegmentType sets the SegmentType field's value. +func (s *AudioOnlyHlsSettings) SetSegmentType(v string) *AudioOnlyHlsSettings { + s.SegmentType = &v + return s +} + +// Audio Pid Selection +type AudioPidSelection struct { + _ struct{} `type:"structure"` + + // Selects a specific PID from within a source. + // + // Pid is a required field + Pid *int64 `locationName:"pid" type:"integer" required:"true"` +} + +// String returns the string representation +func (s AudioPidSelection) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AudioPidSelection) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AudioPidSelection) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AudioPidSelection"} + if s.Pid == nil { + invalidParams.Add(request.NewErrParamRequired("Pid")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPid sets the Pid field's value. +func (s *AudioPidSelection) SetPid(v int64) *AudioPidSelection { + s.Pid = &v + return s +} + +// Audio Selector +type AudioSelector struct { + _ struct{} `type:"structure"` + + // The name of this AudioSelector. AudioDescriptions will use this name to uniquely + // identify this Selector. Selector names should be unique per input. + // + // Name is a required field + Name *string `locationName:"name" min:"1" type:"string" required:"true"` + + // The audio selector settings. + SelectorSettings *AudioSelectorSettings `locationName:"selectorSettings" type:"structure"` +} + +// String returns the string representation +func (s AudioSelector) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AudioSelector) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AudioSelector) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AudioSelector"} + 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.SelectorSettings != nil { + if err := s.SelectorSettings.Validate(); err != nil { + invalidParams.AddNested("SelectorSettings", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *AudioSelector) SetName(v string) *AudioSelector { + s.Name = &v + return s +} + +// SetSelectorSettings sets the SelectorSettings field's value. +func (s *AudioSelector) SetSelectorSettings(v *AudioSelectorSettings) *AudioSelector { + s.SelectorSettings = v + return s +} + +// Audio Selector Settings +type AudioSelectorSettings struct { + _ struct{} `type:"structure"` + + // Audio Language Selection + AudioLanguageSelection *AudioLanguageSelection `locationName:"audioLanguageSelection" type:"structure"` + + // Audio Pid Selection + AudioPidSelection *AudioPidSelection `locationName:"audioPidSelection" type:"structure"` +} + +// String returns the string representation +func (s AudioSelectorSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AudioSelectorSettings) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AudioSelectorSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AudioSelectorSettings"} + if s.AudioLanguageSelection != nil { + if err := s.AudioLanguageSelection.Validate(); err != nil { + invalidParams.AddNested("AudioLanguageSelection", err.(request.ErrInvalidParams)) + } + } + if s.AudioPidSelection != nil { + if err := s.AudioPidSelection.Validate(); err != nil { + invalidParams.AddNested("AudioPidSelection", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAudioLanguageSelection sets the AudioLanguageSelection field's value. +func (s *AudioSelectorSettings) SetAudioLanguageSelection(v *AudioLanguageSelection) *AudioSelectorSettings { + s.AudioLanguageSelection = v + return s +} + +// SetAudioPidSelection sets the AudioPidSelection field's value. +func (s *AudioSelectorSettings) SetAudioPidSelection(v *AudioPidSelection) *AudioSelectorSettings { + s.AudioPidSelection = v + return s +} + +// Avail Blanking +type AvailBlanking struct { + _ struct{} `type:"structure"` + + // Blanking image to be used. Leave empty for solid black. Only bmp and png + // images are supported. + AvailBlankingImage *InputLocation `locationName:"availBlankingImage" type:"structure"` + + // When set to enabled, causes video, audio and captions to be blanked when + // insertion metadata is added. + State *string `locationName:"state" type:"string" enum:"AvailBlankingState"` +} + +// String returns the string representation +func (s AvailBlanking) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AvailBlanking) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AvailBlanking) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AvailBlanking"} + if s.AvailBlankingImage != nil { + if err := s.AvailBlankingImage.Validate(); err != nil { + invalidParams.AddNested("AvailBlankingImage", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAvailBlankingImage sets the AvailBlankingImage field's value. +func (s *AvailBlanking) SetAvailBlankingImage(v *InputLocation) *AvailBlanking { + s.AvailBlankingImage = v + return s +} + +// SetState sets the State field's value. +func (s *AvailBlanking) SetState(v string) *AvailBlanking { + s.State = &v + return s +} + +// Avail Configuration +type AvailConfiguration struct { + _ struct{} `type:"structure"` + + // Ad avail settings. + AvailSettings *AvailSettings `locationName:"availSettings" type:"structure"` +} + +// String returns the string representation +func (s AvailConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AvailConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AvailConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AvailConfiguration"} + if s.AvailSettings != nil { + if err := s.AvailSettings.Validate(); err != nil { + invalidParams.AddNested("AvailSettings", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAvailSettings sets the AvailSettings field's value. +func (s *AvailConfiguration) SetAvailSettings(v *AvailSettings) *AvailConfiguration { + s.AvailSettings = v + return s +} + +// Avail Settings +type AvailSettings struct { + _ struct{} `type:"structure"` + + // Scte35 Splice Insert + Scte35SpliceInsert *Scte35SpliceInsert `locationName:"scte35SpliceInsert" type:"structure"` + + // Scte35 Time Signal Apos + Scte35TimeSignalApos *Scte35TimeSignalApos `locationName:"scte35TimeSignalApos" type:"structure"` +} + +// String returns the string representation +func (s AvailSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AvailSettings) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AvailSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AvailSettings"} + if s.Scte35SpliceInsert != nil { + if err := s.Scte35SpliceInsert.Validate(); err != nil { + invalidParams.AddNested("Scte35SpliceInsert", err.(request.ErrInvalidParams)) + } + } + if s.Scte35TimeSignalApos != nil { + if err := s.Scte35TimeSignalApos.Validate(); err != nil { + invalidParams.AddNested("Scte35TimeSignalApos", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetScte35SpliceInsert sets the Scte35SpliceInsert field's value. +func (s *AvailSettings) SetScte35SpliceInsert(v *Scte35SpliceInsert) *AvailSettings { + s.Scte35SpliceInsert = v + return s +} + +// SetScte35TimeSignalApos sets the Scte35TimeSignalApos field's value. +func (s *AvailSettings) SetScte35TimeSignalApos(v *Scte35TimeSignalApos) *AvailSettings { + s.Scte35TimeSignalApos = v + return s +} + +type BadGatewayException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BadGatewayException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadGatewayException) GoString() string { + return s.String() +} + +func newErrorBadGatewayException(v protocol.ResponseMetadata) error { + return &BadGatewayException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadGatewayException) Code() string { + return "BadGatewayException" +} + +// Message returns the exception's message. +func (s BadGatewayException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadGatewayException) OrigErr() error { + return nil +} + +func (s BadGatewayException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadGatewayException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadGatewayException) RequestID() string { + return s.respMetadata.RequestID +} + +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// A list of schedule actions to create (in a request) or that have been created +// (in a response). +type BatchScheduleActionCreateRequest struct { + _ struct{} `type:"structure"` + + // A list of schedule actions to create. + // + // ScheduleActions is a required field + ScheduleActions []*ScheduleAction `locationName:"scheduleActions" type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchScheduleActionCreateRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchScheduleActionCreateRequest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchScheduleActionCreateRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchScheduleActionCreateRequest"} + if s.ScheduleActions == nil { + invalidParams.Add(request.NewErrParamRequired("ScheduleActions")) + } + if s.ScheduleActions != nil { + for i, v := range s.ScheduleActions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ScheduleActions", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetScheduleActions sets the ScheduleActions field's value. +func (s *BatchScheduleActionCreateRequest) SetScheduleActions(v []*ScheduleAction) *BatchScheduleActionCreateRequest { + s.ScheduleActions = v + return s +} + +// List of actions that have been created in the schedule. +type BatchScheduleActionCreateResult struct { + _ struct{} `type:"structure"` + + // List of actions that have been created in the schedule. + // + // ScheduleActions is a required field + ScheduleActions []*ScheduleAction `locationName:"scheduleActions" type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchScheduleActionCreateResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchScheduleActionCreateResult) GoString() string { + return s.String() +} + +// SetScheduleActions sets the ScheduleActions field's value. +func (s *BatchScheduleActionCreateResult) SetScheduleActions(v []*ScheduleAction) *BatchScheduleActionCreateResult { + s.ScheduleActions = v + return s +} + +// A list of schedule actions to delete. +type BatchScheduleActionDeleteRequest struct { + _ struct{} `type:"structure"` + + // A list of schedule actions to delete. + // + // ActionNames is a required field + ActionNames []*string `locationName:"actionNames" type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchScheduleActionDeleteRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchScheduleActionDeleteRequest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchScheduleActionDeleteRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchScheduleActionDeleteRequest"} + if s.ActionNames == nil { + invalidParams.Add(request.NewErrParamRequired("ActionNames")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetActionNames sets the ActionNames field's value. +func (s *BatchScheduleActionDeleteRequest) SetActionNames(v []*string) *BatchScheduleActionDeleteRequest { + s.ActionNames = v + return s +} + +// List of actions that have been deleted from the schedule. +type BatchScheduleActionDeleteResult struct { + _ struct{} `type:"structure"` + + // List of actions that have been deleted from the schedule. + // + // ScheduleActions is a required field + ScheduleActions []*ScheduleAction `locationName:"scheduleActions" type:"list" required:"true"` +} + +// String returns the string representation +func (s BatchScheduleActionDeleteResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchScheduleActionDeleteResult) GoString() string { + return s.String() +} + +// SetScheduleActions sets the ScheduleActions field's value. +func (s *BatchScheduleActionDeleteResult) SetScheduleActions(v []*ScheduleAction) *BatchScheduleActionDeleteResult { + s.ScheduleActions = v + return s +} + +// A request to create actions (add actions to the schedule), delete actions +// (remove actions from the schedule), or both create and delete actions. +type BatchUpdateScheduleInput struct { + _ struct{} `type:"structure"` + + // ChannelId is a required field + ChannelId *string `location:"uri" locationName:"channelId" type:"string" required:"true"` + + // Schedule actions to create in the schedule. + Creates *BatchScheduleActionCreateRequest `locationName:"creates" type:"structure"` + + // Schedule actions to delete from the schedule. + Deletes *BatchScheduleActionDeleteRequest `locationName:"deletes" type:"structure"` +} + +// String returns the string representation +func (s BatchUpdateScheduleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchUpdateScheduleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchUpdateScheduleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchUpdateScheduleInput"} + if s.ChannelId == nil { + invalidParams.Add(request.NewErrParamRequired("ChannelId")) + } + if s.ChannelId != nil && len(*s.ChannelId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChannelId", 1)) + } + if s.Creates != nil { + if err := s.Creates.Validate(); err != nil { + invalidParams.AddNested("Creates", err.(request.ErrInvalidParams)) + } + } + if s.Deletes != nil { + if err := s.Deletes.Validate(); err != nil { + invalidParams.AddNested("Deletes", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetChannelId sets the ChannelId field's value. +func (s *BatchUpdateScheduleInput) SetChannelId(v string) *BatchUpdateScheduleInput { + s.ChannelId = &v + return s +} + +// SetCreates sets the Creates field's value. +func (s *BatchUpdateScheduleInput) SetCreates(v *BatchScheduleActionCreateRequest) *BatchUpdateScheduleInput { + s.Creates = v + return s +} + +// SetDeletes sets the Deletes field's value. +func (s *BatchUpdateScheduleInput) SetDeletes(v *BatchScheduleActionDeleteRequest) *BatchUpdateScheduleInput { + s.Deletes = v + return s +} + +type BatchUpdateScheduleOutput struct { + _ struct{} `type:"structure"` + + // List of actions that have been created in the schedule. + Creates *BatchScheduleActionCreateResult `locationName:"creates" type:"structure"` + + // List of actions that have been deleted from the schedule. + Deletes *BatchScheduleActionDeleteResult `locationName:"deletes" type:"structure"` +} + +// String returns the string representation +func (s BatchUpdateScheduleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchUpdateScheduleOutput) GoString() string { + return s.String() +} + +// SetCreates sets the Creates field's value. +func (s *BatchUpdateScheduleOutput) SetCreates(v *BatchScheduleActionCreateResult) *BatchUpdateScheduleOutput { + s.Creates = v + return s +} + +// SetDeletes sets the Deletes field's value. +func (s *BatchUpdateScheduleOutput) SetDeletes(v *BatchScheduleActionDeleteResult) *BatchUpdateScheduleOutput { + s.Deletes = v + return s +} + +// Blackout Slate +type BlackoutSlate struct { + _ struct{} `type:"structure"` + + // Blackout slate image to be used. Leave empty for solid black. Only bmp and + // png images are supported. + BlackoutSlateImage *InputLocation `locationName:"blackoutSlateImage" type:"structure"` + + // Setting to enabled causes the encoder to blackout the video, audio, and captions, + // and raise the "Network Blackout Image" slate when an SCTE104/35 Network End + // Segmentation Descriptor is encountered. The blackout will be lifted when + // the Network Start Segmentation Descriptor is encountered. The Network End + // and Network Start descriptors must contain a network ID that matches the + // value entered in "Network ID". + NetworkEndBlackout *string `locationName:"networkEndBlackout" type:"string" enum:"BlackoutSlateNetworkEndBlackout"` + + // Path to local file to use as Network End Blackout image. Image will be scaled + // to fill the entire output raster. + NetworkEndBlackoutImage *InputLocation `locationName:"networkEndBlackoutImage" type:"structure"` + + // Provides Network ID that matches EIDR ID format (e.g., "10.XXXX/XXXX-XXXX-XXXX-XXXX-XXXX-C"). + NetworkId *string `locationName:"networkId" min:"34" type:"string"` + + // When set to enabled, causes video, audio and captions to be blanked when + // indicated by program metadata. + State *string `locationName:"state" type:"string" enum:"BlackoutSlateState"` +} + +// String returns the string representation +func (s BlackoutSlate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BlackoutSlate) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BlackoutSlate) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BlackoutSlate"} + if s.NetworkId != nil && len(*s.NetworkId) < 34 { + invalidParams.Add(request.NewErrParamMinLen("NetworkId", 34)) + } + if s.BlackoutSlateImage != nil { + if err := s.BlackoutSlateImage.Validate(); err != nil { + invalidParams.AddNested("BlackoutSlateImage", err.(request.ErrInvalidParams)) + } + } + if s.NetworkEndBlackoutImage != nil { + if err := s.NetworkEndBlackoutImage.Validate(); err != nil { + invalidParams.AddNested("NetworkEndBlackoutImage", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBlackoutSlateImage sets the BlackoutSlateImage field's value. +func (s *BlackoutSlate) SetBlackoutSlateImage(v *InputLocation) *BlackoutSlate { + s.BlackoutSlateImage = v + return s +} + +// SetNetworkEndBlackout sets the NetworkEndBlackout field's value. +func (s *BlackoutSlate) SetNetworkEndBlackout(v string) *BlackoutSlate { + s.NetworkEndBlackout = &v + return s +} + +// SetNetworkEndBlackoutImage sets the NetworkEndBlackoutImage field's value. +func (s *BlackoutSlate) SetNetworkEndBlackoutImage(v *InputLocation) *BlackoutSlate { + s.NetworkEndBlackoutImage = v + return s +} + +// SetNetworkId sets the NetworkId field's value. +func (s *BlackoutSlate) SetNetworkId(v string) *BlackoutSlate { + s.NetworkId = &v + return s +} + +// SetState sets the State field's value. +func (s *BlackoutSlate) SetState(v string) *BlackoutSlate { + s.State = &v + return s +} + +// Burn In Destination Settings +type BurnInDestinationSettings struct { + _ struct{} `type:"structure"` + + // If no explicit xPosition or yPosition is provided, setting alignment to centered + // will place the captions at the bottom center of the output. Similarly, setting + // a left alignment will align captions to the bottom left of the output. If + // x and y positions are given in conjunction with the alignment parameter, + // the font will be justified (either left or centered) relative to those coordinates. + // Selecting "smart" justification will left-justify live subtitles and center-justify + // pre-recorded subtitles. All burn-in and DVB-Sub font settings must match. + Alignment *string `locationName:"alignment" type:"string" enum:"BurnInAlignment"` + + // Specifies the color of the rectangle behind the captions. All burn-in and + // DVB-Sub font settings must match. + BackgroundColor *string `locationName:"backgroundColor" type:"string" enum:"BurnInBackgroundColor"` + + // Specifies the opacity of the background rectangle. 255 is opaque; 0 is transparent. + // Leaving this parameter out is equivalent to setting it to 0 (transparent). + // All burn-in and DVB-Sub font settings must match. + BackgroundOpacity *int64 `locationName:"backgroundOpacity" type:"integer"` + + // External font file used for caption burn-in. File extension must be 'ttf' + // or 'tte'. Although the user can select output fonts for many different types + // of input captions, embedded, STL and teletext sources use a strict grid system. + // Using external fonts with these caption sources could cause unexpected display + // of proportional fonts. All burn-in and DVB-Sub font settings must match. + Font *InputLocation `locationName:"font" type:"structure"` + + // Specifies the color of the burned-in captions. This option is not valid for + // source captions that are STL, 608/embedded or teletext. These source settings + // are already pre-defined by the caption stream. All burn-in and DVB-Sub font + // settings must match. + FontColor *string `locationName:"fontColor" type:"string" enum:"BurnInFontColor"` + + // Specifies the opacity of the burned-in captions. 255 is opaque; 0 is transparent. + // All burn-in and DVB-Sub font settings must match. + FontOpacity *int64 `locationName:"fontOpacity" type:"integer"` + + // Font resolution in DPI (dots per inch); default is 96 dpi. All burn-in and + // DVB-Sub font settings must match. + FontResolution *int64 `locationName:"fontResolution" min:"96" type:"integer"` + + // When set to 'auto' fontSize will scale depending on the size of the output. + // Giving a positive integer will specify the exact font size in points. All + // burn-in and DVB-Sub font settings must match. + FontSize *string `locationName:"fontSize" type:"string"` + + // Specifies font outline color. This option is not valid for source captions + // that are either 608/embedded or teletext. These source settings are already + // pre-defined by the caption stream. All burn-in and DVB-Sub font settings + // must match. + OutlineColor *string `locationName:"outlineColor" type:"string" enum:"BurnInOutlineColor"` + + // Specifies font outline size in pixels. This option is not valid for source + // captions that are either 608/embedded or teletext. These source settings + // are already pre-defined by the caption stream. All burn-in and DVB-Sub font + // settings must match. + OutlineSize *int64 `locationName:"outlineSize" type:"integer"` + + // Specifies the color of the shadow cast by the captions. All burn-in and DVB-Sub + // font settings must match. + ShadowColor *string `locationName:"shadowColor" type:"string" enum:"BurnInShadowColor"` + + // Specifies the opacity of the shadow. 255 is opaque; 0 is transparent. Leaving + // this parameter out is equivalent to setting it to 0 (transparent). All burn-in + // and DVB-Sub font settings must match. + ShadowOpacity *int64 `locationName:"shadowOpacity" type:"integer"` + + // Specifies the horizontal offset of the shadow relative to the captions in + // pixels. A value of -2 would result in a shadow offset 2 pixels to the left. + // All burn-in and DVB-Sub font settings must match. + ShadowXOffset *int64 `locationName:"shadowXOffset" type:"integer"` + + // Specifies the vertical offset of the shadow relative to the captions in pixels. + // A value of -2 would result in a shadow offset 2 pixels above the text. All + // burn-in and DVB-Sub font settings must match. + ShadowYOffset *int64 `locationName:"shadowYOffset" type:"integer"` + + // Controls whether a fixed grid size will be used to generate the output subtitles + // bitmap. Only applicable for Teletext inputs and DVB-Sub/Burn-in outputs. + TeletextGridControl *string `locationName:"teletextGridControl" type:"string" enum:"BurnInTeletextGridControl"` + + // Specifies the horizontal position of the caption relative to the left side + // of the output in pixels. A value of 10 would result in the captions starting + // 10 pixels from the left of the output. If no explicit xPosition is provided, + // the horizontal caption position will be determined by the alignment parameter. + // All burn-in and DVB-Sub font settings must match. + XPosition *int64 `locationName:"xPosition" type:"integer"` + + // Specifies the vertical position of the caption relative to the top of the + // output in pixels. A value of 10 would result in the captions starting 10 + // pixels from the top of the output. If no explicit yPosition is provided, + // the caption will be positioned towards the bottom of the output. All burn-in + // and DVB-Sub font settings must match. + YPosition *int64 `locationName:"yPosition" type:"integer"` } // String returns the string representation -func (s AacSettings) String() string { +func (s BurnInDestinationSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AacSettings) GoString() string { +func (s BurnInDestinationSettings) GoString() string { return s.String() } -// SetBitrate sets the Bitrate field's value. -func (s *AacSettings) SetBitrate(v float64) *AacSettings { - s.Bitrate = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *BurnInDestinationSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BurnInDestinationSettings"} + if s.FontResolution != nil && *s.FontResolution < 96 { + invalidParams.Add(request.NewErrParamMinValue("FontResolution", 96)) + } + if s.Font != nil { + if err := s.Font.Validate(); err != nil { + invalidParams.AddNested("Font", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAlignment sets the Alignment field's value. +func (s *BurnInDestinationSettings) SetAlignment(v string) *BurnInDestinationSettings { + s.Alignment = &v return s } -// SetCodingMode sets the CodingMode field's value. -func (s *AacSettings) SetCodingMode(v string) *AacSettings { - s.CodingMode = &v +// SetBackgroundColor sets the BackgroundColor field's value. +func (s *BurnInDestinationSettings) SetBackgroundColor(v string) *BurnInDestinationSettings { + s.BackgroundColor = &v return s } -// SetInputType sets the InputType field's value. -func (s *AacSettings) SetInputType(v string) *AacSettings { - s.InputType = &v +// SetBackgroundOpacity sets the BackgroundOpacity field's value. +func (s *BurnInDestinationSettings) SetBackgroundOpacity(v int64) *BurnInDestinationSettings { + s.BackgroundOpacity = &v return s } -// SetProfile sets the Profile field's value. -func (s *AacSettings) SetProfile(v string) *AacSettings { - s.Profile = &v +// SetFont sets the Font field's value. +func (s *BurnInDestinationSettings) SetFont(v *InputLocation) *BurnInDestinationSettings { + s.Font = v return s } -// SetRateControlMode sets the RateControlMode field's value. -func (s *AacSettings) SetRateControlMode(v string) *AacSettings { - s.RateControlMode = &v +// SetFontColor sets the FontColor field's value. +func (s *BurnInDestinationSettings) SetFontColor(v string) *BurnInDestinationSettings { + s.FontColor = &v return s } -// SetRawFormat sets the RawFormat field's value. -func (s *AacSettings) SetRawFormat(v string) *AacSettings { - s.RawFormat = &v +// SetFontOpacity sets the FontOpacity field's value. +func (s *BurnInDestinationSettings) SetFontOpacity(v int64) *BurnInDestinationSettings { + s.FontOpacity = &v + return s +} + +// SetFontResolution sets the FontResolution field's value. +func (s *BurnInDestinationSettings) SetFontResolution(v int64) *BurnInDestinationSettings { + s.FontResolution = &v + return s +} + +// SetFontSize sets the FontSize field's value. +func (s *BurnInDestinationSettings) SetFontSize(v string) *BurnInDestinationSettings { + s.FontSize = &v + return s +} + +// SetOutlineColor sets the OutlineColor field's value. +func (s *BurnInDestinationSettings) SetOutlineColor(v string) *BurnInDestinationSettings { + s.OutlineColor = &v + return s +} + +// SetOutlineSize sets the OutlineSize field's value. +func (s *BurnInDestinationSettings) SetOutlineSize(v int64) *BurnInDestinationSettings { + s.OutlineSize = &v + return s +} + +// SetShadowColor sets the ShadowColor field's value. +func (s *BurnInDestinationSettings) SetShadowColor(v string) *BurnInDestinationSettings { + s.ShadowColor = &v + return s +} + +// SetShadowOpacity sets the ShadowOpacity field's value. +func (s *BurnInDestinationSettings) SetShadowOpacity(v int64) *BurnInDestinationSettings { + s.ShadowOpacity = &v + return s +} + +// SetShadowXOffset sets the ShadowXOffset field's value. +func (s *BurnInDestinationSettings) SetShadowXOffset(v int64) *BurnInDestinationSettings { + s.ShadowXOffset = &v + return s +} + +// SetShadowYOffset sets the ShadowYOffset field's value. +func (s *BurnInDestinationSettings) SetShadowYOffset(v int64) *BurnInDestinationSettings { + s.ShadowYOffset = &v + return s +} + +// SetTeletextGridControl sets the TeletextGridControl field's value. +func (s *BurnInDestinationSettings) SetTeletextGridControl(v string) *BurnInDestinationSettings { + s.TeletextGridControl = &v + return s +} + +// SetXPosition sets the XPosition field's value. +func (s *BurnInDestinationSettings) SetXPosition(v int64) *BurnInDestinationSettings { + s.XPosition = &v + return s +} + +// SetYPosition sets the YPosition field's value. +func (s *BurnInDestinationSettings) SetYPosition(v int64) *BurnInDestinationSettings { + s.YPosition = &v + return s +} + +// Caption Description +type CaptionDescription struct { + _ struct{} `type:"structure"` + + // Specifies which input caption selector to use as a caption source when generating + // output captions. This field should match a captionSelector name. + // + // CaptionSelectorName is a required field + CaptionSelectorName *string `locationName:"captionSelectorName" type:"string" required:"true"` + + // Additional settings for captions destination that depend on the destination + // type. + DestinationSettings *CaptionDestinationSettings `locationName:"destinationSettings" type:"structure"` + + // ISO 639-2 three-digit code: http://www.loc.gov/standards/iso639-2/ + LanguageCode *string `locationName:"languageCode" type:"string"` + + // Human readable information to indicate captions available for players (eg. + // English, or Spanish). + LanguageDescription *string `locationName:"languageDescription" type:"string"` + + // Name of the caption description. Used to associate a caption description + // with an output. Names must be unique within an event. + // + // Name is a required field + Name *string `locationName:"name" type:"string" required:"true"` +} + +// String returns the string representation +func (s CaptionDescription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CaptionDescription) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CaptionDescription) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CaptionDescription"} + if s.CaptionSelectorName == nil { + invalidParams.Add(request.NewErrParamRequired("CaptionSelectorName")) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.DestinationSettings != nil { + if err := s.DestinationSettings.Validate(); err != nil { + invalidParams.AddNested("DestinationSettings", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCaptionSelectorName sets the CaptionSelectorName field's value. +func (s *CaptionDescription) SetCaptionSelectorName(v string) *CaptionDescription { + s.CaptionSelectorName = &v + return s +} + +// SetDestinationSettings sets the DestinationSettings field's value. +func (s *CaptionDescription) SetDestinationSettings(v *CaptionDestinationSettings) *CaptionDescription { + s.DestinationSettings = v return s } -// SetSampleRate sets the SampleRate field's value. -func (s *AacSettings) SetSampleRate(v float64) *AacSettings { - s.SampleRate = &v +// SetLanguageCode sets the LanguageCode field's value. +func (s *CaptionDescription) SetLanguageCode(v string) *CaptionDescription { + s.LanguageCode = &v return s } -// SetSpec sets the Spec field's value. -func (s *AacSettings) SetSpec(v string) *AacSettings { - s.Spec = &v +// SetLanguageDescription sets the LanguageDescription field's value. +func (s *CaptionDescription) SetLanguageDescription(v string) *CaptionDescription { + s.LanguageDescription = &v return s } -// SetVbrQuality sets the VbrQuality field's value. -func (s *AacSettings) SetVbrQuality(v string) *AacSettings { - s.VbrQuality = &v +// SetName sets the Name field's value. +func (s *CaptionDescription) SetName(v string) *CaptionDescription { + s.Name = &v return s } -// Ac3 Settings -type Ac3Settings struct { +// Caption Destination Settings +type CaptionDestinationSettings struct { _ struct{} `type:"structure"` - // Average bitrate in bits/second. Valid bitrates depend on the coding mode. - Bitrate *float64 `locationName:"bitrate" type:"double"` + // Arib Destination Settings + AribDestinationSettings *AribDestinationSettings `locationName:"aribDestinationSettings" type:"structure"` - // Specifies the bitstream mode (bsmod) for the emitted AC-3 stream. See ATSC - // A/52-2012 for background on these values. - BitstreamMode *string `locationName:"bitstreamMode" type:"string" enum:"Ac3BitstreamMode"` + // Burn In Destination Settings + BurnInDestinationSettings *BurnInDestinationSettings `locationName:"burnInDestinationSettings" type:"structure"` - // Dolby Digital coding mode. Determines number of channels. - CodingMode *string `locationName:"codingMode" type:"string" enum:"Ac3CodingMode"` + // Dvb Sub Destination Settings + DvbSubDestinationSettings *DvbSubDestinationSettings `locationName:"dvbSubDestinationSettings" type:"structure"` - // Sets the dialnorm for the output. If excluded and input audio is Dolby Digital, - // dialnorm will be passed through. - Dialnorm *int64 `locationName:"dialnorm" min:"1" type:"integer"` + // Embedded Destination Settings + EmbeddedDestinationSettings *EmbeddedDestinationSettings `locationName:"embeddedDestinationSettings" type:"structure"` - // If set to filmStandard, adds dynamic range compression signaling to the output - // bitstream as defined in the Dolby Digital specification. - DrcProfile *string `locationName:"drcProfile" type:"string" enum:"Ac3DrcProfile"` + // Embedded Plus Scte20 Destination Settings + EmbeddedPlusScte20DestinationSettings *EmbeddedPlusScte20DestinationSettings `locationName:"embeddedPlusScte20DestinationSettings" type:"structure"` - // When set to enabled, applies a 120Hz lowpass filter to the LFE channel prior - // to encoding. Only valid in codingMode32Lfe mode. - LfeFilter *string `locationName:"lfeFilter" type:"string" enum:"Ac3LfeFilter"` + // Rtmp Caption Info Destination Settings + RtmpCaptionInfoDestinationSettings *RtmpCaptionInfoDestinationSettings `locationName:"rtmpCaptionInfoDestinationSettings" type:"structure"` - // When set to "followInput", encoder metadata will be sourced from the DD, - // DD+, or DolbyE decoder that supplied this audio data. If audio was not supplied - // from one of these streams, then the static metadata settings will be used. - MetadataControl *string `locationName:"metadataControl" type:"string" enum:"Ac3MetadataControl"` + // Scte20 Plus Embedded Destination Settings + Scte20PlusEmbeddedDestinationSettings *Scte20PlusEmbeddedDestinationSettings `locationName:"scte20PlusEmbeddedDestinationSettings" type:"structure"` + + // Scte27 Destination Settings + Scte27DestinationSettings *Scte27DestinationSettings `locationName:"scte27DestinationSettings" type:"structure"` + + // Smpte Tt Destination Settings + SmpteTtDestinationSettings *SmpteTtDestinationSettings `locationName:"smpteTtDestinationSettings" type:"structure"` + + // Teletext Destination Settings + TeletextDestinationSettings *TeletextDestinationSettings `locationName:"teletextDestinationSettings" type:"structure"` + + // Ttml Destination Settings + TtmlDestinationSettings *TtmlDestinationSettings `locationName:"ttmlDestinationSettings" type:"structure"` + + // Webvtt Destination Settings + WebvttDestinationSettings *WebvttDestinationSettings `locationName:"webvttDestinationSettings" type:"structure"` } // String returns the string representation -func (s Ac3Settings) String() string { +func (s CaptionDestinationSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Ac3Settings) GoString() string { +func (s CaptionDestinationSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *Ac3Settings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Ac3Settings"} - if s.Dialnorm != nil && *s.Dialnorm < 1 { - invalidParams.Add(request.NewErrParamMinValue("Dialnorm", 1)) +func (s *CaptionDestinationSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CaptionDestinationSettings"} + if s.BurnInDestinationSettings != nil { + if err := s.BurnInDestinationSettings.Validate(); err != nil { + invalidParams.AddNested("BurnInDestinationSettings", err.(request.ErrInvalidParams)) + } + } + if s.DvbSubDestinationSettings != nil { + if err := s.DvbSubDestinationSettings.Validate(); err != nil { + invalidParams.AddNested("DvbSubDestinationSettings", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -3296,73 +6345,130 @@ func (s *Ac3Settings) Validate() error { return nil } -// SetBitrate sets the Bitrate field's value. -func (s *Ac3Settings) SetBitrate(v float64) *Ac3Settings { - s.Bitrate = &v +// SetAribDestinationSettings sets the AribDestinationSettings field's value. +func (s *CaptionDestinationSettings) SetAribDestinationSettings(v *AribDestinationSettings) *CaptionDestinationSettings { + s.AribDestinationSettings = v return s } -// SetBitstreamMode sets the BitstreamMode field's value. -func (s *Ac3Settings) SetBitstreamMode(v string) *Ac3Settings { - s.BitstreamMode = &v +// SetBurnInDestinationSettings sets the BurnInDestinationSettings field's value. +func (s *CaptionDestinationSettings) SetBurnInDestinationSettings(v *BurnInDestinationSettings) *CaptionDestinationSettings { + s.BurnInDestinationSettings = v return s } -// SetCodingMode sets the CodingMode field's value. -func (s *Ac3Settings) SetCodingMode(v string) *Ac3Settings { - s.CodingMode = &v +// SetDvbSubDestinationSettings sets the DvbSubDestinationSettings field's value. +func (s *CaptionDestinationSettings) SetDvbSubDestinationSettings(v *DvbSubDestinationSettings) *CaptionDestinationSettings { + s.DvbSubDestinationSettings = v return s } -// SetDialnorm sets the Dialnorm field's value. -func (s *Ac3Settings) SetDialnorm(v int64) *Ac3Settings { - s.Dialnorm = &v +// SetEmbeddedDestinationSettings sets the EmbeddedDestinationSettings field's value. +func (s *CaptionDestinationSettings) SetEmbeddedDestinationSettings(v *EmbeddedDestinationSettings) *CaptionDestinationSettings { + s.EmbeddedDestinationSettings = v return s } -// SetDrcProfile sets the DrcProfile field's value. -func (s *Ac3Settings) SetDrcProfile(v string) *Ac3Settings { - s.DrcProfile = &v +// SetEmbeddedPlusScte20DestinationSettings sets the EmbeddedPlusScte20DestinationSettings field's value. +func (s *CaptionDestinationSettings) SetEmbeddedPlusScte20DestinationSettings(v *EmbeddedPlusScte20DestinationSettings) *CaptionDestinationSettings { + s.EmbeddedPlusScte20DestinationSettings = v return s } -// SetLfeFilter sets the LfeFilter field's value. -func (s *Ac3Settings) SetLfeFilter(v string) *Ac3Settings { - s.LfeFilter = &v +// SetRtmpCaptionInfoDestinationSettings sets the RtmpCaptionInfoDestinationSettings field's value. +func (s *CaptionDestinationSettings) SetRtmpCaptionInfoDestinationSettings(v *RtmpCaptionInfoDestinationSettings) *CaptionDestinationSettings { + s.RtmpCaptionInfoDestinationSettings = v return s } -// SetMetadataControl sets the MetadataControl field's value. -func (s *Ac3Settings) SetMetadataControl(v string) *Ac3Settings { - s.MetadataControl = &v +// SetScte20PlusEmbeddedDestinationSettings sets the Scte20PlusEmbeddedDestinationSettings field's value. +func (s *CaptionDestinationSettings) SetScte20PlusEmbeddedDestinationSettings(v *Scte20PlusEmbeddedDestinationSettings) *CaptionDestinationSettings { + s.Scte20PlusEmbeddedDestinationSettings = v return s } -// Archive Container Settings -type ArchiveContainerSettings struct { +// SetScte27DestinationSettings sets the Scte27DestinationSettings field's value. +func (s *CaptionDestinationSettings) SetScte27DestinationSettings(v *Scte27DestinationSettings) *CaptionDestinationSettings { + s.Scte27DestinationSettings = v + return s +} + +// SetSmpteTtDestinationSettings sets the SmpteTtDestinationSettings field's value. +func (s *CaptionDestinationSettings) SetSmpteTtDestinationSettings(v *SmpteTtDestinationSettings) *CaptionDestinationSettings { + s.SmpteTtDestinationSettings = v + return s +} + +// SetTeletextDestinationSettings sets the TeletextDestinationSettings field's value. +func (s *CaptionDestinationSettings) SetTeletextDestinationSettings(v *TeletextDestinationSettings) *CaptionDestinationSettings { + s.TeletextDestinationSettings = v + return s +} + +// SetTtmlDestinationSettings sets the TtmlDestinationSettings field's value. +func (s *CaptionDestinationSettings) SetTtmlDestinationSettings(v *TtmlDestinationSettings) *CaptionDestinationSettings { + s.TtmlDestinationSettings = v + return s +} + +// SetWebvttDestinationSettings sets the WebvttDestinationSettings field's value. +func (s *CaptionDestinationSettings) SetWebvttDestinationSettings(v *WebvttDestinationSettings) *CaptionDestinationSettings { + s.WebvttDestinationSettings = v + return s +} + +// Maps a caption channel to an ISO 693-2 language code (http://www.loc.gov/standards/iso639-2), +// with an optional description. +type CaptionLanguageMapping struct { _ struct{} `type:"structure"` - // M2ts Settings - M2tsSettings *M2tsSettings `locationName:"m2tsSettings" type:"structure"` + // The closed caption channel being described by this CaptionLanguageMapping. + // Each channel mapping must have a unique channel number (maximum of 4) + // + // CaptionChannel is a required field + CaptionChannel *int64 `locationName:"captionChannel" min:"1" type:"integer" required:"true"` + + // Three character ISO 639-2 language code (see http://www.loc.gov/standards/iso639-2) + // + // LanguageCode is a required field + LanguageCode *string `locationName:"languageCode" min:"3" type:"string" required:"true"` + + // Textual description of language + // + // LanguageDescription is a required field + LanguageDescription *string `locationName:"languageDescription" min:"1" type:"string" required:"true"` } // String returns the string representation -func (s ArchiveContainerSettings) String() string { +func (s CaptionLanguageMapping) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ArchiveContainerSettings) GoString() string { +func (s CaptionLanguageMapping) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ArchiveContainerSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ArchiveContainerSettings"} - if s.M2tsSettings != nil { - if err := s.M2tsSettings.Validate(); err != nil { - invalidParams.AddNested("M2tsSettings", err.(request.ErrInvalidParams)) - } +func (s *CaptionLanguageMapping) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CaptionLanguageMapping"} + if s.CaptionChannel == nil { + invalidParams.Add(request.NewErrParamRequired("CaptionChannel")) + } + if s.CaptionChannel != nil && *s.CaptionChannel < 1 { + invalidParams.Add(request.NewErrParamMinValue("CaptionChannel", 1)) + } + if s.LanguageCode == nil { + invalidParams.Add(request.NewErrParamRequired("LanguageCode")) + } + if s.LanguageCode != nil && len(*s.LanguageCode) < 3 { + invalidParams.Add(request.NewErrParamMinLen("LanguageCode", 3)) + } + if s.LanguageDescription == nil { + invalidParams.Add(request.NewErrParamRequired("LanguageDescription")) + } + if s.LanguageDescription != nil && len(*s.LanguageDescription) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LanguageDescription", 1)) } if invalidParams.Len() > 0 { @@ -3371,44 +6477,67 @@ func (s *ArchiveContainerSettings) Validate() error { return nil } -// SetM2tsSettings sets the M2tsSettings field's value. -func (s *ArchiveContainerSettings) SetM2tsSettings(v *M2tsSettings) *ArchiveContainerSettings { - s.M2tsSettings = v +// SetCaptionChannel sets the CaptionChannel field's value. +func (s *CaptionLanguageMapping) SetCaptionChannel(v int64) *CaptionLanguageMapping { + s.CaptionChannel = &v return s } -// Archive Group Settings -type ArchiveGroupSettings struct { +// SetLanguageCode sets the LanguageCode field's value. +func (s *CaptionLanguageMapping) SetLanguageCode(v string) *CaptionLanguageMapping { + s.LanguageCode = &v + return s +} + +// SetLanguageDescription sets the LanguageDescription field's value. +func (s *CaptionLanguageMapping) SetLanguageDescription(v string) *CaptionLanguageMapping { + s.LanguageDescription = &v + return s +} + +// Output groups for this Live Event. Output groups contain information about +// where streams should be distributed. +type CaptionSelector struct { _ struct{} `type:"structure"` - // A directory and base filename where archive files should be written. + // When specified this field indicates the three letter language code of the + // caption track to extract from the source. + LanguageCode *string `locationName:"languageCode" type:"string"` + + // Name identifier for a caption selector. This name is used to associate this + // caption selector with one or more caption descriptions. Names must be unique + // within an event. // - // Destination is a required field - Destination *OutputLocationRef `locationName:"destination" type:"structure" required:"true"` + // Name is a required field + Name *string `locationName:"name" min:"1" type:"string" required:"true"` - // Number of seconds to write to archive file before closing and starting a - // new one. - RolloverInterval *int64 `locationName:"rolloverInterval" min:"1" type:"integer"` + // Caption selector settings. + SelectorSettings *CaptionSelectorSettings `locationName:"selectorSettings" type:"structure"` } // String returns the string representation -func (s ArchiveGroupSettings) String() string { +func (s CaptionSelector) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ArchiveGroupSettings) GoString() string { +func (s CaptionSelector) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ArchiveGroupSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ArchiveGroupSettings"} - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) +func (s *CaptionSelector) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CaptionSelector"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) } - if s.RolloverInterval != nil && *s.RolloverInterval < 1 { - invalidParams.Add(request.NewErrParamMinValue("RolloverInterval", 1)) + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.SelectorSettings != nil { + if err := s.SelectorSettings.Validate(); err != nil { + invalidParams.AddNested("SelectorSettings", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -3417,55 +6546,78 @@ func (s *ArchiveGroupSettings) Validate() error { return nil } -// SetDestination sets the Destination field's value. -func (s *ArchiveGroupSettings) SetDestination(v *OutputLocationRef) *ArchiveGroupSettings { - s.Destination = v +// SetLanguageCode sets the LanguageCode field's value. +func (s *CaptionSelector) SetLanguageCode(v string) *CaptionSelector { + s.LanguageCode = &v return s } -// SetRolloverInterval sets the RolloverInterval field's value. -func (s *ArchiveGroupSettings) SetRolloverInterval(v int64) *ArchiveGroupSettings { - s.RolloverInterval = &v +// SetName sets the Name field's value. +func (s *CaptionSelector) SetName(v string) *CaptionSelector { + s.Name = &v return s } -// Archive Output Settings -type ArchiveOutputSettings struct { +// SetSelectorSettings sets the SelectorSettings field's value. +func (s *CaptionSelector) SetSelectorSettings(v *CaptionSelectorSettings) *CaptionSelector { + s.SelectorSettings = v + return s +} + +// Caption Selector Settings +type CaptionSelectorSettings struct { _ struct{} `type:"structure"` - // Settings specific to the container type of the file. - // - // ContainerSettings is a required field - ContainerSettings *ArchiveContainerSettings `locationName:"containerSettings" type:"structure" required:"true"` + // Arib Source Settings + AribSourceSettings *AribSourceSettings `locationName:"aribSourceSettings" type:"structure"` - // Output file extension. If excluded, this will be auto-selected from the container - // type. - Extension *string `locationName:"extension" type:"string"` + // Dvb Sub Source Settings + DvbSubSourceSettings *DvbSubSourceSettings `locationName:"dvbSubSourceSettings" type:"structure"` - // String concatenated to the end of the destination filename. Required for - // multiple outputs of the same type. - NameModifier *string `locationName:"nameModifier" type:"string"` + // Embedded Source Settings + EmbeddedSourceSettings *EmbeddedSourceSettings `locationName:"embeddedSourceSettings" type:"structure"` + + // Scte20 Source Settings + Scte20SourceSettings *Scte20SourceSettings `locationName:"scte20SourceSettings" type:"structure"` + + // Scte27 Source Settings + Scte27SourceSettings *Scte27SourceSettings `locationName:"scte27SourceSettings" type:"structure"` + + // Teletext Source Settings + TeletextSourceSettings *TeletextSourceSettings `locationName:"teletextSourceSettings" type:"structure"` } // String returns the string representation -func (s ArchiveOutputSettings) String() string { +func (s CaptionSelectorSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ArchiveOutputSettings) GoString() string { +func (s CaptionSelectorSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ArchiveOutputSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ArchiveOutputSettings"} - if s.ContainerSettings == nil { - invalidParams.Add(request.NewErrParamRequired("ContainerSettings")) +func (s *CaptionSelectorSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CaptionSelectorSettings"} + if s.DvbSubSourceSettings != nil { + if err := s.DvbSubSourceSettings.Validate(); err != nil { + invalidParams.AddNested("DvbSubSourceSettings", err.(request.ErrInvalidParams)) + } } - if s.ContainerSettings != nil { - if err := s.ContainerSettings.Validate(); err != nil { - invalidParams.AddNested("ContainerSettings", err.(request.ErrInvalidParams)) + if s.EmbeddedSourceSettings != nil { + if err := s.EmbeddedSourceSettings.Validate(); err != nil { + invalidParams.AddNested("EmbeddedSourceSettings", err.(request.ErrInvalidParams)) + } + } + if s.Scte20SourceSettings != nil { + if err := s.Scte20SourceSettings.Validate(); err != nil { + invalidParams.AddNested("Scte20SourceSettings", err.(request.ErrInvalidParams)) + } + } + if s.Scte27SourceSettings != nil { + if err := s.Scte27SourceSettings.Validate(); err != nil { + invalidParams.AddNested("Scte27SourceSettings", err.(request.ErrInvalidParams)) } } @@ -3475,494 +6627,483 @@ func (s *ArchiveOutputSettings) Validate() error { return nil } -// SetContainerSettings sets the ContainerSettings field's value. -func (s *ArchiveOutputSettings) SetContainerSettings(v *ArchiveContainerSettings) *ArchiveOutputSettings { - s.ContainerSettings = v +// SetAribSourceSettings sets the AribSourceSettings field's value. +func (s *CaptionSelectorSettings) SetAribSourceSettings(v *AribSourceSettings) *CaptionSelectorSettings { + s.AribSourceSettings = v return s } -// SetExtension sets the Extension field's value. -func (s *ArchiveOutputSettings) SetExtension(v string) *ArchiveOutputSettings { - s.Extension = &v +// SetDvbSubSourceSettings sets the DvbSubSourceSettings field's value. +func (s *CaptionSelectorSettings) SetDvbSubSourceSettings(v *DvbSubSourceSettings) *CaptionSelectorSettings { + s.DvbSubSourceSettings = v return s } -// SetNameModifier sets the NameModifier field's value. -func (s *ArchiveOutputSettings) SetNameModifier(v string) *ArchiveOutputSettings { - s.NameModifier = &v +// SetEmbeddedSourceSettings sets the EmbeddedSourceSettings field's value. +func (s *CaptionSelectorSettings) SetEmbeddedSourceSettings(v *EmbeddedSourceSettings) *CaptionSelectorSettings { + s.EmbeddedSourceSettings = v return s } -// Arib Destination Settings -type AribDestinationSettings struct { - _ struct{} `type:"structure"` +// SetScte20SourceSettings sets the Scte20SourceSettings field's value. +func (s *CaptionSelectorSettings) SetScte20SourceSettings(v *Scte20SourceSettings) *CaptionSelectorSettings { + s.Scte20SourceSettings = v + return s } -// String returns the string representation -func (s AribDestinationSettings) String() string { - return awsutil.Prettify(s) +// SetScte27SourceSettings sets the Scte27SourceSettings field's value. +func (s *CaptionSelectorSettings) SetScte27SourceSettings(v *Scte27SourceSettings) *CaptionSelectorSettings { + s.Scte27SourceSettings = v + return s } -// GoString returns the string representation -func (s AribDestinationSettings) GoString() string { - return s.String() +// SetTeletextSourceSettings sets the TeletextSourceSettings field's value. +func (s *CaptionSelectorSettings) SetTeletextSourceSettings(v *TeletextSourceSettings) *CaptionSelectorSettings { + s.TeletextSourceSettings = v + return s } -// Arib Source Settings -type AribSourceSettings struct { +type Channel struct { _ struct{} `type:"structure"` -} -// String returns the string representation -func (s AribSourceSettings) String() string { - return awsutil.Prettify(s) -} + // The unique arn of the channel. + Arn *string `locationName:"arn" type:"string"` -// GoString returns the string representation -func (s AribSourceSettings) GoString() string { - return s.String() -} + // The class for this channel. STANDARD for a channel with two pipelines or + // SINGLE_PIPELINE for a channel with one pipeline. + ChannelClass *string `locationName:"channelClass" type:"string" enum:"ChannelClass"` -// Audio Channel Mapping -type AudioChannelMapping struct { - _ struct{} `type:"structure"` + // A list of destinations of the channel. For UDP outputs, there is onedestination + // per output. For other types (HLS, for example), there isone destination per + // packager. + Destinations []*OutputDestination `locationName:"destinations" type:"list"` - // Indices and gain values for each input channel that should be remixed into - // this output channel. - // - // InputChannelLevels is a required field - InputChannelLevels []*InputChannelLevel `locationName:"inputChannelLevels" type:"list" required:"true"` + // The endpoints where outgoing connections initiate from + EgressEndpoints []*ChannelEgressEndpoint `locationName:"egressEndpoints" type:"list"` - // The index of the output channel being produced. - // - // OutputChannel is a required field - OutputChannel *int64 `locationName:"outputChannel" type:"integer" required:"true"` + // Encoder Settings + EncoderSettings *EncoderSettings `locationName:"encoderSettings" type:"structure"` + + // The unique id of the channel. + Id *string `locationName:"id" type:"string"` + + // List of input attachments for channel. + InputAttachments []*InputAttachment `locationName:"inputAttachments" type:"list"` + + InputSpecification *InputSpecification `locationName:"inputSpecification" type:"structure"` + + // The log level being written to CloudWatch Logs. + LogLevel *string `locationName:"logLevel" type:"string" enum:"LogLevel"` + + // The name of the channel. (user-mutable) + Name *string `locationName:"name" type:"string"` + + // Runtime details for the pipelines of a running channel. + PipelineDetails []*PipelineDetail `locationName:"pipelineDetails" type:"list"` + + // The number of currently healthy pipelines. + PipelinesRunningCount *int64 `locationName:"pipelinesRunningCount" type:"integer"` + + // The Amazon Resource Name (ARN) of the role assumed when running the Channel. + RoleArn *string `locationName:"roleArn" type:"string"` + + State *string `locationName:"state" type:"string" enum:"ChannelState"` + + // A collection of key-value pairs. + Tags map[string]*string `locationName:"tags" type:"map"` } // String returns the string representation -func (s AudioChannelMapping) String() string { +func (s Channel) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AudioChannelMapping) GoString() string { +func (s Channel) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AudioChannelMapping) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AudioChannelMapping"} - if s.InputChannelLevels == nil { - invalidParams.Add(request.NewErrParamRequired("InputChannelLevels")) - } - if s.OutputChannel == nil { - invalidParams.Add(request.NewErrParamRequired("OutputChannel")) - } - if s.InputChannelLevels != nil { - for i, v := range s.InputChannelLevels { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputChannelLevels", i), err.(request.ErrInvalidParams)) - } - } - } +// SetArn sets the Arn field's value. +func (s *Channel) SetArn(v string) *Channel { + s.Arn = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetChannelClass sets the ChannelClass field's value. +func (s *Channel) SetChannelClass(v string) *Channel { + s.ChannelClass = &v + return s } -// SetInputChannelLevels sets the InputChannelLevels field's value. -func (s *AudioChannelMapping) SetInputChannelLevels(v []*InputChannelLevel) *AudioChannelMapping { - s.InputChannelLevels = v +// SetDestinations sets the Destinations field's value. +func (s *Channel) SetDestinations(v []*OutputDestination) *Channel { + s.Destinations = v + return s +} + +// SetEgressEndpoints sets the EgressEndpoints field's value. +func (s *Channel) SetEgressEndpoints(v []*ChannelEgressEndpoint) *Channel { + s.EgressEndpoints = v + return s +} + +// SetEncoderSettings sets the EncoderSettings field's value. +func (s *Channel) SetEncoderSettings(v *EncoderSettings) *Channel { + s.EncoderSettings = v return s } -// SetOutputChannel sets the OutputChannel field's value. -func (s *AudioChannelMapping) SetOutputChannel(v int64) *AudioChannelMapping { - s.OutputChannel = &v +// SetId sets the Id field's value. +func (s *Channel) SetId(v string) *Channel { + s.Id = &v return s } -// Audio Codec Settings -type AudioCodecSettings struct { - _ struct{} `type:"structure"` - - // Aac Settings - AacSettings *AacSettings `locationName:"aacSettings" type:"structure"` - - // Ac3 Settings - Ac3Settings *Ac3Settings `locationName:"ac3Settings" type:"structure"` - - // Eac3 Settings - Eac3Settings *Eac3Settings `locationName:"eac3Settings" type:"structure"` - - // Mp2 Settings - Mp2Settings *Mp2Settings `locationName:"mp2Settings" type:"structure"` - - // Pass Through Settings - PassThroughSettings *PassThroughSettings `locationName:"passThroughSettings" type:"structure"` +// SetInputAttachments sets the InputAttachments field's value. +func (s *Channel) SetInputAttachments(v []*InputAttachment) *Channel { + s.InputAttachments = v + return s } -// String returns the string representation -func (s AudioCodecSettings) String() string { - return awsutil.Prettify(s) +// SetInputSpecification sets the InputSpecification field's value. +func (s *Channel) SetInputSpecification(v *InputSpecification) *Channel { + s.InputSpecification = v + return s } -// GoString returns the string representation -func (s AudioCodecSettings) GoString() string { - return s.String() +// SetLogLevel sets the LogLevel field's value. +func (s *Channel) SetLogLevel(v string) *Channel { + s.LogLevel = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AudioCodecSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AudioCodecSettings"} - if s.Ac3Settings != nil { - if err := s.Ac3Settings.Validate(); err != nil { - invalidParams.AddNested("Ac3Settings", err.(request.ErrInvalidParams)) - } - } - if s.Eac3Settings != nil { - if err := s.Eac3Settings.Validate(); err != nil { - invalidParams.AddNested("Eac3Settings", err.(request.ErrInvalidParams)) - } - } +// SetName sets the Name field's value. +func (s *Channel) SetName(v string) *Channel { + s.Name = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetPipelineDetails sets the PipelineDetails field's value. +func (s *Channel) SetPipelineDetails(v []*PipelineDetail) *Channel { + s.PipelineDetails = v + return s } -// SetAacSettings sets the AacSettings field's value. -func (s *AudioCodecSettings) SetAacSettings(v *AacSettings) *AudioCodecSettings { - s.AacSettings = v +// SetPipelinesRunningCount sets the PipelinesRunningCount field's value. +func (s *Channel) SetPipelinesRunningCount(v int64) *Channel { + s.PipelinesRunningCount = &v return s } -// SetAc3Settings sets the Ac3Settings field's value. -func (s *AudioCodecSettings) SetAc3Settings(v *Ac3Settings) *AudioCodecSettings { - s.Ac3Settings = v +// SetRoleArn sets the RoleArn field's value. +func (s *Channel) SetRoleArn(v string) *Channel { + s.RoleArn = &v return s } -// SetEac3Settings sets the Eac3Settings field's value. -func (s *AudioCodecSettings) SetEac3Settings(v *Eac3Settings) *AudioCodecSettings { - s.Eac3Settings = v +// SetState sets the State field's value. +func (s *Channel) SetState(v string) *Channel { + s.State = &v return s } -// SetMp2Settings sets the Mp2Settings field's value. -func (s *AudioCodecSettings) SetMp2Settings(v *Mp2Settings) *AudioCodecSettings { - s.Mp2Settings = v +// SetTags sets the Tags field's value. +func (s *Channel) SetTags(v map[string]*string) *Channel { + s.Tags = v return s } -// SetPassThroughSettings sets the PassThroughSettings field's value. -func (s *AudioCodecSettings) SetPassThroughSettings(v *PassThroughSettings) *AudioCodecSettings { - s.PassThroughSettings = v +type ChannelEgressEndpoint struct { + _ struct{} `type:"structure"` + + // Public IP of where a channel's output comes from + SourceIp *string `locationName:"sourceIp" type:"string"` +} + +// String returns the string representation +func (s ChannelEgressEndpoint) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChannelEgressEndpoint) GoString() string { + return s.String() +} + +// SetSourceIp sets the SourceIp field's value. +func (s *ChannelEgressEndpoint) SetSourceIp(v string) *ChannelEgressEndpoint { + s.SourceIp = &v return s } -// Audio Description -type AudioDescription struct { +type ChannelSummary struct { _ struct{} `type:"structure"` - // Advanced audio normalization settings. - AudioNormalizationSettings *AudioNormalizationSettings `locationName:"audioNormalizationSettings" type:"structure"` + // The unique arn of the channel. + Arn *string `locationName:"arn" type:"string"` - // The name of the AudioSelector used as the source for this AudioDescription. - // - // AudioSelectorName is a required field - AudioSelectorName *string `locationName:"audioSelectorName" type:"string" required:"true"` + // The class for this channel. STANDARD for a channel with two pipelines or + // SINGLE_PIPELINE for a channel with one pipeline. + ChannelClass *string `locationName:"channelClass" type:"string" enum:"ChannelClass"` - // Applies only if audioTypeControl is useConfigured. The values for audioType - // are defined in ISO-IEC 13818-1. - AudioType *string `locationName:"audioType" type:"string" enum:"AudioType"` + // A list of destinations of the channel. For UDP outputs, there is onedestination + // per output. For other types (HLS, for example), there isone destination per + // packager. + Destinations []*OutputDestination `locationName:"destinations" type:"list"` - // Determines how audio type is determined. followInput: If the input contains - // an ISO 639 audioType, then that value is passed through to the output. If - // the input contains no ISO 639 audioType, the value in Audio Type is included - // in the output. useConfigured: The value in Audio Type is included in the - // output.Note that this field and audioType are both ignored if inputType is - // broadcasterMixedAd. - AudioTypeControl *string `locationName:"audioTypeControl" type:"string" enum:"AudioDescriptionAudioTypeControl"` + // The endpoints where outgoing connections initiate from + EgressEndpoints []*ChannelEgressEndpoint `locationName:"egressEndpoints" type:"list"` - // Audio codec settings. - CodecSettings *AudioCodecSettings `locationName:"codecSettings" type:"structure"` + // The unique id of the channel. + Id *string `locationName:"id" type:"string"` - // Indicates the language of the audio output track. Only used if languageControlMode - // is useConfigured, or there is no ISO 639 language code specified in the input. - LanguageCode *string `locationName:"languageCode" min:"3" type:"string"` + // List of input attachments for channel. + InputAttachments []*InputAttachment `locationName:"inputAttachments" type:"list"` - // Choosing followInput will cause the ISO 639 language code of the output to - // follow the ISO 639 language code of the input. The languageCode will be used - // when useConfigured is set, or when followInput is selected but there is no - // ISO 639 language code specified by the input. - LanguageCodeControl *string `locationName:"languageCodeControl" type:"string" enum:"AudioDescriptionLanguageCodeControl"` + InputSpecification *InputSpecification `locationName:"inputSpecification" type:"structure"` - // The name of this AudioDescription. Outputs will use this name to uniquely - // identify this AudioDescription. Description names should be unique within - // this Live Event. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` + // The log level being written to CloudWatch Logs. + LogLevel *string `locationName:"logLevel" type:"string" enum:"LogLevel"` - // Settings that control how input audio channels are remixed into the output - // audio channels. - RemixSettings *RemixSettings `locationName:"remixSettings" type:"structure"` + // The name of the channel. (user-mutable) + Name *string `locationName:"name" type:"string"` - // Used for MS Smooth and Apple HLS outputs. Indicates the name displayed by - // the player (eg. English, or Director Commentary). - StreamName *string `locationName:"streamName" type:"string"` + // The number of currently healthy pipelines. + PipelinesRunningCount *int64 `locationName:"pipelinesRunningCount" type:"integer"` + + // The Amazon Resource Name (ARN) of the role assumed when running the Channel. + RoleArn *string `locationName:"roleArn" type:"string"` + + State *string `locationName:"state" type:"string" enum:"ChannelState"` + + // A collection of key-value pairs. + Tags map[string]*string `locationName:"tags" type:"map"` } // String returns the string representation -func (s AudioDescription) String() string { +func (s ChannelSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AudioDescription) GoString() string { +func (s ChannelSummary) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AudioDescription) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AudioDescription"} - if s.AudioSelectorName == nil { - invalidParams.Add(request.NewErrParamRequired("AudioSelectorName")) - } - if s.LanguageCode != nil && len(*s.LanguageCode) < 3 { - invalidParams.Add(request.NewErrParamMinLen("LanguageCode", 3)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.CodecSettings != nil { - if err := s.CodecSettings.Validate(); err != nil { - invalidParams.AddNested("CodecSettings", err.(request.ErrInvalidParams)) - } - } - if s.RemixSettings != nil { - if err := s.RemixSettings.Validate(); err != nil { - invalidParams.AddNested("RemixSettings", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetArn sets the Arn field's value. +func (s *ChannelSummary) SetArn(v string) *ChannelSummary { + s.Arn = &v + return s } -// SetAudioNormalizationSettings sets the AudioNormalizationSettings field's value. -func (s *AudioDescription) SetAudioNormalizationSettings(v *AudioNormalizationSettings) *AudioDescription { - s.AudioNormalizationSettings = v +// SetChannelClass sets the ChannelClass field's value. +func (s *ChannelSummary) SetChannelClass(v string) *ChannelSummary { + s.ChannelClass = &v return s } -// SetAudioSelectorName sets the AudioSelectorName field's value. -func (s *AudioDescription) SetAudioSelectorName(v string) *AudioDescription { - s.AudioSelectorName = &v +// SetDestinations sets the Destinations field's value. +func (s *ChannelSummary) SetDestinations(v []*OutputDestination) *ChannelSummary { + s.Destinations = v return s } -// SetAudioType sets the AudioType field's value. -func (s *AudioDescription) SetAudioType(v string) *AudioDescription { - s.AudioType = &v +// SetEgressEndpoints sets the EgressEndpoints field's value. +func (s *ChannelSummary) SetEgressEndpoints(v []*ChannelEgressEndpoint) *ChannelSummary { + s.EgressEndpoints = v return s } -// SetAudioTypeControl sets the AudioTypeControl field's value. -func (s *AudioDescription) SetAudioTypeControl(v string) *AudioDescription { - s.AudioTypeControl = &v +// SetId sets the Id field's value. +func (s *ChannelSummary) SetId(v string) *ChannelSummary { + s.Id = &v return s } -// SetCodecSettings sets the CodecSettings field's value. -func (s *AudioDescription) SetCodecSettings(v *AudioCodecSettings) *AudioDescription { - s.CodecSettings = v +// SetInputAttachments sets the InputAttachments field's value. +func (s *ChannelSummary) SetInputAttachments(v []*InputAttachment) *ChannelSummary { + s.InputAttachments = v return s } -// SetLanguageCode sets the LanguageCode field's value. -func (s *AudioDescription) SetLanguageCode(v string) *AudioDescription { - s.LanguageCode = &v +// SetInputSpecification sets the InputSpecification field's value. +func (s *ChannelSummary) SetInputSpecification(v *InputSpecification) *ChannelSummary { + s.InputSpecification = v return s } -// SetLanguageCodeControl sets the LanguageCodeControl field's value. -func (s *AudioDescription) SetLanguageCodeControl(v string) *AudioDescription { - s.LanguageCodeControl = &v +// SetLogLevel sets the LogLevel field's value. +func (s *ChannelSummary) SetLogLevel(v string) *ChannelSummary { + s.LogLevel = &v return s } // SetName sets the Name field's value. -func (s *AudioDescription) SetName(v string) *AudioDescription { +func (s *ChannelSummary) SetName(v string) *ChannelSummary { s.Name = &v return s } -// SetRemixSettings sets the RemixSettings field's value. -func (s *AudioDescription) SetRemixSettings(v *RemixSettings) *AudioDescription { - s.RemixSettings = v +// SetPipelinesRunningCount sets the PipelinesRunningCount field's value. +func (s *ChannelSummary) SetPipelinesRunningCount(v int64) *ChannelSummary { + s.PipelinesRunningCount = &v return s } -// SetStreamName sets the StreamName field's value. -func (s *AudioDescription) SetStreamName(v string) *AudioDescription { - s.StreamName = &v +// SetRoleArn sets the RoleArn field's value. +func (s *ChannelSummary) SetRoleArn(v string) *ChannelSummary { + s.RoleArn = &v return s } -// Audio Language Selection -type AudioLanguageSelection struct { - _ struct{} `type:"structure"` +// SetState sets the State field's value. +func (s *ChannelSummary) SetState(v string) *ChannelSummary { + s.State = &v + return s +} - // Selects a specific three-letter language code from within an audio source. - // - // LanguageCode is a required field - LanguageCode *string `locationName:"languageCode" type:"string" required:"true"` +// SetTags sets the Tags field's value. +func (s *ChannelSummary) SetTags(v map[string]*string) *ChannelSummary { + s.Tags = v + return s +} - // When set to "strict", the transport stream demux strictly identifies audio - // streams by their language descriptor. If a PMT update occurs such that an - // audio stream matching the initially selected language is no longer present - // then mute will be encoded until the language returns. If "loose", then on - // a PMT update the demux will choose another audio stream in the program with - // the same stream type if it can't find one with the same language. - LanguageSelectionPolicy *string `locationName:"languageSelectionPolicy" type:"string" enum:"AudioLanguageSelectionPolicy"` +// Passthrough applies no color space conversion to the output +type ColorSpacePassthroughSettings struct { + _ struct{} `type:"structure"` } // String returns the string representation -func (s AudioLanguageSelection) String() string { +func (s ColorSpacePassthroughSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AudioLanguageSelection) GoString() string { +func (s ColorSpacePassthroughSettings) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AudioLanguageSelection) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AudioLanguageSelection"} - if s.LanguageCode == nil { - invalidParams.Add(request.NewErrParamRequired("LanguageCode")) - } +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - if invalidParams.Len() > 0 { - return invalidParams - } - return nil + Message_ *string `locationName:"message" type:"string"` } -// SetLanguageCode sets the LanguageCode field's value. -func (s *AudioLanguageSelection) SetLanguageCode(v string) *AudioLanguageSelection { - s.LanguageCode = &v - return s +// String returns the string representation +func (s ConflictException) String() string { + return awsutil.Prettify(s) } -// SetLanguageSelectionPolicy sets the LanguageSelectionPolicy field's value. -func (s *AudioLanguageSelection) SetLanguageSelectionPolicy(v string) *AudioLanguageSelection { - s.LanguageSelectionPolicy = &v - return s +// GoString returns the string representation +func (s ConflictException) GoString() string { + return s.String() } -// Audio Normalization Settings -type AudioNormalizationSettings struct { - _ struct{} `type:"structure"` - - // Audio normalization algorithm to use. itu17701 conforms to the CALM Act specification, - // itu17702 conforms to the EBU R-128 specification. - Algorithm *string `locationName:"algorithm" type:"string" enum:"AudioNormalizationAlgorithm"` - - // When set to correctAudio the output audio is corrected using the chosen algorithm. - // If set to measureOnly, the audio will be measured but not adjusted. - AlgorithmControl *string `locationName:"algorithmControl" type:"string" enum:"AudioNormalizationAlgorithmControl"` +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, + } +} - // Target LKFS(loudness) to adjust volume to. If no value is entered, a default - // value will be used according to the chosen algorithm. The CALM Act (1770-1) - // recommends a target of -24 LKFS. The EBU R-128 specification (1770-2) recommends - // a target of -23 LKFS. - TargetLkfs *float64 `locationName:"targetLkfs" type:"double"` +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" } -// String returns the string representation -func (s AudioNormalizationSettings) String() string { - return awsutil.Prettify(s) +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// GoString returns the string representation -func (s AudioNormalizationSettings) GoString() string { - return s.String() +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil } -// SetAlgorithm sets the Algorithm field's value. -func (s *AudioNormalizationSettings) SetAlgorithm(v string) *AudioNormalizationSettings { - s.Algorithm = &v - return s +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetAlgorithmControl sets the AlgorithmControl field's value. -func (s *AudioNormalizationSettings) SetAlgorithmControl(v string) *AudioNormalizationSettings { - s.AlgorithmControl = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetTargetLkfs sets the TargetLkfs field's value. -func (s *AudioNormalizationSettings) SetTargetLkfs(v float64) *AudioNormalizationSettings { - s.TargetLkfs = &v - return s +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID } -// Audio Only Hls Settings -type AudioOnlyHlsSettings struct { +type CreateChannelInput struct { _ struct{} `type:"structure"` - // Specifies the group to which the audio Rendition belongs. - AudioGroupId *string `locationName:"audioGroupId" type:"string"` + // A standard channel has two encoding pipelines and a single pipeline channel + // only has one. + ChannelClass *string `locationName:"channelClass" type:"string" enum:"ChannelClass"` - // Optional. Specifies the .jpg or .png image to use as the cover art for an - // audio-only output. We recommend a low bit-size file because the image increases - // the output audio bandwidth.The image is attached to the audio as an ID3 tag, - // frame type APIC, picture type 0x10, as per the "ID3 tag version 2.4.0 - Native - // Frames" standard. - AudioOnlyImage *InputLocation `locationName:"audioOnlyImage" type:"structure"` + Destinations []*OutputDestination `locationName:"destinations" type:"list"` - // Four types of audio-only tracks are supported:Audio-Only Variant StreamThe - // client can play back this audio-only stream instead of video in low-bandwidth - // scenarios. Represented as an EXT-X-STREAM-INF in the HLS manifest.Alternate - // Audio, Auto Select, DefaultAlternate rendition that the client should try - // to play back by default. Represented as an EXT-X-MEDIA in the HLS manifest - // with DEFAULT=YES, AUTOSELECT=YESAlternate Audio, Auto Select, Not DefaultAlternate - // rendition that the client may try to play back by default. Represented as - // an EXT-X-MEDIA in the HLS manifest with DEFAULT=NO, AUTOSELECT=YESAlternate - // Audio, not Auto SelectAlternate rendition that the client will not try to - // play back by default. Represented as an EXT-X-MEDIA in the HLS manifest with - // DEFAULT=NO, AUTOSELECT=NO - AudioTrackType *string `locationName:"audioTrackType" type:"string" enum:"AudioOnlyHlsTrackType"` + // Encoder Settings + EncoderSettings *EncoderSettings `locationName:"encoderSettings" type:"structure"` + + InputAttachments []*InputAttachment `locationName:"inputAttachments" type:"list"` + + InputSpecification *InputSpecification `locationName:"inputSpecification" type:"structure"` + + // The log level the user wants for their channel. + LogLevel *string `locationName:"logLevel" type:"string" enum:"LogLevel"` + + Name *string `locationName:"name" type:"string"` + + RequestId *string `locationName:"requestId" type:"string" idempotencyToken:"true"` + + Reserved *string `locationName:"reserved" deprecated:"true" type:"string"` + + RoleArn *string `locationName:"roleArn" type:"string"` + + Tags map[string]*string `locationName:"tags" type:"map"` } // String returns the string representation -func (s AudioOnlyHlsSettings) String() string { +func (s CreateChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AudioOnlyHlsSettings) GoString() string { +func (s CreateChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *AudioOnlyHlsSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AudioOnlyHlsSettings"} - if s.AudioOnlyImage != nil { - if err := s.AudioOnlyImage.Validate(); err != nil { - invalidParams.AddNested("AudioOnlyImage", err.(request.ErrInvalidParams)) +func (s *CreateChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateChannelInput"} + if s.Destinations != nil { + for i, v := range s.Destinations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Destinations", i), err.(request.ErrInvalidParams)) + } + } + } + if s.EncoderSettings != nil { + if err := s.EncoderSettings.Validate(); err != nil { + invalidParams.AddNested("EncoderSettings", err.(request.ErrInvalidParams)) + } + } + if s.InputAttachments != nil { + for i, v := range s.InputAttachments { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputAttachments", i), err.(request.ErrInvalidParams)) + } } } @@ -3972,99 +7113,138 @@ func (s *AudioOnlyHlsSettings) Validate() error { return nil } -// SetAudioGroupId sets the AudioGroupId field's value. -func (s *AudioOnlyHlsSettings) SetAudioGroupId(v string) *AudioOnlyHlsSettings { - s.AudioGroupId = &v +// SetChannelClass sets the ChannelClass field's value. +func (s *CreateChannelInput) SetChannelClass(v string) *CreateChannelInput { + s.ChannelClass = &v return s } -// SetAudioOnlyImage sets the AudioOnlyImage field's value. -func (s *AudioOnlyHlsSettings) SetAudioOnlyImage(v *InputLocation) *AudioOnlyHlsSettings { - s.AudioOnlyImage = v +// SetDestinations sets the Destinations field's value. +func (s *CreateChannelInput) SetDestinations(v []*OutputDestination) *CreateChannelInput { + s.Destinations = v return s } -// SetAudioTrackType sets the AudioTrackType field's value. -func (s *AudioOnlyHlsSettings) SetAudioTrackType(v string) *AudioOnlyHlsSettings { - s.AudioTrackType = &v +// SetEncoderSettings sets the EncoderSettings field's value. +func (s *CreateChannelInput) SetEncoderSettings(v *EncoderSettings) *CreateChannelInput { + s.EncoderSettings = v + return s +} + +// SetInputAttachments sets the InputAttachments field's value. +func (s *CreateChannelInput) SetInputAttachments(v []*InputAttachment) *CreateChannelInput { + s.InputAttachments = v + return s +} + +// SetInputSpecification sets the InputSpecification field's value. +func (s *CreateChannelInput) SetInputSpecification(v *InputSpecification) *CreateChannelInput { + s.InputSpecification = v + return s +} + +// SetLogLevel sets the LogLevel field's value. +func (s *CreateChannelInput) SetLogLevel(v string) *CreateChannelInput { + s.LogLevel = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateChannelInput) SetName(v string) *CreateChannelInput { + s.Name = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateChannelInput) SetRequestId(v string) *CreateChannelInput { + s.RequestId = &v + return s +} + +// SetReserved sets the Reserved field's value. +func (s *CreateChannelInput) SetReserved(v string) *CreateChannelInput { + s.Reserved = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *CreateChannelInput) SetRoleArn(v string) *CreateChannelInput { + s.RoleArn = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateChannelInput) SetTags(v map[string]*string) *CreateChannelInput { + s.Tags = v return s } -// Audio Pid Selection -type AudioPidSelection struct { +type CreateChannelOutput struct { _ struct{} `type:"structure"` - // Selects a specific PID from within a source. - // - // Pid is a required field - Pid *int64 `locationName:"pid" type:"integer" required:"true"` + Channel *Channel `locationName:"channel" type:"structure"` } // String returns the string representation -func (s AudioPidSelection) String() string { +func (s CreateChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AudioPidSelection) GoString() string { +func (s CreateChannelOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AudioPidSelection) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AudioPidSelection"} - if s.Pid == nil { - invalidParams.Add(request.NewErrParamRequired("Pid")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPid sets the Pid field's value. -func (s *AudioPidSelection) SetPid(v int64) *AudioPidSelection { - s.Pid = &v +// SetChannel sets the Channel field's value. +func (s *CreateChannelOutput) SetChannel(v *Channel) *CreateChannelOutput { + s.Channel = v return s } -// Audio Selector -type AudioSelector struct { +type CreateInputInput struct { _ struct{} `type:"structure"` - // The name of this AudioSelector. AudioDescriptions will use this name to uniquely - // identify this Selector. Selector names should be unique per input. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` + Destinations []*InputDestinationRequest `locationName:"destinations" type:"list"` - // The audio selector settings. - SelectorSettings *AudioSelectorSettings `locationName:"selectorSettings" type:"structure"` + InputSecurityGroups []*string `locationName:"inputSecurityGroups" type:"list"` + + MediaConnectFlows []*MediaConnectFlowRequest `locationName:"mediaConnectFlows" type:"list"` + + Name *string `locationName:"name" type:"string"` + + RequestId *string `locationName:"requestId" type:"string" idempotencyToken:"true"` + + RoleArn *string `locationName:"roleArn" type:"string"` + + Sources []*InputSourceRequest `locationName:"sources" type:"list"` + + Tags map[string]*string `locationName:"tags" type:"map"` + + Type *string `locationName:"type" type:"string" enum:"InputType"` + + // Settings for a private VPC Input.When this property is specified, the input + // destination addresses will be created in a VPC rather than with public Internet + // addresses.This property requires setting the roleArn property on Input creation.Not + // compatible with the inputSecurityGroups property. + Vpc *InputVpcRequest `locationName:"vpc" type:"structure"` } // String returns the string representation -func (s AudioSelector) String() string { +func (s CreateInputInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AudioSelector) GoString() string { +func (s CreateInputInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *AudioSelector) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AudioSelector"} - 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.SelectorSettings != nil { - if err := s.SelectorSettings.Validate(); err != nil { - invalidParams.AddNested("SelectorSettings", err.(request.ErrInvalidParams)) +func (s *CreateInputInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateInputInput"} + if s.Vpc != nil { + if err := s.Vpc.Validate(); err != nil { + invalidParams.AddNested("Vpc", err.(request.ErrInvalidParams)) } } @@ -4074,192 +7254,185 @@ func (s *AudioSelector) Validate() error { return nil } -// SetName sets the Name field's value. -func (s *AudioSelector) SetName(v string) *AudioSelector { - s.Name = &v +// SetDestinations sets the Destinations field's value. +func (s *CreateInputInput) SetDestinations(v []*InputDestinationRequest) *CreateInputInput { + s.Destinations = v return s } -// SetSelectorSettings sets the SelectorSettings field's value. -func (s *AudioSelector) SetSelectorSettings(v *AudioSelectorSettings) *AudioSelector { - s.SelectorSettings = v +// SetInputSecurityGroups sets the InputSecurityGroups field's value. +func (s *CreateInputInput) SetInputSecurityGroups(v []*string) *CreateInputInput { + s.InputSecurityGroups = v return s } -// Audio Selector Settings -type AudioSelectorSettings struct { - _ struct{} `type:"structure"` - - // Audio Language Selection - AudioLanguageSelection *AudioLanguageSelection `locationName:"audioLanguageSelection" type:"structure"` +// SetMediaConnectFlows sets the MediaConnectFlows field's value. +func (s *CreateInputInput) SetMediaConnectFlows(v []*MediaConnectFlowRequest) *CreateInputInput { + s.MediaConnectFlows = v + return s +} - // Audio Pid Selection - AudioPidSelection *AudioPidSelection `locationName:"audioPidSelection" type:"structure"` +// SetName sets the Name field's value. +func (s *CreateInputInput) SetName(v string) *CreateInputInput { + s.Name = &v + return s } -// String returns the string representation -func (s AudioSelectorSettings) String() string { - return awsutil.Prettify(s) +// SetRequestId sets the RequestId field's value. +func (s *CreateInputInput) SetRequestId(v string) *CreateInputInput { + s.RequestId = &v + return s } -// GoString returns the string representation -func (s AudioSelectorSettings) GoString() string { - return s.String() +// SetRoleArn sets the RoleArn field's value. +func (s *CreateInputInput) SetRoleArn(v string) *CreateInputInput { + s.RoleArn = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AudioSelectorSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AudioSelectorSettings"} - if s.AudioLanguageSelection != nil { - if err := s.AudioLanguageSelection.Validate(); err != nil { - invalidParams.AddNested("AudioLanguageSelection", err.(request.ErrInvalidParams)) - } - } - if s.AudioPidSelection != nil { - if err := s.AudioPidSelection.Validate(); err != nil { - invalidParams.AddNested("AudioPidSelection", err.(request.ErrInvalidParams)) - } - } +// SetSources sets the Sources field's value. +func (s *CreateInputInput) SetSources(v []*InputSourceRequest) *CreateInputInput { + s.Sources = v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetTags sets the Tags field's value. +func (s *CreateInputInput) SetTags(v map[string]*string) *CreateInputInput { + s.Tags = v + return s } -// SetAudioLanguageSelection sets the AudioLanguageSelection field's value. -func (s *AudioSelectorSettings) SetAudioLanguageSelection(v *AudioLanguageSelection) *AudioSelectorSettings { - s.AudioLanguageSelection = v +// SetType sets the Type field's value. +func (s *CreateInputInput) SetType(v string) *CreateInputInput { + s.Type = &v return s } -// SetAudioPidSelection sets the AudioPidSelection field's value. -func (s *AudioSelectorSettings) SetAudioPidSelection(v *AudioPidSelection) *AudioSelectorSettings { - s.AudioPidSelection = v +// SetVpc sets the Vpc field's value. +func (s *CreateInputInput) SetVpc(v *InputVpcRequest) *CreateInputInput { + s.Vpc = v return s } -// Avail Blanking -type AvailBlanking struct { +type CreateInputOutput struct { _ struct{} `type:"structure"` - // Blanking image to be used. Leave empty for solid black. Only bmp and png - // images are supported. - AvailBlankingImage *InputLocation `locationName:"availBlankingImage" type:"structure"` - - // When set to enabled, causes video, audio and captions to be blanked when - // insertion metadata is added. - State *string `locationName:"state" type:"string" enum:"AvailBlankingState"` + Input *Input `locationName:"input" type:"structure"` } // String returns the string representation -func (s AvailBlanking) String() string { +func (s CreateInputOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AvailBlanking) GoString() string { +func (s CreateInputOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AvailBlanking) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AvailBlanking"} - if s.AvailBlankingImage != nil { - if err := s.AvailBlankingImage.Validate(); err != nil { - invalidParams.AddNested("AvailBlankingImage", err.(request.ErrInvalidParams)) - } - } +// SetInput sets the Input field's value. +func (s *CreateInputOutput) SetInput(v *Input) *CreateInputOutput { + s.Input = v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +type CreateInputSecurityGroupInput struct { + _ struct{} `type:"structure"` + + Tags map[string]*string `locationName:"tags" type:"map"` + + WhitelistRules []*InputWhitelistRuleCidr `locationName:"whitelistRules" type:"list"` } -// SetAvailBlankingImage sets the AvailBlankingImage field's value. -func (s *AvailBlanking) SetAvailBlankingImage(v *InputLocation) *AvailBlanking { - s.AvailBlankingImage = v +// String returns the string representation +func (s CreateInputSecurityGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateInputSecurityGroupInput) GoString() string { + return s.String() +} + +// SetTags sets the Tags field's value. +func (s *CreateInputSecurityGroupInput) SetTags(v map[string]*string) *CreateInputSecurityGroupInput { + s.Tags = v return s } -// SetState sets the State field's value. -func (s *AvailBlanking) SetState(v string) *AvailBlanking { - s.State = &v +// SetWhitelistRules sets the WhitelistRules field's value. +func (s *CreateInputSecurityGroupInput) SetWhitelistRules(v []*InputWhitelistRuleCidr) *CreateInputSecurityGroupInput { + s.WhitelistRules = v return s } -// Avail Configuration -type AvailConfiguration struct { +type CreateInputSecurityGroupOutput struct { _ struct{} `type:"structure"` - // Ad avail settings. - AvailSettings *AvailSettings `locationName:"availSettings" type:"structure"` + // An Input Security Group + SecurityGroup *InputSecurityGroup `locationName:"securityGroup" type:"structure"` } // String returns the string representation -func (s AvailConfiguration) String() string { +func (s CreateInputSecurityGroupOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AvailConfiguration) GoString() string { +func (s CreateInputSecurityGroupOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AvailConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AvailConfiguration"} - if s.AvailSettings != nil { - if err := s.AvailSettings.Validate(); err != nil { - invalidParams.AddNested("AvailSettings", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAvailSettings sets the AvailSettings field's value. -func (s *AvailConfiguration) SetAvailSettings(v *AvailSettings) *AvailConfiguration { - s.AvailSettings = v +// SetSecurityGroup sets the SecurityGroup field's value. +func (s *CreateInputSecurityGroupOutput) SetSecurityGroup(v *InputSecurityGroup) *CreateInputSecurityGroupOutput { + s.SecurityGroup = v return s } -// Avail Settings -type AvailSettings struct { +type CreateMultiplexInput struct { _ struct{} `type:"structure"` - // Scte35 Splice Insert - Scte35SpliceInsert *Scte35SpliceInsert `locationName:"scte35SpliceInsert" type:"structure"` + // AvailabilityZones is a required field + AvailabilityZones []*string `locationName:"availabilityZones" type:"list" required:"true"` - // Scte35 Time Signal Apos - Scte35TimeSignalApos *Scte35TimeSignalApos `locationName:"scte35TimeSignalApos" type:"structure"` + // Contains configuration for a Multiplex event + // + // MultiplexSettings is a required field + MultiplexSettings *MultiplexSettings `locationName:"multiplexSettings" type:"structure" required:"true"` + + // Name is a required field + Name *string `locationName:"name" type:"string" required:"true"` + + RequestId *string `locationName:"requestId" type:"string" idempotencyToken:"true"` + + Tags map[string]*string `locationName:"tags" type:"map"` } // String returns the string representation -func (s AvailSettings) String() string { +func (s CreateMultiplexInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AvailSettings) GoString() string { +func (s CreateMultiplexInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *AvailSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AvailSettings"} - if s.Scte35SpliceInsert != nil { - if err := s.Scte35SpliceInsert.Validate(); err != nil { - invalidParams.AddNested("Scte35SpliceInsert", err.(request.ErrInvalidParams)) - } +func (s *CreateMultiplexInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateMultiplexInput"} + if s.AvailabilityZones == nil { + invalidParams.Add(request.NewErrParamRequired("AvailabilityZones")) } - if s.Scte35TimeSignalApos != nil { - if err := s.Scte35TimeSignalApos.Validate(); err != nil { - invalidParams.AddNested("Scte35TimeSignalApos", err.(request.ErrInvalidParams)) + if s.MultiplexSettings == nil { + invalidParams.Add(request.NewErrParamRequired("MultiplexSettings")) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.MultiplexSettings != nil { + if err := s.MultiplexSettings.Validate(); err != nil { + invalidParams.AddNested("MultiplexSettings", err.(request.ErrInvalidParams)) } } @@ -4269,53 +7442,104 @@ func (s *AvailSettings) Validate() error { return nil } -// SetScte35SpliceInsert sets the Scte35SpliceInsert field's value. -func (s *AvailSettings) SetScte35SpliceInsert(v *Scte35SpliceInsert) *AvailSettings { - s.Scte35SpliceInsert = v +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *CreateMultiplexInput) SetAvailabilityZones(v []*string) *CreateMultiplexInput { + s.AvailabilityZones = v return s } -// SetScte35TimeSignalApos sets the Scte35TimeSignalApos field's value. -func (s *AvailSettings) SetScte35TimeSignalApos(v *Scte35TimeSignalApos) *AvailSettings { - s.Scte35TimeSignalApos = v +// SetMultiplexSettings sets the MultiplexSettings field's value. +func (s *CreateMultiplexInput) SetMultiplexSettings(v *MultiplexSettings) *CreateMultiplexInput { + s.MultiplexSettings = v return s } -// A list of schedule actions to create (in a request) or that have been created -// (in a response). -type BatchScheduleActionCreateRequest struct { +// SetName sets the Name field's value. +func (s *CreateMultiplexInput) SetName(v string) *CreateMultiplexInput { + s.Name = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateMultiplexInput) SetRequestId(v string) *CreateMultiplexInput { + s.RequestId = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateMultiplexInput) SetTags(v map[string]*string) *CreateMultiplexInput { + s.Tags = v + return s +} + +type CreateMultiplexOutput struct { _ struct{} `type:"structure"` - // A list of schedule actions to create. + // The multiplex object. + Multiplex *Multiplex `locationName:"multiplex" type:"structure"` +} + +// String returns the string representation +func (s CreateMultiplexOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateMultiplexOutput) GoString() string { + return s.String() +} + +// SetMultiplex sets the Multiplex field's value. +func (s *CreateMultiplexOutput) SetMultiplex(v *Multiplex) *CreateMultiplexOutput { + s.Multiplex = v + return s +} + +type CreateMultiplexProgramInput struct { + _ struct{} `type:"structure"` + + // MultiplexId is a required field + MultiplexId *string `location:"uri" locationName:"multiplexId" type:"string" required:"true"` + + // Multiplex Program settings configuration. // - // ScheduleActions is a required field - ScheduleActions []*ScheduleAction `locationName:"scheduleActions" type:"list" required:"true"` + // MultiplexProgramSettings is a required field + MultiplexProgramSettings *MultiplexProgramSettings `locationName:"multiplexProgramSettings" type:"structure" required:"true"` + + // ProgramName is a required field + ProgramName *string `locationName:"programName" type:"string" required:"true"` + + RequestId *string `locationName:"requestId" type:"string" idempotencyToken:"true"` } // String returns the string representation -func (s BatchScheduleActionCreateRequest) String() string { +func (s CreateMultiplexProgramInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchScheduleActionCreateRequest) GoString() string { +func (s CreateMultiplexProgramInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *BatchScheduleActionCreateRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchScheduleActionCreateRequest"} - if s.ScheduleActions == nil { - invalidParams.Add(request.NewErrParamRequired("ScheduleActions")) +func (s *CreateMultiplexProgramInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateMultiplexProgramInput"} + if s.MultiplexId == nil { + invalidParams.Add(request.NewErrParamRequired("MultiplexId")) } - if s.ScheduleActions != nil { - for i, v := range s.ScheduleActions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ScheduleActions", i), err.(request.ErrInvalidParams)) - } + if s.MultiplexId != nil && len(*s.MultiplexId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MultiplexId", 1)) + } + if s.MultiplexProgramSettings == nil { + invalidParams.Add(request.NewErrParamRequired("MultiplexProgramSettings")) + } + if s.ProgramName == nil { + invalidParams.Add(request.NewErrParamRequired("ProgramName")) + } + if s.MultiplexProgramSettings != nil { + if err := s.MultiplexProgramSettings.Validate(); err != nil { + invalidParams.AddNested("MultiplexProgramSettings", err.(request.ErrInvalidParams)) } } @@ -4325,63 +7549,80 @@ func (s *BatchScheduleActionCreateRequest) Validate() error { return nil } -// SetScheduleActions sets the ScheduleActions field's value. -func (s *BatchScheduleActionCreateRequest) SetScheduleActions(v []*ScheduleAction) *BatchScheduleActionCreateRequest { - s.ScheduleActions = v +// SetMultiplexId sets the MultiplexId field's value. +func (s *CreateMultiplexProgramInput) SetMultiplexId(v string) *CreateMultiplexProgramInput { + s.MultiplexId = &v return s } -// List of actions that have been created in the schedule. -type BatchScheduleActionCreateResult struct { +// SetMultiplexProgramSettings sets the MultiplexProgramSettings field's value. +func (s *CreateMultiplexProgramInput) SetMultiplexProgramSettings(v *MultiplexProgramSettings) *CreateMultiplexProgramInput { + s.MultiplexProgramSettings = v + return s +} + +// SetProgramName sets the ProgramName field's value. +func (s *CreateMultiplexProgramInput) SetProgramName(v string) *CreateMultiplexProgramInput { + s.ProgramName = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateMultiplexProgramInput) SetRequestId(v string) *CreateMultiplexProgramInput { + s.RequestId = &v + return s +} + +type CreateMultiplexProgramOutput struct { _ struct{} `type:"structure"` - // List of actions that have been created in the schedule. - // - // ScheduleActions is a required field - ScheduleActions []*ScheduleAction `locationName:"scheduleActions" type:"list" required:"true"` + // The multiplex program object. + MultiplexProgram *MultiplexProgram `locationName:"multiplexProgram" type:"structure"` } // String returns the string representation -func (s BatchScheduleActionCreateResult) String() string { +func (s CreateMultiplexProgramOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchScheduleActionCreateResult) GoString() string { +func (s CreateMultiplexProgramOutput) GoString() string { return s.String() } -// SetScheduleActions sets the ScheduleActions field's value. -func (s *BatchScheduleActionCreateResult) SetScheduleActions(v []*ScheduleAction) *BatchScheduleActionCreateResult { - s.ScheduleActions = v +// SetMultiplexProgram sets the MultiplexProgram field's value. +func (s *CreateMultiplexProgramOutput) SetMultiplexProgram(v *MultiplexProgram) *CreateMultiplexProgramOutput { + s.MultiplexProgram = v return s } -// A list of schedule actions to delete. -type BatchScheduleActionDeleteRequest struct { +type CreateTagsInput struct { _ struct{} `type:"structure"` - // A list of schedule actions to delete. - // - // ActionNames is a required field - ActionNames []*string `locationName:"actionNames" type:"list" required:"true"` + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` + + Tags map[string]*string `locationName:"tags" type:"map"` } // String returns the string representation -func (s BatchScheduleActionDeleteRequest) String() string { +func (s CreateTagsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchScheduleActionDeleteRequest) GoString() string { +func (s CreateTagsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *BatchScheduleActionDeleteRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchScheduleActionDeleteRequest"} - if s.ActionNames == nil { - invalidParams.Add(request.NewErrParamRequired("ActionNames")) +func (s *CreateTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTagsInput"} + 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 { @@ -4390,192 +7631,234 @@ func (s *BatchScheduleActionDeleteRequest) Validate() error { return nil } -// SetActionNames sets the ActionNames field's value. -func (s *BatchScheduleActionDeleteRequest) SetActionNames(v []*string) *BatchScheduleActionDeleteRequest { - s.ActionNames = v +// SetResourceArn sets the ResourceArn field's value. +func (s *CreateTagsInput) SetResourceArn(v string) *CreateTagsInput { + s.ResourceArn = &v return s } -// List of actions that have been deleted from the schedule. -type BatchScheduleActionDeleteResult struct { - _ struct{} `type:"structure"` +// SetTags sets the Tags field's value. +func (s *CreateTagsInput) SetTags(v map[string]*string) *CreateTagsInput { + s.Tags = v + return s +} - // List of actions that have been deleted from the schedule. - // - // ScheduleActions is a required field - ScheduleActions []*ScheduleAction `locationName:"scheduleActions" type:"list" required:"true"` +type CreateTagsOutput struct { + _ struct{} `type:"structure"` } // String returns the string representation -func (s BatchScheduleActionDeleteResult) String() string { +func (s CreateTagsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchScheduleActionDeleteResult) GoString() string { +func (s CreateTagsOutput) GoString() string { return s.String() } -// SetScheduleActions sets the ScheduleActions field's value. -func (s *BatchScheduleActionDeleteResult) SetScheduleActions(v []*ScheduleAction) *BatchScheduleActionDeleteResult { - s.ScheduleActions = v - return s -} - -// A request to create actions (add actions to the schedule), delete actions -// (remove actions from the schedule), or both create and delete actions. -type BatchUpdateScheduleInput struct { +type DeleteChannelInput struct { _ struct{} `type:"structure"` // ChannelId is a required field ChannelId *string `location:"uri" locationName:"channelId" type:"string" required:"true"` - - // Schedule actions to create in the schedule. - Creates *BatchScheduleActionCreateRequest `locationName:"creates" type:"structure"` - - // Schedule actions to delete from the schedule. - Deletes *BatchScheduleActionDeleteRequest `locationName:"deletes" type:"structure"` } // String returns the string representation -func (s BatchUpdateScheduleInput) String() string { +func (s DeleteChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BatchUpdateScheduleInput) GoString() string { +func (s DeleteChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *BatchUpdateScheduleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BatchUpdateScheduleInput"} +func (s *DeleteChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteChannelInput"} if s.ChannelId == nil { invalidParams.Add(request.NewErrParamRequired("ChannelId")) } if s.ChannelId != nil && len(*s.ChannelId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ChannelId", 1)) } - if s.Creates != nil { - if err := s.Creates.Validate(); err != nil { - invalidParams.AddNested("Creates", err.(request.ErrInvalidParams)) - } - } - if s.Deletes != nil { - if err := s.Deletes.Validate(); err != nil { - invalidParams.AddNested("Deletes", err.(request.ErrInvalidParams)) - } + + if invalidParams.Len() > 0 { + return invalidParams } + return nil +} + +// SetChannelId sets the ChannelId field's value. +func (s *DeleteChannelInput) SetChannelId(v string) *DeleteChannelInput { + s.ChannelId = &v + return s +} + +type DeleteChannelOutput struct { + _ struct{} `type:"structure"` + + Arn *string `locationName:"arn" type:"string"` + + // A standard channel has two encoding pipelines and a single pipeline channel + // only has one. + ChannelClass *string `locationName:"channelClass" type:"string" enum:"ChannelClass"` + + Destinations []*OutputDestination `locationName:"destinations" type:"list"` + + EgressEndpoints []*ChannelEgressEndpoint `locationName:"egressEndpoints" type:"list"` + + // Encoder Settings + EncoderSettings *EncoderSettings `locationName:"encoderSettings" type:"structure"` + + Id *string `locationName:"id" type:"string"` + + InputAttachments []*InputAttachment `locationName:"inputAttachments" type:"list"` + + InputSpecification *InputSpecification `locationName:"inputSpecification" type:"structure"` + + // The log level the user wants for their channel. + LogLevel *string `locationName:"logLevel" type:"string" enum:"LogLevel"` + + Name *string `locationName:"name" type:"string"` + + PipelineDetails []*PipelineDetail `locationName:"pipelineDetails" type:"list"` + + PipelinesRunningCount *int64 `locationName:"pipelinesRunningCount" type:"integer"` + + RoleArn *string `locationName:"roleArn" type:"string"` + + State *string `locationName:"state" type:"string" enum:"ChannelState"` + + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s DeleteChannelOutput) String() string { + return awsutil.Prettify(s) +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// GoString returns the string representation +func (s DeleteChannelOutput) GoString() string { + return s.String() } -// SetChannelId sets the ChannelId field's value. -func (s *BatchUpdateScheduleInput) SetChannelId(v string) *BatchUpdateScheduleInput { - s.ChannelId = &v +// SetArn sets the Arn field's value. +func (s *DeleteChannelOutput) SetArn(v string) *DeleteChannelOutput { + s.Arn = &v return s } -// SetCreates sets the Creates field's value. -func (s *BatchUpdateScheduleInput) SetCreates(v *BatchScheduleActionCreateRequest) *BatchUpdateScheduleInput { - s.Creates = v +// SetChannelClass sets the ChannelClass field's value. +func (s *DeleteChannelOutput) SetChannelClass(v string) *DeleteChannelOutput { + s.ChannelClass = &v return s } -// SetDeletes sets the Deletes field's value. -func (s *BatchUpdateScheduleInput) SetDeletes(v *BatchScheduleActionDeleteRequest) *BatchUpdateScheduleInput { - s.Deletes = v +// SetDestinations sets the Destinations field's value. +func (s *DeleteChannelOutput) SetDestinations(v []*OutputDestination) *DeleteChannelOutput { + s.Destinations = v return s } -type BatchUpdateScheduleOutput struct { - _ struct{} `type:"structure"` +// SetEgressEndpoints sets the EgressEndpoints field's value. +func (s *DeleteChannelOutput) SetEgressEndpoints(v []*ChannelEgressEndpoint) *DeleteChannelOutput { + s.EgressEndpoints = v + return s +} - // List of actions that have been created in the schedule. - Creates *BatchScheduleActionCreateResult `locationName:"creates" type:"structure"` +// SetEncoderSettings sets the EncoderSettings field's value. +func (s *DeleteChannelOutput) SetEncoderSettings(v *EncoderSettings) *DeleteChannelOutput { + s.EncoderSettings = v + return s +} - // List of actions that have been deleted from the schedule. - Deletes *BatchScheduleActionDeleteResult `locationName:"deletes" type:"structure"` +// SetId sets the Id field's value. +func (s *DeleteChannelOutput) SetId(v string) *DeleteChannelOutput { + s.Id = &v + return s } -// String returns the string representation -func (s BatchUpdateScheduleOutput) String() string { - return awsutil.Prettify(s) +// SetInputAttachments sets the InputAttachments field's value. +func (s *DeleteChannelOutput) SetInputAttachments(v []*InputAttachment) *DeleteChannelOutput { + s.InputAttachments = v + return s } -// GoString returns the string representation -func (s BatchUpdateScheduleOutput) GoString() string { - return s.String() +// SetInputSpecification sets the InputSpecification field's value. +func (s *DeleteChannelOutput) SetInputSpecification(v *InputSpecification) *DeleteChannelOutput { + s.InputSpecification = v + return s } -// SetCreates sets the Creates field's value. -func (s *BatchUpdateScheduleOutput) SetCreates(v *BatchScheduleActionCreateResult) *BatchUpdateScheduleOutput { - s.Creates = v +// SetLogLevel sets the LogLevel field's value. +func (s *DeleteChannelOutput) SetLogLevel(v string) *DeleteChannelOutput { + s.LogLevel = &v return s } -// SetDeletes sets the Deletes field's value. -func (s *BatchUpdateScheduleOutput) SetDeletes(v *BatchScheduleActionDeleteResult) *BatchUpdateScheduleOutput { - s.Deletes = v +// SetName sets the Name field's value. +func (s *DeleteChannelOutput) SetName(v string) *DeleteChannelOutput { + s.Name = &v return s } -// Blackout Slate -type BlackoutSlate struct { - _ struct{} `type:"structure"` +// SetPipelineDetails sets the PipelineDetails field's value. +func (s *DeleteChannelOutput) SetPipelineDetails(v []*PipelineDetail) *DeleteChannelOutput { + s.PipelineDetails = v + return s +} - // Blackout slate image to be used. Leave empty for solid black. Only bmp and - // png images are supported. - BlackoutSlateImage *InputLocation `locationName:"blackoutSlateImage" type:"structure"` +// SetPipelinesRunningCount sets the PipelinesRunningCount field's value. +func (s *DeleteChannelOutput) SetPipelinesRunningCount(v int64) *DeleteChannelOutput { + s.PipelinesRunningCount = &v + return s +} - // Setting to enabled causes the encoder to blackout the video, audio, and captions, - // and raise the "Network Blackout Image" slate when an SCTE104/35 Network End - // Segmentation Descriptor is encountered. The blackout will be lifted when - // the Network Start Segmentation Descriptor is encountered. The Network End - // and Network Start descriptors must contain a network ID that matches the - // value entered in "Network ID". - NetworkEndBlackout *string `locationName:"networkEndBlackout" type:"string" enum:"BlackoutSlateNetworkEndBlackout"` +// SetRoleArn sets the RoleArn field's value. +func (s *DeleteChannelOutput) SetRoleArn(v string) *DeleteChannelOutput { + s.RoleArn = &v + return s +} - // Path to local file to use as Network End Blackout image. Image will be scaled - // to fill the entire output raster. - NetworkEndBlackoutImage *InputLocation `locationName:"networkEndBlackoutImage" type:"structure"` +// SetState sets the State field's value. +func (s *DeleteChannelOutput) SetState(v string) *DeleteChannelOutput { + s.State = &v + return s +} - // Provides Network ID that matches EIDR ID format (e.g., "10.XXXX/XXXX-XXXX-XXXX-XXXX-XXXX-C"). - NetworkId *string `locationName:"networkId" min:"34" type:"string"` +// SetTags sets the Tags field's value. +func (s *DeleteChannelOutput) SetTags(v map[string]*string) *DeleteChannelOutput { + s.Tags = v + return s +} - // When set to enabled, causes video, audio and captions to be blanked when - // indicated by program metadata. - State *string `locationName:"state" type:"string" enum:"BlackoutSlateState"` +type DeleteInputInput struct { + _ struct{} `type:"structure"` + + // InputId is a required field + InputId *string `location:"uri" locationName:"inputId" type:"string" required:"true"` } // String returns the string representation -func (s BlackoutSlate) String() string { +func (s DeleteInputInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BlackoutSlate) GoString() string { +func (s DeleteInputInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *BlackoutSlate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BlackoutSlate"} - if s.NetworkId != nil && len(*s.NetworkId) < 34 { - invalidParams.Add(request.NewErrParamMinLen("NetworkId", 34)) - } - if s.BlackoutSlateImage != nil { - if err := s.BlackoutSlateImage.Validate(); err != nil { - invalidParams.AddNested("BlackoutSlateImage", err.(request.ErrInvalidParams)) - } +func (s *DeleteInputInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteInputInput"} + if s.InputId == nil { + invalidParams.Add(request.NewErrParamRequired("InputId")) } - if s.NetworkEndBlackoutImage != nil { - if err := s.NetworkEndBlackoutImage.Validate(); err != nil { - invalidParams.AddNested("NetworkEndBlackoutImage", err.(request.ErrInvalidParams)) - } + if s.InputId != nil && len(*s.InputId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InputId", 1)) } if invalidParams.Len() > 0 { @@ -4584,154 +7867,104 @@ func (s *BlackoutSlate) Validate() error { return nil } -// SetBlackoutSlateImage sets the BlackoutSlateImage field's value. -func (s *BlackoutSlate) SetBlackoutSlateImage(v *InputLocation) *BlackoutSlate { - s.BlackoutSlateImage = v - return s -} - -// SetNetworkEndBlackout sets the NetworkEndBlackout field's value. -func (s *BlackoutSlate) SetNetworkEndBlackout(v string) *BlackoutSlate { - s.NetworkEndBlackout = &v +// SetInputId sets the InputId field's value. +func (s *DeleteInputInput) SetInputId(v string) *DeleteInputInput { + s.InputId = &v return s } -// SetNetworkEndBlackoutImage sets the NetworkEndBlackoutImage field's value. -func (s *BlackoutSlate) SetNetworkEndBlackoutImage(v *InputLocation) *BlackoutSlate { - s.NetworkEndBlackoutImage = v - return s +type DeleteInputOutput struct { + _ struct{} `type:"structure"` } -// SetNetworkId sets the NetworkId field's value. -func (s *BlackoutSlate) SetNetworkId(v string) *BlackoutSlate { - s.NetworkId = &v - return s +// String returns the string representation +func (s DeleteInputOutput) String() string { + return awsutil.Prettify(s) } -// SetState sets the State field's value. -func (s *BlackoutSlate) SetState(v string) *BlackoutSlate { - s.State = &v - return s +// GoString returns the string representation +func (s DeleteInputOutput) GoString() string { + return s.String() } -// Burn In Destination Settings -type BurnInDestinationSettings struct { +type DeleteInputSecurityGroupInput struct { _ struct{} `type:"structure"` - // If no explicit xPosition or yPosition is provided, setting alignment to centered - // will place the captions at the bottom center of the output. Similarly, setting - // a left alignment will align captions to the bottom left of the output. If - // x and y positions are given in conjunction with the alignment parameter, - // the font will be justified (either left or centered) relative to those coordinates. - // Selecting "smart" justification will left-justify live subtitles and center-justify - // pre-recorded subtitles. All burn-in and DVB-Sub font settings must match. - Alignment *string `locationName:"alignment" type:"string" enum:"BurnInAlignment"` - - // Specifies the color of the rectangle behind the captions. All burn-in and - // DVB-Sub font settings must match. - BackgroundColor *string `locationName:"backgroundColor" type:"string" enum:"BurnInBackgroundColor"` - - // Specifies the opacity of the background rectangle. 255 is opaque; 0 is transparent. - // Leaving this parameter out is equivalent to setting it to 0 (transparent). - // All burn-in and DVB-Sub font settings must match. - BackgroundOpacity *int64 `locationName:"backgroundOpacity" type:"integer"` - - // External font file used for caption burn-in. File extension must be 'ttf' - // or 'tte'. Although the user can select output fonts for many different types - // of input captions, embedded, STL and teletext sources use a strict grid system. - // Using external fonts with these caption sources could cause unexpected display - // of proportional fonts. All burn-in and DVB-Sub font settings must match. - Font *InputLocation `locationName:"font" type:"structure"` - - // Specifies the color of the burned-in captions. This option is not valid for - // source captions that are STL, 608/embedded or teletext. These source settings - // are already pre-defined by the caption stream. All burn-in and DVB-Sub font - // settings must match. - FontColor *string `locationName:"fontColor" type:"string" enum:"BurnInFontColor"` - - // Specifies the opacity of the burned-in captions. 255 is opaque; 0 is transparent. - // All burn-in and DVB-Sub font settings must match. - FontOpacity *int64 `locationName:"fontOpacity" type:"integer"` - - // Font resolution in DPI (dots per inch); default is 96 dpi. All burn-in and - // DVB-Sub font settings must match. - FontResolution *int64 `locationName:"fontResolution" min:"96" type:"integer"` - - // When set to 'auto' fontSize will scale depending on the size of the output. - // Giving a positive integer will specify the exact font size in points. All - // burn-in and DVB-Sub font settings must match. - FontSize *string `locationName:"fontSize" type:"string"` + // InputSecurityGroupId is a required field + InputSecurityGroupId *string `location:"uri" locationName:"inputSecurityGroupId" type:"string" required:"true"` +} - // Specifies font outline color. This option is not valid for source captions - // that are either 608/embedded or teletext. These source settings are already - // pre-defined by the caption stream. All burn-in and DVB-Sub font settings - // must match. - OutlineColor *string `locationName:"outlineColor" type:"string" enum:"BurnInOutlineColor"` +// String returns the string representation +func (s DeleteInputSecurityGroupInput) String() string { + return awsutil.Prettify(s) +} - // Specifies font outline size in pixels. This option is not valid for source - // captions that are either 608/embedded or teletext. These source settings - // are already pre-defined by the caption stream. All burn-in and DVB-Sub font - // settings must match. - OutlineSize *int64 `locationName:"outlineSize" type:"integer"` +// GoString returns the string representation +func (s DeleteInputSecurityGroupInput) GoString() string { + return s.String() +} - // Specifies the color of the shadow cast by the captions. All burn-in and DVB-Sub - // font settings must match. - ShadowColor *string `locationName:"shadowColor" type:"string" enum:"BurnInShadowColor"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteInputSecurityGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteInputSecurityGroupInput"} + if s.InputSecurityGroupId == nil { + invalidParams.Add(request.NewErrParamRequired("InputSecurityGroupId")) + } + if s.InputSecurityGroupId != nil && len(*s.InputSecurityGroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InputSecurityGroupId", 1)) + } - // Specifies the opacity of the shadow. 255 is opaque; 0 is transparent. Leaving - // this parameter out is equivalent to setting it to 0 (transparent). All burn-in - // and DVB-Sub font settings must match. - ShadowOpacity *int64 `locationName:"shadowOpacity" type:"integer"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // Specifies the horizontal offset of the shadow relative to the captions in - // pixels. A value of -2 would result in a shadow offset 2 pixels to the left. - // All burn-in and DVB-Sub font settings must match. - ShadowXOffset *int64 `locationName:"shadowXOffset" type:"integer"` +// SetInputSecurityGroupId sets the InputSecurityGroupId field's value. +func (s *DeleteInputSecurityGroupInput) SetInputSecurityGroupId(v string) *DeleteInputSecurityGroupInput { + s.InputSecurityGroupId = &v + return s +} - // Specifies the vertical offset of the shadow relative to the captions in pixels. - // A value of -2 would result in a shadow offset 2 pixels above the text. All - // burn-in and DVB-Sub font settings must match. - ShadowYOffset *int64 `locationName:"shadowYOffset" type:"integer"` +type DeleteInputSecurityGroupOutput struct { + _ struct{} `type:"structure"` +} - // Controls whether a fixed grid size will be used to generate the output subtitles - // bitmap. Only applicable for Teletext inputs and DVB-Sub/Burn-in outputs. - TeletextGridControl *string `locationName:"teletextGridControl" type:"string" enum:"BurnInTeletextGridControl"` +// String returns the string representation +func (s DeleteInputSecurityGroupOutput) String() string { + return awsutil.Prettify(s) +} - // Specifies the horizontal position of the caption relative to the left side - // of the output in pixels. A value of 10 would result in the captions starting - // 10 pixels from the left of the output. If no explicit xPosition is provided, - // the horizontal caption position will be determined by the alignment parameter. - // All burn-in and DVB-Sub font settings must match. - XPosition *int64 `locationName:"xPosition" type:"integer"` +// GoString returns the string representation +func (s DeleteInputSecurityGroupOutput) GoString() string { + return s.String() +} - // Specifies the vertical position of the caption relative to the top of the - // output in pixels. A value of 10 would result in the captions starting 10 - // pixels from the top of the output. If no explicit yPosition is provided, - // the caption will be positioned towards the bottom of the output. All burn-in - // and DVB-Sub font settings must match. - YPosition *int64 `locationName:"yPosition" type:"integer"` +type DeleteMultiplexInput struct { + _ struct{} `type:"structure"` + + // MultiplexId is a required field + MultiplexId *string `location:"uri" locationName:"multiplexId" type:"string" required:"true"` } // String returns the string representation -func (s BurnInDestinationSettings) String() string { +func (s DeleteMultiplexInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BurnInDestinationSettings) GoString() string { +func (s DeleteMultiplexInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *BurnInDestinationSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BurnInDestinationSettings"} - if s.FontResolution != nil && *s.FontResolution < 96 { - invalidParams.Add(request.NewErrParamMinValue("FontResolution", 96)) +func (s *DeleteMultiplexInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteMultiplexInput"} + if s.MultiplexId == nil { + invalidParams.Add(request.NewErrParamRequired("MultiplexId")) } - if s.Font != nil { - if err := s.Font.Validate(); err != nil { - invalidParams.AddNested("Font", err.(request.ErrInvalidParams)) - } + if s.MultiplexId != nil && len(*s.MultiplexId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MultiplexId", 1)) } if invalidParams.Len() > 0 { @@ -4740,160 +7973,142 @@ func (s *BurnInDestinationSettings) Validate() error { return nil } -// SetAlignment sets the Alignment field's value. -func (s *BurnInDestinationSettings) SetAlignment(v string) *BurnInDestinationSettings { - s.Alignment = &v +// SetMultiplexId sets the MultiplexId field's value. +func (s *DeleteMultiplexInput) SetMultiplexId(v string) *DeleteMultiplexInput { + s.MultiplexId = &v return s } -// SetBackgroundColor sets the BackgroundColor field's value. -func (s *BurnInDestinationSettings) SetBackgroundColor(v string) *BurnInDestinationSettings { - s.BackgroundColor = &v - return s -} +type DeleteMultiplexOutput struct { + _ struct{} `type:"structure"` -// SetBackgroundOpacity sets the BackgroundOpacity field's value. -func (s *BurnInDestinationSettings) SetBackgroundOpacity(v int64) *BurnInDestinationSettings { - s.BackgroundOpacity = &v - return s -} + Arn *string `locationName:"arn" type:"string"` -// SetFont sets the Font field's value. -func (s *BurnInDestinationSettings) SetFont(v *InputLocation) *BurnInDestinationSettings { - s.Font = v - return s -} + AvailabilityZones []*string `locationName:"availabilityZones" type:"list"` -// SetFontColor sets the FontColor field's value. -func (s *BurnInDestinationSettings) SetFontColor(v string) *BurnInDestinationSettings { - s.FontColor = &v - return s + Destinations []*MultiplexOutputDestination `locationName:"destinations" type:"list"` + + Id *string `locationName:"id" type:"string"` + + // Contains configuration for a Multiplex event + MultiplexSettings *MultiplexSettings `locationName:"multiplexSettings" type:"structure"` + + Name *string `locationName:"name" type:"string"` + + PipelinesRunningCount *int64 `locationName:"pipelinesRunningCount" type:"integer"` + + ProgramCount *int64 `locationName:"programCount" type:"integer"` + + // The current state of the multiplex. + State *string `locationName:"state" type:"string" enum:"MultiplexState"` + + Tags map[string]*string `locationName:"tags" type:"map"` } -// SetFontOpacity sets the FontOpacity field's value. -func (s *BurnInDestinationSettings) SetFontOpacity(v int64) *BurnInDestinationSettings { - s.FontOpacity = &v - return s +// String returns the string representation +func (s DeleteMultiplexOutput) String() string { + return awsutil.Prettify(s) } -// SetFontResolution sets the FontResolution field's value. -func (s *BurnInDestinationSettings) SetFontResolution(v int64) *BurnInDestinationSettings { - s.FontResolution = &v - return s +// GoString returns the string representation +func (s DeleteMultiplexOutput) GoString() string { + return s.String() } -// SetFontSize sets the FontSize field's value. -func (s *BurnInDestinationSettings) SetFontSize(v string) *BurnInDestinationSettings { - s.FontSize = &v +// SetArn sets the Arn field's value. +func (s *DeleteMultiplexOutput) SetArn(v string) *DeleteMultiplexOutput { + s.Arn = &v return s } -// SetOutlineColor sets the OutlineColor field's value. -func (s *BurnInDestinationSettings) SetOutlineColor(v string) *BurnInDestinationSettings { - s.OutlineColor = &v +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *DeleteMultiplexOutput) SetAvailabilityZones(v []*string) *DeleteMultiplexOutput { + s.AvailabilityZones = v return s } -// SetOutlineSize sets the OutlineSize field's value. -func (s *BurnInDestinationSettings) SetOutlineSize(v int64) *BurnInDestinationSettings { - s.OutlineSize = &v +// SetDestinations sets the Destinations field's value. +func (s *DeleteMultiplexOutput) SetDestinations(v []*MultiplexOutputDestination) *DeleteMultiplexOutput { + s.Destinations = v return s } -// SetShadowColor sets the ShadowColor field's value. -func (s *BurnInDestinationSettings) SetShadowColor(v string) *BurnInDestinationSettings { - s.ShadowColor = &v +// SetId sets the Id field's value. +func (s *DeleteMultiplexOutput) SetId(v string) *DeleteMultiplexOutput { + s.Id = &v return s } -// SetShadowOpacity sets the ShadowOpacity field's value. -func (s *BurnInDestinationSettings) SetShadowOpacity(v int64) *BurnInDestinationSettings { - s.ShadowOpacity = &v +// SetMultiplexSettings sets the MultiplexSettings field's value. +func (s *DeleteMultiplexOutput) SetMultiplexSettings(v *MultiplexSettings) *DeleteMultiplexOutput { + s.MultiplexSettings = v return s } -// SetShadowXOffset sets the ShadowXOffset field's value. -func (s *BurnInDestinationSettings) SetShadowXOffset(v int64) *BurnInDestinationSettings { - s.ShadowXOffset = &v +// SetName sets the Name field's value. +func (s *DeleteMultiplexOutput) SetName(v string) *DeleteMultiplexOutput { + s.Name = &v return s } -// SetShadowYOffset sets the ShadowYOffset field's value. -func (s *BurnInDestinationSettings) SetShadowYOffset(v int64) *BurnInDestinationSettings { - s.ShadowYOffset = &v +// SetPipelinesRunningCount sets the PipelinesRunningCount field's value. +func (s *DeleteMultiplexOutput) SetPipelinesRunningCount(v int64) *DeleteMultiplexOutput { + s.PipelinesRunningCount = &v return s } -// SetTeletextGridControl sets the TeletextGridControl field's value. -func (s *BurnInDestinationSettings) SetTeletextGridControl(v string) *BurnInDestinationSettings { - s.TeletextGridControl = &v +// SetProgramCount sets the ProgramCount field's value. +func (s *DeleteMultiplexOutput) SetProgramCount(v int64) *DeleteMultiplexOutput { + s.ProgramCount = &v return s } -// SetXPosition sets the XPosition field's value. -func (s *BurnInDestinationSettings) SetXPosition(v int64) *BurnInDestinationSettings { - s.XPosition = &v +// SetState sets the State field's value. +func (s *DeleteMultiplexOutput) SetState(v string) *DeleteMultiplexOutput { + s.State = &v return s } -// SetYPosition sets the YPosition field's value. -func (s *BurnInDestinationSettings) SetYPosition(v int64) *BurnInDestinationSettings { - s.YPosition = &v +// SetTags sets the Tags field's value. +func (s *DeleteMultiplexOutput) SetTags(v map[string]*string) *DeleteMultiplexOutput { + s.Tags = v return s } -// Output groups for this Live Event. Output groups contain information about -// where streams should be distributed. -type CaptionDescription struct { +type DeleteMultiplexProgramInput struct { _ struct{} `type:"structure"` - // Specifies which input caption selector to use as a caption source when generating - // output captions. This field should match a captionSelector name. - // - // CaptionSelectorName is a required field - CaptionSelectorName *string `locationName:"captionSelectorName" type:"string" required:"true"` - - // Additional settings for captions destination that depend on the destination - // type. - DestinationSettings *CaptionDestinationSettings `locationName:"destinationSettings" type:"structure"` - - // ISO 639-2 three-digit code: http://www.loc.gov/standards/iso639-2/ - LanguageCode *string `locationName:"languageCode" type:"string"` - - // Human readable information to indicate captions available for players (eg. - // English, or Spanish). - LanguageDescription *string `locationName:"languageDescription" type:"string"` + // MultiplexId is a required field + MultiplexId *string `location:"uri" locationName:"multiplexId" type:"string" required:"true"` - // Name of the caption description. Used to associate a caption description - // with an output. Names must be unique within an event. - // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` + // ProgramName is a required field + ProgramName *string `location:"uri" locationName:"programName" type:"string" required:"true"` } // String returns the string representation -func (s CaptionDescription) String() string { +func (s DeleteMultiplexProgramInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CaptionDescription) GoString() string { +func (s DeleteMultiplexProgramInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CaptionDescription) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CaptionDescription"} - if s.CaptionSelectorName == nil { - invalidParams.Add(request.NewErrParamRequired("CaptionSelectorName")) +func (s *DeleteMultiplexProgramInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteMultiplexProgramInput"} + if s.MultiplexId == nil { + invalidParams.Add(request.NewErrParamRequired("MultiplexId")) } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) + if s.MultiplexId != nil && len(*s.MultiplexId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MultiplexId", 1)) } - if s.DestinationSettings != nil { - if err := s.DestinationSettings.Validate(); err != nil { - invalidParams.AddNested("DestinationSettings", err.(request.ErrInvalidParams)) - } + if s.ProgramName == nil { + invalidParams.Add(request.NewErrParamRequired("ProgramName")) + } + if s.ProgramName != nil && len(*s.ProgramName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ProgramName", 1)) } if invalidParams.Len() > 0 { @@ -4902,231 +8117,292 @@ func (s *CaptionDescription) Validate() error { return nil } -// SetCaptionSelectorName sets the CaptionSelectorName field's value. -func (s *CaptionDescription) SetCaptionSelectorName(v string) *CaptionDescription { - s.CaptionSelectorName = &v +// SetMultiplexId sets the MultiplexId field's value. +func (s *DeleteMultiplexProgramInput) SetMultiplexId(v string) *DeleteMultiplexProgramInput { + s.MultiplexId = &v return s } -// SetDestinationSettings sets the DestinationSettings field's value. -func (s *CaptionDescription) SetDestinationSettings(v *CaptionDestinationSettings) *CaptionDescription { - s.DestinationSettings = v +// SetProgramName sets the ProgramName field's value. +func (s *DeleteMultiplexProgramInput) SetProgramName(v string) *DeleteMultiplexProgramInput { + s.ProgramName = &v return s } -// SetLanguageCode sets the LanguageCode field's value. -func (s *CaptionDescription) SetLanguageCode(v string) *CaptionDescription { - s.LanguageCode = &v +type DeleteMultiplexProgramOutput struct { + _ struct{} `type:"structure"` + + ChannelId *string `locationName:"channelId" type:"string"` + + // Multiplex Program settings configuration. + MultiplexProgramSettings *MultiplexProgramSettings `locationName:"multiplexProgramSettings" type:"structure"` + + // Packet identifiers map for a given Multiplex program. + PacketIdentifiersMap *MultiplexProgramPacketIdentifiersMap `locationName:"packetIdentifiersMap" type:"structure"` + + ProgramName *string `locationName:"programName" type:"string"` +} + +// String returns the string representation +func (s DeleteMultiplexProgramOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMultiplexProgramOutput) GoString() string { + return s.String() +} + +// SetChannelId sets the ChannelId field's value. +func (s *DeleteMultiplexProgramOutput) SetChannelId(v string) *DeleteMultiplexProgramOutput { + s.ChannelId = &v return s } -// SetLanguageDescription sets the LanguageDescription field's value. -func (s *CaptionDescription) SetLanguageDescription(v string) *CaptionDescription { - s.LanguageDescription = &v +// SetMultiplexProgramSettings sets the MultiplexProgramSettings field's value. +func (s *DeleteMultiplexProgramOutput) SetMultiplexProgramSettings(v *MultiplexProgramSettings) *DeleteMultiplexProgramOutput { + s.MultiplexProgramSettings = v + return s +} + +// SetPacketIdentifiersMap sets the PacketIdentifiersMap field's value. +func (s *DeleteMultiplexProgramOutput) SetPacketIdentifiersMap(v *MultiplexProgramPacketIdentifiersMap) *DeleteMultiplexProgramOutput { + s.PacketIdentifiersMap = v + return s +} + +// SetProgramName sets the ProgramName field's value. +func (s *DeleteMultiplexProgramOutput) SetProgramName(v string) *DeleteMultiplexProgramOutput { + s.ProgramName = &v return s } -// SetName sets the Name field's value. -func (s *CaptionDescription) SetName(v string) *CaptionDescription { - s.Name = &v +type DeleteReservationInput struct { + _ struct{} `type:"structure"` + + // ReservationId is a required field + ReservationId *string `location:"uri" locationName:"reservationId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteReservationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteReservationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteReservationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteReservationInput"} + if s.ReservationId == nil { + invalidParams.Add(request.NewErrParamRequired("ReservationId")) + } + if s.ReservationId != nil && len(*s.ReservationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ReservationId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetReservationId sets the ReservationId field's value. +func (s *DeleteReservationInput) SetReservationId(v string) *DeleteReservationInput { + s.ReservationId = &v return s } -// Caption Destination Settings -type CaptionDestinationSettings struct { +type DeleteReservationOutput struct { _ struct{} `type:"structure"` - // Arib Destination Settings - AribDestinationSettings *AribDestinationSettings `locationName:"aribDestinationSettings" type:"structure"` + Arn *string `locationName:"arn" type:"string"` - // Burn In Destination Settings - BurnInDestinationSettings *BurnInDestinationSettings `locationName:"burnInDestinationSettings" type:"structure"` + Count *int64 `locationName:"count" type:"integer"` - // Dvb Sub Destination Settings - DvbSubDestinationSettings *DvbSubDestinationSettings `locationName:"dvbSubDestinationSettings" type:"structure"` + CurrencyCode *string `locationName:"currencyCode" type:"string"` - // Embedded Destination Settings - EmbeddedDestinationSettings *EmbeddedDestinationSettings `locationName:"embeddedDestinationSettings" type:"structure"` + Duration *int64 `locationName:"duration" type:"integer"` - // Embedded Plus Scte20 Destination Settings - EmbeddedPlusScte20DestinationSettings *EmbeddedPlusScte20DestinationSettings `locationName:"embeddedPlusScte20DestinationSettings" type:"structure"` + // Units for duration, e.g. 'MONTHS' + DurationUnits *string `locationName:"durationUnits" type:"string" enum:"OfferingDurationUnits"` - // Rtmp Caption Info Destination Settings - RtmpCaptionInfoDestinationSettings *RtmpCaptionInfoDestinationSettings `locationName:"rtmpCaptionInfoDestinationSettings" type:"structure"` + End *string `locationName:"end" type:"string"` - // Scte20 Plus Embedded Destination Settings - Scte20PlusEmbeddedDestinationSettings *Scte20PlusEmbeddedDestinationSettings `locationName:"scte20PlusEmbeddedDestinationSettings" type:"structure"` + FixedPrice *float64 `locationName:"fixedPrice" type:"double"` - // Scte27 Destination Settings - Scte27DestinationSettings *Scte27DestinationSettings `locationName:"scte27DestinationSettings" type:"structure"` + Name *string `locationName:"name" type:"string"` - // Smpte Tt Destination Settings - SmpteTtDestinationSettings *SmpteTtDestinationSettings `locationName:"smpteTtDestinationSettings" type:"structure"` + OfferingDescription *string `locationName:"offeringDescription" type:"string"` - // Teletext Destination Settings - TeletextDestinationSettings *TeletextDestinationSettings `locationName:"teletextDestinationSettings" type:"structure"` + OfferingId *string `locationName:"offeringId" type:"string"` - // Ttml Destination Settings - TtmlDestinationSettings *TtmlDestinationSettings `locationName:"ttmlDestinationSettings" type:"structure"` + // Offering type, e.g. 'NO_UPFRONT' + OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingType"` - // Webvtt Destination Settings - WebvttDestinationSettings *WebvttDestinationSettings `locationName:"webvttDestinationSettings" type:"structure"` + Region *string `locationName:"region" type:"string"` + + ReservationId *string `locationName:"reservationId" type:"string"` + + // Resource configuration (codec, resolution, bitrate, ...) + ResourceSpecification *ReservationResourceSpecification `locationName:"resourceSpecification" type:"structure"` + + Start *string `locationName:"start" type:"string"` + + // Current reservation state + State *string `locationName:"state" type:"string" enum:"ReservationState"` + + Tags map[string]*string `locationName:"tags" type:"map"` + + UsagePrice *float64 `locationName:"usagePrice" type:"double"` } // String returns the string representation -func (s CaptionDestinationSettings) String() string { +func (s DeleteReservationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CaptionDestinationSettings) GoString() string { +func (s DeleteReservationOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CaptionDestinationSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CaptionDestinationSettings"} - if s.BurnInDestinationSettings != nil { - if err := s.BurnInDestinationSettings.Validate(); err != nil { - invalidParams.AddNested("BurnInDestinationSettings", err.(request.ErrInvalidParams)) - } - } - if s.DvbSubDestinationSettings != nil { - if err := s.DvbSubDestinationSettings.Validate(); err != nil { - invalidParams.AddNested("DvbSubDestinationSettings", err.(request.ErrInvalidParams)) - } - } +// SetArn sets the Arn field's value. +func (s *DeleteReservationOutput) SetArn(v string) *DeleteReservationOutput { + s.Arn = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCount sets the Count field's value. +func (s *DeleteReservationOutput) SetCount(v int64) *DeleteReservationOutput { + s.Count = &v + return s } -// SetAribDestinationSettings sets the AribDestinationSettings field's value. -func (s *CaptionDestinationSettings) SetAribDestinationSettings(v *AribDestinationSettings) *CaptionDestinationSettings { - s.AribDestinationSettings = v +// SetCurrencyCode sets the CurrencyCode field's value. +func (s *DeleteReservationOutput) SetCurrencyCode(v string) *DeleteReservationOutput { + s.CurrencyCode = &v return s } -// SetBurnInDestinationSettings sets the BurnInDestinationSettings field's value. -func (s *CaptionDestinationSettings) SetBurnInDestinationSettings(v *BurnInDestinationSettings) *CaptionDestinationSettings { - s.BurnInDestinationSettings = v +// SetDuration sets the Duration field's value. +func (s *DeleteReservationOutput) SetDuration(v int64) *DeleteReservationOutput { + s.Duration = &v return s } -// SetDvbSubDestinationSettings sets the DvbSubDestinationSettings field's value. -func (s *CaptionDestinationSettings) SetDvbSubDestinationSettings(v *DvbSubDestinationSettings) *CaptionDestinationSettings { - s.DvbSubDestinationSettings = v +// SetDurationUnits sets the DurationUnits field's value. +func (s *DeleteReservationOutput) SetDurationUnits(v string) *DeleteReservationOutput { + s.DurationUnits = &v return s } -// SetEmbeddedDestinationSettings sets the EmbeddedDestinationSettings field's value. -func (s *CaptionDestinationSettings) SetEmbeddedDestinationSettings(v *EmbeddedDestinationSettings) *CaptionDestinationSettings { - s.EmbeddedDestinationSettings = v +// SetEnd sets the End field's value. +func (s *DeleteReservationOutput) SetEnd(v string) *DeleteReservationOutput { + s.End = &v return s } -// SetEmbeddedPlusScte20DestinationSettings sets the EmbeddedPlusScte20DestinationSettings field's value. -func (s *CaptionDestinationSettings) SetEmbeddedPlusScte20DestinationSettings(v *EmbeddedPlusScte20DestinationSettings) *CaptionDestinationSettings { - s.EmbeddedPlusScte20DestinationSettings = v +// SetFixedPrice sets the FixedPrice field's value. +func (s *DeleteReservationOutput) SetFixedPrice(v float64) *DeleteReservationOutput { + s.FixedPrice = &v return s } -// SetRtmpCaptionInfoDestinationSettings sets the RtmpCaptionInfoDestinationSettings field's value. -func (s *CaptionDestinationSettings) SetRtmpCaptionInfoDestinationSettings(v *RtmpCaptionInfoDestinationSettings) *CaptionDestinationSettings { - s.RtmpCaptionInfoDestinationSettings = v +// SetName sets the Name field's value. +func (s *DeleteReservationOutput) SetName(v string) *DeleteReservationOutput { + s.Name = &v return s } -// SetScte20PlusEmbeddedDestinationSettings sets the Scte20PlusEmbeddedDestinationSettings field's value. -func (s *CaptionDestinationSettings) SetScte20PlusEmbeddedDestinationSettings(v *Scte20PlusEmbeddedDestinationSettings) *CaptionDestinationSettings { - s.Scte20PlusEmbeddedDestinationSettings = v +// SetOfferingDescription sets the OfferingDescription field's value. +func (s *DeleteReservationOutput) SetOfferingDescription(v string) *DeleteReservationOutput { + s.OfferingDescription = &v return s } -// SetScte27DestinationSettings sets the Scte27DestinationSettings field's value. -func (s *CaptionDestinationSettings) SetScte27DestinationSettings(v *Scte27DestinationSettings) *CaptionDestinationSettings { - s.Scte27DestinationSettings = v +// SetOfferingId sets the OfferingId field's value. +func (s *DeleteReservationOutput) SetOfferingId(v string) *DeleteReservationOutput { + s.OfferingId = &v return s } -// SetSmpteTtDestinationSettings sets the SmpteTtDestinationSettings field's value. -func (s *CaptionDestinationSettings) SetSmpteTtDestinationSettings(v *SmpteTtDestinationSettings) *CaptionDestinationSettings { - s.SmpteTtDestinationSettings = v +// SetOfferingType sets the OfferingType field's value. +func (s *DeleteReservationOutput) SetOfferingType(v string) *DeleteReservationOutput { + s.OfferingType = &v return s } -// SetTeletextDestinationSettings sets the TeletextDestinationSettings field's value. -func (s *CaptionDestinationSettings) SetTeletextDestinationSettings(v *TeletextDestinationSettings) *CaptionDestinationSettings { - s.TeletextDestinationSettings = v +// SetRegion sets the Region field's value. +func (s *DeleteReservationOutput) SetRegion(v string) *DeleteReservationOutput { + s.Region = &v return s } -// SetTtmlDestinationSettings sets the TtmlDestinationSettings field's value. -func (s *CaptionDestinationSettings) SetTtmlDestinationSettings(v *TtmlDestinationSettings) *CaptionDestinationSettings { - s.TtmlDestinationSettings = v +// SetReservationId sets the ReservationId field's value. +func (s *DeleteReservationOutput) SetReservationId(v string) *DeleteReservationOutput { + s.ReservationId = &v return s } -// SetWebvttDestinationSettings sets the WebvttDestinationSettings field's value. -func (s *CaptionDestinationSettings) SetWebvttDestinationSettings(v *WebvttDestinationSettings) *CaptionDestinationSettings { - s.WebvttDestinationSettings = v +// SetResourceSpecification sets the ResourceSpecification field's value. +func (s *DeleteReservationOutput) SetResourceSpecification(v *ReservationResourceSpecification) *DeleteReservationOutput { + s.ResourceSpecification = v return s } -// Maps a caption channel to an ISO 693-2 language code (http://www.loc.gov/standards/iso639-2), -// with an optional description. -type CaptionLanguageMapping struct { - _ struct{} `type:"structure"` +// SetStart sets the Start field's value. +func (s *DeleteReservationOutput) SetStart(v string) *DeleteReservationOutput { + s.Start = &v + return s +} - // The closed caption channel being described by this CaptionLanguageMapping. - // Each channel mapping must have a unique channel number (maximum of 4) - // - // CaptionChannel is a required field - CaptionChannel *int64 `locationName:"captionChannel" min:"1" type:"integer" required:"true"` +// SetState sets the State field's value. +func (s *DeleteReservationOutput) SetState(v string) *DeleteReservationOutput { + s.State = &v + return s +} - // Three character ISO 639-2 language code (see http://www.loc.gov/standards/iso639-2) - // - // LanguageCode is a required field - LanguageCode *string `locationName:"languageCode" min:"3" type:"string" required:"true"` +// SetTags sets the Tags field's value. +func (s *DeleteReservationOutput) SetTags(v map[string]*string) *DeleteReservationOutput { + s.Tags = v + return s +} - // Textual description of language - // - // LanguageDescription is a required field - LanguageDescription *string `locationName:"languageDescription" min:"1" type:"string" required:"true"` +// SetUsagePrice sets the UsagePrice field's value. +func (s *DeleteReservationOutput) SetUsagePrice(v float64) *DeleteReservationOutput { + s.UsagePrice = &v + return s +} + +type DeleteScheduleInput struct { + _ struct{} `type:"structure"` + + // ChannelId is a required field + ChannelId *string `location:"uri" locationName:"channelId" type:"string" required:"true"` } // String returns the string representation -func (s CaptionLanguageMapping) String() string { +func (s DeleteScheduleInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CaptionLanguageMapping) GoString() string { +func (s DeleteScheduleInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CaptionLanguageMapping) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CaptionLanguageMapping"} - if s.CaptionChannel == nil { - invalidParams.Add(request.NewErrParamRequired("CaptionChannel")) - } - if s.CaptionChannel != nil && *s.CaptionChannel < 1 { - invalidParams.Add(request.NewErrParamMinValue("CaptionChannel", 1)) - } - if s.LanguageCode == nil { - invalidParams.Add(request.NewErrParamRequired("LanguageCode")) - } - if s.LanguageCode != nil && len(*s.LanguageCode) < 3 { - invalidParams.Add(request.NewErrParamMinLen("LanguageCode", 3)) - } - if s.LanguageDescription == nil { - invalidParams.Add(request.NewErrParamRequired("LanguageDescription")) +func (s *DeleteScheduleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteScheduleInput"} + if s.ChannelId == nil { + invalidParams.Add(request.NewErrParamRequired("ChannelId")) } - if s.LanguageDescription != nil && len(*s.LanguageDescription) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LanguageDescription", 1)) + if s.ChannelId != nil && len(*s.ChannelId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChannelId", 1)) } if invalidParams.Len() > 0 { @@ -5135,67 +8411,57 @@ func (s *CaptionLanguageMapping) Validate() error { return nil } -// SetCaptionChannel sets the CaptionChannel field's value. -func (s *CaptionLanguageMapping) SetCaptionChannel(v int64) *CaptionLanguageMapping { - s.CaptionChannel = &v +// SetChannelId sets the ChannelId field's value. +func (s *DeleteScheduleInput) SetChannelId(v string) *DeleteScheduleInput { + s.ChannelId = &v return s } -// SetLanguageCode sets the LanguageCode field's value. -func (s *CaptionLanguageMapping) SetLanguageCode(v string) *CaptionLanguageMapping { - s.LanguageCode = &v - return s +type DeleteScheduleOutput struct { + _ struct{} `type:"structure"` } -// SetLanguageDescription sets the LanguageDescription field's value. -func (s *CaptionLanguageMapping) SetLanguageDescription(v string) *CaptionLanguageMapping { - s.LanguageDescription = &v - return s +// String returns the string representation +func (s DeleteScheduleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteScheduleOutput) GoString() string { + return s.String() } -// Output groups for this Live Event. Output groups contain information about -// where streams should be distributed. -type CaptionSelector struct { +type DeleteTagsInput struct { _ struct{} `type:"structure"` - // When specified this field indicates the three letter language code of the - // caption track to extract from the source. - LanguageCode *string `locationName:"languageCode" type:"string"` - - // Name identifier for a caption selector. This name is used to associate this - // caption selector with one or more caption descriptions. Names must be unique - // within an event. - // - // Name is a required field - Name *string `locationName:"name" min:"1" type:"string" required:"true"` + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` - // Caption selector settings. - SelectorSettings *CaptionSelectorSettings `locationName:"selectorSettings" type:"structure"` + // TagKeys is a required field + TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" required:"true"` } // String returns the string representation -func (s CaptionSelector) String() string { +func (s DeleteTagsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CaptionSelector) GoString() string { +func (s DeleteTagsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CaptionSelector) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CaptionSelector"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) +func (s *DeleteTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTagsInput"} + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) } - if s.SelectorSettings != nil { - if err := s.SelectorSettings.Validate(); err != nil { - invalidParams.AddNested("SelectorSettings", err.(request.ErrInvalidParams)) - } + if s.TagKeys == nil { + invalidParams.Add(request.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { @@ -5204,79 +8470,57 @@ func (s *CaptionSelector) Validate() error { return nil } -// SetLanguageCode sets the LanguageCode field's value. -func (s *CaptionSelector) SetLanguageCode(v string) *CaptionSelector { - s.LanguageCode = &v - return s -} - -// SetName sets the Name field's value. -func (s *CaptionSelector) SetName(v string) *CaptionSelector { - s.Name = &v +// SetResourceArn sets the ResourceArn field's value. +func (s *DeleteTagsInput) SetResourceArn(v string) *DeleteTagsInput { + s.ResourceArn = &v return s } -// SetSelectorSettings sets the SelectorSettings field's value. -func (s *CaptionSelector) SetSelectorSettings(v *CaptionSelectorSettings) *CaptionSelector { - s.SelectorSettings = v +// SetTagKeys sets the TagKeys field's value. +func (s *DeleteTagsInput) SetTagKeys(v []*string) *DeleteTagsInput { + s.TagKeys = v return s } -// Caption Selector Settings -type CaptionSelectorSettings struct { +type DeleteTagsOutput struct { _ struct{} `type:"structure"` +} - // Arib Source Settings - AribSourceSettings *AribSourceSettings `locationName:"aribSourceSettings" type:"structure"` - - // Dvb Sub Source Settings - DvbSubSourceSettings *DvbSubSourceSettings `locationName:"dvbSubSourceSettings" type:"structure"` - - // Embedded Source Settings - EmbeddedSourceSettings *EmbeddedSourceSettings `locationName:"embeddedSourceSettings" type:"structure"` +// String returns the string representation +func (s DeleteTagsOutput) String() string { + return awsutil.Prettify(s) +} - // Scte20 Source Settings - Scte20SourceSettings *Scte20SourceSettings `locationName:"scte20SourceSettings" type:"structure"` +// GoString returns the string representation +func (s DeleteTagsOutput) GoString() string { + return s.String() +} - // Scte27 Source Settings - Scte27SourceSettings *Scte27SourceSettings `locationName:"scte27SourceSettings" type:"structure"` +type DescribeChannelInput struct { + _ struct{} `type:"structure"` - // Teletext Source Settings - TeletextSourceSettings *TeletextSourceSettings `locationName:"teletextSourceSettings" type:"structure"` + // ChannelId is a required field + ChannelId *string `location:"uri" locationName:"channelId" type:"string" required:"true"` } // String returns the string representation -func (s CaptionSelectorSettings) String() string { +func (s DescribeChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CaptionSelectorSettings) GoString() string { +func (s DescribeChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CaptionSelectorSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CaptionSelectorSettings"} - if s.DvbSubSourceSettings != nil { - if err := s.DvbSubSourceSettings.Validate(); err != nil { - invalidParams.AddNested("DvbSubSourceSettings", err.(request.ErrInvalidParams)) - } - } - if s.EmbeddedSourceSettings != nil { - if err := s.EmbeddedSourceSettings.Validate(); err != nil { - invalidParams.AddNested("EmbeddedSourceSettings", err.(request.ErrInvalidParams)) - } - } - if s.Scte20SourceSettings != nil { - if err := s.Scte20SourceSettings.Validate(); err != nil { - invalidParams.AddNested("Scte20SourceSettings", err.(request.ErrInvalidParams)) - } +func (s *DescribeChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeChannelInput"} + if s.ChannelId == nil { + invalidParams.Add(request.NewErrParamRequired("ChannelId")) } - if s.Scte27SourceSettings != nil { - if err := s.Scte27SourceSettings.Validate(); err != nil { - invalidParams.AddNested("Scte27SourceSettings", err.(request.ErrInvalidParams)) - } + if s.ChannelId != nil && len(*s.ChannelId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChannelId", 1)) } if invalidParams.Len() > 0 { @@ -5285,429 +8529,345 @@ func (s *CaptionSelectorSettings) Validate() error { return nil } -// SetAribSourceSettings sets the AribSourceSettings field's value. -func (s *CaptionSelectorSettings) SetAribSourceSettings(v *AribSourceSettings) *CaptionSelectorSettings { - s.AribSourceSettings = v - return s -} - -// SetDvbSubSourceSettings sets the DvbSubSourceSettings field's value. -func (s *CaptionSelectorSettings) SetDvbSubSourceSettings(v *DvbSubSourceSettings) *CaptionSelectorSettings { - s.DvbSubSourceSettings = v - return s -} - -// SetEmbeddedSourceSettings sets the EmbeddedSourceSettings field's value. -func (s *CaptionSelectorSettings) SetEmbeddedSourceSettings(v *EmbeddedSourceSettings) *CaptionSelectorSettings { - s.EmbeddedSourceSettings = v - return s -} - -// SetScte20SourceSettings sets the Scte20SourceSettings field's value. -func (s *CaptionSelectorSettings) SetScte20SourceSettings(v *Scte20SourceSettings) *CaptionSelectorSettings { - s.Scte20SourceSettings = v - return s -} - -// SetScte27SourceSettings sets the Scte27SourceSettings field's value. -func (s *CaptionSelectorSettings) SetScte27SourceSettings(v *Scte27SourceSettings) *CaptionSelectorSettings { - s.Scte27SourceSettings = v - return s -} - -// SetTeletextSourceSettings sets the TeletextSourceSettings field's value. -func (s *CaptionSelectorSettings) SetTeletextSourceSettings(v *TeletextSourceSettings) *CaptionSelectorSettings { - s.TeletextSourceSettings = v +// SetChannelId sets the ChannelId field's value. +func (s *DescribeChannelInput) SetChannelId(v string) *DescribeChannelInput { + s.ChannelId = &v return s } -type Channel struct { +type DescribeChannelOutput struct { _ struct{} `type:"structure"` - // The unique arn of the channel. Arn *string `locationName:"arn" type:"string"` - // The class for this channel. STANDARD for a channel with two pipelines or - // SINGLE_PIPELINE for a channel with one pipeline. + // A standard channel has two encoding pipelines and a single pipeline channel + // only has one. ChannelClass *string `locationName:"channelClass" type:"string" enum:"ChannelClass"` - // A list of destinations of the channel. For UDP outputs, there is onedestination - // per output. For other types (HLS, for example), there isone destination per - // packager. Destinations []*OutputDestination `locationName:"destinations" type:"list"` - // The endpoints where outgoing connections initiate from EgressEndpoints []*ChannelEgressEndpoint `locationName:"egressEndpoints" type:"list"` // Encoder Settings EncoderSettings *EncoderSettings `locationName:"encoderSettings" type:"structure"` - // The unique id of the channel. Id *string `locationName:"id" type:"string"` - // List of input attachments for channel. InputAttachments []*InputAttachment `locationName:"inputAttachments" type:"list"` InputSpecification *InputSpecification `locationName:"inputSpecification" type:"structure"` - // The log level being written to CloudWatch Logs. + // The log level the user wants for their channel. LogLevel *string `locationName:"logLevel" type:"string" enum:"LogLevel"` - // The name of the channel. (user-mutable) Name *string `locationName:"name" type:"string"` - // Runtime details for the pipelines of a running channel. PipelineDetails []*PipelineDetail `locationName:"pipelineDetails" type:"list"` - // The number of currently healthy pipelines. PipelinesRunningCount *int64 `locationName:"pipelinesRunningCount" type:"integer"` - // The Amazon Resource Name (ARN) of the role assumed when running the Channel. RoleArn *string `locationName:"roleArn" type:"string"` State *string `locationName:"state" type:"string" enum:"ChannelState"` - // A collection of key-value pairs. Tags map[string]*string `locationName:"tags" type:"map"` } // String returns the string representation -func (s Channel) String() string { +func (s DescribeChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Channel) GoString() string { +func (s DescribeChannelOutput) GoString() string { return s.String() } // SetArn sets the Arn field's value. -func (s *Channel) SetArn(v string) *Channel { +func (s *DescribeChannelOutput) SetArn(v string) *DescribeChannelOutput { s.Arn = &v return s } // SetChannelClass sets the ChannelClass field's value. -func (s *Channel) SetChannelClass(v string) *Channel { +func (s *DescribeChannelOutput) SetChannelClass(v string) *DescribeChannelOutput { s.ChannelClass = &v return s } // SetDestinations sets the Destinations field's value. -func (s *Channel) SetDestinations(v []*OutputDestination) *Channel { +func (s *DescribeChannelOutput) SetDestinations(v []*OutputDestination) *DescribeChannelOutput { s.Destinations = v return s } // SetEgressEndpoints sets the EgressEndpoints field's value. -func (s *Channel) SetEgressEndpoints(v []*ChannelEgressEndpoint) *Channel { +func (s *DescribeChannelOutput) SetEgressEndpoints(v []*ChannelEgressEndpoint) *DescribeChannelOutput { s.EgressEndpoints = v return s } // SetEncoderSettings sets the EncoderSettings field's value. -func (s *Channel) SetEncoderSettings(v *EncoderSettings) *Channel { +func (s *DescribeChannelOutput) SetEncoderSettings(v *EncoderSettings) *DescribeChannelOutput { s.EncoderSettings = v return s } // SetId sets the Id field's value. -func (s *Channel) SetId(v string) *Channel { +func (s *DescribeChannelOutput) SetId(v string) *DescribeChannelOutput { s.Id = &v return s } // SetInputAttachments sets the InputAttachments field's value. -func (s *Channel) SetInputAttachments(v []*InputAttachment) *Channel { +func (s *DescribeChannelOutput) SetInputAttachments(v []*InputAttachment) *DescribeChannelOutput { s.InputAttachments = v return s } // SetInputSpecification sets the InputSpecification field's value. -func (s *Channel) SetInputSpecification(v *InputSpecification) *Channel { +func (s *DescribeChannelOutput) SetInputSpecification(v *InputSpecification) *DescribeChannelOutput { s.InputSpecification = v return s } // SetLogLevel sets the LogLevel field's value. -func (s *Channel) SetLogLevel(v string) *Channel { +func (s *DescribeChannelOutput) SetLogLevel(v string) *DescribeChannelOutput { s.LogLevel = &v return s } // SetName sets the Name field's value. -func (s *Channel) SetName(v string) *Channel { +func (s *DescribeChannelOutput) SetName(v string) *DescribeChannelOutput { s.Name = &v return s } // SetPipelineDetails sets the PipelineDetails field's value. -func (s *Channel) SetPipelineDetails(v []*PipelineDetail) *Channel { +func (s *DescribeChannelOutput) SetPipelineDetails(v []*PipelineDetail) *DescribeChannelOutput { s.PipelineDetails = v return s } // SetPipelinesRunningCount sets the PipelinesRunningCount field's value. -func (s *Channel) SetPipelinesRunningCount(v int64) *Channel { +func (s *DescribeChannelOutput) SetPipelinesRunningCount(v int64) *DescribeChannelOutput { s.PipelinesRunningCount = &v return s } // SetRoleArn sets the RoleArn field's value. -func (s *Channel) SetRoleArn(v string) *Channel { +func (s *DescribeChannelOutput) SetRoleArn(v string) *DescribeChannelOutput { s.RoleArn = &v return s } // SetState sets the State field's value. -func (s *Channel) SetState(v string) *Channel { +func (s *DescribeChannelOutput) SetState(v string) *DescribeChannelOutput { s.State = &v return s } // SetTags sets the Tags field's value. -func (s *Channel) SetTags(v map[string]*string) *Channel { +func (s *DescribeChannelOutput) SetTags(v map[string]*string) *DescribeChannelOutput { s.Tags = v return s } -type ChannelEgressEndpoint struct { +type DescribeInputInput struct { _ struct{} `type:"structure"` - // Public IP of where a channel's output comes from - SourceIp *string `locationName:"sourceIp" type:"string"` + // InputId is a required field + InputId *string `location:"uri" locationName:"inputId" type:"string" required:"true"` } // String returns the string representation -func (s ChannelEgressEndpoint) String() string { +func (s DescribeInputInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ChannelEgressEndpoint) GoString() string { +func (s DescribeInputInput) GoString() string { return s.String() } -// SetSourceIp sets the SourceIp field's value. -func (s *ChannelEgressEndpoint) SetSourceIp(v string) *ChannelEgressEndpoint { - s.SourceIp = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeInputInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeInputInput"} + if s.InputId == nil { + invalidParams.Add(request.NewErrParamRequired("InputId")) + } + if s.InputId != nil && len(*s.InputId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InputId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInputId sets the InputId field's value. +func (s *DescribeInputInput) SetInputId(v string) *DescribeInputInput { + s.InputId = &v return s } -type ChannelSummary struct { +type DescribeInputOutput struct { _ struct{} `type:"structure"` - // The unique arn of the channel. Arn *string `locationName:"arn" type:"string"` - // The class for this channel. STANDARD for a channel with two pipelines or - // SINGLE_PIPELINE for a channel with one pipeline. - ChannelClass *string `locationName:"channelClass" type:"string" enum:"ChannelClass"` - - // A list of destinations of the channel. For UDP outputs, there is onedestination - // per output. For other types (HLS, for example), there isone destination per - // packager. - Destinations []*OutputDestination `locationName:"destinations" type:"list"` + AttachedChannels []*string `locationName:"attachedChannels" type:"list"` - // The endpoints where outgoing connections initiate from - EgressEndpoints []*ChannelEgressEndpoint `locationName:"egressEndpoints" type:"list"` + Destinations []*InputDestination `locationName:"destinations" type:"list"` - // The unique id of the channel. Id *string `locationName:"id" type:"string"` - // List of input attachments for channel. - InputAttachments []*InputAttachment `locationName:"inputAttachments" type:"list"` + // A standard input has two sources and a single pipeline input only has one. + InputClass *string `locationName:"inputClass" type:"string" enum:"InputClass"` - InputSpecification *InputSpecification `locationName:"inputSpecification" type:"structure"` + // There are two types of input sources, static and dynamic. If an input source + // is dynamic you canchange the source url of the input dynamically using an + // input switch action. However, the only input typeto support a dynamic url + // at this time is MP4_FILE. By default all input sources are static. + InputSourceType *string `locationName:"inputSourceType" type:"string" enum:"InputSourceType"` - // The log level being written to CloudWatch Logs. - LogLevel *string `locationName:"logLevel" type:"string" enum:"LogLevel"` + MediaConnectFlows []*MediaConnectFlow `locationName:"mediaConnectFlows" type:"list"` - // The name of the channel. (user-mutable) Name *string `locationName:"name" type:"string"` - // The number of currently healthy pipelines. - PipelinesRunningCount *int64 `locationName:"pipelinesRunningCount" type:"integer"` - - // The Amazon Resource Name (ARN) of the role assumed when running the Channel. RoleArn *string `locationName:"roleArn" type:"string"` - State *string `locationName:"state" type:"string" enum:"ChannelState"` + SecurityGroups []*string `locationName:"securityGroups" type:"list"` + + Sources []*InputSource `locationName:"sources" type:"list"` + + State *string `locationName:"state" type:"string" enum:"InputState"` - // A collection of key-value pairs. Tags map[string]*string `locationName:"tags" type:"map"` + + Type *string `locationName:"type" type:"string" enum:"InputType"` } // String returns the string representation -func (s ChannelSummary) String() string { +func (s DescribeInputOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ChannelSummary) GoString() string { +func (s DescribeInputOutput) GoString() string { return s.String() } // SetArn sets the Arn field's value. -func (s *ChannelSummary) SetArn(v string) *ChannelSummary { +func (s *DescribeInputOutput) SetArn(v string) *DescribeInputOutput { s.Arn = &v return s } -// SetChannelClass sets the ChannelClass field's value. -func (s *ChannelSummary) SetChannelClass(v string) *ChannelSummary { - s.ChannelClass = &v +// SetAttachedChannels sets the AttachedChannels field's value. +func (s *DescribeInputOutput) SetAttachedChannels(v []*string) *DescribeInputOutput { + s.AttachedChannels = v return s } // SetDestinations sets the Destinations field's value. -func (s *ChannelSummary) SetDestinations(v []*OutputDestination) *ChannelSummary { +func (s *DescribeInputOutput) SetDestinations(v []*InputDestination) *DescribeInputOutput { s.Destinations = v return s } -// SetEgressEndpoints sets the EgressEndpoints field's value. -func (s *ChannelSummary) SetEgressEndpoints(v []*ChannelEgressEndpoint) *ChannelSummary { - s.EgressEndpoints = v - return s -} - // SetId sets the Id field's value. -func (s *ChannelSummary) SetId(v string) *ChannelSummary { +func (s *DescribeInputOutput) SetId(v string) *DescribeInputOutput { s.Id = &v return s } -// SetInputAttachments sets the InputAttachments field's value. -func (s *ChannelSummary) SetInputAttachments(v []*InputAttachment) *ChannelSummary { - s.InputAttachments = v +// SetInputClass sets the InputClass field's value. +func (s *DescribeInputOutput) SetInputClass(v string) *DescribeInputOutput { + s.InputClass = &v return s } -// SetInputSpecification sets the InputSpecification field's value. -func (s *ChannelSummary) SetInputSpecification(v *InputSpecification) *ChannelSummary { - s.InputSpecification = v +// SetInputSourceType sets the InputSourceType field's value. +func (s *DescribeInputOutput) SetInputSourceType(v string) *DescribeInputOutput { + s.InputSourceType = &v return s } -// SetLogLevel sets the LogLevel field's value. -func (s *ChannelSummary) SetLogLevel(v string) *ChannelSummary { - s.LogLevel = &v +// SetMediaConnectFlows sets the MediaConnectFlows field's value. +func (s *DescribeInputOutput) SetMediaConnectFlows(v []*MediaConnectFlow) *DescribeInputOutput { + s.MediaConnectFlows = v return s } // SetName sets the Name field's value. -func (s *ChannelSummary) SetName(v string) *ChannelSummary { +func (s *DescribeInputOutput) SetName(v string) *DescribeInputOutput { s.Name = &v return s } -// SetPipelinesRunningCount sets the PipelinesRunningCount field's value. -func (s *ChannelSummary) SetPipelinesRunningCount(v int64) *ChannelSummary { - s.PipelinesRunningCount = &v +// SetRoleArn sets the RoleArn field's value. +func (s *DescribeInputOutput) SetRoleArn(v string) *DescribeInputOutput { + s.RoleArn = &v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *ChannelSummary) SetRoleArn(v string) *ChannelSummary { - s.RoleArn = &v +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *DescribeInputOutput) SetSecurityGroups(v []*string) *DescribeInputOutput { + s.SecurityGroups = v + return s +} + +// SetSources sets the Sources field's value. +func (s *DescribeInputOutput) SetSources(v []*InputSource) *DescribeInputOutput { + s.Sources = v return s } // SetState sets the State field's value. -func (s *ChannelSummary) SetState(v string) *ChannelSummary { +func (s *DescribeInputOutput) SetState(v string) *DescribeInputOutput { s.State = &v return s } // SetTags sets the Tags field's value. -func (s *ChannelSummary) SetTags(v map[string]*string) *ChannelSummary { +func (s *DescribeInputOutput) SetTags(v map[string]*string) *DescribeInputOutput { s.Tags = v return s } -// Passthrough applies no color space conversion to the output -type ColorSpacePassthroughSettings struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s ColorSpacePassthroughSettings) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ColorSpacePassthroughSettings) GoString() string { - return s.String() +// SetType sets the Type field's value. +func (s *DescribeInputOutput) SetType(v string) *DescribeInputOutput { + s.Type = &v + return s } -type CreateChannelInput struct { +type DescribeInputSecurityGroupInput struct { _ struct{} `type:"structure"` - // A standard channel has two encoding pipelines and a single pipeline channel - // only has one. - ChannelClass *string `locationName:"channelClass" type:"string" enum:"ChannelClass"` - - Destinations []*OutputDestination `locationName:"destinations" type:"list"` - - // Encoder Settings - EncoderSettings *EncoderSettings `locationName:"encoderSettings" type:"structure"` - - InputAttachments []*InputAttachment `locationName:"inputAttachments" type:"list"` - - InputSpecification *InputSpecification `locationName:"inputSpecification" type:"structure"` - - // The log level the user wants for their channel. - LogLevel *string `locationName:"logLevel" type:"string" enum:"LogLevel"` - - Name *string `locationName:"name" type:"string"` - - RequestId *string `locationName:"requestId" type:"string" idempotencyToken:"true"` - - Reserved *string `locationName:"reserved" deprecated:"true" type:"string"` - - RoleArn *string `locationName:"roleArn" type:"string"` - - Tags map[string]*string `locationName:"tags" type:"map"` + // InputSecurityGroupId is a required field + InputSecurityGroupId *string `location:"uri" locationName:"inputSecurityGroupId" type:"string" required:"true"` } // String returns the string representation -func (s CreateChannelInput) String() string { +func (s DescribeInputSecurityGroupInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateChannelInput) GoString() string { +func (s DescribeInputSecurityGroupInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateChannelInput"} - if s.Destinations != nil { - for i, v := range s.Destinations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Destinations", i), err.(request.ErrInvalidParams)) - } - } - } - if s.EncoderSettings != nil { - if err := s.EncoderSettings.Validate(); err != nil { - invalidParams.AddNested("EncoderSettings", err.(request.ErrInvalidParams)) - } +func (s *DescribeInputSecurityGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeInputSecurityGroupInput"} + if s.InputSecurityGroupId == nil { + invalidParams.Add(request.NewErrParamRequired("InputSecurityGroupId")) } - if s.InputAttachments != nil { - for i, v := range s.InputAttachments { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputAttachments", i), err.(request.ErrInvalidParams)) - } - } + if s.InputSecurityGroupId != nil && len(*s.InputSecurityGroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InputSecurityGroupId", 1)) } if invalidParams.Len() > 0 { @@ -5716,368 +8876,480 @@ func (s *CreateChannelInput) Validate() error { return nil } -// SetChannelClass sets the ChannelClass field's value. -func (s *CreateChannelInput) SetChannelClass(v string) *CreateChannelInput { - s.ChannelClass = &v +// SetInputSecurityGroupId sets the InputSecurityGroupId field's value. +func (s *DescribeInputSecurityGroupInput) SetInputSecurityGroupId(v string) *DescribeInputSecurityGroupInput { + s.InputSecurityGroupId = &v return s } -// SetDestinations sets the Destinations field's value. -func (s *CreateChannelInput) SetDestinations(v []*OutputDestination) *CreateChannelInput { - s.Destinations = v - return s -} +type DescribeInputSecurityGroupOutput struct { + _ struct{} `type:"structure"` -// SetEncoderSettings sets the EncoderSettings field's value. -func (s *CreateChannelInput) SetEncoderSettings(v *EncoderSettings) *CreateChannelInput { - s.EncoderSettings = v - return s -} + Arn *string `locationName:"arn" type:"string"` -// SetInputAttachments sets the InputAttachments field's value. -func (s *CreateChannelInput) SetInputAttachments(v []*InputAttachment) *CreateChannelInput { - s.InputAttachments = v - return s + Id *string `locationName:"id" type:"string"` + + Inputs []*string `locationName:"inputs" type:"list"` + + State *string `locationName:"state" type:"string" enum:"InputSecurityGroupState"` + + Tags map[string]*string `locationName:"tags" type:"map"` + + WhitelistRules []*InputWhitelistRule `locationName:"whitelistRules" type:"list"` } -// SetInputSpecification sets the InputSpecification field's value. -func (s *CreateChannelInput) SetInputSpecification(v *InputSpecification) *CreateChannelInput { - s.InputSpecification = v - return s +// String returns the string representation +func (s DescribeInputSecurityGroupOutput) String() string { + return awsutil.Prettify(s) } -// SetLogLevel sets the LogLevel field's value. -func (s *CreateChannelInput) SetLogLevel(v string) *CreateChannelInput { - s.LogLevel = &v - return s +// GoString returns the string representation +func (s DescribeInputSecurityGroupOutput) GoString() string { + return s.String() } -// SetName sets the Name field's value. -func (s *CreateChannelInput) SetName(v string) *CreateChannelInput { - s.Name = &v +// SetArn sets the Arn field's value. +func (s *DescribeInputSecurityGroupOutput) SetArn(v string) *DescribeInputSecurityGroupOutput { + s.Arn = &v return s } -// SetRequestId sets the RequestId field's value. -func (s *CreateChannelInput) SetRequestId(v string) *CreateChannelInput { - s.RequestId = &v +// SetId sets the Id field's value. +func (s *DescribeInputSecurityGroupOutput) SetId(v string) *DescribeInputSecurityGroupOutput { + s.Id = &v return s } -// SetReserved sets the Reserved field's value. -func (s *CreateChannelInput) SetReserved(v string) *CreateChannelInput { - s.Reserved = &v +// SetInputs sets the Inputs field's value. +func (s *DescribeInputSecurityGroupOutput) SetInputs(v []*string) *DescribeInputSecurityGroupOutput { + s.Inputs = v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *CreateChannelInput) SetRoleArn(v string) *CreateChannelInput { - s.RoleArn = &v +// SetState sets the State field's value. +func (s *DescribeInputSecurityGroupOutput) SetState(v string) *DescribeInputSecurityGroupOutput { + s.State = &v return s } // SetTags sets the Tags field's value. -func (s *CreateChannelInput) SetTags(v map[string]*string) *CreateChannelInput { +func (s *DescribeInputSecurityGroupOutput) SetTags(v map[string]*string) *DescribeInputSecurityGroupOutput { s.Tags = v return s } -type CreateChannelOutput struct { +// SetWhitelistRules sets the WhitelistRules field's value. +func (s *DescribeInputSecurityGroupOutput) SetWhitelistRules(v []*InputWhitelistRule) *DescribeInputSecurityGroupOutput { + s.WhitelistRules = v + return s +} + +type DescribeMultiplexInput struct { _ struct{} `type:"structure"` - Channel *Channel `locationName:"channel" type:"structure"` + // MultiplexId is a required field + MultiplexId *string `location:"uri" locationName:"multiplexId" type:"string" required:"true"` } // String returns the string representation -func (s CreateChannelOutput) String() string { +func (s DescribeMultiplexInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateChannelOutput) GoString() string { +func (s DescribeMultiplexInput) GoString() string { return s.String() } -// SetChannel sets the Channel field's value. -func (s *CreateChannelOutput) SetChannel(v *Channel) *CreateChannelOutput { - s.Channel = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeMultiplexInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeMultiplexInput"} + if s.MultiplexId == nil { + invalidParams.Add(request.NewErrParamRequired("MultiplexId")) + } + if s.MultiplexId != nil && len(*s.MultiplexId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MultiplexId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMultiplexId sets the MultiplexId field's value. +func (s *DescribeMultiplexInput) SetMultiplexId(v string) *DescribeMultiplexInput { + s.MultiplexId = &v return s } -type CreateInputInput struct { +type DescribeMultiplexOutput struct { _ struct{} `type:"structure"` - Destinations []*InputDestinationRequest `locationName:"destinations" type:"list"` + Arn *string `locationName:"arn" type:"string"` - InputSecurityGroups []*string `locationName:"inputSecurityGroups" type:"list"` + AvailabilityZones []*string `locationName:"availabilityZones" type:"list"` - MediaConnectFlows []*MediaConnectFlowRequest `locationName:"mediaConnectFlows" type:"list"` + Destinations []*MultiplexOutputDestination `locationName:"destinations" type:"list"` - Name *string `locationName:"name" type:"string"` + Id *string `locationName:"id" type:"string"` - RequestId *string `locationName:"requestId" type:"string" idempotencyToken:"true"` + // Contains configuration for a Multiplex event + MultiplexSettings *MultiplexSettings `locationName:"multiplexSettings" type:"structure"` - RoleArn *string `locationName:"roleArn" type:"string"` + Name *string `locationName:"name" type:"string"` - Sources []*InputSourceRequest `locationName:"sources" type:"list"` + PipelinesRunningCount *int64 `locationName:"pipelinesRunningCount" type:"integer"` - Tags map[string]*string `locationName:"tags" type:"map"` + ProgramCount *int64 `locationName:"programCount" type:"integer"` - Type *string `locationName:"type" type:"string" enum:"InputType"` + // The current state of the multiplex. + State *string `locationName:"state" type:"string" enum:"MultiplexState"` - // Settings for a private VPC Input.When this property is specified, the input - // destination addresses will be created in a VPC rather than with public Internet - // addresses.This property requires setting the roleArn property on Input creation.Not - // compatible with the inputSecurityGroups property. - Vpc *InputVpcRequest `locationName:"vpc" type:"structure"` + Tags map[string]*string `locationName:"tags" type:"map"` } // String returns the string representation -func (s CreateInputInput) String() string { +func (s DescribeMultiplexOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateInputInput) GoString() string { +func (s DescribeMultiplexOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateInputInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateInputInput"} - if s.Vpc != nil { - if err := s.Vpc.Validate(); err != nil { - invalidParams.AddNested("Vpc", err.(request.ErrInvalidParams)) - } - } +// SetArn sets the Arn field's value. +func (s *DescribeMultiplexOutput) SetArn(v string) *DescribeMultiplexOutput { + s.Arn = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *DescribeMultiplexOutput) SetAvailabilityZones(v []*string) *DescribeMultiplexOutput { + s.AvailabilityZones = v + return s } // SetDestinations sets the Destinations field's value. -func (s *CreateInputInput) SetDestinations(v []*InputDestinationRequest) *CreateInputInput { +func (s *DescribeMultiplexOutput) SetDestinations(v []*MultiplexOutputDestination) *DescribeMultiplexOutput { s.Destinations = v return s } -// SetInputSecurityGroups sets the InputSecurityGroups field's value. -func (s *CreateInputInput) SetInputSecurityGroups(v []*string) *CreateInputInput { - s.InputSecurityGroups = v +// SetId sets the Id field's value. +func (s *DescribeMultiplexOutput) SetId(v string) *DescribeMultiplexOutput { + s.Id = &v return s } -// SetMediaConnectFlows sets the MediaConnectFlows field's value. -func (s *CreateInputInput) SetMediaConnectFlows(v []*MediaConnectFlowRequest) *CreateInputInput { - s.MediaConnectFlows = v +// SetMultiplexSettings sets the MultiplexSettings field's value. +func (s *DescribeMultiplexOutput) SetMultiplexSettings(v *MultiplexSettings) *DescribeMultiplexOutput { + s.MultiplexSettings = v return s } // SetName sets the Name field's value. -func (s *CreateInputInput) SetName(v string) *CreateInputInput { +func (s *DescribeMultiplexOutput) SetName(v string) *DescribeMultiplexOutput { s.Name = &v return s } -// SetRequestId sets the RequestId field's value. -func (s *CreateInputInput) SetRequestId(v string) *CreateInputInput { - s.RequestId = &v +// SetPipelinesRunningCount sets the PipelinesRunningCount field's value. +func (s *DescribeMultiplexOutput) SetPipelinesRunningCount(v int64) *DescribeMultiplexOutput { + s.PipelinesRunningCount = &v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *CreateInputInput) SetRoleArn(v string) *CreateInputInput { - s.RoleArn = &v +// SetProgramCount sets the ProgramCount field's value. +func (s *DescribeMultiplexOutput) SetProgramCount(v int64) *DescribeMultiplexOutput { + s.ProgramCount = &v return s } -// SetSources sets the Sources field's value. -func (s *CreateInputInput) SetSources(v []*InputSourceRequest) *CreateInputInput { - s.Sources = v +// SetState sets the State field's value. +func (s *DescribeMultiplexOutput) SetState(v string) *DescribeMultiplexOutput { + s.State = &v return s } // SetTags sets the Tags field's value. -func (s *CreateInputInput) SetTags(v map[string]*string) *CreateInputInput { +func (s *DescribeMultiplexOutput) SetTags(v map[string]*string) *DescribeMultiplexOutput { s.Tags = v return s } -// SetType sets the Type field's value. -func (s *CreateInputInput) SetType(v string) *CreateInputInput { - s.Type = &v - return s -} - -// SetVpc sets the Vpc field's value. -func (s *CreateInputInput) SetVpc(v *InputVpcRequest) *CreateInputInput { - s.Vpc = v - return s -} - -type CreateInputOutput struct { +type DescribeMultiplexProgramInput struct { _ struct{} `type:"structure"` - Input *Input `locationName:"input" type:"structure"` + // MultiplexId is a required field + MultiplexId *string `location:"uri" locationName:"multiplexId" type:"string" required:"true"` + + // ProgramName is a required field + ProgramName *string `location:"uri" locationName:"programName" type:"string" required:"true"` } // String returns the string representation -func (s CreateInputOutput) String() string { +func (s DescribeMultiplexProgramInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateInputOutput) GoString() string { +func (s DescribeMultiplexProgramInput) GoString() string { return s.String() } -// SetInput sets the Input field's value. -func (s *CreateInputOutput) SetInput(v *Input) *CreateInputOutput { - s.Input = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeMultiplexProgramInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeMultiplexProgramInput"} + if s.MultiplexId == nil { + invalidParams.Add(request.NewErrParamRequired("MultiplexId")) + } + if s.MultiplexId != nil && len(*s.MultiplexId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MultiplexId", 1)) + } + if s.ProgramName == nil { + invalidParams.Add(request.NewErrParamRequired("ProgramName")) + } + if s.ProgramName != nil && len(*s.ProgramName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ProgramName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMultiplexId sets the MultiplexId field's value. +func (s *DescribeMultiplexProgramInput) SetMultiplexId(v string) *DescribeMultiplexProgramInput { + s.MultiplexId = &v return s } -type CreateInputSecurityGroupInput struct { +// SetProgramName sets the ProgramName field's value. +func (s *DescribeMultiplexProgramInput) SetProgramName(v string) *DescribeMultiplexProgramInput { + s.ProgramName = &v + return s +} + +type DescribeMultiplexProgramOutput struct { _ struct{} `type:"structure"` - Tags map[string]*string `locationName:"tags" type:"map"` + ChannelId *string `locationName:"channelId" type:"string"` - WhitelistRules []*InputWhitelistRuleCidr `locationName:"whitelistRules" type:"list"` + // Multiplex Program settings configuration. + MultiplexProgramSettings *MultiplexProgramSettings `locationName:"multiplexProgramSettings" type:"structure"` + + // Packet identifiers map for a given Multiplex program. + PacketIdentifiersMap *MultiplexProgramPacketIdentifiersMap `locationName:"packetIdentifiersMap" type:"structure"` + + ProgramName *string `locationName:"programName" type:"string"` } // String returns the string representation -func (s CreateInputSecurityGroupInput) String() string { +func (s DescribeMultiplexProgramOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateInputSecurityGroupInput) GoString() string { +func (s DescribeMultiplexProgramOutput) GoString() string { return s.String() } -// SetTags sets the Tags field's value. -func (s *CreateInputSecurityGroupInput) SetTags(v map[string]*string) *CreateInputSecurityGroupInput { - s.Tags = v +// SetChannelId sets the ChannelId field's value. +func (s *DescribeMultiplexProgramOutput) SetChannelId(v string) *DescribeMultiplexProgramOutput { + s.ChannelId = &v return s } -// SetWhitelistRules sets the WhitelistRules field's value. -func (s *CreateInputSecurityGroupInput) SetWhitelistRules(v []*InputWhitelistRuleCidr) *CreateInputSecurityGroupInput { - s.WhitelistRules = v +// SetMultiplexProgramSettings sets the MultiplexProgramSettings field's value. +func (s *DescribeMultiplexProgramOutput) SetMultiplexProgramSettings(v *MultiplexProgramSettings) *DescribeMultiplexProgramOutput { + s.MultiplexProgramSettings = v return s } -type CreateInputSecurityGroupOutput struct { +// SetPacketIdentifiersMap sets the PacketIdentifiersMap field's value. +func (s *DescribeMultiplexProgramOutput) SetPacketIdentifiersMap(v *MultiplexProgramPacketIdentifiersMap) *DescribeMultiplexProgramOutput { + s.PacketIdentifiersMap = v + return s +} + +// SetProgramName sets the ProgramName field's value. +func (s *DescribeMultiplexProgramOutput) SetProgramName(v string) *DescribeMultiplexProgramOutput { + s.ProgramName = &v + return s +} + +type DescribeOfferingInput struct { _ struct{} `type:"structure"` - // An Input Security Group - SecurityGroup *InputSecurityGroup `locationName:"securityGroup" type:"structure"` + // OfferingId is a required field + OfferingId *string `location:"uri" locationName:"offeringId" type:"string" required:"true"` } // String returns the string representation -func (s CreateInputSecurityGroupOutput) String() string { +func (s DescribeOfferingInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateInputSecurityGroupOutput) GoString() string { +func (s DescribeOfferingInput) GoString() string { return s.String() } -// SetSecurityGroup sets the SecurityGroup field's value. -func (s *CreateInputSecurityGroupOutput) SetSecurityGroup(v *InputSecurityGroup) *CreateInputSecurityGroupOutput { - s.SecurityGroup = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeOfferingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeOfferingInput"} + if s.OfferingId == nil { + invalidParams.Add(request.NewErrParamRequired("OfferingId")) + } + if s.OfferingId != nil && len(*s.OfferingId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OfferingId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOfferingId sets the OfferingId field's value. +func (s *DescribeOfferingInput) SetOfferingId(v string) *DescribeOfferingInput { + s.OfferingId = &v return s } -type CreateTagsInput struct { +type DescribeOfferingOutput struct { _ struct{} `type:"structure"` - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` + Arn *string `locationName:"arn" type:"string"` - Tags map[string]*string `locationName:"tags" type:"map"` + CurrencyCode *string `locationName:"currencyCode" type:"string"` + + Duration *int64 `locationName:"duration" type:"integer"` + + // Units for duration, e.g. 'MONTHS' + DurationUnits *string `locationName:"durationUnits" type:"string" enum:"OfferingDurationUnits"` + + FixedPrice *float64 `locationName:"fixedPrice" type:"double"` + + OfferingDescription *string `locationName:"offeringDescription" type:"string"` + + OfferingId *string `locationName:"offeringId" type:"string"` + + // Offering type, e.g. 'NO_UPFRONT' + OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingType"` + + Region *string `locationName:"region" type:"string"` + + // Resource configuration (codec, resolution, bitrate, ...) + ResourceSpecification *ReservationResourceSpecification `locationName:"resourceSpecification" type:"structure"` + + UsagePrice *float64 `locationName:"usagePrice" type:"double"` } // String returns the string representation -func (s CreateTagsInput) String() string { +func (s DescribeOfferingOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTagsInput) GoString() string { +func (s DescribeOfferingOutput) 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.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) - } +// SetArn sets the Arn field's value. +func (s *DescribeOfferingOutput) SetArn(v string) *DescribeOfferingOutput { + s.Arn = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCurrencyCode sets the CurrencyCode field's value. +func (s *DescribeOfferingOutput) SetCurrencyCode(v string) *DescribeOfferingOutput { + s.CurrencyCode = &v + return s } -// SetResourceArn sets the ResourceArn field's value. -func (s *CreateTagsInput) SetResourceArn(v string) *CreateTagsInput { - s.ResourceArn = &v +// SetDuration sets the Duration field's value. +func (s *DescribeOfferingOutput) SetDuration(v int64) *DescribeOfferingOutput { + s.Duration = &v return s } -// SetTags sets the Tags field's value. -func (s *CreateTagsInput) SetTags(v map[string]*string) *CreateTagsInput { - s.Tags = v +// SetDurationUnits sets the DurationUnits field's value. +func (s *DescribeOfferingOutput) SetDurationUnits(v string) *DescribeOfferingOutput { + s.DurationUnits = &v + return s +} + +// SetFixedPrice sets the FixedPrice field's value. +func (s *DescribeOfferingOutput) SetFixedPrice(v float64) *DescribeOfferingOutput { + s.FixedPrice = &v + return s +} + +// SetOfferingDescription sets the OfferingDescription field's value. +func (s *DescribeOfferingOutput) SetOfferingDescription(v string) *DescribeOfferingOutput { + s.OfferingDescription = &v + return s +} + +// SetOfferingId sets the OfferingId field's value. +func (s *DescribeOfferingOutput) SetOfferingId(v string) *DescribeOfferingOutput { + s.OfferingId = &v + return s +} + +// SetOfferingType sets the OfferingType field's value. +func (s *DescribeOfferingOutput) SetOfferingType(v string) *DescribeOfferingOutput { + s.OfferingType = &v return s } -type CreateTagsOutput struct { - _ struct{} `type:"structure"` +// SetRegion sets the Region field's value. +func (s *DescribeOfferingOutput) SetRegion(v string) *DescribeOfferingOutput { + s.Region = &v + return s } -// String returns the string representation -func (s CreateTagsOutput) String() string { - return awsutil.Prettify(s) +// SetResourceSpecification sets the ResourceSpecification field's value. +func (s *DescribeOfferingOutput) SetResourceSpecification(v *ReservationResourceSpecification) *DescribeOfferingOutput { + s.ResourceSpecification = v + return s } -// GoString returns the string representation -func (s CreateTagsOutput) GoString() string { - return s.String() +// SetUsagePrice sets the UsagePrice field's value. +func (s *DescribeOfferingOutput) SetUsagePrice(v float64) *DescribeOfferingOutput { + s.UsagePrice = &v + return s } -type DeleteChannelInput struct { +type DescribeReservationInput struct { _ struct{} `type:"structure"` - // ChannelId is a required field - ChannelId *string `location:"uri" locationName:"channelId" type:"string" required:"true"` + // ReservationId is a required field + ReservationId *string `location:"uri" locationName:"reservationId" type:"string" required:"true"` } // String returns the string representation -func (s DeleteChannelInput) String() string { +func (s DescribeReservationInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteChannelInput) GoString() string { +func (s DescribeReservationInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteChannelInput"} - if s.ChannelId == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelId")) +func (s *DescribeReservationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeReservationInput"} + if s.ReservationId == nil { + invalidParams.Add(request.NewErrParamRequired("ReservationId")) } - if s.ChannelId != nil && len(*s.ChannelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelId", 1)) + if s.ReservationId != nil && len(*s.ReservationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ReservationId", 1)) } if invalidParams.Len() > 0 { @@ -6086,175 +9358,206 @@ func (s *DeleteChannelInput) Validate() error { return nil } -// SetChannelId sets the ChannelId field's value. -func (s *DeleteChannelInput) SetChannelId(v string) *DeleteChannelInput { - s.ChannelId = &v +// SetReservationId sets the ReservationId field's value. +func (s *DescribeReservationInput) SetReservationId(v string) *DescribeReservationInput { + s.ReservationId = &v return s } -type DeleteChannelOutput struct { +type DescribeReservationOutput struct { _ struct{} `type:"structure"` Arn *string `locationName:"arn" type:"string"` - // A standard channel has two encoding pipelines and a single pipeline channel - // only has one. - ChannelClass *string `locationName:"channelClass" type:"string" enum:"ChannelClass"` + Count *int64 `locationName:"count" type:"integer"` - Destinations []*OutputDestination `locationName:"destinations" type:"list"` + CurrencyCode *string `locationName:"currencyCode" type:"string"` - EgressEndpoints []*ChannelEgressEndpoint `locationName:"egressEndpoints" type:"list"` + Duration *int64 `locationName:"duration" type:"integer"` - // Encoder Settings - EncoderSettings *EncoderSettings `locationName:"encoderSettings" type:"structure"` + // Units for duration, e.g. 'MONTHS' + DurationUnits *string `locationName:"durationUnits" type:"string" enum:"OfferingDurationUnits"` - Id *string `locationName:"id" type:"string"` + End *string `locationName:"end" type:"string"` - InputAttachments []*InputAttachment `locationName:"inputAttachments" type:"list"` + FixedPrice *float64 `locationName:"fixedPrice" type:"double"` - InputSpecification *InputSpecification `locationName:"inputSpecification" type:"structure"` + Name *string `locationName:"name" type:"string"` - // The log level the user wants for their channel. - LogLevel *string `locationName:"logLevel" type:"string" enum:"LogLevel"` + OfferingDescription *string `locationName:"offeringDescription" type:"string"` - Name *string `locationName:"name" type:"string"` + OfferingId *string `locationName:"offeringId" type:"string"` - PipelineDetails []*PipelineDetail `locationName:"pipelineDetails" type:"list"` + // Offering type, e.g. 'NO_UPFRONT' + OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingType"` - PipelinesRunningCount *int64 `locationName:"pipelinesRunningCount" type:"integer"` + Region *string `locationName:"region" type:"string"` - RoleArn *string `locationName:"roleArn" type:"string"` + ReservationId *string `locationName:"reservationId" type:"string"` - State *string `locationName:"state" type:"string" enum:"ChannelState"` + // Resource configuration (codec, resolution, bitrate, ...) + ResourceSpecification *ReservationResourceSpecification `locationName:"resourceSpecification" type:"structure"` + + Start *string `locationName:"start" type:"string"` + + // Current reservation state + State *string `locationName:"state" type:"string" enum:"ReservationState"` Tags map[string]*string `locationName:"tags" type:"map"` + + UsagePrice *float64 `locationName:"usagePrice" type:"double"` } // String returns the string representation -func (s DeleteChannelOutput) String() string { +func (s DescribeReservationOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteChannelOutput) GoString() string { +func (s DescribeReservationOutput) GoString() string { return s.String() } // SetArn sets the Arn field's value. -func (s *DeleteChannelOutput) SetArn(v string) *DeleteChannelOutput { +func (s *DescribeReservationOutput) SetArn(v string) *DescribeReservationOutput { s.Arn = &v return s } -// SetChannelClass sets the ChannelClass field's value. -func (s *DeleteChannelOutput) SetChannelClass(v string) *DeleteChannelOutput { - s.ChannelClass = &v +// SetCount sets the Count field's value. +func (s *DescribeReservationOutput) SetCount(v int64) *DescribeReservationOutput { + s.Count = &v return s } -// SetDestinations sets the Destinations field's value. -func (s *DeleteChannelOutput) SetDestinations(v []*OutputDestination) *DeleteChannelOutput { - s.Destinations = v +// SetCurrencyCode sets the CurrencyCode field's value. +func (s *DescribeReservationOutput) SetCurrencyCode(v string) *DescribeReservationOutput { + s.CurrencyCode = &v return s } -// SetEgressEndpoints sets the EgressEndpoints field's value. -func (s *DeleteChannelOutput) SetEgressEndpoints(v []*ChannelEgressEndpoint) *DeleteChannelOutput { - s.EgressEndpoints = v +// SetDuration sets the Duration field's value. +func (s *DescribeReservationOutput) SetDuration(v int64) *DescribeReservationOutput { + s.Duration = &v return s } -// SetEncoderSettings sets the EncoderSettings field's value. -func (s *DeleteChannelOutput) SetEncoderSettings(v *EncoderSettings) *DeleteChannelOutput { - s.EncoderSettings = v +// SetDurationUnits sets the DurationUnits field's value. +func (s *DescribeReservationOutput) SetDurationUnits(v string) *DescribeReservationOutput { + s.DurationUnits = &v return s } -// SetId sets the Id field's value. -func (s *DeleteChannelOutput) SetId(v string) *DeleteChannelOutput { - s.Id = &v +// SetEnd sets the End field's value. +func (s *DescribeReservationOutput) SetEnd(v string) *DescribeReservationOutput { + s.End = &v return s } -// SetInputAttachments sets the InputAttachments field's value. -func (s *DeleteChannelOutput) SetInputAttachments(v []*InputAttachment) *DeleteChannelOutput { - s.InputAttachments = v +// SetFixedPrice sets the FixedPrice field's value. +func (s *DescribeReservationOutput) SetFixedPrice(v float64) *DescribeReservationOutput { + s.FixedPrice = &v return s } -// SetInputSpecification sets the InputSpecification field's value. -func (s *DeleteChannelOutput) SetInputSpecification(v *InputSpecification) *DeleteChannelOutput { - s.InputSpecification = v +// SetName sets the Name field's value. +func (s *DescribeReservationOutput) SetName(v string) *DescribeReservationOutput { + s.Name = &v return s } -// SetLogLevel sets the LogLevel field's value. -func (s *DeleteChannelOutput) SetLogLevel(v string) *DeleteChannelOutput { - s.LogLevel = &v +// SetOfferingDescription sets the OfferingDescription field's value. +func (s *DescribeReservationOutput) SetOfferingDescription(v string) *DescribeReservationOutput { + s.OfferingDescription = &v return s } -// SetName sets the Name field's value. -func (s *DeleteChannelOutput) SetName(v string) *DeleteChannelOutput { - s.Name = &v +// SetOfferingId sets the OfferingId field's value. +func (s *DescribeReservationOutput) SetOfferingId(v string) *DescribeReservationOutput { + s.OfferingId = &v return s } -// SetPipelineDetails sets the PipelineDetails field's value. -func (s *DeleteChannelOutput) SetPipelineDetails(v []*PipelineDetail) *DeleteChannelOutput { - s.PipelineDetails = v +// SetOfferingType sets the OfferingType field's value. +func (s *DescribeReservationOutput) SetOfferingType(v string) *DescribeReservationOutput { + s.OfferingType = &v return s } -// SetPipelinesRunningCount sets the PipelinesRunningCount field's value. -func (s *DeleteChannelOutput) SetPipelinesRunningCount(v int64) *DeleteChannelOutput { - s.PipelinesRunningCount = &v +// SetRegion sets the Region field's value. +func (s *DescribeReservationOutput) SetRegion(v string) *DescribeReservationOutput { + s.Region = &v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *DeleteChannelOutput) SetRoleArn(v string) *DeleteChannelOutput { - s.RoleArn = &v +// SetReservationId sets the ReservationId field's value. +func (s *DescribeReservationOutput) SetReservationId(v string) *DescribeReservationOutput { + s.ReservationId = &v + return s +} + +// SetResourceSpecification sets the ResourceSpecification field's value. +func (s *DescribeReservationOutput) SetResourceSpecification(v *ReservationResourceSpecification) *DescribeReservationOutput { + s.ResourceSpecification = v + return s +} + +// SetStart sets the Start field's value. +func (s *DescribeReservationOutput) SetStart(v string) *DescribeReservationOutput { + s.Start = &v return s } // SetState sets the State field's value. -func (s *DeleteChannelOutput) SetState(v string) *DeleteChannelOutput { +func (s *DescribeReservationOutput) SetState(v string) *DescribeReservationOutput { s.State = &v return s } // SetTags sets the Tags field's value. -func (s *DeleteChannelOutput) SetTags(v map[string]*string) *DeleteChannelOutput { +func (s *DescribeReservationOutput) SetTags(v map[string]*string) *DescribeReservationOutput { s.Tags = v return s } -type DeleteInputInput struct { +// SetUsagePrice sets the UsagePrice field's value. +func (s *DescribeReservationOutput) SetUsagePrice(v float64) *DescribeReservationOutput { + s.UsagePrice = &v + return s +} + +type DescribeScheduleInput struct { _ struct{} `type:"structure"` - // InputId is a required field - InputId *string `location:"uri" locationName:"inputId" type:"string" required:"true"` + // ChannelId is a required field + ChannelId *string `location:"uri" locationName:"channelId" type:"string" required:"true"` + + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` } // String returns the string representation -func (s DeleteInputInput) String() string { +func (s DescribeScheduleInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteInputInput) GoString() string { +func (s DescribeScheduleInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteInputInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteInputInput"} - if s.InputId == nil { - invalidParams.Add(request.NewErrParamRequired("InputId")) +func (s *DescribeScheduleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeScheduleInput"} + if s.ChannelId == nil { + invalidParams.Add(request.NewErrParamRequired("ChannelId")) } - if s.InputId != nil && len(*s.InputId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InputId", 1)) + if s.ChannelId != nil && len(*s.ChannelId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChannelId", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -6263,51 +9566,98 @@ func (s *DeleteInputInput) Validate() error { return nil } -// SetInputId sets the InputId field's value. -func (s *DeleteInputInput) SetInputId(v string) *DeleteInputInput { - s.InputId = &v +// SetChannelId sets the ChannelId field's value. +func (s *DescribeScheduleInput) SetChannelId(v string) *DescribeScheduleInput { + s.ChannelId = &v return s } -type DeleteInputOutput struct { +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeScheduleInput) SetMaxResults(v int64) *DescribeScheduleInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeScheduleInput) SetNextToken(v string) *DescribeScheduleInput { + s.NextToken = &v + return s +} + +type DescribeScheduleOutput struct { _ struct{} `type:"structure"` + + NextToken *string `locationName:"nextToken" type:"string"` + + ScheduleActions []*ScheduleAction `locationName:"scheduleActions" type:"list"` } // String returns the string representation -func (s DeleteInputOutput) String() string { +func (s DescribeScheduleOutput) String() string { return awsutil.Prettify(s) } -// GoString returns the string representation -func (s DeleteInputOutput) GoString() string { - return s.String() +// GoString returns the string representation +func (s DescribeScheduleOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeScheduleOutput) SetNextToken(v string) *DescribeScheduleOutput { + s.NextToken = &v + return s +} + +// SetScheduleActions sets the ScheduleActions field's value. +func (s *DescribeScheduleOutput) SetScheduleActions(v []*ScheduleAction) *DescribeScheduleOutput { + s.ScheduleActions = v + return s } -type DeleteInputSecurityGroupInput struct { +// DVB Network Information Table (NIT) +type DvbNitSettings struct { _ struct{} `type:"structure"` - // InputSecurityGroupId is a required field - InputSecurityGroupId *string `location:"uri" locationName:"inputSecurityGroupId" type:"string" required:"true"` + // The numeric value placed in the Network Information Table (NIT). + // + // NetworkId is a required field + NetworkId *int64 `locationName:"networkId" type:"integer" required:"true"` + + // The network name text placed in the networkNameDescriptor inside the Network + // Information Table. Maximum length is 256 characters. + // + // NetworkName is a required field + NetworkName *string `locationName:"networkName" min:"1" type:"string" required:"true"` + + // The number of milliseconds between instances of this table in the output + // transport stream. + RepInterval *int64 `locationName:"repInterval" min:"25" type:"integer"` } // String returns the string representation -func (s DeleteInputSecurityGroupInput) String() string { +func (s DvbNitSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteInputSecurityGroupInput) GoString() string { +func (s DvbNitSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteInputSecurityGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteInputSecurityGroupInput"} - if s.InputSecurityGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("InputSecurityGroupId")) +func (s *DvbNitSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DvbNitSettings"} + if s.NetworkId == nil { + invalidParams.Add(request.NewErrParamRequired("NetworkId")) } - if s.InputSecurityGroupId != nil && len(*s.InputSecurityGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InputSecurityGroupId", 1)) + if s.NetworkName == nil { + invalidParams.Add(request.NewErrParamRequired("NetworkName")) + } + if s.NetworkName != nil && len(*s.NetworkName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NetworkName", 1)) + } + if s.RepInterval != nil && *s.RepInterval < 25 { + invalidParams.Add(request.NewErrParamMinValue("RepInterval", 25)) } if invalidParams.Len() > 0 { @@ -6316,51 +9666,70 @@ func (s *DeleteInputSecurityGroupInput) Validate() error { return nil } -// SetInputSecurityGroupId sets the InputSecurityGroupId field's value. -func (s *DeleteInputSecurityGroupInput) SetInputSecurityGroupId(v string) *DeleteInputSecurityGroupInput { - s.InputSecurityGroupId = &v +// SetNetworkId sets the NetworkId field's value. +func (s *DvbNitSettings) SetNetworkId(v int64) *DvbNitSettings { + s.NetworkId = &v return s } -type DeleteInputSecurityGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteInputSecurityGroupOutput) String() string { - return awsutil.Prettify(s) +// SetNetworkName sets the NetworkName field's value. +func (s *DvbNitSettings) SetNetworkName(v string) *DvbNitSettings { + s.NetworkName = &v + return s } -// GoString returns the string representation -func (s DeleteInputSecurityGroupOutput) GoString() string { - return s.String() +// SetRepInterval sets the RepInterval field's value. +func (s *DvbNitSettings) SetRepInterval(v int64) *DvbNitSettings { + s.RepInterval = &v + return s } -type DeleteReservationInput struct { +// DVB Service Description Table (SDT) +type DvbSdtSettings struct { _ struct{} `type:"structure"` - // ReservationId is a required field - ReservationId *string `location:"uri" locationName:"reservationId" type:"string" required:"true"` + // Selects method of inserting SDT information into output stream. The sdtFollow + // setting copies SDT information from input stream to output stream. The sdtFollowIfPresent + // setting copies SDT information from input stream to output stream if SDT + // information is present in the input, otherwise it will fall back on the user-defined + // values. The sdtManual setting means user will enter the SDT information. + // The sdtNone setting means output stream will not contain SDT information. + OutputSdt *string `locationName:"outputSdt" type:"string" enum:"DvbSdtOutputSdt"` + + // The number of milliseconds between instances of this table in the output + // transport stream. + RepInterval *int64 `locationName:"repInterval" min:"25" type:"integer"` + + // The service name placed in the serviceDescriptor in the Service Description + // Table. Maximum length is 256 characters. + ServiceName *string `locationName:"serviceName" min:"1" type:"string"` + + // The service provider name placed in the serviceDescriptor in the Service + // Description Table. Maximum length is 256 characters. + ServiceProviderName *string `locationName:"serviceProviderName" min:"1" type:"string"` } // String returns the string representation -func (s DeleteReservationInput) String() string { +func (s DvbSdtSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteReservationInput) GoString() string { +func (s DvbSdtSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteReservationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteReservationInput"} - if s.ReservationId == nil { - invalidParams.Add(request.NewErrParamRequired("ReservationId")) +func (s *DvbSdtSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DvbSdtSettings"} + if s.RepInterval != nil && *s.RepInterval < 25 { + invalidParams.Add(request.NewErrParamMinValue("RepInterval", 25)) } - if s.ReservationId != nil && len(*s.ReservationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ReservationId", 1)) + if s.ServiceName != nil && len(*s.ServiceName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ServiceName", 1)) + } + if s.ServiceProviderName != nil && len(*s.ServiceProviderName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ServiceProviderName", 1)) } if invalidParams.Len() > 0 { @@ -6369,199 +9738,289 @@ func (s *DeleteReservationInput) Validate() error { return nil } -// SetReservationId sets the ReservationId field's value. -func (s *DeleteReservationInput) SetReservationId(v string) *DeleteReservationInput { - s.ReservationId = &v +// SetOutputSdt sets the OutputSdt field's value. +func (s *DvbSdtSettings) SetOutputSdt(v string) *DvbSdtSettings { + s.OutputSdt = &v return s } -type DeleteReservationOutput struct { - _ struct{} `type:"structure"` +// SetRepInterval sets the RepInterval field's value. +func (s *DvbSdtSettings) SetRepInterval(v int64) *DvbSdtSettings { + s.RepInterval = &v + return s +} - Arn *string `locationName:"arn" type:"string"` +// SetServiceName sets the ServiceName field's value. +func (s *DvbSdtSettings) SetServiceName(v string) *DvbSdtSettings { + s.ServiceName = &v + return s +} - Count *int64 `locationName:"count" type:"integer"` +// SetServiceProviderName sets the ServiceProviderName field's value. +func (s *DvbSdtSettings) SetServiceProviderName(v string) *DvbSdtSettings { + s.ServiceProviderName = &v + return s +} - CurrencyCode *string `locationName:"currencyCode" type:"string"` +// Dvb Sub Destination Settings +type DvbSubDestinationSettings struct { + _ struct{} `type:"structure"` - Duration *int64 `locationName:"duration" type:"integer"` + // If no explicit xPosition or yPosition is provided, setting alignment to centered + // will place the captions at the bottom center of the output. Similarly, setting + // a left alignment will align captions to the bottom left of the output. If + // x and y positions are given in conjunction with the alignment parameter, + // the font will be justified (either left or centered) relative to those coordinates. + // Selecting "smart" justification will left-justify live subtitles and center-justify + // pre-recorded subtitles. This option is not valid for source captions that + // are STL or 608/embedded. These source settings are already pre-defined by + // the caption stream. All burn-in and DVB-Sub font settings must match. + Alignment *string `locationName:"alignment" type:"string" enum:"DvbSubDestinationAlignment"` - // Units for duration, e.g. 'MONTHS' - DurationUnits *string `locationName:"durationUnits" type:"string" enum:"OfferingDurationUnits"` + // Specifies the color of the rectangle behind the captions. All burn-in and + // DVB-Sub font settings must match. + BackgroundColor *string `locationName:"backgroundColor" type:"string" enum:"DvbSubDestinationBackgroundColor"` - End *string `locationName:"end" type:"string"` + // Specifies the opacity of the background rectangle. 255 is opaque; 0 is transparent. + // Leaving this parameter blank is equivalent to setting it to 0 (transparent). + // All burn-in and DVB-Sub font settings must match. + BackgroundOpacity *int64 `locationName:"backgroundOpacity" type:"integer"` - FixedPrice *float64 `locationName:"fixedPrice" type:"double"` + // External font file used for caption burn-in. File extension must be 'ttf' + // or 'tte'. Although the user can select output fonts for many different types + // of input captions, embedded, STL and teletext sources use a strict grid system. + // Using external fonts with these caption sources could cause unexpected display + // of proportional fonts. All burn-in and DVB-Sub font settings must match. + Font *InputLocation `locationName:"font" type:"structure"` - Name *string `locationName:"name" type:"string"` + // Specifies the color of the burned-in captions. This option is not valid for + // source captions that are STL, 608/embedded or teletext. These source settings + // are already pre-defined by the caption stream. All burn-in and DVB-Sub font + // settings must match. + FontColor *string `locationName:"fontColor" type:"string" enum:"DvbSubDestinationFontColor"` - OfferingDescription *string `locationName:"offeringDescription" type:"string"` + // Specifies the opacity of the burned-in captions. 255 is opaque; 0 is transparent. + // All burn-in and DVB-Sub font settings must match. + FontOpacity *int64 `locationName:"fontOpacity" type:"integer"` - OfferingId *string `locationName:"offeringId" type:"string"` + // Font resolution in DPI (dots per inch); default is 96 dpi. All burn-in and + // DVB-Sub font settings must match. + FontResolution *int64 `locationName:"fontResolution" min:"96" type:"integer"` - // Offering type, e.g. 'NO_UPFRONT' - OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingType"` + // When set to auto fontSize will scale depending on the size of the output. + // Giving a positive integer will specify the exact font size in points. All + // burn-in and DVB-Sub font settings must match. + FontSize *string `locationName:"fontSize" type:"string"` - Region *string `locationName:"region" type:"string"` + // Specifies font outline color. This option is not valid for source captions + // that are either 608/embedded or teletext. These source settings are already + // pre-defined by the caption stream. All burn-in and DVB-Sub font settings + // must match. + OutlineColor *string `locationName:"outlineColor" type:"string" enum:"DvbSubDestinationOutlineColor"` - ReservationId *string `locationName:"reservationId" type:"string"` + // Specifies font outline size in pixels. This option is not valid for source + // captions that are either 608/embedded or teletext. These source settings + // are already pre-defined by the caption stream. All burn-in and DVB-Sub font + // settings must match. + OutlineSize *int64 `locationName:"outlineSize" type:"integer"` - // Resource configuration (codec, resolution, bitrate, ...) - ResourceSpecification *ReservationResourceSpecification `locationName:"resourceSpecification" type:"structure"` + // Specifies the color of the shadow cast by the captions. All burn-in and DVB-Sub + // font settings must match. + ShadowColor *string `locationName:"shadowColor" type:"string" enum:"DvbSubDestinationShadowColor"` - Start *string `locationName:"start" type:"string"` + // Specifies the opacity of the shadow. 255 is opaque; 0 is transparent. Leaving + // this parameter blank is equivalent to setting it to 0 (transparent). All + // burn-in and DVB-Sub font settings must match. + ShadowOpacity *int64 `locationName:"shadowOpacity" type:"integer"` - // Current reservation state - State *string `locationName:"state" type:"string" enum:"ReservationState"` + // Specifies the horizontal offset of the shadow relative to the captions in + // pixels. A value of -2 would result in a shadow offset 2 pixels to the left. + // All burn-in and DVB-Sub font settings must match. + ShadowXOffset *int64 `locationName:"shadowXOffset" type:"integer"` - Tags map[string]*string `locationName:"tags" type:"map"` + // Specifies the vertical offset of the shadow relative to the captions in pixels. + // A value of -2 would result in a shadow offset 2 pixels above the text. All + // burn-in and DVB-Sub font settings must match. + ShadowYOffset *int64 `locationName:"shadowYOffset" type:"integer"` - UsagePrice *float64 `locationName:"usagePrice" type:"double"` + // Controls whether a fixed grid size will be used to generate the output subtitles + // bitmap. Only applicable for Teletext inputs and DVB-Sub/Burn-in outputs. + TeletextGridControl *string `locationName:"teletextGridControl" type:"string" enum:"DvbSubDestinationTeletextGridControl"` + + // Specifies the horizontal position of the caption relative to the left side + // of the output in pixels. A value of 10 would result in the captions starting + // 10 pixels from the left of the output. If no explicit xPosition is provided, + // the horizontal caption position will be determined by the alignment parameter. + // This option is not valid for source captions that are STL, 608/embedded or + // teletext. These source settings are already pre-defined by the caption stream. + // All burn-in and DVB-Sub font settings must match. + XPosition *int64 `locationName:"xPosition" type:"integer"` + + // Specifies the vertical position of the caption relative to the top of the + // output in pixels. A value of 10 would result in the captions starting 10 + // pixels from the top of the output. If no explicit yPosition is provided, + // the caption will be positioned towards the bottom of the output. This option + // is not valid for source captions that are STL, 608/embedded or teletext. + // These source settings are already pre-defined by the caption stream. All + // burn-in and DVB-Sub font settings must match. + YPosition *int64 `locationName:"yPosition" type:"integer"` } // String returns the string representation -func (s DeleteReservationOutput) String() string { +func (s DvbSubDestinationSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteReservationOutput) GoString() string { +func (s DvbSubDestinationSettings) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *DeleteReservationOutput) SetArn(v string) *DeleteReservationOutput { - s.Arn = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DvbSubDestinationSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DvbSubDestinationSettings"} + if s.FontResolution != nil && *s.FontResolution < 96 { + invalidParams.Add(request.NewErrParamMinValue("FontResolution", 96)) + } + if s.Font != nil { + if err := s.Font.Validate(); err != nil { + invalidParams.AddNested("Font", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetCount sets the Count field's value. -func (s *DeleteReservationOutput) SetCount(v int64) *DeleteReservationOutput { - s.Count = &v +// SetAlignment sets the Alignment field's value. +func (s *DvbSubDestinationSettings) SetAlignment(v string) *DvbSubDestinationSettings { + s.Alignment = &v return s } -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *DeleteReservationOutput) SetCurrencyCode(v string) *DeleteReservationOutput { - s.CurrencyCode = &v +// SetBackgroundColor sets the BackgroundColor field's value. +func (s *DvbSubDestinationSettings) SetBackgroundColor(v string) *DvbSubDestinationSettings { + s.BackgroundColor = &v return s } -// SetDuration sets the Duration field's value. -func (s *DeleteReservationOutput) SetDuration(v int64) *DeleteReservationOutput { - s.Duration = &v +// SetBackgroundOpacity sets the BackgroundOpacity field's value. +func (s *DvbSubDestinationSettings) SetBackgroundOpacity(v int64) *DvbSubDestinationSettings { + s.BackgroundOpacity = &v return s } -// SetDurationUnits sets the DurationUnits field's value. -func (s *DeleteReservationOutput) SetDurationUnits(v string) *DeleteReservationOutput { - s.DurationUnits = &v +// SetFont sets the Font field's value. +func (s *DvbSubDestinationSettings) SetFont(v *InputLocation) *DvbSubDestinationSettings { + s.Font = v return s } -// SetEnd sets the End field's value. -func (s *DeleteReservationOutput) SetEnd(v string) *DeleteReservationOutput { - s.End = &v +// SetFontColor sets the FontColor field's value. +func (s *DvbSubDestinationSettings) SetFontColor(v string) *DvbSubDestinationSettings { + s.FontColor = &v return s } -// SetFixedPrice sets the FixedPrice field's value. -func (s *DeleteReservationOutput) SetFixedPrice(v float64) *DeleteReservationOutput { - s.FixedPrice = &v +// SetFontOpacity sets the FontOpacity field's value. +func (s *DvbSubDestinationSettings) SetFontOpacity(v int64) *DvbSubDestinationSettings { + s.FontOpacity = &v return s } -// SetName sets the Name field's value. -func (s *DeleteReservationOutput) SetName(v string) *DeleteReservationOutput { - s.Name = &v +// SetFontResolution sets the FontResolution field's value. +func (s *DvbSubDestinationSettings) SetFontResolution(v int64) *DvbSubDestinationSettings { + s.FontResolution = &v return s } -// SetOfferingDescription sets the OfferingDescription field's value. -func (s *DeleteReservationOutput) SetOfferingDescription(v string) *DeleteReservationOutput { - s.OfferingDescription = &v +// SetFontSize sets the FontSize field's value. +func (s *DvbSubDestinationSettings) SetFontSize(v string) *DvbSubDestinationSettings { + s.FontSize = &v return s } -// SetOfferingId sets the OfferingId field's value. -func (s *DeleteReservationOutput) SetOfferingId(v string) *DeleteReservationOutput { - s.OfferingId = &v +// SetOutlineColor sets the OutlineColor field's value. +func (s *DvbSubDestinationSettings) SetOutlineColor(v string) *DvbSubDestinationSettings { + s.OutlineColor = &v return s } -// SetOfferingType sets the OfferingType field's value. -func (s *DeleteReservationOutput) SetOfferingType(v string) *DeleteReservationOutput { - s.OfferingType = &v +// SetOutlineSize sets the OutlineSize field's value. +func (s *DvbSubDestinationSettings) SetOutlineSize(v int64) *DvbSubDestinationSettings { + s.OutlineSize = &v return s } -// SetRegion sets the Region field's value. -func (s *DeleteReservationOutput) SetRegion(v string) *DeleteReservationOutput { - s.Region = &v +// SetShadowColor sets the ShadowColor field's value. +func (s *DvbSubDestinationSettings) SetShadowColor(v string) *DvbSubDestinationSettings { + s.ShadowColor = &v return s } -// SetReservationId sets the ReservationId field's value. -func (s *DeleteReservationOutput) SetReservationId(v string) *DeleteReservationOutput { - s.ReservationId = &v +// SetShadowOpacity sets the ShadowOpacity field's value. +func (s *DvbSubDestinationSettings) SetShadowOpacity(v int64) *DvbSubDestinationSettings { + s.ShadowOpacity = &v return s } -// SetResourceSpecification sets the ResourceSpecification field's value. -func (s *DeleteReservationOutput) SetResourceSpecification(v *ReservationResourceSpecification) *DeleteReservationOutput { - s.ResourceSpecification = v +// SetShadowXOffset sets the ShadowXOffset field's value. +func (s *DvbSubDestinationSettings) SetShadowXOffset(v int64) *DvbSubDestinationSettings { + s.ShadowXOffset = &v return s } -// SetStart sets the Start field's value. -func (s *DeleteReservationOutput) SetStart(v string) *DeleteReservationOutput { - s.Start = &v +// SetShadowYOffset sets the ShadowYOffset field's value. +func (s *DvbSubDestinationSettings) SetShadowYOffset(v int64) *DvbSubDestinationSettings { + s.ShadowYOffset = &v return s } -// SetState sets the State field's value. -func (s *DeleteReservationOutput) SetState(v string) *DeleteReservationOutput { - s.State = &v +// SetTeletextGridControl sets the TeletextGridControl field's value. +func (s *DvbSubDestinationSettings) SetTeletextGridControl(v string) *DvbSubDestinationSettings { + s.TeletextGridControl = &v return s } -// SetTags sets the Tags field's value. -func (s *DeleteReservationOutput) SetTags(v map[string]*string) *DeleteReservationOutput { - s.Tags = v +// SetXPosition sets the XPosition field's value. +func (s *DvbSubDestinationSettings) SetXPosition(v int64) *DvbSubDestinationSettings { + s.XPosition = &v return s } -// SetUsagePrice sets the UsagePrice field's value. -func (s *DeleteReservationOutput) SetUsagePrice(v float64) *DeleteReservationOutput { - s.UsagePrice = &v +// SetYPosition sets the YPosition field's value. +func (s *DvbSubDestinationSettings) SetYPosition(v int64) *DvbSubDestinationSettings { + s.YPosition = &v return s } -type DeleteScheduleInput struct { +// Dvb Sub Source Settings +type DvbSubSourceSettings struct { _ struct{} `type:"structure"` - // ChannelId is a required field - ChannelId *string `location:"uri" locationName:"channelId" type:"string" required:"true"` + // When using DVB-Sub with Burn-In or SMPTE-TT, use this PID for the source + // content. Unused for DVB-Sub passthrough. All DVB-Sub content is passed through, + // regardless of selectors. + Pid *int64 `locationName:"pid" min:"1" type:"integer"` } // String returns the string representation -func (s DeleteScheduleInput) String() string { +func (s DvbSubSourceSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteScheduleInput) GoString() string { +func (s DvbSubSourceSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteScheduleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteScheduleInput"} - if s.ChannelId == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelId")) - } - if s.ChannelId != nil && len(*s.ChannelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelId", 1)) +func (s *DvbSubSourceSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DvbSubSourceSettings"} + if s.Pid != nil && *s.Pid < 1 { + invalidParams.Add(request.NewErrParamMinValue("Pid", 1)) } if invalidParams.Len() > 0 { @@ -6570,57 +10029,143 @@ func (s *DeleteScheduleInput) Validate() error { return nil } -// SetChannelId sets the ChannelId field's value. -func (s *DeleteScheduleInput) SetChannelId(v string) *DeleteScheduleInput { - s.ChannelId = &v +// SetPid sets the Pid field's value. +func (s *DvbSubSourceSettings) SetPid(v int64) *DvbSubSourceSettings { + s.Pid = &v return s } -type DeleteScheduleOutput struct { +// DVB Time and Date Table (SDT) +type DvbTdtSettings struct { _ struct{} `type:"structure"` + + // The number of milliseconds between instances of this table in the output + // transport stream. + RepInterval *int64 `locationName:"repInterval" min:"1000" type:"integer"` } // String returns the string representation -func (s DeleteScheduleOutput) String() string { +func (s DvbTdtSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteScheduleOutput) GoString() string { +func (s DvbTdtSettings) GoString() string { return s.String() } -type DeleteTagsInput struct { +// Validate inspects the fields of the type to determine if they are valid. +func (s *DvbTdtSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DvbTdtSettings"} + if s.RepInterval != nil && *s.RepInterval < 1000 { + invalidParams.Add(request.NewErrParamMinValue("RepInterval", 1000)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRepInterval sets the RepInterval field's value. +func (s *DvbTdtSettings) SetRepInterval(v int64) *DvbTdtSettings { + s.RepInterval = &v + return s +} + +// Eac3 Settings +type Eac3Settings struct { _ struct{} `type:"structure"` - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` + // When set to attenuate3Db, applies a 3 dB attenuation to the surround channels. + // Only used for 3/2 coding mode. + AttenuationControl *string `locationName:"attenuationControl" type:"string" enum:"Eac3AttenuationControl"` - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" required:"true"` + // Average bitrate in bits/second. Valid bitrates depend on the coding mode. + Bitrate *float64 `locationName:"bitrate" type:"double"` + + // Specifies the bitstream mode (bsmod) for the emitted E-AC-3 stream. See ATSC + // A/52-2012 (Annex E) for background on these values. + BitstreamMode *string `locationName:"bitstreamMode" type:"string" enum:"Eac3BitstreamMode"` + + // Dolby Digital Plus coding mode. Determines number of channels. + CodingMode *string `locationName:"codingMode" type:"string" enum:"Eac3CodingMode"` + + // When set to enabled, activates a DC highpass filter for all input channels. + DcFilter *string `locationName:"dcFilter" type:"string" enum:"Eac3DcFilter"` + + // Sets the dialnorm for the output. If blank and input audio is Dolby Digital + // Plus, dialnorm will be passed through. + Dialnorm *int64 `locationName:"dialnorm" min:"1" type:"integer"` + + // Sets the Dolby dynamic range compression profile. + DrcLine *string `locationName:"drcLine" type:"string" enum:"Eac3DrcLine"` + + // Sets the profile for heavy Dolby dynamic range compression, ensures that + // the instantaneous signal peaks do not exceed specified levels. + DrcRf *string `locationName:"drcRf" type:"string" enum:"Eac3DrcRf"` + + // When encoding 3/2 audio, setting to lfe enables the LFE channel + LfeControl *string `locationName:"lfeControl" type:"string" enum:"Eac3LfeControl"` + + // When set to enabled, applies a 120Hz lowpass filter to the LFE channel prior + // to encoding. Only valid with codingMode32 coding mode. + LfeFilter *string `locationName:"lfeFilter" type:"string" enum:"Eac3LfeFilter"` + + // Left only/Right only center mix level. Only used for 3/2 coding mode. + LoRoCenterMixLevel *float64 `locationName:"loRoCenterMixLevel" type:"double"` + + // Left only/Right only surround mix level. Only used for 3/2 coding mode. + LoRoSurroundMixLevel *float64 `locationName:"loRoSurroundMixLevel" type:"double"` + + // Left total/Right total center mix level. Only used for 3/2 coding mode. + LtRtCenterMixLevel *float64 `locationName:"ltRtCenterMixLevel" type:"double"` + + // Left total/Right total surround mix level. Only used for 3/2 coding mode. + LtRtSurroundMixLevel *float64 `locationName:"ltRtSurroundMixLevel" type:"double"` + + // When set to followInput, encoder metadata will be sourced from the DD, DD+, + // or DolbyE decoder that supplied this audio data. If audio was not supplied + // from one of these streams, then the static metadata settings will be used. + MetadataControl *string `locationName:"metadataControl" type:"string" enum:"Eac3MetadataControl"` + + // When set to whenPossible, input DD+ audio will be passed through if it is + // present on the input. This detection is dynamic over the life of the transcode. + // Inputs that alternate between DD+ and non-DD+ content will have a consistent + // DD+ output as the system alternates between passthrough and encoding. + PassthroughControl *string `locationName:"passthroughControl" type:"string" enum:"Eac3PassthroughControl"` + + // When set to shift90Degrees, applies a 90-degree phase shift to the surround + // channels. Only used for 3/2 coding mode. + PhaseControl *string `locationName:"phaseControl" type:"string" enum:"Eac3PhaseControl"` + + // Stereo downmix preference. Only used for 3/2 coding mode. + StereoDownmix *string `locationName:"stereoDownmix" type:"string" enum:"Eac3StereoDownmix"` + + // When encoding 3/2 audio, sets whether an extra center back surround channel + // is matrix encoded into the left and right surround channels. + SurroundExMode *string `locationName:"surroundExMode" type:"string" enum:"Eac3SurroundExMode"` + + // When encoding 2/0 audio, sets whether Dolby Surround is matrix encoded into + // the two channels. + SurroundMode *string `locationName:"surroundMode" type:"string" enum:"Eac3SurroundMode"` } // String returns the string representation -func (s DeleteTagsInput) String() string { +func (s Eac3Settings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTagsInput) GoString() string { +func (s Eac3Settings) 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.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")) +func (s *Eac3Settings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Eac3Settings"} + if s.Dialnorm != nil && *s.Dialnorm < 1 { + invalidParams.Add(request.NewErrParamMinValue("Dialnorm", 1)) } if invalidParams.Len() > 0 { @@ -6629,234 +10174,195 @@ func (s *DeleteTagsInput) Validate() error { return nil } -// SetResourceArn sets the ResourceArn field's value. -func (s *DeleteTagsInput) SetResourceArn(v string) *DeleteTagsInput { - s.ResourceArn = &v +// SetAttenuationControl sets the AttenuationControl field's value. +func (s *Eac3Settings) SetAttenuationControl(v string) *Eac3Settings { + s.AttenuationControl = &v return s } -// SetTagKeys sets the TagKeys field's value. -func (s *DeleteTagsInput) SetTagKeys(v []*string) *DeleteTagsInput { - s.TagKeys = v +// SetBitrate sets the Bitrate field's value. +func (s *Eac3Settings) SetBitrate(v float64) *Eac3Settings { + s.Bitrate = &v return s } -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() +// SetBitstreamMode sets the BitstreamMode field's value. +func (s *Eac3Settings) SetBitstreamMode(v string) *Eac3Settings { + s.BitstreamMode = &v + return s } -type DescribeChannelInput struct { - _ struct{} `type:"structure"` - - // ChannelId is a required field - ChannelId *string `location:"uri" locationName:"channelId" type:"string" required:"true"` +// SetCodingMode sets the CodingMode field's value. +func (s *Eac3Settings) SetCodingMode(v string) *Eac3Settings { + s.CodingMode = &v + return s } -// String returns the string representation -func (s DescribeChannelInput) String() string { - return awsutil.Prettify(s) +// SetDcFilter sets the DcFilter field's value. +func (s *Eac3Settings) SetDcFilter(v string) *Eac3Settings { + s.DcFilter = &v + return s } -// GoString returns the string representation -func (s DescribeChannelInput) GoString() string { - return s.String() +// SetDialnorm sets the Dialnorm field's value. +func (s *Eac3Settings) SetDialnorm(v int64) *Eac3Settings { + s.Dialnorm = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeChannelInput"} - if s.ChannelId == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelId")) - } - if s.ChannelId != nil && len(*s.ChannelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetDrcLine sets the DrcLine field's value. +func (s *Eac3Settings) SetDrcLine(v string) *Eac3Settings { + s.DrcLine = &v + return s } -// SetChannelId sets the ChannelId field's value. -func (s *DescribeChannelInput) SetChannelId(v string) *DescribeChannelInput { - s.ChannelId = &v +// SetDrcRf sets the DrcRf field's value. +func (s *Eac3Settings) SetDrcRf(v string) *Eac3Settings { + s.DrcRf = &v return s } -type DescribeChannelOutput struct { - _ struct{} `type:"structure"` - - Arn *string `locationName:"arn" type:"string"` - - // A standard channel has two encoding pipelines and a single pipeline channel - // only has one. - ChannelClass *string `locationName:"channelClass" type:"string" enum:"ChannelClass"` - - Destinations []*OutputDestination `locationName:"destinations" type:"list"` - - EgressEndpoints []*ChannelEgressEndpoint `locationName:"egressEndpoints" type:"list"` - - // Encoder Settings - EncoderSettings *EncoderSettings `locationName:"encoderSettings" type:"structure"` - - Id *string `locationName:"id" type:"string"` - - InputAttachments []*InputAttachment `locationName:"inputAttachments" type:"list"` - - InputSpecification *InputSpecification `locationName:"inputSpecification" type:"structure"` - - // The log level the user wants for their channel. - LogLevel *string `locationName:"logLevel" type:"string" enum:"LogLevel"` - - Name *string `locationName:"name" type:"string"` - - PipelineDetails []*PipelineDetail `locationName:"pipelineDetails" type:"list"` - - PipelinesRunningCount *int64 `locationName:"pipelinesRunningCount" type:"integer"` - - RoleArn *string `locationName:"roleArn" type:"string"` - - State *string `locationName:"state" type:"string" enum:"ChannelState"` - - Tags map[string]*string `locationName:"tags" type:"map"` +// SetLfeControl sets the LfeControl field's value. +func (s *Eac3Settings) SetLfeControl(v string) *Eac3Settings { + s.LfeControl = &v + return s } -// String returns the string representation -func (s DescribeChannelOutput) String() string { - return awsutil.Prettify(s) +// SetLfeFilter sets the LfeFilter field's value. +func (s *Eac3Settings) SetLfeFilter(v string) *Eac3Settings { + s.LfeFilter = &v + return s } -// GoString returns the string representation -func (s DescribeChannelOutput) GoString() string { - return s.String() +// SetLoRoCenterMixLevel sets the LoRoCenterMixLevel field's value. +func (s *Eac3Settings) SetLoRoCenterMixLevel(v float64) *Eac3Settings { + s.LoRoCenterMixLevel = &v + return s } -// SetArn sets the Arn field's value. -func (s *DescribeChannelOutput) SetArn(v string) *DescribeChannelOutput { - s.Arn = &v +// SetLoRoSurroundMixLevel sets the LoRoSurroundMixLevel field's value. +func (s *Eac3Settings) SetLoRoSurroundMixLevel(v float64) *Eac3Settings { + s.LoRoSurroundMixLevel = &v return s } -// SetChannelClass sets the ChannelClass field's value. -func (s *DescribeChannelOutput) SetChannelClass(v string) *DescribeChannelOutput { - s.ChannelClass = &v +// SetLtRtCenterMixLevel sets the LtRtCenterMixLevel field's value. +func (s *Eac3Settings) SetLtRtCenterMixLevel(v float64) *Eac3Settings { + s.LtRtCenterMixLevel = &v return s } -// SetDestinations sets the Destinations field's value. -func (s *DescribeChannelOutput) SetDestinations(v []*OutputDestination) *DescribeChannelOutput { - s.Destinations = v +// SetLtRtSurroundMixLevel sets the LtRtSurroundMixLevel field's value. +func (s *Eac3Settings) SetLtRtSurroundMixLevel(v float64) *Eac3Settings { + s.LtRtSurroundMixLevel = &v return s } -// SetEgressEndpoints sets the EgressEndpoints field's value. -func (s *DescribeChannelOutput) SetEgressEndpoints(v []*ChannelEgressEndpoint) *DescribeChannelOutput { - s.EgressEndpoints = v +// SetMetadataControl sets the MetadataControl field's value. +func (s *Eac3Settings) SetMetadataControl(v string) *Eac3Settings { + s.MetadataControl = &v return s } -// SetEncoderSettings sets the EncoderSettings field's value. -func (s *DescribeChannelOutput) SetEncoderSettings(v *EncoderSettings) *DescribeChannelOutput { - s.EncoderSettings = v +// SetPassthroughControl sets the PassthroughControl field's value. +func (s *Eac3Settings) SetPassthroughControl(v string) *Eac3Settings { + s.PassthroughControl = &v return s } -// SetId sets the Id field's value. -func (s *DescribeChannelOutput) SetId(v string) *DescribeChannelOutput { - s.Id = &v +// SetPhaseControl sets the PhaseControl field's value. +func (s *Eac3Settings) SetPhaseControl(v string) *Eac3Settings { + s.PhaseControl = &v return s } -// SetInputAttachments sets the InputAttachments field's value. -func (s *DescribeChannelOutput) SetInputAttachments(v []*InputAttachment) *DescribeChannelOutput { - s.InputAttachments = v +// SetStereoDownmix sets the StereoDownmix field's value. +func (s *Eac3Settings) SetStereoDownmix(v string) *Eac3Settings { + s.StereoDownmix = &v return s } -// SetInputSpecification sets the InputSpecification field's value. -func (s *DescribeChannelOutput) SetInputSpecification(v *InputSpecification) *DescribeChannelOutput { - s.InputSpecification = v +// SetSurroundExMode sets the SurroundExMode field's value. +func (s *Eac3Settings) SetSurroundExMode(v string) *Eac3Settings { + s.SurroundExMode = &v return s } -// SetLogLevel sets the LogLevel field's value. -func (s *DescribeChannelOutput) SetLogLevel(v string) *DescribeChannelOutput { - s.LogLevel = &v +// SetSurroundMode sets the SurroundMode field's value. +func (s *Eac3Settings) SetSurroundMode(v string) *Eac3Settings { + s.SurroundMode = &v return s } -// SetName sets the Name field's value. -func (s *DescribeChannelOutput) SetName(v string) *DescribeChannelOutput { - s.Name = &v - return s +// Embedded Destination Settings +type EmbeddedDestinationSettings struct { + _ struct{} `type:"structure"` } -// SetPipelineDetails sets the PipelineDetails field's value. -func (s *DescribeChannelOutput) SetPipelineDetails(v []*PipelineDetail) *DescribeChannelOutput { - s.PipelineDetails = v - return s +// String returns the string representation +func (s EmbeddedDestinationSettings) String() string { + return awsutil.Prettify(s) } -// SetPipelinesRunningCount sets the PipelinesRunningCount field's value. -func (s *DescribeChannelOutput) SetPipelinesRunningCount(v int64) *DescribeChannelOutput { - s.PipelinesRunningCount = &v - return s +// GoString returns the string representation +func (s EmbeddedDestinationSettings) GoString() string { + return s.String() } -// SetRoleArn sets the RoleArn field's value. -func (s *DescribeChannelOutput) SetRoleArn(v string) *DescribeChannelOutput { - s.RoleArn = &v - return s +// Embedded Plus Scte20 Destination Settings +type EmbeddedPlusScte20DestinationSettings struct { + _ struct{} `type:"structure"` } -// SetState sets the State field's value. -func (s *DescribeChannelOutput) SetState(v string) *DescribeChannelOutput { - s.State = &v - return s +// String returns the string representation +func (s EmbeddedPlusScte20DestinationSettings) String() string { + return awsutil.Prettify(s) } -// SetTags sets the Tags field's value. -func (s *DescribeChannelOutput) SetTags(v map[string]*string) *DescribeChannelOutput { - s.Tags = v - return s +// GoString returns the string representation +func (s EmbeddedPlusScte20DestinationSettings) GoString() string { + return s.String() } -type DescribeInputInput struct { +// Embedded Source Settings +type EmbeddedSourceSettings struct { _ struct{} `type:"structure"` - // InputId is a required field - InputId *string `location:"uri" locationName:"inputId" type:"string" required:"true"` + // If upconvert, 608 data is both passed through via the "608 compatibility + // bytes" fields of the 708 wrapper as well as translated into 708. 708 data + // present in the source content will be discarded. + Convert608To708 *string `locationName:"convert608To708" type:"string" enum:"EmbeddedConvert608To708"` + + // Set to "auto" to handle streams with intermittent and/or non-aligned SCTE-20 + // and Embedded captions. + Scte20Detection *string `locationName:"scte20Detection" type:"string" enum:"EmbeddedScte20Detection"` + + // Specifies the 608/708 channel number within the video track from which to + // extract captions. Unused for passthrough. + Source608ChannelNumber *int64 `locationName:"source608ChannelNumber" min:"1" type:"integer"` + + // This field is unused and deprecated. + Source608TrackNumber *int64 `locationName:"source608TrackNumber" min:"1" type:"integer"` } // String returns the string representation -func (s DescribeInputInput) String() string { +func (s EmbeddedSourceSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeInputInput) GoString() string { +func (s EmbeddedSourceSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeInputInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeInputInput"} - if s.InputId == nil { - invalidParams.Add(request.NewErrParamRequired("InputId")) +func (s *EmbeddedSourceSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EmbeddedSourceSettings"} + if s.Source608ChannelNumber != nil && *s.Source608ChannelNumber < 1 { + invalidParams.Add(request.NewErrParamMinValue("Source608ChannelNumber", 1)) } - if s.InputId != nil && len(*s.InputId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InputId", 1)) + if s.Source608TrackNumber != nil && *s.Source608TrackNumber < 1 { + invalidParams.Add(request.NewErrParamMinValue("Source608TrackNumber", 1)) } if invalidParams.Len() > 0 { @@ -6865,168 +10371,263 @@ func (s *DescribeInputInput) Validate() error { return nil } -// SetInputId sets the InputId field's value. -func (s *DescribeInputInput) SetInputId(v string) *DescribeInputInput { - s.InputId = &v +// SetConvert608To708 sets the Convert608To708 field's value. +func (s *EmbeddedSourceSettings) SetConvert608To708(v string) *EmbeddedSourceSettings { + s.Convert608To708 = &v return s } -type DescribeInputOutput struct { - _ struct{} `type:"structure"` - - Arn *string `locationName:"arn" type:"string"` +// SetScte20Detection sets the Scte20Detection field's value. +func (s *EmbeddedSourceSettings) SetScte20Detection(v string) *EmbeddedSourceSettings { + s.Scte20Detection = &v + return s +} - AttachedChannels []*string `locationName:"attachedChannels" type:"list"` +// SetSource608ChannelNumber sets the Source608ChannelNumber field's value. +func (s *EmbeddedSourceSettings) SetSource608ChannelNumber(v int64) *EmbeddedSourceSettings { + s.Source608ChannelNumber = &v + return s +} - Destinations []*InputDestination `locationName:"destinations" type:"list"` +// SetSource608TrackNumber sets the Source608TrackNumber field's value. +func (s *EmbeddedSourceSettings) SetSource608TrackNumber(v int64) *EmbeddedSourceSettings { + s.Source608TrackNumber = &v + return s +} - Id *string `locationName:"id" type:"string"` +// Encoder Settings +type EncoderSettings struct { + _ struct{} `type:"structure"` - // A standard input has two sources and a single pipeline input only has one. - InputClass *string `locationName:"inputClass" type:"string" enum:"InputClass"` + // AudioDescriptions is a required field + AudioDescriptions []*AudioDescription `locationName:"audioDescriptions" type:"list" required:"true"` - // There are two types of input sources, static and dynamic. If an input source - // is dynamic you canchange the source url of the input dynamically using an - // input switch action. However, the only input typeto support a dynamic url - // at this time is MP4_FILE. By default all input sources are static. - InputSourceType *string `locationName:"inputSourceType" type:"string" enum:"InputSourceType"` + // Settings for ad avail blanking. + AvailBlanking *AvailBlanking `locationName:"availBlanking" type:"structure"` - MediaConnectFlows []*MediaConnectFlow `locationName:"mediaConnectFlows" type:"list"` + // Event-wide configuration settings for ad avail insertion. + AvailConfiguration *AvailConfiguration `locationName:"availConfiguration" type:"structure"` - Name *string `locationName:"name" type:"string"` + // Settings for blackout slate. + BlackoutSlate *BlackoutSlate `locationName:"blackoutSlate" type:"structure"` - RoleArn *string `locationName:"roleArn" type:"string"` + // Settings for caption decriptions + CaptionDescriptions []*CaptionDescription `locationName:"captionDescriptions" type:"list"` - SecurityGroups []*string `locationName:"securityGroups" type:"list"` + // Configuration settings that apply to the event as a whole. + GlobalConfiguration *GlobalConfiguration `locationName:"globalConfiguration" type:"structure"` - Sources []*InputSource `locationName:"sources" type:"list"` + // Nielsen configuration settings. + NielsenConfiguration *NielsenConfiguration `locationName:"nielsenConfiguration" type:"structure"` - State *string `locationName:"state" type:"string" enum:"InputState"` + // OutputGroups is a required field + OutputGroups []*OutputGroup `locationName:"outputGroups" type:"list" required:"true"` - Tags map[string]*string `locationName:"tags" type:"map"` + // Contains settings used to acquire and adjust timecode information from inputs. + // + // TimecodeConfig is a required field + TimecodeConfig *TimecodeConfig `locationName:"timecodeConfig" type:"structure" required:"true"` - Type *string `locationName:"type" type:"string" enum:"InputType"` + // VideoDescriptions is a required field + VideoDescriptions []*VideoDescription `locationName:"videoDescriptions" type:"list" required:"true"` } // String returns the string representation -func (s DescribeInputOutput) String() string { +func (s EncoderSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeInputOutput) GoString() string { +func (s EncoderSettings) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *DescribeInputOutput) SetArn(v string) *DescribeInputOutput { - s.Arn = &v - return s -} - -// SetAttachedChannels sets the AttachedChannels field's value. -func (s *DescribeInputOutput) SetAttachedChannels(v []*string) *DescribeInputOutput { - s.AttachedChannels = v - return s -} - -// SetDestinations sets the Destinations field's value. -func (s *DescribeInputOutput) SetDestinations(v []*InputDestination) *DescribeInputOutput { - s.Destinations = v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *EncoderSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EncoderSettings"} + if s.AudioDescriptions == nil { + invalidParams.Add(request.NewErrParamRequired("AudioDescriptions")) + } + if s.OutputGroups == nil { + invalidParams.Add(request.NewErrParamRequired("OutputGroups")) + } + if s.TimecodeConfig == nil { + invalidParams.Add(request.NewErrParamRequired("TimecodeConfig")) + } + if s.VideoDescriptions == nil { + invalidParams.Add(request.NewErrParamRequired("VideoDescriptions")) + } + if s.AudioDescriptions != nil { + for i, v := range s.AudioDescriptions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AudioDescriptions", i), err.(request.ErrInvalidParams)) + } + } + } + if s.AvailBlanking != nil { + if err := s.AvailBlanking.Validate(); err != nil { + invalidParams.AddNested("AvailBlanking", err.(request.ErrInvalidParams)) + } + } + if s.AvailConfiguration != nil { + if err := s.AvailConfiguration.Validate(); err != nil { + invalidParams.AddNested("AvailConfiguration", err.(request.ErrInvalidParams)) + } + } + if s.BlackoutSlate != nil { + if err := s.BlackoutSlate.Validate(); err != nil { + invalidParams.AddNested("BlackoutSlate", err.(request.ErrInvalidParams)) + } + } + if s.CaptionDescriptions != nil { + for i, v := range s.CaptionDescriptions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CaptionDescriptions", i), err.(request.ErrInvalidParams)) + } + } + } + if s.GlobalConfiguration != nil { + if err := s.GlobalConfiguration.Validate(); err != nil { + invalidParams.AddNested("GlobalConfiguration", err.(request.ErrInvalidParams)) + } + } + if s.OutputGroups != nil { + for i, v := range s.OutputGroups { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OutputGroups", i), err.(request.ErrInvalidParams)) + } + } + } + if s.TimecodeConfig != nil { + if err := s.TimecodeConfig.Validate(); err != nil { + invalidParams.AddNested("TimecodeConfig", err.(request.ErrInvalidParams)) + } + } + if s.VideoDescriptions != nil { + for i, v := range s.VideoDescriptions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "VideoDescriptions", i), err.(request.ErrInvalidParams)) + } + } + } -// SetId sets the Id field's value. -func (s *DescribeInputOutput) SetId(v string) *DescribeInputOutput { - s.Id = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetInputClass sets the InputClass field's value. -func (s *DescribeInputOutput) SetInputClass(v string) *DescribeInputOutput { - s.InputClass = &v +// SetAudioDescriptions sets the AudioDescriptions field's value. +func (s *EncoderSettings) SetAudioDescriptions(v []*AudioDescription) *EncoderSettings { + s.AudioDescriptions = v return s } -// SetInputSourceType sets the InputSourceType field's value. -func (s *DescribeInputOutput) SetInputSourceType(v string) *DescribeInputOutput { - s.InputSourceType = &v +// SetAvailBlanking sets the AvailBlanking field's value. +func (s *EncoderSettings) SetAvailBlanking(v *AvailBlanking) *EncoderSettings { + s.AvailBlanking = v return s } -// SetMediaConnectFlows sets the MediaConnectFlows field's value. -func (s *DescribeInputOutput) SetMediaConnectFlows(v []*MediaConnectFlow) *DescribeInputOutput { - s.MediaConnectFlows = v +// SetAvailConfiguration sets the AvailConfiguration field's value. +func (s *EncoderSettings) SetAvailConfiguration(v *AvailConfiguration) *EncoderSettings { + s.AvailConfiguration = v return s } -// SetName sets the Name field's value. -func (s *DescribeInputOutput) SetName(v string) *DescribeInputOutput { - s.Name = &v +// SetBlackoutSlate sets the BlackoutSlate field's value. +func (s *EncoderSettings) SetBlackoutSlate(v *BlackoutSlate) *EncoderSettings { + s.BlackoutSlate = v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *DescribeInputOutput) SetRoleArn(v string) *DescribeInputOutput { - s.RoleArn = &v +// SetCaptionDescriptions sets the CaptionDescriptions field's value. +func (s *EncoderSettings) SetCaptionDescriptions(v []*CaptionDescription) *EncoderSettings { + s.CaptionDescriptions = v return s } -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *DescribeInputOutput) SetSecurityGroups(v []*string) *DescribeInputOutput { - s.SecurityGroups = v +// SetGlobalConfiguration sets the GlobalConfiguration field's value. +func (s *EncoderSettings) SetGlobalConfiguration(v *GlobalConfiguration) *EncoderSettings { + s.GlobalConfiguration = v return s } -// SetSources sets the Sources field's value. -func (s *DescribeInputOutput) SetSources(v []*InputSource) *DescribeInputOutput { - s.Sources = v +// SetNielsenConfiguration sets the NielsenConfiguration field's value. +func (s *EncoderSettings) SetNielsenConfiguration(v *NielsenConfiguration) *EncoderSettings { + s.NielsenConfiguration = v return s } -// SetState sets the State field's value. -func (s *DescribeInputOutput) SetState(v string) *DescribeInputOutput { - s.State = &v +// SetOutputGroups sets the OutputGroups field's value. +func (s *EncoderSettings) SetOutputGroups(v []*OutputGroup) *EncoderSettings { + s.OutputGroups = v return s } -// SetTags sets the Tags field's value. -func (s *DescribeInputOutput) SetTags(v map[string]*string) *DescribeInputOutput { - s.Tags = v +// SetTimecodeConfig sets the TimecodeConfig field's value. +func (s *EncoderSettings) SetTimecodeConfig(v *TimecodeConfig) *EncoderSettings { + s.TimecodeConfig = v return s } -// SetType sets the Type field's value. -func (s *DescribeInputOutput) SetType(v string) *DescribeInputOutput { - s.Type = &v +// SetVideoDescriptions sets the VideoDescriptions field's value. +func (s *EncoderSettings) SetVideoDescriptions(v []*VideoDescription) *EncoderSettings { + s.VideoDescriptions = v return s } -type DescribeInputSecurityGroupInput struct { +// Fec Output Settings +type FecOutputSettings struct { _ struct{} `type:"structure"` - // InputSecurityGroupId is a required field - InputSecurityGroupId *string `location:"uri" locationName:"inputSecurityGroupId" type:"string" required:"true"` + // Parameter D from SMPTE 2022-1. The height of the FEC protection matrix. The + // number of transport stream packets per column error correction packet. Must + // be between 4 and 20, inclusive. + ColumnDepth *int64 `locationName:"columnDepth" min:"4" type:"integer"` + + // Enables column only or column and row based FEC + IncludeFec *string `locationName:"includeFec" type:"string" enum:"FecOutputIncludeFec"` + + // Parameter L from SMPTE 2022-1. The width of the FEC protection matrix. Must + // be between 1 and 20, inclusive. If only Column FEC is used, then larger values + // increase robustness. If Row FEC is used, then this is the number of transport + // stream packets per row error correction packet, and the value must be between + // 4 and 20, inclusive, if includeFec is columnAndRow. If includeFec is column, + // this value must be 1 to 20, inclusive. + RowLength *int64 `locationName:"rowLength" min:"1" type:"integer"` } // String returns the string representation -func (s DescribeInputSecurityGroupInput) String() string { +func (s FecOutputSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeInputSecurityGroupInput) GoString() string { +func (s FecOutputSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeInputSecurityGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeInputSecurityGroupInput"} - if s.InputSecurityGroupId == nil { - invalidParams.Add(request.NewErrParamRequired("InputSecurityGroupId")) +func (s *FecOutputSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "FecOutputSettings"} + if s.ColumnDepth != nil && *s.ColumnDepth < 4 { + invalidParams.Add(request.NewErrParamMinValue("ColumnDepth", 4)) } - if s.InputSecurityGroupId != nil && len(*s.InputSecurityGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InputSecurityGroupId", 1)) + if s.RowLength != nil && *s.RowLength < 1 { + invalidParams.Add(request.NewErrParamMinValue("RowLength", 1)) } if invalidParams.Len() > 0 { @@ -7035,99 +10636,126 @@ func (s *DescribeInputSecurityGroupInput) Validate() error { return nil } -// SetInputSecurityGroupId sets the InputSecurityGroupId field's value. -func (s *DescribeInputSecurityGroupInput) SetInputSecurityGroupId(v string) *DescribeInputSecurityGroupInput { - s.InputSecurityGroupId = &v +// SetColumnDepth sets the ColumnDepth field's value. +func (s *FecOutputSettings) SetColumnDepth(v int64) *FecOutputSettings { + s.ColumnDepth = &v return s } -type DescribeInputSecurityGroupOutput struct { - _ struct{} `type:"structure"` - - Arn *string `locationName:"arn" type:"string"` - - Id *string `locationName:"id" type:"string"` - - Inputs []*string `locationName:"inputs" type:"list"` +// SetIncludeFec sets the IncludeFec field's value. +func (s *FecOutputSettings) SetIncludeFec(v string) *FecOutputSettings { + s.IncludeFec = &v + return s +} - State *string `locationName:"state" type:"string" enum:"InputSecurityGroupState"` +// SetRowLength sets the RowLength field's value. +func (s *FecOutputSettings) SetRowLength(v int64) *FecOutputSettings { + s.RowLength = &v + return s +} - Tags map[string]*string `locationName:"tags" type:"map"` +// Start time for the action. +type FixedModeScheduleActionStartSettings struct { + _ struct{} `type:"structure"` - WhitelistRules []*InputWhitelistRule `locationName:"whitelistRules" type:"list"` + // Start time for the action to start in the channel. (Not the time for the + // action to be added to the schedule: actions are always added to the schedule + // immediately.) UTC format: yyyy-mm-ddThh:mm:ss.nnnZ. All the letters are digits + // (for example, mm might be 01) except for the two constants "T" for time and + // "Z" for "UTC format". + // + // Time is a required field + Time *string `locationName:"time" type:"string" required:"true"` } // String returns the string representation -func (s DescribeInputSecurityGroupOutput) String() string { +func (s FixedModeScheduleActionStartSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeInputSecurityGroupOutput) GoString() string { +func (s FixedModeScheduleActionStartSettings) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *DescribeInputSecurityGroupOutput) SetArn(v string) *DescribeInputSecurityGroupOutput { - s.Arn = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *FixedModeScheduleActionStartSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "FixedModeScheduleActionStartSettings"} + if s.Time == nil { + invalidParams.Add(request.NewErrParamRequired("Time")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetId sets the Id field's value. -func (s *DescribeInputSecurityGroupOutput) SetId(v string) *DescribeInputSecurityGroupOutput { - s.Id = &v +// SetTime sets the Time field's value. +func (s *FixedModeScheduleActionStartSettings) SetTime(v string) *FixedModeScheduleActionStartSettings { + s.Time = &v return s } -// SetInputs sets the Inputs field's value. -func (s *DescribeInputSecurityGroupOutput) SetInputs(v []*string) *DescribeInputSecurityGroupOutput { - s.Inputs = v - return s +// Fmp4 Hls Settings +type Fmp4HlsSettings struct { + _ struct{} `type:"structure"` + + // List all the audio groups that are used with the video output stream. Input + // all the audio GROUP-IDs that are associated to the video, separate by ','. + AudioRenditionSets *string `locationName:"audioRenditionSets" type:"string"` } -// SetState sets the State field's value. -func (s *DescribeInputSecurityGroupOutput) SetState(v string) *DescribeInputSecurityGroupOutput { - s.State = &v - return s +// String returns the string representation +func (s Fmp4HlsSettings) String() string { + return awsutil.Prettify(s) } -// SetTags sets the Tags field's value. -func (s *DescribeInputSecurityGroupOutput) SetTags(v map[string]*string) *DescribeInputSecurityGroupOutput { - s.Tags = v - return s +// GoString returns the string representation +func (s Fmp4HlsSettings) GoString() string { + return s.String() } -// SetWhitelistRules sets the WhitelistRules field's value. -func (s *DescribeInputSecurityGroupOutput) SetWhitelistRules(v []*InputWhitelistRule) *DescribeInputSecurityGroupOutput { - s.WhitelistRules = v +// SetAudioRenditionSets sets the AudioRenditionSets field's value. +func (s *Fmp4HlsSettings) SetAudioRenditionSets(v string) *Fmp4HlsSettings { + s.AudioRenditionSets = &v return s } -type DescribeOfferingInput struct { +// Settings to specify if an action follows another. +type FollowModeScheduleActionStartSettings struct { _ struct{} `type:"structure"` - // OfferingId is a required field - OfferingId *string `location:"uri" locationName:"offeringId" type:"string" required:"true"` + // Identifies whether this action starts relative to the start or relative to + // the end of the reference action. + // + // FollowPoint is a required field + FollowPoint *string `locationName:"followPoint" type:"string" required:"true" enum:"FollowPoint"` + + // The action name of another action that this one refers to. + // + // ReferenceActionName is a required field + ReferenceActionName *string `locationName:"referenceActionName" type:"string" required:"true"` } // String returns the string representation -func (s DescribeOfferingInput) String() string { +func (s FollowModeScheduleActionStartSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeOfferingInput) GoString() string { +func (s FollowModeScheduleActionStartSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeOfferingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeOfferingInput"} - if s.OfferingId == nil { - invalidParams.Add(request.NewErrParamRequired("OfferingId")) +func (s *FollowModeScheduleActionStartSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "FollowModeScheduleActionStartSettings"} + if s.FollowPoint == nil { + invalidParams.Add(request.NewErrParamRequired("FollowPoint")) } - if s.OfferingId != nil && len(*s.OfferingId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("OfferingId", 1)) + if s.ReferenceActionName == nil { + invalidParams.Add(request.NewErrParamRequired("ReferenceActionName")) } if invalidParams.Len() > 0 { @@ -7136,142 +10764,104 @@ func (s *DescribeOfferingInput) Validate() error { return nil } -// SetOfferingId sets the OfferingId field's value. -func (s *DescribeOfferingInput) SetOfferingId(v string) *DescribeOfferingInput { - s.OfferingId = &v +// SetFollowPoint sets the FollowPoint field's value. +func (s *FollowModeScheduleActionStartSettings) SetFollowPoint(v string) *FollowModeScheduleActionStartSettings { + s.FollowPoint = &v return s } -type DescribeOfferingOutput struct { - _ struct{} `type:"structure"` - - Arn *string `locationName:"arn" type:"string"` - - CurrencyCode *string `locationName:"currencyCode" type:"string"` - - Duration *int64 `locationName:"duration" type:"integer"` - - // Units for duration, e.g. 'MONTHS' - DurationUnits *string `locationName:"durationUnits" type:"string" enum:"OfferingDurationUnits"` - - FixedPrice *float64 `locationName:"fixedPrice" type:"double"` - - OfferingDescription *string `locationName:"offeringDescription" type:"string"` - - OfferingId *string `locationName:"offeringId" type:"string"` - - // Offering type, e.g. 'NO_UPFRONT' - OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingType"` - - Region *string `locationName:"region" type:"string"` +// SetReferenceActionName sets the ReferenceActionName field's value. +func (s *FollowModeScheduleActionStartSettings) SetReferenceActionName(v string) *FollowModeScheduleActionStartSettings { + s.ReferenceActionName = &v + return s +} - // Resource configuration (codec, resolution, bitrate, ...) - ResourceSpecification *ReservationResourceSpecification `locationName:"resourceSpecification" type:"structure"` +type ForbiddenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - UsagePrice *float64 `locationName:"usagePrice" type:"double"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DescribeOfferingOutput) String() string { +func (s ForbiddenException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeOfferingOutput) GoString() string { +func (s ForbiddenException) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *DescribeOfferingOutput) SetArn(v string) *DescribeOfferingOutput { - s.Arn = &v - return s -} - -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *DescribeOfferingOutput) SetCurrencyCode(v string) *DescribeOfferingOutput { - s.CurrencyCode = &v - return s -} - -// SetDuration sets the Duration field's value. -func (s *DescribeOfferingOutput) SetDuration(v int64) *DescribeOfferingOutput { - s.Duration = &v - return s -} - -// SetDurationUnits sets the DurationUnits field's value. -func (s *DescribeOfferingOutput) SetDurationUnits(v string) *DescribeOfferingOutput { - s.DurationUnits = &v - return s -} - -// SetFixedPrice sets the FixedPrice field's value. -func (s *DescribeOfferingOutput) SetFixedPrice(v float64) *DescribeOfferingOutput { - s.FixedPrice = &v - return s +func newErrorForbiddenException(v protocol.ResponseMetadata) error { + return &ForbiddenException{ + respMetadata: v, + } } -// SetOfferingDescription sets the OfferingDescription field's value. -func (s *DescribeOfferingOutput) SetOfferingDescription(v string) *DescribeOfferingOutput { - s.OfferingDescription = &v - return s +// Code returns the exception type name. +func (s ForbiddenException) Code() string { + return "ForbiddenException" } -// SetOfferingId sets the OfferingId field's value. -func (s *DescribeOfferingOutput) SetOfferingId(v string) *DescribeOfferingOutput { - s.OfferingId = &v - return s +// Message returns the exception's message. +func (s ForbiddenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetOfferingType sets the OfferingType field's value. -func (s *DescribeOfferingOutput) SetOfferingType(v string) *DescribeOfferingOutput { - s.OfferingType = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ForbiddenException) OrigErr() error { + return nil } -// SetRegion sets the Region field's value. -func (s *DescribeOfferingOutput) SetRegion(v string) *DescribeOfferingOutput { - s.Region = &v - return s +func (s ForbiddenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetResourceSpecification sets the ResourceSpecification field's value. -func (s *DescribeOfferingOutput) SetResourceSpecification(v *ReservationResourceSpecification) *DescribeOfferingOutput { - s.ResourceSpecification = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ForbiddenException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetUsagePrice sets the UsagePrice field's value. -func (s *DescribeOfferingOutput) SetUsagePrice(v float64) *DescribeOfferingOutput { - s.UsagePrice = &v - return s +// RequestID returns the service's response RequestID for request. +func (s ForbiddenException) RequestID() string { + return s.respMetadata.RequestID } -type DescribeReservationInput struct { +// Frame Capture Group Settings +type FrameCaptureGroupSettings struct { _ struct{} `type:"structure"` - // ReservationId is a required field - ReservationId *string `location:"uri" locationName:"reservationId" type:"string" required:"true"` + // The destination for the frame capture files. Either the URI for an Amazon + // S3 bucket and object, plus a file name prefix (for example, s3ssl://sportsDelivery/highlights/20180820/curling_) + // or the URI for a MediaStore container, plus a file name prefix (for example, + // mediastoressl://sportsDelivery/20180820/curling_). The final file names consist + // of the prefix from the destination field (for example, "curling_") + name + // modifier + the counter (5 digits, starting from 00001) + extension (which + // is always .jpg). For example, curlingLow.00001.jpg + // + // Destination is a required field + Destination *OutputLocationRef `locationName:"destination" type:"structure" required:"true"` } // String returns the string representation -func (s DescribeReservationInput) String() string { +func (s FrameCaptureGroupSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeReservationInput) GoString() string { +func (s FrameCaptureGroupSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeReservationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeReservationInput"} - if s.ReservationId == nil { - invalidParams.Add(request.NewErrParamRequired("ReservationId")) - } - if s.ReservationId != nil && len(*s.ReservationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ReservationId", 1)) +func (s *FrameCaptureGroupSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "FrameCaptureGroupSettings"} + if s.Destination == nil { + invalidParams.Add(request.NewErrParamRequired("Destination")) } if invalidParams.Len() > 0 { @@ -7280,378 +10870,500 @@ func (s *DescribeReservationInput) Validate() error { return nil } -// SetReservationId sets the ReservationId field's value. -func (s *DescribeReservationInput) SetReservationId(v string) *DescribeReservationInput { - s.ReservationId = &v +// SetDestination sets the Destination field's value. +func (s *FrameCaptureGroupSettings) SetDestination(v *OutputLocationRef) *FrameCaptureGroupSettings { + s.Destination = v return s } -type DescribeReservationOutput struct { +// Frame Capture Output Settings +type FrameCaptureOutputSettings struct { _ struct{} `type:"structure"` - Arn *string `locationName:"arn" type:"string"` - - Count *int64 `locationName:"count" type:"integer"` - - CurrencyCode *string `locationName:"currencyCode" type:"string"` - - Duration *int64 `locationName:"duration" type:"integer"` - - // Units for duration, e.g. 'MONTHS' - DurationUnits *string `locationName:"durationUnits" type:"string" enum:"OfferingDurationUnits"` - - End *string `locationName:"end" type:"string"` - - FixedPrice *float64 `locationName:"fixedPrice" type:"double"` - - Name *string `locationName:"name" type:"string"` - - OfferingDescription *string `locationName:"offeringDescription" type:"string"` - - OfferingId *string `locationName:"offeringId" type:"string"` - - // Offering type, e.g. 'NO_UPFRONT' - OfferingType *string `locationName:"offeringType" type:"string" enum:"OfferingType"` - - Region *string `locationName:"region" type:"string"` - - ReservationId *string `locationName:"reservationId" type:"string"` - - // Resource configuration (codec, resolution, bitrate, ...) - ResourceSpecification *ReservationResourceSpecification `locationName:"resourceSpecification" type:"structure"` - - Start *string `locationName:"start" type:"string"` - - // Current reservation state - State *string `locationName:"state" type:"string" enum:"ReservationState"` - - Tags map[string]*string `locationName:"tags" type:"map"` - - UsagePrice *float64 `locationName:"usagePrice" type:"double"` + // Required if the output group contains more than one output. This modifier + // forms part of the output file name. + NameModifier *string `locationName:"nameModifier" type:"string"` } // String returns the string representation -func (s DescribeReservationOutput) String() string { +func (s FrameCaptureOutputSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeReservationOutput) GoString() string { +func (s FrameCaptureOutputSettings) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *DescribeReservationOutput) SetArn(v string) *DescribeReservationOutput { - s.Arn = &v +// SetNameModifier sets the NameModifier field's value. +func (s *FrameCaptureOutputSettings) SetNameModifier(v string) *FrameCaptureOutputSettings { + s.NameModifier = &v return s } -// SetCount sets the Count field's value. -func (s *DescribeReservationOutput) SetCount(v int64) *DescribeReservationOutput { - s.Count = &v - return s -} +// Frame Capture Settings +type FrameCaptureSettings struct { + _ struct{} `type:"structure"` -// SetCurrencyCode sets the CurrencyCode field's value. -func (s *DescribeReservationOutput) SetCurrencyCode(v string) *DescribeReservationOutput { - s.CurrencyCode = &v - return s + // The frequency at which to capture frames for inclusion in the output. May + // be specified in either seconds or milliseconds, as specified by captureIntervalUnits. + // + // CaptureInterval is a required field + CaptureInterval *int64 `locationName:"captureInterval" min:"1" type:"integer" required:"true"` + + // Unit for the frame capture interval. + CaptureIntervalUnits *string `locationName:"captureIntervalUnits" type:"string" enum:"FrameCaptureIntervalUnit"` } -// SetDuration sets the Duration field's value. -func (s *DescribeReservationOutput) SetDuration(v int64) *DescribeReservationOutput { - s.Duration = &v - return s +// String returns the string representation +func (s FrameCaptureSettings) String() string { + return awsutil.Prettify(s) } -// SetDurationUnits sets the DurationUnits field's value. -func (s *DescribeReservationOutput) SetDurationUnits(v string) *DescribeReservationOutput { - s.DurationUnits = &v - return s +// GoString returns the string representation +func (s FrameCaptureSettings) GoString() string { + return s.String() } -// SetEnd sets the End field's value. -func (s *DescribeReservationOutput) SetEnd(v string) *DescribeReservationOutput { - s.End = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *FrameCaptureSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "FrameCaptureSettings"} + if s.CaptureInterval == nil { + invalidParams.Add(request.NewErrParamRequired("CaptureInterval")) + } + if s.CaptureInterval != nil && *s.CaptureInterval < 1 { + invalidParams.Add(request.NewErrParamMinValue("CaptureInterval", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetFixedPrice sets the FixedPrice field's value. -func (s *DescribeReservationOutput) SetFixedPrice(v float64) *DescribeReservationOutput { - s.FixedPrice = &v +// SetCaptureInterval sets the CaptureInterval field's value. +func (s *FrameCaptureSettings) SetCaptureInterval(v int64) *FrameCaptureSettings { + s.CaptureInterval = &v return s } -// SetName sets the Name field's value. -func (s *DescribeReservationOutput) SetName(v string) *DescribeReservationOutput { - s.Name = &v +// SetCaptureIntervalUnits sets the CaptureIntervalUnits field's value. +func (s *FrameCaptureSettings) SetCaptureIntervalUnits(v string) *FrameCaptureSettings { + s.CaptureIntervalUnits = &v return s } -// SetOfferingDescription sets the OfferingDescription field's value. -func (s *DescribeReservationOutput) SetOfferingDescription(v string) *DescribeReservationOutput { - s.OfferingDescription = &v - return s +type GatewayTimeoutException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetOfferingId sets the OfferingId field's value. -func (s *DescribeReservationOutput) SetOfferingId(v string) *DescribeReservationOutput { - s.OfferingId = &v - return s +// String returns the string representation +func (s GatewayTimeoutException) String() string { + return awsutil.Prettify(s) } -// SetOfferingType sets the OfferingType field's value. -func (s *DescribeReservationOutput) SetOfferingType(v string) *DescribeReservationOutput { - s.OfferingType = &v - return s +// GoString returns the string representation +func (s GatewayTimeoutException) GoString() string { + return s.String() } -// SetRegion sets the Region field's value. -func (s *DescribeReservationOutput) SetRegion(v string) *DescribeReservationOutput { - s.Region = &v - return s +func newErrorGatewayTimeoutException(v protocol.ResponseMetadata) error { + return &GatewayTimeoutException{ + respMetadata: v, + } } -// SetReservationId sets the ReservationId field's value. -func (s *DescribeReservationOutput) SetReservationId(v string) *DescribeReservationOutput { - s.ReservationId = &v - return s +// Code returns the exception type name. +func (s GatewayTimeoutException) Code() string { + return "GatewayTimeoutException" } -// SetResourceSpecification sets the ResourceSpecification field's value. -func (s *DescribeReservationOutput) SetResourceSpecification(v *ReservationResourceSpecification) *DescribeReservationOutput { - s.ResourceSpecification = v - return s +// Message returns the exception's message. +func (s GatewayTimeoutException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetStart sets the Start field's value. -func (s *DescribeReservationOutput) SetStart(v string) *DescribeReservationOutput { - s.Start = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s GatewayTimeoutException) OrigErr() error { + return nil } -// SetState sets the State field's value. -func (s *DescribeReservationOutput) SetState(v string) *DescribeReservationOutput { - s.State = &v - return s +func (s GatewayTimeoutException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetTags sets the Tags field's value. -func (s *DescribeReservationOutput) SetTags(v map[string]*string) *DescribeReservationOutput { - s.Tags = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s GatewayTimeoutException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetUsagePrice sets the UsagePrice field's value. -func (s *DescribeReservationOutput) SetUsagePrice(v float64) *DescribeReservationOutput { - s.UsagePrice = &v - return s +// RequestID returns the service's response RequestID for request. +func (s GatewayTimeoutException) RequestID() string { + return s.respMetadata.RequestID } -type DescribeScheduleInput struct { +// Global Configuration +type GlobalConfiguration struct { _ struct{} `type:"structure"` - // ChannelId is a required field - ChannelId *string `location:"uri" locationName:"channelId" type:"string" required:"true"` + // Value to set the initial audio gain for the Live Event. + InitialAudioGain *int64 `locationName:"initialAudioGain" type:"integer"` - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + // Indicates the action to take when the current input completes (e.g. end-of-file). + // When switchAndLoopInputs is configured the encoder will restart at the beginning + // of the first input. When "none" is configured the encoder will transcode + // either black, a solid color, or a user specified slate images per the "Input + // Loss Behavior" configuration until the next input switch occurs (which is + // controlled through the Channel Schedule API). + InputEndAction *string `locationName:"inputEndAction" type:"string" enum:"GlobalConfigurationInputEndAction"` - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + // Settings for system actions when input is lost. + InputLossBehavior *InputLossBehavior `locationName:"inputLossBehavior" type:"structure"` + + // Indicates how MediaLive pipelines are synchronized.PIPELINELOCKING - MediaLive + // will attempt to synchronize the output of each pipeline to the other.EPOCHLOCKING + // - MediaLive will attempt to synchronize the output of each pipeline to the + // Unix epoch. + OutputLockingMode *string `locationName:"outputLockingMode" type:"string" enum:"GlobalConfigurationOutputLockingMode"` + + // Indicates whether the rate of frames emitted by the Live encoder should be + // paced by its system clock (which optionally may be locked to another source + // via NTP) or should be locked to the clock of the source that is providing + // the input stream. + OutputTimingSource *string `locationName:"outputTimingSource" type:"string" enum:"GlobalConfigurationOutputTimingSource"` + + // Adjusts video input buffer for streams with very low video framerates. This + // is commonly set to enabled for music channels with less than one video frame + // per second. + SupportLowFramerateInputs *string `locationName:"supportLowFramerateInputs" type:"string" enum:"GlobalConfigurationLowFramerateInputs"` } // String returns the string representation -func (s DescribeScheduleInput) String() string { +func (s GlobalConfiguration) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeScheduleInput) GoString() string { +func (s GlobalConfiguration) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeScheduleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeScheduleInput"} - if s.ChannelId == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelId")) +func (s *GlobalConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GlobalConfiguration"} + if s.InitialAudioGain != nil && *s.InitialAudioGain < -60 { + invalidParams.Add(request.NewErrParamMinValue("InitialAudioGain", -60)) } - if s.ChannelId != nil && len(*s.ChannelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelId", 1)) + if s.InputLossBehavior != nil { + if err := s.InputLossBehavior.Validate(); err != nil { + invalidParams.AddNested("InputLossBehavior", err.(request.ErrInvalidParams)) + } } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + + if invalidParams.Len() > 0 { + return invalidParams } + return nil +} + +// SetInitialAudioGain sets the InitialAudioGain field's value. +func (s *GlobalConfiguration) SetInitialAudioGain(v int64) *GlobalConfiguration { + s.InitialAudioGain = &v + return s +} + +// SetInputEndAction sets the InputEndAction field's value. +func (s *GlobalConfiguration) SetInputEndAction(v string) *GlobalConfiguration { + s.InputEndAction = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetInputLossBehavior sets the InputLossBehavior field's value. +func (s *GlobalConfiguration) SetInputLossBehavior(v *InputLossBehavior) *GlobalConfiguration { + s.InputLossBehavior = v + return s } -// SetChannelId sets the ChannelId field's value. -func (s *DescribeScheduleInput) SetChannelId(v string) *DescribeScheduleInput { - s.ChannelId = &v +// SetOutputLockingMode sets the OutputLockingMode field's value. +func (s *GlobalConfiguration) SetOutputLockingMode(v string) *GlobalConfiguration { + s.OutputLockingMode = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeScheduleInput) SetMaxResults(v int64) *DescribeScheduleInput { - s.MaxResults = &v +// SetOutputTimingSource sets the OutputTimingSource field's value. +func (s *GlobalConfiguration) SetOutputTimingSource(v string) *GlobalConfiguration { + s.OutputTimingSource = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeScheduleInput) SetNextToken(v string) *DescribeScheduleInput { - s.NextToken = &v +// SetSupportLowFramerateInputs sets the SupportLowFramerateInputs field's value. +func (s *GlobalConfiguration) SetSupportLowFramerateInputs(v string) *GlobalConfiguration { + s.SupportLowFramerateInputs = &v return s } -type DescribeScheduleOutput struct { +// H264 Color Space Settings +type H264ColorSpaceSettings struct { _ struct{} `type:"structure"` - NextToken *string `locationName:"nextToken" type:"string"` + // Passthrough applies no color space conversion to the output + ColorSpacePassthroughSettings *ColorSpacePassthroughSettings `locationName:"colorSpacePassthroughSettings" type:"structure"` - ScheduleActions []*ScheduleAction `locationName:"scheduleActions" type:"list"` + // Rec601 Settings + Rec601Settings *Rec601Settings `locationName:"rec601Settings" type:"structure"` + + // Rec709 Settings + Rec709Settings *Rec709Settings `locationName:"rec709Settings" type:"structure"` } // String returns the string representation -func (s DescribeScheduleOutput) String() string { +func (s H264ColorSpaceSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeScheduleOutput) GoString() string { +func (s H264ColorSpaceSettings) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribeScheduleOutput) SetNextToken(v string) *DescribeScheduleOutput { - s.NextToken = &v +// SetColorSpacePassthroughSettings sets the ColorSpacePassthroughSettings field's value. +func (s *H264ColorSpaceSettings) SetColorSpacePassthroughSettings(v *ColorSpacePassthroughSettings) *H264ColorSpaceSettings { + s.ColorSpacePassthroughSettings = v return s } -// SetScheduleActions sets the ScheduleActions field's value. -func (s *DescribeScheduleOutput) SetScheduleActions(v []*ScheduleAction) *DescribeScheduleOutput { - s.ScheduleActions = v +// SetRec601Settings sets the Rec601Settings field's value. +func (s *H264ColorSpaceSettings) SetRec601Settings(v *Rec601Settings) *H264ColorSpaceSettings { + s.Rec601Settings = v return s } -// DVB Network Information Table (NIT) -type DvbNitSettings struct { +// SetRec709Settings sets the Rec709Settings field's value. +func (s *H264ColorSpaceSettings) SetRec709Settings(v *Rec709Settings) *H264ColorSpaceSettings { + s.Rec709Settings = v + return s +} + +// H264 Settings +type H264Settings struct { _ struct{} `type:"structure"` - // The numeric value placed in the Network Information Table (NIT). - // - // NetworkId is a required field - NetworkId *int64 `locationName:"networkId" type:"integer" required:"true"` + // Adaptive quantization. Allows intra-frame quantizers to vary to improve visual + // quality. + AdaptiveQuantization *string `locationName:"adaptiveQuantization" type:"string" enum:"H264AdaptiveQuantization"` - // The network name text placed in the networkNameDescriptor inside the Network - // Information Table. Maximum length is 256 characters. - // - // NetworkName is a required field - NetworkName *string `locationName:"networkName" min:"1" type:"string" required:"true"` + // Indicates that AFD values will be written into the output stream. If afdSignaling + // is "auto", the system will try to preserve the input AFD value (in cases + // where multiple AFD values are valid). If set to "fixed", the AFD value will + // be the value configured in the fixedAfd parameter. + AfdSignaling *string `locationName:"afdSignaling" type:"string" enum:"AfdSignaling"` - // The number of milliseconds between instances of this table in the output - // transport stream. - RepInterval *int64 `locationName:"repInterval" min:"25" type:"integer"` -} + // Average bitrate in bits/second. Required when the rate control mode is VBR + // or CBR. Not used for QVBR. In an MS Smooth output group, each output must + // have a unique value when its bitrate is rounded down to the nearest multiple + // of 1000. + Bitrate *int64 `locationName:"bitrate" min:"1000" type:"integer"` -// String returns the string representation -func (s DvbNitSettings) String() string { - return awsutil.Prettify(s) -} + // Percentage of the buffer that should initially be filled (HRD buffer model). + BufFillPct *int64 `locationName:"bufFillPct" type:"integer"` -// GoString returns the string representation -func (s DvbNitSettings) GoString() string { - return s.String() -} + // Size of buffer (HRD buffer model) in bits. + BufSize *int64 `locationName:"bufSize" type:"integer"` -// Validate inspects the fields of the type to determine if they are valid. -func (s *DvbNitSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DvbNitSettings"} - if s.NetworkId == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkId")) - } - if s.NetworkName == nil { - invalidParams.Add(request.NewErrParamRequired("NetworkName")) - } - if s.NetworkName != nil && len(*s.NetworkName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NetworkName", 1)) - } - if s.RepInterval != nil && *s.RepInterval < 25 { - invalidParams.Add(request.NewErrParamMinValue("RepInterval", 25)) - } + // Includes colorspace metadata in the output. + ColorMetadata *string `locationName:"colorMetadata" type:"string" enum:"H264ColorMetadata"` - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} + // Color Space settings + ColorSpaceSettings *H264ColorSpaceSettings `locationName:"colorSpaceSettings" type:"structure"` -// SetNetworkId sets the NetworkId field's value. -func (s *DvbNitSettings) SetNetworkId(v int64) *DvbNitSettings { - s.NetworkId = &v - return s -} + // Entropy encoding mode. Use cabac (must be in Main or High profile) or cavlc. + EntropyEncoding *string `locationName:"entropyEncoding" type:"string" enum:"H264EntropyEncoding"` -// SetNetworkName sets the NetworkName field's value. -func (s *DvbNitSettings) SetNetworkName(v string) *DvbNitSettings { - s.NetworkName = &v - return s -} + // Four bit AFD value to write on all frames of video in the output stream. + // Only valid when afdSignaling is set to 'Fixed'. + FixedAfd *string `locationName:"fixedAfd" type:"string" enum:"FixedAfd"` -// SetRepInterval sets the RepInterval field's value. -func (s *DvbNitSettings) SetRepInterval(v int64) *DvbNitSettings { - s.RepInterval = &v - return s -} + // If set to enabled, adjust quantization within each frame to reduce flicker + // or 'pop' on I-frames. + FlickerAq *string `locationName:"flickerAq" type:"string" enum:"H264FlickerAq"` -// DVB Service Description Table (SDT) -type DvbSdtSettings struct { - _ struct{} `type:"structure"` + // This field indicates how the output video frame rate is specified. If "specified" + // is selected then the output video frame rate is determined by framerateNumerator + // and framerateDenominator, else if "initializeFromSource" is selected then + // the output video frame rate will be set equal to the input video frame rate + // of the first input. + FramerateControl *string `locationName:"framerateControl" type:"string" enum:"H264FramerateControl"` + + // Framerate denominator. + FramerateDenominator *int64 `locationName:"framerateDenominator" min:"1" type:"integer"` + + // Framerate numerator - framerate is a fraction, e.g. 24000 / 1001 = 23.976 + // fps. + FramerateNumerator *int64 `locationName:"framerateNumerator" min:"1" type:"integer"` + + // If enabled, use reference B frames for GOP structures that have B frames + // > 1. + GopBReference *string `locationName:"gopBReference" type:"string" enum:"H264GopBReference"` + + // Frequency of closed GOPs. In streaming applications, it is recommended that + // this be set to 1 so a decoder joining mid-stream will receive an IDR frame + // as quickly as possible. Setting this value to 0 will break output segmenting. + GopClosedCadence *int64 `locationName:"gopClosedCadence" type:"integer"` + + // Number of B-frames between reference frames. + GopNumBFrames *int64 `locationName:"gopNumBFrames" type:"integer"` + + // GOP size (keyframe interval) in units of either frames or seconds per gopSizeUnits.If + // gopSizeUnits is frames, gopSize must be an integer and must be greater than + // or equal to 1.If gopSizeUnits is seconds, gopSize must be greater than 0, + // but need not be an integer. + GopSize *float64 `locationName:"gopSize" type:"double"` + + // Indicates if the gopSize is specified in frames or seconds. If seconds the + // system will convert the gopSize into a frame count at run time. + GopSizeUnits *string `locationName:"gopSizeUnits" type:"string" enum:"H264GopSizeUnits"` + + // H.264 Level. + Level *string `locationName:"level" type:"string" enum:"H264Level"` + + // Amount of lookahead. A value of low can decrease latency and memory usage, + // while high can produce better quality for certain content. + LookAheadRateControl *string `locationName:"lookAheadRateControl" type:"string" enum:"H264LookAheadRateControl"` + + // For QVBR: See the tooltip for Quality levelFor VBR: Set the maximum bitrate + // in order to accommodate expected spikes in the complexity of the video. + MaxBitrate *int64 `locationName:"maxBitrate" min:"1000" type:"integer"` + + // Only meaningful if sceneChangeDetect is set to enabled. Defaults to 5 if + // multiplex rate control is used. Enforces separation between repeated (cadence) + // I-frames and I-frames inserted by Scene Change Detection. If a scene change + // I-frame is within I-interval frames of a cadence I-frame, the GOP is shrunk + // and/or stretched to the scene change I-frame. GOP stretch requires enabling + // lookahead as well as setting I-interval. The normal cadence resumes for the + // next GOP. Note: Maximum GOP stretch = GOP size + Min-I-interval - 1 + MinIInterval *int64 `locationName:"minIInterval" type:"integer"` + + // Number of reference frames to use. The encoder may use more than requested + // if using B-frames and/or interlaced encoding. + NumRefFrames *int64 `locationName:"numRefFrames" min:"1" type:"integer"` + + // This field indicates how the output pixel aspect ratio is specified. If "specified" + // is selected then the output video pixel aspect ratio is determined by parNumerator + // and parDenominator, else if "initializeFromSource" is selected then the output + // pixsel aspect ratio will be set equal to the input video pixel aspect ratio + // of the first input. + ParControl *string `locationName:"parControl" type:"string" enum:"H264ParControl"` + + // Pixel Aspect Ratio denominator. + ParDenominator *int64 `locationName:"parDenominator" min:"1" type:"integer"` + + // Pixel Aspect Ratio numerator. + ParNumerator *int64 `locationName:"parNumerator" type:"integer"` + + // H.264 Profile. + Profile *string `locationName:"profile" type:"string" enum:"H264Profile"` + + // Controls the target quality for the video encode. Applies only when the rate + // control mode is QVBR. Set values for the QVBR quality level field and Max + // bitrate field that suit your most important viewing devices. Recommended + // values are:- Primary screen: Quality level: 8 to 10. Max bitrate: 4M- PC + // or tablet: Quality level: 7. Max bitrate: 1.5M to 3M- Smartphone: Quality + // level: 6. Max bitrate: 1M to 1.5M + QvbrQualityLevel *int64 `locationName:"qvbrQualityLevel" min:"1" type:"integer"` + + // Rate control mode.QVBR: Quality will match the specified quality level except + // when it is constrained by themaximum bitrate. Recommended if you or your + // viewers pay for bandwidth.VBR: Quality and bitrate vary, depending on the + // video complexity. Recommended instead of QVBRif you want to maintain a specific + // average bitrate over the duration of the channel.CBR: Quality varies, depending + // on the video complexity. Recommended only if you distributeyour assets to + // devices that cannot handle variable bitrates.Multiplex: This rate control + // mode is only supported (and is required) when the video is beingdelivered + // to a MediaLive Multiplex in which case the rate control configuration is + // controlledby the properties within the Multiplex Program. + RateControlMode *string `locationName:"rateControlMode" type:"string" enum:"H264RateControlMode"` + + // Sets the scan type of the output to progressive or top-field-first interlaced. + ScanType *string `locationName:"scanType" type:"string" enum:"H264ScanType"` + + // Scene change detection.- On: inserts I-frames when scene change is detected.- + // Off: does not force an I-frame when scene change is detected. + SceneChangeDetect *string `locationName:"sceneChangeDetect" type:"string" enum:"H264SceneChangeDetect"` + + // Number of slices per picture. Must be less than or equal to the number of + // macroblock rows for progressive pictures, and less than or equal to half + // the number of macroblock rows for interlaced pictures.This field is optional; + // when no value is specified the encoder will choose the number of slices based + // on encode resolution. + Slices *int64 `locationName:"slices" min:"1" type:"integer"` + + // Softness. Selects quantizer matrix, larger values reduce high-frequency content + // in the encoded image. + Softness *int64 `locationName:"softness" type:"integer"` + + // If set to enabled, adjust quantization within each frame based on spatial + // variation of content complexity. + SpatialAq *string `locationName:"spatialAq" type:"string" enum:"H264SpatialAq"` - // Selects method of inserting SDT information into output stream. The sdtFollow - // setting copies SDT information from input stream to output stream. The sdtFollowIfPresent - // setting copies SDT information from input stream to output stream if SDT - // information is present in the input, otherwise it will fall back on the user-defined - // values. The sdtManual setting means user will enter the SDT information. - // The sdtNone setting means output stream will not contain SDT information. - OutputSdt *string `locationName:"outputSdt" type:"string" enum:"DvbSdtOutputSdt"` + // If set to fixed, use gopNumBFrames B-frames per sub-GOP. If set to dynamic, + // optimize the number of B-frames used for each sub-GOP to improve visual quality. + SubgopLength *string `locationName:"subgopLength" type:"string" enum:"H264SubGopLength"` - // The number of milliseconds between instances of this table in the output - // transport stream. - RepInterval *int64 `locationName:"repInterval" min:"25" type:"integer"` + // Produces a bitstream compliant with SMPTE RP-2027. + Syntax *string `locationName:"syntax" type:"string" enum:"H264Syntax"` - // The service name placed in the serviceDescriptor in the Service Description - // Table. Maximum length is 256 characters. - ServiceName *string `locationName:"serviceName" min:"1" type:"string"` + // If set to enabled, adjust quantization within each frame based on temporal + // variation of content complexity. + TemporalAq *string `locationName:"temporalAq" type:"string" enum:"H264TemporalAq"` - // The service provider name placed in the serviceDescriptor in the Service - // Description Table. Maximum length is 256 characters. - ServiceProviderName *string `locationName:"serviceProviderName" min:"1" type:"string"` + // Determines how timecodes should be inserted into the video elementary stream.- + // 'disabled': Do not include timecodes- 'picTimingSei': Pass through picture + // timing SEI messages from the source specified in Timecode Config + TimecodeInsertion *string `locationName:"timecodeInsertion" type:"string" enum:"H264TimecodeInsertionBehavior"` } // String returns the string representation -func (s DvbSdtSettings) String() string { +func (s H264Settings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DvbSdtSettings) GoString() string { +func (s H264Settings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DvbSdtSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DvbSdtSettings"} - if s.RepInterval != nil && *s.RepInterval < 25 { - invalidParams.Add(request.NewErrParamMinValue("RepInterval", 25)) +func (s *H264Settings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "H264Settings"} + if s.Bitrate != nil && *s.Bitrate < 1000 { + invalidParams.Add(request.NewErrParamMinValue("Bitrate", 1000)) } - if s.ServiceName != nil && len(*s.ServiceName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServiceName", 1)) + if s.FramerateDenominator != nil && *s.FramerateDenominator < 1 { + invalidParams.Add(request.NewErrParamMinValue("FramerateDenominator", 1)) } - if s.ServiceProviderName != nil && len(*s.ServiceProviderName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServiceProviderName", 1)) + if s.FramerateNumerator != nil && *s.FramerateNumerator < 1 { + invalidParams.Add(request.NewErrParamMinValue("FramerateNumerator", 1)) + } + if s.MaxBitrate != nil && *s.MaxBitrate < 1000 { + invalidParams.Add(request.NewErrParamMinValue("MaxBitrate", 1000)) + } + if s.NumRefFrames != nil && *s.NumRefFrames < 1 { + invalidParams.Add(request.NewErrParamMinValue("NumRefFrames", 1)) + } + if s.ParDenominator != nil && *s.ParDenominator < 1 { + invalidParams.Add(request.NewErrParamMinValue("ParDenominator", 1)) + } + if s.QvbrQualityLevel != nil && *s.QvbrQualityLevel < 1 { + invalidParams.Add(request.NewErrParamMinValue("QvbrQualityLevel", 1)) + } + if s.Slices != nil && *s.Slices < 1 { + invalidParams.Add(request.NewErrParamMinValue("Slices", 1)) } if invalidParams.Len() > 0 { @@ -7660,434 +11372,462 @@ func (s *DvbSdtSettings) Validate() error { return nil } -// SetOutputSdt sets the OutputSdt field's value. -func (s *DvbSdtSettings) SetOutputSdt(v string) *DvbSdtSettings { - s.OutputSdt = &v +// SetAdaptiveQuantization sets the AdaptiveQuantization field's value. +func (s *H264Settings) SetAdaptiveQuantization(v string) *H264Settings { + s.AdaptiveQuantization = &v return s } -// SetRepInterval sets the RepInterval field's value. -func (s *DvbSdtSettings) SetRepInterval(v int64) *DvbSdtSettings { - s.RepInterval = &v +// SetAfdSignaling sets the AfdSignaling field's value. +func (s *H264Settings) SetAfdSignaling(v string) *H264Settings { + s.AfdSignaling = &v return s } -// SetServiceName sets the ServiceName field's value. -func (s *DvbSdtSettings) SetServiceName(v string) *DvbSdtSettings { - s.ServiceName = &v +// SetBitrate sets the Bitrate field's value. +func (s *H264Settings) SetBitrate(v int64) *H264Settings { + s.Bitrate = &v return s } -// SetServiceProviderName sets the ServiceProviderName field's value. -func (s *DvbSdtSettings) SetServiceProviderName(v string) *DvbSdtSettings { - s.ServiceProviderName = &v +// SetBufFillPct sets the BufFillPct field's value. +func (s *H264Settings) SetBufFillPct(v int64) *H264Settings { + s.BufFillPct = &v return s } -// Dvb Sub Destination Settings -type DvbSubDestinationSettings struct { - _ struct{} `type:"structure"` - - // If no explicit xPosition or yPosition is provided, setting alignment to centered - // will place the captions at the bottom center of the output. Similarly, setting - // a left alignment will align captions to the bottom left of the output. If - // x and y positions are given in conjunction with the alignment parameter, - // the font will be justified (either left or centered) relative to those coordinates. - // Selecting "smart" justification will left-justify live subtitles and center-justify - // pre-recorded subtitles. This option is not valid for source captions that - // are STL or 608/embedded. These source settings are already pre-defined by - // the caption stream. All burn-in and DVB-Sub font settings must match. - Alignment *string `locationName:"alignment" type:"string" enum:"DvbSubDestinationAlignment"` - - // Specifies the color of the rectangle behind the captions. All burn-in and - // DVB-Sub font settings must match. - BackgroundColor *string `locationName:"backgroundColor" type:"string" enum:"DvbSubDestinationBackgroundColor"` - - // Specifies the opacity of the background rectangle. 255 is opaque; 0 is transparent. - // Leaving this parameter blank is equivalent to setting it to 0 (transparent). - // All burn-in and DVB-Sub font settings must match. - BackgroundOpacity *int64 `locationName:"backgroundOpacity" type:"integer"` - - // External font file used for caption burn-in. File extension must be 'ttf' - // or 'tte'. Although the user can select output fonts for many different types - // of input captions, embedded, STL and teletext sources use a strict grid system. - // Using external fonts with these caption sources could cause unexpected display - // of proportional fonts. All burn-in and DVB-Sub font settings must match. - Font *InputLocation `locationName:"font" type:"structure"` - - // Specifies the color of the burned-in captions. This option is not valid for - // source captions that are STL, 608/embedded or teletext. These source settings - // are already pre-defined by the caption stream. All burn-in and DVB-Sub font - // settings must match. - FontColor *string `locationName:"fontColor" type:"string" enum:"DvbSubDestinationFontColor"` - - // Specifies the opacity of the burned-in captions. 255 is opaque; 0 is transparent. - // All burn-in and DVB-Sub font settings must match. - FontOpacity *int64 `locationName:"fontOpacity" type:"integer"` - - // Font resolution in DPI (dots per inch); default is 96 dpi. All burn-in and - // DVB-Sub font settings must match. - FontResolution *int64 `locationName:"fontResolution" min:"96" type:"integer"` - - // When set to auto fontSize will scale depending on the size of the output. - // Giving a positive integer will specify the exact font size in points. All - // burn-in and DVB-Sub font settings must match. - FontSize *string `locationName:"fontSize" type:"string"` - - // Specifies font outline color. This option is not valid for source captions - // that are either 608/embedded or teletext. These source settings are already - // pre-defined by the caption stream. All burn-in and DVB-Sub font settings - // must match. - OutlineColor *string `locationName:"outlineColor" type:"string" enum:"DvbSubDestinationOutlineColor"` - - // Specifies font outline size in pixels. This option is not valid for source - // captions that are either 608/embedded or teletext. These source settings - // are already pre-defined by the caption stream. All burn-in and DVB-Sub font - // settings must match. - OutlineSize *int64 `locationName:"outlineSize" type:"integer"` - - // Specifies the color of the shadow cast by the captions. All burn-in and DVB-Sub - // font settings must match. - ShadowColor *string `locationName:"shadowColor" type:"string" enum:"DvbSubDestinationShadowColor"` +// SetBufSize sets the BufSize field's value. +func (s *H264Settings) SetBufSize(v int64) *H264Settings { + s.BufSize = &v + return s +} - // Specifies the opacity of the shadow. 255 is opaque; 0 is transparent. Leaving - // this parameter blank is equivalent to setting it to 0 (transparent). All - // burn-in and DVB-Sub font settings must match. - ShadowOpacity *int64 `locationName:"shadowOpacity" type:"integer"` +// SetColorMetadata sets the ColorMetadata field's value. +func (s *H264Settings) SetColorMetadata(v string) *H264Settings { + s.ColorMetadata = &v + return s +} - // Specifies the horizontal offset of the shadow relative to the captions in - // pixels. A value of -2 would result in a shadow offset 2 pixels to the left. - // All burn-in and DVB-Sub font settings must match. - ShadowXOffset *int64 `locationName:"shadowXOffset" type:"integer"` +// SetColorSpaceSettings sets the ColorSpaceSettings field's value. +func (s *H264Settings) SetColorSpaceSettings(v *H264ColorSpaceSettings) *H264Settings { + s.ColorSpaceSettings = v + return s +} - // Specifies the vertical offset of the shadow relative to the captions in pixels. - // A value of -2 would result in a shadow offset 2 pixels above the text. All - // burn-in and DVB-Sub font settings must match. - ShadowYOffset *int64 `locationName:"shadowYOffset" type:"integer"` +// SetEntropyEncoding sets the EntropyEncoding field's value. +func (s *H264Settings) SetEntropyEncoding(v string) *H264Settings { + s.EntropyEncoding = &v + return s +} - // Controls whether a fixed grid size will be used to generate the output subtitles - // bitmap. Only applicable for Teletext inputs and DVB-Sub/Burn-in outputs. - TeletextGridControl *string `locationName:"teletextGridControl" type:"string" enum:"DvbSubDestinationTeletextGridControl"` +// SetFixedAfd sets the FixedAfd field's value. +func (s *H264Settings) SetFixedAfd(v string) *H264Settings { + s.FixedAfd = &v + return s +} - // Specifies the horizontal position of the caption relative to the left side - // of the output in pixels. A value of 10 would result in the captions starting - // 10 pixels from the left of the output. If no explicit xPosition is provided, - // the horizontal caption position will be determined by the alignment parameter. - // This option is not valid for source captions that are STL, 608/embedded or - // teletext. These source settings are already pre-defined by the caption stream. - // All burn-in and DVB-Sub font settings must match. - XPosition *int64 `locationName:"xPosition" type:"integer"` +// SetFlickerAq sets the FlickerAq field's value. +func (s *H264Settings) SetFlickerAq(v string) *H264Settings { + s.FlickerAq = &v + return s +} - // Specifies the vertical position of the caption relative to the top of the - // output in pixels. A value of 10 would result in the captions starting 10 - // pixels from the top of the output. If no explicit yPosition is provided, - // the caption will be positioned towards the bottom of the output. This option - // is not valid for source captions that are STL, 608/embedded or teletext. - // These source settings are already pre-defined by the caption stream. All - // burn-in and DVB-Sub font settings must match. - YPosition *int64 `locationName:"yPosition" type:"integer"` +// SetFramerateControl sets the FramerateControl field's value. +func (s *H264Settings) SetFramerateControl(v string) *H264Settings { + s.FramerateControl = &v + return s } -// String returns the string representation -func (s DvbSubDestinationSettings) String() string { - return awsutil.Prettify(s) +// SetFramerateDenominator sets the FramerateDenominator field's value. +func (s *H264Settings) SetFramerateDenominator(v int64) *H264Settings { + s.FramerateDenominator = &v + return s } -// GoString returns the string representation -func (s DvbSubDestinationSettings) GoString() string { - return s.String() +// SetFramerateNumerator sets the FramerateNumerator field's value. +func (s *H264Settings) SetFramerateNumerator(v int64) *H264Settings { + s.FramerateNumerator = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DvbSubDestinationSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DvbSubDestinationSettings"} - if s.FontResolution != nil && *s.FontResolution < 96 { - invalidParams.Add(request.NewErrParamMinValue("FontResolution", 96)) - } - if s.Font != nil { - if err := s.Font.Validate(); err != nil { - invalidParams.AddNested("Font", err.(request.ErrInvalidParams)) - } - } +// SetGopBReference sets the GopBReference field's value. +func (s *H264Settings) SetGopBReference(v string) *H264Settings { + s.GopBReference = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetGopClosedCadence sets the GopClosedCadence field's value. +func (s *H264Settings) SetGopClosedCadence(v int64) *H264Settings { + s.GopClosedCadence = &v + return s } -// SetAlignment sets the Alignment field's value. -func (s *DvbSubDestinationSettings) SetAlignment(v string) *DvbSubDestinationSettings { - s.Alignment = &v +// SetGopNumBFrames sets the GopNumBFrames field's value. +func (s *H264Settings) SetGopNumBFrames(v int64) *H264Settings { + s.GopNumBFrames = &v return s } -// SetBackgroundColor sets the BackgroundColor field's value. -func (s *DvbSubDestinationSettings) SetBackgroundColor(v string) *DvbSubDestinationSettings { - s.BackgroundColor = &v +// SetGopSize sets the GopSize field's value. +func (s *H264Settings) SetGopSize(v float64) *H264Settings { + s.GopSize = &v return s } -// SetBackgroundOpacity sets the BackgroundOpacity field's value. -func (s *DvbSubDestinationSettings) SetBackgroundOpacity(v int64) *DvbSubDestinationSettings { - s.BackgroundOpacity = &v +// SetGopSizeUnits sets the GopSizeUnits field's value. +func (s *H264Settings) SetGopSizeUnits(v string) *H264Settings { + s.GopSizeUnits = &v return s } -// SetFont sets the Font field's value. -func (s *DvbSubDestinationSettings) SetFont(v *InputLocation) *DvbSubDestinationSettings { - s.Font = v +// SetLevel sets the Level field's value. +func (s *H264Settings) SetLevel(v string) *H264Settings { + s.Level = &v return s } -// SetFontColor sets the FontColor field's value. -func (s *DvbSubDestinationSettings) SetFontColor(v string) *DvbSubDestinationSettings { - s.FontColor = &v +// SetLookAheadRateControl sets the LookAheadRateControl field's value. +func (s *H264Settings) SetLookAheadRateControl(v string) *H264Settings { + s.LookAheadRateControl = &v return s } -// SetFontOpacity sets the FontOpacity field's value. -func (s *DvbSubDestinationSettings) SetFontOpacity(v int64) *DvbSubDestinationSettings { - s.FontOpacity = &v +// SetMaxBitrate sets the MaxBitrate field's value. +func (s *H264Settings) SetMaxBitrate(v int64) *H264Settings { + s.MaxBitrate = &v return s } -// SetFontResolution sets the FontResolution field's value. -func (s *DvbSubDestinationSettings) SetFontResolution(v int64) *DvbSubDestinationSettings { - s.FontResolution = &v +// SetMinIInterval sets the MinIInterval field's value. +func (s *H264Settings) SetMinIInterval(v int64) *H264Settings { + s.MinIInterval = &v return s } -// SetFontSize sets the FontSize field's value. -func (s *DvbSubDestinationSettings) SetFontSize(v string) *DvbSubDestinationSettings { - s.FontSize = &v +// SetNumRefFrames sets the NumRefFrames field's value. +func (s *H264Settings) SetNumRefFrames(v int64) *H264Settings { + s.NumRefFrames = &v return s } -// SetOutlineColor sets the OutlineColor field's value. -func (s *DvbSubDestinationSettings) SetOutlineColor(v string) *DvbSubDestinationSettings { - s.OutlineColor = &v +// SetParControl sets the ParControl field's value. +func (s *H264Settings) SetParControl(v string) *H264Settings { + s.ParControl = &v return s } -// SetOutlineSize sets the OutlineSize field's value. -func (s *DvbSubDestinationSettings) SetOutlineSize(v int64) *DvbSubDestinationSettings { - s.OutlineSize = &v +// SetParDenominator sets the ParDenominator field's value. +func (s *H264Settings) SetParDenominator(v int64) *H264Settings { + s.ParDenominator = &v return s } -// SetShadowColor sets the ShadowColor field's value. -func (s *DvbSubDestinationSettings) SetShadowColor(v string) *DvbSubDestinationSettings { - s.ShadowColor = &v +// SetParNumerator sets the ParNumerator field's value. +func (s *H264Settings) SetParNumerator(v int64) *H264Settings { + s.ParNumerator = &v return s } -// SetShadowOpacity sets the ShadowOpacity field's value. -func (s *DvbSubDestinationSettings) SetShadowOpacity(v int64) *DvbSubDestinationSettings { - s.ShadowOpacity = &v +// SetProfile sets the Profile field's value. +func (s *H264Settings) SetProfile(v string) *H264Settings { + s.Profile = &v return s } -// SetShadowXOffset sets the ShadowXOffset field's value. -func (s *DvbSubDestinationSettings) SetShadowXOffset(v int64) *DvbSubDestinationSettings { - s.ShadowXOffset = &v +// SetQvbrQualityLevel sets the QvbrQualityLevel field's value. +func (s *H264Settings) SetQvbrQualityLevel(v int64) *H264Settings { + s.QvbrQualityLevel = &v return s } -// SetShadowYOffset sets the ShadowYOffset field's value. -func (s *DvbSubDestinationSettings) SetShadowYOffset(v int64) *DvbSubDestinationSettings { - s.ShadowYOffset = &v +// SetRateControlMode sets the RateControlMode field's value. +func (s *H264Settings) SetRateControlMode(v string) *H264Settings { + s.RateControlMode = &v return s } -// SetTeletextGridControl sets the TeletextGridControl field's value. -func (s *DvbSubDestinationSettings) SetTeletextGridControl(v string) *DvbSubDestinationSettings { - s.TeletextGridControl = &v +// SetScanType sets the ScanType field's value. +func (s *H264Settings) SetScanType(v string) *H264Settings { + s.ScanType = &v return s } -// SetXPosition sets the XPosition field's value. -func (s *DvbSubDestinationSettings) SetXPosition(v int64) *DvbSubDestinationSettings { - s.XPosition = &v +// SetSceneChangeDetect sets the SceneChangeDetect field's value. +func (s *H264Settings) SetSceneChangeDetect(v string) *H264Settings { + s.SceneChangeDetect = &v return s } -// SetYPosition sets the YPosition field's value. -func (s *DvbSubDestinationSettings) SetYPosition(v int64) *DvbSubDestinationSettings { - s.YPosition = &v +// SetSlices sets the Slices field's value. +func (s *H264Settings) SetSlices(v int64) *H264Settings { + s.Slices = &v return s } -// Dvb Sub Source Settings -type DvbSubSourceSettings struct { - _ struct{} `type:"structure"` - - // When using DVB-Sub with Burn-In or SMPTE-TT, use this PID for the source - // content. Unused for DVB-Sub passthrough. All DVB-Sub content is passed through, - // regardless of selectors. - Pid *int64 `locationName:"pid" min:"1" type:"integer"` +// SetSoftness sets the Softness field's value. +func (s *H264Settings) SetSoftness(v int64) *H264Settings { + s.Softness = &v + return s } -// String returns the string representation -func (s DvbSubSourceSettings) String() string { - return awsutil.Prettify(s) +// SetSpatialAq sets the SpatialAq field's value. +func (s *H264Settings) SetSpatialAq(v string) *H264Settings { + s.SpatialAq = &v + return s } -// GoString returns the string representation -func (s DvbSubSourceSettings) GoString() string { - return s.String() +// SetSubgopLength sets the SubgopLength field's value. +func (s *H264Settings) SetSubgopLength(v string) *H264Settings { + s.SubgopLength = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DvbSubSourceSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DvbSubSourceSettings"} - if s.Pid != nil && *s.Pid < 1 { - invalidParams.Add(request.NewErrParamMinValue("Pid", 1)) - } +// SetSyntax sets the Syntax field's value. +func (s *H264Settings) SetSyntax(v string) *H264Settings { + s.Syntax = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetTemporalAq sets the TemporalAq field's value. +func (s *H264Settings) SetTemporalAq(v string) *H264Settings { + s.TemporalAq = &v + return s } -// SetPid sets the Pid field's value. -func (s *DvbSubSourceSettings) SetPid(v int64) *DvbSubSourceSettings { - s.Pid = &v +// SetTimecodeInsertion sets the TimecodeInsertion field's value. +func (s *H264Settings) SetTimecodeInsertion(v string) *H264Settings { + s.TimecodeInsertion = &v return s } -// DVB Time and Date Table (SDT) -type DvbTdtSettings struct { +// H265 Color Space Settings +type H265ColorSpaceSettings struct { _ struct{} `type:"structure"` - // The number of milliseconds between instances of this table in the output - // transport stream. - RepInterval *int64 `locationName:"repInterval" min:"1000" type:"integer"` + // Passthrough applies no color space conversion to the output + ColorSpacePassthroughSettings *ColorSpacePassthroughSettings `locationName:"colorSpacePassthroughSettings" type:"structure"` + + // Hdr10 Settings + Hdr10Settings *Hdr10Settings `locationName:"hdr10Settings" type:"structure"` + + // Rec601 Settings + Rec601Settings *Rec601Settings `locationName:"rec601Settings" type:"structure"` + + // Rec709 Settings + Rec709Settings *Rec709Settings `locationName:"rec709Settings" type:"structure"` } // String returns the string representation -func (s DvbTdtSettings) String() string { +func (s H265ColorSpaceSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DvbTdtSettings) GoString() string { +func (s H265ColorSpaceSettings) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DvbTdtSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DvbTdtSettings"} - if s.RepInterval != nil && *s.RepInterval < 1000 { - invalidParams.Add(request.NewErrParamMinValue("RepInterval", 1000)) - } +// SetColorSpacePassthroughSettings sets the ColorSpacePassthroughSettings field's value. +func (s *H265ColorSpaceSettings) SetColorSpacePassthroughSettings(v *ColorSpacePassthroughSettings) *H265ColorSpaceSettings { + s.ColorSpacePassthroughSettings = v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetHdr10Settings sets the Hdr10Settings field's value. +func (s *H265ColorSpaceSettings) SetHdr10Settings(v *Hdr10Settings) *H265ColorSpaceSettings { + s.Hdr10Settings = v + return s } -// SetRepInterval sets the RepInterval field's value. -func (s *DvbTdtSettings) SetRepInterval(v int64) *DvbTdtSettings { - s.RepInterval = &v +// SetRec601Settings sets the Rec601Settings field's value. +func (s *H265ColorSpaceSettings) SetRec601Settings(v *Rec601Settings) *H265ColorSpaceSettings { + s.Rec601Settings = v return s } -// Eac3 Settings -type Eac3Settings struct { +// SetRec709Settings sets the Rec709Settings field's value. +func (s *H265ColorSpaceSettings) SetRec709Settings(v *Rec709Settings) *H265ColorSpaceSettings { + s.Rec709Settings = v + return s +} + +// H265 Settings +type H265Settings struct { _ struct{} `type:"structure"` - // When set to attenuate3Db, applies a 3 dB attenuation to the surround channels. - // Only used for 3/2 coding mode. - AttenuationControl *string `locationName:"attenuationControl" type:"string" enum:"Eac3AttenuationControl"` + // Adaptive quantization. Allows intra-frame quantizers to vary to improve visual + // quality. + AdaptiveQuantization *string `locationName:"adaptiveQuantization" type:"string" enum:"H265AdaptiveQuantization"` - // Average bitrate in bits/second. Valid bitrates depend on the coding mode. - Bitrate *float64 `locationName:"bitrate" type:"double"` + // Indicates that AFD values will be written into the output stream. If afdSignaling + // is "auto", the system will try to preserve the input AFD value (in cases + // where multiple AFD values are valid). If set to "fixed", the AFD value will + // be the value configured in the fixedAfd parameter. + AfdSignaling *string `locationName:"afdSignaling" type:"string" enum:"AfdSignaling"` + + // Whether or not EML should insert an Alternative Transfer Function SEI message + // to support backwards compatibility with non-HDR decoders and displays. + AlternativeTransferFunction *string `locationName:"alternativeTransferFunction" type:"string" enum:"H265AlternativeTransferFunction"` + + // Average bitrate in bits/second. Required when the rate control mode is VBR + // or CBR. Not used for QVBR. In an MS Smooth output group, each output must + // have a unique value when its bitrate is rounded down to the nearest multiple + // of 1000. + Bitrate *int64 `locationName:"bitrate" min:"100000" type:"integer"` + + // Size of buffer (HRD buffer model) in bits. + BufSize *int64 `locationName:"bufSize" min:"100000" type:"integer"` + + // Includes colorspace metadata in the output. + ColorMetadata *string `locationName:"colorMetadata" type:"string" enum:"H265ColorMetadata"` + + // Color Space settings + ColorSpaceSettings *H265ColorSpaceSettings `locationName:"colorSpaceSettings" type:"structure"` + + // Four bit AFD value to write on all frames of video in the output stream. + // Only valid when afdSignaling is set to 'Fixed'. + FixedAfd *string `locationName:"fixedAfd" type:"string" enum:"FixedAfd"` + + // If set to enabled, adjust quantization within each frame to reduce flicker + // or 'pop' on I-frames. + FlickerAq *string `locationName:"flickerAq" type:"string" enum:"H265FlickerAq"` + + // Framerate denominator. + // + // FramerateDenominator is a required field + FramerateDenominator *int64 `locationName:"framerateDenominator" min:"1" type:"integer" required:"true"` - // Specifies the bitstream mode (bsmod) for the emitted E-AC-3 stream. See ATSC - // A/52-2012 (Annex E) for background on these values. - BitstreamMode *string `locationName:"bitstreamMode" type:"string" enum:"Eac3BitstreamMode"` + // Framerate numerator - framerate is a fraction, e.g. 24000 / 1001 = 23.976 + // fps. + // + // FramerateNumerator is a required field + FramerateNumerator *int64 `locationName:"framerateNumerator" min:"1" type:"integer" required:"true"` - // Dolby Digital Plus coding mode. Determines number of channels. - CodingMode *string `locationName:"codingMode" type:"string" enum:"Eac3CodingMode"` + // Frequency of closed GOPs. In streaming applications, it is recommended that + // this be set to 1 so a decoder joining mid-stream will receive an IDR frame + // as quickly as possible. Setting this value to 0 will break output segmenting. + GopClosedCadence *int64 `locationName:"gopClosedCadence" type:"integer"` - // When set to enabled, activates a DC highpass filter for all input channels. - DcFilter *string `locationName:"dcFilter" type:"string" enum:"Eac3DcFilter"` + // GOP size (keyframe interval) in units of either frames or seconds per gopSizeUnits.If + // gopSizeUnits is frames, gopSize must be an integer and must be greater than + // or equal to 1.If gopSizeUnits is seconds, gopSize must be greater than 0, + // but need not be an integer. + GopSize *float64 `locationName:"gopSize" type:"double"` - // Sets the dialnorm for the output. If blank and input audio is Dolby Digital - // Plus, dialnorm will be passed through. - Dialnorm *int64 `locationName:"dialnorm" min:"1" type:"integer"` + // Indicates if the gopSize is specified in frames or seconds. If seconds the + // system will convert the gopSize into a frame count at run time. + GopSizeUnits *string `locationName:"gopSizeUnits" type:"string" enum:"H265GopSizeUnits"` - // Sets the Dolby dynamic range compression profile. - DrcLine *string `locationName:"drcLine" type:"string" enum:"Eac3DrcLine"` + // H.265 Level. + Level *string `locationName:"level" type:"string" enum:"H265Level"` - // Sets the profile for heavy Dolby dynamic range compression, ensures that - // the instantaneous signal peaks do not exceed specified levels. - DrcRf *string `locationName:"drcRf" type:"string" enum:"Eac3DrcRf"` + // Amount of lookahead. A value of low can decrease latency and memory usage, + // while high can produce better quality for certain content. + LookAheadRateControl *string `locationName:"lookAheadRateControl" type:"string" enum:"H265LookAheadRateControl"` - // When encoding 3/2 audio, setting to lfe enables the LFE channel - LfeControl *string `locationName:"lfeControl" type:"string" enum:"Eac3LfeControl"` + // For QVBR: See the tooltip for Quality level + MaxBitrate *int64 `locationName:"maxBitrate" min:"100000" type:"integer"` - // When set to enabled, applies a 120Hz lowpass filter to the LFE channel prior - // to encoding. Only valid with codingMode32 coding mode. - LfeFilter *string `locationName:"lfeFilter" type:"string" enum:"Eac3LfeFilter"` + // Only meaningful if sceneChangeDetect is set to enabled. Defaults to 5 if + // multiplex rate control is used. Enforces separation between repeated (cadence) + // I-frames and I-frames inserted by Scene Change Detection. If a scene change + // I-frame is within I-interval frames of a cadence I-frame, the GOP is shrunk + // and/or stretched to the scene change I-frame. GOP stretch requires enabling + // lookahead as well as setting I-interval. The normal cadence resumes for the + // next GOP. Note: Maximum GOP stretch = GOP size + Min-I-interval - 1 + MinIInterval *int64 `locationName:"minIInterval" type:"integer"` - // Left only/Right only center mix level. Only used for 3/2 coding mode. - LoRoCenterMixLevel *float64 `locationName:"loRoCenterMixLevel" type:"double"` + // Pixel Aspect Ratio denominator. + ParDenominator *int64 `locationName:"parDenominator" min:"1" type:"integer"` - // Left only/Right only surround mix level. Only used for 3/2 coding mode. - LoRoSurroundMixLevel *float64 `locationName:"loRoSurroundMixLevel" type:"double"` + // Pixel Aspect Ratio numerator. + ParNumerator *int64 `locationName:"parNumerator" min:"1" type:"integer"` - // Left total/Right total center mix level. Only used for 3/2 coding mode. - LtRtCenterMixLevel *float64 `locationName:"ltRtCenterMixLevel" type:"double"` + // H.265 Profile. + Profile *string `locationName:"profile" type:"string" enum:"H265Profile"` - // Left total/Right total surround mix level. Only used for 3/2 coding mode. - LtRtSurroundMixLevel *float64 `locationName:"ltRtSurroundMixLevel" type:"double"` + // Controls the target quality for the video encode. Applies only when the rate + // control mode is QVBR. Set values for the QVBR quality level field and Max + // bitrate field that suit your most important viewing devices. Recommended + // values are:- Primary screen: Quality level: 8 to 10. Max bitrate: 4M- PC + // or tablet: Quality level: 7. Max bitrate: 1.5M to 3M- Smartphone: Quality + // level: 6. Max bitrate: 1M to 1.5M + QvbrQualityLevel *int64 `locationName:"qvbrQualityLevel" min:"1" type:"integer"` - // When set to followInput, encoder metadata will be sourced from the DD, DD+, - // or DolbyE decoder that supplied this audio data. If audio was not supplied - // from one of these streams, then the static metadata settings will be used. - MetadataControl *string `locationName:"metadataControl" type:"string" enum:"Eac3MetadataControl"` + // Rate control mode.QVBR: Quality will match the specified quality level except + // when it is constrained by themaximum bitrate. Recommended if you or your + // viewers pay for bandwidth.CBR: Quality varies, depending on the video complexity. + // Recommended only if you distributeyour assets to devices that cannot handle + // variable bitrates. + RateControlMode *string `locationName:"rateControlMode" type:"string" enum:"H265RateControlMode"` - // When set to whenPossible, input DD+ audio will be passed through if it is - // present on the input. This detection is dynamic over the life of the transcode. - // Inputs that alternate between DD+ and non-DD+ content will have a consistent - // DD+ output as the system alternates between passthrough and encoding. - PassthroughControl *string `locationName:"passthroughControl" type:"string" enum:"Eac3PassthroughControl"` + // Sets the scan type of the output to progressive or top-field-first interlaced. + ScanType *string `locationName:"scanType" type:"string" enum:"H265ScanType"` - // When set to shift90Degrees, applies a 90-degree phase shift to the surround - // channels. Only used for 3/2 coding mode. - PhaseControl *string `locationName:"phaseControl" type:"string" enum:"Eac3PhaseControl"` + // Scene change detection. + SceneChangeDetect *string `locationName:"sceneChangeDetect" type:"string" enum:"H265SceneChangeDetect"` - // Stereo downmix preference. Only used for 3/2 coding mode. - StereoDownmix *string `locationName:"stereoDownmix" type:"string" enum:"Eac3StereoDownmix"` + // Number of slices per picture. Must be less than or equal to the number of + // macroblock rows for progressive pictures, and less than or equal to half + // the number of macroblock rows for interlaced pictures.This field is optional; + // when no value is specified the encoder will choose the number of slices based + // on encode resolution. + Slices *int64 `locationName:"slices" min:"1" type:"integer"` - // When encoding 3/2 audio, sets whether an extra center back surround channel - // is matrix encoded into the left and right surround channels. - SurroundExMode *string `locationName:"surroundExMode" type:"string" enum:"Eac3SurroundExMode"` + // H.265 Tier. + Tier *string `locationName:"tier" type:"string" enum:"H265Tier"` - // When encoding 2/0 audio, sets whether Dolby Surround is matrix encoded into - // the two channels. - SurroundMode *string `locationName:"surroundMode" type:"string" enum:"Eac3SurroundMode"` + // Determines how timecodes should be inserted into the video elementary stream.- + // 'disabled': Do not include timecodes- 'picTimingSei': Pass through picture + // timing SEI messages from the source specified in Timecode Config + TimecodeInsertion *string `locationName:"timecodeInsertion" type:"string" enum:"H265TimecodeInsertionBehavior"` } // String returns the string representation -func (s Eac3Settings) String() string { +func (s H265Settings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Eac3Settings) GoString() string { +func (s H265Settings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *Eac3Settings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Eac3Settings"} - if s.Dialnorm != nil && *s.Dialnorm < 1 { - invalidParams.Add(request.NewErrParamMinValue("Dialnorm", 1)) +func (s *H265Settings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "H265Settings"} + if s.Bitrate != nil && *s.Bitrate < 100000 { + invalidParams.Add(request.NewErrParamMinValue("Bitrate", 100000)) + } + if s.BufSize != nil && *s.BufSize < 100000 { + invalidParams.Add(request.NewErrParamMinValue("BufSize", 100000)) + } + if s.FramerateDenominator == nil { + invalidParams.Add(request.NewErrParamRequired("FramerateDenominator")) + } + if s.FramerateDenominator != nil && *s.FramerateDenominator < 1 { + invalidParams.Add(request.NewErrParamMinValue("FramerateDenominator", 1)) + } + if s.FramerateNumerator == nil { + invalidParams.Add(request.NewErrParamRequired("FramerateNumerator")) + } + if s.FramerateNumerator != nil && *s.FramerateNumerator < 1 { + invalidParams.Add(request.NewErrParamMinValue("FramerateNumerator", 1)) + } + if s.MaxBitrate != nil && *s.MaxBitrate < 100000 { + invalidParams.Add(request.NewErrParamMinValue("MaxBitrate", 100000)) + } + if s.ParDenominator != nil && *s.ParDenominator < 1 { + invalidParams.Add(request.NewErrParamMinValue("ParDenominator", 1)) + } + if s.ParNumerator != nil && *s.ParNumerator < 1 { + invalidParams.Add(request.NewErrParamMinValue("ParNumerator", 1)) + } + if s.QvbrQualityLevel != nil && *s.QvbrQualityLevel < 1 { + invalidParams.Add(request.NewErrParamMinValue("QvbrQualityLevel", 1)) + } + if s.Slices != nil && *s.Slices < 1 { + invalidParams.Add(request.NewErrParamMinValue("Slices", 1)) } if invalidParams.Len() > 0 { @@ -8096,742 +11836,648 @@ func (s *Eac3Settings) Validate() error { return nil } -// SetAttenuationControl sets the AttenuationControl field's value. -func (s *Eac3Settings) SetAttenuationControl(v string) *Eac3Settings { - s.AttenuationControl = &v +// SetAdaptiveQuantization sets the AdaptiveQuantization field's value. +func (s *H265Settings) SetAdaptiveQuantization(v string) *H265Settings { + s.AdaptiveQuantization = &v + return s +} + +// SetAfdSignaling sets the AfdSignaling field's value. +func (s *H265Settings) SetAfdSignaling(v string) *H265Settings { + s.AfdSignaling = &v + return s +} + +// SetAlternativeTransferFunction sets the AlternativeTransferFunction field's value. +func (s *H265Settings) SetAlternativeTransferFunction(v string) *H265Settings { + s.AlternativeTransferFunction = &v return s } // SetBitrate sets the Bitrate field's value. -func (s *Eac3Settings) SetBitrate(v float64) *Eac3Settings { +func (s *H265Settings) SetBitrate(v int64) *H265Settings { s.Bitrate = &v return s } -// SetBitstreamMode sets the BitstreamMode field's value. -func (s *Eac3Settings) SetBitstreamMode(v string) *Eac3Settings { - s.BitstreamMode = &v +// SetBufSize sets the BufSize field's value. +func (s *H265Settings) SetBufSize(v int64) *H265Settings { + s.BufSize = &v return s } -// SetCodingMode sets the CodingMode field's value. -func (s *Eac3Settings) SetCodingMode(v string) *Eac3Settings { - s.CodingMode = &v +// SetColorMetadata sets the ColorMetadata field's value. +func (s *H265Settings) SetColorMetadata(v string) *H265Settings { + s.ColorMetadata = &v return s } -// SetDcFilter sets the DcFilter field's value. -func (s *Eac3Settings) SetDcFilter(v string) *Eac3Settings { - s.DcFilter = &v +// SetColorSpaceSettings sets the ColorSpaceSettings field's value. +func (s *H265Settings) SetColorSpaceSettings(v *H265ColorSpaceSettings) *H265Settings { + s.ColorSpaceSettings = v return s } -// SetDialnorm sets the Dialnorm field's value. -func (s *Eac3Settings) SetDialnorm(v int64) *Eac3Settings { - s.Dialnorm = &v +// SetFixedAfd sets the FixedAfd field's value. +func (s *H265Settings) SetFixedAfd(v string) *H265Settings { + s.FixedAfd = &v return s } -// SetDrcLine sets the DrcLine field's value. -func (s *Eac3Settings) SetDrcLine(v string) *Eac3Settings { - s.DrcLine = &v +// SetFlickerAq sets the FlickerAq field's value. +func (s *H265Settings) SetFlickerAq(v string) *H265Settings { + s.FlickerAq = &v return s } -// SetDrcRf sets the DrcRf field's value. -func (s *Eac3Settings) SetDrcRf(v string) *Eac3Settings { - s.DrcRf = &v +// SetFramerateDenominator sets the FramerateDenominator field's value. +func (s *H265Settings) SetFramerateDenominator(v int64) *H265Settings { + s.FramerateDenominator = &v return s } -// SetLfeControl sets the LfeControl field's value. -func (s *Eac3Settings) SetLfeControl(v string) *Eac3Settings { - s.LfeControl = &v +// SetFramerateNumerator sets the FramerateNumerator field's value. +func (s *H265Settings) SetFramerateNumerator(v int64) *H265Settings { + s.FramerateNumerator = &v return s } -// SetLfeFilter sets the LfeFilter field's value. -func (s *Eac3Settings) SetLfeFilter(v string) *Eac3Settings { - s.LfeFilter = &v +// SetGopClosedCadence sets the GopClosedCadence field's value. +func (s *H265Settings) SetGopClosedCadence(v int64) *H265Settings { + s.GopClosedCadence = &v return s } -// SetLoRoCenterMixLevel sets the LoRoCenterMixLevel field's value. -func (s *Eac3Settings) SetLoRoCenterMixLevel(v float64) *Eac3Settings { - s.LoRoCenterMixLevel = &v +// SetGopSize sets the GopSize field's value. +func (s *H265Settings) SetGopSize(v float64) *H265Settings { + s.GopSize = &v return s } -// SetLoRoSurroundMixLevel sets the LoRoSurroundMixLevel field's value. -func (s *Eac3Settings) SetLoRoSurroundMixLevel(v float64) *Eac3Settings { - s.LoRoSurroundMixLevel = &v +// SetGopSizeUnits sets the GopSizeUnits field's value. +func (s *H265Settings) SetGopSizeUnits(v string) *H265Settings { + s.GopSizeUnits = &v return s } -// SetLtRtCenterMixLevel sets the LtRtCenterMixLevel field's value. -func (s *Eac3Settings) SetLtRtCenterMixLevel(v float64) *Eac3Settings { - s.LtRtCenterMixLevel = &v +// SetLevel sets the Level field's value. +func (s *H265Settings) SetLevel(v string) *H265Settings { + s.Level = &v return s } -// SetLtRtSurroundMixLevel sets the LtRtSurroundMixLevel field's value. -func (s *Eac3Settings) SetLtRtSurroundMixLevel(v float64) *Eac3Settings { - s.LtRtSurroundMixLevel = &v +// SetLookAheadRateControl sets the LookAheadRateControl field's value. +func (s *H265Settings) SetLookAheadRateControl(v string) *H265Settings { + s.LookAheadRateControl = &v return s } -// SetMetadataControl sets the MetadataControl field's value. -func (s *Eac3Settings) SetMetadataControl(v string) *Eac3Settings { - s.MetadataControl = &v +// SetMaxBitrate sets the MaxBitrate field's value. +func (s *H265Settings) SetMaxBitrate(v int64) *H265Settings { + s.MaxBitrate = &v return s } -// SetPassthroughControl sets the PassthroughControl field's value. -func (s *Eac3Settings) SetPassthroughControl(v string) *Eac3Settings { - s.PassthroughControl = &v +// SetMinIInterval sets the MinIInterval field's value. +func (s *H265Settings) SetMinIInterval(v int64) *H265Settings { + s.MinIInterval = &v return s } -// SetPhaseControl sets the PhaseControl field's value. -func (s *Eac3Settings) SetPhaseControl(v string) *Eac3Settings { - s.PhaseControl = &v +// SetParDenominator sets the ParDenominator field's value. +func (s *H265Settings) SetParDenominator(v int64) *H265Settings { + s.ParDenominator = &v return s } -// SetStereoDownmix sets the StereoDownmix field's value. -func (s *Eac3Settings) SetStereoDownmix(v string) *Eac3Settings { - s.StereoDownmix = &v +// SetParNumerator sets the ParNumerator field's value. +func (s *H265Settings) SetParNumerator(v int64) *H265Settings { + s.ParNumerator = &v return s } -// SetSurroundExMode sets the SurroundExMode field's value. -func (s *Eac3Settings) SetSurroundExMode(v string) *Eac3Settings { - s.SurroundExMode = &v +// SetProfile sets the Profile field's value. +func (s *H265Settings) SetProfile(v string) *H265Settings { + s.Profile = &v return s } -// SetSurroundMode sets the SurroundMode field's value. -func (s *Eac3Settings) SetSurroundMode(v string) *Eac3Settings { - s.SurroundMode = &v +// SetQvbrQualityLevel sets the QvbrQualityLevel field's value. +func (s *H265Settings) SetQvbrQualityLevel(v int64) *H265Settings { + s.QvbrQualityLevel = &v return s } -// Embedded Destination Settings -type EmbeddedDestinationSettings struct { - _ struct{} `type:"structure"` +// SetRateControlMode sets the RateControlMode field's value. +func (s *H265Settings) SetRateControlMode(v string) *H265Settings { + s.RateControlMode = &v + return s } -// String returns the string representation -func (s EmbeddedDestinationSettings) String() string { - return awsutil.Prettify(s) +// SetScanType sets the ScanType field's value. +func (s *H265Settings) SetScanType(v string) *H265Settings { + s.ScanType = &v + return s } -// GoString returns the string representation -func (s EmbeddedDestinationSettings) GoString() string { - return s.String() +// SetSceneChangeDetect sets the SceneChangeDetect field's value. +func (s *H265Settings) SetSceneChangeDetect(v string) *H265Settings { + s.SceneChangeDetect = &v + return s } -// Embedded Plus Scte20 Destination Settings -type EmbeddedPlusScte20DestinationSettings struct { - _ struct{} `type:"structure"` +// SetSlices sets the Slices field's value. +func (s *H265Settings) SetSlices(v int64) *H265Settings { + s.Slices = &v + return s } -// String returns the string representation -func (s EmbeddedPlusScte20DestinationSettings) String() string { - return awsutil.Prettify(s) +// SetTier sets the Tier field's value. +func (s *H265Settings) SetTier(v string) *H265Settings { + s.Tier = &v + return s } -// GoString returns the string representation -func (s EmbeddedPlusScte20DestinationSettings) GoString() string { - return s.String() +// SetTimecodeInsertion sets the TimecodeInsertion field's value. +func (s *H265Settings) SetTimecodeInsertion(v string) *H265Settings { + s.TimecodeInsertion = &v + return s } -// Embedded Source Settings -type EmbeddedSourceSettings struct { +// Hdr10 Settings +type Hdr10Settings struct { _ struct{} `type:"structure"` - // If upconvert, 608 data is both passed through via the "608 compatibility - // bytes" fields of the 708 wrapper as well as translated into 708. 708 data - // present in the source content will be discarded. - Convert608To708 *string `locationName:"convert608To708" type:"string" enum:"EmbeddedConvert608To708"` - - // Set to "auto" to handle streams with intermittent and/or non-aligned SCTE-20 - // and Embedded captions. - Scte20Detection *string `locationName:"scte20Detection" type:"string" enum:"EmbeddedScte20Detection"` - - // Specifies the 608/708 channel number within the video track from which to - // extract captions. Unused for passthrough. - Source608ChannelNumber *int64 `locationName:"source608ChannelNumber" min:"1" type:"integer"` + // Maximum Content Light LevelAn integer metadata value defining the maximum + // light level, in nits,of any single pixel within an encoded HDR video stream + // or file. + MaxCll *int64 `locationName:"maxCll" type:"integer"` - // This field is unused and deprecated. - Source608TrackNumber *int64 `locationName:"source608TrackNumber" min:"1" type:"integer"` + // Maximum Frame Average Light LevelAn integer metadata value defining the maximum + // average light level, in nits,for any single frame within an encoded HDR video + // stream or file. + MaxFall *int64 `locationName:"maxFall" type:"integer"` } // String returns the string representation -func (s EmbeddedSourceSettings) String() string { +func (s Hdr10Settings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EmbeddedSourceSettings) GoString() string { +func (s Hdr10Settings) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *EmbeddedSourceSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EmbeddedSourceSettings"} - if s.Source608ChannelNumber != nil && *s.Source608ChannelNumber < 1 { - invalidParams.Add(request.NewErrParamMinValue("Source608ChannelNumber", 1)) - } - if s.Source608TrackNumber != nil && *s.Source608TrackNumber < 1 { - invalidParams.Add(request.NewErrParamMinValue("Source608TrackNumber", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetConvert608To708 sets the Convert608To708 field's value. -func (s *EmbeddedSourceSettings) SetConvert608To708(v string) *EmbeddedSourceSettings { - s.Convert608To708 = &v - return s -} - -// SetScte20Detection sets the Scte20Detection field's value. -func (s *EmbeddedSourceSettings) SetScte20Detection(v string) *EmbeddedSourceSettings { - s.Scte20Detection = &v - return s -} - -// SetSource608ChannelNumber sets the Source608ChannelNumber field's value. -func (s *EmbeddedSourceSettings) SetSource608ChannelNumber(v int64) *EmbeddedSourceSettings { - s.Source608ChannelNumber = &v +// SetMaxCll sets the MaxCll field's value. +func (s *Hdr10Settings) SetMaxCll(v int64) *Hdr10Settings { + s.MaxCll = &v return s } -// SetSource608TrackNumber sets the Source608TrackNumber field's value. -func (s *EmbeddedSourceSettings) SetSource608TrackNumber(v int64) *EmbeddedSourceSettings { - s.Source608TrackNumber = &v +// SetMaxFall sets the MaxFall field's value. +func (s *Hdr10Settings) SetMaxFall(v int64) *Hdr10Settings { + s.MaxFall = &v return s } -// Encoder Settings -type EncoderSettings struct { +// Hls Akamai Settings +type HlsAkamaiSettings struct { _ struct{} `type:"structure"` - // AudioDescriptions is a required field - AudioDescriptions []*AudioDescription `locationName:"audioDescriptions" type:"list" required:"true"` - - // Settings for ad avail blanking. - AvailBlanking *AvailBlanking `locationName:"availBlanking" type:"structure"` - - // Event-wide configuration settings for ad avail insertion. - AvailConfiguration *AvailConfiguration `locationName:"availConfiguration" type:"structure"` - - // Settings for blackout slate. - BlackoutSlate *BlackoutSlate `locationName:"blackoutSlate" type:"structure"` - - // Settings for caption decriptions - CaptionDescriptions []*CaptionDescription `locationName:"captionDescriptions" type:"list"` - - // Configuration settings that apply to the event as a whole. - GlobalConfiguration *GlobalConfiguration `locationName:"globalConfiguration" type:"structure"` - - // OutputGroups is a required field - OutputGroups []*OutputGroup `locationName:"outputGroups" type:"list" required:"true"` - - // Contains settings used to acquire and adjust timecode information from inputs. - // - // TimecodeConfig is a required field - TimecodeConfig *TimecodeConfig `locationName:"timecodeConfig" type:"structure" required:"true"` - - // VideoDescriptions is a required field - VideoDescriptions []*VideoDescription `locationName:"videoDescriptions" type:"list" required:"true"` -} - -// String returns the string representation -func (s EncoderSettings) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s EncoderSettings) GoString() string { - return s.String() -} + // Number of seconds to wait before retrying connection to the CDN if the connection + // is lost. + ConnectionRetryInterval *int64 `locationName:"connectionRetryInterval" type:"integer"` -// Validate inspects the fields of the type to determine if they are valid. -func (s *EncoderSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EncoderSettings"} - if s.AudioDescriptions == nil { - invalidParams.Add(request.NewErrParamRequired("AudioDescriptions")) - } - if s.OutputGroups == nil { - invalidParams.Add(request.NewErrParamRequired("OutputGroups")) - } - if s.TimecodeConfig == nil { - invalidParams.Add(request.NewErrParamRequired("TimecodeConfig")) - } - if s.VideoDescriptions == nil { - invalidParams.Add(request.NewErrParamRequired("VideoDescriptions")) - } - if s.AudioDescriptions != nil { - for i, v := range s.AudioDescriptions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AudioDescriptions", i), err.(request.ErrInvalidParams)) - } - } - } - if s.AvailBlanking != nil { - if err := s.AvailBlanking.Validate(); err != nil { - invalidParams.AddNested("AvailBlanking", err.(request.ErrInvalidParams)) - } - } - if s.AvailConfiguration != nil { - if err := s.AvailConfiguration.Validate(); err != nil { - invalidParams.AddNested("AvailConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.BlackoutSlate != nil { - if err := s.BlackoutSlate.Validate(); err != nil { - invalidParams.AddNested("BlackoutSlate", err.(request.ErrInvalidParams)) - } - } - if s.CaptionDescriptions != nil { - for i, v := range s.CaptionDescriptions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CaptionDescriptions", i), err.(request.ErrInvalidParams)) - } - } - } - if s.GlobalConfiguration != nil { - if err := s.GlobalConfiguration.Validate(); err != nil { - invalidParams.AddNested("GlobalConfiguration", err.(request.ErrInvalidParams)) - } - } - if s.OutputGroups != nil { - for i, v := range s.OutputGroups { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OutputGroups", i), err.(request.ErrInvalidParams)) - } - } - } - if s.TimecodeConfig != nil { - if err := s.TimecodeConfig.Validate(); err != nil { - invalidParams.AddNested("TimecodeConfig", err.(request.ErrInvalidParams)) - } - } - if s.VideoDescriptions != nil { - for i, v := range s.VideoDescriptions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "VideoDescriptions", i), err.(request.ErrInvalidParams)) - } - } - } + // Size in seconds of file cache for streaming outputs. + FilecacheDuration *int64 `locationName:"filecacheDuration" type:"integer"` - if invalidParams.Len() > 0 { - return invalidParams - } - return nil + // Specify whether or not to use chunked transfer encoding to Akamai. User should + // contact Akamai to enable this feature. + HttpTransferMode *string `locationName:"httpTransferMode" type:"string" enum:"HlsAkamaiHttpTransferMode"` + + // Number of retry attempts that will be made before the Live Event is put into + // an error state. + NumRetries *int64 `locationName:"numRetries" type:"integer"` + + // If a streaming output fails, number of seconds to wait until a restart is + // initiated. A value of 0 means never restart. + RestartDelay *int64 `locationName:"restartDelay" type:"integer"` + + // Salt for authenticated Akamai. + Salt *string `locationName:"salt" type:"string"` + + // Token parameter for authenticated akamai. If not specified, _gda_ is used. + Token *string `locationName:"token" type:"string"` } -// SetAudioDescriptions sets the AudioDescriptions field's value. -func (s *EncoderSettings) SetAudioDescriptions(v []*AudioDescription) *EncoderSettings { - s.AudioDescriptions = v - return s +// String returns the string representation +func (s HlsAkamaiSettings) String() string { + return awsutil.Prettify(s) } -// SetAvailBlanking sets the AvailBlanking field's value. -func (s *EncoderSettings) SetAvailBlanking(v *AvailBlanking) *EncoderSettings { - s.AvailBlanking = v - return s +// GoString returns the string representation +func (s HlsAkamaiSettings) GoString() string { + return s.String() } -// SetAvailConfiguration sets the AvailConfiguration field's value. -func (s *EncoderSettings) SetAvailConfiguration(v *AvailConfiguration) *EncoderSettings { - s.AvailConfiguration = v +// SetConnectionRetryInterval sets the ConnectionRetryInterval field's value. +func (s *HlsAkamaiSettings) SetConnectionRetryInterval(v int64) *HlsAkamaiSettings { + s.ConnectionRetryInterval = &v return s } -// SetBlackoutSlate sets the BlackoutSlate field's value. -func (s *EncoderSettings) SetBlackoutSlate(v *BlackoutSlate) *EncoderSettings { - s.BlackoutSlate = v +// SetFilecacheDuration sets the FilecacheDuration field's value. +func (s *HlsAkamaiSettings) SetFilecacheDuration(v int64) *HlsAkamaiSettings { + s.FilecacheDuration = &v return s } -// SetCaptionDescriptions sets the CaptionDescriptions field's value. -func (s *EncoderSettings) SetCaptionDescriptions(v []*CaptionDescription) *EncoderSettings { - s.CaptionDescriptions = v +// SetHttpTransferMode sets the HttpTransferMode field's value. +func (s *HlsAkamaiSettings) SetHttpTransferMode(v string) *HlsAkamaiSettings { + s.HttpTransferMode = &v return s } -// SetGlobalConfiguration sets the GlobalConfiguration field's value. -func (s *EncoderSettings) SetGlobalConfiguration(v *GlobalConfiguration) *EncoderSettings { - s.GlobalConfiguration = v +// SetNumRetries sets the NumRetries field's value. +func (s *HlsAkamaiSettings) SetNumRetries(v int64) *HlsAkamaiSettings { + s.NumRetries = &v return s } -// SetOutputGroups sets the OutputGroups field's value. -func (s *EncoderSettings) SetOutputGroups(v []*OutputGroup) *EncoderSettings { - s.OutputGroups = v +// SetRestartDelay sets the RestartDelay field's value. +func (s *HlsAkamaiSettings) SetRestartDelay(v int64) *HlsAkamaiSettings { + s.RestartDelay = &v return s } -// SetTimecodeConfig sets the TimecodeConfig field's value. -func (s *EncoderSettings) SetTimecodeConfig(v *TimecodeConfig) *EncoderSettings { - s.TimecodeConfig = v +// SetSalt sets the Salt field's value. +func (s *HlsAkamaiSettings) SetSalt(v string) *HlsAkamaiSettings { + s.Salt = &v return s } -// SetVideoDescriptions sets the VideoDescriptions field's value. -func (s *EncoderSettings) SetVideoDescriptions(v []*VideoDescription) *EncoderSettings { - s.VideoDescriptions = v +// SetToken sets the Token field's value. +func (s *HlsAkamaiSettings) SetToken(v string) *HlsAkamaiSettings { + s.Token = &v return s } -// Fec Output Settings -type FecOutputSettings struct { +// Hls Basic Put Settings +type HlsBasicPutSettings struct { _ struct{} `type:"structure"` - // Parameter D from SMPTE 2022-1. The height of the FEC protection matrix. The - // number of transport stream packets per column error correction packet. Must - // be between 4 and 20, inclusive. - ColumnDepth *int64 `locationName:"columnDepth" min:"4" type:"integer"` + // Number of seconds to wait before retrying connection to the CDN if the connection + // is lost. + ConnectionRetryInterval *int64 `locationName:"connectionRetryInterval" type:"integer"` - // Enables column only or column and row based FEC - IncludeFec *string `locationName:"includeFec" type:"string" enum:"FecOutputIncludeFec"` + // Size in seconds of file cache for streaming outputs. + FilecacheDuration *int64 `locationName:"filecacheDuration" type:"integer"` - // Parameter L from SMPTE 2022-1. The width of the FEC protection matrix. Must - // be between 1 and 20, inclusive. If only Column FEC is used, then larger values - // increase robustness. If Row FEC is used, then this is the number of transport - // stream packets per row error correction packet, and the value must be between - // 4 and 20, inclusive, if includeFec is columnAndRow. If includeFec is column, - // this value must be 1 to 20, inclusive. - RowLength *int64 `locationName:"rowLength" min:"1" type:"integer"` + // Number of retry attempts that will be made before the Live Event is put into + // an error state. + NumRetries *int64 `locationName:"numRetries" type:"integer"` + + // If a streaming output fails, number of seconds to wait until a restart is + // initiated. A value of 0 means never restart. + RestartDelay *int64 `locationName:"restartDelay" type:"integer"` } // String returns the string representation -func (s FecOutputSettings) String() string { +func (s HlsBasicPutSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s FecOutputSettings) GoString() string { +func (s HlsBasicPutSettings) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *FecOutputSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FecOutputSettings"} - if s.ColumnDepth != nil && *s.ColumnDepth < 4 { - invalidParams.Add(request.NewErrParamMinValue("ColumnDepth", 4)) - } - if s.RowLength != nil && *s.RowLength < 1 { - invalidParams.Add(request.NewErrParamMinValue("RowLength", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetConnectionRetryInterval sets the ConnectionRetryInterval field's value. +func (s *HlsBasicPutSettings) SetConnectionRetryInterval(v int64) *HlsBasicPutSettings { + s.ConnectionRetryInterval = &v + return s } -// SetColumnDepth sets the ColumnDepth field's value. -func (s *FecOutputSettings) SetColumnDepth(v int64) *FecOutputSettings { - s.ColumnDepth = &v +// SetFilecacheDuration sets the FilecacheDuration field's value. +func (s *HlsBasicPutSettings) SetFilecacheDuration(v int64) *HlsBasicPutSettings { + s.FilecacheDuration = &v return s } -// SetIncludeFec sets the IncludeFec field's value. -func (s *FecOutputSettings) SetIncludeFec(v string) *FecOutputSettings { - s.IncludeFec = &v +// SetNumRetries sets the NumRetries field's value. +func (s *HlsBasicPutSettings) SetNumRetries(v int64) *HlsBasicPutSettings { + s.NumRetries = &v return s } -// SetRowLength sets the RowLength field's value. -func (s *FecOutputSettings) SetRowLength(v int64) *FecOutputSettings { - s.RowLength = &v +// SetRestartDelay sets the RestartDelay field's value. +func (s *HlsBasicPutSettings) SetRestartDelay(v int64) *HlsBasicPutSettings { + s.RestartDelay = &v return s } -// Start time for the action. -type FixedModeScheduleActionStartSettings struct { +// Hls Cdn Settings +type HlsCdnSettings struct { _ struct{} `type:"structure"` - // Start time for the action to start in the channel. (Not the time for the - // action to be added to the schedule: actions are always added to the schedule - // immediately.) UTC format: yyyy-mm-ddThh:mm:ss.nnnZ. All the letters are digits - // (for example, mm might be 01) except for the two constants "T" for time and - // "Z" for "UTC format". - // - // Time is a required field - Time *string `locationName:"time" type:"string" required:"true"` + // Hls Akamai Settings + HlsAkamaiSettings *HlsAkamaiSettings `locationName:"hlsAkamaiSettings" type:"structure"` + + // Hls Basic Put Settings + HlsBasicPutSettings *HlsBasicPutSettings `locationName:"hlsBasicPutSettings" type:"structure"` + + // Hls Media Store Settings + HlsMediaStoreSettings *HlsMediaStoreSettings `locationName:"hlsMediaStoreSettings" type:"structure"` + + // Hls Webdav Settings + HlsWebdavSettings *HlsWebdavSettings `locationName:"hlsWebdavSettings" type:"structure"` } // String returns the string representation -func (s FixedModeScheduleActionStartSettings) String() string { +func (s HlsCdnSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s FixedModeScheduleActionStartSettings) GoString() string { +func (s HlsCdnSettings) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *FixedModeScheduleActionStartSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FixedModeScheduleActionStartSettings"} - if s.Time == nil { - invalidParams.Add(request.NewErrParamRequired("Time")) - } +// SetHlsAkamaiSettings sets the HlsAkamaiSettings field's value. +func (s *HlsCdnSettings) SetHlsAkamaiSettings(v *HlsAkamaiSettings) *HlsCdnSettings { + s.HlsAkamaiSettings = v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetHlsBasicPutSettings sets the HlsBasicPutSettings field's value. +func (s *HlsCdnSettings) SetHlsBasicPutSettings(v *HlsBasicPutSettings) *HlsCdnSettings { + s.HlsBasicPutSettings = v + return s } -// SetTime sets the Time field's value. -func (s *FixedModeScheduleActionStartSettings) SetTime(v string) *FixedModeScheduleActionStartSettings { - s.Time = &v +// SetHlsMediaStoreSettings sets the HlsMediaStoreSettings field's value. +func (s *HlsCdnSettings) SetHlsMediaStoreSettings(v *HlsMediaStoreSettings) *HlsCdnSettings { + s.HlsMediaStoreSettings = v return s } -// Settings to specify if an action follows another. -type FollowModeScheduleActionStartSettings struct { +// SetHlsWebdavSettings sets the HlsWebdavSettings field's value. +func (s *HlsCdnSettings) SetHlsWebdavSettings(v *HlsWebdavSettings) *HlsCdnSettings { + s.HlsWebdavSettings = v + return s +} + +// Hls Group Settings +type HlsGroupSettings struct { _ struct{} `type:"structure"` - // Identifies whether this action starts relative to the start or relative to - // the end of the reference action. - // - // FollowPoint is a required field - FollowPoint *string `locationName:"followPoint" type:"string" required:"true" enum:"FollowPoint"` + // Choose one or more ad marker types to pass SCTE35 signals through to this + // group of Apple HLS outputs. + AdMarkers []*string `locationName:"adMarkers" type:"list"` - // The action name of another action that this one refers to. - // - // ReferenceActionName is a required field - ReferenceActionName *string `locationName:"referenceActionName" type:"string" required:"true"` -} + // A partial URI prefix that will be prepended to each output in the media .m3u8 + // file. Can be used if base manifest is delivered from a different URL than + // the main .m3u8 file. + BaseUrlContent *string `locationName:"baseUrlContent" type:"string"` -// String returns the string representation -func (s FollowModeScheduleActionStartSettings) String() string { - return awsutil.Prettify(s) -} + // Optional. One value per output group.This field is required only if you are + // completing Base URL content A, and the downstream system has notified you + // that the media files for pipeline 1 of all outputs are in a location different + // from the media files for pipeline 0. + BaseUrlContent1 *string `locationName:"baseUrlContent1" type:"string"` -// GoString returns the string representation -func (s FollowModeScheduleActionStartSettings) GoString() string { - return s.String() -} + // A partial URI prefix that will be prepended to each output in the media .m3u8 + // file. Can be used if base manifest is delivered from a different URL than + // the main .m3u8 file. + BaseUrlManifest *string `locationName:"baseUrlManifest" type:"string"` -// Validate inspects the fields of the type to determine if they are valid. -func (s *FollowModeScheduleActionStartSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FollowModeScheduleActionStartSettings"} - if s.FollowPoint == nil { - invalidParams.Add(request.NewErrParamRequired("FollowPoint")) - } - if s.ReferenceActionName == nil { - invalidParams.Add(request.NewErrParamRequired("ReferenceActionName")) - } + // Optional. One value per output group.Complete this field only if you are + // completing Base URL manifest A, and the downstream system has notified you + // that the child manifest files for pipeline 1 of all outputs are in a location + // different from the child manifest files for pipeline 0. + BaseUrlManifest1 *string `locationName:"baseUrlManifest1" type:"string"` - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} + // Mapping of up to 4 caption channels to caption languages. Is only meaningful + // if captionLanguageSetting is set to "insert". + CaptionLanguageMappings []*CaptionLanguageMapping `locationName:"captionLanguageMappings" type:"list"` -// SetFollowPoint sets the FollowPoint field's value. -func (s *FollowModeScheduleActionStartSettings) SetFollowPoint(v string) *FollowModeScheduleActionStartSettings { - s.FollowPoint = &v - return s -} + // Applies only to 608 Embedded output captions.insert: Include CLOSED-CAPTIONS + // lines in the manifest. Specify at least one language in the CC1 Language + // Code field. One CLOSED-CAPTION line is added for each Language Code you specify. + // Make sure to specify the languages in the order in which they appear in the + // original source (if the source is embedded format) or the order of the caption + // selectors (if the source is other than embedded). Otherwise, languages in + // the manifest will not match up properly with the output captions.none: Include + // CLOSED-CAPTIONS=NONE line in the manifest.omit: Omit any CLOSED-CAPTIONS + // line from the manifest. + CaptionLanguageSetting *string `locationName:"captionLanguageSetting" type:"string" enum:"HlsCaptionLanguageSetting"` -// SetReferenceActionName sets the ReferenceActionName field's value. -func (s *FollowModeScheduleActionStartSettings) SetReferenceActionName(v string) *FollowModeScheduleActionStartSettings { - s.ReferenceActionName = &v - return s -} + // When set to "disabled", sets the #EXT-X-ALLOW-CACHE:no tag in the manifest, + // which prevents clients from saving media segments for later replay. + ClientCache *string `locationName:"clientCache" type:"string" enum:"HlsClientCache"` -// Frame Capture Group Settings -type FrameCaptureGroupSettings struct { - _ struct{} `type:"structure"` + // Specification to use (RFC-6381 or the default RFC-4281) during m3u8 playlist + // generation. + CodecSpecification *string `locationName:"codecSpecification" type:"string" enum:"HlsCodecSpecification"` - // The destination for the frame capture files. Either the URI for an Amazon - // S3 bucket and object, plus a file name prefix (for example, s3ssl://sportsDelivery/highlights/20180820/curling_) - // or the URI for a MediaStore container, plus a file name prefix (for example, - // mediastoressl://sportsDelivery/20180820/curling_). The final file names consist - // of the prefix from the destination field (for example, "curling_") + name - // modifier + the counter (5 digits, starting from 00001) + extension (which - // is always .jpg). For example, curlingLow.00001.jpg + // For use with encryptionType. This is a 128-bit, 16-byte hex value represented + // by a 32-character text string. If ivSource is set to "explicit" then this + // parameter is required and is used as the IV for encryption. + ConstantIv *string `locationName:"constantIv" min:"32" type:"string"` + + // A directory or HTTP destination for the HLS segments, manifest files, and + // encryption keys (if enabled). // // Destination is a required field Destination *OutputLocationRef `locationName:"destination" type:"structure" required:"true"` -} -// String returns the string representation -func (s FrameCaptureGroupSettings) String() string { - return awsutil.Prettify(s) -} + // Place segments in subdirectories. + DirectoryStructure *string `locationName:"directoryStructure" type:"string" enum:"HlsDirectoryStructure"` -// GoString returns the string representation -func (s FrameCaptureGroupSettings) GoString() string { - return s.String() -} + // Encrypts the segments with the given encryption scheme. Exclude this parameter + // if no encryption is desired. + EncryptionType *string `locationName:"encryptionType" type:"string" enum:"HlsEncryptionType"` -// Validate inspects the fields of the type to determine if they are valid. -func (s *FrameCaptureGroupSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FrameCaptureGroupSettings"} - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) - } + // Parameters that control interactions with the CDN. + HlsCdnSettings *HlsCdnSettings `locationName:"hlsCdnSettings" type:"structure"` - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} + // State of HLS ID3 Segment Tagging + HlsId3SegmentTagging *string `locationName:"hlsId3SegmentTagging" type:"string" enum:"HlsId3SegmentTaggingState"` -// SetDestination sets the Destination field's value. -func (s *FrameCaptureGroupSettings) SetDestination(v *OutputLocationRef) *FrameCaptureGroupSettings { - s.Destination = v - return s -} + // DISABLED: Do not create an I-frame-only manifest, but do create the master + // and media manifests (according to the Output Selection field).STANDARD: Create + // an I-frame-only manifest for each output that contains video, as well as + // the other manifests (according to the Output Selection field). The I-frame + // manifest contains a #EXT-X-I-FRAMES-ONLY tag to indicate it is I-frame only, + // and one or more #EXT-X-BYTERANGE entries identifying the I-frame position. + // For example, #EXT-X-BYTERANGE:160364@1461888" + IFrameOnlyPlaylists *string `locationName:"iFrameOnlyPlaylists" type:"string" enum:"IFrameOnlyPlaylistType"` -// Frame Capture Output Settings -type FrameCaptureOutputSettings struct { - _ struct{} `type:"structure"` + // Applies only if Mode field is LIVE. Specifies the maximum number of segments + // in the media manifest file. After this maximum, older segments are removed + // from the media manifest. This number must be less than or equal to the Keep + // Segments field. + IndexNSegments *int64 `locationName:"indexNSegments" min:"3" type:"integer"` - // Required if the output group contains more than one output. This modifier - // forms part of the output file name. - NameModifier *string `locationName:"nameModifier" type:"string"` -} + // Parameter that control output group behavior on input loss. + InputLossAction *string `locationName:"inputLossAction" type:"string" enum:"InputLossActionForHlsOut"` -// String returns the string representation -func (s FrameCaptureOutputSettings) String() string { - return awsutil.Prettify(s) -} + // For use with encryptionType. The IV (Initialization Vector) is a 128-bit + // number used in conjunction with the key for encrypting blocks. If set to + // "include", IV is listed in the manifest, otherwise the IV is not in the manifest. + IvInManifest *string `locationName:"ivInManifest" type:"string" enum:"HlsIvInManifest"` -// GoString returns the string representation -func (s FrameCaptureOutputSettings) GoString() string { - return s.String() -} + // For use with encryptionType. The IV (Initialization Vector) is a 128-bit + // number used in conjunction with the key for encrypting blocks. If this setting + // is "followsSegmentNumber", it will cause the IV to change every segment (to + // match the segment number). If this is set to "explicit", you must enter a + // constantIv value. + IvSource *string `locationName:"ivSource" type:"string" enum:"HlsIvSource"` -// SetNameModifier sets the NameModifier field's value. -func (s *FrameCaptureOutputSettings) SetNameModifier(v string) *FrameCaptureOutputSettings { - s.NameModifier = &v - return s -} + // Applies only if Mode field is LIVE. Specifies the number of media segments + // (.ts files) to retain in the destination directory. + KeepSegments *int64 `locationName:"keepSegments" min:"1" type:"integer"` -// Frame Capture Settings -type FrameCaptureSettings struct { - _ struct{} `type:"structure"` + // The value specifies how the key is represented in the resource identified + // by the URI. If parameter is absent, an implicit value of "identity" is used. + // A reverse DNS string can also be given. + KeyFormat *string `locationName:"keyFormat" type:"string"` - // The frequency, in seconds, for capturing frames for inclusion in the output. - // For example, "10" means capture a frame every 10 seconds. - // - // CaptureInterval is a required field - CaptureInterval *int64 `locationName:"captureInterval" min:"1" type:"integer" required:"true"` -} + // Either a single positive integer version value or a slash delimited list + // of version values (1/2/3). + KeyFormatVersions *string `locationName:"keyFormatVersions" type:"string"` -// String returns the string representation -func (s FrameCaptureSettings) String() string { - return awsutil.Prettify(s) -} + // The key provider settings. + KeyProviderSettings *KeyProviderSettings `locationName:"keyProviderSettings" type:"structure"` -// GoString returns the string representation -func (s FrameCaptureSettings) GoString() string { - return s.String() -} + // When set to gzip, compresses HLS playlist. + ManifestCompression *string `locationName:"manifestCompression" type:"string" enum:"HlsManifestCompression"` -// Validate inspects the fields of the type to determine if they are valid. -func (s *FrameCaptureSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FrameCaptureSettings"} - if s.CaptureInterval == nil { - invalidParams.Add(request.NewErrParamRequired("CaptureInterval")) - } - if s.CaptureInterval != nil && *s.CaptureInterval < 1 { - invalidParams.Add(request.NewErrParamMinValue("CaptureInterval", 1)) - } + // Indicates whether the output manifest should use floating point or integer + // values for segment duration. + ManifestDurationFormat *string `locationName:"manifestDurationFormat" type:"string" enum:"HlsManifestDurationFormat"` - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} + // When set, minimumSegmentLength is enforced by looking ahead and back within + // the specified range for a nearby avail and extending the segment size if + // needed. + MinSegmentLength *int64 `locationName:"minSegmentLength" type:"integer"` -// SetCaptureInterval sets the CaptureInterval field's value. -func (s *FrameCaptureSettings) SetCaptureInterval(v int64) *FrameCaptureSettings { - s.CaptureInterval = &v - return s -} + // If "vod", all segments are indexed and kept permanently in the destination + // and manifest. If "live", only the number segments specified in keepSegments + // and indexNSegments are kept; newer segments replace older segments, which + // may prevent players from rewinding all the way to the beginning of the event.VOD + // mode uses HLS EXT-X-PLAYLIST-TYPE of EVENT while the channel is running, + // converting it to a "VOD" type manifest on completion of the stream. + Mode *string `locationName:"mode" type:"string" enum:"HlsMode"` -// Global Configuration -type GlobalConfiguration struct { - _ struct{} `type:"structure"` + // MANIFESTSANDSEGMENTS: Generates manifests (master manifest, if applicable, + // and media manifests) for this output group.SEGMENTSONLY: Does not generate + // any manifests for this output group. + OutputSelection *string `locationName:"outputSelection" type:"string" enum:"HlsOutputSelection"` - // Value to set the initial audio gain for the Live Event. - InitialAudioGain *int64 `locationName:"initialAudioGain" type:"integer"` + // Includes or excludes EXT-X-PROGRAM-DATE-TIME tag in .m3u8 manifest files. + // The value is calculated as follows: either the program date and time are + // initialized using the input timecode source, or the time is initialized using + // the input timecode source and the date is initialized using the timestampOffset. + ProgramDateTime *string `locationName:"programDateTime" type:"string" enum:"HlsProgramDateTime"` - // Indicates the action to take when the current input completes (e.g. end-of-file). - // When switchAndLoopInputs is configured the encoder will restart at the beginning - // of the first input. When "none" is configured the encoder will transcode - // either black, a solid color, or a user specified slate images per the "Input - // Loss Behavior" configuration until the next input switch occurs (which is - // controlled through the Channel Schedule API). - InputEndAction *string `locationName:"inputEndAction" type:"string" enum:"GlobalConfigurationInputEndAction"` + // Period of insertion of EXT-X-PROGRAM-DATE-TIME entry, in seconds. + ProgramDateTimePeriod *int64 `locationName:"programDateTimePeriod" type:"integer"` - // Settings for system actions when input is lost. - InputLossBehavior *InputLossBehavior `locationName:"inputLossBehavior" type:"structure"` + // ENABLED: The master manifest (.m3u8 file) for each pipeline includes information + // about both pipelines: first its own media files, then the media files of + // the other pipeline. This feature allows playout device that support stale + // manifest detection to switch from one manifest to the other, when the current + // manifest seems to be stale. There are still two destinations and two master + // manifests, but both master manifests reference the media files from both + // pipelines.DISABLED: The master manifest (.m3u8 file) for each pipeline includes + // information about its own pipeline only.For an HLS output group with MediaPackage + // as the destination, the DISABLED behavior is always followed. MediaPackage + // regenerates the manifests it serves to players so a redundant manifest from + // MediaLive is irrelevant. + RedundantManifest *string `locationName:"redundantManifest" type:"string" enum:"HlsRedundantManifest"` - // Indicates how MediaLive pipelines are synchronized.PIPELINELOCKING - MediaLive - // will attempt to synchronize the output of each pipeline to the other.EPOCHLOCKING - // - MediaLive will attempt to synchronize the output of each pipeline to the - // Unix epoch. - OutputLockingMode *string `locationName:"outputLockingMode" type:"string" enum:"GlobalConfigurationOutputLockingMode"` + // Length of MPEG-2 Transport Stream segments to create (in seconds). Note that + // segments will end on the next keyframe after this number of seconds, so actual + // segment length may be longer. + SegmentLength *int64 `locationName:"segmentLength" min:"1" type:"integer"` - // Indicates whether the rate of frames emitted by the Live encoder should be - // paced by its system clock (which optionally may be locked to another source - // via NTP) or should be locked to the clock of the source that is providing - // the input stream. - OutputTimingSource *string `locationName:"outputTimingSource" type:"string" enum:"GlobalConfigurationOutputTimingSource"` + // useInputSegmentation has been deprecated. The configured segment size is + // always used. + SegmentationMode *string `locationName:"segmentationMode" type:"string" enum:"HlsSegmentationMode"` - // Adjusts video input buffer for streams with very low video framerates. This - // is commonly set to enabled for music channels with less than one video frame - // per second. - SupportLowFramerateInputs *string `locationName:"supportLowFramerateInputs" type:"string" enum:"GlobalConfigurationLowFramerateInputs"` + // Number of segments to write to a subdirectory before starting a new one. + // directoryStructure must be subdirectoryPerStream for this setting to have + // an effect. + SegmentsPerSubdirectory *int64 `locationName:"segmentsPerSubdirectory" min:"1" type:"integer"` + + // Include or exclude RESOLUTION attribute for video in EXT-X-STREAM-INF tag + // of variant manifest. + StreamInfResolution *string `locationName:"streamInfResolution" type:"string" enum:"HlsStreamInfResolution"` + + // Indicates ID3 frame that has the timecode. + TimedMetadataId3Frame *string `locationName:"timedMetadataId3Frame" type:"string" enum:"HlsTimedMetadataId3Frame"` + + // Timed Metadata interval in seconds. + TimedMetadataId3Period *int64 `locationName:"timedMetadataId3Period" type:"integer"` + + // Provides an extra millisecond delta offset to fine tune the timestamps. + TimestampDeltaMilliseconds *int64 `locationName:"timestampDeltaMilliseconds" type:"integer"` + + // SEGMENTEDFILES: Emit the program as segments - multiple .ts media files.SINGLEFILE: + // Applies only if Mode field is VOD. Emit the program as a single .ts media + // file. The media manifest includes #EXT-X-BYTERANGE tags to index segments + // for playback. A typical use for this value is when sending the output to + // AWS Elemental MediaConvert, which can accept only a single media file. Playback + // while the channel is running is not guaranteed due to HTTP server caching. + TsFileMode *string `locationName:"tsFileMode" type:"string" enum:"HlsTsFileMode"` } // String returns the string representation -func (s GlobalConfiguration) String() string { +func (s HlsGroupSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GlobalConfiguration) GoString() string { +func (s HlsGroupSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GlobalConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GlobalConfiguration"} - if s.InitialAudioGain != nil && *s.InitialAudioGain < -60 { - invalidParams.Add(request.NewErrParamMinValue("InitialAudioGain", -60)) +func (s *HlsGroupSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HlsGroupSettings"} + if s.ConstantIv != nil && len(*s.ConstantIv) < 32 { + invalidParams.Add(request.NewErrParamMinLen("ConstantIv", 32)) } - if s.InputLossBehavior != nil { - if err := s.InputLossBehavior.Validate(); err != nil { - invalidParams.AddNested("InputLossBehavior", err.(request.ErrInvalidParams)) + if s.Destination == nil { + invalidParams.Add(request.NewErrParamRequired("Destination")) + } + if s.IndexNSegments != nil && *s.IndexNSegments < 3 { + invalidParams.Add(request.NewErrParamMinValue("IndexNSegments", 3)) + } + if s.KeepSegments != nil && *s.KeepSegments < 1 { + invalidParams.Add(request.NewErrParamMinValue("KeepSegments", 1)) + } + if s.SegmentLength != nil && *s.SegmentLength < 1 { + invalidParams.Add(request.NewErrParamMinValue("SegmentLength", 1)) + } + if s.SegmentsPerSubdirectory != nil && *s.SegmentsPerSubdirectory < 1 { + invalidParams.Add(request.NewErrParamMinValue("SegmentsPerSubdirectory", 1)) + } + if s.CaptionLanguageMappings != nil { + for i, v := range s.CaptionLanguageMappings { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CaptionLanguageMappings", i), err.(request.ErrInvalidParams)) + } + } + } + if s.KeyProviderSettings != nil { + if err := s.KeyProviderSettings.Validate(); err != nil { + invalidParams.AddNested("KeyProviderSettings", err.(request.ErrInvalidParams)) } } @@ -8841,293 +12487,273 @@ func (s *GlobalConfiguration) Validate() error { return nil } -// SetInitialAudioGain sets the InitialAudioGain field's value. -func (s *GlobalConfiguration) SetInitialAudioGain(v int64) *GlobalConfiguration { - s.InitialAudioGain = &v +// SetAdMarkers sets the AdMarkers field's value. +func (s *HlsGroupSettings) SetAdMarkers(v []*string) *HlsGroupSettings { + s.AdMarkers = v return s } -// SetInputEndAction sets the InputEndAction field's value. -func (s *GlobalConfiguration) SetInputEndAction(v string) *GlobalConfiguration { - s.InputEndAction = &v +// SetBaseUrlContent sets the BaseUrlContent field's value. +func (s *HlsGroupSettings) SetBaseUrlContent(v string) *HlsGroupSettings { + s.BaseUrlContent = &v return s } -// SetInputLossBehavior sets the InputLossBehavior field's value. -func (s *GlobalConfiguration) SetInputLossBehavior(v *InputLossBehavior) *GlobalConfiguration { - s.InputLossBehavior = v +// SetBaseUrlContent1 sets the BaseUrlContent1 field's value. +func (s *HlsGroupSettings) SetBaseUrlContent1(v string) *HlsGroupSettings { + s.BaseUrlContent1 = &v return s } -// SetOutputLockingMode sets the OutputLockingMode field's value. -func (s *GlobalConfiguration) SetOutputLockingMode(v string) *GlobalConfiguration { - s.OutputLockingMode = &v +// SetBaseUrlManifest sets the BaseUrlManifest field's value. +func (s *HlsGroupSettings) SetBaseUrlManifest(v string) *HlsGroupSettings { + s.BaseUrlManifest = &v return s } -// SetOutputTimingSource sets the OutputTimingSource field's value. -func (s *GlobalConfiguration) SetOutputTimingSource(v string) *GlobalConfiguration { - s.OutputTimingSource = &v +// SetBaseUrlManifest1 sets the BaseUrlManifest1 field's value. +func (s *HlsGroupSettings) SetBaseUrlManifest1(v string) *HlsGroupSettings { + s.BaseUrlManifest1 = &v return s } -// SetSupportLowFramerateInputs sets the SupportLowFramerateInputs field's value. -func (s *GlobalConfiguration) SetSupportLowFramerateInputs(v string) *GlobalConfiguration { - s.SupportLowFramerateInputs = &v +// SetCaptionLanguageMappings sets the CaptionLanguageMappings field's value. +func (s *HlsGroupSettings) SetCaptionLanguageMappings(v []*CaptionLanguageMapping) *HlsGroupSettings { + s.CaptionLanguageMappings = v return s } -// H264 Color Space Settings -type H264ColorSpaceSettings struct { - _ struct{} `type:"structure"` - - // Passthrough applies no color space conversion to the output - ColorSpacePassthroughSettings *ColorSpacePassthroughSettings `locationName:"colorSpacePassthroughSettings" type:"structure"` - - // Rec601 Settings - Rec601Settings *Rec601Settings `locationName:"rec601Settings" type:"structure"` - - // Rec709 Settings - Rec709Settings *Rec709Settings `locationName:"rec709Settings" type:"structure"` +// SetCaptionLanguageSetting sets the CaptionLanguageSetting field's value. +func (s *HlsGroupSettings) SetCaptionLanguageSetting(v string) *HlsGroupSettings { + s.CaptionLanguageSetting = &v + return s } -// String returns the string representation -func (s H264ColorSpaceSettings) String() string { - return awsutil.Prettify(s) +// SetClientCache sets the ClientCache field's value. +func (s *HlsGroupSettings) SetClientCache(v string) *HlsGroupSettings { + s.ClientCache = &v + return s } -// GoString returns the string representation -func (s H264ColorSpaceSettings) GoString() string { - return s.String() +// SetCodecSpecification sets the CodecSpecification field's value. +func (s *HlsGroupSettings) SetCodecSpecification(v string) *HlsGroupSettings { + s.CodecSpecification = &v + return s } -// SetColorSpacePassthroughSettings sets the ColorSpacePassthroughSettings field's value. -func (s *H264ColorSpaceSettings) SetColorSpacePassthroughSettings(v *ColorSpacePassthroughSettings) *H264ColorSpaceSettings { - s.ColorSpacePassthroughSettings = v +// SetConstantIv sets the ConstantIv field's value. +func (s *HlsGroupSettings) SetConstantIv(v string) *HlsGroupSettings { + s.ConstantIv = &v return s } -// SetRec601Settings sets the Rec601Settings field's value. -func (s *H264ColorSpaceSettings) SetRec601Settings(v *Rec601Settings) *H264ColorSpaceSettings { - s.Rec601Settings = v +// SetDestination sets the Destination field's value. +func (s *HlsGroupSettings) SetDestination(v *OutputLocationRef) *HlsGroupSettings { + s.Destination = v return s } -// SetRec709Settings sets the Rec709Settings field's value. -func (s *H264ColorSpaceSettings) SetRec709Settings(v *Rec709Settings) *H264ColorSpaceSettings { - s.Rec709Settings = v +// SetDirectoryStructure sets the DirectoryStructure field's value. +func (s *HlsGroupSettings) SetDirectoryStructure(v string) *HlsGroupSettings { + s.DirectoryStructure = &v return s } -// H264 Settings -type H264Settings struct { - _ struct{} `type:"structure"` - - // Adaptive quantization. Allows intra-frame quantizers to vary to improve visual - // quality. - AdaptiveQuantization *string `locationName:"adaptiveQuantization" type:"string" enum:"H264AdaptiveQuantization"` - - // Indicates that AFD values will be written into the output stream. If afdSignaling - // is "auto", the system will try to preserve the input AFD value (in cases - // where multiple AFD values are valid). If set to "fixed", the AFD value will - // be the value configured in the fixedAfd parameter. - AfdSignaling *string `locationName:"afdSignaling" type:"string" enum:"AfdSignaling"` - - // Average bitrate in bits/second. Required when the rate control mode is VBR - // or CBR. Not used for QVBR. In an MS Smooth output group, each output must - // have a unique value when its bitrate is rounded down to the nearest multiple - // of 1000. - Bitrate *int64 `locationName:"bitrate" min:"1000" type:"integer"` - - // Percentage of the buffer that should initially be filled (HRD buffer model). - BufFillPct *int64 `locationName:"bufFillPct" type:"integer"` - - // Size of buffer (HRD buffer model) in bits. - BufSize *int64 `locationName:"bufSize" type:"integer"` - - // Includes colorspace metadata in the output. - ColorMetadata *string `locationName:"colorMetadata" type:"string" enum:"H264ColorMetadata"` - - // Color Space settings - ColorSpaceSettings *H264ColorSpaceSettings `locationName:"colorSpaceSettings" type:"structure"` - - // Entropy encoding mode. Use cabac (must be in Main or High profile) or cavlc. - EntropyEncoding *string `locationName:"entropyEncoding" type:"string" enum:"H264EntropyEncoding"` - - // Four bit AFD value to write on all frames of video in the output stream. - // Only valid when afdSignaling is set to 'Fixed'. - FixedAfd *string `locationName:"fixedAfd" type:"string" enum:"FixedAfd"` +// SetEncryptionType sets the EncryptionType field's value. +func (s *HlsGroupSettings) SetEncryptionType(v string) *HlsGroupSettings { + s.EncryptionType = &v + return s +} - // If set to enabled, adjust quantization within each frame to reduce flicker - // or 'pop' on I-frames. - FlickerAq *string `locationName:"flickerAq" type:"string" enum:"H264FlickerAq"` +// SetHlsCdnSettings sets the HlsCdnSettings field's value. +func (s *HlsGroupSettings) SetHlsCdnSettings(v *HlsCdnSettings) *HlsGroupSettings { + s.HlsCdnSettings = v + return s +} - // This field indicates how the output video frame rate is specified. If "specified" - // is selected then the output video frame rate is determined by framerateNumerator - // and framerateDenominator, else if "initializeFromSource" is selected then - // the output video frame rate will be set equal to the input video frame rate - // of the first input. - FramerateControl *string `locationName:"framerateControl" type:"string" enum:"H264FramerateControl"` +// SetHlsId3SegmentTagging sets the HlsId3SegmentTagging field's value. +func (s *HlsGroupSettings) SetHlsId3SegmentTagging(v string) *HlsGroupSettings { + s.HlsId3SegmentTagging = &v + return s +} - // Framerate denominator. - FramerateDenominator *int64 `locationName:"framerateDenominator" min:"1" type:"integer"` +// SetIFrameOnlyPlaylists sets the IFrameOnlyPlaylists field's value. +func (s *HlsGroupSettings) SetIFrameOnlyPlaylists(v string) *HlsGroupSettings { + s.IFrameOnlyPlaylists = &v + return s +} - // Framerate numerator - framerate is a fraction, e.g. 24000 / 1001 = 23.976 - // fps. - FramerateNumerator *int64 `locationName:"framerateNumerator" min:"1" type:"integer"` +// SetIndexNSegments sets the IndexNSegments field's value. +func (s *HlsGroupSettings) SetIndexNSegments(v int64) *HlsGroupSettings { + s.IndexNSegments = &v + return s +} - // If enabled, use reference B frames for GOP structures that have B frames - // > 1. - GopBReference *string `locationName:"gopBReference" type:"string" enum:"H264GopBReference"` +// SetInputLossAction sets the InputLossAction field's value. +func (s *HlsGroupSettings) SetInputLossAction(v string) *HlsGroupSettings { + s.InputLossAction = &v + return s +} - // Frequency of closed GOPs. In streaming applications, it is recommended that - // this be set to 1 so a decoder joining mid-stream will receive an IDR frame - // as quickly as possible. Setting this value to 0 will break output segmenting. - GopClosedCadence *int64 `locationName:"gopClosedCadence" type:"integer"` +// SetIvInManifest sets the IvInManifest field's value. +func (s *HlsGroupSettings) SetIvInManifest(v string) *HlsGroupSettings { + s.IvInManifest = &v + return s +} - // Number of B-frames between reference frames. - GopNumBFrames *int64 `locationName:"gopNumBFrames" type:"integer"` +// SetIvSource sets the IvSource field's value. +func (s *HlsGroupSettings) SetIvSource(v string) *HlsGroupSettings { + s.IvSource = &v + return s +} - // GOP size (keyframe interval) in units of either frames or seconds per gopSizeUnits. - // Must be greater than zero. - GopSize *float64 `locationName:"gopSize" type:"double"` +// SetKeepSegments sets the KeepSegments field's value. +func (s *HlsGroupSettings) SetKeepSegments(v int64) *HlsGroupSettings { + s.KeepSegments = &v + return s +} - // Indicates if the gopSize is specified in frames or seconds. If seconds the - // system will convert the gopSize into a frame count at run time. - GopSizeUnits *string `locationName:"gopSizeUnits" type:"string" enum:"H264GopSizeUnits"` +// SetKeyFormat sets the KeyFormat field's value. +func (s *HlsGroupSettings) SetKeyFormat(v string) *HlsGroupSettings { + s.KeyFormat = &v + return s +} - // H.264 Level. - Level *string `locationName:"level" type:"string" enum:"H264Level"` +// SetKeyFormatVersions sets the KeyFormatVersions field's value. +func (s *HlsGroupSettings) SetKeyFormatVersions(v string) *HlsGroupSettings { + s.KeyFormatVersions = &v + return s +} - // Amount of lookahead. A value of low can decrease latency and memory usage, - // while high can produce better quality for certain content. - LookAheadRateControl *string `locationName:"lookAheadRateControl" type:"string" enum:"H264LookAheadRateControl"` +// SetKeyProviderSettings sets the KeyProviderSettings field's value. +func (s *HlsGroupSettings) SetKeyProviderSettings(v *KeyProviderSettings) *HlsGroupSettings { + s.KeyProviderSettings = v + return s +} - // For QVBR: See the tooltip for Quality levelFor VBR: Set the maximum bitrate - // in order to accommodate expected spikes in the complexity of the video. - MaxBitrate *int64 `locationName:"maxBitrate" min:"1000" type:"integer"` +// SetManifestCompression sets the ManifestCompression field's value. +func (s *HlsGroupSettings) SetManifestCompression(v string) *HlsGroupSettings { + s.ManifestCompression = &v + return s +} - // Only meaningful if sceneChangeDetect is set to enabled. Enforces separation - // between repeated (cadence) I-frames and I-frames inserted by Scene Change - // Detection. If a scene change I-frame is within I-interval frames of a cadence - // I-frame, the GOP is shrunk and/or stretched to the scene change I-frame. - // GOP stretch requires enabling lookahead as well as setting I-interval. The - // normal cadence resumes for the next GOP. Note: Maximum GOP stretch = GOP - // size + Min-I-interval - 1 - MinIInterval *int64 `locationName:"minIInterval" type:"integer"` +// SetManifestDurationFormat sets the ManifestDurationFormat field's value. +func (s *HlsGroupSettings) SetManifestDurationFormat(v string) *HlsGroupSettings { + s.ManifestDurationFormat = &v + return s +} - // Number of reference frames to use. The encoder may use more than requested - // if using B-frames and/or interlaced encoding. - NumRefFrames *int64 `locationName:"numRefFrames" min:"1" type:"integer"` +// SetMinSegmentLength sets the MinSegmentLength field's value. +func (s *HlsGroupSettings) SetMinSegmentLength(v int64) *HlsGroupSettings { + s.MinSegmentLength = &v + return s +} - // This field indicates how the output pixel aspect ratio is specified. If "specified" - // is selected then the output video pixel aspect ratio is determined by parNumerator - // and parDenominator, else if "initializeFromSource" is selected then the output - // pixsel aspect ratio will be set equal to the input video pixel aspect ratio - // of the first input. - ParControl *string `locationName:"parControl" type:"string" enum:"H264ParControl"` +// SetMode sets the Mode field's value. +func (s *HlsGroupSettings) SetMode(v string) *HlsGroupSettings { + s.Mode = &v + return s +} - // Pixel Aspect Ratio denominator. - ParDenominator *int64 `locationName:"parDenominator" min:"1" type:"integer"` +// SetOutputSelection sets the OutputSelection field's value. +func (s *HlsGroupSettings) SetOutputSelection(v string) *HlsGroupSettings { + s.OutputSelection = &v + return s +} - // Pixel Aspect Ratio numerator. - ParNumerator *int64 `locationName:"parNumerator" type:"integer"` +// SetProgramDateTime sets the ProgramDateTime field's value. +func (s *HlsGroupSettings) SetProgramDateTime(v string) *HlsGroupSettings { + s.ProgramDateTime = &v + return s +} - // H.264 Profile. - Profile *string `locationName:"profile" type:"string" enum:"H264Profile"` +// SetProgramDateTimePeriod sets the ProgramDateTimePeriod field's value. +func (s *HlsGroupSettings) SetProgramDateTimePeriod(v int64) *HlsGroupSettings { + s.ProgramDateTimePeriod = &v + return s +} - // Controls the target quality for the video encode. Applies only when the rate - // control mode is QVBR. Set values for the QVBR quality level field and Max - // bitrate field that suit your most important viewing devices. Recommended - // values are:- Primary screen: Quality level: 8 to 10. Max bitrate: 4M- PC - // or tablet: Quality level: 7. Max bitrate: 1.5M to 3M- Smartphone: Quality - // level: 6. Max bitrate: 1M to 1.5M - QvbrQualityLevel *int64 `locationName:"qvbrQualityLevel" min:"1" type:"integer"` +// SetRedundantManifest sets the RedundantManifest field's value. +func (s *HlsGroupSettings) SetRedundantManifest(v string) *HlsGroupSettings { + s.RedundantManifest = &v + return s +} - // Rate control mode.QVBR: Quality will match the specified quality level except - // when it is constrained by themaximum bitrate. Recommended if you or your - // viewers pay for bandwidth.VBR: Quality and bitrate vary, depending on the - // video complexity. Recommended instead of QVBRif you want to maintain a specific - // average bitrate over the duration of the channel.CBR: Quality varies, depending - // on the video complexity. Recommended only if you distributeyour assets to - // devices that cannot handle variable bitrates. - RateControlMode *string `locationName:"rateControlMode" type:"string" enum:"H264RateControlMode"` +// SetSegmentLength sets the SegmentLength field's value. +func (s *HlsGroupSettings) SetSegmentLength(v int64) *HlsGroupSettings { + s.SegmentLength = &v + return s +} - // Sets the scan type of the output to progressive or top-field-first interlaced. - ScanType *string `locationName:"scanType" type:"string" enum:"H264ScanType"` +// SetSegmentationMode sets the SegmentationMode field's value. +func (s *HlsGroupSettings) SetSegmentationMode(v string) *HlsGroupSettings { + s.SegmentationMode = &v + return s +} - // Scene change detection.- On: inserts I-frames when scene change is detected.- - // Off: does not force an I-frame when scene change is detected. - SceneChangeDetect *string `locationName:"sceneChangeDetect" type:"string" enum:"H264SceneChangeDetect"` +// SetSegmentsPerSubdirectory sets the SegmentsPerSubdirectory field's value. +func (s *HlsGroupSettings) SetSegmentsPerSubdirectory(v int64) *HlsGroupSettings { + s.SegmentsPerSubdirectory = &v + return s +} - // Number of slices per picture. Must be less than or equal to the number of - // macroblock rows for progressive pictures, and less than or equal to half - // the number of macroblock rows for interlaced pictures.This field is optional; - // when no value is specified the encoder will choose the number of slices based - // on encode resolution. - Slices *int64 `locationName:"slices" min:"1" type:"integer"` +// SetStreamInfResolution sets the StreamInfResolution field's value. +func (s *HlsGroupSettings) SetStreamInfResolution(v string) *HlsGroupSettings { + s.StreamInfResolution = &v + return s +} - // Softness. Selects quantizer matrix, larger values reduce high-frequency content - // in the encoded image. - Softness *int64 `locationName:"softness" type:"integer"` +// SetTimedMetadataId3Frame sets the TimedMetadataId3Frame field's value. +func (s *HlsGroupSettings) SetTimedMetadataId3Frame(v string) *HlsGroupSettings { + s.TimedMetadataId3Frame = &v + return s +} - // If set to enabled, adjust quantization within each frame based on spatial - // variation of content complexity. - SpatialAq *string `locationName:"spatialAq" type:"string" enum:"H264SpatialAq"` +// SetTimedMetadataId3Period sets the TimedMetadataId3Period field's value. +func (s *HlsGroupSettings) SetTimedMetadataId3Period(v int64) *HlsGroupSettings { + s.TimedMetadataId3Period = &v + return s +} - // If set to fixed, use gopNumBFrames B-frames per sub-GOP. If set to dynamic, - // optimize the number of B-frames used for each sub-GOP to improve visual quality. - SubgopLength *string `locationName:"subgopLength" type:"string" enum:"H264SubGopLength"` +// SetTimestampDeltaMilliseconds sets the TimestampDeltaMilliseconds field's value. +func (s *HlsGroupSettings) SetTimestampDeltaMilliseconds(v int64) *HlsGroupSettings { + s.TimestampDeltaMilliseconds = &v + return s +} - // Produces a bitstream compliant with SMPTE RP-2027. - Syntax *string `locationName:"syntax" type:"string" enum:"H264Syntax"` +// SetTsFileMode sets the TsFileMode field's value. +func (s *HlsGroupSettings) SetTsFileMode(v string) *HlsGroupSettings { + s.TsFileMode = &v + return s +} - // If set to enabled, adjust quantization within each frame based on temporal - // variation of content complexity. - TemporalAq *string `locationName:"temporalAq" type:"string" enum:"H264TemporalAq"` +// Settings for the action to insert a user-defined ID3 tag in each HLS segment +type HlsId3SegmentTaggingScheduleActionSettings struct { + _ struct{} `type:"structure"` - // Determines how timecodes should be inserted into the video elementary stream.- - // 'disabled': Do not include timecodes- 'picTimingSei': Pass through picture - // timing SEI messages from the source specified in Timecode Config - TimecodeInsertion *string `locationName:"timecodeInsertion" type:"string" enum:"H264TimecodeInsertionBehavior"` + // ID3 tag to insert into each segment. Supports special keyword identifiers + // to substitute in segment-related values.\nSupported keyword identifiers: + // https://docs.aws.amazon.com/medialive/latest/ug/variable-data-identifiers.html + // + // Tag is a required field + Tag *string `locationName:"tag" type:"string" required:"true"` } // String returns the string representation -func (s H264Settings) String() string { +func (s HlsId3SegmentTaggingScheduleActionSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s H264Settings) GoString() string { +func (s HlsId3SegmentTaggingScheduleActionSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *H264Settings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "H264Settings"} - if s.Bitrate != nil && *s.Bitrate < 1000 { - invalidParams.Add(request.NewErrParamMinValue("Bitrate", 1000)) - } - if s.FramerateDenominator != nil && *s.FramerateDenominator < 1 { - invalidParams.Add(request.NewErrParamMinValue("FramerateDenominator", 1)) - } - if s.FramerateNumerator != nil && *s.FramerateNumerator < 1 { - invalidParams.Add(request.NewErrParamMinValue("FramerateNumerator", 1)) - } - if s.MaxBitrate != nil && *s.MaxBitrate < 1000 { - invalidParams.Add(request.NewErrParamMinValue("MaxBitrate", 1000)) - } - if s.NumRefFrames != nil && *s.NumRefFrames < 1 { - invalidParams.Add(request.NewErrParamMinValue("NumRefFrames", 1)) - } - if s.ParDenominator != nil && *s.ParDenominator < 1 { - invalidParams.Add(request.NewErrParamMinValue("ParDenominator", 1)) - } - if s.QvbrQualityLevel != nil && *s.QvbrQualityLevel < 1 { - invalidParams.Add(request.NewErrParamMinValue("QvbrQualityLevel", 1)) - } - if s.Slices != nil && *s.Slices < 1 { - invalidParams.Add(request.NewErrParamMinValue("Slices", 1)) +func (s *HlsId3SegmentTaggingScheduleActionSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HlsId3SegmentTaggingScheduleActionSettings"} + if s.Tag == nil { + invalidParams.Add(request.NewErrParamRequired("Tag")) } if invalidParams.Len() > 0 { @@ -9136,1095 +12762,929 @@ func (s *H264Settings) Validate() error { return nil } -// SetAdaptiveQuantization sets the AdaptiveQuantization field's value. -func (s *H264Settings) SetAdaptiveQuantization(v string) *H264Settings { - s.AdaptiveQuantization = &v +// SetTag sets the Tag field's value. +func (s *HlsId3SegmentTaggingScheduleActionSettings) SetTag(v string) *HlsId3SegmentTaggingScheduleActionSettings { + s.Tag = &v return s } -// SetAfdSignaling sets the AfdSignaling field's value. -func (s *H264Settings) SetAfdSignaling(v string) *H264Settings { - s.AfdSignaling = &v +// Hls Input Settings +type HlsInputSettings struct { + _ struct{} `type:"structure"` + + // When specified the HLS stream with the m3u8 BANDWIDTH that most closely matches + // this value will be chosen, otherwise the highest bandwidth stream in the + // m3u8 will be chosen. The bitrate is specified in bits per second, as in an + // HLS manifest. + Bandwidth *int64 `locationName:"bandwidth" type:"integer"` + + // When specified, reading of the HLS input will begin this many buffer segments + // from the end (most recently written segment). When not specified, the HLS + // input will begin with the first segment specified in the m3u8. + BufferSegments *int64 `locationName:"bufferSegments" type:"integer"` + + // The number of consecutive times that attempts to read a manifest or segment + // must fail before the input is considered unavailable. + Retries *int64 `locationName:"retries" type:"integer"` + + // The number of seconds between retries when an attempt to read a manifest + // or segment fails. + RetryInterval *int64 `locationName:"retryInterval" type:"integer"` +} + +// String returns the string representation +func (s HlsInputSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HlsInputSettings) GoString() string { + return s.String() +} + +// SetBandwidth sets the Bandwidth field's value. +func (s *HlsInputSettings) SetBandwidth(v int64) *HlsInputSettings { + s.Bandwidth = &v return s } -// SetBitrate sets the Bitrate field's value. -func (s *H264Settings) SetBitrate(v int64) *H264Settings { - s.Bitrate = &v +// SetBufferSegments sets the BufferSegments field's value. +func (s *HlsInputSettings) SetBufferSegments(v int64) *HlsInputSettings { + s.BufferSegments = &v return s } -// SetBufFillPct sets the BufFillPct field's value. -func (s *H264Settings) SetBufFillPct(v int64) *H264Settings { - s.BufFillPct = &v +// SetRetries sets the Retries field's value. +func (s *HlsInputSettings) SetRetries(v int64) *HlsInputSettings { + s.Retries = &v + return s +} + +// SetRetryInterval sets the RetryInterval field's value. +func (s *HlsInputSettings) SetRetryInterval(v int64) *HlsInputSettings { + s.RetryInterval = &v return s } -// SetBufSize sets the BufSize field's value. -func (s *H264Settings) SetBufSize(v int64) *H264Settings { - s.BufSize = &v - return s +// Hls Media Store Settings +type HlsMediaStoreSettings struct { + _ struct{} `type:"structure"` + + // Number of seconds to wait before retrying connection to the CDN if the connection + // is lost. + ConnectionRetryInterval *int64 `locationName:"connectionRetryInterval" type:"integer"` + + // Size in seconds of file cache for streaming outputs. + FilecacheDuration *int64 `locationName:"filecacheDuration" type:"integer"` + + // When set to temporal, output files are stored in non-persistent memory for + // faster reading and writing. + MediaStoreStorageClass *string `locationName:"mediaStoreStorageClass" type:"string" enum:"HlsMediaStoreStorageClass"` + + // Number of retry attempts that will be made before the Live Event is put into + // an error state. + NumRetries *int64 `locationName:"numRetries" type:"integer"` + + // If a streaming output fails, number of seconds to wait until a restart is + // initiated. A value of 0 means never restart. + RestartDelay *int64 `locationName:"restartDelay" type:"integer"` +} + +// String returns the string representation +func (s HlsMediaStoreSettings) String() string { + return awsutil.Prettify(s) } -// SetColorMetadata sets the ColorMetadata field's value. -func (s *H264Settings) SetColorMetadata(v string) *H264Settings { - s.ColorMetadata = &v - return s +// GoString returns the string representation +func (s HlsMediaStoreSettings) GoString() string { + return s.String() } -// SetColorSpaceSettings sets the ColorSpaceSettings field's value. -func (s *H264Settings) SetColorSpaceSettings(v *H264ColorSpaceSettings) *H264Settings { - s.ColorSpaceSettings = v +// SetConnectionRetryInterval sets the ConnectionRetryInterval field's value. +func (s *HlsMediaStoreSettings) SetConnectionRetryInterval(v int64) *HlsMediaStoreSettings { + s.ConnectionRetryInterval = &v return s } -// SetEntropyEncoding sets the EntropyEncoding field's value. -func (s *H264Settings) SetEntropyEncoding(v string) *H264Settings { - s.EntropyEncoding = &v +// SetFilecacheDuration sets the FilecacheDuration field's value. +func (s *HlsMediaStoreSettings) SetFilecacheDuration(v int64) *HlsMediaStoreSettings { + s.FilecacheDuration = &v return s } -// SetFixedAfd sets the FixedAfd field's value. -func (s *H264Settings) SetFixedAfd(v string) *H264Settings { - s.FixedAfd = &v +// SetMediaStoreStorageClass sets the MediaStoreStorageClass field's value. +func (s *HlsMediaStoreSettings) SetMediaStoreStorageClass(v string) *HlsMediaStoreSettings { + s.MediaStoreStorageClass = &v return s } -// SetFlickerAq sets the FlickerAq field's value. -func (s *H264Settings) SetFlickerAq(v string) *H264Settings { - s.FlickerAq = &v +// SetNumRetries sets the NumRetries field's value. +func (s *HlsMediaStoreSettings) SetNumRetries(v int64) *HlsMediaStoreSettings { + s.NumRetries = &v return s } -// SetFramerateControl sets the FramerateControl field's value. -func (s *H264Settings) SetFramerateControl(v string) *H264Settings { - s.FramerateControl = &v +// SetRestartDelay sets the RestartDelay field's value. +func (s *HlsMediaStoreSettings) SetRestartDelay(v int64) *HlsMediaStoreSettings { + s.RestartDelay = &v return s } -// SetFramerateDenominator sets the FramerateDenominator field's value. -func (s *H264Settings) SetFramerateDenominator(v int64) *H264Settings { - s.FramerateDenominator = &v - return s -} +// Hls Output Settings +type HlsOutputSettings struct { + _ struct{} `type:"structure"` -// SetFramerateNumerator sets the FramerateNumerator field's value. -func (s *H264Settings) SetFramerateNumerator(v int64) *H264Settings { - s.FramerateNumerator = &v - return s -} + // Only applicable when this output is referencing an H.265 video description.Specifies + // whether MP4 segments should be packaged as HEV1 or HVC1. + H265PackagingType *string `locationName:"h265PackagingType" type:"string" enum:"HlsH265PackagingType"` -// SetGopBReference sets the GopBReference field's value. -func (s *H264Settings) SetGopBReference(v string) *H264Settings { - s.GopBReference = &v - return s -} + // Settings regarding the underlying stream. These settings are different for + // audio-only outputs. + // + // HlsSettings is a required field + HlsSettings *HlsSettings `locationName:"hlsSettings" type:"structure" required:"true"` -// SetGopClosedCadence sets the GopClosedCadence field's value. -func (s *H264Settings) SetGopClosedCadence(v int64) *H264Settings { - s.GopClosedCadence = &v - return s -} + // String concatenated to the end of the destination filename. Accepts \"Format + // Identifiers\":#formatIdentifierParameters. + NameModifier *string `locationName:"nameModifier" min:"1" type:"string"` -// SetGopNumBFrames sets the GopNumBFrames field's value. -func (s *H264Settings) SetGopNumBFrames(v int64) *H264Settings { - s.GopNumBFrames = &v - return s + // String concatenated to end of segment filenames. + SegmentModifier *string `locationName:"segmentModifier" type:"string"` } -// SetGopSize sets the GopSize field's value. -func (s *H264Settings) SetGopSize(v float64) *H264Settings { - s.GopSize = &v - return s +// String returns the string representation +func (s HlsOutputSettings) String() string { + return awsutil.Prettify(s) } -// SetGopSizeUnits sets the GopSizeUnits field's value. -func (s *H264Settings) SetGopSizeUnits(v string) *H264Settings { - s.GopSizeUnits = &v - return s +// GoString returns the string representation +func (s HlsOutputSettings) GoString() string { + return s.String() } -// SetLevel sets the Level field's value. -func (s *H264Settings) SetLevel(v string) *H264Settings { - s.Level = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *HlsOutputSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HlsOutputSettings"} + if s.HlsSettings == nil { + invalidParams.Add(request.NewErrParamRequired("HlsSettings")) + } + if s.NameModifier != nil && len(*s.NameModifier) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NameModifier", 1)) + } + if s.HlsSettings != nil { + if err := s.HlsSettings.Validate(); err != nil { + invalidParams.AddNested("HlsSettings", err.(request.ErrInvalidParams)) + } + } -// SetLookAheadRateControl sets the LookAheadRateControl field's value. -func (s *H264Settings) SetLookAheadRateControl(v string) *H264Settings { - s.LookAheadRateControl = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetMaxBitrate sets the MaxBitrate field's value. -func (s *H264Settings) SetMaxBitrate(v int64) *H264Settings { - s.MaxBitrate = &v +// SetH265PackagingType sets the H265PackagingType field's value. +func (s *HlsOutputSettings) SetH265PackagingType(v string) *HlsOutputSettings { + s.H265PackagingType = &v return s } -// SetMinIInterval sets the MinIInterval field's value. -func (s *H264Settings) SetMinIInterval(v int64) *H264Settings { - s.MinIInterval = &v +// SetHlsSettings sets the HlsSettings field's value. +func (s *HlsOutputSettings) SetHlsSettings(v *HlsSettings) *HlsOutputSettings { + s.HlsSettings = v return s } -// SetNumRefFrames sets the NumRefFrames field's value. -func (s *H264Settings) SetNumRefFrames(v int64) *H264Settings { - s.NumRefFrames = &v +// SetNameModifier sets the NameModifier field's value. +func (s *HlsOutputSettings) SetNameModifier(v string) *HlsOutputSettings { + s.NameModifier = &v return s } -// SetParControl sets the ParControl field's value. -func (s *H264Settings) SetParControl(v string) *H264Settings { - s.ParControl = &v +// SetSegmentModifier sets the SegmentModifier field's value. +func (s *HlsOutputSettings) SetSegmentModifier(v string) *HlsOutputSettings { + s.SegmentModifier = &v return s } -// SetParDenominator sets the ParDenominator field's value. -func (s *H264Settings) SetParDenominator(v int64) *H264Settings { - s.ParDenominator = &v - return s -} +// Hls Settings +type HlsSettings struct { + _ struct{} `type:"structure"` -// SetParNumerator sets the ParNumerator field's value. -func (s *H264Settings) SetParNumerator(v int64) *H264Settings { - s.ParNumerator = &v - return s -} + // Audio Only Hls Settings + AudioOnlyHlsSettings *AudioOnlyHlsSettings `locationName:"audioOnlyHlsSettings" type:"structure"` -// SetProfile sets the Profile field's value. -func (s *H264Settings) SetProfile(v string) *H264Settings { - s.Profile = &v - return s + // Fmp4 Hls Settings + Fmp4HlsSettings *Fmp4HlsSettings `locationName:"fmp4HlsSettings" type:"structure"` + + // Standard Hls Settings + StandardHlsSettings *StandardHlsSettings `locationName:"standardHlsSettings" type:"structure"` } -// SetQvbrQualityLevel sets the QvbrQualityLevel field's value. -func (s *H264Settings) SetQvbrQualityLevel(v int64) *H264Settings { - s.QvbrQualityLevel = &v - return s +// String returns the string representation +func (s HlsSettings) String() string { + return awsutil.Prettify(s) } -// SetRateControlMode sets the RateControlMode field's value. -func (s *H264Settings) SetRateControlMode(v string) *H264Settings { - s.RateControlMode = &v - return s +// GoString returns the string representation +func (s HlsSettings) GoString() string { + return s.String() } -// SetScanType sets the ScanType field's value. -func (s *H264Settings) SetScanType(v string) *H264Settings { - s.ScanType = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *HlsSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HlsSettings"} + if s.AudioOnlyHlsSettings != nil { + if err := s.AudioOnlyHlsSettings.Validate(); err != nil { + invalidParams.AddNested("AudioOnlyHlsSettings", err.(request.ErrInvalidParams)) + } + } + if s.StandardHlsSettings != nil { + if err := s.StandardHlsSettings.Validate(); err != nil { + invalidParams.AddNested("StandardHlsSettings", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetSceneChangeDetect sets the SceneChangeDetect field's value. -func (s *H264Settings) SetSceneChangeDetect(v string) *H264Settings { - s.SceneChangeDetect = &v +// SetAudioOnlyHlsSettings sets the AudioOnlyHlsSettings field's value. +func (s *HlsSettings) SetAudioOnlyHlsSettings(v *AudioOnlyHlsSettings) *HlsSettings { + s.AudioOnlyHlsSettings = v return s } -// SetSlices sets the Slices field's value. -func (s *H264Settings) SetSlices(v int64) *H264Settings { - s.Slices = &v +// SetFmp4HlsSettings sets the Fmp4HlsSettings field's value. +func (s *HlsSettings) SetFmp4HlsSettings(v *Fmp4HlsSettings) *HlsSettings { + s.Fmp4HlsSettings = v return s } -// SetSoftness sets the Softness field's value. -func (s *H264Settings) SetSoftness(v int64) *H264Settings { - s.Softness = &v +// SetStandardHlsSettings sets the StandardHlsSettings field's value. +func (s *HlsSettings) SetStandardHlsSettings(v *StandardHlsSettings) *HlsSettings { + s.StandardHlsSettings = v return s } -// SetSpatialAq sets the SpatialAq field's value. -func (s *H264Settings) SetSpatialAq(v string) *H264Settings { - s.SpatialAq = &v - return s +// Settings for the action to emit HLS metadata +type HlsTimedMetadataScheduleActionSettings struct { + _ struct{} `type:"structure"` + + // Base64 string formatted according to the ID3 specification: http://id3.org/id3v2.4.0-structure + // + // Id3 is a required field + Id3 *string `locationName:"id3" type:"string" required:"true"` } -// SetSubgopLength sets the SubgopLength field's value. -func (s *H264Settings) SetSubgopLength(v string) *H264Settings { - s.SubgopLength = &v - return s +// String returns the string representation +func (s HlsTimedMetadataScheduleActionSettings) String() string { + return awsutil.Prettify(s) } -// SetSyntax sets the Syntax field's value. -func (s *H264Settings) SetSyntax(v string) *H264Settings { - s.Syntax = &v - return s +// GoString returns the string representation +func (s HlsTimedMetadataScheduleActionSettings) GoString() string { + return s.String() } -// SetTemporalAq sets the TemporalAq field's value. -func (s *H264Settings) SetTemporalAq(v string) *H264Settings { - s.TemporalAq = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *HlsTimedMetadataScheduleActionSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HlsTimedMetadataScheduleActionSettings"} + if s.Id3 == nil { + invalidParams.Add(request.NewErrParamRequired("Id3")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetTimecodeInsertion sets the TimecodeInsertion field's value. -func (s *H264Settings) SetTimecodeInsertion(v string) *H264Settings { - s.TimecodeInsertion = &v +// SetId3 sets the Id3 field's value. +func (s *HlsTimedMetadataScheduleActionSettings) SetId3(v string) *HlsTimedMetadataScheduleActionSettings { + s.Id3 = &v return s } -// H265 Color Space Settings -type H265ColorSpaceSettings struct { +// Hls Webdav Settings +type HlsWebdavSettings struct { _ struct{} `type:"structure"` - // Passthrough applies no color space conversion to the output - ColorSpacePassthroughSettings *ColorSpacePassthroughSettings `locationName:"colorSpacePassthroughSettings" type:"structure"` + // Number of seconds to wait before retrying connection to the CDN if the connection + // is lost. + ConnectionRetryInterval *int64 `locationName:"connectionRetryInterval" type:"integer"` - // Hdr10 Settings - Hdr10Settings *Hdr10Settings `locationName:"hdr10Settings" type:"structure"` + // Size in seconds of file cache for streaming outputs. + FilecacheDuration *int64 `locationName:"filecacheDuration" type:"integer"` - // Rec601 Settings - Rec601Settings *Rec601Settings `locationName:"rec601Settings" type:"structure"` + // Specify whether or not to use chunked transfer encoding to WebDAV. + HttpTransferMode *string `locationName:"httpTransferMode" type:"string" enum:"HlsWebdavHttpTransferMode"` - // Rec709 Settings - Rec709Settings *Rec709Settings `locationName:"rec709Settings" type:"structure"` + // Number of retry attempts that will be made before the Live Event is put into + // an error state. + NumRetries *int64 `locationName:"numRetries" type:"integer"` + + // If a streaming output fails, number of seconds to wait until a restart is + // initiated. A value of 0 means never restart. + RestartDelay *int64 `locationName:"restartDelay" type:"integer"` } // String returns the string representation -func (s H265ColorSpaceSettings) String() string { +func (s HlsWebdavSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s H265ColorSpaceSettings) GoString() string { +func (s HlsWebdavSettings) GoString() string { return s.String() } -// SetColorSpacePassthroughSettings sets the ColorSpacePassthroughSettings field's value. -func (s *H265ColorSpaceSettings) SetColorSpacePassthroughSettings(v *ColorSpacePassthroughSettings) *H265ColorSpaceSettings { - s.ColorSpacePassthroughSettings = v +// SetConnectionRetryInterval sets the ConnectionRetryInterval field's value. +func (s *HlsWebdavSettings) SetConnectionRetryInterval(v int64) *HlsWebdavSettings { + s.ConnectionRetryInterval = &v return s } -// SetHdr10Settings sets the Hdr10Settings field's value. -func (s *H265ColorSpaceSettings) SetHdr10Settings(v *Hdr10Settings) *H265ColorSpaceSettings { - s.Hdr10Settings = v +// SetFilecacheDuration sets the FilecacheDuration field's value. +func (s *HlsWebdavSettings) SetFilecacheDuration(v int64) *HlsWebdavSettings { + s.FilecacheDuration = &v return s } -// SetRec601Settings sets the Rec601Settings field's value. -func (s *H265ColorSpaceSettings) SetRec601Settings(v *Rec601Settings) *H265ColorSpaceSettings { - s.Rec601Settings = v +// SetHttpTransferMode sets the HttpTransferMode field's value. +func (s *HlsWebdavSettings) SetHttpTransferMode(v string) *HlsWebdavSettings { + s.HttpTransferMode = &v return s } -// SetRec709Settings sets the Rec709Settings field's value. -func (s *H265ColorSpaceSettings) SetRec709Settings(v *Rec709Settings) *H265ColorSpaceSettings { - s.Rec709Settings = v +// SetNumRetries sets the NumRetries field's value. +func (s *HlsWebdavSettings) SetNumRetries(v int64) *HlsWebdavSettings { + s.NumRetries = &v return s } -// H265 Settings -type H265Settings struct { - _ struct{} `type:"structure"` - - // Adaptive quantization. Allows intra-frame quantizers to vary to improve visual - // quality. - AdaptiveQuantization *string `locationName:"adaptiveQuantization" type:"string" enum:"H265AdaptiveQuantization"` - - // Indicates that AFD values will be written into the output stream. If afdSignaling - // is "auto", the system will try to preserve the input AFD value (in cases - // where multiple AFD values are valid). If set to "fixed", the AFD value will - // be the value configured in the fixedAfd parameter. - AfdSignaling *string `locationName:"afdSignaling" type:"string" enum:"AfdSignaling"` - - // Whether or not EML should insert an Alternative Transfer Function SEI message - // to support backwards compatibility with non-HDR decoders and displays. - AlternativeTransferFunction *string `locationName:"alternativeTransferFunction" type:"string" enum:"H265AlternativeTransferFunction"` - - // Average bitrate in bits/second. Required when the rate control mode is VBR - // or CBR. Not used for QVBR. In an MS Smooth output group, each output must - // have a unique value when its bitrate is rounded down to the nearest multiple - // of 1000. - Bitrate *int64 `locationName:"bitrate" min:"100000" type:"integer"` - - // Size of buffer (HRD buffer model) in bits. - BufSize *int64 `locationName:"bufSize" min:"100000" type:"integer"` - - // Includes colorspace metadata in the output. - ColorMetadata *string `locationName:"colorMetadata" type:"string" enum:"H265ColorMetadata"` - - // Color Space settings - ColorSpaceSettings *H265ColorSpaceSettings `locationName:"colorSpaceSettings" type:"structure"` - - // Four bit AFD value to write on all frames of video in the output stream. - // Only valid when afdSignaling is set to 'Fixed'. - FixedAfd *string `locationName:"fixedAfd" type:"string" enum:"FixedAfd"` - - // If set to enabled, adjust quantization within each frame to reduce flicker - // or 'pop' on I-frames. - FlickerAq *string `locationName:"flickerAq" type:"string" enum:"H265FlickerAq"` - - // Framerate denominator. - // - // FramerateDenominator is a required field - FramerateDenominator *int64 `locationName:"framerateDenominator" min:"1" type:"integer" required:"true"` - - // Framerate numerator - framerate is a fraction, e.g. 24000 / 1001 = 23.976 - // fps. - // - // FramerateNumerator is a required field - FramerateNumerator *int64 `locationName:"framerateNumerator" min:"1" type:"integer" required:"true"` - - // Frequency of closed GOPs. In streaming applications, it is recommended that - // this be set to 1 so a decoder joining mid-stream will receive an IDR frame - // as quickly as possible. Setting this value to 0 will break output segmenting. - GopClosedCadence *int64 `locationName:"gopClosedCadence" type:"integer"` - - // GOP size (keyframe interval) in units of either frames or seconds per gopSizeUnits. - // Must be greater than zero. - GopSize *float64 `locationName:"gopSize" type:"double"` - - // Indicates if the gopSize is specified in frames or seconds. If seconds the - // system will convert the gopSize into a frame count at run time. - GopSizeUnits *string `locationName:"gopSizeUnits" type:"string" enum:"H265GopSizeUnits"` - - // H.265 Level. - Level *string `locationName:"level" type:"string" enum:"H265Level"` - - // Amount of lookahead. A value of low can decrease latency and memory usage, - // while high can produce better quality for certain content. - LookAheadRateControl *string `locationName:"lookAheadRateControl" type:"string" enum:"H265LookAheadRateControl"` - - // For QVBR: See the tooltip for Quality level - MaxBitrate *int64 `locationName:"maxBitrate" min:"100000" type:"integer"` - - // Only meaningful if sceneChangeDetect is set to enabled. Enforces separation - // between repeated (cadence) I-frames and I-frames inserted by Scene Change - // Detection. If a scene change I-frame is within I-interval frames of a cadence - // I-frame, the GOP is shrunk and/or stretched to the scene change I-frame. - // GOP stretch requires enabling lookahead as well as setting I-interval. The - // normal cadence resumes for the next GOP. Note: Maximum GOP stretch = GOP - // size + Min-I-interval - 1 - MinIInterval *int64 `locationName:"minIInterval" type:"integer"` - - // Pixel Aspect Ratio denominator. - ParDenominator *int64 `locationName:"parDenominator" min:"1" type:"integer"` - - // Pixel Aspect Ratio numerator. - ParNumerator *int64 `locationName:"parNumerator" min:"1" type:"integer"` - - // H.265 Profile. - Profile *string `locationName:"profile" type:"string" enum:"H265Profile"` - - // Controls the target quality for the video encode. Applies only when the rate - // control mode is QVBR. Set values for the QVBR quality level field and Max - // bitrate field that suit your most important viewing devices. Recommended - // values are:- Primary screen: Quality level: 8 to 10. Max bitrate: 4M- PC - // or tablet: Quality level: 7. Max bitrate: 1.5M to 3M- Smartphone: Quality - // level: 6. Max bitrate: 1M to 1.5M - QvbrQualityLevel *int64 `locationName:"qvbrQualityLevel" min:"1" type:"integer"` - - // Rate control mode.QVBR: Quality will match the specified quality level except - // when it is constrained by themaximum bitrate. Recommended if you or your - // viewers pay for bandwidth.CBR: Quality varies, depending on the video complexity. - // Recommended only if you distributeyour assets to devices that cannot handle - // variable bitrates. - RateControlMode *string `locationName:"rateControlMode" type:"string" enum:"H265RateControlMode"` - - // Sets the scan type of the output to progressive or top-field-first interlaced. - ScanType *string `locationName:"scanType" type:"string" enum:"H265ScanType"` - - // Scene change detection. - SceneChangeDetect *string `locationName:"sceneChangeDetect" type:"string" enum:"H265SceneChangeDetect"` - - // Number of slices per picture. Must be less than or equal to the number of - // macroblock rows for progressive pictures, and less than or equal to half - // the number of macroblock rows for interlaced pictures.This field is optional; - // when no value is specified the encoder will choose the number of slices based - // on encode resolution. - Slices *int64 `locationName:"slices" min:"1" type:"integer"` - - // H.265 Tier. - Tier *string `locationName:"tier" type:"string" enum:"H265Tier"` +// SetRestartDelay sets the RestartDelay field's value. +func (s *HlsWebdavSettings) SetRestartDelay(v int64) *HlsWebdavSettings { + s.RestartDelay = &v + return s +} - // Determines how timecodes should be inserted into the video elementary stream.- - // 'disabled': Do not include timecodes- 'picTimingSei': Pass through picture - // timing SEI messages from the source specified in Timecode Config - TimecodeInsertion *string `locationName:"timecodeInsertion" type:"string" enum:"H265TimecodeInsertionBehavior"` +// Settings to configure an action so that it occurs immediately. This is only +// supported for input switch actions currently. +type ImmediateModeScheduleActionStartSettings struct { + _ struct{} `type:"structure"` } // String returns the string representation -func (s H265Settings) String() string { +func (s ImmediateModeScheduleActionStartSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s H265Settings) GoString() string { +func (s ImmediateModeScheduleActionStartSettings) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *H265Settings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "H265Settings"} - if s.Bitrate != nil && *s.Bitrate < 100000 { - invalidParams.Add(request.NewErrParamMinValue("Bitrate", 100000)) - } - if s.BufSize != nil && *s.BufSize < 100000 { - invalidParams.Add(request.NewErrParamMinValue("BufSize", 100000)) - } - if s.FramerateDenominator == nil { - invalidParams.Add(request.NewErrParamRequired("FramerateDenominator")) - } - if s.FramerateDenominator != nil && *s.FramerateDenominator < 1 { - invalidParams.Add(request.NewErrParamMinValue("FramerateDenominator", 1)) - } - if s.FramerateNumerator == nil { - invalidParams.Add(request.NewErrParamRequired("FramerateNumerator")) - } - if s.FramerateNumerator != nil && *s.FramerateNumerator < 1 { - invalidParams.Add(request.NewErrParamMinValue("FramerateNumerator", 1)) - } - if s.MaxBitrate != nil && *s.MaxBitrate < 100000 { - invalidParams.Add(request.NewErrParamMinValue("MaxBitrate", 100000)) - } - if s.ParDenominator != nil && *s.ParDenominator < 1 { - invalidParams.Add(request.NewErrParamMinValue("ParDenominator", 1)) - } - if s.ParNumerator != nil && *s.ParNumerator < 1 { - invalidParams.Add(request.NewErrParamMinValue("ParNumerator", 1)) - } - if s.QvbrQualityLevel != nil && *s.QvbrQualityLevel < 1 { - invalidParams.Add(request.NewErrParamMinValue("QvbrQualityLevel", 1)) - } - if s.Slices != nil && *s.Slices < 1 { - invalidParams.Add(request.NewErrParamMinValue("Slices", 1)) - } +type Input struct { + _ struct{} `type:"structure"` - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} + // The Unique ARN of the input (generated, immutable). + Arn *string `locationName:"arn" type:"string"` -// SetAdaptiveQuantization sets the AdaptiveQuantization field's value. -func (s *H265Settings) SetAdaptiveQuantization(v string) *H265Settings { - s.AdaptiveQuantization = &v - return s -} + // A list of channel IDs that that input is attached to (currently an input + // can only be attached to one channel). + AttachedChannels []*string `locationName:"attachedChannels" type:"list"` -// SetAfdSignaling sets the AfdSignaling field's value. -func (s *H265Settings) SetAfdSignaling(v string) *H265Settings { - s.AfdSignaling = &v - return s -} + // A list of the destinations of the input (PUSH-type). + Destinations []*InputDestination `locationName:"destinations" type:"list"` -// SetAlternativeTransferFunction sets the AlternativeTransferFunction field's value. -func (s *H265Settings) SetAlternativeTransferFunction(v string) *H265Settings { - s.AlternativeTransferFunction = &v - return s -} + // The generated ID of the input (unique for user account, immutable). + Id *string `locationName:"id" type:"string"` -// SetBitrate sets the Bitrate field's value. -func (s *H265Settings) SetBitrate(v int64) *H265Settings { - s.Bitrate = &v - return s -} + // STANDARD - MediaLive expects two sources to be connected to this input. If + // the channel is also STANDARD, both sources will be ingested. If the channel + // is SINGLE_PIPELINE, only the first source will be ingested; the second source + // will always be ignored, even if the first source fails.SINGLE_PIPELINE - + // You can connect only one source to this input. If the ChannelClass is also + // SINGLE_PIPELINE, this value is valid. If the ChannelClass is STANDARD, this + // value is not valid because the channel requires two sources in the input. + InputClass *string `locationName:"inputClass" type:"string" enum:"InputClass"` -// SetBufSize sets the BufSize field's value. -func (s *H265Settings) SetBufSize(v int64) *H265Settings { - s.BufSize = &v - return s -} + // Certain pull input sources can be dynamic, meaning that they can have their + // URL's dynamically changesduring input switch actions. Presently, this functionality + // only works with MP4_FILE inputs. + InputSourceType *string `locationName:"inputSourceType" type:"string" enum:"InputSourceType"` -// SetColorMetadata sets the ColorMetadata field's value. -func (s *H265Settings) SetColorMetadata(v string) *H265Settings { - s.ColorMetadata = &v - return s -} + // A list of MediaConnect Flows for this input. + MediaConnectFlows []*MediaConnectFlow `locationName:"mediaConnectFlows" type:"list"` -// SetColorSpaceSettings sets the ColorSpaceSettings field's value. -func (s *H265Settings) SetColorSpaceSettings(v *H265ColorSpaceSettings) *H265Settings { - s.ColorSpaceSettings = v - return s -} + // The user-assigned name (This is a mutable value). + Name *string `locationName:"name" type:"string"` -// SetFixedAfd sets the FixedAfd field's value. -func (s *H265Settings) SetFixedAfd(v string) *H265Settings { - s.FixedAfd = &v - return s -} + // The Amazon Resource Name (ARN) of the role this input assumes during and + // after creation. + RoleArn *string `locationName:"roleArn" type:"string"` -// SetFlickerAq sets the FlickerAq field's value. -func (s *H265Settings) SetFlickerAq(v string) *H265Settings { - s.FlickerAq = &v - return s -} + // A list of IDs for all the Input Security Groups attached to the input. + SecurityGroups []*string `locationName:"securityGroups" type:"list"` -// SetFramerateDenominator sets the FramerateDenominator field's value. -func (s *H265Settings) SetFramerateDenominator(v int64) *H265Settings { - s.FramerateDenominator = &v - return s -} + // A list of the sources of the input (PULL-type). + Sources []*InputSource `locationName:"sources" type:"list"` -// SetFramerateNumerator sets the FramerateNumerator field's value. -func (s *H265Settings) SetFramerateNumerator(v int64) *H265Settings { - s.FramerateNumerator = &v - return s -} + State *string `locationName:"state" type:"string" enum:"InputState"` -// SetGopClosedCadence sets the GopClosedCadence field's value. -func (s *H265Settings) SetGopClosedCadence(v int64) *H265Settings { - s.GopClosedCadence = &v - return s + // A collection of key-value pairs. + Tags map[string]*string `locationName:"tags" type:"map"` + + Type *string `locationName:"type" type:"string" enum:"InputType"` } -// SetGopSize sets the GopSize field's value. -func (s *H265Settings) SetGopSize(v float64) *H265Settings { - s.GopSize = &v - return s +// String returns the string representation +func (s Input) String() string { + return awsutil.Prettify(s) } -// SetGopSizeUnits sets the GopSizeUnits field's value. -func (s *H265Settings) SetGopSizeUnits(v string) *H265Settings { - s.GopSizeUnits = &v - return s +// GoString returns the string representation +func (s Input) GoString() string { + return s.String() } -// SetLevel sets the Level field's value. -func (s *H265Settings) SetLevel(v string) *H265Settings { - s.Level = &v +// SetArn sets the Arn field's value. +func (s *Input) SetArn(v string) *Input { + s.Arn = &v return s } -// SetLookAheadRateControl sets the LookAheadRateControl field's value. -func (s *H265Settings) SetLookAheadRateControl(v string) *H265Settings { - s.LookAheadRateControl = &v +// SetAttachedChannels sets the AttachedChannels field's value. +func (s *Input) SetAttachedChannels(v []*string) *Input { + s.AttachedChannels = v return s } -// SetMaxBitrate sets the MaxBitrate field's value. -func (s *H265Settings) SetMaxBitrate(v int64) *H265Settings { - s.MaxBitrate = &v +// SetDestinations sets the Destinations field's value. +func (s *Input) SetDestinations(v []*InputDestination) *Input { + s.Destinations = v return s } -// SetMinIInterval sets the MinIInterval field's value. -func (s *H265Settings) SetMinIInterval(v int64) *H265Settings { - s.MinIInterval = &v +// SetId sets the Id field's value. +func (s *Input) SetId(v string) *Input { + s.Id = &v return s } -// SetParDenominator sets the ParDenominator field's value. -func (s *H265Settings) SetParDenominator(v int64) *H265Settings { - s.ParDenominator = &v +// SetInputClass sets the InputClass field's value. +func (s *Input) SetInputClass(v string) *Input { + s.InputClass = &v return s } -// SetParNumerator sets the ParNumerator field's value. -func (s *H265Settings) SetParNumerator(v int64) *H265Settings { - s.ParNumerator = &v +// SetInputSourceType sets the InputSourceType field's value. +func (s *Input) SetInputSourceType(v string) *Input { + s.InputSourceType = &v return s } -// SetProfile sets the Profile field's value. -func (s *H265Settings) SetProfile(v string) *H265Settings { - s.Profile = &v +// SetMediaConnectFlows sets the MediaConnectFlows field's value. +func (s *Input) SetMediaConnectFlows(v []*MediaConnectFlow) *Input { + s.MediaConnectFlows = v return s } -// SetQvbrQualityLevel sets the QvbrQualityLevel field's value. -func (s *H265Settings) SetQvbrQualityLevel(v int64) *H265Settings { - s.QvbrQualityLevel = &v +// SetName sets the Name field's value. +func (s *Input) SetName(v string) *Input { + s.Name = &v return s } -// SetRateControlMode sets the RateControlMode field's value. -func (s *H265Settings) SetRateControlMode(v string) *H265Settings { - s.RateControlMode = &v +// SetRoleArn sets the RoleArn field's value. +func (s *Input) SetRoleArn(v string) *Input { + s.RoleArn = &v return s } -// SetScanType sets the ScanType field's value. -func (s *H265Settings) SetScanType(v string) *H265Settings { - s.ScanType = &v +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *Input) SetSecurityGroups(v []*string) *Input { + s.SecurityGroups = v return s } -// SetSceneChangeDetect sets the SceneChangeDetect field's value. -func (s *H265Settings) SetSceneChangeDetect(v string) *H265Settings { - s.SceneChangeDetect = &v +// SetSources sets the Sources field's value. +func (s *Input) SetSources(v []*InputSource) *Input { + s.Sources = v return s } -// SetSlices sets the Slices field's value. -func (s *H265Settings) SetSlices(v int64) *H265Settings { - s.Slices = &v +// SetState sets the State field's value. +func (s *Input) SetState(v string) *Input { + s.State = &v return s } -// SetTier sets the Tier field's value. -func (s *H265Settings) SetTier(v string) *H265Settings { - s.Tier = &v +// SetTags sets the Tags field's value. +func (s *Input) SetTags(v map[string]*string) *Input { + s.Tags = v return s } -// SetTimecodeInsertion sets the TimecodeInsertion field's value. -func (s *H265Settings) SetTimecodeInsertion(v string) *H265Settings { - s.TimecodeInsertion = &v +// SetType sets the Type field's value. +func (s *Input) SetType(v string) *Input { + s.Type = &v return s } -// Hdr10 Settings -type Hdr10Settings struct { +type InputAttachment struct { _ struct{} `type:"structure"` - // Maximum Content Light LevelAn integer metadata value defining the maximum - // light level, in nits,of any single pixel within an encoded HDR video stream - // or file. - MaxCll *int64 `locationName:"maxCll" type:"integer"` + // User-specified name for the attachment. This is required if the user wants + // to use this input in an input switch action. + InputAttachmentName *string `locationName:"inputAttachmentName" type:"string"` - // Maximum Frame Average Light LevelAn integer metadata value defining the maximum - // average light level, in nits,for any single frame within an encoded HDR video - // stream or file. - MaxFall *int64 `locationName:"maxFall" type:"integer"` + // The ID of the input + InputId *string `locationName:"inputId" type:"string"` + + // Settings of an input (caption selector, etc.) + InputSettings *InputSettings `locationName:"inputSettings" type:"structure"` } // String returns the string representation -func (s Hdr10Settings) String() string { +func (s InputAttachment) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Hdr10Settings) GoString() string { +func (s InputAttachment) GoString() string { return s.String() } -// SetMaxCll sets the MaxCll field's value. -func (s *Hdr10Settings) SetMaxCll(v int64) *Hdr10Settings { - s.MaxCll = &v - return s -} - -// SetMaxFall sets the MaxFall field's value. -func (s *Hdr10Settings) SetMaxFall(v int64) *Hdr10Settings { - s.MaxFall = &v - return s -} - -// Hls Akamai Settings -type HlsAkamaiSettings struct { - _ struct{} `type:"structure"` - - // Number of seconds to wait before retrying connection to the CDN if the connection - // is lost. - ConnectionRetryInterval *int64 `locationName:"connectionRetryInterval" type:"integer"` - - // Size in seconds of file cache for streaming outputs. - FilecacheDuration *int64 `locationName:"filecacheDuration" type:"integer"` - - // Specify whether or not to use chunked transfer encoding to Akamai. User should - // contact Akamai to enable this feature. - HttpTransferMode *string `locationName:"httpTransferMode" type:"string" enum:"HlsAkamaiHttpTransferMode"` - - // Number of retry attempts that will be made before the Live Event is put into - // an error state. - NumRetries *int64 `locationName:"numRetries" type:"integer"` - - // If a streaming output fails, number of seconds to wait until a restart is - // initiated. A value of 0 means never restart. - RestartDelay *int64 `locationName:"restartDelay" type:"integer"` - - // Salt for authenticated Akamai. - Salt *string `locationName:"salt" type:"string"` - - // Token parameter for authenticated akamai. If not specified, _gda_ is used. - Token *string `locationName:"token" type:"string"` -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *InputAttachment) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InputAttachment"} + if s.InputSettings != nil { + if err := s.InputSettings.Validate(); err != nil { + invalidParams.AddNested("InputSettings", err.(request.ErrInvalidParams)) + } + } -// String returns the string representation -func (s HlsAkamaiSettings) String() string { - return awsutil.Prettify(s) + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// GoString returns the string representation -func (s HlsAkamaiSettings) GoString() string { - return s.String() +// SetInputAttachmentName sets the InputAttachmentName field's value. +func (s *InputAttachment) SetInputAttachmentName(v string) *InputAttachment { + s.InputAttachmentName = &v + return s } -// SetConnectionRetryInterval sets the ConnectionRetryInterval field's value. -func (s *HlsAkamaiSettings) SetConnectionRetryInterval(v int64) *HlsAkamaiSettings { - s.ConnectionRetryInterval = &v +// SetInputId sets the InputId field's value. +func (s *InputAttachment) SetInputId(v string) *InputAttachment { + s.InputId = &v return s } -// SetFilecacheDuration sets the FilecacheDuration field's value. -func (s *HlsAkamaiSettings) SetFilecacheDuration(v int64) *HlsAkamaiSettings { - s.FilecacheDuration = &v +// SetInputSettings sets the InputSettings field's value. +func (s *InputAttachment) SetInputSettings(v *InputSettings) *InputAttachment { + s.InputSettings = v return s } -// SetHttpTransferMode sets the HttpTransferMode field's value. -func (s *HlsAkamaiSettings) SetHttpTransferMode(v string) *HlsAkamaiSettings { - s.HttpTransferMode = &v - return s +// Input Channel Level +type InputChannelLevel struct { + _ struct{} `type:"structure"` + + // Remixing value. Units are in dB and acceptable values are within the range + // from -60 (mute) and 6 dB. + // + // Gain is a required field + Gain *int64 `locationName:"gain" type:"integer" required:"true"` + + // The index of the input channel used as a source. + // + // InputChannel is a required field + InputChannel *int64 `locationName:"inputChannel" type:"integer" required:"true"` } -// SetNumRetries sets the NumRetries field's value. -func (s *HlsAkamaiSettings) SetNumRetries(v int64) *HlsAkamaiSettings { - s.NumRetries = &v - return s +// String returns the string representation +func (s InputChannelLevel) String() string { + return awsutil.Prettify(s) } -// SetRestartDelay sets the RestartDelay field's value. -func (s *HlsAkamaiSettings) SetRestartDelay(v int64) *HlsAkamaiSettings { - s.RestartDelay = &v - return s +// GoString returns the string representation +func (s InputChannelLevel) GoString() string { + return s.String() } -// SetSalt sets the Salt field's value. -func (s *HlsAkamaiSettings) SetSalt(v string) *HlsAkamaiSettings { - s.Salt = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *InputChannelLevel) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InputChannelLevel"} + if s.Gain == nil { + invalidParams.Add(request.NewErrParamRequired("Gain")) + } + if s.Gain != nil && *s.Gain < -60 { + invalidParams.Add(request.NewErrParamMinValue("Gain", -60)) + } + if s.InputChannel == nil { + invalidParams.Add(request.NewErrParamRequired("InputChannel")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGain sets the Gain field's value. +func (s *InputChannelLevel) SetGain(v int64) *InputChannelLevel { + s.Gain = &v return s } -// SetToken sets the Token field's value. -func (s *HlsAkamaiSettings) SetToken(v string) *HlsAkamaiSettings { - s.Token = &v +// SetInputChannel sets the InputChannel field's value. +func (s *InputChannelLevel) SetInputChannel(v int64) *InputChannelLevel { + s.InputChannel = &v return s } -// Hls Basic Put Settings -type HlsBasicPutSettings struct { +// Settings to let you create a clip of the file input, in order to set up the +// input to ingest only a portion of the file. +type InputClippingSettings struct { _ struct{} `type:"structure"` - // Number of seconds to wait before retrying connection to the CDN if the connection - // is lost. - ConnectionRetryInterval *int64 `locationName:"connectionRetryInterval" type:"integer"` - - // Size in seconds of file cache for streaming outputs. - FilecacheDuration *int64 `locationName:"filecacheDuration" type:"integer"` + // The source of the timecodes in the source being clipped. + // + // InputTimecodeSource is a required field + InputTimecodeSource *string `locationName:"inputTimecodeSource" type:"string" required:"true" enum:"InputTimecodeSource"` - // Number of retry attempts that will be made before the Live Event is put into - // an error state. - NumRetries *int64 `locationName:"numRetries" type:"integer"` + // Settings to identify the start of the clip. + StartTimecode *StartTimecode `locationName:"startTimecode" type:"structure"` - // If a streaming output fails, number of seconds to wait until a restart is - // initiated. A value of 0 means never restart. - RestartDelay *int64 `locationName:"restartDelay" type:"integer"` + // Settings to identify the end of the clip. + StopTimecode *StopTimecode `locationName:"stopTimecode" type:"structure"` } // String returns the string representation -func (s HlsBasicPutSettings) String() string { +func (s InputClippingSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HlsBasicPutSettings) GoString() string { +func (s InputClippingSettings) GoString() string { return s.String() } -// SetConnectionRetryInterval sets the ConnectionRetryInterval field's value. -func (s *HlsBasicPutSettings) SetConnectionRetryInterval(v int64) *HlsBasicPutSettings { - s.ConnectionRetryInterval = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *InputClippingSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InputClippingSettings"} + if s.InputTimecodeSource == nil { + invalidParams.Add(request.NewErrParamRequired("InputTimecodeSource")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetFilecacheDuration sets the FilecacheDuration field's value. -func (s *HlsBasicPutSettings) SetFilecacheDuration(v int64) *HlsBasicPutSettings { - s.FilecacheDuration = &v +// SetInputTimecodeSource sets the InputTimecodeSource field's value. +func (s *InputClippingSettings) SetInputTimecodeSource(v string) *InputClippingSettings { + s.InputTimecodeSource = &v return s } -// SetNumRetries sets the NumRetries field's value. -func (s *HlsBasicPutSettings) SetNumRetries(v int64) *HlsBasicPutSettings { - s.NumRetries = &v +// SetStartTimecode sets the StartTimecode field's value. +func (s *InputClippingSettings) SetStartTimecode(v *StartTimecode) *InputClippingSettings { + s.StartTimecode = v return s } -// SetRestartDelay sets the RestartDelay field's value. -func (s *HlsBasicPutSettings) SetRestartDelay(v int64) *HlsBasicPutSettings { - s.RestartDelay = &v +// SetStopTimecode sets the StopTimecode field's value. +func (s *InputClippingSettings) SetStopTimecode(v *StopTimecode) *InputClippingSettings { + s.StopTimecode = v return s } -// Hls Cdn Settings -type HlsCdnSettings struct { +// The settings for a PUSH type input. +type InputDestination struct { _ struct{} `type:"structure"` - // Hls Akamai Settings - HlsAkamaiSettings *HlsAkamaiSettings `locationName:"hlsAkamaiSettings" type:"structure"` + // The system-generated static IP address of endpoint.It remains fixed for the + // lifetime of the input. + Ip *string `locationName:"ip" type:"string"` - // Hls Basic Put Settings - HlsBasicPutSettings *HlsBasicPutSettings `locationName:"hlsBasicPutSettings" type:"structure"` + // The port number for the input. + Port *string `locationName:"port" type:"string"` - // Hls Media Store Settings - HlsMediaStoreSettings *HlsMediaStoreSettings `locationName:"hlsMediaStoreSettings" type:"structure"` + // This represents the endpoint that the customer stream will bepushed to. + Url *string `locationName:"url" type:"string"` - // Hls Webdav Settings - HlsWebdavSettings *HlsWebdavSettings `locationName:"hlsWebdavSettings" type:"structure"` + // The properties for a VPC type input destination. + Vpc *InputDestinationVpc `locationName:"vpc" type:"structure"` } // String returns the string representation -func (s HlsCdnSettings) String() string { +func (s InputDestination) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HlsCdnSettings) GoString() string { +func (s InputDestination) GoString() string { return s.String() } -// SetHlsAkamaiSettings sets the HlsAkamaiSettings field's value. -func (s *HlsCdnSettings) SetHlsAkamaiSettings(v *HlsAkamaiSettings) *HlsCdnSettings { - s.HlsAkamaiSettings = v +// SetIp sets the Ip field's value. +func (s *InputDestination) SetIp(v string) *InputDestination { + s.Ip = &v return s } -// SetHlsBasicPutSettings sets the HlsBasicPutSettings field's value. -func (s *HlsCdnSettings) SetHlsBasicPutSettings(v *HlsBasicPutSettings) *HlsCdnSettings { - s.HlsBasicPutSettings = v +// SetPort sets the Port field's value. +func (s *InputDestination) SetPort(v string) *InputDestination { + s.Port = &v return s } -// SetHlsMediaStoreSettings sets the HlsMediaStoreSettings field's value. -func (s *HlsCdnSettings) SetHlsMediaStoreSettings(v *HlsMediaStoreSettings) *HlsCdnSettings { - s.HlsMediaStoreSettings = v +// SetUrl sets the Url field's value. +func (s *InputDestination) SetUrl(v string) *InputDestination { + s.Url = &v return s } -// SetHlsWebdavSettings sets the HlsWebdavSettings field's value. -func (s *HlsCdnSettings) SetHlsWebdavSettings(v *HlsWebdavSettings) *HlsCdnSettings { - s.HlsWebdavSettings = v +// SetVpc sets the Vpc field's value. +func (s *InputDestination) SetVpc(v *InputDestinationVpc) *InputDestination { + s.Vpc = v return s } -// Hls Group Settings -type HlsGroupSettings struct { +// Endpoint settings for a PUSH type input. +type InputDestinationRequest struct { _ struct{} `type:"structure"` - // Choose one or more ad marker types to pass SCTE35 signals through to this - // group of Apple HLS outputs. - AdMarkers []*string `locationName:"adMarkers" type:"list"` - - // A partial URI prefix that will be prepended to each output in the media .m3u8 - // file. Can be used if base manifest is delivered from a different URL than - // the main .m3u8 file. - BaseUrlContent *string `locationName:"baseUrlContent" type:"string"` - - // A partial URI prefix that will be prepended to each output in the media .m3u8 - // file. Can be used if base manifest is delivered from a different URL than - // the main .m3u8 file. - BaseUrlManifest *string `locationName:"baseUrlManifest" type:"string"` - - // Mapping of up to 4 caption channels to caption languages. Is only meaningful - // if captionLanguageSetting is set to "insert". - CaptionLanguageMappings []*CaptionLanguageMapping `locationName:"captionLanguageMappings" type:"list"` - - // Applies only to 608 Embedded output captions.insert: Include CLOSED-CAPTIONS - // lines in the manifest. Specify at least one language in the CC1 Language - // Code field. One CLOSED-CAPTION line is added for each Language Code you specify. - // Make sure to specify the languages in the order in which they appear in the - // original source (if the source is embedded format) or the order of the caption - // selectors (if the source is other than embedded). Otherwise, languages in - // the manifest will not match up properly with the output captions.none: Include - // CLOSED-CAPTIONS=NONE line in the manifest.omit: Omit any CLOSED-CAPTIONS - // line from the manifest. - CaptionLanguageSetting *string `locationName:"captionLanguageSetting" type:"string" enum:"HlsCaptionLanguageSetting"` - - // When set to "disabled", sets the #EXT-X-ALLOW-CACHE:no tag in the manifest, - // which prevents clients from saving media segments for later replay. - ClientCache *string `locationName:"clientCache" type:"string" enum:"HlsClientCache"` - - // Specification to use (RFC-6381 or the default RFC-4281) during m3u8 playlist - // generation. - CodecSpecification *string `locationName:"codecSpecification" type:"string" enum:"HlsCodecSpecification"` - - // For use with encryptionType. This is a 128-bit, 16-byte hex value represented - // by a 32-character text string. If ivSource is set to "explicit" then this - // parameter is required and is used as the IV for encryption. - ConstantIv *string `locationName:"constantIv" min:"32" type:"string"` - - // A directory or HTTP destination for the HLS segments, manifest files, and - // encryption keys (if enabled). - // - // Destination is a required field - Destination *OutputLocationRef `locationName:"destination" type:"structure" required:"true"` - - // Place segments in subdirectories. - DirectoryStructure *string `locationName:"directoryStructure" type:"string" enum:"HlsDirectoryStructure"` + // A unique name for the location the RTMP stream is being pushedto. + StreamName *string `locationName:"streamName" type:"string"` +} - // Encrypts the segments with the given encryption scheme. Exclude this parameter - // if no encryption is desired. - EncryptionType *string `locationName:"encryptionType" type:"string" enum:"HlsEncryptionType"` +// String returns the string representation +func (s InputDestinationRequest) String() string { + return awsutil.Prettify(s) +} - // Parameters that control interactions with the CDN. - HlsCdnSettings *HlsCdnSettings `locationName:"hlsCdnSettings" type:"structure"` +// GoString returns the string representation +func (s InputDestinationRequest) GoString() string { + return s.String() +} - // DISABLED: Do not create an I-frame-only manifest, but do create the master - // and media manifests (according to the Output Selection field).STANDARD: Create - // an I-frame-only manifest for each output that contains video, as well as - // the other manifests (according to the Output Selection field). The I-frame - // manifest contains a #EXT-X-I-FRAMES-ONLY tag to indicate it is I-frame only, - // and one or more #EXT-X-BYTERANGE entries identifying the I-frame position. - // For example, #EXT-X-BYTERANGE:160364@1461888" - IFrameOnlyPlaylists *string `locationName:"iFrameOnlyPlaylists" type:"string" enum:"IFrameOnlyPlaylistType"` +// SetStreamName sets the StreamName field's value. +func (s *InputDestinationRequest) SetStreamName(v string) *InputDestinationRequest { + s.StreamName = &v + return s +} - // Applies only if Mode field is LIVE. Specifies the maximum number of segments - // in the media manifest file. After this maximum, older segments are removed - // from the media manifest. This number must be less than or equal to the Keep - // Segments field. - IndexNSegments *int64 `locationName:"indexNSegments" min:"3" type:"integer"` +// The properties for a VPC type input destination. +type InputDestinationVpc struct { + _ struct{} `type:"structure"` - // Parameter that control output group behavior on input loss. - InputLossAction *string `locationName:"inputLossAction" type:"string" enum:"InputLossActionForHlsOut"` + // The availability zone of the Input destination. + AvailabilityZone *string `locationName:"availabilityZone" type:"string"` - // For use with encryptionType. The IV (Initialization Vector) is a 128-bit - // number used in conjunction with the key for encrypting blocks. If set to - // "include", IV is listed in the manifest, otherwise the IV is not in the manifest. - IvInManifest *string `locationName:"ivInManifest" type:"string" enum:"HlsIvInManifest"` + // The network interface ID of the Input destination in the VPC. + NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` +} - // For use with encryptionType. The IV (Initialization Vector) is a 128-bit - // number used in conjunction with the key for encrypting blocks. If this setting - // is "followsSegmentNumber", it will cause the IV to change every segment (to - // match the segment number). If this is set to "explicit", you must enter a - // constantIv value. - IvSource *string `locationName:"ivSource" type:"string" enum:"HlsIvSource"` +// String returns the string representation +func (s InputDestinationVpc) String() string { + return awsutil.Prettify(s) +} - // Applies only if Mode field is LIVE. Specifies the number of media segments - // (.ts files) to retain in the destination directory. - KeepSegments *int64 `locationName:"keepSegments" min:"1" type:"integer"` +// GoString returns the string representation +func (s InputDestinationVpc) GoString() string { + return s.String() +} - // The value specifies how the key is represented in the resource identified - // by the URI. If parameter is absent, an implicit value of "identity" is used. - // A reverse DNS string can also be given. - KeyFormat *string `locationName:"keyFormat" type:"string"` +// SetAvailabilityZone sets the AvailabilityZone field's value. +func (s *InputDestinationVpc) SetAvailabilityZone(v string) *InputDestinationVpc { + s.AvailabilityZone = &v + return s +} - // Either a single positive integer version value or a slash delimited list - // of version values (1/2/3). - KeyFormatVersions *string `locationName:"keyFormatVersions" type:"string"` +// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. +func (s *InputDestinationVpc) SetNetworkInterfaceId(v string) *InputDestinationVpc { + s.NetworkInterfaceId = &v + return s +} - // The key provider settings. - KeyProviderSettings *KeyProviderSettings `locationName:"keyProviderSettings" type:"structure"` +// Input Location +type InputLocation struct { + _ struct{} `type:"structure"` - // When set to gzip, compresses HLS playlist. - ManifestCompression *string `locationName:"manifestCompression" type:"string" enum:"HlsManifestCompression"` + // key used to extract the password from EC2 Parameter store + PasswordParam *string `locationName:"passwordParam" type:"string"` - // Indicates whether the output manifest should use floating point or integer - // values for segment duration. - ManifestDurationFormat *string `locationName:"manifestDurationFormat" type:"string" enum:"HlsManifestDurationFormat"` + // Uniform Resource Identifier - This should be a path to a file accessible + // to the Live system (eg. a http:// URI) depending on the output type. For + // example, a RTMP destination should have a uri simliar to: "rtmp://fmsserver/live". + // + // Uri is a required field + Uri *string `locationName:"uri" type:"string" required:"true"` - // When set, minimumSegmentLength is enforced by looking ahead and back within - // the specified range for a nearby avail and extending the segment size if - // needed. - MinSegmentLength *int64 `locationName:"minSegmentLength" type:"integer"` + // Username if credentials are required to access a file or publishing point. + // This can be either a plaintext username, or a reference to an AWS parameter + // store name from which the username can be retrieved. AWS Parameter store + // format: "ssm://" + Username *string `locationName:"username" type:"string"` +} - // If "vod", all segments are indexed and kept permanently in the destination - // and manifest. If "live", only the number segments specified in keepSegments - // and indexNSegments are kept; newer segments replace older segments, which - // may prevent players from rewinding all the way to the beginning of the event.VOD - // mode uses HLS EXT-X-PLAYLIST-TYPE of EVENT while the channel is running, - // converting it to a "VOD" type manifest on completion of the stream. - Mode *string `locationName:"mode" type:"string" enum:"HlsMode"` +// String returns the string representation +func (s InputLocation) String() string { + return awsutil.Prettify(s) +} - // MANIFESTSANDSEGMENTS: Generates manifests (master manifest, if applicable, - // and media manifests) for this output group.SEGMENTSONLY: Does not generate - // any manifests for this output group. - OutputSelection *string `locationName:"outputSelection" type:"string" enum:"HlsOutputSelection"` +// GoString returns the string representation +func (s InputLocation) GoString() string { + return s.String() +} - // Includes or excludes EXT-X-PROGRAM-DATE-TIME tag in .m3u8 manifest files. - // The value is calculated as follows: either the program date and time are - // initialized using the input timecode source, or the time is initialized using - // the input timecode source and the date is initialized using the timestampOffset. - ProgramDateTime *string `locationName:"programDateTime" type:"string" enum:"HlsProgramDateTime"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *InputLocation) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InputLocation"} + if s.Uri == nil { + invalidParams.Add(request.NewErrParamRequired("Uri")) + } - // Period of insertion of EXT-X-PROGRAM-DATE-TIME entry, in seconds. - ProgramDateTimePeriod *int64 `locationName:"programDateTimePeriod" type:"integer"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // ENABLED: The master manifest (.m3u8 file) for each pipeline includes information - // about both pipelines: first its own media files, then the media files of - // the other pipeline. This feature allows playout device that support stale - // manifest detection to switch from one manifest to the other, when the current - // manifest seems to be stale. There are still two destinations and two master - // manifests, but both master manifests reference the media files from both - // pipelines.DISABLED: The master manifest (.m3u8 file) for each pipeline includes - // information about its own pipeline only.For an HLS output group with MediaPackage - // as the destination, the DISABLED behavior is always followed. MediaPackage - // regenerates the manifests it serves to players so a redundant manifest from - // MediaLive is irrelevant. - RedundantManifest *string `locationName:"redundantManifest" type:"string" enum:"HlsRedundantManifest"` +// SetPasswordParam sets the PasswordParam field's value. +func (s *InputLocation) SetPasswordParam(v string) *InputLocation { + s.PasswordParam = &v + return s +} - // Length of MPEG-2 Transport Stream segments to create (in seconds). Note that - // segments will end on the next keyframe after this number of seconds, so actual - // segment length may be longer. - SegmentLength *int64 `locationName:"segmentLength" min:"1" type:"integer"` +// SetUri sets the Uri field's value. +func (s *InputLocation) SetUri(v string) *InputLocation { + s.Uri = &v + return s +} - // useInputSegmentation has been deprecated. The configured segment size is - // always used. - SegmentationMode *string `locationName:"segmentationMode" type:"string" enum:"HlsSegmentationMode"` +// SetUsername sets the Username field's value. +func (s *InputLocation) SetUsername(v string) *InputLocation { + s.Username = &v + return s +} - // Number of segments to write to a subdirectory before starting a new one. - // directoryStructure must be subdirectoryPerStream for this setting to have - // an effect. - SegmentsPerSubdirectory *int64 `locationName:"segmentsPerSubdirectory" min:"1" type:"integer"` +// Input Loss Behavior +type InputLossBehavior struct { + _ struct{} `type:"structure"` - // Include or exclude RESOLUTION attribute for video in EXT-X-STREAM-INF tag - // of variant manifest. - StreamInfResolution *string `locationName:"streamInfResolution" type:"string" enum:"HlsStreamInfResolution"` + // On input loss, the number of milliseconds to substitute black into the output + // before switching to the frame specified by inputLossImageType. A value x, + // where 0 <= x <= 1,000,000 and a value of 1,000,000 will be interpreted as + // infinite. + BlackFrameMsec *int64 `locationName:"blackFrameMsec" type:"integer"` - // Indicates ID3 frame that has the timecode. - TimedMetadataId3Frame *string `locationName:"timedMetadataId3Frame" type:"string" enum:"HlsTimedMetadataId3Frame"` + // When input loss image type is "color" this field specifies the color to use. + // Value: 6 hex characters representing the values of RGB. + InputLossImageColor *string `locationName:"inputLossImageColor" min:"6" type:"string"` - // Timed Metadata interval in seconds. - TimedMetadataId3Period *int64 `locationName:"timedMetadataId3Period" type:"integer"` + // When input loss image type is "slate" these fields specify the parameters + // for accessing the slate. + InputLossImageSlate *InputLocation `locationName:"inputLossImageSlate" type:"structure"` - // Provides an extra millisecond delta offset to fine tune the timestamps. - TimestampDeltaMilliseconds *int64 `locationName:"timestampDeltaMilliseconds" type:"integer"` + // Indicates whether to substitute a solid color or a slate into the output + // after input loss exceeds blackFrameMsec. + InputLossImageType *string `locationName:"inputLossImageType" type:"string" enum:"InputLossImageType"` - // SEGMENTEDFILES: Emit the program as segments - multiple .ts media files.SINGLEFILE: - // Applies only if Mode field is VOD. Emit the program as a single .ts media - // file. The media manifest includes #EXT-X-BYTERANGE tags to index segments - // for playback. A typical use for this value is when sending the output to - // AWS Elemental MediaConvert, which can accept only a single media file. Playback - // while the channel is running is not guaranteed due to HTTP server caching. - TsFileMode *string `locationName:"tsFileMode" type:"string" enum:"HlsTsFileMode"` + // On input loss, the number of milliseconds to repeat the previous picture + // before substituting black into the output. A value x, where 0 <= x <= 1,000,000 + // and a value of 1,000,000 will be interpreted as infinite. + RepeatFrameMsec *int64 `locationName:"repeatFrameMsec" type:"integer"` } // String returns the string representation -func (s HlsGroupSettings) String() string { +func (s InputLossBehavior) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HlsGroupSettings) GoString() string { +func (s InputLossBehavior) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *HlsGroupSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HlsGroupSettings"} - if s.ConstantIv != nil && len(*s.ConstantIv) < 32 { - invalidParams.Add(request.NewErrParamMinLen("ConstantIv", 32)) - } - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) - } - if s.IndexNSegments != nil && *s.IndexNSegments < 3 { - invalidParams.Add(request.NewErrParamMinValue("IndexNSegments", 3)) - } - if s.KeepSegments != nil && *s.KeepSegments < 1 { - invalidParams.Add(request.NewErrParamMinValue("KeepSegments", 1)) - } - if s.SegmentLength != nil && *s.SegmentLength < 1 { - invalidParams.Add(request.NewErrParamMinValue("SegmentLength", 1)) - } - if s.SegmentsPerSubdirectory != nil && *s.SegmentsPerSubdirectory < 1 { - invalidParams.Add(request.NewErrParamMinValue("SegmentsPerSubdirectory", 1)) - } - if s.CaptionLanguageMappings != nil { - for i, v := range s.CaptionLanguageMappings { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CaptionLanguageMappings", i), err.(request.ErrInvalidParams)) - } - } +func (s *InputLossBehavior) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InputLossBehavior"} + if s.InputLossImageColor != nil && len(*s.InputLossImageColor) < 6 { + invalidParams.Add(request.NewErrParamMinLen("InputLossImageColor", 6)) } - if s.KeyProviderSettings != nil { - if err := s.KeyProviderSettings.Validate(); err != nil { - invalidParams.AddNested("KeyProviderSettings", err.(request.ErrInvalidParams)) + if s.InputLossImageSlate != nil { + if err := s.InputLossImageSlate.Validate(); err != nil { + invalidParams.AddNested("InputLossImageSlate", err.(request.ErrInvalidParams)) } } @@ -10234,449 +13694,405 @@ func (s *HlsGroupSettings) Validate() error { return nil } -// SetAdMarkers sets the AdMarkers field's value. -func (s *HlsGroupSettings) SetAdMarkers(v []*string) *HlsGroupSettings { - s.AdMarkers = v +// SetBlackFrameMsec sets the BlackFrameMsec field's value. +func (s *InputLossBehavior) SetBlackFrameMsec(v int64) *InputLossBehavior { + s.BlackFrameMsec = &v return s } -// SetBaseUrlContent sets the BaseUrlContent field's value. -func (s *HlsGroupSettings) SetBaseUrlContent(v string) *HlsGroupSettings { - s.BaseUrlContent = &v +// SetInputLossImageColor sets the InputLossImageColor field's value. +func (s *InputLossBehavior) SetInputLossImageColor(v string) *InputLossBehavior { + s.InputLossImageColor = &v return s } -// SetBaseUrlManifest sets the BaseUrlManifest field's value. -func (s *HlsGroupSettings) SetBaseUrlManifest(v string) *HlsGroupSettings { - s.BaseUrlManifest = &v +// SetInputLossImageSlate sets the InputLossImageSlate field's value. +func (s *InputLossBehavior) SetInputLossImageSlate(v *InputLocation) *InputLossBehavior { + s.InputLossImageSlate = v return s } -// SetCaptionLanguageMappings sets the CaptionLanguageMappings field's value. -func (s *HlsGroupSettings) SetCaptionLanguageMappings(v []*CaptionLanguageMapping) *HlsGroupSettings { - s.CaptionLanguageMappings = v +// SetInputLossImageType sets the InputLossImageType field's value. +func (s *InputLossBehavior) SetInputLossImageType(v string) *InputLossBehavior { + s.InputLossImageType = &v return s } -// SetCaptionLanguageSetting sets the CaptionLanguageSetting field's value. -func (s *HlsGroupSettings) SetCaptionLanguageSetting(v string) *HlsGroupSettings { - s.CaptionLanguageSetting = &v +// SetRepeatFrameMsec sets the RepeatFrameMsec field's value. +func (s *InputLossBehavior) SetRepeatFrameMsec(v int64) *InputLossBehavior { + s.RepeatFrameMsec = &v return s } -// SetClientCache sets the ClientCache field's value. -func (s *HlsGroupSettings) SetClientCache(v string) *HlsGroupSettings { - s.ClientCache = &v - return s -} +// An Input Security Group +type InputSecurityGroup struct { + _ struct{} `type:"structure"` -// SetCodecSpecification sets the CodecSpecification field's value. -func (s *HlsGroupSettings) SetCodecSpecification(v string) *HlsGroupSettings { - s.CodecSpecification = &v - return s -} + // Unique ARN of Input Security Group + Arn *string `locationName:"arn" type:"string"` -// SetConstantIv sets the ConstantIv field's value. -func (s *HlsGroupSettings) SetConstantIv(v string) *HlsGroupSettings { - s.ConstantIv = &v - return s -} + // The Id of the Input Security Group + Id *string `locationName:"id" type:"string"` -// SetDestination sets the Destination field's value. -func (s *HlsGroupSettings) SetDestination(v *OutputLocationRef) *HlsGroupSettings { - s.Destination = v - return s -} + // The list of inputs currently using this Input Security Group. + Inputs []*string `locationName:"inputs" type:"list"` -// SetDirectoryStructure sets the DirectoryStructure field's value. -func (s *HlsGroupSettings) SetDirectoryStructure(v string) *HlsGroupSettings { - s.DirectoryStructure = &v - return s -} + // The current state of the Input Security Group. + State *string `locationName:"state" type:"string" enum:"InputSecurityGroupState"` -// SetEncryptionType sets the EncryptionType field's value. -func (s *HlsGroupSettings) SetEncryptionType(v string) *HlsGroupSettings { - s.EncryptionType = &v - return s -} + // A collection of key-value pairs. + Tags map[string]*string `locationName:"tags" type:"map"` -// SetHlsCdnSettings sets the HlsCdnSettings field's value. -func (s *HlsGroupSettings) SetHlsCdnSettings(v *HlsCdnSettings) *HlsGroupSettings { - s.HlsCdnSettings = v - return s + // Whitelist rules and their sync status + WhitelistRules []*InputWhitelistRule `locationName:"whitelistRules" type:"list"` } -// SetIFrameOnlyPlaylists sets the IFrameOnlyPlaylists field's value. -func (s *HlsGroupSettings) SetIFrameOnlyPlaylists(v string) *HlsGroupSettings { - s.IFrameOnlyPlaylists = &v - return s +// String returns the string representation +func (s InputSecurityGroup) String() string { + return awsutil.Prettify(s) } -// SetIndexNSegments sets the IndexNSegments field's value. -func (s *HlsGroupSettings) SetIndexNSegments(v int64) *HlsGroupSettings { - s.IndexNSegments = &v - return s +// GoString returns the string representation +func (s InputSecurityGroup) GoString() string { + return s.String() } -// SetInputLossAction sets the InputLossAction field's value. -func (s *HlsGroupSettings) SetInputLossAction(v string) *HlsGroupSettings { - s.InputLossAction = &v +// SetArn sets the Arn field's value. +func (s *InputSecurityGroup) SetArn(v string) *InputSecurityGroup { + s.Arn = &v return s } -// SetIvInManifest sets the IvInManifest field's value. -func (s *HlsGroupSettings) SetIvInManifest(v string) *HlsGroupSettings { - s.IvInManifest = &v +// SetId sets the Id field's value. +func (s *InputSecurityGroup) SetId(v string) *InputSecurityGroup { + s.Id = &v return s } -// SetIvSource sets the IvSource field's value. -func (s *HlsGroupSettings) SetIvSource(v string) *HlsGroupSettings { - s.IvSource = &v +// SetInputs sets the Inputs field's value. +func (s *InputSecurityGroup) SetInputs(v []*string) *InputSecurityGroup { + s.Inputs = v return s } -// SetKeepSegments sets the KeepSegments field's value. -func (s *HlsGroupSettings) SetKeepSegments(v int64) *HlsGroupSettings { - s.KeepSegments = &v +// SetState sets the State field's value. +func (s *InputSecurityGroup) SetState(v string) *InputSecurityGroup { + s.State = &v return s } -// SetKeyFormat sets the KeyFormat field's value. -func (s *HlsGroupSettings) SetKeyFormat(v string) *HlsGroupSettings { - s.KeyFormat = &v +// SetTags sets the Tags field's value. +func (s *InputSecurityGroup) SetTags(v map[string]*string) *InputSecurityGroup { + s.Tags = v return s } -// SetKeyFormatVersions sets the KeyFormatVersions field's value. -func (s *HlsGroupSettings) SetKeyFormatVersions(v string) *HlsGroupSettings { - s.KeyFormatVersions = &v +// SetWhitelistRules sets the WhitelistRules field's value. +func (s *InputSecurityGroup) SetWhitelistRules(v []*InputWhitelistRule) *InputSecurityGroup { + s.WhitelistRules = v return s } -// SetKeyProviderSettings sets the KeyProviderSettings field's value. -func (s *HlsGroupSettings) SetKeyProviderSettings(v *KeyProviderSettings) *HlsGroupSettings { - s.KeyProviderSettings = v - return s -} +// Live Event input parameters. There can be multiple inputs in a single Live +// Event. +type InputSettings struct { + _ struct{} `type:"structure"` -// SetManifestCompression sets the ManifestCompression field's value. -func (s *HlsGroupSettings) SetManifestCompression(v string) *HlsGroupSettings { - s.ManifestCompression = &v - return s -} + // Used to select the audio stream to decode for inputs that have multiple available. + AudioSelectors []*AudioSelector `locationName:"audioSelectors" type:"list"` -// SetManifestDurationFormat sets the ManifestDurationFormat field's value. -func (s *HlsGroupSettings) SetManifestDurationFormat(v string) *HlsGroupSettings { - s.ManifestDurationFormat = &v - return s -} + // Used to select the caption input to use for inputs that have multiple available. + CaptionSelectors []*CaptionSelector `locationName:"captionSelectors" type:"list"` -// SetMinSegmentLength sets the MinSegmentLength field's value. -func (s *HlsGroupSettings) SetMinSegmentLength(v int64) *HlsGroupSettings { - s.MinSegmentLength = &v - return s -} + // Enable or disable the deblock filter when filtering. + DeblockFilter *string `locationName:"deblockFilter" type:"string" enum:"InputDeblockFilter"` -// SetMode sets the Mode field's value. -func (s *HlsGroupSettings) SetMode(v string) *HlsGroupSettings { - s.Mode = &v - return s + // Enable or disable the denoise filter when filtering. + DenoiseFilter *string `locationName:"denoiseFilter" type:"string" enum:"InputDenoiseFilter"` + + // Adjusts the magnitude of filtering from 1 (minimal) to 5 (strongest). + FilterStrength *int64 `locationName:"filterStrength" min:"1" type:"integer"` + + // Turns on the filter for this input. MPEG-2 inputs have the deblocking filter + // enabled by default.1) auto - filtering will be applied depending on input + // type/quality2) disabled - no filtering will be applied to the input3) forced + // - filtering will be applied regardless of input type + InputFilter *string `locationName:"inputFilter" type:"string" enum:"InputFilter"` + + // Input settings. + NetworkInputSettings *NetworkInputSettings `locationName:"networkInputSettings" type:"structure"` + + // Loop input if it is a file. This allows a file input to be streamed indefinitely. + SourceEndBehavior *string `locationName:"sourceEndBehavior" type:"string" enum:"InputSourceEndBehavior"` + + // Informs which video elementary stream to decode for input types that have + // multiple available. + VideoSelector *VideoSelector `locationName:"videoSelector" type:"structure"` } -// SetOutputSelection sets the OutputSelection field's value. -func (s *HlsGroupSettings) SetOutputSelection(v string) *HlsGroupSettings { - s.OutputSelection = &v - return s +// String returns the string representation +func (s InputSettings) String() string { + return awsutil.Prettify(s) } -// SetProgramDateTime sets the ProgramDateTime field's value. -func (s *HlsGroupSettings) SetProgramDateTime(v string) *HlsGroupSettings { - s.ProgramDateTime = &v - return s +// GoString returns the string representation +func (s InputSettings) GoString() string { + return s.String() } -// SetProgramDateTimePeriod sets the ProgramDateTimePeriod field's value. -func (s *HlsGroupSettings) SetProgramDateTimePeriod(v int64) *HlsGroupSettings { - s.ProgramDateTimePeriod = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *InputSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InputSettings"} + if s.FilterStrength != nil && *s.FilterStrength < 1 { + invalidParams.Add(request.NewErrParamMinValue("FilterStrength", 1)) + } + if s.AudioSelectors != nil { + for i, v := range s.AudioSelectors { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AudioSelectors", i), err.(request.ErrInvalidParams)) + } + } + } + if s.CaptionSelectors != nil { + for i, v := range s.CaptionSelectors { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CaptionSelectors", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetRedundantManifest sets the RedundantManifest field's value. -func (s *HlsGroupSettings) SetRedundantManifest(v string) *HlsGroupSettings { - s.RedundantManifest = &v +// SetAudioSelectors sets the AudioSelectors field's value. +func (s *InputSettings) SetAudioSelectors(v []*AudioSelector) *InputSettings { + s.AudioSelectors = v return s } -// SetSegmentLength sets the SegmentLength field's value. -func (s *HlsGroupSettings) SetSegmentLength(v int64) *HlsGroupSettings { - s.SegmentLength = &v +// SetCaptionSelectors sets the CaptionSelectors field's value. +func (s *InputSettings) SetCaptionSelectors(v []*CaptionSelector) *InputSettings { + s.CaptionSelectors = v return s } -// SetSegmentationMode sets the SegmentationMode field's value. -func (s *HlsGroupSettings) SetSegmentationMode(v string) *HlsGroupSettings { - s.SegmentationMode = &v +// SetDeblockFilter sets the DeblockFilter field's value. +func (s *InputSettings) SetDeblockFilter(v string) *InputSettings { + s.DeblockFilter = &v return s } - -// SetSegmentsPerSubdirectory sets the SegmentsPerSubdirectory field's value. -func (s *HlsGroupSettings) SetSegmentsPerSubdirectory(v int64) *HlsGroupSettings { - s.SegmentsPerSubdirectory = &v + +// SetDenoiseFilter sets the DenoiseFilter field's value. +func (s *InputSettings) SetDenoiseFilter(v string) *InputSettings { + s.DenoiseFilter = &v return s } -// SetStreamInfResolution sets the StreamInfResolution field's value. -func (s *HlsGroupSettings) SetStreamInfResolution(v string) *HlsGroupSettings { - s.StreamInfResolution = &v +// SetFilterStrength sets the FilterStrength field's value. +func (s *InputSettings) SetFilterStrength(v int64) *InputSettings { + s.FilterStrength = &v return s } -// SetTimedMetadataId3Frame sets the TimedMetadataId3Frame field's value. -func (s *HlsGroupSettings) SetTimedMetadataId3Frame(v string) *HlsGroupSettings { - s.TimedMetadataId3Frame = &v +// SetInputFilter sets the InputFilter field's value. +func (s *InputSettings) SetInputFilter(v string) *InputSettings { + s.InputFilter = &v return s } -// SetTimedMetadataId3Period sets the TimedMetadataId3Period field's value. -func (s *HlsGroupSettings) SetTimedMetadataId3Period(v int64) *HlsGroupSettings { - s.TimedMetadataId3Period = &v +// SetNetworkInputSettings sets the NetworkInputSettings field's value. +func (s *InputSettings) SetNetworkInputSettings(v *NetworkInputSettings) *InputSettings { + s.NetworkInputSettings = v return s } -// SetTimestampDeltaMilliseconds sets the TimestampDeltaMilliseconds field's value. -func (s *HlsGroupSettings) SetTimestampDeltaMilliseconds(v int64) *HlsGroupSettings { - s.TimestampDeltaMilliseconds = &v +// SetSourceEndBehavior sets the SourceEndBehavior field's value. +func (s *InputSettings) SetSourceEndBehavior(v string) *InputSettings { + s.SourceEndBehavior = &v return s } -// SetTsFileMode sets the TsFileMode field's value. -func (s *HlsGroupSettings) SetTsFileMode(v string) *HlsGroupSettings { - s.TsFileMode = &v +// SetVideoSelector sets the VideoSelector field's value. +func (s *InputSettings) SetVideoSelector(v *VideoSelector) *InputSettings { + s.VideoSelector = v return s } -// Hls Input Settings -type HlsInputSettings struct { +// The settings for a PULL type input. +type InputSource struct { _ struct{} `type:"structure"` - // When specified the HLS stream with the m3u8 BANDWIDTH that most closely matches - // this value will be chosen, otherwise the highest bandwidth stream in the - // m3u8 will be chosen. The bitrate is specified in bits per second, as in an - // HLS manifest. - Bandwidth *int64 `locationName:"bandwidth" type:"integer"` - - // When specified, reading of the HLS input will begin this many buffer segments - // from the end (most recently written segment). When not specified, the HLS - // input will begin with the first segment specified in the m3u8. - BufferSegments *int64 `locationName:"bufferSegments" type:"integer"` + // The key used to extract the password from EC2 Parameter store. + PasswordParam *string `locationName:"passwordParam" type:"string"` - // The number of consecutive times that attempts to read a manifest or segment - // must fail before the input is considered unavailable. - Retries *int64 `locationName:"retries" type:"integer"` + // This represents the customer's source URL where stream ispulled from. + Url *string `locationName:"url" type:"string"` - // The number of seconds between retries when an attempt to read a manifest - // or segment fails. - RetryInterval *int64 `locationName:"retryInterval" type:"integer"` + // The username for the input source. + Username *string `locationName:"username" type:"string"` } // String returns the string representation -func (s HlsInputSettings) String() string { +func (s InputSource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HlsInputSettings) GoString() string { +func (s InputSource) GoString() string { return s.String() } -// SetBandwidth sets the Bandwidth field's value. -func (s *HlsInputSettings) SetBandwidth(v int64) *HlsInputSettings { - s.Bandwidth = &v - return s -} - -// SetBufferSegments sets the BufferSegments field's value. -func (s *HlsInputSettings) SetBufferSegments(v int64) *HlsInputSettings { - s.BufferSegments = &v +// SetPasswordParam sets the PasswordParam field's value. +func (s *InputSource) SetPasswordParam(v string) *InputSource { + s.PasswordParam = &v return s } -// SetRetries sets the Retries field's value. -func (s *HlsInputSettings) SetRetries(v int64) *HlsInputSettings { - s.Retries = &v +// SetUrl sets the Url field's value. +func (s *InputSource) SetUrl(v string) *InputSource { + s.Url = &v return s } -// SetRetryInterval sets the RetryInterval field's value. -func (s *HlsInputSettings) SetRetryInterval(v int64) *HlsInputSettings { - s.RetryInterval = &v +// SetUsername sets the Username field's value. +func (s *InputSource) SetUsername(v string) *InputSource { + s.Username = &v return s } -// Hls Media Store Settings -type HlsMediaStoreSettings struct { +// Settings for for a PULL type input. +type InputSourceRequest struct { _ struct{} `type:"structure"` - // Number of seconds to wait before retrying connection to the CDN if the connection - // is lost. - ConnectionRetryInterval *int64 `locationName:"connectionRetryInterval" type:"integer"` - - // Size in seconds of file cache for streaming outputs. - FilecacheDuration *int64 `locationName:"filecacheDuration" type:"integer"` - - // When set to temporal, output files are stored in non-persistent memory for - // faster reading and writing. - MediaStoreStorageClass *string `locationName:"mediaStoreStorageClass" type:"string" enum:"HlsMediaStoreStorageClass"` + // The key used to extract the password from EC2 Parameter store. + PasswordParam *string `locationName:"passwordParam" type:"string"` - // Number of retry attempts that will be made before the Live Event is put into - // an error state. - NumRetries *int64 `locationName:"numRetries" type:"integer"` + // This represents the customer's source URL where stream ispulled from. + Url *string `locationName:"url" type:"string"` - // If a streaming output fails, number of seconds to wait until a restart is - // initiated. A value of 0 means never restart. - RestartDelay *int64 `locationName:"restartDelay" type:"integer"` + // The username for the input source. + Username *string `locationName:"username" type:"string"` } // String returns the string representation -func (s HlsMediaStoreSettings) String() string { +func (s InputSourceRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HlsMediaStoreSettings) GoString() string { +func (s InputSourceRequest) GoString() string { return s.String() } -// SetConnectionRetryInterval sets the ConnectionRetryInterval field's value. -func (s *HlsMediaStoreSettings) SetConnectionRetryInterval(v int64) *HlsMediaStoreSettings { - s.ConnectionRetryInterval = &v - return s -} - -// SetFilecacheDuration sets the FilecacheDuration field's value. -func (s *HlsMediaStoreSettings) SetFilecacheDuration(v int64) *HlsMediaStoreSettings { - s.FilecacheDuration = &v - return s -} - -// SetMediaStoreStorageClass sets the MediaStoreStorageClass field's value. -func (s *HlsMediaStoreSettings) SetMediaStoreStorageClass(v string) *HlsMediaStoreSettings { - s.MediaStoreStorageClass = &v +// SetPasswordParam sets the PasswordParam field's value. +func (s *InputSourceRequest) SetPasswordParam(v string) *InputSourceRequest { + s.PasswordParam = &v return s } -// SetNumRetries sets the NumRetries field's value. -func (s *HlsMediaStoreSettings) SetNumRetries(v int64) *HlsMediaStoreSettings { - s.NumRetries = &v +// SetUrl sets the Url field's value. +func (s *InputSourceRequest) SetUrl(v string) *InputSourceRequest { + s.Url = &v return s } -// SetRestartDelay sets the RestartDelay field's value. -func (s *HlsMediaStoreSettings) SetRestartDelay(v int64) *HlsMediaStoreSettings { - s.RestartDelay = &v +// SetUsername sets the Username field's value. +func (s *InputSourceRequest) SetUsername(v string) *InputSourceRequest { + s.Username = &v return s } -// Hls Output Settings -type HlsOutputSettings struct { +type InputSpecification struct { _ struct{} `type:"structure"` - // Settings regarding the underlying stream. These settings are different for - // audio-only outputs. - // - // HlsSettings is a required field - HlsSettings *HlsSettings `locationName:"hlsSettings" type:"structure" required:"true"` + // Input codec + Codec *string `locationName:"codec" type:"string" enum:"InputCodec"` - // String concatenated to the end of the destination filename. Accepts \"Format - // Identifiers\":#formatIdentifierParameters. - NameModifier *string `locationName:"nameModifier" min:"1" type:"string"` + // Maximum input bitrate, categorized coarsely + MaximumBitrate *string `locationName:"maximumBitrate" type:"string" enum:"InputMaximumBitrate"` - // String concatenated to end of segment filenames. - SegmentModifier *string `locationName:"segmentModifier" type:"string"` + // Input resolution, categorized coarsely + Resolution *string `locationName:"resolution" type:"string" enum:"InputResolution"` } // String returns the string representation -func (s HlsOutputSettings) String() string { +func (s InputSpecification) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HlsOutputSettings) GoString() string { +func (s InputSpecification) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *HlsOutputSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HlsOutputSettings"} - if s.HlsSettings == nil { - invalidParams.Add(request.NewErrParamRequired("HlsSettings")) - } - if s.NameModifier != nil && len(*s.NameModifier) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NameModifier", 1)) - } - if s.HlsSettings != nil { - if err := s.HlsSettings.Validate(); err != nil { - invalidParams.AddNested("HlsSettings", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHlsSettings sets the HlsSettings field's value. -func (s *HlsOutputSettings) SetHlsSettings(v *HlsSettings) *HlsOutputSettings { - s.HlsSettings = v +// SetCodec sets the Codec field's value. +func (s *InputSpecification) SetCodec(v string) *InputSpecification { + s.Codec = &v return s } -// SetNameModifier sets the NameModifier field's value. -func (s *HlsOutputSettings) SetNameModifier(v string) *HlsOutputSettings { - s.NameModifier = &v +// SetMaximumBitrate sets the MaximumBitrate field's value. +func (s *InputSpecification) SetMaximumBitrate(v string) *InputSpecification { + s.MaximumBitrate = &v return s } -// SetSegmentModifier sets the SegmentModifier field's value. -func (s *HlsOutputSettings) SetSegmentModifier(v string) *HlsOutputSettings { - s.SegmentModifier = &v +// SetResolution sets the Resolution field's value. +func (s *InputSpecification) SetResolution(v string) *InputSpecification { + s.Resolution = &v return s } -// Hls Settings -type HlsSettings struct { +// Settings for the "switch input" action: to switch from ingesting one input +// to ingesting another input. +type InputSwitchScheduleActionSettings struct { _ struct{} `type:"structure"` - // Audio Only Hls Settings - AudioOnlyHlsSettings *AudioOnlyHlsSettings `locationName:"audioOnlyHlsSettings" type:"structure"` + // The name of the input attachment (not the name of the input!) to switch to. + // The name is specified in the channel configuration. + // + // InputAttachmentNameReference is a required field + InputAttachmentNameReference *string `locationName:"inputAttachmentNameReference" type:"string" required:"true"` - // Standard Hls Settings - StandardHlsSettings *StandardHlsSettings `locationName:"standardHlsSettings" type:"structure"` + // Settings to let you create a clip of the file input, in order to set up the + // input to ingest only a portion of the file. + InputClippingSettings *InputClippingSettings `locationName:"inputClippingSettings" type:"structure"` + + // The value for the variable portion of the URL for the dynamic input, for + // this instance of the input. Each time you use the same dynamic input in an + // input switch action, you can provide a different value, in order to connect + // the input to a different content source. + UrlPath []*string `locationName:"urlPath" type:"list"` } // String returns the string representation -func (s HlsSettings) String() string { +func (s InputSwitchScheduleActionSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HlsSettings) GoString() string { +func (s InputSwitchScheduleActionSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *HlsSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HlsSettings"} - if s.AudioOnlyHlsSettings != nil { - if err := s.AudioOnlyHlsSettings.Validate(); err != nil { - invalidParams.AddNested("AudioOnlyHlsSettings", err.(request.ErrInvalidParams)) - } +func (s *InputSwitchScheduleActionSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InputSwitchScheduleActionSettings"} + if s.InputAttachmentNameReference == nil { + invalidParams.Add(request.NewErrParamRequired("InputAttachmentNameReference")) } - if s.StandardHlsSettings != nil { - if err := s.StandardHlsSettings.Validate(); err != nil { - invalidParams.AddNested("StandardHlsSettings", err.(request.ErrInvalidParams)) + if s.InputClippingSettings != nil { + if err := s.InputClippingSettings.Validate(); err != nil { + invalidParams.AddNested("InputClippingSettings", err.(request.ErrInvalidParams)) } } @@ -10686,43 +14102,58 @@ func (s *HlsSettings) Validate() error { return nil } -// SetAudioOnlyHlsSettings sets the AudioOnlyHlsSettings field's value. -func (s *HlsSettings) SetAudioOnlyHlsSettings(v *AudioOnlyHlsSettings) *HlsSettings { - s.AudioOnlyHlsSettings = v +// SetInputAttachmentNameReference sets the InputAttachmentNameReference field's value. +func (s *InputSwitchScheduleActionSettings) SetInputAttachmentNameReference(v string) *InputSwitchScheduleActionSettings { + s.InputAttachmentNameReference = &v + return s +} + +// SetInputClippingSettings sets the InputClippingSettings field's value. +func (s *InputSwitchScheduleActionSettings) SetInputClippingSettings(v *InputClippingSettings) *InputSwitchScheduleActionSettings { + s.InputClippingSettings = v return s } -// SetStandardHlsSettings sets the StandardHlsSettings field's value. -func (s *HlsSettings) SetStandardHlsSettings(v *StandardHlsSettings) *HlsSettings { - s.StandardHlsSettings = v +// SetUrlPath sets the UrlPath field's value. +func (s *InputSwitchScheduleActionSettings) SetUrlPath(v []*string) *InputSwitchScheduleActionSettings { + s.UrlPath = v return s } -// Settings for the action to emit HLS metadata -type HlsTimedMetadataScheduleActionSettings struct { +// Settings for a private VPC Input.When this property is specified, the input +// destination addresses will be created in a VPC rather than with public Internet +// addresses.This property requires setting the roleArn property on Input creation.Not +// compatible with the inputSecurityGroups property. +type InputVpcRequest struct { _ struct{} `type:"structure"` - // Base64 string formatted according to the ID3 specification: http://id3.org/id3v2.4.0-structure + // A list of up to 5 EC2 VPC security group IDs to attach to the Input VPC network + // interfaces.Requires subnetIds. If none are specified then the VPC default + // security group will be used. + SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` + + // A list of 2 VPC subnet IDs from the same VPC.Subnet IDs must be mapped to + // two unique availability zones (AZ). // - // Id3 is a required field - Id3 *string `locationName:"id3" type:"string" required:"true"` + // SubnetIds is a required field + SubnetIds []*string `locationName:"subnetIds" type:"list" required:"true"` } // String returns the string representation -func (s HlsTimedMetadataScheduleActionSettings) String() string { +func (s InputVpcRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HlsTimedMetadataScheduleActionSettings) GoString() string { +func (s InputVpcRequest) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *HlsTimedMetadataScheduleActionSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HlsTimedMetadataScheduleActionSettings"} - if s.Id3 == nil { - invalidParams.Add(request.NewErrParamRequired("Id3")) +func (s *InputVpcRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InputVpcRequest"} + if s.SubnetIds == nil { + invalidParams.Add(request.NewErrParamRequired("SubnetIds")) } if invalidParams.Len() > 0 { @@ -10731,270 +14162,183 @@ func (s *HlsTimedMetadataScheduleActionSettings) Validate() error { return nil } -// SetId3 sets the Id3 field's value. -func (s *HlsTimedMetadataScheduleActionSettings) SetId3(v string) *HlsTimedMetadataScheduleActionSettings { - s.Id3 = &v +// SetSecurityGroupIds sets the SecurityGroupIds field's value. +func (s *InputVpcRequest) SetSecurityGroupIds(v []*string) *InputVpcRequest { + s.SecurityGroupIds = v return s } -// Hls Webdav Settings -type HlsWebdavSettings struct { - _ struct{} `type:"structure"` - - // Number of seconds to wait before retrying connection to the CDN if the connection - // is lost. - ConnectionRetryInterval *int64 `locationName:"connectionRetryInterval" type:"integer"` - - // Size in seconds of file cache for streaming outputs. - FilecacheDuration *int64 `locationName:"filecacheDuration" type:"integer"` - - // Specify whether or not to use chunked transfer encoding to WebDAV. - HttpTransferMode *string `locationName:"httpTransferMode" type:"string" enum:"HlsWebdavHttpTransferMode"` +// SetSubnetIds sets the SubnetIds field's value. +func (s *InputVpcRequest) SetSubnetIds(v []*string) *InputVpcRequest { + s.SubnetIds = v + return s +} - // Number of retry attempts that will be made before the Live Event is put into - // an error state. - NumRetries *int64 `locationName:"numRetries" type:"integer"` +// Whitelist rule +type InputWhitelistRule struct { + _ struct{} `type:"structure"` - // If a streaming output fails, number of seconds to wait until a restart is - // initiated. A value of 0 means never restart. - RestartDelay *int64 `locationName:"restartDelay" type:"integer"` + // The IPv4 CIDR that's whitelisted. + Cidr *string `locationName:"cidr" type:"string"` } // String returns the string representation -func (s HlsWebdavSettings) String() string { +func (s InputWhitelistRule) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HlsWebdavSettings) GoString() string { +func (s InputWhitelistRule) GoString() string { return s.String() } -// SetConnectionRetryInterval sets the ConnectionRetryInterval field's value. -func (s *HlsWebdavSettings) SetConnectionRetryInterval(v int64) *HlsWebdavSettings { - s.ConnectionRetryInterval = &v - return s -} - -// SetFilecacheDuration sets the FilecacheDuration field's value. -func (s *HlsWebdavSettings) SetFilecacheDuration(v int64) *HlsWebdavSettings { - s.FilecacheDuration = &v - return s -} - -// SetHttpTransferMode sets the HttpTransferMode field's value. -func (s *HlsWebdavSettings) SetHttpTransferMode(v string) *HlsWebdavSettings { - s.HttpTransferMode = &v - return s -} - -// SetNumRetries sets the NumRetries field's value. -func (s *HlsWebdavSettings) SetNumRetries(v int64) *HlsWebdavSettings { - s.NumRetries = &v - return s -} - -// SetRestartDelay sets the RestartDelay field's value. -func (s *HlsWebdavSettings) SetRestartDelay(v int64) *HlsWebdavSettings { - s.RestartDelay = &v +// SetCidr sets the Cidr field's value. +func (s *InputWhitelistRule) SetCidr(v string) *InputWhitelistRule { + s.Cidr = &v return s } -// Settings to configure an action so that it occurs immediately. This is only -// supported for input switch actions currently. -type ImmediateModeScheduleActionStartSettings struct { +// An IPv4 CIDR to whitelist. +type InputWhitelistRuleCidr struct { _ struct{} `type:"structure"` + + // The IPv4 CIDR to whitelist. + Cidr *string `locationName:"cidr" type:"string"` } // String returns the string representation -func (s ImmediateModeScheduleActionStartSettings) String() string { +func (s InputWhitelistRuleCidr) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ImmediateModeScheduleActionStartSettings) GoString() string { +func (s InputWhitelistRuleCidr) GoString() string { return s.String() } -type Input struct { - _ struct{} `type:"structure"` - - // The Unique ARN of the input (generated, immutable). - Arn *string `locationName:"arn" type:"string"` - - // A list of channel IDs that that input is attached to (currently an input - // can only be attached to one channel). - AttachedChannels []*string `locationName:"attachedChannels" type:"list"` - - // A list of the destinations of the input (PUSH-type). - Destinations []*InputDestination `locationName:"destinations" type:"list"` - - // The generated ID of the input (unique for user account, immutable). - Id *string `locationName:"id" type:"string"` - - // STANDARD - MediaLive expects two sources to be connected to this input. If - // the channel is also STANDARD, both sources will be ingested. If the channel - // is SINGLE_PIPELINE, only the first source will be ingested; the second source - // will always be ignored, even if the first source fails.SINGLE_PIPELINE - - // You can connect only one source to this input. If the ChannelClass is also - // SINGLE_PIPELINE, this value is valid. If the ChannelClass is STANDARD, this - // value is not valid because the channel requires two sources in the input. - InputClass *string `locationName:"inputClass" type:"string" enum:"InputClass"` - - // Certain pull input sources can be dynamic, meaning that they can have their - // URL's dynamically changesduring input switch actions. Presently, this functionality - // only works with MP4_FILE inputs. - InputSourceType *string `locationName:"inputSourceType" type:"string" enum:"InputSourceType"` - - // A list of MediaConnect Flows for this input. - MediaConnectFlows []*MediaConnectFlow `locationName:"mediaConnectFlows" type:"list"` - - // The user-assigned name (This is a mutable value). - Name *string `locationName:"name" type:"string"` - - // The Amazon Resource Name (ARN) of the role this input assumes during and - // after creation. - RoleArn *string `locationName:"roleArn" type:"string"` - - // A list of IDs for all the Input Security Groups attached to the input. - SecurityGroups []*string `locationName:"securityGroups" type:"list"` - - // A list of the sources of the input (PULL-type). - Sources []*InputSource `locationName:"sources" type:"list"` - - State *string `locationName:"state" type:"string" enum:"InputState"` +// SetCidr sets the Cidr field's value. +func (s *InputWhitelistRuleCidr) SetCidr(v string) *InputWhitelistRuleCidr { + s.Cidr = &v + return s +} - // A collection of key-value pairs. - Tags map[string]*string `locationName:"tags" type:"map"` +type InternalServerErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - Type *string `locationName:"type" type:"string" enum:"InputType"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s Input) String() string { +func (s InternalServerErrorException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Input) GoString() string { +func (s InternalServerErrorException) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *Input) SetArn(v string) *Input { - s.Arn = &v - return s +func newErrorInternalServerErrorException(v protocol.ResponseMetadata) error { + return &InternalServerErrorException{ + respMetadata: v, + } } -// SetAttachedChannels sets the AttachedChannels field's value. -func (s *Input) SetAttachedChannels(v []*string) *Input { - s.AttachedChannels = v - return s +// Code returns the exception type name. +func (s InternalServerErrorException) Code() string { + return "InternalServerErrorException" } -// SetDestinations sets the Destinations field's value. -func (s *Input) SetDestinations(v []*InputDestination) *Input { - s.Destinations = v - return s +// Message returns the exception's message. +func (s InternalServerErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetId sets the Id field's value. -func (s *Input) SetId(v string) *Input { - s.Id = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerErrorException) OrigErr() error { + return nil } -// SetInputClass sets the InputClass field's value. -func (s *Input) SetInputClass(v string) *Input { - s.InputClass = &v - return s +func (s InternalServerErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetInputSourceType sets the InputSourceType field's value. -func (s *Input) SetInputSourceType(v string) *Input { - s.InputSourceType = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerErrorException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetMediaConnectFlows sets the MediaConnectFlows field's value. -func (s *Input) SetMediaConnectFlows(v []*MediaConnectFlow) *Input { - s.MediaConnectFlows = v - return s +// RequestID returns the service's response RequestID for request. +func (s InternalServerErrorException) RequestID() string { + return s.respMetadata.RequestID } -// SetName sets the Name field's value. -func (s *Input) SetName(v string) *Input { - s.Name = &v - return s -} +// Key Provider Settings +type KeyProviderSettings struct { + _ struct{} `type:"structure"` -// SetRoleArn sets the RoleArn field's value. -func (s *Input) SetRoleArn(v string) *Input { - s.RoleArn = &v - return s + // Static Key Settings + StaticKeySettings *StaticKeySettings `locationName:"staticKeySettings" type:"structure"` } -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *Input) SetSecurityGroups(v []*string) *Input { - s.SecurityGroups = v - return s +// String returns the string representation +func (s KeyProviderSettings) String() string { + return awsutil.Prettify(s) } -// SetSources sets the Sources field's value. -func (s *Input) SetSources(v []*InputSource) *Input { - s.Sources = v - return s +// GoString returns the string representation +func (s KeyProviderSettings) GoString() string { + return s.String() } -// SetState sets the State field's value. -func (s *Input) SetState(v string) *Input { - s.State = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *KeyProviderSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "KeyProviderSettings"} + if s.StaticKeySettings != nil { + if err := s.StaticKeySettings.Validate(); err != nil { + invalidParams.AddNested("StaticKeySettings", err.(request.ErrInvalidParams)) + } + } -// SetTags sets the Tags field's value. -func (s *Input) SetTags(v map[string]*string) *Input { - s.Tags = v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetType sets the Type field's value. -func (s *Input) SetType(v string) *Input { - s.Type = &v +// SetStaticKeySettings sets the StaticKeySettings field's value. +func (s *KeyProviderSettings) SetStaticKeySettings(v *StaticKeySettings) *KeyProviderSettings { + s.StaticKeySettings = v return s } -type InputAttachment struct { +type ListChannelsInput struct { _ struct{} `type:"structure"` - // User-specified name for the attachment. This is required if the user wants - // to use this input in an input switch action. - InputAttachmentName *string `locationName:"inputAttachmentName" type:"string"` - - // The ID of the input - InputId *string `locationName:"inputId" type:"string"` + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - // Settings of an input (caption selector, etc.) - InputSettings *InputSettings `locationName:"inputSettings" type:"structure"` + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` } // String returns the string representation -func (s InputAttachment) String() string { +func (s ListChannelsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InputAttachment) GoString() string { +func (s ListChannelsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *InputAttachment) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputAttachment"} - if s.InputSettings != nil { - if err := s.InputSettings.Validate(); err != nil { - invalidParams.AddNested("InputSettings", err.(request.ErrInvalidParams)) - } +func (s *ListChannelsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListChannelsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -11003,113 +14347,71 @@ func (s *InputAttachment) Validate() error { return nil } -// SetInputAttachmentName sets the InputAttachmentName field's value. -func (s *InputAttachment) SetInputAttachmentName(v string) *InputAttachment { - s.InputAttachmentName = &v - return s -} - -// SetInputId sets the InputId field's value. -func (s *InputAttachment) SetInputId(v string) *InputAttachment { - s.InputId = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListChannelsInput) SetMaxResults(v int64) *ListChannelsInput { + s.MaxResults = &v return s } -// SetInputSettings sets the InputSettings field's value. -func (s *InputAttachment) SetInputSettings(v *InputSettings) *InputAttachment { - s.InputSettings = v +// SetNextToken sets the NextToken field's value. +func (s *ListChannelsInput) SetNextToken(v string) *ListChannelsInput { + s.NextToken = &v return s } -// Input Channel Level -type InputChannelLevel struct { +type ListChannelsOutput struct { _ struct{} `type:"structure"` - // Remixing value. Units are in dB and acceptable values are within the range - // from -60 (mute) and 6 dB. - // - // Gain is a required field - Gain *int64 `locationName:"gain" type:"integer" required:"true"` + Channels []*ChannelSummary `locationName:"channels" type:"list"` - // The index of the input channel used as a source. - // - // InputChannel is a required field - InputChannel *int64 `locationName:"inputChannel" type:"integer" required:"true"` + NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation -func (s InputChannelLevel) String() string { +func (s ListChannelsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InputChannelLevel) GoString() string { +func (s ListChannelsOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputChannelLevel) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputChannelLevel"} - if s.Gain == nil { - invalidParams.Add(request.NewErrParamRequired("Gain")) - } - if s.Gain != nil && *s.Gain < -60 { - invalidParams.Add(request.NewErrParamMinValue("Gain", -60)) - } - if s.InputChannel == nil { - invalidParams.Add(request.NewErrParamRequired("InputChannel")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGain sets the Gain field's value. -func (s *InputChannelLevel) SetGain(v int64) *InputChannelLevel { - s.Gain = &v +// SetChannels sets the Channels field's value. +func (s *ListChannelsOutput) SetChannels(v []*ChannelSummary) *ListChannelsOutput { + s.Channels = v return s } -// SetInputChannel sets the InputChannel field's value. -func (s *InputChannelLevel) SetInputChannel(v int64) *InputChannelLevel { - s.InputChannel = &v +// SetNextToken sets the NextToken field's value. +func (s *ListChannelsOutput) SetNextToken(v string) *ListChannelsOutput { + s.NextToken = &v return s } -// Settings to let you create a clip of the file input, in order to set up the -// input to ingest only a portion of the file. -type InputClippingSettings struct { +type ListInputSecurityGroupsInput struct { _ struct{} `type:"structure"` - // The source of the timecodes in the source being clipped. - // - // InputTimecodeSource is a required field - InputTimecodeSource *string `locationName:"inputTimecodeSource" type:"string" required:"true" enum:"InputTimecodeSource"` - - // Settings to identify the start of the clip. - StartTimecode *StartTimecode `locationName:"startTimecode" type:"structure"` + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - // Settings to identify the end of the clip. - StopTimecode *StopTimecode `locationName:"stopTimecode" type:"structure"` + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` } // String returns the string representation -func (s InputClippingSettings) String() string { +func (s ListInputSecurityGroupsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InputClippingSettings) GoString() string { +func (s ListInputSecurityGroupsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *InputClippingSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputClippingSettings"} - if s.InputTimecodeSource == nil { - invalidParams.Add(request.NewErrParamRequired("InputTimecodeSource")) +func (s *ListInputSecurityGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListInputSecurityGroupsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -11118,169 +14420,153 @@ func (s *InputClippingSettings) Validate() error { return nil } -// SetInputTimecodeSource sets the InputTimecodeSource field's value. -func (s *InputClippingSettings) SetInputTimecodeSource(v string) *InputClippingSettings { - s.InputTimecodeSource = &v - return s -} - -// SetStartTimecode sets the StartTimecode field's value. -func (s *InputClippingSettings) SetStartTimecode(v *StartTimecode) *InputClippingSettings { - s.StartTimecode = v +// SetMaxResults sets the MaxResults field's value. +func (s *ListInputSecurityGroupsInput) SetMaxResults(v int64) *ListInputSecurityGroupsInput { + s.MaxResults = &v return s } -// SetStopTimecode sets the StopTimecode field's value. -func (s *InputClippingSettings) SetStopTimecode(v *StopTimecode) *InputClippingSettings { - s.StopTimecode = v +// SetNextToken sets the NextToken field's value. +func (s *ListInputSecurityGroupsInput) SetNextToken(v string) *ListInputSecurityGroupsInput { + s.NextToken = &v return s } -// The settings for a PUSH type input. -type InputDestination struct { +type ListInputSecurityGroupsOutput struct { _ struct{} `type:"structure"` - // The system-generated static IP address of endpoint.It remains fixed for the - // lifetime of the input. - Ip *string `locationName:"ip" type:"string"` - - // The port number for the input. - Port *string `locationName:"port" type:"string"` - - // This represents the endpoint that the customer stream will bepushed to. - Url *string `locationName:"url" type:"string"` + InputSecurityGroups []*InputSecurityGroup `locationName:"inputSecurityGroups" type:"list"` - // The properties for a VPC type input destination. - Vpc *InputDestinationVpc `locationName:"vpc" type:"structure"` + NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation -func (s InputDestination) String() string { +func (s ListInputSecurityGroupsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InputDestination) GoString() string { +func (s ListInputSecurityGroupsOutput) GoString() string { return s.String() } -// SetIp sets the Ip field's value. -func (s *InputDestination) SetIp(v string) *InputDestination { - s.Ip = &v - return s -} - -// SetPort sets the Port field's value. -func (s *InputDestination) SetPort(v string) *InputDestination { - s.Port = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *InputDestination) SetUrl(v string) *InputDestination { - s.Url = &v +// SetInputSecurityGroups sets the InputSecurityGroups field's value. +func (s *ListInputSecurityGroupsOutput) SetInputSecurityGroups(v []*InputSecurityGroup) *ListInputSecurityGroupsOutput { + s.InputSecurityGroups = v return s } -// SetVpc sets the Vpc field's value. -func (s *InputDestination) SetVpc(v *InputDestinationVpc) *InputDestination { - s.Vpc = v +// SetNextToken sets the NextToken field's value. +func (s *ListInputSecurityGroupsOutput) SetNextToken(v string) *ListInputSecurityGroupsOutput { + s.NextToken = &v return s } -// Endpoint settings for a PUSH type input. -type InputDestinationRequest struct { +type ListInputsInput struct { _ struct{} `type:"structure"` - // A unique name for the location the RTMP stream is being pushedto. - StreamName *string `locationName:"streamName" type:"string"` + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` } // String returns the string representation -func (s InputDestinationRequest) String() string { +func (s ListInputsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InputDestinationRequest) GoString() string { +func (s ListInputsInput) GoString() string { return s.String() } -// SetStreamName sets the StreamName field's value. -func (s *InputDestinationRequest) SetStreamName(v string) *InputDestinationRequest { - s.StreamName = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListInputsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListInputsInput"} + 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 *ListInputsInput) SetMaxResults(v int64) *ListInputsInput { + s.MaxResults = &v return s } -// The properties for a VPC type input destination. -type InputDestinationVpc struct { +// SetNextToken sets the NextToken field's value. +func (s *ListInputsInput) SetNextToken(v string) *ListInputsInput { + s.NextToken = &v + return s +} + +type ListInputsOutput struct { _ struct{} `type:"structure"` - // The availability zone of the Input destination. - AvailabilityZone *string `locationName:"availabilityZone" type:"string"` + Inputs []*Input `locationName:"inputs" type:"list"` - // The network interface ID of the Input destination in the VPC. - NetworkInterfaceId *string `locationName:"networkInterfaceId" type:"string"` + NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation -func (s InputDestinationVpc) String() string { +func (s ListInputsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InputDestinationVpc) GoString() string { +func (s ListInputsOutput) GoString() string { return s.String() } -// SetAvailabilityZone sets the AvailabilityZone field's value. -func (s *InputDestinationVpc) SetAvailabilityZone(v string) *InputDestinationVpc { - s.AvailabilityZone = &v +// SetInputs sets the Inputs field's value. +func (s *ListInputsOutput) SetInputs(v []*Input) *ListInputsOutput { + s.Inputs = v return s } -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *InputDestinationVpc) SetNetworkInterfaceId(v string) *InputDestinationVpc { - s.NetworkInterfaceId = &v +// SetNextToken sets the NextToken field's value. +func (s *ListInputsOutput) SetNextToken(v string) *ListInputsOutput { + s.NextToken = &v return s } -// Input Location -type InputLocation struct { +type ListMultiplexProgramsInput struct { _ struct{} `type:"structure"` - // key used to extract the password from EC2 Parameter store - PasswordParam *string `locationName:"passwordParam" type:"string"` + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - // Uniform Resource Identifier - This should be a path to a file accessible - // to the Live system (eg. a http:// URI) depending on the output type. For - // example, a RTMP destination should have a uri simliar to: "rtmp://fmsserver/live". - // - // Uri is a required field - Uri *string `locationName:"uri" type:"string" required:"true"` + // MultiplexId is a required field + MultiplexId *string `location:"uri" locationName:"multiplexId" type:"string" required:"true"` - // Username if credentials are required to access a file or publishing point. - // This can be either a plaintext username, or a reference to an AWS parameter - // store name from which the username can be retrieved. AWS Parameter store - // format: "ssm://" - Username *string `locationName:"username" type:"string"` + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` } // String returns the string representation -func (s InputLocation) String() string { +func (s ListMultiplexProgramsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InputLocation) GoString() string { +func (s ListMultiplexProgramsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *InputLocation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputLocation"} - if s.Uri == nil { - invalidParams.Add(request.NewErrParamRequired("Uri")) +func (s *ListMultiplexProgramsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListMultiplexProgramsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.MultiplexId == nil { + invalidParams.Add(request.NewErrParamRequired("MultiplexId")) + } + if s.MultiplexId != nil && len(*s.MultiplexId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MultiplexId", 1)) } if invalidParams.Len() > 0 { @@ -11289,72 +14575,77 @@ func (s *InputLocation) Validate() error { return nil } -// SetPasswordParam sets the PasswordParam field's value. -func (s *InputLocation) SetPasswordParam(v string) *InputLocation { - s.PasswordParam = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListMultiplexProgramsInput) SetMaxResults(v int64) *ListMultiplexProgramsInput { + s.MaxResults = &v return s } -// SetUri sets the Uri field's value. -func (s *InputLocation) SetUri(v string) *InputLocation { - s.Uri = &v +// SetMultiplexId sets the MultiplexId field's value. +func (s *ListMultiplexProgramsInput) SetMultiplexId(v string) *ListMultiplexProgramsInput { + s.MultiplexId = &v return s } -// SetUsername sets the Username field's value. -func (s *InputLocation) SetUsername(v string) *InputLocation { - s.Username = &v +// SetNextToken sets the NextToken field's value. +func (s *ListMultiplexProgramsInput) SetNextToken(v string) *ListMultiplexProgramsInput { + s.NextToken = &v return s } -// Input Loss Behavior -type InputLossBehavior struct { +type ListMultiplexProgramsOutput struct { _ struct{} `type:"structure"` - // On input loss, the number of milliseconds to substitute black into the output - // before switching to the frame specified by inputLossImageType. A value x, - // where 0 <= x <= 1,000,000 and a value of 1,000,000 will be interpreted as - // infinite. - BlackFrameMsec *int64 `locationName:"blackFrameMsec" type:"integer"` + MultiplexPrograms []*MultiplexProgramSummary `locationName:"multiplexPrograms" type:"list"` - // When input loss image type is "color" this field specifies the color to use. - // Value: 6 hex characters representing the values of RGB. - InputLossImageColor *string `locationName:"inputLossImageColor" min:"6" type:"string"` + NextToken *string `locationName:"nextToken" type:"string"` +} - // When input loss image type is "slate" these fields specify the parameters - // for accessing the slate. - InputLossImageSlate *InputLocation `locationName:"inputLossImageSlate" type:"structure"` +// String returns the string representation +func (s ListMultiplexProgramsOutput) String() string { + return awsutil.Prettify(s) +} - // Indicates whether to substitute a solid color or a slate into the output - // after input loss exceeds blackFrameMsec. - InputLossImageType *string `locationName:"inputLossImageType" type:"string" enum:"InputLossImageType"` +// GoString returns the string representation +func (s ListMultiplexProgramsOutput) GoString() string { + return s.String() +} - // On input loss, the number of milliseconds to repeat the previous picture - // before substituting black into the output. A value x, where 0 <= x <= 1,000,000 - // and a value of 1,000,000 will be interpreted as infinite. - RepeatFrameMsec *int64 `locationName:"repeatFrameMsec" type:"integer"` +// SetMultiplexPrograms sets the MultiplexPrograms field's value. +func (s *ListMultiplexProgramsOutput) SetMultiplexPrograms(v []*MultiplexProgramSummary) *ListMultiplexProgramsOutput { + s.MultiplexPrograms = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListMultiplexProgramsOutput) SetNextToken(v string) *ListMultiplexProgramsOutput { + s.NextToken = &v + return s +} + +type ListMultiplexesInput struct { + _ struct{} `type:"structure"` + + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` } // String returns the string representation -func (s InputLossBehavior) String() string { +func (s ListMultiplexesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InputLossBehavior) GoString() string { +func (s ListMultiplexesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *InputLossBehavior) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputLossBehavior"} - if s.InputLossImageColor != nil && len(*s.InputLossImageColor) < 6 { - invalidParams.Add(request.NewErrParamMinLen("InputLossImageColor", 6)) - } - if s.InputLossImageSlate != nil { - if err := s.InputLossImageSlate.Validate(); err != nil { - invalidParams.AddNested("InputLossImageSlate", err.(request.ErrInvalidParams)) - } +func (s *ListMultiplexesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListMultiplexesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -11363,177 +14654,91 @@ func (s *InputLossBehavior) Validate() error { return nil } -// SetBlackFrameMsec sets the BlackFrameMsec field's value. -func (s *InputLossBehavior) SetBlackFrameMsec(v int64) *InputLossBehavior { - s.BlackFrameMsec = &v - return s -} - -// SetInputLossImageColor sets the InputLossImageColor field's value. -func (s *InputLossBehavior) SetInputLossImageColor(v string) *InputLossBehavior { - s.InputLossImageColor = &v - return s -} - -// SetInputLossImageSlate sets the InputLossImageSlate field's value. -func (s *InputLossBehavior) SetInputLossImageSlate(v *InputLocation) *InputLossBehavior { - s.InputLossImageSlate = v - return s -} - -// SetInputLossImageType sets the InputLossImageType field's value. -func (s *InputLossBehavior) SetInputLossImageType(v string) *InputLossBehavior { - s.InputLossImageType = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListMultiplexesInput) SetMaxResults(v int64) *ListMultiplexesInput { + s.MaxResults = &v return s } -// SetRepeatFrameMsec sets the RepeatFrameMsec field's value. -func (s *InputLossBehavior) SetRepeatFrameMsec(v int64) *InputLossBehavior { - s.RepeatFrameMsec = &v +// SetNextToken sets the NextToken field's value. +func (s *ListMultiplexesInput) SetNextToken(v string) *ListMultiplexesInput { + s.NextToken = &v return s } -// An Input Security Group -type InputSecurityGroup struct { +type ListMultiplexesOutput struct { _ struct{} `type:"structure"` - // Unique ARN of Input Security Group - Arn *string `locationName:"arn" type:"string"` - - // The Id of the Input Security Group - Id *string `locationName:"id" type:"string"` - - // The list of inputs currently using this Input Security Group. - Inputs []*string `locationName:"inputs" type:"list"` - - // The current state of the Input Security Group. - State *string `locationName:"state" type:"string" enum:"InputSecurityGroupState"` - - // A collection of key-value pairs. - Tags map[string]*string `locationName:"tags" type:"map"` + Multiplexes []*MultiplexSummary `locationName:"multiplexes" type:"list"` - // Whitelist rules and their sync status - WhitelistRules []*InputWhitelistRule `locationName:"whitelistRules" type:"list"` + NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation -func (s InputSecurityGroup) String() string { +func (s ListMultiplexesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InputSecurityGroup) GoString() string { +func (s ListMultiplexesOutput) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *InputSecurityGroup) SetArn(v string) *InputSecurityGroup { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *InputSecurityGroup) SetId(v string) *InputSecurityGroup { - s.Id = &v +// SetMultiplexes sets the Multiplexes field's value. +func (s *ListMultiplexesOutput) SetMultiplexes(v []*MultiplexSummary) *ListMultiplexesOutput { + s.Multiplexes = v return s } -// SetInputs sets the Inputs field's value. -func (s *InputSecurityGroup) SetInputs(v []*string) *InputSecurityGroup { - s.Inputs = v +// SetNextToken sets the NextToken field's value. +func (s *ListMultiplexesOutput) SetNextToken(v string) *ListMultiplexesOutput { + s.NextToken = &v return s } -// SetState sets the State field's value. -func (s *InputSecurityGroup) SetState(v string) *InputSecurityGroup { - s.State = &v - return s -} +type ListOfferingsInput struct { + _ struct{} `type:"structure"` -// SetTags sets the Tags field's value. -func (s *InputSecurityGroup) SetTags(v map[string]*string) *InputSecurityGroup { - s.Tags = v - return s -} + ChannelClass *string `location:"querystring" locationName:"channelClass" type:"string"` -// SetWhitelistRules sets the WhitelistRules field's value. -func (s *InputSecurityGroup) SetWhitelistRules(v []*InputWhitelistRule) *InputSecurityGroup { - s.WhitelistRules = v - return s -} + ChannelConfiguration *string `location:"querystring" locationName:"channelConfiguration" type:"string"` -// Live Event input parameters. There can be multiple inputs in a single Live -// Event. -type InputSettings struct { - _ struct{} `type:"structure"` + Codec *string `location:"querystring" locationName:"codec" type:"string"` - // Used to select the audio stream to decode for inputs that have multiple available. - AudioSelectors []*AudioSelector `locationName:"audioSelectors" type:"list"` + Duration *string `location:"querystring" locationName:"duration" type:"string"` - // Used to select the caption input to use for inputs that have multiple available. - CaptionSelectors []*CaptionSelector `locationName:"captionSelectors" type:"list"` + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - // Enable or disable the deblock filter when filtering. - DeblockFilter *string `locationName:"deblockFilter" type:"string" enum:"InputDeblockFilter"` + MaximumBitrate *string `location:"querystring" locationName:"maximumBitrate" type:"string"` - // Enable or disable the denoise filter when filtering. - DenoiseFilter *string `locationName:"denoiseFilter" type:"string" enum:"InputDenoiseFilter"` + MaximumFramerate *string `location:"querystring" locationName:"maximumFramerate" type:"string"` - // Adjusts the magnitude of filtering from 1 (minimal) to 5 (strongest). - FilterStrength *int64 `locationName:"filterStrength" min:"1" type:"integer"` + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - // Turns on the filter for this input. MPEG-2 inputs have the deblocking filter - // enabled by default.1) auto - filtering will be applied depending on input - // type/quality2) disabled - no filtering will be applied to the input3) forced - // - filtering will be applied regardless of input type - InputFilter *string `locationName:"inputFilter" type:"string" enum:"InputFilter"` + Resolution *string `location:"querystring" locationName:"resolution" type:"string"` - // Input settings. - NetworkInputSettings *NetworkInputSettings `locationName:"networkInputSettings" type:"structure"` + ResourceType *string `location:"querystring" locationName:"resourceType" type:"string"` - // Loop input if it is a file. This allows a file input to be streamed indefinitely. - SourceEndBehavior *string `locationName:"sourceEndBehavior" type:"string" enum:"InputSourceEndBehavior"` + SpecialFeature *string `location:"querystring" locationName:"specialFeature" type:"string"` - // Informs which video elementary stream to decode for input types that have - // multiple available. - VideoSelector *VideoSelector `locationName:"videoSelector" type:"structure"` + VideoQuality *string `location:"querystring" locationName:"videoQuality" type:"string"` } // String returns the string representation -func (s InputSettings) String() string { +func (s ListOfferingsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InputSettings) GoString() string { +func (s ListOfferingsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *InputSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputSettings"} - if s.FilterStrength != nil && *s.FilterStrength < 1 { - invalidParams.Add(request.NewErrParamMinValue("FilterStrength", 1)) - } - if s.AudioSelectors != nil { - for i, v := range s.AudioSelectors { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AudioSelectors", i), err.(request.ErrInvalidParams)) - } - } - } - if s.CaptionSelectors != nil { - for i, v := range s.CaptionSelectors { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CaptionSelectors", i), err.(request.ErrInvalidParams)) - } - } +func (s *ListOfferingsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListOfferingsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -11542,287 +14747,270 @@ func (s *InputSettings) Validate() error { return nil } -// SetAudioSelectors sets the AudioSelectors field's value. -func (s *InputSettings) SetAudioSelectors(v []*AudioSelector) *InputSettings { - s.AudioSelectors = v +// SetChannelClass sets the ChannelClass field's value. +func (s *ListOfferingsInput) SetChannelClass(v string) *ListOfferingsInput { + s.ChannelClass = &v + return s +} + +// SetChannelConfiguration sets the ChannelConfiguration field's value. +func (s *ListOfferingsInput) SetChannelConfiguration(v string) *ListOfferingsInput { + s.ChannelConfiguration = &v + return s +} + +// SetCodec sets the Codec field's value. +func (s *ListOfferingsInput) SetCodec(v string) *ListOfferingsInput { + s.Codec = &v return s } -// SetCaptionSelectors sets the CaptionSelectors field's value. -func (s *InputSettings) SetCaptionSelectors(v []*CaptionSelector) *InputSettings { - s.CaptionSelectors = v +// SetDuration sets the Duration field's value. +func (s *ListOfferingsInput) SetDuration(v string) *ListOfferingsInput { + s.Duration = &v return s } -// SetDeblockFilter sets the DeblockFilter field's value. -func (s *InputSettings) SetDeblockFilter(v string) *InputSettings { - s.DeblockFilter = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListOfferingsInput) SetMaxResults(v int64) *ListOfferingsInput { + s.MaxResults = &v return s } -// SetDenoiseFilter sets the DenoiseFilter field's value. -func (s *InputSettings) SetDenoiseFilter(v string) *InputSettings { - s.DenoiseFilter = &v +// SetMaximumBitrate sets the MaximumBitrate field's value. +func (s *ListOfferingsInput) SetMaximumBitrate(v string) *ListOfferingsInput { + s.MaximumBitrate = &v return s } -// SetFilterStrength sets the FilterStrength field's value. -func (s *InputSettings) SetFilterStrength(v int64) *InputSettings { - s.FilterStrength = &v +// SetMaximumFramerate sets the MaximumFramerate field's value. +func (s *ListOfferingsInput) SetMaximumFramerate(v string) *ListOfferingsInput { + s.MaximumFramerate = &v return s } -// SetInputFilter sets the InputFilter field's value. -func (s *InputSettings) SetInputFilter(v string) *InputSettings { - s.InputFilter = &v +// SetNextToken sets the NextToken field's value. +func (s *ListOfferingsInput) SetNextToken(v string) *ListOfferingsInput { + s.NextToken = &v return s } -// SetNetworkInputSettings sets the NetworkInputSettings field's value. -func (s *InputSettings) SetNetworkInputSettings(v *NetworkInputSettings) *InputSettings { - s.NetworkInputSettings = v +// SetResolution sets the Resolution field's value. +func (s *ListOfferingsInput) SetResolution(v string) *ListOfferingsInput { + s.Resolution = &v return s } -// SetSourceEndBehavior sets the SourceEndBehavior field's value. -func (s *InputSettings) SetSourceEndBehavior(v string) *InputSettings { - s.SourceEndBehavior = &v +// SetResourceType sets the ResourceType field's value. +func (s *ListOfferingsInput) SetResourceType(v string) *ListOfferingsInput { + s.ResourceType = &v return s } -// SetVideoSelector sets the VideoSelector field's value. -func (s *InputSettings) SetVideoSelector(v *VideoSelector) *InputSettings { - s.VideoSelector = v +// SetSpecialFeature sets the SpecialFeature field's value. +func (s *ListOfferingsInput) SetSpecialFeature(v string) *ListOfferingsInput { + s.SpecialFeature = &v return s } -// The settings for a PULL type input. -type InputSource struct { - _ struct{} `type:"structure"` +// SetVideoQuality sets the VideoQuality field's value. +func (s *ListOfferingsInput) SetVideoQuality(v string) *ListOfferingsInput { + s.VideoQuality = &v + return s +} - // The key used to extract the password from EC2 Parameter store. - PasswordParam *string `locationName:"passwordParam" type:"string"` +type ListOfferingsOutput struct { + _ struct{} `type:"structure"` - // This represents the customer's source URL where stream ispulled from. - Url *string `locationName:"url" type:"string"` + NextToken *string `locationName:"nextToken" type:"string"` - // The username for the input source. - Username *string `locationName:"username" type:"string"` + Offerings []*Offering `locationName:"offerings" type:"list"` } // String returns the string representation -func (s InputSource) String() string { +func (s ListOfferingsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InputSource) GoString() string { +func (s ListOfferingsOutput) GoString() string { return s.String() } -// SetPasswordParam sets the PasswordParam field's value. -func (s *InputSource) SetPasswordParam(v string) *InputSource { - s.PasswordParam = &v - return s -} - -// SetUrl sets the Url field's value. -func (s *InputSource) SetUrl(v string) *InputSource { - s.Url = &v +// SetNextToken sets the NextToken field's value. +func (s *ListOfferingsOutput) SetNextToken(v string) *ListOfferingsOutput { + s.NextToken = &v return s } -// SetUsername sets the Username field's value. -func (s *InputSource) SetUsername(v string) *InputSource { - s.Username = &v +// SetOfferings sets the Offerings field's value. +func (s *ListOfferingsOutput) SetOfferings(v []*Offering) *ListOfferingsOutput { + s.Offerings = v return s } -// Settings for for a PULL type input. -type InputSourceRequest struct { +type ListReservationsInput struct { _ struct{} `type:"structure"` - // The key used to extract the password from EC2 Parameter store. - PasswordParam *string `locationName:"passwordParam" type:"string"` + ChannelClass *string `location:"querystring" locationName:"channelClass" type:"string"` - // This represents the customer's source URL where stream ispulled from. - Url *string `locationName:"url" type:"string"` + Codec *string `location:"querystring" locationName:"codec" type:"string"` - // The username for the input source. - Username *string `locationName:"username" type:"string"` + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + MaximumBitrate *string `location:"querystring" locationName:"maximumBitrate" type:"string"` + + MaximumFramerate *string `location:"querystring" locationName:"maximumFramerate" type:"string"` + + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + + Resolution *string `location:"querystring" locationName:"resolution" type:"string"` + + ResourceType *string `location:"querystring" locationName:"resourceType" type:"string"` + + SpecialFeature *string `location:"querystring" locationName:"specialFeature" type:"string"` + + VideoQuality *string `location:"querystring" locationName:"videoQuality" type:"string"` } // String returns the string representation -func (s InputSourceRequest) String() string { +func (s ListReservationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InputSourceRequest) GoString() string { +func (s ListReservationsInput) GoString() string { return s.String() } -// SetPasswordParam sets the PasswordParam field's value. -func (s *InputSourceRequest) SetPasswordParam(v string) *InputSourceRequest { - s.PasswordParam = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListReservationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListReservationsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetUrl sets the Url field's value. -func (s *InputSourceRequest) SetUrl(v string) *InputSourceRequest { - s.Url = &v +// SetChannelClass sets the ChannelClass field's value. +func (s *ListReservationsInput) SetChannelClass(v string) *ListReservationsInput { + s.ChannelClass = &v return s } -// SetUsername sets the Username field's value. -func (s *InputSourceRequest) SetUsername(v string) *InputSourceRequest { - s.Username = &v +// SetCodec sets the Codec field's value. +func (s *ListReservationsInput) SetCodec(v string) *ListReservationsInput { + s.Codec = &v return s } -type InputSpecification struct { - _ struct{} `type:"structure"` - - // Input codec - Codec *string `locationName:"codec" type:"string" enum:"InputCodec"` +// SetMaxResults sets the MaxResults field's value. +func (s *ListReservationsInput) SetMaxResults(v int64) *ListReservationsInput { + s.MaxResults = &v + return s +} - // Maximum input bitrate, categorized coarsely - MaximumBitrate *string `locationName:"maximumBitrate" type:"string" enum:"InputMaximumBitrate"` +// SetMaximumBitrate sets the MaximumBitrate field's value. +func (s *ListReservationsInput) SetMaximumBitrate(v string) *ListReservationsInput { + s.MaximumBitrate = &v + return s +} - // Input resolution, categorized coarsely - Resolution *string `locationName:"resolution" type:"string" enum:"InputResolution"` +// SetMaximumFramerate sets the MaximumFramerate field's value. +func (s *ListReservationsInput) SetMaximumFramerate(v string) *ListReservationsInput { + s.MaximumFramerate = &v + return s } -// String returns the string representation -func (s InputSpecification) String() string { - return awsutil.Prettify(s) +// SetNextToken sets the NextToken field's value. +func (s *ListReservationsInput) SetNextToken(v string) *ListReservationsInput { + s.NextToken = &v + return s } -// GoString returns the string representation -func (s InputSpecification) GoString() string { - return s.String() +// SetResolution sets the Resolution field's value. +func (s *ListReservationsInput) SetResolution(v string) *ListReservationsInput { + s.Resolution = &v + return s } -// SetCodec sets the Codec field's value. -func (s *InputSpecification) SetCodec(v string) *InputSpecification { - s.Codec = &v +// SetResourceType sets the ResourceType field's value. +func (s *ListReservationsInput) SetResourceType(v string) *ListReservationsInput { + s.ResourceType = &v return s } -// SetMaximumBitrate sets the MaximumBitrate field's value. -func (s *InputSpecification) SetMaximumBitrate(v string) *InputSpecification { - s.MaximumBitrate = &v +// SetSpecialFeature sets the SpecialFeature field's value. +func (s *ListReservationsInput) SetSpecialFeature(v string) *ListReservationsInput { + s.SpecialFeature = &v return s } -// SetResolution sets the Resolution field's value. -func (s *InputSpecification) SetResolution(v string) *InputSpecification { - s.Resolution = &v +// SetVideoQuality sets the VideoQuality field's value. +func (s *ListReservationsInput) SetVideoQuality(v string) *ListReservationsInput { + s.VideoQuality = &v return s } -// Settings for the "switch input" action: to switch from ingesting one input -// to ingesting another input. -type InputSwitchScheduleActionSettings struct { +type ListReservationsOutput struct { _ struct{} `type:"structure"` - // The name of the input attachment (not the name of the input!) to switch to. - // The name is specified in the channel configuration. - // - // InputAttachmentNameReference is a required field - InputAttachmentNameReference *string `locationName:"inputAttachmentNameReference" type:"string" required:"true"` - - // Settings to let you create a clip of the file input, in order to set up the - // input to ingest only a portion of the file. - InputClippingSettings *InputClippingSettings `locationName:"inputClippingSettings" type:"structure"` + NextToken *string `locationName:"nextToken" type:"string"` - // The value for the variable portion of the URL for the dynamic input, for - // this instance of the input. Each time you use the same dynamic input in an - // input switch action, you can provide a different value, in order to connect - // the input to a different content source. - UrlPath []*string `locationName:"urlPath" type:"list"` + Reservations []*Reservation `locationName:"reservations" type:"list"` } // String returns the string representation -func (s InputSwitchScheduleActionSettings) String() string { +func (s ListReservationsOutput) String() string { return awsutil.Prettify(s) } - -// GoString returns the string representation -func (s InputSwitchScheduleActionSettings) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputSwitchScheduleActionSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputSwitchScheduleActionSettings"} - if s.InputAttachmentNameReference == nil { - invalidParams.Add(request.NewErrParamRequired("InputAttachmentNameReference")) - } - if s.InputClippingSettings != nil { - if err := s.InputClippingSettings.Validate(); err != nil { - invalidParams.AddNested("InputClippingSettings", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInputAttachmentNameReference sets the InputAttachmentNameReference field's value. -func (s *InputSwitchScheduleActionSettings) SetInputAttachmentNameReference(v string) *InputSwitchScheduleActionSettings { - s.InputAttachmentNameReference = &v - return s + +// GoString returns the string representation +func (s ListReservationsOutput) GoString() string { + return s.String() } -// SetInputClippingSettings sets the InputClippingSettings field's value. -func (s *InputSwitchScheduleActionSettings) SetInputClippingSettings(v *InputClippingSettings) *InputSwitchScheduleActionSettings { - s.InputClippingSettings = v +// SetNextToken sets the NextToken field's value. +func (s *ListReservationsOutput) SetNextToken(v string) *ListReservationsOutput { + s.NextToken = &v return s } -// SetUrlPath sets the UrlPath field's value. -func (s *InputSwitchScheduleActionSettings) SetUrlPath(v []*string) *InputSwitchScheduleActionSettings { - s.UrlPath = v +// SetReservations sets the Reservations field's value. +func (s *ListReservationsOutput) SetReservations(v []*Reservation) *ListReservationsOutput { + s.Reservations = v return s } -// Settings for a private VPC Input.When this property is specified, the input -// destination addresses will be created in a VPC rather than with public Internet -// addresses.This property requires setting the roleArn property on Input creation.Not -// compatible with the inputSecurityGroups property. -type InputVpcRequest struct { +type ListTagsForResourceInput struct { _ struct{} `type:"structure"` - // A list of up to 5 EC2 VPC security group IDs to attach to the Input VPC network - // interfaces.Requires subnetIds. If none are specified then the VPC default - // security group will be used. - SecurityGroupIds []*string `locationName:"securityGroupIds" type:"list"` - - // A list of 2 VPC subnet IDs from the same VPC.Subnet IDs must be mapped to - // two unique availability zones (AZ). - // - // SubnetIds is a required field - SubnetIds []*string `locationName:"subnetIds" type:"list" required:"true"` + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` } // String returns the string representation -func (s InputVpcRequest) String() string { +func (s ListTagsForResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InputVpcRequest) GoString() string { +func (s ListTagsForResourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *InputVpcRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputVpcRequest"} - if s.SubnetIds == nil { - invalidParams.Add(request.NewErrParamRequired("SubnetIds")) +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 { @@ -11831,90 +15019,291 @@ func (s *InputVpcRequest) Validate() error { return nil } -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *InputVpcRequest) SetSecurityGroupIds(v []*string) *InputVpcRequest { - s.SecurityGroupIds = v - return s -} - -// SetSubnetIds sets the SubnetIds field's value. -func (s *InputVpcRequest) SetSubnetIds(v []*string) *InputVpcRequest { - s.SubnetIds = v +// SetResourceArn sets the ResourceArn field's value. +func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { + s.ResourceArn = &v return s } -// Whitelist rule -type InputWhitelistRule struct { +type ListTagsForResourceOutput struct { _ struct{} `type:"structure"` - // The IPv4 CIDR that's whitelisted. - Cidr *string `locationName:"cidr" type:"string"` + Tags map[string]*string `locationName:"tags" type:"map"` } // String returns the string representation -func (s InputWhitelistRule) String() string { +func (s ListTagsForResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InputWhitelistRule) GoString() string { +func (s ListTagsForResourceOutput) GoString() string { return s.String() } -// SetCidr sets the Cidr field's value. -func (s *InputWhitelistRule) SetCidr(v string) *InputWhitelistRule { - s.Cidr = &v +// SetTags sets the Tags field's value. +func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { + s.Tags = v return s } -// An IPv4 CIDR to whitelist. -type InputWhitelistRuleCidr struct { - _ struct{} `type:"structure"` +// M2ts Settings +type M2tsSettings struct { + _ struct{} `type:"structure"` + + // When set to drop, output audio streams will be removed from the program if + // the selected input audio stream is removed from the input. This allows the + // output audio configuration to dynamically change based on input configuration. + // If this is set to encodeSilence, all output audio streams will output encoded + // silence when not connected to an active input stream. + AbsentInputAudioBehavior *string `locationName:"absentInputAudioBehavior" type:"string" enum:"M2tsAbsentInputAudioBehavior"` + + // When set to enabled, uses ARIB-compliant field muxing and removes video descriptor. + Arib *string `locationName:"arib" type:"string" enum:"M2tsArib"` + + // Packet Identifier (PID) for ARIB Captions in the transport stream. Can be + // entered as a decimal or hexadecimal value. Valid values are 32 (or 0x20)..8182 + // (or 0x1ff6). + AribCaptionsPid *string `locationName:"aribCaptionsPid" type:"string"` + + // If set to auto, pid number used for ARIB Captions will be auto-selected from + // unused pids. If set to useConfigured, ARIB Captions will be on the configured + // pid number. + AribCaptionsPidControl *string `locationName:"aribCaptionsPidControl" type:"string" enum:"M2tsAribCaptionsPidControl"` + + // When set to dvb, uses DVB buffer model for Dolby Digital audio. When set + // to atsc, the ATSC model is used. + AudioBufferModel *string `locationName:"audioBufferModel" type:"string" enum:"M2tsAudioBufferModel"` + + // The number of audio frames to insert for each PES packet. + AudioFramesPerPes *int64 `locationName:"audioFramesPerPes" type:"integer"` + + // Packet Identifier (PID) of the elementary audio stream(s) in the transport + // stream. Multiple values are accepted, and can be entered in ranges and/or + // by comma separation. Can be entered as decimal or hexadecimal values. Each + // PID specified must be in the range of 32 (or 0x20)..8182 (or 0x1ff6). + AudioPids *string `locationName:"audioPids" type:"string"` + + // When set to atsc, uses stream type = 0x81 for AC3 and stream type = 0x87 + // for EAC3. When set to dvb, uses stream type = 0x06. + AudioStreamType *string `locationName:"audioStreamType" type:"string" enum:"M2tsAudioStreamType"` + + // The output bitrate of the transport stream in bits per second. Setting to + // 0 lets the muxer automatically determine the appropriate bitrate. + Bitrate *int64 `locationName:"bitrate" type:"integer"` + + // If set to multiplex, use multiplex buffer model for accurate interleaving. + // Setting to bufferModel to none can lead to lower latency, but low-memory + // devices may not be able to play back the stream without interruptions. + BufferModel *string `locationName:"bufferModel" type:"string" enum:"M2tsBufferModel"` + + // When set to enabled, generates captionServiceDescriptor in PMT. + CcDescriptor *string `locationName:"ccDescriptor" type:"string" enum:"M2tsCcDescriptor"` + + // Inserts DVB Network Information Table (NIT) at the specified table repetition + // interval. + DvbNitSettings *DvbNitSettings `locationName:"dvbNitSettings" type:"structure"` + + // Inserts DVB Service Description Table (SDT) at the specified table repetition + // interval. + DvbSdtSettings *DvbSdtSettings `locationName:"dvbSdtSettings" type:"structure"` + + // Packet Identifier (PID) for input source DVB Subtitle data to this output. + // Multiple values are accepted, and can be entered in ranges and/or by comma + // separation. Can be entered as decimal or hexadecimal values. Each PID specified + // must be in the range of 32 (or 0x20)..8182 (or 0x1ff6). + DvbSubPids *string `locationName:"dvbSubPids" type:"string"` + + // Inserts DVB Time and Date Table (TDT) at the specified table repetition interval. + DvbTdtSettings *DvbTdtSettings `locationName:"dvbTdtSettings" type:"structure"` + + // Packet Identifier (PID) for input source DVB Teletext data to this output. + // Can be entered as a decimal or hexadecimal value. Valid values are 32 (or + // 0x20)..8182 (or 0x1ff6). + DvbTeletextPid *string `locationName:"dvbTeletextPid" type:"string"` + + // If set to passthrough, passes any EBIF data from the input source to this + // output. + Ebif *string `locationName:"ebif" type:"string" enum:"M2tsEbifControl"` + + // When videoAndFixedIntervals is selected, audio EBP markers will be added + // to partitions 3 and 4. The interval between these additional markers will + // be fixed, and will be slightly shorter than the video EBP marker interval. + // Only available when EBP Cablelabs segmentation markers are selected. Partitions + // 1 and 2 will always follow the video interval. + EbpAudioInterval *string `locationName:"ebpAudioInterval" type:"string" enum:"M2tsAudioInterval"` + + // When set, enforces that Encoder Boundary Points do not come within the specified + // time interval of each other by looking ahead at input video. If another EBP + // is going to come in within the specified time interval, the current EBP is + // not emitted, and the segment is "stretched" to the next marker. The lookahead + // value does not add latency to the system. The Live Event must be configured + // elsewhere to create sufficient latency to make the lookahead accurate. + EbpLookaheadMs *int64 `locationName:"ebpLookaheadMs" type:"integer"` + + // Controls placement of EBP on Audio PIDs. If set to videoAndAudioPids, EBP + // markers will be placed on the video PID and all audio PIDs. If set to videoPid, + // EBP markers will be placed on only the video PID. + EbpPlacement *string `locationName:"ebpPlacement" type:"string" enum:"M2tsEbpPlacement"` + + // This field is unused and deprecated. + EcmPid *string `locationName:"ecmPid" type:"string"` + + // Include or exclude the ES Rate field in the PES header. + EsRateInPes *string `locationName:"esRateInPes" type:"string" enum:"M2tsEsRateInPes"` + + // Packet Identifier (PID) for input source ETV Platform data to this output. + // Can be entered as a decimal or hexadecimal value. Valid values are 32 (or + // 0x20)..8182 (or 0x1ff6). + EtvPlatformPid *string `locationName:"etvPlatformPid" type:"string"` + + // Packet Identifier (PID) for input source ETV Signal data to this output. + // Can be entered as a decimal or hexadecimal value. Valid values are 32 (or + // 0x20)..8182 (or 0x1ff6). + EtvSignalPid *string `locationName:"etvSignalPid" type:"string"` + + // The length in seconds of each fragment. Only used with EBP markers. + FragmentTime *float64 `locationName:"fragmentTime" type:"double"` + + // If set to passthrough, passes any KLV data from the input source to this + // output. + Klv *string `locationName:"klv" type:"string" enum:"M2tsKlv"` + + // Packet Identifier (PID) for input source KLV data to this output. Multiple + // values are accepted, and can be entered in ranges and/or by comma separation. + // Can be entered as decimal or hexadecimal values. Each PID specified must + // be in the range of 32 (or 0x20)..8182 (or 0x1ff6). + KlvDataPids *string `locationName:"klvDataPids" type:"string"` + + // If set to passthrough, Nielsen inaudible tones for media tracking will be + // detected in the input audio and an equivalent ID3 tag will be inserted in + // the output. + NielsenId3Behavior *string `locationName:"nielsenId3Behavior" type:"string" enum:"M2tsNielsenId3Behavior"` + + // Value in bits per second of extra null packets to insert into the transport + // stream. This can be used if a downstream encryption system requires periodic + // null packets. + NullPacketBitrate *float64 `locationName:"nullPacketBitrate" type:"double"` + + // The number of milliseconds between instances of this table in the output + // transport stream. Valid values are 0, 10..1000. + PatInterval *int64 `locationName:"patInterval" type:"integer"` + + // When set to pcrEveryPesPacket, a Program Clock Reference value is inserted + // for every Packetized Elementary Stream (PES) header. This parameter is effective + // only when the PCR PID is the same as the video or audio elementary stream. + PcrControl *string `locationName:"pcrControl" type:"string" enum:"M2tsPcrControl"` + + // Maximum time in milliseconds between Program Clock Reference (PCRs) inserted + // into the transport stream. + PcrPeriod *int64 `locationName:"pcrPeriod" type:"integer"` + + // Packet Identifier (PID) of the Program Clock Reference (PCR) in the transport + // stream. When no value is given, the encoder will assign the same value as + // the Video PID. Can be entered as a decimal or hexadecimal value. Valid values + // are 32 (or 0x20)..8182 (or 0x1ff6). + PcrPid *string `locationName:"pcrPid" type:"string"` + + // The number of milliseconds between instances of this table in the output + // transport stream. Valid values are 0, 10..1000. + PmtInterval *int64 `locationName:"pmtInterval" type:"integer"` + + // Packet Identifier (PID) for the Program Map Table (PMT) in the transport + // stream. Can be entered as a decimal or hexadecimal value. Valid values are + // 32 (or 0x20)..8182 (or 0x1ff6). + PmtPid *string `locationName:"pmtPid" type:"string"` + + // The value of the program number field in the Program Map Table. + ProgramNum *int64 `locationName:"programNum" type:"integer"` + + // When vbr, does not insert null packets into transport stream to fill specified + // bitrate. The bitrate setting acts as the maximum bitrate when vbr is set. + RateMode *string `locationName:"rateMode" type:"string" enum:"M2tsRateMode"` + + // Packet Identifier (PID) for input source SCTE-27 data to this output. Multiple + // values are accepted, and can be entered in ranges and/or by comma separation. + // Can be entered as decimal or hexadecimal values. Each PID specified must + // be in the range of 32 (or 0x20)..8182 (or 0x1ff6). + Scte27Pids *string `locationName:"scte27Pids" type:"string"` + + // Optionally pass SCTE-35 signals from the input source to this output. + Scte35Control *string `locationName:"scte35Control" type:"string" enum:"M2tsScte35Control"` + + // Packet Identifier (PID) of the SCTE-35 stream in the transport stream. Can + // be entered as a decimal or hexadecimal value. Valid values are 32 (or 0x20)..8182 + // (or 0x1ff6). + Scte35Pid *string `locationName:"scte35Pid" type:"string"` + + // Inserts segmentation markers at each segmentationTime period. raiSegstart + // sets the Random Access Indicator bit in the adaptation field. raiAdapt sets + // the RAI bit and adds the current timecode in the private data bytes. psiSegstart + // inserts PAT and PMT tables at the start of segments. ebp adds Encoder Boundary + // Point information to the adaptation field as per OpenCable specification + // OC-SP-EBP-I01-130118. ebpLegacy adds Encoder Boundary Point information to + // the adaptation field using a legacy proprietary format. + SegmentationMarkers *string `locationName:"segmentationMarkers" type:"string" enum:"M2tsSegmentationMarkers"` - // The IPv4 CIDR to whitelist. - Cidr *string `locationName:"cidr" type:"string"` -} + // The segmentation style parameter controls how segmentation markers are inserted + // into the transport stream. With avails, it is possible that segments may + // be truncated, which can influence where future segmentation markers are inserted.When + // a segmentation style of "resetCadence" is selected and a segment is truncated + // due to an avail, we will reset the segmentation cadence. This means the subsequent + // segment will have a duration of $segmentationTime seconds.When a segmentation + // style of "maintainCadence" is selected and a segment is truncated due to + // an avail, we will not reset the segmentation cadence. This means the subsequent + // segment will likely be truncated as well. However, all segments after that + // will have a duration of $segmentationTime seconds. Note that EBP lookahead + // is a slight exception to this rule. + SegmentationStyle *string `locationName:"segmentationStyle" type:"string" enum:"M2tsSegmentationStyle"` -// String returns the string representation -func (s InputWhitelistRuleCidr) String() string { - return awsutil.Prettify(s) -} + // The length in seconds of each segment. Required unless markers is set to + // None_. + SegmentationTime *float64 `locationName:"segmentationTime" type:"double"` -// GoString returns the string representation -func (s InputWhitelistRuleCidr) GoString() string { - return s.String() -} + // When set to passthrough, timed metadata will be passed through from input + // to output. + TimedMetadataBehavior *string `locationName:"timedMetadataBehavior" type:"string" enum:"M2tsTimedMetadataBehavior"` -// SetCidr sets the Cidr field's value. -func (s *InputWhitelistRuleCidr) SetCidr(v string) *InputWhitelistRuleCidr { - s.Cidr = &v - return s -} + // Packet Identifier (PID) of the timed metadata stream in the transport stream. + // Can be entered as a decimal or hexadecimal value. Valid values are 32 (or + // 0x20)..8182 (or 0x1ff6). + TimedMetadataPid *string `locationName:"timedMetadataPid" type:"string"` -// Key Provider Settings -type KeyProviderSettings struct { - _ struct{} `type:"structure"` + // The value of the transport stream ID field in the Program Map Table. + TransportStreamId *int64 `locationName:"transportStreamId" type:"integer"` - // Static Key Settings - StaticKeySettings *StaticKeySettings `locationName:"staticKeySettings" type:"structure"` + // Packet Identifier (PID) of the elementary video stream in the transport stream. + // Can be entered as a decimal or hexadecimal value. Valid values are 32 (or + // 0x20)..8182 (or 0x1ff6). + VideoPid *string `locationName:"videoPid" type:"string"` } // String returns the string representation -func (s KeyProviderSettings) String() string { +func (s M2tsSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s KeyProviderSettings) GoString() string { +func (s M2tsSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *KeyProviderSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "KeyProviderSettings"} - if s.StaticKeySettings != nil { - if err := s.StaticKeySettings.Validate(); err != nil { - invalidParams.AddNested("StaticKeySettings", err.(request.ErrInvalidParams)) +func (s *M2tsSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "M2tsSettings"} + if s.DvbNitSettings != nil { + if err := s.DvbNitSettings.Validate(); err != nil { + invalidParams.AddNested("DvbNitSettings", err.(request.ErrInvalidParams)) + } + } + if s.DvbSdtSettings != nil { + if err := s.DvbSdtSettings.Validate(); err != nil { + invalidParams.AddNested("DvbSdtSettings", err.(request.ErrInvalidParams)) + } + } + if s.DvbTdtSettings != nil { + if err := s.DvbTdtSettings.Validate(); err != nil { + invalidParams.AddNested("DvbTdtSettings", err.(request.ErrInvalidParams)) } } @@ -11924,827 +15313,763 @@ func (s *KeyProviderSettings) Validate() error { return nil } -// SetStaticKeySettings sets the StaticKeySettings field's value. -func (s *KeyProviderSettings) SetStaticKeySettings(v *StaticKeySettings) *KeyProviderSettings { - s.StaticKeySettings = v +// SetAbsentInputAudioBehavior sets the AbsentInputAudioBehavior field's value. +func (s *M2tsSettings) SetAbsentInputAudioBehavior(v string) *M2tsSettings { + s.AbsentInputAudioBehavior = &v return s } -type ListChannelsInput struct { - _ struct{} `type:"structure"` - - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` -} - -// String returns the string representation -func (s ListChannelsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ListChannelsInput) GoString() string { - return s.String() +// SetArib sets the Arib field's value. +func (s *M2tsSettings) SetArib(v string) *M2tsSettings { + s.Arib = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListChannelsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListChannelsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetAribCaptionsPid sets the AribCaptionsPid field's value. +func (s *M2tsSettings) SetAribCaptionsPid(v string) *M2tsSettings { + s.AribCaptionsPid = &v + return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListChannelsInput) SetMaxResults(v int64) *ListChannelsInput { - s.MaxResults = &v +// SetAribCaptionsPidControl sets the AribCaptionsPidControl field's value. +func (s *M2tsSettings) SetAribCaptionsPidControl(v string) *M2tsSettings { + s.AribCaptionsPidControl = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListChannelsInput) SetNextToken(v string) *ListChannelsInput { - s.NextToken = &v +// SetAudioBufferModel sets the AudioBufferModel field's value. +func (s *M2tsSettings) SetAudioBufferModel(v string) *M2tsSettings { + s.AudioBufferModel = &v return s } -type ListChannelsOutput struct { - _ struct{} `type:"structure"` - - Channels []*ChannelSummary `locationName:"channels" type:"list"` - - NextToken *string `locationName:"nextToken" type:"string"` +// SetAudioFramesPerPes sets the AudioFramesPerPes field's value. +func (s *M2tsSettings) SetAudioFramesPerPes(v int64) *M2tsSettings { + s.AudioFramesPerPes = &v + return s } -// String returns the string representation -func (s ListChannelsOutput) String() string { - return awsutil.Prettify(s) +// SetAudioPids sets the AudioPids field's value. +func (s *M2tsSettings) SetAudioPids(v string) *M2tsSettings { + s.AudioPids = &v + return s } -// GoString returns the string representation -func (s ListChannelsOutput) GoString() string { - return s.String() +// SetAudioStreamType sets the AudioStreamType field's value. +func (s *M2tsSettings) SetAudioStreamType(v string) *M2tsSettings { + s.AudioStreamType = &v + return s } -// SetChannels sets the Channels field's value. -func (s *ListChannelsOutput) SetChannels(v []*ChannelSummary) *ListChannelsOutput { - s.Channels = v +// SetBitrate sets the Bitrate field's value. +func (s *M2tsSettings) SetBitrate(v int64) *M2tsSettings { + s.Bitrate = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListChannelsOutput) SetNextToken(v string) *ListChannelsOutput { - s.NextToken = &v +// SetBufferModel sets the BufferModel field's value. +func (s *M2tsSettings) SetBufferModel(v string) *M2tsSettings { + s.BufferModel = &v return s } -type ListInputSecurityGroupsInput struct { - _ struct{} `type:"structure"` - - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +// SetCcDescriptor sets the CcDescriptor field's value. +func (s *M2tsSettings) SetCcDescriptor(v string) *M2tsSettings { + s.CcDescriptor = &v + return s } -// String returns the string representation -func (s ListInputSecurityGroupsInput) String() string { - return awsutil.Prettify(s) +// SetDvbNitSettings sets the DvbNitSettings field's value. +func (s *M2tsSettings) SetDvbNitSettings(v *DvbNitSettings) *M2tsSettings { + s.DvbNitSettings = v + return s } -// GoString returns the string representation -func (s ListInputSecurityGroupsInput) GoString() string { - return s.String() +// SetDvbSdtSettings sets the DvbSdtSettings field's value. +func (s *M2tsSettings) SetDvbSdtSettings(v *DvbSdtSettings) *M2tsSettings { + s.DvbSdtSettings = v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListInputSecurityGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListInputSecurityGroupsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetDvbSubPids sets the DvbSubPids field's value. +func (s *M2tsSettings) SetDvbSubPids(v string) *M2tsSettings { + s.DvbSubPids = &v + return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListInputSecurityGroupsInput) SetMaxResults(v int64) *ListInputSecurityGroupsInput { - s.MaxResults = &v +// SetDvbTdtSettings sets the DvbTdtSettings field's value. +func (s *M2tsSettings) SetDvbTdtSettings(v *DvbTdtSettings) *M2tsSettings { + s.DvbTdtSettings = v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListInputSecurityGroupsInput) SetNextToken(v string) *ListInputSecurityGroupsInput { - s.NextToken = &v +// SetDvbTeletextPid sets the DvbTeletextPid field's value. +func (s *M2tsSettings) SetDvbTeletextPid(v string) *M2tsSettings { + s.DvbTeletextPid = &v return s } -type ListInputSecurityGroupsOutput struct { - _ struct{} `type:"structure"` - - InputSecurityGroups []*InputSecurityGroup `locationName:"inputSecurityGroups" type:"list"` - - NextToken *string `locationName:"nextToken" type:"string"` +// SetEbif sets the Ebif field's value. +func (s *M2tsSettings) SetEbif(v string) *M2tsSettings { + s.Ebif = &v + return s } -// String returns the string representation -func (s ListInputSecurityGroupsOutput) String() string { - return awsutil.Prettify(s) +// SetEbpAudioInterval sets the EbpAudioInterval field's value. +func (s *M2tsSettings) SetEbpAudioInterval(v string) *M2tsSettings { + s.EbpAudioInterval = &v + return s } -// GoString returns the string representation -func (s ListInputSecurityGroupsOutput) GoString() string { - return s.String() +// SetEbpLookaheadMs sets the EbpLookaheadMs field's value. +func (s *M2tsSettings) SetEbpLookaheadMs(v int64) *M2tsSettings { + s.EbpLookaheadMs = &v + return s } -// SetInputSecurityGroups sets the InputSecurityGroups field's value. -func (s *ListInputSecurityGroupsOutput) SetInputSecurityGroups(v []*InputSecurityGroup) *ListInputSecurityGroupsOutput { - s.InputSecurityGroups = v +// SetEbpPlacement sets the EbpPlacement field's value. +func (s *M2tsSettings) SetEbpPlacement(v string) *M2tsSettings { + s.EbpPlacement = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListInputSecurityGroupsOutput) SetNextToken(v string) *ListInputSecurityGroupsOutput { - s.NextToken = &v +// SetEcmPid sets the EcmPid field's value. +func (s *M2tsSettings) SetEcmPid(v string) *M2tsSettings { + s.EcmPid = &v return s } -type ListInputsInput struct { - _ struct{} `type:"structure"` - - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +// SetEsRateInPes sets the EsRateInPes field's value. +func (s *M2tsSettings) SetEsRateInPes(v string) *M2tsSettings { + s.EsRateInPes = &v + return s } -// String returns the string representation -func (s ListInputsInput) String() string { - return awsutil.Prettify(s) +// SetEtvPlatformPid sets the EtvPlatformPid field's value. +func (s *M2tsSettings) SetEtvPlatformPid(v string) *M2tsSettings { + s.EtvPlatformPid = &v + return s } -// GoString returns the string representation -func (s ListInputsInput) GoString() string { - return s.String() +// SetEtvSignalPid sets the EtvSignalPid field's value. +func (s *M2tsSettings) SetEtvSignalPid(v string) *M2tsSettings { + s.EtvSignalPid = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListInputsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListInputsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetFragmentTime sets the FragmentTime field's value. +func (s *M2tsSettings) SetFragmentTime(v float64) *M2tsSettings { + s.FragmentTime = &v + return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListInputsInput) SetMaxResults(v int64) *ListInputsInput { - s.MaxResults = &v +// SetKlv sets the Klv field's value. +func (s *M2tsSettings) SetKlv(v string) *M2tsSettings { + s.Klv = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListInputsInput) SetNextToken(v string) *ListInputsInput { - s.NextToken = &v +// SetKlvDataPids sets the KlvDataPids field's value. +func (s *M2tsSettings) SetKlvDataPids(v string) *M2tsSettings { + s.KlvDataPids = &v return s } -type ListInputsOutput struct { - _ struct{} `type:"structure"` - - Inputs []*Input `locationName:"inputs" type:"list"` - - NextToken *string `locationName:"nextToken" type:"string"` +// SetNielsenId3Behavior sets the NielsenId3Behavior field's value. +func (s *M2tsSettings) SetNielsenId3Behavior(v string) *M2tsSettings { + s.NielsenId3Behavior = &v + return s } -// String returns the string representation -func (s ListInputsOutput) String() string { - return awsutil.Prettify(s) +// SetNullPacketBitrate sets the NullPacketBitrate field's value. +func (s *M2tsSettings) SetNullPacketBitrate(v float64) *M2tsSettings { + s.NullPacketBitrate = &v + return s } -// GoString returns the string representation -func (s ListInputsOutput) GoString() string { - return s.String() +// SetPatInterval sets the PatInterval field's value. +func (s *M2tsSettings) SetPatInterval(v int64) *M2tsSettings { + s.PatInterval = &v + return s } -// SetInputs sets the Inputs field's value. -func (s *ListInputsOutput) SetInputs(v []*Input) *ListInputsOutput { - s.Inputs = v +// SetPcrControl sets the PcrControl field's value. +func (s *M2tsSettings) SetPcrControl(v string) *M2tsSettings { + s.PcrControl = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListInputsOutput) SetNextToken(v string) *ListInputsOutput { - s.NextToken = &v +// SetPcrPeriod sets the PcrPeriod field's value. +func (s *M2tsSettings) SetPcrPeriod(v int64) *M2tsSettings { + s.PcrPeriod = &v return s } -type ListOfferingsInput struct { - _ struct{} `type:"structure"` - - ChannelClass *string `location:"querystring" locationName:"channelClass" type:"string"` - - ChannelConfiguration *string `location:"querystring" locationName:"channelConfiguration" type:"string"` - - Codec *string `location:"querystring" locationName:"codec" type:"string"` - - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` - - MaximumBitrate *string `location:"querystring" locationName:"maximumBitrate" type:"string"` - - MaximumFramerate *string `location:"querystring" locationName:"maximumFramerate" type:"string"` - - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` - - Resolution *string `location:"querystring" locationName:"resolution" type:"string"` - - ResourceType *string `location:"querystring" locationName:"resourceType" type:"string"` - - SpecialFeature *string `location:"querystring" locationName:"specialFeature" type:"string"` - - VideoQuality *string `location:"querystring" locationName:"videoQuality" type:"string"` +// SetPcrPid sets the PcrPid field's value. +func (s *M2tsSettings) SetPcrPid(v string) *M2tsSettings { + s.PcrPid = &v + return s } -// String returns the string representation -func (s ListOfferingsInput) String() string { - return awsutil.Prettify(s) +// SetPmtInterval sets the PmtInterval field's value. +func (s *M2tsSettings) SetPmtInterval(v int64) *M2tsSettings { + s.PmtInterval = &v + return s } -// GoString returns the string representation -func (s ListOfferingsInput) GoString() string { - return s.String() +// SetPmtPid sets the PmtPid field's value. +func (s *M2tsSettings) SetPmtPid(v string) *M2tsSettings { + s.PmtPid = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListOfferingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListOfferingsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetProgramNum sets the ProgramNum field's value. +func (s *M2tsSettings) SetProgramNum(v int64) *M2tsSettings { + s.ProgramNum = &v + return s } -// SetChannelClass sets the ChannelClass field's value. -func (s *ListOfferingsInput) SetChannelClass(v string) *ListOfferingsInput { - s.ChannelClass = &v +// SetRateMode sets the RateMode field's value. +func (s *M2tsSettings) SetRateMode(v string) *M2tsSettings { + s.RateMode = &v return s } -// SetChannelConfiguration sets the ChannelConfiguration field's value. -func (s *ListOfferingsInput) SetChannelConfiguration(v string) *ListOfferingsInput { - s.ChannelConfiguration = &v +// SetScte27Pids sets the Scte27Pids field's value. +func (s *M2tsSettings) SetScte27Pids(v string) *M2tsSettings { + s.Scte27Pids = &v return s } -// SetCodec sets the Codec field's value. -func (s *ListOfferingsInput) SetCodec(v string) *ListOfferingsInput { - s.Codec = &v +// SetScte35Control sets the Scte35Control field's value. +func (s *M2tsSettings) SetScte35Control(v string) *M2tsSettings { + s.Scte35Control = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListOfferingsInput) SetMaxResults(v int64) *ListOfferingsInput { - s.MaxResults = &v +// SetScte35Pid sets the Scte35Pid field's value. +func (s *M2tsSettings) SetScte35Pid(v string) *M2tsSettings { + s.Scte35Pid = &v return s } -// SetMaximumBitrate sets the MaximumBitrate field's value. -func (s *ListOfferingsInput) SetMaximumBitrate(v string) *ListOfferingsInput { - s.MaximumBitrate = &v +// SetSegmentationMarkers sets the SegmentationMarkers field's value. +func (s *M2tsSettings) SetSegmentationMarkers(v string) *M2tsSettings { + s.SegmentationMarkers = &v return s } -// SetMaximumFramerate sets the MaximumFramerate field's value. -func (s *ListOfferingsInput) SetMaximumFramerate(v string) *ListOfferingsInput { - s.MaximumFramerate = &v +// SetSegmentationStyle sets the SegmentationStyle field's value. +func (s *M2tsSettings) SetSegmentationStyle(v string) *M2tsSettings { + s.SegmentationStyle = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListOfferingsInput) SetNextToken(v string) *ListOfferingsInput { - s.NextToken = &v +// SetSegmentationTime sets the SegmentationTime field's value. +func (s *M2tsSettings) SetSegmentationTime(v float64) *M2tsSettings { + s.SegmentationTime = &v return s } -// SetResolution sets the Resolution field's value. -func (s *ListOfferingsInput) SetResolution(v string) *ListOfferingsInput { - s.Resolution = &v +// SetTimedMetadataBehavior sets the TimedMetadataBehavior field's value. +func (s *M2tsSettings) SetTimedMetadataBehavior(v string) *M2tsSettings { + s.TimedMetadataBehavior = &v return s } -// SetResourceType sets the ResourceType field's value. -func (s *ListOfferingsInput) SetResourceType(v string) *ListOfferingsInput { - s.ResourceType = &v +// SetTimedMetadataPid sets the TimedMetadataPid field's value. +func (s *M2tsSettings) SetTimedMetadataPid(v string) *M2tsSettings { + s.TimedMetadataPid = &v return s } -// SetSpecialFeature sets the SpecialFeature field's value. -func (s *ListOfferingsInput) SetSpecialFeature(v string) *ListOfferingsInput { - s.SpecialFeature = &v +// SetTransportStreamId sets the TransportStreamId field's value. +func (s *M2tsSettings) SetTransportStreamId(v int64) *M2tsSettings { + s.TransportStreamId = &v return s } -// SetVideoQuality sets the VideoQuality field's value. -func (s *ListOfferingsInput) SetVideoQuality(v string) *ListOfferingsInput { - s.VideoQuality = &v +// SetVideoPid sets the VideoPid field's value. +func (s *M2tsSettings) SetVideoPid(v string) *M2tsSettings { + s.VideoPid = &v return s } -type ListOfferingsOutput struct { +// Settings information for the .m3u8 container +type M3u8Settings struct { _ struct{} `type:"structure"` - NextToken *string `locationName:"nextToken" type:"string"` + // The number of audio frames to insert for each PES packet. + AudioFramesPerPes *int64 `locationName:"audioFramesPerPes" type:"integer"` - Offerings []*Offering `locationName:"offerings" type:"list"` -} + // Packet Identifier (PID) of the elementary audio stream(s) in the transport + // stream. Multiple values are accepted, and can be entered in ranges and/or + // by comma separation. Can be entered as decimal or hexadecimal values. + AudioPids *string `locationName:"audioPids" type:"string"` -// String returns the string representation -func (s ListOfferingsOutput) String() string { - return awsutil.Prettify(s) -} + // This parameter is unused and deprecated. + EcmPid *string `locationName:"ecmPid" type:"string"` -// GoString returns the string representation -func (s ListOfferingsOutput) GoString() string { - return s.String() -} + // If set to passthrough, Nielsen inaudible tones for media tracking will be + // detected in the input audio and an equivalent ID3 tag will be inserted in + // the output. + NielsenId3Behavior *string `locationName:"nielsenId3Behavior" type:"string" enum:"M3u8NielsenId3Behavior"` -// SetNextToken sets the NextToken field's value. -func (s *ListOfferingsOutput) SetNextToken(v string) *ListOfferingsOutput { - s.NextToken = &v - return s -} + // The number of milliseconds between instances of this table in the output + // transport stream. A value of \"0\" writes out the PMT once per segment file. + PatInterval *int64 `locationName:"patInterval" type:"integer"` -// SetOfferings sets the Offerings field's value. -func (s *ListOfferingsOutput) SetOfferings(v []*Offering) *ListOfferingsOutput { - s.Offerings = v - return s -} + // When set to pcrEveryPesPacket, a Program Clock Reference value is inserted + // for every Packetized Elementary Stream (PES) header. This parameter is effective + // only when the PCR PID is the same as the video or audio elementary stream. + PcrControl *string `locationName:"pcrControl" type:"string" enum:"M3u8PcrControl"` -type ListReservationsInput struct { - _ struct{} `type:"structure"` + // Maximum time in milliseconds between Program Clock References (PCRs) inserted + // into the transport stream. + PcrPeriod *int64 `locationName:"pcrPeriod" type:"integer"` - ChannelClass *string `location:"querystring" locationName:"channelClass" type:"string"` + // Packet Identifier (PID) of the Program Clock Reference (PCR) in the transport + // stream. When no value is given, the encoder will assign the same value as + // the Video PID. Can be entered as a decimal or hexadecimal value. + PcrPid *string `locationName:"pcrPid" type:"string"` - Codec *string `location:"querystring" locationName:"codec" type:"string"` + // The number of milliseconds between instances of this table in the output + // transport stream. A value of \"0\" writes out the PMT once per segment file. + PmtInterval *int64 `locationName:"pmtInterval" type:"integer"` - MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + // Packet Identifier (PID) for the Program Map Table (PMT) in the transport + // stream. Can be entered as a decimal or hexadecimal value. + PmtPid *string `locationName:"pmtPid" type:"string"` - MaximumBitrate *string `location:"querystring" locationName:"maximumBitrate" type:"string"` + // The value of the program number field in the Program Map Table. + ProgramNum *int64 `locationName:"programNum" type:"integer"` - MaximumFramerate *string `location:"querystring" locationName:"maximumFramerate" type:"string"` + // If set to passthrough, passes any SCTE-35 signals from the input source to + // this output. + Scte35Behavior *string `locationName:"scte35Behavior" type:"string" enum:"M3u8Scte35Behavior"` - NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + // Packet Identifier (PID) of the SCTE-35 stream in the transport stream. Can + // be entered as a decimal or hexadecimal value. + Scte35Pid *string `locationName:"scte35Pid" type:"string"` - Resolution *string `location:"querystring" locationName:"resolution" type:"string"` + // When set to passthrough, timed metadata is passed through from input to output. + TimedMetadataBehavior *string `locationName:"timedMetadataBehavior" type:"string" enum:"M3u8TimedMetadataBehavior"` - ResourceType *string `location:"querystring" locationName:"resourceType" type:"string"` + // Packet Identifier (PID) of the timed metadata stream in the transport stream. + // Can be entered as a decimal or hexadecimal value. Valid values are 32 (or + // 0x20)..8182 (or 0x1ff6). + TimedMetadataPid *string `locationName:"timedMetadataPid" type:"string"` - SpecialFeature *string `location:"querystring" locationName:"specialFeature" type:"string"` + // The value of the transport stream ID field in the Program Map Table. + TransportStreamId *int64 `locationName:"transportStreamId" type:"integer"` - VideoQuality *string `location:"querystring" locationName:"videoQuality" type:"string"` + // Packet Identifier (PID) of the elementary video stream in the transport stream. + // Can be entered as a decimal or hexadecimal value. + VideoPid *string `locationName:"videoPid" type:"string"` } // String returns the string representation -func (s ListReservationsInput) String() string { +func (s M3u8Settings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListReservationsInput) GoString() string { +func (s M3u8Settings) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListReservationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListReservationsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetAudioFramesPerPes sets the AudioFramesPerPes field's value. +func (s *M3u8Settings) SetAudioFramesPerPes(v int64) *M3u8Settings { + s.AudioFramesPerPes = &v + return s } -// SetChannelClass sets the ChannelClass field's value. -func (s *ListReservationsInput) SetChannelClass(v string) *ListReservationsInput { - s.ChannelClass = &v +// SetAudioPids sets the AudioPids field's value. +func (s *M3u8Settings) SetAudioPids(v string) *M3u8Settings { + s.AudioPids = &v return s } -// SetCodec sets the Codec field's value. -func (s *ListReservationsInput) SetCodec(v string) *ListReservationsInput { - s.Codec = &v +// SetEcmPid sets the EcmPid field's value. +func (s *M3u8Settings) SetEcmPid(v string) *M3u8Settings { + s.EcmPid = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListReservationsInput) SetMaxResults(v int64) *ListReservationsInput { - s.MaxResults = &v +// SetNielsenId3Behavior sets the NielsenId3Behavior field's value. +func (s *M3u8Settings) SetNielsenId3Behavior(v string) *M3u8Settings { + s.NielsenId3Behavior = &v return s } -// SetMaximumBitrate sets the MaximumBitrate field's value. -func (s *ListReservationsInput) SetMaximumBitrate(v string) *ListReservationsInput { - s.MaximumBitrate = &v +// SetPatInterval sets the PatInterval field's value. +func (s *M3u8Settings) SetPatInterval(v int64) *M3u8Settings { + s.PatInterval = &v return s } -// SetMaximumFramerate sets the MaximumFramerate field's value. -func (s *ListReservationsInput) SetMaximumFramerate(v string) *ListReservationsInput { - s.MaximumFramerate = &v +// SetPcrControl sets the PcrControl field's value. +func (s *M3u8Settings) SetPcrControl(v string) *M3u8Settings { + s.PcrControl = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListReservationsInput) SetNextToken(v string) *ListReservationsInput { - s.NextToken = &v +// SetPcrPeriod sets the PcrPeriod field's value. +func (s *M3u8Settings) SetPcrPeriod(v int64) *M3u8Settings { + s.PcrPeriod = &v return s } -// SetResolution sets the Resolution field's value. -func (s *ListReservationsInput) SetResolution(v string) *ListReservationsInput { - s.Resolution = &v +// SetPcrPid sets the PcrPid field's value. +func (s *M3u8Settings) SetPcrPid(v string) *M3u8Settings { + s.PcrPid = &v return s } -// SetResourceType sets the ResourceType field's value. -func (s *ListReservationsInput) SetResourceType(v string) *ListReservationsInput { - s.ResourceType = &v +// SetPmtInterval sets the PmtInterval field's value. +func (s *M3u8Settings) SetPmtInterval(v int64) *M3u8Settings { + s.PmtInterval = &v return s } -// SetSpecialFeature sets the SpecialFeature field's value. -func (s *ListReservationsInput) SetSpecialFeature(v string) *ListReservationsInput { - s.SpecialFeature = &v +// SetPmtPid sets the PmtPid field's value. +func (s *M3u8Settings) SetPmtPid(v string) *M3u8Settings { + s.PmtPid = &v return s } -// SetVideoQuality sets the VideoQuality field's value. -func (s *ListReservationsInput) SetVideoQuality(v string) *ListReservationsInput { - s.VideoQuality = &v +// SetProgramNum sets the ProgramNum field's value. +func (s *M3u8Settings) SetProgramNum(v int64) *M3u8Settings { + s.ProgramNum = &v return s } -type ListReservationsOutput struct { - _ struct{} `type:"structure"` - - NextToken *string `locationName:"nextToken" type:"string"` +// SetScte35Behavior sets the Scte35Behavior field's value. +func (s *M3u8Settings) SetScte35Behavior(v string) *M3u8Settings { + s.Scte35Behavior = &v + return s +} - Reservations []*Reservation `locationName:"reservations" type:"list"` +// SetScte35Pid sets the Scte35Pid field's value. +func (s *M3u8Settings) SetScte35Pid(v string) *M3u8Settings { + s.Scte35Pid = &v + return s } -// String returns the string representation -func (s ListReservationsOutput) String() string { - return awsutil.Prettify(s) +// SetTimedMetadataBehavior sets the TimedMetadataBehavior field's value. +func (s *M3u8Settings) SetTimedMetadataBehavior(v string) *M3u8Settings { + s.TimedMetadataBehavior = &v + return s } -// GoString returns the string representation -func (s ListReservationsOutput) GoString() string { - return s.String() +// SetTimedMetadataPid sets the TimedMetadataPid field's value. +func (s *M3u8Settings) SetTimedMetadataPid(v string) *M3u8Settings { + s.TimedMetadataPid = &v + return s } -// SetNextToken sets the NextToken field's value. -func (s *ListReservationsOutput) SetNextToken(v string) *ListReservationsOutput { - s.NextToken = &v +// SetTransportStreamId sets the TransportStreamId field's value. +func (s *M3u8Settings) SetTransportStreamId(v int64) *M3u8Settings { + s.TransportStreamId = &v return s } -// SetReservations sets the Reservations field's value. -func (s *ListReservationsOutput) SetReservations(v []*Reservation) *ListReservationsOutput { - s.Reservations = v +// SetVideoPid sets the VideoPid field's value. +func (s *M3u8Settings) SetVideoPid(v string) *M3u8Settings { + s.VideoPid = &v return s } -type ListTagsForResourceInput struct { +// The settings for a MediaConnect Flow. +type MediaConnectFlow struct { _ struct{} `type:"structure"` - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` + // The unique ARN of the MediaConnect Flow being used as a source. + FlowArn *string `locationName:"flowArn" type:"string"` } // String returns the string representation -func (s ListTagsForResourceInput) String() string { +func (s MediaConnectFlow) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsForResourceInput) GoString() string { +func (s MediaConnectFlow) 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 +// SetFlowArn sets the FlowArn field's value. +func (s *MediaConnectFlow) SetFlowArn(v string) *MediaConnectFlow { + s.FlowArn = &v return s } -type ListTagsForResourceOutput struct { +// The settings for a MediaConnect Flow. +type MediaConnectFlowRequest struct { _ struct{} `type:"structure"` - Tags map[string]*string `locationName:"tags" type:"map"` + // The ARN of the MediaConnect Flow that you want to use as a source. + FlowArn *string `locationName:"flowArn" type:"string"` } // String returns the string representation -func (s ListTagsForResourceOutput) String() string { +func (s MediaConnectFlowRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsForResourceOutput) GoString() string { +func (s MediaConnectFlowRequest) GoString() string { return s.String() } -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForResourceOutput { - s.Tags = v +// SetFlowArn sets the FlowArn field's value. +func (s *MediaConnectFlowRequest) SetFlowArn(v string) *MediaConnectFlowRequest { + s.FlowArn = &v return s } -// M2ts Settings -type M2tsSettings struct { +// Media Package Group Settings +type MediaPackageGroupSettings struct { _ struct{} `type:"structure"` - // When set to drop, output audio streams will be removed from the program if - // the selected input audio stream is removed from the input. This allows the - // output audio configuration to dynamically change based on input configuration. - // If this is set to encodeSilence, all output audio streams will output encoded - // silence when not connected to an active input stream. - AbsentInputAudioBehavior *string `locationName:"absentInputAudioBehavior" type:"string" enum:"M2tsAbsentInputAudioBehavior"` - - // When set to enabled, uses ARIB-compliant field muxing and removes video descriptor. - Arib *string `locationName:"arib" type:"string" enum:"M2tsArib"` + // MediaPackage channel destination. + // + // Destination is a required field + Destination *OutputLocationRef `locationName:"destination" type:"structure" required:"true"` +} - // Packet Identifier (PID) for ARIB Captions in the transport stream. Can be - // entered as a decimal or hexadecimal value. Valid values are 32 (or 0x20)..8182 - // (or 0x1ff6). - AribCaptionsPid *string `locationName:"aribCaptionsPid" type:"string"` +// String returns the string representation +func (s MediaPackageGroupSettings) String() string { + return awsutil.Prettify(s) +} - // If set to auto, pid number used for ARIB Captions will be auto-selected from - // unused pids. If set to useConfigured, ARIB Captions will be on the configured - // pid number. - AribCaptionsPidControl *string `locationName:"aribCaptionsPidControl" type:"string" enum:"M2tsAribCaptionsPidControl"` +// GoString returns the string representation +func (s MediaPackageGroupSettings) GoString() string { + return s.String() +} - // When set to dvb, uses DVB buffer model for Dolby Digital audio. When set - // to atsc, the ATSC model is used. - AudioBufferModel *string `locationName:"audioBufferModel" type:"string" enum:"M2tsAudioBufferModel"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *MediaPackageGroupSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MediaPackageGroupSettings"} + if s.Destination == nil { + invalidParams.Add(request.NewErrParamRequired("Destination")) + } - // The number of audio frames to insert for each PES packet. - AudioFramesPerPes *int64 `locationName:"audioFramesPerPes" type:"integer"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // Packet Identifier (PID) of the elementary audio stream(s) in the transport - // stream. Multiple values are accepted, and can be entered in ranges and/or - // by comma separation. Can be entered as decimal or hexadecimal values. Each - // PID specified must be in the range of 32 (or 0x20)..8182 (or 0x1ff6). - AudioPids *string `locationName:"audioPids" type:"string"` +// SetDestination sets the Destination field's value. +func (s *MediaPackageGroupSettings) SetDestination(v *OutputLocationRef) *MediaPackageGroupSettings { + s.Destination = v + return s +} - // When set to atsc, uses stream type = 0x81 for AC3 and stream type = 0x87 - // for EAC3. When set to dvb, uses stream type = 0x06. - AudioStreamType *string `locationName:"audioStreamType" type:"string" enum:"M2tsAudioStreamType"` +// MediaPackage Output Destination Settings +type MediaPackageOutputDestinationSettings struct { + _ struct{} `type:"structure"` - // The output bitrate of the transport stream in bits per second. Setting to - // 0 lets the muxer automatically determine the appropriate bitrate. - Bitrate *int64 `locationName:"bitrate" type:"integer"` + // ID of the channel in MediaPackage that is the destination for this output + // group. You do not need to specify the individual inputs in MediaPackage; + // MediaLive will handle the connection of the two MediaLive pipelines to the + // two MediaPackage inputs. The MediaPackage channel and MediaLive channel must + // be in the same region. + ChannelId *string `locationName:"channelId" min:"1" type:"string"` +} - // If set to multiplex, use multiplex buffer model for accurate interleaving. - // Setting to bufferModel to none can lead to lower latency, but low-memory - // devices may not be able to play back the stream without interruptions. - BufferModel *string `locationName:"bufferModel" type:"string" enum:"M2tsBufferModel"` +// String returns the string representation +func (s MediaPackageOutputDestinationSettings) String() string { + return awsutil.Prettify(s) +} - // When set to enabled, generates captionServiceDescriptor in PMT. - CcDescriptor *string `locationName:"ccDescriptor" type:"string" enum:"M2tsCcDescriptor"` +// GoString returns the string representation +func (s MediaPackageOutputDestinationSettings) GoString() string { + return s.String() +} - // Inserts DVB Network Information Table (NIT) at the specified table repetition - // interval. - DvbNitSettings *DvbNitSettings `locationName:"dvbNitSettings" type:"structure"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *MediaPackageOutputDestinationSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MediaPackageOutputDestinationSettings"} + if s.ChannelId != nil && len(*s.ChannelId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChannelId", 1)) + } - // Inserts DVB Service Description Table (SDT) at the specified table repetition - // interval. - DvbSdtSettings *DvbSdtSettings `locationName:"dvbSdtSettings" type:"structure"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // Packet Identifier (PID) for input source DVB Subtitle data to this output. - // Multiple values are accepted, and can be entered in ranges and/or by comma - // separation. Can be entered as decimal or hexadecimal values. Each PID specified - // must be in the range of 32 (or 0x20)..8182 (or 0x1ff6). - DvbSubPids *string `locationName:"dvbSubPids" type:"string"` +// SetChannelId sets the ChannelId field's value. +func (s *MediaPackageOutputDestinationSettings) SetChannelId(v string) *MediaPackageOutputDestinationSettings { + s.ChannelId = &v + return s +} - // Inserts DVB Time and Date Table (TDT) at the specified table repetition interval. - DvbTdtSettings *DvbTdtSettings `locationName:"dvbTdtSettings" type:"structure"` +// Media Package Output Settings +type MediaPackageOutputSettings struct { + _ struct{} `type:"structure"` +} - // Packet Identifier (PID) for input source DVB Teletext data to this output. - // Can be entered as a decimal or hexadecimal value. Valid values are 32 (or - // 0x20)..8182 (or 0x1ff6). - DvbTeletextPid *string `locationName:"dvbTeletextPid" type:"string"` +// String returns the string representation +func (s MediaPackageOutputSettings) String() string { + return awsutil.Prettify(s) +} - // If set to passthrough, passes any EBIF data from the input source to this - // output. - Ebif *string `locationName:"ebif" type:"string" enum:"M2tsEbifControl"` +// GoString returns the string representation +func (s MediaPackageOutputSettings) GoString() string { + return s.String() +} - // When videoAndFixedIntervals is selected, audio EBP markers will be added - // to partitions 3 and 4. The interval between these additional markers will - // be fixed, and will be slightly shorter than the video EBP marker interval. - // Only available when EBP Cablelabs segmentation markers are selected. Partitions - // 1 and 2 will always follow the video interval. - EbpAudioInterval *string `locationName:"ebpAudioInterval" type:"string" enum:"M2tsAudioInterval"` +// Mp2 Settings +type Mp2Settings struct { + _ struct{} `type:"structure"` - // When set, enforces that Encoder Boundary Points do not come within the specified - // time interval of each other by looking ahead at input video. If another EBP - // is going to come in within the specified time interval, the current EBP is - // not emitted, and the segment is "stretched" to the next marker. The lookahead - // value does not add latency to the system. The Live Event must be configured - // elsewhere to create sufficient latency to make the lookahead accurate. - EbpLookaheadMs *int64 `locationName:"ebpLookaheadMs" type:"integer"` + // Average bitrate in bits/second. + Bitrate *float64 `locationName:"bitrate" type:"double"` - // Controls placement of EBP on Audio PIDs. If set to videoAndAudioPids, EBP - // markers will be placed on the video PID and all audio PIDs. If set to videoPid, - // EBP markers will be placed on only the video PID. - EbpPlacement *string `locationName:"ebpPlacement" type:"string" enum:"M2tsEbpPlacement"` + // The MPEG2 Audio coding mode. Valid values are codingMode10 (for mono) or + // codingMode20 (for stereo). + CodingMode *string `locationName:"codingMode" type:"string" enum:"Mp2CodingMode"` - // This field is unused and deprecated. - EcmPid *string `locationName:"ecmPid" type:"string"` + // Sample rate in Hz. + SampleRate *float64 `locationName:"sampleRate" type:"double"` +} - // Include or exclude the ES Rate field in the PES header. - EsRateInPes *string `locationName:"esRateInPes" type:"string" enum:"M2tsEsRateInPes"` +// String returns the string representation +func (s Mp2Settings) String() string { + return awsutil.Prettify(s) +} - // Packet Identifier (PID) for input source ETV Platform data to this output. - // Can be entered as a decimal or hexadecimal value. Valid values are 32 (or - // 0x20)..8182 (or 0x1ff6). - EtvPlatformPid *string `locationName:"etvPlatformPid" type:"string"` +// GoString returns the string representation +func (s Mp2Settings) GoString() string { + return s.String() +} - // Packet Identifier (PID) for input source ETV Signal data to this output. - // Can be entered as a decimal or hexadecimal value. Valid values are 32 (or - // 0x20)..8182 (or 0x1ff6). - EtvSignalPid *string `locationName:"etvSignalPid" type:"string"` +// SetBitrate sets the Bitrate field's value. +func (s *Mp2Settings) SetBitrate(v float64) *Mp2Settings { + s.Bitrate = &v + return s +} - // The length in seconds of each fragment. Only used with EBP markers. - FragmentTime *float64 `locationName:"fragmentTime" type:"double"` +// SetCodingMode sets the CodingMode field's value. +func (s *Mp2Settings) SetCodingMode(v string) *Mp2Settings { + s.CodingMode = &v + return s +} - // If set to passthrough, passes any KLV data from the input source to this - // output. - Klv *string `locationName:"klv" type:"string" enum:"M2tsKlv"` +// SetSampleRate sets the SampleRate field's value. +func (s *Mp2Settings) SetSampleRate(v float64) *Mp2Settings { + s.SampleRate = &v + return s +} - // Packet Identifier (PID) for input source KLV data to this output. Multiple - // values are accepted, and can be entered in ranges and/or by comma separation. - // Can be entered as decimal or hexadecimal values. Each PID specified must - // be in the range of 32 (or 0x20)..8182 (or 0x1ff6). - KlvDataPids *string `locationName:"klvDataPids" type:"string"` +// Ms Smooth Group Settings +type MsSmoothGroupSettings struct { + _ struct{} `type:"structure"` - // Value in bits per second of extra null packets to insert into the transport - // stream. This can be used if a downstream encryption system requires periodic - // null packets. - NullPacketBitrate *float64 `locationName:"nullPacketBitrate" type:"double"` + // The value of the "Acquisition Point Identity" element used in each message + // placed in the sparse track. Only enabled if sparseTrackType is not "none". + AcquisitionPointId *string `locationName:"acquisitionPointId" type:"string"` - // The number of milliseconds between instances of this table in the output - // transport stream. Valid values are 0, 10..1000. - PatInterval *int64 `locationName:"patInterval" type:"integer"` + // If set to passthrough for an audio-only MS Smooth output, the fragment absolute + // time will be set to the current timecode. This option does not write timecodes + // to the audio elementary stream. + AudioOnlyTimecodeControl *string `locationName:"audioOnlyTimecodeControl" type:"string" enum:"SmoothGroupAudioOnlyTimecodeControl"` - // When set to pcrEveryPesPacket, a Program Clock Reference value is inserted - // for every Packetized Elementary Stream (PES) header. This parameter is effective - // only when the PCR PID is the same as the video or audio elementary stream. - PcrControl *string `locationName:"pcrControl" type:"string" enum:"M2tsPcrControl"` + // If set to verifyAuthenticity, verify the https certificate chain to a trusted + // Certificate Authority (CA). This will cause https outputs to self-signed + // certificates to fail. + CertificateMode *string `locationName:"certificateMode" type:"string" enum:"SmoothGroupCertificateMode"` - // Maximum time in milliseconds between Program Clock Reference (PCRs) inserted - // into the transport stream. - PcrPeriod *int64 `locationName:"pcrPeriod" type:"integer"` + // Number of seconds to wait before retrying connection to the IIS server if + // the connection is lost. Content will be cached during this time and the cache + // will be be delivered to the IIS server once the connection is re-established. + ConnectionRetryInterval *int64 `locationName:"connectionRetryInterval" type:"integer"` - // Packet Identifier (PID) of the Program Clock Reference (PCR) in the transport - // stream. When no value is given, the encoder will assign the same value as - // the Video PID. Can be entered as a decimal or hexadecimal value. Valid values - // are 32 (or 0x20)..8182 (or 0x1ff6). - PcrPid *string `locationName:"pcrPid" type:"string"` + // Smooth Streaming publish point on an IIS server. Elemental Live acts as a + // "Push" encoder to IIS. + // + // Destination is a required field + Destination *OutputLocationRef `locationName:"destination" type:"structure" required:"true"` - // The number of milliseconds between instances of this table in the output - // transport stream. Valid values are 0, 10..1000. - PmtInterval *int64 `locationName:"pmtInterval" type:"integer"` + // MS Smooth event ID to be sent to the IIS server.Should only be specified + // if eventIdMode is set to useConfigured. + EventId *string `locationName:"eventId" type:"string"` - // Packet Identifier (PID) for the Program Map Table (PMT) in the transport - // stream. Can be entered as a decimal or hexadecimal value. Valid values are - // 32 (or 0x20)..8182 (or 0x1ff6). - PmtPid *string `locationName:"pmtPid" type:"string"` + // Specifies whether or not to send an event ID to the IIS server. If no event + // ID is sent and the same Live Event is used without changing the publishing + // point, clients might see cached video from the previous run.Options:- "useConfigured" + // - use the value provided in eventId- "useTimestamp" - generate and send an + // event ID based on the current timestamp- "noEventId" - do not send an event + // ID to the IIS server. + EventIdMode *string `locationName:"eventIdMode" type:"string" enum:"SmoothGroupEventIdMode"` - // The value of the program number field in the Program Map Table. - ProgramNum *int64 `locationName:"programNum" type:"integer"` + // When set to sendEos, send EOS signal to IIS server when stopping the event + EventStopBehavior *string `locationName:"eventStopBehavior" type:"string" enum:"SmoothGroupEventStopBehavior"` - // When vbr, does not insert null packets into transport stream to fill specified - // bitrate. The bitrate setting acts as the maximum bitrate when vbr is set. - RateMode *string `locationName:"rateMode" type:"string" enum:"M2tsRateMode"` + // Size in seconds of file cache for streaming outputs. + FilecacheDuration *int64 `locationName:"filecacheDuration" type:"integer"` - // Packet Identifier (PID) for input source SCTE-27 data to this output. Multiple - // values are accepted, and can be entered in ranges and/or by comma separation. - // Can be entered as decimal or hexadecimal values. Each PID specified must - // be in the range of 32 (or 0x20)..8182 (or 0x1ff6). - Scte27Pids *string `locationName:"scte27Pids" type:"string"` + // Length of mp4 fragments to generate (in seconds). Fragment length must be + // compatible with GOP size and framerate. + FragmentLength *int64 `locationName:"fragmentLength" min:"1" type:"integer"` - // Optionally pass SCTE-35 signals from the input source to this output. - Scte35Control *string `locationName:"scte35Control" type:"string" enum:"M2tsScte35Control"` + // Parameter that control output group behavior on input loss. + InputLossAction *string `locationName:"inputLossAction" type:"string" enum:"InputLossActionForMsSmoothOut"` - // Packet Identifier (PID) of the SCTE-35 stream in the transport stream. Can - // be entered as a decimal or hexadecimal value. Valid values are 32 (or 0x20)..8182 - // (or 0x1ff6). - Scte35Pid *string `locationName:"scte35Pid" type:"string"` + // Number of retry attempts. + NumRetries *int64 `locationName:"numRetries" type:"integer"` - // Inserts segmentation markers at each segmentationTime period. raiSegstart - // sets the Random Access Indicator bit in the adaptation field. raiAdapt sets - // the RAI bit and adds the current timecode in the private data bytes. psiSegstart - // inserts PAT and PMT tables at the start of segments. ebp adds Encoder Boundary - // Point information to the adaptation field as per OpenCable specification - // OC-SP-EBP-I01-130118. ebpLegacy adds Encoder Boundary Point information to - // the adaptation field using a legacy proprietary format. - SegmentationMarkers *string `locationName:"segmentationMarkers" type:"string" enum:"M2tsSegmentationMarkers"` + // Number of seconds before initiating a restart due to output failure, due + // to exhausting the numRetries on one segment, or exceeding filecacheDuration. + RestartDelay *int64 `locationName:"restartDelay" type:"integer"` - // The segmentation style parameter controls how segmentation markers are inserted - // into the transport stream. With avails, it is possible that segments may - // be truncated, which can influence where future segmentation markers are inserted.When - // a segmentation style of "resetCadence" is selected and a segment is truncated - // due to an avail, we will reset the segmentation cadence. This means the subsequent - // segment will have a duration of $segmentationTime seconds.When a segmentation - // style of "maintainCadence" is selected and a segment is truncated due to - // an avail, we will not reset the segmentation cadence. This means the subsequent - // segment will likely be truncated as well. However, all segments after that - // will have a duration of $segmentationTime seconds. Note that EBP lookahead - // is a slight exception to this rule. - SegmentationStyle *string `locationName:"segmentationStyle" type:"string" enum:"M2tsSegmentationStyle"` + // useInputSegmentation has been deprecated. The configured segment size is + // always used. + SegmentationMode *string `locationName:"segmentationMode" type:"string" enum:"SmoothGroupSegmentationMode"` - // The length in seconds of each segment. Required unless markers is set to - // None_. - SegmentationTime *float64 `locationName:"segmentationTime" type:"double"` + // Number of milliseconds to delay the output from the second pipeline. + SendDelayMs *int64 `locationName:"sendDelayMs" type:"integer"` - // When set to passthrough, timed metadata will be passed through from input - // to output. - TimedMetadataBehavior *string `locationName:"timedMetadataBehavior" type:"string" enum:"M2tsTimedMetadataBehavior"` + // If set to scte35, use incoming SCTE-35 messages to generate a sparse track + // in this group of MS-Smooth outputs. + SparseTrackType *string `locationName:"sparseTrackType" type:"string" enum:"SmoothGroupSparseTrackType"` - // Packet Identifier (PID) of the timed metadata stream in the transport stream. - // Can be entered as a decimal or hexadecimal value. Valid values are 32 (or - // 0x20)..8182 (or 0x1ff6). - TimedMetadataPid *string `locationName:"timedMetadataPid" type:"string"` + // When set to send, send stream manifest so publishing point doesn't start + // until all streams start. + StreamManifestBehavior *string `locationName:"streamManifestBehavior" type:"string" enum:"SmoothGroupStreamManifestBehavior"` - // The value of the transport stream ID field in the Program Map Table. - TransportStreamId *int64 `locationName:"transportStreamId" type:"integer"` + // Timestamp offset for the event. Only used if timestampOffsetMode is set to + // useConfiguredOffset. + TimestampOffset *string `locationName:"timestampOffset" type:"string"` - // Packet Identifier (PID) of the elementary video stream in the transport stream. - // Can be entered as a decimal or hexadecimal value. Valid values are 32 (or - // 0x20)..8182 (or 0x1ff6). - VideoPid *string `locationName:"videoPid" type:"string"` + // Type of timestamp date offset to use.- useEventStartDate: Use the date the + // event was started as the offset- useConfiguredOffset: Use an explicitly configured + // date as the offset + TimestampOffsetMode *string `locationName:"timestampOffsetMode" type:"string" enum:"SmoothGroupTimestampOffsetMode"` } // String returns the string representation -func (s M2tsSettings) String() string { +func (s MsSmoothGroupSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s M2tsSettings) GoString() string { +func (s MsSmoothGroupSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *M2tsSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "M2tsSettings"} - if s.DvbNitSettings != nil { - if err := s.DvbNitSettings.Validate(); err != nil { - invalidParams.AddNested("DvbNitSettings", err.(request.ErrInvalidParams)) - } - } - if s.DvbSdtSettings != nil { - if err := s.DvbSdtSettings.Validate(); err != nil { - invalidParams.AddNested("DvbSdtSettings", err.(request.ErrInvalidParams)) - } +func (s *MsSmoothGroupSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MsSmoothGroupSettings"} + if s.Destination == nil { + invalidParams.Add(request.NewErrParamRequired("Destination")) } - if s.DvbTdtSettings != nil { - if err := s.DvbTdtSettings.Validate(); err != nil { - invalidParams.AddNested("DvbTdtSettings", err.(request.ErrInvalidParams)) - } + if s.FragmentLength != nil && *s.FragmentLength < 1 { + invalidParams.Add(request.NewErrParamMinValue("FragmentLength", 1)) } if invalidParams.Len() > 0 { @@ -12753,529 +16078,619 @@ func (s *M2tsSettings) Validate() error { return nil } -// SetAbsentInputAudioBehavior sets the AbsentInputAudioBehavior field's value. -func (s *M2tsSettings) SetAbsentInputAudioBehavior(v string) *M2tsSettings { - s.AbsentInputAudioBehavior = &v +// SetAcquisitionPointId sets the AcquisitionPointId field's value. +func (s *MsSmoothGroupSettings) SetAcquisitionPointId(v string) *MsSmoothGroupSettings { + s.AcquisitionPointId = &v return s } -// SetArib sets the Arib field's value. -func (s *M2tsSettings) SetArib(v string) *M2tsSettings { - s.Arib = &v +// SetAudioOnlyTimecodeControl sets the AudioOnlyTimecodeControl field's value. +func (s *MsSmoothGroupSettings) SetAudioOnlyTimecodeControl(v string) *MsSmoothGroupSettings { + s.AudioOnlyTimecodeControl = &v return s } -// SetAribCaptionsPid sets the AribCaptionsPid field's value. -func (s *M2tsSettings) SetAribCaptionsPid(v string) *M2tsSettings { - s.AribCaptionsPid = &v +// SetCertificateMode sets the CertificateMode field's value. +func (s *MsSmoothGroupSettings) SetCertificateMode(v string) *MsSmoothGroupSettings { + s.CertificateMode = &v return s } -// SetAribCaptionsPidControl sets the AribCaptionsPidControl field's value. -func (s *M2tsSettings) SetAribCaptionsPidControl(v string) *M2tsSettings { - s.AribCaptionsPidControl = &v +// SetConnectionRetryInterval sets the ConnectionRetryInterval field's value. +func (s *MsSmoothGroupSettings) SetConnectionRetryInterval(v int64) *MsSmoothGroupSettings { + s.ConnectionRetryInterval = &v return s } -// SetAudioBufferModel sets the AudioBufferModel field's value. -func (s *M2tsSettings) SetAudioBufferModel(v string) *M2tsSettings { - s.AudioBufferModel = &v +// SetDestination sets the Destination field's value. +func (s *MsSmoothGroupSettings) SetDestination(v *OutputLocationRef) *MsSmoothGroupSettings { + s.Destination = v return s } -// SetAudioFramesPerPes sets the AudioFramesPerPes field's value. -func (s *M2tsSettings) SetAudioFramesPerPes(v int64) *M2tsSettings { - s.AudioFramesPerPes = &v +// SetEventId sets the EventId field's value. +func (s *MsSmoothGroupSettings) SetEventId(v string) *MsSmoothGroupSettings { + s.EventId = &v return s } -// SetAudioPids sets the AudioPids field's value. -func (s *M2tsSettings) SetAudioPids(v string) *M2tsSettings { - s.AudioPids = &v +// SetEventIdMode sets the EventIdMode field's value. +func (s *MsSmoothGroupSettings) SetEventIdMode(v string) *MsSmoothGroupSettings { + s.EventIdMode = &v return s } -// SetAudioStreamType sets the AudioStreamType field's value. -func (s *M2tsSettings) SetAudioStreamType(v string) *M2tsSettings { - s.AudioStreamType = &v +// SetEventStopBehavior sets the EventStopBehavior field's value. +func (s *MsSmoothGroupSettings) SetEventStopBehavior(v string) *MsSmoothGroupSettings { + s.EventStopBehavior = &v return s } -// SetBitrate sets the Bitrate field's value. -func (s *M2tsSettings) SetBitrate(v int64) *M2tsSettings { - s.Bitrate = &v +// SetFilecacheDuration sets the FilecacheDuration field's value. +func (s *MsSmoothGroupSettings) SetFilecacheDuration(v int64) *MsSmoothGroupSettings { + s.FilecacheDuration = &v + return s +} + +// SetFragmentLength sets the FragmentLength field's value. +func (s *MsSmoothGroupSettings) SetFragmentLength(v int64) *MsSmoothGroupSettings { + s.FragmentLength = &v + return s +} + +// SetInputLossAction sets the InputLossAction field's value. +func (s *MsSmoothGroupSettings) SetInputLossAction(v string) *MsSmoothGroupSettings { + s.InputLossAction = &v + return s +} + +// SetNumRetries sets the NumRetries field's value. +func (s *MsSmoothGroupSettings) SetNumRetries(v int64) *MsSmoothGroupSettings { + s.NumRetries = &v + return s +} + +// SetRestartDelay sets the RestartDelay field's value. +func (s *MsSmoothGroupSettings) SetRestartDelay(v int64) *MsSmoothGroupSettings { + s.RestartDelay = &v + return s +} + +// SetSegmentationMode sets the SegmentationMode field's value. +func (s *MsSmoothGroupSettings) SetSegmentationMode(v string) *MsSmoothGroupSettings { + s.SegmentationMode = &v + return s +} + +// SetSendDelayMs sets the SendDelayMs field's value. +func (s *MsSmoothGroupSettings) SetSendDelayMs(v int64) *MsSmoothGroupSettings { + s.SendDelayMs = &v + return s +} + +// SetSparseTrackType sets the SparseTrackType field's value. +func (s *MsSmoothGroupSettings) SetSparseTrackType(v string) *MsSmoothGroupSettings { + s.SparseTrackType = &v + return s +} + +// SetStreamManifestBehavior sets the StreamManifestBehavior field's value. +func (s *MsSmoothGroupSettings) SetStreamManifestBehavior(v string) *MsSmoothGroupSettings { + s.StreamManifestBehavior = &v + return s +} + +// SetTimestampOffset sets the TimestampOffset field's value. +func (s *MsSmoothGroupSettings) SetTimestampOffset(v string) *MsSmoothGroupSettings { + s.TimestampOffset = &v + return s +} + +// SetTimestampOffsetMode sets the TimestampOffsetMode field's value. +func (s *MsSmoothGroupSettings) SetTimestampOffsetMode(v string) *MsSmoothGroupSettings { + s.TimestampOffsetMode = &v + return s +} + +// Ms Smooth Output Settings +type MsSmoothOutputSettings struct { + _ struct{} `type:"structure"` + + // Only applicable when this output is referencing an H.265 video description.Specifies + // whether MP4 segments should be packaged as HEV1 or HVC1. + H265PackagingType *string `locationName:"h265PackagingType" type:"string" enum:"MsSmoothH265PackagingType"` + + // String concatenated to the end of the destination filename. Required for + // multiple outputs of the same type. + NameModifier *string `locationName:"nameModifier" type:"string"` +} + +// String returns the string representation +func (s MsSmoothOutputSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MsSmoothOutputSettings) GoString() string { + return s.String() +} + +// SetH265PackagingType sets the H265PackagingType field's value. +func (s *MsSmoothOutputSettings) SetH265PackagingType(v string) *MsSmoothOutputSettings { + s.H265PackagingType = &v + return s +} + +// SetNameModifier sets the NameModifier field's value. +func (s *MsSmoothOutputSettings) SetNameModifier(v string) *MsSmoothOutputSettings { + s.NameModifier = &v + return s +} + +// The multiplex object. +type Multiplex struct { + _ struct{} `type:"structure"` + + // The unique arn of the multiplex. + Arn *string `locationName:"arn" type:"string"` + + // A list of availability zones for the multiplex. + AvailabilityZones []*string `locationName:"availabilityZones" type:"list"` + + // A list of the multiplex output destinations. + Destinations []*MultiplexOutputDestination `locationName:"destinations" type:"list"` + + // The unique id of the multiplex. + Id *string `locationName:"id" type:"string"` + + // Configuration for a multiplex event. + MultiplexSettings *MultiplexSettings `locationName:"multiplexSettings" type:"structure"` + + // The name of the multiplex. + Name *string `locationName:"name" type:"string"` + + // The number of currently healthy pipelines. + PipelinesRunningCount *int64 `locationName:"pipelinesRunningCount" type:"integer"` + + // The number of programs in the multiplex. + ProgramCount *int64 `locationName:"programCount" type:"integer"` + + // The current state of the multiplex. + State *string `locationName:"state" type:"string" enum:"MultiplexState"` + + // A collection of key-value pairs. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s Multiplex) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Multiplex) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *Multiplex) SetArn(v string) *Multiplex { + s.Arn = &v return s } -// SetBufferModel sets the BufferModel field's value. -func (s *M2tsSettings) SetBufferModel(v string) *M2tsSettings { - s.BufferModel = &v +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *Multiplex) SetAvailabilityZones(v []*string) *Multiplex { + s.AvailabilityZones = v return s } -// SetCcDescriptor sets the CcDescriptor field's value. -func (s *M2tsSettings) SetCcDescriptor(v string) *M2tsSettings { - s.CcDescriptor = &v +// SetDestinations sets the Destinations field's value. +func (s *Multiplex) SetDestinations(v []*MultiplexOutputDestination) *Multiplex { + s.Destinations = v return s } -// SetDvbNitSettings sets the DvbNitSettings field's value. -func (s *M2tsSettings) SetDvbNitSettings(v *DvbNitSettings) *M2tsSettings { - s.DvbNitSettings = v +// SetId sets the Id field's value. +func (s *Multiplex) SetId(v string) *Multiplex { + s.Id = &v return s } -// SetDvbSdtSettings sets the DvbSdtSettings field's value. -func (s *M2tsSettings) SetDvbSdtSettings(v *DvbSdtSettings) *M2tsSettings { - s.DvbSdtSettings = v +// SetMultiplexSettings sets the MultiplexSettings field's value. +func (s *Multiplex) SetMultiplexSettings(v *MultiplexSettings) *Multiplex { + s.MultiplexSettings = v return s } -// SetDvbSubPids sets the DvbSubPids field's value. -func (s *M2tsSettings) SetDvbSubPids(v string) *M2tsSettings { - s.DvbSubPids = &v +// SetName sets the Name field's value. +func (s *Multiplex) SetName(v string) *Multiplex { + s.Name = &v return s } -// SetDvbTdtSettings sets the DvbTdtSettings field's value. -func (s *M2tsSettings) SetDvbTdtSettings(v *DvbTdtSettings) *M2tsSettings { - s.DvbTdtSettings = v +// SetPipelinesRunningCount sets the PipelinesRunningCount field's value. +func (s *Multiplex) SetPipelinesRunningCount(v int64) *Multiplex { + s.PipelinesRunningCount = &v return s } -// SetDvbTeletextPid sets the DvbTeletextPid field's value. -func (s *M2tsSettings) SetDvbTeletextPid(v string) *M2tsSettings { - s.DvbTeletextPid = &v +// SetProgramCount sets the ProgramCount field's value. +func (s *Multiplex) SetProgramCount(v int64) *Multiplex { + s.ProgramCount = &v return s } -// SetEbif sets the Ebif field's value. -func (s *M2tsSettings) SetEbif(v string) *M2tsSettings { - s.Ebif = &v +// SetState sets the State field's value. +func (s *Multiplex) SetState(v string) *Multiplex { + s.State = &v return s } -// SetEbpAudioInterval sets the EbpAudioInterval field's value. -func (s *M2tsSettings) SetEbpAudioInterval(v string) *M2tsSettings { - s.EbpAudioInterval = &v +// SetTags sets the Tags field's value. +func (s *Multiplex) SetTags(v map[string]*string) *Multiplex { + s.Tags = v return s } -// SetEbpLookaheadMs sets the EbpLookaheadMs field's value. -func (s *M2tsSettings) SetEbpLookaheadMs(v int64) *M2tsSettings { - s.EbpLookaheadMs = &v - return s +// Multiplex Group Settings +type MultiplexGroupSettings struct { + _ struct{} `type:"structure"` } -// SetEbpPlacement sets the EbpPlacement field's value. -func (s *M2tsSettings) SetEbpPlacement(v string) *M2tsSettings { - s.EbpPlacement = &v - return s +// String returns the string representation +func (s MultiplexGroupSettings) String() string { + return awsutil.Prettify(s) } -// SetEcmPid sets the EcmPid field's value. -func (s *M2tsSettings) SetEcmPid(v string) *M2tsSettings { - s.EcmPid = &v - return s +// GoString returns the string representation +func (s MultiplexGroupSettings) GoString() string { + return s.String() } -// SetEsRateInPes sets the EsRateInPes field's value. -func (s *M2tsSettings) SetEsRateInPes(v string) *M2tsSettings { - s.EsRateInPes = &v - return s +// Multiplex MediaConnect output destination settings. +type MultiplexMediaConnectOutputDestinationSettings struct { + _ struct{} `type:"structure"` + + // The MediaConnect entitlement ARN available as a Flow source. + EntitlementArn *string `locationName:"entitlementArn" min:"1" type:"string"` } -// SetEtvPlatformPid sets the EtvPlatformPid field's value. -func (s *M2tsSettings) SetEtvPlatformPid(v string) *M2tsSettings { - s.EtvPlatformPid = &v - return s +// String returns the string representation +func (s MultiplexMediaConnectOutputDestinationSettings) String() string { + return awsutil.Prettify(s) } -// SetEtvSignalPid sets the EtvSignalPid field's value. -func (s *M2tsSettings) SetEtvSignalPid(v string) *M2tsSettings { - s.EtvSignalPid = &v - return s +// GoString returns the string representation +func (s MultiplexMediaConnectOutputDestinationSettings) GoString() string { + return s.String() } -// SetFragmentTime sets the FragmentTime field's value. -func (s *M2tsSettings) SetFragmentTime(v float64) *M2tsSettings { - s.FragmentTime = &v +// SetEntitlementArn sets the EntitlementArn field's value. +func (s *MultiplexMediaConnectOutputDestinationSettings) SetEntitlementArn(v string) *MultiplexMediaConnectOutputDestinationSettings { + s.EntitlementArn = &v return s } -// SetKlv sets the Klv field's value. -func (s *M2tsSettings) SetKlv(v string) *M2tsSettings { - s.Klv = &v - return s +// Multiplex output destination settings +type MultiplexOutputDestination struct { + _ struct{} `type:"structure"` + + // Multiplex MediaConnect output destination settings. + MediaConnectSettings *MultiplexMediaConnectOutputDestinationSettings `locationName:"mediaConnectSettings" type:"structure"` } -// SetKlvDataPids sets the KlvDataPids field's value. -func (s *M2tsSettings) SetKlvDataPids(v string) *M2tsSettings { - s.KlvDataPids = &v - return s +// String returns the string representation +func (s MultiplexOutputDestination) String() string { + return awsutil.Prettify(s) } -// SetNullPacketBitrate sets the NullPacketBitrate field's value. -func (s *M2tsSettings) SetNullPacketBitrate(v float64) *M2tsSettings { - s.NullPacketBitrate = &v - return s +// GoString returns the string representation +func (s MultiplexOutputDestination) GoString() string { + return s.String() } -// SetPatInterval sets the PatInterval field's value. -func (s *M2tsSettings) SetPatInterval(v int64) *M2tsSettings { - s.PatInterval = &v +// SetMediaConnectSettings sets the MediaConnectSettings field's value. +func (s *MultiplexOutputDestination) SetMediaConnectSettings(v *MultiplexMediaConnectOutputDestinationSettings) *MultiplexOutputDestination { + s.MediaConnectSettings = v return s } -// SetPcrControl sets the PcrControl field's value. -func (s *M2tsSettings) SetPcrControl(v string) *M2tsSettings { - s.PcrControl = &v - return s +// Multiplex Output Settings +type MultiplexOutputSettings struct { + _ struct{} `type:"structure"` + + // Destination is a Multiplex. + // + // Destination is a required field + Destination *OutputLocationRef `locationName:"destination" type:"structure" required:"true"` } -// SetPcrPeriod sets the PcrPeriod field's value. -func (s *M2tsSettings) SetPcrPeriod(v int64) *M2tsSettings { - s.PcrPeriod = &v - return s +// String returns the string representation +func (s MultiplexOutputSettings) String() string { + return awsutil.Prettify(s) } -// SetPcrPid sets the PcrPid field's value. -func (s *M2tsSettings) SetPcrPid(v string) *M2tsSettings { - s.PcrPid = &v - return s +// GoString returns the string representation +func (s MultiplexOutputSettings) GoString() string { + return s.String() } -// SetPmtInterval sets the PmtInterval field's value. -func (s *M2tsSettings) SetPmtInterval(v int64) *M2tsSettings { - s.PmtInterval = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *MultiplexOutputSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MultiplexOutputSettings"} + if s.Destination == nil { + invalidParams.Add(request.NewErrParamRequired("Destination")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetPmtPid sets the PmtPid field's value. -func (s *M2tsSettings) SetPmtPid(v string) *M2tsSettings { - s.PmtPid = &v +// SetDestination sets the Destination field's value. +func (s *MultiplexOutputSettings) SetDestination(v *OutputLocationRef) *MultiplexOutputSettings { + s.Destination = v return s } -// SetProgramNum sets the ProgramNum field's value. -func (s *M2tsSettings) SetProgramNum(v int64) *M2tsSettings { - s.ProgramNum = &v - return s +// The multiplex program object. +type MultiplexProgram struct { + _ struct{} `type:"structure"` + + // The MediaLive channel associated with the program. + ChannelId *string `locationName:"channelId" type:"string"` + + // The settings for this multiplex program. + MultiplexProgramSettings *MultiplexProgramSettings `locationName:"multiplexProgramSettings" type:"structure"` + + // The packet identifier map for this multiplex program. + PacketIdentifiersMap *MultiplexProgramPacketIdentifiersMap `locationName:"packetIdentifiersMap" type:"structure"` + + // The name of the multiplex program. + ProgramName *string `locationName:"programName" type:"string"` } -// SetRateMode sets the RateMode field's value. -func (s *M2tsSettings) SetRateMode(v string) *M2tsSettings { - s.RateMode = &v - return s +// String returns the string representation +func (s MultiplexProgram) String() string { + return awsutil.Prettify(s) } -// SetScte27Pids sets the Scte27Pids field's value. -func (s *M2tsSettings) SetScte27Pids(v string) *M2tsSettings { - s.Scte27Pids = &v - return s +// GoString returns the string representation +func (s MultiplexProgram) GoString() string { + return s.String() } -// SetScte35Control sets the Scte35Control field's value. -func (s *M2tsSettings) SetScte35Control(v string) *M2tsSettings { - s.Scte35Control = &v +// SetChannelId sets the ChannelId field's value. +func (s *MultiplexProgram) SetChannelId(v string) *MultiplexProgram { + s.ChannelId = &v return s } -// SetScte35Pid sets the Scte35Pid field's value. -func (s *M2tsSettings) SetScte35Pid(v string) *M2tsSettings { - s.Scte35Pid = &v +// SetMultiplexProgramSettings sets the MultiplexProgramSettings field's value. +func (s *MultiplexProgram) SetMultiplexProgramSettings(v *MultiplexProgramSettings) *MultiplexProgram { + s.MultiplexProgramSettings = v return s } -// SetSegmentationMarkers sets the SegmentationMarkers field's value. -func (s *M2tsSettings) SetSegmentationMarkers(v string) *M2tsSettings { - s.SegmentationMarkers = &v +// SetPacketIdentifiersMap sets the PacketIdentifiersMap field's value. +func (s *MultiplexProgram) SetPacketIdentifiersMap(v *MultiplexProgramPacketIdentifiersMap) *MultiplexProgram { + s.PacketIdentifiersMap = v return s } -// SetSegmentationStyle sets the SegmentationStyle field's value. -func (s *M2tsSettings) SetSegmentationStyle(v string) *M2tsSettings { - s.SegmentationStyle = &v +// SetProgramName sets the ProgramName field's value. +func (s *MultiplexProgram) SetProgramName(v string) *MultiplexProgram { + s.ProgramName = &v return s } -// SetSegmentationTime sets the SegmentationTime field's value. -func (s *M2tsSettings) SetSegmentationTime(v float64) *M2tsSettings { - s.SegmentationTime = &v - return s +// Multiplex Program Input Destination Settings for outputting a Channel to +// a Multiplex +type MultiplexProgramChannelDestinationSettings struct { + _ struct{} `type:"structure"` + + // The ID of the Multiplex that the encoder is providing output to. You do not + // need to specify the individual inputs to the Multiplex; MediaLive will handle + // the connection of the two MediaLive pipelines to the two Multiplex instances.The + // Multiplex must be in the same region as the Channel. + MultiplexId *string `locationName:"multiplexId" min:"1" type:"string"` + + // The program name of the Multiplex program that the encoder is providing output + // to. + ProgramName *string `locationName:"programName" min:"1" type:"string"` } -// SetTimedMetadataBehavior sets the TimedMetadataBehavior field's value. -func (s *M2tsSettings) SetTimedMetadataBehavior(v string) *M2tsSettings { - s.TimedMetadataBehavior = &v - return s +// String returns the string representation +func (s MultiplexProgramChannelDestinationSettings) String() string { + return awsutil.Prettify(s) } -// SetTimedMetadataPid sets the TimedMetadataPid field's value. -func (s *M2tsSettings) SetTimedMetadataPid(v string) *M2tsSettings { - s.TimedMetadataPid = &v - return s +// GoString returns the string representation +func (s MultiplexProgramChannelDestinationSettings) GoString() string { + return s.String() } -// SetTransportStreamId sets the TransportStreamId field's value. -func (s *M2tsSettings) SetTransportStreamId(v int64) *M2tsSettings { - s.TransportStreamId = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *MultiplexProgramChannelDestinationSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MultiplexProgramChannelDestinationSettings"} + if s.MultiplexId != nil && len(*s.MultiplexId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MultiplexId", 1)) + } + if s.ProgramName != nil && len(*s.ProgramName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ProgramName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMultiplexId sets the MultiplexId field's value. +func (s *MultiplexProgramChannelDestinationSettings) SetMultiplexId(v string) *MultiplexProgramChannelDestinationSettings { + s.MultiplexId = &v return s } -// SetVideoPid sets the VideoPid field's value. -func (s *M2tsSettings) SetVideoPid(v string) *M2tsSettings { - s.VideoPid = &v +// SetProgramName sets the ProgramName field's value. +func (s *MultiplexProgramChannelDestinationSettings) SetProgramName(v string) *MultiplexProgramChannelDestinationSettings { + s.ProgramName = &v return s } -// Settings information for the .m3u8 container -type M3u8Settings struct { +// Packet identifiers map for a given Multiplex program. +type MultiplexProgramPacketIdentifiersMap struct { _ struct{} `type:"structure"` - // The number of audio frames to insert for each PES packet. - AudioFramesPerPes *int64 `locationName:"audioFramesPerPes" type:"integer"` - - // Packet Identifier (PID) of the elementary audio stream(s) in the transport - // stream. Multiple values are accepted, and can be entered in ranges and/or - // by comma separation. Can be entered as decimal or hexadecimal values. - AudioPids *string `locationName:"audioPids" type:"string"` - - // This parameter is unused and deprecated. - EcmPid *string `locationName:"ecmPid" type:"string"` - - // The number of milliseconds between instances of this table in the output - // transport stream. A value of \"0\" writes out the PMT once per segment file. - PatInterval *int64 `locationName:"patInterval" type:"integer"` + AudioPids []*int64 `locationName:"audioPids" type:"list"` - // When set to pcrEveryPesPacket, a Program Clock Reference value is inserted - // for every Packetized Elementary Stream (PES) header. This parameter is effective - // only when the PCR PID is the same as the video or audio elementary stream. - PcrControl *string `locationName:"pcrControl" type:"string" enum:"M3u8PcrControl"` + DvbSubPids []*int64 `locationName:"dvbSubPids" type:"list"` - // Maximum time in milliseconds between Program Clock References (PCRs) inserted - // into the transport stream. - PcrPeriod *int64 `locationName:"pcrPeriod" type:"integer"` + DvbTeletextPid *int64 `locationName:"dvbTeletextPid" type:"integer"` - // Packet Identifier (PID) of the Program Clock Reference (PCR) in the transport - // stream. When no value is given, the encoder will assign the same value as - // the Video PID. Can be entered as a decimal or hexadecimal value. - PcrPid *string `locationName:"pcrPid" type:"string"` + EtvPlatformPid *int64 `locationName:"etvPlatformPid" type:"integer"` - // The number of milliseconds between instances of this table in the output - // transport stream. A value of \"0\" writes out the PMT once per segment file. - PmtInterval *int64 `locationName:"pmtInterval" type:"integer"` + EtvSignalPid *int64 `locationName:"etvSignalPid" type:"integer"` - // Packet Identifier (PID) for the Program Map Table (PMT) in the transport - // stream. Can be entered as a decimal or hexadecimal value. - PmtPid *string `locationName:"pmtPid" type:"string"` + KlvDataPids []*int64 `locationName:"klvDataPids" type:"list"` - // The value of the program number field in the Program Map Table. - ProgramNum *int64 `locationName:"programNum" type:"integer"` + PcrPid *int64 `locationName:"pcrPid" type:"integer"` - // If set to passthrough, passes any SCTE-35 signals from the input source to - // this output. - Scte35Behavior *string `locationName:"scte35Behavior" type:"string" enum:"M3u8Scte35Behavior"` + PmtPid *int64 `locationName:"pmtPid" type:"integer"` - // Packet Identifier (PID) of the SCTE-35 stream in the transport stream. Can - // be entered as a decimal or hexadecimal value. - Scte35Pid *string `locationName:"scte35Pid" type:"string"` + PrivateMetadataPid *int64 `locationName:"privateMetadataPid" type:"integer"` - // When set to passthrough, timed metadata is passed through from input to output. - TimedMetadataBehavior *string `locationName:"timedMetadataBehavior" type:"string" enum:"M3u8TimedMetadataBehavior"` + Scte27Pids []*int64 `locationName:"scte27Pids" type:"list"` - // Packet Identifier (PID) of the timed metadata stream in the transport stream. - // Can be entered as a decimal or hexadecimal value. Valid values are 32 (or - // 0x20)..8182 (or 0x1ff6). - TimedMetadataPid *string `locationName:"timedMetadataPid" type:"string"` + Scte35Pid *int64 `locationName:"scte35Pid" type:"integer"` - // The value of the transport stream ID field in the Program Map Table. - TransportStreamId *int64 `locationName:"transportStreamId" type:"integer"` + TimedMetadataPid *int64 `locationName:"timedMetadataPid" type:"integer"` - // Packet Identifier (PID) of the elementary video stream in the transport stream. - // Can be entered as a decimal or hexadecimal value. - VideoPid *string `locationName:"videoPid" type:"string"` + VideoPid *int64 `locationName:"videoPid" type:"integer"` } // String returns the string representation -func (s M3u8Settings) String() string { +func (s MultiplexProgramPacketIdentifiersMap) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s M3u8Settings) GoString() string { +func (s MultiplexProgramPacketIdentifiersMap) GoString() string { return s.String() } -// SetAudioFramesPerPes sets the AudioFramesPerPes field's value. -func (s *M3u8Settings) SetAudioFramesPerPes(v int64) *M3u8Settings { - s.AudioFramesPerPes = &v +// SetAudioPids sets the AudioPids field's value. +func (s *MultiplexProgramPacketIdentifiersMap) SetAudioPids(v []*int64) *MultiplexProgramPacketIdentifiersMap { + s.AudioPids = v return s } -// SetAudioPids sets the AudioPids field's value. -func (s *M3u8Settings) SetAudioPids(v string) *M3u8Settings { - s.AudioPids = &v +// SetDvbSubPids sets the DvbSubPids field's value. +func (s *MultiplexProgramPacketIdentifiersMap) SetDvbSubPids(v []*int64) *MultiplexProgramPacketIdentifiersMap { + s.DvbSubPids = v return s } -// SetEcmPid sets the EcmPid field's value. -func (s *M3u8Settings) SetEcmPid(v string) *M3u8Settings { - s.EcmPid = &v +// SetDvbTeletextPid sets the DvbTeletextPid field's value. +func (s *MultiplexProgramPacketIdentifiersMap) SetDvbTeletextPid(v int64) *MultiplexProgramPacketIdentifiersMap { + s.DvbTeletextPid = &v return s } -// SetPatInterval sets the PatInterval field's value. -func (s *M3u8Settings) SetPatInterval(v int64) *M3u8Settings { - s.PatInterval = &v +// SetEtvPlatformPid sets the EtvPlatformPid field's value. +func (s *MultiplexProgramPacketIdentifiersMap) SetEtvPlatformPid(v int64) *MultiplexProgramPacketIdentifiersMap { + s.EtvPlatformPid = &v return s } -// SetPcrControl sets the PcrControl field's value. -func (s *M3u8Settings) SetPcrControl(v string) *M3u8Settings { - s.PcrControl = &v +// SetEtvSignalPid sets the EtvSignalPid field's value. +func (s *MultiplexProgramPacketIdentifiersMap) SetEtvSignalPid(v int64) *MultiplexProgramPacketIdentifiersMap { + s.EtvSignalPid = &v return s } -// SetPcrPeriod sets the PcrPeriod field's value. -func (s *M3u8Settings) SetPcrPeriod(v int64) *M3u8Settings { - s.PcrPeriod = &v +// SetKlvDataPids sets the KlvDataPids field's value. +func (s *MultiplexProgramPacketIdentifiersMap) SetKlvDataPids(v []*int64) *MultiplexProgramPacketIdentifiersMap { + s.KlvDataPids = v return s } // SetPcrPid sets the PcrPid field's value. -func (s *M3u8Settings) SetPcrPid(v string) *M3u8Settings { +func (s *MultiplexProgramPacketIdentifiersMap) SetPcrPid(v int64) *MultiplexProgramPacketIdentifiersMap { s.PcrPid = &v return s } -// SetPmtInterval sets the PmtInterval field's value. -func (s *M3u8Settings) SetPmtInterval(v int64) *M3u8Settings { - s.PmtInterval = &v - return s -} - // SetPmtPid sets the PmtPid field's value. -func (s *M3u8Settings) SetPmtPid(v string) *M3u8Settings { +func (s *MultiplexProgramPacketIdentifiersMap) SetPmtPid(v int64) *MultiplexProgramPacketIdentifiersMap { s.PmtPid = &v return s } -// SetProgramNum sets the ProgramNum field's value. -func (s *M3u8Settings) SetProgramNum(v int64) *M3u8Settings { - s.ProgramNum = &v +// SetPrivateMetadataPid sets the PrivateMetadataPid field's value. +func (s *MultiplexProgramPacketIdentifiersMap) SetPrivateMetadataPid(v int64) *MultiplexProgramPacketIdentifiersMap { + s.PrivateMetadataPid = &v return s } -// SetScte35Behavior sets the Scte35Behavior field's value. -func (s *M3u8Settings) SetScte35Behavior(v string) *M3u8Settings { - s.Scte35Behavior = &v +// SetScte27Pids sets the Scte27Pids field's value. +func (s *MultiplexProgramPacketIdentifiersMap) SetScte27Pids(v []*int64) *MultiplexProgramPacketIdentifiersMap { + s.Scte27Pids = v return s } // SetScte35Pid sets the Scte35Pid field's value. -func (s *M3u8Settings) SetScte35Pid(v string) *M3u8Settings { +func (s *MultiplexProgramPacketIdentifiersMap) SetScte35Pid(v int64) *MultiplexProgramPacketIdentifiersMap { s.Scte35Pid = &v return s } -// SetTimedMetadataBehavior sets the TimedMetadataBehavior field's value. -func (s *M3u8Settings) SetTimedMetadataBehavior(v string) *M3u8Settings { - s.TimedMetadataBehavior = &v - return s -} - // SetTimedMetadataPid sets the TimedMetadataPid field's value. -func (s *M3u8Settings) SetTimedMetadataPid(v string) *M3u8Settings { +func (s *MultiplexProgramPacketIdentifiersMap) SetTimedMetadataPid(v int64) *MultiplexProgramPacketIdentifiersMap { s.TimedMetadataPid = &v return s } -// SetTransportStreamId sets the TransportStreamId field's value. -func (s *M3u8Settings) SetTransportStreamId(v int64) *M3u8Settings { - s.TransportStreamId = &v - return s -} - // SetVideoPid sets the VideoPid field's value. -func (s *M3u8Settings) SetVideoPid(v string) *M3u8Settings { +func (s *MultiplexProgramPacketIdentifiersMap) SetVideoPid(v int64) *MultiplexProgramPacketIdentifiersMap { s.VideoPid = &v return s } -// The settings for a MediaConnect Flow. -type MediaConnectFlow struct { - _ struct{} `type:"structure"` - - // The unique ARN of the MediaConnect Flow being used as a source. - FlowArn *string `locationName:"flowArn" type:"string"` -} - -// String returns the string representation -func (s MediaConnectFlow) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MediaConnectFlow) GoString() string { - return s.String() -} - -// SetFlowArn sets the FlowArn field's value. -func (s *MediaConnectFlow) SetFlowArn(v string) *MediaConnectFlow { - s.FlowArn = &v - return s -} - -// The settings for a MediaConnect Flow. -type MediaConnectFlowRequest struct { +// Transport stream service descriptor configuration for the Multiplex program. +type MultiplexProgramServiceDescriptor struct { _ struct{} `type:"structure"` - // The ARN of the MediaConnect Flow that you want to use as a source. - FlowArn *string `locationName:"flowArn" type:"string"` -} - -// String returns the string representation -func (s MediaConnectFlowRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s MediaConnectFlowRequest) GoString() string { - return s.String() -} - -// SetFlowArn sets the FlowArn field's value. -func (s *MediaConnectFlowRequest) SetFlowArn(v string) *MediaConnectFlowRequest { - s.FlowArn = &v - return s -} - -// Media Package Group Settings -type MediaPackageGroupSettings struct { - _ struct{} `type:"structure"` + // Name of the provider. + // + // ProviderName is a required field + ProviderName *string `locationName:"providerName" type:"string" required:"true"` - // MediaPackage channel destination. + // Name of the service. // - // Destination is a required field - Destination *OutputLocationRef `locationName:"destination" type:"structure" required:"true"` + // ServiceName is a required field + ServiceName *string `locationName:"serviceName" type:"string" required:"true"` } // String returns the string representation -func (s MediaPackageGroupSettings) String() string { +func (s MultiplexProgramServiceDescriptor) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MediaPackageGroupSettings) GoString() string { +func (s MultiplexProgramServiceDescriptor) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *MediaPackageGroupSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MediaPackageGroupSettings"} - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) +func (s *MultiplexProgramServiceDescriptor) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MultiplexProgramServiceDescriptor"} + if s.ProviderName == nil { + invalidParams.Add(request.NewErrParamRequired("ProviderName")) + } + if s.ServiceName == nil { + invalidParams.Add(request.NewErrParamRequired("ServiceName")) } if invalidParams.Len() > 0 { @@ -13284,39 +16699,59 @@ func (s *MediaPackageGroupSettings) Validate() error { return nil } -// SetDestination sets the Destination field's value. -func (s *MediaPackageGroupSettings) SetDestination(v *OutputLocationRef) *MediaPackageGroupSettings { - s.Destination = v +// SetProviderName sets the ProviderName field's value. +func (s *MultiplexProgramServiceDescriptor) SetProviderName(v string) *MultiplexProgramServiceDescriptor { + s.ProviderName = &v return s } -// MediaPackage Output Destination Settings -type MediaPackageOutputDestinationSettings struct { +// SetServiceName sets the ServiceName field's value. +func (s *MultiplexProgramServiceDescriptor) SetServiceName(v string) *MultiplexProgramServiceDescriptor { + s.ServiceName = &v + return s +} + +// Multiplex Program settings configuration. +type MultiplexProgramSettings struct { _ struct{} `type:"structure"` - // ID of the channel in MediaPackage that is the destination for this output - // group. You do not need to specify the individual inputs in MediaPackage; - // MediaLive will handle the connection of the two MediaLive pipelines to the - // two MediaPackage inputs. The MediaPackage channel and MediaLive channel must - // be in the same region. - ChannelId *string `locationName:"channelId" min:"1" type:"string"` + // Unique program number. + // + // ProgramNumber is a required field + ProgramNumber *int64 `locationName:"programNumber" type:"integer" required:"true"` + + // Transport stream service descriptor configuration for the Multiplex program. + ServiceDescriptor *MultiplexProgramServiceDescriptor `locationName:"serviceDescriptor" type:"structure"` + + // Program video settings configuration. + VideoSettings *MultiplexVideoSettings `locationName:"videoSettings" type:"structure"` } // String returns the string representation -func (s MediaPackageOutputDestinationSettings) String() string { +func (s MultiplexProgramSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MediaPackageOutputDestinationSettings) GoString() string { +func (s MultiplexProgramSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *MediaPackageOutputDestinationSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MediaPackageOutputDestinationSettings"} - if s.ChannelId != nil && len(*s.ChannelId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelId", 1)) +func (s *MultiplexProgramSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MultiplexProgramSettings"} + if s.ProgramNumber == nil { + invalidParams.Add(request.NewErrParamRequired("ProgramNumber")) + } + if s.ServiceDescriptor != nil { + if err := s.ServiceDescriptor.Validate(); err != nil { + invalidParams.AddNested("ServiceDescriptor", err.(request.ErrInvalidParams)) + } + } + if s.VideoSettings != nil { + if err := s.VideoSettings.Validate(); err != nil { + invalidParams.AddNested("VideoSettings", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -13325,174 +16760,101 @@ func (s *MediaPackageOutputDestinationSettings) Validate() error { return nil } -// SetChannelId sets the ChannelId field's value. -func (s *MediaPackageOutputDestinationSettings) SetChannelId(v string) *MediaPackageOutputDestinationSettings { - s.ChannelId = &v +// SetProgramNumber sets the ProgramNumber field's value. +func (s *MultiplexProgramSettings) SetProgramNumber(v int64) *MultiplexProgramSettings { + s.ProgramNumber = &v return s } -// Media Package Output Settings -type MediaPackageOutputSettings struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s MediaPackageOutputSettings) String() string { - return awsutil.Prettify(s) +// SetServiceDescriptor sets the ServiceDescriptor field's value. +func (s *MultiplexProgramSettings) SetServiceDescriptor(v *MultiplexProgramServiceDescriptor) *MultiplexProgramSettings { + s.ServiceDescriptor = v + return s } -// GoString returns the string representation -func (s MediaPackageOutputSettings) GoString() string { - return s.String() +// SetVideoSettings sets the VideoSettings field's value. +func (s *MultiplexProgramSettings) SetVideoSettings(v *MultiplexVideoSettings) *MultiplexProgramSettings { + s.VideoSettings = v + return s } -// Mp2 Settings -type Mp2Settings struct { +type MultiplexProgramSummary struct { _ struct{} `type:"structure"` - // Average bitrate in bits/second. - Bitrate *float64 `locationName:"bitrate" type:"double"` - - // The MPEG2 Audio coding mode. Valid values are codingMode10 (for mono) or - // codingMode20 (for stereo). - CodingMode *string `locationName:"codingMode" type:"string" enum:"Mp2CodingMode"` + // The MediaLive Channel associated with the program. + ChannelId *string `locationName:"channelId" type:"string"` - // Sample rate in Hz. - SampleRate *float64 `locationName:"sampleRate" type:"double"` + // The name of the multiplex program. + ProgramName *string `locationName:"programName" type:"string"` } // String returns the string representation -func (s Mp2Settings) String() string { +func (s MultiplexProgramSummary) String() string { return awsutil.Prettify(s) } -// GoString returns the string representation -func (s Mp2Settings) GoString() string { - return s.String() -} - -// SetBitrate sets the Bitrate field's value. -func (s *Mp2Settings) SetBitrate(v float64) *Mp2Settings { - s.Bitrate = &v - return s -} - -// SetCodingMode sets the CodingMode field's value. -func (s *Mp2Settings) SetCodingMode(v string) *Mp2Settings { - s.CodingMode = &v - return s -} - -// SetSampleRate sets the SampleRate field's value. -func (s *Mp2Settings) SetSampleRate(v float64) *Mp2Settings { - s.SampleRate = &v - return s -} - -// Ms Smooth Group Settings -type MsSmoothGroupSettings struct { - _ struct{} `type:"structure"` - - // The value of the "Acquisition Point Identity" element used in each message - // placed in the sparse track. Only enabled if sparseTrackType is not "none". - AcquisitionPointId *string `locationName:"acquisitionPointId" type:"string"` - - // If set to passthrough for an audio-only MS Smooth output, the fragment absolute - // time will be set to the current timecode. This option does not write timecodes - // to the audio elementary stream. - AudioOnlyTimecodeControl *string `locationName:"audioOnlyTimecodeControl" type:"string" enum:"SmoothGroupAudioOnlyTimecodeControl"` - - // If set to verifyAuthenticity, verify the https certificate chain to a trusted - // Certificate Authority (CA). This will cause https outputs to self-signed - // certificates to fail. - CertificateMode *string `locationName:"certificateMode" type:"string" enum:"SmoothGroupCertificateMode"` - - // Number of seconds to wait before retrying connection to the IIS server if - // the connection is lost. Content will be cached during this time and the cache - // will be be delivered to the IIS server once the connection is re-established. - ConnectionRetryInterval *int64 `locationName:"connectionRetryInterval" type:"integer"` - - // Smooth Streaming publish point on an IIS server. Elemental Live acts as a - // "Push" encoder to IIS. - // - // Destination is a required field - Destination *OutputLocationRef `locationName:"destination" type:"structure" required:"true"` - - // MS Smooth event ID to be sent to the IIS server.Should only be specified - // if eventIdMode is set to useConfigured. - EventId *string `locationName:"eventId" type:"string"` - - // Specifies whether or not to send an event ID to the IIS server. If no event - // ID is sent and the same Live Event is used without changing the publishing - // point, clients might see cached video from the previous run.Options:- "useConfigured" - // - use the value provided in eventId- "useTimestamp" - generate and send an - // event ID based on the current timestamp- "noEventId" - do not send an event - // ID to the IIS server. - EventIdMode *string `locationName:"eventIdMode" type:"string" enum:"SmoothGroupEventIdMode"` - - // When set to sendEos, send EOS signal to IIS server when stopping the event - EventStopBehavior *string `locationName:"eventStopBehavior" type:"string" enum:"SmoothGroupEventStopBehavior"` - - // Size in seconds of file cache for streaming outputs. - FilecacheDuration *int64 `locationName:"filecacheDuration" type:"integer"` - - // Length of mp4 fragments to generate (in seconds). Fragment length must be - // compatible with GOP size and framerate. - FragmentLength *int64 `locationName:"fragmentLength" min:"1" type:"integer"` - - // Parameter that control output group behavior on input loss. - InputLossAction *string `locationName:"inputLossAction" type:"string" enum:"InputLossActionForMsSmoothOut"` - - // Number of retry attempts. - NumRetries *int64 `locationName:"numRetries" type:"integer"` +// GoString returns the string representation +func (s MultiplexProgramSummary) GoString() string { + return s.String() +} - // Number of seconds before initiating a restart due to output failure, due - // to exhausting the numRetries on one segment, or exceeding filecacheDuration. - RestartDelay *int64 `locationName:"restartDelay" type:"integer"` +// SetChannelId sets the ChannelId field's value. +func (s *MultiplexProgramSummary) SetChannelId(v string) *MultiplexProgramSummary { + s.ChannelId = &v + return s +} - // useInputSegmentation has been deprecated. The configured segment size is - // always used. - SegmentationMode *string `locationName:"segmentationMode" type:"string" enum:"SmoothGroupSegmentationMode"` +// SetProgramName sets the ProgramName field's value. +func (s *MultiplexProgramSummary) SetProgramName(v string) *MultiplexProgramSummary { + s.ProgramName = &v + return s +} - // Number of milliseconds to delay the output from the second pipeline. - SendDelayMs *int64 `locationName:"sendDelayMs" type:"integer"` +// Contains configuration for a Multiplex event +type MultiplexSettings struct { + _ struct{} `type:"structure"` - // If set to scte35, use incoming SCTE-35 messages to generate a sparse track - // in this group of MS-Smooth outputs. - SparseTrackType *string `locationName:"sparseTrackType" type:"string" enum:"SmoothGroupSparseTrackType"` + // Maximum video buffer delay in milliseconds. + MaximumVideoBufferDelayMilliseconds *int64 `locationName:"maximumVideoBufferDelayMilliseconds" min:"1000" type:"integer"` - // When set to send, send stream manifest so publishing point doesn't start - // until all streams start. - StreamManifestBehavior *string `locationName:"streamManifestBehavior" type:"string" enum:"SmoothGroupStreamManifestBehavior"` + // Transport stream bit rate. + // + // TransportStreamBitrate is a required field + TransportStreamBitrate *int64 `locationName:"transportStreamBitrate" min:"1e+06" type:"integer" required:"true"` - // Timestamp offset for the event. Only used if timestampOffsetMode is set to - // useConfiguredOffset. - TimestampOffset *string `locationName:"timestampOffset" type:"string"` + // Transport stream ID. + // + // TransportStreamId is a required field + TransportStreamId *int64 `locationName:"transportStreamId" type:"integer" required:"true"` - // Type of timestamp date offset to use.- useEventStartDate: Use the date the - // event was started as the offset- useConfiguredOffset: Use an explicitly configured - // date as the offset - TimestampOffsetMode *string `locationName:"timestampOffsetMode" type:"string" enum:"SmoothGroupTimestampOffsetMode"` + // Transport stream reserved bit rate. + TransportStreamReservedBitrate *int64 `locationName:"transportStreamReservedBitrate" type:"integer"` } // String returns the string representation -func (s MsSmoothGroupSettings) String() string { +func (s MultiplexSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MsSmoothGroupSettings) GoString() string { +func (s MultiplexSettings) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *MsSmoothGroupSettings) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MsSmoothGroupSettings"} - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) +func (s *MultiplexSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MultiplexSettings"} + if s.MaximumVideoBufferDelayMilliseconds != nil && *s.MaximumVideoBufferDelayMilliseconds < 1000 { + invalidParams.Add(request.NewErrParamMinValue("MaximumVideoBufferDelayMilliseconds", 1000)) } - if s.FragmentLength != nil && *s.FragmentLength < 1 { - invalidParams.Add(request.NewErrParamMinValue("FragmentLength", 1)) + if s.TransportStreamBitrate == nil { + invalidParams.Add(request.NewErrParamRequired("TransportStreamBitrate")) + } + if s.TransportStreamBitrate != nil && *s.TransportStreamBitrate < 1e+06 { + invalidParams.Add(request.NewErrParamMinValue("TransportStreamBitrate", 1e+06)) + } + if s.TransportStreamId == nil { + invalidParams.Add(request.NewErrParamRequired("TransportStreamId")) } if invalidParams.Len() > 0 { @@ -13501,152 +16863,248 @@ func (s *MsSmoothGroupSettings) Validate() error { return nil } -// SetAcquisitionPointId sets the AcquisitionPointId field's value. -func (s *MsSmoothGroupSettings) SetAcquisitionPointId(v string) *MsSmoothGroupSettings { - s.AcquisitionPointId = &v +// SetMaximumVideoBufferDelayMilliseconds sets the MaximumVideoBufferDelayMilliseconds field's value. +func (s *MultiplexSettings) SetMaximumVideoBufferDelayMilliseconds(v int64) *MultiplexSettings { + s.MaximumVideoBufferDelayMilliseconds = &v return s } -// SetAudioOnlyTimecodeControl sets the AudioOnlyTimecodeControl field's value. -func (s *MsSmoothGroupSettings) SetAudioOnlyTimecodeControl(v string) *MsSmoothGroupSettings { - s.AudioOnlyTimecodeControl = &v +// SetTransportStreamBitrate sets the TransportStreamBitrate field's value. +func (s *MultiplexSettings) SetTransportStreamBitrate(v int64) *MultiplexSettings { + s.TransportStreamBitrate = &v return s } -// SetCertificateMode sets the CertificateMode field's value. -func (s *MsSmoothGroupSettings) SetCertificateMode(v string) *MsSmoothGroupSettings { - s.CertificateMode = &v +// SetTransportStreamId sets the TransportStreamId field's value. +func (s *MultiplexSettings) SetTransportStreamId(v int64) *MultiplexSettings { + s.TransportStreamId = &v return s } -// SetConnectionRetryInterval sets the ConnectionRetryInterval field's value. -func (s *MsSmoothGroupSettings) SetConnectionRetryInterval(v int64) *MsSmoothGroupSettings { - s.ConnectionRetryInterval = &v +// SetTransportStreamReservedBitrate sets the TransportStreamReservedBitrate field's value. +func (s *MultiplexSettings) SetTransportStreamReservedBitrate(v int64) *MultiplexSettings { + s.TransportStreamReservedBitrate = &v return s } -// SetDestination sets the Destination field's value. -func (s *MsSmoothGroupSettings) SetDestination(v *OutputLocationRef) *MsSmoothGroupSettings { - s.Destination = v - return s +// Contains summary configuration for a Multiplex event. +type MultiplexSettingsSummary struct { + _ struct{} `type:"structure"` + + // Transport stream bit rate. + TransportStreamBitrate *int64 `locationName:"transportStreamBitrate" min:"1e+06" type:"integer"` } -// SetEventId sets the EventId field's value. -func (s *MsSmoothGroupSettings) SetEventId(v string) *MsSmoothGroupSettings { - s.EventId = &v - return s +// String returns the string representation +func (s MultiplexSettingsSummary) String() string { + return awsutil.Prettify(s) } -// SetEventIdMode sets the EventIdMode field's value. -func (s *MsSmoothGroupSettings) SetEventIdMode(v string) *MsSmoothGroupSettings { - s.EventIdMode = &v - return s +// GoString returns the string representation +func (s MultiplexSettingsSummary) GoString() string { + return s.String() } -// SetEventStopBehavior sets the EventStopBehavior field's value. -func (s *MsSmoothGroupSettings) SetEventStopBehavior(v string) *MsSmoothGroupSettings { - s.EventStopBehavior = &v +// SetTransportStreamBitrate sets the TransportStreamBitrate field's value. +func (s *MultiplexSettingsSummary) SetTransportStreamBitrate(v int64) *MultiplexSettingsSummary { + s.TransportStreamBitrate = &v return s } -// SetFilecacheDuration sets the FilecacheDuration field's value. -func (s *MsSmoothGroupSettings) SetFilecacheDuration(v int64) *MsSmoothGroupSettings { - s.FilecacheDuration = &v +// Statmux rate control settings +type MultiplexStatmuxVideoSettings struct { + _ struct{} `type:"structure"` + + // Maximum statmux bitrate. + MaximumBitrate *int64 `locationName:"maximumBitrate" min:"100000" type:"integer"` + + // Minimum statmux bitrate. + MinimumBitrate *int64 `locationName:"minimumBitrate" min:"100000" type:"integer"` +} + +// String returns the string representation +func (s MultiplexStatmuxVideoSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MultiplexStatmuxVideoSettings) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *MultiplexStatmuxVideoSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MultiplexStatmuxVideoSettings"} + if s.MaximumBitrate != nil && *s.MaximumBitrate < 100000 { + invalidParams.Add(request.NewErrParamMinValue("MaximumBitrate", 100000)) + } + if s.MinimumBitrate != nil && *s.MinimumBitrate < 100000 { + invalidParams.Add(request.NewErrParamMinValue("MinimumBitrate", 100000)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaximumBitrate sets the MaximumBitrate field's value. +func (s *MultiplexStatmuxVideoSettings) SetMaximumBitrate(v int64) *MultiplexStatmuxVideoSettings { + s.MaximumBitrate = &v return s } -// SetFragmentLength sets the FragmentLength field's value. -func (s *MsSmoothGroupSettings) SetFragmentLength(v int64) *MsSmoothGroupSettings { - s.FragmentLength = &v +// SetMinimumBitrate sets the MinimumBitrate field's value. +func (s *MultiplexStatmuxVideoSettings) SetMinimumBitrate(v int64) *MultiplexStatmuxVideoSettings { + s.MinimumBitrate = &v return s } -// SetInputLossAction sets the InputLossAction field's value. -func (s *MsSmoothGroupSettings) SetInputLossAction(v string) *MsSmoothGroupSettings { - s.InputLossAction = &v +type MultiplexSummary struct { + _ struct{} `type:"structure"` + + // The unique arn of the multiplex. + Arn *string `locationName:"arn" type:"string"` + + // A list of availability zones for the multiplex. + AvailabilityZones []*string `locationName:"availabilityZones" type:"list"` + + // The unique id of the multiplex. + Id *string `locationName:"id" type:"string"` + + // Configuration for a multiplex event. + MultiplexSettings *MultiplexSettingsSummary `locationName:"multiplexSettings" type:"structure"` + + // The name of the multiplex. + Name *string `locationName:"name" type:"string"` + + // The number of currently healthy pipelines. + PipelinesRunningCount *int64 `locationName:"pipelinesRunningCount" type:"integer"` + + // The number of programs in the multiplex. + ProgramCount *int64 `locationName:"programCount" type:"integer"` + + // The current state of the multiplex. + State *string `locationName:"state" type:"string" enum:"MultiplexState"` + + // A collection of key-value pairs. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s MultiplexSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MultiplexSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *MultiplexSummary) SetArn(v string) *MultiplexSummary { + s.Arn = &v return s } -// SetNumRetries sets the NumRetries field's value. -func (s *MsSmoothGroupSettings) SetNumRetries(v int64) *MsSmoothGroupSettings { - s.NumRetries = &v +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *MultiplexSummary) SetAvailabilityZones(v []*string) *MultiplexSummary { + s.AvailabilityZones = v return s } -// SetRestartDelay sets the RestartDelay field's value. -func (s *MsSmoothGroupSettings) SetRestartDelay(v int64) *MsSmoothGroupSettings { - s.RestartDelay = &v +// SetId sets the Id field's value. +func (s *MultiplexSummary) SetId(v string) *MultiplexSummary { + s.Id = &v return s } -// SetSegmentationMode sets the SegmentationMode field's value. -func (s *MsSmoothGroupSettings) SetSegmentationMode(v string) *MsSmoothGroupSettings { - s.SegmentationMode = &v +// SetMultiplexSettings sets the MultiplexSettings field's value. +func (s *MultiplexSummary) SetMultiplexSettings(v *MultiplexSettingsSummary) *MultiplexSummary { + s.MultiplexSettings = v return s } -// SetSendDelayMs sets the SendDelayMs field's value. -func (s *MsSmoothGroupSettings) SetSendDelayMs(v int64) *MsSmoothGroupSettings { - s.SendDelayMs = &v +// SetName sets the Name field's value. +func (s *MultiplexSummary) SetName(v string) *MultiplexSummary { + s.Name = &v return s } -// SetSparseTrackType sets the SparseTrackType field's value. -func (s *MsSmoothGroupSettings) SetSparseTrackType(v string) *MsSmoothGroupSettings { - s.SparseTrackType = &v +// SetPipelinesRunningCount sets the PipelinesRunningCount field's value. +func (s *MultiplexSummary) SetPipelinesRunningCount(v int64) *MultiplexSummary { + s.PipelinesRunningCount = &v return s } -// SetStreamManifestBehavior sets the StreamManifestBehavior field's value. -func (s *MsSmoothGroupSettings) SetStreamManifestBehavior(v string) *MsSmoothGroupSettings { - s.StreamManifestBehavior = &v +// SetProgramCount sets the ProgramCount field's value. +func (s *MultiplexSummary) SetProgramCount(v int64) *MultiplexSummary { + s.ProgramCount = &v return s } -// SetTimestampOffset sets the TimestampOffset field's value. -func (s *MsSmoothGroupSettings) SetTimestampOffset(v string) *MsSmoothGroupSettings { - s.TimestampOffset = &v +// SetState sets the State field's value. +func (s *MultiplexSummary) SetState(v string) *MultiplexSummary { + s.State = &v return s } -// SetTimestampOffsetMode sets the TimestampOffsetMode field's value. -func (s *MsSmoothGroupSettings) SetTimestampOffsetMode(v string) *MsSmoothGroupSettings { - s.TimestampOffsetMode = &v +// SetTags sets the Tags field's value. +func (s *MultiplexSummary) SetTags(v map[string]*string) *MultiplexSummary { + s.Tags = v return s } -// Ms Smooth Output Settings -type MsSmoothOutputSettings struct { +// The video configuration for each program in a multiplex. +type MultiplexVideoSettings struct { _ struct{} `type:"structure"` - // Only applicable when this output is referencing an H.265 video description.Specifies - // whether MP4 segments should be packaged as HEV1 or HVC1. - H265PackagingType *string `locationName:"h265PackagingType" type:"string" enum:"MsSmoothH265PackagingType"` + // The constant bitrate configuration for the video encode.When this field is + // defined, StatmuxSettings must be undefined. + ConstantBitrate *int64 `locationName:"constantBitrate" min:"100000" type:"integer"` - // String concatenated to the end of the destination filename. Required for - // multiple outputs of the same type. - NameModifier *string `locationName:"nameModifier" type:"string"` + // Statmux rate control settings.When this field is defined, ConstantBitrate + // must be undefined. + StatmuxSettings *MultiplexStatmuxVideoSettings `locationName:"statmuxSettings" type:"structure"` } // String returns the string representation -func (s MsSmoothOutputSettings) String() string { +func (s MultiplexVideoSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MsSmoothOutputSettings) GoString() string { +func (s MultiplexVideoSettings) GoString() string { return s.String() } -// SetH265PackagingType sets the H265PackagingType field's value. -func (s *MsSmoothOutputSettings) SetH265PackagingType(v string) *MsSmoothOutputSettings { - s.H265PackagingType = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *MultiplexVideoSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MultiplexVideoSettings"} + if s.ConstantBitrate != nil && *s.ConstantBitrate < 100000 { + invalidParams.Add(request.NewErrParamMinValue("ConstantBitrate", 100000)) + } + if s.StatmuxSettings != nil { + if err := s.StatmuxSettings.Validate(); err != nil { + invalidParams.AddNested("StatmuxSettings", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConstantBitrate sets the ConstantBitrate field's value. +func (s *MultiplexVideoSettings) SetConstantBitrate(v int64) *MultiplexVideoSettings { + s.ConstantBitrate = &v return s } -// SetNameModifier sets the NameModifier field's value. -func (s *MsSmoothOutputSettings) SetNameModifier(v string) *MsSmoothOutputSettings { - s.NameModifier = &v +// SetStatmuxSettings sets the StatmuxSettings field's value. +func (s *MultiplexVideoSettings) SetStatmuxSettings(v *MultiplexStatmuxVideoSettings) *MultiplexVideoSettings { + s.StatmuxSettings = v return s } @@ -13689,6 +17147,94 @@ func (s *NetworkInputSettings) SetServerValidation(v string) *NetworkInputSettin return s } +// Nielsen Configuration +type NielsenConfiguration struct { + _ struct{} `type:"structure"` + + // Enter the Distributor ID assigned to your organization by Nielsen. + DistributorId *string `locationName:"distributorId" type:"string"` + + // Enables Nielsen PCM to ID3 tagging + NielsenPcmToId3Tagging *string `locationName:"nielsenPcmToId3Tagging" type:"string" enum:"NielsenPcmToId3TaggingState"` +} + +// String returns the string representation +func (s NielsenConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NielsenConfiguration) GoString() string { + return s.String() +} + +// SetDistributorId sets the DistributorId field's value. +func (s *NielsenConfiguration) SetDistributorId(v string) *NielsenConfiguration { + s.DistributorId = &v + return s +} + +// SetNielsenPcmToId3Tagging sets the NielsenPcmToId3Tagging field's value. +func (s *NielsenConfiguration) SetNielsenPcmToId3Tagging(v string) *NielsenConfiguration { + s.NielsenPcmToId3Tagging = &v + return s +} + +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Reserved resources available for purchase type Offering struct { _ struct{} `type:"structure"` @@ -13897,6 +17443,9 @@ type OutputDestination struct { // encoders. MediaPackageSettings []*MediaPackageOutputDestinationSettings `locationName:"mediaPackageSettings" type:"list"` + // Destination settings for a Multiplex output; one destination for both encoders. + MultiplexSettings *MultiplexProgramChannelDestinationSettings `locationName:"multiplexSettings" type:"structure"` + // Destination settings for a standard output; one destination for each redundant // encoder. Settings []*OutputDestinationSettings `locationName:"settings" type:"list"` @@ -13925,6 +17474,11 @@ func (s *OutputDestination) Validate() error { } } } + if s.MultiplexSettings != nil { + if err := s.MultiplexSettings.Validate(); err != nil { + invalidParams.AddNested("MultiplexSettings", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -13944,6 +17498,12 @@ func (s *OutputDestination) SetMediaPackageSettings(v []*MediaPackageOutputDesti return s } +// SetMultiplexSettings sets the MultiplexSettings field's value. +func (s *OutputDestination) SetMultiplexSettings(v *MultiplexProgramChannelDestinationSettings) *OutputDestination { + s.MultiplexSettings = v + return s +} + // SetSettings sets the Settings field's value. func (s *OutputDestination) SetSettings(v []*OutputDestinationSettings) *OutputDestination { s.Settings = v @@ -14096,6 +17656,9 @@ type OutputGroupSettings struct { // Ms Smooth Group Settings MsSmoothGroupSettings *MsSmoothGroupSettings `locationName:"msSmoothGroupSettings" type:"structure"` + // Multiplex Group Settings + MultiplexGroupSettings *MultiplexGroupSettings `locationName:"multiplexGroupSettings" type:"structure"` + // Rtmp Group Settings RtmpGroupSettings *RtmpGroupSettings `locationName:"rtmpGroupSettings" type:"structure"` @@ -14183,6 +17746,12 @@ func (s *OutputGroupSettings) SetMsSmoothGroupSettings(v *MsSmoothGroupSettings) return s } +// SetMultiplexGroupSettings sets the MultiplexGroupSettings field's value. +func (s *OutputGroupSettings) SetMultiplexGroupSettings(v *MultiplexGroupSettings) *OutputGroupSettings { + s.MultiplexGroupSettings = v + return s +} + // SetRtmpGroupSettings sets the RtmpGroupSettings field's value. func (s *OutputGroupSettings) SetRtmpGroupSettings(v *RtmpGroupSettings) *OutputGroupSettings { s.RtmpGroupSettings = v @@ -14237,6 +17806,9 @@ type OutputSettings struct { // Ms Smooth Output Settings MsSmoothOutputSettings *MsSmoothOutputSettings `locationName:"msSmoothOutputSettings" type:"structure"` + // Multiplex Output Settings + MultiplexOutputSettings *MultiplexOutputSettings `locationName:"multiplexOutputSettings" type:"structure"` + // Rtmp Output Settings RtmpOutputSettings *RtmpOutputSettings `locationName:"rtmpOutputSettings" type:"structure"` @@ -14267,6 +17839,11 @@ func (s *OutputSettings) Validate() error { invalidParams.AddNested("HlsOutputSettings", err.(request.ErrInvalidParams)) } } + if s.MultiplexOutputSettings != nil { + if err := s.MultiplexOutputSettings.Validate(); err != nil { + invalidParams.AddNested("MultiplexOutputSettings", err.(request.ErrInvalidParams)) + } + } if s.RtmpOutputSettings != nil { if err := s.RtmpOutputSettings.Validate(); err != nil { invalidParams.AddNested("RtmpOutputSettings", err.(request.ErrInvalidParams)) @@ -14314,6 +17891,12 @@ func (s *OutputSettings) SetMsSmoothOutputSettings(v *MsSmoothOutputSettings) *O return s } +// SetMultiplexOutputSettings sets the MultiplexOutputSettings field's value. +func (s *OutputSettings) SetMultiplexOutputSettings(v *MultiplexOutputSettings) *OutputSettings { + s.MultiplexOutputSettings = v + return s +} + // SetRtmpOutputSettings sets the RtmpOutputSettings field's value. func (s *OutputSettings) SetRtmpOutputSettings(v *RtmpOutputSettings) *OutputSettings { s.RtmpOutputSettings = v @@ -14877,7 +18460,7 @@ type ReservationResourceSpecification struct { // Resolution, e.g. 'HD' Resolution *string `locationName:"resolution" type:"string" enum:"ReservationResolution"` - // Resource type, 'INPUT', 'OUTPUT', or 'CHANNEL' + // Resource type, 'INPUT', 'OUTPUT', 'MULTIPLEX', or 'CHANNEL' ResourceType *string `locationName:"resourceType" type:"string" enum:"ReservationResourceType"` // Special feature, e.g. 'AUDIO_NORMALIZATION' (Channels only) @@ -15214,6 +18797,9 @@ func (s *ScheduleAction) SetScheduleActionStartSettings(v *ScheduleActionStartSe type ScheduleActionSettings struct { _ struct{} `type:"structure"` + // Action to insert HLS ID3 segment tagging + HlsId3SegmentTaggingSettings *HlsId3SegmentTaggingScheduleActionSettings `locationName:"hlsId3SegmentTaggingSettings" type:"structure"` + // Action to insert HLS metadata HlsTimedMetadataSettings *HlsTimedMetadataScheduleActionSettings `locationName:"hlsTimedMetadataSettings" type:"structure"` @@ -15252,6 +18838,11 @@ func (s ScheduleActionSettings) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *ScheduleActionSettings) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ScheduleActionSettings"} + if s.HlsId3SegmentTaggingSettings != nil { + if err := s.HlsId3SegmentTaggingSettings.Validate(); err != nil { + invalidParams.AddNested("HlsId3SegmentTaggingSettings", err.(request.ErrInvalidParams)) + } + } if s.HlsTimedMetadataSettings != nil { if err := s.HlsTimedMetadataSettings.Validate(); err != nil { invalidParams.AddNested("HlsTimedMetadataSettings", err.(request.ErrInvalidParams)) @@ -15294,6 +18885,12 @@ func (s *ScheduleActionSettings) Validate() error { return nil } +// SetHlsId3SegmentTaggingSettings sets the HlsId3SegmentTaggingSettings field's value. +func (s *ScheduleActionSettings) SetHlsId3SegmentTaggingSettings(v *HlsId3SegmentTaggingScheduleActionSettings) *ScheduleActionSettings { + s.HlsId3SegmentTaggingSettings = v + return s +} + // SetHlsTimedMetadataSettings sets the HlsTimedMetadataSettings field's value. func (s *ScheduleActionSettings) SetHlsTimedMetadataSettings(v *HlsTimedMetadataScheduleActionSettings) *ScheduleActionSettings { s.HlsTimedMetadataSettings = v @@ -16356,6 +19953,141 @@ func (s *StartChannelOutput) SetTags(v map[string]*string) *StartChannelOutput { return s } +type StartMultiplexInput struct { + _ struct{} `type:"structure"` + + // MultiplexId is a required field + MultiplexId *string `location:"uri" locationName:"multiplexId" type:"string" required:"true"` +} + +// String returns the string representation +func (s StartMultiplexInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartMultiplexInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartMultiplexInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartMultiplexInput"} + if s.MultiplexId == nil { + invalidParams.Add(request.NewErrParamRequired("MultiplexId")) + } + if s.MultiplexId != nil && len(*s.MultiplexId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MultiplexId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMultiplexId sets the MultiplexId field's value. +func (s *StartMultiplexInput) SetMultiplexId(v string) *StartMultiplexInput { + s.MultiplexId = &v + return s +} + +type StartMultiplexOutput struct { + _ struct{} `type:"structure"` + + Arn *string `locationName:"arn" type:"string"` + + AvailabilityZones []*string `locationName:"availabilityZones" type:"list"` + + Destinations []*MultiplexOutputDestination `locationName:"destinations" type:"list"` + + Id *string `locationName:"id" type:"string"` + + // Contains configuration for a Multiplex event + MultiplexSettings *MultiplexSettings `locationName:"multiplexSettings" type:"structure"` + + Name *string `locationName:"name" type:"string"` + + PipelinesRunningCount *int64 `locationName:"pipelinesRunningCount" type:"integer"` + + ProgramCount *int64 `locationName:"programCount" type:"integer"` + + // The current state of the multiplex. + State *string `locationName:"state" type:"string" enum:"MultiplexState"` + + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s StartMultiplexOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartMultiplexOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *StartMultiplexOutput) SetArn(v string) *StartMultiplexOutput { + s.Arn = &v + return s +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *StartMultiplexOutput) SetAvailabilityZones(v []*string) *StartMultiplexOutput { + s.AvailabilityZones = v + return s +} + +// SetDestinations sets the Destinations field's value. +func (s *StartMultiplexOutput) SetDestinations(v []*MultiplexOutputDestination) *StartMultiplexOutput { + s.Destinations = v + return s +} + +// SetId sets the Id field's value. +func (s *StartMultiplexOutput) SetId(v string) *StartMultiplexOutput { + s.Id = &v + return s +} + +// SetMultiplexSettings sets the MultiplexSettings field's value. +func (s *StartMultiplexOutput) SetMultiplexSettings(v *MultiplexSettings) *StartMultiplexOutput { + s.MultiplexSettings = v + return s +} + +// SetName sets the Name field's value. +func (s *StartMultiplexOutput) SetName(v string) *StartMultiplexOutput { + s.Name = &v + return s +} + +// SetPipelinesRunningCount sets the PipelinesRunningCount field's value. +func (s *StartMultiplexOutput) SetPipelinesRunningCount(v int64) *StartMultiplexOutput { + s.PipelinesRunningCount = &v + return s +} + +// SetProgramCount sets the ProgramCount field's value. +func (s *StartMultiplexOutput) SetProgramCount(v int64) *StartMultiplexOutput { + s.ProgramCount = &v + return s +} + +// SetState sets the State field's value. +func (s *StartMultiplexOutput) SetState(v string) *StartMultiplexOutput { + s.State = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *StartMultiplexOutput) SetTags(v map[string]*string) *StartMultiplexOutput { + s.Tags = v + return s +} + // Settings to identify the start of the clip. type StartTimecode struct { _ struct{} `type:"structure"` @@ -16689,113 +20421,248 @@ type StopChannelOutput struct { Name *string `locationName:"name" type:"string"` - PipelineDetails []*PipelineDetail `locationName:"pipelineDetails" type:"list"` - + PipelineDetails []*PipelineDetail `locationName:"pipelineDetails" type:"list"` + + PipelinesRunningCount *int64 `locationName:"pipelinesRunningCount" type:"integer"` + + RoleArn *string `locationName:"roleArn" type:"string"` + + State *string `locationName:"state" type:"string" enum:"ChannelState"` + + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s StopChannelOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopChannelOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *StopChannelOutput) SetArn(v string) *StopChannelOutput { + s.Arn = &v + return s +} + +// SetChannelClass sets the ChannelClass field's value. +func (s *StopChannelOutput) SetChannelClass(v string) *StopChannelOutput { + s.ChannelClass = &v + return s +} + +// SetDestinations sets the Destinations field's value. +func (s *StopChannelOutput) SetDestinations(v []*OutputDestination) *StopChannelOutput { + s.Destinations = v + return s +} + +// SetEgressEndpoints sets the EgressEndpoints field's value. +func (s *StopChannelOutput) SetEgressEndpoints(v []*ChannelEgressEndpoint) *StopChannelOutput { + s.EgressEndpoints = v + return s +} + +// SetEncoderSettings sets the EncoderSettings field's value. +func (s *StopChannelOutput) SetEncoderSettings(v *EncoderSettings) *StopChannelOutput { + s.EncoderSettings = v + return s +} + +// SetId sets the Id field's value. +func (s *StopChannelOutput) SetId(v string) *StopChannelOutput { + s.Id = &v + return s +} + +// SetInputAttachments sets the InputAttachments field's value. +func (s *StopChannelOutput) SetInputAttachments(v []*InputAttachment) *StopChannelOutput { + s.InputAttachments = v + return s +} + +// SetInputSpecification sets the InputSpecification field's value. +func (s *StopChannelOutput) SetInputSpecification(v *InputSpecification) *StopChannelOutput { + s.InputSpecification = v + return s +} + +// SetLogLevel sets the LogLevel field's value. +func (s *StopChannelOutput) SetLogLevel(v string) *StopChannelOutput { + s.LogLevel = &v + return s +} + +// SetName sets the Name field's value. +func (s *StopChannelOutput) SetName(v string) *StopChannelOutput { + s.Name = &v + return s +} + +// SetPipelineDetails sets the PipelineDetails field's value. +func (s *StopChannelOutput) SetPipelineDetails(v []*PipelineDetail) *StopChannelOutput { + s.PipelineDetails = v + return s +} + +// SetPipelinesRunningCount sets the PipelinesRunningCount field's value. +func (s *StopChannelOutput) SetPipelinesRunningCount(v int64) *StopChannelOutput { + s.PipelinesRunningCount = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *StopChannelOutput) SetRoleArn(v string) *StopChannelOutput { + s.RoleArn = &v + return s +} + +// SetState sets the State field's value. +func (s *StopChannelOutput) SetState(v string) *StopChannelOutput { + s.State = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *StopChannelOutput) SetTags(v map[string]*string) *StopChannelOutput { + s.Tags = v + return s +} + +type StopMultiplexInput struct { + _ struct{} `type:"structure"` + + // MultiplexId is a required field + MultiplexId *string `location:"uri" locationName:"multiplexId" type:"string" required:"true"` +} + +// String returns the string representation +func (s StopMultiplexInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopMultiplexInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StopMultiplexInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopMultiplexInput"} + if s.MultiplexId == nil { + invalidParams.Add(request.NewErrParamRequired("MultiplexId")) + } + if s.MultiplexId != nil && len(*s.MultiplexId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MultiplexId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMultiplexId sets the MultiplexId field's value. +func (s *StopMultiplexInput) SetMultiplexId(v string) *StopMultiplexInput { + s.MultiplexId = &v + return s +} + +type StopMultiplexOutput struct { + _ struct{} `type:"structure"` + + Arn *string `locationName:"arn" type:"string"` + + AvailabilityZones []*string `locationName:"availabilityZones" type:"list"` + + Destinations []*MultiplexOutputDestination `locationName:"destinations" type:"list"` + + Id *string `locationName:"id" type:"string"` + + // Contains configuration for a Multiplex event + MultiplexSettings *MultiplexSettings `locationName:"multiplexSettings" type:"structure"` + + Name *string `locationName:"name" type:"string"` + PipelinesRunningCount *int64 `locationName:"pipelinesRunningCount" type:"integer"` - RoleArn *string `locationName:"roleArn" type:"string"` + ProgramCount *int64 `locationName:"programCount" type:"integer"` - State *string `locationName:"state" type:"string" enum:"ChannelState"` + // The current state of the multiplex. + State *string `locationName:"state" type:"string" enum:"MultiplexState"` Tags map[string]*string `locationName:"tags" type:"map"` } // String returns the string representation -func (s StopChannelOutput) String() string { +func (s StopMultiplexOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s StopChannelOutput) GoString() string { +func (s StopMultiplexOutput) GoString() string { return s.String() } // SetArn sets the Arn field's value. -func (s *StopChannelOutput) SetArn(v string) *StopChannelOutput { +func (s *StopMultiplexOutput) SetArn(v string) *StopMultiplexOutput { s.Arn = &v return s } -// SetChannelClass sets the ChannelClass field's value. -func (s *StopChannelOutput) SetChannelClass(v string) *StopChannelOutput { - s.ChannelClass = &v +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *StopMultiplexOutput) SetAvailabilityZones(v []*string) *StopMultiplexOutput { + s.AvailabilityZones = v return s } // SetDestinations sets the Destinations field's value. -func (s *StopChannelOutput) SetDestinations(v []*OutputDestination) *StopChannelOutput { +func (s *StopMultiplexOutput) SetDestinations(v []*MultiplexOutputDestination) *StopMultiplexOutput { s.Destinations = v return s } -// SetEgressEndpoints sets the EgressEndpoints field's value. -func (s *StopChannelOutput) SetEgressEndpoints(v []*ChannelEgressEndpoint) *StopChannelOutput { - s.EgressEndpoints = v - return s -} - -// SetEncoderSettings sets the EncoderSettings field's value. -func (s *StopChannelOutput) SetEncoderSettings(v *EncoderSettings) *StopChannelOutput { - s.EncoderSettings = v - return s -} - // SetId sets the Id field's value. -func (s *StopChannelOutput) SetId(v string) *StopChannelOutput { +func (s *StopMultiplexOutput) SetId(v string) *StopMultiplexOutput { s.Id = &v return s } -// SetInputAttachments sets the InputAttachments field's value. -func (s *StopChannelOutput) SetInputAttachments(v []*InputAttachment) *StopChannelOutput { - s.InputAttachments = v - return s -} - -// SetInputSpecification sets the InputSpecification field's value. -func (s *StopChannelOutput) SetInputSpecification(v *InputSpecification) *StopChannelOutput { - s.InputSpecification = v - return s -} - -// SetLogLevel sets the LogLevel field's value. -func (s *StopChannelOutput) SetLogLevel(v string) *StopChannelOutput { - s.LogLevel = &v +// SetMultiplexSettings sets the MultiplexSettings field's value. +func (s *StopMultiplexOutput) SetMultiplexSettings(v *MultiplexSettings) *StopMultiplexOutput { + s.MultiplexSettings = v return s } // SetName sets the Name field's value. -func (s *StopChannelOutput) SetName(v string) *StopChannelOutput { +func (s *StopMultiplexOutput) SetName(v string) *StopMultiplexOutput { s.Name = &v return s } -// SetPipelineDetails sets the PipelineDetails field's value. -func (s *StopChannelOutput) SetPipelineDetails(v []*PipelineDetail) *StopChannelOutput { - s.PipelineDetails = v - return s -} - // SetPipelinesRunningCount sets the PipelinesRunningCount field's value. -func (s *StopChannelOutput) SetPipelinesRunningCount(v int64) *StopChannelOutput { +func (s *StopMultiplexOutput) SetPipelinesRunningCount(v int64) *StopMultiplexOutput { s.PipelinesRunningCount = &v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *StopChannelOutput) SetRoleArn(v string) *StopChannelOutput { - s.RoleArn = &v +// SetProgramCount sets the ProgramCount field's value. +func (s *StopMultiplexOutput) SetProgramCount(v int64) *StopMultiplexOutput { + s.ProgramCount = &v return s } // SetState sets the State field's value. -func (s *StopChannelOutput) SetState(v string) *StopChannelOutput { +func (s *StopMultiplexOutput) SetState(v string) *StopMultiplexOutput { s.State = &v return s } // SetTags sets the Tags field's value. -func (s *StopChannelOutput) SetTags(v map[string]*string) *StopChannelOutput { +func (s *StopMultiplexOutput) SetTags(v map[string]*string) *StopMultiplexOutput { s.Tags = v return s } @@ -16937,6 +20804,61 @@ func (s *TimecodeConfig) SetSyncThreshold(v int64) *TimecodeConfig { return s } +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + // Ttml Destination Settings type TtmlDestinationSettings struct { _ struct{} `type:"structure"` @@ -17135,6 +21057,63 @@ func (s *UdpOutputSettings) SetFecOutputSettings(v *FecOutputSettings) *UdpOutpu return s } +type UnprocessableEntityException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + ValidationErrors []*ValidationError `locationName:"validationErrors" type:"list"` +} + +// String returns the string representation +func (s UnprocessableEntityException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnprocessableEntityException) GoString() string { + return s.String() +} + +func newErrorUnprocessableEntityException(v protocol.ResponseMetadata) error { + return &UnprocessableEntityException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnprocessableEntityException) Code() string { + return "UnprocessableEntityException" +} + +// Message returns the exception's message. +func (s UnprocessableEntityException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnprocessableEntityException) OrigErr() error { + return nil +} + +func (s UnprocessableEntityException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnprocessableEntityException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnprocessableEntityException) RequestID() string { + return s.respMetadata.RequestID +} + type UpdateChannelClassInput struct { _ struct{} `type:"structure"` @@ -17560,6 +21539,181 @@ func (s *UpdateInputSecurityGroupOutput) SetSecurityGroup(v *InputSecurityGroup) return s } +type UpdateMultiplexInput struct { + _ struct{} `type:"structure"` + + // MultiplexId is a required field + MultiplexId *string `location:"uri" locationName:"multiplexId" type:"string" required:"true"` + + // Contains configuration for a Multiplex event + MultiplexSettings *MultiplexSettings `locationName:"multiplexSettings" type:"structure"` + + Name *string `locationName:"name" type:"string"` +} + +// String returns the string representation +func (s UpdateMultiplexInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateMultiplexInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateMultiplexInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateMultiplexInput"} + if s.MultiplexId == nil { + invalidParams.Add(request.NewErrParamRequired("MultiplexId")) + } + if s.MultiplexId != nil && len(*s.MultiplexId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MultiplexId", 1)) + } + if s.MultiplexSettings != nil { + if err := s.MultiplexSettings.Validate(); err != nil { + invalidParams.AddNested("MultiplexSettings", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMultiplexId sets the MultiplexId field's value. +func (s *UpdateMultiplexInput) SetMultiplexId(v string) *UpdateMultiplexInput { + s.MultiplexId = &v + return s +} + +// SetMultiplexSettings sets the MultiplexSettings field's value. +func (s *UpdateMultiplexInput) SetMultiplexSettings(v *MultiplexSettings) *UpdateMultiplexInput { + s.MultiplexSettings = v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateMultiplexInput) SetName(v string) *UpdateMultiplexInput { + s.Name = &v + return s +} + +type UpdateMultiplexOutput struct { + _ struct{} `type:"structure"` + + // The multiplex object. + Multiplex *Multiplex `locationName:"multiplex" type:"structure"` +} + +// String returns the string representation +func (s UpdateMultiplexOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateMultiplexOutput) GoString() string { + return s.String() +} + +// SetMultiplex sets the Multiplex field's value. +func (s *UpdateMultiplexOutput) SetMultiplex(v *Multiplex) *UpdateMultiplexOutput { + s.Multiplex = v + return s +} + +type UpdateMultiplexProgramInput struct { + _ struct{} `type:"structure"` + + // MultiplexId is a required field + MultiplexId *string `location:"uri" locationName:"multiplexId" type:"string" required:"true"` + + // Multiplex Program settings configuration. + MultiplexProgramSettings *MultiplexProgramSettings `locationName:"multiplexProgramSettings" type:"structure"` + + // ProgramName is a required field + ProgramName *string `location:"uri" locationName:"programName" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateMultiplexProgramInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateMultiplexProgramInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateMultiplexProgramInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateMultiplexProgramInput"} + if s.MultiplexId == nil { + invalidParams.Add(request.NewErrParamRequired("MultiplexId")) + } + if s.MultiplexId != nil && len(*s.MultiplexId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MultiplexId", 1)) + } + if s.ProgramName == nil { + invalidParams.Add(request.NewErrParamRequired("ProgramName")) + } + if s.ProgramName != nil && len(*s.ProgramName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ProgramName", 1)) + } + if s.MultiplexProgramSettings != nil { + if err := s.MultiplexProgramSettings.Validate(); err != nil { + invalidParams.AddNested("MultiplexProgramSettings", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMultiplexId sets the MultiplexId field's value. +func (s *UpdateMultiplexProgramInput) SetMultiplexId(v string) *UpdateMultiplexProgramInput { + s.MultiplexId = &v + return s +} + +// SetMultiplexProgramSettings sets the MultiplexProgramSettings field's value. +func (s *UpdateMultiplexProgramInput) SetMultiplexProgramSettings(v *MultiplexProgramSettings) *UpdateMultiplexProgramInput { + s.MultiplexProgramSettings = v + return s +} + +// SetProgramName sets the ProgramName field's value. +func (s *UpdateMultiplexProgramInput) SetProgramName(v string) *UpdateMultiplexProgramInput { + s.ProgramName = &v + return s +} + +type UpdateMultiplexProgramOutput struct { + _ struct{} `type:"structure"` + + // The multiplex program object. + MultiplexProgram *MultiplexProgram `locationName:"multiplexProgram" type:"structure"` +} + +// String returns the string representation +func (s UpdateMultiplexProgramOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateMultiplexProgramOutput) GoString() string { + return s.String() +} + +// SetMultiplexProgram sets the MultiplexProgram field's value. +func (s *UpdateMultiplexProgramOutput) SetMultiplexProgram(v *MultiplexProgram) *UpdateMultiplexProgramOutput { + s.MultiplexProgram = v + return s +} + type UpdateReservationInput struct { _ struct{} `type:"structure"` @@ -18198,6 +22352,15 @@ const ( AudioNormalizationAlgorithmControlCorrectAudio = "CORRECT_AUDIO" ) +// Audio Only Hls Segment Type +const ( + // AudioOnlyHlsSegmentTypeAac is a AudioOnlyHlsSegmentType enum value + AudioOnlyHlsSegmentTypeAac = "AAC" + + // AudioOnlyHlsSegmentTypeFmp4 is a AudioOnlyHlsSegmentType enum value + AudioOnlyHlsSegmentTypeFmp4 = "FMP4" +) + // Audio Only Hls Track Type const ( // AudioOnlyHlsTrackTypeAlternateAudioAutoSelect is a AudioOnlyHlsTrackType enum value @@ -18744,6 +22907,15 @@ const ( FollowPointStart = "START" ) +// Frame Capture Interval Unit +const ( + // FrameCaptureIntervalUnitMilliseconds is a FrameCaptureIntervalUnit enum value + FrameCaptureIntervalUnitMilliseconds = "MILLISECONDS" + + // FrameCaptureIntervalUnitSeconds is a FrameCaptureIntervalUnit enum value + FrameCaptureIntervalUnitSeconds = "SECONDS" +) + // Global Configuration Input End Action const ( // GlobalConfigurationInputEndActionNone is a GlobalConfigurationInputEndAction enum value @@ -19157,6 +23329,9 @@ const ( // H265RateControlModeCbr is a H265RateControlMode enum value H265RateControlModeCbr = "CBR" + // H265RateControlModeMultiplex is a H265RateControlMode enum value + H265RateControlModeMultiplex = "MULTIPLEX" + // H265RateControlModeQvbr is a H265RateControlMode enum value H265RateControlModeQvbr = "QVBR" ) @@ -19263,6 +23438,24 @@ const ( HlsEncryptionTypeSampleAes = "SAMPLE_AES" ) +// Hls H265 Packaging Type +const ( + // HlsH265PackagingTypeHev1 is a HlsH265PackagingType enum value + HlsH265PackagingTypeHev1 = "HEV1" + + // HlsH265PackagingTypeHvc1 is a HlsH265PackagingType enum value + HlsH265PackagingTypeHvc1 = "HVC1" +) + +// State of HLS ID3 Segment Tagging +const ( + // HlsId3SegmentTaggingStateDisabled is a HlsId3SegmentTaggingState enum value + HlsId3SegmentTaggingStateDisabled = "DISABLED" + + // HlsId3SegmentTaggingStateEnabled is a HlsId3SegmentTaggingState enum value + HlsId3SegmentTaggingStateEnabled = "ENABLED" +) + // Hls Iv In Manifest const ( // HlsIvInManifestExclude is a HlsIvInManifest enum value @@ -19752,6 +23945,15 @@ const ( M2tsKlvPassthrough = "PASSTHROUGH" ) +// M2ts Nielsen Id3 Behavior +const ( + // M2tsNielsenId3BehaviorNoPassthrough is a M2tsNielsenId3Behavior enum value + M2tsNielsenId3BehaviorNoPassthrough = "NO_PASSTHROUGH" + + // M2tsNielsenId3BehaviorPassthrough is a M2tsNielsenId3Behavior enum value + M2tsNielsenId3BehaviorPassthrough = "PASSTHROUGH" +) + // M2ts Pcr Control const ( // M2tsPcrControlConfiguredPcrPeriod is a M2tsPcrControl enum value @@ -19818,6 +24020,15 @@ const ( M2tsTimedMetadataBehaviorPassthrough = "PASSTHROUGH" ) +// M3u8 Nielsen Id3 Behavior +const ( + // M3u8NielsenId3BehaviorNoPassthrough is a M3u8NielsenId3Behavior enum value + M3u8NielsenId3BehaviorNoPassthrough = "NO_PASSTHROUGH" + + // M3u8NielsenId3BehaviorPassthrough is a M3u8NielsenId3Behavior enum value + M3u8NielsenId3BehaviorPassthrough = "PASSTHROUGH" +) + // M3u8 Pcr Control const ( // M3u8PcrControlConfiguredPcrPeriod is a M3u8PcrControl enum value @@ -19863,6 +24074,36 @@ const ( MsSmoothH265PackagingTypeHvc1 = "HVC1" ) +// The current state of the multiplex. +const ( + // MultiplexStateCreating is a MultiplexState enum value + MultiplexStateCreating = "CREATING" + + // MultiplexStateCreateFailed is a MultiplexState enum value + MultiplexStateCreateFailed = "CREATE_FAILED" + + // MultiplexStateIdle is a MultiplexState enum value + MultiplexStateIdle = "IDLE" + + // MultiplexStateStarting is a MultiplexState enum value + MultiplexStateStarting = "STARTING" + + // MultiplexStateRunning is a MultiplexState enum value + MultiplexStateRunning = "RUNNING" + + // MultiplexStateRecovering is a MultiplexState enum value + MultiplexStateRecovering = "RECOVERING" + + // MultiplexStateStopping is a MultiplexState enum value + MultiplexStateStopping = "STOPPING" + + // MultiplexStateDeleting is a MultiplexState enum value + MultiplexStateDeleting = "DELETING" + + // MultiplexStateDeleted is a MultiplexState enum value + MultiplexStateDeleted = "DELETED" +) + // Network Input Server Validation const ( // NetworkInputServerValidationCheckCryptographyAndValidateName is a NetworkInputServerValidation enum value @@ -19872,6 +24113,15 @@ const ( NetworkInputServerValidationCheckCryptographyOnly = "CHECK_CRYPTOGRAPHY_ONLY" ) +// State of Nielsen PCM to ID3 tagging +const ( + // NielsenPcmToId3TaggingStateDisabled is a NielsenPcmToId3TaggingState enum value + NielsenPcmToId3TaggingStateDisabled = "DISABLED" + + // NielsenPcmToId3TaggingStateEnabled is a NielsenPcmToId3TaggingState enum value + NielsenPcmToId3TaggingStateEnabled = "ENABLED" +) + // Units for duration, e.g. 'MONTHS' const ( // OfferingDurationUnitsMonths is a OfferingDurationUnits enum value @@ -19930,7 +24180,7 @@ const ( ) // Resolution based on lines of vertical resolution; SD is less than 720 lines, -// HD is 720 to 1080 lines, UHD is greater than 1080 lines +// HD is 720 to 1080 lines, FHD is 1080 lines, UHD is greater than 1080 lines const ( // ReservationResolutionSd is a ReservationResolution enum value ReservationResolutionSd = "SD" @@ -19938,11 +24188,14 @@ const ( // ReservationResolutionHd is a ReservationResolution enum value ReservationResolutionHd = "HD" + // ReservationResolutionFhd is a ReservationResolution enum value + ReservationResolutionFhd = "FHD" + // ReservationResolutionUhd is a ReservationResolution enum value ReservationResolutionUhd = "UHD" ) -// Resource type, 'INPUT', 'OUTPUT', or 'CHANNEL' +// Resource type, 'INPUT', 'OUTPUT', 'MULTIPLEX', or 'CHANNEL' const ( // ReservationResourceTypeInput is a ReservationResourceType enum value ReservationResourceTypeInput = "INPUT" @@ -19950,6 +24203,9 @@ const ( // ReservationResourceTypeOutput is a ReservationResourceType enum value ReservationResourceTypeOutput = "OUTPUT" + // ReservationResourceTypeMultiplex is a ReservationResourceType enum value + ReservationResourceTypeMultiplex = "MULTIPLEX" + // ReservationResourceTypeChannel is a ReservationResourceType enum value ReservationResourceTypeChannel = "CHANNEL" ) diff --git a/vendor/github.com/aws/aws-sdk-go/service/medialive/errors.go b/vendor/github.com/aws/aws-sdk-go/service/medialive/errors.go index 247fb52c70c..ecd77c4fac2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/medialive/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/medialive/errors.go @@ -2,6 +2,10 @@ package medialive +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadGatewayException for service response error code @@ -40,3 +44,15 @@ const ( // "UnprocessableEntityException". ErrCodeUnprocessableEntityException = "UnprocessableEntityException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadGatewayException": newErrorBadGatewayException, + "BadRequestException": newErrorBadRequestException, + "ConflictException": newErrorConflictException, + "ForbiddenException": newErrorForbiddenException, + "GatewayTimeoutException": newErrorGatewayTimeoutException, + "InternalServerErrorException": newErrorInternalServerErrorException, + "NotFoundException": newErrorNotFoundException, + "TooManyRequestsException": newErrorTooManyRequestsException, + "UnprocessableEntityException": newErrorUnprocessableEntityException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/medialive/service.go b/vendor/github.com/aws/aws-sdk-go/service/medialive/service.go index 621855b02ad..56eec0de58a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/medialive/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/medialive/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "medialive" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "MediaLive" // ServiceID is a unique identifer of a specific service. + ServiceID = "MediaLive" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the MediaLive client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a MediaLive client from just a session. // svc := medialive.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *MediaLive { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "medialive" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *MediaLive { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *MediaLive { svc := &MediaLive{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-10-14", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/medialive/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/medialive/waiters.go index 63f7e0e6621..36fb19d08c9 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/medialive/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/medialive/waiters.go @@ -237,3 +237,232 @@ func (c *MediaLive) WaitUntilChannelStoppedWithContext(ctx aws.Context, input *D return w.WaitWithContext(ctx) } + +// WaitUntilMultiplexCreated uses the MediaLive API operation +// DescribeMultiplex to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *MediaLive) WaitUntilMultiplexCreated(input *DescribeMultiplexInput) error { + return c.WaitUntilMultiplexCreatedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilMultiplexCreatedWithContext is an extended version of WaitUntilMultiplexCreated. +// 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 *MediaLive) WaitUntilMultiplexCreatedWithContext(ctx aws.Context, input *DescribeMultiplexInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilMultiplexCreated", + MaxAttempts: 5, + Delay: request.ConstantWaiterDelay(3 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "State", + Expected: "IDLE", + }, + { + State: request.RetryWaiterState, + Matcher: request.PathWaiterMatch, Argument: "State", + Expected: "CREATING", + }, + { + State: request.RetryWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 500, + }, + { + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "State", + Expected: "CREATE_FAILED", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeMultiplexInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeMultiplexRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + +// WaitUntilMultiplexDeleted uses the MediaLive API operation +// DescribeMultiplex to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *MediaLive) WaitUntilMultiplexDeleted(input *DescribeMultiplexInput) error { + return c.WaitUntilMultiplexDeletedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilMultiplexDeletedWithContext is an extended version of WaitUntilMultiplexDeleted. +// 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 *MediaLive) WaitUntilMultiplexDeletedWithContext(ctx aws.Context, input *DescribeMultiplexInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilMultiplexDeleted", + MaxAttempts: 20, + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "State", + Expected: "DELETED", + }, + { + State: request.RetryWaiterState, + Matcher: request.PathWaiterMatch, Argument: "State", + Expected: "DELETING", + }, + { + State: request.RetryWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 500, + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeMultiplexInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeMultiplexRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + +// WaitUntilMultiplexRunning uses the MediaLive API operation +// DescribeMultiplex to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *MediaLive) WaitUntilMultiplexRunning(input *DescribeMultiplexInput) error { + return c.WaitUntilMultiplexRunningWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilMultiplexRunningWithContext is an extended version of WaitUntilMultiplexRunning. +// 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 *MediaLive) WaitUntilMultiplexRunningWithContext(ctx aws.Context, input *DescribeMultiplexInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilMultiplexRunning", + MaxAttempts: 120, + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "State", + Expected: "RUNNING", + }, + { + State: request.RetryWaiterState, + Matcher: request.PathWaiterMatch, Argument: "State", + Expected: "STARTING", + }, + { + State: request.RetryWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 500, + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeMultiplexInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeMultiplexRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + +// WaitUntilMultiplexStopped uses the MediaLive API operation +// DescribeMultiplex to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *MediaLive) WaitUntilMultiplexStopped(input *DescribeMultiplexInput) error { + return c.WaitUntilMultiplexStoppedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilMultiplexStoppedWithContext is an extended version of WaitUntilMultiplexStopped. +// 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 *MediaLive) WaitUntilMultiplexStoppedWithContext(ctx aws.Context, input *DescribeMultiplexInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilMultiplexStopped", + MaxAttempts: 28, + Delay: request.ConstantWaiterDelay(5 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "State", + Expected: "IDLE", + }, + { + State: request.RetryWaiterState, + Matcher: request.PathWaiterMatch, Argument: "State", + Expected: "STOPPING", + }, + { + State: request.RetryWaiterState, + Matcher: request.StatusWaiterMatch, + Expected: 500, + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeMultiplexInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeMultiplexRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/mediapackage/api.go b/vendor/github.com/aws/aws-sdk-go/service/mediapackage/api.go index b5e271fab16..2f468581307 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mediapackage/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mediapackage/api.go @@ -65,18 +65,18 @@ func (c *MediaPackage) CreateChannelRequest(input *CreateChannelInput) (req *req // See the AWS API reference guide for AWS Elemental MediaPackage's // API operation CreateChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// Returned Error Types: +// * UnprocessableEntityException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/CreateChannel func (c *MediaPackage) CreateChannel(input *CreateChannelInput) (*CreateChannelOutput, error) { @@ -100,6 +100,94 @@ func (c *MediaPackage) CreateChannelWithContext(ctx aws.Context, input *CreateCh return out, req.Send() } +const opCreateHarvestJob = "CreateHarvestJob" + +// CreateHarvestJobRequest generates a "aws/request.Request" representing the +// client's request for the CreateHarvestJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateHarvestJob for more information on using the CreateHarvestJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateHarvestJobRequest method. +// req, resp := client.CreateHarvestJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/CreateHarvestJob +func (c *MediaPackage) CreateHarvestJobRequest(input *CreateHarvestJobInput) (req *request.Request, output *CreateHarvestJobOutput) { + op := &request.Operation{ + Name: opCreateHarvestJob, + HTTPMethod: "POST", + HTTPPath: "/harvest_jobs", + } + + if input == nil { + input = &CreateHarvestJobInput{} + } + + output = &CreateHarvestJobOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateHarvestJob API operation for AWS Elemental MediaPackage. +// +// Creates a new HarvestJob 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 AWS Elemental MediaPackage's +// API operation CreateHarvestJob for usage and error information. +// +// Returned Error Types: +// * UnprocessableEntityException +// +// * InternalServerErrorException +// +// * ForbiddenException +// +// * NotFoundException +// +// * ServiceUnavailableException +// +// * TooManyRequestsException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/CreateHarvestJob +func (c *MediaPackage) CreateHarvestJob(input *CreateHarvestJobInput) (*CreateHarvestJobOutput, error) { + req, out := c.CreateHarvestJobRequest(input) + return out, req.Send() +} + +// CreateHarvestJobWithContext is the same as CreateHarvestJob with the addition of +// the ability to pass a context and additional request options. +// +// See CreateHarvestJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MediaPackage) CreateHarvestJobWithContext(ctx aws.Context, input *CreateHarvestJobInput, opts ...request.Option) (*CreateHarvestJobOutput, error) { + req, out := c.CreateHarvestJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateOriginEndpoint = "CreateOriginEndpoint" // CreateOriginEndpointRequest generates a "aws/request.Request" representing the @@ -153,18 +241,18 @@ func (c *MediaPackage) CreateOriginEndpointRequest(input *CreateOriginEndpointIn // See the AWS API reference guide for AWS Elemental MediaPackage's // API operation CreateOriginEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// Returned Error Types: +// * UnprocessableEntityException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/CreateOriginEndpoint func (c *MediaPackage) CreateOriginEndpoint(input *CreateOriginEndpointInput) (*CreateOriginEndpointOutput, error) { @@ -242,18 +330,18 @@ func (c *MediaPackage) DeleteChannelRequest(input *DeleteChannelInput) (req *req // See the AWS API reference guide for AWS Elemental MediaPackage's // API operation DeleteChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// Returned Error Types: +// * UnprocessableEntityException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/DeleteChannel func (c *MediaPackage) DeleteChannel(input *DeleteChannelInput) (*DeleteChannelOutput, error) { @@ -331,18 +419,18 @@ func (c *MediaPackage) DeleteOriginEndpointRequest(input *DeleteOriginEndpointIn // See the AWS API reference guide for AWS Elemental MediaPackage's // API operation DeleteOriginEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// Returned Error Types: +// * UnprocessableEntityException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/DeleteOriginEndpoint func (c *MediaPackage) DeleteOriginEndpoint(input *DeleteOriginEndpointInput) (*DeleteOriginEndpointOutput, error) { @@ -419,18 +507,18 @@ func (c *MediaPackage) DescribeChannelRequest(input *DescribeChannelInput) (req // See the AWS API reference guide for AWS Elemental MediaPackage's // API operation DescribeChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// Returned Error Types: +// * UnprocessableEntityException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/DescribeChannel func (c *MediaPackage) DescribeChannel(input *DescribeChannelInput) (*DescribeChannelOutput, error) { @@ -454,6 +542,94 @@ func (c *MediaPackage) DescribeChannelWithContext(ctx aws.Context, input *Descri return out, req.Send() } +const opDescribeHarvestJob = "DescribeHarvestJob" + +// DescribeHarvestJobRequest generates a "aws/request.Request" representing the +// client's request for the DescribeHarvestJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeHarvestJob for more information on using the DescribeHarvestJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeHarvestJobRequest method. +// req, resp := client.DescribeHarvestJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/DescribeHarvestJob +func (c *MediaPackage) DescribeHarvestJobRequest(input *DescribeHarvestJobInput) (req *request.Request, output *DescribeHarvestJobOutput) { + op := &request.Operation{ + Name: opDescribeHarvestJob, + HTTPMethod: "GET", + HTTPPath: "/harvest_jobs/{id}", + } + + if input == nil { + input = &DescribeHarvestJobInput{} + } + + output = &DescribeHarvestJobOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeHarvestJob API operation for AWS Elemental MediaPackage. +// +// Gets details about an existing HarvestJob. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Elemental MediaPackage's +// API operation DescribeHarvestJob for usage and error information. +// +// Returned Error Types: +// * UnprocessableEntityException +// +// * InternalServerErrorException +// +// * ForbiddenException +// +// * NotFoundException +// +// * ServiceUnavailableException +// +// * TooManyRequestsException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/DescribeHarvestJob +func (c *MediaPackage) DescribeHarvestJob(input *DescribeHarvestJobInput) (*DescribeHarvestJobOutput, error) { + req, out := c.DescribeHarvestJobRequest(input) + return out, req.Send() +} + +// DescribeHarvestJobWithContext is the same as DescribeHarvestJob with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeHarvestJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MediaPackage) DescribeHarvestJobWithContext(ctx aws.Context, input *DescribeHarvestJobInput, opts ...request.Option) (*DescribeHarvestJobOutput, error) { + req, out := c.DescribeHarvestJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeOriginEndpoint = "DescribeOriginEndpoint" // DescribeOriginEndpointRequest generates a "aws/request.Request" representing the @@ -507,18 +683,18 @@ func (c *MediaPackage) DescribeOriginEndpointRequest(input *DescribeOriginEndpoi // See the AWS API reference guide for AWS Elemental MediaPackage's // API operation DescribeOriginEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// Returned Error Types: +// * UnprocessableEntityException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/DescribeOriginEndpoint func (c *MediaPackage) DescribeOriginEndpoint(input *DescribeOriginEndpointInput) (*DescribeOriginEndpointOutput, error) { @@ -601,18 +777,18 @@ func (c *MediaPackage) ListChannelsRequest(input *ListChannelsInput) (req *reque // See the AWS API reference guide for AWS Elemental MediaPackage's // API operation ListChannels for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// Returned Error Types: +// * UnprocessableEntityException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/ListChannels func (c *MediaPackage) ListChannels(input *ListChannelsInput) (*ListChannelsOutput, error) { @@ -679,10 +855,158 @@ func (c *MediaPackage) ListChannelsPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListChannelsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListChannelsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListHarvestJobs = "ListHarvestJobs" + +// ListHarvestJobsRequest generates a "aws/request.Request" representing the +// client's request for the ListHarvestJobs operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListHarvestJobs for more information on using the ListHarvestJobs +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListHarvestJobsRequest method. +// req, resp := client.ListHarvestJobsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/ListHarvestJobs +func (c *MediaPackage) ListHarvestJobsRequest(input *ListHarvestJobsInput) (req *request.Request, output *ListHarvestJobsOutput) { + op := &request.Operation{ + Name: opListHarvestJobs, + HTTPMethod: "GET", + HTTPPath: "/harvest_jobs", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListHarvestJobsInput{} + } + + output = &ListHarvestJobsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListHarvestJobs API operation for AWS Elemental MediaPackage. +// +// Returns a collection of HarvestJob 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 AWS Elemental MediaPackage's +// API operation ListHarvestJobs for usage and error information. +// +// Returned Error Types: +// * UnprocessableEntityException +// +// * InternalServerErrorException +// +// * ForbiddenException +// +// * NotFoundException +// +// * ServiceUnavailableException +// +// * TooManyRequestsException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/ListHarvestJobs +func (c *MediaPackage) ListHarvestJobs(input *ListHarvestJobsInput) (*ListHarvestJobsOutput, error) { + req, out := c.ListHarvestJobsRequest(input) + return out, req.Send() +} + +// ListHarvestJobsWithContext is the same as ListHarvestJobs with the addition of +// the ability to pass a context and additional request options. +// +// See ListHarvestJobs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *MediaPackage) ListHarvestJobsWithContext(ctx aws.Context, input *ListHarvestJobsInput, opts ...request.Option) (*ListHarvestJobsOutput, error) { + req, out := c.ListHarvestJobsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListHarvestJobsPages iterates over the pages of a ListHarvestJobs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListHarvestJobs 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 ListHarvestJobs operation. +// pageNum := 0 +// err := client.ListHarvestJobsPages(params, +// func(page *mediapackage.ListHarvestJobsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *MediaPackage) ListHarvestJobsPages(input *ListHarvestJobsInput, fn func(*ListHarvestJobsOutput, bool) bool) error { + return c.ListHarvestJobsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListHarvestJobsPagesWithContext same as ListHarvestJobsPages 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 *MediaPackage) ListHarvestJobsPagesWithContext(ctx aws.Context, input *ListHarvestJobsInput, fn func(*ListHarvestJobsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListHarvestJobsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListHarvestJobsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListHarvestJobsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -745,18 +1069,18 @@ func (c *MediaPackage) ListOriginEndpointsRequest(input *ListOriginEndpointsInpu // See the AWS API reference guide for AWS Elemental MediaPackage's // API operation ListOriginEndpoints for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// Returned Error Types: +// * UnprocessableEntityException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/ListOriginEndpoints func (c *MediaPackage) ListOriginEndpoints(input *ListOriginEndpointsInput) (*ListOriginEndpointsOutput, error) { @@ -823,10 +1147,12 @@ func (c *MediaPackage) ListOriginEndpointsPagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOriginEndpointsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListOriginEndpointsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -961,18 +1287,18 @@ func (c *MediaPackage) RotateChannelCredentialsRequest(input *RotateChannelCrede // See the AWS API reference guide for AWS Elemental MediaPackage's // API operation RotateChannelCredentials for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// Returned Error Types: +// * UnprocessableEntityException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/RotateChannelCredentials // @@ -1054,18 +1380,18 @@ func (c *MediaPackage) RotateIngestEndpointCredentialsRequest(input *RotateInges // See the AWS API reference guide for AWS Elemental MediaPackage's // API operation RotateIngestEndpointCredentials for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// Returned Error Types: +// * UnprocessableEntityException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/RotateIngestEndpointCredentials func (c *MediaPackage) RotateIngestEndpointCredentials(input *RotateIngestEndpointCredentialsInput) (*RotateIngestEndpointCredentialsOutput, error) { @@ -1288,18 +1614,18 @@ func (c *MediaPackage) UpdateChannelRequest(input *UpdateChannelInput) (req *req // See the AWS API reference guide for AWS Elemental MediaPackage's // API operation UpdateChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// Returned Error Types: +// * UnprocessableEntityException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/UpdateChannel func (c *MediaPackage) UpdateChannel(input *UpdateChannelInput) (*UpdateChannelOutput, error) { @@ -1376,18 +1702,18 @@ func (c *MediaPackage) UpdateOriginEndpointRequest(input *UpdateOriginEndpointIn // See the AWS API reference guide for AWS Elemental MediaPackage's // API operation UpdateOriginEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnprocessableEntityException "UnprocessableEntityException" +// Returned Error Types: +// * UnprocessableEntityException // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediapackage-2017-10-12/UpdateOriginEndpoint func (c *MediaPackage) UpdateOriginEndpoint(input *UpdateOriginEndpointInput) (*UpdateOriginEndpointOutput, error) { @@ -1411,6 +1737,62 @@ func (c *MediaPackage) UpdateOriginEndpointWithContext(ctx aws.Context, input *U return out, req.Send() } +// CDN Authorization credentials +type Authorization struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) for the secret in Secrets Manager that your + // Content Distribution Network (CDN) uses for authorization to access your + // endpoint. + // + // CdnIdentifierSecret is a required field + CdnIdentifierSecret *string `locationName:"cdnIdentifierSecret" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) for the IAM role that allows MediaPackage + // to communicate with AWS Secrets Manager. + // + // SecretsRoleArn is a required field + SecretsRoleArn *string `locationName:"secretsRoleArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s Authorization) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Authorization) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Authorization) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Authorization"} + if s.CdnIdentifierSecret == nil { + invalidParams.Add(request.NewErrParamRequired("CdnIdentifierSecret")) + } + if s.SecretsRoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("SecretsRoleArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCdnIdentifierSecret sets the CdnIdentifierSecret field's value. +func (s *Authorization) SetCdnIdentifierSecret(v string) *Authorization { + s.CdnIdentifierSecret = &v + return s +} + +// SetSecretsRoleArn sets the SecretsRoleArn field's value. +func (s *Authorization) SetSecretsRoleArn(v string) *Authorization { + s.SecretsRoleArn = &v + return s +} + // A Channel resource configuration. type Channel struct { _ struct{} `type:"structure"` @@ -1783,9 +2165,192 @@ func (s *CreateChannelOutput) SetTags(v map[string]*string) *CreateChannelOutput return s } +type CreateHarvestJobInput struct { + _ struct{} `type:"structure"` + + // EndTime is a required field + EndTime *string `locationName:"endTime" type:"string" required:"true"` + + // Id is a required field + Id *string `locationName:"id" type:"string" required:"true"` + + // OriginEndpointId is a required field + OriginEndpointId *string `locationName:"originEndpointId" type:"string" required:"true"` + + // Configuration parameters for where in an S3 bucket to place the harvested + // content + // + // S3Destination is a required field + S3Destination *S3Destination `locationName:"s3Destination" type:"structure" required:"true"` + + // StartTime is a required field + StartTime *string `locationName:"startTime" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateHarvestJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateHarvestJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateHarvestJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateHarvestJobInput"} + if s.EndTime == nil { + invalidParams.Add(request.NewErrParamRequired("EndTime")) + } + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.OriginEndpointId == nil { + invalidParams.Add(request.NewErrParamRequired("OriginEndpointId")) + } + if s.S3Destination == nil { + invalidParams.Add(request.NewErrParamRequired("S3Destination")) + } + if s.StartTime == nil { + invalidParams.Add(request.NewErrParamRequired("StartTime")) + } + if s.S3Destination != nil { + if err := s.S3Destination.Validate(); err != nil { + invalidParams.AddNested("S3Destination", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEndTime sets the EndTime field's value. +func (s *CreateHarvestJobInput) SetEndTime(v string) *CreateHarvestJobInput { + s.EndTime = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateHarvestJobInput) SetId(v string) *CreateHarvestJobInput { + s.Id = &v + return s +} + +// SetOriginEndpointId sets the OriginEndpointId field's value. +func (s *CreateHarvestJobInput) SetOriginEndpointId(v string) *CreateHarvestJobInput { + s.OriginEndpointId = &v + return s +} + +// SetS3Destination sets the S3Destination field's value. +func (s *CreateHarvestJobInput) SetS3Destination(v *S3Destination) *CreateHarvestJobInput { + s.S3Destination = v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *CreateHarvestJobInput) SetStartTime(v string) *CreateHarvestJobInput { + s.StartTime = &v + return s +} + +type CreateHarvestJobOutput struct { + _ struct{} `type:"structure"` + + Arn *string `locationName:"arn" type:"string"` + + ChannelId *string `locationName:"channelId" type:"string"` + + CreatedAt *string `locationName:"createdAt" type:"string"` + + EndTime *string `locationName:"endTime" type:"string"` + + Id *string `locationName:"id" type:"string"` + + OriginEndpointId *string `locationName:"originEndpointId" type:"string"` + + // Configuration parameters for where in an S3 bucket to place the harvested + // content + S3Destination *S3Destination `locationName:"s3Destination" type:"structure"` + + StartTime *string `locationName:"startTime" type:"string"` + + Status *string `locationName:"status" type:"string" enum:"Status"` +} + +// String returns the string representation +func (s CreateHarvestJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateHarvestJobOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateHarvestJobOutput) SetArn(v string) *CreateHarvestJobOutput { + s.Arn = &v + return s +} + +// SetChannelId sets the ChannelId field's value. +func (s *CreateHarvestJobOutput) SetChannelId(v string) *CreateHarvestJobOutput { + s.ChannelId = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *CreateHarvestJobOutput) SetCreatedAt(v string) *CreateHarvestJobOutput { + s.CreatedAt = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *CreateHarvestJobOutput) SetEndTime(v string) *CreateHarvestJobOutput { + s.EndTime = &v + return s +} + +// SetId sets the Id field's value. +func (s *CreateHarvestJobOutput) SetId(v string) *CreateHarvestJobOutput { + s.Id = &v + return s +} + +// SetOriginEndpointId sets the OriginEndpointId field's value. +func (s *CreateHarvestJobOutput) SetOriginEndpointId(v string) *CreateHarvestJobOutput { + s.OriginEndpointId = &v + return s +} + +// SetS3Destination sets the S3Destination field's value. +func (s *CreateHarvestJobOutput) SetS3Destination(v *S3Destination) *CreateHarvestJobOutput { + s.S3Destination = v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *CreateHarvestJobOutput) SetStartTime(v string) *CreateHarvestJobOutput { + s.StartTime = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CreateHarvestJobOutput) SetStatus(v string) *CreateHarvestJobOutput { + s.Status = &v + return s +} + type CreateOriginEndpointInput struct { _ struct{} `type:"structure"` + // CDN Authorization credentials + Authorization *Authorization `locationName:"authorization" type:"structure"` + // ChannelId is a required field ChannelId *string `locationName:"channelId" type:"string" required:"true"` @@ -1808,6 +2373,8 @@ type CreateOriginEndpointInput struct { // A Microsoft Smooth Streaming (MSS) packaging configuration. MssPackage *MssPackage `locationName:"mssPackage" type:"structure"` + Origination *string `locationName:"origination" type:"string" enum:"Origination"` + StartoverWindowSeconds *int64 `locationName:"startoverWindowSeconds" type:"integer"` // A collection of tags associated with a resource @@ -1837,6 +2404,11 @@ func (s *CreateOriginEndpointInput) Validate() error { if s.Id == nil { invalidParams.Add(request.NewErrParamRequired("Id")) } + if s.Authorization != nil { + if err := s.Authorization.Validate(); err != nil { + invalidParams.AddNested("Authorization", err.(request.ErrInvalidParams)) + } + } if s.CmafPackage != nil { if err := s.CmafPackage.Validate(); err != nil { invalidParams.AddNested("CmafPackage", err.(request.ErrInvalidParams)) @@ -1864,6 +2436,12 @@ func (s *CreateOriginEndpointInput) Validate() error { return nil } +// SetAuthorization sets the Authorization field's value. +func (s *CreateOriginEndpointInput) SetAuthorization(v *Authorization) *CreateOriginEndpointInput { + s.Authorization = v + return s +} + // SetChannelId sets the ChannelId field's value. func (s *CreateOriginEndpointInput) SetChannelId(v string) *CreateOriginEndpointInput { s.ChannelId = &v @@ -1912,6 +2490,12 @@ func (s *CreateOriginEndpointInput) SetMssPackage(v *MssPackage) *CreateOriginEn return s } +// SetOrigination sets the Origination field's value. +func (s *CreateOriginEndpointInput) SetOrigination(v string) *CreateOriginEndpointInput { + s.Origination = &v + return s +} + // SetStartoverWindowSeconds sets the StartoverWindowSeconds field's value. func (s *CreateOriginEndpointInput) SetStartoverWindowSeconds(v int64) *CreateOriginEndpointInput { s.StartoverWindowSeconds = &v @@ -1941,6 +2525,9 @@ type CreateOriginEndpointOutput struct { Arn *string `locationName:"arn" type:"string"` + // CDN Authorization credentials + Authorization *Authorization `locationName:"authorization" type:"structure"` + ChannelId *string `locationName:"channelId" type:"string"` // A Common Media Application Format (CMAF) packaging configuration. @@ -1961,6 +2548,8 @@ type CreateOriginEndpointOutput struct { // A Microsoft Smooth Streaming (MSS) packaging configuration. MssPackage *MssPackage `locationName:"mssPackage" type:"structure"` + Origination *string `locationName:"origination" type:"string" enum:"Origination"` + StartoverWindowSeconds *int64 `locationName:"startoverWindowSeconds" type:"integer"` // A collection of tags associated with a resource @@ -1989,6 +2578,12 @@ func (s *CreateOriginEndpointOutput) SetArn(v string) *CreateOriginEndpointOutpu return s } +// SetAuthorization sets the Authorization field's value. +func (s *CreateOriginEndpointOutput) SetAuthorization(v *Authorization) *CreateOriginEndpointOutput { + s.Authorization = v + return s +} + // SetChannelId sets the ChannelId field's value. func (s *CreateOriginEndpointOutput) SetChannelId(v string) *CreateOriginEndpointOutput { s.ChannelId = &v @@ -2037,6 +2632,12 @@ func (s *CreateOriginEndpointOutput) SetMssPackage(v *MssPackage) *CreateOriginE return s } +// SetOrigination sets the Origination field's value. +func (s *CreateOriginEndpointOutput) SetOrigination(v string) *CreateOriginEndpointOutput { + s.Origination = &v + return s +} + // SetStartoverWindowSeconds sets the StartoverWindowSeconds field's value. func (s *CreateOriginEndpointOutput) SetStartoverWindowSeconds(v int64) *CreateOriginEndpointOutput { s.StartoverWindowSeconds = &v @@ -2496,6 +3097,133 @@ func (s *DescribeChannelOutput) SetTags(v map[string]*string) *DescribeChannelOu return s } +type DescribeHarvestJobInput struct { + _ struct{} `type:"structure"` + + // Id is a required field + Id *string `location:"uri" locationName:"id" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeHarvestJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeHarvestJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeHarvestJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeHarvestJobInput"} + 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 *DescribeHarvestJobInput) SetId(v string) *DescribeHarvestJobInput { + s.Id = &v + return s +} + +type DescribeHarvestJobOutput struct { + _ struct{} `type:"structure"` + + Arn *string `locationName:"arn" type:"string"` + + ChannelId *string `locationName:"channelId" type:"string"` + + CreatedAt *string `locationName:"createdAt" type:"string"` + + EndTime *string `locationName:"endTime" type:"string"` + + Id *string `locationName:"id" type:"string"` + + OriginEndpointId *string `locationName:"originEndpointId" type:"string"` + + // Configuration parameters for where in an S3 bucket to place the harvested + // content + S3Destination *S3Destination `locationName:"s3Destination" type:"structure"` + + StartTime *string `locationName:"startTime" type:"string"` + + Status *string `locationName:"status" type:"string" enum:"Status"` +} + +// String returns the string representation +func (s DescribeHarvestJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeHarvestJobOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DescribeHarvestJobOutput) SetArn(v string) *DescribeHarvestJobOutput { + s.Arn = &v + return s +} + +// SetChannelId sets the ChannelId field's value. +func (s *DescribeHarvestJobOutput) SetChannelId(v string) *DescribeHarvestJobOutput { + s.ChannelId = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *DescribeHarvestJobOutput) SetCreatedAt(v string) *DescribeHarvestJobOutput { + s.CreatedAt = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *DescribeHarvestJobOutput) SetEndTime(v string) *DescribeHarvestJobOutput { + s.EndTime = &v + return s +} + +// SetId sets the Id field's value. +func (s *DescribeHarvestJobOutput) SetId(v string) *DescribeHarvestJobOutput { + s.Id = &v + return s +} + +// SetOriginEndpointId sets the OriginEndpointId field's value. +func (s *DescribeHarvestJobOutput) SetOriginEndpointId(v string) *DescribeHarvestJobOutput { + s.OriginEndpointId = &v + return s +} + +// SetS3Destination sets the S3Destination field's value. +func (s *DescribeHarvestJobOutput) SetS3Destination(v *S3Destination) *DescribeHarvestJobOutput { + s.S3Destination = v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *DescribeHarvestJobOutput) SetStartTime(v string) *DescribeHarvestJobOutput { + s.StartTime = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeHarvestJobOutput) SetStatus(v string) *DescribeHarvestJobOutput { + s.Status = &v + return s +} + type DescribeOriginEndpointInput struct { _ struct{} `type:"structure"` @@ -2540,6 +3268,9 @@ type DescribeOriginEndpointOutput struct { Arn *string `locationName:"arn" type:"string"` + // CDN Authorization credentials + Authorization *Authorization `locationName:"authorization" type:"structure"` + ChannelId *string `locationName:"channelId" type:"string"` // A Common Media Application Format (CMAF) packaging configuration. @@ -2560,6 +3291,8 @@ type DescribeOriginEndpointOutput struct { // A Microsoft Smooth Streaming (MSS) packaging configuration. MssPackage *MssPackage `locationName:"mssPackage" type:"structure"` + Origination *string `locationName:"origination" type:"string" enum:"Origination"` + StartoverWindowSeconds *int64 `locationName:"startoverWindowSeconds" type:"integer"` // A collection of tags associated with a resource @@ -2588,6 +3321,12 @@ func (s *DescribeOriginEndpointOutput) SetArn(v string) *DescribeOriginEndpointO return s } +// SetAuthorization sets the Authorization field's value. +func (s *DescribeOriginEndpointOutput) SetAuthorization(v *Authorization) *DescribeOriginEndpointOutput { + s.Authorization = v + return s +} + // SetChannelId sets the ChannelId field's value. func (s *DescribeOriginEndpointOutput) SetChannelId(v string) *DescribeOriginEndpointOutput { s.ChannelId = &v @@ -2636,6 +3375,12 @@ func (s *DescribeOriginEndpointOutput) SetMssPackage(v *MssPackage) *DescribeOri return s } +// SetOrigination sets the Origination field's value. +func (s *DescribeOriginEndpointOutput) SetOrigination(v string) *DescribeOriginEndpointOutput { + s.Origination = &v + return s +} + // SetStartoverWindowSeconds sets the StartoverWindowSeconds field's value. func (s *DescribeOriginEndpointOutput) SetStartoverWindowSeconds(v int64) *DescribeOriginEndpointOutput { s.StartoverWindowSeconds = &v @@ -2666,6 +3411,162 @@ func (s *DescribeOriginEndpointOutput) SetWhitelist(v []*string) *DescribeOrigin return s } +type ForbiddenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ForbiddenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ForbiddenException) GoString() string { + return s.String() +} + +func newErrorForbiddenException(v protocol.ResponseMetadata) error { + return &ForbiddenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ForbiddenException) Code() string { + return "ForbiddenException" +} + +// Message returns the exception's message. +func (s ForbiddenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ForbiddenException) OrigErr() error { + return nil +} + +func (s ForbiddenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ForbiddenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ForbiddenException) RequestID() string { + return s.respMetadata.RequestID +} + +// A HarvestJob resource configuration +type HarvestJob struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) assigned to the HarvestJob. + Arn *string `locationName:"arn" type:"string"` + + // The ID of the Channel that the HarvestJob will harvest from. + ChannelId *string `locationName:"channelId" type:"string"` + + // The time the HarvestJob was submitted + CreatedAt *string `locationName:"createdAt" type:"string"` + + // The end of the time-window which will be harvested. + EndTime *string `locationName:"endTime" type:"string"` + + // The ID of the HarvestJob. The ID must be unique within the regionand it cannot + // be changed after the HarvestJob is submitted. + Id *string `locationName:"id" type:"string"` + + // The ID of the OriginEndpoint that the HarvestJob will harvest from.This cannot + // be changed after the HarvestJob is submitted. + OriginEndpointId *string `locationName:"originEndpointId" type:"string"` + + // Configuration parameters for where in an S3 bucket to place the harvested + // content + S3Destination *S3Destination `locationName:"s3Destination" type:"structure"` + + // The start of the time-window which will be harvested. + StartTime *string `locationName:"startTime" type:"string"` + + // The current status of the HarvestJob. Consider setting up a CloudWatch Event + // to listen forHarvestJobs as they succeed or fail. In the event of failure, + // the CloudWatch Event willinclude an explanation of why the HarvestJob failed. + Status *string `locationName:"status" type:"string" enum:"Status"` +} + +// String returns the string representation +func (s HarvestJob) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HarvestJob) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *HarvestJob) SetArn(v string) *HarvestJob { + s.Arn = &v + return s +} + +// SetChannelId sets the ChannelId field's value. +func (s *HarvestJob) SetChannelId(v string) *HarvestJob { + s.ChannelId = &v + return s +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *HarvestJob) SetCreatedAt(v string) *HarvestJob { + s.CreatedAt = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *HarvestJob) SetEndTime(v string) *HarvestJob { + s.EndTime = &v + return s +} + +// SetId sets the Id field's value. +func (s *HarvestJob) SetId(v string) *HarvestJob { + s.Id = &v + return s +} + +// SetOriginEndpointId sets the OriginEndpointId field's value. +func (s *HarvestJob) SetOriginEndpointId(v string) *HarvestJob { + s.OriginEndpointId = &v + return s +} + +// SetS3Destination sets the S3Destination field's value. +func (s *HarvestJob) SetS3Destination(v *S3Destination) *HarvestJob { + s.S3Destination = v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *HarvestJob) SetStartTime(v string) *HarvestJob { + s.StartTime = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *HarvestJob) SetStatus(v string) *HarvestJob { + s.Status = &v + return s +} + // An HTTP Live Streaming (HLS) encryption configuration. type HlsEncryption struct { _ struct{} `type:"structure"` @@ -3167,59 +4068,191 @@ func (s *HlsPackage) SetUseAudioRenditionGroup(v bool) *HlsPackage { return s } -// An endpoint for ingesting source content for a Channel. -type IngestEndpoint struct { +// An endpoint for ingesting source content for a Channel. +type IngestEndpoint struct { + _ struct{} `type:"structure"` + + // The system generated unique identifier for the IngestEndpoint + Id *string `locationName:"id" type:"string"` + + // The system generated password for ingest authentication. + Password *string `locationName:"password" type:"string"` + + // The ingest URL to which the source stream should be sent. + Url *string `locationName:"url" type:"string"` + + // The system generated username for ingest authentication. + Username *string `locationName:"username" type:"string"` +} + +// String returns the string representation +func (s IngestEndpoint) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IngestEndpoint) GoString() string { + return s.String() +} + +// SetId sets the Id field's value. +func (s *IngestEndpoint) SetId(v string) *IngestEndpoint { + s.Id = &v + return s +} + +// SetPassword sets the Password field's value. +func (s *IngestEndpoint) SetPassword(v string) *IngestEndpoint { + s.Password = &v + return s +} + +// SetUrl sets the Url field's value. +func (s *IngestEndpoint) SetUrl(v string) *IngestEndpoint { + s.Url = &v + return s +} + +// SetUsername sets the Username field's value. +func (s *IngestEndpoint) SetUsername(v string) *IngestEndpoint { + s.Username = &v + return s +} + +type InternalServerErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalServerErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerErrorException) GoString() string { + return s.String() +} + +func newErrorInternalServerErrorException(v protocol.ResponseMetadata) error { + return &InternalServerErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerErrorException) Code() string { + return "InternalServerErrorException" +} + +// Message returns the exception's message. +func (s InternalServerErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerErrorException) OrigErr() error { + return nil +} + +func (s InternalServerErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +type ListChannelsInput struct { + _ struct{} `type:"structure"` + + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` +} + +// String returns the string representation +func (s ListChannelsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListChannelsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListChannelsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListChannelsInput"} + 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 *ListChannelsInput) SetMaxResults(v int64) *ListChannelsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListChannelsInput) SetNextToken(v string) *ListChannelsInput { + s.NextToken = &v + return s +} + +type ListChannelsOutput struct { _ struct{} `type:"structure"` - // The system generated unique identifier for the IngestEndpoint - Id *string `locationName:"id" type:"string"` - - // The system generated password for ingest authentication. - Password *string `locationName:"password" type:"string"` - - // The ingest URL to which the source stream should be sent. - Url *string `locationName:"url" type:"string"` + Channels []*Channel `locationName:"channels" type:"list"` - // The system generated username for ingest authentication. - Username *string `locationName:"username" type:"string"` + NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation -func (s IngestEndpoint) String() string { +func (s ListChannelsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s IngestEndpoint) GoString() string { +func (s ListChannelsOutput) GoString() string { return s.String() } -// SetId sets the Id field's value. -func (s *IngestEndpoint) SetId(v string) *IngestEndpoint { - s.Id = &v +// SetChannels sets the Channels field's value. +func (s *ListChannelsOutput) SetChannels(v []*Channel) *ListChannelsOutput { + s.Channels = v return s } -// SetPassword sets the Password field's value. -func (s *IngestEndpoint) SetPassword(v string) *IngestEndpoint { - s.Password = &v +// SetNextToken sets the NextToken field's value. +func (s *ListChannelsOutput) SetNextToken(v string) *ListChannelsOutput { + s.NextToken = &v return s } -// SetUrl sets the Url field's value. -func (s *IngestEndpoint) SetUrl(v string) *IngestEndpoint { - s.Url = &v - return s -} +type ListHarvestJobsInput struct { + _ struct{} `type:"structure"` -// SetUsername sets the Username field's value. -func (s *IngestEndpoint) SetUsername(v string) *IngestEndpoint { - s.Username = &v - return s -} + IncludeChannelId *string `location:"querystring" locationName:"includeChannelId" type:"string"` -type ListChannelsInput struct { - _ struct{} `type:"structure"` + IncludeStatus *string `location:"querystring" locationName:"includeStatus" type:"string"` MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` @@ -3227,18 +4260,18 @@ type ListChannelsInput struct { } // String returns the string representation -func (s ListChannelsInput) String() string { +func (s ListHarvestJobsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListChannelsInput) GoString() string { +func (s ListHarvestJobsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListChannelsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListChannelsInput"} +func (s *ListHarvestJobsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListHarvestJobsInput"} if s.MaxResults != nil && *s.MaxResults < 1 { invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } @@ -3249,44 +4282,56 @@ func (s *ListChannelsInput) Validate() error { return nil } +// SetIncludeChannelId sets the IncludeChannelId field's value. +func (s *ListHarvestJobsInput) SetIncludeChannelId(v string) *ListHarvestJobsInput { + s.IncludeChannelId = &v + return s +} + +// SetIncludeStatus sets the IncludeStatus field's value. +func (s *ListHarvestJobsInput) SetIncludeStatus(v string) *ListHarvestJobsInput { + s.IncludeStatus = &v + return s +} + // SetMaxResults sets the MaxResults field's value. -func (s *ListChannelsInput) SetMaxResults(v int64) *ListChannelsInput { +func (s *ListHarvestJobsInput) SetMaxResults(v int64) *ListHarvestJobsInput { s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *ListChannelsInput) SetNextToken(v string) *ListChannelsInput { +func (s *ListHarvestJobsInput) SetNextToken(v string) *ListHarvestJobsInput { s.NextToken = &v return s } -type ListChannelsOutput struct { +type ListHarvestJobsOutput struct { _ struct{} `type:"structure"` - Channels []*Channel `locationName:"channels" type:"list"` + HarvestJobs []*HarvestJob `locationName:"harvestJobs" type:"list"` NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation -func (s ListChannelsOutput) String() string { +func (s ListHarvestJobsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListChannelsOutput) GoString() string { +func (s ListHarvestJobsOutput) GoString() string { return s.String() } -// SetChannels sets the Channels field's value. -func (s *ListChannelsOutput) SetChannels(v []*Channel) *ListChannelsOutput { - s.Channels = v +// SetHarvestJobs sets the HarvestJobs field's value. +func (s *ListHarvestJobsOutput) SetHarvestJobs(v []*HarvestJob) *ListHarvestJobsOutput { + s.HarvestJobs = v return s } // SetNextToken sets the NextToken field's value. -func (s *ListChannelsOutput) SetNextToken(v string) *ListChannelsOutput { +func (s *ListHarvestJobsOutput) SetNextToken(v string) *ListHarvestJobsOutput { s.NextToken = &v return s } @@ -3544,6 +4589,61 @@ func (s *MssPackage) SetStreamSelection(v *StreamSelection) *MssPackage { return s } +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // An OriginEndpoint resource configuration. type OriginEndpoint struct { _ struct{} `type:"structure"` @@ -3551,6 +4651,9 @@ type OriginEndpoint struct { // The Amazon Resource Name (ARN) assigned to the OriginEndpoint. Arn *string `locationName:"arn" type:"string"` + // CDN Authorization credentials + Authorization *Authorization `locationName:"authorization" type:"structure"` + // The ID of the Channel the OriginEndpoint is associated with. ChannelId *string `locationName:"channelId" type:"string"` @@ -3575,6 +4678,13 @@ type OriginEndpoint struct { // A Microsoft Smooth Streaming (MSS) packaging configuration. MssPackage *MssPackage `locationName:"mssPackage" type:"structure"` + // Control whether origination of video is allowed for this OriginEndpoint. + // If set to ALLOW, the OriginEndpointmay by requested, pursuant to any other + // form of access control. If set to DENY, the OriginEndpoint may not berequested. + // This can be helpful for Live to VOD harvesting, or for temporarily disabling + // origination + Origination *string `locationName:"origination" type:"string" enum:"Origination"` + // Maximum duration (seconds) of content to retain for startover playback.If // not specified, startover playback will be disabled for the OriginEndpoint. StartoverWindowSeconds *int64 `locationName:"startoverWindowSeconds" type:"integer"` @@ -3609,6 +4719,12 @@ func (s *OriginEndpoint) SetArn(v string) *OriginEndpoint { return s } +// SetAuthorization sets the Authorization field's value. +func (s *OriginEndpoint) SetAuthorization(v *Authorization) *OriginEndpoint { + s.Authorization = v + return s +} + // SetChannelId sets the ChannelId field's value. func (s *OriginEndpoint) SetChannelId(v string) *OriginEndpoint { s.ChannelId = &v @@ -3657,6 +4773,12 @@ func (s *OriginEndpoint) SetMssPackage(v *MssPackage) *OriginEndpoint { return s } +// SetOrigination sets the Origination field's value. +func (s *OriginEndpoint) SetOrigination(v string) *OriginEndpoint { + s.Origination = &v + return s +} + // SetStartoverWindowSeconds sets the StartoverWindowSeconds field's value. func (s *OriginEndpoint) SetStartoverWindowSeconds(v int64) *OriginEndpoint { s.StartoverWindowSeconds = &v @@ -3894,6 +5016,130 @@ func (s *RotateIngestEndpointCredentialsOutput) SetTags(v map[string]*string) *R return s } +// Configuration parameters for where in an S3 bucket to place the harvested +// content +type S3Destination struct { + _ struct{} `type:"structure"` + + // The name of an S3 bucket within which harvested content will be exported + // + // BucketName is a required field + BucketName *string `locationName:"bucketName" type:"string" required:"true"` + + // The key in the specified S3 bucket where the harvested top-level manifest + // will be placed. + // + // ManifestKey is a required field + ManifestKey *string `locationName:"manifestKey" type:"string" required:"true"` + + // The IAM role used to write to the specified S3 bucket + // + // RoleArn is a required field + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s S3Destination) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s S3Destination) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *S3Destination) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "S3Destination"} + if s.BucketName == nil { + invalidParams.Add(request.NewErrParamRequired("BucketName")) + } + if s.ManifestKey == nil { + invalidParams.Add(request.NewErrParamRequired("ManifestKey")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucketName sets the BucketName field's value. +func (s *S3Destination) SetBucketName(v string) *S3Destination { + s.BucketName = &v + return s +} + +// SetManifestKey sets the ManifestKey field's value. +func (s *S3Destination) SetManifestKey(v string) *S3Destination { + s.ManifestKey = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *S3Destination) SetRoleArn(v string) *S3Destination { + s.RoleArn = &v + return s +} + +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + // A configuration for accessing an external Secure Packager and Encoder Key // Exchange (SPEKE) service that will provide encryption keys. type SpekeKeyProvider struct { @@ -4095,6 +5341,116 @@ func (s TagResourceOutput) GoString() string { return s.String() } +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + +type UnprocessableEntityException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnprocessableEntityException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnprocessableEntityException) GoString() string { + return s.String() +} + +func newErrorUnprocessableEntityException(v protocol.ResponseMetadata) error { + return &UnprocessableEntityException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnprocessableEntityException) Code() string { + return "UnprocessableEntityException" +} + +// Message returns the exception's message. +func (s UnprocessableEntityException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnprocessableEntityException) OrigErr() error { + return nil +} + +func (s UnprocessableEntityException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnprocessableEntityException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnprocessableEntityException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -4266,6 +5622,9 @@ func (s *UpdateChannelOutput) SetTags(v map[string]*string) *UpdateChannelOutput type UpdateOriginEndpointInput struct { _ struct{} `type:"structure"` + // CDN Authorization credentials + Authorization *Authorization `locationName:"authorization" type:"structure"` + // A Common Media Application Format (CMAF) packaging configuration. CmafPackage *CmafPackageCreateOrUpdateParameters `locationName:"cmafPackage" type:"structure"` @@ -4285,6 +5644,8 @@ type UpdateOriginEndpointInput struct { // A Microsoft Smooth Streaming (MSS) packaging configuration. MssPackage *MssPackage `locationName:"mssPackage" type:"structure"` + Origination *string `locationName:"origination" type:"string" enum:"Origination"` + StartoverWindowSeconds *int64 `locationName:"startoverWindowSeconds" type:"integer"` TimeDelaySeconds *int64 `locationName:"timeDelaySeconds" type:"integer"` @@ -4311,6 +5672,11 @@ func (s *UpdateOriginEndpointInput) Validate() error { if s.Id != nil && len(*s.Id) < 1 { invalidParams.Add(request.NewErrParamMinLen("Id", 1)) } + if s.Authorization != nil { + if err := s.Authorization.Validate(); err != nil { + invalidParams.AddNested("Authorization", err.(request.ErrInvalidParams)) + } + } if s.CmafPackage != nil { if err := s.CmafPackage.Validate(); err != nil { invalidParams.AddNested("CmafPackage", err.(request.ErrInvalidParams)) @@ -4338,6 +5704,12 @@ func (s *UpdateOriginEndpointInput) Validate() error { return nil } +// SetAuthorization sets the Authorization field's value. +func (s *UpdateOriginEndpointInput) SetAuthorization(v *Authorization) *UpdateOriginEndpointInput { + s.Authorization = v + return s +} + // SetCmafPackage sets the CmafPackage field's value. func (s *UpdateOriginEndpointInput) SetCmafPackage(v *CmafPackageCreateOrUpdateParameters) *UpdateOriginEndpointInput { s.CmafPackage = v @@ -4380,6 +5752,12 @@ func (s *UpdateOriginEndpointInput) SetMssPackage(v *MssPackage) *UpdateOriginEn return s } +// SetOrigination sets the Origination field's value. +func (s *UpdateOriginEndpointInput) SetOrigination(v string) *UpdateOriginEndpointInput { + s.Origination = &v + return s +} + // SetStartoverWindowSeconds sets the StartoverWindowSeconds field's value. func (s *UpdateOriginEndpointInput) SetStartoverWindowSeconds(v int64) *UpdateOriginEndpointInput { s.StartoverWindowSeconds = &v @@ -4403,6 +5781,9 @@ type UpdateOriginEndpointOutput struct { Arn *string `locationName:"arn" type:"string"` + // CDN Authorization credentials + Authorization *Authorization `locationName:"authorization" type:"structure"` + ChannelId *string `locationName:"channelId" type:"string"` // A Common Media Application Format (CMAF) packaging configuration. @@ -4423,6 +5804,8 @@ type UpdateOriginEndpointOutput struct { // A Microsoft Smooth Streaming (MSS) packaging configuration. MssPackage *MssPackage `locationName:"mssPackage" type:"structure"` + Origination *string `locationName:"origination" type:"string" enum:"Origination"` + StartoverWindowSeconds *int64 `locationName:"startoverWindowSeconds" type:"integer"` // A collection of tags associated with a resource @@ -4451,6 +5834,12 @@ func (s *UpdateOriginEndpointOutput) SetArn(v string) *UpdateOriginEndpointOutpu return s } +// SetAuthorization sets the Authorization field's value. +func (s *UpdateOriginEndpointOutput) SetAuthorization(v *Authorization) *UpdateOriginEndpointOutput { + s.Authorization = v + return s +} + // SetChannelId sets the ChannelId field's value. func (s *UpdateOriginEndpointOutput) SetChannelId(v string) *UpdateOriginEndpointOutput { s.ChannelId = &v @@ -4499,6 +5888,12 @@ func (s *UpdateOriginEndpointOutput) SetMssPackage(v *MssPackage) *UpdateOriginE return s } +// SetOrigination sets the Origination field's value. +func (s *UpdateOriginEndpointOutput) SetOrigination(v string) *UpdateOriginEndpointOutput { + s.Origination = &v + return s +} + // SetStartoverWindowSeconds sets the StartoverWindowSeconds field's value. func (s *UpdateOriginEndpointOutput) SetStartoverWindowSeconds(v int64) *UpdateOriginEndpointOutput { s.StartoverWindowSeconds = &v @@ -4580,6 +5975,14 @@ const ( ManifestLayoutCompact = "COMPACT" ) +const ( + // OriginationAllow is a Origination enum value + OriginationAllow = "ALLOW" + + // OriginationDeny is a Origination enum value + OriginationDeny = "DENY" +) + const ( // PlaylistTypeNone is a PlaylistType enum value PlaylistTypeNone = "NONE" @@ -4610,6 +6013,17 @@ const ( SegmentTemplateFormatNumberWithDuration = "NUMBER_WITH_DURATION" ) +const ( + // StatusInProgress is a Status enum value + StatusInProgress = "IN_PROGRESS" + + // StatusSucceeded is a Status enum value + StatusSucceeded = "SUCCEEDED" + + // StatusFailed is a Status enum value + StatusFailed = "FAILED" +) + const ( // StreamOrderOriginal is a StreamOrder enum value StreamOrderOriginal = "ORIGINAL" diff --git a/vendor/github.com/aws/aws-sdk-go/service/mediapackage/errors.go b/vendor/github.com/aws/aws-sdk-go/service/mediapackage/errors.go index c6ba3649e5c..ad731558cba 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mediapackage/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mediapackage/errors.go @@ -2,6 +2,10 @@ package mediapackage +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeForbiddenException for service response error code @@ -28,3 +32,12 @@ const ( // "UnprocessableEntityException". ErrCodeUnprocessableEntityException = "UnprocessableEntityException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ForbiddenException": newErrorForbiddenException, + "InternalServerErrorException": newErrorInternalServerErrorException, + "NotFoundException": newErrorNotFoundException, + "ServiceUnavailableException": newErrorServiceUnavailableException, + "TooManyRequestsException": newErrorTooManyRequestsException, + "UnprocessableEntityException": newErrorUnprocessableEntityException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/mediapackage/service.go b/vendor/github.com/aws/aws-sdk-go/service/mediapackage/service.go index e08a3e8787c..ea0ee0a921a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mediapackage/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mediapackage/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "mediapackage" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "MediaPackage" // ServiceID is a unique identifer of a specific service. + ServiceID = "MediaPackage" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the MediaPackage client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a MediaPackage client from just a session. // svc := mediapackage.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *MediaPackage { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "mediapackage" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *MediaPackage { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *MediaPackage { svc := &MediaPackage{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-10-12", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/mediastore/api.go b/vendor/github.com/aws/aws-sdk-go/service/mediastore/api.go index 75bb7975c89..daa0851e7dc 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mediastore/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mediastore/api.go @@ -67,15 +67,15 @@ func (c *MediaStore) CreateContainerRequest(input *CreateContainerInput) (req *r // See the AWS API reference guide for AWS Elemental MediaStore's // API operation CreateContainer for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerInUseException "ContainerInUseException" +// Returned Error Types: +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // A service limit has been exceeded. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/CreateContainer @@ -156,15 +156,15 @@ func (c *MediaStore) DeleteContainerRequest(input *DeleteContainerInput) (req *r // See the AWS API reference guide for AWS Elemental MediaStore's // API operation DeleteContainer for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerInUseException "ContainerInUseException" +// Returned Error Types: +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DeleteContainer @@ -243,18 +243,18 @@ func (c *MediaStore) DeleteContainerPolicyRequest(input *DeleteContainerPolicyIn // See the AWS API reference guide for AWS Elemental MediaStore's // API operation DeleteContainerPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerInUseException "ContainerInUseException" +// Returned Error Types: +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodePolicyNotFoundException "PolicyNotFoundException" +// * PolicyNotFoundException // The policy that you specified in the request does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DeleteContainerPolicy @@ -338,18 +338,18 @@ func (c *MediaStore) DeleteCorsPolicyRequest(input *DeleteCorsPolicyInput) (req // See the AWS API reference guide for AWS Elemental MediaStore's // API operation DeleteCorsPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerInUseException "ContainerInUseException" +// Returned Error Types: +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodeCorsPolicyNotFoundException "CorsPolicyNotFoundException" +// * CorsPolicyNotFoundException // The CORS policy that you specified in the request does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DeleteCorsPolicy @@ -429,18 +429,18 @@ func (c *MediaStore) DeleteLifecyclePolicyRequest(input *DeleteLifecyclePolicyIn // See the AWS API reference guide for AWS Elemental MediaStore's // API operation DeleteLifecyclePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerInUseException "ContainerInUseException" +// Returned Error Types: +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodePolicyNotFoundException "PolicyNotFoundException" +// * PolicyNotFoundException // The policy that you specified in the request does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DeleteLifecyclePolicy @@ -523,11 +523,11 @@ func (c *MediaStore) DescribeContainerRequest(input *DescribeContainerInput) (re // See the AWS API reference guide for AWS Elemental MediaStore's // API operation DescribeContainer for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// Returned Error Types: +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/DescribeContainer @@ -607,18 +607,18 @@ func (c *MediaStore) GetContainerPolicyRequest(input *GetContainerPolicyInput) ( // See the AWS API reference guide for AWS Elemental MediaStore's // API operation GetContainerPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerInUseException "ContainerInUseException" +// Returned Error Types: +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodePolicyNotFoundException "PolicyNotFoundException" +// * PolicyNotFoundException // The policy that you specified in the request does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/GetContainerPolicy @@ -701,18 +701,18 @@ func (c *MediaStore) GetCorsPolicyRequest(input *GetCorsPolicyInput) (req *reque // See the AWS API reference guide for AWS Elemental MediaStore's // API operation GetCorsPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerInUseException "ContainerInUseException" +// Returned Error Types: +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodeCorsPolicyNotFoundException "CorsPolicyNotFoundException" +// * CorsPolicyNotFoundException // The CORS policy that you specified in the request does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/GetCorsPolicy @@ -790,18 +790,18 @@ func (c *MediaStore) GetLifecyclePolicyRequest(input *GetLifecyclePolicyInput) ( // See the AWS API reference guide for AWS Elemental MediaStore's // API operation GetLifecyclePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerInUseException "ContainerInUseException" +// Returned Error Types: +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodePolicyNotFoundException "PolicyNotFoundException" +// * PolicyNotFoundException // The policy that you specified in the request does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/GetLifecyclePolicy @@ -894,8 +894,8 @@ func (c *MediaStore) ListContainersRequest(input *ListContainersInput) (req *req // See the AWS API reference guide for AWS Elemental MediaStore's // API operation ListContainers for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/ListContainers @@ -963,10 +963,12 @@ func (c *MediaStore) ListContainersPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListContainersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListContainersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1023,15 +1025,15 @@ func (c *MediaStore) ListTagsForResourceRequest(input *ListTagsForResourceInput) // See the AWS API reference guide for AWS Elemental MediaStore's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerInUseException "ContainerInUseException" +// Returned Error Types: +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/ListTagsForResource @@ -1117,15 +1119,15 @@ func (c *MediaStore) PutContainerPolicyRequest(input *PutContainerPolicyInput) ( // See the AWS API reference guide for AWS Elemental MediaStore's // API operation PutContainerPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// Returned Error Types: +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodeContainerInUseException "ContainerInUseException" +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/PutContainerPolicy @@ -1217,15 +1219,15 @@ func (c *MediaStore) PutCorsPolicyRequest(input *PutCorsPolicyInput) (req *reque // See the AWS API reference guide for AWS Elemental MediaStore's // API operation PutCorsPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// Returned Error Types: +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodeContainerInUseException "ContainerInUseException" +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/PutCorsPolicy @@ -1309,15 +1311,15 @@ func (c *MediaStore) PutLifecyclePolicyRequest(input *PutLifecyclePolicyInput) ( // See the AWS API reference guide for AWS Elemental MediaStore's // API operation PutLifecyclePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerInUseException "ContainerInUseException" +// Returned Error Types: +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/PutLifecyclePolicy @@ -1398,15 +1400,15 @@ func (c *MediaStore) StartAccessLoggingRequest(input *StartAccessLoggingInput) ( // See the AWS API reference guide for AWS Elemental MediaStore's // API operation StartAccessLogging for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerInUseException "ContainerInUseException" +// Returned Error Types: +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/StartAccessLogging @@ -1487,15 +1489,15 @@ func (c *MediaStore) StopAccessLoggingRequest(input *StopAccessLoggingInput) (re // See the AWS API reference guide for AWS Elemental MediaStore's // API operation StopAccessLogging for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerInUseException "ContainerInUseException" +// Returned Error Types: +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/StopAccessLogging @@ -1570,7 +1572,7 @@ func (c *MediaStore) TagResourceRequest(input *TagResourceInput) (req *request.R // might be "customer" and the tag value might be "companyA." You can specify // one or more tags to add to each container. You can add up to 50 tags to each // container. For more information about tagging, including naming and usage -// conventions, see Tagging Resources in MediaStore (https://aws.amazon.com/documentation/mediastore/tagging). +// conventions, see Tagging Resources in MediaStore (https://docs.aws.amazon.com/mediastore/latest/ug/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 @@ -1579,15 +1581,15 @@ func (c *MediaStore) TagResourceRequest(input *TagResourceInput) (req *request.R // See the AWS API reference guide for AWS Elemental MediaStore's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerInUseException "ContainerInUseException" +// Returned Error Types: +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/TagResource @@ -1667,15 +1669,15 @@ func (c *MediaStore) UntagResourceRequest(input *UntagResourceInput) (req *reque // See the AWS API reference guide for AWS Elemental MediaStore's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerInUseException "ContainerInUseException" +// Returned Error Types: +// * ContainerInUseException // The container that you specified in the request already exists or is being // updated. // -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// * ContainerNotFoundException // The container that you specified in the request does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-2017-09-01/UntagResource @@ -1785,6 +1787,175 @@ func (s *Container) SetStatus(v string) *Container { return s } +// The container that you specified in the request already exists or is being +// updated. +type ContainerInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s ContainerInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ContainerInUseException) GoString() string { + return s.String() +} + +func newErrorContainerInUseException(v protocol.ResponseMetadata) error { + return &ContainerInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ContainerInUseException) Code() string { + return "ContainerInUseException" +} + +// Message returns the exception's message. +func (s ContainerInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ContainerInUseException) OrigErr() error { + return nil +} + +func (s ContainerInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ContainerInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ContainerInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The container that you specified in the request does not exist. +type ContainerNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s ContainerNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ContainerNotFoundException) GoString() string { + return s.String() +} + +func newErrorContainerNotFoundException(v protocol.ResponseMetadata) error { + return &ContainerNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ContainerNotFoundException) Code() string { + return "ContainerNotFoundException" +} + +// Message returns the exception's message. +func (s ContainerNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ContainerNotFoundException) OrigErr() error { + return nil +} + +func (s ContainerNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ContainerNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ContainerNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The CORS policy that you specified in the request does not exist. +type CorsPolicyNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s CorsPolicyNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CorsPolicyNotFoundException) GoString() string { + return s.String() +} + +func newErrorCorsPolicyNotFoundException(v protocol.ResponseMetadata) error { + return &CorsPolicyNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CorsPolicyNotFoundException) Code() string { + return "CorsPolicyNotFoundException" +} + +// Message returns the exception's message. +func (s CorsPolicyNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CorsPolicyNotFoundException) OrigErr() error { + return nil +} + +func (s CorsPolicyNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CorsPolicyNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CorsPolicyNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // A rule for a CORS policy. You can add up to 100 rules to a CORS policy. If // more than one rule applies, the service uses the first applicable rule listed. type CorsRule struct { @@ -1909,7 +2080,7 @@ type CreateContainerInput struct { // and the tag value represents a specific value within that category (such // as "test," "development," or "production"). You can add up to 50 tags to // each container. For more information about tagging, including naming and - // usage conventions, see Tagging Resources in MediaStore (https://aws.amazon.com/documentation/mediastore/tagging). + // usage conventions, see Tagging Resources in MediaStore (https://docs.aws.amazon.com/mediastore/latest/ug/tagging.html). Tags []*Tag `type:"list"` } @@ -2477,6 +2648,118 @@ func (s *GetLifecyclePolicyOutput) SetLifecyclePolicy(v string) *GetLifecyclePol return s } +// The service is temporarily unavailable. +type InternalServerError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s InternalServerError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerError) GoString() string { + return s.String() +} + +func newErrorInternalServerError(v protocol.ResponseMetadata) error { + return &InternalServerError{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerError) Code() string { + return "InternalServerError" +} + +// Message returns the exception's message. +func (s InternalServerError) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerError) OrigErr() error { + return nil +} + +func (s InternalServerError) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerError) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerError) RequestID() string { + return s.respMetadata.RequestID +} + +// A service limit has been exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListContainersInput struct { _ struct{} `type:"structure"` @@ -2629,6 +2912,62 @@ func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput return s } +// The policy that you specified in the request does not exist. +type PolicyNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s PolicyNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyNotFoundException) GoString() string { + return s.String() +} + +func newErrorPolicyNotFoundException(v protocol.ResponseMetadata) error { + return &PolicyNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PolicyNotFoundException) Code() string { + return "PolicyNotFoundException" +} + +// Message returns the exception's message. +func (s PolicyNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PolicyNotFoundException) OrigErr() error { + return nil +} + +func (s PolicyNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PolicyNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PolicyNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + type PutContainerPolicyInput struct { _ struct{} `type:"structure"` @@ -2973,13 +3312,15 @@ func (s StopAccessLoggingOutput) GoString() string { // a specific value within that category (such as "test," "development," or // "production"). You can add up to 50 tags to each container. For more information // about tagging, including naming and usage conventions, see Tagging Resources -// in MediaStore (https://aws.amazon.com/documentation/mediastore/tagging). +// in MediaStore (https://docs.aws.amazon.com/mediastore/latest/ug/tagging.html). type Tag struct { _ struct{} `type:"structure"` // Part of the key:value pair that defines a tag. You can use a tag key to describe // a category of information, such as "customer." Tag keys are case-sensitive. - Key *string `min:"1" type:"string"` + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` // Part of the key:value pair that defines a tag. You can use a tag value to // describe a specific value within a category, such as "companyA" or "companyB." @@ -3000,6 +3341,9 @@ func (s Tag) GoString() 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)) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/mediastore/errors.go b/vendor/github.com/aws/aws-sdk-go/service/mediastore/errors.go index f64caedd3b6..ca3b3a099dd 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mediastore/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mediastore/errors.go @@ -2,6 +2,10 @@ package mediastore +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeContainerInUseException for service response error code @@ -41,3 +45,12 @@ const ( // The policy that you specified in the request does not exist. ErrCodePolicyNotFoundException = "PolicyNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ContainerInUseException": newErrorContainerInUseException, + "ContainerNotFoundException": newErrorContainerNotFoundException, + "CorsPolicyNotFoundException": newErrorCorsPolicyNotFoundException, + "InternalServerError": newErrorInternalServerError, + "LimitExceededException": newErrorLimitExceededException, + "PolicyNotFoundException": newErrorPolicyNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/mediastore/service.go b/vendor/github.com/aws/aws-sdk-go/service/mediastore/service.go index 492b3bf04c3..98d1be28cba 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mediastore/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mediastore/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "mediastore" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "MediaStore" // ServiceID is a unique identifer of a specific service. + ServiceID = "MediaStore" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the MediaStore client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a MediaStore client from just a session. // svc := mediastore.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *MediaStore { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "mediastore" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *MediaStore { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *MediaStore { svc := &MediaStore{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-09-01", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/mediastoredata/api.go b/vendor/github.com/aws/aws-sdk-go/service/mediastoredata/api.go index 3f4784369c9..6fd56c6dc09 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mediastoredata/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mediastoredata/api.go @@ -3,6 +3,7 @@ package mediastoredata import ( + "fmt" "io" "time" @@ -68,14 +69,14 @@ func (c *MediaStoreData) DeleteObjectRequest(input *DeleteObjectInput) (req *req // See the AWS API reference guide for AWS Elemental MediaStore Data Plane's // API operation DeleteObject for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// Returned Error Types: +// * ContainerNotFoundException // The specified container was not found for the specified account. // -// * ErrCodeObjectNotFoundException "ObjectNotFoundException" +// * ObjectNotFoundException // Could not perform an operation on an object that does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-data-2017-09-01/DeleteObject @@ -153,14 +154,14 @@ func (c *MediaStoreData) DescribeObjectRequest(input *DescribeObjectInput) (req // See the AWS API reference guide for AWS Elemental MediaStore Data Plane's // API operation DescribeObject for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// Returned Error Types: +// * ContainerNotFoundException // The specified container was not found for the specified account. // -// * ErrCodeObjectNotFoundException "ObjectNotFoundException" +// * ObjectNotFoundException // Could not perform an operation on an object that does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-data-2017-09-01/DescribeObject @@ -240,17 +241,17 @@ func (c *MediaStoreData) GetObjectRequest(input *GetObjectInput) (req *request.R // See the AWS API reference guide for AWS Elemental MediaStore Data Plane's // API operation GetObject for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// Returned Error Types: +// * ContainerNotFoundException // The specified container was not found for the specified account. // -// * ErrCodeObjectNotFoundException "ObjectNotFoundException" +// * ObjectNotFoundException // Could not perform an operation on an object that does not exist. // -// * ErrCodeRequestedRangeNotSatisfiableException "RequestedRangeNotSatisfiableException" +// * RequestedRangeNotSatisfiableException // The requested content range is not valid. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-data-2017-09-01/GetObject @@ -335,11 +336,11 @@ func (c *MediaStoreData) ListItemsRequest(input *ListItemsInput) (req *request.R // See the AWS API reference guide for AWS Elemental MediaStore Data Plane's // API operation ListItems for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// Returned Error Types: +// * ContainerNotFoundException // The specified container was not found for the specified account. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-data-2017-09-01/ListItems @@ -407,10 +408,12 @@ func (c *MediaStoreData) ListItemsPagesWithContext(ctx aws.Context, input *ListI }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListItemsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListItemsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -471,11 +474,11 @@ func (c *MediaStoreData) PutObjectRequest(input *PutObjectInput) (req *request.R // See the AWS API reference guide for AWS Elemental MediaStore Data Plane's // API operation PutObject for usage and error information. // -// Returned Error Codes: -// * ErrCodeContainerNotFoundException "ContainerNotFoundException" +// Returned Error Types: +// * ContainerNotFoundException // The specified container was not found for the specified account. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // The service is temporarily unavailable. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mediastore-data-2017-09-01/PutObject @@ -500,6 +503,62 @@ func (c *MediaStoreData) PutObjectWithContext(ctx aws.Context, input *PutObjectI return out, req.Send() } +// The specified container was not found for the specified account. +type ContainerNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s ContainerNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ContainerNotFoundException) GoString() string { + return s.String() +} + +func newErrorContainerNotFoundException(v protocol.ResponseMetadata) error { + return &ContainerNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ContainerNotFoundException) Code() string { + return "ContainerNotFoundException" +} + +// Message returns the exception's message. +func (s ContainerNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ContainerNotFoundException) OrigErr() error { + return nil +} + +func (s ContainerNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ContainerNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ContainerNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + type DeleteObjectInput struct { _ struct{} `type:"structure"` @@ -831,6 +890,62 @@ func (s *GetObjectOutput) SetStatusCode(v int64) *GetObjectOutput { return s } +// The service is temporarily unavailable. +type InternalServerError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s InternalServerError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerError) GoString() string { + return s.String() +} + +func newErrorInternalServerError(v protocol.ResponseMetadata) error { + return &InternalServerError{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerError) Code() string { + return "InternalServerError" +} + +// Message returns the exception's message. +func (s InternalServerError) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerError) OrigErr() error { + return nil +} + +func (s InternalServerError) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerError) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerError) RequestID() string { + return s.respMetadata.RequestID +} + // A metadata entry for a folder or object. type Item struct { _ struct{} `type:"structure"` @@ -1005,6 +1120,62 @@ func (s *ListItemsOutput) SetNextToken(v string) *ListItemsOutput { return s } +// Could not perform an operation on an object that does not exist. +type ObjectNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s ObjectNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ObjectNotFoundException) GoString() string { + return s.String() +} + +func newErrorObjectNotFoundException(v protocol.ResponseMetadata) error { + return &ObjectNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ObjectNotFoundException) Code() string { + return "ObjectNotFoundException" +} + +// Message returns the exception's message. +func (s ObjectNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ObjectNotFoundException) OrigErr() error { + return nil +} + +func (s ObjectNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ObjectNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ObjectNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + type PutObjectInput struct { _ struct{} `type:"structure" payload:"Body"` @@ -1183,6 +1354,62 @@ func (s *PutObjectOutput) SetStorageClass(v string) *PutObjectOutput { return s } +// The requested content range is not valid. +type RequestedRangeNotSatisfiableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s RequestedRangeNotSatisfiableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RequestedRangeNotSatisfiableException) GoString() string { + return s.String() +} + +func newErrorRequestedRangeNotSatisfiableException(v protocol.ResponseMetadata) error { + return &RequestedRangeNotSatisfiableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RequestedRangeNotSatisfiableException) Code() string { + return "RequestedRangeNotSatisfiableException" +} + +// Message returns the exception's message. +func (s RequestedRangeNotSatisfiableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RequestedRangeNotSatisfiableException) OrigErr() error { + return nil +} + +func (s RequestedRangeNotSatisfiableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RequestedRangeNotSatisfiableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RequestedRangeNotSatisfiableException) RequestID() string { + return s.respMetadata.RequestID +} + const ( // ItemTypeObject is a ItemType enum value ItemTypeObject = "OBJECT" diff --git a/vendor/github.com/aws/aws-sdk-go/service/mediastoredata/errors.go b/vendor/github.com/aws/aws-sdk-go/service/mediastoredata/errors.go index 95f0acdbd0f..05b5c57b1f4 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mediastoredata/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mediastoredata/errors.go @@ -2,6 +2,10 @@ package mediastoredata +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeContainerNotFoundException for service response error code @@ -28,3 +32,10 @@ const ( // The requested content range is not valid. ErrCodeRequestedRangeNotSatisfiableException = "RequestedRangeNotSatisfiableException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ContainerNotFoundException": newErrorContainerNotFoundException, + "InternalServerError": newErrorInternalServerError, + "ObjectNotFoundException": newErrorObjectNotFoundException, + "RequestedRangeNotSatisfiableException": newErrorRequestedRangeNotSatisfiableException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/mediastoredata/service.go b/vendor/github.com/aws/aws-sdk-go/service/mediastoredata/service.go index 4203140146d..48d7a9cbc34 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mediastoredata/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mediastoredata/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "data.mediastore" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "MediaStore Data" // ServiceID is a unique identifer of a specific service. + ServiceID = "MediaStore Data" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the MediaStoreData client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a MediaStoreData client from just a session. // svc := mediastoredata.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *MediaStoreData { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "mediastore" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *MediaStoreData { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *MediaStoreData { svc := &MediaStoreData{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-09-01", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/mq/api.go b/vendor/github.com/aws/aws-sdk-go/service/mq/api.go index 0b3086c2acb..9aabceea076 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mq/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mq/api.go @@ -3,6 +3,7 @@ package mq import ( + "fmt" "time" "github.com/aws/aws-sdk-go/aws" @@ -65,20 +66,20 @@ func (c *MQ) CreateBrokerRequest(input *CreateBrokerRequest) (req *request.Reque // See the AWS API reference guide for AmazonMQ's // API operation CreateBroker for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Returns information about an error. // -// * ErrCodeUnauthorizedException "UnauthorizedException" +// * UnauthorizedException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/CreateBroker @@ -157,17 +158,17 @@ func (c *MQ) CreateConfigurationRequest(input *CreateConfigurationRequest) (req // See the AWS API reference guide for AmazonMQ's // API operation CreateConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/CreateConfiguration @@ -246,17 +247,17 @@ func (c *MQ) CreateTagsRequest(input *CreateTagsInput) (req *request.Request, ou // See the AWS API reference guide for AmazonMQ's // API operation CreateTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/CreateTags @@ -335,20 +336,20 @@ func (c *MQ) CreateUserRequest(input *CreateUserRequest) (req *request.Request, // See the AWS API reference guide for AmazonMQ's // API operation CreateUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/CreateUser @@ -426,17 +427,17 @@ func (c *MQ) DeleteBrokerRequest(input *DeleteBrokerInput) (req *request.Request // See the AWS API reference guide for AmazonMQ's // API operation DeleteBroker for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/DeleteBroker @@ -515,17 +516,17 @@ func (c *MQ) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, ou // See the AWS API reference guide for AmazonMQ's // API operation DeleteTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/DeleteTags @@ -604,17 +605,17 @@ func (c *MQ) DeleteUserRequest(input *DeleteUserInput) (req *request.Request, ou // See the AWS API reference guide for AmazonMQ's // API operation DeleteUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/DeleteUser @@ -692,17 +693,17 @@ func (c *MQ) DescribeBrokerRequest(input *DescribeBrokerInput) (req *request.Req // See the AWS API reference guide for AmazonMQ's // API operation DescribeBroker for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/DescribeBroker @@ -780,14 +781,14 @@ func (c *MQ) DescribeBrokerEngineTypesRequest(input *DescribeBrokerEngineTypesIn // See the AWS API reference guide for AmazonMQ's // API operation DescribeBrokerEngineTypes for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/DescribeBrokerEngineTypes @@ -865,14 +866,14 @@ func (c *MQ) DescribeBrokerInstanceOptionsRequest(input *DescribeBrokerInstanceO // See the AWS API reference guide for AmazonMQ's // API operation DescribeBrokerInstanceOptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/DescribeBrokerInstanceOptions @@ -950,17 +951,17 @@ func (c *MQ) DescribeConfigurationRequest(input *DescribeConfigurationInput) (re // See the AWS API reference guide for AmazonMQ's // API operation DescribeConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/DescribeConfiguration @@ -1038,17 +1039,17 @@ func (c *MQ) DescribeConfigurationRevisionRequest(input *DescribeConfigurationRe // See the AWS API reference guide for AmazonMQ's // API operation DescribeConfigurationRevision for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/DescribeConfigurationRevision @@ -1126,17 +1127,17 @@ func (c *MQ) DescribeUserRequest(input *DescribeUserInput) (req *request.Request // See the AWS API reference guide for AmazonMQ's // API operation DescribeUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/DescribeUser @@ -1214,14 +1215,14 @@ func (c *MQ) ListBrokersRequest(input *ListBrokersInput) (req *request.Request, // See the AWS API reference guide for AmazonMQ's // API operation ListBrokers for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/ListBrokers @@ -1299,17 +1300,17 @@ func (c *MQ) ListConfigurationRevisionsRequest(input *ListConfigurationRevisions // See the AWS API reference guide for AmazonMQ's // API operation ListConfigurationRevisions for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/ListConfigurationRevisions @@ -1387,14 +1388,14 @@ func (c *MQ) ListConfigurationsRequest(input *ListConfigurationsInput) (req *req // See the AWS API reference guide for AmazonMQ's // API operation ListConfigurations for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/ListConfigurations @@ -1472,17 +1473,17 @@ func (c *MQ) ListTagsRequest(input *ListTagsInput) (req *request.Request, output // See the AWS API reference guide for AmazonMQ's // API operation ListTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/ListTags @@ -1560,17 +1561,17 @@ func (c *MQ) ListUsersRequest(input *ListUsersInput) (req *request.Request, outp // See the AWS API reference guide for AmazonMQ's // API operation ListUsers for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/ListUsers @@ -1649,17 +1650,17 @@ func (c *MQ) RebootBrokerRequest(input *RebootBrokerInput) (req *request.Request // See the AWS API reference guide for AmazonMQ's // API operation RebootBroker for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/RebootBroker @@ -1737,20 +1738,20 @@ func (c *MQ) UpdateBrokerRequest(input *UpdateBrokerRequest) (req *request.Reque // See the AWS API reference guide for AmazonMQ's // API operation UpdateBroker for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/UpdateBroker @@ -1828,20 +1829,20 @@ func (c *MQ) UpdateConfigurationRequest(input *UpdateConfigurationRequest) (req // See the AWS API reference guide for AmazonMQ's // API operation UpdateConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/UpdateConfiguration @@ -1920,20 +1921,20 @@ func (c *MQ) UpdateUserRequest(input *UpdateUserRequest) (req *request.Request, // See the AWS API reference guide for AmazonMQ's // API operation UpdateUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // Returns information about an error. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // Returns information about an error. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Returns information about an error. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // Returns information about an error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Returns information about an error. // // See also, https://docs.aws.amazon.com/goto/WebAPI/mq-2017-11-27/UpdateUser @@ -1982,6 +1983,64 @@ func (s *AvailabilityZone) SetName(v string) *AvailabilityZone { return s } +// Returns information about an error. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + ErrorAttribute *string `locationName:"errorAttribute" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // Types of broker engines. type BrokerEngineType struct { _ struct{} `type:"structure"` @@ -2070,6 +2129,12 @@ type BrokerInstanceOption struct { // The type of broker instance. HostInstanceType *string `locationName:"hostInstanceType" type:"string"` + // The broker's storage type. + StorageType *string `locationName:"storageType" type:"string" enum:"BrokerStorageType"` + + // The list of supported deployment modes. + SupportedDeploymentModes []*string `locationName:"supportedDeploymentModes" type:"list"` + // The list of supported engine versions. SupportedEngineVersions []*string `locationName:"supportedEngineVersions" type:"list"` } @@ -2102,6 +2167,18 @@ func (s *BrokerInstanceOption) SetHostInstanceType(v string) *BrokerInstanceOpti return s } +// SetStorageType sets the StorageType field's value. +func (s *BrokerInstanceOption) SetStorageType(v string) *BrokerInstanceOption { + s.StorageType = &v + return s +} + +// SetSupportedDeploymentModes sets the SupportedDeploymentModes field's value. +func (s *BrokerInstanceOption) SetSupportedDeploymentModes(v []*string) *BrokerInstanceOption { + s.SupportedDeploymentModes = v + return s +} + // SetSupportedEngineVersions sets the SupportedEngineVersions field's value. func (s *BrokerInstanceOption) SetSupportedEngineVersions(v []*string) *BrokerInstanceOption { s.SupportedEngineVersions = v @@ -2406,6 +2483,64 @@ func (s *Configurations) SetPending(v *ConfigurationId) *Configurations { return s } +// Returns information about an error. +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + ErrorAttribute *string `locationName:"errorAttribute" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictException) GoString() string { + return s.String() +} + +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" +} + +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil +} + +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID +} + type CreateBrokerRequest struct { _ struct{} `type:"structure"` @@ -2442,6 +2577,9 @@ type CreateBrokerRequest struct { SecurityGroups []*string `locationName:"securityGroups" type:"list"` + // The storage type of the broker. + StorageType *string `locationName:"storageType" type:"string" enum:"BrokerStorageType"` + SubnetIds []*string `locationName:"subnetIds" type:"list"` Tags map[string]*string `locationName:"tags" type:"map"` @@ -2552,6 +2690,12 @@ func (s *CreateBrokerRequest) SetSecurityGroups(v []*string) *CreateBrokerReques return s } +// SetStorageType sets the StorageType field's value. +func (s *CreateBrokerRequest) SetStorageType(v string) *CreateBrokerRequest { + s.StorageType = &v + return s +} + // SetSubnetIds sets the SubnetIds field's value. func (s *CreateBrokerRequest) SetSubnetIds(v []*string) *CreateBrokerRequest { s.SubnetIds = v @@ -3187,6 +3331,8 @@ type DescribeBrokerInstanceOptionsInput struct { MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` NextToken *string `location:"querystring" locationName:"nextToken" type:"string"` + + StorageType *string `location:"querystring" locationName:"storageType" type:"string"` } // String returns the string representation @@ -3236,6 +3382,12 @@ func (s *DescribeBrokerInstanceOptionsInput) SetNextToken(v string) *DescribeBro return s } +// SetStorageType sets the StorageType field's value. +func (s *DescribeBrokerInstanceOptionsInput) SetStorageType(v string) *DescribeBrokerInstanceOptionsInput { + s.StorageType = &v + return s +} + type DescribeBrokerInstanceOptionsOutput struct { _ struct{} `type:"structure"` @@ -3326,6 +3478,9 @@ type DescribeBrokerResponse struct { SecurityGroups []*string `locationName:"securityGroups" type:"list"` + // The storage type of the broker. + StorageType *string `locationName:"storageType" type:"string" enum:"BrokerStorageType"` + SubnetIds []*string `locationName:"subnetIds" type:"list"` Tags map[string]*string `locationName:"tags" type:"map"` @@ -3463,6 +3618,12 @@ func (s *DescribeBrokerResponse) SetSecurityGroups(v []*string) *DescribeBrokerR return s } +// SetStorageType sets the StorageType field's value. +func (s *DescribeBrokerResponse) SetStorageType(v string) *DescribeBrokerResponse { + s.StorageType = &v + return s +} + // SetSubnetIds sets the SubnetIds field's value. func (s *DescribeBrokerResponse) SetSubnetIds(v []*string) *DescribeBrokerResponse { s.SubnetIds = v @@ -3892,6 +4053,122 @@ func (s *EngineVersion) SetName(v string) *EngineVersion { return s } +// Returns information about an error. +type ForbiddenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + ErrorAttribute *string `locationName:"errorAttribute" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ForbiddenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ForbiddenException) GoString() string { + return s.String() +} + +func newErrorForbiddenException(v protocol.ResponseMetadata) error { + return &ForbiddenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ForbiddenException) Code() string { + return "ForbiddenException" +} + +// Message returns the exception's message. +func (s ForbiddenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ForbiddenException) OrigErr() error { + return nil +} + +func (s ForbiddenException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ForbiddenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ForbiddenException) RequestID() string { + return s.respMetadata.RequestID +} + +// Returns information about an error. +type InternalServerErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + ErrorAttribute *string `locationName:"errorAttribute" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalServerErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerErrorException) GoString() string { + return s.String() +} + +func newErrorInternalServerErrorException(v protocol.ResponseMetadata) error { + return &InternalServerErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerErrorException) Code() string { + return "InternalServerErrorException" +} + +// Message returns the exception's message. +func (s InternalServerErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerErrorException) OrigErr() error { + return nil +} + +func (s InternalServerErrorException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerErrorException) RequestID() string { + return s.respMetadata.RequestID +} + type ListBrokersInput struct { _ struct{} `type:"structure"` @@ -4412,6 +4689,64 @@ func (s *LogsSummary) SetPending(v *PendingLogs) *LogsSummary { return s } +// Returns information about an error. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + ErrorAttribute *string `locationName:"errorAttribute" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // The list of information about logs to be enabled for the specified broker. type PendingLogs struct { _ struct{} `type:"structure"` @@ -4542,6 +4877,64 @@ func (s *SanitizationWarning) SetReason(v string) *SanitizationWarning { return s } +// Returns information about an error. +type UnauthorizedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + ErrorAttribute *string `locationName:"errorAttribute" type:"string"` + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnauthorizedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnauthorizedException) GoString() string { + return s.String() +} + +func newErrorUnauthorizedException(v protocol.ResponseMetadata) error { + return &UnauthorizedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnauthorizedException) Code() string { + return "UnauthorizedException" +} + +// Message returns the exception's message. +func (s UnauthorizedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnauthorizedException) OrigErr() error { + return nil +} + +func (s UnauthorizedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnauthorizedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnauthorizedException) RequestID() string { + return s.respMetadata.RequestID +} + type UpdateBrokerRequest struct { _ struct{} `type:"structure"` @@ -5112,6 +5505,15 @@ const ( BrokerStateRebootInProgress = "REBOOT_IN_PROGRESS" ) +// The storage type of the broker. +const ( + // BrokerStorageTypeEbs is a BrokerStorageType enum value + BrokerStorageTypeEbs = "EBS" + + // BrokerStorageTypeEfs is a BrokerStorageType enum value + BrokerStorageTypeEfs = "EFS" +) + // The type of change pending for the ActiveMQ user. const ( // ChangeTypeCreate is a ChangeType enum value diff --git a/vendor/github.com/aws/aws-sdk-go/service/mq/errors.go b/vendor/github.com/aws/aws-sdk-go/service/mq/errors.go index 064fc8e5b71..24d6e0fefbf 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mq/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mq/errors.go @@ -2,6 +2,10 @@ package mq +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadRequestException for service response error code @@ -40,3 +44,12 @@ const ( // Returns information about an error. ErrCodeUnauthorizedException = "UnauthorizedException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadRequestException": newErrorBadRequestException, + "ConflictException": newErrorConflictException, + "ForbiddenException": newErrorForbiddenException, + "InternalServerErrorException": newErrorInternalServerErrorException, + "NotFoundException": newErrorNotFoundException, + "UnauthorizedException": newErrorUnauthorizedException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/mq/service.go b/vendor/github.com/aws/aws-sdk-go/service/mq/service.go index 4baaa385e39..d6823d36055 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/mq/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/mq/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "mq" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "mq" // ServiceID is a unique identifer of a specific service. + ServiceID = "mq" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the MQ client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a MQ client from just a session. // svc := mq.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *MQ { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "mq" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *MQ { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *MQ { svc := &MQ{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-11-27", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/neptune/api.go b/vendor/github.com/aws/aws-sdk-go/service/neptune/api.go index 39af2f2ae5d..938839b0c04 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/neptune/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/neptune/api.go @@ -491,8 +491,6 @@ func (c *Neptune) CopyDBClusterSnapshotRequest(input *CopyDBClusterSnapshotInput // 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't copy from one AWS Region to another. -// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -676,6 +674,11 @@ func (c *Neptune) CreateDBClusterRequest(input *CreateDBClusterInput) (req *requ // You can use the ReplicationSourceIdentifier parameter to create the DB cluster // as a Read Replica of another DB cluster or Amazon Neptune DB instance. // +// Note that when you create a new cluster using CreateDBCluster directly, deletion +// protection is disabled by default (when you create a new production cluster +// in the console, deletion protection is enabled by default). You can only +// delete a DB cluster if its DeletionProtection field is set to false. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1459,6 +1462,9 @@ func (c *Neptune) DeleteDBClusterRequest(input *DeleteDBClusterInput) (req *requ // and can't be recovered. Manual DB cluster snapshots of the specified DB cluster // are not deleted. // +// Note that the DB Cluster cannot be deleted if deletion protection is enabled. +// To delete it, you must first set its DeletionProtection field to False. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1733,7 +1739,8 @@ func (c *Neptune) DeleteDBInstanceRequest(input *DeleteDBInstanceInput) (req *re // incompatible-restore, or incompatible-network, you can only delete it when // the SkipFinalSnapshot parameter is set to true. // -// You can't delete a DB instance if it is the only instance in the DB cluster. +// You can't delete a DB instance if it is the only instance in the DB cluster, +// or if it has deletion protection 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 @@ -2411,7 +2418,10 @@ func (c *Neptune) DescribeDBClustersRequest(input *DescribeDBClustersInput) (req // DescribeDBClusters API operation for Amazon Neptune. // -// Returns information about provisioned DB clusters. This API supports pagination. +// Returns information about provisioned DB clusters, and supports pagination. +// +// This operation can also return information for Amazon RDS clusters and Amazon +// DocDB 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 @@ -2569,10 +2579,12 @@ func (c *Neptune) DescribeDBEngineVersionsPagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBEngineVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBEngineVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2626,7 +2638,10 @@ func (c *Neptune) DescribeDBInstancesRequest(input *DescribeDBInstancesInput) (r // DescribeDBInstances API operation for Amazon Neptune. // -// Returns information about provisioned instances. This API supports pagination. +// Returns information about provisioned instances, and supports pagination. +// +// This operation can also return information for Amazon RDS instances and Amazon +// DocDB 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 @@ -2704,10 +2719,12 @@ func (c *Neptune) DescribeDBInstancesPagesWithContext(ctx aws.Context, input *De }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBInstancesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBInstancesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2841,10 +2858,12 @@ func (c *Neptune) DescribeDBParameterGroupsPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBParameterGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBParameterGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2976,10 +2995,12 @@ func (c *Neptune) DescribeDBParametersPagesWithContext(ctx aws.Context, input *D }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBParametersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBParametersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3114,10 +3135,12 @@ func (c *Neptune) DescribeDBSubnetGroupsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBSubnetGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBSubnetGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3320,10 +3343,12 @@ func (c *Neptune) DescribeEngineDefaultParametersPagesWithContext(ctx aws.Contex }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEngineDefaultParametersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEngineDefaultParametersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3534,10 +3559,12 @@ func (c *Neptune) DescribeEventSubscriptionsPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventSubscriptionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEventSubscriptionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3668,10 +3695,12 @@ func (c *Neptune) DescribeEventsPagesWithContext(ctx aws.Context, input *Describ }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3798,10 +3827,12 @@ func (c *Neptune) DescribeOrderableDBInstanceOptionsPagesWithContext(ctx aws.Con }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeOrderableDBInstanceOptionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeOrderableDBInstanceOptionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5796,6 +5827,181 @@ func (c *Neptune) RestoreDBClusterToPointInTimeWithContext(ctx aws.Context, inpu return out, req.Send() } +const opStartDBCluster = "StartDBCluster" + +// StartDBClusterRequest generates a "aws/request.Request" representing the +// client's request for the StartDBCluster operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartDBCluster for more information on using the StartDBCluster +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartDBClusterRequest method. +// req, resp := client.StartDBClusterRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/neptune-2014-10-31/StartDBCluster +func (c *Neptune) StartDBClusterRequest(input *StartDBClusterInput) (req *request.Request, output *StartDBClusterOutput) { + op := &request.Operation{ + Name: opStartDBCluster, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StartDBClusterInput{} + } + + output = &StartDBClusterOutput{} + req = c.newRequest(op, input, output) + return +} + +// StartDBCluster API operation for Amazon Neptune. +// +// Starts an Amazon Neptune DB cluster that was stopped using the AWS console, +// the AWS CLI stop-db-cluster command, or the StopDBCluster 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 Neptune's +// API operation StartDBCluster 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. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/neptune-2014-10-31/StartDBCluster +func (c *Neptune) StartDBCluster(input *StartDBClusterInput) (*StartDBClusterOutput, error) { + req, out := c.StartDBClusterRequest(input) + return out, req.Send() +} + +// StartDBClusterWithContext is the same as StartDBCluster with the addition of +// the ability to pass a context and additional request options. +// +// See StartDBCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Neptune) StartDBClusterWithContext(ctx aws.Context, input *StartDBClusterInput, opts ...request.Option) (*StartDBClusterOutput, error) { + req, out := c.StartDBClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopDBCluster = "StopDBCluster" + +// StopDBClusterRequest generates a "aws/request.Request" representing the +// client's request for the StopDBCluster operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopDBCluster for more information on using the StopDBCluster +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopDBClusterRequest method. +// req, resp := client.StopDBClusterRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/neptune-2014-10-31/StopDBCluster +func (c *Neptune) StopDBClusterRequest(input *StopDBClusterInput) (req *request.Request, output *StopDBClusterOutput) { + op := &request.Operation{ + Name: opStopDBCluster, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StopDBClusterInput{} + } + + output = &StopDBClusterOutput{} + req = c.newRequest(op, input, output) + return +} + +// StopDBCluster API operation for Amazon Neptune. +// +// Stops an Amazon Neptune DB cluster. When you stop a DB cluster, Neptune retains +// the DB cluster's metadata, including its endpoints and DB parameter groups. +// +// Neptune also retains the transaction logs so you can do a point-in-time restore +// 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 Neptune's +// API operation StopDBCluster 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. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/neptune-2014-10-31/StopDBCluster +func (c *Neptune) StopDBCluster(input *StopDBClusterInput) (*StopDBClusterOutput, error) { + req, out := c.StopDBClusterRequest(input) + return out, req.Send() +} + +// StopDBClusterWithContext is the same as StopDBCluster with the addition of +// the ability to pass a context and additional request options. +// +// See StopDBCluster for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Neptune) StopDBClusterWithContext(ctx aws.Context, input *StopDBClusterInput, opts ...request.Option) (*StopDBClusterOutput, error) { + req, out := c.StopDBClusterRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + type AddRoleToDBClusterInput struct { _ struct{} `type:"structure"` @@ -6356,10 +6562,6 @@ type CopyDBClusterSnapshotInput struct { // 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 Neptune 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 @@ -6371,6 +6573,10 @@ type CopyDBClusterSnapshotInput struct { // KMS encryption keys are specific to the AWS Region that they are created // in, and you can't use encryption keys from one AWS Region in another AWS // Region. + // + // You cannot encrypt an unencrypted DB cluster snapshot when you copy it. If + // you try to copy an unencrypted DB cluster snapshot and specify a value for + // the KmsKeyId parameter, an error is returned. KmsKeyId *string `type:"string"` // Not currently supported. @@ -6638,8 +6844,7 @@ type CreateDBClusterInput struct { // * 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. + // (Not supported by Neptune) CharacterSetName *string `type:"string"` // The DB cluster identifier. This parameter is stored as a lowercase string. @@ -6678,6 +6883,11 @@ type CreateDBClusterInput struct { // you are creating. DatabaseName *string `type:"string"` + // A value that indicates whether the DB cluster has deletion protection enabled. + // The database can't be deleted when deletion protection is enabled. By default, + // deletion protection is enabled. + DeletionProtection *bool `type:"boolean"` + // The list of log types that need to be enabled for exporting to CloudWatch // Logs. EnableCloudwatchLogsExports []*string `type:"list"` @@ -6695,7 +6905,8 @@ type CreateDBClusterInput struct { // Engine is a required field Engine *string `type:"string" required:"true"` - // The version number of the database engine to use. + // The version number of the database engine to use. Currently, setting this + // parameter has no effect. // // Example: 1.0.1 EngineVersion *string `type:"string"` @@ -6742,11 +6953,7 @@ type CreateDBClusterInput struct { // * 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 can't be removed from an option group. The option group - // can't be removed from a DB cluster once it is associated with a DB cluster. + // (Not supported by Neptune) OptionGroupName *string `type:"string"` // The port number on which the instances in the DB cluster accept connections. @@ -6874,6 +7081,12 @@ func (s *CreateDBClusterInput) SetDatabaseName(v string) *CreateDBClusterInput { return s } +// SetDeletionProtection sets the DeletionProtection field's value. +func (s *CreateDBClusterInput) SetDeletionProtection(v bool) *CreateDBClusterInput { + s.DeletionProtection = &v + return s +} + // SetEnableCloudwatchLogsExports sets the EnableCloudwatchLogsExports field's value. func (s *CreateDBClusterInput) SetEnableCloudwatchLogsExports(v []*string) *CreateDBClusterInput { s.EnableCloudwatchLogsExports = v @@ -7254,10 +7467,7 @@ type CreateDBInstanceInput struct { // * Cannot be set to 0 if the DB instance is a source to Read Replicas BackupRetentionPeriod *int64 `type:"integer"` - // Indicates that the DB instance should be associated with the specified CharacterSet. - // - // Not applicable. The character set is managed by the DB cluster. For more - // information, see CreateDBCluster. + // (Not supported by Neptune) CharacterSetName *string `type:"string"` // True to copy all tags from the DB instance to snapshots of the DB instance, @@ -7318,6 +7528,14 @@ type CreateDBInstanceInput struct { // If there is no DB subnet group, then it is a non-VPC DB instance. DBSubnetGroupName *string `type:"string"` + // A value that indicates whether the DB instance has deletion protection enabled. + // The database can't be deleted when deletion protection is enabled. By default, + // deletion protection is disabled. See Deleting a DB Instance (https://docs.aws.amazon.com/neptune/latest/userguide/manage-console-instances-delete.html). + // + // DB instances in a DB cluster can be deleted even when deletion protection + // is enabled in their parent DB cluster. + DeletionProtection *bool `type:"boolean"` + // Specify the Active Directory Domain to create the instance in. Domain *string `type:"string"` @@ -7335,7 +7553,7 @@ type CreateDBInstanceInput struct { // Default: false EnableIAMDatabaseAuthentication *bool `type:"boolean"` - // True to enable Performance Insights for the DB instance, and otherwise false. + // (Not supported by Neptune) EnablePerformanceInsights *bool `type:"boolean"` // The name of the database engine to be used for this instance. @@ -7345,7 +7563,8 @@ type CreateDBInstanceInput struct { // Engine is a required field Engine *string `type:"string" required:"true"` - // The version number of the database engine to use. + // The version number of the database engine to use. Currently, setting this + // parameter has no effect. EngineVersion *string `type:"string"` // The amount of Provisioned IOPS (input/output operations per second) to be @@ -7403,17 +7622,10 @@ type CreateDBInstanceInput struct { // 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, - // can't be removed from an option group, and that option group can't be removed - // from a DB instance once it is associated with a DB instance + // (Not supported by Neptune) OptionGroupName *string `type:"string"` - // The AWS KMS key identifier for encryption of Performance Insights data. The - // KMS key ID is the Amazon Resource Name (ARN), KMS key identifier, or the - // KMS key alias for the KMS encryption key. + // (Not supported by Neptune) PerformanceInsightsKMSKeyId *string `type:"string"` // The port number on which the database accepts connections. @@ -7600,6 +7812,12 @@ func (s *CreateDBInstanceInput) SetDBSubnetGroupName(v string) *CreateDBInstance return s } +// SetDeletionProtection sets the DeletionProtection field's value. +func (s *CreateDBInstanceInput) SetDeletionProtection(v bool) *CreateDBInstanceInput { + s.DeletionProtection = &v + return s +} + // SetDomain sets the Domain field's value. func (s *CreateDBInstanceInput) SetDomain(v string) *CreateDBInstanceInput { s.Domain = &v @@ -8194,8 +8412,7 @@ type DBCluster struct { // 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. + // (Not supported by Neptune) CharacterSetName *string `type:"string"` // Identifies the clone group to which the DB cluster is associated. @@ -8215,7 +8432,7 @@ type DBCluster struct { // 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. + // (Not supported by Neptune) DBClusterOptionGroupMemberships []*DBClusterOptionGroupStatus `locationNameList:"DBClusterOptionGroup" type:"list"` // Specifies the name of the DB cluster parameter group for the DB cluster. @@ -8235,6 +8452,10 @@ type DBCluster struct { // cluster is accessed. DbClusterResourceId *string `type:"string"` + // Indicates whether or not the DB cluster has deletion protection enabled. + // The database can't be deleted when deletion protection is enabled. + DeletionProtection *bool `type:"boolean"` + // Specifies the earliest time to which a database can be restored with point-in-time // restore. EarliestRestorableTime *time.Time `type:"timestamp"` @@ -8417,6 +8638,12 @@ func (s *DBCluster) SetDbClusterResourceId(v string) *DBCluster { return s } +// SetDeletionProtection sets the DeletionProtection field's value. +func (s *DBCluster) SetDeletionProtection(v bool) *DBCluster { + s.DeletionProtection = &v + return s +} + // SetEarliestRestorableTime sets the EarliestRestorableTime field's value. func (s *DBCluster) SetEarliestRestorableTime(v time.Time) *DBCluster { s.EarliestRestorableTime = &v @@ -8756,7 +8983,20 @@ type DBClusterSnapshot struct { // The Amazon Resource Name (ARN) for the DB cluster snapshot. DBClusterSnapshotArn *string `type:"string"` - // Specifies the identifier for the DB cluster snapshot. + // Specifies the identifier for a DB cluster snapshot. Must match the identifier + // of an existing snapshot. + // + // After you restore a DB cluster using a DBClusterSnapshotIdentifier, you must + // specify the same DBClusterSnapshotIdentifier for any future updates to the + // DB cluster. When you specify this property for an update, the DB cluster + // is not restored from the snapshot again, and the data in the database is + // not changed. + // + // However, if you don't specify the DBClusterSnapshotIdentifier, an empty DB + // cluster is created, and the original DB cluster is deleted. If you specify + // a property that is different from the previous snapshot restore property, + // the DB cluster is restored from the snapshot specified by the DBClusterSnapshotIdentifier, + // and the original DB cluster is deleted. DBClusterSnapshotIdentifier *string `type:"string"` // Specifies the name of the database engine. @@ -9037,8 +9277,7 @@ type DBEngineVersion struct { // 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. + // (Not supported by Neptune) DefaultCharacterSet *CharacterSet `type:"structure"` // The name of the database engine. @@ -9051,8 +9290,7 @@ type DBEngineVersion struct { // Logs. ExportableLogTypes []*string `type:"list"` - // A list of the character sets supported by this engine for the CharacterSetName - // parameter of the CreateDBInstance action. + // (Not supported by Neptune) SupportedCharacterSets []*CharacterSet `locationNameList:"CharacterSet" type:"list"` // A list of the time zones supported by this engine for the Timezone parameter @@ -9174,8 +9412,7 @@ type DBInstance struct { // 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. + // (Not supported by Neptune) CharacterSetName *string `type:"string"` // Specifies whether tags are copied from the DB instance to snapshots of the @@ -9222,6 +9459,11 @@ type DBInstance struct { // instance is accessed. DbiResourceId *string `type:"string"` + // Indicates whether or not the DB instance has deletion protection enabled. + // The instance can't be deleted when deletion protection is enabled. See Deleting + // a DB Instance (https://docs.aws.amazon.com/neptune/latest/userguide/manage-console-instances-delete.html). + DeletionProtection *bool `type:"boolean"` + // Not supported DomainMemberships []*DomainMembership `locationNameList:"DomainMembership" type:"list"` @@ -9276,20 +9518,17 @@ type DBInstance struct { // 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. + // (Not supported by Neptune) 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"` - // True if Performance Insights is enabled for the DB instance, and otherwise - // false. + // (Not supported by Neptune) PerformanceInsightsEnabled *bool `type:"boolean"` - // The AWS KMS key identifier for encryption of Performance Insights data. The - // KMS key ID is the Amazon Resource Name (ARN), KMS key identifier, or the - // KMS key alias for the KMS encryption key. + // (Not supported by Neptune) PerformanceInsightsKMSKeyId *string `type:"string"` // Specifies the daily time range during which automated backups are created @@ -9465,6 +9704,12 @@ func (s *DBInstance) SetDbiResourceId(v string) *DBInstance { return s } +// SetDeletionProtection sets the DeletionProtection field's value. +func (s *DBInstance) SetDeletionProtection(v bool) *DBInstance { + s.DeletionProtection = &v + return s +} + // SetDomainMemberships sets the DomainMemberships field's value. func (s *DBInstance) SetDomainMemberships(v []*DomainMembership) *DBInstance { s.DomainMemberships = v @@ -10983,6 +11228,12 @@ type DescribeDBClustersInput struct { // * 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. + // + // * engine - Accepts an engine name (such as neptune), and restricts the + // results list to DB clusters created by that engine. + // + // For example, to invoke this API from the AWS CLI and filter so that only + // Neptune DB clusters are returned, you could use the following command: Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous DescribeDBClusters request. @@ -11274,9 +11525,11 @@ type DescribeDBInstancesInput struct { // 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. + // * engine - Accepts an engine name (such as neptune), and restricts the + // results list to DB instances created by that engine. + // + // For example, to invoke this API from the AWS CLI and filter so that only + // Neptune DB instances are returned, you could use the following command: Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous DescribeDBInstances request. @@ -13317,15 +13570,20 @@ type ModifyDBClusterInput struct { // The name of the DB cluster parameter group to use for the DB cluster. DBClusterParameterGroupName *string `type:"string"` + // A value that indicates whether the DB cluster has deletion protection enabled. + // The database can't be deleted when deletion protection is enabled. By default, + // deletion protection is disabled. + DeletionProtection *bool `type:"boolean"` + // True to enable mapping of AWS Identity and Access Management (IAM) accounts // to database accounts, and otherwise false. // // Default: false EnableIAMDatabaseAuthentication *bool `type:"boolean"` - // The version number of the database engine to which you want to upgrade. Changing - // this parameter results in an outage. The change is applied during the next - // maintenance window unless the ApplyImmediately parameter is set to true. + // The version number of the database engine. Currently, setting this parameter + // has no effect. To upgrade your database engine to the most recent release, + // use the ApplyPendingMaintenanceAction API. // // For a list of valid engine versions, see CreateDBInstance, or call DescribeDBEngineVersions. EngineVersion *string `type:"string"` @@ -13350,16 +13608,7 @@ type ModifyDBClusterInput struct { // 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 doesn't 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 can't be removed from an option group. The option group - // can't be removed from a DB cluster once it is associated with a DB cluster. + // (Not supported by Neptune) OptionGroupName *string `type:"string"` // The port number on which the DB cluster accepts connections. @@ -13456,6 +13705,12 @@ func (s *ModifyDBClusterInput) SetDBClusterParameterGroupName(v string) *ModifyD return s } +// SetDeletionProtection sets the DeletionProtection field's value. +func (s *ModifyDBClusterInput) SetDeletionProtection(v bool) *ModifyDBClusterInput { + s.DeletionProtection = &v + return s +} + // SetEnableIAMDatabaseAuthentication sets the EnableIAMDatabaseAuthentication field's value. func (s *ModifyDBClusterInput) SetEnableIAMDatabaseAuthentication(v bool) *ModifyDBClusterInput { s.EnableIAMDatabaseAuthentication = &v @@ -13714,10 +13969,6 @@ type ModifyDBInstanceInput struct { // Indicates that major version upgrades are allowed. Changing this parameter // doesn't 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 @@ -13821,6 +14072,11 @@ type ModifyDBInstanceInput struct { // Example: mySubnetGroup DBSubnetGroupName *string `type:"string"` + // A value that indicates whether the DB instance has deletion protection enabled. + // The database can't be deleted when deletion protection is enabled. By default, + // deletion protection is disabled. See Deleting a DB Instance (https://docs.aws.amazon.com/neptune/latest/userguide/manage-console-instances-delete.html). + DeletionProtection *bool `type:"boolean"` + // Not supported. Domain *string `type:"string"` @@ -13838,17 +14094,12 @@ type ModifyDBInstanceInput struct { // Default: false EnableIAMDatabaseAuthentication *bool `type:"boolean"` - // Not supported. + // (Not supported by Neptune) EnablePerformanceInsights *bool `type:"boolean"` - // 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 nondefault 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. + // The version number of the database engine to upgrade to. Currently, setting + // this parameter has no effect. To upgrade your database engine to the most + // recent release, use the ApplyPendingMaintenanceAction API. EngineVersion *string `type:"string"` // The new Provisioned IOPS (I/O operations per second) value for the instance. @@ -13905,20 +14156,10 @@ type ModifyDBInstanceInput struct { // Example: mydbinstance NewDBInstanceIdentifier *string `type:"string"` - // Indicates that the DB instance should be associated with the specified option - // group. Changing this parameter doesn't 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, - // can't be removed from an option group, and that option group can't be removed - // from a DB instance once it is associated with a DB instance + // (Not supported by Neptune) OptionGroupName *string `type:"string"` - // Not supported. + // (Not supported by Neptune) PerformanceInsightsKMSKeyId *string `type:"string"` // The daily time range during which automated backups are created if automated @@ -14098,6 +14339,12 @@ func (s *ModifyDBInstanceInput) SetDBSubnetGroupName(v string) *ModifyDBInstance return s } +// SetDeletionProtection sets the DeletionProtection field's value. +func (s *ModifyDBInstanceInput) SetDeletionProtection(v bool) *ModifyDBInstanceInput { + s.DeletionProtection = &v + return s +} + // SetDomain sets the Domain field's value. func (s *ModifyDBInstanceInput) SetDomain(v string) *ModifyDBInstanceInput { s.Domain = &v @@ -14613,7 +14860,7 @@ type OrderableDBInstanceOption struct { // Indicates whether a DB instance supports provisioned IOPS. SupportsIops *bool `type:"boolean"` - // True if a DB instance supports Performance Insights, otherwise false. + // (Not supported by Neptune) SupportsPerformanceInsights *bool `type:"boolean"` // Indicates whether a DB instance supports encrypted storage. @@ -15019,7 +15266,8 @@ type PendingModifiedValues struct { // Indicates that the Single-AZ DB instance is to change to a Multi-AZ deployment. MultiAZ *bool `type:"boolean"` - // Specifies the CloudWatch logs to be exported. + // This PendingCloudwatchLogsExports structure specifies pending changes to + // which CloudWatch logs are enabled and which are disabled. PendingCloudwatchLogsExports *PendingCloudwatchLogsExports `type:"structure"` // Specifies the pending port for the DB instance. @@ -15781,6 +16029,11 @@ type RestoreDBClusterFromSnapshotInput struct { // Not supported. DatabaseName *string `type:"string"` + // A value that indicates whether the DB cluster has deletion protection enabled. + // The database can't be deleted when deletion protection is enabled. By default, + // deletion protection is disabled. + DeletionProtection *bool `type:"boolean"` + // The list of logs that the restored DB cluster is to export to Amazon CloudWatch // Logs. EnableCloudwatchLogsExports []*string `type:"list"` @@ -15822,7 +16075,7 @@ type RestoreDBClusterFromSnapshotInput struct { // encrypted, then the restored DB cluster is not encrypted. KmsKeyId *string `type:"string"` - // The name of the option group to use for the restored DB cluster. + // (Not supported by Neptune) OptionGroupName *string `type:"string"` // The port number on which the new DB cluster accepts connections. @@ -15911,6 +16164,12 @@ func (s *RestoreDBClusterFromSnapshotInput) SetDatabaseName(v string) *RestoreDB return s } +// SetDeletionProtection sets the DeletionProtection field's value. +func (s *RestoreDBClusterFromSnapshotInput) SetDeletionProtection(v bool) *RestoreDBClusterFromSnapshotInput { + s.DeletionProtection = &v + return s +} + // SetEnableCloudwatchLogsExports sets the EnableCloudwatchLogsExports field's value. func (s *RestoreDBClusterFromSnapshotInput) SetEnableCloudwatchLogsExports(v []*string) *RestoreDBClusterFromSnapshotInput { s.EnableCloudwatchLogsExports = v @@ -16026,6 +16285,11 @@ type RestoreDBClusterToPointInTimeInput struct { // Example: mySubnetgroup DBSubnetGroupName *string `type:"string"` + // A value that indicates whether the DB cluster has deletion protection enabled. + // The database can't be deleted when deletion protection is enabled. By default, + // deletion protection is disabled. + DeletionProtection *bool `type:"boolean"` + // The list of logs that the restored DB cluster is to export to CloudWatch // Logs. EnableCloudwatchLogsExports []*string `type:"list"` @@ -16062,7 +16326,7 @@ type RestoreDBClusterToPointInTimeInput struct { // the restore request is rejected. KmsKeyId *string `type:"string"` - // The name of the option group for the new DB cluster. + // (Not supported by Neptune) OptionGroupName *string `type:"string"` // The port number on which the new DB cluster accepts connections. @@ -16170,6 +16434,12 @@ func (s *RestoreDBClusterToPointInTimeInput) SetDBSubnetGroupName(v string) *Res return s } +// SetDeletionProtection sets the DeletionProtection field's value. +func (s *RestoreDBClusterToPointInTimeInput) SetDeletionProtection(v bool) *RestoreDBClusterToPointInTimeInput { + s.DeletionProtection = &v + return s +} + // SetEnableCloudwatchLogsExports sets the EnableCloudwatchLogsExports field's value. func (s *RestoreDBClusterToPointInTimeInput) SetEnableCloudwatchLogsExports(v []*string) *RestoreDBClusterToPointInTimeInput { s.EnableCloudwatchLogsExports = v @@ -16261,6 +16531,134 @@ func (s *RestoreDBClusterToPointInTimeOutput) SetDBCluster(v *DBCluster) *Restor return s } +type StartDBClusterInput struct { + _ struct{} `type:"structure"` + + // The DB cluster identifier of the Neptune DB cluster to be started. This parameter + // is stored as a lowercase string. + // + // DBClusterIdentifier is a required field + DBClusterIdentifier *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s StartDBClusterInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartDBClusterInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartDBClusterInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartDBClusterInput"} + 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 *StartDBClusterInput) SetDBClusterIdentifier(v string) *StartDBClusterInput { + s.DBClusterIdentifier = &v + return s +} + +type StartDBClusterOutput struct { + _ struct{} `type:"structure"` + + // Contains the details of an Amazon Neptune DB cluster. + // + // This data type is used as a response element in the DescribeDBClusters action. + DBCluster *DBCluster `type:"structure"` +} + +// String returns the string representation +func (s StartDBClusterOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartDBClusterOutput) GoString() string { + return s.String() +} + +// SetDBCluster sets the DBCluster field's value. +func (s *StartDBClusterOutput) SetDBCluster(v *DBCluster) *StartDBClusterOutput { + s.DBCluster = v + return s +} + +type StopDBClusterInput struct { + _ struct{} `type:"structure"` + + // The DB cluster identifier of the Neptune DB cluster to be stopped. This parameter + // is stored as a lowercase string. + // + // DBClusterIdentifier is a required field + DBClusterIdentifier *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s StopDBClusterInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopDBClusterInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StopDBClusterInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopDBClusterInput"} + 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 *StopDBClusterInput) SetDBClusterIdentifier(v string) *StopDBClusterInput { + s.DBClusterIdentifier = &v + return s +} + +type StopDBClusterOutput struct { + _ struct{} `type:"structure"` + + // Contains the details of an Amazon Neptune DB cluster. + // + // This data type is used as a response element in the DescribeDBClusters action. + DBCluster *DBCluster `type:"structure"` +} + +// String returns the string representation +func (s StopDBClusterOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopDBClusterOutput) GoString() string { + return s.String() +} + +// SetDBCluster sets the DBCluster field's value. +func (s *StopDBClusterOutput) SetDBCluster(v *DBCluster) *StopDBClusterOutput { + s.DBCluster = v + return s +} + // Specifies a subnet. // // This data type is used as a response element in the DescribeDBSubnetGroups diff --git a/vendor/github.com/aws/aws-sdk-go/service/neptune/service.go b/vendor/github.com/aws/aws-sdk-go/service/neptune/service.go index 3ddc5e5fba7..5c542c8d17e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/neptune/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/neptune/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "rds" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Neptune" // ServiceID is a unique identifer of a specific service. + ServiceID = "Neptune" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Neptune client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Neptune client from just a session. // svc := neptune.New(mySession) // @@ -49,11 +51,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *Neptune { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "rds" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Neptune { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Neptune { svc := &Neptune{ Client: client.New( cfg, @@ -62,6 +64,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2014-10-31", }, 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 index 183f356567b..0acf64add1d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/opsworks/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/opsworks/api.go @@ -78,11 +78,11 @@ func (c *OpsWorks) AssignInstanceRequest(input *AssignInstanceInput) (req *reque // See the AWS API reference guide for AWS OpsWorks's // API operation AssignInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssignInstance @@ -170,11 +170,11 @@ func (c *OpsWorks) AssignVolumeRequest(input *AssignVolumeInput) (req *request.R // See the AWS API reference guide for AWS OpsWorks's // API operation AssignVolume for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssignVolume @@ -260,11 +260,11 @@ func (c *OpsWorks) AssociateElasticIpRequest(input *AssociateElasticIpInput) (re // See the AWS API reference guide for AWS OpsWorks's // API operation AssociateElasticIp for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AssociateElasticIp @@ -355,11 +355,11 @@ func (c *OpsWorks) AttachElasticLoadBalancerRequest(input *AttachElasticLoadBala // See the AWS API reference guide for AWS OpsWorks's // API operation AttachElasticLoadBalancer for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/AttachElasticLoadBalancer @@ -443,11 +443,11 @@ func (c *OpsWorks) CloneStackRequest(input *CloneStackInput) (req *request.Reque // See the AWS API reference guide for AWS OpsWorks's // API operation CloneStack for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CloneStack @@ -531,11 +531,11 @@ func (c *OpsWorks) CreateAppRequest(input *CreateAppInput) (req *request.Request // See the AWS API reference guide for AWS OpsWorks's // API operation CreateApp for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateApp @@ -620,11 +620,11 @@ func (c *OpsWorks) CreateDeploymentRequest(input *CreateDeploymentInput) (req *r // See the AWS API reference guide for AWS OpsWorks's // API operation CreateDeployment for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateDeployment @@ -708,11 +708,11 @@ func (c *OpsWorks) CreateInstanceRequest(input *CreateInstanceInput) (req *reque // See the AWS API reference guide for AWS OpsWorks's // API operation CreateInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateInstance @@ -802,11 +802,11 @@ func (c *OpsWorks) CreateLayerRequest(input *CreateLayerInput) (req *request.Req // See the AWS API reference guide for AWS OpsWorks's // API operation CreateLayer for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateLayer @@ -888,8 +888,8 @@ func (c *OpsWorks) CreateStackRequest(input *CreateStackInput) (req *request.Req // See the AWS API reference guide for AWS OpsWorks's // API operation CreateStack for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateStack @@ -971,8 +971,8 @@ func (c *OpsWorks) CreateUserProfileRequest(input *CreateUserProfileInput) (req // See the AWS API reference guide for AWS OpsWorks's // API operation CreateUserProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/CreateUserProfile @@ -1056,11 +1056,11 @@ func (c *OpsWorks) DeleteAppRequest(input *DeleteAppInput) (req *request.Request // See the AWS API reference guide for AWS OpsWorks's // API operation DeleteApp for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteApp @@ -1147,11 +1147,11 @@ func (c *OpsWorks) DeleteInstanceRequest(input *DeleteInstanceInput) (req *reque // See the AWS API reference guide for AWS OpsWorks's // API operation DeleteInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteInstance @@ -1237,11 +1237,11 @@ func (c *OpsWorks) DeleteLayerRequest(input *DeleteLayerInput) (req *request.Req // See the AWS API reference guide for AWS OpsWorks's // API operation DeleteLayer for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteLayer @@ -1327,11 +1327,11 @@ func (c *OpsWorks) DeleteStackRequest(input *DeleteStackInput) (req *request.Req // See the AWS API reference guide for AWS OpsWorks's // API operation DeleteStack for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteStack @@ -1414,11 +1414,11 @@ func (c *OpsWorks) DeleteUserProfileRequest(input *DeleteUserProfileInput) (req // See the AWS API reference guide for AWS OpsWorks's // API operation DeleteUserProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeleteUserProfile @@ -1503,11 +1503,11 @@ func (c *OpsWorks) DeregisterEcsClusterRequest(input *DeregisterEcsClusterInput) // See the AWS API reference guide for AWS OpsWorks's // API operation DeregisterEcsCluster for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterEcsCluster @@ -1592,11 +1592,11 @@ func (c *OpsWorks) DeregisterElasticIpRequest(input *DeregisterElasticIpInput) ( // See the AWS API reference guide for AWS OpsWorks's // API operation DeregisterElasticIp for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterElasticIp @@ -1682,11 +1682,11 @@ func (c *OpsWorks) DeregisterInstanceRequest(input *DeregisterInstanceInput) (re // See the AWS API reference guide for AWS OpsWorks's // API operation DeregisterInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterInstance @@ -1770,11 +1770,11 @@ func (c *OpsWorks) DeregisterRdsDbInstanceRequest(input *DeregisterRdsDbInstance // See the AWS API reference guide for AWS OpsWorks's // API operation DeregisterRdsDbInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterRdsDbInstance @@ -1859,11 +1859,11 @@ func (c *OpsWorks) DeregisterVolumeRequest(input *DeregisterVolumeInput) (req *r // See the AWS API reference guide for AWS OpsWorks's // API operation DeregisterVolume for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DeregisterVolume @@ -1943,11 +1943,11 @@ func (c *OpsWorks) DescribeAgentVersionsRequest(input *DescribeAgentVersionsInpu // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeAgentVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeAgentVersions @@ -2032,11 +2032,11 @@ func (c *OpsWorks) DescribeAppsRequest(input *DescribeAppsInput) (req *request.R // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeApps for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeApps @@ -2121,11 +2121,11 @@ func (c *OpsWorks) DescribeCommandsRequest(input *DescribeCommandsInput) (req *r // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeCommands for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeCommands @@ -2210,11 +2210,11 @@ func (c *OpsWorks) DescribeDeploymentsRequest(input *DescribeDeploymentsInput) ( // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeDeployments for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeDeployments @@ -2308,11 +2308,11 @@ func (c *OpsWorks) DescribeEcsClustersRequest(input *DescribeEcsClustersInput) ( // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeEcsClusters for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeEcsClusters @@ -2380,10 +2380,12 @@ func (c *OpsWorks) DescribeEcsClustersPagesWithContext(ctx aws.Context, input *D }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEcsClustersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEcsClustersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2447,11 +2449,11 @@ func (c *OpsWorks) DescribeElasticIpsRequest(input *DescribeElasticIpsInput) (re // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeElasticIps for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeElasticIps @@ -2536,11 +2538,11 @@ func (c *OpsWorks) DescribeElasticLoadBalancersRequest(input *DescribeElasticLoa // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeElasticLoadBalancers for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeElasticLoadBalancers @@ -2625,11 +2627,11 @@ func (c *OpsWorks) DescribeInstancesRequest(input *DescribeInstancesInput) (req // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeInstances @@ -2714,11 +2716,11 @@ func (c *OpsWorks) DescribeLayersRequest(input *DescribeLayersInput) (req *reque // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeLayers for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeLayers @@ -2803,11 +2805,11 @@ func (c *OpsWorks) DescribeLoadBasedAutoScalingRequest(input *DescribeLoadBasedA // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeLoadBasedAutoScaling for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeLoadBasedAutoScaling @@ -3042,11 +3044,11 @@ func (c *OpsWorks) DescribePermissionsRequest(input *DescribePermissionsInput) ( // See the AWS API reference guide for AWS OpsWorks's // API operation DescribePermissions for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribePermissions @@ -3131,11 +3133,11 @@ func (c *OpsWorks) DescribeRaidArraysRequest(input *DescribeRaidArraysInput) (re // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeRaidArrays for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeRaidArrays @@ -3220,11 +3222,11 @@ func (c *OpsWorks) DescribeRdsDbInstancesRequest(input *DescribeRdsDbInstancesIn // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeRdsDbInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeRdsDbInstances @@ -3309,11 +3311,11 @@ func (c *OpsWorks) DescribeServiceErrorsRequest(input *DescribeServiceErrorsInpu // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeServiceErrors for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeServiceErrors @@ -3396,11 +3398,11 @@ func (c *OpsWorks) DescribeStackProvisioningParametersRequest(input *DescribeSta // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeStackProvisioningParameters for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStackProvisioningParameters @@ -3484,11 +3486,11 @@ func (c *OpsWorks) DescribeStackSummaryRequest(input *DescribeStackSummaryInput) // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeStackSummary for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStackSummary @@ -3571,11 +3573,11 @@ func (c *OpsWorks) DescribeStacksRequest(input *DescribeStacksInput) (req *reque // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeStacks for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeStacks @@ -3660,11 +3662,11 @@ func (c *OpsWorks) DescribeTimeBasedAutoScalingRequest(input *DescribeTimeBasedA // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeTimeBasedAutoScaling for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeTimeBasedAutoScaling @@ -3746,11 +3748,11 @@ func (c *OpsWorks) DescribeUserProfilesRequest(input *DescribeUserProfilesInput) // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeUserProfiles for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeUserProfiles @@ -3835,11 +3837,11 @@ func (c *OpsWorks) DescribeVolumesRequest(input *DescribeVolumesInput) (req *req // See the AWS API reference guide for AWS OpsWorks's // API operation DescribeVolumes for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DescribeVolumes @@ -3923,8 +3925,8 @@ func (c *OpsWorks) DetachElasticLoadBalancerRequest(input *DetachElasticLoadBala // See the AWS API reference guide for AWS OpsWorks's // API operation DetachElasticLoadBalancer for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DetachElasticLoadBalancer @@ -4010,11 +4012,11 @@ func (c *OpsWorks) DisassociateElasticIpRequest(input *DisassociateElasticIpInpu // See the AWS API reference guide for AWS OpsWorks's // API operation DisassociateElasticIp for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/DisassociateElasticIp @@ -4098,11 +4100,11 @@ func (c *OpsWorks) GetHostnameSuggestionRequest(input *GetHostnameSuggestionInpu // See the AWS API reference guide for AWS OpsWorks's // API operation GetHostnameSuggestion for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/GetHostnameSuggestion @@ -4183,11 +4185,11 @@ func (c *OpsWorks) GrantAccessRequest(input *GrantAccessInput) (req *request.Req // See the AWS API reference guide for AWS OpsWorks's // API operation GrantAccess for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/GrantAccess @@ -4265,11 +4267,11 @@ func (c *OpsWorks) ListTagsRequest(input *ListTagsInput) (req *request.Request, // See the AWS API reference guide for AWS OpsWorks's // API operation ListTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/ListTags @@ -4354,11 +4356,11 @@ func (c *OpsWorks) RebootInstanceRequest(input *RebootInstanceInput) (req *reque // See the AWS API reference guide for AWS OpsWorks's // API operation RebootInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RebootInstance @@ -4443,11 +4445,11 @@ func (c *OpsWorks) RegisterEcsClusterRequest(input *RegisterEcsClusterInput) (re // See the AWS API reference guide for AWS OpsWorks's // API operation RegisterEcsCluster for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterEcsCluster @@ -4533,11 +4535,11 @@ func (c *OpsWorks) RegisterElasticIpRequest(input *RegisterElasticIpInput) (req // See the AWS API reference guide for AWS OpsWorks's // API operation RegisterElasticIp for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterElasticIp @@ -4634,11 +4636,11 @@ func (c *OpsWorks) RegisterInstanceRequest(input *RegisterInstanceInput) (req *r // See the AWS API reference guide for AWS OpsWorks's // API operation RegisterInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterInstance @@ -4722,11 +4724,11 @@ func (c *OpsWorks) RegisterRdsDbInstanceRequest(input *RegisterRdsDbInstanceInpu // See the AWS API reference guide for AWS OpsWorks's // API operation RegisterRdsDbInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterRdsDbInstance @@ -4812,11 +4814,11 @@ func (c *OpsWorks) RegisterVolumeRequest(input *RegisterVolumeInput) (req *reque // See the AWS API reference guide for AWS OpsWorks's // API operation RegisterVolume for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/RegisterVolume @@ -4907,11 +4909,11 @@ func (c *OpsWorks) SetLoadBasedAutoScalingRequest(input *SetLoadBasedAutoScaling // See the AWS API reference guide for AWS OpsWorks's // API operation SetLoadBasedAutoScaling for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetLoadBasedAutoScaling @@ -4996,11 +4998,11 @@ func (c *OpsWorks) SetPermissionRequest(input *SetPermissionInput) (req *request // See the AWS API reference guide for AWS OpsWorks's // API operation SetPermission for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetPermission @@ -5086,11 +5088,11 @@ func (c *OpsWorks) SetTimeBasedAutoScalingRequest(input *SetTimeBasedAutoScaling // See the AWS API reference guide for AWS OpsWorks's // API operation SetTimeBasedAutoScaling for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/SetTimeBasedAutoScaling @@ -5175,11 +5177,11 @@ func (c *OpsWorks) StartInstanceRequest(input *StartInstanceInput) (req *request // See the AWS API reference guide for AWS OpsWorks's // API operation StartInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StartInstance @@ -5263,11 +5265,11 @@ func (c *OpsWorks) StartStackRequest(input *StartStackInput) (req *request.Reque // See the AWS API reference guide for AWS OpsWorks's // API operation StartStack for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StartStack @@ -5354,11 +5356,11 @@ func (c *OpsWorks) StopInstanceRequest(input *StopInstanceInput) (req *request.R // See the AWS API reference guide for AWS OpsWorks's // API operation StopInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StopInstance @@ -5442,11 +5444,11 @@ func (c *OpsWorks) StopStackRequest(input *StopStackInput) (req *request.Request // See the AWS API reference guide for AWS OpsWorks's // API operation StopStack for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/StopStack @@ -5527,11 +5529,11 @@ func (c *OpsWorks) TagResourceRequest(input *TagResourceInput) (req *request.Req // See the AWS API reference guide for AWS OpsWorks's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/TagResource @@ -5618,11 +5620,11 @@ func (c *OpsWorks) UnassignInstanceRequest(input *UnassignInstanceInput) (req *r // See the AWS API reference guide for AWS OpsWorks's // API operation UnassignInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UnassignInstance @@ -5707,11 +5709,11 @@ func (c *OpsWorks) UnassignVolumeRequest(input *UnassignVolumeInput) (req *reque // See the AWS API reference guide for AWS OpsWorks's // API operation UnassignVolume for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UnassignVolume @@ -5790,11 +5792,11 @@ func (c *OpsWorks) UntagResourceRequest(input *UntagResourceInput) (req *request // See the AWS API reference guide for AWS OpsWorks's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UntagResource @@ -5878,11 +5880,11 @@ func (c *OpsWorks) UpdateAppRequest(input *UpdateAppInput) (req *request.Request // See the AWS API reference guide for AWS OpsWorks's // API operation UpdateApp for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateApp @@ -5967,11 +5969,11 @@ func (c *OpsWorks) UpdateElasticIpRequest(input *UpdateElasticIpInput) (req *req // See the AWS API reference guide for AWS OpsWorks's // API operation UpdateElasticIp for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateElasticIp @@ -6055,11 +6057,11 @@ func (c *OpsWorks) UpdateInstanceRequest(input *UpdateInstanceInput) (req *reque // See the AWS API reference guide for AWS OpsWorks's // API operation UpdateInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateInstance @@ -6143,11 +6145,11 @@ func (c *OpsWorks) UpdateLayerRequest(input *UpdateLayerInput) (req *request.Req // See the AWS API reference guide for AWS OpsWorks's // API operation UpdateLayer for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateLayer @@ -6230,8 +6232,8 @@ func (c *OpsWorks) UpdateMyUserProfileRequest(input *UpdateMyUserProfileInput) ( // See the AWS API reference guide for AWS OpsWorks's // API operation UpdateMyUserProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateMyUserProfile @@ -6315,11 +6317,11 @@ func (c *OpsWorks) UpdateRdsDbInstanceRequest(input *UpdateRdsDbInstanceInput) ( // See the AWS API reference guide for AWS OpsWorks's // API operation UpdateRdsDbInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateRdsDbInstance @@ -6403,11 +6405,11 @@ func (c *OpsWorks) UpdateStackRequest(input *UpdateStackInput) (req *request.Req // See the AWS API reference guide for AWS OpsWorks's // API operation UpdateStack for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateStack @@ -6490,11 +6492,11 @@ func (c *OpsWorks) UpdateUserProfileRequest(input *UpdateUserProfileInput) (req // See the AWS API reference guide for AWS OpsWorks's // API operation UpdateUserProfile for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateUserProfile @@ -6579,11 +6581,11 @@ func (c *OpsWorks) UpdateVolumeRequest(input *UpdateVolumeInput) (req *request.R // See the AWS API reference guide for AWS OpsWorks's // API operation UpdateVolume for usage and error information. // -// Returned Error Codes: -// * ErrCodeValidationException "ValidationException" +// Returned Error Types: +// * ValidationException // Indicates that a request was not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Indicates that a resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/opsworks-2013-02-18/UpdateVolume @@ -14320,6 +14322,63 @@ func (s *ReportedOs) SetVersion(v string) *ReportedOs { return s } +// Indicates that a resource was not found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The exception message. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes a user's SSH information. type SelfUserProfile struct { _ struct{} `type:"structure"` @@ -17111,6 +17170,63 @@ func (s *UserProfile) SetSshUsername(v string) *UserProfile { return s } +// Indicates that a request was not valid. +type ValidationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The exception message. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ValidationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ValidationException) GoString() string { + return s.String() +} + +func newErrorValidationException(v protocol.ResponseMetadata) error { + return &ValidationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ValidationException) Code() string { + return "ValidationException" +} + +// Message returns the exception's message. +func (s ValidationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ValidationException) OrigErr() error { + return nil +} + +func (s ValidationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ValidationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ValidationException) RequestID() string { + return s.respMetadata.RequestID +} + // Describes an instance's Amazon EBS volume. type Volume struct { _ struct{} `type:"structure"` 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 index fc849646ccb..63a7e6a5c76 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/opsworks/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/opsworks/errors.go @@ -2,6 +2,10 @@ package opsworks +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeResourceNotFoundException for service response error code @@ -16,3 +20,8 @@ const ( // Indicates that a request was not valid. ErrCodeValidationException = "ValidationException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ValidationException": newErrorValidationException, +} 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 index a1a8307cae4..f319e652009 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/opsworks/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/opsworks/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "opsworks" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "OpsWorks" // ServiceID is a unique identifer of a specific service. + ServiceID = "OpsWorks" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the OpsWorks client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a OpsWorks client from just a session. // svc := opsworks.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *OpsWorks { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *OpsWorks { svc := &OpsWorks{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2013-02-18", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/organizations/api.go b/vendor/github.com/aws/aws-sdk-go/service/organizations/api.go index 7394f8e5dd4..9c061bfea10 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/organizations/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/organizations/api.go @@ -90,19 +90,19 @@ func (c *Organizations) AcceptHandshakeRequest(input *AcceptHandshakeInput) (req // See the AWS API reference guide for AWS Organizations's // API operation AcceptHandshake for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeHandshakeConstraintViolationException "HandshakeConstraintViolationException" +// * HandshakeConstraintViolationException // The requested operation would violate the constraint identified in the reason // code. // @@ -142,19 +142,19 @@ func (c *Organizations) AcceptHandshakeRequest(input *AcceptHandshakeInput) (req // account that doesn't have a payment instrument, such as a credit card, // associated with it. // -// * ErrCodeHandshakeNotFoundException "HandshakeNotFoundException" +// * HandshakeNotFoundException // We can't find a handshake with the HandshakeId that you specified. // -// * ErrCodeInvalidHandshakeTransitionException "InvalidHandshakeTransitionException" +// * InvalidHandshakeTransitionException // You can't perform the operation on the handshake in its current state. For // example, you can't cancel a handshake that was already accepted or accept // a handshake that was already declined. // -// * ErrCodeHandshakeAlreadyInStateException "HandshakeAlreadyInStateException" +// * HandshakeAlreadyInStateException // The specified handshake is already in the requested state. For example, you // can't accept a handshake that was already accepted. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -169,6 +169,8 @@ func (c *Organizations) AcceptHandshakeRequest(input *AcceptHandshakeInput) (req // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -218,15 +220,15 @@ func (c *Organizations) AcceptHandshakeRequest(input *AcceptHandshakeInput) (req // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -234,7 +236,7 @@ func (c *Organizations) AcceptHandshakeRequest(input *AcceptHandshakeInput) (req // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // -// * ErrCodeAccessDeniedForDependencyException "AccessDeniedForDependencyException" +// * AccessDeniedForDependencyException // The operation that you attempted requires you to have the iam:CreateServiceLinkedRole // for organizations.amazonaws.com permission so that AWS Organizations can // create the required service-linked role. You don't have that permission. @@ -307,34 +309,15 @@ func (c *Organizations) AttachPolicyRequest(input *AttachPolicyInput) (req *requ // AttachPolicy API operation for AWS Organizations. // // Attaches a policy to a root, an organizational unit (OU), or an individual -// account. How the policy affects accounts depends on the type of policy: -// -// * Service control policy (SCP) - An SCP specifies what permissions can -// be delegated to users in affected member accounts. The scope of influence -// for a policy depends on what you attach the policy to: If you attach an -// SCP to a root, it affects all accounts in the organization. If you attach -// an SCP to an OU, it affects all accounts in that OU and in any child OUs. -// If you attach the policy directly to an account, it affects only that -// account. SCPs are JSON policies that specify the maximum permissions for -// an organization or organizational unit (OU). You can attach one SCP to -// a higher level root or OU, and a different SCP to a child OU or to an -// account. The child policy can further restrict only the permissions that -// pass through the parent filter and are available to the child. An SCP -// that is attached to a child can't grant a permission that the parent hasn't -// already granted. For example, imagine that the parent SCP allows permissions -// A, B, C, D, and E. The child SCP allows C, D, E, F, and G. The result -// is that the accounts affected by the child SCP are allowed to use only -// C, D, and E. They can't use A or B because the child OU filtered them -// out. They also can't use F and G because the parent OU filtered them out. -// They can't be granted back by the child SCP; child SCPs can only filter -// the permissions they receive from the parent SCP. AWS Organizations attaches -// a default SCP named "FullAWSAccess to every root, OU, and account. This -// default SCP allows all services and actions, enabling any new child OU -// or account to inherit the permissions of the parent root or OU. If you -// detach the default policy, you must replace it with a policy that specifies -// the permissions that you want to allow in that OU or account. For more -// information about how AWS Organizations policies permissions work, see -// Using Service Control Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) +// account. +// +// How the policy affects accounts depends on the type of policy: +// +// * For more information about attaching SCPs, see How SCPs Work (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_about-scps.html) +// in the AWS Organizations User Guide. +// +// * For information about attaching tag policies, see How Policy Inheritance +// Works (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies-inheritance.html) // in the AWS Organizations User Guide. // // This operation can be called only from the organization's master account. @@ -346,29 +329,28 @@ func (c *Organizations) AttachPolicyRequest(input *AttachPolicyInput) (req *requ // See the AWS API reference guide for AWS Organizations's // API operation AttachPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -443,8 +425,8 @@ func (c *Organizations) AttachPolicyRequest(input *AttachPolicyInput) (req *requ // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -457,13 +439,18 @@ func (c *Organizations) AttachPolicyRequest(input *AttachPolicyInput) (req *requ // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeDuplicatePolicyAttachmentException "DuplicatePolicyAttachmentException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * DuplicatePolicyAttachmentException // The selected policy is already attached to the specified target. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -478,6 +465,8 @@ func (c *Organizations) AttachPolicyRequest(input *AttachPolicyInput) (req *requ // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -527,24 +516,24 @@ func (c *Organizations) AttachPolicyRequest(input *AttachPolicyInput) (req *requ // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodePolicyNotFoundException "PolicyNotFoundException" +// * PolicyNotFoundException // We can't find a policy with the PolicyId that you specified. // -// * ErrCodePolicyTypeNotEnabledException "PolicyTypeNotEnabledException" +// * PolicyTypeNotEnabledException // The specified policy type isn't currently enabled in this root. You can't // attach policies of the specified type to entities in a root until you enable // that type in the root. For more information, see Enabling All Features in // Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) // in the AWS Organizations User Guide. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTargetNotFoundException "TargetNotFoundException" +// * TargetNotFoundException // We can't find a root, OU, or account with the TargetId that you specified. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -552,6 +541,13 @@ func (c *Organizations) AttachPolicyRequest(input *AttachPolicyInput) (req *requ // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // +// * UnsupportedAPIEndpointException +// This action isn't available in the current Region. +// +// * PolicyChangesInProgressException +// Changes to the effective policy are in progress, and its contents can't be +// returned. Try the operation again later. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/AttachPolicy func (c *Organizations) AttachPolicy(input *AttachPolicyInput) (*AttachPolicyOutput, error) { req, out := c.AttachPolicyRequest(input) @@ -635,31 +631,31 @@ func (c *Organizations) CancelHandshakeRequest(input *CancelHandshakeInput) (req // See the AWS API reference guide for AWS Organizations's // API operation CancelHandshake for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeHandshakeNotFoundException "HandshakeNotFoundException" +// * HandshakeNotFoundException // We can't find a handshake with the HandshakeId that you specified. // -// * ErrCodeInvalidHandshakeTransitionException "InvalidHandshakeTransitionException" +// * InvalidHandshakeTransitionException // You can't perform the operation on the handshake in its current state. For // example, you can't cancel a handshake that was already accepted or accept // a handshake that was already declined. // -// * ErrCodeHandshakeAlreadyInStateException "HandshakeAlreadyInStateException" +// * HandshakeAlreadyInStateException // The specified handshake is already in the requested state. For example, you // can't accept a handshake that was already accepted. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -674,6 +670,8 @@ func (c *Organizations) CancelHandshakeRequest(input *CancelHandshakeInput) (req // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -723,11 +721,11 @@ func (c *Organizations) CancelHandshakeRequest(input *CancelHandshakeInput) (req // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -836,13 +834,13 @@ func (c *Organizations) CreateAccountRequest(input *CreateAccountInput) (req *re // in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html) // in the AWS Organizations User Guide. // -// * When you create an account in an organization using the AWS Organizations -// console, API, or CLI commands, the information required for the account -// to operate as a standalone account, such as a payment method and signing -// the end user license agreement (EULA) is not automatically collected. -// If you must remove an account from your organization later, you can do -// so only after you provide the missing information. Follow the steps at -// To leave an organization as a member account (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// * When you create an account in an organization, the information required +// for the account to operate as a standalone account is not automatically +// collected. For example, information about the payment method and signing +// the end user license agreement (EULA) is not collected. If you must remove +// an account from your organization later, you can do so only after you +// provide the missing information. Follow the steps at To leave an organization +// as a member account (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) // in the AWS Organizations User Guide. // // * If you get an exception that indicates that you exceeded your account @@ -873,29 +871,28 @@ func (c *Organizations) CreateAccountRequest(input *CreateAccountInput) (req *re // See the AWS API reference guide for AWS Organizations's // API operation CreateAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -970,8 +967,8 @@ func (c *Organizations) CreateAccountRequest(input *CreateAccountInput) (req *re // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -984,10 +981,15 @@ func (c *Organizations) CreateAccountRequest(input *CreateAccountInput) (req *re // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -1002,6 +1004,8 @@ func (c *Organizations) CreateAccountRequest(input *CreateAccountInput) (req *re // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -1051,17 +1055,17 @@ func (c *Organizations) CreateAccountRequest(input *CreateAccountInput) (req *re // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeFinalizingOrganizationException "FinalizingOrganizationException" +// * FinalizingOrganizationException // AWS Organizations couldn't perform the operation because your organization // hasn't finished initializing. This can take up to an hour. Try again later. // If after one hour you continue to receive this error, contact AWS Support // (https://console.aws.amazon.com/support/home#/). // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -1069,7 +1073,7 @@ func (c *Organizations) CreateAccountRequest(input *CreateAccountInput) (req *re // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // -// * ErrCodeUnsupportedAPIEndpointException "UnsupportedAPIEndpointException" +// * UnsupportedAPIEndpointException // This action isn't available in the current Region. // // See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateAccount @@ -1198,8 +1202,8 @@ func (c *Organizations) CreateGovCloudAccountRequest(input *CreateGovCloudAccoun // the master account in the organization in the commercial Region to assume // it. An AWS GovCloud (US) account is then created and associated with the // commercial account that you just created. A role is created in the new AWS -// GovCloud (US) account that can be assumed by the AWS GovCloud (US) account -// that is associated with the master account of the commercial organization. +// GovCloud (US) account. This role can be assumed by the AWS GovCloud (US) +// account that is associated with the master account of the commercial organization. // For more information and to view a diagram that explains how account access // works, see AWS Organizations (http://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) // in the AWS GovCloud User Guide. @@ -1208,13 +1212,12 @@ func (c *Organizations) CreateGovCloudAccountRequest(input *CreateGovCloudAccoun // in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html) // in the AWS Organizations User Guide. // -// * When you create an account in an organization using the AWS Organizations -// console, API, or CLI commands, the information required for the account -// to operate as a standalone account, such as a payment method and signing -// the end user license agreement (EULA) is not automatically collected. -// If you must remove an account from your organization later, you can do -// so only after you provide the missing information. Follow the steps at -// To leave an organization as a member account (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// * You can create an account in an organization using the AWS Organizations +// console, API, or CLI commands. When you do, the information required for +// the account to operate as a standalone account, such as a payment method, +// is not automatically collected. If you must remove an account from your +// organization later, you can do so only after you provide the missing information. +// Follow the steps at To leave an organization as a member account (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) // in the AWS Organizations User Guide. // // * If you get an exception that indicates that you exceeded your account @@ -1246,29 +1249,28 @@ func (c *Organizations) CreateGovCloudAccountRequest(input *CreateGovCloudAccoun // See the AWS API reference guide for AWS Organizations's // API operation CreateGovCloudAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -1343,8 +1345,8 @@ func (c *Organizations) CreateGovCloudAccountRequest(input *CreateGovCloudAccoun // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -1357,10 +1359,15 @@ func (c *Organizations) CreateGovCloudAccountRequest(input *CreateGovCloudAccoun // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -1375,6 +1382,8 @@ func (c *Organizations) CreateGovCloudAccountRequest(input *CreateGovCloudAccoun // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -1424,17 +1433,17 @@ func (c *Organizations) CreateGovCloudAccountRequest(input *CreateGovCloudAccoun // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeFinalizingOrganizationException "FinalizingOrganizationException" +// * FinalizingOrganizationException // AWS Organizations couldn't perform the operation because your organization // hasn't finished initializing. This can take up to an hour. Try again later. // If after one hour you continue to receive this error, contact AWS Support // (https://console.aws.amazon.com/support/home#/). // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -1442,7 +1451,7 @@ func (c *Organizations) CreateGovCloudAccountRequest(input *CreateGovCloudAccoun // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // -// * ErrCodeUnsupportedAPIEndpointException "UnsupportedAPIEndpointException" +// * UnsupportedAPIEndpointException // This action isn't available in the current Region. // // See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateGovCloudAccount @@ -1520,11 +1529,10 @@ func (c *Organizations) CreateOrganizationRequest(input *CreateOrganizationInput // have the relevant IAM permissions. // // By default (or if you set the FeatureSet parameter to ALL), the new organization -// is created with all features enabled and service control policies automatically -// enabled in the root. If you instead choose to create the organization supporting -// only the consolidated billing features by setting the FeatureSet parameter -// to CONSOLIDATED_BILLING", no policy types are enabled by default, and you -// can't use organization policies. +// is created with all features enabled. In addition, service control policies +// are automatically enabled in the root. If you instead create the organization +// supporting only the consolidated billing features, no policy types are enabled +// by default, and you can't use organization 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 @@ -1533,29 +1541,28 @@ func (c *Organizations) CreateOrganizationRequest(input *CreateOrganizationInput // See the AWS API reference guide for AWS Organizations's // API operation CreateOrganization for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAlreadyInOrganizationException "AlreadyInOrganizationException" +// * AlreadyInOrganizationException // This account is already a member of an organization. An account can belong // to only one organization at a time. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -1630,8 +1637,8 @@ func (c *Organizations) CreateOrganizationRequest(input *CreateOrganizationInput // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -1644,10 +1651,15 @@ func (c *Organizations) CreateOrganizationRequest(input *CreateOrganizationInput // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -1662,6 +1674,8 @@ func (c *Organizations) CreateOrganizationRequest(input *CreateOrganizationInput // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -1711,11 +1725,11 @@ func (c *Organizations) CreateOrganizationRequest(input *CreateOrganizationInput // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -1723,7 +1737,7 @@ func (c *Organizations) CreateOrganizationRequest(input *CreateOrganizationInput // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // -// * ErrCodeAccessDeniedForDependencyException "AccessDeniedForDependencyException" +// * AccessDeniedForDependencyException // The operation that you attempted requires you to have the iam:CreateServiceLinkedRole // for organizations.amazonaws.com permission so that AWS Organizations can // create the required service-linked role. You don't have that permission. @@ -1812,29 +1826,28 @@ func (c *Organizations) CreateOrganizationalUnitRequest(input *CreateOrganizatio // See the AWS API reference guide for AWS Organizations's // API operation CreateOrganizationalUnit for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -1909,8 +1922,8 @@ func (c *Organizations) CreateOrganizationalUnitRequest(input *CreateOrganizatio // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -1923,13 +1936,18 @@ func (c *Organizations) CreateOrganizationalUnitRequest(input *CreateOrganizatio // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeDuplicateOrganizationalUnitException "DuplicateOrganizationalUnitException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * DuplicateOrganizationalUnitException // An OU with the same name already exists. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -1944,6 +1962,8 @@ func (c *Organizations) CreateOrganizationalUnitRequest(input *CreateOrganizatio // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -1993,14 +2013,14 @@ func (c *Organizations) CreateOrganizationalUnitRequest(input *CreateOrganizatio // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeParentNotFoundException "ParentNotFoundException" +// * ParentNotFoundException // We can't find a root or OU with the ParentId that you specified. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -2089,29 +2109,28 @@ func (c *Organizations) CreatePolicyRequest(input *CreatePolicyInput) (req *requ // See the AWS API reference guide for AWS Organizations's // API operation CreatePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -2186,8 +2205,8 @@ func (c *Organizations) CreatePolicyRequest(input *CreatePolicyInput) (req *requ // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -2200,13 +2219,18 @@ func (c *Organizations) CreatePolicyRequest(input *CreatePolicyInput) (req *requ // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeDuplicatePolicyException "DuplicatePolicyException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * DuplicatePolicyException // A policy with the same name already exists. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -2221,6 +2245,8 @@ func (c *Organizations) CreatePolicyRequest(input *CreatePolicyInput) (req *requ // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -2270,24 +2296,24 @@ func (c *Organizations) CreatePolicyRequest(input *CreatePolicyInput) (req *requ // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocumentException" +// * MalformedPolicyDocumentException // The provided policy document doesn't meet the requirements of the specified // policy type. For example, the syntax might be incorrect. For details about // service control policy syntax, see Service Control Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) // in the AWS Organizations User Guide. // -// * ErrCodePolicyTypeNotAvailableForOrganizationException "PolicyTypeNotAvailableForOrganizationException" +// * PolicyTypeNotAvailableForOrganizationException // You can't use the specified policy type with the feature set currently enabled // for this organization. For example, you can enable SCPs only after you enable // all features in the organization. For more information, see Enabling and // Disabling a Policy Type on a Root (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html#enable_policies_on_root) // in the AWS Organizations User Guide. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -2295,6 +2321,9 @@ func (c *Organizations) CreatePolicyRequest(input *CreatePolicyInput) (req *requ // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // +// * UnsupportedAPIEndpointException +// This action isn't available in the current Region. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreatePolicy func (c *Organizations) CreatePolicy(input *CreatePolicyInput) (*CreatePolicyOutput, error) { req, out := c.CreatePolicyRequest(input) @@ -2370,7 +2399,7 @@ func (c *Organizations) DeclineHandshakeRequest(input *DeclineHandshakeInput) (r // a new handshake request. // // After you decline a handshake, it continues to appear in the results of relevant -// APIs for only 30 days. After that, it's deleted. +// API operations for only 30 days. After that, it's 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 @@ -2379,31 +2408,31 @@ func (c *Organizations) DeclineHandshakeRequest(input *DeclineHandshakeInput) (r // See the AWS API reference guide for AWS Organizations's // API operation DeclineHandshake for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeHandshakeNotFoundException "HandshakeNotFoundException" +// * HandshakeNotFoundException // We can't find a handshake with the HandshakeId that you specified. // -// * ErrCodeInvalidHandshakeTransitionException "InvalidHandshakeTransitionException" +// * InvalidHandshakeTransitionException // You can't perform the operation on the handshake in its current state. For // example, you can't cancel a handshake that was already accepted or accept // a handshake that was already declined. // -// * ErrCodeHandshakeAlreadyInStateException "HandshakeAlreadyInStateException" +// * HandshakeAlreadyInStateException // The specified handshake is already in the requested state. For example, you // can't accept a handshake that was already accepted. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -2418,6 +2447,8 @@ func (c *Organizations) DeclineHandshakeRequest(input *DeclineHandshakeInput) (r // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -2467,11 +2498,11 @@ func (c *Organizations) DeclineHandshakeRequest(input *DeclineHandshakeInput) (r // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -2556,23 +2587,23 @@ func (c *Organizations) DeleteOrganizationRequest(input *DeleteOrganizationInput // See the AWS API reference guide for AWS Organizations's // API operation DeleteOrganization for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -2587,6 +2618,8 @@ func (c *Organizations) DeleteOrganizationRequest(input *DeleteOrganizationInput // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -2636,15 +2669,15 @@ func (c *Organizations) DeleteOrganizationRequest(input *DeleteOrganizationInput // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeOrganizationNotEmptyException "OrganizationNotEmptyException" +// * OrganizationNotEmptyException // The organization isn't empty. To delete an organization, you must first remove // all accounts except the master account, delete all OUs, and delete all policies. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -2731,23 +2764,23 @@ func (c *Organizations) DeleteOrganizationalUnitRequest(input *DeleteOrganizatio // See the AWS API reference guide for AWS Organizations's // API operation DeleteOrganizationalUnit for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -2762,6 +2795,8 @@ func (c *Organizations) DeleteOrganizationalUnitRequest(input *DeleteOrganizatio // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -2811,18 +2846,18 @@ func (c *Organizations) DeleteOrganizationalUnitRequest(input *DeleteOrganizatio // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeOrganizationalUnitNotEmptyException "OrganizationalUnitNotEmptyException" +// * OrganizationalUnitNotEmptyException // The specified OU is not empty. Move all accounts to another root or to other // OUs, remove all child OUs, and try the operation again. // -// * ErrCodeOrganizationalUnitNotFoundException "OrganizationalUnitNotFoundException" +// * OrganizationalUnitNotFoundException // We can't find an OU with the OrganizationalUnitId that you specified. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -2910,23 +2945,23 @@ func (c *Organizations) DeletePolicyRequest(input *DeletePolicyInput) (req *requ // See the AWS API reference guide for AWS Organizations's // API operation DeletePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -2941,6 +2976,8 @@ func (c *Organizations) DeletePolicyRequest(input *DeletePolicyInput) (req *requ // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -2990,18 +3027,18 @@ func (c *Organizations) DeletePolicyRequest(input *DeletePolicyInput) (req *requ // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodePolicyInUseException "PolicyInUseException" +// * PolicyInUseException // The policy is attached to one or more entities. You must detach it from all // roots, OUs, and accounts before performing this operation. // -// * ErrCodePolicyNotFoundException "PolicyNotFoundException" +// * PolicyNotFoundException // We can't find a policy with the PolicyId that you specified. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -3009,6 +3046,9 @@ func (c *Organizations) DeletePolicyRequest(input *DeletePolicyInput) (req *requ // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // +// * UnsupportedAPIEndpointException +// This action isn't available in the current Region. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeletePolicy func (c *Organizations) DeletePolicy(input *DeletePolicyInput) (*DeletePolicyOutput, error) { req, out := c.DeletePolicyRequest(input) @@ -3075,7 +3115,7 @@ func (c *Organizations) DescribeAccountRequest(input *DescribeAccountInput) (req // DescribeAccount API operation for AWS Organizations. // -// Retrieves AWS Organizations-related information about the specified account. +// Retrieves AWS Organizations related information about the specified account. // // This operation can be called only from the organization's master account. // @@ -3086,24 +3126,24 @@ func (c *Organizations) DescribeAccountRequest(input *DescribeAccountInput) (req // See the AWS API reference guide for AWS Organizations's // API operation DescribeAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAccountNotFoundException "AccountNotFoundException" -// We can't find an AWS account with the AccountId that you specified, or the +// * AccountNotFoundException +// We can't find an AWS account with the AccountId that you specified. Or the // account whose credentials you used to make this request isn't a member of // an organization. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -3118,6 +3158,8 @@ func (c *Organizations) DescribeAccountRequest(input *DescribeAccountInput) (req // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -3167,11 +3209,11 @@ func (c *Organizations) DescribeAccountRequest(input *DescribeAccountInput) (req // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -3256,23 +3298,23 @@ func (c *Organizations) DescribeCreateAccountStatusRequest(input *DescribeCreate // See the AWS API reference guide for AWS Organizations's // API operation DescribeCreateAccountStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeCreateAccountStatusNotFoundException "CreateAccountStatusNotFoundException" -// We can't find an create account request with the CreateAccountRequestId that +// * CreateAccountStatusNotFoundException +// We can't find a create account request with the CreateAccountRequestId that // you specified. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -3287,6 +3329,8 @@ func (c *Organizations) DescribeCreateAccountStatusRequest(input *DescribeCreate // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -3336,11 +3380,11 @@ func (c *Organizations) DescribeCreateAccountStatusRequest(input *DescribeCreate // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -3348,7 +3392,7 @@ func (c *Organizations) DescribeCreateAccountStatusRequest(input *DescribeCreate // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // -// * ErrCodeUnsupportedAPIEndpointException "UnsupportedAPIEndpointException" +// * UnsupportedAPIEndpointException // This action isn't available in the current Region. // // See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeCreateAccountStatus @@ -3373,57 +3417,59 @@ func (c *Organizations) DescribeCreateAccountStatusWithContext(ctx aws.Context, return out, req.Send() } -const opDescribeHandshake = "DescribeHandshake" +const opDescribeEffectivePolicy = "DescribeEffectivePolicy" -// DescribeHandshakeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeHandshake operation. The "output" return +// DescribeEffectivePolicyRequest generates a "aws/request.Request" representing the +// client's request for the DescribeEffectivePolicy operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeHandshake for more information on using the DescribeHandshake +// See DescribeEffectivePolicy for more information on using the DescribeEffectivePolicy // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeHandshakeRequest method. -// req, resp := client.DescribeHandshakeRequest(params) +// // Example sending a request using the DescribeEffectivePolicyRequest method. +// req, resp := client.DescribeEffectivePolicyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeHandshake -func (c *Organizations) DescribeHandshakeRequest(input *DescribeHandshakeInput) (req *request.Request, output *DescribeHandshakeOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeEffectivePolicy +func (c *Organizations) DescribeEffectivePolicyRequest(input *DescribeEffectivePolicyInput) (req *request.Request, output *DescribeEffectivePolicyOutput) { op := &request.Operation{ - Name: opDescribeHandshake, + Name: opDescribeEffectivePolicy, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeHandshakeInput{} + input = &DescribeEffectivePolicyInput{} } - output = &DescribeHandshakeOutput{} + output = &DescribeEffectivePolicyOutput{} req = c.newRequest(op, input, output) return } -// DescribeHandshake API operation for AWS Organizations. +// DescribeEffectivePolicy API operation for AWS Organizations. // -// Retrieves information about a previously requested handshake. The handshake -// ID comes from the response to the original InviteAccountToOrganization operation -// that generated the handshake. +// Returns the contents of the effective tag policy for the account. The effective +// tag policy is the aggregation of any tag policies the account inherits, plus +// any policy directly that is attached to the account. // -// You can access handshakes that are ACCEPTED, DECLINED, or CANCELED for only -// 30 days after they change to that state. They're then deleted and no longer -// accessible. +// This action returns information on tag policies only. +// +// For more information on policy inheritance, see How Policy Inheritance Works +// (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies-inheritance.html) +// in the AWS Organizations User Guide. // // This operation can be called from any account in the organization. // @@ -3432,24 +3478,144 @@ func (c *Organizations) DescribeHandshakeRequest(input *DescribeHandshakeInput) // the error. // // See the AWS API reference guide for AWS Organizations's -// API operation DescribeHandshake for usage and error information. +// API operation DescribeEffectivePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" -// The target of the operation is currently being modified by a different request. -// Try again later. +// * AWSOrganizationsNotInUseException +// Your account isn't a member of an organization. To make this request, you +// must use the credentials of an account that belongs to an organization. // -// * ErrCodeHandshakeNotFoundException "HandshakeNotFoundException" -// We can't find a handshake with the HandshakeId that you specified. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. +// +// Some of the reasons in the following list might not be applicable to this +// specific API or operation: +// +// * ACCOUNT_CANNOT_LEAVE_WITHOUT_EULA: You attempted to remove an account +// from the organization that doesn't yet have enough information to exist +// as a standalone account. This account requires you to first agree to the +// AWS Customer Agreement. Follow the steps at To leave an organization when +// all required account information has not yet been provided (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// in the AWS Organizations User Guide. +// +// * ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove +// an account from the organization that doesn't yet have enough information +// to exist as a standalone account. This account requires you to first complete +// phone verification. Follow the steps at To leave an organization when +// all required account information has not yet been provided (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// in the AWS Organizations User Guide. +// +// * ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number +// of accounts that you can create in one day. +// +// * ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on +// the number of accounts in an organization. If you need more accounts, +// contact AWS Support (https://console.aws.amazon.com/support/home#/) to +// request an increase in your limit. Or the number of invitations that you +// tried to send would cause you to exceed the limit of accounts in your +// organization. Send fewer invitations or contact AWS Support to request +// an increase in the number of accounts. Deleted and closed accounts still +// count toward your limit. If you get receive this exception when running +// a command immediately after creating the organization, wait one hour and +// try again. If after an hour it continues to fail with this error, contact +// AWS Support (https://console.aws.amazon.com/support/home#/). +// +// * HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of +// handshakes that you can send in one day. +// +// * MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account +// in this organization, you first must migrate the organization's master +// account to the marketplace that corresponds to the master account's address. +// For example, accounts with India addresses must be associated with the +// AISPL marketplace. All accounts in an organization must be associated +// with the same marketplace. +// +// * MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you +// must first provide contact a valid address and phone number for the master +// account. Then try the operation again. +// +// * MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the +// master account must have an associated account in the AWS GovCloud (US-West) +// Region. For more information, see AWS Organizations (http://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) +// in the AWS GovCloud User Guide. +// +// * MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization +// with this master account, you first must associate a valid payment instrument, +// such as a credit card, with the account. Follow the steps at To leave +// an organization when all required account information has not yet been +// provided (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// in the AWS Organizations User Guide. +// +// * MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the +// number of policies of a certain type that can be attached to an entity +// at one time. +// +// * MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed +// on this resource. +// +// * MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation +// with this member account, you first must associate a valid payment instrument, +// such as a credit card, with the account. Follow the steps at To leave +// an organization when all required account information has not yet been +// provided (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// in the AWS Organizations User Guide. +// +// * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. +// +// * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is +// too many levels deep. +// +// * ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation +// that requires the organization to be configured to support all features. +// An organization that supports only consolidated billing features can't +// perform this operation. +// +// * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs +// that you can have in an organization. +// +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of +// policies that you can have in an organization. +// +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * ServiceException +// AWS Organizations can't complete your request because of an internal service +// error. Try again later. +// +// * TooManyRequestsException +// You have sent too many requests in too short a period of time. The limit +// helps protect against denial-of-service attacks. Try again later. +// +// For information on limits that affect AWS Organizations, see Limits of AWS +// Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) +// in the AWS Organizations User Guide. +// +// * TargetNotFoundException +// We can't find a root, OU, or account with the TargetId that you specified. +// +// * EffectivePolicyNotFoundException +// If you ran this action on the master account, this policy type is not enabled. +// If you ran the action on a member account, the account doesn't have an effective +// policy of this type. Contact the administrator of your organization about +// attaching a policy of this type to the account. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -3464,6 +3630,8 @@ func (c *Organizations) DescribeHandshakeRequest(input *DescribeHandshakeInput) // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -3513,144 +3681,311 @@ func (c *Organizations) DescribeHandshakeRequest(input *DescribeHandshakeInput) // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" -// AWS Organizations can't complete your request because of an internal service -// error. Try again later. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// You have sent too many requests in too short a period of time. The limit -// helps protect against denial-of-service attacks. Try again later. -// -// For information on limits that affect AWS Organizations, see Limits of AWS -// Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) -// in the AWS Organizations User Guide. +// * UnsupportedAPIEndpointException +// This action isn't available in the current Region. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeHandshake -func (c *Organizations) DescribeHandshake(input *DescribeHandshakeInput) (*DescribeHandshakeOutput, error) { - req, out := c.DescribeHandshakeRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeEffectivePolicy +func (c *Organizations) DescribeEffectivePolicy(input *DescribeEffectivePolicyInput) (*DescribeEffectivePolicyOutput, error) { + req, out := c.DescribeEffectivePolicyRequest(input) return out, req.Send() } -// DescribeHandshakeWithContext is the same as DescribeHandshake with the addition of +// DescribeEffectivePolicyWithContext is the same as DescribeEffectivePolicy with the addition of // the ability to pass a context and additional request options. // -// See DescribeHandshake for details on how to use this API operation. +// See DescribeEffectivePolicy for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Organizations) DescribeHandshakeWithContext(ctx aws.Context, input *DescribeHandshakeInput, opts ...request.Option) (*DescribeHandshakeOutput, error) { - req, out := c.DescribeHandshakeRequest(input) +func (c *Organizations) DescribeEffectivePolicyWithContext(ctx aws.Context, input *DescribeEffectivePolicyInput, opts ...request.Option) (*DescribeEffectivePolicyOutput, error) { + req, out := c.DescribeEffectivePolicyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeOrganization = "DescribeOrganization" +const opDescribeHandshake = "DescribeHandshake" -// DescribeOrganizationRequest generates a "aws/request.Request" representing the -// client's request for the DescribeOrganization operation. The "output" return +// DescribeHandshakeRequest generates a "aws/request.Request" representing the +// client's request for the DescribeHandshake operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeOrganization for more information on using the DescribeOrganization +// See DescribeHandshake for more information on using the DescribeHandshake // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeOrganizationRequest method. -// req, resp := client.DescribeOrganizationRequest(params) +// // Example sending a request using the DescribeHandshakeRequest method. +// req, resp := client.DescribeHandshakeRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeOrganization -func (c *Organizations) DescribeOrganizationRequest(input *DescribeOrganizationInput) (req *request.Request, output *DescribeOrganizationOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeHandshake +func (c *Organizations) DescribeHandshakeRequest(input *DescribeHandshakeInput) (req *request.Request, output *DescribeHandshakeOutput) { op := &request.Operation{ - Name: opDescribeOrganization, + Name: opDescribeHandshake, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeOrganizationInput{} + input = &DescribeHandshakeInput{} } - output = &DescribeOrganizationOutput{} + output = &DescribeHandshakeOutput{} req = c.newRequest(op, input, output) return } -// DescribeOrganization API operation for AWS Organizations. +// DescribeHandshake API operation for AWS Organizations. // -// Retrieves information about the organization that the user's account belongs -// to. +// Retrieves information about a previously requested handshake. The handshake +// ID comes from the response to the original InviteAccountToOrganization operation +// that generated the handshake. // -// This operation can be called from any account in the organization. +// You can access handshakes that are ACCEPTED, DECLINED, or CANCELED for only +// 30 days after they change to that state. They're then deleted and no longer +// accessible. // -// Even if a policy type is shown as available in the organization, you can -// disable it separately at the root level with DisablePolicyType. Use ListRoots -// to see the status of policy types for a specified root. +// This operation can be called from any account in the organization. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS Organizations's -// API operation DescribeOrganization for usage and error information. +// API operation DescribeHandshake for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeServiceException "ServiceException" -// AWS Organizations can't complete your request because of an internal service -// error. Try again later. +// * HandshakeNotFoundException +// We can't find a handshake with the HandshakeId that you specified. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// You have sent too many requests in too short a period of time. The limit -// helps protect against denial-of-service attacks. Try again later. +// * InvalidInputException +// The requested operation failed because you provided invalid values for one +// or more of the request parameters. This exception includes a reason that +// contains additional information about the violated limit: // -// For information on limits that affect AWS Organizations, see Limits of AWS -// Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) -// in the AWS Organizations User Guide. +// Some of the reasons in the following list might not be applicable to this +// specific API or operation: // -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeOrganization -func (c *Organizations) DescribeOrganization(input *DescribeOrganizationInput) (*DescribeOrganizationOutput, error) { - req, out := c.DescribeOrganizationRequest(input) - return out, req.Send() -} - -// DescribeOrganizationWithContext is the same as DescribeOrganization with the addition of -// the ability to pass a context and additional request options. +// * IMMUTABLE_POLICY: You specified a policy that is managed by AWS and +// can't be modified. // -// See DescribeOrganization for details on how to use this API operation. +// * INPUT_REQUIRED: You must include a value for all required parameters. // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DescribeOrganizationWithContext(ctx aws.Context, input *DescribeOrganizationInput, opts ...request.Option) (*DescribeOrganizationOutput, error) { +// * INVALID_ENUM: You specified an invalid value. +// +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// +// * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid +// characters. +// +// * INVALID_LIST_MEMBER: You provided a list to a parameter that contains +// at least one invalid value. +// +// * INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter +// from the response to a previous call of the operation. +// +// * INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, +// organization, or email) as a party. +// +// * INVALID_PATTERN: You provided a value that doesn't match the required +// pattern. +// +// * INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't +// match the required pattern. +// +// * INVALID_ROLE_NAME: You provided a role name that isn't valid. A role +// name can't begin with the reserved prefix AWSServiceRoleFor. +// +// * INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource +// Name (ARN) for the organization. +// +// * INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. +// +// * INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system +// tag. You can’t add, edit, or delete system tag keys because they're +// reserved for AWS use. System tags don’t count against your tags per +// resource limit. +// +// * MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter +// for the operation. +// +// * MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer +// than allowed. +// +// * MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger +// value than allowed. +// +// * MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter +// than allowed. +// +// * MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller +// value than allowed. +// +// * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only +// between entities in the same root. +// +// * ServiceException +// AWS Organizations can't complete your request because of an internal service +// error. Try again later. +// +// * TooManyRequestsException +// You have sent too many requests in too short a period of time. The limit +// helps protect against denial-of-service attacks. Try again later. +// +// For information on limits that affect AWS Organizations, see Limits of AWS +// Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) +// in the AWS Organizations User Guide. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeHandshake +func (c *Organizations) DescribeHandshake(input *DescribeHandshakeInput) (*DescribeHandshakeOutput, error) { + req, out := c.DescribeHandshakeRequest(input) + return out, req.Send() +} + +// DescribeHandshakeWithContext is the same as DescribeHandshake with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeHandshake for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Organizations) DescribeHandshakeWithContext(ctx aws.Context, input *DescribeHandshakeInput, opts ...request.Option) (*DescribeHandshakeOutput, error) { + req, out := c.DescribeHandshakeRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeOrganization = "DescribeOrganization" + +// DescribeOrganizationRequest generates a "aws/request.Request" representing the +// client's request for the DescribeOrganization operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeOrganization for more information on using the DescribeOrganization +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeOrganizationRequest method. +// req, resp := client.DescribeOrganizationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeOrganization +func (c *Organizations) DescribeOrganizationRequest(input *DescribeOrganizationInput) (req *request.Request, output *DescribeOrganizationOutput) { + op := &request.Operation{ + Name: opDescribeOrganization, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeOrganizationInput{} + } + + output = &DescribeOrganizationOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeOrganization API operation for AWS Organizations. +// +// Retrieves information about the organization that the user's account belongs +// to. +// +// This operation can be called from any account in the organization. +// +// Even if a policy type is shown as available in the organization, you can +// disable it separately at the root level with DisablePolicyType. Use ListRoots +// to see the status of policy types for a specified root. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Organizations's +// API operation DescribeOrganization for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have permissions to perform the requested operation. The user or +// role that is making the request must have at least one IAM permissions policy +// attached that grants the required permissions. For more information, see +// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) +// in the IAM User Guide. +// +// * AWSOrganizationsNotInUseException +// Your account isn't a member of an organization. To make this request, you +// must use the credentials of an account that belongs to an organization. +// +// * ConcurrentModificationException +// The target of the operation is currently being modified by a different request. +// Try again later. +// +// * ServiceException +// AWS Organizations can't complete your request because of an internal service +// error. Try again later. +// +// * TooManyRequestsException +// You have sent too many requests in too short a period of time. The limit +// helps protect against denial-of-service attacks. Try again later. +// +// For information on limits that affect AWS Organizations, see Limits of AWS +// Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) +// in the AWS Organizations User Guide. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeOrganization +func (c *Organizations) DescribeOrganization(input *DescribeOrganizationInput) (*DescribeOrganizationOutput, error) { + req, out := c.DescribeOrganizationRequest(input) + return out, req.Send() +} + +// DescribeOrganizationWithContext is the same as DescribeOrganization with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeOrganization for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Organizations) DescribeOrganizationWithContext(ctx aws.Context, input *DescribeOrganizationInput, opts ...request.Option) (*DescribeOrganizationOutput, error) { req, out := c.DescribeOrganizationRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) @@ -3712,19 +4047,19 @@ func (c *Organizations) DescribeOrganizationalUnitRequest(input *DescribeOrganiz // See the AWS API reference guide for AWS Organizations's // API operation DescribeOrganizationalUnit for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -3739,6 +4074,8 @@ func (c *Organizations) DescribeOrganizationalUnitRequest(input *DescribeOrganiz // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -3788,14 +4125,14 @@ func (c *Organizations) DescribeOrganizationalUnitRequest(input *DescribeOrganiz // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeOrganizationalUnitNotFoundException "OrganizationalUnitNotFoundException" +// * OrganizationalUnitNotFoundException // We can't find an OU with the OrganizationalUnitId that you specified. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -3880,19 +4217,19 @@ func (c *Organizations) DescribePolicyRequest(input *DescribePolicyInput) (req * // See the AWS API reference guide for AWS Organizations's // API operation DescribePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -3907,6 +4244,8 @@ func (c *Organizations) DescribePolicyRequest(input *DescribePolicyInput) (req * // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -3956,14 +4295,14 @@ func (c *Organizations) DescribePolicyRequest(input *DescribePolicyInput) (req * // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodePolicyNotFoundException "PolicyNotFoundException" +// * PolicyNotFoundException // We can't find a policy with the PolicyId that you specified. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -3971,6 +4310,9 @@ func (c *Organizations) DescribePolicyRequest(input *DescribePolicyInput) (req * // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // +// * UnsupportedAPIEndpointException +// This action isn't available in the current Region. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribePolicy func (c *Organizations) DescribePolicy(input *DescribePolicyInput) (*DescribePolicyOutput, error) { req, out := c.DescribePolicyRequest(input) @@ -4042,15 +4384,16 @@ func (c *Organizations) DetachPolicyRequest(input *DetachPolicyInput) (req *requ // If the policy being detached is a service control policy (SCP), the changes // to permissions for IAM users and roles in affected accounts are immediate. // -// Note: Every root, OU, and account must have at least one SCP attached. If -// you want to replace the default FullAWSAccess policy with one that limits -// the permissions that can be delegated, you must attach the replacement policy +// Note: Every root, OU, and account must have at least one SCP attached. You +// can replace the default FullAWSAccess policy with one that limits the permissions +// that can be delegated. To do that, you must attach the replacement policy // before you can remove the default one. This is the authorization strategy -// of whitelisting (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_about-scps.html#orgs_policies_whitelist). -// If you instead attach a second SCP and leave the FullAWSAccess SCP still -// attached, and specify "Effect": "Deny" in the second SCP to override the -// "Effect": "Allow" in the FullAWSAccess policy (or any other attached SCP), -// you're using the authorization strategy of blacklisting (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_about-scps.html#orgs_policies_blacklist) . +// of using an allow list (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_about-scps.html#orgs_policies_whitelist). +// You could instead attach a second SCP and leave the FullAWSAccess SCP still +// attached. You could then specify "Effect": "Deny" in the second SCP to override +// the "Effect": "Allow" in the FullAWSAccess policy (or any other attached +// SCP). If you take these steps, you're using the authorization strategy of +// a deny list (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_about-scps.html#orgs_policies_blacklist). // // This operation can be called only from the organization's master account. // @@ -4061,29 +4404,28 @@ func (c *Organizations) DetachPolicyRequest(input *DetachPolicyInput) (req *requ // See the AWS API reference guide for AWS Organizations's // API operation DetachPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -4158,8 +4500,8 @@ func (c *Organizations) DetachPolicyRequest(input *DetachPolicyInput) (req *requ // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -4172,10 +4514,15 @@ func (c *Organizations) DetachPolicyRequest(input *DetachPolicyInput) (req *requ // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -4190,6 +4537,8 @@ func (c *Organizations) DetachPolicyRequest(input *DetachPolicyInput) (req *requ // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -4239,20 +4588,20 @@ func (c *Organizations) DetachPolicyRequest(input *DetachPolicyInput) (req *requ // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodePolicyNotAttachedException "PolicyNotAttachedException" +// * PolicyNotAttachedException // The policy isn't attached to the specified target in the specified root. // -// * ErrCodePolicyNotFoundException "PolicyNotFoundException" +// * PolicyNotFoundException // We can't find a policy with the PolicyId that you specified. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTargetNotFoundException "TargetNotFoundException" +// * TargetNotFoundException // We can't find a root, OU, or account with the TargetId that you specified. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -4260,6 +4609,13 @@ func (c *Organizations) DetachPolicyRequest(input *DetachPolicyInput) (req *requ // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // +// * UnsupportedAPIEndpointException +// This action isn't available in the current Region. +// +// * PolicyChangesInProgressException +// Changes to the effective policy are in progress, and its contents can't be +// returned. Try the operation again later. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DetachPolicy func (c *Organizations) DetachPolicy(input *DetachPolicyInput) (*DetachPolicyOutput, error) { req, out := c.DetachPolicyRequest(input) @@ -4344,9 +4700,9 @@ func (c *Organizations) DisableAWSServiceAccessRequest(input *DisableAWSServiceA // AWS service. // // After you perform the DisableAWSServiceAccess operation, the specified service -// can no longer perform operations in your organization's accounts unless the -// operations are explicitly permitted by the IAM policies that are attached -// to your roles. +// can no longer perform operations in your organization's accounts. The only +// exception is when the operations are explicitly permitted by IAM policies +// that are attached to your roles. // // For more information about integrating other services with AWS Organizations, // including the list of services that work with Organizations, see Integrating @@ -4362,29 +4718,28 @@ func (c *Organizations) DisableAWSServiceAccessRequest(input *DisableAWSServiceA // See the AWS API reference guide for AWS Organizations's // API operation DisableAWSServiceAccess for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -4459,8 +4814,8 @@ func (c *Organizations) DisableAWSServiceAccessRequest(input *DisableAWSServiceA // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -4473,10 +4828,15 @@ func (c *Organizations) DisableAWSServiceAccessRequest(input *DisableAWSServiceA // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -4491,6 +4851,8 @@ func (c *Organizations) DisableAWSServiceAccessRequest(input *DisableAWSServiceA // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -4540,11 +4902,11 @@ func (c *Organizations) DisableAWSServiceAccessRequest(input *DisableAWSServiceA // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -4618,11 +4980,13 @@ func (c *Organizations) DisablePolicyTypeRequest(input *DisablePolicyTypeInput) // DisablePolicyType API operation for AWS Organizations. // -// Disables an organizational control policy type in a root. A policy of a certain -// type can be attached to entities in a root only if that type is enabled in -// the root. After you perform this operation, you no longer can attach policies -// of the specified type to that root or to any organizational unit (OU) or -// account in that root. You can undo this by using the EnablePolicyType operation. +// Disables an organizational control policy type in a root and detaches all +// policies of that type from the organization root, OUs, and accounts. A policy +// of a certain type can be attached to entities in a root only if that type +// is enabled in the root. After you perform this operation, you no longer can +// attach policies of the specified type to that root or to any organizational +// unit (OU) or account in that root. You can undo this by using the EnablePolicyType +// operation. // // This is an asynchronous request that AWS performs in the background. If you // disable a policy for a root, it still appears enabled for the organization @@ -4642,29 +5006,28 @@ func (c *Organizations) DisablePolicyTypeRequest(input *DisablePolicyTypeInput) // See the AWS API reference guide for AWS Organizations's // API operation DisablePolicyType for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -4739,8 +5102,8 @@ func (c *Organizations) DisablePolicyTypeRequest(input *DisablePolicyTypeInput) // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -4753,10 +5116,15 @@ func (c *Organizations) DisablePolicyTypeRequest(input *DisablePolicyTypeInput) // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -4771,6 +5139,8 @@ func (c *Organizations) DisablePolicyTypeRequest(input *DisablePolicyTypeInput) // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -4820,21 +5190,21 @@ func (c *Organizations) DisablePolicyTypeRequest(input *DisablePolicyTypeInput) // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodePolicyTypeNotEnabledException "PolicyTypeNotEnabledException" +// * PolicyTypeNotEnabledException // The specified policy type isn't currently enabled in this root. You can't // attach policies of the specified type to entities in a root until you enable // that type in the root. For more information, see Enabling All Features in // Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) // in the AWS Organizations User Guide. // -// * ErrCodeRootNotFoundException "RootNotFoundException" +// * RootNotFoundException // We can't find a root with the RootId that you specified. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -4842,6 +5212,13 @@ func (c *Organizations) DisablePolicyTypeRequest(input *DisablePolicyTypeInput) // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // +// * UnsupportedAPIEndpointException +// This action isn't available in the current Region. +// +// * PolicyChangesInProgressException +// Changes to the effective policy are in progress, and its contents can't be +// returned. Try the operation again later. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DisablePolicyType func (c *Organizations) DisablePolicyType(input *DisablePolicyTypeInput) (*DisablePolicyTypeOutput, error) { req, out := c.DisablePolicyTypeRequest(input) @@ -4937,29 +5314,28 @@ func (c *Organizations) EnableAWSServiceAccessRequest(input *EnableAWSServiceAcc // See the AWS API reference guide for AWS Organizations's // API operation EnableAWSServiceAccess for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -5034,8 +5410,8 @@ func (c *Organizations) EnableAWSServiceAccessRequest(input *EnableAWSServiceAcc // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -5048,10 +5424,15 @@ func (c *Organizations) EnableAWSServiceAccessRequest(input *EnableAWSServiceAcc // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -5066,6 +5447,8 @@ func (c *Organizations) EnableAWSServiceAccessRequest(input *EnableAWSServiceAcc // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -5115,11 +5498,11 @@ func (c *Organizations) EnableAWSServiceAccessRequest(input *EnableAWSServiceAcc // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -5196,7 +5579,7 @@ func (c *Organizations) EnableAllFeaturesRequest(input *EnableAllFeaturesInput) // Enables all features in an organization. This enables the use of organization // policies that can restrict the services and actions that can be called in // each account. Until you enable all features, you have access only to consolidated -// billing, and you can't use any of the advanced account administration features +// billing. You can't use any of the advanced account administration features // that AWS Organizations supports. For more information, see Enabling All Features // in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) // in the AWS Organizations User Guide. @@ -5205,8 +5588,8 @@ func (c *Organizations) EnableAllFeaturesRequest(input *EnableAllFeaturesInput) // with only the consolidated billing features enabled. Calling this operation // sends a handshake to every invited account in the organization. The feature // set change can be finalized and the additional features enabled only after -// all administrators in the invited accounts approve the change by accepting -// the handshake. +// all administrators in the invited accounts approve the change. Accepting +// the handshake approves the change. // // After you enable all features, you can separately enable or disable individual // policy types in a root using EnablePolicyType and DisablePolicyType. To see @@ -5231,23 +5614,23 @@ func (c *Organizations) EnableAllFeaturesRequest(input *EnableAllFeaturesInput) // See the AWS API reference guide for AWS Organizations's // API operation EnableAllFeatures for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeHandshakeConstraintViolationException "HandshakeConstraintViolationException" +// * HandshakeConstraintViolationException // The requested operation would violate the constraint identified in the reason // code. // @@ -5287,7 +5670,7 @@ func (c *Organizations) EnableAllFeaturesRequest(input *EnableAllFeaturesInput) // account that doesn't have a payment instrument, such as a credit card, // associated with it. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -5302,6 +5685,8 @@ func (c *Organizations) EnableAllFeaturesRequest(input *EnableAllFeaturesInput) // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -5351,11 +5736,11 @@ func (c *Organizations) EnableAllFeaturesRequest(input *EnableAllFeaturesInput) // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -5451,29 +5836,28 @@ func (c *Organizations) EnablePolicyTypeRequest(input *EnablePolicyTypeInput) (r // See the AWS API reference guide for AWS Organizations's // API operation EnablePolicyType for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -5548,8 +5932,8 @@ func (c *Organizations) EnablePolicyTypeRequest(input *EnablePolicyTypeInput) (r // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -5562,10 +5946,15 @@ func (c *Organizations) EnablePolicyTypeRequest(input *EnablePolicyTypeInput) (r // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -5580,6 +5969,8 @@ func (c *Organizations) EnablePolicyTypeRequest(input *EnablePolicyTypeInput) (r // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -5629,17 +6020,17 @@ func (c *Organizations) EnablePolicyTypeRequest(input *EnablePolicyTypeInput) (r // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodePolicyTypeAlreadyEnabledException "PolicyTypeAlreadyEnabledException" +// * PolicyTypeAlreadyEnabledException // The specified policy type is already enabled in the specified root. // -// * ErrCodeRootNotFoundException "RootNotFoundException" +// * RootNotFoundException // We can't find a root with the RootId that you specified. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -5647,13 +6038,20 @@ func (c *Organizations) EnablePolicyTypeRequest(input *EnablePolicyTypeInput) (r // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // -// * ErrCodePolicyTypeNotAvailableForOrganizationException "PolicyTypeNotAvailableForOrganizationException" +// * PolicyTypeNotAvailableForOrganizationException // You can't use the specified policy type with the feature set currently enabled // for this organization. For example, you can enable SCPs only after you enable // all features in the organization. For more information, see Enabling and // Disabling a Policy Type on a Root (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html#enable_policies_on_root) // in the AWS Organizations User Guide. // +// * UnsupportedAPIEndpointException +// This action isn't available in the current Region. +// +// * PolicyChangesInProgressException +// Changes to the effective policy are in progress, and its contents can't be +// returned. Try the operation again later. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/EnablePolicyType func (c *Organizations) EnablePolicyType(input *EnablePolicyTypeInput) (*EnablePolicyTypeOutput, error) { req, out := c.EnablePolicyTypeRequest(input) @@ -5726,16 +6124,16 @@ func (c *Organizations) InviteAccountToOrganizationRequest(input *InviteAccountT // as a Handshake whose details are in the response. // // * You can invite AWS accounts only from the same seller as the master -// account. For example, if your organization's master account was created -// by Amazon Internet Services Pvt. Ltd (AISPL), an AWS seller in India, -// you can invite only other AISPL accounts to your organization. You can't -// combine accounts from AISPL and AWS or from any other AWS seller. For -// more information, see Consolidated Billing in India (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/useconsolidatedbilliing-India.html). +// account. For example, assume that your organization's master account was +// created by Amazon Internet Services Pvt. Ltd (AISPL), an AWS seller in +// India. You can invite only other AISPL accounts to your organization. +// You can't combine accounts from AISPL and AWS or from any other AWS seller. +// For more information, see Consolidated Billing in India (http://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/useconsolidatedbilliing-India.html). // -// * If you receive an exception that indicates that you exceeded your account -// limits for the organization or that the operation failed because your -// organization is still initializing, wait one hour and then try again. -// If the error persists after an hour, contact AWS Support (https://console.aws.amazon.com/support/home#/). +// * You might receive an exception that indicates that you exceeded your +// account limits for the organization or that the operation failed because +// your organization is still initializing. If so, wait one hour and then +// try again. If the error persists after an hour, contact AWS Support (https://console.aws.amazon.com/support/home#/). // // This operation can be called only from the organization's master account. // @@ -5746,29 +6144,29 @@ func (c *Organizations) InviteAccountToOrganizationRequest(input *InviteAccountT // See the AWS API reference guide for AWS Organizations's // API operation InviteAccountToOrganization for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeAccountOwnerNotVerifiedException "AccountOwnerNotVerifiedException" +// * AccountOwnerNotVerifiedException // You can't invite an existing account to your organization until you verify // that you own the email address associated with the master account. For more // information, see Email Address Verification (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_create.html#about-email-verification) // in the AWS Organizations User Guide. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeHandshakeConstraintViolationException "HandshakeConstraintViolationException" +// * HandshakeConstraintViolationException // The requested operation would violate the constraint identified in the reason // code. // @@ -5808,14 +6206,14 @@ func (c *Organizations) InviteAccountToOrganizationRequest(input *InviteAccountT // account that doesn't have a payment instrument, such as a credit card, // associated with it. // -// * ErrCodeDuplicateHandshakeException "DuplicateHandshakeException" +// * DuplicateHandshakeException // A handshake with the same action and target already exists. For example, // if you invited an account to join your organization, the invited account // might already have a pending invitation from this organization. If you intend // to resend an invitation to an account, ensure that existing handshakes that // might be considered duplicates are canceled or declined. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -5830,6 +6228,8 @@ func (c *Organizations) InviteAccountToOrganizationRequest(input *InviteAccountT // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -5879,17 +6279,17 @@ func (c *Organizations) InviteAccountToOrganizationRequest(input *InviteAccountT // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeFinalizingOrganizationException "FinalizingOrganizationException" +// * FinalizingOrganizationException // AWS Organizations couldn't perform the operation because your organization // hasn't finished initializing. This can take up to an hour. Try again later. // If after one hour you continue to receive this error, contact AWS Support // (https://console.aws.amazon.com/support/home#/). // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -5973,20 +6373,21 @@ func (c *Organizations) LeaveOrganizationRequest(input *LeaveOrganizationInput) // // * The master account in an organization with all features enabled can // set service control policies (SCPs) that can restrict what administrators -// of member accounts can do, including preventing them from successfully -// calling LeaveOrganization and leaving the organization. +// of member accounts can do. These restrictions can include preventing member +// accounts from successfully calling LeaveOrganization. // // * You can leave an organization as a member account only if the account // is configured with the information required to operate as a standalone // account. When you create an account in an organization using the AWS Organizations -// console, API, or CLI commands, the information required of standalone -// accounts is not automatically collected. For each account that you want -// to make standalone, you must accept the end user license agreement (EULA), -// choose a support plan, provide and verify the required contact information, -// and provide a current payment method. AWS uses the payment method to charge -// for any billable (not free tier) AWS activity that occurs while the account -// isn't attached to an organization. Follow the steps at To leave an organization -// when all required account information has not yet been provided (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// console, API, or CLI, the information required of standalone accounts +// is not automatically collected. For each account that you want to make +// standalone, you must accept the end user license agreement (EULA). You +// must also choose a support plan, provide and verify the required contact +// information, and provide a current payment method. AWS uses the payment +// method to charge for any billable (not free tier) AWS activity that occurs +// while the account isn't attached to an organization. Follow the steps +// at To leave an organization when all required account information has +// not yet been provided (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) // in the AWS Organizations User Guide. // // * You can leave an organization only after you enable IAM user access @@ -6001,34 +6402,33 @@ func (c *Organizations) LeaveOrganizationRequest(input *LeaveOrganizationInput) // See the AWS API reference guide for AWS Organizations's // API operation LeaveOrganization for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAccountNotFoundException "AccountNotFoundException" -// We can't find an AWS account with the AccountId that you specified, or the +// * AccountNotFoundException +// We can't find an AWS account with the AccountId that you specified. Or the // account whose credentials you used to make this request isn't a member of // an organization. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -6103,8 +6503,8 @@ func (c *Organizations) LeaveOrganizationRequest(input *LeaveOrganizationInput) // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -6117,10 +6517,15 @@ func (c *Organizations) LeaveOrganizationRequest(input *LeaveOrganizationInput) // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -6135,6 +6540,8 @@ func (c *Organizations) LeaveOrganizationRequest(input *LeaveOrganizationInput) // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -6184,16 +6591,16 @@ func (c *Organizations) LeaveOrganizationRequest(input *LeaveOrganizationInput) // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeMasterCannotLeaveOrganizationException "MasterCannotLeaveOrganizationException" +// * MasterCannotLeaveOrganizationException // You can't remove a master account from an organization. If you want the master // account to become a member account in another organization, you must first // delete the current organization of the master account. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -6292,25 +6699,24 @@ func (c *Organizations) ListAWSServiceAccessForOrganizationRequest(input *ListAW // See the AWS API reference guide for AWS Organizations's // API operation ListAWSServiceAccessForOrganization for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -6385,8 +6791,8 @@ func (c *Organizations) ListAWSServiceAccessForOrganizationRequest(input *ListAW // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -6399,10 +6805,15 @@ func (c *Organizations) ListAWSServiceAccessForOrganizationRequest(input *ListAW // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -6417,6 +6828,8 @@ func (c *Organizations) ListAWSServiceAccessForOrganizationRequest(input *ListAW // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -6466,11 +6879,11 @@ func (c *Organizations) ListAWSServiceAccessForOrganizationRequest(input *ListAW // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -6543,10 +6956,12 @@ func (c *Organizations) ListAWSServiceAccessForOrganizationPagesWithContext(ctx }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAWSServiceAccessForOrganizationOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAWSServiceAccessForOrganizationOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6618,19 +7033,19 @@ func (c *Organizations) ListAccountsRequest(input *ListAccountsInput) (req *requ // See the AWS API reference guide for AWS Organizations's // API operation ListAccounts for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -6645,6 +7060,8 @@ func (c *Organizations) ListAccountsRequest(input *ListAccountsInput) (req *requ // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -6694,11 +7111,11 @@ func (c *Organizations) ListAccountsRequest(input *ListAccountsInput) (req *requ // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -6771,10 +7188,12 @@ func (c *Organizations) ListAccountsPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAccountsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAccountsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6848,19 +7267,19 @@ func (c *Organizations) ListAccountsForParentRequest(input *ListAccountsForParen // See the AWS API reference guide for AWS Organizations's // API operation ListAccountsForParent for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -6875,6 +7294,8 @@ func (c *Organizations) ListAccountsForParentRequest(input *ListAccountsForParen // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -6924,14 +7345,14 @@ func (c *Organizations) ListAccountsForParentRequest(input *ListAccountsForParen // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeParentNotFoundException "ParentNotFoundException" +// * ParentNotFoundException // We can't find a root or OU with the ParentId that you specified. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -7004,10 +7425,12 @@ func (c *Organizations) ListAccountsForParentPagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAccountsForParentOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAccountsForParentOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7079,19 +7502,19 @@ func (c *Organizations) ListChildrenRequest(input *ListChildrenInput) (req *requ // See the AWS API reference guide for AWS Organizations's // API operation ListChildren for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -7106,6 +7529,8 @@ func (c *Organizations) ListChildrenRequest(input *ListChildrenInput) (req *requ // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -7155,14 +7580,14 @@ func (c *Organizations) ListChildrenRequest(input *ListChildrenInput) (req *requ // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeParentNotFoundException "ParentNotFoundException" +// * ParentNotFoundException // We can't find a root or OU with the ParentId that you specified. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -7235,10 +7660,12 @@ func (c *Organizations) ListChildrenPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListChildrenOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListChildrenOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7309,19 +7736,19 @@ func (c *Organizations) ListCreateAccountStatusRequest(input *ListCreateAccountS // See the AWS API reference guide for AWS Organizations's // API operation ListCreateAccountStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -7336,6 +7763,8 @@ func (c *Organizations) ListCreateAccountStatusRequest(input *ListCreateAccountS // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -7385,11 +7814,11 @@ func (c *Organizations) ListCreateAccountStatusRequest(input *ListCreateAccountS // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -7397,7 +7826,7 @@ func (c *Organizations) ListCreateAccountStatusRequest(input *ListCreateAccountS // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // -// * ErrCodeUnsupportedAPIEndpointException "UnsupportedAPIEndpointException" +// * UnsupportedAPIEndpointException // This action isn't available in the current Region. // // See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListCreateAccountStatus @@ -7465,10 +7894,12 @@ func (c *Organizations) ListCreateAccountStatusPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCreateAccountStatusOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListCreateAccountStatusOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7543,19 +7974,19 @@ func (c *Organizations) ListHandshakesForAccountRequest(input *ListHandshakesFor // See the AWS API reference guide for AWS Organizations's // API operation ListHandshakesForAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -7570,6 +8001,8 @@ func (c *Organizations) ListHandshakesForAccountRequest(input *ListHandshakesFor // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -7619,11 +8052,11 @@ func (c *Organizations) ListHandshakesForAccountRequest(input *ListHandshakesFor // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -7696,10 +8129,12 @@ func (c *Organizations) ListHandshakesForAccountPagesWithContext(ctx aws.Context }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListHandshakesForAccountOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListHandshakesForAccountOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7776,23 +8211,23 @@ func (c *Organizations) ListHandshakesForOrganizationRequest(input *ListHandshak // See the AWS API reference guide for AWS Organizations's // API operation ListHandshakesForOrganization for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -7807,6 +8242,8 @@ func (c *Organizations) ListHandshakesForOrganizationRequest(input *ListHandshak // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -7856,11 +8293,11 @@ func (c *Organizations) ListHandshakesForOrganizationRequest(input *ListHandshak // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -7933,10 +8370,12 @@ func (c *Organizations) ListHandshakesForOrganizationPagesWithContext(ctx aws.Co }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListHandshakesForOrganizationOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListHandshakesForOrganizationOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8006,19 +8445,19 @@ func (c *Organizations) ListOrganizationalUnitsForParentRequest(input *ListOrgan // See the AWS API reference guide for AWS Organizations's // API operation ListOrganizationalUnitsForParent for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -8033,6 +8472,8 @@ func (c *Organizations) ListOrganizationalUnitsForParentRequest(input *ListOrgan // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -8082,14 +8523,14 @@ func (c *Organizations) ListOrganizationalUnitsForParentRequest(input *ListOrgan // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeParentNotFoundException "ParentNotFoundException" +// * ParentNotFoundException // We can't find a root or OU with the ParentId that you specified. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -8162,10 +8603,12 @@ func (c *Organizations) ListOrganizationalUnitsForParentPagesWithContext(ctx aws }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOrganizationalUnitsForParentOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListOrganizationalUnitsForParentOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8239,23 +8682,23 @@ func (c *Organizations) ListParentsRequest(input *ListParentsInput) (req *reques // See the AWS API reference guide for AWS Organizations's // API operation ListParents for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeChildNotFoundException "ChildNotFoundException" +// * ChildNotFoundException // We can't find an organizational unit (OU) or AWS account with the ChildId // that you specified. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -8270,6 +8713,8 @@ func (c *Organizations) ListParentsRequest(input *ListParentsInput) (req *reques // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -8319,11 +8764,11 @@ func (c *Organizations) ListParentsRequest(input *ListParentsInput) (req *reques // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -8396,10 +8841,12 @@ func (c *Organizations) ListParentsPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListParentsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListParentsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8469,19 +8916,19 @@ func (c *Organizations) ListPoliciesRequest(input *ListPoliciesInput) (req *requ // See the AWS API reference guide for AWS Organizations's // API operation ListPolicies for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -8496,6 +8943,8 @@ func (c *Organizations) ListPoliciesRequest(input *ListPoliciesInput) (req *requ // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -8545,11 +8994,11 @@ func (c *Organizations) ListPoliciesRequest(input *ListPoliciesInput) (req *requ // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -8557,6 +9006,9 @@ func (c *Organizations) ListPoliciesRequest(input *ListPoliciesInput) (req *requ // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // +// * UnsupportedAPIEndpointException +// This action isn't available in the current Region. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListPolicies func (c *Organizations) ListPolicies(input *ListPoliciesInput) (*ListPoliciesOutput, error) { req, out := c.ListPoliciesRequest(input) @@ -8622,10 +9074,12 @@ func (c *Organizations) ListPoliciesPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPoliciesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPoliciesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8697,19 +9151,19 @@ func (c *Organizations) ListPoliciesForTargetRequest(input *ListPoliciesForTarge // See the AWS API reference guide for AWS Organizations's // API operation ListPoliciesForTarget for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -8724,6 +9178,8 @@ func (c *Organizations) ListPoliciesForTargetRequest(input *ListPoliciesForTarge // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -8773,14 +9229,14 @@ func (c *Organizations) ListPoliciesForTargetRequest(input *ListPoliciesForTarge // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTargetNotFoundException "TargetNotFoundException" +// * TargetNotFoundException // We can't find a root, OU, or account with the TargetId that you specified. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -8788,6 +9244,9 @@ func (c *Organizations) ListPoliciesForTargetRequest(input *ListPoliciesForTarge // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // +// * UnsupportedAPIEndpointException +// This action isn't available in the current Region. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListPoliciesForTarget func (c *Organizations) ListPoliciesForTarget(input *ListPoliciesForTargetInput) (*ListPoliciesForTargetOutput, error) { req, out := c.ListPoliciesForTargetRequest(input) @@ -8853,10 +9312,12 @@ func (c *Organizations) ListPoliciesForTargetPagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPoliciesForTargetOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPoliciesForTargetOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8932,19 +9393,19 @@ func (c *Organizations) ListRootsRequest(input *ListRootsInput) (req *request.Re // See the AWS API reference guide for AWS Organizations's // API operation ListRoots for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -8959,6 +9420,8 @@ func (c *Organizations) ListRootsRequest(input *ListRootsInput) (req *request.Re // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -9008,11 +9471,11 @@ func (c *Organizations) ListRootsRequest(input *ListRootsInput) (req *request.Re // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -9085,10 +9548,12 @@ func (c *Organizations) ListRootsPagesWithContext(ctx aws.Context, input *ListRo }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRootsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListRootsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -9146,6 +9611,8 @@ func (c *Organizations) ListTagsForResourceRequest(input *ListTagsForResourceInp // // Currently, you can list tags on an account in AWS Organizations. // +// This operation can be called only from the organization's master 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. @@ -9153,22 +9620,22 @@ func (c *Organizations) ListTagsForResourceRequest(input *ListTagsForResourceInp // See the AWS API reference guide for AWS Organizations's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeTargetNotFoundException "TargetNotFoundException" +// * TargetNotFoundException // We can't find a root, OU, or account with the TargetId that you specified. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -9183,6 +9650,8 @@ func (c *Organizations) ListTagsForResourceRequest(input *ListTagsForResourceInp // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -9232,11 +9701,11 @@ func (c *Organizations) ListTagsForResourceRequest(input *ListTagsForResourceInp // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -9309,10 +9778,12 @@ func (c *Organizations) ListTagsForResourcePagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -9383,19 +9854,19 @@ func (c *Organizations) ListTargetsForPolicyRequest(input *ListTargetsForPolicyI // See the AWS API reference guide for AWS Organizations's // API operation ListTargetsForPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -9410,6 +9881,8 @@ func (c *Organizations) ListTargetsForPolicyRequest(input *ListTargetsForPolicyI // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -9459,14 +9932,14 @@ func (c *Organizations) ListTargetsForPolicyRequest(input *ListTargetsForPolicyI // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodePolicyNotFoundException "PolicyNotFoundException" +// * PolicyNotFoundException // We can't find a policy with the PolicyId that you specified. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -9474,6 +9947,9 @@ func (c *Organizations) ListTargetsForPolicyRequest(input *ListTargetsForPolicyI // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // +// * UnsupportedAPIEndpointException +// This action isn't available in the current Region. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListTargetsForPolicy func (c *Organizations) ListTargetsForPolicy(input *ListTargetsForPolicyInput) (*ListTargetsForPolicyOutput, error) { req, out := c.ListTargetsForPolicyRequest(input) @@ -9539,10 +10015,12 @@ func (c *Organizations) ListTargetsForPolicyPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTargetsForPolicyOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTargetsForPolicyOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -9603,15 +10081,15 @@ func (c *Organizations) MoveAccountRequest(input *MoveAccountInput) (req *reques // See the AWS API reference guide for AWS Organizations's // API operation MoveAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -9626,6 +10104,8 @@ func (c *Organizations) MoveAccountRequest(input *MoveAccountInput) (req *reques // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -9675,22 +10155,22 @@ func (c *Organizations) MoveAccountRequest(input *MoveAccountInput) (req *reques // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeSourceParentNotFoundException "SourceParentNotFoundException" +// * SourceParentNotFoundException // We can't find a source root or OU with the ParentId that you specified. // -// * ErrCodeDestinationParentNotFoundException "DestinationParentNotFoundException" +// * DestinationParentNotFoundException // We can't find the destination container (a root or OU) with the ParentId // that you specified. // -// * ErrCodeDuplicateAccountException "DuplicateAccountException" +// * DuplicateAccountException // That account is already present in the specified destination. // -// * ErrCodeAccountNotFoundException "AccountNotFoundException" -// We can't find an AWS account with the AccountId that you specified, or the +// * AccountNotFoundException +// We can't find an AWS account with the AccountId that you specified. Or the // account whose credentials you used to make this request isn't a member of // an organization. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -9698,15 +10178,15 @@ func (c *Organizations) MoveAccountRequest(input *MoveAccountInput) (req *reques // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // @@ -9791,15 +10271,15 @@ func (c *Organizations) RemoveAccountFromOrganizationRequest(input *RemoveAccoun // You can remove an account from your organization only if the account is configured // with the information required to operate as a standalone account. When you // create an account in an organization using the AWS Organizations console, -// API, or CLI commands, the information required of standalone accounts is -// not automatically collected. For an account that you want to make standalone, -// you must accept the end user license agreement (EULA), choose a support plan, +// API, or CLI, the information required of standalone accounts is not automatically +// collected. For an account that you want to make standalone, you must accept +// the end user license agreement (EULA). You must also choose a support plan, // provide and verify the required contact information, and provide a current // payment method. AWS uses the payment method to charge for any billable (not // free tier) AWS activity that occurs while the account isn't attached to an // organization. To remove an account that doesn't yet have this information, -// you must sign in as the member account and follow the steps at To leave an -// organization when all required account information has not yet been provided +// you must sign in as the member account. Then follow the steps at To leave +// an organization when all required account information has not yet been provided // (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) // in the AWS Organizations User Guide. // @@ -9810,34 +10290,33 @@ func (c *Organizations) RemoveAccountFromOrganizationRequest(input *RemoveAccoun // See the AWS API reference guide for AWS Organizations's // API operation RemoveAccountFromOrganization for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAccountNotFoundException "AccountNotFoundException" -// We can't find an AWS account with the AccountId that you specified, or the +// * AccountNotFoundException +// We can't find an AWS account with the AccountId that you specified. Or the // account whose credentials you used to make this request isn't a member of // an organization. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -9912,8 +10391,8 @@ func (c *Organizations) RemoveAccountFromOrganizationRequest(input *RemoveAccoun // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -9926,10 +10405,15 @@ func (c *Organizations) RemoveAccountFromOrganizationRequest(input *RemoveAccoun // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -9944,6 +10428,8 @@ func (c *Organizations) RemoveAccountFromOrganizationRequest(input *RemoveAccoun // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -9993,16 +10479,16 @@ func (c *Organizations) RemoveAccountFromOrganizationRequest(input *RemoveAccoun // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeMasterCannotLeaveOrganizationException "MasterCannotLeaveOrganizationException" +// * MasterCannotLeaveOrganizationException // You can't remove a master account from an organization. If you want the master // account to become a member account in another organization, you must first // delete the current organization of the master account. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -10081,6 +10567,8 @@ func (c *Organizations) TagResourceRequest(input *TagResourceInput) (req *reques // // Currently, you can tag and untag accounts in AWS Organizations. // +// This operation can be called only from the organization's master 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. @@ -10088,32 +10576,31 @@ func (c *Organizations) TagResourceRequest(input *TagResourceInput) (req *reques // See the AWS API reference guide for AWS Organizations's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeTargetNotFoundException "TargetNotFoundException" +// * TargetNotFoundException // We can't find a root, OU, or account with the TargetId that you specified. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -10188,8 +10675,8 @@ func (c *Organizations) TagResourceRequest(input *TagResourceInput) (req *reques // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -10202,10 +10689,15 @@ func (c *Organizations) TagResourceRequest(input *TagResourceInput) (req *reques // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -10220,6 +10712,8 @@ func (c *Organizations) TagResourceRequest(input *TagResourceInput) (req *reques // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -10269,11 +10763,11 @@ func (c *Organizations) TagResourceRequest(input *TagResourceInput) (req *reques // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -10352,6 +10846,8 @@ func (c *Organizations) UntagResourceRequest(input *UntagResourceInput) (req *re // // Currently, you can tag and untag accounts in AWS Organizations. // +// This operation can be called only from the organization's master 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. @@ -10359,32 +10855,31 @@ func (c *Organizations) UntagResourceRequest(input *UntagResourceInput) (req *re // See the AWS API reference guide for AWS Organizations's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeTargetNotFoundException "TargetNotFoundException" +// * TargetNotFoundException // We can't find a root, OU, or account with the TargetId that you specified. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -10459,8 +10954,8 @@ func (c *Organizations) UntagResourceRequest(input *UntagResourceInput) (req *re // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -10473,10 +10968,15 @@ func (c *Organizations) UntagResourceRequest(input *UntagResourceInput) (req *re // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -10491,6 +10991,8 @@ func (c *Organizations) UntagResourceRequest(input *UntagResourceInput) (req *re // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -10540,11 +11042,11 @@ func (c *Organizations) UntagResourceRequest(input *UntagResourceInput) (req *re // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -10631,26 +11133,26 @@ func (c *Organizations) UpdateOrganizationalUnitRequest(input *UpdateOrganizatio // See the AWS API reference guide for AWS Organizations's // API operation UpdateOrganizationalUnit for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeDuplicateOrganizationalUnitException "DuplicateOrganizationalUnitException" +// * DuplicateOrganizationalUnitException // An OU with the same name already exists. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -10665,6 +11167,8 @@ func (c *Organizations) UpdateOrganizationalUnitRequest(input *UpdateOrganizatio // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -10714,14 +11218,14 @@ func (c *Organizations) UpdateOrganizationalUnitRequest(input *UpdateOrganizatio // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeOrganizationalUnitNotFoundException "OrganizationalUnitNotFoundException" +// * OrganizationalUnitNotFoundException // We can't find an OU with the OrganizationalUnitId that you specified. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -10808,29 +11312,28 @@ func (c *Organizations) UpdatePolicyRequest(input *UpdatePolicyInput) (req *requ // See the AWS API reference guide for AWS Organizations's // API operation UpdatePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You don't have permissions to perform the requested operation. The user or // role that is making the request must have at least one IAM permissions policy // attached that grants the required permissions. For more information, see // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) // in the IAM User Guide. // -// * ErrCodeAWSOrganizationsNotInUseException "AWSOrganizationsNotInUseException" +// * AWSOrganizationsNotInUseException // Your account isn't a member of an organization. To make this request, you // must use the credentials of an account that belongs to an organization. // -// * ErrCodeConcurrentModificationException "ConcurrentModificationException" +// * ConcurrentModificationException // The target of the operation is currently being modified by a different request. // Try again later. // -// * ErrCodeConstraintViolationException "ConstraintViolationException" -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit. +// * ConstraintViolationException +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -10905,8 +11408,8 @@ func (c *Organizations) UpdatePolicyRequest(input *UpdatePolicyInput) (req *requ // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -10919,13 +11422,18 @@ func (c *Organizations) UpdatePolicyRequest(input *UpdatePolicyInput) (req *requ // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // -// * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. // -// * ErrCodeDuplicatePolicyException "DuplicatePolicyException" +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +// +// * DuplicatePolicyException // A policy with the same name already exists. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The requested operation failed because you provided invalid values for one // or more of the request parameters. This exception includes a reason that // contains additional information about the violated limit: @@ -10940,6 +11448,8 @@ func (c *Organizations) UpdatePolicyRequest(input *UpdatePolicyInput) (req *requ // // * INVALID_ENUM: You specified an invalid value. // +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -10989,20 +11499,20 @@ func (c *Organizations) UpdatePolicyRequest(input *UpdatePolicyInput) (req *requ // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only // between entities in the same root. // -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocumentException" +// * MalformedPolicyDocumentException // The provided policy document doesn't meet the requirements of the specified // policy type. For example, the syntax might be incorrect. For details about // service control policy syntax, see Service Control Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) // in the AWS Organizations User Guide. // -// * ErrCodePolicyNotFoundException "PolicyNotFoundException" +// * PolicyNotFoundException // We can't find a policy with the PolicyId that you specified. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // AWS Organizations can't complete your request because of an internal service // error. Try again later. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // You have sent too many requests in too short a period of time. The limit // helps protect against denial-of-service attacks. Try again later. // @@ -11010,6 +11520,13 @@ func (c *Organizations) UpdatePolicyRequest(input *UpdatePolicyInput) (req *requ // Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) // in the AWS Organizations User Guide. // +// * UnsupportedAPIEndpointException +// This action isn't available in the current Region. +// +// * PolicyChangesInProgressException +// Changes to the effective policy are in progress, and its contents can't be +// returned. Try the operation again later. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/UpdatePolicy func (c *Organizations) UpdatePolicy(input *UpdatePolicyInput) (*UpdatePolicyOutput, error) { req, out := c.UpdatePolicyRequest(input) @@ -11032,13 +11549,70 @@ func (c *Organizations) UpdatePolicyWithContext(ctx aws.Context, input *UpdatePo return out, req.Send() } +// Your account isn't a member of an organization. To make this request, you +// must use the credentials of an account that belongs to an organization. +type AWSOrganizationsNotInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AWSOrganizationsNotInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AWSOrganizationsNotInUseException) GoString() string { + return s.String() +} + +func newErrorAWSOrganizationsNotInUseException(v protocol.ResponseMetadata) error { + return &AWSOrganizationsNotInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AWSOrganizationsNotInUseException) Code() string { + return "AWSOrganizationsNotInUseException" +} + +// Message returns the exception's message. +func (s AWSOrganizationsNotInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AWSOrganizationsNotInUseException) OrigErr() error { + return nil +} + +func (s AWSOrganizationsNotInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AWSOrganizationsNotInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AWSOrganizationsNotInUseException) RequestID() string { + return s.respMetadata.RequestID +} + type AcceptHandshakeInput struct { _ struct{} `type:"structure"` // The unique identifier (ID) of the handshake that you want to accept. // // The regex pattern (http://wikipedia.org/wiki/regex) for handshake ID string - // requires "h-" followed by from 8 to 32 lower-case letters or digits. + // requires "h-" followed by from 8 to 32 lowercase letters or digits. // // HandshakeId is a required field HandshakeId *string `type:"string" required:"true"` @@ -11096,6 +11670,126 @@ func (s *AcceptHandshakeOutput) SetHandshake(v *Handshake) *AcceptHandshakeOutpu return s } +// You don't have permissions to perform the requested operation. The user or +// role that is making the request must have at least one IAM permissions policy +// attached that grants the required permissions. For more information, see +// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) +// in the IAM User Guide. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The operation that you attempted requires you to have the iam:CreateServiceLinkedRole +// for organizations.amazonaws.com permission so that AWS Organizations can +// create the required service-linked role. You don't have that permission. +type AccessDeniedForDependencyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Reason *string `type:"string" enum:"AccessDeniedForDependencyExceptionReason"` +} + +// String returns the string representation +func (s AccessDeniedForDependencyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedForDependencyException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedForDependencyException(v protocol.ResponseMetadata) error { + return &AccessDeniedForDependencyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedForDependencyException) Code() string { + return "AccessDeniedForDependencyException" +} + +// Message returns the exception's message. +func (s AccessDeniedForDependencyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedForDependencyException) OrigErr() error { + return nil +} + +func (s AccessDeniedForDependencyException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedForDependencyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedForDependencyException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains information about an AWS account that is a member of an organization. type Account struct { _ struct{} `type:"structure"` @@ -11110,7 +11804,7 @@ type Account struct { // The email address associated with the AWS account. // // The regex pattern (http://wikipedia.org/wiki/regex) for this parameter is - // a string of characters that represents a standard Internet email address. + // a string of characters that represents a standard internet email address. Email *string `min:"6" type:"string" sensitive:"true"` // The unique identifier (ID) of the account. @@ -11188,6 +11882,180 @@ func (s *Account) SetStatus(v string) *Account { return s } +// We can't find an AWS account with the AccountId that you specified. Or the +// account whose credentials you used to make this request isn't a member of +// an organization. +type AccountNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccountNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountNotFoundException) GoString() string { + return s.String() +} + +func newErrorAccountNotFoundException(v protocol.ResponseMetadata) error { + return &AccountNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccountNotFoundException) Code() string { + return "AccountNotFoundException" +} + +// Message returns the exception's message. +func (s AccountNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccountNotFoundException) OrigErr() error { + return nil +} + +func (s AccountNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccountNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccountNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// You can't invite an existing account to your organization until you verify +// that you own the email address associated with the master account. For more +// information, see Email Address Verification (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_create.html#about-email-verification) +// in the AWS Organizations User Guide. +type AccountOwnerNotVerifiedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccountOwnerNotVerifiedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountOwnerNotVerifiedException) GoString() string { + return s.String() +} + +func newErrorAccountOwnerNotVerifiedException(v protocol.ResponseMetadata) error { + return &AccountOwnerNotVerifiedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccountOwnerNotVerifiedException) Code() string { + return "AccountOwnerNotVerifiedException" +} + +// Message returns the exception's message. +func (s AccountOwnerNotVerifiedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccountOwnerNotVerifiedException) OrigErr() error { + return nil +} + +func (s AccountOwnerNotVerifiedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccountOwnerNotVerifiedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccountOwnerNotVerifiedException) RequestID() string { + return s.respMetadata.RequestID +} + +// This account is already a member of an organization. An account can belong +// to only one organization at a time. +type AlreadyInOrganizationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AlreadyInOrganizationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AlreadyInOrganizationException) GoString() string { + return s.String() +} + +func newErrorAlreadyInOrganizationException(v protocol.ResponseMetadata) error { + return &AlreadyInOrganizationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AlreadyInOrganizationException) Code() string { + return "AlreadyInOrganizationException" +} + +// Message returns the exception's message. +func (s AlreadyInOrganizationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AlreadyInOrganizationException) OrigErr() error { + return nil +} + +func (s AlreadyInOrganizationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AlreadyInOrganizationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AlreadyInOrganizationException) RequestID() string { + return s.respMetadata.RequestID +} + type AttachPolicyInput struct { _ struct{} `type:"structure"` @@ -11195,7 +12063,8 @@ type AttachPolicyInput struct { // You can get the ID for the policy by calling the ListPolicies operation. // // The regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string - // requires "p-" followed by from 8 to 128 lower-case letters or digits. + // requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, + // or the underscore character (_). // // PolicyId is a required field PolicyId *string `type:"string" required:"true"` @@ -11207,15 +12076,15 @@ type AttachPolicyInput struct { // The regex pattern (http://wikipedia.org/wiki/regex) for a target ID string // requires one of the following: // - // * Root - A string that begins with "r-" followed by from 4 to 32 lower-case + // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // // * Account - A string that consists of exactly 12 digits. // // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lower-case letters or digits (the ID of the root that - // the OU is in) followed by a second "-" dash and from 8 to 32 additional - // lower-case letters or digits. + // by from 4 to 32 lowercase letters or digits (the ID of the root that the + // OU is in). This string is followed by a second "-" dash and from 8 to + // 32 additional lowercase letters or digits. // // TargetId is a required field TargetId *string `type:"string" required:"true"` @@ -11280,7 +12149,7 @@ type CancelHandshakeInput struct { // can get the ID from the ListHandshakesForOrganization operation. // // The regex pattern (http://wikipedia.org/wiki/regex) for handshake ID string - // requires "h-" followed by from 8 to 32 lower-case letters or digits. + // requires "h-" followed by from 8 to 32 lowercase letters or digits. // // HandshakeId is a required field HandshakeId *string `type:"string" required:"true"` @@ -11347,12 +12216,12 @@ type Child struct { // The regex pattern (http://wikipedia.org/wiki/regex) for a child ID string // requires one of the following: // - // * Account: a string that consists of exactly 12 digits. + // * Account: A string that consists of exactly 12 digits. // - // * Organizational unit (OU): a string that begins with "ou-" followed by + // * Organizational unit (OU): A string that begins with "ou-" followed by // from 4 to 32 lower-case letters or digits (the ID of the root that contains - // the OU) followed by a second "-" dash and from 8 to 32 additional lower-case - // letters or digits. + // the OU). This string is followed by a second "-" dash and from 8 to 32 + // additional lower-case letters or digits. Id *string `type:"string"` // The type of this child entity. @@ -11381,71 +12250,341 @@ func (s *Child) SetType(v string) *Child { return s } -type CreateAccountInput struct { - _ struct{} `type:"structure"` - - // The friendly name of the member account. - // - // AccountName is a required field - AccountName *string `min:"1" type:"string" required:"true" sensitive:"true"` - - // The email address of the owner to assign to the new member account. This - // email address must not already be associated with another AWS account. You - // must use a valid email address to complete account creation. You can't access - // the root user of the account or remove an account that was created with an - // invalid email address. - // - // Email is a required field - Email *string `min:"6" type:"string" required:"true" sensitive:"true"` - - // If set to ALLOW, the new account enables IAM users to access account billing - // information if they have the required permissions. If set to DENY, only the - // root user of the new account can access account billing information. For - // more information, see Activating Access to the Billing and Cost Management - // Console (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate) - // in the AWS Billing and Cost Management User Guide. - // - // If you don't specify this parameter, the value defaults to ALLOW, and IAM - // users and roles with the required permissions can access billing information - // for the new account. - IamUserAccessToBilling *string `type:"string" enum:"IAMUserAccessToBilling"` +// We can't find an organizational unit (OU) or AWS account with the ChildId +// that you specified. +type ChildNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // (Optional) - // - // The name of an IAM role that AWS Organizations automatically preconfigures - // in the new member account. This role trusts the master account, allowing - // users in the master account to assume the role, as permitted by the master - // account administrator. The role has administrator permissions in the new - // member account. - // - // If you don't specify this parameter, the role name defaults to OrganizationAccountAccessRole. - // - // For more information about how to use this role to access the member account, - // see Accessing and Administering the Member Accounts in Your Organization - // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role) - // in the AWS Organizations User Guide, and steps 2 and 3 in Tutorial: Delegate - // Access Across AWS Accounts Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html) - // in the IAM User Guide. - // - // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate - // this parameter is a string of characters that can consist of uppercase letters, - // lowercase letters, digits with no spaces, and any of the following characters: - // =,.@- - RoleName *string `type:"string"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s CreateAccountInput) String() string { +func (s ChildNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateAccountInput) GoString() string { +func (s ChildNotFoundException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAccountInput) Validate() error { +func newErrorChildNotFoundException(v protocol.ResponseMetadata) error { + return &ChildNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ChildNotFoundException) Code() string { + return "ChildNotFoundException" +} + +// Message returns the exception's message. +func (s ChildNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ChildNotFoundException) OrigErr() error { + return nil +} + +func (s ChildNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ChildNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ChildNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The target of the operation is currently being modified by a different request. +// Try again later. +type ConcurrentModificationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ConcurrentModificationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentModificationException) GoString() string { + return s.String() +} + +func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { + return &ConcurrentModificationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentModificationException) Code() string { + return "ConcurrentModificationException" +} + +// Message returns the exception's message. +func (s ConcurrentModificationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentModificationException) OrigErr() error { + return nil +} + +func (s ConcurrentModificationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentModificationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentModificationException) RequestID() string { + return s.respMetadata.RequestID +} + +// Performing this operation violates a minimum or maximum value limit. Examples +// include attempting to remove the last service control policy (SCP) from an +// OU or root, or attaching too many policies to an account, OU, or root. This +// exception includes a reason that contains additional information about the +// violated limit. +// +// Some of the reasons in the following list might not be applicable to this +// specific API or operation: +// +// * ACCOUNT_CANNOT_LEAVE_WITHOUT_EULA: You attempted to remove an account +// from the organization that doesn't yet have enough information to exist +// as a standalone account. This account requires you to first agree to the +// AWS Customer Agreement. Follow the steps at To leave an organization when +// all required account information has not yet been provided (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// in the AWS Organizations User Guide. +// +// * ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove +// an account from the organization that doesn't yet have enough information +// to exist as a standalone account. This account requires you to first complete +// phone verification. Follow the steps at To leave an organization when +// all required account information has not yet been provided (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// in the AWS Organizations User Guide. +// +// * ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number +// of accounts that you can create in one day. +// +// * ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on +// the number of accounts in an organization. If you need more accounts, +// contact AWS Support (https://console.aws.amazon.com/support/home#/) to +// request an increase in your limit. Or the number of invitations that you +// tried to send would cause you to exceed the limit of accounts in your +// organization. Send fewer invitations or contact AWS Support to request +// an increase in the number of accounts. Deleted and closed accounts still +// count toward your limit. If you get receive this exception when running +// a command immediately after creating the organization, wait one hour and +// try again. If after an hour it continues to fail with this error, contact +// AWS Support (https://console.aws.amazon.com/support/home#/). +// +// * HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of +// handshakes that you can send in one day. +// +// * MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account +// in this organization, you first must migrate the organization's master +// account to the marketplace that corresponds to the master account's address. +// For example, accounts with India addresses must be associated with the +// AISPL marketplace. All accounts in an organization must be associated +// with the same marketplace. +// +// * MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you +// must first provide contact a valid address and phone number for the master +// account. Then try the operation again. +// +// * MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the +// master account must have an associated account in the AWS GovCloud (US-West) +// Region. For more information, see AWS Organizations (http://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) +// in the AWS GovCloud User Guide. +// +// * MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization +// with this master account, you first must associate a valid payment instrument, +// such as a credit card, with the account. Follow the steps at To leave +// an organization when all required account information has not yet been +// provided (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// in the AWS Organizations User Guide. +// +// * MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the +// number of policies of a certain type that can be attached to an entity +// at one time. +// +// * MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed +// on this resource. +// +// * MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation +// with this member account, you first must associate a valid payment instrument, +// such as a credit card, with the account. Follow the steps at To leave +// an organization when all required account information has not yet been +// provided (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) +// in the AWS Organizations User Guide. +// +// * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a +// policy from an entity, which would cause the entity to have fewer than +// the minimum number of policies of the required type. +// +// * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is +// too many levels deep. +// +// * ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation +// that requires the organization to be configured to support all features. +// An organization that supports only consolidated billing features can't +// perform this operation. +// +// * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs +// that you can have in an organization. +// +// * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of +// policies that you can have in an organization. +// +// * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant +// with the tag policy that’s in effect for the account. For more information, +// see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +// in the AWS Organizations User Guide. +type ConstraintViolationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Reason *string `type:"string" enum:"ConstraintViolationExceptionReason"` +} + +// String returns the string representation +func (s ConstraintViolationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConstraintViolationException) GoString() string { + return s.String() +} + +func newErrorConstraintViolationException(v protocol.ResponseMetadata) error { + return &ConstraintViolationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConstraintViolationException) Code() string { + return "ConstraintViolationException" +} + +// Message returns the exception's message. +func (s ConstraintViolationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConstraintViolationException) OrigErr() error { + return nil +} + +func (s ConstraintViolationException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConstraintViolationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConstraintViolationException) RequestID() string { + return s.respMetadata.RequestID +} + +type CreateAccountInput struct { + _ struct{} `type:"structure"` + + // The friendly name of the member account. + // + // AccountName is a required field + AccountName *string `min:"1" type:"string" required:"true" sensitive:"true"` + + // The email address of the owner to assign to the new member account. This + // email address must not already be associated with another AWS account. You + // must use a valid email address to complete account creation. You can't access + // the root user of the account or remove an account that was created with an + // invalid email address. + // + // Email is a required field + Email *string `min:"6" type:"string" required:"true" sensitive:"true"` + + // If set to ALLOW, the new account enables IAM users to access account billing + // information if they have the required permissions. If set to DENY, only the + // root user of the new account can access account billing information. For + // more information, see Activating Access to the Billing and Cost Management + // Console (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate) + // in the AWS Billing and Cost Management User Guide. + // + // If you don't specify this parameter, the value defaults to ALLOW. This value + // allows IAM users and roles with the required permissions to access billing + // information for the new account. + IamUserAccessToBilling *string `type:"string" enum:"IAMUserAccessToBilling"` + + // (Optional) + // + // The name of an IAM role that AWS Organizations automatically preconfigures + // in the new member account. This role trusts the master account, allowing + // users in the master account to assume the role, as permitted by the master + // account administrator. The role has administrator permissions in the new + // member account. + // + // If you don't specify this parameter, the role name defaults to OrganizationAccountAccessRole. + // + // For more information about how to use this role to access the member account, + // see Accessing and Administering the Member Accounts in Your Organization + // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role) + // in the AWS Organizations User Guide. Also see steps 2 and 3 in Tutorial: + // Delegate Access Across AWS Accounts Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html) + // in the IAM User Guide. + // + // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate + // this parameter. The pattern can include uppercase letters, lowercase letters, + // digits with no spaces, and any of the following characters: =,.@- + RoleName *string `type:"string"` +} + +// String returns the string representation +func (s CreateAccountInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAccountInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateAccountInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "CreateAccountInput"} if s.AccountName == nil { invalidParams.Add(request.NewErrParamRequired("AccountName")) @@ -11546,6 +12685,10 @@ type CreateAccountStatus struct { // * EMAIL_ALREADY_EXISTS: The account could not be created because another // AWS account with that email address already exists. // + // * GOVCLOUD_ACCOUNT_ALREADY_EXISTS: The account in the AWS GovCloud (US) + // Region could not be created because this Region already includes an account + // with that email address. + // // * INVALID_ADDRESS: The account could not be created because the address // you provided is not valid. // @@ -11553,7 +12696,7 @@ type CreateAccountStatus struct { // you provided is not valid. // // * INTERNAL_FAILURE: The account could not be created because of an internal - // failure. Try again later. If the problem persists, contact Customer Support. + // failure. Try again later. If the problem persists, contact AWS Support. FailureReason *string `type:"string" enum:"CreateAccountFailureReason"` // If the account was created successfully, the unique identifier (ID) of the @@ -11563,7 +12706,7 @@ type CreateAccountStatus struct { // The unique identifier (ID) that references this request. You get this value // from the response of the initial CreateAccount request to create the account. // - // The regex pattern (http://wikipedia.org/wiki/regex) for an create account + // The regex pattern (http://wikipedia.org/wiki/regex) for a create account // request ID string requires "car-" followed by from 8 to 32 lower-case letters // or digits. Id *string `type:"string"` @@ -11633,6 +12776,63 @@ func (s *CreateAccountStatus) SetState(v string) *CreateAccountStatus { return s } +// We can't find a create account request with the CreateAccountRequestId that +// you specified. +type CreateAccountStatusNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s CreateAccountStatusNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAccountStatusNotFoundException) GoString() string { + return s.String() +} + +func newErrorCreateAccountStatusNotFoundException(v protocol.ResponseMetadata) error { + return &CreateAccountStatusNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CreateAccountStatusNotFoundException) Code() string { + return "CreateAccountStatusNotFoundException" +} + +// Message returns the exception's message. +func (s CreateAccountStatusNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CreateAccountStatusNotFoundException) OrigErr() error { + return nil +} + +func (s CreateAccountStatusNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CreateAccountStatusNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CreateAccountStatusNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + type CreateGovCloudAccountInput struct { _ struct{} `type:"structure"` @@ -11647,8 +12847,8 @@ type CreateGovCloudAccountInput struct { // creation. You can't access the root user of the account or remove an account // that was created with an invalid email address. Like all request parameters // for CreateGovCloudAccount, the request for the email address for the AWS - // GovCloud (US) account originates from the commercial Region, not from the - // AWS GovCloud (US) Region. + // GovCloud (US) account originates from the commercial Region. It does not + // come from the AWS GovCloud (US) Region. // // Email is a required field Email *string `min:"6" type:"string" required:"true" sensitive:"true"` @@ -11678,14 +12878,13 @@ type CreateGovCloudAccountInput struct { // For more information about how to use this role to access the member account, // see Accessing and Administering the Member Accounts in Your Organization // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role) - // in the AWS Organizations User Guide and steps 2 and 3 in Tutorial: Delegate - // Access Across AWS Accounts Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html) + // in the AWS Organizations User Guide. See also steps 2 and 3 in Tutorial: + // Delegate Access Across AWS Accounts Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html) // in the IAM User Guide. // // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate - // this parameter is a string of characters that can consist of uppercase letters, - // lowercase letters, digits with no spaces, and any of the following characters: - // =,.@- + // this parameter. The pattern can include uppercase letters, lowercase letters, + // digits with no spaces, and any of the following characters: =,.@- RoleName *string `type:"string"` } @@ -11781,8 +12980,8 @@ type CreateOrganizationInput struct { // in the AWS Organizations User Guide. The consolidated billing feature // subset isn't available for organizations in the AWS GovCloud (US) Region. // - // * ALL: In addition to all the features supported by the consolidated billing - // feature set, the master account can also apply any policy type to any + // * ALL: In addition to all the features that consolidated billing feature + // set supports, the master account can also apply any policy type to any // member account in the organization. For more information, see All features // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#feature-set-all) // in the AWS Organizations User Guide. @@ -11842,13 +13041,13 @@ type CreateOrganizationalUnitInput struct { // The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID string // requires one of the following: // - // * Root - A string that begins with "r-" followed by from 4 to 32 lower-case + // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lower-case letters or digits (the ID of the root that - // the OU is in) followed by a second "-" dash and from 8 to 32 additional - // lower-case letters or digits. + // by from 4 to 32 lowercase letters or digits (the ID of the root that the + // OU is in). This string is followed by a second "-" dash and from 8 to + // 32 additional lowercase letters or digits. // // ParentId is a required field ParentId *string `type:"string" required:"true"` @@ -11921,12 +13120,12 @@ func (s *CreateOrganizationalUnitOutput) SetOrganizationalUnit(v *Organizational type CreatePolicyInput struct { _ struct{} `type:"structure"` - // The policy content to add to the new policy. For example, if you create a - // service control policy (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) - // (SCP), this string must be JSON text that specifies the permissions that - // admins in attached accounts can delegate to their users, groups, and roles. - // For more information about the SCP syntax, see Service Control Policy Syntax - // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) + // The policy content to add to the new policy. For example, you could create + // a service control policy (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) + // (SCP) that specifies the permissions that administrators in attached accounts + // can delegate to their users, groups, and roles. The string for this SCP must + // be JSON text. For more information about the SCP syntax, see Service Control + // Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) // in the AWS Organizations User Guide. // // Content is a required field @@ -11948,9 +13147,6 @@ type CreatePolicyInput struct { // The type of policy to create. // - // In the current release, the only type of policy that you can create is a - // service control policy (SCP). - // // Type is a required field Type *string `type:"string" required:"true" enum:"PolicyType"` } @@ -12047,7 +13243,7 @@ type DeclineHandshakeInput struct { // can get the ID from the ListHandshakesForAccount operation. // // The regex pattern (http://wikipedia.org/wiki/regex) for handshake ID string - // requires "h-" followed by from 8 to 32 lower-case letters or digits. + // requires "h-" followed by from 8 to 32 lowercase letters or digits. // // HandshakeId is a required field HandshakeId *string `type:"string" required:"true"` @@ -12141,9 +13337,9 @@ type DeleteOrganizationalUnitInput struct { // You can get the ID from the ListOrganizationalUnitsForParent operation. // // The regex pattern (http://wikipedia.org/wiki/regex) for an organizational - // unit ID string requires "ou-" followed by from 4 to 32 lower-case letters - // or digits (the ID of the root that contains the OU) followed by a second - // "-" dash and from 8 to 32 additional lower-case letters or digits. + // unit ID string requires "ou-" followed by from 4 to 32 lowercase letters + // or digits (the ID of the root that contains the OU). This string is followed + // by a second "-" dash and from 8 to 32 additional lowercase letters or digits. // // OrganizationalUnitId is a required field OrganizationalUnitId *string `type:"string" required:"true"` @@ -12199,7 +13395,8 @@ type DeletePolicyInput struct { // get the ID from the ListPolicies or ListPoliciesForTarget operations. // // The regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string - // requires "p-" followed by from 8 to 128 lower-case letters or digits. + // requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, + // or the underscore character (_). // // PolicyId is a required field PolicyId *string `type:"string" required:"true"` @@ -12321,7 +13518,7 @@ type DescribeCreateAccountStatusInput struct { // ListCreateAccountStatus operation. // // The regex pattern (http://wikipedia.org/wiki/regex) for a create account - // request ID string requires "car-" followed by from 8 to 32 lower-case letters + // request ID string requires "car-" followed by from 8 to 32 lowercase letters // or digits. // // CreateAccountRequestId is a required field @@ -12380,6 +13577,78 @@ func (s *DescribeCreateAccountStatusOutput) SetCreateAccountStatus(v *CreateAcco return s } +type DescribeEffectivePolicyInput struct { + _ struct{} `type:"structure"` + + // The type of policy that you want information about. + // + // PolicyType is a required field + PolicyType *string `type:"string" required:"true" enum:"EffectivePolicyType"` + + // When you're signed in as the master account, specify the ID of the account + // that you want details about. Specifying an organization root or OU as the + // target is not supported. + TargetId *string `type:"string"` +} + +// String returns the string representation +func (s DescribeEffectivePolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEffectivePolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeEffectivePolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeEffectivePolicyInput"} + if s.PolicyType == nil { + invalidParams.Add(request.NewErrParamRequired("PolicyType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPolicyType sets the PolicyType field's value. +func (s *DescribeEffectivePolicyInput) SetPolicyType(v string) *DescribeEffectivePolicyInput { + s.PolicyType = &v + return s +} + +// SetTargetId sets the TargetId field's value. +func (s *DescribeEffectivePolicyInput) SetTargetId(v string) *DescribeEffectivePolicyInput { + s.TargetId = &v + return s +} + +type DescribeEffectivePolicyOutput struct { + _ struct{} `type:"structure"` + + // The contents of the effective policy. + EffectivePolicy *EffectivePolicy `type:"structure"` +} + +// String returns the string representation +func (s DescribeEffectivePolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEffectivePolicyOutput) GoString() string { + return s.String() +} + +// SetEffectivePolicy sets the EffectivePolicy field's value. +func (s *DescribeEffectivePolicyOutput) SetEffectivePolicy(v *EffectivePolicy) *DescribeEffectivePolicyOutput { + s.EffectivePolicy = v + return s +} + type DescribeHandshakeInput struct { _ struct{} `type:"structure"` @@ -12388,7 +13657,7 @@ type DescribeHandshakeInput struct { // or from a call to ListHandshakesForAccount or ListHandshakesForOrganization. // // The regex pattern (http://wikipedia.org/wiki/regex) for handshake ID string - // requires "h-" followed by from 8 to 32 lower-case letters or digits. + // requires "h-" followed by from 8 to 32 lowercase letters or digits. // // HandshakeId is a required field HandshakeId *string `type:"string" required:"true"` @@ -12490,9 +13759,9 @@ type DescribeOrganizationalUnitInput struct { // about. You can get the ID from the ListOrganizationalUnitsForParent operation. // // The regex pattern (http://wikipedia.org/wiki/regex) for an organizational - // unit ID string requires "ou-" followed by from 4 to 32 lower-case letters - // or digits (the ID of the root that contains the OU) followed by a second - // "-" dash and from 8 to 32 additional lower-case letters or digits. + // unit ID string requires "ou-" followed by from 4 to 32 lowercase letters + // or digits (the ID of the root that contains the OU). This string is followed + // by a second "-" dash and from 8 to 32 additional lowercase letters or digits. // // OrganizationalUnitId is a required field OrganizationalUnitId *string `type:"string" required:"true"` @@ -12557,7 +13826,8 @@ type DescribePolicyInput struct { // can get the ID from the ListPolicies or ListPoliciesForTarget operations. // // The regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string - // requires "p-" followed by from 8 to 128 lower-case letters or digits. + // requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, + // or the underscore character (_). // // PolicyId is a required field PolicyId *string `type:"string" required:"true"` @@ -12615,34 +13885,92 @@ func (s *DescribePolicyOutput) SetPolicy(v *Policy) *DescribePolicyOutput { return s } -type DetachPolicyInput struct { - _ struct{} `type:"structure"` +// We can't find the destination container (a root or OU) with the ParentId +// that you specified. +type DestinationParentNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The unique identifier (ID) of the policy you want to detach. You can get - // the ID from the ListPolicies or ListPoliciesForTarget operations. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string - // requires "p-" followed by from 8 to 128 lower-case letters or digits. - // - // PolicyId is a required field - PolicyId *string `type:"string" required:"true"` + Message_ *string `locationName:"Message" type:"string"` +} - // The unique identifier (ID) of the root, OU, or account that you want to detach - // the policy from. You can get the ID from the ListRoots, ListOrganizationalUnitsForParent, - // or ListAccounts operations. - // +// String returns the string representation +func (s DestinationParentNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DestinationParentNotFoundException) GoString() string { + return s.String() +} + +func newErrorDestinationParentNotFoundException(v protocol.ResponseMetadata) error { + return &DestinationParentNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DestinationParentNotFoundException) Code() string { + return "DestinationParentNotFoundException" +} + +// Message returns the exception's message. +func (s DestinationParentNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DestinationParentNotFoundException) OrigErr() error { + return nil +} + +func (s DestinationParentNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DestinationParentNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DestinationParentNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +type DetachPolicyInput struct { + _ struct{} `type:"structure"` + + // The unique identifier (ID) of the policy you want to detach. You can get + // the ID from the ListPolicies or ListPoliciesForTarget operations. + // + // The regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string + // requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, + // or the underscore character (_). + // + // PolicyId is a required field + PolicyId *string `type:"string" required:"true"` + + // The unique identifier (ID) of the root, OU, or account that you want to detach + // the policy from. You can get the ID from the ListRoots, ListOrganizationalUnitsForParent, + // or ListAccounts operations. + // // The regex pattern (http://wikipedia.org/wiki/regex) for a target ID string // requires one of the following: // - // * Root - A string that begins with "r-" followed by from 4 to 32 lower-case + // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // // * Account - A string that consists of exactly 12 digits. // // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lower-case letters or digits (the ID of the root that - // the OU is in) followed by a second "-" dash and from 8 to 32 additional - // lower-case letters or digits. + // by from 4 to 32 lowercase letters or digits (the ID of the root that the + // OU is in). This string is followed by a second "-" dash and from 8 to + // 32 additional lowercase letters or digits. // // TargetId is a required field TargetId *string `type:"string" required:"true"` @@ -12769,7 +14097,7 @@ type DisablePolicyTypeInput struct { // type. You can get the ID from the ListRoots operation. // // The regex pattern (http://wikipedia.org/wiki/regex) for a root ID string - // requires "r-" followed by from 4 to 32 lower-case letters or digits. + // requires "r-" followed by from 4 to 32 lowercase letters or digits. // // RootId is a required field RootId *string `type:"string" required:"true"` @@ -12836,6 +14164,402 @@ func (s *DisablePolicyTypeOutput) SetRoot(v *Root) *DisablePolicyTypeOutput { return s } +// That account is already present in the specified destination. +type DuplicateAccountException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DuplicateAccountException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DuplicateAccountException) GoString() string { + return s.String() +} + +func newErrorDuplicateAccountException(v protocol.ResponseMetadata) error { + return &DuplicateAccountException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DuplicateAccountException) Code() string { + return "DuplicateAccountException" +} + +// Message returns the exception's message. +func (s DuplicateAccountException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DuplicateAccountException) OrigErr() error { + return nil +} + +func (s DuplicateAccountException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DuplicateAccountException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DuplicateAccountException) RequestID() string { + return s.respMetadata.RequestID +} + +// A handshake with the same action and target already exists. For example, +// if you invited an account to join your organization, the invited account +// might already have a pending invitation from this organization. If you intend +// to resend an invitation to an account, ensure that existing handshakes that +// might be considered duplicates are canceled or declined. +type DuplicateHandshakeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DuplicateHandshakeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DuplicateHandshakeException) GoString() string { + return s.String() +} + +func newErrorDuplicateHandshakeException(v protocol.ResponseMetadata) error { + return &DuplicateHandshakeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DuplicateHandshakeException) Code() string { + return "DuplicateHandshakeException" +} + +// Message returns the exception's message. +func (s DuplicateHandshakeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DuplicateHandshakeException) OrigErr() error { + return nil +} + +func (s DuplicateHandshakeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DuplicateHandshakeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DuplicateHandshakeException) RequestID() string { + return s.respMetadata.RequestID +} + +// An OU with the same name already exists. +type DuplicateOrganizationalUnitException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DuplicateOrganizationalUnitException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DuplicateOrganizationalUnitException) GoString() string { + return s.String() +} + +func newErrorDuplicateOrganizationalUnitException(v protocol.ResponseMetadata) error { + return &DuplicateOrganizationalUnitException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DuplicateOrganizationalUnitException) Code() string { + return "DuplicateOrganizationalUnitException" +} + +// Message returns the exception's message. +func (s DuplicateOrganizationalUnitException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DuplicateOrganizationalUnitException) OrigErr() error { + return nil +} + +func (s DuplicateOrganizationalUnitException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DuplicateOrganizationalUnitException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DuplicateOrganizationalUnitException) RequestID() string { + return s.respMetadata.RequestID +} + +// The selected policy is already attached to the specified target. +type DuplicatePolicyAttachmentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DuplicatePolicyAttachmentException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DuplicatePolicyAttachmentException) GoString() string { + return s.String() +} + +func newErrorDuplicatePolicyAttachmentException(v protocol.ResponseMetadata) error { + return &DuplicatePolicyAttachmentException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DuplicatePolicyAttachmentException) Code() string { + return "DuplicatePolicyAttachmentException" +} + +// Message returns the exception's message. +func (s DuplicatePolicyAttachmentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DuplicatePolicyAttachmentException) OrigErr() error { + return nil +} + +func (s DuplicatePolicyAttachmentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DuplicatePolicyAttachmentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DuplicatePolicyAttachmentException) RequestID() string { + return s.respMetadata.RequestID +} + +// A policy with the same name already exists. +type DuplicatePolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DuplicatePolicyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DuplicatePolicyException) GoString() string { + return s.String() +} + +func newErrorDuplicatePolicyException(v protocol.ResponseMetadata) error { + return &DuplicatePolicyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DuplicatePolicyException) Code() string { + return "DuplicatePolicyException" +} + +// Message returns the exception's message. +func (s DuplicatePolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DuplicatePolicyException) OrigErr() error { + return nil +} + +func (s DuplicatePolicyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DuplicatePolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DuplicatePolicyException) RequestID() string { + return s.respMetadata.RequestID +} + +// Contains rules to be applied to the affected accounts. The effective policy +// is the aggregation of any policies the account inherits, plus any policy +// directly attached to the account. +type EffectivePolicy struct { + _ struct{} `type:"structure"` + + // The time of the last update to this policy. + LastUpdatedTimestamp *time.Time `type:"timestamp"` + + // The text content of the policy. + PolicyContent *string `min:"1" type:"string"` + + // The policy type. + PolicyType *string `type:"string" enum:"EffectivePolicyType"` + + // The account ID of the policy target. + TargetId *string `type:"string"` +} + +// String returns the string representation +func (s EffectivePolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EffectivePolicy) GoString() string { + return s.String() +} + +// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. +func (s *EffectivePolicy) SetLastUpdatedTimestamp(v time.Time) *EffectivePolicy { + s.LastUpdatedTimestamp = &v + return s +} + +// SetPolicyContent sets the PolicyContent field's value. +func (s *EffectivePolicy) SetPolicyContent(v string) *EffectivePolicy { + s.PolicyContent = &v + return s +} + +// SetPolicyType sets the PolicyType field's value. +func (s *EffectivePolicy) SetPolicyType(v string) *EffectivePolicy { + s.PolicyType = &v + return s +} + +// SetTargetId sets the TargetId field's value. +func (s *EffectivePolicy) SetTargetId(v string) *EffectivePolicy { + s.TargetId = &v + return s +} + +// If you ran this action on the master account, this policy type is not enabled. +// If you ran the action on a member account, the account doesn't have an effective +// policy of this type. Contact the administrator of your organization about +// attaching a policy of this type to the account. +type EffectivePolicyNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s EffectivePolicyNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EffectivePolicyNotFoundException) GoString() string { + return s.String() +} + +func newErrorEffectivePolicyNotFoundException(v protocol.ResponseMetadata) error { + return &EffectivePolicyNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EffectivePolicyNotFoundException) Code() string { + return "EffectivePolicyNotFoundException" +} + +// Message returns the exception's message. +func (s EffectivePolicyNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EffectivePolicyNotFoundException) OrigErr() error { + return nil +} + +func (s EffectivePolicyNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EffectivePolicyNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EffectivePolicyNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + type EnableAWSServiceAccessInput struct { _ struct{} `type:"structure"` @@ -12943,7 +14667,7 @@ type EnablePolicyTypeInput struct { // type. You can get the ID from the ListRoots operation. // // The regex pattern (http://wikipedia.org/wiki/regex) for a root ID string - // requires "r-" followed by from 4 to 32 lower-case letters or digits. + // requires "r-" followed by from 4 to 32 lowercase letters or digits. // // RootId is a required field RootId *string `type:"string" required:"true"` @@ -13046,25 +14770,84 @@ func (s *EnabledServicePrincipal) SetServicePrincipal(v string) *EnabledServiceP return s } -// Contains information that must be exchanged to securely establish a relationship -// between two accounts (an originator and a recipient). For example, when a -// master account (the originator) invites another account (the recipient) to -// join its organization, the two accounts exchange information as a series -// of handshake requests and responses. -// -// Note: Handshakes that are CANCELED, ACCEPTED, or DECLINED show up in lists -// for only 30 days after entering that state After that they are deleted. -type Handshake struct { - _ struct{} `type:"structure"` +// AWS Organizations couldn't perform the operation because your organization +// hasn't finished initializing. This can take up to an hour. Try again later. +// If after one hour you continue to receive this error, contact AWS Support +// (https://console.aws.amazon.com/support/home#/). +type FinalizingOrganizationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The type of handshake, indicating what action occurs when the recipient accepts - // the handshake. The following handshake types are supported: - // - // * INVITE: This type of handshake represents a request to join an organization. - // It is always sent from the master account to only non-member accounts. - // - // * ENABLE_ALL_FEATURES: This type of handshake represents a request to - // enable all features in an organization. It is always sent from the master + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s FinalizingOrganizationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FinalizingOrganizationException) GoString() string { + return s.String() +} + +func newErrorFinalizingOrganizationException(v protocol.ResponseMetadata) error { + return &FinalizingOrganizationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FinalizingOrganizationException) Code() string { + return "FinalizingOrganizationException" +} + +// Message returns the exception's message. +func (s FinalizingOrganizationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FinalizingOrganizationException) OrigErr() error { + return nil +} + +func (s FinalizingOrganizationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FinalizingOrganizationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FinalizingOrganizationException) RequestID() string { + return s.respMetadata.RequestID +} + +// Contains information that must be exchanged to securely establish a relationship +// between two accounts (an originator and a recipient). For example, assume +// that a master account (the originator) invites another account (the recipient) +// to join its organization. In that case, the two accounts exchange information +// as a series of handshake requests and responses. +// +// Note: Handshakes that are CANCELED, ACCEPTED, or DECLINED show up in lists +// for only 30 days after entering that state. After that, they are deleted. +type Handshake struct { + _ struct{} `type:"structure"` + + // The type of handshake, indicating what action occurs when the recipient accepts + // the handshake. The following handshake types are supported: + // + // * INVITE: This type of handshake represents a request to join an organization. + // It is always sent from the master account to only non-member accounts. + // + // * ENABLE_ALL_FEATURES: This type of handshake represents a request to + // enable all features in an organization. It is always sent from the master // account to only invited member accounts. Created accounts do not receive // this because those accounts were created by the organization's master // account and approval is inferred. @@ -13188,6 +14971,158 @@ func (s *Handshake) SetState(v string) *Handshake { return s } +// The specified handshake is already in the requested state. For example, you +// can't accept a handshake that was already accepted. +type HandshakeAlreadyInStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s HandshakeAlreadyInStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HandshakeAlreadyInStateException) GoString() string { + return s.String() +} + +func newErrorHandshakeAlreadyInStateException(v protocol.ResponseMetadata) error { + return &HandshakeAlreadyInStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s HandshakeAlreadyInStateException) Code() string { + return "HandshakeAlreadyInStateException" +} + +// Message returns the exception's message. +func (s HandshakeAlreadyInStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s HandshakeAlreadyInStateException) OrigErr() error { + return nil +} + +func (s HandshakeAlreadyInStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s HandshakeAlreadyInStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s HandshakeAlreadyInStateException) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested operation would violate the constraint identified in the reason +// code. +// +// Some of the reasons in the following list might not be applicable to this +// specific API or operation: +// +// * ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on +// the number of accounts in an organization. Note that deleted and closed +// accounts still count toward your limit. If you get this exception immediately +// after creating the organization, wait one hour and try again. If after +// an hour it continues to fail with this error, contact AWS Support (https://console.aws.amazon.com/support/home#/). +// +// * ALREADY_IN_AN_ORGANIZATION: The handshake request is invalid because +// the invited account is already a member of an organization. +// +// * HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of +// handshakes that you can send in one day. +// +// * INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES: You can't issue new invitations +// to join an organization while it's in the process of enabling all features. +// You can resume inviting accounts after you finalize the process when all +// accounts have agreed to the change. +// +// * ORGANIZATION_ALREADY_HAS_ALL_FEATURES: The handshake request is invalid +// because the organization has already enabled all features. +// +// * ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD: The request failed because +// the account is from a different marketplace than the accounts in the organization. +// For example, accounts with India addresses must be associated with the +// AISPL marketplace. All accounts in an organization must be from the same +// marketplace. +// +// * ORGANIZATION_MEMBERSHIP_CHANGE_RATE_LIMIT_EXCEEDED: You attempted to +// change the membership of an account too quickly after its previous change. +// +// * PAYMENT_INSTRUMENT_REQUIRED: You can't complete the operation with an +// account that doesn't have a payment instrument, such as a credit card, +// associated with it. +type HandshakeConstraintViolationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Reason *string `type:"string" enum:"HandshakeConstraintViolationExceptionReason"` +} + +// String returns the string representation +func (s HandshakeConstraintViolationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HandshakeConstraintViolationException) GoString() string { + return s.String() +} + +func newErrorHandshakeConstraintViolationException(v protocol.ResponseMetadata) error { + return &HandshakeConstraintViolationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s HandshakeConstraintViolationException) Code() string { + return "HandshakeConstraintViolationException" +} + +// Message returns the exception's message. +func (s HandshakeConstraintViolationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s HandshakeConstraintViolationException) OrigErr() error { + return nil +} + +func (s HandshakeConstraintViolationException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s HandshakeConstraintViolationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s HandshakeConstraintViolationException) RequestID() string { + return s.respMetadata.RequestID +} + // Specifies the criteria that are used to select the handshakes for the operation. type HandshakeFilter struct { _ struct{} `type:"structure"` @@ -13229,6 +15164,62 @@ func (s *HandshakeFilter) SetParentHandshakeId(v string) *HandshakeFilter { return s } +// We can't find a handshake with the HandshakeId that you specified. +type HandshakeNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s HandshakeNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HandshakeNotFoundException) GoString() string { + return s.String() +} + +func newErrorHandshakeNotFoundException(v protocol.ResponseMetadata) error { + return &HandshakeNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s HandshakeNotFoundException) Code() string { + return "HandshakeNotFoundException" +} + +// Message returns the exception's message. +func (s HandshakeNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s HandshakeNotFoundException) OrigErr() error { + return nil +} + +func (s HandshakeNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s HandshakeNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s HandshakeNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Identifies a participant in a handshake. type HandshakeParty struct { _ struct{} `type:"structure"` @@ -13348,6 +15339,185 @@ func (s *HandshakeResource) SetValue(v string) *HandshakeResource { return s } +// You can't perform the operation on the handshake in its current state. For +// example, you can't cancel a handshake that was already accepted or accept +// a handshake that was already declined. +type InvalidHandshakeTransitionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidHandshakeTransitionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidHandshakeTransitionException) GoString() string { + return s.String() +} + +func newErrorInvalidHandshakeTransitionException(v protocol.ResponseMetadata) error { + return &InvalidHandshakeTransitionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidHandshakeTransitionException) Code() string { + return "InvalidHandshakeTransitionException" +} + +// Message returns the exception's message. +func (s InvalidHandshakeTransitionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidHandshakeTransitionException) OrigErr() error { + return nil +} + +func (s InvalidHandshakeTransitionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidHandshakeTransitionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidHandshakeTransitionException) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested operation failed because you provided invalid values for one +// or more of the request parameters. This exception includes a reason that +// contains additional information about the violated limit: +// +// Some of the reasons in the following list might not be applicable to this +// specific API or operation: +// +// * IMMUTABLE_POLICY: You specified a policy that is managed by AWS and +// can't be modified. +// +// * INPUT_REQUIRED: You must include a value for all required parameters. +// +// * INVALID_ENUM: You specified an invalid value. +// +// * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. +// +// * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid +// characters. +// +// * INVALID_LIST_MEMBER: You provided a list to a parameter that contains +// at least one invalid value. +// +// * INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter +// from the response to a previous call of the operation. +// +// * INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, +// organization, or email) as a party. +// +// * INVALID_PATTERN: You provided a value that doesn't match the required +// pattern. +// +// * INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't +// match the required pattern. +// +// * INVALID_ROLE_NAME: You provided a role name that isn't valid. A role +// name can't begin with the reserved prefix AWSServiceRoleFor. +// +// * INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource +// Name (ARN) for the organization. +// +// * INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. +// +// * INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system +// tag. You can’t add, edit, or delete system tag keys because they're +// reserved for AWS use. System tags don’t count against your tags per +// resource limit. +// +// * MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter +// for the operation. +// +// * MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer +// than allowed. +// +// * MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger +// value than allowed. +// +// * MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter +// than allowed. +// +// * MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller +// value than allowed. +// +// * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only +// between entities in the same root. +type InvalidInputException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Reason *string `type:"string" enum:"InvalidInputExceptionReason"` +} + +// String returns the string representation +func (s InvalidInputException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInputException) GoString() string { + return s.String() +} + +func newErrorInvalidInputException(v protocol.ResponseMetadata) error { + return &InvalidInputException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInputException) Code() string { + return "InvalidInputException" +} + +// Message returns the exception's message. +func (s InvalidInputException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInputException) OrigErr() error { + return nil +} + +func (s InvalidInputException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInputException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInputException) RequestID() string { + return s.respMetadata.RequestID +} + type InviteAccountToOrganizationInput struct { _ struct{} `type:"structure"` @@ -13791,13 +15961,13 @@ type ListChildrenInput struct { // The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID string // requires one of the following: // - // * Root - A string that begins with "r-" followed by from 4 to 32 lower-case + // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lower-case letters or digits (the ID of the root that - // the OU is in) followed by a second "-" dash and from 8 to 32 additional - // lower-case letters or digits. + // by from 4 to 32 lowercase letters or digits (the ID of the root that the + // OU is in). This string is followed by a second "-" dash and from 8 to + // 32 additional lowercase letters or digits. // // ParentId is a required field ParentId *string `type:"string" required:"true"` @@ -14002,9 +16172,9 @@ type ListHandshakesForAccountInput struct { // Filters the handshakes that you want included in the response. The default // is all types. Use the ActionType element to limit the output to only a specified // type, such as INVITE, ENABLE_ALL_FEATURES, or APPROVE_ALL_FEATURES. Alternatively, - // for the ENABLE_ALL_FEATURES handshake that generates a separate child handshake - // for each member account, you can specify ParentHandshakeId to see only the - // handshakes that were generated by that parent request. + // you can specify the ENABLE_ALL_FEATURES handshake, which generates a separate + // child handshake for each member account. When you do specify ParentHandshakeId + // to see only the handshakes that were generated by that parent request. Filter *HandshakeFilter `type:"structure"` // (Optional) Use this to limit the number of results you want included per @@ -14109,9 +16279,9 @@ type ListHandshakesForOrganizationInput struct { // A filter of the handshakes that you want included in the response. The default // is all types. Use the ActionType element to limit the output to only a specified // type, such as INVITE, ENABLE-ALL-FEATURES, or APPROVE-ALL-FEATURES. Alternatively, - // for the ENABLE-ALL-FEATURES handshake that generates a separate child handshake - // for each member account, you can specify the ParentHandshakeId to see only - // the handshakes that were generated by that parent request. + // you can specify the ENABLE-ALL-FEATURES handshake, which generates a separate + // child handshake for each member account. When you do, specify the ParentHandshakeId + // to see only the handshakes that were generated by that parent request. Filter *HandshakeFilter `type:"structure"` // (Optional) Use this to limit the number of results you want included per @@ -14236,13 +16406,13 @@ type ListOrganizationalUnitsForParentInput struct { // The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID string // requires one of the following: // - // * Root - A string that begins with "r-" followed by from 4 to 32 lower-case + // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lower-case letters or digits (the ID of the root that - // the OU is in) followed by a second "-" dash and from 8 to 32 additional - // lower-case letters or digits. + // by from 4 to 32 lowercase letters or digits (the ID of the root that the + // OU is in). This string is followed by a second "-" dash and from 8 to + // 32 additional lowercase letters or digits. // // ParentId is a required field ParentId *string `type:"string" required:"true"` @@ -14340,9 +16510,9 @@ type ListParentsInput struct { // * Account - A string that consists of exactly 12 digits. // // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lower-case letters or digits (the ID of the root that - // contains the OU) followed by a second "-" dash and from 8 to 32 additional - // lower-case letters or digits. + // by from 4 to 32 lowercase letters or digits (the ID of the root that contains + // the OU). This string is followed by a second "-" dash and from 8 to 32 + // additional lowercase letters or digits. // // ChildId is a required field ChildId *string `type:"string" required:"true"` @@ -14476,15 +16646,15 @@ type ListPoliciesForTargetInput struct { // The regex pattern (http://wikipedia.org/wiki/regex) for a target ID string // requires one of the following: // - // * Root - A string that begins with "r-" followed by from 4 to 32 lower-case + // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase // letters or digits. // // * Account - A string that consists of exactly 12 digits. // // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lower-case letters or digits (the ID of the root that - // the OU is in) followed by a second "-" dash and from 8 to 32 additional - // lower-case letters or digits. + // by from 4 to 32 lowercase letters or digits (the ID of the root that the + // OU is in). This string is followed by a second "-" dash and from 8 to + // 32 additional lowercase letters or digits. // // TargetId is a required field TargetId *string `type:"string" required:"true"` @@ -14888,7 +17058,8 @@ type ListTargetsForPolicyInput struct { // The unique identifier (ID) of the policy whose attachments you want to know. // // The regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string - // requires "p-" followed by from 8 to 128 lower-case letters or digits. + // requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, + // or the underscore character (_). // // PolicyId is a required field PolicyId *string `type:"string" required:"true"` @@ -14975,66 +17146,183 @@ func (s *ListTargetsForPolicyOutput) SetTargets(v []*PolicyTargetSummary) *ListT return s } -type MoveAccountInput struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the account that you want to move. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for an account ID string - // requires exactly 12 digits. - // - // AccountId is a required field - AccountId *string `type:"string" required:"true"` - - // The unique identifier (ID) of the root or organizational unit that you want - // to move the account to. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID string - // requires one of the following: - // - // * Root - A string that begins with "r-" followed by from 4 to 32 lower-case - // letters or digits. - // - // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lower-case letters or digits (the ID of the root that - // the OU is in) followed by a second "-" dash and from 8 to 32 additional - // lower-case letters or digits. - // - // DestinationParentId is a required field - DestinationParentId *string `type:"string" required:"true"` +// The provided policy document doesn't meet the requirements of the specified +// policy type. For example, the syntax might be incorrect. For details about +// service control policy syntax, see Service Control Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) +// in the AWS Organizations User Guide. +type MalformedPolicyDocumentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The unique identifier (ID) of the root or organizational unit that you want - // to move the account from. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID string - // requires one of the following: - // - // * Root - A string that begins with "r-" followed by from 4 to 32 lower-case - // letters or digits. - // - // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lower-case letters or digits (the ID of the root that - // the OU is in) followed by a second "-" dash and from 8 to 32 additional - // lower-case letters or digits. - // - // SourceParentId is a required field - SourceParentId *string `type:"string" required:"true"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s MoveAccountInput) String() string { +func (s MalformedPolicyDocumentException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MoveAccountInput) GoString() string { +func (s MalformedPolicyDocumentException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *MoveAccountInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MoveAccountInput"} - if s.AccountId == nil { +func newErrorMalformedPolicyDocumentException(v protocol.ResponseMetadata) error { + return &MalformedPolicyDocumentException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MalformedPolicyDocumentException) Code() string { + return "MalformedPolicyDocumentException" +} + +// Message returns the exception's message. +func (s MalformedPolicyDocumentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MalformedPolicyDocumentException) OrigErr() error { + return nil +} + +func (s MalformedPolicyDocumentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MalformedPolicyDocumentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MalformedPolicyDocumentException) RequestID() string { + return s.respMetadata.RequestID +} + +// You can't remove a master account from an organization. If you want the master +// account to become a member account in another organization, you must first +// delete the current organization of the master account. +type MasterCannotLeaveOrganizationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s MasterCannotLeaveOrganizationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MasterCannotLeaveOrganizationException) GoString() string { + return s.String() +} + +func newErrorMasterCannotLeaveOrganizationException(v protocol.ResponseMetadata) error { + return &MasterCannotLeaveOrganizationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MasterCannotLeaveOrganizationException) Code() string { + return "MasterCannotLeaveOrganizationException" +} + +// Message returns the exception's message. +func (s MasterCannotLeaveOrganizationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MasterCannotLeaveOrganizationException) OrigErr() error { + return nil +} + +func (s MasterCannotLeaveOrganizationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MasterCannotLeaveOrganizationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MasterCannotLeaveOrganizationException) RequestID() string { + return s.respMetadata.RequestID +} + +type MoveAccountInput struct { + _ struct{} `type:"structure"` + + // The unique identifier (ID) of the account that you want to move. + // + // The regex pattern (http://wikipedia.org/wiki/regex) for an account ID string + // requires exactly 12 digits. + // + // AccountId is a required field + AccountId *string `type:"string" required:"true"` + + // The unique identifier (ID) of the root or organizational unit that you want + // to move the account to. + // + // The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID string + // requires one of the following: + // + // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase + // letters or digits. + // + // * Organizational unit (OU) - A string that begins with "ou-" followed + // by from 4 to 32 lowercase letters or digits (the ID of the root that the + // OU is in). This string is followed by a second "-" dash and from 8 to + // 32 additional lowercase letters or digits. + // + // DestinationParentId is a required field + DestinationParentId *string `type:"string" required:"true"` + + // The unique identifier (ID) of the root or organizational unit that you want + // to move the account from. + // + // The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID string + // requires one of the following: + // + // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase + // letters or digits. + // + // * Organizational unit (OU) - A string that begins with "ou-" followed + // by from 4 to 32 lowercase letters or digits (the ID of the root that the + // OU is in). This string is followed by a second "-" dash and from 8 to + // 32 additional lowercase letters or digits. + // + // SourceParentId is a required field + SourceParentId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s MoveAccountInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MoveAccountInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *MoveAccountInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MoveAccountInput"} + if s.AccountId == nil { invalidParams.Add(request.NewErrParamRequired("AccountId")) } if s.DestinationParentId == nil { @@ -15085,7 +17373,7 @@ func (s MoveAccountOutput) GoString() string { // Contains details about an organization. An organization is a collection of // accounts that are centrally managed together using consolidated billing, // organized hierarchically with organizational units (OUs), and controlled -// with policies . +// with policies. type Organization struct { _ struct{} `type:"structure"` @@ -15191,6 +17479,63 @@ func (s *Organization) SetMasterAccountId(v string) *Organization { return s } +// The organization isn't empty. To delete an organization, you must first remove +// all accounts except the master account, delete all OUs, and delete all policies. +type OrganizationNotEmptyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s OrganizationNotEmptyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationNotEmptyException) GoString() string { + return s.String() +} + +func newErrorOrganizationNotEmptyException(v protocol.ResponseMetadata) error { + return &OrganizationNotEmptyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OrganizationNotEmptyException) Code() string { + return "OrganizationNotEmptyException" +} + +// Message returns the exception's message. +func (s OrganizationNotEmptyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OrganizationNotEmptyException) OrigErr() error { + return nil +} + +func (s OrganizationNotEmptyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OrganizationNotEmptyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OrganizationNotEmptyException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains details about an organizational unit (OU). An OU is a container // of AWS accounts within a root of an organization. Policies that are attached // to an OU apply to all accounts contained in that OU and in any child OUs. @@ -15208,8 +17553,8 @@ type OrganizationalUnit struct { // // The regex pattern (http://wikipedia.org/wiki/regex) for an organizational // unit ID string requires "ou-" followed by from 4 to 32 lower-case letters - // or digits (the ID of the root that contains the OU) followed by a second - // "-" dash and from 8 to 32 additional lower-case letters or digits. + // or digits (the ID of the root that contains the OU). This string is followed + // by a second "-" dash and from 8 to 32 additional lower-case letters or digits. Id *string `type:"string"` // The friendly name of this OU. @@ -15248,6 +17593,119 @@ func (s *OrganizationalUnit) SetName(v string) *OrganizationalUnit { return s } +// The specified OU is not empty. Move all accounts to another root or to other +// OUs, remove all child OUs, and try the operation again. +type OrganizationalUnitNotEmptyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s OrganizationalUnitNotEmptyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationalUnitNotEmptyException) GoString() string { + return s.String() +} + +func newErrorOrganizationalUnitNotEmptyException(v protocol.ResponseMetadata) error { + return &OrganizationalUnitNotEmptyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OrganizationalUnitNotEmptyException) Code() string { + return "OrganizationalUnitNotEmptyException" +} + +// Message returns the exception's message. +func (s OrganizationalUnitNotEmptyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OrganizationalUnitNotEmptyException) OrigErr() error { + return nil +} + +func (s OrganizationalUnitNotEmptyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OrganizationalUnitNotEmptyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OrganizationalUnitNotEmptyException) RequestID() string { + return s.respMetadata.RequestID +} + +// We can't find an OU with the OrganizationalUnitId that you specified. +type OrganizationalUnitNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s OrganizationalUnitNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationalUnitNotFoundException) GoString() string { + return s.String() +} + +func newErrorOrganizationalUnitNotFoundException(v protocol.ResponseMetadata) error { + return &OrganizationalUnitNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OrganizationalUnitNotFoundException) Code() string { + return "OrganizationalUnitNotFoundException" +} + +// Message returns the exception's message. +func (s OrganizationalUnitNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OrganizationalUnitNotFoundException) OrigErr() error { + return nil +} + +func (s OrganizationalUnitNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OrganizationalUnitNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OrganizationalUnitNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains information about either a root or an organizational unit (OU) that // can contain OUs or accounts in an organization. type Parent struct { @@ -15258,13 +17716,13 @@ type Parent struct { // The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID string // requires one of the following: // - // * Root: a string that begins with "r-" followed by from 4 to 32 lower-case + // * Root: A string that begins with "r-" followed by from 4 to 32 lower-case // letters or digits. // - // * Organizational unit (OU): a string that begins with "ou-" followed by + // * Organizational unit (OU): A string that begins with "ou-" followed by // from 4 to 32 lower-case letters or digits (the ID of the root that the - // OU is in) followed by a second "-" dash and from 8 to 32 additional lower-case - // letters or digits. + // OU is in). This string is followed by a second "-" dash and from 8 to + // 32 additional lower-case letters or digits. Id *string `type:"string"` // The type of the parent entity. @@ -15293,6 +17751,62 @@ func (s *Parent) SetType(v string) *Parent { return s } +// We can't find a root or OU with the ParentId that you specified. +type ParentNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ParentNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ParentNotFoundException) GoString() string { + return s.String() +} + +func newErrorParentNotFoundException(v protocol.ResponseMetadata) error { + return &ParentNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ParentNotFoundException) Code() string { + return "ParentNotFoundException" +} + +// Message returns the exception's message. +func (s ParentNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ParentNotFoundException) OrigErr() error { + return nil +} + +func (s ParentNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ParentNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ParentNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains rules to be applied to the affected accounts. Policies can be attached // directly to accounts, or to roots and OUs to affect all accounts in those // hierarchies. @@ -15328,6 +17842,232 @@ func (s *Policy) SetPolicySummary(v *PolicySummary) *Policy { return s } +// Changes to the effective policy are in progress, and its contents can't be +// returned. Try the operation again later. +type PolicyChangesInProgressException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s PolicyChangesInProgressException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyChangesInProgressException) GoString() string { + return s.String() +} + +func newErrorPolicyChangesInProgressException(v protocol.ResponseMetadata) error { + return &PolicyChangesInProgressException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PolicyChangesInProgressException) Code() string { + return "PolicyChangesInProgressException" +} + +// Message returns the exception's message. +func (s PolicyChangesInProgressException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PolicyChangesInProgressException) OrigErr() error { + return nil +} + +func (s PolicyChangesInProgressException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PolicyChangesInProgressException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PolicyChangesInProgressException) RequestID() string { + return s.respMetadata.RequestID +} + +// The policy is attached to one or more entities. You must detach it from all +// roots, OUs, and accounts before performing this operation. +type PolicyInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s PolicyInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyInUseException) GoString() string { + return s.String() +} + +func newErrorPolicyInUseException(v protocol.ResponseMetadata) error { + return &PolicyInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PolicyInUseException) Code() string { + return "PolicyInUseException" +} + +// Message returns the exception's message. +func (s PolicyInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PolicyInUseException) OrigErr() error { + return nil +} + +func (s PolicyInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PolicyInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PolicyInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The policy isn't attached to the specified target in the specified root. +type PolicyNotAttachedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s PolicyNotAttachedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyNotAttachedException) GoString() string { + return s.String() +} + +func newErrorPolicyNotAttachedException(v protocol.ResponseMetadata) error { + return &PolicyNotAttachedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PolicyNotAttachedException) Code() string { + return "PolicyNotAttachedException" +} + +// Message returns the exception's message. +func (s PolicyNotAttachedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PolicyNotAttachedException) OrigErr() error { + return nil +} + +func (s PolicyNotAttachedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PolicyNotAttachedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PolicyNotAttachedException) RequestID() string { + return s.respMetadata.RequestID +} + +// We can't find a policy with the PolicyId that you specified. +type PolicyNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s PolicyNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyNotFoundException) GoString() string { + return s.String() +} + +func newErrorPolicyNotFoundException(v protocol.ResponseMetadata) error { + return &PolicyNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PolicyNotFoundException) Code() string { + return "PolicyNotFoundException" +} + +// Message returns the exception's message. +func (s PolicyNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PolicyNotFoundException) OrigErr() error { + return nil +} + +func (s PolicyNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PolicyNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PolicyNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Contains information about a policy, but does not include the content. To // see the content of a policy, see DescribePolicy. type PolicySummary struct { @@ -15340,7 +18080,7 @@ type PolicySummary struct { // in the AWS Organizations User Guide. Arn *string `type:"string"` - // A boolean value that indicates whether the specified policy is an AWS managed + // A Boolean value that indicates whether the specified policy is an AWS managed // policy. If true, then you can attach the policy to roots, OUs, or accounts, // but you cannot edit it. AwsManaged *bool `type:"boolean"` @@ -15393,95 +18133,271 @@ func (s *PolicySummary) SetDescription(v string) *PolicySummary { return s } -// SetId sets the Id field's value. -func (s *PolicySummary) SetId(v string) *PolicySummary { - s.Id = &v - return s +// SetId sets the Id field's value. +func (s *PolicySummary) SetId(v string) *PolicySummary { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *PolicySummary) SetName(v string) *PolicySummary { + s.Name = &v + return s +} + +// SetType sets the Type field's value. +func (s *PolicySummary) SetType(v string) *PolicySummary { + s.Type = &v + return s +} + +// Contains information about a root, OU, or account that a policy is attached +// to. +type PolicyTargetSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the policy target. + // + // For more information about ARNs in Organizations, see ARN Formats Supported + // by Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_permissions.html#orgs-permissions-arns) + // in the AWS Organizations User Guide. + Arn *string `type:"string"` + + // The friendly name of the policy target. + // + // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate + // this parameter is a string of any of the characters in the ASCII character + // range. + Name *string `min:"1" type:"string"` + + // The unique identifier (ID) of the policy target. + // + // The regex pattern (http://wikipedia.org/wiki/regex) for a target ID string + // requires one of the following: + // + // * Root: A string that begins with "r-" followed by from 4 to 32 lower-case + // letters or digits. + // + // * Account: A string that consists of exactly 12 digits. + // + // * Organizational unit (OU): A string that begins with "ou-" followed by + // from 4 to 32 lower-case letters or digits (the ID of the root that the + // OU is in). This string is followed by a second "-" dash and from 8 to + // 32 additional lower-case letters or digits. + TargetId *string `type:"string"` + + // The type of the policy target. + Type *string `type:"string" enum:"TargetType"` +} + +// String returns the string representation +func (s PolicyTargetSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyTargetSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *PolicyTargetSummary) SetArn(v string) *PolicyTargetSummary { + s.Arn = &v + return s +} + +// SetName sets the Name field's value. +func (s *PolicyTargetSummary) SetName(v string) *PolicyTargetSummary { + s.Name = &v + return s +} + +// SetTargetId sets the TargetId field's value. +func (s *PolicyTargetSummary) SetTargetId(v string) *PolicyTargetSummary { + s.TargetId = &v + return s +} + +// SetType sets the Type field's value. +func (s *PolicyTargetSummary) SetType(v string) *PolicyTargetSummary { + s.Type = &v + return s +} + +// The specified policy type is already enabled in the specified root. +type PolicyTypeAlreadyEnabledException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s PolicyTypeAlreadyEnabledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyTypeAlreadyEnabledException) GoString() string { + return s.String() +} + +func newErrorPolicyTypeAlreadyEnabledException(v protocol.ResponseMetadata) error { + return &PolicyTypeAlreadyEnabledException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PolicyTypeAlreadyEnabledException) Code() string { + return "PolicyTypeAlreadyEnabledException" +} + +// Message returns the exception's message. +func (s PolicyTypeAlreadyEnabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PolicyTypeAlreadyEnabledException) OrigErr() error { + return nil +} + +func (s PolicyTypeAlreadyEnabledException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PolicyTypeAlreadyEnabledException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PolicyTypeAlreadyEnabledException) RequestID() string { + return s.respMetadata.RequestID +} + +// You can't use the specified policy type with the feature set currently enabled +// for this organization. For example, you can enable SCPs only after you enable +// all features in the organization. For more information, see Enabling and +// Disabling a Policy Type on a Root (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html#enable_policies_on_root) +// in the AWS Organizations User Guide. +type PolicyTypeNotAvailableForOrganizationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s PolicyTypeNotAvailableForOrganizationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyTypeNotAvailableForOrganizationException) GoString() string { + return s.String() +} + +func newErrorPolicyTypeNotAvailableForOrganizationException(v protocol.ResponseMetadata) error { + return &PolicyTypeNotAvailableForOrganizationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PolicyTypeNotAvailableForOrganizationException) Code() string { + return "PolicyTypeNotAvailableForOrganizationException" } -// SetName sets the Name field's value. -func (s *PolicySummary) SetName(v string) *PolicySummary { - s.Name = &v - return s +// Message returns the exception's message. +func (s PolicyTypeNotAvailableForOrganizationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetType sets the Type field's value. -func (s *PolicySummary) SetType(v string) *PolicySummary { - s.Type = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PolicyTypeNotAvailableForOrganizationException) OrigErr() error { + return nil } -// Contains information about a root, OU, or account that a policy is attached -// to. -type PolicyTargetSummary struct { - _ struct{} `type:"structure"` +func (s PolicyTypeNotAvailableForOrganizationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The Amazon Resource Name (ARN) of the policy target. - // - // For more information about ARNs in Organizations, see ARN Formats Supported - // by Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_permissions.html#orgs-permissions-arns) - // in the AWS Organizations User Guide. - Arn *string `type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s PolicyTypeNotAvailableForOrganizationException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The friendly name of the policy target. - // - // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate - // this parameter is a string of any of the characters in the ASCII character - // range. - Name *string `min:"1" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s PolicyTypeNotAvailableForOrganizationException) RequestID() string { + return s.respMetadata.RequestID +} - // The unique identifier (ID) of the policy target. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a target ID string - // requires one of the following: - // - // * Root: a string that begins with "r-" followed by from 4 to 32 lower-case - // letters or digits. - // - // * Account: a string that consists of exactly 12 digits. - // - // * Organizational unit (OU): a string that begins with "ou-" followed by - // from 4 to 32 lower-case letters or digits (the ID of the root that the - // OU is in) followed by a second "-" dash and from 8 to 32 additional lower-case - // letters or digits. - TargetId *string `type:"string"` +// The specified policy type isn't currently enabled in this root. You can't +// attach policies of the specified type to entities in a root until you enable +// that type in the root. For more information, see Enabling All Features in +// Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) +// in the AWS Organizations User Guide. +type PolicyTypeNotEnabledException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The type of the policy target. - Type *string `type:"string" enum:"TargetType"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s PolicyTargetSummary) String() string { +func (s PolicyTypeNotEnabledException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PolicyTargetSummary) GoString() string { +func (s PolicyTypeNotEnabledException) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *PolicyTargetSummary) SetArn(v string) *PolicyTargetSummary { - s.Arn = &v - return s +func newErrorPolicyTypeNotEnabledException(v protocol.ResponseMetadata) error { + return &PolicyTypeNotEnabledException{ + respMetadata: v, + } } -// SetName sets the Name field's value. -func (s *PolicyTargetSummary) SetName(v string) *PolicyTargetSummary { - s.Name = &v - return s +// Code returns the exception type name. +func (s PolicyTypeNotEnabledException) Code() string { + return "PolicyTypeNotEnabledException" } -// SetTargetId sets the TargetId field's value. -func (s *PolicyTargetSummary) SetTargetId(v string) *PolicyTargetSummary { - s.TargetId = &v - return s +// Message returns the exception's message. +func (s PolicyTypeNotEnabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetType sets the Type field's value. -func (s *PolicyTargetSummary) SetType(v string) *PolicyTargetSummary { - s.Type = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PolicyTypeNotEnabledException) OrigErr() error { + return nil +} + +func (s PolicyTypeNotEnabledException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PolicyTypeNotEnabledException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PolicyTypeNotEnabledException) RequestID() string { + return s.respMetadata.RequestID } // Contains information about a policy type and its status in the associated @@ -15489,9 +18405,10 @@ func (s *PolicyTargetSummary) SetType(v string) *PolicyTargetSummary { type PolicyTypeSummary struct { _ struct{} `type:"structure"` - // The status of the policy type as it relates to the associated root. To attach - // a policy of the specified type to a root or to an OU or account in that root, - // it must be available in the organization and enabled for that root. + // The status of the policy type as it relates to the associated root. You can + // attach a policy of the specified type to a root or to an OU or account in + // that root. To do so, the policy must be available in the organization and + // enabled for that root. Status *string `type:"string" enum:"PolicyTypeStatus"` // The name of the policy type. @@ -15648,6 +18565,175 @@ func (s *Root) SetPolicyTypes(v []*PolicyTypeSummary) *Root { return s } +// We can't find a root with the RootId that you specified. +type RootNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s RootNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RootNotFoundException) GoString() string { + return s.String() +} + +func newErrorRootNotFoundException(v protocol.ResponseMetadata) error { + return &RootNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RootNotFoundException) Code() string { + return "RootNotFoundException" +} + +// Message returns the exception's message. +func (s RootNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RootNotFoundException) OrigErr() error { + return nil +} + +func (s RootNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RootNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RootNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS Organizations can't complete your request because of an internal service +// error. Try again later. +type ServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceException) GoString() string { + return s.String() +} + +func newErrorServiceException(v protocol.ResponseMetadata) error { + return &ServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceException) Code() string { + return "ServiceException" +} + +// Message returns the exception's message. +func (s ServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceException) OrigErr() error { + return nil +} + +func (s ServiceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceException) RequestID() string { + return s.respMetadata.RequestID +} + +// We can't find a source root or OU with the ParentId that you specified. +type SourceParentNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s SourceParentNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SourceParentNotFoundException) GoString() string { + return s.String() +} + +func newErrorSourceParentNotFoundException(v protocol.ResponseMetadata) error { + return &SourceParentNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SourceParentNotFoundException) Code() string { + return "SourceParentNotFoundException" +} + +// Message returns the exception's message. +func (s SourceParentNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SourceParentNotFoundException) OrigErr() error { + return nil +} + +func (s SourceParentNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SourceParentNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SourceParentNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // A custom key-value pair associated with a resource such as an account within // your organization. type Tag struct { @@ -15785,6 +18871,181 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// We can't find a root, OU, or account with the TargetId that you specified. +type TargetNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s TargetNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TargetNotFoundException) GoString() string { + return s.String() +} + +func newErrorTargetNotFoundException(v protocol.ResponseMetadata) error { + return &TargetNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TargetNotFoundException) Code() string { + return "TargetNotFoundException" +} + +// Message returns the exception's message. +func (s TargetNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TargetNotFoundException) OrigErr() error { + return nil +} + +func (s TargetNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TargetNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TargetNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// You have sent too many requests in too short a period of time. The limit +// helps protect against denial-of-service attacks. Try again later. +// +// For information on limits that affect AWS Organizations, see Limits of AWS +// Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html) +// in the AWS Organizations User Guide. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + +// This action isn't available in the current Region. +type UnsupportedAPIEndpointException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedAPIEndpointException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedAPIEndpointException) GoString() string { + return s.String() +} + +func newErrorUnsupportedAPIEndpointException(v protocol.ResponseMetadata) error { + return &UnsupportedAPIEndpointException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedAPIEndpointException) Code() string { + return "UnsupportedAPIEndpointException" +} + +// Message returns the exception's message. +func (s UnsupportedAPIEndpointException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedAPIEndpointException) OrigErr() error { + return nil +} + +func (s UnsupportedAPIEndpointException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedAPIEndpointException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedAPIEndpointException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -15865,9 +19126,9 @@ type UpdateOrganizationalUnitInput struct { // the ID from the ListOrganizationalUnitsForParent operation. // // The regex pattern (http://wikipedia.org/wiki/regex) for an organizational - // unit ID string requires "ou-" followed by from 4 to 32 lower-case letters - // or digits (the ID of the root that contains the OU) followed by a second - // "-" dash and from 8 to 32 additional lower-case letters or digits. + // unit ID string requires "ou-" followed by from 4 to 32 lowercase letters + // or digits (the ID of the root that contains the OU). This string is followed + // by a second "-" dash and from 8 to 32 additional lowercase letters or digits. // // OrganizationalUnitId is a required field OrganizationalUnitId *string `type:"string" required:"true"` @@ -15957,7 +19218,8 @@ type UpdatePolicyInput struct { // The unique identifier (ID) of the policy that you want to update. // // The regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string - // requires "p-" followed by from 8 to 128 lower-case letters or digits. + // requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, + // or the underscore character (_). // // PolicyId is a required field PolicyId *string `type:"string" required:"true"` @@ -16099,6 +19361,9 @@ const ( // ConstraintViolationExceptionReasonPolicyNumberLimitExceeded is a ConstraintViolationExceptionReason enum value ConstraintViolationExceptionReasonPolicyNumberLimitExceeded = "POLICY_NUMBER_LIMIT_EXCEEDED" + // ConstraintViolationExceptionReasonPolicyContentLimitExceeded is a ConstraintViolationExceptionReason enum value + ConstraintViolationExceptionReasonPolicyContentLimitExceeded = "POLICY_CONTENT_LIMIT_EXCEEDED" + // ConstraintViolationExceptionReasonMaxPolicyTypeAttachmentLimitExceeded is a ConstraintViolationExceptionReason enum value ConstraintViolationExceptionReasonMaxPolicyTypeAttachmentLimitExceeded = "MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED" @@ -16169,6 +19434,9 @@ const ( // CreateAccountFailureReasonInternalFailure is a CreateAccountFailureReason enum value CreateAccountFailureReasonInternalFailure = "INTERNAL_FAILURE" + + // CreateAccountFailureReasonGovcloudAccountAlreadyExists is a CreateAccountFailureReason enum value + CreateAccountFailureReasonGovcloudAccountAlreadyExists = "GOVCLOUD_ACCOUNT_ALREADY_EXISTS" ) const ( @@ -16182,6 +19450,11 @@ const ( CreateAccountStateFailed = "FAILED" ) +const ( + // EffectivePolicyTypeTagPolicy is a EffectivePolicyType enum value + EffectivePolicyTypeTagPolicy = "TAG_POLICY" +) + const ( // HandshakeConstraintViolationExceptionReasonAccountNumberLimitExceeded is a HandshakeConstraintViolationExceptionReason enum value HandshakeConstraintViolationExceptionReasonAccountNumberLimitExceeded = "ACCOUNT_NUMBER_LIMIT_EXCEEDED" @@ -16286,6 +19559,9 @@ const ( // InvalidInputExceptionReasonInvalidEnum is a InvalidInputExceptionReason enum value InvalidInputExceptionReasonInvalidEnum = "INVALID_ENUM" + // InvalidInputExceptionReasonInvalidEnumPolicyType is a InvalidInputExceptionReason enum value + InvalidInputExceptionReasonInvalidEnumPolicyType = "INVALID_ENUM_POLICY_TYPE" + // InvalidInputExceptionReasonInvalidListMember is a InvalidInputExceptionReason enum value InvalidInputExceptionReasonInvalidListMember = "INVALID_LIST_MEMBER" @@ -16333,6 +19609,9 @@ const ( // InvalidInputExceptionReasonInvalidSystemTagsParameter is a InvalidInputExceptionReason enum value InvalidInputExceptionReasonInvalidSystemTagsParameter = "INVALID_SYSTEM_TAGS_PARAMETER" + + // InvalidInputExceptionReasonTargetNotSupported is a InvalidInputExceptionReason enum value + InvalidInputExceptionReasonTargetNotSupported = "TARGET_NOT_SUPPORTED" ) const ( @@ -16354,6 +19633,9 @@ const ( const ( // PolicyTypeServiceControlPolicy is a PolicyType enum value PolicyTypeServiceControlPolicy = "SERVICE_CONTROL_POLICY" + + // PolicyTypeTagPolicy is a PolicyType enum value + PolicyTypeTagPolicy = "TAG_POLICY" ) const ( diff --git a/vendor/github.com/aws/aws-sdk-go/service/organizations/doc.go b/vendor/github.com/aws/aws-sdk-go/service/organizations/doc.go index e66d3ab2704..0cd7cc997ce 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/organizations/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/organizations/doc.go @@ -3,111 +3,7 @@ // Package organizations provides the client and types for making API // requests to AWS Organizations. // -// 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. -// -// This guide provides descriptions of the Organizations API. For more information -// about using this service, see the AWS Organizations User Guide (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html). -// -// API Version -// -// This version of the Organizations API Reference documents the Organizations -// API version 2016-11-28. -// -// As an alternative to using the API directly, 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, and more). The SDKs provide -// a convenient way to create programmatic access to AWS Organizations. For -// example, the SDKs take care of cryptographically signing requests, 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 -// Organizations. However, you also can use the Organizations Query API to make -// direct calls to the Organizations web service. To learn more about the Organizations -// Query API, see Making Query Requests (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_query-requests.html) -// in the AWS Organizations User Guide. Organizations 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 -// -// When you send HTTP requests to AWS, you must sign the requests so that AWS -// can identify who sent them. You sign requests with your AWS access key, which -// consists of an access key ID and a secret access key. We strongly recommend -// that you do not create an access key for your root account. Anyone who has -// the access key for your root account has unrestricted access to all the resources -// in your account. Instead, create an access key for an IAM user account that -// has administrative privileges. As another option, use AWS Security Token -// Service to generate temporary security credentials, and use those credentials -// to sign requests. -// -// To sign requests, we recommend that you use Signature Version 4 (https://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. -// -// When you use the AWS Command Line Interface (AWS CLI) or one of the AWS SDKs -// to make requests to AWS, these tools automatically sign the requests for -// you with the access key that you specify when you configure the tools. -// -// In this release, each organization can have only one root. In a future release, -// a single organization will support multiple roots. -// -// Support and Feedback for AWS Organizations -// -// We welcome your feedback. Send your comments to feedback-awsorganizations@amazon.com -// (mailto:feedback-awsorganizations@amazon.com) or post your feedback and questions -// in the AWS Organizations support forum (http://forums.aws.amazon.com/forum.jspa?forumID=219). -// For more information about the AWS support forums, see Forums Help (http://forums.aws.amazon.com/help.jspa). -// -// Endpoint to Call When Using the CLI or the AWS API -// -// For the current release of Organizations, you must specify the us-east-1 -// region for all AWS API and CLI calls. You can do this in the CLI by using -// these parameters and commands: -// -// * Use the following parameter with each command to specify both the endpoint -// and its region: --endpoint-url https://organizations.us-east-1.amazonaws.com -// -// * Use the default endpoint, but configure your default region with this -// command: aws configure set default.region us-east-1 -// -// * Use the following parameter with each command to specify the endpoint: -// --region us-east-1 -// -// For the various SDKs used to call the APIs, see the documentation for the -// SDK of interest to learn how to direct the requests to a specific endpoint. -// For more information, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#sts_region) -// in the AWS General Reference. -// -// How examples are presented -// -// The JSON returned by the AWS Organizations service as response to your requests -// is returned as a single long string without line breaks or formatting whitespace. -// Both line breaks and whitespace are included in the examples in this guide -// to improve readability. When example input parameters also would result in -// long strings that would extend beyond the screen, we insert line breaks to -// enhance readability. You should always submit the input as a single JSON -// text string. -// -// Recording API Requests -// -// AWS Organizations supports AWS CloudTrail, a service that records AWS API -// calls for your AWS account and delivers log files to an Amazon S3 bucket. -// By using information collected by AWS CloudTrail, you can determine which -// requests were successfully made to Organizations, who made the request, when -// it was made, and so on. For more about AWS Organizations and its support -// for AWS CloudTrail, see Logging AWS Organizations Events with AWS CloudTrail -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_monitoring.html#orgs_cloudtrail-integration) -// in the AWS Organizations User Guide. To learn more about CloudTrail, including -// how to turn it on and find your log files, see the AWS CloudTrail User Guide -// (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html). +// AWS Organizations // // See https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28 for more information on this service. // diff --git a/vendor/github.com/aws/aws-sdk-go/service/organizations/errors.go b/vendor/github.com/aws/aws-sdk-go/service/organizations/errors.go index 8c3d7b05803..af309e1f14f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/organizations/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/organizations/errors.go @@ -2,6 +2,10 @@ package organizations +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAWSOrganizationsNotInUseException for service response error code @@ -32,7 +36,7 @@ const ( // ErrCodeAccountNotFoundException for service response error code // "AccountNotFoundException". // - // We can't find an AWS account with the AccountId that you specified, or the + // We can't find an AWS account with the AccountId that you specified. Or the // account whose credentials you used to make this request isn't a member of // an organization. ErrCodeAccountNotFoundException = "AccountNotFoundException" @@ -70,12 +74,11 @@ const ( // ErrCodeConstraintViolationException for service response error code // "ConstraintViolationException". // - // Performing this operation violates a minimum or maximum value limit. For - // example, attempting to remove the last service control policy (SCP) from - // an OU or root, inviting or creating too many accounts to the organization, - // or attaching too many policies to an account, OU, or root. This exception - // includes a reason that contains additional information about the violated - // limit. + // Performing this operation violates a minimum or maximum value limit. Examples + // include attempting to remove the last service control policy (SCP) from an + // OU or root, or attaching too many policies to an account, OU, or root. This + // exception includes a reason that contains additional information about the + // violated limit. // // Some of the reasons in the following list might not be applicable to this // specific API or operation: @@ -150,8 +153,8 @@ const ( // in the AWS Organizations User Guide. // // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a - // policy from an entity that would cause the entity to have fewer than the - // minimum number of policies of a certain type required. + // policy from an entity, which would cause the entity to have fewer than + // the minimum number of policies of the required type. // // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is // too many levels deep. @@ -164,14 +167,19 @@ const ( // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs // that you can have in an organization. // - // * POLICY_NUMBER_LIMIT_EXCEEDED. You attempted to exceed the number of + // * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of // policies that you can have in an organization. + // + // * TAG_POLICY_VIOLATION: Tags associated with the resource must be compliant + // with the tag policy that’s in effect for the account. For more information, + // see Tag Policies (http://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) + // in the AWS Organizations User Guide. ErrCodeConstraintViolationException = "ConstraintViolationException" // ErrCodeCreateAccountStatusNotFoundException for service response error code // "CreateAccountStatusNotFoundException". // - // We can't find an create account request with the CreateAccountRequestId that + // We can't find a create account request with the CreateAccountRequestId that // you specified. ErrCodeCreateAccountStatusNotFoundException = "CreateAccountStatusNotFoundException" @@ -216,6 +224,15 @@ const ( // A policy with the same name already exists. ErrCodeDuplicatePolicyException = "DuplicatePolicyException" + // ErrCodeEffectivePolicyNotFoundException for service response error code + // "EffectivePolicyNotFoundException". + // + // If you ran this action on the master account, this policy type is not enabled. + // If you ran the action on a member account, the account doesn't have an effective + // policy of this type. Contact the administrator of your organization about + // attaching a policy of this type to the account. + ErrCodeEffectivePolicyNotFoundException = "EffectivePolicyNotFoundException" + // ErrCodeFinalizingOrganizationException for service response error code // "FinalizingOrganizationException". // @@ -306,6 +323,8 @@ const ( // // * INVALID_ENUM: You specified an invalid value. // + // * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type. + // // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid // characters. // @@ -399,6 +418,13 @@ const ( // We can't find a root or OU with the ParentId that you specified. ErrCodeParentNotFoundException = "ParentNotFoundException" + // ErrCodePolicyChangesInProgressException for service response error code + // "PolicyChangesInProgressException". + // + // Changes to the effective policy are in progress, and its contents can't be + // returned. Try the operation again later. + ErrCodePolicyChangesInProgressException = "PolicyChangesInProgressException" + // ErrCodePolicyInUseException for service response error code // "PolicyInUseException". // @@ -486,3 +512,48 @@ const ( // This action isn't available in the current Region. ErrCodeUnsupportedAPIEndpointException = "UnsupportedAPIEndpointException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AWSOrganizationsNotInUseException": newErrorAWSOrganizationsNotInUseException, + "AccessDeniedException": newErrorAccessDeniedException, + "AccessDeniedForDependencyException": newErrorAccessDeniedForDependencyException, + "AccountNotFoundException": newErrorAccountNotFoundException, + "AccountOwnerNotVerifiedException": newErrorAccountOwnerNotVerifiedException, + "AlreadyInOrganizationException": newErrorAlreadyInOrganizationException, + "ChildNotFoundException": newErrorChildNotFoundException, + "ConcurrentModificationException": newErrorConcurrentModificationException, + "ConstraintViolationException": newErrorConstraintViolationException, + "CreateAccountStatusNotFoundException": newErrorCreateAccountStatusNotFoundException, + "DestinationParentNotFoundException": newErrorDestinationParentNotFoundException, + "DuplicateAccountException": newErrorDuplicateAccountException, + "DuplicateHandshakeException": newErrorDuplicateHandshakeException, + "DuplicateOrganizationalUnitException": newErrorDuplicateOrganizationalUnitException, + "DuplicatePolicyAttachmentException": newErrorDuplicatePolicyAttachmentException, + "DuplicatePolicyException": newErrorDuplicatePolicyException, + "EffectivePolicyNotFoundException": newErrorEffectivePolicyNotFoundException, + "FinalizingOrganizationException": newErrorFinalizingOrganizationException, + "HandshakeAlreadyInStateException": newErrorHandshakeAlreadyInStateException, + "HandshakeConstraintViolationException": newErrorHandshakeConstraintViolationException, + "HandshakeNotFoundException": newErrorHandshakeNotFoundException, + "InvalidHandshakeTransitionException": newErrorInvalidHandshakeTransitionException, + "InvalidInputException": newErrorInvalidInputException, + "MalformedPolicyDocumentException": newErrorMalformedPolicyDocumentException, + "MasterCannotLeaveOrganizationException": newErrorMasterCannotLeaveOrganizationException, + "OrganizationNotEmptyException": newErrorOrganizationNotEmptyException, + "OrganizationalUnitNotEmptyException": newErrorOrganizationalUnitNotEmptyException, + "OrganizationalUnitNotFoundException": newErrorOrganizationalUnitNotFoundException, + "ParentNotFoundException": newErrorParentNotFoundException, + "PolicyChangesInProgressException": newErrorPolicyChangesInProgressException, + "PolicyInUseException": newErrorPolicyInUseException, + "PolicyNotAttachedException": newErrorPolicyNotAttachedException, + "PolicyNotFoundException": newErrorPolicyNotFoundException, + "PolicyTypeAlreadyEnabledException": newErrorPolicyTypeAlreadyEnabledException, + "PolicyTypeNotAvailableForOrganizationException": newErrorPolicyTypeNotAvailableForOrganizationException, + "PolicyTypeNotEnabledException": newErrorPolicyTypeNotEnabledException, + "RootNotFoundException": newErrorRootNotFoundException, + "ServiceException": newErrorServiceException, + "SourceParentNotFoundException": newErrorSourceParentNotFoundException, + "TargetNotFoundException": newErrorTargetNotFoundException, + "TooManyRequestsException": newErrorTooManyRequestsException, + "UnsupportedAPIEndpointException": newErrorUnsupportedAPIEndpointException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/organizations/service.go b/vendor/github.com/aws/aws-sdk-go/service/organizations/service.go index 565c1715f3c..7a87e3ba30f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/organizations/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/organizations/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "organizations" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Organizations" // ServiceID is a unique identifer of a specific service. + ServiceID = "Organizations" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Organizations client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Organizations client from just a session. // svc := organizations.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := organizations.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *Organizations { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Organizations { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Organizations { svc := &Organizations{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-11-28", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/personalize/api.go b/vendor/github.com/aws/aws-sdk-go/service/personalize/api.go index bea02eca744..9a01bcc84d4 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/personalize/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/personalize/api.go @@ -13,6 +13,99 @@ import ( "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) +const opCreateBatchInferenceJob = "CreateBatchInferenceJob" + +// CreateBatchInferenceJobRequest generates a "aws/request.Request" representing the +// client's request for the CreateBatchInferenceJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateBatchInferenceJob for more information on using the CreateBatchInferenceJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateBatchInferenceJobRequest method. +// req, resp := client.CreateBatchInferenceJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/CreateBatchInferenceJob +func (c *Personalize) CreateBatchInferenceJobRequest(input *CreateBatchInferenceJobInput) (req *request.Request, output *CreateBatchInferenceJobOutput) { + op := &request.Operation{ + Name: opCreateBatchInferenceJob, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateBatchInferenceJobInput{} + } + + output = &CreateBatchInferenceJobOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateBatchInferenceJob API operation for Amazon Personalize. +// +// Creates a batch inference job. The operation can handle up to 50 million +// records and the input file must be in JSON format. For more information, +// see recommendations-batch. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Personalize's +// API operation CreateBatchInferenceJob for usage and error information. +// +// Returned Error Types: +// * InvalidInputException +// Provide a valid value for the field or parameter. +// +// * ResourceAlreadyExistsException +// The specified resource already exists. +// +// * LimitExceededException +// The limit on the number of requests per second has been exceeded. +// +// * ResourceNotFoundException +// Could not find the specified resource. +// +// * ResourceInUseException +// The specified resource is in use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/CreateBatchInferenceJob +func (c *Personalize) CreateBatchInferenceJob(input *CreateBatchInferenceJobInput) (*CreateBatchInferenceJobOutput, error) { + req, out := c.CreateBatchInferenceJobRequest(input) + return out, req.Send() +} + +// CreateBatchInferenceJobWithContext is the same as CreateBatchInferenceJob with the addition of +// the ability to pass a context and additional request options. +// +// See CreateBatchInferenceJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Personalize) CreateBatchInferenceJobWithContext(ctx aws.Context, input *CreateBatchInferenceJobInput, opts ...request.Option) (*CreateBatchInferenceJobOutput, error) { + req, out := c.CreateBatchInferenceJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateCampaign = "CreateCampaign" // CreateCampaignRequest generates a "aws/request.Request" representing the @@ -105,20 +198,20 @@ func (c *Personalize) CreateCampaignRequest(input *CreateCampaignInput) (req *re // See the AWS API reference guide for Amazon Personalize's // API operation CreateCampaign for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The limit on the number of requests per second has been exceeded. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/CreateCampaign @@ -227,20 +320,20 @@ func (c *Personalize) CreateDatasetRequest(input *CreateDatasetInput) (req *requ // See the AWS API reference guide for Amazon Personalize's // API operation CreateDataset for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The limit on the number of requests per second has been exceeded. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/CreateDataset @@ -362,14 +455,14 @@ func (c *Personalize) CreateDatasetGroupRequest(input *CreateDatasetGroupInput) // See the AWS API reference guide for Amazon Personalize's // API operation CreateDatasetGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The limit on the number of requests per second has been exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/CreateDatasetGroup @@ -473,20 +566,20 @@ func (c *Personalize) CreateDatasetImportJobRequest(input *CreateDatasetImportJo // See the AWS API reference guide for Amazon Personalize's // API operation CreateDatasetImportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The limit on the number of requests per second has been exceeded. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/CreateDatasetImportJob @@ -596,20 +689,20 @@ func (c *Personalize) CreateEventTrackerRequest(input *CreateEventTrackerInput) // See the AWS API reference guide for Amazon Personalize's // API operation CreateEventTracker for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The limit on the number of requests per second has been exceeded. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/CreateEventTracker @@ -700,14 +793,14 @@ func (c *Personalize) CreateSchemaRequest(input *CreateSchemaInput) (req *reques // See the AWS API reference guide for Amazon Personalize's // API operation CreateSchema for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The limit on the number of requests per second has been exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/CreateSchema @@ -827,20 +920,20 @@ func (c *Personalize) CreateSolutionRequest(input *CreateSolutionInput) (req *re // See the AWS API reference guide for Amazon Personalize's // API operation CreateSolution for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The limit on the number of requests per second has been exceeded. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/CreateSolution @@ -946,14 +1039,14 @@ func (c *Personalize) CreateSolutionVersionRequest(input *CreateSolutionVersionI // See the AWS API reference guide for Amazon Personalize's // API operation CreateSolutionVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/CreateSolutionVersion @@ -1035,14 +1128,14 @@ func (c *Personalize) DeleteCampaignRequest(input *DeleteCampaignInput) (req *re // See the AWS API reference guide for Amazon Personalize's // API operation DeleteCampaign for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DeleteCampaign @@ -1123,14 +1216,14 @@ func (c *Personalize) DeleteDatasetRequest(input *DeleteDatasetInput) (req *requ // See the AWS API reference guide for Amazon Personalize's // API operation DeleteDataset for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DeleteDataset @@ -1216,14 +1309,14 @@ func (c *Personalize) DeleteDatasetGroupRequest(input *DeleteDatasetGroupInput) // See the AWS API reference guide for Amazon Personalize's // API operation DeleteDatasetGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DeleteDatasetGroup @@ -1304,14 +1397,14 @@ func (c *Personalize) DeleteEventTrackerRequest(input *DeleteEventTrackerInput) // See the AWS API reference guide for Amazon Personalize's // API operation DeleteEventTracker for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DeleteEventTracker @@ -1391,14 +1484,14 @@ func (c *Personalize) DeleteSchemaRequest(input *DeleteSchemaInput) (req *reques // See the AWS API reference guide for Amazon Personalize's // API operation DeleteSchema for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DeleteSchema @@ -1482,14 +1575,14 @@ func (c *Personalize) DeleteSolutionRequest(input *DeleteSolutionInput) (req *re // See the AWS API reference guide for Amazon Personalize's // API operation DeleteSolution for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DeleteSolution @@ -1567,11 +1660,11 @@ func (c *Personalize) DescribeAlgorithmRequest(input *DescribeAlgorithmInput) (r // See the AWS API reference guide for Amazon Personalize's // API operation DescribeAlgorithm for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DescribeAlgorithm @@ -1596,6 +1689,90 @@ func (c *Personalize) DescribeAlgorithmWithContext(ctx aws.Context, input *Descr return out, req.Send() } +const opDescribeBatchInferenceJob = "DescribeBatchInferenceJob" + +// DescribeBatchInferenceJobRequest generates a "aws/request.Request" representing the +// client's request for the DescribeBatchInferenceJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeBatchInferenceJob for more information on using the DescribeBatchInferenceJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeBatchInferenceJobRequest method. +// req, resp := client.DescribeBatchInferenceJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DescribeBatchInferenceJob +func (c *Personalize) DescribeBatchInferenceJobRequest(input *DescribeBatchInferenceJobInput) (req *request.Request, output *DescribeBatchInferenceJobOutput) { + op := &request.Operation{ + Name: opDescribeBatchInferenceJob, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeBatchInferenceJobInput{} + } + + output = &DescribeBatchInferenceJobOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeBatchInferenceJob API operation for Amazon Personalize. +// +// Gets the properties of a batch inference job including name, Amazon Resource +// Name (ARN), status, input and output configurations, and the ARN of the solution +// version used to generate the recommendations. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Personalize's +// API operation DescribeBatchInferenceJob for usage and error information. +// +// Returned Error Types: +// * InvalidInputException +// Provide a valid value for the field or parameter. +// +// * ResourceNotFoundException +// Could not find the specified resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DescribeBatchInferenceJob +func (c *Personalize) DescribeBatchInferenceJob(input *DescribeBatchInferenceJobInput) (*DescribeBatchInferenceJobOutput, error) { + req, out := c.DescribeBatchInferenceJobRequest(input) + return out, req.Send() +} + +// DescribeBatchInferenceJobWithContext is the same as DescribeBatchInferenceJob with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeBatchInferenceJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Personalize) DescribeBatchInferenceJobWithContext(ctx aws.Context, input *DescribeBatchInferenceJobInput, opts ...request.Option) (*DescribeBatchInferenceJobOutput, error) { + req, out := c.DescribeBatchInferenceJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeCampaign = "DescribeCampaign" // DescribeCampaignRequest generates a "aws/request.Request" representing the @@ -1660,11 +1837,11 @@ func (c *Personalize) DescribeCampaignRequest(input *DescribeCampaignInput) (req // See the AWS API reference guide for Amazon Personalize's // API operation DescribeCampaign for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DescribeCampaign @@ -1742,11 +1919,11 @@ func (c *Personalize) DescribeDatasetRequest(input *DescribeDatasetInput) (req * // See the AWS API reference guide for Amazon Personalize's // API operation DescribeDataset for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DescribeDataset @@ -1825,11 +2002,11 @@ func (c *Personalize) DescribeDatasetGroupRequest(input *DescribeDatasetGroupInp // See the AWS API reference guide for Amazon Personalize's // API operation DescribeDatasetGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DescribeDatasetGroup @@ -1908,11 +2085,11 @@ func (c *Personalize) DescribeDatasetImportJobRequest(input *DescribeDatasetImpo // See the AWS API reference guide for Amazon Personalize's // API operation DescribeDatasetImportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DescribeDatasetImportJob @@ -1991,11 +2168,11 @@ func (c *Personalize) DescribeEventTrackerRequest(input *DescribeEventTrackerInp // See the AWS API reference guide for Amazon Personalize's // API operation DescribeEventTracker for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DescribeEventTracker @@ -2073,11 +2250,11 @@ func (c *Personalize) DescribeFeatureTransformationRequest(input *DescribeFeatur // See the AWS API reference guide for Amazon Personalize's // API operation DescribeFeatureTransformation for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DescribeFeatureTransformation @@ -2171,11 +2348,11 @@ func (c *Personalize) DescribeRecipeRequest(input *DescribeRecipeInput) (req *re // See the AWS API reference guide for Amazon Personalize's // API operation DescribeRecipe for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DescribeRecipe @@ -2253,11 +2430,11 @@ func (c *Personalize) DescribeSchemaRequest(input *DescribeSchemaInput) (req *re // See the AWS API reference guide for Amazon Personalize's // API operation DescribeSchema for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DescribeSchema @@ -2335,11 +2512,11 @@ func (c *Personalize) DescribeSolutionRequest(input *DescribeSolutionInput) (req // See the AWS API reference guide for Amazon Personalize's // API operation DescribeSolution for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DescribeSolution @@ -2418,11 +2595,11 @@ func (c *Personalize) DescribeSolutionVersionRequest(input *DescribeSolutionVers // See the AWS API reference guide for Amazon Personalize's // API operation DescribeSolutionVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/DescribeSolutionVersion @@ -2500,14 +2677,14 @@ func (c *Personalize) GetSolutionMetricsRequest(input *GetSolutionMetricsInput) // See the AWS API reference guide for Amazon Personalize's // API operation GetSolutionMetrics for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/GetSolutionMetrics @@ -2532,6 +2709,147 @@ func (c *Personalize) GetSolutionMetricsWithContext(ctx aws.Context, input *GetS return out, req.Send() } +const opListBatchInferenceJobs = "ListBatchInferenceJobs" + +// ListBatchInferenceJobsRequest generates a "aws/request.Request" representing the +// client's request for the ListBatchInferenceJobs operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListBatchInferenceJobs for more information on using the ListBatchInferenceJobs +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListBatchInferenceJobsRequest method. +// req, resp := client.ListBatchInferenceJobsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/ListBatchInferenceJobs +func (c *Personalize) ListBatchInferenceJobsRequest(input *ListBatchInferenceJobsInput) (req *request.Request, output *ListBatchInferenceJobsOutput) { + op := &request.Operation{ + Name: opListBatchInferenceJobs, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListBatchInferenceJobsInput{} + } + + output = &ListBatchInferenceJobsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListBatchInferenceJobs API operation for Amazon Personalize. +// +// Gets a list of the batch inference jobs that have been performed off of a +// solution 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 Amazon Personalize's +// API operation ListBatchInferenceJobs for usage and error information. +// +// Returned Error Types: +// * InvalidInputException +// Provide a valid value for the field or parameter. +// +// * InvalidNextTokenException +// The token is not valid. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/ListBatchInferenceJobs +func (c *Personalize) ListBatchInferenceJobs(input *ListBatchInferenceJobsInput) (*ListBatchInferenceJobsOutput, error) { + req, out := c.ListBatchInferenceJobsRequest(input) + return out, req.Send() +} + +// ListBatchInferenceJobsWithContext is the same as ListBatchInferenceJobs with the addition of +// the ability to pass a context and additional request options. +// +// See ListBatchInferenceJobs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Personalize) ListBatchInferenceJobsWithContext(ctx aws.Context, input *ListBatchInferenceJobsInput, opts ...request.Option) (*ListBatchInferenceJobsOutput, error) { + req, out := c.ListBatchInferenceJobsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListBatchInferenceJobsPages iterates over the pages of a ListBatchInferenceJobs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListBatchInferenceJobs 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 ListBatchInferenceJobs operation. +// pageNum := 0 +// err := client.ListBatchInferenceJobsPages(params, +// func(page *personalize.ListBatchInferenceJobsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Personalize) ListBatchInferenceJobsPages(input *ListBatchInferenceJobsInput, fn func(*ListBatchInferenceJobsOutput, bool) bool) error { + return c.ListBatchInferenceJobsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListBatchInferenceJobsPagesWithContext same as ListBatchInferenceJobsPages 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 *Personalize) ListBatchInferenceJobsPagesWithContext(ctx aws.Context, input *ListBatchInferenceJobsInput, fn func(*ListBatchInferenceJobsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListBatchInferenceJobsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListBatchInferenceJobsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListBatchInferenceJobsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opListCampaigns = "ListCampaigns" // ListCampaignsRequest generates a "aws/request.Request" representing the @@ -2594,11 +2912,11 @@ func (c *Personalize) ListCampaignsRequest(input *ListCampaignsInput) (req *requ // See the AWS API reference guide for Amazon Personalize's // API operation ListCampaigns for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/ListCampaigns @@ -2666,10 +2984,12 @@ func (c *Personalize) ListCampaignsPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCampaignsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListCampaignsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2734,8 +3054,8 @@ func (c *Personalize) ListDatasetGroupsRequest(input *ListDatasetGroupsInput) (r // See the AWS API reference guide for Amazon Personalize's // API operation ListDatasetGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/ListDatasetGroups @@ -2803,10 +3123,12 @@ func (c *Personalize) ListDatasetGroupsPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDatasetGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDatasetGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2874,11 +3196,11 @@ func (c *Personalize) ListDatasetImportJobsRequest(input *ListDatasetImportJobsI // See the AWS API reference guide for Amazon Personalize's // API operation ListDatasetImportJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/ListDatasetImportJobs @@ -2946,10 +3268,12 @@ func (c *Personalize) ListDatasetImportJobsPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDatasetImportJobsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDatasetImportJobsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3014,11 +3338,11 @@ func (c *Personalize) ListDatasetsRequest(input *ListDatasetsInput) (req *reques // See the AWS API reference guide for Amazon Personalize's // API operation ListDatasets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/ListDatasets @@ -3086,10 +3410,12 @@ func (c *Personalize) ListDatasetsPagesWithContext(ctx aws.Context, input *ListD }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDatasetsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDatasetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3154,11 +3480,11 @@ func (c *Personalize) ListEventTrackersRequest(input *ListEventTrackersInput) (r // See the AWS API reference guide for Amazon Personalize's // API operation ListEventTrackers for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/ListEventTrackers @@ -3226,10 +3552,12 @@ func (c *Personalize) ListEventTrackersPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEventTrackersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListEventTrackersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3293,8 +3621,8 @@ func (c *Personalize) ListRecipesRequest(input *ListRecipesInput) (req *request. // See the AWS API reference guide for Amazon Personalize's // API operation ListRecipes for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/ListRecipes @@ -3362,10 +3690,12 @@ func (c *Personalize) ListRecipesPagesWithContext(ctx aws.Context, input *ListRe }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRecipesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListRecipesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3430,8 +3760,8 @@ func (c *Personalize) ListSchemasRequest(input *ListSchemasInput) (req *request. // See the AWS API reference guide for Amazon Personalize's // API operation ListSchemas for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/ListSchemas @@ -3499,10 +3829,12 @@ func (c *Personalize) ListSchemasPagesWithContext(ctx aws.Context, input *ListSc }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSchemasOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListSchemasOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3568,14 +3900,14 @@ func (c *Personalize) ListSolutionVersionsRequest(input *ListSolutionVersionsInp // See the AWS API reference guide for Amazon Personalize's // API operation ListSolutionVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/ListSolutionVersions @@ -3643,10 +3975,12 @@ func (c *Personalize) ListSolutionVersionsPagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSolutionVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListSolutionVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3712,11 +4046,11 @@ func (c *Personalize) ListSolutionsRequest(input *ListSolutionsInput) (req *requ // See the AWS API reference guide for Amazon Personalize's // API operation ListSolutions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/ListSolutions @@ -3784,10 +4118,12 @@ func (c *Personalize) ListSolutionsPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSolutionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListSolutionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3853,14 +4189,14 @@ func (c *Personalize) UpdateCampaignRequest(input *UpdateCampaignInput) (req *re // See the AWS API reference guide for Amazon Personalize's // API operation UpdateCampaign for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInputException "InvalidInputException" +// Returned Error Types: +// * InvalidInputException // Provide a valid value for the field or parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Could not find the specified resource. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource is in use. // // See also, https://docs.aws.amazon.com/goto/WebAPI/personalize-2018-05-22/UpdateCampaign @@ -4088,28 +4424,325 @@ func (s *AutoMLResult) SetBestRecipeArn(v string) *AutoMLResult { return s } -// Describes a deployed solution version, otherwise known as a campaign. For -// more information on campaigns, see CreateCampaign. -type Campaign struct { +// Contains information on a batch inference job. +type BatchInferenceJob struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the campaign. - CampaignArn *string `locationName:"campaignArn" type:"string"` + // The Amazon Resource Name (ARN) of the batch inference job. + BatchInferenceJobArn *string `locationName:"batchInferenceJobArn" type:"string"` - // The date and time (in Unix format) that the campaign was created. + // The time at which the batch inference job was created. CreationDateTime *time.Time `locationName:"creationDateTime" type:"timestamp"` - // If a campaign fails, the reason behind the failure. + // If the batch inference job failed, the reason for the failure. FailureReason *string `locationName:"failureReason" type:"string"` - // The date and time (in Unix format) that the campaign was last updated. - LastUpdatedDateTime *time.Time `locationName:"lastUpdatedDateTime" type:"timestamp"` + // The Amazon S3 path that leads to the input data used to generate the batch + // inference job. + JobInput *BatchInferenceJobInput `locationName:"jobInput" type:"structure"` - // Provides a summary of the properties of a campaign update. For a complete - // listing, call the DescribeCampaign API. - LatestCampaignUpdate *CampaignUpdateSummary `locationName:"latestCampaignUpdate" type:"structure"` + // The name of the batch inference job. + JobName *string `locationName:"jobName" min:"1" type:"string"` - // Specifies the requested minimum provisioned transactions (recommendations) + // The Amazon S3 bucket that contains the output data generated by the batch + // inference job. + JobOutput *BatchInferenceJobOutput `locationName:"jobOutput" type:"structure"` + + // The time at which the batch inference job was last updated. + LastUpdatedDateTime *time.Time `locationName:"lastUpdatedDateTime" type:"timestamp"` + + // The number of recommendations generated by the batch inference job. This + // number includes the error messages generated for failed input records. + NumResults *int64 `locationName:"numResults" type:"integer"` + + // The ARN of the Amazon Identity and Access Management (IAM) role that requested + // the batch inference job. + RoleArn *string `locationName:"roleArn" type:"string"` + + // The Amazon Resource Name (ARN) of the solution version from which the batch + // inference job was created. + SolutionVersionArn *string `locationName:"solutionVersionArn" type:"string"` + + // The status of the batch inference job. The status is one of the following + // values: + // + // * PENDING + // + // * IN PROGRESS + // + // * ACTIVE + // + // * CREATE FAILED + Status *string `locationName:"status" type:"string"` +} + +// String returns the string representation +func (s BatchInferenceJob) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchInferenceJob) GoString() string { + return s.String() +} + +// SetBatchInferenceJobArn sets the BatchInferenceJobArn field's value. +func (s *BatchInferenceJob) SetBatchInferenceJobArn(v string) *BatchInferenceJob { + s.BatchInferenceJobArn = &v + return s +} + +// SetCreationDateTime sets the CreationDateTime field's value. +func (s *BatchInferenceJob) SetCreationDateTime(v time.Time) *BatchInferenceJob { + s.CreationDateTime = &v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *BatchInferenceJob) SetFailureReason(v string) *BatchInferenceJob { + s.FailureReason = &v + return s +} + +// SetJobInput sets the JobInput field's value. +func (s *BatchInferenceJob) SetJobInput(v *BatchInferenceJobInput) *BatchInferenceJob { + s.JobInput = v + return s +} + +// SetJobName sets the JobName field's value. +func (s *BatchInferenceJob) SetJobName(v string) *BatchInferenceJob { + s.JobName = &v + return s +} + +// SetJobOutput sets the JobOutput field's value. +func (s *BatchInferenceJob) SetJobOutput(v *BatchInferenceJobOutput) *BatchInferenceJob { + s.JobOutput = v + return s +} + +// SetLastUpdatedDateTime sets the LastUpdatedDateTime field's value. +func (s *BatchInferenceJob) SetLastUpdatedDateTime(v time.Time) *BatchInferenceJob { + s.LastUpdatedDateTime = &v + return s +} + +// SetNumResults sets the NumResults field's value. +func (s *BatchInferenceJob) SetNumResults(v int64) *BatchInferenceJob { + s.NumResults = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *BatchInferenceJob) SetRoleArn(v string) *BatchInferenceJob { + s.RoleArn = &v + return s +} + +// SetSolutionVersionArn sets the SolutionVersionArn field's value. +func (s *BatchInferenceJob) SetSolutionVersionArn(v string) *BatchInferenceJob { + s.SolutionVersionArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *BatchInferenceJob) SetStatus(v string) *BatchInferenceJob { + s.Status = &v + return s +} + +// The input configuration of a batch inference job. +type BatchInferenceJobInput struct { + _ struct{} `type:"structure"` + + // The URI of the Amazon S3 location that contains your input data. The Amazon + // S3 bucket must be in the same region as the API endpoint you are calling. + // + // S3DataSource is a required field + S3DataSource *S3DataConfig `locationName:"s3DataSource" type:"structure" required:"true"` +} + +// String returns the string representation +func (s BatchInferenceJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchInferenceJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchInferenceJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchInferenceJobInput"} + if s.S3DataSource == nil { + invalidParams.Add(request.NewErrParamRequired("S3DataSource")) + } + if s.S3DataSource != nil { + if err := s.S3DataSource.Validate(); err != nil { + invalidParams.AddNested("S3DataSource", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetS3DataSource sets the S3DataSource field's value. +func (s *BatchInferenceJobInput) SetS3DataSource(v *S3DataConfig) *BatchInferenceJobInput { + s.S3DataSource = v + return s +} + +// The output configuration parameters of a batch inference job. +type BatchInferenceJobOutput struct { + _ struct{} `type:"structure"` + + // Information on the Amazon S3 bucket in which the batch inference job's output + // is stored. + // + // S3DataDestination is a required field + S3DataDestination *S3DataConfig `locationName:"s3DataDestination" type:"structure" required:"true"` +} + +// String returns the string representation +func (s BatchInferenceJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchInferenceJobOutput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BatchInferenceJobOutput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BatchInferenceJobOutput"} + if s.S3DataDestination == nil { + invalidParams.Add(request.NewErrParamRequired("S3DataDestination")) + } + if s.S3DataDestination != nil { + if err := s.S3DataDestination.Validate(); err != nil { + invalidParams.AddNested("S3DataDestination", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetS3DataDestination sets the S3DataDestination field's value. +func (s *BatchInferenceJobOutput) SetS3DataDestination(v *S3DataConfig) *BatchInferenceJobOutput { + s.S3DataDestination = v + return s +} + +// A truncated version of the BatchInferenceJob datatype. The ListBatchInferenceJobs +// operation returns a list of batch inference job summaries. +type BatchInferenceJobSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the batch inference job. + BatchInferenceJobArn *string `locationName:"batchInferenceJobArn" type:"string"` + + // The time at which the batch inference job was created. + CreationDateTime *time.Time `locationName:"creationDateTime" type:"timestamp"` + + // If the batch inference job failed, the reason for the failure. + FailureReason *string `locationName:"failureReason" type:"string"` + + // The name of the batch inference job. + JobName *string `locationName:"jobName" min:"1" type:"string"` + + // The time at which the batch inference job was last updated. + LastUpdatedDateTime *time.Time `locationName:"lastUpdatedDateTime" type:"timestamp"` + + // The status of the batch inference job. The status is one of the following + // values: + // + // * PENDING + // + // * IN PROGRESS + // + // * ACTIVE + // + // * CREATE FAILED + Status *string `locationName:"status" type:"string"` +} + +// String returns the string representation +func (s BatchInferenceJobSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BatchInferenceJobSummary) GoString() string { + return s.String() +} + +// SetBatchInferenceJobArn sets the BatchInferenceJobArn field's value. +func (s *BatchInferenceJobSummary) SetBatchInferenceJobArn(v string) *BatchInferenceJobSummary { + s.BatchInferenceJobArn = &v + return s +} + +// SetCreationDateTime sets the CreationDateTime field's value. +func (s *BatchInferenceJobSummary) SetCreationDateTime(v time.Time) *BatchInferenceJobSummary { + s.CreationDateTime = &v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *BatchInferenceJobSummary) SetFailureReason(v string) *BatchInferenceJobSummary { + s.FailureReason = &v + return s +} + +// SetJobName sets the JobName field's value. +func (s *BatchInferenceJobSummary) SetJobName(v string) *BatchInferenceJobSummary { + s.JobName = &v + return s +} + +// SetLastUpdatedDateTime sets the LastUpdatedDateTime field's value. +func (s *BatchInferenceJobSummary) SetLastUpdatedDateTime(v time.Time) *BatchInferenceJobSummary { + s.LastUpdatedDateTime = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *BatchInferenceJobSummary) SetStatus(v string) *BatchInferenceJobSummary { + s.Status = &v + return s +} + +// Describes a deployed solution version, otherwise known as a campaign. For +// more information on campaigns, see CreateCampaign. +type Campaign struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the campaign. + CampaignArn *string `locationName:"campaignArn" type:"string"` + + // The date and time (in Unix format) that the campaign was created. + CreationDateTime *time.Time `locationName:"creationDateTime" type:"timestamp"` + + // If a campaign fails, the reason behind the failure. + FailureReason *string `locationName:"failureReason" type:"string"` + + // The date and time (in Unix format) that the campaign was last updated. + LastUpdatedDateTime *time.Time `locationName:"lastUpdatedDateTime" type:"timestamp"` + + // Provides a summary of the properties of a campaign update. For a complete + // listing, call the DescribeCampaign API. + LatestCampaignUpdate *CampaignUpdateSummary `locationName:"latestCampaignUpdate" type:"structure"` + + // Specifies the requested minimum provisioned transactions (recommendations) // per second. MinProvisionedTPS *int64 `locationName:"minProvisionedTPS" min:"1" type:"integer"` @@ -4437,6 +5070,148 @@ func (s *ContinuousHyperParameterRange) SetName(v string) *ContinuousHyperParame return s } +type CreateBatchInferenceJobInput struct { + _ struct{} `type:"structure"` + + // The Amazon S3 path that leads to the input file to base your recommendations + // on. The input material must be in JSON format. + // + // JobInput is a required field + JobInput *BatchInferenceJobInput `locationName:"jobInput" type:"structure" required:"true"` + + // The name of the batch inference job to create. + // + // JobName is a required field + JobName *string `locationName:"jobName" min:"1" type:"string" required:"true"` + + // The path to the Amazon S3 bucket where the job's output will be stored. + // + // JobOutput is a required field + JobOutput *BatchInferenceJobOutput `locationName:"jobOutput" type:"structure" required:"true"` + + // The number of recommendations to retreive. + NumResults *int64 `locationName:"numResults" type:"integer"` + + // The ARN of the Amazon Identity and Access Management role that has permissions + // to read and write to your input and out Amazon S3 buckets respectively. + // + // RoleArn is a required field + RoleArn *string `locationName:"roleArn" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the solution version that will be used + // to generate the batch inference recommendations. + // + // SolutionVersionArn is a required field + SolutionVersionArn *string `locationName:"solutionVersionArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateBatchInferenceJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateBatchInferenceJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateBatchInferenceJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateBatchInferenceJobInput"} + if s.JobInput == nil { + invalidParams.Add(request.NewErrParamRequired("JobInput")) + } + if s.JobName == nil { + invalidParams.Add(request.NewErrParamRequired("JobName")) + } + if s.JobName != nil && len(*s.JobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("JobName", 1)) + } + if s.JobOutput == nil { + invalidParams.Add(request.NewErrParamRequired("JobOutput")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.SolutionVersionArn == nil { + invalidParams.Add(request.NewErrParamRequired("SolutionVersionArn")) + } + if s.JobInput != nil { + if err := s.JobInput.Validate(); err != nil { + invalidParams.AddNested("JobInput", err.(request.ErrInvalidParams)) + } + } + if s.JobOutput != nil { + if err := s.JobOutput.Validate(); err != nil { + invalidParams.AddNested("JobOutput", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetJobInput sets the JobInput field's value. +func (s *CreateBatchInferenceJobInput) SetJobInput(v *BatchInferenceJobInput) *CreateBatchInferenceJobInput { + s.JobInput = v + return s +} + +// SetJobName sets the JobName field's value. +func (s *CreateBatchInferenceJobInput) SetJobName(v string) *CreateBatchInferenceJobInput { + s.JobName = &v + return s +} + +// SetJobOutput sets the JobOutput field's value. +func (s *CreateBatchInferenceJobInput) SetJobOutput(v *BatchInferenceJobOutput) *CreateBatchInferenceJobInput { + s.JobOutput = v + return s +} + +// SetNumResults sets the NumResults field's value. +func (s *CreateBatchInferenceJobInput) SetNumResults(v int64) *CreateBatchInferenceJobInput { + s.NumResults = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *CreateBatchInferenceJobInput) SetRoleArn(v string) *CreateBatchInferenceJobInput { + s.RoleArn = &v + return s +} + +// SetSolutionVersionArn sets the SolutionVersionArn field's value. +func (s *CreateBatchInferenceJobInput) SetSolutionVersionArn(v string) *CreateBatchInferenceJobInput { + s.SolutionVersionArn = &v + return s +} + +type CreateBatchInferenceJobOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the batch inference job. + BatchInferenceJobArn *string `locationName:"batchInferenceJobArn" type:"string"` +} + +// String returns the string representation +func (s CreateBatchInferenceJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateBatchInferenceJobOutput) GoString() string { + return s.String() +} + +// SetBatchInferenceJobArn sets the BatchInferenceJobArn field's value. +func (s *CreateBatchInferenceJobOutput) SetBatchInferenceJobArn(v string) *CreateBatchInferenceJobOutput { + s.BatchInferenceJobArn = &v + return s +} + type CreateCampaignInput struct { _ struct{} `type:"structure"` @@ -5160,6 +5935,18 @@ type CreateSolutionVersionInput struct { // // SolutionArn is a required field SolutionArn *string `locationName:"solutionArn" type:"string" required:"true"` + + // The scope of training to be performed when creating the solution version. + // The FULL option trains the solution version based on the entirety of the + // input solution's training data, while the UPDATE option processes only the + // data that has changed in comparison to the input solution. Choose UPDATE + // when you want to incrementally update your solution version instead of creating + // an entirely new one. + // + // The UPDATE option can only be used when you already have an active solution + // version created from the input solution using the FULL option and the input + // solution was trained with the native-recipe-hrnn-coldstart recipe. + TrainingMode *string `locationName:"trainingMode" type:"string" enum:"TrainingMode"` } // String returns the string representation @@ -5191,6 +5978,12 @@ func (s *CreateSolutionVersionInput) SetSolutionArn(v string) *CreateSolutionVer return s } +// SetTrainingMode sets the TrainingMode field's value. +func (s *CreateSolutionVersionInput) SetTrainingMode(v string) *CreateSolutionVersionInput { + s.TrainingMode = &v + return s +} + type CreateSolutionVersionOutput struct { _ struct{} `type:"structure"` @@ -6460,6 +7253,67 @@ func (s *DescribeAlgorithmOutput) SetAlgorithm(v *Algorithm) *DescribeAlgorithmO return s } +type DescribeBatchInferenceJobInput struct { + _ struct{} `type:"structure"` + + // The ARN of the batch inference job to describe. + // + // BatchInferenceJobArn is a required field + BatchInferenceJobArn *string `locationName:"batchInferenceJobArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeBatchInferenceJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeBatchInferenceJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeBatchInferenceJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeBatchInferenceJobInput"} + if s.BatchInferenceJobArn == nil { + invalidParams.Add(request.NewErrParamRequired("BatchInferenceJobArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBatchInferenceJobArn sets the BatchInferenceJobArn field's value. +func (s *DescribeBatchInferenceJobInput) SetBatchInferenceJobArn(v string) *DescribeBatchInferenceJobInput { + s.BatchInferenceJobArn = &v + return s +} + +type DescribeBatchInferenceJobOutput struct { + _ struct{} `type:"structure"` + + // Information on the specified batch inference job. + BatchInferenceJob *BatchInferenceJob `locationName:"batchInferenceJob" type:"structure"` +} + +// String returns the string representation +func (s DescribeBatchInferenceJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeBatchInferenceJobOutput) GoString() string { + return s.String() +} + +// SetBatchInferenceJob sets the BatchInferenceJob field's value. +func (s *DescribeBatchInferenceJobOutput) SetBatchInferenceJob(v *BatchInferenceJob) *DescribeBatchInferenceJobOutput { + s.BatchInferenceJob = v + return s +} + type DescribeCampaignInput struct { _ struct{} `type:"structure"` @@ -7488,86 +8342,367 @@ func (s *HPOObjective) SetType(v string) *HPOObjective { return s } -// Describes the resource configuration for hyperparameter optimization (HPO). -type HPOResourceConfig struct { - _ struct{} `type:"structure"` +// Describes the resource configuration for hyperparameter optimization (HPO). +type HPOResourceConfig struct { + _ struct{} `type:"structure"` + + // The maximum number of training jobs when you create a solution version. The + // maximum value for maxNumberOfTrainingJobs is 40. + MaxNumberOfTrainingJobs *string `locationName:"maxNumberOfTrainingJobs" type:"string"` + + // The maximum number of parallel training jobs when you create a solution version. + // The maximum value for maxParallelTrainingJobs is 10. + MaxParallelTrainingJobs *string `locationName:"maxParallelTrainingJobs" type:"string"` +} + +// String returns the string representation +func (s HPOResourceConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HPOResourceConfig) GoString() string { + return s.String() +} + +// SetMaxNumberOfTrainingJobs sets the MaxNumberOfTrainingJobs field's value. +func (s *HPOResourceConfig) SetMaxNumberOfTrainingJobs(v string) *HPOResourceConfig { + s.MaxNumberOfTrainingJobs = &v + return s +} + +// SetMaxParallelTrainingJobs sets the MaxParallelTrainingJobs field's value. +func (s *HPOResourceConfig) SetMaxParallelTrainingJobs(v string) *HPOResourceConfig { + s.MaxParallelTrainingJobs = &v + return s +} + +// Specifies the hyperparameters and their ranges. Hyperparameters can be categorical, +// continuous, or integer-valued. +type HyperParameterRanges struct { + _ struct{} `type:"structure"` + + // The categorical hyperparameters and their ranges. + CategoricalHyperParameterRanges []*CategoricalHyperParameterRange `locationName:"categoricalHyperParameterRanges" type:"list"` + + // The continuous hyperparameters and their ranges. + ContinuousHyperParameterRanges []*ContinuousHyperParameterRange `locationName:"continuousHyperParameterRanges" type:"list"` + + // The integer-valued hyperparameters and their ranges. + IntegerHyperParameterRanges []*IntegerHyperParameterRange `locationName:"integerHyperParameterRanges" type:"list"` +} + +// String returns the string representation +func (s HyperParameterRanges) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HyperParameterRanges) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *HyperParameterRanges) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HyperParameterRanges"} + if s.ContinuousHyperParameterRanges != nil { + for i, v := range s.ContinuousHyperParameterRanges { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ContinuousHyperParameterRanges", i), err.(request.ErrInvalidParams)) + } + } + } + if s.IntegerHyperParameterRanges != nil { + for i, v := range s.IntegerHyperParameterRanges { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "IntegerHyperParameterRanges", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCategoricalHyperParameterRanges sets the CategoricalHyperParameterRanges field's value. +func (s *HyperParameterRanges) SetCategoricalHyperParameterRanges(v []*CategoricalHyperParameterRange) *HyperParameterRanges { + s.CategoricalHyperParameterRanges = v + return s +} + +// SetContinuousHyperParameterRanges sets the ContinuousHyperParameterRanges field's value. +func (s *HyperParameterRanges) SetContinuousHyperParameterRanges(v []*ContinuousHyperParameterRange) *HyperParameterRanges { + s.ContinuousHyperParameterRanges = v + return s +} + +// SetIntegerHyperParameterRanges sets the IntegerHyperParameterRanges field's value. +func (s *HyperParameterRanges) SetIntegerHyperParameterRanges(v []*IntegerHyperParameterRange) *HyperParameterRanges { + s.IntegerHyperParameterRanges = v + return s +} + +// Provides the name and range of an integer-valued hyperparameter. +type IntegerHyperParameterRange struct { + _ struct{} `type:"structure"` + + // The maximum allowable value for the hyperparameter. + MaxValue *int64 `locationName:"maxValue" type:"integer"` + + // The minimum allowable value for the hyperparameter. + MinValue *int64 `locationName:"minValue" type:"integer"` + + // The name of the hyperparameter. + Name *string `locationName:"name" type:"string"` +} + +// String returns the string representation +func (s IntegerHyperParameterRange) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IntegerHyperParameterRange) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *IntegerHyperParameterRange) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "IntegerHyperParameterRange"} + if s.MinValue != nil && *s.MinValue < -1e+06 { + invalidParams.Add(request.NewErrParamMinValue("MinValue", -1e+06)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxValue sets the MaxValue field's value. +func (s *IntegerHyperParameterRange) SetMaxValue(v int64) *IntegerHyperParameterRange { + s.MaxValue = &v + return s +} + +// SetMinValue sets the MinValue field's value. +func (s *IntegerHyperParameterRange) SetMinValue(v int64) *IntegerHyperParameterRange { + s.MinValue = &v + return s +} + +// SetName sets the Name field's value. +func (s *IntegerHyperParameterRange) SetName(v string) *IntegerHyperParameterRange { + s.Name = &v + return s +} + +// Provide a valid value for the field or parameter. +type InvalidInputException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidInputException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInputException) GoString() string { + return s.String() +} + +func newErrorInvalidInputException(v protocol.ResponseMetadata) error { + return &InvalidInputException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInputException) Code() string { + return "InvalidInputException" +} + +// Message returns the exception's message. +func (s InvalidInputException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInputException) OrigErr() error { + return nil +} + +func (s InvalidInputException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInputException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInputException) RequestID() string { + return s.respMetadata.RequestID +} + +// The token is not valid. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNextTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The maximum number of training jobs. - MaxNumberOfTrainingJobs *string `locationName:"maxNumberOfTrainingJobs" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} - // The maximum number of parallel training jobs. - MaxParallelTrainingJobs *string `locationName:"maxParallelTrainingJobs" type:"string"` +// The limit on the number of requests per second has been exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s HPOResourceConfig) String() string { +func (s LimitExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HPOResourceConfig) GoString() string { +func (s LimitExceededException) GoString() string { return s.String() } -// SetMaxNumberOfTrainingJobs sets the MaxNumberOfTrainingJobs field's value. -func (s *HPOResourceConfig) SetMaxNumberOfTrainingJobs(v string) *HPOResourceConfig { - s.MaxNumberOfTrainingJobs = &v - return s +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } } -// SetMaxParallelTrainingJobs sets the MaxParallelTrainingJobs field's value. -func (s *HPOResourceConfig) SetMaxParallelTrainingJobs(v string) *HPOResourceConfig { - s.MaxParallelTrainingJobs = &v - return s +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" } -// Specifies the hyperparameters and their ranges. Hyperparameters can be categorical, -// continuous, or integer-valued. -type HyperParameterRanges struct { +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +type ListBatchInferenceJobsInput struct { _ struct{} `type:"structure"` - // The categorical hyperparameters and their ranges. - CategoricalHyperParameterRanges []*CategoricalHyperParameterRange `locationName:"categoricalHyperParameterRanges" type:"list"` + // The maximum number of batch inference job results to return in each page. + // The default value is 100. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - // The continuous hyperparameters and their ranges. - ContinuousHyperParameterRanges []*ContinuousHyperParameterRange `locationName:"continuousHyperParameterRanges" type:"list"` + // The token to request the next page of results. + NextToken *string `locationName:"nextToken" type:"string"` - // The integer-valued hyperparameters and their ranges. - IntegerHyperParameterRanges []*IntegerHyperParameterRange `locationName:"integerHyperParameterRanges" type:"list"` + // The Amazon Resource Name (ARN) of the solution version from which the batch + // inference jobs were created. + SolutionVersionArn *string `locationName:"solutionVersionArn" type:"string"` } // String returns the string representation -func (s HyperParameterRanges) String() string { +func (s ListBatchInferenceJobsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HyperParameterRanges) GoString() string { +func (s ListBatchInferenceJobsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *HyperParameterRanges) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HyperParameterRanges"} - if s.ContinuousHyperParameterRanges != nil { - for i, v := range s.ContinuousHyperParameterRanges { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ContinuousHyperParameterRanges", i), err.(request.ErrInvalidParams)) - } - } - } - if s.IntegerHyperParameterRanges != nil { - for i, v := range s.IntegerHyperParameterRanges { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "IntegerHyperParameterRanges", i), err.(request.ErrInvalidParams)) - } - } +func (s *ListBatchInferenceJobsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListBatchInferenceJobsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -7576,76 +8711,54 @@ func (s *HyperParameterRanges) Validate() error { return nil } -// SetCategoricalHyperParameterRanges sets the CategoricalHyperParameterRanges field's value. -func (s *HyperParameterRanges) SetCategoricalHyperParameterRanges(v []*CategoricalHyperParameterRange) *HyperParameterRanges { - s.CategoricalHyperParameterRanges = v +// SetMaxResults sets the MaxResults field's value. +func (s *ListBatchInferenceJobsInput) SetMaxResults(v int64) *ListBatchInferenceJobsInput { + s.MaxResults = &v return s } -// SetContinuousHyperParameterRanges sets the ContinuousHyperParameterRanges field's value. -func (s *HyperParameterRanges) SetContinuousHyperParameterRanges(v []*ContinuousHyperParameterRange) *HyperParameterRanges { - s.ContinuousHyperParameterRanges = v +// SetNextToken sets the NextToken field's value. +func (s *ListBatchInferenceJobsInput) SetNextToken(v string) *ListBatchInferenceJobsInput { + s.NextToken = &v return s } -// SetIntegerHyperParameterRanges sets the IntegerHyperParameterRanges field's value. -func (s *HyperParameterRanges) SetIntegerHyperParameterRanges(v []*IntegerHyperParameterRange) *HyperParameterRanges { - s.IntegerHyperParameterRanges = v +// SetSolutionVersionArn sets the SolutionVersionArn field's value. +func (s *ListBatchInferenceJobsInput) SetSolutionVersionArn(v string) *ListBatchInferenceJobsInput { + s.SolutionVersionArn = &v return s } -// Provides the name and range of an integer-valued hyperparameter. -type IntegerHyperParameterRange struct { +type ListBatchInferenceJobsOutput struct { _ struct{} `type:"structure"` - // The maximum allowable value for the hyperparameter. - MaxValue *int64 `locationName:"maxValue" type:"integer"` - - // The minimum allowable value for the hyperparameter. - MinValue *int64 `locationName:"minValue" type:"integer"` + // A list containing information on each job that is returned. + BatchInferenceJobs []*BatchInferenceJobSummary `locationName:"batchInferenceJobs" type:"list"` - // The name of the hyperparameter. - Name *string `locationName:"name" type:"string"` + // The token to use to retreive the next page of results. The value is null + // when there are no more results to return. + NextToken *string `locationName:"nextToken" type:"string"` } // String returns the string representation -func (s IntegerHyperParameterRange) String() string { +func (s ListBatchInferenceJobsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s IntegerHyperParameterRange) GoString() string { +func (s ListBatchInferenceJobsOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *IntegerHyperParameterRange) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IntegerHyperParameterRange"} - if s.MinValue != nil && *s.MinValue < -1e+06 { - invalidParams.Add(request.NewErrParamMinValue("MinValue", -1e+06)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxValue sets the MaxValue field's value. -func (s *IntegerHyperParameterRange) SetMaxValue(v int64) *IntegerHyperParameterRange { - s.MaxValue = &v - return s -} - -// SetMinValue sets the MinValue field's value. -func (s *IntegerHyperParameterRange) SetMinValue(v int64) *IntegerHyperParameterRange { - s.MinValue = &v +// SetBatchInferenceJobs sets the BatchInferenceJobs field's value. +func (s *ListBatchInferenceJobsOutput) SetBatchInferenceJobs(v []*BatchInferenceJobSummary) *ListBatchInferenceJobsOutput { + s.BatchInferenceJobs = v return s } -// SetName sets the Name field's value. -func (s *IntegerHyperParameterRange) SetName(v string) *IntegerHyperParameterRange { - s.Name = &v +// SetNextToken sets the NextToken field's value. +func (s *ListBatchInferenceJobsOutput) SetNextToken(v string) *ListBatchInferenceJobsOutput { + s.NextToken = &v return s } @@ -8584,6 +9697,224 @@ func (s *RecipeSummary) SetStatus(v string) *RecipeSummary { return s } +// The specified resource already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource is in use. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// Could not find the specified resource. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The configuration details of an Amazon S3 input or output bucket. +type S3DataConfig struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the Amazon Key Management Service (KMS) + // key that Amazon Personalize uses to encrypt or decrypt the input and output + // files of a batch inference job. + KmsKeyArn *string `locationName:"kmsKeyArn" type:"string"` + + // The file path of the Amazon S3 bucket. + // + // Path is a required field + Path *string `locationName:"path" type:"string" required:"true"` +} + +// String returns the string representation +func (s S3DataConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s S3DataConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *S3DataConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "S3DataConfig"} + if s.Path == nil { + invalidParams.Add(request.NewErrParamRequired("Path")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKmsKeyArn sets the KmsKeyArn field's value. +func (s *S3DataConfig) SetKmsKeyArn(v string) *S3DataConfig { + s.KmsKeyArn = &v + return s +} + +// SetPath sets the Path field's value. +func (s *S3DataConfig) SetPath(v string) *S3DataConfig { + s.Path = &v + return s +} + // An object that provides information about a solution. A solution is a trained // model that can be deployed as a campaign. type Solution struct { @@ -8748,9 +10079,7 @@ type SolutionConfig struct { // Lists the feature transformation parameters. FeatureTransformationParameters map[string]*string `locationName:"featureTransformationParameters" type:"map"` - // Describes the properties for hyperparameter optimization (HPO). For use with - // the bring-your-own-recipe feature. Not used with Amazon Personalize predefined - // recipes. + // Describes the properties for hyperparameter optimization (HPO). HpoConfig *HPOConfig `locationName:"hpoConfig" type:"structure"` } @@ -8891,15 +10220,15 @@ type SolutionVersion struct { // the model. EventType *string `locationName:"eventType" type:"string"` - // If training a solution version fails, the reason behind the failure. + // If training a solution version fails, the reason for the failure. FailureReason *string `locationName:"failureReason" type:"string"` // The date and time (in Unix time) that the solution was last updated. LastUpdatedDateTime *time.Time `locationName:"lastUpdatedDateTime" type:"timestamp"` - // When true, Amazon Personalize performs a search for the most optimal recipe - // according to the solution configuration. When false (the default), Amazon - // Personalize uses recipeArn. + // When true, Amazon Personalize searches for the most optimal recipe according + // to the solution configuration. When false (the default), Amazon Personalize + // uses recipeArn. PerformAutoML *bool `locationName:"performAutoML" type:"boolean"` // Whether to perform hyperparameter optimization (HPO) on the chosen recipe. @@ -8922,11 +10251,30 @@ type SolutionVersion struct { // // A solution version can be in one of the following states: // - // * CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED + // * CREATE PENDING + // + // * CREATE IN_PROGRESS + // + // * ACTIVE + // + // * CREATE FAILED Status *string `locationName:"status" type:"string"` - // The time used to train the model. + // The time used to train the model. You are billed for the time it takes to + // train a model. This field is visible only after Amazon Personalize successfully + // trains a model. TrainingHours *float64 `locationName:"trainingHours" type:"double"` + + // The scope of training used to create the solution version. The FULL option + // trains the solution version based on the entirety of the input solution's + // training data, while the UPDATE option processes only the training data that + // has changed since the creation of the last solution version. Choose UPDATE + // when you want to start recommending items added to the dataset without retraining + // the model. + // + // The UPDATE option can only be used after you've created a solution version + // with the FULL option and the training solution uses the native-recipe-hrnn-coldstart. + TrainingMode *string `locationName:"trainingMode" type:"string" enum:"TrainingMode"` } // String returns the string representation @@ -9017,6 +10365,12 @@ func (s *SolutionVersion) SetTrainingHours(v float64) *SolutionVersion { return s } +// SetTrainingMode sets the TrainingMode field's value. +func (s *SolutionVersion) SetTrainingMode(v string) *SolutionVersion { + s.TrainingMode = &v + return s +} + // Provides a summary of the properties of a solution version. For a complete // listing, call the DescribeSolutionVersion API. type SolutionVersionSummary struct { @@ -9169,3 +10523,11 @@ const ( // RecipeProviderService is a RecipeProvider enum value RecipeProviderService = "SERVICE" ) + +const ( + // TrainingModeFull is a TrainingMode enum value + TrainingModeFull = "FULL" + + // TrainingModeUpdate is a TrainingMode enum value + TrainingModeUpdate = "UPDATE" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/personalize/errors.go b/vendor/github.com/aws/aws-sdk-go/service/personalize/errors.go index 9511bd051a9..c764bbb02d9 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/personalize/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/personalize/errors.go @@ -2,6 +2,10 @@ package personalize +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInvalidInputException for service response error code @@ -40,3 +44,12 @@ const ( // Could not find the specified resource. ErrCodeResourceNotFoundException = "ResourceNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InvalidInputException": newErrorInvalidInputException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "LimitExceededException": newErrorLimitExceededException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/personalize/service.go b/vendor/github.com/aws/aws-sdk-go/service/personalize/service.go index 4b1ff03e3de..e7febdb085b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/personalize/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/personalize/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "Personalize" // Name of service. EndpointsID = "personalize" // ID to lookup a service endpoint with. - ServiceID = "Personalize" // ServiceID is a unique identifer of a specific service. + ServiceID = "Personalize" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Personalize client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Personalize client from just a session. // svc := personalize.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *Personalize { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "personalize" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Personalize { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Personalize { svc := &Personalize{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-05-22", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/pinpoint/api.go b/vendor/github.com/aws/aws-sdk-go/service/pinpoint/api.go index 1db0bda0991..e9856621f52 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/pinpoint/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/pinpoint/api.go @@ -66,23 +66,23 @@ func (c *Pinpoint) CreateAppRequest(input *CreateAppInput) (req *request.Request // See the AWS API reference guide for Amazon Pinpoint's // API operation CreateApp for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // // See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateApp @@ -161,23 +161,23 @@ func (c *Pinpoint) CreateCampaignRequest(input *CreateCampaignInput) (req *reque // See the AWS API reference guide for Amazon Pinpoint's // API operation CreateCampaign for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // // See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateCampaign @@ -202,6 +202,97 @@ func (c *Pinpoint) CreateCampaignWithContext(ctx aws.Context, input *CreateCampa return out, req.Send() } +const opCreateEmailTemplate = "CreateEmailTemplate" + +// CreateEmailTemplateRequest generates a "aws/request.Request" representing the +// client's request for the CreateEmailTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateEmailTemplate for more information on using the CreateEmailTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateEmailTemplateRequest method. +// req, resp := client.CreateEmailTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateEmailTemplate +func (c *Pinpoint) CreateEmailTemplateRequest(input *CreateEmailTemplateInput) (req *request.Request, output *CreateEmailTemplateOutput) { + op := &request.Operation{ + Name: opCreateEmailTemplate, + HTTPMethod: "POST", + HTTPPath: "/v1/templates/{template-name}/email", + } + + if input == nil { + input = &CreateEmailTemplateInput{} + } + + output = &CreateEmailTemplateOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateEmailTemplate API operation for Amazon Pinpoint. +// +// Creates a message template for messages that are sent through the email channel. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Pinpoint's +// API operation CreateEmailTemplate for usage and error information. +// +// Returned Error Types: +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateEmailTemplate +func (c *Pinpoint) CreateEmailTemplate(input *CreateEmailTemplateInput) (*CreateEmailTemplateOutput, error) { + req, out := c.CreateEmailTemplateRequest(input) + return out, req.Send() +} + +// CreateEmailTemplateWithContext is the same as CreateEmailTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See CreateEmailTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) CreateEmailTemplateWithContext(ctx aws.Context, input *CreateEmailTemplateInput, opts ...request.Option) (*CreateEmailTemplateOutput, error) { + req, out := c.CreateEmailTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateExportJob = "CreateExportJob" // CreateExportJobRequest generates a "aws/request.Request" representing the @@ -246,7 +337,7 @@ func (c *Pinpoint) CreateExportJobRequest(input *CreateExportJobInput) (req *req // CreateExportJob API operation for Amazon Pinpoint. // -// Creates a new export job for an application. +// Creates an export job 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 @@ -255,23 +346,23 @@ func (c *Pinpoint) CreateExportJobRequest(input *CreateExportJobInput) (req *req // See the AWS API reference guide for Amazon Pinpoint's // API operation CreateExportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // // See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateExportJob @@ -340,7 +431,7 @@ func (c *Pinpoint) CreateImportJobRequest(input *CreateImportJobInput) (req *req // CreateImportJob API operation for Amazon Pinpoint. // -// Creates a new import job for an application. +// Creates an import job 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 @@ -349,23 +440,23 @@ func (c *Pinpoint) CreateImportJobRequest(input *CreateImportJobInput) (req *req // See the AWS API reference guide for Amazon Pinpoint's // API operation CreateImportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // // See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateImportJob @@ -390,3366 +481,3354 @@ func (c *Pinpoint) CreateImportJobWithContext(ctx aws.Context, input *CreateImpo return out, req.Send() } -const opCreateSegment = "CreateSegment" +const opCreateJourney = "CreateJourney" -// CreateSegmentRequest generates a "aws/request.Request" representing the -// client's request for the CreateSegment operation. The "output" return +// CreateJourneyRequest generates a "aws/request.Request" representing the +// client's request for the CreateJourney operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See CreateSegment for more information on using the CreateSegment +// See CreateJourney for more information on using the CreateJourney // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the CreateSegmentRequest method. -// req, resp := client.CreateSegmentRequest(params) +// // Example sending a request using the CreateJourneyRequest method. +// req, resp := client.CreateJourneyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateSegment -func (c *Pinpoint) CreateSegmentRequest(input *CreateSegmentInput) (req *request.Request, output *CreateSegmentOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateJourney +func (c *Pinpoint) CreateJourneyRequest(input *CreateJourneyInput) (req *request.Request, output *CreateJourneyOutput) { op := &request.Operation{ - Name: opCreateSegment, + Name: opCreateJourney, HTTPMethod: "POST", - HTTPPath: "/v1/apps/{application-id}/segments", + HTTPPath: "/v1/apps/{application-id}/journeys", } if input == nil { - input = &CreateSegmentInput{} + input = &CreateJourneyInput{} } - output = &CreateSegmentOutput{} + output = &CreateJourneyOutput{} req = c.newRequest(op, input, output) return } -// CreateSegment API operation for Amazon Pinpoint. +// CreateJourney API operation for Amazon Pinpoint. // -// Creates a new segment for an application or updates the configuration, dimension, -// and other settings for an existing segment that's associated with an application. +// Creates a journey 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 Amazon Pinpoint's -// API operation CreateSegment for usage and error information. +// API operation CreateJourney for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateSegment -func (c *Pinpoint) CreateSegment(input *CreateSegmentInput) (*CreateSegmentOutput, error) { - req, out := c.CreateSegmentRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateJourney +func (c *Pinpoint) CreateJourney(input *CreateJourneyInput) (*CreateJourneyOutput, error) { + req, out := c.CreateJourneyRequest(input) return out, req.Send() } -// CreateSegmentWithContext is the same as CreateSegment with the addition of +// CreateJourneyWithContext is the same as CreateJourney with the addition of // the ability to pass a context and additional request options. // -// See CreateSegment for details on how to use this API operation. +// See CreateJourney for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) CreateSegmentWithContext(ctx aws.Context, input *CreateSegmentInput, opts ...request.Option) (*CreateSegmentOutput, error) { - req, out := c.CreateSegmentRequest(input) +func (c *Pinpoint) CreateJourneyWithContext(ctx aws.Context, input *CreateJourneyInput, opts ...request.Option) (*CreateJourneyOutput, error) { + req, out := c.CreateJourneyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteAdmChannel = "DeleteAdmChannel" +const opCreatePushTemplate = "CreatePushTemplate" -// DeleteAdmChannelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAdmChannel operation. The "output" return +// CreatePushTemplateRequest generates a "aws/request.Request" representing the +// client's request for the CreatePushTemplate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteAdmChannel for more information on using the DeleteAdmChannel +// See CreatePushTemplate for more information on using the CreatePushTemplate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteAdmChannelRequest method. -// req, resp := client.DeleteAdmChannelRequest(params) +// // Example sending a request using the CreatePushTemplateRequest method. +// req, resp := client.CreatePushTemplateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteAdmChannel -func (c *Pinpoint) DeleteAdmChannelRequest(input *DeleteAdmChannelInput) (req *request.Request, output *DeleteAdmChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreatePushTemplate +func (c *Pinpoint) CreatePushTemplateRequest(input *CreatePushTemplateInput) (req *request.Request, output *CreatePushTemplateOutput) { op := &request.Operation{ - Name: opDeleteAdmChannel, - HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}/channels/adm", + Name: opCreatePushTemplate, + HTTPMethod: "POST", + HTTPPath: "/v1/templates/{template-name}/push", } if input == nil { - input = &DeleteAdmChannelInput{} + input = &CreatePushTemplateInput{} } - output = &DeleteAdmChannelOutput{} + output = &CreatePushTemplateOutput{} req = c.newRequest(op, input, output) return } -// DeleteAdmChannel API operation for Amazon Pinpoint. +// CreatePushTemplate API operation for Amazon Pinpoint. // -// Disables the ADM channel for an application and deletes any existing settings -// for the channel. +// Creates a message template for messages that are sent through a push notification +// channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation DeleteAdmChannel for usage and error information. +// API operation CreatePushTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * TooManyRequestsException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Provides information about an API request or response. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteAdmChannel -func (c *Pinpoint) DeleteAdmChannel(input *DeleteAdmChannelInput) (*DeleteAdmChannelOutput, error) { - req, out := c.DeleteAdmChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreatePushTemplate +func (c *Pinpoint) CreatePushTemplate(input *CreatePushTemplateInput) (*CreatePushTemplateOutput, error) { + req, out := c.CreatePushTemplateRequest(input) return out, req.Send() } -// DeleteAdmChannelWithContext is the same as DeleteAdmChannel with the addition of +// CreatePushTemplateWithContext is the same as CreatePushTemplate with the addition of // the ability to pass a context and additional request options. // -// See DeleteAdmChannel for details on how to use this API operation. +// See CreatePushTemplate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteAdmChannelWithContext(ctx aws.Context, input *DeleteAdmChannelInput, opts ...request.Option) (*DeleteAdmChannelOutput, error) { - req, out := c.DeleteAdmChannelRequest(input) +func (c *Pinpoint) CreatePushTemplateWithContext(ctx aws.Context, input *CreatePushTemplateInput, opts ...request.Option) (*CreatePushTemplateOutput, error) { + req, out := c.CreatePushTemplateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteApnsChannel = "DeleteApnsChannel" +const opCreateSegment = "CreateSegment" -// DeleteApnsChannelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteApnsChannel operation. The "output" return +// CreateSegmentRequest generates a "aws/request.Request" representing the +// client's request for the CreateSegment operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteApnsChannel for more information on using the DeleteApnsChannel +// See CreateSegment for more information on using the CreateSegment // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteApnsChannelRequest method. -// req, resp := client.DeleteApnsChannelRequest(params) +// // Example sending a request using the CreateSegmentRequest method. +// req, resp := client.CreateSegmentRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsChannel -func (c *Pinpoint) DeleteApnsChannelRequest(input *DeleteApnsChannelInput) (req *request.Request, output *DeleteApnsChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateSegment +func (c *Pinpoint) CreateSegmentRequest(input *CreateSegmentInput) (req *request.Request, output *CreateSegmentOutput) { op := &request.Operation{ - Name: opDeleteApnsChannel, - HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}/channels/apns", + Name: opCreateSegment, + HTTPMethod: "POST", + HTTPPath: "/v1/apps/{application-id}/segments", } if input == nil { - input = &DeleteApnsChannelInput{} + input = &CreateSegmentInput{} } - output = &DeleteApnsChannelOutput{} + output = &CreateSegmentOutput{} req = c.newRequest(op, input, output) return } -// DeleteApnsChannel API operation for Amazon Pinpoint. +// CreateSegment API operation for Amazon Pinpoint. // -// Disables the APNs channel for an application and deletes any existing settings -// for the channel. +// Creates a new segment for an application or updates the configuration, dimension, +// and other settings for an existing segment that's associated with 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 Amazon Pinpoint's -// API operation DeleteApnsChannel for usage and error information. +// API operation CreateSegment for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsChannel -func (c *Pinpoint) DeleteApnsChannel(input *DeleteApnsChannelInput) (*DeleteApnsChannelOutput, error) { - req, out := c.DeleteApnsChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateSegment +func (c *Pinpoint) CreateSegment(input *CreateSegmentInput) (*CreateSegmentOutput, error) { + req, out := c.CreateSegmentRequest(input) return out, req.Send() } -// DeleteApnsChannelWithContext is the same as DeleteApnsChannel with the addition of +// CreateSegmentWithContext is the same as CreateSegment with the addition of // the ability to pass a context and additional request options. // -// See DeleteApnsChannel for details on how to use this API operation. +// See CreateSegment for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteApnsChannelWithContext(ctx aws.Context, input *DeleteApnsChannelInput, opts ...request.Option) (*DeleteApnsChannelOutput, error) { - req, out := c.DeleteApnsChannelRequest(input) +func (c *Pinpoint) CreateSegmentWithContext(ctx aws.Context, input *CreateSegmentInput, opts ...request.Option) (*CreateSegmentOutput, error) { + req, out := c.CreateSegmentRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteApnsSandboxChannel = "DeleteApnsSandboxChannel" +const opCreateSmsTemplate = "CreateSmsTemplate" -// DeleteApnsSandboxChannelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteApnsSandboxChannel operation. The "output" return +// CreateSmsTemplateRequest generates a "aws/request.Request" representing the +// client's request for the CreateSmsTemplate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteApnsSandboxChannel for more information on using the DeleteApnsSandboxChannel +// See CreateSmsTemplate for more information on using the CreateSmsTemplate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteApnsSandboxChannelRequest method. -// req, resp := client.DeleteApnsSandboxChannelRequest(params) +// // Example sending a request using the CreateSmsTemplateRequest method. +// req, resp := client.CreateSmsTemplateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsSandboxChannel -func (c *Pinpoint) DeleteApnsSandboxChannelRequest(input *DeleteApnsSandboxChannelInput) (req *request.Request, output *DeleteApnsSandboxChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateSmsTemplate +func (c *Pinpoint) CreateSmsTemplateRequest(input *CreateSmsTemplateInput) (req *request.Request, output *CreateSmsTemplateOutput) { op := &request.Operation{ - Name: opDeleteApnsSandboxChannel, - HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}/channels/apns_sandbox", + Name: opCreateSmsTemplate, + HTTPMethod: "POST", + HTTPPath: "/v1/templates/{template-name}/sms", } if input == nil { - input = &DeleteApnsSandboxChannelInput{} + input = &CreateSmsTemplateInput{} } - output = &DeleteApnsSandboxChannelOutput{} + output = &CreateSmsTemplateOutput{} req = c.newRequest(op, input, output) return } -// DeleteApnsSandboxChannel API operation for Amazon Pinpoint. +// CreateSmsTemplate API operation for Amazon Pinpoint. // -// Disables the APNs sandbox channel for an application and deletes any existing -// settings for the channel. +// Creates a message template for messages that are sent through the SMS channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation DeleteApnsSandboxChannel for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// Provides information about an API request or response. +// API operation CreateSmsTemplate for usage and error information. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// Returned Error Types: +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * TooManyRequestsException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * ForbiddenException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsSandboxChannel -func (c *Pinpoint) DeleteApnsSandboxChannel(input *DeleteApnsSandboxChannelInput) (*DeleteApnsSandboxChannelOutput, error) { - req, out := c.DeleteApnsSandboxChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateSmsTemplate +func (c *Pinpoint) CreateSmsTemplate(input *CreateSmsTemplateInput) (*CreateSmsTemplateOutput, error) { + req, out := c.CreateSmsTemplateRequest(input) return out, req.Send() } -// DeleteApnsSandboxChannelWithContext is the same as DeleteApnsSandboxChannel with the addition of +// CreateSmsTemplateWithContext is the same as CreateSmsTemplate with the addition of // the ability to pass a context and additional request options. // -// See DeleteApnsSandboxChannel for details on how to use this API operation. +// See CreateSmsTemplate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteApnsSandboxChannelWithContext(ctx aws.Context, input *DeleteApnsSandboxChannelInput, opts ...request.Option) (*DeleteApnsSandboxChannelOutput, error) { - req, out := c.DeleteApnsSandboxChannelRequest(input) +func (c *Pinpoint) CreateSmsTemplateWithContext(ctx aws.Context, input *CreateSmsTemplateInput, opts ...request.Option) (*CreateSmsTemplateOutput, error) { + req, out := c.CreateSmsTemplateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteApnsVoipChannel = "DeleteApnsVoipChannel" +const opCreateVoiceTemplate = "CreateVoiceTemplate" -// DeleteApnsVoipChannelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteApnsVoipChannel operation. The "output" return +// CreateVoiceTemplateRequest generates a "aws/request.Request" representing the +// client's request for the CreateVoiceTemplate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteApnsVoipChannel for more information on using the DeleteApnsVoipChannel +// See CreateVoiceTemplate for more information on using the CreateVoiceTemplate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteApnsVoipChannelRequest method. -// req, resp := client.DeleteApnsVoipChannelRequest(params) +// // Example sending a request using the CreateVoiceTemplateRequest method. +// req, resp := client.CreateVoiceTemplateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsVoipChannel -func (c *Pinpoint) DeleteApnsVoipChannelRequest(input *DeleteApnsVoipChannelInput) (req *request.Request, output *DeleteApnsVoipChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateVoiceTemplate +func (c *Pinpoint) CreateVoiceTemplateRequest(input *CreateVoiceTemplateInput) (req *request.Request, output *CreateVoiceTemplateOutput) { op := &request.Operation{ - Name: opDeleteApnsVoipChannel, - HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}/channels/apns_voip", + Name: opCreateVoiceTemplate, + HTTPMethod: "POST", + HTTPPath: "/v1/templates/{template-name}/voice", } if input == nil { - input = &DeleteApnsVoipChannelInput{} + input = &CreateVoiceTemplateInput{} } - output = &DeleteApnsVoipChannelOutput{} + output = &CreateVoiceTemplateOutput{} req = c.newRequest(op, input, output) return } -// DeleteApnsVoipChannel API operation for Amazon Pinpoint. +// CreateVoiceTemplate API operation for Amazon Pinpoint. // -// Disables the APNs VoIP channel for an application and deletes any existing -// settings for the channel. +// Creates a message template for messages that are sent through the voice channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation DeleteApnsVoipChannel for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// Provides information about an API request or response. +// API operation CreateVoiceTemplate for usage and error information. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// Returned Error Types: +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * TooManyRequestsException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * ForbiddenException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsVoipChannel -func (c *Pinpoint) DeleteApnsVoipChannel(input *DeleteApnsVoipChannelInput) (*DeleteApnsVoipChannelOutput, error) { - req, out := c.DeleteApnsVoipChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/CreateVoiceTemplate +func (c *Pinpoint) CreateVoiceTemplate(input *CreateVoiceTemplateInput) (*CreateVoiceTemplateOutput, error) { + req, out := c.CreateVoiceTemplateRequest(input) return out, req.Send() } -// DeleteApnsVoipChannelWithContext is the same as DeleteApnsVoipChannel with the addition of +// CreateVoiceTemplateWithContext is the same as CreateVoiceTemplate with the addition of // the ability to pass a context and additional request options. // -// See DeleteApnsVoipChannel for details on how to use this API operation. +// See CreateVoiceTemplate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteApnsVoipChannelWithContext(ctx aws.Context, input *DeleteApnsVoipChannelInput, opts ...request.Option) (*DeleteApnsVoipChannelOutput, error) { - req, out := c.DeleteApnsVoipChannelRequest(input) +func (c *Pinpoint) CreateVoiceTemplateWithContext(ctx aws.Context, input *CreateVoiceTemplateInput, opts ...request.Option) (*CreateVoiceTemplateOutput, error) { + req, out := c.CreateVoiceTemplateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteApnsVoipSandboxChannel = "DeleteApnsVoipSandboxChannel" +const opDeleteAdmChannel = "DeleteAdmChannel" -// DeleteApnsVoipSandboxChannelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteApnsVoipSandboxChannel operation. The "output" return +// DeleteAdmChannelRequest generates a "aws/request.Request" representing the +// client's request for the DeleteAdmChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteApnsVoipSandboxChannel for more information on using the DeleteApnsVoipSandboxChannel +// See DeleteAdmChannel for more information on using the DeleteAdmChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteApnsVoipSandboxChannelRequest method. -// req, resp := client.DeleteApnsVoipSandboxChannelRequest(params) +// // Example sending a request using the DeleteAdmChannelRequest method. +// req, resp := client.DeleteAdmChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsVoipSandboxChannel -func (c *Pinpoint) DeleteApnsVoipSandboxChannelRequest(input *DeleteApnsVoipSandboxChannelInput) (req *request.Request, output *DeleteApnsVoipSandboxChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteAdmChannel +func (c *Pinpoint) DeleteAdmChannelRequest(input *DeleteAdmChannelInput) (req *request.Request, output *DeleteAdmChannelOutput) { op := &request.Operation{ - Name: opDeleteApnsVoipSandboxChannel, + Name: opDeleteAdmChannel, HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}/channels/apns_voip_sandbox", + HTTPPath: "/v1/apps/{application-id}/channels/adm", } if input == nil { - input = &DeleteApnsVoipSandboxChannelInput{} + input = &DeleteAdmChannelInput{} } - output = &DeleteApnsVoipSandboxChannelOutput{} + output = &DeleteAdmChannelOutput{} req = c.newRequest(op, input, output) return } -// DeleteApnsVoipSandboxChannel API operation for Amazon Pinpoint. +// DeleteAdmChannel API operation for Amazon Pinpoint. // -// Disables the APNs VoIP sandbox channel for an application and deletes any -// existing settings for the channel. +// Disables the ADM channel for an application and deletes any existing settings +// for the channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation DeleteApnsVoipSandboxChannel for usage and error information. +// API operation DeleteAdmChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsVoipSandboxChannel -func (c *Pinpoint) DeleteApnsVoipSandboxChannel(input *DeleteApnsVoipSandboxChannelInput) (*DeleteApnsVoipSandboxChannelOutput, error) { - req, out := c.DeleteApnsVoipSandboxChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteAdmChannel +func (c *Pinpoint) DeleteAdmChannel(input *DeleteAdmChannelInput) (*DeleteAdmChannelOutput, error) { + req, out := c.DeleteAdmChannelRequest(input) return out, req.Send() } -// DeleteApnsVoipSandboxChannelWithContext is the same as DeleteApnsVoipSandboxChannel with the addition of +// DeleteAdmChannelWithContext is the same as DeleteAdmChannel with the addition of // the ability to pass a context and additional request options. // -// See DeleteApnsVoipSandboxChannel for details on how to use this API operation. +// See DeleteAdmChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteApnsVoipSandboxChannelWithContext(ctx aws.Context, input *DeleteApnsVoipSandboxChannelInput, opts ...request.Option) (*DeleteApnsVoipSandboxChannelOutput, error) { - req, out := c.DeleteApnsVoipSandboxChannelRequest(input) +func (c *Pinpoint) DeleteAdmChannelWithContext(ctx aws.Context, input *DeleteAdmChannelInput, opts ...request.Option) (*DeleteAdmChannelOutput, error) { + req, out := c.DeleteAdmChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteApp = "DeleteApp" +const opDeleteApnsChannel = "DeleteApnsChannel" -// DeleteAppRequest generates a "aws/request.Request" representing the -// client's request for the DeleteApp operation. The "output" return +// DeleteApnsChannelRequest generates a "aws/request.Request" representing the +// client's request for the DeleteApnsChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteApp for more information on using the DeleteApp +// See DeleteApnsChannel for more information on using the DeleteApnsChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteAppRequest method. -// req, resp := client.DeleteAppRequest(params) +// // Example sending a request using the DeleteApnsChannelRequest method. +// req, resp := client.DeleteApnsChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApp -func (c *Pinpoint) DeleteAppRequest(input *DeleteAppInput) (req *request.Request, output *DeleteAppOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsChannel +func (c *Pinpoint) DeleteApnsChannelRequest(input *DeleteApnsChannelInput) (req *request.Request, output *DeleteApnsChannelOutput) { op := &request.Operation{ - Name: opDeleteApp, + Name: opDeleteApnsChannel, HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}", + HTTPPath: "/v1/apps/{application-id}/channels/apns", } if input == nil { - input = &DeleteAppInput{} + input = &DeleteApnsChannelInput{} } - output = &DeleteAppOutput{} + output = &DeleteApnsChannelOutput{} req = c.newRequest(op, input, output) return } -// DeleteApp API operation for Amazon Pinpoint. +// DeleteApnsChannel API operation for Amazon Pinpoint. // -// Deletes an application. +// Disables the APNs channel for an application and deletes any existing settings +// for the channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation DeleteApp for usage and error information. +// API operation DeleteApnsChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApp -func (c *Pinpoint) DeleteApp(input *DeleteAppInput) (*DeleteAppOutput, error) { - req, out := c.DeleteAppRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsChannel +func (c *Pinpoint) DeleteApnsChannel(input *DeleteApnsChannelInput) (*DeleteApnsChannelOutput, error) { + req, out := c.DeleteApnsChannelRequest(input) return out, req.Send() } -// DeleteAppWithContext is the same as DeleteApp with the addition of +// DeleteApnsChannelWithContext is the same as DeleteApnsChannel with the addition of // the ability to pass a context and additional request options. // -// See DeleteApp for details on how to use this API operation. +// See DeleteApnsChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteAppWithContext(ctx aws.Context, input *DeleteAppInput, opts ...request.Option) (*DeleteAppOutput, error) { - req, out := c.DeleteAppRequest(input) +func (c *Pinpoint) DeleteApnsChannelWithContext(ctx aws.Context, input *DeleteApnsChannelInput, opts ...request.Option) (*DeleteApnsChannelOutput, error) { + req, out := c.DeleteApnsChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteBaiduChannel = "DeleteBaiduChannel" +const opDeleteApnsSandboxChannel = "DeleteApnsSandboxChannel" -// DeleteBaiduChannelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBaiduChannel operation. The "output" return +// DeleteApnsSandboxChannelRequest generates a "aws/request.Request" representing the +// client's request for the DeleteApnsSandboxChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteBaiduChannel for more information on using the DeleteBaiduChannel +// See DeleteApnsSandboxChannel for more information on using the DeleteApnsSandboxChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteBaiduChannelRequest method. -// req, resp := client.DeleteBaiduChannelRequest(params) +// // Example sending a request using the DeleteApnsSandboxChannelRequest method. +// req, resp := client.DeleteApnsSandboxChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteBaiduChannel -func (c *Pinpoint) DeleteBaiduChannelRequest(input *DeleteBaiduChannelInput) (req *request.Request, output *DeleteBaiduChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsSandboxChannel +func (c *Pinpoint) DeleteApnsSandboxChannelRequest(input *DeleteApnsSandboxChannelInput) (req *request.Request, output *DeleteApnsSandboxChannelOutput) { op := &request.Operation{ - Name: opDeleteBaiduChannel, + Name: opDeleteApnsSandboxChannel, HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}/channels/baidu", + HTTPPath: "/v1/apps/{application-id}/channels/apns_sandbox", } if input == nil { - input = &DeleteBaiduChannelInput{} + input = &DeleteApnsSandboxChannelInput{} } - output = &DeleteBaiduChannelOutput{} + output = &DeleteApnsSandboxChannelOutput{} req = c.newRequest(op, input, output) return } -// DeleteBaiduChannel API operation for Amazon Pinpoint. +// DeleteApnsSandboxChannel API operation for Amazon Pinpoint. // -// Disables the Baidu channel for an application and deletes any existing settings -// for the channel. +// Disables the APNs sandbox channel for an application and deletes any existing +// settings for the channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation DeleteBaiduChannel for usage and error information. +// API operation DeleteApnsSandboxChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteBaiduChannel -func (c *Pinpoint) DeleteBaiduChannel(input *DeleteBaiduChannelInput) (*DeleteBaiduChannelOutput, error) { - req, out := c.DeleteBaiduChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsSandboxChannel +func (c *Pinpoint) DeleteApnsSandboxChannel(input *DeleteApnsSandboxChannelInput) (*DeleteApnsSandboxChannelOutput, error) { + req, out := c.DeleteApnsSandboxChannelRequest(input) return out, req.Send() } -// DeleteBaiduChannelWithContext is the same as DeleteBaiduChannel with the addition of +// DeleteApnsSandboxChannelWithContext is the same as DeleteApnsSandboxChannel with the addition of // the ability to pass a context and additional request options. // -// See DeleteBaiduChannel for details on how to use this API operation. +// See DeleteApnsSandboxChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteBaiduChannelWithContext(ctx aws.Context, input *DeleteBaiduChannelInput, opts ...request.Option) (*DeleteBaiduChannelOutput, error) { - req, out := c.DeleteBaiduChannelRequest(input) +func (c *Pinpoint) DeleteApnsSandboxChannelWithContext(ctx aws.Context, input *DeleteApnsSandboxChannelInput, opts ...request.Option) (*DeleteApnsSandboxChannelOutput, error) { + req, out := c.DeleteApnsSandboxChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteCampaign = "DeleteCampaign" +const opDeleteApnsVoipChannel = "DeleteApnsVoipChannel" -// DeleteCampaignRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCampaign operation. The "output" return +// DeleteApnsVoipChannelRequest generates a "aws/request.Request" representing the +// client's request for the DeleteApnsVoipChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteCampaign for more information on using the DeleteCampaign +// See DeleteApnsVoipChannel for more information on using the DeleteApnsVoipChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteCampaignRequest method. -// req, resp := client.DeleteCampaignRequest(params) +// // Example sending a request using the DeleteApnsVoipChannelRequest method. +// req, resp := client.DeleteApnsVoipChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteCampaign -func (c *Pinpoint) DeleteCampaignRequest(input *DeleteCampaignInput) (req *request.Request, output *DeleteCampaignOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsVoipChannel +func (c *Pinpoint) DeleteApnsVoipChannelRequest(input *DeleteApnsVoipChannelInput) (req *request.Request, output *DeleteApnsVoipChannelOutput) { op := &request.Operation{ - Name: opDeleteCampaign, + Name: opDeleteApnsVoipChannel, HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}/campaigns/{campaign-id}", + HTTPPath: "/v1/apps/{application-id}/channels/apns_voip", } if input == nil { - input = &DeleteCampaignInput{} + input = &DeleteApnsVoipChannelInput{} } - output = &DeleteCampaignOutput{} + output = &DeleteApnsVoipChannelOutput{} req = c.newRequest(op, input, output) return } -// DeleteCampaign API operation for Amazon Pinpoint. +// DeleteApnsVoipChannel API operation for Amazon Pinpoint. // -// Deletes a campaign from an application. +// Disables the APNs VoIP channel for an application and deletes any existing +// settings for the channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation DeleteCampaign for usage and error information. +// API operation DeleteApnsVoipChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteCampaign -func (c *Pinpoint) DeleteCampaign(input *DeleteCampaignInput) (*DeleteCampaignOutput, error) { - req, out := c.DeleteCampaignRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsVoipChannel +func (c *Pinpoint) DeleteApnsVoipChannel(input *DeleteApnsVoipChannelInput) (*DeleteApnsVoipChannelOutput, error) { + req, out := c.DeleteApnsVoipChannelRequest(input) return out, req.Send() } -// DeleteCampaignWithContext is the same as DeleteCampaign with the addition of +// DeleteApnsVoipChannelWithContext is the same as DeleteApnsVoipChannel with the addition of // the ability to pass a context and additional request options. // -// See DeleteCampaign for details on how to use this API operation. +// See DeleteApnsVoipChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteCampaignWithContext(ctx aws.Context, input *DeleteCampaignInput, opts ...request.Option) (*DeleteCampaignOutput, error) { - req, out := c.DeleteCampaignRequest(input) +func (c *Pinpoint) DeleteApnsVoipChannelWithContext(ctx aws.Context, input *DeleteApnsVoipChannelInput, opts ...request.Option) (*DeleteApnsVoipChannelOutput, error) { + req, out := c.DeleteApnsVoipChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteEmailChannel = "DeleteEmailChannel" +const opDeleteApnsVoipSandboxChannel = "DeleteApnsVoipSandboxChannel" -// DeleteEmailChannelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEmailChannel operation. The "output" return +// DeleteApnsVoipSandboxChannelRequest generates a "aws/request.Request" representing the +// client's request for the DeleteApnsVoipSandboxChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteEmailChannel for more information on using the DeleteEmailChannel +// See DeleteApnsVoipSandboxChannel for more information on using the DeleteApnsVoipSandboxChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteEmailChannelRequest method. -// req, resp := client.DeleteEmailChannelRequest(params) +// // Example sending a request using the DeleteApnsVoipSandboxChannelRequest method. +// req, resp := client.DeleteApnsVoipSandboxChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteEmailChannel -func (c *Pinpoint) DeleteEmailChannelRequest(input *DeleteEmailChannelInput) (req *request.Request, output *DeleteEmailChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsVoipSandboxChannel +func (c *Pinpoint) DeleteApnsVoipSandboxChannelRequest(input *DeleteApnsVoipSandboxChannelInput) (req *request.Request, output *DeleteApnsVoipSandboxChannelOutput) { op := &request.Operation{ - Name: opDeleteEmailChannel, + Name: opDeleteApnsVoipSandboxChannel, HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}/channels/email", + HTTPPath: "/v1/apps/{application-id}/channels/apns_voip_sandbox", } if input == nil { - input = &DeleteEmailChannelInput{} + input = &DeleteApnsVoipSandboxChannelInput{} } - output = &DeleteEmailChannelOutput{} + output = &DeleteApnsVoipSandboxChannelOutput{} req = c.newRequest(op, input, output) return } -// DeleteEmailChannel API operation for Amazon Pinpoint. +// DeleteApnsVoipSandboxChannel API operation for Amazon Pinpoint. // -// Disables the email channel for an application and deletes any existing settings -// for the channel. +// Disables the APNs VoIP sandbox channel for an application and deletes any +// existing settings for the channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation DeleteEmailChannel for usage and error information. +// API operation DeleteApnsVoipSandboxChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteEmailChannel -func (c *Pinpoint) DeleteEmailChannel(input *DeleteEmailChannelInput) (*DeleteEmailChannelOutput, error) { - req, out := c.DeleteEmailChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApnsVoipSandboxChannel +func (c *Pinpoint) DeleteApnsVoipSandboxChannel(input *DeleteApnsVoipSandboxChannelInput) (*DeleteApnsVoipSandboxChannelOutput, error) { + req, out := c.DeleteApnsVoipSandboxChannelRequest(input) return out, req.Send() } -// DeleteEmailChannelWithContext is the same as DeleteEmailChannel with the addition of +// DeleteApnsVoipSandboxChannelWithContext is the same as DeleteApnsVoipSandboxChannel with the addition of // the ability to pass a context and additional request options. // -// See DeleteEmailChannel for details on how to use this API operation. +// See DeleteApnsVoipSandboxChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteEmailChannelWithContext(ctx aws.Context, input *DeleteEmailChannelInput, opts ...request.Option) (*DeleteEmailChannelOutput, error) { - req, out := c.DeleteEmailChannelRequest(input) +func (c *Pinpoint) DeleteApnsVoipSandboxChannelWithContext(ctx aws.Context, input *DeleteApnsVoipSandboxChannelInput, opts ...request.Option) (*DeleteApnsVoipSandboxChannelOutput, error) { + req, out := c.DeleteApnsVoipSandboxChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteEndpoint = "DeleteEndpoint" +const opDeleteApp = "DeleteApp" -// DeleteEndpointRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEndpoint operation. The "output" return +// DeleteAppRequest generates a "aws/request.Request" representing the +// client's request for the DeleteApp operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteEndpoint for more information on using the DeleteEndpoint +// See DeleteApp for more information on using the DeleteApp // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteEndpointRequest method. -// req, resp := client.DeleteEndpointRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteEndpoint -func (c *Pinpoint) DeleteEndpointRequest(input *DeleteEndpointInput) (req *request.Request, output *DeleteEndpointOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApp +func (c *Pinpoint) DeleteAppRequest(input *DeleteAppInput) (req *request.Request, output *DeleteAppOutput) { op := &request.Operation{ - Name: opDeleteEndpoint, + Name: opDeleteApp, HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}/endpoints/{endpoint-id}", + HTTPPath: "/v1/apps/{application-id}", } if input == nil { - input = &DeleteEndpointInput{} + input = &DeleteAppInput{} } - output = &DeleteEndpointOutput{} + output = &DeleteAppOutput{} req = c.newRequest(op, input, output) return } -// DeleteEndpoint API operation for Amazon Pinpoint. +// DeleteApp API operation for Amazon Pinpoint. // -// Deletes an endpoint from an application. +// 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 Amazon Pinpoint's -// API operation DeleteEndpoint for usage and error information. +// API operation DeleteApp for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteEndpoint -func (c *Pinpoint) DeleteEndpoint(input *DeleteEndpointInput) (*DeleteEndpointOutput, error) { - req, out := c.DeleteEndpointRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteApp +func (c *Pinpoint) DeleteApp(input *DeleteAppInput) (*DeleteAppOutput, error) { + req, out := c.DeleteAppRequest(input) return out, req.Send() } -// DeleteEndpointWithContext is the same as DeleteEndpoint with the addition of +// DeleteAppWithContext is the same as DeleteApp with the addition of // the ability to pass a context and additional request options. // -// See DeleteEndpoint for details on how to use this API operation. +// See DeleteApp for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteEndpointWithContext(ctx aws.Context, input *DeleteEndpointInput, opts ...request.Option) (*DeleteEndpointOutput, error) { - req, out := c.DeleteEndpointRequest(input) +func (c *Pinpoint) DeleteAppWithContext(ctx aws.Context, input *DeleteAppInput, opts ...request.Option) (*DeleteAppOutput, error) { + req, out := c.DeleteAppRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteEventStream = "DeleteEventStream" +const opDeleteBaiduChannel = "DeleteBaiduChannel" -// DeleteEventStreamRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEventStream operation. The "output" return +// DeleteBaiduChannelRequest generates a "aws/request.Request" representing the +// client's request for the DeleteBaiduChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteEventStream for more information on using the DeleteEventStream +// See DeleteBaiduChannel for more information on using the DeleteBaiduChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteEventStreamRequest method. -// req, resp := client.DeleteEventStreamRequest(params) +// // Example sending a request using the DeleteBaiduChannelRequest method. +// req, resp := client.DeleteBaiduChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteEventStream -func (c *Pinpoint) DeleteEventStreamRequest(input *DeleteEventStreamInput) (req *request.Request, output *DeleteEventStreamOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteBaiduChannel +func (c *Pinpoint) DeleteBaiduChannelRequest(input *DeleteBaiduChannelInput) (req *request.Request, output *DeleteBaiduChannelOutput) { op := &request.Operation{ - Name: opDeleteEventStream, + Name: opDeleteBaiduChannel, HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}/eventstream", + HTTPPath: "/v1/apps/{application-id}/channels/baidu", } if input == nil { - input = &DeleteEventStreamInput{} + input = &DeleteBaiduChannelInput{} } - output = &DeleteEventStreamOutput{} + output = &DeleteBaiduChannelOutput{} req = c.newRequest(op, input, output) return } -// DeleteEventStream API operation for Amazon Pinpoint. +// DeleteBaiduChannel API operation for Amazon Pinpoint. // -// Deletes the event stream for an application. +// Disables the Baidu channel for an application and deletes any existing settings +// for the channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation DeleteEventStream for usage and error information. +// API operation DeleteBaiduChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteEventStream -func (c *Pinpoint) DeleteEventStream(input *DeleteEventStreamInput) (*DeleteEventStreamOutput, error) { - req, out := c.DeleteEventStreamRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteBaiduChannel +func (c *Pinpoint) DeleteBaiduChannel(input *DeleteBaiduChannelInput) (*DeleteBaiduChannelOutput, error) { + req, out := c.DeleteBaiduChannelRequest(input) return out, req.Send() } -// DeleteEventStreamWithContext is the same as DeleteEventStream with the addition of +// DeleteBaiduChannelWithContext is the same as DeleteBaiduChannel with the addition of // the ability to pass a context and additional request options. // -// See DeleteEventStream for details on how to use this API operation. +// See DeleteBaiduChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteEventStreamWithContext(ctx aws.Context, input *DeleteEventStreamInput, opts ...request.Option) (*DeleteEventStreamOutput, error) { - req, out := c.DeleteEventStreamRequest(input) +func (c *Pinpoint) DeleteBaiduChannelWithContext(ctx aws.Context, input *DeleteBaiduChannelInput, opts ...request.Option) (*DeleteBaiduChannelOutput, error) { + req, out := c.DeleteBaiduChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteGcmChannel = "DeleteGcmChannel" +const opDeleteCampaign = "DeleteCampaign" -// DeleteGcmChannelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteGcmChannel operation. The "output" return +// DeleteCampaignRequest generates a "aws/request.Request" representing the +// client's request for the DeleteCampaign operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteGcmChannel for more information on using the DeleteGcmChannel +// See DeleteCampaign for more information on using the DeleteCampaign // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteGcmChannelRequest method. -// req, resp := client.DeleteGcmChannelRequest(params) +// // Example sending a request using the DeleteCampaignRequest method. +// req, resp := client.DeleteCampaignRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteGcmChannel -func (c *Pinpoint) DeleteGcmChannelRequest(input *DeleteGcmChannelInput) (req *request.Request, output *DeleteGcmChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteCampaign +func (c *Pinpoint) DeleteCampaignRequest(input *DeleteCampaignInput) (req *request.Request, output *DeleteCampaignOutput) { op := &request.Operation{ - Name: opDeleteGcmChannel, + Name: opDeleteCampaign, HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}/channels/gcm", + HTTPPath: "/v1/apps/{application-id}/campaigns/{campaign-id}", } if input == nil { - input = &DeleteGcmChannelInput{} + input = &DeleteCampaignInput{} } - output = &DeleteGcmChannelOutput{} + output = &DeleteCampaignOutput{} req = c.newRequest(op, input, output) return } -// DeleteGcmChannel API operation for Amazon Pinpoint. +// DeleteCampaign API operation for Amazon Pinpoint. // -// Disables the GCM channel for an application and deletes any existing settings -// for the channel. +// Deletes a campaign from 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 Amazon Pinpoint's -// API operation DeleteGcmChannel for usage and error information. +// API operation DeleteCampaign for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteGcmChannel -func (c *Pinpoint) DeleteGcmChannel(input *DeleteGcmChannelInput) (*DeleteGcmChannelOutput, error) { - req, out := c.DeleteGcmChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteCampaign +func (c *Pinpoint) DeleteCampaign(input *DeleteCampaignInput) (*DeleteCampaignOutput, error) { + req, out := c.DeleteCampaignRequest(input) return out, req.Send() } -// DeleteGcmChannelWithContext is the same as DeleteGcmChannel with the addition of +// DeleteCampaignWithContext is the same as DeleteCampaign with the addition of // the ability to pass a context and additional request options. // -// See DeleteGcmChannel for details on how to use this API operation. +// See DeleteCampaign for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteGcmChannelWithContext(ctx aws.Context, input *DeleteGcmChannelInput, opts ...request.Option) (*DeleteGcmChannelOutput, error) { - req, out := c.DeleteGcmChannelRequest(input) +func (c *Pinpoint) DeleteCampaignWithContext(ctx aws.Context, input *DeleteCampaignInput, opts ...request.Option) (*DeleteCampaignOutput, error) { + req, out := c.DeleteCampaignRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteSegment = "DeleteSegment" +const opDeleteEmailChannel = "DeleteEmailChannel" -// DeleteSegmentRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSegment operation. The "output" return +// DeleteEmailChannelRequest generates a "aws/request.Request" representing the +// client's request for the DeleteEmailChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteSegment for more information on using the DeleteSegment +// See DeleteEmailChannel for more information on using the DeleteEmailChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteSegmentRequest method. -// req, resp := client.DeleteSegmentRequest(params) +// // Example sending a request using the DeleteEmailChannelRequest method. +// req, resp := client.DeleteEmailChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteSegment -func (c *Pinpoint) DeleteSegmentRequest(input *DeleteSegmentInput) (req *request.Request, output *DeleteSegmentOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteEmailChannel +func (c *Pinpoint) DeleteEmailChannelRequest(input *DeleteEmailChannelInput) (req *request.Request, output *DeleteEmailChannelOutput) { op := &request.Operation{ - Name: opDeleteSegment, + Name: opDeleteEmailChannel, HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}/segments/{segment-id}", + HTTPPath: "/v1/apps/{application-id}/channels/email", } if input == nil { - input = &DeleteSegmentInput{} + input = &DeleteEmailChannelInput{} } - output = &DeleteSegmentOutput{} + output = &DeleteEmailChannelOutput{} req = c.newRequest(op, input, output) return } -// DeleteSegment API operation for Amazon Pinpoint. +// DeleteEmailChannel API operation for Amazon Pinpoint. // -// Deletes a segment from an application. +// Disables the email channel for an application and deletes any existing settings +// for the channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation DeleteSegment for usage and error information. +// API operation DeleteEmailChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteSegment -func (c *Pinpoint) DeleteSegment(input *DeleteSegmentInput) (*DeleteSegmentOutput, error) { - req, out := c.DeleteSegmentRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteEmailChannel +func (c *Pinpoint) DeleteEmailChannel(input *DeleteEmailChannelInput) (*DeleteEmailChannelOutput, error) { + req, out := c.DeleteEmailChannelRequest(input) return out, req.Send() } -// DeleteSegmentWithContext is the same as DeleteSegment with the addition of +// DeleteEmailChannelWithContext is the same as DeleteEmailChannel with the addition of // the ability to pass a context and additional request options. // -// See DeleteSegment for details on how to use this API operation. +// See DeleteEmailChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteSegmentWithContext(ctx aws.Context, input *DeleteSegmentInput, opts ...request.Option) (*DeleteSegmentOutput, error) { - req, out := c.DeleteSegmentRequest(input) +func (c *Pinpoint) DeleteEmailChannelWithContext(ctx aws.Context, input *DeleteEmailChannelInput, opts ...request.Option) (*DeleteEmailChannelOutput, error) { + req, out := c.DeleteEmailChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteSmsChannel = "DeleteSmsChannel" +const opDeleteEmailTemplate = "DeleteEmailTemplate" -// DeleteSmsChannelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteSmsChannel operation. The "output" return +// DeleteEmailTemplateRequest generates a "aws/request.Request" representing the +// client's request for the DeleteEmailTemplate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteSmsChannel for more information on using the DeleteSmsChannel +// See DeleteEmailTemplate for more information on using the DeleteEmailTemplate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteSmsChannelRequest method. -// req, resp := client.DeleteSmsChannelRequest(params) +// // Example sending a request using the DeleteEmailTemplateRequest method. +// req, resp := client.DeleteEmailTemplateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteSmsChannel -func (c *Pinpoint) DeleteSmsChannelRequest(input *DeleteSmsChannelInput) (req *request.Request, output *DeleteSmsChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteEmailTemplate +func (c *Pinpoint) DeleteEmailTemplateRequest(input *DeleteEmailTemplateInput) (req *request.Request, output *DeleteEmailTemplateOutput) { op := &request.Operation{ - Name: opDeleteSmsChannel, + Name: opDeleteEmailTemplate, HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}/channels/sms", + HTTPPath: "/v1/templates/{template-name}/email", } if input == nil { - input = &DeleteSmsChannelInput{} + input = &DeleteEmailTemplateInput{} } - output = &DeleteSmsChannelOutput{} + output = &DeleteEmailTemplateOutput{} req = c.newRequest(op, input, output) return } -// DeleteSmsChannel API operation for Amazon Pinpoint. +// DeleteEmailTemplate API operation for Amazon Pinpoint. // -// Disables the SMS channel for an application and deletes any existing settings -// for the channel. +// Deletes a message template for messages that were sent through the email +// channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation DeleteSmsChannel for usage and error information. +// API operation DeleteEmailTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteSmsChannel -func (c *Pinpoint) DeleteSmsChannel(input *DeleteSmsChannelInput) (*DeleteSmsChannelOutput, error) { - req, out := c.DeleteSmsChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteEmailTemplate +func (c *Pinpoint) DeleteEmailTemplate(input *DeleteEmailTemplateInput) (*DeleteEmailTemplateOutput, error) { + req, out := c.DeleteEmailTemplateRequest(input) return out, req.Send() } -// DeleteSmsChannelWithContext is the same as DeleteSmsChannel with the addition of +// DeleteEmailTemplateWithContext is the same as DeleteEmailTemplate with the addition of // the ability to pass a context and additional request options. // -// See DeleteSmsChannel for details on how to use this API operation. +// See DeleteEmailTemplate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteSmsChannelWithContext(ctx aws.Context, input *DeleteSmsChannelInput, opts ...request.Option) (*DeleteSmsChannelOutput, error) { - req, out := c.DeleteSmsChannelRequest(input) +func (c *Pinpoint) DeleteEmailTemplateWithContext(ctx aws.Context, input *DeleteEmailTemplateInput, opts ...request.Option) (*DeleteEmailTemplateOutput, error) { + req, out := c.DeleteEmailTemplateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteUserEndpoints = "DeleteUserEndpoints" +const opDeleteEndpoint = "DeleteEndpoint" -// DeleteUserEndpointsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteUserEndpoints operation. The "output" return +// DeleteEndpointRequest generates a "aws/request.Request" representing the +// client's request for the DeleteEndpoint operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteUserEndpoints for more information on using the DeleteUserEndpoints +// See DeleteEndpoint for more information on using the DeleteEndpoint // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteUserEndpointsRequest method. -// req, resp := client.DeleteUserEndpointsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteUserEndpoints -func (c *Pinpoint) DeleteUserEndpointsRequest(input *DeleteUserEndpointsInput) (req *request.Request, output *DeleteUserEndpointsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteEndpoint +func (c *Pinpoint) DeleteEndpointRequest(input *DeleteEndpointInput) (req *request.Request, output *DeleteEndpointOutput) { op := &request.Operation{ - Name: opDeleteUserEndpoints, + Name: opDeleteEndpoint, HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}/users/{user-id}", + HTTPPath: "/v1/apps/{application-id}/endpoints/{endpoint-id}", } if input == nil { - input = &DeleteUserEndpointsInput{} + input = &DeleteEndpointInput{} } - output = &DeleteUserEndpointsOutput{} + output = &DeleteEndpointOutput{} req = c.newRequest(op, input, output) return } -// DeleteUserEndpoints API operation for Amazon Pinpoint. +// DeleteEndpoint API operation for Amazon Pinpoint. // -// Deletes all the endpoints that are associated with a specific user ID. +// Deletes an endpoint from 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 Amazon Pinpoint's -// API operation DeleteUserEndpoints for usage and error information. +// API operation DeleteEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteUserEndpoints -func (c *Pinpoint) DeleteUserEndpoints(input *DeleteUserEndpointsInput) (*DeleteUserEndpointsOutput, error) { - req, out := c.DeleteUserEndpointsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteEndpoint +func (c *Pinpoint) DeleteEndpoint(input *DeleteEndpointInput) (*DeleteEndpointOutput, error) { + req, out := c.DeleteEndpointRequest(input) return out, req.Send() } -// DeleteUserEndpointsWithContext is the same as DeleteUserEndpoints with the addition of +// DeleteEndpointWithContext is the same as DeleteEndpoint with the addition of // the ability to pass a context and additional request options. // -// See DeleteUserEndpoints for details on how to use this API operation. +// See DeleteEndpoint for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteUserEndpointsWithContext(ctx aws.Context, input *DeleteUserEndpointsInput, opts ...request.Option) (*DeleteUserEndpointsOutput, error) { - req, out := c.DeleteUserEndpointsRequest(input) +func (c *Pinpoint) DeleteEndpointWithContext(ctx aws.Context, input *DeleteEndpointInput, opts ...request.Option) (*DeleteEndpointOutput, error) { + req, out := c.DeleteEndpointRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteVoiceChannel = "DeleteVoiceChannel" +const opDeleteEventStream = "DeleteEventStream" -// DeleteVoiceChannelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteVoiceChannel operation. The "output" return +// DeleteEventStreamRequest generates a "aws/request.Request" representing the +// client's request for the DeleteEventStream operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteVoiceChannel for more information on using the DeleteVoiceChannel +// See DeleteEventStream for more information on using the DeleteEventStream // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteVoiceChannelRequest method. -// req, resp := client.DeleteVoiceChannelRequest(params) +// // Example sending a request using the DeleteEventStreamRequest method. +// req, resp := client.DeleteEventStreamRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteVoiceChannel -func (c *Pinpoint) DeleteVoiceChannelRequest(input *DeleteVoiceChannelInput) (req *request.Request, output *DeleteVoiceChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteEventStream +func (c *Pinpoint) DeleteEventStreamRequest(input *DeleteEventStreamInput) (req *request.Request, output *DeleteEventStreamOutput) { op := &request.Operation{ - Name: opDeleteVoiceChannel, + Name: opDeleteEventStream, HTTPMethod: "DELETE", - HTTPPath: "/v1/apps/{application-id}/channels/voice", + HTTPPath: "/v1/apps/{application-id}/eventstream", } if input == nil { - input = &DeleteVoiceChannelInput{} + input = &DeleteEventStreamInput{} } - output = &DeleteVoiceChannelOutput{} + output = &DeleteEventStreamOutput{} req = c.newRequest(op, input, output) return } -// DeleteVoiceChannel API operation for Amazon Pinpoint. +// DeleteEventStream API operation for Amazon Pinpoint. // -// Disables the voice channel for an application and deletes any existing settings -// for the channel. +// Deletes the event stream 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 Amazon Pinpoint's -// API operation DeleteVoiceChannel for usage and error information. +// API operation DeleteEventStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteVoiceChannel -func (c *Pinpoint) DeleteVoiceChannel(input *DeleteVoiceChannelInput) (*DeleteVoiceChannelOutput, error) { - req, out := c.DeleteVoiceChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteEventStream +func (c *Pinpoint) DeleteEventStream(input *DeleteEventStreamInput) (*DeleteEventStreamOutput, error) { + req, out := c.DeleteEventStreamRequest(input) return out, req.Send() } -// DeleteVoiceChannelWithContext is the same as DeleteVoiceChannel with the addition of +// DeleteEventStreamWithContext is the same as DeleteEventStream with the addition of // the ability to pass a context and additional request options. // -// See DeleteVoiceChannel for details on how to use this API operation. +// See DeleteEventStream for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) DeleteVoiceChannelWithContext(ctx aws.Context, input *DeleteVoiceChannelInput, opts ...request.Option) (*DeleteVoiceChannelOutput, error) { - req, out := c.DeleteVoiceChannelRequest(input) +func (c *Pinpoint) DeleteEventStreamWithContext(ctx aws.Context, input *DeleteEventStreamInput, opts ...request.Option) (*DeleteEventStreamOutput, error) { + req, out := c.DeleteEventStreamRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetAdmChannel = "GetAdmChannel" +const opDeleteGcmChannel = "DeleteGcmChannel" -// GetAdmChannelRequest generates a "aws/request.Request" representing the -// client's request for the GetAdmChannel operation. The "output" return +// DeleteGcmChannelRequest generates a "aws/request.Request" representing the +// client's request for the DeleteGcmChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetAdmChannel for more information on using the GetAdmChannel +// See DeleteGcmChannel for more information on using the DeleteGcmChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetAdmChannelRequest method. -// req, resp := client.GetAdmChannelRequest(params) +// // Example sending a request using the DeleteGcmChannelRequest method. +// req, resp := client.DeleteGcmChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetAdmChannel -func (c *Pinpoint) GetAdmChannelRequest(input *GetAdmChannelInput) (req *request.Request, output *GetAdmChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteGcmChannel +func (c *Pinpoint) DeleteGcmChannelRequest(input *DeleteGcmChannelInput) (req *request.Request, output *DeleteGcmChannelOutput) { op := &request.Operation{ - Name: opGetAdmChannel, - HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/channels/adm", + Name: opDeleteGcmChannel, + HTTPMethod: "DELETE", + HTTPPath: "/v1/apps/{application-id}/channels/gcm", } if input == nil { - input = &GetAdmChannelInput{} + input = &DeleteGcmChannelInput{} } - output = &GetAdmChannelOutput{} + output = &DeleteGcmChannelOutput{} req = c.newRequest(op, input, output) return } -// GetAdmChannel API operation for Amazon Pinpoint. +// DeleteGcmChannel API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of the ADM channel for -// an application. +// Disables the GCM channel for an application and deletes any existing settings +// for the channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation GetAdmChannel for usage and error information. +// API operation DeleteGcmChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetAdmChannel -func (c *Pinpoint) GetAdmChannel(input *GetAdmChannelInput) (*GetAdmChannelOutput, error) { - req, out := c.GetAdmChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteGcmChannel +func (c *Pinpoint) DeleteGcmChannel(input *DeleteGcmChannelInput) (*DeleteGcmChannelOutput, error) { + req, out := c.DeleteGcmChannelRequest(input) return out, req.Send() } -// GetAdmChannelWithContext is the same as GetAdmChannel with the addition of +// DeleteGcmChannelWithContext is the same as DeleteGcmChannel with the addition of // the ability to pass a context and additional request options. // -// See GetAdmChannel for details on how to use this API operation. +// See DeleteGcmChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetAdmChannelWithContext(ctx aws.Context, input *GetAdmChannelInput, opts ...request.Option) (*GetAdmChannelOutput, error) { - req, out := c.GetAdmChannelRequest(input) +func (c *Pinpoint) DeleteGcmChannelWithContext(ctx aws.Context, input *DeleteGcmChannelInput, opts ...request.Option) (*DeleteGcmChannelOutput, error) { + req, out := c.DeleteGcmChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetApnsChannel = "GetApnsChannel" +const opDeleteJourney = "DeleteJourney" -// GetApnsChannelRequest generates a "aws/request.Request" representing the -// client's request for the GetApnsChannel operation. The "output" return +// DeleteJourneyRequest generates a "aws/request.Request" representing the +// client's request for the DeleteJourney operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetApnsChannel for more information on using the GetApnsChannel +// See DeleteJourney for more information on using the DeleteJourney // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetApnsChannelRequest method. -// req, resp := client.GetApnsChannelRequest(params) +// // Example sending a request using the DeleteJourneyRequest method. +// req, resp := client.DeleteJourneyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsChannel -func (c *Pinpoint) GetApnsChannelRequest(input *GetApnsChannelInput) (req *request.Request, output *GetApnsChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteJourney +func (c *Pinpoint) DeleteJourneyRequest(input *DeleteJourneyInput) (req *request.Request, output *DeleteJourneyOutput) { op := &request.Operation{ - Name: opGetApnsChannel, - HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/channels/apns", + Name: opDeleteJourney, + HTTPMethod: "DELETE", + HTTPPath: "/v1/apps/{application-id}/journeys/{journey-id}", } if input == nil { - input = &GetApnsChannelInput{} + input = &DeleteJourneyInput{} } - output = &GetApnsChannelOutput{} + output = &DeleteJourneyOutput{} req = c.newRequest(op, input, output) return } -// GetApnsChannel API operation for Amazon Pinpoint. +// DeleteJourney API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of the APNs channel for -// an application. +// Deletes a journey from 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 Amazon Pinpoint's -// API operation GetApnsChannel for usage and error information. +// API operation DeleteJourney for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsChannel -func (c *Pinpoint) GetApnsChannel(input *GetApnsChannelInput) (*GetApnsChannelOutput, error) { - req, out := c.GetApnsChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteJourney +func (c *Pinpoint) DeleteJourney(input *DeleteJourneyInput) (*DeleteJourneyOutput, error) { + req, out := c.DeleteJourneyRequest(input) return out, req.Send() } -// GetApnsChannelWithContext is the same as GetApnsChannel with the addition of +// DeleteJourneyWithContext is the same as DeleteJourney with the addition of // the ability to pass a context and additional request options. // -// See GetApnsChannel for details on how to use this API operation. +// See DeleteJourney for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetApnsChannelWithContext(ctx aws.Context, input *GetApnsChannelInput, opts ...request.Option) (*GetApnsChannelOutput, error) { - req, out := c.GetApnsChannelRequest(input) +func (c *Pinpoint) DeleteJourneyWithContext(ctx aws.Context, input *DeleteJourneyInput, opts ...request.Option) (*DeleteJourneyOutput, error) { + req, out := c.DeleteJourneyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetApnsSandboxChannel = "GetApnsSandboxChannel" +const opDeletePushTemplate = "DeletePushTemplate" -// GetApnsSandboxChannelRequest generates a "aws/request.Request" representing the -// client's request for the GetApnsSandboxChannel operation. The "output" return +// DeletePushTemplateRequest generates a "aws/request.Request" representing the +// client's request for the DeletePushTemplate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetApnsSandboxChannel for more information on using the GetApnsSandboxChannel +// See DeletePushTemplate for more information on using the DeletePushTemplate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetApnsSandboxChannelRequest method. -// req, resp := client.GetApnsSandboxChannelRequest(params) +// // Example sending a request using the DeletePushTemplateRequest method. +// req, resp := client.DeletePushTemplateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsSandboxChannel -func (c *Pinpoint) GetApnsSandboxChannelRequest(input *GetApnsSandboxChannelInput) (req *request.Request, output *GetApnsSandboxChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeletePushTemplate +func (c *Pinpoint) DeletePushTemplateRequest(input *DeletePushTemplateInput) (req *request.Request, output *DeletePushTemplateOutput) { op := &request.Operation{ - Name: opGetApnsSandboxChannel, - HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/channels/apns_sandbox", + Name: opDeletePushTemplate, + HTTPMethod: "DELETE", + HTTPPath: "/v1/templates/{template-name}/push", } if input == nil { - input = &GetApnsSandboxChannelInput{} + input = &DeletePushTemplateInput{} } - output = &GetApnsSandboxChannelOutput{} + output = &DeletePushTemplateOutput{} req = c.newRequest(op, input, output) return } -// GetApnsSandboxChannel API operation for Amazon Pinpoint. +// DeletePushTemplate API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of the APNs sandbox channel -// for an application. +// Deletes a message template for messages that were sent through a push notification +// channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation GetApnsSandboxChannel for usage and error information. +// API operation DeletePushTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsSandboxChannel -func (c *Pinpoint) GetApnsSandboxChannel(input *GetApnsSandboxChannelInput) (*GetApnsSandboxChannelOutput, error) { - req, out := c.GetApnsSandboxChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeletePushTemplate +func (c *Pinpoint) DeletePushTemplate(input *DeletePushTemplateInput) (*DeletePushTemplateOutput, error) { + req, out := c.DeletePushTemplateRequest(input) return out, req.Send() } -// GetApnsSandboxChannelWithContext is the same as GetApnsSandboxChannel with the addition of +// DeletePushTemplateWithContext is the same as DeletePushTemplate with the addition of // the ability to pass a context and additional request options. // -// See GetApnsSandboxChannel for details on how to use this API operation. +// See DeletePushTemplate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetApnsSandboxChannelWithContext(ctx aws.Context, input *GetApnsSandboxChannelInput, opts ...request.Option) (*GetApnsSandboxChannelOutput, error) { - req, out := c.GetApnsSandboxChannelRequest(input) +func (c *Pinpoint) DeletePushTemplateWithContext(ctx aws.Context, input *DeletePushTemplateInput, opts ...request.Option) (*DeletePushTemplateOutput, error) { + req, out := c.DeletePushTemplateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetApnsVoipChannel = "GetApnsVoipChannel" +const opDeleteSegment = "DeleteSegment" -// GetApnsVoipChannelRequest generates a "aws/request.Request" representing the -// client's request for the GetApnsVoipChannel operation. The "output" return +// DeleteSegmentRequest generates a "aws/request.Request" representing the +// client's request for the DeleteSegment operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetApnsVoipChannel for more information on using the GetApnsVoipChannel +// See DeleteSegment for more information on using the DeleteSegment // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetApnsVoipChannelRequest method. -// req, resp := client.GetApnsVoipChannelRequest(params) +// // Example sending a request using the DeleteSegmentRequest method. +// req, resp := client.DeleteSegmentRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsVoipChannel -func (c *Pinpoint) GetApnsVoipChannelRequest(input *GetApnsVoipChannelInput) (req *request.Request, output *GetApnsVoipChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteSegment +func (c *Pinpoint) DeleteSegmentRequest(input *DeleteSegmentInput) (req *request.Request, output *DeleteSegmentOutput) { op := &request.Operation{ - Name: opGetApnsVoipChannel, - HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/channels/apns_voip", + Name: opDeleteSegment, + HTTPMethod: "DELETE", + HTTPPath: "/v1/apps/{application-id}/segments/{segment-id}", } if input == nil { - input = &GetApnsVoipChannelInput{} + input = &DeleteSegmentInput{} } - output = &GetApnsVoipChannelOutput{} + output = &DeleteSegmentOutput{} req = c.newRequest(op, input, output) return } -// GetApnsVoipChannel API operation for Amazon Pinpoint. +// DeleteSegment API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of the APNs VoIP channel -// for an application. +// Deletes a segment from 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 Amazon Pinpoint's -// API operation GetApnsVoipChannel for usage and error information. +// API operation DeleteSegment for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsVoipChannel -func (c *Pinpoint) GetApnsVoipChannel(input *GetApnsVoipChannelInput) (*GetApnsVoipChannelOutput, error) { - req, out := c.GetApnsVoipChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteSegment +func (c *Pinpoint) DeleteSegment(input *DeleteSegmentInput) (*DeleteSegmentOutput, error) { + req, out := c.DeleteSegmentRequest(input) return out, req.Send() } -// GetApnsVoipChannelWithContext is the same as GetApnsVoipChannel with the addition of +// DeleteSegmentWithContext is the same as DeleteSegment with the addition of // the ability to pass a context and additional request options. // -// See GetApnsVoipChannel for details on how to use this API operation. +// See DeleteSegment for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetApnsVoipChannelWithContext(ctx aws.Context, input *GetApnsVoipChannelInput, opts ...request.Option) (*GetApnsVoipChannelOutput, error) { - req, out := c.GetApnsVoipChannelRequest(input) +func (c *Pinpoint) DeleteSegmentWithContext(ctx aws.Context, input *DeleteSegmentInput, opts ...request.Option) (*DeleteSegmentOutput, error) { + req, out := c.DeleteSegmentRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetApnsVoipSandboxChannel = "GetApnsVoipSandboxChannel" +const opDeleteSmsChannel = "DeleteSmsChannel" -// GetApnsVoipSandboxChannelRequest generates a "aws/request.Request" representing the -// client's request for the GetApnsVoipSandboxChannel operation. The "output" return +// DeleteSmsChannelRequest generates a "aws/request.Request" representing the +// client's request for the DeleteSmsChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetApnsVoipSandboxChannel for more information on using the GetApnsVoipSandboxChannel +// See DeleteSmsChannel for more information on using the DeleteSmsChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetApnsVoipSandboxChannelRequest method. -// req, resp := client.GetApnsVoipSandboxChannelRequest(params) +// // Example sending a request using the DeleteSmsChannelRequest method. +// req, resp := client.DeleteSmsChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsVoipSandboxChannel -func (c *Pinpoint) GetApnsVoipSandboxChannelRequest(input *GetApnsVoipSandboxChannelInput) (req *request.Request, output *GetApnsVoipSandboxChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteSmsChannel +func (c *Pinpoint) DeleteSmsChannelRequest(input *DeleteSmsChannelInput) (req *request.Request, output *DeleteSmsChannelOutput) { op := &request.Operation{ - Name: opGetApnsVoipSandboxChannel, - HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/channels/apns_voip_sandbox", + Name: opDeleteSmsChannel, + HTTPMethod: "DELETE", + HTTPPath: "/v1/apps/{application-id}/channels/sms", } if input == nil { - input = &GetApnsVoipSandboxChannelInput{} + input = &DeleteSmsChannelInput{} } - output = &GetApnsVoipSandboxChannelOutput{} + output = &DeleteSmsChannelOutput{} req = c.newRequest(op, input, output) return } -// GetApnsVoipSandboxChannel API operation for Amazon Pinpoint. +// DeleteSmsChannel API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of the APNs VoIP sandbox -// channel for an application. +// Disables the SMS channel for an application and deletes any existing settings +// for the channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation GetApnsVoipSandboxChannel for usage and error information. +// API operation DeleteSmsChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsVoipSandboxChannel -func (c *Pinpoint) GetApnsVoipSandboxChannel(input *GetApnsVoipSandboxChannelInput) (*GetApnsVoipSandboxChannelOutput, error) { - req, out := c.GetApnsVoipSandboxChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteSmsChannel +func (c *Pinpoint) DeleteSmsChannel(input *DeleteSmsChannelInput) (*DeleteSmsChannelOutput, error) { + req, out := c.DeleteSmsChannelRequest(input) return out, req.Send() } -// GetApnsVoipSandboxChannelWithContext is the same as GetApnsVoipSandboxChannel with the addition of +// DeleteSmsChannelWithContext is the same as DeleteSmsChannel with the addition of // the ability to pass a context and additional request options. // -// See GetApnsVoipSandboxChannel for details on how to use this API operation. +// See DeleteSmsChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetApnsVoipSandboxChannelWithContext(ctx aws.Context, input *GetApnsVoipSandboxChannelInput, opts ...request.Option) (*GetApnsVoipSandboxChannelOutput, error) { - req, out := c.GetApnsVoipSandboxChannelRequest(input) +func (c *Pinpoint) DeleteSmsChannelWithContext(ctx aws.Context, input *DeleteSmsChannelInput, opts ...request.Option) (*DeleteSmsChannelOutput, error) { + req, out := c.DeleteSmsChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetApp = "GetApp" +const opDeleteSmsTemplate = "DeleteSmsTemplate" -// GetAppRequest generates a "aws/request.Request" representing the -// client's request for the GetApp operation. The "output" return +// DeleteSmsTemplateRequest generates a "aws/request.Request" representing the +// client's request for the DeleteSmsTemplate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetApp for more information on using the GetApp +// See DeleteSmsTemplate for more information on using the DeleteSmsTemplate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetAppRequest method. -// req, resp := client.GetAppRequest(params) +// // Example sending a request using the DeleteSmsTemplateRequest method. +// req, resp := client.DeleteSmsTemplateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApp -func (c *Pinpoint) GetAppRequest(input *GetAppInput) (req *request.Request, output *GetAppOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteSmsTemplate +func (c *Pinpoint) DeleteSmsTemplateRequest(input *DeleteSmsTemplateInput) (req *request.Request, output *DeleteSmsTemplateOutput) { op := &request.Operation{ - Name: opGetApp, - HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}", + Name: opDeleteSmsTemplate, + HTTPMethod: "DELETE", + HTTPPath: "/v1/templates/{template-name}/sms", } if input == nil { - input = &GetAppInput{} + input = &DeleteSmsTemplateInput{} } - output = &GetAppOutput{} + output = &DeleteSmsTemplateOutput{} req = c.newRequest(op, input, output) return } -// GetApp API operation for Amazon Pinpoint. +// DeleteSmsTemplate API operation for Amazon Pinpoint. // -// Retrieves information about an application. +// Deletes a message template for messages that were sent through the SMS channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation GetApp for usage and error information. +// API operation DeleteSmsTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApp -func (c *Pinpoint) GetApp(input *GetAppInput) (*GetAppOutput, error) { - req, out := c.GetAppRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteSmsTemplate +func (c *Pinpoint) DeleteSmsTemplate(input *DeleteSmsTemplateInput) (*DeleteSmsTemplateOutput, error) { + req, out := c.DeleteSmsTemplateRequest(input) return out, req.Send() } -// GetAppWithContext is the same as GetApp with the addition of +// DeleteSmsTemplateWithContext is the same as DeleteSmsTemplate with the addition of // the ability to pass a context and additional request options. // -// See GetApp for details on how to use this API operation. +// See DeleteSmsTemplate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetAppWithContext(ctx aws.Context, input *GetAppInput, opts ...request.Option) (*GetAppOutput, error) { - req, out := c.GetAppRequest(input) +func (c *Pinpoint) DeleteSmsTemplateWithContext(ctx aws.Context, input *DeleteSmsTemplateInput, opts ...request.Option) (*DeleteSmsTemplateOutput, error) { + req, out := c.DeleteSmsTemplateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetApplicationDateRangeKpi = "GetApplicationDateRangeKpi" +const opDeleteUserEndpoints = "DeleteUserEndpoints" -// GetApplicationDateRangeKpiRequest generates a "aws/request.Request" representing the -// client's request for the GetApplicationDateRangeKpi operation. The "output" return +// DeleteUserEndpointsRequest generates a "aws/request.Request" representing the +// client's request for the DeleteUserEndpoints operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetApplicationDateRangeKpi for more information on using the GetApplicationDateRangeKpi +// See DeleteUserEndpoints for more information on using the DeleteUserEndpoints // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetApplicationDateRangeKpiRequest method. -// req, resp := client.GetApplicationDateRangeKpiRequest(params) +// // Example sending a request using the DeleteUserEndpointsRequest method. +// req, resp := client.DeleteUserEndpointsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApplicationDateRangeKpi -func (c *Pinpoint) GetApplicationDateRangeKpiRequest(input *GetApplicationDateRangeKpiInput) (req *request.Request, output *GetApplicationDateRangeKpiOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteUserEndpoints +func (c *Pinpoint) DeleteUserEndpointsRequest(input *DeleteUserEndpointsInput) (req *request.Request, output *DeleteUserEndpointsOutput) { op := &request.Operation{ - Name: opGetApplicationDateRangeKpi, - HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/kpis/daterange/{kpi-name}", + Name: opDeleteUserEndpoints, + HTTPMethod: "DELETE", + HTTPPath: "/v1/apps/{application-id}/users/{user-id}", } if input == nil { - input = &GetApplicationDateRangeKpiInput{} + input = &DeleteUserEndpointsInput{} } - output = &GetApplicationDateRangeKpiOutput{} + output = &DeleteUserEndpointsOutput{} req = c.newRequest(op, input, output) return } -// GetApplicationDateRangeKpi API operation for Amazon Pinpoint. +// DeleteUserEndpoints API operation for Amazon Pinpoint. // -// Retrieves (queries) pre-aggregated data for a standard metric that applies -// to an application. +// Deletes all the endpoints that are associated with a specific user 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 Pinpoint's -// API operation GetApplicationDateRangeKpi for usage and error information. +// API operation DeleteUserEndpoints for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApplicationDateRangeKpi -func (c *Pinpoint) GetApplicationDateRangeKpi(input *GetApplicationDateRangeKpiInput) (*GetApplicationDateRangeKpiOutput, error) { - req, out := c.GetApplicationDateRangeKpiRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteUserEndpoints +func (c *Pinpoint) DeleteUserEndpoints(input *DeleteUserEndpointsInput) (*DeleteUserEndpointsOutput, error) { + req, out := c.DeleteUserEndpointsRequest(input) return out, req.Send() } -// GetApplicationDateRangeKpiWithContext is the same as GetApplicationDateRangeKpi with the addition of +// DeleteUserEndpointsWithContext is the same as DeleteUserEndpoints with the addition of // the ability to pass a context and additional request options. // -// See GetApplicationDateRangeKpi for details on how to use this API operation. +// See DeleteUserEndpoints for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetApplicationDateRangeKpiWithContext(ctx aws.Context, input *GetApplicationDateRangeKpiInput, opts ...request.Option) (*GetApplicationDateRangeKpiOutput, error) { - req, out := c.GetApplicationDateRangeKpiRequest(input) +func (c *Pinpoint) DeleteUserEndpointsWithContext(ctx aws.Context, input *DeleteUserEndpointsInput, opts ...request.Option) (*DeleteUserEndpointsOutput, error) { + req, out := c.DeleteUserEndpointsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetApplicationSettings = "GetApplicationSettings" +const opDeleteVoiceChannel = "DeleteVoiceChannel" -// GetApplicationSettingsRequest generates a "aws/request.Request" representing the -// client's request for the GetApplicationSettings operation. The "output" return +// DeleteVoiceChannelRequest generates a "aws/request.Request" representing the +// client's request for the DeleteVoiceChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetApplicationSettings for more information on using the GetApplicationSettings +// See DeleteVoiceChannel for more information on using the DeleteVoiceChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetApplicationSettingsRequest method. -// req, resp := client.GetApplicationSettingsRequest(params) +// // Example sending a request using the DeleteVoiceChannelRequest method. +// req, resp := client.DeleteVoiceChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApplicationSettings -func (c *Pinpoint) GetApplicationSettingsRequest(input *GetApplicationSettingsInput) (req *request.Request, output *GetApplicationSettingsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteVoiceChannel +func (c *Pinpoint) DeleteVoiceChannelRequest(input *DeleteVoiceChannelInput) (req *request.Request, output *DeleteVoiceChannelOutput) { op := &request.Operation{ - Name: opGetApplicationSettings, - HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/settings", + Name: opDeleteVoiceChannel, + HTTPMethod: "DELETE", + HTTPPath: "/v1/apps/{application-id}/channels/voice", } if input == nil { - input = &GetApplicationSettingsInput{} + input = &DeleteVoiceChannelInput{} } - output = &GetApplicationSettingsOutput{} + output = &DeleteVoiceChannelOutput{} req = c.newRequest(op, input, output) return } -// GetApplicationSettings API operation for Amazon Pinpoint. +// DeleteVoiceChannel API operation for Amazon Pinpoint. // -// Retrieves information about the settings for an application. +// Disables the voice channel for an application and deletes any existing settings +// for the channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation GetApplicationSettings for usage and error information. +// API operation DeleteVoiceChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApplicationSettings -func (c *Pinpoint) GetApplicationSettings(input *GetApplicationSettingsInput) (*GetApplicationSettingsOutput, error) { - req, out := c.GetApplicationSettingsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteVoiceChannel +func (c *Pinpoint) DeleteVoiceChannel(input *DeleteVoiceChannelInput) (*DeleteVoiceChannelOutput, error) { + req, out := c.DeleteVoiceChannelRequest(input) return out, req.Send() } -// GetApplicationSettingsWithContext is the same as GetApplicationSettings with the addition of +// DeleteVoiceChannelWithContext is the same as DeleteVoiceChannel with the addition of // the ability to pass a context and additional request options. // -// See GetApplicationSettings for details on how to use this API operation. +// See DeleteVoiceChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetApplicationSettingsWithContext(ctx aws.Context, input *GetApplicationSettingsInput, opts ...request.Option) (*GetApplicationSettingsOutput, error) { - req, out := c.GetApplicationSettingsRequest(input) +func (c *Pinpoint) DeleteVoiceChannelWithContext(ctx aws.Context, input *DeleteVoiceChannelInput, opts ...request.Option) (*DeleteVoiceChannelOutput, error) { + req, out := c.DeleteVoiceChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetApps = "GetApps" +const opDeleteVoiceTemplate = "DeleteVoiceTemplate" -// GetAppsRequest generates a "aws/request.Request" representing the -// client's request for the GetApps operation. The "output" return +// DeleteVoiceTemplateRequest generates a "aws/request.Request" representing the +// client's request for the DeleteVoiceTemplate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetApps for more information on using the GetApps +// See DeleteVoiceTemplate for more information on using the DeleteVoiceTemplate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetAppsRequest method. -// req, resp := client.GetAppsRequest(params) +// // Example sending a request using the DeleteVoiceTemplateRequest method. +// req, resp := client.DeleteVoiceTemplateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApps -func (c *Pinpoint) GetAppsRequest(input *GetAppsInput) (req *request.Request, output *GetAppsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteVoiceTemplate +func (c *Pinpoint) DeleteVoiceTemplateRequest(input *DeleteVoiceTemplateInput) (req *request.Request, output *DeleteVoiceTemplateOutput) { op := &request.Operation{ - Name: opGetApps, - HTTPMethod: "GET", - HTTPPath: "/v1/apps", + Name: opDeleteVoiceTemplate, + HTTPMethod: "DELETE", + HTTPPath: "/v1/templates/{template-name}/voice", } if input == nil { - input = &GetAppsInput{} + input = &DeleteVoiceTemplateInput{} } - output = &GetAppsOutput{} + output = &DeleteVoiceTemplateOutput{} req = c.newRequest(op, input, output) return } -// GetApps API operation for Amazon Pinpoint. +// DeleteVoiceTemplate API operation for Amazon Pinpoint. // -// Retrieves information about all of your applications. +// Deletes a message template for messages that were sent through the voice +// channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation GetApps for usage and error information. +// API operation DeleteVoiceTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApps -func (c *Pinpoint) GetApps(input *GetAppsInput) (*GetAppsOutput, error) { - req, out := c.GetAppsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/DeleteVoiceTemplate +func (c *Pinpoint) DeleteVoiceTemplate(input *DeleteVoiceTemplateInput) (*DeleteVoiceTemplateOutput, error) { + req, out := c.DeleteVoiceTemplateRequest(input) return out, req.Send() } -// GetAppsWithContext is the same as GetApps with the addition of +// DeleteVoiceTemplateWithContext is the same as DeleteVoiceTemplate with the addition of // the ability to pass a context and additional request options. // -// See GetApps for details on how to use this API operation. +// See DeleteVoiceTemplate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetAppsWithContext(ctx aws.Context, input *GetAppsInput, opts ...request.Option) (*GetAppsOutput, error) { - req, out := c.GetAppsRequest(input) +func (c *Pinpoint) DeleteVoiceTemplateWithContext(ctx aws.Context, input *DeleteVoiceTemplateInput, opts ...request.Option) (*DeleteVoiceTemplateOutput, error) { + req, out := c.DeleteVoiceTemplateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetBaiduChannel = "GetBaiduChannel" +const opGetAdmChannel = "GetAdmChannel" -// GetBaiduChannelRequest generates a "aws/request.Request" representing the -// client's request for the GetBaiduChannel operation. The "output" return +// GetAdmChannelRequest generates a "aws/request.Request" representing the +// client's request for the GetAdmChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetBaiduChannel for more information on using the GetBaiduChannel +// See GetAdmChannel for more information on using the GetAdmChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetBaiduChannelRequest method. -// req, resp := client.GetBaiduChannelRequest(params) +// // Example sending a request using the GetAdmChannelRequest method. +// req, resp := client.GetAdmChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetBaiduChannel -func (c *Pinpoint) GetBaiduChannelRequest(input *GetBaiduChannelInput) (req *request.Request, output *GetBaiduChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetAdmChannel +func (c *Pinpoint) GetAdmChannelRequest(input *GetAdmChannelInput) (req *request.Request, output *GetAdmChannelOutput) { op := &request.Operation{ - Name: opGetBaiduChannel, + Name: opGetAdmChannel, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/channels/baidu", + HTTPPath: "/v1/apps/{application-id}/channels/adm", } if input == nil { - input = &GetBaiduChannelInput{} + input = &GetAdmChannelInput{} } - output = &GetBaiduChannelOutput{} + output = &GetAdmChannelOutput{} req = c.newRequest(op, input, output) return } -// GetBaiduChannel API operation for Amazon Pinpoint. +// GetAdmChannel API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of the Baidu Cloud Push -// channel for an application. +// Retrieves information about the status and settings of the ADM channel 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 Amazon Pinpoint's -// API operation GetBaiduChannel for usage and error information. +// API operation GetAdmChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetBaiduChannel -func (c *Pinpoint) GetBaiduChannel(input *GetBaiduChannelInput) (*GetBaiduChannelOutput, error) { - req, out := c.GetBaiduChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetAdmChannel +func (c *Pinpoint) GetAdmChannel(input *GetAdmChannelInput) (*GetAdmChannelOutput, error) { + req, out := c.GetAdmChannelRequest(input) return out, req.Send() } -// GetBaiduChannelWithContext is the same as GetBaiduChannel with the addition of +// GetAdmChannelWithContext is the same as GetAdmChannel with the addition of // the ability to pass a context and additional request options. // -// See GetBaiduChannel for details on how to use this API operation. +// See GetAdmChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetBaiduChannelWithContext(ctx aws.Context, input *GetBaiduChannelInput, opts ...request.Option) (*GetBaiduChannelOutput, error) { - req, out := c.GetBaiduChannelRequest(input) +func (c *Pinpoint) GetAdmChannelWithContext(ctx aws.Context, input *GetAdmChannelInput, opts ...request.Option) (*GetAdmChannelOutput, error) { + req, out := c.GetAdmChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetCampaign = "GetCampaign" +const opGetApnsChannel = "GetApnsChannel" -// GetCampaignRequest generates a "aws/request.Request" representing the -// client's request for the GetCampaign operation. The "output" return +// GetApnsChannelRequest generates a "aws/request.Request" representing the +// client's request for the GetApnsChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetCampaign for more information on using the GetCampaign +// See GetApnsChannel for more information on using the GetApnsChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetCampaignRequest method. -// req, resp := client.GetCampaignRequest(params) +// // Example sending a request using the GetApnsChannelRequest method. +// req, resp := client.GetApnsChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaign -func (c *Pinpoint) GetCampaignRequest(input *GetCampaignInput) (req *request.Request, output *GetCampaignOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsChannel +func (c *Pinpoint) GetApnsChannelRequest(input *GetApnsChannelInput) (req *request.Request, output *GetApnsChannelOutput) { op := &request.Operation{ - Name: opGetCampaign, + Name: opGetApnsChannel, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/campaigns/{campaign-id}", + HTTPPath: "/v1/apps/{application-id}/channels/apns", } if input == nil { - input = &GetCampaignInput{} + input = &GetApnsChannelInput{} } - output = &GetCampaignOutput{} + output = &GetApnsChannelOutput{} req = c.newRequest(op, input, output) return } -// GetCampaign API operation for Amazon Pinpoint. +// GetApnsChannel API operation for Amazon Pinpoint. // -// Retrieves information about the status, configuration, and other settings -// for a campaign. +// Retrieves information about the status and settings of the APNs channel 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 Amazon Pinpoint's -// API operation GetCampaign for usage and error information. +// API operation GetApnsChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaign -func (c *Pinpoint) GetCampaign(input *GetCampaignInput) (*GetCampaignOutput, error) { - req, out := c.GetCampaignRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsChannel +func (c *Pinpoint) GetApnsChannel(input *GetApnsChannelInput) (*GetApnsChannelOutput, error) { + req, out := c.GetApnsChannelRequest(input) return out, req.Send() } -// GetCampaignWithContext is the same as GetCampaign with the addition of +// GetApnsChannelWithContext is the same as GetApnsChannel with the addition of // the ability to pass a context and additional request options. // -// See GetCampaign for details on how to use this API operation. +// See GetApnsChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetCampaignWithContext(ctx aws.Context, input *GetCampaignInput, opts ...request.Option) (*GetCampaignOutput, error) { - req, out := c.GetCampaignRequest(input) +func (c *Pinpoint) GetApnsChannelWithContext(ctx aws.Context, input *GetApnsChannelInput, opts ...request.Option) (*GetApnsChannelOutput, error) { + req, out := c.GetApnsChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetCampaignActivities = "GetCampaignActivities" +const opGetApnsSandboxChannel = "GetApnsSandboxChannel" -// GetCampaignActivitiesRequest generates a "aws/request.Request" representing the -// client's request for the GetCampaignActivities operation. The "output" return +// GetApnsSandboxChannelRequest generates a "aws/request.Request" representing the +// client's request for the GetApnsSandboxChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetCampaignActivities for more information on using the GetCampaignActivities +// See GetApnsSandboxChannel for more information on using the GetApnsSandboxChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetCampaignActivitiesRequest method. -// req, resp := client.GetCampaignActivitiesRequest(params) +// // Example sending a request using the GetApnsSandboxChannelRequest method. +// req, resp := client.GetApnsSandboxChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignActivities -func (c *Pinpoint) GetCampaignActivitiesRequest(input *GetCampaignActivitiesInput) (req *request.Request, output *GetCampaignActivitiesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsSandboxChannel +func (c *Pinpoint) GetApnsSandboxChannelRequest(input *GetApnsSandboxChannelInput) (req *request.Request, output *GetApnsSandboxChannelOutput) { op := &request.Operation{ - Name: opGetCampaignActivities, + Name: opGetApnsSandboxChannel, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/campaigns/{campaign-id}/activities", + HTTPPath: "/v1/apps/{application-id}/channels/apns_sandbox", } if input == nil { - input = &GetCampaignActivitiesInput{} + input = &GetApnsSandboxChannelInput{} } - output = &GetCampaignActivitiesOutput{} + output = &GetApnsSandboxChannelOutput{} req = c.newRequest(op, input, output) return } -// GetCampaignActivities API operation for Amazon Pinpoint. +// GetApnsSandboxChannel API operation for Amazon Pinpoint. // -// Retrieves information about the activity performed by a campaign. +// Retrieves information about the status and settings of the APNs sandbox channel +// 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 Amazon Pinpoint's -// API operation GetCampaignActivities for usage and error information. +// API operation GetApnsSandboxChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignActivities -func (c *Pinpoint) GetCampaignActivities(input *GetCampaignActivitiesInput) (*GetCampaignActivitiesOutput, error) { - req, out := c.GetCampaignActivitiesRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsSandboxChannel +func (c *Pinpoint) GetApnsSandboxChannel(input *GetApnsSandboxChannelInput) (*GetApnsSandboxChannelOutput, error) { + req, out := c.GetApnsSandboxChannelRequest(input) return out, req.Send() } -// GetCampaignActivitiesWithContext is the same as GetCampaignActivities with the addition of +// GetApnsSandboxChannelWithContext is the same as GetApnsSandboxChannel with the addition of // the ability to pass a context and additional request options. // -// See GetCampaignActivities for details on how to use this API operation. +// See GetApnsSandboxChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetCampaignActivitiesWithContext(ctx aws.Context, input *GetCampaignActivitiesInput, opts ...request.Option) (*GetCampaignActivitiesOutput, error) { - req, out := c.GetCampaignActivitiesRequest(input) +func (c *Pinpoint) GetApnsSandboxChannelWithContext(ctx aws.Context, input *GetApnsSandboxChannelInput, opts ...request.Option) (*GetApnsSandboxChannelOutput, error) { + req, out := c.GetApnsSandboxChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetCampaignDateRangeKpi = "GetCampaignDateRangeKpi" +const opGetApnsVoipChannel = "GetApnsVoipChannel" -// GetCampaignDateRangeKpiRequest generates a "aws/request.Request" representing the -// client's request for the GetCampaignDateRangeKpi operation. The "output" return +// GetApnsVoipChannelRequest generates a "aws/request.Request" representing the +// client's request for the GetApnsVoipChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetCampaignDateRangeKpi for more information on using the GetCampaignDateRangeKpi +// See GetApnsVoipChannel for more information on using the GetApnsVoipChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetCampaignDateRangeKpiRequest method. -// req, resp := client.GetCampaignDateRangeKpiRequest(params) +// // Example sending a request using the GetApnsVoipChannelRequest method. +// req, resp := client.GetApnsVoipChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignDateRangeKpi -func (c *Pinpoint) GetCampaignDateRangeKpiRequest(input *GetCampaignDateRangeKpiInput) (req *request.Request, output *GetCampaignDateRangeKpiOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsVoipChannel +func (c *Pinpoint) GetApnsVoipChannelRequest(input *GetApnsVoipChannelInput) (req *request.Request, output *GetApnsVoipChannelOutput) { op := &request.Operation{ - Name: opGetCampaignDateRangeKpi, + Name: opGetApnsVoipChannel, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/campaigns/{campaign-id}/kpis/daterange/{kpi-name}", + HTTPPath: "/v1/apps/{application-id}/channels/apns_voip", } if input == nil { - input = &GetCampaignDateRangeKpiInput{} + input = &GetApnsVoipChannelInput{} } - output = &GetCampaignDateRangeKpiOutput{} + output = &GetApnsVoipChannelOutput{} req = c.newRequest(op, input, output) return } -// GetCampaignDateRangeKpi API operation for Amazon Pinpoint. +// GetApnsVoipChannel API operation for Amazon Pinpoint. // -// Retrieves (queries) pre-aggregated data for a standard metric that applies -// to a campaign. +// Retrieves information about the status and settings of the APNs VoIP channel +// 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 Amazon Pinpoint's -// API operation GetCampaignDateRangeKpi for usage and error information. +// API operation GetApnsVoipChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignDateRangeKpi -func (c *Pinpoint) GetCampaignDateRangeKpi(input *GetCampaignDateRangeKpiInput) (*GetCampaignDateRangeKpiOutput, error) { - req, out := c.GetCampaignDateRangeKpiRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsVoipChannel +func (c *Pinpoint) GetApnsVoipChannel(input *GetApnsVoipChannelInput) (*GetApnsVoipChannelOutput, error) { + req, out := c.GetApnsVoipChannelRequest(input) return out, req.Send() } -// GetCampaignDateRangeKpiWithContext is the same as GetCampaignDateRangeKpi with the addition of +// GetApnsVoipChannelWithContext is the same as GetApnsVoipChannel with the addition of // the ability to pass a context and additional request options. // -// See GetCampaignDateRangeKpi for details on how to use this API operation. +// See GetApnsVoipChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetCampaignDateRangeKpiWithContext(ctx aws.Context, input *GetCampaignDateRangeKpiInput, opts ...request.Option) (*GetCampaignDateRangeKpiOutput, error) { - req, out := c.GetCampaignDateRangeKpiRequest(input) +func (c *Pinpoint) GetApnsVoipChannelWithContext(ctx aws.Context, input *GetApnsVoipChannelInput, opts ...request.Option) (*GetApnsVoipChannelOutput, error) { + req, out := c.GetApnsVoipChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetCampaignVersion = "GetCampaignVersion" +const opGetApnsVoipSandboxChannel = "GetApnsVoipSandboxChannel" -// GetCampaignVersionRequest generates a "aws/request.Request" representing the -// client's request for the GetCampaignVersion operation. The "output" return +// GetApnsVoipSandboxChannelRequest generates a "aws/request.Request" representing the +// client's request for the GetApnsVoipSandboxChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetCampaignVersion for more information on using the GetCampaignVersion +// See GetApnsVoipSandboxChannel for more information on using the GetApnsVoipSandboxChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetCampaignVersionRequest method. -// req, resp := client.GetCampaignVersionRequest(params) +// // Example sending a request using the GetApnsVoipSandboxChannelRequest method. +// req, resp := client.GetApnsVoipSandboxChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignVersion -func (c *Pinpoint) GetCampaignVersionRequest(input *GetCampaignVersionInput) (req *request.Request, output *GetCampaignVersionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsVoipSandboxChannel +func (c *Pinpoint) GetApnsVoipSandboxChannelRequest(input *GetApnsVoipSandboxChannelInput) (req *request.Request, output *GetApnsVoipSandboxChannelOutput) { op := &request.Operation{ - Name: opGetCampaignVersion, + Name: opGetApnsVoipSandboxChannel, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/campaigns/{campaign-id}/versions/{version}", + HTTPPath: "/v1/apps/{application-id}/channels/apns_voip_sandbox", } if input == nil { - input = &GetCampaignVersionInput{} + input = &GetApnsVoipSandboxChannelInput{} } - output = &GetCampaignVersionOutput{} + output = &GetApnsVoipSandboxChannelOutput{} req = c.newRequest(op, input, output) return } -// GetCampaignVersion API operation for Amazon Pinpoint. +// GetApnsVoipSandboxChannel API operation for Amazon Pinpoint. // -// Retrieves information about the status, configuration, and other settings -// for a specific version of a campaign. +// Retrieves information about the status and settings of the APNs VoIP sandbox +// channel 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 Amazon Pinpoint's -// API operation GetCampaignVersion for usage and error information. +// API operation GetApnsVoipSandboxChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignVersion -func (c *Pinpoint) GetCampaignVersion(input *GetCampaignVersionInput) (*GetCampaignVersionOutput, error) { - req, out := c.GetCampaignVersionRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApnsVoipSandboxChannel +func (c *Pinpoint) GetApnsVoipSandboxChannel(input *GetApnsVoipSandboxChannelInput) (*GetApnsVoipSandboxChannelOutput, error) { + req, out := c.GetApnsVoipSandboxChannelRequest(input) return out, req.Send() } -// GetCampaignVersionWithContext is the same as GetCampaignVersion with the addition of +// GetApnsVoipSandboxChannelWithContext is the same as GetApnsVoipSandboxChannel with the addition of // the ability to pass a context and additional request options. // -// See GetCampaignVersion for details on how to use this API operation. +// See GetApnsVoipSandboxChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetCampaignVersionWithContext(ctx aws.Context, input *GetCampaignVersionInput, opts ...request.Option) (*GetCampaignVersionOutput, error) { - req, out := c.GetCampaignVersionRequest(input) +func (c *Pinpoint) GetApnsVoipSandboxChannelWithContext(ctx aws.Context, input *GetApnsVoipSandboxChannelInput, opts ...request.Option) (*GetApnsVoipSandboxChannelOutput, error) { + req, out := c.GetApnsVoipSandboxChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetCampaignVersions = "GetCampaignVersions" +const opGetApp = "GetApp" -// GetCampaignVersionsRequest generates a "aws/request.Request" representing the -// client's request for the GetCampaignVersions operation. The "output" return +// GetAppRequest generates a "aws/request.Request" representing the +// client's request for the GetApp operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetCampaignVersions for more information on using the GetCampaignVersions +// See GetApp for more information on using the GetApp // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetCampaignVersionsRequest method. -// req, resp := client.GetCampaignVersionsRequest(params) +// // Example sending a request using the GetAppRequest method. +// req, resp := client.GetAppRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignVersions -func (c *Pinpoint) GetCampaignVersionsRequest(input *GetCampaignVersionsInput) (req *request.Request, output *GetCampaignVersionsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApp +func (c *Pinpoint) GetAppRequest(input *GetAppInput) (req *request.Request, output *GetAppOutput) { op := &request.Operation{ - Name: opGetCampaignVersions, + Name: opGetApp, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/campaigns/{campaign-id}/versions", + HTTPPath: "/v1/apps/{application-id}", } if input == nil { - input = &GetCampaignVersionsInput{} + input = &GetAppInput{} } - output = &GetCampaignVersionsOutput{} + output = &GetAppOutput{} req = c.newRequest(op, input, output) return } -// GetCampaignVersions API operation for Amazon Pinpoint. +// GetApp API operation for Amazon Pinpoint. // -// Retrieves information about the status, configuration, and other settings -// for all versions of a specific campaign. +// Retrieves 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 Amazon Pinpoint's -// API operation GetCampaignVersions for usage and error information. +// API operation GetApp for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignVersions -func (c *Pinpoint) GetCampaignVersions(input *GetCampaignVersionsInput) (*GetCampaignVersionsOutput, error) { - req, out := c.GetCampaignVersionsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApp +func (c *Pinpoint) GetApp(input *GetAppInput) (*GetAppOutput, error) { + req, out := c.GetAppRequest(input) return out, req.Send() } -// GetCampaignVersionsWithContext is the same as GetCampaignVersions with the addition of +// GetAppWithContext is the same as GetApp with the addition of // the ability to pass a context and additional request options. // -// See GetCampaignVersions for details on how to use this API operation. +// See GetApp for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetCampaignVersionsWithContext(ctx aws.Context, input *GetCampaignVersionsInput, opts ...request.Option) (*GetCampaignVersionsOutput, error) { - req, out := c.GetCampaignVersionsRequest(input) +func (c *Pinpoint) GetAppWithContext(ctx aws.Context, input *GetAppInput, opts ...request.Option) (*GetAppOutput, error) { + req, out := c.GetAppRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetCampaigns = "GetCampaigns" +const opGetApplicationDateRangeKpi = "GetApplicationDateRangeKpi" -// GetCampaignsRequest generates a "aws/request.Request" representing the -// client's request for the GetCampaigns operation. The "output" return +// GetApplicationDateRangeKpiRequest generates a "aws/request.Request" representing the +// client's request for the GetApplicationDateRangeKpi operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetCampaigns for more information on using the GetCampaigns +// See GetApplicationDateRangeKpi for more information on using the GetApplicationDateRangeKpi // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetCampaignsRequest method. -// req, resp := client.GetCampaignsRequest(params) +// // Example sending a request using the GetApplicationDateRangeKpiRequest method. +// req, resp := client.GetApplicationDateRangeKpiRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaigns -func (c *Pinpoint) GetCampaignsRequest(input *GetCampaignsInput) (req *request.Request, output *GetCampaignsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApplicationDateRangeKpi +func (c *Pinpoint) GetApplicationDateRangeKpiRequest(input *GetApplicationDateRangeKpiInput) (req *request.Request, output *GetApplicationDateRangeKpiOutput) { op := &request.Operation{ - Name: opGetCampaigns, + Name: opGetApplicationDateRangeKpi, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/campaigns", + HTTPPath: "/v1/apps/{application-id}/kpis/daterange/{kpi-name}", } if input == nil { - input = &GetCampaignsInput{} + input = &GetApplicationDateRangeKpiInput{} } - output = &GetCampaignsOutput{} + output = &GetApplicationDateRangeKpiOutput{} req = c.newRequest(op, input, output) return } -// GetCampaigns API operation for Amazon Pinpoint. +// GetApplicationDateRangeKpi API operation for Amazon Pinpoint. // -// Retrieves information about the status, configuration, and other settings -// for all the campaigns that are associated with an application. +// Retrieves (queries) pre-aggregated data for a standard metric that applies +// to 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 Amazon Pinpoint's -// API operation GetCampaigns for usage and error information. +// API operation GetApplicationDateRangeKpi for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaigns -func (c *Pinpoint) GetCampaigns(input *GetCampaignsInput) (*GetCampaignsOutput, error) { - req, out := c.GetCampaignsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApplicationDateRangeKpi +func (c *Pinpoint) GetApplicationDateRangeKpi(input *GetApplicationDateRangeKpiInput) (*GetApplicationDateRangeKpiOutput, error) { + req, out := c.GetApplicationDateRangeKpiRequest(input) return out, req.Send() } -// GetCampaignsWithContext is the same as GetCampaigns with the addition of +// GetApplicationDateRangeKpiWithContext is the same as GetApplicationDateRangeKpi with the addition of // the ability to pass a context and additional request options. // -// See GetCampaigns for details on how to use this API operation. +// See GetApplicationDateRangeKpi for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetCampaignsWithContext(ctx aws.Context, input *GetCampaignsInput, opts ...request.Option) (*GetCampaignsOutput, error) { - req, out := c.GetCampaignsRequest(input) +func (c *Pinpoint) GetApplicationDateRangeKpiWithContext(ctx aws.Context, input *GetApplicationDateRangeKpiInput, opts ...request.Option) (*GetApplicationDateRangeKpiOutput, error) { + req, out := c.GetApplicationDateRangeKpiRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetChannels = "GetChannels" +const opGetApplicationSettings = "GetApplicationSettings" -// GetChannelsRequest generates a "aws/request.Request" representing the -// client's request for the GetChannels operation. The "output" return +// GetApplicationSettingsRequest generates a "aws/request.Request" representing the +// client's request for the GetApplicationSettings operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetChannels for more information on using the GetChannels +// See GetApplicationSettings for more information on using the GetApplicationSettings // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetChannelsRequest method. -// req, resp := client.GetChannelsRequest(params) +// // Example sending a request using the GetApplicationSettingsRequest method. +// req, resp := client.GetApplicationSettingsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetChannels -func (c *Pinpoint) GetChannelsRequest(input *GetChannelsInput) (req *request.Request, output *GetChannelsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApplicationSettings +func (c *Pinpoint) GetApplicationSettingsRequest(input *GetApplicationSettingsInput) (req *request.Request, output *GetApplicationSettingsOutput) { op := &request.Operation{ - Name: opGetChannels, + Name: opGetApplicationSettings, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/channels", + HTTPPath: "/v1/apps/{application-id}/settings", } if input == nil { - input = &GetChannelsInput{} + input = &GetApplicationSettingsInput{} } - output = &GetChannelsOutput{} + output = &GetApplicationSettingsOutput{} req = c.newRequest(op, input, output) return } -// GetChannels API operation for Amazon Pinpoint. +// GetApplicationSettings API operation for Amazon Pinpoint. // -// Retrieves information about the history and status of each channel for an -// application. +// Retrieves information about the 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 Amazon Pinpoint's -// API operation GetChannels for usage and error information. +// API operation GetApplicationSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetChannels -func (c *Pinpoint) GetChannels(input *GetChannelsInput) (*GetChannelsOutput, error) { - req, out := c.GetChannelsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApplicationSettings +func (c *Pinpoint) GetApplicationSettings(input *GetApplicationSettingsInput) (*GetApplicationSettingsOutput, error) { + req, out := c.GetApplicationSettingsRequest(input) return out, req.Send() } -// GetChannelsWithContext is the same as GetChannels with the addition of +// GetApplicationSettingsWithContext is the same as GetApplicationSettings with the addition of // the ability to pass a context and additional request options. // -// See GetChannels for details on how to use this API operation. +// See GetApplicationSettings for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetChannelsWithContext(ctx aws.Context, input *GetChannelsInput, opts ...request.Option) (*GetChannelsOutput, error) { - req, out := c.GetChannelsRequest(input) +func (c *Pinpoint) GetApplicationSettingsWithContext(ctx aws.Context, input *GetApplicationSettingsInput, opts ...request.Option) (*GetApplicationSettingsOutput, error) { + req, out := c.GetApplicationSettingsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetEmailChannel = "GetEmailChannel" +const opGetApps = "GetApps" -// GetEmailChannelRequest generates a "aws/request.Request" representing the -// client's request for the GetEmailChannel operation. The "output" return +// GetAppsRequest generates a "aws/request.Request" representing the +// client's request for the GetApps operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetEmailChannel for more information on using the GetEmailChannel +// See GetApps for more information on using the GetApps // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetEmailChannelRequest method. -// req, resp := client.GetEmailChannelRequest(params) +// // Example sending a request using the GetAppsRequest method. +// req, resp := client.GetAppsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetEmailChannel -func (c *Pinpoint) GetEmailChannelRequest(input *GetEmailChannelInput) (req *request.Request, output *GetEmailChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApps +func (c *Pinpoint) GetAppsRequest(input *GetAppsInput) (req *request.Request, output *GetAppsOutput) { op := &request.Operation{ - Name: opGetEmailChannel, + Name: opGetApps, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/channels/email", + HTTPPath: "/v1/apps", } if input == nil { - input = &GetEmailChannelInput{} + input = &GetAppsInput{} } - output = &GetEmailChannelOutput{} + output = &GetAppsOutput{} req = c.newRequest(op, input, output) return } -// GetEmailChannel API operation for Amazon Pinpoint. +// GetApps API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of the email channel -// for an application. +// Retrieves information about all the applications that are associated with +// your Amazon Pinpoint 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 Pinpoint's -// API operation GetEmailChannel for usage and error information. +// API operation GetApps for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetEmailChannel -func (c *Pinpoint) GetEmailChannel(input *GetEmailChannelInput) (*GetEmailChannelOutput, error) { - req, out := c.GetEmailChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetApps +func (c *Pinpoint) GetApps(input *GetAppsInput) (*GetAppsOutput, error) { + req, out := c.GetAppsRequest(input) return out, req.Send() } -// GetEmailChannelWithContext is the same as GetEmailChannel with the addition of +// GetAppsWithContext is the same as GetApps with the addition of // the ability to pass a context and additional request options. // -// See GetEmailChannel for details on how to use this API operation. +// See GetApps for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetEmailChannelWithContext(ctx aws.Context, input *GetEmailChannelInput, opts ...request.Option) (*GetEmailChannelOutput, error) { - req, out := c.GetEmailChannelRequest(input) +func (c *Pinpoint) GetAppsWithContext(ctx aws.Context, input *GetAppsInput, opts ...request.Option) (*GetAppsOutput, error) { + req, out := c.GetAppsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetEndpoint = "GetEndpoint" +const opGetBaiduChannel = "GetBaiduChannel" -// GetEndpointRequest generates a "aws/request.Request" representing the -// client's request for the GetEndpoint operation. The "output" return +// GetBaiduChannelRequest generates a "aws/request.Request" representing the +// client's request for the GetBaiduChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetEndpoint for more information on using the GetEndpoint +// See GetBaiduChannel for more information on using the GetBaiduChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetEndpointRequest method. -// req, resp := client.GetEndpointRequest(params) +// // Example sending a request using the GetBaiduChannelRequest method. +// req, resp := client.GetBaiduChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetEndpoint -func (c *Pinpoint) GetEndpointRequest(input *GetEndpointInput) (req *request.Request, output *GetEndpointOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetBaiduChannel +func (c *Pinpoint) GetBaiduChannelRequest(input *GetBaiduChannelInput) (req *request.Request, output *GetBaiduChannelOutput) { op := &request.Operation{ - Name: opGetEndpoint, + Name: opGetBaiduChannel, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/endpoints/{endpoint-id}", + HTTPPath: "/v1/apps/{application-id}/channels/baidu", } if input == nil { - input = &GetEndpointInput{} + input = &GetBaiduChannelInput{} } - output = &GetEndpointOutput{} + output = &GetBaiduChannelOutput{} req = c.newRequest(op, input, output) return } -// GetEndpoint API operation for Amazon Pinpoint. +// GetBaiduChannel API operation for Amazon Pinpoint. // -// Retrieves information about the settings and attributes of a specific endpoint +// Retrieves information about the status and settings of the Baidu channel // for an application. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -3757,5730 +3836,12544 @@ func (c *Pinpoint) GetEndpointRequest(input *GetEndpointInput) (req *request.Req // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation GetEndpoint for usage and error information. +// API operation GetBaiduChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetEndpoint -func (c *Pinpoint) GetEndpoint(input *GetEndpointInput) (*GetEndpointOutput, error) { - req, out := c.GetEndpointRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetBaiduChannel +func (c *Pinpoint) GetBaiduChannel(input *GetBaiduChannelInput) (*GetBaiduChannelOutput, error) { + req, out := c.GetBaiduChannelRequest(input) return out, req.Send() } -// GetEndpointWithContext is the same as GetEndpoint with the addition of +// GetBaiduChannelWithContext is the same as GetBaiduChannel with the addition of // the ability to pass a context and additional request options. // -// See GetEndpoint for details on how to use this API operation. +// See GetBaiduChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetEndpointWithContext(ctx aws.Context, input *GetEndpointInput, opts ...request.Option) (*GetEndpointOutput, error) { - req, out := c.GetEndpointRequest(input) +func (c *Pinpoint) GetBaiduChannelWithContext(ctx aws.Context, input *GetBaiduChannelInput, opts ...request.Option) (*GetBaiduChannelOutput, error) { + req, out := c.GetBaiduChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetEventStream = "GetEventStream" +const opGetCampaign = "GetCampaign" -// GetEventStreamRequest generates a "aws/request.Request" representing the -// client's request for the GetEventStream operation. The "output" return +// GetCampaignRequest generates a "aws/request.Request" representing the +// client's request for the GetCampaign operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetEventStream for more information on using the GetEventStream +// See GetCampaign for more information on using the GetCampaign // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetEventStreamRequest method. -// req, resp := client.GetEventStreamRequest(params) +// // Example sending a request using the GetCampaignRequest method. +// req, resp := client.GetCampaignRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetEventStream -func (c *Pinpoint) GetEventStreamRequest(input *GetEventStreamInput) (req *request.Request, output *GetEventStreamOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaign +func (c *Pinpoint) GetCampaignRequest(input *GetCampaignInput) (req *request.Request, output *GetCampaignOutput) { op := &request.Operation{ - Name: opGetEventStream, + Name: opGetCampaign, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/eventstream", + HTTPPath: "/v1/apps/{application-id}/campaigns/{campaign-id}", } if input == nil { - input = &GetEventStreamInput{} + input = &GetCampaignInput{} } - output = &GetEventStreamOutput{} + output = &GetCampaignOutput{} req = c.newRequest(op, input, output) return } -// GetEventStream API operation for Amazon Pinpoint. +// GetCampaign API operation for Amazon Pinpoint. // -// Retrieves information about the event stream settings for an application. +// Retrieves information about the status, configuration, and other settings +// for a campaign. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation GetEventStream for usage and error information. +// API operation GetCampaign for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetEventStream -func (c *Pinpoint) GetEventStream(input *GetEventStreamInput) (*GetEventStreamOutput, error) { - req, out := c.GetEventStreamRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaign +func (c *Pinpoint) GetCampaign(input *GetCampaignInput) (*GetCampaignOutput, error) { + req, out := c.GetCampaignRequest(input) return out, req.Send() } -// GetEventStreamWithContext is the same as GetEventStream with the addition of +// GetCampaignWithContext is the same as GetCampaign with the addition of // the ability to pass a context and additional request options. // -// See GetEventStream for details on how to use this API operation. +// See GetCampaign for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetEventStreamWithContext(ctx aws.Context, input *GetEventStreamInput, opts ...request.Option) (*GetEventStreamOutput, error) { - req, out := c.GetEventStreamRequest(input) +func (c *Pinpoint) GetCampaignWithContext(ctx aws.Context, input *GetCampaignInput, opts ...request.Option) (*GetCampaignOutput, error) { + req, out := c.GetCampaignRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetExportJob = "GetExportJob" +const opGetCampaignActivities = "GetCampaignActivities" -// GetExportJobRequest generates a "aws/request.Request" representing the -// client's request for the GetExportJob operation. The "output" return +// GetCampaignActivitiesRequest generates a "aws/request.Request" representing the +// client's request for the GetCampaignActivities operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetExportJob for more information on using the GetExportJob +// See GetCampaignActivities for more information on using the GetCampaignActivities // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetExportJobRequest method. -// req, resp := client.GetExportJobRequest(params) +// // Example sending a request using the GetCampaignActivitiesRequest method. +// req, resp := client.GetCampaignActivitiesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetExportJob -func (c *Pinpoint) GetExportJobRequest(input *GetExportJobInput) (req *request.Request, output *GetExportJobOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignActivities +func (c *Pinpoint) GetCampaignActivitiesRequest(input *GetCampaignActivitiesInput) (req *request.Request, output *GetCampaignActivitiesOutput) { op := &request.Operation{ - Name: opGetExportJob, + Name: opGetCampaignActivities, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/jobs/export/{job-id}", + HTTPPath: "/v1/apps/{application-id}/campaigns/{campaign-id}/activities", } if input == nil { - input = &GetExportJobInput{} + input = &GetCampaignActivitiesInput{} } - output = &GetExportJobOutput{} + output = &GetCampaignActivitiesOutput{} req = c.newRequest(op, input, output) return } -// GetExportJob API operation for Amazon Pinpoint. +// GetCampaignActivities API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of a specific export -// job for an application. +// Retrieves information about all the activities for a campaign. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation GetExportJob for usage and error information. +// API operation GetCampaignActivities for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetExportJob -func (c *Pinpoint) GetExportJob(input *GetExportJobInput) (*GetExportJobOutput, error) { - req, out := c.GetExportJobRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignActivities +func (c *Pinpoint) GetCampaignActivities(input *GetCampaignActivitiesInput) (*GetCampaignActivitiesOutput, error) { + req, out := c.GetCampaignActivitiesRequest(input) return out, req.Send() } -// GetExportJobWithContext is the same as GetExportJob with the addition of +// GetCampaignActivitiesWithContext is the same as GetCampaignActivities with the addition of // the ability to pass a context and additional request options. // -// See GetExportJob for details on how to use this API operation. +// See GetCampaignActivities for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetExportJobWithContext(ctx aws.Context, input *GetExportJobInput, opts ...request.Option) (*GetExportJobOutput, error) { - req, out := c.GetExportJobRequest(input) +func (c *Pinpoint) GetCampaignActivitiesWithContext(ctx aws.Context, input *GetCampaignActivitiesInput, opts ...request.Option) (*GetCampaignActivitiesOutput, error) { + req, out := c.GetCampaignActivitiesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetExportJobs = "GetExportJobs" +const opGetCampaignDateRangeKpi = "GetCampaignDateRangeKpi" -// GetExportJobsRequest generates a "aws/request.Request" representing the -// client's request for the GetExportJobs operation. The "output" return +// GetCampaignDateRangeKpiRequest generates a "aws/request.Request" representing the +// client's request for the GetCampaignDateRangeKpi operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetExportJobs for more information on using the GetExportJobs +// See GetCampaignDateRangeKpi for more information on using the GetCampaignDateRangeKpi // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetExportJobsRequest method. -// req, resp := client.GetExportJobsRequest(params) +// // Example sending a request using the GetCampaignDateRangeKpiRequest method. +// req, resp := client.GetCampaignDateRangeKpiRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetExportJobs -func (c *Pinpoint) GetExportJobsRequest(input *GetExportJobsInput) (req *request.Request, output *GetExportJobsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignDateRangeKpi +func (c *Pinpoint) GetCampaignDateRangeKpiRequest(input *GetCampaignDateRangeKpiInput) (req *request.Request, output *GetCampaignDateRangeKpiOutput) { op := &request.Operation{ - Name: opGetExportJobs, + Name: opGetCampaignDateRangeKpi, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/jobs/export", + HTTPPath: "/v1/apps/{application-id}/campaigns/{campaign-id}/kpis/daterange/{kpi-name}", } if input == nil { - input = &GetExportJobsInput{} + input = &GetCampaignDateRangeKpiInput{} } - output = &GetExportJobsOutput{} + output = &GetCampaignDateRangeKpiOutput{} req = c.newRequest(op, input, output) return } -// GetExportJobs API operation for Amazon Pinpoint. +// GetCampaignDateRangeKpi API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of all the export jobs -// for an application. +// Retrieves (queries) pre-aggregated data for a standard metric that applies +// to a campaign. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation GetExportJobs for usage and error information. +// API operation GetCampaignDateRangeKpi for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetExportJobs -func (c *Pinpoint) GetExportJobs(input *GetExportJobsInput) (*GetExportJobsOutput, error) { - req, out := c.GetExportJobsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignDateRangeKpi +func (c *Pinpoint) GetCampaignDateRangeKpi(input *GetCampaignDateRangeKpiInput) (*GetCampaignDateRangeKpiOutput, error) { + req, out := c.GetCampaignDateRangeKpiRequest(input) return out, req.Send() } -// GetExportJobsWithContext is the same as GetExportJobs with the addition of +// GetCampaignDateRangeKpiWithContext is the same as GetCampaignDateRangeKpi with the addition of // the ability to pass a context and additional request options. // -// See GetExportJobs for details on how to use this API operation. +// See GetCampaignDateRangeKpi for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetExportJobsWithContext(ctx aws.Context, input *GetExportJobsInput, opts ...request.Option) (*GetExportJobsOutput, error) { - req, out := c.GetExportJobsRequest(input) +func (c *Pinpoint) GetCampaignDateRangeKpiWithContext(ctx aws.Context, input *GetCampaignDateRangeKpiInput, opts ...request.Option) (*GetCampaignDateRangeKpiOutput, error) { + req, out := c.GetCampaignDateRangeKpiRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetGcmChannel = "GetGcmChannel" +const opGetCampaignVersion = "GetCampaignVersion" -// GetGcmChannelRequest generates a "aws/request.Request" representing the -// client's request for the GetGcmChannel operation. The "output" return +// GetCampaignVersionRequest generates a "aws/request.Request" representing the +// client's request for the GetCampaignVersion operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetGcmChannel for more information on using the GetGcmChannel +// See GetCampaignVersion for more information on using the GetCampaignVersion // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetGcmChannelRequest method. -// req, resp := client.GetGcmChannelRequest(params) +// // Example sending a request using the GetCampaignVersionRequest method. +// req, resp := client.GetCampaignVersionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetGcmChannel -func (c *Pinpoint) GetGcmChannelRequest(input *GetGcmChannelInput) (req *request.Request, output *GetGcmChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignVersion +func (c *Pinpoint) GetCampaignVersionRequest(input *GetCampaignVersionInput) (req *request.Request, output *GetCampaignVersionOutput) { op := &request.Operation{ - Name: opGetGcmChannel, + Name: opGetCampaignVersion, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/channels/gcm", + HTTPPath: "/v1/apps/{application-id}/campaigns/{campaign-id}/versions/{version}", } if input == nil { - input = &GetGcmChannelInput{} + input = &GetCampaignVersionInput{} } - output = &GetGcmChannelOutput{} + output = &GetCampaignVersionOutput{} req = c.newRequest(op, input, output) return } -// GetGcmChannel API operation for Amazon Pinpoint. +// GetCampaignVersion API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of the GCM channel for -// an application. +// Retrieves information about the status, configuration, and other settings +// for a specific version of a campaign. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation GetGcmChannel for usage and error information. +// API operation GetCampaignVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetGcmChannel -func (c *Pinpoint) GetGcmChannel(input *GetGcmChannelInput) (*GetGcmChannelOutput, error) { - req, out := c.GetGcmChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignVersion +func (c *Pinpoint) GetCampaignVersion(input *GetCampaignVersionInput) (*GetCampaignVersionOutput, error) { + req, out := c.GetCampaignVersionRequest(input) return out, req.Send() } -// GetGcmChannelWithContext is the same as GetGcmChannel with the addition of +// GetCampaignVersionWithContext is the same as GetCampaignVersion with the addition of // the ability to pass a context and additional request options. // -// See GetGcmChannel for details on how to use this API operation. +// See GetCampaignVersion for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetGcmChannelWithContext(ctx aws.Context, input *GetGcmChannelInput, opts ...request.Option) (*GetGcmChannelOutput, error) { - req, out := c.GetGcmChannelRequest(input) +func (c *Pinpoint) GetCampaignVersionWithContext(ctx aws.Context, input *GetCampaignVersionInput, opts ...request.Option) (*GetCampaignVersionOutput, error) { + req, out := c.GetCampaignVersionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetImportJob = "GetImportJob" +const opGetCampaignVersions = "GetCampaignVersions" -// GetImportJobRequest generates a "aws/request.Request" representing the -// client's request for the GetImportJob operation. The "output" return +// GetCampaignVersionsRequest generates a "aws/request.Request" representing the +// client's request for the GetCampaignVersions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetImportJob for more information on using the GetImportJob +// See GetCampaignVersions for more information on using the GetCampaignVersions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetImportJobRequest method. -// req, resp := client.GetImportJobRequest(params) +// // Example sending a request using the GetCampaignVersionsRequest method. +// req, resp := client.GetCampaignVersionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetImportJob -func (c *Pinpoint) GetImportJobRequest(input *GetImportJobInput) (req *request.Request, output *GetImportJobOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignVersions +func (c *Pinpoint) GetCampaignVersionsRequest(input *GetCampaignVersionsInput) (req *request.Request, output *GetCampaignVersionsOutput) { op := &request.Operation{ - Name: opGetImportJob, + Name: opGetCampaignVersions, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/jobs/import/{job-id}", + HTTPPath: "/v1/apps/{application-id}/campaigns/{campaign-id}/versions", } if input == nil { - input = &GetImportJobInput{} + input = &GetCampaignVersionsInput{} } - output = &GetImportJobOutput{} + output = &GetCampaignVersionsOutput{} req = c.newRequest(op, input, output) return } -// GetImportJob API operation for Amazon Pinpoint. +// GetCampaignVersions API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of a specific import -// job for an application. +// Retrieves information about the status, configuration, and other settings +// for all versions of a campaign. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation GetImportJob for usage and error information. +// API operation GetCampaignVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetImportJob -func (c *Pinpoint) GetImportJob(input *GetImportJobInput) (*GetImportJobOutput, error) { - req, out := c.GetImportJobRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaignVersions +func (c *Pinpoint) GetCampaignVersions(input *GetCampaignVersionsInput) (*GetCampaignVersionsOutput, error) { + req, out := c.GetCampaignVersionsRequest(input) return out, req.Send() } -// GetImportJobWithContext is the same as GetImportJob with the addition of +// GetCampaignVersionsWithContext is the same as GetCampaignVersions with the addition of // the ability to pass a context and additional request options. // -// See GetImportJob for details on how to use this API operation. +// See GetCampaignVersions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetImportJobWithContext(ctx aws.Context, input *GetImportJobInput, opts ...request.Option) (*GetImportJobOutput, error) { - req, out := c.GetImportJobRequest(input) +func (c *Pinpoint) GetCampaignVersionsWithContext(ctx aws.Context, input *GetCampaignVersionsInput, opts ...request.Option) (*GetCampaignVersionsOutput, error) { + req, out := c.GetCampaignVersionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetImportJobs = "GetImportJobs" +const opGetCampaigns = "GetCampaigns" -// GetImportJobsRequest generates a "aws/request.Request" representing the -// client's request for the GetImportJobs operation. The "output" return +// GetCampaignsRequest generates a "aws/request.Request" representing the +// client's request for the GetCampaigns operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetImportJobs for more information on using the GetImportJobs +// See GetCampaigns for more information on using the GetCampaigns // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetImportJobsRequest method. -// req, resp := client.GetImportJobsRequest(params) +// // Example sending a request using the GetCampaignsRequest method. +// req, resp := client.GetCampaignsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetImportJobs -func (c *Pinpoint) GetImportJobsRequest(input *GetImportJobsInput) (req *request.Request, output *GetImportJobsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaigns +func (c *Pinpoint) GetCampaignsRequest(input *GetCampaignsInput) (req *request.Request, output *GetCampaignsOutput) { op := &request.Operation{ - Name: opGetImportJobs, + Name: opGetCampaigns, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/jobs/import", + HTTPPath: "/v1/apps/{application-id}/campaigns", } if input == nil { - input = &GetImportJobsInput{} + input = &GetCampaignsInput{} } - output = &GetImportJobsOutput{} + output = &GetCampaignsOutput{} req = c.newRequest(op, input, output) return } -// GetImportJobs API operation for Amazon Pinpoint. +// GetCampaigns API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of all the import jobs -// for an application. +// Retrieves information about the status, configuration, and other settings +// for all the campaigns that are associated with 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 Amazon Pinpoint's -// API operation GetImportJobs for usage and error information. +// API operation GetCampaigns for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetImportJobs -func (c *Pinpoint) GetImportJobs(input *GetImportJobsInput) (*GetImportJobsOutput, error) { - req, out := c.GetImportJobsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetCampaigns +func (c *Pinpoint) GetCampaigns(input *GetCampaignsInput) (*GetCampaignsOutput, error) { + req, out := c.GetCampaignsRequest(input) return out, req.Send() } -// GetImportJobsWithContext is the same as GetImportJobs with the addition of +// GetCampaignsWithContext is the same as GetCampaigns with the addition of // the ability to pass a context and additional request options. // -// See GetImportJobs for details on how to use this API operation. +// See GetCampaigns for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetImportJobsWithContext(ctx aws.Context, input *GetImportJobsInput, opts ...request.Option) (*GetImportJobsOutput, error) { - req, out := c.GetImportJobsRequest(input) +func (c *Pinpoint) GetCampaignsWithContext(ctx aws.Context, input *GetCampaignsInput, opts ...request.Option) (*GetCampaignsOutput, error) { + req, out := c.GetCampaignsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetSegment = "GetSegment" +const opGetChannels = "GetChannels" -// GetSegmentRequest generates a "aws/request.Request" representing the -// client's request for the GetSegment operation. The "output" return +// GetChannelsRequest generates a "aws/request.Request" representing the +// client's request for the GetChannels operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetSegment for more information on using the GetSegment +// See GetChannels for more information on using the GetChannels // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetSegmentRequest method. -// req, resp := client.GetSegmentRequest(params) +// // Example sending a request using the GetChannelsRequest method. +// req, resp := client.GetChannelsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegment -func (c *Pinpoint) GetSegmentRequest(input *GetSegmentInput) (req *request.Request, output *GetSegmentOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetChannels +func (c *Pinpoint) GetChannelsRequest(input *GetChannelsInput) (req *request.Request, output *GetChannelsOutput) { op := &request.Operation{ - Name: opGetSegment, + Name: opGetChannels, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/segments/{segment-id}", + HTTPPath: "/v1/apps/{application-id}/channels", } if input == nil { - input = &GetSegmentInput{} + input = &GetChannelsInput{} } - output = &GetSegmentOutput{} + output = &GetChannelsOutput{} req = c.newRequest(op, input, output) return } -// GetSegment API operation for Amazon Pinpoint. +// GetChannels API operation for Amazon Pinpoint. // -// Retrieves information about the configuration, dimension, and other settings -// for a specific segment that's associated with an application. +// Retrieves information about the history and status of each channel 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 Amazon Pinpoint's -// API operation GetSegment for usage and error information. +// API operation GetChannels for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegment -func (c *Pinpoint) GetSegment(input *GetSegmentInput) (*GetSegmentOutput, error) { - req, out := c.GetSegmentRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetChannels +func (c *Pinpoint) GetChannels(input *GetChannelsInput) (*GetChannelsOutput, error) { + req, out := c.GetChannelsRequest(input) return out, req.Send() } -// GetSegmentWithContext is the same as GetSegment with the addition of +// GetChannelsWithContext is the same as GetChannels with the addition of // the ability to pass a context and additional request options. // -// See GetSegment for details on how to use this API operation. +// See GetChannels for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetSegmentWithContext(ctx aws.Context, input *GetSegmentInput, opts ...request.Option) (*GetSegmentOutput, error) { - req, out := c.GetSegmentRequest(input) +func (c *Pinpoint) GetChannelsWithContext(ctx aws.Context, input *GetChannelsInput, opts ...request.Option) (*GetChannelsOutput, error) { + req, out := c.GetChannelsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetSegmentExportJobs = "GetSegmentExportJobs" +const opGetEmailChannel = "GetEmailChannel" -// GetSegmentExportJobsRequest generates a "aws/request.Request" representing the -// client's request for the GetSegmentExportJobs operation. The "output" return +// GetEmailChannelRequest generates a "aws/request.Request" representing the +// client's request for the GetEmailChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetSegmentExportJobs for more information on using the GetSegmentExportJobs +// See GetEmailChannel for more information on using the GetEmailChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetSegmentExportJobsRequest method. -// req, resp := client.GetSegmentExportJobsRequest(params) +// // Example sending a request using the GetEmailChannelRequest method. +// req, resp := client.GetEmailChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentExportJobs -func (c *Pinpoint) GetSegmentExportJobsRequest(input *GetSegmentExportJobsInput) (req *request.Request, output *GetSegmentExportJobsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetEmailChannel +func (c *Pinpoint) GetEmailChannelRequest(input *GetEmailChannelInput) (req *request.Request, output *GetEmailChannelOutput) { op := &request.Operation{ - Name: opGetSegmentExportJobs, + Name: opGetEmailChannel, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/segments/{segment-id}/jobs/export", + HTTPPath: "/v1/apps/{application-id}/channels/email", } if input == nil { - input = &GetSegmentExportJobsInput{} + input = &GetEmailChannelInput{} } - output = &GetSegmentExportJobsOutput{} + output = &GetEmailChannelOutput{} req = c.newRequest(op, input, output) return } -// GetSegmentExportJobs API operation for Amazon Pinpoint. +// GetEmailChannel API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of the export jobs for -// a segment. +// Retrieves information about the status and settings of the email channel +// 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 Amazon Pinpoint's -// API operation GetSegmentExportJobs for usage and error information. +// API operation GetEmailChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentExportJobs -func (c *Pinpoint) GetSegmentExportJobs(input *GetSegmentExportJobsInput) (*GetSegmentExportJobsOutput, error) { - req, out := c.GetSegmentExportJobsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetEmailChannel +func (c *Pinpoint) GetEmailChannel(input *GetEmailChannelInput) (*GetEmailChannelOutput, error) { + req, out := c.GetEmailChannelRequest(input) return out, req.Send() } -// GetSegmentExportJobsWithContext is the same as GetSegmentExportJobs with the addition of +// GetEmailChannelWithContext is the same as GetEmailChannel with the addition of // the ability to pass a context and additional request options. // -// See GetSegmentExportJobs for details on how to use this API operation. +// See GetEmailChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetSegmentExportJobsWithContext(ctx aws.Context, input *GetSegmentExportJobsInput, opts ...request.Option) (*GetSegmentExportJobsOutput, error) { - req, out := c.GetSegmentExportJobsRequest(input) +func (c *Pinpoint) GetEmailChannelWithContext(ctx aws.Context, input *GetEmailChannelInput, opts ...request.Option) (*GetEmailChannelOutput, error) { + req, out := c.GetEmailChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetSegmentImportJobs = "GetSegmentImportJobs" +const opGetEmailTemplate = "GetEmailTemplate" -// GetSegmentImportJobsRequest generates a "aws/request.Request" representing the -// client's request for the GetSegmentImportJobs operation. The "output" return +// GetEmailTemplateRequest generates a "aws/request.Request" representing the +// client's request for the GetEmailTemplate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetSegmentImportJobs for more information on using the GetSegmentImportJobs +// See GetEmailTemplate for more information on using the GetEmailTemplate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetSegmentImportJobsRequest method. -// req, resp := client.GetSegmentImportJobsRequest(params) +// // Example sending a request using the GetEmailTemplateRequest method. +// req, resp := client.GetEmailTemplateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentImportJobs -func (c *Pinpoint) GetSegmentImportJobsRequest(input *GetSegmentImportJobsInput) (req *request.Request, output *GetSegmentImportJobsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetEmailTemplate +func (c *Pinpoint) GetEmailTemplateRequest(input *GetEmailTemplateInput) (req *request.Request, output *GetEmailTemplateOutput) { op := &request.Operation{ - Name: opGetSegmentImportJobs, + Name: opGetEmailTemplate, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/segments/{segment-id}/jobs/import", + HTTPPath: "/v1/templates/{template-name}/email", } if input == nil { - input = &GetSegmentImportJobsInput{} + input = &GetEmailTemplateInput{} } - output = &GetSegmentImportJobsOutput{} + output = &GetEmailTemplateOutput{} req = c.newRequest(op, input, output) return } -// GetSegmentImportJobs API operation for Amazon Pinpoint. +// GetEmailTemplate API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of the import jobs for -// a segment. +// Retrieves the content and settings of a message template for messages that +// are sent through the email channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation GetSegmentImportJobs for usage and error information. +// API operation GetEmailTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentImportJobs -func (c *Pinpoint) GetSegmentImportJobs(input *GetSegmentImportJobsInput) (*GetSegmentImportJobsOutput, error) { - req, out := c.GetSegmentImportJobsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetEmailTemplate +func (c *Pinpoint) GetEmailTemplate(input *GetEmailTemplateInput) (*GetEmailTemplateOutput, error) { + req, out := c.GetEmailTemplateRequest(input) return out, req.Send() } -// GetSegmentImportJobsWithContext is the same as GetSegmentImportJobs with the addition of +// GetEmailTemplateWithContext is the same as GetEmailTemplate with the addition of // the ability to pass a context and additional request options. // -// See GetSegmentImportJobs for details on how to use this API operation. +// See GetEmailTemplate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetSegmentImportJobsWithContext(ctx aws.Context, input *GetSegmentImportJobsInput, opts ...request.Option) (*GetSegmentImportJobsOutput, error) { - req, out := c.GetSegmentImportJobsRequest(input) +func (c *Pinpoint) GetEmailTemplateWithContext(ctx aws.Context, input *GetEmailTemplateInput, opts ...request.Option) (*GetEmailTemplateOutput, error) { + req, out := c.GetEmailTemplateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetSegmentVersion = "GetSegmentVersion" +const opGetEndpoint = "GetEndpoint" -// GetSegmentVersionRequest generates a "aws/request.Request" representing the -// client's request for the GetSegmentVersion operation. The "output" return +// GetEndpointRequest generates a "aws/request.Request" representing the +// client's request for the GetEndpoint operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetSegmentVersion for more information on using the GetSegmentVersion +// See GetEndpoint for more information on using the GetEndpoint // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetSegmentVersionRequest method. -// req, resp := client.GetSegmentVersionRequest(params) +// // Example sending a request using the GetEndpointRequest method. +// req, resp := client.GetEndpointRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentVersion -func (c *Pinpoint) GetSegmentVersionRequest(input *GetSegmentVersionInput) (req *request.Request, output *GetSegmentVersionOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetEndpoint +func (c *Pinpoint) GetEndpointRequest(input *GetEndpointInput) (req *request.Request, output *GetEndpointOutput) { op := &request.Operation{ - Name: opGetSegmentVersion, + Name: opGetEndpoint, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/segments/{segment-id}/versions/{version}", + HTTPPath: "/v1/apps/{application-id}/endpoints/{endpoint-id}", } if input == nil { - input = &GetSegmentVersionInput{} + input = &GetEndpointInput{} } - output = &GetSegmentVersionOutput{} + output = &GetEndpointOutput{} req = c.newRequest(op, input, output) return } -// GetSegmentVersion API operation for Amazon Pinpoint. +// GetEndpoint API operation for Amazon Pinpoint. // -// Retrieves information about the configuration, dimension, and other settings -// for a specific version of a segment that's associated with an application. +// Retrieves information about the settings and attributes of a specific endpoint +// 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 Amazon Pinpoint's -// API operation GetSegmentVersion for usage and error information. +// API operation GetEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentVersion -func (c *Pinpoint) GetSegmentVersion(input *GetSegmentVersionInput) (*GetSegmentVersionOutput, error) { - req, out := c.GetSegmentVersionRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetEndpoint +func (c *Pinpoint) GetEndpoint(input *GetEndpointInput) (*GetEndpointOutput, error) { + req, out := c.GetEndpointRequest(input) return out, req.Send() } -// GetSegmentVersionWithContext is the same as GetSegmentVersion with the addition of +// GetEndpointWithContext is the same as GetEndpoint with the addition of // the ability to pass a context and additional request options. // -// See GetSegmentVersion for details on how to use this API operation. +// See GetEndpoint for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetSegmentVersionWithContext(ctx aws.Context, input *GetSegmentVersionInput, opts ...request.Option) (*GetSegmentVersionOutput, error) { - req, out := c.GetSegmentVersionRequest(input) +func (c *Pinpoint) GetEndpointWithContext(ctx aws.Context, input *GetEndpointInput, opts ...request.Option) (*GetEndpointOutput, error) { + req, out := c.GetEndpointRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetSegmentVersions = "GetSegmentVersions" +const opGetEventStream = "GetEventStream" -// GetSegmentVersionsRequest generates a "aws/request.Request" representing the -// client's request for the GetSegmentVersions operation. The "output" return +// GetEventStreamRequest generates a "aws/request.Request" representing the +// client's request for the GetEventStream operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetSegmentVersions for more information on using the GetSegmentVersions +// See GetEventStream for more information on using the GetEventStream // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetSegmentVersionsRequest method. -// req, resp := client.GetSegmentVersionsRequest(params) +// // Example sending a request using the GetEventStreamRequest method. +// req, resp := client.GetEventStreamRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentVersions -func (c *Pinpoint) GetSegmentVersionsRequest(input *GetSegmentVersionsInput) (req *request.Request, output *GetSegmentVersionsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetEventStream +func (c *Pinpoint) GetEventStreamRequest(input *GetEventStreamInput) (req *request.Request, output *GetEventStreamOutput) { op := &request.Operation{ - Name: opGetSegmentVersions, + Name: opGetEventStream, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/segments/{segment-id}/versions", + HTTPPath: "/v1/apps/{application-id}/eventstream", } if input == nil { - input = &GetSegmentVersionsInput{} + input = &GetEventStreamInput{} } - output = &GetSegmentVersionsOutput{} + output = &GetEventStreamOutput{} req = c.newRequest(op, input, output) return } -// GetSegmentVersions API operation for Amazon Pinpoint. +// GetEventStream API operation for Amazon Pinpoint. // -// Retrieves information about the configuration, dimension, and other settings -// for all versions of a specific segment that's associated with an application. +// Retrieves information about the event stream 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 Amazon Pinpoint's -// API operation GetSegmentVersions for usage and error information. +// API operation GetEventStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentVersions -func (c *Pinpoint) GetSegmentVersions(input *GetSegmentVersionsInput) (*GetSegmentVersionsOutput, error) { - req, out := c.GetSegmentVersionsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetEventStream +func (c *Pinpoint) GetEventStream(input *GetEventStreamInput) (*GetEventStreamOutput, error) { + req, out := c.GetEventStreamRequest(input) return out, req.Send() } -// GetSegmentVersionsWithContext is the same as GetSegmentVersions with the addition of +// GetEventStreamWithContext is the same as GetEventStream with the addition of // the ability to pass a context and additional request options. // -// See GetSegmentVersions for details on how to use this API operation. +// See GetEventStream for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetSegmentVersionsWithContext(ctx aws.Context, input *GetSegmentVersionsInput, opts ...request.Option) (*GetSegmentVersionsOutput, error) { - req, out := c.GetSegmentVersionsRequest(input) +func (c *Pinpoint) GetEventStreamWithContext(ctx aws.Context, input *GetEventStreamInput, opts ...request.Option) (*GetEventStreamOutput, error) { + req, out := c.GetEventStreamRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetSegments = "GetSegments" +const opGetExportJob = "GetExportJob" -// GetSegmentsRequest generates a "aws/request.Request" representing the -// client's request for the GetSegments operation. The "output" return +// GetExportJobRequest generates a "aws/request.Request" representing the +// client's request for the GetExportJob operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetSegments for more information on using the GetSegments +// See GetExportJob for more information on using the GetExportJob // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetSegmentsRequest method. -// req, resp := client.GetSegmentsRequest(params) +// // Example sending a request using the GetExportJobRequest method. +// req, resp := client.GetExportJobRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegments -func (c *Pinpoint) GetSegmentsRequest(input *GetSegmentsInput) (req *request.Request, output *GetSegmentsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetExportJob +func (c *Pinpoint) GetExportJobRequest(input *GetExportJobInput) (req *request.Request, output *GetExportJobOutput) { op := &request.Operation{ - Name: opGetSegments, + Name: opGetExportJob, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/segments", + HTTPPath: "/v1/apps/{application-id}/jobs/export/{job-id}", } if input == nil { - input = &GetSegmentsInput{} + input = &GetExportJobInput{} } - output = &GetSegmentsOutput{} + output = &GetExportJobOutput{} req = c.newRequest(op, input, output) return } -// GetSegments API operation for Amazon Pinpoint. +// GetExportJob API operation for Amazon Pinpoint. // -// Retrieves information about the configuration, dimension, and other settings -// for all the segments that are associated with an application. +// Retrieves information about the status and settings of a specific export +// job 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 Amazon Pinpoint's -// API operation GetSegments for usage and error information. +// API operation GetExportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegments -func (c *Pinpoint) GetSegments(input *GetSegmentsInput) (*GetSegmentsOutput, error) { - req, out := c.GetSegmentsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetExportJob +func (c *Pinpoint) GetExportJob(input *GetExportJobInput) (*GetExportJobOutput, error) { + req, out := c.GetExportJobRequest(input) return out, req.Send() } -// GetSegmentsWithContext is the same as GetSegments with the addition of +// GetExportJobWithContext is the same as GetExportJob with the addition of // the ability to pass a context and additional request options. // -// See GetSegments for details on how to use this API operation. +// See GetExportJob for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetSegmentsWithContext(ctx aws.Context, input *GetSegmentsInput, opts ...request.Option) (*GetSegmentsOutput, error) { - req, out := c.GetSegmentsRequest(input) +func (c *Pinpoint) GetExportJobWithContext(ctx aws.Context, input *GetExportJobInput, opts ...request.Option) (*GetExportJobOutput, error) { + req, out := c.GetExportJobRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetSmsChannel = "GetSmsChannel" +const opGetExportJobs = "GetExportJobs" -// GetSmsChannelRequest generates a "aws/request.Request" representing the -// client's request for the GetSmsChannel operation. The "output" return +// GetExportJobsRequest generates a "aws/request.Request" representing the +// client's request for the GetExportJobs operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetSmsChannel for more information on using the GetSmsChannel +// See GetExportJobs for more information on using the GetExportJobs // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetSmsChannelRequest method. -// req, resp := client.GetSmsChannelRequest(params) +// // Example sending a request using the GetExportJobsRequest method. +// req, resp := client.GetExportJobsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSmsChannel -func (c *Pinpoint) GetSmsChannelRequest(input *GetSmsChannelInput) (req *request.Request, output *GetSmsChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetExportJobs +func (c *Pinpoint) GetExportJobsRequest(input *GetExportJobsInput) (req *request.Request, output *GetExportJobsOutput) { op := &request.Operation{ - Name: opGetSmsChannel, + Name: opGetExportJobs, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/channels/sms", + HTTPPath: "/v1/apps/{application-id}/jobs/export", } if input == nil { - input = &GetSmsChannelInput{} + input = &GetExportJobsInput{} } - output = &GetSmsChannelOutput{} + output = &GetExportJobsOutput{} req = c.newRequest(op, input, output) return } -// GetSmsChannel API operation for Amazon Pinpoint. +// GetExportJobs API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of the SMS channel for -// an application. +// Retrieves information about the status and settings of all the export jobs +// 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 Amazon Pinpoint's -// API operation GetSmsChannel for usage and error information. +// API operation GetExportJobs for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSmsChannel -func (c *Pinpoint) GetSmsChannel(input *GetSmsChannelInput) (*GetSmsChannelOutput, error) { - req, out := c.GetSmsChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetExportJobs +func (c *Pinpoint) GetExportJobs(input *GetExportJobsInput) (*GetExportJobsOutput, error) { + req, out := c.GetExportJobsRequest(input) return out, req.Send() } -// GetSmsChannelWithContext is the same as GetSmsChannel with the addition of +// GetExportJobsWithContext is the same as GetExportJobs with the addition of // the ability to pass a context and additional request options. // -// See GetSmsChannel for details on how to use this API operation. +// See GetExportJobs for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetSmsChannelWithContext(ctx aws.Context, input *GetSmsChannelInput, opts ...request.Option) (*GetSmsChannelOutput, error) { - req, out := c.GetSmsChannelRequest(input) +func (c *Pinpoint) GetExportJobsWithContext(ctx aws.Context, input *GetExportJobsInput, opts ...request.Option) (*GetExportJobsOutput, error) { + req, out := c.GetExportJobsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetUserEndpoints = "GetUserEndpoints" +const opGetGcmChannel = "GetGcmChannel" -// GetUserEndpointsRequest generates a "aws/request.Request" representing the -// client's request for the GetUserEndpoints operation. The "output" return +// GetGcmChannelRequest generates a "aws/request.Request" representing the +// client's request for the GetGcmChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetUserEndpoints for more information on using the GetUserEndpoints +// See GetGcmChannel for more information on using the GetGcmChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetUserEndpointsRequest method. -// req, resp := client.GetUserEndpointsRequest(params) +// // Example sending a request using the GetGcmChannelRequest method. +// req, resp := client.GetGcmChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetUserEndpoints -func (c *Pinpoint) GetUserEndpointsRequest(input *GetUserEndpointsInput) (req *request.Request, output *GetUserEndpointsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetGcmChannel +func (c *Pinpoint) GetGcmChannelRequest(input *GetGcmChannelInput) (req *request.Request, output *GetGcmChannelOutput) { op := &request.Operation{ - Name: opGetUserEndpoints, + Name: opGetGcmChannel, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/users/{user-id}", + HTTPPath: "/v1/apps/{application-id}/channels/gcm", } if input == nil { - input = &GetUserEndpointsInput{} + input = &GetGcmChannelInput{} } - output = &GetUserEndpointsOutput{} + output = &GetGcmChannelOutput{} req = c.newRequest(op, input, output) return } -// GetUserEndpoints API operation for Amazon Pinpoint. +// GetGcmChannel API operation for Amazon Pinpoint. // -// Retrieves information about all the endpoints that are associated with a -// specific user ID. +// Retrieves information about the status and settings of the GCM channel 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 Amazon Pinpoint's -// API operation GetUserEndpoints for usage and error information. +// API operation GetGcmChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetUserEndpoints -func (c *Pinpoint) GetUserEndpoints(input *GetUserEndpointsInput) (*GetUserEndpointsOutput, error) { - req, out := c.GetUserEndpointsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetGcmChannel +func (c *Pinpoint) GetGcmChannel(input *GetGcmChannelInput) (*GetGcmChannelOutput, error) { + req, out := c.GetGcmChannelRequest(input) return out, req.Send() } -// GetUserEndpointsWithContext is the same as GetUserEndpoints with the addition of +// GetGcmChannelWithContext is the same as GetGcmChannel with the addition of // the ability to pass a context and additional request options. // -// See GetUserEndpoints for details on how to use this API operation. +// See GetGcmChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetUserEndpointsWithContext(ctx aws.Context, input *GetUserEndpointsInput, opts ...request.Option) (*GetUserEndpointsOutput, error) { - req, out := c.GetUserEndpointsRequest(input) +func (c *Pinpoint) GetGcmChannelWithContext(ctx aws.Context, input *GetGcmChannelInput, opts ...request.Option) (*GetGcmChannelOutput, error) { + req, out := c.GetGcmChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetVoiceChannel = "GetVoiceChannel" +const opGetImportJob = "GetImportJob" -// GetVoiceChannelRequest generates a "aws/request.Request" representing the -// client's request for the GetVoiceChannel operation. The "output" return +// GetImportJobRequest generates a "aws/request.Request" representing the +// client's request for the GetImportJob operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetVoiceChannel for more information on using the GetVoiceChannel +// See GetImportJob for more information on using the GetImportJob // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetVoiceChannelRequest method. -// req, resp := client.GetVoiceChannelRequest(params) +// // Example sending a request using the GetImportJobRequest method. +// req, resp := client.GetImportJobRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetVoiceChannel -func (c *Pinpoint) GetVoiceChannelRequest(input *GetVoiceChannelInput) (req *request.Request, output *GetVoiceChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetImportJob +func (c *Pinpoint) GetImportJobRequest(input *GetImportJobInput) (req *request.Request, output *GetImportJobOutput) { op := &request.Operation{ - Name: opGetVoiceChannel, + Name: opGetImportJob, HTTPMethod: "GET", - HTTPPath: "/v1/apps/{application-id}/channels/voice", + HTTPPath: "/v1/apps/{application-id}/jobs/import/{job-id}", } if input == nil { - input = &GetVoiceChannelInput{} + input = &GetImportJobInput{} } - output = &GetVoiceChannelOutput{} + output = &GetImportJobOutput{} req = c.newRequest(op, input, output) return } -// GetVoiceChannel API operation for Amazon Pinpoint. +// GetImportJob API operation for Amazon Pinpoint. // -// Retrieves information about the status and settings of the voice channel -// for an application. +// Retrieves information about the status and settings of a specific import +// job 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 Amazon Pinpoint's -// API operation GetVoiceChannel for usage and error information. +// API operation GetImportJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetVoiceChannel -func (c *Pinpoint) GetVoiceChannel(input *GetVoiceChannelInput) (*GetVoiceChannelOutput, error) { - req, out := c.GetVoiceChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetImportJob +func (c *Pinpoint) GetImportJob(input *GetImportJobInput) (*GetImportJobOutput, error) { + req, out := c.GetImportJobRequest(input) return out, req.Send() } -// GetVoiceChannelWithContext is the same as GetVoiceChannel with the addition of +// GetImportJobWithContext is the same as GetImportJob with the addition of // the ability to pass a context and additional request options. // -// See GetVoiceChannel for details on how to use this API operation. +// See GetImportJob for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) GetVoiceChannelWithContext(ctx aws.Context, input *GetVoiceChannelInput, opts ...request.Option) (*GetVoiceChannelOutput, error) { - req, out := c.GetVoiceChannelRequest(input) +func (c *Pinpoint) GetImportJobWithContext(ctx aws.Context, input *GetImportJobInput, opts ...request.Option) (*GetImportJobOutput, error) { + req, out := c.GetImportJobRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListTagsForResource = "ListTagsForResource" +const opGetImportJobs = "GetImportJobs" -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource operation. The "output" return +// GetImportJobsRequest generates a "aws/request.Request" representing the +// client's request for the GetImportJobs operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListTagsForResource for more information on using the ListTagsForResource +// See GetImportJobs for more information on using the GetImportJobs // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) +// // Example sending a request using the GetImportJobsRequest method. +// req, resp := client.GetImportJobsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/ListTagsForResource -func (c *Pinpoint) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetImportJobs +func (c *Pinpoint) GetImportJobsRequest(input *GetImportJobsInput) (req *request.Request, output *GetImportJobsOutput) { op := &request.Operation{ - Name: opListTagsForResource, + Name: opGetImportJobs, HTTPMethod: "GET", - HTTPPath: "/v1/tags/{resource-arn}", + HTTPPath: "/v1/apps/{application-id}/jobs/import", } if input == nil { - input = &ListTagsForResourceInput{} + input = &GetImportJobsInput{} } - output = &ListTagsForResourceOutput{} + output = &GetImportJobsOutput{} req = c.newRequest(op, input, output) return } -// ListTagsForResource API operation for Amazon Pinpoint. +// GetImportJobs API operation for Amazon Pinpoint. // -// Retrieves all the tags (keys and values) that are associated with an application, -// campaign, or segment. +// Retrieves information about the status and settings of all the import jobs +// 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 Amazon Pinpoint's -// API operation ListTagsForResource for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/ListTagsForResource -func (c *Pinpoint) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) +// API operation GetImportJobs for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetImportJobs +func (c *Pinpoint) GetImportJobs(input *GetImportJobsInput) (*GetImportJobsOutput, error) { + req, out := c.GetImportJobsRequest(input) return out, req.Send() } -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// GetImportJobsWithContext is the same as GetImportJobs with the addition of // the ability to pass a context and additional request options. // -// See ListTagsForResource for details on how to use this API operation. +// See GetImportJobs for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) +func (c *Pinpoint) GetImportJobsWithContext(ctx aws.Context, input *GetImportJobsInput, opts ...request.Option) (*GetImportJobsOutput, error) { + req, out := c.GetImportJobsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPhoneNumberValidate = "PhoneNumberValidate" +const opGetJourney = "GetJourney" -// PhoneNumberValidateRequest generates a "aws/request.Request" representing the -// client's request for the PhoneNumberValidate operation. The "output" return +// GetJourneyRequest generates a "aws/request.Request" representing the +// client's request for the GetJourney operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PhoneNumberValidate for more information on using the PhoneNumberValidate +// See GetJourney for more information on using the GetJourney // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PhoneNumberValidateRequest method. -// req, resp := client.PhoneNumberValidateRequest(params) +// // Example sending a request using the GetJourneyRequest method. +// req, resp := client.GetJourneyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/PhoneNumberValidate -func (c *Pinpoint) PhoneNumberValidateRequest(input *PhoneNumberValidateInput) (req *request.Request, output *PhoneNumberValidateOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetJourney +func (c *Pinpoint) GetJourneyRequest(input *GetJourneyInput) (req *request.Request, output *GetJourneyOutput) { op := &request.Operation{ - Name: opPhoneNumberValidate, - HTTPMethod: "POST", - HTTPPath: "/v1/phone/number/validate", + Name: opGetJourney, + HTTPMethod: "GET", + HTTPPath: "/v1/apps/{application-id}/journeys/{journey-id}", } if input == nil { - input = &PhoneNumberValidateInput{} + input = &GetJourneyInput{} } - output = &PhoneNumberValidateOutput{} + output = &GetJourneyOutput{} req = c.newRequest(op, input, output) return } -// PhoneNumberValidate API operation for Amazon Pinpoint. +// GetJourney API operation for Amazon Pinpoint. // -// Retrieves information about a phone number. +// Retrieves information about the status, configuration, and other settings +// for a journey. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation PhoneNumberValidate for usage and error information. +// API operation GetJourney for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/PhoneNumberValidate -func (c *Pinpoint) PhoneNumberValidate(input *PhoneNumberValidateInput) (*PhoneNumberValidateOutput, error) { - req, out := c.PhoneNumberValidateRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetJourney +func (c *Pinpoint) GetJourney(input *GetJourneyInput) (*GetJourneyOutput, error) { + req, out := c.GetJourneyRequest(input) return out, req.Send() } -// PhoneNumberValidateWithContext is the same as PhoneNumberValidate with the addition of +// GetJourneyWithContext is the same as GetJourney with the addition of // the ability to pass a context and additional request options. // -// See PhoneNumberValidate for details on how to use this API operation. +// See GetJourney for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) PhoneNumberValidateWithContext(ctx aws.Context, input *PhoneNumberValidateInput, opts ...request.Option) (*PhoneNumberValidateOutput, error) { - req, out := c.PhoneNumberValidateRequest(input) +func (c *Pinpoint) GetJourneyWithContext(ctx aws.Context, input *GetJourneyInput, opts ...request.Option) (*GetJourneyOutput, error) { + req, out := c.GetJourneyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPutEventStream = "PutEventStream" +const opGetJourneyDateRangeKpi = "GetJourneyDateRangeKpi" -// PutEventStreamRequest generates a "aws/request.Request" representing the -// client's request for the PutEventStream operation. The "output" return +// GetJourneyDateRangeKpiRequest generates a "aws/request.Request" representing the +// client's request for the GetJourneyDateRangeKpi operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutEventStream for more information on using the PutEventStream +// See GetJourneyDateRangeKpi for more information on using the GetJourneyDateRangeKpi // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutEventStreamRequest method. -// req, resp := client.PutEventStreamRequest(params) +// // Example sending a request using the GetJourneyDateRangeKpiRequest method. +// req, resp := client.GetJourneyDateRangeKpiRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/PutEventStream -func (c *Pinpoint) PutEventStreamRequest(input *PutEventStreamInput) (req *request.Request, output *PutEventStreamOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetJourneyDateRangeKpi +func (c *Pinpoint) GetJourneyDateRangeKpiRequest(input *GetJourneyDateRangeKpiInput) (req *request.Request, output *GetJourneyDateRangeKpiOutput) { op := &request.Operation{ - Name: opPutEventStream, - HTTPMethod: "POST", - HTTPPath: "/v1/apps/{application-id}/eventstream", + Name: opGetJourneyDateRangeKpi, + HTTPMethod: "GET", + HTTPPath: "/v1/apps/{application-id}/journeys/{journey-id}/kpis/daterange/{kpi-name}", } if input == nil { - input = &PutEventStreamInput{} + input = &GetJourneyDateRangeKpiInput{} } - output = &PutEventStreamOutput{} + output = &GetJourneyDateRangeKpiOutput{} req = c.newRequest(op, input, output) return } -// PutEventStream API operation for Amazon Pinpoint. +// GetJourneyDateRangeKpi API operation for Amazon Pinpoint. // -// Creates a new event stream for an application or updates the settings of -// an existing event stream for an application. +// Retrieves (queries) pre-aggregated data for a standard engagement metric +// that applies to a journey. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation PutEventStream for usage and error information. +// API operation GetJourneyDateRangeKpi for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/PutEventStream -func (c *Pinpoint) PutEventStream(input *PutEventStreamInput) (*PutEventStreamOutput, error) { - req, out := c.PutEventStreamRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetJourneyDateRangeKpi +func (c *Pinpoint) GetJourneyDateRangeKpi(input *GetJourneyDateRangeKpiInput) (*GetJourneyDateRangeKpiOutput, error) { + req, out := c.GetJourneyDateRangeKpiRequest(input) return out, req.Send() } -// PutEventStreamWithContext is the same as PutEventStream with the addition of +// GetJourneyDateRangeKpiWithContext is the same as GetJourneyDateRangeKpi with the addition of // the ability to pass a context and additional request options. // -// See PutEventStream for details on how to use this API operation. +// See GetJourneyDateRangeKpi for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) PutEventStreamWithContext(ctx aws.Context, input *PutEventStreamInput, opts ...request.Option) (*PutEventStreamOutput, error) { - req, out := c.PutEventStreamRequest(input) +func (c *Pinpoint) GetJourneyDateRangeKpiWithContext(ctx aws.Context, input *GetJourneyDateRangeKpiInput, opts ...request.Option) (*GetJourneyDateRangeKpiOutput, error) { + req, out := c.GetJourneyDateRangeKpiRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opPutEvents = "PutEvents" +const opGetJourneyExecutionActivityMetrics = "GetJourneyExecutionActivityMetrics" -// PutEventsRequest generates a "aws/request.Request" representing the -// client's request for the PutEvents operation. The "output" return +// GetJourneyExecutionActivityMetricsRequest generates a "aws/request.Request" representing the +// client's request for the GetJourneyExecutionActivityMetrics operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutEvents for more information on using the PutEvents +// See GetJourneyExecutionActivityMetrics for more information on using the GetJourneyExecutionActivityMetrics // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutEventsRequest method. -// req, resp := client.PutEventsRequest(params) +// // Example sending a request using the GetJourneyExecutionActivityMetricsRequest method. +// req, resp := client.GetJourneyExecutionActivityMetricsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/PutEvents -func (c *Pinpoint) PutEventsRequest(input *PutEventsInput) (req *request.Request, output *PutEventsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetJourneyExecutionActivityMetrics +func (c *Pinpoint) GetJourneyExecutionActivityMetricsRequest(input *GetJourneyExecutionActivityMetricsInput) (req *request.Request, output *GetJourneyExecutionActivityMetricsOutput) { op := &request.Operation{ - Name: opPutEvents, - HTTPMethod: "POST", - HTTPPath: "/v1/apps/{application-id}/events", + Name: opGetJourneyExecutionActivityMetrics, + HTTPMethod: "GET", + HTTPPath: "/v1/apps/{application-id}/journeys/{journey-id}/activities/{journey-activity-id}/execution-metrics", } if input == nil { - input = &PutEventsInput{} + input = &GetJourneyExecutionActivityMetricsInput{} } - output = &PutEventsOutput{} + output = &GetJourneyExecutionActivityMetricsOutput{} req = c.newRequest(op, input, output) return } -// PutEvents API operation for Amazon Pinpoint. +// GetJourneyExecutionActivityMetrics API operation for Amazon Pinpoint. // -// Creates a new event to record for endpoints, or creates or updates endpoint -// data that existing events are associated with. +// Retrieves (queries) pre-aggregated data for a standard execution metric that +// applies to a journey 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 Amazon Pinpoint's -// API operation PutEvents for usage and error information. +// API operation GetJourneyExecutionActivityMetrics for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/PutEvents -func (c *Pinpoint) PutEvents(input *PutEventsInput) (*PutEventsOutput, error) { - req, out := c.PutEventsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetJourneyExecutionActivityMetrics +func (c *Pinpoint) GetJourneyExecutionActivityMetrics(input *GetJourneyExecutionActivityMetricsInput) (*GetJourneyExecutionActivityMetricsOutput, error) { + req, out := c.GetJourneyExecutionActivityMetricsRequest(input) return out, req.Send() } -// PutEventsWithContext is the same as PutEvents with the addition of +// GetJourneyExecutionActivityMetricsWithContext is the same as GetJourneyExecutionActivityMetrics with the addition of // the ability to pass a context and additional request options. // -// See PutEvents for details on how to use this API operation. +// See GetJourneyExecutionActivityMetrics for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) PutEventsWithContext(ctx aws.Context, input *PutEventsInput, opts ...request.Option) (*PutEventsOutput, error) { - req, out := c.PutEventsRequest(input) +func (c *Pinpoint) GetJourneyExecutionActivityMetricsWithContext(ctx aws.Context, input *GetJourneyExecutionActivityMetricsInput, opts ...request.Option) (*GetJourneyExecutionActivityMetricsOutput, error) { + req, out := c.GetJourneyExecutionActivityMetricsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRemoveAttributes = "RemoveAttributes" +const opGetJourneyExecutionMetrics = "GetJourneyExecutionMetrics" -// RemoveAttributesRequest generates a "aws/request.Request" representing the -// client's request for the RemoveAttributes operation. The "output" return +// GetJourneyExecutionMetricsRequest generates a "aws/request.Request" representing the +// client's request for the GetJourneyExecutionMetrics operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RemoveAttributes for more information on using the RemoveAttributes +// See GetJourneyExecutionMetrics for more information on using the GetJourneyExecutionMetrics // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RemoveAttributesRequest method. -// req, resp := client.RemoveAttributesRequest(params) +// // Example sending a request using the GetJourneyExecutionMetricsRequest method. +// req, resp := client.GetJourneyExecutionMetricsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/RemoveAttributes -func (c *Pinpoint) RemoveAttributesRequest(input *RemoveAttributesInput) (req *request.Request, output *RemoveAttributesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetJourneyExecutionMetrics +func (c *Pinpoint) GetJourneyExecutionMetricsRequest(input *GetJourneyExecutionMetricsInput) (req *request.Request, output *GetJourneyExecutionMetricsOutput) { op := &request.Operation{ - Name: opRemoveAttributes, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/attributes/{attribute-type}", + Name: opGetJourneyExecutionMetrics, + HTTPMethod: "GET", + HTTPPath: "/v1/apps/{application-id}/journeys/{journey-id}/execution-metrics", } if input == nil { - input = &RemoveAttributesInput{} + input = &GetJourneyExecutionMetricsInput{} } - output = &RemoveAttributesOutput{} + output = &GetJourneyExecutionMetricsOutput{} req = c.newRequest(op, input, output) return } -// RemoveAttributes API operation for Amazon Pinpoint. +// GetJourneyExecutionMetrics API operation for Amazon Pinpoint. // -// Removes one or more attributes, of the same attribute type, from all the -// endpoints that are associated with an application. +// Retrieves (queries) pre-aggregated data for a standard execution metric that +// applies to a journey. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation RemoveAttributes for usage and error information. +// API operation GetJourneyExecutionMetrics for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/RemoveAttributes -func (c *Pinpoint) RemoveAttributes(input *RemoveAttributesInput) (*RemoveAttributesOutput, error) { - req, out := c.RemoveAttributesRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetJourneyExecutionMetrics +func (c *Pinpoint) GetJourneyExecutionMetrics(input *GetJourneyExecutionMetricsInput) (*GetJourneyExecutionMetricsOutput, error) { + req, out := c.GetJourneyExecutionMetricsRequest(input) return out, req.Send() } -// RemoveAttributesWithContext is the same as RemoveAttributes with the addition of +// GetJourneyExecutionMetricsWithContext is the same as GetJourneyExecutionMetrics with the addition of // the ability to pass a context and additional request options. // -// See RemoveAttributes for details on how to use this API operation. +// See GetJourneyExecutionMetrics for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) RemoveAttributesWithContext(ctx aws.Context, input *RemoveAttributesInput, opts ...request.Option) (*RemoveAttributesOutput, error) { - req, out := c.RemoveAttributesRequest(input) +func (c *Pinpoint) GetJourneyExecutionMetricsWithContext(ctx aws.Context, input *GetJourneyExecutionMetricsInput, opts ...request.Option) (*GetJourneyExecutionMetricsOutput, error) { + req, out := c.GetJourneyExecutionMetricsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opSendMessages = "SendMessages" +const opGetPushTemplate = "GetPushTemplate" -// SendMessagesRequest generates a "aws/request.Request" representing the -// client's request for the SendMessages operation. The "output" return +// GetPushTemplateRequest generates a "aws/request.Request" representing the +// client's request for the GetPushTemplate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See SendMessages for more information on using the SendMessages +// See GetPushTemplate for more information on using the GetPushTemplate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the SendMessagesRequest method. -// req, resp := client.SendMessagesRequest(params) +// // Example sending a request using the GetPushTemplateRequest method. +// req, resp := client.GetPushTemplateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/SendMessages -func (c *Pinpoint) SendMessagesRequest(input *SendMessagesInput) (req *request.Request, output *SendMessagesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetPushTemplate +func (c *Pinpoint) GetPushTemplateRequest(input *GetPushTemplateInput) (req *request.Request, output *GetPushTemplateOutput) { op := &request.Operation{ - Name: opSendMessages, - HTTPMethod: "POST", - HTTPPath: "/v1/apps/{application-id}/messages", + Name: opGetPushTemplate, + HTTPMethod: "GET", + HTTPPath: "/v1/templates/{template-name}/push", } if input == nil { - input = &SendMessagesInput{} + input = &GetPushTemplateInput{} } - output = &SendMessagesOutput{} + output = &GetPushTemplateOutput{} req = c.newRequest(op, input, output) return } -// SendMessages API operation for Amazon Pinpoint. +// GetPushTemplate API operation for Amazon Pinpoint. // -// Creates and sends a direct message. +// Retrieves the content and settings of a message template for messages that +// are sent through a push notification channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation SendMessages for usage and error information. +// API operation GetPushTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/SendMessages -func (c *Pinpoint) SendMessages(input *SendMessagesInput) (*SendMessagesOutput, error) { - req, out := c.SendMessagesRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetPushTemplate +func (c *Pinpoint) GetPushTemplate(input *GetPushTemplateInput) (*GetPushTemplateOutput, error) { + req, out := c.GetPushTemplateRequest(input) return out, req.Send() } -// SendMessagesWithContext is the same as SendMessages with the addition of +// GetPushTemplateWithContext is the same as GetPushTemplate with the addition of // the ability to pass a context and additional request options. // -// See SendMessages for details on how to use this API operation. +// See GetPushTemplate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) SendMessagesWithContext(ctx aws.Context, input *SendMessagesInput, opts ...request.Option) (*SendMessagesOutput, error) { - req, out := c.SendMessagesRequest(input) +func (c *Pinpoint) GetPushTemplateWithContext(ctx aws.Context, input *GetPushTemplateInput, opts ...request.Option) (*GetPushTemplateOutput, error) { + req, out := c.GetPushTemplateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opSendUsersMessages = "SendUsersMessages" +const opGetSegment = "GetSegment" -// SendUsersMessagesRequest generates a "aws/request.Request" representing the -// client's request for the SendUsersMessages operation. The "output" return +// GetSegmentRequest generates a "aws/request.Request" representing the +// client's request for the GetSegment operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See SendUsersMessages for more information on using the SendUsersMessages +// See GetSegment for more information on using the GetSegment // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the SendUsersMessagesRequest method. -// req, resp := client.SendUsersMessagesRequest(params) +// // Example sending a request using the GetSegmentRequest method. +// req, resp := client.GetSegmentRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/SendUsersMessages -func (c *Pinpoint) SendUsersMessagesRequest(input *SendUsersMessagesInput) (req *request.Request, output *SendUsersMessagesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegment +func (c *Pinpoint) GetSegmentRequest(input *GetSegmentInput) (req *request.Request, output *GetSegmentOutput) { op := &request.Operation{ - Name: opSendUsersMessages, - HTTPMethod: "POST", - HTTPPath: "/v1/apps/{application-id}/users-messages", + Name: opGetSegment, + HTTPMethod: "GET", + HTTPPath: "/v1/apps/{application-id}/segments/{segment-id}", } if input == nil { - input = &SendUsersMessagesInput{} + input = &GetSegmentInput{} } - output = &SendUsersMessagesOutput{} + output = &GetSegmentOutput{} req = c.newRequest(op, input, output) return } -// SendUsersMessages API operation for Amazon Pinpoint. +// GetSegment API operation for Amazon Pinpoint. // -// Creates and sends a message to a list of users. +// Retrieves information about the configuration, dimension, and other settings +// for a specific segment that's associated with 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 Amazon Pinpoint's -// API operation SendUsersMessages for usage and error information. +// API operation GetSegment for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/SendUsersMessages -func (c *Pinpoint) SendUsersMessages(input *SendUsersMessagesInput) (*SendUsersMessagesOutput, error) { - req, out := c.SendUsersMessagesRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegment +func (c *Pinpoint) GetSegment(input *GetSegmentInput) (*GetSegmentOutput, error) { + req, out := c.GetSegmentRequest(input) return out, req.Send() } -// SendUsersMessagesWithContext is the same as SendUsersMessages with the addition of +// GetSegmentWithContext is the same as GetSegment with the addition of // the ability to pass a context and additional request options. // -// See SendUsersMessages for details on how to use this API operation. +// See GetSegment for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) SendUsersMessagesWithContext(ctx aws.Context, input *SendUsersMessagesInput, opts ...request.Option) (*SendUsersMessagesOutput, error) { - req, out := c.SendUsersMessagesRequest(input) +func (c *Pinpoint) GetSegmentWithContext(ctx aws.Context, input *GetSegmentInput, opts ...request.Option) (*GetSegmentOutput, error) { + req, out := c.GetSegmentRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opTagResource = "TagResource" +const opGetSegmentExportJobs = "GetSegmentExportJobs" -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource operation. The "output" return +// GetSegmentExportJobsRequest generates a "aws/request.Request" representing the +// client's request for the GetSegmentExportJobs operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See TagResource for more information on using the TagResource +// See GetSegmentExportJobs for more information on using the GetSegmentExportJobs // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) +// // Example sending a request using the GetSegmentExportJobsRequest method. +// req, resp := client.GetSegmentExportJobsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/TagResource -func (c *Pinpoint) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentExportJobs +func (c *Pinpoint) GetSegmentExportJobsRequest(input *GetSegmentExportJobsInput) (req *request.Request, output *GetSegmentExportJobsOutput) { op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/v1/tags/{resource-arn}", + Name: opGetSegmentExportJobs, + HTTPMethod: "GET", + HTTPPath: "/v1/apps/{application-id}/segments/{segment-id}/jobs/export", } if input == nil { - input = &TagResourceInput{} + input = &GetSegmentExportJobsInput{} } - output = &TagResourceOutput{} + output = &GetSegmentExportJobsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// TagResource API operation for Amazon Pinpoint. +// GetSegmentExportJobs API operation for Amazon Pinpoint. // -// Adds one or more tags (keys and values) to an application, campaign, or segment. +// Retrieves information about the status and settings of the export jobs for +// a segment. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation TagResource for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/TagResource -func (c *Pinpoint) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) +// API operation GetSegmentExportJobs for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentExportJobs +func (c *Pinpoint) GetSegmentExportJobs(input *GetSegmentExportJobsInput) (*GetSegmentExportJobsOutput, error) { + req, out := c.GetSegmentExportJobsRequest(input) return out, req.Send() } -// TagResourceWithContext is the same as TagResource with the addition of +// GetSegmentExportJobsWithContext is the same as GetSegmentExportJobs with the addition of // the ability to pass a context and additional request options. // -// See TagResource for details on how to use this API operation. +// See GetSegmentExportJobs for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) +func (c *Pinpoint) GetSegmentExportJobsWithContext(ctx aws.Context, input *GetSegmentExportJobsInput, opts ...request.Option) (*GetSegmentExportJobsOutput, error) { + req, out := c.GetSegmentExportJobsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUntagResource = "UntagResource" +const opGetSegmentImportJobs = "GetSegmentImportJobs" -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource operation. The "output" return +// GetSegmentImportJobsRequest generates a "aws/request.Request" representing the +// client's request for the GetSegmentImportJobs operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UntagResource for more information on using the UntagResource +// See GetSegmentImportJobs for more information on using the GetSegmentImportJobs // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) +// // Example sending a request using the GetSegmentImportJobsRequest method. +// req, resp := client.GetSegmentImportJobsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UntagResource -func (c *Pinpoint) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentImportJobs +func (c *Pinpoint) GetSegmentImportJobsRequest(input *GetSegmentImportJobsInput) (req *request.Request, output *GetSegmentImportJobsOutput) { op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "DELETE", - HTTPPath: "/v1/tags/{resource-arn}", + Name: opGetSegmentImportJobs, + HTTPMethod: "GET", + HTTPPath: "/v1/apps/{application-id}/segments/{segment-id}/jobs/import", } if input == nil { - input = &UntagResourceInput{} + input = &GetSegmentImportJobsInput{} } - output = &UntagResourceOutput{} + output = &GetSegmentImportJobsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UntagResource API operation for Amazon Pinpoint. +// GetSegmentImportJobs API operation for Amazon Pinpoint. // -// Removes one or more tags (keys and values) from an application, campaign, -// or segment. +// Retrieves information about the status and settings of the import jobs for +// a segment. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation UntagResource for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UntagResource -func (c *Pinpoint) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) +// API operation GetSegmentImportJobs for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentImportJobs +func (c *Pinpoint) GetSegmentImportJobs(input *GetSegmentImportJobsInput) (*GetSegmentImportJobsOutput, error) { + req, out := c.GetSegmentImportJobsRequest(input) return out, req.Send() } -// UntagResourceWithContext is the same as UntagResource with the addition of +// GetSegmentImportJobsWithContext is the same as GetSegmentImportJobs with the addition of // the ability to pass a context and additional request options. // -// See UntagResource for details on how to use this API operation. +// See GetSegmentImportJobs for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) +func (c *Pinpoint) GetSegmentImportJobsWithContext(ctx aws.Context, input *GetSegmentImportJobsInput, opts ...request.Option) (*GetSegmentImportJobsOutput, error) { + req, out := c.GetSegmentImportJobsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateAdmChannel = "UpdateAdmChannel" +const opGetSegmentVersion = "GetSegmentVersion" -// UpdateAdmChannelRequest generates a "aws/request.Request" representing the -// client's request for the UpdateAdmChannel operation. The "output" return +// GetSegmentVersionRequest generates a "aws/request.Request" representing the +// client's request for the GetSegmentVersion operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateAdmChannel for more information on using the UpdateAdmChannel +// See GetSegmentVersion for more information on using the GetSegmentVersion // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateAdmChannelRequest method. -// req, resp := client.UpdateAdmChannelRequest(params) +// // Example sending a request using the GetSegmentVersionRequest method. +// req, resp := client.GetSegmentVersionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateAdmChannel -func (c *Pinpoint) UpdateAdmChannelRequest(input *UpdateAdmChannelInput) (req *request.Request, output *UpdateAdmChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentVersion +func (c *Pinpoint) GetSegmentVersionRequest(input *GetSegmentVersionInput) (req *request.Request, output *GetSegmentVersionOutput) { op := &request.Operation{ - Name: opUpdateAdmChannel, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/channels/adm", + Name: opGetSegmentVersion, + HTTPMethod: "GET", + HTTPPath: "/v1/apps/{application-id}/segments/{segment-id}/versions/{version}", } if input == nil { - input = &UpdateAdmChannelInput{} + input = &GetSegmentVersionInput{} } - output = &UpdateAdmChannelOutput{} + output = &GetSegmentVersionOutput{} req = c.newRequest(op, input, output) return } -// UpdateAdmChannel API operation for Amazon Pinpoint. +// GetSegmentVersion API operation for Amazon Pinpoint. // -// Updates the ADM channel settings for an application. +// Retrieves information about the configuration, dimension, and other settings +// for a specific version of a segment that's associated with 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 Amazon Pinpoint's -// API operation UpdateAdmChannel for usage and error information. +// API operation GetSegmentVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateAdmChannel -func (c *Pinpoint) UpdateAdmChannel(input *UpdateAdmChannelInput) (*UpdateAdmChannelOutput, error) { - req, out := c.UpdateAdmChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentVersion +func (c *Pinpoint) GetSegmentVersion(input *GetSegmentVersionInput) (*GetSegmentVersionOutput, error) { + req, out := c.GetSegmentVersionRequest(input) return out, req.Send() } -// UpdateAdmChannelWithContext is the same as UpdateAdmChannel with the addition of +// GetSegmentVersionWithContext is the same as GetSegmentVersion with the addition of // the ability to pass a context and additional request options. // -// See UpdateAdmChannel for details on how to use this API operation. +// See GetSegmentVersion for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UpdateAdmChannelWithContext(ctx aws.Context, input *UpdateAdmChannelInput, opts ...request.Option) (*UpdateAdmChannelOutput, error) { - req, out := c.UpdateAdmChannelRequest(input) +func (c *Pinpoint) GetSegmentVersionWithContext(ctx aws.Context, input *GetSegmentVersionInput, opts ...request.Option) (*GetSegmentVersionOutput, error) { + req, out := c.GetSegmentVersionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateApnsChannel = "UpdateApnsChannel" +const opGetSegmentVersions = "GetSegmentVersions" -// UpdateApnsChannelRequest generates a "aws/request.Request" representing the -// client's request for the UpdateApnsChannel operation. The "output" return +// GetSegmentVersionsRequest generates a "aws/request.Request" representing the +// client's request for the GetSegmentVersions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateApnsChannel for more information on using the UpdateApnsChannel +// See GetSegmentVersions for more information on using the GetSegmentVersions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateApnsChannelRequest method. -// req, resp := client.UpdateApnsChannelRequest(params) +// // Example sending a request using the GetSegmentVersionsRequest method. +// req, resp := client.GetSegmentVersionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsChannel -func (c *Pinpoint) UpdateApnsChannelRequest(input *UpdateApnsChannelInput) (req *request.Request, output *UpdateApnsChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentVersions +func (c *Pinpoint) GetSegmentVersionsRequest(input *GetSegmentVersionsInput) (req *request.Request, output *GetSegmentVersionsOutput) { op := &request.Operation{ - Name: opUpdateApnsChannel, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/channels/apns", + Name: opGetSegmentVersions, + HTTPMethod: "GET", + HTTPPath: "/v1/apps/{application-id}/segments/{segment-id}/versions", } if input == nil { - input = &UpdateApnsChannelInput{} + input = &GetSegmentVersionsInput{} } - output = &UpdateApnsChannelOutput{} + output = &GetSegmentVersionsOutput{} req = c.newRequest(op, input, output) return } -// UpdateApnsChannel API operation for Amazon Pinpoint. +// GetSegmentVersions API operation for Amazon Pinpoint. // -// Updates the APNs channel settings for an application. +// Retrieves information about the configuration, dimension, and other settings +// for all the versions of a specific segment that's associated with 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 Amazon Pinpoint's -// API operation UpdateApnsChannel for usage and error information. +// API operation GetSegmentVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsChannel -func (c *Pinpoint) UpdateApnsChannel(input *UpdateApnsChannelInput) (*UpdateApnsChannelOutput, error) { - req, out := c.UpdateApnsChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegmentVersions +func (c *Pinpoint) GetSegmentVersions(input *GetSegmentVersionsInput) (*GetSegmentVersionsOutput, error) { + req, out := c.GetSegmentVersionsRequest(input) return out, req.Send() } -// UpdateApnsChannelWithContext is the same as UpdateApnsChannel with the addition of +// GetSegmentVersionsWithContext is the same as GetSegmentVersions with the addition of // the ability to pass a context and additional request options. // -// See UpdateApnsChannel for details on how to use this API operation. +// See GetSegmentVersions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UpdateApnsChannelWithContext(ctx aws.Context, input *UpdateApnsChannelInput, opts ...request.Option) (*UpdateApnsChannelOutput, error) { - req, out := c.UpdateApnsChannelRequest(input) +func (c *Pinpoint) GetSegmentVersionsWithContext(ctx aws.Context, input *GetSegmentVersionsInput, opts ...request.Option) (*GetSegmentVersionsOutput, error) { + req, out := c.GetSegmentVersionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateApnsSandboxChannel = "UpdateApnsSandboxChannel" +const opGetSegments = "GetSegments" -// UpdateApnsSandboxChannelRequest generates a "aws/request.Request" representing the -// client's request for the UpdateApnsSandboxChannel operation. The "output" return +// GetSegmentsRequest generates a "aws/request.Request" representing the +// client's request for the GetSegments operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateApnsSandboxChannel for more information on using the UpdateApnsSandboxChannel +// See GetSegments for more information on using the GetSegments // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateApnsSandboxChannelRequest method. -// req, resp := client.UpdateApnsSandboxChannelRequest(params) +// // Example sending a request using the GetSegmentsRequest method. +// req, resp := client.GetSegmentsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsSandboxChannel -func (c *Pinpoint) UpdateApnsSandboxChannelRequest(input *UpdateApnsSandboxChannelInput) (req *request.Request, output *UpdateApnsSandboxChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegments +func (c *Pinpoint) GetSegmentsRequest(input *GetSegmentsInput) (req *request.Request, output *GetSegmentsOutput) { op := &request.Operation{ - Name: opUpdateApnsSandboxChannel, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/channels/apns_sandbox", + Name: opGetSegments, + HTTPMethod: "GET", + HTTPPath: "/v1/apps/{application-id}/segments", } if input == nil { - input = &UpdateApnsSandboxChannelInput{} + input = &GetSegmentsInput{} } - output = &UpdateApnsSandboxChannelOutput{} + output = &GetSegmentsOutput{} req = c.newRequest(op, input, output) return } -// UpdateApnsSandboxChannel API operation for Amazon Pinpoint. +// GetSegments API operation for Amazon Pinpoint. // -// Updates the APNs sandbox channel settings for an application. +// Retrieves information about the configuration, dimension, and other settings +// for all the segments that are associated with 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 Amazon Pinpoint's -// API operation UpdateApnsSandboxChannel for usage and error information. +// API operation GetSegments for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsSandboxChannel -func (c *Pinpoint) UpdateApnsSandboxChannel(input *UpdateApnsSandboxChannelInput) (*UpdateApnsSandboxChannelOutput, error) { - req, out := c.UpdateApnsSandboxChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSegments +func (c *Pinpoint) GetSegments(input *GetSegmentsInput) (*GetSegmentsOutput, error) { + req, out := c.GetSegmentsRequest(input) return out, req.Send() } -// UpdateApnsSandboxChannelWithContext is the same as UpdateApnsSandboxChannel with the addition of +// GetSegmentsWithContext is the same as GetSegments with the addition of // the ability to pass a context and additional request options. // -// See UpdateApnsSandboxChannel for details on how to use this API operation. +// See GetSegments for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UpdateApnsSandboxChannelWithContext(ctx aws.Context, input *UpdateApnsSandboxChannelInput, opts ...request.Option) (*UpdateApnsSandboxChannelOutput, error) { - req, out := c.UpdateApnsSandboxChannelRequest(input) +func (c *Pinpoint) GetSegmentsWithContext(ctx aws.Context, input *GetSegmentsInput, opts ...request.Option) (*GetSegmentsOutput, error) { + req, out := c.GetSegmentsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateApnsVoipChannel = "UpdateApnsVoipChannel" +const opGetSmsChannel = "GetSmsChannel" -// UpdateApnsVoipChannelRequest generates a "aws/request.Request" representing the -// client's request for the UpdateApnsVoipChannel operation. The "output" return +// GetSmsChannelRequest generates a "aws/request.Request" representing the +// client's request for the GetSmsChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateApnsVoipChannel for more information on using the UpdateApnsVoipChannel +// See GetSmsChannel for more information on using the GetSmsChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateApnsVoipChannelRequest method. -// req, resp := client.UpdateApnsVoipChannelRequest(params) +// // Example sending a request using the GetSmsChannelRequest method. +// req, resp := client.GetSmsChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsVoipChannel -func (c *Pinpoint) UpdateApnsVoipChannelRequest(input *UpdateApnsVoipChannelInput) (req *request.Request, output *UpdateApnsVoipChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSmsChannel +func (c *Pinpoint) GetSmsChannelRequest(input *GetSmsChannelInput) (req *request.Request, output *GetSmsChannelOutput) { op := &request.Operation{ - Name: opUpdateApnsVoipChannel, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/channels/apns_voip", + Name: opGetSmsChannel, + HTTPMethod: "GET", + HTTPPath: "/v1/apps/{application-id}/channels/sms", } if input == nil { - input = &UpdateApnsVoipChannelInput{} + input = &GetSmsChannelInput{} } - output = &UpdateApnsVoipChannelOutput{} + output = &GetSmsChannelOutput{} req = c.newRequest(op, input, output) return } -// UpdateApnsVoipChannel API operation for Amazon Pinpoint. +// GetSmsChannel API operation for Amazon Pinpoint. // -// Updates the APNs VoIP channel settings for an application. +// Retrieves information about the status and settings of the SMS channel 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 Amazon Pinpoint's -// API operation UpdateApnsVoipChannel for usage and error information. +// API operation GetSmsChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsVoipChannel -func (c *Pinpoint) UpdateApnsVoipChannel(input *UpdateApnsVoipChannelInput) (*UpdateApnsVoipChannelOutput, error) { - req, out := c.UpdateApnsVoipChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSmsChannel +func (c *Pinpoint) GetSmsChannel(input *GetSmsChannelInput) (*GetSmsChannelOutput, error) { + req, out := c.GetSmsChannelRequest(input) return out, req.Send() } -// UpdateApnsVoipChannelWithContext is the same as UpdateApnsVoipChannel with the addition of +// GetSmsChannelWithContext is the same as GetSmsChannel with the addition of // the ability to pass a context and additional request options. // -// See UpdateApnsVoipChannel for details on how to use this API operation. +// See GetSmsChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UpdateApnsVoipChannelWithContext(ctx aws.Context, input *UpdateApnsVoipChannelInput, opts ...request.Option) (*UpdateApnsVoipChannelOutput, error) { - req, out := c.UpdateApnsVoipChannelRequest(input) +func (c *Pinpoint) GetSmsChannelWithContext(ctx aws.Context, input *GetSmsChannelInput, opts ...request.Option) (*GetSmsChannelOutput, error) { + req, out := c.GetSmsChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateApnsVoipSandboxChannel = "UpdateApnsVoipSandboxChannel" +const opGetSmsTemplate = "GetSmsTemplate" -// UpdateApnsVoipSandboxChannelRequest generates a "aws/request.Request" representing the -// client's request for the UpdateApnsVoipSandboxChannel operation. The "output" return +// GetSmsTemplateRequest generates a "aws/request.Request" representing the +// client's request for the GetSmsTemplate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateApnsVoipSandboxChannel for more information on using the UpdateApnsVoipSandboxChannel +// See GetSmsTemplate for more information on using the GetSmsTemplate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateApnsVoipSandboxChannelRequest method. -// req, resp := client.UpdateApnsVoipSandboxChannelRequest(params) +// // Example sending a request using the GetSmsTemplateRequest method. +// req, resp := client.GetSmsTemplateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsVoipSandboxChannel -func (c *Pinpoint) UpdateApnsVoipSandboxChannelRequest(input *UpdateApnsVoipSandboxChannelInput) (req *request.Request, output *UpdateApnsVoipSandboxChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSmsTemplate +func (c *Pinpoint) GetSmsTemplateRequest(input *GetSmsTemplateInput) (req *request.Request, output *GetSmsTemplateOutput) { op := &request.Operation{ - Name: opUpdateApnsVoipSandboxChannel, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/channels/apns_voip_sandbox", + Name: opGetSmsTemplate, + HTTPMethod: "GET", + HTTPPath: "/v1/templates/{template-name}/sms", } if input == nil { - input = &UpdateApnsVoipSandboxChannelInput{} + input = &GetSmsTemplateInput{} } - output = &UpdateApnsVoipSandboxChannelOutput{} + output = &GetSmsTemplateOutput{} req = c.newRequest(op, input, output) return } -// UpdateApnsVoipSandboxChannel API operation for Amazon Pinpoint. +// GetSmsTemplate API operation for Amazon Pinpoint. // -// Updates the settings for the APNs VoIP sandbox channel for an application. +// Retrieves the content and settings of a message template for messages that +// are sent through the SMS channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation UpdateApnsVoipSandboxChannel for usage and error information. +// API operation GetSmsTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsVoipSandboxChannel -func (c *Pinpoint) UpdateApnsVoipSandboxChannel(input *UpdateApnsVoipSandboxChannelInput) (*UpdateApnsVoipSandboxChannelOutput, error) { - req, out := c.UpdateApnsVoipSandboxChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetSmsTemplate +func (c *Pinpoint) GetSmsTemplate(input *GetSmsTemplateInput) (*GetSmsTemplateOutput, error) { + req, out := c.GetSmsTemplateRequest(input) return out, req.Send() } -// UpdateApnsVoipSandboxChannelWithContext is the same as UpdateApnsVoipSandboxChannel with the addition of +// GetSmsTemplateWithContext is the same as GetSmsTemplate with the addition of // the ability to pass a context and additional request options. // -// See UpdateApnsVoipSandboxChannel for details on how to use this API operation. +// See GetSmsTemplate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UpdateApnsVoipSandboxChannelWithContext(ctx aws.Context, input *UpdateApnsVoipSandboxChannelInput, opts ...request.Option) (*UpdateApnsVoipSandboxChannelOutput, error) { - req, out := c.UpdateApnsVoipSandboxChannelRequest(input) +func (c *Pinpoint) GetSmsTemplateWithContext(ctx aws.Context, input *GetSmsTemplateInput, opts ...request.Option) (*GetSmsTemplateOutput, error) { + req, out := c.GetSmsTemplateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateApplicationSettings = "UpdateApplicationSettings" +const opGetUserEndpoints = "GetUserEndpoints" -// UpdateApplicationSettingsRequest generates a "aws/request.Request" representing the -// client's request for the UpdateApplicationSettings operation. The "output" return +// GetUserEndpointsRequest generates a "aws/request.Request" representing the +// client's request for the GetUserEndpoints operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateApplicationSettings for more information on using the UpdateApplicationSettings +// See GetUserEndpoints for more information on using the GetUserEndpoints // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateApplicationSettingsRequest method. -// req, resp := client.UpdateApplicationSettingsRequest(params) +// // Example sending a request using the GetUserEndpointsRequest method. +// req, resp := client.GetUserEndpointsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApplicationSettings -func (c *Pinpoint) UpdateApplicationSettingsRequest(input *UpdateApplicationSettingsInput) (req *request.Request, output *UpdateApplicationSettingsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetUserEndpoints +func (c *Pinpoint) GetUserEndpointsRequest(input *GetUserEndpointsInput) (req *request.Request, output *GetUserEndpointsOutput) { op := &request.Operation{ - Name: opUpdateApplicationSettings, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/settings", + Name: opGetUserEndpoints, + HTTPMethod: "GET", + HTTPPath: "/v1/apps/{application-id}/users/{user-id}", } if input == nil { - input = &UpdateApplicationSettingsInput{} + input = &GetUserEndpointsInput{} } - output = &UpdateApplicationSettingsOutput{} + output = &GetUserEndpointsOutput{} req = c.newRequest(op, input, output) return } -// UpdateApplicationSettings API operation for Amazon Pinpoint. +// GetUserEndpoints API operation for Amazon Pinpoint. // -// Updates the settings for an application. +// Retrieves information about all the endpoints that are associated with a +// specific user 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 Pinpoint's -// API operation UpdateApplicationSettings for usage and error information. +// API operation GetUserEndpoints for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApplicationSettings -func (c *Pinpoint) UpdateApplicationSettings(input *UpdateApplicationSettingsInput) (*UpdateApplicationSettingsOutput, error) { - req, out := c.UpdateApplicationSettingsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetUserEndpoints +func (c *Pinpoint) GetUserEndpoints(input *GetUserEndpointsInput) (*GetUserEndpointsOutput, error) { + req, out := c.GetUserEndpointsRequest(input) return out, req.Send() } -// UpdateApplicationSettingsWithContext is the same as UpdateApplicationSettings with the addition of +// GetUserEndpointsWithContext is the same as GetUserEndpoints with the addition of // the ability to pass a context and additional request options. // -// See UpdateApplicationSettings for details on how to use this API operation. +// See GetUserEndpoints for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UpdateApplicationSettingsWithContext(ctx aws.Context, input *UpdateApplicationSettingsInput, opts ...request.Option) (*UpdateApplicationSettingsOutput, error) { - req, out := c.UpdateApplicationSettingsRequest(input) +func (c *Pinpoint) GetUserEndpointsWithContext(ctx aws.Context, input *GetUserEndpointsInput, opts ...request.Option) (*GetUserEndpointsOutput, error) { + req, out := c.GetUserEndpointsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateBaiduChannel = "UpdateBaiduChannel" +const opGetVoiceChannel = "GetVoiceChannel" -// UpdateBaiduChannelRequest generates a "aws/request.Request" representing the -// client's request for the UpdateBaiduChannel operation. The "output" return +// GetVoiceChannelRequest generates a "aws/request.Request" representing the +// client's request for the GetVoiceChannel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateBaiduChannel for more information on using the UpdateBaiduChannel +// See GetVoiceChannel for more information on using the GetVoiceChannel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateBaiduChannelRequest method. -// req, resp := client.UpdateBaiduChannelRequest(params) +// // Example sending a request using the GetVoiceChannelRequest method. +// req, resp := client.GetVoiceChannelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateBaiduChannel -func (c *Pinpoint) UpdateBaiduChannelRequest(input *UpdateBaiduChannelInput) (req *request.Request, output *UpdateBaiduChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetVoiceChannel +func (c *Pinpoint) GetVoiceChannelRequest(input *GetVoiceChannelInput) (req *request.Request, output *GetVoiceChannelOutput) { op := &request.Operation{ - Name: opUpdateBaiduChannel, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/channels/baidu", + Name: opGetVoiceChannel, + HTTPMethod: "GET", + HTTPPath: "/v1/apps/{application-id}/channels/voice", } if input == nil { - input = &UpdateBaiduChannelInput{} + input = &GetVoiceChannelInput{} } - output = &UpdateBaiduChannelOutput{} + output = &GetVoiceChannelOutput{} req = c.newRequest(op, input, output) return } -// UpdateBaiduChannel API operation for Amazon Pinpoint. +// GetVoiceChannel API operation for Amazon Pinpoint. // -// Updates the settings of the Baidu channel for an application. +// Retrieves information about the status and settings of the voice channel +// 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 Amazon Pinpoint's -// API operation UpdateBaiduChannel for usage and error information. +// API operation GetVoiceChannel for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateBaiduChannel -func (c *Pinpoint) UpdateBaiduChannel(input *UpdateBaiduChannelInput) (*UpdateBaiduChannelOutput, error) { - req, out := c.UpdateBaiduChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetVoiceChannel +func (c *Pinpoint) GetVoiceChannel(input *GetVoiceChannelInput) (*GetVoiceChannelOutput, error) { + req, out := c.GetVoiceChannelRequest(input) return out, req.Send() } -// UpdateBaiduChannelWithContext is the same as UpdateBaiduChannel with the addition of +// GetVoiceChannelWithContext is the same as GetVoiceChannel with the addition of // the ability to pass a context and additional request options. // -// See UpdateBaiduChannel for details on how to use this API operation. +// See GetVoiceChannel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UpdateBaiduChannelWithContext(ctx aws.Context, input *UpdateBaiduChannelInput, opts ...request.Option) (*UpdateBaiduChannelOutput, error) { - req, out := c.UpdateBaiduChannelRequest(input) +func (c *Pinpoint) GetVoiceChannelWithContext(ctx aws.Context, input *GetVoiceChannelInput, opts ...request.Option) (*GetVoiceChannelOutput, error) { + req, out := c.GetVoiceChannelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateCampaign = "UpdateCampaign" +const opGetVoiceTemplate = "GetVoiceTemplate" -// UpdateCampaignRequest generates a "aws/request.Request" representing the -// client's request for the UpdateCampaign operation. The "output" return +// GetVoiceTemplateRequest generates a "aws/request.Request" representing the +// client's request for the GetVoiceTemplate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateCampaign for more information on using the UpdateCampaign +// See GetVoiceTemplate for more information on using the GetVoiceTemplate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateCampaignRequest method. -// req, resp := client.UpdateCampaignRequest(params) +// // Example sending a request using the GetVoiceTemplateRequest method. +// req, resp := client.GetVoiceTemplateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateCampaign -func (c *Pinpoint) UpdateCampaignRequest(input *UpdateCampaignInput) (req *request.Request, output *UpdateCampaignOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetVoiceTemplate +func (c *Pinpoint) GetVoiceTemplateRequest(input *GetVoiceTemplateInput) (req *request.Request, output *GetVoiceTemplateOutput) { op := &request.Operation{ - Name: opUpdateCampaign, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/campaigns/{campaign-id}", + Name: opGetVoiceTemplate, + HTTPMethod: "GET", + HTTPPath: "/v1/templates/{template-name}/voice", } if input == nil { - input = &UpdateCampaignInput{} + input = &GetVoiceTemplateInput{} } - output = &UpdateCampaignOutput{} + output = &GetVoiceTemplateOutput{} req = c.newRequest(op, input, output) return } -// UpdateCampaign API operation for Amazon Pinpoint. +// GetVoiceTemplate API operation for Amazon Pinpoint. // -// Updates the settings for a campaign. +// Retrieves the content and settings of a message template for messages that +// are sent through the voice channel. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation UpdateCampaign for usage and error information. +// API operation GetVoiceTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateCampaign -func (c *Pinpoint) UpdateCampaign(input *UpdateCampaignInput) (*UpdateCampaignOutput, error) { - req, out := c.UpdateCampaignRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/GetVoiceTemplate +func (c *Pinpoint) GetVoiceTemplate(input *GetVoiceTemplateInput) (*GetVoiceTemplateOutput, error) { + req, out := c.GetVoiceTemplateRequest(input) return out, req.Send() } -// UpdateCampaignWithContext is the same as UpdateCampaign with the addition of +// GetVoiceTemplateWithContext is the same as GetVoiceTemplate with the addition of // the ability to pass a context and additional request options. // -// See UpdateCampaign for details on how to use this API operation. +// See GetVoiceTemplate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UpdateCampaignWithContext(ctx aws.Context, input *UpdateCampaignInput, opts ...request.Option) (*UpdateCampaignOutput, error) { - req, out := c.UpdateCampaignRequest(input) +func (c *Pinpoint) GetVoiceTemplateWithContext(ctx aws.Context, input *GetVoiceTemplateInput, opts ...request.Option) (*GetVoiceTemplateOutput, error) { + req, out := c.GetVoiceTemplateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateEmailChannel = "UpdateEmailChannel" +const opListJourneys = "ListJourneys" -// UpdateEmailChannelRequest generates a "aws/request.Request" representing the -// client's request for the UpdateEmailChannel operation. The "output" return +// ListJourneysRequest generates a "aws/request.Request" representing the +// client's request for the ListJourneys operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateEmailChannel for more information on using the UpdateEmailChannel +// See ListJourneys for more information on using the ListJourneys // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateEmailChannelRequest method. -// req, resp := client.UpdateEmailChannelRequest(params) +// // Example sending a request using the ListJourneysRequest method. +// req, resp := client.ListJourneysRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateEmailChannel -func (c *Pinpoint) UpdateEmailChannelRequest(input *UpdateEmailChannelInput) (req *request.Request, output *UpdateEmailChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/ListJourneys +func (c *Pinpoint) ListJourneysRequest(input *ListJourneysInput) (req *request.Request, output *ListJourneysOutput) { op := &request.Operation{ - Name: opUpdateEmailChannel, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/channels/email", + Name: opListJourneys, + HTTPMethod: "GET", + HTTPPath: "/v1/apps/{application-id}/journeys", } if input == nil { - input = &UpdateEmailChannelInput{} + input = &ListJourneysInput{} } - output = &UpdateEmailChannelOutput{} + output = &ListJourneysOutput{} req = c.newRequest(op, input, output) return } -// UpdateEmailChannel API operation for Amazon Pinpoint. +// ListJourneys API operation for Amazon Pinpoint. // -// Updates the status and settings of the email channel for an application. +// Retrieves information about the status, configuration, and other settings +// for all the journeys that are associated with 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 Amazon Pinpoint's -// API operation UpdateEmailChannel for usage and error information. +// API operation ListJourneys for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateEmailChannel -func (c *Pinpoint) UpdateEmailChannel(input *UpdateEmailChannelInput) (*UpdateEmailChannelOutput, error) { - req, out := c.UpdateEmailChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/ListJourneys +func (c *Pinpoint) ListJourneys(input *ListJourneysInput) (*ListJourneysOutput, error) { + req, out := c.ListJourneysRequest(input) return out, req.Send() } -// UpdateEmailChannelWithContext is the same as UpdateEmailChannel with the addition of +// ListJourneysWithContext is the same as ListJourneys with the addition of // the ability to pass a context and additional request options. // -// See UpdateEmailChannel for details on how to use this API operation. +// See ListJourneys for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UpdateEmailChannelWithContext(ctx aws.Context, input *UpdateEmailChannelInput, opts ...request.Option) (*UpdateEmailChannelOutput, error) { - req, out := c.UpdateEmailChannelRequest(input) +func (c *Pinpoint) ListJourneysWithContext(ctx aws.Context, input *ListJourneysInput, opts ...request.Option) (*ListJourneysOutput, error) { + req, out := c.ListJourneysRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateEndpoint = "UpdateEndpoint" +const opListTagsForResource = "ListTagsForResource" -// UpdateEndpointRequest generates a "aws/request.Request" representing the -// client's request for the UpdateEndpoint operation. The "output" return +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateEndpoint for more information on using the UpdateEndpoint +// See ListTagsForResource for more information on using the ListTagsForResource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateEndpointRequest method. -// req, resp := client.UpdateEndpointRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateEndpoint -func (c *Pinpoint) UpdateEndpointRequest(input *UpdateEndpointInput) (req *request.Request, output *UpdateEndpointOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/ListTagsForResource +func (c *Pinpoint) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { op := &request.Operation{ - Name: opUpdateEndpoint, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/endpoints/{endpoint-id}", + Name: opListTagsForResource, + HTTPMethod: "GET", + HTTPPath: "/v1/tags/{resource-arn}", } if input == nil { - input = &UpdateEndpointInput{} + input = &ListTagsForResourceInput{} } - output = &UpdateEndpointOutput{} + output = &ListTagsForResourceOutput{} req = c.newRequest(op, input, output) return } -// UpdateEndpoint API operation for Amazon Pinpoint. +// ListTagsForResource API operation for Amazon Pinpoint. // -// Creates a new endpoint for an application or updates the settings and attributes -// of an existing endpoint for an application. You can also use this operation -// to define custom attributes (Attributes, Metrics, and UserAttributes properties) -// for an endpoint. +// Retrieves all the tags (keys and values) that are associated with an application, +// campaign, journey, message template, or segment. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation UpdateEndpoint for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// Provides information about an API request or response. -// -// * ErrCodeInternalServerErrorException "InternalServerErrorException" -// Provides information about an API request or response. -// -// * ErrCodeForbiddenException "ForbiddenException" -// Provides information about an API request or response. -// -// * ErrCodeNotFoundException "NotFoundException" -// Provides information about an API request or response. -// -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" -// Provides information about an API request or response. -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// Provides information about an API request or response. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateEndpoint -func (c *Pinpoint) UpdateEndpoint(input *UpdateEndpointInput) (*UpdateEndpointOutput, error) { - req, out := c.UpdateEndpointRequest(input) +// API operation ListTagsForResource for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/ListTagsForResource +func (c *Pinpoint) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) return out, req.Send() } -// UpdateEndpointWithContext is the same as UpdateEndpoint with the addition of +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of // the ability to pass a context and additional request options. // -// See UpdateEndpoint for details on how to use this API operation. +// See ListTagsForResource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UpdateEndpointWithContext(ctx aws.Context, input *UpdateEndpointInput, opts ...request.Option) (*UpdateEndpointOutput, error) { - req, out := c.UpdateEndpointRequest(input) +func (c *Pinpoint) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateEndpointsBatch = "UpdateEndpointsBatch" +const opListTemplateVersions = "ListTemplateVersions" -// UpdateEndpointsBatchRequest generates a "aws/request.Request" representing the -// client's request for the UpdateEndpointsBatch operation. The "output" return +// ListTemplateVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListTemplateVersions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateEndpointsBatch for more information on using the UpdateEndpointsBatch +// See ListTemplateVersions for more information on using the ListTemplateVersions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateEndpointsBatchRequest method. -// req, resp := client.UpdateEndpointsBatchRequest(params) +// // Example sending a request using the ListTemplateVersionsRequest method. +// req, resp := client.ListTemplateVersionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateEndpointsBatch -func (c *Pinpoint) UpdateEndpointsBatchRequest(input *UpdateEndpointsBatchInput) (req *request.Request, output *UpdateEndpointsBatchOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/ListTemplateVersions +func (c *Pinpoint) ListTemplateVersionsRequest(input *ListTemplateVersionsInput) (req *request.Request, output *ListTemplateVersionsOutput) { op := &request.Operation{ - Name: opUpdateEndpointsBatch, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/endpoints", + Name: opListTemplateVersions, + HTTPMethod: "GET", + HTTPPath: "/v1/templates/{template-name}/{template-type}/versions", } if input == nil { - input = &UpdateEndpointsBatchInput{} + input = &ListTemplateVersionsInput{} } - output = &UpdateEndpointsBatchOutput{} + output = &ListTemplateVersionsOutput{} req = c.newRequest(op, input, output) return } -// UpdateEndpointsBatch API operation for Amazon Pinpoint. +// ListTemplateVersions API operation for Amazon Pinpoint. // -// Creates a new batch of endpoints for an application or updates the settings -// and attributes of a batch of existing endpoints for an application. You can -// also use this operation to define custom attributes (Attributes, Metrics, -// and UserAttributes properties) for a batch of endpoints. +// Retrieves information about all the versions of a specific message 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 Pinpoint's -// API operation UpdateEndpointsBatch for usage and error information. +// API operation ListTemplateVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateEndpointsBatch -func (c *Pinpoint) UpdateEndpointsBatch(input *UpdateEndpointsBatchInput) (*UpdateEndpointsBatchOutput, error) { - req, out := c.UpdateEndpointsBatchRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/ListTemplateVersions +func (c *Pinpoint) ListTemplateVersions(input *ListTemplateVersionsInput) (*ListTemplateVersionsOutput, error) { + req, out := c.ListTemplateVersionsRequest(input) return out, req.Send() } -// UpdateEndpointsBatchWithContext is the same as UpdateEndpointsBatch with the addition of +// ListTemplateVersionsWithContext is the same as ListTemplateVersions with the addition of // the ability to pass a context and additional request options. // -// See UpdateEndpointsBatch for details on how to use this API operation. +// See ListTemplateVersions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UpdateEndpointsBatchWithContext(ctx aws.Context, input *UpdateEndpointsBatchInput, opts ...request.Option) (*UpdateEndpointsBatchOutput, error) { - req, out := c.UpdateEndpointsBatchRequest(input) +func (c *Pinpoint) ListTemplateVersionsWithContext(ctx aws.Context, input *ListTemplateVersionsInput, opts ...request.Option) (*ListTemplateVersionsOutput, error) { + req, out := c.ListTemplateVersionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateGcmChannel = "UpdateGcmChannel" +const opListTemplates = "ListTemplates" -// UpdateGcmChannelRequest generates a "aws/request.Request" representing the -// client's request for the UpdateGcmChannel operation. The "output" return +// ListTemplatesRequest generates a "aws/request.Request" representing the +// client's request for the ListTemplates operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateGcmChannel for more information on using the UpdateGcmChannel +// See ListTemplates for more information on using the ListTemplates // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateGcmChannelRequest method. -// req, resp := client.UpdateGcmChannelRequest(params) +// // Example sending a request using the ListTemplatesRequest method. +// req, resp := client.ListTemplatesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateGcmChannel -func (c *Pinpoint) UpdateGcmChannelRequest(input *UpdateGcmChannelInput) (req *request.Request, output *UpdateGcmChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/ListTemplates +func (c *Pinpoint) ListTemplatesRequest(input *ListTemplatesInput) (req *request.Request, output *ListTemplatesOutput) { op := &request.Operation{ - Name: opUpdateGcmChannel, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/channels/gcm", + Name: opListTemplates, + HTTPMethod: "GET", + HTTPPath: "/v1/templates", } if input == nil { - input = &UpdateGcmChannelInput{} + input = &ListTemplatesInput{} } - output = &UpdateGcmChannelOutput{} + output = &ListTemplatesOutput{} req = c.newRequest(op, input, output) return } -// UpdateGcmChannel API operation for Amazon Pinpoint. +// ListTemplates API operation for Amazon Pinpoint. // -// Updates the status and settings of the GCM channel for an application. +// Retrieves information about all the message templates that are associated +// with your Amazon Pinpoint 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 Pinpoint's -// API operation UpdateGcmChannel for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// Provides information about an API request or response. +// API operation ListTemplates for usage and error information. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// Returned Error Types: +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * TooManyRequestsException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * ForbiddenException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateGcmChannel -func (c *Pinpoint) UpdateGcmChannel(input *UpdateGcmChannelInput) (*UpdateGcmChannelOutput, error) { - req, out := c.UpdateGcmChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/ListTemplates +func (c *Pinpoint) ListTemplates(input *ListTemplatesInput) (*ListTemplatesOutput, error) { + req, out := c.ListTemplatesRequest(input) return out, req.Send() } -// UpdateGcmChannelWithContext is the same as UpdateGcmChannel with the addition of +// ListTemplatesWithContext is the same as ListTemplates with the addition of // the ability to pass a context and additional request options. // -// See UpdateGcmChannel for details on how to use this API operation. +// See ListTemplates for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UpdateGcmChannelWithContext(ctx aws.Context, input *UpdateGcmChannelInput, opts ...request.Option) (*UpdateGcmChannelOutput, error) { - req, out := c.UpdateGcmChannelRequest(input) +func (c *Pinpoint) ListTemplatesWithContext(ctx aws.Context, input *ListTemplatesInput, opts ...request.Option) (*ListTemplatesOutput, error) { + req, out := c.ListTemplatesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateSegment = "UpdateSegment" +const opPhoneNumberValidate = "PhoneNumberValidate" -// UpdateSegmentRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSegment operation. The "output" return +// PhoneNumberValidateRequest generates a "aws/request.Request" representing the +// client's request for the PhoneNumberValidate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateSegment for more information on using the UpdateSegment +// See PhoneNumberValidate for more information on using the PhoneNumberValidate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateSegmentRequest method. -// req, resp := client.UpdateSegmentRequest(params) +// // Example sending a request using the PhoneNumberValidateRequest method. +// req, resp := client.PhoneNumberValidateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateSegment -func (c *Pinpoint) UpdateSegmentRequest(input *UpdateSegmentInput) (req *request.Request, output *UpdateSegmentOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/PhoneNumberValidate +func (c *Pinpoint) PhoneNumberValidateRequest(input *PhoneNumberValidateInput) (req *request.Request, output *PhoneNumberValidateOutput) { op := &request.Operation{ - Name: opUpdateSegment, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/segments/{segment-id}", + Name: opPhoneNumberValidate, + HTTPMethod: "POST", + HTTPPath: "/v1/phone/number/validate", } if input == nil { - input = &UpdateSegmentInput{} + input = &PhoneNumberValidateInput{} } - output = &UpdateSegmentOutput{} + output = &PhoneNumberValidateOutput{} req = c.newRequest(op, input, output) return } -// UpdateSegment API operation for Amazon Pinpoint. +// PhoneNumberValidate API operation for Amazon Pinpoint. // -// Creates a new segment for an application or updates the configuration, dimension, -// and other settings for an existing segment that's associated with an application. +// Retrieves information about a phone number. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation UpdateSegment for usage and error information. +// API operation PhoneNumberValidate for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateSegment -func (c *Pinpoint) UpdateSegment(input *UpdateSegmentInput) (*UpdateSegmentOutput, error) { - req, out := c.UpdateSegmentRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/PhoneNumberValidate +func (c *Pinpoint) PhoneNumberValidate(input *PhoneNumberValidateInput) (*PhoneNumberValidateOutput, error) { + req, out := c.PhoneNumberValidateRequest(input) return out, req.Send() } -// UpdateSegmentWithContext is the same as UpdateSegment with the addition of +// PhoneNumberValidateWithContext is the same as PhoneNumberValidate with the addition of // the ability to pass a context and additional request options. // -// See UpdateSegment for details on how to use this API operation. +// See PhoneNumberValidate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UpdateSegmentWithContext(ctx aws.Context, input *UpdateSegmentInput, opts ...request.Option) (*UpdateSegmentOutput, error) { - req, out := c.UpdateSegmentRequest(input) +func (c *Pinpoint) PhoneNumberValidateWithContext(ctx aws.Context, input *PhoneNumberValidateInput, opts ...request.Option) (*PhoneNumberValidateOutput, error) { + req, out := c.PhoneNumberValidateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateSmsChannel = "UpdateSmsChannel" +const opPutEventStream = "PutEventStream" -// UpdateSmsChannelRequest generates a "aws/request.Request" representing the -// client's request for the UpdateSmsChannel operation. The "output" return +// PutEventStreamRequest generates a "aws/request.Request" representing the +// client's request for the PutEventStream operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateSmsChannel for more information on using the UpdateSmsChannel +// See PutEventStream for more information on using the PutEventStream // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateSmsChannelRequest method. -// req, resp := client.UpdateSmsChannelRequest(params) +// // Example sending a request using the PutEventStreamRequest method. +// req, resp := client.PutEventStreamRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateSmsChannel -func (c *Pinpoint) UpdateSmsChannelRequest(input *UpdateSmsChannelInput) (req *request.Request, output *UpdateSmsChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/PutEventStream +func (c *Pinpoint) PutEventStreamRequest(input *PutEventStreamInput) (req *request.Request, output *PutEventStreamOutput) { op := &request.Operation{ - Name: opUpdateSmsChannel, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/channels/sms", + Name: opPutEventStream, + HTTPMethod: "POST", + HTTPPath: "/v1/apps/{application-id}/eventstream", } if input == nil { - input = &UpdateSmsChannelInput{} + input = &PutEventStreamInput{} } - output = &UpdateSmsChannelOutput{} + output = &PutEventStreamOutput{} req = c.newRequest(op, input, output) return } -// UpdateSmsChannel API operation for Amazon Pinpoint. +// PutEventStream API operation for Amazon Pinpoint. // -// Updates the status and settings of the SMS channel for an application. +// Creates a new event stream for an application or updates the settings of +// an existing event stream 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 Amazon Pinpoint's -// API operation UpdateSmsChannel for usage and error information. +// API operation PutEventStream for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateSmsChannel -func (c *Pinpoint) UpdateSmsChannel(input *UpdateSmsChannelInput) (*UpdateSmsChannelOutput, error) { - req, out := c.UpdateSmsChannelRequest(input) - return out, req.Send() -} +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/PutEventStream +func (c *Pinpoint) PutEventStream(input *PutEventStreamInput) (*PutEventStreamOutput, error) { + req, out := c.PutEventStreamRequest(input) + return out, req.Send() +} -// UpdateSmsChannelWithContext is the same as UpdateSmsChannel with the addition of +// PutEventStreamWithContext is the same as PutEventStream with the addition of // the ability to pass a context and additional request options. // -// See UpdateSmsChannel for details on how to use this API operation. +// See PutEventStream for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UpdateSmsChannelWithContext(ctx aws.Context, input *UpdateSmsChannelInput, opts ...request.Option) (*UpdateSmsChannelOutput, error) { - req, out := c.UpdateSmsChannelRequest(input) +func (c *Pinpoint) PutEventStreamWithContext(ctx aws.Context, input *PutEventStreamInput, opts ...request.Option) (*PutEventStreamOutput, error) { + req, out := c.PutEventStreamRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateVoiceChannel = "UpdateVoiceChannel" +const opPutEvents = "PutEvents" -// UpdateVoiceChannelRequest generates a "aws/request.Request" representing the -// client's request for the UpdateVoiceChannel operation. The "output" return +// PutEventsRequest generates a "aws/request.Request" representing the +// client's request for the PutEvents operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateVoiceChannel for more information on using the UpdateVoiceChannel +// See PutEvents for more information on using the PutEvents // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateVoiceChannelRequest method. -// req, resp := client.UpdateVoiceChannelRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateVoiceChannel -func (c *Pinpoint) UpdateVoiceChannelRequest(input *UpdateVoiceChannelInput) (req *request.Request, output *UpdateVoiceChannelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/PutEvents +func (c *Pinpoint) PutEventsRequest(input *PutEventsInput) (req *request.Request, output *PutEventsOutput) { op := &request.Operation{ - Name: opUpdateVoiceChannel, - HTTPMethod: "PUT", - HTTPPath: "/v1/apps/{application-id}/channels/voice", + Name: opPutEvents, + HTTPMethod: "POST", + HTTPPath: "/v1/apps/{application-id}/events", } if input == nil { - input = &UpdateVoiceChannelInput{} + input = &PutEventsInput{} } - output = &UpdateVoiceChannelOutput{} + output = &PutEventsOutput{} req = c.newRequest(op, input, output) return } -// UpdateVoiceChannel API operation for Amazon Pinpoint. +// PutEvents API operation for Amazon Pinpoint. // -// Updates the status and settings of the voice channel for an application. +// Creates a new event to record for endpoints, or creates or updates endpoint +// data that existing events are associated with. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon Pinpoint's -// API operation UpdateVoiceChannel for usage and error information. +// API operation PutEvents for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // Provides information about an API request or response. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // Provides information about an API request or response. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // Provides information about an API request or response. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // Provides information about an API request or response. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // Provides information about an API request or response. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Provides information about an API request or response. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateVoiceChannel -func (c *Pinpoint) UpdateVoiceChannel(input *UpdateVoiceChannelInput) (*UpdateVoiceChannelOutput, error) { - req, out := c.UpdateVoiceChannelRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/PutEvents +func (c *Pinpoint) PutEvents(input *PutEventsInput) (*PutEventsOutput, error) { + req, out := c.PutEventsRequest(input) return out, req.Send() } -// UpdateVoiceChannelWithContext is the same as UpdateVoiceChannel with the addition of +// PutEventsWithContext is the same as PutEvents with the addition of // the ability to pass a context and additional request options. // -// See UpdateVoiceChannel for details on how to use this API operation. +// See PutEvents for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Pinpoint) UpdateVoiceChannelWithContext(ctx aws.Context, input *UpdateVoiceChannelInput, opts ...request.Option) (*UpdateVoiceChannelOutput, error) { - req, out := c.UpdateVoiceChannelRequest(input) +func (c *Pinpoint) PutEventsWithContext(ctx aws.Context, input *PutEventsInput, opts ...request.Option) (*PutEventsOutput, error) { + req, out := c.PutEventsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// Specifies the status and settings of the ADM (Amazon Device Messaging) channel -// for an application. -type ADMChannelRequest struct { - _ struct{} `type:"structure"` +const opRemoveAttributes = "RemoveAttributes" - // The Client ID that you received from Amazon to send messages by using ADM. - // - // ClientId is a required field - ClientId *string `type:"string" required:"true"` +// RemoveAttributesRequest generates a "aws/request.Request" representing the +// client's request for the RemoveAttributes operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RemoveAttributes for more information on using the RemoveAttributes +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RemoveAttributesRequest method. +// req, resp := client.RemoveAttributesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/RemoveAttributes +func (c *Pinpoint) RemoveAttributesRequest(input *RemoveAttributesInput) (req *request.Request, output *RemoveAttributesOutput) { + op := &request.Operation{ + Name: opRemoveAttributes, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/attributes/{attribute-type}", + } - // The Client Secret that you received from Amazon to send messages by using - // ADM. - // - // ClientSecret is a required field - ClientSecret *string `type:"string" required:"true"` + if input == nil { + input = &RemoveAttributesInput{} + } - // Specifies whether to enable the ADM channel for the application. - Enabled *bool `type:"boolean"` + output = &RemoveAttributesOutput{} + req = c.newRequest(op, input, output) + return } -// String returns the string representation -func (s ADMChannelRequest) String() string { - return awsutil.Prettify(s) +// RemoveAttributes API operation for Amazon Pinpoint. +// +// Removes one or more attributes, of the same attribute type, from all the +// endpoints that are associated with 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 Amazon Pinpoint's +// API operation RemoveAttributes for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/RemoveAttributes +func (c *Pinpoint) RemoveAttributes(input *RemoveAttributesInput) (*RemoveAttributesOutput, error) { + req, out := c.RemoveAttributesRequest(input) + return out, req.Send() } -// GoString returns the string representation -func (s ADMChannelRequest) GoString() string { - return s.String() +// RemoveAttributesWithContext is the same as RemoveAttributes with the addition of +// the ability to pass a context and additional request options. +// +// See RemoveAttributes for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) RemoveAttributesWithContext(ctx aws.Context, input *RemoveAttributesInput, opts ...request.Option) (*RemoveAttributesOutput, error) { + req, out := c.RemoveAttributesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ADMChannelRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ADMChannelRequest"} - if s.ClientId == nil { - invalidParams.Add(request.NewErrParamRequired("ClientId")) - } - if s.ClientSecret == nil { - invalidParams.Add(request.NewErrParamRequired("ClientSecret")) +const opSendMessages = "SendMessages" + +// SendMessagesRequest generates a "aws/request.Request" representing the +// client's request for the SendMessages operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SendMessages for more information on using the SendMessages +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SendMessagesRequest method. +// req, resp := client.SendMessagesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/SendMessages +func (c *Pinpoint) SendMessagesRequest(input *SendMessagesInput) (req *request.Request, output *SendMessagesOutput) { + op := &request.Operation{ + Name: opSendMessages, + HTTPMethod: "POST", + HTTPPath: "/v1/apps/{application-id}/messages", } - if invalidParams.Len() > 0 { - return invalidParams + if input == nil { + input = &SendMessagesInput{} } - return nil + + output = &SendMessagesOutput{} + req = c.newRequest(op, input, output) + return } -// SetClientId sets the ClientId field's value. -func (s *ADMChannelRequest) SetClientId(v string) *ADMChannelRequest { - s.ClientId = &v - return s +// SendMessages API operation for Amazon Pinpoint. +// +// Creates and sends a direct message. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Pinpoint's +// API operation SendMessages for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/SendMessages +func (c *Pinpoint) SendMessages(input *SendMessagesInput) (*SendMessagesOutput, error) { + req, out := c.SendMessagesRequest(input) + return out, req.Send() } -// SetClientSecret sets the ClientSecret field's value. -func (s *ADMChannelRequest) SetClientSecret(v string) *ADMChannelRequest { - s.ClientSecret = &v - return s +// SendMessagesWithContext is the same as SendMessages with the addition of +// the ability to pass a context and additional request options. +// +// See SendMessages for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) SendMessagesWithContext(ctx aws.Context, input *SendMessagesInput, opts ...request.Option) (*SendMessagesOutput, error) { + req, out := c.SendMessagesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSendUsersMessages = "SendUsersMessages" + +// SendUsersMessagesRequest generates a "aws/request.Request" representing the +// client's request for the SendUsersMessages operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SendUsersMessages for more information on using the SendUsersMessages +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SendUsersMessagesRequest method. +// req, resp := client.SendUsersMessagesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/SendUsersMessages +func (c *Pinpoint) SendUsersMessagesRequest(input *SendUsersMessagesInput) (req *request.Request, output *SendUsersMessagesOutput) { + op := &request.Operation{ + Name: opSendUsersMessages, + HTTPMethod: "POST", + HTTPPath: "/v1/apps/{application-id}/users-messages", + } + + if input == nil { + input = &SendUsersMessagesInput{} + } + + output = &SendUsersMessagesOutput{} + req = c.newRequest(op, input, output) + return +} + +// SendUsersMessages API operation for Amazon Pinpoint. +// +// Creates and sends a message to a list of 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 Amazon Pinpoint's +// API operation SendUsersMessages for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/SendUsersMessages +func (c *Pinpoint) SendUsersMessages(input *SendUsersMessagesInput) (*SendUsersMessagesOutput, error) { + req, out := c.SendUsersMessagesRequest(input) + return out, req.Send() +} + +// SendUsersMessagesWithContext is the same as SendUsersMessages with the addition of +// the ability to pass a context and additional request options. +// +// See SendUsersMessages for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) SendUsersMessagesWithContext(ctx aws.Context, input *SendUsersMessagesInput, opts ...request.Option) (*SendUsersMessagesOutput, error) { + req, out := c.SendUsersMessagesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/TagResource +func (c *Pinpoint) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { + op := &request.Operation{ + Name: opTagResource, + HTTPMethod: "POST", + HTTPPath: "/v1/tags/{resource-arn}", + } + + if input == nil { + input = &TagResourceInput{} + } + + output = &TagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for Amazon Pinpoint. +// +// Adds one or more tags (keys and values) to an application, campaign, journey, +// message template, or segment. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Pinpoint's +// API operation TagResource for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/TagResource +func (c *Pinpoint) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UntagResource +func (c *Pinpoint) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { + op := &request.Operation{ + Name: opUntagResource, + HTTPMethod: "DELETE", + HTTPPath: "/v1/tags/{resource-arn}", + } + + if input == nil { + input = &UntagResourceInput{} + } + + output = &UntagResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for Amazon Pinpoint. +// +// Removes one or more tags (keys and values) from an application, campaign, +// journey, message template, or segment. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Pinpoint's +// API operation UntagResource for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UntagResource +func (c *Pinpoint) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateAdmChannel = "UpdateAdmChannel" + +// UpdateAdmChannelRequest generates a "aws/request.Request" representing the +// client's request for the UpdateAdmChannel operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateAdmChannel for more information on using the UpdateAdmChannel +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateAdmChannelRequest method. +// req, resp := client.UpdateAdmChannelRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateAdmChannel +func (c *Pinpoint) UpdateAdmChannelRequest(input *UpdateAdmChannelInput) (req *request.Request, output *UpdateAdmChannelOutput) { + op := &request.Operation{ + Name: opUpdateAdmChannel, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/channels/adm", + } + + if input == nil { + input = &UpdateAdmChannelInput{} + } + + output = &UpdateAdmChannelOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateAdmChannel API operation for Amazon Pinpoint. +// +// Enables the ADM channel for an application or updates the status and settings +// of the ADM channel 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 Amazon Pinpoint's +// API operation UpdateAdmChannel for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateAdmChannel +func (c *Pinpoint) UpdateAdmChannel(input *UpdateAdmChannelInput) (*UpdateAdmChannelOutput, error) { + req, out := c.UpdateAdmChannelRequest(input) + return out, req.Send() +} + +// UpdateAdmChannelWithContext is the same as UpdateAdmChannel with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateAdmChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateAdmChannelWithContext(ctx aws.Context, input *UpdateAdmChannelInput, opts ...request.Option) (*UpdateAdmChannelOutput, error) { + req, out := c.UpdateAdmChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateApnsChannel = "UpdateApnsChannel" + +// UpdateApnsChannelRequest generates a "aws/request.Request" representing the +// client's request for the UpdateApnsChannel operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateApnsChannel for more information on using the UpdateApnsChannel +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateApnsChannelRequest method. +// req, resp := client.UpdateApnsChannelRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsChannel +func (c *Pinpoint) UpdateApnsChannelRequest(input *UpdateApnsChannelInput) (req *request.Request, output *UpdateApnsChannelOutput) { + op := &request.Operation{ + Name: opUpdateApnsChannel, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/channels/apns", + } + + if input == nil { + input = &UpdateApnsChannelInput{} + } + + output = &UpdateApnsChannelOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateApnsChannel API operation for Amazon Pinpoint. +// +// Enables the APNs channel for an application or updates the status and settings +// of the APNs channel 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 Amazon Pinpoint's +// API operation UpdateApnsChannel for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsChannel +func (c *Pinpoint) UpdateApnsChannel(input *UpdateApnsChannelInput) (*UpdateApnsChannelOutput, error) { + req, out := c.UpdateApnsChannelRequest(input) + return out, req.Send() +} + +// UpdateApnsChannelWithContext is the same as UpdateApnsChannel with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApnsChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateApnsChannelWithContext(ctx aws.Context, input *UpdateApnsChannelInput, opts ...request.Option) (*UpdateApnsChannelOutput, error) { + req, out := c.UpdateApnsChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateApnsSandboxChannel = "UpdateApnsSandboxChannel" + +// UpdateApnsSandboxChannelRequest generates a "aws/request.Request" representing the +// client's request for the UpdateApnsSandboxChannel operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateApnsSandboxChannel for more information on using the UpdateApnsSandboxChannel +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateApnsSandboxChannelRequest method. +// req, resp := client.UpdateApnsSandboxChannelRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsSandboxChannel +func (c *Pinpoint) UpdateApnsSandboxChannelRequest(input *UpdateApnsSandboxChannelInput) (req *request.Request, output *UpdateApnsSandboxChannelOutput) { + op := &request.Operation{ + Name: opUpdateApnsSandboxChannel, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/channels/apns_sandbox", + } + + if input == nil { + input = &UpdateApnsSandboxChannelInput{} + } + + output = &UpdateApnsSandboxChannelOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateApnsSandboxChannel API operation for Amazon Pinpoint. +// +// Enables the APNs sandbox channel for an application or updates the status +// and settings of the APNs sandbox channel 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 Amazon Pinpoint's +// API operation UpdateApnsSandboxChannel for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsSandboxChannel +func (c *Pinpoint) UpdateApnsSandboxChannel(input *UpdateApnsSandboxChannelInput) (*UpdateApnsSandboxChannelOutput, error) { + req, out := c.UpdateApnsSandboxChannelRequest(input) + return out, req.Send() +} + +// UpdateApnsSandboxChannelWithContext is the same as UpdateApnsSandboxChannel with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApnsSandboxChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateApnsSandboxChannelWithContext(ctx aws.Context, input *UpdateApnsSandboxChannelInput, opts ...request.Option) (*UpdateApnsSandboxChannelOutput, error) { + req, out := c.UpdateApnsSandboxChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateApnsVoipChannel = "UpdateApnsVoipChannel" + +// UpdateApnsVoipChannelRequest generates a "aws/request.Request" representing the +// client's request for the UpdateApnsVoipChannel operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateApnsVoipChannel for more information on using the UpdateApnsVoipChannel +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateApnsVoipChannelRequest method. +// req, resp := client.UpdateApnsVoipChannelRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsVoipChannel +func (c *Pinpoint) UpdateApnsVoipChannelRequest(input *UpdateApnsVoipChannelInput) (req *request.Request, output *UpdateApnsVoipChannelOutput) { + op := &request.Operation{ + Name: opUpdateApnsVoipChannel, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/channels/apns_voip", + } + + if input == nil { + input = &UpdateApnsVoipChannelInput{} + } + + output = &UpdateApnsVoipChannelOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateApnsVoipChannel API operation for Amazon Pinpoint. +// +// Enables the APNs VoIP channel for an application or updates the status and +// settings of the APNs VoIP channel 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 Amazon Pinpoint's +// API operation UpdateApnsVoipChannel for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsVoipChannel +func (c *Pinpoint) UpdateApnsVoipChannel(input *UpdateApnsVoipChannelInput) (*UpdateApnsVoipChannelOutput, error) { + req, out := c.UpdateApnsVoipChannelRequest(input) + return out, req.Send() +} + +// UpdateApnsVoipChannelWithContext is the same as UpdateApnsVoipChannel with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApnsVoipChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateApnsVoipChannelWithContext(ctx aws.Context, input *UpdateApnsVoipChannelInput, opts ...request.Option) (*UpdateApnsVoipChannelOutput, error) { + req, out := c.UpdateApnsVoipChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateApnsVoipSandboxChannel = "UpdateApnsVoipSandboxChannel" + +// UpdateApnsVoipSandboxChannelRequest generates a "aws/request.Request" representing the +// client's request for the UpdateApnsVoipSandboxChannel operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateApnsVoipSandboxChannel for more information on using the UpdateApnsVoipSandboxChannel +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateApnsVoipSandboxChannelRequest method. +// req, resp := client.UpdateApnsVoipSandboxChannelRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsVoipSandboxChannel +func (c *Pinpoint) UpdateApnsVoipSandboxChannelRequest(input *UpdateApnsVoipSandboxChannelInput) (req *request.Request, output *UpdateApnsVoipSandboxChannelOutput) { + op := &request.Operation{ + Name: opUpdateApnsVoipSandboxChannel, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/channels/apns_voip_sandbox", + } + + if input == nil { + input = &UpdateApnsVoipSandboxChannelInput{} + } + + output = &UpdateApnsVoipSandboxChannelOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateApnsVoipSandboxChannel API operation for Amazon Pinpoint. +// +// Enables the APNs VoIP sandbox channel for an application or updates the status +// and settings of the APNs VoIP sandbox channel 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 Amazon Pinpoint's +// API operation UpdateApnsVoipSandboxChannel for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApnsVoipSandboxChannel +func (c *Pinpoint) UpdateApnsVoipSandboxChannel(input *UpdateApnsVoipSandboxChannelInput) (*UpdateApnsVoipSandboxChannelOutput, error) { + req, out := c.UpdateApnsVoipSandboxChannelRequest(input) + return out, req.Send() +} + +// UpdateApnsVoipSandboxChannelWithContext is the same as UpdateApnsVoipSandboxChannel with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApnsVoipSandboxChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateApnsVoipSandboxChannelWithContext(ctx aws.Context, input *UpdateApnsVoipSandboxChannelInput, opts ...request.Option) (*UpdateApnsVoipSandboxChannelOutput, error) { + req, out := c.UpdateApnsVoipSandboxChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateApplicationSettings = "UpdateApplicationSettings" + +// UpdateApplicationSettingsRequest generates a "aws/request.Request" representing the +// client's request for the UpdateApplicationSettings operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateApplicationSettings for more information on using the UpdateApplicationSettings +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateApplicationSettingsRequest method. +// req, resp := client.UpdateApplicationSettingsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApplicationSettings +func (c *Pinpoint) UpdateApplicationSettingsRequest(input *UpdateApplicationSettingsInput) (req *request.Request, output *UpdateApplicationSettingsOutput) { + op := &request.Operation{ + Name: opUpdateApplicationSettings, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/settings", + } + + if input == nil { + input = &UpdateApplicationSettingsInput{} + } + + output = &UpdateApplicationSettingsOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateApplicationSettings API operation for Amazon Pinpoint. +// +// Updates the 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 Amazon Pinpoint's +// API operation UpdateApplicationSettings for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateApplicationSettings +func (c *Pinpoint) UpdateApplicationSettings(input *UpdateApplicationSettingsInput) (*UpdateApplicationSettingsOutput, error) { + req, out := c.UpdateApplicationSettingsRequest(input) + return out, req.Send() +} + +// UpdateApplicationSettingsWithContext is the same as UpdateApplicationSettings with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateApplicationSettings for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateApplicationSettingsWithContext(ctx aws.Context, input *UpdateApplicationSettingsInput, opts ...request.Option) (*UpdateApplicationSettingsOutput, error) { + req, out := c.UpdateApplicationSettingsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateBaiduChannel = "UpdateBaiduChannel" + +// UpdateBaiduChannelRequest generates a "aws/request.Request" representing the +// client's request for the UpdateBaiduChannel operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateBaiduChannel for more information on using the UpdateBaiduChannel +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateBaiduChannelRequest method. +// req, resp := client.UpdateBaiduChannelRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateBaiduChannel +func (c *Pinpoint) UpdateBaiduChannelRequest(input *UpdateBaiduChannelInput) (req *request.Request, output *UpdateBaiduChannelOutput) { + op := &request.Operation{ + Name: opUpdateBaiduChannel, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/channels/baidu", + } + + if input == nil { + input = &UpdateBaiduChannelInput{} + } + + output = &UpdateBaiduChannelOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateBaiduChannel API operation for Amazon Pinpoint. +// +// Enables the Baidu channel for an application or updates the status and settings +// of the Baidu channel 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 Amazon Pinpoint's +// API operation UpdateBaiduChannel for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateBaiduChannel +func (c *Pinpoint) UpdateBaiduChannel(input *UpdateBaiduChannelInput) (*UpdateBaiduChannelOutput, error) { + req, out := c.UpdateBaiduChannelRequest(input) + return out, req.Send() +} + +// UpdateBaiduChannelWithContext is the same as UpdateBaiduChannel with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateBaiduChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateBaiduChannelWithContext(ctx aws.Context, input *UpdateBaiduChannelInput, opts ...request.Option) (*UpdateBaiduChannelOutput, error) { + req, out := c.UpdateBaiduChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateCampaign = "UpdateCampaign" + +// UpdateCampaignRequest generates a "aws/request.Request" representing the +// client's request for the UpdateCampaign operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateCampaign for more information on using the UpdateCampaign +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateCampaignRequest method. +// req, resp := client.UpdateCampaignRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateCampaign +func (c *Pinpoint) UpdateCampaignRequest(input *UpdateCampaignInput) (req *request.Request, output *UpdateCampaignOutput) { + op := &request.Operation{ + Name: opUpdateCampaign, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/campaigns/{campaign-id}", + } + + if input == nil { + input = &UpdateCampaignInput{} + } + + output = &UpdateCampaignOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateCampaign API operation for Amazon Pinpoint. +// +// Updates the configuration and other settings for a campaign. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Pinpoint's +// API operation UpdateCampaign for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateCampaign +func (c *Pinpoint) UpdateCampaign(input *UpdateCampaignInput) (*UpdateCampaignOutput, error) { + req, out := c.UpdateCampaignRequest(input) + return out, req.Send() +} + +// UpdateCampaignWithContext is the same as UpdateCampaign with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateCampaign for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateCampaignWithContext(ctx aws.Context, input *UpdateCampaignInput, opts ...request.Option) (*UpdateCampaignOutput, error) { + req, out := c.UpdateCampaignRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateEmailChannel = "UpdateEmailChannel" + +// UpdateEmailChannelRequest generates a "aws/request.Request" representing the +// client's request for the UpdateEmailChannel operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateEmailChannel for more information on using the UpdateEmailChannel +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateEmailChannelRequest method. +// req, resp := client.UpdateEmailChannelRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateEmailChannel +func (c *Pinpoint) UpdateEmailChannelRequest(input *UpdateEmailChannelInput) (req *request.Request, output *UpdateEmailChannelOutput) { + op := &request.Operation{ + Name: opUpdateEmailChannel, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/channels/email", + } + + if input == nil { + input = &UpdateEmailChannelInput{} + } + + output = &UpdateEmailChannelOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateEmailChannel API operation for Amazon Pinpoint. +// +// Enables the email channel for an application or updates the status and settings +// of the email channel 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 Amazon Pinpoint's +// API operation UpdateEmailChannel for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateEmailChannel +func (c *Pinpoint) UpdateEmailChannel(input *UpdateEmailChannelInput) (*UpdateEmailChannelOutput, error) { + req, out := c.UpdateEmailChannelRequest(input) + return out, req.Send() +} + +// UpdateEmailChannelWithContext is the same as UpdateEmailChannel with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateEmailChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateEmailChannelWithContext(ctx aws.Context, input *UpdateEmailChannelInput, opts ...request.Option) (*UpdateEmailChannelOutput, error) { + req, out := c.UpdateEmailChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateEmailTemplate = "UpdateEmailTemplate" + +// UpdateEmailTemplateRequest generates a "aws/request.Request" representing the +// client's request for the UpdateEmailTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateEmailTemplate for more information on using the UpdateEmailTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateEmailTemplateRequest method. +// req, resp := client.UpdateEmailTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateEmailTemplate +func (c *Pinpoint) UpdateEmailTemplateRequest(input *UpdateEmailTemplateInput) (req *request.Request, output *UpdateEmailTemplateOutput) { + op := &request.Operation{ + Name: opUpdateEmailTemplate, + HTTPMethod: "PUT", + HTTPPath: "/v1/templates/{template-name}/email", + } + + if input == nil { + input = &UpdateEmailTemplateInput{} + } + + output = &UpdateEmailTemplateOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateEmailTemplate API operation for Amazon Pinpoint. +// +// Updates an existing message template for messages that are sent through the +// email channel. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Pinpoint's +// API operation UpdateEmailTemplate for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateEmailTemplate +func (c *Pinpoint) UpdateEmailTemplate(input *UpdateEmailTemplateInput) (*UpdateEmailTemplateOutput, error) { + req, out := c.UpdateEmailTemplateRequest(input) + return out, req.Send() +} + +// UpdateEmailTemplateWithContext is the same as UpdateEmailTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateEmailTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateEmailTemplateWithContext(ctx aws.Context, input *UpdateEmailTemplateInput, opts ...request.Option) (*UpdateEmailTemplateOutput, error) { + req, out := c.UpdateEmailTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateEndpoint = "UpdateEndpoint" + +// UpdateEndpointRequest generates a "aws/request.Request" representing the +// client's request for the UpdateEndpoint operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateEndpoint for more information on using the UpdateEndpoint +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateEndpointRequest method. +// req, resp := client.UpdateEndpointRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateEndpoint +func (c *Pinpoint) UpdateEndpointRequest(input *UpdateEndpointInput) (req *request.Request, output *UpdateEndpointOutput) { + op := &request.Operation{ + Name: opUpdateEndpoint, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/endpoints/{endpoint-id}", + } + + if input == nil { + input = &UpdateEndpointInput{} + } + + output = &UpdateEndpointOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateEndpoint API operation for Amazon Pinpoint. +// +// Creates a new endpoint for an application or updates the settings and attributes +// of an existing endpoint for an application. You can also use this operation +// to define custom attributes (Attributes, Metrics, and UserAttributes properties) +// for 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 Amazon Pinpoint's +// API operation UpdateEndpoint for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateEndpoint +func (c *Pinpoint) UpdateEndpoint(input *UpdateEndpointInput) (*UpdateEndpointOutput, error) { + req, out := c.UpdateEndpointRequest(input) + return out, req.Send() +} + +// UpdateEndpointWithContext is the same as UpdateEndpoint with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateEndpoint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateEndpointWithContext(ctx aws.Context, input *UpdateEndpointInput, opts ...request.Option) (*UpdateEndpointOutput, error) { + req, out := c.UpdateEndpointRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateEndpointsBatch = "UpdateEndpointsBatch" + +// UpdateEndpointsBatchRequest generates a "aws/request.Request" representing the +// client's request for the UpdateEndpointsBatch operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateEndpointsBatch for more information on using the UpdateEndpointsBatch +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateEndpointsBatchRequest method. +// req, resp := client.UpdateEndpointsBatchRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateEndpointsBatch +func (c *Pinpoint) UpdateEndpointsBatchRequest(input *UpdateEndpointsBatchInput) (req *request.Request, output *UpdateEndpointsBatchOutput) { + op := &request.Operation{ + Name: opUpdateEndpointsBatch, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/endpoints", + } + + if input == nil { + input = &UpdateEndpointsBatchInput{} + } + + output = &UpdateEndpointsBatchOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateEndpointsBatch API operation for Amazon Pinpoint. +// +// Creates a new batch of endpoints for an application or updates the settings +// and attributes of a batch of existing endpoints for an application. You can +// also use this operation to define custom attributes (Attributes, Metrics, +// and UserAttributes properties) for a batch of 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 Pinpoint's +// API operation UpdateEndpointsBatch for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateEndpointsBatch +func (c *Pinpoint) UpdateEndpointsBatch(input *UpdateEndpointsBatchInput) (*UpdateEndpointsBatchOutput, error) { + req, out := c.UpdateEndpointsBatchRequest(input) + return out, req.Send() +} + +// UpdateEndpointsBatchWithContext is the same as UpdateEndpointsBatch with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateEndpointsBatch for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateEndpointsBatchWithContext(ctx aws.Context, input *UpdateEndpointsBatchInput, opts ...request.Option) (*UpdateEndpointsBatchOutput, error) { + req, out := c.UpdateEndpointsBatchRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateGcmChannel = "UpdateGcmChannel" + +// UpdateGcmChannelRequest generates a "aws/request.Request" representing the +// client's request for the UpdateGcmChannel operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateGcmChannel for more information on using the UpdateGcmChannel +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateGcmChannelRequest method. +// req, resp := client.UpdateGcmChannelRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateGcmChannel +func (c *Pinpoint) UpdateGcmChannelRequest(input *UpdateGcmChannelInput) (req *request.Request, output *UpdateGcmChannelOutput) { + op := &request.Operation{ + Name: opUpdateGcmChannel, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/channels/gcm", + } + + if input == nil { + input = &UpdateGcmChannelInput{} + } + + output = &UpdateGcmChannelOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateGcmChannel API operation for Amazon Pinpoint. +// +// Enables the GCM channel for an application or updates the status and settings +// of the GCM channel 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 Amazon Pinpoint's +// API operation UpdateGcmChannel for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateGcmChannel +func (c *Pinpoint) UpdateGcmChannel(input *UpdateGcmChannelInput) (*UpdateGcmChannelOutput, error) { + req, out := c.UpdateGcmChannelRequest(input) + return out, req.Send() +} + +// UpdateGcmChannelWithContext is the same as UpdateGcmChannel with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateGcmChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateGcmChannelWithContext(ctx aws.Context, input *UpdateGcmChannelInput, opts ...request.Option) (*UpdateGcmChannelOutput, error) { + req, out := c.UpdateGcmChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateJourney = "UpdateJourney" + +// UpdateJourneyRequest generates a "aws/request.Request" representing the +// client's request for the UpdateJourney operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateJourney for more information on using the UpdateJourney +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateJourneyRequest method. +// req, resp := client.UpdateJourneyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateJourney +func (c *Pinpoint) UpdateJourneyRequest(input *UpdateJourneyInput) (req *request.Request, output *UpdateJourneyOutput) { + op := &request.Operation{ + Name: opUpdateJourney, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/journeys/{journey-id}", + } + + if input == nil { + input = &UpdateJourneyInput{} + } + + output = &UpdateJourneyOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateJourney API operation for Amazon Pinpoint. +// +// Updates the configuration and other settings for a journey. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Pinpoint's +// API operation UpdateJourney for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateJourney +func (c *Pinpoint) UpdateJourney(input *UpdateJourneyInput) (*UpdateJourneyOutput, error) { + req, out := c.UpdateJourneyRequest(input) + return out, req.Send() +} + +// UpdateJourneyWithContext is the same as UpdateJourney with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateJourney for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateJourneyWithContext(ctx aws.Context, input *UpdateJourneyInput, opts ...request.Option) (*UpdateJourneyOutput, error) { + req, out := c.UpdateJourneyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateJourneyState = "UpdateJourneyState" + +// UpdateJourneyStateRequest generates a "aws/request.Request" representing the +// client's request for the UpdateJourneyState operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateJourneyState for more information on using the UpdateJourneyState +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateJourneyStateRequest method. +// req, resp := client.UpdateJourneyStateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateJourneyState +func (c *Pinpoint) UpdateJourneyStateRequest(input *UpdateJourneyStateInput) (req *request.Request, output *UpdateJourneyStateOutput) { + op := &request.Operation{ + Name: opUpdateJourneyState, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/journeys/{journey-id}/state", + } + + if input == nil { + input = &UpdateJourneyStateInput{} + } + + output = &UpdateJourneyStateOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateJourneyState API operation for Amazon Pinpoint. +// +// Cancels (stops) an active journey. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Pinpoint's +// API operation UpdateJourneyState for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateJourneyState +func (c *Pinpoint) UpdateJourneyState(input *UpdateJourneyStateInput) (*UpdateJourneyStateOutput, error) { + req, out := c.UpdateJourneyStateRequest(input) + return out, req.Send() +} + +// UpdateJourneyStateWithContext is the same as UpdateJourneyState with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateJourneyState for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateJourneyStateWithContext(ctx aws.Context, input *UpdateJourneyStateInput, opts ...request.Option) (*UpdateJourneyStateOutput, error) { + req, out := c.UpdateJourneyStateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdatePushTemplate = "UpdatePushTemplate" + +// UpdatePushTemplateRequest generates a "aws/request.Request" representing the +// client's request for the UpdatePushTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdatePushTemplate for more information on using the UpdatePushTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdatePushTemplateRequest method. +// req, resp := client.UpdatePushTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdatePushTemplate +func (c *Pinpoint) UpdatePushTemplateRequest(input *UpdatePushTemplateInput) (req *request.Request, output *UpdatePushTemplateOutput) { + op := &request.Operation{ + Name: opUpdatePushTemplate, + HTTPMethod: "PUT", + HTTPPath: "/v1/templates/{template-name}/push", + } + + if input == nil { + input = &UpdatePushTemplateInput{} + } + + output = &UpdatePushTemplateOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdatePushTemplate API operation for Amazon Pinpoint. +// +// Updates an existing message template for messages that are sent through a +// push notification channel. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Pinpoint's +// API operation UpdatePushTemplate for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdatePushTemplate +func (c *Pinpoint) UpdatePushTemplate(input *UpdatePushTemplateInput) (*UpdatePushTemplateOutput, error) { + req, out := c.UpdatePushTemplateRequest(input) + return out, req.Send() +} + +// UpdatePushTemplateWithContext is the same as UpdatePushTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See UpdatePushTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdatePushTemplateWithContext(ctx aws.Context, input *UpdatePushTemplateInput, opts ...request.Option) (*UpdatePushTemplateOutput, error) { + req, out := c.UpdatePushTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateSegment = "UpdateSegment" + +// UpdateSegmentRequest generates a "aws/request.Request" representing the +// client's request for the UpdateSegment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateSegment for more information on using the UpdateSegment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateSegmentRequest method. +// req, resp := client.UpdateSegmentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateSegment +func (c *Pinpoint) UpdateSegmentRequest(input *UpdateSegmentInput) (req *request.Request, output *UpdateSegmentOutput) { + op := &request.Operation{ + Name: opUpdateSegment, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/segments/{segment-id}", + } + + if input == nil { + input = &UpdateSegmentInput{} + } + + output = &UpdateSegmentOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateSegment API operation for Amazon Pinpoint. +// +// Creates a new segment for an application or updates the configuration, dimension, +// and other settings for an existing segment that's associated with 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 Amazon Pinpoint's +// API operation UpdateSegment for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateSegment +func (c *Pinpoint) UpdateSegment(input *UpdateSegmentInput) (*UpdateSegmentOutput, error) { + req, out := c.UpdateSegmentRequest(input) + return out, req.Send() +} + +// UpdateSegmentWithContext is the same as UpdateSegment with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSegment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateSegmentWithContext(ctx aws.Context, input *UpdateSegmentInput, opts ...request.Option) (*UpdateSegmentOutput, error) { + req, out := c.UpdateSegmentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateSmsChannel = "UpdateSmsChannel" + +// UpdateSmsChannelRequest generates a "aws/request.Request" representing the +// client's request for the UpdateSmsChannel operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateSmsChannel for more information on using the UpdateSmsChannel +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateSmsChannelRequest method. +// req, resp := client.UpdateSmsChannelRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateSmsChannel +func (c *Pinpoint) UpdateSmsChannelRequest(input *UpdateSmsChannelInput) (req *request.Request, output *UpdateSmsChannelOutput) { + op := &request.Operation{ + Name: opUpdateSmsChannel, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/channels/sms", + } + + if input == nil { + input = &UpdateSmsChannelInput{} + } + + output = &UpdateSmsChannelOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateSmsChannel API operation for Amazon Pinpoint. +// +// Enables the SMS channel for an application or updates the status and settings +// of the SMS channel 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 Amazon Pinpoint's +// API operation UpdateSmsChannel for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateSmsChannel +func (c *Pinpoint) UpdateSmsChannel(input *UpdateSmsChannelInput) (*UpdateSmsChannelOutput, error) { + req, out := c.UpdateSmsChannelRequest(input) + return out, req.Send() +} + +// UpdateSmsChannelWithContext is the same as UpdateSmsChannel with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSmsChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateSmsChannelWithContext(ctx aws.Context, input *UpdateSmsChannelInput, opts ...request.Option) (*UpdateSmsChannelOutput, error) { + req, out := c.UpdateSmsChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateSmsTemplate = "UpdateSmsTemplate" + +// UpdateSmsTemplateRequest generates a "aws/request.Request" representing the +// client's request for the UpdateSmsTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateSmsTemplate for more information on using the UpdateSmsTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateSmsTemplateRequest method. +// req, resp := client.UpdateSmsTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateSmsTemplate +func (c *Pinpoint) UpdateSmsTemplateRequest(input *UpdateSmsTemplateInput) (req *request.Request, output *UpdateSmsTemplateOutput) { + op := &request.Operation{ + Name: opUpdateSmsTemplate, + HTTPMethod: "PUT", + HTTPPath: "/v1/templates/{template-name}/sms", + } + + if input == nil { + input = &UpdateSmsTemplateInput{} + } + + output = &UpdateSmsTemplateOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateSmsTemplate API operation for Amazon Pinpoint. +// +// Updates an existing message template for messages that are sent through the +// SMS channel. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Pinpoint's +// API operation UpdateSmsTemplate for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateSmsTemplate +func (c *Pinpoint) UpdateSmsTemplate(input *UpdateSmsTemplateInput) (*UpdateSmsTemplateOutput, error) { + req, out := c.UpdateSmsTemplateRequest(input) + return out, req.Send() +} + +// UpdateSmsTemplateWithContext is the same as UpdateSmsTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateSmsTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateSmsTemplateWithContext(ctx aws.Context, input *UpdateSmsTemplateInput, opts ...request.Option) (*UpdateSmsTemplateOutput, error) { + req, out := c.UpdateSmsTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateTemplateActiveVersion = "UpdateTemplateActiveVersion" + +// UpdateTemplateActiveVersionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateTemplateActiveVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateTemplateActiveVersion for more information on using the UpdateTemplateActiveVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateTemplateActiveVersionRequest method. +// req, resp := client.UpdateTemplateActiveVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateTemplateActiveVersion +func (c *Pinpoint) UpdateTemplateActiveVersionRequest(input *UpdateTemplateActiveVersionInput) (req *request.Request, output *UpdateTemplateActiveVersionOutput) { + op := &request.Operation{ + Name: opUpdateTemplateActiveVersion, + HTTPMethod: "PUT", + HTTPPath: "/v1/templates/{template-name}/{template-type}/active-version", + } + + if input == nil { + input = &UpdateTemplateActiveVersionInput{} + } + + output = &UpdateTemplateActiveVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateTemplateActiveVersion API operation for Amazon Pinpoint. +// +// Changes the status of a specific version of a message template to active. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Pinpoint's +// API operation UpdateTemplateActiveVersion for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateTemplateActiveVersion +func (c *Pinpoint) UpdateTemplateActiveVersion(input *UpdateTemplateActiveVersionInput) (*UpdateTemplateActiveVersionOutput, error) { + req, out := c.UpdateTemplateActiveVersionRequest(input) + return out, req.Send() +} + +// UpdateTemplateActiveVersionWithContext is the same as UpdateTemplateActiveVersion with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTemplateActiveVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateTemplateActiveVersionWithContext(ctx aws.Context, input *UpdateTemplateActiveVersionInput, opts ...request.Option) (*UpdateTemplateActiveVersionOutput, error) { + req, out := c.UpdateTemplateActiveVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateVoiceChannel = "UpdateVoiceChannel" + +// UpdateVoiceChannelRequest generates a "aws/request.Request" representing the +// client's request for the UpdateVoiceChannel operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateVoiceChannel for more information on using the UpdateVoiceChannel +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateVoiceChannelRequest method. +// req, resp := client.UpdateVoiceChannelRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateVoiceChannel +func (c *Pinpoint) UpdateVoiceChannelRequest(input *UpdateVoiceChannelInput) (req *request.Request, output *UpdateVoiceChannelOutput) { + op := &request.Operation{ + Name: opUpdateVoiceChannel, + HTTPMethod: "PUT", + HTTPPath: "/v1/apps/{application-id}/channels/voice", + } + + if input == nil { + input = &UpdateVoiceChannelInput{} + } + + output = &UpdateVoiceChannelOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateVoiceChannel API operation for Amazon Pinpoint. +// +// Enables the voice channel for an application or updates the status and settings +// of the voice channel 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 Amazon Pinpoint's +// API operation UpdateVoiceChannel for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateVoiceChannel +func (c *Pinpoint) UpdateVoiceChannel(input *UpdateVoiceChannelInput) (*UpdateVoiceChannelOutput, error) { + req, out := c.UpdateVoiceChannelRequest(input) + return out, req.Send() +} + +// UpdateVoiceChannelWithContext is the same as UpdateVoiceChannel with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateVoiceChannel for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateVoiceChannelWithContext(ctx aws.Context, input *UpdateVoiceChannelInput, opts ...request.Option) (*UpdateVoiceChannelOutput, error) { + req, out := c.UpdateVoiceChannelRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateVoiceTemplate = "UpdateVoiceTemplate" + +// UpdateVoiceTemplateRequest generates a "aws/request.Request" representing the +// client's request for the UpdateVoiceTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateVoiceTemplate for more information on using the UpdateVoiceTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateVoiceTemplateRequest method. +// req, resp := client.UpdateVoiceTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateVoiceTemplate +func (c *Pinpoint) UpdateVoiceTemplateRequest(input *UpdateVoiceTemplateInput) (req *request.Request, output *UpdateVoiceTemplateOutput) { + op := &request.Operation{ + Name: opUpdateVoiceTemplate, + HTTPMethod: "PUT", + HTTPPath: "/v1/templates/{template-name}/voice", + } + + if input == nil { + input = &UpdateVoiceTemplateInput{} + } + + output = &UpdateVoiceTemplateOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateVoiceTemplate API operation for Amazon Pinpoint. +// +// Updates an existing message template for messages that are sent through the +// voice channel. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Pinpoint's +// API operation UpdateVoiceTemplate for usage and error information. +// +// Returned Error Types: +// * BadRequestException +// Provides information about an API request or response. +// +// * InternalServerErrorException +// Provides information about an API request or response. +// +// * ForbiddenException +// Provides information about an API request or response. +// +// * NotFoundException +// Provides information about an API request or response. +// +// * MethodNotAllowedException +// Provides information about an API request or response. +// +// * TooManyRequestsException +// Provides information about an API request or response. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-12-01/UpdateVoiceTemplate +func (c *Pinpoint) UpdateVoiceTemplate(input *UpdateVoiceTemplateInput) (*UpdateVoiceTemplateOutput, error) { + req, out := c.UpdateVoiceTemplateRequest(input) + return out, req.Send() +} + +// UpdateVoiceTemplateWithContext is the same as UpdateVoiceTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateVoiceTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Pinpoint) UpdateVoiceTemplateWithContext(ctx aws.Context, input *UpdateVoiceTemplateInput, opts ...request.Option) (*UpdateVoiceTemplateOutput, error) { + req, out := c.UpdateVoiceTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// Specifies the status and settings of the ADM (Amazon Device Messaging) channel +// for an application. +type ADMChannelRequest struct { + _ struct{} `type:"structure"` + + // The Client ID that you received from Amazon to send messages by using ADM. + // + // ClientId is a required field + ClientId *string `type:"string" required:"true"` + + // The Client Secret that you received from Amazon to send messages by using + // ADM. + // + // ClientSecret is a required field + ClientSecret *string `type:"string" required:"true"` + + // Specifies whether to enable the ADM channel for the application. + Enabled *bool `type:"boolean"` +} + +// String returns the string representation +func (s ADMChannelRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ADMChannelRequest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ADMChannelRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ADMChannelRequest"} + if s.ClientId == nil { + invalidParams.Add(request.NewErrParamRequired("ClientId")) + } + if s.ClientSecret == nil { + invalidParams.Add(request.NewErrParamRequired("ClientSecret")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientId sets the ClientId field's value. +func (s *ADMChannelRequest) SetClientId(v string) *ADMChannelRequest { + s.ClientId = &v + return s +} + +// SetClientSecret sets the ClientSecret field's value. +func (s *ADMChannelRequest) SetClientSecret(v string) *ADMChannelRequest { + s.ClientSecret = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *ADMChannelRequest) SetEnabled(v bool) *ADMChannelRequest { + s.Enabled = &v + return s +} + +// Provides information about the status and settings of the ADM (Amazon Device +// Messaging) channel for an application. +type ADMChannelResponse struct { + _ struct{} `type:"structure"` + + // The unique identifier for the application that the ADM channel applies to. + ApplicationId *string `type:"string"` + + // The date and time when the ADM channel was enabled. + CreationDate *string `type:"string"` + + // Specifies whether the ADM channel is enabled for the application. + Enabled *bool `type:"boolean"` + + // (Not used) This property is retained only for backward compatibility. + HasCredential *bool `type:"boolean"` + + // (Deprecated) An identifier for the ADM channel. This property is retained + // only for backward compatibility. + Id *string `type:"string"` + + // Specifies whether the ADM channel is archived. + IsArchived *bool `type:"boolean"` + + // The user who last modified the ADM channel. + LastModifiedBy *string `type:"string"` + + // The date and time when the ADM channel was last modified. + LastModifiedDate *string `type:"string"` + + // The type of messaging or notification platform for the channel. For the ADM + // channel, this value is ADM. + // + // Platform is a required field + Platform *string `type:"string" required:"true"` + + // The current version of the ADM channel. + Version *int64 `type:"integer"` +} + +// String returns the string representation +func (s ADMChannelResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ADMChannelResponse) GoString() string { + return s.String() +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *ADMChannelResponse) SetApplicationId(v string) *ADMChannelResponse { + s.ApplicationId = &v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *ADMChannelResponse) SetCreationDate(v string) *ADMChannelResponse { + s.CreationDate = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *ADMChannelResponse) SetEnabled(v bool) *ADMChannelResponse { + s.Enabled = &v + return s +} + +// SetHasCredential sets the HasCredential field's value. +func (s *ADMChannelResponse) SetHasCredential(v bool) *ADMChannelResponse { + s.HasCredential = &v + return s +} + +// SetId sets the Id field's value. +func (s *ADMChannelResponse) SetId(v string) *ADMChannelResponse { + s.Id = &v + return s +} + +// SetIsArchived sets the IsArchived field's value. +func (s *ADMChannelResponse) SetIsArchived(v bool) *ADMChannelResponse { + s.IsArchived = &v + return s +} + +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *ADMChannelResponse) SetLastModifiedBy(v string) *ADMChannelResponse { + s.LastModifiedBy = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *ADMChannelResponse) SetLastModifiedDate(v string) *ADMChannelResponse { + s.LastModifiedDate = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *ADMChannelResponse) SetPlatform(v string) *ADMChannelResponse { + s.Platform = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *ADMChannelResponse) SetVersion(v int64) *ADMChannelResponse { + s.Version = &v + return s +} + +// Specifies the settings for a one-time message that's sent directly to an +// endpoint through the ADM (Amazon Device Messaging) channel. +type ADMMessage struct { + _ struct{} `type:"structure"` + + // The action to occur if the recipient taps the push notification. Valid values + // are: + // + // * OPEN_APP - Your app opens or it becomes the foreground app if it was + // sent to the background. This is the default action. + // + // * DEEP_LINK - Your app opens and displays a designated user interface + // in the app. This action uses the deep-linking features of the Android + // platform. + // + // * URL - The default mobile browser on the recipient's device opens and + // loads the web page at a URL that you specify. + Action *string `type:"string" enum:"Action"` + + // The body of the notification message. + Body *string `type:"string"` + + // An arbitrary string that indicates that multiple messages are logically the + // same and that Amazon Device Messaging (ADM) can drop previously enqueued + // messages in favor of this message. + ConsolidationKey *string `type:"string"` + + // The JSON data payload to use for the push notification, if the notification + // is a silent push notification. This payload is added to the data.pinpoint.jsonBody + // object of the notification. + Data map[string]*string `type:"map"` + + // The amount of time, in seconds, that ADM should store the message if the + // recipient's device is offline. Amazon Pinpoint specifies this value in the + // expiresAfter parameter when it sends the notification message to ADM. + ExpiresAfter *string `type:"string"` + + // The icon image name of the asset saved in your app. + IconReference *string `type:"string"` + + // The URL of the large icon image to display in the content view of the push + // notification. + ImageIconUrl *string `type:"string"` + + // The URL of an image to display in the push notification. + ImageUrl *string `type:"string"` + + // The base64-encoded, MD5 checksum of the value specified by the Data property. + // ADM uses the MD5 value to verify the integrity of the data. + MD5 *string `type:"string"` + + // The raw, JSON-formatted string to use as the payload for the notification + // message. If specified, this value overrides all other content for the message. + RawContent *string `type:"string"` + + // Specifies whether the notification is a silent push notification, which is + // a push notification that doesn't display on a recipient's device. Silent + // push notifications can be used for cases such as updating an app's configuration + // or supporting phone home functionality. + SilentPush *bool `type:"boolean"` + + // The URL of the small icon image to display in the status bar and the content + // view of the push notification. + SmallImageIconUrl *string `type:"string"` + + // The sound to play when the recipient receives the push notification. You + // can use the default stream or specify the file name of a sound resource that's + // bundled in your app. On an Android platform, the sound file must reside in + // /res/raw/. + Sound *string `type:"string"` + + // The default message variables to use in the notification message. You can + // override the default variables with individual address variables. + Substitutions map[string][]*string `type:"map"` + + // The title to display above the notification message on the recipient's device. + Title *string `type:"string"` + + // The URL to open in the recipient's default mobile browser, if a recipient + // taps the push notification and the value of the Action property is URL. + Url *string `type:"string"` +} + +// String returns the string representation +func (s ADMMessage) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ADMMessage) GoString() string { + return s.String() +} + +// SetAction sets the Action field's value. +func (s *ADMMessage) SetAction(v string) *ADMMessage { + s.Action = &v + return s +} + +// SetBody sets the Body field's value. +func (s *ADMMessage) SetBody(v string) *ADMMessage { + s.Body = &v + return s +} + +// SetConsolidationKey sets the ConsolidationKey field's value. +func (s *ADMMessage) SetConsolidationKey(v string) *ADMMessage { + s.ConsolidationKey = &v + return s +} + +// SetData sets the Data field's value. +func (s *ADMMessage) SetData(v map[string]*string) *ADMMessage { + s.Data = v + return s +} + +// SetExpiresAfter sets the ExpiresAfter field's value. +func (s *ADMMessage) SetExpiresAfter(v string) *ADMMessage { + s.ExpiresAfter = &v + return s +} + +// SetIconReference sets the IconReference field's value. +func (s *ADMMessage) SetIconReference(v string) *ADMMessage { + s.IconReference = &v + return s +} + +// SetImageIconUrl sets the ImageIconUrl field's value. +func (s *ADMMessage) SetImageIconUrl(v string) *ADMMessage { + s.ImageIconUrl = &v + return s +} + +// SetImageUrl sets the ImageUrl field's value. +func (s *ADMMessage) SetImageUrl(v string) *ADMMessage { + s.ImageUrl = &v + return s +} + +// SetMD5 sets the MD5 field's value. +func (s *ADMMessage) SetMD5(v string) *ADMMessage { + s.MD5 = &v + return s +} + +// SetRawContent sets the RawContent field's value. +func (s *ADMMessage) SetRawContent(v string) *ADMMessage { + s.RawContent = &v + return s +} + +// SetSilentPush sets the SilentPush field's value. +func (s *ADMMessage) SetSilentPush(v bool) *ADMMessage { + s.SilentPush = &v + return s +} + +// SetSmallImageIconUrl sets the SmallImageIconUrl field's value. +func (s *ADMMessage) SetSmallImageIconUrl(v string) *ADMMessage { + s.SmallImageIconUrl = &v + return s +} + +// SetSound sets the Sound field's value. +func (s *ADMMessage) SetSound(v string) *ADMMessage { + s.Sound = &v + return s +} + +// SetSubstitutions sets the Substitutions field's value. +func (s *ADMMessage) SetSubstitutions(v map[string][]*string) *ADMMessage { + s.Substitutions = v + return s +} + +// SetTitle sets the Title field's value. +func (s *ADMMessage) SetTitle(v string) *ADMMessage { + s.Title = &v + return s +} + +// SetUrl sets the Url field's value. +func (s *ADMMessage) SetUrl(v string) *ADMMessage { + s.Url = &v + return s +} + +// Specifies the status and settings of the APNs (Apple Push Notification service) +// channel for an application. +type APNSChannelRequest struct { + _ struct{} `type:"structure"` + + // The bundle identifier that's assigned to your iOS app. This identifier is + // used for APNs tokens. + BundleId *string `type:"string"` + + // The APNs client certificate that you received from Apple, if you want Amazon + // Pinpoint to communicate with APNs by using an APNs certificate. + Certificate *string `type:"string"` + + // The default authentication method that you want Amazon Pinpoint to use when + // authenticating with APNs, key or certificate. + DefaultAuthenticationMethod *string `type:"string"` + + // Specifies whether to enable the APNs channel for the application. + Enabled *bool `type:"boolean"` + + // The private key for the APNs client certificate that you want Amazon Pinpoint + // to use to communicate with APNs. + PrivateKey *string `type:"string"` + + // The identifier that's assigned to your Apple developer account team. This + // identifier is used for APNs tokens. + TeamId *string `type:"string"` + + // The authentication key to use for APNs tokens. + TokenKey *string `type:"string"` + + // The key identifier that's assigned to your APNs signing key, if you want + // Amazon Pinpoint to communicate with APNs by using APNs tokens. + TokenKeyId *string `type:"string"` +} + +// String returns the string representation +func (s APNSChannelRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s APNSChannelRequest) GoString() string { + return s.String() +} + +// SetBundleId sets the BundleId field's value. +func (s *APNSChannelRequest) SetBundleId(v string) *APNSChannelRequest { + s.BundleId = &v + return s +} + +// SetCertificate sets the Certificate field's value. +func (s *APNSChannelRequest) SetCertificate(v string) *APNSChannelRequest { + s.Certificate = &v + return s +} + +// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. +func (s *APNSChannelRequest) SetDefaultAuthenticationMethod(v string) *APNSChannelRequest { + s.DefaultAuthenticationMethod = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *APNSChannelRequest) SetEnabled(v bool) *APNSChannelRequest { + s.Enabled = &v + return s +} + +// SetPrivateKey sets the PrivateKey field's value. +func (s *APNSChannelRequest) SetPrivateKey(v string) *APNSChannelRequest { + s.PrivateKey = &v + return s +} + +// SetTeamId sets the TeamId field's value. +func (s *APNSChannelRequest) SetTeamId(v string) *APNSChannelRequest { + s.TeamId = &v + return s +} + +// SetTokenKey sets the TokenKey field's value. +func (s *APNSChannelRequest) SetTokenKey(v string) *APNSChannelRequest { + s.TokenKey = &v + return s +} + +// SetTokenKeyId sets the TokenKeyId field's value. +func (s *APNSChannelRequest) SetTokenKeyId(v string) *APNSChannelRequest { + s.TokenKeyId = &v + return s +} + +// Provides information about the status and settings of the APNs (Apple Push +// Notification service) channel for an application. +type APNSChannelResponse struct { + _ struct{} `type:"structure"` + + // The unique identifier for the application that the APNs channel applies to. + ApplicationId *string `type:"string"` + + // The date and time when the APNs channel was enabled. + CreationDate *string `type:"string"` + + // The default authentication method that Amazon Pinpoint uses to authenticate + // with APNs for this channel, key or certificate. + DefaultAuthenticationMethod *string `type:"string"` + + // Specifies whether the APNs channel is enabled for the application. + Enabled *bool `type:"boolean"` + + // (Not used) This property is retained only for backward compatibility. + HasCredential *bool `type:"boolean"` + + // Specifies whether the APNs channel is configured to communicate with APNs + // by using APNs tokens. To provide an authentication key for APNs tokens, set + // the TokenKey property of the channel. + HasTokenKey *bool `type:"boolean"` + + // (Deprecated) An identifier for the APNs channel. This property is retained + // only for backward compatibility. + Id *string `type:"string"` + + // Specifies whether the APNs channel is archived. + IsArchived *bool `type:"boolean"` + + // The user who last modified the APNs channel. + LastModifiedBy *string `type:"string"` + + // The date and time when the APNs channel was last modified. + LastModifiedDate *string `type:"string"` + + // The type of messaging or notification platform for the channel. For the APNs + // channel, this value is APNS. + // + // Platform is a required field + Platform *string `type:"string" required:"true"` + + // The current version of the APNs channel. + Version *int64 `type:"integer"` +} + +// String returns the string representation +func (s APNSChannelResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s APNSChannelResponse) GoString() string { + return s.String() +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *APNSChannelResponse) SetApplicationId(v string) *APNSChannelResponse { + s.ApplicationId = &v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *APNSChannelResponse) SetCreationDate(v string) *APNSChannelResponse { + s.CreationDate = &v + return s +} + +// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. +func (s *APNSChannelResponse) SetDefaultAuthenticationMethod(v string) *APNSChannelResponse { + s.DefaultAuthenticationMethod = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *APNSChannelResponse) SetEnabled(v bool) *APNSChannelResponse { + s.Enabled = &v + return s +} + +// SetHasCredential sets the HasCredential field's value. +func (s *APNSChannelResponse) SetHasCredential(v bool) *APNSChannelResponse { + s.HasCredential = &v + return s +} + +// SetHasTokenKey sets the HasTokenKey field's value. +func (s *APNSChannelResponse) SetHasTokenKey(v bool) *APNSChannelResponse { + s.HasTokenKey = &v + return s +} + +// SetId sets the Id field's value. +func (s *APNSChannelResponse) SetId(v string) *APNSChannelResponse { + s.Id = &v + return s +} + +// SetIsArchived sets the IsArchived field's value. +func (s *APNSChannelResponse) SetIsArchived(v bool) *APNSChannelResponse { + s.IsArchived = &v + return s +} + +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *APNSChannelResponse) SetLastModifiedBy(v string) *APNSChannelResponse { + s.LastModifiedBy = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *APNSChannelResponse) SetLastModifiedDate(v string) *APNSChannelResponse { + s.LastModifiedDate = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *APNSChannelResponse) SetPlatform(v string) *APNSChannelResponse { + s.Platform = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *APNSChannelResponse) SetVersion(v int64) *APNSChannelResponse { + s.Version = &v + return s +} + +// Specifies the settings for a one-time message that's sent directly to an +// endpoint through the APNs (Apple Push Notification service) channel. +type APNSMessage struct { + _ struct{} `type:"structure"` + + // The type of push notification to send. Valid values are: + // + // * alert - For a standard notification that's displayed on recipients' + // devices and prompts a recipient to interact with the notification. + // + // * background - For a silent notification that delivers content in the + // background and isn't displayed on recipients' devices. + // + // * complication - For a notification that contains update information for + // an app’s complication timeline. + // + // * fileprovider - For a notification that signals changes to a File Provider + // extension. + // + // * mdm - For a notification that tells managed devices to contact the MDM + // server. + // + // * voip - For a notification that provides information about an incoming + // VoIP call. + // + // Amazon Pinpoint specifies this value in the apns-push-type request header + // when it sends the notification message to APNs. If you don't specify a value + // for this property, Amazon Pinpoint sets the value to alert or background + // automatically, based on the value that you specify for the SilentPush or + // RawContent property of the message. + // + // For more information about the apns-push-type request header, see Sending + // Notification Requests to APNs (https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/sending_notification_requests_to_apns) + // on the Apple Developer website. + APNSPushType *string `type:"string"` + + // The action to occur if the recipient taps the push notification. Valid values + // are: + // + // * OPEN_APP - Your app opens or it becomes the foreground app if it was + // sent to the background. This is the default action. + // + // * DEEP_LINK - Your app opens and displays a designated user interface + // in the app. This setting uses the deep-linking features of the iOS platform. + // + // * URL - The default mobile browser on the recipient's device opens and + // loads the web page at a URL that you specify. + Action *string `type:"string" enum:"Action"` + + // The key that indicates whether and how to modify the badge of your app's + // icon when the recipient receives the push notification. If this key isn't + // included in the dictionary, the badge doesn't change. To remove the badge, + // set this value to 0. + Badge *int64 `type:"integer"` + + // The body of the notification message. + Body *string `type:"string"` + + // The key that indicates the notification type for the push notification. This + // key is a value that's defined by the identifier property of one of your app's + // registered categories. + Category *string `type:"string"` + + // An arbitrary identifier that, if assigned to multiple messages, APNs uses + // to coalesce the messages into a single push notification instead of delivering + // each message individually. This value can't exceed 64 bytes. + // + // Amazon Pinpoint specifies this value in the apns-collapse-id request header + // when it sends the notification message to APNs. + CollapseId *string `type:"string"` + + // The JSON payload to use for a silent push notification. This payload is added + // to the data.pinpoint.jsonBody object of the notification. + Data map[string]*string `type:"map"` + + // The URL of an image or video to display in the push notification. + MediaUrl *string `type:"string"` + + // The authentication method that you want Amazon Pinpoint to use when authenticating + // with APNs, CERTIFICATE or TOKEN. + PreferredAuthenticationMethod *string `type:"string"` + + // para>5 - Low priority, the notification might be delayed, delivered as part + // of a group, or throttled. + // /listitem> + // 10 - High priority, the notification is sent immediately. This is the default + // value. A high priority notification should trigger an alert, play a sound, + // or badge your app's icon on the recipient's device. + // /para> + // Amazon Pinpoint specifies this value in the apns-priority request header + // when it sends the notification message to APNs. + // + // The equivalent values for Firebase Cloud Messaging (FCM), formerly Google + // Cloud Messaging (GCM), are normal, for 5, and high, for 10. If you specify + // an FCM value for this property, Amazon Pinpoint accepts and converts the + // value to the corresponding APNs value. + Priority *string `type:"string"` + + // The raw, JSON-formatted string to use as the payload for the notification + // message. If specified, this value overrides all other content for the message. + // + // If you specify the raw content of an APNs push notification, the message + // payload has to include the content-available key. The value of the content-available + // key has to be an integer, and can only be 0 or 1. If you're sending a standard + // notification, set the value of content-available to 0. If you're sending + // a silent (background) notification, set the value of content-available to + // 1. Additionally, silent notification payloads can't include the alert, badge, + // or sound keys. For more information, see Generating a Remote Notification + // (https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification) + // and Pushing Background Updates to Your App (https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app) + // on the Apple Developer website. + RawContent *string `type:"string"` + + // Specifies whether the notification is a silent push notification. A silent + // (or background) push notification isn't displayed on recipients' devices. + // You can use silent push notifications to make small updates to your app, + // or to display messages in an in-app message center. + // + // Amazon Pinpoint uses this property to determine the correct value for the + // apns-push-type request header when it sends the notification message to APNs. + // If you specify a value of true for this property, Amazon Pinpoint sets the + // value for the apns-push-type header field to background. + // + // If you specify the raw content of an APNs push notification, the message + // payload has to include the content-available key. For silent (background) + // notifications, set the value of content-available to 1. Additionally, the + // message payload for a silent notification can't include the alert, badge, + // or sound keys. For more information, see Generating a Remote Notification + // (https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification) + // and Pushing Background Updates to Your App (https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/pushing_background_updates_to_your_app) + // on the Apple Developer website. + // + // Apple has indicated that they will throttle "excessive" background notifications + // based on current traffic volumes. To prevent your notifications being throttled, + // Apple recommends that you send no more than 3 silent push notifications to + // each recipient per hour. + SilentPush *bool `type:"boolean"` + + // The key for the sound to play when the recipient receives the push notification. + // The value for this key is the name of a sound file in your app's main bundle + // or the Library/Sounds folder in your app's data container. If the sound file + // can't be found or you specify default for the value, the system plays the + // default alert sound. + Sound *string `type:"string"` + + // The default message variables to use in the notification message. You can + // override these default variables with individual address variables. + Substitutions map[string][]*string `type:"map"` + + // The key that represents your app-specific identifier for grouping notifications. + // If you provide a Notification Content app extension, you can use this value + // to group your notifications together. + ThreadId *string `type:"string"` + + // The amount of time, in seconds, that APNs should store and attempt to deliver + // the push notification, if the service is unable to deliver the notification + // the first time. If this value is 0, APNs treats the notification as if it + // expires immediately and the service doesn't store or try to deliver the notification + // again. + // + // Amazon Pinpoint specifies this value in the apns-expiration request header + // when it sends the notification message to APNs. + TimeToLive *int64 `type:"integer"` + + // The title to display above the notification message on the recipient's device. + Title *string `type:"string"` + + // The URL to open in the recipient's default mobile browser, if a recipient + // taps the push notification and the value of the Action property is URL. + Url *string `type:"string"` +} + +// String returns the string representation +func (s APNSMessage) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s APNSMessage) GoString() string { + return s.String() +} + +// SetAPNSPushType sets the APNSPushType field's value. +func (s *APNSMessage) SetAPNSPushType(v string) *APNSMessage { + s.APNSPushType = &v + return s +} + +// SetAction sets the Action field's value. +func (s *APNSMessage) SetAction(v string) *APNSMessage { + s.Action = &v + return s +} + +// SetBadge sets the Badge field's value. +func (s *APNSMessage) SetBadge(v int64) *APNSMessage { + s.Badge = &v + return s +} + +// SetBody sets the Body field's value. +func (s *APNSMessage) SetBody(v string) *APNSMessage { + s.Body = &v + return s +} + +// SetCategory sets the Category field's value. +func (s *APNSMessage) SetCategory(v string) *APNSMessage { + s.Category = &v + return s +} + +// SetCollapseId sets the CollapseId field's value. +func (s *APNSMessage) SetCollapseId(v string) *APNSMessage { + s.CollapseId = &v + return s +} + +// SetData sets the Data field's value. +func (s *APNSMessage) SetData(v map[string]*string) *APNSMessage { + s.Data = v + return s +} + +// SetMediaUrl sets the MediaUrl field's value. +func (s *APNSMessage) SetMediaUrl(v string) *APNSMessage { + s.MediaUrl = &v + return s +} + +// SetPreferredAuthenticationMethod sets the PreferredAuthenticationMethod field's value. +func (s *APNSMessage) SetPreferredAuthenticationMethod(v string) *APNSMessage { + s.PreferredAuthenticationMethod = &v + return s +} + +// SetPriority sets the Priority field's value. +func (s *APNSMessage) SetPriority(v string) *APNSMessage { + s.Priority = &v + return s +} + +// SetRawContent sets the RawContent field's value. +func (s *APNSMessage) SetRawContent(v string) *APNSMessage { + s.RawContent = &v + return s +} + +// SetSilentPush sets the SilentPush field's value. +func (s *APNSMessage) SetSilentPush(v bool) *APNSMessage { + s.SilentPush = &v + return s +} + +// SetSound sets the Sound field's value. +func (s *APNSMessage) SetSound(v string) *APNSMessage { + s.Sound = &v + return s +} + +// SetSubstitutions sets the Substitutions field's value. +func (s *APNSMessage) SetSubstitutions(v map[string][]*string) *APNSMessage { + s.Substitutions = v + return s +} + +// SetThreadId sets the ThreadId field's value. +func (s *APNSMessage) SetThreadId(v string) *APNSMessage { + s.ThreadId = &v + return s +} + +// SetTimeToLive sets the TimeToLive field's value. +func (s *APNSMessage) SetTimeToLive(v int64) *APNSMessage { + s.TimeToLive = &v + return s +} + +// SetTitle sets the Title field's value. +func (s *APNSMessage) SetTitle(v string) *APNSMessage { + s.Title = &v + return s +} + +// SetUrl sets the Url field's value. +func (s *APNSMessage) SetUrl(v string) *APNSMessage { + s.Url = &v + return s +} + +// Specifies channel-specific content and settings for a message template that +// can be used in push notifications that are sent through the APNs (Apple Push +// Notification service) channel. +type APNSPushNotificationTemplate struct { + _ struct{} `type:"structure"` + + // The action to occur if a recipient taps a push notification that's based + // on the message template. Valid values are: + // + // * OPEN_APP - Your app opens or it becomes the foreground app if it was + // sent to the background. This is the default action. + // + // * DEEP_LINK - Your app opens and displays a designated user interface + // in the app. This setting uses the deep-linking features of the iOS platform. + // + // * URL - The default mobile browser on the recipient's device opens and + // loads the web page at a URL that you specify. + Action *string `type:"string" enum:"Action"` + + // The message body to use in push notifications that are based on the message + // template. + Body *string `type:"string"` + + // The URL of an image or video to display in push notifications that are based + // on the message template. + MediaUrl *string `type:"string"` + + // The raw, JSON-formatted string to use as the payload for push notifications + // that are based on the message template. If specified, this value overrides + // all other content for the message template. + RawContent *string `type:"string"` + + // The key for the sound to play when the recipient receives a push notification + // that's based on the message template. The value for this key is the name + // of a sound file in your app's main bundle or the Library/Sounds folder in + // your app's data container. If the sound file can't be found or you specify + // default for the value, the system plays the default alert sound. + Sound *string `type:"string"` + + // The title to use in push notifications that are based on the message template. + // This title appears above the notification message on a recipient's device. + Title *string `type:"string"` + + // The URL to open in the recipient's default mobile browser, if a recipient + // taps a push notification that's based on the message template and the value + // of the Action property is URL. + Url *string `type:"string"` +} + +// String returns the string representation +func (s APNSPushNotificationTemplate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s APNSPushNotificationTemplate) GoString() string { + return s.String() +} + +// SetAction sets the Action field's value. +func (s *APNSPushNotificationTemplate) SetAction(v string) *APNSPushNotificationTemplate { + s.Action = &v + return s +} + +// SetBody sets the Body field's value. +func (s *APNSPushNotificationTemplate) SetBody(v string) *APNSPushNotificationTemplate { + s.Body = &v + return s +} + +// SetMediaUrl sets the MediaUrl field's value. +func (s *APNSPushNotificationTemplate) SetMediaUrl(v string) *APNSPushNotificationTemplate { + s.MediaUrl = &v + return s +} + +// SetRawContent sets the RawContent field's value. +func (s *APNSPushNotificationTemplate) SetRawContent(v string) *APNSPushNotificationTemplate { + s.RawContent = &v + return s +} + +// SetSound sets the Sound field's value. +func (s *APNSPushNotificationTemplate) SetSound(v string) *APNSPushNotificationTemplate { + s.Sound = &v + return s +} + +// SetTitle sets the Title field's value. +func (s *APNSPushNotificationTemplate) SetTitle(v string) *APNSPushNotificationTemplate { + s.Title = &v + return s +} + +// SetUrl sets the Url field's value. +func (s *APNSPushNotificationTemplate) SetUrl(v string) *APNSPushNotificationTemplate { + s.Url = &v + return s +} + +// Specifies the status and settings of the APNs (Apple Push Notification service) +// sandbox channel for an application. +type APNSSandboxChannelRequest struct { + _ struct{} `type:"structure"` + + // The bundle identifier that's assigned to your iOS app. This identifier is + // used for APNs tokens. + BundleId *string `type:"string"` + + // The APNs client certificate that you received from Apple, if you want Amazon + // Pinpoint to communicate with the APNs sandbox environment by using an APNs + // certificate. + Certificate *string `type:"string"` + + // The default authentication method that you want Amazon Pinpoint to use when + // authenticating with the APNs sandbox environment, key or certificate. + DefaultAuthenticationMethod *string `type:"string"` + + // Specifies whether to enable the APNs sandbox channel for the application. + Enabled *bool `type:"boolean"` + + // The private key for the APNs client certificate that you want Amazon Pinpoint + // to use to communicate with the APNs sandbox environment. + PrivateKey *string `type:"string"` + + // The identifier that's assigned to your Apple developer account team. This + // identifier is used for APNs tokens. + TeamId *string `type:"string"` + + // The authentication key to use for APNs tokens. + TokenKey *string `type:"string"` + + // The key identifier that's assigned to your APNs signing key, if you want + // Amazon Pinpoint to communicate with the APNs sandbox environment by using + // APNs tokens. + TokenKeyId *string `type:"string"` +} + +// String returns the string representation +func (s APNSSandboxChannelRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s APNSSandboxChannelRequest) GoString() string { + return s.String() +} + +// SetBundleId sets the BundleId field's value. +func (s *APNSSandboxChannelRequest) SetBundleId(v string) *APNSSandboxChannelRequest { + s.BundleId = &v + return s +} + +// SetCertificate sets the Certificate field's value. +func (s *APNSSandboxChannelRequest) SetCertificate(v string) *APNSSandboxChannelRequest { + s.Certificate = &v + return s +} + +// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. +func (s *APNSSandboxChannelRequest) SetDefaultAuthenticationMethod(v string) *APNSSandboxChannelRequest { + s.DefaultAuthenticationMethod = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *APNSSandboxChannelRequest) SetEnabled(v bool) *APNSSandboxChannelRequest { + s.Enabled = &v + return s +} + +// SetPrivateKey sets the PrivateKey field's value. +func (s *APNSSandboxChannelRequest) SetPrivateKey(v string) *APNSSandboxChannelRequest { + s.PrivateKey = &v + return s +} + +// SetTeamId sets the TeamId field's value. +func (s *APNSSandboxChannelRequest) SetTeamId(v string) *APNSSandboxChannelRequest { + s.TeamId = &v + return s +} + +// SetTokenKey sets the TokenKey field's value. +func (s *APNSSandboxChannelRequest) SetTokenKey(v string) *APNSSandboxChannelRequest { + s.TokenKey = &v + return s +} + +// SetTokenKeyId sets the TokenKeyId field's value. +func (s *APNSSandboxChannelRequest) SetTokenKeyId(v string) *APNSSandboxChannelRequest { + s.TokenKeyId = &v + return s +} + +// Provides information about the status and settings of the APNs (Apple Push +// Notification service) sandbox channel for an application. +type APNSSandboxChannelResponse struct { + _ struct{} `type:"structure"` + + // The unique identifier for the application that the APNs sandbox channel applies + // to. + ApplicationId *string `type:"string"` + + // The date and time when the APNs sandbox channel was enabled. + CreationDate *string `type:"string"` + + // The default authentication method that Amazon Pinpoint uses to authenticate + // with the APNs sandbox environment for this channel, key or certificate. + DefaultAuthenticationMethod *string `type:"string"` + + // Specifies whether the APNs sandbox channel is enabled for the application. + Enabled *bool `type:"boolean"` + + // (Not used) This property is retained only for backward compatibility. + HasCredential *bool `type:"boolean"` + + // Specifies whether the APNs sandbox channel is configured to communicate with + // APNs by using APNs tokens. To provide an authentication key for APNs tokens, + // set the TokenKey property of the channel. + HasTokenKey *bool `type:"boolean"` + + // (Deprecated) An identifier for the APNs sandbox channel. This property is + // retained only for backward compatibility. + Id *string `type:"string"` + + // Specifies whether the APNs sandbox channel is archived. + IsArchived *bool `type:"boolean"` + + // The user who last modified the APNs sandbox channel. + LastModifiedBy *string `type:"string"` + + // The date and time when the APNs sandbox channel was last modified. + LastModifiedDate *string `type:"string"` + + // The type of messaging or notification platform for the channel. For the APNs + // sandbox channel, this value is APNS_SANDBOX. + // + // Platform is a required field + Platform *string `type:"string" required:"true"` + + // The current version of the APNs sandbox channel. + Version *int64 `type:"integer"` +} + +// String returns the string representation +func (s APNSSandboxChannelResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s APNSSandboxChannelResponse) GoString() string { + return s.String() +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *APNSSandboxChannelResponse) SetApplicationId(v string) *APNSSandboxChannelResponse { + s.ApplicationId = &v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *APNSSandboxChannelResponse) SetCreationDate(v string) *APNSSandboxChannelResponse { + s.CreationDate = &v + return s +} + +// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. +func (s *APNSSandboxChannelResponse) SetDefaultAuthenticationMethod(v string) *APNSSandboxChannelResponse { + s.DefaultAuthenticationMethod = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *APNSSandboxChannelResponse) SetEnabled(v bool) *APNSSandboxChannelResponse { + s.Enabled = &v + return s +} + +// SetHasCredential sets the HasCredential field's value. +func (s *APNSSandboxChannelResponse) SetHasCredential(v bool) *APNSSandboxChannelResponse { + s.HasCredential = &v + return s +} + +// SetHasTokenKey sets the HasTokenKey field's value. +func (s *APNSSandboxChannelResponse) SetHasTokenKey(v bool) *APNSSandboxChannelResponse { + s.HasTokenKey = &v + return s +} + +// SetId sets the Id field's value. +func (s *APNSSandboxChannelResponse) SetId(v string) *APNSSandboxChannelResponse { + s.Id = &v + return s +} + +// SetIsArchived sets the IsArchived field's value. +func (s *APNSSandboxChannelResponse) SetIsArchived(v bool) *APNSSandboxChannelResponse { + s.IsArchived = &v + return s +} + +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *APNSSandboxChannelResponse) SetLastModifiedBy(v string) *APNSSandboxChannelResponse { + s.LastModifiedBy = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *APNSSandboxChannelResponse) SetLastModifiedDate(v string) *APNSSandboxChannelResponse { + s.LastModifiedDate = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *APNSSandboxChannelResponse) SetPlatform(v string) *APNSSandboxChannelResponse { + s.Platform = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *APNSSandboxChannelResponse) SetVersion(v int64) *APNSSandboxChannelResponse { + s.Version = &v + return s +} + +// Specifies the status and settings of the APNs (Apple Push Notification service) +// VoIP channel for an application. +type APNSVoipChannelRequest struct { + _ struct{} `type:"structure"` + + // The bundle identifier that's assigned to your iOS app. This identifier is + // used for APNs tokens. + BundleId *string `type:"string"` + + // The APNs client certificate that you received from Apple, if you want Amazon + // Pinpoint to communicate with APNs by using an APNs certificate. + Certificate *string `type:"string"` + + // The default authentication method that you want Amazon Pinpoint to use when + // authenticating with APNs, key or certificate. + DefaultAuthenticationMethod *string `type:"string"` + + // Specifies whether to enable the APNs VoIP channel for the application. + Enabled *bool `type:"boolean"` + + // The private key for the APNs client certificate that you want Amazon Pinpoint + // to use to communicate with APNs. + PrivateKey *string `type:"string"` + + // The identifier that's assigned to your Apple developer account team. This + // identifier is used for APNs tokens. + TeamId *string `type:"string"` + + // The authentication key to use for APNs tokens. + TokenKey *string `type:"string"` + + // The key identifier that's assigned to your APNs signing key, if you want + // Amazon Pinpoint to communicate with APNs by using APNs tokens. + TokenKeyId *string `type:"string"` +} + +// String returns the string representation +func (s APNSVoipChannelRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s APNSVoipChannelRequest) GoString() string { + return s.String() +} + +// SetBundleId sets the BundleId field's value. +func (s *APNSVoipChannelRequest) SetBundleId(v string) *APNSVoipChannelRequest { + s.BundleId = &v + return s +} + +// SetCertificate sets the Certificate field's value. +func (s *APNSVoipChannelRequest) SetCertificate(v string) *APNSVoipChannelRequest { + s.Certificate = &v + return s +} + +// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. +func (s *APNSVoipChannelRequest) SetDefaultAuthenticationMethod(v string) *APNSVoipChannelRequest { + s.DefaultAuthenticationMethod = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *APNSVoipChannelRequest) SetEnabled(v bool) *APNSVoipChannelRequest { + s.Enabled = &v + return s +} + +// SetPrivateKey sets the PrivateKey field's value. +func (s *APNSVoipChannelRequest) SetPrivateKey(v string) *APNSVoipChannelRequest { + s.PrivateKey = &v + return s +} + +// SetTeamId sets the TeamId field's value. +func (s *APNSVoipChannelRequest) SetTeamId(v string) *APNSVoipChannelRequest { + s.TeamId = &v + return s +} + +// SetTokenKey sets the TokenKey field's value. +func (s *APNSVoipChannelRequest) SetTokenKey(v string) *APNSVoipChannelRequest { + s.TokenKey = &v + return s +} + +// SetTokenKeyId sets the TokenKeyId field's value. +func (s *APNSVoipChannelRequest) SetTokenKeyId(v string) *APNSVoipChannelRequest { + s.TokenKeyId = &v + return s +} + +// Provides information about the status and settings of the APNs (Apple Push +// Notification service) VoIP channel for an application. +type APNSVoipChannelResponse struct { + _ struct{} `type:"structure"` + + // The unique identifier for the application that the APNs VoIP channel applies + // to. + ApplicationId *string `type:"string"` + + // The date and time when the APNs VoIP channel was enabled. + CreationDate *string `type:"string"` + + // The default authentication method that Amazon Pinpoint uses to authenticate + // with APNs for this channel, key or certificate. + DefaultAuthenticationMethod *string `type:"string"` + + // Specifies whether the APNs VoIP channel is enabled for the application. + Enabled *bool `type:"boolean"` + + // (Not used) This property is retained only for backward compatibility. + HasCredential *bool `type:"boolean"` + + // Specifies whether the APNs VoIP channel is configured to communicate with + // APNs by using APNs tokens. To provide an authentication key for APNs tokens, + // set the TokenKey property of the channel. + HasTokenKey *bool `type:"boolean"` + + // (Deprecated) An identifier for the APNs VoIP channel. This property is retained + // only for backward compatibility. + Id *string `type:"string"` + + // Specifies whether the APNs VoIP channel is archived. + IsArchived *bool `type:"boolean"` + + // The user who last modified the APNs VoIP channel. + LastModifiedBy *string `type:"string"` + + // The date and time when the APNs VoIP channel was last modified. + LastModifiedDate *string `type:"string"` + + // The type of messaging or notification platform for the channel. For the APNs + // VoIP channel, this value is APNS_VOIP. + // + // Platform is a required field + Platform *string `type:"string" required:"true"` + + // The current version of the APNs VoIP channel. + Version *int64 `type:"integer"` +} + +// String returns the string representation +func (s APNSVoipChannelResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s APNSVoipChannelResponse) GoString() string { + return s.String() +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *APNSVoipChannelResponse) SetApplicationId(v string) *APNSVoipChannelResponse { + s.ApplicationId = &v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *APNSVoipChannelResponse) SetCreationDate(v string) *APNSVoipChannelResponse { + s.CreationDate = &v + return s +} + +// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. +func (s *APNSVoipChannelResponse) SetDefaultAuthenticationMethod(v string) *APNSVoipChannelResponse { + s.DefaultAuthenticationMethod = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *APNSVoipChannelResponse) SetEnabled(v bool) *APNSVoipChannelResponse { + s.Enabled = &v + return s +} + +// SetHasCredential sets the HasCredential field's value. +func (s *APNSVoipChannelResponse) SetHasCredential(v bool) *APNSVoipChannelResponse { + s.HasCredential = &v + return s +} + +// SetHasTokenKey sets the HasTokenKey field's value. +func (s *APNSVoipChannelResponse) SetHasTokenKey(v bool) *APNSVoipChannelResponse { + s.HasTokenKey = &v + return s +} + +// SetId sets the Id field's value. +func (s *APNSVoipChannelResponse) SetId(v string) *APNSVoipChannelResponse { + s.Id = &v + return s +} + +// SetIsArchived sets the IsArchived field's value. +func (s *APNSVoipChannelResponse) SetIsArchived(v bool) *APNSVoipChannelResponse { + s.IsArchived = &v + return s +} + +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *APNSVoipChannelResponse) SetLastModifiedBy(v string) *APNSVoipChannelResponse { + s.LastModifiedBy = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *APNSVoipChannelResponse) SetLastModifiedDate(v string) *APNSVoipChannelResponse { + s.LastModifiedDate = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *APNSVoipChannelResponse) SetPlatform(v string) *APNSVoipChannelResponse { + s.Platform = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *APNSVoipChannelResponse) SetVersion(v int64) *APNSVoipChannelResponse { + s.Version = &v + return s +} + +// Specifies the status and settings of the APNs (Apple Push Notification service) +// VoIP sandbox channel for an application. +type APNSVoipSandboxChannelRequest struct { + _ struct{} `type:"structure"` + + // The bundle identifier that's assigned to your iOS app. This identifier is + // used for APNs tokens. + BundleId *string `type:"string"` + + // The APNs client certificate that you received from Apple, if you want Amazon + // Pinpoint to communicate with the APNs sandbox environment by using an APNs + // certificate. + Certificate *string `type:"string"` + + // The default authentication method that you want Amazon Pinpoint to use when + // authenticating with the APNs sandbox environment for this channel, key or + // certificate. + DefaultAuthenticationMethod *string `type:"string"` + + // Specifies whether the APNs VoIP sandbox channel is enabled for the application. + Enabled *bool `type:"boolean"` + + // The private key for the APNs client certificate that you want Amazon Pinpoint + // to use to communicate with the APNs sandbox environment. + PrivateKey *string `type:"string"` + + // The identifier that's assigned to your Apple developer account team. This + // identifier is used for APNs tokens. + TeamId *string `type:"string"` + + // The authentication key to use for APNs tokens. + TokenKey *string `type:"string"` + + // The key identifier that's assigned to your APNs signing key, if you want + // Amazon Pinpoint to communicate with the APNs sandbox environment by using + // APNs tokens. + TokenKeyId *string `type:"string"` +} + +// String returns the string representation +func (s APNSVoipSandboxChannelRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s APNSVoipSandboxChannelRequest) GoString() string { + return s.String() +} + +// SetBundleId sets the BundleId field's value. +func (s *APNSVoipSandboxChannelRequest) SetBundleId(v string) *APNSVoipSandboxChannelRequest { + s.BundleId = &v + return s +} + +// SetCertificate sets the Certificate field's value. +func (s *APNSVoipSandboxChannelRequest) SetCertificate(v string) *APNSVoipSandboxChannelRequest { + s.Certificate = &v + return s +} + +// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. +func (s *APNSVoipSandboxChannelRequest) SetDefaultAuthenticationMethod(v string) *APNSVoipSandboxChannelRequest { + s.DefaultAuthenticationMethod = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *APNSVoipSandboxChannelRequest) SetEnabled(v bool) *APNSVoipSandboxChannelRequest { + s.Enabled = &v + return s +} + +// SetPrivateKey sets the PrivateKey field's value. +func (s *APNSVoipSandboxChannelRequest) SetPrivateKey(v string) *APNSVoipSandboxChannelRequest { + s.PrivateKey = &v + return s +} + +// SetTeamId sets the TeamId field's value. +func (s *APNSVoipSandboxChannelRequest) SetTeamId(v string) *APNSVoipSandboxChannelRequest { + s.TeamId = &v + return s +} + +// SetTokenKey sets the TokenKey field's value. +func (s *APNSVoipSandboxChannelRequest) SetTokenKey(v string) *APNSVoipSandboxChannelRequest { + s.TokenKey = &v + return s +} + +// SetTokenKeyId sets the TokenKeyId field's value. +func (s *APNSVoipSandboxChannelRequest) SetTokenKeyId(v string) *APNSVoipSandboxChannelRequest { + s.TokenKeyId = &v + return s +} + +// Provides information about the status and settings of the APNs (Apple Push +// Notification service) VoIP sandbox channel for an application. +type APNSVoipSandboxChannelResponse struct { + _ struct{} `type:"structure"` + + // The unique identifier for the application that the APNs VoIP sandbox channel + // applies to. + ApplicationId *string `type:"string"` + + // The date and time when the APNs VoIP sandbox channel was enabled. + CreationDate *string `type:"string"` + + // The default authentication method that Amazon Pinpoint uses to authenticate + // with the APNs sandbox environment for this channel, key or certificate. + DefaultAuthenticationMethod *string `type:"string"` + + // Specifies whether the APNs VoIP sandbox channel is enabled for the application. + Enabled *bool `type:"boolean"` + + // (Not used) This property is retained only for backward compatibility. + HasCredential *bool `type:"boolean"` + + // Specifies whether the APNs VoIP sandbox channel is configured to communicate + // with APNs by using APNs tokens. To provide an authentication key for APNs + // tokens, set the TokenKey property of the channel. + HasTokenKey *bool `type:"boolean"` + + // (Deprecated) An identifier for the APNs VoIP sandbox channel. This property + // is retained only for backward compatibility. + Id *string `type:"string"` + + // Specifies whether the APNs VoIP sandbox channel is archived. + IsArchived *bool `type:"boolean"` + + // The user who last modified the APNs VoIP sandbox channel. + LastModifiedBy *string `type:"string"` + + // The date and time when the APNs VoIP sandbox channel was last modified. + LastModifiedDate *string `type:"string"` + + // The type of messaging or notification platform for the channel. For the APNs + // VoIP sandbox channel, this value is APNS_VOIP_SANDBOX. + // + // Platform is a required field + Platform *string `type:"string" required:"true"` + + // The current version of the APNs VoIP sandbox channel. + Version *int64 `type:"integer"` +} + +// String returns the string representation +func (s APNSVoipSandboxChannelResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s APNSVoipSandboxChannelResponse) GoString() string { + return s.String() +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *APNSVoipSandboxChannelResponse) SetApplicationId(v string) *APNSVoipSandboxChannelResponse { + s.ApplicationId = &v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *APNSVoipSandboxChannelResponse) SetCreationDate(v string) *APNSVoipSandboxChannelResponse { + s.CreationDate = &v + return s +} + +// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. +func (s *APNSVoipSandboxChannelResponse) SetDefaultAuthenticationMethod(v string) *APNSVoipSandboxChannelResponse { + s.DefaultAuthenticationMethod = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *APNSVoipSandboxChannelResponse) SetEnabled(v bool) *APNSVoipSandboxChannelResponse { + s.Enabled = &v + return s +} + +// SetHasCredential sets the HasCredential field's value. +func (s *APNSVoipSandboxChannelResponse) SetHasCredential(v bool) *APNSVoipSandboxChannelResponse { + s.HasCredential = &v + return s +} + +// SetHasTokenKey sets the HasTokenKey field's value. +func (s *APNSVoipSandboxChannelResponse) SetHasTokenKey(v bool) *APNSVoipSandboxChannelResponse { + s.HasTokenKey = &v + return s +} + +// SetId sets the Id field's value. +func (s *APNSVoipSandboxChannelResponse) SetId(v string) *APNSVoipSandboxChannelResponse { + s.Id = &v + return s +} + +// SetIsArchived sets the IsArchived field's value. +func (s *APNSVoipSandboxChannelResponse) SetIsArchived(v bool) *APNSVoipSandboxChannelResponse { + s.IsArchived = &v + return s +} + +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *APNSVoipSandboxChannelResponse) SetLastModifiedBy(v string) *APNSVoipSandboxChannelResponse { + s.LastModifiedBy = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *APNSVoipSandboxChannelResponse) SetLastModifiedDate(v string) *APNSVoipSandboxChannelResponse { + s.LastModifiedDate = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *APNSVoipSandboxChannelResponse) SetPlatform(v string) *APNSVoipSandboxChannelResponse { + s.Platform = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *APNSVoipSandboxChannelResponse) SetVersion(v int64) *APNSVoipSandboxChannelResponse { + s.Version = &v + return s +} + +// Provides information about the activities that were performed by a campaign. +type ActivitiesResponse struct { + _ struct{} `type:"structure"` + + // An array of responses, one for each activity that was performed by the campaign. + // + // Item is a required field + Item []*ActivityResponse `type:"list" required:"true"` + + // The string to use in a subsequent request to get the next page of results + // in a paginated response. This value is null if there are no additional pages. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ActivitiesResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ActivitiesResponse) GoString() string { + return s.String() +} + +// SetItem sets the Item field's value. +func (s *ActivitiesResponse) SetItem(v []*ActivityResponse) *ActivitiesResponse { + s.Item = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ActivitiesResponse) SetNextToken(v string) *ActivitiesResponse { + s.NextToken = &v + return s +} + +// Specifies the configuration and other settings for an activity in a journey. +type Activity struct { + _ struct{} `type:"structure"` + + // The settings for a yes/no split activity. This type of activity sends participants + // down one of two paths in a journey, based on conditions that you specify. + ConditionalSplit *ConditionalSplitActivity `type:"structure"` + + // The custom description of the activity. + Description *string `type:"string"` + + // The settings for an email activity. This type of activity sends an email + // message to participants. + EMAIL *EmailMessageActivity `type:"structure"` + + // The settings for a holdout activity. This type of activity stops a journey + // for a specified percentage of participants. + Holdout *HoldoutActivity `type:"structure"` + + // The settings for a multivariate split activity. This type of activity sends + // participants down one of as many as five paths (including a default Else + // path) in a journey, based on conditions that you specify. + MultiCondition *MultiConditionalSplitActivity `type:"structure"` + + // The settings for a random split activity. This type of activity randomly + // sends specified percentages of participants down one of as many as five paths + // in a journey, based on conditions that you specify. + RandomSplit *RandomSplitActivity `type:"structure"` + + // The settings for a wait activity. This type of activity waits for a certain + // amount of time or until a specific date and time before moving participants + // to the next activity in a journey. + Wait *WaitActivity `type:"structure"` +} + +// 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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Activity) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Activity"} + if s.ConditionalSplit != nil { + if err := s.ConditionalSplit.Validate(); err != nil { + invalidParams.AddNested("ConditionalSplit", err.(request.ErrInvalidParams)) + } + } + if s.Holdout != nil { + if err := s.Holdout.Validate(); err != nil { + invalidParams.AddNested("Holdout", err.(request.ErrInvalidParams)) + } + } + if s.MultiCondition != nil { + if err := s.MultiCondition.Validate(); err != nil { + invalidParams.AddNested("MultiCondition", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConditionalSplit sets the ConditionalSplit field's value. +func (s *Activity) SetConditionalSplit(v *ConditionalSplitActivity) *Activity { + s.ConditionalSplit = v + return s +} + +// SetDescription sets the Description field's value. +func (s *Activity) SetDescription(v string) *Activity { + s.Description = &v + return s +} + +// SetEMAIL sets the EMAIL field's value. +func (s *Activity) SetEMAIL(v *EmailMessageActivity) *Activity { + s.EMAIL = v + return s +} + +// SetHoldout sets the Holdout field's value. +func (s *Activity) SetHoldout(v *HoldoutActivity) *Activity { + s.Holdout = v + return s +} + +// SetMultiCondition sets the MultiCondition field's value. +func (s *Activity) SetMultiCondition(v *MultiConditionalSplitActivity) *Activity { + s.MultiCondition = v + return s +} + +// SetRandomSplit sets the RandomSplit field's value. +func (s *Activity) SetRandomSplit(v *RandomSplitActivity) *Activity { + s.RandomSplit = v + return s +} + +// SetWait sets the Wait field's value. +func (s *Activity) SetWait(v *WaitActivity) *Activity { + s.Wait = v + return s +} + +// Provides information about an activity that was performed by a campaign. +type ActivityResponse struct { + _ struct{} `type:"structure"` + + // The unique identifier for the application that the campaign applies to. + // + // ApplicationId is a required field + ApplicationId *string `type:"string" required:"true"` + + // The unique identifier for the campaign that the activity applies to. + // + // CampaignId is a required field + CampaignId *string `type:"string" required:"true"` + + // The actual time, in ISO 8601 format, when the activity was marked CANCELLED + // or COMPLETED. + End *string `type:"string"` + + // The unique identifier for the activity. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // Specifies whether the activity succeeded. Possible values are SUCCESS and + // FAIL. + Result *string `type:"string"` + + // The scheduled start time, in ISO 8601 format, for the activity. + ScheduledStart *string `type:"string"` + + // The actual start time, in ISO 8601 format, of the activity. + Start *string `type:"string"` + + // The current status of the activity. Possible values are: PENDING, INITIALIZING, + // RUNNING, PAUSED, CANCELLED, and COMPLETED. + State *string `type:"string"` + + // The total number of endpoints that the campaign successfully delivered messages + // to. + SuccessfulEndpointCount *int64 `type:"integer"` + + // The total number of time zones that were completed. + TimezonesCompletedCount *int64 `type:"integer"` + + // The total number of unique time zones that are in the segment for the campaign. + TimezonesTotalCount *int64 `type:"integer"` + + // The total number of endpoints that the campaign attempted to deliver messages + // to. + TotalEndpointCount *int64 `type:"integer"` + + // The unique identifier for the campaign treatment that the activity applies + // to. A treatment is a variation of a campaign that's used for A/B testing + // of a campaign. + TreatmentId *string `type:"string"` +} + +// String returns the string representation +func (s ActivityResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ActivityResponse) GoString() string { + return s.String() +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *ActivityResponse) SetApplicationId(v string) *ActivityResponse { + s.ApplicationId = &v + return s +} + +// SetCampaignId sets the CampaignId field's value. +func (s *ActivityResponse) SetCampaignId(v string) *ActivityResponse { + s.CampaignId = &v + return s +} + +// SetEnd sets the End field's value. +func (s *ActivityResponse) SetEnd(v string) *ActivityResponse { + s.End = &v + return s +} + +// SetId sets the Id field's value. +func (s *ActivityResponse) SetId(v string) *ActivityResponse { + s.Id = &v + return s +} + +// SetResult sets the Result field's value. +func (s *ActivityResponse) SetResult(v string) *ActivityResponse { + s.Result = &v + return s +} + +// SetScheduledStart sets the ScheduledStart field's value. +func (s *ActivityResponse) SetScheduledStart(v string) *ActivityResponse { + s.ScheduledStart = &v + return s +} + +// SetStart sets the Start field's value. +func (s *ActivityResponse) SetStart(v string) *ActivityResponse { + s.Start = &v + return s +} + +// SetState sets the State field's value. +func (s *ActivityResponse) SetState(v string) *ActivityResponse { + s.State = &v + return s +} + +// SetSuccessfulEndpointCount sets the SuccessfulEndpointCount field's value. +func (s *ActivityResponse) SetSuccessfulEndpointCount(v int64) *ActivityResponse { + s.SuccessfulEndpointCount = &v + return s +} + +// SetTimezonesCompletedCount sets the TimezonesCompletedCount field's value. +func (s *ActivityResponse) SetTimezonesCompletedCount(v int64) *ActivityResponse { + s.TimezonesCompletedCount = &v + return s +} + +// SetTimezonesTotalCount sets the TimezonesTotalCount field's value. +func (s *ActivityResponse) SetTimezonesTotalCount(v int64) *ActivityResponse { + s.TimezonesTotalCount = &v + return s +} + +// SetTotalEndpointCount sets the TotalEndpointCount field's value. +func (s *ActivityResponse) SetTotalEndpointCount(v int64) *ActivityResponse { + s.TotalEndpointCount = &v + return s +} + +// SetTreatmentId sets the TreatmentId field's value. +func (s *ActivityResponse) SetTreatmentId(v string) *ActivityResponse { + s.TreatmentId = &v + return s +} + +// Specifies address-based configuration settings for a message that's sent +// directly to an endpoint. +type AddressConfiguration struct { + _ struct{} `type:"structure"` + + // The message body to use instead of the default message body. This value overrides + // the default message body. + BodyOverride *string `type:"string"` + + // The channel to use when sending the message. + ChannelType *string `type:"string" enum:"ChannelType"` + + // An object that maps custom attributes to attributes for the address and is + // attached to the message. For a push notification, this payload is added to + // the data.pinpoint object. For an email or text message, this payload is added + // to email/SMS delivery receipt event attributes. + Context map[string]*string `type:"map"` + + // The raw, JSON-formatted string to use as the payload for the message. If + // specified, this value overrides all other values for the message. + RawContent *string `type:"string"` + + // A map of the message variables to merge with the variables specified by properties + // of the DefaultMessage object. The variables specified in this map take precedence + // over all other variables. + Substitutions map[string][]*string `type:"map"` + + // The message title to use instead of the default message title. This value + // overrides the default message title. + TitleOverride *string `type:"string"` +} + +// String returns the string representation +func (s AddressConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AddressConfiguration) GoString() string { + return s.String() +} + +// SetBodyOverride sets the BodyOverride field's value. +func (s *AddressConfiguration) SetBodyOverride(v string) *AddressConfiguration { + s.BodyOverride = &v + return s +} + +// SetChannelType sets the ChannelType field's value. +func (s *AddressConfiguration) SetChannelType(v string) *AddressConfiguration { + s.ChannelType = &v + return s +} + +// SetContext sets the Context field's value. +func (s *AddressConfiguration) SetContext(v map[string]*string) *AddressConfiguration { + s.Context = v + return s +} + +// SetRawContent sets the RawContent field's value. +func (s *AddressConfiguration) SetRawContent(v string) *AddressConfiguration { + s.RawContent = &v + return s +} + +// SetSubstitutions sets the Substitutions field's value. +func (s *AddressConfiguration) SetSubstitutions(v map[string][]*string) *AddressConfiguration { + s.Substitutions = v + return s +} + +// SetTitleOverride sets the TitleOverride field's value. +func (s *AddressConfiguration) SetTitleOverride(v string) *AddressConfiguration { + s.TitleOverride = &v + return s +} + +// Specifies channel-specific content and settings for a message template that +// can be used in push notifications that are sent through the ADM (Amazon Device +// Messaging), Baidu (Baidu Cloud Push), or GCM (Firebase Cloud Messaging, formerly +// Google Cloud Messaging) channel. +type AndroidPushNotificationTemplate struct { + _ struct{} `type:"structure"` + + // The action to occur if a recipient taps a push notification that's based + // on the message template. Valid values are: + // + // * OPEN_APP - Your app opens or it becomes the foreground app if it was + // sent to the background. This is the default action. + // + // * DEEP_LINK - Your app opens and displays a designated user interface + // in the app. This action uses the deep-linking features of the Android + // platform. + // + // * URL - The default mobile browser on the recipient's device opens and + // loads the web page at a URL that you specify. + Action *string `type:"string" enum:"Action"` + + // The message body to use in a push notification that's based on the message + // template. + Body *string `type:"string"` + + // The URL of the large icon image to display in the content view of a push + // notification that's based on the message template. + ImageIconUrl *string `type:"string"` + + // The URL of an image to display in a push notification that's based on the + // message template. + ImageUrl *string `type:"string"` + + // The raw, JSON-formatted string to use as the payload for a push notification + // that's based on the message template. If specified, this value overrides + // all other content for the message template. + RawContent *string `type:"string"` + + // The URL of the small icon image to display in the status bar and the content + // view of a push notification that's based on the message template. + SmallImageIconUrl *string `type:"string"` + + // The sound to play when a recipient receives a push notification that's based + // on the message template. You can use the default stream or specify the file + // name of a sound resource that's bundled in your app. On an Android platform, + // the sound file must reside in /res/raw/. + Sound *string `type:"string"` + + // The title to use in a push notification that's based on the message template. + // This title appears above the notification message on a recipient's device. + Title *string `type:"string"` + + // The URL to open in a recipient's default mobile browser, if a recipient taps + // a a push notification that's based on the message template and the value + // of the Action property is URL. + Url *string `type:"string"` +} + +// String returns the string representation +func (s AndroidPushNotificationTemplate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AndroidPushNotificationTemplate) GoString() string { + return s.String() +} + +// SetAction sets the Action field's value. +func (s *AndroidPushNotificationTemplate) SetAction(v string) *AndroidPushNotificationTemplate { + s.Action = &v + return s +} + +// SetBody sets the Body field's value. +func (s *AndroidPushNotificationTemplate) SetBody(v string) *AndroidPushNotificationTemplate { + s.Body = &v + return s +} + +// SetImageIconUrl sets the ImageIconUrl field's value. +func (s *AndroidPushNotificationTemplate) SetImageIconUrl(v string) *AndroidPushNotificationTemplate { + s.ImageIconUrl = &v + return s +} + +// SetImageUrl sets the ImageUrl field's value. +func (s *AndroidPushNotificationTemplate) SetImageUrl(v string) *AndroidPushNotificationTemplate { + s.ImageUrl = &v + return s +} + +// SetRawContent sets the RawContent field's value. +func (s *AndroidPushNotificationTemplate) SetRawContent(v string) *AndroidPushNotificationTemplate { + s.RawContent = &v + return s +} + +// SetSmallImageIconUrl sets the SmallImageIconUrl field's value. +func (s *AndroidPushNotificationTemplate) SetSmallImageIconUrl(v string) *AndroidPushNotificationTemplate { + s.SmallImageIconUrl = &v + return s +} + +// SetSound sets the Sound field's value. +func (s *AndroidPushNotificationTemplate) SetSound(v string) *AndroidPushNotificationTemplate { + s.Sound = &v + return s +} + +// SetTitle sets the Title field's value. +func (s *AndroidPushNotificationTemplate) SetTitle(v string) *AndroidPushNotificationTemplate { + s.Title = &v + return s +} + +// SetUrl sets the Url field's value. +func (s *AndroidPushNotificationTemplate) SetUrl(v string) *AndroidPushNotificationTemplate { + s.Url = &v + return s +} + +// Provides the results of a query that retrieved the data for a standard metric +// that applies to an application, and provides information about that query. +type ApplicationDateRangeKpiResponse struct { + _ struct{} `type:"structure"` + + // The unique identifier for the application that the metric applies to. + // + // ApplicationId is a required field + ApplicationId *string `type:"string" required:"true"` + + // EndTime is a required field + EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // The name of the metric, also referred to as a key performance indicator (KPI), + // that the data was retrieved for. This value describes the associated metric + // and consists of two or more terms, which are comprised of lowercase alphanumeric + // characters, separated by a hyphen. For a list of possible values, see the + // Amazon Pinpoint Developer Guide (https://docs.aws.amazon.com/pinpoint/latest/developerguide/welcome.html). + // + // KpiName is a required field + KpiName *string `type:"string" required:"true"` + + // An array of objects that contains the results of the query. Each object contains + // the value for the metric and metadata about that value. + // + // KpiResult is a required field + KpiResult *BaseKpiResult `type:"structure" required:"true"` + + // The string to use in a subsequent request to get the next page of results + // in a paginated response. This value is null for the Application Metrics resource + // because the resource returns all results in a single page. + NextToken *string `type:"string"` + + // StartTime is a required field + StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` +} + +// String returns the string representation +func (s ApplicationDateRangeKpiResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApplicationDateRangeKpiResponse) GoString() string { + return s.String() +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *ApplicationDateRangeKpiResponse) SetApplicationId(v string) *ApplicationDateRangeKpiResponse { + s.ApplicationId = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *ApplicationDateRangeKpiResponse) SetEndTime(v time.Time) *ApplicationDateRangeKpiResponse { + s.EndTime = &v + return s +} + +// SetKpiName sets the KpiName field's value. +func (s *ApplicationDateRangeKpiResponse) SetKpiName(v string) *ApplicationDateRangeKpiResponse { + s.KpiName = &v + return s +} + +// SetKpiResult sets the KpiResult field's value. +func (s *ApplicationDateRangeKpiResponse) SetKpiResult(v *BaseKpiResult) *ApplicationDateRangeKpiResponse { + s.KpiResult = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ApplicationDateRangeKpiResponse) SetNextToken(v string) *ApplicationDateRangeKpiResponse { + s.NextToken = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *ApplicationDateRangeKpiResponse) SetStartTime(v time.Time) *ApplicationDateRangeKpiResponse { + s.StartTime = &v + return s +} + +// Provides information about an application. +type ApplicationResponse struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the application. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // The unique identifier for the application. This identifier is displayed as + // the Project ID on the Amazon Pinpoint console. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // The display name of the application. This name is displayed as the Project + // name on the Amazon Pinpoint console. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // A string-to-string map of key-value pairs that identifies the tags that are + // associated with the application. Each tag consists of a required tag key + // and an associated tag value. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s ApplicationResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApplicationResponse) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *ApplicationResponse) SetArn(v string) *ApplicationResponse { + s.Arn = &v + return s +} + +// SetId sets the Id field's value. +func (s *ApplicationResponse) SetId(v string) *ApplicationResponse { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *ApplicationResponse) SetName(v string) *ApplicationResponse { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *ApplicationResponse) SetTags(v map[string]*string) *ApplicationResponse { + s.Tags = v + return s +} + +// Provides information about an application, including the default settings +// for an application. +type ApplicationSettingsResource struct { + _ struct{} `type:"structure"` + + // The unique identifier for the application. This identifier is displayed as + // the Project ID on the Amazon Pinpoint console. + // + // ApplicationId is a required field + ApplicationId *string `type:"string" required:"true"` + + // The settings for the AWS Lambda function to use by default as a code hook + // for campaigns in the application. + CampaignHook *CampaignHook `type:"structure"` + + // The date and time, in ISO 8601 format, when the application's settings were + // last modified. + LastModifiedDate *string `type:"string"` + + // The default sending limits for campaigns in the application. + Limits *CampaignLimits `type:"structure"` + + // The default quiet time for campaigns and journeys in the application. Quiet + // time is a specific time range when messages aren't sent to endpoints, if + // all the following conditions are met: + // + // * The EndpointDemographic.Timezone property of the endpoint is set to + // a valid value. + // + // * The current time in the endpoint's time zone is later than or equal + // to the time specified by the QuietTime.Start property for the application + // (or a campaign or journey that has custom quiet time settings). + // + // * The current time in the endpoint's time zone is earlier than or equal + // to the time specified by the QuietTime.End property for the application + // (or a campaign or journey that has custom quiet time settings). + // + // If any of the preceding conditions isn't met, the endpoint will receive messages + // from a campaign or journey, even if quiet time is enabled. + QuietTime *QuietTime `type:"structure"` +} + +// String returns the string representation +func (s ApplicationSettingsResource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApplicationSettingsResource) GoString() string { + return s.String() +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *ApplicationSettingsResource) SetApplicationId(v string) *ApplicationSettingsResource { + s.ApplicationId = &v + return s +} + +// SetCampaignHook sets the CampaignHook field's value. +func (s *ApplicationSettingsResource) SetCampaignHook(v *CampaignHook) *ApplicationSettingsResource { + s.CampaignHook = v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *ApplicationSettingsResource) SetLastModifiedDate(v string) *ApplicationSettingsResource { + s.LastModifiedDate = &v + return s +} + +// SetLimits sets the Limits field's value. +func (s *ApplicationSettingsResource) SetLimits(v *CampaignLimits) *ApplicationSettingsResource { + s.Limits = v + return s +} + +// SetQuietTime sets the QuietTime field's value. +func (s *ApplicationSettingsResource) SetQuietTime(v *QuietTime) *ApplicationSettingsResource { + s.QuietTime = v + return s +} + +// Provides information about all of your applications. +type ApplicationsResponse struct { + _ struct{} `type:"structure"` + + // An array of responses, one for each application that was returned. + Item []*ApplicationResponse `type:"list"` + + // The string to use in a subsequent request to get the next page of results + // in a paginated response. This value is null if there are no additional pages. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s ApplicationsResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ApplicationsResponse) GoString() string { + return s.String() +} + +// SetItem sets the Item field's value. +func (s *ApplicationsResponse) SetItem(v []*ApplicationResponse) *ApplicationsResponse { + s.Item = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ApplicationsResponse) SetNextToken(v string) *ApplicationsResponse { + s.NextToken = &v + return s +} + +// Specifies attribute-based criteria for including or excluding endpoints from +// a segment. +type AttributeDimension struct { + _ struct{} `type:"structure"` + + // The type of segment dimension to use. Valid values are: INCLUSIVE, endpoints + // that match the criteria are included in the segment; and, EXCLUSIVE, endpoints + // that match the criteria are excluded from the segment. + AttributeType *string `type:"string" enum:"AttributeType"` + + // The criteria values to use for the segment dimension. Depending on the value + // of the AttributeType property, endpoints are included or excluded from the + // segment if their attribute values match the criteria values. + // + // Values is a required field + Values []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s AttributeDimension) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttributeDimension) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AttributeDimension) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AttributeDimension"} + if s.Values == nil { + invalidParams.Add(request.NewErrParamRequired("Values")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAttributeType sets the AttributeType field's value. +func (s *AttributeDimension) SetAttributeType(v string) *AttributeDimension { + s.AttributeType = &v + return s +} + +// SetValues sets the Values field's value. +func (s *AttributeDimension) SetValues(v []*string) *AttributeDimension { + s.Values = v + return s +} + +// Provides information about the type and the names of attributes that were +// removed from all the endpoints that are associated with an application. +type AttributesResource struct { + _ struct{} `type:"structure"` + + // The unique identifier for the application. + // + // ApplicationId is a required field + ApplicationId *string `type:"string" required:"true"` + + // The type of attribute or attributes that were removed from the endpoints. + // Valid values are: + // + // * endpoint-custom-attributes - Custom attributes that describe endpoints. + // + // * endpoint-metric-attributes - Custom metrics that your app reports to + // Amazon Pinpoint for endpoints. + // + // * endpoint-user-attributes - Custom attributes that describe users. + // + // AttributeType is a required field + AttributeType *string `type:"string" required:"true"` + + // An array that specifies the names of the attributes that were removed from + // the endpoints. + Attributes []*string `type:"list"` +} + +// String returns the string representation +func (s AttributesResource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AttributesResource) GoString() string { + return s.String() +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *AttributesResource) SetApplicationId(v string) *AttributesResource { + s.ApplicationId = &v + return s +} + +// SetAttributeType sets the AttributeType field's value. +func (s *AttributesResource) SetAttributeType(v string) *AttributesResource { + s.AttributeType = &v + return s +} + +// SetAttributes sets the Attributes field's value. +func (s *AttributesResource) SetAttributes(v []*string) *AttributesResource { + s.Attributes = v + return s +} + +// Provides information about an API request or response. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + RequestID_ *string `locationName:"RequestID" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// Specifies the status and settings of the Baidu (Baidu Cloud Push) channel +// for an application. +type BaiduChannelRequest struct { + _ struct{} `type:"structure"` + + // The API key that you received from the Baidu Cloud Push service to communicate + // with the service. + // + // ApiKey is a required field + ApiKey *string `type:"string" required:"true"` + + // Specifies whether to enable the Baidu channel for the application. + Enabled *bool `type:"boolean"` + + // The secret key that you received from the Baidu Cloud Push service to communicate + // with the service. + // + // SecretKey is a required field + SecretKey *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s BaiduChannelRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BaiduChannelRequest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *BaiduChannelRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "BaiduChannelRequest"} + if s.ApiKey == nil { + invalidParams.Add(request.NewErrParamRequired("ApiKey")) + } + if s.SecretKey == nil { + invalidParams.Add(request.NewErrParamRequired("SecretKey")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApiKey sets the ApiKey field's value. +func (s *BaiduChannelRequest) SetApiKey(v string) *BaiduChannelRequest { + s.ApiKey = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *BaiduChannelRequest) SetEnabled(v bool) *BaiduChannelRequest { + s.Enabled = &v + return s +} + +// SetSecretKey sets the SecretKey field's value. +func (s *BaiduChannelRequest) SetSecretKey(v string) *BaiduChannelRequest { + s.SecretKey = &v + return s +} + +// Provides information about the status and settings of the Baidu (Baidu Cloud +// Push) channel for an application. +type BaiduChannelResponse struct { + _ struct{} `type:"structure"` + + // The unique identifier for the application that the Baidu channel applies + // to. + ApplicationId *string `type:"string"` + + // The date and time when the Baidu channel was enabled. + CreationDate *string `type:"string"` + + // The API key that you received from the Baidu Cloud Push service to communicate + // with the service. + // + // Credential is a required field + Credential *string `type:"string" required:"true"` + + // Specifies whether the Baidu channel is enabled for the application. + Enabled *bool `type:"boolean"` + + // (Not used) This property is retained only for backward compatibility. + HasCredential *bool `type:"boolean"` + + // (Deprecated) An identifier for the Baidu channel. This property is retained + // only for backward compatibility. + Id *string `type:"string"` + + // Specifies whether the Baidu channel is archived. + IsArchived *bool `type:"boolean"` + + // The user who last modified the Baidu channel. + LastModifiedBy *string `type:"string"` + + // The date and time when the Baidu channel was last modified. + LastModifiedDate *string `type:"string"` + + // The type of messaging or notification platform for the channel. For the Baidu + // channel, this value is BAIDU. + // + // Platform is a required field + Platform *string `type:"string" required:"true"` + + // The current version of the Baidu channel. + Version *int64 `type:"integer"` +} + +// String returns the string representation +func (s BaiduChannelResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BaiduChannelResponse) GoString() string { + return s.String() +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *BaiduChannelResponse) SetApplicationId(v string) *BaiduChannelResponse { + s.ApplicationId = &v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *BaiduChannelResponse) SetCreationDate(v string) *BaiduChannelResponse { + s.CreationDate = &v + return s +} + +// SetCredential sets the Credential field's value. +func (s *BaiduChannelResponse) SetCredential(v string) *BaiduChannelResponse { + s.Credential = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *BaiduChannelResponse) SetEnabled(v bool) *BaiduChannelResponse { + s.Enabled = &v + return s +} + +// SetHasCredential sets the HasCredential field's value. +func (s *BaiduChannelResponse) SetHasCredential(v bool) *BaiduChannelResponse { + s.HasCredential = &v + return s +} + +// SetId sets the Id field's value. +func (s *BaiduChannelResponse) SetId(v string) *BaiduChannelResponse { + s.Id = &v + return s +} + +// SetIsArchived sets the IsArchived field's value. +func (s *BaiduChannelResponse) SetIsArchived(v bool) *BaiduChannelResponse { + s.IsArchived = &v + return s +} + +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *BaiduChannelResponse) SetLastModifiedBy(v string) *BaiduChannelResponse { + s.LastModifiedBy = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *BaiduChannelResponse) SetLastModifiedDate(v string) *BaiduChannelResponse { + s.LastModifiedDate = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *BaiduChannelResponse) SetPlatform(v string) *BaiduChannelResponse { + s.Platform = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *BaiduChannelResponse) SetVersion(v int64) *BaiduChannelResponse { + s.Version = &v + return s +} + +// Specifies the settings for a one-time message that's sent directly to an +// endpoint through the Baidu (Baidu Cloud Push) channel. +type BaiduMessage struct { + _ struct{} `type:"structure"` + + // The action to occur if the recipient taps the push notification. Valid values + // are: + // + // * OPEN_APP - Your app opens or it becomes the foreground app if it was + // sent to the background. This is the default action. + // + // * DEEP_LINK - Your app opens and displays a designated user interface + // in the app. This action uses the deep-linking features of the Android + // platform. + // + // * URL - The default mobile browser on the recipient's device opens and + // loads the web page at a URL that you specify. + Action *string `type:"string" enum:"Action"` + + // The body of the notification message. + Body *string `type:"string"` + + // The JSON data payload to use for the push notification, if the notification + // is a silent push notification. This payload is added to the data.pinpoint.jsonBody + // object of the notification. + Data map[string]*string `type:"map"` + + // The icon image name of the asset saved in your app. + IconReference *string `type:"string"` + + // The URL of the large icon image to display in the content view of the push + // notification. + ImageIconUrl *string `type:"string"` + + // The URL of an image to display in the push notification. + ImageUrl *string `type:"string"` + + // The raw, JSON-formatted string to use as the payload for the notification + // message. If specified, this value overrides all other content for the message. + RawContent *string `type:"string"` + + // Specifies whether the notification is a silent push notification, which is + // a push notification that doesn't display on a recipient's device. Silent + // push notifications can be used for cases such as updating an app's configuration + // or supporting phone home functionality. + SilentPush *bool `type:"boolean"` + + // The URL of the small icon image to display in the status bar and the content + // view of the push notification. + SmallImageIconUrl *string `type:"string"` + + // The sound to play when the recipient receives the push notification. You + // can use the default stream or specify the file name of a sound resource that's + // bundled in your app. On an Android platform, the sound file must reside in + // /res/raw/. + Sound *string `type:"string"` + + // The default message variables to use in the notification message. You can + // override the default variables with individual address variables. + Substitutions map[string][]*string `type:"map"` + + // The amount of time, in seconds, that the Baidu Cloud Push service should + // store the message if the recipient's device is offline. The default value + // and maximum supported time is 604,800 seconds (7 days). + TimeToLive *int64 `type:"integer"` + + // The title to display above the notification message on the recipient's device. + Title *string `type:"string"` + + // The URL to open in the recipient's default mobile browser, if a recipient + // taps the push notification and the value of the Action property is URL. + Url *string `type:"string"` +} + +// String returns the string representation +func (s BaiduMessage) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BaiduMessage) GoString() string { + return s.String() +} + +// SetAction sets the Action field's value. +func (s *BaiduMessage) SetAction(v string) *BaiduMessage { + s.Action = &v + return s +} + +// SetBody sets the Body field's value. +func (s *BaiduMessage) SetBody(v string) *BaiduMessage { + s.Body = &v + return s +} + +// SetData sets the Data field's value. +func (s *BaiduMessage) SetData(v map[string]*string) *BaiduMessage { + s.Data = v + return s +} + +// SetIconReference sets the IconReference field's value. +func (s *BaiduMessage) SetIconReference(v string) *BaiduMessage { + s.IconReference = &v + return s +} + +// SetImageIconUrl sets the ImageIconUrl field's value. +func (s *BaiduMessage) SetImageIconUrl(v string) *BaiduMessage { + s.ImageIconUrl = &v + return s +} + +// SetImageUrl sets the ImageUrl field's value. +func (s *BaiduMessage) SetImageUrl(v string) *BaiduMessage { + s.ImageUrl = &v + return s +} + +// SetRawContent sets the RawContent field's value. +func (s *BaiduMessage) SetRawContent(v string) *BaiduMessage { + s.RawContent = &v + return s +} + +// SetSilentPush sets the SilentPush field's value. +func (s *BaiduMessage) SetSilentPush(v bool) *BaiduMessage { + s.SilentPush = &v + return s +} + +// SetSmallImageIconUrl sets the SmallImageIconUrl field's value. +func (s *BaiduMessage) SetSmallImageIconUrl(v string) *BaiduMessage { + s.SmallImageIconUrl = &v + return s +} + +// SetSound sets the Sound field's value. +func (s *BaiduMessage) SetSound(v string) *BaiduMessage { + s.Sound = &v + return s +} + +// SetSubstitutions sets the Substitutions field's value. +func (s *BaiduMessage) SetSubstitutions(v map[string][]*string) *BaiduMessage { + s.Substitutions = v + return s +} + +// SetTimeToLive sets the TimeToLive field's value. +func (s *BaiduMessage) SetTimeToLive(v int64) *BaiduMessage { + s.TimeToLive = &v + return s +} + +// SetTitle sets the Title field's value. +func (s *BaiduMessage) SetTitle(v string) *BaiduMessage { + s.Title = &v + return s +} + +// SetUrl sets the Url field's value. +func (s *BaiduMessage) SetUrl(v string) *BaiduMessage { + s.Url = &v + return s +} + +// Provides the results of a query that retrieved the data for a standard metric +// that applies to an application, campaign, or journey. +type BaseKpiResult struct { + _ struct{} `type:"structure"` + + // An array of objects that provides the results of a query that retrieved the + // data for a standard metric that applies to an application, campaign, or journey. + // + // Rows is a required field + Rows []*ResultRow `type:"list" required:"true"` +} + +// String returns the string representation +func (s BaseKpiResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BaseKpiResult) GoString() string { + return s.String() +} + +// SetRows sets the Rows field's value. +func (s *BaseKpiResult) SetRows(v []*ResultRow) *BaseKpiResult { + s.Rows = v + return s +} + +// Provides the results of a query that retrieved the data for a standard metric +// that applies to a campaign, and provides information about that query. +type CampaignDateRangeKpiResponse struct { + _ struct{} `type:"structure"` + + // The unique identifier for the application that the metric applies to. + // + // ApplicationId is a required field + ApplicationId *string `type:"string" required:"true"` + + // The unique identifier for the campaign that the metric applies to. + // + // CampaignId is a required field + CampaignId *string `type:"string" required:"true"` + + // EndTime is a required field + EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` + + // The name of the metric, also referred to as a key performance indicator (KPI), + // that the data was retrieved for. This value describes the associated metric + // and consists of two or more terms, which are comprised of lowercase alphanumeric + // characters, separated by a hyphen. For a list of possible values, see the + // Amazon Pinpoint Developer Guide (https://docs.aws.amazon.com/pinpoint/latest/developerguide/welcome.html). + // + // KpiName is a required field + KpiName *string `type:"string" required:"true"` + + // An array of objects that contains the results of the query. Each object contains + // the value for the metric and metadata about that value. + // + // KpiResult is a required field + KpiResult *BaseKpiResult `type:"structure" required:"true"` + + // The string to use in a subsequent request to get the next page of results + // in a paginated response. This value is null for the Campaign Metrics resource + // because the resource returns all results in a single page. + NextToken *string `type:"string"` + + // StartTime is a required field + StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` +} + +// String returns the string representation +func (s CampaignDateRangeKpiResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CampaignDateRangeKpiResponse) GoString() string { + return s.String() +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *CampaignDateRangeKpiResponse) SetApplicationId(v string) *CampaignDateRangeKpiResponse { + s.ApplicationId = &v + return s +} + +// SetCampaignId sets the CampaignId field's value. +func (s *CampaignDateRangeKpiResponse) SetCampaignId(v string) *CampaignDateRangeKpiResponse { + s.CampaignId = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *CampaignDateRangeKpiResponse) SetEndTime(v time.Time) *CampaignDateRangeKpiResponse { + s.EndTime = &v + return s +} + +// SetKpiName sets the KpiName field's value. +func (s *CampaignDateRangeKpiResponse) SetKpiName(v string) *CampaignDateRangeKpiResponse { + s.KpiName = &v + return s +} + +// SetKpiResult sets the KpiResult field's value. +func (s *CampaignDateRangeKpiResponse) SetKpiResult(v *BaseKpiResult) *CampaignDateRangeKpiResponse { + s.KpiResult = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *CampaignDateRangeKpiResponse) SetNextToken(v string) *CampaignDateRangeKpiResponse { + s.NextToken = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *CampaignDateRangeKpiResponse) SetStartTime(v time.Time) *CampaignDateRangeKpiResponse { + s.StartTime = &v + return s +} + +// Specifies the content and "From" address for an email message that's sent +// to recipients of a campaign. +type CampaignEmailMessage struct { + _ struct{} `type:"structure"` + + // The body of the email for recipients whose email clients don't render HTML + // content. + Body *string `type:"string"` + + // The verified email address to send the email from. The default address is + // the FromAddress specified for the email channel for the application. + FromAddress *string `type:"string"` + + // The body of the email, in HTML format, for recipients whose email clients + // render HTML content. + HtmlBody *string `type:"string"` + + // The subject line, or title, of the email. + Title *string `type:"string"` +} + +// String returns the string representation +func (s CampaignEmailMessage) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CampaignEmailMessage) GoString() string { + return s.String() +} + +// SetBody sets the Body field's value. +func (s *CampaignEmailMessage) SetBody(v string) *CampaignEmailMessage { + s.Body = &v + return s +} + +// SetFromAddress sets the FromAddress field's value. +func (s *CampaignEmailMessage) SetFromAddress(v string) *CampaignEmailMessage { + s.FromAddress = &v + return s +} + +// SetHtmlBody sets the HtmlBody field's value. +func (s *CampaignEmailMessage) SetHtmlBody(v string) *CampaignEmailMessage { + s.HtmlBody = &v + return s +} + +// SetTitle sets the Title field's value. +func (s *CampaignEmailMessage) SetTitle(v string) *CampaignEmailMessage { + s.Title = &v + return s +} + +// Specifies the settings for events that cause a campaign to be sent. +type CampaignEventFilter struct { + _ struct{} `type:"structure"` + + // The dimension settings of the event filter for the campaign. + // + // Dimensions is a required field + Dimensions *EventDimensions `type:"structure" required:"true"` + + // The type of event that causes the campaign to be sent. Valid values are: + // SYSTEM, sends the campaign when a system event occurs; and, ENDPOINT, sends + // the campaign when an endpoint event (Events resource) occurs. + // + // FilterType is a required field + FilterType *string `type:"string" required:"true" enum:"FilterType"` +} + +// String returns the string representation +func (s CampaignEventFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CampaignEventFilter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CampaignEventFilter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CampaignEventFilter"} + if s.Dimensions == nil { + invalidParams.Add(request.NewErrParamRequired("Dimensions")) + } + if s.FilterType == nil { + invalidParams.Add(request.NewErrParamRequired("FilterType")) + } + if s.Dimensions != nil { + if err := s.Dimensions.Validate(); err != nil { + invalidParams.AddNested("Dimensions", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDimensions sets the Dimensions field's value. +func (s *CampaignEventFilter) SetDimensions(v *EventDimensions) *CampaignEventFilter { + s.Dimensions = v + return s +} + +// SetFilterType sets the FilterType field's value. +func (s *CampaignEventFilter) SetFilterType(v string) *CampaignEventFilter { + s.FilterType = &v + return s +} + +// Specifies the AWS Lambda function to use as a code hook for a campaign. +type CampaignHook struct { + _ struct{} `type:"structure"` + + // The name or Amazon Resource Name (ARN) of the AWS Lambda function that Amazon + // Pinpoint invokes to send messages for a campaign. + LambdaFunctionName *string `type:"string"` + + // Specifies which Lambda mode to use when invoking the AWS Lambda function. + Mode *string `type:"string" enum:"Mode"` + + // The web URL that Amazon Pinpoint calls to invoke the AWS Lambda function + // over HTTPS. + WebUrl *string `type:"string"` +} + +// String returns the string representation +func (s CampaignHook) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CampaignHook) GoString() string { + return s.String() +} + +// SetLambdaFunctionName sets the LambdaFunctionName field's value. +func (s *CampaignHook) SetLambdaFunctionName(v string) *CampaignHook { + s.LambdaFunctionName = &v + return s +} + +// SetMode sets the Mode field's value. +func (s *CampaignHook) SetMode(v string) *CampaignHook { + s.Mode = &v + return s +} + +// SetWebUrl sets the WebUrl field's value. +func (s *CampaignHook) SetWebUrl(v string) *CampaignHook { + s.WebUrl = &v + return s +} + +// Specifies limits on the messages that a campaign can send. +type CampaignLimits struct { + _ struct{} `type:"structure"` + + // The maximum number of messages that a campaign can send to a single endpoint + // during a 24-hour period. The maximum value is 100. + Daily *int64 `type:"integer"` + + // The maximum amount of time, in seconds, that a campaign can attempt to deliver + // a message after the scheduled start time for the campaign. The minimum value + // is 60 seconds. + MaximumDuration *int64 `type:"integer"` + + // The maximum number of messages that a campaign can send each second. The + // minimum value is 50. The maximum value is 20,000. + MessagesPerSecond *int64 `type:"integer"` + + // The maximum number of messages that a campaign can send to a single endpoint + // during the course of the campaign. The maximum value is 100. + Total *int64 `type:"integer"` +} + +// String returns the string representation +func (s CampaignLimits) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CampaignLimits) GoString() string { + return s.String() +} + +// SetDaily sets the Daily field's value. +func (s *CampaignLimits) SetDaily(v int64) *CampaignLimits { + s.Daily = &v + return s +} + +// SetMaximumDuration sets the MaximumDuration field's value. +func (s *CampaignLimits) SetMaximumDuration(v int64) *CampaignLimits { + s.MaximumDuration = &v + return s +} + +// SetMessagesPerSecond sets the MessagesPerSecond field's value. +func (s *CampaignLimits) SetMessagesPerSecond(v int64) *CampaignLimits { + s.MessagesPerSecond = &v + return s +} + +// SetTotal sets the Total field's value. +func (s *CampaignLimits) SetTotal(v int64) *CampaignLimits { + s.Total = &v + return s +} + +// Provides information about the status, configuration, and other settings +// for a campaign. +type CampaignResponse struct { + _ struct{} `type:"structure"` + + // An array of responses, one for each treatment that you defined for the campaign, + // in addition to the default treatment. + AdditionalTreatments []*TreatmentResource `type:"list"` + + // The unique identifier for the application that the campaign applies to. + // + // ApplicationId is a required field + ApplicationId *string `type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the campaign. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // The date, in ISO 8601 format, when the campaign was created. + // + // CreationDate is a required field + CreationDate *string `type:"string" required:"true"` + + // The current status of the campaign's default treatment. This value exists + // only for campaigns that have more than one treatment, to support A/B testing. + DefaultState *CampaignState `type:"structure"` + + // The custom description of the campaign. + Description *string `type:"string"` + + // The allocated percentage of users (segment members) who shouldn't receive + // messages from the campaign. + HoldoutPercent *int64 `type:"integer"` + + // The settings for the AWS Lambda function to use as a code hook for the campaign. + Hook *CampaignHook `type:"structure"` + + // The unique identifier for the campaign. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // Specifies whether the campaign is paused. A paused campaign doesn't run unless + // you resume it by changing this value to false. + IsPaused *bool `type:"boolean"` + + // The date, in ISO 8601 format, when the campaign was last modified. + // + // LastModifiedDate is a required field + LastModifiedDate *string `type:"string" required:"true"` + + // The messaging limits for the campaign. + Limits *CampaignLimits `type:"structure"` + + // The message configuration settings for the campaign. + MessageConfiguration *MessageConfiguration `type:"structure"` + + // The name of the campaign. + Name *string `type:"string"` + + // The schedule settings for the campaign. + Schedule *Schedule `type:"structure"` + + // The unique identifier for the segment that's associated with the campaign. + // + // SegmentId is a required field + SegmentId *string `type:"string" required:"true"` + + // The version number of the segment that's associated with the campaign. + // + // SegmentVersion is a required field + SegmentVersion *int64 `type:"integer" required:"true"` + + // The current status of the campaign. + State *CampaignState `type:"structure"` + + // A string-to-string map of key-value pairs that identifies the tags that are + // associated with the campaign. Each tag consists of a required tag key and + // an associated tag value. + Tags map[string]*string `locationName:"tags" type:"map"` + + // The message template that’s used for the campaign. + TemplateConfiguration *TemplateConfiguration `type:"structure"` + + // The custom description of a variation of the campaign that's used for A/B + // testing. + TreatmentDescription *string `type:"string"` + + // The custom name of a variation of the campaign that's used for A/B testing. + TreatmentName *string `type:"string"` + + // The version number of the campaign. + Version *int64 `type:"integer"` +} + +// String returns the string representation +func (s CampaignResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CampaignResponse) GoString() string { + return s.String() +} + +// SetAdditionalTreatments sets the AdditionalTreatments field's value. +func (s *CampaignResponse) SetAdditionalTreatments(v []*TreatmentResource) *CampaignResponse { + s.AdditionalTreatments = v + return s +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *CampaignResponse) SetApplicationId(v string) *CampaignResponse { + s.ApplicationId = &v + return s +} + +// SetArn sets the Arn field's value. +func (s *CampaignResponse) SetArn(v string) *CampaignResponse { + s.Arn = &v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *CampaignResponse) SetCreationDate(v string) *CampaignResponse { + s.CreationDate = &v + return s +} + +// SetDefaultState sets the DefaultState field's value. +func (s *CampaignResponse) SetDefaultState(v *CampaignState) *CampaignResponse { + s.DefaultState = v + return s +} + +// SetDescription sets the Description field's value. +func (s *CampaignResponse) SetDescription(v string) *CampaignResponse { + s.Description = &v + return s +} + +// SetHoldoutPercent sets the HoldoutPercent field's value. +func (s *CampaignResponse) SetHoldoutPercent(v int64) *CampaignResponse { + s.HoldoutPercent = &v + return s +} + +// SetHook sets the Hook field's value. +func (s *CampaignResponse) SetHook(v *CampaignHook) *CampaignResponse { + s.Hook = v + return s +} + +// SetId sets the Id field's value. +func (s *CampaignResponse) SetId(v string) *CampaignResponse { + s.Id = &v + return s +} + +// SetIsPaused sets the IsPaused field's value. +func (s *CampaignResponse) SetIsPaused(v bool) *CampaignResponse { + s.IsPaused = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *CampaignResponse) SetLastModifiedDate(v string) *CampaignResponse { + s.LastModifiedDate = &v + return s +} + +// SetLimits sets the Limits field's value. +func (s *CampaignResponse) SetLimits(v *CampaignLimits) *CampaignResponse { + s.Limits = v + return s +} + +// SetMessageConfiguration sets the MessageConfiguration field's value. +func (s *CampaignResponse) SetMessageConfiguration(v *MessageConfiguration) *CampaignResponse { + s.MessageConfiguration = v + return s +} + +// SetName sets the Name field's value. +func (s *CampaignResponse) SetName(v string) *CampaignResponse { + s.Name = &v + return s +} + +// SetSchedule sets the Schedule field's value. +func (s *CampaignResponse) SetSchedule(v *Schedule) *CampaignResponse { + s.Schedule = v + return s +} + +// SetSegmentId sets the SegmentId field's value. +func (s *CampaignResponse) SetSegmentId(v string) *CampaignResponse { + s.SegmentId = &v + return s +} + +// SetSegmentVersion sets the SegmentVersion field's value. +func (s *CampaignResponse) SetSegmentVersion(v int64) *CampaignResponse { + s.SegmentVersion = &v + return s +} + +// SetState sets the State field's value. +func (s *CampaignResponse) SetState(v *CampaignState) *CampaignResponse { + s.State = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CampaignResponse) SetTags(v map[string]*string) *CampaignResponse { + s.Tags = v + return s +} + +// SetTemplateConfiguration sets the TemplateConfiguration field's value. +func (s *CampaignResponse) SetTemplateConfiguration(v *TemplateConfiguration) *CampaignResponse { + s.TemplateConfiguration = v + return s +} + +// SetTreatmentDescription sets the TreatmentDescription field's value. +func (s *CampaignResponse) SetTreatmentDescription(v string) *CampaignResponse { + s.TreatmentDescription = &v + return s +} + +// SetTreatmentName sets the TreatmentName field's value. +func (s *CampaignResponse) SetTreatmentName(v string) *CampaignResponse { + s.TreatmentName = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *CampaignResponse) SetVersion(v int64) *CampaignResponse { + s.Version = &v + return s +} + +// Specifies the content and settings for an SMS message that's sent to recipients +// of a campaign. +type CampaignSmsMessage struct { + _ struct{} `type:"structure"` + + // The body of the SMS message. + Body *string `type:"string"` + + // The type of SMS message. Valid values are: TRANSACTIONAL, the message is + // critical or time-sensitive, such as a one-time password that supports a customer + // transaction; and, PROMOTIONAL, the message isn't critical or time-sensitive, + // such as a marketing message. + MessageType *string `type:"string" enum:"MessageType"` + + // The sender ID to display on recipients' devices when they receive the SMS + // message. + SenderId *string `type:"string"` +} + +// String returns the string representation +func (s CampaignSmsMessage) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CampaignSmsMessage) GoString() string { + return s.String() +} + +// SetBody sets the Body field's value. +func (s *CampaignSmsMessage) SetBody(v string) *CampaignSmsMessage { + s.Body = &v + return s +} + +// SetMessageType sets the MessageType field's value. +func (s *CampaignSmsMessage) SetMessageType(v string) *CampaignSmsMessage { + s.MessageType = &v + return s +} + +// SetSenderId sets the SenderId field's value. +func (s *CampaignSmsMessage) SetSenderId(v string) *CampaignSmsMessage { + s.SenderId = &v + return s +} + +// Provides information about the status of a campaign. +type CampaignState struct { + _ struct{} `type:"structure"` + + // The current status of the campaign, or the current status of a treatment + // that belongs to an A/B test campaign. If a campaign uses A/B testing, the + // campaign has a status of COMPLETED only if all campaign treatments have a + // status of COMPLETED. + CampaignStatus *string `type:"string" enum:"CampaignStatus"` +} + +// String returns the string representation +func (s CampaignState) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CampaignState) GoString() string { + return s.String() +} + +// SetCampaignStatus sets the CampaignStatus field's value. +func (s *CampaignState) SetCampaignStatus(v string) *CampaignState { + s.CampaignStatus = &v + return s +} + +// Provides information about the configuration and other settings for all the +// campaigns that are associated with an application. +type CampaignsResponse struct { + _ struct{} `type:"structure"` + + // An array of responses, one for each campaign that's associated with the application. + // + // Item is a required field + Item []*CampaignResponse `type:"list" required:"true"` + + // The string to use in a subsequent request to get the next page of results + // in a paginated response. This value is null if there are no additional pages. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s CampaignsResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CampaignsResponse) GoString() string { + return s.String() +} + +// SetItem sets the Item field's value. +func (s *CampaignsResponse) SetItem(v []*CampaignResponse) *CampaignsResponse { + s.Item = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *CampaignsResponse) SetNextToken(v string) *CampaignsResponse { + s.NextToken = &v + return s +} + +// Provides information about the general settings and status of a channel for +// an application. +type ChannelResponse struct { + _ struct{} `type:"structure"` + + // The unique identifier for the application. + ApplicationId *string `type:"string"` + + // The date and time, in ISO 8601 format, when the channel was enabled. + CreationDate *string `type:"string"` + + // Specifies whether the channel is enabled for the application. + Enabled *bool `type:"boolean"` + + // (Not used) This property is retained only for backward compatibility. + HasCredential *bool `type:"boolean"` + + // (Deprecated) An identifier for the channel. This property is retained only + // for backward compatibility. + Id *string `type:"string"` + + // Specifies whether the channel is archived. + IsArchived *bool `type:"boolean"` + + // The user who last modified the channel. + LastModifiedBy *string `type:"string"` + + // The date and time, in ISO 8601 format, when the channel was last modified. + LastModifiedDate *string `type:"string"` + + // The current version of the channel. + Version *int64 `type:"integer"` +} + +// String returns the string representation +func (s ChannelResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChannelResponse) GoString() string { + return s.String() +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *ChannelResponse) SetApplicationId(v string) *ChannelResponse { + s.ApplicationId = &v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *ChannelResponse) SetCreationDate(v string) *ChannelResponse { + s.CreationDate = &v + return s } // SetEnabled sets the Enabled field's value. -func (s *ADMChannelRequest) SetEnabled(v bool) *ADMChannelRequest { +func (s *ChannelResponse) SetEnabled(v bool) *ChannelResponse { s.Enabled = &v return s } -// Provides information about the status and settings of the ADM (Amazon Device -// Messaging) channel for an application. -type ADMChannelResponse struct { - _ struct{} `type:"structure"` +// SetHasCredential sets the HasCredential field's value. +func (s *ChannelResponse) SetHasCredential(v bool) *ChannelResponse { + s.HasCredential = &v + return s +} + +// SetId sets the Id field's value. +func (s *ChannelResponse) SetId(v string) *ChannelResponse { + s.Id = &v + return s +} + +// SetIsArchived sets the IsArchived field's value. +func (s *ChannelResponse) SetIsArchived(v bool) *ChannelResponse { + s.IsArchived = &v + return s +} + +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *ChannelResponse) SetLastModifiedBy(v string) *ChannelResponse { + s.LastModifiedBy = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *ChannelResponse) SetLastModifiedDate(v string) *ChannelResponse { + s.LastModifiedDate = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *ChannelResponse) SetVersion(v int64) *ChannelResponse { + s.Version = &v + return s +} + +// Provides information about the general settings and status of all channels +// for an application, including channels that aren't enabled for the application. +type ChannelsResponse struct { + _ struct{} `type:"structure"` + + // A map that contains a multipart response for each channel. For each item + // in this object, the ChannelType is the key and the Channel is the value. + // + // Channels is a required field + Channels map[string]*ChannelResponse `type:"map" required:"true"` +} + +// String returns the string representation +func (s ChannelsResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChannelsResponse) GoString() string { + return s.String() +} + +// SetChannels sets the Channels field's value. +func (s *ChannelsResponse) SetChannels(v map[string]*ChannelResponse) *ChannelsResponse { + s.Channels = v + return s +} + +// Specifies the conditions to evaluate for an activity in a journey, and how +// to evaluate those conditions. +type Condition struct { + _ struct{} `type:"structure"` + + // The conditions to evaluate for the activity. + Conditions []*SimpleCondition `type:"list"` + + // Specifies how to handle multiple conditions for the activity. For example, + // if you specify two conditions for an activity, whether both or only one of + // the conditions must be met for the activity to be performed. + Operator *string `type:"string" enum:"Operator"` +} + +// 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.Conditions != nil { + for i, v := range s.Conditions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Conditions", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConditions sets the Conditions field's value. +func (s *Condition) SetConditions(v []*SimpleCondition) *Condition { + s.Conditions = v + return s +} + +// SetOperator sets the Operator field's value. +func (s *Condition) SetOperator(v string) *Condition { + s.Operator = &v + return s +} + +// Specifies the settings for a yes/no split activity in a journey. This type +// of activity sends participants down one of two paths in a journey, based +// on conditions that you specify. +type ConditionalSplitActivity struct { + _ struct{} `type:"structure"` + + // The conditions that define the paths for the activity, and the relationship + // between the conditions. + Condition *Condition `type:"structure"` + + // The amount of time to wait before determining whether the conditions are + // met, or the date and time when Amazon Pinpoint determines whether the conditions + // are met. + EvaluationWaitTime *WaitTime `type:"structure"` + + // The unique identifier for the activity to perform if the conditions aren't + // met. + FalseActivity *string `type:"string"` + + // The unique identifier for the activity to perform if the conditions are met. + TrueActivity *string `type:"string"` +} + +// String returns the string representation +func (s ConditionalSplitActivity) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConditionalSplitActivity) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ConditionalSplitActivity) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ConditionalSplitActivity"} + if s.Condition != nil { + if err := s.Condition.Validate(); err != nil { + invalidParams.AddNested("Condition", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCondition sets the Condition field's value. +func (s *ConditionalSplitActivity) SetCondition(v *Condition) *ConditionalSplitActivity { + s.Condition = v + return s +} + +// SetEvaluationWaitTime sets the EvaluationWaitTime field's value. +func (s *ConditionalSplitActivity) SetEvaluationWaitTime(v *WaitTime) *ConditionalSplitActivity { + s.EvaluationWaitTime = v + return s +} + +// SetFalseActivity sets the FalseActivity field's value. +func (s *ConditionalSplitActivity) SetFalseActivity(v string) *ConditionalSplitActivity { + s.FalseActivity = &v + return s +} + +// SetTrueActivity sets the TrueActivity field's value. +func (s *ConditionalSplitActivity) SetTrueActivity(v string) *ConditionalSplitActivity { + s.TrueActivity = &v + return s +} + +type CreateAppInput struct { + _ struct{} `type:"structure" payload:"CreateApplicationRequest"` + + // Specifies the display name of an application and the tags to associate with + // the application. + // + // CreateApplicationRequest is a required field + CreateApplicationRequest *CreateApplicationRequest `type:"structure" required:"true"` +} + +// 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.CreateApplicationRequest == nil { + invalidParams.Add(request.NewErrParamRequired("CreateApplicationRequest")) + } + if s.CreateApplicationRequest != nil { + if err := s.CreateApplicationRequest.Validate(); err != nil { + invalidParams.AddNested("CreateApplicationRequest", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCreateApplicationRequest sets the CreateApplicationRequest field's value. +func (s *CreateAppInput) SetCreateApplicationRequest(v *CreateApplicationRequest) *CreateAppInput { + s.CreateApplicationRequest = v + return s +} + +type CreateAppOutput struct { + _ struct{} `type:"structure" payload:"ApplicationResponse"` + + // Provides information about an application. + // + // ApplicationResponse is a required field + ApplicationResponse *ApplicationResponse `type:"structure" required:"true"` +} + +// 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() +} + +// SetApplicationResponse sets the ApplicationResponse field's value. +func (s *CreateAppOutput) SetApplicationResponse(v *ApplicationResponse) *CreateAppOutput { + s.ApplicationResponse = v + return s +} + +// Specifies the display name of an application and the tags to associate with +// the application. +type CreateApplicationRequest struct { + _ struct{} `type:"structure"` + + // The display name of the application. This name is displayed as the Project + // name on the Amazon Pinpoint console. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // A string-to-string map of key-value pairs that defines the tags to associate + // with the application. Each tag consists of a required tag key and an associated + // tag value. + Tags map[string]*string `locationName:"tags" type:"map"` +} + +// String returns the string representation +func (s CreateApplicationRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateApplicationRequest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateApplicationRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateApplicationRequest"} + 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 *CreateApplicationRequest) SetName(v string) *CreateApplicationRequest { + s.Name = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateApplicationRequest) SetTags(v map[string]*string) *CreateApplicationRequest { + s.Tags = v + return s +} + +type CreateCampaignInput struct { + _ struct{} `type:"structure" payload:"WriteCampaignRequest"` + + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + // Specifies the configuration and other settings for a campaign. + // + // WriteCampaignRequest is a required field + WriteCampaignRequest *WriteCampaignRequest `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateCampaignInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCampaignInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateCampaignInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateCampaignInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.WriteCampaignRequest == nil { + invalidParams.Add(request.NewErrParamRequired("WriteCampaignRequest")) + } + if s.WriteCampaignRequest != nil { + if err := s.WriteCampaignRequest.Validate(); err != nil { + invalidParams.AddNested("WriteCampaignRequest", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *CreateCampaignInput) SetApplicationId(v string) *CreateCampaignInput { + s.ApplicationId = &v + return s +} + +// SetWriteCampaignRequest sets the WriteCampaignRequest field's value. +func (s *CreateCampaignInput) SetWriteCampaignRequest(v *WriteCampaignRequest) *CreateCampaignInput { + s.WriteCampaignRequest = v + return s +} + +type CreateCampaignOutput struct { + _ struct{} `type:"structure" payload:"CampaignResponse"` + + // Provides information about the status, configuration, and other settings + // for a campaign. + // + // CampaignResponse is a required field + CampaignResponse *CampaignResponse `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateCampaignOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCampaignOutput) GoString() string { + return s.String() +} + +// SetCampaignResponse sets the CampaignResponse field's value. +func (s *CreateCampaignOutput) SetCampaignResponse(v *CampaignResponse) *CreateCampaignOutput { + s.CampaignResponse = v + return s +} + +type CreateEmailTemplateInput struct { + _ struct{} `type:"structure" payload:"EmailTemplateRequest"` + + // Specifies the content and settings for a message template that can be used + // in messages that are sent through the email channel. + // + // EmailTemplateRequest is a required field + EmailTemplateRequest *EmailTemplateRequest `type:"structure" required:"true"` + + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateEmailTemplateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateEmailTemplateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateEmailTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateEmailTemplateInput"} + if s.EmailTemplateRequest == nil { + invalidParams.Add(request.NewErrParamRequired("EmailTemplateRequest")) + } + 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 +} + +// SetEmailTemplateRequest sets the EmailTemplateRequest field's value. +func (s *CreateEmailTemplateInput) SetEmailTemplateRequest(v *EmailTemplateRequest) *CreateEmailTemplateInput { + s.EmailTemplateRequest = v + return s +} - // The unique identifier for the application that the ADM channel applies to. - ApplicationId *string `type:"string"` +// SetTemplateName sets the TemplateName field's value. +func (s *CreateEmailTemplateInput) SetTemplateName(v string) *CreateEmailTemplateInput { + s.TemplateName = &v + return s +} - // The date and time when the ADM channel was enabled. - CreationDate *string `type:"string"` +type CreateEmailTemplateOutput struct { + _ struct{} `type:"structure" payload:"CreateTemplateMessageBody"` - // Specifies whether the ADM channel is enabled for the application. - Enabled *bool `type:"boolean"` + // Provides information about a request to create a message template. + // + // CreateTemplateMessageBody is a required field + CreateTemplateMessageBody *CreateTemplateMessageBody `type:"structure" required:"true"` +} - // (Not used) This property is retained only for backward compatibility. - HasCredential *bool `type:"boolean"` +// String returns the string representation +func (s CreateEmailTemplateOutput) String() string { + return awsutil.Prettify(s) +} - // (Deprecated) An identifier for the ADM channel. This property is retained - // only for backward compatibility. - Id *string `type:"string"` +// GoString returns the string representation +func (s CreateEmailTemplateOutput) GoString() string { + return s.String() +} - // Specifies whether the ADM channel is archived. - IsArchived *bool `type:"boolean"` +// SetCreateTemplateMessageBody sets the CreateTemplateMessageBody field's value. +func (s *CreateEmailTemplateOutput) SetCreateTemplateMessageBody(v *CreateTemplateMessageBody) *CreateEmailTemplateOutput { + s.CreateTemplateMessageBody = v + return s +} - // The user who last modified the ADM channel. - LastModifiedBy *string `type:"string"` +type CreateExportJobInput struct { + _ struct{} `type:"structure" payload:"ExportJobRequest"` - // The date and time when the ADM channel was last modified. - LastModifiedDate *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The type of messaging or notification platform for the channel. For the ADM - // channel, this value is ADM. + // Specifies the settings for a job that exports endpoint definitions to an + // Amazon Simple Storage Service (Amazon S3) bucket. // - // Platform is a required field - Platform *string `type:"string" required:"true"` - - // The current version of the ADM channel. - Version *int64 `type:"integer"` + // ExportJobRequest is a required field + ExportJobRequest *ExportJobRequest `type:"structure" required:"true"` } // String returns the string representation -func (s ADMChannelResponse) String() string { +func (s CreateExportJobInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ADMChannelResponse) GoString() string { +func (s CreateExportJobInput) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *ADMChannelResponse) SetApplicationId(v string) *ADMChannelResponse { - s.ApplicationId = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateExportJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateExportJobInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.ExportJobRequest == nil { + invalidParams.Add(request.NewErrParamRequired("ExportJobRequest")) + } + if s.ExportJobRequest != nil { + if err := s.ExportJobRequest.Validate(); err != nil { + invalidParams.AddNested("ExportJobRequest", err.(request.ErrInvalidParams)) + } + } -// SetCreationDate sets the CreationDate field's value. -func (s *ADMChannelResponse) SetCreationDate(v string) *ADMChannelResponse { - s.CreationDate = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetEnabled sets the Enabled field's value. -func (s *ADMChannelResponse) SetEnabled(v bool) *ADMChannelResponse { - s.Enabled = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *CreateExportJobInput) SetApplicationId(v string) *CreateExportJobInput { + s.ApplicationId = &v return s } -// SetHasCredential sets the HasCredential field's value. -func (s *ADMChannelResponse) SetHasCredential(v bool) *ADMChannelResponse { - s.HasCredential = &v +// SetExportJobRequest sets the ExportJobRequest field's value. +func (s *CreateExportJobInput) SetExportJobRequest(v *ExportJobRequest) *CreateExportJobInput { + s.ExportJobRequest = v return s } -// SetId sets the Id field's value. -func (s *ADMChannelResponse) SetId(v string) *ADMChannelResponse { - s.Id = &v - return s -} +type CreateExportJobOutput struct { + _ struct{} `type:"structure" payload:"ExportJobResponse"` -// SetIsArchived sets the IsArchived field's value. -func (s *ADMChannelResponse) SetIsArchived(v bool) *ADMChannelResponse { - s.IsArchived = &v - return s + // Provides information about the status and settings of a job that exports + // endpoint definitions to a file. The file can be added directly to an Amazon + // Simple Storage Service (Amazon S3) bucket by using the Amazon Pinpoint API + // or downloaded directly to a computer by using the Amazon Pinpoint console. + // + // ExportJobResponse is a required field + ExportJobResponse *ExportJobResponse `type:"structure" required:"true"` } -// SetLastModifiedBy sets the LastModifiedBy field's value. -func (s *ADMChannelResponse) SetLastModifiedBy(v string) *ADMChannelResponse { - s.LastModifiedBy = &v - return s +// String returns the string representation +func (s CreateExportJobOutput) String() string { + return awsutil.Prettify(s) } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *ADMChannelResponse) SetLastModifiedDate(v string) *ADMChannelResponse { - s.LastModifiedDate = &v - return s +// GoString returns the string representation +func (s CreateExportJobOutput) GoString() string { + return s.String() } -// SetPlatform sets the Platform field's value. -func (s *ADMChannelResponse) SetPlatform(v string) *ADMChannelResponse { - s.Platform = &v +// SetExportJobResponse sets the ExportJobResponse field's value. +func (s *CreateExportJobOutput) SetExportJobResponse(v *ExportJobResponse) *CreateExportJobOutput { + s.ExportJobResponse = v return s } -// SetVersion sets the Version field's value. -func (s *ADMChannelResponse) SetVersion(v int64) *ADMChannelResponse { - s.Version = &v - return s -} +type CreateImportJobInput struct { + _ struct{} `type:"structure" payload:"ImportJobRequest"` -// Specifies the settings for a one-time message that's sent directly to an -// endpoint through the ADM (Amazon Device Messaging) channel. -type ADMMessage struct { - _ struct{} `type:"structure"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The action to occur if the recipient taps the push notification. Valid values - // are: - // - // * OPEN_APP - Your app opens or it becomes the foreground app if it was - // sent to the background. This is the default action. - // - // * DEEP_LINK - Your app opens and displays a designated user interface - // in the app. This action uses the deep-linking features of the Android - // platform. + // Specifies the settings for a job that imports endpoint definitions from an + // Amazon Simple Storage Service (Amazon S3) bucket. // - // * URL - The default mobile browser on the recipient's device opens and - // loads the web page at a URL that you specify. - Action *string `type:"string" enum:"Action"` - - // The body of the notification message. - Body *string `type:"string"` + // ImportJobRequest is a required field + ImportJobRequest *ImportJobRequest `type:"structure" required:"true"` +} - // An arbitrary string that indicates that multiple messages are logically the - // same and that Amazon Device Messaging (ADM) can drop previously enqueued - // messages in favor of this message. - ConsolidationKey *string `type:"string"` +// String returns the string representation +func (s CreateImportJobInput) String() string { + return awsutil.Prettify(s) +} - // The JSON data payload to use for the push notification, if the notification - // is a silent push notification. This payload is added to the data.pinpoint.jsonBody - // object of the notification. - Data map[string]*string `type:"map"` +// GoString returns the string representation +func (s CreateImportJobInput) GoString() string { + return s.String() +} - // The amount of time, in seconds, that ADM should store the message if the - // recipient's device is offline. Amazon Pinpoint specifies this value in the - // expiresAfter parameter when it sends the notification message to ADM. - ExpiresAfter *string `type:"string"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateImportJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateImportJobInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.ImportJobRequest == nil { + invalidParams.Add(request.NewErrParamRequired("ImportJobRequest")) + } + if s.ImportJobRequest != nil { + if err := s.ImportJobRequest.Validate(); err != nil { + invalidParams.AddNested("ImportJobRequest", err.(request.ErrInvalidParams)) + } + } - // The icon image name of the asset saved in your app. - IconReference *string `type:"string"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // The URL of the large icon image to display in the content view of the push - // notification. - ImageIconUrl *string `type:"string"` +// SetApplicationId sets the ApplicationId field's value. +func (s *CreateImportJobInput) SetApplicationId(v string) *CreateImportJobInput { + s.ApplicationId = &v + return s +} - // The URL of an image to display in the push notification. - ImageUrl *string `type:"string"` +// SetImportJobRequest sets the ImportJobRequest field's value. +func (s *CreateImportJobInput) SetImportJobRequest(v *ImportJobRequest) *CreateImportJobInput { + s.ImportJobRequest = v + return s +} - // The base64-encoded, MD5 checksum of the value specified by the Data property. - // ADM uses the MD5 value to verify the integrity of the data. - MD5 *string `type:"string"` +type CreateImportJobOutput struct { + _ struct{} `type:"structure" payload:"ImportJobResponse"` - // The raw, JSON-formatted string to use as the payload for the notification - // message. This value overrides the message. - RawContent *string `type:"string"` + // Provides information about the status and settings of a job that imports + // endpoint definitions from one or more files. The files can be stored in an + // Amazon Simple Storage Service (Amazon S3) bucket or uploaded directly from + // a computer by using the Amazon Pinpoint console. + // + // ImportJobResponse is a required field + ImportJobResponse *ImportJobResponse `type:"structure" required:"true"` +} - // Specifies whether the notification is a silent push notification, which is - // a push notification that doesn't display on a recipient's device. Silent - // push notifications can be used for cases such as updating an app's configuration - // or supporting phone home functionality. - SilentPush *bool `type:"boolean"` +// String returns the string representation +func (s CreateImportJobOutput) String() string { + return awsutil.Prettify(s) +} - // The URL of the small icon image to display in the status bar and the content - // view of the push notification. - SmallImageIconUrl *string `type:"string"` +// GoString returns the string representation +func (s CreateImportJobOutput) GoString() string { + return s.String() +} - // The sound to play when the recipient receives the push notification. You - // can use the default stream or specify the file name of a sound resource that's - // bundled in your app. On an Android platform, the sound file must reside in - // /res/raw/. - Sound *string `type:"string"` +// SetImportJobResponse sets the ImportJobResponse field's value. +func (s *CreateImportJobOutput) SetImportJobResponse(v *ImportJobResponse) *CreateImportJobOutput { + s.ImportJobResponse = v + return s +} - // The default message variables to use in the notification message. You can - // override the default variables with individual address variables. - Substitutions map[string][]*string `type:"map"` +type CreateJourneyInput struct { + _ struct{} `type:"structure" payload:"WriteJourneyRequest"` - // The title to display above the notification message on the recipient's device. - Title *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The URL to open in the recipient's default mobile browser, if a recipient - // taps the push notification and the value of the Action property is URL. - Url *string `type:"string"` + // Specifies the configuration and other settings for a journey. + // + // WriteJourneyRequest is a required field + WriteJourneyRequest *WriteJourneyRequest `type:"structure" required:"true"` } // String returns the string representation -func (s ADMMessage) String() string { +func (s CreateJourneyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ADMMessage) GoString() string { +func (s CreateJourneyInput) GoString() string { return s.String() } -// SetAction sets the Action field's value. -func (s *ADMMessage) SetAction(v string) *ADMMessage { - s.Action = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateJourneyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateJourneyInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.WriteJourneyRequest == nil { + invalidParams.Add(request.NewErrParamRequired("WriteJourneyRequest")) + } + if s.WriteJourneyRequest != nil { + if err := s.WriteJourneyRequest.Validate(); err != nil { + invalidParams.AddNested("WriteJourneyRequest", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetBody sets the Body field's value. -func (s *ADMMessage) SetBody(v string) *ADMMessage { - s.Body = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *CreateJourneyInput) SetApplicationId(v string) *CreateJourneyInput { + s.ApplicationId = &v return s } -// SetConsolidationKey sets the ConsolidationKey field's value. -func (s *ADMMessage) SetConsolidationKey(v string) *ADMMessage { - s.ConsolidationKey = &v +// SetWriteJourneyRequest sets the WriteJourneyRequest field's value. +func (s *CreateJourneyInput) SetWriteJourneyRequest(v *WriteJourneyRequest) *CreateJourneyInput { + s.WriteJourneyRequest = v return s } -// SetData sets the Data field's value. -func (s *ADMMessage) SetData(v map[string]*string) *ADMMessage { - s.Data = v - return s +type CreateJourneyOutput struct { + _ struct{} `type:"structure" payload:"JourneyResponse"` + + // Provides information about the status, configuration, and other settings + // for a journey. + // + // JourneyResponse is a required field + JourneyResponse *JourneyResponse `type:"structure" required:"true"` } -// SetExpiresAfter sets the ExpiresAfter field's value. -func (s *ADMMessage) SetExpiresAfter(v string) *ADMMessage { - s.ExpiresAfter = &v - return s +// String returns the string representation +func (s CreateJourneyOutput) String() string { + return awsutil.Prettify(s) } -// SetIconReference sets the IconReference field's value. -func (s *ADMMessage) SetIconReference(v string) *ADMMessage { - s.IconReference = &v - return s +// GoString returns the string representation +func (s CreateJourneyOutput) GoString() string { + return s.String() } -// SetImageIconUrl sets the ImageIconUrl field's value. -func (s *ADMMessage) SetImageIconUrl(v string) *ADMMessage { - s.ImageIconUrl = &v +// SetJourneyResponse sets the JourneyResponse field's value. +func (s *CreateJourneyOutput) SetJourneyResponse(v *JourneyResponse) *CreateJourneyOutput { + s.JourneyResponse = v return s } -// SetImageUrl sets the ImageUrl field's value. -func (s *ADMMessage) SetImageUrl(v string) *ADMMessage { - s.ImageUrl = &v - return s +type CreatePushTemplateInput struct { + _ struct{} `type:"structure" payload:"PushNotificationTemplateRequest"` + + // Specifies the content and settings for a message template that can be used + // in messages that are sent through a push notification channel. + // + // PushNotificationTemplateRequest is a required field + PushNotificationTemplateRequest *PushNotificationTemplateRequest `type:"structure" required:"true"` + + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` } -// SetMD5 sets the MD5 field's value. -func (s *ADMMessage) SetMD5(v string) *ADMMessage { - s.MD5 = &v - return s +// String returns the string representation +func (s CreatePushTemplateInput) String() string { + return awsutil.Prettify(s) } -// SetRawContent sets the RawContent field's value. -func (s *ADMMessage) SetRawContent(v string) *ADMMessage { - s.RawContent = &v - return s +// GoString returns the string representation +func (s CreatePushTemplateInput) GoString() string { + return s.String() } -// SetSilentPush sets the SilentPush field's value. -func (s *ADMMessage) SetSilentPush(v bool) *ADMMessage { - s.SilentPush = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreatePushTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreatePushTemplateInput"} + if s.PushNotificationTemplateRequest == nil { + invalidParams.Add(request.NewErrParamRequired("PushNotificationTemplateRequest")) + } + 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 } -// SetSmallImageIconUrl sets the SmallImageIconUrl field's value. -func (s *ADMMessage) SetSmallImageIconUrl(v string) *ADMMessage { - s.SmallImageIconUrl = &v +// SetPushNotificationTemplateRequest sets the PushNotificationTemplateRequest field's value. +func (s *CreatePushTemplateInput) SetPushNotificationTemplateRequest(v *PushNotificationTemplateRequest) *CreatePushTemplateInput { + s.PushNotificationTemplateRequest = v return s } -// SetSound sets the Sound field's value. -func (s *ADMMessage) SetSound(v string) *ADMMessage { - s.Sound = &v +// SetTemplateName sets the TemplateName field's value. +func (s *CreatePushTemplateInput) SetTemplateName(v string) *CreatePushTemplateInput { + s.TemplateName = &v return s } -// SetSubstitutions sets the Substitutions field's value. -func (s *ADMMessage) SetSubstitutions(v map[string][]*string) *ADMMessage { - s.Substitutions = v - return s +type CreatePushTemplateOutput struct { + _ struct{} `type:"structure" payload:"CreateTemplateMessageBody"` + + // Provides information about a request to create a message template. + // + // CreateTemplateMessageBody is a required field + CreateTemplateMessageBody *CreateTemplateMessageBody `type:"structure" required:"true"` } -// SetTitle sets the Title field's value. -func (s *ADMMessage) SetTitle(v string) *ADMMessage { - s.Title = &v - return s +// String returns the string representation +func (s CreatePushTemplateOutput) String() string { + return awsutil.Prettify(s) } -// SetUrl sets the Url field's value. -func (s *ADMMessage) SetUrl(v string) *ADMMessage { - s.Url = &v +// GoString returns the string representation +func (s CreatePushTemplateOutput) GoString() string { + return s.String() +} + +// SetCreateTemplateMessageBody sets the CreateTemplateMessageBody field's value. +func (s *CreatePushTemplateOutput) SetCreateTemplateMessageBody(v *CreateTemplateMessageBody) *CreatePushTemplateOutput { + s.CreateTemplateMessageBody = v return s } -// Specifies the status and settings of the APNs (Apple Push Notification service) -// channel for an application. -type APNSChannelRequest struct { - _ struct{} `type:"structure"` +type CreateSegmentInput struct { + _ struct{} `type:"structure" payload:"WriteSegmentRequest"` - // The bundle identifier that's assigned to your iOS app. This identifier is - // used for APNs tokens. - BundleId *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The APNs client certificate that you received from Apple, if you want Amazon - // Pinpoint to communicate with APNs by using an APNs certificate. - Certificate *string `type:"string"` + // Specifies the configuration, dimension, and other settings for a segment. + // A WriteSegmentRequest object can include a Dimensions object or a SegmentGroups + // object, but not both. + // + // WriteSegmentRequest is a required field + WriteSegmentRequest *WriteSegmentRequest `type:"structure" required:"true"` +} - // The default authentication method that you want Amazon Pinpoint to use when - // authenticating with APNs, key or certificate. - DefaultAuthenticationMethod *string `type:"string"` +// String returns the string representation +func (s CreateSegmentInput) String() string { + return awsutil.Prettify(s) +} - // Specifies whether to enable the APNs channel for the application. - Enabled *bool `type:"boolean"` +// GoString returns the string representation +func (s CreateSegmentInput) GoString() string { + return s.String() +} - // The private key for the APNs client certificate that you want Amazon Pinpoint - // to use to communicate with APNs. - PrivateKey *string `type:"string"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateSegmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateSegmentInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.WriteSegmentRequest == nil { + invalidParams.Add(request.NewErrParamRequired("WriteSegmentRequest")) + } + if s.WriteSegmentRequest != nil { + if err := s.WriteSegmentRequest.Validate(); err != nil { + invalidParams.AddNested("WriteSegmentRequest", err.(request.ErrInvalidParams)) + } + } - // The identifier that's assigned to your Apple developer account team. This - // identifier is used for APNs tokens. - TeamId *string `type:"string"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // The authentication key to use for APNs tokens. - TokenKey *string `type:"string"` +// SetApplicationId sets the ApplicationId field's value. +func (s *CreateSegmentInput) SetApplicationId(v string) *CreateSegmentInput { + s.ApplicationId = &v + return s +} - // The key identifier that's assigned to your APNs signing key, if you want - // Amazon Pinpoint to communicate with APNs by using APNs tokens. - TokenKeyId *string `type:"string"` +// SetWriteSegmentRequest sets the WriteSegmentRequest field's value. +func (s *CreateSegmentInput) SetWriteSegmentRequest(v *WriteSegmentRequest) *CreateSegmentInput { + s.WriteSegmentRequest = v + return s +} + +type CreateSegmentOutput struct { + _ struct{} `type:"structure" payload:"SegmentResponse"` + + // Provides information about the configuration, dimension, and other settings + // for a segment. + // + // SegmentResponse is a required field + SegmentResponse *SegmentResponse `type:"structure" required:"true"` } // String returns the string representation -func (s APNSChannelRequest) String() string { +func (s CreateSegmentOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s APNSChannelRequest) GoString() string { +func (s CreateSegmentOutput) GoString() string { return s.String() } -// SetBundleId sets the BundleId field's value. -func (s *APNSChannelRequest) SetBundleId(v string) *APNSChannelRequest { - s.BundleId = &v +// SetSegmentResponse sets the SegmentResponse field's value. +func (s *CreateSegmentOutput) SetSegmentResponse(v *SegmentResponse) *CreateSegmentOutput { + s.SegmentResponse = v return s } -// SetCertificate sets the Certificate field's value. -func (s *APNSChannelRequest) SetCertificate(v string) *APNSChannelRequest { - s.Certificate = &v - return s +type CreateSmsTemplateInput struct { + _ struct{} `type:"structure" payload:"SMSTemplateRequest"` + + // Specifies the content and settings for a message template that can be used + // in text messages that are sent through the SMS channel. + // + // SMSTemplateRequest is a required field + SMSTemplateRequest *SMSTemplateRequest `type:"structure" required:"true"` + + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` } -// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. -func (s *APNSChannelRequest) SetDefaultAuthenticationMethod(v string) *APNSChannelRequest { - s.DefaultAuthenticationMethod = &v - return s +// String returns the string representation +func (s CreateSmsTemplateInput) String() string { + return awsutil.Prettify(s) } -// SetEnabled sets the Enabled field's value. -func (s *APNSChannelRequest) SetEnabled(v bool) *APNSChannelRequest { - s.Enabled = &v - return s +// GoString returns the string representation +func (s CreateSmsTemplateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateSmsTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateSmsTemplateInput"} + if s.SMSTemplateRequest == nil { + invalidParams.Add(request.NewErrParamRequired("SMSTemplateRequest")) + } + 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 } -// SetPrivateKey sets the PrivateKey field's value. -func (s *APNSChannelRequest) SetPrivateKey(v string) *APNSChannelRequest { - s.PrivateKey = &v +// SetSMSTemplateRequest sets the SMSTemplateRequest field's value. +func (s *CreateSmsTemplateInput) SetSMSTemplateRequest(v *SMSTemplateRequest) *CreateSmsTemplateInput { + s.SMSTemplateRequest = v return s } -// SetTeamId sets the TeamId field's value. -func (s *APNSChannelRequest) SetTeamId(v string) *APNSChannelRequest { - s.TeamId = &v +// SetTemplateName sets the TemplateName field's value. +func (s *CreateSmsTemplateInput) SetTemplateName(v string) *CreateSmsTemplateInput { + s.TemplateName = &v return s } -// SetTokenKey sets the TokenKey field's value. -func (s *APNSChannelRequest) SetTokenKey(v string) *APNSChannelRequest { - s.TokenKey = &v - return s +type CreateSmsTemplateOutput struct { + _ struct{} `type:"structure" payload:"CreateTemplateMessageBody"` + + // Provides information about a request to create a message template. + // + // CreateTemplateMessageBody is a required field + CreateTemplateMessageBody *CreateTemplateMessageBody `type:"structure" required:"true"` } -// SetTokenKeyId sets the TokenKeyId field's value. -func (s *APNSChannelRequest) SetTokenKeyId(v string) *APNSChannelRequest { - s.TokenKeyId = &v +// String returns the string representation +func (s CreateSmsTemplateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateSmsTemplateOutput) GoString() string { + return s.String() +} + +// SetCreateTemplateMessageBody sets the CreateTemplateMessageBody field's value. +func (s *CreateSmsTemplateOutput) SetCreateTemplateMessageBody(v *CreateTemplateMessageBody) *CreateSmsTemplateOutput { + s.CreateTemplateMessageBody = v return s } -// Provides information about the status and settings of the APNs (Apple Push -// Notification service) channel for an application. -type APNSChannelResponse struct { +// Provides information about a request to create a message template. +type CreateTemplateMessageBody struct { _ struct{} `type:"structure"` - // The unique identifier for the application that the APNs channel applies to. - ApplicationId *string `type:"string"` + // The Amazon Resource Name (ARN) of the message template that was created. + Arn *string `type:"string"` - // The date and time when the APNs channel was enabled. - CreationDate *string `type:"string"` + // The message that's returned from the API for the request to create the message + // template. + Message *string `type:"string"` - // The default authentication method that Amazon Pinpoint uses to authenticate - // with APNs for this channel, key or certificate. - DefaultAuthenticationMethod *string `type:"string"` + // The unique identifier for the request to create the message template. + RequestID *string `type:"string"` +} - // Specifies whether the APNs channel is enabled for the application. - Enabled *bool `type:"boolean"` +// String returns the string representation +func (s CreateTemplateMessageBody) String() string { + return awsutil.Prettify(s) +} - // (Not used) This property is retained only for backward compatibility. - HasCredential *bool `type:"boolean"` +// GoString returns the string representation +func (s CreateTemplateMessageBody) GoString() string { + return s.String() +} - // Specifies whether the APNs channel is configured to communicate with APNs - // by using APNs tokens. To provide an authentication key for APNs tokens, set - // the TokenKey property of the channel. - HasTokenKey *bool `type:"boolean"` +// SetArn sets the Arn field's value. +func (s *CreateTemplateMessageBody) SetArn(v string) *CreateTemplateMessageBody { + s.Arn = &v + return s +} - // (Deprecated) An identifier for the APNs channel. This property is retained - // only for backward compatibility. - Id *string `type:"string"` +// SetMessage sets the Message field's value. +func (s *CreateTemplateMessageBody) SetMessage(v string) *CreateTemplateMessageBody { + s.Message = &v + return s +} - // Specifies whether the APNs channel is archived. - IsArchived *bool `type:"boolean"` +// SetRequestID sets the RequestID field's value. +func (s *CreateTemplateMessageBody) SetRequestID(v string) *CreateTemplateMessageBody { + s.RequestID = &v + return s +} - // The user who last modified the APNs channel. - LastModifiedBy *string `type:"string"` +type CreateVoiceTemplateInput struct { + _ struct{} `type:"structure" payload:"VoiceTemplateRequest"` - // The date and time when the APNs channel was last modified. - LastModifiedDate *string `type:"string"` + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` - // The type of messaging or notification platform for the channel. For the APNs - // channel, this value is APNS. + // Specifies the content and settings for a message template that can be used + // in messages that are sent through the voice channel. // - // Platform is a required field - Platform *string `type:"string" required:"true"` - - // The current version of the APNs channel. - Version *int64 `type:"integer"` + // VoiceTemplateRequest is a required field + VoiceTemplateRequest *VoiceTemplateRequest `type:"structure" required:"true"` } // String returns the string representation -func (s APNSChannelResponse) String() string { +func (s CreateVoiceTemplateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s APNSChannelResponse) GoString() string { +func (s CreateVoiceTemplateInput) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *APNSChannelResponse) SetApplicationId(v string) *APNSChannelResponse { - s.ApplicationId = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateVoiceTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateVoiceTemplateInput"} + 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.VoiceTemplateRequest == nil { + invalidParams.Add(request.NewErrParamRequired("VoiceTemplateRequest")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetCreationDate sets the CreationDate field's value. -func (s *APNSChannelResponse) SetCreationDate(v string) *APNSChannelResponse { - s.CreationDate = &v +// SetTemplateName sets the TemplateName field's value. +func (s *CreateVoiceTemplateInput) SetTemplateName(v string) *CreateVoiceTemplateInput { + s.TemplateName = &v return s } -// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. -func (s *APNSChannelResponse) SetDefaultAuthenticationMethod(v string) *APNSChannelResponse { - s.DefaultAuthenticationMethod = &v +// SetVoiceTemplateRequest sets the VoiceTemplateRequest field's value. +func (s *CreateVoiceTemplateInput) SetVoiceTemplateRequest(v *VoiceTemplateRequest) *CreateVoiceTemplateInput { + s.VoiceTemplateRequest = v return s } -// SetEnabled sets the Enabled field's value. -func (s *APNSChannelResponse) SetEnabled(v bool) *APNSChannelResponse { - s.Enabled = &v - return s +type CreateVoiceTemplateOutput struct { + _ struct{} `type:"structure" payload:"CreateTemplateMessageBody"` + + // Provides information about a request to create a message template. + // + // CreateTemplateMessageBody is a required field + CreateTemplateMessageBody *CreateTemplateMessageBody `type:"structure" required:"true"` } -// SetHasCredential sets the HasCredential field's value. -func (s *APNSChannelResponse) SetHasCredential(v bool) *APNSChannelResponse { - s.HasCredential = &v - return s +// String returns the string representation +func (s CreateVoiceTemplateOutput) String() string { + return awsutil.Prettify(s) } -// SetHasTokenKey sets the HasTokenKey field's value. -func (s *APNSChannelResponse) SetHasTokenKey(v bool) *APNSChannelResponse { - s.HasTokenKey = &v - return s +// GoString returns the string representation +func (s CreateVoiceTemplateOutput) GoString() string { + return s.String() } -// SetId sets the Id field's value. -func (s *APNSChannelResponse) SetId(v string) *APNSChannelResponse { - s.Id = &v +// SetCreateTemplateMessageBody sets the CreateTemplateMessageBody field's value. +func (s *CreateVoiceTemplateOutput) SetCreateTemplateMessageBody(v *CreateTemplateMessageBody) *CreateVoiceTemplateOutput { + s.CreateTemplateMessageBody = v return s } -// SetIsArchived sets the IsArchived field's value. -func (s *APNSChannelResponse) SetIsArchived(v bool) *APNSChannelResponse { - s.IsArchived = &v - return s +// Specifies the default message for all channels. +type DefaultMessage struct { + _ struct{} `type:"structure"` + + // The default body of the message. + Body *string `type:"string"` + + // The default message variables to use in the message. You can override these + // default variables with individual address variables. + Substitutions map[string][]*string `type:"map"` } -// SetLastModifiedBy sets the LastModifiedBy field's value. -func (s *APNSChannelResponse) SetLastModifiedBy(v string) *APNSChannelResponse { - s.LastModifiedBy = &v - return s +// String returns the string representation +func (s DefaultMessage) String() string { + return awsutil.Prettify(s) } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *APNSChannelResponse) SetLastModifiedDate(v string) *APNSChannelResponse { - s.LastModifiedDate = &v - return s +// GoString returns the string representation +func (s DefaultMessage) GoString() string { + return s.String() } -// SetPlatform sets the Platform field's value. -func (s *APNSChannelResponse) SetPlatform(v string) *APNSChannelResponse { - s.Platform = &v +// SetBody sets the Body field's value. +func (s *DefaultMessage) SetBody(v string) *DefaultMessage { + s.Body = &v return s } -// SetVersion sets the Version field's value. -func (s *APNSChannelResponse) SetVersion(v int64) *APNSChannelResponse { - s.Version = &v +// SetSubstitutions sets the Substitutions field's value. +func (s *DefaultMessage) SetSubstitutions(v map[string][]*string) *DefaultMessage { + s.Substitutions = v return s } -// Specifies the settings for a one-time message that's sent directly to an -// endpoint through the APNs (Apple Push Notification service) channel. -type APNSMessage struct { +// Specifies the default settings and content for a push notification that's +// sent directly to an endpoint. +type DefaultPushNotificationMessage struct { _ struct{} `type:"structure"` - // The action to occur if the recipient taps the push notification. Valid values - // are: + // The default action to occur if a recipient taps the push notification. Valid + // values are: // // * OPEN_APP - Your app opens or it becomes the foreground app if it was // sent to the background. This is the default action. // // * DEEP_LINK - Your app opens and displays a designated user interface - // in the app. This setting uses the deep-linking features of the iOS platform. + // in the app. This setting uses the deep-linking features of the iOS and + // Android platforms. // // * URL - The default mobile browser on the recipient's device opens and // loads the web page at a URL that you specify. Action *string `type:"string" enum:"Action"` - // The key that indicates whether and how to modify the badge of your app's - // icon when the recipient receives the push notification. If this key isn't - // included in the dictionary, the badge doesn't change. To remove the badge, - // set this value to 0. - Badge *int64 `type:"integer"` - - // The body of the notification message. + // The default body of the notification message. Body *string `type:"string"` - // The key that indicates the notification type for the push notification. This - // key is a value that's defined by the identifier property of one of your app's - // registered categories. - Category *string `type:"string"` - - // An arbitrary identifier that, if assigned to multiple messages, APNs uses - // to coalesce the messages into a single push notification instead of delivering - // each message individually. This value can't exceed 64 bytes. - // - // Amazon Pinpoint specifies this value in the apns-collapse-id request header - // when it sends the notification message to APNs. - CollapseId *string `type:"string"` - - // The JSON payload to use for a silent push notification. This payload is added - // to the data.pinpoint.jsonBody object of the notification. + // The JSON data payload to use for the default push notification, if the notification + // is a silent push notification. This payload is added to the data.pinpoint.jsonBody + // object of the notification. Data map[string]*string `type:"map"` - // The URL of an image or video to display in the push notification. - MediaUrl *string `type:"string"` - - // The authentication method that you want Amazon Pinpoint to use when authenticating - // with Apple Push Notification service (APNs), CERTIFICATE or TOKEN. - PreferredAuthenticationMethod *string `type:"string"` - - // para>5 - Low priority, the notification might be delayed, delivered as part - // of a group, or throttled. - // /listitem> - // 10 - High priority, the notification is sent immediately. This is the default - // value. A high priority notification should trigger an alert, play a sound, - // or badge your app's icon on the recipient's device. - // /para> - // Amazon Pinpoint specifies this value in the apns-priority request header - // when it sends the notification message to APNs. - // - // The equivalent values for Firebase Cloud Messaging (FCM), formerly Google - // Cloud Messaging (GCM), are normal, for 5, and high, for 10. If you specify - // an FCM value for this property, Amazon Pinpoint accepts and converts the - // value to the corresponding APNs value. - Priority *string `type:"string"` - - // The raw, JSON-formatted string to use as the payload for the notification - // message. This value overrides the message. - RawContent *string `type:"string"` - - // Specifies whether the notification is a silent push notification, which is - // a push notification that doesn't display on a recipient's device. Silent - // push notifications can be used for cases such as updating an app's configuration, - // displaying messages in an in-app message center, or supporting phone home - // functionality. + // Specifies whether the default notification is a silent push notification, + // which is a push notification that doesn't display on a recipient's device. + // Silent push notifications can be used for cases such as updating an app's + // configuration or delivering messages to an in-app notification center. SilentPush *bool `type:"boolean"` - // The key for the sound to play when the recipient receives the push notification. - // The value of this key is the name of a sound file in your app's main bundle - // or the Library/Sounds folder in your app's data container. If the sound file - // can't be found or you specify default for the value, the system plays the - // default alert sound. - Sound *string `type:"string"` - // The default message variables to use in the notification message. You can - // override these default variables with individual address variables. + // override the default variables with individual address variables. Substitutions map[string][]*string `type:"map"` - // The key that represents your app-specific identifier for grouping notifications. - // If you provide a Notification Content app extension, you can use this value - // to group your notifications together. - ThreadId *string `type:"string"` - - // The amount of time, in seconds, that APNs should store and attempt to deliver - // the push notification, if the service is unable to deliver the notification - // the first time. If this value is 0, APNs treats the notification as if it - // expires immediately and the service doesn't store or try to deliver the notification - // again. - // - // Amazon Pinpoint specifies this value in the apns-expiration request header - // when it sends the notification message to APNs. - TimeToLive *int64 `type:"integer"` - - // The title to display above the notification message on the recipient's device. + // The default title to display above the notification message on a recipient's + // device. Title *string `type:"string"` - // The URL to open in the recipient's default mobile browser, if a recipient + // The default URL to open in a recipient's default mobile browser, if a recipient // taps the push notification and the value of the Action property is URL. Url *string `type:"string"` } // String returns the string representation -func (s APNSMessage) String() string { +func (s DefaultPushNotificationMessage) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s APNSMessage) GoString() string { +func (s DefaultPushNotificationMessage) GoString() string { return s.String() } // SetAction sets the Action field's value. -func (s *APNSMessage) SetAction(v string) *APNSMessage { +func (s *DefaultPushNotificationMessage) SetAction(v string) *DefaultPushNotificationMessage { s.Action = &v return s } -// SetBadge sets the Badge field's value. -func (s *APNSMessage) SetBadge(v int64) *APNSMessage { - s.Badge = &v - return s -} - // SetBody sets the Body field's value. -func (s *APNSMessage) SetBody(v string) *APNSMessage { +func (s *DefaultPushNotificationMessage) SetBody(v string) *DefaultPushNotificationMessage { s.Body = &v return s } -// SetCategory sets the Category field's value. -func (s *APNSMessage) SetCategory(v string) *APNSMessage { - s.Category = &v +// SetData sets the Data field's value. +func (s *DefaultPushNotificationMessage) SetData(v map[string]*string) *DefaultPushNotificationMessage { + s.Data = v return s } -// SetCollapseId sets the CollapseId field's value. -func (s *APNSMessage) SetCollapseId(v string) *APNSMessage { - s.CollapseId = &v +// SetSilentPush sets the SilentPush field's value. +func (s *DefaultPushNotificationMessage) SetSilentPush(v bool) *DefaultPushNotificationMessage { + s.SilentPush = &v return s } -// SetData sets the Data field's value. -func (s *APNSMessage) SetData(v map[string]*string) *APNSMessage { - s.Data = v +// SetSubstitutions sets the Substitutions field's value. +func (s *DefaultPushNotificationMessage) SetSubstitutions(v map[string][]*string) *DefaultPushNotificationMessage { + s.Substitutions = v return s } -// SetMediaUrl sets the MediaUrl field's value. -func (s *APNSMessage) SetMediaUrl(v string) *APNSMessage { - s.MediaUrl = &v +// SetTitle sets the Title field's value. +func (s *DefaultPushNotificationMessage) SetTitle(v string) *DefaultPushNotificationMessage { + s.Title = &v return s } -// SetPreferredAuthenticationMethod sets the PreferredAuthenticationMethod field's value. -func (s *APNSMessage) SetPreferredAuthenticationMethod(v string) *APNSMessage { - s.PreferredAuthenticationMethod = &v +// SetUrl sets the Url field's value. +func (s *DefaultPushNotificationMessage) SetUrl(v string) *DefaultPushNotificationMessage { + s.Url = &v return s } -// SetPriority sets the Priority field's value. -func (s *APNSMessage) SetPriority(v string) *APNSMessage { - s.Priority = &v - return s -} +// Specifies the default settings and content for a message template that can +// be used in messages that are sent through a push notification channel. +type DefaultPushNotificationTemplate struct { + _ struct{} `type:"structure"` -// SetRawContent sets the RawContent field's value. -func (s *APNSMessage) SetRawContent(v string) *APNSMessage { - s.RawContent = &v - return s + // The action to occur if a recipient taps a push notification that's based + // on the message template. Valid values are: + // + // * OPEN_APP - Your app opens or it becomes the foreground app if it was + // sent to the background. This is the default action. + // + // * DEEP_LINK - Your app opens and displays a designated user interface + // in the app. This setting uses the deep-linking features of the iOS and + // Android platforms. + // + // * URL - The default mobile browser on the recipient's device opens and + // loads the web page at a URL that you specify. + Action *string `type:"string" enum:"Action"` + + // The message body to use in push notifications that are based on the message + // template. + Body *string `type:"string"` + + // The sound to play when a recipient receives a push notification that's based + // on the message template. You can use the default stream or specify the file + // name of a sound resource that's bundled in your app. On an Android platform, + // the sound file must reside in /res/raw/. + // + // For an iOS platform, this value is the key for the name of a sound file in + // your app's main bundle or the Library/Sounds folder in your app's data container. + // If the sound file can't be found or you specify default for the value, the + // system plays the default alert sound. + Sound *string `type:"string"` + + // The title to use in push notifications that are based on the message template. + // This title appears above the notification message on a recipient's device. + Title *string `type:"string"` + + // The URL to open in a recipient's default mobile browser, if a recipient taps + // a push notification that's based on the message template and the value of + // the Action property is URL. + Url *string `type:"string"` } -// SetSilentPush sets the SilentPush field's value. -func (s *APNSMessage) SetSilentPush(v bool) *APNSMessage { - s.SilentPush = &v - return s +// String returns the string representation +func (s DefaultPushNotificationTemplate) String() string { + return awsutil.Prettify(s) } -// SetSound sets the Sound field's value. -func (s *APNSMessage) SetSound(v string) *APNSMessage { - s.Sound = &v - return s +// GoString returns the string representation +func (s DefaultPushNotificationTemplate) GoString() string { + return s.String() } -// SetSubstitutions sets the Substitutions field's value. -func (s *APNSMessage) SetSubstitutions(v map[string][]*string) *APNSMessage { - s.Substitutions = v +// SetAction sets the Action field's value. +func (s *DefaultPushNotificationTemplate) SetAction(v string) *DefaultPushNotificationTemplate { + s.Action = &v return s } -// SetThreadId sets the ThreadId field's value. -func (s *APNSMessage) SetThreadId(v string) *APNSMessage { - s.ThreadId = &v +// SetBody sets the Body field's value. +func (s *DefaultPushNotificationTemplate) SetBody(v string) *DefaultPushNotificationTemplate { + s.Body = &v return s } -// SetTimeToLive sets the TimeToLive field's value. -func (s *APNSMessage) SetTimeToLive(v int64) *APNSMessage { - s.TimeToLive = &v +// SetSound sets the Sound field's value. +func (s *DefaultPushNotificationTemplate) SetSound(v string) *DefaultPushNotificationTemplate { + s.Sound = &v return s } // SetTitle sets the Title field's value. -func (s *APNSMessage) SetTitle(v string) *APNSMessage { +func (s *DefaultPushNotificationTemplate) SetTitle(v string) *DefaultPushNotificationTemplate { s.Title = &v return s } // SetUrl sets the Url field's value. -func (s *APNSMessage) SetUrl(v string) *APNSMessage { +func (s *DefaultPushNotificationTemplate) SetUrl(v string) *DefaultPushNotificationTemplate { s.Url = &v return s } -// Specifies the status and settings of the APNs (Apple Push Notification service) -// sandbox channel for an application. -type APNSSandboxChannelRequest struct { +type DeleteAdmChannelInput struct { _ struct{} `type:"structure"` - // The bundle identifier that's assigned to your iOS app. This identifier is - // used for APNs tokens. - BundleId *string `type:"string"` - - // The APNs client certificate that you received from Apple, if you want Amazon - // Pinpoint to communicate with the APNs sandbox environment by using an APNs - // certificate. - Certificate *string `type:"string"` - - // The default authentication method that you want Amazon Pinpoint to use when - // authenticating with the APNs sandbox environment, key or certificate. - DefaultAuthenticationMethod *string `type:"string"` - - // Specifies whether to enable the APNs sandbox channel for the application. - Enabled *bool `type:"boolean"` - - // The private key for the APNs client certificate that you want Amazon Pinpoint - // to use to communicate with the APNs sandbox environment. - PrivateKey *string `type:"string"` - - // The identifier that's assigned to your Apple developer account team. This - // identifier is used for APNs tokens. - TeamId *string `type:"string"` - - // The authentication key to use for APNs tokens. - TokenKey *string `type:"string"` - - // The key identifier that's assigned to your APNs signing key, if you want - // Amazon Pinpoint to communicate with the APNs sandbox environment by using - // APNs tokens. - TokenKeyId *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } // String returns the string representation -func (s APNSSandboxChannelRequest) String() string { +func (s DeleteAdmChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s APNSSandboxChannelRequest) GoString() string { +func (s DeleteAdmChannelInput) GoString() string { return s.String() } -// SetBundleId sets the BundleId field's value. -func (s *APNSSandboxChannelRequest) SetBundleId(v string) *APNSSandboxChannelRequest { - s.BundleId = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteAdmChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteAdmChannelInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } -// SetCertificate sets the Certificate field's value. -func (s *APNSSandboxChannelRequest) SetCertificate(v string) *APNSSandboxChannelRequest { - s.Certificate = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. -func (s *APNSSandboxChannelRequest) SetDefaultAuthenticationMethod(v string) *APNSSandboxChannelRequest { - s.DefaultAuthenticationMethod = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *DeleteAdmChannelInput) SetApplicationId(v string) *DeleteAdmChannelInput { + s.ApplicationId = &v return s } -// SetEnabled sets the Enabled field's value. -func (s *APNSSandboxChannelRequest) SetEnabled(v bool) *APNSSandboxChannelRequest { - s.Enabled = &v - return s -} +type DeleteAdmChannelOutput struct { + _ struct{} `type:"structure" payload:"ADMChannelResponse"` -// SetPrivateKey sets the PrivateKey field's value. -func (s *APNSSandboxChannelRequest) SetPrivateKey(v string) *APNSSandboxChannelRequest { - s.PrivateKey = &v - return s + // Provides information about the status and settings of the ADM (Amazon Device + // Messaging) channel for an application. + // + // ADMChannelResponse is a required field + ADMChannelResponse *ADMChannelResponse `type:"structure" required:"true"` } -// SetTeamId sets the TeamId field's value. -func (s *APNSSandboxChannelRequest) SetTeamId(v string) *APNSSandboxChannelRequest { - s.TeamId = &v - return s +// String returns the string representation +func (s DeleteAdmChannelOutput) String() string { + return awsutil.Prettify(s) } -// SetTokenKey sets the TokenKey field's value. -func (s *APNSSandboxChannelRequest) SetTokenKey(v string) *APNSSandboxChannelRequest { - s.TokenKey = &v - return s +// GoString returns the string representation +func (s DeleteAdmChannelOutput) GoString() string { + return s.String() } -// SetTokenKeyId sets the TokenKeyId field's value. -func (s *APNSSandboxChannelRequest) SetTokenKeyId(v string) *APNSSandboxChannelRequest { - s.TokenKeyId = &v +// SetADMChannelResponse sets the ADMChannelResponse field's value. +func (s *DeleteAdmChannelOutput) SetADMChannelResponse(v *ADMChannelResponse) *DeleteAdmChannelOutput { + s.ADMChannelResponse = v return s } -// Provides information about the status and settings of the APNs (Apple Push -// Notification service) sandbox channel for an application. -type APNSSandboxChannelResponse struct { +type DeleteApnsChannelInput struct { _ struct{} `type:"structure"` - // The unique identifier for the application that the APNs sandbox channel applies - // to. - ApplicationId *string `type:"string"` - - // The date and time when the APNs sandbox channel was enabled. - CreationDate *string `type:"string"` - - // The default authentication method that Amazon Pinpoint uses to authenticate - // with the APNs sandbox environment for this channel, key or certificate. - DefaultAuthenticationMethod *string `type:"string"` - - // Specifies whether the APNs sandbox channel is enabled for the application. - Enabled *bool `type:"boolean"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +} - // (Not used) This property is retained only for backward compatibility. - HasCredential *bool `type:"boolean"` +// String returns the string representation +func (s DeleteApnsChannelInput) String() string { + return awsutil.Prettify(s) +} - // Specifies whether the APNs sandbox channel is configured to communicate with - // APNs by using APNs tokens. To provide an authentication key for APNs tokens, - // set the TokenKey property of the channel. - HasTokenKey *bool `type:"boolean"` +// GoString returns the string representation +func (s DeleteApnsChannelInput) GoString() string { + return s.String() +} - // (Deprecated) An identifier for the APNs sandbox channel. This property is - // retained only for backward compatibility. - Id *string `type:"string"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteApnsChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteApnsChannelInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } - // Specifies whether the APNs sandbox channel is archived. - IsArchived *bool `type:"boolean"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // The user who last modified the APNs sandbox channel. - LastModifiedBy *string `type:"string"` +// SetApplicationId sets the ApplicationId field's value. +func (s *DeleteApnsChannelInput) SetApplicationId(v string) *DeleteApnsChannelInput { + s.ApplicationId = &v + return s +} - // The date and time when the APNs sandbox channel was last modified. - LastModifiedDate *string `type:"string"` +type DeleteApnsChannelOutput struct { + _ struct{} `type:"structure" payload:"APNSChannelResponse"` - // The type of messaging or notification platform for the channel. For the APNs - // sandbox channel, this value is APNS_SANDBOX. + // Provides information about the status and settings of the APNs (Apple Push + // Notification service) channel for an application. // - // Platform is a required field - Platform *string `type:"string" required:"true"` - - // The current version of the APNs sandbox channel. - Version *int64 `type:"integer"` + // APNSChannelResponse is a required field + APNSChannelResponse *APNSChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s APNSSandboxChannelResponse) String() string { +func (s DeleteApnsChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s APNSSandboxChannelResponse) GoString() string { +func (s DeleteApnsChannelOutput) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *APNSSandboxChannelResponse) SetApplicationId(v string) *APNSSandboxChannelResponse { - s.ApplicationId = &v +// SetAPNSChannelResponse sets the APNSChannelResponse field's value. +func (s *DeleteApnsChannelOutput) SetAPNSChannelResponse(v *APNSChannelResponse) *DeleteApnsChannelOutput { + s.APNSChannelResponse = v return s } -// SetCreationDate sets the CreationDate field's value. -func (s *APNSSandboxChannelResponse) SetCreationDate(v string) *APNSSandboxChannelResponse { - s.CreationDate = &v - return s -} +type DeleteApnsSandboxChannelInput struct { + _ struct{} `type:"structure"` -// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. -func (s *APNSSandboxChannelResponse) SetDefaultAuthenticationMethod(v string) *APNSSandboxChannelResponse { - s.DefaultAuthenticationMethod = &v - return s + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } -// SetEnabled sets the Enabled field's value. -func (s *APNSSandboxChannelResponse) SetEnabled(v bool) *APNSSandboxChannelResponse { - s.Enabled = &v - return s +// String returns the string representation +func (s DeleteApnsSandboxChannelInput) String() string { + return awsutil.Prettify(s) } -// SetHasCredential sets the HasCredential field's value. -func (s *APNSSandboxChannelResponse) SetHasCredential(v bool) *APNSSandboxChannelResponse { - s.HasCredential = &v - return s +// GoString returns the string representation +func (s DeleteApnsSandboxChannelInput) GoString() string { + return s.String() } -// SetHasTokenKey sets the HasTokenKey field's value. -func (s *APNSSandboxChannelResponse) SetHasTokenKey(v bool) *APNSSandboxChannelResponse { - s.HasTokenKey = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteApnsSandboxChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteApnsSandboxChannelInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } -// SetId sets the Id field's value. -func (s *APNSSandboxChannelResponse) SetId(v string) *APNSSandboxChannelResponse { - s.Id = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetIsArchived sets the IsArchived field's value. -func (s *APNSSandboxChannelResponse) SetIsArchived(v bool) *APNSSandboxChannelResponse { - s.IsArchived = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *DeleteApnsSandboxChannelInput) SetApplicationId(v string) *DeleteApnsSandboxChannelInput { + s.ApplicationId = &v return s } -// SetLastModifiedBy sets the LastModifiedBy field's value. -func (s *APNSSandboxChannelResponse) SetLastModifiedBy(v string) *APNSSandboxChannelResponse { - s.LastModifiedBy = &v - return s +type DeleteApnsSandboxChannelOutput struct { + _ struct{} `type:"structure" payload:"APNSSandboxChannelResponse"` + + // Provides information about the status and settings of the APNs (Apple Push + // Notification service) sandbox channel for an application. + // + // APNSSandboxChannelResponse is a required field + APNSSandboxChannelResponse *APNSSandboxChannelResponse `type:"structure" required:"true"` } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *APNSSandboxChannelResponse) SetLastModifiedDate(v string) *APNSSandboxChannelResponse { - s.LastModifiedDate = &v - return s +// String returns the string representation +func (s DeleteApnsSandboxChannelOutput) String() string { + return awsutil.Prettify(s) } -// SetPlatform sets the Platform field's value. -func (s *APNSSandboxChannelResponse) SetPlatform(v string) *APNSSandboxChannelResponse { - s.Platform = &v - return s +// GoString returns the string representation +func (s DeleteApnsSandboxChannelOutput) GoString() string { + return s.String() } -// SetVersion sets the Version field's value. -func (s *APNSSandboxChannelResponse) SetVersion(v int64) *APNSSandboxChannelResponse { - s.Version = &v +// SetAPNSSandboxChannelResponse sets the APNSSandboxChannelResponse field's value. +func (s *DeleteApnsSandboxChannelOutput) SetAPNSSandboxChannelResponse(v *APNSSandboxChannelResponse) *DeleteApnsSandboxChannelOutput { + s.APNSSandboxChannelResponse = v return s } -// Specifies the status and settings of the APNs (Apple Push Notification service) -// VoIP channel for an application. -type APNSVoipChannelRequest struct { +type DeleteApnsVoipChannelInput struct { _ struct{} `type:"structure"` - // The bundle identifier that's assigned to your iOS app. This identifier is - // used for APNs tokens. - BundleId *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +} - // The APNs client certificate that you received from Apple, if you want Amazon - // Pinpoint to communicate with APNs by using an APNs certificate. - Certificate *string `type:"string"` +// String returns the string representation +func (s DeleteApnsVoipChannelInput) String() string { + return awsutil.Prettify(s) +} - // The default authentication method that you want Amazon Pinpoint to use when - // authenticating with APNs, key or certificate. - DefaultAuthenticationMethod *string `type:"string"` +// GoString returns the string representation +func (s DeleteApnsVoipChannelInput) GoString() string { + return s.String() +} - // Specifies whether to enable the APNs VoIP channel for the application. - Enabled *bool `type:"boolean"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteApnsVoipChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteApnsVoipChannelInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } - // The private key for the APNs client certificate that you want Amazon Pinpoint - // to use to communicate with APNs. - PrivateKey *string `type:"string"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // The identifier that's assigned to your Apple developer account team. This - // identifier is used for APNs tokens. - TeamId *string `type:"string"` +// SetApplicationId sets the ApplicationId field's value. +func (s *DeleteApnsVoipChannelInput) SetApplicationId(v string) *DeleteApnsVoipChannelInput { + s.ApplicationId = &v + return s +} - // The authentication key to use for APNs tokens. - TokenKey *string `type:"string"` +type DeleteApnsVoipChannelOutput struct { + _ struct{} `type:"structure" payload:"APNSVoipChannelResponse"` - // The key identifier that's assigned to your APNs signing key, if you want - // Amazon Pinpoint to communicate with APNs by using APNs tokens. - TokenKeyId *string `type:"string"` + // Provides information about the status and settings of the APNs (Apple Push + // Notification service) VoIP channel for an application. + // + // APNSVoipChannelResponse is a required field + APNSVoipChannelResponse *APNSVoipChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s APNSVoipChannelRequest) String() string { +func (s DeleteApnsVoipChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s APNSVoipChannelRequest) GoString() string { +func (s DeleteApnsVoipChannelOutput) GoString() string { return s.String() } -// SetBundleId sets the BundleId field's value. -func (s *APNSVoipChannelRequest) SetBundleId(v string) *APNSVoipChannelRequest { - s.BundleId = &v +// SetAPNSVoipChannelResponse sets the APNSVoipChannelResponse field's value. +func (s *DeleteApnsVoipChannelOutput) SetAPNSVoipChannelResponse(v *APNSVoipChannelResponse) *DeleteApnsVoipChannelOutput { + s.APNSVoipChannelResponse = v return s } -// SetCertificate sets the Certificate field's value. -func (s *APNSVoipChannelRequest) SetCertificate(v string) *APNSVoipChannelRequest { - s.Certificate = &v - return s +type DeleteApnsVoipSandboxChannelInput struct { + _ struct{} `type:"structure"` + + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } -// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. -func (s *APNSVoipChannelRequest) SetDefaultAuthenticationMethod(v string) *APNSVoipChannelRequest { - s.DefaultAuthenticationMethod = &v - return s +// String returns the string representation +func (s DeleteApnsVoipSandboxChannelInput) String() string { + return awsutil.Prettify(s) } -// SetEnabled sets the Enabled field's value. -func (s *APNSVoipChannelRequest) SetEnabled(v bool) *APNSVoipChannelRequest { - s.Enabled = &v - return s +// GoString returns the string representation +func (s DeleteApnsVoipSandboxChannelInput) GoString() string { + return s.String() } -// SetPrivateKey sets the PrivateKey field's value. -func (s *APNSVoipChannelRequest) SetPrivateKey(v string) *APNSVoipChannelRequest { - s.PrivateKey = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteApnsVoipSandboxChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteApnsVoipSandboxChannelInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetTeamId sets the TeamId field's value. -func (s *APNSVoipChannelRequest) SetTeamId(v string) *APNSVoipChannelRequest { - s.TeamId = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *DeleteApnsVoipSandboxChannelInput) SetApplicationId(v string) *DeleteApnsVoipSandboxChannelInput { + s.ApplicationId = &v return s } -// SetTokenKey sets the TokenKey field's value. -func (s *APNSVoipChannelRequest) SetTokenKey(v string) *APNSVoipChannelRequest { - s.TokenKey = &v - return s +type DeleteApnsVoipSandboxChannelOutput struct { + _ struct{} `type:"structure" payload:"APNSVoipSandboxChannelResponse"` + + // Provides information about the status and settings of the APNs (Apple Push + // Notification service) VoIP sandbox channel for an application. + // + // APNSVoipSandboxChannelResponse is a required field + APNSVoipSandboxChannelResponse *APNSVoipSandboxChannelResponse `type:"structure" required:"true"` +} + +// String returns the string representation +func (s DeleteApnsVoipSandboxChannelOutput) String() string { + return awsutil.Prettify(s) } -// SetTokenKeyId sets the TokenKeyId field's value. -func (s *APNSVoipChannelRequest) SetTokenKeyId(v string) *APNSVoipChannelRequest { - s.TokenKeyId = &v +// GoString returns the string representation +func (s DeleteApnsVoipSandboxChannelOutput) GoString() string { + return s.String() +} + +// SetAPNSVoipSandboxChannelResponse sets the APNSVoipSandboxChannelResponse field's value. +func (s *DeleteApnsVoipSandboxChannelOutput) SetAPNSVoipSandboxChannelResponse(v *APNSVoipSandboxChannelResponse) *DeleteApnsVoipSandboxChannelOutput { + s.APNSVoipSandboxChannelResponse = v return s } -// Provides information about the status and settings of the APNs (Apple Push -// Notification service) VoIP channel for an application. -type APNSVoipChannelResponse struct { +type DeleteAppInput struct { _ struct{} `type:"structure"` - // The unique identifier for the application that the APNs VoIP channel applies - // to. - ApplicationId *string `type:"string"` - - // The date and time when the APNs VoIP channel was enabled. - CreationDate *string `type:"string"` - - // The default authentication method that Amazon Pinpoint uses to authenticate - // with APNs for this channel, key or certificate. - DefaultAuthenticationMethod *string `type:"string"` - - // Specifies whether the APNs VoIP channel is enabled for the application. - Enabled *bool `type:"boolean"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +} - // (Not used) This property is retained only for backward compatibility. - HasCredential *bool `type:"boolean"` +// String returns the string representation +func (s DeleteAppInput) String() string { + return awsutil.Prettify(s) +} - // Specifies whether the APNs VoIP channel is configured to communicate with - // APNs by using APNs tokens. To provide an authentication key for APNs tokens, - // set the TokenKey property of the channel. - HasTokenKey *bool `type:"boolean"` +// GoString returns the string representation +func (s DeleteAppInput) GoString() string { + return s.String() +} - // (Deprecated) An identifier for the APNs VoIP channel. This property is retained - // only for backward compatibility. - Id *string `type:"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.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } - // Specifies whether the APNs VoIP channel is archived. - IsArchived *bool `type:"boolean"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // The user who last modified the APNs VoIP channel. - LastModifiedBy *string `type:"string"` +// SetApplicationId sets the ApplicationId field's value. +func (s *DeleteAppInput) SetApplicationId(v string) *DeleteAppInput { + s.ApplicationId = &v + return s +} - // The date and time when the APNs VoIP channel was last modified. - LastModifiedDate *string `type:"string"` +type DeleteAppOutput struct { + _ struct{} `type:"structure" payload:"ApplicationResponse"` - // The type of messaging or notification platform for the channel. For the APNs - // VoIP channel, this value is APNS_VOIP. + // Provides information about an application. // - // Platform is a required field - Platform *string `type:"string" required:"true"` - - // The current version of the APNs VoIP channel. - Version *int64 `type:"integer"` + // ApplicationResponse is a required field + ApplicationResponse *ApplicationResponse `type:"structure" required:"true"` } // String returns the string representation -func (s APNSVoipChannelResponse) String() string { +func (s DeleteAppOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s APNSVoipChannelResponse) GoString() string { +func (s DeleteAppOutput) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *APNSVoipChannelResponse) SetApplicationId(v string) *APNSVoipChannelResponse { - s.ApplicationId = &v +// SetApplicationResponse sets the ApplicationResponse field's value. +func (s *DeleteAppOutput) SetApplicationResponse(v *ApplicationResponse) *DeleteAppOutput { + s.ApplicationResponse = v return s } -// SetCreationDate sets the CreationDate field's value. -func (s *APNSVoipChannelResponse) SetCreationDate(v string) *APNSVoipChannelResponse { - s.CreationDate = &v - return s -} +type DeleteBaiduChannelInput struct { + _ struct{} `type:"structure"` -// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. -func (s *APNSVoipChannelResponse) SetDefaultAuthenticationMethod(v string) *APNSVoipChannelResponse { - s.DefaultAuthenticationMethod = &v - return s + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } -// SetEnabled sets the Enabled field's value. -func (s *APNSVoipChannelResponse) SetEnabled(v bool) *APNSVoipChannelResponse { - s.Enabled = &v - return s +// String returns the string representation +func (s DeleteBaiduChannelInput) String() string { + return awsutil.Prettify(s) } -// SetHasCredential sets the HasCredential field's value. -func (s *APNSVoipChannelResponse) SetHasCredential(v bool) *APNSVoipChannelResponse { - s.HasCredential = &v - return s +// GoString returns the string representation +func (s DeleteBaiduChannelInput) GoString() string { + return s.String() } -// SetHasTokenKey sets the HasTokenKey field's value. -func (s *APNSVoipChannelResponse) SetHasTokenKey(v bool) *APNSVoipChannelResponse { - s.HasTokenKey = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteBaiduChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteBaiduChannelInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } -// SetId sets the Id field's value. -func (s *APNSVoipChannelResponse) SetId(v string) *APNSVoipChannelResponse { - s.Id = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetIsArchived sets the IsArchived field's value. -func (s *APNSVoipChannelResponse) SetIsArchived(v bool) *APNSVoipChannelResponse { - s.IsArchived = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *DeleteBaiduChannelInput) SetApplicationId(v string) *DeleteBaiduChannelInput { + s.ApplicationId = &v return s } -// SetLastModifiedBy sets the LastModifiedBy field's value. -func (s *APNSVoipChannelResponse) SetLastModifiedBy(v string) *APNSVoipChannelResponse { - s.LastModifiedBy = &v - return s +type DeleteBaiduChannelOutput struct { + _ struct{} `type:"structure" payload:"BaiduChannelResponse"` + + // Provides information about the status and settings of the Baidu (Baidu Cloud + // Push) channel for an application. + // + // BaiduChannelResponse is a required field + BaiduChannelResponse *BaiduChannelResponse `type:"structure" required:"true"` } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *APNSVoipChannelResponse) SetLastModifiedDate(v string) *APNSVoipChannelResponse { - s.LastModifiedDate = &v - return s +// String returns the string representation +func (s DeleteBaiduChannelOutput) String() string { + return awsutil.Prettify(s) } -// SetPlatform sets the Platform field's value. -func (s *APNSVoipChannelResponse) SetPlatform(v string) *APNSVoipChannelResponse { - s.Platform = &v - return s +// GoString returns the string representation +func (s DeleteBaiduChannelOutput) GoString() string { + return s.String() } -// SetVersion sets the Version field's value. -func (s *APNSVoipChannelResponse) SetVersion(v int64) *APNSVoipChannelResponse { - s.Version = &v +// SetBaiduChannelResponse sets the BaiduChannelResponse field's value. +func (s *DeleteBaiduChannelOutput) SetBaiduChannelResponse(v *BaiduChannelResponse) *DeleteBaiduChannelOutput { + s.BaiduChannelResponse = v return s } -// Specifies the status and settings of the APNs (Apple Push Notification service) -// VoIP sandbox channel for an application. -type APNSVoipSandboxChannelRequest struct { +type DeleteCampaignInput struct { _ struct{} `type:"structure"` - // The bundle identifier that's assigned to your iOS app. This identifier is - // used for APNs tokens. - BundleId *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The APNs client certificate that you received from Apple, if you want Amazon - // Pinpoint to communicate with the APNs sandbox environment by using an APNs - // certificate. - Certificate *string `type:"string"` + // CampaignId is a required field + CampaignId *string `location:"uri" locationName:"campaign-id" type:"string" required:"true"` +} - // The default authentication method that you want Amazon Pinpoint to use when - // authenticating with the APNs sandbox environment for this channel, key or - // certificate. - DefaultAuthenticationMethod *string `type:"string"` +// String returns the string representation +func (s DeleteCampaignInput) String() string { + return awsutil.Prettify(s) +} - // Specifies whether the APNs VoIP sandbox channel is enabled for the application. - Enabled *bool `type:"boolean"` +// GoString returns the string representation +func (s DeleteCampaignInput) GoString() string { + return s.String() +} - // The private key for the APNs client certificate that you want Amazon Pinpoint - // to use to communicate with the APNs sandbox environment. - PrivateKey *string `type:"string"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteCampaignInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteCampaignInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.CampaignId == nil { + invalidParams.Add(request.NewErrParamRequired("CampaignId")) + } + if s.CampaignId != nil && len(*s.CampaignId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CampaignId", 1)) + } - // The identifier that's assigned to your Apple developer account team. This - // identifier is used for APNs tokens. - TeamId *string `type:"string"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *DeleteCampaignInput) SetApplicationId(v string) *DeleteCampaignInput { + s.ApplicationId = &v + return s +} + +// SetCampaignId sets the CampaignId field's value. +func (s *DeleteCampaignInput) SetCampaignId(v string) *DeleteCampaignInput { + s.CampaignId = &v + return s +} - // The authentication key to use for APNs tokens. - TokenKey *string `type:"string"` +type DeleteCampaignOutput struct { + _ struct{} `type:"structure" payload:"CampaignResponse"` - // The key identifier that's assigned to your APNs signing key, if you want - // Amazon Pinpoint to communicate with the APNs sandbox environment by using - // APNs tokens. - TokenKeyId *string `type:"string"` + // Provides information about the status, configuration, and other settings + // for a campaign. + // + // CampaignResponse is a required field + CampaignResponse *CampaignResponse `type:"structure" required:"true"` } // String returns the string representation -func (s APNSVoipSandboxChannelRequest) String() string { +func (s DeleteCampaignOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s APNSVoipSandboxChannelRequest) GoString() string { +func (s DeleteCampaignOutput) GoString() string { return s.String() } -// SetBundleId sets the BundleId field's value. -func (s *APNSVoipSandboxChannelRequest) SetBundleId(v string) *APNSVoipSandboxChannelRequest { - s.BundleId = &v +// SetCampaignResponse sets the CampaignResponse field's value. +func (s *DeleteCampaignOutput) SetCampaignResponse(v *CampaignResponse) *DeleteCampaignOutput { + s.CampaignResponse = v return s } -// SetCertificate sets the Certificate field's value. -func (s *APNSVoipSandboxChannelRequest) SetCertificate(v string) *APNSVoipSandboxChannelRequest { - s.Certificate = &v - return s +type DeleteEmailChannelInput struct { + _ struct{} `type:"structure"` + + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } -// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. -func (s *APNSVoipSandboxChannelRequest) SetDefaultAuthenticationMethod(v string) *APNSVoipSandboxChannelRequest { - s.DefaultAuthenticationMethod = &v - return s +// String returns the string representation +func (s DeleteEmailChannelInput) String() string { + return awsutil.Prettify(s) } -// SetEnabled sets the Enabled field's value. -func (s *APNSVoipSandboxChannelRequest) SetEnabled(v bool) *APNSVoipSandboxChannelRequest { - s.Enabled = &v - return s +// GoString returns the string representation +func (s DeleteEmailChannelInput) GoString() string { + return s.String() } -// SetPrivateKey sets the PrivateKey field's value. -func (s *APNSVoipSandboxChannelRequest) SetPrivateKey(v string) *APNSVoipSandboxChannelRequest { - s.PrivateKey = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteEmailChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteEmailChannelInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetTeamId sets the TeamId field's value. -func (s *APNSVoipSandboxChannelRequest) SetTeamId(v string) *APNSVoipSandboxChannelRequest { - s.TeamId = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *DeleteEmailChannelInput) SetApplicationId(v string) *DeleteEmailChannelInput { + s.ApplicationId = &v return s } -// SetTokenKey sets the TokenKey field's value. -func (s *APNSVoipSandboxChannelRequest) SetTokenKey(v string) *APNSVoipSandboxChannelRequest { - s.TokenKey = &v - return s +type DeleteEmailChannelOutput struct { + _ struct{} `type:"structure" payload:"EmailChannelResponse"` + + // Provides information about the status and settings of the email channel for + // an application. + // + // EmailChannelResponse is a required field + EmailChannelResponse *EmailChannelResponse `type:"structure" required:"true"` } -// SetTokenKeyId sets the TokenKeyId field's value. -func (s *APNSVoipSandboxChannelRequest) SetTokenKeyId(v string) *APNSVoipSandboxChannelRequest { - s.TokenKeyId = &v +// String returns the string representation +func (s DeleteEmailChannelOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteEmailChannelOutput) GoString() string { + return s.String() +} + +// SetEmailChannelResponse sets the EmailChannelResponse field's value. +func (s *DeleteEmailChannelOutput) SetEmailChannelResponse(v *EmailChannelResponse) *DeleteEmailChannelOutput { + s.EmailChannelResponse = v return s } -// Provides information about the status and settings of the APNs (Apple Push -// Notification service) VoIP sandbox channel for an application. -type APNSVoipSandboxChannelResponse struct { +type DeleteEmailTemplateInput struct { _ struct{} `type:"structure"` - // The unique identifier for the application that the APNs VoIP sandbox channel - // applies to. - ApplicationId *string `type:"string"` - - // The date and time when the APNs VoIP sandbox channel was enabled. - CreationDate *string `type:"string"` + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` - // The default authentication method that Amazon Pinpoint uses to authenticate - // with the APNs sandbox environment for this channel, key or certificate. - DefaultAuthenticationMethod *string `type:"string"` + Version *string `location:"querystring" locationName:"version" type:"string"` +} - // Specifies whether the APNs VoIP sandbox channel is enabled for the application. - Enabled *bool `type:"boolean"` +// String returns the string representation +func (s DeleteEmailTemplateInput) String() string { + return awsutil.Prettify(s) +} - // (Not used) This property is retained only for backward compatibility. - HasCredential *bool `type:"boolean"` +// GoString returns the string representation +func (s DeleteEmailTemplateInput) GoString() string { + return s.String() +} - // Specifies whether the APNs VoIP sandbox channel is configured to communicate - // with APNs by using APNs tokens. To provide an authentication key for APNs - // tokens, set the TokenKey property of the channel. - HasTokenKey *bool `type:"boolean"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteEmailTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteEmailTemplateInput"} + if s.TemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateName")) + } + if s.TemplateName != nil && len(*s.TemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) + } - // (Deprecated) An identifier for the APNs VoIP sandbox channel. This property - // is retained only for backward compatibility. - Id *string `type:"string"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // Specifies whether the APNs VoIP sandbox channel is archived. - IsArchived *bool `type:"boolean"` +// SetTemplateName sets the TemplateName field's value. +func (s *DeleteEmailTemplateInput) SetTemplateName(v string) *DeleteEmailTemplateInput { + s.TemplateName = &v + return s +} - // The user who last modified the APNs VoIP sandbox channel. - LastModifiedBy *string `type:"string"` +// SetVersion sets the Version field's value. +func (s *DeleteEmailTemplateInput) SetVersion(v string) *DeleteEmailTemplateInput { + s.Version = &v + return s +} - // The date and time when the APNs VoIP sandbox channel was last modified. - LastModifiedDate *string `type:"string"` +type DeleteEmailTemplateOutput struct { + _ struct{} `type:"structure" payload:"MessageBody"` - // The type of messaging or notification platform for the channel. For the APNs - // VoIP sandbox channel, this value is APNS_VOIP_SANDBOX. + // Provides information about an API request or response. // - // Platform is a required field - Platform *string `type:"string" required:"true"` - - // The current version of the APNs VoIP sandbox channel. - Version *int64 `type:"integer"` + // MessageBody is a required field + MessageBody *MessageBody `type:"structure" required:"true"` } // String returns the string representation -func (s APNSVoipSandboxChannelResponse) String() string { +func (s DeleteEmailTemplateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s APNSVoipSandboxChannelResponse) GoString() string { +func (s DeleteEmailTemplateOutput) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *APNSVoipSandboxChannelResponse) SetApplicationId(v string) *APNSVoipSandboxChannelResponse { - s.ApplicationId = &v +// SetMessageBody sets the MessageBody field's value. +func (s *DeleteEmailTemplateOutput) SetMessageBody(v *MessageBody) *DeleteEmailTemplateOutput { + s.MessageBody = v return s } -// SetCreationDate sets the CreationDate field's value. -func (s *APNSVoipSandboxChannelResponse) SetCreationDate(v string) *APNSVoipSandboxChannelResponse { - s.CreationDate = &v - return s -} +type DeleteEndpointInput struct { + _ struct{} `type:"structure"` -// SetDefaultAuthenticationMethod sets the DefaultAuthenticationMethod field's value. -func (s *APNSVoipSandboxChannelResponse) SetDefaultAuthenticationMethod(v string) *APNSVoipSandboxChannelResponse { - s.DefaultAuthenticationMethod = &v - return s + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + // EndpointId is a required field + EndpointId *string `location:"uri" locationName:"endpoint-id" type:"string" required:"true"` } -// SetEnabled sets the Enabled field's value. -func (s *APNSVoipSandboxChannelResponse) SetEnabled(v bool) *APNSVoipSandboxChannelResponse { - s.Enabled = &v - return s +// String returns the string representation +func (s DeleteEndpointInput) String() string { + return awsutil.Prettify(s) } -// SetHasCredential sets the HasCredential field's value. -func (s *APNSVoipSandboxChannelResponse) SetHasCredential(v bool) *APNSVoipSandboxChannelResponse { - s.HasCredential = &v - return s +// GoString returns the string representation +func (s DeleteEndpointInput) GoString() string { + return s.String() } -// SetHasTokenKey sets the HasTokenKey field's value. -func (s *APNSVoipSandboxChannelResponse) SetHasTokenKey(v bool) *APNSVoipSandboxChannelResponse { - s.HasTokenKey = &v - return s +// 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.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.EndpointId == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointId")) + } + if s.EndpointId != nil && len(*s.EndpointId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EndpointId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetId sets the Id field's value. -func (s *APNSVoipSandboxChannelResponse) SetId(v string) *APNSVoipSandboxChannelResponse { - s.Id = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *DeleteEndpointInput) SetApplicationId(v string) *DeleteEndpointInput { + s.ApplicationId = &v return s } -// SetIsArchived sets the IsArchived field's value. -func (s *APNSVoipSandboxChannelResponse) SetIsArchived(v bool) *APNSVoipSandboxChannelResponse { - s.IsArchived = &v +// SetEndpointId sets the EndpointId field's value. +func (s *DeleteEndpointInput) SetEndpointId(v string) *DeleteEndpointInput { + s.EndpointId = &v return s } -// SetLastModifiedBy sets the LastModifiedBy field's value. -func (s *APNSVoipSandboxChannelResponse) SetLastModifiedBy(v string) *APNSVoipSandboxChannelResponse { - s.LastModifiedBy = &v - return s +type DeleteEndpointOutput struct { + _ struct{} `type:"structure" payload:"EndpointResponse"` + + // Provides information about the channel type and other settings for an endpoint. + // + // EndpointResponse is a required field + EndpointResponse *EndpointResponse `type:"structure" required:"true"` } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *APNSVoipSandboxChannelResponse) SetLastModifiedDate(v string) *APNSVoipSandboxChannelResponse { - s.LastModifiedDate = &v - return s +// String returns the string representation +func (s DeleteEndpointOutput) String() string { + return awsutil.Prettify(s) } -// SetPlatform sets the Platform field's value. -func (s *APNSVoipSandboxChannelResponse) SetPlatform(v string) *APNSVoipSandboxChannelResponse { - s.Platform = &v - return s +// GoString returns the string representation +func (s DeleteEndpointOutput) GoString() string { + return s.String() } -// SetVersion sets the Version field's value. -func (s *APNSVoipSandboxChannelResponse) SetVersion(v int64) *APNSVoipSandboxChannelResponse { - s.Version = &v +// SetEndpointResponse sets the EndpointResponse field's value. +func (s *DeleteEndpointOutput) SetEndpointResponse(v *EndpointResponse) *DeleteEndpointOutput { + s.EndpointResponse = v return s } -// Provides information about the activities that were performed by a campaign. -type ActivitiesResponse struct { +type DeleteEventStreamInput struct { _ struct{} `type:"structure"` - // An array of responses, one for each activity that was performed by the campaign. - // - // Item is a required field - Item []*ActivityResponse `type:"list" required:"true"` - - // The string to use in a subsequent request to get the next page of results - // in a paginated response. This value is null if there are no additional pages. - NextToken *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } // String returns the string representation -func (s ActivitiesResponse) String() string { +func (s DeleteEventStreamInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ActivitiesResponse) GoString() string { +func (s DeleteEventStreamInput) GoString() string { return s.String() } -// SetItem sets the Item field's value. -func (s *ActivitiesResponse) SetItem(v []*ActivityResponse) *ActivitiesResponse { - s.Item = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteEventStreamInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteEventStreamInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetNextToken sets the NextToken field's value. -func (s *ActivitiesResponse) SetNextToken(v string) *ActivitiesResponse { - s.NextToken = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *DeleteEventStreamInput) SetApplicationId(v string) *DeleteEventStreamInput { + s.ApplicationId = &v return s } -// Provides information about an activity that was performed by a campaign. -type ActivityResponse struct { - _ struct{} `type:"structure"` +type DeleteEventStreamOutput struct { + _ struct{} `type:"structure" payload:"EventStream"` - // The unique identifier for the application that the campaign applies to. + // Specifies settings for publishing event data to an Amazon Kinesis data stream + // or an Amazon Kinesis Data Firehose delivery stream. // - // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` + // EventStream is a required field + EventStream *EventStream `type:"structure" required:"true"` +} - // The unique identifier for the campaign that the activity applies to. - // - // CampaignId is a required field - CampaignId *string `type:"string" required:"true"` +// String returns the string representation +func (s DeleteEventStreamOutput) String() string { + return awsutil.Prettify(s) +} - // The actual time, in ISO 8601 format, when the activity was marked CANCELLED - // or COMPLETED. - End *string `type:"string"` +// GoString returns the string representation +func (s DeleteEventStreamOutput) GoString() string { + return s.String() +} - // The unique identifier for the activity. - // - // Id is a required field - Id *string `type:"string" required:"true"` +// SetEventStream sets the EventStream field's value. +func (s *DeleteEventStreamOutput) SetEventStream(v *EventStream) *DeleteEventStreamOutput { + s.EventStream = v + return s +} - // Specifies whether the activity succeeded. Possible values are SUCCESS and - // FAIL. - Result *string `type:"string"` +type DeleteGcmChannelInput struct { + _ struct{} `type:"structure"` - // The scheduled start time, in ISO 8601 format, for the activity. - ScheduledStart *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +} - // The actual start time, in ISO 8601 format, of the activity. - Start *string `type:"string"` +// String returns the string representation +func (s DeleteGcmChannelInput) String() string { + return awsutil.Prettify(s) +} - // The state of the activity. Possible values are: PENDING, INITIALIZING, RUNNING, - // PAUSED, CANCELLED, and COMPLETED. - State *string `type:"string"` +// GoString returns the string representation +func (s DeleteGcmChannelInput) GoString() string { + return s.String() +} - // The total number of endpoints that the campaign successfully delivered messages - // to. - SuccessfulEndpointCount *int64 `type:"integer"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteGcmChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteGcmChannelInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } - // The total number of time zones that were completed. - TimezonesCompletedCount *int64 `type:"integer"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // The total number of unique time zones that are in the segment for the campaign. - TimezonesTotalCount *int64 `type:"integer"` +// SetApplicationId sets the ApplicationId field's value. +func (s *DeleteGcmChannelInput) SetApplicationId(v string) *DeleteGcmChannelInput { + s.ApplicationId = &v + return s +} - // The total number of endpoints that the campaign attempted to deliver messages - // to. - TotalEndpointCount *int64 `type:"integer"` +type DeleteGcmChannelOutput struct { + _ struct{} `type:"structure" payload:"GCMChannelResponse"` - // The unique identifier for the campaign treatment that the activity applies - // to. A treatment is a variation of a campaign that's used for A/B testing - // of a campaign. - TreatmentId *string `type:"string"` + // Provides information about the status and settings of the GCM channel for + // an application. The GCM channel enables Amazon Pinpoint to send push notifications + // through the Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging + // (GCM), service. + // + // GCMChannelResponse is a required field + GCMChannelResponse *GCMChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s ActivityResponse) String() string { +func (s DeleteGcmChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ActivityResponse) GoString() string { +func (s DeleteGcmChannelOutput) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *ActivityResponse) SetApplicationId(v string) *ActivityResponse { - s.ApplicationId = &v +// SetGCMChannelResponse sets the GCMChannelResponse field's value. +func (s *DeleteGcmChannelOutput) SetGCMChannelResponse(v *GCMChannelResponse) *DeleteGcmChannelOutput { + s.GCMChannelResponse = v return s } -// SetCampaignId sets the CampaignId field's value. -func (s *ActivityResponse) SetCampaignId(v string) *ActivityResponse { - s.CampaignId = &v - return s -} +type DeleteJourneyInput struct { + _ struct{} `type:"structure"` -// SetEnd sets the End field's value. -func (s *ActivityResponse) SetEnd(v string) *ActivityResponse { - s.End = &v - return s -} + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` -// SetId sets the Id field's value. -func (s *ActivityResponse) SetId(v string) *ActivityResponse { - s.Id = &v - return s + // JourneyId is a required field + JourneyId *string `location:"uri" locationName:"journey-id" type:"string" required:"true"` } -// SetResult sets the Result field's value. -func (s *ActivityResponse) SetResult(v string) *ActivityResponse { - s.Result = &v - return s +// String returns the string representation +func (s DeleteJourneyInput) String() string { + return awsutil.Prettify(s) } -// SetScheduledStart sets the ScheduledStart field's value. -func (s *ActivityResponse) SetScheduledStart(v string) *ActivityResponse { - s.ScheduledStart = &v - return s +// GoString returns the string representation +func (s DeleteJourneyInput) GoString() string { + return s.String() } -// SetStart sets the Start field's value. -func (s *ActivityResponse) SetStart(v string) *ActivityResponse { - s.Start = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteJourneyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteJourneyInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.JourneyId == nil { + invalidParams.Add(request.NewErrParamRequired("JourneyId")) + } + if s.JourneyId != nil && len(*s.JourneyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("JourneyId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetState sets the State field's value. -func (s *ActivityResponse) SetState(v string) *ActivityResponse { - s.State = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *DeleteJourneyInput) SetApplicationId(v string) *DeleteJourneyInput { + s.ApplicationId = &v return s } -// SetSuccessfulEndpointCount sets the SuccessfulEndpointCount field's value. -func (s *ActivityResponse) SetSuccessfulEndpointCount(v int64) *ActivityResponse { - s.SuccessfulEndpointCount = &v +// SetJourneyId sets the JourneyId field's value. +func (s *DeleteJourneyInput) SetJourneyId(v string) *DeleteJourneyInput { + s.JourneyId = &v return s } -// SetTimezonesCompletedCount sets the TimezonesCompletedCount field's value. -func (s *ActivityResponse) SetTimezonesCompletedCount(v int64) *ActivityResponse { - s.TimezonesCompletedCount = &v - return s +type DeleteJourneyOutput struct { + _ struct{} `type:"structure" payload:"JourneyResponse"` + + // Provides information about the status, configuration, and other settings + // for a journey. + // + // JourneyResponse is a required field + JourneyResponse *JourneyResponse `type:"structure" required:"true"` } -// SetTimezonesTotalCount sets the TimezonesTotalCount field's value. -func (s *ActivityResponse) SetTimezonesTotalCount(v int64) *ActivityResponse { - s.TimezonesTotalCount = &v - return s +// String returns the string representation +func (s DeleteJourneyOutput) String() string { + return awsutil.Prettify(s) } -// SetTotalEndpointCount sets the TotalEndpointCount field's value. -func (s *ActivityResponse) SetTotalEndpointCount(v int64) *ActivityResponse { - s.TotalEndpointCount = &v - return s +// GoString returns the string representation +func (s DeleteJourneyOutput) GoString() string { + return s.String() } -// SetTreatmentId sets the TreatmentId field's value. -func (s *ActivityResponse) SetTreatmentId(v string) *ActivityResponse { - s.TreatmentId = &v +// SetJourneyResponse sets the JourneyResponse field's value. +func (s *DeleteJourneyOutput) SetJourneyResponse(v *JourneyResponse) *DeleteJourneyOutput { + s.JourneyResponse = v return s } -// Specifies address-based configuration settings for a message that's sent -// directly to an endpoint. -type AddressConfiguration struct { +type DeletePushTemplateInput struct { _ struct{} `type:"structure"` - // The message body to use instead of the default message body. This value overrides - // the default message body. - BodyOverride *string `type:"string"` - - // The channel to use when sending the message. - ChannelType *string `type:"string" enum:"ChannelType"` - - // An object that maps custom attributes to attributes for the address and is - // attached to the message. For a push notification, this payload is added to - // the data.pinpoint object. For an email or text message, this payload is added - // to email/SMS delivery receipt event attributes. - Context map[string]*string `type:"map"` - - // The raw, JSON-formatted string to use as the payload for the notification - // message. This value overrides the message. - RawContent *string `type:"string"` - - // An object that maps variable values for the message. Amazon Pinpoint merges - // these values with the variable values specified by properties of the DefaultMessage - // object. The substitutions in this map take precedence over all other substitutions. - Substitutions map[string][]*string `type:"map"` + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` - // The message title to use instead of the default message title. This value - // overrides the default message title. - TitleOverride *string `type:"string"` + Version *string `location:"querystring" locationName:"version" type:"string"` } // String returns the string representation -func (s AddressConfiguration) String() string { +func (s DeletePushTemplateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AddressConfiguration) GoString() string { +func (s DeletePushTemplateInput) GoString() string { return s.String() } -// SetBodyOverride sets the BodyOverride field's value. -func (s *AddressConfiguration) SetBodyOverride(v string) *AddressConfiguration { - s.BodyOverride = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeletePushTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeletePushTemplateInput"} + 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 } -// SetChannelType sets the ChannelType field's value. -func (s *AddressConfiguration) SetChannelType(v string) *AddressConfiguration { - s.ChannelType = &v +// SetTemplateName sets the TemplateName field's value. +func (s *DeletePushTemplateInput) SetTemplateName(v string) *DeletePushTemplateInput { + s.TemplateName = &v return s } -// SetContext sets the Context field's value. -func (s *AddressConfiguration) SetContext(v map[string]*string) *AddressConfiguration { - s.Context = v +// SetVersion sets the Version field's value. +func (s *DeletePushTemplateInput) SetVersion(v string) *DeletePushTemplateInput { + s.Version = &v return s } -// SetRawContent sets the RawContent field's value. -func (s *AddressConfiguration) SetRawContent(v string) *AddressConfiguration { - s.RawContent = &v - return s +type DeletePushTemplateOutput struct { + _ struct{} `type:"structure" payload:"MessageBody"` + + // Provides information about an API request or response. + // + // MessageBody is a required field + MessageBody *MessageBody `type:"structure" required:"true"` } -// SetSubstitutions sets the Substitutions field's value. -func (s *AddressConfiguration) SetSubstitutions(v map[string][]*string) *AddressConfiguration { - s.Substitutions = v - return s +// String returns the string representation +func (s DeletePushTemplateOutput) String() string { + return awsutil.Prettify(s) } -// SetTitleOverride sets the TitleOverride field's value. -func (s *AddressConfiguration) SetTitleOverride(v string) *AddressConfiguration { - s.TitleOverride = &v +// GoString returns the string representation +func (s DeletePushTemplateOutput) GoString() string { + return s.String() +} + +// SetMessageBody sets the MessageBody field's value. +func (s *DeletePushTemplateOutput) SetMessageBody(v *MessageBody) *DeletePushTemplateOutput { + s.MessageBody = v return s } -// Provides the results of a query that retrieved the data for a standard metric -// that applies to an application, and provides information about that query. -type ApplicationDateRangeKpiResponse struct { +type DeleteSegmentInput struct { _ struct{} `type:"structure"` - // The unique identifier for the application that the metric applies to. - // // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` - - // EndTime is a required field - EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - - // The name of the metric, also referred to as a key performance indicator (KPI), - // that the data was retrieved for. This value describes the associated metric - // and consists of two or more terms, which are comprised of lowercase alphanumeric - // characters, separated by a hyphen. For a list of valid values, see the Amazon - // Pinpoint Developer Guide (developerguide.html). - // - // KpiName is a required field - KpiName *string `type:"string" required:"true"` - - // An array of objects that contains the results of the query. Each object contains - // the value for the metric and metadata about that value. - // - // KpiResult is a required field - KpiResult *BaseKpiResult `type:"structure" required:"true"` - - // The string to use in a subsequent request to get the next page of results - // in a paginated response. This value is null for the App Metrics resource. - // The App Metrics resource returns all results in a single page. - NextToken *string `type:"string"` + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // StartTime is a required field - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` + // SegmentId is a required field + SegmentId *string `location:"uri" locationName:"segment-id" type:"string" required:"true"` } // String returns the string representation -func (s ApplicationDateRangeKpiResponse) String() string { +func (s DeleteSegmentInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ApplicationDateRangeKpiResponse) GoString() string { +func (s DeleteSegmentInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteSegmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteSegmentInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.SegmentId == nil { + invalidParams.Add(request.NewErrParamRequired("SegmentId")) + } + if s.SegmentId != nil && len(*s.SegmentId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SegmentId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetApplicationId sets the ApplicationId field's value. -func (s *ApplicationDateRangeKpiResponse) SetApplicationId(v string) *ApplicationDateRangeKpiResponse { +func (s *DeleteSegmentInput) SetApplicationId(v string) *DeleteSegmentInput { s.ApplicationId = &v return s } -// SetEndTime sets the EndTime field's value. -func (s *ApplicationDateRangeKpiResponse) SetEndTime(v time.Time) *ApplicationDateRangeKpiResponse { - s.EndTime = &v +// SetSegmentId sets the SegmentId field's value. +func (s *DeleteSegmentInput) SetSegmentId(v string) *DeleteSegmentInput { + s.SegmentId = &v return s } -// SetKpiName sets the KpiName field's value. -func (s *ApplicationDateRangeKpiResponse) SetKpiName(v string) *ApplicationDateRangeKpiResponse { - s.KpiName = &v - return s +type DeleteSegmentOutput struct { + _ struct{} `type:"structure" payload:"SegmentResponse"` + + // Provides information about the configuration, dimension, and other settings + // for a segment. + // + // SegmentResponse is a required field + SegmentResponse *SegmentResponse `type:"structure" required:"true"` } -// SetKpiResult sets the KpiResult field's value. -func (s *ApplicationDateRangeKpiResponse) SetKpiResult(v *BaseKpiResult) *ApplicationDateRangeKpiResponse { - s.KpiResult = v - return s +// String returns the string representation +func (s DeleteSegmentOutput) String() string { + return awsutil.Prettify(s) } -// SetNextToken sets the NextToken field's value. -func (s *ApplicationDateRangeKpiResponse) SetNextToken(v string) *ApplicationDateRangeKpiResponse { - s.NextToken = &v - return s +// GoString returns the string representation +func (s DeleteSegmentOutput) GoString() string { + return s.String() } -// SetStartTime sets the StartTime field's value. -func (s *ApplicationDateRangeKpiResponse) SetStartTime(v time.Time) *ApplicationDateRangeKpiResponse { - s.StartTime = &v +// SetSegmentResponse sets the SegmentResponse field's value. +func (s *DeleteSegmentOutput) SetSegmentResponse(v *SegmentResponse) *DeleteSegmentOutput { + s.SegmentResponse = v return s } -// Provides information about an application. -type ApplicationResponse struct { +type DeleteSmsChannelInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the application. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The unique identifier for the application. This identifier is displayed as - // the Project ID on the Amazon Pinpoint console. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // The display name of the application. This name is displayed as the Project - // name on the Amazon Pinpoint console. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // A string-to-string map of key-value pairs that identifies the tags that are - // associated with the application. Each tag consists of a required tag key - // and an associated tag value. - Tags map[string]*string `locationName:"tags" type:"map"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } // String returns the string representation -func (s ApplicationResponse) String() string { +func (s DeleteSmsChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ApplicationResponse) GoString() string { +func (s DeleteSmsChannelInput) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *ApplicationResponse) SetArn(v string) *ApplicationResponse { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *ApplicationResponse) SetId(v string) *ApplicationResponse { - s.Id = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteSmsChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteSmsChannelInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } -// SetName sets the Name field's value. -func (s *ApplicationResponse) SetName(v string) *ApplicationResponse { - s.Name = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetTags sets the Tags field's value. -func (s *ApplicationResponse) SetTags(v map[string]*string) *ApplicationResponse { - s.Tags = v +// SetApplicationId sets the ApplicationId field's value. +func (s *DeleteSmsChannelInput) SetApplicationId(v string) *DeleteSmsChannelInput { + s.ApplicationId = &v return s } -// Provides information about an application, including the default settings -// for an application. -type ApplicationSettingsResource struct { - _ struct{} `type:"structure"` +type DeleteSmsChannelOutput struct { + _ struct{} `type:"structure" payload:"SMSChannelResponse"` - // The unique identifier for the application. This identifier is displayed as - // the Project ID on the Amazon Pinpoint console. + // Provides information about the status and settings of the SMS channel for + // an application. // - // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` - - // The settings for the AWS Lambda function to use by default as a code hook - // for campaigns in the application. - CampaignHook *CampaignHook `type:"structure"` - - // The date and time, in ISO 8601 format, when the application's settings were - // last modified. - LastModifiedDate *string `type:"string"` + // SMSChannelResponse is a required field + SMSChannelResponse *SMSChannelResponse `type:"structure" required:"true"` +} - // The default sending limits for campaigns in the application. - Limits *CampaignLimits `type:"structure"` +// String returns the string representation +func (s DeleteSmsChannelOutput) String() string { + return awsutil.Prettify(s) +} - // The default quiet time for campaigns in the application. Quiet time is a - // specific time range when campaigns don't send messages to endpoints, if all - // the following conditions are met: - // - // * The EndpointDemographic.Timezone property of the endpoint is set to - // a valid value. - // - // * The current time in the endpoint's time zone is later than or equal - // to the time specified by the QuietTime.Start property for the application - // (or a campaign that has custom quiet time settings). - // - // * The current time in the endpoint's time zone is earlier than or equal - // to the time specified by the QuietTime.End property for the application - // (or a campaign that has custom quiet time settings). - // - // If any of the preceding conditions isn't met, the endpoint will receive messages - // from a campaign, even if quiet time is enabled. - QuietTime *QuietTime `type:"structure"` +// GoString returns the string representation +func (s DeleteSmsChannelOutput) GoString() string { + return s.String() +} + +// SetSMSChannelResponse sets the SMSChannelResponse field's value. +func (s *DeleteSmsChannelOutput) SetSMSChannelResponse(v *SMSChannelResponse) *DeleteSmsChannelOutput { + s.SMSChannelResponse = v + return s +} + +type DeleteSmsTemplateInput struct { + _ struct{} `type:"structure"` + + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` + + Version *string `location:"querystring" locationName:"version" type:"string"` } // String returns the string representation -func (s ApplicationSettingsResource) String() string { +func (s DeleteSmsTemplateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ApplicationSettingsResource) GoString() string { +func (s DeleteSmsTemplateInput) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *ApplicationSettingsResource) SetApplicationId(v string) *ApplicationSettingsResource { - s.ApplicationId = &v - return s -} - -// SetCampaignHook sets the CampaignHook field's value. -func (s *ApplicationSettingsResource) SetCampaignHook(v *CampaignHook) *ApplicationSettingsResource { - s.CampaignHook = v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteSmsTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteSmsTemplateInput"} + if s.TemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateName")) + } + if s.TemplateName != nil && len(*s.TemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) + } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *ApplicationSettingsResource) SetLastModifiedDate(v string) *ApplicationSettingsResource { - s.LastModifiedDate = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetLimits sets the Limits field's value. -func (s *ApplicationSettingsResource) SetLimits(v *CampaignLimits) *ApplicationSettingsResource { - s.Limits = v +// SetTemplateName sets the TemplateName field's value. +func (s *DeleteSmsTemplateInput) SetTemplateName(v string) *DeleteSmsTemplateInput { + s.TemplateName = &v return s } -// SetQuietTime sets the QuietTime field's value. -func (s *ApplicationSettingsResource) SetQuietTime(v *QuietTime) *ApplicationSettingsResource { - s.QuietTime = v +// SetVersion sets the Version field's value. +func (s *DeleteSmsTemplateInput) SetVersion(v string) *DeleteSmsTemplateInput { + s.Version = &v return s } -// Provides information about all of your applications. -type ApplicationsResponse struct { - _ struct{} `type:"structure"` - - // An array of responses, one for each application that was returned. - Item []*ApplicationResponse `type:"list"` +type DeleteSmsTemplateOutput struct { + _ struct{} `type:"structure" payload:"MessageBody"` - // The string to use in a subsequent request to get the next page of results - // in a paginated response. This value is null if there are no additional pages. - NextToken *string `type:"string"` + // Provides information about an API request or response. + // + // MessageBody is a required field + MessageBody *MessageBody `type:"structure" required:"true"` } // String returns the string representation -func (s ApplicationsResponse) String() string { +func (s DeleteSmsTemplateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ApplicationsResponse) GoString() string { +func (s DeleteSmsTemplateOutput) GoString() string { return s.String() } -// SetItem sets the Item field's value. -func (s *ApplicationsResponse) SetItem(v []*ApplicationResponse) *ApplicationsResponse { - s.Item = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ApplicationsResponse) SetNextToken(v string) *ApplicationsResponse { - s.NextToken = &v +// SetMessageBody sets the MessageBody field's value. +func (s *DeleteSmsTemplateOutput) SetMessageBody(v *MessageBody) *DeleteSmsTemplateOutput { + s.MessageBody = v return s } -// Specifies attribute-based criteria for including or excluding endpoints from -// a segment. -type AttributeDimension struct { +type DeleteUserEndpointsInput struct { _ struct{} `type:"structure"` - // The type of segment dimension to use. Valid values are: INCLUSIVE, endpoints - // that match the criteria are included in the segment; and, EXCLUSIVE, endpoints - // that match the criteria are excluded from the segment. - AttributeType *string `type:"string" enum:"AttributeType"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The criteria values to use for the segment dimension. Depending on the value - // of the AttributeType property, endpoints are included or excluded from the - // segment if their attribute values match the criteria values. - // - // Values is a required field - Values []*string `type:"list" required:"true"` + // UserId is a required field + UserId *string `location:"uri" locationName:"user-id" type:"string" required:"true"` } // String returns the string representation -func (s AttributeDimension) String() string { +func (s DeleteUserEndpointsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AttributeDimension) GoString() string { +func (s DeleteUserEndpointsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *AttributeDimension) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttributeDimension"} - if s.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) +func (s *DeleteUserEndpointsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteUserEndpointsInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.UserId == nil { + invalidParams.Add(request.NewErrParamRequired("UserId")) + } + if s.UserId != nil && len(*s.UserId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) } if invalidParams.Len() > 0 { @@ -9489,113 +16382,136 @@ func (s *AttributeDimension) Validate() error { return nil } -// SetAttributeType sets the AttributeType field's value. -func (s *AttributeDimension) SetAttributeType(v string) *AttributeDimension { - s.AttributeType = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *DeleteUserEndpointsInput) SetApplicationId(v string) *DeleteUserEndpointsInput { + s.ApplicationId = &v return s } -// SetValues sets the Values field's value. -func (s *AttributeDimension) SetValues(v []*string) *AttributeDimension { - s.Values = v +// SetUserId sets the UserId field's value. +func (s *DeleteUserEndpointsInput) SetUserId(v string) *DeleteUserEndpointsInput { + s.UserId = &v return s } -// Provides information about the type and the names of attributes that were -// removed from all the endpoints that are associated with an application. -type AttributesResource struct { - _ struct{} `type:"structure"` +type DeleteUserEndpointsOutput struct { + _ struct{} `type:"structure" payload:"EndpointsResponse"` - // The unique identifier for the application. + // Provides information about all the endpoints that are associated with a user + // ID. // - // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` + // EndpointsResponse is a required field + EndpointsResponse *EndpointsResponse `type:"structure" required:"true"` +} - // The type of attribute or attributes that were removed from the endpoints. - // Valid values are: - // - // * endpoint-custom-attributes - Custom attributes that describe endpoints - // - // * endpoint-custom-metrics - Custom metrics that your app reports to Amazon - // Pinpoint for endpoints - // - // * endpoint-user-attributes - Custom attributes that describe users - // - // AttributeType is a required field - AttributeType *string `type:"string" required:"true"` +// String returns the string representation +func (s DeleteUserEndpointsOutput) String() string { + return awsutil.Prettify(s) +} - // An array that specifies the names of the attributes that were removed from - // the endpoints. - Attributes []*string `type:"list"` +// GoString returns the string representation +func (s DeleteUserEndpointsOutput) GoString() string { + return s.String() +} + +// SetEndpointsResponse sets the EndpointsResponse field's value. +func (s *DeleteUserEndpointsOutput) SetEndpointsResponse(v *EndpointsResponse) *DeleteUserEndpointsOutput { + s.EndpointsResponse = v + return s +} + +type DeleteVoiceChannelInput struct { + _ struct{} `type:"structure"` + + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } // String returns the string representation -func (s AttributesResource) String() string { +func (s DeleteVoiceChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AttributesResource) GoString() string { +func (s DeleteVoiceChannelInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteVoiceChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteVoiceChannelInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetApplicationId sets the ApplicationId field's value. -func (s *AttributesResource) SetApplicationId(v string) *AttributesResource { +func (s *DeleteVoiceChannelInput) SetApplicationId(v string) *DeleteVoiceChannelInput { s.ApplicationId = &v return s } -// SetAttributeType sets the AttributeType field's value. -func (s *AttributesResource) SetAttributeType(v string) *AttributesResource { - s.AttributeType = &v - return s +type DeleteVoiceChannelOutput struct { + _ struct{} `type:"structure" payload:"VoiceChannelResponse"` + + // Provides information about the status and settings of the voice channel for + // an application. + // + // VoiceChannelResponse is a required field + VoiceChannelResponse *VoiceChannelResponse `type:"structure" required:"true"` } -// SetAttributes sets the Attributes field's value. -func (s *AttributesResource) SetAttributes(v []*string) *AttributesResource { - s.Attributes = v +// String returns the string representation +func (s DeleteVoiceChannelOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVoiceChannelOutput) GoString() string { + return s.String() +} + +// SetVoiceChannelResponse sets the VoiceChannelResponse field's value. +func (s *DeleteVoiceChannelOutput) SetVoiceChannelResponse(v *VoiceChannelResponse) *DeleteVoiceChannelOutput { + s.VoiceChannelResponse = v return s } -// Specifies the status and settings of the Baidu (Baidu Cloud Push) channel -// for an application. -type BaiduChannelRequest struct { +type DeleteVoiceTemplateInput struct { _ struct{} `type:"structure"` - // The API key that you received from the Baidu Cloud Push service to communicate - // with the service. - // - // ApiKey is a required field - ApiKey *string `type:"string" required:"true"` - - // Specifies whether to enable the Baidu channel for the application. - Enabled *bool `type:"boolean"` + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` - // The secret key that you received from the Baidu Cloud Push service to communicate - // with the service. - // - // SecretKey is a required field - SecretKey *string `type:"string" required:"true"` + Version *string `location:"querystring" locationName:"version" type:"string"` } // String returns the string representation -func (s BaiduChannelRequest) String() string { +func (s DeleteVoiceTemplateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BaiduChannelRequest) GoString() string { +func (s DeleteVoiceTemplateInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *BaiduChannelRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BaiduChannelRequest"} - if s.ApiKey == nil { - invalidParams.Add(request.NewErrParamRequired("ApiKey")) +func (s *DeleteVoiceTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteVoiceTemplateInput"} + if s.TemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateName")) } - if s.SecretKey == nil { - invalidParams.Add(request.NewErrParamRequired("SecretKey")) + if s.TemplateName != nil && len(*s.TemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) } if invalidParams.Len() > 0 { @@ -9604,1468 +16520,1777 @@ func (s *BaiduChannelRequest) Validate() error { return nil } -// SetApiKey sets the ApiKey field's value. -func (s *BaiduChannelRequest) SetApiKey(v string) *BaiduChannelRequest { - s.ApiKey = &v +// SetTemplateName sets the TemplateName field's value. +func (s *DeleteVoiceTemplateInput) SetTemplateName(v string) *DeleteVoiceTemplateInput { + s.TemplateName = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *DeleteVoiceTemplateInput) SetVersion(v string) *DeleteVoiceTemplateInput { + s.Version = &v return s } -// SetEnabled sets the Enabled field's value. -func (s *BaiduChannelRequest) SetEnabled(v bool) *BaiduChannelRequest { - s.Enabled = &v - return s +type DeleteVoiceTemplateOutput struct { + _ struct{} `type:"structure" payload:"MessageBody"` + + // Provides information about an API request or response. + // + // MessageBody is a required field + MessageBody *MessageBody `type:"structure" required:"true"` +} + +// String returns the string representation +func (s DeleteVoiceTemplateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteVoiceTemplateOutput) GoString() string { + return s.String() } -// SetSecretKey sets the SecretKey field's value. -func (s *BaiduChannelRequest) SetSecretKey(v string) *BaiduChannelRequest { - s.SecretKey = &v +// SetMessageBody sets the MessageBody field's value. +func (s *DeleteVoiceTemplateOutput) SetMessageBody(v *MessageBody) *DeleteVoiceTemplateOutput { + s.MessageBody = v return s } -// Provides information about the status and settings of the Baidu (Baidu Cloud -// Push) channel for an application. -type BaiduChannelResponse struct { +// Specifies the settings and content for the default message and any default +// messages that you tailored for specific channels. +type DirectMessageConfiguration struct { _ struct{} `type:"structure"` - // The unique identifier for the application that the Baidu channel applies - // to. - ApplicationId *string `type:"string"` - - // The date and time when the Baidu channel was enabled. - CreationDate *string `type:"string"` - - // The API key that you received from the Baidu Cloud Push service to communicate - // with the service. - // - // Credential is a required field - Credential *string `type:"string" required:"true"` + // The default push notification message for the ADM (Amazon Device Messaging) + // channel. This message overrides the default push notification message (DefaultPushNotificationMessage). + ADMMessage *ADMMessage `type:"structure"` - // Specifies whether the Baidu channel is enabled for the application. - Enabled *bool `type:"boolean"` + // The default push notification message for the APNs (Apple Push Notification + // service) channel. This message overrides the default push notification message + // (DefaultPushNotificationMessage). + APNSMessage *APNSMessage `type:"structure"` - // (Not used) This property is retained only for backward compatibility. - HasCredential *bool `type:"boolean"` + // The default push notification message for the Baidu (Baidu Cloud Push) channel. + // This message overrides the default push notification message (DefaultPushNotificationMessage). + BaiduMessage *BaiduMessage `type:"structure"` - // (Deprecated) An identifier for the Baidu channel. This property is retained - // only for backward compatibility. - Id *string `type:"string"` + // The default message for all channels. + DefaultMessage *DefaultMessage `type:"structure"` - // Specifies whether the Baidu channel is archived. - IsArchived *bool `type:"boolean"` + // The default push notification message for all push notification channels. + DefaultPushNotificationMessage *DefaultPushNotificationMessage `type:"structure"` - // The user who last modified the Baidu channel. - LastModifiedBy *string `type:"string"` + // The default message for the email channel. This message overrides the default + // message (DefaultMessage). + EmailMessage *EmailMessage `type:"structure"` - // The date and time when the Baidu channel was last modified. - LastModifiedDate *string `type:"string"` + // The default push notification message for the GCM channel, which is used + // to send notifications through the Firebase Cloud Messaging (FCM), formerly + // Google Cloud Messaging (GCM), service. This message overrides the default + // push notification message (DefaultPushNotificationMessage). + GCMMessage *GCMMessage `type:"structure"` - // The type of messaging or notification platform for the channel. For the Baidu - // channel, this value is BAIDU. - // - // Platform is a required field - Platform *string `type:"string" required:"true"` + // The default message for the SMS channel. This message overrides the default + // message (DefaultMessage). + SMSMessage *SMSMessage `type:"structure"` - // The current version of the Baidu channel. - Version *int64 `type:"integer"` + // The default message for the voice channel. This message overrides the default + // message (DefaultMessage). + VoiceMessage *VoiceMessage `type:"structure"` } // String returns the string representation -func (s BaiduChannelResponse) String() string { +func (s DirectMessageConfiguration) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BaiduChannelResponse) GoString() string { +func (s DirectMessageConfiguration) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *BaiduChannelResponse) SetApplicationId(v string) *BaiduChannelResponse { - s.ApplicationId = &v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *BaiduChannelResponse) SetCreationDate(v string) *BaiduChannelResponse { - s.CreationDate = &v - return s -} - -// SetCredential sets the Credential field's value. -func (s *BaiduChannelResponse) SetCredential(v string) *BaiduChannelResponse { - s.Credential = &v +// SetADMMessage sets the ADMMessage field's value. +func (s *DirectMessageConfiguration) SetADMMessage(v *ADMMessage) *DirectMessageConfiguration { + s.ADMMessage = v return s } -// SetEnabled sets the Enabled field's value. -func (s *BaiduChannelResponse) SetEnabled(v bool) *BaiduChannelResponse { - s.Enabled = &v +// SetAPNSMessage sets the APNSMessage field's value. +func (s *DirectMessageConfiguration) SetAPNSMessage(v *APNSMessage) *DirectMessageConfiguration { + s.APNSMessage = v return s } -// SetHasCredential sets the HasCredential field's value. -func (s *BaiduChannelResponse) SetHasCredential(v bool) *BaiduChannelResponse { - s.HasCredential = &v +// SetBaiduMessage sets the BaiduMessage field's value. +func (s *DirectMessageConfiguration) SetBaiduMessage(v *BaiduMessage) *DirectMessageConfiguration { + s.BaiduMessage = v return s } -// SetId sets the Id field's value. -func (s *BaiduChannelResponse) SetId(v string) *BaiduChannelResponse { - s.Id = &v +// SetDefaultMessage sets the DefaultMessage field's value. +func (s *DirectMessageConfiguration) SetDefaultMessage(v *DefaultMessage) *DirectMessageConfiguration { + s.DefaultMessage = v return s } -// SetIsArchived sets the IsArchived field's value. -func (s *BaiduChannelResponse) SetIsArchived(v bool) *BaiduChannelResponse { - s.IsArchived = &v +// SetDefaultPushNotificationMessage sets the DefaultPushNotificationMessage field's value. +func (s *DirectMessageConfiguration) SetDefaultPushNotificationMessage(v *DefaultPushNotificationMessage) *DirectMessageConfiguration { + s.DefaultPushNotificationMessage = v return s } -// SetLastModifiedBy sets the LastModifiedBy field's value. -func (s *BaiduChannelResponse) SetLastModifiedBy(v string) *BaiduChannelResponse { - s.LastModifiedBy = &v +// SetEmailMessage sets the EmailMessage field's value. +func (s *DirectMessageConfiguration) SetEmailMessage(v *EmailMessage) *DirectMessageConfiguration { + s.EmailMessage = v return s } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *BaiduChannelResponse) SetLastModifiedDate(v string) *BaiduChannelResponse { - s.LastModifiedDate = &v +// SetGCMMessage sets the GCMMessage field's value. +func (s *DirectMessageConfiguration) SetGCMMessage(v *GCMMessage) *DirectMessageConfiguration { + s.GCMMessage = v return s } -// SetPlatform sets the Platform field's value. -func (s *BaiduChannelResponse) SetPlatform(v string) *BaiduChannelResponse { - s.Platform = &v +// SetSMSMessage sets the SMSMessage field's value. +func (s *DirectMessageConfiguration) SetSMSMessage(v *SMSMessage) *DirectMessageConfiguration { + s.SMSMessage = v return s } -// SetVersion sets the Version field's value. -func (s *BaiduChannelResponse) SetVersion(v int64) *BaiduChannelResponse { - s.Version = &v +// SetVoiceMessage sets the VoiceMessage field's value. +func (s *DirectMessageConfiguration) SetVoiceMessage(v *VoiceMessage) *DirectMessageConfiguration { + s.VoiceMessage = v return s } -// Specifies the settings for a one-time message that's sent directly to an -// endpoint through the Baidu (Baidu Cloud Push) channel. -type BaiduMessage struct { +// Specifies the status and settings of the email channel for an application. +type EmailChannelRequest struct { _ struct{} `type:"structure"` - // The action to occur if the recipient taps the push notification. Valid values - // are: - // - // * OPEN_APP - Your app opens or it becomes the foreground app if it was - // sent to the background. This is the default action. - // - // * DEEP_LINK - Your app opens and displays a designated user interface - // in the app. This action uses the deep-linking features of the Android - // platform. - // - // * URL - The default mobile browser on the recipient's device opens and - // loads the web page at a URL that you specify. - Action *string `type:"string" enum:"Action"` - - // The body of the notification message. - Body *string `type:"string"` - - // The JSON data payload to use for the push notification, if the notification - // is a silent push notification. This payload is added to the data.pinpoint.jsonBody - // object of the notification. - Data map[string]*string `type:"map"` - - // The icon image name of the asset saved in your app. - IconReference *string `type:"string"` - - // The URL of the large icon image to display in the content view of the push - // notification. - ImageIconUrl *string `type:"string"` - - // The URL of an image to display in the push notification. - ImageUrl *string `type:"string"` - - // The raw, JSON-formatted string to use as the payload for the notification - // message. This value overrides the message. - RawContent *string `type:"string"` - - // Specifies whether the notification is a silent push notification, which is - // a push notification that doesn't display on a recipient's device. Silent - // push notifications can be used for cases such as updating an app's configuration - // or supporting phone home functionality. - SilentPush *bool `type:"boolean"` - - // The URL of the small icon image to display in the status bar and the content - // view of the push notification. - SmallImageIconUrl *string `type:"string"` - - // The sound to play when the recipient receives the push notification. You - // can use the default stream or specify the file name of a sound resource that's - // bundled in your app. On an Android platform, the sound file must reside in - // /res/raw/. - Sound *string `type:"string"` + // The configuration set that you want to apply to email that you send through + // the channel by using the Amazon Pinpoint Email API (emailAPIreference.html). + ConfigurationSet *string `type:"string"` - // The default message variables to use in the notification message. You can - // override the default variables with individual address variables. - Substitutions map[string][]*string `type:"map"` + // Specifies whether to enable the email channel for the application. + Enabled *bool `type:"boolean"` - // The amount of time, in seconds, that the Baidu Cloud Push service should - // store the message if the recipient's device is offline. The default value - // and maximum supported time is 604,800 seconds (7 days). - TimeToLive *int64 `type:"integer"` + // The verified email address that you want to send email from when you send + // email through the channel. + // + // FromAddress is a required field + FromAddress *string `type:"string" required:"true"` - // The title to display above the notification message on the recipient's device. - Title *string `type:"string"` + // The Amazon Resource Name (ARN) of the identity, verified with Amazon Simple + // Email Service (Amazon SES), that you want to use when you send email through + // the channel. + // + // Identity is a required field + Identity *string `type:"string" required:"true"` - // The URL to open in the recipient's default mobile browser, if a recipient - // taps the push notification and the value of the Action property is URL. - Url *string `type:"string"` + // The ARN of the AWS Identity and Access Management (IAM) role that you want + // Amazon Pinpoint to use when it submits email-related event data for the channel. + RoleArn *string `type:"string"` } // String returns the string representation -func (s BaiduMessage) String() string { +func (s EmailChannelRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BaiduMessage) GoString() string { +func (s EmailChannelRequest) GoString() string { return s.String() } -// SetAction sets the Action field's value. -func (s *BaiduMessage) SetAction(v string) *BaiduMessage { - s.Action = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *EmailChannelRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EmailChannelRequest"} + if s.FromAddress == nil { + invalidParams.Add(request.NewErrParamRequired("FromAddress")) + } + if s.Identity == nil { + invalidParams.Add(request.NewErrParamRequired("Identity")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetBody sets the Body field's value. -func (s *BaiduMessage) SetBody(v string) *BaiduMessage { - s.Body = &v +// SetConfigurationSet sets the ConfigurationSet field's value. +func (s *EmailChannelRequest) SetConfigurationSet(v string) *EmailChannelRequest { + s.ConfigurationSet = &v return s } -// SetData sets the Data field's value. -func (s *BaiduMessage) SetData(v map[string]*string) *BaiduMessage { - s.Data = v +// SetEnabled sets the Enabled field's value. +func (s *EmailChannelRequest) SetEnabled(v bool) *EmailChannelRequest { + s.Enabled = &v return s } -// SetIconReference sets the IconReference field's value. -func (s *BaiduMessage) SetIconReference(v string) *BaiduMessage { - s.IconReference = &v +// SetFromAddress sets the FromAddress field's value. +func (s *EmailChannelRequest) SetFromAddress(v string) *EmailChannelRequest { + s.FromAddress = &v return s } -// SetImageIconUrl sets the ImageIconUrl field's value. -func (s *BaiduMessage) SetImageIconUrl(v string) *BaiduMessage { - s.ImageIconUrl = &v +// SetIdentity sets the Identity field's value. +func (s *EmailChannelRequest) SetIdentity(v string) *EmailChannelRequest { + s.Identity = &v return s } -// SetImageUrl sets the ImageUrl field's value. -func (s *BaiduMessage) SetImageUrl(v string) *BaiduMessage { - s.ImageUrl = &v +// SetRoleArn sets the RoleArn field's value. +func (s *EmailChannelRequest) SetRoleArn(v string) *EmailChannelRequest { + s.RoleArn = &v return s } -// SetRawContent sets the RawContent field's value. -func (s *BaiduMessage) SetRawContent(v string) *BaiduMessage { - s.RawContent = &v - return s -} +// Provides information about the status and settings of the email channel for +// an application. +type EmailChannelResponse struct { + _ struct{} `type:"structure"` -// SetSilentPush sets the SilentPush field's value. -func (s *BaiduMessage) SetSilentPush(v bool) *BaiduMessage { - s.SilentPush = &v - return s -} + // The unique identifier for the application that the email channel applies + // to. + ApplicationId *string `type:"string"` -// SetSmallImageIconUrl sets the SmallImageIconUrl field's value. -func (s *BaiduMessage) SetSmallImageIconUrl(v string) *BaiduMessage { - s.SmallImageIconUrl = &v - return s -} + // The configuration set that's applied to email that's sent through the channel + // by using the Amazon Pinpoint Email API (emailAPIreference.html). + ConfigurationSet *string `type:"string"` -// SetSound sets the Sound field's value. -func (s *BaiduMessage) SetSound(v string) *BaiduMessage { - s.Sound = &v - return s -} + // The date and time, in ISO 8601 format, when the email channel was enabled. + CreationDate *string `type:"string"` -// SetSubstitutions sets the Substitutions field's value. -func (s *BaiduMessage) SetSubstitutions(v map[string][]*string) *BaiduMessage { - s.Substitutions = v - return s -} + // Specifies whether the email channel is enabled for the application. + Enabled *bool `type:"boolean"` -// SetTimeToLive sets the TimeToLive field's value. -func (s *BaiduMessage) SetTimeToLive(v int64) *BaiduMessage { - s.TimeToLive = &v - return s -} + // The verified email address that you send email from when you send email through + // the channel. + FromAddress *string `type:"string"` -// SetTitle sets the Title field's value. -func (s *BaiduMessage) SetTitle(v string) *BaiduMessage { - s.Title = &v - return s -} + // (Not used) This property is retained only for backward compatibility. + HasCredential *bool `type:"boolean"` -// SetUrl sets the Url field's value. -func (s *BaiduMessage) SetUrl(v string) *BaiduMessage { - s.Url = &v - return s -} + // (Deprecated) An identifier for the email channel. This property is retained + // only for backward compatibility. + Id *string `type:"string"` -// Provides the results of a query that retrieved the data for a standard metric -// that applies to an application or campaign. -type BaseKpiResult struct { - _ struct{} `type:"structure"` + // The Amazon Resource Name (ARN) of the identity, verified with Amazon Simple + // Email Service (Amazon SES), that you use when you send email through the + // channel. + Identity *string `type:"string"` - // An array of objects that provides the results of a query that retrieved the - // data for a standard metric that applies to an application or campaign. + // Specifies whether the email channel is archived. + IsArchived *bool `type:"boolean"` + + // The user who last modified the email channel. + LastModifiedBy *string `type:"string"` + + // The date and time, in ISO 8601 format, when the email channel was last modified. + LastModifiedDate *string `type:"string"` + + // The maximum number of emails that you can send through the channel each second. + MessagesPerSecond *int64 `type:"integer"` + + // The type of messaging or notification platform for the channel. For the email + // channel, this value is EMAIL. // - // Rows is a required field - Rows []*ResultRow `type:"list" required:"true"` + // Platform is a required field + Platform *string `type:"string" required:"true"` + + // The ARN of the AWS Identity and Access Management (IAM) role that Amazon + // Pinpoint uses to submit email-related event data for the channel. + RoleArn *string `type:"string"` + + // The current version of the email channel. + Version *int64 `type:"integer"` } // String returns the string representation -func (s BaseKpiResult) String() string { +func (s EmailChannelResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s BaseKpiResult) GoString() string { +func (s EmailChannelResponse) GoString() string { return s.String() } -// SetRows sets the Rows field's value. -func (s *BaseKpiResult) SetRows(v []*ResultRow) *BaseKpiResult { - s.Rows = v +// SetApplicationId sets the ApplicationId field's value. +func (s *EmailChannelResponse) SetApplicationId(v string) *EmailChannelResponse { + s.ApplicationId = &v return s } -// Provides the results of a query that retrieved the data for a standard metric -// that applies to a campaign, and provides information about that query. -type CampaignDateRangeKpiResponse struct { - _ struct{} `type:"structure"` - - // The unique identifier for the application that the metric applies to. - // - // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` - - // The unique identifier for the campaign that the metric applies to. - // - // CampaignId is a required field - CampaignId *string `type:"string" required:"true"` - - // EndTime is a required field - EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` +// SetConfigurationSet sets the ConfigurationSet field's value. +func (s *EmailChannelResponse) SetConfigurationSet(v string) *EmailChannelResponse { + s.ConfigurationSet = &v + return s +} - // The name of the metric, also referred to as a key performance indicator (KPI), - // that the data was retrieved for. This value describes the associated metric - // and consists of two or more terms, which are comprised of lowercase alphanumeric - // characters, separated by a hyphen. For a list of valid values, see the Amazon - // Pinpoint Developer Guide (developerguide.html). - // - // KpiName is a required field - KpiName *string `type:"string" required:"true"` +// SetCreationDate sets the CreationDate field's value. +func (s *EmailChannelResponse) SetCreationDate(v string) *EmailChannelResponse { + s.CreationDate = &v + return s +} - // An array of objects that contains the results of the query. Each object contains - // the value for the metric and metadata about that value. - // - // KpiResult is a required field - KpiResult *BaseKpiResult `type:"structure" required:"true"` +// SetEnabled sets the Enabled field's value. +func (s *EmailChannelResponse) SetEnabled(v bool) *EmailChannelResponse { + s.Enabled = &v + return s +} - // The string to use in a subsequent request to get the next page of results - // in a paginated response. This value is null for the Campaign Metrics resource. - // The Campaign Metrics resource returns all results in a single page. - NextToken *string `type:"string"` +// SetFromAddress sets the FromAddress field's value. +func (s *EmailChannelResponse) SetFromAddress(v string) *EmailChannelResponse { + s.FromAddress = &v + return s +} - // StartTime is a required field - StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` +// SetHasCredential sets the HasCredential field's value. +func (s *EmailChannelResponse) SetHasCredential(v bool) *EmailChannelResponse { + s.HasCredential = &v + return s } -// String returns the string representation -func (s CampaignDateRangeKpiResponse) String() string { - return awsutil.Prettify(s) +// SetId sets the Id field's value. +func (s *EmailChannelResponse) SetId(v string) *EmailChannelResponse { + s.Id = &v + return s } -// GoString returns the string representation -func (s CampaignDateRangeKpiResponse) GoString() string { - return s.String() +// SetIdentity sets the Identity field's value. +func (s *EmailChannelResponse) SetIdentity(v string) *EmailChannelResponse { + s.Identity = &v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *CampaignDateRangeKpiResponse) SetApplicationId(v string) *CampaignDateRangeKpiResponse { - s.ApplicationId = &v +// SetIsArchived sets the IsArchived field's value. +func (s *EmailChannelResponse) SetIsArchived(v bool) *EmailChannelResponse { + s.IsArchived = &v return s } -// SetCampaignId sets the CampaignId field's value. -func (s *CampaignDateRangeKpiResponse) SetCampaignId(v string) *CampaignDateRangeKpiResponse { - s.CampaignId = &v +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *EmailChannelResponse) SetLastModifiedBy(v string) *EmailChannelResponse { + s.LastModifiedBy = &v return s } -// SetEndTime sets the EndTime field's value. -func (s *CampaignDateRangeKpiResponse) SetEndTime(v time.Time) *CampaignDateRangeKpiResponse { - s.EndTime = &v +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *EmailChannelResponse) SetLastModifiedDate(v string) *EmailChannelResponse { + s.LastModifiedDate = &v return s } -// SetKpiName sets the KpiName field's value. -func (s *CampaignDateRangeKpiResponse) SetKpiName(v string) *CampaignDateRangeKpiResponse { - s.KpiName = &v +// SetMessagesPerSecond sets the MessagesPerSecond field's value. +func (s *EmailChannelResponse) SetMessagesPerSecond(v int64) *EmailChannelResponse { + s.MessagesPerSecond = &v return s } -// SetKpiResult sets the KpiResult field's value. -func (s *CampaignDateRangeKpiResponse) SetKpiResult(v *BaseKpiResult) *CampaignDateRangeKpiResponse { - s.KpiResult = v +// SetPlatform sets the Platform field's value. +func (s *EmailChannelResponse) SetPlatform(v string) *EmailChannelResponse { + s.Platform = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *CampaignDateRangeKpiResponse) SetNextToken(v string) *CampaignDateRangeKpiResponse { - s.NextToken = &v +// SetRoleArn sets the RoleArn field's value. +func (s *EmailChannelResponse) SetRoleArn(v string) *EmailChannelResponse { + s.RoleArn = &v return s } -// SetStartTime sets the StartTime field's value. -func (s *CampaignDateRangeKpiResponse) SetStartTime(v time.Time) *CampaignDateRangeKpiResponse { - s.StartTime = &v +// SetVersion sets the Version field's value. +func (s *EmailChannelResponse) SetVersion(v int64) *EmailChannelResponse { + s.Version = &v return s } -// Specifies the content and "From" address for an email message that's sent -// to recipients of a campaign. -type CampaignEmailMessage struct { +// Specifies the default settings and content for a one-time email message that's +// sent directly to an endpoint. +type EmailMessage struct { _ struct{} `type:"structure"` - // The body of the email for recipients whose email clients don't support HTML - // content. + // The body of the email message. Body *string `type:"string"` - // The verified email address to send the email from. The default address is - // the FromAddress specified for the email channel for the application. + // The email address to forward bounces and complaints to, if feedback forwarding + // is enabled. + FeedbackForwardingAddress *string `type:"string"` + + // The verified email address to send the email message from. The default value + // is the FromAddress specified for the email channel. FromAddress *string `type:"string"` - // The body of the email, in HTML format, for recipients whose email clients - // support HTML content. - HtmlBody *string `type:"string"` + // The email message, represented as a raw MIME message. + RawEmail *RawEmail `type:"structure"` - // The subject line, or title, of the email. - // - // Title is a required field - Title *string `type:"string" required:"true"` + // The reply-to email address(es) for the email message. If a recipient replies + // to the email, each reply-to address receives the reply. + ReplyToAddresses []*string `type:"list"` + + // The email message, composed of a subject, a text part, and an HTML part. + SimpleEmail *SimpleEmail `type:"structure"` + + // The default message variables to use in the email message. You can override + // the default variables with individual address variables. + Substitutions map[string][]*string `type:"map"` } // String returns the string representation -func (s CampaignEmailMessage) String() string { +func (s EmailMessage) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CampaignEmailMessage) GoString() string { +func (s EmailMessage) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CampaignEmailMessage) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CampaignEmailMessage"} - if s.Title == nil { - invalidParams.Add(request.NewErrParamRequired("Title")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - // SetBody sets the Body field's value. -func (s *CampaignEmailMessage) SetBody(v string) *CampaignEmailMessage { +func (s *EmailMessage) SetBody(v string) *EmailMessage { s.Body = &v return s } +// SetFeedbackForwardingAddress sets the FeedbackForwardingAddress field's value. +func (s *EmailMessage) SetFeedbackForwardingAddress(v string) *EmailMessage { + s.FeedbackForwardingAddress = &v + return s +} + // SetFromAddress sets the FromAddress field's value. -func (s *CampaignEmailMessage) SetFromAddress(v string) *CampaignEmailMessage { +func (s *EmailMessage) SetFromAddress(v string) *EmailMessage { s.FromAddress = &v return s } -// SetHtmlBody sets the HtmlBody field's value. -func (s *CampaignEmailMessage) SetHtmlBody(v string) *CampaignEmailMessage { - s.HtmlBody = &v +// SetRawEmail sets the RawEmail field's value. +func (s *EmailMessage) SetRawEmail(v *RawEmail) *EmailMessage { + s.RawEmail = v return s } -// SetTitle sets the Title field's value. -func (s *CampaignEmailMessage) SetTitle(v string) *CampaignEmailMessage { - s.Title = &v +// SetReplyToAddresses sets the ReplyToAddresses field's value. +func (s *EmailMessage) SetReplyToAddresses(v []*string) *EmailMessage { + s.ReplyToAddresses = v return s } -// Specifies the settings for events that cause a campaign to be sent. -type CampaignEventFilter struct { +// SetSimpleEmail sets the SimpleEmail field's value. +func (s *EmailMessage) SetSimpleEmail(v *SimpleEmail) *EmailMessage { + s.SimpleEmail = v + return s +} + +// SetSubstitutions sets the Substitutions field's value. +func (s *EmailMessage) SetSubstitutions(v map[string][]*string) *EmailMessage { + s.Substitutions = v + return s +} + +// Specifies the settings for an email activity in a journey. This type of activity +// sends an email message to participants. +type EmailMessageActivity struct { _ struct{} `type:"structure"` - // The dimension settings of the event filter for the campaign. - // - // Dimensions is a required field - Dimensions *EventDimensions `type:"structure" required:"true"` + // The "From" address to use for the message. + MessageConfig *JourneyEmailMessage `type:"structure"` - // The type of event that causes the campaign to be sent. Valid values are: - // SYSTEM, sends the campaign when a system event occurs; and, ENDPOINT, sends - // the campaign when an endpoint event (Events resource) occurs. + // The unique identifier for the next activity to perform, after the message + // is sent. + NextActivity *string `type:"string"` + + // The name of the email template to use for the message. + TemplateName *string `type:"string"` + + // The unique identifier for the version of the email template to use for the + // message. If specified, this value must match the identifier for an existing + // template version. To retrieve a list of versions and version identifiers + // for a template, use the Template Versions resource. // - // FilterType is a required field - FilterType *string `type:"string" required:"true" enum:"FilterType"` + // If you don't specify a value for this property, Amazon Pinpoint uses the + // active version of the template. The active version is typically the version + // of a template that's been most recently reviewed and approved for use, depending + // on your workflow. It isn't necessarily the latest version of a template. + TemplateVersion *string `type:"string"` } // String returns the string representation -func (s CampaignEventFilter) String() string { +func (s EmailMessageActivity) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CampaignEventFilter) GoString() string { +func (s EmailMessageActivity) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CampaignEventFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CampaignEventFilter"} - if s.Dimensions == nil { - invalidParams.Add(request.NewErrParamRequired("Dimensions")) - } - if s.FilterType == nil { - invalidParams.Add(request.NewErrParamRequired("FilterType")) - } - if s.Dimensions != nil { - if err := s.Dimensions.Validate(); err != nil { - invalidParams.AddNested("Dimensions", err.(request.ErrInvalidParams)) - } - } +// SetMessageConfig sets the MessageConfig field's value. +func (s *EmailMessageActivity) SetMessageConfig(v *JourneyEmailMessage) *EmailMessageActivity { + s.MessageConfig = v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetNextActivity sets the NextActivity field's value. +func (s *EmailMessageActivity) SetNextActivity(v string) *EmailMessageActivity { + s.NextActivity = &v + return s } -// SetDimensions sets the Dimensions field's value. -func (s *CampaignEventFilter) SetDimensions(v *EventDimensions) *CampaignEventFilter { - s.Dimensions = v +// SetTemplateName sets the TemplateName field's value. +func (s *EmailMessageActivity) SetTemplateName(v string) *EmailMessageActivity { + s.TemplateName = &v return s } -// SetFilterType sets the FilterType field's value. -func (s *CampaignEventFilter) SetFilterType(v string) *CampaignEventFilter { - s.FilterType = &v +// SetTemplateVersion sets the TemplateVersion field's value. +func (s *EmailMessageActivity) SetTemplateVersion(v string) *EmailMessageActivity { + s.TemplateVersion = &v return s } -// Specifies the AWS Lambda function to use as a code hook for a campaign. -type CampaignHook struct { +// Specifies the content and settings for a message template that can be used +// in messages that are sent through the email channel. +type EmailTemplateRequest struct { _ struct{} `type:"structure"` - // The name or Amazon Resource Name (ARN) of the AWS Lambda function that Amazon - // Pinpoint invokes to send messages for a campaign. - LambdaFunctionName *string `type:"string"` + // A JSON object that specifies the default values to use for message variables + // in the message template. This object is a set of key-value pairs. Each key + // defines a message variable in the template. The corresponding value defines + // the default value for that variable. When you create a message that's based + // on the template, you can override these defaults with message-specific and + // address-specific variables and values. + DefaultSubstitutions *string `type:"string"` - // Specifies which Lambda mode to use when invoking the AWS Lambda function. - Mode *string `type:"string" enum:"Mode"` + // The message body, in HTML format, to use in email messages that are based + // on the message template. We recommend using HTML format for email clients + // that render HTML content. You can include links, formatted text, and more + // in an HTML message. + HtmlPart *string `type:"string"` - // The web URL that Amazon Pinpoint calls to invoke the AWS Lambda function - // over HTTPS. - WebUrl *string `type:"string"` + // The subject line, or title, to use in email messages that are based on the + // message template. + Subject *string `type:"string"` + + // A string-to-string map of key-value pairs that defines the tags to associate + // with the message template. Each tag consists of a required tag key and an + // associated tag value. + Tags map[string]*string `locationName:"tags" type:"map"` + + // A custom description of the message template. + TemplateDescription *string `type:"string"` + + // The message body, in plain text format, to use in email messages that are + // based on the message template. We recommend using plain text format for email + // clients that don't render HTML content and clients that are connected to + // high-latency networks, such as mobile devices. + TextPart *string `type:"string"` } // String returns the string representation -func (s CampaignHook) String() string { +func (s EmailTemplateRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CampaignHook) GoString() string { +func (s EmailTemplateRequest) GoString() string { return s.String() } -// SetLambdaFunctionName sets the LambdaFunctionName field's value. -func (s *CampaignHook) SetLambdaFunctionName(v string) *CampaignHook { - s.LambdaFunctionName = &v +// SetDefaultSubstitutions sets the DefaultSubstitutions field's value. +func (s *EmailTemplateRequest) SetDefaultSubstitutions(v string) *EmailTemplateRequest { + s.DefaultSubstitutions = &v return s } -// SetMode sets the Mode field's value. -func (s *CampaignHook) SetMode(v string) *CampaignHook { - s.Mode = &v +// SetHtmlPart sets the HtmlPart field's value. +func (s *EmailTemplateRequest) SetHtmlPart(v string) *EmailTemplateRequest { + s.HtmlPart = &v return s } -// SetWebUrl sets the WebUrl field's value. -func (s *CampaignHook) SetWebUrl(v string) *CampaignHook { - s.WebUrl = &v +// SetSubject sets the Subject field's value. +func (s *EmailTemplateRequest) SetSubject(v string) *EmailTemplateRequest { + s.Subject = &v return s } -// Specifies limits on the messages that a campaign can send. -type CampaignLimits struct { +// SetTags sets the Tags field's value. +func (s *EmailTemplateRequest) SetTags(v map[string]*string) *EmailTemplateRequest { + s.Tags = v + return s +} + +// SetTemplateDescription sets the TemplateDescription field's value. +func (s *EmailTemplateRequest) SetTemplateDescription(v string) *EmailTemplateRequest { + s.TemplateDescription = &v + return s +} + +// SetTextPart sets the TextPart field's value. +func (s *EmailTemplateRequest) SetTextPart(v string) *EmailTemplateRequest { + s.TextPart = &v + return s +} + +// Provides information about the content and settings for a message template +// that can be used in messages that are sent through the email channel. +type EmailTemplateResponse struct { _ struct{} `type:"structure"` - // The maximum number of messages that a campaign can send to a single endpoint - // during a 24-hour period. The maximum value is 100. - Daily *int64 `type:"integer"` + // The Amazon Resource Name (ARN) of the message template. + Arn *string `type:"string"` - // The maximum amount of time, in seconds, that a campaign can attempt to deliver - // a message after the scheduled start time for the campaign. The minimum value - // is 60 seconds. - MaximumDuration *int64 `type:"integer"` + // The date, in ISO 8601 format, when the message template was created. + // + // CreationDate is a required field + CreationDate *string `type:"string" required:"true"` - // The maximum number of messages that a campaign can send each second. The - // minimum value is 50. The maximum value is 20,000. - MessagesPerSecond *int64 `type:"integer"` + // The JSON object that specifies the default values that are used for message + // variables in the message template. This object is a set of key-value pairs. + // Each key defines a message variable in the template. The corresponding value + // defines the default value for that variable. + DefaultSubstitutions *string `type:"string"` - // The maximum number of messages that a campaign can send to a single endpoint - // during the course of the campaign. The maximum value is 100. - Total *int64 `type:"integer"` + // The message body, in HTML format, that's used in email messages that are + // based on the message template. + HtmlPart *string `type:"string"` + + // The date, in ISO 8601 format, when the message template was last modified. + // + // LastModifiedDate is a required field + LastModifiedDate *string `type:"string" required:"true"` + + // The subject line, or title, that's used in email messages that are based + // on the message template. + Subject *string `type:"string"` + + // A string-to-string map of key-value pairs that identifies the tags that are + // associated with the message template. Each tag consists of a required tag + // key and an associated tag value. + Tags map[string]*string `locationName:"tags" type:"map"` + + // The custom description of the message template. + TemplateDescription *string `type:"string"` + + // The name of the message template. + // + // TemplateName is a required field + TemplateName *string `type:"string" required:"true"` + + // The type of channel that the message template is designed for. For an email + // template, this value is EMAIL. + // + // TemplateType is a required field + TemplateType *string `type:"string" required:"true" enum:"TemplateType"` + + // The message body, in plain text format, that's used in email messages that + // are based on the message template. + TextPart *string `type:"string"` + + // The unique identifier, as an integer, for the active version of the message + // template, or the version of the template that you specified by using the + // version parameter in your request. + Version *string `type:"string"` } // String returns the string representation -func (s CampaignLimits) String() string { +func (s EmailTemplateResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CampaignLimits) GoString() string { +func (s EmailTemplateResponse) GoString() string { return s.String() } -// SetDaily sets the Daily field's value. -func (s *CampaignLimits) SetDaily(v int64) *CampaignLimits { - s.Daily = &v +// SetArn sets the Arn field's value. +func (s *EmailTemplateResponse) SetArn(v string) *EmailTemplateResponse { + s.Arn = &v return s } -// SetMaximumDuration sets the MaximumDuration field's value. -func (s *CampaignLimits) SetMaximumDuration(v int64) *CampaignLimits { - s.MaximumDuration = &v +// SetCreationDate sets the CreationDate field's value. +func (s *EmailTemplateResponse) SetCreationDate(v string) *EmailTemplateResponse { + s.CreationDate = &v return s } -// SetMessagesPerSecond sets the MessagesPerSecond field's value. -func (s *CampaignLimits) SetMessagesPerSecond(v int64) *CampaignLimits { - s.MessagesPerSecond = &v +// SetDefaultSubstitutions sets the DefaultSubstitutions field's value. +func (s *EmailTemplateResponse) SetDefaultSubstitutions(v string) *EmailTemplateResponse { + s.DefaultSubstitutions = &v return s } -// SetTotal sets the Total field's value. -func (s *CampaignLimits) SetTotal(v int64) *CampaignLimits { - s.Total = &v +// SetHtmlPart sets the HtmlPart field's value. +func (s *EmailTemplateResponse) SetHtmlPart(v string) *EmailTemplateResponse { + s.HtmlPart = &v return s } -// Provides information about the status, configuration, and other settings -// for a campaign. -type CampaignResponse struct { - _ struct{} `type:"structure"` - - // An array of responses, one for each treatment that you defined for the campaign, - // in addition to the default treatment. - AdditionalTreatments []*TreatmentResource `type:"list"` +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *EmailTemplateResponse) SetLastModifiedDate(v string) *EmailTemplateResponse { + s.LastModifiedDate = &v + return s +} - // The unique identifier for the application that the campaign applies to. - // - // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` +// SetSubject sets the Subject field's value. +func (s *EmailTemplateResponse) SetSubject(v string) *EmailTemplateResponse { + s.Subject = &v + return s +} - // The Amazon Resource Name (ARN) of the campaign. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` +// SetTags sets the Tags field's value. +func (s *EmailTemplateResponse) SetTags(v map[string]*string) *EmailTemplateResponse { + s.Tags = v + return s +} - // The date, ISO 8601 format, when the campaign was created. - // - // CreationDate is a required field - CreationDate *string `type:"string" required:"true"` +// SetTemplateDescription sets the TemplateDescription field's value. +func (s *EmailTemplateResponse) SetTemplateDescription(v string) *EmailTemplateResponse { + s.TemplateDescription = &v + return s +} - // The current status of the campaign's default treatment. This value exists - // only for campaigns that have more than one treatment, to support A/B testing. - DefaultState *CampaignState `type:"structure"` +// SetTemplateName sets the TemplateName field's value. +func (s *EmailTemplateResponse) SetTemplateName(v string) *EmailTemplateResponse { + s.TemplateName = &v + return s +} - // The custom description of the campaign. - Description *string `type:"string"` +// SetTemplateType sets the TemplateType field's value. +func (s *EmailTemplateResponse) SetTemplateType(v string) *EmailTemplateResponse { + s.TemplateType = &v + return s +} - // The allocated percentage of users (segment members) who shouldn't receive - // messages from the campaign. - HoldoutPercent *int64 `type:"integer"` +// SetTextPart sets the TextPart field's value. +func (s *EmailTemplateResponse) SetTextPart(v string) *EmailTemplateResponse { + s.TextPart = &v + return s +} - // The settings for the AWS Lambda function to use as a code hook for the campaign. - Hook *CampaignHook `type:"structure"` +// SetVersion sets the Version field's value. +func (s *EmailTemplateResponse) SetVersion(v string) *EmailTemplateResponse { + s.Version = &v + return s +} - // The unique identifier for the campaign. - // - // Id is a required field - Id *string `type:"string" required:"true"` +// Specifies an endpoint to create or update and the settings and attributes +// to set or change for the endpoint. +type EndpointBatchItem struct { + _ struct{} `type:"structure"` - // Specifies whether the campaign is paused. A paused campaign doesn't run unless - // you resume it by changing this value to false. - IsPaused *bool `type:"boolean"` + // The destination address for messages or push notifications that you send + // to the endpoint. The address varies by channel. For a push-notification channel, + // use the token provided by the push notification service, such as an Apple + // Push Notification service (APNs) device token or a Firebase Cloud Messaging + // (FCM) registration token. For the SMS channel, use a phone number in E.164 + // format, such as +12065550100. For the email channel, use an email address. + Address *string `type:"string"` - // The date, in ISO 8601 format, when the campaign was last modified. + // One or more custom attributes that describe the endpoint by associating a + // name with an array of values. For example, the value of a custom attribute + // named Interests might be: ["science", "music", "travel"]. You can use these + // attributes as filter criteria when you create segments. // - // LastModifiedDate is a required field - LastModifiedDate *string `type:"string" required:"true"` - - // The messaging limits for the campaign. - Limits *CampaignLimits `type:"structure"` + // When you define the name of a custom attribute, avoid using the following + // characters: number sign (#), colon (:), question mark (?), backslash (\), + // and slash (/). The Amazon Pinpoint console can't display attribute names + // that contain these characters. This limitation doesn't apply to attribute + // values. + Attributes map[string][]*string `type:"map"` - // The message configuration settings for the campaign. - MessageConfiguration *MessageConfiguration `type:"structure"` + // The channel to use when sending messages or push notifications to the endpoint. + ChannelType *string `type:"string" enum:"ChannelType"` - // The name of the campaign. - Name *string `type:"string"` + // The demographic information for the endpoint, such as the time zone and platform. + Demographic *EndpointDemographic `type:"structure"` - // The schedule settings for the campaign. - Schedule *Schedule `type:"structure"` + // The date and time, in ISO 8601 format, when the endpoint was created or updated. + EffectiveDate *string `type:"string"` - // The unique identifier for the segment that's associated with the campaign. + // Specifies whether to send messages or push notifications to the endpoint. + // Valid values are: ACTIVE, messages are sent to the endpoint; and, INACTIVE, + // messages aren’t sent to the endpoint. // - // SegmentId is a required field - SegmentId *string `type:"string" required:"true"` + // Amazon Pinpoint automatically sets this value to ACTIVE when you create an + // endpoint or update an existing endpoint. Amazon Pinpoint automatically sets + // this value to INACTIVE if you update another endpoint that has the same address + // specified by the Address property. + EndpointStatus *string `type:"string"` - // The version number of the segment that's associated with the campaign. - // - // SegmentVersion is a required field - SegmentVersion *int64 `type:"integer" required:"true"` + // The unique identifier for the endpoint in the context of the batch. + Id *string `type:"string"` - // The current status of the campaign. - State *CampaignState `type:"structure"` + // The geographic information for the endpoint. + Location *EndpointLocation `type:"structure"` - // A string-to-string map of key-value pairs that identifies the tags that are - // associated with the campaign. Each tag consists of a required tag key and - // an associated tag value. - Tags map[string]*string `locationName:"tags" type:"map"` + // One or more custom metrics that your app reports to Amazon Pinpoint for the + // endpoint. + Metrics map[string]*float64 `type:"map"` - // The custom description of a variation of the campaign that's used for A/B - // testing. - TreatmentDescription *string `type:"string"` + // Specifies whether the user who's associated with the endpoint has opted out + // of receiving messages and push notifications from you. Possible values are: + // ALL, the user has opted out and doesn't want to receive any messages or push + // notifications; and, NONE, the user hasn't opted out and wants to receive + // all messages and push notifications. + OptOut *string `type:"string"` - // The custom name of a variation of the campaign that's used for A/B testing. - TreatmentName *string `type:"string"` + // The unique identifier for the request to create or update the endpoint. + RequestId *string `type:"string"` - // The version number of the campaign. - Version *int64 `type:"integer"` + // One or more custom user attributes that your app reports to Amazon Pinpoint + // for the user who's associated with the endpoint. + User *EndpointUser `type:"structure"` } // String returns the string representation -func (s CampaignResponse) String() string { +func (s EndpointBatchItem) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CampaignResponse) GoString() string { +func (s EndpointBatchItem) GoString() string { return s.String() } -// SetAdditionalTreatments sets the AdditionalTreatments field's value. -func (s *CampaignResponse) SetAdditionalTreatments(v []*TreatmentResource) *CampaignResponse { - s.AdditionalTreatments = v +// SetAddress sets the Address field's value. +func (s *EndpointBatchItem) SetAddress(v string) *EndpointBatchItem { + s.Address = &v return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *CampaignResponse) SetApplicationId(v string) *CampaignResponse { - s.ApplicationId = &v +// SetAttributes sets the Attributes field's value. +func (s *EndpointBatchItem) SetAttributes(v map[string][]*string) *EndpointBatchItem { + s.Attributes = v return s } -// SetArn sets the Arn field's value. -func (s *CampaignResponse) SetArn(v string) *CampaignResponse { - s.Arn = &v +// SetChannelType sets the ChannelType field's value. +func (s *EndpointBatchItem) SetChannelType(v string) *EndpointBatchItem { + s.ChannelType = &v return s } -// SetCreationDate sets the CreationDate field's value. -func (s *CampaignResponse) SetCreationDate(v string) *CampaignResponse { - s.CreationDate = &v +// SetDemographic sets the Demographic field's value. +func (s *EndpointBatchItem) SetDemographic(v *EndpointDemographic) *EndpointBatchItem { + s.Demographic = v return s } -// SetDefaultState sets the DefaultState field's value. -func (s *CampaignResponse) SetDefaultState(v *CampaignState) *CampaignResponse { - s.DefaultState = v +// SetEffectiveDate sets the EffectiveDate field's value. +func (s *EndpointBatchItem) SetEffectiveDate(v string) *EndpointBatchItem { + s.EffectiveDate = &v return s } -// SetDescription sets the Description field's value. -func (s *CampaignResponse) SetDescription(v string) *CampaignResponse { - s.Description = &v +// SetEndpointStatus sets the EndpointStatus field's value. +func (s *EndpointBatchItem) SetEndpointStatus(v string) *EndpointBatchItem { + s.EndpointStatus = &v return s } -// SetHoldoutPercent sets the HoldoutPercent field's value. -func (s *CampaignResponse) SetHoldoutPercent(v int64) *CampaignResponse { - s.HoldoutPercent = &v +// SetId sets the Id field's value. +func (s *EndpointBatchItem) SetId(v string) *EndpointBatchItem { + s.Id = &v return s } -// SetHook sets the Hook field's value. -func (s *CampaignResponse) SetHook(v *CampaignHook) *CampaignResponse { - s.Hook = v +// SetLocation sets the Location field's value. +func (s *EndpointBatchItem) SetLocation(v *EndpointLocation) *EndpointBatchItem { + s.Location = v return s } -// SetId sets the Id field's value. -func (s *CampaignResponse) SetId(v string) *CampaignResponse { - s.Id = &v +// SetMetrics sets the Metrics field's value. +func (s *EndpointBatchItem) SetMetrics(v map[string]*float64) *EndpointBatchItem { + s.Metrics = v return s } -// SetIsPaused sets the IsPaused field's value. -func (s *CampaignResponse) SetIsPaused(v bool) *CampaignResponse { - s.IsPaused = &v +// SetOptOut sets the OptOut field's value. +func (s *EndpointBatchItem) SetOptOut(v string) *EndpointBatchItem { + s.OptOut = &v return s } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *CampaignResponse) SetLastModifiedDate(v string) *CampaignResponse { - s.LastModifiedDate = &v +// SetRequestId sets the RequestId field's value. +func (s *EndpointBatchItem) SetRequestId(v string) *EndpointBatchItem { + s.RequestId = &v return s } -// SetLimits sets the Limits field's value. -func (s *CampaignResponse) SetLimits(v *CampaignLimits) *CampaignResponse { - s.Limits = v +// SetUser sets the User field's value. +func (s *EndpointBatchItem) SetUser(v *EndpointUser) *EndpointBatchItem { + s.User = v return s } -// SetMessageConfiguration sets the MessageConfiguration field's value. -func (s *CampaignResponse) SetMessageConfiguration(v *MessageConfiguration) *CampaignResponse { - s.MessageConfiguration = v - return s +// Specifies a batch of endpoints to create or update and the settings and attributes +// to set or change for each endpoint. +type EndpointBatchRequest struct { + _ struct{} `type:"structure"` + + // An array that defines the endpoints to create or update and, for each endpoint, + // the property values to set or change. An array can contain a maximum of 100 + // items. + // + // Item is a required field + Item []*EndpointBatchItem `type:"list" required:"true"` } -// SetName sets the Name field's value. -func (s *CampaignResponse) SetName(v string) *CampaignResponse { - s.Name = &v +// String returns the string representation +func (s EndpointBatchRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EndpointBatchRequest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EndpointBatchRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EndpointBatchRequest"} + if s.Item == nil { + invalidParams.Add(request.NewErrParamRequired("Item")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetItem sets the Item field's value. +func (s *EndpointBatchRequest) SetItem(v []*EndpointBatchItem) *EndpointBatchRequest { + s.Item = v return s } -// SetSchedule sets the Schedule field's value. -func (s *CampaignResponse) SetSchedule(v *Schedule) *CampaignResponse { - s.Schedule = v +// Specifies demographic information about an endpoint, such as the applicable +// time zone and platform. +type EndpointDemographic struct { + _ struct{} `type:"structure"` + + // The version of the app that's associated with the endpoint. + AppVersion *string `type:"string"` + + // The locale of the endpoint, in the following format: the ISO 639-1 alpha-2 + // code, followed by an underscore (_), followed by an ISO 3166-1 alpha-2 value. + Locale *string `type:"string"` + + // The manufacturer of the endpoint device, such as apple or samsung. + Make *string `type:"string"` + + // The model name or number of the endpoint device, such as iPhone or SM-G900F. + Model *string `type:"string"` + + // The model version of the endpoint device. + ModelVersion *string `type:"string"` + + // The platform of the endpoint device, such as ios. + Platform *string `type:"string"` + + // The platform version of the endpoint device. + PlatformVersion *string `type:"string"` + + // The time zone of the endpoint, specified as a tz database name value, such + // as America/Los_Angeles. + Timezone *string `type:"string"` +} + +// String returns the string representation +func (s EndpointDemographic) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EndpointDemographic) GoString() string { + return s.String() +} + +// SetAppVersion sets the AppVersion field's value. +func (s *EndpointDemographic) SetAppVersion(v string) *EndpointDemographic { + s.AppVersion = &v return s } -// SetSegmentId sets the SegmentId field's value. -func (s *CampaignResponse) SetSegmentId(v string) *CampaignResponse { - s.SegmentId = &v +// SetLocale sets the Locale field's value. +func (s *EndpointDemographic) SetLocale(v string) *EndpointDemographic { + s.Locale = &v return s } -// SetSegmentVersion sets the SegmentVersion field's value. -func (s *CampaignResponse) SetSegmentVersion(v int64) *CampaignResponse { - s.SegmentVersion = &v +// SetMake sets the Make field's value. +func (s *EndpointDemographic) SetMake(v string) *EndpointDemographic { + s.Make = &v return s } -// SetState sets the State field's value. -func (s *CampaignResponse) SetState(v *CampaignState) *CampaignResponse { - s.State = v +// SetModel sets the Model field's value. +func (s *EndpointDemographic) SetModel(v string) *EndpointDemographic { + s.Model = &v return s } -// SetTags sets the Tags field's value. -func (s *CampaignResponse) SetTags(v map[string]*string) *CampaignResponse { - s.Tags = v +// SetModelVersion sets the ModelVersion field's value. +func (s *EndpointDemographic) SetModelVersion(v string) *EndpointDemographic { + s.ModelVersion = &v return s } -// SetTreatmentDescription sets the TreatmentDescription field's value. -func (s *CampaignResponse) SetTreatmentDescription(v string) *CampaignResponse { - s.TreatmentDescription = &v +// SetPlatform sets the Platform field's value. +func (s *EndpointDemographic) SetPlatform(v string) *EndpointDemographic { + s.Platform = &v return s } -// SetTreatmentName sets the TreatmentName field's value. -func (s *CampaignResponse) SetTreatmentName(v string) *CampaignResponse { - s.TreatmentName = &v +// SetPlatformVersion sets the PlatformVersion field's value. +func (s *EndpointDemographic) SetPlatformVersion(v string) *EndpointDemographic { + s.PlatformVersion = &v return s } -// SetVersion sets the Version field's value. -func (s *CampaignResponse) SetVersion(v int64) *CampaignResponse { - s.Version = &v +// SetTimezone sets the Timezone field's value. +func (s *EndpointDemographic) SetTimezone(v string) *EndpointDemographic { + s.Timezone = &v return s } -// Specifies the content and settings for an SMS message that's sent to recipients -// of a campaign. -type CampaignSmsMessage struct { +// Provides the status code and message that result from processing data for +// an endpoint. +type EndpointItemResponse struct { _ struct{} `type:"structure"` - // The body of the SMS message. - Body *string `type:"string"` - - // The type of SMS message. Valid values are: TRANSACTIONAL, the message is - // critical or time-sensitive, such as a one-time password that supports a customer - // transaction; and, PROMOTIONAL, the message isn't critical or time-sensitive, - // such as a marketing message. - MessageType *string `type:"string" enum:"MessageType"` + // The custom message that's returned in the response as a result of processing + // the endpoint data. + Message *string `type:"string"` - // The sender ID to display on recipients' devices when they receive the SMS - // message. - SenderId *string `type:"string"` + // The status code that's returned in the response as a result of processing + // the endpoint data. + StatusCode *int64 `type:"integer"` } // String returns the string representation -func (s CampaignSmsMessage) String() string { +func (s EndpointItemResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CampaignSmsMessage) GoString() string { +func (s EndpointItemResponse) GoString() string { return s.String() } -// SetBody sets the Body field's value. -func (s *CampaignSmsMessage) SetBody(v string) *CampaignSmsMessage { - s.Body = &v - return s -} - -// SetMessageType sets the MessageType field's value. -func (s *CampaignSmsMessage) SetMessageType(v string) *CampaignSmsMessage { - s.MessageType = &v +// SetMessage sets the Message field's value. +func (s *EndpointItemResponse) SetMessage(v string) *EndpointItemResponse { + s.Message = &v return s } -// SetSenderId sets the SenderId field's value. -func (s *CampaignSmsMessage) SetSenderId(v string) *CampaignSmsMessage { - s.SenderId = &v +// SetStatusCode sets the StatusCode field's value. +func (s *EndpointItemResponse) SetStatusCode(v int64) *EndpointItemResponse { + s.StatusCode = &v return s } -// Provides information about the status of a campaign. -type CampaignState struct { +// Specifies geographic information about an endpoint. +type EndpointLocation struct { _ struct{} `type:"structure"` - // The status of the campaign, or the status of a treatment that belongs to - // an A/B test campaign. If a campaign uses A/B testing, the campaign has a - // status of COMPLETED only when all campaign treatments have a status of COMPLETED. - CampaignStatus *string `type:"string" enum:"CampaignStatus"` + // The name of the city where the endpoint is located. + City *string `type:"string"` + + // The two-character code, in ISO 3166-1 alpha-2 format, for the country or + // region where the endpoint is located. For example, US for the United States. + Country *string `type:"string"` + + // The latitude coordinate of the endpoint location, rounded to one decimal + // place. + Latitude *float64 `type:"double"` + + // The longitude coordinate of the endpoint location, rounded to one decimal + // place. + Longitude *float64 `type:"double"` + + // The postal or ZIP code for the area where the endpoint is located. + PostalCode *string `type:"string"` + + // The name of the region where the endpoint is located. For locations in the + // United States, this value is the name of a state. + Region *string `type:"string"` } // String returns the string representation -func (s CampaignState) String() string { +func (s EndpointLocation) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CampaignState) GoString() string { +func (s EndpointLocation) GoString() string { return s.String() } -// SetCampaignStatus sets the CampaignStatus field's value. -func (s *CampaignState) SetCampaignStatus(v string) *CampaignState { - s.CampaignStatus = &v +// SetCity sets the City field's value. +func (s *EndpointLocation) SetCity(v string) *EndpointLocation { + s.City = &v return s } -// Provides information about the configuration and other settings for all the -// campaigns that are associated with an application. -type CampaignsResponse struct { +// SetCountry sets the Country field's value. +func (s *EndpointLocation) SetCountry(v string) *EndpointLocation { + s.Country = &v + return s +} + +// SetLatitude sets the Latitude field's value. +func (s *EndpointLocation) SetLatitude(v float64) *EndpointLocation { + s.Latitude = &v + return s +} + +// SetLongitude sets the Longitude field's value. +func (s *EndpointLocation) SetLongitude(v float64) *EndpointLocation { + s.Longitude = &v + return s +} + +// SetPostalCode sets the PostalCode field's value. +func (s *EndpointLocation) SetPostalCode(v string) *EndpointLocation { + s.PostalCode = &v + return s +} + +// SetRegion sets the Region field's value. +func (s *EndpointLocation) SetRegion(v string) *EndpointLocation { + s.Region = &v + return s +} + +// Provides information about the delivery status and results of sending a message +// directly to an endpoint. +type EndpointMessageResult struct { _ struct{} `type:"structure"` - // An array of responses, one for each campaign that's associated with the application. + // The endpoint address that the message was delivered to. + Address *string `type:"string"` + + // The delivery status of the message. Possible values are: // - // Item is a required field - Item []*CampaignResponse `type:"list" required:"true"` + // * DUPLICATE - The endpoint address is a duplicate of another endpoint + // address. Amazon Pinpoint won't attempt to send the message again. + // + // * OPT_OUT - The user who's associated with the endpoint has opted out + // of receiving messages from you. Amazon Pinpoint won't attempt to send + // the message again. + // + // * PERMANENT_FAILURE - An error occurred when delivering the message to + // the endpoint. Amazon Pinpoint won't attempt to send the message again. + // + // * SUCCESSFUL - The message was successfully delivered to the endpoint. + // + // * TEMPORARY_FAILURE - A temporary error occurred. Amazon Pinpoint will + // attempt to deliver the message again later. + // + // * THROTTLED - Amazon Pinpoint throttled the operation to send the message + // to the endpoint. + // + // * TIMEOUT - The message couldn't be sent within the timeout period. + // + // * UNKNOWN_FAILURE - An unknown error occurred. + // + // DeliveryStatus is a required field + DeliveryStatus *string `type:"string" required:"true" enum:"DeliveryStatus"` - // The string to use in a subsequent request to get the next page of results - // in a paginated response. This value is null if there are no additional pages. - NextToken *string `type:"string"` + // The unique identifier for the message that was sent. + MessageId *string `type:"string"` + + // The downstream service status code for delivering the message. + // + // StatusCode is a required field + StatusCode *int64 `type:"integer" required:"true"` + + // The status message for delivering the message. + StatusMessage *string `type:"string"` + + // For push notifications that are sent through the GCM channel, specifies whether + // the endpoint's device registration token was updated as part of delivering + // the message. + UpdatedToken *string `type:"string"` } // String returns the string representation -func (s CampaignsResponse) String() string { +func (s EndpointMessageResult) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CampaignsResponse) GoString() string { +func (s EndpointMessageResult) GoString() string { return s.String() } -// SetItem sets the Item field's value. -func (s *CampaignsResponse) SetItem(v []*CampaignResponse) *CampaignsResponse { - s.Item = v +// SetAddress sets the Address field's value. +func (s *EndpointMessageResult) SetAddress(v string) *EndpointMessageResult { + s.Address = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *CampaignsResponse) SetNextToken(v string) *CampaignsResponse { - s.NextToken = &v +// SetDeliveryStatus sets the DeliveryStatus field's value. +func (s *EndpointMessageResult) SetDeliveryStatus(v string) *EndpointMessageResult { + s.DeliveryStatus = &v return s } -// Provides information about the general settings and status of a channel for -// an application. -type ChannelResponse struct { +// SetMessageId sets the MessageId field's value. +func (s *EndpointMessageResult) SetMessageId(v string) *EndpointMessageResult { + s.MessageId = &v + return s +} + +// SetStatusCode sets the StatusCode field's value. +func (s *EndpointMessageResult) SetStatusCode(v int64) *EndpointMessageResult { + s.StatusCode = &v + return s +} + +// SetStatusMessage sets the StatusMessage field's value. +func (s *EndpointMessageResult) SetStatusMessage(v string) *EndpointMessageResult { + s.StatusMessage = &v + return s +} + +// SetUpdatedToken sets the UpdatedToken field's value. +func (s *EndpointMessageResult) SetUpdatedToken(v string) *EndpointMessageResult { + s.UpdatedToken = &v + return s +} + +// Specifies the channel type and other settings for an endpoint. +type EndpointRequest struct { _ struct{} `type:"structure"` - // The unique identifier for the application. - ApplicationId *string `type:"string"` + // The destination address for messages or push notifications that you send + // to the endpoint. The address varies by channel. For a push-notification channel, + // use the token provided by the push notification service, such as an Apple + // Push Notification service (APNs) device token or a Firebase Cloud Messaging + // (FCM) registration token. For the SMS channel, use a phone number in E.164 + // format, such as +12065550100. For the email channel, use an email address. + Address *string `type:"string"` + + // One or more custom attributes that describe the endpoint by associating a + // name with an array of values. For example, the value of a custom attribute + // named Interests might be: ["science", "music", "travel"]. You can use these + // attributes as filter criteria when you create segments. + // + // When you define the name of a custom attribute, avoid using the following + // characters: number sign (#), colon (:), question mark (?), backslash (\), + // and slash (/). The Amazon Pinpoint console can't display attribute names + // that contain these characters. This limitation doesn't apply to attribute + // values. + Attributes map[string][]*string `type:"map"` + + // The channel to use when sending messages or push notifications to the endpoint. + ChannelType *string `type:"string" enum:"ChannelType"` - // The date and time, in ISO 8601 format, when the channel was enabled. - CreationDate *string `type:"string"` + // The demographic information for the endpoint, such as the time zone and platform. + Demographic *EndpointDemographic `type:"structure"` - // Specifies whether the channel is enabled for the application. - Enabled *bool `type:"boolean"` + // The date and time, in ISO 8601 format, when the endpoint is updated. + EffectiveDate *string `type:"string"` - // (Not used) This property is retained only for backward compatibility. - HasCredential *bool `type:"boolean"` + // Specifies whether to send messages or push notifications to the endpoint. + // Valid values are: ACTIVE, messages are sent to the endpoint; and, INACTIVE, + // messages aren’t sent to the endpoint. + // + // Amazon Pinpoint automatically sets this value to ACTIVE when you create an + // endpoint or update an existing endpoint. Amazon Pinpoint automatically sets + // this value to INACTIVE if you update another endpoint that has the same address + // specified by the Address property. + EndpointStatus *string `type:"string"` - // (Deprecated) An identifier for the channel. This property is retained only - // for backward compatibility. - Id *string `type:"string"` + // The geographic information for the endpoint. + Location *EndpointLocation `type:"structure"` - // Specifies whether the channel is archived. - IsArchived *bool `type:"boolean"` + // One or more custom metrics that your app reports to Amazon Pinpoint for the + // endpoint. + Metrics map[string]*float64 `type:"map"` - // The user who last modified the channel. - LastModifiedBy *string `type:"string"` + // Specifies whether the user who's associated with the endpoint has opted out + // of receiving messages and push notifications from you. Possible values are: + // ALL, the user has opted out and doesn't want to receive any messages or push + // notifications; and, NONE, the user hasn't opted out and wants to receive + // all messages and push notifications. + OptOut *string `type:"string"` - // The date and time, in ISO 8601 format, when the channel was last modified. - LastModifiedDate *string `type:"string"` + // The unique identifier for the most recent request to update the endpoint. + RequestId *string `type:"string"` - // The current version of the channel. - Version *int64 `type:"integer"` + // One or more custom user attributes that describe the user who's associated + // with the endpoint. + User *EndpointUser `type:"structure"` } // String returns the string representation -func (s ChannelResponse) String() string { +func (s EndpointRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ChannelResponse) GoString() string { +func (s EndpointRequest) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *ChannelResponse) SetApplicationId(v string) *ChannelResponse { - s.ApplicationId = &v +// SetAddress sets the Address field's value. +func (s *EndpointRequest) SetAddress(v string) *EndpointRequest { + s.Address = &v return s } -// SetCreationDate sets the CreationDate field's value. -func (s *ChannelResponse) SetCreationDate(v string) *ChannelResponse { - s.CreationDate = &v +// SetAttributes sets the Attributes field's value. +func (s *EndpointRequest) SetAttributes(v map[string][]*string) *EndpointRequest { + s.Attributes = v return s } -// SetEnabled sets the Enabled field's value. -func (s *ChannelResponse) SetEnabled(v bool) *ChannelResponse { - s.Enabled = &v +// SetChannelType sets the ChannelType field's value. +func (s *EndpointRequest) SetChannelType(v string) *EndpointRequest { + s.ChannelType = &v return s } -// SetHasCredential sets the HasCredential field's value. -func (s *ChannelResponse) SetHasCredential(v bool) *ChannelResponse { - s.HasCredential = &v +// SetDemographic sets the Demographic field's value. +func (s *EndpointRequest) SetDemographic(v *EndpointDemographic) *EndpointRequest { + s.Demographic = v return s } -// SetId sets the Id field's value. -func (s *ChannelResponse) SetId(v string) *ChannelResponse { - s.Id = &v +// SetEffectiveDate sets the EffectiveDate field's value. +func (s *EndpointRequest) SetEffectiveDate(v string) *EndpointRequest { + s.EffectiveDate = &v return s } -// SetIsArchived sets the IsArchived field's value. -func (s *ChannelResponse) SetIsArchived(v bool) *ChannelResponse { - s.IsArchived = &v +// SetEndpointStatus sets the EndpointStatus field's value. +func (s *EndpointRequest) SetEndpointStatus(v string) *EndpointRequest { + s.EndpointStatus = &v return s } -// SetLastModifiedBy sets the LastModifiedBy field's value. -func (s *ChannelResponse) SetLastModifiedBy(v string) *ChannelResponse { - s.LastModifiedBy = &v +// SetLocation sets the Location field's value. +func (s *EndpointRequest) SetLocation(v *EndpointLocation) *EndpointRequest { + s.Location = v return s } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *ChannelResponse) SetLastModifiedDate(v string) *ChannelResponse { - s.LastModifiedDate = &v +// SetMetrics sets the Metrics field's value. +func (s *EndpointRequest) SetMetrics(v map[string]*float64) *EndpointRequest { + s.Metrics = v return s } -// SetVersion sets the Version field's value. -func (s *ChannelResponse) SetVersion(v int64) *ChannelResponse { - s.Version = &v +// SetOptOut sets the OptOut field's value. +func (s *EndpointRequest) SetOptOut(v string) *EndpointRequest { + s.OptOut = &v return s } -// Provides information about the general settings and status of all channels -// for an application, including channels that aren't enabled for the application. -type ChannelsResponse struct { - _ struct{} `type:"structure"` - - // A map that contains a multipart response for each channel. For each item - // in this object, the ChannelType is the key and the Channel is the value. - // - // Channels is a required field - Channels map[string]*ChannelResponse `type:"map" required:"true"` -} - -// String returns the string representation -func (s ChannelsResponse) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ChannelsResponse) GoString() string { - return s.String() +// SetRequestId sets the RequestId field's value. +func (s *EndpointRequest) SetRequestId(v string) *EndpointRequest { + s.RequestId = &v + return s } -// SetChannels sets the Channels field's value. -func (s *ChannelsResponse) SetChannels(v map[string]*ChannelResponse) *ChannelsResponse { - s.Channels = v +// SetUser sets the User field's value. +func (s *EndpointRequest) SetUser(v *EndpointUser) *EndpointRequest { + s.User = v return s } -type CreateAppInput struct { - _ struct{} `type:"structure" payload:"CreateApplicationRequest"` +// Provides information about the channel type and other settings for an endpoint. +type EndpointResponse struct { + _ struct{} `type:"structure"` - // Specifies the display name of an application and the tags to associate with - // the application. - // - // CreateApplicationRequest is a required field - CreateApplicationRequest *CreateApplicationRequest `type:"structure" required:"true"` -} + // The destination address for messages or push notifications that you send + // to the endpoint. The address varies by channel. For example, the address + // for a push-notification channel is typically the token provided by a push + // notification service, such as an Apple Push Notification service (APNs) device + // token or a Firebase Cloud Messaging (FCM) registration token. The address + // for the SMS channel is a phone number in E.164 format, such as +12065550100. + // The address for the email channel is an email address. + Address *string `type:"string"` -// String returns the string representation -func (s CreateAppInput) String() string { - return awsutil.Prettify(s) -} + // The unique identifier for the application that's associated with the endpoint. + ApplicationId *string `type:"string"` -// GoString returns the string representation -func (s CreateAppInput) GoString() string { - return s.String() -} + // One or more custom attributes that describe the endpoint by associating a + // name with an array of values. For example, the value of a custom attribute + // named Interests might be: ["science", "music", "travel"]. You can use these + // attributes as filter criteria when you create segments. + Attributes map[string][]*string `type:"map"` -// 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.CreateApplicationRequest == nil { - invalidParams.Add(request.NewErrParamRequired("CreateApplicationRequest")) - } - if s.CreateApplicationRequest != nil { - if err := s.CreateApplicationRequest.Validate(); err != nil { - invalidParams.AddNested("CreateApplicationRequest", err.(request.ErrInvalidParams)) - } - } + // The channel that's used when sending messages or push notifications to the + // endpoint. + ChannelType *string `type:"string" enum:"ChannelType"` - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} + // A number from 0-99 that represents the cohort that the endpoint is assigned + // to. Endpoints are grouped into cohorts randomly, and each cohort contains + // approximately 1 percent of the endpoints for an application. Amazon Pinpoint + // assigns cohorts to the holdout or treatment allocations for campaigns. + CohortId *string `type:"string"` -// SetCreateApplicationRequest sets the CreateApplicationRequest field's value. -func (s *CreateAppInput) SetCreateApplicationRequest(v *CreateApplicationRequest) *CreateAppInput { - s.CreateApplicationRequest = v - return s -} + // The date and time, in ISO 8601 format, when the endpoint was created. + CreationDate *string `type:"string"` -type CreateAppOutput struct { - _ struct{} `type:"structure" payload:"ApplicationResponse"` + // The demographic information for the endpoint, such as the time zone and platform. + Demographic *EndpointDemographic `type:"structure"` - // Provides information about an application. + // The date and time, in ISO 8601 format, when the endpoint was last updated. + EffectiveDate *string `type:"string"` + + // Specifies whether messages or push notifications are sent to the endpoint. + // Possible values are: ACTIVE, messages are sent to the endpoint; and, INACTIVE, + // messages aren’t sent to the endpoint. // - // ApplicationResponse is a required field - ApplicationResponse *ApplicationResponse `type:"structure" required:"true"` -} + // Amazon Pinpoint automatically sets this value to ACTIVE when you create an + // endpoint or update an existing endpoint. Amazon Pinpoint automatically sets + // this value to INACTIVE if you update another endpoint that has the same address + // specified by the Address property. + EndpointStatus *string `type:"string"` -// String returns the string representation -func (s CreateAppOutput) String() string { - return awsutil.Prettify(s) -} + // The unique identifier that you assigned to the endpoint. The identifier should + // be a globally unique identifier (GUID) to ensure that it doesn't conflict + // with other endpoint identifiers that are associated with the application. + Id *string `type:"string"` -// GoString returns the string representation -func (s CreateAppOutput) GoString() string { - return s.String() -} + // The geographic information for the endpoint. + Location *EndpointLocation `type:"structure"` -// SetApplicationResponse sets the ApplicationResponse field's value. -func (s *CreateAppOutput) SetApplicationResponse(v *ApplicationResponse) *CreateAppOutput { - s.ApplicationResponse = v - return s -} + // One or more custom metrics that your app reports to Amazon Pinpoint for the + // endpoint. + Metrics map[string]*float64 `type:"map"` -// Specifies the display name of an application and the tags to associate with -// the application. -type CreateApplicationRequest struct { - _ struct{} `type:"structure"` + // Specifies whether the user who's associated with the endpoint has opted out + // of receiving messages and push notifications from you. Possible values are: + // ALL, the user has opted out and doesn't want to receive any messages or push + // notifications; and, NONE, the user hasn't opted out and wants to receive + // all messages and push notifications. + OptOut *string `type:"string"` - // The display name of the application. This name is displayed as the Project - // name on the Amazon Pinpoint console. - // - // Name is a required field - Name *string `type:"string" required:"true"` + // The unique identifier for the most recent request to update the endpoint. + RequestId *string `type:"string"` - // A string-to-string map of key-value pairs that defines the tags to associate - // with the application. Each tag consists of a required tag key and an associated - // tag value. - Tags map[string]*string `locationName:"tags" type:"map"` + // One or more custom user attributes that your app reports to Amazon Pinpoint + // for the user who's associated with the endpoint. + User *EndpointUser `type:"structure"` } // String returns the string representation -func (s CreateApplicationRequest) String() string { +func (s EndpointResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateApplicationRequest) GoString() string { +func (s EndpointResponse) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateApplicationRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateApplicationRequest"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } +// SetAddress sets the Address field's value. +func (s *EndpointResponse) SetAddress(v string) *EndpointResponse { + s.Address = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetApplicationId sets the ApplicationId field's value. +func (s *EndpointResponse) SetApplicationId(v string) *EndpointResponse { + s.ApplicationId = &v + return s } -// SetName sets the Name field's value. -func (s *CreateApplicationRequest) SetName(v string) *CreateApplicationRequest { - s.Name = &v +// SetAttributes sets the Attributes field's value. +func (s *EndpointResponse) SetAttributes(v map[string][]*string) *EndpointResponse { + s.Attributes = v return s } -// SetTags sets the Tags field's value. -func (s *CreateApplicationRequest) SetTags(v map[string]*string) *CreateApplicationRequest { - s.Tags = v +// SetChannelType sets the ChannelType field's value. +func (s *EndpointResponse) SetChannelType(v string) *EndpointResponse { + s.ChannelType = &v return s } -type CreateCampaignInput struct { - _ struct{} `type:"structure" payload:"WriteCampaignRequest"` +// SetCohortId sets the CohortId field's value. +func (s *EndpointResponse) SetCohortId(v string) *EndpointResponse { + s.CohortId = &v + return s +} - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +// SetCreationDate sets the CreationDate field's value. +func (s *EndpointResponse) SetCreationDate(v string) *EndpointResponse { + s.CreationDate = &v + return s +} - // Specifies the configuration and other settings for a campaign. - // - // WriteCampaignRequest is a required field - WriteCampaignRequest *WriteCampaignRequest `type:"structure" required:"true"` +// SetDemographic sets the Demographic field's value. +func (s *EndpointResponse) SetDemographic(v *EndpointDemographic) *EndpointResponse { + s.Demographic = v + return s } -// String returns the string representation -func (s CreateCampaignInput) String() string { - return awsutil.Prettify(s) +// SetEffectiveDate sets the EffectiveDate field's value. +func (s *EndpointResponse) SetEffectiveDate(v string) *EndpointResponse { + s.EffectiveDate = &v + return s } -// GoString returns the string representation -func (s CreateCampaignInput) GoString() string { - return s.String() +// SetEndpointStatus sets the EndpointStatus field's value. +func (s *EndpointResponse) SetEndpointStatus(v string) *EndpointResponse { + s.EndpointStatus = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCampaignInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCampaignInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.WriteCampaignRequest == nil { - invalidParams.Add(request.NewErrParamRequired("WriteCampaignRequest")) - } - if s.WriteCampaignRequest != nil { - if err := s.WriteCampaignRequest.Validate(); err != nil { - invalidParams.AddNested("WriteCampaignRequest", err.(request.ErrInvalidParams)) - } - } +// SetId sets the Id field's value. +func (s *EndpointResponse) SetId(v string) *EndpointResponse { + s.Id = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetLocation sets the Location field's value. +func (s *EndpointResponse) SetLocation(v *EndpointLocation) *EndpointResponse { + s.Location = v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *CreateCampaignInput) SetApplicationId(v string) *CreateCampaignInput { - s.ApplicationId = &v +// SetMetrics sets the Metrics field's value. +func (s *EndpointResponse) SetMetrics(v map[string]*float64) *EndpointResponse { + s.Metrics = v return s } -// SetWriteCampaignRequest sets the WriteCampaignRequest field's value. -func (s *CreateCampaignInput) SetWriteCampaignRequest(v *WriteCampaignRequest) *CreateCampaignInput { - s.WriteCampaignRequest = v +// SetOptOut sets the OptOut field's value. +func (s *EndpointResponse) SetOptOut(v string) *EndpointResponse { + s.OptOut = &v return s } -type CreateCampaignOutput struct { - _ struct{} `type:"structure" payload:"CampaignResponse"` +// SetRequestId sets the RequestId field's value. +func (s *EndpointResponse) SetRequestId(v string) *EndpointResponse { + s.RequestId = &v + return s +} - // Provides information about the status, configuration, and other settings - // for a campaign. - // - // CampaignResponse is a required field - CampaignResponse *CampaignResponse `type:"structure" required:"true"` +// SetUser sets the User field's value. +func (s *EndpointResponse) SetUser(v *EndpointUser) *EndpointResponse { + s.User = v + return s +} + +// Specifies the content, including message variables and attributes, to use +// in a message that's sent directly to an endpoint. +type EndpointSendConfiguration struct { + _ struct{} `type:"structure"` + + // The body of the message. If specified, this value overrides the default message + // body. + BodyOverride *string `type:"string"` + + // A map of custom attributes to attach to the message for the address. For + // a push notification, this payload is added to the data.pinpoint object. For + // an email or text message, this payload is added to email/SMS delivery receipt + // event attributes. + Context map[string]*string `type:"map"` + + // The raw, JSON-formatted string to use as the payload for the message. If + // specified, this value overrides all other values for the message. + RawContent *string `type:"string"` + + // A map of the message variables to merge with the variables specified for + // the default message (DefaultMessage.Substitutions). The variables specified + // in this map take precedence over all other variables. + Substitutions map[string][]*string `type:"map"` + + // The title or subject line of the message. If specified, this value overrides + // the default message title or subject line. + TitleOverride *string `type:"string"` } // String returns the string representation -func (s CreateCampaignOutput) String() string { +func (s EndpointSendConfiguration) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateCampaignOutput) GoString() string { +func (s EndpointSendConfiguration) GoString() string { return s.String() } -// SetCampaignResponse sets the CampaignResponse field's value. -func (s *CreateCampaignOutput) SetCampaignResponse(v *CampaignResponse) *CreateCampaignOutput { - s.CampaignResponse = v +// SetBodyOverride sets the BodyOverride field's value. +func (s *EndpointSendConfiguration) SetBodyOverride(v string) *EndpointSendConfiguration { + s.BodyOverride = &v return s } -type CreateExportJobInput struct { - _ struct{} `type:"structure" payload:"ExportJobRequest"` +// SetContext sets the Context field's value. +func (s *EndpointSendConfiguration) SetContext(v map[string]*string) *EndpointSendConfiguration { + s.Context = v + return s +} - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +// SetRawContent sets the RawContent field's value. +func (s *EndpointSendConfiguration) SetRawContent(v string) *EndpointSendConfiguration { + s.RawContent = &v + return s +} - // Specifies the settings for a job that exports endpoint definitions to an - // Amazon Simple Storage Service (Amazon S3) bucket. +// SetSubstitutions sets the Substitutions field's value. +func (s *EndpointSendConfiguration) SetSubstitutions(v map[string][]*string) *EndpointSendConfiguration { + s.Substitutions = v + return s +} + +// SetTitleOverride sets the TitleOverride field's value. +func (s *EndpointSendConfiguration) SetTitleOverride(v string) *EndpointSendConfiguration { + s.TitleOverride = &v + return s +} + +// Specifies data for one or more attributes that describe the user who's associated +// with an endpoint. +type EndpointUser struct { + _ struct{} `type:"structure"` + + // One or more custom attributes that describe the user by associating a name + // with an array of values. For example, the value of an attribute named Interests + // might be: ["science", "music", "travel"]. You can use these attributes as + // filter criteria when you create segments. // - // ExportJobRequest is a required field - ExportJobRequest *ExportJobRequest `type:"structure" required:"true"` + // When you define the name of a custom attribute, avoid using the following + // characters: number sign (#), colon (:), question mark (?), backslash (\), + // and slash (/). The Amazon Pinpoint console can't display attribute names + // that contain these characters. This limitation doesn't apply to attribute + // values. + UserAttributes map[string][]*string `type:"map"` + + // The unique identifier for the user. + UserId *string `type:"string"` } // String returns the string representation -func (s CreateExportJobInput) String() string { +func (s EndpointUser) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateExportJobInput) GoString() string { +func (s EndpointUser) GoString() string { return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateExportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateExportJobInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.ExportJobRequest == nil { - invalidParams.Add(request.NewErrParamRequired("ExportJobRequest")) - } - if s.ExportJobRequest != nil { - if err := s.ExportJobRequest.Validate(); err != nil { - invalidParams.AddNested("ExportJobRequest", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *CreateExportJobInput) SetApplicationId(v string) *CreateExportJobInput { - s.ApplicationId = &v +} + +// SetUserAttributes sets the UserAttributes field's value. +func (s *EndpointUser) SetUserAttributes(v map[string][]*string) *EndpointUser { + s.UserAttributes = v return s } -// SetExportJobRequest sets the ExportJobRequest field's value. -func (s *CreateExportJobInput) SetExportJobRequest(v *ExportJobRequest) *CreateExportJobInput { - s.ExportJobRequest = v +// SetUserId sets the UserId field's value. +func (s *EndpointUser) SetUserId(v string) *EndpointUser { + s.UserId = &v return s } -type CreateExportJobOutput struct { - _ struct{} `type:"structure" payload:"ExportJobResponse"` +// Provides information about all the endpoints that are associated with a user +// ID. +type EndpointsResponse struct { + _ struct{} `type:"structure"` - // Provides information about the status and settings of a job that exports - // endpoint definitions to a file. The file can be added directly to an Amazon - // Simple Storage Service (Amazon S3) bucket by using the Amazon Pinpoint API - // or downloaded directly to a computer by using the Amazon Pinpoint console. + // An array of responses, one for each endpoint that's associated with the user + // ID. // - // ExportJobResponse is a required field - ExportJobResponse *ExportJobResponse `type:"structure" required:"true"` + // Item is a required field + Item []*EndpointResponse `type:"list" required:"true"` } // String returns the string representation -func (s CreateExportJobOutput) String() string { +func (s EndpointsResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateExportJobOutput) GoString() string { +func (s EndpointsResponse) GoString() string { return s.String() } -// SetExportJobResponse sets the ExportJobResponse field's value. -func (s *CreateExportJobOutput) SetExportJobResponse(v *ExportJobResponse) *CreateExportJobOutput { - s.ExportJobResponse = v +// SetItem sets the Item field's value. +func (s *EndpointsResponse) SetItem(v []*EndpointResponse) *EndpointsResponse { + s.Item = v return s } -type CreateImportJobInput struct { - _ struct{} `type:"structure" payload:"ImportJobRequest"` +// Specifies information about an event that reports data to Amazon Pinpoint. +type Event struct { + _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The package name of the app that's recording the event. + AppPackageName *string `type:"string"` - // Specifies the settings for a job that imports endpoint definitions from an - // Amazon Simple Storage Service (Amazon S3) bucket. + // The title of the app that's recording the event. + AppTitle *string `type:"string"` + + // The version number of the app that's recording the event. + AppVersionCode *string `type:"string"` + + // One or more custom attributes that are associated with the event. + Attributes map[string]*string `type:"map"` + + // The version of the SDK that's running on the client device. + ClientSdkVersion *string `type:"string"` + + // The name of the event. // - // ImportJobRequest is a required field - ImportJobRequest *ImportJobRequest `type:"structure" required:"true"` + // EventType is a required field + EventType *string `type:"string" required:"true"` + + // One or more custom metrics that are associated with the event. + Metrics map[string]*float64 `type:"map"` + + // The name of the SDK that's being used to record the event. + SdkName *string `type:"string"` + + // Information about the session in which the event occurred. + Session *Session `type:"structure"` + + // The date and time, in ISO 8601 format, when the event occurred. + // + // Timestamp is a required field + Timestamp *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateImportJobInput) String() string { +func (s Event) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateImportJobInput) GoString() string { +func (s Event) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateImportJobInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) +func (s *Event) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Event"} + if s.EventType == nil { + invalidParams.Add(request.NewErrParamRequired("EventType")) } - if s.ImportJobRequest == nil { - invalidParams.Add(request.NewErrParamRequired("ImportJobRequest")) + if s.Timestamp == nil { + invalidParams.Add(request.NewErrParamRequired("Timestamp")) } - if s.ImportJobRequest != nil { - if err := s.ImportJobRequest.Validate(); err != nil { - invalidParams.AddNested("ImportJobRequest", err.(request.ErrInvalidParams)) + if s.Session != nil { + if err := s.Session.Validate(); err != nil { + invalidParams.AddNested("Session", err.(request.ErrInvalidParams)) } } @@ -11075,85 +18300,100 @@ func (s *CreateImportJobInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *CreateImportJobInput) SetApplicationId(v string) *CreateImportJobInput { - s.ApplicationId = &v +// SetAppPackageName sets the AppPackageName field's value. +func (s *Event) SetAppPackageName(v string) *Event { + s.AppPackageName = &v return s } -// SetImportJobRequest sets the ImportJobRequest field's value. -func (s *CreateImportJobInput) SetImportJobRequest(v *ImportJobRequest) *CreateImportJobInput { - s.ImportJobRequest = v +// SetAppTitle sets the AppTitle field's value. +func (s *Event) SetAppTitle(v string) *Event { + s.AppTitle = &v return s } -type CreateImportJobOutput struct { - _ struct{} `type:"structure" payload:"ImportJobResponse"` +// SetAppVersionCode sets the AppVersionCode field's value. +func (s *Event) SetAppVersionCode(v string) *Event { + s.AppVersionCode = &v + return s +} - // Provides information about the status and settings of a job that imports - // endpoint definitions from one or more files. The files can be stored in an - // Amazon Simple Storage Service (Amazon S3) bucket or uploaded directly from - // a computer by using the Amazon Pinpoint console. - // - // ImportJobResponse is a required field - ImportJobResponse *ImportJobResponse `type:"structure" required:"true"` +// SetAttributes sets the Attributes field's value. +func (s *Event) SetAttributes(v map[string]*string) *Event { + s.Attributes = v + return s } -// String returns the string representation -func (s CreateImportJobOutput) String() string { - return awsutil.Prettify(s) +// SetClientSdkVersion sets the ClientSdkVersion field's value. +func (s *Event) SetClientSdkVersion(v string) *Event { + s.ClientSdkVersion = &v + return s } -// GoString returns the string representation -func (s CreateImportJobOutput) GoString() string { - return s.String() +// SetEventType sets the EventType field's value. +func (s *Event) SetEventType(v string) *Event { + s.EventType = &v + return s } -// SetImportJobResponse sets the ImportJobResponse field's value. -func (s *CreateImportJobOutput) SetImportJobResponse(v *ImportJobResponse) *CreateImportJobOutput { - s.ImportJobResponse = v +// SetMetrics sets the Metrics field's value. +func (s *Event) SetMetrics(v map[string]*float64) *Event { + s.Metrics = v return s } -type CreateSegmentInput struct { - _ struct{} `type:"structure" payload:"WriteSegmentRequest"` +// SetSdkName sets the SdkName field's value. +func (s *Event) SetSdkName(v string) *Event { + s.SdkName = &v + return s +} - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +// SetSession sets the Session field's value. +func (s *Event) SetSession(v *Session) *Event { + s.Session = v + return s +} - // Specifies the configuration, dimension, and other settings for a segment. - // A WriteSegmentRequest object can include a Dimensions object or a SegmentGroups - // object, but not both. +// SetTimestamp sets the Timestamp field's value. +func (s *Event) SetTimestamp(v string) *Event { + s.Timestamp = &v + return s +} + +// Specifies the conditions to evaluate for an event that applies to an activity +// in a journey. +type EventCondition struct { + _ struct{} `type:"structure"` + + // The dimensions for the event filter to use for the activity. // - // WriteSegmentRequest is a required field - WriteSegmentRequest *WriteSegmentRequest `type:"structure" required:"true"` + // Dimensions is a required field + Dimensions *EventDimensions `type:"structure" required:"true"` + + // The message identifier (message_id) for the message to use when determining + // whether message events meet the condition. + MessageActivity *string `type:"string"` } // String returns the string representation -func (s CreateSegmentInput) String() string { +func (s EventCondition) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateSegmentInput) GoString() string { +func (s EventCondition) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateSegmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateSegmentInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.WriteSegmentRequest == nil { - invalidParams.Add(request.NewErrParamRequired("WriteSegmentRequest")) +func (s *EventCondition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EventCondition"} + if s.Dimensions == nil { + invalidParams.Add(request.NewErrParamRequired("Dimensions")) } - if s.WriteSegmentRequest != nil { - if err := s.WriteSegmentRequest.Validate(); err != nil { - invalidParams.AddNested("WriteSegmentRequest", err.(request.ErrInvalidParams)) + if s.Dimensions != nil { + if err := s.Dimensions.Validate(); err != nil { + invalidParams.AddNested("Dimensions", err.(request.ErrInvalidParams)) } } @@ -11163,202 +18403,324 @@ func (s *CreateSegmentInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *CreateSegmentInput) SetApplicationId(v string) *CreateSegmentInput { - s.ApplicationId = &v +// SetDimensions sets the Dimensions field's value. +func (s *EventCondition) SetDimensions(v *EventDimensions) *EventCondition { + s.Dimensions = v return s } -// SetWriteSegmentRequest sets the WriteSegmentRequest field's value. -func (s *CreateSegmentInput) SetWriteSegmentRequest(v *WriteSegmentRequest) *CreateSegmentInput { - s.WriteSegmentRequest = v +// SetMessageActivity sets the MessageActivity field's value. +func (s *EventCondition) SetMessageActivity(v string) *EventCondition { + s.MessageActivity = &v return s } -type CreateSegmentOutput struct { - _ struct{} `type:"structure" payload:"SegmentResponse"` +// Specifies the dimensions for an event filter that determines when a campaign +// is sent or a journey activity is performed. +type EventDimensions struct { + _ struct{} `type:"structure"` + + // One or more custom attributes that your application reports to Amazon Pinpoint. + // You can use these attributes as selection criteria when you create an event + // filter. + Attributes map[string]*AttributeDimension `type:"map"` + + // The name of the event that causes the campaign to be sent or the journey + // activity to be performed. This can be a standard type of event that Amazon + // Pinpoint generates, such as _email.delivered, or a custom event that's specific + // to your application. + EventType *SetDimension `type:"structure"` + + // One or more custom metrics that your application reports to Amazon Pinpoint. + // You can use these metrics as selection criteria when you create an event + // filter. + Metrics map[string]*MetricDimension `type:"map"` +} + +// String returns the string representation +func (s EventDimensions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EventDimensions) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EventDimensions) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EventDimensions"} + 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.EventType != nil { + if err := s.EventType.Validate(); err != nil { + invalidParams.AddNested("EventType", err.(request.ErrInvalidParams)) + } + } + if s.Metrics != nil { + for i, v := range s.Metrics { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Metrics", i), err.(request.ErrInvalidParams)) + } + } + } - // Provides information about the configuration, dimension, and other settings - // for a segment. - // - // SegmentResponse is a required field - SegmentResponse *SegmentResponse `type:"structure" required:"true"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// String returns the string representation -func (s CreateSegmentOutput) String() string { - return awsutil.Prettify(s) +// SetAttributes sets the Attributes field's value. +func (s *EventDimensions) SetAttributes(v map[string]*AttributeDimension) *EventDimensions { + s.Attributes = v + return s } -// GoString returns the string representation -func (s CreateSegmentOutput) GoString() string { - return s.String() +// SetEventType sets the EventType field's value. +func (s *EventDimensions) SetEventType(v *SetDimension) *EventDimensions { + s.EventType = v + return s } -// SetSegmentResponse sets the SegmentResponse field's value. -func (s *CreateSegmentOutput) SetSegmentResponse(v *SegmentResponse) *CreateSegmentOutput { - s.SegmentResponse = v +// SetMetrics sets the Metrics field's value. +func (s *EventDimensions) SetMetrics(v map[string]*MetricDimension) *EventDimensions { + s.Metrics = v return s } -// Specifies the default message to use for all channels. -type DefaultMessage struct { +// Provides the status code and message that result from processing an event. +type EventItemResponse struct { _ struct{} `type:"structure"` - // The default message body of the push notification, email, or SMS message. - Body *string `type:"string"` + // A custom message that's returned in the response as a result of processing + // the event. + Message *string `type:"string"` - // The default message variables to use in the push notification, email, or - // SMS message. You can override these default variables with individual address - // variables. - Substitutions map[string][]*string `type:"map"` + // The status code that's returned in the response as a result of processing + // the event. Possible values are: 202, for events that were accepted; and, + // 400, for events that weren't valid. + StatusCode *int64 `type:"integer"` } // String returns the string representation -func (s DefaultMessage) String() string { +func (s EventItemResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DefaultMessage) GoString() string { +func (s EventItemResponse) GoString() string { return s.String() } -// SetBody sets the Body field's value. -func (s *DefaultMessage) SetBody(v string) *DefaultMessage { - s.Body = &v +// SetMessage sets the Message field's value. +func (s *EventItemResponse) SetMessage(v string) *EventItemResponse { + s.Message = &v return s } -// SetSubstitutions sets the Substitutions field's value. -func (s *DefaultMessage) SetSubstitutions(v map[string][]*string) *DefaultMessage { - s.Substitutions = v +// SetStatusCode sets the StatusCode field's value. +func (s *EventItemResponse) SetStatusCode(v int64) *EventItemResponse { + s.StatusCode = &v return s } -// Specifies the default settings and content for a push notification that's -// sent directly to an endpoint. -type DefaultPushNotificationMessage struct { +// Specifies settings for publishing event data to an Amazon Kinesis data stream +// or an Amazon Kinesis Data Firehose delivery stream. +type EventStream struct { _ struct{} `type:"structure"` - // The default action to occur if a recipient taps the push notification. Valid - // values are: + // The unique identifier for the application to publish event data for. // - // * OPEN_APP - Your app opens or it becomes the foreground app if it was - // sent to the background. This is the default action. + // ApplicationId is a required field + ApplicationId *string `type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the Amazon Kinesis data stream or Amazon + // Kinesis Data Firehose delivery stream to publish event data to. // - // * DEEP_LINK - Your app opens and displays a designated user interface - // in the app. This setting uses the deep-linking features of the iOS and - // Android platforms. + // For a Kinesis data stream, the ARN format is: arn:aws:kinesis:region:account-id:stream/stream_name // - // * URL - The default mobile browser on the recipient's device opens and - // loads the web page at a URL that you specify. - Action *string `type:"string" enum:"Action"` - - // The default body of the notification message. - Body *string `type:"string"` - - // The JSON data payload to use for the default push notification, if the notification - // is a silent push notification. This payload is added to the data.pinpoint.jsonBody - // object of the notification. - Data map[string]*string `type:"map"` + // For a Kinesis Data Firehose delivery stream, the ARN format is: arn:aws:firehose:region:account-id:deliverystream/stream_name + // + // DestinationStreamArn is a required field + DestinationStreamArn *string `type:"string" required:"true"` - // Specifies whether the default notification is a silent push notification, - // which is a push notification that doesn't display on a recipient's device. - // Silent push notifications can be used for cases such as updating an app's - // configuration or delivering messages to an in-app notification center. - SilentPush *bool `type:"boolean"` + // (Deprecated) Your AWS account ID, which you assigned to an external ID key + // in an IAM trust policy. Amazon Pinpoint previously used this value to assume + // an IAM role when publishing event data, but we removed this requirement. + // We don't recommend use of external IDs for IAM roles that are assumed by + // Amazon Pinpoint. + ExternalId *string `type:"string"` - // The default message variables to use in the notification message. You can - // override the default variables with individual address variables. - Substitutions map[string][]*string `type:"map"` + // The date, in ISO 8601 format, when the event stream was last modified. + LastModifiedDate *string `type:"string"` - // The default title to display above the notification message on a recipient's - // device. - Title *string `type:"string"` + // The IAM user who last modified the event stream. + LastUpdatedBy *string `type:"string"` - // The default URL to open in a recipient's default mobile browser, if a recipient - // taps the push notification and the value of the Action property is URL. - Url *string `type:"string"` + // The AWS Identity and Access Management (IAM) role that authorizes Amazon + // Pinpoint to publish event data to the stream in your AWS account. + // + // RoleArn is a required field + RoleArn *string `type:"string" required:"true"` } // String returns the string representation -func (s DefaultPushNotificationMessage) String() string { +func (s EventStream) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DefaultPushNotificationMessage) GoString() string { +func (s EventStream) GoString() string { return s.String() } -// SetAction sets the Action field's value. -func (s *DefaultPushNotificationMessage) SetAction(v string) *DefaultPushNotificationMessage { - s.Action = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *EventStream) SetApplicationId(v string) *EventStream { + s.ApplicationId = &v return s } -// SetBody sets the Body field's value. -func (s *DefaultPushNotificationMessage) SetBody(v string) *DefaultPushNotificationMessage { - s.Body = &v +// SetDestinationStreamArn sets the DestinationStreamArn field's value. +func (s *EventStream) SetDestinationStreamArn(v string) *EventStream { + s.DestinationStreamArn = &v return s } -// SetData sets the Data field's value. -func (s *DefaultPushNotificationMessage) SetData(v map[string]*string) *DefaultPushNotificationMessage { - s.Data = v +// SetExternalId sets the ExternalId field's value. +func (s *EventStream) SetExternalId(v string) *EventStream { + s.ExternalId = &v return s } -// SetSilentPush sets the SilentPush field's value. -func (s *DefaultPushNotificationMessage) SetSilentPush(v bool) *DefaultPushNotificationMessage { - s.SilentPush = &v +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *EventStream) SetLastModifiedDate(v string) *EventStream { + s.LastModifiedDate = &v return s } -// SetSubstitutions sets the Substitutions field's value. -func (s *DefaultPushNotificationMessage) SetSubstitutions(v map[string][]*string) *DefaultPushNotificationMessage { - s.Substitutions = v +// SetLastUpdatedBy sets the LastUpdatedBy field's value. +func (s *EventStream) SetLastUpdatedBy(v string) *EventStream { + s.LastUpdatedBy = &v return s } -// SetTitle sets the Title field's value. -func (s *DefaultPushNotificationMessage) SetTitle(v string) *DefaultPushNotificationMessage { - s.Title = &v +// SetRoleArn sets the RoleArn field's value. +func (s *EventStream) SetRoleArn(v string) *EventStream { + s.RoleArn = &v return s } -// SetUrl sets the Url field's value. -func (s *DefaultPushNotificationMessage) SetUrl(v string) *DefaultPushNotificationMessage { - s.Url = &v +// Specifies a batch of endpoints and events to process. +type EventsBatch struct { + _ struct{} `type:"structure"` + + // A set of properties and attributes that are associated with the endpoint. + // + // Endpoint is a required field + Endpoint *PublicEndpoint `type:"structure" required:"true"` + + // A set of properties that are associated with the event. + // + // Events is a required field + Events map[string]*Event `type:"map" required:"true"` +} + +// String returns the string representation +func (s EventsBatch) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EventsBatch) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *EventsBatch) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EventsBatch"} + if s.Endpoint == nil { + invalidParams.Add(request.NewErrParamRequired("Endpoint")) + } + if s.Events == nil { + invalidParams.Add(request.NewErrParamRequired("Events")) + } + if s.Events != nil { + for i, v := range s.Events { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Events", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEndpoint sets the Endpoint field's value. +func (s *EventsBatch) SetEndpoint(v *PublicEndpoint) *EventsBatch { + s.Endpoint = v return s } -type DeleteAdmChannelInput struct { +// SetEvents sets the Events field's value. +func (s *EventsBatch) SetEvents(v map[string]*Event) *EventsBatch { + s.Events = v + return s +} + +// Specifies a batch of events to process. +type EventsRequest struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The batch of events to process. For each item in a batch, the endpoint ID + // acts as a key that has an EventsBatch object as its value. + // + // BatchItem is a required field + BatchItem map[string]*EventsBatch `type:"map" required:"true"` } // String returns the string representation -func (s DeleteAdmChannelInput) String() string { +func (s EventsRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteAdmChannelInput) GoString() string { +func (s EventsRequest) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAdmChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAdmChannelInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) +func (s *EventsRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EventsRequest"} + if s.BatchItem == nil { + invalidParams.Add(request.NewErrParamRequired("BatchItem")) } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + if s.BatchItem != nil { + for i, v := range s.BatchItem { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "BatchItem", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -11367,63 +18729,88 @@ func (s *DeleteAdmChannelInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteAdmChannelInput) SetApplicationId(v string) *DeleteAdmChannelInput { - s.ApplicationId = &v +// SetBatchItem sets the BatchItem field's value. +func (s *EventsRequest) SetBatchItem(v map[string]*EventsBatch) *EventsRequest { + s.BatchItem = v return s } -type DeleteAdmChannelOutput struct { - _ struct{} `type:"structure" payload:"ADMChannelResponse"` +// Provides information about endpoints and the events that they're associated +// with. +type EventsResponse struct { + _ struct{} `type:"structure"` - // Provides information about the status and settings of the ADM (Amazon Device - // Messaging) channel for an application. - // - // ADMChannelResponse is a required field - ADMChannelResponse *ADMChannelResponse `type:"structure" required:"true"` + // A map that contains a multipart response for each endpoint. For each item + // in this object, the endpoint ID is the key and the item response is the value. + // If no item response exists, the value can also be one of the following: 202, + // the request was processed successfully; or 400, the payload wasn't valid + // or required fields were missing. + Results map[string]*ItemResponse `type:"map"` } // String returns the string representation -func (s DeleteAdmChannelOutput) String() string { +func (s EventsResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteAdmChannelOutput) GoString() string { +func (s EventsResponse) GoString() string { return s.String() } -// SetADMChannelResponse sets the ADMChannelResponse field's value. -func (s *DeleteAdmChannelOutput) SetADMChannelResponse(v *ADMChannelResponse) *DeleteAdmChannelOutput { - s.ADMChannelResponse = v +// SetResults sets the Results field's value. +func (s *EventsResponse) SetResults(v map[string]*ItemResponse) *EventsResponse { + s.Results = v return s } -type DeleteApnsChannelInput struct { +// Specifies the settings for a job that exports endpoint definitions to an +// Amazon Simple Storage Service (Amazon S3) bucket. +type ExportJobRequest struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The Amazon Resource Name (ARN) of the AWS Identity and Access Management + // (IAM) role that authorizes Amazon Pinpoint to access the Amazon S3 location + // where you want to export endpoint definitions to. + // + // RoleArn is a required field + RoleArn *string `type:"string" required:"true"` + + // The URL of the location in an Amazon Simple Storage Service (Amazon S3) bucket + // where you want to export endpoint definitions to. This location is typically + // a folder that contains multiple files. The URL should be in the following + // format: s3://bucket-name/folder-name/. + // + // S3UrlPrefix is a required field + S3UrlPrefix *string `type:"string" required:"true"` + + // The identifier for the segment to export endpoint definitions from. If you + // don't specify this value, Amazon Pinpoint exports definitions for all the + // endpoints that are associated with the application. + SegmentId *string `type:"string"` + + // The version of the segment to export endpoint definitions from, if specified. + SegmentVersion *int64 `type:"integer"` } // String returns the string representation -func (s DeleteApnsChannelInput) String() string { +func (s ExportJobRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteApnsChannelInput) GoString() string { +func (s ExportJobRequest) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteApnsChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteApnsChannelInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) +func (s *ExportJobRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ExportJobRequest"} + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + if s.S3UrlPrefix == nil { + invalidParams.Add(request.NewErrParamRequired("S3UrlPrefix")) } if invalidParams.Len() > 0 { @@ -11432,258 +18819,380 @@ func (s *DeleteApnsChannelInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteApnsChannelInput) SetApplicationId(v string) *DeleteApnsChannelInput { - s.ApplicationId = &v +// SetRoleArn sets the RoleArn field's value. +func (s *ExportJobRequest) SetRoleArn(v string) *ExportJobRequest { + s.RoleArn = &v return s } -type DeleteApnsChannelOutput struct { - _ struct{} `type:"structure" payload:"APNSChannelResponse"` +// SetS3UrlPrefix sets the S3UrlPrefix field's value. +func (s *ExportJobRequest) SetS3UrlPrefix(v string) *ExportJobRequest { + s.S3UrlPrefix = &v + return s +} - // Provides information about the status and settings of the APNs (Apple Push - // Notification service) channel for an application. +// SetSegmentId sets the SegmentId field's value. +func (s *ExportJobRequest) SetSegmentId(v string) *ExportJobRequest { + s.SegmentId = &v + return s +} + +// SetSegmentVersion sets the SegmentVersion field's value. +func (s *ExportJobRequest) SetSegmentVersion(v int64) *ExportJobRequest { + s.SegmentVersion = &v + return s +} + +// Provides information about the resource settings for a job that exports endpoint +// definitions to a file. The file can be added directly to an Amazon Simple +// Storage Service (Amazon S3) bucket by using the Amazon Pinpoint API or downloaded +// directly to a computer by using the Amazon Pinpoint console. +type ExportJobResource struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the AWS Identity and Access Management + // (IAM) role that authorized Amazon Pinpoint to access the Amazon S3 location + // where the endpoint definitions were exported to. // - // APNSChannelResponse is a required field - APNSChannelResponse *APNSChannelResponse `type:"structure" required:"true"` + // RoleArn is a required field + RoleArn *string `type:"string" required:"true"` + + // The URL of the location in an Amazon Simple Storage Service (Amazon S3) bucket + // where the endpoint definitions were exported to. This location is typically + // a folder that contains multiple files. The URL should be in the following + // format: s3://bucket-name/folder-name/. + // + // S3UrlPrefix is a required field + S3UrlPrefix *string `type:"string" required:"true"` + + // The identifier for the segment that the endpoint definitions were exported + // from. If this value isn't present, Amazon Pinpoint exported definitions for + // all the endpoints that are associated with the application. + SegmentId *string `type:"string"` + + // The version of the segment that the endpoint definitions were exported from. + SegmentVersion *int64 `type:"integer"` } // String returns the string representation -func (s DeleteApnsChannelOutput) String() string { +func (s ExportJobResource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteApnsChannelOutput) GoString() string { +func (s ExportJobResource) GoString() string { return s.String() } -// SetAPNSChannelResponse sets the APNSChannelResponse field's value. -func (s *DeleteApnsChannelOutput) SetAPNSChannelResponse(v *APNSChannelResponse) *DeleteApnsChannelOutput { - s.APNSChannelResponse = v +// SetRoleArn sets the RoleArn field's value. +func (s *ExportJobResource) SetRoleArn(v string) *ExportJobResource { + s.RoleArn = &v return s } -type DeleteApnsSandboxChannelInput struct { +// SetS3UrlPrefix sets the S3UrlPrefix field's value. +func (s *ExportJobResource) SetS3UrlPrefix(v string) *ExportJobResource { + s.S3UrlPrefix = &v + return s +} + +// SetSegmentId sets the SegmentId field's value. +func (s *ExportJobResource) SetSegmentId(v string) *ExportJobResource { + s.SegmentId = &v + return s +} + +// SetSegmentVersion sets the SegmentVersion field's value. +func (s *ExportJobResource) SetSegmentVersion(v int64) *ExportJobResource { + s.SegmentVersion = &v + return s +} + +// Provides information about the status and settings of a job that exports +// endpoint definitions to a file. The file can be added directly to an Amazon +// Simple Storage Service (Amazon S3) bucket by using the Amazon Pinpoint API +// or downloaded directly to a computer by using the Amazon Pinpoint console. +type ExportJobResponse struct { _ struct{} `type:"structure"` + // The unique identifier for the application that's associated with the export + // job. + // // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + ApplicationId *string `type:"string" required:"true"` + + // The number of pieces that were processed successfully (completed) by the + // export job, as of the time of the request. + CompletedPieces *int64 `type:"integer"` + + // The date, in ISO 8601 format, when the export job was completed. + CompletionDate *string `type:"string"` + + // The date, in ISO 8601 format, when the export job was created. + // + // CreationDate is a required field + CreationDate *string `type:"string" required:"true"` + + // The resource settings that apply to the export job. + // + // Definition is a required field + Definition *ExportJobResource `type:"structure" required:"true"` + + // The number of pieces that weren't processed successfully (failed) by the + // export job, as of the time of the request. + FailedPieces *int64 `type:"integer"` + + // An array of entries, one for each of the first 100 entries that weren't processed + // successfully (failed) by the export job, if any. + Failures []*string `type:"list"` + + // The unique identifier for the export job. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // The status of the export job. The job status is FAILED if Amazon Pinpoint + // wasn't able to process one or more pieces in the job. + // + // JobStatus is a required field + JobStatus *string `type:"string" required:"true" enum:"JobStatus"` + + // The total number of endpoint definitions that weren't processed successfully + // (failed) by the export job, typically because an error, such as a syntax + // error, occurred. + TotalFailures *int64 `type:"integer"` + + // The total number of pieces that must be processed to complete the export + // job. Each piece consists of an approximately equal portion of the endpoint + // definitions that are part of the export job. + TotalPieces *int64 `type:"integer"` + + // The total number of endpoint definitions that were processed by the export + // job. + TotalProcessed *int64 `type:"integer"` + + // The job type. This value is EXPORT for export jobs. + // + // Type is a required field + Type *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteApnsSandboxChannelInput) String() string { +func (s ExportJobResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteApnsSandboxChannelInput) GoString() string { +func (s ExportJobResponse) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteApnsSandboxChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteApnsSandboxChannelInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - // SetApplicationId sets the ApplicationId field's value. -func (s *DeleteApnsSandboxChannelInput) SetApplicationId(v string) *DeleteApnsSandboxChannelInput { +func (s *ExportJobResponse) SetApplicationId(v string) *ExportJobResponse { s.ApplicationId = &v return s } -type DeleteApnsSandboxChannelOutput struct { - _ struct{} `type:"structure" payload:"APNSSandboxChannelResponse"` +// SetCompletedPieces sets the CompletedPieces field's value. +func (s *ExportJobResponse) SetCompletedPieces(v int64) *ExportJobResponse { + s.CompletedPieces = &v + return s +} - // Provides information about the status and settings of the APNs (Apple Push - // Notification service) sandbox channel for an application. - // - // APNSSandboxChannelResponse is a required field - APNSSandboxChannelResponse *APNSSandboxChannelResponse `type:"structure" required:"true"` +// SetCompletionDate sets the CompletionDate field's value. +func (s *ExportJobResponse) SetCompletionDate(v string) *ExportJobResponse { + s.CompletionDate = &v + return s } -// String returns the string representation -func (s DeleteApnsSandboxChannelOutput) String() string { - return awsutil.Prettify(s) +// SetCreationDate sets the CreationDate field's value. +func (s *ExportJobResponse) SetCreationDate(v string) *ExportJobResponse { + s.CreationDate = &v + return s } -// GoString returns the string representation -func (s DeleteApnsSandboxChannelOutput) GoString() string { - return s.String() +// SetDefinition sets the Definition field's value. +func (s *ExportJobResponse) SetDefinition(v *ExportJobResource) *ExportJobResponse { + s.Definition = v + return s } -// SetAPNSSandboxChannelResponse sets the APNSSandboxChannelResponse field's value. -func (s *DeleteApnsSandboxChannelOutput) SetAPNSSandboxChannelResponse(v *APNSSandboxChannelResponse) *DeleteApnsSandboxChannelOutput { - s.APNSSandboxChannelResponse = v +// SetFailedPieces sets the FailedPieces field's value. +func (s *ExportJobResponse) SetFailedPieces(v int64) *ExportJobResponse { + s.FailedPieces = &v return s } -type DeleteApnsVoipChannelInput struct { - _ struct{} `type:"structure"` +// SetFailures sets the Failures field's value. +func (s *ExportJobResponse) SetFailures(v []*string) *ExportJobResponse { + s.Failures = v + return s +} - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +// SetId sets the Id field's value. +func (s *ExportJobResponse) SetId(v string) *ExportJobResponse { + s.Id = &v + return s } -// String returns the string representation -func (s DeleteApnsVoipChannelInput) String() string { - return awsutil.Prettify(s) +// SetJobStatus sets the JobStatus field's value. +func (s *ExportJobResponse) SetJobStatus(v string) *ExportJobResponse { + s.JobStatus = &v + return s } -// GoString returns the string representation -func (s DeleteApnsVoipChannelInput) GoString() string { - return s.String() +// SetTotalFailures sets the TotalFailures field's value. +func (s *ExportJobResponse) SetTotalFailures(v int64) *ExportJobResponse { + s.TotalFailures = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteApnsVoipChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteApnsVoipChannelInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } +// SetTotalPieces sets the TotalPieces field's value. +func (s *ExportJobResponse) SetTotalPieces(v int64) *ExportJobResponse { + s.TotalPieces = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetTotalProcessed sets the TotalProcessed field's value. +func (s *ExportJobResponse) SetTotalProcessed(v int64) *ExportJobResponse { + s.TotalProcessed = &v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteApnsVoipChannelInput) SetApplicationId(v string) *DeleteApnsVoipChannelInput { - s.ApplicationId = &v +// SetType sets the Type field's value. +func (s *ExportJobResponse) SetType(v string) *ExportJobResponse { + s.Type = &v return s } -type DeleteApnsVoipChannelOutput struct { - _ struct{} `type:"structure" payload:"APNSVoipChannelResponse"` +// Provides information about all the export jobs that are associated with an +// application or segment. An export job is a job that exports endpoint definitions +// to a file. +type ExportJobsResponse struct { + _ struct{} `type:"structure"` - // Provides information about the status and settings of the APNs (Apple Push - // Notification service) VoIP channel for an application. + // An array of responses, one for each export job that's associated with the + // application (Export Jobs resource) or segment (Segment Export Jobs resource). // - // APNSVoipChannelResponse is a required field - APNSVoipChannelResponse *APNSVoipChannelResponse `type:"structure" required:"true"` + // Item is a required field + Item []*ExportJobResponse `type:"list" required:"true"` + + // The string to use in a subsequent request to get the next page of results + // in a paginated response. This value is null if there are no additional pages. + NextToken *string `type:"string"` } // String returns the string representation -func (s DeleteApnsVoipChannelOutput) String() string { +func (s ExportJobsResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteApnsVoipChannelOutput) GoString() string { +func (s ExportJobsResponse) GoString() string { return s.String() } -// SetAPNSVoipChannelResponse sets the APNSVoipChannelResponse field's value. -func (s *DeleteApnsVoipChannelOutput) SetAPNSVoipChannelResponse(v *APNSVoipChannelResponse) *DeleteApnsVoipChannelOutput { - s.APNSVoipChannelResponse = v +// SetItem sets the Item field's value. +func (s *ExportJobsResponse) SetItem(v []*ExportJobResponse) *ExportJobsResponse { + s.Item = v return s } -type DeleteApnsVoipSandboxChannelInput struct { - _ struct{} `type:"structure"` +// SetNextToken sets the NextToken field's value. +func (s *ExportJobsResponse) SetNextToken(v string) *ExportJobsResponse { + s.NextToken = &v + return s +} - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +// Provides information about an API request or response. +type ForbiddenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + RequestID_ *string `locationName:"RequestID" type:"string"` } // String returns the string representation -func (s DeleteApnsVoipSandboxChannelInput) String() string { +func (s ForbiddenException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteApnsVoipSandboxChannelInput) GoString() string { +func (s ForbiddenException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteApnsVoipSandboxChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteApnsVoipSandboxChannelInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams +func newErrorForbiddenException(v protocol.ResponseMetadata) error { + return &ForbiddenException{ + respMetadata: v, } - return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteApnsVoipSandboxChannelInput) SetApplicationId(v string) *DeleteApnsVoipSandboxChannelInput { - s.ApplicationId = &v - return s +// Code returns the exception type name. +func (s ForbiddenException) Code() string { + return "ForbiddenException" } -type DeleteApnsVoipSandboxChannelOutput struct { - _ struct{} `type:"structure" payload:"APNSVoipSandboxChannelResponse"` +// Message returns the exception's message. +func (s ForbiddenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Provides information about the status and settings of the APNs (Apple Push - // Notification service) VoIP sandbox channel for an application. - // - // APNSVoipSandboxChannelResponse is a required field - APNSVoipSandboxChannelResponse *APNSVoipSandboxChannelResponse `type:"structure" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ForbiddenException) OrigErr() error { + return nil } -// String returns the string representation -func (s DeleteApnsVoipSandboxChannelOutput) String() string { - return awsutil.Prettify(s) +func (s ForbiddenException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// GoString returns the string representation -func (s DeleteApnsVoipSandboxChannelOutput) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s ForbiddenException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetAPNSVoipSandboxChannelResponse sets the APNSVoipSandboxChannelResponse field's value. -func (s *DeleteApnsVoipSandboxChannelOutput) SetAPNSVoipSandboxChannelResponse(v *APNSVoipSandboxChannelResponse) *DeleteApnsVoipSandboxChannelOutput { - s.APNSVoipSandboxChannelResponse = v - return s +// RequestID returns the service's response RequestID for request. +func (s ForbiddenException) RequestID() string { + return s.respMetadata.RequestID } -type DeleteAppInput struct { +// Specifies the status and settings of the GCM channel for an application. +// This channel enables Amazon Pinpoint to send push notifications through the +// Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging (GCM), service. +type GCMChannelRequest struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The Web API Key, also referred to as an API_KEY or server key, that you received + // from Google to communicate with Google services. + // + // ApiKey is a required field + ApiKey *string `type:"string" required:"true"` + + // Specifies whether to enable the GCM channel for the application. + Enabled *bool `type:"boolean"` } // String returns the string representation -func (s DeleteAppInput) String() string { +func (s GCMChannelRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteAppInput) GoString() string { +func (s GCMChannelRequest) 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.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) +func (s *GCMChannelRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GCMChannelRequest"} + if s.ApiKey == nil { + invalidParams.Add(request.NewErrParamRequired("ApiKey")) } if invalidParams.Len() > 0 { @@ -11692,281 +19201,394 @@ func (s *DeleteAppInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteAppInput) SetApplicationId(v string) *DeleteAppInput { - s.ApplicationId = &v +// SetApiKey sets the ApiKey field's value. +func (s *GCMChannelRequest) SetApiKey(v string) *GCMChannelRequest { + s.ApiKey = &v return s } -type DeleteAppOutput struct { - _ struct{} `type:"structure" payload:"ApplicationResponse"` +// SetEnabled sets the Enabled field's value. +func (s *GCMChannelRequest) SetEnabled(v bool) *GCMChannelRequest { + s.Enabled = &v + return s +} - // Provides information about an application. +// Provides information about the status and settings of the GCM channel for +// an application. The GCM channel enables Amazon Pinpoint to send push notifications +// through the Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging +// (GCM), service. +type GCMChannelResponse struct { + _ struct{} `type:"structure"` + + // The unique identifier for the application that the GCM channel applies to. + ApplicationId *string `type:"string"` + + // The date and time when the GCM channel was enabled. + CreationDate *string `type:"string"` + + // The Web API Key, also referred to as an API_KEY or server key, that you received + // from Google to communicate with Google services. // - // ApplicationResponse is a required field - ApplicationResponse *ApplicationResponse `type:"structure" required:"true"` + // Credential is a required field + Credential *string `type:"string" required:"true"` + + // Specifies whether the GCM channel is enabled for the application. + Enabled *bool `type:"boolean"` + + // (Not used) This property is retained only for backward compatibility. + HasCredential *bool `type:"boolean"` + + // (Deprecated) An identifier for the GCM channel. This property is retained + // only for backward compatibility. + Id *string `type:"string"` + + // Specifies whether the GCM channel is archived. + IsArchived *bool `type:"boolean"` + + // The user who last modified the GCM channel. + LastModifiedBy *string `type:"string"` + + // The date and time when the GCM channel was last modified. + LastModifiedDate *string `type:"string"` + + // The type of messaging or notification platform for the channel. For the GCM + // channel, this value is GCM. + // + // Platform is a required field + Platform *string `type:"string" required:"true"` + + // The current version of the GCM channel. + Version *int64 `type:"integer"` } // String returns the string representation -func (s DeleteAppOutput) String() string { +func (s GCMChannelResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteAppOutput) GoString() string { +func (s GCMChannelResponse) GoString() string { return s.String() } -// SetApplicationResponse sets the ApplicationResponse field's value. -func (s *DeleteAppOutput) SetApplicationResponse(v *ApplicationResponse) *DeleteAppOutput { - s.ApplicationResponse = v +// SetApplicationId sets the ApplicationId field's value. +func (s *GCMChannelResponse) SetApplicationId(v string) *GCMChannelResponse { + s.ApplicationId = &v return s } -type DeleteBaiduChannelInput struct { - _ struct{} `type:"structure"` - - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +// SetCreationDate sets the CreationDate field's value. +func (s *GCMChannelResponse) SetCreationDate(v string) *GCMChannelResponse { + s.CreationDate = &v + return s } -// String returns the string representation -func (s DeleteBaiduChannelInput) String() string { - return awsutil.Prettify(s) +// SetCredential sets the Credential field's value. +func (s *GCMChannelResponse) SetCredential(v string) *GCMChannelResponse { + s.Credential = &v + return s } -// GoString returns the string representation -func (s DeleteBaiduChannelInput) GoString() string { - return s.String() +// SetEnabled sets the Enabled field's value. +func (s *GCMChannelResponse) SetEnabled(v bool) *GCMChannelResponse { + s.Enabled = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBaiduChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBaiduChannelInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetHasCredential sets the HasCredential field's value. +func (s *GCMChannelResponse) SetHasCredential(v bool) *GCMChannelResponse { + s.HasCredential = &v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteBaiduChannelInput) SetApplicationId(v string) *DeleteBaiduChannelInput { - s.ApplicationId = &v +// SetId sets the Id field's value. +func (s *GCMChannelResponse) SetId(v string) *GCMChannelResponse { + s.Id = &v return s } -type DeleteBaiduChannelOutput struct { - _ struct{} `type:"structure" payload:"BaiduChannelResponse"` +// SetIsArchived sets the IsArchived field's value. +func (s *GCMChannelResponse) SetIsArchived(v bool) *GCMChannelResponse { + s.IsArchived = &v + return s +} - // Provides information about the status and settings of the Baidu (Baidu Cloud - // Push) channel for an application. - // - // BaiduChannelResponse is a required field - BaiduChannelResponse *BaiduChannelResponse `type:"structure" required:"true"` +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *GCMChannelResponse) SetLastModifiedBy(v string) *GCMChannelResponse { + s.LastModifiedBy = &v + return s } -// String returns the string representation -func (s DeleteBaiduChannelOutput) String() string { - return awsutil.Prettify(s) +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *GCMChannelResponse) SetLastModifiedDate(v string) *GCMChannelResponse { + s.LastModifiedDate = &v + return s } -// GoString returns the string representation -func (s DeleteBaiduChannelOutput) GoString() string { - return s.String() +// SetPlatform sets the Platform field's value. +func (s *GCMChannelResponse) SetPlatform(v string) *GCMChannelResponse { + s.Platform = &v + return s } -// SetBaiduChannelResponse sets the BaiduChannelResponse field's value. -func (s *DeleteBaiduChannelOutput) SetBaiduChannelResponse(v *BaiduChannelResponse) *DeleteBaiduChannelOutput { - s.BaiduChannelResponse = v +// SetVersion sets the Version field's value. +func (s *GCMChannelResponse) SetVersion(v int64) *GCMChannelResponse { + s.Version = &v return s } -type DeleteCampaignInput struct { +// Specifies the settings for a one-time message that's sent directly to an +// endpoint through the GCM channel. The GCM channel enables Amazon Pinpoint +// to send messages to the Firebase Cloud Messaging (FCM), formerly Google Cloud +// Messaging (GCM), service. +type GCMMessage struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The action to occur if the recipient taps the push notification. Valid values + // are: + // + // * OPEN_APP - Your app opens or it becomes the foreground app if it was + // sent to the background. This is the default action. + // + // * DEEP_LINK - Your app opens and displays a designated user interface + // in the app. This action uses the deep-linking features of the Android + // platform. + // + // * URL - The default mobile browser on the recipient's device opens and + // loads the web page at a URL that you specify. + Action *string `type:"string" enum:"Action"` - // CampaignId is a required field - CampaignId *string `location:"uri" locationName:"campaign-id" type:"string" required:"true"` + // The body of the notification message. + Body *string `type:"string"` + + // An arbitrary string that identifies a group of messages that can be collapsed + // to ensure that only the last message is sent when delivery can resume. This + // helps avoid sending too many instances of the same messages when the recipient's + // device comes online again or becomes active. + // + // Amazon Pinpoint specifies this value in the Firebase Cloud Messaging (FCM) + // collapse_key parameter when it sends the notification message to FCM. + CollapseKey *string `type:"string"` + + // The JSON data payload to use for the push notification, if the notification + // is a silent push notification. This payload is added to the data.pinpoint.jsonBody + // object of the notification. + Data map[string]*string `type:"map"` + + // The icon image name of the asset saved in your app. + IconReference *string `type:"string"` + + // The URL of the large icon image to display in the content view of the push + // notification. + ImageIconUrl *string `type:"string"` + + // The URL of an image to display in the push notification. + ImageUrl *string `type:"string"` + + // para>normal - The notification might be delayed. Delivery is optimized for + // battery usage on the recipient's device. Use this value unless immediate + // delivery is required. + // /listitem> + // high - The notification is sent immediately and might wake a sleeping device. + // /para> + // Amazon Pinpoint specifies this value in the FCM priority parameter when it + // sends the notification message to FCM. + // + // The equivalent values for Apple Push Notification service (APNs) are 5, for + // normal, and 10, for high. If you specify an APNs value for this property, + // Amazon Pinpoint accepts and converts the value to the corresponding FCM value. + Priority *string `type:"string"` + + // The raw, JSON-formatted string to use as the payload for the notification + // message. If specified, this value overrides all other content for the message. + RawContent *string `type:"string"` + + // The package name of the application where registration tokens must match + // in order for the recipient to receive the message. + RestrictedPackageName *string `type:"string"` + + // Specifies whether the notification is a silent push notification, which is + // a push notification that doesn't display on a recipient's device. Silent + // push notifications can be used for cases such as updating an app's configuration + // or supporting phone home functionality. + SilentPush *bool `type:"boolean"` + + // The URL of the small icon image to display in the status bar and the content + // view of the push notification. + SmallImageIconUrl *string `type:"string"` + + // The sound to play when the recipient receives the push notification. You + // can use the default stream or specify the file name of a sound resource that's + // bundled in your app. On an Android platform, the sound file must reside in + // /res/raw/. + Sound *string `type:"string"` + + // The default message variables to use in the notification message. You can + // override the default variables with individual address variables. + Substitutions map[string][]*string `type:"map"` + + // The amount of time, in seconds, that FCM should store and attempt to deliver + // the push notification, if the service is unable to deliver the notification + // the first time. If you don't specify this value, FCM defaults to the maximum + // value, which is 2,419,200 seconds (28 days). + // + // Amazon Pinpoint specifies this value in the FCM time_to_live parameter when + // it sends the notification message to FCM. + TimeToLive *int64 `type:"integer"` + + // The title to display above the notification message on the recipient's device. + Title *string `type:"string"` + + // The URL to open in the recipient's default mobile browser, if a recipient + // taps the push notification and the value of the Action property is URL. + Url *string `type:"string"` } // String returns the string representation -func (s DeleteCampaignInput) String() string { +func (s GCMMessage) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteCampaignInput) GoString() string { +func (s GCMMessage) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCampaignInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCampaignInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.CampaignId == nil { - invalidParams.Add(request.NewErrParamRequired("CampaignId")) - } - if s.CampaignId != nil && len(*s.CampaignId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CampaignId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteCampaignInput) SetApplicationId(v string) *DeleteCampaignInput { - s.ApplicationId = &v +// SetAction sets the Action field's value. +func (s *GCMMessage) SetAction(v string) *GCMMessage { + s.Action = &v return s } -// SetCampaignId sets the CampaignId field's value. -func (s *DeleteCampaignInput) SetCampaignId(v string) *DeleteCampaignInput { - s.CampaignId = &v +// SetBody sets the Body field's value. +func (s *GCMMessage) SetBody(v string) *GCMMessage { + s.Body = &v return s } -type DeleteCampaignOutput struct { - _ struct{} `type:"structure" payload:"CampaignResponse"` - - // Provides information about the status, configuration, and other settings - // for a campaign. - // - // CampaignResponse is a required field - CampaignResponse *CampaignResponse `type:"structure" required:"true"` -} - -// String returns the string representation -func (s DeleteCampaignOutput) String() string { - return awsutil.Prettify(s) +// SetCollapseKey sets the CollapseKey field's value. +func (s *GCMMessage) SetCollapseKey(v string) *GCMMessage { + s.CollapseKey = &v + return s } -// GoString returns the string representation -func (s DeleteCampaignOutput) GoString() string { - return s.String() +// SetData sets the Data field's value. +func (s *GCMMessage) SetData(v map[string]*string) *GCMMessage { + s.Data = v + return s } -// SetCampaignResponse sets the CampaignResponse field's value. -func (s *DeleteCampaignOutput) SetCampaignResponse(v *CampaignResponse) *DeleteCampaignOutput { - s.CampaignResponse = v +// SetIconReference sets the IconReference field's value. +func (s *GCMMessage) SetIconReference(v string) *GCMMessage { + s.IconReference = &v return s } -type DeleteEmailChannelInput struct { - _ struct{} `type:"structure"` +// SetImageIconUrl sets the ImageIconUrl field's value. +func (s *GCMMessage) SetImageIconUrl(v string) *GCMMessage { + s.ImageIconUrl = &v + return s +} - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +// SetImageUrl sets the ImageUrl field's value. +func (s *GCMMessage) SetImageUrl(v string) *GCMMessage { + s.ImageUrl = &v + return s } -// String returns the string representation -func (s DeleteEmailChannelInput) String() string { - return awsutil.Prettify(s) +// SetPriority sets the Priority field's value. +func (s *GCMMessage) SetPriority(v string) *GCMMessage { + s.Priority = &v + return s } -// GoString returns the string representation -func (s DeleteEmailChannelInput) GoString() string { - return s.String() +// SetRawContent sets the RawContent field's value. +func (s *GCMMessage) SetRawContent(v string) *GCMMessage { + s.RawContent = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEmailChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEmailChannelInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } +// SetRestrictedPackageName sets the RestrictedPackageName field's value. +func (s *GCMMessage) SetRestrictedPackageName(v string) *GCMMessage { + s.RestrictedPackageName = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetSilentPush sets the SilentPush field's value. +func (s *GCMMessage) SetSilentPush(v bool) *GCMMessage { + s.SilentPush = &v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteEmailChannelInput) SetApplicationId(v string) *DeleteEmailChannelInput { - s.ApplicationId = &v +// SetSmallImageIconUrl sets the SmallImageIconUrl field's value. +func (s *GCMMessage) SetSmallImageIconUrl(v string) *GCMMessage { + s.SmallImageIconUrl = &v return s } -type DeleteEmailChannelOutput struct { - _ struct{} `type:"structure" payload:"EmailChannelResponse"` +// SetSound sets the Sound field's value. +func (s *GCMMessage) SetSound(v string) *GCMMessage { + s.Sound = &v + return s +} - // Provides information about the status and settings of the email channel for - // an application. - // - // EmailChannelResponse is a required field - EmailChannelResponse *EmailChannelResponse `type:"structure" required:"true"` +// SetSubstitutions sets the Substitutions field's value. +func (s *GCMMessage) SetSubstitutions(v map[string][]*string) *GCMMessage { + s.Substitutions = v + return s } -// String returns the string representation -func (s DeleteEmailChannelOutput) String() string { - return awsutil.Prettify(s) +// SetTimeToLive sets the TimeToLive field's value. +func (s *GCMMessage) SetTimeToLive(v int64) *GCMMessage { + s.TimeToLive = &v + return s } -// GoString returns the string representation -func (s DeleteEmailChannelOutput) GoString() string { - return s.String() +// SetTitle sets the Title field's value. +func (s *GCMMessage) SetTitle(v string) *GCMMessage { + s.Title = &v + return s } -// SetEmailChannelResponse sets the EmailChannelResponse field's value. -func (s *DeleteEmailChannelOutput) SetEmailChannelResponse(v *EmailChannelResponse) *DeleteEmailChannelOutput { - s.EmailChannelResponse = v +// SetUrl sets the Url field's value. +func (s *GCMMessage) SetUrl(v string) *GCMMessage { + s.Url = &v return s } -type DeleteEndpointInput struct { +// Specifies the GPS coordinates of a location. +type GPSCoordinates struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The latitude coordinate of the location. + // + // Latitude is a required field + Latitude *float64 `type:"double" required:"true"` - // EndpointId is a required field - EndpointId *string `location:"uri" locationName:"endpoint-id" type:"string" required:"true"` + // The longitude coordinate of the location. + // + // Longitude is a required field + Longitude *float64 `type:"double" required:"true"` } // String returns the string representation -func (s DeleteEndpointInput) String() string { +func (s GPSCoordinates) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteEndpointInput) GoString() string { +func (s GPSCoordinates) 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.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.EndpointId == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointId")) +func (s *GPSCoordinates) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GPSCoordinates"} + if s.Latitude == nil { + invalidParams.Add(request.NewErrParamRequired("Latitude")) } - if s.EndpointId != nil && len(*s.EndpointId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EndpointId", 1)) + if s.Longitude == nil { + invalidParams.Add(request.NewErrParamRequired("Longitude")) } if invalidParams.Len() > 0 { @@ -11975,68 +19597,52 @@ func (s *DeleteEndpointInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteEndpointInput) SetApplicationId(v string) *DeleteEndpointInput { - s.ApplicationId = &v +// SetLatitude sets the Latitude field's value. +func (s *GPSCoordinates) SetLatitude(v float64) *GPSCoordinates { + s.Latitude = &v return s } -// SetEndpointId sets the EndpointId field's value. -func (s *DeleteEndpointInput) SetEndpointId(v string) *DeleteEndpointInput { - s.EndpointId = &v +// SetLongitude sets the Longitude field's value. +func (s *GPSCoordinates) SetLongitude(v float64) *GPSCoordinates { + s.Longitude = &v return s } -type DeleteEndpointOutput struct { - _ struct{} `type:"structure" payload:"EndpointResponse"` +// Specifies GPS-based criteria for including or excluding endpoints from a +// segment. +type GPSPointDimension struct { + _ struct{} `type:"structure"` - // Provides information about the channel type and other settings for an endpoint. + // The GPS coordinates to measure distance from. // - // EndpointResponse is a required field - EndpointResponse *EndpointResponse `type:"structure" required:"true"` -} - -// 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() -} - -// SetEndpointResponse sets the EndpointResponse field's value. -func (s *DeleteEndpointOutput) SetEndpointResponse(v *EndpointResponse) *DeleteEndpointOutput { - s.EndpointResponse = v - return s -} - -type DeleteEventStreamInput struct { - _ struct{} `type:"structure"` + // Coordinates is a required field + Coordinates *GPSCoordinates `type:"structure" required:"true"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The range, in kilometers, from the GPS coordinates. + RangeInKilometers *float64 `type:"double"` } // String returns the string representation -func (s DeleteEventStreamInput) String() string { +func (s GPSPointDimension) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteEventStreamInput) GoString() string { +func (s GPSPointDimension) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEventStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEventStreamInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) +func (s *GPSPointDimension) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GPSPointDimension"} + if s.Coordinates == nil { + invalidParams.Add(request.NewErrParamRequired("Coordinates")) } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + if s.Coordinates != nil { + if err := s.Coordinates.Validate(); err != nil { + invalidParams.AddNested("Coordinates", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -12045,39 +19651,19 @@ func (s *DeleteEventStreamInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *DeleteEventStreamInput) SetApplicationId(v string) *DeleteEventStreamInput { - s.ApplicationId = &v +// SetCoordinates sets the Coordinates field's value. +func (s *GPSPointDimension) SetCoordinates(v *GPSCoordinates) *GPSPointDimension { + s.Coordinates = v return s } -type DeleteEventStreamOutput struct { - _ struct{} `type:"structure" payload:"EventStream"` - - // Specifies settings for publishing event data to an Amazon Kinesis data stream - // or an Amazon Kinesis Data Firehose delivery stream. - // - // EventStream is a required field - EventStream *EventStream `type:"structure" required:"true"` -} - -// String returns the string representation -func (s DeleteEventStreamOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteEventStreamOutput) GoString() string { - return s.String() -} - -// SetEventStream sets the EventStream field's value. -func (s *DeleteEventStreamOutput) SetEventStream(v *EventStream) *DeleteEventStreamOutput { - s.EventStream = v +// SetRangeInKilometers sets the RangeInKilometers field's value. +func (s *GPSPointDimension) SetRangeInKilometers(v float64) *GPSPointDimension { + s.RangeInKilometers = &v return s } -type DeleteGcmChannelInput struct { +type GetAdmChannelInput struct { _ struct{} `type:"structure"` // ApplicationId is a required field @@ -12085,18 +19671,18 @@ type DeleteGcmChannelInput struct { } // String returns the string representation -func (s DeleteGcmChannelInput) String() string { +func (s GetAdmChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteGcmChannelInput) GoString() string { +func (s GetAdmChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteGcmChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteGcmChannelInput"} +func (s *GetAdmChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAdmChannelInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } @@ -12111,74 +19697,63 @@ func (s *DeleteGcmChannelInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *DeleteGcmChannelInput) SetApplicationId(v string) *DeleteGcmChannelInput { +func (s *GetAdmChannelInput) SetApplicationId(v string) *GetAdmChannelInput { s.ApplicationId = &v return s } -type DeleteGcmChannelOutput struct { - _ struct{} `type:"structure" payload:"GCMChannelResponse"` +type GetAdmChannelOutput struct { + _ struct{} `type:"structure" payload:"ADMChannelResponse"` - // Provides information about the status and settings of the GCM channel for - // an application. The GCM channel enables Amazon Pinpoint to send push notifications - // through the Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging - // (GCM), service. + // Provides information about the status and settings of the ADM (Amazon Device + // Messaging) channel for an application. // - // GCMChannelResponse is a required field - GCMChannelResponse *GCMChannelResponse `type:"structure" required:"true"` + // ADMChannelResponse is a required field + ADMChannelResponse *ADMChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s DeleteGcmChannelOutput) String() string { +func (s GetAdmChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteGcmChannelOutput) GoString() string { +func (s GetAdmChannelOutput) GoString() string { return s.String() } -// SetGCMChannelResponse sets the GCMChannelResponse field's value. -func (s *DeleteGcmChannelOutput) SetGCMChannelResponse(v *GCMChannelResponse) *DeleteGcmChannelOutput { - s.GCMChannelResponse = v +// SetADMChannelResponse sets the ADMChannelResponse field's value. +func (s *GetAdmChannelOutput) SetADMChannelResponse(v *ADMChannelResponse) *GetAdmChannelOutput { + s.ADMChannelResponse = v return s } -type DeleteSegmentInput struct { +type GetApnsChannelInput struct { _ struct{} `type:"structure"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - - // SegmentId is a required field - SegmentId *string `location:"uri" locationName:"segment-id" type:"string" required:"true"` } // String returns the string representation -func (s DeleteSegmentInput) String() string { +func (s GetApnsChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSegmentInput) GoString() string { +func (s GetApnsChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSegmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSegmentInput"} +func (s *GetApnsChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetApnsChannelInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } - if s.SegmentId == nil { - invalidParams.Add(request.NewErrParamRequired("SegmentId")) - } - if s.SegmentId != nil && len(*s.SegmentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SegmentId", 1)) - } if invalidParams.Len() > 0 { return invalidParams @@ -12187,44 +19762,38 @@ func (s *DeleteSegmentInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *DeleteSegmentInput) SetApplicationId(v string) *DeleteSegmentInput { +func (s *GetApnsChannelInput) SetApplicationId(v string) *GetApnsChannelInput { s.ApplicationId = &v return s } -// SetSegmentId sets the SegmentId field's value. -func (s *DeleteSegmentInput) SetSegmentId(v string) *DeleteSegmentInput { - s.SegmentId = &v - return s -} - -type DeleteSegmentOutput struct { - _ struct{} `type:"structure" payload:"SegmentResponse"` +type GetApnsChannelOutput struct { + _ struct{} `type:"structure" payload:"APNSChannelResponse"` - // Provides information about the configuration, dimension, and other settings - // for a segment. + // Provides information about the status and settings of the APNs (Apple Push + // Notification service) channel for an application. // - // SegmentResponse is a required field - SegmentResponse *SegmentResponse `type:"structure" required:"true"` + // APNSChannelResponse is a required field + APNSChannelResponse *APNSChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s DeleteSegmentOutput) String() string { +func (s GetApnsChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSegmentOutput) GoString() string { +func (s GetApnsChannelOutput) GoString() string { return s.String() } -// SetSegmentResponse sets the SegmentResponse field's value. -func (s *DeleteSegmentOutput) SetSegmentResponse(v *SegmentResponse) *DeleteSegmentOutput { - s.SegmentResponse = v +// SetAPNSChannelResponse sets the APNSChannelResponse field's value. +func (s *GetApnsChannelOutput) SetAPNSChannelResponse(v *APNSChannelResponse) *GetApnsChannelOutput { + s.APNSChannelResponse = v return s } -type DeleteSmsChannelInput struct { +type GetApnsSandboxChannelInput struct { _ struct{} `type:"structure"` // ApplicationId is a required field @@ -12232,18 +19801,18 @@ type DeleteSmsChannelInput struct { } // String returns the string representation -func (s DeleteSmsChannelInput) String() string { +func (s GetApnsSandboxChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSmsChannelInput) GoString() string { +func (s GetApnsSandboxChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteSmsChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteSmsChannelInput"} +func (s *GetApnsSandboxChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetApnsSandboxChannelInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } @@ -12258,72 +19827,63 @@ func (s *DeleteSmsChannelInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *DeleteSmsChannelInput) SetApplicationId(v string) *DeleteSmsChannelInput { +func (s *GetApnsSandboxChannelInput) SetApplicationId(v string) *GetApnsSandboxChannelInput { s.ApplicationId = &v return s } -type DeleteSmsChannelOutput struct { - _ struct{} `type:"structure" payload:"SMSChannelResponse"` +type GetApnsSandboxChannelOutput struct { + _ struct{} `type:"structure" payload:"APNSSandboxChannelResponse"` - // Provides information about the status and settings of the SMS channel for - // an application. + // Provides information about the status and settings of the APNs (Apple Push + // Notification service) sandbox channel for an application. // - // SMSChannelResponse is a required field - SMSChannelResponse *SMSChannelResponse `type:"structure" required:"true"` + // APNSSandboxChannelResponse is a required field + APNSSandboxChannelResponse *APNSSandboxChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s DeleteSmsChannelOutput) String() string { +func (s GetApnsSandboxChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteSmsChannelOutput) GoString() string { +func (s GetApnsSandboxChannelOutput) GoString() string { return s.String() } -// SetSMSChannelResponse sets the SMSChannelResponse field's value. -func (s *DeleteSmsChannelOutput) SetSMSChannelResponse(v *SMSChannelResponse) *DeleteSmsChannelOutput { - s.SMSChannelResponse = v +// SetAPNSSandboxChannelResponse sets the APNSSandboxChannelResponse field's value. +func (s *GetApnsSandboxChannelOutput) SetAPNSSandboxChannelResponse(v *APNSSandboxChannelResponse) *GetApnsSandboxChannelOutput { + s.APNSSandboxChannelResponse = v return s } -type DeleteUserEndpointsInput struct { +type GetApnsVoipChannelInput struct { _ struct{} `type:"structure"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - - // UserId is a required field - UserId *string `location:"uri" locationName:"user-id" type:"string" required:"true"` } // String returns the string representation -func (s DeleteUserEndpointsInput) String() string { +func (s GetApnsVoipChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteUserEndpointsInput) GoString() string { +func (s GetApnsVoipChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteUserEndpointsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteUserEndpointsInput"} +func (s *GetApnsVoipChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetApnsVoipChannelInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } - if s.UserId == nil { - invalidParams.Add(request.NewErrParamRequired("UserId")) - } - if s.UserId != nil && len(*s.UserId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) - } if invalidParams.Len() > 0 { return invalidParams @@ -12332,44 +19892,38 @@ func (s *DeleteUserEndpointsInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *DeleteUserEndpointsInput) SetApplicationId(v string) *DeleteUserEndpointsInput { +func (s *GetApnsVoipChannelInput) SetApplicationId(v string) *GetApnsVoipChannelInput { s.ApplicationId = &v return s } -// SetUserId sets the UserId field's value. -func (s *DeleteUserEndpointsInput) SetUserId(v string) *DeleteUserEndpointsInput { - s.UserId = &v - return s -} - -type DeleteUserEndpointsOutput struct { - _ struct{} `type:"structure" payload:"EndpointsResponse"` +type GetApnsVoipChannelOutput struct { + _ struct{} `type:"structure" payload:"APNSVoipChannelResponse"` - // Provides information about all the endpoints that are associated with a user - // ID. + // Provides information about the status and settings of the APNs (Apple Push + // Notification service) VoIP channel for an application. // - // EndpointsResponse is a required field - EndpointsResponse *EndpointsResponse `type:"structure" required:"true"` + // APNSVoipChannelResponse is a required field + APNSVoipChannelResponse *APNSVoipChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s DeleteUserEndpointsOutput) String() string { +func (s GetApnsVoipChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteUserEndpointsOutput) GoString() string { +func (s GetApnsVoipChannelOutput) GoString() string { return s.String() } -// SetEndpointsResponse sets the EndpointsResponse field's value. -func (s *DeleteUserEndpointsOutput) SetEndpointsResponse(v *EndpointsResponse) *DeleteUserEndpointsOutput { - s.EndpointsResponse = v +// SetAPNSVoipChannelResponse sets the APNSVoipChannelResponse field's value. +func (s *GetApnsVoipChannelOutput) SetAPNSVoipChannelResponse(v *APNSVoipChannelResponse) *GetApnsVoipChannelOutput { + s.APNSVoipChannelResponse = v return s } -type DeleteVoiceChannelInput struct { +type GetApnsVoipSandboxChannelInput struct { _ struct{} `type:"structure"` // ApplicationId is a required field @@ -12377,18 +19931,18 @@ type DeleteVoiceChannelInput struct { } // String returns the string representation -func (s DeleteVoiceChannelInput) String() string { +func (s GetApnsVoipSandboxChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVoiceChannelInput) GoString() string { +func (s GetApnsVoipSandboxChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteVoiceChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteVoiceChannelInput"} +func (s *GetApnsVoipSandboxChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetApnsVoipSandboxChannelInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } @@ -12403,191 +19957,143 @@ func (s *DeleteVoiceChannelInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *DeleteVoiceChannelInput) SetApplicationId(v string) *DeleteVoiceChannelInput { +func (s *GetApnsVoipSandboxChannelInput) SetApplicationId(v string) *GetApnsVoipSandboxChannelInput { s.ApplicationId = &v return s } -type DeleteVoiceChannelOutput struct { - _ struct{} `type:"structure" payload:"VoiceChannelResponse"` +type GetApnsVoipSandboxChannelOutput struct { + _ struct{} `type:"structure" payload:"APNSVoipSandboxChannelResponse"` - // Provides information about the status and settings of the voice channel for - // an application. + // Provides information about the status and settings of the APNs (Apple Push + // Notification service) VoIP sandbox channel for an application. // - // VoiceChannelResponse is a required field - VoiceChannelResponse *VoiceChannelResponse `type:"structure" required:"true"` + // APNSVoipSandboxChannelResponse is a required field + APNSVoipSandboxChannelResponse *APNSVoipSandboxChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s DeleteVoiceChannelOutput) String() string { +func (s GetApnsVoipSandboxChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteVoiceChannelOutput) GoString() string { +func (s GetApnsVoipSandboxChannelOutput) GoString() string { return s.String() } -// SetVoiceChannelResponse sets the VoiceChannelResponse field's value. -func (s *DeleteVoiceChannelOutput) SetVoiceChannelResponse(v *VoiceChannelResponse) *DeleteVoiceChannelOutput { - s.VoiceChannelResponse = v +// SetAPNSVoipSandboxChannelResponse sets the APNSVoipSandboxChannelResponse field's value. +func (s *GetApnsVoipSandboxChannelOutput) SetAPNSVoipSandboxChannelResponse(v *APNSVoipSandboxChannelResponse) *GetApnsVoipSandboxChannelOutput { + s.APNSVoipSandboxChannelResponse = v return s } -// Specifies the settings and content for the default message and any default -// messages that you tailored for specific channels. -type DirectMessageConfiguration struct { +type GetAppInput struct { _ struct{} `type:"structure"` - // The default push notification message for the ADM (Amazon Device Messaging) - // channel. This message overrides the default push notification message (DefaultPushNotificationMessage). - ADMMessage *ADMMessage `type:"structure"` - - // The default push notification message for the APNs (Apple Push Notification - // service) channel. This message overrides the default push notification message - // (DefaultPushNotificationMessage). - APNSMessage *APNSMessage `type:"structure"` - - // The default push notification message for the Baidu (Baidu Cloud Push) channel. - // This message overrides the default push notification message (DefaultPushNotificationMessage). - BaiduMessage *BaiduMessage `type:"structure"` - - // The default message body for all channels. - DefaultMessage *DefaultMessage `type:"structure"` - - // The default push notification message for all push channels. - DefaultPushNotificationMessage *DefaultPushNotificationMessage `type:"structure"` - - // The default message for the email channel. This message overrides the default - // message (DefaultMessage). - EmailMessage *EmailMessage `type:"structure"` - - // The default push notification message for the GCM channel, which is used - // to send notifications through the Firebase Cloud Messaging (FCM), formerly - // Google Cloud Messaging (GCM), service. This message overrides the default - // push notification message (DefaultPushNotificationMessage). - GCMMessage *GCMMessage `type:"structure"` - - // The default message for the SMS channel. This message overrides the default - // message (DefaultMessage). - SMSMessage *SMSMessage `type:"structure"` - - // The default message for the voice channel. This message overrides the default - // message (DefaultMessage). - VoiceMessage *VoiceMessage `type:"structure"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } // String returns the string representation -func (s DirectMessageConfiguration) String() string { +func (s GetAppInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DirectMessageConfiguration) GoString() string { +func (s GetAppInput) GoString() string { return s.String() } -// SetADMMessage sets the ADMMessage field's value. -func (s *DirectMessageConfiguration) SetADMMessage(v *ADMMessage) *DirectMessageConfiguration { - s.ADMMessage = v - return s -} - -// SetAPNSMessage sets the APNSMessage field's value. -func (s *DirectMessageConfiguration) SetAPNSMessage(v *APNSMessage) *DirectMessageConfiguration { - s.APNSMessage = v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAppInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAppInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } -// SetBaiduMessage sets the BaiduMessage field's value. -func (s *DirectMessageConfiguration) SetBaiduMessage(v *BaiduMessage) *DirectMessageConfiguration { - s.BaiduMessage = v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetDefaultMessage sets the DefaultMessage field's value. -func (s *DirectMessageConfiguration) SetDefaultMessage(v *DefaultMessage) *DirectMessageConfiguration { - s.DefaultMessage = v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetAppInput) SetApplicationId(v string) *GetAppInput { + s.ApplicationId = &v return s } -// SetDefaultPushNotificationMessage sets the DefaultPushNotificationMessage field's value. -func (s *DirectMessageConfiguration) SetDefaultPushNotificationMessage(v *DefaultPushNotificationMessage) *DirectMessageConfiguration { - s.DefaultPushNotificationMessage = v - return s -} +type GetAppOutput struct { + _ struct{} `type:"structure" payload:"ApplicationResponse"` -// SetEmailMessage sets the EmailMessage field's value. -func (s *DirectMessageConfiguration) SetEmailMessage(v *EmailMessage) *DirectMessageConfiguration { - s.EmailMessage = v - return s + // Provides information about an application. + // + // ApplicationResponse is a required field + ApplicationResponse *ApplicationResponse `type:"structure" required:"true"` } -// SetGCMMessage sets the GCMMessage field's value. -func (s *DirectMessageConfiguration) SetGCMMessage(v *GCMMessage) *DirectMessageConfiguration { - s.GCMMessage = v - return s +// String returns the string representation +func (s GetAppOutput) String() string { + return awsutil.Prettify(s) } -// SetSMSMessage sets the SMSMessage field's value. -func (s *DirectMessageConfiguration) SetSMSMessage(v *SMSMessage) *DirectMessageConfiguration { - s.SMSMessage = v - return s +// GoString returns the string representation +func (s GetAppOutput) GoString() string { + return s.String() } -// SetVoiceMessage sets the VoiceMessage field's value. -func (s *DirectMessageConfiguration) SetVoiceMessage(v *VoiceMessage) *DirectMessageConfiguration { - s.VoiceMessage = v +// SetApplicationResponse sets the ApplicationResponse field's value. +func (s *GetAppOutput) SetApplicationResponse(v *ApplicationResponse) *GetAppOutput { + s.ApplicationResponse = v return s } -// Specifies the status and settings of the email channel for an application. -type EmailChannelRequest struct { +type GetApplicationDateRangeKpiInput struct { _ struct{} `type:"structure"` - // The configuration set that you want to apply to email that you send through - // the channel by using the Amazon Pinpoint Email API (emailAPIreference.html). - ConfigurationSet *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // Specifies whether to enable the email channel for the application. - Enabled *bool `type:"boolean"` + EndTime *time.Time `location:"querystring" locationName:"end-time" type:"timestamp" timestampFormat:"iso8601"` - // The verified email address that you want to send email from when you send - // email through the channel. - // - // FromAddress is a required field - FromAddress *string `type:"string" required:"true"` + // KpiName is a required field + KpiName *string `location:"uri" locationName:"kpi-name" type:"string" required:"true"` - // The Amazon Resource Name (ARN) of the identity, verified with Amazon Simple - // Email Service (Amazon SES), that you want to use when you send email through - // the channel. - // - // Identity is a required field - Identity *string `type:"string" required:"true"` + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` - // The ARN of the AWS Identity and Access Management (IAM) role that you want - // Amazon Pinpoint to use when it submits email-related event data for the channel. - RoleArn *string `type:"string"` + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + + StartTime *time.Time `location:"querystring" locationName:"start-time" type:"timestamp" timestampFormat:"iso8601"` } // String returns the string representation -func (s EmailChannelRequest) String() string { +func (s GetApplicationDateRangeKpiInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EmailChannelRequest) GoString() string { +func (s GetApplicationDateRangeKpiInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *EmailChannelRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EmailChannelRequest"} - if s.FromAddress == nil { - invalidParams.Add(request.NewErrParamRequired("FromAddress")) +func (s *GetApplicationDateRangeKpiInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetApplicationDateRangeKpiInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } - if s.Identity == nil { - invalidParams.Add(request.NewErrParamRequired("Identity")) + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.KpiName == nil { + invalidParams.Add(request.NewErrParamRequired("KpiName")) + } + if s.KpiName != nil && len(*s.KpiName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("KpiName", 1)) } if invalidParams.Len() > 0 { @@ -12596,1269 +20102,1134 @@ func (s *EmailChannelRequest) Validate() error { return nil } -// SetConfigurationSet sets the ConfigurationSet field's value. -func (s *EmailChannelRequest) SetConfigurationSet(v string) *EmailChannelRequest { - s.ConfigurationSet = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetApplicationDateRangeKpiInput) SetApplicationId(v string) *GetApplicationDateRangeKpiInput { + s.ApplicationId = &v return s } -// SetEnabled sets the Enabled field's value. -func (s *EmailChannelRequest) SetEnabled(v bool) *EmailChannelRequest { - s.Enabled = &v +// SetEndTime sets the EndTime field's value. +func (s *GetApplicationDateRangeKpiInput) SetEndTime(v time.Time) *GetApplicationDateRangeKpiInput { + s.EndTime = &v return s } -// SetFromAddress sets the FromAddress field's value. -func (s *EmailChannelRequest) SetFromAddress(v string) *EmailChannelRequest { - s.FromAddress = &v +// SetKpiName sets the KpiName field's value. +func (s *GetApplicationDateRangeKpiInput) SetKpiName(v string) *GetApplicationDateRangeKpiInput { + s.KpiName = &v return s } -// SetIdentity sets the Identity field's value. -func (s *EmailChannelRequest) SetIdentity(v string) *EmailChannelRequest { - s.Identity = &v +// SetNextToken sets the NextToken field's value. +func (s *GetApplicationDateRangeKpiInput) SetNextToken(v string) *GetApplicationDateRangeKpiInput { + s.NextToken = &v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *EmailChannelRequest) SetRoleArn(v string) *EmailChannelRequest { - s.RoleArn = &v +// SetPageSize sets the PageSize field's value. +func (s *GetApplicationDateRangeKpiInput) SetPageSize(v string) *GetApplicationDateRangeKpiInput { + s.PageSize = &v return s } -// Provides information about the status and settings of the email channel for -// an application. -type EmailChannelResponse struct { - _ struct{} `type:"structure"` - - // The unique identifier for the application that the email channel applies - // to. - ApplicationId *string `type:"string"` - - // The configuration set that's applied to email that's sent through the channel - // by using the Amazon Pinpoint Email API (emailAPIreference.html). - ConfigurationSet *string `type:"string"` - - // The date and time, in ISO 8601 format, when the email channel was enabled. - CreationDate *string `type:"string"` - - // Specifies whether the email channel is enabled for the application. - Enabled *bool `type:"boolean"` - - // The verified email address that you send email from when you send email through - // the channel. - FromAddress *string `type:"string"` - - // (Not used) This property is retained only for backward compatibility. - HasCredential *bool `type:"boolean"` - - // (Deprecated) An identifier for the email channel. This property is retained - // only for backward compatibility. - Id *string `type:"string"` - - // The Amazon Resource Name (ARN) of the identity, verified with Amazon Simple - // Email Service (Amazon SES), that you use when you send email through the - // channel. - Identity *string `type:"string"` - - // Specifies whether the email channel is archived. - IsArchived *bool `type:"boolean"` - - // The user who last modified the email channel. - LastModifiedBy *string `type:"string"` - - // The date and time, in ISO 8601 format, when the email channel was last modified. - LastModifiedDate *string `type:"string"` +// SetStartTime sets the StartTime field's value. +func (s *GetApplicationDateRangeKpiInput) SetStartTime(v time.Time) *GetApplicationDateRangeKpiInput { + s.StartTime = &v + return s +} - // The maximum number of emails that you can send through the channel each second. - MessagesPerSecond *int64 `type:"integer"` +type GetApplicationDateRangeKpiOutput struct { + _ struct{} `type:"structure" payload:"ApplicationDateRangeKpiResponse"` - // The type of messaging or notification platform for the channel. For the email - // channel, this value is EMAIL. + // Provides the results of a query that retrieved the data for a standard metric + // that applies to an application, and provides information about that query. // - // Platform is a required field - Platform *string `type:"string" required:"true"` - - // The ARN of the AWS Identity and Access Management (IAM) role that Amazon - // Pinpoint uses to submit email-related event data for the channel. - RoleArn *string `type:"string"` - - // The current version of the email channel. - Version *int64 `type:"integer"` + // ApplicationDateRangeKpiResponse is a required field + ApplicationDateRangeKpiResponse *ApplicationDateRangeKpiResponse `type:"structure" required:"true"` } // String returns the string representation -func (s EmailChannelResponse) String() string { +func (s GetApplicationDateRangeKpiOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EmailChannelResponse) GoString() string { +func (s GetApplicationDateRangeKpiOutput) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *EmailChannelResponse) SetApplicationId(v string) *EmailChannelResponse { - s.ApplicationId = &v - return s -} - -// SetConfigurationSet sets the ConfigurationSet field's value. -func (s *EmailChannelResponse) SetConfigurationSet(v string) *EmailChannelResponse { - s.ConfigurationSet = &v - return s -} - -// SetCreationDate sets the CreationDate field's value. -func (s *EmailChannelResponse) SetCreationDate(v string) *EmailChannelResponse { - s.CreationDate = &v +// SetApplicationDateRangeKpiResponse sets the ApplicationDateRangeKpiResponse field's value. +func (s *GetApplicationDateRangeKpiOutput) SetApplicationDateRangeKpiResponse(v *ApplicationDateRangeKpiResponse) *GetApplicationDateRangeKpiOutput { + s.ApplicationDateRangeKpiResponse = v return s } -// SetEnabled sets the Enabled field's value. -func (s *EmailChannelResponse) SetEnabled(v bool) *EmailChannelResponse { - s.Enabled = &v - return s -} +type GetApplicationSettingsInput struct { + _ struct{} `type:"structure"` -// SetFromAddress sets the FromAddress field's value. -func (s *EmailChannelResponse) SetFromAddress(v string) *EmailChannelResponse { - s.FromAddress = &v - return s + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } -// SetHasCredential sets the HasCredential field's value. -func (s *EmailChannelResponse) SetHasCredential(v bool) *EmailChannelResponse { - s.HasCredential = &v - return s +// String returns the string representation +func (s GetApplicationSettingsInput) String() string { + return awsutil.Prettify(s) } -// SetId sets the Id field's value. -func (s *EmailChannelResponse) SetId(v string) *EmailChannelResponse { - s.Id = &v - return s +// GoString returns the string representation +func (s GetApplicationSettingsInput) GoString() string { + return s.String() } -// SetIdentity sets the Identity field's value. -func (s *EmailChannelResponse) SetIdentity(v string) *EmailChannelResponse { - s.Identity = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetApplicationSettingsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetApplicationSettingsInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } -// SetIsArchived sets the IsArchived field's value. -func (s *EmailChannelResponse) SetIsArchived(v bool) *EmailChannelResponse { - s.IsArchived = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetLastModifiedBy sets the LastModifiedBy field's value. -func (s *EmailChannelResponse) SetLastModifiedBy(v string) *EmailChannelResponse { - s.LastModifiedBy = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetApplicationSettingsInput) SetApplicationId(v string) *GetApplicationSettingsInput { + s.ApplicationId = &v return s } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *EmailChannelResponse) SetLastModifiedDate(v string) *EmailChannelResponse { - s.LastModifiedDate = &v - return s -} +type GetApplicationSettingsOutput struct { + _ struct{} `type:"structure" payload:"ApplicationSettingsResource"` -// SetMessagesPerSecond sets the MessagesPerSecond field's value. -func (s *EmailChannelResponse) SetMessagesPerSecond(v int64) *EmailChannelResponse { - s.MessagesPerSecond = &v - return s + // Provides information about an application, including the default settings + // for an application. + // + // ApplicationSettingsResource is a required field + ApplicationSettingsResource *ApplicationSettingsResource `type:"structure" required:"true"` } -// SetPlatform sets the Platform field's value. -func (s *EmailChannelResponse) SetPlatform(v string) *EmailChannelResponse { - s.Platform = &v - return s +// String returns the string representation +func (s GetApplicationSettingsOutput) String() string { + return awsutil.Prettify(s) } -// SetRoleArn sets the RoleArn field's value. -func (s *EmailChannelResponse) SetRoleArn(v string) *EmailChannelResponse { - s.RoleArn = &v - return s +// GoString returns the string representation +func (s GetApplicationSettingsOutput) GoString() string { + return s.String() } -// SetVersion sets the Version field's value. -func (s *EmailChannelResponse) SetVersion(v int64) *EmailChannelResponse { - s.Version = &v +// SetApplicationSettingsResource sets the ApplicationSettingsResource field's value. +func (s *GetApplicationSettingsOutput) SetApplicationSettingsResource(v *ApplicationSettingsResource) *GetApplicationSettingsOutput { + s.ApplicationSettingsResource = v return s } -// Specifies the default settings and content for a one-time email message that's -// sent directly to an endpoint. -type EmailMessage struct { +type GetAppsInput struct { _ struct{} `type:"structure"` - // The body of the email message. - Body *string `type:"string"` - - // The email address to forward bounces and complaints to, if feedback forwarding - // is enabled. - FeedbackForwardingAddress *string `type:"string"` - - // The verified email address to send the email message from. The default value - // is the FromAddress specified for the email channel. - FromAddress *string `type:"string"` - - // The email message, represented as a raw MIME message. - RawEmail *RawEmail `type:"structure"` - - // The reply-to email address(es) for the email message. If a recipient replies - // to the email, each reply-to address receives the reply. - ReplyToAddresses []*string `type:"list"` - - // The email message, composed of a subject, a text part, and an HTML part. - SimpleEmail *SimpleEmail `type:"structure"` + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` - // The default message variables to use in the email message. You can override - // the default variables with individual address variables. - Substitutions map[string][]*string `type:"map"` + Token *string `location:"querystring" locationName:"token" type:"string"` } // String returns the string representation -func (s EmailMessage) String() string { +func (s GetAppsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EmailMessage) GoString() string { +func (s GetAppsInput) GoString() string { return s.String() } -// SetBody sets the Body field's value. -func (s *EmailMessage) SetBody(v string) *EmailMessage { - s.Body = &v +// SetPageSize sets the PageSize field's value. +func (s *GetAppsInput) SetPageSize(v string) *GetAppsInput { + s.PageSize = &v return s } -// SetFeedbackForwardingAddress sets the FeedbackForwardingAddress field's value. -func (s *EmailMessage) SetFeedbackForwardingAddress(v string) *EmailMessage { - s.FeedbackForwardingAddress = &v +// SetToken sets the Token field's value. +func (s *GetAppsInput) SetToken(v string) *GetAppsInput { + s.Token = &v return s } -// SetFromAddress sets the FromAddress field's value. -func (s *EmailMessage) SetFromAddress(v string) *EmailMessage { - s.FromAddress = &v - return s -} +type GetAppsOutput struct { + _ struct{} `type:"structure" payload:"ApplicationsResponse"` -// SetRawEmail sets the RawEmail field's value. -func (s *EmailMessage) SetRawEmail(v *RawEmail) *EmailMessage { - s.RawEmail = v - return s + // Provides information about all of your applications. + // + // ApplicationsResponse is a required field + ApplicationsResponse *ApplicationsResponse `type:"structure" required:"true"` } -// SetReplyToAddresses sets the ReplyToAddresses field's value. -func (s *EmailMessage) SetReplyToAddresses(v []*string) *EmailMessage { - s.ReplyToAddresses = v - return s +// String returns the string representation +func (s GetAppsOutput) String() string { + return awsutil.Prettify(s) } -// SetSimpleEmail sets the SimpleEmail field's value. -func (s *EmailMessage) SetSimpleEmail(v *SimpleEmail) *EmailMessage { - s.SimpleEmail = v - return s +// GoString returns the string representation +func (s GetAppsOutput) GoString() string { + return s.String() } -// SetSubstitutions sets the Substitutions field's value. -func (s *EmailMessage) SetSubstitutions(v map[string][]*string) *EmailMessage { - s.Substitutions = v +// SetApplicationsResponse sets the ApplicationsResponse field's value. +func (s *GetAppsOutput) SetApplicationsResponse(v *ApplicationsResponse) *GetAppsOutput { + s.ApplicationsResponse = v return s } -// Specifies an endpoint to create or update and the settings and attributes -// to set or change for the endpoint. -type EndpointBatchItem struct { +type GetBaiduChannelInput struct { _ struct{} `type:"structure"` - // The destination address for messages or push notifications that you send - // to the endpoint. The address varies by channel. For a push-notification channel, - // use the token provided by the push notification service, such as an Apple - // Push Notification service (APNs) device token or a Firebase Cloud Messaging - // (FCM) registration token. For the SMS channel, use a phone number in E.164 - // format, such as +12065550100. For the email channel, use an email address. - Address *string `type:"string"` - - // One or more custom attributes that describe the endpoint by associating a - // name with an array of values. For example, the value of a custom attribute - // named Interests might be: ["science", "music", "travel"]. You can use these - // attributes as filter criteria when you create segments. - // - // When you define the name of a custom attribute, avoid using the following - // characters: number sign (#), colon (:), question mark (?), backslash (\), - // and slash (/). The Amazon Pinpoint console can't display attribute names - // that contain these characters. This limitation doesn't apply to attribute - // values. - Attributes map[string][]*string `type:"map"` - - // The channel to use when sending messages or push notifications to the endpoint. - ChannelType *string `type:"string" enum:"ChannelType"` - - // The demographic information for the endpoint, such as the time zone and platform. - Demographic *EndpointDemographic `type:"structure"` - - // The date and time, in ISO 8601 format, when the endpoint was created or updated. - EffectiveDate *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +} - // Not used. - EndpointStatus *string `type:"string"` +// String returns the string representation +func (s GetBaiduChannelInput) String() string { + return awsutil.Prettify(s) +} - // The unique identifier for the endpoint in the context of the batch. - Id *string `type:"string"` +// GoString returns the string representation +func (s GetBaiduChannelInput) GoString() string { + return s.String() +} - // The geographic information for the endpoint. - Location *EndpointLocation `type:"structure"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetBaiduChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetBaiduChannelInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } - // One or more custom metrics that your app reports to Amazon Pinpoint for the - // endpoint. - Metrics map[string]*float64 `type:"map"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // Specifies whether the user who's associated with the endpoint has opted out - // of receiving messages and push notifications from you. Possible values are: - // ALL, the user has opted out and doesn't want to receive any messages or push - // notifications; and, NONE, the user hasn't opted out and wants to receive - // all messages and push notifications. - OptOut *string `type:"string"` +// SetApplicationId sets the ApplicationId field's value. +func (s *GetBaiduChannelInput) SetApplicationId(v string) *GetBaiduChannelInput { + s.ApplicationId = &v + return s +} - // The unique identifier for the request to create or update the endpoint. - RequestId *string `type:"string"` +type GetBaiduChannelOutput struct { + _ struct{} `type:"structure" payload:"BaiduChannelResponse"` - // One or more custom user attributes that your app reports to Amazon Pinpoint - // for the user who's associated with the endpoint. - User *EndpointUser `type:"structure"` + // Provides information about the status and settings of the Baidu (Baidu Cloud + // Push) channel for an application. + // + // BaiduChannelResponse is a required field + BaiduChannelResponse *BaiduChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s EndpointBatchItem) String() string { +func (s GetBaiduChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EndpointBatchItem) GoString() string { +func (s GetBaiduChannelOutput) GoString() string { return s.String() } -// SetAddress sets the Address field's value. -func (s *EndpointBatchItem) SetAddress(v string) *EndpointBatchItem { - s.Address = &v +// SetBaiduChannelResponse sets the BaiduChannelResponse field's value. +func (s *GetBaiduChannelOutput) SetBaiduChannelResponse(v *BaiduChannelResponse) *GetBaiduChannelOutput { + s.BaiduChannelResponse = v return s } -// SetAttributes sets the Attributes field's value. -func (s *EndpointBatchItem) SetAttributes(v map[string][]*string) *EndpointBatchItem { - s.Attributes = v - return s -} +type GetCampaignActivitiesInput struct { + _ struct{} `type:"structure"` -// SetChannelType sets the ChannelType field's value. -func (s *EndpointBatchItem) SetChannelType(v string) *EndpointBatchItem { - s.ChannelType = &v - return s -} + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` -// SetDemographic sets the Demographic field's value. -func (s *EndpointBatchItem) SetDemographic(v *EndpointDemographic) *EndpointBatchItem { - s.Demographic = v - return s -} + // CampaignId is a required field + CampaignId *string `location:"uri" locationName:"campaign-id" type:"string" required:"true"` -// SetEffectiveDate sets the EffectiveDate field's value. -func (s *EndpointBatchItem) SetEffectiveDate(v string) *EndpointBatchItem { - s.EffectiveDate = &v - return s + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + + Token *string `location:"querystring" locationName:"token" type:"string"` } -// SetEndpointStatus sets the EndpointStatus field's value. -func (s *EndpointBatchItem) SetEndpointStatus(v string) *EndpointBatchItem { - s.EndpointStatus = &v - return s +// String returns the string representation +func (s GetCampaignActivitiesInput) String() string { + return awsutil.Prettify(s) } -// SetId sets the Id field's value. -func (s *EndpointBatchItem) SetId(v string) *EndpointBatchItem { - s.Id = &v - return s +// GoString returns the string representation +func (s GetCampaignActivitiesInput) GoString() string { + return s.String() } -// SetLocation sets the Location field's value. -func (s *EndpointBatchItem) SetLocation(v *EndpointLocation) *EndpointBatchItem { - s.Location = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetCampaignActivitiesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetCampaignActivitiesInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.CampaignId == nil { + invalidParams.Add(request.NewErrParamRequired("CampaignId")) + } + if s.CampaignId != nil && len(*s.CampaignId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CampaignId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetMetrics sets the Metrics field's value. -func (s *EndpointBatchItem) SetMetrics(v map[string]*float64) *EndpointBatchItem { - s.Metrics = v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetCampaignActivitiesInput) SetApplicationId(v string) *GetCampaignActivitiesInput { + s.ApplicationId = &v return s } -// SetOptOut sets the OptOut field's value. -func (s *EndpointBatchItem) SetOptOut(v string) *EndpointBatchItem { - s.OptOut = &v +// SetCampaignId sets the CampaignId field's value. +func (s *GetCampaignActivitiesInput) SetCampaignId(v string) *GetCampaignActivitiesInput { + s.CampaignId = &v return s } -// SetRequestId sets the RequestId field's value. -func (s *EndpointBatchItem) SetRequestId(v string) *EndpointBatchItem { - s.RequestId = &v +// SetPageSize sets the PageSize field's value. +func (s *GetCampaignActivitiesInput) SetPageSize(v string) *GetCampaignActivitiesInput { + s.PageSize = &v return s } -// SetUser sets the User field's value. -func (s *EndpointBatchItem) SetUser(v *EndpointUser) *EndpointBatchItem { - s.User = v +// SetToken sets the Token field's value. +func (s *GetCampaignActivitiesInput) SetToken(v string) *GetCampaignActivitiesInput { + s.Token = &v return s } -// Specifies a batch of endpoints to create or update and the settings and attributes -// to set or change for each endpoint. -type EndpointBatchRequest struct { - _ struct{} `type:"structure"` +type GetCampaignActivitiesOutput struct { + _ struct{} `type:"structure" payload:"ActivitiesResponse"` - // An array that defines the endpoints to create or update and, for each endpoint, - // the property values to set or change. An array can contain a maximum of 100 - // items. + // Provides information about the activities that were performed by a campaign. // - // Item is a required field - Item []*EndpointBatchItem `type:"list" required:"true"` + // ActivitiesResponse is a required field + ActivitiesResponse *ActivitiesResponse `type:"structure" required:"true"` } // String returns the string representation -func (s EndpointBatchRequest) String() string { +func (s GetCampaignActivitiesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EndpointBatchRequest) GoString() string { +func (s GetCampaignActivitiesOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *EndpointBatchRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EndpointBatchRequest"} - if s.Item == nil { - invalidParams.Add(request.NewErrParamRequired("Item")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetItem sets the Item field's value. -func (s *EndpointBatchRequest) SetItem(v []*EndpointBatchItem) *EndpointBatchRequest { - s.Item = v +// SetActivitiesResponse sets the ActivitiesResponse field's value. +func (s *GetCampaignActivitiesOutput) SetActivitiesResponse(v *ActivitiesResponse) *GetCampaignActivitiesOutput { + s.ActivitiesResponse = v return s } -// Specifies demographic information about an endpoint, such as the applicable -// time zone and platform. -type EndpointDemographic struct { +type GetCampaignDateRangeKpiInput struct { _ struct{} `type:"structure"` - // The version of the app that's associated with the endpoint. - AppVersion *string `type:"string"` - - // The locale of the endpoint, in the following format: the ISO 639-1 alpha-2 - // code, followed by an underscore (_), followed by an ISO 3166-1 alpha-2 value. - Locale *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The manufacturer of the endpoint device, such as Apple or Samsung. - Make *string `type:"string"` + // CampaignId is a required field + CampaignId *string `location:"uri" locationName:"campaign-id" type:"string" required:"true"` - // The model name or number of the endpoint device, such as iPhone. - Model *string `type:"string"` + EndTime *time.Time `location:"querystring" locationName:"end-time" type:"timestamp" timestampFormat:"iso8601"` - // The model version of the endpoint device. - ModelVersion *string `type:"string"` + // KpiName is a required field + KpiName *string `location:"uri" locationName:"kpi-name" type:"string" required:"true"` - // The platform of the endpoint device, such as iOS or Android. - Platform *string `type:"string"` + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` - // The platform version of the endpoint device. - PlatformVersion *string `type:"string"` + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` - // The time zone of the endpoint, specified as a tz database name value, such - // as America/Los_Angeles. - Timezone *string `type:"string"` + StartTime *time.Time `location:"querystring" locationName:"start-time" type:"timestamp" timestampFormat:"iso8601"` } // String returns the string representation -func (s EndpointDemographic) String() string { +func (s GetCampaignDateRangeKpiInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EndpointDemographic) GoString() string { +func (s GetCampaignDateRangeKpiInput) GoString() string { return s.String() } -// SetAppVersion sets the AppVersion field's value. -func (s *EndpointDemographic) SetAppVersion(v string) *EndpointDemographic { - s.AppVersion = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetCampaignDateRangeKpiInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetCampaignDateRangeKpiInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.CampaignId == nil { + invalidParams.Add(request.NewErrParamRequired("CampaignId")) + } + if s.CampaignId != nil && len(*s.CampaignId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CampaignId", 1)) + } + if s.KpiName == nil { + invalidParams.Add(request.NewErrParamRequired("KpiName")) + } + if s.KpiName != nil && len(*s.KpiName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("KpiName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetLocale sets the Locale field's value. -func (s *EndpointDemographic) SetLocale(v string) *EndpointDemographic { - s.Locale = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetCampaignDateRangeKpiInput) SetApplicationId(v string) *GetCampaignDateRangeKpiInput { + s.ApplicationId = &v return s } -// SetMake sets the Make field's value. -func (s *EndpointDemographic) SetMake(v string) *EndpointDemographic { - s.Make = &v +// SetCampaignId sets the CampaignId field's value. +func (s *GetCampaignDateRangeKpiInput) SetCampaignId(v string) *GetCampaignDateRangeKpiInput { + s.CampaignId = &v return s } -// SetModel sets the Model field's value. -func (s *EndpointDemographic) SetModel(v string) *EndpointDemographic { - s.Model = &v +// SetEndTime sets the EndTime field's value. +func (s *GetCampaignDateRangeKpiInput) SetEndTime(v time.Time) *GetCampaignDateRangeKpiInput { + s.EndTime = &v return s } -// SetModelVersion sets the ModelVersion field's value. -func (s *EndpointDemographic) SetModelVersion(v string) *EndpointDemographic { - s.ModelVersion = &v +// SetKpiName sets the KpiName field's value. +func (s *GetCampaignDateRangeKpiInput) SetKpiName(v string) *GetCampaignDateRangeKpiInput { + s.KpiName = &v return s } -// SetPlatform sets the Platform field's value. -func (s *EndpointDemographic) SetPlatform(v string) *EndpointDemographic { - s.Platform = &v +// SetNextToken sets the NextToken field's value. +func (s *GetCampaignDateRangeKpiInput) SetNextToken(v string) *GetCampaignDateRangeKpiInput { + s.NextToken = &v return s } -// SetPlatformVersion sets the PlatformVersion field's value. -func (s *EndpointDemographic) SetPlatformVersion(v string) *EndpointDemographic { - s.PlatformVersion = &v +// SetPageSize sets the PageSize field's value. +func (s *GetCampaignDateRangeKpiInput) SetPageSize(v string) *GetCampaignDateRangeKpiInput { + s.PageSize = &v return s } -// SetTimezone sets the Timezone field's value. -func (s *EndpointDemographic) SetTimezone(v string) *EndpointDemographic { - s.Timezone = &v +// SetStartTime sets the StartTime field's value. +func (s *GetCampaignDateRangeKpiInput) SetStartTime(v time.Time) *GetCampaignDateRangeKpiInput { + s.StartTime = &v return s } -// Provides the status code and message that result from processing data for -// an endpoint. -type EndpointItemResponse struct { - _ struct{} `type:"structure"` - - // The custom message that's returned in the response as a result of processing - // the endpoint data. - Message *string `type:"string"` +type GetCampaignDateRangeKpiOutput struct { + _ struct{} `type:"structure" payload:"CampaignDateRangeKpiResponse"` - // The status code that's returned in the response as a result of processing - // the endpoint data. - StatusCode *int64 `type:"integer"` + // Provides the results of a query that retrieved the data for a standard metric + // that applies to a campaign, and provides information about that query. + // + // CampaignDateRangeKpiResponse is a required field + CampaignDateRangeKpiResponse *CampaignDateRangeKpiResponse `type:"structure" required:"true"` } // String returns the string representation -func (s EndpointItemResponse) String() string { +func (s GetCampaignDateRangeKpiOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EndpointItemResponse) GoString() string { +func (s GetCampaignDateRangeKpiOutput) GoString() string { return s.String() } -// SetMessage sets the Message field's value. -func (s *EndpointItemResponse) SetMessage(v string) *EndpointItemResponse { - s.Message = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *EndpointItemResponse) SetStatusCode(v int64) *EndpointItemResponse { - s.StatusCode = &v +// SetCampaignDateRangeKpiResponse sets the CampaignDateRangeKpiResponse field's value. +func (s *GetCampaignDateRangeKpiOutput) SetCampaignDateRangeKpiResponse(v *CampaignDateRangeKpiResponse) *GetCampaignDateRangeKpiOutput { + s.CampaignDateRangeKpiResponse = v return s -} - -// Specifies geographic information about an endpoint. -type EndpointLocation struct { - _ struct{} `type:"structure"` - - // The name of the city where the endpoint is located. - City *string `type:"string"` - - // The two-character code, in ISO 3166-1 alpha-2 format, for the country or - // region where the endpoint is located. For example, US for the United States. - Country *string `type:"string"` - - // The latitude coordinate of the endpoint location, rounded to one decimal - // place. - Latitude *float64 `type:"double"` +} - // The longitude coordinate of the endpoint location, rounded to one decimal - // place. - Longitude *float64 `type:"double"` +type GetCampaignInput struct { + _ struct{} `type:"structure"` - // The postal or ZIP code for the area where the endpoint is located. - PostalCode *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The name of the region where the endpoint is located. For locations in the - // United States, this value is the name of a state. - Region *string `type:"string"` + // CampaignId is a required field + CampaignId *string `location:"uri" locationName:"campaign-id" type:"string" required:"true"` } // String returns the string representation -func (s EndpointLocation) String() string { +func (s GetCampaignInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EndpointLocation) GoString() string { +func (s GetCampaignInput) GoString() string { return s.String() } -// SetCity sets the City field's value. -func (s *EndpointLocation) SetCity(v string) *EndpointLocation { - s.City = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetCampaignInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetCampaignInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.CampaignId == nil { + invalidParams.Add(request.NewErrParamRequired("CampaignId")) + } + if s.CampaignId != nil && len(*s.CampaignId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CampaignId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetCountry sets the Country field's value. -func (s *EndpointLocation) SetCountry(v string) *EndpointLocation { - s.Country = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetCampaignInput) SetApplicationId(v string) *GetCampaignInput { + s.ApplicationId = &v return s } -// SetLatitude sets the Latitude field's value. -func (s *EndpointLocation) SetLatitude(v float64) *EndpointLocation { - s.Latitude = &v +// SetCampaignId sets the CampaignId field's value. +func (s *GetCampaignInput) SetCampaignId(v string) *GetCampaignInput { + s.CampaignId = &v return s } -// SetLongitude sets the Longitude field's value. -func (s *EndpointLocation) SetLongitude(v float64) *EndpointLocation { - s.Longitude = &v - return s +type GetCampaignOutput struct { + _ struct{} `type:"structure" payload:"CampaignResponse"` + + // Provides information about the status, configuration, and other settings + // for a campaign. + // + // CampaignResponse is a required field + CampaignResponse *CampaignResponse `type:"structure" required:"true"` } -// SetPostalCode sets the PostalCode field's value. -func (s *EndpointLocation) SetPostalCode(v string) *EndpointLocation { - s.PostalCode = &v - return s +// String returns the string representation +func (s GetCampaignOutput) String() string { + return awsutil.Prettify(s) } -// SetRegion sets the Region field's value. -func (s *EndpointLocation) SetRegion(v string) *EndpointLocation { - s.Region = &v +// GoString returns the string representation +func (s GetCampaignOutput) GoString() string { + return s.String() +} + +// SetCampaignResponse sets the CampaignResponse field's value. +func (s *GetCampaignOutput) SetCampaignResponse(v *CampaignResponse) *GetCampaignOutput { + s.CampaignResponse = v return s } -// Provides information about the delivery status and results of sending a message -// directly to an endpoint. -type EndpointMessageResult struct { +type GetCampaignVersionInput struct { _ struct{} `type:"structure"` - // The endpoint address that the message was delivered to. - Address *string `type:"string"` - - // The delivery status of the message. Possible values are: - // - // * DUPLICATE - The endpoint address is a duplicate of another endpoint - // address. Amazon Pinpoint won't attempt to send the message again. - // - // * OPT_OUT - The user who's associated with the endpoint has opted out - // of receiving messages from you. Amazon Pinpoint won't attempt to send - // the message again. - // - // * PERMANENT_FAILURE - An error occurred when delivering the message to - // the endpoint. Amazon Pinpoint won't attempt to send the message again. - // - // * SUCCESSFUL - The message was successfully delivered to the endpoint. - // - // * TEMPORARY_FAILURE - A temporary error occurred. Amazon Pinpoint will - // attempt to deliver the message again later. - // - // * THROTTLED - Amazon Pinpoint throttled the operation to send the message - // to the endpoint. - // - // * TIMEOUT - The message couldn't be sent within the timeout period. - // - // * UNKNOWN_FAILURE - An unknown error occurred. - // - // DeliveryStatus is a required field - DeliveryStatus *string `type:"string" required:"true" enum:"DeliveryStatus"` - - // The unique identifier for the message that was sent. - MessageId *string `type:"string"` - - // The downstream service status code for delivering the message. - // - // StatusCode is a required field - StatusCode *int64 `type:"integer" required:"true"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The status message for delivering the message. - StatusMessage *string `type:"string"` + // CampaignId is a required field + CampaignId *string `location:"uri" locationName:"campaign-id" type:"string" required:"true"` - // For push notifications that are sent through the GCM channel, specifies whether - // the token was updated as part of delivering the message. - UpdatedToken *string `type:"string"` + // Version is a required field + Version *string `location:"uri" locationName:"version" type:"string" required:"true"` } // String returns the string representation -func (s EndpointMessageResult) String() string { +func (s GetCampaignVersionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EndpointMessageResult) GoString() string { +func (s GetCampaignVersionInput) GoString() string { return s.String() } -// SetAddress sets the Address field's value. -func (s *EndpointMessageResult) SetAddress(v string) *EndpointMessageResult { - s.Address = &v - return s -} - -// SetDeliveryStatus sets the DeliveryStatus field's value. -func (s *EndpointMessageResult) SetDeliveryStatus(v string) *EndpointMessageResult { - s.DeliveryStatus = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetCampaignVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetCampaignVersionInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.CampaignId == nil { + invalidParams.Add(request.NewErrParamRequired("CampaignId")) + } + if s.CampaignId != nil && len(*s.CampaignId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CampaignId", 1)) + } + if s.Version == nil { + invalidParams.Add(request.NewErrParamRequired("Version")) + } + if s.Version != nil && len(*s.Version) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Version", 1)) + } -// SetMessageId sets the MessageId field's value. -func (s *EndpointMessageResult) SetMessageId(v string) *EndpointMessageResult { - s.MessageId = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetStatusCode sets the StatusCode field's value. -func (s *EndpointMessageResult) SetStatusCode(v int64) *EndpointMessageResult { - s.StatusCode = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetCampaignVersionInput) SetApplicationId(v string) *GetCampaignVersionInput { + s.ApplicationId = &v return s } -// SetStatusMessage sets the StatusMessage field's value. -func (s *EndpointMessageResult) SetStatusMessage(v string) *EndpointMessageResult { - s.StatusMessage = &v +// SetCampaignId sets the CampaignId field's value. +func (s *GetCampaignVersionInput) SetCampaignId(v string) *GetCampaignVersionInput { + s.CampaignId = &v return s } -// SetUpdatedToken sets the UpdatedToken field's value. -func (s *EndpointMessageResult) SetUpdatedToken(v string) *EndpointMessageResult { - s.UpdatedToken = &v +// SetVersion sets the Version field's value. +func (s *GetCampaignVersionInput) SetVersion(v string) *GetCampaignVersionInput { + s.Version = &v return s } -// Specifies the channel type and other settings for an endpoint. -type EndpointRequest struct { - _ struct{} `type:"structure"` - - // The destination address for messages or push notifications that you send - // to the endpoint. The address varies by channel. For a push-notification channel, - // use the token provided by the push notification service, such as an Apple - // Push Notification service (APNs) device token or a Firebase Cloud Messaging - // (FCM) registration token. For the SMS channel, use a phone number in E.164 - // format, such as +12065550100. For the email channel, use an email address. - Address *string `type:"string"` +type GetCampaignVersionOutput struct { + _ struct{} `type:"structure" payload:"CampaignResponse"` - // One or more custom attributes that describe the endpoint by associating a - // name with an array of values. For example, the value of a custom attribute - // named Interests might be: ["science", "music", "travel"]. You can use these - // attributes as filter criteria when you create segments. + // Provides information about the status, configuration, and other settings + // for a campaign. // - // When you define the name of a custom attribute, avoid using the following - // characters: number sign (#), colon (:), question mark (?), backslash (\), - // and slash (/). The Amazon Pinpoint console can't display attribute names - // that contain these characters. This limitation doesn't apply to attribute - // values. - Attributes map[string][]*string `type:"map"` - - // The channel to use when sending messages or push notifications to the endpoint. - ChannelType *string `type:"string" enum:"ChannelType"` + // CampaignResponse is a required field + CampaignResponse *CampaignResponse `type:"structure" required:"true"` +} - // The demographic information for the endpoint, such as the time zone and platform. - Demographic *EndpointDemographic `type:"structure"` +// String returns the string representation +func (s GetCampaignVersionOutput) String() string { + return awsutil.Prettify(s) +} - // The date and time, in ISO 8601 format, when the endpoint is updated. - EffectiveDate *string `type:"string"` +// GoString returns the string representation +func (s GetCampaignVersionOutput) GoString() string { + return s.String() +} - // Not used. - EndpointStatus *string `type:"string"` +// SetCampaignResponse sets the CampaignResponse field's value. +func (s *GetCampaignVersionOutput) SetCampaignResponse(v *CampaignResponse) *GetCampaignVersionOutput { + s.CampaignResponse = v + return s +} - // The geographic information for the endpoint. - Location *EndpointLocation `type:"structure"` +type GetCampaignVersionsInput struct { + _ struct{} `type:"structure"` - // One or more custom metrics that your app reports to Amazon Pinpoint for the - // endpoint. - Metrics map[string]*float64 `type:"map"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // Specifies whether the user who's associated with the endpoint has opted out - // of receiving messages and push notifications from you. Possible values are: - // ALL, the user has opted out and doesn't want to receive any messages or push - // notifications; and, NONE, the user hasn't opted out and wants to receive - // all messages and push notifications. - OptOut *string `type:"string"` + // CampaignId is a required field + CampaignId *string `location:"uri" locationName:"campaign-id" type:"string" required:"true"` - // The unique identifier for the most recent request to update the endpoint. - RequestId *string `type:"string"` + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` - // One or more custom user attributes that describe the user who's associated - // with the endpoint. - User *EndpointUser `type:"structure"` + Token *string `location:"querystring" locationName:"token" type:"string"` } // String returns the string representation -func (s EndpointRequest) String() string { +func (s GetCampaignVersionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EndpointRequest) GoString() string { +func (s GetCampaignVersionsInput) GoString() string { return s.String() } -// SetAddress sets the Address field's value. -func (s *EndpointRequest) SetAddress(v string) *EndpointRequest { - s.Address = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetCampaignVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetCampaignVersionsInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.CampaignId == nil { + invalidParams.Add(request.NewErrParamRequired("CampaignId")) + } + if s.CampaignId != nil && len(*s.CampaignId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CampaignId", 1)) + } -// SetAttributes sets the Attributes field's value. -func (s *EndpointRequest) SetAttributes(v map[string][]*string) *EndpointRequest { - s.Attributes = v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetChannelType sets the ChannelType field's value. -func (s *EndpointRequest) SetChannelType(v string) *EndpointRequest { - s.ChannelType = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetCampaignVersionsInput) SetApplicationId(v string) *GetCampaignVersionsInput { + s.ApplicationId = &v return s } -// SetDemographic sets the Demographic field's value. -func (s *EndpointRequest) SetDemographic(v *EndpointDemographic) *EndpointRequest { - s.Demographic = v +// SetCampaignId sets the CampaignId field's value. +func (s *GetCampaignVersionsInput) SetCampaignId(v string) *GetCampaignVersionsInput { + s.CampaignId = &v return s } -// SetEffectiveDate sets the EffectiveDate field's value. -func (s *EndpointRequest) SetEffectiveDate(v string) *EndpointRequest { - s.EffectiveDate = &v +// SetPageSize sets the PageSize field's value. +func (s *GetCampaignVersionsInput) SetPageSize(v string) *GetCampaignVersionsInput { + s.PageSize = &v return s } -// SetEndpointStatus sets the EndpointStatus field's value. -func (s *EndpointRequest) SetEndpointStatus(v string) *EndpointRequest { - s.EndpointStatus = &v +// SetToken sets the Token field's value. +func (s *GetCampaignVersionsInput) SetToken(v string) *GetCampaignVersionsInput { + s.Token = &v return s } -// SetLocation sets the Location field's value. -func (s *EndpointRequest) SetLocation(v *EndpointLocation) *EndpointRequest { - s.Location = v - return s -} +type GetCampaignVersionsOutput struct { + _ struct{} `type:"structure" payload:"CampaignsResponse"` -// SetMetrics sets the Metrics field's value. -func (s *EndpointRequest) SetMetrics(v map[string]*float64) *EndpointRequest { - s.Metrics = v - return s + // Provides information about the configuration and other settings for all the + // campaigns that are associated with an application. + // + // CampaignsResponse is a required field + CampaignsResponse *CampaignsResponse `type:"structure" required:"true"` } -// SetOptOut sets the OptOut field's value. -func (s *EndpointRequest) SetOptOut(v string) *EndpointRequest { - s.OptOut = &v - return s +// String returns the string representation +func (s GetCampaignVersionsOutput) String() string { + return awsutil.Prettify(s) } -// SetRequestId sets the RequestId field's value. -func (s *EndpointRequest) SetRequestId(v string) *EndpointRequest { - s.RequestId = &v - return s +// GoString returns the string representation +func (s GetCampaignVersionsOutput) GoString() string { + return s.String() } -// SetUser sets the User field's value. -func (s *EndpointRequest) SetUser(v *EndpointUser) *EndpointRequest { - s.User = v +// SetCampaignsResponse sets the CampaignsResponse field's value. +func (s *GetCampaignVersionsOutput) SetCampaignsResponse(v *CampaignsResponse) *GetCampaignVersionsOutput { + s.CampaignsResponse = v return s } -// Provides information about the channel type and other settings for an endpoint. -type EndpointResponse struct { +type GetCampaignsInput struct { _ struct{} `type:"structure"` - // The destination address for messages or push notifications that you send - // to the endpoint. The address varies by channel. For example, the address - // for a push-notification channel is typically the token provided by a push - // notification service, such as an Apple Push Notification service (APNs) device - // token or a Firebase Cloud Messaging (FCM) registration token. The address - // for the SMS channel is a phone number in E.164 format, such as +12065550100. - // The address for the email channel is an email address. - Address *string `type:"string"` - - // The unique identifier for the application that's associated with the endpoint. - ApplicationId *string `type:"string"` - - // One or more custom attributes that describe the endpoint by associating a - // name with an array of values. For example, the value of a custom attribute - // named Interests might be: ["science", "music", "travel"]. You can use these - // attributes as filter criteria when you create segments. - Attributes map[string][]*string `type:"map"` - - // The channel that's used when sending messages or push notifications to the - // endpoint. - ChannelType *string `type:"string" enum:"ChannelType"` - - // A number from 0-99 that represents the cohort that the endpoint is assigned - // to. Endpoints are grouped into cohorts randomly, and each cohort contains - // approximately 1 percent of the endpoints for an application. Amazon Pinpoint - // assigns cohorts to the holdout or treatment allocations for campaigns. - CohortId *string `type:"string"` - - // The date and time, in ISO 8601 format, when the endpoint was created. - CreationDate *string `type:"string"` - - // The demographic information for the endpoint, such as the time zone and platform. - Demographic *EndpointDemographic `type:"structure"` - - // The date and time, in ISO 8601 format, when the endpoint was last updated. - EffectiveDate *string `type:"string"` - - // Not used. - EndpointStatus *string `type:"string"` - - // The unique identifier that you assigned to the endpoint. The identifier should - // be a globally unique identifier (GUID) to ensure that it doesn't conflict - // with other endpoint identifiers that are associated with the application. - Id *string `type:"string"` - - // The geographic information for the endpoint. - Location *EndpointLocation `type:"structure"` - - // One or more custom metrics that your app reports to Amazon Pinpoint for the - // endpoint. - Metrics map[string]*float64 `type:"map"` - - // Specifies whether the user who's associated with the endpoint has opted out - // of receiving messages and push notifications from you. Possible values are: - // ALL, the user has opted out and doesn't want to receive any messages or push - // notifications; and, NONE, the user hasn't opted out and wants to receive - // all messages and push notifications. - OptOut *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The unique identifier for the most recent request to update the endpoint. - RequestId *string `type:"string"` + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` - // One or more custom user attributes that your app reports to Amazon Pinpoint - // for the user who's associated with the endpoint. - User *EndpointUser `type:"structure"` + Token *string `location:"querystring" locationName:"token" type:"string"` } // String returns the string representation -func (s EndpointResponse) String() string { +func (s GetCampaignsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EndpointResponse) GoString() string { +func (s GetCampaignsInput) GoString() string { return s.String() } -// SetAddress sets the Address field's value. -func (s *EndpointResponse) SetAddress(v string) *EndpointResponse { - s.Address = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetCampaignsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetCampaignsInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } // SetApplicationId sets the ApplicationId field's value. -func (s *EndpointResponse) SetApplicationId(v string) *EndpointResponse { +func (s *GetCampaignsInput) SetApplicationId(v string) *GetCampaignsInput { s.ApplicationId = &v return s } -// SetAttributes sets the Attributes field's value. -func (s *EndpointResponse) SetAttributes(v map[string][]*string) *EndpointResponse { - s.Attributes = v +// SetPageSize sets the PageSize field's value. +func (s *GetCampaignsInput) SetPageSize(v string) *GetCampaignsInput { + s.PageSize = &v return s } -// SetChannelType sets the ChannelType field's value. -func (s *EndpointResponse) SetChannelType(v string) *EndpointResponse { - s.ChannelType = &v +// SetToken sets the Token field's value. +func (s *GetCampaignsInput) SetToken(v string) *GetCampaignsInput { + s.Token = &v return s } -// SetCohortId sets the CohortId field's value. -func (s *EndpointResponse) SetCohortId(v string) *EndpointResponse { - s.CohortId = &v - return s +type GetCampaignsOutput struct { + _ struct{} `type:"structure" payload:"CampaignsResponse"` + + // Provides information about the configuration and other settings for all the + // campaigns that are associated with an application. + // + // CampaignsResponse is a required field + CampaignsResponse *CampaignsResponse `type:"structure" required:"true"` } -// SetCreationDate sets the CreationDate field's value. -func (s *EndpointResponse) SetCreationDate(v string) *EndpointResponse { - s.CreationDate = &v - return s +// String returns the string representation +func (s GetCampaignsOutput) String() string { + return awsutil.Prettify(s) } -// SetDemographic sets the Demographic field's value. -func (s *EndpointResponse) SetDemographic(v *EndpointDemographic) *EndpointResponse { - s.Demographic = v - return s +// GoString returns the string representation +func (s GetCampaignsOutput) GoString() string { + return s.String() } -// SetEffectiveDate sets the EffectiveDate field's value. -func (s *EndpointResponse) SetEffectiveDate(v string) *EndpointResponse { - s.EffectiveDate = &v +// SetCampaignsResponse sets the CampaignsResponse field's value. +func (s *GetCampaignsOutput) SetCampaignsResponse(v *CampaignsResponse) *GetCampaignsOutput { + s.CampaignsResponse = v return s } -// SetEndpointStatus sets the EndpointStatus field's value. -func (s *EndpointResponse) SetEndpointStatus(v string) *EndpointResponse { - s.EndpointStatus = &v - return s +type GetChannelsInput struct { + _ struct{} `type:"structure"` + + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetChannelsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetChannelsInput) GoString() string { + return s.String() } -// SetId sets the Id field's value. -func (s *EndpointResponse) SetId(v string) *EndpointResponse { - s.Id = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetChannelsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetChannelsInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetLocation sets the Location field's value. -func (s *EndpointResponse) SetLocation(v *EndpointLocation) *EndpointResponse { - s.Location = v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetChannelsInput) SetApplicationId(v string) *GetChannelsInput { + s.ApplicationId = &v return s } -// SetMetrics sets the Metrics field's value. -func (s *EndpointResponse) SetMetrics(v map[string]*float64) *EndpointResponse { - s.Metrics = v - return s +type GetChannelsOutput struct { + _ struct{} `type:"structure" payload:"ChannelsResponse"` + + // Provides information about the general settings and status of all channels + // for an application, including channels that aren't enabled for the application. + // + // ChannelsResponse is a required field + ChannelsResponse *ChannelsResponse `type:"structure" required:"true"` } -// SetOptOut sets the OptOut field's value. -func (s *EndpointResponse) SetOptOut(v string) *EndpointResponse { - s.OptOut = &v - return s +// String returns the string representation +func (s GetChannelsOutput) String() string { + return awsutil.Prettify(s) } -// SetRequestId sets the RequestId field's value. -func (s *EndpointResponse) SetRequestId(v string) *EndpointResponse { - s.RequestId = &v - return s +// GoString returns the string representation +func (s GetChannelsOutput) GoString() string { + return s.String() } -// SetUser sets the User field's value. -func (s *EndpointResponse) SetUser(v *EndpointUser) *EndpointResponse { - s.User = v +// SetChannelsResponse sets the ChannelsResponse field's value. +func (s *GetChannelsOutput) SetChannelsResponse(v *ChannelsResponse) *GetChannelsOutput { + s.ChannelsResponse = v return s } -// Specifies the content, including message variables and attributes, to use -// in a message that's sent directly to an endpoint. -type EndpointSendConfiguration struct { +type GetEmailChannelInput struct { _ struct{} `type:"structure"` - // The body of the message. If specified, this value overrides the default message - // body. - BodyOverride *string `type:"string"` - - // A map of custom attributes to attach to the message for the address. For - // a push notification, this payload is added to the data.pinpoint object. For - // an email or text message, this payload is added to email/SMS delivery receipt - // event attributes. - Context map[string]*string `type:"map"` - - // The raw, JSON-formatted string to use as the payload for the message. If - // specified, this value overrides the message. - RawContent *string `type:"string"` - - // A map of the message variables to merge with the variables specified for - // the default message (DefaultMessage.Substitutions). The variables specified - // in this map take precedence over all other variables. - Substitutions map[string][]*string `type:"map"` - - // The title or subject line of the message. If specified, this value overrides - // the default message title or subject line. - TitleOverride *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } // String returns the string representation -func (s EndpointSendConfiguration) String() string { +func (s GetEmailChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EndpointSendConfiguration) GoString() string { +func (s GetEmailChannelInput) GoString() string { return s.String() } -// SetBodyOverride sets the BodyOverride field's value. -func (s *EndpointSendConfiguration) SetBodyOverride(v string) *EndpointSendConfiguration { - s.BodyOverride = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetEmailChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetEmailChannelInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetContext sets the Context field's value. -func (s *EndpointSendConfiguration) SetContext(v map[string]*string) *EndpointSendConfiguration { - s.Context = v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetEmailChannelInput) SetApplicationId(v string) *GetEmailChannelInput { + s.ApplicationId = &v return s } -// SetRawContent sets the RawContent field's value. -func (s *EndpointSendConfiguration) SetRawContent(v string) *EndpointSendConfiguration { - s.RawContent = &v - return s +type GetEmailChannelOutput struct { + _ struct{} `type:"structure" payload:"EmailChannelResponse"` + + // Provides information about the status and settings of the email channel for + // an application. + // + // EmailChannelResponse is a required field + EmailChannelResponse *EmailChannelResponse `type:"structure" required:"true"` } -// SetSubstitutions sets the Substitutions field's value. -func (s *EndpointSendConfiguration) SetSubstitutions(v map[string][]*string) *EndpointSendConfiguration { - s.Substitutions = v - return s +// String returns the string representation +func (s GetEmailChannelOutput) String() string { + return awsutil.Prettify(s) } -// SetTitleOverride sets the TitleOverride field's value. -func (s *EndpointSendConfiguration) SetTitleOverride(v string) *EndpointSendConfiguration { - s.TitleOverride = &v +// GoString returns the string representation +func (s GetEmailChannelOutput) GoString() string { + return s.String() +} + +// SetEmailChannelResponse sets the EmailChannelResponse field's value. +func (s *GetEmailChannelOutput) SetEmailChannelResponse(v *EmailChannelResponse) *GetEmailChannelOutput { + s.EmailChannelResponse = v return s } -// Specifies data for one or more attributes that describe the user who's associated -// with an endpoint. -type EndpointUser struct { +type GetEmailTemplateInput struct { _ struct{} `type:"structure"` - // One or more custom attributes that describe the user by associating a name - // with an array of values. For example, the value of an attribute named Interests - // might be: ["science", "music", "travel"]. You can use these attributes as - // filter criteria when you create segments. - // - // When you define the name of a custom attribute, avoid using the following - // characters: number sign (#), colon (:), question mark (?), backslash (\), - // and slash (/). The Amazon Pinpoint console can't display attribute names - // that contain these characters. This limitation doesn't apply to attribute - // values. - UserAttributes map[string][]*string `type:"map"` + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` - // The unique identifier for the user. - UserId *string `type:"string"` + Version *string `location:"querystring" locationName:"version" type:"string"` } // String returns the string representation -func (s EndpointUser) String() string { +func (s GetEmailTemplateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EndpointUser) GoString() string { +func (s GetEmailTemplateInput) GoString() string { return s.String() } -// SetUserAttributes sets the UserAttributes field's value. -func (s *EndpointUser) SetUserAttributes(v map[string][]*string) *EndpointUser { - s.UserAttributes = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetEmailTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetEmailTemplateInput"} + 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 +} + +// SetTemplateName sets the TemplateName field's value. +func (s *GetEmailTemplateInput) SetTemplateName(v string) *GetEmailTemplateInput { + s.TemplateName = &v return s } -// SetUserId sets the UserId field's value. -func (s *EndpointUser) SetUserId(v string) *EndpointUser { - s.UserId = &v +// SetVersion sets the Version field's value. +func (s *GetEmailTemplateInput) SetVersion(v string) *GetEmailTemplateInput { + s.Version = &v return s } -// Provides information about all the endpoints that are associated with a user -// ID. -type EndpointsResponse struct { - _ struct{} `type:"structure"` +type GetEmailTemplateOutput struct { + _ struct{} `type:"structure" payload:"EmailTemplateResponse"` - // An array of responses, one for each endpoint that's associated with the user - // ID. + // Provides information about the content and settings for a message template + // that can be used in messages that are sent through the email channel. // - // Item is a required field - Item []*EndpointResponse `type:"list" required:"true"` + // EmailTemplateResponse is a required field + EmailTemplateResponse *EmailTemplateResponse `type:"structure" required:"true"` } // String returns the string representation -func (s EndpointsResponse) String() string { +func (s GetEmailTemplateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EndpointsResponse) GoString() string { +func (s GetEmailTemplateOutput) GoString() string { return s.String() } -// SetItem sets the Item field's value. -func (s *EndpointsResponse) SetItem(v []*EndpointResponse) *EndpointsResponse { - s.Item = v +// SetEmailTemplateResponse sets the EmailTemplateResponse field's value. +func (s *GetEmailTemplateOutput) SetEmailTemplateResponse(v *EmailTemplateResponse) *GetEmailTemplateOutput { + s.EmailTemplateResponse = v return s } -// Specifies information about an event that reports data to Amazon Pinpoint. -type Event struct { +type GetEndpointInput struct { _ struct{} `type:"structure"` - // The package name of the app that's recording the event. - AppPackageName *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The title of the app that's recording the event. - AppTitle *string `type:"string"` + // EndpointId is a required field + EndpointId *string `location:"uri" locationName:"endpoint-id" type:"string" required:"true"` +} - // The version number of the app that's recording the event. - AppVersionCode *string `type:"string"` +// String returns the string representation +func (s GetEndpointInput) String() string { + return awsutil.Prettify(s) +} - // One or more custom attributes that are associated with the event. - Attributes map[string]*string `type:"map"` +// GoString returns the string representation +func (s GetEndpointInput) GoString() string { + return s.String() +} - // The version of the SDK that's running on the client device. - ClientSdkVersion *string `type:"string"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetEndpointInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetEndpointInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.EndpointId == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointId")) + } + if s.EndpointId != nil && len(*s.EndpointId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EndpointId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *GetEndpointInput) SetApplicationId(v string) *GetEndpointInput { + s.ApplicationId = &v + return s +} + +// SetEndpointId sets the EndpointId field's value. +func (s *GetEndpointInput) SetEndpointId(v string) *GetEndpointInput { + s.EndpointId = &v + return s +} - // The name of the event. +type GetEndpointOutput struct { + _ struct{} `type:"structure" payload:"EndpointResponse"` + + // Provides information about the channel type and other settings for an endpoint. // - // EventType is a required field - EventType *string `type:"string" required:"true"` + // EndpointResponse is a required field + EndpointResponse *EndpointResponse `type:"structure" required:"true"` +} - // One or more custom metrics that are associated with the event. - Metrics map[string]*float64 `type:"map"` +// String returns the string representation +func (s GetEndpointOutput) String() string { + return awsutil.Prettify(s) +} - // The name of the SDK that's being used to record the event. - SdkName *string `type:"string"` +// GoString returns the string representation +func (s GetEndpointOutput) GoString() string { + return s.String() +} - // Information about the session in which the event occurred. - Session *Session `type:"structure"` +// SetEndpointResponse sets the EndpointResponse field's value. +func (s *GetEndpointOutput) SetEndpointResponse(v *EndpointResponse) *GetEndpointOutput { + s.EndpointResponse = v + return s +} - // The date and time, in ISO 8601 format, when the event occurred. - // - // Timestamp is a required field - Timestamp *string `type:"string" required:"true"` +type GetEventStreamInput struct { + _ struct{} `type:"structure"` + + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } // String returns the string representation -func (s Event) String() string { +func (s GetEventStreamInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Event) GoString() string { +func (s GetEventStreamInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *Event) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Event"} - if s.EventType == nil { - invalidParams.Add(request.NewErrParamRequired("EventType")) - } - if s.Timestamp == nil { - invalidParams.Add(request.NewErrParamRequired("Timestamp")) +func (s *GetEventStreamInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetEventStreamInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } - if s.Session != nil { - if err := s.Session.Validate(); err != nil { - invalidParams.AddNested("Session", err.(request.ErrInvalidParams)) - } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } if invalidParams.Len() > 0 { @@ -13867,122 +21238,72 @@ func (s *Event) Validate() error { return nil } -// SetAppPackageName sets the AppPackageName field's value. -func (s *Event) SetAppPackageName(v string) *Event { - s.AppPackageName = &v - return s -} - -// SetAppTitle sets the AppTitle field's value. -func (s *Event) SetAppTitle(v string) *Event { - s.AppTitle = &v - return s -} - -// SetAppVersionCode sets the AppVersionCode field's value. -func (s *Event) SetAppVersionCode(v string) *Event { - s.AppVersionCode = &v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *Event) SetAttributes(v map[string]*string) *Event { - s.Attributes = v - return s -} - -// SetClientSdkVersion sets the ClientSdkVersion field's value. -func (s *Event) SetClientSdkVersion(v string) *Event { - s.ClientSdkVersion = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetEventStreamInput) SetApplicationId(v string) *GetEventStreamInput { + s.ApplicationId = &v return s } -// SetEventType sets the EventType field's value. -func (s *Event) SetEventType(v string) *Event { - s.EventType = &v - return s -} +type GetEventStreamOutput struct { + _ struct{} `type:"structure" payload:"EventStream"` -// SetMetrics sets the Metrics field's value. -func (s *Event) SetMetrics(v map[string]*float64) *Event { - s.Metrics = v - return s + // Specifies settings for publishing event data to an Amazon Kinesis data stream + // or an Amazon Kinesis Data Firehose delivery stream. + // + // EventStream is a required field + EventStream *EventStream `type:"structure" required:"true"` } -// SetSdkName sets the SdkName field's value. -func (s *Event) SetSdkName(v string) *Event { - s.SdkName = &v - return s +// String returns the string representation +func (s GetEventStreamOutput) String() string { + return awsutil.Prettify(s) } -// SetSession sets the Session field's value. -func (s *Event) SetSession(v *Session) *Event { - s.Session = v - return s +// GoString returns the string representation +func (s GetEventStreamOutput) GoString() string { + return s.String() } -// SetTimestamp sets the Timestamp field's value. -func (s *Event) SetTimestamp(v string) *Event { - s.Timestamp = &v +// SetEventStream sets the EventStream field's value. +func (s *GetEventStreamOutput) SetEventStream(v *EventStream) *GetEventStreamOutput { + s.EventStream = v return s } -// Specifies the dimensions for an event filter that determines when a campaign -// is sent. -type EventDimensions struct { +type GetExportJobInput struct { _ struct{} `type:"structure"` - // One or more custom attributes that your app reports to Amazon Pinpoint. You - // can use these attributes as selection criteria when you create an event filter. - Attributes map[string]*AttributeDimension `type:"map"` - - // The name of the event that causes the campaign to be sent. This can be a - // standard type of event that Amazon Pinpoint generates, such as _session.start, - // or a custom event that's specific to your app. - EventType *SetDimension `type:"structure"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // One or more custom metrics that your app reports to Amazon Pinpoint. You - // can use these metrics as selection criteria when you create an event filter. - Metrics map[string]*MetricDimension `type:"map"` + // JobId is a required field + JobId *string `location:"uri" locationName:"job-id" type:"string" required:"true"` } // String returns the string representation -func (s EventDimensions) String() string { +func (s GetExportJobInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EventDimensions) GoString() string { +func (s GetExportJobInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *EventDimensions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EventDimensions"} - 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)) - } - } +func (s *GetExportJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetExportJobInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } - if s.EventType != nil { - if err := s.EventType.Validate(); err != nil { - invalidParams.AddNested("EventType", err.(request.ErrInvalidParams)) - } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } - if s.Metrics != nil { - for i, v := range s.Metrics { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Metrics", i), err.(request.ErrInvalidParams)) - } - } + 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 { @@ -13991,189 +21312,153 @@ func (s *EventDimensions) Validate() error { return nil } -// SetAttributes sets the Attributes field's value. -func (s *EventDimensions) SetAttributes(v map[string]*AttributeDimension) *EventDimensions { - s.Attributes = v - return s -} - -// SetEventType sets the EventType field's value. -func (s *EventDimensions) SetEventType(v *SetDimension) *EventDimensions { - s.EventType = v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetExportJobInput) SetApplicationId(v string) *GetExportJobInput { + s.ApplicationId = &v return s } -// SetMetrics sets the Metrics field's value. -func (s *EventDimensions) SetMetrics(v map[string]*MetricDimension) *EventDimensions { - s.Metrics = v +// SetJobId sets the JobId field's value. +func (s *GetExportJobInput) SetJobId(v string) *GetExportJobInput { + s.JobId = &v return s } -// Provides the status code and message that result from processing an event. -type EventItemResponse struct { - _ struct{} `type:"structure"` - - // A custom message that's returned in the response as a result of processing - // the event. - Message *string `type:"string"` +type GetExportJobOutput struct { + _ struct{} `type:"structure" payload:"ExportJobResponse"` - // The status code that's returned in the response as a result of processing - // the event. Possible values are: 202, for events that were accepted; and, - // 400, for events that weren't valid. - StatusCode *int64 `type:"integer"` + // Provides information about the status and settings of a job that exports + // endpoint definitions to a file. The file can be added directly to an Amazon + // Simple Storage Service (Amazon S3) bucket by using the Amazon Pinpoint API + // or downloaded directly to a computer by using the Amazon Pinpoint console. + // + // ExportJobResponse is a required field + ExportJobResponse *ExportJobResponse `type:"structure" required:"true"` } // String returns the string representation -func (s EventItemResponse) String() string { +func (s GetExportJobOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EventItemResponse) GoString() string { +func (s GetExportJobOutput) GoString() string { return s.String() } -// SetMessage sets the Message field's value. -func (s *EventItemResponse) SetMessage(v string) *EventItemResponse { - s.Message = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *EventItemResponse) SetStatusCode(v int64) *EventItemResponse { - s.StatusCode = &v +// SetExportJobResponse sets the ExportJobResponse field's value. +func (s *GetExportJobOutput) SetExportJobResponse(v *ExportJobResponse) *GetExportJobOutput { + s.ExportJobResponse = v return s } -// Specifies settings for publishing event data to an Amazon Kinesis data stream -// or an Amazon Kinesis Data Firehose delivery stream. -type EventStream struct { - _ struct{} `type:"structure"` - - // The unique identifier for the application to publish event data for. - // - // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the Amazon Kinesis data stream or Amazon - // Kinesis Data Firehose delivery stream to publish event data to. - // - // For a Kinesis data stream, the ARN format is: arn:aws:kinesis:region:account-id:stream/stream_name - // - // For a Kinesis Data Firehose delivery stream, the ARN format is: arn:aws:firehose:region:account-id:deliverystream/stream_name - // - // DestinationStreamArn is a required field - DestinationStreamArn *string `type:"string" required:"true"` - - // (Deprecated) Your AWS account ID, which you assigned to an external ID key - // in an IAM trust policy. Amazon Pinpoint previously used this value to assume - // an IAM role when publishing event data, but we removed this requirement. - // We don't recommend use of external IDs for IAM roles that are assumed by - // Amazon Pinpoint. - ExternalId *string `type:"string"` +type GetExportJobsInput struct { + _ struct{} `type:"structure"` - // The date, in ISO 8601 format, when the event stream was last modified. - LastModifiedDate *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The IAM user who last modified the event stream. - LastUpdatedBy *string `type:"string"` + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` - // The AWS Identity and Access Management (IAM) role that authorizes Amazon - // Pinpoint to publish event data to the stream in your AWS account. - // - // RoleArn is a required field - RoleArn *string `type:"string" required:"true"` + Token *string `location:"querystring" locationName:"token" type:"string"` } // String returns the string representation -func (s EventStream) String() string { +func (s GetExportJobsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EventStream) GoString() string { +func (s GetExportJobsInput) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetExportJobsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetExportJobsInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetApplicationId sets the ApplicationId field's value. -func (s *EventStream) SetApplicationId(v string) *EventStream { +func (s *GetExportJobsInput) SetApplicationId(v string) *GetExportJobsInput { s.ApplicationId = &v return s } -// SetDestinationStreamArn sets the DestinationStreamArn field's value. -func (s *EventStream) SetDestinationStreamArn(v string) *EventStream { - s.DestinationStreamArn = &v +// SetPageSize sets the PageSize field's value. +func (s *GetExportJobsInput) SetPageSize(v string) *GetExportJobsInput { + s.PageSize = &v return s } -// SetExternalId sets the ExternalId field's value. -func (s *EventStream) SetExternalId(v string) *EventStream { - s.ExternalId = &v +// SetToken sets the Token field's value. +func (s *GetExportJobsInput) SetToken(v string) *GetExportJobsInput { + s.Token = &v return s } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *EventStream) SetLastModifiedDate(v string) *EventStream { - s.LastModifiedDate = &v - return s +type GetExportJobsOutput struct { + _ struct{} `type:"structure" payload:"ExportJobsResponse"` + + // Provides information about all the export jobs that are associated with an + // application or segment. An export job is a job that exports endpoint definitions + // to a file. + // + // ExportJobsResponse is a required field + ExportJobsResponse *ExportJobsResponse `type:"structure" required:"true"` } -// SetLastUpdatedBy sets the LastUpdatedBy field's value. -func (s *EventStream) SetLastUpdatedBy(v string) *EventStream { - s.LastUpdatedBy = &v - return s +// String returns the string representation +func (s GetExportJobsOutput) String() string { + return awsutil.Prettify(s) } -// SetRoleArn sets the RoleArn field's value. -func (s *EventStream) SetRoleArn(v string) *EventStream { - s.RoleArn = &v +// GoString returns the string representation +func (s GetExportJobsOutput) GoString() string { + return s.String() +} + +// SetExportJobsResponse sets the ExportJobsResponse field's value. +func (s *GetExportJobsOutput) SetExportJobsResponse(v *ExportJobsResponse) *GetExportJobsOutput { + s.ExportJobsResponse = v return s } -// Specifies a batch of endpoints and events to process. -type EventsBatch struct { +type GetGcmChannelInput struct { _ struct{} `type:"structure"` - // A set of properties and attributes that are associated with the endpoint. - // - // Endpoint is a required field - Endpoint *PublicEndpoint `type:"structure" required:"true"` - - // A set of properties that are associated with the event. - // - // Events is a required field - Events map[string]*Event `type:"map" required:"true"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } // String returns the string representation -func (s EventsBatch) String() string { +func (s GetGcmChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EventsBatch) GoString() string { +func (s GetGcmChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *EventsBatch) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EventsBatch"} - if s.Endpoint == nil { - invalidParams.Add(request.NewErrParamRequired("Endpoint")) - } - if s.Events == nil { - invalidParams.Add(request.NewErrParamRequired("Events")) +func (s *GetGcmChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetGcmChannelInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } - if s.Events != nil { - for i, v := range s.Events { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Events", i), err.(request.ErrInvalidParams)) - } - } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } if invalidParams.Len() > 0 { @@ -14182,54 +21467,74 @@ func (s *EventsBatch) Validate() error { return nil } -// SetEndpoint sets the Endpoint field's value. -func (s *EventsBatch) SetEndpoint(v *PublicEndpoint) *EventsBatch { - s.Endpoint = v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetGcmChannelInput) SetApplicationId(v string) *GetGcmChannelInput { + s.ApplicationId = &v return s } -// SetEvents sets the Events field's value. -func (s *EventsBatch) SetEvents(v map[string]*Event) *EventsBatch { - s.Events = v +type GetGcmChannelOutput struct { + _ struct{} `type:"structure" payload:"GCMChannelResponse"` + + // Provides information about the status and settings of the GCM channel for + // an application. The GCM channel enables Amazon Pinpoint to send push notifications + // through the Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging + // (GCM), service. + // + // GCMChannelResponse is a required field + GCMChannelResponse *GCMChannelResponse `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetGcmChannelOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetGcmChannelOutput) GoString() string { + return s.String() +} + +// SetGCMChannelResponse sets the GCMChannelResponse field's value. +func (s *GetGcmChannelOutput) SetGCMChannelResponse(v *GCMChannelResponse) *GetGcmChannelOutput { + s.GCMChannelResponse = v return s } -// Specifies a batch of events to process. -type EventsRequest struct { +type GetImportJobInput struct { _ struct{} `type:"structure"` - // The batch of events to process. For each item in a batch, the endpoint ID - // acts as a key that has an EventsBatch object as its value. - // - // BatchItem is a required field - BatchItem map[string]*EventsBatch `type:"map" required:"true"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + // JobId is a required field + JobId *string `location:"uri" locationName:"job-id" type:"string" required:"true"` } // String returns the string representation -func (s EventsRequest) String() string { +func (s GetImportJobInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EventsRequest) GoString() string { +func (s GetImportJobInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *EventsRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EventsRequest"} - if s.BatchItem == nil { - invalidParams.Add(request.NewErrParamRequired("BatchItem")) +func (s *GetImportJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetImportJobInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } - if s.BatchItem != nil { - for i, v := range s.BatchItem { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "BatchItem", i), err.(request.ErrInvalidParams)) - } - } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + 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 { @@ -14238,88 +21543,75 @@ func (s *EventsRequest) Validate() error { return nil } -// SetBatchItem sets the BatchItem field's value. -func (s *EventsRequest) SetBatchItem(v map[string]*EventsBatch) *EventsRequest { - s.BatchItem = v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetImportJobInput) SetApplicationId(v string) *GetImportJobInput { + s.ApplicationId = &v return s } -// Provides information about endpoints and the events that they're associated -// with. -type EventsResponse struct { - _ struct{} `type:"structure"` +// SetJobId sets the JobId field's value. +func (s *GetImportJobInput) SetJobId(v string) *GetImportJobInput { + s.JobId = &v + return s +} - // A map that contains a multipart response for each endpoint. For each item - // in this object, the endpoint ID is the key and the item response is the value. - // If no item response exists, the value can also be one of the following: 202, - // the request was processed successfully; or 400, the payload wasn't valid - // or required fields were missing. - Results map[string]*ItemResponse `type:"map"` +type GetImportJobOutput struct { + _ struct{} `type:"structure" payload:"ImportJobResponse"` + + // Provides information about the status and settings of a job that imports + // endpoint definitions from one or more files. The files can be stored in an + // Amazon Simple Storage Service (Amazon S3) bucket or uploaded directly from + // a computer by using the Amazon Pinpoint console. + // + // ImportJobResponse is a required field + ImportJobResponse *ImportJobResponse `type:"structure" required:"true"` } // String returns the string representation -func (s EventsResponse) String() string { +func (s GetImportJobOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EventsResponse) GoString() string { +func (s GetImportJobOutput) GoString() string { return s.String() } -// SetResults sets the Results field's value. -func (s *EventsResponse) SetResults(v map[string]*ItemResponse) *EventsResponse { - s.Results = v +// SetImportJobResponse sets the ImportJobResponse field's value. +func (s *GetImportJobOutput) SetImportJobResponse(v *ImportJobResponse) *GetImportJobOutput { + s.ImportJobResponse = v return s } -// Specifies the settings for a job that exports endpoint definitions to an -// Amazon Simple Storage Service (Amazon S3) bucket. -type ExportJobRequest struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the AWS Identity and Access Management - // (IAM) role that authorizes Amazon Pinpoint to access the Amazon S3 location - // where you want to export endpoint definitions to. - // - // RoleArn is a required field - RoleArn *string `type:"string" required:"true"` - - // The URL of the location in an Amazon Simple Storage Service (Amazon S3) bucket - // where you want to export endpoint definitions to. This location is typically - // a folder that contains multiple files. The URL should be in the following - // format: s3://bucket-name/folder-name/. - // - // S3UrlPrefix is a required field - S3UrlPrefix *string `type:"string" required:"true"` - - // The identifier for the segment to export endpoint definitions from. If you - // don't specify this value, Amazon Pinpoint exports definitions for all the - // endpoints that are associated with the application. - SegmentId *string `type:"string"` +type GetImportJobsInput struct { + _ struct{} `type:"structure"` - // The version of the segment to export endpoint definitions from, if specified. - SegmentVersion *int64 `type:"integer"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + + Token *string `location:"querystring" locationName:"token" type:"string"` } // String returns the string representation -func (s ExportJobRequest) String() string { +func (s GetImportJobsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ExportJobRequest) GoString() string { +func (s GetImportJobsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ExportJobRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExportJobRequest"} - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) +func (s *GetImportJobsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetImportJobsInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } - if s.S3UrlPrefix == nil { - invalidParams.Add(request.NewErrParamRequired("S3UrlPrefix")) + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } if invalidParams.Len() > 0 { @@ -14328,322 +21620,328 @@ func (s *ExportJobRequest) Validate() error { return nil } -// SetRoleArn sets the RoleArn field's value. -func (s *ExportJobRequest) SetRoleArn(v string) *ExportJobRequest { - s.RoleArn = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetImportJobsInput) SetApplicationId(v string) *GetImportJobsInput { + s.ApplicationId = &v return s } -// SetS3UrlPrefix sets the S3UrlPrefix field's value. -func (s *ExportJobRequest) SetS3UrlPrefix(v string) *ExportJobRequest { - s.S3UrlPrefix = &v +// SetPageSize sets the PageSize field's value. +func (s *GetImportJobsInput) SetPageSize(v string) *GetImportJobsInput { + s.PageSize = &v return s } -// SetSegmentId sets the SegmentId field's value. -func (s *ExportJobRequest) SetSegmentId(v string) *ExportJobRequest { - s.SegmentId = &v +// SetToken sets the Token field's value. +func (s *GetImportJobsInput) SetToken(v string) *GetImportJobsInput { + s.Token = &v return s } -// SetSegmentVersion sets the SegmentVersion field's value. -func (s *ExportJobRequest) SetSegmentVersion(v int64) *ExportJobRequest { - s.SegmentVersion = &v +type GetImportJobsOutput struct { + _ struct{} `type:"structure" payload:"ImportJobsResponse"` + + // Provides information about the status and settings of all the import jobs + // that are associated with an application or segment. An import job is a job + // that imports endpoint definitions from one or more files. + // + // ImportJobsResponse is a required field + ImportJobsResponse *ImportJobsResponse `type:"structure" required:"true"` +} + +// String returns the string representation +func (s GetImportJobsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetImportJobsOutput) GoString() string { + return s.String() +} + +// SetImportJobsResponse sets the ImportJobsResponse field's value. +func (s *GetImportJobsOutput) SetImportJobsResponse(v *ImportJobsResponse) *GetImportJobsOutput { + s.ImportJobsResponse = v return s } -// Provides information about the resource settings for a job that exports endpoint -// definitions to a file. The file can be added directly to an Amazon Simple -// Storage Service (Amazon S3) bucket by using the Amazon Pinpoint API or downloaded -// directly to a computer by using the Amazon Pinpoint console. -type ExportJobResource struct { +type GetJourneyDateRangeKpiInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the AWS Identity and Access Management - // (IAM) role that authorized Amazon Pinpoint to access the Amazon S3 location - // where the endpoint definitions were exported to. - // - // RoleArn is a required field - RoleArn *string `type:"string" required:"true"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The URL of the location in an Amazon Simple Storage Service (Amazon S3) bucket - // where the endpoint definitions were exported to. This location is typically - // a folder that contains multiple files. The URL should be in the following - // format: s3://bucket-name/folder-name/. - // - // S3UrlPrefix is a required field - S3UrlPrefix *string `type:"string" required:"true"` + EndTime *time.Time `location:"querystring" locationName:"end-time" type:"timestamp" timestampFormat:"iso8601"` - // The identifier for the segment that the endpoint definitions were exported - // from. If this value isn't present, Amazon Pinpoint exported definitions for - // all the endpoints that are associated with the application. - SegmentId *string `type:"string"` + // JourneyId is a required field + JourneyId *string `location:"uri" locationName:"journey-id" type:"string" required:"true"` - // The version of the segment that the endpoint definitions were exported from. - SegmentVersion *int64 `type:"integer"` + // KpiName is a required field + KpiName *string `location:"uri" locationName:"kpi-name" type:"string" required:"true"` + + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` + + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + + StartTime *time.Time `location:"querystring" locationName:"start-time" type:"timestamp" timestampFormat:"iso8601"` } // String returns the string representation -func (s ExportJobResource) String() string { +func (s GetJourneyDateRangeKpiInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ExportJobResource) GoString() string { +func (s GetJourneyDateRangeKpiInput) GoString() string { return s.String() } -// SetRoleArn sets the RoleArn field's value. -func (s *ExportJobResource) SetRoleArn(v string) *ExportJobResource { - s.RoleArn = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetJourneyDateRangeKpiInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetJourneyDateRangeKpiInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.JourneyId == nil { + invalidParams.Add(request.NewErrParamRequired("JourneyId")) + } + if s.JourneyId != nil && len(*s.JourneyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("JourneyId", 1)) + } + if s.KpiName == nil { + invalidParams.Add(request.NewErrParamRequired("KpiName")) + } + if s.KpiName != nil && len(*s.KpiName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("KpiName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetS3UrlPrefix sets the S3UrlPrefix field's value. -func (s *ExportJobResource) SetS3UrlPrefix(v string) *ExportJobResource { - s.S3UrlPrefix = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetJourneyDateRangeKpiInput) SetApplicationId(v string) *GetJourneyDateRangeKpiInput { + s.ApplicationId = &v return s } -// SetSegmentId sets the SegmentId field's value. -func (s *ExportJobResource) SetSegmentId(v string) *ExportJobResource { - s.SegmentId = &v +// SetEndTime sets the EndTime field's value. +func (s *GetJourneyDateRangeKpiInput) SetEndTime(v time.Time) *GetJourneyDateRangeKpiInput { + s.EndTime = &v return s } -// SetSegmentVersion sets the SegmentVersion field's value. -func (s *ExportJobResource) SetSegmentVersion(v int64) *ExportJobResource { - s.SegmentVersion = &v +// SetJourneyId sets the JourneyId field's value. +func (s *GetJourneyDateRangeKpiInput) SetJourneyId(v string) *GetJourneyDateRangeKpiInput { + s.JourneyId = &v return s } -// Provides information about the status and settings of a job that exports -// endpoint definitions to a file. The file can be added directly to an Amazon -// Simple Storage Service (Amazon S3) bucket by using the Amazon Pinpoint API -// or downloaded directly to a computer by using the Amazon Pinpoint console. -type ExportJobResponse struct { - _ struct{} `type:"structure"` - - // The unique identifier for the application that's associated with the export - // job. - // - // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` - - // The number of pieces that were processed successfully (completed) by the - // export job, as of the time of the request. - CompletedPieces *int64 `type:"integer"` - - // The date, in ISO 8601 format, when the export job was completed. - CompletionDate *string `type:"string"` - - // The date, in ISO 8601 format, when the export job was created. - // - // CreationDate is a required field - CreationDate *string `type:"string" required:"true"` - - // The resource settings that apply to the export job. - // - // Definition is a required field - Definition *ExportJobResource `type:"structure" required:"true"` - - // The number of pieces that weren't processed successfully (failed) by the - // export job, as of the time of the request. - FailedPieces *int64 `type:"integer"` - - // An array of entries, one for each of the first 100 entries that weren't processed - // successfully (failed) by the export job, if any. - Failures []*string `type:"list"` - - // The unique identifier for the export job. - // - // Id is a required field - Id *string `type:"string" required:"true"` +// SetKpiName sets the KpiName field's value. +func (s *GetJourneyDateRangeKpiInput) SetKpiName(v string) *GetJourneyDateRangeKpiInput { + s.KpiName = &v + return s +} - // The status of the export job. The job status is FAILED if Amazon Pinpoint - // wasn't able to process one or more pieces in the job. - // - // JobStatus is a required field - JobStatus *string `type:"string" required:"true" enum:"JobStatus"` +// SetNextToken sets the NextToken field's value. +func (s *GetJourneyDateRangeKpiInput) SetNextToken(v string) *GetJourneyDateRangeKpiInput { + s.NextToken = &v + return s +} - // The total number of endpoint definitions that weren't processed successfully - // (failed) by the export job, typically because an error, such as a syntax - // error, occurred. - TotalFailures *int64 `type:"integer"` +// SetPageSize sets the PageSize field's value. +func (s *GetJourneyDateRangeKpiInput) SetPageSize(v string) *GetJourneyDateRangeKpiInput { + s.PageSize = &v + return s +} - // The total number of pieces that must be processed to complete the export - // job. Each piece consists of an approximately equal portion of the endpoint - // definitions that are part of the export job. - TotalPieces *int64 `type:"integer"` +// SetStartTime sets the StartTime field's value. +func (s *GetJourneyDateRangeKpiInput) SetStartTime(v time.Time) *GetJourneyDateRangeKpiInput { + s.StartTime = &v + return s +} - // The total number of endpoint definitions that were processed by the export - // job. - TotalProcessed *int64 `type:"integer"` +type GetJourneyDateRangeKpiOutput struct { + _ struct{} `type:"structure" payload:"JourneyDateRangeKpiResponse"` - // The job type. This value is EXPORT for export jobs. + // Provides the results of a query that retrieved the data for a standard engagement + // metric that applies to a journey, and provides information about that query. // - // Type is a required field - Type *string `type:"string" required:"true"` + // JourneyDateRangeKpiResponse is a required field + JourneyDateRangeKpiResponse *JourneyDateRangeKpiResponse `type:"structure" required:"true"` } // String returns the string representation -func (s ExportJobResponse) String() string { +func (s GetJourneyDateRangeKpiOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ExportJobResponse) GoString() string { +func (s GetJourneyDateRangeKpiOutput) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *ExportJobResponse) SetApplicationId(v string) *ExportJobResponse { - s.ApplicationId = &v +// SetJourneyDateRangeKpiResponse sets the JourneyDateRangeKpiResponse field's value. +func (s *GetJourneyDateRangeKpiOutput) SetJourneyDateRangeKpiResponse(v *JourneyDateRangeKpiResponse) *GetJourneyDateRangeKpiOutput { + s.JourneyDateRangeKpiResponse = v return s } -// SetCompletedPieces sets the CompletedPieces field's value. -func (s *ExportJobResponse) SetCompletedPieces(v int64) *ExportJobResponse { - s.CompletedPieces = &v - return s -} +type GetJourneyExecutionActivityMetricsInput struct { + _ struct{} `type:"structure"` -// SetCompletionDate sets the CompletionDate field's value. -func (s *ExportJobResponse) SetCompletionDate(v string) *ExportJobResponse { - s.CompletionDate = &v - return s -} + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` -// SetCreationDate sets the CreationDate field's value. -func (s *ExportJobResponse) SetCreationDate(v string) *ExportJobResponse { - s.CreationDate = &v - return s -} + // JourneyActivityId is a required field + JourneyActivityId *string `location:"uri" locationName:"journey-activity-id" type:"string" required:"true"` -// SetDefinition sets the Definition field's value. -func (s *ExportJobResponse) SetDefinition(v *ExportJobResource) *ExportJobResponse { - s.Definition = v - return s + // JourneyId is a required field + JourneyId *string `location:"uri" locationName:"journey-id" type:"string" required:"true"` + + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` + + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` } -// SetFailedPieces sets the FailedPieces field's value. -func (s *ExportJobResponse) SetFailedPieces(v int64) *ExportJobResponse { - s.FailedPieces = &v - return s +// String returns the string representation +func (s GetJourneyExecutionActivityMetricsInput) String() string { + return awsutil.Prettify(s) } -// SetFailures sets the Failures field's value. -func (s *ExportJobResponse) SetFailures(v []*string) *ExportJobResponse { - s.Failures = v - return s +// GoString returns the string representation +func (s GetJourneyExecutionActivityMetricsInput) GoString() string { + return s.String() } -// SetId sets the Id field's value. -func (s *ExportJobResponse) SetId(v string) *ExportJobResponse { - s.Id = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetJourneyExecutionActivityMetricsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetJourneyExecutionActivityMetricsInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.JourneyActivityId == nil { + invalidParams.Add(request.NewErrParamRequired("JourneyActivityId")) + } + if s.JourneyActivityId != nil && len(*s.JourneyActivityId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("JourneyActivityId", 1)) + } + if s.JourneyId == nil { + invalidParams.Add(request.NewErrParamRequired("JourneyId")) + } + if s.JourneyId != nil && len(*s.JourneyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("JourneyId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetJobStatus sets the JobStatus field's value. -func (s *ExportJobResponse) SetJobStatus(v string) *ExportJobResponse { - s.JobStatus = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetJourneyExecutionActivityMetricsInput) SetApplicationId(v string) *GetJourneyExecutionActivityMetricsInput { + s.ApplicationId = &v return s } -// SetTotalFailures sets the TotalFailures field's value. -func (s *ExportJobResponse) SetTotalFailures(v int64) *ExportJobResponse { - s.TotalFailures = &v +// SetJourneyActivityId sets the JourneyActivityId field's value. +func (s *GetJourneyExecutionActivityMetricsInput) SetJourneyActivityId(v string) *GetJourneyExecutionActivityMetricsInput { + s.JourneyActivityId = &v return s } -// SetTotalPieces sets the TotalPieces field's value. -func (s *ExportJobResponse) SetTotalPieces(v int64) *ExportJobResponse { - s.TotalPieces = &v +// SetJourneyId sets the JourneyId field's value. +func (s *GetJourneyExecutionActivityMetricsInput) SetJourneyId(v string) *GetJourneyExecutionActivityMetricsInput { + s.JourneyId = &v return s } -// SetTotalProcessed sets the TotalProcessed field's value. -func (s *ExportJobResponse) SetTotalProcessed(v int64) *ExportJobResponse { - s.TotalProcessed = &v +// SetNextToken sets the NextToken field's value. +func (s *GetJourneyExecutionActivityMetricsInput) SetNextToken(v string) *GetJourneyExecutionActivityMetricsInput { + s.NextToken = &v return s } -// SetType sets the Type field's value. -func (s *ExportJobResponse) SetType(v string) *ExportJobResponse { - s.Type = &v +// SetPageSize sets the PageSize field's value. +func (s *GetJourneyExecutionActivityMetricsInput) SetPageSize(v string) *GetJourneyExecutionActivityMetricsInput { + s.PageSize = &v return s } -// Provides information about all the export jobs that are associated with an -// application or segment. An export job is a job that exports endpoint definitions -// to a file. -type ExportJobsResponse struct { - _ struct{} `type:"structure"` +type GetJourneyExecutionActivityMetricsOutput struct { + _ struct{} `type:"structure" payload:"JourneyExecutionActivityMetricsResponse"` - // An array of responses, one for each export job that's associated with the - // application (Export Jobs resource) or segment (Segment Export Jobs resource). + // Provides the results of a query that retrieved the data for a standard execution + // metric that applies to a journey activity, and provides information about + // that query. // - // Item is a required field - Item []*ExportJobResponse `type:"list" required:"true"` - - // The string to use in a subsequent request to get the next page of results - // in a paginated response. This value is null if there are no additional pages. - NextToken *string `type:"string"` + // JourneyExecutionActivityMetricsResponse is a required field + JourneyExecutionActivityMetricsResponse *JourneyExecutionActivityMetricsResponse `type:"structure" required:"true"` } // String returns the string representation -func (s ExportJobsResponse) String() string { +func (s GetJourneyExecutionActivityMetricsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ExportJobsResponse) GoString() string { +func (s GetJourneyExecutionActivityMetricsOutput) GoString() string { return s.String() } -// SetItem sets the Item field's value. -func (s *ExportJobsResponse) SetItem(v []*ExportJobResponse) *ExportJobsResponse { - s.Item = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ExportJobsResponse) SetNextToken(v string) *ExportJobsResponse { - s.NextToken = &v +// SetJourneyExecutionActivityMetricsResponse sets the JourneyExecutionActivityMetricsResponse field's value. +func (s *GetJourneyExecutionActivityMetricsOutput) SetJourneyExecutionActivityMetricsResponse(v *JourneyExecutionActivityMetricsResponse) *GetJourneyExecutionActivityMetricsOutput { + s.JourneyExecutionActivityMetricsResponse = v return s } -// Specifies the status and settings of the GCM channel for an application. -// This channel enables Amazon Pinpoint to send push notifications through the -// Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging (GCM), service. -type GCMChannelRequest struct { +type GetJourneyExecutionMetricsInput struct { _ struct{} `type:"structure"` - // The API key, also referred to as a server key, that you received from Google - // to communicate with Google services. - // - // ApiKey is a required field - ApiKey *string `type:"string" required:"true"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // Specifies whether to enable the GCM channel for the application. - Enabled *bool `type:"boolean"` + // JourneyId is a required field + JourneyId *string `location:"uri" locationName:"journey-id" type:"string" required:"true"` + + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` + + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` } // String returns the string representation -func (s GCMChannelRequest) String() string { +func (s GetJourneyExecutionMetricsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GCMChannelRequest) GoString() string { +func (s GetJourneyExecutionMetricsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GCMChannelRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GCMChannelRequest"} - if s.ApiKey == nil { - invalidParams.Add(request.NewErrParamRequired("ApiKey")) +func (s *GetJourneyExecutionMetricsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetJourneyExecutionMetricsInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.JourneyId == nil { + invalidParams.Add(request.NewErrParamRequired("JourneyId")) + } + if s.JourneyId != nil && len(*s.JourneyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("JourneyId", 1)) } if invalidParams.Len() > 0 { @@ -14652,394 +21950,437 @@ func (s *GCMChannelRequest) Validate() error { return nil } -// SetApiKey sets the ApiKey field's value. -func (s *GCMChannelRequest) SetApiKey(v string) *GCMChannelRequest { - s.ApiKey = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetJourneyExecutionMetricsInput) SetApplicationId(v string) *GetJourneyExecutionMetricsInput { + s.ApplicationId = &v return s } -// SetEnabled sets the Enabled field's value. -func (s *GCMChannelRequest) SetEnabled(v bool) *GCMChannelRequest { - s.Enabled = &v +// SetJourneyId sets the JourneyId field's value. +func (s *GetJourneyExecutionMetricsInput) SetJourneyId(v string) *GetJourneyExecutionMetricsInput { + s.JourneyId = &v return s } -// Provides information about the status and settings of the GCM channel for -// an application. The GCM channel enables Amazon Pinpoint to send push notifications -// through the Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging -// (GCM), service. -type GCMChannelResponse struct { - _ struct{} `type:"structure"` - - // The unique identifier for the application that the GCM channel applies to. - ApplicationId *string `type:"string"` - - // The date and time when the GCM channel was enabled. - CreationDate *string `type:"string"` - - // The API key, also referred to as a server key, that you received from Google - // to communicate with Google services. - // - // Credential is a required field - Credential *string `type:"string" required:"true"` - - // Specifies whether the GCM channel is enabled for the application. - Enabled *bool `type:"boolean"` - - // (Not used) This property is retained only for backward compatibility. - HasCredential *bool `type:"boolean"` - - // (Deprecated) An identifier for the GCM channel. This property is retained - // only for backward compatibility. - Id *string `type:"string"` - - // Specifies whether the GCM channel is archived. - IsArchived *bool `type:"boolean"` +// SetNextToken sets the NextToken field's value. +func (s *GetJourneyExecutionMetricsInput) SetNextToken(v string) *GetJourneyExecutionMetricsInput { + s.NextToken = &v + return s +} - // The user who last modified the GCM channel. - LastModifiedBy *string `type:"string"` +// SetPageSize sets the PageSize field's value. +func (s *GetJourneyExecutionMetricsInput) SetPageSize(v string) *GetJourneyExecutionMetricsInput { + s.PageSize = &v + return s +} - // The date and time when the GCM channel was last modified. - LastModifiedDate *string `type:"string"` +type GetJourneyExecutionMetricsOutput struct { + _ struct{} `type:"structure" payload:"JourneyExecutionMetricsResponse"` - // The type of messaging or notification platform for the channel. For the GCM - // channel, this value is GCM. + // Provides the results of a query that retrieved the data for a standard execution + // metric that applies to a journey, and provides information about that query. // - // Platform is a required field - Platform *string `type:"string" required:"true"` - - // The current version of the GCM channel. - Version *int64 `type:"integer"` + // JourneyExecutionMetricsResponse is a required field + JourneyExecutionMetricsResponse *JourneyExecutionMetricsResponse `type:"structure" required:"true"` } // String returns the string representation -func (s GCMChannelResponse) String() string { +func (s GetJourneyExecutionMetricsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GCMChannelResponse) GoString() string { +func (s GetJourneyExecutionMetricsOutput) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *GCMChannelResponse) SetApplicationId(v string) *GCMChannelResponse { - s.ApplicationId = &v +// SetJourneyExecutionMetricsResponse sets the JourneyExecutionMetricsResponse field's value. +func (s *GetJourneyExecutionMetricsOutput) SetJourneyExecutionMetricsResponse(v *JourneyExecutionMetricsResponse) *GetJourneyExecutionMetricsOutput { + s.JourneyExecutionMetricsResponse = v return s } -// SetCreationDate sets the CreationDate field's value. -func (s *GCMChannelResponse) SetCreationDate(v string) *GCMChannelResponse { - s.CreationDate = &v - return s +type GetJourneyInput struct { + _ struct{} `type:"structure"` + + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + // JourneyId is a required field + JourneyId *string `location:"uri" locationName:"journey-id" type:"string" required:"true"` } -// SetCredential sets the Credential field's value. -func (s *GCMChannelResponse) SetCredential(v string) *GCMChannelResponse { - s.Credential = &v - return s +// String returns the string representation +func (s GetJourneyInput) String() string { + return awsutil.Prettify(s) } -// SetEnabled sets the Enabled field's value. -func (s *GCMChannelResponse) SetEnabled(v bool) *GCMChannelResponse { - s.Enabled = &v - return s +// GoString returns the string representation +func (s GetJourneyInput) GoString() string { + return s.String() } -// SetHasCredential sets the HasCredential field's value. -func (s *GCMChannelResponse) SetHasCredential(v bool) *GCMChannelResponse { - s.HasCredential = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetJourneyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetJourneyInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.JourneyId == nil { + invalidParams.Add(request.NewErrParamRequired("JourneyId")) + } + if s.JourneyId != nil && len(*s.JourneyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("JourneyId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetId sets the Id field's value. -func (s *GCMChannelResponse) SetId(v string) *GCMChannelResponse { - s.Id = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetJourneyInput) SetApplicationId(v string) *GetJourneyInput { + s.ApplicationId = &v return s } -// SetIsArchived sets the IsArchived field's value. -func (s *GCMChannelResponse) SetIsArchived(v bool) *GCMChannelResponse { - s.IsArchived = &v +// SetJourneyId sets the JourneyId field's value. +func (s *GetJourneyInput) SetJourneyId(v string) *GetJourneyInput { + s.JourneyId = &v return s } -// SetLastModifiedBy sets the LastModifiedBy field's value. -func (s *GCMChannelResponse) SetLastModifiedBy(v string) *GCMChannelResponse { - s.LastModifiedBy = &v - return s +type GetJourneyOutput struct { + _ struct{} `type:"structure" payload:"JourneyResponse"` + + // Provides information about the status, configuration, and other settings + // for a journey. + // + // JourneyResponse is a required field + JourneyResponse *JourneyResponse `type:"structure" required:"true"` } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *GCMChannelResponse) SetLastModifiedDate(v string) *GCMChannelResponse { - s.LastModifiedDate = &v - return s +// String returns the string representation +func (s GetJourneyOutput) String() string { + return awsutil.Prettify(s) } -// SetPlatform sets the Platform field's value. -func (s *GCMChannelResponse) SetPlatform(v string) *GCMChannelResponse { - s.Platform = &v - return s +// GoString returns the string representation +func (s GetJourneyOutput) GoString() string { + return s.String() } -// SetVersion sets the Version field's value. -func (s *GCMChannelResponse) SetVersion(v int64) *GCMChannelResponse { - s.Version = &v +// SetJourneyResponse sets the JourneyResponse field's value. +func (s *GetJourneyOutput) SetJourneyResponse(v *JourneyResponse) *GetJourneyOutput { + s.JourneyResponse = v return s } -// Specifies the settings for a one-time message that's sent directly to an -// endpoint through the GCM channel. The GCM channel enables Amazon Pinpoint -// to send messages to the Firebase Cloud Messaging (FCM), formerly Google Cloud -// Messaging (GCM), service. -type GCMMessage struct { +type GetPushTemplateInput struct { _ struct{} `type:"structure"` - // The action to occur if the recipient taps the push notification. Valid values - // are: - // - // * OPEN_APP - Your app opens or it becomes the foreground app if it was - // sent to the background. This is the default action. - // - // * DEEP_LINK - Your app opens and displays a designated user interface - // in the app. This action uses the deep-linking features of the Android - // platform. - // - // * URL - The default mobile browser on the recipient's device opens and - // loads the web page at a URL that you specify. - Action *string `type:"string" enum:"Action"` + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` + + Version *string `location:"querystring" locationName:"version" type:"string"` +} - // The body of the notification message. - Body *string `type:"string"` +// String returns the string representation +func (s GetPushTemplateInput) String() string { + return awsutil.Prettify(s) +} - // An arbitrary string that identifies a group of messages that can be collapsed - // to ensure that only the last message is sent when delivery can resume. This - // helps avoid sending too many instances of the same messages when the recipient's - // device comes online again or becomes active. - // - // Amazon Pinpoint specifies this value in the Firebase Cloud Messaging (FCM) - // collapse_key parameter when it sends the notification message to FCM. - CollapseKey *string `type:"string"` +// GoString returns the string representation +func (s GetPushTemplateInput) GoString() string { + return s.String() +} - // The JSON data payload to use for the push notification, if the notification - // is a silent push notification. This payload is added to the data.pinpoint.jsonBody - // object of the notification. - Data map[string]*string `type:"map"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetPushTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetPushTemplateInput"} + if s.TemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateName")) + } + if s.TemplateName != nil && len(*s.TemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) + } - // The icon image name of the asset saved in your app. - IconReference *string `type:"string"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // The URL of the large icon image to display in the content view of the push - // notification. - ImageIconUrl *string `type:"string"` +// SetTemplateName sets the TemplateName field's value. +func (s *GetPushTemplateInput) SetTemplateName(v string) *GetPushTemplateInput { + s.TemplateName = &v + return s +} - // The URL of an image to display in the push notification. - ImageUrl *string `type:"string"` +// SetVersion sets the Version field's value. +func (s *GetPushTemplateInput) SetVersion(v string) *GetPushTemplateInput { + s.Version = &v + return s +} - // para>normal - The notification might be delayed. Delivery is optimized for - // battery usage on the recipient's device. Use this value unless immediate - // delivery is required. - // /listitem> - // high - The notification is sent immediately and might wake a sleeping device. - // /para> - // Amazon Pinpoint specifies this value in the FCM priority parameter when it - // sends the notification message to FCM. - // - // The equivalent values for Apple Push Notification service (APNs) are 5, for - // normal, and 10, for high. If you specify an APNs value for this property, - // Amazon Pinpoint accepts and converts the value to the corresponding FCM value. - Priority *string `type:"string"` +type GetPushTemplateOutput struct { + _ struct{} `type:"structure" payload:"PushNotificationTemplateResponse"` - // The raw, JSON-formatted string to use as the payload for the notification - // message. This value overrides the message. - RawContent *string `type:"string"` + // Provides information about the content and settings for a message template + // that can be used in messages that are sent through a push notification channel. + // + // PushNotificationTemplateResponse is a required field + PushNotificationTemplateResponse *PushNotificationTemplateResponse `type:"structure" required:"true"` +} - // The package name of the application where registration tokens must match - // in order for the recipient to receive the message. - RestrictedPackageName *string `type:"string"` +// String returns the string representation +func (s GetPushTemplateOutput) String() string { + return awsutil.Prettify(s) +} - // Specifies whether the notification is a silent push notification, which is - // a push notification that doesn't display on a recipient's device. Silent - // push notifications can be used for cases such as updating an app's configuration - // or supporting phone home functionality. - SilentPush *bool `type:"boolean"` +// GoString returns the string representation +func (s GetPushTemplateOutput) GoString() string { + return s.String() +} - // The URL of the small icon image to display in the status bar and the content - // view of the push notification. - SmallImageIconUrl *string `type:"string"` +// SetPushNotificationTemplateResponse sets the PushNotificationTemplateResponse field's value. +func (s *GetPushTemplateOutput) SetPushNotificationTemplateResponse(v *PushNotificationTemplateResponse) *GetPushTemplateOutput { + s.PushNotificationTemplateResponse = v + return s +} - // The sound to play when the recipient receives the push notification. You - // can use the default stream or specify the file name of a sound resource that's - // bundled in your app. On an Android platform, the sound file must reside in - // /res/raw/. - Sound *string `type:"string"` +type GetSegmentExportJobsInput struct { + _ struct{} `type:"structure"` - // The default message variables to use in the notification message. You can - // override the default variables with individual address variables. - Substitutions map[string][]*string `type:"map"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The amount of time, in seconds, that FCM should store and attempt to deliver - // the push notification, if the service is unable to deliver the notification - // the first time. If you don't specify this value, FCM defaults to the maximum - // value, which is 2,419,200 seconds (28 days). - // - // Amazon Pinpoint specifies this value in the FCM time_to_live parameter when - // it sends the notification message to FCM. - TimeToLive *int64 `type:"integer"` + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` - // The title to display above the notification message on the recipient's device. - Title *string `type:"string"` + // SegmentId is a required field + SegmentId *string `location:"uri" locationName:"segment-id" type:"string" required:"true"` - // The URL to open in the recipient's default mobile browser, if a recipient - // taps the push notification and the value of the Action property is URL. - Url *string `type:"string"` + Token *string `location:"querystring" locationName:"token" type:"string"` } // String returns the string representation -func (s GCMMessage) String() string { +func (s GetSegmentExportJobsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GCMMessage) GoString() string { +func (s GetSegmentExportJobsInput) GoString() string { return s.String() } -// SetAction sets the Action field's value. -func (s *GCMMessage) SetAction(v string) *GCMMessage { - s.Action = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetSegmentExportJobsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSegmentExportJobsInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.SegmentId == nil { + invalidParams.Add(request.NewErrParamRequired("SegmentId")) + } + if s.SegmentId != nil && len(*s.SegmentId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SegmentId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetBody sets the Body field's value. -func (s *GCMMessage) SetBody(v string) *GCMMessage { - s.Body = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetSegmentExportJobsInput) SetApplicationId(v string) *GetSegmentExportJobsInput { + s.ApplicationId = &v return s } -// SetCollapseKey sets the CollapseKey field's value. -func (s *GCMMessage) SetCollapseKey(v string) *GCMMessage { - s.CollapseKey = &v +// SetPageSize sets the PageSize field's value. +func (s *GetSegmentExportJobsInput) SetPageSize(v string) *GetSegmentExportJobsInput { + s.PageSize = &v return s } -// SetData sets the Data field's value. -func (s *GCMMessage) SetData(v map[string]*string) *GCMMessage { - s.Data = v +// SetSegmentId sets the SegmentId field's value. +func (s *GetSegmentExportJobsInput) SetSegmentId(v string) *GetSegmentExportJobsInput { + s.SegmentId = &v return s } -// SetIconReference sets the IconReference field's value. -func (s *GCMMessage) SetIconReference(v string) *GCMMessage { - s.IconReference = &v +// SetToken sets the Token field's value. +func (s *GetSegmentExportJobsInput) SetToken(v string) *GetSegmentExportJobsInput { + s.Token = &v return s } -// SetImageIconUrl sets the ImageIconUrl field's value. -func (s *GCMMessage) SetImageIconUrl(v string) *GCMMessage { - s.ImageIconUrl = &v - return s +type GetSegmentExportJobsOutput struct { + _ struct{} `type:"structure" payload:"ExportJobsResponse"` + + // Provides information about all the export jobs that are associated with an + // application or segment. An export job is a job that exports endpoint definitions + // to a file. + // + // ExportJobsResponse is a required field + ExportJobsResponse *ExportJobsResponse `type:"structure" required:"true"` } -// SetImageUrl sets the ImageUrl field's value. -func (s *GCMMessage) SetImageUrl(v string) *GCMMessage { - s.ImageUrl = &v - return s +// String returns the string representation +func (s GetSegmentExportJobsOutput) String() string { + return awsutil.Prettify(s) } -// SetPriority sets the Priority field's value. -func (s *GCMMessage) SetPriority(v string) *GCMMessage { - s.Priority = &v - return s +// GoString returns the string representation +func (s GetSegmentExportJobsOutput) GoString() string { + return s.String() } -// SetRawContent sets the RawContent field's value. -func (s *GCMMessage) SetRawContent(v string) *GCMMessage { - s.RawContent = &v +// SetExportJobsResponse sets the ExportJobsResponse field's value. +func (s *GetSegmentExportJobsOutput) SetExportJobsResponse(v *ExportJobsResponse) *GetSegmentExportJobsOutput { + s.ExportJobsResponse = v return s } -// SetRestrictedPackageName sets the RestrictedPackageName field's value. -func (s *GCMMessage) SetRestrictedPackageName(v string) *GCMMessage { - s.RestrictedPackageName = &v - return s +type GetSegmentImportJobsInput struct { + _ struct{} `type:"structure"` + + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + + // SegmentId is a required field + SegmentId *string `location:"uri" locationName:"segment-id" type:"string" required:"true"` + + Token *string `location:"querystring" locationName:"token" type:"string"` } -// SetSilentPush sets the SilentPush field's value. -func (s *GCMMessage) SetSilentPush(v bool) *GCMMessage { - s.SilentPush = &v +// String returns the string representation +func (s GetSegmentImportJobsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetSegmentImportJobsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetSegmentImportJobsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSegmentImportJobsInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.SegmentId == nil { + invalidParams.Add(request.NewErrParamRequired("SegmentId")) + } + if s.SegmentId != nil && len(*s.SegmentId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SegmentId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *GetSegmentImportJobsInput) SetApplicationId(v string) *GetSegmentImportJobsInput { + s.ApplicationId = &v return s } -// SetSmallImageIconUrl sets the SmallImageIconUrl field's value. -func (s *GCMMessage) SetSmallImageIconUrl(v string) *GCMMessage { - s.SmallImageIconUrl = &v +// SetPageSize sets the PageSize field's value. +func (s *GetSegmentImportJobsInput) SetPageSize(v string) *GetSegmentImportJobsInput { + s.PageSize = &v return s } -// SetSound sets the Sound field's value. -func (s *GCMMessage) SetSound(v string) *GCMMessage { - s.Sound = &v +// SetSegmentId sets the SegmentId field's value. +func (s *GetSegmentImportJobsInput) SetSegmentId(v string) *GetSegmentImportJobsInput { + s.SegmentId = &v return s } -// SetSubstitutions sets the Substitutions field's value. -func (s *GCMMessage) SetSubstitutions(v map[string][]*string) *GCMMessage { - s.Substitutions = v +// SetToken sets the Token field's value. +func (s *GetSegmentImportJobsInput) SetToken(v string) *GetSegmentImportJobsInput { + s.Token = &v return s } -// SetTimeToLive sets the TimeToLive field's value. -func (s *GCMMessage) SetTimeToLive(v int64) *GCMMessage { - s.TimeToLive = &v - return s +type GetSegmentImportJobsOutput struct { + _ struct{} `type:"structure" payload:"ImportJobsResponse"` + + // Provides information about the status and settings of all the import jobs + // that are associated with an application or segment. An import job is a job + // that imports endpoint definitions from one or more files. + // + // ImportJobsResponse is a required field + ImportJobsResponse *ImportJobsResponse `type:"structure" required:"true"` } -// SetTitle sets the Title field's value. -func (s *GCMMessage) SetTitle(v string) *GCMMessage { - s.Title = &v - return s +// String returns the string representation +func (s GetSegmentImportJobsOutput) String() string { + return awsutil.Prettify(s) } -// SetUrl sets the Url field's value. -func (s *GCMMessage) SetUrl(v string) *GCMMessage { - s.Url = &v +// GoString returns the string representation +func (s GetSegmentImportJobsOutput) GoString() string { + return s.String() +} + +// SetImportJobsResponse sets the ImportJobsResponse field's value. +func (s *GetSegmentImportJobsOutput) SetImportJobsResponse(v *ImportJobsResponse) *GetSegmentImportJobsOutput { + s.ImportJobsResponse = v return s } -// Specifies the GPS coordinates of a location. -type GPSCoordinates struct { +type GetSegmentInput struct { _ struct{} `type:"structure"` - // The latitude coordinate of the location. - // - // Latitude is a required field - Latitude *float64 `type:"double" required:"true"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The longitude coordinate of the location. - // - // Longitude is a required field - Longitude *float64 `type:"double" required:"true"` + // SegmentId is a required field + SegmentId *string `location:"uri" locationName:"segment-id" type:"string" required:"true"` } // String returns the string representation -func (s GPSCoordinates) String() string { +func (s GetSegmentInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GPSCoordinates) GoString() string { +func (s GetSegmentInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GPSCoordinates) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GPSCoordinates"} - if s.Latitude == nil { - invalidParams.Add(request.NewErrParamRequired("Latitude")) +func (s *GetSegmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSegmentInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } - if s.Longitude == nil { - invalidParams.Add(request.NewErrParamRequired("Longitude")) + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.SegmentId == nil { + invalidParams.Add(request.NewErrParamRequired("SegmentId")) + } + if s.SegmentId != nil && len(*s.SegmentId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SegmentId", 1)) } if invalidParams.Len() > 0 { @@ -15048,98 +22389,88 @@ func (s *GPSCoordinates) Validate() error { return nil } -// SetLatitude sets the Latitude field's value. -func (s *GPSCoordinates) SetLatitude(v float64) *GPSCoordinates { - s.Latitude = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *GetSegmentInput) SetApplicationId(v string) *GetSegmentInput { + s.ApplicationId = &v return s } -// SetLongitude sets the Longitude field's value. -func (s *GPSCoordinates) SetLongitude(v float64) *GPSCoordinates { - s.Longitude = &v +// SetSegmentId sets the SegmentId field's value. +func (s *GetSegmentInput) SetSegmentId(v string) *GetSegmentInput { + s.SegmentId = &v return s } -// Specifies GPS-based criteria for including or excluding endpoints from a -// segment. -type GPSPointDimension struct { - _ struct{} `type:"structure"` +type GetSegmentOutput struct { + _ struct{} `type:"structure" payload:"SegmentResponse"` - // The GPS coordinates to measure distance from. + // Provides information about the configuration, dimension, and other settings + // for a segment. // - // Coordinates is a required field - Coordinates *GPSCoordinates `type:"structure" required:"true"` - - // The range, in kilometers, from the GPS coordinates. - RangeInKilometers *float64 `type:"double"` + // SegmentResponse is a required field + SegmentResponse *SegmentResponse `type:"structure" required:"true"` } // String returns the string representation -func (s GPSPointDimension) String() string { +func (s GetSegmentOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GPSPointDimension) GoString() string { +func (s GetSegmentOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GPSPointDimension) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GPSPointDimension"} - if s.Coordinates == nil { - invalidParams.Add(request.NewErrParamRequired("Coordinates")) - } - if s.Coordinates != nil { - if err := s.Coordinates.Validate(); err != nil { - invalidParams.AddNested("Coordinates", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCoordinates sets the Coordinates field's value. -func (s *GPSPointDimension) SetCoordinates(v *GPSCoordinates) *GPSPointDimension { - s.Coordinates = v - return s -} - -// SetRangeInKilometers sets the RangeInKilometers field's value. -func (s *GPSPointDimension) SetRangeInKilometers(v float64) *GPSPointDimension { - s.RangeInKilometers = &v +// SetSegmentResponse sets the SegmentResponse field's value. +func (s *GetSegmentOutput) SetSegmentResponse(v *SegmentResponse) *GetSegmentOutput { + s.SegmentResponse = v return s } -type GetAdmChannelInput struct { +type GetSegmentVersionInput struct { _ struct{} `type:"structure"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + // SegmentId is a required field + SegmentId *string `location:"uri" locationName:"segment-id" type:"string" required:"true"` + + // Version is a required field + Version *string `location:"uri" locationName:"version" type:"string" required:"true"` } // String returns the string representation -func (s GetAdmChannelInput) String() string { +func (s GetSegmentVersionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetAdmChannelInput) GoString() string { +func (s GetSegmentVersionInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetAdmChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAdmChannelInput"} +func (s *GetSegmentVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSegmentVersionInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } + if s.SegmentId == nil { + invalidParams.Add(request.NewErrParamRequired("SegmentId")) + } + if s.SegmentId != nil && len(*s.SegmentId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SegmentId", 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 @@ -15148,63 +22479,88 @@ func (s *GetAdmChannelInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *GetAdmChannelInput) SetApplicationId(v string) *GetAdmChannelInput { +func (s *GetSegmentVersionInput) SetApplicationId(v string) *GetSegmentVersionInput { s.ApplicationId = &v return s } -type GetAdmChannelOutput struct { - _ struct{} `type:"structure" payload:"ADMChannelResponse"` +// SetSegmentId sets the SegmentId field's value. +func (s *GetSegmentVersionInput) SetSegmentId(v string) *GetSegmentVersionInput { + s.SegmentId = &v + return s +} - // Provides information about the status and settings of the ADM (Amazon Device - // Messaging) channel for an application. +// SetVersion sets the Version field's value. +func (s *GetSegmentVersionInput) SetVersion(v string) *GetSegmentVersionInput { + s.Version = &v + return s +} + +type GetSegmentVersionOutput struct { + _ struct{} `type:"structure" payload:"SegmentResponse"` + + // Provides information about the configuration, dimension, and other settings + // for a segment. // - // ADMChannelResponse is a required field - ADMChannelResponse *ADMChannelResponse `type:"structure" required:"true"` + // SegmentResponse is a required field + SegmentResponse *SegmentResponse `type:"structure" required:"true"` } // String returns the string representation -func (s GetAdmChannelOutput) String() string { +func (s GetSegmentVersionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetAdmChannelOutput) GoString() string { +func (s GetSegmentVersionOutput) GoString() string { return s.String() } -// SetADMChannelResponse sets the ADMChannelResponse field's value. -func (s *GetAdmChannelOutput) SetADMChannelResponse(v *ADMChannelResponse) *GetAdmChannelOutput { - s.ADMChannelResponse = v +// SetSegmentResponse sets the SegmentResponse field's value. +func (s *GetSegmentVersionOutput) SetSegmentResponse(v *SegmentResponse) *GetSegmentVersionOutput { + s.SegmentResponse = v return s } -type GetApnsChannelInput struct { +type GetSegmentVersionsInput struct { _ struct{} `type:"structure"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + + // SegmentId is a required field + SegmentId *string `location:"uri" locationName:"segment-id" type:"string" required:"true"` + + Token *string `location:"querystring" locationName:"token" type:"string"` } // String returns the string representation -func (s GetApnsChannelInput) String() string { +func (s GetSegmentVersionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApnsChannelInput) GoString() string { +func (s GetSegmentVersionsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetApnsChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetApnsChannelInput"} +func (s *GetSegmentVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSegmentVersionsInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } + if s.SegmentId == nil { + invalidParams.Add(request.NewErrParamRequired("SegmentId")) + } + if s.SegmentId != nil && len(*s.SegmentId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SegmentId", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -15213,57 +22569,78 @@ func (s *GetApnsChannelInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *GetApnsChannelInput) SetApplicationId(v string) *GetApnsChannelInput { +func (s *GetSegmentVersionsInput) SetApplicationId(v string) *GetSegmentVersionsInput { s.ApplicationId = &v return s } -type GetApnsChannelOutput struct { - _ struct{} `type:"structure" payload:"APNSChannelResponse"` +// SetPageSize sets the PageSize field's value. +func (s *GetSegmentVersionsInput) SetPageSize(v string) *GetSegmentVersionsInput { + s.PageSize = &v + return s +} - // Provides information about the status and settings of the APNs (Apple Push - // Notification service) channel for an application. +// SetSegmentId sets the SegmentId field's value. +func (s *GetSegmentVersionsInput) SetSegmentId(v string) *GetSegmentVersionsInput { + s.SegmentId = &v + return s +} + +// SetToken sets the Token field's value. +func (s *GetSegmentVersionsInput) SetToken(v string) *GetSegmentVersionsInput { + s.Token = &v + return s +} + +type GetSegmentVersionsOutput struct { + _ struct{} `type:"structure" payload:"SegmentsResponse"` + + // Provides information about all the segments that are associated with an application. // - // APNSChannelResponse is a required field - APNSChannelResponse *APNSChannelResponse `type:"structure" required:"true"` + // SegmentsResponse is a required field + SegmentsResponse *SegmentsResponse `type:"structure" required:"true"` } // String returns the string representation -func (s GetApnsChannelOutput) String() string { +func (s GetSegmentVersionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApnsChannelOutput) GoString() string { +func (s GetSegmentVersionsOutput) GoString() string { return s.String() } -// SetAPNSChannelResponse sets the APNSChannelResponse field's value. -func (s *GetApnsChannelOutput) SetAPNSChannelResponse(v *APNSChannelResponse) *GetApnsChannelOutput { - s.APNSChannelResponse = v +// SetSegmentsResponse sets the SegmentsResponse field's value. +func (s *GetSegmentVersionsOutput) SetSegmentsResponse(v *SegmentsResponse) *GetSegmentVersionsOutput { + s.SegmentsResponse = v return s } -type GetApnsSandboxChannelInput struct { +type GetSegmentsInput struct { _ struct{} `type:"structure"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + + Token *string `location:"querystring" locationName:"token" type:"string"` } // String returns the string representation -func (s GetApnsSandboxChannelInput) String() string { +func (s GetSegmentsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApnsSandboxChannelInput) GoString() string { +func (s GetSegmentsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetApnsSandboxChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetApnsSandboxChannelInput"} +func (s *GetSegmentsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSegmentsInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } @@ -15278,38 +22655,49 @@ func (s *GetApnsSandboxChannelInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *GetApnsSandboxChannelInput) SetApplicationId(v string) *GetApnsSandboxChannelInput { +func (s *GetSegmentsInput) SetApplicationId(v string) *GetSegmentsInput { s.ApplicationId = &v return s } -type GetApnsSandboxChannelOutput struct { - _ struct{} `type:"structure" payload:"APNSSandboxChannelResponse"` +// SetPageSize sets the PageSize field's value. +func (s *GetSegmentsInput) SetPageSize(v string) *GetSegmentsInput { + s.PageSize = &v + return s +} - // Provides information about the status and settings of the APNs (Apple Push - // Notification service) sandbox channel for an application. +// SetToken sets the Token field's value. +func (s *GetSegmentsInput) SetToken(v string) *GetSegmentsInput { + s.Token = &v + return s +} + +type GetSegmentsOutput struct { + _ struct{} `type:"structure" payload:"SegmentsResponse"` + + // Provides information about all the segments that are associated with an application. // - // APNSSandboxChannelResponse is a required field - APNSSandboxChannelResponse *APNSSandboxChannelResponse `type:"structure" required:"true"` + // SegmentsResponse is a required field + SegmentsResponse *SegmentsResponse `type:"structure" required:"true"` } // String returns the string representation -func (s GetApnsSandboxChannelOutput) String() string { +func (s GetSegmentsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApnsSandboxChannelOutput) GoString() string { +func (s GetSegmentsOutput) GoString() string { return s.String() } -// SetAPNSSandboxChannelResponse sets the APNSSandboxChannelResponse field's value. -func (s *GetApnsSandboxChannelOutput) SetAPNSSandboxChannelResponse(v *APNSSandboxChannelResponse) *GetApnsSandboxChannelOutput { - s.APNSSandboxChannelResponse = v +// SetSegmentsResponse sets the SegmentsResponse field's value. +func (s *GetSegmentsOutput) SetSegmentsResponse(v *SegmentsResponse) *GetSegmentsOutput { + s.SegmentsResponse = v return s } -type GetApnsVoipChannelInput struct { +type GetSmsChannelInput struct { _ struct{} `type:"structure"` // ApplicationId is a required field @@ -15317,18 +22705,18 @@ type GetApnsVoipChannelInput struct { } // String returns the string representation -func (s GetApnsVoipChannelInput) String() string { +func (s GetSmsChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApnsVoipChannelInput) GoString() string { +func (s GetSmsChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetApnsVoipChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetApnsVoipChannelInput"} +func (s *GetSmsChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSmsChannelInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } @@ -15343,62 +22731,64 @@ func (s *GetApnsVoipChannelInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *GetApnsVoipChannelInput) SetApplicationId(v string) *GetApnsVoipChannelInput { +func (s *GetSmsChannelInput) SetApplicationId(v string) *GetSmsChannelInput { s.ApplicationId = &v return s } -type GetApnsVoipChannelOutput struct { - _ struct{} `type:"structure" payload:"APNSVoipChannelResponse"` +type GetSmsChannelOutput struct { + _ struct{} `type:"structure" payload:"SMSChannelResponse"` - // Provides information about the status and settings of the APNs (Apple Push - // Notification service) VoIP channel for an application. + // Provides information about the status and settings of the SMS channel for + // an application. // - // APNSVoipChannelResponse is a required field - APNSVoipChannelResponse *APNSVoipChannelResponse `type:"structure" required:"true"` + // SMSChannelResponse is a required field + SMSChannelResponse *SMSChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s GetApnsVoipChannelOutput) String() string { +func (s GetSmsChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApnsVoipChannelOutput) GoString() string { +func (s GetSmsChannelOutput) GoString() string { return s.String() } -// SetAPNSVoipChannelResponse sets the APNSVoipChannelResponse field's value. -func (s *GetApnsVoipChannelOutput) SetAPNSVoipChannelResponse(v *APNSVoipChannelResponse) *GetApnsVoipChannelOutput { - s.APNSVoipChannelResponse = v +// SetSMSChannelResponse sets the SMSChannelResponse field's value. +func (s *GetSmsChannelOutput) SetSMSChannelResponse(v *SMSChannelResponse) *GetSmsChannelOutput { + s.SMSChannelResponse = v return s } -type GetApnsVoipSandboxChannelInput struct { +type GetSmsTemplateInput struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` + + Version *string `location:"querystring" locationName:"version" type:"string"` } // String returns the string representation -func (s GetApnsVoipSandboxChannelInput) String() string { +func (s GetSmsTemplateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApnsVoipSandboxChannelInput) GoString() string { +func (s GetSmsTemplateInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetApnsVoipSandboxChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetApnsVoipSandboxChannelInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) +func (s *GetSmsTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSmsTemplateInput"} + if s.TemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateName")) } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + if s.TemplateName != nil && len(*s.TemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) } if invalidParams.Len() > 0 { @@ -15407,64 +22797,79 @@ func (s *GetApnsVoipSandboxChannelInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetApnsVoipSandboxChannelInput) SetApplicationId(v string) *GetApnsVoipSandboxChannelInput { - s.ApplicationId = &v +// SetTemplateName sets the TemplateName field's value. +func (s *GetSmsTemplateInput) SetTemplateName(v string) *GetSmsTemplateInput { + s.TemplateName = &v return s } -type GetApnsVoipSandboxChannelOutput struct { - _ struct{} `type:"structure" payload:"APNSVoipSandboxChannelResponse"` +// SetVersion sets the Version field's value. +func (s *GetSmsTemplateInput) SetVersion(v string) *GetSmsTemplateInput { + s.Version = &v + return s +} - // Provides information about the status and settings of the APNs (Apple Push - // Notification service) VoIP sandbox channel for an application. +type GetSmsTemplateOutput struct { + _ struct{} `type:"structure" payload:"SMSTemplateResponse"` + + // Provides information about the content and settings for a message template + // that can be used in text messages that are sent through the SMS channel. // - // APNSVoipSandboxChannelResponse is a required field - APNSVoipSandboxChannelResponse *APNSVoipSandboxChannelResponse `type:"structure" required:"true"` + // SMSTemplateResponse is a required field + SMSTemplateResponse *SMSTemplateResponse `type:"structure" required:"true"` } // String returns the string representation -func (s GetApnsVoipSandboxChannelOutput) String() string { +func (s GetSmsTemplateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApnsVoipSandboxChannelOutput) GoString() string { +func (s GetSmsTemplateOutput) GoString() string { return s.String() } -// SetAPNSVoipSandboxChannelResponse sets the APNSVoipSandboxChannelResponse field's value. -func (s *GetApnsVoipSandboxChannelOutput) SetAPNSVoipSandboxChannelResponse(v *APNSVoipSandboxChannelResponse) *GetApnsVoipSandboxChannelOutput { - s.APNSVoipSandboxChannelResponse = v +// SetSMSTemplateResponse sets the SMSTemplateResponse field's value. +func (s *GetSmsTemplateOutput) SetSMSTemplateResponse(v *SMSTemplateResponse) *GetSmsTemplateOutput { + s.SMSTemplateResponse = v return s } -type GetAppInput struct { +type GetUserEndpointsInput struct { _ struct{} `type:"structure"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + // UserId is a required field + UserId *string `location:"uri" locationName:"user-id" type:"string" required:"true"` } // String returns the string representation -func (s GetAppInput) String() string { +func (s GetUserEndpointsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetAppInput) GoString() string { +func (s GetUserEndpointsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetAppInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetAppInput"} +func (s *GetUserEndpointsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetUserEndpointsInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } + if s.UserId == nil { + invalidParams.Add(request.NewErrParamRequired("UserId")) + } + if s.UserId != nil && len(*s.UserId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -15473,79 +22878,69 @@ func (s *GetAppInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *GetAppInput) SetApplicationId(v string) *GetAppInput { +func (s *GetUserEndpointsInput) SetApplicationId(v string) *GetUserEndpointsInput { s.ApplicationId = &v return s } -type GetAppOutput struct { - _ struct{} `type:"structure" payload:"ApplicationResponse"` +// SetUserId sets the UserId field's value. +func (s *GetUserEndpointsInput) SetUserId(v string) *GetUserEndpointsInput { + s.UserId = &v + return s +} - // Provides information about an application. +type GetUserEndpointsOutput struct { + _ struct{} `type:"structure" payload:"EndpointsResponse"` + + // Provides information about all the endpoints that are associated with a user + // ID. // - // ApplicationResponse is a required field - ApplicationResponse *ApplicationResponse `type:"structure" required:"true"` + // EndpointsResponse is a required field + EndpointsResponse *EndpointsResponse `type:"structure" required:"true"` } // String returns the string representation -func (s GetAppOutput) String() string { +func (s GetUserEndpointsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetAppOutput) GoString() string { +func (s GetUserEndpointsOutput) GoString() string { return s.String() } -// SetApplicationResponse sets the ApplicationResponse field's value. -func (s *GetAppOutput) SetApplicationResponse(v *ApplicationResponse) *GetAppOutput { - s.ApplicationResponse = v +// SetEndpointsResponse sets the EndpointsResponse field's value. +func (s *GetUserEndpointsOutput) SetEndpointsResponse(v *EndpointsResponse) *GetUserEndpointsOutput { + s.EndpointsResponse = v return s } -type GetApplicationDateRangeKpiInput struct { +type GetVoiceChannelInput struct { _ struct{} `type:"structure"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - - EndTime *time.Time `location:"querystring" locationName:"end-time" type:"timestamp" timestampFormat:"iso8601"` - - // KpiName is a required field - KpiName *string `location:"uri" locationName:"kpi-name" type:"string" required:"true"` - - NextToken *string `location:"querystring" locationName:"next-token" type:"string"` - - PageSize *string `location:"querystring" locationName:"page-size" type:"string"` - - StartTime *time.Time `location:"querystring" locationName:"start-time" type:"timestamp" timestampFormat:"iso8601"` } // String returns the string representation -func (s GetApplicationDateRangeKpiInput) String() string { +func (s GetVoiceChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApplicationDateRangeKpiInput) GoString() string { +func (s GetVoiceChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetApplicationDateRangeKpiInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetApplicationDateRangeKpiInput"} +func (s *GetVoiceChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetVoiceChannelInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } - if s.KpiName == nil { - invalidParams.Add(request.NewErrParamRequired("KpiName")) - } - if s.KpiName != nil && len(*s.KpiName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KpiName", 1)) - } if invalidParams.Len() > 0 { return invalidParams @@ -15554,92 +22949,64 @@ func (s *GetApplicationDateRangeKpiInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *GetApplicationDateRangeKpiInput) SetApplicationId(v string) *GetApplicationDateRangeKpiInput { +func (s *GetVoiceChannelInput) SetApplicationId(v string) *GetVoiceChannelInput { s.ApplicationId = &v return s } -// SetEndTime sets the EndTime field's value. -func (s *GetApplicationDateRangeKpiInput) SetEndTime(v time.Time) *GetApplicationDateRangeKpiInput { - s.EndTime = &v - return s -} - -// SetKpiName sets the KpiName field's value. -func (s *GetApplicationDateRangeKpiInput) SetKpiName(v string) *GetApplicationDateRangeKpiInput { - s.KpiName = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetApplicationDateRangeKpiInput) SetNextToken(v string) *GetApplicationDateRangeKpiInput { - s.NextToken = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *GetApplicationDateRangeKpiInput) SetPageSize(v string) *GetApplicationDateRangeKpiInput { - s.PageSize = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *GetApplicationDateRangeKpiInput) SetStartTime(v time.Time) *GetApplicationDateRangeKpiInput { - s.StartTime = &v - return s -} - -type GetApplicationDateRangeKpiOutput struct { - _ struct{} `type:"structure" payload:"ApplicationDateRangeKpiResponse"` +type GetVoiceChannelOutput struct { + _ struct{} `type:"structure" payload:"VoiceChannelResponse"` - // Provides the results of a query that retrieved the data for a standard metric - // that applies to an application, and provides information about that query. + // Provides information about the status and settings of the voice channel for + // an application. // - // ApplicationDateRangeKpiResponse is a required field - ApplicationDateRangeKpiResponse *ApplicationDateRangeKpiResponse `type:"structure" required:"true"` + // VoiceChannelResponse is a required field + VoiceChannelResponse *VoiceChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s GetApplicationDateRangeKpiOutput) String() string { +func (s GetVoiceChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApplicationDateRangeKpiOutput) GoString() string { +func (s GetVoiceChannelOutput) GoString() string { return s.String() } -// SetApplicationDateRangeKpiResponse sets the ApplicationDateRangeKpiResponse field's value. -func (s *GetApplicationDateRangeKpiOutput) SetApplicationDateRangeKpiResponse(v *ApplicationDateRangeKpiResponse) *GetApplicationDateRangeKpiOutput { - s.ApplicationDateRangeKpiResponse = v +// SetVoiceChannelResponse sets the VoiceChannelResponse field's value. +func (s *GetVoiceChannelOutput) SetVoiceChannelResponse(v *VoiceChannelResponse) *GetVoiceChannelOutput { + s.VoiceChannelResponse = v return s } -type GetApplicationSettingsInput struct { +type GetVoiceTemplateInput struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` + + Version *string `location:"querystring" locationName:"version" type:"string"` } // String returns the string representation -func (s GetApplicationSettingsInput) String() string { +func (s GetVoiceTemplateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApplicationSettingsInput) GoString() string { +func (s GetVoiceTemplateInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetApplicationSettingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetApplicationSettingsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) +func (s *GetVoiceTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetVoiceTemplateInput"} + if s.TemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateName")) } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + if s.TemplateName != nil && len(*s.TemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) } if invalidParams.Len() > 0 { @@ -15648,118 +23015,178 @@ func (s *GetApplicationSettingsInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetApplicationSettingsInput) SetApplicationId(v string) *GetApplicationSettingsInput { - s.ApplicationId = &v +// SetTemplateName sets the TemplateName field's value. +func (s *GetVoiceTemplateInput) SetTemplateName(v string) *GetVoiceTemplateInput { + s.TemplateName = &v return s } -type GetApplicationSettingsOutput struct { - _ struct{} `type:"structure" payload:"ApplicationSettingsResource"` +// SetVersion sets the Version field's value. +func (s *GetVoiceTemplateInput) SetVersion(v string) *GetVoiceTemplateInput { + s.Version = &v + return s +} - // Provides information about an application, including the default settings - // for an application. +type GetVoiceTemplateOutput struct { + _ struct{} `type:"structure" payload:"VoiceTemplateResponse"` + + // Provides information about the content and settings for a message template + // that can be used in messages that are sent through the voice channel. // - // ApplicationSettingsResource is a required field - ApplicationSettingsResource *ApplicationSettingsResource `type:"structure" required:"true"` + // VoiceTemplateResponse is a required field + VoiceTemplateResponse *VoiceTemplateResponse `type:"structure" required:"true"` } // String returns the string representation -func (s GetApplicationSettingsOutput) String() string { +func (s GetVoiceTemplateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetApplicationSettingsOutput) GoString() string { +func (s GetVoiceTemplateOutput) GoString() string { return s.String() } -// SetApplicationSettingsResource sets the ApplicationSettingsResource field's value. -func (s *GetApplicationSettingsOutput) SetApplicationSettingsResource(v *ApplicationSettingsResource) *GetApplicationSettingsOutput { - s.ApplicationSettingsResource = v +// SetVoiceTemplateResponse sets the VoiceTemplateResponse field's value. +func (s *GetVoiceTemplateOutput) SetVoiceTemplateResponse(v *VoiceTemplateResponse) *GetVoiceTemplateOutput { + s.VoiceTemplateResponse = v return s } -type GetAppsInput struct { +// Specifies the settings for a holdout activity in a journey. This type of +// activity stops a journey for a specified percentage of participants. +type HoldoutActivity struct { _ struct{} `type:"structure"` - PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + // The unique identifier for the next activity to perform, after performing + // the holdout activity. + NextActivity *string `type:"string"` - Token *string `location:"querystring" locationName:"token" type:"string"` + // The percentage of participants who shouldn't continue the journey. + // + // To determine which participants are held out, Amazon Pinpoint applies a probability-based + // algorithm to the percentage that you specify. Therefore, the actual percentage + // of participants who are held out may not be equal to the percentage that + // you specify. + // + // Percentage is a required field + Percentage *int64 `type:"integer" required:"true"` } // String returns the string representation -func (s GetAppsInput) String() string { +func (s HoldoutActivity) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetAppsInput) GoString() string { +func (s HoldoutActivity) GoString() string { return s.String() } -// SetPageSize sets the PageSize field's value. -func (s *GetAppsInput) SetPageSize(v string) *GetAppsInput { - s.PageSize = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *HoldoutActivity) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HoldoutActivity"} + if s.Percentage == nil { + invalidParams.Add(request.NewErrParamRequired("Percentage")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNextActivity sets the NextActivity field's value. +func (s *HoldoutActivity) SetNextActivity(v string) *HoldoutActivity { + s.NextActivity = &v return s } -// SetToken sets the Token field's value. -func (s *GetAppsInput) SetToken(v string) *GetAppsInput { - s.Token = &v +// SetPercentage sets the Percentage field's value. +func (s *HoldoutActivity) SetPercentage(v int64) *HoldoutActivity { + s.Percentage = &v return s } -type GetAppsOutput struct { - _ struct{} `type:"structure" payload:"ApplicationsResponse"` +// Specifies the settings for a job that imports endpoint definitions from an +// Amazon Simple Storage Service (Amazon S3) bucket. +type ImportJobRequest struct { + _ struct{} `type:"structure"` - // Provides information about all of your applications. + // Specifies whether to create a segment that contains the endpoints, when the + // endpoint definitions are imported. + DefineSegment *bool `type:"boolean"` + + // (Deprecated) Your AWS account ID, which you assigned to an external ID key + // in an IAM trust policy. Amazon Pinpoint previously used this value to assume + // an IAM role when importing endpoint definitions, but we removed this requirement. + // We don't recommend use of external IDs for IAM roles that are assumed by + // Amazon Pinpoint. + ExternalId *string `type:"string"` + + // The format of the files that contain the endpoint definitions to import. + // Valid values are: CSV, for comma-separated values format; and, JSON, for + // newline-delimited JSON format. If the Amazon S3 location stores multiple + // files that use different formats, Amazon Pinpoint imports data only from + // the files that use the specified format. // - // ApplicationsResponse is a required field - ApplicationsResponse *ApplicationsResponse `type:"structure" required:"true"` -} + // Format is a required field + Format *string `type:"string" required:"true" enum:"Format"` -// String returns the string representation -func (s GetAppsOutput) String() string { - return awsutil.Prettify(s) -} + // Specifies whether to register the endpoints with Amazon Pinpoint, when the + // endpoint definitions are imported. + RegisterEndpoints *bool `type:"boolean"` -// GoString returns the string representation -func (s GetAppsOutput) GoString() string { - return s.String() -} + // The Amazon Resource Name (ARN) of the AWS Identity and Access Management + // (IAM) role that authorizes Amazon Pinpoint to access the Amazon S3 location + // to import endpoint definitions from. + // + // RoleArn is a required field + RoleArn *string `type:"string" required:"true"` -// SetApplicationsResponse sets the ApplicationsResponse field's value. -func (s *GetAppsOutput) SetApplicationsResponse(v *ApplicationsResponse) *GetAppsOutput { - s.ApplicationsResponse = v - return s -} + // The URL of the Amazon Simple Storage Service (Amazon S3) bucket that contains + // the endpoint definitions to import. This location can be a folder or a single + // file. If the location is a folder, Amazon Pinpoint imports endpoint definitions + // from the files in this location, including any subfolders that the folder + // contains. + // + // The URL should be in the following format: s3://bucket-name/folder-name/file-name. + // The location can end with the key for an individual object or a prefix that + // qualifies multiple objects. + // + // S3Url is a required field + S3Url *string `type:"string" required:"true"` -type GetBaiduChannelInput struct { - _ struct{} `type:"structure"` + // The identifier for the segment to update or add the imported endpoint definitions + // to, if the import job is meant to update an existing segment. + SegmentId *string `type:"string"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The custom name for the segment that's created by the import job, if the + // value of the DefineSegment property is true. + SegmentName *string `type:"string"` } // String returns the string representation -func (s GetBaiduChannelInput) String() string { +func (s ImportJobRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetBaiduChannelInput) GoString() string { +func (s ImportJobRequest) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetBaiduChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBaiduChannelInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) +func (s *ImportJobRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ImportJobRequest"} + if s.Format == nil { + invalidParams.Add(request.NewErrParamRequired("Format")) } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.S3Url == nil { + invalidParams.Add(request.NewErrParamRequired("S3Url")) } if invalidParams.Len() > 0 { @@ -15768,921 +23195,1146 @@ func (s *GetBaiduChannelInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetBaiduChannelInput) SetApplicationId(v string) *GetBaiduChannelInput { - s.ApplicationId = &v +// SetDefineSegment sets the DefineSegment field's value. +func (s *ImportJobRequest) SetDefineSegment(v bool) *ImportJobRequest { + s.DefineSegment = &v return s } -type GetBaiduChannelOutput struct { - _ struct{} `type:"structure" payload:"BaiduChannelResponse"` +// SetExternalId sets the ExternalId field's value. +func (s *ImportJobRequest) SetExternalId(v string) *ImportJobRequest { + s.ExternalId = &v + return s +} - // Provides information about the status and settings of the Baidu (Baidu Cloud - // Push) channel for an application. - // - // BaiduChannelResponse is a required field - BaiduChannelResponse *BaiduChannelResponse `type:"structure" required:"true"` +// SetFormat sets the Format field's value. +func (s *ImportJobRequest) SetFormat(v string) *ImportJobRequest { + s.Format = &v + return s } -// String returns the string representation -func (s GetBaiduChannelOutput) String() string { - return awsutil.Prettify(s) +// SetRegisterEndpoints sets the RegisterEndpoints field's value. +func (s *ImportJobRequest) SetRegisterEndpoints(v bool) *ImportJobRequest { + s.RegisterEndpoints = &v + return s } -// GoString returns the string representation -func (s GetBaiduChannelOutput) GoString() string { - return s.String() +// SetRoleArn sets the RoleArn field's value. +func (s *ImportJobRequest) SetRoleArn(v string) *ImportJobRequest { + s.RoleArn = &v + return s } -// SetBaiduChannelResponse sets the BaiduChannelResponse field's value. -func (s *GetBaiduChannelOutput) SetBaiduChannelResponse(v *BaiduChannelResponse) *GetBaiduChannelOutput { - s.BaiduChannelResponse = v +// SetS3Url sets the S3Url field's value. +func (s *ImportJobRequest) SetS3Url(v string) *ImportJobRequest { + s.S3Url = &v return s } -type GetCampaignActivitiesInput struct { +// SetSegmentId sets the SegmentId field's value. +func (s *ImportJobRequest) SetSegmentId(v string) *ImportJobRequest { + s.SegmentId = &v + return s +} + +// SetSegmentName sets the SegmentName field's value. +func (s *ImportJobRequest) SetSegmentName(v string) *ImportJobRequest { + s.SegmentName = &v + return s +} + +// Provides information about the resource settings for a job that imports endpoint +// definitions from one or more files. The files can be stored in an Amazon +// Simple Storage Service (Amazon S3) bucket or uploaded directly from a computer +// by using the Amazon Pinpoint console. +type ImportJobResource struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // Specifies whether the import job creates a segment that contains the endpoints, + // when the endpoint definitions are imported. + DefineSegment *bool `type:"boolean"` - // CampaignId is a required field - CampaignId *string `location:"uri" locationName:"campaign-id" type:"string" required:"true"` + // (Deprecated) Your AWS account ID, which you assigned to an external ID key + // in an IAM trust policy. Amazon Pinpoint previously used this value to assume + // an IAM role when importing endpoint definitions, but we removed this requirement. + // We don't recommend use of external IDs for IAM roles that are assumed by + // Amazon Pinpoint. + ExternalId *string `type:"string"` - PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + // The format of the files that contain the endpoint definitions to import. + // Valid values are: CSV, for comma-separated values format; and, JSON, for + // newline-delimited JSON format. + // + // If the files are stored in an Amazon S3 location and that location contains + // multiple files that use different formats, Amazon Pinpoint imports data only + // from the files that use the specified format. + // + // Format is a required field + Format *string `type:"string" required:"true" enum:"Format"` - Token *string `location:"querystring" locationName:"token" type:"string"` + // Specifies whether the import job registers the endpoints with Amazon Pinpoint, + // when the endpoint definitions are imported. + RegisterEndpoints *bool `type:"boolean"` + + // The Amazon Resource Name (ARN) of the AWS Identity and Access Management + // (IAM) role that authorizes Amazon Pinpoint to access the Amazon S3 location + // to import endpoint definitions from. + // + // RoleArn is a required field + RoleArn *string `type:"string" required:"true"` + + // The URL of the Amazon Simple Storage Service (Amazon S3) bucket that contains + // the endpoint definitions to import. This location can be a folder or a single + // file. If the location is a folder, Amazon Pinpoint imports endpoint definitions + // from the files in this location, including any subfolders that the folder + // contains. + // + // The URL should be in the following format: s3://bucket-name/folder-name/file-name. + // The location can end with the key for an individual object or a prefix that + // qualifies multiple objects. + // + // S3Url is a required field + S3Url *string `type:"string" required:"true"` + + // The identifier for the segment that the import job updates or adds endpoint + // definitions to, if the import job updates an existing segment. + SegmentId *string `type:"string"` + + // The custom name for the segment that's created by the import job, if the + // value of the DefineSegment property is true. + SegmentName *string `type:"string"` } // String returns the string representation -func (s GetCampaignActivitiesInput) String() string { +func (s ImportJobResource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetCampaignActivitiesInput) GoString() string { +func (s ImportJobResource) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCampaignActivitiesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCampaignActivitiesInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.CampaignId == nil { - invalidParams.Add(request.NewErrParamRequired("CampaignId")) - } - if s.CampaignId != nil && len(*s.CampaignId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CampaignId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetCampaignActivitiesInput) SetApplicationId(v string) *GetCampaignActivitiesInput { - s.ApplicationId = &v +// SetDefineSegment sets the DefineSegment field's value. +func (s *ImportJobResource) SetDefineSegment(v bool) *ImportJobResource { + s.DefineSegment = &v return s } -// SetCampaignId sets the CampaignId field's value. -func (s *GetCampaignActivitiesInput) SetCampaignId(v string) *GetCampaignActivitiesInput { - s.CampaignId = &v +// SetExternalId sets the ExternalId field's value. +func (s *ImportJobResource) SetExternalId(v string) *ImportJobResource { + s.ExternalId = &v return s } -// SetPageSize sets the PageSize field's value. -func (s *GetCampaignActivitiesInput) SetPageSize(v string) *GetCampaignActivitiesInput { - s.PageSize = &v +// SetFormat sets the Format field's value. +func (s *ImportJobResource) SetFormat(v string) *ImportJobResource { + s.Format = &v return s } -// SetToken sets the Token field's value. -func (s *GetCampaignActivitiesInput) SetToken(v string) *GetCampaignActivitiesInput { - s.Token = &v +// SetRegisterEndpoints sets the RegisterEndpoints field's value. +func (s *ImportJobResource) SetRegisterEndpoints(v bool) *ImportJobResource { + s.RegisterEndpoints = &v return s } -type GetCampaignActivitiesOutput struct { - _ struct{} `type:"structure" payload:"ActivitiesResponse"` - - // Provides information about the activities that were performed by a campaign. - // - // ActivitiesResponse is a required field - ActivitiesResponse *ActivitiesResponse `type:"structure" required:"true"` +// SetRoleArn sets the RoleArn field's value. +func (s *ImportJobResource) SetRoleArn(v string) *ImportJobResource { + s.RoleArn = &v + return s } -// String returns the string representation -func (s GetCampaignActivitiesOutput) String() string { - return awsutil.Prettify(s) +// SetS3Url sets the S3Url field's value. +func (s *ImportJobResource) SetS3Url(v string) *ImportJobResource { + s.S3Url = &v + return s } -// GoString returns the string representation -func (s GetCampaignActivitiesOutput) GoString() string { - return s.String() +// SetSegmentId sets the SegmentId field's value. +func (s *ImportJobResource) SetSegmentId(v string) *ImportJobResource { + s.SegmentId = &v + return s } -// SetActivitiesResponse sets the ActivitiesResponse field's value. -func (s *GetCampaignActivitiesOutput) SetActivitiesResponse(v *ActivitiesResponse) *GetCampaignActivitiesOutput { - s.ActivitiesResponse = v +// SetSegmentName sets the SegmentName field's value. +func (s *ImportJobResource) SetSegmentName(v string) *ImportJobResource { + s.SegmentName = &v return s } -type GetCampaignDateRangeKpiInput struct { +// Provides information about the status and settings of a job that imports +// endpoint definitions from one or more files. The files can be stored in an +// Amazon Simple Storage Service (Amazon S3) bucket or uploaded directly from +// a computer by using the Amazon Pinpoint console. +type ImportJobResponse struct { _ struct{} `type:"structure"` + // The unique identifier for the application that's associated with the import + // job. + // // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + ApplicationId *string `type:"string" required:"true"` - // CampaignId is a required field - CampaignId *string `location:"uri" locationName:"campaign-id" type:"string" required:"true"` + // The number of pieces that were processed successfully (completed) by the + // import job, as of the time of the request. + CompletedPieces *int64 `type:"integer"` - EndTime *time.Time `location:"querystring" locationName:"end-time" type:"timestamp" timestampFormat:"iso8601"` + // The date, in ISO 8601 format, when the import job was completed. + CompletionDate *string `type:"string"` - // KpiName is a required field - KpiName *string `location:"uri" locationName:"kpi-name" type:"string" required:"true"` + // The date, in ISO 8601 format, when the import job was created. + // + // CreationDate is a required field + CreationDate *string `type:"string" required:"true"` - NextToken *string `location:"querystring" locationName:"next-token" type:"string"` + // The resource settings that apply to the import job. + // + // Definition is a required field + Definition *ImportJobResource `type:"structure" required:"true"` - PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + // The number of pieces that weren't processed successfully (failed) by the + // import job, as of the time of the request. + FailedPieces *int64 `type:"integer"` - StartTime *time.Time `location:"querystring" locationName:"start-time" type:"timestamp" timestampFormat:"iso8601"` + // An array of entries, one for each of the first 100 entries that weren't processed + // successfully (failed) by the import job, if any. + Failures []*string `type:"list"` + + // The unique identifier for the import job. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // The status of the import job. The job status is FAILED if Amazon Pinpoint + // wasn't able to process one or more pieces in the job. + // + // JobStatus is a required field + JobStatus *string `type:"string" required:"true" enum:"JobStatus"` + + // The total number of endpoint definitions that weren't processed successfully + // (failed) by the import job, typically because an error, such as a syntax + // error, occurred. + TotalFailures *int64 `type:"integer"` + + // The total number of pieces that must be processed to complete the import + // job. Each piece consists of an approximately equal portion of the endpoint + // definitions that are part of the import job. + TotalPieces *int64 `type:"integer"` + + // The total number of endpoint definitions that were processed by the import + // job. + TotalProcessed *int64 `type:"integer"` + + // The job type. This value is IMPORT for import jobs. + // + // Type is a required field + Type *string `type:"string" required:"true"` } // String returns the string representation -func (s GetCampaignDateRangeKpiInput) String() string { +func (s ImportJobResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetCampaignDateRangeKpiInput) GoString() string { +func (s ImportJobResponse) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCampaignDateRangeKpiInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCampaignDateRangeKpiInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.CampaignId == nil { - invalidParams.Add(request.NewErrParamRequired("CampaignId")) - } - if s.CampaignId != nil && len(*s.CampaignId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CampaignId", 1)) - } - if s.KpiName == nil { - invalidParams.Add(request.NewErrParamRequired("KpiName")) - } - if s.KpiName != nil && len(*s.KpiName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KpiName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - // SetApplicationId sets the ApplicationId field's value. -func (s *GetCampaignDateRangeKpiInput) SetApplicationId(v string) *GetCampaignDateRangeKpiInput { +func (s *ImportJobResponse) SetApplicationId(v string) *ImportJobResponse { s.ApplicationId = &v return s } -// SetCampaignId sets the CampaignId field's value. -func (s *GetCampaignDateRangeKpiInput) SetCampaignId(v string) *GetCampaignDateRangeKpiInput { - s.CampaignId = &v - return s -} - -// SetEndTime sets the EndTime field's value. -func (s *GetCampaignDateRangeKpiInput) SetEndTime(v time.Time) *GetCampaignDateRangeKpiInput { - s.EndTime = &v +// SetCompletedPieces sets the CompletedPieces field's value. +func (s *ImportJobResponse) SetCompletedPieces(v int64) *ImportJobResponse { + s.CompletedPieces = &v return s } -// SetKpiName sets the KpiName field's value. -func (s *GetCampaignDateRangeKpiInput) SetKpiName(v string) *GetCampaignDateRangeKpiInput { - s.KpiName = &v +// SetCompletionDate sets the CompletionDate field's value. +func (s *ImportJobResponse) SetCompletionDate(v string) *ImportJobResponse { + s.CompletionDate = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *GetCampaignDateRangeKpiInput) SetNextToken(v string) *GetCampaignDateRangeKpiInput { - s.NextToken = &v +// SetCreationDate sets the CreationDate field's value. +func (s *ImportJobResponse) SetCreationDate(v string) *ImportJobResponse { + s.CreationDate = &v return s } -// SetPageSize sets the PageSize field's value. -func (s *GetCampaignDateRangeKpiInput) SetPageSize(v string) *GetCampaignDateRangeKpiInput { - s.PageSize = &v +// SetDefinition sets the Definition field's value. +func (s *ImportJobResponse) SetDefinition(v *ImportJobResource) *ImportJobResponse { + s.Definition = v return s } -// SetStartTime sets the StartTime field's value. -func (s *GetCampaignDateRangeKpiInput) SetStartTime(v time.Time) *GetCampaignDateRangeKpiInput { - s.StartTime = &v +// SetFailedPieces sets the FailedPieces field's value. +func (s *ImportJobResponse) SetFailedPieces(v int64) *ImportJobResponse { + s.FailedPieces = &v return s } -type GetCampaignDateRangeKpiOutput struct { - _ struct{} `type:"structure" payload:"CampaignDateRangeKpiResponse"` - - // Provides the results of a query that retrieved the data for a standard metric - // that applies to a campaign, and provides information about that query. - // - // CampaignDateRangeKpiResponse is a required field - CampaignDateRangeKpiResponse *CampaignDateRangeKpiResponse `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetCampaignDateRangeKpiOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCampaignDateRangeKpiOutput) GoString() string { - return s.String() -} - -// SetCampaignDateRangeKpiResponse sets the CampaignDateRangeKpiResponse field's value. -func (s *GetCampaignDateRangeKpiOutput) SetCampaignDateRangeKpiResponse(v *CampaignDateRangeKpiResponse) *GetCampaignDateRangeKpiOutput { - s.CampaignDateRangeKpiResponse = v +// SetFailures sets the Failures field's value. +func (s *ImportJobResponse) SetFailures(v []*string) *ImportJobResponse { + s.Failures = v return s } -type GetCampaignInput struct { - _ struct{} `type:"structure"` - - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - - // CampaignId is a required field - CampaignId *string `location:"uri" locationName:"campaign-id" type:"string" required:"true"` +// SetId sets the Id field's value. +func (s *ImportJobResponse) SetId(v string) *ImportJobResponse { + s.Id = &v + return s } -// String returns the string representation -func (s GetCampaignInput) String() string { - return awsutil.Prettify(s) +// SetJobStatus sets the JobStatus field's value. +func (s *ImportJobResponse) SetJobStatus(v string) *ImportJobResponse { + s.JobStatus = &v + return s } -// GoString returns the string representation -func (s GetCampaignInput) GoString() string { - return s.String() +// SetTotalFailures sets the TotalFailures field's value. +func (s *ImportJobResponse) SetTotalFailures(v int64) *ImportJobResponse { + s.TotalFailures = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCampaignInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCampaignInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.CampaignId == nil { - invalidParams.Add(request.NewErrParamRequired("CampaignId")) - } - if s.CampaignId != nil && len(*s.CampaignId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CampaignId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetTotalPieces sets the TotalPieces field's value. +func (s *ImportJobResponse) SetTotalPieces(v int64) *ImportJobResponse { + s.TotalPieces = &v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetCampaignInput) SetApplicationId(v string) *GetCampaignInput { - s.ApplicationId = &v +// SetTotalProcessed sets the TotalProcessed field's value. +func (s *ImportJobResponse) SetTotalProcessed(v int64) *ImportJobResponse { + s.TotalProcessed = &v return s } -// SetCampaignId sets the CampaignId field's value. -func (s *GetCampaignInput) SetCampaignId(v string) *GetCampaignInput { - s.CampaignId = &v +// SetType sets the Type field's value. +func (s *ImportJobResponse) SetType(v string) *ImportJobResponse { + s.Type = &v return s } -type GetCampaignOutput struct { - _ struct{} `type:"structure" payload:"CampaignResponse"` +// Provides information about the status and settings of all the import jobs +// that are associated with an application or segment. An import job is a job +// that imports endpoint definitions from one or more files. +type ImportJobsResponse struct { + _ struct{} `type:"structure"` - // Provides information about the status, configuration, and other settings - // for a campaign. + // An array of responses, one for each import job that's associated with the + // application (Import Jobs resource) or segment (Segment Import Jobs resource). // - // CampaignResponse is a required field - CampaignResponse *CampaignResponse `type:"structure" required:"true"` + // Item is a required field + Item []*ImportJobResponse `type:"list" required:"true"` + + // The string to use in a subsequent request to get the next page of results + // in a paginated response. This value is null if there are no additional pages. + NextToken *string `type:"string"` } // String returns the string representation -func (s GetCampaignOutput) String() string { +func (s ImportJobsResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetCampaignOutput) GoString() string { +func (s ImportJobsResponse) GoString() string { return s.String() } -// SetCampaignResponse sets the CampaignResponse field's value. -func (s *GetCampaignOutput) SetCampaignResponse(v *CampaignResponse) *GetCampaignOutput { - s.CampaignResponse = v +// SetItem sets the Item field's value. +func (s *ImportJobsResponse) SetItem(v []*ImportJobResponse) *ImportJobsResponse { + s.Item = v return s } -type GetCampaignVersionInput struct { - _ struct{} `type:"structure"` +// SetNextToken sets the NextToken field's value. +func (s *ImportJobsResponse) SetNextToken(v string) *ImportJobsResponse { + s.NextToken = &v + return s +} - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +// Provides information about an API request or response. +type InternalServerErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // CampaignId is a required field - CampaignId *string `location:"uri" locationName:"campaign-id" type:"string" required:"true"` + Message_ *string `locationName:"Message" type:"string"` - // Version is a required field - Version *string `location:"uri" locationName:"version" type:"string" required:"true"` + RequestID_ *string `locationName:"RequestID" type:"string"` } // String returns the string representation -func (s GetCampaignVersionInput) String() string { +func (s InternalServerErrorException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetCampaignVersionInput) GoString() string { +func (s InternalServerErrorException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCampaignVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCampaignVersionInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.CampaignId == nil { - invalidParams.Add(request.NewErrParamRequired("CampaignId")) - } - if s.CampaignId != nil && len(*s.CampaignId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CampaignId", 1)) - } - if s.Version == nil { - invalidParams.Add(request.NewErrParamRequired("Version")) - } - if s.Version != nil && len(*s.Version) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Version", 1)) +func newErrorInternalServerErrorException(v protocol.ResponseMetadata) error { + return &InternalServerErrorException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InternalServerErrorException) Code() string { + return "InternalServerErrorException" +} + +// Message returns the exception's message. +func (s InternalServerErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerErrorException) OrigErr() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetCampaignVersionInput) SetApplicationId(v string) *GetCampaignVersionInput { - s.ApplicationId = &v - return s +func (s InternalServerErrorException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetCampaignId sets the CampaignId field's value. -func (s *GetCampaignVersionInput) SetCampaignId(v string) *GetCampaignVersionInput { - s.CampaignId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerErrorException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetVersion sets the Version field's value. -func (s *GetCampaignVersionInput) SetVersion(v string) *GetCampaignVersionInput { - s.Version = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InternalServerErrorException) RequestID() string { + return s.respMetadata.RequestID } -type GetCampaignVersionOutput struct { - _ struct{} `type:"structure" payload:"CampaignResponse"` +// Provides information about the results of a request to create or update an +// endpoint that's associated with an event. +type ItemResponse struct { + _ struct{} `type:"structure"` - // Provides information about the status, configuration, and other settings - // for a campaign. - // - // CampaignResponse is a required field - CampaignResponse *CampaignResponse `type:"structure" required:"true"` + // The response that was received after the endpoint data was accepted. + EndpointItemResponse *EndpointItemResponse `type:"structure"` + + // A multipart response object that contains a key and a value for each event + // in the request. In each object, the event ID is the key and an EventItemResponse + // object is the value. + EventsItemResponse map[string]*EventItemResponse `type:"map"` } // String returns the string representation -func (s GetCampaignVersionOutput) String() string { +func (s ItemResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetCampaignVersionOutput) GoString() string { +func (s ItemResponse) GoString() string { return s.String() } -// SetCampaignResponse sets the CampaignResponse field's value. -func (s *GetCampaignVersionOutput) SetCampaignResponse(v *CampaignResponse) *GetCampaignVersionOutput { - s.CampaignResponse = v +// SetEndpointItemResponse sets the EndpointItemResponse field's value. +func (s *ItemResponse) SetEndpointItemResponse(v *EndpointItemResponse) *ItemResponse { + s.EndpointItemResponse = v return s } -type GetCampaignVersionsInput struct { +// SetEventsItemResponse sets the EventsItemResponse field's value. +func (s *ItemResponse) SetEventsItemResponse(v map[string]*EventItemResponse) *ItemResponse { + s.EventsItemResponse = v + return s +} + +// Provides the results of a query that retrieved the data for a standard engagement +// metric that applies to a journey, and provides information about that query. +type JourneyDateRangeKpiResponse struct { _ struct{} `type:"structure"` + // The unique identifier for the application that the metric applies to. + // // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + ApplicationId *string `type:"string" required:"true"` - // CampaignId is a required field - CampaignId *string `location:"uri" locationName:"campaign-id" type:"string" required:"true"` + // EndTime is a required field + EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` - PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + // The unique identifier for the journey that the metric applies to. + // + // JourneyId is a required field + JourneyId *string `type:"string" required:"true"` - Token *string `location:"querystring" locationName:"token" type:"string"` + // The name of the metric, also referred to as a key performance indicator (KPI), + // that the data was retrieved for. This value describes the associated metric + // and consists of two or more terms, which are comprised of lowercase alphanumeric + // characters, separated by a hyphen. For a list of possible values, see the + // Amazon Pinpoint Developer Guide (https://docs.aws.amazon.com/pinpoint/latest/developerguide/welcome.html). + // + // KpiName is a required field + KpiName *string `type:"string" required:"true"` + + // An array of objects that contains the results of the query. Each object contains + // the value for the metric and metadata about that value. + // + // KpiResult is a required field + KpiResult *BaseKpiResult `type:"structure" required:"true"` + + // The string to use in a subsequent request to get the next page of results + // in a paginated response. This value is null for the Journey Engagement Metrics + // resource because the resource returns all results in a single page. + NextToken *string `type:"string"` + + // StartTime is a required field + StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601" required:"true"` } // String returns the string representation -func (s GetCampaignVersionsInput) String() string { +func (s JourneyDateRangeKpiResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetCampaignVersionsInput) GoString() string { +func (s JourneyDateRangeKpiResponse) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCampaignVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCampaignVersionsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.CampaignId == nil { - invalidParams.Add(request.NewErrParamRequired("CampaignId")) - } - if s.CampaignId != nil && len(*s.CampaignId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CampaignId", 1)) - } +// SetApplicationId sets the ApplicationId field's value. +func (s *JourneyDateRangeKpiResponse) SetApplicationId(v string) *JourneyDateRangeKpiResponse { + s.ApplicationId = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetEndTime sets the EndTime field's value. +func (s *JourneyDateRangeKpiResponse) SetEndTime(v time.Time) *JourneyDateRangeKpiResponse { + s.EndTime = &v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetCampaignVersionsInput) SetApplicationId(v string) *GetCampaignVersionsInput { - s.ApplicationId = &v +// SetJourneyId sets the JourneyId field's value. +func (s *JourneyDateRangeKpiResponse) SetJourneyId(v string) *JourneyDateRangeKpiResponse { + s.JourneyId = &v return s } -// SetCampaignId sets the CampaignId field's value. -func (s *GetCampaignVersionsInput) SetCampaignId(v string) *GetCampaignVersionsInput { - s.CampaignId = &v +// SetKpiName sets the KpiName field's value. +func (s *JourneyDateRangeKpiResponse) SetKpiName(v string) *JourneyDateRangeKpiResponse { + s.KpiName = &v return s } -// SetPageSize sets the PageSize field's value. -func (s *GetCampaignVersionsInput) SetPageSize(v string) *GetCampaignVersionsInput { - s.PageSize = &v +// SetKpiResult sets the KpiResult field's value. +func (s *JourneyDateRangeKpiResponse) SetKpiResult(v *BaseKpiResult) *JourneyDateRangeKpiResponse { + s.KpiResult = v return s } -// SetToken sets the Token field's value. -func (s *GetCampaignVersionsInput) SetToken(v string) *GetCampaignVersionsInput { - s.Token = &v +// SetNextToken sets the NextToken field's value. +func (s *JourneyDateRangeKpiResponse) SetNextToken(v string) *JourneyDateRangeKpiResponse { + s.NextToken = &v return s } -type GetCampaignVersionsOutput struct { - _ struct{} `type:"structure" payload:"CampaignsResponse"` +// SetStartTime sets the StartTime field's value. +func (s *JourneyDateRangeKpiResponse) SetStartTime(v time.Time) *JourneyDateRangeKpiResponse { + s.StartTime = &v + return s +} - // Provides information about the configuration and other settings for all the - // campaigns that are associated with an application. - // - // CampaignsResponse is a required field - CampaignsResponse *CampaignsResponse `type:"structure" required:"true"` +// Specifies the "From" address for an email message that's sent to participants +// in a journey. +type JourneyEmailMessage struct { + _ struct{} `type:"structure"` + + // The verified email address to send the email message from. The default address + // is the FromAddress specified for the email channel for the application. + FromAddress *string `type:"string"` } // String returns the string representation -func (s GetCampaignVersionsOutput) String() string { +func (s JourneyEmailMessage) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetCampaignVersionsOutput) GoString() string { +func (s JourneyEmailMessage) GoString() string { return s.String() } -// SetCampaignsResponse sets the CampaignsResponse field's value. -func (s *GetCampaignVersionsOutput) SetCampaignsResponse(v *CampaignsResponse) *GetCampaignVersionsOutput { - s.CampaignsResponse = v +// SetFromAddress sets the FromAddress field's value. +func (s *JourneyEmailMessage) SetFromAddress(v string) *JourneyEmailMessage { + s.FromAddress = &v return s } -type GetCampaignsInput struct { +// Provides the results of a query that retrieved the data for a standard execution +// metric that applies to a journey activity, and provides information about +// that query. +type JourneyExecutionActivityMetricsResponse struct { _ struct{} `type:"structure"` + // The type of activity that the metric applies to. Possible values are: + // + // * CONDITIONAL_SPLIT - For a yes/no split activity, which is an activity + // that sends participants down one of two paths in a journey. + // + // * HOLDOUT - For a holdout activity, which is an activity that stops a + // journey for a specified percentage of participants. + // + // * MESSAGE - For an email activity, which is an activity that sends an + // email message to participants. + // + // * MULTI_CONDITIONAL_SPLIT - For a multivariate split activity, which is + // an activity that sends participants down one of as many as five paths + // in a journey. + // + // * RANDOM_SPLIT - For a random split activity, which is an activity that + // sends specified percentages of participants down one of as many as five + // paths in a journey. + // + // * WAIT - For a wait activity, which is an activity that waits for a certain + // amount of time or until a specific date and time before moving participants + // to the next activity in a journey. + // + // ActivityType is a required field + ActivityType *string `type:"string" required:"true"` + + // The unique identifier for the application that the metric applies to. + // // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + ApplicationId *string `type:"string" required:"true"` - PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + // The unique identifier for the activity that the metric applies to. + // + // JourneyActivityId is a required field + JourneyActivityId *string `type:"string" required:"true"` - Token *string `location:"querystring" locationName:"token" type:"string"` + // The unique identifier for the journey that the metric applies to. + // + // JourneyId is a required field + JourneyId *string `type:"string" required:"true"` + + // The date and time, in ISO 8601 format, when Amazon Pinpoint last evaluated + // the execution status of the activity and updated the data for the metric. + // + // LastEvaluatedTime is a required field + LastEvaluatedTime *string `type:"string" required:"true"` + + // A JSON object that contains the results of the query. The results vary depending + // on the type of activity (ActivityType). For information about the structure + // and contents of the results, see the Amazon Pinpoint Developer Guide (https://docs.aws.amazon.com/pinpoint/latest/developerguide/welcome.html). + // + // Metrics is a required field + Metrics map[string]*string `type:"map" required:"true"` } // String returns the string representation -func (s GetCampaignsInput) String() string { +func (s JourneyExecutionActivityMetricsResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetCampaignsInput) GoString() string { +func (s JourneyExecutionActivityMetricsResponse) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetCampaignsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetCampaignsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetActivityType sets the ActivityType field's value. +func (s *JourneyExecutionActivityMetricsResponse) SetActivityType(v string) *JourneyExecutionActivityMetricsResponse { + s.ActivityType = &v + return s } // SetApplicationId sets the ApplicationId field's value. -func (s *GetCampaignsInput) SetApplicationId(v string) *GetCampaignsInput { +func (s *JourneyExecutionActivityMetricsResponse) SetApplicationId(v string) *JourneyExecutionActivityMetricsResponse { s.ApplicationId = &v return s } -// SetPageSize sets the PageSize field's value. -func (s *GetCampaignsInput) SetPageSize(v string) *GetCampaignsInput { - s.PageSize = &v +// SetJourneyActivityId sets the JourneyActivityId field's value. +func (s *JourneyExecutionActivityMetricsResponse) SetJourneyActivityId(v string) *JourneyExecutionActivityMetricsResponse { + s.JourneyActivityId = &v return s } -// SetToken sets the Token field's value. -func (s *GetCampaignsInput) SetToken(v string) *GetCampaignsInput { - s.Token = &v +// SetJourneyId sets the JourneyId field's value. +func (s *JourneyExecutionActivityMetricsResponse) SetJourneyId(v string) *JourneyExecutionActivityMetricsResponse { + s.JourneyId = &v return s } -type GetCampaignsOutput struct { - _ struct{} `type:"structure" payload:"CampaignsResponse"` - - // Provides information about the configuration and other settings for all the - // campaigns that are associated with an application. - // - // CampaignsResponse is a required field - CampaignsResponse *CampaignsResponse `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetCampaignsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetCampaignsOutput) GoString() string { - return s.String() +// SetLastEvaluatedTime sets the LastEvaluatedTime field's value. +func (s *JourneyExecutionActivityMetricsResponse) SetLastEvaluatedTime(v string) *JourneyExecutionActivityMetricsResponse { + s.LastEvaluatedTime = &v + return s } -// SetCampaignsResponse sets the CampaignsResponse field's value. -func (s *GetCampaignsOutput) SetCampaignsResponse(v *CampaignsResponse) *GetCampaignsOutput { - s.CampaignsResponse = v +// SetMetrics sets the Metrics field's value. +func (s *JourneyExecutionActivityMetricsResponse) SetMetrics(v map[string]*string) *JourneyExecutionActivityMetricsResponse { + s.Metrics = v return s } -type GetChannelsInput struct { +// Provides the results of a query that retrieved the data for a standard execution +// metric that applies to a journey, and provides information about that query. +type JourneyExecutionMetricsResponse struct { _ struct{} `type:"structure"` + // The unique identifier for the application that the metric applies to. + // // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + ApplicationId *string `type:"string" required:"true"` + + // The unique identifier for the journey that the metric applies to. + // + // JourneyId is a required field + JourneyId *string `type:"string" required:"true"` + + // The date and time, in ISO 8601 format, when Amazon Pinpoint last evaluated + // the journey and updated the data for the metric. + // + // LastEvaluatedTime is a required field + LastEvaluatedTime *string `type:"string" required:"true"` + + // A JSON object that contains the results of the query. For information about + // the structure and contents of the results, see the Amazon Pinpoint Developer + // Guide (https://docs.aws.amazon.com/pinpoint/latest/developerguide/welcome.html). + // + // Metrics is a required field + Metrics map[string]*string `type:"map" required:"true"` } // String returns the string representation -func (s GetChannelsInput) String() string { +func (s JourneyExecutionMetricsResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetChannelsInput) GoString() string { +func (s JourneyExecutionMetricsResponse) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetChannelsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetChannelsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } +// SetApplicationId sets the ApplicationId field's value. +func (s *JourneyExecutionMetricsResponse) SetApplicationId(v string) *JourneyExecutionMetricsResponse { + s.ApplicationId = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetJourneyId sets the JourneyId field's value. +func (s *JourneyExecutionMetricsResponse) SetJourneyId(v string) *JourneyExecutionMetricsResponse { + s.JourneyId = &v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetChannelsInput) SetApplicationId(v string) *GetChannelsInput { - s.ApplicationId = &v +// SetLastEvaluatedTime sets the LastEvaluatedTime field's value. +func (s *JourneyExecutionMetricsResponse) SetLastEvaluatedTime(v string) *JourneyExecutionMetricsResponse { + s.LastEvaluatedTime = &v return s } -type GetChannelsOutput struct { - _ struct{} `type:"structure" payload:"ChannelsResponse"` +// SetMetrics sets the Metrics field's value. +func (s *JourneyExecutionMetricsResponse) SetMetrics(v map[string]*string) *JourneyExecutionMetricsResponse { + s.Metrics = v + return s +} - // Provides information about the general settings and status of all channels - // for an application, including channels that aren't enabled for the application. - // - // ChannelsResponse is a required field - ChannelsResponse *ChannelsResponse `type:"structure" required:"true"` +// Specifies limits on the messages that a journey can send and the number of +// times participants can enter a journey. +type JourneyLimits struct { + _ struct{} `type:"structure"` + + // The maximum number of messages that the journey can send to a single participant + // during a 24-hour period. The maximum value is 100. + DailyCap *int64 `type:"integer"` + + // The maximum number of times that a participant can enter the journey. The + // maximum value is 100. To allow participants to enter the journey an unlimited + // number of times, set this value to 0. + EndpointReentryCap *int64 `type:"integer"` + + // The maximum number of messages that the journey can send each second. + MessagesPerSecond *int64 `type:"integer"` } // String returns the string representation -func (s GetChannelsOutput) String() string { +func (s JourneyLimits) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetChannelsOutput) GoString() string { +func (s JourneyLimits) GoString() string { return s.String() } -// SetChannelsResponse sets the ChannelsResponse field's value. -func (s *GetChannelsOutput) SetChannelsResponse(v *ChannelsResponse) *GetChannelsOutput { - s.ChannelsResponse = v +// SetDailyCap sets the DailyCap field's value. +func (s *JourneyLimits) SetDailyCap(v int64) *JourneyLimits { + s.DailyCap = &v return s } -type GetEmailChannelInput struct { +// SetEndpointReentryCap sets the EndpointReentryCap field's value. +func (s *JourneyLimits) SetEndpointReentryCap(v int64) *JourneyLimits { + s.EndpointReentryCap = &v + return s +} + +// SetMessagesPerSecond sets the MessagesPerSecond field's value. +func (s *JourneyLimits) SetMessagesPerSecond(v int64) *JourneyLimits { + s.MessagesPerSecond = &v + return s +} + +// Provides information about the status, configuration, and other settings +// for a journey. +type JourneyResponse struct { _ struct{} `type:"structure"` + // A map that contains a set of Activity objects, one object for each activity + // in the journey. For each Activity object, the key is the unique identifier + // (string) for an activity and the value is the settings for the activity. + Activities map[string]*Activity `type:"map"` + + // The unique identifier for the application that the journey applies to. + // // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + ApplicationId *string `type:"string" required:"true"` + + // The date, in ISO 8601 format, when the journey was created. + CreationDate *string `type:"string"` + + // The unique identifier for the journey. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // The date, in ISO 8601 format, when the journey was last modified. + LastModifiedDate *string `type:"string"` + + // The messaging and entry limits for the journey. + Limits *JourneyLimits `type:"structure"` + + // Specifies whether the journey's scheduled start and end times use each participant's + // local time. If this value is true, the schedule uses each participant's local + // time. + LocalTime *bool `type:"boolean"` + + // The name of the journey. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // The quiet time settings for the journey. Quiet time is a specific time range + // when a journey doesn't send messages to participants, if all the following + // conditions are met: + // + // * The EndpointDemographic.Timezone property of the endpoint for the participant + // is set to a valid value. + // + // * The current time in the participant's time zone is later than or equal + // to the time specified by the QuietTime.Start property for the journey. + // + // * The current time in the participant's time zone is earlier than or equal + // to the time specified by the QuietTime.End property for the journey. + // + // If any of the preceding conditions isn't met, the participant will receive + // messages from the journey, even if quiet time is enabled. + QuietTime *QuietTime `type:"structure"` + + // The frequency with which Amazon Pinpoint evaluates segment and event data + // for the journey, as a duration in ISO 8601 format. + RefreshFrequency *string `type:"string"` + + // The schedule settings for the journey. + Schedule *JourneySchedule `type:"structure"` + + // The unique identifier for the first activity in the journey. + StartActivity *string `type:"string"` + + // The segment that defines which users are participants in the journey. + StartCondition *StartCondition `type:"structure"` + + // The current status of the journey. Possible values are: + // + // * DRAFT - The journey is being developed and hasn't been published yet. + // + // * ACTIVE - The journey has been developed and published. Depending on + // the journey's schedule, the journey may currently be running or scheduled + // to start running at a later time. If a journey's status is ACTIVE, you + // can't add, change, or remove activities from it. + // + // * COMPLETED - The journey has been published and has finished running. + // All participants have entered the journey and no participants are waiting + // to complete the journey or any activities in the journey. + // + // * CANCELLED - The journey has been stopped. If a journey's status is CANCELLED, + // you can't add, change, or remove activities or segment settings from the + // journey. + // + // * CLOSED - The journey has been published and has started running. It + // may have also passed its scheduled end time, or passed its scheduled start + // time and a refresh frequency hasn't been specified for it. If a journey's + // status is CLOSED, you can't add participants to it, and no existing participants + // can enter the journey for the first time. However, any existing participants + // who are currently waiting to start an activity may continue the journey. + State *string `type:"string" enum:"State"` + + // A string-to-string map of key-value pairs that identifies the tags that are + // associated with the journey. Each tag consists of a required tag key and + // an associated tag value. + Tags map[string]*string `locationName:"tags" type:"map"` } // String returns the string representation -func (s GetEmailChannelInput) String() string { +func (s JourneyResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetEmailChannelInput) GoString() string { +func (s JourneyResponse) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEmailChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEmailChannelInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetActivities sets the Activities field's value. +func (s *JourneyResponse) SetActivities(v map[string]*Activity) *JourneyResponse { + s.Activities = v + return s } // SetApplicationId sets the ApplicationId field's value. -func (s *GetEmailChannelInput) SetApplicationId(v string) *GetEmailChannelInput { +func (s *JourneyResponse) SetApplicationId(v string) *JourneyResponse { s.ApplicationId = &v return s } -type GetEmailChannelOutput struct { - _ struct{} `type:"structure" payload:"EmailChannelResponse"` +// SetCreationDate sets the CreationDate field's value. +func (s *JourneyResponse) SetCreationDate(v string) *JourneyResponse { + s.CreationDate = &v + return s +} - // Provides information about the status and settings of the email channel for - // an application. - // - // EmailChannelResponse is a required field - EmailChannelResponse *EmailChannelResponse `type:"structure" required:"true"` +// SetId sets the Id field's value. +func (s *JourneyResponse) SetId(v string) *JourneyResponse { + s.Id = &v + return s } -// String returns the string representation -func (s GetEmailChannelOutput) String() string { - return awsutil.Prettify(s) +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *JourneyResponse) SetLastModifiedDate(v string) *JourneyResponse { + s.LastModifiedDate = &v + return s } -// GoString returns the string representation -func (s GetEmailChannelOutput) GoString() string { - return s.String() +// SetLimits sets the Limits field's value. +func (s *JourneyResponse) SetLimits(v *JourneyLimits) *JourneyResponse { + s.Limits = v + return s } -// SetEmailChannelResponse sets the EmailChannelResponse field's value. -func (s *GetEmailChannelOutput) SetEmailChannelResponse(v *EmailChannelResponse) *GetEmailChannelOutput { - s.EmailChannelResponse = v +// SetLocalTime sets the LocalTime field's value. +func (s *JourneyResponse) SetLocalTime(v bool) *JourneyResponse { + s.LocalTime = &v return s } -type GetEndpointInput struct { - _ struct{} `type:"structure"` +// SetName sets the Name field's value. +func (s *JourneyResponse) SetName(v string) *JourneyResponse { + s.Name = &v + return s +} - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +// SetQuietTime sets the QuietTime field's value. +func (s *JourneyResponse) SetQuietTime(v *QuietTime) *JourneyResponse { + s.QuietTime = v + return s +} - // EndpointId is a required field - EndpointId *string `location:"uri" locationName:"endpoint-id" type:"string" required:"true"` +// SetRefreshFrequency sets the RefreshFrequency field's value. +func (s *JourneyResponse) SetRefreshFrequency(v string) *JourneyResponse { + s.RefreshFrequency = &v + return s } -// String returns the string representation -func (s GetEndpointInput) String() string { - return awsutil.Prettify(s) +// SetSchedule sets the Schedule field's value. +func (s *JourneyResponse) SetSchedule(v *JourneySchedule) *JourneyResponse { + s.Schedule = v + return s } -// GoString returns the string representation -func (s GetEndpointInput) GoString() string { - return s.String() +// SetStartActivity sets the StartActivity field's value. +func (s *JourneyResponse) SetStartActivity(v string) *JourneyResponse { + s.StartActivity = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEndpointInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.EndpointId == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointId")) - } - if s.EndpointId != nil && len(*s.EndpointId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EndpointId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetStartCondition sets the StartCondition field's value. +func (s *JourneyResponse) SetStartCondition(v *StartCondition) *JourneyResponse { + s.StartCondition = v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetEndpointInput) SetApplicationId(v string) *GetEndpointInput { - s.ApplicationId = &v +// SetState sets the State field's value. +func (s *JourneyResponse) SetState(v string) *JourneyResponse { + s.State = &v return s } -// SetEndpointId sets the EndpointId field's value. -func (s *GetEndpointInput) SetEndpointId(v string) *GetEndpointInput { - s.EndpointId = &v +// SetTags sets the Tags field's value. +func (s *JourneyResponse) SetTags(v map[string]*string) *JourneyResponse { + s.Tags = v return s } -type GetEndpointOutput struct { - _ struct{} `type:"structure" payload:"EndpointResponse"` +// Specifies the schedule settings for a journey. +type JourneySchedule struct { + _ struct{} `type:"structure"` - // Provides information about the channel type and other settings for an endpoint. - // - // EndpointResponse is a required field - EndpointResponse *EndpointResponse `type:"structure" required:"true"` + EndTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + StartTime *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + // The starting UTC offset for the journey schedule, if the value of the journey's + // LocalTime property is true. Valid values are: UTC, UTC+01, UTC+02, UTC+03, + // UTC+03:30, UTC+04, UTC+04:30, UTC+05, UTC+05:30, UTC+05:45, UTC+06, UTC+06:30, + // UTC+07, UTC+08, UTC+08:45, UTC+09, UTC+09:30, UTC+10, UTC+10:30, UTC+11, + // UTC+12, UTC+12:45, UTC+13, UTC+13:45, UTC-02, UTC-02:30, UTC-03, UTC-03:30, + // UTC-04, UTC-05, UTC-06, UTC-07, UTC-08, UTC-09, UTC-09:30, UTC-10, and UTC-11. + Timezone *string `type:"string"` } // String returns the string representation -func (s GetEndpointOutput) String() string { +func (s JourneySchedule) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetEndpointOutput) GoString() string { +func (s JourneySchedule) GoString() string { return s.String() } -// SetEndpointResponse sets the EndpointResponse field's value. -func (s *GetEndpointOutput) SetEndpointResponse(v *EndpointResponse) *GetEndpointOutput { - s.EndpointResponse = v +// SetEndTime sets the EndTime field's value. +func (s *JourneySchedule) SetEndTime(v time.Time) *JourneySchedule { + s.EndTime = &v return s } -type GetEventStreamInput struct { +// SetStartTime sets the StartTime field's value. +func (s *JourneySchedule) SetStartTime(v time.Time) *JourneySchedule { + s.StartTime = &v + return s +} + +// SetTimezone sets the Timezone field's value. +func (s *JourneySchedule) SetTimezone(v string) *JourneySchedule { + s.Timezone = &v + return s +} + +// Changes the status of a journey. +type JourneyStateRequest struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The status of the journey. Currently, the only supported value is CANCELLED. + // + // If you cancel a journey, Amazon Pinpoint continues to perform activities + // that are currently in progress, until those activities are complete. Amazon + // Pinpoint also continues to collect and aggregate analytics data for those + // activities, until they are complete, and any activities that were complete + // when you cancelled the journey. + // + // After you cancel a journey, you can't add, change, or remove any activities + // from the journey. In addition, Amazon Pinpoint stops evaluating the journey + // and doesn't perform any activities that haven't started. + State *string `type:"string" enum:"State"` } // String returns the string representation -func (s GetEventStreamInput) String() string { +func (s JourneyStateRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetEventStreamInput) GoString() string { +func (s JourneyStateRequest) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEventStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEventStreamInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetEventStreamInput) SetApplicationId(v string) *GetEventStreamInput { - s.ApplicationId = &v +// SetState sets the State field's value. +func (s *JourneyStateRequest) SetState(v string) *JourneyStateRequest { + s.State = &v return s } -type GetEventStreamOutput struct { - _ struct{} `type:"structure" payload:"EventStream"` +// Provides information about the status, configuration, and other settings +// for all the journeys that are associated with an application. +type JourneysResponse struct { + _ struct{} `type:"structure"` - // Specifies settings for publishing event data to an Amazon Kinesis data stream - // or an Amazon Kinesis Data Firehose delivery stream. + // An array of responses, one for each journey that's associated with the application. // - // EventStream is a required field - EventStream *EventStream `type:"structure" required:"true"` + // Item is a required field + Item []*JourneyResponse `type:"list" required:"true"` + + // The string to use in a subsequent request to get the next page of results + // in a paginated response. This value is null if there are no additional pages. + NextToken *string `type:"string"` } // String returns the string representation -func (s GetEventStreamOutput) String() string { +func (s JourneysResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetEventStreamOutput) GoString() string { +func (s JourneysResponse) GoString() string { return s.String() } -// SetEventStream sets the EventStream field's value. -func (s *GetEventStreamOutput) SetEventStream(v *EventStream) *GetEventStreamOutput { - s.EventStream = v +// SetItem sets the Item field's value. +func (s *JourneysResponse) SetItem(v []*JourneyResponse) *JourneysResponse { + s.Item = v return s } -type GetExportJobInput struct { +// SetNextToken sets the NextToken field's value. +func (s *JourneysResponse) SetNextToken(v string) *JourneysResponse { + s.NextToken = &v + return s +} + +type ListJourneysInput struct { _ struct{} `type:"structure"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // JobId is a required field - JobId *string `location:"uri" locationName:"job-id" type:"string" required:"true"` + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + + Token *string `location:"querystring" locationName:"token" type:"string"` } // String returns the string representation -func (s GetExportJobInput) String() string { +func (s ListJourneysInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetExportJobInput) GoString() string { +func (s ListJourneysInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetExportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetExportJobInput"} +func (s *ListJourneysInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListJourneysInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } - 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 @@ -16691,74 +24343,74 @@ func (s *GetExportJobInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *GetExportJobInput) SetApplicationId(v string) *GetExportJobInput { +func (s *ListJourneysInput) SetApplicationId(v string) *ListJourneysInput { s.ApplicationId = &v return s } -// SetJobId sets the JobId field's value. -func (s *GetExportJobInput) SetJobId(v string) *GetExportJobInput { - s.JobId = &v +// SetPageSize sets the PageSize field's value. +func (s *ListJourneysInput) SetPageSize(v string) *ListJourneysInput { + s.PageSize = &v return s } -type GetExportJobOutput struct { - _ struct{} `type:"structure" payload:"ExportJobResponse"` +// SetToken sets the Token field's value. +func (s *ListJourneysInput) SetToken(v string) *ListJourneysInput { + s.Token = &v + return s +} - // Provides information about the status and settings of a job that exports - // endpoint definitions to a file. The file can be added directly to an Amazon - // Simple Storage Service (Amazon S3) bucket by using the Amazon Pinpoint API - // or downloaded directly to a computer by using the Amazon Pinpoint console. +type ListJourneysOutput struct { + _ struct{} `type:"structure" payload:"JourneysResponse"` + + // Provides information about the status, configuration, and other settings + // for all the journeys that are associated with an application. // - // ExportJobResponse is a required field - ExportJobResponse *ExportJobResponse `type:"structure" required:"true"` + // JourneysResponse is a required field + JourneysResponse *JourneysResponse `type:"structure" required:"true"` } // String returns the string representation -func (s GetExportJobOutput) String() string { +func (s ListJourneysOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetExportJobOutput) GoString() string { +func (s ListJourneysOutput) GoString() string { return s.String() } -// SetExportJobResponse sets the ExportJobResponse field's value. -func (s *GetExportJobOutput) SetExportJobResponse(v *ExportJobResponse) *GetExportJobOutput { - s.ExportJobResponse = v +// SetJourneysResponse sets the JourneysResponse field's value. +func (s *ListJourneysOutput) SetJourneysResponse(v *JourneysResponse) *ListJourneysOutput { + s.JourneysResponse = v return s } -type GetExportJobsInput struct { +type ListTagsForResourceInput struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - - PageSize *string `location:"querystring" locationName:"page-size" type:"string"` - - Token *string `location:"querystring" locationName:"token" type:"string"` + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` } // String returns the string representation -func (s GetExportJobsInput) String() string { +func (s ListTagsForResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetExportJobsInput) GoString() string { +func (s ListTagsForResourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetExportJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetExportJobsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) +func (s *ListTagsForResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) } if invalidParams.Len() > 0 { @@ -16767,76 +24419,76 @@ func (s *GetExportJobsInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetExportJobsInput) SetApplicationId(v string) *GetExportJobsInput { - s.ApplicationId = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *GetExportJobsInput) SetPageSize(v string) *GetExportJobsInput { - s.PageSize = &v - return s -} - -// SetToken sets the Token field's value. -func (s *GetExportJobsInput) SetToken(v string) *GetExportJobsInput { - s.Token = &v +// SetResourceArn sets the ResourceArn field's value. +func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { + s.ResourceArn = &v return s } -type GetExportJobsOutput struct { - _ struct{} `type:"structure" payload:"ExportJobsResponse"` +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure" payload:"TagsModel"` - // Provides information about all the export jobs that are associated with an - // application or segment. An export job is a job that exports endpoint definitions - // to a file. + // Specifies the tags (keys and values) for an application, campaign, journey, + // message template, or segment. // - // ExportJobsResponse is a required field - ExportJobsResponse *ExportJobsResponse `type:"structure" required:"true"` + // TagsModel is a required field + TagsModel *TagsModel `type:"structure" required:"true"` } // String returns the string representation -func (s GetExportJobsOutput) String() string { +func (s ListTagsForResourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetExportJobsOutput) GoString() string { +func (s ListTagsForResourceOutput) GoString() string { return s.String() } -// SetExportJobsResponse sets the ExportJobsResponse field's value. -func (s *GetExportJobsOutput) SetExportJobsResponse(v *ExportJobsResponse) *GetExportJobsOutput { - s.ExportJobsResponse = v +// SetTagsModel sets the TagsModel field's value. +func (s *ListTagsForResourceOutput) SetTagsModel(v *TagsModel) *ListTagsForResourceOutput { + s.TagsModel = v return s } -type GetGcmChannelInput struct { +type ListTemplateVersionsInput struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` + + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` + + // TemplateType is a required field + TemplateType *string `location:"uri" locationName:"template-type" type:"string" required:"true"` } // String returns the string representation -func (s GetGcmChannelInput) String() string { +func (s ListTemplateVersionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetGcmChannelInput) GoString() string { +func (s ListTemplateVersionsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetGcmChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetGcmChannelInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) +func (s *ListTemplateVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTemplateVersionsInput"} + if s.TemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateName")) } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + if s.TemplateName != nil && len(*s.TemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) + } + if s.TemplateType == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateType")) + } + if s.TemplateType != nil && len(*s.TemplateType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateType", 1)) } if invalidParams.Len() > 0 { @@ -16845,339 +24497,447 @@ func (s *GetGcmChannelInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetGcmChannelInput) SetApplicationId(v string) *GetGcmChannelInput { - s.ApplicationId = &v +// SetNextToken sets the NextToken field's value. +func (s *ListTemplateVersionsInput) SetNextToken(v string) *ListTemplateVersionsInput { + s.NextToken = &v return s } -type GetGcmChannelOutput struct { - _ struct{} `type:"structure" payload:"GCMChannelResponse"` +// SetPageSize sets the PageSize field's value. +func (s *ListTemplateVersionsInput) SetPageSize(v string) *ListTemplateVersionsInput { + s.PageSize = &v + return s +} - // Provides information about the status and settings of the GCM channel for - // an application. The GCM channel enables Amazon Pinpoint to send push notifications - // through the Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging - // (GCM), service. +// SetTemplateName sets the TemplateName field's value. +func (s *ListTemplateVersionsInput) SetTemplateName(v string) *ListTemplateVersionsInput { + s.TemplateName = &v + return s +} + +// SetTemplateType sets the TemplateType field's value. +func (s *ListTemplateVersionsInput) SetTemplateType(v string) *ListTemplateVersionsInput { + s.TemplateType = &v + return s +} + +type ListTemplateVersionsOutput struct { + _ struct{} `type:"structure" payload:"TemplateVersionsResponse"` + + // Provides information about all the versions of a specific message template. // - // GCMChannelResponse is a required field - GCMChannelResponse *GCMChannelResponse `type:"structure" required:"true"` + // TemplateVersionsResponse is a required field + TemplateVersionsResponse *TemplateVersionsResponse `type:"structure" required:"true"` } // String returns the string representation -func (s GetGcmChannelOutput) String() string { +func (s ListTemplateVersionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetGcmChannelOutput) GoString() string { +func (s ListTemplateVersionsOutput) GoString() string { return s.String() } -// SetGCMChannelResponse sets the GCMChannelResponse field's value. -func (s *GetGcmChannelOutput) SetGCMChannelResponse(v *GCMChannelResponse) *GetGcmChannelOutput { - s.GCMChannelResponse = v +// SetTemplateVersionsResponse sets the TemplateVersionsResponse field's value. +func (s *ListTemplateVersionsOutput) SetTemplateVersionsResponse(v *TemplateVersionsResponse) *ListTemplateVersionsOutput { + s.TemplateVersionsResponse = v return s } -type GetImportJobInput struct { +type ListTemplatesInput struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` - // JobId is a required field - JobId *string `location:"uri" locationName:"job-id" type:"string" required:"true"` + PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + + Prefix *string `location:"querystring" locationName:"prefix" type:"string"` + + TemplateType *string `location:"querystring" locationName:"template-type" type:"string"` } // String returns the string representation -func (s GetImportJobInput) String() string { +func (s ListTemplatesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetImportJobInput) GoString() string { +func (s ListTemplatesInput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetImportJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetImportJobInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) - } - if s.JobId != nil && len(*s.JobId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobId", 1)) - } +// SetNextToken sets the NextToken field's value. +func (s *ListTemplatesInput) SetNextToken(v string) *ListTemplatesInput { + s.NextToken = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetPageSize sets the PageSize field's value. +func (s *ListTemplatesInput) SetPageSize(v string) *ListTemplatesInput { + s.PageSize = &v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetImportJobInput) SetApplicationId(v string) *GetImportJobInput { - s.ApplicationId = &v +// SetPrefix sets the Prefix field's value. +func (s *ListTemplatesInput) SetPrefix(v string) *ListTemplatesInput { + s.Prefix = &v return s } -// SetJobId sets the JobId field's value. -func (s *GetImportJobInput) SetJobId(v string) *GetImportJobInput { - s.JobId = &v +// SetTemplateType sets the TemplateType field's value. +func (s *ListTemplatesInput) SetTemplateType(v string) *ListTemplatesInput { + s.TemplateType = &v return s } -type GetImportJobOutput struct { - _ struct{} `type:"structure" payload:"ImportJobResponse"` +type ListTemplatesOutput struct { + _ struct{} `type:"structure" payload:"TemplatesResponse"` - // Provides information about the status and settings of a job that imports - // endpoint definitions from one or more files. The files can be stored in an - // Amazon Simple Storage Service (Amazon S3) bucket or uploaded directly from - // a computer by using the Amazon Pinpoint console. + // Provides information about all the message templates that are associated + // with your Amazon Pinpoint account. // - // ImportJobResponse is a required field - ImportJobResponse *ImportJobResponse `type:"structure" required:"true"` + // TemplatesResponse is a required field + TemplatesResponse *TemplatesResponse `type:"structure" required:"true"` } // String returns the string representation -func (s GetImportJobOutput) String() string { +func (s ListTemplatesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetImportJobOutput) GoString() string { +func (s ListTemplatesOutput) GoString() string { return s.String() } -// SetImportJobResponse sets the ImportJobResponse field's value. -func (s *GetImportJobOutput) SetImportJobResponse(v *ImportJobResponse) *GetImportJobOutput { - s.ImportJobResponse = v +// SetTemplatesResponse sets the TemplatesResponse field's value. +func (s *ListTemplatesOutput) SetTemplatesResponse(v *TemplatesResponse) *ListTemplatesOutput { + s.TemplatesResponse = v return s } -type GetImportJobsInput struct { +// Specifies the content and settings for a push notification that's sent to +// recipients of a campaign. +type Message struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The action to occur if a recipient taps the push notification. Valid values + // are: + // + // * OPEN_APP - Your app opens or it becomes the foreground app if it was + // sent to the background. This is the default action. + // + // * DEEP_LINK - Your app opens and displays a designated user interface + // in the app. This setting uses the deep-linking features of iOS and Android. + // + // * URL - The default mobile browser on the recipient's device opens and + // loads the web page at a URL that you specify. + Action *string `type:"string" enum:"Action"` - PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + // The body of the notification message. The maximum number of characters is + // 200. + Body *string `type:"string"` - Token *string `location:"querystring" locationName:"token" type:"string"` + // The URL of the image to display as the push-notification icon, such as the + // icon for the app. + ImageIconUrl *string `type:"string"` + + // The URL of the image to display as the small, push-notification icon, such + // as a small version of the icon for the app. + ImageSmallIconUrl *string `type:"string"` + + // The URL of an image to display in the push notification. + ImageUrl *string `type:"string"` + + // The JSON payload to use for a silent push notification. + JsonBody *string `type:"string"` + + // The URL of the image or video to display in the push notification. + MediaUrl *string `type:"string"` + + // The raw, JSON-formatted string to use as the payload for the notification + // message. If specified, this value overrides all other content for the message. + RawContent *string `type:"string"` + + // Specifies whether the notification is a silent push notification, which is + // a push notification that doesn't display on a recipient's device. Silent + // push notifications can be used for cases such as updating an app's configuration, + // displaying messages in an in-app message center, or supporting phone home + // functionality. + SilentPush *bool `type:"boolean"` + + // The number of seconds that the push-notification service should keep the + // message, if the service is unable to deliver the notification the first time. + // This value is converted to an expiration value when it's sent to a push-notification + // service. If this value is 0, the service treats the notification as if it + // expires immediately and the service doesn't store or try to deliver the notification + // again. + // + // This value doesn't apply to messages that are sent through the Amazon Device + // Messaging (ADM) service. + TimeToLive *int64 `type:"integer"` + + // The title to display above the notification message on a recipient's device. + Title *string `type:"string"` + + // The URL to open in a recipient's default mobile browser, if a recipient taps + // the push notification and the value of the Action property is URL. + Url *string `type:"string"` } // String returns the string representation -func (s GetImportJobsInput) String() string { +func (s Message) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetImportJobsInput) GoString() string { +func (s Message) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetImportJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetImportJobsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } +// SetAction sets the Action field's value. +func (s *Message) SetAction(v string) *Message { + s.Action = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetBody sets the Body field's value. +func (s *Message) SetBody(v string) *Message { + s.Body = &v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetImportJobsInput) SetApplicationId(v string) *GetImportJobsInput { - s.ApplicationId = &v +// SetImageIconUrl sets the ImageIconUrl field's value. +func (s *Message) SetImageIconUrl(v string) *Message { + s.ImageIconUrl = &v return s } -// SetPageSize sets the PageSize field's value. -func (s *GetImportJobsInput) SetPageSize(v string) *GetImportJobsInput { - s.PageSize = &v +// SetImageSmallIconUrl sets the ImageSmallIconUrl field's value. +func (s *Message) SetImageSmallIconUrl(v string) *Message { + s.ImageSmallIconUrl = &v return s } -// SetToken sets the Token field's value. -func (s *GetImportJobsInput) SetToken(v string) *GetImportJobsInput { - s.Token = &v +// SetImageUrl sets the ImageUrl field's value. +func (s *Message) SetImageUrl(v string) *Message { + s.ImageUrl = &v return s } -type GetImportJobsOutput struct { - _ struct{} `type:"structure" payload:"ImportJobsResponse"` +// SetJsonBody sets the JsonBody field's value. +func (s *Message) SetJsonBody(v string) *Message { + s.JsonBody = &v + return s +} - // Provides information about the status and settings of all the import jobs - // that are associated with an application or segment. An import job is a job - // that imports endpoint definitions from one or more files. - // - // ImportJobsResponse is a required field - ImportJobsResponse *ImportJobsResponse `type:"structure" required:"true"` +// SetMediaUrl sets the MediaUrl field's value. +func (s *Message) SetMediaUrl(v string) *Message { + s.MediaUrl = &v + return s +} + +// SetRawContent sets the RawContent field's value. +func (s *Message) SetRawContent(v string) *Message { + s.RawContent = &v + return s +} + +// SetSilentPush sets the SilentPush field's value. +func (s *Message) SetSilentPush(v bool) *Message { + s.SilentPush = &v + return s +} + +// SetTimeToLive sets the TimeToLive field's value. +func (s *Message) SetTimeToLive(v int64) *Message { + s.TimeToLive = &v + return s +} + +// SetTitle sets the Title field's value. +func (s *Message) SetTitle(v string) *Message { + s.Title = &v + return s +} + +// SetUrl sets the Url field's value. +func (s *Message) SetUrl(v string) *Message { + s.Url = &v + return s +} + +// Provides information about an API request or response. +type MessageBody struct { + _ struct{} `type:"structure"` + + // The message that's returned from the API. + Message *string `type:"string"` + + // The unique identifier for the request or response. + RequestID *string `type:"string"` } // String returns the string representation -func (s GetImportJobsOutput) String() string { +func (s MessageBody) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetImportJobsOutput) GoString() string { +func (s MessageBody) GoString() string { return s.String() } -// SetImportJobsResponse sets the ImportJobsResponse field's value. -func (s *GetImportJobsOutput) SetImportJobsResponse(v *ImportJobsResponse) *GetImportJobsOutput { - s.ImportJobsResponse = v +// SetMessage sets the Message field's value. +func (s *MessageBody) SetMessage(v string) *MessageBody { + s.Message = &v + return s +} + +// SetRequestID sets the RequestID field's value. +func (s *MessageBody) SetRequestID(v string) *MessageBody { + s.RequestID = &v return s } -type GetSegmentExportJobsInput struct { - _ struct{} `type:"structure"` +// Specifies the message configuration settings for a campaign. +type MessageConfiguration struct { + _ struct{} `type:"structure"` + + // The message that the campaign sends through the ADM (Amazon Device Messaging) + // channel. This message overrides the default message. + ADMMessage *Message `type:"structure"` + + // The message that the campaign sends through the APNs (Apple Push Notification + // service) channel. This message overrides the default message. + APNSMessage *Message `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The message that the campaign sends through the Baidu (Baidu Cloud Push) + // channel. This message overrides the default message. + BaiduMessage *Message `type:"structure"` - PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + // The default message that the campaign sends through all the channels that + // are configured for the campaign. + DefaultMessage *Message `type:"structure"` - // SegmentId is a required field - SegmentId *string `location:"uri" locationName:"segment-id" type:"string" required:"true"` + // The message that the campaign sends through the email channel. + EmailMessage *CampaignEmailMessage `type:"structure"` - Token *string `location:"querystring" locationName:"token" type:"string"` + // The message that the campaign sends through the GCM channel, which enables + // Amazon Pinpoint to send push notifications through the Firebase Cloud Messaging + // (FCM), formerly Google Cloud Messaging (GCM), service. This message overrides + // the default message. + GCMMessage *Message `type:"structure"` + + // The message that the campaign sends through the SMS channel. + SMSMessage *CampaignSmsMessage `type:"structure"` } // String returns the string representation -func (s GetSegmentExportJobsInput) String() string { +func (s MessageConfiguration) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetSegmentExportJobsInput) GoString() string { +func (s MessageConfiguration) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSegmentExportJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSegmentExportJobsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.SegmentId == nil { - invalidParams.Add(request.NewErrParamRequired("SegmentId")) - } - if s.SegmentId != nil && len(*s.SegmentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SegmentId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplicationId sets the ApplicationId field's value. -func (s *GetSegmentExportJobsInput) SetApplicationId(v string) *GetSegmentExportJobsInput { - s.ApplicationId = &v +// SetADMMessage sets the ADMMessage field's value. +func (s *MessageConfiguration) SetADMMessage(v *Message) *MessageConfiguration { + s.ADMMessage = v return s } -// SetPageSize sets the PageSize field's value. -func (s *GetSegmentExportJobsInput) SetPageSize(v string) *GetSegmentExportJobsInput { - s.PageSize = &v +// SetAPNSMessage sets the APNSMessage field's value. +func (s *MessageConfiguration) SetAPNSMessage(v *Message) *MessageConfiguration { + s.APNSMessage = v return s } -// SetSegmentId sets the SegmentId field's value. -func (s *GetSegmentExportJobsInput) SetSegmentId(v string) *GetSegmentExportJobsInput { - s.SegmentId = &v +// SetBaiduMessage sets the BaiduMessage field's value. +func (s *MessageConfiguration) SetBaiduMessage(v *Message) *MessageConfiguration { + s.BaiduMessage = v return s } -// SetToken sets the Token field's value. -func (s *GetSegmentExportJobsInput) SetToken(v string) *GetSegmentExportJobsInput { - s.Token = &v +// SetDefaultMessage sets the DefaultMessage field's value. +func (s *MessageConfiguration) SetDefaultMessage(v *Message) *MessageConfiguration { + s.DefaultMessage = v return s } -type GetSegmentExportJobsOutput struct { - _ struct{} `type:"structure" payload:"ExportJobsResponse"` - - // Provides information about all the export jobs that are associated with an - // application or segment. An export job is a job that exports endpoint definitions - // to a file. - // - // ExportJobsResponse is a required field - ExportJobsResponse *ExportJobsResponse `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetSegmentExportJobsOutput) String() string { - return awsutil.Prettify(s) +// SetEmailMessage sets the EmailMessage field's value. +func (s *MessageConfiguration) SetEmailMessage(v *CampaignEmailMessage) *MessageConfiguration { + s.EmailMessage = v + return s } -// GoString returns the string representation -func (s GetSegmentExportJobsOutput) GoString() string { - return s.String() +// SetGCMMessage sets the GCMMessage field's value. +func (s *MessageConfiguration) SetGCMMessage(v *Message) *MessageConfiguration { + s.GCMMessage = v + return s } -// SetExportJobsResponse sets the ExportJobsResponse field's value. -func (s *GetSegmentExportJobsOutput) SetExportJobsResponse(v *ExportJobsResponse) *GetSegmentExportJobsOutput { - s.ExportJobsResponse = v +// SetSMSMessage sets the SMSMessage field's value. +func (s *MessageConfiguration) SetSMSMessage(v *CampaignSmsMessage) *MessageConfiguration { + s.SMSMessage = v return s } -type GetSegmentImportJobsInput struct { +// Specifies the configuration and other settings for a message. +type MessageRequest struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // A map of key-value pairs, where each key is an address and each value is + // an AddressConfiguration object. An address can be a push notification token, + // a phone number, or an email address. You can use an AddressConfiguration + // object to tailor the message for an address by specifying settings such as + // content overrides and message variables. + Addresses map[string]*AddressConfiguration `type:"map"` - PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + // A map of custom attributes to attach to the message. For a push notification, + // this payload is added to the data.pinpoint object. For an email or text message, + // this payload is added to email/SMS delivery receipt event attributes. + Context map[string]*string `type:"map"` - // SegmentId is a required field - SegmentId *string `location:"uri" locationName:"segment-id" type:"string" required:"true"` + // A map of key-value pairs, where each key is an endpoint ID and each value + // is an EndpointSendConfiguration object. You can use an EndpointSendConfiguration + // object to tailor the message for an endpoint by specifying settings such + // as content overrides and message variables. + Endpoints map[string]*EndpointSendConfiguration `type:"map"` - Token *string `location:"querystring" locationName:"token" type:"string"` + // The settings and content for the default message and any default messages + // that you defined for specific channels. + // + // MessageConfiguration is a required field + MessageConfiguration *DirectMessageConfiguration `type:"structure" required:"true"` + + // The message template to use for the message. + TemplateConfiguration *TemplateConfiguration `type:"structure"` + + // The unique identifier for tracing the message. This identifier is visible + // to message recipients. + TraceId *string `type:"string"` } // String returns the string representation -func (s GetSegmentImportJobsInput) String() string { +func (s MessageRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetSegmentImportJobsInput) GoString() string { +func (s MessageRequest) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetSegmentImportJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSegmentImportJobsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.SegmentId == nil { - invalidParams.Add(request.NewErrParamRequired("SegmentId")) - } - if s.SegmentId != nil && len(*s.SegmentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SegmentId", 1)) +func (s *MessageRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MessageRequest"} + if s.MessageConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("MessageConfiguration")) } if invalidParams.Len() > 0 { @@ -17186,270 +24946,285 @@ func (s *GetSegmentImportJobsInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetSegmentImportJobsInput) SetApplicationId(v string) *GetSegmentImportJobsInput { - s.ApplicationId = &v +// SetAddresses sets the Addresses field's value. +func (s *MessageRequest) SetAddresses(v map[string]*AddressConfiguration) *MessageRequest { + s.Addresses = v return s } -// SetPageSize sets the PageSize field's value. -func (s *GetSegmentImportJobsInput) SetPageSize(v string) *GetSegmentImportJobsInput { - s.PageSize = &v +// SetContext sets the Context field's value. +func (s *MessageRequest) SetContext(v map[string]*string) *MessageRequest { + s.Context = v return s } -// SetSegmentId sets the SegmentId field's value. -func (s *GetSegmentImportJobsInput) SetSegmentId(v string) *GetSegmentImportJobsInput { - s.SegmentId = &v +// SetEndpoints sets the Endpoints field's value. +func (s *MessageRequest) SetEndpoints(v map[string]*EndpointSendConfiguration) *MessageRequest { + s.Endpoints = v return s } -// SetToken sets the Token field's value. -func (s *GetSegmentImportJobsInput) SetToken(v string) *GetSegmentImportJobsInput { - s.Token = &v +// SetMessageConfiguration sets the MessageConfiguration field's value. +func (s *MessageRequest) SetMessageConfiguration(v *DirectMessageConfiguration) *MessageRequest { + s.MessageConfiguration = v return s } -type GetSegmentImportJobsOutput struct { - _ struct{} `type:"structure" payload:"ImportJobsResponse"` - - // Provides information about the status and settings of all the import jobs - // that are associated with an application or segment. An import job is a job - // that imports endpoint definitions from one or more files. - // - // ImportJobsResponse is a required field - ImportJobsResponse *ImportJobsResponse `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetSegmentImportJobsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSegmentImportJobsOutput) GoString() string { - return s.String() +// SetTemplateConfiguration sets the TemplateConfiguration field's value. +func (s *MessageRequest) SetTemplateConfiguration(v *TemplateConfiguration) *MessageRequest { + s.TemplateConfiguration = v + return s } -// SetImportJobsResponse sets the ImportJobsResponse field's value. -func (s *GetSegmentImportJobsOutput) SetImportJobsResponse(v *ImportJobsResponse) *GetSegmentImportJobsOutput { - s.ImportJobsResponse = v +// SetTraceId sets the TraceId field's value. +func (s *MessageRequest) SetTraceId(v string) *MessageRequest { + s.TraceId = &v return s } -type GetSegmentInput struct { +// Provides information about the results of a request to send a message to +// an endpoint address. +type MessageResponse struct { _ struct{} `type:"structure"` + // The unique identifier for the application that was used to send the message. + // // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + ApplicationId *string `type:"string" required:"true"` - // SegmentId is a required field - SegmentId *string `location:"uri" locationName:"segment-id" type:"string" required:"true"` -} + // A map that contains a multipart response for each address that the message + // was sent to. In the map, the endpoint ID is the key and the result is the + // value. + EndpointResult map[string]*EndpointMessageResult `type:"map"` -// String returns the string representation -func (s GetSegmentInput) String() string { - return awsutil.Prettify(s) -} + // The identifier for the original request that the message was delivered for. + RequestId *string `type:"string"` -// GoString returns the string representation -func (s GetSegmentInput) GoString() string { - return s.String() + // A map that contains a multipart response for each address (email address, + // phone number, or push notification token) that the message was sent to. In + // the map, the address is the key and the result is the value. + Result map[string]*MessageResult `type:"map"` } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSegmentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSegmentInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.SegmentId == nil { - invalidParams.Add(request.NewErrParamRequired("SegmentId")) - } - if s.SegmentId != nil && len(*s.SegmentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SegmentId", 1)) - } +// String returns the string representation +func (s MessageResponse) String() string { + return awsutil.Prettify(s) +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// GoString returns the string representation +func (s MessageResponse) GoString() string { + return s.String() } // SetApplicationId sets the ApplicationId field's value. -func (s *GetSegmentInput) SetApplicationId(v string) *GetSegmentInput { +func (s *MessageResponse) SetApplicationId(v string) *MessageResponse { s.ApplicationId = &v return s } -// SetSegmentId sets the SegmentId field's value. -func (s *GetSegmentInput) SetSegmentId(v string) *GetSegmentInput { - s.SegmentId = &v +// SetEndpointResult sets the EndpointResult field's value. +func (s *MessageResponse) SetEndpointResult(v map[string]*EndpointMessageResult) *MessageResponse { + s.EndpointResult = v return s } -type GetSegmentOutput struct { - _ struct{} `type:"structure" payload:"SegmentResponse"` - - // Provides information about the configuration, dimension, and other settings - // for a segment. - // - // SegmentResponse is a required field - SegmentResponse *SegmentResponse `type:"structure" required:"true"` -} - -// String returns the string representation -func (s GetSegmentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetSegmentOutput) GoString() string { - return s.String() +// SetRequestId sets the RequestId field's value. +func (s *MessageResponse) SetRequestId(v string) *MessageResponse { + s.RequestId = &v + return s } -// SetSegmentResponse sets the SegmentResponse field's value. -func (s *GetSegmentOutput) SetSegmentResponse(v *SegmentResponse) *GetSegmentOutput { - s.SegmentResponse = v +// SetResult sets the Result field's value. +func (s *MessageResponse) SetResult(v map[string]*MessageResult) *MessageResponse { + s.Result = v return s } -type GetSegmentVersionInput struct { +// Provides information about the results of sending a message directly to an +// endpoint address. +type MessageResult struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The delivery status of the message. Possible values are: + // + // * DUPLICATE - The endpoint address is a duplicate of another endpoint + // address. Amazon Pinpoint won't attempt to send the message again. + // + // * OPT_OUT - The user who's associated with the endpoint address has opted + // out of receiving messages from you. Amazon Pinpoint won't attempt to send + // the message again. + // + // * PERMANENT_FAILURE - An error occurred when delivering the message to + // the endpoint address. Amazon Pinpoint won't attempt to send the message + // again. + // + // * SUCCESSFUL - The message was successfully delivered to the endpoint + // address. + // + // * TEMPORARY_FAILURE - A temporary error occurred. Amazon Pinpoint will + // attempt to deliver the message again later. + // + // * THROTTLED - Amazon Pinpoint throttled the operation to send the message + // to the endpoint address. + // + // * TIMEOUT - The message couldn't be sent within the timeout period. + // + // * UNKNOWN_FAILURE - An unknown error occurred. + // + // DeliveryStatus is a required field + DeliveryStatus *string `type:"string" required:"true" enum:"DeliveryStatus"` - // SegmentId is a required field - SegmentId *string `location:"uri" locationName:"segment-id" type:"string" required:"true"` + // The unique identifier for the message that was sent. + MessageId *string `type:"string"` - // Version is a required field - Version *string `location:"uri" locationName:"version" type:"string" required:"true"` + // The downstream service status code for delivering the message. + // + // StatusCode is a required field + StatusCode *int64 `type:"integer" required:"true"` + + // The status message for delivering the message. + StatusMessage *string `type:"string"` + + // For push notifications that are sent through the GCM channel, specifies whether + // the endpoint's device registration token was updated as part of delivering + // the message. + UpdatedToken *string `type:"string"` } // String returns the string representation -func (s GetSegmentVersionInput) String() string { +func (s MessageResult) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetSegmentVersionInput) GoString() string { +func (s MessageResult) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSegmentVersionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSegmentVersionInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.SegmentId == nil { - invalidParams.Add(request.NewErrParamRequired("SegmentId")) - } - if s.SegmentId != nil && len(*s.SegmentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SegmentId", 1)) - } - if s.Version == nil { - invalidParams.Add(request.NewErrParamRequired("Version")) - } - if s.Version != nil && len(*s.Version) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Version", 1)) - } +// SetDeliveryStatus sets the DeliveryStatus field's value. +func (s *MessageResult) SetDeliveryStatus(v string) *MessageResult { + s.DeliveryStatus = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetMessageId sets the MessageId field's value. +func (s *MessageResult) SetMessageId(v string) *MessageResult { + s.MessageId = &v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetSegmentVersionInput) SetApplicationId(v string) *GetSegmentVersionInput { - s.ApplicationId = &v +// SetStatusCode sets the StatusCode field's value. +func (s *MessageResult) SetStatusCode(v int64) *MessageResult { + s.StatusCode = &v return s } -// SetSegmentId sets the SegmentId field's value. -func (s *GetSegmentVersionInput) SetSegmentId(v string) *GetSegmentVersionInput { - s.SegmentId = &v +// SetStatusMessage sets the StatusMessage field's value. +func (s *MessageResult) SetStatusMessage(v string) *MessageResult { + s.StatusMessage = &v return s } -// SetVersion sets the Version field's value. -func (s *GetSegmentVersionInput) SetVersion(v string) *GetSegmentVersionInput { - s.Version = &v +// SetUpdatedToken sets the UpdatedToken field's value. +func (s *MessageResult) SetUpdatedToken(v string) *MessageResult { + s.UpdatedToken = &v return s } -type GetSegmentVersionOutput struct { - _ struct{} `type:"structure" payload:"SegmentResponse"` +// Provides information about an API request or response. +type MethodNotAllowedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Provides information about the configuration, dimension, and other settings - // for a segment. - // - // SegmentResponse is a required field - SegmentResponse *SegmentResponse `type:"structure" required:"true"` + Message_ *string `locationName:"Message" type:"string"` + + RequestID_ *string `locationName:"RequestID" type:"string"` } // String returns the string representation -func (s GetSegmentVersionOutput) String() string { +func (s MethodNotAllowedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetSegmentVersionOutput) GoString() string { +func (s MethodNotAllowedException) GoString() string { return s.String() } -// SetSegmentResponse sets the SegmentResponse field's value. -func (s *GetSegmentVersionOutput) SetSegmentResponse(v *SegmentResponse) *GetSegmentVersionOutput { - s.SegmentResponse = v - return s +func newErrorMethodNotAllowedException(v protocol.ResponseMetadata) error { + return &MethodNotAllowedException{ + respMetadata: v, + } } -type GetSegmentVersionsInput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s MethodNotAllowedException) Code() string { + return "MethodNotAllowedException" +} - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +// Message returns the exception's message. +func (s MethodNotAllowedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - PageSize *string `location:"querystring" locationName:"page-size" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MethodNotAllowedException) OrigErr() error { + return nil +} - // SegmentId is a required field - SegmentId *string `location:"uri" locationName:"segment-id" type:"string" required:"true"` +func (s MethodNotAllowedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} - Token *string `location:"querystring" locationName:"token" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s MethodNotAllowedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MethodNotAllowedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Specifies metric-based criteria for including or excluding endpoints from +// a segment. These criteria derive from custom metrics that you define for +// endpoints. +type MetricDimension struct { + _ struct{} `type:"structure"` + + // The operator to use when comparing metric values. Valid values are: GREATER_THAN, + // LESS_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN_OR_EQUAL, and EQUAL. + // + // ComparisonOperator is a required field + ComparisonOperator *string `type:"string" required:"true"` + + // The value to compare. + // + // Value is a required field + Value *float64 `type:"double" required:"true"` } // String returns the string representation -func (s GetSegmentVersionsInput) String() string { +func (s MetricDimension) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetSegmentVersionsInput) GoString() string { +func (s MetricDimension) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetSegmentVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSegmentVersionsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.SegmentId == nil { - invalidParams.Add(request.NewErrParamRequired("SegmentId")) +func (s *MetricDimension) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MetricDimension"} + if s.ComparisonOperator == nil { + invalidParams.Add(request.NewErrParamRequired("ComparisonOperator")) } - if s.SegmentId != nil && len(*s.SegmentId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SegmentId", 1)) + if s.Value == nil { + invalidParams.Add(request.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { @@ -17458,84 +25233,108 @@ func (s *GetSegmentVersionsInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetSegmentVersionsInput) SetApplicationId(v string) *GetSegmentVersionsInput { - s.ApplicationId = &v - return s -} - -// SetPageSize sets the PageSize field's value. -func (s *GetSegmentVersionsInput) SetPageSize(v string) *GetSegmentVersionsInput { - s.PageSize = &v - return s -} - -// SetSegmentId sets the SegmentId field's value. -func (s *GetSegmentVersionsInput) SetSegmentId(v string) *GetSegmentVersionsInput { - s.SegmentId = &v +// SetComparisonOperator sets the ComparisonOperator field's value. +func (s *MetricDimension) SetComparisonOperator(v string) *MetricDimension { + s.ComparisonOperator = &v return s } -// SetToken sets the Token field's value. -func (s *GetSegmentVersionsInput) SetToken(v string) *GetSegmentVersionsInput { - s.Token = &v +// SetValue sets the Value field's value. +func (s *MetricDimension) SetValue(v float64) *MetricDimension { + s.Value = &v return s } -type GetSegmentVersionsOutput struct { - _ struct{} `type:"structure" payload:"SegmentsResponse"` - - // Provides information about all the segments that are associated with an application. - // - // SegmentsResponse is a required field - SegmentsResponse *SegmentsResponse `type:"structure" required:"true"` +// Specifies a condition to evaluate for an activity path in a journey. +type MultiConditionalBranch struct { + _ struct{} `type:"structure"` + + // The condition to evaluate for the activity path. + Condition *SimpleCondition `type:"structure"` + + // The unique identifier for the next activity to perform, after completing + // the activity for the path. + NextActivity *string `type:"string"` } // String returns the string representation -func (s GetSegmentVersionsOutput) String() string { +func (s MultiConditionalBranch) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetSegmentVersionsOutput) GoString() string { +func (s MultiConditionalBranch) GoString() string { return s.String() } -// SetSegmentsResponse sets the SegmentsResponse field's value. -func (s *GetSegmentVersionsOutput) SetSegmentsResponse(v *SegmentsResponse) *GetSegmentVersionsOutput { - s.SegmentsResponse = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *MultiConditionalBranch) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MultiConditionalBranch"} + if s.Condition != nil { + if err := s.Condition.Validate(); err != nil { + invalidParams.AddNested("Condition", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCondition sets the Condition field's value. +func (s *MultiConditionalBranch) SetCondition(v *SimpleCondition) *MultiConditionalBranch { + s.Condition = v return s } -type GetSegmentsInput struct { +// SetNextActivity sets the NextActivity field's value. +func (s *MultiConditionalBranch) SetNextActivity(v string) *MultiConditionalBranch { + s.NextActivity = &v + return s +} + +// Specifies the settings for a multivariate split activity in a journey. This +// type of activity sends participants down one of as many as five paths (including +// a default Else path) in a journey, based on conditions that you specify. +type MultiConditionalSplitActivity struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The paths for the activity, including the conditions for entering each path + // and the activity to perform for each path. + Branches []*MultiConditionalBranch `type:"list"` - PageSize *string `location:"querystring" locationName:"page-size" type:"string"` + // The unique identifier for the activity to perform for participants who don't + // meet any of the conditions specified for other paths in the activity. + DefaultActivity *string `type:"string"` - Token *string `location:"querystring" locationName:"token" type:"string"` + // The amount of time to wait or the date and time when Amazon Pinpoint determines + // whether the conditions are met. + EvaluationWaitTime *WaitTime `type:"structure"` } // String returns the string representation -func (s GetSegmentsInput) String() string { +func (s MultiConditionalSplitActivity) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetSegmentsInput) GoString() string { +func (s MultiConditionalSplitActivity) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetSegmentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSegmentsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) +func (s *MultiConditionalSplitActivity) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MultiConditionalSplitActivity"} + if s.Branches != nil { + for i, v := range s.Branches { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Branches", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -17544,219 +25343,293 @@ func (s *GetSegmentsInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetSegmentsInput) SetApplicationId(v string) *GetSegmentsInput { - s.ApplicationId = &v +// SetBranches sets the Branches field's value. +func (s *MultiConditionalSplitActivity) SetBranches(v []*MultiConditionalBranch) *MultiConditionalSplitActivity { + s.Branches = v return s } -// SetPageSize sets the PageSize field's value. -func (s *GetSegmentsInput) SetPageSize(v string) *GetSegmentsInput { - s.PageSize = &v +// SetDefaultActivity sets the DefaultActivity field's value. +func (s *MultiConditionalSplitActivity) SetDefaultActivity(v string) *MultiConditionalSplitActivity { + s.DefaultActivity = &v return s } -// SetToken sets the Token field's value. -func (s *GetSegmentsInput) SetToken(v string) *GetSegmentsInput { - s.Token = &v +// SetEvaluationWaitTime sets the EvaluationWaitTime field's value. +func (s *MultiConditionalSplitActivity) SetEvaluationWaitTime(v *WaitTime) *MultiConditionalSplitActivity { + s.EvaluationWaitTime = v return s } -type GetSegmentsOutput struct { - _ struct{} `type:"structure" payload:"SegmentsResponse"` +// Provides information about an API request or response. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Provides information about all the segments that are associated with an application. - // - // SegmentsResponse is a required field - SegmentsResponse *SegmentsResponse `type:"structure" required:"true"` + Message_ *string `locationName:"Message" type:"string"` + + RequestID_ *string `locationName:"RequestID" type:"string"` } // String returns the string representation -func (s GetSegmentsOutput) String() string { +func (s NotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetSegmentsOutput) GoString() string { +func (s NotFoundException) GoString() string { return s.String() } -// SetSegmentsResponse sets the SegmentsResponse field's value. -func (s *GetSegmentsOutput) SetSegmentsResponse(v *SegmentsResponse) *GetSegmentsOutput { - s.SegmentsResponse = v - return s +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } } -type GetSmsChannelInput struct { +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Specifies a phone number to validate and retrieve information about. +type NumberValidateRequest struct { _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The two-character code, in ISO 3166-1 alpha-2 format, for the country or + // region where the phone number was originally registered. + IsoCountryCode *string `type:"string"` + + // The phone number to retrieve information about. The phone number that you + // provide should include a valid numeric country code. Otherwise, the operation + // might result in an error. + PhoneNumber *string `type:"string"` } // String returns the string representation -func (s GetSmsChannelInput) String() string { +func (s NumberValidateRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetSmsChannelInput) GoString() string { +func (s NumberValidateRequest) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetSmsChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSmsChannelInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetIsoCountryCode sets the IsoCountryCode field's value. +func (s *NumberValidateRequest) SetIsoCountryCode(v string) *NumberValidateRequest { + s.IsoCountryCode = &v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetSmsChannelInput) SetApplicationId(v string) *GetSmsChannelInput { - s.ApplicationId = &v +// SetPhoneNumber sets the PhoneNumber field's value. +func (s *NumberValidateRequest) SetPhoneNumber(v string) *NumberValidateRequest { + s.PhoneNumber = &v return s } -type GetSmsChannelOutput struct { - _ struct{} `type:"structure" payload:"SMSChannelResponse"` +// Provides information about a phone number. +type NumberValidateResponse struct { + _ struct{} `type:"structure"` - // Provides information about the status and settings of the SMS channel for - // an application. - // - // SMSChannelResponse is a required field - SMSChannelResponse *SMSChannelResponse `type:"structure" required:"true"` + // The carrier or service provider that the phone number is currently registered + // with. In some countries and regions, this value may be the carrier or service + // provider that the phone number was originally registered with. + Carrier *string `type:"string"` + + // The name of the city where the phone number was originally registered. + City *string `type:"string"` + + // The cleansed phone number, in E.164 format, for the location where the phone + // number was originally registered. + CleansedPhoneNumberE164 *string `type:"string"` + + // The cleansed phone number, in the format for the location where the phone + // number was originally registered. + CleansedPhoneNumberNational *string `type:"string"` + + // The name of the country or region where the phone number was originally registered. + Country *string `type:"string"` + + // The two-character code, in ISO 3166-1 alpha-2 format, for the country or + // region where the phone number was originally registered. + CountryCodeIso2 *string `type:"string"` + + // The numeric code for the country or region where the phone number was originally + // registered. + CountryCodeNumeric *string `type:"string"` + + // The name of the county where the phone number was originally registered. + County *string `type:"string"` + + // The two-character code, in ISO 3166-1 alpha-2 format, that was sent in the + // request body. + OriginalCountryCodeIso2 *string `type:"string"` + + // The phone number that was sent in the request body. + OriginalPhoneNumber *string `type:"string"` + + // The description of the phone type. Valid values are: MOBILE, LANDLINE, VOIP, + // INVALID, PREPAID, and OTHER. + PhoneType *string `type:"string"` + + // The phone type, represented by an integer. Valid values are: 0 (mobile), + // 1 (landline), 2 (VoIP), 3 (invalid), 4 (other), and 5 (prepaid). + PhoneTypeCode *int64 `type:"integer"` + + // The time zone for the location where the phone number was originally registered. + Timezone *string `type:"string"` + + // The postal or ZIP code for the location where the phone number was originally + // registered. + ZipCode *string `type:"string"` } // String returns the string representation -func (s GetSmsChannelOutput) String() string { +func (s NumberValidateResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetSmsChannelOutput) GoString() string { +func (s NumberValidateResponse) GoString() string { return s.String() } -// SetSMSChannelResponse sets the SMSChannelResponse field's value. -func (s *GetSmsChannelOutput) SetSMSChannelResponse(v *SMSChannelResponse) *GetSmsChannelOutput { - s.SMSChannelResponse = v +// SetCarrier sets the Carrier field's value. +func (s *NumberValidateResponse) SetCarrier(v string) *NumberValidateResponse { + s.Carrier = &v return s } -type GetUserEndpointsInput struct { - _ struct{} `type:"structure"` +// SetCity sets the City field's value. +func (s *NumberValidateResponse) SetCity(v string) *NumberValidateResponse { + s.City = &v + return s +} - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +// SetCleansedPhoneNumberE164 sets the CleansedPhoneNumberE164 field's value. +func (s *NumberValidateResponse) SetCleansedPhoneNumberE164(v string) *NumberValidateResponse { + s.CleansedPhoneNumberE164 = &v + return s +} - // UserId is a required field - UserId *string `location:"uri" locationName:"user-id" type:"string" required:"true"` +// SetCleansedPhoneNumberNational sets the CleansedPhoneNumberNational field's value. +func (s *NumberValidateResponse) SetCleansedPhoneNumberNational(v string) *NumberValidateResponse { + s.CleansedPhoneNumberNational = &v + return s } -// String returns the string representation -func (s GetUserEndpointsInput) String() string { - return awsutil.Prettify(s) +// SetCountry sets the Country field's value. +func (s *NumberValidateResponse) SetCountry(v string) *NumberValidateResponse { + s.Country = &v + return s } -// GoString returns the string representation -func (s GetUserEndpointsInput) GoString() string { - return s.String() +// SetCountryCodeIso2 sets the CountryCodeIso2 field's value. +func (s *NumberValidateResponse) SetCountryCodeIso2(v string) *NumberValidateResponse { + s.CountryCodeIso2 = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetUserEndpointsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetUserEndpointsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.UserId == nil { - invalidParams.Add(request.NewErrParamRequired("UserId")) - } - if s.UserId != nil && len(*s.UserId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserId", 1)) - } +// SetCountryCodeNumeric sets the CountryCodeNumeric field's value. +func (s *NumberValidateResponse) SetCountryCodeNumeric(v string) *NumberValidateResponse { + s.CountryCodeNumeric = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCounty sets the County field's value. +func (s *NumberValidateResponse) SetCounty(v string) *NumberValidateResponse { + s.County = &v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetUserEndpointsInput) SetApplicationId(v string) *GetUserEndpointsInput { - s.ApplicationId = &v +// SetOriginalCountryCodeIso2 sets the OriginalCountryCodeIso2 field's value. +func (s *NumberValidateResponse) SetOriginalCountryCodeIso2(v string) *NumberValidateResponse { + s.OriginalCountryCodeIso2 = &v return s } -// SetUserId sets the UserId field's value. -func (s *GetUserEndpointsInput) SetUserId(v string) *GetUserEndpointsInput { - s.UserId = &v +// SetOriginalPhoneNumber sets the OriginalPhoneNumber field's value. +func (s *NumberValidateResponse) SetOriginalPhoneNumber(v string) *NumberValidateResponse { + s.OriginalPhoneNumber = &v return s } -type GetUserEndpointsOutput struct { - _ struct{} `type:"structure" payload:"EndpointsResponse"` - - // Provides information about all the endpoints that are associated with a user - // ID. - // - // EndpointsResponse is a required field - EndpointsResponse *EndpointsResponse `type:"structure" required:"true"` +// SetPhoneType sets the PhoneType field's value. +func (s *NumberValidateResponse) SetPhoneType(v string) *NumberValidateResponse { + s.PhoneType = &v + return s } -// String returns the string representation -func (s GetUserEndpointsOutput) String() string { - return awsutil.Prettify(s) +// SetPhoneTypeCode sets the PhoneTypeCode field's value. +func (s *NumberValidateResponse) SetPhoneTypeCode(v int64) *NumberValidateResponse { + s.PhoneTypeCode = &v + return s } -// GoString returns the string representation -func (s GetUserEndpointsOutput) GoString() string { - return s.String() +// SetTimezone sets the Timezone field's value. +func (s *NumberValidateResponse) SetTimezone(v string) *NumberValidateResponse { + s.Timezone = &v + return s } -// SetEndpointsResponse sets the EndpointsResponse field's value. -func (s *GetUserEndpointsOutput) SetEndpointsResponse(v *EndpointsResponse) *GetUserEndpointsOutput { - s.EndpointsResponse = v +// SetZipCode sets the ZipCode field's value. +func (s *NumberValidateResponse) SetZipCode(v string) *NumberValidateResponse { + s.ZipCode = &v return s } -type GetVoiceChannelInput struct { - _ struct{} `type:"structure"` +type PhoneNumberValidateInput struct { + _ struct{} `type:"structure" payload:"NumberValidateRequest"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // Specifies a phone number to validate and retrieve information about. + // + // NumberValidateRequest is a required field + NumberValidateRequest *NumberValidateRequest `type:"structure" required:"true"` } // String returns the string representation -func (s GetVoiceChannelInput) String() string { +func (s PhoneNumberValidateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetVoiceChannelInput) GoString() string { +func (s PhoneNumberValidateInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetVoiceChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetVoiceChannelInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) +func (s *PhoneNumberValidateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PhoneNumberValidateInput"} + if s.NumberValidateRequest == nil { + invalidParams.Add(request.NewErrParamRequired("NumberValidateRequest")) } if invalidParams.Len() > 0 { @@ -17765,550 +25638,564 @@ func (s *GetVoiceChannelInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *GetVoiceChannelInput) SetApplicationId(v string) *GetVoiceChannelInput { - s.ApplicationId = &v +// SetNumberValidateRequest sets the NumberValidateRequest field's value. +func (s *PhoneNumberValidateInput) SetNumberValidateRequest(v *NumberValidateRequest) *PhoneNumberValidateInput { + s.NumberValidateRequest = v return s } -type GetVoiceChannelOutput struct { - _ struct{} `type:"structure" payload:"VoiceChannelResponse"` +type PhoneNumberValidateOutput struct { + _ struct{} `type:"structure" payload:"NumberValidateResponse"` - // Provides information about the status and settings of the voice channel for - // an application. + // Provides information about a phone number. // - // VoiceChannelResponse is a required field - VoiceChannelResponse *VoiceChannelResponse `type:"structure" required:"true"` + // NumberValidateResponse is a required field + NumberValidateResponse *NumberValidateResponse `type:"structure" required:"true"` } // String returns the string representation -func (s GetVoiceChannelOutput) String() string { +func (s PhoneNumberValidateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetVoiceChannelOutput) GoString() string { +func (s PhoneNumberValidateOutput) GoString() string { return s.String() } -// SetVoiceChannelResponse sets the VoiceChannelResponse field's value. -func (s *GetVoiceChannelOutput) SetVoiceChannelResponse(v *VoiceChannelResponse) *GetVoiceChannelOutput { - s.VoiceChannelResponse = v +// SetNumberValidateResponse sets the NumberValidateResponse field's value. +func (s *PhoneNumberValidateOutput) SetNumberValidateResponse(v *NumberValidateResponse) *PhoneNumberValidateOutput { + s.NumberValidateResponse = v return s } -// Specifies the settings for a job that imports endpoint definitions from an -// Amazon Simple Storage Service (Amazon S3) bucket. -type ImportJobRequest struct { +// Specifies the properties and attributes of an endpoint that's associated +// with an event. +type PublicEndpoint struct { _ struct{} `type:"structure"` - // Specifies whether to create a segment that contains the endpoints, when the - // endpoint definitions are imported. - DefineSegment *bool `type:"boolean"` + // The unique identifier for the recipient, such as a device token, email address, + // or mobile phone number. + Address *string `type:"string"` - // (Deprecated) Your AWS account ID, which you assigned to an external ID key - // in an IAM trust policy. Amazon Pinpoint previously used this value to assume - // an IAM role when importing endpoint definitions, but we removed this requirement. - // We don't recommend use of external IDs for IAM roles that are assumed by - // Amazon Pinpoint. - ExternalId *string `type:"string"` + // One or more custom attributes that describe the endpoint by associating a + // name with an array of values. You can use these attributes as filter criteria + // when you create segments. + Attributes map[string][]*string `type:"map"` - // The format of the files that contain the endpoint definitions to import. - // Valid values are: CSV, for comma-separated values format; and, JSON, for - // newline-delimited JSON format. If the Amazon S3 location stores multiple - // files that use different formats, Amazon Pinpoint imports data only from - // the files that use the specified format. - // - // Format is a required field - Format *string `type:"string" required:"true" enum:"Format"` + // The channel that's used when sending messages or push notifications to the + // endpoint. + ChannelType *string `type:"string" enum:"ChannelType"` - // Specifies whether to register the endpoints with Amazon Pinpoint, when the - // endpoint definitions are imported. - RegisterEndpoints *bool `type:"boolean"` + // The demographic information for the endpoint, such as the time zone and platform. + Demographic *EndpointDemographic `type:"structure"` - // The Amazon Resource Name (ARN) of the AWS Identity and Access Management - // (IAM) role that authorizes Amazon Pinpoint to access the Amazon S3 location - // to import endpoint definitions from. - // - // RoleArn is a required field - RoleArn *string `type:"string" required:"true"` + // The date and time, in ISO 8601 format, when the endpoint was last updated. + EffectiveDate *string `type:"string"` - // The URL of the Amazon Simple Storage Service (Amazon S3) bucket that contains - // the endpoint definitions to import. This location can be a folder or a single - // file. If the location is a folder, Amazon Pinpoint imports endpoint definitions - // from the files in this location, including any subfolders that the folder - // contains. - // - // The URL should be in the following format: s3://bucket-name/folder-name/file-name. - // The location can end with the key for an individual object or a prefix that - // qualifies multiple objects. + // Specifies whether to send messages or push notifications to the endpoint. + // Valid values are: ACTIVE, messages are sent to the endpoint; and, INACTIVE, + // messages aren’t sent to the endpoint. // - // S3Url is a required field - S3Url *string `type:"string" required:"true"` + // Amazon Pinpoint automatically sets this value to ACTIVE when you create an + // endpoint or update an existing endpoint. Amazon Pinpoint automatically sets + // this value to INACTIVE if you update another endpoint that has the same address + // specified by the Address property. + EndpointStatus *string `type:"string"` - // The identifier for the segment to update or add the imported endpoint definitions - // to, if the import job is meant to update an existing segment. - SegmentId *string `type:"string"` + // The geographic information for the endpoint. + Location *EndpointLocation `type:"structure"` - // The custom name for the segment that's created by the import job, if the - // value of the DefineSegment property is true. - SegmentName *string `type:"string"` + // One or more custom metrics that your app reports to Amazon Pinpoint for the + // endpoint. + Metrics map[string]*float64 `type:"map"` + + // Specifies whether the user who's associated with the endpoint has opted out + // of receiving messages and push notifications from you. Possible values are: + // ALL, the user has opted out and doesn't want to receive any messages or push + // notifications; and, NONE, the user hasn't opted out and wants to receive + // all messages and push notifications. + OptOut *string `type:"string"` + + // A unique identifier that's generated each time the endpoint is updated. + RequestId *string `type:"string"` + + // One or more custom user attributes that your app reports to Amazon Pinpoint + // for the user who's associated with the endpoint. + User *EndpointUser `type:"structure"` } // String returns the string representation -func (s ImportJobRequest) String() string { +func (s PublicEndpoint) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ImportJobRequest) GoString() string { +func (s PublicEndpoint) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportJobRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportJobRequest"} - if s.Format == nil { - invalidParams.Add(request.NewErrParamRequired("Format")) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.S3Url == nil { - invalidParams.Add(request.NewErrParamRequired("S3Url")) - } +// SetAddress sets the Address field's value. +func (s *PublicEndpoint) SetAddress(v string) *PublicEndpoint { + s.Address = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetAttributes sets the Attributes field's value. +func (s *PublicEndpoint) SetAttributes(v map[string][]*string) *PublicEndpoint { + s.Attributes = v + return s } -// SetDefineSegment sets the DefineSegment field's value. -func (s *ImportJobRequest) SetDefineSegment(v bool) *ImportJobRequest { - s.DefineSegment = &v +// SetChannelType sets the ChannelType field's value. +func (s *PublicEndpoint) SetChannelType(v string) *PublicEndpoint { + s.ChannelType = &v return s } -// SetExternalId sets the ExternalId field's value. -func (s *ImportJobRequest) SetExternalId(v string) *ImportJobRequest { - s.ExternalId = &v +// SetDemographic sets the Demographic field's value. +func (s *PublicEndpoint) SetDemographic(v *EndpointDemographic) *PublicEndpoint { + s.Demographic = v return s } -// SetFormat sets the Format field's value. -func (s *ImportJobRequest) SetFormat(v string) *ImportJobRequest { - s.Format = &v +// SetEffectiveDate sets the EffectiveDate field's value. +func (s *PublicEndpoint) SetEffectiveDate(v string) *PublicEndpoint { + s.EffectiveDate = &v return s } -// SetRegisterEndpoints sets the RegisterEndpoints field's value. -func (s *ImportJobRequest) SetRegisterEndpoints(v bool) *ImportJobRequest { - s.RegisterEndpoints = &v +// SetEndpointStatus sets the EndpointStatus field's value. +func (s *PublicEndpoint) SetEndpointStatus(v string) *PublicEndpoint { + s.EndpointStatus = &v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *ImportJobRequest) SetRoleArn(v string) *ImportJobRequest { - s.RoleArn = &v +// SetLocation sets the Location field's value. +func (s *PublicEndpoint) SetLocation(v *EndpointLocation) *PublicEndpoint { + s.Location = v return s } -// SetS3Url sets the S3Url field's value. -func (s *ImportJobRequest) SetS3Url(v string) *ImportJobRequest { - s.S3Url = &v +// SetMetrics sets the Metrics field's value. +func (s *PublicEndpoint) SetMetrics(v map[string]*float64) *PublicEndpoint { + s.Metrics = v return s } -// SetSegmentId sets the SegmentId field's value. -func (s *ImportJobRequest) SetSegmentId(v string) *ImportJobRequest { - s.SegmentId = &v +// SetOptOut sets the OptOut field's value. +func (s *PublicEndpoint) SetOptOut(v string) *PublicEndpoint { + s.OptOut = &v return s } -// SetSegmentName sets the SegmentName field's value. -func (s *ImportJobRequest) SetSegmentName(v string) *ImportJobRequest { - s.SegmentName = &v +// SetRequestId sets the RequestId field's value. +func (s *PublicEndpoint) SetRequestId(v string) *PublicEndpoint { + s.RequestId = &v + return s +} + +// SetUser sets the User field's value. +func (s *PublicEndpoint) SetUser(v *EndpointUser) *PublicEndpoint { + s.User = v return s } -// Provides information about the resource settings for a job that imports endpoint -// definitions from one or more files. The files can be stored in an Amazon -// Simple Storage Service (Amazon S3) bucket or uploaded directly from a computer -// by using the Amazon Pinpoint console. -type ImportJobResource struct { +// Specifies the content and settings for a message template that can be used +// in messages that are sent through a push notification channel. +type PushNotificationTemplateRequest struct { _ struct{} `type:"structure"` - // Specifies whether the import job creates a segment that contains the endpoints, - // when the endpoint definitions are imported. - DefineSegment *bool `type:"boolean"` - - // (Deprecated) Your AWS account ID, which you assigned to an external ID key - // in an IAM trust policy. Amazon Pinpoint previously used this value to assume - // an IAM role when importing endpoint definitions, but we removed this requirement. - // We don't recommend use of external IDs for IAM roles that are assumed by - // Amazon Pinpoint. - ExternalId *string `type:"string"` - - // The format of the files that contain the endpoint definitions to import. - // Valid values are: CSV, for comma-separated values format; and, JSON, for - // newline-delimited JSON format. - // - // If the files are stored in an Amazon S3 location and that location contains - // multiple files that use different formats, Amazon Pinpoint imports data only - // from the files that use the specified format. - // - // Format is a required field - Format *string `type:"string" required:"true" enum:"Format"` - - // Specifies whether the import job registers the endpoints with Amazon Pinpoint, - // when the endpoint definitions are imported. - RegisterEndpoints *bool `type:"boolean"` - - // The Amazon Resource Name (ARN) of the AWS Identity and Access Management - // (IAM) role that authorizes Amazon Pinpoint to access the Amazon S3 location - // to import endpoint definitions from. - // - // RoleArn is a required field - RoleArn *string `type:"string" required:"true"` - - // The URL of the Amazon Simple Storage Service (Amazon S3) bucket that contains - // the endpoint definitions to import. This location can be a folder or a single - // file. If the location is a folder, Amazon Pinpoint imports endpoint definitions - // from the files in this location, including any subfolders that the folder - // contains. - // - // The URL should be in the following format: s3://bucket-name/folder-name/file-name. - // The location can end with the key for an individual object or a prefix that - // qualifies multiple objects. - // - // S3Url is a required field - S3Url *string `type:"string" required:"true"` + // The message template to use for the ADM (Amazon Device Messaging) channel. + // This message template overrides the default template for push notification + // channels (DefaultPushNotificationTemplate). + ADM *AndroidPushNotificationTemplate `type:"structure"` + + // The message template to use for the APNs (Apple Push Notification service) + // channel. This message template overrides the default template for push notification + // channels (DefaultPushNotificationTemplate). + APNS *APNSPushNotificationTemplate `type:"structure"` + + // The message template to use for the Baidu (Baidu Cloud Push) channel. This + // message template overrides the default template for push notification channels + // (DefaultPushNotificationTemplate). + Baidu *AndroidPushNotificationTemplate `type:"structure"` + + // The default message template to use for push notification channels. + Default *DefaultPushNotificationTemplate `type:"structure"` + + // A JSON object that specifies the default values to use for message variables + // in the message template. This object is a set of key-value pairs. Each key + // defines a message variable in the template. The corresponding value defines + // the default value for that variable. When you create a message that's based + // on the template, you can override these defaults with message-specific and + // address-specific variables and values. + DefaultSubstitutions *string `type:"string"` + + // The message template to use for the GCM channel, which is used to send notifications + // through the Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging + // (GCM), service. This message template overrides the default template for + // push notification channels (DefaultPushNotificationTemplate). + GCM *AndroidPushNotificationTemplate `type:"structure"` - // The identifier for the segment that the import job updates or adds endpoint - // definitions to, if the import job updates an existing segment. - SegmentId *string `type:"string"` + // A string-to-string map of key-value pairs that defines the tags to associate + // with the message template. Each tag consists of a required tag key and an + // associated tag value. + Tags map[string]*string `locationName:"tags" type:"map"` - // The custom name for the segment that's created by the import job, if the - // value of the DefineSegment property is true. - SegmentName *string `type:"string"` + // A custom description of the message template. + TemplateDescription *string `type:"string"` } // String returns the string representation -func (s ImportJobResource) String() string { +func (s PushNotificationTemplateRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ImportJobResource) GoString() string { +func (s PushNotificationTemplateRequest) GoString() string { return s.String() } -// SetDefineSegment sets the DefineSegment field's value. -func (s *ImportJobResource) SetDefineSegment(v bool) *ImportJobResource { - s.DefineSegment = &v +// SetADM sets the ADM field's value. +func (s *PushNotificationTemplateRequest) SetADM(v *AndroidPushNotificationTemplate) *PushNotificationTemplateRequest { + s.ADM = v return s } -// SetExternalId sets the ExternalId field's value. -func (s *ImportJobResource) SetExternalId(v string) *ImportJobResource { - s.ExternalId = &v +// SetAPNS sets the APNS field's value. +func (s *PushNotificationTemplateRequest) SetAPNS(v *APNSPushNotificationTemplate) *PushNotificationTemplateRequest { + s.APNS = v return s } -// SetFormat sets the Format field's value. -func (s *ImportJobResource) SetFormat(v string) *ImportJobResource { - s.Format = &v +// SetBaidu sets the Baidu field's value. +func (s *PushNotificationTemplateRequest) SetBaidu(v *AndroidPushNotificationTemplate) *PushNotificationTemplateRequest { + s.Baidu = v return s } -// SetRegisterEndpoints sets the RegisterEndpoints field's value. -func (s *ImportJobResource) SetRegisterEndpoints(v bool) *ImportJobResource { - s.RegisterEndpoints = &v +// SetDefault sets the Default field's value. +func (s *PushNotificationTemplateRequest) SetDefault(v *DefaultPushNotificationTemplate) *PushNotificationTemplateRequest { + s.Default = v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *ImportJobResource) SetRoleArn(v string) *ImportJobResource { - s.RoleArn = &v +// SetDefaultSubstitutions sets the DefaultSubstitutions field's value. +func (s *PushNotificationTemplateRequest) SetDefaultSubstitutions(v string) *PushNotificationTemplateRequest { + s.DefaultSubstitutions = &v return s } -// SetS3Url sets the S3Url field's value. -func (s *ImportJobResource) SetS3Url(v string) *ImportJobResource { - s.S3Url = &v +// SetGCM sets the GCM field's value. +func (s *PushNotificationTemplateRequest) SetGCM(v *AndroidPushNotificationTemplate) *PushNotificationTemplateRequest { + s.GCM = v return s } -// SetSegmentId sets the SegmentId field's value. -func (s *ImportJobResource) SetSegmentId(v string) *ImportJobResource { - s.SegmentId = &v +// SetTags sets the Tags field's value. +func (s *PushNotificationTemplateRequest) SetTags(v map[string]*string) *PushNotificationTemplateRequest { + s.Tags = v return s } -// SetSegmentName sets the SegmentName field's value. -func (s *ImportJobResource) SetSegmentName(v string) *ImportJobResource { - s.SegmentName = &v +// SetTemplateDescription sets the TemplateDescription field's value. +func (s *PushNotificationTemplateRequest) SetTemplateDescription(v string) *PushNotificationTemplateRequest { + s.TemplateDescription = &v return s } -// Provides information about the status and settings of a job that imports -// endpoint definitions from one or more files. The files can be stored in an -// Amazon Simple Storage Service (Amazon S3) bucket or uploaded directly from -// a computer by using the Amazon Pinpoint console. -type ImportJobResponse struct { +// Provides information about the content and settings for a message template +// that can be used in messages that are sent through a push notification channel. +type PushNotificationTemplateResponse struct { _ struct{} `type:"structure"` - // The unique identifier for the application that's associated with the import - // job. - // - // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` + // The message template that's used for the ADM (Amazon Device Messaging) channel. + // This message template overrides the default template for push notification + // channels (DefaultPushNotificationTemplate). + ADM *AndroidPushNotificationTemplate `type:"structure"` - // The number of pieces that were processed successfully (completed) by the - // import job, as of the time of the request. - CompletedPieces *int64 `type:"integer"` + // The message template that's used for the APNs (Apple Push Notification service) + // channel. This message template overrides the default template for push notification + // channels (DefaultPushNotificationTemplate). + APNS *APNSPushNotificationTemplate `type:"structure"` - // The date, in ISO 8601 format, when the import job was completed. - CompletionDate *string `type:"string"` + // The Amazon Resource Name (ARN) of the message template. + Arn *string `type:"string"` - // The date, in ISO 8601 format, when the import job was created. + // The message template that's used for the Baidu (Baidu Cloud Push) channel. + // This message template overrides the default template for push notification + // channels (DefaultPushNotificationTemplate). + Baidu *AndroidPushNotificationTemplate `type:"structure"` + + // The date, in ISO 8601 format, when the message template was created. // // CreationDate is a required field CreationDate *string `type:"string" required:"true"` - // The resource settings that apply to the import job. - // - // Definition is a required field - Definition *ImportJobResource `type:"structure" required:"true"` - - // The number of pieces that weren't processed successfully (failed) by the - // import job, as of the time of the request. - FailedPieces *int64 `type:"integer"` + // The default message template that's used for push notification channels. + Default *DefaultPushNotificationTemplate `type:"structure"` - // An array of entries, one for each of the first 100 entries that weren't processed - // successfully (failed) by the import job, if any. - Failures []*string `type:"list"` + // The JSON object that specifies the default values that are used for message + // variables in the message template. This object is a set of key-value pairs. + // Each key defines a message variable in the template. The corresponding value + // defines the default value for that variable. + DefaultSubstitutions *string `type:"string"` - // The unique identifier for the import job. - // - // Id is a required field - Id *string `type:"string" required:"true"` + // The message template that's used for the GCM channel, which is used to send + // notifications through the Firebase Cloud Messaging (FCM), formerly Google + // Cloud Messaging (GCM), service. This message template overrides the default + // template for push notification channels (DefaultPushNotificationTemplate). + GCM *AndroidPushNotificationTemplate `type:"structure"` - // The status of the import job. The job status is FAILED if Amazon Pinpoint - // wasn't able to process one or more pieces in the job. + // The date, in ISO 8601 format, when the message template was last modified. // - // JobStatus is a required field - JobStatus *string `type:"string" required:"true" enum:"JobStatus"` + // LastModifiedDate is a required field + LastModifiedDate *string `type:"string" required:"true"` - // The total number of endpoint definitions that weren't processed successfully - // (failed) by the import job, typically because an error, such as a syntax - // error, occurred. - TotalFailures *int64 `type:"integer"` + // A string-to-string map of key-value pairs that identifies the tags that are + // associated with the message template. Each tag consists of a required tag + // key and an associated tag value. + Tags map[string]*string `locationName:"tags" type:"map"` - // The total number of pieces that must be processed to complete the import - // job. Each piece consists of an approximately equal portion of the endpoint - // definitions that are part of the import job. - TotalPieces *int64 `type:"integer"` + // The custom description of the message template. + TemplateDescription *string `type:"string"` - // The total number of endpoint definitions that were processed by the import - // job. - TotalProcessed *int64 `type:"integer"` + // The name of the message template. + // + // TemplateName is a required field + TemplateName *string `type:"string" required:"true"` - // The job type. This value is IMPORT for import jobs. + // The type of channel that the message template is designed for. For a push + // notification template, this value is PUSH. // - // Type is a required field - Type *string `type:"string" required:"true"` + // TemplateType is a required field + TemplateType *string `type:"string" required:"true" enum:"TemplateType"` + + // The unique identifier, as an integer, for the active version of the message + // template, or the version of the template that you specified by using the + // version parameter in your request. + Version *string `type:"string"` } // String returns the string representation -func (s ImportJobResponse) String() string { +func (s PushNotificationTemplateResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ImportJobResponse) GoString() string { +func (s PushNotificationTemplateResponse) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *ImportJobResponse) SetApplicationId(v string) *ImportJobResponse { - s.ApplicationId = &v +// SetADM sets the ADM field's value. +func (s *PushNotificationTemplateResponse) SetADM(v *AndroidPushNotificationTemplate) *PushNotificationTemplateResponse { + s.ADM = v return s } -// SetCompletedPieces sets the CompletedPieces field's value. -func (s *ImportJobResponse) SetCompletedPieces(v int64) *ImportJobResponse { - s.CompletedPieces = &v +// SetAPNS sets the APNS field's value. +func (s *PushNotificationTemplateResponse) SetAPNS(v *APNSPushNotificationTemplate) *PushNotificationTemplateResponse { + s.APNS = v return s } -// SetCompletionDate sets the CompletionDate field's value. -func (s *ImportJobResponse) SetCompletionDate(v string) *ImportJobResponse { - s.CompletionDate = &v +// SetArn sets the Arn field's value. +func (s *PushNotificationTemplateResponse) SetArn(v string) *PushNotificationTemplateResponse { + s.Arn = &v + return s +} + +// SetBaidu sets the Baidu field's value. +func (s *PushNotificationTemplateResponse) SetBaidu(v *AndroidPushNotificationTemplate) *PushNotificationTemplateResponse { + s.Baidu = v return s } // SetCreationDate sets the CreationDate field's value. -func (s *ImportJobResponse) SetCreationDate(v string) *ImportJobResponse { +func (s *PushNotificationTemplateResponse) SetCreationDate(v string) *PushNotificationTemplateResponse { s.CreationDate = &v return s } -// SetDefinition sets the Definition field's value. -func (s *ImportJobResponse) SetDefinition(v *ImportJobResource) *ImportJobResponse { - s.Definition = v +// SetDefault sets the Default field's value. +func (s *PushNotificationTemplateResponse) SetDefault(v *DefaultPushNotificationTemplate) *PushNotificationTemplateResponse { + s.Default = v return s } -// SetFailedPieces sets the FailedPieces field's value. -func (s *ImportJobResponse) SetFailedPieces(v int64) *ImportJobResponse { - s.FailedPieces = &v +// SetDefaultSubstitutions sets the DefaultSubstitutions field's value. +func (s *PushNotificationTemplateResponse) SetDefaultSubstitutions(v string) *PushNotificationTemplateResponse { + s.DefaultSubstitutions = &v return s } -// SetFailures sets the Failures field's value. -func (s *ImportJobResponse) SetFailures(v []*string) *ImportJobResponse { - s.Failures = v +// SetGCM sets the GCM field's value. +func (s *PushNotificationTemplateResponse) SetGCM(v *AndroidPushNotificationTemplate) *PushNotificationTemplateResponse { + s.GCM = v return s } -// SetId sets the Id field's value. -func (s *ImportJobResponse) SetId(v string) *ImportJobResponse { - s.Id = &v +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *PushNotificationTemplateResponse) SetLastModifiedDate(v string) *PushNotificationTemplateResponse { + s.LastModifiedDate = &v return s } -// SetJobStatus sets the JobStatus field's value. -func (s *ImportJobResponse) SetJobStatus(v string) *ImportJobResponse { - s.JobStatus = &v +// SetTags sets the Tags field's value. +func (s *PushNotificationTemplateResponse) SetTags(v map[string]*string) *PushNotificationTemplateResponse { + s.Tags = v return s } -// SetTotalFailures sets the TotalFailures field's value. -func (s *ImportJobResponse) SetTotalFailures(v int64) *ImportJobResponse { - s.TotalFailures = &v +// SetTemplateDescription sets the TemplateDescription field's value. +func (s *PushNotificationTemplateResponse) SetTemplateDescription(v string) *PushNotificationTemplateResponse { + s.TemplateDescription = &v return s } -// SetTotalPieces sets the TotalPieces field's value. -func (s *ImportJobResponse) SetTotalPieces(v int64) *ImportJobResponse { - s.TotalPieces = &v +// SetTemplateName sets the TemplateName field's value. +func (s *PushNotificationTemplateResponse) SetTemplateName(v string) *PushNotificationTemplateResponse { + s.TemplateName = &v return s } -// SetTotalProcessed sets the TotalProcessed field's value. -func (s *ImportJobResponse) SetTotalProcessed(v int64) *ImportJobResponse { - s.TotalProcessed = &v +// SetTemplateType sets the TemplateType field's value. +func (s *PushNotificationTemplateResponse) SetTemplateType(v string) *PushNotificationTemplateResponse { + s.TemplateType = &v return s } -// SetType sets the Type field's value. -func (s *ImportJobResponse) SetType(v string) *ImportJobResponse { - s.Type = &v +// SetVersion sets the Version field's value. +func (s *PushNotificationTemplateResponse) SetVersion(v string) *PushNotificationTemplateResponse { + s.Version = &v return s } -// Provides information about the status and settings of all the import jobs -// that are associated with an application or segment. An import job is a job -// that imports endpoint definitions from one or more files. -type ImportJobsResponse struct { - _ struct{} `type:"structure"` +type PutEventStreamInput struct { + _ struct{} `type:"structure" payload:"WriteEventStream"` - // An array of responses, one for each import job that's associated with the - // application (Import Jobs resource) or segment (Segment Import Jobs resource). - // - // Item is a required field - Item []*ImportJobResponse `type:"list" required:"true"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The string to use in a subsequent request to get the next page of results - // in a paginated response. This value is null if there are no additional pages. - NextToken *string `type:"string"` + // Specifies the Amazon Resource Name (ARN) of an event stream to publish events + // to and the AWS Identity and Access Management (IAM) role to use when publishing + // those events. + // + // WriteEventStream is a required field + WriteEventStream *WriteEventStream `type:"structure" required:"true"` } // String returns the string representation -func (s ImportJobsResponse) String() string { +func (s PutEventStreamInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ImportJobsResponse) GoString() string { +func (s PutEventStreamInput) GoString() string { return s.String() } -// SetItem sets the Item field's value. -func (s *ImportJobsResponse) SetItem(v []*ImportJobResponse) *ImportJobsResponse { - s.Item = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutEventStreamInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutEventStreamInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.WriteEventStream == nil { + invalidParams.Add(request.NewErrParamRequired("WriteEventStream")) + } + if s.WriteEventStream != nil { + if err := s.WriteEventStream.Validate(); err != nil { + invalidParams.AddNested("WriteEventStream", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *PutEventStreamInput) SetApplicationId(v string) *PutEventStreamInput { + s.ApplicationId = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ImportJobsResponse) SetNextToken(v string) *ImportJobsResponse { - s.NextToken = &v +// SetWriteEventStream sets the WriteEventStream field's value. +func (s *PutEventStreamInput) SetWriteEventStream(v *WriteEventStream) *PutEventStreamInput { + s.WriteEventStream = v return s } -// Provides information about the results of a request to create or update an -// endpoint that's associated with an event. -type ItemResponse struct { - _ struct{} `type:"structure"` - - // The response that was received after the endpoint data was accepted. - EndpointItemResponse *EndpointItemResponse `type:"structure"` +type PutEventStreamOutput struct { + _ struct{} `type:"structure" payload:"EventStream"` - // A multipart response object that contains a key and a value for each event - // in the request. In each object, the event ID is the key and an EventItemResponse - // object is the value. - EventsItemResponse map[string]*EventItemResponse `type:"map"` + // Specifies settings for publishing event data to an Amazon Kinesis data stream + // or an Amazon Kinesis Data Firehose delivery stream. + // + // EventStream is a required field + EventStream *EventStream `type:"structure" required:"true"` } // String returns the string representation -func (s ItemResponse) String() string { +func (s PutEventStreamOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ItemResponse) GoString() string { +func (s PutEventStreamOutput) GoString() string { return s.String() } -// SetEndpointItemResponse sets the EndpointItemResponse field's value. -func (s *ItemResponse) SetEndpointItemResponse(v *EndpointItemResponse) *ItemResponse { - s.EndpointItemResponse = v +// SetEventStream sets the EventStream field's value. +func (s *PutEventStreamOutput) SetEventStream(v *EventStream) *PutEventStreamOutput { + s.EventStream = v return s } -// SetEventsItemResponse sets the EventsItemResponse field's value. -func (s *ItemResponse) SetEventsItemResponse(v map[string]*EventItemResponse) *ItemResponse { - s.EventsItemResponse = v - return s -} +type PutEventsInput struct { + _ struct{} `type:"structure" payload:"EventsRequest"` -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` + // Specifies a batch of events to process. + // + // EventsRequest is a required field + EventsRequest *EventsRequest `type:"structure" required:"true"` } // String returns the string representation -func (s ListTagsForResourceInput) String() string { +func (s PutEventsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsForResourceInput) GoString() string { +func (s PutEventsInput) 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")) +func (s *PutEventsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutEventsInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.EventsRequest == nil { + invalidParams.Add(request.NewErrParamRequired("EventsRequest")) + } + if s.EventsRequest != nil { + if err := s.EventsRequest.Validate(); err != nil { + invalidParams.AddNested("EventsRequest", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -18317,271 +26204,274 @@ func (s *ListTagsForResourceInput) Validate() error { return nil } -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsForResourceInput) SetResourceArn(v string) *ListTagsForResourceInput { - s.ResourceArn = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *PutEventsInput) SetApplicationId(v string) *PutEventsInput { + s.ApplicationId = &v return s } -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure" payload:"TagsModel"` +// SetEventsRequest sets the EventsRequest field's value. +func (s *PutEventsInput) SetEventsRequest(v *EventsRequest) *PutEventsInput { + s.EventsRequest = v + return s +} - // Specifies the tags (keys and values) for an application, campaign, or segment. +type PutEventsOutput struct { + _ struct{} `type:"structure" payload:"EventsResponse"` + + // Provides information about endpoints and the events that they're associated + // with. // - // TagsModel is a required field - TagsModel *TagsModel `type:"structure" required:"true"` + // EventsResponse is a required field + EventsResponse *EventsResponse `type:"structure" required:"true"` } // String returns the string representation -func (s ListTagsForResourceOutput) String() string { +func (s PutEventsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsForResourceOutput) GoString() string { +func (s PutEventsOutput) GoString() string { return s.String() } -// SetTagsModel sets the TagsModel field's value. -func (s *ListTagsForResourceOutput) SetTagsModel(v *TagsModel) *ListTagsForResourceOutput { - s.TagsModel = v +// SetEventsResponse sets the EventsResponse field's value. +func (s *PutEventsOutput) SetEventsResponse(v *EventsResponse) *PutEventsOutput { + s.EventsResponse = v return s } -// Specifies the content and settings for a push notification that's sent to -// recipients of a campaign. -type Message struct { +// Specifies the start and end times that define a time range when messages +// aren't sent to endpoints. +type QuietTime struct { _ struct{} `type:"structure"` - // The action to occur if a recipient taps the push notification. Valid values - // are: - // - // * OPEN_APP - Your app opens or it becomes the foreground app if it was - // sent to the background. This is the default action. - // - // * DEEP_LINK - Your app opens and displays a designated user interface - // in the app. This setting uses the deep-linking features of iOS and Android. - // - // * URL - The default mobile browser on the recipient's device opens and - // loads the web page at a URL that you specify. - Action *string `type:"string" enum:"Action"` - - // The body of the notification message. The maximum number of characters is - // 200. - Body *string `type:"string"` - - // The URL of the image to display as the push-notification icon, such as the - // icon for the app. - ImageIconUrl *string `type:"string"` - - // The URL of the image to display as the small, push-notification icon, such - // as a small version of the icon for the app. - ImageSmallIconUrl *string `type:"string"` - - // The URL of an image to display in the push notification. - ImageUrl *string `type:"string"` + // The specific time when quiet time ends. This value has to use 24-hour notation + // and be in HH:MM format, where HH is the hour (with a leading zero, if applicable) + // and MM is the minutes. For example, use 02:30 to represent 2:30 AM, or 14:30 + // to represent 2:30 PM. + End *string `type:"string"` - // The JSON payload to use for a silent push notification. - JsonBody *string `type:"string"` + // The specific time when quiet time begins. This value has to use 24-hour notation + // and be in HH:MM format, where HH is the hour (with a leading zero, if applicable) + // and MM is the minutes. For example, use 02:30 to represent 2:30 AM, or 14:30 + // to represent 2:30 PM. + Start *string `type:"string"` +} - // The URL of the image or video to display in the push notification. - MediaUrl *string `type:"string"` +// String returns the string representation +func (s QuietTime) String() string { + return awsutil.Prettify(s) +} - // The raw, JSON-formatted string to use as the payload for the notification - // message. This value overrides other values for the message. - RawContent *string `type:"string"` +// GoString returns the string representation +func (s QuietTime) GoString() string { + return s.String() +} - // Specifies whether the notification is a silent push notification, which is - // a push notification that doesn't display on a recipient's device. Silent - // push notifications can be used for cases such as updating an app's configuration, - // displaying messages in an in-app message center, or supporting phone home - // functionality. - SilentPush *bool `type:"boolean"` +// SetEnd sets the End field's value. +func (s *QuietTime) SetEnd(v string) *QuietTime { + s.End = &v + return s +} - // The number of seconds that the push-notification service should keep the - // message, if the service is unable to deliver the notification the first time. - // This value is converted to an expiration value when it's sent to a push-notification - // service. If this value is 0, the service treats the notification as if it - // expires immediately and the service doesn't store or try to deliver the notification - // again. - // - // This value doesn't apply to messages that are sent through the Amazon Device - // Messaging (ADM) service. - TimeToLive *int64 `type:"integer"` +// SetStart sets the Start field's value. +func (s *QuietTime) SetStart(v string) *QuietTime { + s.Start = &v + return s +} - // The title to display above the notification message on a recipient's device. - Title *string `type:"string"` +// Specifies the settings for a random split activity in a journey. This type +// of activity randomly sends specified percentages of participants down one +// of as many as five paths in a journey, based on conditions that you specify. +type RandomSplitActivity struct { + _ struct{} `type:"structure"` - // The URL to open in a recipient's default mobile browser, if a recipient taps - // the push notification and the value of the Action property is URL. - Url *string `type:"string"` + // The paths for the activity, including the percentage of participants to enter + // each path and the activity to perform for each path. + Branches []*RandomSplitEntry `type:"list"` } // String returns the string representation -func (s Message) String() string { +func (s RandomSplitActivity) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Message) GoString() string { +func (s RandomSplitActivity) GoString() string { return s.String() } -// SetAction sets the Action field's value. -func (s *Message) SetAction(v string) *Message { - s.Action = &v +// SetBranches sets the Branches field's value. +func (s *RandomSplitActivity) SetBranches(v []*RandomSplitEntry) *RandomSplitActivity { + s.Branches = v return s } -// SetBody sets the Body field's value. -func (s *Message) SetBody(v string) *Message { - s.Body = &v - return s -} +// Specifies the settings for a path in a random split activity in a journey. +type RandomSplitEntry struct { + _ struct{} `type:"structure"` -// SetImageIconUrl sets the ImageIconUrl field's value. -func (s *Message) SetImageIconUrl(v string) *Message { - s.ImageIconUrl = &v - return s -} + // The unique identifier for the next activity to perform, after completing + // the activity for the path. + NextActivity *string `type:"string"` -// SetImageSmallIconUrl sets the ImageSmallIconUrl field's value. -func (s *Message) SetImageSmallIconUrl(v string) *Message { - s.ImageSmallIconUrl = &v - return s + // The percentage of participants to send down the activity path. + // + // To determine which participants are sent down each path, Amazon Pinpoint + // applies a probability-based algorithm to the percentages that you specify + // for the paths. Therefore, the actual percentage of participants who are sent + // down a path may not be equal to the percentage that you specify. + Percentage *int64 `type:"integer"` } -// SetImageUrl sets the ImageUrl field's value. -func (s *Message) SetImageUrl(v string) *Message { - s.ImageUrl = &v - return s +// String returns the string representation +func (s RandomSplitEntry) String() string { + return awsutil.Prettify(s) } -// SetJsonBody sets the JsonBody field's value. -func (s *Message) SetJsonBody(v string) *Message { - s.JsonBody = &v - return s +// GoString returns the string representation +func (s RandomSplitEntry) GoString() string { + return s.String() } -// SetMediaUrl sets the MediaUrl field's value. -func (s *Message) SetMediaUrl(v string) *Message { - s.MediaUrl = &v +// SetNextActivity sets the NextActivity field's value. +func (s *RandomSplitEntry) SetNextActivity(v string) *RandomSplitEntry { + s.NextActivity = &v return s } -// SetRawContent sets the RawContent field's value. -func (s *Message) SetRawContent(v string) *Message { - s.RawContent = &v +// SetPercentage sets the Percentage field's value. +func (s *RandomSplitEntry) SetPercentage(v int64) *RandomSplitEntry { + s.Percentage = &v return s } -// SetSilentPush sets the SilentPush field's value. -func (s *Message) SetSilentPush(v bool) *Message { - s.SilentPush = &v - return s +// Specifies the contents of an email message, represented as a raw MIME message. +type RawEmail struct { + _ struct{} `type:"structure"` + + // Data is automatically base64 encoded/decoded by the SDK. + Data []byte `type:"blob"` } -// SetTimeToLive sets the TimeToLive field's value. -func (s *Message) SetTimeToLive(v int64) *Message { - s.TimeToLive = &v - return s +// String returns the string representation +func (s RawEmail) String() string { + return awsutil.Prettify(s) } -// SetTitle sets the Title field's value. -func (s *Message) SetTitle(v string) *Message { - s.Title = &v - return s +// GoString returns the string representation +func (s RawEmail) GoString() string { + return s.String() } -// SetUrl sets the Url field's value. -func (s *Message) SetUrl(v string) *Message { - s.Url = &v +// SetData sets the Data field's value. +func (s *RawEmail) SetData(v []byte) *RawEmail { + s.Data = v return s } -// Provides information about an API request or response. -type MessageBody struct { +// Specifies criteria for including or excluding endpoints from a segment based +// on how recently an endpoint was active. +type RecencyDimension struct { _ struct{} `type:"structure"` - // The message that's returned from the API. - Message *string `type:"string"` + // The duration to use when determining whether an endpoint is active or inactive. + // + // Duration is a required field + Duration *string `type:"string" required:"true" enum:"Duration"` - // The unique identifier for the request or response. - RequestID *string `type:"string"` + // The type of recency dimension to use for the segment. Valid values are: ACTIVE, + // endpoints that were active within the specified duration are included in + // the segment; and, INACTIVE, endpoints that weren't active within the specified + // duration are included in the segment. + // + // RecencyType is a required field + RecencyType *string `type:"string" required:"true" enum:"RecencyType"` } // String returns the string representation -func (s MessageBody) String() string { +func (s RecencyDimension) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MessageBody) GoString() string { +func (s RecencyDimension) GoString() string { return s.String() } -// SetMessage sets the Message field's value. -func (s *MessageBody) SetMessage(v string) *MessageBody { - s.Message = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *RecencyDimension) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RecencyDimension"} + if s.Duration == nil { + invalidParams.Add(request.NewErrParamRequired("Duration")) + } + if s.RecencyType == nil { + invalidParams.Add(request.NewErrParamRequired("RecencyType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetRequestID sets the RequestID field's value. -func (s *MessageBody) SetRequestID(v string) *MessageBody { - s.RequestID = &v +// SetDuration sets the Duration field's value. +func (s *RecencyDimension) SetDuration(v string) *RecencyDimension { + s.Duration = &v return s } -// Specifies the message configuration settings for a campaign. -type MessageConfiguration struct { - _ struct{} `type:"structure"` - - // The message that the campaign sends through the ADM (Amazon Device Messaging) - // channel. This message overrides the default message. - ADMMessage *Message `type:"structure"` - - // The message that the campaign sends through the APNs (Apple Push Notification - // service) channel. This message overrides the default message. - APNSMessage *Message `type:"structure"` - - // The message that the campaign sends through the Baidu (Baidu Cloud Push) - // channel. This message overrides the default message. - BaiduMessage *Message `type:"structure"` +// SetRecencyType sets the RecencyType field's value. +func (s *RecencyDimension) SetRecencyType(v string) *RecencyDimension { + s.RecencyType = &v + return s +} - // The default message that the campaign sends through all the channels that - // are configured for the campaign. - DefaultMessage *Message `type:"structure"` +type RemoveAttributesInput struct { + _ struct{} `type:"structure" payload:"UpdateAttributesRequest"` - // The message that the campaign sends through the email channel. - EmailMessage *CampaignEmailMessage `type:"structure"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The message that the campaign sends through the GCM channel, which enables - // Amazon Pinpoint to send push notifications through the Firebase Cloud Messaging - // (FCM), formerly Google Cloud Messaging (GCM), service. This message overrides - // the default message. - GCMMessage *Message `type:"structure"` + // AttributeType is a required field + AttributeType *string `location:"uri" locationName:"attribute-type" type:"string" required:"true"` - // The message that the campaign sends through the SMS channel. - SMSMessage *CampaignSmsMessage `type:"structure"` + // Specifies one or more attributes to remove from all the endpoints that are + // associated with an application. + // + // UpdateAttributesRequest is a required field + UpdateAttributesRequest *UpdateAttributesRequest `type:"structure" required:"true"` } // String returns the string representation -func (s MessageConfiguration) String() string { +func (s RemoveAttributesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MessageConfiguration) GoString() string { +func (s RemoveAttributesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *MessageConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MessageConfiguration"} - if s.EmailMessage != nil { - if err := s.EmailMessage.Validate(); err != nil { - invalidParams.AddNested("EmailMessage", err.(request.ErrInvalidParams)) - } +func (s *RemoveAttributesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RemoveAttributesInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.AttributeType == nil { + invalidParams.Add(request.NewErrParamRequired("AttributeType")) + } + if s.AttributeType != nil && len(*s.AttributeType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AttributeType", 1)) + } + if s.UpdateAttributesRequest == nil { + invalidParams.Add(request.NewErrParamRequired("UpdateAttributesRequest")) } if invalidParams.Len() > 0 { @@ -18590,753 +26480,742 @@ func (s *MessageConfiguration) Validate() error { return nil } -// SetADMMessage sets the ADMMessage field's value. -func (s *MessageConfiguration) SetADMMessage(v *Message) *MessageConfiguration { - s.ADMMessage = v +// SetApplicationId sets the ApplicationId field's value. +func (s *RemoveAttributesInput) SetApplicationId(v string) *RemoveAttributesInput { + s.ApplicationId = &v return s } -// SetAPNSMessage sets the APNSMessage field's value. -func (s *MessageConfiguration) SetAPNSMessage(v *Message) *MessageConfiguration { - s.APNSMessage = v +// SetAttributeType sets the AttributeType field's value. +func (s *RemoveAttributesInput) SetAttributeType(v string) *RemoveAttributesInput { + s.AttributeType = &v return s } -// SetBaiduMessage sets the BaiduMessage field's value. -func (s *MessageConfiguration) SetBaiduMessage(v *Message) *MessageConfiguration { - s.BaiduMessage = v +// SetUpdateAttributesRequest sets the UpdateAttributesRequest field's value. +func (s *RemoveAttributesInput) SetUpdateAttributesRequest(v *UpdateAttributesRequest) *RemoveAttributesInput { + s.UpdateAttributesRequest = v return s } -// SetDefaultMessage sets the DefaultMessage field's value. -func (s *MessageConfiguration) SetDefaultMessage(v *Message) *MessageConfiguration { - s.DefaultMessage = v - return s +type RemoveAttributesOutput struct { + _ struct{} `type:"structure" payload:"AttributesResource"` + + // Provides information about the type and the names of attributes that were + // removed from all the endpoints that are associated with an application. + // + // AttributesResource is a required field + AttributesResource *AttributesResource `type:"structure" required:"true"` } -// SetEmailMessage sets the EmailMessage field's value. -func (s *MessageConfiguration) SetEmailMessage(v *CampaignEmailMessage) *MessageConfiguration { - s.EmailMessage = v - return s +// String returns the string representation +func (s RemoveAttributesOutput) String() string { + return awsutil.Prettify(s) } -// SetGCMMessage sets the GCMMessage field's value. -func (s *MessageConfiguration) SetGCMMessage(v *Message) *MessageConfiguration { - s.GCMMessage = v - return s +// GoString returns the string representation +func (s RemoveAttributesOutput) GoString() string { + return s.String() } -// SetSMSMessage sets the SMSMessage field's value. -func (s *MessageConfiguration) SetSMSMessage(v *CampaignSmsMessage) *MessageConfiguration { - s.SMSMessage = v +// SetAttributesResource sets the AttributesResource field's value. +func (s *RemoveAttributesOutput) SetAttributesResource(v *AttributesResource) *RemoveAttributesOutput { + s.AttributesResource = v return s } -// Specifies the objects that define configuration and other settings for a -// message. -type MessageRequest struct { +// Provides the results of a query that retrieved the data for a standard metric +// that applies to an application, campaign, or journey. +type ResultRow struct { _ struct{} `type:"structure"` - // A map of key-value pairs, where each key is an address and each value is - // an AddressConfiguration object. An address can be a push notification token, - // a phone number, or an email address. You can use an AddressConfiguration - // object to tailor the message for an address by specifying settings such as - // content overrides and message variables. - Addresses map[string]*AddressConfiguration `type:"map"` - - // A map of custom attributes to attach to the message. For a push notification, - // this payload is added to the data.pinpoint object. For an email or text message, - // this payload is added to email/SMS delivery receipt event attributes. - Context map[string]*string `type:"map"` - - // A map of key-value pairs, where each key is an endpoint ID and each value - // is an EndpointSendConfiguration object. You can use an EndpointSendConfiguration - // object to tailor the message for an endpoint by specifying settings such - // as content overrides and message variables. - Endpoints map[string]*EndpointSendConfiguration `type:"map"` - - // The set of properties that defines the configuration settings for the message. + // An array of objects that defines the field and field values that were used + // to group data in a result set that contains multiple results. This value + // is null if the data in a result set isn’t grouped. // - // MessageConfiguration is a required field - MessageConfiguration *DirectMessageConfiguration `type:"structure" required:"true"` + // GroupedBys is a required field + GroupedBys []*ResultRowValue `type:"list" required:"true"` - // The unique identifier for tracing the message. This identifier is visible - // to message recipients. - TraceId *string `type:"string"` + // An array of objects that provides pre-aggregated values for a standard metric + // that applies to an application, campaign, or journey. + // + // Values is a required field + Values []*ResultRowValue `type:"list" required:"true"` } // String returns the string representation -func (s MessageRequest) String() string { +func (s ResultRow) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MessageRequest) GoString() string { +func (s ResultRow) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *MessageRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MessageRequest"} - if s.MessageConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("MessageConfiguration")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetGroupedBys sets the GroupedBys field's value. +func (s *ResultRow) SetGroupedBys(v []*ResultRowValue) *ResultRow { + s.GroupedBys = v + return s } -// SetAddresses sets the Addresses field's value. -func (s *MessageRequest) SetAddresses(v map[string]*AddressConfiguration) *MessageRequest { - s.Addresses = v +// SetValues sets the Values field's value. +func (s *ResultRow) SetValues(v []*ResultRowValue) *ResultRow { + s.Values = v return s } -// SetContext sets the Context field's value. -func (s *MessageRequest) SetContext(v map[string]*string) *MessageRequest { - s.Context = v - return s +// Provides a single value and metadata about that value as part of an array +// of query results for a standard metric that applies to an application, campaign, +// or journey. +type ResultRowValue struct { + _ struct{} `type:"structure"` + + // The friendly name of the metric whose value is specified by the Value property. + // + // Key is a required field + Key *string `type:"string" required:"true"` + + // The data type of the value specified by the Value property. + // + // Type is a required field + Type *string `type:"string" required:"true"` + + // In a Values object, the value for the metric that the query retrieved data + // for. In a GroupedBys object, the value for the field that was used to group + // data in a result set that contains multiple results (Values objects). + // + // Value is a required field + Value *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ResultRowValue) String() string { + return awsutil.Prettify(s) } -// SetEndpoints sets the Endpoints field's value. -func (s *MessageRequest) SetEndpoints(v map[string]*EndpointSendConfiguration) *MessageRequest { - s.Endpoints = v +// GoString returns the string representation +func (s ResultRowValue) GoString() string { + return s.String() +} + +// SetKey sets the Key field's value. +func (s *ResultRowValue) SetKey(v string) *ResultRowValue { + s.Key = &v return s } -// SetMessageConfiguration sets the MessageConfiguration field's value. -func (s *MessageRequest) SetMessageConfiguration(v *DirectMessageConfiguration) *MessageRequest { - s.MessageConfiguration = v +// SetType sets the Type field's value. +func (s *ResultRowValue) SetType(v string) *ResultRowValue { + s.Type = &v return s } -// SetTraceId sets the TraceId field's value. -func (s *MessageRequest) SetTraceId(v string) *MessageRequest { - s.TraceId = &v +// SetValue sets the Value field's value. +func (s *ResultRowValue) SetValue(v string) *ResultRowValue { + s.Value = &v return s } -// Provides information about the results of a request to send a message to -// an endpoint address. -type MessageResponse struct { +// Specifies the status and settings of the SMS channel for an application. +type SMSChannelRequest struct { _ struct{} `type:"structure"` - // The unique identifier for the application that was used to send the message. - // - // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` - - // A map that contains a multipart response for each address that the message - // was sent to. In the map, the endpoint ID is the key and the result is the - // value. - EndpointResult map[string]*EndpointMessageResult `type:"map"` + // Specifies whether to enable the SMS channel for the application. + Enabled *bool `type:"boolean"` - // The identifier for the original request that the message was delivered for. - RequestId *string `type:"string"` + // The identity that you want to display on recipients' devices when they receive + // messages from the SMS channel. + SenderId *string `type:"string"` - // A map that contains a multipart response for each address (email address, - // phone number, or push notification token) that the message was sent to. In - // the map, the address is the key and the result is the value. - Result map[string]*MessageResult `type:"map"` + // The registered short code that you want to use when you send messages through + // the SMS channel. + ShortCode *string `type:"string"` } // String returns the string representation -func (s MessageResponse) String() string { +func (s SMSChannelRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MessageResponse) GoString() string { +func (s SMSChannelRequest) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *MessageResponse) SetApplicationId(v string) *MessageResponse { - s.ApplicationId = &v - return s -} - -// SetEndpointResult sets the EndpointResult field's value. -func (s *MessageResponse) SetEndpointResult(v map[string]*EndpointMessageResult) *MessageResponse { - s.EndpointResult = v +// SetEnabled sets the Enabled field's value. +func (s *SMSChannelRequest) SetEnabled(v bool) *SMSChannelRequest { + s.Enabled = &v return s } -// SetRequestId sets the RequestId field's value. -func (s *MessageResponse) SetRequestId(v string) *MessageResponse { - s.RequestId = &v +// SetSenderId sets the SenderId field's value. +func (s *SMSChannelRequest) SetSenderId(v string) *SMSChannelRequest { + s.SenderId = &v return s } -// SetResult sets the Result field's value. -func (s *MessageResponse) SetResult(v map[string]*MessageResult) *MessageResponse { - s.Result = v +// SetShortCode sets the ShortCode field's value. +func (s *SMSChannelRequest) SetShortCode(v string) *SMSChannelRequest { + s.ShortCode = &v return s } -// Provides information about the results of sending a message directly to an -// endpoint address. -type MessageResult struct { +// Provides information about the status and settings of the SMS channel for +// an application. +type SMSChannelResponse struct { _ struct{} `type:"structure"` - // The delivery status of the message. Possible values are: - // - // * DUPLICATE - The endpoint address is a duplicate of another endpoint - // address. Amazon Pinpoint won't attempt to send the message again. - // - // * OPT_OUT - The user who's associated with the endpoint address has opted - // out of receiving messages from you. Amazon Pinpoint won't attempt to send - // the message again. - // - // * PERMANENT_FAILURE - An error occurred when delivering the message to - // the endpoint address. Amazon Pinpoint won't attempt to send the message - // again. - // - // * SUCCESSFUL - The message was successfully delivered to the endpoint - // address. - // - // * TEMPORARY_FAILURE - A temporary error occurred. Amazon Pinpoint will - // attempt to deliver the message again later. - // - // * THROTTLED - Amazon Pinpoint throttled the operation to send the message - // to the endpoint address. - // - // * TIMEOUT - The message couldn't be sent within the timeout period. - // - // * UNKNOWN_FAILURE - An unknown error occurred. - // - // DeliveryStatus is a required field - DeliveryStatus *string `type:"string" required:"true" enum:"DeliveryStatus"` + // The unique identifier for the application that the SMS channel applies to. + ApplicationId *string `type:"string"` - // The unique identifier for the message that was sent. - MessageId *string `type:"string"` + // The date and time, in ISO 8601 format, when the SMS channel was enabled. + CreationDate *string `type:"string"` - // The downstream service status code for delivering the message. + // Specifies whether the SMS channel is enabled for the application. + Enabled *bool `type:"boolean"` + + // (Not used) This property is retained only for backward compatibility. + HasCredential *bool `type:"boolean"` + + // (Deprecated) An identifier for the SMS channel. This property is retained + // only for backward compatibility. + Id *string `type:"string"` + + // Specifies whether the SMS channel is archived. + IsArchived *bool `type:"boolean"` + + // The user who last modified the SMS channel. + LastModifiedBy *string `type:"string"` + + // The date and time, in ISO 8601 format, when the SMS channel was last modified. + LastModifiedDate *string `type:"string"` + + // The type of messaging or notification platform for the channel. For the SMS + // channel, this value is SMS. // - // StatusCode is a required field - StatusCode *int64 `type:"integer" required:"true"` + // Platform is a required field + Platform *string `type:"string" required:"true"` - // The status message for delivering the message. - StatusMessage *string `type:"string"` + // The maximum number of promotional messages that you can send through the + // SMS channel each second. + PromotionalMessagesPerSecond *int64 `type:"integer"` - // For push notifications that are sent through the GCM channel, specifies whether - // the token was updated as part of delivering the message. - UpdatedToken *string `type:"string"` + // The identity that displays on recipients' devices when they receive messages + // from the SMS channel. + SenderId *string `type:"string"` + + // The registered short code to use when you send messages through the SMS channel. + ShortCode *string `type:"string"` + + // The maximum number of transactional messages that you can send through the + // SMS channel each second. + TransactionalMessagesPerSecond *int64 `type:"integer"` + + // The current version of the SMS channel. + Version *int64 `type:"integer"` } // String returns the string representation -func (s MessageResult) String() string { +func (s SMSChannelResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MessageResult) GoString() string { +func (s SMSChannelResponse) GoString() string { return s.String() } -// SetDeliveryStatus sets the DeliveryStatus field's value. -func (s *MessageResult) SetDeliveryStatus(v string) *MessageResult { - s.DeliveryStatus = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *SMSChannelResponse) SetApplicationId(v string) *SMSChannelResponse { + s.ApplicationId = &v return s } -// SetMessageId sets the MessageId field's value. -func (s *MessageResult) SetMessageId(v string) *MessageResult { - s.MessageId = &v +// SetCreationDate sets the CreationDate field's value. +func (s *SMSChannelResponse) SetCreationDate(v string) *SMSChannelResponse { + s.CreationDate = &v return s } -// SetStatusCode sets the StatusCode field's value. -func (s *MessageResult) SetStatusCode(v int64) *MessageResult { - s.StatusCode = &v +// SetEnabled sets the Enabled field's value. +func (s *SMSChannelResponse) SetEnabled(v bool) *SMSChannelResponse { + s.Enabled = &v return s } -// SetStatusMessage sets the StatusMessage field's value. -func (s *MessageResult) SetStatusMessage(v string) *MessageResult { - s.StatusMessage = &v +// SetHasCredential sets the HasCredential field's value. +func (s *SMSChannelResponse) SetHasCredential(v bool) *SMSChannelResponse { + s.HasCredential = &v return s } -// SetUpdatedToken sets the UpdatedToken field's value. -func (s *MessageResult) SetUpdatedToken(v string) *MessageResult { - s.UpdatedToken = &v +// SetId sets the Id field's value. +func (s *SMSChannelResponse) SetId(v string) *SMSChannelResponse { + s.Id = &v return s } -// Specifies metric-based criteria for including or excluding endpoints from -// a segment. These criteria derive from custom metrics that you define for -// endpoints. -type MetricDimension struct { - _ struct{} `type:"structure"` - - // The operator to use when comparing metric values. Valid values are: GREATER_THAN, - // LESS_THAN, GREATER_THAN_OR_EQUAL, LESS_THAN_OR_EQUAL, and EQUAL. - // - // ComparisonOperator is a required field - ComparisonOperator *string `type:"string" required:"true"` - - // The value to compare. - // - // Value is a required field - Value *float64 `type:"double" required:"true"` -} - -// 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() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MetricDimension) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MetricDimension"} - if s.ComparisonOperator == nil { - invalidParams.Add(request.NewErrParamRequired("ComparisonOperator")) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetIsArchived sets the IsArchived field's value. +func (s *SMSChannelResponse) SetIsArchived(v bool) *SMSChannelResponse { + s.IsArchived = &v + return s } -// SetComparisonOperator sets the ComparisonOperator field's value. -func (s *MetricDimension) SetComparisonOperator(v string) *MetricDimension { - s.ComparisonOperator = &v +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *SMSChannelResponse) SetLastModifiedBy(v string) *SMSChannelResponse { + s.LastModifiedBy = &v return s } -// SetValue sets the Value field's value. -func (s *MetricDimension) SetValue(v float64) *MetricDimension { - s.Value = &v +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *SMSChannelResponse) SetLastModifiedDate(v string) *SMSChannelResponse { + s.LastModifiedDate = &v return s } -// Specifies a phone number to validate and retrieve information about. -type NumberValidateRequest struct { - _ struct{} `type:"structure"` - - // The two-character code, in ISO 3166-1 alpha-2 format, for the country or - // region where the phone number was originally registered. - IsoCountryCode *string `type:"string"` +// SetPlatform sets the Platform field's value. +func (s *SMSChannelResponse) SetPlatform(v string) *SMSChannelResponse { + s.Platform = &v + return s +} - // The phone number to retrieve information about. The phone number that you - // provide should include a valid numeric country code. Otherwise, the operation - // might result in an error. - PhoneNumber *string `type:"string"` +// SetPromotionalMessagesPerSecond sets the PromotionalMessagesPerSecond field's value. +func (s *SMSChannelResponse) SetPromotionalMessagesPerSecond(v int64) *SMSChannelResponse { + s.PromotionalMessagesPerSecond = &v + return s } -// String returns the string representation -func (s NumberValidateRequest) String() string { - return awsutil.Prettify(s) +// SetSenderId sets the SenderId field's value. +func (s *SMSChannelResponse) SetSenderId(v string) *SMSChannelResponse { + s.SenderId = &v + return s } -// GoString returns the string representation -func (s NumberValidateRequest) GoString() string { - return s.String() +// SetShortCode sets the ShortCode field's value. +func (s *SMSChannelResponse) SetShortCode(v string) *SMSChannelResponse { + s.ShortCode = &v + return s } -// SetIsoCountryCode sets the IsoCountryCode field's value. -func (s *NumberValidateRequest) SetIsoCountryCode(v string) *NumberValidateRequest { - s.IsoCountryCode = &v +// SetTransactionalMessagesPerSecond sets the TransactionalMessagesPerSecond field's value. +func (s *SMSChannelResponse) SetTransactionalMessagesPerSecond(v int64) *SMSChannelResponse { + s.TransactionalMessagesPerSecond = &v return s } -// SetPhoneNumber sets the PhoneNumber field's value. -func (s *NumberValidateRequest) SetPhoneNumber(v string) *NumberValidateRequest { - s.PhoneNumber = &v +// SetVersion sets the Version field's value. +func (s *SMSChannelResponse) SetVersion(v int64) *SMSChannelResponse { + s.Version = &v return s } -// Provides information about a phone number. -type NumberValidateResponse struct { +// Specifies the default settings for a one-time SMS message that's sent directly +// to an endpoint. +type SMSMessage struct { _ struct{} `type:"structure"` - // The carrier or service provider that the phone number is currently registered - // with. In some countries and regions, this value may be the carrier or service - // provider that the phone number was originally registered with. - Carrier *string `type:"string"` - - // The name of the city where the phone number was originally registered. - City *string `type:"string"` - - // The cleansed phone number, in E.164 format, for the location where the phone - // number was originally registered. - CleansedPhoneNumberE164 *string `type:"string"` - - // The cleansed phone number, in the format for the location where the phone - // number was originally registered. - CleansedPhoneNumberNational *string `type:"string"` - - // The name of the country or region where the phone number was originally registered. - Country *string `type:"string"` - - // The two-character code, in ISO 3166-1 alpha-2 format, for the country or - // region where the phone number was originally registered. - CountryCodeIso2 *string `type:"string"` - - // The numeric code for the country or region where the phone number was originally - // registered. - CountryCodeNumeric *string `type:"string"` - - // The name of the county where the phone number was originally registered. - County *string `type:"string"` - - // The two-character code, in ISO 3166-1 alpha-2 format, that was sent in the - // request body. - OriginalCountryCodeIso2 *string `type:"string"` + // The body of the SMS message. + Body *string `type:"string"` - // The phone number that was sent in the request body. - OriginalPhoneNumber *string `type:"string"` + // The SMS program name that you provided to AWS Support when you requested + // your dedicated number. + Keyword *string `type:"string"` - // The description of the phone type. Valid values are: MOBILE, LANDLINE, VOIP, - // INVALID, PREPAID, and OTHER. - PhoneType *string `type:"string"` + // The SMS message type. Valid values are: TRANSACTIONAL, the message is critical + // or time-sensitive, such as a one-time password that supports a customer transaction; + // and, PROMOTIONAL, the message is not critical or time-sensitive, such as + // a marketing message. + MessageType *string `type:"string" enum:"MessageType"` - // The phone type, represented by an integer. Valid values are: 0 (mobile), - // 1 (landline), 2 (VoIP), 3 (invalid), 4 (other), and 5 (prepaid). - PhoneTypeCode *int64 `type:"integer"` + // The number to send the SMS message from. This value should be one of the + // dedicated long or short codes that's assigned to your AWS account. If you + // don't specify a long or short code, Amazon Pinpoint assigns a random long + // code to the SMS message and sends the message from that code. + OriginationNumber *string `type:"string"` - // The time zone for the location where the phone number was originally registered. - Timezone *string `type:"string"` + // The sender ID to display as the sender of the message on a recipient's device. + // Support for sender IDs varies by country or region. + SenderId *string `type:"string"` - // The postal or ZIP code for the location where the phone number was originally - // registered. - ZipCode *string `type:"string"` + // The message variables to use in the SMS message. You can override the default + // variables with individual address variables. + Substitutions map[string][]*string `type:"map"` } // String returns the string representation -func (s NumberValidateResponse) String() string { +func (s SMSMessage) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s NumberValidateResponse) GoString() string { +func (s SMSMessage) GoString() string { return s.String() } -// SetCarrier sets the Carrier field's value. -func (s *NumberValidateResponse) SetCarrier(v string) *NumberValidateResponse { - s.Carrier = &v +// SetBody sets the Body field's value. +func (s *SMSMessage) SetBody(v string) *SMSMessage { + s.Body = &v return s } -// SetCity sets the City field's value. -func (s *NumberValidateResponse) SetCity(v string) *NumberValidateResponse { - s.City = &v +// SetKeyword sets the Keyword field's value. +func (s *SMSMessage) SetKeyword(v string) *SMSMessage { + s.Keyword = &v return s } -// SetCleansedPhoneNumberE164 sets the CleansedPhoneNumberE164 field's value. -func (s *NumberValidateResponse) SetCleansedPhoneNumberE164(v string) *NumberValidateResponse { - s.CleansedPhoneNumberE164 = &v +// SetMessageType sets the MessageType field's value. +func (s *SMSMessage) SetMessageType(v string) *SMSMessage { + s.MessageType = &v return s } -// SetCleansedPhoneNumberNational sets the CleansedPhoneNumberNational field's value. -func (s *NumberValidateResponse) SetCleansedPhoneNumberNational(v string) *NumberValidateResponse { - s.CleansedPhoneNumberNational = &v +// SetOriginationNumber sets the OriginationNumber field's value. +func (s *SMSMessage) SetOriginationNumber(v string) *SMSMessage { + s.OriginationNumber = &v return s } -// SetCountry sets the Country field's value. -func (s *NumberValidateResponse) SetCountry(v string) *NumberValidateResponse { - s.Country = &v +// SetSenderId sets the SenderId field's value. +func (s *SMSMessage) SetSenderId(v string) *SMSMessage { + s.SenderId = &v return s } -// SetCountryCodeIso2 sets the CountryCodeIso2 field's value. -func (s *NumberValidateResponse) SetCountryCodeIso2(v string) *NumberValidateResponse { - s.CountryCodeIso2 = &v +// SetSubstitutions sets the Substitutions field's value. +func (s *SMSMessage) SetSubstitutions(v map[string][]*string) *SMSMessage { + s.Substitutions = v return s } -// SetCountryCodeNumeric sets the CountryCodeNumeric field's value. -func (s *NumberValidateResponse) SetCountryCodeNumeric(v string) *NumberValidateResponse { - s.CountryCodeNumeric = &v - return s -} +// Specifies the content and settings for a message template that can be used +// in text messages that are sent through the SMS channel. +type SMSTemplateRequest struct { + _ struct{} `type:"structure"` -// SetCounty sets the County field's value. -func (s *NumberValidateResponse) SetCounty(v string) *NumberValidateResponse { - s.County = &v - return s + // The message body to use in text messages that are based on the message template. + Body *string `type:"string"` + + // A JSON object that specifies the default values to use for message variables + // in the message template. This object is a set of key-value pairs. Each key + // defines a message variable in the template. The corresponding value defines + // the default value for that variable. When you create a message that's based + // on the template, you can override these defaults with message-specific and + // address-specific variables and values. + DefaultSubstitutions *string `type:"string"` + + // A string-to-string map of key-value pairs that defines the tags to associate + // with the message template. Each tag consists of a required tag key and an + // associated tag value. + Tags map[string]*string `locationName:"tags" type:"map"` + + // A custom description of the message template. + TemplateDescription *string `type:"string"` } -// SetOriginalCountryCodeIso2 sets the OriginalCountryCodeIso2 field's value. -func (s *NumberValidateResponse) SetOriginalCountryCodeIso2(v string) *NumberValidateResponse { - s.OriginalCountryCodeIso2 = &v - return s +// String returns the string representation +func (s SMSTemplateRequest) String() string { + return awsutil.Prettify(s) } -// SetOriginalPhoneNumber sets the OriginalPhoneNumber field's value. -func (s *NumberValidateResponse) SetOriginalPhoneNumber(v string) *NumberValidateResponse { - s.OriginalPhoneNumber = &v - return s +// GoString returns the string representation +func (s SMSTemplateRequest) GoString() string { + return s.String() } -// SetPhoneType sets the PhoneType field's value. -func (s *NumberValidateResponse) SetPhoneType(v string) *NumberValidateResponse { - s.PhoneType = &v +// SetBody sets the Body field's value. +func (s *SMSTemplateRequest) SetBody(v string) *SMSTemplateRequest { + s.Body = &v return s } -// SetPhoneTypeCode sets the PhoneTypeCode field's value. -func (s *NumberValidateResponse) SetPhoneTypeCode(v int64) *NumberValidateResponse { - s.PhoneTypeCode = &v +// SetDefaultSubstitutions sets the DefaultSubstitutions field's value. +func (s *SMSTemplateRequest) SetDefaultSubstitutions(v string) *SMSTemplateRequest { + s.DefaultSubstitutions = &v return s } -// SetTimezone sets the Timezone field's value. -func (s *NumberValidateResponse) SetTimezone(v string) *NumberValidateResponse { - s.Timezone = &v +// SetTags sets the Tags field's value. +func (s *SMSTemplateRequest) SetTags(v map[string]*string) *SMSTemplateRequest { + s.Tags = v return s } -// SetZipCode sets the ZipCode field's value. -func (s *NumberValidateResponse) SetZipCode(v string) *NumberValidateResponse { - s.ZipCode = &v +// SetTemplateDescription sets the TemplateDescription field's value. +func (s *SMSTemplateRequest) SetTemplateDescription(v string) *SMSTemplateRequest { + s.TemplateDescription = &v return s } -type PhoneNumberValidateInput struct { - _ struct{} `type:"structure" payload:"NumberValidateRequest"` +// Provides information about the content and settings for a message template +// that can be used in text messages that are sent through the SMS channel. +type SMSTemplateResponse struct { + _ struct{} `type:"structure"` - // Specifies a phone number to validate and retrieve information about. + // The Amazon Resource Name (ARN) of the message template. + Arn *string `type:"string"` + + // The message body that's used in text messages that are based on the message + // template. + Body *string `type:"string"` + + // The date, in ISO 8601 format, when the message template was created. // - // NumberValidateRequest is a required field - NumberValidateRequest *NumberValidateRequest `type:"structure" required:"true"` + // CreationDate is a required field + CreationDate *string `type:"string" required:"true"` + + // The JSON object that specifies the default values that are used for message + // variables in the message template. This object is a set of key-value pairs. + // Each key defines a message variable in the template. The corresponding value + // defines the default value for that variable. + DefaultSubstitutions *string `type:"string"` + + // The date, in ISO 8601 format, when the message template was last modified. + // + // LastModifiedDate is a required field + LastModifiedDate *string `type:"string" required:"true"` + + // A string-to-string map of key-value pairs that identifies the tags that are + // associated with the message template. Each tag consists of a required tag + // key and an associated tag value. + Tags map[string]*string `locationName:"tags" type:"map"` + + // The custom description of the message template. + TemplateDescription *string `type:"string"` + + // The name of the message template. + // + // TemplateName is a required field + TemplateName *string `type:"string" required:"true"` + + // The type of channel that the message template is designed for. For an SMS + // template, this value is SMS. + // + // TemplateType is a required field + TemplateType *string `type:"string" required:"true" enum:"TemplateType"` + + // The unique identifier, as an integer, for the active version of the message + // template, or the version of the template that you specified by using the + // version parameter in your request. + Version *string `type:"string"` } // String returns the string representation -func (s PhoneNumberValidateInput) String() string { +func (s SMSTemplateResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PhoneNumberValidateInput) GoString() string { +func (s SMSTemplateResponse) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *PhoneNumberValidateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PhoneNumberValidateInput"} - if s.NumberValidateRequest == nil { - invalidParams.Add(request.NewErrParamRequired("NumberValidateRequest")) - } +// SetArn sets the Arn field's value. +func (s *SMSTemplateResponse) SetArn(v string) *SMSTemplateResponse { + s.Arn = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetBody sets the Body field's value. +func (s *SMSTemplateResponse) SetBody(v string) *SMSTemplateResponse { + s.Body = &v + return s } -// SetNumberValidateRequest sets the NumberValidateRequest field's value. -func (s *PhoneNumberValidateInput) SetNumberValidateRequest(v *NumberValidateRequest) *PhoneNumberValidateInput { - s.NumberValidateRequest = v +// SetCreationDate sets the CreationDate field's value. +func (s *SMSTemplateResponse) SetCreationDate(v string) *SMSTemplateResponse { + s.CreationDate = &v + return s +} + +// SetDefaultSubstitutions sets the DefaultSubstitutions field's value. +func (s *SMSTemplateResponse) SetDefaultSubstitutions(v string) *SMSTemplateResponse { + s.DefaultSubstitutions = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *SMSTemplateResponse) SetLastModifiedDate(v string) *SMSTemplateResponse { + s.LastModifiedDate = &v return s } -type PhoneNumberValidateOutput struct { - _ struct{} `type:"structure" payload:"NumberValidateResponse"` +// SetTags sets the Tags field's value. +func (s *SMSTemplateResponse) SetTags(v map[string]*string) *SMSTemplateResponse { + s.Tags = v + return s +} - // Provides information about a phone number. - // - // NumberValidateResponse is a required field - NumberValidateResponse *NumberValidateResponse `type:"structure" required:"true"` +// SetTemplateDescription sets the TemplateDescription field's value. +func (s *SMSTemplateResponse) SetTemplateDescription(v string) *SMSTemplateResponse { + s.TemplateDescription = &v + return s } -// String returns the string representation -func (s PhoneNumberValidateOutput) String() string { - return awsutil.Prettify(s) +// SetTemplateName sets the TemplateName field's value. +func (s *SMSTemplateResponse) SetTemplateName(v string) *SMSTemplateResponse { + s.TemplateName = &v + return s } -// GoString returns the string representation -func (s PhoneNumberValidateOutput) GoString() string { - return s.String() +// SetTemplateType sets the TemplateType field's value. +func (s *SMSTemplateResponse) SetTemplateType(v string) *SMSTemplateResponse { + s.TemplateType = &v + return s } -// SetNumberValidateResponse sets the NumberValidateResponse field's value. -func (s *PhoneNumberValidateOutput) SetNumberValidateResponse(v *NumberValidateResponse) *PhoneNumberValidateOutput { - s.NumberValidateResponse = v +// SetVersion sets the Version field's value. +func (s *SMSTemplateResponse) SetVersion(v string) *SMSTemplateResponse { + s.Version = &v return s } -// Specifies the properties and attributes of an endpoint that's associated -// with an event. -type PublicEndpoint struct { +// Specifies the schedule settings for a campaign. +type Schedule struct { _ struct{} `type:"structure"` - // The unique identifier for the recipient, such as a device token, email address, - // or mobile phone number. - Address *string `type:"string"` - - // One or more custom attributes that describe the endpoint by associating a - // name with an array of values. You can use these attributes as filter criteria - // when you create segments. - Attributes map[string][]*string `type:"map"` - - // The channel that's used when sending messages or push notifications to the - // endpoint. - ChannelType *string `type:"string" enum:"ChannelType"` - - // The demographic information for the endpoint, such as the time zone and platform. - Demographic *EndpointDemographic `type:"structure"` - - // The date and time, in ISO 8601 format, when the endpoint was last updated. - EffectiveDate *string `type:"string"` + // The scheduled time, in ISO 8601 format, when the campaign ended or will end. + EndTime *string `type:"string"` - // The status of the update request for the endpoint. Possible values are: INACTIVE, - // the update failed; and, ACTIVE, the endpoint was updated successfully. - EndpointStatus *string `type:"string"` + // The type of event that causes the campaign to be sent, if the value of the + // Frequency property is EVENT. + EventFilter *CampaignEventFilter `type:"structure"` - // The geographic information for the endpoint. - Location *EndpointLocation `type:"structure"` + // Specifies how often the campaign is sent or whether the campaign is sent + // in response to a specific event. + Frequency *string `type:"string" enum:"Frequency"` - // One or more custom metrics that your app reports to Amazon Pinpoint for the - // endpoint. - Metrics map[string]*float64 `type:"map"` + // Specifies whether the start and end times for the campaign schedule use each + // recipient's local time. To base the schedule on each recipient's local time, + // set this value to true. + IsLocalTime *bool `type:"boolean"` - // Specifies whether the user who's associated with the endpoint has opted out - // of receiving messages and push notifications from you. Possible values are: - // ALL, the user has opted out and doesn't want to receive any messages or push - // notifications; and, NONE, the user hasn't opted out and wants to receive - // all messages and push notifications. - OptOut *string `type:"string"` + // The default quiet time for the campaign. Quiet time is a specific time range + // when a campaign doesn't send messages to endpoints, if all the following + // conditions are met: + // + // * The EndpointDemographic.Timezone property of the endpoint is set to + // a valid value. + // + // * The current time in the endpoint's time zone is later than or equal + // to the time specified by the QuietTime.Start property for the campaign. + // + // * The current time in the endpoint's time zone is earlier than or equal + // to the time specified by the QuietTime.End property for the campaign. + // + // If any of the preceding conditions isn't met, the endpoint will receive messages + // from the campaign, even if quiet time is enabled. + QuietTime *QuietTime `type:"structure"` - // A unique identifier that's generated each time the endpoint is updated. - RequestId *string `type:"string"` + // The scheduled time, in ISO 8601 format, when the campaign began or will begin. + // + // StartTime is a required field + StartTime *string `type:"string" required:"true"` - // One or more custom user attributes that your app reports to Amazon Pinpoint - // for the user who's associated with the endpoint. - User *EndpointUser `type:"structure"` + // The starting UTC offset for the campaign schedule, if the value of the IsLocalTime + // property is true. Valid values are: UTC, UTC+01, UTC+02, UTC+03, UTC+03:30, + // UTC+04, UTC+04:30, UTC+05, UTC+05:30, UTC+05:45, UTC+06, UTC+06:30, UTC+07, + // UTC+08, UTC+09, UTC+09:30, UTC+10, UTC+10:30, UTC+11, UTC+12, UTC+13, UTC-02, + // UTC-03, UTC-04, UTC-05, UTC-06, UTC-07, UTC-08, UTC-09, UTC-10, and UTC-11. + Timezone *string `type:"string"` } // String returns the string representation -func (s PublicEndpoint) String() string { +func (s Schedule) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PublicEndpoint) GoString() string { +func (s Schedule) GoString() string { return s.String() } -// SetAddress sets the Address field's value. -func (s *PublicEndpoint) SetAddress(v string) *PublicEndpoint { - s.Address = &v - return s -} - -// SetAttributes sets the Attributes field's value. -func (s *PublicEndpoint) SetAttributes(v map[string][]*string) *PublicEndpoint { - s.Attributes = v - return s -} - -// SetChannelType sets the ChannelType field's value. -func (s *PublicEndpoint) SetChannelType(v string) *PublicEndpoint { - s.ChannelType = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *Schedule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Schedule"} + if s.StartTime == nil { + invalidParams.Add(request.NewErrParamRequired("StartTime")) + } + if s.EventFilter != nil { + if err := s.EventFilter.Validate(); err != nil { + invalidParams.AddNested("EventFilter", err.(request.ErrInvalidParams)) + } + } -// SetDemographic sets the Demographic field's value. -func (s *PublicEndpoint) SetDemographic(v *EndpointDemographic) *PublicEndpoint { - s.Demographic = v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetEffectiveDate sets the EffectiveDate field's value. -func (s *PublicEndpoint) SetEffectiveDate(v string) *PublicEndpoint { - s.EffectiveDate = &v +// SetEndTime sets the EndTime field's value. +func (s *Schedule) SetEndTime(v string) *Schedule { + s.EndTime = &v return s } -// SetEndpointStatus sets the EndpointStatus field's value. -func (s *PublicEndpoint) SetEndpointStatus(v string) *PublicEndpoint { - s.EndpointStatus = &v +// SetEventFilter sets the EventFilter field's value. +func (s *Schedule) SetEventFilter(v *CampaignEventFilter) *Schedule { + s.EventFilter = v return s } -// SetLocation sets the Location field's value. -func (s *PublicEndpoint) SetLocation(v *EndpointLocation) *PublicEndpoint { - s.Location = v +// SetFrequency sets the Frequency field's value. +func (s *Schedule) SetFrequency(v string) *Schedule { + s.Frequency = &v return s } -// SetMetrics sets the Metrics field's value. -func (s *PublicEndpoint) SetMetrics(v map[string]*float64) *PublicEndpoint { - s.Metrics = v +// SetIsLocalTime sets the IsLocalTime field's value. +func (s *Schedule) SetIsLocalTime(v bool) *Schedule { + s.IsLocalTime = &v return s } -// SetOptOut sets the OptOut field's value. -func (s *PublicEndpoint) SetOptOut(v string) *PublicEndpoint { - s.OptOut = &v +// SetQuietTime sets the QuietTime field's value. +func (s *Schedule) SetQuietTime(v *QuietTime) *Schedule { + s.QuietTime = v return s } -// SetRequestId sets the RequestId field's value. -func (s *PublicEndpoint) SetRequestId(v string) *PublicEndpoint { - s.RequestId = &v +// SetStartTime sets the StartTime field's value. +func (s *Schedule) SetStartTime(v string) *Schedule { + s.StartTime = &v return s } -// SetUser sets the User field's value. -func (s *PublicEndpoint) SetUser(v *EndpointUser) *PublicEndpoint { - s.User = v +// SetTimezone sets the Timezone field's value. +func (s *Schedule) SetTimezone(v string) *Schedule { + s.Timezone = &v return s } -type PutEventStreamInput struct { - _ struct{} `type:"structure" payload:"WriteEventStream"` - - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +// Specifies dimension settings for including or excluding endpoints from a +// segment based on how recently an endpoint was active. +type SegmentBehaviors struct { + _ struct{} `type:"structure"` - // Specifies the Amazon Resource Name (ARN) of an event stream to publish events - // to and the AWS Identity and Access Management (IAM) role to use when publishing - // those events. - // - // WriteEventStream is a required field - WriteEventStream *WriteEventStream `type:"structure" required:"true"` + // The dimension settings that are based on how recently an endpoint was active. + Recency *RecencyDimension `type:"structure"` } // String returns the string representation -func (s PutEventStreamInput) String() string { +func (s SegmentBehaviors) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutEventStreamInput) GoString() string { +func (s SegmentBehaviors) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *PutEventStreamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutEventStreamInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.WriteEventStream == nil { - invalidParams.Add(request.NewErrParamRequired("WriteEventStream")) - } - if s.WriteEventStream != nil { - if err := s.WriteEventStream.Validate(); err != nil { - invalidParams.AddNested("WriteEventStream", err.(request.ErrInvalidParams)) +func (s *SegmentBehaviors) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SegmentBehaviors"} + if s.Recency != nil { + if err := s.Recency.Validate(); err != nil { + invalidParams.AddNested("Recency", err.(request.ErrInvalidParams)) } } @@ -19346,81 +27225,117 @@ func (s *PutEventStreamInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *PutEventStreamInput) SetApplicationId(v string) *PutEventStreamInput { - s.ApplicationId = &v - return s -} - -// SetWriteEventStream sets the WriteEventStream field's value. -func (s *PutEventStreamInput) SetWriteEventStream(v *WriteEventStream) *PutEventStreamInput { - s.WriteEventStream = v +// SetRecency sets the Recency field's value. +func (s *SegmentBehaviors) SetRecency(v *RecencyDimension) *SegmentBehaviors { + s.Recency = v return s } -type PutEventStreamOutput struct { - _ struct{} `type:"structure" payload:"EventStream"` +// Specifies a segment to associate with an activity in a journey. +type SegmentCondition struct { + _ struct{} `type:"structure"` - // Specifies settings for publishing event data to an Amazon Kinesis data stream - // or an Amazon Kinesis Data Firehose delivery stream. + // The unique identifier for the segment to associate with the activity. // - // EventStream is a required field - EventStream *EventStream `type:"structure" required:"true"` + // SegmentId is a required field + SegmentId *string `type:"string" required:"true"` } // String returns the string representation -func (s PutEventStreamOutput) String() string { +func (s SegmentCondition) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutEventStreamOutput) GoString() string { +func (s SegmentCondition) GoString() string { return s.String() } -// SetEventStream sets the EventStream field's value. -func (s *PutEventStreamOutput) SetEventStream(v *EventStream) *PutEventStreamOutput { - s.EventStream = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *SegmentCondition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SegmentCondition"} + if s.SegmentId == nil { + invalidParams.Add(request.NewErrParamRequired("SegmentId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSegmentId sets the SegmentId field's value. +func (s *SegmentCondition) SetSegmentId(v string) *SegmentCondition { + s.SegmentId = &v return s } -type PutEventsInput struct { - _ struct{} `type:"structure" payload:"EventsRequest"` +// Specifies demographic-based dimension settings for including or excluding +// endpoints from a segment. These settings derive from characteristics of endpoint +// devices, such as platform, make, and model. +type SegmentDemographics struct { + _ struct{} `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The app version criteria for the segment. + AppVersion *SetDimension `type:"structure"` - // Specifies a batch of events to process. - // - // EventsRequest is a required field - EventsRequest *EventsRequest `type:"structure" required:"true"` + // The channel criteria for the segment. + Channel *SetDimension `type:"structure"` + + // The device type criteria for the segment. + DeviceType *SetDimension `type:"structure"` + + // The device make criteria for the segment. + Make *SetDimension `type:"structure"` + + // The device model criteria for the segment. + Model *SetDimension `type:"structure"` + + // The device platform criteria for the segment. + Platform *SetDimension `type:"structure"` } // String returns the string representation -func (s PutEventsInput) String() string { +func (s SegmentDemographics) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PutEventsInput) GoString() string { +func (s SegmentDemographics) 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.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) +func (s *SegmentDemographics) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SegmentDemographics"} + if s.AppVersion != nil { + if err := s.AppVersion.Validate(); err != nil { + invalidParams.AddNested("AppVersion", err.(request.ErrInvalidParams)) + } } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + if s.Channel != nil { + if err := s.Channel.Validate(); err != nil { + invalidParams.AddNested("Channel", err.(request.ErrInvalidParams)) + } } - if s.EventsRequest == nil { - invalidParams.Add(request.NewErrParamRequired("EventsRequest")) + if s.DeviceType != nil { + if err := s.DeviceType.Validate(); err != nil { + invalidParams.AddNested("DeviceType", err.(request.ErrInvalidParams)) + } } - if s.EventsRequest != nil { - if err := s.EventsRequest.Validate(); err != nil { - invalidParams.AddNested("EventsRequest", err.(request.ErrInvalidParams)) + if s.Make != nil { + if err := s.Make.Validate(); err != nil { + invalidParams.AddNested("Make", err.(request.ErrInvalidParams)) + } + } + if s.Model != nil { + if err := s.Model.Validate(); err != nil { + invalidParams.AddNested("Model", err.(request.ErrInvalidParams)) + } + } + if s.Platform != nil { + if err := s.Platform.Validate(); err != nil { + invalidParams.AddNested("Platform", err.(request.ErrInvalidParams)) } } @@ -19430,145 +27345,229 @@ func (s *PutEventsInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *PutEventsInput) SetApplicationId(v string) *PutEventsInput { - s.ApplicationId = &v +// SetAppVersion sets the AppVersion field's value. +func (s *SegmentDemographics) SetAppVersion(v *SetDimension) *SegmentDemographics { + s.AppVersion = v return s } -// SetEventsRequest sets the EventsRequest field's value. -func (s *PutEventsInput) SetEventsRequest(v *EventsRequest) *PutEventsInput { - s.EventsRequest = v +// SetChannel sets the Channel field's value. +func (s *SegmentDemographics) SetChannel(v *SetDimension) *SegmentDemographics { + s.Channel = v return s } -type PutEventsOutput struct { - _ struct{} `type:"structure" payload:"EventsResponse"` - - // Provides information about endpoints and the events that they're associated - // with. - // - // EventsResponse is a required field - EventsResponse *EventsResponse `type:"structure" required:"true"` +// SetDeviceType sets the DeviceType field's value. +func (s *SegmentDemographics) SetDeviceType(v *SetDimension) *SegmentDemographics { + s.DeviceType = v + return s } -// String returns the string representation -func (s PutEventsOutput) String() string { - return awsutil.Prettify(s) +// SetMake sets the Make field's value. +func (s *SegmentDemographics) SetMake(v *SetDimension) *SegmentDemographics { + s.Make = v + return s } -// GoString returns the string representation -func (s PutEventsOutput) GoString() string { - return s.String() +// SetModel sets the Model field's value. +func (s *SegmentDemographics) SetModel(v *SetDimension) *SegmentDemographics { + s.Model = v + return s } -// SetEventsResponse sets the EventsResponse field's value. -func (s *PutEventsOutput) SetEventsResponse(v *EventsResponse) *PutEventsOutput { - s.EventsResponse = v +// SetPlatform sets the Platform field's value. +func (s *SegmentDemographics) SetPlatform(v *SetDimension) *SegmentDemographics { + s.Platform = v return s } -// Specifies the start and end times that define a time range when messages -// aren't sent to endpoints. -type QuietTime struct { +// Specifies the dimension settings for a segment. +type SegmentDimensions struct { _ struct{} `type:"structure"` - // The specific time when quiet time ends. This value has to use 24-hour notation - // and be in HH:MM format, where HH is the hour (with a leading zero, if applicable) - // and MM is the minutes. For example, use 02:30 to represent 2:30 AM, or 14:30 - // to represent 2:30 PM. - End *string `type:"string"` + // One or more custom attributes to use as criteria for the segment. + Attributes map[string]*AttributeDimension `type:"map"` - // The specific time when quiet time begins. This value has to use 24-hour notation - // and be in HH:MM format, where HH is the hour (with a leading zero, if applicable) - // and MM is the minutes. For example, use 02:30 to represent 2:30 AM, or 14:30 - // to represent 2:30 PM. - Start *string `type:"string"` + // The behavior-based criteria, such as how recently users have used your app, + // for the segment. + Behavior *SegmentBehaviors `type:"structure"` + + // The demographic-based criteria, such as device platform, for the segment. + Demographic *SegmentDemographics `type:"structure"` + + // The location-based criteria, such as region or GPS coordinates, for the segment. + Location *SegmentLocation `type:"structure"` + + // One or more custom metrics to use as criteria for the segment. + Metrics map[string]*MetricDimension `type:"map"` + + // One or more custom user attributes to use as criteria for the segment. + UserAttributes map[string]*AttributeDimension `type:"map"` } // String returns the string representation -func (s QuietTime) String() string { +func (s SegmentDimensions) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s QuietTime) GoString() string { +func (s SegmentDimensions) GoString() string { return s.String() } -// SetEnd sets the End field's value. -func (s *QuietTime) SetEnd(v string) *QuietTime { - s.End = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *SegmentDimensions) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SegmentDimensions"} + 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.Behavior != nil { + if err := s.Behavior.Validate(); err != nil { + invalidParams.AddNested("Behavior", err.(request.ErrInvalidParams)) + } + } + if s.Demographic != nil { + if err := s.Demographic.Validate(); err != nil { + invalidParams.AddNested("Demographic", err.(request.ErrInvalidParams)) + } + } + if s.Location != nil { + if err := s.Location.Validate(); err != nil { + invalidParams.AddNested("Location", err.(request.ErrInvalidParams)) + } + } + if s.Metrics != nil { + for i, v := range s.Metrics { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Metrics", 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 } -// SetStart sets the Start field's value. -func (s *QuietTime) SetStart(v string) *QuietTime { - s.Start = &v +// SetAttributes sets the Attributes field's value. +func (s *SegmentDimensions) SetAttributes(v map[string]*AttributeDimension) *SegmentDimensions { + s.Attributes = v return s } -// Specifies the contents of an email message, represented as a raw MIME message. -type RawEmail struct { - _ struct{} `type:"structure"` +// SetBehavior sets the Behavior field's value. +func (s *SegmentDimensions) SetBehavior(v *SegmentBehaviors) *SegmentDimensions { + s.Behavior = v + return s +} - // Data is automatically base64 encoded/decoded by the SDK. - Data []byte `type:"blob"` +// SetDemographic sets the Demographic field's value. +func (s *SegmentDimensions) SetDemographic(v *SegmentDemographics) *SegmentDimensions { + s.Demographic = v + return s } -// String returns the string representation -func (s RawEmail) String() string { - return awsutil.Prettify(s) +// SetLocation sets the Location field's value. +func (s *SegmentDimensions) SetLocation(v *SegmentLocation) *SegmentDimensions { + s.Location = v + return s } -// GoString returns the string representation -func (s RawEmail) GoString() string { - return s.String() +// SetMetrics sets the Metrics field's value. +func (s *SegmentDimensions) SetMetrics(v map[string]*MetricDimension) *SegmentDimensions { + s.Metrics = v + return s } -// SetData sets the Data field's value. -func (s *RawEmail) SetData(v []byte) *RawEmail { - s.Data = v +// SetUserAttributes sets the UserAttributes field's value. +func (s *SegmentDimensions) SetUserAttributes(v map[string]*AttributeDimension) *SegmentDimensions { + s.UserAttributes = v return s } -// Specifies criteria for including or excluding endpoints from a segment based -// on how recently an endpoint was active. -type RecencyDimension struct { +// Specifies the base segments and dimensions for a segment, and the relationships +// between these base segments and dimensions. +type SegmentGroup struct { _ struct{} `type:"structure"` - // The duration to use when determining whether an endpoint is active or inactive. - // - // Duration is a required field - Duration *string `type:"string" required:"true" enum:"Duration"` + // An array that defines the dimensions for the segment. + Dimensions []*SegmentDimensions `type:"list"` - // The type of recency dimension to use for the segment. Valid values are: ACTIVE, - // endpoints that were active within the specified duration are included in - // the segment; and, INACTIVE, endpoints that weren't active within the specified - // duration are included in the segment. + // The base segment to build the segment on. A base segment, also referred to + // as a source segment, defines the initial population of endpoints for a segment. + // When you add dimensions to a segment, Amazon Pinpoint filters the base segment + // by using the dimensions that you specify. // - // RecencyType is a required field - RecencyType *string `type:"string" required:"true" enum:"RecencyType"` + // You can specify more than one dimensional segment or only one imported segment. + // If you specify an imported segment, the Amazon Pinpoint console displays + // a segment size estimate that indicates the size of the imported segment without + // any filters applied to it. + SourceSegments []*SegmentReference `type:"list"` + + // Specifies how to handle multiple base segments for the segment. For example, + // if you specify three base segments for the segment, whether the resulting + // segment is based on all, any, or none of the base segments. + SourceType *string `type:"string" enum:"SourceType"` + + // Specifies how to handle multiple dimensions for the segment. For example, + // if you specify three dimensions for the segment, whether the resulting segment + // includes endpoints that match all, any, or none of the dimensions. + Type *string `type:"string" enum:"Type"` } // String returns the string representation -func (s RecencyDimension) String() string { +func (s SegmentGroup) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RecencyDimension) GoString() string { +func (s SegmentGroup) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *RecencyDimension) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RecencyDimension"} - if s.Duration == nil { - invalidParams.Add(request.NewErrParamRequired("Duration")) +func (s *SegmentGroup) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SegmentGroup"} + 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.RecencyType == nil { - invalidParams.Add(request.NewErrParamRequired("RecencyType")) + if s.SourceSegments != nil { + for i, v := range s.SourceSegments { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SourceSegments", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -19577,61 +27576,67 @@ func (s *RecencyDimension) Validate() error { return nil } -// SetDuration sets the Duration field's value. -func (s *RecencyDimension) SetDuration(v string) *RecencyDimension { - s.Duration = &v +// SetDimensions sets the Dimensions field's value. +func (s *SegmentGroup) SetDimensions(v []*SegmentDimensions) *SegmentGroup { + s.Dimensions = v return s } -// SetRecencyType sets the RecencyType field's value. -func (s *RecencyDimension) SetRecencyType(v string) *RecencyDimension { - s.RecencyType = &v +// SetSourceSegments sets the SourceSegments field's value. +func (s *SegmentGroup) SetSourceSegments(v []*SegmentReference) *SegmentGroup { + s.SourceSegments = v return s } -type RemoveAttributesInput struct { - _ struct{} `type:"structure" payload:"UpdateAttributesRequest"` +// SetSourceType sets the SourceType field's value. +func (s *SegmentGroup) SetSourceType(v string) *SegmentGroup { + s.SourceType = &v + return s +} - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +// SetType sets the Type field's value. +func (s *SegmentGroup) SetType(v string) *SegmentGroup { + s.Type = &v + return s +} - // AttributeType is a required field - AttributeType *string `location:"uri" locationName:"attribute-type" type:"string" required:"true"` +// Specifies the settings that define the relationships between segment groups +// for a segment. +type SegmentGroupList struct { + _ struct{} `type:"structure"` - // Specifies one or more attributes to remove from all the endpoints that are - // associated with an application. - // - // UpdateAttributesRequest is a required field - UpdateAttributesRequest *UpdateAttributesRequest `type:"structure" required:"true"` + // An array that defines the set of segment criteria to evaluate when handling + // segment groups for the segment. + Groups []*SegmentGroup `type:"list"` + + // Specifies how to handle multiple segment groups for the segment. For example, + // if the segment includes three segment groups, whether the resulting segment + // includes endpoints that match all, any, or none of the segment groups. + Include *string `type:"string" enum:"Include"` } // String returns the string representation -func (s RemoveAttributesInput) String() string { +func (s SegmentGroupList) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RemoveAttributesInput) GoString() string { +func (s SegmentGroupList) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveAttributesInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.AttributeType == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeType")) - } - if s.AttributeType != nil && len(*s.AttributeType) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributeType", 1)) - } - if s.UpdateAttributesRequest == nil { - invalidParams.Add(request.NewErrParamRequired("UpdateAttributesRequest")) +func (s *SegmentGroupList) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SegmentGroupList"} + if s.Groups != nil { + for i, v := range s.Groups { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Groups", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -19640,486 +27645,529 @@ func (s *RemoveAttributesInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *RemoveAttributesInput) SetApplicationId(v string) *RemoveAttributesInput { - s.ApplicationId = &v +// SetGroups sets the Groups field's value. +func (s *SegmentGroupList) SetGroups(v []*SegmentGroup) *SegmentGroupList { + s.Groups = v return s } -// SetAttributeType sets the AttributeType field's value. -func (s *RemoveAttributesInput) SetAttributeType(v string) *RemoveAttributesInput { - s.AttributeType = &v +// SetInclude sets the Include field's value. +func (s *SegmentGroupList) SetInclude(v string) *SegmentGroupList { + s.Include = &v return s } -// SetUpdateAttributesRequest sets the UpdateAttributesRequest field's value. -func (s *RemoveAttributesInput) SetUpdateAttributesRequest(v *UpdateAttributesRequest) *RemoveAttributesInput { - s.UpdateAttributesRequest = v - return s -} +// Provides information about the import job that created a segment. An import +// job is a job that creates a user segment by importing endpoint definitions. +type SegmentImportResource struct { + _ struct{} `type:"structure"` -type RemoveAttributesOutput struct { - _ struct{} `type:"structure" payload:"AttributesResource"` + // The number of channel types in the endpoint definitions that were imported + // to create the segment. + ChannelCounts map[string]*int64 `type:"map"` - // Provides information about the type and the names of attributes that were - // removed from all the endpoints that are associated with an application. + // (Deprecated) Your AWS account ID, which you assigned to an external ID key + // in an IAM trust policy. Amazon Pinpoint previously used this value to assume + // an IAM role when importing endpoint definitions, but we removed this requirement. + // We don't recommend use of external IDs for IAM roles that are assumed by + // Amazon Pinpoint. // - // AttributesResource is a required field - AttributesResource *AttributesResource `type:"structure" required:"true"` + // ExternalId is a required field + ExternalId *string `type:"string" required:"true"` + + // The format of the files that were imported to create the segment. Valid values + // are: CSV, for comma-separated values format; and, JSON, for newline-delimited + // JSON format. + // + // Format is a required field + Format *string `type:"string" required:"true" enum:"Format"` + + // The Amazon Resource Name (ARN) of the AWS Identity and Access Management + // (IAM) role that authorized Amazon Pinpoint to access the Amazon S3 location + // to import endpoint definitions from. + // + // RoleArn is a required field + RoleArn *string `type:"string" required:"true"` + + // The URL of the Amazon Simple Storage Service (Amazon S3) bucket that the + // endpoint definitions were imported from to create the segment. + // + // S3Url is a required field + S3Url *string `type:"string" required:"true"` + + // The number of endpoint definitions that were imported successfully to create + // the segment. + // + // Size is a required field + Size *int64 `type:"integer" required:"true"` } // String returns the string representation -func (s RemoveAttributesOutput) String() string { +func (s SegmentImportResource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RemoveAttributesOutput) GoString() string { +func (s SegmentImportResource) GoString() string { return s.String() } -// SetAttributesResource sets the AttributesResource field's value. -func (s *RemoveAttributesOutput) SetAttributesResource(v *AttributesResource) *RemoveAttributesOutput { - s.AttributesResource = v +// SetChannelCounts sets the ChannelCounts field's value. +func (s *SegmentImportResource) SetChannelCounts(v map[string]*int64) *SegmentImportResource { + s.ChannelCounts = v return s } -// Provides the results of a query that retrieved the data for a standard metric -// that applies to an application or campaign. -type ResultRow struct { - _ struct{} `type:"structure"` - - // An array of objects that defines the field and field values that were used - // to group data in a result set that contains multiple results. This value - // is null if the data in a result set isn’t grouped. - // - // GroupedBys is a required field - GroupedBys []*ResultRowValue `type:"list" required:"true"` - - // An array of objects that provides pre-aggregated values for a standard metric - // that applies to an application or campaign. - // - // Values is a required field - Values []*ResultRowValue `type:"list" required:"true"` +// SetExternalId sets the ExternalId field's value. +func (s *SegmentImportResource) SetExternalId(v string) *SegmentImportResource { + s.ExternalId = &v + return s } -// String returns the string representation -func (s ResultRow) String() string { - return awsutil.Prettify(s) +// SetFormat sets the Format field's value. +func (s *SegmentImportResource) SetFormat(v string) *SegmentImportResource { + s.Format = &v + return s } -// GoString returns the string representation -func (s ResultRow) GoString() string { - return s.String() +// SetRoleArn sets the RoleArn field's value. +func (s *SegmentImportResource) SetRoleArn(v string) *SegmentImportResource { + s.RoleArn = &v + return s } -// SetGroupedBys sets the GroupedBys field's value. -func (s *ResultRow) SetGroupedBys(v []*ResultRowValue) *ResultRow { - s.GroupedBys = v +// SetS3Url sets the S3Url field's value. +func (s *SegmentImportResource) SetS3Url(v string) *SegmentImportResource { + s.S3Url = &v return s } - -// SetValues sets the Values field's value. -func (s *ResultRow) SetValues(v []*ResultRowValue) *ResultRow { - s.Values = v + +// SetSize sets the Size field's value. +func (s *SegmentImportResource) SetSize(v int64) *SegmentImportResource { + s.Size = &v return s } -// Provides a single value and metadata about that value as part of an array -// of query results for a standard metric that applies to an application or -// campaign. -type ResultRowValue struct { +// Specifies geographical dimension settings for a segment. +type SegmentLocation struct { _ struct{} `type:"structure"` - // The name of the field that Amazon Pinpoint uses to store the value specified - // by the Value property. - // - // Key is a required field - Key *string `type:"string" required:"true"` - - // The data type of the value specified by the Value property. - // - // Type is a required field - Type *string `type:"string" required:"true"` + // The country or region code, in ISO 3166-1 alpha-2 format, for the segment. + Country *SetDimension `type:"structure"` - // In a Values object, the value for the metric that the query retrieved data - // for. In a GroupedBys object, the value for the field that was used to group - // data in a result set that contains multiple results (Values objects). - // - // Value is a required field - Value *string `type:"string" required:"true"` + // The GPS location and range for the segment. + GPSPoint *GPSPointDimension `type:"structure"` } // String returns the string representation -func (s ResultRowValue) String() string { +func (s SegmentLocation) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ResultRowValue) GoString() string { +func (s SegmentLocation) GoString() string { return s.String() } -// SetKey sets the Key field's value. -func (s *ResultRowValue) SetKey(v string) *ResultRowValue { - s.Key = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *SegmentLocation) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SegmentLocation"} + if s.Country != nil { + if err := s.Country.Validate(); err != nil { + invalidParams.AddNested("Country", err.(request.ErrInvalidParams)) + } + } + if s.GPSPoint != nil { + if err := s.GPSPoint.Validate(); err != nil { + invalidParams.AddNested("GPSPoint", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetType sets the Type field's value. -func (s *ResultRowValue) SetType(v string) *ResultRowValue { - s.Type = &v +// SetCountry sets the Country field's value. +func (s *SegmentLocation) SetCountry(v *SetDimension) *SegmentLocation { + s.Country = v return s } -// SetValue sets the Value field's value. -func (s *ResultRowValue) SetValue(v string) *ResultRowValue { - s.Value = &v +// SetGPSPoint sets the GPSPoint field's value. +func (s *SegmentLocation) SetGPSPoint(v *GPSPointDimension) *SegmentLocation { + s.GPSPoint = v return s } -// Specifies the status and settings of the SMS channel for an application. -type SMSChannelRequest struct { +// Specifies the segment identifier and version of a segment. +type SegmentReference struct { _ struct{} `type:"structure"` - // Specifies whether to enable the SMS channel for the application. - Enabled *bool `type:"boolean"` - - // The identity that you want to display on recipients' devices when they receive - // messages from the SMS channel. - SenderId *string `type:"string"` + // The unique identifier for the segment. + // + // Id is a required field + Id *string `type:"string" required:"true"` - // The registered short code that you want to use when you send messages through - // the SMS channel. - ShortCode *string `type:"string"` + // The version number of the segment. + Version *int64 `type:"integer"` } // String returns the string representation -func (s SMSChannelRequest) String() string { +func (s SegmentReference) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SMSChannelRequest) GoString() string { +func (s SegmentReference) GoString() string { return s.String() } -// SetEnabled sets the Enabled field's value. -func (s *SMSChannelRequest) SetEnabled(v bool) *SMSChannelRequest { - s.Enabled = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *SegmentReference) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SegmentReference"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetSenderId sets the SenderId field's value. -func (s *SMSChannelRequest) SetSenderId(v string) *SMSChannelRequest { - s.SenderId = &v +// SetId sets the Id field's value. +func (s *SegmentReference) SetId(v string) *SegmentReference { + s.Id = &v return s } -// SetShortCode sets the ShortCode field's value. -func (s *SMSChannelRequest) SetShortCode(v string) *SMSChannelRequest { - s.ShortCode = &v +// SetVersion sets the Version field's value. +func (s *SegmentReference) SetVersion(v int64) *SegmentReference { + s.Version = &v return s } -// Provides information about the status and settings of the SMS channel for -// an application. -type SMSChannelResponse struct { +// Provides information about the configuration, dimension, and other settings +// for a segment. +type SegmentResponse struct { _ struct{} `type:"structure"` - // The unique identifier for the application that the SMS channel applies to. - ApplicationId *string `type:"string"` - - // The date and time, in ISO 8601 format, when the SMS channel was enabled. - CreationDate *string `type:"string"` + // The unique identifier for the application that the segment is associated + // with. + // + // ApplicationId is a required field + ApplicationId *string `type:"string" required:"true"` - // Specifies whether the SMS channel is enabled for the application. - Enabled *bool `type:"boolean"` + // The Amazon Resource Name (ARN) of the segment. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` - // (Not used) This property is retained only for backward compatibility. - HasCredential *bool `type:"boolean"` + // The date and time when the segment was created. + // + // CreationDate is a required field + CreationDate *string `type:"string" required:"true"` - // (Deprecated) An identifier for the SMS channel. This property is retained - // only for backward compatibility. - Id *string `type:"string"` + // The dimension settings for the segment. + Dimensions *SegmentDimensions `type:"structure"` - // Specifies whether the SMS channel is archived. - IsArchived *bool `type:"boolean"` + // The unique identifier for the segment. + // + // Id is a required field + Id *string `type:"string" required:"true"` - // The user who last modified the SMS channel. - LastModifiedBy *string `type:"string"` + // The settings for the import job that's associated with the segment. + ImportDefinition *SegmentImportResource `type:"structure"` - // The date and time, in ISO 8601 format, when the SMS channel was last modified. + // The date and time when the segment was last modified. LastModifiedDate *string `type:"string"` - // The type of messaging or notification platform for the channel. For the SMS - // channel, this value is SMS. - // - // Platform is a required field - Platform *string `type:"string" required:"true"` - - // The maximum number of promotional messages that you can send through the - // SMS channel each second. - PromotionalMessagesPerSecond *int64 `type:"integer"` + // The name of the segment. + Name *string `type:"string"` - // The identity that displays on recipients' devices when they receive messages - // from the SMS channel. - SenderId *string `type:"string"` + // A list of one or more segment groups that apply to the segment. Each segment + // group consists of zero or more base segments and the dimensions that are + // applied to those base segments. + SegmentGroups *SegmentGroupList `type:"structure"` - // The registered short code to use when you send messages through the SMS channel. - ShortCode *string `type:"string"` + // The segment type. Valid values are: + // + // * DIMENSIONAL - A dynamic segment, which is a segment that uses selection + // criteria that you specify and is based on endpoint data that's reported + // by your app. Dynamic segments can change over time. + // + // * IMPORT - A static segment, which is a segment that uses selection criteria + // that you specify and is based on endpoint definitions that you import + // from a file. Imported segments are static; they don't change over time. + // + // SegmentType is a required field + SegmentType *string `type:"string" required:"true" enum:"SegmentType"` - // The maximum number of transactional messages that you can send through the - // SMS channel each second. - TransactionalMessagesPerSecond *int64 `type:"integer"` + // A string-to-string map of key-value pairs that identifies the tags that are + // associated with the segment. Each tag consists of a required tag key and + // an associated tag value. + Tags map[string]*string `locationName:"tags" type:"map"` - // The current version of the SMS channel. + // The version number of the segment. Version *int64 `type:"integer"` } // String returns the string representation -func (s SMSChannelResponse) String() string { +func (s SegmentResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SMSChannelResponse) GoString() string { +func (s SegmentResponse) GoString() string { return s.String() } // SetApplicationId sets the ApplicationId field's value. -func (s *SMSChannelResponse) SetApplicationId(v string) *SMSChannelResponse { +func (s *SegmentResponse) SetApplicationId(v string) *SegmentResponse { s.ApplicationId = &v return s } -// SetCreationDate sets the CreationDate field's value. -func (s *SMSChannelResponse) SetCreationDate(v string) *SMSChannelResponse { - s.CreationDate = &v +// SetArn sets the Arn field's value. +func (s *SegmentResponse) SetArn(v string) *SegmentResponse { + s.Arn = &v return s } -// SetEnabled sets the Enabled field's value. -func (s *SMSChannelResponse) SetEnabled(v bool) *SMSChannelResponse { - s.Enabled = &v +// SetCreationDate sets the CreationDate field's value. +func (s *SegmentResponse) SetCreationDate(v string) *SegmentResponse { + s.CreationDate = &v return s } -// SetHasCredential sets the HasCredential field's value. -func (s *SMSChannelResponse) SetHasCredential(v bool) *SMSChannelResponse { - s.HasCredential = &v +// SetDimensions sets the Dimensions field's value. +func (s *SegmentResponse) SetDimensions(v *SegmentDimensions) *SegmentResponse { + s.Dimensions = v return s } // SetId sets the Id field's value. -func (s *SMSChannelResponse) SetId(v string) *SMSChannelResponse { +func (s *SegmentResponse) SetId(v string) *SegmentResponse { s.Id = &v return s } -// SetIsArchived sets the IsArchived field's value. -func (s *SMSChannelResponse) SetIsArchived(v bool) *SMSChannelResponse { - s.IsArchived = &v - return s -} - -// SetLastModifiedBy sets the LastModifiedBy field's value. -func (s *SMSChannelResponse) SetLastModifiedBy(v string) *SMSChannelResponse { - s.LastModifiedBy = &v +// SetImportDefinition sets the ImportDefinition field's value. +func (s *SegmentResponse) SetImportDefinition(v *SegmentImportResource) *SegmentResponse { + s.ImportDefinition = v return s } // SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *SMSChannelResponse) SetLastModifiedDate(v string) *SMSChannelResponse { +func (s *SegmentResponse) SetLastModifiedDate(v string) *SegmentResponse { s.LastModifiedDate = &v return s } -// SetPlatform sets the Platform field's value. -func (s *SMSChannelResponse) SetPlatform(v string) *SMSChannelResponse { - s.Platform = &v - return s -} - -// SetPromotionalMessagesPerSecond sets the PromotionalMessagesPerSecond field's value. -func (s *SMSChannelResponse) SetPromotionalMessagesPerSecond(v int64) *SMSChannelResponse { - s.PromotionalMessagesPerSecond = &v +// SetName sets the Name field's value. +func (s *SegmentResponse) SetName(v string) *SegmentResponse { + s.Name = &v return s } -// SetSenderId sets the SenderId field's value. -func (s *SMSChannelResponse) SetSenderId(v string) *SMSChannelResponse { - s.SenderId = &v +// SetSegmentGroups sets the SegmentGroups field's value. +func (s *SegmentResponse) SetSegmentGroups(v *SegmentGroupList) *SegmentResponse { + s.SegmentGroups = v return s } -// SetShortCode sets the ShortCode field's value. -func (s *SMSChannelResponse) SetShortCode(v string) *SMSChannelResponse { - s.ShortCode = &v +// SetSegmentType sets the SegmentType field's value. +func (s *SegmentResponse) SetSegmentType(v string) *SegmentResponse { + s.SegmentType = &v return s } -// SetTransactionalMessagesPerSecond sets the TransactionalMessagesPerSecond field's value. -func (s *SMSChannelResponse) SetTransactionalMessagesPerSecond(v int64) *SMSChannelResponse { - s.TransactionalMessagesPerSecond = &v +// SetTags sets the Tags field's value. +func (s *SegmentResponse) SetTags(v map[string]*string) *SegmentResponse { + s.Tags = v return s } // SetVersion sets the Version field's value. -func (s *SMSChannelResponse) SetVersion(v int64) *SMSChannelResponse { +func (s *SegmentResponse) SetVersion(v int64) *SegmentResponse { s.Version = &v return s } -// Specifies the default settings for a one-time SMS message that's sent directly -// to an endpoint. -type SMSMessage struct { +// Provides information about all the segments that are associated with an application. +type SegmentsResponse struct { _ struct{} `type:"structure"` - // The body of the SMS message. - Body *string `type:"string"` + // An array of responses, one for each segment that's associated with the application + // (Segments resource) or each version of a segment that's associated with the + // application (Segment Versions resource). + // + // Item is a required field + Item []*SegmentResponse `type:"list" required:"true"` - // The SMS program name that you provided to AWS Support when you requested - // your dedicated number. - Keyword *string `type:"string"` + // The string to use in a subsequent request to get the next page of results + // in a paginated response. This value is null if there are no additional pages. + NextToken *string `type:"string"` +} - // The SMS message type. Valid values are: TRANSACTIONAL, the message is critical - // or time-sensitive, such as a one-time password that supports a customer transaction; - // and, PROMOTIONAL, the message is not critical or time-sensitive, such as - // a marketing message. - MessageType *string `type:"string" enum:"MessageType"` +// String returns the string representation +func (s SegmentsResponse) String() string { + return awsutil.Prettify(s) +} - // The number that the SMS message originates from. This should be one of the - // dedicated long codes or short codes that you requested from AWS Support and - // is assigned to your AWS account. If you don't specify a long or short code, - // Amazon Pinpoint assigns a random long code to the SMS message. - OriginationNumber *string `type:"string"` +// GoString returns the string representation +func (s SegmentsResponse) GoString() string { + return s.String() +} - // The sender ID to display as the sender of the message on a recipient's device. - // Support for sender IDs varies by country or region. - SenderId *string `type:"string"` +// SetItem sets the Item field's value. +func (s *SegmentsResponse) SetItem(v []*SegmentResponse) *SegmentsResponse { + s.Item = v + return s +} - // The message variables to use in the SMS message. You can override the default - // variables with individual address variables. - Substitutions map[string][]*string `type:"map"` +// SetNextToken sets the NextToken field's value. +func (s *SegmentsResponse) SetNextToken(v string) *SegmentsResponse { + s.NextToken = &v + return s +} + +type SendMessagesInput struct { + _ struct{} `type:"structure" payload:"MessageRequest"` + + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + // Specifies the configuration and other settings for a message. + // + // MessageRequest is a required field + MessageRequest *MessageRequest `type:"structure" required:"true"` } // String returns the string representation -func (s SMSMessage) String() string { +func (s SendMessagesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SMSMessage) GoString() string { +func (s SendMessagesInput) GoString() string { return s.String() } -// SetBody sets the Body field's value. -func (s *SMSMessage) SetBody(v string) *SMSMessage { - s.Body = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *SendMessagesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SendMessagesInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.MessageRequest == nil { + invalidParams.Add(request.NewErrParamRequired("MessageRequest")) + } + if s.MessageRequest != nil { + if err := s.MessageRequest.Validate(); err != nil { + invalidParams.AddNested("MessageRequest", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetKeyword sets the Keyword field's value. -func (s *SMSMessage) SetKeyword(v string) *SMSMessage { - s.Keyword = &v +// SetApplicationId sets the ApplicationId field's value. +func (s *SendMessagesInput) SetApplicationId(v string) *SendMessagesInput { + s.ApplicationId = &v return s } -// SetMessageType sets the MessageType field's value. -func (s *SMSMessage) SetMessageType(v string) *SMSMessage { - s.MessageType = &v +// SetMessageRequest sets the MessageRequest field's value. +func (s *SendMessagesInput) SetMessageRequest(v *MessageRequest) *SendMessagesInput { + s.MessageRequest = v return s } -// SetOriginationNumber sets the OriginationNumber field's value. -func (s *SMSMessage) SetOriginationNumber(v string) *SMSMessage { - s.OriginationNumber = &v - return s +type SendMessagesOutput struct { + _ struct{} `type:"structure" payload:"MessageResponse"` + + // Provides information about the results of a request to send a message to + // an endpoint address. + // + // MessageResponse is a required field + MessageResponse *MessageResponse `type:"structure" required:"true"` } -// SetSenderId sets the SenderId field's value. -func (s *SMSMessage) SetSenderId(v string) *SMSMessage { - s.SenderId = &v - return s +// String returns the string representation +func (s SendMessagesOutput) String() string { + return awsutil.Prettify(s) } -// SetSubstitutions sets the Substitutions field's value. -func (s *SMSMessage) SetSubstitutions(v map[string][]*string) *SMSMessage { - s.Substitutions = v +// GoString returns the string representation +func (s SendMessagesOutput) GoString() string { + return s.String() +} + +// SetMessageResponse sets the MessageResponse field's value. +func (s *SendMessagesOutput) SetMessageResponse(v *MessageResponse) *SendMessagesOutput { + s.MessageResponse = v return s } -// Specifies the schedule settings for a campaign. -type Schedule struct { +// Specifies the configuration and other settings for a message to send to all +// the endpoints that are associated with a list of users. +type SendUsersMessageRequest struct { _ struct{} `type:"structure"` - // The scheduled time, in ISO 8601 format, for the campaign to end. - EndTime *string `type:"string"` - - // The type of event that causes the campaign to be sent, if the value of the - // Frequency property is EVENT. - EventFilter *CampaignEventFilter `type:"structure"` + // A map of custom attribute-value pairs. For a push notification, Amazon Pinpoint + // adds these attributes to the data.pinpoint object in the body of the notification + // payload. Amazon Pinpoint also provides these attributes in the events that + // it generates for users-messages deliveries. + Context map[string]*string `type:"map"` - // Specifies how often the campaign is sent or whether the campaign is sent - // in response to a specific event. - Frequency *string `type:"string" enum:"Frequency"` + // The settings and content for the default message and any default messages + // that you defined for specific channels. + // + // MessageConfiguration is a required field + MessageConfiguration *DirectMessageConfiguration `type:"structure" required:"true"` - // Specifies whether the start and end times for the campaign schedule use each - // recipient's local time. To base the schedule on each recipient's local time, - // set this value to true. - IsLocalTime *bool `type:"boolean"` + // The message template to use for the message. + TemplateConfiguration *TemplateConfiguration `type:"structure"` - // The default quiet time for the campaign. Quiet time is a specific time range - // when a campaign doesn't send messages to endpoints, if all the following - // conditions are met: - // - // * The EndpointDemographic.Timezone property of the endpoint is set to - // a valid value. - // - // * The current time in the endpoint's time zone is later than or equal - // to the time specified by the QuietTime.Start property for the campaign. - // - // * The current time in the endpoint's time zone is earlier than or equal - // to the time specified by the QuietTime.End property for the campaign. - // - // If any of the preceding conditions isn't met, the endpoint will receive messages - // from the campaign, even if quiet time is enabled. - QuietTime *QuietTime `type:"structure"` + // The unique identifier for tracing the message. This identifier is visible + // to message recipients. + TraceId *string `type:"string"` - // The scheduled time, in ISO 8601 format, for the campaign to begin. + // A map that associates user IDs with EndpointSendConfiguration objects. You + // can use an EndpointSendConfiguration object to tailor the message for a user + // by specifying settings such as content overrides and message variables. // - // StartTime is a required field - StartTime *string `type:"string" required:"true"` - - // The starting UTC offset for the campaign schedule, if the value of the IsLocalTime - // property is true. Valid values are: UTC, UTC+01, UTC+02, UTC+03, UTC+03:30, - // UTC+04, UTC+04:30, UTC+05, UTC+05:30, UTC+05:45, UTC+06, UTC+06:30, UTC+07, - // UTC+08, UTC+09, UTC+09:30, UTC+10, UTC+10:30, UTC+11, UTC+12, UTC+13, UTC-02, - // UTC-03, UTC-04, UTC-05, UTC-06, UTC-07, UTC-08, UTC-09, UTC-10, and UTC-11. - Timezone *string `type:"string"` + // Users is a required field + Users map[string]*EndpointSendConfiguration `type:"map" required:"true"` } // String returns the string representation -func (s Schedule) String() string { +func (s SendUsersMessageRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Schedule) GoString() string { +func (s SendUsersMessageRequest) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *Schedule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Schedule"} - if s.StartTime == nil { - invalidParams.Add(request.NewErrParamRequired("StartTime")) +func (s *SendUsersMessageRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SendUsersMessageRequest"} + if s.MessageConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("MessageConfiguration")) } - if s.EventFilter != nil { - if err := s.EventFilter.Validate(); err != nil { - invalidParams.AddNested("EventFilter", err.(request.ErrInvalidParams)) - } + if s.Users == nil { + invalidParams.Add(request.NewErrParamRequired("Users")) } if invalidParams.Len() > 0 { @@ -20128,154 +28176,121 @@ func (s *Schedule) Validate() error { return nil } -// SetEndTime sets the EndTime field's value. -func (s *Schedule) SetEndTime(v string) *Schedule { - s.EndTime = &v - return s -} - -// SetEventFilter sets the EventFilter field's value. -func (s *Schedule) SetEventFilter(v *CampaignEventFilter) *Schedule { - s.EventFilter = v - return s -} - -// SetFrequency sets the Frequency field's value. -func (s *Schedule) SetFrequency(v string) *Schedule { - s.Frequency = &v +// SetContext sets the Context field's value. +func (s *SendUsersMessageRequest) SetContext(v map[string]*string) *SendUsersMessageRequest { + s.Context = v return s } -// SetIsLocalTime sets the IsLocalTime field's value. -func (s *Schedule) SetIsLocalTime(v bool) *Schedule { - s.IsLocalTime = &v +// SetMessageConfiguration sets the MessageConfiguration field's value. +func (s *SendUsersMessageRequest) SetMessageConfiguration(v *DirectMessageConfiguration) *SendUsersMessageRequest { + s.MessageConfiguration = v return s } -// SetQuietTime sets the QuietTime field's value. -func (s *Schedule) SetQuietTime(v *QuietTime) *Schedule { - s.QuietTime = v +// SetTemplateConfiguration sets the TemplateConfiguration field's value. +func (s *SendUsersMessageRequest) SetTemplateConfiguration(v *TemplateConfiguration) *SendUsersMessageRequest { + s.TemplateConfiguration = v return s } -// SetStartTime sets the StartTime field's value. -func (s *Schedule) SetStartTime(v string) *Schedule { - s.StartTime = &v +// SetTraceId sets the TraceId field's value. +func (s *SendUsersMessageRequest) SetTraceId(v string) *SendUsersMessageRequest { + s.TraceId = &v return s } -// SetTimezone sets the Timezone field's value. -func (s *Schedule) SetTimezone(v string) *Schedule { - s.Timezone = &v +// SetUsers sets the Users field's value. +func (s *SendUsersMessageRequest) SetUsers(v map[string]*EndpointSendConfiguration) *SendUsersMessageRequest { + s.Users = v return s } -// Specifies dimension settings for including or excluding endpoints from a -// segment based on how recently an endpoint was active. -type SegmentBehaviors struct { +// Provides information about which users and endpoints a message was sent to. +type SendUsersMessageResponse struct { _ struct{} `type:"structure"` - // The dimension settings that are based on how recently an endpoint was active. - Recency *RecencyDimension `type:"structure"` + // The unique identifier for the application that was used to send the message. + // + // ApplicationId is a required field + ApplicationId *string `type:"string" required:"true"` + + // The unique identifier that was assigned to the message request. + RequestId *string `type:"string"` + + // An object that indicates which endpoints the message was sent to, for each + // user. The object lists user IDs and, for each user ID, provides the endpoint + // IDs that the message was sent to. For each endpoint ID, it provides an EndpointMessageResult + // object. + Result map[string]map[string]*EndpointMessageResult `type:"map"` } // String returns the string representation -func (s SegmentBehaviors) String() string { +func (s SendUsersMessageResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SegmentBehaviors) GoString() string { +func (s SendUsersMessageResponse) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *SegmentBehaviors) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SegmentBehaviors"} - if s.Recency != nil { - if err := s.Recency.Validate(); err != nil { - invalidParams.AddNested("Recency", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetApplicationId sets the ApplicationId field's value. +func (s *SendUsersMessageResponse) SetApplicationId(v string) *SendUsersMessageResponse { + s.ApplicationId = &v + return s } -// SetRecency sets the Recency field's value. -func (s *SegmentBehaviors) SetRecency(v *RecencyDimension) *SegmentBehaviors { - s.Recency = v +// SetRequestId sets the RequestId field's value. +func (s *SendUsersMessageResponse) SetRequestId(v string) *SendUsersMessageResponse { + s.RequestId = &v return s } -// Specifies demographic-based dimension settings for including or excluding -// endpoints from a segment. These settings derive from characteristics of endpoint -// devices, such as platform, make, and model. -type SegmentDemographics struct { - _ struct{} `type:"structure"` - - // The app version criteria for the segment. - AppVersion *SetDimension `type:"structure"` - - // The channel criteria for the segment. - Channel *SetDimension `type:"structure"` - - // The device type criteria for the segment. - DeviceType *SetDimension `type:"structure"` +// SetResult sets the Result field's value. +func (s *SendUsersMessageResponse) SetResult(v map[string]map[string]*EndpointMessageResult) *SendUsersMessageResponse { + s.Result = v + return s +} - // The device make criteria for the segment. - Make *SetDimension `type:"structure"` +type SendUsersMessagesInput struct { + _ struct{} `type:"structure" payload:"SendUsersMessageRequest"` - // The device model criteria for the segment. - Model *SetDimension `type:"structure"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // The device platform criteria for the segment. - Platform *SetDimension `type:"structure"` + // Specifies the configuration and other settings for a message to send to all + // the endpoints that are associated with a list of users. + // + // SendUsersMessageRequest is a required field + SendUsersMessageRequest *SendUsersMessageRequest `type:"structure" required:"true"` } // String returns the string representation -func (s SegmentDemographics) String() string { +func (s SendUsersMessagesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SegmentDemographics) GoString() string { +func (s SendUsersMessagesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *SegmentDemographics) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SegmentDemographics"} - if s.AppVersion != nil { - if err := s.AppVersion.Validate(); err != nil { - invalidParams.AddNested("AppVersion", err.(request.ErrInvalidParams)) - } - } - if s.Channel != nil { - if err := s.Channel.Validate(); err != nil { - invalidParams.AddNested("Channel", err.(request.ErrInvalidParams)) - } - } - if s.DeviceType != nil { - if err := s.DeviceType.Validate(); err != nil { - invalidParams.AddNested("DeviceType", err.(request.ErrInvalidParams)) - } +func (s *SendUsersMessagesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SendUsersMessagesInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } - if s.Make != nil { - if err := s.Make.Validate(); err != nil { - invalidParams.AddNested("Make", err.(request.ErrInvalidParams)) - } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } - if s.Model != nil { - if err := s.Model.Validate(); err != nil { - invalidParams.AddNested("Model", err.(request.ErrInvalidParams)) - } + if s.SendUsersMessageRequest == nil { + invalidParams.Add(request.NewErrParamRequired("SendUsersMessageRequest")) } - if s.Platform != nil { - if err := s.Platform.Validate(); err != nil { - invalidParams.AddNested("Platform", err.(request.ErrInvalidParams)) + if s.SendUsersMessageRequest != nil { + if err := s.SendUsersMessageRequest.Validate(); err != nil { + invalidParams.AddNested("SendUsersMessageRequest", err.(request.ErrInvalidParams)) } } @@ -20285,123 +28300,82 @@ func (s *SegmentDemographics) Validate() error { return nil } -// SetAppVersion sets the AppVersion field's value. -func (s *SegmentDemographics) SetAppVersion(v *SetDimension) *SegmentDemographics { - s.AppVersion = v +// SetApplicationId sets the ApplicationId field's value. +func (s *SendUsersMessagesInput) SetApplicationId(v string) *SendUsersMessagesInput { + s.ApplicationId = &v return s } -// SetChannel sets the Channel field's value. -func (s *SegmentDemographics) SetChannel(v *SetDimension) *SegmentDemographics { - s.Channel = v +// SetSendUsersMessageRequest sets the SendUsersMessageRequest field's value. +func (s *SendUsersMessagesInput) SetSendUsersMessageRequest(v *SendUsersMessageRequest) *SendUsersMessagesInput { + s.SendUsersMessageRequest = v return s } -// SetDeviceType sets the DeviceType field's value. -func (s *SegmentDemographics) SetDeviceType(v *SetDimension) *SegmentDemographics { - s.DeviceType = v - return s +type SendUsersMessagesOutput struct { + _ struct{} `type:"structure" payload:"SendUsersMessageResponse"` + + // Provides information about which users and endpoints a message was sent to. + // + // SendUsersMessageResponse is a required field + SendUsersMessageResponse *SendUsersMessageResponse `type:"structure" required:"true"` } -// SetMake sets the Make field's value. -func (s *SegmentDemographics) SetMake(v *SetDimension) *SegmentDemographics { - s.Make = v - return s +// String returns the string representation +func (s SendUsersMessagesOutput) String() string { + return awsutil.Prettify(s) } -// SetModel sets the Model field's value. -func (s *SegmentDemographics) SetModel(v *SetDimension) *SegmentDemographics { - s.Model = v - return s +// GoString returns the string representation +func (s SendUsersMessagesOutput) GoString() string { + return s.String() } -// SetPlatform sets the Platform field's value. -func (s *SegmentDemographics) SetPlatform(v *SetDimension) *SegmentDemographics { - s.Platform = v +// SetSendUsersMessageResponse sets the SendUsersMessageResponse field's value. +func (s *SendUsersMessagesOutput) SetSendUsersMessageResponse(v *SendUsersMessageResponse) *SendUsersMessagesOutput { + s.SendUsersMessageResponse = v return s } -// Specifies the dimension settings for a segment. -type SegmentDimensions struct { +// Provides information about a session. +type Session struct { _ struct{} `type:"structure"` - // One or more custom attributes to use as criteria for the segment. - Attributes map[string]*AttributeDimension `type:"map"` - - // The behavior-based criteria, such as how recently users have used your app, - // for the segment. - Behavior *SegmentBehaviors `type:"structure"` - - // The demographic-based criteria, such as device platform, for the segment. - Demographic *SegmentDemographics `type:"structure"` + // The duration of the session, in milliseconds. + Duration *int64 `type:"integer"` - // The location-based criteria, such as region or GPS coordinates, for the segment. - Location *SegmentLocation `type:"structure"` + // The unique identifier for the session. + // + // Id is a required field + Id *string `type:"string" required:"true"` - // One or more custom metrics to use as criteria for the segment. - Metrics map[string]*MetricDimension `type:"map"` + // The date and time when the session began. + // + // StartTimestamp is a required field + StartTimestamp *string `type:"string" required:"true"` - // One or more custom user attributes to use as criteria for the segment. - UserAttributes map[string]*AttributeDimension `type:"map"` + // The date and time when the session ended. + StopTimestamp *string `type:"string"` } // String returns the string representation -func (s SegmentDimensions) String() string { +func (s Session) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SegmentDimensions) GoString() string { +func (s Session) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *SegmentDimensions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SegmentDimensions"} - 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.Behavior != nil { - if err := s.Behavior.Validate(); err != nil { - invalidParams.AddNested("Behavior", err.(request.ErrInvalidParams)) - } - } - if s.Demographic != nil { - if err := s.Demographic.Validate(); err != nil { - invalidParams.AddNested("Demographic", err.(request.ErrInvalidParams)) - } - } - if s.Location != nil { - if err := s.Location.Validate(); err != nil { - invalidParams.AddNested("Location", err.(request.ErrInvalidParams)) - } - } - if s.Metrics != nil { - for i, v := range s.Metrics { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Metrics", 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)) - } - } +// Validate inspects the fields of the type to determine if they are valid. +func (s *Session) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Session"} + if s.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.StartTimestamp == nil { + invalidParams.Add(request.NewErrParamRequired("StartTimestamp")) } if invalidParams.Len() > 0 { @@ -20410,104 +28384,62 @@ func (s *SegmentDimensions) Validate() error { return nil } -// SetAttributes sets the Attributes field's value. -func (s *SegmentDimensions) SetAttributes(v map[string]*AttributeDimension) *SegmentDimensions { - s.Attributes = v - return s -} - -// SetBehavior sets the Behavior field's value. -func (s *SegmentDimensions) SetBehavior(v *SegmentBehaviors) *SegmentDimensions { - s.Behavior = v - return s -} - -// SetDemographic sets the Demographic field's value. -func (s *SegmentDimensions) SetDemographic(v *SegmentDemographics) *SegmentDimensions { - s.Demographic = v +// SetDuration sets the Duration field's value. +func (s *Session) SetDuration(v int64) *Session { + s.Duration = &v return s } -// SetLocation sets the Location field's value. -func (s *SegmentDimensions) SetLocation(v *SegmentLocation) *SegmentDimensions { - s.Location = v +// SetId sets the Id field's value. +func (s *Session) SetId(v string) *Session { + s.Id = &v return s } -// SetMetrics sets the Metrics field's value. -func (s *SegmentDimensions) SetMetrics(v map[string]*MetricDimension) *SegmentDimensions { - s.Metrics = v +// SetStartTimestamp sets the StartTimestamp field's value. +func (s *Session) SetStartTimestamp(v string) *Session { + s.StartTimestamp = &v return s } -// SetUserAttributes sets the UserAttributes field's value. -func (s *SegmentDimensions) SetUserAttributes(v map[string]*AttributeDimension) *SegmentDimensions { - s.UserAttributes = v +// SetStopTimestamp sets the StopTimestamp field's value. +func (s *Session) SetStopTimestamp(v string) *Session { + s.StopTimestamp = &v return s } -// Specifies the base segments and dimensions for a segment, and the relationships -// between these base segments and dimensions. -type SegmentGroup struct { +// Specifies the dimension type and values for a segment dimension. +type SetDimension struct { _ struct{} `type:"structure"` - // An array that defines the dimensions for the segment. - Dimensions []*SegmentDimensions `type:"list"` + // The type of segment dimension to use. Valid values are: INCLUSIVE, endpoints + // that match the criteria are included in the segment; and, EXCLUSIVE, endpoints + // that match the criteria are excluded from the segment. + DimensionType *string `type:"string" enum:"DimensionType"` - // The base segment to build the segment on. A base segment, also referred to - // as a source segment, defines the initial population of endpoints for a segment. - // When you add dimensions to a segment, Amazon Pinpoint filters the base segment - // by using the dimensions that you specify. + // The criteria values to use for the segment dimension. Depending on the value + // of the DimensionType property, endpoints are included or excluded from the + // segment if their values match the criteria values. // - // You can specify more than one dimensional segment or only one imported segment. - // If you specify an imported segment, the Amazon Pinpoint console displays - // a segment size estimate that indicates the size of the imported segment without - // any filters applied to it. - SourceSegments []*SegmentReference `type:"list"` - - // Specifies how to handle multiple base segments for the segment. For example, - // if you specify three base segments for the segment, whether the resulting - // segment is based on all, any, or none of the base segments. - SourceType *string `type:"string" enum:"SourceType"` - - // Specifies how to handle multiple dimensions for the segment. For example, - // if you specify three dimensions for the segment, whether the resulting segment - // includes endpoints that match all, any, or none of the dimensions. - Type *string `type:"string" enum:"Type"` + // Values is a required field + Values []*string `type:"list" required:"true"` } // String returns the string representation -func (s SegmentGroup) String() string { +func (s SetDimension) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SegmentGroup) GoString() string { +func (s SetDimension) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *SegmentGroup) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SegmentGroup"} - 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.SourceSegments != nil { - for i, v := range s.SourceSegments { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SourceSegments", i), err.(request.ErrInvalidParams)) - } - } +func (s *SetDimension) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SetDimension"} + if s.Values == nil { + invalidParams.Add(request.NewErrParamRequired("Values")) } if invalidParams.Len() > 0 { @@ -20516,66 +28448,58 @@ func (s *SegmentGroup) Validate() error { return nil } -// SetDimensions sets the Dimensions field's value. -func (s *SegmentGroup) SetDimensions(v []*SegmentDimensions) *SegmentGroup { - s.Dimensions = v - return s -} - -// SetSourceSegments sets the SourceSegments field's value. -func (s *SegmentGroup) SetSourceSegments(v []*SegmentReference) *SegmentGroup { - s.SourceSegments = v - return s -} - -// SetSourceType sets the SourceType field's value. -func (s *SegmentGroup) SetSourceType(v string) *SegmentGroup { - s.SourceType = &v +// SetDimensionType sets the DimensionType field's value. +func (s *SetDimension) SetDimensionType(v string) *SetDimension { + s.DimensionType = &v return s } -// SetType sets the Type field's value. -func (s *SegmentGroup) SetType(v string) *SegmentGroup { - s.Type = &v +// SetValues sets the Values field's value. +func (s *SetDimension) SetValues(v []*string) *SetDimension { + s.Values = v return s } -// Specifies the settings that define the relationships between segment groups -// for a segment. -type SegmentGroupList struct { +// Specifies a condition to evaluate for an activity in a journey. +type SimpleCondition struct { _ struct{} `type:"structure"` - // An array that defines the set of segment criteria to evaluate when handling - // segment groups for the segment. - Groups []*SegmentGroup `type:"list"` + // The dimension settings for the event that's associated with the activity. + EventCondition *EventCondition `type:"structure"` - // Specifies how to handle multiple segment groups for the segment. For example, - // if the segment includes three segment groups, whether the resulting segment - // includes endpoints that match all, any, or none of the segment groups. - Include *string `type:"string" enum:"Include"` + // The segment that's associated with the activity. + SegmentCondition *SegmentCondition `type:"structure"` + + // The dimension settings for the segment that's associated with the activity. + SegmentDimensions *SegmentDimensions `locationName:"segmentDimensions" type:"structure"` } // String returns the string representation -func (s SegmentGroupList) String() string { +func (s SimpleCondition) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SegmentGroupList) GoString() string { +func (s SimpleCondition) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *SegmentGroupList) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SegmentGroupList"} - if s.Groups != nil { - for i, v := range s.Groups { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Groups", i), err.(request.ErrInvalidParams)) - } +func (s *SimpleCondition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SimpleCondition"} + if s.EventCondition != nil { + if err := s.EventCondition.Validate(); err != nil { + invalidParams.AddNested("EventCondition", err.(request.ErrInvalidParams)) + } + } + if s.SegmentCondition != nil { + if err := s.SegmentCondition.Validate(); err != nil { + invalidParams.AddNested("SegmentCondition", err.(request.ErrInvalidParams)) + } + } + if s.SegmentDimensions != nil { + if err := s.SegmentDimensions.Validate(); err != nil { + invalidParams.AddNested("SegmentDimensions", err.(request.ErrInvalidParams)) } } @@ -20585,141 +28509,134 @@ func (s *SegmentGroupList) Validate() error { return nil } -// SetGroups sets the Groups field's value. -func (s *SegmentGroupList) SetGroups(v []*SegmentGroup) *SegmentGroupList { - s.Groups = v +// SetEventCondition sets the EventCondition field's value. +func (s *SimpleCondition) SetEventCondition(v *EventCondition) *SimpleCondition { + s.EventCondition = v return s } -// SetInclude sets the Include field's value. -func (s *SegmentGroupList) SetInclude(v string) *SegmentGroupList { - s.Include = &v +// SetSegmentCondition sets the SegmentCondition field's value. +func (s *SimpleCondition) SetSegmentCondition(v *SegmentCondition) *SimpleCondition { + s.SegmentCondition = v return s } -// Provides information about the import job that created a segment. An import -// job is a job that creates a user segment by importing endpoint definitions. -type SegmentImportResource struct { - _ struct{} `type:"structure"` - - // The number of channel types in the endpoint definitions that were imported - // to create the segment. - ChannelCounts map[string]*int64 `type:"map"` - - // (Deprecated) Your AWS account ID, which you assigned to an external ID key - // in an IAM trust policy. Amazon Pinpoint previously used this value to assume - // an IAM role when importing endpoint definitions, but we removed this requirement. - // We don't recommend use of external IDs for IAM roles that are assumed by - // Amazon Pinpoint. - // - // ExternalId is a required field - ExternalId *string `type:"string" required:"true"` +// SetSegmentDimensions sets the SegmentDimensions field's value. +func (s *SimpleCondition) SetSegmentDimensions(v *SegmentDimensions) *SimpleCondition { + s.SegmentDimensions = v + return s +} - // The format of the files that were imported to create the segment. Valid values - // are: CSV, for comma-separated values format; and, JSON, for newline-delimited - // JSON format. - // - // Format is a required field - Format *string `type:"string" required:"true" enum:"Format"` +// Specifies the contents of an email message, composed of a subject, a text +// part, and an HTML part. +type SimpleEmail struct { + _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the AWS Identity and Access Management - // (IAM) role that authorized Amazon Pinpoint to access the Amazon S3 location - // to import endpoint definitions from. - // - // RoleArn is a required field - RoleArn *string `type:"string" required:"true"` + // The body of the email message, in HTML format. We recommend using HTML format + // for email clients that render HTML content. You can include links, formatted + // text, and more in an HTML message. + HtmlPart *SimpleEmailPart `type:"structure"` - // The URL of the Amazon Simple Storage Service (Amazon S3) bucket that the - // endpoint definitions were imported from to create the segment. - // - // S3Url is a required field - S3Url *string `type:"string" required:"true"` + // The subject line, or title, of the email. + Subject *SimpleEmailPart `type:"structure"` - // The number of endpoint definitions that were imported successfully to create - // the segment. - // - // Size is a required field - Size *int64 `type:"integer" required:"true"` + // The body of the email message, in plain text format. We recommend using plain + // text format for email clients that don't render HTML content and clients + // that are connected to high-latency networks, such as mobile devices. + TextPart *SimpleEmailPart `type:"structure"` } // String returns the string representation -func (s SegmentImportResource) String() string { +func (s SimpleEmail) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SegmentImportResource) GoString() string { +func (s SimpleEmail) GoString() string { return s.String() } -// SetChannelCounts sets the ChannelCounts field's value. -func (s *SegmentImportResource) SetChannelCounts(v map[string]*int64) *SegmentImportResource { - s.ChannelCounts = v +// SetHtmlPart sets the HtmlPart field's value. +func (s *SimpleEmail) SetHtmlPart(v *SimpleEmailPart) *SimpleEmail { + s.HtmlPart = v return s } -// SetExternalId sets the ExternalId field's value. -func (s *SegmentImportResource) SetExternalId(v string) *SegmentImportResource { - s.ExternalId = &v +// SetSubject sets the Subject field's value. +func (s *SimpleEmail) SetSubject(v *SimpleEmailPart) *SimpleEmail { + s.Subject = v return s } -// SetFormat sets the Format field's value. -func (s *SegmentImportResource) SetFormat(v string) *SegmentImportResource { - s.Format = &v +// SetTextPart sets the TextPart field's value. +func (s *SimpleEmail) SetTextPart(v *SimpleEmailPart) *SimpleEmail { + s.TextPart = v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *SegmentImportResource) SetRoleArn(v string) *SegmentImportResource { - s.RoleArn = &v - return s +// Specifies the subject or body of an email message, represented as textual +// email data and the applicable character set. +type SimpleEmailPart struct { + _ struct{} `type:"structure"` + + // The applicable character set for the message content. + Charset *string `type:"string"` + + // The textual data of the message content. + Data *string `type:"string"` +} + +// String returns the string representation +func (s SimpleEmailPart) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SimpleEmailPart) GoString() string { + return s.String() } -// SetS3Url sets the S3Url field's value. -func (s *SegmentImportResource) SetS3Url(v string) *SegmentImportResource { - s.S3Url = &v +// SetCharset sets the Charset field's value. +func (s *SimpleEmailPart) SetCharset(v string) *SimpleEmailPart { + s.Charset = &v return s } -// SetSize sets the Size field's value. -func (s *SegmentImportResource) SetSize(v int64) *SegmentImportResource { - s.Size = &v +// SetData sets the Data field's value. +func (s *SimpleEmailPart) SetData(v string) *SimpleEmailPart { + s.Data = &v return s } -// Specifies geographical dimension settings for a segment. -type SegmentLocation struct { +// Specifies the conditions for the first activity in a journey. This activity +// and its conditions determine which users are participants in a journey. +type StartCondition struct { _ struct{} `type:"structure"` - // The country or region code, in ISO 3166-1 alpha-2 format, for the segment. - Country *SetDimension `type:"structure"` + // The custom description of the condition. + Description *string `type:"string"` - // The GPS location and range for the segment. - GPSPoint *GPSPointDimension `type:"structure"` + // The segment that's associated with the first activity in the journey. This + // segment determines which users are participants in the journey. + SegmentStartCondition *SegmentCondition `type:"structure"` } // String returns the string representation -func (s SegmentLocation) String() string { +func (s StartCondition) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SegmentLocation) GoString() string { +func (s StartCondition) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *SegmentLocation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SegmentLocation"} - if s.Country != nil { - if err := s.Country.Validate(); err != nil { - invalidParams.AddNested("Country", err.(request.ErrInvalidParams)) - } - } - if s.GPSPoint != nil { - if err := s.GPSPoint.Validate(); err != nil { - invalidParams.AddNested("GPSPoint", err.(request.ErrInvalidParams)) +func (s *StartCondition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartCondition"} + if s.SegmentStartCondition != nil { + if err := s.SegmentStartCondition.Validate(); err != nil { + invalidParams.AddNested("SegmentStartCondition", err.(request.ErrInvalidParams)) } } @@ -20729,46 +28646,57 @@ func (s *SegmentLocation) Validate() error { return nil } -// SetCountry sets the Country field's value. -func (s *SegmentLocation) SetCountry(v *SetDimension) *SegmentLocation { - s.Country = v +// SetDescription sets the Description field's value. +func (s *StartCondition) SetDescription(v string) *StartCondition { + s.Description = &v return s } -// SetGPSPoint sets the GPSPoint field's value. -func (s *SegmentLocation) SetGPSPoint(v *GPSPointDimension) *SegmentLocation { - s.GPSPoint = v +// SetSegmentStartCondition sets the SegmentStartCondition field's value. +func (s *StartCondition) SetSegmentStartCondition(v *SegmentCondition) *StartCondition { + s.SegmentStartCondition = v return s } -// Specifies the segment identifier and version of a segment. -type SegmentReference struct { - _ struct{} `type:"structure"` +type TagResourceInput struct { + _ struct{} `type:"structure" payload:"TagsModel"` - // The unique identifier for the segment. - // - // Id is a required field - Id *string `type:"string" required:"true"` + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` - // The version number of the segment. - Version *int64 `type:"integer"` + // Specifies the tags (keys and values) for an application, campaign, journey, + // message template, or segment. + // + // TagsModel is a required field + TagsModel *TagsModel `type:"structure" required:"true"` } // String returns the string representation -func (s SegmentReference) String() string { +func (s TagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SegmentReference) GoString() string { +func (s TagResourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *SegmentReference) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SegmentReference"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) +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.TagsModel == nil { + invalidParams.Add(request.NewErrParamRequired("TagsModel")) + } + if s.TagsModel != nil { + if err := s.TagsModel.Validate(); err != nil { + invalidParams.AddNested("TagsModel", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -20777,739 +28705,755 @@ func (s *SegmentReference) Validate() error { return nil } -// SetId sets the Id field's value. -func (s *SegmentReference) SetId(v string) *SegmentReference { - s.Id = &v +// SetResourceArn sets the ResourceArn field's value. +func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { + s.ResourceArn = &v return s } -// SetVersion sets the Version field's value. -func (s *SegmentReference) SetVersion(v int64) *SegmentReference { - s.Version = &v +// SetTagsModel sets the TagsModel field's value. +func (s *TagResourceInput) SetTagsModel(v *TagsModel) *TagResourceInput { + s.TagsModel = v return s } -// Provides information about the configuration, dimension, and other settings -// for a segment. -type SegmentResponse struct { +type TagResourceOutput struct { _ struct{} `type:"structure"` +} - // The unique identifier for the application that the segment is associated - // with. - // - // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the segment. - // - // Arn is a required field - Arn *string `type:"string" required:"true"` - - // The date and time when the segment was created. - // - // CreationDate is a required field - CreationDate *string `type:"string" required:"true"` - - // The dimension settings for the segment. - Dimensions *SegmentDimensions `type:"structure"` - - // The unique identifier for the segment. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // The settings for the import job that's associated with the segment. - ImportDefinition *SegmentImportResource `type:"structure"` - - // The date and time when the segment was last modified. - LastModifiedDate *string `type:"string"` +// String returns the string representation +func (s TagResourceOutput) String() string { + return awsutil.Prettify(s) +} - // The name of the segment. - Name *string `type:"string"` +// GoString returns the string representation +func (s TagResourceOutput) GoString() string { + return s.String() +} - // A list of one or more segment groups that apply to the segment. Each segment - // group consists of zero or more base segments and the dimensions that are - // applied to those base segments. - SegmentGroups *SegmentGroupList `type:"structure"` +// Specifies the tags (keys and values) for an application, campaign, journey, +// message template, or segment. +type TagsModel struct { + _ struct{} `type:"structure"` - // The segment type. Valid values are: - // - // * DIMENSIONAL - A dynamic segment, which is a segment that uses selection - // criteria that you specify and is based on endpoint data that's reported - // by your app. Dynamic segments can change over time. + // A string-to-string map of key-value pairs that defines the tags for an application, + // campaign, journey, message template, or segment. Each of these resources + // can have a maximum of 50 tags. // - // * IMPORT - A static segment, which is a segment that uses selection criteria - // that you specify and is based on endpoint definitions that you import - // from a file. Imported segments are static; they don't change over time. + // Each tag consists of a required tag key and an associated tag value. The + // maximum length of a tag key is 128 characters. The maximum length of a tag + // value is 256 characters. // - // SegmentType is a required field - SegmentType *string `type:"string" required:"true" enum:"SegmentType"` - - // A string-to-string map of key-value pairs that identifies the tags that are - // associated with the segment. Each tag consists of a required tag key and - // an associated tag value. - Tags map[string]*string `locationName:"tags" type:"map"` - - // The version number of the segment. - Version *int64 `type:"integer"` + // Tags is a required field + Tags map[string]*string `locationName:"tags" type:"map" required:"true"` } // String returns the string representation -func (s SegmentResponse) String() string { +func (s TagsModel) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SegmentResponse) GoString() string { +func (s TagsModel) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *SegmentResponse) SetApplicationId(v string) *SegmentResponse { - s.ApplicationId = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *TagsModel) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TagsModel"} + if s.Tags == nil { + invalidParams.Add(request.NewErrParamRequired("Tags")) + } -// SetArn sets the Arn field's value. -func (s *SegmentResponse) SetArn(v string) *SegmentResponse { - s.Arn = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetCreationDate sets the CreationDate field's value. -func (s *SegmentResponse) SetCreationDate(v string) *SegmentResponse { - s.CreationDate = &v +// SetTags sets the Tags field's value. +func (s *TagsModel) SetTags(v map[string]*string) *TagsModel { + s.Tags = v return s } -// SetDimensions sets the Dimensions field's value. -func (s *SegmentResponse) SetDimensions(v *SegmentDimensions) *SegmentResponse { - s.Dimensions = v - return s -} +// Specifies the name and version of the message template to use for the message. +type Template struct { + _ struct{} `type:"structure"` -// SetId sets the Id field's value. -func (s *SegmentResponse) SetId(v string) *SegmentResponse { - s.Id = &v - return s + // The name of the message template to use for the message. If specified, this + // value must match the name of an existing message template. + Name *string `type:"string"` + + // The unique identifier for the version of the message template to use for + // the message. If specified, this value must match the identifier for an existing + // template version. To retrieve a list of versions and version identifiers + // for a template, use the Template Versions resource. + // + // If you don't specify a value for this property, Amazon Pinpoint uses the + // active version of the template. The active version is typically the version + // of a template that's been most recently reviewed and approved for use, depending + // on your workflow. It isn't necessarily the latest version of a template. + Version *string `type:"string"` } -// SetImportDefinition sets the ImportDefinition field's value. -func (s *SegmentResponse) SetImportDefinition(v *SegmentImportResource) *SegmentResponse { - s.ImportDefinition = v - return s +// String returns the string representation +func (s Template) String() string { + return awsutil.Prettify(s) } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *SegmentResponse) SetLastModifiedDate(v string) *SegmentResponse { - s.LastModifiedDate = &v - return s +// GoString returns the string representation +func (s Template) GoString() string { + return s.String() } // SetName sets the Name field's value. -func (s *SegmentResponse) SetName(v string) *SegmentResponse { +func (s *Template) SetName(v string) *Template { s.Name = &v return s } -// SetSegmentGroups sets the SegmentGroups field's value. -func (s *SegmentResponse) SetSegmentGroups(v *SegmentGroupList) *SegmentResponse { - s.SegmentGroups = v - return s -} - -// SetSegmentType sets the SegmentType field's value. -func (s *SegmentResponse) SetSegmentType(v string) *SegmentResponse { - s.SegmentType = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *SegmentResponse) SetTags(v map[string]*string) *SegmentResponse { - s.Tags = v - return s -} - // SetVersion sets the Version field's value. -func (s *SegmentResponse) SetVersion(v int64) *SegmentResponse { +func (s *Template) SetVersion(v string) *Template { s.Version = &v return s } -// Provides information about all the segments that are associated with an application. -type SegmentsResponse struct { - _ struct{} `type:"structure"` - - // An array of responses, one for each segment that's associated with the application - // (Segments resource) or each version of a segment that's associated with the - // application (Segment Versions resource). - // - // Item is a required field - Item []*SegmentResponse `type:"list" required:"true"` - - // The string to use in a subsequent request to get the next page of results - // in a paginated response. This value is null if there are no additional pages. - NextToken *string `type:"string"` +// Specifies which version of a message template to use as the active version +// of the template. +type TemplateActiveVersionRequest struct { + _ struct{} `type:"structure"` + + // The unique identifier for the version of the message template to use as the + // active version of the template. If specified, this value must match the identifier + // for an existing template version. To retrieve a list of versions and version + // identifiers for a template, use the Template Versions resource. + Version *string `type:"string"` } // String returns the string representation -func (s SegmentsResponse) String() string { +func (s TemplateActiveVersionRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SegmentsResponse) GoString() string { +func (s TemplateActiveVersionRequest) GoString() string { return s.String() } -// SetItem sets the Item field's value. -func (s *SegmentsResponse) SetItem(v []*SegmentResponse) *SegmentsResponse { - s.Item = v +// SetVersion sets the Version field's value. +func (s *TemplateActiveVersionRequest) SetVersion(v string) *TemplateActiveVersionRequest { + s.Version = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *SegmentsResponse) SetNextToken(v string) *SegmentsResponse { - s.NextToken = &v - return s -} +// Specifies the message template to use for the message, for each type of channel. +type TemplateConfiguration struct { + _ struct{} `type:"structure"` -type SendMessagesInput struct { - _ struct{} `type:"structure" payload:"MessageRequest"` + // The email template to use for the message. + EmailTemplate *Template `type:"structure"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + // The push notification template to use for the message. + PushTemplate *Template `type:"structure"` - // Specifies the objects that define configuration and other settings for a - // message. - // - // MessageRequest is a required field - MessageRequest *MessageRequest `type:"structure" required:"true"` + // The SMS template to use for the message. + SMSTemplate *Template `type:"structure"` + + // The voice template to use for the message. + VoiceTemplate *Template `type:"structure"` } // String returns the string representation -func (s SendMessagesInput) String() string { +func (s TemplateConfiguration) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SendMessagesInput) GoString() string { +func (s TemplateConfiguration) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *SendMessagesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SendMessagesInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.MessageRequest == nil { - invalidParams.Add(request.NewErrParamRequired("MessageRequest")) - } - if s.MessageRequest != nil { - if err := s.MessageRequest.Validate(); err != nil { - invalidParams.AddNested("MessageRequest", err.(request.ErrInvalidParams)) - } - } +// SetEmailTemplate sets the EmailTemplate field's value. +func (s *TemplateConfiguration) SetEmailTemplate(v *Template) *TemplateConfiguration { + s.EmailTemplate = v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetPushTemplate sets the PushTemplate field's value. +func (s *TemplateConfiguration) SetPushTemplate(v *Template) *TemplateConfiguration { + s.PushTemplate = v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *SendMessagesInput) SetApplicationId(v string) *SendMessagesInput { - s.ApplicationId = &v +// SetSMSTemplate sets the SMSTemplate field's value. +func (s *TemplateConfiguration) SetSMSTemplate(v *Template) *TemplateConfiguration { + s.SMSTemplate = v return s } -// SetMessageRequest sets the MessageRequest field's value. -func (s *SendMessagesInput) SetMessageRequest(v *MessageRequest) *SendMessagesInput { - s.MessageRequest = v +// SetVoiceTemplate sets the VoiceTemplate field's value. +func (s *TemplateConfiguration) SetVoiceTemplate(v *Template) *TemplateConfiguration { + s.VoiceTemplate = v return s } -type SendMessagesOutput struct { - _ struct{} `type:"structure" payload:"MessageResponse"` +// Provides information about a message template that's associated with your +// Amazon Pinpoint account. +type TemplateResponse struct { + _ struct{} `type:"structure"` - // Provides information about the results of a request to send a message to - // an endpoint address. - // - // MessageResponse is a required field - MessageResponse *MessageResponse `type:"structure" required:"true"` -} + // The Amazon Resource Name (ARN) of the message template. + Arn *string `type:"string"` -// String returns the string representation -func (s SendMessagesOutput) String() string { - return awsutil.Prettify(s) -} + // The date, in ISO 8601 format, when the message template was created. + // + // CreationDate is a required field + CreationDate *string `type:"string" required:"true"` -// GoString returns the string representation -func (s SendMessagesOutput) GoString() string { - return s.String() -} + // The JSON object that specifies the default values that are used for message + // variables in the message template. This object is a set of key-value pairs. + // Each key defines a message variable in the template. The corresponding value + // defines the default value for that variable. + DefaultSubstitutions *string `type:"string"` -// SetMessageResponse sets the MessageResponse field's value. -func (s *SendMessagesOutput) SetMessageResponse(v *MessageResponse) *SendMessagesOutput { - s.MessageResponse = v - return s -} + // The date, in ISO 8601 format, when the message template was last modified. + // + // LastModifiedDate is a required field + LastModifiedDate *string `type:"string" required:"true"` -// Specifies the configuration and other settings for a message to send to all -// the endpoints that are associated with a list of users. -type SendUsersMessageRequest struct { - _ struct{} `type:"structure"` + // A string-to-string map of key-value pairs that identifies the tags that are + // associated with the message template. Each tag consists of a required tag + // key and an associated tag value. + Tags map[string]*string `locationName:"tags" type:"map"` - // A map of custom attribute-value pairs. For a push notification, Amazon Pinpoint - // adds these attributes to the data.pinpoint object in the body of the notification - // payload. Amazon Pinpoint also provides these attributes in the events that - // it generates for users-messages deliveries. - Context map[string]*string `type:"map"` + // The custom description of the message template. + TemplateDescription *string `type:"string"` - // The message definitions for the default message and any default messages - // that you defined for specific channels. + // The name of the message template. // - // MessageConfiguration is a required field - MessageConfiguration *DirectMessageConfiguration `type:"structure" required:"true"` - - // The unique identifier for tracing the message. This identifier is visible - // to message recipients. - TraceId *string `type:"string"` + // TemplateName is a required field + TemplateName *string `type:"string" required:"true"` - // A map that associates user IDs with EndpointSendConfiguration objects. You - // can use an EndpointSendConfiguration object to tailor the message for a user - // by specifying settings such as content overrides and message variables. + // The type of channel that the message template is designed for. Possible values + // are: EMAIL, PUSH, SMS, and VOICE. // - // Users is a required field - Users map[string]*EndpointSendConfiguration `type:"map" required:"true"` + // TemplateType is a required field + TemplateType *string `type:"string" required:"true" enum:"TemplateType"` + + // The unique identifier, as an integer, for the active version of the message + // template. + Version *string `type:"string"` } // String returns the string representation -func (s SendUsersMessageRequest) String() string { +func (s TemplateResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SendUsersMessageRequest) GoString() string { +func (s TemplateResponse) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *SendUsersMessageRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SendUsersMessageRequest"} - if s.MessageConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("MessageConfiguration")) - } - if s.Users == nil { - invalidParams.Add(request.NewErrParamRequired("Users")) - } +// SetArn sets the Arn field's value. +func (s *TemplateResponse) SetArn(v string) *TemplateResponse { + s.Arn = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCreationDate sets the CreationDate field's value. +func (s *TemplateResponse) SetCreationDate(v string) *TemplateResponse { + s.CreationDate = &v + return s } -// SetContext sets the Context field's value. -func (s *SendUsersMessageRequest) SetContext(v map[string]*string) *SendUsersMessageRequest { - s.Context = v +// SetDefaultSubstitutions sets the DefaultSubstitutions field's value. +func (s *TemplateResponse) SetDefaultSubstitutions(v string) *TemplateResponse { + s.DefaultSubstitutions = &v return s } -// SetMessageConfiguration sets the MessageConfiguration field's value. -func (s *SendUsersMessageRequest) SetMessageConfiguration(v *DirectMessageConfiguration) *SendUsersMessageRequest { - s.MessageConfiguration = v +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *TemplateResponse) SetLastModifiedDate(v string) *TemplateResponse { + s.LastModifiedDate = &v return s } -// SetTraceId sets the TraceId field's value. -func (s *SendUsersMessageRequest) SetTraceId(v string) *SendUsersMessageRequest { - s.TraceId = &v +// SetTags sets the Tags field's value. +func (s *TemplateResponse) SetTags(v map[string]*string) *TemplateResponse { + s.Tags = v return s } -// SetUsers sets the Users field's value. -func (s *SendUsersMessageRequest) SetUsers(v map[string]*EndpointSendConfiguration) *SendUsersMessageRequest { - s.Users = v +// SetTemplateDescription sets the TemplateDescription field's value. +func (s *TemplateResponse) SetTemplateDescription(v string) *TemplateResponse { + s.TemplateDescription = &v return s } -// Provides information about which users and endpoints a message was sent to. -type SendUsersMessageResponse struct { +// SetTemplateName sets the TemplateName field's value. +func (s *TemplateResponse) SetTemplateName(v string) *TemplateResponse { + s.TemplateName = &v + return s +} + +// SetTemplateType sets the TemplateType field's value. +func (s *TemplateResponse) SetTemplateType(v string) *TemplateResponse { + s.TemplateType = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *TemplateResponse) SetVersion(v string) *TemplateResponse { + s.Version = &v + return s +} + +// Provides information about a specific version of a message template. +type TemplateVersionResponse struct { _ struct{} `type:"structure"` - // The unique identifier for the application that was used to send the message. + // The date, in ISO 8601 format, when the version of the message template was + // created. // - // ApplicationId is a required field - ApplicationId *string `type:"string" required:"true"` + // CreationDate is a required field + CreationDate *string `type:"string" required:"true"` - // The unique identifier that was assigned to the message request. - RequestId *string `type:"string"` + // A JSON object that specifies the default values that are used for message + // variables in the version of the message template. This object is a set of + // key-value pairs. Each key defines a message variable in the template. The + // corresponding value defines the default value for that variable. + DefaultSubstitutions *string `type:"string"` - // An object that indicates which endpoints the message was sent to, for each - // user. The object lists user IDs and, for each user ID, provides the endpoint - // IDs that the message was sent to. For each endpoint ID, it provides an EndpointMessageResult - // object. - Result map[string]map[string]*EndpointMessageResult `type:"map"` + // The date, in ISO 8601 format, when the version of the message template was + // last modified. + // + // LastModifiedDate is a required field + LastModifiedDate *string `type:"string" required:"true"` + + // The custom description of the version of the message template. + TemplateDescription *string `type:"string"` + + // The name of the message template. + // + // TemplateName is a required field + TemplateName *string `type:"string" required:"true"` + + // The type of channel that the message template is designed for. Possible values + // are: EMAIL, PUSH, SMS, and VOICE. + // + // TemplateType is a required field + TemplateType *string `type:"string" required:"true"` + + // The unique identifier for the version of the message template. This value + // is an integer that Amazon Pinpoint automatically increments and assigns to + // each new version of a template. + Version *string `type:"string"` } // String returns the string representation -func (s SendUsersMessageResponse) String() string { +func (s TemplateVersionResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SendUsersMessageResponse) GoString() string { +func (s TemplateVersionResponse) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *SendUsersMessageResponse) SetApplicationId(v string) *SendUsersMessageResponse { - s.ApplicationId = &v +// SetCreationDate sets the CreationDate field's value. +func (s *TemplateVersionResponse) SetCreationDate(v string) *TemplateVersionResponse { + s.CreationDate = &v return s } -// SetRequestId sets the RequestId field's value. -func (s *SendUsersMessageResponse) SetRequestId(v string) *SendUsersMessageResponse { - s.RequestId = &v +// SetDefaultSubstitutions sets the DefaultSubstitutions field's value. +func (s *TemplateVersionResponse) SetDefaultSubstitutions(v string) *TemplateVersionResponse { + s.DefaultSubstitutions = &v return s } -// SetResult sets the Result field's value. -func (s *SendUsersMessageResponse) SetResult(v map[string]map[string]*EndpointMessageResult) *SendUsersMessageResponse { - s.Result = v +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *TemplateVersionResponse) SetLastModifiedDate(v string) *TemplateVersionResponse { + s.LastModifiedDate = &v return s } -type SendUsersMessagesInput struct { - _ struct{} `type:"structure" payload:"SendUsersMessageRequest"` +// SetTemplateDescription sets the TemplateDescription field's value. +func (s *TemplateVersionResponse) SetTemplateDescription(v string) *TemplateVersionResponse { + s.TemplateDescription = &v + return s +} - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` +// SetTemplateName sets the TemplateName field's value. +func (s *TemplateVersionResponse) SetTemplateName(v string) *TemplateVersionResponse { + s.TemplateName = &v + return s +} - // Specifies the configuration and other settings for a message to send to all - // the endpoints that are associated with a list of users. +// SetTemplateType sets the TemplateType field's value. +func (s *TemplateVersionResponse) SetTemplateType(v string) *TemplateVersionResponse { + s.TemplateType = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *TemplateVersionResponse) SetVersion(v string) *TemplateVersionResponse { + s.Version = &v + return s +} + +// Provides information about all the versions of a specific message template. +type TemplateVersionsResponse struct { + _ struct{} `type:"structure"` + + // An array of responses, one for each version of the message template. // - // SendUsersMessageRequest is a required field - SendUsersMessageRequest *SendUsersMessageRequest `type:"structure" required:"true"` + // Item is a required field + Item []*TemplateVersionResponse `type:"list" required:"true"` + + // The message that's returned from the API for the request to retrieve information + // about all the versions of the message template. + Message *string `type:"string"` + + // The string to use in a subsequent request to get the next page of results + // in a paginated response. This value is null if there are no additional pages. + NextToken *string `type:"string"` + + // The unique identifier for the request to retrieve information about all the + // versions of the message template. + RequestID *string `type:"string"` } // String returns the string representation -func (s SendUsersMessagesInput) String() string { +func (s TemplateVersionsResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SendUsersMessagesInput) GoString() string { +func (s TemplateVersionsResponse) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *SendUsersMessagesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SendUsersMessagesInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) - } - if s.SendUsersMessageRequest == nil { - invalidParams.Add(request.NewErrParamRequired("SendUsersMessageRequest")) - } - if s.SendUsersMessageRequest != nil { - if err := s.SendUsersMessageRequest.Validate(); err != nil { - invalidParams.AddNested("SendUsersMessageRequest", err.(request.ErrInvalidParams)) - } - } +// SetItem sets the Item field's value. +func (s *TemplateVersionsResponse) SetItem(v []*TemplateVersionResponse) *TemplateVersionsResponse { + s.Item = v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetMessage sets the Message field's value. +func (s *TemplateVersionsResponse) SetMessage(v string) *TemplateVersionsResponse { + s.Message = &v + return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *SendUsersMessagesInput) SetApplicationId(v string) *SendUsersMessagesInput { - s.ApplicationId = &v +// SetNextToken sets the NextToken field's value. +func (s *TemplateVersionsResponse) SetNextToken(v string) *TemplateVersionsResponse { + s.NextToken = &v return s } -// SetSendUsersMessageRequest sets the SendUsersMessageRequest field's value. -func (s *SendUsersMessagesInput) SetSendUsersMessageRequest(v *SendUsersMessageRequest) *SendUsersMessagesInput { - s.SendUsersMessageRequest = v +// SetRequestID sets the RequestID field's value. +func (s *TemplateVersionsResponse) SetRequestID(v string) *TemplateVersionsResponse { + s.RequestID = &v return s } -type SendUsersMessagesOutput struct { - _ struct{} `type:"structure" payload:"SendUsersMessageResponse"` +// Provides information about all the message templates that are associated +// with your Amazon Pinpoint account. +type TemplatesResponse struct { + _ struct{} `type:"structure"` - // Provides information about which users and endpoints a message was sent to. + // An array of responses, one for each message template that's associated with + // your Amazon Pinpoint account and meets any filter criteria that you specified + // in the request. // - // SendUsersMessageResponse is a required field - SendUsersMessageResponse *SendUsersMessageResponse `type:"structure" required:"true"` + // Item is a required field + Item []*TemplateResponse `type:"list" required:"true"` + + // The string to use in a subsequent request to get the next page of results + // in a paginated response. This value is null if there are no additional pages. + NextToken *string `type:"string"` } // String returns the string representation -func (s SendUsersMessagesOutput) String() string { +func (s TemplatesResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SendUsersMessagesOutput) GoString() string { +func (s TemplatesResponse) GoString() string { return s.String() } -// SetSendUsersMessageResponse sets the SendUsersMessageResponse field's value. -func (s *SendUsersMessagesOutput) SetSendUsersMessageResponse(v *SendUsersMessageResponse) *SendUsersMessagesOutput { - s.SendUsersMessageResponse = v +// SetItem sets the Item field's value. +func (s *TemplatesResponse) SetItem(v []*TemplateResponse) *TemplatesResponse { + s.Item = v return s } -// Provides information about a session. -type Session struct { - _ struct{} `type:"structure"` - - // The duration of the session, in milliseconds. - Duration *int64 `type:"integer"` +// SetNextToken sets the NextToken field's value. +func (s *TemplatesResponse) SetNextToken(v string) *TemplatesResponse { + s.NextToken = &v + return s +} - // The unique identifier for the session. - // - // Id is a required field - Id *string `type:"string" required:"true"` +// Provides information about an API request or response. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The date and time when the session began. - // - // StartTimestamp is a required field - StartTimestamp *string `type:"string" required:"true"` + Message_ *string `locationName:"Message" type:"string"` - // The date and time when the session ended. - StopTimestamp *string `type:"string"` + RequestID_ *string `locationName:"RequestID" type:"string"` } // String returns the string representation -func (s Session) String() string { +func (s TooManyRequestsException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Session) GoString() string { +func (s TooManyRequestsException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *Session) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Session"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.StartTimestamp == nil { - invalidParams.Add(request.NewErrParamRequired("StartTimestamp")) +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetDuration sets the Duration field's value. -func (s *Session) SetDuration(v int64) *Session { - s.Duration = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil } -// SetId sets the Id field's value. -func (s *Session) SetId(v string) *Session { - s.Id = &v - return s +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetStartTimestamp sets the StartTimestamp field's value. -func (s *Session) SetStartTimestamp(v string) *Session { - s.StartTimestamp = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetStopTimestamp sets the StopTimestamp field's value. -func (s *Session) SetStopTimestamp(v string) *Session { - s.StopTimestamp = &v - return s +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID } -// Specifies the dimension type and values for a segment dimension. -type SetDimension struct { +// Specifies the settings for a campaign treatment. A treatment is a variation +// of a campaign that's used for A/B testing of a campaign. +type TreatmentResource struct { _ struct{} `type:"structure"` - // The type of segment dimension to use. Valid values are: INCLUSIVE, endpoints - // that match the criteria are included in the segment; and, EXCLUSIVE, endpoints - // that match the criteria are excluded from the segment. - DimensionType *string `type:"string" enum:"DimensionType"` + // The unique identifier for the treatment. + // + // Id is a required field + Id *string `type:"string" required:"true"` - // The criteria values to use for the segment dimension. Depending on the value - // of the DimensionType property, endpoints are included or excluded from the - // segment if their values match the criteria values. + // The message configuration settings for the treatment. + MessageConfiguration *MessageConfiguration `type:"structure"` + + // The schedule settings for the treatment. + Schedule *Schedule `type:"structure"` + + // The allocated percentage of users (segment members) that the treatment is + // sent to. // - // Values is a required field - Values []*string `type:"list" required:"true"` + // SizePercent is a required field + SizePercent *int64 `type:"integer" required:"true"` + + // The current status of the treatment. + State *CampaignState `type:"structure"` + + // The message template to use for the treatment. + TemplateConfiguration *TemplateConfiguration `type:"structure"` + + // The custom description of the treatment. + TreatmentDescription *string `type:"string"` + + // The custom name of the treatment. A treatment is a variation of a campaign + // that's used for A/B testing of a campaign. + TreatmentName *string `type:"string"` } // String returns the string representation -func (s SetDimension) String() string { +func (s TreatmentResource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SetDimension) GoString() string { +func (s TreatmentResource) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *SetDimension) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SetDimension"} - if s.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDimensionType sets the DimensionType field's value. -func (s *SetDimension) SetDimensionType(v string) *SetDimension { - s.DimensionType = &v +// SetId sets the Id field's value. +func (s *TreatmentResource) SetId(v string) *TreatmentResource { + s.Id = &v return s } -// SetValues sets the Values field's value. -func (s *SetDimension) SetValues(v []*string) *SetDimension { - s.Values = v +// SetMessageConfiguration sets the MessageConfiguration field's value. +func (s *TreatmentResource) SetMessageConfiguration(v *MessageConfiguration) *TreatmentResource { + s.MessageConfiguration = v return s } -// Specifies the content of an email message, composed of a subject, a text -// part, and an HTML part. -type SimpleEmail struct { - _ struct{} `type:"structure"` - - // The body of the email message, in HTML format. We recommend using an HTML - // part for email clients that support HTML. You can include links, formatted - // text, and more in an HTML message. - HtmlPart *SimpleEmailPart `type:"structure"` - - // The subject line, or title, of the email. - Subject *SimpleEmailPart `type:"structure"` - - // The body of the email message, in text format. We recommend using a text - // part for email clients that don't support HTML and clients that are connected - // to high-latency networks, such as mobile devices. - TextPart *SimpleEmailPart `type:"structure"` +// SetSchedule sets the Schedule field's value. +func (s *TreatmentResource) SetSchedule(v *Schedule) *TreatmentResource { + s.Schedule = v + return s } -// String returns the string representation -func (s SimpleEmail) String() string { - return awsutil.Prettify(s) +// SetSizePercent sets the SizePercent field's value. +func (s *TreatmentResource) SetSizePercent(v int64) *TreatmentResource { + s.SizePercent = &v + return s } -// GoString returns the string representation -func (s SimpleEmail) GoString() string { - return s.String() +// SetState sets the State field's value. +func (s *TreatmentResource) SetState(v *CampaignState) *TreatmentResource { + s.State = v + return s } -// SetHtmlPart sets the HtmlPart field's value. -func (s *SimpleEmail) SetHtmlPart(v *SimpleEmailPart) *SimpleEmail { - s.HtmlPart = v +// SetTemplateConfiguration sets the TemplateConfiguration field's value. +func (s *TreatmentResource) SetTemplateConfiguration(v *TemplateConfiguration) *TreatmentResource { + s.TemplateConfiguration = v return s } -// SetSubject sets the Subject field's value. -func (s *SimpleEmail) SetSubject(v *SimpleEmailPart) *SimpleEmail { - s.Subject = v +// SetTreatmentDescription sets the TreatmentDescription field's value. +func (s *TreatmentResource) SetTreatmentDescription(v string) *TreatmentResource { + s.TreatmentDescription = &v return s } -// SetTextPart sets the TextPart field's value. -func (s *SimpleEmail) SetTextPart(v *SimpleEmailPart) *SimpleEmail { - s.TextPart = v +// SetTreatmentName sets the TreatmentName field's value. +func (s *TreatmentResource) SetTreatmentName(v string) *TreatmentResource { + s.TreatmentName = &v return s } -// Specifies the subject or body of an email message, represented as textual -// email data and the applicable character set. -type SimpleEmailPart struct { +type UntagResourceInput struct { _ struct{} `type:"structure"` - // The applicable character set for the message content. - Charset *string `type:"string"` + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` - // The textual data of the message content. - Data *string `type:"string"` + // TagKeys is a required field + TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" required:"true"` } // String returns the string representation -func (s SimpleEmailPart) String() string { +func (s UntagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SimpleEmailPart) GoString() string { +func (s UntagResourceInput) GoString() string { return s.String() } -// SetCharset sets the Charset field's value. -func (s *SimpleEmailPart) SetCharset(v string) *SimpleEmailPart { - s.Charset = &v +// 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 } -// SetData sets the Data field's value. -func (s *SimpleEmailPart) SetData(v string) *SimpleEmailPart { - s.Data = &v +// SetTagKeys sets the TagKeys field's value. +func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { + s.TagKeys = v return s } -type TagResourceInput struct { - _ struct{} `type:"structure" payload:"TagsModel"` +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() +} - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` +type UpdateAdmChannelInput struct { + _ struct{} `type:"structure" payload:"ADMChannelRequest"` - // Specifies the tags (keys and values) for an application, campaign, or segment. + // Specifies the status and settings of the ADM (Amazon Device Messaging) channel + // for an application. // - // TagsModel is a required field - TagsModel *TagsModel `type:"structure" required:"true"` + // ADMChannelRequest is a required field + ADMChannelRequest *ADMChannelRequest `type:"structure" required:"true"` + + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } // String returns the string representation -func (s TagResourceInput) String() string { +func (s UpdateAdmChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TagResourceInput) GoString() string { +func (s UpdateAdmChannelInput) 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")) +func (s *UpdateAdmChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateAdmChannelInput"} + if s.ADMChannelRequest == nil { + invalidParams.Add(request.NewErrParamRequired("ADMChannelRequest")) } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } - if s.TagsModel == nil { - invalidParams.Add(request.NewErrParamRequired("TagsModel")) + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } - if s.TagsModel != nil { - if err := s.TagsModel.Validate(); err != nil { - invalidParams.AddNested("TagsModel", err.(request.ErrInvalidParams)) + if s.ADMChannelRequest != nil { + if err := s.ADMChannelRequest.Validate(); err != nil { + invalidParams.AddNested("ADMChannelRequest", err.(request.ErrInvalidParams)) } } @@ -21519,63 +29463,78 @@ func (s *TagResourceInput) Validate() error { return nil } -// SetResourceArn sets the ResourceArn field's value. -func (s *TagResourceInput) SetResourceArn(v string) *TagResourceInput { - s.ResourceArn = &v +// SetADMChannelRequest sets the ADMChannelRequest field's value. +func (s *UpdateAdmChannelInput) SetADMChannelRequest(v *ADMChannelRequest) *UpdateAdmChannelInput { + s.ADMChannelRequest = v return s } -// SetTagsModel sets the TagsModel field's value. -func (s *TagResourceInput) SetTagsModel(v *TagsModel) *TagResourceInput { - s.TagsModel = v +// SetApplicationId sets the ApplicationId field's value. +func (s *UpdateAdmChannelInput) SetApplicationId(v string) *UpdateAdmChannelInput { + s.ApplicationId = &v return s } -type TagResourceOutput struct { - _ struct{} `type:"structure"` +type UpdateAdmChannelOutput struct { + _ struct{} `type:"structure" payload:"ADMChannelResponse"` + + // Provides information about the status and settings of the ADM (Amazon Device + // Messaging) channel for an application. + // + // ADMChannelResponse is a required field + ADMChannelResponse *ADMChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s TagResourceOutput) String() string { +func (s UpdateAdmChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TagResourceOutput) GoString() string { +func (s UpdateAdmChannelOutput) GoString() string { return s.String() } -// Specifies the tags (keys and values) for an application, campaign, or segment. -type TagsModel struct { - _ struct{} `type:"structure"` +// SetADMChannelResponse sets the ADMChannelResponse field's value. +func (s *UpdateAdmChannelOutput) SetADMChannelResponse(v *ADMChannelResponse) *UpdateAdmChannelOutput { + s.ADMChannelResponse = v + return s +} - // A string-to-string map of key-value pairs that defines the tags for an application, - // campaign, or segment. A project, campaign, or segment can have a maximum - // of 50 tags. - // - // Each tag consists of a required tag key and an associated tag value. The - // maximum length of a tag key is 128 characters. The maximum length of a tag - // value is 256 characters. +type UpdateApnsChannelInput struct { + _ struct{} `type:"structure" payload:"APNSChannelRequest"` + + // Specifies the status and settings of the APNs (Apple Push Notification service) + // channel for an application. // - // Tags is a required field - Tags map[string]*string `locationName:"tags" type:"map" required:"true"` + // APNSChannelRequest is a required field + APNSChannelRequest *APNSChannelRequest `type:"structure" required:"true"` + + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } // String returns the string representation -func (s TagsModel) String() string { +func (s UpdateApnsChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TagsModel) GoString() string { +func (s UpdateApnsChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *TagsModel) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagsModel"} - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) +func (s *UpdateApnsChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateApnsChannelInput"} + if s.APNSChannelRequest == nil { + invalidParams.Add(request.NewErrParamRequired("APNSChannelRequest")) + } + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } if invalidParams.Len() > 0 { @@ -21584,128 +29543,158 @@ func (s *TagsModel) Validate() error { return nil } -// SetTags sets the Tags field's value. -func (s *TagsModel) SetTags(v map[string]*string) *TagsModel { - s.Tags = v +// SetAPNSChannelRequest sets the APNSChannelRequest field's value. +func (s *UpdateApnsChannelInput) SetAPNSChannelRequest(v *APNSChannelRequest) *UpdateApnsChannelInput { + s.APNSChannelRequest = v return s } -// Specifies the settings for a campaign treatment. A treatment is a variation -// of a campaign that's used for A/B testing of a campaign. -type TreatmentResource struct { - _ struct{} `type:"structure"` +// SetApplicationId sets the ApplicationId field's value. +func (s *UpdateApnsChannelInput) SetApplicationId(v string) *UpdateApnsChannelInput { + s.ApplicationId = &v + return s +} - // The unique identifier for the treatment. +type UpdateApnsChannelOutput struct { + _ struct{} `type:"structure" payload:"APNSChannelResponse"` + + // Provides information about the status and settings of the APNs (Apple Push + // Notification service) channel for an application. // - // Id is a required field - Id *string `type:"string" required:"true"` + // APNSChannelResponse is a required field + APNSChannelResponse *APNSChannelResponse `type:"structure" required:"true"` +} - // The message configuration settings for the treatment. - MessageConfiguration *MessageConfiguration `type:"structure"` +// String returns the string representation +func (s UpdateApnsChannelOutput) String() string { + return awsutil.Prettify(s) +} - // The schedule settings for the treatment. - Schedule *Schedule `type:"structure"` +// GoString returns the string representation +func (s UpdateApnsChannelOutput) GoString() string { + return s.String() +} - // The allocated percentage of users (segment members) that the treatment is - // sent to. - // - // SizePercent is a required field - SizePercent *int64 `type:"integer" required:"true"` +// SetAPNSChannelResponse sets the APNSChannelResponse field's value. +func (s *UpdateApnsChannelOutput) SetAPNSChannelResponse(v *APNSChannelResponse) *UpdateApnsChannelOutput { + s.APNSChannelResponse = v + return s +} - // The status of the treatment. - State *CampaignState `type:"structure"` +type UpdateApnsSandboxChannelInput struct { + _ struct{} `type:"structure" payload:"APNSSandboxChannelRequest"` - // The custom description of the treatment. - TreatmentDescription *string `type:"string"` + // Specifies the status and settings of the APNs (Apple Push Notification service) + // sandbox channel for an application. + // + // APNSSandboxChannelRequest is a required field + APNSSandboxChannelRequest *APNSSandboxChannelRequest `type:"structure" required:"true"` - // The custom name of the treatment. A treatment is a variation of a campaign - // that's used for A/B testing of a campaign. - TreatmentName *string `type:"string"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } // String returns the string representation -func (s TreatmentResource) String() string { +func (s UpdateApnsSandboxChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TreatmentResource) GoString() string { +func (s UpdateApnsSandboxChannelInput) GoString() string { return s.String() } -// SetId sets the Id field's value. -func (s *TreatmentResource) SetId(v string) *TreatmentResource { - s.Id = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateApnsSandboxChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateApnsSandboxChannelInput"} + if s.APNSSandboxChannelRequest == nil { + invalidParams.Add(request.NewErrParamRequired("APNSSandboxChannelRequest")) + } + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetMessageConfiguration sets the MessageConfiguration field's value. -func (s *TreatmentResource) SetMessageConfiguration(v *MessageConfiguration) *TreatmentResource { - s.MessageConfiguration = v +// SetAPNSSandboxChannelRequest sets the APNSSandboxChannelRequest field's value. +func (s *UpdateApnsSandboxChannelInput) SetAPNSSandboxChannelRequest(v *APNSSandboxChannelRequest) *UpdateApnsSandboxChannelInput { + s.APNSSandboxChannelRequest = v return s } -// SetSchedule sets the Schedule field's value. -func (s *TreatmentResource) SetSchedule(v *Schedule) *TreatmentResource { - s.Schedule = v +// SetApplicationId sets the ApplicationId field's value. +func (s *UpdateApnsSandboxChannelInput) SetApplicationId(v string) *UpdateApnsSandboxChannelInput { + s.ApplicationId = &v return s } -// SetSizePercent sets the SizePercent field's value. -func (s *TreatmentResource) SetSizePercent(v int64) *TreatmentResource { - s.SizePercent = &v - return s +type UpdateApnsSandboxChannelOutput struct { + _ struct{} `type:"structure" payload:"APNSSandboxChannelResponse"` + + // Provides information about the status and settings of the APNs (Apple Push + // Notification service) sandbox channel for an application. + // + // APNSSandboxChannelResponse is a required field + APNSSandboxChannelResponse *APNSSandboxChannelResponse `type:"structure" required:"true"` } -// SetState sets the State field's value. -func (s *TreatmentResource) SetState(v *CampaignState) *TreatmentResource { - s.State = v - return s +// String returns the string representation +func (s UpdateApnsSandboxChannelOutput) String() string { + return awsutil.Prettify(s) } -// SetTreatmentDescription sets the TreatmentDescription field's value. -func (s *TreatmentResource) SetTreatmentDescription(v string) *TreatmentResource { - s.TreatmentDescription = &v - return s +// GoString returns the string representation +func (s UpdateApnsSandboxChannelOutput) GoString() string { + return s.String() } -// SetTreatmentName sets the TreatmentName field's value. -func (s *TreatmentResource) SetTreatmentName(v string) *TreatmentResource { - s.TreatmentName = &v +// SetAPNSSandboxChannelResponse sets the APNSSandboxChannelResponse field's value. +func (s *UpdateApnsSandboxChannelOutput) SetAPNSSandboxChannelResponse(v *APNSSandboxChannelResponse) *UpdateApnsSandboxChannelOutput { + s.APNSSandboxChannelResponse = v return s } -type UntagResourceInput struct { - _ struct{} `type:"structure"` +type UpdateApnsVoipChannelInput struct { + _ struct{} `type:"structure" payload:"APNSVoipChannelRequest"` - // ResourceArn is a required field - ResourceArn *string `location:"uri" locationName:"resource-arn" type:"string" required:"true"` + // Specifies the status and settings of the APNs (Apple Push Notification service) + // VoIP channel for an application. + // + // APNSVoipChannelRequest is a required field + APNSVoipChannelRequest *APNSVoipChannelRequest `type:"structure" required:"true"` - // TagKeys is a required field - TagKeys []*string `location:"querystring" locationName:"tagKeys" type:"list" required:"true"` + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } // String returns the string representation -func (s UntagResourceInput) String() string { +func (s UpdateApnsVoipChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UntagResourceInput) GoString() string { +func (s UpdateApnsVoipChannelInput) 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")) +func (s *UpdateApnsVoipChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateApnsVoipChannelInput"} + if s.APNSVoipChannelRequest == nil { + invalidParams.Add(request.NewErrParamRequired("APNSVoipChannelRequest")) } - if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } if invalidParams.Len() > 0 { @@ -21714,60 +29703,72 @@ func (s *UntagResourceInput) Validate() error { return nil } -// SetResourceArn sets the ResourceArn field's value. -func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { - s.ResourceArn = &v +// SetAPNSVoipChannelRequest sets the APNSVoipChannelRequest field's value. +func (s *UpdateApnsVoipChannelInput) SetAPNSVoipChannelRequest(v *APNSVoipChannelRequest) *UpdateApnsVoipChannelInput { + s.APNSVoipChannelRequest = v return s } -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v +// SetApplicationId sets the ApplicationId field's value. +func (s *UpdateApnsVoipChannelInput) SetApplicationId(v string) *UpdateApnsVoipChannelInput { + s.ApplicationId = &v return s } -type UntagResourceOutput struct { - _ struct{} `type:"structure"` +type UpdateApnsVoipChannelOutput struct { + _ struct{} `type:"structure" payload:"APNSVoipChannelResponse"` + + // Provides information about the status and settings of the APNs (Apple Push + // Notification service) VoIP channel for an application. + // + // APNSVoipChannelResponse is a required field + APNSVoipChannelResponse *APNSVoipChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s UntagResourceOutput) String() string { +func (s UpdateApnsVoipChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UntagResourceOutput) GoString() string { +func (s UpdateApnsVoipChannelOutput) GoString() string { return s.String() } -type UpdateAdmChannelInput struct { - _ struct{} `type:"structure" payload:"ADMChannelRequest"` +// SetAPNSVoipChannelResponse sets the APNSVoipChannelResponse field's value. +func (s *UpdateApnsVoipChannelOutput) SetAPNSVoipChannelResponse(v *APNSVoipChannelResponse) *UpdateApnsVoipChannelOutput { + s.APNSVoipChannelResponse = v + return s +} - // Specifies the status and settings of the ADM (Amazon Device Messaging) channel - // for an application. +type UpdateApnsVoipSandboxChannelInput struct { + _ struct{} `type:"structure" payload:"APNSVoipSandboxChannelRequest"` + + // Specifies the status and settings of the APNs (Apple Push Notification service) + // VoIP sandbox channel for an application. // - // ADMChannelRequest is a required field - ADMChannelRequest *ADMChannelRequest `type:"structure" required:"true"` + // APNSVoipSandboxChannelRequest is a required field + APNSVoipSandboxChannelRequest *APNSVoipSandboxChannelRequest `type:"structure" required:"true"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` } // String returns the string representation -func (s UpdateAdmChannelInput) String() string { +func (s UpdateApnsVoipSandboxChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateAdmChannelInput) GoString() string { +func (s UpdateApnsVoipSandboxChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateAdmChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateAdmChannelInput"} - if s.ADMChannelRequest == nil { - invalidParams.Add(request.NewErrParamRequired("ADMChannelRequest")) +func (s *UpdateApnsVoipSandboxChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateApnsVoipSandboxChannelInput"} + if s.APNSVoipSandboxChannelRequest == nil { + invalidParams.Add(request.NewErrParamRequired("APNSVoipSandboxChannelRequest")) } if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) @@ -21775,11 +29776,6 @@ func (s *UpdateAdmChannelInput) Validate() error { if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } - if s.ADMChannelRequest != nil { - if err := s.ADMChannelRequest.Validate(); err != nil { - invalidParams.AddNested("ADMChannelRequest", err.(request.ErrInvalidParams)) - } - } if invalidParams.Len() > 0 { return invalidParams @@ -21787,79 +29783,78 @@ func (s *UpdateAdmChannelInput) Validate() error { return nil } -// SetADMChannelRequest sets the ADMChannelRequest field's value. -func (s *UpdateAdmChannelInput) SetADMChannelRequest(v *ADMChannelRequest) *UpdateAdmChannelInput { - s.ADMChannelRequest = v +// SetAPNSVoipSandboxChannelRequest sets the APNSVoipSandboxChannelRequest field's value. +func (s *UpdateApnsVoipSandboxChannelInput) SetAPNSVoipSandboxChannelRequest(v *APNSVoipSandboxChannelRequest) *UpdateApnsVoipSandboxChannelInput { + s.APNSVoipSandboxChannelRequest = v return s } // SetApplicationId sets the ApplicationId field's value. -func (s *UpdateAdmChannelInput) SetApplicationId(v string) *UpdateAdmChannelInput { +func (s *UpdateApnsVoipSandboxChannelInput) SetApplicationId(v string) *UpdateApnsVoipSandboxChannelInput { s.ApplicationId = &v return s } -type UpdateAdmChannelOutput struct { - _ struct{} `type:"structure" payload:"ADMChannelResponse"` +type UpdateApnsVoipSandboxChannelOutput struct { + _ struct{} `type:"structure" payload:"APNSVoipSandboxChannelResponse"` - // Provides information about the status and settings of the ADM (Amazon Device - // Messaging) channel for an application. + // Provides information about the status and settings of the APNs (Apple Push + // Notification service) VoIP sandbox channel for an application. // - // ADMChannelResponse is a required field - ADMChannelResponse *ADMChannelResponse `type:"structure" required:"true"` + // APNSVoipSandboxChannelResponse is a required field + APNSVoipSandboxChannelResponse *APNSVoipSandboxChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateAdmChannelOutput) String() string { +func (s UpdateApnsVoipSandboxChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateAdmChannelOutput) GoString() string { +func (s UpdateApnsVoipSandboxChannelOutput) GoString() string { return s.String() } -// SetADMChannelResponse sets the ADMChannelResponse field's value. -func (s *UpdateAdmChannelOutput) SetADMChannelResponse(v *ADMChannelResponse) *UpdateAdmChannelOutput { - s.ADMChannelResponse = v +// SetAPNSVoipSandboxChannelResponse sets the APNSVoipSandboxChannelResponse field's value. +func (s *UpdateApnsVoipSandboxChannelOutput) SetAPNSVoipSandboxChannelResponse(v *APNSVoipSandboxChannelResponse) *UpdateApnsVoipSandboxChannelOutput { + s.APNSVoipSandboxChannelResponse = v return s } -type UpdateApnsChannelInput struct { - _ struct{} `type:"structure" payload:"APNSChannelRequest"` - - // Specifies the status and settings of the APNs (Apple Push Notification service) - // channel for an application. - // - // APNSChannelRequest is a required field - APNSChannelRequest *APNSChannelRequest `type:"structure" required:"true"` +type UpdateApplicationSettingsInput struct { + _ struct{} `type:"structure" payload:"WriteApplicationSettingsRequest"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + // Specifies the default settings for an application. + // + // WriteApplicationSettingsRequest is a required field + WriteApplicationSettingsRequest *WriteApplicationSettingsRequest `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateApnsChannelInput) String() string { +func (s UpdateApplicationSettingsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateApnsChannelInput) GoString() string { +func (s UpdateApplicationSettingsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateApnsChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateApnsChannelInput"} - if s.APNSChannelRequest == nil { - invalidParams.Add(request.NewErrParamRequired("APNSChannelRequest")) - } +func (s *UpdateApplicationSettingsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateApplicationSettingsInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } + if s.WriteApplicationSettingsRequest == nil { + invalidParams.Add(request.NewErrParamRequired("WriteApplicationSettingsRequest")) + } if invalidParams.Len() > 0 { return invalidParams @@ -21867,79 +29862,112 @@ func (s *UpdateApnsChannelInput) Validate() error { return nil } -// SetAPNSChannelRequest sets the APNSChannelRequest field's value. -func (s *UpdateApnsChannelInput) SetAPNSChannelRequest(v *APNSChannelRequest) *UpdateApnsChannelInput { - s.APNSChannelRequest = v +// SetApplicationId sets the ApplicationId field's value. +func (s *UpdateApplicationSettingsInput) SetApplicationId(v string) *UpdateApplicationSettingsInput { + s.ApplicationId = &v return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateApnsChannelInput) SetApplicationId(v string) *UpdateApnsChannelInput { - s.ApplicationId = &v +// SetWriteApplicationSettingsRequest sets the WriteApplicationSettingsRequest field's value. +func (s *UpdateApplicationSettingsInput) SetWriteApplicationSettingsRequest(v *WriteApplicationSettingsRequest) *UpdateApplicationSettingsInput { + s.WriteApplicationSettingsRequest = v return s } -type UpdateApnsChannelOutput struct { - _ struct{} `type:"structure" payload:"APNSChannelResponse"` +type UpdateApplicationSettingsOutput struct { + _ struct{} `type:"structure" payload:"ApplicationSettingsResource"` - // Provides information about the status and settings of the APNs (Apple Push - // Notification service) channel for an application. + // Provides information about an application, including the default settings + // for an application. // - // APNSChannelResponse is a required field - APNSChannelResponse *APNSChannelResponse `type:"structure" required:"true"` + // ApplicationSettingsResource is a required field + ApplicationSettingsResource *ApplicationSettingsResource `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateApnsChannelOutput) String() string { +func (s UpdateApplicationSettingsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateApnsChannelOutput) GoString() string { +func (s UpdateApplicationSettingsOutput) GoString() string { return s.String() } -// SetAPNSChannelResponse sets the APNSChannelResponse field's value. -func (s *UpdateApnsChannelOutput) SetAPNSChannelResponse(v *APNSChannelResponse) *UpdateApnsChannelOutput { - s.APNSChannelResponse = v +// SetApplicationSettingsResource sets the ApplicationSettingsResource field's value. +func (s *UpdateApplicationSettingsOutput) SetApplicationSettingsResource(v *ApplicationSettingsResource) *UpdateApplicationSettingsOutput { + s.ApplicationSettingsResource = v return s } -type UpdateApnsSandboxChannelInput struct { - _ struct{} `type:"structure" payload:"APNSSandboxChannelRequest"` +// Specifies one or more attributes to remove from all the endpoints that are +// associated with an application. +type UpdateAttributesRequest struct { + _ struct{} `type:"structure"` - // Specifies the status and settings of the APNs (Apple Push Notification service) - // sandbox channel for an application. - // - // APNSSandboxChannelRequest is a required field - APNSSandboxChannelRequest *APNSSandboxChannelRequest `type:"structure" required:"true"` + // An array of the attributes to remove from all the endpoints that are associated + // with the application. The array can specify the complete, exact name of each + // attribute to remove or it can specify a glob pattern that an attribute name + // must match in order for the attribute to be removed. + Blacklist []*string `type:"list"` +} + +// String returns the string representation +func (s UpdateAttributesRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateAttributesRequest) GoString() string { + return s.String() +} + +// SetBlacklist sets the Blacklist field's value. +func (s *UpdateAttributesRequest) SetBlacklist(v []*string) *UpdateAttributesRequest { + s.Blacklist = v + return s +} + +type UpdateBaiduChannelInput struct { + _ struct{} `type:"structure" payload:"BaiduChannelRequest"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + // Specifies the status and settings of the Baidu (Baidu Cloud Push) channel + // for an application. + // + // BaiduChannelRequest is a required field + BaiduChannelRequest *BaiduChannelRequest `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateApnsSandboxChannelInput) String() string { +func (s UpdateBaiduChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateApnsSandboxChannelInput) GoString() string { +func (s UpdateBaiduChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateApnsSandboxChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateApnsSandboxChannelInput"} - if s.APNSSandboxChannelRequest == nil { - invalidParams.Add(request.NewErrParamRequired("APNSSandboxChannelRequest")) - } +func (s *UpdateBaiduChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateBaiduChannelInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } + if s.BaiduChannelRequest == nil { + invalidParams.Add(request.NewErrParamRequired("BaiduChannelRequest")) + } + if s.BaiduChannelRequest != nil { + if err := s.BaiduChannelRequest.Validate(); err != nil { + invalidParams.AddNested("BaiduChannelRequest", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -21947,79 +29975,92 @@ func (s *UpdateApnsSandboxChannelInput) Validate() error { return nil } -// SetAPNSSandboxChannelRequest sets the APNSSandboxChannelRequest field's value. -func (s *UpdateApnsSandboxChannelInput) SetAPNSSandboxChannelRequest(v *APNSSandboxChannelRequest) *UpdateApnsSandboxChannelInput { - s.APNSSandboxChannelRequest = v +// SetApplicationId sets the ApplicationId field's value. +func (s *UpdateBaiduChannelInput) SetApplicationId(v string) *UpdateBaiduChannelInput { + s.ApplicationId = &v return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateApnsSandboxChannelInput) SetApplicationId(v string) *UpdateApnsSandboxChannelInput { - s.ApplicationId = &v +// SetBaiduChannelRequest sets the BaiduChannelRequest field's value. +func (s *UpdateBaiduChannelInput) SetBaiduChannelRequest(v *BaiduChannelRequest) *UpdateBaiduChannelInput { + s.BaiduChannelRequest = v return s } -type UpdateApnsSandboxChannelOutput struct { - _ struct{} `type:"structure" payload:"APNSSandboxChannelResponse"` +type UpdateBaiduChannelOutput struct { + _ struct{} `type:"structure" payload:"BaiduChannelResponse"` - // Provides information about the status and settings of the APNs (Apple Push - // Notification service) sandbox channel for an application. + // Provides information about the status and settings of the Baidu (Baidu Cloud + // Push) channel for an application. // - // APNSSandboxChannelResponse is a required field - APNSSandboxChannelResponse *APNSSandboxChannelResponse `type:"structure" required:"true"` + // BaiduChannelResponse is a required field + BaiduChannelResponse *BaiduChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateApnsSandboxChannelOutput) String() string { +func (s UpdateBaiduChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateApnsSandboxChannelOutput) GoString() string { +func (s UpdateBaiduChannelOutput) GoString() string { return s.String() } -// SetAPNSSandboxChannelResponse sets the APNSSandboxChannelResponse field's value. -func (s *UpdateApnsSandboxChannelOutput) SetAPNSSandboxChannelResponse(v *APNSSandboxChannelResponse) *UpdateApnsSandboxChannelOutput { - s.APNSSandboxChannelResponse = v +// SetBaiduChannelResponse sets the BaiduChannelResponse field's value. +func (s *UpdateBaiduChannelOutput) SetBaiduChannelResponse(v *BaiduChannelResponse) *UpdateBaiduChannelOutput { + s.BaiduChannelResponse = v return s } -type UpdateApnsVoipChannelInput struct { - _ struct{} `type:"structure" payload:"APNSVoipChannelRequest"` - - // Specifies the status and settings of the APNs (Apple Push Notification service) - // VoIP channel for an application. - // - // APNSVoipChannelRequest is a required field - APNSVoipChannelRequest *APNSVoipChannelRequest `type:"structure" required:"true"` +type UpdateCampaignInput struct { + _ struct{} `type:"structure" payload:"WriteCampaignRequest"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + // CampaignId is a required field + CampaignId *string `location:"uri" locationName:"campaign-id" type:"string" required:"true"` + + // Specifies the configuration and other settings for a campaign. + // + // WriteCampaignRequest is a required field + WriteCampaignRequest *WriteCampaignRequest `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateApnsVoipChannelInput) String() string { +func (s UpdateCampaignInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateApnsVoipChannelInput) GoString() string { +func (s UpdateCampaignInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateApnsVoipChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateApnsVoipChannelInput"} - if s.APNSVoipChannelRequest == nil { - invalidParams.Add(request.NewErrParamRequired("APNSVoipChannelRequest")) - } +func (s *UpdateCampaignInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateCampaignInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } + if s.CampaignId == nil { + invalidParams.Add(request.NewErrParamRequired("CampaignId")) + } + if s.CampaignId != nil && len(*s.CampaignId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CampaignId", 1)) + } + if s.WriteCampaignRequest == nil { + invalidParams.Add(request.NewErrParamRequired("WriteCampaignRequest")) + } + if s.WriteCampaignRequest != nil { + if err := s.WriteCampaignRequest.Validate(); err != nil { + invalidParams.AddNested("WriteCampaignRequest", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -22027,79 +30068,89 @@ func (s *UpdateApnsVoipChannelInput) Validate() error { return nil } -// SetAPNSVoipChannelRequest sets the APNSVoipChannelRequest field's value. -func (s *UpdateApnsVoipChannelInput) SetAPNSVoipChannelRequest(v *APNSVoipChannelRequest) *UpdateApnsVoipChannelInput { - s.APNSVoipChannelRequest = v +// SetApplicationId sets the ApplicationId field's value. +func (s *UpdateCampaignInput) SetApplicationId(v string) *UpdateCampaignInput { + s.ApplicationId = &v return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateApnsVoipChannelInput) SetApplicationId(v string) *UpdateApnsVoipChannelInput { - s.ApplicationId = &v +// SetCampaignId sets the CampaignId field's value. +func (s *UpdateCampaignInput) SetCampaignId(v string) *UpdateCampaignInput { + s.CampaignId = &v return s } -type UpdateApnsVoipChannelOutput struct { - _ struct{} `type:"structure" payload:"APNSVoipChannelResponse"` +// SetWriteCampaignRequest sets the WriteCampaignRequest field's value. +func (s *UpdateCampaignInput) SetWriteCampaignRequest(v *WriteCampaignRequest) *UpdateCampaignInput { + s.WriteCampaignRequest = v + return s +} - // Provides information about the status and settings of the APNs (Apple Push - // Notification service) VoIP channel for an application. +type UpdateCampaignOutput struct { + _ struct{} `type:"structure" payload:"CampaignResponse"` + + // Provides information about the status, configuration, and other settings + // for a campaign. // - // APNSVoipChannelResponse is a required field - APNSVoipChannelResponse *APNSVoipChannelResponse `type:"structure" required:"true"` + // CampaignResponse is a required field + CampaignResponse *CampaignResponse `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateApnsVoipChannelOutput) String() string { +func (s UpdateCampaignOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateApnsVoipChannelOutput) GoString() string { +func (s UpdateCampaignOutput) GoString() string { return s.String() } -// SetAPNSVoipChannelResponse sets the APNSVoipChannelResponse field's value. -func (s *UpdateApnsVoipChannelOutput) SetAPNSVoipChannelResponse(v *APNSVoipChannelResponse) *UpdateApnsVoipChannelOutput { - s.APNSVoipChannelResponse = v +// SetCampaignResponse sets the CampaignResponse field's value. +func (s *UpdateCampaignOutput) SetCampaignResponse(v *CampaignResponse) *UpdateCampaignOutput { + s.CampaignResponse = v return s } -type UpdateApnsVoipSandboxChannelInput struct { - _ struct{} `type:"structure" payload:"APNSVoipSandboxChannelRequest"` - - // Specifies the status and settings of the APNs (Apple Push Notification service) - // VoIP sandbox channel for an application. - // - // APNSVoipSandboxChannelRequest is a required field - APNSVoipSandboxChannelRequest *APNSVoipSandboxChannelRequest `type:"structure" required:"true"` +type UpdateEmailChannelInput struct { + _ struct{} `type:"structure" payload:"EmailChannelRequest"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + // Specifies the status and settings of the email channel for an application. + // + // EmailChannelRequest is a required field + EmailChannelRequest *EmailChannelRequest `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateApnsVoipSandboxChannelInput) String() string { +func (s UpdateEmailChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateApnsVoipSandboxChannelInput) GoString() string { +func (s UpdateEmailChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateApnsVoipSandboxChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateApnsVoipSandboxChannelInput"} - if s.APNSVoipSandboxChannelRequest == nil { - invalidParams.Add(request.NewErrParamRequired("APNSVoipSandboxChannelRequest")) - } +func (s *UpdateEmailChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateEmailChannelInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } + if s.EmailChannelRequest == nil { + invalidParams.Add(request.NewErrParamRequired("EmailChannelRequest")) + } + if s.EmailChannelRequest != nil { + if err := s.EmailChannelRequest.Validate(); err != nil { + invalidParams.AddNested("EmailChannelRequest", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -22107,77 +30158,82 @@ func (s *UpdateApnsVoipSandboxChannelInput) Validate() error { return nil } -// SetAPNSVoipSandboxChannelRequest sets the APNSVoipSandboxChannelRequest field's value. -func (s *UpdateApnsVoipSandboxChannelInput) SetAPNSVoipSandboxChannelRequest(v *APNSVoipSandboxChannelRequest) *UpdateApnsVoipSandboxChannelInput { - s.APNSVoipSandboxChannelRequest = v +// SetApplicationId sets the ApplicationId field's value. +func (s *UpdateEmailChannelInput) SetApplicationId(v string) *UpdateEmailChannelInput { + s.ApplicationId = &v return s } -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateApnsVoipSandboxChannelInput) SetApplicationId(v string) *UpdateApnsVoipSandboxChannelInput { - s.ApplicationId = &v +// SetEmailChannelRequest sets the EmailChannelRequest field's value. +func (s *UpdateEmailChannelInput) SetEmailChannelRequest(v *EmailChannelRequest) *UpdateEmailChannelInput { + s.EmailChannelRequest = v return s } -type UpdateApnsVoipSandboxChannelOutput struct { - _ struct{} `type:"structure" payload:"APNSVoipSandboxChannelResponse"` +type UpdateEmailChannelOutput struct { + _ struct{} `type:"structure" payload:"EmailChannelResponse"` - // Provides information about the status and settings of the APNs (Apple Push - // Notification service) VoIP sandbox channel for an application. + // Provides information about the status and settings of the email channel for + // an application. // - // APNSVoipSandboxChannelResponse is a required field - APNSVoipSandboxChannelResponse *APNSVoipSandboxChannelResponse `type:"structure" required:"true"` + // EmailChannelResponse is a required field + EmailChannelResponse *EmailChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateApnsVoipSandboxChannelOutput) String() string { +func (s UpdateEmailChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateApnsVoipSandboxChannelOutput) GoString() string { +func (s UpdateEmailChannelOutput) GoString() string { return s.String() } -// SetAPNSVoipSandboxChannelResponse sets the APNSVoipSandboxChannelResponse field's value. -func (s *UpdateApnsVoipSandboxChannelOutput) SetAPNSVoipSandboxChannelResponse(v *APNSVoipSandboxChannelResponse) *UpdateApnsVoipSandboxChannelOutput { - s.APNSVoipSandboxChannelResponse = v +// SetEmailChannelResponse sets the EmailChannelResponse field's value. +func (s *UpdateEmailChannelOutput) SetEmailChannelResponse(v *EmailChannelResponse) *UpdateEmailChannelOutput { + s.EmailChannelResponse = v return s } -type UpdateApplicationSettingsInput struct { - _ struct{} `type:"structure" payload:"WriteApplicationSettingsRequest"` +type UpdateEmailTemplateInput struct { + _ struct{} `type:"structure" payload:"EmailTemplateRequest"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + CreateNewVersion *bool `location:"querystring" locationName:"create-new-version" type:"boolean"` - // Specifies the default settings for an application. + // Specifies the content and settings for a message template that can be used + // in messages that are sent through the email channel. // - // WriteApplicationSettingsRequest is a required field - WriteApplicationSettingsRequest *WriteApplicationSettingsRequest `type:"structure" required:"true"` + // EmailTemplateRequest is a required field + EmailTemplateRequest *EmailTemplateRequest `type:"structure" required:"true"` + + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` + + Version *string `location:"querystring" locationName:"version" type:"string"` } // String returns the string representation -func (s UpdateApplicationSettingsInput) String() string { +func (s UpdateEmailTemplateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateApplicationSettingsInput) GoString() string { +func (s UpdateEmailTemplateInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateApplicationSettingsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateApplicationSettingsInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) +func (s *UpdateEmailTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateEmailTemplateInput"} + if s.EmailTemplateRequest == nil { + invalidParams.Add(request.NewErrParamRequired("EmailTemplateRequest")) } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + if s.TemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateName")) } - if s.WriteApplicationSettingsRequest == nil { - invalidParams.Add(request.NewErrParamRequired("WriteApplicationSettingsRequest")) + if s.TemplateName != nil && len(*s.TemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) } if invalidParams.Len() > 0 { @@ -22186,111 +30242,97 @@ func (s *UpdateApplicationSettingsInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateApplicationSettingsInput) SetApplicationId(v string) *UpdateApplicationSettingsInput { - s.ApplicationId = &v +// SetCreateNewVersion sets the CreateNewVersion field's value. +func (s *UpdateEmailTemplateInput) SetCreateNewVersion(v bool) *UpdateEmailTemplateInput { + s.CreateNewVersion = &v return s } -// SetWriteApplicationSettingsRequest sets the WriteApplicationSettingsRequest field's value. -func (s *UpdateApplicationSettingsInput) SetWriteApplicationSettingsRequest(v *WriteApplicationSettingsRequest) *UpdateApplicationSettingsInput { - s.WriteApplicationSettingsRequest = v +// SetEmailTemplateRequest sets the EmailTemplateRequest field's value. +func (s *UpdateEmailTemplateInput) SetEmailTemplateRequest(v *EmailTemplateRequest) *UpdateEmailTemplateInput { + s.EmailTemplateRequest = v return s } -type UpdateApplicationSettingsOutput struct { - _ struct{} `type:"structure" payload:"ApplicationSettingsResource"` - - // Provides information about an application, including the default settings - // for an application. - // - // ApplicationSettingsResource is a required field - ApplicationSettingsResource *ApplicationSettingsResource `type:"structure" required:"true"` -} - -// String returns the string representation -func (s UpdateApplicationSettingsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s UpdateApplicationSettingsOutput) GoString() string { - return s.String() +// SetTemplateName sets the TemplateName field's value. +func (s *UpdateEmailTemplateInput) SetTemplateName(v string) *UpdateEmailTemplateInput { + s.TemplateName = &v + return s } -// SetApplicationSettingsResource sets the ApplicationSettingsResource field's value. -func (s *UpdateApplicationSettingsOutput) SetApplicationSettingsResource(v *ApplicationSettingsResource) *UpdateApplicationSettingsOutput { - s.ApplicationSettingsResource = v +// SetVersion sets the Version field's value. +func (s *UpdateEmailTemplateInput) SetVersion(v string) *UpdateEmailTemplateInput { + s.Version = &v return s } -// Specifies one or more attributes to remove from all the endpoints that are -// associated with an application. -type UpdateAttributesRequest struct { - _ struct{} `type:"structure"` +type UpdateEmailTemplateOutput struct { + _ struct{} `type:"structure" payload:"MessageBody"` - // An array of the attributes to remove from all the endpoints that are associated - // with the application. The array can specify the complete, exact name of each - // attribute to remove or it can specify a glob pattern that an attribute name - // must match in order for the attribute to be removed. - Blacklist []*string `type:"list"` + // Provides information about an API request or response. + // + // MessageBody is a required field + MessageBody *MessageBody `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateAttributesRequest) String() string { +func (s UpdateEmailTemplateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateAttributesRequest) GoString() string { +func (s UpdateEmailTemplateOutput) GoString() string { return s.String() } -// SetBlacklist sets the Blacklist field's value. -func (s *UpdateAttributesRequest) SetBlacklist(v []*string) *UpdateAttributesRequest { - s.Blacklist = v +// SetMessageBody sets the MessageBody field's value. +func (s *UpdateEmailTemplateOutput) SetMessageBody(v *MessageBody) *UpdateEmailTemplateOutput { + s.MessageBody = v return s } -type UpdateBaiduChannelInput struct { - _ struct{} `type:"structure" payload:"BaiduChannelRequest"` +type UpdateEndpointInput struct { + _ struct{} `type:"structure" payload:"EndpointRequest"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // Specifies the status and settings of the Baidu (Baidu Cloud Push) channel - // for an application. + // EndpointId is a required field + EndpointId *string `location:"uri" locationName:"endpoint-id" type:"string" required:"true"` + + // Specifies the channel type and other settings for an endpoint. // - // BaiduChannelRequest is a required field - BaiduChannelRequest *BaiduChannelRequest `type:"structure" required:"true"` + // EndpointRequest is a required field + EndpointRequest *EndpointRequest `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateBaiduChannelInput) String() string { +func (s UpdateEndpointInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateBaiduChannelInput) GoString() string { +func (s UpdateEndpointInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateBaiduChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateBaiduChannelInput"} +func (s *UpdateEndpointInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateEndpointInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } - if s.BaiduChannelRequest == nil { - invalidParams.Add(request.NewErrParamRequired("BaiduChannelRequest")) + if s.EndpointId == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointId")) + } + if s.EndpointId != nil && len(*s.EndpointId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("EndpointId", 1)) } - if s.BaiduChannelRequest != nil { - if err := s.BaiduChannelRequest.Validate(); err != nil { - invalidParams.AddNested("BaiduChannelRequest", err.(request.ErrInvalidParams)) - } + if s.EndpointRequest == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointRequest")) } if invalidParams.Len() > 0 { @@ -22300,89 +30342,86 @@ func (s *UpdateBaiduChannelInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *UpdateBaiduChannelInput) SetApplicationId(v string) *UpdateBaiduChannelInput { +func (s *UpdateEndpointInput) SetApplicationId(v string) *UpdateEndpointInput { s.ApplicationId = &v return s } -// SetBaiduChannelRequest sets the BaiduChannelRequest field's value. -func (s *UpdateBaiduChannelInput) SetBaiduChannelRequest(v *BaiduChannelRequest) *UpdateBaiduChannelInput { - s.BaiduChannelRequest = v +// SetEndpointId sets the EndpointId field's value. +func (s *UpdateEndpointInput) SetEndpointId(v string) *UpdateEndpointInput { + s.EndpointId = &v return s } -type UpdateBaiduChannelOutput struct { - _ struct{} `type:"structure" payload:"BaiduChannelResponse"` +// SetEndpointRequest sets the EndpointRequest field's value. +func (s *UpdateEndpointInput) SetEndpointRequest(v *EndpointRequest) *UpdateEndpointInput { + s.EndpointRequest = v + return s +} - // Provides information about the status and settings of the Baidu (Baidu Cloud - // Push) channel for an application. +type UpdateEndpointOutput struct { + _ struct{} `type:"structure" payload:"MessageBody"` + + // Provides information about an API request or response. // - // BaiduChannelResponse is a required field - BaiduChannelResponse *BaiduChannelResponse `type:"structure" required:"true"` + // MessageBody is a required field + MessageBody *MessageBody `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateBaiduChannelOutput) String() string { +func (s UpdateEndpointOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateBaiduChannelOutput) GoString() string { +func (s UpdateEndpointOutput) GoString() string { return s.String() } -// SetBaiduChannelResponse sets the BaiduChannelResponse field's value. -func (s *UpdateBaiduChannelOutput) SetBaiduChannelResponse(v *BaiduChannelResponse) *UpdateBaiduChannelOutput { - s.BaiduChannelResponse = v +// SetMessageBody sets the MessageBody field's value. +func (s *UpdateEndpointOutput) SetMessageBody(v *MessageBody) *UpdateEndpointOutput { + s.MessageBody = v return s } -type UpdateCampaignInput struct { - _ struct{} `type:"structure" payload:"WriteCampaignRequest"` +type UpdateEndpointsBatchInput struct { + _ struct{} `type:"structure" payload:"EndpointBatchRequest"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // CampaignId is a required field - CampaignId *string `location:"uri" locationName:"campaign-id" type:"string" required:"true"` - - // Specifies the configuration and other settings for a campaign. + // Specifies a batch of endpoints to create or update and the settings and attributes + // to set or change for each endpoint. // - // WriteCampaignRequest is a required field - WriteCampaignRequest *WriteCampaignRequest `type:"structure" required:"true"` + // EndpointBatchRequest is a required field + EndpointBatchRequest *EndpointBatchRequest `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateCampaignInput) String() string { +func (s UpdateEndpointsBatchInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateCampaignInput) GoString() string { +func (s UpdateEndpointsBatchInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateCampaignInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateCampaignInput"} +func (s *UpdateEndpointsBatchInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateEndpointsBatchInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } - if s.CampaignId == nil { - invalidParams.Add(request.NewErrParamRequired("CampaignId")) - } - if s.CampaignId != nil && len(*s.CampaignId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CampaignId", 1)) - } - if s.WriteCampaignRequest == nil { - invalidParams.Add(request.NewErrParamRequired("WriteCampaignRequest")) + if s.EndpointBatchRequest == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointBatchRequest")) } - if s.WriteCampaignRequest != nil { - if err := s.WriteCampaignRequest.Validate(); err != nil { - invalidParams.AddNested("WriteCampaignRequest", err.(request.ErrInvalidParams)) + if s.EndpointBatchRequest != nil { + if err := s.EndpointBatchRequest.Validate(); err != nil { + invalidParams.AddNested("EndpointBatchRequest", err.(request.ErrInvalidParams)) } } @@ -22393,86 +30432,81 @@ func (s *UpdateCampaignInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *UpdateCampaignInput) SetApplicationId(v string) *UpdateCampaignInput { +func (s *UpdateEndpointsBatchInput) SetApplicationId(v string) *UpdateEndpointsBatchInput { s.ApplicationId = &v return s } -// SetCampaignId sets the CampaignId field's value. -func (s *UpdateCampaignInput) SetCampaignId(v string) *UpdateCampaignInput { - s.CampaignId = &v - return s -} - -// SetWriteCampaignRequest sets the WriteCampaignRequest field's value. -func (s *UpdateCampaignInput) SetWriteCampaignRequest(v *WriteCampaignRequest) *UpdateCampaignInput { - s.WriteCampaignRequest = v +// SetEndpointBatchRequest sets the EndpointBatchRequest field's value. +func (s *UpdateEndpointsBatchInput) SetEndpointBatchRequest(v *EndpointBatchRequest) *UpdateEndpointsBatchInput { + s.EndpointBatchRequest = v return s } -type UpdateCampaignOutput struct { - _ struct{} `type:"structure" payload:"CampaignResponse"` +type UpdateEndpointsBatchOutput struct { + _ struct{} `type:"structure" payload:"MessageBody"` - // Provides information about the status, configuration, and other settings - // for a campaign. + // Provides information about an API request or response. // - // CampaignResponse is a required field - CampaignResponse *CampaignResponse `type:"structure" required:"true"` + // MessageBody is a required field + MessageBody *MessageBody `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateCampaignOutput) String() string { +func (s UpdateEndpointsBatchOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateCampaignOutput) GoString() string { +func (s UpdateEndpointsBatchOutput) GoString() string { return s.String() } -// SetCampaignResponse sets the CampaignResponse field's value. -func (s *UpdateCampaignOutput) SetCampaignResponse(v *CampaignResponse) *UpdateCampaignOutput { - s.CampaignResponse = v +// SetMessageBody sets the MessageBody field's value. +func (s *UpdateEndpointsBatchOutput) SetMessageBody(v *MessageBody) *UpdateEndpointsBatchOutput { + s.MessageBody = v return s } -type UpdateEmailChannelInput struct { - _ struct{} `type:"structure" payload:"EmailChannelRequest"` +type UpdateGcmChannelInput struct { + _ struct{} `type:"structure" payload:"GCMChannelRequest"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // Specifies the status and settings of the email channel for an application. + // Specifies the status and settings of the GCM channel for an application. + // This channel enables Amazon Pinpoint to send push notifications through the + // Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging (GCM), service. // - // EmailChannelRequest is a required field - EmailChannelRequest *EmailChannelRequest `type:"structure" required:"true"` + // GCMChannelRequest is a required field + GCMChannelRequest *GCMChannelRequest `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateEmailChannelInput) String() string { +func (s UpdateGcmChannelInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateEmailChannelInput) GoString() string { +func (s UpdateGcmChannelInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateEmailChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateEmailChannelInput"} +func (s *UpdateGcmChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateGcmChannelInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } - if s.EmailChannelRequest == nil { - invalidParams.Add(request.NewErrParamRequired("EmailChannelRequest")) + if s.GCMChannelRequest == nil { + invalidParams.Add(request.NewErrParamRequired("GCMChannelRequest")) } - if s.EmailChannelRequest != nil { - if err := s.EmailChannelRequest.Validate(); err != nil { - invalidParams.AddNested("EmailChannelRequest", err.(request.ErrInvalidParams)) + if s.GCMChannelRequest != nil { + if err := s.GCMChannelRequest.Validate(); err != nil { + invalidParams.AddNested("GCMChannelRequest", err.(request.ErrInvalidParams)) } } @@ -22483,85 +30517,92 @@ func (s *UpdateEmailChannelInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *UpdateEmailChannelInput) SetApplicationId(v string) *UpdateEmailChannelInput { +func (s *UpdateGcmChannelInput) SetApplicationId(v string) *UpdateGcmChannelInput { s.ApplicationId = &v return s } -// SetEmailChannelRequest sets the EmailChannelRequest field's value. -func (s *UpdateEmailChannelInput) SetEmailChannelRequest(v *EmailChannelRequest) *UpdateEmailChannelInput { - s.EmailChannelRequest = v +// SetGCMChannelRequest sets the GCMChannelRequest field's value. +func (s *UpdateGcmChannelInput) SetGCMChannelRequest(v *GCMChannelRequest) *UpdateGcmChannelInput { + s.GCMChannelRequest = v return s } -type UpdateEmailChannelOutput struct { - _ struct{} `type:"structure" payload:"EmailChannelResponse"` +type UpdateGcmChannelOutput struct { + _ struct{} `type:"structure" payload:"GCMChannelResponse"` - // Provides information about the status and settings of the email channel for - // an application. + // Provides information about the status and settings of the GCM channel for + // an application. The GCM channel enables Amazon Pinpoint to send push notifications + // through the Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging + // (GCM), service. // - // EmailChannelResponse is a required field - EmailChannelResponse *EmailChannelResponse `type:"structure" required:"true"` + // GCMChannelResponse is a required field + GCMChannelResponse *GCMChannelResponse `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateEmailChannelOutput) String() string { +func (s UpdateGcmChannelOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateEmailChannelOutput) GoString() string { +func (s UpdateGcmChannelOutput) GoString() string { return s.String() } -// SetEmailChannelResponse sets the EmailChannelResponse field's value. -func (s *UpdateEmailChannelOutput) SetEmailChannelResponse(v *EmailChannelResponse) *UpdateEmailChannelOutput { - s.EmailChannelResponse = v +// SetGCMChannelResponse sets the GCMChannelResponse field's value. +func (s *UpdateGcmChannelOutput) SetGCMChannelResponse(v *GCMChannelResponse) *UpdateGcmChannelOutput { + s.GCMChannelResponse = v return s } -type UpdateEndpointInput struct { - _ struct{} `type:"structure" payload:"EndpointRequest"` +type UpdateJourneyInput struct { + _ struct{} `type:"structure" payload:"WriteJourneyRequest"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // EndpointId is a required field - EndpointId *string `location:"uri" locationName:"endpoint-id" type:"string" required:"true"` + // JourneyId is a required field + JourneyId *string `location:"uri" locationName:"journey-id" type:"string" required:"true"` - // Specifies the channel type and other settings for an endpoint. + // Specifies the configuration and other settings for a journey. // - // EndpointRequest is a required field - EndpointRequest *EndpointRequest `type:"structure" required:"true"` + // WriteJourneyRequest is a required field + WriteJourneyRequest *WriteJourneyRequest `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateEndpointInput) String() string { +func (s UpdateJourneyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateEndpointInput) GoString() string { +func (s UpdateJourneyInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateEndpointInput"} +func (s *UpdateJourneyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateJourneyInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } - if s.EndpointId == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointId")) + if s.JourneyId == nil { + invalidParams.Add(request.NewErrParamRequired("JourneyId")) } - if s.EndpointId != nil && len(*s.EndpointId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EndpointId", 1)) + if s.JourneyId != nil && len(*s.JourneyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("JourneyId", 1)) } - if s.EndpointRequest == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointRequest")) + if s.WriteJourneyRequest == nil { + invalidParams.Add(request.NewErrParamRequired("WriteJourneyRequest")) + } + if s.WriteJourneyRequest != nil { + if err := s.WriteJourneyRequest.Validate(); err != nil { + invalidParams.AddNested("WriteJourneyRequest", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -22571,87 +30612,91 @@ func (s *UpdateEndpointInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *UpdateEndpointInput) SetApplicationId(v string) *UpdateEndpointInput { +func (s *UpdateJourneyInput) SetApplicationId(v string) *UpdateJourneyInput { s.ApplicationId = &v return s } -// SetEndpointId sets the EndpointId field's value. -func (s *UpdateEndpointInput) SetEndpointId(v string) *UpdateEndpointInput { - s.EndpointId = &v +// SetJourneyId sets the JourneyId field's value. +func (s *UpdateJourneyInput) SetJourneyId(v string) *UpdateJourneyInput { + s.JourneyId = &v return s } -// SetEndpointRequest sets the EndpointRequest field's value. -func (s *UpdateEndpointInput) SetEndpointRequest(v *EndpointRequest) *UpdateEndpointInput { - s.EndpointRequest = v +// SetWriteJourneyRequest sets the WriteJourneyRequest field's value. +func (s *UpdateJourneyInput) SetWriteJourneyRequest(v *WriteJourneyRequest) *UpdateJourneyInput { + s.WriteJourneyRequest = v return s } -type UpdateEndpointOutput struct { - _ struct{} `type:"structure" payload:"MessageBody"` +type UpdateJourneyOutput struct { + _ struct{} `type:"structure" payload:"JourneyResponse"` - // Provides information about an API request or response. + // Provides information about the status, configuration, and other settings + // for a journey. // - // MessageBody is a required field - MessageBody *MessageBody `type:"structure" required:"true"` + // JourneyResponse is a required field + JourneyResponse *JourneyResponse `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateEndpointOutput) String() string { +func (s UpdateJourneyOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateEndpointOutput) GoString() string { +func (s UpdateJourneyOutput) GoString() string { return s.String() } -// SetMessageBody sets the MessageBody field's value. -func (s *UpdateEndpointOutput) SetMessageBody(v *MessageBody) *UpdateEndpointOutput { - s.MessageBody = v +// SetJourneyResponse sets the JourneyResponse field's value. +func (s *UpdateJourneyOutput) SetJourneyResponse(v *JourneyResponse) *UpdateJourneyOutput { + s.JourneyResponse = v return s } -type UpdateEndpointsBatchInput struct { - _ struct{} `type:"structure" payload:"EndpointBatchRequest"` +type UpdateJourneyStateInput struct { + _ struct{} `type:"structure" payload:"JourneyStateRequest"` // ApplicationId is a required field ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` - // Specifies a batch of endpoints to create or update and the settings and attributes - // to set or change for each endpoint. + // JourneyId is a required field + JourneyId *string `location:"uri" locationName:"journey-id" type:"string" required:"true"` + + // Changes the status of a journey. // - // EndpointBatchRequest is a required field - EndpointBatchRequest *EndpointBatchRequest `type:"structure" required:"true"` + // JourneyStateRequest is a required field + JourneyStateRequest *JourneyStateRequest `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateEndpointsBatchInput) String() string { +func (s UpdateJourneyStateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateEndpointsBatchInput) GoString() string { +func (s UpdateJourneyStateInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateEndpointsBatchInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateEndpointsBatchInput"} +func (s *UpdateJourneyStateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateJourneyStateInput"} if s.ApplicationId == nil { invalidParams.Add(request.NewErrParamRequired("ApplicationId")) } if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) } - if s.EndpointBatchRequest == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointBatchRequest")) + if s.JourneyId == nil { + invalidParams.Add(request.NewErrParamRequired("JourneyId")) } - if s.EndpointBatchRequest != nil { - if err := s.EndpointBatchRequest.Validate(); err != nil { - invalidParams.AddNested("EndpointBatchRequest", err.(request.ErrInvalidParams)) - } + if s.JourneyId != nil && len(*s.JourneyId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("JourneyId", 1)) + } + if s.JourneyStateRequest == nil { + invalidParams.Add(request.NewErrParamRequired("JourneyStateRequest")) } if invalidParams.Len() > 0 { @@ -22661,82 +30706,87 @@ func (s *UpdateEndpointsBatchInput) Validate() error { } // SetApplicationId sets the ApplicationId field's value. -func (s *UpdateEndpointsBatchInput) SetApplicationId(v string) *UpdateEndpointsBatchInput { +func (s *UpdateJourneyStateInput) SetApplicationId(v string) *UpdateJourneyStateInput { s.ApplicationId = &v return s } -// SetEndpointBatchRequest sets the EndpointBatchRequest field's value. -func (s *UpdateEndpointsBatchInput) SetEndpointBatchRequest(v *EndpointBatchRequest) *UpdateEndpointsBatchInput { - s.EndpointBatchRequest = v +// SetJourneyId sets the JourneyId field's value. +func (s *UpdateJourneyStateInput) SetJourneyId(v string) *UpdateJourneyStateInput { + s.JourneyId = &v return s } -type UpdateEndpointsBatchOutput struct { - _ struct{} `type:"structure" payload:"MessageBody"` +// SetJourneyStateRequest sets the JourneyStateRequest field's value. +func (s *UpdateJourneyStateInput) SetJourneyStateRequest(v *JourneyStateRequest) *UpdateJourneyStateInput { + s.JourneyStateRequest = v + return s +} - // Provides information about an API request or response. +type UpdateJourneyStateOutput struct { + _ struct{} `type:"structure" payload:"JourneyResponse"` + + // Provides information about the status, configuration, and other settings + // for a journey. // - // MessageBody is a required field - MessageBody *MessageBody `type:"structure" required:"true"` + // JourneyResponse is a required field + JourneyResponse *JourneyResponse `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateEndpointsBatchOutput) String() string { +func (s UpdateJourneyStateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateEndpointsBatchOutput) GoString() string { +func (s UpdateJourneyStateOutput) GoString() string { return s.String() -} - -// SetMessageBody sets the MessageBody field's value. -func (s *UpdateEndpointsBatchOutput) SetMessageBody(v *MessageBody) *UpdateEndpointsBatchOutput { - s.MessageBody = v +} + +// SetJourneyResponse sets the JourneyResponse field's value. +func (s *UpdateJourneyStateOutput) SetJourneyResponse(v *JourneyResponse) *UpdateJourneyStateOutput { + s.JourneyResponse = v return s } -type UpdateGcmChannelInput struct { - _ struct{} `type:"structure" payload:"GCMChannelRequest"` +type UpdatePushTemplateInput struct { + _ struct{} `type:"structure" payload:"PushNotificationTemplateRequest"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + CreateNewVersion *bool `location:"querystring" locationName:"create-new-version" type:"boolean"` - // Specifies the status and settings of the GCM channel for an application. - // This channel enables Amazon Pinpoint to send push notifications through the - // Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging (GCM), service. + // Specifies the content and settings for a message template that can be used + // in messages that are sent through a push notification channel. // - // GCMChannelRequest is a required field - GCMChannelRequest *GCMChannelRequest `type:"structure" required:"true"` + // PushNotificationTemplateRequest is a required field + PushNotificationTemplateRequest *PushNotificationTemplateRequest `type:"structure" required:"true"` + + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` + + Version *string `location:"querystring" locationName:"version" type:"string"` } // String returns the string representation -func (s UpdateGcmChannelInput) String() string { +func (s UpdatePushTemplateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateGcmChannelInput) GoString() string { +func (s UpdatePushTemplateInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateGcmChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateGcmChannelInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) - } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) +func (s *UpdatePushTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdatePushTemplateInput"} + if s.PushNotificationTemplateRequest == nil { + invalidParams.Add(request.NewErrParamRequired("PushNotificationTemplateRequest")) } - if s.GCMChannelRequest == nil { - invalidParams.Add(request.NewErrParamRequired("GCMChannelRequest")) + if s.TemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateName")) } - if s.GCMChannelRequest != nil { - if err := s.GCMChannelRequest.Validate(); err != nil { - invalidParams.AddNested("GCMChannelRequest", err.(request.ErrInvalidParams)) - } + if s.TemplateName != nil && len(*s.TemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) } if invalidParams.Len() > 0 { @@ -22745,43 +30795,52 @@ func (s *UpdateGcmChannelInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateGcmChannelInput) SetApplicationId(v string) *UpdateGcmChannelInput { - s.ApplicationId = &v +// SetCreateNewVersion sets the CreateNewVersion field's value. +func (s *UpdatePushTemplateInput) SetCreateNewVersion(v bool) *UpdatePushTemplateInput { + s.CreateNewVersion = &v return s } -// SetGCMChannelRequest sets the GCMChannelRequest field's value. -func (s *UpdateGcmChannelInput) SetGCMChannelRequest(v *GCMChannelRequest) *UpdateGcmChannelInput { - s.GCMChannelRequest = v +// SetPushNotificationTemplateRequest sets the PushNotificationTemplateRequest field's value. +func (s *UpdatePushTemplateInput) SetPushNotificationTemplateRequest(v *PushNotificationTemplateRequest) *UpdatePushTemplateInput { + s.PushNotificationTemplateRequest = v return s } -type UpdateGcmChannelOutput struct { - _ struct{} `type:"structure" payload:"GCMChannelResponse"` +// SetTemplateName sets the TemplateName field's value. +func (s *UpdatePushTemplateInput) SetTemplateName(v string) *UpdatePushTemplateInput { + s.TemplateName = &v + return s +} - // Provides information about the status and settings of the GCM channel for - // an application. The GCM channel enables Amazon Pinpoint to send push notifications - // through the Firebase Cloud Messaging (FCM), formerly Google Cloud Messaging - // (GCM), service. +// SetVersion sets the Version field's value. +func (s *UpdatePushTemplateInput) SetVersion(v string) *UpdatePushTemplateInput { + s.Version = &v + return s +} + +type UpdatePushTemplateOutput struct { + _ struct{} `type:"structure" payload:"MessageBody"` + + // Provides information about an API request or response. // - // GCMChannelResponse is a required field - GCMChannelResponse *GCMChannelResponse `type:"structure" required:"true"` + // MessageBody is a required field + MessageBody *MessageBody `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateGcmChannelOutput) String() string { +func (s UpdatePushTemplateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateGcmChannelOutput) GoString() string { +func (s UpdatePushTemplateOutput) GoString() string { return s.String() } -// SetGCMChannelResponse sets the GCMChannelResponse field's value. -func (s *UpdateGcmChannelOutput) SetGCMChannelResponse(v *GCMChannelResponse) *UpdateGcmChannelOutput { - s.GCMChannelResponse = v +// SetMessageBody sets the MessageBody field's value. +func (s *UpdatePushTemplateOutput) SetMessageBody(v *MessageBody) *UpdatePushTemplateOutput { + s.MessageBody = v return s } @@ -22965,39 +31024,312 @@ func (s *UpdateSmsChannelOutput) SetSMSChannelResponse(v *SMSChannelResponse) *U return s } -type UpdateVoiceChannelInput struct { - _ struct{} `type:"structure" payload:"VoiceChannelRequest"` +type UpdateSmsTemplateInput struct { + _ struct{} `type:"structure" payload:"SMSTemplateRequest"` + + CreateNewVersion *bool `location:"querystring" locationName:"create-new-version" type:"boolean"` + + // Specifies the content and settings for a message template that can be used + // in text messages that are sent through the SMS channel. + // + // SMSTemplateRequest is a required field + SMSTemplateRequest *SMSTemplateRequest `type:"structure" required:"true"` + + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` + + Version *string `location:"querystring" locationName:"version" type:"string"` +} + +// String returns the string representation +func (s UpdateSmsTemplateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSmsTemplateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateSmsTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateSmsTemplateInput"} + if s.SMSTemplateRequest == nil { + invalidParams.Add(request.NewErrParamRequired("SMSTemplateRequest")) + } + 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 +} + +// SetCreateNewVersion sets the CreateNewVersion field's value. +func (s *UpdateSmsTemplateInput) SetCreateNewVersion(v bool) *UpdateSmsTemplateInput { + s.CreateNewVersion = &v + return s +} + +// SetSMSTemplateRequest sets the SMSTemplateRequest field's value. +func (s *UpdateSmsTemplateInput) SetSMSTemplateRequest(v *SMSTemplateRequest) *UpdateSmsTemplateInput { + s.SMSTemplateRequest = v + return s +} + +// SetTemplateName sets the TemplateName field's value. +func (s *UpdateSmsTemplateInput) SetTemplateName(v string) *UpdateSmsTemplateInput { + s.TemplateName = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *UpdateSmsTemplateInput) SetVersion(v string) *UpdateSmsTemplateInput { + s.Version = &v + return s +} + +type UpdateSmsTemplateOutput struct { + _ struct{} `type:"structure" payload:"MessageBody"` + + // Provides information about an API request or response. + // + // MessageBody is a required field + MessageBody *MessageBody `type:"structure" required:"true"` +} + +// String returns the string representation +func (s UpdateSmsTemplateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateSmsTemplateOutput) GoString() string { + return s.String() +} + +// SetMessageBody sets the MessageBody field's value. +func (s *UpdateSmsTemplateOutput) SetMessageBody(v *MessageBody) *UpdateSmsTemplateOutput { + s.MessageBody = v + return s +} + +type UpdateTemplateActiveVersionInput struct { + _ struct{} `type:"structure" payload:"TemplateActiveVersionRequest"` + + // Specifies which version of a message template to use as the active version + // of the template. + // + // TemplateActiveVersionRequest is a required field + TemplateActiveVersionRequest *TemplateActiveVersionRequest `type:"structure" required:"true"` + + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` + + // TemplateType is a required field + TemplateType *string `location:"uri" locationName:"template-type" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateTemplateActiveVersionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTemplateActiveVersionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateTemplateActiveVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateTemplateActiveVersionInput"} + if s.TemplateActiveVersionRequest == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateActiveVersionRequest")) + } + 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.TemplateType == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateType")) + } + if s.TemplateType != nil && len(*s.TemplateType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateType", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTemplateActiveVersionRequest sets the TemplateActiveVersionRequest field's value. +func (s *UpdateTemplateActiveVersionInput) SetTemplateActiveVersionRequest(v *TemplateActiveVersionRequest) *UpdateTemplateActiveVersionInput { + s.TemplateActiveVersionRequest = v + return s +} + +// SetTemplateName sets the TemplateName field's value. +func (s *UpdateTemplateActiveVersionInput) SetTemplateName(v string) *UpdateTemplateActiveVersionInput { + s.TemplateName = &v + return s +} + +// SetTemplateType sets the TemplateType field's value. +func (s *UpdateTemplateActiveVersionInput) SetTemplateType(v string) *UpdateTemplateActiveVersionInput { + s.TemplateType = &v + return s +} + +type UpdateTemplateActiveVersionOutput struct { + _ struct{} `type:"structure" payload:"MessageBody"` + + // Provides information about an API request or response. + // + // MessageBody is a required field + MessageBody *MessageBody `type:"structure" required:"true"` +} + +// String returns the string representation +func (s UpdateTemplateActiveVersionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTemplateActiveVersionOutput) GoString() string { + return s.String() +} + +// SetMessageBody sets the MessageBody field's value. +func (s *UpdateTemplateActiveVersionOutput) SetMessageBody(v *MessageBody) *UpdateTemplateActiveVersionOutput { + s.MessageBody = v + return s +} + +type UpdateVoiceChannelInput struct { + _ struct{} `type:"structure" payload:"VoiceChannelRequest"` + + // ApplicationId is a required field + ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + + // Specifies the status and settings of the voice channel for an application. + // + // VoiceChannelRequest is a required field + VoiceChannelRequest *VoiceChannelRequest `type:"structure" required:"true"` +} + +// String returns the string representation +func (s UpdateVoiceChannelInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateVoiceChannelInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateVoiceChannelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateVoiceChannelInput"} + if s.ApplicationId == nil { + invalidParams.Add(request.NewErrParamRequired("ApplicationId")) + } + if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + } + if s.VoiceChannelRequest == nil { + invalidParams.Add(request.NewErrParamRequired("VoiceChannelRequest")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *UpdateVoiceChannelInput) SetApplicationId(v string) *UpdateVoiceChannelInput { + s.ApplicationId = &v + return s +} + +// SetVoiceChannelRequest sets the VoiceChannelRequest field's value. +func (s *UpdateVoiceChannelInput) SetVoiceChannelRequest(v *VoiceChannelRequest) *UpdateVoiceChannelInput { + s.VoiceChannelRequest = v + return s +} + +type UpdateVoiceChannelOutput struct { + _ struct{} `type:"structure" payload:"VoiceChannelResponse"` + + // Provides information about the status and settings of the voice channel for + // an application. + // + // VoiceChannelResponse is a required field + VoiceChannelResponse *VoiceChannelResponse `type:"structure" required:"true"` +} + +// String returns the string representation +func (s UpdateVoiceChannelOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateVoiceChannelOutput) GoString() string { + return s.String() +} + +// SetVoiceChannelResponse sets the VoiceChannelResponse field's value. +func (s *UpdateVoiceChannelOutput) SetVoiceChannelResponse(v *VoiceChannelResponse) *UpdateVoiceChannelOutput { + s.VoiceChannelResponse = v + return s +} + +type UpdateVoiceTemplateInput struct { + _ struct{} `type:"structure" payload:"VoiceTemplateRequest"` - // ApplicationId is a required field - ApplicationId *string `location:"uri" locationName:"application-id" type:"string" required:"true"` + CreateNewVersion *bool `location:"querystring" locationName:"create-new-version" type:"boolean"` - // Specifies the status and settings of the voice channel for an application. + // TemplateName is a required field + TemplateName *string `location:"uri" locationName:"template-name" type:"string" required:"true"` + + Version *string `location:"querystring" locationName:"version" type:"string"` + + // Specifies the content and settings for a message template that can be used + // in messages that are sent through the voice channel. // - // VoiceChannelRequest is a required field - VoiceChannelRequest *VoiceChannelRequest `type:"structure" required:"true"` + // VoiceTemplateRequest is a required field + VoiceTemplateRequest *VoiceTemplateRequest `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateVoiceChannelInput) String() string { +func (s UpdateVoiceTemplateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateVoiceChannelInput) GoString() string { +func (s UpdateVoiceTemplateInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateVoiceChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateVoiceChannelInput"} - if s.ApplicationId == nil { - invalidParams.Add(request.NewErrParamRequired("ApplicationId")) +func (s *UpdateVoiceTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateVoiceTemplateInput"} + if s.TemplateName == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateName")) } - if s.ApplicationId != nil && len(*s.ApplicationId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ApplicationId", 1)) + if s.TemplateName != nil && len(*s.TemplateName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateName", 1)) } - if s.VoiceChannelRequest == nil { - invalidParams.Add(request.NewErrParamRequired("VoiceChannelRequest")) + if s.VoiceTemplateRequest == nil { + invalidParams.Add(request.NewErrParamRequired("VoiceTemplateRequest")) } if invalidParams.Len() > 0 { @@ -23006,41 +31338,52 @@ func (s *UpdateVoiceChannelInput) Validate() error { return nil } -// SetApplicationId sets the ApplicationId field's value. -func (s *UpdateVoiceChannelInput) SetApplicationId(v string) *UpdateVoiceChannelInput { - s.ApplicationId = &v +// SetCreateNewVersion sets the CreateNewVersion field's value. +func (s *UpdateVoiceTemplateInput) SetCreateNewVersion(v bool) *UpdateVoiceTemplateInput { + s.CreateNewVersion = &v return s } -// SetVoiceChannelRequest sets the VoiceChannelRequest field's value. -func (s *UpdateVoiceChannelInput) SetVoiceChannelRequest(v *VoiceChannelRequest) *UpdateVoiceChannelInput { - s.VoiceChannelRequest = v +// SetTemplateName sets the TemplateName field's value. +func (s *UpdateVoiceTemplateInput) SetTemplateName(v string) *UpdateVoiceTemplateInput { + s.TemplateName = &v return s } -type UpdateVoiceChannelOutput struct { - _ struct{} `type:"structure" payload:"VoiceChannelResponse"` +// SetVersion sets the Version field's value. +func (s *UpdateVoiceTemplateInput) SetVersion(v string) *UpdateVoiceTemplateInput { + s.Version = &v + return s +} - // Provides information about the status and settings of the voice channel for - // an application. +// SetVoiceTemplateRequest sets the VoiceTemplateRequest field's value. +func (s *UpdateVoiceTemplateInput) SetVoiceTemplateRequest(v *VoiceTemplateRequest) *UpdateVoiceTemplateInput { + s.VoiceTemplateRequest = v + return s +} + +type UpdateVoiceTemplateOutput struct { + _ struct{} `type:"structure" payload:"MessageBody"` + + // Provides information about an API request or response. // - // VoiceChannelResponse is a required field - VoiceChannelResponse *VoiceChannelResponse `type:"structure" required:"true"` + // MessageBody is a required field + MessageBody *MessageBody `type:"structure" required:"true"` } // String returns the string representation -func (s UpdateVoiceChannelOutput) String() string { +func (s UpdateVoiceTemplateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateVoiceChannelOutput) GoString() string { +func (s UpdateVoiceTemplateOutput) GoString() string { return s.String() } -// SetVoiceChannelResponse sets the VoiceChannelResponse field's value. -func (s *UpdateVoiceChannelOutput) SetVoiceChannelResponse(v *VoiceChannelResponse) *UpdateVoiceChannelOutput { - s.VoiceChannelResponse = v +// SetMessageBody sets the MessageBody field's value. +func (s *UpdateVoiceTemplateOutput) SetMessageBody(v *MessageBody) *UpdateVoiceTemplateOutput { + s.MessageBody = v return s } @@ -23090,166 +31433,465 @@ type VoiceChannelResponse struct { // only for backward compatibility. Id *string `type:"string"` - // Specifies whether the voice channel is archived. - IsArchived *bool `type:"boolean"` + // Specifies whether the voice channel is archived. + IsArchived *bool `type:"boolean"` + + // The user who last modified the voice channel. + LastModifiedBy *string `type:"string"` + + // The date and time, in ISO 8601 format, when the voice channel was last modified. + LastModifiedDate *string `type:"string"` + + // The type of messaging or notification platform for the channel. For the voice + // channel, this value is VOICE. + // + // Platform is a required field + Platform *string `type:"string" required:"true"` + + // The current version of the voice channel. + Version *int64 `type:"integer"` +} + +// String returns the string representation +func (s VoiceChannelResponse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VoiceChannelResponse) GoString() string { + return s.String() +} + +// SetApplicationId sets the ApplicationId field's value. +func (s *VoiceChannelResponse) SetApplicationId(v string) *VoiceChannelResponse { + s.ApplicationId = &v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *VoiceChannelResponse) SetCreationDate(v string) *VoiceChannelResponse { + s.CreationDate = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *VoiceChannelResponse) SetEnabled(v bool) *VoiceChannelResponse { + s.Enabled = &v + return s +} + +// SetHasCredential sets the HasCredential field's value. +func (s *VoiceChannelResponse) SetHasCredential(v bool) *VoiceChannelResponse { + s.HasCredential = &v + return s +} + +// SetId sets the Id field's value. +func (s *VoiceChannelResponse) SetId(v string) *VoiceChannelResponse { + s.Id = &v + return s +} + +// SetIsArchived sets the IsArchived field's value. +func (s *VoiceChannelResponse) SetIsArchived(v bool) *VoiceChannelResponse { + s.IsArchived = &v + return s +} + +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *VoiceChannelResponse) SetLastModifiedBy(v string) *VoiceChannelResponse { + s.LastModifiedBy = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *VoiceChannelResponse) SetLastModifiedDate(v string) *VoiceChannelResponse { + s.LastModifiedDate = &v + return s +} + +// SetPlatform sets the Platform field's value. +func (s *VoiceChannelResponse) SetPlatform(v string) *VoiceChannelResponse { + s.Platform = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *VoiceChannelResponse) SetVersion(v int64) *VoiceChannelResponse { + s.Version = &v + return s +} + +// Specifies the settings for a one-time voice message that's sent directly +// to an endpoint through the voice channel. +type VoiceMessage struct { + _ struct{} `type:"structure"` + + // The text of the script to use for the voice message. + Body *string `type:"string"` + + // The code for the language to use when synthesizing the text of the message + // script. For a list of supported languages and the code for each one, see + // the Amazon Polly Developer Guide (https://docs.aws.amazon.com/polly/latest/dg/what-is.html). + LanguageCode *string `type:"string"` + + // The long code to send the voice message from. This value should be one of + // the dedicated long codes that's assigned to your AWS account. Although it + // isn't required, we recommend that you specify the long code in E.164 format, + // for example +12065550100, to ensure prompt and accurate delivery of the message. + OriginationNumber *string `type:"string"` + + // The default message variables to use in the voice message. You can override + // the default variables with individual address variables. + Substitutions map[string][]*string `type:"map"` + + // The name of the voice to use when delivering the message. For a list of supported + // voices, see the Amazon Polly Developer Guide (https://docs.aws.amazon.com/polly/latest/dg/what-is.html). + VoiceId *string `type:"string"` +} + +// String returns the string representation +func (s VoiceMessage) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VoiceMessage) GoString() string { + return s.String() +} + +// SetBody sets the Body field's value. +func (s *VoiceMessage) SetBody(v string) *VoiceMessage { + s.Body = &v + return s +} + +// SetLanguageCode sets the LanguageCode field's value. +func (s *VoiceMessage) SetLanguageCode(v string) *VoiceMessage { + s.LanguageCode = &v + return s +} + +// SetOriginationNumber sets the OriginationNumber field's value. +func (s *VoiceMessage) SetOriginationNumber(v string) *VoiceMessage { + s.OriginationNumber = &v + return s +} + +// SetSubstitutions sets the Substitutions field's value. +func (s *VoiceMessage) SetSubstitutions(v map[string][]*string) *VoiceMessage { + s.Substitutions = v + return s +} + +// SetVoiceId sets the VoiceId field's value. +func (s *VoiceMessage) SetVoiceId(v string) *VoiceMessage { + s.VoiceId = &v + return s +} + +// Specifies the content and settings for a message template that can be used +// in messages that are sent through the voice channel. +type VoiceTemplateRequest struct { + _ struct{} `type:"structure"` + + // The text of the script to use in messages that are based on the message template, + // in plain text format. + Body *string `type:"string"` + + // A JSON object that specifies the default values to use for message variables + // in the message template. This object is a set of key-value pairs. Each key + // defines a message variable in the template. The corresponding value defines + // the default value for that variable. When you create a message that's based + // on the template, you can override these defaults with message-specific and + // address-specific variables and values. + DefaultSubstitutions *string `type:"string"` + + // The code for the language to use when synthesizing the text of the script + // in messages that are based on the message template. For a list of supported + // languages and the code for each one, see the Amazon Polly Developer Guide + // (https://docs.aws.amazon.com/polly/latest/dg/what-is.html). + LanguageCode *string `type:"string"` + + // A string-to-string map of key-value pairs that defines the tags to associate + // with the message template. Each tag consists of a required tag key and an + // associated tag value. + Tags map[string]*string `locationName:"tags" type:"map"` + + // A custom description of the message template. + TemplateDescription *string `type:"string"` + + // The name of the voice to use when delivering messages that are based on the + // message template. For a list of supported voices, see the Amazon Polly Developer + // Guide (https://docs.aws.amazon.com/polly/latest/dg/what-is.html). + VoiceId *string `type:"string"` +} + +// String returns the string representation +func (s VoiceTemplateRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VoiceTemplateRequest) GoString() string { + return s.String() +} + +// SetBody sets the Body field's value. +func (s *VoiceTemplateRequest) SetBody(v string) *VoiceTemplateRequest { + s.Body = &v + return s +} + +// SetDefaultSubstitutions sets the DefaultSubstitutions field's value. +func (s *VoiceTemplateRequest) SetDefaultSubstitutions(v string) *VoiceTemplateRequest { + s.DefaultSubstitutions = &v + return s +} + +// SetLanguageCode sets the LanguageCode field's value. +func (s *VoiceTemplateRequest) SetLanguageCode(v string) *VoiceTemplateRequest { + s.LanguageCode = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *VoiceTemplateRequest) SetTags(v map[string]*string) *VoiceTemplateRequest { + s.Tags = v + return s +} + +// SetTemplateDescription sets the TemplateDescription field's value. +func (s *VoiceTemplateRequest) SetTemplateDescription(v string) *VoiceTemplateRequest { + s.TemplateDescription = &v + return s +} + +// SetVoiceId sets the VoiceId field's value. +func (s *VoiceTemplateRequest) SetVoiceId(v string) *VoiceTemplateRequest { + s.VoiceId = &v + return s +} + +// Provides information about the content and settings for a message template +// that can be used in messages that are sent through the voice channel. +type VoiceTemplateResponse struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the message template. + Arn *string `type:"string"` + + // The text of the script that's used in messages that are based on the message + // template, in plain text format. + Body *string `type:"string"` + + // The date, in ISO 8601 format, when the message template was created. + // + // CreationDate is a required field + CreationDate *string `type:"string" required:"true"` + + // The JSON object that specifies the default values that are used for message + // variables in the message template. This object is a set of key-value pairs. + // Each key defines a message variable in the template. The corresponding value + // defines the default value for that variable. + DefaultSubstitutions *string `type:"string"` - // The user who last modified the voice channel. - LastModifiedBy *string `type:"string"` + // The code for the language that's used when synthesizing the text of the script + // in messages that are based on the message template. For a list of supported + // languages and the code for each one, see the Amazon Polly Developer Guide + // (https://docs.aws.amazon.com/polly/latest/dg/what-is.html). + LanguageCode *string `type:"string"` - // The date and time, in ISO 8601 format, when the voice channel was last modified. - LastModifiedDate *string `type:"string"` + // The date, in ISO 8601 format, when the message template was last modified. + // + // LastModifiedDate is a required field + LastModifiedDate *string `type:"string" required:"true"` - OriginationNumber *string `type:"string"` + // A string-to-string map of key-value pairs that identifies the tags that are + // associated with the message template. Each tag consists of a required tag + // key and an associated tag value. + Tags map[string]*string `locationName:"tags" type:"map"` - // The type of messaging or notification platform for the channel. For the voice - // channel, this value is VOICE. + // The custom description of the message template. + TemplateDescription *string `type:"string"` + + // The name of the message template. // - // Platform is a required field - Platform *string `type:"string" required:"true"` + // TemplateName is a required field + TemplateName *string `type:"string" required:"true"` - // The current version of the voice channel. - Version *int64 `type:"integer"` + // The type of channel that the message template is designed for. For a voice + // template, this value is VOICE. + // + // TemplateType is a required field + TemplateType *string `type:"string" required:"true" enum:"TemplateType"` + + // The unique identifier, as an integer, for the active version of the message + // template, or the version of the template that you specified by using the + // version parameter in your request. + Version *string `type:"string"` + + // The name of the voice that's used when delivering messages that are based + // on the message template. For a list of supported voices, see the Amazon Polly + // Developer Guide (https://docs.aws.amazon.com/polly/latest/dg/what-is.html). + VoiceId *string `type:"string"` } // String returns the string representation -func (s VoiceChannelResponse) String() string { +func (s VoiceTemplateResponse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s VoiceChannelResponse) GoString() string { +func (s VoiceTemplateResponse) GoString() string { return s.String() } -// SetApplicationId sets the ApplicationId field's value. -func (s *VoiceChannelResponse) SetApplicationId(v string) *VoiceChannelResponse { - s.ApplicationId = &v +// SetArn sets the Arn field's value. +func (s *VoiceTemplateResponse) SetArn(v string) *VoiceTemplateResponse { + s.Arn = &v return s } -// SetCreationDate sets the CreationDate field's value. -func (s *VoiceChannelResponse) SetCreationDate(v string) *VoiceChannelResponse { - s.CreationDate = &v +// SetBody sets the Body field's value. +func (s *VoiceTemplateResponse) SetBody(v string) *VoiceTemplateResponse { + s.Body = &v return s } -// SetEnabled sets the Enabled field's value. -func (s *VoiceChannelResponse) SetEnabled(v bool) *VoiceChannelResponse { - s.Enabled = &v +// SetCreationDate sets the CreationDate field's value. +func (s *VoiceTemplateResponse) SetCreationDate(v string) *VoiceTemplateResponse { + s.CreationDate = &v return s } -// SetHasCredential sets the HasCredential field's value. -func (s *VoiceChannelResponse) SetHasCredential(v bool) *VoiceChannelResponse { - s.HasCredential = &v +// SetDefaultSubstitutions sets the DefaultSubstitutions field's value. +func (s *VoiceTemplateResponse) SetDefaultSubstitutions(v string) *VoiceTemplateResponse { + s.DefaultSubstitutions = &v return s } -// SetId sets the Id field's value. -func (s *VoiceChannelResponse) SetId(v string) *VoiceChannelResponse { - s.Id = &v +// SetLanguageCode sets the LanguageCode field's value. +func (s *VoiceTemplateResponse) SetLanguageCode(v string) *VoiceTemplateResponse { + s.LanguageCode = &v return s } -// SetIsArchived sets the IsArchived field's value. -func (s *VoiceChannelResponse) SetIsArchived(v bool) *VoiceChannelResponse { - s.IsArchived = &v +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *VoiceTemplateResponse) SetLastModifiedDate(v string) *VoiceTemplateResponse { + s.LastModifiedDate = &v return s } -// SetLastModifiedBy sets the LastModifiedBy field's value. -func (s *VoiceChannelResponse) SetLastModifiedBy(v string) *VoiceChannelResponse { - s.LastModifiedBy = &v +// SetTags sets the Tags field's value. +func (s *VoiceTemplateResponse) SetTags(v map[string]*string) *VoiceTemplateResponse { + s.Tags = v return s } -// SetLastModifiedDate sets the LastModifiedDate field's value. -func (s *VoiceChannelResponse) SetLastModifiedDate(v string) *VoiceChannelResponse { - s.LastModifiedDate = &v +// SetTemplateDescription sets the TemplateDescription field's value. +func (s *VoiceTemplateResponse) SetTemplateDescription(v string) *VoiceTemplateResponse { + s.TemplateDescription = &v return s } -// SetOriginationNumber sets the OriginationNumber field's value. -func (s *VoiceChannelResponse) SetOriginationNumber(v string) *VoiceChannelResponse { - s.OriginationNumber = &v +// SetTemplateName sets the TemplateName field's value. +func (s *VoiceTemplateResponse) SetTemplateName(v string) *VoiceTemplateResponse { + s.TemplateName = &v return s } -// SetPlatform sets the Platform field's value. -func (s *VoiceChannelResponse) SetPlatform(v string) *VoiceChannelResponse { - s.Platform = &v +// SetTemplateType sets the TemplateType field's value. +func (s *VoiceTemplateResponse) SetTemplateType(v string) *VoiceTemplateResponse { + s.TemplateType = &v return s } // SetVersion sets the Version field's value. -func (s *VoiceChannelResponse) SetVersion(v int64) *VoiceChannelResponse { +func (s *VoiceTemplateResponse) SetVersion(v string) *VoiceTemplateResponse { s.Version = &v return s } -// Specifies the settings for a one-time voice message that's sent directly -// to an endpoint through the voice channel. -type VoiceMessage struct { - _ struct{} `type:"structure"` - - // The text script for the voice message. - Body *string `type:"string"` - - // The language to use when delivering the message. For a list of supported - // languages, see the Amazon Polly Developer Guide (AmazonPollyDG.html). - LanguageCode *string `type:"string"` +// SetVoiceId sets the VoiceId field's value. +func (s *VoiceTemplateResponse) SetVoiceId(v string) *VoiceTemplateResponse { + s.VoiceId = &v + return s +} - // The phone number from the pool or messaging service to send the message from. - // Although it isn't required, we recommend that you specify the phone number - // in E.164 format to ensure prompt and accurate delivery. - OriginationNumber *string `type:"string"` +// Specifies the settings for a wait activity in a journey. This type of activity +// waits for a certain amount of time or until a specific date and time before +// moving participants to the next activity in a journey. +type WaitActivity struct { + _ struct{} `type:"structure"` - // The default message variables to use in the voice message. You can override - // the default variables with individual address variables. - Substitutions map[string][]*string `type:"map"` + // The unique identifier for the next activity to perform, after performing + // the wait activity. + NextActivity *string `type:"string"` - // The name of the voice to use when delivering the message. For a list of supported - // voices, see the Amazon Polly Developer Guide (AmazonPollyDG.html). - VoiceId *string `type:"string"` + // The amount of time to wait or the date and time when the activity moves participants + // to the next activity in the journey. + WaitTime *WaitTime `type:"structure"` } // String returns the string representation -func (s VoiceMessage) String() string { +func (s WaitActivity) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s VoiceMessage) GoString() string { +func (s WaitActivity) GoString() string { return s.String() } -// SetBody sets the Body field's value. -func (s *VoiceMessage) SetBody(v string) *VoiceMessage { - s.Body = &v +// SetNextActivity sets the NextActivity field's value. +func (s *WaitActivity) SetNextActivity(v string) *WaitActivity { + s.NextActivity = &v return s } -// SetLanguageCode sets the LanguageCode field's value. -func (s *VoiceMessage) SetLanguageCode(v string) *VoiceMessage { - s.LanguageCode = &v +// SetWaitTime sets the WaitTime field's value. +func (s *WaitActivity) SetWaitTime(v *WaitTime) *WaitActivity { + s.WaitTime = v return s } -// SetOriginationNumber sets the OriginationNumber field's value. -func (s *VoiceMessage) SetOriginationNumber(v string) *VoiceMessage { - s.OriginationNumber = &v - return s +// Specifies a duration or a date and time that indicates when Amazon Pinpoint +// determines whether an activity's conditions have been met or an activity +// moves participants to the next activity in a journey. +type WaitTime struct { + _ struct{} `type:"structure"` + + // The amount of time to wait, as a duration in ISO 8601 format, before determining + // whether the activity's conditions have been met or moving participants to + // the next activity in the journey. + WaitFor *string `type:"string"` + + // The date and time, in ISO 8601 format, when Amazon Pinpoint determines whether + // the activity's conditions have been met or the activity moves participants + // to the next activity in the journey. + WaitUntil *string `type:"string"` } -// SetSubstitutions sets the Substitutions field's value. -func (s *VoiceMessage) SetSubstitutions(v map[string][]*string) *VoiceMessage { - s.Substitutions = v +// String returns the string representation +func (s WaitTime) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WaitTime) GoString() string { + return s.String() +} + +// SetWaitFor sets the WaitFor field's value. +func (s *WaitTime) SetWaitFor(v string) *WaitTime { + s.WaitFor = &v return s } -// SetVoiceId sets the VoiceId field's value. -func (s *VoiceMessage) SetVoiceId(v string) *VoiceMessage { - s.VoiceId = &v +// SetWaitUntil sets the WaitUntil field's value. +func (s *WaitTime) SetWaitUntil(v string) *WaitTime { + s.WaitUntil = &v return s } @@ -23271,26 +31913,27 @@ type WriteApplicationSettingsRequest struct { // custom limits for the campaign. Limits *CampaignLimits `type:"structure"` - // The default quiet time for campaigns in the application. Quiet time is a - // specific time range when campaigns don't send messages to endpoints, if all - // the following conditions are met: + // The default quiet time for campaigns and journeys in the application. Quiet + // time is a specific time range when messages aren't sent to endpoints, if + // all the following conditions are met: // // * The EndpointDemographic.Timezone property of the endpoint is set to // a valid value. // // * The current time in the endpoint's time zone is later than or equal // to the time specified by the QuietTime.Start property for the application - // (or a campaign that has custom quiet time settings). + // (or a campaign or journey that has custom quiet time settings). // // * The current time in the endpoint's time zone is earlier than or equal // to the time specified by the QuietTime.End property for the application - // (or a campaign that has custom quiet time settings). + // (or a campaign or journey that has custom quiet time settings). // // If any of the preceding conditions isn't met, the endpoint will receive messages - // from a campaign, even if quiet time is enabled. + // from a campaign or journey, even if quiet time is enabled. // - // To override the default quiet time settings for a specific campaign, use - // the Campaign resource to define a custom quiet time for the campaign. + // To override the default quiet time settings for a specific campaign or journey, + // use the Campaign resource or the Journey resource to define a custom quiet + // time for the campaign or journey. QuietTime *QuietTime `type:"structure"` } @@ -23336,7 +31979,7 @@ type WriteCampaignRequest struct { // in addition to the default treatment for the campaign. AdditionalTreatments []*WriteTreatmentResource `type:"list"` - // The custom description of the campaign. + // A custom description of the campaign. Description *string `type:"string"` // The allocated percentage of users (segment members) who shouldn't receive @@ -23373,7 +32016,10 @@ type WriteCampaignRequest struct { // tag value. Tags map[string]*string `locationName:"tags" type:"map"` - // The custom description of a variation of the campaign to use for A/B testing. + // The message template to use for the campaign. + TemplateConfiguration *TemplateConfiguration `type:"structure"` + + // A custom description of a variation of the campaign to use for A/B testing. TreatmentDescription *string `type:"string"` // The custom name of a variation of the campaign to use for A/B testing. @@ -23403,11 +32049,6 @@ func (s *WriteCampaignRequest) Validate() error { } } } - if s.MessageConfiguration != nil { - if err := s.MessageConfiguration.Validate(); err != nil { - invalidParams.AddNested("MessageConfiguration", err.(request.ErrInvalidParams)) - } - } if s.Schedule != nil { if err := s.Schedule.Validate(); err != nil { invalidParams.AddNested("Schedule", err.(request.ErrInvalidParams)) @@ -23492,6 +32133,12 @@ func (s *WriteCampaignRequest) SetTags(v map[string]*string) *WriteCampaignReque return s } +// SetTemplateConfiguration sets the TemplateConfiguration field's value. +func (s *WriteCampaignRequest) SetTemplateConfiguration(v *TemplateConfiguration) *WriteCampaignRequest { + s.TemplateConfiguration = v + return s +} + // SetTreatmentDescription sets the TreatmentDescription field's value. func (s *WriteCampaignRequest) SetTreatmentDescription(v string) *WriteCampaignRequest { s.TreatmentDescription = &v @@ -23566,6 +32213,195 @@ func (s *WriteEventStream) SetRoleArn(v string) *WriteEventStream { return s } +// Specifies the configuration and other settings for a journey. +type WriteJourneyRequest struct { + _ struct{} `type:"structure"` + + // A map that contains a set of Activity objects, one object for each activity + // in the journey. For each Activity object, the key is the unique identifier + // (string) for an activity and the value is the settings for the activity. + // An activity identifier can contain a maximum of 128 characters. The characters + // must be alphanumeric characters. + Activities map[string]*Activity `type:"map"` + + // The date, in ISO 8601 format, when the journey was created. + CreationDate *string `type:"string"` + + // The date, in ISO 8601 format, when the journey was last modified. + LastModifiedDate *string `type:"string"` + + // The messaging and entry limits for the journey. + Limits *JourneyLimits `type:"structure"` + + // Specifies whether the journey's scheduled start and end times use each participant's + // local time. To base the schedule on each participant's local time, set this + // value to true. + LocalTime *bool `type:"boolean"` + + // The name of the journey. A journey name can contain a maximum of 150 characters. + // The characters can be alphanumeric characters or symbols, such as underscores + // (_) or hyphens (-). A journey name can't contain any spaces. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // The quiet time settings for the journey. Quiet time is a specific time range + // when a journey doesn't send messages to participants, if all the following + // conditions are met: + // + // * The EndpointDemographic.Timezone property of the endpoint for the participant + // is set to a valid value. + // + // * The current time in the participant's time zone is later than or equal + // to the time specified by the QuietTime.Start property for the journey. + // + // * The current time in the participant's time zone is earlier than or equal + // to the time specified by the QuietTime.End property for the journey. + // + // If any of the preceding conditions isn't met, the participant will receive + // messages from the journey, even if quiet time is enabled. + QuietTime *QuietTime `type:"structure"` + + // The frequency with which Amazon Pinpoint evaluates segment and event data + // for the journey, as a duration in ISO 8601 format. + RefreshFrequency *string `type:"string"` + + // The schedule settings for the journey. + Schedule *JourneySchedule `type:"structure"` + + // The unique identifier for the first activity in the journey. An activity + // identifier can contain a maximum of 128 characters. The characters must be + // alphanumeric characters. + StartActivity *string `type:"string"` + + // The segment that defines which users are participants in the journey. + StartCondition *StartCondition `type:"structure"` + + // The status of the journey. Valid values are: + // + // * DRAFT - Saves the journey and doesn't publish it. + // + // * ACTIVE - Saves and publishes the journey. Depending on the journey's + // schedule, the journey starts running immediately or at the scheduled start + // time. If a journey's status is ACTIVE, you can't add, change, or remove + // activities from it. + // + // The CANCELLED, COMPLETED, and CLOSED values are not supported in requests + // to create or update a journey. To cancel a journey, use the Journey State + // resource. + State *string `type:"string" enum:"State"` +} + +// String returns the string representation +func (s WriteJourneyRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WriteJourneyRequest) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *WriteJourneyRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "WriteJourneyRequest"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Activities != nil { + for i, v := range s.Activities { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Activities", i), err.(request.ErrInvalidParams)) + } + } + } + if s.StartCondition != nil { + if err := s.StartCondition.Validate(); err != nil { + invalidParams.AddNested("StartCondition", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetActivities sets the Activities field's value. +func (s *WriteJourneyRequest) SetActivities(v map[string]*Activity) *WriteJourneyRequest { + s.Activities = v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *WriteJourneyRequest) SetCreationDate(v string) *WriteJourneyRequest { + s.CreationDate = &v + return s +} + +// SetLastModifiedDate sets the LastModifiedDate field's value. +func (s *WriteJourneyRequest) SetLastModifiedDate(v string) *WriteJourneyRequest { + s.LastModifiedDate = &v + return s +} + +// SetLimits sets the Limits field's value. +func (s *WriteJourneyRequest) SetLimits(v *JourneyLimits) *WriteJourneyRequest { + s.Limits = v + return s +} + +// SetLocalTime sets the LocalTime field's value. +func (s *WriteJourneyRequest) SetLocalTime(v bool) *WriteJourneyRequest { + s.LocalTime = &v + return s +} + +// SetName sets the Name field's value. +func (s *WriteJourneyRequest) SetName(v string) *WriteJourneyRequest { + s.Name = &v + return s +} + +// SetQuietTime sets the QuietTime field's value. +func (s *WriteJourneyRequest) SetQuietTime(v *QuietTime) *WriteJourneyRequest { + s.QuietTime = v + return s +} + +// SetRefreshFrequency sets the RefreshFrequency field's value. +func (s *WriteJourneyRequest) SetRefreshFrequency(v string) *WriteJourneyRequest { + s.RefreshFrequency = &v + return s +} + +// SetSchedule sets the Schedule field's value. +func (s *WriteJourneyRequest) SetSchedule(v *JourneySchedule) *WriteJourneyRequest { + s.Schedule = v + return s +} + +// SetStartActivity sets the StartActivity field's value. +func (s *WriteJourneyRequest) SetStartActivity(v string) *WriteJourneyRequest { + s.StartActivity = &v + return s +} + +// SetStartCondition sets the StartCondition field's value. +func (s *WriteJourneyRequest) SetStartCondition(v *StartCondition) *WriteJourneyRequest { + s.StartCondition = v + return s +} + +// SetState sets the State field's value. +func (s *WriteJourneyRequest) SetState(v string) *WriteJourneyRequest { + s.State = &v + return s +} + // Specifies the configuration, dimension, and other settings for a segment. // A WriteSegmentRequest object can include a Dimensions object or a SegmentGroups // object, but not both. @@ -23660,7 +32496,10 @@ type WriteTreatmentResource struct { // SizePercent is a required field SizePercent *int64 `type:"integer" required:"true"` - // The custom description of the treatment. + // The message template to use for the treatment. + TemplateConfiguration *TemplateConfiguration `type:"structure"` + + // A custom description of the treatment. TreatmentDescription *string `type:"string"` // The custom name of the treatment. A treatment is a variation of a campaign @@ -23684,11 +32523,6 @@ func (s *WriteTreatmentResource) Validate() error { if s.SizePercent == nil { invalidParams.Add(request.NewErrParamRequired("SizePercent")) } - if s.MessageConfiguration != nil { - if err := s.MessageConfiguration.Validate(); err != nil { - invalidParams.AddNested("MessageConfiguration", err.(request.ErrInvalidParams)) - } - } if s.Schedule != nil { if err := s.Schedule.Validate(); err != nil { invalidParams.AddNested("Schedule", err.(request.ErrInvalidParams)) @@ -23719,6 +32553,12 @@ func (s *WriteTreatmentResource) SetSizePercent(v int64) *WriteTreatmentResource return s } +// SetTemplateConfiguration sets the TemplateConfiguration field's value. +func (s *WriteTreatmentResource) SetTemplateConfiguration(v *TemplateConfiguration) *WriteTreatmentResource { + s.TemplateConfiguration = v + return s +} + // SetTreatmentDescription sets the TreatmentDescription field's value. func (s *WriteTreatmentResource) SetTreatmentDescription(v string) *WriteTreatmentResource { s.TreatmentDescription = &v @@ -23901,12 +32741,18 @@ const ( // JobStatusCreated is a JobStatus enum value JobStatusCreated = "CREATED" + // JobStatusPreparingForInitialization is a JobStatus enum value + JobStatusPreparingForInitialization = "PREPARING_FOR_INITIALIZATION" + // JobStatusInitializing is a JobStatus enum value JobStatusInitializing = "INITIALIZING" // JobStatusProcessing is a JobStatus enum value JobStatusProcessing = "PROCESSING" + // JobStatusPendingJob is a JobStatus enum value + JobStatusPendingJob = "PENDING_JOB" + // JobStatusCompleting is a JobStatus enum value JobStatusCompleting = "COMPLETING" @@ -23936,6 +32782,14 @@ const ( ModeFilter = "FILTER" ) +const ( + // OperatorAll is a Operator enum value + OperatorAll = "ALL" + + // OperatorAny is a Operator enum value + OperatorAny = "ANY" +) + const ( // RecencyTypeActive is a RecencyType enum value RecencyTypeActive = "ACTIVE" @@ -23963,6 +32817,37 @@ const ( SourceTypeNone = "NONE" ) +const ( + // StateDraft is a State enum value + StateDraft = "DRAFT" + + // StateActive is a State enum value + StateActive = "ACTIVE" + + // StateCompleted is a State enum value + StateCompleted = "COMPLETED" + + // StateCancelled is a State enum value + StateCancelled = "CANCELLED" + + // StateClosed is a State enum value + StateClosed = "CLOSED" +) + +const ( + // TemplateTypeEmail is a TemplateType enum value + TemplateTypeEmail = "EMAIL" + + // TemplateTypeSms is a TemplateType enum value + TemplateTypeSms = "SMS" + + // TemplateTypeVoice is a TemplateType enum value + TemplateTypeVoice = "VOICE" + + // TemplateTypePush is a TemplateType enum value + TemplateTypePush = "PUSH" +) + const ( // TypeAll is a Type enum value TypeAll = "ALL" diff --git a/vendor/github.com/aws/aws-sdk-go/service/pinpoint/errors.go b/vendor/github.com/aws/aws-sdk-go/service/pinpoint/errors.go index e70fd0b8bf9..5840e4aff15 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/pinpoint/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/pinpoint/errors.go @@ -2,6 +2,10 @@ package pinpoint +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadRequestException for service response error code @@ -40,3 +44,12 @@ const ( // Provides information about an API request or response. ErrCodeTooManyRequestsException = "TooManyRequestsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadRequestException": newErrorBadRequestException, + "ForbiddenException": newErrorForbiddenException, + "InternalServerErrorException": newErrorInternalServerErrorException, + "MethodNotAllowedException": newErrorMethodNotAllowedException, + "NotFoundException": newErrorNotFoundException, + "TooManyRequestsException": newErrorTooManyRequestsException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/pinpoint/service.go b/vendor/github.com/aws/aws-sdk-go/service/pinpoint/service.go index 487964c89cc..31529ff9c7e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/pinpoint/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/pinpoint/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "pinpoint" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Pinpoint" // ServiceID is a unique identifer of a specific service. + ServiceID = "Pinpoint" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Pinpoint client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Pinpoint client from just a session. // svc := pinpoint.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *Pinpoint { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "mobiletargeting" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Pinpoint { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Pinpoint { svc := &Pinpoint{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-12-01", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/pricing/api.go b/vendor/github.com/aws/aws-sdk-go/service/pricing/api.go index 8da137df86d..eddb51929b1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/pricing/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/pricing/api.go @@ -8,6 +8,7 @@ import ( "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" ) const opDescribeServices = "DescribeServices" @@ -74,21 +75,21 @@ func (c *Pricing) DescribeServicesRequest(input *DescribeServicesInput) (req *re // See the AWS API reference guide for AWS Price List Service's // API operation DescribeServices for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters had an invalid value. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource can't be found. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The pagination token is invalid. Try again without a pagination token. // -// * ErrCodeExpiredNextTokenException "ExpiredNextTokenException" +// * ExpiredNextTokenException // The pagination token expired. Try again without a pagination token. // // See also, https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/DescribeServices @@ -156,10 +157,12 @@ func (c *Pricing) DescribeServicesPagesWithContext(ctx aws.Context, input *Descr }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeServicesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeServicesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -225,21 +228,21 @@ func (c *Pricing) GetAttributeValuesRequest(input *GetAttributeValuesInput) (req // See the AWS API reference guide for AWS Price List Service's // API operation GetAttributeValues for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters had an invalid value. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource can't be found. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The pagination token is invalid. Try again without a pagination token. // -// * ErrCodeExpiredNextTokenException "ExpiredNextTokenException" +// * ExpiredNextTokenException // The pagination token expired. Try again without a pagination token. // // See also, https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetAttributeValues @@ -307,10 +310,12 @@ func (c *Pricing) GetAttributeValuesPagesWithContext(ctx aws.Context, input *Get }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetAttributeValuesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetAttributeValuesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -373,21 +378,21 @@ func (c *Pricing) GetProductsRequest(input *GetProductsInput) (req *request.Requ // See the AWS API reference guide for AWS Price List Service's // API operation GetProducts for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // An error on the server occurred during the processing of your request. Try // again later. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters had an invalid value. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The requested resource can't be found. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The pagination token is invalid. Try again without a pagination token. // -// * ErrCodeExpiredNextTokenException "ExpiredNextTokenException" +// * ExpiredNextTokenException // The pagination token expired. Try again without a pagination token. // // See also, https://docs.aws.amazon.com/goto/WebAPI/pricing-2017-10-15/GetProducts @@ -455,10 +460,12 @@ func (c *Pricing) GetProductsPagesWithContext(ctx aws.Context, input *GetProduct }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetProductsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetProductsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -596,6 +603,62 @@ func (s *DescribeServicesOutput) SetServices(v []*Service) *DescribeServicesOutp return s } +// The pagination token expired. Try again without a pagination token. +type ExpiredNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ExpiredNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExpiredNextTokenException) GoString() string { + return s.String() +} + +func newErrorExpiredNextTokenException(v protocol.ResponseMetadata) error { + return &ExpiredNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ExpiredNextTokenException) Code() string { + return "ExpiredNextTokenException" +} + +// Message returns the exception's message. +func (s ExpiredNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ExpiredNextTokenException) OrigErr() error { + return nil +} + +func (s ExpiredNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ExpiredNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ExpiredNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + // The constraints that you want all returned products to match. type Filter struct { _ struct{} `type:"structure"` @@ -915,6 +978,231 @@ func (s *GetProductsOutput) SetPriceList(v []aws.JSONValue) *GetProductsOutput { return s } +// An error on the server occurred during the processing of your request. Try +// again later. +type InternalErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalErrorException) GoString() string { + return s.String() +} + +func newErrorInternalErrorException(v protocol.ResponseMetadata) error { + return &InternalErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalErrorException) Code() string { + return "InternalErrorException" +} + +// Message returns the exception's message. +func (s InternalErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalErrorException) OrigErr() error { + return nil +} + +func (s InternalErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// The pagination token is invalid. Try again without a pagination token. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNextTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more parameters had an invalid value. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} + +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested resource can't be found. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // The metadata for a service, such as the service code and available attribute // names. type Service struct { diff --git a/vendor/github.com/aws/aws-sdk-go/service/pricing/errors.go b/vendor/github.com/aws/aws-sdk-go/service/pricing/errors.go index 10e4c44fe92..c628c9a2b06 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/pricing/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/pricing/errors.go @@ -2,6 +2,10 @@ package pricing +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeExpiredNextTokenException for service response error code @@ -35,3 +39,11 @@ const ( // The requested resource can't be found. ErrCodeNotFoundException = "NotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ExpiredNextTokenException": newErrorExpiredNextTokenException, + "InternalErrorException": newErrorInternalErrorException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "InvalidParameterException": newErrorInvalidParameterException, + "NotFoundException": newErrorNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/pricing/service.go b/vendor/github.com/aws/aws-sdk-go/service/pricing/service.go index 90ff33d0a08..c657fb60619 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/pricing/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/pricing/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "api.pricing" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Pricing" // ServiceID is a unique identifer of a specific service. + ServiceID = "Pricing" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Pricing client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Pricing client from just a session. // svc := pricing.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *Pricing { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "pricing" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Pricing { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Pricing { svc := &Pricing{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-10-15", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/qldb/api.go b/vendor/github.com/aws/aws-sdk-go/service/qldb/api.go index 3d8a1410880..0fcb1f12705 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/qldb/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/qldb/api.go @@ -3,6 +3,7 @@ package qldb import ( + "fmt" "time" "github.com/aws/aws-sdk-go/aws" @@ -65,17 +66,17 @@ func (c *QLDB) CreateLedgerRequest(input *CreateLedgerInput) (req *request.Reque // See the AWS API reference guide for Amazon QLDB's // API operation CreateLedger for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters in the request aren't valid. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // You have reached the limit on the maximum number of resources allowed. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource can't be modified at this time. // // See also, https://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/CreateLedger @@ -160,17 +161,17 @@ func (c *QLDB) DeleteLedgerRequest(input *DeleteLedgerInput) (req *request.Reque // See the AWS API reference guide for Amazon QLDB's // API operation DeleteLedger for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters in the request aren't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The specified resource can't be modified at this time. // -// * ErrCodeResourcePreconditionNotMetException "ResourcePreconditionNotMetException" +// * ResourcePreconditionNotMetException // The operation failed because a condition wasn't satisfied in advance. // // See also, https://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/DeleteLedger @@ -254,8 +255,8 @@ func (c *QLDB) DescribeJournalS3ExportRequest(input *DescribeJournalS3ExportInpu // See the AWS API reference guide for Amazon QLDB's // API operation DescribeJournalS3Export for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/DescribeJournalS3Export @@ -333,11 +334,11 @@ func (c *QLDB) DescribeLedgerRequest(input *DescribeLedgerInput) (req *request.R // See the AWS API reference guide for Amazon QLDB's // API operation DescribeLedger for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters in the request aren't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/DescribeLedger @@ -424,11 +425,11 @@ func (c *QLDB) ExportJournalToS3Request(input *ExportJournalToS3Input) (req *req // See the AWS API reference guide for Amazon QLDB's // API operation ExportJournalToS3 for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeResourcePreconditionNotMetException "ResourcePreconditionNotMetException" +// * ResourcePreconditionNotMetException // The operation failed because a condition wasn't satisfied in advance. // // See also, https://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/ExportJournalToS3 @@ -514,14 +515,14 @@ func (c *QLDB) GetBlockRequest(input *GetBlockInput) (req *request.Request, outp // See the AWS API reference guide for Amazon QLDB's // API operation GetBlock for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters in the request aren't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeResourcePreconditionNotMetException "ResourcePreconditionNotMetException" +// * ResourcePreconditionNotMetException // The operation failed because a condition wasn't satisfied in advance. // // See also, https://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/GetBlock @@ -600,14 +601,14 @@ func (c *QLDB) GetDigestRequest(input *GetDigestInput) (req *request.Request, ou // See the AWS API reference guide for Amazon QLDB's // API operation GetDigest for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters in the request aren't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeResourcePreconditionNotMetException "ResourcePreconditionNotMetException" +// * ResourcePreconditionNotMetException // The operation failed because a condition wasn't satisfied in advance. // // See also, https://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/GetDigest @@ -687,14 +688,14 @@ func (c *QLDB) GetRevisionRequest(input *GetRevisionInput) (req *request.Request // See the AWS API reference guide for Amazon QLDB's // API operation GetRevision for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters in the request aren't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeResourcePreconditionNotMetException "ResourcePreconditionNotMetException" +// * ResourcePreconditionNotMetException // The operation failed because a condition wasn't satisfied in advance. // // See also, https://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/GetRevision @@ -846,10 +847,12 @@ func (c *QLDB) ListJournalS3ExportsPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJournalS3ExportsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListJournalS3ExportsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -980,10 +983,12 @@ func (c *QLDB) ListJournalS3ExportsForLedgerPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJournalS3ExportsForLedgerOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListJournalS3ExportsForLedgerOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1114,10 +1119,12 @@ func (c *QLDB) ListLedgersPagesWithContext(ctx aws.Context, input *ListLedgersIn }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListLedgersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListLedgersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1174,11 +1181,11 @@ func (c *QLDB) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req // See the AWS API reference guide for Amazon QLDB's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters in the request aren't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/ListTagsForResource @@ -1260,11 +1267,11 @@ func (c *QLDB) TagResourceRequest(input *TagResourceInput) (req *request.Request // See the AWS API reference guide for Amazon QLDB's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters in the request aren't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/TagResource @@ -1344,11 +1351,11 @@ func (c *QLDB) UntagResourceRequest(input *UntagResourceInput) (req *request.Req // See the AWS API reference guide for Amazon QLDB's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters in the request aren't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/UntagResource @@ -1426,11 +1433,11 @@ func (c *QLDB) UpdateLedgerRequest(input *UpdateLedgerInput) (req *request.Reque // See the AWS API reference guide for Amazon QLDB's // API operation UpdateLedger for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters in the request aren't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/qldb-2019-01-02/UpdateLedger @@ -2339,6 +2346,65 @@ func (s *GetRevisionOutput) SetRevision(v *ValueHolder) *GetRevisionOutput { return s } +// One or more parameters in the request aren't valid. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The name of the invalid parameter. + ParameterName *string `type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} + +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + // The information about a journal export job, including the ledger name, export // ID, when it was created, current status, and its start and end time export // parameters. @@ -2499,6 +2565,65 @@ func (s *LedgerSummary) SetState(v string) *LedgerSummary { return s } +// You have reached the limit on the maximum number of resources allowed. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The type of resource. + ResourceType *string `type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListJournalS3ExportsForLedgerInput struct { _ struct{} `type:"structure"` @@ -2852,6 +2977,254 @@ func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForRe return s } +// The specified resource already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The name of the resource. + ResourceName *string `type:"string"` + + // The type of resource. + ResourceType *string `type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource can't be modified at this time. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The name of the resource. + ResourceName *string `type:"string"` + + // The type of resource. + ResourceType *string `type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource doesn't exist. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The name of the resource. + ResourceName *string `type:"string"` + + // The type of resource. + ResourceType *string `type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The operation failed because a condition wasn't satisfied in advance. +type ResourcePreconditionNotMetException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The name of the resource. + ResourceName *string `type:"string"` + + // The type of resource. + ResourceType *string `type:"string"` +} + +// String returns the string representation +func (s ResourcePreconditionNotMetException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourcePreconditionNotMetException) GoString() string { + return s.String() +} + +func newErrorResourcePreconditionNotMetException(v protocol.ResponseMetadata) error { + return &ResourcePreconditionNotMetException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourcePreconditionNotMetException) Code() string { + return "ResourcePreconditionNotMetException" +} + +// Message returns the exception's message. +func (s ResourcePreconditionNotMetException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourcePreconditionNotMetException) OrigErr() error { + return nil +} + +func (s ResourcePreconditionNotMetException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourcePreconditionNotMetException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourcePreconditionNotMetException) RequestID() string { + return s.respMetadata.RequestID +} + // The encryption settings that are used by a journal export job to write data // in an Amazon Simple Storage Service (Amazon S3) bucket. type S3EncryptionConfiguration struct { diff --git a/vendor/github.com/aws/aws-sdk-go/service/qldb/errors.go b/vendor/github.com/aws/aws-sdk-go/service/qldb/errors.go index f6d45d03d47..b7cec5a11d7 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/qldb/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/qldb/errors.go @@ -2,6 +2,10 @@ package qldb +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInvalidParameterException for service response error code @@ -40,3 +44,12 @@ const ( // The operation failed because a condition wasn't satisfied in advance. ErrCodeResourcePreconditionNotMetException = "ResourcePreconditionNotMetException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InvalidParameterException": newErrorInvalidParameterException, + "LimitExceededException": newErrorLimitExceededException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ResourcePreconditionNotMetException": newErrorResourcePreconditionNotMetException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/qldb/service.go b/vendor/github.com/aws/aws-sdk-go/service/qldb/service.go index c24c67a5b23..5860a9e108b 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/qldb/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/qldb/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "QLDB" // Name of service. EndpointsID = "qldb" // ID to lookup a service endpoint with. - ServiceID = "QLDB" // ServiceID is a unique identifer of a specific service. + ServiceID = "QLDB" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the QLDB client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a QLDB client from just a session. // svc := qldb.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *QLDB { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "qldb" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *QLDB { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *QLDB { svc := &QLDB{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2019-01-02", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/quicksight/api.go b/vendor/github.com/aws/aws-sdk-go/service/quicksight/api.go index 9722c6d884d..e4cfc186fcd 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/quicksight/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/quicksight/api.go @@ -3,1870 +3,20216 @@ package quicksight import ( + "fmt" + "time" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" ) -const opCreateGroup = "CreateGroup" +const opCancelIngestion = "CancelIngestion" -// CreateGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateGroup operation. The "output" return +// CancelIngestionRequest generates a "aws/request.Request" representing the +// client's request for the CancelIngestion operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See CreateGroup for more information on using the CreateGroup +// See CancelIngestion for more information on using the CancelIngestion // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the CreateGroupRequest method. -// req, resp := client.CreateGroupRequest(params) +// // Example sending a request using the CancelIngestionRequest method. +// req, resp := client.CancelIngestionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateGroup -func (c *QuickSight) CreateGroupRequest(input *CreateGroupInput) (req *request.Request, output *CreateGroupOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CancelIngestion +func (c *QuickSight) CancelIngestionRequest(input *CancelIngestionInput) (req *request.Request, output *CancelIngestionOutput) { op := &request.Operation{ - Name: opCreateGroup, - HTTPMethod: "POST", - HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups", + Name: opCancelIngestion, + HTTPMethod: "DELETE", + HTTPPath: "/accounts/{AwsAccountId}/data-sets/{DataSetId}/ingestions/{IngestionId}", } if input == nil { - input = &CreateGroupInput{} + input = &CancelIngestionInput{} } - output = &CreateGroupOutput{} + output = &CancelIngestionOutput{} req = c.newRequest(op, input, output) return } -// CreateGroup API operation for Amazon QuickSight. +// CancelIngestion API operation for Amazon QuickSight. // -// Creates an Amazon QuickSight group. -// -// The permissions resource is arn:aws:quicksight:us-east-1::group/default/ . -// -// The response is a group object. -// -// CLI Sample: -// -// aws quicksight create-group --aws-account-id=111122223333 --namespace=default -// --group-name="Sales-Management" --description="Sales Management - Forecasting" +// Cancels an ongoing ingestion of data into SPICE. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon QuickSight's -// API operation CreateGroup for usage and error information. +// API operation CancelIngestion for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. // -// * ErrCodeResourceExistsException "ResourceExistsException" -// The resource specified doesn't exist. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // One or more resources can't be found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // Access is throttled. // -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" -// One or more preconditions aren't met. -// -// * ErrCodeLimitExceededException "LimitExceededException" -// A limit is exceeded. +// * ResourceExistsException +// The resource specified already exists. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" -// This resource is currently unavailable. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateGroup -func (c *QuickSight) CreateGroup(input *CreateGroupInput) (*CreateGroupOutput, error) { - req, out := c.CreateGroupRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CancelIngestion +func (c *QuickSight) CancelIngestion(input *CancelIngestionInput) (*CancelIngestionOutput, error) { + req, out := c.CancelIngestionRequest(input) return out, req.Send() } -// CreateGroupWithContext is the same as CreateGroup with the addition of +// CancelIngestionWithContext is the same as CancelIngestion with the addition of // the ability to pass a context and additional request options. // -// See CreateGroup for details on how to use this API operation. +// See CancelIngestion for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) CreateGroupWithContext(ctx aws.Context, input *CreateGroupInput, opts ...request.Option) (*CreateGroupOutput, error) { - req, out := c.CreateGroupRequest(input) +func (c *QuickSight) CancelIngestionWithContext(ctx aws.Context, input *CancelIngestionInput, opts ...request.Option) (*CancelIngestionOutput, error) { + req, out := c.CancelIngestionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opCreateGroupMembership = "CreateGroupMembership" +const opCreateDashboard = "CreateDashboard" -// CreateGroupMembershipRequest generates a "aws/request.Request" representing the -// client's request for the CreateGroupMembership operation. The "output" return +// CreateDashboardRequest generates a "aws/request.Request" representing the +// client's request for the CreateDashboard operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See CreateGroupMembership for more information on using the CreateGroupMembership +// See CreateDashboard for more information on using the CreateDashboard // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the CreateGroupMembershipRequest method. -// req, resp := client.CreateGroupMembershipRequest(params) +// // Example sending a request using the CreateDashboardRequest method. +// req, resp := client.CreateDashboardRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateGroupMembership -func (c *QuickSight) CreateGroupMembershipRequest(input *CreateGroupMembershipInput) (req *request.Request, output *CreateGroupMembershipOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateDashboard +func (c *QuickSight) CreateDashboardRequest(input *CreateDashboardInput) (req *request.Request, output *CreateDashboardOutput) { op := &request.Operation{ - Name: opCreateGroupMembership, - HTTPMethod: "PUT", - HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}/members/{MemberName}", + Name: opCreateDashboard, + HTTPMethod: "POST", + HTTPPath: "/accounts/{AwsAccountId}/dashboards/{DashboardId}", } if input == nil { - input = &CreateGroupMembershipInput{} + input = &CreateDashboardInput{} } - output = &CreateGroupMembershipOutput{} + output = &CreateDashboardOutput{} req = c.newRequest(op, input, output) return } -// CreateGroupMembership API operation for Amazon QuickSight. -// -// Adds an Amazon QuickSight user to an Amazon QuickSight group. -// -// The permissions resource is arn:aws:quicksight:us-east-1::group/default/ . -// -// The condition resource is the user name. +// CreateDashboard API operation for Amazon QuickSight. // -// The condition key is quicksight:UserName. +// Creates a dashboard from a template. To first create a template, see the +// CreateTemplate API operation. // -// The response is the group member object. -// -// CLI Sample: -// -// aws quicksight create-group-membership --aws-account-id=111122223333 --namespace=default -// --group-name=Sales --member-name=Pat +// A dashboard is an entity in QuickSight that identifies QuickSight reports, +// created from analyses. You can share QuickSight dashboards. With the right +// permissions, you can create scheduled email reports from them. The CreateDashboard, +// DescribeDashboard, and ListDashboardsByUser API operations act on the dashboard +// entity. If you have the correct permissions, you can create a dashboard from +// a template that exists in a different 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 QuickSight's -// API operation CreateGroupMembership for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. +// API operation CreateDashboard for usage and error information. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // One or more resources can't be found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ThrottlingException // Access is throttled. // -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" -// One or more preconditions aren't met. +// * ResourceExistsException +// The resource specified already exists. // -// * ErrCodeInternalFailureException "InternalFailureException" -// An internal failure occurred. +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" -// This resource is currently unavailable. +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateGroupMembership -func (c *QuickSight) CreateGroupMembership(input *CreateGroupMembershipInput) (*CreateGroupMembershipOutput, error) { - req, out := c.CreateGroupMembershipRequest(input) +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateDashboard +func (c *QuickSight) CreateDashboard(input *CreateDashboardInput) (*CreateDashboardOutput, error) { + req, out := c.CreateDashboardRequest(input) return out, req.Send() } -// CreateGroupMembershipWithContext is the same as CreateGroupMembership with the addition of +// CreateDashboardWithContext is the same as CreateDashboard with the addition of // the ability to pass a context and additional request options. // -// See CreateGroupMembership for details on how to use this API operation. +// See CreateDashboard for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) CreateGroupMembershipWithContext(ctx aws.Context, input *CreateGroupMembershipInput, opts ...request.Option) (*CreateGroupMembershipOutput, error) { - req, out := c.CreateGroupMembershipRequest(input) +func (c *QuickSight) CreateDashboardWithContext(ctx aws.Context, input *CreateDashboardInput, opts ...request.Option) (*CreateDashboardOutput, error) { + req, out := c.CreateDashboardRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteGroup = "DeleteGroup" +const opCreateDataSet = "CreateDataSet" -// DeleteGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteGroup operation. The "output" return +// CreateDataSetRequest generates a "aws/request.Request" representing the +// client's request for the CreateDataSet operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteGroup for more information on using the DeleteGroup +// See CreateDataSet for more information on using the CreateDataSet // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteGroupRequest method. -// req, resp := client.DeleteGroupRequest(params) +// // Example sending a request using the CreateDataSetRequest method. +// req, resp := client.CreateDataSetRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteGroup -func (c *QuickSight) DeleteGroupRequest(input *DeleteGroupInput) (req *request.Request, output *DeleteGroupOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateDataSet +func (c *QuickSight) CreateDataSetRequest(input *CreateDataSetInput) (req *request.Request, output *CreateDataSetOutput) { op := &request.Operation{ - Name: opDeleteGroup, - HTTPMethod: "DELETE", - HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}", + Name: opCreateDataSet, + HTTPMethod: "POST", + HTTPPath: "/accounts/{AwsAccountId}/data-sets", } if input == nil { - input = &DeleteGroupInput{} + input = &CreateDataSetInput{} } - output = &DeleteGroupOutput{} + output = &CreateDataSetOutput{} req = c.newRequest(op, input, output) return } -// DeleteGroup API operation for Amazon QuickSight. -// -// Removes a user group from Amazon QuickSight. -// -// The permissions resource is arn:aws:quicksight:us-east-1::group/default/ . +// CreateDataSet API operation for Amazon QuickSight. // -// CLI Sample: -// -// aws quicksight delete-group -\-aws-account-id=111122223333 -\-namespace=default -// -\-group-name=Sales-Management +// Creates a dataset. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon QuickSight's -// API operation DeleteGroup for usage and error information. +// API operation CreateDataSet for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. +// * LimitExceededException +// A limit is exceeded. +// +// * ResourceExistsException +// The resource specified already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // One or more resources can't be found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // Access is throttled. // -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" -// One or more preconditions aren't met. +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" -// This resource is currently unavailable. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteGroup -func (c *QuickSight) DeleteGroup(input *DeleteGroupInput) (*DeleteGroupOutput, error) { - req, out := c.DeleteGroupRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateDataSet +func (c *QuickSight) CreateDataSet(input *CreateDataSetInput) (*CreateDataSetOutput, error) { + req, out := c.CreateDataSetRequest(input) return out, req.Send() } -// DeleteGroupWithContext is the same as DeleteGroup with the addition of +// CreateDataSetWithContext is the same as CreateDataSet with the addition of // the ability to pass a context and additional request options. // -// See DeleteGroup for details on how to use this API operation. +// See CreateDataSet for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) DeleteGroupWithContext(ctx aws.Context, input *DeleteGroupInput, opts ...request.Option) (*DeleteGroupOutput, error) { - req, out := c.DeleteGroupRequest(input) +func (c *QuickSight) CreateDataSetWithContext(ctx aws.Context, input *CreateDataSetInput, opts ...request.Option) (*CreateDataSetOutput, error) { + req, out := c.CreateDataSetRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteGroupMembership = "DeleteGroupMembership" +const opCreateDataSource = "CreateDataSource" -// DeleteGroupMembershipRequest generates a "aws/request.Request" representing the -// client's request for the DeleteGroupMembership operation. The "output" return +// CreateDataSourceRequest generates a "aws/request.Request" representing the +// client's request for the CreateDataSource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteGroupMembership for more information on using the DeleteGroupMembership +// See CreateDataSource for more information on using the CreateDataSource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteGroupMembershipRequest method. -// req, resp := client.DeleteGroupMembershipRequest(params) +// // Example sending a request using the CreateDataSourceRequest method. +// req, resp := client.CreateDataSourceRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteGroupMembership -func (c *QuickSight) DeleteGroupMembershipRequest(input *DeleteGroupMembershipInput) (req *request.Request, output *DeleteGroupMembershipOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateDataSource +func (c *QuickSight) CreateDataSourceRequest(input *CreateDataSourceInput) (req *request.Request, output *CreateDataSourceOutput) { op := &request.Operation{ - Name: opDeleteGroupMembership, - HTTPMethod: "DELETE", - HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}/members/{MemberName}", + Name: opCreateDataSource, + HTTPMethod: "POST", + HTTPPath: "/accounts/{AwsAccountId}/data-sources", } if input == nil { - input = &DeleteGroupMembershipInput{} + input = &CreateDataSourceInput{} } - output = &DeleteGroupMembershipOutput{} + output = &CreateDataSourceOutput{} req = c.newRequest(op, input, output) return } -// DeleteGroupMembership API operation for Amazon QuickSight. -// -// Removes a user from a group so that the user is no longer a member of the -// group. -// -// The permissions resource is arn:aws:quicksight:us-east-1::group/default/ . -// -// The condition resource is the user name. +// CreateDataSource API operation for Amazon QuickSight. // -// The condition key is quicksight:UserName. -// -// CLI Sample: -// -// aws quicksight delete-group-membership --aws-account-id=111122223333 --namespace=default -// --group-name=Sales-Management --member-name=Charlie +// Creates a data source. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon QuickSight's -// API operation DeleteGroupMembership for usage and error information. +// API operation CreateDataSource for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * LimitExceededException +// A limit is exceeded. +// +// * ResourceNotFoundException // One or more resources can't be found. // -// * ErrCodeThrottlingException "ThrottlingException" -// Access is throttled. +// * ResourceExistsException +// The resource specified already exists. // -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" -// One or more preconditions aren't met. +// * ThrottlingException +// Access is throttled. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" -// This resource is currently unavailable. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteGroupMembership -func (c *QuickSight) DeleteGroupMembership(input *DeleteGroupMembershipInput) (*DeleteGroupMembershipOutput, error) { - req, out := c.DeleteGroupMembershipRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateDataSource +func (c *QuickSight) CreateDataSource(input *CreateDataSourceInput) (*CreateDataSourceOutput, error) { + req, out := c.CreateDataSourceRequest(input) return out, req.Send() } -// DeleteGroupMembershipWithContext is the same as DeleteGroupMembership with the addition of +// CreateDataSourceWithContext is the same as CreateDataSource with the addition of // the ability to pass a context and additional request options. // -// See DeleteGroupMembership for details on how to use this API operation. +// See CreateDataSource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) DeleteGroupMembershipWithContext(ctx aws.Context, input *DeleteGroupMembershipInput, opts ...request.Option) (*DeleteGroupMembershipOutput, error) { - req, out := c.DeleteGroupMembershipRequest(input) +func (c *QuickSight) CreateDataSourceWithContext(ctx aws.Context, input *CreateDataSourceInput, opts ...request.Option) (*CreateDataSourceOutput, error) { + req, out := c.CreateDataSourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteUser = "DeleteUser" +const opCreateGroup = "CreateGroup" -// DeleteUserRequest generates a "aws/request.Request" representing the -// client's request for the DeleteUser operation. The "output" return +// CreateGroupRequest generates a "aws/request.Request" representing the +// client's request for the CreateGroup operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteUser for more information on using the DeleteUser +// See CreateGroup for more information on using the CreateGroup // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteUserRequest method. -// req, resp := client.DeleteUserRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteUser -func (c *QuickSight) DeleteUserRequest(input *DeleteUserInput) (req *request.Request, output *DeleteUserOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateGroup +func (c *QuickSight) CreateGroupRequest(input *CreateGroupInput) (req *request.Request, output *CreateGroupOutput) { op := &request.Operation{ - Name: opDeleteUser, - HTTPMethod: "DELETE", - HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}", + Name: opCreateGroup, + HTTPMethod: "POST", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups", } if input == nil { - input = &DeleteUserInput{} + input = &CreateGroupInput{} } - output = &DeleteUserOutput{} + output = &CreateGroupOutput{} req = c.newRequest(op, input, output) return } -// DeleteUser API operation for Amazon QuickSight. -// -// Deletes the Amazon QuickSight user that is associated with the identity of -// the AWS Identity and Access Management (IAM) user or role that's making the -// call. The IAM user isn't deleted as a result of this call. +// CreateGroup API operation for Amazon QuickSight. // -// The permission resource is arn:aws:quicksight:us-east-1::user/default/ . +// Creates an Amazon QuickSight group. // -// CLI Sample: +// The permissions resource is arn:aws:quicksight:us-east-1::group/default/ . // -// aws quicksight delete-user --aws-account-id=111122223333 --namespace=default -// --user-name=Pat +// The response is a group object. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon QuickSight's -// API operation DeleteUser for usage and error information. +// API operation CreateGroup for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. +// * ResourceExistsException +// The resource specified already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // One or more resources can't be found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // Access is throttled. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * PreconditionNotMetException +// One or more preconditions aren't met. +// +// * LimitExceededException +// A limit is exceeded. +// +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" +// * ResourceUnavailableException // This resource is currently unavailable. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteUser -func (c *QuickSight) DeleteUser(input *DeleteUserInput) (*DeleteUserOutput, error) { - req, out := c.DeleteUserRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateGroup +func (c *QuickSight) CreateGroup(input *CreateGroupInput) (*CreateGroupOutput, error) { + req, out := c.CreateGroupRequest(input) return out, req.Send() } -// DeleteUserWithContext is the same as DeleteUser with the addition of +// CreateGroupWithContext is the same as CreateGroup with the addition of // the ability to pass a context and additional request options. // -// See DeleteUser for details on how to use this API operation. +// See CreateGroup for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) DeleteUserWithContext(ctx aws.Context, input *DeleteUserInput, opts ...request.Option) (*DeleteUserOutput, error) { - req, out := c.DeleteUserRequest(input) +func (c *QuickSight) CreateGroupWithContext(ctx aws.Context, input *CreateGroupInput, opts ...request.Option) (*CreateGroupOutput, error) { + req, out := c.CreateGroupRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteUserByPrincipalId = "DeleteUserByPrincipalId" +const opCreateGroupMembership = "CreateGroupMembership" -// DeleteUserByPrincipalIdRequest generates a "aws/request.Request" representing the -// client's request for the DeleteUserByPrincipalId operation. The "output" return +// CreateGroupMembershipRequest generates a "aws/request.Request" representing the +// client's request for the CreateGroupMembership operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteUserByPrincipalId for more information on using the DeleteUserByPrincipalId +// See CreateGroupMembership for more information on using the CreateGroupMembership // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteUserByPrincipalIdRequest method. -// req, resp := client.DeleteUserByPrincipalIdRequest(params) +// // Example sending a request using the CreateGroupMembershipRequest method. +// req, resp := client.CreateGroupMembershipRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteUserByPrincipalId -func (c *QuickSight) DeleteUserByPrincipalIdRequest(input *DeleteUserByPrincipalIdInput) (req *request.Request, output *DeleteUserByPrincipalIdOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateGroupMembership +func (c *QuickSight) CreateGroupMembershipRequest(input *CreateGroupMembershipInput) (req *request.Request, output *CreateGroupMembershipOutput) { op := &request.Operation{ - Name: opDeleteUserByPrincipalId, - HTTPMethod: "DELETE", - HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/user-principals/{PrincipalId}", + Name: opCreateGroupMembership, + HTTPMethod: "PUT", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}/members/{MemberName}", } if input == nil { - input = &DeleteUserByPrincipalIdInput{} + input = &CreateGroupMembershipInput{} } - output = &DeleteUserByPrincipalIdOutput{} + output = &CreateGroupMembershipOutput{} req = c.newRequest(op, input, output) return } -// DeleteUserByPrincipalId API operation for Amazon QuickSight. -// -// Deletes a user identified by its principal ID. -// -// The permission resource is arn:aws:quicksight:us-east-1::user/default/ . -// -// CLI Sample: +// CreateGroupMembership API operation for Amazon QuickSight. // -// aws quicksight delete-user-by-principal-id --aws-account-id=111122223333 -// --namespace=default --principal-id=ABCDEFJA26JLI7EUUOEHS +// Adds an Amazon QuickSight user to an Amazon QuickSight 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 QuickSight's -// API operation DeleteUserByPrincipalId for usage and error information. +// API operation CreateGroupMembership for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // One or more resources can't be found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // Access is throttled. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * PreconditionNotMetException +// One or more preconditions aren't met. +// +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" +// * ResourceUnavailableException // This resource is currently unavailable. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteUserByPrincipalId -func (c *QuickSight) DeleteUserByPrincipalId(input *DeleteUserByPrincipalIdInput) (*DeleteUserByPrincipalIdOutput, error) { - req, out := c.DeleteUserByPrincipalIdRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateGroupMembership +func (c *QuickSight) CreateGroupMembership(input *CreateGroupMembershipInput) (*CreateGroupMembershipOutput, error) { + req, out := c.CreateGroupMembershipRequest(input) return out, req.Send() } -// DeleteUserByPrincipalIdWithContext is the same as DeleteUserByPrincipalId with the addition of +// CreateGroupMembershipWithContext is the same as CreateGroupMembership with the addition of // the ability to pass a context and additional request options. // -// See DeleteUserByPrincipalId for details on how to use this API operation. +// See CreateGroupMembership for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) DeleteUserByPrincipalIdWithContext(ctx aws.Context, input *DeleteUserByPrincipalIdInput, opts ...request.Option) (*DeleteUserByPrincipalIdOutput, error) { - req, out := c.DeleteUserByPrincipalIdRequest(input) +func (c *QuickSight) CreateGroupMembershipWithContext(ctx aws.Context, input *CreateGroupMembershipInput, opts ...request.Option) (*CreateGroupMembershipOutput, error) { + req, out := c.CreateGroupMembershipRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeGroup = "DescribeGroup" +const opCreateIAMPolicyAssignment = "CreateIAMPolicyAssignment" -// DescribeGroupRequest generates a "aws/request.Request" representing the -// client's request for the DescribeGroup operation. The "output" return +// CreateIAMPolicyAssignmentRequest generates a "aws/request.Request" representing the +// client's request for the CreateIAMPolicyAssignment operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeGroup for more information on using the DescribeGroup +// See CreateIAMPolicyAssignment for more information on using the CreateIAMPolicyAssignment // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeGroupRequest method. -// req, resp := client.DescribeGroupRequest(params) +// // Example sending a request using the CreateIAMPolicyAssignmentRequest method. +// req, resp := client.CreateIAMPolicyAssignmentRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeGroup -func (c *QuickSight) DescribeGroupRequest(input *DescribeGroupInput) (req *request.Request, output *DescribeGroupOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateIAMPolicyAssignment +func (c *QuickSight) CreateIAMPolicyAssignmentRequest(input *CreateIAMPolicyAssignmentInput) (req *request.Request, output *CreateIAMPolicyAssignmentOutput) { op := &request.Operation{ - Name: opDescribeGroup, - HTTPMethod: "GET", - HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}", + Name: opCreateIAMPolicyAssignment, + HTTPMethod: "POST", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/iam-policy-assignments/", } if input == nil { - input = &DescribeGroupInput{} + input = &CreateIAMPolicyAssignmentInput{} } - output = &DescribeGroupOutput{} + output = &CreateIAMPolicyAssignmentOutput{} req = c.newRequest(op, input, output) return } -// DescribeGroup API operation for Amazon QuickSight. -// -// Returns an Amazon QuickSight group's description and Amazon Resource Name -// (ARN). -// -// The permissions resource is arn:aws:quicksight:us-east-1::group/default/ . -// -// The response is the group object. +// CreateIAMPolicyAssignment API operation for Amazon QuickSight. // -// CLI Sample: -// -// aws quicksight describe-group -\-aws-account-id=11112222333 -\-namespace=default -// -\-group-name=Sales +// Creates an assignment with one specified IAM policy, identified by its Amazon +// Resource Name (ARN). This policy will be assigned to specified groups or +// users of Amazon QuickSight. The users and groups need to be in the same namespace. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon QuickSight's -// API operation DescribeGroup for usage and error information. +// API operation CreateIAMPolicyAssignment for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceExistsException +// The resource specified already exists. +// +// * ResourceNotFoundException // One or more resources can't be found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // Access is throttled. // -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" -// One or more preconditions aren't met. +// * ConcurrentUpdatingException +// A resource is already in a state that indicates an action is happening that +// must complete before a new update can be applied. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" -// This resource is currently unavailable. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeGroup -func (c *QuickSight) DescribeGroup(input *DescribeGroupInput) (*DescribeGroupOutput, error) { - req, out := c.DescribeGroupRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateIAMPolicyAssignment +func (c *QuickSight) CreateIAMPolicyAssignment(input *CreateIAMPolicyAssignmentInput) (*CreateIAMPolicyAssignmentOutput, error) { + req, out := c.CreateIAMPolicyAssignmentRequest(input) return out, req.Send() } -// DescribeGroupWithContext is the same as DescribeGroup with the addition of +// CreateIAMPolicyAssignmentWithContext is the same as CreateIAMPolicyAssignment with the addition of // the ability to pass a context and additional request options. // -// See DescribeGroup for details on how to use this API operation. +// See CreateIAMPolicyAssignment for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) DescribeGroupWithContext(ctx aws.Context, input *DescribeGroupInput, opts ...request.Option) (*DescribeGroupOutput, error) { - req, out := c.DescribeGroupRequest(input) +func (c *QuickSight) CreateIAMPolicyAssignmentWithContext(ctx aws.Context, input *CreateIAMPolicyAssignmentInput, opts ...request.Option) (*CreateIAMPolicyAssignmentOutput, error) { + req, out := c.CreateIAMPolicyAssignmentRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeUser = "DescribeUser" +const opCreateIngestion = "CreateIngestion" -// DescribeUserRequest generates a "aws/request.Request" representing the -// client's request for the DescribeUser operation. The "output" return +// CreateIngestionRequest generates a "aws/request.Request" representing the +// client's request for the CreateIngestion operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeUser for more information on using the DescribeUser +// See CreateIngestion for more information on using the CreateIngestion // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeUserRequest method. -// req, resp := client.DescribeUserRequest(params) +// // Example sending a request using the CreateIngestionRequest method. +// req, resp := client.CreateIngestionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeUser -func (c *QuickSight) DescribeUserRequest(input *DescribeUserInput) (req *request.Request, output *DescribeUserOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateIngestion +func (c *QuickSight) CreateIngestionRequest(input *CreateIngestionInput) (req *request.Request, output *CreateIngestionOutput) { op := &request.Operation{ - Name: opDescribeUser, - HTTPMethod: "GET", - HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}", + Name: opCreateIngestion, + HTTPMethod: "PUT", + HTTPPath: "/accounts/{AwsAccountId}/data-sets/{DataSetId}/ingestions/{IngestionId}", } if input == nil { - input = &DescribeUserInput{} + input = &CreateIngestionInput{} } - output = &DescribeUserOutput{} + output = &CreateIngestionOutput{} req = c.newRequest(op, input, output) return } -// DescribeUser API operation for Amazon QuickSight. -// -// Returns information about a user, given the user name. +// CreateIngestion API operation for Amazon QuickSight. // -// The permission resource is arn:aws:quicksight:us-east-1::user/default/ . +// Creates and starts a new SPICE ingestion on a dataset // -// The response is a user object that contains the user's Amazon Resource Name -// (ARN), AWS Identity and Access Management (IAM) role, and email address. -// -// CLI Sample: -// -// aws quicksight describe-user --aws-account-id=111122223333 --namespace=default -// --user-name=Pat +// Any ingestions operating on tagged datasets inherit the same tags automatically +// for use in access control. For an example, see How do I create an IAM policy +// to control access to Amazon EC2 resources using tags? (https://aws.example.com/premiumsupport/knowledge-center/iam-ec2-resource-tags/) +// in the AWS Knowledge Center. Tags are visible on the tagged dataset, but +// not on the ingestion 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 QuickSight's -// API operation DescribeUser for usage and error information. +// API operation CreateIngestion for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // One or more resources can't be found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // Access is throttled. // -// * ErrCodeInternalFailureException "InternalFailureException" -// An internal failure occurred. +// * LimitExceededException +// A limit is exceeded. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" -// This resource is currently unavailable. +// * ResourceExistsException +// The resource specified already exists. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeUser -func (c *QuickSight) DescribeUser(input *DescribeUserInput) (*DescribeUserOutput, error) { - req, out := c.DescribeUserRequest(input) +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateIngestion +func (c *QuickSight) CreateIngestion(input *CreateIngestionInput) (*CreateIngestionOutput, error) { + req, out := c.CreateIngestionRequest(input) return out, req.Send() } -// DescribeUserWithContext is the same as DescribeUser with the addition of +// CreateIngestionWithContext is the same as CreateIngestion with the addition of // the ability to pass a context and additional request options. // -// See DescribeUser for details on how to use this API operation. +// See CreateIngestion for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) DescribeUserWithContext(ctx aws.Context, input *DescribeUserInput, opts ...request.Option) (*DescribeUserOutput, error) { - req, out := c.DescribeUserRequest(input) +func (c *QuickSight) CreateIngestionWithContext(ctx aws.Context, input *CreateIngestionInput, opts ...request.Option) (*CreateIngestionOutput, error) { + req, out := c.CreateIngestionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetDashboardEmbedUrl = "GetDashboardEmbedUrl" +const opCreateTemplate = "CreateTemplate" -// GetDashboardEmbedUrlRequest generates a "aws/request.Request" representing the -// client's request for the GetDashboardEmbedUrl operation. The "output" return +// CreateTemplateRequest generates a "aws/request.Request" representing the +// client's request for the CreateTemplate operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetDashboardEmbedUrl for more information on using the GetDashboardEmbedUrl +// See CreateTemplate for more information on using the CreateTemplate // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetDashboardEmbedUrlRequest method. -// req, resp := client.GetDashboardEmbedUrlRequest(params) +// // Example sending a request using the CreateTemplateRequest method. +// req, resp := client.CreateTemplateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/GetDashboardEmbedUrl -func (c *QuickSight) GetDashboardEmbedUrlRequest(input *GetDashboardEmbedUrlInput) (req *request.Request, output *GetDashboardEmbedUrlOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateTemplate +func (c *QuickSight) CreateTemplateRequest(input *CreateTemplateInput) (req *request.Request, output *CreateTemplateOutput) { op := &request.Operation{ - Name: opGetDashboardEmbedUrl, - HTTPMethod: "GET", - HTTPPath: "/accounts/{AwsAccountId}/dashboards/{DashboardId}/embed-url", + Name: opCreateTemplate, + HTTPMethod: "POST", + HTTPPath: "/accounts/{AwsAccountId}/templates/{TemplateId}", } if input == nil { - input = &GetDashboardEmbedUrlInput{} + input = &CreateTemplateInput{} } - output = &GetDashboardEmbedUrlOutput{} + output = &CreateTemplateOutput{} req = c.newRequest(op, input, output) return } -// GetDashboardEmbedUrl API operation for Amazon QuickSight. -// -// Generates a server-side embeddable URL and authorization code. Before this -// can work properly, first you need to configure the dashboards and user permissions. -// For more information, see Embedding Amazon QuickSight Dashboards (https://docs.aws.amazon.com/en_us/quicksight/latest/user/embedding.html). -// -// Currently, you can use GetDashboardEmbedURL only from the server, not from -// the user’s browser. -// -// CLI Sample: -// -// Assume the role with permissions enabled for actions: quickSight:RegisterUser -// and quicksight:GetDashboardEmbedURL. You can use assume-role, assume-role-with-web-identity, -// or assume-role-with-saml. +// CreateTemplate API operation for Amazon QuickSight. // -// aws sts assume-role --role-arn "arn:aws:iam::111122223333:role/embedding_quicksight_dashboard_role" -// --role-session-name embeddingsession +// Creates a template from an existing QuickSight analysis or template. You +// can use the resulting template to create a dashboard. // -// If the user does not exist in QuickSight, register the user: -// -// aws quicksight register-user --aws-account-id 111122223333 --namespace default -// --identity-type IAM --iam-arn "arn:aws:iam::111122223333:role/embedding_quicksight_dashboard_role" -// --user-role READER --session-name "embeddingsession" --email user123@example.com -// --region us-east-1 -// -// Get the URL for the embedded dashboard -// -// aws quicksight get-dashboard-embed-url --aws-account-id 111122223333 --dashboard-id -// 1a1ac2b2-3fc3-4b44-5e5d-c6db6778df89 --identity-type IAM +// A template is an entity in QuickSight that encapsulates the metadata required +// to create an analysis and that you can use to create s dashboard. A template +// adds a layer of abstraction by using placeholders to replace the dataset +// associated with the analysis. You can use templates to create dashboards +// by replacing dataset placeholders with datasets that follow the same schema +// that was used to create the source analysis and 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 QuickSight's -// API operation GetDashboardEmbedUrl for usage and error information. +// API operation CreateTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. +// Returned Error Types: +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. // -// * ErrCodeResourceExistsException "ResourceExistsException" -// The resource specified doesn't exist. +// * ResourceExistsException +// The resource specified already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // One or more resources can't be found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // Access is throttled. // -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" -// One or more preconditions aren't met. -// -// * ErrCodeDomainNotWhitelistedException "DomainNotWhitelistedException" -// The domain specified is not on the allowlist. All domains for embedded dashboards -// must be added to the approved list by an Amazon QuickSight admin. -// -// * ErrCodeUserNotFoundException "QuickSightUserNotFoundException" -// The user is not found. This error can happen in any operation that requires -// finding a user based on a provided user name, such as DeleteUser, DescribeUser, -// and so on. -// -// * ErrCodeIdentityTypeNotSupportedException "IdentityTypeNotSupportedException" -// The identity type specified is not supported. Supported identity types include -// IAM and QUICKSIGHT. -// -// * ErrCodeSessionLifetimeInMinutesInvalidException "SessionLifetimeInMinutesInvalidException" -// The number of minutes specified for the lifetime of a session is not valid. -// The session lifetime must be from 15 to 600 minutes. +// * LimitExceededException +// A limit is exceeded. // -// * ErrCodeUnsupportedUserEditionException "UnsupportedUserEditionException" +// * UnsupportedUserEditionException // This error indicates that you are calling an operation on an Amazon QuickSight // subscription where the edition doesn't include support for that operation. // Amazon QuickSight currently has Standard Edition and Enterprise Edition. // Not every operation and capability is available in every edition. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" -// This resource is currently unavailable. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/GetDashboardEmbedUrl -func (c *QuickSight) GetDashboardEmbedUrl(input *GetDashboardEmbedUrlInput) (*GetDashboardEmbedUrlOutput, error) { - req, out := c.GetDashboardEmbedUrlRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateTemplate +func (c *QuickSight) CreateTemplate(input *CreateTemplateInput) (*CreateTemplateOutput, error) { + req, out := c.CreateTemplateRequest(input) return out, req.Send() } -// GetDashboardEmbedUrlWithContext is the same as GetDashboardEmbedUrl with the addition of +// CreateTemplateWithContext is the same as CreateTemplate with the addition of // the ability to pass a context and additional request options. // -// See GetDashboardEmbedUrl for details on how to use this API operation. +// See CreateTemplate for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) GetDashboardEmbedUrlWithContext(ctx aws.Context, input *GetDashboardEmbedUrlInput, opts ...request.Option) (*GetDashboardEmbedUrlOutput, error) { - req, out := c.GetDashboardEmbedUrlRequest(input) +func (c *QuickSight) CreateTemplateWithContext(ctx aws.Context, input *CreateTemplateInput, opts ...request.Option) (*CreateTemplateOutput, error) { + req, out := c.CreateTemplateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListGroupMemberships = "ListGroupMemberships" +const opCreateTemplateAlias = "CreateTemplateAlias" -// ListGroupMembershipsRequest generates a "aws/request.Request" representing the -// client's request for the ListGroupMemberships operation. The "output" return +// CreateTemplateAliasRequest generates a "aws/request.Request" representing the +// client's request for the CreateTemplateAlias operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListGroupMemberships for more information on using the ListGroupMemberships +// See CreateTemplateAlias for more information on using the CreateTemplateAlias // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListGroupMembershipsRequest method. -// req, resp := client.ListGroupMembershipsRequest(params) +// // Example sending a request using the CreateTemplateAliasRequest method. +// req, resp := client.CreateTemplateAliasRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListGroupMemberships -func (c *QuickSight) ListGroupMembershipsRequest(input *ListGroupMembershipsInput) (req *request.Request, output *ListGroupMembershipsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateTemplateAlias +func (c *QuickSight) CreateTemplateAliasRequest(input *CreateTemplateAliasInput) (req *request.Request, output *CreateTemplateAliasOutput) { op := &request.Operation{ - Name: opListGroupMemberships, - HTTPMethod: "GET", - HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}/members", + Name: opCreateTemplateAlias, + HTTPMethod: "POST", + HTTPPath: "/accounts/{AwsAccountId}/templates/{TemplateId}/aliases/{AliasName}", } if input == nil { - input = &ListGroupMembershipsInput{} + input = &CreateTemplateAliasInput{} } - output = &ListGroupMembershipsOutput{} + output = &CreateTemplateAliasOutput{} req = c.newRequest(op, input, output) return } -// ListGroupMemberships API operation for Amazon QuickSight. +// CreateTemplateAlias API operation for Amazon QuickSight. // -// Lists member users in a group. -// -// The permissions resource is arn:aws:quicksight:us-east-1::group/default/ . -// -// The response is a list of group member objects. -// -// CLI Sample: -// -// aws quicksight list-group-memberships -\-aws-account-id=111122223333 -\-namespace=default +// Creates a template alias for a 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 QuickSight's -// API operation ListGroupMemberships for usage and error information. +// API operation CreateTemplateAlias for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. -// -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. +// Returned Error Types: +// * ThrottlingException +// Access is throttled. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // One or more resources can't be found. // -// * ErrCodeThrottlingException "ThrottlingException" -// Access is throttled. +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The NextToken value isn't valid. +// * ResourceExistsException +// The resource specified already exists. // -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" -// One or more preconditions aren't met. +// * LimitExceededException +// A limit is exceeded. // -// * ErrCodeInternalFailureException "InternalFailureException" -// An internal failure occurred. +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" -// This resource is currently unavailable. +// * InternalFailureException +// An internal failure occurred. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListGroupMemberships -func (c *QuickSight) ListGroupMemberships(input *ListGroupMembershipsInput) (*ListGroupMembershipsOutput, error) { - req, out := c.ListGroupMembershipsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/CreateTemplateAlias +func (c *QuickSight) CreateTemplateAlias(input *CreateTemplateAliasInput) (*CreateTemplateAliasOutput, error) { + req, out := c.CreateTemplateAliasRequest(input) return out, req.Send() } -// ListGroupMembershipsWithContext is the same as ListGroupMemberships with the addition of +// CreateTemplateAliasWithContext is the same as CreateTemplateAlias with the addition of // the ability to pass a context and additional request options. // -// See ListGroupMemberships for details on how to use this API operation. +// See CreateTemplateAlias for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) ListGroupMembershipsWithContext(ctx aws.Context, input *ListGroupMembershipsInput, opts ...request.Option) (*ListGroupMembershipsOutput, error) { - req, out := c.ListGroupMembershipsRequest(input) +func (c *QuickSight) CreateTemplateAliasWithContext(ctx aws.Context, input *CreateTemplateAliasInput, opts ...request.Option) (*CreateTemplateAliasOutput, error) { + req, out := c.CreateTemplateAliasRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListGroups = "ListGroups" +const opDeleteDashboard = "DeleteDashboard" -// ListGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListGroups operation. The "output" return +// DeleteDashboardRequest generates a "aws/request.Request" representing the +// client's request for the DeleteDashboard operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListGroups for more information on using the ListGroups +// See DeleteDashboard for more information on using the DeleteDashboard // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListGroupsRequest method. -// req, resp := client.ListGroupsRequest(params) +// // Example sending a request using the DeleteDashboardRequest method. +// req, resp := client.DeleteDashboardRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListGroups -func (c *QuickSight) ListGroupsRequest(input *ListGroupsInput) (req *request.Request, output *ListGroupsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteDashboard +func (c *QuickSight) DeleteDashboardRequest(input *DeleteDashboardInput) (req *request.Request, output *DeleteDashboardOutput) { op := &request.Operation{ - Name: opListGroups, - HTTPMethod: "GET", - HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups", + Name: opDeleteDashboard, + HTTPMethod: "DELETE", + HTTPPath: "/accounts/{AwsAccountId}/dashboards/{DashboardId}", } if input == nil { - input = &ListGroupsInput{} + input = &DeleteDashboardInput{} } - output = &ListGroupsOutput{} + output = &DeleteDashboardOutput{} req = c.newRequest(op, input, output) return } -// ListGroups API operation for Amazon QuickSight. -// -// Lists all user groups in Amazon QuickSight. -// -// The permissions resource is arn:aws:quicksight:us-east-1::group/default/*. +// DeleteDashboard API operation for Amazon QuickSight. // -// The response is a list of group objects. -// -// CLI Sample: -// -// aws quicksight list-groups -\-aws-account-id=111122223333 -\-namespace=default +// Deletes a dashboard. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon QuickSight's -// API operation ListGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. +// API operation DeleteDashboard for usage and error information. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. +// Returned Error Types: +// * ThrottlingException +// Access is throttled. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// One or more resources can't be found. +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. // -// * ErrCodeThrottlingException "ThrottlingException" -// Access is throttled. +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The NextToken value isn't valid. +// * ResourceNotFoundException +// One or more resources can't be found. // -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" -// One or more preconditions aren't met. +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" -// This resource is currently unavailable. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListGroups -func (c *QuickSight) ListGroups(input *ListGroupsInput) (*ListGroupsOutput, error) { - req, out := c.ListGroupsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteDashboard +func (c *QuickSight) DeleteDashboard(input *DeleteDashboardInput) (*DeleteDashboardOutput, error) { + req, out := c.DeleteDashboardRequest(input) return out, req.Send() } -// ListGroupsWithContext is the same as ListGroups with the addition of +// DeleteDashboardWithContext is the same as DeleteDashboard with the addition of // the ability to pass a context and additional request options. // -// See ListGroups for details on how to use this API operation. +// See DeleteDashboard for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) ListGroupsWithContext(ctx aws.Context, input *ListGroupsInput, opts ...request.Option) (*ListGroupsOutput, error) { - req, out := c.ListGroupsRequest(input) +func (c *QuickSight) DeleteDashboardWithContext(ctx aws.Context, input *DeleteDashboardInput, opts ...request.Option) (*DeleteDashboardOutput, error) { + req, out := c.DeleteDashboardRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListUserGroups = "ListUserGroups" +const opDeleteDataSet = "DeleteDataSet" -// ListUserGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListUserGroups operation. The "output" return +// DeleteDataSetRequest generates a "aws/request.Request" representing the +// client's request for the DeleteDataSet operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListUserGroups for more information on using the ListUserGroups +// See DeleteDataSet for more information on using the DeleteDataSet // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListUserGroupsRequest method. -// req, resp := client.ListUserGroupsRequest(params) +// // Example sending a request using the DeleteDataSetRequest method. +// req, resp := client.DeleteDataSetRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListUserGroups -func (c *QuickSight) ListUserGroupsRequest(input *ListUserGroupsInput) (req *request.Request, output *ListUserGroupsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteDataSet +func (c *QuickSight) DeleteDataSetRequest(input *DeleteDataSetInput) (req *request.Request, output *DeleteDataSetOutput) { op := &request.Operation{ - Name: opListUserGroups, - HTTPMethod: "GET", - HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}/groups", + Name: opDeleteDataSet, + HTTPMethod: "DELETE", + HTTPPath: "/accounts/{AwsAccountId}/data-sets/{DataSetId}", } if input == nil { - input = &ListUserGroupsInput{} + input = &DeleteDataSetInput{} } - output = &ListUserGroupsOutput{} + output = &DeleteDataSetOutput{} req = c.newRequest(op, input, output) return } -// ListUserGroups API operation for Amazon QuickSight. -// -// Lists the Amazon QuickSight groups that an Amazon QuickSight user is a member -// of. -// -// The permission resource is arn:aws:quicksight:us-east-1::user/default/ . -// -// The response is a one or more group objects. -// -// CLI Sample: +// DeleteDataSet API operation for Amazon QuickSight. // -// aws quicksight list-user-groups -\-user-name=Pat -\-aws-account-id=111122223333 -// -\-namespace=default -\-region=us-east-1 +// Deletes a dataset. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon QuickSight's -// API operation ListUserGroups for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. +// API operation DeleteDataSet for usage and error information. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// One or more resources can't be found. +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // Access is throttled. // -// * ErrCodeInternalFailureException "InternalFailureException" -// An internal failure occurred. +// * ResourceNotFoundException +// One or more resources can't be found. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" -// This resource is currently unavailable. +// * InternalFailureException +// An internal failure occurred. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListUserGroups -func (c *QuickSight) ListUserGroups(input *ListUserGroupsInput) (*ListUserGroupsOutput, error) { - req, out := c.ListUserGroupsRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteDataSet +func (c *QuickSight) DeleteDataSet(input *DeleteDataSetInput) (*DeleteDataSetOutput, error) { + req, out := c.DeleteDataSetRequest(input) return out, req.Send() } -// ListUserGroupsWithContext is the same as ListUserGroups with the addition of +// DeleteDataSetWithContext is the same as DeleteDataSet with the addition of // the ability to pass a context and additional request options. // -// See ListUserGroups for details on how to use this API operation. +// See DeleteDataSet for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) ListUserGroupsWithContext(ctx aws.Context, input *ListUserGroupsInput, opts ...request.Option) (*ListUserGroupsOutput, error) { - req, out := c.ListUserGroupsRequest(input) +func (c *QuickSight) DeleteDataSetWithContext(ctx aws.Context, input *DeleteDataSetInput, opts ...request.Option) (*DeleteDataSetOutput, error) { + req, out := c.DeleteDataSetRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListUsers = "ListUsers" +const opDeleteDataSource = "DeleteDataSource" -// ListUsersRequest generates a "aws/request.Request" representing the -// client's request for the ListUsers operation. The "output" return +// DeleteDataSourceRequest generates a "aws/request.Request" representing the +// client's request for the DeleteDataSource operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListUsers for more information on using the ListUsers +// See DeleteDataSource for more information on using the DeleteDataSource // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListUsersRequest method. -// req, resp := client.ListUsersRequest(params) +// // Example sending a request using the DeleteDataSourceRequest method. +// req, resp := client.DeleteDataSourceRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListUsers -func (c *QuickSight) ListUsersRequest(input *ListUsersInput) (req *request.Request, output *ListUsersOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteDataSource +func (c *QuickSight) DeleteDataSourceRequest(input *DeleteDataSourceInput) (req *request.Request, output *DeleteDataSourceOutput) { op := &request.Operation{ - Name: opListUsers, - HTTPMethod: "GET", - HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/users", + Name: opDeleteDataSource, + HTTPMethod: "DELETE", + HTTPPath: "/accounts/{AwsAccountId}/data-sources/{DataSourceId}", } if input == nil { - input = &ListUsersInput{} + input = &DeleteDataSourceInput{} } - output = &ListUsersOutput{} + output = &DeleteDataSourceOutput{} req = c.newRequest(op, input, output) return } -// ListUsers API operation for Amazon QuickSight. -// -// Returns a list of all of the Amazon QuickSight users belonging to this account. -// -// The permission resource is arn:aws:quicksight:us-east-1::user/default/* . +// DeleteDataSource API operation for Amazon QuickSight. // -// The response is a list of user objects, containing each user's Amazon Resource -// Name (ARN), AWS Identity and Access Management (IAM) role, and email address. -// -// CLI Sample: -// -// aws quicksight list-users --aws-account-id=111122223333 --namespace=default +// Deletes the data source permanently. This action breaks all the datasets +// that reference the deleted data source. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon QuickSight's -// API operation ListUsers for usage and error information. -// -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. +// API operation DeleteDataSource for usage and error information. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// One or more resources can't be found. +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // Access is throttled. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// The NextToken value isn't valid. +// * ResourceNotFoundException +// One or more resources can't be found. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" -// This resource is currently unavailable. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListUsers -func (c *QuickSight) ListUsers(input *ListUsersInput) (*ListUsersOutput, error) { - req, out := c.ListUsersRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteDataSource +func (c *QuickSight) DeleteDataSource(input *DeleteDataSourceInput) (*DeleteDataSourceOutput, error) { + req, out := c.DeleteDataSourceRequest(input) return out, req.Send() } -// ListUsersWithContext is the same as ListUsers with the addition of +// DeleteDataSourceWithContext is the same as DeleteDataSource with the addition of // the ability to pass a context and additional request options. // -// See ListUsers for details on how to use this API operation. +// See DeleteDataSource for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) ListUsersWithContext(ctx aws.Context, input *ListUsersInput, opts ...request.Option) (*ListUsersOutput, error) { - req, out := c.ListUsersRequest(input) +func (c *QuickSight) DeleteDataSourceWithContext(ctx aws.Context, input *DeleteDataSourceInput, opts ...request.Option) (*DeleteDataSourceOutput, error) { + req, out := c.DeleteDataSourceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRegisterUser = "RegisterUser" +const opDeleteGroup = "DeleteGroup" -// RegisterUserRequest generates a "aws/request.Request" representing the -// client's request for the RegisterUser operation. The "output" return +// DeleteGroupRequest generates a "aws/request.Request" representing the +// client's request for the DeleteGroup operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RegisterUser for more information on using the RegisterUser +// See DeleteGroup for more information on using the DeleteGroup // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RegisterUserRequest method. -// req, resp := client.RegisterUserRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/RegisterUser -func (c *QuickSight) RegisterUserRequest(input *RegisterUserInput) (req *request.Request, output *RegisterUserOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteGroup +func (c *QuickSight) DeleteGroupRequest(input *DeleteGroupInput) (req *request.Request, output *DeleteGroupOutput) { op := &request.Operation{ - Name: opRegisterUser, - HTTPMethod: "POST", - HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/users", + Name: opDeleteGroup, + HTTPMethod: "DELETE", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}", } if input == nil { - input = &RegisterUserInput{} + input = &DeleteGroupInput{} } - output = &RegisterUserOutput{} + output = &DeleteGroupOutput{} req = c.newRequest(op, input, output) return } -// RegisterUser API operation for Amazon QuickSight. -// -// Creates an Amazon QuickSight user, whose identity is associated with the -// AWS Identity and Access Management (IAM) identity or role specified in the -// request. -// -// The permission resource is arn:aws:quicksight:us-east-1::user/default/ . -// -// The condition resource is the Amazon Resource Name (ARN) for the IAM user -// or role, and the session name. -// -// The condition keys are quicksight:IamArn and quicksight:SessionName. -// -// CLI Sample: +// DeleteGroup API operation for Amazon QuickSight. // -// aws quicksight register-user -\-aws-account-id=111122223333 -\-namespace=default -// -\-email=pat@example.com -\-identity-type=IAM -\-user-role=AUTHOR -\-iam-arn=arn:aws:iam::111122223333:user/Pat +// Removes a user group from Amazon QuickSight. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon QuickSight's -// API operation RegisterUser for usage and error information. +// API operation DeleteGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // One or more resources can't be found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // Access is throttled. // -// * ErrCodeLimitExceededException "LimitExceededException" -// A limit is exceeded. -// -// * ErrCodeResourceExistsException "ResourceExistsException" -// The resource specified doesn't exist. -// -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" +// * PreconditionNotMetException // One or more preconditions aren't met. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" +// * ResourceUnavailableException // This resource is currently unavailable. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/RegisterUser -func (c *QuickSight) RegisterUser(input *RegisterUserInput) (*RegisterUserOutput, error) { - req, out := c.RegisterUserRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteGroup +func (c *QuickSight) DeleteGroup(input *DeleteGroupInput) (*DeleteGroupOutput, error) { + req, out := c.DeleteGroupRequest(input) return out, req.Send() } -// RegisterUserWithContext is the same as RegisterUser with the addition of +// DeleteGroupWithContext is the same as DeleteGroup with the addition of // the ability to pass a context and additional request options. // -// See RegisterUser for details on how to use this API operation. +// See DeleteGroup for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) RegisterUserWithContext(ctx aws.Context, input *RegisterUserInput, opts ...request.Option) (*RegisterUserOutput, error) { - req, out := c.RegisterUserRequest(input) +func (c *QuickSight) DeleteGroupWithContext(ctx aws.Context, input *DeleteGroupInput, opts ...request.Option) (*DeleteGroupOutput, error) { + req, out := c.DeleteGroupRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateGroup = "UpdateGroup" +const opDeleteGroupMembership = "DeleteGroupMembership" -// UpdateGroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateGroup operation. The "output" return +// DeleteGroupMembershipRequest generates a "aws/request.Request" representing the +// client's request for the DeleteGroupMembership operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateGroup for more information on using the UpdateGroup +// See DeleteGroupMembership for more information on using the DeleteGroupMembership // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateGroupRequest method. -// req, resp := client.UpdateGroupRequest(params) +// // Example sending a request using the DeleteGroupMembershipRequest method. +// req, resp := client.DeleteGroupMembershipRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateGroup -func (c *QuickSight) UpdateGroupRequest(input *UpdateGroupInput) (req *request.Request, output *UpdateGroupOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteGroupMembership +func (c *QuickSight) DeleteGroupMembershipRequest(input *DeleteGroupMembershipInput) (req *request.Request, output *DeleteGroupMembershipOutput) { op := &request.Operation{ - Name: opUpdateGroup, - HTTPMethod: "PUT", - HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}", + Name: opDeleteGroupMembership, + HTTPMethod: "DELETE", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}/members/{MemberName}", } if input == nil { - input = &UpdateGroupInput{} + input = &DeleteGroupMembershipInput{} } - output = &UpdateGroupOutput{} + output = &DeleteGroupMembershipOutput{} req = c.newRequest(op, input, output) return } -// UpdateGroup API operation for Amazon QuickSight. -// -// Changes a group description. -// -// The permissions resource is arn:aws:quicksight:us-east-1::group/default/ . -// -// The response is a group object. -// -// CLI Sample: +// DeleteGroupMembership API operation for Amazon QuickSight. // -// aws quicksight update-group --aws-account-id=111122223333 --namespace=default -// --group-name=Sales --description="Sales BI Dashboards" +// Removes a user from a group so that the user is no longer a member of the +// 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 QuickSight's -// API operation UpdateGroup for usage and error information. +// API operation DeleteGroupMembership for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // One or more resources can't be found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // Access is throttled. // -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" +// * PreconditionNotMetException // One or more preconditions aren't met. // -// * ErrCodeInternalFailureException "InternalFailureException" +// * InternalFailureException // An internal failure occurred. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" +// * ResourceUnavailableException // This resource is currently unavailable. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateGroup -func (c *QuickSight) UpdateGroup(input *UpdateGroupInput) (*UpdateGroupOutput, error) { - req, out := c.UpdateGroupRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteGroupMembership +func (c *QuickSight) DeleteGroupMembership(input *DeleteGroupMembershipInput) (*DeleteGroupMembershipOutput, error) { + req, out := c.DeleteGroupMembershipRequest(input) return out, req.Send() } -// UpdateGroupWithContext is the same as UpdateGroup with the addition of +// DeleteGroupMembershipWithContext is the same as DeleteGroupMembership with the addition of // the ability to pass a context and additional request options. // -// See UpdateGroup for details on how to use this API operation. +// See DeleteGroupMembership for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) UpdateGroupWithContext(ctx aws.Context, input *UpdateGroupInput, opts ...request.Option) (*UpdateGroupOutput, error) { - req, out := c.UpdateGroupRequest(input) +func (c *QuickSight) DeleteGroupMembershipWithContext(ctx aws.Context, input *DeleteGroupMembershipInput, opts ...request.Option) (*DeleteGroupMembershipOutput, error) { + req, out := c.DeleteGroupMembershipRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateUser = "UpdateUser" +const opDeleteIAMPolicyAssignment = "DeleteIAMPolicyAssignment" -// UpdateUserRequest generates a "aws/request.Request" representing the -// client's request for the UpdateUser operation. The "output" return +// DeleteIAMPolicyAssignmentRequest generates a "aws/request.Request" representing the +// client's request for the DeleteIAMPolicyAssignment operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateUser for more information on using the UpdateUser +// See DeleteIAMPolicyAssignment for more information on using the DeleteIAMPolicyAssignment // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateUserRequest method. -// req, resp := client.UpdateUserRequest(params) +// // Example sending a request using the DeleteIAMPolicyAssignmentRequest method. +// req, resp := client.DeleteIAMPolicyAssignmentRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateUser -func (c *QuickSight) UpdateUserRequest(input *UpdateUserInput) (req *request.Request, output *UpdateUserOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteIAMPolicyAssignment +func (c *QuickSight) DeleteIAMPolicyAssignmentRequest(input *DeleteIAMPolicyAssignmentInput) (req *request.Request, output *DeleteIAMPolicyAssignmentOutput) { op := &request.Operation{ - Name: opUpdateUser, - HTTPMethod: "PUT", - HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}", + Name: opDeleteIAMPolicyAssignment, + HTTPMethod: "DELETE", + HTTPPath: "/accounts/{AwsAccountId}/namespace/{Namespace}/iam-policy-assignments/{AssignmentName}", } if input == nil { - input = &UpdateUserInput{} + input = &DeleteIAMPolicyAssignmentInput{} } - output = &UpdateUserOutput{} + output = &DeleteIAMPolicyAssignmentOutput{} req = c.newRequest(op, input, output) return } -// UpdateUser API operation for Amazon QuickSight. -// -// Updates an Amazon QuickSight user. -// -// The permission resource is arn:aws:quicksight:us-east-1::user/default/ . -// -// The response is a user object that contains the user's Amazon QuickSight -// user name, email address, active or inactive status in Amazon QuickSight, -// Amazon QuickSight role, and Amazon Resource Name (ARN). -// -// CLI Sample: +// DeleteIAMPolicyAssignment API operation for Amazon QuickSight. // -// aws quicksight update-user --user-name=Pat --role=ADMIN --email=new_address@amazon.com -// --aws-account-id=111122223333 --namespace=default --region=us-east-1 +// Deletes an existing IAM policy assignment. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon QuickSight's -// API operation UpdateUser for usage and error information. +// API operation DeleteIAMPolicyAssignment for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" -// You don't have access to this. The provided credentials couldn't be validated. -// You might not be authorized to carry out the request. Ensure that your account -// is authorized to use the Amazon QuickSight service, that your policies have -// the correct permissions, and that you are using the correct access keys. +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. // -// * ErrCodeInvalidParameterValueException "InvalidParameterValueException" -// One or more parameters don't have a valid value. +// * ResourceExistsException +// The resource specified already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // One or more resources can't be found. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // Access is throttled. // -// * ErrCodeInternalFailureException "InternalFailureException" -// An internal failure occurred. +// * ConcurrentUpdatingException +// A resource is already in a state that indicates an action is happening that +// must complete before a new update can be applied. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" -// This resource is currently unavailable. +// * InternalFailureException +// An internal failure occurred. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateUser -func (c *QuickSight) UpdateUser(input *UpdateUserInput) (*UpdateUserOutput, error) { - req, out := c.UpdateUserRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteIAMPolicyAssignment +func (c *QuickSight) DeleteIAMPolicyAssignment(input *DeleteIAMPolicyAssignmentInput) (*DeleteIAMPolicyAssignmentOutput, error) { + req, out := c.DeleteIAMPolicyAssignmentRequest(input) return out, req.Send() } -// UpdateUserWithContext is the same as UpdateUser with the addition of +// DeleteIAMPolicyAssignmentWithContext is the same as DeleteIAMPolicyAssignment with the addition of // the ability to pass a context and additional request options. // -// See UpdateUser for details on how to use this API operation. +// See DeleteIAMPolicyAssignment for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *QuickSight) UpdateUserWithContext(ctx aws.Context, input *UpdateUserInput, opts ...request.Option) (*UpdateUserOutput, error) { - req, out := c.UpdateUserRequest(input) +func (c *QuickSight) DeleteIAMPolicyAssignmentWithContext(ctx aws.Context, input *DeleteIAMPolicyAssignmentInput, opts ...request.Option) (*DeleteIAMPolicyAssignmentOutput, error) { + req, out := c.DeleteIAMPolicyAssignmentRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// The request object for this operation. -type CreateGroupInput struct { - _ struct{} `type:"structure"` - - // The ID for the AWS account that the group is in. Currently, you use the ID - // for the AWS account that contains your Amazon QuickSight account. - // - // AwsAccountId is a required field - AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` +const opDeleteTemplate = "DeleteTemplate" - // A description for the group that you want to create. - Description *string `min:"1" type:"string"` +// DeleteTemplateRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteTemplate for more information on using the DeleteTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteTemplateRequest method. +// req, resp := client.DeleteTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteTemplate +func (c *QuickSight) DeleteTemplateRequest(input *DeleteTemplateInput) (req *request.Request, output *DeleteTemplateOutput) { + op := &request.Operation{ + Name: opDeleteTemplate, + HTTPMethod: "DELETE", + HTTPPath: "/accounts/{AwsAccountId}/templates/{TemplateId}", + } - // A name for the group that you want to create. - // - // GroupName is a required field - GroupName *string `min:"1" type:"string" required:"true"` + if input == nil { + input = &DeleteTemplateInput{} + } - // The namespace. Currently, you should set this to default. - // - // Namespace is a required field - Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + output = &DeleteTemplateOutput{} + req = c.newRequest(op, input, output) + return } -// String returns the string representation -func (s CreateGroupInput) String() string { - return awsutil.Prettify(s) +// DeleteTemplate API operation for Amazon QuickSight. +// +// Deletes a 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 QuickSight's +// API operation DeleteTemplate for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. +// +// * LimitExceededException +// A limit is exceeded. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteTemplate +func (c *QuickSight) DeleteTemplate(input *DeleteTemplateInput) (*DeleteTemplateOutput, error) { + req, out := c.DeleteTemplateRequest(input) + return out, req.Send() } -// GoString returns the string representation -func (s CreateGroupInput) GoString() string { - return s.String() +// DeleteTemplateWithContext is the same as DeleteTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DeleteTemplateWithContext(ctx aws.Context, input *DeleteTemplateInput, opts ...request.Option) (*DeleteTemplateOutput, error) { + req, out := c.DeleteTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -// 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.AwsAccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) - } - if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { - invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - 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.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) - } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) - } +const opDeleteTemplateAlias = "DeleteTemplateAlias" + +// DeleteTemplateAliasRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTemplateAlias operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteTemplateAlias for more information on using the DeleteTemplateAlias +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteTemplateAliasRequest method. +// req, resp := client.DeleteTemplateAliasRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteTemplateAlias +func (c *QuickSight) DeleteTemplateAliasRequest(input *DeleteTemplateAliasInput) (req *request.Request, output *DeleteTemplateAliasOutput) { + op := &request.Operation{ + Name: opDeleteTemplateAlias, + HTTPMethod: "DELETE", + HTTPPath: "/accounts/{AwsAccountId}/templates/{TemplateId}/aliases/{AliasName}", + } + + if input == nil { + input = &DeleteTemplateAliasInput{} + } + + output = &DeleteTemplateAliasOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteTemplateAlias API operation for Amazon QuickSight. +// +// Deletes the item that the specified template alias points to. If you provide +// a specific alias, you delete the version of the template that the alias points +// to. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation DeleteTemplateAlias for usage and error information. +// +// Returned Error Types: +// * ThrottlingException +// Access is throttled. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteTemplateAlias +func (c *QuickSight) DeleteTemplateAlias(input *DeleteTemplateAliasInput) (*DeleteTemplateAliasOutput, error) { + req, out := c.DeleteTemplateAliasRequest(input) + return out, req.Send() +} + +// DeleteTemplateAliasWithContext is the same as DeleteTemplateAlias with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteTemplateAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DeleteTemplateAliasWithContext(ctx aws.Context, input *DeleteTemplateAliasInput, opts ...request.Option) (*DeleteTemplateAliasOutput, error) { + req, out := c.DeleteTemplateAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteUser = "DeleteUser" + +// DeleteUserRequest generates a "aws/request.Request" representing the +// client's request for the DeleteUser operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteUser for more information on using the DeleteUser +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteUserRequest method. +// req, resp := client.DeleteUserRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteUser +func (c *QuickSight) DeleteUserRequest(input *DeleteUserInput) (req *request.Request, output *DeleteUserOutput) { + op := &request.Operation{ + Name: opDeleteUser, + HTTPMethod: "DELETE", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}", + } + + if input == nil { + input = &DeleteUserInput{} + } + + output = &DeleteUserOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteUser API operation for Amazon QuickSight. +// +// Deletes the Amazon QuickSight user that is associated with the identity of +// the AWS Identity and Access Management (IAM) user or role that's making the +// call. The IAM user isn't deleted as a result of this 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 QuickSight's +// API operation DeleteUser for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InternalFailureException +// An internal failure occurred. +// +// * ResourceUnavailableException +// This resource is currently unavailable. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteUser +func (c *QuickSight) DeleteUser(input *DeleteUserInput) (*DeleteUserOutput, error) { + req, out := c.DeleteUserRequest(input) + return out, req.Send() +} + +// DeleteUserWithContext is the same as DeleteUser with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DeleteUserWithContext(ctx aws.Context, input *DeleteUserInput, opts ...request.Option) (*DeleteUserOutput, error) { + req, out := c.DeleteUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteUserByPrincipalId = "DeleteUserByPrincipalId" + +// DeleteUserByPrincipalIdRequest generates a "aws/request.Request" representing the +// client's request for the DeleteUserByPrincipalId operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteUserByPrincipalId for more information on using the DeleteUserByPrincipalId +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteUserByPrincipalIdRequest method. +// req, resp := client.DeleteUserByPrincipalIdRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteUserByPrincipalId +func (c *QuickSight) DeleteUserByPrincipalIdRequest(input *DeleteUserByPrincipalIdInput) (req *request.Request, output *DeleteUserByPrincipalIdOutput) { + op := &request.Operation{ + Name: opDeleteUserByPrincipalId, + HTTPMethod: "DELETE", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/user-principals/{PrincipalId}", + } + + if input == nil { + input = &DeleteUserByPrincipalIdInput{} + } + + output = &DeleteUserByPrincipalIdOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteUserByPrincipalId API operation for Amazon QuickSight. +// +// Deletes a user identified by its principal 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 QuickSight's +// API operation DeleteUserByPrincipalId for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InternalFailureException +// An internal failure occurred. +// +// * ResourceUnavailableException +// This resource is currently unavailable. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DeleteUserByPrincipalId +func (c *QuickSight) DeleteUserByPrincipalId(input *DeleteUserByPrincipalIdInput) (*DeleteUserByPrincipalIdOutput, error) { + req, out := c.DeleteUserByPrincipalIdRequest(input) + return out, req.Send() +} + +// DeleteUserByPrincipalIdWithContext is the same as DeleteUserByPrincipalId with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteUserByPrincipalId for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DeleteUserByPrincipalIdWithContext(ctx aws.Context, input *DeleteUserByPrincipalIdInput, opts ...request.Option) (*DeleteUserByPrincipalIdOutput, error) { + req, out := c.DeleteUserByPrincipalIdRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeDashboard = "DescribeDashboard" + +// DescribeDashboardRequest generates a "aws/request.Request" representing the +// client's request for the DescribeDashboard operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeDashboard for more information on using the DescribeDashboard +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeDashboardRequest method. +// req, resp := client.DescribeDashboardRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeDashboard +func (c *QuickSight) DescribeDashboardRequest(input *DescribeDashboardInput) (req *request.Request, output *DescribeDashboardOutput) { + op := &request.Operation{ + Name: opDescribeDashboard, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/dashboards/{DashboardId}", + } + + if input == nil { + input = &DescribeDashboardInput{} + } + + output = &DescribeDashboardOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeDashboard API operation for Amazon QuickSight. +// +// Provides a summary for a dashboard. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation DescribeDashboard for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * ThrottlingException +// Access is throttled. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeDashboard +func (c *QuickSight) DescribeDashboard(input *DescribeDashboardInput) (*DescribeDashboardOutput, error) { + req, out := c.DescribeDashboardRequest(input) + return out, req.Send() +} + +// DescribeDashboardWithContext is the same as DescribeDashboard with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDashboard for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DescribeDashboardWithContext(ctx aws.Context, input *DescribeDashboardInput, opts ...request.Option) (*DescribeDashboardOutput, error) { + req, out := c.DescribeDashboardRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeDashboardPermissions = "DescribeDashboardPermissions" + +// DescribeDashboardPermissionsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeDashboardPermissions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeDashboardPermissions for more information on using the DescribeDashboardPermissions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeDashboardPermissionsRequest method. +// req, resp := client.DescribeDashboardPermissionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeDashboardPermissions +func (c *QuickSight) DescribeDashboardPermissionsRequest(input *DescribeDashboardPermissionsInput) (req *request.Request, output *DescribeDashboardPermissionsOutput) { + op := &request.Operation{ + Name: opDescribeDashboardPermissions, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/dashboards/{DashboardId}/permissions", + } + + if input == nil { + input = &DescribeDashboardPermissionsInput{} + } + + output = &DescribeDashboardPermissionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeDashboardPermissions API operation for Amazon QuickSight. +// +// Describes read and write permissions for a dashboard. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation DescribeDashboardPermissions for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeDashboardPermissions +func (c *QuickSight) DescribeDashboardPermissions(input *DescribeDashboardPermissionsInput) (*DescribeDashboardPermissionsOutput, error) { + req, out := c.DescribeDashboardPermissionsRequest(input) + return out, req.Send() +} + +// DescribeDashboardPermissionsWithContext is the same as DescribeDashboardPermissions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDashboardPermissions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DescribeDashboardPermissionsWithContext(ctx aws.Context, input *DescribeDashboardPermissionsInput, opts ...request.Option) (*DescribeDashboardPermissionsOutput, error) { + req, out := c.DescribeDashboardPermissionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeDataSet = "DescribeDataSet" + +// DescribeDataSetRequest generates a "aws/request.Request" representing the +// client's request for the DescribeDataSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeDataSet for more information on using the DescribeDataSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeDataSetRequest method. +// req, resp := client.DescribeDataSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeDataSet +func (c *QuickSight) DescribeDataSetRequest(input *DescribeDataSetInput) (req *request.Request, output *DescribeDataSetOutput) { + op := &request.Operation{ + Name: opDescribeDataSet, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/data-sets/{DataSetId}", + } + + if input == nil { + input = &DescribeDataSetInput{} + } + + output = &DescribeDataSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeDataSet API operation for Amazon QuickSight. +// +// Describes a dataset. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation DescribeDataSet for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ThrottlingException +// Access is throttled. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeDataSet +func (c *QuickSight) DescribeDataSet(input *DescribeDataSetInput) (*DescribeDataSetOutput, error) { + req, out := c.DescribeDataSetRequest(input) + return out, req.Send() +} + +// DescribeDataSetWithContext is the same as DescribeDataSet with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDataSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DescribeDataSetWithContext(ctx aws.Context, input *DescribeDataSetInput, opts ...request.Option) (*DescribeDataSetOutput, error) { + req, out := c.DescribeDataSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeDataSetPermissions = "DescribeDataSetPermissions" + +// DescribeDataSetPermissionsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeDataSetPermissions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeDataSetPermissions for more information on using the DescribeDataSetPermissions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeDataSetPermissionsRequest method. +// req, resp := client.DescribeDataSetPermissionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeDataSetPermissions +func (c *QuickSight) DescribeDataSetPermissionsRequest(input *DescribeDataSetPermissionsInput) (req *request.Request, output *DescribeDataSetPermissionsOutput) { + op := &request.Operation{ + Name: opDescribeDataSetPermissions, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/data-sets/{DataSetId}/permissions", + } + + if input == nil { + input = &DescribeDataSetPermissionsInput{} + } + + output = &DescribeDataSetPermissionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeDataSetPermissions API operation for Amazon QuickSight. +// +// Describes the permissions on a dataset. +// +// The permissions resource is arn:aws:quicksight:region:aws-account-id:dataset/data-set-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 QuickSight's +// API operation DescribeDataSetPermissions for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ThrottlingException +// Access is throttled. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeDataSetPermissions +func (c *QuickSight) DescribeDataSetPermissions(input *DescribeDataSetPermissionsInput) (*DescribeDataSetPermissionsOutput, error) { + req, out := c.DescribeDataSetPermissionsRequest(input) + return out, req.Send() +} + +// DescribeDataSetPermissionsWithContext is the same as DescribeDataSetPermissions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDataSetPermissions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DescribeDataSetPermissionsWithContext(ctx aws.Context, input *DescribeDataSetPermissionsInput, opts ...request.Option) (*DescribeDataSetPermissionsOutput, error) { + req, out := c.DescribeDataSetPermissionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeDataSource = "DescribeDataSource" + +// DescribeDataSourceRequest generates a "aws/request.Request" representing the +// client's request for the DescribeDataSource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeDataSource for more information on using the DescribeDataSource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeDataSourceRequest method. +// req, resp := client.DescribeDataSourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeDataSource +func (c *QuickSight) DescribeDataSourceRequest(input *DescribeDataSourceInput) (req *request.Request, output *DescribeDataSourceOutput) { + op := &request.Operation{ + Name: opDescribeDataSource, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/data-sources/{DataSourceId}", + } + + if input == nil { + input = &DescribeDataSourceInput{} + } + + output = &DescribeDataSourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeDataSource API operation for Amazon QuickSight. +// +// Describes a data source. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation DescribeDataSource for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ThrottlingException +// Access is throttled. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeDataSource +func (c *QuickSight) DescribeDataSource(input *DescribeDataSourceInput) (*DescribeDataSourceOutput, error) { + req, out := c.DescribeDataSourceRequest(input) + return out, req.Send() +} + +// DescribeDataSourceWithContext is the same as DescribeDataSource with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDataSource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DescribeDataSourceWithContext(ctx aws.Context, input *DescribeDataSourceInput, opts ...request.Option) (*DescribeDataSourceOutput, error) { + req, out := c.DescribeDataSourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeDataSourcePermissions = "DescribeDataSourcePermissions" + +// DescribeDataSourcePermissionsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeDataSourcePermissions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeDataSourcePermissions for more information on using the DescribeDataSourcePermissions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeDataSourcePermissionsRequest method. +// req, resp := client.DescribeDataSourcePermissionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeDataSourcePermissions +func (c *QuickSight) DescribeDataSourcePermissionsRequest(input *DescribeDataSourcePermissionsInput) (req *request.Request, output *DescribeDataSourcePermissionsOutput) { + op := &request.Operation{ + Name: opDescribeDataSourcePermissions, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/data-sources/{DataSourceId}/permissions", + } + + if input == nil { + input = &DescribeDataSourcePermissionsInput{} + } + + output = &DescribeDataSourcePermissionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeDataSourcePermissions API operation for Amazon QuickSight. +// +// Describes the resource permissions for a data source. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation DescribeDataSourcePermissions for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ThrottlingException +// Access is throttled. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeDataSourcePermissions +func (c *QuickSight) DescribeDataSourcePermissions(input *DescribeDataSourcePermissionsInput) (*DescribeDataSourcePermissionsOutput, error) { + req, out := c.DescribeDataSourcePermissionsRequest(input) + return out, req.Send() +} + +// DescribeDataSourcePermissionsWithContext is the same as DescribeDataSourcePermissions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDataSourcePermissions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DescribeDataSourcePermissionsWithContext(ctx aws.Context, input *DescribeDataSourcePermissionsInput, opts ...request.Option) (*DescribeDataSourcePermissionsOutput, error) { + req, out := c.DescribeDataSourcePermissionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeGroup = "DescribeGroup" + +// DescribeGroupRequest generates a "aws/request.Request" representing the +// client's request for the DescribeGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeGroup for more information on using the DescribeGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeGroupRequest method. +// req, resp := client.DescribeGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeGroup +func (c *QuickSight) DescribeGroupRequest(input *DescribeGroupInput) (req *request.Request, output *DescribeGroupOutput) { + op := &request.Operation{ + Name: opDescribeGroup, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}", + } + + if input == nil { + input = &DescribeGroupInput{} + } + + output = &DescribeGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeGroup API operation for Amazon QuickSight. +// +// Returns an Amazon QuickSight group's description and Amazon Resource Name +// (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 QuickSight's +// API operation DescribeGroup for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * PreconditionNotMetException +// One or more preconditions aren't met. +// +// * InternalFailureException +// An internal failure occurred. +// +// * ResourceUnavailableException +// This resource is currently unavailable. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeGroup +func (c *QuickSight) DescribeGroup(input *DescribeGroupInput) (*DescribeGroupOutput, error) { + req, out := c.DescribeGroupRequest(input) + return out, req.Send() +} + +// DescribeGroupWithContext is the same as DescribeGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DescribeGroupWithContext(ctx aws.Context, input *DescribeGroupInput, opts ...request.Option) (*DescribeGroupOutput, error) { + req, out := c.DescribeGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeIAMPolicyAssignment = "DescribeIAMPolicyAssignment" + +// DescribeIAMPolicyAssignmentRequest generates a "aws/request.Request" representing the +// client's request for the DescribeIAMPolicyAssignment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeIAMPolicyAssignment for more information on using the DescribeIAMPolicyAssignment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeIAMPolicyAssignmentRequest method. +// req, resp := client.DescribeIAMPolicyAssignmentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeIAMPolicyAssignment +func (c *QuickSight) DescribeIAMPolicyAssignmentRequest(input *DescribeIAMPolicyAssignmentInput) (req *request.Request, output *DescribeIAMPolicyAssignmentOutput) { + op := &request.Operation{ + Name: opDescribeIAMPolicyAssignment, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/iam-policy-assignments/{AssignmentName}", + } + + if input == nil { + input = &DescribeIAMPolicyAssignmentInput{} + } + + output = &DescribeIAMPolicyAssignmentOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeIAMPolicyAssignment API operation for Amazon QuickSight. +// +// Describes an existing IAM policy assignment, as specified by the assignment +// 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 QuickSight's +// API operation DescribeIAMPolicyAssignment for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InvalidNextTokenException +// The NextToken value isn't valid. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeIAMPolicyAssignment +func (c *QuickSight) DescribeIAMPolicyAssignment(input *DescribeIAMPolicyAssignmentInput) (*DescribeIAMPolicyAssignmentOutput, error) { + req, out := c.DescribeIAMPolicyAssignmentRequest(input) + return out, req.Send() +} + +// DescribeIAMPolicyAssignmentWithContext is the same as DescribeIAMPolicyAssignment with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeIAMPolicyAssignment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DescribeIAMPolicyAssignmentWithContext(ctx aws.Context, input *DescribeIAMPolicyAssignmentInput, opts ...request.Option) (*DescribeIAMPolicyAssignmentOutput, error) { + req, out := c.DescribeIAMPolicyAssignmentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeIngestion = "DescribeIngestion" + +// DescribeIngestionRequest generates a "aws/request.Request" representing the +// client's request for the DescribeIngestion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeIngestion for more information on using the DescribeIngestion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeIngestionRequest method. +// req, resp := client.DescribeIngestionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeIngestion +func (c *QuickSight) DescribeIngestionRequest(input *DescribeIngestionInput) (req *request.Request, output *DescribeIngestionOutput) { + op := &request.Operation{ + Name: opDescribeIngestion, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/data-sets/{DataSetId}/ingestions/{IngestionId}", + } + + if input == nil { + input = &DescribeIngestionInput{} + } + + output = &DescribeIngestionOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeIngestion API operation for Amazon QuickSight. +// +// Describes a SPICE ingestion. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation DescribeIngestion for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * ResourceExistsException +// The resource specified already exists. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeIngestion +func (c *QuickSight) DescribeIngestion(input *DescribeIngestionInput) (*DescribeIngestionOutput, error) { + req, out := c.DescribeIngestionRequest(input) + return out, req.Send() +} + +// DescribeIngestionWithContext is the same as DescribeIngestion with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeIngestion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DescribeIngestionWithContext(ctx aws.Context, input *DescribeIngestionInput, opts ...request.Option) (*DescribeIngestionOutput, error) { + req, out := c.DescribeIngestionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeTemplate = "DescribeTemplate" + +// DescribeTemplateRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeTemplate for more information on using the DescribeTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeTemplateRequest method. +// req, resp := client.DescribeTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeTemplate +func (c *QuickSight) DescribeTemplateRequest(input *DescribeTemplateInput) (req *request.Request, output *DescribeTemplateOutput) { + op := &request.Operation{ + Name: opDescribeTemplate, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/templates/{TemplateId}", + } + + if input == nil { + input = &DescribeTemplateInput{} + } + + output = &DescribeTemplateOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeTemplate API operation for Amazon QuickSight. +// +// Describes a template's metadata. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation DescribeTemplate for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * ResourceExistsException +// The resource specified already exists. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeTemplate +func (c *QuickSight) DescribeTemplate(input *DescribeTemplateInput) (*DescribeTemplateOutput, error) { + req, out := c.DescribeTemplateRequest(input) + return out, req.Send() +} + +// DescribeTemplateWithContext is the same as DescribeTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DescribeTemplateWithContext(ctx aws.Context, input *DescribeTemplateInput, opts ...request.Option) (*DescribeTemplateOutput, error) { + req, out := c.DescribeTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeTemplateAlias = "DescribeTemplateAlias" + +// DescribeTemplateAliasRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTemplateAlias operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeTemplateAlias for more information on using the DescribeTemplateAlias +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeTemplateAliasRequest method. +// req, resp := client.DescribeTemplateAliasRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeTemplateAlias +func (c *QuickSight) DescribeTemplateAliasRequest(input *DescribeTemplateAliasInput) (req *request.Request, output *DescribeTemplateAliasOutput) { + op := &request.Operation{ + Name: opDescribeTemplateAlias, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/templates/{TemplateId}/aliases/{AliasName}", + } + + if input == nil { + input = &DescribeTemplateAliasInput{} + } + + output = &DescribeTemplateAliasOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeTemplateAlias API operation for Amazon QuickSight. +// +// Describes the template alias for a 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 QuickSight's +// API operation DescribeTemplateAlias for usage and error information. +// +// Returned Error Types: +// * ThrottlingException +// Access is throttled. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeTemplateAlias +func (c *QuickSight) DescribeTemplateAlias(input *DescribeTemplateAliasInput) (*DescribeTemplateAliasOutput, error) { + req, out := c.DescribeTemplateAliasRequest(input) + return out, req.Send() +} + +// DescribeTemplateAliasWithContext is the same as DescribeTemplateAlias with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTemplateAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DescribeTemplateAliasWithContext(ctx aws.Context, input *DescribeTemplateAliasInput, opts ...request.Option) (*DescribeTemplateAliasOutput, error) { + req, out := c.DescribeTemplateAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeTemplatePermissions = "DescribeTemplatePermissions" + +// DescribeTemplatePermissionsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTemplatePermissions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeTemplatePermissions for more information on using the DescribeTemplatePermissions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeTemplatePermissionsRequest method. +// req, resp := client.DescribeTemplatePermissionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeTemplatePermissions +func (c *QuickSight) DescribeTemplatePermissionsRequest(input *DescribeTemplatePermissionsInput) (req *request.Request, output *DescribeTemplatePermissionsOutput) { + op := &request.Operation{ + Name: opDescribeTemplatePermissions, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/templates/{TemplateId}/permissions", + } + + if input == nil { + input = &DescribeTemplatePermissionsInput{} + } + + output = &DescribeTemplatePermissionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeTemplatePermissions API operation for Amazon QuickSight. +// +// Describes read and write permissions on a 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 QuickSight's +// API operation DescribeTemplatePermissions for usage and error information. +// +// Returned Error Types: +// * ThrottlingException +// Access is throttled. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeTemplatePermissions +func (c *QuickSight) DescribeTemplatePermissions(input *DescribeTemplatePermissionsInput) (*DescribeTemplatePermissionsOutput, error) { + req, out := c.DescribeTemplatePermissionsRequest(input) + return out, req.Send() +} + +// DescribeTemplatePermissionsWithContext is the same as DescribeTemplatePermissions with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTemplatePermissions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DescribeTemplatePermissionsWithContext(ctx aws.Context, input *DescribeTemplatePermissionsInput, opts ...request.Option) (*DescribeTemplatePermissionsOutput, error) { + req, out := c.DescribeTemplatePermissionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeUser = "DescribeUser" + +// DescribeUserRequest generates a "aws/request.Request" representing the +// client's request for the DescribeUser operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeUser for more information on using the DescribeUser +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeUserRequest method. +// req, resp := client.DescribeUserRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeUser +func (c *QuickSight) DescribeUserRequest(input *DescribeUserInput) (req *request.Request, output *DescribeUserOutput) { + op := &request.Operation{ + Name: opDescribeUser, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}", + } + + if input == nil { + input = &DescribeUserInput{} + } + + output = &DescribeUserOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeUser API operation for Amazon QuickSight. +// +// Returns information about a user, given the user 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 QuickSight's +// API operation DescribeUser for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InternalFailureException +// An internal failure occurred. +// +// * ResourceUnavailableException +// This resource is currently unavailable. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/DescribeUser +func (c *QuickSight) DescribeUser(input *DescribeUserInput) (*DescribeUserOutput, error) { + req, out := c.DescribeUserRequest(input) + return out, req.Send() +} + +// DescribeUserWithContext is the same as DescribeUser with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) DescribeUserWithContext(ctx aws.Context, input *DescribeUserInput, opts ...request.Option) (*DescribeUserOutput, error) { + req, out := c.DescribeUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetDashboardEmbedUrl = "GetDashboardEmbedUrl" + +// GetDashboardEmbedUrlRequest generates a "aws/request.Request" representing the +// client's request for the GetDashboardEmbedUrl operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetDashboardEmbedUrl for more information on using the GetDashboardEmbedUrl +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetDashboardEmbedUrlRequest method. +// req, resp := client.GetDashboardEmbedUrlRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/GetDashboardEmbedUrl +func (c *QuickSight) GetDashboardEmbedUrlRequest(input *GetDashboardEmbedUrlInput) (req *request.Request, output *GetDashboardEmbedUrlOutput) { + op := &request.Operation{ + Name: opGetDashboardEmbedUrl, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/dashboards/{DashboardId}/embed-url", + } + + if input == nil { + input = &GetDashboardEmbedUrlInput{} + } + + output = &GetDashboardEmbedUrlOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetDashboardEmbedUrl API operation for Amazon QuickSight. +// +// Generates a server-side embeddable URL and authorization code. For this process +// to work properly, first configure the dashboards and user permissions. For +// more information, see Embedding Amazon QuickSight Dashboards (https://docs.aws.amazon.com/quicksight/latest/user/embedding-dashboards.html) +// in the Amazon QuickSight User Guide or Embedding Amazon QuickSight Dashboards +// (https://docs.aws.amazon.com/quicksight/latest/APIReference/qs-dev-embedded-dashboards.html) +// in the Amazon QuickSight API Reference. +// +// Currently, you can use GetDashboardEmbedURL only from the server, not from +// the user’s browser. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation GetDashboardEmbedUrl for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceExistsException +// The resource specified already exists. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * DomainNotWhitelistedException +// The domain specified isn't on the allow list. All domains for embedded dashboards +// must be added to the approved list by an Amazon QuickSight admin. +// +// * UserNotFoundException +// The user with the provided name isn't found. This error can happen in any +// operation that requires finding a user based on a provided user name, such +// as DeleteUser, DescribeUser, and so on. +// +// * IdentityTypeNotSupportedException +// The identity type specified isn't supported. Supported identity types include +// IAM and QUICKSIGHT. +// +// * SessionLifetimeInMinutesInvalidException +// The number of minutes specified for the lifetime of a session isn't valid. +// The session lifetime must be 15-600 minutes. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/GetDashboardEmbedUrl +func (c *QuickSight) GetDashboardEmbedUrl(input *GetDashboardEmbedUrlInput) (*GetDashboardEmbedUrlOutput, error) { + req, out := c.GetDashboardEmbedUrlRequest(input) + return out, req.Send() +} + +// GetDashboardEmbedUrlWithContext is the same as GetDashboardEmbedUrl with the addition of +// the ability to pass a context and additional request options. +// +// See GetDashboardEmbedUrl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) GetDashboardEmbedUrlWithContext(ctx aws.Context, input *GetDashboardEmbedUrlInput, opts ...request.Option) (*GetDashboardEmbedUrlOutput, error) { + req, out := c.GetDashboardEmbedUrlRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListDashboardVersions = "ListDashboardVersions" + +// ListDashboardVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListDashboardVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListDashboardVersions for more information on using the ListDashboardVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListDashboardVersionsRequest method. +// req, resp := client.ListDashboardVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListDashboardVersions +func (c *QuickSight) ListDashboardVersionsRequest(input *ListDashboardVersionsInput) (req *request.Request, output *ListDashboardVersionsOutput) { + op := &request.Operation{ + Name: opListDashboardVersions, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/dashboards/{DashboardId}/versions", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListDashboardVersionsInput{} + } + + output = &ListDashboardVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListDashboardVersions API operation for Amazon QuickSight. +// +// Lists all the versions of the dashboards in the QuickSight 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 QuickSight's +// API operation ListDashboardVersions for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InvalidNextTokenException +// The NextToken value isn't valid. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListDashboardVersions +func (c *QuickSight) ListDashboardVersions(input *ListDashboardVersionsInput) (*ListDashboardVersionsOutput, error) { + req, out := c.ListDashboardVersionsRequest(input) + return out, req.Send() +} + +// ListDashboardVersionsWithContext is the same as ListDashboardVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListDashboardVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) ListDashboardVersionsWithContext(ctx aws.Context, input *ListDashboardVersionsInput, opts ...request.Option) (*ListDashboardVersionsOutput, error) { + req, out := c.ListDashboardVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListDashboardVersionsPages iterates over the pages of a ListDashboardVersions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListDashboardVersions 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 ListDashboardVersions operation. +// pageNum := 0 +// err := client.ListDashboardVersionsPages(params, +// func(page *quicksight.ListDashboardVersionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *QuickSight) ListDashboardVersionsPages(input *ListDashboardVersionsInput, fn func(*ListDashboardVersionsOutput, bool) bool) error { + return c.ListDashboardVersionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListDashboardVersionsPagesWithContext same as ListDashboardVersionsPages 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 *QuickSight) ListDashboardVersionsPagesWithContext(ctx aws.Context, input *ListDashboardVersionsInput, fn func(*ListDashboardVersionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDashboardVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDashboardVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListDashboardVersionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListDashboards = "ListDashboards" + +// ListDashboardsRequest generates a "aws/request.Request" representing the +// client's request for the ListDashboards operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListDashboards for more information on using the ListDashboards +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListDashboardsRequest method. +// req, resp := client.ListDashboardsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListDashboards +func (c *QuickSight) ListDashboardsRequest(input *ListDashboardsInput) (req *request.Request, output *ListDashboardsOutput) { + op := &request.Operation{ + Name: opListDashboards, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/dashboards", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListDashboardsInput{} + } + + output = &ListDashboardsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListDashboards API operation for Amazon QuickSight. +// +// Lists dashboards 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 QuickSight's +// API operation ListDashboards for usage and error information. +// +// Returned Error Types: +// * ThrottlingException +// Access is throttled. +// +// * InvalidNextTokenException +// The NextToken value isn't valid. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListDashboards +func (c *QuickSight) ListDashboards(input *ListDashboardsInput) (*ListDashboardsOutput, error) { + req, out := c.ListDashboardsRequest(input) + return out, req.Send() +} + +// ListDashboardsWithContext is the same as ListDashboards with the addition of +// the ability to pass a context and additional request options. +// +// See ListDashboards for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) ListDashboardsWithContext(ctx aws.Context, input *ListDashboardsInput, opts ...request.Option) (*ListDashboardsOutput, error) { + req, out := c.ListDashboardsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListDashboardsPages iterates over the pages of a ListDashboards operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListDashboards 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 ListDashboards operation. +// pageNum := 0 +// err := client.ListDashboardsPages(params, +// func(page *quicksight.ListDashboardsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *QuickSight) ListDashboardsPages(input *ListDashboardsInput, fn func(*ListDashboardsOutput, bool) bool) error { + return c.ListDashboardsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListDashboardsPagesWithContext same as ListDashboardsPages 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 *QuickSight) ListDashboardsPagesWithContext(ctx aws.Context, input *ListDashboardsInput, fn func(*ListDashboardsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDashboardsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDashboardsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListDashboardsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListDataSets = "ListDataSets" + +// ListDataSetsRequest generates a "aws/request.Request" representing the +// client's request for the ListDataSets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListDataSets for more information on using the ListDataSets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListDataSetsRequest method. +// req, resp := client.ListDataSetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListDataSets +func (c *QuickSight) ListDataSetsRequest(input *ListDataSetsInput) (req *request.Request, output *ListDataSetsOutput) { + op := &request.Operation{ + Name: opListDataSets, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/data-sets", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListDataSetsInput{} + } + + output = &ListDataSetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListDataSets API operation for Amazon QuickSight. +// +// Lists all of the datasets belonging to the current AWS account in an AWS +// Region. +// +// The permissions resource is arn:aws:quicksight:region:aws-account-id:dataset/*. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation ListDataSets for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ThrottlingException +// Access is throttled. +// +// * InvalidNextTokenException +// The NextToken value isn't valid. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListDataSets +func (c *QuickSight) ListDataSets(input *ListDataSetsInput) (*ListDataSetsOutput, error) { + req, out := c.ListDataSetsRequest(input) + return out, req.Send() +} + +// ListDataSetsWithContext is the same as ListDataSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListDataSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) ListDataSetsWithContext(ctx aws.Context, input *ListDataSetsInput, opts ...request.Option) (*ListDataSetsOutput, error) { + req, out := c.ListDataSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListDataSetsPages iterates over the pages of a ListDataSets operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListDataSets 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 ListDataSets operation. +// pageNum := 0 +// err := client.ListDataSetsPages(params, +// func(page *quicksight.ListDataSetsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *QuickSight) ListDataSetsPages(input *ListDataSetsInput, fn func(*ListDataSetsOutput, bool) bool) error { + return c.ListDataSetsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListDataSetsPagesWithContext same as ListDataSetsPages 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 *QuickSight) ListDataSetsPagesWithContext(ctx aws.Context, input *ListDataSetsInput, fn func(*ListDataSetsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDataSetsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDataSetsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListDataSetsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListDataSources = "ListDataSources" + +// ListDataSourcesRequest generates a "aws/request.Request" representing the +// client's request for the ListDataSources operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListDataSources for more information on using the ListDataSources +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListDataSourcesRequest method. +// req, resp := client.ListDataSourcesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListDataSources +func (c *QuickSight) ListDataSourcesRequest(input *ListDataSourcesInput) (req *request.Request, output *ListDataSourcesOutput) { + op := &request.Operation{ + Name: opListDataSources, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/data-sources", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListDataSourcesInput{} + } + + output = &ListDataSourcesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListDataSources API operation for Amazon QuickSight. +// +// Lists data sources in current AWS Region that belong to 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 QuickSight's +// API operation ListDataSources for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ThrottlingException +// Access is throttled. +// +// * InvalidNextTokenException +// The NextToken value isn't valid. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListDataSources +func (c *QuickSight) ListDataSources(input *ListDataSourcesInput) (*ListDataSourcesOutput, error) { + req, out := c.ListDataSourcesRequest(input) + return out, req.Send() +} + +// ListDataSourcesWithContext is the same as ListDataSources with the addition of +// the ability to pass a context and additional request options. +// +// See ListDataSources for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) ListDataSourcesWithContext(ctx aws.Context, input *ListDataSourcesInput, opts ...request.Option) (*ListDataSourcesOutput, error) { + req, out := c.ListDataSourcesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListDataSourcesPages iterates over the pages of a ListDataSources operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListDataSources 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 ListDataSources operation. +// pageNum := 0 +// err := client.ListDataSourcesPages(params, +// func(page *quicksight.ListDataSourcesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *QuickSight) ListDataSourcesPages(input *ListDataSourcesInput, fn func(*ListDataSourcesOutput, bool) bool) error { + return c.ListDataSourcesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListDataSourcesPagesWithContext same as ListDataSourcesPages 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 *QuickSight) ListDataSourcesPagesWithContext(ctx aws.Context, input *ListDataSourcesInput, fn func(*ListDataSourcesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDataSourcesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDataSourcesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListDataSourcesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListGroupMemberships = "ListGroupMemberships" + +// ListGroupMembershipsRequest generates a "aws/request.Request" representing the +// client's request for the ListGroupMemberships operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListGroupMemberships for more information on using the ListGroupMemberships +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListGroupMembershipsRequest method. +// req, resp := client.ListGroupMembershipsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListGroupMemberships +func (c *QuickSight) ListGroupMembershipsRequest(input *ListGroupMembershipsInput) (req *request.Request, output *ListGroupMembershipsOutput) { + op := &request.Operation{ + Name: opListGroupMemberships, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}/members", + } + + if input == nil { + input = &ListGroupMembershipsInput{} + } + + output = &ListGroupMembershipsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListGroupMemberships API operation for Amazon QuickSight. +// +// Lists member users in a 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 QuickSight's +// API operation ListGroupMemberships for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InvalidNextTokenException +// The NextToken value isn't valid. +// +// * PreconditionNotMetException +// One or more preconditions aren't met. +// +// * InternalFailureException +// An internal failure occurred. +// +// * ResourceUnavailableException +// This resource is currently unavailable. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListGroupMemberships +func (c *QuickSight) ListGroupMemberships(input *ListGroupMembershipsInput) (*ListGroupMembershipsOutput, error) { + req, out := c.ListGroupMembershipsRequest(input) + return out, req.Send() +} + +// ListGroupMembershipsWithContext is the same as ListGroupMemberships with the addition of +// the ability to pass a context and additional request options. +// +// See ListGroupMemberships for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) ListGroupMembershipsWithContext(ctx aws.Context, input *ListGroupMembershipsInput, opts ...request.Option) (*ListGroupMembershipsOutput, error) { + req, out := c.ListGroupMembershipsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListGroups = "ListGroups" + +// ListGroupsRequest generates a "aws/request.Request" representing the +// client's request for the ListGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListGroups for more information on using the ListGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListGroupsRequest method. +// req, resp := client.ListGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListGroups +func (c *QuickSight) ListGroupsRequest(input *ListGroupsInput) (req *request.Request, output *ListGroupsOutput) { + op := &request.Operation{ + Name: opListGroups, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups", + } + + if input == nil { + input = &ListGroupsInput{} + } + + output = &ListGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListGroups API operation for Amazon QuickSight. +// +// Lists all user groups in Amazon QuickSight. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation ListGroups for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InvalidNextTokenException +// The NextToken value isn't valid. +// +// * PreconditionNotMetException +// One or more preconditions aren't met. +// +// * InternalFailureException +// An internal failure occurred. +// +// * ResourceUnavailableException +// This resource is currently unavailable. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListGroups +func (c *QuickSight) ListGroups(input *ListGroupsInput) (*ListGroupsOutput, error) { + req, out := c.ListGroupsRequest(input) + return out, req.Send() +} + +// ListGroupsWithContext is the same as ListGroups with the addition of +// the ability to pass a context and additional request options. +// +// See ListGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) ListGroupsWithContext(ctx aws.Context, input *ListGroupsInput, opts ...request.Option) (*ListGroupsOutput, error) { + req, out := c.ListGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListIAMPolicyAssignments = "ListIAMPolicyAssignments" + +// ListIAMPolicyAssignmentsRequest generates a "aws/request.Request" representing the +// client's request for the ListIAMPolicyAssignments operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListIAMPolicyAssignments for more information on using the ListIAMPolicyAssignments +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListIAMPolicyAssignmentsRequest method. +// req, resp := client.ListIAMPolicyAssignmentsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListIAMPolicyAssignments +func (c *QuickSight) ListIAMPolicyAssignmentsRequest(input *ListIAMPolicyAssignmentsInput) (req *request.Request, output *ListIAMPolicyAssignmentsOutput) { + op := &request.Operation{ + Name: opListIAMPolicyAssignments, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/iam-policy-assignments", + } + + if input == nil { + input = &ListIAMPolicyAssignmentsInput{} + } + + output = &ListIAMPolicyAssignmentsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListIAMPolicyAssignments API operation for Amazon QuickSight. +// +// Lists IAM policy assignments in the current Amazon QuickSight 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 QuickSight's +// API operation ListIAMPolicyAssignments for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InvalidNextTokenException +// The NextToken value isn't valid. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListIAMPolicyAssignments +func (c *QuickSight) ListIAMPolicyAssignments(input *ListIAMPolicyAssignmentsInput) (*ListIAMPolicyAssignmentsOutput, error) { + req, out := c.ListIAMPolicyAssignmentsRequest(input) + return out, req.Send() +} + +// ListIAMPolicyAssignmentsWithContext is the same as ListIAMPolicyAssignments with the addition of +// the ability to pass a context and additional request options. +// +// See ListIAMPolicyAssignments for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) ListIAMPolicyAssignmentsWithContext(ctx aws.Context, input *ListIAMPolicyAssignmentsInput, opts ...request.Option) (*ListIAMPolicyAssignmentsOutput, error) { + req, out := c.ListIAMPolicyAssignmentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListIAMPolicyAssignmentsForUser = "ListIAMPolicyAssignmentsForUser" + +// ListIAMPolicyAssignmentsForUserRequest generates a "aws/request.Request" representing the +// client's request for the ListIAMPolicyAssignmentsForUser operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListIAMPolicyAssignmentsForUser for more information on using the ListIAMPolicyAssignmentsForUser +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListIAMPolicyAssignmentsForUserRequest method. +// req, resp := client.ListIAMPolicyAssignmentsForUserRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListIAMPolicyAssignmentsForUser +func (c *QuickSight) ListIAMPolicyAssignmentsForUserRequest(input *ListIAMPolicyAssignmentsForUserInput) (req *request.Request, output *ListIAMPolicyAssignmentsForUserOutput) { + op := &request.Operation{ + Name: opListIAMPolicyAssignmentsForUser, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}/iam-policy-assignments", + } + + if input == nil { + input = &ListIAMPolicyAssignmentsForUserInput{} + } + + output = &ListIAMPolicyAssignmentsForUserOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListIAMPolicyAssignmentsForUser API operation for Amazon QuickSight. +// +// Lists all the IAM policy assignments, including the Amazon Resource Names +// (ARNs) for the IAM policies assigned to the specified user and group or groups +// that the user belongs to. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation ListIAMPolicyAssignmentsForUser for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceExistsException +// The resource specified already exists. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * ConcurrentUpdatingException +// A resource is already in a state that indicates an action is happening that +// must complete before a new update can be applied. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListIAMPolicyAssignmentsForUser +func (c *QuickSight) ListIAMPolicyAssignmentsForUser(input *ListIAMPolicyAssignmentsForUserInput) (*ListIAMPolicyAssignmentsForUserOutput, error) { + req, out := c.ListIAMPolicyAssignmentsForUserRequest(input) + return out, req.Send() +} + +// ListIAMPolicyAssignmentsForUserWithContext is the same as ListIAMPolicyAssignmentsForUser with the addition of +// the ability to pass a context and additional request options. +// +// See ListIAMPolicyAssignmentsForUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) ListIAMPolicyAssignmentsForUserWithContext(ctx aws.Context, input *ListIAMPolicyAssignmentsForUserInput, opts ...request.Option) (*ListIAMPolicyAssignmentsForUserOutput, error) { + req, out := c.ListIAMPolicyAssignmentsForUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListIngestions = "ListIngestions" + +// ListIngestionsRequest generates a "aws/request.Request" representing the +// client's request for the ListIngestions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListIngestions for more information on using the ListIngestions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListIngestionsRequest method. +// req, resp := client.ListIngestionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListIngestions +func (c *QuickSight) ListIngestionsRequest(input *ListIngestionsInput) (req *request.Request, output *ListIngestionsOutput) { + op := &request.Operation{ + Name: opListIngestions, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/data-sets/{DataSetId}/ingestions", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListIngestionsInput{} + } + + output = &ListIngestionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListIngestions API operation for Amazon QuickSight. +// +// Lists the history of SPICE ingestions for a dataset. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation ListIngestions for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * ResourceExistsException +// The resource specified already exists. +// +// * InvalidNextTokenException +// The NextToken value isn't valid. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListIngestions +func (c *QuickSight) ListIngestions(input *ListIngestionsInput) (*ListIngestionsOutput, error) { + req, out := c.ListIngestionsRequest(input) + return out, req.Send() +} + +// ListIngestionsWithContext is the same as ListIngestions with the addition of +// the ability to pass a context and additional request options. +// +// See ListIngestions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) ListIngestionsWithContext(ctx aws.Context, input *ListIngestionsInput, opts ...request.Option) (*ListIngestionsOutput, error) { + req, out := c.ListIngestionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListIngestionsPages iterates over the pages of a ListIngestions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListIngestions 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 ListIngestions operation. +// pageNum := 0 +// err := client.ListIngestionsPages(params, +// func(page *quicksight.ListIngestionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *QuickSight) ListIngestionsPages(input *ListIngestionsInput, fn func(*ListIngestionsOutput, bool) bool) error { + return c.ListIngestionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListIngestionsPagesWithContext same as ListIngestionsPages 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 *QuickSight) ListIngestionsPagesWithContext(ctx aws.Context, input *ListIngestionsInput, fn func(*ListIngestionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListIngestionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListIngestionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListIngestionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListTagsForResource +func (c *QuickSight) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { + op := &request.Operation{ + Name: opListTagsForResource, + HTTPMethod: "GET", + HTTPPath: "/resources/{ResourceArn}/tags", + } + + if input == nil { + input = &ListTagsForResourceInput{} + } + + output = &ListTagsForResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTagsForResource API operation for Amazon QuickSight. +// +// Lists the tags assigned to 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 QuickSight's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListTagsForResource +func (c *QuickSight) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListTemplateAliases = "ListTemplateAliases" + +// ListTemplateAliasesRequest generates a "aws/request.Request" representing the +// client's request for the ListTemplateAliases operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTemplateAliases for more information on using the ListTemplateAliases +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTemplateAliasesRequest method. +// req, resp := client.ListTemplateAliasesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListTemplateAliases +func (c *QuickSight) ListTemplateAliasesRequest(input *ListTemplateAliasesInput) (req *request.Request, output *ListTemplateAliasesOutput) { + op := &request.Operation{ + Name: opListTemplateAliases, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/templates/{TemplateId}/aliases", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListTemplateAliasesInput{} + } + + output = &ListTemplateAliasesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTemplateAliases API operation for Amazon QuickSight. +// +// Lists all the aliases of a 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 QuickSight's +// API operation ListTemplateAliases for usage and error information. +// +// Returned Error Types: +// * ThrottlingException +// Access is throttled. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListTemplateAliases +func (c *QuickSight) ListTemplateAliases(input *ListTemplateAliasesInput) (*ListTemplateAliasesOutput, error) { + req, out := c.ListTemplateAliasesRequest(input) + return out, req.Send() +} + +// ListTemplateAliasesWithContext is the same as ListTemplateAliases with the addition of +// the ability to pass a context and additional request options. +// +// See ListTemplateAliases for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) ListTemplateAliasesWithContext(ctx aws.Context, input *ListTemplateAliasesInput, opts ...request.Option) (*ListTemplateAliasesOutput, error) { + req, out := c.ListTemplateAliasesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListTemplateAliasesPages iterates over the pages of a ListTemplateAliases operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTemplateAliases 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 ListTemplateAliases operation. +// pageNum := 0 +// err := client.ListTemplateAliasesPages(params, +// func(page *quicksight.ListTemplateAliasesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *QuickSight) ListTemplateAliasesPages(input *ListTemplateAliasesInput, fn func(*ListTemplateAliasesOutput, bool) bool) error { + return c.ListTemplateAliasesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListTemplateAliasesPagesWithContext same as ListTemplateAliasesPages 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 *QuickSight) ListTemplateAliasesPagesWithContext(ctx aws.Context, input *ListTemplateAliasesInput, fn func(*ListTemplateAliasesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTemplateAliasesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTemplateAliasesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTemplateAliasesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTemplateVersions = "ListTemplateVersions" + +// ListTemplateVersionsRequest generates a "aws/request.Request" representing the +// client's request for the ListTemplateVersions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTemplateVersions for more information on using the ListTemplateVersions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTemplateVersionsRequest method. +// req, resp := client.ListTemplateVersionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListTemplateVersions +func (c *QuickSight) ListTemplateVersionsRequest(input *ListTemplateVersionsInput) (req *request.Request, output *ListTemplateVersionsOutput) { + op := &request.Operation{ + Name: opListTemplateVersions, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/templates/{TemplateId}/versions", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListTemplateVersionsInput{} + } + + output = &ListTemplateVersionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTemplateVersions API operation for Amazon QuickSight. +// +// Lists all the versions of the templates in the current Amazon QuickSight +// 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 QuickSight's +// API operation ListTemplateVersions for usage and error information. +// +// Returned Error Types: +// * ThrottlingException +// Access is throttled. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * InvalidNextTokenException +// The NextToken value isn't valid. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListTemplateVersions +func (c *QuickSight) ListTemplateVersions(input *ListTemplateVersionsInput) (*ListTemplateVersionsOutput, error) { + req, out := c.ListTemplateVersionsRequest(input) + return out, req.Send() +} + +// ListTemplateVersionsWithContext is the same as ListTemplateVersions with the addition of +// the ability to pass a context and additional request options. +// +// See ListTemplateVersions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) ListTemplateVersionsWithContext(ctx aws.Context, input *ListTemplateVersionsInput, opts ...request.Option) (*ListTemplateVersionsOutput, error) { + req, out := c.ListTemplateVersionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListTemplateVersionsPages iterates over the pages of a ListTemplateVersions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTemplateVersions 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 ListTemplateVersions operation. +// pageNum := 0 +// err := client.ListTemplateVersionsPages(params, +// func(page *quicksight.ListTemplateVersionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *QuickSight) ListTemplateVersionsPages(input *ListTemplateVersionsInput, fn func(*ListTemplateVersionsOutput, bool) bool) error { + return c.ListTemplateVersionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListTemplateVersionsPagesWithContext same as ListTemplateVersionsPages 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 *QuickSight) ListTemplateVersionsPagesWithContext(ctx aws.Context, input *ListTemplateVersionsInput, fn func(*ListTemplateVersionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTemplateVersionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTemplateVersionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTemplateVersionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTemplates = "ListTemplates" + +// ListTemplatesRequest generates a "aws/request.Request" representing the +// client's request for the ListTemplates operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTemplates for more information on using the ListTemplates +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTemplatesRequest method. +// req, resp := client.ListTemplatesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListTemplates +func (c *QuickSight) ListTemplatesRequest(input *ListTemplatesInput) (req *request.Request, output *ListTemplatesOutput) { + op := &request.Operation{ + Name: opListTemplates, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/templates", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListTemplatesInput{} + } + + output = &ListTemplatesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTemplates API operation for Amazon QuickSight. +// +// Lists all the templates in the current Amazon QuickSight 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 QuickSight's +// API operation ListTemplates for usage and error information. +// +// Returned Error Types: +// * ThrottlingException +// Access is throttled. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * InvalidNextTokenException +// The NextToken value isn't valid. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListTemplates +func (c *QuickSight) ListTemplates(input *ListTemplatesInput) (*ListTemplatesOutput, error) { + req, out := c.ListTemplatesRequest(input) + return out, req.Send() +} + +// ListTemplatesWithContext is the same as ListTemplates with the addition of +// the ability to pass a context and additional request options. +// +// See ListTemplates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) ListTemplatesWithContext(ctx aws.Context, input *ListTemplatesInput, opts ...request.Option) (*ListTemplatesOutput, error) { + req, out := c.ListTemplatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListTemplatesPages iterates over the pages of a ListTemplates operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTemplates 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 ListTemplates operation. +// pageNum := 0 +// err := client.ListTemplatesPages(params, +// func(page *quicksight.ListTemplatesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *QuickSight) ListTemplatesPages(input *ListTemplatesInput, fn func(*ListTemplatesOutput, bool) bool) error { + return c.ListTemplatesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListTemplatesPagesWithContext same as ListTemplatesPages 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 *QuickSight) ListTemplatesPagesWithContext(ctx aws.Context, input *ListTemplatesInput, fn func(*ListTemplatesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTemplatesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTemplatesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTemplatesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListUserGroups = "ListUserGroups" + +// ListUserGroupsRequest generates a "aws/request.Request" representing the +// client's request for the ListUserGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListUserGroups for more information on using the ListUserGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListUserGroupsRequest method. +// req, resp := client.ListUserGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListUserGroups +func (c *QuickSight) ListUserGroupsRequest(input *ListUserGroupsInput) (req *request.Request, output *ListUserGroupsOutput) { + op := &request.Operation{ + Name: opListUserGroups, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}/groups", + } + + if input == nil { + input = &ListUserGroupsInput{} + } + + output = &ListUserGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListUserGroups API operation for Amazon QuickSight. +// +// Lists the Amazon QuickSight groups that an Amazon QuickSight user is a member +// of. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation ListUserGroups for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InternalFailureException +// An internal failure occurred. +// +// * ResourceUnavailableException +// This resource is currently unavailable. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListUserGroups +func (c *QuickSight) ListUserGroups(input *ListUserGroupsInput) (*ListUserGroupsOutput, error) { + req, out := c.ListUserGroupsRequest(input) + return out, req.Send() +} + +// ListUserGroupsWithContext is the same as ListUserGroups with the addition of +// the ability to pass a context and additional request options. +// +// See ListUserGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) ListUserGroupsWithContext(ctx aws.Context, input *ListUserGroupsInput, opts ...request.Option) (*ListUserGroupsOutput, error) { + req, out := c.ListUserGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListUsers = "ListUsers" + +// ListUsersRequest generates a "aws/request.Request" representing the +// client's request for the ListUsers operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListUsers for more information on using the ListUsers +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListUsersRequest method. +// req, resp := client.ListUsersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListUsers +func (c *QuickSight) ListUsersRequest(input *ListUsersInput) (req *request.Request, output *ListUsersOutput) { + op := &request.Operation{ + Name: opListUsers, + HTTPMethod: "GET", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/users", + } + + if input == nil { + input = &ListUsersInput{} + } + + output = &ListUsersOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListUsers API operation for Amazon QuickSight. +// +// Returns a list of all of the Amazon QuickSight users belonging to this 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 QuickSight's +// API operation ListUsers for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InvalidNextTokenException +// The NextToken value isn't valid. +// +// * InternalFailureException +// An internal failure occurred. +// +// * ResourceUnavailableException +// This resource is currently unavailable. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/ListUsers +func (c *QuickSight) ListUsers(input *ListUsersInput) (*ListUsersOutput, error) { + req, out := c.ListUsersRequest(input) + return out, req.Send() +} + +// ListUsersWithContext is the same as ListUsers with the addition of +// the ability to pass a context and additional request options. +// +// See ListUsers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) ListUsersWithContext(ctx aws.Context, input *ListUsersInput, opts ...request.Option) (*ListUsersOutput, error) { + req, out := c.ListUsersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRegisterUser = "RegisterUser" + +// RegisterUserRequest generates a "aws/request.Request" representing the +// client's request for the RegisterUser operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RegisterUser for more information on using the RegisterUser +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RegisterUserRequest method. +// req, resp := client.RegisterUserRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/RegisterUser +func (c *QuickSight) RegisterUserRequest(input *RegisterUserInput) (req *request.Request, output *RegisterUserOutput) { + op := &request.Operation{ + Name: opRegisterUser, + HTTPMethod: "POST", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/users", + } + + if input == nil { + input = &RegisterUserInput{} + } + + output = &RegisterUserOutput{} + req = c.newRequest(op, input, output) + return +} + +// RegisterUser API operation for Amazon QuickSight. +// +// Creates an Amazon QuickSight user, whose identity is associated with the +// AWS Identity and Access Management (IAM) identity or role 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 QuickSight's +// API operation RegisterUser for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * LimitExceededException +// A limit is exceeded. +// +// * ResourceExistsException +// The resource specified already exists. +// +// * PreconditionNotMetException +// One or more preconditions aren't met. +// +// * InternalFailureException +// An internal failure occurred. +// +// * ResourceUnavailableException +// This resource is currently unavailable. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/RegisterUser +func (c *QuickSight) RegisterUser(input *RegisterUserInput) (*RegisterUserOutput, error) { + req, out := c.RegisterUserRequest(input) + return out, req.Send() +} + +// RegisterUserWithContext is the same as RegisterUser with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) RegisterUserWithContext(ctx aws.Context, input *RegisterUserInput, opts ...request.Option) (*RegisterUserOutput, error) { + req, out := c.RegisterUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSearchDashboards = "SearchDashboards" + +// SearchDashboardsRequest generates a "aws/request.Request" representing the +// client's request for the SearchDashboards operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See SearchDashboards for more information on using the SearchDashboards +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SearchDashboardsRequest method. +// req, resp := client.SearchDashboardsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/SearchDashboards +func (c *QuickSight) SearchDashboardsRequest(input *SearchDashboardsInput) (req *request.Request, output *SearchDashboardsOutput) { + op := &request.Operation{ + Name: opSearchDashboards, + HTTPMethod: "POST", + HTTPPath: "/accounts/{AwsAccountId}/search/dashboards", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &SearchDashboardsInput{} + } + + output = &SearchDashboardsOutput{} + req = c.newRequest(op, input, output) + return +} + +// SearchDashboards API operation for Amazon QuickSight. +// +// Searchs for dashboards that belong to a 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 QuickSight's +// API operation SearchDashboards for usage and error information. +// +// Returned Error Types: +// * ThrottlingException +// Access is throttled. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InvalidNextTokenException +// The NextToken value isn't valid. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/SearchDashboards +func (c *QuickSight) SearchDashboards(input *SearchDashboardsInput) (*SearchDashboardsOutput, error) { + req, out := c.SearchDashboardsRequest(input) + return out, req.Send() +} + +// SearchDashboardsWithContext is the same as SearchDashboards with the addition of +// the ability to pass a context and additional request options. +// +// See SearchDashboards for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) SearchDashboardsWithContext(ctx aws.Context, input *SearchDashboardsInput, opts ...request.Option) (*SearchDashboardsOutput, error) { + req, out := c.SearchDashboardsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// SearchDashboardsPages iterates over the pages of a SearchDashboards operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See SearchDashboards 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 SearchDashboards operation. +// pageNum := 0 +// err := client.SearchDashboardsPages(params, +// func(page *quicksight.SearchDashboardsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *QuickSight) SearchDashboardsPages(input *SearchDashboardsInput, fn func(*SearchDashboardsOutput, bool) bool) error { + return c.SearchDashboardsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// SearchDashboardsPagesWithContext same as SearchDashboardsPages 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 *QuickSight) SearchDashboardsPagesWithContext(ctx aws.Context, input *SearchDashboardsInput, fn func(*SearchDashboardsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *SearchDashboardsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.SearchDashboardsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*SearchDashboardsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/TagResource +func (c *QuickSight) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { + op := &request.Operation{ + Name: opTagResource, + HTTPMethod: "POST", + HTTPPath: "/resources/{ResourceArn}/tags", + } + + if input == nil { + input = &TagResourceInput{} + } + + output = &TagResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// TagResource API operation for Amazon QuickSight. +// +// Assigns one or more tags (key-value pairs) to the specified QuickSight resource. +// +// Tags can help you organize and categorize your resources. You can also use +// them to scope user permissions, by granting a user permission to access or +// change only resources with certain tag values. You can use the TagResource +// operation with a resource that already has tags. If you specify a new tag +// key for the resource, this tag is appended to the list of tags associated +// with the resource. If you specify a tag key that is already associated with +// the resource, the new tag value that you specify replaces the previous value +// for that tag. +// +// You can associate as many as 50 tags with a resource. QuickSight supports +// tagging on data set, data source, dashboard, and template. +// +// Tagging for QuickSight works in a similar way to tagging for other AWS services, +// except for the following: +// +// * You can't use tags to track AWS costs for QuickSight. This restriction +// is because QuickSight costs are based on users and SPICE capacity, which +// aren't taggable resources. +// +// * QuickSight doesn't currently support the Tag Editor for AWS 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 QuickSight's +// API operation TagResource for usage and error information. +// +// Returned Error Types: +// * LimitExceededException +// A limit is exceeded. +// +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/TagResource +func (c *QuickSight) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UntagResource +func (c *QuickSight) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { + op := &request.Operation{ + Name: opUntagResource, + HTTPMethod: "DELETE", + HTTPPath: "/resources/{ResourceArn}/tags", + } + + if input == nil { + input = &UntagResourceInput{} + } + + output = &UntagResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// UntagResource API operation for Amazon QuickSight. +// +// Removes a tag or tags from 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 QuickSight's +// API operation UntagResource for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UntagResource +func (c *QuickSight) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateDashboard = "UpdateDashboard" + +// UpdateDashboardRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDashboard operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateDashboard for more information on using the UpdateDashboard +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateDashboardRequest method. +// req, resp := client.UpdateDashboardRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateDashboard +func (c *QuickSight) UpdateDashboardRequest(input *UpdateDashboardInput) (req *request.Request, output *UpdateDashboardOutput) { + op := &request.Operation{ + Name: opUpdateDashboard, + HTTPMethod: "PUT", + HTTPPath: "/accounts/{AwsAccountId}/dashboards/{DashboardId}", + } + + if input == nil { + input = &UpdateDashboardInput{} + } + + output = &UpdateDashboardOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateDashboard API operation for Amazon QuickSight. +// +// Updates a dashboard 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 QuickSight's +// API operation UpdateDashboard for usage and error information. +// +// Returned Error Types: +// * ThrottlingException +// Access is throttled. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. +// +// * LimitExceededException +// A limit is exceeded. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateDashboard +func (c *QuickSight) UpdateDashboard(input *UpdateDashboardInput) (*UpdateDashboardOutput, error) { + req, out := c.UpdateDashboardRequest(input) + return out, req.Send() +} + +// UpdateDashboardWithContext is the same as UpdateDashboard with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDashboard for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) UpdateDashboardWithContext(ctx aws.Context, input *UpdateDashboardInput, opts ...request.Option) (*UpdateDashboardOutput, error) { + req, out := c.UpdateDashboardRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateDashboardPermissions = "UpdateDashboardPermissions" + +// UpdateDashboardPermissionsRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDashboardPermissions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateDashboardPermissions for more information on using the UpdateDashboardPermissions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateDashboardPermissionsRequest method. +// req, resp := client.UpdateDashboardPermissionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateDashboardPermissions +func (c *QuickSight) UpdateDashboardPermissionsRequest(input *UpdateDashboardPermissionsInput) (req *request.Request, output *UpdateDashboardPermissionsOutput) { + op := &request.Operation{ + Name: opUpdateDashboardPermissions, + HTTPMethod: "PUT", + HTTPPath: "/accounts/{AwsAccountId}/dashboards/{DashboardId}/permissions", + } + + if input == nil { + input = &UpdateDashboardPermissionsInput{} + } + + output = &UpdateDashboardPermissionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateDashboardPermissions API operation for Amazon QuickSight. +// +// Updates read and write permissions on a dashboard. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation UpdateDashboardPermissions for usage and error information. +// +// Returned Error Types: +// * ThrottlingException +// Access is throttled. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateDashboardPermissions +func (c *QuickSight) UpdateDashboardPermissions(input *UpdateDashboardPermissionsInput) (*UpdateDashboardPermissionsOutput, error) { + req, out := c.UpdateDashboardPermissionsRequest(input) + return out, req.Send() +} + +// UpdateDashboardPermissionsWithContext is the same as UpdateDashboardPermissions with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDashboardPermissions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) UpdateDashboardPermissionsWithContext(ctx aws.Context, input *UpdateDashboardPermissionsInput, opts ...request.Option) (*UpdateDashboardPermissionsOutput, error) { + req, out := c.UpdateDashboardPermissionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateDashboardPublishedVersion = "UpdateDashboardPublishedVersion" + +// UpdateDashboardPublishedVersionRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDashboardPublishedVersion operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateDashboardPublishedVersion for more information on using the UpdateDashboardPublishedVersion +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateDashboardPublishedVersionRequest method. +// req, resp := client.UpdateDashboardPublishedVersionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateDashboardPublishedVersion +func (c *QuickSight) UpdateDashboardPublishedVersionRequest(input *UpdateDashboardPublishedVersionInput) (req *request.Request, output *UpdateDashboardPublishedVersionOutput) { + op := &request.Operation{ + Name: opUpdateDashboardPublishedVersion, + HTTPMethod: "PUT", + HTTPPath: "/accounts/{AwsAccountId}/dashboards/{DashboardId}/versions/{VersionNumber}", + } + + if input == nil { + input = &UpdateDashboardPublishedVersionInput{} + } + + output = &UpdateDashboardPublishedVersionOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateDashboardPublishedVersion API operation for Amazon QuickSight. +// +// Updates the published version of a dashboard. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation UpdateDashboardPublishedVersion for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ThrottlingException +// Access is throttled. +// +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateDashboardPublishedVersion +func (c *QuickSight) UpdateDashboardPublishedVersion(input *UpdateDashboardPublishedVersionInput) (*UpdateDashboardPublishedVersionOutput, error) { + req, out := c.UpdateDashboardPublishedVersionRequest(input) + return out, req.Send() +} + +// UpdateDashboardPublishedVersionWithContext is the same as UpdateDashboardPublishedVersion with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDashboardPublishedVersion for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) UpdateDashboardPublishedVersionWithContext(ctx aws.Context, input *UpdateDashboardPublishedVersionInput, opts ...request.Option) (*UpdateDashboardPublishedVersionOutput, error) { + req, out := c.UpdateDashboardPublishedVersionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateDataSet = "UpdateDataSet" + +// UpdateDataSetRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDataSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateDataSet for more information on using the UpdateDataSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateDataSetRequest method. +// req, resp := client.UpdateDataSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateDataSet +func (c *QuickSight) UpdateDataSetRequest(input *UpdateDataSetInput) (req *request.Request, output *UpdateDataSetOutput) { + op := &request.Operation{ + Name: opUpdateDataSet, + HTTPMethod: "PUT", + HTTPPath: "/accounts/{AwsAccountId}/data-sets/{DataSetId}", + } + + if input == nil { + input = &UpdateDataSetInput{} + } + + output = &UpdateDataSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateDataSet API operation for Amazon QuickSight. +// +// Updates a dataset. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation UpdateDataSet for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * LimitExceededException +// A limit is exceeded. +// +// * ThrottlingException +// Access is throttled. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateDataSet +func (c *QuickSight) UpdateDataSet(input *UpdateDataSetInput) (*UpdateDataSetOutput, error) { + req, out := c.UpdateDataSetRequest(input) + return out, req.Send() +} + +// UpdateDataSetWithContext is the same as UpdateDataSet with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDataSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) UpdateDataSetWithContext(ctx aws.Context, input *UpdateDataSetInput, opts ...request.Option) (*UpdateDataSetOutput, error) { + req, out := c.UpdateDataSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateDataSetPermissions = "UpdateDataSetPermissions" + +// UpdateDataSetPermissionsRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDataSetPermissions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateDataSetPermissions for more information on using the UpdateDataSetPermissions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateDataSetPermissionsRequest method. +// req, resp := client.UpdateDataSetPermissionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateDataSetPermissions +func (c *QuickSight) UpdateDataSetPermissionsRequest(input *UpdateDataSetPermissionsInput) (req *request.Request, output *UpdateDataSetPermissionsOutput) { + op := &request.Operation{ + Name: opUpdateDataSetPermissions, + HTTPMethod: "POST", + HTTPPath: "/accounts/{AwsAccountId}/data-sets/{DataSetId}/permissions", + } + + if input == nil { + input = &UpdateDataSetPermissionsInput{} + } + + output = &UpdateDataSetPermissionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateDataSetPermissions API operation for Amazon QuickSight. +// +// Updates the permissions on a dataset. +// +// The permissions resource is arn:aws:quicksight:region:aws-account-id:dataset/data-set-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 QuickSight's +// API operation UpdateDataSetPermissions for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateDataSetPermissions +func (c *QuickSight) UpdateDataSetPermissions(input *UpdateDataSetPermissionsInput) (*UpdateDataSetPermissionsOutput, error) { + req, out := c.UpdateDataSetPermissionsRequest(input) + return out, req.Send() +} + +// UpdateDataSetPermissionsWithContext is the same as UpdateDataSetPermissions with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDataSetPermissions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) UpdateDataSetPermissionsWithContext(ctx aws.Context, input *UpdateDataSetPermissionsInput, opts ...request.Option) (*UpdateDataSetPermissionsOutput, error) { + req, out := c.UpdateDataSetPermissionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateDataSource = "UpdateDataSource" + +// UpdateDataSourceRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDataSource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateDataSource for more information on using the UpdateDataSource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateDataSourceRequest method. +// req, resp := client.UpdateDataSourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateDataSource +func (c *QuickSight) UpdateDataSourceRequest(input *UpdateDataSourceInput) (req *request.Request, output *UpdateDataSourceOutput) { + op := &request.Operation{ + Name: opUpdateDataSource, + HTTPMethod: "PUT", + HTTPPath: "/accounts/{AwsAccountId}/data-sources/{DataSourceId}", + } + + if input == nil { + input = &UpdateDataSourceInput{} + } + + output = &UpdateDataSourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateDataSource API operation for Amazon QuickSight. +// +// Updates a data source. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation UpdateDataSource for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ThrottlingException +// Access is throttled. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateDataSource +func (c *QuickSight) UpdateDataSource(input *UpdateDataSourceInput) (*UpdateDataSourceOutput, error) { + req, out := c.UpdateDataSourceRequest(input) + return out, req.Send() +} + +// UpdateDataSourceWithContext is the same as UpdateDataSource with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDataSource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) UpdateDataSourceWithContext(ctx aws.Context, input *UpdateDataSourceInput, opts ...request.Option) (*UpdateDataSourceOutput, error) { + req, out := c.UpdateDataSourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateDataSourcePermissions = "UpdateDataSourcePermissions" + +// UpdateDataSourcePermissionsRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDataSourcePermissions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateDataSourcePermissions for more information on using the UpdateDataSourcePermissions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateDataSourcePermissionsRequest method. +// req, resp := client.UpdateDataSourcePermissionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateDataSourcePermissions +func (c *QuickSight) UpdateDataSourcePermissionsRequest(input *UpdateDataSourcePermissionsInput) (req *request.Request, output *UpdateDataSourcePermissionsOutput) { + op := &request.Operation{ + Name: opUpdateDataSourcePermissions, + HTTPMethod: "POST", + HTTPPath: "/accounts/{AwsAccountId}/data-sources/{DataSourceId}/permissions", + } + + if input == nil { + input = &UpdateDataSourcePermissionsInput{} + } + + output = &UpdateDataSourcePermissionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateDataSourcePermissions API operation for Amazon QuickSight. +// +// Updates the permissions to a data source. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation UpdateDataSourcePermissions for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateDataSourcePermissions +func (c *QuickSight) UpdateDataSourcePermissions(input *UpdateDataSourcePermissionsInput) (*UpdateDataSourcePermissionsOutput, error) { + req, out := c.UpdateDataSourcePermissionsRequest(input) + return out, req.Send() +} + +// UpdateDataSourcePermissionsWithContext is the same as UpdateDataSourcePermissions with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDataSourcePermissions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) UpdateDataSourcePermissionsWithContext(ctx aws.Context, input *UpdateDataSourcePermissionsInput, opts ...request.Option) (*UpdateDataSourcePermissionsOutput, error) { + req, out := c.UpdateDataSourcePermissionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateGroup = "UpdateGroup" + +// UpdateGroupRequest generates a "aws/request.Request" representing the +// client's request for the UpdateGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateGroup for more information on using the UpdateGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateGroupRequest method. +// req, resp := client.UpdateGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateGroup +func (c *QuickSight) UpdateGroupRequest(input *UpdateGroupInput) (req *request.Request, output *UpdateGroupOutput) { + op := &request.Operation{ + Name: opUpdateGroup, + HTTPMethod: "PUT", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}", + } + + if input == nil { + input = &UpdateGroupInput{} + } + + output = &UpdateGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateGroup API operation for Amazon QuickSight. +// +// Changes a group description. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon QuickSight's +// API operation UpdateGroup for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * PreconditionNotMetException +// One or more preconditions aren't met. +// +// * InternalFailureException +// An internal failure occurred. +// +// * ResourceUnavailableException +// This resource is currently unavailable. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateGroup +func (c *QuickSight) UpdateGroup(input *UpdateGroupInput) (*UpdateGroupOutput, error) { + req, out := c.UpdateGroupRequest(input) + return out, req.Send() +} + +// UpdateGroupWithContext is the same as UpdateGroup with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) UpdateGroupWithContext(ctx aws.Context, input *UpdateGroupInput, opts ...request.Option) (*UpdateGroupOutput, error) { + req, out := c.UpdateGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateIAMPolicyAssignment = "UpdateIAMPolicyAssignment" + +// UpdateIAMPolicyAssignmentRequest generates a "aws/request.Request" representing the +// client's request for the UpdateIAMPolicyAssignment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateIAMPolicyAssignment for more information on using the UpdateIAMPolicyAssignment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateIAMPolicyAssignmentRequest method. +// req, resp := client.UpdateIAMPolicyAssignmentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateIAMPolicyAssignment +func (c *QuickSight) UpdateIAMPolicyAssignmentRequest(input *UpdateIAMPolicyAssignmentInput) (req *request.Request, output *UpdateIAMPolicyAssignmentOutput) { + op := &request.Operation{ + Name: opUpdateIAMPolicyAssignment, + HTTPMethod: "PUT", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/iam-policy-assignments/{AssignmentName}", + } + + if input == nil { + input = &UpdateIAMPolicyAssignmentInput{} + } + + output = &UpdateIAMPolicyAssignmentOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateIAMPolicyAssignment API operation for Amazon QuickSight. +// +// Updates an existing IAM policy assignment. This operation updates only the +// optional parameter or parameters that are 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 QuickSight's +// API operation UpdateIAMPolicyAssignment for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceExistsException +// The resource specified already exists. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * ConcurrentUpdatingException +// A resource is already in a state that indicates an action is happening that +// must complete before a new update can be applied. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateIAMPolicyAssignment +func (c *QuickSight) UpdateIAMPolicyAssignment(input *UpdateIAMPolicyAssignmentInput) (*UpdateIAMPolicyAssignmentOutput, error) { + req, out := c.UpdateIAMPolicyAssignmentRequest(input) + return out, req.Send() +} + +// UpdateIAMPolicyAssignmentWithContext is the same as UpdateIAMPolicyAssignment with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateIAMPolicyAssignment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) UpdateIAMPolicyAssignmentWithContext(ctx aws.Context, input *UpdateIAMPolicyAssignmentInput, opts ...request.Option) (*UpdateIAMPolicyAssignmentOutput, error) { + req, out := c.UpdateIAMPolicyAssignmentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateTemplate = "UpdateTemplate" + +// UpdateTemplateRequest generates a "aws/request.Request" representing the +// client's request for the UpdateTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateTemplate for more information on using the UpdateTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateTemplateRequest method. +// req, resp := client.UpdateTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateTemplate +func (c *QuickSight) UpdateTemplateRequest(input *UpdateTemplateInput) (req *request.Request, output *UpdateTemplateOutput) { + op := &request.Operation{ + Name: opUpdateTemplate, + HTTPMethod: "PUT", + HTTPPath: "/accounts/{AwsAccountId}/templates/{TemplateId}", + } + + if input == nil { + input = &UpdateTemplateInput{} + } + + output = &UpdateTemplateOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateTemplate API operation for Amazon QuickSight. +// +// Updates a template from an existing Amazon QuickSight analysis or another +// 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 QuickSight's +// API operation UpdateTemplate for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceExistsException +// The resource specified already exists. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. +// +// * LimitExceededException +// A limit is exceeded. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateTemplate +func (c *QuickSight) UpdateTemplate(input *UpdateTemplateInput) (*UpdateTemplateOutput, error) { + req, out := c.UpdateTemplateRequest(input) + return out, req.Send() +} + +// UpdateTemplateWithContext is the same as UpdateTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) UpdateTemplateWithContext(ctx aws.Context, input *UpdateTemplateInput, opts ...request.Option) (*UpdateTemplateOutput, error) { + req, out := c.UpdateTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateTemplateAlias = "UpdateTemplateAlias" + +// UpdateTemplateAliasRequest generates a "aws/request.Request" representing the +// client's request for the UpdateTemplateAlias operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateTemplateAlias for more information on using the UpdateTemplateAlias +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateTemplateAliasRequest method. +// req, resp := client.UpdateTemplateAliasRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateTemplateAlias +func (c *QuickSight) UpdateTemplateAliasRequest(input *UpdateTemplateAliasInput) (req *request.Request, output *UpdateTemplateAliasOutput) { + op := &request.Operation{ + Name: opUpdateTemplateAlias, + HTTPMethod: "PUT", + HTTPPath: "/accounts/{AwsAccountId}/templates/{TemplateId}/aliases/{AliasName}", + } + + if input == nil { + input = &UpdateTemplateAliasInput{} + } + + output = &UpdateTemplateAliasOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateTemplateAlias API operation for Amazon QuickSight. +// +// Updates the template alias of a 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 QuickSight's +// API operation UpdateTemplateAlias for usage and error information. +// +// Returned Error Types: +// * ThrottlingException +// Access is throttled. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateTemplateAlias +func (c *QuickSight) UpdateTemplateAlias(input *UpdateTemplateAliasInput) (*UpdateTemplateAliasOutput, error) { + req, out := c.UpdateTemplateAliasRequest(input) + return out, req.Send() +} + +// UpdateTemplateAliasWithContext is the same as UpdateTemplateAlias with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTemplateAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) UpdateTemplateAliasWithContext(ctx aws.Context, input *UpdateTemplateAliasInput, opts ...request.Option) (*UpdateTemplateAliasOutput, error) { + req, out := c.UpdateTemplateAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateTemplatePermissions = "UpdateTemplatePermissions" + +// UpdateTemplatePermissionsRequest generates a "aws/request.Request" representing the +// client's request for the UpdateTemplatePermissions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateTemplatePermissions for more information on using the UpdateTemplatePermissions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateTemplatePermissionsRequest method. +// req, resp := client.UpdateTemplatePermissionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateTemplatePermissions +func (c *QuickSight) UpdateTemplatePermissionsRequest(input *UpdateTemplatePermissionsInput) (req *request.Request, output *UpdateTemplatePermissionsOutput) { + op := &request.Operation{ + Name: opUpdateTemplatePermissions, + HTTPMethod: "PUT", + HTTPPath: "/accounts/{AwsAccountId}/templates/{TemplateId}/permissions", + } + + if input == nil { + input = &UpdateTemplatePermissionsInput{} + } + + output = &UpdateTemplatePermissionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateTemplatePermissions API operation for Amazon QuickSight. +// +// Updates the resource permissions for a 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 QuickSight's +// API operation UpdateTemplatePermissions for usage and error information. +// +// Returned Error Types: +// * ThrottlingException +// Access is throttled. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ConflictException +// Updating or deleting a resource can cause an inconsistent state. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * UnsupportedUserEditionException +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +// +// * InternalFailureException +// An internal failure occurred. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateTemplatePermissions +func (c *QuickSight) UpdateTemplatePermissions(input *UpdateTemplatePermissionsInput) (*UpdateTemplatePermissionsOutput, error) { + req, out := c.UpdateTemplatePermissionsRequest(input) + return out, req.Send() +} + +// UpdateTemplatePermissionsWithContext is the same as UpdateTemplatePermissions with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTemplatePermissions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) UpdateTemplatePermissionsWithContext(ctx aws.Context, input *UpdateTemplatePermissionsInput, opts ...request.Option) (*UpdateTemplatePermissionsOutput, error) { + req, out := c.UpdateTemplatePermissionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateUser = "UpdateUser" + +// UpdateUserRequest generates a "aws/request.Request" representing the +// client's request for the UpdateUser operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateUser for more information on using the UpdateUser +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateUserRequest method. +// req, resp := client.UpdateUserRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateUser +func (c *QuickSight) UpdateUserRequest(input *UpdateUserInput) (req *request.Request, output *UpdateUserOutput) { + op := &request.Operation{ + Name: opUpdateUser, + HTTPMethod: "PUT", + HTTPPath: "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}", + } + + if input == nil { + input = &UpdateUserInput{} + } + + output = &UpdateUserOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateUser API operation for Amazon QuickSight. +// +// Updates an Amazon QuickSight 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 QuickSight's +// API operation UpdateUser for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +// +// * InvalidParameterValueException +// One or more parameters has a value that isn't valid. +// +// * ResourceNotFoundException +// One or more resources can't be found. +// +// * ThrottlingException +// Access is throttled. +// +// * InternalFailureException +// An internal failure occurred. +// +// * ResourceUnavailableException +// This resource is currently unavailable. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01/UpdateUser +func (c *QuickSight) UpdateUser(input *UpdateUserInput) (*UpdateUserOutput, error) { + req, out := c.UpdateUserRequest(input) + return out, req.Send() +} + +// UpdateUserWithContext is the same as UpdateUser with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *QuickSight) UpdateUserWithContext(ctx aws.Context, input *UpdateUserInput, opts ...request.Option) (*UpdateUserOutput, error) { + req, out := c.UpdateUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// You don't have access to this item. The provided credentials couldn't be +// validated. You might not be authorized to carry out the request. Make sure +// that your account is authorized to use the Amazon QuickSight service, that +// your policies have the correct permissions, and that you are using the correct +// access keys. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request ID for this request. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The active AWS Identity and Access Management (IAM) policy assignment. +type ActiveIAMPolicyAssignment struct { + _ struct{} `type:"structure"` + + // A name for the IAM policy assignment. + AssignmentName *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the resource. + PolicyArn *string `type:"string"` +} + +// String returns the string representation +func (s ActiveIAMPolicyAssignment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ActiveIAMPolicyAssignment) GoString() string { + return s.String() +} + +// SetAssignmentName sets the AssignmentName field's value. +func (s *ActiveIAMPolicyAssignment) SetAssignmentName(v string) *ActiveIAMPolicyAssignment { + s.AssignmentName = &v + return s +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *ActiveIAMPolicyAssignment) SetPolicyArn(v string) *ActiveIAMPolicyAssignment { + s.PolicyArn = &v + return s +} + +// Ad hoc (one-time) filtering option. +type AdHocFilteringOption struct { + _ struct{} `type:"structure"` + + // Availability status. + AvailabilityStatus *string `type:"string" enum:"DashboardBehavior"` +} + +// String returns the string representation +func (s AdHocFilteringOption) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AdHocFilteringOption) GoString() string { + return s.String() +} + +// SetAvailabilityStatus sets the AvailabilityStatus field's value. +func (s *AdHocFilteringOption) SetAvailabilityStatus(v string) *AdHocFilteringOption { + s.AvailabilityStatus = &v + return s +} + +// Amazon Elasticsearch Service parameters. +type AmazonElasticsearchParameters struct { + _ struct{} `type:"structure"` + + // The Amazon Elasticsearch Service domain. + // + // Domain is a required field + Domain *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s AmazonElasticsearchParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AmazonElasticsearchParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AmazonElasticsearchParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AmazonElasticsearchParameters"} + if s.Domain == nil { + invalidParams.Add(request.NewErrParamRequired("Domain")) + } + if s.Domain != nil && len(*s.Domain) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Domain", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDomain sets the Domain field's value. +func (s *AmazonElasticsearchParameters) SetDomain(v string) *AmazonElasticsearchParameters { + s.Domain = &v + return s +} + +// Amazon Athena parameters. +type AthenaParameters struct { + _ struct{} `type:"structure"` + + // The workgroup that Amazon Athena uses. + WorkGroup *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s AthenaParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AthenaParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AthenaParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AthenaParameters"} + if s.WorkGroup != nil && len(*s.WorkGroup) < 1 { + invalidParams.Add(request.NewErrParamMinLen("WorkGroup", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetWorkGroup sets the WorkGroup field's value. +func (s *AthenaParameters) SetWorkGroup(v string) *AthenaParameters { + s.WorkGroup = &v + return s +} + +// Amazon Aurora parameters. +type AuroraParameters struct { + _ struct{} `type:"structure"` + + // Database. + // + // Database is a required field + Database *string `min:"1" type:"string" required:"true"` + + // Host. + // + // Host is a required field + Host *string `min:"1" type:"string" required:"true"` + + // Port. + // + // Port is a required field + Port *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s AuroraParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AuroraParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AuroraParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AuroraParameters"} + if s.Database == nil { + invalidParams.Add(request.NewErrParamRequired("Database")) + } + if s.Database != nil && len(*s.Database) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Database", 1)) + } + if s.Host == nil { + invalidParams.Add(request.NewErrParamRequired("Host")) + } + if s.Host != nil && len(*s.Host) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Host", 1)) + } + if s.Port == nil { + invalidParams.Add(request.NewErrParamRequired("Port")) + } + if s.Port != nil && *s.Port < 1 { + invalidParams.Add(request.NewErrParamMinValue("Port", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDatabase sets the Database field's value. +func (s *AuroraParameters) SetDatabase(v string) *AuroraParameters { + s.Database = &v + return s +} + +// SetHost sets the Host field's value. +func (s *AuroraParameters) SetHost(v string) *AuroraParameters { + s.Host = &v + return s +} + +// SetPort sets the Port field's value. +func (s *AuroraParameters) SetPort(v int64) *AuroraParameters { + s.Port = &v + return s +} + +// Amazon Aurora with PostgreSQL compatibility parameters. +type AuroraPostgreSqlParameters struct { + _ struct{} `type:"structure"` + + // Database. + // + // Database is a required field + Database *string `min:"1" type:"string" required:"true"` + + // Host. + // + // Host is a required field + Host *string `min:"1" type:"string" required:"true"` + + // Port. + // + // Port is a required field + Port *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s AuroraPostgreSqlParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AuroraPostgreSqlParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AuroraPostgreSqlParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AuroraPostgreSqlParameters"} + if s.Database == nil { + invalidParams.Add(request.NewErrParamRequired("Database")) + } + if s.Database != nil && len(*s.Database) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Database", 1)) + } + if s.Host == nil { + invalidParams.Add(request.NewErrParamRequired("Host")) + } + if s.Host != nil && len(*s.Host) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Host", 1)) + } + if s.Port == nil { + invalidParams.Add(request.NewErrParamRequired("Port")) + } + if s.Port != nil && *s.Port < 1 { + invalidParams.Add(request.NewErrParamMinValue("Port", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDatabase sets the Database field's value. +func (s *AuroraPostgreSqlParameters) SetDatabase(v string) *AuroraPostgreSqlParameters { + s.Database = &v + return s +} + +// SetHost sets the Host field's value. +func (s *AuroraPostgreSqlParameters) SetHost(v string) *AuroraPostgreSqlParameters { + s.Host = &v + return s +} + +// SetPort sets the Port field's value. +func (s *AuroraPostgreSqlParameters) SetPort(v int64) *AuroraPostgreSqlParameters { + s.Port = &v + return s +} + +// AWS IoT Analytics parameters. +type AwsIotAnalyticsParameters struct { + _ struct{} `type:"structure"` + + // Dataset name. + // + // DataSetName is a required field + DataSetName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s AwsIotAnalyticsParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsIotAnalyticsParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AwsIotAnalyticsParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AwsIotAnalyticsParameters"} + if s.DataSetName == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetName")) + } + if s.DataSetName != nil && len(*s.DataSetName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDataSetName sets the DataSetName field's value. +func (s *AwsIotAnalyticsParameters) SetDataSetName(v string) *AwsIotAnalyticsParameters { + s.DataSetName = &v + return s +} + +// A calculated column for a dataset. +type CalculatedColumn struct { + _ struct{} `type:"structure"` + + // A unique ID to identify a calculated column. During a dataset update, if + // the column ID of a calculated column matches that of an existing calculated + // column, Amazon QuickSight preserves the existing calculated column. + // + // ColumnId is a required field + ColumnId *string `min:"1" type:"string" required:"true"` + + // Column name. + // + // ColumnName is a required field + ColumnName *string `min:"1" type:"string" required:"true"` + + // An expression that defines the calculated column. + // + // Expression is a required field + Expression *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CalculatedColumn) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CalculatedColumn) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CalculatedColumn) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CalculatedColumn"} + if s.ColumnId == nil { + invalidParams.Add(request.NewErrParamRequired("ColumnId")) + } + if s.ColumnId != nil && len(*s.ColumnId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ColumnId", 1)) + } + if s.ColumnName == nil { + invalidParams.Add(request.NewErrParamRequired("ColumnName")) + } + if s.ColumnName != nil && len(*s.ColumnName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ColumnName", 1)) + } + if s.Expression == nil { + invalidParams.Add(request.NewErrParamRequired("Expression")) + } + if s.Expression != nil && len(*s.Expression) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Expression", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetColumnId sets the ColumnId field's value. +func (s *CalculatedColumn) SetColumnId(v string) *CalculatedColumn { + s.ColumnId = &v + return s +} + +// SetColumnName sets the ColumnName field's value. +func (s *CalculatedColumn) SetColumnName(v string) *CalculatedColumn { + s.ColumnName = &v + return s +} + +// SetExpression sets the Expression field's value. +func (s *CalculatedColumn) SetExpression(v string) *CalculatedColumn { + s.Expression = &v + return s +} + +type CancelIngestionInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID of the dataset used in the ingestion. + // + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` + + // An ID for the ingestion. + // + // IngestionId is a required field + IngestionId *string `location:"uri" locationName:"IngestionId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CancelIngestionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelIngestionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CancelIngestionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CancelIngestionInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) + } + if s.IngestionId == nil { + invalidParams.Add(request.NewErrParamRequired("IngestionId")) + } + if s.IngestionId != nil && len(*s.IngestionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("IngestionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *CancelIngestionInput) SetAwsAccountId(v string) *CancelIngestionInput { + s.AwsAccountId = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *CancelIngestionInput) SetDataSetId(v string) *CancelIngestionInput { + s.DataSetId = &v + return s +} + +// SetIngestionId sets the IngestionId field's value. +func (s *CancelIngestionInput) SetIngestionId(v string) *CancelIngestionInput { + s.IngestionId = &v + return s +} + +type CancelIngestionOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) for the data ingestion. + Arn *string `type:"string"` + + // An ID for the ingestion. + IngestionId *string `min:"1" type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s CancelIngestionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CancelIngestionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CancelIngestionOutput) SetArn(v string) *CancelIngestionOutput { + s.Arn = &v + return s +} + +// SetIngestionId sets the IngestionId field's value. +func (s *CancelIngestionOutput) SetIngestionId(v string) *CancelIngestionOutput { + s.IngestionId = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CancelIngestionOutput) SetRequestId(v string) *CancelIngestionOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CancelIngestionOutput) SetStatus(v int64) *CancelIngestionOutput { + s.Status = &v + return s +} + +// A transform operation that casts a column to a different type. +type CastColumnTypeOperation struct { + _ struct{} `type:"structure"` + + // Column name. + // + // ColumnName is a required field + ColumnName *string `min:"1" type:"string" required:"true"` + + // When casting a column from string to datetime type, you can supply a string + // in a format supported by Amazon QuickSight to denote the source data format. + Format *string `type:"string"` + + // New column data type. + // + // NewColumnType is a required field + NewColumnType *string `type:"string" required:"true" enum:"ColumnDataType"` +} + +// String returns the string representation +func (s CastColumnTypeOperation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CastColumnTypeOperation) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CastColumnTypeOperation) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CastColumnTypeOperation"} + if s.ColumnName == nil { + invalidParams.Add(request.NewErrParamRequired("ColumnName")) + } + if s.ColumnName != nil && len(*s.ColumnName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ColumnName", 1)) + } + if s.NewColumnType == nil { + invalidParams.Add(request.NewErrParamRequired("NewColumnType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetColumnName sets the ColumnName field's value. +func (s *CastColumnTypeOperation) SetColumnName(v string) *CastColumnTypeOperation { + s.ColumnName = &v + return s +} + +// SetFormat sets the Format field's value. +func (s *CastColumnTypeOperation) SetFormat(v string) *CastColumnTypeOperation { + s.Format = &v + return s +} + +// SetNewColumnType sets the NewColumnType field's value. +func (s *CastColumnTypeOperation) SetNewColumnType(v string) *CastColumnTypeOperation { + s.NewColumnType = &v + return s +} + +// Groupings of columns that work together in certain Amazon QuickSight features. +// This is a variant type structure. For this structure to be valid, only one +// of the attributes can be non-null. +type ColumnGroup struct { + _ struct{} `type:"structure"` + + // Geospatial column group that denotes a hierarchy. + GeoSpatialColumnGroup *GeoSpatialColumnGroup `type:"structure"` +} + +// String returns the string representation +func (s ColumnGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ColumnGroup) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ColumnGroup) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ColumnGroup"} + if s.GeoSpatialColumnGroup != nil { + if err := s.GeoSpatialColumnGroup.Validate(); err != nil { + invalidParams.AddNested("GeoSpatialColumnGroup", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGeoSpatialColumnGroup sets the GeoSpatialColumnGroup field's value. +func (s *ColumnGroup) SetGeoSpatialColumnGroup(v *GeoSpatialColumnGroup) *ColumnGroup { + s.GeoSpatialColumnGroup = v + return s +} + +// A structure describing the name, data type, and geographic role of the columns. +type ColumnGroupColumnSchema struct { + _ struct{} `type:"structure"` + + // The name of the column group's column schema. + Name *string `type:"string"` +} + +// String returns the string representation +func (s ColumnGroupColumnSchema) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ColumnGroupColumnSchema) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *ColumnGroupColumnSchema) SetName(v string) *ColumnGroupColumnSchema { + s.Name = &v + return s +} + +// The column group schema. +type ColumnGroupSchema struct { + _ struct{} `type:"structure"` + + // A structure containing the list of schemas for column group columns. + ColumnGroupColumnSchemaList []*ColumnGroupColumnSchema `type:"list"` + + // The name of the column group schema. + Name *string `type:"string"` +} + +// String returns the string representation +func (s ColumnGroupSchema) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ColumnGroupSchema) GoString() string { + return s.String() +} + +// SetColumnGroupColumnSchemaList sets the ColumnGroupColumnSchemaList field's value. +func (s *ColumnGroupSchema) SetColumnGroupColumnSchemaList(v []*ColumnGroupColumnSchema) *ColumnGroupSchema { + s.ColumnGroupColumnSchemaList = v + return s +} + +// SetName sets the Name field's value. +func (s *ColumnGroupSchema) SetName(v string) *ColumnGroupSchema { + s.Name = &v + return s +} + +// The column schema. +type ColumnSchema struct { + _ struct{} `type:"structure"` + + // The data type of the column schema. + DataType *string `type:"string"` + + // The geographic role of the column schema. + GeographicRole *string `type:"string"` + + // The name of the column schema. + Name *string `type:"string"` +} + +// String returns the string representation +func (s ColumnSchema) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ColumnSchema) GoString() string { + return s.String() +} + +// SetDataType sets the DataType field's value. +func (s *ColumnSchema) SetDataType(v string) *ColumnSchema { + s.DataType = &v + return s +} + +// SetGeographicRole sets the GeographicRole field's value. +func (s *ColumnSchema) SetGeographicRole(v string) *ColumnSchema { + s.GeographicRole = &v + return s +} + +// SetName sets the Name field's value. +func (s *ColumnSchema) SetName(v string) *ColumnSchema { + s.Name = &v + return s +} + +// A tag for a column in a TagColumnOperation structure. This is a variant type +// structure. For this structure to be valid, only one of the attributes can +// be non-null. +type ColumnTag struct { + _ struct{} `type:"structure"` + + // A geospatial role for a column. + ColumnGeographicRole *string `type:"string" enum:"GeoSpatialDataRole"` +} + +// String returns the string representation +func (s ColumnTag) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ColumnTag) GoString() string { + return s.String() +} + +// SetColumnGeographicRole sets the ColumnGeographicRole field's value. +func (s *ColumnTag) SetColumnGeographicRole(v string) *ColumnTag { + s.ColumnGeographicRole = &v + return s +} + +// A resource is already in a state that indicates an action is happening that +// must complete before a new update can be applied. +type ConcurrentUpdatingException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s ConcurrentUpdatingException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConcurrentUpdatingException) GoString() string { + return s.String() +} + +func newErrorConcurrentUpdatingException(v protocol.ResponseMetadata) error { + return &ConcurrentUpdatingException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConcurrentUpdatingException) Code() string { + return "ConcurrentUpdatingException" +} + +// Message returns the exception's message. +func (s ConcurrentUpdatingException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConcurrentUpdatingException) OrigErr() error { + return nil +} + +func (s ConcurrentUpdatingException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConcurrentUpdatingException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConcurrentUpdatingException) RequestID() string { + return s.respMetadata.RequestID +} + +// Updating or deleting a resource can cause an inconsistent state. +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request ID for this request. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s ConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictException) GoString() string { + return s.String() +} + +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" +} + +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil +} + +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID +} + +// A transform operation that creates calculated columns. Columns created in +// one such operation form a lexical closure. +type CreateColumnsOperation struct { + _ struct{} `type:"structure"` + + // Calculated columns to create. + // + // Columns is a required field + Columns []*CalculatedColumn `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s CreateColumnsOperation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateColumnsOperation) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateColumnsOperation) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateColumnsOperation"} + if s.Columns == nil { + invalidParams.Add(request.NewErrParamRequired("Columns")) + } + if s.Columns != nil && len(s.Columns) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Columns", 1)) + } + if s.Columns != nil { + for i, v := range s.Columns { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Columns", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetColumns sets the Columns field's value. +func (s *CreateColumnsOperation) SetColumns(v []*CalculatedColumn) *CreateColumnsOperation { + s.Columns = v + return s +} + +type CreateDashboardInput struct { + _ struct{} `type:"structure"` + + // The ID of the AWS account where you want to create the dashboard. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID for the dashboard, also added to the IAM policy. + // + // DashboardId is a required field + DashboardId *string `location:"uri" locationName:"DashboardId" min:"1" type:"string" required:"true"` + + // Options for publishing the dashboard when you create it: + // + // * AvailabilityStatus for AdHocFilteringOption - This status can be either + // ENABLED or DISABLED. When this is set to DISABLED, QuickSight disables + // the left filter pane on the published dashboard, which can be used for + // ad hoc (one-time) filtering. This option is ENABLED by default. + // + // * AvailabilityStatus for ExportToCSVOption - This status can be either + // ENABLED or DISABLED. The visual option to export data to .csv format isn't + // enabled when this is set to DISABLED. This option is ENABLED by default. + // + // * VisibilityState for SheetControlsOption - This visibility state can + // be either COLLAPSED or EXPANDED. The sheet controls pane is collapsed + // by default when set to true. This option is COLLAPSED by default. + DashboardPublishOptions *DashboardPublishOptions `type:"structure"` + + // The display name of the dashboard. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // A structure that contains the parameters of the dashboard. These are parameter + // overrides for a dashboard. A dashboard can have any type of parameters, and + // some parameters might accept multiple values. You can use the dashboard permissions + // structure described following to override two string parameters that accept + // multiple values. + Parameters *Parameters `type:"structure"` + + // A structure that contains the permissions of the dashboard. You can use this + // structure for granting permissions with principal and action information. + Permissions []*ResourcePermission `min:"1" type:"list"` + + // The source entity from which the dashboard is created. The source entity + // accepts the Amazon Resource Name (ARN) of the source template or analysis + // and also references the replacement datasets for the placeholders set when + // creating the template. The replacement datasets need to follow the same schema + // as the datasets for which placeholders were created when creating the template. + // + // If you are creating a dashboard from a source entity in a different AWS account, + // use the ARN of the source template. + // + // SourceEntity is a required field + SourceEntity *DashboardSourceEntity `type:"structure" required:"true"` + + // Contains a map of the key-value pairs for the resource tag or tags assigned + // to the dashboard. + Tags []*Tag `min:"1" type:"list"` + + // A description for the first version of the dashboard being created. + VersionDescription *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateDashboardInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDashboardInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateDashboardInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateDashboardInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DashboardId == nil { + invalidParams.Add(request.NewErrParamRequired("DashboardId")) + } + if s.DashboardId != nil && len(*s.DashboardId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DashboardId", 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.Permissions != nil && len(s.Permissions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Permissions", 1)) + } + if s.SourceEntity == nil { + invalidParams.Add(request.NewErrParamRequired("SourceEntity")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + if s.VersionDescription != nil && len(*s.VersionDescription) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VersionDescription", 1)) + } + if s.Parameters != nil { + if err := s.Parameters.Validate(); err != nil { + invalidParams.AddNested("Parameters", err.(request.ErrInvalidParams)) + } + } + 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 s.SourceEntity != nil { + if err := s.SourceEntity.Validate(); err != nil { + invalidParams.AddNested("SourceEntity", 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 +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *CreateDashboardInput) SetAwsAccountId(v string) *CreateDashboardInput { + s.AwsAccountId = &v + return s +} + +// SetDashboardId sets the DashboardId field's value. +func (s *CreateDashboardInput) SetDashboardId(v string) *CreateDashboardInput { + s.DashboardId = &v + return s +} + +// SetDashboardPublishOptions sets the DashboardPublishOptions field's value. +func (s *CreateDashboardInput) SetDashboardPublishOptions(v *DashboardPublishOptions) *CreateDashboardInput { + s.DashboardPublishOptions = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateDashboardInput) SetName(v string) *CreateDashboardInput { + s.Name = &v + return s +} + +// SetParameters sets the Parameters field's value. +func (s *CreateDashboardInput) SetParameters(v *Parameters) *CreateDashboardInput { + s.Parameters = v + return s +} + +// SetPermissions sets the Permissions field's value. +func (s *CreateDashboardInput) SetPermissions(v []*ResourcePermission) *CreateDashboardInput { + s.Permissions = v + return s +} + +// SetSourceEntity sets the SourceEntity field's value. +func (s *CreateDashboardInput) SetSourceEntity(v *DashboardSourceEntity) *CreateDashboardInput { + s.SourceEntity = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateDashboardInput) SetTags(v []*Tag) *CreateDashboardInput { + s.Tags = v + return s +} + +// SetVersionDescription sets the VersionDescription field's value. +func (s *CreateDashboardInput) SetVersionDescription(v string) *CreateDashboardInput { + s.VersionDescription = &v + return s +} + +type CreateDashboardOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the dashboard. + Arn *string `type:"string"` + + // The status of the dashboard creation request. + CreationStatus *string `type:"string" enum:"ResourceStatus"` + + // The ID for the dashboard. + DashboardId *string `min:"1" type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` + + // The ARN of the dashboard, including the version number of the first version + // that is created. + VersionArn *string `type:"string"` +} + +// String returns the string representation +func (s CreateDashboardOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDashboardOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateDashboardOutput) SetArn(v string) *CreateDashboardOutput { + s.Arn = &v + return s +} + +// SetCreationStatus sets the CreationStatus field's value. +func (s *CreateDashboardOutput) SetCreationStatus(v string) *CreateDashboardOutput { + s.CreationStatus = &v + return s +} + +// SetDashboardId sets the DashboardId field's value. +func (s *CreateDashboardOutput) SetDashboardId(v string) *CreateDashboardOutput { + s.DashboardId = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateDashboardOutput) SetRequestId(v string) *CreateDashboardOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CreateDashboardOutput) SetStatus(v int64) *CreateDashboardOutput { + s.Status = &v + return s +} + +// SetVersionArn sets the VersionArn field's value. +func (s *CreateDashboardOutput) SetVersionArn(v string) *CreateDashboardOutput { + s.VersionArn = &v + return s +} + +type CreateDataSetInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // Groupings of columns that work together in certain QuickSight features. Currently, + // only geospatial hierarchy is supported. + ColumnGroups []*ColumnGroup `min:"1" type:"list"` + + // An ID for the dataset that you want to create. This ID is unique per AWS + // Region for each AWS account. + // + // DataSetId is a required field + DataSetId *string `type:"string" required:"true"` + + // Indicates whether you want to import the data into SPICE. + // + // ImportMode is a required field + ImportMode *string `type:"string" required:"true" enum:"DataSetImportMode"` + + // Configures the combination and transformation of the data from the physical + // tables. + LogicalTableMap map[string]*LogicalTable `min:"1" type:"map"` + + // The display name for the dataset. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // A list of resource permissions on the dataset. + Permissions []*ResourcePermission `min:"1" type:"list"` + + // Declares the physical tables that are available in the underlying data sources. + // + // PhysicalTableMap is a required field + PhysicalTableMap map[string]*PhysicalTable `min:"1" type:"map" required:"true"` + + // The row-level security configuration for the data that you want to create. + RowLevelPermissionDataSet *RowLevelPermissionDataSet `type:"structure"` + + // Contains a map of the key-value pairs for the resource tag or tags assigned + // to the dataset. + Tags []*Tag `min:"1" type:"list"` +} + +// String returns the string representation +func (s CreateDataSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDataSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateDataSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateDataSetInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.ColumnGroups != nil && len(s.ColumnGroups) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ColumnGroups", 1)) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.ImportMode == nil { + invalidParams.Add(request.NewErrParamRequired("ImportMode")) + } + if s.LogicalTableMap != nil && len(s.LogicalTableMap) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LogicalTableMap", 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.Permissions != nil && len(s.Permissions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Permissions", 1)) + } + if s.PhysicalTableMap == nil { + invalidParams.Add(request.NewErrParamRequired("PhysicalTableMap")) + } + if s.PhysicalTableMap != nil && len(s.PhysicalTableMap) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PhysicalTableMap", 1)) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + if s.ColumnGroups != nil { + for i, v := range s.ColumnGroups { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ColumnGroups", i), err.(request.ErrInvalidParams)) + } + } + } + if s.LogicalTableMap != nil { + for i, v := range s.LogicalTableMap { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LogicalTableMap", i), err.(request.ErrInvalidParams)) + } + } + } + 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 s.PhysicalTableMap != nil { + for i, v := range s.PhysicalTableMap { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PhysicalTableMap", i), err.(request.ErrInvalidParams)) + } + } + } + if s.RowLevelPermissionDataSet != nil { + if err := s.RowLevelPermissionDataSet.Validate(); err != nil { + invalidParams.AddNested("RowLevelPermissionDataSet", 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 +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *CreateDataSetInput) SetAwsAccountId(v string) *CreateDataSetInput { + s.AwsAccountId = &v + return s +} + +// SetColumnGroups sets the ColumnGroups field's value. +func (s *CreateDataSetInput) SetColumnGroups(v []*ColumnGroup) *CreateDataSetInput { + s.ColumnGroups = v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *CreateDataSetInput) SetDataSetId(v string) *CreateDataSetInput { + s.DataSetId = &v + return s +} + +// SetImportMode sets the ImportMode field's value. +func (s *CreateDataSetInput) SetImportMode(v string) *CreateDataSetInput { + s.ImportMode = &v + return s +} + +// SetLogicalTableMap sets the LogicalTableMap field's value. +func (s *CreateDataSetInput) SetLogicalTableMap(v map[string]*LogicalTable) *CreateDataSetInput { + s.LogicalTableMap = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateDataSetInput) SetName(v string) *CreateDataSetInput { + s.Name = &v + return s +} + +// SetPermissions sets the Permissions field's value. +func (s *CreateDataSetInput) SetPermissions(v []*ResourcePermission) *CreateDataSetInput { + s.Permissions = v + return s +} + +// SetPhysicalTableMap sets the PhysicalTableMap field's value. +func (s *CreateDataSetInput) SetPhysicalTableMap(v map[string]*PhysicalTable) *CreateDataSetInput { + s.PhysicalTableMap = v + return s +} + +// SetRowLevelPermissionDataSet sets the RowLevelPermissionDataSet field's value. +func (s *CreateDataSetInput) SetRowLevelPermissionDataSet(v *RowLevelPermissionDataSet) *CreateDataSetInput { + s.RowLevelPermissionDataSet = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateDataSetInput) SetTags(v []*Tag) *CreateDataSetInput { + s.Tags = v + return s +} + +type CreateDataSetOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the dataset. + Arn *string `type:"string"` + + // The ID for the dataset that you want to create. This ID is unique per AWS + // Region for each AWS account. + DataSetId *string `type:"string"` + + // The ARN for the ingestion, which is triggered as a result of dataset creation + // if the import mode is SPICE. + IngestionArn *string `type:"string"` + + // The ID of the ingestion, which is triggered as a result of dataset creation + // if the import mode is SPICE. + IngestionId *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s CreateDataSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDataSetOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateDataSetOutput) SetArn(v string) *CreateDataSetOutput { + s.Arn = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *CreateDataSetOutput) SetDataSetId(v string) *CreateDataSetOutput { + s.DataSetId = &v + return s +} + +// SetIngestionArn sets the IngestionArn field's value. +func (s *CreateDataSetOutput) SetIngestionArn(v string) *CreateDataSetOutput { + s.IngestionArn = &v + return s +} + +// SetIngestionId sets the IngestionId field's value. +func (s *CreateDataSetOutput) SetIngestionId(v string) *CreateDataSetOutput { + s.IngestionId = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateDataSetOutput) SetRequestId(v string) *CreateDataSetOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CreateDataSetOutput) SetStatus(v int64) *CreateDataSetOutput { + s.Status = &v + return s +} + +type CreateDataSourceInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The credentials QuickSight that uses to connect to your underlying source. + // Currently, only credentials based on user name and password are supported. + Credentials *DataSourceCredentials `type:"structure" sensitive:"true"` + + // An ID for the data source. This ID is unique per AWS Region for each AWS + // account. + // + // DataSourceId is a required field + DataSourceId *string `type:"string" required:"true"` + + // The parameters that QuickSight uses to connect to your underlying source. + DataSourceParameters *DataSourceParameters `type:"structure"` + + // A display name for the data source. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // A list of resource permissions on the data source. + Permissions []*ResourcePermission `min:"1" type:"list"` + + // Secure Socket Layer (SSL) properties that apply when QuickSight connects + // to your underlying source. + SslProperties *SslProperties `type:"structure"` + + // Contains a map of the key-value pairs for the resource tag or tags assigned + // to the data source. + Tags []*Tag `min:"1" type:"list"` + + // The type of the data source. Currently, the supported types for this operation + // are: ATHENA, AURORA, AURORA_POSTGRESQL, MARIADB, MYSQL, POSTGRESQL, PRESTO, + // REDSHIFT, S3, SNOWFLAKE, SPARK, SQLSERVER, TERADATA. Use ListDataSources + // to return a list of all data sources. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"DataSourceType"` + + // Use this parameter only when you want QuickSight to use a VPC connection + // when connecting to your underlying source. + VpcConnectionProperties *VpcConnectionProperties `type:"structure"` +} + +// String returns the string representation +func (s CreateDataSourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDataSourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateDataSourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateDataSourceInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DataSourceId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSourceId")) + } + 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.Permissions != nil && len(s.Permissions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Permissions", 1)) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + if s.Credentials != nil { + if err := s.Credentials.Validate(); err != nil { + invalidParams.AddNested("Credentials", err.(request.ErrInvalidParams)) + } + } + if s.DataSourceParameters != nil { + if err := s.DataSourceParameters.Validate(); err != nil { + invalidParams.AddNested("DataSourceParameters", err.(request.ErrInvalidParams)) + } + } + 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 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 s.VpcConnectionProperties != nil { + if err := s.VpcConnectionProperties.Validate(); err != nil { + invalidParams.AddNested("VpcConnectionProperties", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *CreateDataSourceInput) SetAwsAccountId(v string) *CreateDataSourceInput { + s.AwsAccountId = &v + return s +} + +// SetCredentials sets the Credentials field's value. +func (s *CreateDataSourceInput) SetCredentials(v *DataSourceCredentials) *CreateDataSourceInput { + s.Credentials = v + return s +} + +// SetDataSourceId sets the DataSourceId field's value. +func (s *CreateDataSourceInput) SetDataSourceId(v string) *CreateDataSourceInput { + s.DataSourceId = &v + return s +} + +// SetDataSourceParameters sets the DataSourceParameters field's value. +func (s *CreateDataSourceInput) SetDataSourceParameters(v *DataSourceParameters) *CreateDataSourceInput { + s.DataSourceParameters = v + return s +} + +// SetName sets the Name field's value. +func (s *CreateDataSourceInput) SetName(v string) *CreateDataSourceInput { + s.Name = &v + return s +} + +// SetPermissions sets the Permissions field's value. +func (s *CreateDataSourceInput) SetPermissions(v []*ResourcePermission) *CreateDataSourceInput { + s.Permissions = v + return s +} + +// SetSslProperties sets the SslProperties field's value. +func (s *CreateDataSourceInput) SetSslProperties(v *SslProperties) *CreateDataSourceInput { + s.SslProperties = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateDataSourceInput) SetTags(v []*Tag) *CreateDataSourceInput { + s.Tags = v + return s +} + +// SetType sets the Type field's value. +func (s *CreateDataSourceInput) SetType(v string) *CreateDataSourceInput { + s.Type = &v + return s +} + +// SetVpcConnectionProperties sets the VpcConnectionProperties field's value. +func (s *CreateDataSourceInput) SetVpcConnectionProperties(v *VpcConnectionProperties) *CreateDataSourceInput { + s.VpcConnectionProperties = v + return s +} + +type CreateDataSourceOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the data source. + Arn *string `type:"string"` + + // The status of creating the data source. + CreationStatus *string `type:"string" enum:"ResourceStatus"` + + // The ID of the data source. This ID is unique per AWS Region for each AWS + // account. + DataSourceId *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s CreateDataSourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDataSourceOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateDataSourceOutput) SetArn(v string) *CreateDataSourceOutput { + s.Arn = &v + return s +} + +// SetCreationStatus sets the CreationStatus field's value. +func (s *CreateDataSourceOutput) SetCreationStatus(v string) *CreateDataSourceOutput { + s.CreationStatus = &v + return s +} + +// SetDataSourceId sets the DataSourceId field's value. +func (s *CreateDataSourceOutput) SetDataSourceId(v string) *CreateDataSourceOutput { + s.DataSourceId = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateDataSourceOutput) SetRequestId(v string) *CreateDataSourceOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CreateDataSourceOutput) SetStatus(v int64) *CreateDataSourceOutput { + s.Status = &v + return s +} + +// The request object for this operation. +type CreateGroupInput struct { + _ struct{} `type:"structure"` + + // The ID for the AWS account that the group is in. Currently, you use the ID + // for the AWS account that contains your Amazon QuickSight account. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // A description for the group that you want to create. + Description *string `min:"1" type:"string"` + + // A name for the group that you want to create. + // + // GroupName is a required field + GroupName *string `min:"1" type:"string" required:"true"` + + // The namespace. Currently, you should set this to default. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` +} + +// 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.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 1)) + } + 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.Namespace == nil { + invalidParams.Add(request.NewErrParamRequired("Namespace")) + } + if s.Namespace != nil && len(*s.Namespace) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *CreateGroupInput) SetAwsAccountId(v string) *CreateGroupInput { + s.AwsAccountId = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateGroupInput) SetDescription(v string) *CreateGroupInput { + s.Description = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *CreateGroupInput) SetGroupName(v string) *CreateGroupInput { + s.GroupName = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *CreateGroupInput) SetNamespace(v string) *CreateGroupInput { + s.Namespace = &v + return s +} + +type CreateGroupMembershipInput struct { + _ struct{} `type:"structure"` + + // The ID for the AWS account that the group is in. Currently, you use the ID + // for the AWS account that contains your Amazon QuickSight account. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The name of the group that you want to add the user to. + // + // GroupName is a required field + GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"` + + // The name of the user that you want to add to the group membership. + // + // MemberName is a required field + MemberName *string `location:"uri" locationName:"MemberName" min:"1" type:"string" required:"true"` + + // The namespace. Currently, you should set this to default. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateGroupMembershipInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateGroupMembershipInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateGroupMembershipInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateGroupMembershipInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + 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.MemberName == nil { + invalidParams.Add(request.NewErrParamRequired("MemberName")) + } + if s.MemberName != nil && len(*s.MemberName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MemberName", 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 invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *CreateGroupMembershipInput) SetAwsAccountId(v string) *CreateGroupMembershipInput { + s.AwsAccountId = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *CreateGroupMembershipInput) SetGroupName(v string) *CreateGroupMembershipInput { + s.GroupName = &v + return s +} + +// SetMemberName sets the MemberName field's value. +func (s *CreateGroupMembershipInput) SetMemberName(v string) *CreateGroupMembershipInput { + s.MemberName = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *CreateGroupMembershipInput) SetNamespace(v string) *CreateGroupMembershipInput { + s.Namespace = &v + return s +} + +type CreateGroupMembershipOutput struct { + _ struct{} `type:"structure"` + + // The group member. + GroupMember *GroupMember `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s CreateGroupMembershipOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateGroupMembershipOutput) GoString() string { + return s.String() +} + +// SetGroupMember sets the GroupMember field's value. +func (s *CreateGroupMembershipOutput) SetGroupMember(v *GroupMember) *CreateGroupMembershipOutput { + s.GroupMember = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateGroupMembershipOutput) SetRequestId(v string) *CreateGroupMembershipOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CreateGroupMembershipOutput) SetStatus(v int64) *CreateGroupMembershipOutput { + s.Status = &v + return s +} + +// The response object for this operation. +type CreateGroupOutput struct { + _ struct{} `type:"structure"` + + // The name of the group. + Group *Group `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// 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 +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateGroupOutput) SetRequestId(v string) *CreateGroupOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CreateGroupOutput) SetStatus(v int64) *CreateGroupOutput { + s.Status = &v + return s +} + +type CreateIAMPolicyAssignmentInput struct { + _ struct{} `type:"structure"` + + // The name of the assignment. It must be unique within an AWS account. + // + // AssignmentName is a required field + AssignmentName *string `min:"1" type:"string" required:"true"` + + // The status of the assignment. Possible values are as follows: + // + // * ENABLED - Anything specified in this assignment is used when creating + // the data source. + // + // * DISABLED - This assignment isn't used when creating the data source. + // + // * DRAFT - This assignment is an unfinished draft and isn't used when creating + // the data source. + // + // AssignmentStatus is a required field + AssignmentStatus *string `type:"string" required:"true" enum:"AssignmentStatus"` + + // The ID of the AWS account where you want to assign an IAM policy to QuickSight + // users or groups. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The QuickSight users, groups, or both that you want to assign the policy + // to. + Identities map[string][]*string `type:"map"` + + // The namespace that contains the assignment. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + + // The ARN for the IAM policy to apply to the QuickSight users and groups specified + // in this assignment. + PolicyArn *string `type:"string"` +} + +// String returns the string representation +func (s CreateIAMPolicyAssignmentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateIAMPolicyAssignmentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateIAMPolicyAssignmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateIAMPolicyAssignmentInput"} + if s.AssignmentName == nil { + invalidParams.Add(request.NewErrParamRequired("AssignmentName")) + } + if s.AssignmentName != nil && len(*s.AssignmentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AssignmentName", 1)) + } + if s.AssignmentStatus == nil { + invalidParams.Add(request.NewErrParamRequired("AssignmentStatus")) + } + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.Namespace == nil { + invalidParams.Add(request.NewErrParamRequired("Namespace")) + } + if s.Namespace != nil && len(*s.Namespace) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssignmentName sets the AssignmentName field's value. +func (s *CreateIAMPolicyAssignmentInput) SetAssignmentName(v string) *CreateIAMPolicyAssignmentInput { + s.AssignmentName = &v + return s +} + +// SetAssignmentStatus sets the AssignmentStatus field's value. +func (s *CreateIAMPolicyAssignmentInput) SetAssignmentStatus(v string) *CreateIAMPolicyAssignmentInput { + s.AssignmentStatus = &v + return s +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *CreateIAMPolicyAssignmentInput) SetAwsAccountId(v string) *CreateIAMPolicyAssignmentInput { + s.AwsAccountId = &v + return s +} + +// SetIdentities sets the Identities field's value. +func (s *CreateIAMPolicyAssignmentInput) SetIdentities(v map[string][]*string) *CreateIAMPolicyAssignmentInput { + s.Identities = v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *CreateIAMPolicyAssignmentInput) SetNamespace(v string) *CreateIAMPolicyAssignmentInput { + s.Namespace = &v + return s +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *CreateIAMPolicyAssignmentInput) SetPolicyArn(v string) *CreateIAMPolicyAssignmentInput { + s.PolicyArn = &v + return s +} + +type CreateIAMPolicyAssignmentOutput struct { + _ struct{} `type:"structure"` + + // The ID for the assignment. + AssignmentId *string `type:"string"` + + // The name of the assignment. This name must be unique within the AWS account. + AssignmentName *string `min:"1" type:"string"` + + // The status of the assignment. Possible values are as follows: + // + // * ENABLED - Anything specified in this assignment is used when creating + // the data source. + // + // * DISABLED - This assignment isn't used when creating the data source. + // + // * DRAFT - This assignment is an unfinished draft and isn't used when creating + // the data source. + AssignmentStatus *string `type:"string" enum:"AssignmentStatus"` + + // The QuickSight users, groups, or both that the IAM policy is assigned to. + Identities map[string][]*string `type:"map"` + + // The ARN for the IAM policy that is applied to the QuickSight users and groups + // specified in this assignment. + PolicyArn *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s CreateIAMPolicyAssignmentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateIAMPolicyAssignmentOutput) GoString() string { + return s.String() +} + +// SetAssignmentId sets the AssignmentId field's value. +func (s *CreateIAMPolicyAssignmentOutput) SetAssignmentId(v string) *CreateIAMPolicyAssignmentOutput { + s.AssignmentId = &v + return s +} + +// SetAssignmentName sets the AssignmentName field's value. +func (s *CreateIAMPolicyAssignmentOutput) SetAssignmentName(v string) *CreateIAMPolicyAssignmentOutput { + s.AssignmentName = &v + return s +} + +// SetAssignmentStatus sets the AssignmentStatus field's value. +func (s *CreateIAMPolicyAssignmentOutput) SetAssignmentStatus(v string) *CreateIAMPolicyAssignmentOutput { + s.AssignmentStatus = &v + return s +} + +// SetIdentities sets the Identities field's value. +func (s *CreateIAMPolicyAssignmentOutput) SetIdentities(v map[string][]*string) *CreateIAMPolicyAssignmentOutput { + s.Identities = v + return s +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *CreateIAMPolicyAssignmentOutput) SetPolicyArn(v string) *CreateIAMPolicyAssignmentOutput { + s.PolicyArn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateIAMPolicyAssignmentOutput) SetRequestId(v string) *CreateIAMPolicyAssignmentOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CreateIAMPolicyAssignmentOutput) SetStatus(v int64) *CreateIAMPolicyAssignmentOutput { + s.Status = &v + return s +} + +type CreateIngestionInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID of the dataset used in the ingestion. + // + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` + + // An ID for the ingestion. + // + // IngestionId is a required field + IngestionId *string `location:"uri" locationName:"IngestionId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateIngestionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateIngestionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateIngestionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateIngestionInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) + } + if s.IngestionId == nil { + invalidParams.Add(request.NewErrParamRequired("IngestionId")) + } + if s.IngestionId != nil && len(*s.IngestionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("IngestionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *CreateIngestionInput) SetAwsAccountId(v string) *CreateIngestionInput { + s.AwsAccountId = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *CreateIngestionInput) SetDataSetId(v string) *CreateIngestionInput { + s.DataSetId = &v + return s +} + +// SetIngestionId sets the IngestionId field's value. +func (s *CreateIngestionInput) SetIngestionId(v string) *CreateIngestionInput { + s.IngestionId = &v + return s +} + +type CreateIngestionOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) for the data ingestion. + Arn *string `type:"string"` + + // An ID for the ingestion. + IngestionId *string `min:"1" type:"string"` + + // The ingestion status. + IngestionStatus *string `type:"string" enum:"IngestionStatus"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s CreateIngestionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateIngestionOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateIngestionOutput) SetArn(v string) *CreateIngestionOutput { + s.Arn = &v + return s +} + +// SetIngestionId sets the IngestionId field's value. +func (s *CreateIngestionOutput) SetIngestionId(v string) *CreateIngestionOutput { + s.IngestionId = &v + return s +} + +// SetIngestionStatus sets the IngestionStatus field's value. +func (s *CreateIngestionOutput) SetIngestionStatus(v string) *CreateIngestionOutput { + s.IngestionStatus = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateIngestionOutput) SetRequestId(v string) *CreateIngestionOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CreateIngestionOutput) SetStatus(v int64) *CreateIngestionOutput { + s.Status = &v + return s +} + +type CreateTemplateAliasInput struct { + _ struct{} `type:"structure"` + + // The name that you want to give to the template alias that you're creating. + // Don't start the alias name with the $ character. Alias names that start with + // $ are reserved by QuickSight. + // + // AliasName is a required field + AliasName *string `location:"uri" locationName:"AliasName" min:"1" type:"string" required:"true"` + + // The ID of the AWS account that contains the template that you creating an + // alias for. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // An ID for the template. + // + // TemplateId is a required field + TemplateId *string `location:"uri" locationName:"TemplateId" min:"1" type:"string" required:"true"` + + // The version number of the template. + // + // TemplateVersionNumber is a required field + TemplateVersionNumber *int64 `min:"1" type:"long" required:"true"` +} + +// String returns the string representation +func (s CreateTemplateAliasInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTemplateAliasInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTemplateAliasInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTemplateAliasInput"} + 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.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.TemplateId == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateId")) + } + if s.TemplateId != nil && len(*s.TemplateId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) + } + if s.TemplateVersionNumber == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateVersionNumber")) + } + if s.TemplateVersionNumber != nil && *s.TemplateVersionNumber < 1 { + invalidParams.Add(request.NewErrParamMinValue("TemplateVersionNumber", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAliasName sets the AliasName field's value. +func (s *CreateTemplateAliasInput) SetAliasName(v string) *CreateTemplateAliasInput { + s.AliasName = &v + return s +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *CreateTemplateAliasInput) SetAwsAccountId(v string) *CreateTemplateAliasInput { + s.AwsAccountId = &v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *CreateTemplateAliasInput) SetTemplateId(v string) *CreateTemplateAliasInput { + s.TemplateId = &v + return s +} + +// SetTemplateVersionNumber sets the TemplateVersionNumber field's value. +func (s *CreateTemplateAliasInput) SetTemplateVersionNumber(v int64) *CreateTemplateAliasInput { + s.TemplateVersionNumber = &v + return s +} + +type CreateTemplateAliasOutput struct { + _ struct{} `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` + + // Information about the template alias. + TemplateAlias *TemplateAlias `type:"structure"` +} + +// String returns the string representation +func (s CreateTemplateAliasOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTemplateAliasOutput) GoString() string { + return s.String() +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateTemplateAliasOutput) SetRequestId(v string) *CreateTemplateAliasOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CreateTemplateAliasOutput) SetStatus(v int64) *CreateTemplateAliasOutput { + s.Status = &v + return s +} + +// SetTemplateAlias sets the TemplateAlias field's value. +func (s *CreateTemplateAliasOutput) SetTemplateAlias(v *TemplateAlias) *CreateTemplateAliasOutput { + s.TemplateAlias = v + return s +} + +type CreateTemplateInput struct { + _ struct{} `type:"structure"` + + // The ID for the AWS account that the group is in. Currently, you use the ID + // for the AWS account that contains your Amazon QuickSight account. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // A display name for the template. + Name *string `min:"1" type:"string"` + + // A list of resource permissions to be set on the template. + Permissions []*ResourcePermission `min:"1" type:"list"` + + // The Amazon Resource Name (ARN) of the source entity from which this template + // is being created. Currently, you can create a template from an analysis or + // another template. If the ARN is for an analysis, include its dataset references. + // + // SourceEntity is a required field + SourceEntity *TemplateSourceEntity `type:"structure" required:"true"` + + // Contains a map of the key-value pairs for the resource tag or tags assigned + // to the resource. + Tags []*Tag `min:"1" type:"list"` + + // An ID for the template that you want to create. This template is unique per + // AWS Region in each AWS account. + // + // TemplateId is a required field + TemplateId *string `location:"uri" locationName:"TemplateId" min:"1" type:"string" required:"true"` + + // A description of the current template version being created. This API operation + // creates the first version of the template. Every time UpdateTemplate is called, + // a new version is created. Each version of the template maintains a description + // of the version in the VersionDescription field. + VersionDescription *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s CreateTemplateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTemplateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTemplateInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.Permissions != nil && len(s.Permissions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Permissions", 1)) + } + if s.SourceEntity == nil { + invalidParams.Add(request.NewErrParamRequired("SourceEntity")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + if s.TemplateId == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateId")) + } + if s.TemplateId != nil && len(*s.TemplateId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) + } + if s.VersionDescription != nil && len(*s.VersionDescription) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VersionDescription", 1)) + } + 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 s.SourceEntity != nil { + if err := s.SourceEntity.Validate(); err != nil { + invalidParams.AddNested("SourceEntity", 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 +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *CreateTemplateInput) SetAwsAccountId(v string) *CreateTemplateInput { + s.AwsAccountId = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateTemplateInput) SetName(v string) *CreateTemplateInput { + s.Name = &v + return s +} + +// SetPermissions sets the Permissions field's value. +func (s *CreateTemplateInput) SetPermissions(v []*ResourcePermission) *CreateTemplateInput { + s.Permissions = v + return s +} + +// SetSourceEntity sets the SourceEntity field's value. +func (s *CreateTemplateInput) SetSourceEntity(v *TemplateSourceEntity) *CreateTemplateInput { + s.SourceEntity = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateTemplateInput) SetTags(v []*Tag) *CreateTemplateInput { + s.Tags = v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *CreateTemplateInput) SetTemplateId(v string) *CreateTemplateInput { + s.TemplateId = &v + return s +} + +// SetVersionDescription sets the VersionDescription field's value. +func (s *CreateTemplateInput) SetVersionDescription(v string) *CreateTemplateInput { + s.VersionDescription = &v + return s +} + +type CreateTemplateOutput struct { + _ struct{} `type:"structure"` + + // The ARN for the template. + Arn *string `type:"string"` + + // The template creation status. + CreationStatus *string `type:"string" enum:"ResourceStatus"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` + + // The ID of the template. + TemplateId *string `min:"1" type:"string"` + + // The ARN for the template, including the version information of the first + // version. + VersionArn *string `type:"string"` +} + +// String returns the string representation +func (s CreateTemplateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTemplateOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *CreateTemplateOutput) SetArn(v string) *CreateTemplateOutput { + s.Arn = &v + return s +} + +// SetCreationStatus sets the CreationStatus field's value. +func (s *CreateTemplateOutput) SetCreationStatus(v string) *CreateTemplateOutput { + s.CreationStatus = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *CreateTemplateOutput) SetRequestId(v string) *CreateTemplateOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CreateTemplateOutput) SetStatus(v int64) *CreateTemplateOutput { + s.Status = &v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *CreateTemplateOutput) SetTemplateId(v string) *CreateTemplateOutput { + s.TemplateId = &v + return s +} + +// SetVersionArn sets the VersionArn field's value. +func (s *CreateTemplateOutput) SetVersionArn(v string) *CreateTemplateOutput { + s.VersionArn = &v + return s +} + +// The combination of user name and password that are used as credentials. +type CredentialPair struct { + _ struct{} `type:"structure"` + + // Password. + // + // Password is a required field + Password *string `min:"1" type:"string" required:"true"` + + // User name. + // + // Username is a required field + Username *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CredentialPair) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CredentialPair) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CredentialPair) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CredentialPair"} + 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 *CredentialPair) SetPassword(v string) *CredentialPair { + s.Password = &v + return s +} + +// SetUsername sets the Username field's value. +func (s *CredentialPair) SetUsername(v string) *CredentialPair { + s.Username = &v + return s +} + +// A physical table type built from the results of the custom SQL query. +type CustomSql struct { + _ struct{} `type:"structure"` + + // The column schema from the SQL query result set. + Columns []*InputColumn `min:"1" type:"list"` + + // The Amazon Resource Name (ARN) of the data source. + // + // DataSourceArn is a required field + DataSourceArn *string `type:"string" required:"true"` + + // A display name for the SQL query result. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The SQL query. + // + // SqlQuery is a required field + SqlQuery *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CustomSql) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CustomSql) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CustomSql) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CustomSql"} + if s.Columns != nil && len(s.Columns) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Columns", 1)) + } + if s.DataSourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("DataSourceArn")) + } + 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.SqlQuery == nil { + invalidParams.Add(request.NewErrParamRequired("SqlQuery")) + } + if s.SqlQuery != nil && len(*s.SqlQuery) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SqlQuery", 1)) + } + if s.Columns != nil { + for i, v := range s.Columns { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Columns", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetColumns sets the Columns field's value. +func (s *CustomSql) SetColumns(v []*InputColumn) *CustomSql { + s.Columns = v + return s +} + +// SetDataSourceArn sets the DataSourceArn field's value. +func (s *CustomSql) SetDataSourceArn(v string) *CustomSql { + s.DataSourceArn = &v + return s +} + +// SetName sets the Name field's value. +func (s *CustomSql) SetName(v string) *CustomSql { + s.Name = &v + return s +} + +// SetSqlQuery sets the SqlQuery field's value. +func (s *CustomSql) SetSqlQuery(v string) *CustomSql { + s.SqlQuery = &v + return s +} + +// Dashboard. +type Dashboard struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + Arn *string `type:"string"` + + // The time that this dataset was created. + CreatedTime *time.Time `type:"timestamp"` + + // Dashboard ID. + DashboardId *string `min:"1" type:"string"` + + // The last time that this dataset was published. + LastPublishedTime *time.Time `type:"timestamp"` + + // The last time that this dataset was updated. + LastUpdatedTime *time.Time `type:"timestamp"` + + // A display name for the dataset. + Name *string `min:"1" type:"string"` + + // Version. + Version *DashboardVersion `type:"structure"` +} + +// String returns the string representation +func (s Dashboard) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Dashboard) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *Dashboard) SetArn(v string) *Dashboard { + s.Arn = &v + return s +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *Dashboard) SetCreatedTime(v time.Time) *Dashboard { + s.CreatedTime = &v + return s +} + +// SetDashboardId sets the DashboardId field's value. +func (s *Dashboard) SetDashboardId(v string) *Dashboard { + s.DashboardId = &v + return s +} + +// SetLastPublishedTime sets the LastPublishedTime field's value. +func (s *Dashboard) SetLastPublishedTime(v time.Time) *Dashboard { + s.LastPublishedTime = &v + return s +} + +// SetLastUpdatedTime sets the LastUpdatedTime field's value. +func (s *Dashboard) SetLastUpdatedTime(v time.Time) *Dashboard { + s.LastUpdatedTime = &v + return s +} + +// SetName sets the Name field's value. +func (s *Dashboard) SetName(v string) *Dashboard { + s.Name = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *Dashboard) SetVersion(v *DashboardVersion) *Dashboard { + s.Version = v + return s +} + +// Dashboard error. +type DashboardError struct { + _ struct{} `type:"structure"` + + // Message. + Message *string `type:"string"` + + // Type. + Type *string `type:"string" enum:"DashboardErrorType"` +} + +// String returns the string representation +func (s DashboardError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DashboardError) GoString() string { + return s.String() +} + +// SetMessage sets the Message field's value. +func (s *DashboardError) SetMessage(v string) *DashboardError { + s.Message = &v + return s +} + +// SetType sets the Type field's value. +func (s *DashboardError) SetType(v string) *DashboardError { + s.Type = &v + return s +} + +// Dashboard publish options. +type DashboardPublishOptions struct { + _ struct{} `type:"structure"` + + // Ad hoc (one-time) filtering option. + AdHocFilteringOption *AdHocFilteringOption `type:"structure"` + + // Export to .csv option. + ExportToCSVOption *ExportToCSVOption `type:"structure"` + + // Sheet controls option. + SheetControlsOption *SheetControlsOption `type:"structure"` +} + +// String returns the string representation +func (s DashboardPublishOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DashboardPublishOptions) GoString() string { + return s.String() +} + +// SetAdHocFilteringOption sets the AdHocFilteringOption field's value. +func (s *DashboardPublishOptions) SetAdHocFilteringOption(v *AdHocFilteringOption) *DashboardPublishOptions { + s.AdHocFilteringOption = v + return s +} + +// SetExportToCSVOption sets the ExportToCSVOption field's value. +func (s *DashboardPublishOptions) SetExportToCSVOption(v *ExportToCSVOption) *DashboardPublishOptions { + s.ExportToCSVOption = v + return s +} + +// SetSheetControlsOption sets the SheetControlsOption field's value. +func (s *DashboardPublishOptions) SetSheetControlsOption(v *SheetControlsOption) *DashboardPublishOptions { + s.SheetControlsOption = v + return s +} + +// A filter that you apply when searching for dashboards. +type DashboardSearchFilter struct { + _ struct{} `type:"structure"` + + // The name of the value that you want to use as a filter. For example, "Name": + // "QUICKSIGHT_USER". + Name *string `type:"string" enum:"DashboardFilterAttribute"` + + // The comparison operator that you want to use as a filter. For example, "Operator": + // "StringEquals". + // + // Operator is a required field + Operator *string `type:"string" required:"true" enum:"FilterOperator"` + + // The value of the named item, in this case QUICKSIGHT_USER, that you want + // to use as a filter. For example, "Value": "arn:aws:quicksight:us-east-1:1:user/default/UserName1". + Value *string `type:"string"` +} + +// String returns the string representation +func (s DashboardSearchFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DashboardSearchFilter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DashboardSearchFilter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DashboardSearchFilter"} + if s.Operator == nil { + invalidParams.Add(request.NewErrParamRequired("Operator")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DashboardSearchFilter) SetName(v string) *DashboardSearchFilter { + s.Name = &v + return s +} + +// SetOperator sets the Operator field's value. +func (s *DashboardSearchFilter) SetOperator(v string) *DashboardSearchFilter { + s.Operator = &v + return s +} + +// SetValue sets the Value field's value. +func (s *DashboardSearchFilter) SetValue(v string) *DashboardSearchFilter { + s.Value = &v + return s +} + +// Dashboard source entity. +type DashboardSourceEntity struct { + _ struct{} `type:"structure"` + + // Source template. + SourceTemplate *DashboardSourceTemplate `type:"structure"` +} + +// String returns the string representation +func (s DashboardSourceEntity) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DashboardSourceEntity) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DashboardSourceEntity) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DashboardSourceEntity"} + if s.SourceTemplate != nil { + if err := s.SourceTemplate.Validate(); err != nil { + invalidParams.AddNested("SourceTemplate", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSourceTemplate sets the SourceTemplate field's value. +func (s *DashboardSourceEntity) SetSourceTemplate(v *DashboardSourceTemplate) *DashboardSourceEntity { + s.SourceTemplate = v + return s +} + +// Dashboard source template. +type DashboardSourceTemplate struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // Dataset references. + // + // DataSetReferences is a required field + DataSetReferences []*DataSetReference `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s DashboardSourceTemplate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DashboardSourceTemplate) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DashboardSourceTemplate) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DashboardSourceTemplate"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.DataSetReferences == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetReferences")) + } + if s.DataSetReferences != nil && len(s.DataSetReferences) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetReferences", 1)) + } + if s.DataSetReferences != nil { + for i, v := range s.DataSetReferences { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DataSetReferences", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *DashboardSourceTemplate) SetArn(v string) *DashboardSourceTemplate { + s.Arn = &v + return s +} + +// SetDataSetReferences sets the DataSetReferences field's value. +func (s *DashboardSourceTemplate) SetDataSetReferences(v []*DataSetReference) *DashboardSourceTemplate { + s.DataSetReferences = v + return s +} + +// Dashboard summary. +type DashboardSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + Arn *string `type:"string"` + + // The time that this dashboard was created. + CreatedTime *time.Time `type:"timestamp"` + + // Dashboard ID. + DashboardId *string `min:"1" type:"string"` + + // The last time that this dashboard was published. + LastPublishedTime *time.Time `type:"timestamp"` + + // The last time that this dashboard was updated. + LastUpdatedTime *time.Time `type:"timestamp"` + + // A display name for the dashboard. + Name *string `min:"1" type:"string"` + + // Published version number. + PublishedVersionNumber *int64 `min:"1" type:"long"` +} + +// String returns the string representation +func (s DashboardSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DashboardSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DashboardSummary) SetArn(v string) *DashboardSummary { + s.Arn = &v + return s +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *DashboardSummary) SetCreatedTime(v time.Time) *DashboardSummary { + s.CreatedTime = &v + return s +} + +// SetDashboardId sets the DashboardId field's value. +func (s *DashboardSummary) SetDashboardId(v string) *DashboardSummary { + s.DashboardId = &v + return s +} + +// SetLastPublishedTime sets the LastPublishedTime field's value. +func (s *DashboardSummary) SetLastPublishedTime(v time.Time) *DashboardSummary { + s.LastPublishedTime = &v + return s +} + +// SetLastUpdatedTime sets the LastUpdatedTime field's value. +func (s *DashboardSummary) SetLastUpdatedTime(v time.Time) *DashboardSummary { + s.LastUpdatedTime = &v + return s +} + +// SetName sets the Name field's value. +func (s *DashboardSummary) SetName(v string) *DashboardSummary { + s.Name = &v + return s +} + +// SetPublishedVersionNumber sets the PublishedVersionNumber field's value. +func (s *DashboardSummary) SetPublishedVersionNumber(v int64) *DashboardSummary { + s.PublishedVersionNumber = &v + return s +} + +// Dashboard version. +type DashboardVersion struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + Arn *string `type:"string"` + + // The time that this dashboard version was created. + CreatedTime *time.Time `type:"timestamp"` + + // Description. + Description *string `min:"1" type:"string"` + + // Errors. + Errors []*DashboardError `min:"1" type:"list"` + + // Source entity ARN. + SourceEntityArn *string `type:"string"` + + // The HTTP status of the request. + Status *string `type:"string" enum:"ResourceStatus"` + + // Version number. + VersionNumber *int64 `min:"1" type:"long"` +} + +// String returns the string representation +func (s DashboardVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DashboardVersion) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DashboardVersion) SetArn(v string) *DashboardVersion { + s.Arn = &v + return s +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *DashboardVersion) SetCreatedTime(v time.Time) *DashboardVersion { + s.CreatedTime = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *DashboardVersion) SetDescription(v string) *DashboardVersion { + s.Description = &v + return s +} + +// SetErrors sets the Errors field's value. +func (s *DashboardVersion) SetErrors(v []*DashboardError) *DashboardVersion { + s.Errors = v + return s +} + +// SetSourceEntityArn sets the SourceEntityArn field's value. +func (s *DashboardVersion) SetSourceEntityArn(v string) *DashboardVersion { + s.SourceEntityArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DashboardVersion) SetStatus(v string) *DashboardVersion { + s.Status = &v + return s +} + +// SetVersionNumber sets the VersionNumber field's value. +func (s *DashboardVersion) SetVersionNumber(v int64) *DashboardVersion { + s.VersionNumber = &v + return s +} + +// Dashboard version summary. +type DashboardVersionSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + Arn *string `type:"string"` + + // The time that this dashboard version was created. + CreatedTime *time.Time `type:"timestamp"` + + // Description. + Description *string `min:"1" type:"string"` + + // Source entity ARN. + SourceEntityArn *string `type:"string"` + + // The HTTP status of the request. + Status *string `type:"string" enum:"ResourceStatus"` + + // Version number. + VersionNumber *int64 `min:"1" type:"long"` +} + +// String returns the string representation +func (s DashboardVersionSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DashboardVersionSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DashboardVersionSummary) SetArn(v string) *DashboardVersionSummary { + s.Arn = &v + return s +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *DashboardVersionSummary) SetCreatedTime(v time.Time) *DashboardVersionSummary { + s.CreatedTime = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *DashboardVersionSummary) SetDescription(v string) *DashboardVersionSummary { + s.Description = &v + return s +} + +// SetSourceEntityArn sets the SourceEntityArn field's value. +func (s *DashboardVersionSummary) SetSourceEntityArn(v string) *DashboardVersionSummary { + s.SourceEntityArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DashboardVersionSummary) SetStatus(v string) *DashboardVersionSummary { + s.Status = &v + return s +} + +// SetVersionNumber sets the VersionNumber field's value. +func (s *DashboardVersionSummary) SetVersionNumber(v int64) *DashboardVersionSummary { + s.VersionNumber = &v + return s +} + +// Dataset. +type DataSet struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + Arn *string `type:"string"` + + // Groupings of columns that work together in certain Amazon QuickSight features. + // Currently, only geospatial hierarchy is supported. + ColumnGroups []*ColumnGroup `min:"1" type:"list"` + + // The amount of SPICE capacity used by this dataset. This is 0 if the dataset + // isn't imported into SPICE. + ConsumedSpiceCapacityInBytes *int64 `type:"long"` + + // The time that this dataset was created. + CreatedTime *time.Time `type:"timestamp"` + + // The ID of the dataset. + DataSetId *string `type:"string"` + + // Indicates whether you want to import the data into SPICE. + ImportMode *string `type:"string" enum:"DataSetImportMode"` + + // The last time that this dataset was updated. + LastUpdatedTime *time.Time `type:"timestamp"` + + // Configures the combination and transformation of the data from the physical + // tables. + LogicalTableMap map[string]*LogicalTable `min:"1" type:"map"` + + // A display name for the dataset. + Name *string `min:"1" type:"string"` + + // The list of columns after all transforms. These columns are available in + // templates, analyses, and dashboards. + OutputColumns []*OutputColumn `type:"list"` + + // Declares the physical tables that are available in the underlying data sources. + PhysicalTableMap map[string]*PhysicalTable `min:"1" type:"map"` + + // The row-level security configuration for the dataset. + RowLevelPermissionDataSet *RowLevelPermissionDataSet `type:"structure"` +} + +// String returns the string representation +func (s DataSet) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataSet) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DataSet) SetArn(v string) *DataSet { + s.Arn = &v + return s +} + +// SetColumnGroups sets the ColumnGroups field's value. +func (s *DataSet) SetColumnGroups(v []*ColumnGroup) *DataSet { + s.ColumnGroups = v + return s +} + +// SetConsumedSpiceCapacityInBytes sets the ConsumedSpiceCapacityInBytes field's value. +func (s *DataSet) SetConsumedSpiceCapacityInBytes(v int64) *DataSet { + s.ConsumedSpiceCapacityInBytes = &v + return s +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *DataSet) SetCreatedTime(v time.Time) *DataSet { + s.CreatedTime = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *DataSet) SetDataSetId(v string) *DataSet { + s.DataSetId = &v + return s +} + +// SetImportMode sets the ImportMode field's value. +func (s *DataSet) SetImportMode(v string) *DataSet { + s.ImportMode = &v + return s +} + +// SetLastUpdatedTime sets the LastUpdatedTime field's value. +func (s *DataSet) SetLastUpdatedTime(v time.Time) *DataSet { + s.LastUpdatedTime = &v + return s +} + +// SetLogicalTableMap sets the LogicalTableMap field's value. +func (s *DataSet) SetLogicalTableMap(v map[string]*LogicalTable) *DataSet { + s.LogicalTableMap = v + return s +} + +// SetName sets the Name field's value. +func (s *DataSet) SetName(v string) *DataSet { + s.Name = &v + return s +} + +// SetOutputColumns sets the OutputColumns field's value. +func (s *DataSet) SetOutputColumns(v []*OutputColumn) *DataSet { + s.OutputColumns = v + return s +} + +// SetPhysicalTableMap sets the PhysicalTableMap field's value. +func (s *DataSet) SetPhysicalTableMap(v map[string]*PhysicalTable) *DataSet { + s.PhysicalTableMap = v + return s +} + +// SetRowLevelPermissionDataSet sets the RowLevelPermissionDataSet field's value. +func (s *DataSet) SetRowLevelPermissionDataSet(v *RowLevelPermissionDataSet) *DataSet { + s.RowLevelPermissionDataSet = v + return s +} + +// Dataset configuration. +type DataSetConfiguration struct { + _ struct{} `type:"structure"` + + // A structure containing the list of column group schemas. + ColumnGroupSchemaList []*ColumnGroupSchema `type:"list"` + + // Dataset schema. + DataSetSchema *DataSetSchema `type:"structure"` + + // Placeholder. + Placeholder *string `type:"string"` +} + +// String returns the string representation +func (s DataSetConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataSetConfiguration) GoString() string { + return s.String() +} + +// SetColumnGroupSchemaList sets the ColumnGroupSchemaList field's value. +func (s *DataSetConfiguration) SetColumnGroupSchemaList(v []*ColumnGroupSchema) *DataSetConfiguration { + s.ColumnGroupSchemaList = v + return s +} + +// SetDataSetSchema sets the DataSetSchema field's value. +func (s *DataSetConfiguration) SetDataSetSchema(v *DataSetSchema) *DataSetConfiguration { + s.DataSetSchema = v + return s +} + +// SetPlaceholder sets the Placeholder field's value. +func (s *DataSetConfiguration) SetPlaceholder(v string) *DataSetConfiguration { + s.Placeholder = &v + return s +} + +// Dataset reference. +type DataSetReference struct { + _ struct{} `type:"structure"` + + // Dataset Amazon Resource Name (ARN). + // + // DataSetArn is a required field + DataSetArn *string `type:"string" required:"true"` + + // Dataset placeholder. + // + // DataSetPlaceholder is a required field + DataSetPlaceholder *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DataSetReference) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataSetReference) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DataSetReference) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DataSetReference"} + if s.DataSetArn == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetArn")) + } + if s.DataSetPlaceholder == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetPlaceholder")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDataSetArn sets the DataSetArn field's value. +func (s *DataSetReference) SetDataSetArn(v string) *DataSetReference { + s.DataSetArn = &v + return s +} + +// SetDataSetPlaceholder sets the DataSetPlaceholder field's value. +func (s *DataSetReference) SetDataSetPlaceholder(v string) *DataSetReference { + s.DataSetPlaceholder = &v + return s +} + +// Dataset schema. +type DataSetSchema struct { + _ struct{} `type:"structure"` + + // A structure containing the list of column schemas. + ColumnSchemaList []*ColumnSchema `type:"list"` +} + +// String returns the string representation +func (s DataSetSchema) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataSetSchema) GoString() string { + return s.String() +} + +// SetColumnSchemaList sets the ColumnSchemaList field's value. +func (s *DataSetSchema) SetColumnSchemaList(v []*ColumnSchema) *DataSetSchema { + s.ColumnSchemaList = v + return s +} + +// Dataset summary. +type DataSetSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the dataset. + Arn *string `type:"string"` + + // The time that this dataset was created. + CreatedTime *time.Time `type:"timestamp"` + + // The ID of the dataset. + DataSetId *string `type:"string"` + + // Indicates whether you want to import the data into SPICE. + ImportMode *string `type:"string" enum:"DataSetImportMode"` + + // The last time that this dataset was updated. + LastUpdatedTime *time.Time `type:"timestamp"` + + // A display name for the dataset. + Name *string `min:"1" type:"string"` + + // The row-level security configuration for the dataset. + RowLevelPermissionDataSet *RowLevelPermissionDataSet `type:"structure"` +} + +// String returns the string representation +func (s DataSetSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataSetSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DataSetSummary) SetArn(v string) *DataSetSummary { + s.Arn = &v + return s +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *DataSetSummary) SetCreatedTime(v time.Time) *DataSetSummary { + s.CreatedTime = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *DataSetSummary) SetDataSetId(v string) *DataSetSummary { + s.DataSetId = &v + return s +} + +// SetImportMode sets the ImportMode field's value. +func (s *DataSetSummary) SetImportMode(v string) *DataSetSummary { + s.ImportMode = &v + return s +} + +// SetLastUpdatedTime sets the LastUpdatedTime field's value. +func (s *DataSetSummary) SetLastUpdatedTime(v time.Time) *DataSetSummary { + s.LastUpdatedTime = &v + return s +} + +// SetName sets the Name field's value. +func (s *DataSetSummary) SetName(v string) *DataSetSummary { + s.Name = &v + return s +} + +// SetRowLevelPermissionDataSet sets the RowLevelPermissionDataSet field's value. +func (s *DataSetSummary) SetRowLevelPermissionDataSet(v *RowLevelPermissionDataSet) *DataSetSummary { + s.RowLevelPermissionDataSet = v + return s +} + +// The structure of a data source. +type DataSource struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the data source. + Arn *string `type:"string"` + + // The time that this data source was created. + CreatedTime *time.Time `type:"timestamp"` + + // The ID of the data source. This ID is unique per AWS Region for each AWS + // account. + DataSourceId *string `type:"string"` + + // The parameters that Amazon QuickSight uses to connect to your underlying + // source. This is a variant type structure. For this structure to be valid, + // only one of the attributes can be non-null. + DataSourceParameters *DataSourceParameters `type:"structure"` + + // Error information from the last update or the creation of the data source. + ErrorInfo *DataSourceErrorInfo `type:"structure"` + + // The last time that this data source was updated. + LastUpdatedTime *time.Time `type:"timestamp"` + + // A display name for the data source. + Name *string `min:"1" type:"string"` + + // Secure Socket Layer (SSL) properties that apply when QuickSight connects + // to your underlying source. + SslProperties *SslProperties `type:"structure"` + + // The HTTP status of the request. + Status *string `type:"string" enum:"ResourceStatus"` + + // The type of the data source. This type indicates which database engine the + // data source connects to. + Type *string `type:"string" enum:"DataSourceType"` + + // The VPC connection information. You need to use this parameter only when + // you want QuickSight to use a VPC connection when connecting to your underlying + // source. + VpcConnectionProperties *VpcConnectionProperties `type:"structure"` +} + +// 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 +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *DataSource) SetCreatedTime(v time.Time) *DataSource { + s.CreatedTime = &v + return s +} + +// SetDataSourceId sets the DataSourceId field's value. +func (s *DataSource) SetDataSourceId(v string) *DataSource { + s.DataSourceId = &v + return s +} + +// SetDataSourceParameters sets the DataSourceParameters field's value. +func (s *DataSource) SetDataSourceParameters(v *DataSourceParameters) *DataSource { + s.DataSourceParameters = v + return s +} + +// SetErrorInfo sets the ErrorInfo field's value. +func (s *DataSource) SetErrorInfo(v *DataSourceErrorInfo) *DataSource { + s.ErrorInfo = v + return s +} + +// SetLastUpdatedTime sets the LastUpdatedTime field's value. +func (s *DataSource) SetLastUpdatedTime(v time.Time) *DataSource { + s.LastUpdatedTime = &v + return s +} + +// SetName sets the Name field's value. +func (s *DataSource) SetName(v string) *DataSource { + s.Name = &v + return s +} + +// SetSslProperties sets the SslProperties field's value. +func (s *DataSource) SetSslProperties(v *SslProperties) *DataSource { + s.SslProperties = v + return s +} + +// SetStatus sets the Status field's value. +func (s *DataSource) SetStatus(v string) *DataSource { + s.Status = &v + return s +} + +// SetType sets the Type field's value. +func (s *DataSource) SetType(v string) *DataSource { + s.Type = &v + return s +} + +// SetVpcConnectionProperties sets the VpcConnectionProperties field's value. +func (s *DataSource) SetVpcConnectionProperties(v *VpcConnectionProperties) *DataSource { + s.VpcConnectionProperties = v + return s +} + +// Data source credentials. +type DataSourceCredentials struct { + _ struct{} `type:"structure" sensitive:"true"` + + // Credential pair. + CredentialPair *CredentialPair `type:"structure"` +} + +// String returns the string representation +func (s DataSourceCredentials) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataSourceCredentials) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DataSourceCredentials) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DataSourceCredentials"} + if s.CredentialPair != nil { + if err := s.CredentialPair.Validate(); err != nil { + invalidParams.AddNested("CredentialPair", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCredentialPair sets the CredentialPair field's value. +func (s *DataSourceCredentials) SetCredentialPair(v *CredentialPair) *DataSourceCredentials { + s.CredentialPair = v + return s +} + +// Error information for the data source creation or update. +type DataSourceErrorInfo struct { + _ struct{} `type:"structure"` + + // Error message. + Message *string `type:"string"` + + // Error type. + Type *string `type:"string" enum:"DataSourceErrorInfoType"` +} + +// String returns the string representation +func (s DataSourceErrorInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataSourceErrorInfo) GoString() string { + return s.String() +} + +// SetMessage sets the Message field's value. +func (s *DataSourceErrorInfo) SetMessage(v string) *DataSourceErrorInfo { + s.Message = &v + return s +} + +// SetType sets the Type field's value. +func (s *DataSourceErrorInfo) SetType(v string) *DataSourceErrorInfo { + s.Type = &v + return s +} + +// The parameters that Amazon QuickSight uses to connect to your underlying +// data source. This is a variant type structure. For this structure to be valid, +// only one of the attributes can be non-null. +type DataSourceParameters struct { + _ struct{} `type:"structure"` + + // Amazon Elasticsearch Service parameters. + AmazonElasticsearchParameters *AmazonElasticsearchParameters `type:"structure"` + + // Amazon Athena parameters. + AthenaParameters *AthenaParameters `type:"structure"` + + // Amazon Aurora MySQL parameters. + AuroraParameters *AuroraParameters `type:"structure"` + + // Aurora PostgreSQL parameters. + AuroraPostgreSqlParameters *AuroraPostgreSqlParameters `type:"structure"` + + // AWS IoT Analytics parameters. + AwsIotAnalyticsParameters *AwsIotAnalyticsParameters `type:"structure"` + + // Jira parameters. + JiraParameters *JiraParameters `type:"structure"` + + // MariaDB parameters. + MariaDbParameters *MariaDbParameters `type:"structure"` + + // MySQL parameters. + MySqlParameters *MySqlParameters `type:"structure"` + + // PostgreSQL parameters. + PostgreSqlParameters *PostgreSqlParameters `type:"structure"` + + // Presto parameters. + PrestoParameters *PrestoParameters `type:"structure"` + + // Amazon RDS parameters. + RdsParameters *RdsParameters `type:"structure"` + + // Amazon Redshift parameters. + RedshiftParameters *RedshiftParameters `type:"structure"` + + // S3 parameters. + S3Parameters *S3Parameters `type:"structure"` + + // ServiceNow parameters. + ServiceNowParameters *ServiceNowParameters `type:"structure"` + + // Snowflake parameters. + SnowflakeParameters *SnowflakeParameters `type:"structure"` + + // Spark parameters. + SparkParameters *SparkParameters `type:"structure"` + + // SQL Server parameters. + SqlServerParameters *SqlServerParameters `type:"structure"` + + // Teradata parameters. + TeradataParameters *TeradataParameters `type:"structure"` + + // Twitter parameters. + TwitterParameters *TwitterParameters `type:"structure"` +} + +// String returns the string representation +func (s DataSourceParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataSourceParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DataSourceParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DataSourceParameters"} + if s.AmazonElasticsearchParameters != nil { + if err := s.AmazonElasticsearchParameters.Validate(); err != nil { + invalidParams.AddNested("AmazonElasticsearchParameters", err.(request.ErrInvalidParams)) + } + } + if s.AthenaParameters != nil { + if err := s.AthenaParameters.Validate(); err != nil { + invalidParams.AddNested("AthenaParameters", err.(request.ErrInvalidParams)) + } + } + if s.AuroraParameters != nil { + if err := s.AuroraParameters.Validate(); err != nil { + invalidParams.AddNested("AuroraParameters", err.(request.ErrInvalidParams)) + } + } + if s.AuroraPostgreSqlParameters != nil { + if err := s.AuroraPostgreSqlParameters.Validate(); err != nil { + invalidParams.AddNested("AuroraPostgreSqlParameters", err.(request.ErrInvalidParams)) + } + } + if s.AwsIotAnalyticsParameters != nil { + if err := s.AwsIotAnalyticsParameters.Validate(); err != nil { + invalidParams.AddNested("AwsIotAnalyticsParameters", err.(request.ErrInvalidParams)) + } + } + if s.JiraParameters != nil { + if err := s.JiraParameters.Validate(); err != nil { + invalidParams.AddNested("JiraParameters", err.(request.ErrInvalidParams)) + } + } + if s.MariaDbParameters != nil { + if err := s.MariaDbParameters.Validate(); err != nil { + invalidParams.AddNested("MariaDbParameters", err.(request.ErrInvalidParams)) + } + } + if s.MySqlParameters != nil { + if err := s.MySqlParameters.Validate(); err != nil { + invalidParams.AddNested("MySqlParameters", err.(request.ErrInvalidParams)) + } + } + if s.PostgreSqlParameters != nil { + if err := s.PostgreSqlParameters.Validate(); err != nil { + invalidParams.AddNested("PostgreSqlParameters", err.(request.ErrInvalidParams)) + } + } + if s.PrestoParameters != nil { + if err := s.PrestoParameters.Validate(); err != nil { + invalidParams.AddNested("PrestoParameters", err.(request.ErrInvalidParams)) + } + } + if s.RdsParameters != nil { + if err := s.RdsParameters.Validate(); err != nil { + invalidParams.AddNested("RdsParameters", err.(request.ErrInvalidParams)) + } + } + if s.RedshiftParameters != nil { + if err := s.RedshiftParameters.Validate(); err != nil { + invalidParams.AddNested("RedshiftParameters", err.(request.ErrInvalidParams)) + } + } + if s.S3Parameters != nil { + if err := s.S3Parameters.Validate(); err != nil { + invalidParams.AddNested("S3Parameters", err.(request.ErrInvalidParams)) + } + } + if s.ServiceNowParameters != nil { + if err := s.ServiceNowParameters.Validate(); err != nil { + invalidParams.AddNested("ServiceNowParameters", err.(request.ErrInvalidParams)) + } + } + if s.SnowflakeParameters != nil { + if err := s.SnowflakeParameters.Validate(); err != nil { + invalidParams.AddNested("SnowflakeParameters", err.(request.ErrInvalidParams)) + } + } + if s.SparkParameters != nil { + if err := s.SparkParameters.Validate(); err != nil { + invalidParams.AddNested("SparkParameters", err.(request.ErrInvalidParams)) + } + } + if s.SqlServerParameters != nil { + if err := s.SqlServerParameters.Validate(); err != nil { + invalidParams.AddNested("SqlServerParameters", err.(request.ErrInvalidParams)) + } + } + if s.TeradataParameters != nil { + if err := s.TeradataParameters.Validate(); err != nil { + invalidParams.AddNested("TeradataParameters", err.(request.ErrInvalidParams)) + } + } + if s.TwitterParameters != nil { + if err := s.TwitterParameters.Validate(); err != nil { + invalidParams.AddNested("TwitterParameters", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAmazonElasticsearchParameters sets the AmazonElasticsearchParameters field's value. +func (s *DataSourceParameters) SetAmazonElasticsearchParameters(v *AmazonElasticsearchParameters) *DataSourceParameters { + s.AmazonElasticsearchParameters = v + return s +} + +// SetAthenaParameters sets the AthenaParameters field's value. +func (s *DataSourceParameters) SetAthenaParameters(v *AthenaParameters) *DataSourceParameters { + s.AthenaParameters = v + return s +} + +// SetAuroraParameters sets the AuroraParameters field's value. +func (s *DataSourceParameters) SetAuroraParameters(v *AuroraParameters) *DataSourceParameters { + s.AuroraParameters = v + return s +} + +// SetAuroraPostgreSqlParameters sets the AuroraPostgreSqlParameters field's value. +func (s *DataSourceParameters) SetAuroraPostgreSqlParameters(v *AuroraPostgreSqlParameters) *DataSourceParameters { + s.AuroraPostgreSqlParameters = v + return s +} + +// SetAwsIotAnalyticsParameters sets the AwsIotAnalyticsParameters field's value. +func (s *DataSourceParameters) SetAwsIotAnalyticsParameters(v *AwsIotAnalyticsParameters) *DataSourceParameters { + s.AwsIotAnalyticsParameters = v + return s +} + +// SetJiraParameters sets the JiraParameters field's value. +func (s *DataSourceParameters) SetJiraParameters(v *JiraParameters) *DataSourceParameters { + s.JiraParameters = v + return s +} + +// SetMariaDbParameters sets the MariaDbParameters field's value. +func (s *DataSourceParameters) SetMariaDbParameters(v *MariaDbParameters) *DataSourceParameters { + s.MariaDbParameters = v + return s +} + +// SetMySqlParameters sets the MySqlParameters field's value. +func (s *DataSourceParameters) SetMySqlParameters(v *MySqlParameters) *DataSourceParameters { + s.MySqlParameters = v + return s +} + +// SetPostgreSqlParameters sets the PostgreSqlParameters field's value. +func (s *DataSourceParameters) SetPostgreSqlParameters(v *PostgreSqlParameters) *DataSourceParameters { + s.PostgreSqlParameters = v + return s +} + +// SetPrestoParameters sets the PrestoParameters field's value. +func (s *DataSourceParameters) SetPrestoParameters(v *PrestoParameters) *DataSourceParameters { + s.PrestoParameters = v + return s +} + +// SetRdsParameters sets the RdsParameters field's value. +func (s *DataSourceParameters) SetRdsParameters(v *RdsParameters) *DataSourceParameters { + s.RdsParameters = v + return s +} + +// SetRedshiftParameters sets the RedshiftParameters field's value. +func (s *DataSourceParameters) SetRedshiftParameters(v *RedshiftParameters) *DataSourceParameters { + s.RedshiftParameters = v + return s +} + +// SetS3Parameters sets the S3Parameters field's value. +func (s *DataSourceParameters) SetS3Parameters(v *S3Parameters) *DataSourceParameters { + s.S3Parameters = v + return s +} + +// SetServiceNowParameters sets the ServiceNowParameters field's value. +func (s *DataSourceParameters) SetServiceNowParameters(v *ServiceNowParameters) *DataSourceParameters { + s.ServiceNowParameters = v + return s +} + +// SetSnowflakeParameters sets the SnowflakeParameters field's value. +func (s *DataSourceParameters) SetSnowflakeParameters(v *SnowflakeParameters) *DataSourceParameters { + s.SnowflakeParameters = v + return s +} + +// SetSparkParameters sets the SparkParameters field's value. +func (s *DataSourceParameters) SetSparkParameters(v *SparkParameters) *DataSourceParameters { + s.SparkParameters = v + return s +} + +// SetSqlServerParameters sets the SqlServerParameters field's value. +func (s *DataSourceParameters) SetSqlServerParameters(v *SqlServerParameters) *DataSourceParameters { + s.SqlServerParameters = v + return s +} + +// SetTeradataParameters sets the TeradataParameters field's value. +func (s *DataSourceParameters) SetTeradataParameters(v *TeradataParameters) *DataSourceParameters { + s.TeradataParameters = v + return s +} + +// SetTwitterParameters sets the TwitterParameters field's value. +func (s *DataSourceParameters) SetTwitterParameters(v *TwitterParameters) *DataSourceParameters { + s.TwitterParameters = v + return s +} + +// Date time parameter. +type DateTimeParameter struct { + _ struct{} `type:"structure"` + + // A display name for the dataset. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // Values. + // + // Values is a required field + Values []*time.Time `type:"list" required:"true"` +} + +// String returns the string representation +func (s DateTimeParameter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DateTimeParameter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DateTimeParameter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DateTimeParameter"} + 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 *DateTimeParameter) SetName(v string) *DateTimeParameter { + s.Name = &v + return s +} + +// SetValues sets the Values field's value. +func (s *DateTimeParameter) SetValues(v []*time.Time) *DateTimeParameter { + s.Values = v + return s +} + +// Decimal parameter. +type DecimalParameter struct { + _ struct{} `type:"structure"` + + // A display name for the dataset. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // Values. + // + // Values is a required field + Values []*float64 `type:"list" required:"true"` +} + +// String returns the string representation +func (s DecimalParameter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DecimalParameter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DecimalParameter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DecimalParameter"} + 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 *DecimalParameter) SetName(v string) *DecimalParameter { + s.Name = &v + return s +} + +// SetValues sets the Values field's value. +func (s *DecimalParameter) SetValues(v []*float64) *DecimalParameter { + s.Values = v + return s +} + +type DeleteDashboardInput struct { + _ struct{} `type:"structure"` + + // The ID of the AWS account that contains the dashboard that you're deleting. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID for the dashboard. + // + // DashboardId is a required field + DashboardId *string `location:"uri" locationName:"DashboardId" min:"1" type:"string" required:"true"` + + // The version number of the dashboard. If the version number property is provided, + // only the specified version of the dashboard is deleted. + VersionNumber *int64 `location:"querystring" locationName:"version-number" min:"1" type:"long"` +} + +// String returns the string representation +func (s DeleteDashboardInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDashboardInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteDashboardInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteDashboardInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DashboardId == nil { + invalidParams.Add(request.NewErrParamRequired("DashboardId")) + } + if s.DashboardId != nil && len(*s.DashboardId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DashboardId", 1)) + } + if s.VersionNumber != nil && *s.VersionNumber < 1 { + invalidParams.Add(request.NewErrParamMinValue("VersionNumber", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DeleteDashboardInput) SetAwsAccountId(v string) *DeleteDashboardInput { + s.AwsAccountId = &v + return s +} + +// SetDashboardId sets the DashboardId field's value. +func (s *DeleteDashboardInput) SetDashboardId(v string) *DeleteDashboardInput { + s.DashboardId = &v + return s +} + +// SetVersionNumber sets the VersionNumber field's value. +func (s *DeleteDashboardInput) SetVersionNumber(v int64) *DeleteDashboardInput { + s.VersionNumber = &v + return s +} + +type DeleteDashboardOutput struct { + _ struct{} `type:"structure"` + + // The Secure Socket Layer (SSL) properties that apply for the resource. + Arn *string `type:"string"` + + // The ID of the dashboard. + DashboardId *string `min:"1" type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s DeleteDashboardOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDashboardOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DeleteDashboardOutput) SetArn(v string) *DeleteDashboardOutput { + s.Arn = &v + return s +} + +// SetDashboardId sets the DashboardId field's value. +func (s *DeleteDashboardOutput) SetDashboardId(v string) *DeleteDashboardOutput { + s.DashboardId = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteDashboardOutput) SetRequestId(v string) *DeleteDashboardOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DeleteDashboardOutput) SetStatus(v int64) *DeleteDashboardOutput { + s.Status = &v + return s +} + +type DeleteDataSetInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID for the dataset that you want to create. This ID is unique per AWS + // Region for each AWS account. + // + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteDataSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDataSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteDataSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteDataSetInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DeleteDataSetInput) SetAwsAccountId(v string) *DeleteDataSetInput { + s.AwsAccountId = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *DeleteDataSetInput) SetDataSetId(v string) *DeleteDataSetInput { + s.DataSetId = &v + return s +} + +type DeleteDataSetOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the dataset. + Arn *string `type:"string"` + + // The ID for the dataset that you want to create. This ID is unique per AWS + // Region for each AWS account. + DataSetId *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s DeleteDataSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDataSetOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DeleteDataSetOutput) SetArn(v string) *DeleteDataSetOutput { + s.Arn = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *DeleteDataSetOutput) SetDataSetId(v string) *DeleteDataSetOutput { + s.DataSetId = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteDataSetOutput) SetRequestId(v string) *DeleteDataSetOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DeleteDataSetOutput) SetStatus(v int64) *DeleteDataSetOutput { + s.Status = &v + return s +} + +type DeleteDataSourceInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID of the data source. This ID is unique per AWS Region for each AWS + // account. + // + // DataSourceId is a required field + DataSourceId *string `location:"uri" locationName:"DataSourceId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteDataSourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDataSourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteDataSourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteDataSourceInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DataSourceId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSourceId")) + } + if s.DataSourceId != nil && len(*s.DataSourceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DeleteDataSourceInput) SetAwsAccountId(v string) *DeleteDataSourceInput { + s.AwsAccountId = &v + return s +} + +// SetDataSourceId sets the DataSourceId field's value. +func (s *DeleteDataSourceInput) SetDataSourceId(v string) *DeleteDataSourceInput { + s.DataSourceId = &v + return s +} + +type DeleteDataSourceOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the data source that you deleted. + Arn *string `type:"string"` + + // The ID of the data source. This ID is unique per AWS Region for each AWS + // account. + DataSourceId *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s DeleteDataSourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDataSourceOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DeleteDataSourceOutput) SetArn(v string) *DeleteDataSourceOutput { + s.Arn = &v + return s +} + +// SetDataSourceId sets the DataSourceId field's value. +func (s *DeleteDataSourceOutput) SetDataSourceId(v string) *DeleteDataSourceOutput { + s.DataSourceId = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteDataSourceOutput) SetRequestId(v string) *DeleteDataSourceOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DeleteDataSourceOutput) SetStatus(v int64) *DeleteDataSourceOutput { + s.Status = &v + return s +} + +type DeleteGroupInput struct { + _ struct{} `type:"structure"` + + // The ID for the AWS account that the group is in. Currently, you use the ID + // for the AWS account that contains your Amazon QuickSight account. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The name of the group that you want to delete. + // + // GroupName is a required field + GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"` + + // The namespace. Currently, you should set this to default. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" 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.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + 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.Namespace == nil { + invalidParams.Add(request.NewErrParamRequired("Namespace")) + } + if s.Namespace != nil && len(*s.Namespace) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DeleteGroupInput) SetAwsAccountId(v string) *DeleteGroupInput { + s.AwsAccountId = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *DeleteGroupInput) SetGroupName(v string) *DeleteGroupInput { + s.GroupName = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *DeleteGroupInput) SetNamespace(v string) *DeleteGroupInput { + s.Namespace = &v + return s +} + +type DeleteGroupMembershipInput struct { + _ struct{} `type:"structure"` + + // The ID for the AWS account that the group is in. Currently, you use the ID + // for the AWS account that contains your Amazon QuickSight account. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The name of the group that you want to delete the user from. + // + // GroupName is a required field + GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"` + + // The name of the user that you want to delete from the group membership. + // + // MemberName is a required field + MemberName *string `location:"uri" locationName:"MemberName" min:"1" type:"string" required:"true"` + + // The namespace. Currently, you should set this to default. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteGroupMembershipInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteGroupMembershipInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteGroupMembershipInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteGroupMembershipInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + 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.MemberName == nil { + invalidParams.Add(request.NewErrParamRequired("MemberName")) + } + if s.MemberName != nil && len(*s.MemberName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MemberName", 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 invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DeleteGroupMembershipInput) SetAwsAccountId(v string) *DeleteGroupMembershipInput { + s.AwsAccountId = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *DeleteGroupMembershipInput) SetGroupName(v string) *DeleteGroupMembershipInput { + s.GroupName = &v + return s +} + +// SetMemberName sets the MemberName field's value. +func (s *DeleteGroupMembershipInput) SetMemberName(v string) *DeleteGroupMembershipInput { + s.MemberName = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *DeleteGroupMembershipInput) SetNamespace(v string) *DeleteGroupMembershipInput { + s.Namespace = &v + return s +} + +type DeleteGroupMembershipOutput struct { + _ struct{} `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s DeleteGroupMembershipOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteGroupMembershipOutput) GoString() string { + return s.String() +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteGroupMembershipOutput) SetRequestId(v string) *DeleteGroupMembershipOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DeleteGroupMembershipOutput) SetStatus(v int64) *DeleteGroupMembershipOutput { + s.Status = &v + return s +} + +type DeleteGroupOutput struct { + _ struct{} `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// 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() +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteGroupOutput) SetRequestId(v string) *DeleteGroupOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DeleteGroupOutput) SetStatus(v int64) *DeleteGroupOutput { + s.Status = &v + return s +} + +type DeleteIAMPolicyAssignmentInput struct { + _ struct{} `type:"structure"` + + // The name of the assignment. + // + // AssignmentName is a required field + AssignmentName *string `location:"uri" locationName:"AssignmentName" min:"1" type:"string" required:"true"` + + // The AWS account ID where you want to delete the IAM policy assignment. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The namespace that contains the assignment. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteIAMPolicyAssignmentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteIAMPolicyAssignmentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteIAMPolicyAssignmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteIAMPolicyAssignmentInput"} + if s.AssignmentName == nil { + invalidParams.Add(request.NewErrParamRequired("AssignmentName")) + } + if s.AssignmentName != nil && len(*s.AssignmentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AssignmentName", 1)) + } + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.Namespace == nil { + invalidParams.Add(request.NewErrParamRequired("Namespace")) + } + if s.Namespace != nil && len(*s.Namespace) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssignmentName sets the AssignmentName field's value. +func (s *DeleteIAMPolicyAssignmentInput) SetAssignmentName(v string) *DeleteIAMPolicyAssignmentInput { + s.AssignmentName = &v + return s +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DeleteIAMPolicyAssignmentInput) SetAwsAccountId(v string) *DeleteIAMPolicyAssignmentInput { + s.AwsAccountId = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *DeleteIAMPolicyAssignmentInput) SetNamespace(v string) *DeleteIAMPolicyAssignmentInput { + s.Namespace = &v + return s +} + +type DeleteIAMPolicyAssignmentOutput struct { + _ struct{} `type:"structure"` + + // The name of the assignment. + AssignmentName *string `min:"1" type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s DeleteIAMPolicyAssignmentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteIAMPolicyAssignmentOutput) GoString() string { + return s.String() +} + +// SetAssignmentName sets the AssignmentName field's value. +func (s *DeleteIAMPolicyAssignmentOutput) SetAssignmentName(v string) *DeleteIAMPolicyAssignmentOutput { + s.AssignmentName = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteIAMPolicyAssignmentOutput) SetRequestId(v string) *DeleteIAMPolicyAssignmentOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DeleteIAMPolicyAssignmentOutput) SetStatus(v int64) *DeleteIAMPolicyAssignmentOutput { + s.Status = &v + return s +} + +type DeleteTemplateAliasInput struct { + _ struct{} `type:"structure"` + + // The name for the template alias. If you name a specific alias, you delete + // the version that the alias points to. You can specify the latest version + // of the template by providing the keyword $LATEST in the AliasName parameter. + // + // AliasName is a required field + AliasName *string `location:"uri" locationName:"AliasName" min:"1" type:"string" required:"true"` + + // The ID of the AWS account that contains the item to delete. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID for the template that the specified alias is for. + // + // TemplateId is a required field + TemplateId *string `location:"uri" locationName:"TemplateId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteTemplateAliasInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTemplateAliasInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteTemplateAliasInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTemplateAliasInput"} + 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.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.TemplateId == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateId")) + } + if s.TemplateId != nil && len(*s.TemplateId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAliasName sets the AliasName field's value. +func (s *DeleteTemplateAliasInput) SetAliasName(v string) *DeleteTemplateAliasInput { + s.AliasName = &v + return s +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DeleteTemplateAliasInput) SetAwsAccountId(v string) *DeleteTemplateAliasInput { + s.AwsAccountId = &v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *DeleteTemplateAliasInput) SetTemplateId(v string) *DeleteTemplateAliasInput { + s.TemplateId = &v + return s +} + +type DeleteTemplateAliasOutput struct { + _ struct{} `type:"structure"` + + // The name for the template alias. + AliasName *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the resource. + Arn *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` + + // An ID for the template associated with the deletion. + TemplateId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DeleteTemplateAliasOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTemplateAliasOutput) GoString() string { + return s.String() +} + +// SetAliasName sets the AliasName field's value. +func (s *DeleteTemplateAliasOutput) SetAliasName(v string) *DeleteTemplateAliasOutput { + s.AliasName = &v + return s +} + +// SetArn sets the Arn field's value. +func (s *DeleteTemplateAliasOutput) SetArn(v string) *DeleteTemplateAliasOutput { + s.Arn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteTemplateAliasOutput) SetRequestId(v string) *DeleteTemplateAliasOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DeleteTemplateAliasOutput) SetStatus(v int64) *DeleteTemplateAliasOutput { + s.Status = &v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *DeleteTemplateAliasOutput) SetTemplateId(v string) *DeleteTemplateAliasOutput { + s.TemplateId = &v + return s +} + +type DeleteTemplateInput struct { + _ struct{} `type:"structure"` + + // The ID of the AWS account that contains the template that you're deleting. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // An ID for the template you want to delete. + // + // TemplateId is a required field + TemplateId *string `location:"uri" locationName:"TemplateId" min:"1" type:"string" required:"true"` + + // Specifies the version of the template that you want to delete. If you don't + // provide a version number, DeleteTemplate deletes all versions of the template. + VersionNumber *int64 `location:"querystring" locationName:"version-number" min:"1" type:"long"` +} + +// String returns the string representation +func (s DeleteTemplateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTemplateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTemplateInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.TemplateId == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateId")) + } + if s.TemplateId != nil && len(*s.TemplateId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) + } + if s.VersionNumber != nil && *s.VersionNumber < 1 { + invalidParams.Add(request.NewErrParamMinValue("VersionNumber", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DeleteTemplateInput) SetAwsAccountId(v string) *DeleteTemplateInput { + s.AwsAccountId = &v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *DeleteTemplateInput) SetTemplateId(v string) *DeleteTemplateInput { + s.TemplateId = &v + return s +} + +// SetVersionNumber sets the VersionNumber field's value. +func (s *DeleteTemplateInput) SetVersionNumber(v int64) *DeleteTemplateInput { + s.VersionNumber = &v + return s +} + +type DeleteTemplateOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + Arn *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` + + // An ID for the template. + TemplateId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DeleteTemplateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTemplateOutput) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *DeleteTemplateOutput) SetArn(v string) *DeleteTemplateOutput { + s.Arn = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteTemplateOutput) SetRequestId(v string) *DeleteTemplateOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DeleteTemplateOutput) SetStatus(v int64) *DeleteTemplateOutput { + s.Status = &v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *DeleteTemplateOutput) SetTemplateId(v string) *DeleteTemplateOutput { + s.TemplateId = &v + return s +} + +type DeleteUserByPrincipalIdInput struct { + _ struct{} `type:"structure"` + + // The ID for the AWS account that the user is in. Currently, you use the ID + // for the AWS account that contains your Amazon QuickSight account. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The namespace. Currently, you should set this to default. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + + // The principal ID of the user. + // + // PrincipalId is a required field + PrincipalId *string `location:"uri" locationName:"PrincipalId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteUserByPrincipalIdInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteUserByPrincipalIdInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteUserByPrincipalIdInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteUserByPrincipalIdInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + 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.PrincipalId == nil { + invalidParams.Add(request.NewErrParamRequired("PrincipalId")) + } + if s.PrincipalId != nil && len(*s.PrincipalId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PrincipalId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DeleteUserByPrincipalIdInput) SetAwsAccountId(v string) *DeleteUserByPrincipalIdInput { + s.AwsAccountId = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *DeleteUserByPrincipalIdInput) SetNamespace(v string) *DeleteUserByPrincipalIdInput { + s.Namespace = &v + return s +} + +// SetPrincipalId sets the PrincipalId field's value. +func (s *DeleteUserByPrincipalIdInput) SetPrincipalId(v string) *DeleteUserByPrincipalIdInput { + s.PrincipalId = &v + return s +} + +type DeleteUserByPrincipalIdOutput struct { + _ struct{} `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s DeleteUserByPrincipalIdOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteUserByPrincipalIdOutput) GoString() string { + return s.String() +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteUserByPrincipalIdOutput) SetRequestId(v string) *DeleteUserByPrincipalIdOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DeleteUserByPrincipalIdOutput) SetStatus(v int64) *DeleteUserByPrincipalIdOutput { + s.Status = &v + return s +} + +type DeleteUserInput struct { + _ struct{} `type:"structure"` + + // The ID for the AWS account that the user is in. Currently, you use the ID + // for the AWS account that contains your Amazon QuickSight account. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The namespace. Currently, you should set this to default. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + + // The name of the user that you want to delete. + // + // UserName is a required field + UserName *string `location:"uri" locationName:"UserName" 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.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + 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.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 +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DeleteUserInput) SetAwsAccountId(v string) *DeleteUserInput { + s.AwsAccountId = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *DeleteUserInput) SetNamespace(v string) *DeleteUserInput { + s.Namespace = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *DeleteUserInput) SetUserName(v string) *DeleteUserInput { + s.UserName = &v + return s +} + +type DeleteUserOutput struct { + _ struct{} `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// 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() +} + +// SetRequestId sets the RequestId field's value. +func (s *DeleteUserOutput) SetRequestId(v string) *DeleteUserOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DeleteUserOutput) SetStatus(v int64) *DeleteUserOutput { + s.Status = &v + return s +} + +type DescribeDashboardInput struct { + _ struct{} `type:"structure"` + + // The alias name. + AliasName *string `location:"querystring" locationName:"alias-name" min:"1" type:"string"` + + // The ID of the AWS account that contains the dashboard that you're describing. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID for the dashboard. + // + // DashboardId is a required field + DashboardId *string `location:"uri" locationName:"DashboardId" min:"1" type:"string" required:"true"` + + // The version number for the dashboard. If a version number isn't passed, the + // latest published dashboard version is described. + VersionNumber *int64 `location:"querystring" locationName:"version-number" min:"1" type:"long"` +} + +// String returns the string representation +func (s DescribeDashboardInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDashboardInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeDashboardInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeDashboardInput"} + if s.AliasName != nil && len(*s.AliasName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AliasName", 1)) + } + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DashboardId == nil { + invalidParams.Add(request.NewErrParamRequired("DashboardId")) + } + if s.DashboardId != nil && len(*s.DashboardId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DashboardId", 1)) + } + if s.VersionNumber != nil && *s.VersionNumber < 1 { + invalidParams.Add(request.NewErrParamMinValue("VersionNumber", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAliasName sets the AliasName field's value. +func (s *DescribeDashboardInput) SetAliasName(v string) *DescribeDashboardInput { + s.AliasName = &v + return s +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DescribeDashboardInput) SetAwsAccountId(v string) *DescribeDashboardInput { + s.AwsAccountId = &v + return s +} + +// SetDashboardId sets the DashboardId field's value. +func (s *DescribeDashboardInput) SetDashboardId(v string) *DescribeDashboardInput { + s.DashboardId = &v + return s +} + +// SetVersionNumber sets the VersionNumber field's value. +func (s *DescribeDashboardInput) SetVersionNumber(v int64) *DescribeDashboardInput { + s.VersionNumber = &v + return s +} + +type DescribeDashboardOutput struct { + _ struct{} `type:"structure"` + + // Information about the dashboard. + Dashboard *Dashboard `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of this request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s DescribeDashboardOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDashboardOutput) GoString() string { + return s.String() +} + +// SetDashboard sets the Dashboard field's value. +func (s *DescribeDashboardOutput) SetDashboard(v *Dashboard) *DescribeDashboardOutput { + s.Dashboard = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DescribeDashboardOutput) SetRequestId(v string) *DescribeDashboardOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeDashboardOutput) SetStatus(v int64) *DescribeDashboardOutput { + s.Status = &v + return s +} + +type DescribeDashboardPermissionsInput struct { + _ struct{} `type:"structure"` + + // The ID of the AWS account that contains the dashboard that you're describing + // permissions for. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID for the dashboard, also added to the IAM policy. + // + // DashboardId is a required field + DashboardId *string `location:"uri" locationName:"DashboardId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeDashboardPermissionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDashboardPermissionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeDashboardPermissionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeDashboardPermissionsInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DashboardId == nil { + invalidParams.Add(request.NewErrParamRequired("DashboardId")) + } + if s.DashboardId != nil && len(*s.DashboardId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DashboardId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DescribeDashboardPermissionsInput) SetAwsAccountId(v string) *DescribeDashboardPermissionsInput { + s.AwsAccountId = &v + return s +} + +// SetDashboardId sets the DashboardId field's value. +func (s *DescribeDashboardPermissionsInput) SetDashboardId(v string) *DescribeDashboardPermissionsInput { + s.DashboardId = &v + return s +} + +type DescribeDashboardPermissionsOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the dashboard. + DashboardArn *string `type:"string"` + + // The ID for the dashboard. + DashboardId *string `min:"1" type:"string"` + + // A structure that contains the permissions for the dashboard. + Permissions []*ResourcePermission `min:"1" type:"list"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s DescribeDashboardPermissionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDashboardPermissionsOutput) GoString() string { + return s.String() +} + +// SetDashboardArn sets the DashboardArn field's value. +func (s *DescribeDashboardPermissionsOutput) SetDashboardArn(v string) *DescribeDashboardPermissionsOutput { + s.DashboardArn = &v + return s +} + +// SetDashboardId sets the DashboardId field's value. +func (s *DescribeDashboardPermissionsOutput) SetDashboardId(v string) *DescribeDashboardPermissionsOutput { + s.DashboardId = &v + return s +} + +// SetPermissions sets the Permissions field's value. +func (s *DescribeDashboardPermissionsOutput) SetPermissions(v []*ResourcePermission) *DescribeDashboardPermissionsOutput { + s.Permissions = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DescribeDashboardPermissionsOutput) SetRequestId(v string) *DescribeDashboardPermissionsOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeDashboardPermissionsOutput) SetStatus(v int64) *DescribeDashboardPermissionsOutput { + s.Status = &v + return s +} + +type DescribeDataSetInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID for the dataset that you want to create. This ID is unique per AWS + // Region for each AWS account. + // + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeDataSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDataSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeDataSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeDataSetInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DescribeDataSetInput) SetAwsAccountId(v string) *DescribeDataSetInput { + s.AwsAccountId = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *DescribeDataSetInput) SetDataSetId(v string) *DescribeDataSetInput { + s.DataSetId = &v + return s +} + +type DescribeDataSetOutput struct { + _ struct{} `type:"structure"` + + // Information on the dataset. + DataSet *DataSet `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s DescribeDataSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDataSetOutput) GoString() string { + return s.String() +} + +// SetDataSet sets the DataSet field's value. +func (s *DescribeDataSetOutput) SetDataSet(v *DataSet) *DescribeDataSetOutput { + s.DataSet = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DescribeDataSetOutput) SetRequestId(v string) *DescribeDataSetOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeDataSetOutput) SetStatus(v int64) *DescribeDataSetOutput { + s.Status = &v + return s +} + +type DescribeDataSetPermissionsInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID for the dataset that you want to create. This ID is unique per AWS + // Region for each AWS account. + // + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeDataSetPermissionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDataSetPermissionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeDataSetPermissionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeDataSetPermissionsInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DescribeDataSetPermissionsInput) SetAwsAccountId(v string) *DescribeDataSetPermissionsInput { + s.AwsAccountId = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *DescribeDataSetPermissionsInput) SetDataSetId(v string) *DescribeDataSetPermissionsInput { + s.DataSetId = &v + return s +} + +type DescribeDataSetPermissionsOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the dataset. + DataSetArn *string `type:"string"` + + // The ID for the dataset that you want to create. This ID is unique per AWS + // Region for each AWS account. + DataSetId *string `type:"string"` + + // A list of resource permissions on the dataset. + Permissions []*ResourcePermission `min:"1" type:"list"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s DescribeDataSetPermissionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDataSetPermissionsOutput) GoString() string { + return s.String() +} + +// SetDataSetArn sets the DataSetArn field's value. +func (s *DescribeDataSetPermissionsOutput) SetDataSetArn(v string) *DescribeDataSetPermissionsOutput { + s.DataSetArn = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *DescribeDataSetPermissionsOutput) SetDataSetId(v string) *DescribeDataSetPermissionsOutput { + s.DataSetId = &v + return s +} + +// SetPermissions sets the Permissions field's value. +func (s *DescribeDataSetPermissionsOutput) SetPermissions(v []*ResourcePermission) *DescribeDataSetPermissionsOutput { + s.Permissions = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DescribeDataSetPermissionsOutput) SetRequestId(v string) *DescribeDataSetPermissionsOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeDataSetPermissionsOutput) SetStatus(v int64) *DescribeDataSetPermissionsOutput { + s.Status = &v + return s +} + +type DescribeDataSourceInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID of the data source. This ID is unique per AWS Region for each AWS + // account. + // + // DataSourceId is a required field + DataSourceId *string `location:"uri" locationName:"DataSourceId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeDataSourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDataSourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeDataSourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeDataSourceInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DataSourceId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSourceId")) + } + if s.DataSourceId != nil && len(*s.DataSourceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DescribeDataSourceInput) SetAwsAccountId(v string) *DescribeDataSourceInput { + s.AwsAccountId = &v + return s +} + +// SetDataSourceId sets the DataSourceId field's value. +func (s *DescribeDataSourceInput) SetDataSourceId(v string) *DescribeDataSourceInput { + s.DataSourceId = &v + return s +} + +type DescribeDataSourceOutput struct { + _ struct{} `type:"structure"` + + // The information on the data source. + DataSource *DataSource `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s DescribeDataSourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDataSourceOutput) GoString() string { + return s.String() +} + +// SetDataSource sets the DataSource field's value. +func (s *DescribeDataSourceOutput) SetDataSource(v *DataSource) *DescribeDataSourceOutput { + s.DataSource = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DescribeDataSourceOutput) SetRequestId(v string) *DescribeDataSourceOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeDataSourceOutput) SetStatus(v int64) *DescribeDataSourceOutput { + s.Status = &v + return s +} + +type DescribeDataSourcePermissionsInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID of the data source. This ID is unique per AWS Region for each AWS + // account. + // + // DataSourceId is a required field + DataSourceId *string `location:"uri" locationName:"DataSourceId" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeDataSourcePermissionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDataSourcePermissionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeDataSourcePermissionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeDataSourcePermissionsInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DataSourceId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSourceId")) + } + if s.DataSourceId != nil && len(*s.DataSourceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DescribeDataSourcePermissionsInput) SetAwsAccountId(v string) *DescribeDataSourcePermissionsInput { + s.AwsAccountId = &v + return s +} + +// SetDataSourceId sets the DataSourceId field's value. +func (s *DescribeDataSourcePermissionsInput) SetDataSourceId(v string) *DescribeDataSourcePermissionsInput { + s.DataSourceId = &v + return s +} + +type DescribeDataSourcePermissionsOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the data source. + DataSourceArn *string `type:"string"` + + // The ID of the data source. This ID is unique per AWS Region for each AWS + // account. + DataSourceId *string `type:"string"` + + // A list of resource permissions on the data source. + Permissions []*ResourcePermission `min:"1" type:"list"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s DescribeDataSourcePermissionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDataSourcePermissionsOutput) GoString() string { + return s.String() +} + +// SetDataSourceArn sets the DataSourceArn field's value. +func (s *DescribeDataSourcePermissionsOutput) SetDataSourceArn(v string) *DescribeDataSourcePermissionsOutput { + s.DataSourceArn = &v + return s +} + +// SetDataSourceId sets the DataSourceId field's value. +func (s *DescribeDataSourcePermissionsOutput) SetDataSourceId(v string) *DescribeDataSourcePermissionsOutput { + s.DataSourceId = &v + return s +} + +// SetPermissions sets the Permissions field's value. +func (s *DescribeDataSourcePermissionsOutput) SetPermissions(v []*ResourcePermission) *DescribeDataSourcePermissionsOutput { + s.Permissions = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DescribeDataSourcePermissionsOutput) SetRequestId(v string) *DescribeDataSourcePermissionsOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeDataSourcePermissionsOutput) SetStatus(v int64) *DescribeDataSourcePermissionsOutput { + s.Status = &v + return s +} + +type DescribeGroupInput struct { + _ struct{} `type:"structure"` + + // The ID for the AWS account that the group is in. Currently, you use the ID + // for the AWS account that contains your Amazon QuickSight account. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The name of the group that you want to describe. + // + // GroupName is a required field + GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"` + + // The namespace. Currently, you should set this to default. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeGroupInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + 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.Namespace == nil { + invalidParams.Add(request.NewErrParamRequired("Namespace")) + } + if s.Namespace != nil && len(*s.Namespace) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DescribeGroupInput) SetAwsAccountId(v string) *DescribeGroupInput { + s.AwsAccountId = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *DescribeGroupInput) SetGroupName(v string) *DescribeGroupInput { + s.GroupName = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *DescribeGroupInput) SetNamespace(v string) *DescribeGroupInput { + s.Namespace = &v + return s +} + +type DescribeGroupOutput struct { + _ struct{} `type:"structure"` + + // The name of the group. + Group *Group `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s DescribeGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeGroupOutput) GoString() string { + return s.String() +} + +// SetGroup sets the Group field's value. +func (s *DescribeGroupOutput) SetGroup(v *Group) *DescribeGroupOutput { + s.Group = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DescribeGroupOutput) SetRequestId(v string) *DescribeGroupOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeGroupOutput) SetStatus(v int64) *DescribeGroupOutput { + s.Status = &v + return s +} + +type DescribeIAMPolicyAssignmentInput struct { + _ struct{} `type:"structure"` + + // The name of the assignment. + // + // AssignmentName is a required field + AssignmentName *string `location:"uri" locationName:"AssignmentName" min:"1" type:"string" required:"true"` + + // The ID of the AWS account that contains the assignment that you want to describe. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The namespace that contains the assignment. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeIAMPolicyAssignmentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeIAMPolicyAssignmentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeIAMPolicyAssignmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeIAMPolicyAssignmentInput"} + if s.AssignmentName == nil { + invalidParams.Add(request.NewErrParamRequired("AssignmentName")) + } + if s.AssignmentName != nil && len(*s.AssignmentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AssignmentName", 1)) + } + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.Namespace == nil { + invalidParams.Add(request.NewErrParamRequired("Namespace")) + } + if s.Namespace != nil && len(*s.Namespace) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssignmentName sets the AssignmentName field's value. +func (s *DescribeIAMPolicyAssignmentInput) SetAssignmentName(v string) *DescribeIAMPolicyAssignmentInput { + s.AssignmentName = &v + return s +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DescribeIAMPolicyAssignmentInput) SetAwsAccountId(v string) *DescribeIAMPolicyAssignmentInput { + s.AwsAccountId = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *DescribeIAMPolicyAssignmentInput) SetNamespace(v string) *DescribeIAMPolicyAssignmentInput { + s.Namespace = &v + return s +} + +type DescribeIAMPolicyAssignmentOutput struct { + _ struct{} `type:"structure"` + + // Information describing the IAM policy assignment. + IAMPolicyAssignment *IAMPolicyAssignment `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s DescribeIAMPolicyAssignmentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeIAMPolicyAssignmentOutput) GoString() string { + return s.String() +} + +// SetIAMPolicyAssignment sets the IAMPolicyAssignment field's value. +func (s *DescribeIAMPolicyAssignmentOutput) SetIAMPolicyAssignment(v *IAMPolicyAssignment) *DescribeIAMPolicyAssignmentOutput { + s.IAMPolicyAssignment = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DescribeIAMPolicyAssignmentOutput) SetRequestId(v string) *DescribeIAMPolicyAssignmentOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeIAMPolicyAssignmentOutput) SetStatus(v int64) *DescribeIAMPolicyAssignmentOutput { + s.Status = &v + return s +} + +type DescribeIngestionInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID of the dataset used in the ingestion. + // + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` + + // An ID for the ingestion. + // + // IngestionId is a required field + IngestionId *string `location:"uri" locationName:"IngestionId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeIngestionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeIngestionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeIngestionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeIngestionInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) + } + if s.IngestionId == nil { + invalidParams.Add(request.NewErrParamRequired("IngestionId")) + } + if s.IngestionId != nil && len(*s.IngestionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("IngestionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DescribeIngestionInput) SetAwsAccountId(v string) *DescribeIngestionInput { + s.AwsAccountId = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *DescribeIngestionInput) SetDataSetId(v string) *DescribeIngestionInput { + s.DataSetId = &v + return s +} + +// SetIngestionId sets the IngestionId field's value. +func (s *DescribeIngestionInput) SetIngestionId(v string) *DescribeIngestionInput { + s.IngestionId = &v + return s +} + +type DescribeIngestionOutput struct { + _ struct{} `type:"structure"` + + // Information about the ingestion. + Ingestion *Ingestion `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s DescribeIngestionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeIngestionOutput) GoString() string { + return s.String() +} + +// SetIngestion sets the Ingestion field's value. +func (s *DescribeIngestionOutput) SetIngestion(v *Ingestion) *DescribeIngestionOutput { + s.Ingestion = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DescribeIngestionOutput) SetRequestId(v string) *DescribeIngestionOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeIngestionOutput) SetStatus(v int64) *DescribeIngestionOutput { + s.Status = &v + return s +} + +type DescribeTemplateAliasInput struct { + _ struct{} `type:"structure"` + + // The name of the template alias that you want to describe. If you name a specific + // alias, you describe the version that the alias points to. You can specify + // the latest version of the template by providing the keyword $LATEST in the + // AliasName parameter. The keyword $PUBLISHED doesn't apply to templates. + // + // AliasName is a required field + AliasName *string `location:"uri" locationName:"AliasName" min:"1" type:"string" required:"true"` + + // The ID of the AWS account that contains the template alias that you're describing. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID for the template. + // + // TemplateId is a required field + TemplateId *string `location:"uri" locationName:"TemplateId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeTemplateAliasInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTemplateAliasInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeTemplateAliasInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTemplateAliasInput"} + 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.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.TemplateId == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateId")) + } + if s.TemplateId != nil && len(*s.TemplateId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAliasName sets the AliasName field's value. +func (s *DescribeTemplateAliasInput) SetAliasName(v string) *DescribeTemplateAliasInput { + s.AliasName = &v + return s +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DescribeTemplateAliasInput) SetAwsAccountId(v string) *DescribeTemplateAliasInput { + s.AwsAccountId = &v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *DescribeTemplateAliasInput) SetTemplateId(v string) *DescribeTemplateAliasInput { + s.TemplateId = &v + return s +} + +type DescribeTemplateAliasOutput struct { + _ struct{} `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` + + // Information about the template alias. + TemplateAlias *TemplateAlias `type:"structure"` +} + +// String returns the string representation +func (s DescribeTemplateAliasOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTemplateAliasOutput) GoString() string { + return s.String() +} + +// SetRequestId sets the RequestId field's value. +func (s *DescribeTemplateAliasOutput) SetRequestId(v string) *DescribeTemplateAliasOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeTemplateAliasOutput) SetStatus(v int64) *DescribeTemplateAliasOutput { + s.Status = &v + return s +} + +// SetTemplateAlias sets the TemplateAlias field's value. +func (s *DescribeTemplateAliasOutput) SetTemplateAlias(v *TemplateAlias) *DescribeTemplateAliasOutput { + s.TemplateAlias = v + return s +} + +type DescribeTemplateInput struct { + _ struct{} `type:"structure"` + + // The alias of the template that you want to describe. If you name a specific + // alias, you describe the version that the alias points to. You can specify + // the latest version of the template by providing the keyword $LATEST in the + // AliasName parameter. The keyword $PUBLISHED doesn't apply to templates. + AliasName *string `location:"querystring" locationName:"alias-name" min:"1" type:"string"` + + // The ID of the AWS account that contains the template that you're describing. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID for the template. + // + // TemplateId is a required field + TemplateId *string `location:"uri" locationName:"TemplateId" min:"1" type:"string" required:"true"` + + // (Optional) The number for the version to describe. If a VersionNumber parameter + // value isn't provided, the latest version of the template is described. + VersionNumber *int64 `location:"querystring" locationName:"version-number" min:"1" type:"long"` +} + +// String returns the string representation +func (s DescribeTemplateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTemplateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTemplateInput"} + if s.AliasName != nil && len(*s.AliasName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AliasName", 1)) + } + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.TemplateId == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateId")) + } + if s.TemplateId != nil && len(*s.TemplateId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) + } + if s.VersionNumber != nil && *s.VersionNumber < 1 { + invalidParams.Add(request.NewErrParamMinValue("VersionNumber", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAliasName sets the AliasName field's value. +func (s *DescribeTemplateInput) SetAliasName(v string) *DescribeTemplateInput { + s.AliasName = &v + return s +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DescribeTemplateInput) SetAwsAccountId(v string) *DescribeTemplateInput { + s.AwsAccountId = &v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *DescribeTemplateInput) SetTemplateId(v string) *DescribeTemplateInput { + s.TemplateId = &v + return s +} + +// SetVersionNumber sets the VersionNumber field's value. +func (s *DescribeTemplateInput) SetVersionNumber(v int64) *DescribeTemplateInput { + s.VersionNumber = &v + return s +} + +type DescribeTemplateOutput struct { + _ struct{} `type:"structure"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` + + // The template structure for the object you want to describe. + Template *Template `type:"structure"` +} + +// String returns the string representation +func (s DescribeTemplateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTemplateOutput) GoString() string { + return s.String() +} + +// SetStatus sets the Status field's value. +func (s *DescribeTemplateOutput) SetStatus(v int64) *DescribeTemplateOutput { + s.Status = &v + return s +} + +// SetTemplate sets the Template field's value. +func (s *DescribeTemplateOutput) SetTemplate(v *Template) *DescribeTemplateOutput { + s.Template = v + return s +} + +type DescribeTemplatePermissionsInput struct { + _ struct{} `type:"structure"` + + // The ID of the AWS account that contains the template that you're describing. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID for the template. + // + // TemplateId is a required field + TemplateId *string `location:"uri" locationName:"TemplateId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeTemplatePermissionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTemplatePermissionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeTemplatePermissionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTemplatePermissionsInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.TemplateId == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateId")) + } + if s.TemplateId != nil && len(*s.TemplateId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DescribeTemplatePermissionsInput) SetAwsAccountId(v string) *DescribeTemplatePermissionsInput { + s.AwsAccountId = &v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *DescribeTemplatePermissionsInput) SetTemplateId(v string) *DescribeTemplatePermissionsInput { + s.TemplateId = &v + return s +} + +type DescribeTemplatePermissionsOutput struct { + _ struct{} `type:"structure"` + + // A list of resource permissions to be set on the template. + Permissions []*ResourcePermission `min:"1" type:"list"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` + + // The Amazon Resource Name (ARN) of the template. + TemplateArn *string `type:"string"` + + // The ID for the template. + TemplateId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DescribeTemplatePermissionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTemplatePermissionsOutput) GoString() string { + return s.String() +} + +// SetPermissions sets the Permissions field's value. +func (s *DescribeTemplatePermissionsOutput) SetPermissions(v []*ResourcePermission) *DescribeTemplatePermissionsOutput { + s.Permissions = v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *DescribeTemplatePermissionsOutput) SetRequestId(v string) *DescribeTemplatePermissionsOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeTemplatePermissionsOutput) SetStatus(v int64) *DescribeTemplatePermissionsOutput { + s.Status = &v + return s +} + +// SetTemplateArn sets the TemplateArn field's value. +func (s *DescribeTemplatePermissionsOutput) SetTemplateArn(v string) *DescribeTemplatePermissionsOutput { + s.TemplateArn = &v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *DescribeTemplatePermissionsOutput) SetTemplateId(v string) *DescribeTemplatePermissionsOutput { + s.TemplateId = &v + return s +} + +type DescribeUserInput struct { + _ struct{} `type:"structure"` + + // The ID for the AWS account that the user is in. Currently, you use the ID + // for the AWS account that contains your Amazon QuickSight account. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The namespace. Currently, you should set this to default. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + + // The name of the user that you want to describe. + // + // UserName is a required field + UserName *string `location:"uri" locationName:"UserName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeUserInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeUserInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeUserInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeUserInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + 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.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 +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *DescribeUserInput) SetAwsAccountId(v string) *DescribeUserInput { + s.AwsAccountId = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *DescribeUserInput) SetNamespace(v string) *DescribeUserInput { + s.Namespace = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *DescribeUserInput) SetUserName(v string) *DescribeUserInput { + s.UserName = &v + return s +} + +type DescribeUserOutput struct { + _ struct{} `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` + + // The user name. + User *User `type:"structure"` +} + +// String returns the string representation +func (s DescribeUserOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeUserOutput) GoString() string { + return s.String() +} + +// SetRequestId sets the RequestId field's value. +func (s *DescribeUserOutput) SetRequestId(v string) *DescribeUserOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeUserOutput) SetStatus(v int64) *DescribeUserOutput { + s.Status = &v + return s +} + +// SetUser sets the User field's value. +func (s *DescribeUserOutput) SetUser(v *User) *DescribeUserOutput { + s.User = v + return s +} + +// The domain specified isn't on the allow list. All domains for embedded dashboards +// must be added to the approved list by an Amazon QuickSight admin. +type DomainNotWhitelistedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request ID for this request. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s DomainNotWhitelistedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DomainNotWhitelistedException) GoString() string { + return s.String() +} + +func newErrorDomainNotWhitelistedException(v protocol.ResponseMetadata) error { + return &DomainNotWhitelistedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DomainNotWhitelistedException) Code() string { + return "DomainNotWhitelistedException" +} + +// Message returns the exception's message. +func (s DomainNotWhitelistedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DomainNotWhitelistedException) OrigErr() error { + return nil +} + +func (s DomainNotWhitelistedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DomainNotWhitelistedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DomainNotWhitelistedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Error information for the SPICE ingestion of a dataset. +type ErrorInfo struct { + _ struct{} `type:"structure"` + + // Error message. + Message *string `type:"string"` + + // Error type. + Type *string `type:"string" enum:"IngestionErrorType"` +} + +// String returns the string representation +func (s ErrorInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ErrorInfo) GoString() string { + return s.String() +} + +// SetMessage sets the Message field's value. +func (s *ErrorInfo) SetMessage(v string) *ErrorInfo { + s.Message = &v + return s +} + +// SetType sets the Type field's value. +func (s *ErrorInfo) SetType(v string) *ErrorInfo { + s.Type = &v + return s +} + +// Export to .csv option. +type ExportToCSVOption struct { + _ struct{} `type:"structure"` + + // Availability status. + AvailabilityStatus *string `type:"string" enum:"DashboardBehavior"` +} + +// String returns the string representation +func (s ExportToCSVOption) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExportToCSVOption) GoString() string { + return s.String() +} + +// SetAvailabilityStatus sets the AvailabilityStatus field's value. +func (s *ExportToCSVOption) SetAvailabilityStatus(v string) *ExportToCSVOption { + s.AvailabilityStatus = &v + return s +} + +// A transform operation that filters rows based on a condition. +type FilterOperation struct { + _ struct{} `type:"structure"` + + // An expression that must evaluate to a Boolean value. Rows for which the expression + // evaluates to true are kept in the dataset. + // + // ConditionExpression is a required field + ConditionExpression *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s FilterOperation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FilterOperation) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *FilterOperation) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "FilterOperation"} + if s.ConditionExpression == nil { + invalidParams.Add(request.NewErrParamRequired("ConditionExpression")) + } + if s.ConditionExpression != nil && len(*s.ConditionExpression) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ConditionExpression", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConditionExpression sets the ConditionExpression field's value. +func (s *FilterOperation) SetConditionExpression(v string) *FilterOperation { + s.ConditionExpression = &v + return s +} + +// Geospatial column group that denotes a hierarchy. +type GeoSpatialColumnGroup struct { + _ struct{} `type:"structure"` + + // Columns in this hierarchy. + // + // Columns is a required field + Columns []*string `min:"1" type:"list" required:"true"` + + // Country code. + // + // CountryCode is a required field + CountryCode *string `type:"string" required:"true" enum:"GeoSpatialCountryCode"` + + // A display name for the hierarchy. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GeoSpatialColumnGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GeoSpatialColumnGroup) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GeoSpatialColumnGroup) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GeoSpatialColumnGroup"} + if s.Columns == nil { + invalidParams.Add(request.NewErrParamRequired("Columns")) + } + if s.Columns != nil && len(s.Columns) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Columns", 1)) + } + if s.CountryCode == nil { + invalidParams.Add(request.NewErrParamRequired("CountryCode")) + } + 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 +} + +// SetColumns sets the Columns field's value. +func (s *GeoSpatialColumnGroup) SetColumns(v []*string) *GeoSpatialColumnGroup { + s.Columns = v + return s +} + +// SetCountryCode sets the CountryCode field's value. +func (s *GeoSpatialColumnGroup) SetCountryCode(v string) *GeoSpatialColumnGroup { + s.CountryCode = &v + return s +} + +// SetName sets the Name field's value. +func (s *GeoSpatialColumnGroup) SetName(v string) *GeoSpatialColumnGroup { + s.Name = &v + return s +} + +type GetDashboardEmbedUrlInput struct { + _ struct{} `type:"structure"` + + // The ID for the AWS account that contains the dashboard that you're embedding. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID for the dashboard, also added to the IAM policy. + // + // DashboardId is a required field + DashboardId *string `location:"uri" locationName:"DashboardId" min:"1" type:"string" required:"true"` + + // The authentication method that the user uses to sign in. + // + // IdentityType is a required field + IdentityType *string `location:"querystring" locationName:"creds-type" type:"string" required:"true" enum:"IdentityType"` + + // Remove the reset button on the embedded dashboard. The default is FALSE, + // which enables the reset button. + ResetDisabled *bool `location:"querystring" locationName:"reset-disabled" type:"boolean"` + + // How many minutes the session is valid. The session lifetime must be 15-600 + // minutes. + SessionLifetimeInMinutes *int64 `location:"querystring" locationName:"session-lifetime" min:"15" type:"long"` + + // Remove the undo/redo button on the embedded dashboard. The default is FALSE, + // which enables the undo/redo button. + UndoRedoDisabled *bool `location:"querystring" locationName:"undo-redo-disabled" type:"boolean"` + + // The Amazon QuickSight user's Amazon Resource Name (ARN), for use with QUICKSIGHT + // identity type. You can use this for any Amazon QuickSight users in your account + // (readers, authors, or admins) authenticated as one of the following: + // + // * Active Directory (AD) users or group members + // + // * Invited nonfederated users + // + // * IAM users and IAM role-based sessions authenticated through Federated + // Single Sign-On using SAML, OpenID Connect, or IAM federation. + UserArn *string `location:"querystring" locationName:"user-arn" type:"string"` +} + +// String returns the string representation +func (s GetDashboardEmbedUrlInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDashboardEmbedUrlInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetDashboardEmbedUrlInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetDashboardEmbedUrlInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DashboardId == nil { + invalidParams.Add(request.NewErrParamRequired("DashboardId")) + } + if s.DashboardId != nil && len(*s.DashboardId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DashboardId", 1)) + } + if s.IdentityType == nil { + invalidParams.Add(request.NewErrParamRequired("IdentityType")) + } + if s.SessionLifetimeInMinutes != nil && *s.SessionLifetimeInMinutes < 15 { + invalidParams.Add(request.NewErrParamMinValue("SessionLifetimeInMinutes", 15)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *GetDashboardEmbedUrlInput) SetAwsAccountId(v string) *GetDashboardEmbedUrlInput { + s.AwsAccountId = &v + return s +} + +// SetDashboardId sets the DashboardId field's value. +func (s *GetDashboardEmbedUrlInput) SetDashboardId(v string) *GetDashboardEmbedUrlInput { + s.DashboardId = &v + return s +} + +// SetIdentityType sets the IdentityType field's value. +func (s *GetDashboardEmbedUrlInput) SetIdentityType(v string) *GetDashboardEmbedUrlInput { + s.IdentityType = &v + return s +} + +// SetResetDisabled sets the ResetDisabled field's value. +func (s *GetDashboardEmbedUrlInput) SetResetDisabled(v bool) *GetDashboardEmbedUrlInput { + s.ResetDisabled = &v + return s +} + +// SetSessionLifetimeInMinutes sets the SessionLifetimeInMinutes field's value. +func (s *GetDashboardEmbedUrlInput) SetSessionLifetimeInMinutes(v int64) *GetDashboardEmbedUrlInput { + s.SessionLifetimeInMinutes = &v + return s +} + +// SetUndoRedoDisabled sets the UndoRedoDisabled field's value. +func (s *GetDashboardEmbedUrlInput) SetUndoRedoDisabled(v bool) *GetDashboardEmbedUrlInput { + s.UndoRedoDisabled = &v + return s +} + +// SetUserArn sets the UserArn field's value. +func (s *GetDashboardEmbedUrlInput) SetUserArn(v string) *GetDashboardEmbedUrlInput { + s.UserArn = &v + return s +} + +type GetDashboardEmbedUrlOutput struct { + _ struct{} `type:"structure"` + + // An URL that you can put into your server-side webpage to embed your dashboard. + // This URL is valid for 5 minutes, and the resulting session is valid for 10 + // hours. The API provides the URL with an auth_code value that enables a single + // sign-on session. + EmbedUrl *string `type:"string" sensitive:"true"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s GetDashboardEmbedUrlOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetDashboardEmbedUrlOutput) GoString() string { + return s.String() +} + +// SetEmbedUrl sets the EmbedUrl field's value. +func (s *GetDashboardEmbedUrlOutput) SetEmbedUrl(v string) *GetDashboardEmbedUrlOutput { + s.EmbedUrl = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *GetDashboardEmbedUrlOutput) SetRequestId(v string) *GetDashboardEmbedUrlOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *GetDashboardEmbedUrlOutput) SetStatus(v int64) *GetDashboardEmbedUrlOutput { + s.Status = &v + return s +} + +// A group in Amazon QuickSight consists of a set of users. You can use groups +// to make it easier to manage access and security. Currently, an Amazon QuickSight +// subscription can't contain more than 500 Amazon QuickSight groups. +type Group struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) for the group. + Arn *string `type:"string"` + + // The group description. + Description *string `min:"1" type:"string"` + + // The name of the group. + GroupName *string `min:"1" type:"string"` + + // The principal ID of the group. + PrincipalId *string `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() +} + +// SetArn sets the Arn field's value. +func (s *Group) SetArn(v string) *Group { + s.Arn = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *Group) SetDescription(v string) *Group { + s.Description = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *Group) SetGroupName(v string) *Group { + s.GroupName = &v + return s +} + +// SetPrincipalId sets the PrincipalId field's value. +func (s *Group) SetPrincipalId(v string) *Group { + s.PrincipalId = &v + return s +} + +// A member of an Amazon QuickSight group. Currently, group members must be +// users. Groups can't be members of another group. . +type GroupMember struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) for the group member (user). + Arn *string `type:"string"` + + // The name of the group member (user). + MemberName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s GroupMember) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GroupMember) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *GroupMember) SetArn(v string) *GroupMember { + s.Arn = &v + return s +} + +// SetMemberName sets the MemberName field's value. +func (s *GroupMember) SetMemberName(v string) *GroupMember { + s.MemberName = &v + return s +} + +// An IAM policy assignment. +type IAMPolicyAssignment struct { + _ struct{} `type:"structure"` + + // Assignment ID. + AssignmentId *string `type:"string"` + + // Assignment name. + AssignmentName *string `min:"1" type:"string"` + + // Assignment status. + AssignmentStatus *string `type:"string" enum:"AssignmentStatus"` + + // The AWS account ID. + AwsAccountId *string `min:"12" type:"string"` + + // Identities. + Identities map[string][]*string `type:"map"` + + // The Amazon Resource Name (ARN) for the IAM policy. + PolicyArn *string `type:"string"` +} + +// String returns the string representation +func (s IAMPolicyAssignment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IAMPolicyAssignment) GoString() string { + return s.String() +} + +// SetAssignmentId sets the AssignmentId field's value. +func (s *IAMPolicyAssignment) SetAssignmentId(v string) *IAMPolicyAssignment { + s.AssignmentId = &v + return s +} + +// SetAssignmentName sets the AssignmentName field's value. +func (s *IAMPolicyAssignment) SetAssignmentName(v string) *IAMPolicyAssignment { + s.AssignmentName = &v + return s +} + +// SetAssignmentStatus sets the AssignmentStatus field's value. +func (s *IAMPolicyAssignment) SetAssignmentStatus(v string) *IAMPolicyAssignment { + s.AssignmentStatus = &v + return s +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *IAMPolicyAssignment) SetAwsAccountId(v string) *IAMPolicyAssignment { + s.AwsAccountId = &v + return s +} + +// SetIdentities sets the Identities field's value. +func (s *IAMPolicyAssignment) SetIdentities(v map[string][]*string) *IAMPolicyAssignment { + s.Identities = v + return s +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *IAMPolicyAssignment) SetPolicyArn(v string) *IAMPolicyAssignment { + s.PolicyArn = &v + return s +} + +// IAM policy assignment summary. +type IAMPolicyAssignmentSummary struct { + _ struct{} `type:"structure"` + + // Assignment name. + AssignmentName *string `min:"1" type:"string"` + + // Assignment status. + AssignmentStatus *string `type:"string" enum:"AssignmentStatus"` +} + +// String returns the string representation +func (s IAMPolicyAssignmentSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IAMPolicyAssignmentSummary) GoString() string { + return s.String() +} + +// SetAssignmentName sets the AssignmentName field's value. +func (s *IAMPolicyAssignmentSummary) SetAssignmentName(v string) *IAMPolicyAssignmentSummary { + s.AssignmentName = &v + return s +} + +// SetAssignmentStatus sets the AssignmentStatus field's value. +func (s *IAMPolicyAssignmentSummary) SetAssignmentStatus(v string) *IAMPolicyAssignmentSummary { + s.AssignmentStatus = &v + return s +} + +// The identity type specified isn't supported. Supported identity types include +// IAM and QUICKSIGHT. +type IdentityTypeNotSupportedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request ID for this request. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s IdentityTypeNotSupportedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IdentityTypeNotSupportedException) GoString() string { + return s.String() +} + +func newErrorIdentityTypeNotSupportedException(v protocol.ResponseMetadata) error { + return &IdentityTypeNotSupportedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IdentityTypeNotSupportedException) Code() string { + return "IdentityTypeNotSupportedException" +} + +// Message returns the exception's message. +func (s IdentityTypeNotSupportedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IdentityTypeNotSupportedException) OrigErr() error { + return nil +} + +func (s IdentityTypeNotSupportedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IdentityTypeNotSupportedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IdentityTypeNotSupportedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about the SPICE ingestion for a dataset. +type Ingestion struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // The time that this ingestion started. + // + // CreatedTime is a required field + CreatedTime *time.Time `type:"timestamp" required:"true"` + + // Error information for this ingestion. + ErrorInfo *ErrorInfo `type:"structure"` + + // Ingestion ID. + IngestionId *string `min:"1" type:"string"` + + // The size of the data ingested, in bytes. + IngestionSizeInBytes *int64 `type:"long"` + + // Ingestion status. + // + // IngestionStatus is a required field + IngestionStatus *string `type:"string" required:"true" enum:"IngestionStatus"` + + // The time that this ingestion took, measured in seconds. + IngestionTimeInSeconds *int64 `type:"long"` + + // Information about a queued dataset SPICE ingestion. + QueueInfo *QueueInfo `type:"structure"` + + // Event source for this ingestion. + RequestSource *string `type:"string" enum:"IngestionRequestSource"` + + // Type of this ingestion. + RequestType *string `type:"string" enum:"IngestionRequestType"` + + // Information about rows for a data set SPICE ingestion. + RowInfo *RowInfo `type:"structure"` +} + +// String returns the string representation +func (s Ingestion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Ingestion) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *Ingestion) SetArn(v string) *Ingestion { + s.Arn = &v + return s +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *Ingestion) SetCreatedTime(v time.Time) *Ingestion { + s.CreatedTime = &v + return s +} + +// SetErrorInfo sets the ErrorInfo field's value. +func (s *Ingestion) SetErrorInfo(v *ErrorInfo) *Ingestion { + s.ErrorInfo = v + return s +} + +// SetIngestionId sets the IngestionId field's value. +func (s *Ingestion) SetIngestionId(v string) *Ingestion { + s.IngestionId = &v + return s +} + +// SetIngestionSizeInBytes sets the IngestionSizeInBytes field's value. +func (s *Ingestion) SetIngestionSizeInBytes(v int64) *Ingestion { + s.IngestionSizeInBytes = &v + return s +} + +// SetIngestionStatus sets the IngestionStatus field's value. +func (s *Ingestion) SetIngestionStatus(v string) *Ingestion { + s.IngestionStatus = &v + return s +} + +// SetIngestionTimeInSeconds sets the IngestionTimeInSeconds field's value. +func (s *Ingestion) SetIngestionTimeInSeconds(v int64) *Ingestion { + s.IngestionTimeInSeconds = &v + return s +} + +// SetQueueInfo sets the QueueInfo field's value. +func (s *Ingestion) SetQueueInfo(v *QueueInfo) *Ingestion { + s.QueueInfo = v + return s +} + +// SetRequestSource sets the RequestSource field's value. +func (s *Ingestion) SetRequestSource(v string) *Ingestion { + s.RequestSource = &v + return s +} + +// SetRequestType sets the RequestType field's value. +func (s *Ingestion) SetRequestType(v string) *Ingestion { + s.RequestType = &v + return s +} + +// SetRowInfo sets the RowInfo field's value. +func (s *Ingestion) SetRowInfo(v *RowInfo) *Ingestion { + s.RowInfo = v + return s +} + +// Metadata for a column that is used as the input of a transform operation. +type InputColumn struct { + _ struct{} `type:"structure"` + + // The name of this column in the underlying data source. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The data type of the column. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"InputColumnDataType"` +} + +// String returns the string representation +func (s InputColumn) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InputColumn) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *InputColumn) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InputColumn"} + 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 *InputColumn) SetName(v string) *InputColumn { + s.Name = &v + return s +} + +// SetType sets the Type field's value. +func (s *InputColumn) SetType(v string) *InputColumn { + s.Type = &v + return s +} + +// Integer parameter. +type IntegerParameter struct { + _ struct{} `type:"structure"` + + // A display name for the dataset. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // Values. + // + // Values is a required field + Values []*int64 `type:"list" required:"true"` +} + +// String returns the string representation +func (s IntegerParameter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IntegerParameter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *IntegerParameter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "IntegerParameter"} + 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 *IntegerParameter) SetName(v string) *IntegerParameter { + s.Name = &v + return s +} + +// SetValues sets the Values field's value. +func (s *IntegerParameter) SetValues(v []*int64) *IntegerParameter { + s.Values = v + return s +} + +// An internal failure occurred. +type InternalFailureException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request ID for this request. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s InternalFailureException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalFailureException) GoString() string { + return s.String() +} + +func newErrorInternalFailureException(v protocol.ResponseMetadata) error { + return &InternalFailureException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalFailureException) Code() string { + return "InternalFailureException" +} + +// Message returns the exception's message. +func (s InternalFailureException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalFailureException) OrigErr() error { + return nil +} + +func (s InternalFailureException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalFailureException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalFailureException) RequestID() string { + return s.respMetadata.RequestID +} + +// The NextToken value isn't valid. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request ID for this request. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s InvalidNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNextTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more parameters has a value that isn't valid. +type InvalidParameterValueException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request ID for this request. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s InvalidParameterValueException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterValueException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterValueException(v protocol.ResponseMetadata) error { + return &InvalidParameterValueException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterValueException) Code() string { + return "InvalidParameterValueException" +} + +// Message returns the exception's message. +func (s InvalidParameterValueException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterValueException) OrigErr() error { + return nil +} + +func (s InvalidParameterValueException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterValueException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterValueException) RequestID() string { + return s.respMetadata.RequestID +} + +// Jira parameters. +type JiraParameters struct { + _ struct{} `type:"structure"` + + // The base URL of the Jira site. + // + // SiteBaseUrl is a required field + SiteBaseUrl *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s JiraParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s JiraParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *JiraParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "JiraParameters"} + if s.SiteBaseUrl == nil { + invalidParams.Add(request.NewErrParamRequired("SiteBaseUrl")) + } + if s.SiteBaseUrl != nil && len(*s.SiteBaseUrl) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SiteBaseUrl", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSiteBaseUrl sets the SiteBaseUrl field's value. +func (s *JiraParameters) SetSiteBaseUrl(v string) *JiraParameters { + s.SiteBaseUrl = &v + return s +} + +// Join instruction. +type JoinInstruction struct { + _ struct{} `type:"structure"` + + // Left operand. + // + // LeftOperand is a required field + LeftOperand *string `min:"1" type:"string" required:"true"` + + // On Clause. + // + // OnClause is a required field + OnClause *string `min:"1" type:"string" required:"true"` + + // Right operand. + // + // RightOperand is a required field + RightOperand *string `min:"1" type:"string" required:"true"` + + // Type. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"JoinType"` +} + +// String returns the string representation +func (s JoinInstruction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s JoinInstruction) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *JoinInstruction) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "JoinInstruction"} + if s.LeftOperand == nil { + invalidParams.Add(request.NewErrParamRequired("LeftOperand")) + } + if s.LeftOperand != nil && len(*s.LeftOperand) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LeftOperand", 1)) + } + if s.OnClause == nil { + invalidParams.Add(request.NewErrParamRequired("OnClause")) + } + if s.OnClause != nil && len(*s.OnClause) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OnClause", 1)) + } + if s.RightOperand == nil { + invalidParams.Add(request.NewErrParamRequired("RightOperand")) + } + if s.RightOperand != nil && len(*s.RightOperand) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RightOperand", 1)) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLeftOperand sets the LeftOperand field's value. +func (s *JoinInstruction) SetLeftOperand(v string) *JoinInstruction { + s.LeftOperand = &v + return s +} + +// SetOnClause sets the OnClause field's value. +func (s *JoinInstruction) SetOnClause(v string) *JoinInstruction { + s.OnClause = &v + return s +} + +// SetRightOperand sets the RightOperand field's value. +func (s *JoinInstruction) SetRightOperand(v string) *JoinInstruction { + s.RightOperand = &v + return s +} + +// SetType sets the Type field's value. +func (s *JoinInstruction) SetType(v string) *JoinInstruction { + s.Type = &v + return s +} + +// A limit is exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request ID for this request. + RequestId *string `type:"string"` + + // Limit exceeded. + ResourceType *string `type:"string" enum:"ExceptionResourceType"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +type ListDashboardVersionsInput struct { + _ struct{} `type:"structure"` + + // The ID of the AWS account that contains the dashboard that you're listing + // versions for. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID for the dashboard. + // + // DashboardId is a required field + DashboardId *string `location:"uri" locationName:"DashboardId" min:"1" type:"string" required:"true"` + + // The maximum number of results to be returned per request. + MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` +} + +// String returns the string representation +func (s ListDashboardVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDashboardVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListDashboardVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListDashboardVersionsInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DashboardId == nil { + invalidParams.Add(request.NewErrParamRequired("DashboardId")) + } + if s.DashboardId != nil && len(*s.DashboardId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DashboardId", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *ListDashboardVersionsInput) SetAwsAccountId(v string) *ListDashboardVersionsInput { + s.AwsAccountId = &v + return s +} + +// SetDashboardId sets the DashboardId field's value. +func (s *ListDashboardVersionsInput) SetDashboardId(v string) *ListDashboardVersionsInput { + s.DashboardId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListDashboardVersionsInput) SetMaxResults(v int64) *ListDashboardVersionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDashboardVersionsInput) SetNextToken(v string) *ListDashboardVersionsInput { + s.NextToken = &v + return s +} + +type ListDashboardVersionsOutput struct { + _ struct{} `type:"structure"` + + // A structure that contains information about each version of the dashboard. + DashboardVersionSummaryList []*DashboardVersionSummary `type:"list"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s ListDashboardVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDashboardVersionsOutput) GoString() string { + return s.String() +} + +// SetDashboardVersionSummaryList sets the DashboardVersionSummaryList field's value. +func (s *ListDashboardVersionsOutput) SetDashboardVersionSummaryList(v []*DashboardVersionSummary) *ListDashboardVersionsOutput { + s.DashboardVersionSummaryList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDashboardVersionsOutput) SetNextToken(v string) *ListDashboardVersionsOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListDashboardVersionsOutput) SetRequestId(v string) *ListDashboardVersionsOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListDashboardVersionsOutput) SetStatus(v int64) *ListDashboardVersionsOutput { + s.Status = &v + return s +} + +type ListDashboardsInput struct { + _ struct{} `type:"structure"` + + // The ID of the AWS account that contains the dashboards that you're listing. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The maximum number of results to be returned per request. + MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` +} + +// String returns the string representation +func (s ListDashboardsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDashboardsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListDashboardsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListDashboardsInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *ListDashboardsInput) SetAwsAccountId(v string) *ListDashboardsInput { + s.AwsAccountId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListDashboardsInput) SetMaxResults(v int64) *ListDashboardsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDashboardsInput) SetNextToken(v string) *ListDashboardsInput { + s.NextToken = &v + return s +} + +type ListDashboardsOutput struct { + _ struct{} `type:"structure"` + + // A structure that contains all of the dashboards shared with the user. This + // structure provides basic information about the dashboards. + DashboardSummaryList []*DashboardSummary `type:"list"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s ListDashboardsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDashboardsOutput) GoString() string { + return s.String() +} + +// SetDashboardSummaryList sets the DashboardSummaryList field's value. +func (s *ListDashboardsOutput) SetDashboardSummaryList(v []*DashboardSummary) *ListDashboardsOutput { + s.DashboardSummaryList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDashboardsOutput) SetNextToken(v string) *ListDashboardsOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListDashboardsOutput) SetRequestId(v string) *ListDashboardsOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListDashboardsOutput) SetStatus(v int64) *ListDashboardsOutput { + s.Status = &v + return s +} + +type ListDataSetsInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The maximum number of results to be returned per request. + MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` +} + +// String returns the string representation +func (s ListDataSetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDataSetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListDataSetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListDataSetsInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *ListDataSetsInput) SetAwsAccountId(v string) *ListDataSetsInput { + s.AwsAccountId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListDataSetsInput) SetMaxResults(v int64) *ListDataSetsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDataSetsInput) SetNextToken(v string) *ListDataSetsInput { + s.NextToken = &v + return s +} + +type ListDataSetsOutput struct { + _ struct{} `type:"structure"` + + // The list of dataset summaries. + DataSetSummaries []*DataSetSummary `type:"list"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s ListDataSetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDataSetsOutput) GoString() string { + return s.String() +} + +// SetDataSetSummaries sets the DataSetSummaries field's value. +func (s *ListDataSetsOutput) SetDataSetSummaries(v []*DataSetSummary) *ListDataSetsOutput { + s.DataSetSummaries = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDataSetsOutput) SetNextToken(v string) *ListDataSetsOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListDataSetsOutput) SetRequestId(v string) *ListDataSetsOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListDataSetsOutput) SetStatus(v int64) *ListDataSetsOutput { + s.Status = &v + return s +} + +type ListDataSourcesInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The maximum number of results to be returned per request. + MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` +} + +// String returns the string representation +func (s ListDataSourcesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDataSourcesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListDataSourcesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListDataSourcesInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *ListDataSourcesInput) SetAwsAccountId(v string) *ListDataSourcesInput { + s.AwsAccountId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListDataSourcesInput) SetMaxResults(v int64) *ListDataSourcesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDataSourcesInput) SetNextToken(v string) *ListDataSourcesInput { + s.NextToken = &v + return s +} + +type ListDataSourcesOutput struct { + _ struct{} `type:"structure"` + + // A list of data sources. + DataSources []*DataSource `type:"list"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s ListDataSourcesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListDataSourcesOutput) GoString() string { + return s.String() +} + +// SetDataSources sets the DataSources field's value. +func (s *ListDataSourcesOutput) SetDataSources(v []*DataSource) *ListDataSourcesOutput { + s.DataSources = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDataSourcesOutput) SetNextToken(v string) *ListDataSourcesOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListDataSourcesOutput) SetRequestId(v string) *ListDataSourcesOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListDataSourcesOutput) SetStatus(v int64) *ListDataSourcesOutput { + s.Status = &v + return s +} + +type ListGroupMembershipsInput struct { + _ struct{} `type:"structure"` + + // The ID for the AWS account that the group is in. Currently, you use the ID + // for the AWS account that contains your Amazon QuickSight account. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The name of the group that you want to see a membership list of. + // + // GroupName is a required field + GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"` + + // The maximum number of results to return from this request. + MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` + + // The namespace. Currently, you should set this to default. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + + // A pagination token that can be used in a subsequent request. + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` +} + +// String returns the string representation +func (s ListGroupMembershipsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGroupMembershipsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListGroupMembershipsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListGroupMembershipsInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + 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.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 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 invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *ListGroupMembershipsInput) SetAwsAccountId(v string) *ListGroupMembershipsInput { + s.AwsAccountId = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *ListGroupMembershipsInput) SetGroupName(v string) *ListGroupMembershipsInput { + s.GroupName = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListGroupMembershipsInput) SetMaxResults(v int64) *ListGroupMembershipsInput { + s.MaxResults = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *ListGroupMembershipsInput) SetNamespace(v string) *ListGroupMembershipsInput { + s.Namespace = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListGroupMembershipsInput) SetNextToken(v string) *ListGroupMembershipsInput { + s.NextToken = &v + return s +} + +type ListGroupMembershipsOutput struct { + _ struct{} `type:"structure"` + + // The list of the members of the group. + GroupMemberList []*GroupMember `type:"list"` + + // A pagination token that can be used in a subsequent request. + NextToken *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s ListGroupMembershipsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGroupMembershipsOutput) GoString() string { + return s.String() +} + +// SetGroupMemberList sets the GroupMemberList field's value. +func (s *ListGroupMembershipsOutput) SetGroupMemberList(v []*GroupMember) *ListGroupMembershipsOutput { + s.GroupMemberList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListGroupMembershipsOutput) SetNextToken(v string) *ListGroupMembershipsOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListGroupMembershipsOutput) SetRequestId(v string) *ListGroupMembershipsOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListGroupMembershipsOutput) SetStatus(v int64) *ListGroupMembershipsOutput { + s.Status = &v + return s +} + +type ListGroupsInput struct { + _ struct{} `type:"structure"` + + // The ID for the AWS account that the group is in. Currently, you use the ID + // for the AWS account that contains your Amazon QuickSight account. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The maximum number of results to return. + MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` + + // The namespace. Currently, you should set this to default. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + + // A pagination token that can be used in a subsequent request. + NextToken *string `location:"querystring" locationName:"next-token" 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.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 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 invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *ListGroupsInput) SetAwsAccountId(v string) *ListGroupsInput { + s.AwsAccountId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListGroupsInput) SetMaxResults(v int64) *ListGroupsInput { + s.MaxResults = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *ListGroupsInput) SetNamespace(v string) *ListGroupsInput { + s.Namespace = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListGroupsInput) SetNextToken(v string) *ListGroupsInput { + s.NextToken = &v + return s +} + +type ListGroupsOutput struct { + _ struct{} `type:"structure"` + + // The list of the groups. + GroupList []*Group `type:"list"` + + // A pagination token that can be used in a subsequent request. + NextToken *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// 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() +} + +// SetGroupList sets the GroupList field's value. +func (s *ListGroupsOutput) SetGroupList(v []*Group) *ListGroupsOutput { + s.GroupList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListGroupsOutput) SetNextToken(v string) *ListGroupsOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListGroupsOutput) SetRequestId(v string) *ListGroupsOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListGroupsOutput) SetStatus(v int64) *ListGroupsOutput { + s.Status = &v + return s +} + +type ListIAMPolicyAssignmentsForUserInput struct { + _ struct{} `type:"structure"` + + // The ID of the AWS account that contains the assignments. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The maximum number of results to be returned per request. + MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` + + // The namespace of the assignment. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` + + // The name of the user. + // + // UserName is a required field + UserName *string `location:"uri" locationName:"UserName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListIAMPolicyAssignmentsForUserInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListIAMPolicyAssignmentsForUserInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListIAMPolicyAssignmentsForUserInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListIAMPolicyAssignmentsForUserInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 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.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 +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *ListIAMPolicyAssignmentsForUserInput) SetAwsAccountId(v string) *ListIAMPolicyAssignmentsForUserInput { + s.AwsAccountId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListIAMPolicyAssignmentsForUserInput) SetMaxResults(v int64) *ListIAMPolicyAssignmentsForUserInput { + s.MaxResults = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *ListIAMPolicyAssignmentsForUserInput) SetNamespace(v string) *ListIAMPolicyAssignmentsForUserInput { + s.Namespace = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListIAMPolicyAssignmentsForUserInput) SetNextToken(v string) *ListIAMPolicyAssignmentsForUserInput { + s.NextToken = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *ListIAMPolicyAssignmentsForUserInput) SetUserName(v string) *ListIAMPolicyAssignmentsForUserInput { + s.UserName = &v + return s +} + +type ListIAMPolicyAssignmentsForUserOutput struct { + _ struct{} `type:"structure"` + + // The active assignments for this user. + ActiveAssignments []*ActiveIAMPolicyAssignment `type:"list"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s ListIAMPolicyAssignmentsForUserOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListIAMPolicyAssignmentsForUserOutput) GoString() string { + return s.String() +} + +// SetActiveAssignments sets the ActiveAssignments field's value. +func (s *ListIAMPolicyAssignmentsForUserOutput) SetActiveAssignments(v []*ActiveIAMPolicyAssignment) *ListIAMPolicyAssignmentsForUserOutput { + s.ActiveAssignments = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListIAMPolicyAssignmentsForUserOutput) SetNextToken(v string) *ListIAMPolicyAssignmentsForUserOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListIAMPolicyAssignmentsForUserOutput) SetRequestId(v string) *ListIAMPolicyAssignmentsForUserOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListIAMPolicyAssignmentsForUserOutput) SetStatus(v int64) *ListIAMPolicyAssignmentsForUserOutput { + s.Status = &v + return s +} + +type ListIAMPolicyAssignmentsInput struct { + _ struct{} `type:"structure"` + + // The status of the assignments. + AssignmentStatus *string `type:"string" enum:"AssignmentStatus"` + + // The ID of the AWS account that contains these IAM policy assignments. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The maximum number of results to be returned per request. + MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` + + // The namespace for the assignments. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` +} + +// String returns the string representation +func (s ListIAMPolicyAssignmentsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListIAMPolicyAssignmentsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListIAMPolicyAssignmentsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListIAMPolicyAssignmentsInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 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 invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssignmentStatus sets the AssignmentStatus field's value. +func (s *ListIAMPolicyAssignmentsInput) SetAssignmentStatus(v string) *ListIAMPolicyAssignmentsInput { + s.AssignmentStatus = &v + return s +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *ListIAMPolicyAssignmentsInput) SetAwsAccountId(v string) *ListIAMPolicyAssignmentsInput { + s.AwsAccountId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListIAMPolicyAssignmentsInput) SetMaxResults(v int64) *ListIAMPolicyAssignmentsInput { + s.MaxResults = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *ListIAMPolicyAssignmentsInput) SetNamespace(v string) *ListIAMPolicyAssignmentsInput { + s.Namespace = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListIAMPolicyAssignmentsInput) SetNextToken(v string) *ListIAMPolicyAssignmentsInput { + s.NextToken = &v + return s +} + +type ListIAMPolicyAssignmentsOutput struct { + _ struct{} `type:"structure"` + + // Information describing the IAM policy assignments. + IAMPolicyAssignments []*IAMPolicyAssignmentSummary `type:"list"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s ListIAMPolicyAssignmentsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListIAMPolicyAssignmentsOutput) GoString() string { + return s.String() +} + +// SetIAMPolicyAssignments sets the IAMPolicyAssignments field's value. +func (s *ListIAMPolicyAssignmentsOutput) SetIAMPolicyAssignments(v []*IAMPolicyAssignmentSummary) *ListIAMPolicyAssignmentsOutput { + s.IAMPolicyAssignments = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListIAMPolicyAssignmentsOutput) SetNextToken(v string) *ListIAMPolicyAssignmentsOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListIAMPolicyAssignmentsOutput) SetRequestId(v string) *ListIAMPolicyAssignmentsOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListIAMPolicyAssignmentsOutput) SetStatus(v int64) *ListIAMPolicyAssignmentsOutput { + s.Status = &v + return s +} + +type ListIngestionsInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The ID of the dataset used in the ingestion. + // + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` + + // The maximum number of results to be returned per request. + MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` +} + +// String returns the string representation +func (s ListIngestionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListIngestionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListIngestionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListIngestionsInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *ListIngestionsInput) SetAwsAccountId(v string) *ListIngestionsInput { + s.AwsAccountId = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *ListIngestionsInput) SetDataSetId(v string) *ListIngestionsInput { + s.DataSetId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListIngestionsInput) SetMaxResults(v int64) *ListIngestionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListIngestionsInput) SetNextToken(v string) *ListIngestionsInput { + s.NextToken = &v + return s +} + +type ListIngestionsOutput struct { + _ struct{} `type:"structure"` + + // A list of the ingestions. + Ingestions []*Ingestion `type:"list"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s ListIngestionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListIngestionsOutput) GoString() string { + return s.String() +} + +// SetIngestions sets the Ingestions field's value. +func (s *ListIngestionsOutput) SetIngestions(v []*Ingestion) *ListIngestionsOutput { + s.Ingestions = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListIngestionsOutput) SetNextToken(v string) *ListIngestionsOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListIngestionsOutput) SetRequestId(v string) *ListIngestionsOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListIngestionsOutput) SetStatus(v int64) *ListIngestionsOutput { + s.Status = &v + return s +} + +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource that you want a list of tags + // for. + // + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"ResourceArn" 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 +} + +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` + + // Contains a map of the key-value pairs for the resource tag or tags assigned + // to the resource. + Tags []*Tag `min:"1" 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() +} + +// SetRequestId sets the RequestId field's value. +func (s *ListTagsForResourceOutput) SetRequestId(v string) *ListTagsForResourceOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListTagsForResourceOutput) SetStatus(v int64) *ListTagsForResourceOutput { + s.Status = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { + s.Tags = v + return s +} + +type ListTemplateAliasesInput struct { + _ struct{} `type:"structure"` + + // The ID of the AWS account that contains the template aliases that you're + // listing. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The maximum number of results to be returned per request. + MaxResults *int64 `location:"querystring" locationName:"max-result" min:"1" type:"integer"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` + + // The ID for the template. + // + // TemplateId is a required field + TemplateId *string `location:"uri" locationName:"TemplateId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListTemplateAliasesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTemplateAliasesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTemplateAliasesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTemplateAliasesInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.TemplateId == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateId")) + } + if s.TemplateId != nil && len(*s.TemplateId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *ListTemplateAliasesInput) SetAwsAccountId(v string) *ListTemplateAliasesInput { + s.AwsAccountId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListTemplateAliasesInput) SetMaxResults(v int64) *ListTemplateAliasesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTemplateAliasesInput) SetNextToken(v string) *ListTemplateAliasesInput { + s.NextToken = &v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *ListTemplateAliasesInput) SetTemplateId(v string) *ListTemplateAliasesInput { + s.TemplateId = &v + return s +} + +type ListTemplateAliasesOutput struct { + _ struct{} `type:"structure"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` + + // A structure containing the list of the template's aliases. + TemplateAliasList []*TemplateAlias `type:"list"` +} + +// String returns the string representation +func (s ListTemplateAliasesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTemplateAliasesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTemplateAliasesOutput) SetNextToken(v string) *ListTemplateAliasesOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListTemplateAliasesOutput) SetRequestId(v string) *ListTemplateAliasesOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListTemplateAliasesOutput) SetStatus(v int64) *ListTemplateAliasesOutput { + s.Status = &v + return s +} + +// SetTemplateAliasList sets the TemplateAliasList field's value. +func (s *ListTemplateAliasesOutput) SetTemplateAliasList(v []*TemplateAlias) *ListTemplateAliasesOutput { + s.TemplateAliasList = v + return s +} + +type ListTemplateVersionsInput struct { + _ struct{} `type:"structure"` + + // The ID of the AWS account that contains the templates that you're listing. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The maximum number of results to be returned per request. + MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` + + // The ID for the template. + // + // TemplateId is a required field + TemplateId *string `location:"uri" locationName:"TemplateId" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListTemplateVersionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTemplateVersionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTemplateVersionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTemplateVersionsInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.TemplateId == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateId")) + } + if s.TemplateId != nil && len(*s.TemplateId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *ListTemplateVersionsInput) SetAwsAccountId(v string) *ListTemplateVersionsInput { + s.AwsAccountId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListTemplateVersionsInput) SetMaxResults(v int64) *ListTemplateVersionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTemplateVersionsInput) SetNextToken(v string) *ListTemplateVersionsInput { + s.NextToken = &v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *ListTemplateVersionsInput) SetTemplateId(v string) *ListTemplateVersionsInput { + s.TemplateId = &v + return s +} + +type ListTemplateVersionsOutput struct { + _ struct{} `type:"structure"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` + + // A structure containing a list of all the versions of the specified template. + TemplateVersionSummaryList []*TemplateVersionSummary `type:"list"` +} + +// String returns the string representation +func (s ListTemplateVersionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTemplateVersionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTemplateVersionsOutput) SetNextToken(v string) *ListTemplateVersionsOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListTemplateVersionsOutput) SetRequestId(v string) *ListTemplateVersionsOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListTemplateVersionsOutput) SetStatus(v int64) *ListTemplateVersionsOutput { + s.Status = &v + return s +} + +// SetTemplateVersionSummaryList sets the TemplateVersionSummaryList field's value. +func (s *ListTemplateVersionsOutput) SetTemplateVersionSummaryList(v []*TemplateVersionSummary) *ListTemplateVersionsOutput { + s.TemplateVersionSummaryList = v + return s +} + +type ListTemplatesInput struct { + _ struct{} `type:"structure"` + + // The ID of the AWS account that contains the templates that you're listing. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The maximum number of results to be returned per request. + MaxResults *int64 `location:"querystring" locationName:"max-result" min:"1" type:"integer"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` +} + +// String returns the string representation +func (s ListTemplatesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTemplatesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTemplatesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTemplatesInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *ListTemplatesInput) SetAwsAccountId(v string) *ListTemplatesInput { + s.AwsAccountId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListTemplatesInput) SetMaxResults(v int64) *ListTemplatesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTemplatesInput) SetNextToken(v string) *ListTemplatesInput { + s.NextToken = &v + return s +} + +type ListTemplatesOutput struct { + _ struct{} `type:"structure"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` + + // A structure containing information about the templates in the list. + TemplateSummaryList []*TemplateSummary `type:"list"` +} + +// String returns the string representation +func (s ListTemplatesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTemplatesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTemplatesOutput) SetNextToken(v string) *ListTemplatesOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListTemplatesOutput) SetRequestId(v string) *ListTemplatesOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListTemplatesOutput) SetStatus(v int64) *ListTemplatesOutput { + s.Status = &v + return s +} + +// SetTemplateSummaryList sets the TemplateSummaryList field's value. +func (s *ListTemplatesOutput) SetTemplateSummaryList(v []*TemplateSummary) *ListTemplatesOutput { + s.TemplateSummaryList = v + return s +} + +type ListUserGroupsInput struct { + _ struct{} `type:"structure"` + + // The AWS account ID that the user is in. Currently, you use the ID for the + // AWS account that contains your Amazon QuickSight account. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The maximum number of results to return from this request. + MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` + + // The namespace. Currently, you should set this to default. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + + // A pagination token that can be used in a subsequent request. + NextToken *string `location:"querystring" locationName:"next-token" type:"string"` + + // The Amazon QuickSight user name that you want to list group memberships for. + // + // UserName is a required field + UserName *string `location:"uri" locationName:"UserName" min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListUserGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListUserGroupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListUserGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListUserGroupsInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 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.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 +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *ListUserGroupsInput) SetAwsAccountId(v string) *ListUserGroupsInput { + s.AwsAccountId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListUserGroupsInput) SetMaxResults(v int64) *ListUserGroupsInput { + s.MaxResults = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *ListUserGroupsInput) SetNamespace(v string) *ListUserGroupsInput { + s.Namespace = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListUserGroupsInput) SetNextToken(v string) *ListUserGroupsInput { + s.NextToken = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *ListUserGroupsInput) SetUserName(v string) *ListUserGroupsInput { + s.UserName = &v + return s +} + +type ListUserGroupsOutput struct { + _ struct{} `type:"structure"` + + // The list of groups the user is a member of. + GroupList []*Group `type:"list"` + + // A pagination token that can be used in a subsequent request. + NextToken *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s ListUserGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListUserGroupsOutput) GoString() string { + return s.String() +} + +// SetGroupList sets the GroupList field's value. +func (s *ListUserGroupsOutput) SetGroupList(v []*Group) *ListUserGroupsOutput { + s.GroupList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListUserGroupsOutput) SetNextToken(v string) *ListUserGroupsOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListUserGroupsOutput) SetRequestId(v string) *ListUserGroupsOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListUserGroupsOutput) SetStatus(v int64) *ListUserGroupsOutput { + s.Status = &v + return s +} + +type ListUsersInput struct { + _ struct{} `type:"structure"` + + // The ID for the AWS account that the user is in. Currently, you use the ID + // for the AWS account that contains your Amazon QuickSight account. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The maximum number of results to return from this request. + MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` + + // The namespace. Currently, you should set this to default. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + + // A pagination token that can be used in a subsequent request. + NextToken *string `location:"querystring" locationName:"next-token" 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.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 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 invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *ListUsersInput) SetAwsAccountId(v string) *ListUsersInput { + s.AwsAccountId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListUsersInput) SetMaxResults(v int64) *ListUsersInput { + s.MaxResults = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *ListUsersInput) SetNamespace(v string) *ListUsersInput { + s.Namespace = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListUsersInput) SetNextToken(v string) *ListUsersInput { + s.NextToken = &v + return s +} + +type ListUsersOutput struct { + _ struct{} `type:"structure"` + + // A pagination token that can be used in a subsequent request. + NextToken *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` + + // The list of users. + UserList []*User `type:"list"` +} + +// 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() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListUsersOutput) SetNextToken(v string) *ListUsersOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *ListUsersOutput) SetRequestId(v string) *ListUsersOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ListUsersOutput) SetStatus(v int64) *ListUsersOutput { + s.Status = &v + return s +} + +// SetUserList sets the UserList field's value. +func (s *ListUsersOutput) SetUserList(v []*User) *ListUsersOutput { + s.UserList = v + return s +} + +// A logical table is a unit that joins and that data transformations operate +// on. A logical table has a source, which can be either a physical table or +// result of a join. When a logical table points to a physical table, the logical +// table acts as a mutable copy of that physical table through transform operations. +type LogicalTable struct { + _ struct{} `type:"structure"` + + // A display name for the logical table. + // + // Alias is a required field + Alias *string `min:"1" type:"string" required:"true"` + + // Transform operations that act on this logical table. + DataTransforms []*TransformOperation `min:"1" type:"list"` + + // Source of this logical table. + // + // Source is a required field + Source *LogicalTableSource `type:"structure" required:"true"` +} + +// String returns the string representation +func (s LogicalTable) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LogicalTable) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LogicalTable) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LogicalTable"} + 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.DataTransforms != nil && len(s.DataTransforms) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataTransforms", 1)) + } + if s.Source == nil { + invalidParams.Add(request.NewErrParamRequired("Source")) + } + if s.DataTransforms != nil { + for i, v := range s.DataTransforms { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DataTransforms", i), 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 +} + +// SetAlias sets the Alias field's value. +func (s *LogicalTable) SetAlias(v string) *LogicalTable { + s.Alias = &v + return s +} + +// SetDataTransforms sets the DataTransforms field's value. +func (s *LogicalTable) SetDataTransforms(v []*TransformOperation) *LogicalTable { + s.DataTransforms = v + return s +} + +// SetSource sets the Source field's value. +func (s *LogicalTable) SetSource(v *LogicalTableSource) *LogicalTable { + s.Source = v + return s +} + +// Information about the source of a logical table. This is a variant type structure. +// For this structure to be valid, only one of the attributes can be non-null. +type LogicalTableSource struct { + _ struct{} `type:"structure"` + + // Specifies the result of a join of two logical tables. + JoinInstruction *JoinInstruction `type:"structure"` + + // Physical table ID. + PhysicalTableId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s LogicalTableSource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LogicalTableSource) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LogicalTableSource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LogicalTableSource"} + if s.PhysicalTableId != nil && len(*s.PhysicalTableId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PhysicalTableId", 1)) + } + if s.JoinInstruction != nil { + if err := s.JoinInstruction.Validate(); err != nil { + invalidParams.AddNested("JoinInstruction", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetJoinInstruction sets the JoinInstruction field's value. +func (s *LogicalTableSource) SetJoinInstruction(v *JoinInstruction) *LogicalTableSource { + s.JoinInstruction = v + return s +} + +// SetPhysicalTableId sets the PhysicalTableId field's value. +func (s *LogicalTableSource) SetPhysicalTableId(v string) *LogicalTableSource { + s.PhysicalTableId = &v + return s +} + +// Amazon S3 manifest file location. +type ManifestFileLocation struct { + _ struct{} `type:"structure"` + + // Amazon S3 bucket. + // + // Bucket is a required field + Bucket *string `min:"1" type:"string" required:"true"` + + // Amazon S3 key that identifies an object. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ManifestFileLocation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ManifestFileLocation) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ManifestFileLocation) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ManifestFileLocation"} + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Bucket != nil && len(*s.Bucket) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) + } + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBucket sets the Bucket field's value. +func (s *ManifestFileLocation) SetBucket(v string) *ManifestFileLocation { + s.Bucket = &v + return s +} + +// SetKey sets the Key field's value. +func (s *ManifestFileLocation) SetKey(v string) *ManifestFileLocation { + s.Key = &v + return s +} + +// MariaDB parameters. +type MariaDbParameters struct { + _ struct{} `type:"structure"` + + // Database. + // + // Database is a required field + Database *string `min:"1" type:"string" required:"true"` + + // Host. + // + // Host is a required field + Host *string `min:"1" type:"string" required:"true"` + + // Port. + // + // Port is a required field + Port *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s MariaDbParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MariaDbParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *MariaDbParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MariaDbParameters"} + if s.Database == nil { + invalidParams.Add(request.NewErrParamRequired("Database")) + } + if s.Database != nil && len(*s.Database) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Database", 1)) + } + if s.Host == nil { + invalidParams.Add(request.NewErrParamRequired("Host")) + } + if s.Host != nil && len(*s.Host) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Host", 1)) + } + if s.Port == nil { + invalidParams.Add(request.NewErrParamRequired("Port")) + } + if s.Port != nil && *s.Port < 1 { + invalidParams.Add(request.NewErrParamMinValue("Port", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDatabase sets the Database field's value. +func (s *MariaDbParameters) SetDatabase(v string) *MariaDbParameters { + s.Database = &v + return s +} + +// SetHost sets the Host field's value. +func (s *MariaDbParameters) SetHost(v string) *MariaDbParameters { + s.Host = &v + return s +} + +// SetPort sets the Port field's value. +func (s *MariaDbParameters) SetPort(v int64) *MariaDbParameters { + s.Port = &v + return s +} + +// MySQL parameters. +type MySqlParameters struct { + _ struct{} `type:"structure"` + + // Database. + // + // Database is a required field + Database *string `min:"1" type:"string" required:"true"` + + // Host. + // + // Host is a required field + Host *string `min:"1" type:"string" required:"true"` + + // Port. + // + // Port is a required field + Port *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s MySqlParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MySqlParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *MySqlParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MySqlParameters"} + if s.Database == nil { + invalidParams.Add(request.NewErrParamRequired("Database")) + } + if s.Database != nil && len(*s.Database) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Database", 1)) + } + if s.Host == nil { + invalidParams.Add(request.NewErrParamRequired("Host")) + } + if s.Host != nil && len(*s.Host) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Host", 1)) + } + if s.Port == nil { + invalidParams.Add(request.NewErrParamRequired("Port")) + } + if s.Port != nil && *s.Port < 1 { + invalidParams.Add(request.NewErrParamMinValue("Port", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDatabase sets the Database field's value. +func (s *MySqlParameters) SetDatabase(v string) *MySqlParameters { + s.Database = &v + return s +} + +// SetHost sets the Host field's value. +func (s *MySqlParameters) SetHost(v string) *MySqlParameters { + s.Host = &v + return s +} + +// SetPort sets the Port field's value. +func (s *MySqlParameters) SetPort(v int64) *MySqlParameters { + s.Port = &v + return s +} + +// Output column. +type OutputColumn struct { + _ struct{} `type:"structure"` + + // A display name for the dataset. + Name *string `min:"1" type:"string"` + + // Type. + Type *string `type:"string" enum:"ColumnDataType"` +} + +// String returns the string representation +func (s OutputColumn) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OutputColumn) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *OutputColumn) SetName(v string) *OutputColumn { + s.Name = &v + return s +} + +// SetType sets the Type field's value. +func (s *OutputColumn) SetType(v string) *OutputColumn { + s.Type = &v + return s +} + +// Parameters. +type Parameters struct { + _ struct{} `type:"structure"` + + // DateTime parameters. + DateTimeParameters []*DateTimeParameter `type:"list"` + + // Decimal parameters. + DecimalParameters []*DecimalParameter `type:"list"` + + // Integer parameters. + IntegerParameters []*IntegerParameter `type:"list"` + + // String parameters. + StringParameters []*StringParameter `type:"list"` +} + +// String returns the string representation +func (s Parameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Parameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Parameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Parameters"} + if s.DateTimeParameters != nil { + for i, v := range s.DateTimeParameters { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DateTimeParameters", i), err.(request.ErrInvalidParams)) + } + } + } + if s.DecimalParameters != nil { + for i, v := range s.DecimalParameters { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DecimalParameters", i), err.(request.ErrInvalidParams)) + } + } + } + if s.IntegerParameters != nil { + for i, v := range s.IntegerParameters { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "IntegerParameters", i), err.(request.ErrInvalidParams)) + } + } + } + if s.StringParameters != nil { + for i, v := range s.StringParameters { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "StringParameters", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDateTimeParameters sets the DateTimeParameters field's value. +func (s *Parameters) SetDateTimeParameters(v []*DateTimeParameter) *Parameters { + s.DateTimeParameters = v + return s +} + +// SetDecimalParameters sets the DecimalParameters field's value. +func (s *Parameters) SetDecimalParameters(v []*DecimalParameter) *Parameters { + s.DecimalParameters = v + return s +} + +// SetIntegerParameters sets the IntegerParameters field's value. +func (s *Parameters) SetIntegerParameters(v []*IntegerParameter) *Parameters { + s.IntegerParameters = v + return s +} + +// SetStringParameters sets the StringParameters field's value. +func (s *Parameters) SetStringParameters(v []*StringParameter) *Parameters { + s.StringParameters = v + return s +} + +// A view of a data source that contains information about the shape of the +// data in the underlying source. This is a variant type structure. For this +// structure to be valid, only one of the attributes can be non-null. +type PhysicalTable struct { + _ struct{} `type:"structure"` + + // A physical table type built from the results of the custom SQL query. + CustomSql *CustomSql `type:"structure"` + + // A physical table type for relational data sources. + RelationalTable *RelationalTable `type:"structure"` + + // A physical table type for as S3 data source. + S3Source *S3Source `type:"structure"` +} + +// String returns the string representation +func (s PhysicalTable) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PhysicalTable) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PhysicalTable) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PhysicalTable"} + if s.CustomSql != nil { + if err := s.CustomSql.Validate(); err != nil { + invalidParams.AddNested("CustomSql", err.(request.ErrInvalidParams)) + } + } + if s.RelationalTable != nil { + if err := s.RelationalTable.Validate(); err != nil { + invalidParams.AddNested("RelationalTable", err.(request.ErrInvalidParams)) + } + } + if s.S3Source != nil { + if err := s.S3Source.Validate(); err != nil { + invalidParams.AddNested("S3Source", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCustomSql sets the CustomSql field's value. +func (s *PhysicalTable) SetCustomSql(v *CustomSql) *PhysicalTable { + s.CustomSql = v + return s +} + +// SetRelationalTable sets the RelationalTable field's value. +func (s *PhysicalTable) SetRelationalTable(v *RelationalTable) *PhysicalTable { + s.RelationalTable = v + return s +} + +// SetS3Source sets the S3Source field's value. +func (s *PhysicalTable) SetS3Source(v *S3Source) *PhysicalTable { + s.S3Source = v + return s +} + +// PostgreSQL parameters. +type PostgreSqlParameters struct { + _ struct{} `type:"structure"` + + // Database. + // + // Database is a required field + Database *string `min:"1" type:"string" required:"true"` + + // Host. + // + // Host is a required field + Host *string `min:"1" type:"string" required:"true"` + + // Port. + // + // Port is a required field + Port *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s PostgreSqlParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PostgreSqlParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PostgreSqlParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PostgreSqlParameters"} + if s.Database == nil { + invalidParams.Add(request.NewErrParamRequired("Database")) + } + if s.Database != nil && len(*s.Database) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Database", 1)) + } + if s.Host == nil { + invalidParams.Add(request.NewErrParamRequired("Host")) + } + if s.Host != nil && len(*s.Host) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Host", 1)) + } + if s.Port == nil { + invalidParams.Add(request.NewErrParamRequired("Port")) + } + if s.Port != nil && *s.Port < 1 { + invalidParams.Add(request.NewErrParamMinValue("Port", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDatabase sets the Database field's value. +func (s *PostgreSqlParameters) SetDatabase(v string) *PostgreSqlParameters { + s.Database = &v + return s +} + +// SetHost sets the Host field's value. +func (s *PostgreSqlParameters) SetHost(v string) *PostgreSqlParameters { + s.Host = &v + return s +} + +// SetPort sets the Port field's value. +func (s *PostgreSqlParameters) SetPort(v int64) *PostgreSqlParameters { + s.Port = &v + return s +} + +// One or more preconditions aren't met. +type PreconditionNotMetException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request ID for this request. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s PreconditionNotMetException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PreconditionNotMetException) GoString() string { + return s.String() +} + +func newErrorPreconditionNotMetException(v protocol.ResponseMetadata) error { + return &PreconditionNotMetException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PreconditionNotMetException) Code() string { + return "PreconditionNotMetException" +} + +// Message returns the exception's message. +func (s PreconditionNotMetException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PreconditionNotMetException) OrigErr() error { + return nil +} + +func (s PreconditionNotMetException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PreconditionNotMetException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PreconditionNotMetException) RequestID() string { + return s.respMetadata.RequestID +} + +// Presto parameters. +type PrestoParameters struct { + _ struct{} `type:"structure"` + + // Catalog. + // + // Catalog is a required field + Catalog *string `type:"string" required:"true"` + + // Host. + // + // Host is a required field + Host *string `min:"1" type:"string" required:"true"` + + // Port. + // + // Port is a required field + Port *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s PrestoParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PrestoParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PrestoParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PrestoParameters"} + if s.Catalog == nil { + invalidParams.Add(request.NewErrParamRequired("Catalog")) + } + if s.Host == nil { + invalidParams.Add(request.NewErrParamRequired("Host")) + } + if s.Host != nil && len(*s.Host) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Host", 1)) + } + if s.Port == nil { + invalidParams.Add(request.NewErrParamRequired("Port")) + } + if s.Port != nil && *s.Port < 1 { + invalidParams.Add(request.NewErrParamMinValue("Port", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCatalog sets the Catalog field's value. +func (s *PrestoParameters) SetCatalog(v string) *PrestoParameters { + s.Catalog = &v + return s +} + +// SetHost sets the Host field's value. +func (s *PrestoParameters) SetHost(v string) *PrestoParameters { + s.Host = &v + return s +} + +// SetPort sets the Port field's value. +func (s *PrestoParameters) SetPort(v int64) *PrestoParameters { + s.Port = &v + return s +} + +// A transform operation that projects columns. Operations that come after a +// projection can only refer to projected columns. +type ProjectOperation struct { + _ struct{} `type:"structure"` + + // Projected columns. + // + // ProjectedColumns is a required field + ProjectedColumns []*string `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s ProjectOperation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ProjectOperation) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ProjectOperation) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProjectOperation"} + if s.ProjectedColumns == nil { + invalidParams.Add(request.NewErrParamRequired("ProjectedColumns")) + } + if s.ProjectedColumns != nil && len(s.ProjectedColumns) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ProjectedColumns", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetProjectedColumns sets the ProjectedColumns field's value. +func (s *ProjectOperation) SetProjectedColumns(v []*string) *ProjectOperation { + s.ProjectedColumns = v + return s +} + +// Information about a queued dataset SPICE ingestion. +type QueueInfo struct { + _ struct{} `type:"structure"` + + // The ID of the ongoing ingestion. The queued ingestion is waiting for the + // ongoing ingestion to complete. + // + // QueuedIngestion is a required field + QueuedIngestion *string `type:"string" required:"true"` + + // The ID of the queued ingestion. + // + // WaitingOnIngestion is a required field + WaitingOnIngestion *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s QueueInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s QueueInfo) GoString() string { + return s.String() +} + +// SetQueuedIngestion sets the QueuedIngestion field's value. +func (s *QueueInfo) SetQueuedIngestion(v string) *QueueInfo { + s.QueuedIngestion = &v + return s +} + +// SetWaitingOnIngestion sets the WaitingOnIngestion field's value. +func (s *QueueInfo) SetWaitingOnIngestion(v string) *QueueInfo { + s.WaitingOnIngestion = &v + return s +} + +// Amazon RDS parameters. +type RdsParameters struct { + _ struct{} `type:"structure"` + + // Database. + // + // Database is a required field + Database *string `min:"1" type:"string" required:"true"` + + // Instance ID. + // + // InstanceId is a required field + InstanceId *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s RdsParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RdsParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RdsParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RdsParameters"} + if s.Database == nil { + invalidParams.Add(request.NewErrParamRequired("Database")) + } + if s.Database != nil && len(*s.Database) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Database", 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 +} + +// SetDatabase sets the Database field's value. +func (s *RdsParameters) SetDatabase(v string) *RdsParameters { + s.Database = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *RdsParameters) SetInstanceId(v string) *RdsParameters { + s.InstanceId = &v + return s +} + +// Amazon Redshift parameters. The ClusterId field can be blank if Host and +// Port are both set. The Host and Port fields can be blank if the ClusterId +// field is set. +type RedshiftParameters struct { + _ struct{} `type:"structure"` + + // Cluster ID. This field can be blank if the Host and Port are provided. + ClusterId *string `min:"1" type:"string"` + + // Database. + // + // Database is a required field + Database *string `min:"1" type:"string" required:"true"` + + // Host. This field can be blank if ClusterId is provided. + Host *string `min:"1" type:"string"` + + // Port. This field can be blank if the ClusterId is provided. + Port *int64 `type:"integer"` +} + +// String returns the string representation +func (s RedshiftParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RedshiftParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RedshiftParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RedshiftParameters"} + if s.ClusterId != nil && len(*s.ClusterId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClusterId", 1)) + } + if s.Database == nil { + invalidParams.Add(request.NewErrParamRequired("Database")) + } + if s.Database != nil && len(*s.Database) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Database", 1)) + } + if s.Host != nil && len(*s.Host) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Host", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClusterId sets the ClusterId field's value. +func (s *RedshiftParameters) SetClusterId(v string) *RedshiftParameters { + s.ClusterId = &v + return s +} + +// SetDatabase sets the Database field's value. +func (s *RedshiftParameters) SetDatabase(v string) *RedshiftParameters { + s.Database = &v + return s +} + +// SetHost sets the Host field's value. +func (s *RedshiftParameters) SetHost(v string) *RedshiftParameters { + s.Host = &v + return s +} + +// SetPort sets the Port field's value. +func (s *RedshiftParameters) SetPort(v int64) *RedshiftParameters { + s.Port = &v + return s +} + +type RegisterUserInput struct { + _ struct{} `type:"structure"` + + // The ID for the AWS account that the user is in. Currently, you use the ID + // for the AWS account that contains your Amazon QuickSight account. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The email address of the user that you want to register. + // + // Email is a required field + Email *string `type:"string" required:"true"` + + // The ARN of the IAM user or role that you are registering with Amazon QuickSight. + IamArn *string `type:"string"` + + // Amazon QuickSight supports several ways of managing the identity of users. + // This parameter accepts two values: + // + // * IAM: A user whose identity maps to an existing IAM user or role. + // + // * QUICKSIGHT: A user whose identity is owned and managed internally by + // Amazon QuickSight. + // + // IdentityType is a required field + IdentityType *string `type:"string" required:"true" enum:"IdentityType"` + + // The namespace. Currently, you should set this to default. + // + // Namespace is a required field + Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + + // You need to use this parameter only when you register one or more users using + // an assumed IAM role. You don't need to provide the session name for other + // scenarios, for example when you are registering an IAM user or an Amazon + // QuickSight user. You can register multiple users using the same IAM role + // if each user has a different session name. For more information on assuming + // IAM roles, see assume-role (https://docs.aws.example.com/cli/latest/reference/sts/assume-role.html) + // in the AWS CLI Reference. + SessionName *string `min:"2" type:"string"` + + // The Amazon QuickSight user name that you want to create for the user you + // are registering. + UserName *string `min:"1" type:"string"` + + // The Amazon QuickSight role for the user. The user role can be one of the + // following: + // + // * READER: A user who has read-only access to dashboards. + // + // * AUTHOR: A user who can create data sources, datasets, analyses, and + // dashboards. + // + // * ADMIN: A user who is an author, who can also manage Amazon QuickSight + // settings. + // + // * RESTRICTED_READER: This role isn't currently available for use. + // + // * RESTRICTED_AUTHOR: This role isn't currently available for use. + // + // UserRole is a required field + UserRole *string `type:"string" required:"true" enum:"UserRole"` +} + +// String returns the string representation +func (s RegisterUserInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterUserInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RegisterUserInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RegisterUserInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.Email == nil { + invalidParams.Add(request.NewErrParamRequired("Email")) + } + if s.IdentityType == nil { + invalidParams.Add(request.NewErrParamRequired("IdentityType")) + } + 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.SessionName != nil && len(*s.SessionName) < 2 { + invalidParams.Add(request.NewErrParamMinLen("SessionName", 2)) + } + if s.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + if s.UserRole == nil { + invalidParams.Add(request.NewErrParamRequired("UserRole")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *RegisterUserInput) SetAwsAccountId(v string) *RegisterUserInput { + s.AwsAccountId = &v + return s +} + +// SetEmail sets the Email field's value. +func (s *RegisterUserInput) SetEmail(v string) *RegisterUserInput { + s.Email = &v + return s +} + +// SetIamArn sets the IamArn field's value. +func (s *RegisterUserInput) SetIamArn(v string) *RegisterUserInput { + s.IamArn = &v + return s +} + +// SetIdentityType sets the IdentityType field's value. +func (s *RegisterUserInput) SetIdentityType(v string) *RegisterUserInput { + s.IdentityType = &v + return s +} + +// SetNamespace sets the Namespace field's value. +func (s *RegisterUserInput) SetNamespace(v string) *RegisterUserInput { + s.Namespace = &v + return s +} + +// SetSessionName sets the SessionName field's value. +func (s *RegisterUserInput) SetSessionName(v string) *RegisterUserInput { + s.SessionName = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *RegisterUserInput) SetUserName(v string) *RegisterUserInput { + s.UserName = &v + return s +} + +// SetUserRole sets the UserRole field's value. +func (s *RegisterUserInput) SetUserRole(v string) *RegisterUserInput { + s.UserRole = &v + return s +} + +type RegisterUserOutput struct { + _ struct{} `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` + + // The user name. + User *User `type:"structure"` + + // The URL the user visits to complete registration and provide a password. + // This is returned only for users with an identity type of QUICKSIGHT. + UserInvitationUrl *string `type:"string"` +} + +// String returns the string representation +func (s RegisterUserOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterUserOutput) GoString() string { + return s.String() +} + +// SetRequestId sets the RequestId field's value. +func (s *RegisterUserOutput) SetRequestId(v string) *RegisterUserOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *RegisterUserOutput) SetStatus(v int64) *RegisterUserOutput { + s.Status = &v + return s +} + +// SetUser sets the User field's value. +func (s *RegisterUserOutput) SetUser(v *User) *RegisterUserOutput { + s.User = v + return s +} + +// SetUserInvitationUrl sets the UserInvitationUrl field's value. +func (s *RegisterUserOutput) SetUserInvitationUrl(v string) *RegisterUserOutput { + s.UserInvitationUrl = &v + return s +} + +// A physical table type for relational data sources. +type RelationalTable struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) for the data source. + // + // DataSourceArn is a required field + DataSourceArn *string `type:"string" required:"true"` + + // The column schema of the table. + // + // InputColumns is a required field + InputColumns []*InputColumn `min:"1" type:"list" required:"true"` + + // The name of the relational table. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The schema name. This name applies to certain relational database engines. + Schema *string `type:"string"` +} + +// String returns the string representation +func (s RelationalTable) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RelationalTable) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RelationalTable) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RelationalTable"} + if s.DataSourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("DataSourceArn")) + } + if s.InputColumns == nil { + invalidParams.Add(request.NewErrParamRequired("InputColumns")) + } + if s.InputColumns != nil && len(s.InputColumns) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InputColumns", 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.InputColumns != nil { + for i, v := range s.InputColumns { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputColumns", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDataSourceArn sets the DataSourceArn field's value. +func (s *RelationalTable) SetDataSourceArn(v string) *RelationalTable { + s.DataSourceArn = &v + return s +} + +// SetInputColumns sets the InputColumns field's value. +func (s *RelationalTable) SetInputColumns(v []*InputColumn) *RelationalTable { + s.InputColumns = v + return s +} + +// SetName sets the Name field's value. +func (s *RelationalTable) SetName(v string) *RelationalTable { + s.Name = &v + return s +} + +// SetSchema sets the Schema field's value. +func (s *RelationalTable) SetSchema(v string) *RelationalTable { + s.Schema = &v + return s +} + +// A transform operation that renames a column. +type RenameColumnOperation struct { + _ struct{} `type:"structure"` + + // The name of the column to be renamed. + // + // ColumnName is a required field + ColumnName *string `min:"1" type:"string" required:"true"` + + // The new name for the column. + // + // NewColumnName is a required field + NewColumnName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s RenameColumnOperation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RenameColumnOperation) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RenameColumnOperation) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RenameColumnOperation"} + if s.ColumnName == nil { + invalidParams.Add(request.NewErrParamRequired("ColumnName")) + } + if s.ColumnName != nil && len(*s.ColumnName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ColumnName", 1)) + } + if s.NewColumnName == nil { + invalidParams.Add(request.NewErrParamRequired("NewColumnName")) + } + if s.NewColumnName != nil && len(*s.NewColumnName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NewColumnName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetColumnName sets the ColumnName field's value. +func (s *RenameColumnOperation) SetColumnName(v string) *RenameColumnOperation { + s.ColumnName = &v + return s +} + +// SetNewColumnName sets the NewColumnName field's value. +func (s *RenameColumnOperation) SetNewColumnName(v string) *RenameColumnOperation { + s.NewColumnName = &v + return s +} + +// The resource specified already exists. +type ResourceExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request ID for this request. + RequestId *string `type:"string"` + + // The AWS request ID for this request. + ResourceType *string `type:"string" enum:"ExceptionResourceType"` +} + +// String returns the string representation +func (s ResourceExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceExistsException) GoString() string { + return s.String() +} + +func newErrorResourceExistsException(v protocol.ResponseMetadata) error { + return &ResourceExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceExistsException) Code() string { + return "ResourceExistsException" +} + +// Message returns the exception's message. +func (s ResourceExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceExistsException) OrigErr() error { + return nil +} + +func (s ResourceExistsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more resources can't be found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request ID for this request. + RequestId *string `type:"string"` + + // The AWS request ID for this request. + ResourceType *string `type:"string" enum:"ExceptionResourceType"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Permission for the resource. +type ResourcePermission struct { + _ struct{} `type:"structure"` + + // The action to grant or revoke permissions on, for example "quicksight:DescribeDashboard". + // + // Actions is a required field + Actions []*string `min:"1" type:"list" required:"true"` + + // The Amazon Resource Name (ARN) of an Amazon QuickSight user or group, or + // an IAM ARN. If you are using cross-account resource sharing, this is the + // IAM ARN of an account root. Otherwise, it is the ARN of a QuickSight user + // or group. . + // + // Principal is a required field + Principal *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ResourcePermission) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourcePermission) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResourcePermission) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResourcePermission"} + if s.Actions == nil { + invalidParams.Add(request.NewErrParamRequired("Actions")) + } + if s.Actions != nil && len(s.Actions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Actions", 1)) + } + if s.Principal == nil { + invalidParams.Add(request.NewErrParamRequired("Principal")) + } + if s.Principal != nil && len(*s.Principal) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Principal", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetActions sets the Actions field's value. +func (s *ResourcePermission) SetActions(v []*string) *ResourcePermission { + s.Actions = v + return s +} + +// SetPrincipal sets the Principal field's value. +func (s *ResourcePermission) SetPrincipal(v string) *ResourcePermission { + s.Principal = &v + return s +} + +// This resource is currently unavailable. +type ResourceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request ID for this request. + RequestId *string `type:"string"` + + // The resource type for this request. + ResourceType *string `type:"string" enum:"ExceptionResourceType"` +} + +// String returns the string representation +func (s ResourceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceUnavailableException) GoString() string { + return s.String() +} + +func newErrorResourceUnavailableException(v protocol.ResponseMetadata) error { + return &ResourceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceUnavailableException) Code() string { + return "ResourceUnavailableException" +} + +// Message returns the exception's message. +func (s ResourceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceUnavailableException) OrigErr() error { + return nil +} + +func (s ResourceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about rows for a data set SPICE ingestion. +type RowInfo struct { + _ struct{} `type:"structure"` + + // The number of rows that were not ingested. + RowsDropped *int64 `type:"long"` + + // The number of rows that were ingested. + RowsIngested *int64 `type:"long"` +} + +// String returns the string representation +func (s RowInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RowInfo) GoString() string { + return s.String() +} + +// SetRowsDropped sets the RowsDropped field's value. +func (s *RowInfo) SetRowsDropped(v int64) *RowInfo { + s.RowsDropped = &v + return s +} + +// SetRowsIngested sets the RowsIngested field's value. +func (s *RowInfo) SetRowsIngested(v int64) *RowInfo { + s.RowsIngested = &v + return s +} + +// The row-level security configuration for the dataset. +type RowLevelPermissionDataSet struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the permission dataset. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // Permission policy. + // + // PermissionPolicy is a required field + PermissionPolicy *string `type:"string" required:"true" enum:"RowLevelPermissionPolicy"` +} + +// String returns the string representation +func (s RowLevelPermissionDataSet) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RowLevelPermissionDataSet) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RowLevelPermissionDataSet) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RowLevelPermissionDataSet"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.PermissionPolicy == nil { + invalidParams.Add(request.NewErrParamRequired("PermissionPolicy")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *RowLevelPermissionDataSet) SetArn(v string) *RowLevelPermissionDataSet { + s.Arn = &v + return s +} + +// SetPermissionPolicy sets the PermissionPolicy field's value. +func (s *RowLevelPermissionDataSet) SetPermissionPolicy(v string) *RowLevelPermissionDataSet { + s.PermissionPolicy = &v + return s +} + +// S3 parameters. +type S3Parameters struct { + _ struct{} `type:"structure"` + + // Location of the Amazon S3 manifest file. This is NULL if the manifest file + // was uploaded in the console. + // + // ManifestFileLocation is a required field + ManifestFileLocation *ManifestFileLocation `type:"structure" required:"true"` +} + +// String returns the string representation +func (s S3Parameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s S3Parameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *S3Parameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "S3Parameters"} + if s.ManifestFileLocation == nil { + invalidParams.Add(request.NewErrParamRequired("ManifestFileLocation")) + } + if s.ManifestFileLocation != nil { + if err := s.ManifestFileLocation.Validate(); err != nil { + invalidParams.AddNested("ManifestFileLocation", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetManifestFileLocation sets the ManifestFileLocation field's value. +func (s *S3Parameters) SetManifestFileLocation(v *ManifestFileLocation) *S3Parameters { + s.ManifestFileLocation = v + return s +} + +// A physical table type for as S3 data source. +type S3Source struct { + _ struct{} `type:"structure"` + + // The amazon Resource Name (ARN) for the data source. + // + // DataSourceArn is a required field + DataSourceArn *string `type:"string" required:"true"` + + // A physical table type for as S3 data source. + // + // InputColumns is a required field + InputColumns []*InputColumn `min:"1" type:"list" required:"true"` + + // Information about the format for the S3 source file or files. + UploadSettings *UploadSettings `type:"structure"` +} + +// String returns the string representation +func (s S3Source) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s S3Source) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *S3Source) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "S3Source"} + if s.DataSourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("DataSourceArn")) + } + if s.InputColumns == nil { + invalidParams.Add(request.NewErrParamRequired("InputColumns")) + } + if s.InputColumns != nil && len(s.InputColumns) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InputColumns", 1)) + } + if s.InputColumns != nil { + for i, v := range s.InputColumns { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputColumns", i), err.(request.ErrInvalidParams)) + } + } + } + if s.UploadSettings != nil { + if err := s.UploadSettings.Validate(); err != nil { + invalidParams.AddNested("UploadSettings", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDataSourceArn sets the DataSourceArn field's value. +func (s *S3Source) SetDataSourceArn(v string) *S3Source { + s.DataSourceArn = &v + return s +} + +// SetInputColumns sets the InputColumns field's value. +func (s *S3Source) SetInputColumns(v []*InputColumn) *S3Source { + s.InputColumns = v + return s +} + +// SetUploadSettings sets the UploadSettings field's value. +func (s *S3Source) SetUploadSettings(v *UploadSettings) *S3Source { + s.UploadSettings = v + return s +} + +type SearchDashboardsInput struct { + _ struct{} `type:"structure"` + + // The ID of the AWS account that contains the user whose dashboards you're + // searching for. + // + // AwsAccountId is a required field + AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + + // The filters to apply to the search. Currently, you can search only by user + // name. For example, "Filters": [ { "Name": "QUICKSIGHT_USER", "Operator": + // "StringEquals", "Value": "arn:aws:quicksight:us-east-1:1:user/default/UserName1" + // } ] + // + // Filters is a required field + Filters []*DashboardSearchFilter `type:"list" required:"true"` + + // The maximum number of results to be returned per request. + MaxResults *int64 `min:"1" type:"integer"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s SearchDashboardsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SearchDashboardsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SearchDashboardsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SearchDashboardsInput"} + if s.AwsAccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) + } + if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) + } + if s.Filters == nil { + invalidParams.Add(request.NewErrParamRequired("Filters")) + } + 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 +} + +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *SearchDashboardsInput) SetAwsAccountId(v string) *SearchDashboardsInput { + s.AwsAccountId = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *SearchDashboardsInput) SetFilters(v []*DashboardSearchFilter) *SearchDashboardsInput { + s.Filters = v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *SearchDashboardsInput) SetMaxResults(v int64) *SearchDashboardsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *SearchDashboardsInput) SetNextToken(v string) *SearchDashboardsInput { + s.NextToken = &v + return s +} + +type SearchDashboardsOutput struct { + _ struct{} `type:"structure"` + + // The list of dashboards owned by the user specified in Filters in your request. + DashboardSummaryList []*DashboardSummary `type:"list"` + + // The token for the next set of results, or null if there are no more results. + NextToken *string `type:"string"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// String returns the string representation +func (s SearchDashboardsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SearchDashboardsOutput) GoString() string { + return s.String() +} + +// SetDashboardSummaryList sets the DashboardSummaryList field's value. +func (s *SearchDashboardsOutput) SetDashboardSummaryList(v []*DashboardSummary) *SearchDashboardsOutput { + s.DashboardSummaryList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *SearchDashboardsOutput) SetNextToken(v string) *SearchDashboardsOutput { + s.NextToken = &v + return s +} + +// SetRequestId sets the RequestId field's value. +func (s *SearchDashboardsOutput) SetRequestId(v string) *SearchDashboardsOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *SearchDashboardsOutput) SetStatus(v int64) *SearchDashboardsOutput { + s.Status = &v + return s +} + +// ServiceNow parameters. +type ServiceNowParameters struct { + _ struct{} `type:"structure"` + + // URL of the base site. + // + // SiteBaseUrl is a required field + SiteBaseUrl *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ServiceNowParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceNowParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ServiceNowParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ServiceNowParameters"} + if s.SiteBaseUrl == nil { + invalidParams.Add(request.NewErrParamRequired("SiteBaseUrl")) + } + if s.SiteBaseUrl != nil && len(*s.SiteBaseUrl) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SiteBaseUrl", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSiteBaseUrl sets the SiteBaseUrl field's value. +func (s *ServiceNowParameters) SetSiteBaseUrl(v string) *ServiceNowParameters { + s.SiteBaseUrl = &v + return s +} + +// The number of minutes specified for the lifetime of a session isn't valid. +// The session lifetime must be 15-600 minutes. +type SessionLifetimeInMinutesInvalidException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request ID for this request. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s SessionLifetimeInMinutesInvalidException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SessionLifetimeInMinutesInvalidException) GoString() string { + return s.String() +} + +func newErrorSessionLifetimeInMinutesInvalidException(v protocol.ResponseMetadata) error { + return &SessionLifetimeInMinutesInvalidException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SessionLifetimeInMinutesInvalidException) Code() string { + return "SessionLifetimeInMinutesInvalidException" +} + +// Message returns the exception's message. +func (s SessionLifetimeInMinutesInvalidException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SessionLifetimeInMinutesInvalidException) OrigErr() error { + return nil +} + +func (s SessionLifetimeInMinutesInvalidException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SessionLifetimeInMinutesInvalidException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SessionLifetimeInMinutesInvalidException) RequestID() string { + return s.respMetadata.RequestID +} + +// Sheet controls option. +type SheetControlsOption struct { + _ struct{} `type:"structure"` + + // Visibility state. + VisibilityState *string `type:"string" enum:"DashboardUIState"` +} + +// String returns the string representation +func (s SheetControlsOption) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SheetControlsOption) GoString() string { + return s.String() +} + +// SetVisibilityState sets the VisibilityState field's value. +func (s *SheetControlsOption) SetVisibilityState(v string) *SheetControlsOption { + s.VisibilityState = &v + return s +} + +// Snowflake parameters. +type SnowflakeParameters struct { + _ struct{} `type:"structure"` + + // Database. + // + // Database is a required field + Database *string `min:"1" type:"string" required:"true"` + + // Host. + // + // Host is a required field + Host *string `min:"1" type:"string" required:"true"` + + // Warehouse. + // + // Warehouse is a required field + Warehouse *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s SnowflakeParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SnowflakeParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SnowflakeParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SnowflakeParameters"} + if s.Database == nil { + invalidParams.Add(request.NewErrParamRequired("Database")) + } + if s.Database != nil && len(*s.Database) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Database", 1)) + } + if s.Host == nil { + invalidParams.Add(request.NewErrParamRequired("Host")) + } + if s.Host != nil && len(*s.Host) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Host", 1)) + } + if s.Warehouse == nil { + invalidParams.Add(request.NewErrParamRequired("Warehouse")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDatabase sets the Database field's value. +func (s *SnowflakeParameters) SetDatabase(v string) *SnowflakeParameters { + s.Database = &v + return s +} + +// SetHost sets the Host field's value. +func (s *SnowflakeParameters) SetHost(v string) *SnowflakeParameters { + s.Host = &v + return s +} + +// SetWarehouse sets the Warehouse field's value. +func (s *SnowflakeParameters) SetWarehouse(v string) *SnowflakeParameters { + s.Warehouse = &v + return s +} + +// Spark parameters. +type SparkParameters struct { + _ struct{} `type:"structure"` + + // Host. + // + // Host is a required field + Host *string `min:"1" type:"string" required:"true"` + + // Port. + // + // Port is a required field + Port *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s SparkParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SparkParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SparkParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SparkParameters"} + if s.Host == nil { + invalidParams.Add(request.NewErrParamRequired("Host")) + } + if s.Host != nil && len(*s.Host) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Host", 1)) + } + if s.Port == nil { + invalidParams.Add(request.NewErrParamRequired("Port")) + } + if s.Port != nil && *s.Port < 1 { + invalidParams.Add(request.NewErrParamMinValue("Port", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHost sets the Host field's value. +func (s *SparkParameters) SetHost(v string) *SparkParameters { + s.Host = &v + return s +} + +// SetPort sets the Port field's value. +func (s *SparkParameters) SetPort(v int64) *SparkParameters { + s.Port = &v + return s +} + +// SQL Server parameters. +type SqlServerParameters struct { + _ struct{} `type:"structure"` + + // Database. + // + // Database is a required field + Database *string `min:"1" type:"string" required:"true"` + + // Host. + // + // Host is a required field + Host *string `min:"1" type:"string" required:"true"` + + // Port. + // + // Port is a required field + Port *int64 `min:"1" type:"integer" required:"true"` +} + +// String returns the string representation +func (s SqlServerParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SqlServerParameters) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SqlServerParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SqlServerParameters"} + if s.Database == nil { + invalidParams.Add(request.NewErrParamRequired("Database")) + } + if s.Database != nil && len(*s.Database) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Database", 1)) + } + if s.Host == nil { + invalidParams.Add(request.NewErrParamRequired("Host")) + } + if s.Host != nil && len(*s.Host) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Host", 1)) + } + if s.Port == nil { + invalidParams.Add(request.NewErrParamRequired("Port")) + } + if s.Port != nil && *s.Port < 1 { + invalidParams.Add(request.NewErrParamMinValue("Port", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDatabase sets the Database field's value. +func (s *SqlServerParameters) SetDatabase(v string) *SqlServerParameters { + s.Database = &v + return s +} + +// SetHost sets the Host field's value. +func (s *SqlServerParameters) SetHost(v string) *SqlServerParameters { + s.Host = &v + return s +} + +// SetPort sets the Port field's value. +func (s *SqlServerParameters) SetPort(v int64) *SqlServerParameters { + s.Port = &v + return s +} + +// Secure Socket Layer (SSL) properties that apply when QuickSight connects +// to your underlying data source. +type SslProperties struct { + _ struct{} `type:"structure"` + + // A Boolean option to control whether SSL should be disabled. + DisableSsl *bool `type:"boolean"` +} + +// String returns the string representation +func (s SslProperties) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SslProperties) GoString() string { + return s.String() +} + +// SetDisableSsl sets the DisableSsl field's value. +func (s *SslProperties) SetDisableSsl(v bool) *SslProperties { + s.DisableSsl = &v + return s +} + +// String parameter. +type StringParameter struct { + _ struct{} `type:"structure"` + + // A display name for the dataset. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // Values. + // + // Values is a required field + Values []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s StringParameter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StringParameter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StringParameter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StringParameter"} + 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 *StringParameter) SetName(v string) *StringParameter { + s.Name = &v + return s +} + +// SetValues sets the Values field's value. +func (s *StringParameter) SetValues(v []*string) *StringParameter { + s.Values = v + return s +} + +// The key or keys of the key-value pairs for the resource tag or tags assigned +// to the resource. +type Tag struct { + _ struct{} `type:"structure"` + + // Tag key. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // Tag value. + // + // 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 +} + +// A transform operation that tags a column with additional information. +type TagColumnOperation struct { + _ struct{} `type:"structure"` + + // The column that this operation acts on. + // + // ColumnName is a required field + ColumnName *string `min:"1" type:"string" required:"true"` + + // The dataset column tag, currently only used for geospatial type tagging. . + // + // This is not tags for the AWS tagging feature. . + // + // Tags is a required field + Tags []*ColumnTag `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s TagColumnOperation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagColumnOperation) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TagColumnOperation) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TagColumnOperation"} + if s.ColumnName == nil { + invalidParams.Add(request.NewErrParamRequired("ColumnName")) + } + if s.ColumnName != nil && len(*s.ColumnName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ColumnName", 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 +} + +// SetColumnName sets the ColumnName field's value. +func (s *TagColumnOperation) SetColumnName(v string) *TagColumnOperation { + s.ColumnName = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *TagColumnOperation) SetTags(v []*ColumnTag) *TagColumnOperation { + s.Tags = v + return s +} + +type TagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource that you want to tag. + // + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"ResourceArn" type:"string" required:"true"` + + // Contains a map of the key-value pairs for the resource tag or tags assigned + // to the resource. + // + // Tags is a required field + Tags []*Tag `min:"1" 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 && 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 +} + +// 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 +} + +type TagResourceOutput struct { + _ struct{} `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// 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() +} + +// SetRequestId sets the RequestId field's value. +func (s *TagResourceOutput) SetRequestId(v string) *TagResourceOutput { + s.RequestId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *TagResourceOutput) SetStatus(v int64) *TagResourceOutput { + s.Status = &v + return s +} + +// A template object. A template is an entity in QuickSight that encapsulates +// the metadata required to create an analysis and that you can use to create +// a dashboard. A template adds a layer of abstraction by using placeholders +// to replace the dataset associated with the analysis. You can use templates +// to create dashboards by replacing dataset placeholders with datasets that +// follow the same schema that was used to create the source analysis and template. +// +// You can share templates across AWS accounts by allowing users in other AWS +// accounts to create a template or a dashboard from an existing template. +type Template struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the template. + Arn *string `type:"string"` + + // Time when this was created. + CreatedTime *time.Time `type:"timestamp"` + + // Time when this was last updated. + LastUpdatedTime *time.Time `type:"timestamp"` + + // The display name of the template. + Name *string `min:"1" type:"string"` + + // The ID for the template. This is unique per AWS Region for each AWS account. + TemplateId *string `min:"1" type:"string"` + + // A structure describing the versions of the template. + Version *TemplateVersion `type:"structure"` +} + +// String returns the string representation +func (s Template) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Template) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *Template) SetArn(v string) *Template { + s.Arn = &v + return s +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *Template) SetCreatedTime(v time.Time) *Template { + s.CreatedTime = &v + return s +} + +// SetLastUpdatedTime sets the LastUpdatedTime field's value. +func (s *Template) SetLastUpdatedTime(v time.Time) *Template { + s.LastUpdatedTime = &v + return s +} + +// SetName sets the Name field's value. +func (s *Template) SetName(v string) *Template { + s.Name = &v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *Template) SetTemplateId(v string) *Template { + s.TemplateId = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *Template) SetVersion(v *TemplateVersion) *Template { + s.Version = v + return s +} + +// The template alias. +type TemplateAlias struct { + _ struct{} `type:"structure"` + + // The display name of the template alias. + AliasName *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the template alias. + Arn *string `type:"string"` + + // The version number of the template alias. + TemplateVersionNumber *int64 `min:"1" type:"long"` +} + +// String returns the string representation +func (s TemplateAlias) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TemplateAlias) GoString() string { + return s.String() +} + +// SetAliasName sets the AliasName field's value. +func (s *TemplateAlias) SetAliasName(v string) *TemplateAlias { + s.AliasName = &v + return s +} + +// SetArn sets the Arn field's value. +func (s *TemplateAlias) SetArn(v string) *TemplateAlias { + s.Arn = &v + return s +} + +// SetTemplateVersionNumber sets the TemplateVersionNumber field's value. +func (s *TemplateAlias) SetTemplateVersionNumber(v int64) *TemplateAlias { + s.TemplateVersionNumber = &v + return s +} + +// List of errors that occurred when the template version creation failed. +type TemplateError struct { + _ struct{} `type:"structure"` + + // Description of the error type. + Message *string `type:"string"` + + // Type of error. + Type *string `type:"string" enum:"TemplateErrorType"` +} + +// String returns the string representation +func (s TemplateError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TemplateError) GoString() string { + return s.String() +} + +// SetMessage sets the Message field's value. +func (s *TemplateError) SetMessage(v string) *TemplateError { + s.Message = &v + return s +} + +// SetType sets the Type field's value. +func (s *TemplateError) SetType(v string) *TemplateError { + s.Type = &v + return s +} + +// The source analysis of the template. +type TemplateSourceAnalysis struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` + + // A structure containing information about the dataset references used as placeholders + // in the template. + // + // DataSetReferences is a required field + DataSetReferences []*DataSetReference `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s TemplateSourceAnalysis) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TemplateSourceAnalysis) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TemplateSourceAnalysis) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TemplateSourceAnalysis"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } + if s.DataSetReferences == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetReferences")) + } + if s.DataSetReferences != nil && len(s.DataSetReferences) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetReferences", 1)) + } + if s.DataSetReferences != nil { + for i, v := range s.DataSetReferences { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DataSetReferences", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetArn sets the Arn field's value. +func (s *TemplateSourceAnalysis) SetArn(v string) *TemplateSourceAnalysis { + s.Arn = &v + return s +} + +// SetDataSetReferences sets the DataSetReferences field's value. +func (s *TemplateSourceAnalysis) SetDataSetReferences(v []*DataSetReference) *TemplateSourceAnalysis { + s.DataSetReferences = v + return s +} + +// The source entity of the template. +type TemplateSourceEntity struct { + _ struct{} `type:"structure"` + + // The source analysis, if it is based on an analysis. + SourceAnalysis *TemplateSourceAnalysis `type:"structure"` + + // The source template, if it is based on an template. + SourceTemplate *TemplateSourceTemplate `type:"structure"` +} + +// String returns the string representation +func (s TemplateSourceEntity) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TemplateSourceEntity) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TemplateSourceEntity) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TemplateSourceEntity"} + if s.SourceAnalysis != nil { + if err := s.SourceAnalysis.Validate(); err != nil { + invalidParams.AddNested("SourceAnalysis", err.(request.ErrInvalidParams)) + } + } + if s.SourceTemplate != nil { + if err := s.SourceTemplate.Validate(); err != nil { + invalidParams.AddNested("SourceTemplate", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSourceAnalysis sets the SourceAnalysis field's value. +func (s *TemplateSourceEntity) SetSourceAnalysis(v *TemplateSourceAnalysis) *TemplateSourceEntity { + s.SourceAnalysis = v + return s +} + +// SetSourceTemplate sets the SourceTemplate field's value. +func (s *TemplateSourceEntity) SetSourceTemplate(v *TemplateSourceTemplate) *TemplateSourceEntity { + s.SourceTemplate = v + return s +} + +// The source template of the template. +type TemplateSourceTemplate struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + // + // Arn is a required field + Arn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s TemplateSourceTemplate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TemplateSourceTemplate) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TemplateSourceTemplate) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TemplateSourceTemplate"} + if s.Arn == nil { + invalidParams.Add(request.NewErrParamRequired("Arn")) + } if invalidParams.Len() > 0 { return invalidParams @@ -1874,91 +20220,272 @@ func (s *CreateGroupInput) Validate() error { return nil } -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *CreateGroupInput) SetAwsAccountId(v string) *CreateGroupInput { - s.AwsAccountId = &v +// SetArn sets the Arn field's value. +func (s *TemplateSourceTemplate) SetArn(v string) *TemplateSourceTemplate { + s.Arn = &v + return s +} + +// The template summary. +type TemplateSummary struct { + _ struct{} `type:"structure"` + + // A summary of a template. + Arn *string `type:"string"` + + // The last time that this template was created. + CreatedTime *time.Time `type:"timestamp"` + + // The last time that this template was updated. + LastUpdatedTime *time.Time `type:"timestamp"` + + // A structure containing a list of version numbers for the template summary. + LatestVersionNumber *int64 `min:"1" type:"long"` + + // A display name for the template. + Name *string `min:"1" type:"string"` + + // The ID of the template. This ID is unique per AWS Region for each AWS account. + TemplateId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s TemplateSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TemplateSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *TemplateSummary) SetArn(v string) *TemplateSummary { + s.Arn = &v + return s +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *TemplateSummary) SetCreatedTime(v time.Time) *TemplateSummary { + s.CreatedTime = &v + return s +} + +// SetLastUpdatedTime sets the LastUpdatedTime field's value. +func (s *TemplateSummary) SetLastUpdatedTime(v time.Time) *TemplateSummary { + s.LastUpdatedTime = &v + return s +} + +// SetLatestVersionNumber sets the LatestVersionNumber field's value. +func (s *TemplateSummary) SetLatestVersionNumber(v int64) *TemplateSummary { + s.LatestVersionNumber = &v + return s +} + +// SetName sets the Name field's value. +func (s *TemplateSummary) SetName(v string) *TemplateSummary { + s.Name = &v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *TemplateSummary) SetTemplateId(v string) *TemplateSummary { + s.TemplateId = &v + return s +} + +// A version of a template. +type TemplateVersion struct { + _ struct{} `type:"structure"` + + // The time that this template version was created. + CreatedTime *time.Time `type:"timestamp"` + + // Schema of the dataset identified by the placeholder. The idea is that any + // dashboard created from the template should be bound to new datasets matching + // the same schema described through this API. . + DataSetConfigurations []*DataSetConfiguration `type:"list"` + + // The description of the template. + Description *string `min:"1" type:"string"` + + // Errors associated with the template. + Errors []*TemplateError `min:"1" type:"list"` + + // The Amazon Resource Name (ARN) of the analysis or template which was used + // to create this template. + SourceEntityArn *string `type:"string"` + + // The HTTP status of the request. + Status *string `type:"string" enum:"ResourceStatus"` + + // The version number of the template. + VersionNumber *int64 `min:"1" type:"long"` +} + +// String returns the string representation +func (s TemplateVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TemplateVersion) GoString() string { + return s.String() +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *TemplateVersion) SetCreatedTime(v time.Time) *TemplateVersion { + s.CreatedTime = &v + return s +} + +// SetDataSetConfigurations sets the DataSetConfigurations field's value. +func (s *TemplateVersion) SetDataSetConfigurations(v []*DataSetConfiguration) *TemplateVersion { + s.DataSetConfigurations = v + return s +} + +// SetDescription sets the Description field's value. +func (s *TemplateVersion) SetDescription(v string) *TemplateVersion { + s.Description = &v + return s +} + +// SetErrors sets the Errors field's value. +func (s *TemplateVersion) SetErrors(v []*TemplateError) *TemplateVersion { + s.Errors = v + return s +} + +// SetSourceEntityArn sets the SourceEntityArn field's value. +func (s *TemplateVersion) SetSourceEntityArn(v string) *TemplateVersion { + s.SourceEntityArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *TemplateVersion) SetStatus(v string) *TemplateVersion { + s.Status = &v + return s +} + +// SetVersionNumber sets the VersionNumber field's value. +func (s *TemplateVersion) SetVersionNumber(v int64) *TemplateVersion { + s.VersionNumber = &v + return s +} + +// The template version. +type TemplateVersionSummary struct { + _ struct{} `type:"structure"` + + // The ARN of the template version. + Arn *string `type:"string"` + + // The time that this template version was created. + CreatedTime *time.Time `type:"timestamp"` + + // The description of the template version. + Description *string `min:"1" type:"string"` + + // The status of the template version. + Status *string `type:"string" enum:"ResourceStatus"` + + // The version number of the template version. + VersionNumber *int64 `min:"1" type:"long"` +} + +// String returns the string representation +func (s TemplateVersionSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TemplateVersionSummary) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *TemplateVersionSummary) SetArn(v string) *TemplateVersionSummary { + s.Arn = &v + return s +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *TemplateVersionSummary) SetCreatedTime(v time.Time) *TemplateVersionSummary { + s.CreatedTime = &v return s } // SetDescription sets the Description field's value. -func (s *CreateGroupInput) SetDescription(v string) *CreateGroupInput { +func (s *TemplateVersionSummary) SetDescription(v string) *TemplateVersionSummary { s.Description = &v return s } -// SetGroupName sets the GroupName field's value. -func (s *CreateGroupInput) SetGroupName(v string) *CreateGroupInput { - s.GroupName = &v +// SetStatus sets the Status field's value. +func (s *TemplateVersionSummary) SetStatus(v string) *TemplateVersionSummary { + s.Status = &v return s } -// SetNamespace sets the Namespace field's value. -func (s *CreateGroupInput) SetNamespace(v string) *CreateGroupInput { - s.Namespace = &v +// SetVersionNumber sets the VersionNumber field's value. +func (s *TemplateVersionSummary) SetVersionNumber(v int64) *TemplateVersionSummary { + s.VersionNumber = &v return s } -type CreateGroupMembershipInput struct { +// Teradata parameters. +type TeradataParameters struct { _ struct{} `type:"structure"` - // The ID for the AWS account that the group is in. Currently, you use the ID - // for the AWS account that contains your Amazon QuickSight account. - // - // AwsAccountId is a required field - AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` - - // The name of the group that you want to add the user to. + // Database. // - // GroupName is a required field - GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"` + // Database is a required field + Database *string `min:"1" type:"string" required:"true"` - // The name of the user that you want to add to the group membership. + // Host. // - // MemberName is a required field - MemberName *string `location:"uri" locationName:"MemberName" min:"1" type:"string" required:"true"` + // Host is a required field + Host *string `min:"1" type:"string" required:"true"` - // The namespace. Currently, you should set this to default. + // Port. // - // Namespace is a required field - Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + // Port is a required field + Port *int64 `min:"1" type:"integer" required:"true"` } // String returns the string representation -func (s CreateGroupMembershipInput) String() string { +func (s TeradataParameters) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateGroupMembershipInput) GoString() string { +func (s TeradataParameters) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateGroupMembershipInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateGroupMembershipInput"} - if s.AwsAccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) - } - if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { - invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) +func (s *TeradataParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TeradataParameters"} + if s.Database == nil { + invalidParams.Add(request.NewErrParamRequired("Database")) } - 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.Database != nil && len(*s.Database) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Database", 1)) } - if s.MemberName == nil { - invalidParams.Add(request.NewErrParamRequired("MemberName")) + if s.Host == nil { + invalidParams.Add(request.NewErrParamRequired("Host")) } - if s.MemberName != nil && len(*s.MemberName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MemberName", 1)) + if s.Host != nil && len(*s.Host) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Host", 1)) } - if s.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) + if s.Port == nil { + invalidParams.Add(request.NewErrParamRequired("Port")) } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + if s.Port != nil && *s.Port < 1 { + invalidParams.Add(request.NewErrParamMinValue("Port", 1)) } if invalidParams.Len() > 0 { @@ -1967,163 +20494,355 @@ func (s *CreateGroupMembershipInput) Validate() error { return nil } -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *CreateGroupMembershipInput) SetAwsAccountId(v string) *CreateGroupMembershipInput { - s.AwsAccountId = &v +// SetDatabase sets the Database field's value. +func (s *TeradataParameters) SetDatabase(v string) *TeradataParameters { + s.Database = &v return s } -// SetGroupName sets the GroupName field's value. -func (s *CreateGroupMembershipInput) SetGroupName(v string) *CreateGroupMembershipInput { - s.GroupName = &v +// SetHost sets the Host field's value. +func (s *TeradataParameters) SetHost(v string) *TeradataParameters { + s.Host = &v return s } -// SetMemberName sets the MemberName field's value. -func (s *CreateGroupMembershipInput) SetMemberName(v string) *CreateGroupMembershipInput { - s.MemberName = &v +// SetPort sets the Port field's value. +func (s *TeradataParameters) SetPort(v int64) *TeradataParameters { + s.Port = &v return s } -// SetNamespace sets the Namespace field's value. -func (s *CreateGroupMembershipInput) SetNamespace(v string) *CreateGroupMembershipInput { - s.Namespace = &v - return s +// Access is throttled. +type ThrottlingException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request ID for this request. + RequestId *string `type:"string"` } -type CreateGroupMembershipOutput struct { +// String returns the string representation +func (s ThrottlingException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ThrottlingException) GoString() string { + return s.String() +} + +func newErrorThrottlingException(v protocol.ResponseMetadata) error { + return &ThrottlingException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ThrottlingException) Code() string { + return "ThrottlingException" +} + +// Message returns the exception's message. +func (s ThrottlingException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ThrottlingException) OrigErr() error { + return nil +} + +func (s ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ThrottlingException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ThrottlingException) RequestID() string { + return s.respMetadata.RequestID +} + +// A data transformation on a logical table. This is a variant type structure. +// For this structure to be valid, only one of the attributes can be non-null. +type TransformOperation struct { _ struct{} `type:"structure"` - // The group member. - GroupMember *GroupMember `type:"structure"` + // A transform operation that casts a column to a different type. + CastColumnTypeOperation *CastColumnTypeOperation `type:"structure"` - // The AWS request ID for this operation. - RequestId *string `type:"string"` + // An operation that creates calculated columns. Columns created in one such + // operation form a lexical closure. + CreateColumnsOperation *CreateColumnsOperation `type:"structure"` - // The http status of the request. - Status *int64 `location:"statusCode" type:"integer"` + // An operation that filters rows based on some condition. + FilterOperation *FilterOperation `type:"structure"` + + // An operation that projects columns. Operations that come after a projection + // can only refer to projected columns. + ProjectOperation *ProjectOperation `type:"structure"` + + // An operation that renames a column. + RenameColumnOperation *RenameColumnOperation `type:"structure"` + + // An operation that tags a column with additional information. + TagColumnOperation *TagColumnOperation `type:"structure"` } // String returns the string representation -func (s CreateGroupMembershipOutput) String() string { +func (s TransformOperation) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateGroupMembershipOutput) GoString() string { +func (s TransformOperation) GoString() string { return s.String() } -// SetGroupMember sets the GroupMember field's value. -func (s *CreateGroupMembershipOutput) SetGroupMember(v *GroupMember) *CreateGroupMembershipOutput { - s.GroupMember = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *TransformOperation) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TransformOperation"} + if s.CastColumnTypeOperation != nil { + if err := s.CastColumnTypeOperation.Validate(); err != nil { + invalidParams.AddNested("CastColumnTypeOperation", err.(request.ErrInvalidParams)) + } + } + if s.CreateColumnsOperation != nil { + if err := s.CreateColumnsOperation.Validate(); err != nil { + invalidParams.AddNested("CreateColumnsOperation", err.(request.ErrInvalidParams)) + } + } + if s.FilterOperation != nil { + if err := s.FilterOperation.Validate(); err != nil { + invalidParams.AddNested("FilterOperation", err.(request.ErrInvalidParams)) + } + } + if s.ProjectOperation != nil { + if err := s.ProjectOperation.Validate(); err != nil { + invalidParams.AddNested("ProjectOperation", err.(request.ErrInvalidParams)) + } + } + if s.RenameColumnOperation != nil { + if err := s.RenameColumnOperation.Validate(); err != nil { + invalidParams.AddNested("RenameColumnOperation", err.(request.ErrInvalidParams)) + } + } + if s.TagColumnOperation != nil { + if err := s.TagColumnOperation.Validate(); err != nil { + invalidParams.AddNested("TagColumnOperation", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCastColumnTypeOperation sets the CastColumnTypeOperation field's value. +func (s *TransformOperation) SetCastColumnTypeOperation(v *CastColumnTypeOperation) *TransformOperation { + s.CastColumnTypeOperation = v return s } -// SetRequestId sets the RequestId field's value. -func (s *CreateGroupMembershipOutput) SetRequestId(v string) *CreateGroupMembershipOutput { - s.RequestId = &v +// SetCreateColumnsOperation sets the CreateColumnsOperation field's value. +func (s *TransformOperation) SetCreateColumnsOperation(v *CreateColumnsOperation) *TransformOperation { + s.CreateColumnsOperation = v return s } -// SetStatus sets the Status field's value. -func (s *CreateGroupMembershipOutput) SetStatus(v int64) *CreateGroupMembershipOutput { - s.Status = &v +// SetFilterOperation sets the FilterOperation field's value. +func (s *TransformOperation) SetFilterOperation(v *FilterOperation) *TransformOperation { + s.FilterOperation = v return s } -// The response object for this operation. -type CreateGroupOutput struct { - _ struct{} `type:"structure"` +// SetProjectOperation sets the ProjectOperation field's value. +func (s *TransformOperation) SetProjectOperation(v *ProjectOperation) *TransformOperation { + s.ProjectOperation = v + return s +} - // The name of the group. - Group *Group `type:"structure"` +// SetRenameColumnOperation sets the RenameColumnOperation field's value. +func (s *TransformOperation) SetRenameColumnOperation(v *RenameColumnOperation) *TransformOperation { + s.RenameColumnOperation = v + return s +} - // The AWS request ID for this operation. - RequestId *string `type:"string"` +// SetTagColumnOperation sets the TagColumnOperation field's value. +func (s *TransformOperation) SetTagColumnOperation(v *TagColumnOperation) *TransformOperation { + s.TagColumnOperation = v + return s +} - // The http status of the request. - Status *int64 `location:"statusCode" type:"integer"` +// Twitter parameters. +type TwitterParameters struct { + _ struct{} `type:"structure"` + + // Maximum number of rows to query Twitter. + // + // MaxRows is a required field + MaxRows *int64 `min:"1" type:"integer" required:"true"` + + // Twitter query string. + // + // Query is a required field + Query *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s CreateGroupOutput) String() string { +func (s TwitterParameters) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateGroupOutput) GoString() string { +func (s TwitterParameters) GoString() string { return s.String() } -// SetGroup sets the Group field's value. -func (s *CreateGroupOutput) SetGroup(v *Group) *CreateGroupOutput { - s.Group = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *TwitterParameters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TwitterParameters"} + if s.MaxRows == nil { + invalidParams.Add(request.NewErrParamRequired("MaxRows")) + } + if s.MaxRows != nil && *s.MaxRows < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxRows", 1)) + } + if s.Query == nil { + invalidParams.Add(request.NewErrParamRequired("Query")) + } + if s.Query != nil && len(*s.Query) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Query", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetRequestId sets the RequestId field's value. -func (s *CreateGroupOutput) SetRequestId(v string) *CreateGroupOutput { - s.RequestId = &v +// SetMaxRows sets the MaxRows field's value. +func (s *TwitterParameters) SetMaxRows(v int64) *TwitterParameters { + s.MaxRows = &v return s } -// SetStatus sets the Status field's value. -func (s *CreateGroupOutput) SetStatus(v int64) *CreateGroupOutput { - s.Status = &v +// SetQuery sets the Query field's value. +func (s *TwitterParameters) SetQuery(v string) *TwitterParameters { + s.Query = &v return s } -type DeleteGroupInput struct { - _ struct{} `type:"structure"` +// This error indicates that you are calling an operation on an Amazon QuickSight +// subscription where the edition doesn't include support for that operation. +// Amazon QuickSight currently has Standard Edition and Enterprise Edition. +// Not every operation and capability is available in every edition. +type UnsupportedUserEditionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The ID for the AWS account that the group is in. Currently, you use the ID - // for the AWS account that contains your Amazon QuickSight account. - // - // AwsAccountId is a required field - AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` + Message_ *string `locationName:"Message" type:"string"` - // The name of the group that you want to delete. + // The AWS request ID for this request. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s UnsupportedUserEditionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedUserEditionException) GoString() string { + return s.String() +} + +func newErrorUnsupportedUserEditionException(v protocol.ResponseMetadata) error { + return &UnsupportedUserEditionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedUserEditionException) Code() string { + return "UnsupportedUserEditionException" +} + +// Message returns the exception's message. +func (s UnsupportedUserEditionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedUserEditionException) OrigErr() error { + return nil +} + +func (s UnsupportedUserEditionException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedUserEditionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedUserEditionException) RequestID() string { + return s.respMetadata.RequestID +} + +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource that you want to untag. // - // GroupName is a required field - GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"` + // ResourceArn is a required field + ResourceArn *string `location:"uri" locationName:"ResourceArn" type:"string" required:"true"` - // The namespace. Currently, you should set this to default. + // The keys of the key-value pairs for the resource tag or tags assigned to + // the resource. // - // Namespace is a required field - Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + // TagKeys is a required field + TagKeys []*string `location:"querystring" locationName:"keys" min:"1" type:"list" required:"true"` } // String returns the string representation -func (s DeleteGroupInput) String() string { +func (s UntagResourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteGroupInput) GoString() string { +func (s UntagResourceInput) 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.AwsAccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) - } - if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { - invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) - } - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) +func (s *UntagResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + if s.ResourceArn != nil && len(*s.ResourceArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 1)) } - if s.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) + if s.TagKeys == nil { + invalidParams.Add(request.NewErrParamRequired("TagKeys")) } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + if s.TagKeys != nil && len(s.TagKeys) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TagKeys", 1)) } if invalidParams.Len() > 0 { @@ -2132,85 +20851,146 @@ func (s *DeleteGroupInput) Validate() error { return nil } -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *DeleteGroupInput) SetAwsAccountId(v string) *DeleteGroupInput { - s.AwsAccountId = &v +// SetResourceArn sets the ResourceArn field's value. +func (s *UntagResourceInput) SetResourceArn(v string) *UntagResourceInput { + s.ResourceArn = &v return s } -// SetGroupName sets the GroupName field's value. -func (s *DeleteGroupInput) SetGroupName(v string) *DeleteGroupInput { - s.GroupName = &v +// SetTagKeys sets the TagKeys field's value. +func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { + s.TagKeys = v + return s +} + +type UntagResourceOutput struct { + _ struct{} `type:"structure"` + + // The AWS request ID for this operation. + RequestId *string `type:"string"` + + // The HTTP status of the request. + Status *int64 `location:"statusCode" type:"integer"` +} + +// 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() +} + +// SetRequestId sets the RequestId field's value. +func (s *UntagResourceOutput) SetRequestId(v string) *UntagResourceOutput { + s.RequestId = &v return s } -// SetNamespace sets the Namespace field's value. -func (s *DeleteGroupInput) SetNamespace(v string) *DeleteGroupInput { - s.Namespace = &v +// SetStatus sets the Status field's value. +func (s *UntagResourceOutput) SetStatus(v int64) *UntagResourceOutput { + s.Status = &v return s } -type DeleteGroupMembershipInput struct { +type UpdateDashboardInput struct { _ struct{} `type:"structure"` - // The ID for the AWS account that the group is in. Currently, you use the ID - // for the AWS account that contains your Amazon QuickSight account. + // The ID of the AWS account that contains the dashboard that you're updating. // // AwsAccountId is a required field AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` - // The name of the group that you want to delete the user from. + // The ID for the dashboard. // - // GroupName is a required field - GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"` + // DashboardId is a required field + DashboardId *string `location:"uri" locationName:"DashboardId" min:"1" type:"string" required:"true"` - // The name of the user that you want to delete from the group membership. + // Options for publishing the dashboard when you create it: // - // MemberName is a required field - MemberName *string `location:"uri" locationName:"MemberName" min:"1" type:"string" required:"true"` + // * AvailabilityStatus for AdHocFilteringOption - This status can be either + // ENABLED or DISABLED. When this is set to DISABLED, QuickSight disables + // the left filter pane on the published dashboard, which can be used for + // ad hoc (one-time) filtering. This option is ENABLED by default. + // + // * AvailabilityStatus for ExportToCSVOption - This status can be either + // ENABLED or DISABLED. The visual option to export data to .csv format isn't + // enabled when this is set to DISABLED. This option is ENABLED by default. + // + // * VisibilityState for SheetControlsOption - This visibility state can + // be either COLLAPSED or EXPANDED. The sheet controls pane is collapsed + // by default when set to true. This option is COLLAPSED by default. + DashboardPublishOptions *DashboardPublishOptions `type:"structure"` - // The namespace. Currently, you should set this to default. + // The display name of the dashboard. // - // Namespace is a required field - Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // A structure that contains the parameters of the dashboard. + Parameters *Parameters `type:"structure"` + + // The template or analysis from which the dashboard is created. The SouceTemplate + // entity accepts the Amazon Resource Name (ARN) of the template and also references + // to replacement datasets for the placeholders set when creating the template. + // The replacement datasets need to follow the same schema as the datasets for + // which placeholders were created when creating the template. + // + // SourceEntity is a required field + SourceEntity *DashboardSourceEntity `type:"structure" required:"true"` + + // A description for the first version of the dashboard being created. + VersionDescription *string `min:"1" type:"string"` } // String returns the string representation -func (s DeleteGroupMembershipInput) String() string { +func (s UpdateDashboardInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteGroupMembershipInput) GoString() string { +func (s UpdateDashboardInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteGroupMembershipInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteGroupMembershipInput"} +func (s *UpdateDashboardInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateDashboardInput"} if s.AwsAccountId == nil { invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) } if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) } - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) + if s.DashboardId == nil { + invalidParams.Add(request.NewErrParamRequired("DashboardId")) } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + if s.DashboardId != nil && len(*s.DashboardId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DashboardId", 1)) } - if s.MemberName == nil { - invalidParams.Add(request.NewErrParamRequired("MemberName")) + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) } - if s.MemberName != nil && len(*s.MemberName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MemberName", 1)) + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) } - if s.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) + if s.SourceEntity == nil { + invalidParams.Add(request.NewErrParamRequired("SourceEntity")) } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + if s.VersionDescription != nil && len(*s.VersionDescription) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VersionDescription", 1)) + } + if s.Parameters != nil { + if err := s.Parameters.Validate(); err != nil { + invalidParams.AddNested("Parameters", err.(request.ErrInvalidParams)) + } + } + if s.SourceEntity != nil { + if err := s.SourceEntity.Validate(); err != nil { + invalidParams.AddNested("SourceEntity", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -2220,143 +21000,186 @@ func (s *DeleteGroupMembershipInput) Validate() error { } // SetAwsAccountId sets the AwsAccountId field's value. -func (s *DeleteGroupMembershipInput) SetAwsAccountId(v string) *DeleteGroupMembershipInput { +func (s *UpdateDashboardInput) SetAwsAccountId(v string) *UpdateDashboardInput { s.AwsAccountId = &v return s } -// SetGroupName sets the GroupName field's value. -func (s *DeleteGroupMembershipInput) SetGroupName(v string) *DeleteGroupMembershipInput { - s.GroupName = &v +// SetDashboardId sets the DashboardId field's value. +func (s *UpdateDashboardInput) SetDashboardId(v string) *UpdateDashboardInput { + s.DashboardId = &v return s } -// SetMemberName sets the MemberName field's value. -func (s *DeleteGroupMembershipInput) SetMemberName(v string) *DeleteGroupMembershipInput { - s.MemberName = &v +// SetDashboardPublishOptions sets the DashboardPublishOptions field's value. +func (s *UpdateDashboardInput) SetDashboardPublishOptions(v *DashboardPublishOptions) *UpdateDashboardInput { + s.DashboardPublishOptions = v return s } -// SetNamespace sets the Namespace field's value. -func (s *DeleteGroupMembershipInput) SetNamespace(v string) *DeleteGroupMembershipInput { - s.Namespace = &v +// SetName sets the Name field's value. +func (s *UpdateDashboardInput) SetName(v string) *UpdateDashboardInput { + s.Name = &v return s } -type DeleteGroupMembershipOutput struct { - _ struct{} `type:"structure"` - - // The AWS request ID for this operation. - RequestId *string `type:"string"` - - // The http status of the request. - Status *int64 `location:"statusCode" type:"integer"` -} - -// String returns the string representation -func (s DeleteGroupMembershipOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DeleteGroupMembershipOutput) GoString() string { - return s.String() +// SetParameters sets the Parameters field's value. +func (s *UpdateDashboardInput) SetParameters(v *Parameters) *UpdateDashboardInput { + s.Parameters = v + return s } -// SetRequestId sets the RequestId field's value. -func (s *DeleteGroupMembershipOutput) SetRequestId(v string) *DeleteGroupMembershipOutput { - s.RequestId = &v +// SetSourceEntity sets the SourceEntity field's value. +func (s *UpdateDashboardInput) SetSourceEntity(v *DashboardSourceEntity) *UpdateDashboardInput { + s.SourceEntity = v return s } -// SetStatus sets the Status field's value. -func (s *DeleteGroupMembershipOutput) SetStatus(v int64) *DeleteGroupMembershipOutput { - s.Status = &v +// SetVersionDescription sets the VersionDescription field's value. +func (s *UpdateDashboardInput) SetVersionDescription(v string) *UpdateDashboardInput { + s.VersionDescription = &v return s } -type DeleteGroupOutput struct { +type UpdateDashboardOutput struct { _ struct{} `type:"structure"` + // The Amazon Resource Name (ARN) of the resource. + Arn *string `type:"string"` + + // The creation status of the request. + CreationStatus *string `type:"string" enum:"ResourceStatus"` + + // The ID for the dashboard. + DashboardId *string `min:"1" type:"string"` + // The AWS request ID for this operation. RequestId *string `type:"string"` - // The http status of the request. - Status *int64 `location:"statusCode" type:"integer"` + // The HTTP status of the request. + Status *int64 `type:"integer"` + + // The ARN of the dashboard, including the version number. + VersionArn *string `type:"string"` } // String returns the string representation -func (s DeleteGroupOutput) String() string { +func (s UpdateDashboardOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteGroupOutput) GoString() string { +func (s UpdateDashboardOutput) GoString() string { return s.String() } +// SetArn sets the Arn field's value. +func (s *UpdateDashboardOutput) SetArn(v string) *UpdateDashboardOutput { + s.Arn = &v + return s +} + +// SetCreationStatus sets the CreationStatus field's value. +func (s *UpdateDashboardOutput) SetCreationStatus(v string) *UpdateDashboardOutput { + s.CreationStatus = &v + return s +} + +// SetDashboardId sets the DashboardId field's value. +func (s *UpdateDashboardOutput) SetDashboardId(v string) *UpdateDashboardOutput { + s.DashboardId = &v + return s +} + // SetRequestId sets the RequestId field's value. -func (s *DeleteGroupOutput) SetRequestId(v string) *DeleteGroupOutput { +func (s *UpdateDashboardOutput) SetRequestId(v string) *UpdateDashboardOutput { s.RequestId = &v return s } // SetStatus sets the Status field's value. -func (s *DeleteGroupOutput) SetStatus(v int64) *DeleteGroupOutput { +func (s *UpdateDashboardOutput) SetStatus(v int64) *UpdateDashboardOutput { s.Status = &v return s } -type DeleteUserByPrincipalIdInput struct { +// SetVersionArn sets the VersionArn field's value. +func (s *UpdateDashboardOutput) SetVersionArn(v string) *UpdateDashboardOutput { + s.VersionArn = &v + return s +} + +type UpdateDashboardPermissionsInput struct { _ struct{} `type:"structure"` - // The ID for the AWS account that the user is in. Currently, you use the ID - // for the AWS account that contains your Amazon QuickSight account. + // The ID of the AWS account that contains the dashboard whose permissions you're + // updating. // // AwsAccountId is a required field AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` - // The namespace. Currently, you should set this to default. + // The ID for the dashboard. // - // Namespace is a required field - Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + // DashboardId is a required field + DashboardId *string `location:"uri" locationName:"DashboardId" min:"1" type:"string" required:"true"` - // The principal ID of the user. - // - // PrincipalId is a required field - PrincipalId *string `location:"uri" locationName:"PrincipalId" type:"string" required:"true"` + // The permissions that you want to grant on this resource. + GrantPermissions []*ResourcePermission `min:"1" type:"list"` + + // The permissions that you want to revoke from this resource. + RevokePermissions []*ResourcePermission `min:"1" type:"list"` } // String returns the string representation -func (s DeleteUserByPrincipalIdInput) String() string { +func (s UpdateDashboardPermissionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteUserByPrincipalIdInput) GoString() string { +func (s UpdateDashboardPermissionsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteUserByPrincipalIdInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteUserByPrincipalIdInput"} +func (s *UpdateDashboardPermissionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateDashboardPermissionsInput"} if s.AwsAccountId == nil { invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) } if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) } - if s.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) + if s.DashboardId == nil { + invalidParams.Add(request.NewErrParamRequired("DashboardId")) } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + if s.DashboardId != nil && len(*s.DashboardId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DashboardId", 1)) } - if s.PrincipalId == nil { - invalidParams.Add(request.NewErrParamRequired("PrincipalId")) + if s.GrantPermissions != nil && len(s.GrantPermissions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GrantPermissions", 1)) } - if s.PrincipalId != nil && len(*s.PrincipalId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("PrincipalId", 1)) + if s.RevokePermissions != nil && len(s.RevokePermissions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RevokePermissions", 1)) + } + if s.GrantPermissions != nil { + for i, v := range s.GrantPermissions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GrantPermissions", i), err.(request.ErrInvalidParams)) + } + } + } + if s.RevokePermissions != nil { + for i, v := range s.RevokePermissions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RevokePermissions", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -2366,105 +21189,137 @@ func (s *DeleteUserByPrincipalIdInput) Validate() error { } // SetAwsAccountId sets the AwsAccountId field's value. -func (s *DeleteUserByPrincipalIdInput) SetAwsAccountId(v string) *DeleteUserByPrincipalIdInput { +func (s *UpdateDashboardPermissionsInput) SetAwsAccountId(v string) *UpdateDashboardPermissionsInput { s.AwsAccountId = &v return s } -// SetNamespace sets the Namespace field's value. -func (s *DeleteUserByPrincipalIdInput) SetNamespace(v string) *DeleteUserByPrincipalIdInput { - s.Namespace = &v +// SetDashboardId sets the DashboardId field's value. +func (s *UpdateDashboardPermissionsInput) SetDashboardId(v string) *UpdateDashboardPermissionsInput { + s.DashboardId = &v return s } -// SetPrincipalId sets the PrincipalId field's value. -func (s *DeleteUserByPrincipalIdInput) SetPrincipalId(v string) *DeleteUserByPrincipalIdInput { - s.PrincipalId = &v +// SetGrantPermissions sets the GrantPermissions field's value. +func (s *UpdateDashboardPermissionsInput) SetGrantPermissions(v []*ResourcePermission) *UpdateDashboardPermissionsInput { + s.GrantPermissions = v return s } -type DeleteUserByPrincipalIdOutput struct { +// SetRevokePermissions sets the RevokePermissions field's value. +func (s *UpdateDashboardPermissionsInput) SetRevokePermissions(v []*ResourcePermission) *UpdateDashboardPermissionsInput { + s.RevokePermissions = v + return s +} + +type UpdateDashboardPermissionsOutput struct { _ struct{} `type:"structure"` + // The Amazon Resource Name (ARN) of the dashboard. + DashboardArn *string `type:"string"` + + // The ID for the dashboard. + DashboardId *string `min:"1" type:"string"` + + // Information about the permissions on the dashboard. + Permissions []*ResourcePermission `min:"1" type:"list"` + // The AWS request ID for this operation. RequestId *string `type:"string"` - // The http status of the request. + // The HTTP status of the request. Status *int64 `location:"statusCode" type:"integer"` } // String returns the string representation -func (s DeleteUserByPrincipalIdOutput) String() string { +func (s UpdateDashboardPermissionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteUserByPrincipalIdOutput) GoString() string { +func (s UpdateDashboardPermissionsOutput) GoString() string { return s.String() } +// SetDashboardArn sets the DashboardArn field's value. +func (s *UpdateDashboardPermissionsOutput) SetDashboardArn(v string) *UpdateDashboardPermissionsOutput { + s.DashboardArn = &v + return s +} + +// SetDashboardId sets the DashboardId field's value. +func (s *UpdateDashboardPermissionsOutput) SetDashboardId(v string) *UpdateDashboardPermissionsOutput { + s.DashboardId = &v + return s +} + +// SetPermissions sets the Permissions field's value. +func (s *UpdateDashboardPermissionsOutput) SetPermissions(v []*ResourcePermission) *UpdateDashboardPermissionsOutput { + s.Permissions = v + return s +} + // SetRequestId sets the RequestId field's value. -func (s *DeleteUserByPrincipalIdOutput) SetRequestId(v string) *DeleteUserByPrincipalIdOutput { +func (s *UpdateDashboardPermissionsOutput) SetRequestId(v string) *UpdateDashboardPermissionsOutput { s.RequestId = &v return s } // SetStatus sets the Status field's value. -func (s *DeleteUserByPrincipalIdOutput) SetStatus(v int64) *DeleteUserByPrincipalIdOutput { +func (s *UpdateDashboardPermissionsOutput) SetStatus(v int64) *UpdateDashboardPermissionsOutput { s.Status = &v return s } -type DeleteUserInput struct { +type UpdateDashboardPublishedVersionInput struct { _ struct{} `type:"structure"` - // The ID for the AWS account that the user is in. Currently, you use the ID - // for the AWS account that contains your Amazon QuickSight account. + // The ID of the AWS account that contains the dashboard that you're updating. // // AwsAccountId is a required field AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` - // The namespace. Currently, you should set this to default. + // The ID for the dashboard. // - // Namespace is a required field - Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + // DashboardId is a required field + DashboardId *string `location:"uri" locationName:"DashboardId" min:"1" type:"string" required:"true"` - // The name of the user that you want to delete. + // The version number of the dashboard. // - // UserName is a required field - UserName *string `location:"uri" locationName:"UserName" min:"1" type:"string" required:"true"` + // VersionNumber is a required field + VersionNumber *int64 `location:"uri" locationName:"VersionNumber" min:"1" type:"long" required:"true"` } // String returns the string representation -func (s DeleteUserInput) String() string { +func (s UpdateDashboardPublishedVersionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteUserInput) GoString() string { +func (s UpdateDashboardPublishedVersionInput) 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"} +func (s *UpdateDashboardPublishedVersionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateDashboardPublishedVersionInput"} if s.AwsAccountId == nil { invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) } if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) } - if s.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) + if s.DashboardId == nil { + invalidParams.Add(request.NewErrParamRequired("DashboardId")) } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + if s.DashboardId != nil && len(*s.DashboardId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DashboardId", 1)) } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) + if s.VersionNumber == nil { + invalidParams.Add(request.NewErrParamRequired("VersionNumber")) } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + if s.VersionNumber != nil && *s.VersionNumber < 1 { + invalidParams.Add(request.NewErrParamMinValue("VersionNumber", 1)) } if invalidParams.Len() > 0 { @@ -2474,105 +21329,194 @@ func (s *DeleteUserInput) Validate() error { } // SetAwsAccountId sets the AwsAccountId field's value. -func (s *DeleteUserInput) SetAwsAccountId(v string) *DeleteUserInput { +func (s *UpdateDashboardPublishedVersionInput) SetAwsAccountId(v string) *UpdateDashboardPublishedVersionInput { s.AwsAccountId = &v return s } -// SetNamespace sets the Namespace field's value. -func (s *DeleteUserInput) SetNamespace(v string) *DeleteUserInput { - s.Namespace = &v +// SetDashboardId sets the DashboardId field's value. +func (s *UpdateDashboardPublishedVersionInput) SetDashboardId(v string) *UpdateDashboardPublishedVersionInput { + s.DashboardId = &v return s } -// SetUserName sets the UserName field's value. -func (s *DeleteUserInput) SetUserName(v string) *DeleteUserInput { - s.UserName = &v +// SetVersionNumber sets the VersionNumber field's value. +func (s *UpdateDashboardPublishedVersionInput) SetVersionNumber(v int64) *UpdateDashboardPublishedVersionInput { + s.VersionNumber = &v return s } -type DeleteUserOutput struct { +type UpdateDashboardPublishedVersionOutput struct { _ struct{} `type:"structure"` + // The Amazon Resource Name (ARN) of the dashboard. + DashboardArn *string `type:"string"` + + // The ID for the dashboard. + DashboardId *string `min:"1" type:"string"` + // The AWS request ID for this operation. RequestId *string `type:"string"` - // The http status of the request. + // The HTTP status of the request. Status *int64 `location:"statusCode" type:"integer"` } // String returns the string representation -func (s DeleteUserOutput) String() string { +func (s UpdateDashboardPublishedVersionOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteUserOutput) GoString() string { +func (s UpdateDashboardPublishedVersionOutput) GoString() string { return s.String() } +// SetDashboardArn sets the DashboardArn field's value. +func (s *UpdateDashboardPublishedVersionOutput) SetDashboardArn(v string) *UpdateDashboardPublishedVersionOutput { + s.DashboardArn = &v + return s +} + +// SetDashboardId sets the DashboardId field's value. +func (s *UpdateDashboardPublishedVersionOutput) SetDashboardId(v string) *UpdateDashboardPublishedVersionOutput { + s.DashboardId = &v + return s +} + // SetRequestId sets the RequestId field's value. -func (s *DeleteUserOutput) SetRequestId(v string) *DeleteUserOutput { +func (s *UpdateDashboardPublishedVersionOutput) SetRequestId(v string) *UpdateDashboardPublishedVersionOutput { s.RequestId = &v return s } // SetStatus sets the Status field's value. -func (s *DeleteUserOutput) SetStatus(v int64) *DeleteUserOutput { +func (s *UpdateDashboardPublishedVersionOutput) SetStatus(v int64) *UpdateDashboardPublishedVersionOutput { s.Status = &v return s } -type DescribeGroupInput struct { +type UpdateDataSetInput struct { _ struct{} `type:"structure"` - // The ID for the AWS account that the group is in. Currently, you use the ID - // for the AWS account that contains your Amazon QuickSight account. + // The AWS account ID. // // AwsAccountId is a required field AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` - // The name of the group that you want to describe. + // Groupings of columns that work together in certain QuickSight features. Currently, + // only geospatial hierarchy is supported. + ColumnGroups []*ColumnGroup `min:"1" type:"list"` + + // The ID for the dataset that you want to update. This ID is unique per AWS + // Region for each AWS account. // - // GroupName is a required field - GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"` + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` - // The namespace. Currently, you should set this to default. + // Indicates whether you want to import the data into SPICE. // - // Namespace is a required field - Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + // ImportMode is a required field + ImportMode *string `type:"string" required:"true" enum:"DataSetImportMode"` + + // Configures the combination and transformation of the data from the physical + // tables. + LogicalTableMap map[string]*LogicalTable `min:"1" type:"map"` + + // The display name for the dataset. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Declares the physical tables that are available in the underlying data sources. + // + // PhysicalTableMap is a required field + PhysicalTableMap map[string]*PhysicalTable `min:"1" type:"map" required:"true"` + + // The row-level security configuration for the data you want to create. + RowLevelPermissionDataSet *RowLevelPermissionDataSet `type:"structure"` } // String returns the string representation -func (s DescribeGroupInput) String() string { +func (s UpdateDataSetInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeGroupInput) GoString() string { +func (s UpdateDataSetInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeGroupInput"} +func (s *UpdateDataSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateDataSetInput"} if s.AwsAccountId == nil { invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) } if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) } - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) + if s.ColumnGroups != nil && len(s.ColumnGroups) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ColumnGroups", 1)) + } + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) + } + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) + } + if s.ImportMode == nil { + invalidParams.Add(request.NewErrParamRequired("ImportMode")) + } + if s.LogicalTableMap != nil && len(s.LogicalTableMap) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LogicalTableMap", 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.PhysicalTableMap == nil { + invalidParams.Add(request.NewErrParamRequired("PhysicalTableMap")) + } + if s.PhysicalTableMap != nil && len(s.PhysicalTableMap) < 1 { + invalidParams.Add(request.NewErrParamMinLen("PhysicalTableMap", 1)) + } + if s.ColumnGroups != nil { + for i, v := range s.ColumnGroups { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ColumnGroups", i), err.(request.ErrInvalidParams)) + } + } } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + if s.LogicalTableMap != nil { + for i, v := range s.LogicalTableMap { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LogicalTableMap", i), err.(request.ErrInvalidParams)) + } + } } - if s.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) + if s.PhysicalTableMap != nil { + for i, v := range s.PhysicalTableMap { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "PhysicalTableMap", i), err.(request.ErrInvalidParams)) + } + } } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + if s.RowLevelPermissionDataSet != nil { + if err := s.RowLevelPermissionDataSet.Validate(); err != nil { + invalidParams.AddNested("RowLevelPermissionDataSet", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -2582,114 +21526,195 @@ func (s *DescribeGroupInput) Validate() error { } // SetAwsAccountId sets the AwsAccountId field's value. -func (s *DescribeGroupInput) SetAwsAccountId(v string) *DescribeGroupInput { +func (s *UpdateDataSetInput) SetAwsAccountId(v string) *UpdateDataSetInput { s.AwsAccountId = &v return s } -// SetGroupName sets the GroupName field's value. -func (s *DescribeGroupInput) SetGroupName(v string) *DescribeGroupInput { - s.GroupName = &v +// SetColumnGroups sets the ColumnGroups field's value. +func (s *UpdateDataSetInput) SetColumnGroups(v []*ColumnGroup) *UpdateDataSetInput { + s.ColumnGroups = v return s } -// SetNamespace sets the Namespace field's value. -func (s *DescribeGroupInput) SetNamespace(v string) *DescribeGroupInput { - s.Namespace = &v +// SetDataSetId sets the DataSetId field's value. +func (s *UpdateDataSetInput) SetDataSetId(v string) *UpdateDataSetInput { + s.DataSetId = &v return s } -type DescribeGroupOutput struct { +// SetImportMode sets the ImportMode field's value. +func (s *UpdateDataSetInput) SetImportMode(v string) *UpdateDataSetInput { + s.ImportMode = &v + return s +} + +// SetLogicalTableMap sets the LogicalTableMap field's value. +func (s *UpdateDataSetInput) SetLogicalTableMap(v map[string]*LogicalTable) *UpdateDataSetInput { + s.LogicalTableMap = v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateDataSetInput) SetName(v string) *UpdateDataSetInput { + s.Name = &v + return s +} + +// SetPhysicalTableMap sets the PhysicalTableMap field's value. +func (s *UpdateDataSetInput) SetPhysicalTableMap(v map[string]*PhysicalTable) *UpdateDataSetInput { + s.PhysicalTableMap = v + return s +} + +// SetRowLevelPermissionDataSet sets the RowLevelPermissionDataSet field's value. +func (s *UpdateDataSetInput) SetRowLevelPermissionDataSet(v *RowLevelPermissionDataSet) *UpdateDataSetInput { + s.RowLevelPermissionDataSet = v + return s +} + +type UpdateDataSetOutput struct { _ struct{} `type:"structure"` - // The name of the group. - Group *Group `type:"structure"` + // The Amazon Resource Name (ARN) of the dataset. + Arn *string `type:"string"` + + // The ID for the dataset that you want to create. This ID is unique per AWS + // Region for each AWS account. + DataSetId *string `type:"string"` + + // The ARN for the ingestion, which is triggered as a result of dataset creation + // if the import mode is SPICE. + IngestionArn *string `type:"string"` + + // The ID of the ingestion, which is triggered as a result of dataset creation + // if the import mode is SPICE. + IngestionId *string `type:"string"` // The AWS request ID for this operation. RequestId *string `type:"string"` - // The http status of the request. + // The HTTP status of the request. Status *int64 `location:"statusCode" type:"integer"` } // String returns the string representation -func (s DescribeGroupOutput) String() string { +func (s UpdateDataSetOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeGroupOutput) GoString() string { +func (s UpdateDataSetOutput) GoString() string { return s.String() } -// SetGroup sets the Group field's value. -func (s *DescribeGroupOutput) SetGroup(v *Group) *DescribeGroupOutput { - s.Group = v +// SetArn sets the Arn field's value. +func (s *UpdateDataSetOutput) SetArn(v string) *UpdateDataSetOutput { + s.Arn = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *UpdateDataSetOutput) SetDataSetId(v string) *UpdateDataSetOutput { + s.DataSetId = &v + return s +} + +// SetIngestionArn sets the IngestionArn field's value. +func (s *UpdateDataSetOutput) SetIngestionArn(v string) *UpdateDataSetOutput { + s.IngestionArn = &v + return s +} + +// SetIngestionId sets the IngestionId field's value. +func (s *UpdateDataSetOutput) SetIngestionId(v string) *UpdateDataSetOutput { + s.IngestionId = &v return s } // SetRequestId sets the RequestId field's value. -func (s *DescribeGroupOutput) SetRequestId(v string) *DescribeGroupOutput { +func (s *UpdateDataSetOutput) SetRequestId(v string) *UpdateDataSetOutput { s.RequestId = &v return s } // SetStatus sets the Status field's value. -func (s *DescribeGroupOutput) SetStatus(v int64) *DescribeGroupOutput { +func (s *UpdateDataSetOutput) SetStatus(v int64) *UpdateDataSetOutput { s.Status = &v return s } -type DescribeUserInput struct { +type UpdateDataSetPermissionsInput struct { _ struct{} `type:"structure"` - // The ID for the AWS account that the user is in. Currently, you use the ID - // for the AWS account that contains your Amazon QuickSight account. + // The AWS account ID. // // AwsAccountId is a required field AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` - // The namespace. Currently, you should set this to default. + // The ID for the dataset whose permissions you want to update. This ID is unique + // per AWS Region for each AWS account. // - // Namespace is a required field - Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + // DataSetId is a required field + DataSetId *string `location:"uri" locationName:"DataSetId" type:"string" required:"true"` - // The name of the user that you want to describe. - // - // UserName is a required field - UserName *string `location:"uri" locationName:"UserName" min:"1" type:"string" required:"true"` + // The resource permissions that you want to grant to the dataset. + GrantPermissions []*ResourcePermission `min:"1" type:"list"` + + // The resource permissions that you want to revoke from the dataset. + RevokePermissions []*ResourcePermission `min:"1" type:"list"` } // String returns the string representation -func (s DescribeUserInput) String() string { +func (s UpdateDataSetPermissionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeUserInput) GoString() string { +func (s UpdateDataSetPermissionsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeUserInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeUserInput"} +func (s *UpdateDataSetPermissionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateDataSetPermissionsInput"} if s.AwsAccountId == nil { invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) } if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) } - if s.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) + if s.DataSetId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSetId")) } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + if s.DataSetId != nil && len(*s.DataSetId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSetId", 1)) } - if s.UserName == nil { - invalidParams.Add(request.NewErrParamRequired("UserName")) + if s.GrantPermissions != nil && len(s.GrantPermissions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GrantPermissions", 1)) } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + if s.RevokePermissions != nil && len(s.RevokePermissions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RevokePermissions", 1)) + } + if s.GrantPermissions != nil { + for i, v := range s.GrantPermissions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GrantPermissions", i), err.(request.ErrInvalidParams)) + } + } + } + if s.RevokePermissions != nil { + for i, v := range s.RevokePermissions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RevokePermissions", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -2699,139 +21724,160 @@ func (s *DescribeUserInput) Validate() error { } // SetAwsAccountId sets the AwsAccountId field's value. -func (s *DescribeUserInput) SetAwsAccountId(v string) *DescribeUserInput { +func (s *UpdateDataSetPermissionsInput) SetAwsAccountId(v string) *UpdateDataSetPermissionsInput { s.AwsAccountId = &v return s } -// SetNamespace sets the Namespace field's value. -func (s *DescribeUserInput) SetNamespace(v string) *DescribeUserInput { - s.Namespace = &v +// SetDataSetId sets the DataSetId field's value. +func (s *UpdateDataSetPermissionsInput) SetDataSetId(v string) *UpdateDataSetPermissionsInput { + s.DataSetId = &v return s } -// SetUserName sets the UserName field's value. -func (s *DescribeUserInput) SetUserName(v string) *DescribeUserInput { - s.UserName = &v +// SetGrantPermissions sets the GrantPermissions field's value. +func (s *UpdateDataSetPermissionsInput) SetGrantPermissions(v []*ResourcePermission) *UpdateDataSetPermissionsInput { + s.GrantPermissions = v return s } -type DescribeUserOutput struct { +// SetRevokePermissions sets the RevokePermissions field's value. +func (s *UpdateDataSetPermissionsInput) SetRevokePermissions(v []*ResourcePermission) *UpdateDataSetPermissionsInput { + s.RevokePermissions = v + return s +} + +type UpdateDataSetPermissionsOutput struct { _ struct{} `type:"structure"` + // The Amazon Resource Name (ARN) of the dataset. + DataSetArn *string `type:"string"` + + // The ID for the dataset whose permissions you want to update. This ID is unique + // per AWS Region for each AWS account. + DataSetId *string `type:"string"` + // The AWS request ID for this operation. RequestId *string `type:"string"` - // The http status of the request. + // The HTTP status of the request. Status *int64 `location:"statusCode" type:"integer"` - - // The user name. - User *User `type:"structure"` } // String returns the string representation -func (s DescribeUserOutput) String() string { +func (s UpdateDataSetPermissionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeUserOutput) GoString() string { +func (s UpdateDataSetPermissionsOutput) GoString() string { return s.String() } +// SetDataSetArn sets the DataSetArn field's value. +func (s *UpdateDataSetPermissionsOutput) SetDataSetArn(v string) *UpdateDataSetPermissionsOutput { + s.DataSetArn = &v + return s +} + +// SetDataSetId sets the DataSetId field's value. +func (s *UpdateDataSetPermissionsOutput) SetDataSetId(v string) *UpdateDataSetPermissionsOutput { + s.DataSetId = &v + return s +} + // SetRequestId sets the RequestId field's value. -func (s *DescribeUserOutput) SetRequestId(v string) *DescribeUserOutput { +func (s *UpdateDataSetPermissionsOutput) SetRequestId(v string) *UpdateDataSetPermissionsOutput { s.RequestId = &v return s } // SetStatus sets the Status field's value. -func (s *DescribeUserOutput) SetStatus(v int64) *DescribeUserOutput { +func (s *UpdateDataSetPermissionsOutput) SetStatus(v int64) *UpdateDataSetPermissionsOutput { s.Status = &v return s } -// SetUser sets the User field's value. -func (s *DescribeUserOutput) SetUser(v *User) *DescribeUserOutput { - s.User = v - return s -} - -type GetDashboardEmbedUrlInput struct { +type UpdateDataSourceInput struct { _ struct{} `type:"structure"` - // AWS account ID that contains the dashboard you are embedding. + // The AWS account ID. // // AwsAccountId is a required field AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` - // The ID for the dashboard, also added to IAM policy - // - // DashboardId is a required field - DashboardId *string `location:"uri" locationName:"DashboardId" type:"string" required:"true"` + // The credentials that QuickSight that uses to connect to your underlying source. + // Currently, only credentials based on user name and password are supported. + Credentials *DataSourceCredentials `type:"structure" sensitive:"true"` - // The authentication method the user uses to sign in (IAM only). + // The ID of the data source. This ID is unique per AWS Region for each AWS + // account. // - // IdentityType is a required field - IdentityType *string `location:"querystring" locationName:"creds-type" type:"string" required:"true" enum:"IdentityType"` + // DataSourceId is a required field + DataSourceId *string `location:"uri" locationName:"DataSourceId" type:"string" required:"true"` - // Remove the reset button on embedded dashboard. The default is FALSE, which - // allows the reset button. - ResetDisabled *bool `location:"querystring" locationName:"reset-disabled" type:"boolean"` + // The parameters that QuickSight uses to connect to your underlying source. + DataSourceParameters *DataSourceParameters `type:"structure"` - // How many minutes the session is valid. The session lifetime must be between - // 15 and 600 minutes. - SessionLifetimeInMinutes *int64 `location:"querystring" locationName:"session-lifetime" min:"15" type:"long"` + // A display name for the data source. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` - // Remove the undo/redo button on embedded dashboard. The default is FALSE, - // which enables the undo/redo button. - UndoRedoDisabled *bool `location:"querystring" locationName:"undo-redo-disabled" type:"boolean"` + // Secure Socket Layer (SSL) properties that apply when QuickSight connects + // to your underlying source. + SslProperties *SslProperties `type:"structure"` - // The Amazon QuickSight user's ARN, for use with QUICKSIGHT identity type. - // You can use this for any of the following: - // - // * Amazon QuickSight users in your account (readers, authors, or admins) - // - // * AD users - // - // * Invited non-federated users - // - // * Federated IAM users - // - // * Federated IAM role-based sessions - UserArn *string `location:"querystring" locationName:"user-arn" type:"string"` + // Use this parameter only when you want QuickSight to use a VPC connection + // when connecting to your underlying source. + VpcConnectionProperties *VpcConnectionProperties `type:"structure"` } // String returns the string representation -func (s GetDashboardEmbedUrlInput) String() string { +func (s UpdateDataSourceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetDashboardEmbedUrlInput) GoString() string { +func (s UpdateDataSourceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetDashboardEmbedUrlInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetDashboardEmbedUrlInput"} +func (s *UpdateDataSourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateDataSourceInput"} if s.AwsAccountId == nil { invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) } if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) } - if s.DashboardId == nil { - invalidParams.Add(request.NewErrParamRequired("DashboardId")) + if s.DataSourceId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSourceId")) } - if s.DashboardId != nil && len(*s.DashboardId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DashboardId", 1)) + if s.DataSourceId != nil && len(*s.DataSourceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 1)) } - if s.IdentityType == nil { - invalidParams.Add(request.NewErrParamRequired("IdentityType")) + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) } - if s.SessionLifetimeInMinutes != nil && *s.SessionLifetimeInMinutes < 15 { - invalidParams.Add(request.NewErrParamMinValue("SessionLifetimeInMinutes", 15)) + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.Credentials != nil { + if err := s.Credentials.Validate(); err != nil { + invalidParams.AddNested("Credentials", err.(request.ErrInvalidParams)) + } + } + if s.DataSourceParameters != nil { + if err := s.DataSourceParameters.Validate(); err != nil { + invalidParams.AddNested("DataSourceParameters", err.(request.ErrInvalidParams)) + } + } + if s.VpcConnectionProperties != nil { + if err := s.VpcConnectionProperties.Validate(); err != nil { + invalidParams.AddNested("VpcConnectionProperties", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -2841,237 +21887,178 @@ func (s *GetDashboardEmbedUrlInput) Validate() error { } // SetAwsAccountId sets the AwsAccountId field's value. -func (s *GetDashboardEmbedUrlInput) SetAwsAccountId(v string) *GetDashboardEmbedUrlInput { +func (s *UpdateDataSourceInput) SetAwsAccountId(v string) *UpdateDataSourceInput { s.AwsAccountId = &v return s } -// SetDashboardId sets the DashboardId field's value. -func (s *GetDashboardEmbedUrlInput) SetDashboardId(v string) *GetDashboardEmbedUrlInput { - s.DashboardId = &v +// SetCredentials sets the Credentials field's value. +func (s *UpdateDataSourceInput) SetCredentials(v *DataSourceCredentials) *UpdateDataSourceInput { + s.Credentials = v return s } -// SetIdentityType sets the IdentityType field's value. -func (s *GetDashboardEmbedUrlInput) SetIdentityType(v string) *GetDashboardEmbedUrlInput { - s.IdentityType = &v +// SetDataSourceId sets the DataSourceId field's value. +func (s *UpdateDataSourceInput) SetDataSourceId(v string) *UpdateDataSourceInput { + s.DataSourceId = &v return s } -// SetResetDisabled sets the ResetDisabled field's value. -func (s *GetDashboardEmbedUrlInput) SetResetDisabled(v bool) *GetDashboardEmbedUrlInput { - s.ResetDisabled = &v +// SetDataSourceParameters sets the DataSourceParameters field's value. +func (s *UpdateDataSourceInput) SetDataSourceParameters(v *DataSourceParameters) *UpdateDataSourceInput { + s.DataSourceParameters = v return s } -// SetSessionLifetimeInMinutes sets the SessionLifetimeInMinutes field's value. -func (s *GetDashboardEmbedUrlInput) SetSessionLifetimeInMinutes(v int64) *GetDashboardEmbedUrlInput { - s.SessionLifetimeInMinutes = &v +// SetName sets the Name field's value. +func (s *UpdateDataSourceInput) SetName(v string) *UpdateDataSourceInput { + s.Name = &v return s } -// SetUndoRedoDisabled sets the UndoRedoDisabled field's value. -func (s *GetDashboardEmbedUrlInput) SetUndoRedoDisabled(v bool) *GetDashboardEmbedUrlInput { - s.UndoRedoDisabled = &v +// SetSslProperties sets the SslProperties field's value. +func (s *UpdateDataSourceInput) SetSslProperties(v *SslProperties) *UpdateDataSourceInput { + s.SslProperties = v return s } -// SetUserArn sets the UserArn field's value. -func (s *GetDashboardEmbedUrlInput) SetUserArn(v string) *GetDashboardEmbedUrlInput { - s.UserArn = &v +// SetVpcConnectionProperties sets the VpcConnectionProperties field's value. +func (s *UpdateDataSourceInput) SetVpcConnectionProperties(v *VpcConnectionProperties) *UpdateDataSourceInput { + s.VpcConnectionProperties = v return s } -type GetDashboardEmbedUrlOutput struct { +type UpdateDataSourceOutput struct { _ struct{} `type:"structure"` - // URL that you can put into your server-side webpage to embed your dashboard. - // This URL is valid for 5 minutes, and the resulting session is valid for 10 - // hours. The API provides the URL with an auth_code that enables a single-signon - // session. - EmbedUrl *string `type:"string" sensitive:"true"` + // The Amazon Resource Name (ARN) of the data source. + Arn *string `type:"string"` + + // The ID of the data source. This ID is unique per AWS Region for each AWS + // account. + DataSourceId *string `type:"string"` // The AWS request ID for this operation. RequestId *string `type:"string"` - // The http status of the request. + // The HTTP status of the request. Status *int64 `location:"statusCode" type:"integer"` -} - -// String returns the string representation -func (s GetDashboardEmbedUrlOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GetDashboardEmbedUrlOutput) GoString() string { - return s.String() -} - -// SetEmbedUrl sets the EmbedUrl field's value. -func (s *GetDashboardEmbedUrlOutput) SetEmbedUrl(v string) *GetDashboardEmbedUrlOutput { - s.EmbedUrl = &v - return s -} - -// SetRequestId sets the RequestId field's value. -func (s *GetDashboardEmbedUrlOutput) SetRequestId(v string) *GetDashboardEmbedUrlOutput { - s.RequestId = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetDashboardEmbedUrlOutput) SetStatus(v int64) *GetDashboardEmbedUrlOutput { - s.Status = &v - return s -} - -// A group in Amazon QuickSight consists of a set of users. You can use groups -// to make it easier to manage access and security. Currently, an Amazon QuickSight -// subscription can't contain more than 500 Amazon QuickSight groups. -type Group struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for the group. - Arn *string `type:"string"` - - // The group description. - Description *string `min:"1" type:"string"` - - // The name of the group. - GroupName *string `min:"1" type:"string"` - // The principal ID of the group. - PrincipalId *string `type:"string"` + // The update status of the data source's last update. + UpdateStatus *string `type:"string" enum:"ResourceStatus"` } // String returns the string representation -func (s Group) String() string { +func (s UpdateDataSourceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Group) GoString() string { +func (s UpdateDataSourceOutput) GoString() string { return s.String() } // SetArn sets the Arn field's value. -func (s *Group) SetArn(v string) *Group { +func (s *UpdateDataSourceOutput) SetArn(v string) *UpdateDataSourceOutput { s.Arn = &v return s } -// SetDescription sets the Description field's value. -func (s *Group) SetDescription(v string) *Group { - s.Description = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *Group) SetGroupName(v string) *Group { - s.GroupName = &v +// SetDataSourceId sets the DataSourceId field's value. +func (s *UpdateDataSourceOutput) SetDataSourceId(v string) *UpdateDataSourceOutput { + s.DataSourceId = &v return s } -// SetPrincipalId sets the PrincipalId field's value. -func (s *Group) SetPrincipalId(v string) *Group { - s.PrincipalId = &v +// SetRequestId sets the RequestId field's value. +func (s *UpdateDataSourceOutput) SetRequestId(v string) *UpdateDataSourceOutput { + s.RequestId = &v return s } -// A member of an Amazon QuickSight group. Currently, group members must be -// users. Groups can't be members of another group. -type GroupMember struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) for the group member (user). - Arn *string `type:"string"` - - // The name of the group member (user). - MemberName *string `min:"1" type:"string"` -} - -// String returns the string representation -func (s GroupMember) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s GroupMember) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *GroupMember) SetArn(v string) *GroupMember { - s.Arn = &v +// SetStatus sets the Status field's value. +func (s *UpdateDataSourceOutput) SetStatus(v int64) *UpdateDataSourceOutput { + s.Status = &v return s } -// SetMemberName sets the MemberName field's value. -func (s *GroupMember) SetMemberName(v string) *GroupMember { - s.MemberName = &v +// SetUpdateStatus sets the UpdateStatus field's value. +func (s *UpdateDataSourceOutput) SetUpdateStatus(v string) *UpdateDataSourceOutput { + s.UpdateStatus = &v return s } -type ListGroupMembershipsInput struct { +type UpdateDataSourcePermissionsInput struct { _ struct{} `type:"structure"` - // The ID for the AWS account that the group is in. Currently, you use the ID - // for the AWS account that contains your Amazon QuickSight account. + // The AWS account ID. // // AwsAccountId is a required field AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` - // The name of the group that you want to see a membership list of. + // The ID of the data source. This ID is unique per AWS Region for each AWS + // account. // - // GroupName is a required field - GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"` - - // The maximum number of results to return from this request. - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` + // DataSourceId is a required field + DataSourceId *string `location:"uri" locationName:"DataSourceId" type:"string" required:"true"` - // The namespace. Currently, you should set this to default. - // - // Namespace is a required field - Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + // A list of resource permissions that you want to grant on the data source. + GrantPermissions []*ResourcePermission `min:"1" type:"list"` - // A pagination token that can be used in a subsequent request. - NextToken *string `location:"querystring" locationName:"next-token" type:"string"` + // A list of resource permissions that you want to revoke on the data source. + RevokePermissions []*ResourcePermission `min:"1" type:"list"` } // String returns the string representation -func (s ListGroupMembershipsInput) String() string { +func (s UpdateDataSourcePermissionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListGroupMembershipsInput) GoString() string { +func (s UpdateDataSourcePermissionsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListGroupMembershipsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListGroupMembershipsInput"} +func (s *UpdateDataSourcePermissionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateDataSourcePermissionsInput"} if s.AwsAccountId == nil { invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) } if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) } - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) + if s.DataSourceId == nil { + invalidParams.Add(request.NewErrParamRequired("DataSourceId")) } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + if s.DataSourceId != nil && len(*s.DataSourceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataSourceId", 1)) } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + if s.GrantPermissions != nil && len(s.GrantPermissions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GrantPermissions", 1)) } - if s.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) + if s.RevokePermissions != nil && len(s.RevokePermissions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RevokePermissions", 1)) } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + if s.GrantPermissions != nil { + for i, v := range s.GrantPermissions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GrantPermissions", i), err.(request.ErrInvalidParams)) + } + } + } + if s.RevokePermissions != nil { + for i, v := range s.RevokePermissions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RevokePermissions", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -3081,86 +22068,81 @@ func (s *ListGroupMembershipsInput) Validate() error { } // SetAwsAccountId sets the AwsAccountId field's value. -func (s *ListGroupMembershipsInput) SetAwsAccountId(v string) *ListGroupMembershipsInput { +func (s *UpdateDataSourcePermissionsInput) SetAwsAccountId(v string) *UpdateDataSourcePermissionsInput { s.AwsAccountId = &v return s } -// SetGroupName sets the GroupName field's value. -func (s *ListGroupMembershipsInput) SetGroupName(v string) *ListGroupMembershipsInput { - s.GroupName = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListGroupMembershipsInput) SetMaxResults(v int64) *ListGroupMembershipsInput { - s.MaxResults = &v +// SetDataSourceId sets the DataSourceId field's value. +func (s *UpdateDataSourcePermissionsInput) SetDataSourceId(v string) *UpdateDataSourcePermissionsInput { + s.DataSourceId = &v return s } -// SetNamespace sets the Namespace field's value. -func (s *ListGroupMembershipsInput) SetNamespace(v string) *ListGroupMembershipsInput { - s.Namespace = &v +// SetGrantPermissions sets the GrantPermissions field's value. +func (s *UpdateDataSourcePermissionsInput) SetGrantPermissions(v []*ResourcePermission) *UpdateDataSourcePermissionsInput { + s.GrantPermissions = v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListGroupMembershipsInput) SetNextToken(v string) *ListGroupMembershipsInput { - s.NextToken = &v +// SetRevokePermissions sets the RevokePermissions field's value. +func (s *UpdateDataSourcePermissionsInput) SetRevokePermissions(v []*ResourcePermission) *UpdateDataSourcePermissionsInput { + s.RevokePermissions = v return s } -type ListGroupMembershipsOutput struct { +type UpdateDataSourcePermissionsOutput struct { _ struct{} `type:"structure"` - // The list of the members of the group. - GroupMemberList []*GroupMember `type:"list"` + // The Amazon Resource Name (ARN) of the data source. + DataSourceArn *string `type:"string"` - // A pagination token that can be used in a subsequent request. - NextToken *string `type:"string"` + // The ID of the data source. This ID is unique per AWS Region for each AWS + // account. + DataSourceId *string `type:"string"` // The AWS request ID for this operation. RequestId *string `type:"string"` - // The http status of the request. + // The HTTP status of the request. Status *int64 `location:"statusCode" type:"integer"` } // String returns the string representation -func (s ListGroupMembershipsOutput) String() string { +func (s UpdateDataSourcePermissionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListGroupMembershipsOutput) GoString() string { +func (s UpdateDataSourcePermissionsOutput) GoString() string { return s.String() } -// SetGroupMemberList sets the GroupMemberList field's value. -func (s *ListGroupMembershipsOutput) SetGroupMemberList(v []*GroupMember) *ListGroupMembershipsOutput { - s.GroupMemberList = v +// SetDataSourceArn sets the DataSourceArn field's value. +func (s *UpdateDataSourcePermissionsOutput) SetDataSourceArn(v string) *UpdateDataSourcePermissionsOutput { + s.DataSourceArn = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListGroupMembershipsOutput) SetNextToken(v string) *ListGroupMembershipsOutput { - s.NextToken = &v +// SetDataSourceId sets the DataSourceId field's value. +func (s *UpdateDataSourcePermissionsOutput) SetDataSourceId(v string) *UpdateDataSourcePermissionsOutput { + s.DataSourceId = &v return s } // SetRequestId sets the RequestId field's value. -func (s *ListGroupMembershipsOutput) SetRequestId(v string) *ListGroupMembershipsOutput { +func (s *UpdateDataSourcePermissionsOutput) SetRequestId(v string) *UpdateDataSourcePermissionsOutput { s.RequestId = &v return s } // SetStatus sets the Status field's value. -func (s *ListGroupMembershipsOutput) SetStatus(v int64) *ListGroupMembershipsOutput { +func (s *UpdateDataSourcePermissionsOutput) SetStatus(v int64) *UpdateDataSourcePermissionsOutput { s.Status = &v return s } -type ListGroupsInput struct { +type UpdateGroupInput struct { _ struct{} `type:"structure"` // The ID for the AWS account that the group is in. Currently, you use the ID @@ -3169,39 +22151,47 @@ type ListGroupsInput struct { // AwsAccountId is a required field AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` - // The maximum number of results to return. - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` + // The description for the group that you want to update. + Description *string `min:"1" type:"string"` + + // The name of the group that you want to update. + // + // GroupName is a required field + GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"` // The namespace. Currently, you should set this to default. // // Namespace is a required field Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` - - // A pagination token that can be used in a subsequent request. - NextToken *string `location:"querystring" locationName:"next-token" type:"string"` } // String returns the string representation -func (s ListGroupsInput) String() string { +func (s UpdateGroupInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListGroupsInput) GoString() string { +func (s UpdateGroupInput) 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"} +func (s *UpdateGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateGroupInput"} if s.AwsAccountId == nil { invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) } if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 1)) + } + 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.Namespace == nil { invalidParams.Add(request.NewErrParamRequired("Namespace")) @@ -3217,139 +22207,139 @@ func (s *ListGroupsInput) Validate() error { } // SetAwsAccountId sets the AwsAccountId field's value. -func (s *ListGroupsInput) SetAwsAccountId(v string) *ListGroupsInput { +func (s *UpdateGroupInput) SetAwsAccountId(v string) *UpdateGroupInput { s.AwsAccountId = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListGroupsInput) SetMaxResults(v int64) *ListGroupsInput { - s.MaxResults = &v +// SetDescription sets the Description field's value. +func (s *UpdateGroupInput) SetDescription(v string) *UpdateGroupInput { + s.Description = &v return s } -// SetNamespace sets the Namespace field's value. -func (s *ListGroupsInput) SetNamespace(v string) *ListGroupsInput { - s.Namespace = &v +// SetGroupName sets the GroupName field's value. +func (s *UpdateGroupInput) SetGroupName(v string) *UpdateGroupInput { + s.GroupName = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListGroupsInput) SetNextToken(v string) *ListGroupsInput { - s.NextToken = &v +// SetNamespace sets the Namespace field's value. +func (s *UpdateGroupInput) SetNamespace(v string) *UpdateGroupInput { + s.Namespace = &v return s } -type ListGroupsOutput struct { +type UpdateGroupOutput struct { _ struct{} `type:"structure"` - // The list of the groups. - GroupList []*Group `type:"list"` - - // A pagination token that can be used in a subsequent request. - NextToken *string `type:"string"` + // The name of the group. + Group *Group `type:"structure"` // The AWS request ID for this operation. RequestId *string `type:"string"` - // The http status of the request. + // The HTTP status of the request. Status *int64 `location:"statusCode" type:"integer"` } // String returns the string representation -func (s ListGroupsOutput) String() string { +func (s UpdateGroupOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListGroupsOutput) GoString() string { +func (s UpdateGroupOutput) GoString() string { return s.String() } -// SetGroupList sets the GroupList field's value. -func (s *ListGroupsOutput) SetGroupList(v []*Group) *ListGroupsOutput { - s.GroupList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListGroupsOutput) SetNextToken(v string) *ListGroupsOutput { - s.NextToken = &v +// SetGroup sets the Group field's value. +func (s *UpdateGroupOutput) SetGroup(v *Group) *UpdateGroupOutput { + s.Group = v return s } // SetRequestId sets the RequestId field's value. -func (s *ListGroupsOutput) SetRequestId(v string) *ListGroupsOutput { +func (s *UpdateGroupOutput) SetRequestId(v string) *UpdateGroupOutput { s.RequestId = &v return s } // SetStatus sets the Status field's value. -func (s *ListGroupsOutput) SetStatus(v int64) *ListGroupsOutput { +func (s *UpdateGroupOutput) SetStatus(v int64) *UpdateGroupOutput { s.Status = &v return s } -type ListUserGroupsInput struct { +type UpdateIAMPolicyAssignmentInput struct { _ struct{} `type:"structure"` - // The AWS Account ID that the user is in. Currently, you use the ID for the - // AWS account that contains your Amazon QuickSight account. + // The name of the assignment. This name must be unique within an AWS account. + // + // AssignmentName is a required field + AssignmentName *string `location:"uri" locationName:"AssignmentName" min:"1" type:"string" required:"true"` + + // The status of the assignment. Possible values are as follows: + // + // * ENABLED - Anything specified in this assignment is used when creating + // the data source. + // + // * DISABLED - This assignment isn't used when creating the data source. + // + // * DRAFT - This assignment is an unfinished draft and isn't used when creating + // the data source. + AssignmentStatus *string `type:"string" enum:"AssignmentStatus"` + + // The ID of the AWS account that contains the IAM policy assignment. // // AwsAccountId is a required field AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` - // The maximum number of results to return from this request. - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` + // The QuickSight users, groups, or both that you want to assign the policy + // to. + Identities map[string][]*string `type:"map"` - // The namespace. Currently, you should set this to default. + // The namespace of the assignment. // // Namespace is a required field Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` - // A pagination token that can be used in a subsequent request. - NextToken *string `location:"querystring" locationName:"next-token" type:"string"` - - // The Amazon QuickSight user name that you want to list group memberships for. - // - // UserName is a required field - UserName *string `location:"uri" locationName:"UserName" min:"1" type:"string" required:"true"` + // The ARN for the IAM policy to apply to the QuickSight users and groups specified + // in this assignment. + PolicyArn *string `type:"string"` } // String returns the string representation -func (s ListUserGroupsInput) String() string { +func (s UpdateIAMPolicyAssignmentInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListUserGroupsInput) GoString() string { +func (s UpdateIAMPolicyAssignmentInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListUserGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListUserGroupsInput"} +func (s *UpdateIAMPolicyAssignmentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateIAMPolicyAssignmentInput"} + if s.AssignmentName == nil { + invalidParams.Add(request.NewErrParamRequired("AssignmentName")) + } + if s.AssignmentName != nil && len(*s.AssignmentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AssignmentName", 1)) + } if s.AwsAccountId == nil { invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) } if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 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.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 @@ -3357,44 +22347,68 @@ func (s *ListUserGroupsInput) Validate() error { return nil } +// SetAssignmentName sets the AssignmentName field's value. +func (s *UpdateIAMPolicyAssignmentInput) SetAssignmentName(v string) *UpdateIAMPolicyAssignmentInput { + s.AssignmentName = &v + return s +} + +// SetAssignmentStatus sets the AssignmentStatus field's value. +func (s *UpdateIAMPolicyAssignmentInput) SetAssignmentStatus(v string) *UpdateIAMPolicyAssignmentInput { + s.AssignmentStatus = &v + return s +} + // SetAwsAccountId sets the AwsAccountId field's value. -func (s *ListUserGroupsInput) SetAwsAccountId(v string) *ListUserGroupsInput { +func (s *UpdateIAMPolicyAssignmentInput) SetAwsAccountId(v string) *UpdateIAMPolicyAssignmentInput { s.AwsAccountId = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListUserGroupsInput) SetMaxResults(v int64) *ListUserGroupsInput { - s.MaxResults = &v +// SetIdentities sets the Identities field's value. +func (s *UpdateIAMPolicyAssignmentInput) SetIdentities(v map[string][]*string) *UpdateIAMPolicyAssignmentInput { + s.Identities = v return s } // SetNamespace sets the Namespace field's value. -func (s *ListUserGroupsInput) SetNamespace(v string) *ListUserGroupsInput { +func (s *UpdateIAMPolicyAssignmentInput) SetNamespace(v string) *UpdateIAMPolicyAssignmentInput { s.Namespace = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListUserGroupsInput) SetNextToken(v string) *ListUserGroupsInput { - s.NextToken = &v - return s -} - -// SetUserName sets the UserName field's value. -func (s *ListUserGroupsInput) SetUserName(v string) *ListUserGroupsInput { - s.UserName = &v +// SetPolicyArn sets the PolicyArn field's value. +func (s *UpdateIAMPolicyAssignmentInput) SetPolicyArn(v string) *UpdateIAMPolicyAssignmentInput { + s.PolicyArn = &v return s } -type ListUserGroupsOutput struct { +type UpdateIAMPolicyAssignmentOutput struct { _ struct{} `type:"structure"` - // The list of groups the user is a member of. - GroupList []*Group `type:"list"` + // The ID of the assignment. + AssignmentId *string `type:"string"` - // A pagination token that can be used in a subsequent request. - NextToken *string `type:"string"` + // The name of the assignment. + AssignmentName *string `min:"1" type:"string"` + + // The status of the assignment. Possible values are as follows: + // + // * ENABLED - Anything specified in this assignment is used when creating + // the data source. + // + // * DISABLED - This assignment isn't used when creating the data source. + // + // * DRAFT - This assignment is an unfinished draft and isn't used when creating + // the data source. + AssignmentStatus *string `type:"string" enum:"AssignmentStatus"` + + // The QuickSight users, groups, or both that the IAM policy is assigned to. + Identities map[string][]*string `type:"map"` + + // The ARN for the IAM policy applied to the QuickSight users and groups specified + // in this assignment. + PolicyArn *string `type:"string"` // The AWS request ID for this operation. RequestId *string `type:"string"` @@ -3404,87 +22418,120 @@ type ListUserGroupsOutput struct { } // String returns the string representation -func (s ListUserGroupsOutput) String() string { +func (s UpdateIAMPolicyAssignmentOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListUserGroupsOutput) GoString() string { +func (s UpdateIAMPolicyAssignmentOutput) GoString() string { return s.String() } -// SetGroupList sets the GroupList field's value. -func (s *ListUserGroupsOutput) SetGroupList(v []*Group) *ListUserGroupsOutput { - s.GroupList = v +// SetAssignmentId sets the AssignmentId field's value. +func (s *UpdateIAMPolicyAssignmentOutput) SetAssignmentId(v string) *UpdateIAMPolicyAssignmentOutput { + s.AssignmentId = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListUserGroupsOutput) SetNextToken(v string) *ListUserGroupsOutput { - s.NextToken = &v +// SetAssignmentName sets the AssignmentName field's value. +func (s *UpdateIAMPolicyAssignmentOutput) SetAssignmentName(v string) *UpdateIAMPolicyAssignmentOutput { + s.AssignmentName = &v + return s +} + +// SetAssignmentStatus sets the AssignmentStatus field's value. +func (s *UpdateIAMPolicyAssignmentOutput) SetAssignmentStatus(v string) *UpdateIAMPolicyAssignmentOutput { + s.AssignmentStatus = &v + return s +} + +// SetIdentities sets the Identities field's value. +func (s *UpdateIAMPolicyAssignmentOutput) SetIdentities(v map[string][]*string) *UpdateIAMPolicyAssignmentOutput { + s.Identities = v + return s +} + +// SetPolicyArn sets the PolicyArn field's value. +func (s *UpdateIAMPolicyAssignmentOutput) SetPolicyArn(v string) *UpdateIAMPolicyAssignmentOutput { + s.PolicyArn = &v return s } // SetRequestId sets the RequestId field's value. -func (s *ListUserGroupsOutput) SetRequestId(v string) *ListUserGroupsOutput { +func (s *UpdateIAMPolicyAssignmentOutput) SetRequestId(v string) *UpdateIAMPolicyAssignmentOutput { s.RequestId = &v return s } // SetStatus sets the Status field's value. -func (s *ListUserGroupsOutput) SetStatus(v int64) *ListUserGroupsOutput { +func (s *UpdateIAMPolicyAssignmentOutput) SetStatus(v int64) *UpdateIAMPolicyAssignmentOutput { s.Status = &v return s } -type ListUsersInput struct { +type UpdateTemplateAliasInput struct { _ struct{} `type:"structure"` - // The ID for the AWS account that the user is in. Currently, you use the ID - // for the AWS account that contains your Amazon QuickSight account. + // The alias of the template that you want to update. If you name a specific + // alias, you update the version that the alias points to. You can specify the + // latest version of the template by providing the keyword $LATEST in the AliasName + // parameter. The keyword $PUBLISHED doesn't apply to templates. + // + // AliasName is a required field + AliasName *string `location:"uri" locationName:"AliasName" min:"1" type:"string" required:"true"` + + // The ID of the AWS account that contains the template alias that you're updating. // // AwsAccountId is a required field AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` - // The maximum number of results to return from this request. - MaxResults *int64 `location:"querystring" locationName:"max-results" min:"1" type:"integer"` - - // The namespace. Currently, you should set this to default. + // The ID for the template. // - // Namespace is a required field - Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + // TemplateId is a required field + TemplateId *string `location:"uri" locationName:"TemplateId" min:"1" type:"string" required:"true"` - // A pagination token that can be used in a subsequent request. - NextToken *string `location:"querystring" locationName:"next-token" type:"string"` + // The version number of the template. + // + // TemplateVersionNumber is a required field + TemplateVersionNumber *int64 `min:"1" type:"long" required:"true"` } // String returns the string representation -func (s ListUsersInput) String() string { +func (s UpdateTemplateAliasInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListUsersInput) GoString() string { +func (s UpdateTemplateAliasInput) 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"} +func (s *UpdateTemplateAliasInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateTemplateAliasInput"} + 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.AwsAccountId == nil { invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) } if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + if s.TemplateId == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateId")) } - if s.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) + if s.TemplateId != nil && len(*s.TemplateId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) + } + if s.TemplateVersionNumber == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateVersionNumber")) } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + if s.TemplateVersionNumber != nil && *s.TemplateVersionNumber < 1 { + invalidParams.Add(request.NewErrParamMinValue("TemplateVersionNumber", 1)) } if invalidParams.Len() > 0 { @@ -3493,179 +22540,138 @@ func (s *ListUsersInput) Validate() error { return nil } -// SetAwsAccountId sets the AwsAccountId field's value. -func (s *ListUsersInput) SetAwsAccountId(v string) *ListUsersInput { - s.AwsAccountId = &v +// SetAliasName sets the AliasName field's value. +func (s *UpdateTemplateAliasInput) SetAliasName(v string) *UpdateTemplateAliasInput { + s.AliasName = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListUsersInput) SetMaxResults(v int64) *ListUsersInput { - s.MaxResults = &v +// SetAwsAccountId sets the AwsAccountId field's value. +func (s *UpdateTemplateAliasInput) SetAwsAccountId(v string) *UpdateTemplateAliasInput { + s.AwsAccountId = &v return s } -// SetNamespace sets the Namespace field's value. -func (s *ListUsersInput) SetNamespace(v string) *ListUsersInput { - s.Namespace = &v +// SetTemplateId sets the TemplateId field's value. +func (s *UpdateTemplateAliasInput) SetTemplateId(v string) *UpdateTemplateAliasInput { + s.TemplateId = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListUsersInput) SetNextToken(v string) *ListUsersInput { - s.NextToken = &v +// SetTemplateVersionNumber sets the TemplateVersionNumber field's value. +func (s *UpdateTemplateAliasInput) SetTemplateVersionNumber(v int64) *UpdateTemplateAliasInput { + s.TemplateVersionNumber = &v return s } -type ListUsersOutput struct { +type UpdateTemplateAliasOutput struct { _ struct{} `type:"structure"` - // A pagination token that can be used in a subsequent request. - NextToken *string `type:"string"` - // The AWS request ID for this operation. RequestId *string `type:"string"` - // The http status of the request. + // The HTTP status of the request. Status *int64 `location:"statusCode" type:"integer"` - // The list of users. - UserList []*User `type:"list"` + // The template alias. + TemplateAlias *TemplateAlias `type:"structure"` } // String returns the string representation -func (s ListUsersOutput) String() string { +func (s UpdateTemplateAliasOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListUsersOutput) GoString() string { +func (s UpdateTemplateAliasOutput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListUsersOutput) SetNextToken(v string) *ListUsersOutput { - s.NextToken = &v - return s -} - // SetRequestId sets the RequestId field's value. -func (s *ListUsersOutput) SetRequestId(v string) *ListUsersOutput { +func (s *UpdateTemplateAliasOutput) SetRequestId(v string) *UpdateTemplateAliasOutput { s.RequestId = &v return s } // SetStatus sets the Status field's value. -func (s *ListUsersOutput) SetStatus(v int64) *ListUsersOutput { +func (s *UpdateTemplateAliasOutput) SetStatus(v int64) *UpdateTemplateAliasOutput { s.Status = &v return s } -// SetUserList sets the UserList field's value. -func (s *ListUsersOutput) SetUserList(v []*User) *ListUsersOutput { - s.UserList = v +// SetTemplateAlias sets the TemplateAlias field's value. +func (s *UpdateTemplateAliasOutput) SetTemplateAlias(v *TemplateAlias) *UpdateTemplateAliasOutput { + s.TemplateAlias = v return s } -type RegisterUserInput struct { +type UpdateTemplateInput struct { _ struct{} `type:"structure"` - // The ID for the AWS account that the user is in. Currently, you use the ID - // for the AWS account that contains your Amazon QuickSight account. + // The ID of the AWS account that contains the template that you're updating. // // AwsAccountId is a required field AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` - // The email address of the user that you want to register. - // - // Email is a required field - Email *string `type:"string" required:"true"` - - // The ARN of the IAM user or role that you are registering with Amazon QuickSight. - IamArn *string `type:"string"` + // The name for the template. + Name *string `min:"1" type:"string"` - // Amazon QuickSight supports several ways of managing the identity of users. - // This parameter accepts two values: + // The source QuickSight entity from which this template is being updated. You + // can currently update templates from an Analysis or another template. // - // * IAM: A user whose identity maps to an existing IAM user or role. - // - // * QUICKSIGHT: A user whose identity is owned and managed internally by - // Amazon QuickSight. - // - // IdentityType is a required field - IdentityType *string `type:"string" required:"true" enum:"IdentityType"` + // SourceEntity is a required field + SourceEntity *TemplateSourceEntity `type:"structure" required:"true"` - // The namespace. Currently, you should set this to default. + // The ID for the template. // - // Namespace is a required field - Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` - - // You need to use this parameter only when you register one or more users using - // an assumed IAM role. You don't need to provide the session name for other - // scenarios, for example when you are registering an IAM user or an Amazon - // QuickSight user. You can register multiple users using the same IAM role - // if each user has a different session name. For more information on assuming - // IAM roles, see assume-role (https://docs.aws.amazon.com/cli/latest/reference/sts/assume-role.html) - // in the AWS CLI Reference. - SessionName *string `min:"2" type:"string"` - - // The Amazon QuickSight user name that you want to create for the user you - // are registering. - UserName *string `min:"1" type:"string"` + // TemplateId is a required field + TemplateId *string `location:"uri" locationName:"TemplateId" min:"1" type:"string" required:"true"` - // The Amazon QuickSight role of the user. The user role can be one of the following: - // - // * READER: A user who has read-only access to dashboards. - // - // * AUTHOR: A user who can create data sources, data sets, analyses, and - // dashboards. - // - // * ADMIN: A user who is an author, who can also manage Amazon QuickSight - // settings. - // - // UserRole is a required field - UserRole *string `type:"string" required:"true" enum:"UserRole"` + // A description of the current template version that is being updated. Every + // time you call UpdateTemplate, you create a new version of the template. Each + // version of the template maintains a description of the version in the VersionDescription + // field. + VersionDescription *string `min:"1" type:"string"` } // String returns the string representation -func (s RegisterUserInput) String() string { +func (s UpdateTemplateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RegisterUserInput) GoString() string { +func (s UpdateTemplateInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterUserInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterUserInput"} +func (s *UpdateTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateTemplateInput"} if s.AwsAccountId == nil { invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) } if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) } - if s.Email == nil { - invalidParams.Add(request.NewErrParamRequired("Email")) - } - if s.IdentityType == nil { - invalidParams.Add(request.NewErrParamRequired("IdentityType")) + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) } - if s.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) + if s.SourceEntity == nil { + invalidParams.Add(request.NewErrParamRequired("SourceEntity")) } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + if s.TemplateId == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateId")) } - if s.SessionName != nil && len(*s.SessionName) < 2 { - invalidParams.Add(request.NewErrParamMinLen("SessionName", 2)) + if s.TemplateId != nil && len(*s.TemplateId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + if s.VersionDescription != nil && len(*s.VersionDescription) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VersionDescription", 1)) } - if s.UserRole == nil { - invalidParams.Add(request.NewErrParamRequired("UserRole")) + if s.SourceEntity != nil { + if err := s.SourceEntity.Validate(); err != nil { + invalidParams.AddNested("SourceEntity", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -3675,160 +22681,174 @@ func (s *RegisterUserInput) Validate() error { } // SetAwsAccountId sets the AwsAccountId field's value. -func (s *RegisterUserInput) SetAwsAccountId(v string) *RegisterUserInput { +func (s *UpdateTemplateInput) SetAwsAccountId(v string) *UpdateTemplateInput { s.AwsAccountId = &v return s } -// SetEmail sets the Email field's value. -func (s *RegisterUserInput) SetEmail(v string) *RegisterUserInput { - s.Email = &v - return s -} - -// SetIamArn sets the IamArn field's value. -func (s *RegisterUserInput) SetIamArn(v string) *RegisterUserInput { - s.IamArn = &v +// SetName sets the Name field's value. +func (s *UpdateTemplateInput) SetName(v string) *UpdateTemplateInput { + s.Name = &v return s } -// SetIdentityType sets the IdentityType field's value. -func (s *RegisterUserInput) SetIdentityType(v string) *RegisterUserInput { - s.IdentityType = &v +// SetSourceEntity sets the SourceEntity field's value. +func (s *UpdateTemplateInput) SetSourceEntity(v *TemplateSourceEntity) *UpdateTemplateInput { + s.SourceEntity = v return s } -// SetNamespace sets the Namespace field's value. -func (s *RegisterUserInput) SetNamespace(v string) *RegisterUserInput { - s.Namespace = &v +// SetTemplateId sets the TemplateId field's value. +func (s *UpdateTemplateInput) SetTemplateId(v string) *UpdateTemplateInput { + s.TemplateId = &v return s } -// SetSessionName sets the SessionName field's value. -func (s *RegisterUserInput) SetSessionName(v string) *RegisterUserInput { - s.SessionName = &v +// SetVersionDescription sets the VersionDescription field's value. +func (s *UpdateTemplateInput) SetVersionDescription(v string) *UpdateTemplateInput { + s.VersionDescription = &v return s } -// SetUserName sets the UserName field's value. -func (s *RegisterUserInput) SetUserName(v string) *RegisterUserInput { - s.UserName = &v - return s -} +type UpdateTemplateOutput struct { + _ struct{} `type:"structure"` -// SetUserRole sets the UserRole field's value. -func (s *RegisterUserInput) SetUserRole(v string) *RegisterUserInput { - s.UserRole = &v - return s -} + // The Amazon Resource Name (ARN) for the template. + Arn *string `type:"string"` -type RegisterUserOutput struct { - _ struct{} `type:"structure"` + // The creation status of the template. + CreationStatus *string `type:"string" enum:"ResourceStatus"` // The AWS request ID for this operation. RequestId *string `type:"string"` - // The http status of the request. + // The HTTP status of the request. Status *int64 `location:"statusCode" type:"integer"` - // The user name. - User *User `type:"structure"` + // The ID for the template. + TemplateId *string `min:"1" type:"string"` - // The URL the user visits to complete registration and provide a password. - // This is returned only for users with an identity type of QUICKSIGHT. - UserInvitationUrl *string `type:"string"` + // The ARN for the template, including the version information of the first + // version. + VersionArn *string `type:"string"` } // String returns the string representation -func (s RegisterUserOutput) String() string { +func (s UpdateTemplateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RegisterUserOutput) GoString() string { +func (s UpdateTemplateOutput) GoString() string { return s.String() } +// SetArn sets the Arn field's value. +func (s *UpdateTemplateOutput) SetArn(v string) *UpdateTemplateOutput { + s.Arn = &v + return s +} + +// SetCreationStatus sets the CreationStatus field's value. +func (s *UpdateTemplateOutput) SetCreationStatus(v string) *UpdateTemplateOutput { + s.CreationStatus = &v + return s +} + // SetRequestId sets the RequestId field's value. -func (s *RegisterUserOutput) SetRequestId(v string) *RegisterUserOutput { +func (s *UpdateTemplateOutput) SetRequestId(v string) *UpdateTemplateOutput { s.RequestId = &v return s } // SetStatus sets the Status field's value. -func (s *RegisterUserOutput) SetStatus(v int64) *RegisterUserOutput { +func (s *UpdateTemplateOutput) SetStatus(v int64) *UpdateTemplateOutput { s.Status = &v return s } -// SetUser sets the User field's value. -func (s *RegisterUserOutput) SetUser(v *User) *RegisterUserOutput { - s.User = v +// SetTemplateId sets the TemplateId field's value. +func (s *UpdateTemplateOutput) SetTemplateId(v string) *UpdateTemplateOutput { + s.TemplateId = &v return s } -// SetUserInvitationUrl sets the UserInvitationUrl field's value. -func (s *RegisterUserOutput) SetUserInvitationUrl(v string) *RegisterUserOutput { - s.UserInvitationUrl = &v +// SetVersionArn sets the VersionArn field's value. +func (s *UpdateTemplateOutput) SetVersionArn(v string) *UpdateTemplateOutput { + s.VersionArn = &v return s } -type UpdateGroupInput struct { +type UpdateTemplatePermissionsInput struct { _ struct{} `type:"structure"` - // The ID for the AWS account that the group is in. Currently, you use the ID - // for the AWS account that contains your Amazon QuickSight account. + // The ID of the AWS account that contains the template. // // AwsAccountId is a required field AwsAccountId *string `location:"uri" locationName:"AwsAccountId" min:"12" type:"string" required:"true"` - // The description for the group that you want to update. - Description *string `min:"1" type:"string"` + // A list of resource permissions to be granted on the template. + GrantPermissions []*ResourcePermission `min:"1" type:"list"` - // The name of the group that you want to update. - // - // GroupName is a required field - GroupName *string `location:"uri" locationName:"GroupName" min:"1" type:"string" required:"true"` + // A list of resource permissions to be revoked from the template. + RevokePermissions []*ResourcePermission `min:"1" type:"list"` - // The namespace. Currently, you should set this to default. + // The ID for the template. // - // Namespace is a required field - Namespace *string `location:"uri" locationName:"Namespace" type:"string" required:"true"` + // TemplateId is a required field + TemplateId *string `location:"uri" locationName:"TemplateId" min:"1" type:"string" required:"true"` } // String returns the string representation -func (s UpdateGroupInput) String() string { +func (s UpdateTemplatePermissionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateGroupInput) GoString() string { +func (s UpdateTemplatePermissionsInput) 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"} +func (s *UpdateTemplatePermissionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateTemplatePermissionsInput"} if s.AwsAccountId == nil { invalidParams.Add(request.NewErrParamRequired("AwsAccountId")) } if s.AwsAccountId != nil && len(*s.AwsAccountId) < 12 { invalidParams.Add(request.NewErrParamMinLen("AwsAccountId", 12)) } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) + if s.GrantPermissions != nil && len(s.GrantPermissions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("GrantPermissions", 1)) } - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) + if s.RevokePermissions != nil && len(s.RevokePermissions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RevokePermissions", 1)) } - if s.GroupName != nil && len(*s.GroupName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("GroupName", 1)) + if s.TemplateId == nil { + invalidParams.Add(request.NewErrParamRequired("TemplateId")) } - if s.Namespace == nil { - invalidParams.Add(request.NewErrParamRequired("Namespace")) + if s.TemplateId != nil && len(*s.TemplateId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TemplateId", 1)) } - if s.Namespace != nil && len(*s.Namespace) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Namespace", 1)) + if s.GrantPermissions != nil { + for i, v := range s.GrantPermissions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "GrantPermissions", i), err.(request.ErrInvalidParams)) + } + } + } + if s.RevokePermissions != nil { + for i, v := range s.RevokePermissions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RevokePermissions", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -3838,70 +22858,88 @@ func (s *UpdateGroupInput) Validate() error { } // SetAwsAccountId sets the AwsAccountId field's value. -func (s *UpdateGroupInput) SetAwsAccountId(v string) *UpdateGroupInput { +func (s *UpdateTemplatePermissionsInput) SetAwsAccountId(v string) *UpdateTemplatePermissionsInput { s.AwsAccountId = &v return s } -// SetDescription sets the Description field's value. -func (s *UpdateGroupInput) SetDescription(v string) *UpdateGroupInput { - s.Description = &v +// SetGrantPermissions sets the GrantPermissions field's value. +func (s *UpdateTemplatePermissionsInput) SetGrantPermissions(v []*ResourcePermission) *UpdateTemplatePermissionsInput { + s.GrantPermissions = v return s } -// SetGroupName sets the GroupName field's value. -func (s *UpdateGroupInput) SetGroupName(v string) *UpdateGroupInput { - s.GroupName = &v +// SetRevokePermissions sets the RevokePermissions field's value. +func (s *UpdateTemplatePermissionsInput) SetRevokePermissions(v []*ResourcePermission) *UpdateTemplatePermissionsInput { + s.RevokePermissions = v return s } -// SetNamespace sets the Namespace field's value. -func (s *UpdateGroupInput) SetNamespace(v string) *UpdateGroupInput { - s.Namespace = &v +// SetTemplateId sets the TemplateId field's value. +func (s *UpdateTemplatePermissionsInput) SetTemplateId(v string) *UpdateTemplatePermissionsInput { + s.TemplateId = &v return s } -type UpdateGroupOutput struct { +type UpdateTemplatePermissionsOutput struct { _ struct{} `type:"structure"` - // The name of the group. - Group *Group `type:"structure"` + // A list of resource permissions to be set on the template. + Permissions []*ResourcePermission `min:"1" type:"list"` // The AWS request ID for this operation. RequestId *string `type:"string"` - // The http status of the request. + // The HTTP status of the request. Status *int64 `location:"statusCode" type:"integer"` + + // The Amazon Resource Name (ARN) of the template. + TemplateArn *string `type:"string"` + + // The ID for the template. + TemplateId *string `min:"1" type:"string"` } // String returns the string representation -func (s UpdateGroupOutput) String() string { +func (s UpdateTemplatePermissionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateGroupOutput) GoString() string { +func (s UpdateTemplatePermissionsOutput) GoString() string { return s.String() } -// SetGroup sets the Group field's value. -func (s *UpdateGroupOutput) SetGroup(v *Group) *UpdateGroupOutput { - s.Group = v +// SetPermissions sets the Permissions field's value. +func (s *UpdateTemplatePermissionsOutput) SetPermissions(v []*ResourcePermission) *UpdateTemplatePermissionsOutput { + s.Permissions = v return s } // SetRequestId sets the RequestId field's value. -func (s *UpdateGroupOutput) SetRequestId(v string) *UpdateGroupOutput { +func (s *UpdateTemplatePermissionsOutput) SetRequestId(v string) *UpdateTemplatePermissionsOutput { s.RequestId = &v return s } // SetStatus sets the Status field's value. -func (s *UpdateGroupOutput) SetStatus(v int64) *UpdateGroupOutput { +func (s *UpdateTemplatePermissionsOutput) SetStatus(v int64) *UpdateTemplatePermissionsOutput { s.Status = &v return s } +// SetTemplateArn sets the TemplateArn field's value. +func (s *UpdateTemplatePermissionsOutput) SetTemplateArn(v string) *UpdateTemplatePermissionsOutput { + s.TemplateArn = &v + return s +} + +// SetTemplateId sets the TemplateId field's value. +func (s *UpdateTemplatePermissionsOutput) SetTemplateId(v string) *UpdateTemplatePermissionsOutput { + s.TemplateId = &v + return s +} + type UpdateUserInput struct { _ struct{} `type:"structure"` @@ -3925,7 +22963,7 @@ type UpdateUserInput struct { // // * READER: A user who has read-only access to dashboards. // - // * AUTHOR: A user who can create data sources, data sets, analyses, and + // * AUTHOR: A user who can create data sources, datasets, analyses, and // dashboards. // // * ADMIN: A user who is an author, who can also manage Amazon QuickSight @@ -4020,7 +23058,7 @@ type UpdateUserOutput struct { // The AWS request ID for this operation. RequestId *string `type:"string"` - // The http status of the request. + // The HTTP status of the request. Status *int64 `location:"statusCode" type:"integer"` // The Amazon QuickSight user. @@ -4049,9 +23087,85 @@ func (s *UpdateUserOutput) SetStatus(v int64) *UpdateUserOutput { return s } -// SetUser sets the User field's value. -func (s *UpdateUserOutput) SetUser(v *User) *UpdateUserOutput { - s.User = v +// SetUser sets the User field's value. +func (s *UpdateUserOutput) SetUser(v *User) *UpdateUserOutput { + s.User = v + return s +} + +// Information about the format for a source file or files. +type UploadSettings struct { + _ struct{} `type:"structure"` + + // Whether the file has a header row, or the files each have a header row. + ContainsHeader *bool `type:"boolean"` + + // The delimiter between values in the file. + Delimiter *string `min:"1" type:"string"` + + // File format. + Format *string `type:"string" enum:"FileFormat"` + + // A row number to start reading data from. + StartFromRow *int64 `min:"1" type:"integer"` + + // Text qualifier. + TextQualifier *string `type:"string" enum:"TextQualifier"` +} + +// String returns the string representation +func (s UploadSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UploadSettings) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UploadSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UploadSettings"} + if s.Delimiter != nil && len(*s.Delimiter) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Delimiter", 1)) + } + if s.StartFromRow != nil && *s.StartFromRow < 1 { + invalidParams.Add(request.NewErrParamMinValue("StartFromRow", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetContainsHeader sets the ContainsHeader field's value. +func (s *UploadSettings) SetContainsHeader(v bool) *UploadSettings { + s.ContainsHeader = &v + return s +} + +// SetDelimiter sets the Delimiter field's value. +func (s *UploadSettings) SetDelimiter(v string) *UploadSettings { + s.Delimiter = &v + return s +} + +// SetFormat sets the Format field's value. +func (s *UploadSettings) SetFormat(v string) *UploadSettings { + s.Format = &v + return s +} + +// SetStartFromRow sets the StartFromRow field's value. +func (s *UploadSettings) SetStartFromRow(v int64) *UploadSettings { + s.StartFromRow = &v + return s +} + +// SetTextQualifier sets the TextQualifier field's value. +func (s *UploadSettings) SetTextQualifier(v string) *UploadSettings { + s.TextQualifier = &v return s } @@ -4060,9 +23174,9 @@ func (s *UpdateUserOutput) SetUser(v *User) *UpdateUserOutput { type User struct { _ struct{} `type:"structure"` - // Active status of user. When you create an Amazon QuickSight user that’s - // not an IAM user or an AD user, that user is inactive until they sign in and - // provide a password + // The active status of user. When you create an Amazon QuickSight user that’s + // not an IAM user or an Active Directory user, that user is inactive until + // they sign in and provide a password. Active *bool `type:"boolean"` // The Amazon Resource Name (ARN) for the user. @@ -4077,7 +23191,20 @@ type User struct { // The principal ID of the user. PrincipalId *string `type:"string"` - // The Amazon QuickSight role for the user. + // The Amazon QuickSight role for the user. The user role can be one of the + // following:. + // + // * READER: A user who has read-only access to dashboards. + // + // * AUTHOR: A user who can create data sources, datasets, analyses, and + // dashboards. + // + // * ADMIN: A user who is an author, who can also manage Amazon QuickSight + // settings. + // + // * RESTRICTED_READER: This role isn't currently available for use. + // + // * RESTRICTED_AUTHOR: This role isn't currently available for use. Role *string `type:"string" enum:"UserRole"` // The user's user name. @@ -4136,6 +23263,271 @@ func (s *User) SetUserName(v string) *User { return s } +// The user with the provided name isn't found. This error can happen in any +// operation that requires finding a user based on a provided user name, such +// as DeleteUser, DescribeUser, and so on. +type UserNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // The AWS request ID for this request. + RequestId *string `type:"string"` +} + +// String returns the string representation +func (s UserNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserNotFoundException) GoString() string { + return s.String() +} + +func newErrorUserNotFoundException(v protocol.ResponseMetadata) error { + return &UserNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UserNotFoundException) Code() string { + return "QuickSightUserNotFoundException" +} + +// Message returns the exception's message. +func (s UserNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UserNotFoundException) OrigErr() error { + return nil +} + +func (s UserNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UserNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UserNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// VPC connection properties. +type VpcConnectionProperties struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) for the VPC connection. + // + // VpcConnectionArn is a required field + VpcConnectionArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s VpcConnectionProperties) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcConnectionProperties) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *VpcConnectionProperties) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "VpcConnectionProperties"} + if s.VpcConnectionArn == nil { + invalidParams.Add(request.NewErrParamRequired("VpcConnectionArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetVpcConnectionArn sets the VpcConnectionArn field's value. +func (s *VpcConnectionProperties) SetVpcConnectionArn(v string) *VpcConnectionProperties { + s.VpcConnectionArn = &v + return s +} + +const ( + // AssignmentStatusEnabled is a AssignmentStatus enum value + AssignmentStatusEnabled = "ENABLED" + + // AssignmentStatusDraft is a AssignmentStatus enum value + AssignmentStatusDraft = "DRAFT" + + // AssignmentStatusDisabled is a AssignmentStatus enum value + AssignmentStatusDisabled = "DISABLED" +) + +const ( + // ColumnDataTypeString is a ColumnDataType enum value + ColumnDataTypeString = "STRING" + + // ColumnDataTypeInteger is a ColumnDataType enum value + ColumnDataTypeInteger = "INTEGER" + + // ColumnDataTypeDecimal is a ColumnDataType enum value + ColumnDataTypeDecimal = "DECIMAL" + + // ColumnDataTypeDatetime is a ColumnDataType enum value + ColumnDataTypeDatetime = "DATETIME" +) + +const ( + // DashboardBehaviorEnabled is a DashboardBehavior enum value + DashboardBehaviorEnabled = "ENABLED" + + // DashboardBehaviorDisabled is a DashboardBehavior enum value + DashboardBehaviorDisabled = "DISABLED" +) + +const ( + // DashboardErrorTypeDataSetNotFound is a DashboardErrorType enum value + DashboardErrorTypeDataSetNotFound = "DATA_SET_NOT_FOUND" + + // DashboardErrorTypeInternalFailure is a DashboardErrorType enum value + DashboardErrorTypeInternalFailure = "INTERNAL_FAILURE" + + // DashboardErrorTypeParameterValueIncompatible is a DashboardErrorType enum value + DashboardErrorTypeParameterValueIncompatible = "PARAMETER_VALUE_INCOMPATIBLE" + + // DashboardErrorTypeParameterTypeInvalid is a DashboardErrorType enum value + DashboardErrorTypeParameterTypeInvalid = "PARAMETER_TYPE_INVALID" + + // DashboardErrorTypeParameterNotFound is a DashboardErrorType enum value + DashboardErrorTypeParameterNotFound = "PARAMETER_NOT_FOUND" + + // DashboardErrorTypeColumnTypeMismatch is a DashboardErrorType enum value + DashboardErrorTypeColumnTypeMismatch = "COLUMN_TYPE_MISMATCH" + + // DashboardErrorTypeColumnGeographicRoleMismatch is a DashboardErrorType enum value + DashboardErrorTypeColumnGeographicRoleMismatch = "COLUMN_GEOGRAPHIC_ROLE_MISMATCH" + + // DashboardErrorTypeColumnReplacementMissing is a DashboardErrorType enum value + DashboardErrorTypeColumnReplacementMissing = "COLUMN_REPLACEMENT_MISSING" +) + +const ( + // DashboardFilterAttributeQuicksightUser is a DashboardFilterAttribute enum value + DashboardFilterAttributeQuicksightUser = "QUICKSIGHT_USER" +) + +const ( + // DashboardUIStateExpanded is a DashboardUIState enum value + DashboardUIStateExpanded = "EXPANDED" + + // DashboardUIStateCollapsed is a DashboardUIState enum value + DashboardUIStateCollapsed = "COLLAPSED" +) + +const ( + // DataSetImportModeSpice is a DataSetImportMode enum value + DataSetImportModeSpice = "SPICE" + + // DataSetImportModeDirectQuery is a DataSetImportMode enum value + DataSetImportModeDirectQuery = "DIRECT_QUERY" +) + +const ( + // DataSourceErrorInfoTypeTimeout is a DataSourceErrorInfoType enum value + DataSourceErrorInfoTypeTimeout = "TIMEOUT" + + // DataSourceErrorInfoTypeEngineVersionNotSupported is a DataSourceErrorInfoType enum value + DataSourceErrorInfoTypeEngineVersionNotSupported = "ENGINE_VERSION_NOT_SUPPORTED" + + // DataSourceErrorInfoTypeUnknownHost is a DataSourceErrorInfoType enum value + DataSourceErrorInfoTypeUnknownHost = "UNKNOWN_HOST" + + // DataSourceErrorInfoTypeGenericSqlFailure is a DataSourceErrorInfoType enum value + DataSourceErrorInfoTypeGenericSqlFailure = "GENERIC_SQL_FAILURE" + + // DataSourceErrorInfoTypeConflict is a DataSourceErrorInfoType enum value + DataSourceErrorInfoTypeConflict = "CONFLICT" + + // DataSourceErrorInfoTypeUnknown is a DataSourceErrorInfoType enum value + DataSourceErrorInfoTypeUnknown = "UNKNOWN" +) + +const ( + // DataSourceTypeAdobeAnalytics is a DataSourceType enum value + DataSourceTypeAdobeAnalytics = "ADOBE_ANALYTICS" + + // DataSourceTypeAmazonElasticsearch is a DataSourceType enum value + DataSourceTypeAmazonElasticsearch = "AMAZON_ELASTICSEARCH" + + // DataSourceTypeAthena is a DataSourceType enum value + DataSourceTypeAthena = "ATHENA" + + // DataSourceTypeAurora is a DataSourceType enum value + DataSourceTypeAurora = "AURORA" + + // DataSourceTypeAuroraPostgresql is a DataSourceType enum value + DataSourceTypeAuroraPostgresql = "AURORA_POSTGRESQL" + + // DataSourceTypeAwsIotAnalytics is a DataSourceType enum value + DataSourceTypeAwsIotAnalytics = "AWS_IOT_ANALYTICS" + + // DataSourceTypeGithub is a DataSourceType enum value + DataSourceTypeGithub = "GITHUB" + + // DataSourceTypeJira is a DataSourceType enum value + DataSourceTypeJira = "JIRA" + + // DataSourceTypeMariadb is a DataSourceType enum value + DataSourceTypeMariadb = "MARIADB" + + // DataSourceTypeMysql is a DataSourceType enum value + DataSourceTypeMysql = "MYSQL" + + // DataSourceTypePostgresql is a DataSourceType enum value + DataSourceTypePostgresql = "POSTGRESQL" + + // DataSourceTypePresto is a DataSourceType enum value + DataSourceTypePresto = "PRESTO" + + // DataSourceTypeRedshift is a DataSourceType enum value + DataSourceTypeRedshift = "REDSHIFT" + + // DataSourceTypeS3 is a DataSourceType enum value + DataSourceTypeS3 = "S3" + + // DataSourceTypeSalesforce is a DataSourceType enum value + DataSourceTypeSalesforce = "SALESFORCE" + + // DataSourceTypeServicenow is a DataSourceType enum value + DataSourceTypeServicenow = "SERVICENOW" + + // DataSourceTypeSnowflake is a DataSourceType enum value + DataSourceTypeSnowflake = "SNOWFLAKE" + + // DataSourceTypeSpark is a DataSourceType enum value + DataSourceTypeSpark = "SPARK" + + // DataSourceTypeSqlserver is a DataSourceType enum value + DataSourceTypeSqlserver = "SQLSERVER" + + // DataSourceTypeTeradata is a DataSourceType enum value + DataSourceTypeTeradata = "TERADATA" + + // DataSourceTypeTwitter is a DataSourceType enum value + DataSourceTypeTwitter = "TWITTER" +) + const ( // ExceptionResourceTypeUser is a ExceptionResourceType enum value ExceptionResourceTypeUser = "USER" @@ -4146,6 +23538,12 @@ const ( // ExceptionResourceTypeNamespace is a ExceptionResourceType enum value ExceptionResourceTypeNamespace = "NAMESPACE" + // ExceptionResourceTypeAccountSettings is a ExceptionResourceType enum value + ExceptionResourceTypeAccountSettings = "ACCOUNT_SETTINGS" + + // ExceptionResourceTypeIampolicyAssignment is a ExceptionResourceType enum value + ExceptionResourceTypeIampolicyAssignment = "IAMPOLICY_ASSIGNMENT" + // ExceptionResourceTypeDataSource is a ExceptionResourceType enum value ExceptionResourceTypeDataSource = "DATA_SOURCE" @@ -4159,6 +23557,59 @@ const ( ExceptionResourceTypeIngestion = "INGESTION" ) +const ( + // FileFormatCsv is a FileFormat enum value + FileFormatCsv = "CSV" + + // FileFormatTsv is a FileFormat enum value + FileFormatTsv = "TSV" + + // FileFormatClf is a FileFormat enum value + FileFormatClf = "CLF" + + // FileFormatElf is a FileFormat enum value + FileFormatElf = "ELF" + + // FileFormatXlsx is a FileFormat enum value + FileFormatXlsx = "XLSX" + + // FileFormatJson is a FileFormat enum value + FileFormatJson = "JSON" +) + +const ( + // FilterOperatorStringEquals is a FilterOperator enum value + FilterOperatorStringEquals = "StringEquals" +) + +const ( + // GeoSpatialCountryCodeUs is a GeoSpatialCountryCode enum value + GeoSpatialCountryCodeUs = "US" +) + +const ( + // GeoSpatialDataRoleCountry is a GeoSpatialDataRole enum value + GeoSpatialDataRoleCountry = "COUNTRY" + + // GeoSpatialDataRoleState is a GeoSpatialDataRole enum value + GeoSpatialDataRoleState = "STATE" + + // GeoSpatialDataRoleCounty is a GeoSpatialDataRole enum value + GeoSpatialDataRoleCounty = "COUNTY" + + // GeoSpatialDataRoleCity is a GeoSpatialDataRole enum value + GeoSpatialDataRoleCity = "CITY" + + // GeoSpatialDataRolePostcode is a GeoSpatialDataRole enum value + GeoSpatialDataRolePostcode = "POSTCODE" + + // GeoSpatialDataRoleLongitude is a GeoSpatialDataRole enum value + GeoSpatialDataRoleLongitude = "LONGITUDE" + + // GeoSpatialDataRoleLatitude is a GeoSpatialDataRole enum value + GeoSpatialDataRoleLatitude = "LATITUDE" +) + const ( // IdentityTypeIam is a IdentityType enum value IdentityTypeIam = "IAM" @@ -4167,6 +23618,251 @@ const ( IdentityTypeQuicksight = "QUICKSIGHT" ) +const ( + // IngestionErrorTypeFailureToAssumeRole is a IngestionErrorType enum value + IngestionErrorTypeFailureToAssumeRole = "FAILURE_TO_ASSUME_ROLE" + + // IngestionErrorTypeIngestionSuperseded is a IngestionErrorType enum value + IngestionErrorTypeIngestionSuperseded = "INGESTION_SUPERSEDED" + + // IngestionErrorTypeIngestionCanceled is a IngestionErrorType enum value + IngestionErrorTypeIngestionCanceled = "INGESTION_CANCELED" + + // IngestionErrorTypeDataSetDeleted is a IngestionErrorType enum value + IngestionErrorTypeDataSetDeleted = "DATA_SET_DELETED" + + // IngestionErrorTypeDataSetNotSpice is a IngestionErrorType enum value + IngestionErrorTypeDataSetNotSpice = "DATA_SET_NOT_SPICE" + + // IngestionErrorTypeS3UploadedFileDeleted is a IngestionErrorType enum value + IngestionErrorTypeS3UploadedFileDeleted = "S3_UPLOADED_FILE_DELETED" + + // IngestionErrorTypeS3ManifestError is a IngestionErrorType enum value + IngestionErrorTypeS3ManifestError = "S3_MANIFEST_ERROR" + + // IngestionErrorTypeDataToleranceException is a IngestionErrorType enum value + IngestionErrorTypeDataToleranceException = "DATA_TOLERANCE_EXCEPTION" + + // IngestionErrorTypeSpiceTableNotFound is a IngestionErrorType enum value + IngestionErrorTypeSpiceTableNotFound = "SPICE_TABLE_NOT_FOUND" + + // IngestionErrorTypeDataSetSizeLimitExceeded is a IngestionErrorType enum value + IngestionErrorTypeDataSetSizeLimitExceeded = "DATA_SET_SIZE_LIMIT_EXCEEDED" + + // IngestionErrorTypeRowSizeLimitExceeded is a IngestionErrorType enum value + IngestionErrorTypeRowSizeLimitExceeded = "ROW_SIZE_LIMIT_EXCEEDED" + + // IngestionErrorTypeAccountCapacityLimitExceeded is a IngestionErrorType enum value + IngestionErrorTypeAccountCapacityLimitExceeded = "ACCOUNT_CAPACITY_LIMIT_EXCEEDED" + + // IngestionErrorTypeCustomerError is a IngestionErrorType enum value + IngestionErrorTypeCustomerError = "CUSTOMER_ERROR" + + // IngestionErrorTypeDataSourceNotFound is a IngestionErrorType enum value + IngestionErrorTypeDataSourceNotFound = "DATA_SOURCE_NOT_FOUND" + + // IngestionErrorTypeIamRoleNotAvailable is a IngestionErrorType enum value + IngestionErrorTypeIamRoleNotAvailable = "IAM_ROLE_NOT_AVAILABLE" + + // IngestionErrorTypeConnectionFailure is a IngestionErrorType enum value + IngestionErrorTypeConnectionFailure = "CONNECTION_FAILURE" + + // IngestionErrorTypeSqlTableNotFound is a IngestionErrorType enum value + IngestionErrorTypeSqlTableNotFound = "SQL_TABLE_NOT_FOUND" + + // IngestionErrorTypePermissionDenied is a IngestionErrorType enum value + IngestionErrorTypePermissionDenied = "PERMISSION_DENIED" + + // IngestionErrorTypeSslCertificateValidationFailure is a IngestionErrorType enum value + IngestionErrorTypeSslCertificateValidationFailure = "SSL_CERTIFICATE_VALIDATION_FAILURE" + + // IngestionErrorTypeOauthTokenFailure is a IngestionErrorType enum value + IngestionErrorTypeOauthTokenFailure = "OAUTH_TOKEN_FAILURE" + + // IngestionErrorTypeSourceApiLimitExceededFailure is a IngestionErrorType enum value + IngestionErrorTypeSourceApiLimitExceededFailure = "SOURCE_API_LIMIT_EXCEEDED_FAILURE" + + // IngestionErrorTypePasswordAuthenticationFailure is a IngestionErrorType enum value + IngestionErrorTypePasswordAuthenticationFailure = "PASSWORD_AUTHENTICATION_FAILURE" + + // IngestionErrorTypeSqlSchemaMismatchError is a IngestionErrorType enum value + IngestionErrorTypeSqlSchemaMismatchError = "SQL_SCHEMA_MISMATCH_ERROR" + + // IngestionErrorTypeInvalidDateFormat is a IngestionErrorType enum value + IngestionErrorTypeInvalidDateFormat = "INVALID_DATE_FORMAT" + + // IngestionErrorTypeInvalidDataprepSyntax is a IngestionErrorType enum value + IngestionErrorTypeInvalidDataprepSyntax = "INVALID_DATAPREP_SYNTAX" + + // IngestionErrorTypeSourceResourceLimitExceeded is a IngestionErrorType enum value + IngestionErrorTypeSourceResourceLimitExceeded = "SOURCE_RESOURCE_LIMIT_EXCEEDED" + + // IngestionErrorTypeSqlInvalidParameterValue is a IngestionErrorType enum value + IngestionErrorTypeSqlInvalidParameterValue = "SQL_INVALID_PARAMETER_VALUE" + + // IngestionErrorTypeQueryTimeout is a IngestionErrorType enum value + IngestionErrorTypeQueryTimeout = "QUERY_TIMEOUT" + + // IngestionErrorTypeSqlNumericOverflow is a IngestionErrorType enum value + IngestionErrorTypeSqlNumericOverflow = "SQL_NUMERIC_OVERFLOW" + + // IngestionErrorTypeUnresolvableHost is a IngestionErrorType enum value + IngestionErrorTypeUnresolvableHost = "UNRESOLVABLE_HOST" + + // IngestionErrorTypeUnroutableHost is a IngestionErrorType enum value + IngestionErrorTypeUnroutableHost = "UNROUTABLE_HOST" + + // IngestionErrorTypeSqlException is a IngestionErrorType enum value + IngestionErrorTypeSqlException = "SQL_EXCEPTION" + + // IngestionErrorTypeS3FileInaccessible is a IngestionErrorType enum value + IngestionErrorTypeS3FileInaccessible = "S3_FILE_INACCESSIBLE" + + // IngestionErrorTypeIotFileNotFound is a IngestionErrorType enum value + IngestionErrorTypeIotFileNotFound = "IOT_FILE_NOT_FOUND" + + // IngestionErrorTypeIotDataSetFileEmpty is a IngestionErrorType enum value + IngestionErrorTypeIotDataSetFileEmpty = "IOT_DATA_SET_FILE_EMPTY" + + // IngestionErrorTypeInvalidDataSourceConfig is a IngestionErrorType enum value + IngestionErrorTypeInvalidDataSourceConfig = "INVALID_DATA_SOURCE_CONFIG" + + // IngestionErrorTypeDataSourceAuthFailed is a IngestionErrorType enum value + IngestionErrorTypeDataSourceAuthFailed = "DATA_SOURCE_AUTH_FAILED" + + // IngestionErrorTypeDataSourceConnectionFailed is a IngestionErrorType enum value + IngestionErrorTypeDataSourceConnectionFailed = "DATA_SOURCE_CONNECTION_FAILED" + + // IngestionErrorTypeFailureToProcessJsonFile is a IngestionErrorType enum value + IngestionErrorTypeFailureToProcessJsonFile = "FAILURE_TO_PROCESS_JSON_FILE" + + // IngestionErrorTypeInternalServiceError is a IngestionErrorType enum value + IngestionErrorTypeInternalServiceError = "INTERNAL_SERVICE_ERROR" +) + +const ( + // IngestionRequestSourceManual is a IngestionRequestSource enum value + IngestionRequestSourceManual = "MANUAL" + + // IngestionRequestSourceScheduled is a IngestionRequestSource enum value + IngestionRequestSourceScheduled = "SCHEDULED" +) + +const ( + // IngestionRequestTypeInitialIngestion is a IngestionRequestType enum value + IngestionRequestTypeInitialIngestion = "INITIAL_INGESTION" + + // IngestionRequestTypeEdit is a IngestionRequestType enum value + IngestionRequestTypeEdit = "EDIT" + + // IngestionRequestTypeIncrementalRefresh is a IngestionRequestType enum value + IngestionRequestTypeIncrementalRefresh = "INCREMENTAL_REFRESH" + + // IngestionRequestTypeFullRefresh is a IngestionRequestType enum value + IngestionRequestTypeFullRefresh = "FULL_REFRESH" +) + +const ( + // IngestionStatusInitialized is a IngestionStatus enum value + IngestionStatusInitialized = "INITIALIZED" + + // IngestionStatusQueued is a IngestionStatus enum value + IngestionStatusQueued = "QUEUED" + + // IngestionStatusRunning is a IngestionStatus enum value + IngestionStatusRunning = "RUNNING" + + // IngestionStatusFailed is a IngestionStatus enum value + IngestionStatusFailed = "FAILED" + + // IngestionStatusCompleted is a IngestionStatus enum value + IngestionStatusCompleted = "COMPLETED" + + // IngestionStatusCancelled is a IngestionStatus enum value + IngestionStatusCancelled = "CANCELLED" +) + +const ( + // InputColumnDataTypeString is a InputColumnDataType enum value + InputColumnDataTypeString = "STRING" + + // InputColumnDataTypeInteger is a InputColumnDataType enum value + InputColumnDataTypeInteger = "INTEGER" + + // InputColumnDataTypeDecimal is a InputColumnDataType enum value + InputColumnDataTypeDecimal = "DECIMAL" + + // InputColumnDataTypeDatetime is a InputColumnDataType enum value + InputColumnDataTypeDatetime = "DATETIME" + + // InputColumnDataTypeBit is a InputColumnDataType enum value + InputColumnDataTypeBit = "BIT" + + // InputColumnDataTypeBoolean is a InputColumnDataType enum value + InputColumnDataTypeBoolean = "BOOLEAN" + + // InputColumnDataTypeJson is a InputColumnDataType enum value + InputColumnDataTypeJson = "JSON" +) + +const ( + // JoinTypeInner is a JoinType enum value + JoinTypeInner = "INNER" + + // JoinTypeOuter is a JoinType enum value + JoinTypeOuter = "OUTER" + + // JoinTypeLeft is a JoinType enum value + JoinTypeLeft = "LEFT" + + // JoinTypeRight is a JoinType enum value + JoinTypeRight = "RIGHT" +) + +const ( + // ResourceStatusCreationInProgress is a ResourceStatus enum value + ResourceStatusCreationInProgress = "CREATION_IN_PROGRESS" + + // ResourceStatusCreationSuccessful is a ResourceStatus enum value + ResourceStatusCreationSuccessful = "CREATION_SUCCESSFUL" + + // ResourceStatusCreationFailed is a ResourceStatus enum value + ResourceStatusCreationFailed = "CREATION_FAILED" + + // ResourceStatusUpdateInProgress is a ResourceStatus enum value + ResourceStatusUpdateInProgress = "UPDATE_IN_PROGRESS" + + // ResourceStatusUpdateSuccessful is a ResourceStatus enum value + ResourceStatusUpdateSuccessful = "UPDATE_SUCCESSFUL" + + // ResourceStatusUpdateFailed is a ResourceStatus enum value + ResourceStatusUpdateFailed = "UPDATE_FAILED" +) + +const ( + // RowLevelPermissionPolicyGrantAccess is a RowLevelPermissionPolicy enum value + RowLevelPermissionPolicyGrantAccess = "GRANT_ACCESS" + + // RowLevelPermissionPolicyDenyAccess is a RowLevelPermissionPolicy enum value + RowLevelPermissionPolicyDenyAccess = "DENY_ACCESS" +) + +const ( + // TemplateErrorTypeDataSetNotFound is a TemplateErrorType enum value + TemplateErrorTypeDataSetNotFound = "DATA_SET_NOT_FOUND" + + // TemplateErrorTypeInternalFailure is a TemplateErrorType enum value + TemplateErrorTypeInternalFailure = "INTERNAL_FAILURE" +) + +const ( + // TextQualifierDoubleQuote is a TextQualifier enum value + TextQualifierDoubleQuote = "DOUBLE_QUOTE" + + // TextQualifierSingleQuote is a TextQualifier enum value + TextQualifierSingleQuote = "SINGLE_QUOTE" +) + const ( // UserRoleAdmin is a UserRole enum value UserRoleAdmin = "ADMIN" diff --git a/vendor/github.com/aws/aws-sdk-go/service/quicksight/doc.go b/vendor/github.com/aws/aws-sdk-go/service/quicksight/doc.go index e483dccd204..34e16d1c118 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/quicksight/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/quicksight/doc.go @@ -3,10 +3,10 @@ // Package quicksight provides the client and types for making API // requests to Amazon QuickSight. // -// Amazon QuickSight is a fully managed, serverless, cloud business intelligence -// service that makes it easy to extend data and insights to every user in your -// organization. This API interface reference contains documentation for a programming -// interface that you can use to manage Amazon QuickSight. +// Amazon QuickSight is a fully managed, serverless business intelligence service +// for the AWS Cloud that makes it easy to extend data and insights to every +// user in your organization. This API reference contains documentation for +// a programming interface that you can use to manage Amazon QuickSight. // // See https://docs.aws.amazon.com/goto/WebAPI/quicksight-2018-04-01 for more information on this service. // diff --git a/vendor/github.com/aws/aws-sdk-go/service/quicksight/errors.go b/vendor/github.com/aws/aws-sdk-go/service/quicksight/errors.go index 290b6e1486b..2f6b3e713ab 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/quicksight/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/quicksight/errors.go @@ -2,28 +2,46 @@ package quicksight +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccessDeniedException for service response error code // "AccessDeniedException". // - // You don't have access to this. The provided credentials couldn't be validated. - // You might not be authorized to carry out the request. Ensure that your account - // is authorized to use the Amazon QuickSight service, that your policies have - // the correct permissions, and that you are using the correct access keys. + // You don't have access to this item. The provided credentials couldn't be + // validated. You might not be authorized to carry out the request. Make sure + // that your account is authorized to use the Amazon QuickSight service, that + // your policies have the correct permissions, and that you are using the correct + // access keys. ErrCodeAccessDeniedException = "AccessDeniedException" + // ErrCodeConcurrentUpdatingException for service response error code + // "ConcurrentUpdatingException". + // + // A resource is already in a state that indicates an action is happening that + // must complete before a new update can be applied. + ErrCodeConcurrentUpdatingException = "ConcurrentUpdatingException" + + // ErrCodeConflictException for service response error code + // "ConflictException". + // + // Updating or deleting a resource can cause an inconsistent state. + ErrCodeConflictException = "ConflictException" + // ErrCodeDomainNotWhitelistedException for service response error code // "DomainNotWhitelistedException". // - // The domain specified is not on the allowlist. All domains for embedded dashboards + // The domain specified isn't on the allow list. All domains for embedded dashboards // must be added to the approved list by an Amazon QuickSight admin. ErrCodeDomainNotWhitelistedException = "DomainNotWhitelistedException" // ErrCodeIdentityTypeNotSupportedException for service response error code // "IdentityTypeNotSupportedException". // - // The identity type specified is not supported. Supported identity types include + // The identity type specified isn't supported. Supported identity types include // IAM and QUICKSIGHT. ErrCodeIdentityTypeNotSupportedException = "IdentityTypeNotSupportedException" @@ -42,7 +60,7 @@ const ( // ErrCodeInvalidParameterValueException for service response error code // "InvalidParameterValueException". // - // One or more parameters don't have a valid value. + // One or more parameters has a value that isn't valid. ErrCodeInvalidParameterValueException = "InvalidParameterValueException" // ErrCodeLimitExceededException for service response error code @@ -60,7 +78,7 @@ const ( // ErrCodeResourceExistsException for service response error code // "ResourceExistsException". // - // The resource specified doesn't exist. + // The resource specified already exists. ErrCodeResourceExistsException = "ResourceExistsException" // ErrCodeResourceNotFoundException for service response error code @@ -78,8 +96,8 @@ const ( // ErrCodeSessionLifetimeInMinutesInvalidException for service response error code // "SessionLifetimeInMinutesInvalidException". // - // The number of minutes specified for the lifetime of a session is not valid. - // The session lifetime must be from 15 to 600 minutes. + // The number of minutes specified for the lifetime of a session isn't valid. + // The session lifetime must be 15-600 minutes. ErrCodeSessionLifetimeInMinutesInvalidException = "SessionLifetimeInMinutesInvalidException" // ErrCodeThrottlingException for service response error code @@ -100,8 +118,28 @@ const ( // ErrCodeUserNotFoundException for service response error code // "QuickSightUserNotFoundException". // - // The user is not found. This error can happen in any operation that requires - // finding a user based on a provided user name, such as DeleteUser, DescribeUser, - // and so on. + // The user with the provided name isn't found. This error can happen in any + // operation that requires finding a user based on a provided user name, such + // as DeleteUser, DescribeUser, and so on. ErrCodeUserNotFoundException = "QuickSightUserNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "ConcurrentUpdatingException": newErrorConcurrentUpdatingException, + "ConflictException": newErrorConflictException, + "DomainNotWhitelistedException": newErrorDomainNotWhitelistedException, + "IdentityTypeNotSupportedException": newErrorIdentityTypeNotSupportedException, + "InternalFailureException": newErrorInternalFailureException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "InvalidParameterValueException": newErrorInvalidParameterValueException, + "LimitExceededException": newErrorLimitExceededException, + "PreconditionNotMetException": newErrorPreconditionNotMetException, + "ResourceExistsException": newErrorResourceExistsException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ResourceUnavailableException": newErrorResourceUnavailableException, + "SessionLifetimeInMinutesInvalidException": newErrorSessionLifetimeInMinutesInvalidException, + "ThrottlingException": newErrorThrottlingException, + "UnsupportedUserEditionException": newErrorUnsupportedUserEditionException, + "QuickSightUserNotFoundException": newErrorUserNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/quicksight/service.go b/vendor/github.com/aws/aws-sdk-go/service/quicksight/service.go index 3ba978ad6a5..9b0a6902ed0 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/quicksight/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/quicksight/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "QuickSight" // Name of service. EndpointsID = "quicksight" // ID to lookup a service endpoint with. - ServiceID = "QuickSight" // ServiceID is a unique identifer of a specific service. + ServiceID = "QuickSight" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the QuickSight client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a QuickSight client from just a session. // svc := quicksight.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := quicksight.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *QuickSight { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *QuickSight { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *QuickSight { svc := &QuickSight{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-04-01", }, @@ -71,7 +75,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/ram/api.go b/vendor/github.com/aws/aws-sdk-go/service/ram/api.go index 9d84d4fb2c1..af4ed72da80 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ram/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ram/api.go @@ -3,6 +3,7 @@ package ram import ( + "fmt" "time" "github.com/aws/aws-sdk-go/aws" @@ -65,35 +66,35 @@ func (c *RAM) AcceptResourceShareInvitationRequest(input *AcceptResourceShareInv // See the AWS API reference guide for AWS Resource Access Manager's // API operation AcceptResourceShareInvitation for usage and error information. // -// Returned Error Codes: -// * ErrCodeMalformedArnException "MalformedArnException" +// Returned Error Types: +// * MalformedArnException // The format of an Amazon Resource Name (ARN) is not valid. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The requested operation is not permitted. // -// * ErrCodeResourceShareInvitationArnNotFoundException "ResourceShareInvitationArnNotFoundException" +// * ResourceShareInvitationArnNotFoundException // The Amazon Resource Name (ARN) for an invitation was not found. // -// * ErrCodeResourceShareInvitationAlreadyAcceptedException "ResourceShareInvitationAlreadyAcceptedException" +// * ResourceShareInvitationAlreadyAcceptedException // The invitation was already accepted. // -// * ErrCodeResourceShareInvitationAlreadyRejectedException "ResourceShareInvitationAlreadyRejectedException" +// * ResourceShareInvitationAlreadyRejectedException // The invitation was already rejected. // -// * ErrCodeResourceShareInvitationExpiredException "ResourceShareInvitationExpiredException" +// * ResourceShareInvitationExpiredException // The invitation is expired. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // -// * ErrCodeInvalidClientTokenException "InvalidClientTokenException" +// * InvalidClientTokenException // A client token is not valid. // -// * ErrCodeIdempotentParameterMismatchException "IdempotentParameterMismatchException" +// * IdempotentParameterMismatchException // A client token input parameter was reused with an operation, but at least // one of the other input parameters is different from the previous call to // the operation. @@ -174,43 +175,43 @@ func (c *RAM) AssociateResourceShareRequest(input *AssociateResourceShareInput) // See the AWS API reference guide for AWS Resource Access Manager's // API operation AssociateResourceShare for usage and error information. // -// Returned Error Codes: -// * ErrCodeIdempotentParameterMismatchException "IdempotentParameterMismatchException" +// Returned Error Types: +// * IdempotentParameterMismatchException // A client token input parameter was reused with an operation, but at least // one of the other input parameters is different from the previous call to // the operation. // -// * ErrCodeUnknownResourceException "UnknownResourceException" +// * UnknownResourceException // A specified resource was not found. // -// * ErrCodeInvalidStateTransitionException "InvalidStateTransitionException" +// * InvalidStateTransitionException // The requested state transition is not valid. // -// * ErrCodeResourceShareLimitExceededException "ResourceShareLimitExceededException" +// * ResourceShareLimitExceededException // The requested resource share exceeds the limit for your account. // -// * ErrCodeMalformedArnException "MalformedArnException" +// * MalformedArnException // The format of an Amazon Resource Name (ARN) is not valid. // -// * ErrCodeInvalidStateTransitionException "InvalidStateTransitionException" +// * InvalidStateTransitionException // The requested state transition is not valid. // -// * ErrCodeInvalidClientTokenException "InvalidClientTokenException" +// * InvalidClientTokenException // A client token is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // A parameter is not valid. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The requested operation is not permitted. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // -// * ErrCodeUnknownResourceException "UnknownResourceException" +// * UnknownResourceException // A specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/AssociateResourceShare @@ -235,6 +236,103 @@ func (c *RAM) AssociateResourceShareWithContext(ctx aws.Context, input *Associat return out, req.Send() } +const opAssociateResourceSharePermission = "AssociateResourceSharePermission" + +// AssociateResourceSharePermissionRequest generates a "aws/request.Request" representing the +// client's request for the AssociateResourceSharePermission operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AssociateResourceSharePermission for more information on using the AssociateResourceSharePermission +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AssociateResourceSharePermissionRequest method. +// req, resp := client.AssociateResourceSharePermissionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/AssociateResourceSharePermission +func (c *RAM) AssociateResourceSharePermissionRequest(input *AssociateResourceSharePermissionInput) (req *request.Request, output *AssociateResourceSharePermissionOutput) { + op := &request.Operation{ + Name: opAssociateResourceSharePermission, + HTTPMethod: "POST", + HTTPPath: "/associateresourcesharepermission", + } + + if input == nil { + input = &AssociateResourceSharePermissionInput{} + } + + output = &AssociateResourceSharePermissionOutput{} + req = c.newRequest(op, input, output) + return +} + +// AssociateResourceSharePermission API operation for AWS Resource Access Manager. +// +// Associates a permission with a resource share. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Resource Access Manager's +// API operation AssociateResourceSharePermission for usage and error information. +// +// Returned Error Types: +// * MalformedArnException +// The format of an Amazon Resource Name (ARN) is not valid. +// +// * UnknownResourceException +// A specified resource was not found. +// +// * InvalidParameterException +// A parameter is not valid. +// +// * InvalidClientTokenException +// A client token is not valid. +// +// * ServerInternalException +// The service could not respond to the request due to an internal problem. +// +// * ServiceUnavailableException +// The service is not available. +// +// * OperationNotPermittedException +// The requested operation is not permitted. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/AssociateResourceSharePermission +func (c *RAM) AssociateResourceSharePermission(input *AssociateResourceSharePermissionInput) (*AssociateResourceSharePermissionOutput, error) { + req, out := c.AssociateResourceSharePermissionRequest(input) + return out, req.Send() +} + +// AssociateResourceSharePermissionWithContext is the same as AssociateResourceSharePermission with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateResourceSharePermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RAM) AssociateResourceSharePermissionWithContext(ctx aws.Context, input *AssociateResourceSharePermissionInput, opts ...request.Option) (*AssociateResourceSharePermissionOutput, error) { + req, out := c.AssociateResourceSharePermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateResourceShare = "CreateResourceShare" // CreateResourceShareRequest generates a "aws/request.Request" representing the @@ -288,40 +386,40 @@ func (c *RAM) CreateResourceShareRequest(input *CreateResourceShareInput) (req * // See the AWS API reference guide for AWS Resource Access Manager's // API operation CreateResourceShare for usage and error information. // -// Returned Error Codes: -// * ErrCodeIdempotentParameterMismatchException "IdempotentParameterMismatchException" +// Returned Error Types: +// * IdempotentParameterMismatchException // A client token input parameter was reused with an operation, but at least // one of the other input parameters is different from the previous call to // the operation. // -// * ErrCodeInvalidStateTransitionException "InvalidStateTransitionException" +// * InvalidStateTransitionException // The requested state transition is not valid. // -// * ErrCodeUnknownResourceException "UnknownResourceException" +// * UnknownResourceException // A specified resource was not found. // -// * ErrCodeMalformedArnException "MalformedArnException" +// * MalformedArnException // The format of an Amazon Resource Name (ARN) is not valid. // -// * ErrCodeInvalidClientTokenException "InvalidClientTokenException" +// * InvalidClientTokenException // A client token is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // A parameter is not valid. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The requested operation is not permitted. // -// * ErrCodeResourceShareLimitExceededException "ResourceShareLimitExceededException" +// * ResourceShareLimitExceededException // The requested resource share exceeds the limit for your account. // -// * ErrCodeTagPolicyViolationException "TagPolicyViolationException" +// * TagPolicyViolationException // The specified tag is a reserved word and cannot be used. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/CreateResourceShare @@ -399,34 +497,34 @@ func (c *RAM) DeleteResourceShareRequest(input *DeleteResourceShareInput) (req * // See the AWS API reference guide for AWS Resource Access Manager's // API operation DeleteResourceShare for usage and error information. // -// Returned Error Codes: -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// Returned Error Types: +// * OperationNotPermittedException // The requested operation is not permitted. // -// * ErrCodeIdempotentParameterMismatchException "IdempotentParameterMismatchException" +// * IdempotentParameterMismatchException // A client token input parameter was reused with an operation, but at least // one of the other input parameters is different from the previous call to // the operation. // -// * ErrCodeInvalidStateTransitionException "InvalidStateTransitionException" +// * InvalidStateTransitionException // The requested state transition is not valid. // -// * ErrCodeUnknownResourceException "UnknownResourceException" +// * UnknownResourceException // A specified resource was not found. // -// * ErrCodeMalformedArnException "MalformedArnException" +// * MalformedArnException // The format of an Amazon Resource Name (ARN) is not valid. // -// * ErrCodeInvalidClientTokenException "InvalidClientTokenException" +// * InvalidClientTokenException // A client token is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // A parameter is not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/DeleteResourceShare @@ -505,37 +603,37 @@ func (c *RAM) DisassociateResourceShareRequest(input *DisassociateResourceShareI // See the AWS API reference guide for AWS Resource Access Manager's // API operation DisassociateResourceShare for usage and error information. // -// Returned Error Codes: -// * ErrCodeIdempotentParameterMismatchException "IdempotentParameterMismatchException" +// Returned Error Types: +// * IdempotentParameterMismatchException // A client token input parameter was reused with an operation, but at least // one of the other input parameters is different from the previous call to // the operation. // -// * ErrCodeResourceShareLimitExceededException "ResourceShareLimitExceededException" +// * ResourceShareLimitExceededException // The requested resource share exceeds the limit for your account. // -// * ErrCodeMalformedArnException "MalformedArnException" +// * MalformedArnException // The format of an Amazon Resource Name (ARN) is not valid. // -// * ErrCodeInvalidStateTransitionException "InvalidStateTransitionException" +// * InvalidStateTransitionException // The requested state transition is not valid. // -// * ErrCodeInvalidClientTokenException "InvalidClientTokenException" +// * InvalidClientTokenException // A client token is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // A parameter is not valid. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The requested operation is not permitted. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // -// * ErrCodeUnknownResourceException "UnknownResourceException" +// * UnknownResourceException // A specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/DisassociateResourceShare @@ -560,6 +658,103 @@ func (c *RAM) DisassociateResourceShareWithContext(ctx aws.Context, input *Disas return out, req.Send() } +const opDisassociateResourceSharePermission = "DisassociateResourceSharePermission" + +// DisassociateResourceSharePermissionRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateResourceSharePermission operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DisassociateResourceSharePermission for more information on using the DisassociateResourceSharePermission +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DisassociateResourceSharePermissionRequest method. +// req, resp := client.DisassociateResourceSharePermissionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/DisassociateResourceSharePermission +func (c *RAM) DisassociateResourceSharePermissionRequest(input *DisassociateResourceSharePermissionInput) (req *request.Request, output *DisassociateResourceSharePermissionOutput) { + op := &request.Operation{ + Name: opDisassociateResourceSharePermission, + HTTPMethod: "POST", + HTTPPath: "/disassociateresourcesharepermission", + } + + if input == nil { + input = &DisassociateResourceSharePermissionInput{} + } + + output = &DisassociateResourceSharePermissionOutput{} + req = c.newRequest(op, input, output) + return +} + +// DisassociateResourceSharePermission API operation for AWS Resource Access Manager. +// +// Disassociates an AWS RAM permission from a resource share. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Resource Access Manager's +// API operation DisassociateResourceSharePermission for usage and error information. +// +// Returned Error Types: +// * MalformedArnException +// The format of an Amazon Resource Name (ARN) is not valid. +// +// * UnknownResourceException +// A specified resource was not found. +// +// * InvalidParameterException +// A parameter is not valid. +// +// * InvalidClientTokenException +// A client token is not valid. +// +// * ServerInternalException +// The service could not respond to the request due to an internal problem. +// +// * ServiceUnavailableException +// The service is not available. +// +// * OperationNotPermittedException +// The requested operation is not permitted. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/DisassociateResourceSharePermission +func (c *RAM) DisassociateResourceSharePermission(input *DisassociateResourceSharePermissionInput) (*DisassociateResourceSharePermissionOutput, error) { + req, out := c.DisassociateResourceSharePermissionRequest(input) + return out, req.Send() +} + +// DisassociateResourceSharePermissionWithContext is the same as DisassociateResourceSharePermission with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateResourceSharePermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RAM) DisassociateResourceSharePermissionWithContext(ctx aws.Context, input *DisassociateResourceSharePermissionInput, opts ...request.Option) (*DisassociateResourceSharePermissionOutput, error) { + req, out := c.DisassociateResourceSharePermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opEnableSharingWithAwsOrganization = "EnableSharingWithAwsOrganization" // EnableSharingWithAwsOrganizationRequest generates a "aws/request.Request" representing the @@ -615,14 +810,14 @@ func (c *RAM) EnableSharingWithAwsOrganizationRequest(input *EnableSharingWithAw // See the AWS API reference guide for AWS Resource Access Manager's // API operation EnableSharingWithAwsOrganization for usage and error information. // -// Returned Error Codes: -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// Returned Error Types: +// * OperationNotPermittedException // The requested operation is not permitted. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/EnableSharingWithAwsOrganization @@ -647,6 +842,100 @@ func (c *RAM) EnableSharingWithAwsOrganizationWithContext(ctx aws.Context, input return out, req.Send() } +const opGetPermission = "GetPermission" + +// GetPermissionRequest generates a "aws/request.Request" representing the +// client's request for the GetPermission operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetPermission for more information on using the GetPermission +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetPermissionRequest method. +// req, resp := client.GetPermissionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/GetPermission +func (c *RAM) GetPermissionRequest(input *GetPermissionInput) (req *request.Request, output *GetPermissionOutput) { + op := &request.Operation{ + Name: opGetPermission, + HTTPMethod: "POST", + HTTPPath: "/getpermission", + } + + if input == nil { + input = &GetPermissionInput{} + } + + output = &GetPermissionOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetPermission API operation for AWS Resource Access Manager. +// +// Gets the contents of an AWS RAM permission in JSON 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 AWS Resource Access Manager's +// API operation GetPermission for usage and error information. +// +// Returned Error Types: +// * InvalidParameterException +// A parameter is not valid. +// +// * MalformedArnException +// The format of an Amazon Resource Name (ARN) is not valid. +// +// * UnknownResourceException +// A specified resource was not found. +// +// * ServerInternalException +// The service could not respond to the request due to an internal problem. +// +// * ServiceUnavailableException +// The service is not available. +// +// * OperationNotPermittedException +// The requested operation is not permitted. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/GetPermission +func (c *RAM) GetPermission(input *GetPermissionInput) (*GetPermissionOutput, error) { + req, out := c.GetPermissionRequest(input) + return out, req.Send() +} + +// GetPermissionWithContext is the same as GetPermission with the addition of +// the ability to pass a context and additional request options. +// +// See GetPermission for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RAM) GetPermissionWithContext(ctx aws.Context, input *GetPermissionInput, opts ...request.Option) (*GetPermissionOutput, error) { + req, out := c.GetPermissionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetResourcePolicies = "GetResourcePolicies" // GetResourcePoliciesRequest generates a "aws/request.Request" representing the @@ -706,20 +995,20 @@ func (c *RAM) GetResourcePoliciesRequest(input *GetResourcePoliciesInput) (req * // See the AWS API reference guide for AWS Resource Access Manager's // API operation GetResourcePolicies for usage and error information. // -// Returned Error Codes: -// * ErrCodeMalformedArnException "MalformedArnException" +// Returned Error Types: +// * MalformedArnException // The format of an Amazon Resource Name (ARN) is not valid. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The specified value for NextToken is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // A parameter is not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/GetResourcePolicies @@ -787,10 +1076,12 @@ func (c *RAM) GetResourcePoliciesPagesWithContext(ctx aws.Context, input *GetRes }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetResourcePoliciesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetResourcePoliciesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -853,26 +1144,26 @@ func (c *RAM) GetResourceShareAssociationsRequest(input *GetResourceShareAssocia // See the AWS API reference guide for AWS Resource Access Manager's // API operation GetResourceShareAssociations for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceException "UnknownResourceException" +// Returned Error Types: +// * UnknownResourceException // A specified resource was not found. // -// * ErrCodeMalformedArnException "MalformedArnException" +// * MalformedArnException // The format of an Amazon Resource Name (ARN) is not valid. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The specified value for NextToken is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // A parameter is not valid. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The requested operation is not permitted. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/GetResourceShareAssociations @@ -940,10 +1231,12 @@ func (c *RAM) GetResourceShareAssociationsPagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetResourceShareAssociationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetResourceShareAssociationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1006,26 +1299,26 @@ func (c *RAM) GetResourceShareInvitationsRequest(input *GetResourceShareInvitati // See the AWS API reference guide for AWS Resource Access Manager's // API operation GetResourceShareInvitations for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceShareInvitationArnNotFoundException "ResourceShareInvitationArnNotFoundException" +// Returned Error Types: +// * ResourceShareInvitationArnNotFoundException // The Amazon Resource Name (ARN) for an invitation was not found. // -// * ErrCodeInvalidMaxResultsException "InvalidMaxResultsException" +// * InvalidMaxResultsException // The specified value for MaxResults is not valid. // -// * ErrCodeMalformedArnException "MalformedArnException" +// * MalformedArnException // The format of an Amazon Resource Name (ARN) is not valid. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The specified value for NextToken is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // A parameter is not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/GetResourceShareInvitations @@ -1093,10 +1386,12 @@ func (c *RAM) GetResourceShareInvitationsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetResourceShareInvitationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetResourceShareInvitationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1160,23 +1455,23 @@ func (c *RAM) GetResourceSharesRequest(input *GetResourceSharesInput) (req *requ // See the AWS API reference guide for AWS Resource Access Manager's // API operation GetResourceShares for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceException "UnknownResourceException" +// Returned Error Types: +// * UnknownResourceException // A specified resource was not found. // -// * ErrCodeMalformedArnException "MalformedArnException" +// * MalformedArnException // The format of an Amazon Resource Name (ARN) is not valid. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The specified value for NextToken is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // A parameter is not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/GetResourceShares @@ -1244,10 +1539,12 @@ func (c *RAM) GetResourceSharesPagesWithContext(ctx aws.Context, input *GetResou }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetResourceSharesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetResourceSharesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1311,32 +1608,32 @@ func (c *RAM) ListPendingInvitationResourcesRequest(input *ListPendingInvitation // See the AWS API reference guide for AWS Resource Access Manager's // API operation ListPendingInvitationResources for usage and error information. // -// Returned Error Codes: -// * ErrCodeMalformedArnException "MalformedArnException" +// Returned Error Types: +// * MalformedArnException // The format of an Amazon Resource Name (ARN) is not valid. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The specified value for NextToken is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // A parameter is not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // -// * ErrCodeResourceShareInvitationArnNotFoundException "ResourceShareInvitationArnNotFoundException" +// * ResourceShareInvitationArnNotFoundException // The Amazon Resource Name (ARN) for an invitation was not found. // -// * ErrCodeMissingRequiredParameterException "MissingRequiredParameterException" +// * MissingRequiredParameterException // A required input parameter is missing. // -// * ErrCodeResourceShareInvitationAlreadyRejectedException "ResourceShareInvitationAlreadyRejectedException" +// * ResourceShareInvitationAlreadyRejectedException // The invitation was already rejected. // -// * ErrCodeResourceShareInvitationExpiredException "ResourceShareInvitationExpiredException" +// * ResourceShareInvitationExpiredException // The invitation is expired. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/ListPendingInvitationResources @@ -1404,124 +1701,217 @@ func (c *RAM) ListPendingInvitationResourcesPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPendingInvitationResourcesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPendingInvitationResourcesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opListPrincipals = "ListPrincipals" +const opListPermissions = "ListPermissions" -// ListPrincipalsRequest generates a "aws/request.Request" representing the -// client's request for the ListPrincipals operation. The "output" return +// ListPermissionsRequest generates a "aws/request.Request" representing the +// client's request for the ListPermissions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListPrincipals for more information on using the ListPrincipals +// See ListPermissions for more information on using the ListPermissions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListPrincipalsRequest method. -// req, resp := client.ListPrincipalsRequest(params) +// // Example sending a request using the ListPermissionsRequest method. +// req, resp := client.ListPermissionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/ListPrincipals -func (c *RAM) ListPrincipalsRequest(input *ListPrincipalsInput) (req *request.Request, output *ListPrincipalsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/ListPermissions +func (c *RAM) ListPermissionsRequest(input *ListPermissionsInput) (req *request.Request, output *ListPermissionsOutput) { op := &request.Operation{ - Name: opListPrincipals, + Name: opListPermissions, HTTPMethod: "POST", - HTTPPath: "/listprincipals", - Paginator: &request.Paginator{ - InputTokens: []string{"nextToken"}, - OutputTokens: []string{"nextToken"}, - LimitToken: "maxResults", - TruncationToken: "", - }, + HTTPPath: "/listpermissions", } if input == nil { - input = &ListPrincipalsInput{} + input = &ListPermissionsInput{} } - output = &ListPrincipalsOutput{} + output = &ListPermissionsOutput{} req = c.newRequest(op, input, output) return } -// ListPrincipals API operation for AWS Resource Access Manager. +// ListPermissions API operation for AWS Resource Access Manager. // -// Lists the principals that you have shared resources with or the principals -// that have shared resources with you. +// Lists the AWS RAM 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 AWS Resource Access Manager's -// API operation ListPrincipals for usage and error information. +// API operation ListPermissions for usage and error information. // -// Returned Error Codes: -// * ErrCodeMalformedArnException "MalformedArnException" -// The format of an Amazon Resource Name (ARN) is not valid. -// -// * ErrCodeUnknownResourceException "UnknownResourceException" -// A specified resource was not found. +// Returned Error Types: +// * InvalidParameterException +// A parameter is not valid. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The specified value for NextToken is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" -// A parameter is not valid. -// -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/ListPrincipals -func (c *RAM) ListPrincipals(input *ListPrincipalsInput) (*ListPrincipalsOutput, error) { - req, out := c.ListPrincipalsRequest(input) +// * OperationNotPermittedException +// The requested operation is not permitted. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/ListPermissions +func (c *RAM) ListPermissions(input *ListPermissionsInput) (*ListPermissionsOutput, error) { + req, out := c.ListPermissionsRequest(input) return out, req.Send() } -// ListPrincipalsWithContext is the same as ListPrincipals with the addition of +// ListPermissionsWithContext is the same as ListPermissions with the addition of // the ability to pass a context and additional request options. // -// See ListPrincipals for details on how to use this API operation. +// See ListPermissions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *RAM) ListPrincipalsWithContext(ctx aws.Context, input *ListPrincipalsInput, opts ...request.Option) (*ListPrincipalsOutput, error) { - req, out := c.ListPrincipalsRequest(input) +func (c *RAM) ListPermissionsWithContext(ctx aws.Context, input *ListPermissionsInput, opts ...request.Option) (*ListPermissionsOutput, error) { + req, out := c.ListPermissionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListPrincipalsPages iterates over the pages of a ListPrincipals operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. +const opListPrincipals = "ListPrincipals" + +// ListPrincipalsRequest generates a "aws/request.Request" representing the +// client's request for the ListPrincipals operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. // -// See ListPrincipals method for more information on how to use this operation. +// 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. // -// Note: This operation can generate multiple requests to a service. +// See ListPrincipals for more information on using the ListPrincipals +// API call, and error handling. // -// // Example iterating over at most 3 pages of a ListPrincipals operation. -// pageNum := 0 +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListPrincipalsRequest method. +// req, resp := client.ListPrincipalsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/ListPrincipals +func (c *RAM) ListPrincipalsRequest(input *ListPrincipalsInput) (req *request.Request, output *ListPrincipalsOutput) { + op := &request.Operation{ + Name: opListPrincipals, + HTTPMethod: "POST", + HTTPPath: "/listprincipals", + Paginator: &request.Paginator{ + InputTokens: []string{"nextToken"}, + OutputTokens: []string{"nextToken"}, + LimitToken: "maxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListPrincipalsInput{} + } + + output = &ListPrincipalsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListPrincipals API operation for AWS Resource Access Manager. +// +// Lists the principals that you have shared resources with or that have shared +// resources with you. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Resource Access Manager's +// API operation ListPrincipals for usage and error information. +// +// Returned Error Types: +// * MalformedArnException +// The format of an Amazon Resource Name (ARN) is not valid. +// +// * UnknownResourceException +// A specified resource was not found. +// +// * InvalidNextTokenException +// The specified value for NextToken is not valid. +// +// * InvalidParameterException +// A parameter is not valid. +// +// * ServerInternalException +// The service could not respond to the request due to an internal problem. +// +// * ServiceUnavailableException +// The service is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/ListPrincipals +func (c *RAM) ListPrincipals(input *ListPrincipalsInput) (*ListPrincipalsOutput, error) { + req, out := c.ListPrincipalsRequest(input) + return out, req.Send() +} + +// ListPrincipalsWithContext is the same as ListPrincipals with the addition of +// the ability to pass a context and additional request options. +// +// See ListPrincipals for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RAM) ListPrincipalsWithContext(ctx aws.Context, input *ListPrincipalsInput, opts ...request.Option) (*ListPrincipalsOutput, error) { + req, out := c.ListPrincipalsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListPrincipalsPages iterates over the pages of a ListPrincipals operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListPrincipals 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 ListPrincipals operation. +// pageNum := 0 // err := client.ListPrincipalsPages(params, // func(page *ram.ListPrincipalsOutput, lastPage bool) bool { // pageNum++ @@ -1555,13 +1945,112 @@ func (c *RAM) ListPrincipalsPagesWithContext(ctx aws.Context, input *ListPrincip }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPrincipalsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPrincipalsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } +const opListResourceSharePermissions = "ListResourceSharePermissions" + +// ListResourceSharePermissionsRequest generates a "aws/request.Request" representing the +// client's request for the ListResourceSharePermissions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListResourceSharePermissions for more information on using the ListResourceSharePermissions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListResourceSharePermissionsRequest method. +// req, resp := client.ListResourceSharePermissionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/ListResourceSharePermissions +func (c *RAM) ListResourceSharePermissionsRequest(input *ListResourceSharePermissionsInput) (req *request.Request, output *ListResourceSharePermissionsOutput) { + op := &request.Operation{ + Name: opListResourceSharePermissions, + HTTPMethod: "POST", + HTTPPath: "/listresourcesharepermissions", + } + + if input == nil { + input = &ListResourceSharePermissionsInput{} + } + + output = &ListResourceSharePermissionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListResourceSharePermissions API operation for AWS Resource Access Manager. +// +// Lists the AWS RAM permissions that are associated with a resource share. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Resource Access Manager's +// API operation ListResourceSharePermissions for usage and error information. +// +// Returned Error Types: +// * InvalidParameterException +// A parameter is not valid. +// +// * MalformedArnException +// The format of an Amazon Resource Name (ARN) is not valid. +// +// * UnknownResourceException +// A specified resource was not found. +// +// * InvalidNextTokenException +// The specified value for NextToken is not valid. +// +// * ServerInternalException +// The service could not respond to the request due to an internal problem. +// +// * ServiceUnavailableException +// The service is not available. +// +// * OperationNotPermittedException +// The requested operation is not permitted. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/ListResourceSharePermissions +func (c *RAM) ListResourceSharePermissions(input *ListResourceSharePermissionsInput) (*ListResourceSharePermissionsOutput, error) { + req, out := c.ListResourceSharePermissionsRequest(input) + return out, req.Send() +} + +// ListResourceSharePermissionsWithContext is the same as ListResourceSharePermissions with the addition of +// the ability to pass a context and additional request options. +// +// See ListResourceSharePermissions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RAM) ListResourceSharePermissionsWithContext(ctx aws.Context, input *ListResourceSharePermissionsInput, opts ...request.Option) (*ListResourceSharePermissionsOutput, error) { + req, out := c.ListResourceSharePermissionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opListResources = "ListResources" // ListResourcesRequest generates a "aws/request.Request" representing the @@ -1622,26 +2111,26 @@ func (c *RAM) ListResourcesRequest(input *ListResourcesInput) (req *request.Requ // See the AWS API reference guide for AWS Resource Access Manager's // API operation ListResources for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidResourceTypeException "InvalidResourceTypeException" +// Returned Error Types: +// * InvalidResourceTypeException // The specified resource type is not valid. // -// * ErrCodeUnknownResourceException "UnknownResourceException" +// * UnknownResourceException // A specified resource was not found. // -// * ErrCodeMalformedArnException "MalformedArnException" +// * MalformedArnException // The format of an Amazon Resource Name (ARN) is not valid. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The specified value for NextToken is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // A parameter is not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/ListResources @@ -1709,13 +2198,118 @@ func (c *RAM) ListResourcesPagesWithContext(ctx aws.Context, input *ListResource }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListResourcesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListResourcesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } +const opPromoteResourceShareCreatedFromPolicy = "PromoteResourceShareCreatedFromPolicy" + +// PromoteResourceShareCreatedFromPolicyRequest generates a "aws/request.Request" representing the +// client's request for the PromoteResourceShareCreatedFromPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PromoteResourceShareCreatedFromPolicy for more information on using the PromoteResourceShareCreatedFromPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PromoteResourceShareCreatedFromPolicyRequest method. +// req, resp := client.PromoteResourceShareCreatedFromPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/PromoteResourceShareCreatedFromPolicy +func (c *RAM) PromoteResourceShareCreatedFromPolicyRequest(input *PromoteResourceShareCreatedFromPolicyInput) (req *request.Request, output *PromoteResourceShareCreatedFromPolicyOutput) { + op := &request.Operation{ + Name: opPromoteResourceShareCreatedFromPolicy, + HTTPMethod: "POST", + HTTPPath: "/promoteresourcesharecreatedfrompolicy", + } + + if input == nil { + input = &PromoteResourceShareCreatedFromPolicyInput{} + } + + output = &PromoteResourceShareCreatedFromPolicyOutput{} + req = c.newRequest(op, input, output) + return +} + +// PromoteResourceShareCreatedFromPolicy API operation for AWS Resource Access Manager. +// +// Resource shares that were created by attaching a policy to a resource are +// visible only to the resource share owner, and the resource share cannot be +// modified in AWS RAM. +// +// Use this API action to promote the resource share. When you promote the resource +// share, it becomes: +// +// * Visible to all principals that it is shared with. +// +// * Modifiable in AWS RAM. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS Resource Access Manager's +// API operation PromoteResourceShareCreatedFromPolicy for usage and error information. +// +// Returned Error Types: +// * MalformedArnException +// The format of an Amazon Resource Name (ARN) is not valid. +// +// * OperationNotPermittedException +// The requested operation is not permitted. +// +// * InvalidParameterException +// A parameter is not valid. +// +// * MissingRequiredParameterException +// A required input parameter is missing. +// +// * ServerInternalException +// The service could not respond to the request due to an internal problem. +// +// * ServiceUnavailableException +// The service is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/PromoteResourceShareCreatedFromPolicy +func (c *RAM) PromoteResourceShareCreatedFromPolicy(input *PromoteResourceShareCreatedFromPolicyInput) (*PromoteResourceShareCreatedFromPolicyOutput, error) { + req, out := c.PromoteResourceShareCreatedFromPolicyRequest(input) + return out, req.Send() +} + +// PromoteResourceShareCreatedFromPolicyWithContext is the same as PromoteResourceShareCreatedFromPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PromoteResourceShareCreatedFromPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RAM) PromoteResourceShareCreatedFromPolicyWithContext(ctx aws.Context, input *PromoteResourceShareCreatedFromPolicyInput, opts ...request.Option) (*PromoteResourceShareCreatedFromPolicyOutput, error) { + req, out := c.PromoteResourceShareCreatedFromPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opRejectResourceShareInvitation = "RejectResourceShareInvitation" // RejectResourceShareInvitationRequest generates a "aws/request.Request" representing the @@ -1769,35 +2363,35 @@ func (c *RAM) RejectResourceShareInvitationRequest(input *RejectResourceShareInv // See the AWS API reference guide for AWS Resource Access Manager's // API operation RejectResourceShareInvitation for usage and error information. // -// Returned Error Codes: -// * ErrCodeMalformedArnException "MalformedArnException" +// Returned Error Types: +// * MalformedArnException // The format of an Amazon Resource Name (ARN) is not valid. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The requested operation is not permitted. // -// * ErrCodeResourceShareInvitationArnNotFoundException "ResourceShareInvitationArnNotFoundException" +// * ResourceShareInvitationArnNotFoundException // The Amazon Resource Name (ARN) for an invitation was not found. // -// * ErrCodeResourceShareInvitationAlreadyAcceptedException "ResourceShareInvitationAlreadyAcceptedException" +// * ResourceShareInvitationAlreadyAcceptedException // The invitation was already accepted. // -// * ErrCodeResourceShareInvitationAlreadyRejectedException "ResourceShareInvitationAlreadyRejectedException" +// * ResourceShareInvitationAlreadyRejectedException // The invitation was already rejected. // -// * ErrCodeResourceShareInvitationExpiredException "ResourceShareInvitationExpiredException" +// * ResourceShareInvitationExpiredException // The invitation is expired. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // -// * ErrCodeInvalidClientTokenException "InvalidClientTokenException" +// * InvalidClientTokenException // A client token is not valid. // -// * ErrCodeIdempotentParameterMismatchException "IdempotentParameterMismatchException" +// * IdempotentParameterMismatchException // A client token input parameter was reused with an operation, but at least // one of the other input parameters is different from the previous call to // the operation. @@ -1878,26 +2472,26 @@ func (c *RAM) TagResourceRequest(input *TagResourceInput) (req *request.Request, // See the AWS API reference guide for AWS Resource Access Manager's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is not valid. // -// * ErrCodeMalformedArnException "MalformedArnException" +// * MalformedArnException // The format of an Amazon Resource Name (ARN) is not valid. // -// * ErrCodeTagLimitExceededException "TagLimitExceededException" +// * TagLimitExceededException // The requested tags exceed the limit for your account. // -// * ErrCodeResourceArnNotFoundException "ResourceArnNotFoundException" +// * ResourceArnNotFoundException // An Amazon Resource Name (ARN) was not found. // -// * ErrCodeTagPolicyViolationException "TagPolicyViolationException" +// * TagPolicyViolationException // The specified tag is a reserved word and cannot be used. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/TagResource @@ -1976,14 +2570,14 @@ func (c *RAM) UntagResourceRequest(input *UntagResourceInput) (req *request.Requ // See the AWS API reference guide for AWS Resource Access Manager's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // A parameter is not valid. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/UntagResource @@ -2061,34 +2655,34 @@ func (c *RAM) UpdateResourceShareRequest(input *UpdateResourceShareInput) (req * // See the AWS API reference guide for AWS Resource Access Manager's // API operation UpdateResourceShare for usage and error information. // -// Returned Error Codes: -// * ErrCodeIdempotentParameterMismatchException "IdempotentParameterMismatchException" +// Returned Error Types: +// * IdempotentParameterMismatchException // A client token input parameter was reused with an operation, but at least // one of the other input parameters is different from the previous call to // the operation. // -// * ErrCodeMissingRequiredParameterException "MissingRequiredParameterException" +// * MissingRequiredParameterException // A required input parameter is missing. // -// * ErrCodeUnknownResourceException "UnknownResourceException" +// * UnknownResourceException // A specified resource was not found. // -// * ErrCodeMalformedArnException "MalformedArnException" +// * MalformedArnException // The format of an Amazon Resource Name (ARN) is not valid. // -// * ErrCodeInvalidClientTokenException "InvalidClientTokenException" +// * InvalidClientTokenException // A client token is not valid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // A parameter is not valid. // -// * ErrCodeOperationNotPermittedException "OperationNotPermittedException" +// * OperationNotPermittedException // The requested operation is not permitted. // -// * ErrCodeServerInternalException "ServerInternalException" +// * ServerInternalException // The service could not respond to the request due to an internal problem. // -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// * ServiceUnavailableException // The service is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ram-2018-01-04/UpdateResourceShare @@ -2293,49 +2887,160 @@ func (s *AssociateResourceShareOutput) SetResourceShareAssociations(v []*Resourc return s } -type CreateResourceShareInput struct { +type AssociateResourceSharePermissionInput struct { _ struct{} `type:"structure"` - // Indicates whether principals outside your AWS organization can be associated - // with a resource share. - AllowExternalPrincipals *bool `locationName:"allowExternalPrincipals" type:"boolean"` - // A unique, case-sensitive identifier that you provide to ensure the idempotency // of the request. ClientToken *string `locationName:"clientToken" type:"string"` - // The name of the resource share. + // The ARN of the AWS RAM permission to associate with the resource share. // - // Name is a required field - Name *string `locationName:"name" type:"string" required:"true"` - - // The principals to associate with the resource share. The possible values - // are IDs of AWS accounts, the ARN of an OU or organization from AWS Organizations. - Principals []*string `locationName:"principals" type:"list"` + // PermissionArn is a required field + PermissionArn *string `locationName:"permissionArn" type:"string" required:"true"` - // The Amazon Resource Names (ARN) of the resources to associate with the resource - // share. - ResourceArns []*string `locationName:"resourceArns" type:"list"` + // Indicates whether the permission should replace the permissions that are + // currently associated with the resource share. Use true to replace the current + // permissions. Use false to add the permission to the current permission. + Replace *bool `locationName:"replace" type:"boolean"` - // One or more tags. - Tags []*Tag `locationName:"tags" type:"list"` + // The Amazon Resource Name (ARN) of the resource share. + // + // ResourceShareArn is a required field + ResourceShareArn *string `locationName:"resourceShareArn" type:"string" required:"true"` } // String returns the string representation -func (s CreateResourceShareInput) String() string { +func (s AssociateResourceSharePermissionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateResourceShareInput) GoString() string { +func (s AssociateResourceSharePermissionInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateResourceShareInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateResourceShareInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) +func (s *AssociateResourceSharePermissionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssociateResourceSharePermissionInput"} + if s.PermissionArn == nil { + invalidParams.Add(request.NewErrParamRequired("PermissionArn")) + } + if s.ResourceShareArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceShareArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *AssociateResourceSharePermissionInput) SetClientToken(v string) *AssociateResourceSharePermissionInput { + s.ClientToken = &v + return s +} + +// SetPermissionArn sets the PermissionArn field's value. +func (s *AssociateResourceSharePermissionInput) SetPermissionArn(v string) *AssociateResourceSharePermissionInput { + s.PermissionArn = &v + return s +} + +// SetReplace sets the Replace field's value. +func (s *AssociateResourceSharePermissionInput) SetReplace(v bool) *AssociateResourceSharePermissionInput { + s.Replace = &v + return s +} + +// SetResourceShareArn sets the ResourceShareArn field's value. +func (s *AssociateResourceSharePermissionInput) SetResourceShareArn(v string) *AssociateResourceSharePermissionInput { + s.ResourceShareArn = &v + return s +} + +type AssociateResourceSharePermissionOutput struct { + _ struct{} `type:"structure"` + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string `locationName:"clientToken" type:"string"` + + // Indicates whether the request succeeded. + ReturnValue *bool `locationName:"returnValue" type:"boolean"` +} + +// String returns the string representation +func (s AssociateResourceSharePermissionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateResourceSharePermissionOutput) GoString() string { + return s.String() +} + +// SetClientToken sets the ClientToken field's value. +func (s *AssociateResourceSharePermissionOutput) SetClientToken(v string) *AssociateResourceSharePermissionOutput { + s.ClientToken = &v + return s +} + +// SetReturnValue sets the ReturnValue field's value. +func (s *AssociateResourceSharePermissionOutput) SetReturnValue(v bool) *AssociateResourceSharePermissionOutput { + s.ReturnValue = &v + return s +} + +type CreateResourceShareInput struct { + _ struct{} `type:"structure"` + + // Indicates whether principals outside your AWS organization can be associated + // with a resource share. + AllowExternalPrincipals *bool `locationName:"allowExternalPrincipals" type:"boolean"` + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string `locationName:"clientToken" type:"string"` + + // The name of the resource share. + // + // Name is a required field + Name *string `locationName:"name" type:"string" required:"true"` + + // The ARNs of the permissions to associate with the resource share. If you + // do not specify an ARN for the permission, AWS RAM automatically attaches + // the default version of the permission for each resource type. + PermissionArns []*string `locationName:"permissionArns" type:"list"` + + // The principals to associate with the resource share. The possible values + // are IDs of AWS accounts, the ARN of an OU or organization from AWS Organizations. + Principals []*string `locationName:"principals" type:"list"` + + // The Amazon Resource Names (ARN) of the resources to associate with the resource + // share. + ResourceArns []*string `locationName:"resourceArns" type:"list"` + + // One or more tags. + Tags []*Tag `locationName:"tags" type:"list"` +} + +// String returns the string representation +func (s CreateResourceShareInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateResourceShareInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateResourceShareInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateResourceShareInput"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { @@ -2362,6 +3067,12 @@ func (s *CreateResourceShareInput) SetName(v string) *CreateResourceShareInput { return s } +// SetPermissionArns sets the PermissionArns field's value. +func (s *CreateResourceShareInput) SetPermissionArns(v []*string) *CreateResourceShareInput { + s.PermissionArns = v + return s +} + // SetPrincipals sets the Principals field's value. func (s *CreateResourceShareInput) SetPrincipals(v []*string) *CreateResourceShareInput { s.Principals = v @@ -2504,7 +3215,7 @@ type DisassociateResourceShareInput struct { // The principals. Principals []*string `locationName:"principals" type:"list"` - // The Amazon Resource Names (ARN) of the resources. + // The Amazon Resource Names (ARNs) of the resources. ResourceArns []*string `locationName:"resourceArns" type:"list"` // The Amazon Resource Name (ARN) of the resource share. @@ -2593,6 +3304,101 @@ func (s *DisassociateResourceShareOutput) SetResourceShareAssociations(v []*Reso return s } +type DisassociateResourceSharePermissionInput struct { + _ struct{} `type:"structure"` + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string `locationName:"clientToken" type:"string"` + + // The ARN of the permission to disassociate from the resource share. + // + // PermissionArn is a required field + PermissionArn *string `locationName:"permissionArn" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the resource share. + // + // ResourceShareArn is a required field + ResourceShareArn *string `locationName:"resourceShareArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s DisassociateResourceSharePermissionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateResourceSharePermissionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisassociateResourceSharePermissionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisassociateResourceSharePermissionInput"} + if s.PermissionArn == nil { + invalidParams.Add(request.NewErrParamRequired("PermissionArn")) + } + if s.ResourceShareArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceShareArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *DisassociateResourceSharePermissionInput) SetClientToken(v string) *DisassociateResourceSharePermissionInput { + s.ClientToken = &v + return s +} + +// SetPermissionArn sets the PermissionArn field's value. +func (s *DisassociateResourceSharePermissionInput) SetPermissionArn(v string) *DisassociateResourceSharePermissionInput { + s.PermissionArn = &v + return s +} + +// SetResourceShareArn sets the ResourceShareArn field's value. +func (s *DisassociateResourceSharePermissionInput) SetResourceShareArn(v string) *DisassociateResourceSharePermissionInput { + s.ResourceShareArn = &v + return s +} + +type DisassociateResourceSharePermissionOutput struct { + _ struct{} `type:"structure"` + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string `locationName:"clientToken" type:"string"` + + // Indicates whether the request succeeded. + ReturnValue *bool `locationName:"returnValue" type:"boolean"` +} + +// String returns the string representation +func (s DisassociateResourceSharePermissionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateResourceSharePermissionOutput) GoString() string { + return s.String() +} + +// SetClientToken sets the ClientToken field's value. +func (s *DisassociateResourceSharePermissionOutput) SetClientToken(v string) *DisassociateResourceSharePermissionOutput { + s.ClientToken = &v + return s +} + +// SetReturnValue sets the ReturnValue field's value. +func (s *DisassociateResourceSharePermissionOutput) SetReturnValue(v bool) *DisassociateResourceSharePermissionOutput { + s.ReturnValue = &v + return s +} + type EnableSharingWithAwsOrganizationInput struct { _ struct{} `type:"structure"` } @@ -2630,6 +3436,76 @@ func (s *EnableSharingWithAwsOrganizationOutput) SetReturnValue(v bool) *EnableS return s } +type GetPermissionInput struct { + _ struct{} `type:"structure"` + + // The ARN of the permission. + // + // PermissionArn is a required field + PermissionArn *string `locationName:"permissionArn" type:"string" required:"true"` + + // The identifier for the version of the permission. + PermissionVersion *int64 `locationName:"permissionVersion" type:"integer"` +} + +// String returns the string representation +func (s GetPermissionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPermissionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetPermissionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetPermissionInput"} + if s.PermissionArn == nil { + invalidParams.Add(request.NewErrParamRequired("PermissionArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPermissionArn sets the PermissionArn field's value. +func (s *GetPermissionInput) SetPermissionArn(v string) *GetPermissionInput { + s.PermissionArn = &v + return s +} + +// SetPermissionVersion sets the PermissionVersion field's value. +func (s *GetPermissionInput) SetPermissionVersion(v int64) *GetPermissionInput { + s.PermissionVersion = &v + return s +} + +type GetPermissionOutput struct { + _ struct{} `type:"structure"` + + // Information about the permission. + Permission *ResourceSharePermissionDetail `locationName:"permission" type:"structure"` +} + +// String returns the string representation +func (s GetPermissionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetPermissionOutput) GoString() string { + return s.String() +} + +// SetPermission sets the Permission field's value. +func (s *GetPermissionOutput) SetPermission(v *ResourceSharePermissionDetail) *GetPermissionOutput { + s.Permission = v + return s +} + type GetResourcePoliciesInput struct { _ struct{} `type:"structure"` @@ -2738,7 +3614,9 @@ type GetResourceShareAssociationsInput struct { // The association status. AssociationStatus *string `locationName:"associationStatus" type:"string" enum:"ResourceShareAssociationStatus"` - // The association type. + // The association type. Specify PRINCIPAL to list the principals that are associated + // with the specified resource share. Specify RESOURCE to list the resources + // that are associated with the specified resource share. // // AssociationType is a required field AssociationType *string `locationName:"associationType" type:"string" required:"true" enum:"ResourceShareAssociationType"` @@ -3089,232 +3967,401 @@ func (s *GetResourceSharesOutput) SetResourceShares(v []*ResourceShare) *GetReso return s } -type ListPendingInvitationResourcesInput struct { - _ struct{} `type:"structure"` - - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` - - // The token for the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` +// A client token input parameter was reused with an operation, but at least +// one of the other input parameters is different from the previous call to +// the operation. +type IdempotentParameterMismatchException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The Amazon Resource Name (ARN) of the invitation. - // - // ResourceShareInvitationArn is a required field - ResourceShareInvitationArn *string `locationName:"resourceShareInvitationArn" type:"string" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListPendingInvitationResourcesInput) String() string { +func (s IdempotentParameterMismatchException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListPendingInvitationResourcesInput) GoString() string { +func (s IdempotentParameterMismatchException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPendingInvitationResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPendingInvitationResourcesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.ResourceShareInvitationArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceShareInvitationArn")) +func newErrorIdempotentParameterMismatchException(v protocol.ResponseMetadata) error { + return &IdempotentParameterMismatchException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s IdempotentParameterMismatchException) Code() string { + return "IdempotentParameterMismatchException" +} + +// Message returns the exception's message. +func (s IdempotentParameterMismatchException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IdempotentParameterMismatchException) OrigErr() error { return nil } -// SetMaxResults sets the MaxResults field's value. -func (s *ListPendingInvitationResourcesInput) SetMaxResults(v int64) *ListPendingInvitationResourcesInput { - s.MaxResults = &v - return s +func (s IdempotentParameterMismatchException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetNextToken sets the NextToken field's value. -func (s *ListPendingInvitationResourcesInput) SetNextToken(v string) *ListPendingInvitationResourcesInput { - s.NextToken = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s IdempotentParameterMismatchException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetResourceShareInvitationArn sets the ResourceShareInvitationArn field's value. -func (s *ListPendingInvitationResourcesInput) SetResourceShareInvitationArn(v string) *ListPendingInvitationResourcesInput { - s.ResourceShareInvitationArn = &v - return s +// RequestID returns the service's response RequestID for request. +func (s IdempotentParameterMismatchException) RequestID() string { + return s.respMetadata.RequestID } -type ListPendingInvitationResourcesOutput 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 client token is not valid. +type InvalidClientTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Information about the resources included the resource share. - Resources []*Resource `locationName:"resources" type:"list"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListPendingInvitationResourcesOutput) String() string { +func (s InvalidClientTokenException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListPendingInvitationResourcesOutput) GoString() string { +func (s InvalidClientTokenException) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListPendingInvitationResourcesOutput) SetNextToken(v string) *ListPendingInvitationResourcesOutput { - s.NextToken = &v - return s +func newErrorInvalidClientTokenException(v protocol.ResponseMetadata) error { + return &InvalidClientTokenException{ + respMetadata: v, + } } -// SetResources sets the Resources field's value. -func (s *ListPendingInvitationResourcesOutput) SetResources(v []*Resource) *ListPendingInvitationResourcesOutput { - s.Resources = v - return s +// Code returns the exception type name. +func (s InvalidClientTokenException) Code() string { + return "InvalidClientTokenException" } -type ListPrincipalsInput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidClientTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The maximum number of results to return with a single call. To retrieve the - // remaining results, make another call with the returned nextToken value. - MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidClientTokenException) OrigErr() error { + return nil +} - // The token for the next page of results. - NextToken *string `locationName:"nextToken" type:"string"` +func (s InvalidClientTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The principals. - Principals []*string `locationName:"principals" type:"list"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidClientTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The Amazon Resource Name (ARN) of the resource. - ResourceArn *string `locationName:"resourceArn" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s InvalidClientTokenException) RequestID() string { + return s.respMetadata.RequestID +} - // The type of owner. - // - // ResourceOwner is a required field - ResourceOwner *string `locationName:"resourceOwner" type:"string" required:"true" enum:"ResourceOwner"` +// The specified value for MaxResults is not valid. +type InvalidMaxResultsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The Amazon Resource Names (ARN) of the resource shares. - ResourceShareArns []*string `locationName:"resourceShareArns" type:"list"` + Message_ *string `locationName:"message" type:"string"` +} - // The resource type. - // - // Valid values: route53resolver:ResolverRule | ec2:TransitGateway | ec2:Subnet - // | license-manager:LicenseConfiguration - ResourceType *string `locationName:"resourceType" type:"string"` +// String returns the string representation +func (s InvalidMaxResultsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidMaxResultsException) GoString() string { + return s.String() +} + +func newErrorInvalidMaxResultsException(v protocol.ResponseMetadata) error { + return &InvalidMaxResultsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidMaxResultsException) Code() string { + return "InvalidMaxResultsException" +} + +// Message returns the exception's message. +func (s InvalidMaxResultsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidMaxResultsException) OrigErr() error { + return nil +} + +func (s InvalidMaxResultsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidMaxResultsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidMaxResultsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified value for NextToken is not valid. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListPrincipalsInput) String() string { +func (s InvalidNextTokenException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListPrincipalsInput) GoString() string { +func (s InvalidNextTokenException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPrincipalsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPrincipalsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, } - if s.ResourceOwner == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceOwner")) +} + +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} - if invalidParams.Len() > 0 { - return invalidParams +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// A parameter is not valid. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { return nil } -// SetMaxResults sets the MaxResults field's value. -func (s *ListPrincipalsInput) SetMaxResults(v int64) *ListPrincipalsInput { - s.MaxResults = &v - return s +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetNextToken sets the NextToken field's value. -func (s *ListPrincipalsInput) SetNextToken(v string) *ListPrincipalsInput { - s.NextToken = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetPrincipals sets the Principals field's value. -func (s *ListPrincipalsInput) SetPrincipals(v []*string) *ListPrincipalsInput { - s.Principals = v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID } -// SetResourceArn sets the ResourceArn field's value. -func (s *ListPrincipalsInput) SetResourceArn(v string) *ListPrincipalsInput { - s.ResourceArn = &v - return s +// The specified resource type is not valid. +type InvalidResourceTypeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } -// SetResourceOwner sets the ResourceOwner field's value. -func (s *ListPrincipalsInput) SetResourceOwner(v string) *ListPrincipalsInput { - s.ResourceOwner = &v - return s +// String returns the string representation +func (s InvalidResourceTypeException) String() string { + return awsutil.Prettify(s) } -// SetResourceShareArns sets the ResourceShareArns field's value. -func (s *ListPrincipalsInput) SetResourceShareArns(v []*string) *ListPrincipalsInput { - s.ResourceShareArns = v - return s +// GoString returns the string representation +func (s InvalidResourceTypeException) GoString() string { + return s.String() } -// SetResourceType sets the ResourceType field's value. -func (s *ListPrincipalsInput) SetResourceType(v string) *ListPrincipalsInput { - s.ResourceType = &v - return s +func newErrorInvalidResourceTypeException(v protocol.ResponseMetadata) error { + return &InvalidResourceTypeException{ + respMetadata: v, + } } -type ListPrincipalsOutput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s InvalidResourceTypeException) Code() string { + return "InvalidResourceTypeException" +} - // 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"` +// Message returns the exception's message. +func (s InvalidResourceTypeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The principals. - Principals []*Principal `locationName:"principals" type:"list"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidResourceTypeException) OrigErr() error { + return nil +} + +func (s InvalidResourceTypeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidResourceTypeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidResourceTypeException) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested state transition is not valid. +type InvalidStateTransitionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListPrincipalsOutput) String() string { +func (s InvalidStateTransitionException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListPrincipalsOutput) GoString() string { +func (s InvalidStateTransitionException) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListPrincipalsOutput) SetNextToken(v string) *ListPrincipalsOutput { - s.NextToken = &v - return s +func newErrorInvalidStateTransitionException(v protocol.ResponseMetadata) error { + return &InvalidStateTransitionException{ + respMetadata: v, + } } -// SetPrincipals sets the Principals field's value. -func (s *ListPrincipalsOutput) SetPrincipals(v []*Principal) *ListPrincipalsOutput { - s.Principals = v - return s +// Code returns the exception type name. +func (s InvalidStateTransitionException) Code() string { + return "InvalidStateTransitionException" } -type ListResourcesInput struct { +// Message returns the exception's message. +func (s InvalidStateTransitionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidStateTransitionException) OrigErr() error { + return nil +} + +func (s InvalidStateTransitionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidStateTransitionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidStateTransitionException) RequestID() string { + return s.respMetadata.RequestID +} + +type ListPendingInvitationResourcesInput struct { _ struct{} `type:"structure"` // The maximum number of results to return with a single call. To retrieve the @@ -3324,45 +4371,30 @@ type ListResourcesInput struct { // The token for the next page of results. NextToken *string `locationName:"nextToken" type:"string"` - // The principal. - Principal *string `locationName:"principal" type:"string"` - - // The Amazon Resource Names (ARN) of the resources. - ResourceArns []*string `locationName:"resourceArns" type:"list"` - - // The type of owner. - // - // ResourceOwner is a required field - ResourceOwner *string `locationName:"resourceOwner" type:"string" required:"true" enum:"ResourceOwner"` - - // The Amazon Resource Names (ARN) of the resource shares. - ResourceShareArns []*string `locationName:"resourceShareArns" type:"list"` - - // The resource type. + // The Amazon Resource Name (ARN) of the invitation. // - // Valid values: route53resolver:ResolverRule | ec2:TransitGateway | ec2:Subnet - // | license-manager:LicenseConfiguration - ResourceType *string `locationName:"resourceType" type:"string"` + // ResourceShareInvitationArn is a required field + ResourceShareInvitationArn *string `locationName:"resourceShareInvitationArn" type:"string" required:"true"` } // String returns the string representation -func (s ListResourcesInput) String() string { +func (s ListPendingInvitationResourcesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListResourcesInput) GoString() string { +func (s ListPendingInvitationResourcesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListResourcesInput"} +func (s *ListPendingInvitationResourcesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListPendingInvitationResourcesInput"} if s.MaxResults != nil && *s.MaxResults < 1 { invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } - if s.ResourceOwner == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceOwner")) + if s.ResourceShareInvitationArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceShareInvitationArn")) } if invalidParams.Len() > 0 { @@ -3371,585 +4403,1895 @@ func (s *ListResourcesInput) Validate() error { return nil } -// SetMaxResults sets the MaxResults field's value. -func (s *ListResourcesInput) SetMaxResults(v int64) *ListResourcesInput { - s.MaxResults = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListPendingInvitationResourcesInput) SetMaxResults(v int64) *ListPendingInvitationResourcesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListPendingInvitationResourcesInput) SetNextToken(v string) *ListPendingInvitationResourcesInput { + s.NextToken = &v + return s +} + +// SetResourceShareInvitationArn sets the ResourceShareInvitationArn field's value. +func (s *ListPendingInvitationResourcesInput) SetResourceShareInvitationArn(v string) *ListPendingInvitationResourcesInput { + s.ResourceShareInvitationArn = &v + return s +} + +type ListPendingInvitationResourcesOutput 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 resources included the resource share. + Resources []*Resource `locationName:"resources" type:"list"` +} + +// String returns the string representation +func (s ListPendingInvitationResourcesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPendingInvitationResourcesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListPendingInvitationResourcesOutput) SetNextToken(v string) *ListPendingInvitationResourcesOutput { + s.NextToken = &v + return s +} + +// SetResources sets the Resources field's value. +func (s *ListPendingInvitationResourcesOutput) SetResources(v []*Resource) *ListPendingInvitationResourcesOutput { + s.Resources = v + return s +} + +type ListPermissionsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // The token for the next page of results. + NextToken *string `locationName:"nextToken" type:"string"` + + // Specifies the resource type for which to list permissions. For example, to + // list only permissions that apply to EC2 subnets, specify ec2:Subnet. + ResourceType *string `locationName:"resourceType" type:"string"` +} + +// String returns the string representation +func (s ListPermissionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPermissionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListPermissionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListPermissionsInput"} + 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 *ListPermissionsInput) SetMaxResults(v int64) *ListPermissionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListPermissionsInput) SetNextToken(v string) *ListPermissionsInput { + s.NextToken = &v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ListPermissionsInput) SetResourceType(v string) *ListPermissionsInput { + s.ResourceType = &v + return s +} + +type ListPermissionsOutput 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 permissions. + Permissions []*ResourceSharePermissionSummary `locationName:"permissions" type:"list"` +} + +// String returns the string representation +func (s ListPermissionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPermissionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListPermissionsOutput) SetNextToken(v string) *ListPermissionsOutput { + s.NextToken = &v + return s +} + +// SetPermissions sets the Permissions field's value. +func (s *ListPermissionsOutput) SetPermissions(v []*ResourceSharePermissionSummary) *ListPermissionsOutput { + s.Permissions = v + return s +} + +type ListPrincipalsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // The token for the next page of results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The principals. + Principals []*string `locationName:"principals" type:"list"` + + // The Amazon Resource Name (ARN) of the resource. + ResourceArn *string `locationName:"resourceArn" type:"string"` + + // The type of owner. + // + // ResourceOwner is a required field + ResourceOwner *string `locationName:"resourceOwner" type:"string" required:"true" enum:"ResourceOwner"` + + // The Amazon Resource Names (ARN) of the resource shares. + ResourceShareArns []*string `locationName:"resourceShareArns" type:"list"` + + // The resource type. + // + // Valid values: ec2:CapacityReservation | ec2:Subnet | ec2:TrafficMirrorTarget + // | ec2:TransitGateway | license-manager:LicenseConfiguration | rds:Cluster + // | route53resolver:ResolverRule I resource-groups:Group + ResourceType *string `locationName:"resourceType" type:"string"` +} + +// String returns the string representation +func (s ListPrincipalsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPrincipalsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListPrincipalsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListPrincipalsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.ResourceOwner == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceOwner")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListPrincipalsInput) SetMaxResults(v int64) *ListPrincipalsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListPrincipalsInput) SetNextToken(v string) *ListPrincipalsInput { + s.NextToken = &v + return s +} + +// SetPrincipals sets the Principals field's value. +func (s *ListPrincipalsInput) SetPrincipals(v []*string) *ListPrincipalsInput { + s.Principals = v + return s +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *ListPrincipalsInput) SetResourceArn(v string) *ListPrincipalsInput { + s.ResourceArn = &v + return s +} + +// SetResourceOwner sets the ResourceOwner field's value. +func (s *ListPrincipalsInput) SetResourceOwner(v string) *ListPrincipalsInput { + s.ResourceOwner = &v + return s +} + +// SetResourceShareArns sets the ResourceShareArns field's value. +func (s *ListPrincipalsInput) SetResourceShareArns(v []*string) *ListPrincipalsInput { + s.ResourceShareArns = v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ListPrincipalsInput) SetResourceType(v string) *ListPrincipalsInput { + s.ResourceType = &v + return s +} + +type ListPrincipalsOutput 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 principals. + Principals []*Principal `locationName:"principals" type:"list"` +} + +// String returns the string representation +func (s ListPrincipalsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListPrincipalsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListPrincipalsOutput) SetNextToken(v string) *ListPrincipalsOutput { + s.NextToken = &v + return s +} + +// SetPrincipals sets the Principals field's value. +func (s *ListPrincipalsOutput) SetPrincipals(v []*Principal) *ListPrincipalsOutput { + s.Principals = v + return s +} + +type ListResourceSharePermissionsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // The token for the next page of results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The Amazon Resource Name (ARN) of the resource share. + // + // ResourceShareArn is a required field + ResourceShareArn *string `locationName:"resourceShareArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListResourceSharePermissionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourceSharePermissionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListResourceSharePermissionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListResourceSharePermissionsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.ResourceShareArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceShareArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListResourceSharePermissionsInput) SetMaxResults(v int64) *ListResourceSharePermissionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListResourceSharePermissionsInput) SetNextToken(v string) *ListResourceSharePermissionsInput { + s.NextToken = &v + return s +} + +// SetResourceShareArn sets the ResourceShareArn field's value. +func (s *ListResourceSharePermissionsInput) SetResourceShareArn(v string) *ListResourceSharePermissionsInput { + s.ResourceShareArn = &v + return s +} + +type ListResourceSharePermissionsOutput 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 permissions associated with the resource share. + Permissions []*ResourceSharePermissionSummary `locationName:"permissions" type:"list"` +} + +// String returns the string representation +func (s ListResourceSharePermissionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourceSharePermissionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListResourceSharePermissionsOutput) SetNextToken(v string) *ListResourceSharePermissionsOutput { + s.NextToken = &v + return s +} + +// SetPermissions sets the Permissions field's value. +func (s *ListResourceSharePermissionsOutput) SetPermissions(v []*ResourceSharePermissionSummary) *ListResourceSharePermissionsOutput { + s.Permissions = v + return s +} + +type ListResourcesInput struct { + _ struct{} `type:"structure"` + + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int64 `locationName:"maxResults" min:"1" type:"integer"` + + // The token for the next page of results. + NextToken *string `locationName:"nextToken" type:"string"` + + // The principal. + Principal *string `locationName:"principal" type:"string"` + + // The Amazon Resource Names (ARN) of the resources. + ResourceArns []*string `locationName:"resourceArns" type:"list"` + + // The type of owner. + // + // ResourceOwner is a required field + ResourceOwner *string `locationName:"resourceOwner" type:"string" required:"true" enum:"ResourceOwner"` + + // The Amazon Resource Names (ARN) of the resource shares. + ResourceShareArns []*string `locationName:"resourceShareArns" type:"list"` + + // The resource type. + // + // Valid values: ec2:CapacityReservation | ec2:Subnet | ec2:TrafficMirrorTarget + // | ec2:TransitGateway | license-manager:LicenseConfiguration | rds:Cluster + // | route53resolver:ResolverRule | resource-groups:Group + ResourceType *string `locationName:"resourceType" type:"string"` +} + +// String returns the string representation +func (s ListResourcesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourcesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListResourcesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListResourcesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.ResourceOwner == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceOwner")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListResourcesInput) SetMaxResults(v int64) *ListResourcesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListResourcesInput) SetNextToken(v string) *ListResourcesInput { + s.NextToken = &v + return s +} + +// SetPrincipal sets the Principal field's value. +func (s *ListResourcesInput) SetPrincipal(v string) *ListResourcesInput { + s.Principal = &v + return s +} + +// SetResourceArns sets the ResourceArns field's value. +func (s *ListResourcesInput) SetResourceArns(v []*string) *ListResourcesInput { + s.ResourceArns = v + return s +} + +// SetResourceOwner sets the ResourceOwner field's value. +func (s *ListResourcesInput) SetResourceOwner(v string) *ListResourcesInput { + s.ResourceOwner = &v + return s +} + +// SetResourceShareArns sets the ResourceShareArns field's value. +func (s *ListResourcesInput) SetResourceShareArns(v []*string) *ListResourcesInput { + s.ResourceShareArns = v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *ListResourcesInput) SetResourceType(v string) *ListResourcesInput { + s.ResourceType = &v + return s +} + +type ListResourcesOutput 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 resources. + Resources []*Resource `locationName:"resources" type:"list"` +} + +// String returns the string representation +func (s ListResourcesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourcesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListResourcesOutput) SetNextToken(v string) *ListResourcesOutput { + s.NextToken = &v + return s +} + +// SetResources sets the Resources field's value. +func (s *ListResourcesOutput) SetResources(v []*Resource) *ListResourcesOutput { + s.Resources = v + return s +} + +// The format of an Amazon Resource Name (ARN) is not valid. +type MalformedArnException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s MalformedArnException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MalformedArnException) GoString() string { + return s.String() +} + +func newErrorMalformedArnException(v protocol.ResponseMetadata) error { + return &MalformedArnException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MalformedArnException) Code() string { + return "MalformedArnException" +} + +// Message returns the exception's message. +func (s MalformedArnException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MalformedArnException) OrigErr() error { + return nil +} + +func (s MalformedArnException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MalformedArnException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MalformedArnException) RequestID() string { + return s.respMetadata.RequestID +} + +// A required input parameter is missing. +type MissingRequiredParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s MissingRequiredParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MissingRequiredParameterException) GoString() string { + return s.String() +} + +func newErrorMissingRequiredParameterException(v protocol.ResponseMetadata) error { + return &MissingRequiredParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MissingRequiredParameterException) Code() string { + return "MissingRequiredParameterException" +} + +// Message returns the exception's message. +func (s MissingRequiredParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MissingRequiredParameterException) OrigErr() error { + return nil +} + +func (s MissingRequiredParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MissingRequiredParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MissingRequiredParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested operation is not permitted. +type OperationNotPermittedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s OperationNotPermittedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OperationNotPermittedException) GoString() string { + return s.String() +} + +func newErrorOperationNotPermittedException(v protocol.ResponseMetadata) error { + return &OperationNotPermittedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OperationNotPermittedException) Code() string { + return "OperationNotPermittedException" +} + +// Message returns the exception's message. +func (s OperationNotPermittedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OperationNotPermittedException) OrigErr() error { + return nil +} + +func (s OperationNotPermittedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OperationNotPermittedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OperationNotPermittedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Describes a principal for use with AWS Resource Access Manager. +type Principal struct { + _ struct{} `type:"structure"` + + // The time when the principal was associated with the resource share. + CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` + + // Indicates whether the principal belongs to the same AWS organization as the + // AWS account that owns the resource share. + External *bool `locationName:"external" type:"boolean"` + + // The ID of the principal. + Id *string `locationName:"id" type:"string"` + + // The time when the association was last updated. + LastUpdatedTime *time.Time `locationName:"lastUpdatedTime" type:"timestamp"` + + // The Amazon Resource Name (ARN) of the resource share. + ResourceShareArn *string `locationName:"resourceShareArn" type:"string"` +} + +// String returns the string representation +func (s Principal) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Principal) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *Principal) SetCreationTime(v time.Time) *Principal { + s.CreationTime = &v + return s +} + +// SetExternal sets the External field's value. +func (s *Principal) SetExternal(v bool) *Principal { + s.External = &v + return s +} + +// SetId sets the Id field's value. +func (s *Principal) SetId(v string) *Principal { + s.Id = &v + return s +} + +// SetLastUpdatedTime sets the LastUpdatedTime field's value. +func (s *Principal) SetLastUpdatedTime(v time.Time) *Principal { + s.LastUpdatedTime = &v + return s +} + +// SetResourceShareArn sets the ResourceShareArn field's value. +func (s *Principal) SetResourceShareArn(v string) *Principal { + s.ResourceShareArn = &v + return s +} + +type PromoteResourceShareCreatedFromPolicyInput struct { + _ struct{} `type:"structure"` + + // The ARN of the resource share to promote. + // + // ResourceShareArn is a required field + ResourceShareArn *string `location:"querystring" locationName:"resourceShareArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s PromoteResourceShareCreatedFromPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PromoteResourceShareCreatedFromPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PromoteResourceShareCreatedFromPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PromoteResourceShareCreatedFromPolicyInput"} + if s.ResourceShareArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceShareArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceShareArn sets the ResourceShareArn field's value. +func (s *PromoteResourceShareCreatedFromPolicyInput) SetResourceShareArn(v string) *PromoteResourceShareCreatedFromPolicyInput { + s.ResourceShareArn = &v + return s +} + +type PromoteResourceShareCreatedFromPolicyOutput struct { + _ struct{} `type:"structure"` + + // Indicates whether the request succeeded. + ReturnValue *bool `locationName:"returnValue" type:"boolean"` +} + +// String returns the string representation +func (s PromoteResourceShareCreatedFromPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PromoteResourceShareCreatedFromPolicyOutput) GoString() string { + return s.String() +} + +// SetReturnValue sets the ReturnValue field's value. +func (s *PromoteResourceShareCreatedFromPolicyOutput) SetReturnValue(v bool) *PromoteResourceShareCreatedFromPolicyOutput { + s.ReturnValue = &v + return s +} + +type RejectResourceShareInvitationInput struct { + _ struct{} `type:"structure"` + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string `locationName:"clientToken" type:"string"` + + // The Amazon Resource Name (ARN) of the invitation. + // + // ResourceShareInvitationArn is a required field + ResourceShareInvitationArn *string `locationName:"resourceShareInvitationArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s RejectResourceShareInvitationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RejectResourceShareInvitationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RejectResourceShareInvitationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RejectResourceShareInvitationInput"} + if s.ResourceShareInvitationArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceShareInvitationArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientToken sets the ClientToken field's value. +func (s *RejectResourceShareInvitationInput) SetClientToken(v string) *RejectResourceShareInvitationInput { + s.ClientToken = &v + return s +} + +// SetResourceShareInvitationArn sets the ResourceShareInvitationArn field's value. +func (s *RejectResourceShareInvitationInput) SetResourceShareInvitationArn(v string) *RejectResourceShareInvitationInput { + s.ResourceShareInvitationArn = &v + return s +} + +type RejectResourceShareInvitationOutput struct { + _ struct{} `type:"structure"` + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + ClientToken *string `locationName:"clientToken" type:"string"` + + // Information about the invitation. + ResourceShareInvitation *ResourceShareInvitation `locationName:"resourceShareInvitation" type:"structure"` +} + +// String returns the string representation +func (s RejectResourceShareInvitationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RejectResourceShareInvitationOutput) GoString() string { + return s.String() +} + +// SetClientToken sets the ClientToken field's value. +func (s *RejectResourceShareInvitationOutput) SetClientToken(v string) *RejectResourceShareInvitationOutput { + s.ClientToken = &v + return s +} + +// SetResourceShareInvitation sets the ResourceShareInvitation field's value. +func (s *RejectResourceShareInvitationOutput) SetResourceShareInvitation(v *ResourceShareInvitation) *RejectResourceShareInvitationOutput { + s.ResourceShareInvitation = v + return s +} + +// Describes a resource associated with a resource share. +type Resource struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + Arn *string `locationName:"arn" type:"string"` + + // The time when the resource was associated with the resource share. + CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` + + // The time when the association was last updated. + LastUpdatedTime *time.Time `locationName:"lastUpdatedTime" type:"timestamp"` + + // The ARN of the resource group. This value is returned only if the resource + // is a resource group. + ResourceGroupArn *string `locationName:"resourceGroupArn" type:"string"` + + // The Amazon Resource Name (ARN) of the resource share. + ResourceShareArn *string `locationName:"resourceShareArn" type:"string"` + + // The status of the resource. + Status *string `locationName:"status" type:"string" enum:"ResourceStatus"` + + // A message about the status of the resource. + StatusMessage *string `locationName:"statusMessage" type:"string"` + + // The resource type. + 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() +} + +// SetArn sets the Arn field's value. +func (s *Resource) SetArn(v string) *Resource { + s.Arn = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *Resource) SetCreationTime(v time.Time) *Resource { + s.CreationTime = &v + return s +} + +// SetLastUpdatedTime sets the LastUpdatedTime field's value. +func (s *Resource) SetLastUpdatedTime(v time.Time) *Resource { + s.LastUpdatedTime = &v + return s +} + +// SetResourceGroupArn sets the ResourceGroupArn field's value. +func (s *Resource) SetResourceGroupArn(v string) *Resource { + s.ResourceGroupArn = &v + return s +} + +// SetResourceShareArn sets the ResourceShareArn field's value. +func (s *Resource) SetResourceShareArn(v string) *Resource { + s.ResourceShareArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *Resource) SetStatus(v string) *Resource { + s.Status = &v + return s +} + +// SetStatusMessage sets the StatusMessage field's value. +func (s *Resource) SetStatusMessage(v string) *Resource { + s.StatusMessage = &v + return s +} + +// SetType sets the Type field's value. +func (s *Resource) SetType(v string) *Resource { + s.Type = &v + return s +} + +// An Amazon Resource Name (ARN) was not found. +type ResourceArnNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceArnNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceArnNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceArnNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceArnNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceArnNotFoundException) Code() string { + return "ResourceArnNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceArnNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceArnNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceArnNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceArnNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceArnNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Describes a resource share. +type ResourceShare struct { + _ struct{} `type:"structure"` + + // Indicates whether principals outside your AWS organization can be associated + // with a resource share. + AllowExternalPrincipals *bool `locationName:"allowExternalPrincipals" type:"boolean"` + + // The time when the resource share was created. + CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` + + // Indicates how the resource share was created. Possible values include: + // + // * CREATED_FROM_POLICY - Indicates that the resource share was created + // from an AWS Identity and Access Management (AWS IAM) policy attached to + // a resource. These resource shares are visible only to the AWS account + // that created it. They cannot be modified in AWS RAM. + // + // * PROMOTING_TO_STANDARD - The resource share is in the process of being + // promoted. For more information, see PromoteResourceShareCreatedFromPolicy. + // + // * STANDARD - Indicates that the resource share was created in AWS RAM + // using the console or APIs. These resource shares are visible to all principals. + // They can be modified in AWS RAM. + FeatureSet *string `locationName:"featureSet" type:"string" enum:"ResourceShareFeatureSet"` + + // The time when the resource share was last updated. + LastUpdatedTime *time.Time `locationName:"lastUpdatedTime" type:"timestamp"` + + // The name of the resource share. + Name *string `locationName:"name" type:"string"` + + // The ID of the AWS account that owns the resource share. + OwningAccountId *string `locationName:"owningAccountId" type:"string"` + + // The Amazon Resource Name (ARN) of the resource share. + ResourceShareArn *string `locationName:"resourceShareArn" type:"string"` + + // The status of the resource share. + Status *string `locationName:"status" type:"string" enum:"ResourceShareStatus"` + + // A message about the status of the resource share. + StatusMessage *string `locationName:"statusMessage" type:"string"` + + // The tags for the resource share. + Tags []*Tag `locationName:"tags" type:"list"` +} + +// String returns the string representation +func (s ResourceShare) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceShare) GoString() string { + return s.String() +} + +// SetAllowExternalPrincipals sets the AllowExternalPrincipals field's value. +func (s *ResourceShare) SetAllowExternalPrincipals(v bool) *ResourceShare { + s.AllowExternalPrincipals = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *ResourceShare) SetCreationTime(v time.Time) *ResourceShare { + s.CreationTime = &v + return s +} + +// SetFeatureSet sets the FeatureSet field's value. +func (s *ResourceShare) SetFeatureSet(v string) *ResourceShare { + s.FeatureSet = &v + return s +} + +// SetLastUpdatedTime sets the LastUpdatedTime field's value. +func (s *ResourceShare) SetLastUpdatedTime(v time.Time) *ResourceShare { + s.LastUpdatedTime = &v + return s +} + +// SetName sets the Name field's value. +func (s *ResourceShare) SetName(v string) *ResourceShare { + s.Name = &v + return s +} + +// SetOwningAccountId sets the OwningAccountId field's value. +func (s *ResourceShare) SetOwningAccountId(v string) *ResourceShare { + s.OwningAccountId = &v + return s +} + +// SetResourceShareArn sets the ResourceShareArn field's value. +func (s *ResourceShare) SetResourceShareArn(v string) *ResourceShare { + s.ResourceShareArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ResourceShare) SetStatus(v string) *ResourceShare { + s.Status = &v + return s +} + +// SetStatusMessage sets the StatusMessage field's value. +func (s *ResourceShare) SetStatusMessage(v string) *ResourceShare { + s.StatusMessage = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *ResourceShare) SetTags(v []*Tag) *ResourceShare { + s.Tags = v + return s +} + +// Describes an association with a resource share. +type ResourceShareAssociation struct { + _ struct{} `type:"structure"` + + // The associated entity. For resource associations, this is the ARN of the + // resource. For principal associations, this is the ID of an AWS account or + // the ARN of an OU or organization from AWS Organizations. + AssociatedEntity *string `locationName:"associatedEntity" type:"string"` + + // The association type. + AssociationType *string `locationName:"associationType" type:"string" enum:"ResourceShareAssociationType"` + + // The time when the association was created. + CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` + + // Indicates whether the principal belongs to the same AWS organization as the + // AWS account that owns the resource share. + External *bool `locationName:"external" type:"boolean"` + + // The time when the association was last updated. + LastUpdatedTime *time.Time `locationName:"lastUpdatedTime" type:"timestamp"` + + // The Amazon Resource Name (ARN) of the resource share. + ResourceShareArn *string `locationName:"resourceShareArn" type:"string"` + + // The name of the resource share. + ResourceShareName *string `locationName:"resourceShareName" type:"string"` + + // The status of the association. + Status *string `locationName:"status" type:"string" enum:"ResourceShareAssociationStatus"` + + // A message about the status of the association. + StatusMessage *string `locationName:"statusMessage" type:"string"` +} + +// String returns the string representation +func (s ResourceShareAssociation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceShareAssociation) GoString() string { + return s.String() +} + +// SetAssociatedEntity sets the AssociatedEntity field's value. +func (s *ResourceShareAssociation) SetAssociatedEntity(v string) *ResourceShareAssociation { + s.AssociatedEntity = &v + return s +} + +// SetAssociationType sets the AssociationType field's value. +func (s *ResourceShareAssociation) SetAssociationType(v string) *ResourceShareAssociation { + s.AssociationType = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *ResourceShareAssociation) SetCreationTime(v time.Time) *ResourceShareAssociation { + s.CreationTime = &v + return s +} + +// SetExternal sets the External field's value. +func (s *ResourceShareAssociation) SetExternal(v bool) *ResourceShareAssociation { + s.External = &v + return s +} + +// SetLastUpdatedTime sets the LastUpdatedTime field's value. +func (s *ResourceShareAssociation) SetLastUpdatedTime(v time.Time) *ResourceShareAssociation { + s.LastUpdatedTime = &v + return s +} + +// SetResourceShareArn sets the ResourceShareArn field's value. +func (s *ResourceShareAssociation) SetResourceShareArn(v string) *ResourceShareAssociation { + s.ResourceShareArn = &v + return s +} + +// SetResourceShareName sets the ResourceShareName field's value. +func (s *ResourceShareAssociation) SetResourceShareName(v string) *ResourceShareAssociation { + s.ResourceShareName = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ResourceShareAssociation) SetStatus(v string) *ResourceShareAssociation { + s.Status = &v + return s +} + +// SetStatusMessage sets the StatusMessage field's value. +func (s *ResourceShareAssociation) SetStatusMessage(v string) *ResourceShareAssociation { + s.StatusMessage = &v + return s +} + +// Describes an invitation to join a resource share. +type ResourceShareInvitation struct { + _ struct{} `type:"structure"` + + // The date and time when the invitation was sent. + InvitationTimestamp *time.Time `locationName:"invitationTimestamp" type:"timestamp"` + + // The ID of the AWS account that received the invitation. + ReceiverAccountId *string `locationName:"receiverAccountId" type:"string"` + + // The Amazon Resource Name (ARN) of the resource share. + ResourceShareArn *string `locationName:"resourceShareArn" type:"string"` + + // To view the resources associated with a pending resource share invitation, + // use ListPendingInvitationResources (https://docs.aws.amazon.com/ram/latest/APIReference/API_ListPendingInvitationResources.html). + // + // Deprecated: This member has been deprecated. Use ListPendingInvitationResources. + ResourceShareAssociations []*ResourceShareAssociation `locationName:"resourceShareAssociations" deprecated:"true" type:"list"` + + // The Amazon Resource Name (ARN) of the invitation. + ResourceShareInvitationArn *string `locationName:"resourceShareInvitationArn" type:"string"` + + // The name of the resource share. + ResourceShareName *string `locationName:"resourceShareName" type:"string"` + + // The ID of the AWS account that sent the invitation. + SenderAccountId *string `locationName:"senderAccountId" type:"string"` + + // The status of the invitation. + Status *string `locationName:"status" type:"string" enum:"ResourceShareInvitationStatus"` +} + +// String returns the string representation +func (s ResourceShareInvitation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceShareInvitation) GoString() string { + return s.String() +} + +// SetInvitationTimestamp sets the InvitationTimestamp field's value. +func (s *ResourceShareInvitation) SetInvitationTimestamp(v time.Time) *ResourceShareInvitation { + s.InvitationTimestamp = &v + return s +} + +// SetReceiverAccountId sets the ReceiverAccountId field's value. +func (s *ResourceShareInvitation) SetReceiverAccountId(v string) *ResourceShareInvitation { + s.ReceiverAccountId = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListResourcesInput) SetNextToken(v string) *ListResourcesInput { - s.NextToken = &v +// SetResourceShareArn sets the ResourceShareArn field's value. +func (s *ResourceShareInvitation) SetResourceShareArn(v string) *ResourceShareInvitation { + s.ResourceShareArn = &v return s } -// SetPrincipal sets the Principal field's value. -func (s *ListResourcesInput) SetPrincipal(v string) *ListResourcesInput { - s.Principal = &v +// SetResourceShareAssociations sets the ResourceShareAssociations field's value. +func (s *ResourceShareInvitation) SetResourceShareAssociations(v []*ResourceShareAssociation) *ResourceShareInvitation { + s.ResourceShareAssociations = v return s } -// SetResourceArns sets the ResourceArns field's value. -func (s *ListResourcesInput) SetResourceArns(v []*string) *ListResourcesInput { - s.ResourceArns = v +// SetResourceShareInvitationArn sets the ResourceShareInvitationArn field's value. +func (s *ResourceShareInvitation) SetResourceShareInvitationArn(v string) *ResourceShareInvitation { + s.ResourceShareInvitationArn = &v return s } -// SetResourceOwner sets the ResourceOwner field's value. -func (s *ListResourcesInput) SetResourceOwner(v string) *ListResourcesInput { - s.ResourceOwner = &v +// SetResourceShareName sets the ResourceShareName field's value. +func (s *ResourceShareInvitation) SetResourceShareName(v string) *ResourceShareInvitation { + s.ResourceShareName = &v return s } -// SetResourceShareArns sets the ResourceShareArns field's value. -func (s *ListResourcesInput) SetResourceShareArns(v []*string) *ListResourcesInput { - s.ResourceShareArns = v +// SetSenderAccountId sets the SenderAccountId field's value. +func (s *ResourceShareInvitation) SetSenderAccountId(v string) *ResourceShareInvitation { + s.SenderAccountId = &v return s } -// SetResourceType sets the ResourceType field's value. -func (s *ListResourcesInput) SetResourceType(v string) *ListResourcesInput { - s.ResourceType = &v +// SetStatus sets the Status field's value. +func (s *ResourceShareInvitation) SetStatus(v string) *ResourceShareInvitation { + s.Status = &v return s } -type ListResourcesOutput 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 invitation was already accepted. +type ResourceShareInvitationAlreadyAcceptedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Information about the resources. - Resources []*Resource `locationName:"resources" type:"list"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListResourcesOutput) String() string { +func (s ResourceShareInvitationAlreadyAcceptedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListResourcesOutput) GoString() string { +func (s ResourceShareInvitationAlreadyAcceptedException) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListResourcesOutput) SetNextToken(v string) *ListResourcesOutput { - s.NextToken = &v - return s +func newErrorResourceShareInvitationAlreadyAcceptedException(v protocol.ResponseMetadata) error { + return &ResourceShareInvitationAlreadyAcceptedException{ + respMetadata: v, + } } -// SetResources sets the Resources field's value. -func (s *ListResourcesOutput) SetResources(v []*Resource) *ListResourcesOutput { - s.Resources = v - return s +// Code returns the exception type name. +func (s ResourceShareInvitationAlreadyAcceptedException) Code() string { + return "ResourceShareInvitationAlreadyAcceptedException" } -// Describes a principal for use with AWS Resource Access Manager. -type Principal struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s ResourceShareInvitationAlreadyAcceptedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The time when the principal was associated with the resource share. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceShareInvitationAlreadyAcceptedException) OrigErr() error { + return nil +} - // Indicates whether the principal belongs to the same AWS organization as the - // AWS account that owns the resource share. - External *bool `locationName:"external" type:"boolean"` +func (s ResourceShareInvitationAlreadyAcceptedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The ID of the principal. - Id *string `locationName:"id" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s ResourceShareInvitationAlreadyAcceptedException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The time when the association was last updated. - LastUpdatedTime *time.Time `locationName:"lastUpdatedTime" type:"timestamp"` +// RequestID returns the service's response RequestID for request. +func (s ResourceShareInvitationAlreadyAcceptedException) RequestID() string { + return s.respMetadata.RequestID +} - // The Amazon Resource Name (ARN) of the resource share. - ResourceShareArn *string `locationName:"resourceShareArn" type:"string"` +// The invitation was already rejected. +type ResourceShareInvitationAlreadyRejectedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s Principal) String() string { +func (s ResourceShareInvitationAlreadyRejectedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Principal) GoString() string { +func (s ResourceShareInvitationAlreadyRejectedException) GoString() string { return s.String() } -// SetCreationTime sets the CreationTime field's value. -func (s *Principal) SetCreationTime(v time.Time) *Principal { - s.CreationTime = &v - return s +func newErrorResourceShareInvitationAlreadyRejectedException(v protocol.ResponseMetadata) error { + return &ResourceShareInvitationAlreadyRejectedException{ + respMetadata: v, + } } -// SetExternal sets the External field's value. -func (s *Principal) SetExternal(v bool) *Principal { - s.External = &v - return s +// Code returns the exception type name. +func (s ResourceShareInvitationAlreadyRejectedException) Code() string { + return "ResourceShareInvitationAlreadyRejectedException" } -// SetId sets the Id field's value. -func (s *Principal) SetId(v string) *Principal { - s.Id = &v - return s +// Message returns the exception's message. +func (s ResourceShareInvitationAlreadyRejectedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *Principal) SetLastUpdatedTime(v time.Time) *Principal { - s.LastUpdatedTime = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceShareInvitationAlreadyRejectedException) OrigErr() error { + return nil } -// SetResourceShareArn sets the ResourceShareArn field's value. -func (s *Principal) SetResourceShareArn(v string) *Principal { - s.ResourceShareArn = &v - return s +func (s ResourceShareInvitationAlreadyRejectedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -type RejectResourceShareInvitationInput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s ResourceShareInvitationAlreadyRejectedException) StatusCode() int { + return s.respMetadata.StatusCode +} - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s ResourceShareInvitationAlreadyRejectedException) RequestID() string { + return s.respMetadata.RequestID +} - // The Amazon Resource Name (ARN) of the invitation. - // - // ResourceShareInvitationArn is a required field - ResourceShareInvitationArn *string `locationName:"resourceShareInvitationArn" type:"string" required:"true"` +// The Amazon Resource Name (ARN) for an invitation was not found. +type ResourceShareInvitationArnNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s RejectResourceShareInvitationInput) String() string { +func (s ResourceShareInvitationArnNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RejectResourceShareInvitationInput) GoString() string { +func (s ResourceShareInvitationArnNotFoundException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *RejectResourceShareInvitationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RejectResourceShareInvitationInput"} - if s.ResourceShareInvitationArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceShareInvitationArn")) +func newErrorResourceShareInvitationArnNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceShareInvitationArnNotFoundException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s ResourceShareInvitationArnNotFoundException) Code() string { + return "ResourceShareInvitationArnNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceShareInvitationArnNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceShareInvitationArnNotFoundException) OrigErr() error { return nil } -// SetClientToken sets the ClientToken field's value. -func (s *RejectResourceShareInvitationInput) SetClientToken(v string) *RejectResourceShareInvitationInput { - s.ClientToken = &v - return s +func (s ResourceShareInvitationArnNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetResourceShareInvitationArn sets the ResourceShareInvitationArn field's value. -func (s *RejectResourceShareInvitationInput) SetResourceShareInvitationArn(v string) *RejectResourceShareInvitationInput { - s.ResourceShareInvitationArn = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ResourceShareInvitationArnNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode } -type RejectResourceShareInvitationOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s ResourceShareInvitationArnNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} - // A unique, case-sensitive identifier that you provide to ensure the idempotency - // of the request. - ClientToken *string `locationName:"clientToken" type:"string"` +// The invitation is expired. +type ResourceShareInvitationExpiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // Information about the invitation. - ResourceShareInvitation *ResourceShareInvitation `locationName:"resourceShareInvitation" type:"structure"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s RejectResourceShareInvitationOutput) String() string { +func (s ResourceShareInvitationExpiredException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RejectResourceShareInvitationOutput) GoString() string { +func (s ResourceShareInvitationExpiredException) GoString() string { return s.String() } -// SetClientToken sets the ClientToken field's value. -func (s *RejectResourceShareInvitationOutput) SetClientToken(v string) *RejectResourceShareInvitationOutput { - s.ClientToken = &v - return s +func newErrorResourceShareInvitationExpiredException(v protocol.ResponseMetadata) error { + return &ResourceShareInvitationExpiredException{ + respMetadata: v, + } } -// SetResourceShareInvitation sets the ResourceShareInvitation field's value. -func (s *RejectResourceShareInvitationOutput) SetResourceShareInvitation(v *ResourceShareInvitation) *RejectResourceShareInvitationOutput { - s.ResourceShareInvitation = v - return s +// Code returns the exception type name. +func (s ResourceShareInvitationExpiredException) Code() string { + return "ResourceShareInvitationExpiredException" } -// Describes a resource associated with a resource share. -type Resource struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource. - Arn *string `locationName:"arn" type:"string"` +// Message returns the exception's message. +func (s ResourceShareInvitationExpiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The time when the resource was associated with the resource share. - CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceShareInvitationExpiredException) OrigErr() error { + return nil +} - // The time when the association was last updated. - LastUpdatedTime *time.Time `locationName:"lastUpdatedTime" type:"timestamp"` +func (s ResourceShareInvitationExpiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The Amazon Resource Name (ARN) of the resource share. - ResourceShareArn *string `locationName:"resourceShareArn" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s ResourceShareInvitationExpiredException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The status of the resource. - Status *string `locationName:"status" type:"string" enum:"ResourceStatus"` +// RequestID returns the service's response RequestID for request. +func (s ResourceShareInvitationExpiredException) RequestID() string { + return s.respMetadata.RequestID +} - // A message about the status of the resource. - StatusMessage *string `locationName:"statusMessage" type:"string"` +// The requested resource share exceeds the limit for your account. +type ResourceShareLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The resource type. - Type *string `locationName:"type" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s Resource) String() string { +func (s ResourceShareLimitExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Resource) GoString() string { +func (s ResourceShareLimitExceededException) GoString() string { return s.String() } -// SetArn sets the Arn field's value. -func (s *Resource) SetArn(v string) *Resource { - s.Arn = &v - return s +func newErrorResourceShareLimitExceededException(v protocol.ResponseMetadata) error { + return &ResourceShareLimitExceededException{ + respMetadata: v, + } } -// SetCreationTime sets the CreationTime field's value. -func (s *Resource) SetCreationTime(v time.Time) *Resource { - s.CreationTime = &v - return s +// Code returns the exception type name. +func (s ResourceShareLimitExceededException) Code() string { + return "ResourceShareLimitExceededException" } -// SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *Resource) SetLastUpdatedTime(v time.Time) *Resource { - s.LastUpdatedTime = &v - return s +// Message returns the exception's message. +func (s ResourceShareLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetResourceShareArn sets the ResourceShareArn field's value. -func (s *Resource) SetResourceShareArn(v string) *Resource { - s.ResourceShareArn = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceShareLimitExceededException) OrigErr() error { + return nil } -// SetStatus sets the Status field's value. -func (s *Resource) SetStatus(v string) *Resource { - s.Status = &v - return s +func (s ResourceShareLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetStatusMessage sets the StatusMessage field's value. -func (s *Resource) SetStatusMessage(v string) *Resource { - s.StatusMessage = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ResourceShareLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetType sets the Type field's value. -func (s *Resource) SetType(v string) *Resource { - s.Type = &v - return s +// RequestID returns the service's response RequestID for request. +func (s ResourceShareLimitExceededException) RequestID() string { + return s.respMetadata.RequestID } -// Describes a resource share. -type ResourceShare struct { +// Information about an AWS RAM permission. +type ResourceSharePermissionDetail struct { _ struct{} `type:"structure"` - // Indicates whether principals outside your AWS organization can be associated - // with a resource share. - AllowExternalPrincipals *bool `locationName:"allowExternalPrincipals" type:"boolean"` + // The ARN of the permission. + Arn *string `locationName:"arn" type:"string"` - // The time when the resource share was created. + // The date and time when the permission was created. CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - // The time when the resource share was last updated. + // The identifier for the version of the permission that is set as the default + // version. + DefaultVersion *bool `locationName:"defaultVersion" type:"boolean"` + + // The date and time when the permission was last updated. LastUpdatedTime *time.Time `locationName:"lastUpdatedTime" type:"timestamp"` - // The name of the resource share. + // The name of the permission. Name *string `locationName:"name" type:"string"` - // The ID of the AWS account that owns the resource share. - OwningAccountId *string `locationName:"owningAccountId" type:"string"` - - // The Amazon Resource Name (ARN) of the resource share. - ResourceShareArn *string `locationName:"resourceShareArn" type:"string"` - - // The status of the resource share. - Status *string `locationName:"status" type:"string" enum:"ResourceShareStatus"` + // The permission's effect and actions in JSON format. The effect indicates + // whether the actions are allowed or denied. The actions list the API actions + // to which the principal is granted or denied access. + Permission *string `locationName:"permission" type:"string"` - // A message about the status of the resource share. - StatusMessage *string `locationName:"statusMessage" type:"string"` + // The resource type to which the permission applies. + ResourceType *string `locationName:"resourceType" type:"string"` - // The tags for the resource share. - Tags []*Tag `locationName:"tags" type:"list"` + // The identifier for the version of the permission. + Version *string `locationName:"version" type:"string"` } // String returns the string representation -func (s ResourceShare) String() string { +func (s ResourceSharePermissionDetail) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ResourceShare) GoString() string { +func (s ResourceSharePermissionDetail) GoString() string { return s.String() } -// SetAllowExternalPrincipals sets the AllowExternalPrincipals field's value. -func (s *ResourceShare) SetAllowExternalPrincipals(v bool) *ResourceShare { - s.AllowExternalPrincipals = &v +// SetArn sets the Arn field's value. +func (s *ResourceSharePermissionDetail) SetArn(v string) *ResourceSharePermissionDetail { + s.Arn = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *ResourceSharePermissionDetail) SetCreationTime(v time.Time) *ResourceSharePermissionDetail { + s.CreationTime = &v return s } -// SetCreationTime sets the CreationTime field's value. -func (s *ResourceShare) SetCreationTime(v time.Time) *ResourceShare { - s.CreationTime = &v +// SetDefaultVersion sets the DefaultVersion field's value. +func (s *ResourceSharePermissionDetail) SetDefaultVersion(v bool) *ResourceSharePermissionDetail { + s.DefaultVersion = &v return s } // SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *ResourceShare) SetLastUpdatedTime(v time.Time) *ResourceShare { +func (s *ResourceSharePermissionDetail) SetLastUpdatedTime(v time.Time) *ResourceSharePermissionDetail { s.LastUpdatedTime = &v return s } // SetName sets the Name field's value. -func (s *ResourceShare) SetName(v string) *ResourceShare { +func (s *ResourceSharePermissionDetail) SetName(v string) *ResourceSharePermissionDetail { s.Name = &v return s } -// SetOwningAccountId sets the OwningAccountId field's value. -func (s *ResourceShare) SetOwningAccountId(v string) *ResourceShare { - s.OwningAccountId = &v - return s -} - -// SetResourceShareArn sets the ResourceShareArn field's value. -func (s *ResourceShare) SetResourceShareArn(v string) *ResourceShare { - s.ResourceShareArn = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ResourceShare) SetStatus(v string) *ResourceShare { - s.Status = &v +// SetPermission sets the Permission field's value. +func (s *ResourceSharePermissionDetail) SetPermission(v string) *ResourceSharePermissionDetail { + s.Permission = &v return s } -// SetStatusMessage sets the StatusMessage field's value. -func (s *ResourceShare) SetStatusMessage(v string) *ResourceShare { - s.StatusMessage = &v +// SetResourceType sets the ResourceType field's value. +func (s *ResourceSharePermissionDetail) SetResourceType(v string) *ResourceSharePermissionDetail { + s.ResourceType = &v return s } -// SetTags sets the Tags field's value. -func (s *ResourceShare) SetTags(v []*Tag) *ResourceShare { - s.Tags = v +// SetVersion sets the Version field's value. +func (s *ResourceSharePermissionDetail) SetVersion(v string) *ResourceSharePermissionDetail { + s.Version = &v return s } -// Describes an association with a resource share. -type ResourceShareAssociation struct { +// Information about a permission that is associated with a resource share. +type ResourceSharePermissionSummary struct { _ struct{} `type:"structure"` - // The associated entity. For resource associations, this is the ARN of the - // resource. For principal associations, this is the ID of an AWS account or - // the ARN of an OU or organization from AWS Organizations. - AssociatedEntity *string `locationName:"associatedEntity" type:"string"` - - // The association type. - AssociationType *string `locationName:"associationType" type:"string" enum:"ResourceShareAssociationType"` + // The ARN of the permission. + Arn *string `locationName:"arn" type:"string"` - // The time when the association was created. + // The date and time when the permission was created. CreationTime *time.Time `locationName:"creationTime" type:"timestamp"` - // Indicates whether the principal belongs to the same AWS organization as the - // AWS account that owns the resource share. - External *bool `locationName:"external" type:"boolean"` + // The identifier for the version of the permission that is set as the default + // version. + DefaultVersion *bool `locationName:"defaultVersion" type:"boolean"` - // The time when the association was last updated. + // The date and time when the permission was last updated. LastUpdatedTime *time.Time `locationName:"lastUpdatedTime" type:"timestamp"` - // The Amazon Resource Name (ARN) of the resource share. - ResourceShareArn *string `locationName:"resourceShareArn" type:"string"` + // The name of the permission. + Name *string `locationName:"name" type:"string"` - // The name of the resource share. - ResourceShareName *string `locationName:"resourceShareName" type:"string"` + // The type of resource to which the permission applies. + ResourceType *string `locationName:"resourceType" type:"string"` - // The status of the association. - Status *string `locationName:"status" type:"string" enum:"ResourceShareAssociationStatus"` + // The current status of the permission. + Status *string `locationName:"status" type:"string"` - // A message about the status of the association. - StatusMessage *string `locationName:"statusMessage" type:"string"` + // The identifier for the version of the permission. + Version *string `locationName:"version" type:"string"` } // String returns the string representation -func (s ResourceShareAssociation) String() string { +func (s ResourceSharePermissionSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ResourceShareAssociation) GoString() string { +func (s ResourceSharePermissionSummary) GoString() string { return s.String() } -// SetAssociatedEntity sets the AssociatedEntity field's value. -func (s *ResourceShareAssociation) SetAssociatedEntity(v string) *ResourceShareAssociation { - s.AssociatedEntity = &v - return s -} - -// SetAssociationType sets the AssociationType field's value. -func (s *ResourceShareAssociation) SetAssociationType(v string) *ResourceShareAssociation { - s.AssociationType = &v +// SetArn sets the Arn field's value. +func (s *ResourceSharePermissionSummary) SetArn(v string) *ResourceSharePermissionSummary { + s.Arn = &v return s } // SetCreationTime sets the CreationTime field's value. -func (s *ResourceShareAssociation) SetCreationTime(v time.Time) *ResourceShareAssociation { +func (s *ResourceSharePermissionSummary) SetCreationTime(v time.Time) *ResourceSharePermissionSummary { s.CreationTime = &v return s } -// SetExternal sets the External field's value. -func (s *ResourceShareAssociation) SetExternal(v bool) *ResourceShareAssociation { - s.External = &v +// SetDefaultVersion sets the DefaultVersion field's value. +func (s *ResourceSharePermissionSummary) SetDefaultVersion(v bool) *ResourceSharePermissionSummary { + s.DefaultVersion = &v return s } // SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *ResourceShareAssociation) SetLastUpdatedTime(v time.Time) *ResourceShareAssociation { +func (s *ResourceSharePermissionSummary) SetLastUpdatedTime(v time.Time) *ResourceSharePermissionSummary { s.LastUpdatedTime = &v return s } -// SetResourceShareArn sets the ResourceShareArn field's value. -func (s *ResourceShareAssociation) SetResourceShareArn(v string) *ResourceShareAssociation { - s.ResourceShareArn = &v +// SetName sets the Name field's value. +func (s *ResourceSharePermissionSummary) SetName(v string) *ResourceSharePermissionSummary { + s.Name = &v return s } -// SetResourceShareName sets the ResourceShareName field's value. -func (s *ResourceShareAssociation) SetResourceShareName(v string) *ResourceShareAssociation { - s.ResourceShareName = &v +// SetResourceType sets the ResourceType field's value. +func (s *ResourceSharePermissionSummary) SetResourceType(v string) *ResourceSharePermissionSummary { + s.ResourceType = &v return s } // SetStatus sets the Status field's value. -func (s *ResourceShareAssociation) SetStatus(v string) *ResourceShareAssociation { +func (s *ResourceSharePermissionSummary) SetStatus(v string) *ResourceSharePermissionSummary { s.Status = &v return s } -// SetStatusMessage sets the StatusMessage field's value. -func (s *ResourceShareAssociation) SetStatusMessage(v string) *ResourceShareAssociation { - s.StatusMessage = &v +// SetVersion sets the Version field's value. +func (s *ResourceSharePermissionSummary) SetVersion(v string) *ResourceSharePermissionSummary { + s.Version = &v return s } -// Describes an invitation to join a resource share. -type ResourceShareInvitation struct { - _ struct{} `type:"structure"` +// The service could not respond to the request due to an internal problem. +type ServerInternalException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The date and time when the invitation was sent. - InvitationTimestamp *time.Time `locationName:"invitationTimestamp" type:"timestamp"` + Message_ *string `locationName:"message" type:"string"` +} - // The ID of the AWS account that received the invitation. - ReceiverAccountId *string `locationName:"receiverAccountId" type:"string"` +// String returns the string representation +func (s ServerInternalException) String() string { + return awsutil.Prettify(s) +} - // The Amazon Resource Name (ARN) of the resource share. - ResourceShareArn *string `locationName:"resourceShareArn" type:"string"` +// GoString returns the string representation +func (s ServerInternalException) GoString() string { + return s.String() +} - // To view the resources associated with a pending resource share invitation, - // use ListPendingInvitationResources (https://docs.aws.amazon.com/ram/latest/APIReference/API_ListPendingInvitationResources.html). - // - // Deprecated: This member has been deprecated. Use ListPendingInvitationResources. - ResourceShareAssociations []*ResourceShareAssociation `locationName:"resourceShareAssociations" deprecated:"true" type:"list"` +func newErrorServerInternalException(v protocol.ResponseMetadata) error { + return &ServerInternalException{ + respMetadata: v, + } +} - // The Amazon Resource Name (ARN) of the invitation. - ResourceShareInvitationArn *string `locationName:"resourceShareInvitationArn" type:"string"` +// Code returns the exception type name. +func (s ServerInternalException) Code() string { + return "ServerInternalException" +} - // The name of the resource share. - ResourceShareName *string `locationName:"resourceShareName" type:"string"` +// Message returns the exception's message. +func (s ServerInternalException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The ID of the AWS account that sent the invitation. - SenderAccountId *string `locationName:"senderAccountId" type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServerInternalException) OrigErr() error { + return nil +} - // The status of the invitation. - Status *string `locationName:"status" type:"string" enum:"ResourceShareInvitationStatus"` +func (s ServerInternalException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServerInternalException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServerInternalException) RequestID() string { + return s.respMetadata.RequestID +} + +// The service is not available. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ResourceShareInvitation) String() string { +func (s ServiceUnavailableException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ResourceShareInvitation) GoString() string { +func (s ServiceUnavailableException) GoString() string { return s.String() } -// SetInvitationTimestamp sets the InvitationTimestamp field's value. -func (s *ResourceShareInvitation) SetInvitationTimestamp(v time.Time) *ResourceShareInvitation { - s.InvitationTimestamp = &v - return s -} - -// SetReceiverAccountId sets the ReceiverAccountId field's value. -func (s *ResourceShareInvitation) SetReceiverAccountId(v string) *ResourceShareInvitation { - s.ReceiverAccountId = &v - return s +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } } -// SetResourceShareArn sets the ResourceShareArn field's value. -func (s *ResourceShareInvitation) SetResourceShareArn(v string) *ResourceShareInvitation { - s.ResourceShareArn = &v - return s +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" } -// SetResourceShareAssociations sets the ResourceShareAssociations field's value. -func (s *ResourceShareInvitation) SetResourceShareAssociations(v []*ResourceShareAssociation) *ResourceShareInvitation { - s.ResourceShareAssociations = v - return s +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetResourceShareInvitationArn sets the ResourceShareInvitationArn field's value. -func (s *ResourceShareInvitation) SetResourceShareInvitationArn(v string) *ResourceShareInvitation { - s.ResourceShareInvitationArn = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil } -// SetResourceShareName sets the ResourceShareName field's value. -func (s *ResourceShareInvitation) SetResourceShareName(v string) *ResourceShareInvitation { - s.ResourceShareName = &v - return s +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetSenderAccountId sets the SenderAccountId field's value. -func (s *ResourceShareInvitation) SetSenderAccountId(v string) *ResourceShareInvitation { - s.SenderAccountId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetStatus sets the Status field's value. -func (s *ResourceShareInvitation) SetStatus(v string) *ResourceShareInvitation { - s.Status = &v - return s +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID } // Information about a tag. @@ -4018,6 +6360,118 @@ func (s *TagFilter) SetTagValues(v []*string) *TagFilter { return s } +// The requested tags exceed the limit for your account. +type TagLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TagLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagLimitExceededException) GoString() string { + return s.String() +} + +func newErrorTagLimitExceededException(v protocol.ResponseMetadata) error { + return &TagLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagLimitExceededException) Code() string { + return "TagLimitExceededException" +} + +// Message returns the exception's message. +func (s TagLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagLimitExceededException) OrigErr() error { + return nil +} + +func (s TagLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified tag is a reserved word and cannot be used. +type TagPolicyViolationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TagPolicyViolationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagPolicyViolationException) GoString() string { + return s.String() +} + +func newErrorTagPolicyViolationException(v protocol.ResponseMetadata) error { + return &TagPolicyViolationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagPolicyViolationException) Code() string { + return "TagPolicyViolationException" +} + +// Message returns the exception's message. +func (s TagPolicyViolationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagPolicyViolationException) OrigErr() error { + return nil +} + +func (s TagPolicyViolationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagPolicyViolationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagPolicyViolationException) RequestID() string { + return s.respMetadata.RequestID +} + type TagResourceInput struct { _ struct{} `type:"structure"` @@ -4084,6 +6538,62 @@ func (s TagResourceOutput) GoString() string { return s.String() } +// A specified resource was not found. +type UnknownResourceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnknownResourceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnknownResourceException) GoString() string { + return s.String() +} + +func newErrorUnknownResourceException(v protocol.ResponseMetadata) error { + return &UnknownResourceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnknownResourceException) Code() string { + return "UnknownResourceException" +} + +// Message returns the exception's message. +func (s UnknownResourceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnknownResourceException) OrigErr() error { + return nil +} + +func (s UnknownResourceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnknownResourceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnknownResourceException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -4283,6 +6793,17 @@ const ( ResourceShareAssociationTypeResource = "RESOURCE" ) +const ( + // ResourceShareFeatureSetCreatedFromPolicy is a ResourceShareFeatureSet enum value + ResourceShareFeatureSetCreatedFromPolicy = "CREATED_FROM_POLICY" + + // ResourceShareFeatureSetPromotingToStandard is a ResourceShareFeatureSet enum value + ResourceShareFeatureSetPromotingToStandard = "PROMOTING_TO_STANDARD" + + // ResourceShareFeatureSetStandard is a ResourceShareFeatureSet enum value + ResourceShareFeatureSetStandard = "STANDARD" +) + const ( // ResourceShareInvitationStatusPending is a ResourceShareInvitationStatus enum value ResourceShareInvitationStatusPending = "PENDING" diff --git a/vendor/github.com/aws/aws-sdk-go/service/ram/errors.go b/vendor/github.com/aws/aws-sdk-go/service/ram/errors.go index 147a3a7d0bd..3fb7028fb16 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ram/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ram/errors.go @@ -2,6 +2,10 @@ package ram +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeIdempotentParameterMismatchException for service response error code @@ -132,3 +136,27 @@ const ( // A specified resource was not found. ErrCodeUnknownResourceException = "UnknownResourceException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "IdempotentParameterMismatchException": newErrorIdempotentParameterMismatchException, + "InvalidClientTokenException": newErrorInvalidClientTokenException, + "InvalidMaxResultsException": newErrorInvalidMaxResultsException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "InvalidParameterException": newErrorInvalidParameterException, + "InvalidResourceTypeException": newErrorInvalidResourceTypeException, + "InvalidStateTransitionException": newErrorInvalidStateTransitionException, + "MalformedArnException": newErrorMalformedArnException, + "MissingRequiredParameterException": newErrorMissingRequiredParameterException, + "OperationNotPermittedException": newErrorOperationNotPermittedException, + "ResourceArnNotFoundException": newErrorResourceArnNotFoundException, + "ResourceShareInvitationAlreadyAcceptedException": newErrorResourceShareInvitationAlreadyAcceptedException, + "ResourceShareInvitationAlreadyRejectedException": newErrorResourceShareInvitationAlreadyRejectedException, + "ResourceShareInvitationArnNotFoundException": newErrorResourceShareInvitationArnNotFoundException, + "ResourceShareInvitationExpiredException": newErrorResourceShareInvitationExpiredException, + "ResourceShareLimitExceededException": newErrorResourceShareLimitExceededException, + "ServerInternalException": newErrorServerInternalException, + "ServiceUnavailableException": newErrorServiceUnavailableException, + "TagLimitExceededException": newErrorTagLimitExceededException, + "TagPolicyViolationException": newErrorTagPolicyViolationException, + "UnknownResourceException": newErrorUnknownResourceException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/ram/service.go b/vendor/github.com/aws/aws-sdk-go/service/ram/service.go index e1e1dc6683e..42713b89801 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ram/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ram/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "RAM" // Name of service. EndpointsID = "ram" // ID to lookup a service endpoint with. - ServiceID = "RAM" // ServiceID is a unique identifer of a specific service. + ServiceID = "RAM" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the RAM client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a RAM client from just a session. // svc := ram.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := ram.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *RAM { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *RAM { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *RAM { svc := &RAM{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-01-04", }, @@ -71,7 +75,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index bbba1da65fa..b9c5f9c6beb 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/rds/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/rds/api.go @@ -534,8 +534,8 @@ func (c *RDS) AuthorizeDBSecurityGroupIngressRequest(input *AuthorizeDBSecurityG // The state of the DB security group doesn't allow deletion. // // * ErrCodeAuthorizationAlreadyExistsFault "AuthorizationAlreadyExists" -// The specified CIDRIP or Amazon EC2 security group is already authorized for -// the specified DB security group. +// The specified CIDR IP range or Amazon EC2 security group is already authorized +// for the specified DB security group. // // * ErrCodeAuthorizationQuotaExceededFault "AuthorizationQuotaExceeded" // The DB security group authorization quota has been reached. @@ -650,6 +650,89 @@ func (c *RDS) BacktrackDBClusterWithContext(ctx aws.Context, input *BacktrackDBC return out, req.Send() } +const opCancelExportTask = "CancelExportTask" + +// CancelExportTaskRequest generates a "aws/request.Request" representing the +// client's request for the CancelExportTask operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CancelExportTask for more information on using the CancelExportTask +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CancelExportTaskRequest method. +// req, resp := client.CancelExportTaskRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CancelExportTask +func (c *RDS) 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) + return +} + +// CancelExportTask API operation for Amazon Relational Database Service. +// +// Cancels an export task in progress that is exporting a snapshot to Amazon +// S3. Any data that has already been written to the S3 bucket isn't 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 Amazon Relational Database Service's +// API operation CancelExportTask for usage and error information. +// +// Returned Error Codes: +// * ErrCodeExportTaskNotFoundFault "ExportTaskNotFound" +// The export task doesn't exist. +// +// * ErrCodeInvalidExportTaskStateFault "InvalidExportTaskStateFault" +// You can't cancel an export task that has completed. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CancelExportTask +func (c *RDS) CancelExportTask(input *CancelExportTaskInput) (*CancelExportTaskOutput, error) { + req, out := c.CancelExportTaskRequest(input) + return out, req.Send() +} + +// CancelExportTaskWithContext is the same as CancelExportTask with the addition of +// the ability to pass a context and additional request options. +// +// See CancelExportTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) CancelExportTaskWithContext(ctx aws.Context, input *CancelExportTaskInput, opts ...request.Option) (*CancelExportTaskOutput, error) { + req, out := c.CancelExportTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCopyDBClusterParameterGroup = "CopyDBClusterParameterGroup" // CopyDBClusterParameterGroupRequest generates a "aws/request.Request" representing the @@ -808,7 +891,7 @@ func (c *RDS) CopyDBClusterSnapshotRequest(input *CopyDBClusterSnapshotInput) (r // Region. This is the same identifier for both the CopyDBClusterSnapshot // action that is called in the destination AWS Region, and the action contained // in the pre-signed URL. DestinationRegion - The name of the AWS Region -// that the DB cluster snapshot will be created in. SourceDBClusterSnapshotIdentifier +// that the DB cluster snapshot is to 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 AWS Region. For example, if you are copying an encrypted @@ -817,6 +900,11 @@ func (c *RDS) CopyDBClusterSnapshotRequest(input *CopyDBClusterSnapshotInput) (r // To learn how to generate a Signature Version 4 signed request, see Authenticating // Requests: Using Query Parameters (AWS Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) // and Signature Version 4 Signing Process (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). +// If you are using an AWS SDK tool or the AWS CLI, you can specify SourceRegion +// (or --source-region for the AWS CLI) instead of specifying PreSignedUrl +// manually. Specifying SourceRegion autogenerates a pre-signed URL that +// is a valid request for the operation that can be executed in the source +// AWS Region. // // * TargetDBClusterSnapshotIdentifier - The identifier for the new copy // of the DB cluster snapshot in the destination AWS Region. @@ -1024,7 +1112,7 @@ func (c *RDS) CopyDBSnapshotRequest(input *CopyDBSnapshotInput) (req *request.Re // AWS Region where you call the CopyDBSnapshot action is the destination AWS // Region for the DB snapshot copy. // -// For more information about copying snapshots, see Copying a DB Snapshot (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopyDBSnapshot.html) +// For more information about copying snapshots, see Copying a DB Snapshot (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html#USER_CopyDBSnapshot) // in the Amazon RDS User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1157,6 +1245,98 @@ func (c *RDS) CopyOptionGroupWithContext(ctx aws.Context, input *CopyOptionGroup return out, req.Send() } +const opCreateCustomAvailabilityZone = "CreateCustomAvailabilityZone" + +// CreateCustomAvailabilityZoneRequest generates a "aws/request.Request" representing the +// client's request for the CreateCustomAvailabilityZone operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateCustomAvailabilityZone for more information on using the CreateCustomAvailabilityZone +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateCustomAvailabilityZoneRequest method. +// req, resp := client.CreateCustomAvailabilityZoneRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateCustomAvailabilityZone +func (c *RDS) CreateCustomAvailabilityZoneRequest(input *CreateCustomAvailabilityZoneInput) (req *request.Request, output *CreateCustomAvailabilityZoneOutput) { + op := &request.Operation{ + Name: opCreateCustomAvailabilityZone, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateCustomAvailabilityZoneInput{} + } + + output = &CreateCustomAvailabilityZoneOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateCustomAvailabilityZone API operation for Amazon Relational Database Service. +// +// Creates a custom Availability Zone (AZ). +// +// A custom AZ is an on-premises AZ that is integrated with a VMware vSphere +// cluster. +// +// For more information about RDS on VMware, see the RDS on VMware User Guide. +// (https://docs.aws.amazon.com/AmazonRDS/latest/RDSonVMwareUserGuide/rds-on-vmware.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 CreateCustomAvailabilityZone for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCustomAvailabilityZoneAlreadyExistsFault "CustomAvailabilityZoneAlreadyExists" +// CustomAvailabilityZoneName is already used by an existing custom Availability +// Zone. +// +// * ErrCodeCustomAvailabilityZoneQuotaExceededFault "CustomAvailabilityZoneQuotaExceeded" +// You have exceeded the maximum number of custom Availability Zones. +// +// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" +// An error occurred accessing an AWS KMS key. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateCustomAvailabilityZone +func (c *RDS) CreateCustomAvailabilityZone(input *CreateCustomAvailabilityZoneInput) (*CreateCustomAvailabilityZoneOutput, error) { + req, out := c.CreateCustomAvailabilityZoneRequest(input) + return out, req.Send() +} + +// CreateCustomAvailabilityZoneWithContext is the same as CreateCustomAvailabilityZone with the addition of +// the ability to pass a context and additional request options. +// +// See CreateCustomAvailabilityZone for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) CreateCustomAvailabilityZoneWithContext(ctx aws.Context, input *CreateCustomAvailabilityZoneInput, opts ...request.Option) (*CreateCustomAvailabilityZoneOutput, error) { + req, out := c.CreateCustomAvailabilityZoneRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateDBCluster = "CreateDBCluster" // CreateDBClusterRequest generates a "aws/request.Request" representing the @@ -1712,11 +1892,11 @@ func (c *RDS) CreateDBInstanceRequest(input *CreateDBInstanceInput) (req *reques // Storage of the StorageType specified can't be associated with the DB instance. // // * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" -// The specified CIDRIP or Amazon EC2 security group isn't authorized for the -// specified DB security group. +// The specified CIDR IP range or Amazon EC2 security group might not be authorized +// for the specified DB security group. // -// RDS also may not be authorized by using IAM to perform necessary actions -// on your behalf. +// Or, RDS might not be authorized to perform necessary actions using IAM on +// your behalf. // // * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" // An error occurred accessing an AWS KMS key. @@ -2004,6 +2184,98 @@ func (c *RDS) CreateDBParameterGroupWithContext(ctx aws.Context, input *CreateDB return out, req.Send() } +const opCreateDBProxy = "CreateDBProxy" + +// CreateDBProxyRequest generates a "aws/request.Request" representing the +// client's request for the CreateDBProxy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateDBProxy for more information on using the CreateDBProxy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateDBProxyRequest method. +// req, resp := client.CreateDBProxyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBProxy +func (c *RDS) CreateDBProxyRequest(input *CreateDBProxyInput) (req *request.Request, output *CreateDBProxyOutput) { + op := &request.Operation{ + Name: opCreateDBProxy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateDBProxyInput{} + } + + output = &CreateDBProxyOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateDBProxy API operation for Amazon Relational Database Service. +// +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// Creates a new DB proxy. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 CreateDBProxy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInvalidSubnet "InvalidSubnet" +// The requested subnet is invalid, or multiple subnets were requested that +// are not all in a common VPC. +// +// * ErrCodeDBProxyAlreadyExistsFault "DBProxyTargetExistsFault" +// The specified proxy name must be unique for all proxies owned by your AWS +// account in the specified AWS Region. +// +// * ErrCodeDBProxyQuotaExceededFault "DBProxyQuotaExceededFault" +// Your AWS account already has the maximum number of proxies in the specified +// AWS Region. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/CreateDBProxy +func (c *RDS) CreateDBProxy(input *CreateDBProxyInput) (*CreateDBProxyOutput, error) { + req, out := c.CreateDBProxyRequest(input) + return out, req.Send() +} + +// CreateDBProxyWithContext is the same as CreateDBProxy with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDBProxy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) CreateDBProxyWithContext(ctx aws.Context, input *CreateDBProxyInput, opts ...request.Option) (*CreateDBProxyOutput, error) { + req, out := c.CreateDBProxyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateDBSecurityGroup = "CreateDBSecurityGroup" // CreateDBSecurityGroupRequest generates a "aws/request.Request" representing the @@ -2324,7 +2596,7 @@ func (c *RDS) CreateEventSubscriptionRequest(input *CreateEventSubscriptionInput // 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, +// Amazon Resource Name (ARN) 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. // @@ -2338,10 +2610,13 @@ func (c *RDS) CreateEventSubscriptionRequest(input *CreateEventSubscriptionInput // and SourceIdentifier = myDBInstance1, you are notified of all the db-instance // events for the specified source. If you specify a SourceType but do not specify // a SourceIdentifier, you 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 are notified of events generated from all RDS sources +// for all your RDS sources. If you don't specify either the SourceType or the +// SourceIdentifier, you are notified of events generated from all RDS sources // belonging to your customer account. // +// RDS event notification is only available for unencrypted SNS topics. If you +// specify an encrypted SNS topic, event notifications aren't sent for 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. @@ -2572,6 +2847,95 @@ func (c *RDS) CreateOptionGroupWithContext(ctx aws.Context, input *CreateOptionG return out, req.Send() } +const opDeleteCustomAvailabilityZone = "DeleteCustomAvailabilityZone" + +// DeleteCustomAvailabilityZoneRequest generates a "aws/request.Request" representing the +// client's request for the DeleteCustomAvailabilityZone operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteCustomAvailabilityZone for more information on using the DeleteCustomAvailabilityZone +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteCustomAvailabilityZoneRequest method. +// req, resp := client.DeleteCustomAvailabilityZoneRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteCustomAvailabilityZone +func (c *RDS) DeleteCustomAvailabilityZoneRequest(input *DeleteCustomAvailabilityZoneInput) (req *request.Request, output *DeleteCustomAvailabilityZoneOutput) { + op := &request.Operation{ + Name: opDeleteCustomAvailabilityZone, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteCustomAvailabilityZoneInput{} + } + + output = &DeleteCustomAvailabilityZoneOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteCustomAvailabilityZone API operation for Amazon Relational Database Service. +// +// Deletes a custom Availability Zone (AZ). +// +// A custom AZ is an on-premises AZ that is integrated with a VMware vSphere +// cluster. +// +// For more information about RDS on VMware, see the RDS on VMware User Guide. +// (https://docs.aws.amazon.com/AmazonRDS/latest/RDSonVMwareUserGuide/rds-on-vmware.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 DeleteCustomAvailabilityZone for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCustomAvailabilityZoneNotFoundFault "CustomAvailabilityZoneNotFound" +// CustomAvailabilityZoneId doesn't refer to an existing custom Availability +// Zone identifier. +// +// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" +// An error occurred accessing an AWS KMS key. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteCustomAvailabilityZone +func (c *RDS) DeleteCustomAvailabilityZone(input *DeleteCustomAvailabilityZoneInput) (*DeleteCustomAvailabilityZoneOutput, error) { + req, out := c.DeleteCustomAvailabilityZoneRequest(input) + return out, req.Send() +} + +// DeleteCustomAvailabilityZoneWithContext is the same as DeleteCustomAvailabilityZone with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteCustomAvailabilityZone for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) DeleteCustomAvailabilityZoneWithContext(ctx aws.Context, input *DeleteCustomAvailabilityZoneInput, opts ...request.Option) (*DeleteCustomAvailabilityZoneOutput, error) { + req, out := c.DeleteCustomAvailabilityZoneRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteDBCluster = "DeleteDBCluster" // DeleteDBClusterRequest generates a "aws/request.Request" representing the @@ -2994,9 +3358,9 @@ func (c *RDS) DeleteDBInstanceRequest(input *DeleteDBInstanceInput) (req *reques // is used to monitor the status of this operation. The action can't 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 -// you skip creation of the final snapshot with the SkipFinalSnapshot parameter. +// 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 you skip creation of +// the final snapshot with the SkipFinalSnapshot parameter. // // If the specified DB instance is part of an Amazon Aurora DB cluster, you // can't delete the DB instance if both of the following conditions are true: @@ -3230,6 +3594,93 @@ func (c *RDS) DeleteDBParameterGroupWithContext(ctx aws.Context, input *DeleteDB return out, req.Send() } +const opDeleteDBProxy = "DeleteDBProxy" + +// DeleteDBProxyRequest generates a "aws/request.Request" representing the +// client's request for the DeleteDBProxy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteDBProxy for more information on using the DeleteDBProxy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteDBProxyRequest method. +// req, resp := client.DeleteDBProxyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBProxy +func (c *RDS) DeleteDBProxyRequest(input *DeleteDBProxyInput) (req *request.Request, output *DeleteDBProxyOutput) { + op := &request.Operation{ + Name: opDeleteDBProxy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteDBProxyInput{} + } + + output = &DeleteDBProxyOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteDBProxy API operation for Amazon Relational Database Service. +// +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// Deletes an existing proxy. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 DeleteDBProxy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeDBProxyNotFoundFault "DBProxyNotFoundFault" +// The specified proxy name doesn't correspond to a proxy owned by your AWS +// accoutn in the specified AWS Region. +// +// * ErrCodeInvalidDBProxyStateFault "InvalidDBProxyStateFault" +// The requested operation can't be performed while the proxy is in this state. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteDBProxy +func (c *RDS) DeleteDBProxy(input *DeleteDBProxyInput) (*DeleteDBProxyOutput, error) { + req, out := c.DeleteDBProxyRequest(input) + return out, req.Send() +} + +// DeleteDBProxyWithContext is the same as DeleteDBProxy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteDBProxy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) DeleteDBProxyWithContext(ctx aws.Context, input *DeleteDBProxyInput, opts ...request.Option) (*DeleteDBProxyOutput, error) { + req, out := c.DeleteDBProxyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteDBSecurityGroup = "DeleteDBSecurityGroup" // DeleteDBSecurityGroupRequest generates a "aws/request.Request" representing the @@ -3654,6 +4105,86 @@ func (c *RDS) DeleteGlobalClusterWithContext(ctx aws.Context, input *DeleteGloba return out, req.Send() } +const opDeleteInstallationMedia = "DeleteInstallationMedia" + +// DeleteInstallationMediaRequest generates a "aws/request.Request" representing the +// client's request for the DeleteInstallationMedia operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteInstallationMedia for more information on using the DeleteInstallationMedia +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteInstallationMediaRequest method. +// req, resp := client.DeleteInstallationMediaRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteInstallationMedia +func (c *RDS) DeleteInstallationMediaRequest(input *DeleteInstallationMediaInput) (req *request.Request, output *DeleteInstallationMediaOutput) { + op := &request.Operation{ + Name: opDeleteInstallationMedia, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteInstallationMediaInput{} + } + + output = &DeleteInstallationMediaOutput{} + req = c.newRequest(op, input, output) + return +} + +// DeleteInstallationMedia API operation for Amazon Relational Database Service. +// +// Deletes the installation medium for a DB engine that requires an on-premises +// customer provided license, such as Microsoft SQL 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 Relational Database Service's +// API operation DeleteInstallationMedia for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInstallationMediaNotFoundFault "InstallationMediaNotFound" +// InstallationMediaID doesn't refer to an existing installation medium. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeleteInstallationMedia +func (c *RDS) DeleteInstallationMedia(input *DeleteInstallationMediaInput) (*DeleteInstallationMediaOutput, error) { + req, out := c.DeleteInstallationMediaRequest(input) + return out, req.Send() +} + +// DeleteInstallationMediaWithContext is the same as DeleteInstallationMedia with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteInstallationMedia for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) DeleteInstallationMediaWithContext(ctx aws.Context, input *DeleteInstallationMediaInput, opts ...request.Option) (*DeleteInstallationMediaOutput, error) { + req, out := c.DeleteInstallationMediaRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteOptionGroup = "DeleteOptionGroup" // DeleteOptionGroupRequest generates a "aws/request.Request" representing the @@ -3737,6 +4268,103 @@ func (c *RDS) DeleteOptionGroupWithContext(ctx aws.Context, input *DeleteOptionG return out, req.Send() } +const opDeregisterDBProxyTargets = "DeregisterDBProxyTargets" + +// DeregisterDBProxyTargetsRequest generates a "aws/request.Request" representing the +// client's request for the DeregisterDBProxyTargets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeregisterDBProxyTargets for more information on using the DeregisterDBProxyTargets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeregisterDBProxyTargetsRequest method. +// req, resp := client.DeregisterDBProxyTargetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeregisterDBProxyTargets +func (c *RDS) DeregisterDBProxyTargetsRequest(input *DeregisterDBProxyTargetsInput) (req *request.Request, output *DeregisterDBProxyTargetsOutput) { + op := &request.Operation{ + Name: opDeregisterDBProxyTargets, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeregisterDBProxyTargetsInput{} + } + + output = &DeregisterDBProxyTargetsOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeregisterDBProxyTargets API operation for Amazon Relational Database Service. +// +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// Remove the association between one or more DBProxyTarget data structures +// and a DBProxyTargetGroup. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 DeregisterDBProxyTargets for usage and error information. +// +// Returned Error Codes: +// * ErrCodeDBProxyTargetNotFoundFault "DBProxyTargetNotFoundFault" +// The specified RDS DB instance or Aurora DB cluster isn't available for a +// proxy owned by your AWS account in the specified AWS Region. +// +// * ErrCodeDBProxyTargetGroupNotFoundFault "DBProxyTargetGroupNotFoundFault" +// The specified target group isn't available for a proxy owned by your AWS +// account in the specified AWS Region. +// +// * ErrCodeDBProxyNotFoundFault "DBProxyNotFoundFault" +// The specified proxy name doesn't correspond to a proxy owned by your AWS +// accoutn in the specified AWS Region. +// +// * ErrCodeInvalidDBProxyStateFault "InvalidDBProxyStateFault" +// The requested operation can't be performed while the proxy is in this state. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DeregisterDBProxyTargets +func (c *RDS) DeregisterDBProxyTargets(input *DeregisterDBProxyTargetsInput) (*DeregisterDBProxyTargetsOutput, error) { + req, out := c.DeregisterDBProxyTargetsRequest(input) + return out, req.Send() +} + +// DeregisterDBProxyTargetsWithContext is the same as DeregisterDBProxyTargets with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterDBProxyTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) DeregisterDBProxyTargetsWithContext(ctx aws.Context, input *DeregisterDBProxyTargetsInput, opts ...request.Option) (*DeregisterDBProxyTargetsOutput, error) { + req, out := c.DeregisterDBProxyTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeAccountAttributes = "DescribeAccountAttributes" // DescribeAccountAttributesRequest generates a "aws/request.Request" representing the @@ -3895,6 +4523,150 @@ func (c *RDS) DescribeCertificatesWithContext(ctx aws.Context, input *DescribeCe return out, req.Send() } +const opDescribeCustomAvailabilityZones = "DescribeCustomAvailabilityZones" + +// DescribeCustomAvailabilityZonesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeCustomAvailabilityZones operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeCustomAvailabilityZones for more information on using the DescribeCustomAvailabilityZones +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeCustomAvailabilityZonesRequest method. +// req, resp := client.DescribeCustomAvailabilityZonesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeCustomAvailabilityZones +func (c *RDS) DescribeCustomAvailabilityZonesRequest(input *DescribeCustomAvailabilityZonesInput) (req *request.Request, output *DescribeCustomAvailabilityZonesOutput) { + op := &request.Operation{ + Name: opDescribeCustomAvailabilityZones, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeCustomAvailabilityZonesInput{} + } + + output = &DescribeCustomAvailabilityZonesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeCustomAvailabilityZones API operation for Amazon Relational Database Service. +// +// Returns information about custom Availability Zones (AZs). +// +// A custom AZ is an on-premises AZ that is integrated with a VMware vSphere +// cluster. +// +// For more information about RDS on VMware, see the RDS on VMware User Guide. +// (https://docs.aws.amazon.com/AmazonRDS/latest/RDSonVMwareUserGuide/rds-on-vmware.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 DescribeCustomAvailabilityZones for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCustomAvailabilityZoneNotFoundFault "CustomAvailabilityZoneNotFound" +// CustomAvailabilityZoneId doesn't refer to an existing custom Availability +// Zone identifier. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeCustomAvailabilityZones +func (c *RDS) DescribeCustomAvailabilityZones(input *DescribeCustomAvailabilityZonesInput) (*DescribeCustomAvailabilityZonesOutput, error) { + req, out := c.DescribeCustomAvailabilityZonesRequest(input) + return out, req.Send() +} + +// DescribeCustomAvailabilityZonesWithContext is the same as DescribeCustomAvailabilityZones with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeCustomAvailabilityZones for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) DescribeCustomAvailabilityZonesWithContext(ctx aws.Context, input *DescribeCustomAvailabilityZonesInput, opts ...request.Option) (*DescribeCustomAvailabilityZonesOutput, error) { + req, out := c.DescribeCustomAvailabilityZonesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeCustomAvailabilityZonesPages iterates over the pages of a DescribeCustomAvailabilityZones operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeCustomAvailabilityZones 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 DescribeCustomAvailabilityZones operation. +// pageNum := 0 +// err := client.DescribeCustomAvailabilityZonesPages(params, +// func(page *rds.DescribeCustomAvailabilityZonesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *RDS) DescribeCustomAvailabilityZonesPages(input *DescribeCustomAvailabilityZonesInput, fn func(*DescribeCustomAvailabilityZonesOutput, bool) bool) error { + return c.DescribeCustomAvailabilityZonesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeCustomAvailabilityZonesPagesWithContext same as DescribeCustomAvailabilityZonesPages 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 *RDS) DescribeCustomAvailabilityZonesPagesWithContext(ctx aws.Context, input *DescribeCustomAvailabilityZonesInput, fn func(*DescribeCustomAvailabilityZonesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeCustomAvailabilityZonesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeCustomAvailabilityZonesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeCustomAvailabilityZonesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opDescribeDBClusterBacktracks = "DescribeDBClusterBacktracks" // DescribeDBClusterBacktracksRequest generates a "aws/request.Request" representing the @@ -4467,7 +5239,8 @@ func (c *RDS) DescribeDBClustersRequest(input *DescribeDBClustersInput) (req *re // For more information on Amazon Aurora, see What Is Amazon Aurora? (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. // -// This action only applies to Aurora DB clusters. +// This operation can also return information for Amazon Neptune DB instances +// and Amazon DocumentDB 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 @@ -4545,10 +5318,12 @@ func (c *RDS) DescribeDBClustersPagesWithContext(ctx aws.Context, input *Describ }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBClustersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBClustersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4675,10 +5450,12 @@ func (c *RDS) DescribeDBEngineVersionsPagesWithContext(ctx aws.Context, input *D }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBEngineVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBEngineVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4816,10 +5593,12 @@ func (c *RDS) DescribeDBInstanceAutomatedBackupsPagesWithContext(ctx aws.Context }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBInstanceAutomatedBackupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBInstanceAutomatedBackupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4875,6 +5654,9 @@ func (c *RDS) DescribeDBInstancesRequest(input *DescribeDBInstancesInput) (req * // // Returns information about provisioned RDS instances. This API supports pagination. // +// This operation can also return information for Amazon Neptune DB instances +// and Amazon DocumentDB 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. @@ -4951,10 +5733,12 @@ func (c *RDS) DescribeDBInstancesPagesWithContext(ctx aws.Context, input *Descri }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBInstancesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBInstancesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5086,10 +5870,12 @@ func (c *RDS) DescribeDBLogFilesPagesWithContext(ctx aws.Context, input *Describ }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBLogFilesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBLogFilesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5223,10 +6009,12 @@ func (c *RDS) DescribeDBParameterGroupsPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBParameterGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBParameterGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5358,10 +6146,457 @@ func (c *RDS) DescribeDBParametersPagesWithContext(ctx aws.Context, input *Descr }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBParametersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBParametersOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeDBProxies = "DescribeDBProxies" + +// DescribeDBProxiesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeDBProxies operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeDBProxies for more information on using the DescribeDBProxies +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeDBProxiesRequest method. +// req, resp := client.DescribeDBProxiesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBProxies +func (c *RDS) DescribeDBProxiesRequest(input *DescribeDBProxiesInput) (req *request.Request, output *DescribeDBProxiesOutput) { + op := &request.Operation{ + Name: opDescribeDBProxies, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeDBProxiesInput{} + } + + output = &DescribeDBProxiesOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeDBProxies API operation for Amazon Relational Database Service. +// +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// Returns information about DB proxies. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 DescribeDBProxies for usage and error information. +// +// Returned Error Codes: +// * ErrCodeDBProxyNotFoundFault "DBProxyNotFoundFault" +// The specified proxy name doesn't correspond to a proxy owned by your AWS +// accoutn in the specified AWS Region. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBProxies +func (c *RDS) DescribeDBProxies(input *DescribeDBProxiesInput) (*DescribeDBProxiesOutput, error) { + req, out := c.DescribeDBProxiesRequest(input) + return out, req.Send() +} + +// DescribeDBProxiesWithContext is the same as DescribeDBProxies with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBProxies for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) DescribeDBProxiesWithContext(ctx aws.Context, input *DescribeDBProxiesInput, opts ...request.Option) (*DescribeDBProxiesOutput, error) { + req, out := c.DescribeDBProxiesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeDBProxiesPages iterates over the pages of a DescribeDBProxies operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeDBProxies 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 DescribeDBProxies operation. +// pageNum := 0 +// err := client.DescribeDBProxiesPages(params, +// func(page *rds.DescribeDBProxiesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *RDS) DescribeDBProxiesPages(input *DescribeDBProxiesInput, fn func(*DescribeDBProxiesOutput, bool) bool) error { + return c.DescribeDBProxiesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeDBProxiesPagesWithContext same as DescribeDBProxiesPages 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 *RDS) DescribeDBProxiesPagesWithContext(ctx aws.Context, input *DescribeDBProxiesInput, fn func(*DescribeDBProxiesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeDBProxiesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDBProxiesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeDBProxiesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeDBProxyTargetGroups = "DescribeDBProxyTargetGroups" + +// DescribeDBProxyTargetGroupsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeDBProxyTargetGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeDBProxyTargetGroups for more information on using the DescribeDBProxyTargetGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeDBProxyTargetGroupsRequest method. +// req, resp := client.DescribeDBProxyTargetGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBProxyTargetGroups +func (c *RDS) DescribeDBProxyTargetGroupsRequest(input *DescribeDBProxyTargetGroupsInput) (req *request.Request, output *DescribeDBProxyTargetGroupsOutput) { + op := &request.Operation{ + Name: opDescribeDBProxyTargetGroups, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeDBProxyTargetGroupsInput{} + } + + output = &DescribeDBProxyTargetGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeDBProxyTargetGroups API operation for Amazon Relational Database Service. +// +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// Returns information about DB proxy target groups, represented by DBProxyTargetGroup +// data structures. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 DescribeDBProxyTargetGroups for usage and error information. +// +// Returned Error Codes: +// * ErrCodeDBProxyNotFoundFault "DBProxyNotFoundFault" +// The specified proxy name doesn't correspond to a proxy owned by your AWS +// accoutn in the specified AWS Region. +// +// * ErrCodeDBProxyTargetGroupNotFoundFault "DBProxyTargetGroupNotFoundFault" +// The specified target group isn't available for a proxy owned by your AWS +// account in the specified AWS Region. +// +// * ErrCodeInvalidDBProxyStateFault "InvalidDBProxyStateFault" +// The requested operation can't be performed while the proxy is in this state. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBProxyTargetGroups +func (c *RDS) DescribeDBProxyTargetGroups(input *DescribeDBProxyTargetGroupsInput) (*DescribeDBProxyTargetGroupsOutput, error) { + req, out := c.DescribeDBProxyTargetGroupsRequest(input) + return out, req.Send() +} + +// DescribeDBProxyTargetGroupsWithContext is the same as DescribeDBProxyTargetGroups with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBProxyTargetGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) DescribeDBProxyTargetGroupsWithContext(ctx aws.Context, input *DescribeDBProxyTargetGroupsInput, opts ...request.Option) (*DescribeDBProxyTargetGroupsOutput, error) { + req, out := c.DescribeDBProxyTargetGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeDBProxyTargetGroupsPages iterates over the pages of a DescribeDBProxyTargetGroups operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeDBProxyTargetGroups 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 DescribeDBProxyTargetGroups operation. +// pageNum := 0 +// err := client.DescribeDBProxyTargetGroupsPages(params, +// func(page *rds.DescribeDBProxyTargetGroupsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *RDS) DescribeDBProxyTargetGroupsPages(input *DescribeDBProxyTargetGroupsInput, fn func(*DescribeDBProxyTargetGroupsOutput, bool) bool) error { + return c.DescribeDBProxyTargetGroupsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeDBProxyTargetGroupsPagesWithContext same as DescribeDBProxyTargetGroupsPages 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 *RDS) DescribeDBProxyTargetGroupsPagesWithContext(ctx aws.Context, input *DescribeDBProxyTargetGroupsInput, fn func(*DescribeDBProxyTargetGroupsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeDBProxyTargetGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDBProxyTargetGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeDBProxyTargetGroupsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeDBProxyTargets = "DescribeDBProxyTargets" + +// DescribeDBProxyTargetsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeDBProxyTargets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeDBProxyTargets for more information on using the DescribeDBProxyTargets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeDBProxyTargetsRequest method. +// req, resp := client.DescribeDBProxyTargetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBProxyTargets +func (c *RDS) DescribeDBProxyTargetsRequest(input *DescribeDBProxyTargetsInput) (req *request.Request, output *DescribeDBProxyTargetsOutput) { + op := &request.Operation{ + Name: opDescribeDBProxyTargets, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeDBProxyTargetsInput{} + } + + output = &DescribeDBProxyTargetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeDBProxyTargets API operation for Amazon Relational Database Service. +// +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// Returns information about DBProxyTarget objects. 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 DescribeDBProxyTargets for usage and error information. +// +// Returned Error Codes: +// * ErrCodeDBProxyNotFoundFault "DBProxyNotFoundFault" +// The specified proxy name doesn't correspond to a proxy owned by your AWS +// accoutn in the specified AWS Region. +// +// * ErrCodeDBProxyTargetNotFoundFault "DBProxyTargetNotFoundFault" +// The specified RDS DB instance or Aurora DB cluster isn't available for a +// proxy owned by your AWS account in the specified AWS Region. +// +// * ErrCodeDBProxyTargetGroupNotFoundFault "DBProxyTargetGroupNotFoundFault" +// The specified target group isn't available for a proxy owned by your AWS +// account in the specified AWS Region. +// +// * ErrCodeInvalidDBProxyStateFault "InvalidDBProxyStateFault" +// The requested operation can't be performed while the proxy is in this state. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeDBProxyTargets +func (c *RDS) DescribeDBProxyTargets(input *DescribeDBProxyTargetsInput) (*DescribeDBProxyTargetsOutput, error) { + req, out := c.DescribeDBProxyTargetsRequest(input) + return out, req.Send() +} + +// DescribeDBProxyTargetsWithContext is the same as DescribeDBProxyTargets with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeDBProxyTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) DescribeDBProxyTargetsWithContext(ctx aws.Context, input *DescribeDBProxyTargetsInput, opts ...request.Option) (*DescribeDBProxyTargetsOutput, error) { + req, out := c.DescribeDBProxyTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeDBProxyTargetsPages iterates over the pages of a DescribeDBProxyTargets operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeDBProxyTargets 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 DescribeDBProxyTargets operation. +// pageNum := 0 +// err := client.DescribeDBProxyTargetsPages(params, +// func(page *rds.DescribeDBProxyTargetsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *RDS) DescribeDBProxyTargetsPages(input *DescribeDBProxyTargetsInput, fn func(*DescribeDBProxyTargetsOutput, bool) bool) error { + return c.DescribeDBProxyTargetsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeDBProxyTargetsPagesWithContext same as DescribeDBProxyTargetsPages 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 *RDS) DescribeDBProxyTargetsPagesWithContext(ctx aws.Context, input *DescribeDBProxyTargetsInput, fn func(*DescribeDBProxyTargetsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeDBProxyTargetsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeDBProxyTargetsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeDBProxyTargetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5495,10 +6730,12 @@ func (c *RDS) DescribeDBSecurityGroupsPagesWithContext(ctx aws.Context, input *D }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBSecurityGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBSecurityGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5720,10 +6957,12 @@ func (c *RDS) DescribeDBSnapshotsPagesWithContext(ctx aws.Context, input *Descri }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBSnapshotsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBSnapshotsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5858,10 +7097,12 @@ func (c *RDS) DescribeDBSubnetGroupsPagesWithContext(ctx aws.Context, input *Des }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDBSubnetGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDBSubnetGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6067,10 +7308,12 @@ func (c *RDS) DescribeEngineDefaultParametersPagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEngineDefaultParametersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEngineDefaultParametersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6283,10 +7526,12 @@ func (c *RDS) DescribeEventSubscriptionsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventSubscriptionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEventSubscriptionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6417,10 +7662,150 @@ func (c *RDS) DescribeEventsPagesWithContext(ctx aws.Context, input *DescribeEve }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) { + break + } } + + return p.Err() +} + +const opDescribeExportTasks = "DescribeExportTasks" + +// DescribeExportTasksRequest generates a "aws/request.Request" representing the +// client's request for the DescribeExportTasks operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeExportTasks for more information on using the DescribeExportTasks +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeExportTasksRequest method. +// req, resp := client.DescribeExportTasksRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeExportTasks +func (c *RDS) DescribeExportTasksRequest(input *DescribeExportTasksInput) (req *request.Request, output *DescribeExportTasksOutput) { + op := &request.Operation{ + Name: opDescribeExportTasks, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeExportTasksInput{} + } + + output = &DescribeExportTasksOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeExportTasks API operation for Amazon Relational Database Service. +// +// Returns information about a snapshot export to Amazon S3. This API operation +// 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 DescribeExportTasks for usage and error information. +// +// Returned Error Codes: +// * ErrCodeExportTaskNotFoundFault "ExportTaskNotFound" +// The export task doesn't exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeExportTasks +func (c *RDS) DescribeExportTasks(input *DescribeExportTasksInput) (*DescribeExportTasksOutput, error) { + req, out := c.DescribeExportTasksRequest(input) + return out, req.Send() +} + +// DescribeExportTasksWithContext is the same as DescribeExportTasks with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeExportTasks for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) DescribeExportTasksWithContext(ctx aws.Context, input *DescribeExportTasksInput, opts ...request.Option) (*DescribeExportTasksOutput, error) { + req, out := c.DescribeExportTasksRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeExportTasksPages iterates over the pages of a DescribeExportTasks operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeExportTasks 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 DescribeExportTasks operation. +// pageNum := 0 +// err := client.DescribeExportTasksPages(params, +// func(page *rds.DescribeExportTasksOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *RDS) DescribeExportTasksPages(input *DescribeExportTasksInput, fn func(*DescribeExportTasksOutput, bool) bool) error { + return c.DescribeExportTasksPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeExportTasksPagesWithContext same as DescribeExportTasksPages 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 *RDS) DescribeExportTasksPagesWithContext(ctx aws.Context, input *DescribeExportTasksInput, fn func(*DescribeExportTasksOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeExportTasksInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeExportTasksRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeExportTasksOutput), !p.HasNextPage()) { + break + } + } + return p.Err() } @@ -6557,10 +7942,150 @@ func (c *RDS) DescribeGlobalClustersPagesWithContext(ctx aws.Context, input *Des }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeGlobalClustersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeGlobalClustersOutput), !p.HasNextPage()) { + break + } } + + return p.Err() +} + +const opDescribeInstallationMedia = "DescribeInstallationMedia" + +// DescribeInstallationMediaRequest generates a "aws/request.Request" representing the +// client's request for the DescribeInstallationMedia operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeInstallationMedia for more information on using the DescribeInstallationMedia +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeInstallationMediaRequest method. +// req, resp := client.DescribeInstallationMediaRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeInstallationMedia +func (c *RDS) DescribeInstallationMediaRequest(input *DescribeInstallationMediaInput) (req *request.Request, output *DescribeInstallationMediaOutput) { + op := &request.Operation{ + Name: opDescribeInstallationMedia, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeInstallationMediaInput{} + } + + output = &DescribeInstallationMediaOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeInstallationMedia API operation for Amazon Relational Database Service. +// +// Describes the available installation media for a DB engine that requires +// an on-premises customer provided license, such as Microsoft SQL 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 Relational Database Service's +// API operation DescribeInstallationMedia for usage and error information. +// +// Returned Error Codes: +// * ErrCodeInstallationMediaNotFoundFault "InstallationMediaNotFound" +// InstallationMediaID doesn't refer to an existing installation medium. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/DescribeInstallationMedia +func (c *RDS) DescribeInstallationMedia(input *DescribeInstallationMediaInput) (*DescribeInstallationMediaOutput, error) { + req, out := c.DescribeInstallationMediaRequest(input) + return out, req.Send() +} + +// DescribeInstallationMediaWithContext is the same as DescribeInstallationMedia with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeInstallationMedia for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) DescribeInstallationMediaWithContext(ctx aws.Context, input *DescribeInstallationMediaInput, opts ...request.Option) (*DescribeInstallationMediaOutput, error) { + req, out := c.DescribeInstallationMediaRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeInstallationMediaPages iterates over the pages of a DescribeInstallationMedia operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeInstallationMedia 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 DescribeInstallationMedia operation. +// pageNum := 0 +// err := client.DescribeInstallationMediaPages(params, +// func(page *rds.DescribeInstallationMediaOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *RDS) DescribeInstallationMediaPages(input *DescribeInstallationMediaInput, fn func(*DescribeInstallationMediaOutput, bool) bool) error { + return c.DescribeInstallationMediaPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeInstallationMediaPagesWithContext same as DescribeInstallationMediaPages 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 *RDS) DescribeInstallationMediaPagesWithContext(ctx aws.Context, input *DescribeInstallationMediaInput, fn func(*DescribeInstallationMediaOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeInstallationMediaInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeInstallationMediaRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeInstallationMediaOutput), !p.HasNextPage()) { + break + } + } + return p.Err() } @@ -6687,10 +8212,12 @@ func (c *RDS) DescribeOptionGroupOptionsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeOptionGroupOptionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeOptionGroupOptionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6822,10 +8349,12 @@ func (c *RDS) DescribeOptionGroupsPagesWithContext(ctx aws.Context, input *Descr }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeOptionGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeOptionGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6952,10 +8481,12 @@ func (c *RDS) DescribeOrderableDBInstanceOptionsPagesWithContext(ctx aws.Context }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeOrderableDBInstanceOptionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeOrderableDBInstanceOptionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7168,10 +8699,12 @@ func (c *RDS) DescribeReservedDBInstancesPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedDBInstancesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReservedDBInstancesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7303,10 +8836,12 @@ func (c *RDS) DescribeReservedDBInstancesOfferingsPagesWithContext(ctx aws.Conte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedDBInstancesOfferingsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReservedDBInstancesOfferingsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7601,10 +9136,12 @@ func (c *RDS) DownloadDBLogFilePortionPagesWithContext(ctx aws.Context, input *D }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DownloadDBLogFilePortionOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DownloadDBLogFilePortionOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7708,6 +9245,90 @@ func (c *RDS) FailoverDBClusterWithContext(ctx aws.Context, input *FailoverDBClu return out, req.Send() } +const opImportInstallationMedia = "ImportInstallationMedia" + +// ImportInstallationMediaRequest generates a "aws/request.Request" representing the +// client's request for the ImportInstallationMedia operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ImportInstallationMedia for more information on using the ImportInstallationMedia +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ImportInstallationMediaRequest method. +// req, resp := client.ImportInstallationMediaRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ImportInstallationMedia +func (c *RDS) ImportInstallationMediaRequest(input *ImportInstallationMediaInput) (req *request.Request, output *ImportInstallationMediaOutput) { + op := &request.Operation{ + Name: opImportInstallationMedia, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ImportInstallationMediaInput{} + } + + output = &ImportInstallationMediaOutput{} + req = c.newRequest(op, input, output) + return +} + +// ImportInstallationMedia API operation for Amazon Relational Database Service. +// +// Imports the installation media for a DB engine that requires an on-premises +// customer provided license, such as SQL 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 Relational Database Service's +// API operation ImportInstallationMedia for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCustomAvailabilityZoneNotFoundFault "CustomAvailabilityZoneNotFound" +// CustomAvailabilityZoneId doesn't refer to an existing custom Availability +// Zone identifier. +// +// * ErrCodeInstallationMediaAlreadyExistsFault "InstallationMediaAlreadyExists" +// The specified installation medium has already been imported. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ImportInstallationMedia +func (c *RDS) ImportInstallationMedia(input *ImportInstallationMediaInput) (*ImportInstallationMediaOutput, error) { + req, out := c.ImportInstallationMediaRequest(input) + return out, req.Send() +} + +// ImportInstallationMediaWithContext is the same as ImportInstallationMedia with the addition of +// the ability to pass a context and additional request options. +// +// See ImportInstallationMedia for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) ImportInstallationMediaWithContext(ctx aws.Context, input *ImportInstallationMediaInput, opts ...request.Option) (*ImportInstallationMediaOutput, error) { + req, out := c.ImportInstallationMediaRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opListTagsForResource = "ListTagsForResource" // ListTagsForResourceRequest generates a "aws/request.Request" representing the @@ -7797,6 +9418,111 @@ func (c *RDS) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsFor return out, req.Send() } +const opModifyCertificates = "ModifyCertificates" + +// ModifyCertificatesRequest generates a "aws/request.Request" representing the +// client's request for the ModifyCertificates operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ModifyCertificates for more information on using the ModifyCertificates +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ModifyCertificatesRequest method. +// req, resp := client.ModifyCertificatesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyCertificates +func (c *RDS) ModifyCertificatesRequest(input *ModifyCertificatesInput) (req *request.Request, output *ModifyCertificatesOutput) { + op := &request.Operation{ + Name: opModifyCertificates, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyCertificatesInput{} + } + + output = &ModifyCertificatesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ModifyCertificates API operation for Amazon Relational Database Service. +// +// Override the system-default Secure Sockets Layer/Transport Layer Security +// (SSL/TLS) certificate for Amazon RDS for new DB instances temporarily, or +// remove the override. +// +// By using this operation, you can specify an RDS-approved SSL/TLS certificate +// for new DB instances that is different from the default certificate provided +// by RDS. You can also use this operation to remove the override, so that new +// DB instances use the default certificate provided by RDS. +// +// You might need to override the default certificate in the following situations: +// +// * You already migrated your applications to support the latest certificate +// authority (CA) certificate, but the new CA certificate is not yet the +// RDS default CA certificate for the specified AWS Region. +// +// * RDS has already moved to a new default CA certificate for the specified +// AWS Region, but you are still in the process of supporting the new CA +// certificate. In this case, you temporarily need additional time to finish +// your application changes. +// +// For more information about rotating your SSL/TLS certificate for RDS DB engines, +// see Rotating Your SSL/TLS Certificate (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL-certificate-rotation.html) +// in the Amazon RDS User Guide. +// +// For more information about rotating your SSL/TLS certificate for Aurora DB +// engines, see Rotating Your SSL/TLS Certificate (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL-certificate-rotation.html) +// in the Amazon Aurora User Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 ModifyCertificates for usage and error information. +// +// Returned Error Codes: +// * ErrCodeCertificateNotFoundFault "CertificateNotFound" +// CertificateIdentifier doesn't refer to an existing certificate. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyCertificates +func (c *RDS) ModifyCertificates(input *ModifyCertificatesInput) (*ModifyCertificatesOutput, error) { + req, out := c.ModifyCertificatesRequest(input) + return out, req.Send() +} + +// ModifyCertificatesWithContext is the same as ModifyCertificates with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyCertificates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) ModifyCertificatesWithContext(ctx aws.Context, input *ModifyCertificatesInput, opts ...request.Option) (*ModifyCertificatesOutput, error) { + req, out := c.ModifyCertificatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opModifyCurrentDBClusterCapacity = "ModifyCurrentDBClusterCapacity" // ModifyCurrentDBClusterCapacityRequest generates a "aws/request.Request" representing the @@ -8186,6 +9912,12 @@ func (c *RDS) ModifyDBClusterParameterGroupRequest(input *ModifyDBClusterParamet // or the DescribeDBClusterParameters action to verify that your DB cluster // parameter group has been created or modified. // +// If the modified DB cluster parameter group is used by an Aurora Serverless +// cluster, Aurora applies the update immediately. The cluster restart might +// interrupt your workload. In that case, your application must reopen any connections +// and retry any transactions that were active when the parameter changes took +// effect. +// // This action only applies to Aurora DB clusters. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -8430,11 +10162,11 @@ func (c *RDS) ModifyDBInstanceRequest(input *ModifyDBInstanceInput) (req *reques // Storage of the StorageType specified can't be associated with the DB instance. // // * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" -// The specified CIDRIP or Amazon EC2 security group isn't authorized for the -// specified DB security group. +// The specified CIDR IP range or Amazon EC2 security group might not be authorized +// for the specified DB security group. // -// RDS also may not be authorized by using IAM to perform necessary actions -// on your behalf. +// Or, RDS might not be authorized to perform necessary actions using IAM on +// your behalf. // // * ErrCodeCertificateNotFoundFault "CertificateNotFound" // CertificateIdentifier doesn't refer to an existing certificate. @@ -8567,6 +10299,188 @@ func (c *RDS) ModifyDBParameterGroupWithContext(ctx aws.Context, input *ModifyDB return out, req.Send() } +const opModifyDBProxy = "ModifyDBProxy" + +// ModifyDBProxyRequest generates a "aws/request.Request" representing the +// client's request for the ModifyDBProxy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ModifyDBProxy for more information on using the ModifyDBProxy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ModifyDBProxyRequest method. +// req, resp := client.ModifyDBProxyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBProxy +func (c *RDS) ModifyDBProxyRequest(input *ModifyDBProxyInput) (req *request.Request, output *ModifyDBProxyOutput) { + op := &request.Operation{ + Name: opModifyDBProxy, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyDBProxyInput{} + } + + output = &ModifyDBProxyOutput{} + req = c.newRequest(op, input, output) + return +} + +// ModifyDBProxy API operation for Amazon Relational Database Service. +// +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// Changes the settings for an existing DB proxy. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 ModifyDBProxy for usage and error information. +// +// Returned Error Codes: +// * ErrCodeDBProxyNotFoundFault "DBProxyNotFoundFault" +// The specified proxy name doesn't correspond to a proxy owned by your AWS +// accoutn in the specified AWS Region. +// +// * ErrCodeDBProxyAlreadyExistsFault "DBProxyTargetExistsFault" +// The specified proxy name must be unique for all proxies owned by your AWS +// account in the specified AWS Region. +// +// * ErrCodeInvalidDBProxyStateFault "InvalidDBProxyStateFault" +// The requested operation can't be performed while the proxy is in this state. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBProxy +func (c *RDS) ModifyDBProxy(input *ModifyDBProxyInput) (*ModifyDBProxyOutput, error) { + req, out := c.ModifyDBProxyRequest(input) + return out, req.Send() +} + +// ModifyDBProxyWithContext is the same as ModifyDBProxy with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyDBProxy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) ModifyDBProxyWithContext(ctx aws.Context, input *ModifyDBProxyInput, opts ...request.Option) (*ModifyDBProxyOutput, error) { + req, out := c.ModifyDBProxyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opModifyDBProxyTargetGroup = "ModifyDBProxyTargetGroup" + +// ModifyDBProxyTargetGroupRequest generates a "aws/request.Request" representing the +// client's request for the ModifyDBProxyTargetGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ModifyDBProxyTargetGroup for more information on using the ModifyDBProxyTargetGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ModifyDBProxyTargetGroupRequest method. +// req, resp := client.ModifyDBProxyTargetGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBProxyTargetGroup +func (c *RDS) ModifyDBProxyTargetGroupRequest(input *ModifyDBProxyTargetGroupInput) (req *request.Request, output *ModifyDBProxyTargetGroupOutput) { + op := &request.Operation{ + Name: opModifyDBProxyTargetGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyDBProxyTargetGroupInput{} + } + + output = &ModifyDBProxyTargetGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// ModifyDBProxyTargetGroup API operation for Amazon Relational Database Service. +// +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// Modifies the properties of a DBProxyTargetGroup. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 ModifyDBProxyTargetGroup for usage and error information. +// +// Returned Error Codes: +// * ErrCodeDBProxyNotFoundFault "DBProxyNotFoundFault" +// The specified proxy name doesn't correspond to a proxy owned by your AWS +// accoutn in the specified AWS Region. +// +// * ErrCodeDBProxyTargetGroupNotFoundFault "DBProxyTargetGroupNotFoundFault" +// The specified target group isn't available for a proxy owned by your AWS +// account in the specified AWS Region. +// +// * ErrCodeInvalidDBProxyStateFault "InvalidDBProxyStateFault" +// The requested operation can't be performed while the proxy is in this state. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBProxyTargetGroup +func (c *RDS) ModifyDBProxyTargetGroup(input *ModifyDBProxyTargetGroupInput) (*ModifyDBProxyTargetGroupOutput, error) { + req, out := c.ModifyDBProxyTargetGroupRequest(input) + return out, req.Send() +} + +// ModifyDBProxyTargetGroupWithContext is the same as ModifyDBProxyTargetGroup with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyDBProxyTargetGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) ModifyDBProxyTargetGroupWithContext(ctx aws.Context, input *ModifyDBProxyTargetGroupInput, opts ...request.Option) (*ModifyDBProxyTargetGroupOutput, error) { + req, out := c.ModifyDBProxyTargetGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opModifyDBSnapshot = "ModifyDBSnapshot" // ModifyDBSnapshotRequest generates a "aws/request.Request" representing the @@ -8614,7 +10528,7 @@ func (c *RDS) ModifyDBSnapshotRequest(input *ModifyDBSnapshotInput) (req *reques // Updates a manual DB snapshot, which can be encrypted or not encrypted, with // a new engine version. // -// Amazon RDS supports upgrading DB snapshots for MySQL and Oracle. +// Amazon RDS supports upgrading DB snapshots for MySQL, Oracle, and PostgreSQL. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -8890,9 +10804,9 @@ func (c *RDS) ModifyEventSubscriptionRequest(input *ModifyEventSubscriptionInput // ModifyEventSubscription API operation for Amazon Relational Database Service. // -// Modifies an existing RDS event notification subscription. Note that you can't -// modify the source identifiers using this call; to change source identifiers -// for a subscription, use the AddSourceIdentifierToSubscription and RemoveSourceIdentifierFromSubscription +// Modifies an existing RDS event notification subscription. You can't 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 @@ -9470,6 +11384,113 @@ func (c *RDS) RebootDBInstanceWithContext(ctx aws.Context, input *RebootDBInstan return out, req.Send() } +const opRegisterDBProxyTargets = "RegisterDBProxyTargets" + +// RegisterDBProxyTargetsRequest generates a "aws/request.Request" representing the +// client's request for the RegisterDBProxyTargets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RegisterDBProxyTargets for more information on using the RegisterDBProxyTargets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RegisterDBProxyTargetsRequest method. +// req, resp := client.RegisterDBProxyTargetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RegisterDBProxyTargets +func (c *RDS) RegisterDBProxyTargetsRequest(input *RegisterDBProxyTargetsInput) (req *request.Request, output *RegisterDBProxyTargetsOutput) { + op := &request.Operation{ + Name: opRegisterDBProxyTargets, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RegisterDBProxyTargetsInput{} + } + + output = &RegisterDBProxyTargetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// RegisterDBProxyTargets API operation for Amazon Relational Database Service. +// +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// Associate one or more DBProxyTarget data structures with a DBProxyTargetGroup. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type 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 RegisterDBProxyTargets for usage and error information. +// +// Returned Error Codes: +// * ErrCodeDBProxyNotFoundFault "DBProxyNotFoundFault" +// The specified proxy name doesn't correspond to a proxy owned by your AWS +// accoutn in the specified AWS Region. +// +// * ErrCodeDBProxyTargetGroupNotFoundFault "DBProxyTargetGroupNotFoundFault" +// The specified target group isn't available for a proxy owned by your AWS +// account in the specified AWS Region. +// +// * ErrCodeDBClusterNotFoundFault "DBClusterNotFoundFault" +// DBClusterIdentifier doesn't refer to an existing DB cluster. +// +// * ErrCodeDBInstanceNotFoundFault "DBInstanceNotFound" +// DBInstanceIdentifier doesn't refer to an existing DB instance. +// +// * ErrCodeDBProxyTargetAlreadyRegisteredFault "DBProxyTargetAlreadyRegisteredFault" +// The proxy is already associated with the specified RDS DB instance or Aurora +// DB cluster. +// +// * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" +// The DB instance isn't in a valid state. +// +// * ErrCodeInvalidDBClusterStateFault "InvalidDBClusterStateFault" +// The requested operation can't be performed while the cluster is in this state. +// +// * ErrCodeInvalidDBProxyStateFault "InvalidDBProxyStateFault" +// The requested operation can't be performed while the proxy is in this state. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/RegisterDBProxyTargets +func (c *RDS) RegisterDBProxyTargets(input *RegisterDBProxyTargetsInput) (*RegisterDBProxyTargetsOutput, error) { + req, out := c.RegisterDBProxyTargetsRequest(input) + return out, req.Send() +} + +// RegisterDBProxyTargetsWithContext is the same as RegisterDBProxyTargets with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterDBProxyTargets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) RegisterDBProxyTargetsWithContext(ctx aws.Context, input *RegisterDBProxyTargetsInput, opts ...request.Option) (*RegisterDBProxyTargetsOutput, error) { + req, out := c.RegisterDBProxyTargetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opRemoveFromGlobalCluster = "RemoveFromGlobalCluster" // RemoveFromGlobalClusterRequest generates a "aws/request.Request" representing the @@ -9710,7 +11731,7 @@ func (c *RDS) RemoveRoleFromDBInstanceRequest(input *RemoveRoleFromDBInstanceInp // DBInstanceIdentifier doesn't refer to an existing DB instance. // // * ErrCodeDBInstanceRoleNotFoundFault "DBInstanceRoleNotFound" -// The specified RoleArn value doesn't match the specifed feature for the DB +// The specified RoleArn value doesn't match the specified feature for the DB // instance. // // * ErrCodeInvalidDBInstanceStateFault "InvalidDBInstanceState" @@ -10282,8 +12303,8 @@ func (c *RDS) RestoreDBClusterFromSnapshotRequest(input *RestoreDBClusterFromSna // // If a DB cluster snapshot is specified, 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. +// source DB cluster. If you don't specify a security group, the new DB cluster +// is associated with the default security group. // // For more information on Amazon Aurora, see What Is Amazon Aurora? (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. @@ -10661,11 +12682,11 @@ func (c *RDS) RestoreDBInstanceFromDBSnapshotRequest(input *RestoreDBInstanceFro // Storage of the StorageType specified can't be associated with the DB instance. // // * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" -// The specified CIDRIP or Amazon EC2 security group isn't authorized for the -// specified DB security group. +// The specified CIDR IP range or Amazon EC2 security group might not be authorized +// for the specified DB security group. // -// RDS also may not be authorized by using IAM to perform necessary actions -// on your behalf. +// Or, RDS might not be authorized to perform necessary actions using IAM on +// your behalf. // // * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" // An error occurred accessing an AWS KMS key. @@ -10813,11 +12834,11 @@ func (c *RDS) RestoreDBInstanceFromS3Request(input *RestoreDBInstanceFromS3Input // Storage of the StorageType specified can't be associated with the DB instance. // // * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" -// The specified CIDRIP or Amazon EC2 security group isn't authorized for the -// specified DB security group. +// The specified CIDR IP range or Amazon EC2 security group might not be authorized +// for the specified DB security group. // -// RDS also may not be authorized by using IAM to perform necessary actions -// on your behalf. +// Or, RDS might not be authorized to perform necessary actions using IAM on +// your behalf. // // * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" // An error occurred accessing an AWS KMS key. @@ -10966,11 +12987,11 @@ func (c *RDS) RestoreDBInstanceToPointInTimeRequest(input *RestoreDBInstanceToPo // Storage of the StorageType specified can't be associated with the DB instance. // // * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" -// The specified CIDRIP or Amazon EC2 security group isn't authorized for the -// specified DB security group. +// The specified CIDR IP range or Amazon EC2 security group might not be authorized +// for the specified DB security group. // -// RDS also may not be authorized by using IAM to perform necessary actions -// on your behalf. +// Or, RDS might not be authorized to perform necessary actions using IAM on +// your behalf. // // * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" // An error occurred accessing an AWS KMS key. @@ -11072,11 +13093,11 @@ func (c *RDS) RevokeDBSecurityGroupIngressRequest(input *RevokeDBSecurityGroupIn // DBSecurityGroupName doesn't refer to an existing DB security group. // // * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" -// The specified CIDRIP or Amazon EC2 security group isn't authorized for the -// specified DB security group. +// The specified CIDR IP range or Amazon EC2 security group might not be authorized +// for the specified DB security group. // -// RDS also may not be authorized by using IAM to perform necessary actions -// on your behalf. +// Or, RDS might not be authorized to perform necessary actions using IAM on +// your behalf. // // * ErrCodeInvalidDBSecurityGroupStateFault "InvalidDBSecurityGroupState" // The state of the DB security group doesn't allow deletion. @@ -11384,11 +13405,11 @@ func (c *RDS) StartDBInstanceRequest(input *StartDBInstanceInput) (req *request. // DBClusterIdentifier doesn't refer to an existing DB cluster. // // * ErrCodeAuthorizationNotFoundFault "AuthorizationNotFound" -// The specified CIDRIP or Amazon EC2 security group isn't authorized for the -// specified DB security group. +// The specified CIDR IP range or Amazon EC2 security group might not be authorized +// for the specified DB security group. // -// RDS also may not be authorized by using IAM to perform necessary actions -// on your behalf. +// Or, RDS might not be authorized to perform necessary actions using IAM on +// your behalf. // // * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" // An error occurred accessing an AWS KMS key. @@ -11415,6 +13436,113 @@ func (c *RDS) StartDBInstanceWithContext(ctx aws.Context, input *StartDBInstance return out, req.Send() } +const opStartExportTask = "StartExportTask" + +// StartExportTaskRequest generates a "aws/request.Request" representing the +// client's request for the StartExportTask operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartExportTask for more information on using the StartExportTask +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartExportTaskRequest method. +// req, resp := client.StartExportTaskRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/StartExportTask +func (c *RDS) StartExportTaskRequest(input *StartExportTaskInput) (req *request.Request, output *StartExportTaskOutput) { + op := &request.Operation{ + Name: opStartExportTask, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StartExportTaskInput{} + } + + output = &StartExportTaskOutput{} + req = c.newRequest(op, input, output) + return +} + +// StartExportTask API operation for Amazon Relational Database Service. +// +// Starts an export of a snapshot to Amazon S3. The provided IAM role must have +// access to the S3 bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Relational Database Service's +// API operation StartExportTask for usage and error information. +// +// Returned Error Codes: +// * ErrCodeDBSnapshotNotFoundFault "DBSnapshotNotFound" +// DBSnapshotIdentifier doesn't refer to an existing DB snapshot. +// +// * ErrCodeDBClusterSnapshotNotFoundFault "DBClusterSnapshotNotFoundFault" +// DBClusterSnapshotIdentifier doesn't refer to an existing DB cluster snapshot. +// +// * ErrCodeExportTaskAlreadyExistsFault "ExportTaskAlreadyExists" +// You can't start an export task that's already running. +// +// * ErrCodeInvalidS3BucketFault "InvalidS3BucketFault" +// The specified Amazon S3 bucket name can't be found or Amazon RDS isn't authorized +// to access the specified Amazon S3 bucket. Verify the SourceS3BucketName and +// S3IngestionRoleArn values and try again. +// +// * ErrCodeIamRoleNotFoundFault "IamRoleNotFound" +// The IAM role is missing for exporting to an Amazon S3 bucket. +// +// * ErrCodeIamRoleMissingPermissionsFault "IamRoleMissingPermissions" +// The IAM role requires additional permissions to export to an Amazon S3 bucket. +// +// * ErrCodeInvalidExportOnlyFault "InvalidExportOnly" +// The export is invalid for exporting to an Amazon S3 bucket. +// +// * ErrCodeKMSKeyNotAccessibleFault "KMSKeyNotAccessibleFault" +// An error occurred accessing an AWS KMS key. +// +// * ErrCodeInvalidExportSourceStateFault "InvalidExportSourceState" +// The state of the export snapshot is invalid for exporting to an Amazon S3 +// bucket. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/StartExportTask +func (c *RDS) StartExportTask(input *StartExportTaskInput) (*StartExportTaskOutput, error) { + req, out := c.StartExportTaskRequest(input) + return out, req.Send() +} + +// StartExportTaskWithContext is the same as StartExportTask with the addition of +// the ability to pass a context and additional request options. +// +// See StartExportTask for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *RDS) StartExportTaskWithContext(ctx aws.Context, input *StartExportTaskInput, opts ...request.Option) (*StartExportTaskOutput, error) { + req, out := c.StartExportTaskRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opStopActivityStream = "StopActivityStream" // StopActivityStreamRequest generates a "aws/request.Request" representing the @@ -11739,7 +13867,9 @@ func (c *RDS) StopDBInstanceWithContext(ctx aws.Context, input *StopDBInstanceIn // a lower number of associated IAM roles. // // * DBInstances - The number of DB instances per account. The used value -// is the count of the DB instances in the account. +// is the count of the DB instances in the account. Amazon RDS DB instances, +// Amazon Aurora DB instances, Amazon Neptune instances, and Amazon DocumentDB +// instances apply to this quota. // // * DBParameterGroups - The number of DB parameter groups per account, excluding // default parameter groups. The used value is the count of nondefault DB @@ -11776,8 +13906,8 @@ func (c *RDS) StopDBInstanceWithContext(ctx aws.Context, input *StopDBInstanceIn // account. Other DB subnet groups in the account might have a lower number // of subnets. // -// For more information, see Limits (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html) -// in the Amazon RDS User Guide and Limits (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_Limits.html) +// For more information, see Quotas for Amazon RDS (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Limits.html) +// in the Amazon RDS User Guide and Quotas for Amazon Aurora (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_Limits.html) // in the Amazon Aurora User Guide. type AccountQuota struct { _ struct{} `type:"structure"` @@ -12143,7 +14273,7 @@ type ApplyPendingMaintenanceActionInput struct { // The pending maintenance action to apply to this resource. // - // Valid values: system-update, db-upgrade, hardware-maintenance + // Valid values: system-update, db-upgrade, hardware-maintenance, ca-certificate-rotation // // ApplyAction is a required field ApplyAction *string `type:"string" required:"true"` @@ -12263,7 +14393,7 @@ type AuthorizeDBSecurityGroupIngressInput struct { 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 + // EC2SecurityGroupName parameter. The AWS access key ID isn't an acceptable // value. For VPC DB security groups, EC2SecurityGroupId must be provided. Otherwise, // EC2SecurityGroupOwnerId and either EC2SecurityGroupName or EC2SecurityGroupId // must be provided. @@ -12430,7 +14560,7 @@ type BacktrackDBClusterInput struct { // 8601 format. For more information about ISO 8601, see the ISO8601 Wikipedia // page. (http://en.wikipedia.org/wiki/ISO_8601) // - // If the specified time is not a consistent time for the DB cluster, Aurora + // If the specified time isn't a consistent time for the DB cluster, Aurora // automatically chooses the nearest possible consistent time for the DB cluster. // // Constraints: @@ -12606,6 +14736,214 @@ func (s *BacktrackDBClusterOutput) SetStatus(v string) *BacktrackDBClusterOutput return s } +type CancelExportTaskInput struct { + _ struct{} `type:"structure"` + + // The identifier of the snapshot export task to cancel. + // + // ExportTaskIdentifier is a required field + ExportTaskIdentifier *string `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.ExportTaskIdentifier == nil { + invalidParams.Add(request.NewErrParamRequired("ExportTaskIdentifier")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetExportTaskIdentifier sets the ExportTaskIdentifier field's value. +func (s *CancelExportTaskInput) SetExportTaskIdentifier(v string) *CancelExportTaskInput { + s.ExportTaskIdentifier = &v + return s +} + +// Contains the details of a snapshot export to Amazon S3. +// +// This data type is used as a response element in the DescribeExportTasks action. +type CancelExportTaskOutput struct { + _ struct{} `type:"structure"` + + // The data exported from the snapshot. Valid values are the following: + // + // * database - Export all the data of the snapshot. + // + // * database.table [table-name] - Export a table of the snapshot. + // + // * database.schema [schema-name] - Export a database schema of the snapshot. + // This value isn't valid for RDS for MySQL, RDS for MariaDB, or Aurora MySQL. + // + // * database.schema.table [table-name] - Export a table of the database + // schema. This value isn't valid for RDS for MySQL, RDS for MariaDB, or + // Aurora MySQL. + ExportOnly []*string `type:"list"` + + // A unique identifier for the snapshot export task. This ID isn't an identifier + // for the Amazon S3 bucket where the snapshot is exported to. + ExportTaskIdentifier *string `type:"string"` + + // The reason the export failed, if it failed. + FailureCause *string `type:"string"` + + // The name of the IAM role that is used to write to Amazon S3 when exporting + // a snapshot. + IamRoleArn *string `type:"string"` + + // The ID of the AWS KMS key that is used to encrypt the snapshot when it's + // exported to Amazon S3. The KMS key ID is the Amazon Resource Name (ARN), + // the KMS key identifier, or the KMS key alias for the KMS encryption key. + // The IAM role used for the snapshot export must have encryption and decryption + // permissions to use this KMS key. + KmsKeyId *string `type:"string"` + + // The progress of the snapshot export task as a percentage. + PercentProgress *int64 `type:"integer"` + + // The Amazon S3 bucket that the snapshot is exported to. + S3Bucket *string `type:"string"` + + // The Amazon S3 bucket prefix that is the file name and path of the exported + // snapshot. + S3Prefix *string `type:"string"` + + // The time that the snapshot was created. + SnapshotTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of the snapshot exported to Amazon S3. + SourceArn *string `type:"string"` + + // The progress status of the export task. + Status *string `type:"string"` + + // The time that the snapshot export task completed. + TaskEndTime *time.Time `type:"timestamp"` + + // The time that the snapshot export task started. + TaskStartTime *time.Time `type:"timestamp"` + + // The total amount of data exported, in gigabytes. + TotalExtractedDataInGB *int64 `type:"integer"` + + // A warning about the snapshot export task. + WarningMessage *string `type:"string"` +} + +// 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() +} + +// SetExportOnly sets the ExportOnly field's value. +func (s *CancelExportTaskOutput) SetExportOnly(v []*string) *CancelExportTaskOutput { + s.ExportOnly = v + return s +} + +// SetExportTaskIdentifier sets the ExportTaskIdentifier field's value. +func (s *CancelExportTaskOutput) SetExportTaskIdentifier(v string) *CancelExportTaskOutput { + s.ExportTaskIdentifier = &v + return s +} + +// SetFailureCause sets the FailureCause field's value. +func (s *CancelExportTaskOutput) SetFailureCause(v string) *CancelExportTaskOutput { + s.FailureCause = &v + return s +} + +// SetIamRoleArn sets the IamRoleArn field's value. +func (s *CancelExportTaskOutput) SetIamRoleArn(v string) *CancelExportTaskOutput { + s.IamRoleArn = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *CancelExportTaskOutput) SetKmsKeyId(v string) *CancelExportTaskOutput { + s.KmsKeyId = &v + return s +} + +// SetPercentProgress sets the PercentProgress field's value. +func (s *CancelExportTaskOutput) SetPercentProgress(v int64) *CancelExportTaskOutput { + s.PercentProgress = &v + return s +} + +// SetS3Bucket sets the S3Bucket field's value. +func (s *CancelExportTaskOutput) SetS3Bucket(v string) *CancelExportTaskOutput { + s.S3Bucket = &v + return s +} + +// SetS3Prefix sets the S3Prefix field's value. +func (s *CancelExportTaskOutput) SetS3Prefix(v string) *CancelExportTaskOutput { + s.S3Prefix = &v + return s +} + +// SetSnapshotTime sets the SnapshotTime field's value. +func (s *CancelExportTaskOutput) SetSnapshotTime(v time.Time) *CancelExportTaskOutput { + s.SnapshotTime = &v + return s +} + +// SetSourceArn sets the SourceArn field's value. +func (s *CancelExportTaskOutput) SetSourceArn(v string) *CancelExportTaskOutput { + s.SourceArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CancelExportTaskOutput) SetStatus(v string) *CancelExportTaskOutput { + s.Status = &v + return s +} + +// SetTaskEndTime sets the TaskEndTime field's value. +func (s *CancelExportTaskOutput) SetTaskEndTime(v time.Time) *CancelExportTaskOutput { + s.TaskEndTime = &v + return s +} + +// SetTaskStartTime sets the TaskStartTime field's value. +func (s *CancelExportTaskOutput) SetTaskStartTime(v time.Time) *CancelExportTaskOutput { + s.TaskStartTime = &v + return s +} + +// SetTotalExtractedDataInGB sets the TotalExtractedDataInGB field's value. +func (s *CancelExportTaskOutput) SetTotalExtractedDataInGB(v int64) *CancelExportTaskOutput { + s.TotalExtractedDataInGB = &v + return s +} + +// SetWarningMessage sets the WarningMessage field's value. +func (s *CancelExportTaskOutput) SetWarningMessage(v string) *CancelExportTaskOutput { + s.WarningMessage = &v + return s +} + // A CA certificate for an AWS account. type Certificate struct { _ struct{} `type:"structure"` @@ -12619,6 +14957,13 @@ type Certificate struct { // The type of the certificate. CertificateType *string `type:"string"` + // Whether there is an override for the default certificate identifier. + CustomerOverride *bool `type:"boolean"` + + // If there is an override for the default certificate identifier, when the + // override expires. + CustomerOverrideValidTill *time.Time `type:"timestamp"` + // The thumbprint of the certificate. Thumbprint *string `type:"string"` @@ -12657,6 +15002,18 @@ func (s *Certificate) SetCertificateType(v string) *Certificate { return s } +// SetCustomerOverride sets the CustomerOverride field's value. +func (s *Certificate) SetCustomerOverride(v bool) *Certificate { + s.CustomerOverride = &v + return s +} + +// SetCustomerOverrideValidTill sets the CustomerOverrideValidTill field's value. +func (s *Certificate) SetCustomerOverrideValidTill(v time.Time) *Certificate { + s.CustomerOverrideValidTill = &v + return s +} + // SetThumbprint sets the Thumbprint field's value. func (s *Certificate) SetThumbprint(v string) *Certificate { s.Thumbprint = &v @@ -12748,6 +15105,186 @@ func (s *CloudwatchLogsExportConfiguration) SetEnableLogTypes(v []*string) *Clou return s } +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// Specifies the settings that control the size and behavior of the connection +// pool associated with a DBProxyTargetGroup. +type ConnectionPoolConfiguration struct { + _ struct{} `type:"structure"` + + // The number of seconds for a proxy to wait for a connection to become available + // in the connection pool. Only applies when the proxy has opened its maximum + // number of connections and all connections are busy with client sessions. + // + // Default: 120 + // + // Constraints: between 1 and 3600, or 0 representing unlimited + ConnectionBorrowTimeout *int64 `type:"integer"` + + // One or more SQL statements for the proxy to run when opening each new database + // connection. Typically used with SET statements to make sure that each connection + // has identical settings such as time zone and character set. For multiple + // statements, use semicolons as the separator. You can also include multiple + // variables in a single SET statement, such as SET x=1, y=2. + // + // Default: no initialization query + InitQuery *string `type:"string"` + + // The maximum size of the connection pool for each target in a target group. + // For Aurora MySQL, it is expressed as a percentage of the max_connections + // setting for the RDS DB instance or Aurora DB cluster used by the target group. + // + // Default: 100 + // + // Constraints: between 1 and 100 + MaxConnectionsPercent *int64 `type:"integer"` + + // Controls how actively the proxy closes idle database connections in the connection + // pool. A high value enables the proxy to leave a high percentage of idle connections + // open. A low value causes the proxy to close idle client connections and return + // the underlying database connections to the connection pool. For Aurora MySQL, + // it is expressed as a percentage of the max_connections setting for the RDS + // DB instance or Aurora DB cluster used by the target group. + // + // Default: 50 + // + // Constraints: between 0 and MaxConnectionsPercent + MaxIdleConnectionsPercent *int64 `type:"integer"` + + // Each item in the list represents a class of SQL operations that normally + // cause all later statements in a session using a proxy to be pinned to the + // same underlying database connection. Including an item in the list exempts + // that class of SQL operations from the pinning behavior. + // + // Default: no session pinning filters + SessionPinningFilters []*string `type:"list"` +} + +// String returns the string representation +func (s ConnectionPoolConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectionPoolConfiguration) GoString() string { + return s.String() +} + +// SetConnectionBorrowTimeout sets the ConnectionBorrowTimeout field's value. +func (s *ConnectionPoolConfiguration) SetConnectionBorrowTimeout(v int64) *ConnectionPoolConfiguration { + s.ConnectionBorrowTimeout = &v + return s +} + +// SetInitQuery sets the InitQuery field's value. +func (s *ConnectionPoolConfiguration) SetInitQuery(v string) *ConnectionPoolConfiguration { + s.InitQuery = &v + return s +} + +// SetMaxConnectionsPercent sets the MaxConnectionsPercent field's value. +func (s *ConnectionPoolConfiguration) SetMaxConnectionsPercent(v int64) *ConnectionPoolConfiguration { + s.MaxConnectionsPercent = &v + return s +} + +// SetMaxIdleConnectionsPercent sets the MaxIdleConnectionsPercent field's value. +func (s *ConnectionPoolConfiguration) SetMaxIdleConnectionsPercent(v int64) *ConnectionPoolConfiguration { + s.MaxIdleConnectionsPercent = &v + return s +} + +// SetSessionPinningFilters sets the SessionPinningFilters field's value. +func (s *ConnectionPoolConfiguration) SetSessionPinningFilters(v []*string) *ConnectionPoolConfiguration { + s.SessionPinningFilters = v + return s +} + +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// Displays the settings that control the size and behavior of the connection +// pool associated with a DBProxyTarget. +type ConnectionPoolConfigurationInfo struct { + _ struct{} `type:"structure"` + + // The number of seconds for a proxy to wait for a connection to become available + // in the connection pool. Only applies when the proxy has opened its maximum + // number of connections and all connections are busy with client sessions. + ConnectionBorrowTimeout *int64 `type:"integer"` + + // One or more SQL statements for the proxy to run when opening each new database + // connection. Typically used with SET statements to make sure that each connection + // has identical settings such as time zone and character set. This setting + // is empty by default. For multiple statements, use semicolons as the separator. + // You can also include multiple variables in a single SET statement, such as + // SET x=1, y=2. + InitQuery *string `type:"string"` + + // The maximum size of the connection pool for each target in a target group. + // For Aurora MySQL, it is expressed as a percentage of the max_connections + // setting for the RDS DB instance or Aurora DB cluster used by the target group. + MaxConnectionsPercent *int64 `type:"integer"` + + // Controls how actively the proxy closes idle database connections in the connection + // pool. A high value enables the proxy to leave a high percentage of idle connections + // open. A low value causes the proxy to close idle client connections and return + // the underlying database connections to the connection pool. For Aurora MySQL, + // it is expressed as a percentage of the max_connections setting for the RDS + // DB instance or Aurora DB cluster used by the target group. + MaxIdleConnectionsPercent *int64 `type:"integer"` + + // Each item in the list represents a class of SQL operations that normally + // cause all later statements in a session using a proxy to be pinned to the + // same underlying database connection. Including an item in the list exempts + // that class of SQL operations from the pinning behavior. Currently, the only + // allowed value is EXCLUDE_VARIABLE_SETS. + SessionPinningFilters []*string `type:"list"` +} + +// String returns the string representation +func (s ConnectionPoolConfigurationInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConnectionPoolConfigurationInfo) GoString() string { + return s.String() +} + +// SetConnectionBorrowTimeout sets the ConnectionBorrowTimeout field's value. +func (s *ConnectionPoolConfigurationInfo) SetConnectionBorrowTimeout(v int64) *ConnectionPoolConfigurationInfo { + s.ConnectionBorrowTimeout = &v + return s +} + +// SetInitQuery sets the InitQuery field's value. +func (s *ConnectionPoolConfigurationInfo) SetInitQuery(v string) *ConnectionPoolConfigurationInfo { + s.InitQuery = &v + return s +} + +// SetMaxConnectionsPercent sets the MaxConnectionsPercent field's value. +func (s *ConnectionPoolConfigurationInfo) SetMaxConnectionsPercent(v int64) *ConnectionPoolConfigurationInfo { + s.MaxConnectionsPercent = &v + return s +} + +// SetMaxIdleConnectionsPercent sets the MaxIdleConnectionsPercent field's value. +func (s *ConnectionPoolConfigurationInfo) SetMaxIdleConnectionsPercent(v int64) *ConnectionPoolConfigurationInfo { + s.MaxIdleConnectionsPercent = &v + return s +} + +// SetSessionPinningFilters sets the SessionPinningFilters field's value. +func (s *ConnectionPoolConfigurationInfo) SetSessionPinningFilters(v []*string) *ConnectionPoolConfigurationInfo { + s.SessionPinningFilters = v + return s +} + type CopyDBClusterParameterGroupInput struct { _ struct{} `type:"structure"` @@ -12886,9 +15423,9 @@ type CopyDBClusterSnapshotInput struct { // DestinationRegion is used for presigning the request to a given region. DestinationRegion *string `type:"string"` - // The AWS 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. + // 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 encrypted DB cluster snapshot from your AWS account, you can // specify a value for KmsKeyId to encrypt the copy with a new KMS encryption @@ -12911,7 +15448,8 @@ type CopyDBClusterSnapshotInput struct { // 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. + // DB cluster snapshot from another AWS Region. Don't specify PreSignedUrl when + // you are copying an encrypted DB cluster snapshot in the same AWS Region. // // The pre-signed URL must be a valid request for the CopyDBSClusterSnapshot // API action that can be executed in the source AWS Region that contains the @@ -12925,7 +15463,7 @@ type CopyDBClusterSnapshotInput struct { // pre-signed URL. // // * DestinationRegion - The name of the AWS Region that the DB cluster snapshot - // will be created in. + // is to be created in. // // * SourceDBClusterSnapshotIdentifier - The DB cluster snapshot identifier // for the encrypted DB cluster snapshot to be copied. This identifier must @@ -12937,10 +15475,14 @@ type CopyDBClusterSnapshotInput struct { // To learn how to generate a Signature Version 4 signed request, see Authenticating // Requests: Using Query Parameters (AWS Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) // and Signature Version 4 Signing Process (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). + // + // If you are using an AWS SDK tool or the AWS CLI, you can specify SourceRegion + // (or --source-region for the AWS CLI) instead of specifying PreSignedUrl manually. + // Specifying SourceRegion autogenerates a pre-signed URL that is a valid request + // for the operation that can be executed in the source AWS Region. PreSignedUrl *string `type:"string"` - // The identifier of the DB cluster snapshot to copy. This parameter is not - // case-sensitive. + // The identifier of the DB cluster snapshot to copy. This parameter isn't case-sensitive. // // You can't copy an encrypted, shared DB cluster snapshot from one AWS Region // to another. @@ -12972,7 +15514,7 @@ type CopyDBClusterSnapshotInput struct { 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. + // cluster snapshot. This parameter isn't case-sensitive. // // Constraints: // @@ -13257,9 +15799,8 @@ type CopyDBSnapshotInput struct { // to copy. // // You must specify this parameter when you copy an encrypted DB snapshot from - // another AWS Region by using the Amazon RDS API. You can specify the --source-region - // option instead of this parameter when you copy an encrypted DB snapshot from - // another AWS Region by using the AWS CLI. + // another AWS Region by using the Amazon RDS API. Don't specify PreSignedUrl + // when you are copying an encrypted DB snapshot in the same AWS Region. // // The presigned URL must be a valid request for the CopyDBSnapshot API action // that can be executed in the source AWS Region that contains the encrypted @@ -13289,6 +15830,11 @@ type CopyDBSnapshotInput struct { // To learn how to generate a Signature Version 4 signed request, see Authenticating // Requests: Using Query Parameters (AWS Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) // and Signature Version 4 Signing Process (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). + // + // If you are using an AWS SDK tool or the AWS CLI, you can specify SourceRegion + // (or --source-region for the AWS CLI) instead of specifying PreSignedUrl manually. + // Specifying SourceRegion autogenerates a pre-signed URL that is a valid request + // for the operation that can be executed in the source AWS Region. PreSignedUrl *string `type:"string"` // The identifier for the source DB snapshot. @@ -13572,6 +16118,105 @@ func (s *CopyOptionGroupOutput) SetOptionGroup(v *OptionGroup) *CopyOptionGroupO return s } +type CreateCustomAvailabilityZoneInput struct { + _ struct{} `type:"structure"` + + // The name of the custom Availability Zone (AZ). + // + // CustomAvailabilityZoneName is a required field + CustomAvailabilityZoneName *string `type:"string" required:"true"` + + // The ID of an existing virtual private network (VPN) between the Amazon RDS + // website and the VMware vSphere cluster. + ExistingVpnId *string `type:"string"` + + // The name of a new VPN tunnel between the Amazon RDS website and the VMware + // vSphere cluster. + // + // Specify this parameter only if ExistingVpnId isn't specified. + NewVpnTunnelName *string `type:"string"` + + // The IP address of network traffic from your on-premises data center. A custom + // AZ receives the network traffic. + // + // Specify this parameter only if ExistingVpnId isn't specified. + VpnTunnelOriginatorIP *string `type:"string"` +} + +// String returns the string representation +func (s CreateCustomAvailabilityZoneInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCustomAvailabilityZoneInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateCustomAvailabilityZoneInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateCustomAvailabilityZoneInput"} + if s.CustomAvailabilityZoneName == nil { + invalidParams.Add(request.NewErrParamRequired("CustomAvailabilityZoneName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCustomAvailabilityZoneName sets the CustomAvailabilityZoneName field's value. +func (s *CreateCustomAvailabilityZoneInput) SetCustomAvailabilityZoneName(v string) *CreateCustomAvailabilityZoneInput { + s.CustomAvailabilityZoneName = &v + return s +} + +// SetExistingVpnId sets the ExistingVpnId field's value. +func (s *CreateCustomAvailabilityZoneInput) SetExistingVpnId(v string) *CreateCustomAvailabilityZoneInput { + s.ExistingVpnId = &v + return s +} + +// SetNewVpnTunnelName sets the NewVpnTunnelName field's value. +func (s *CreateCustomAvailabilityZoneInput) SetNewVpnTunnelName(v string) *CreateCustomAvailabilityZoneInput { + s.NewVpnTunnelName = &v + return s +} + +// SetVpnTunnelOriginatorIP sets the VpnTunnelOriginatorIP field's value. +func (s *CreateCustomAvailabilityZoneInput) SetVpnTunnelOriginatorIP(v string) *CreateCustomAvailabilityZoneInput { + s.VpnTunnelOriginatorIP = &v + return s +} + +type CreateCustomAvailabilityZoneOutput struct { + _ struct{} `type:"structure"` + + // A custom Availability Zone (AZ) is an on-premises AZ that is integrated with + // a VMware vSphere cluster. + // + // For more information about RDS on VMware, see the RDS on VMware User Guide. + // (https://docs.aws.amazon.com/AmazonRDS/latest/RDSonVMwareUserGuide/rds-on-vmware.html) + CustomAvailabilityZone *CustomAvailabilityZone `type:"structure"` +} + +// String returns the string representation +func (s CreateCustomAvailabilityZoneOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCustomAvailabilityZoneOutput) GoString() string { + return s.String() +} + +// SetCustomAvailabilityZone sets the CustomAvailabilityZone field's value. +func (s *CreateCustomAvailabilityZoneOutput) SetCustomAvailabilityZone(v *CustomAvailabilityZone) *CreateCustomAvailabilityZoneOutput { + s.CustomAvailabilityZone = v + return s +} + type CreateDBClusterEndpointInput struct { _ struct{} `type:"structure"` @@ -13599,6 +16244,9 @@ type CreateDBClusterEndpointInput struct { // List of DB instance identifiers that are part of the custom endpoint group. StaticMembers []*string `type:"list"` + + // The tags to be assigned to the Amazon RDS resource. + Tags []*Tag `locationNameList:"Tag" type:"list"` } // String returns the string representation @@ -13660,6 +16308,12 @@ func (s *CreateDBClusterEndpointInput) SetStaticMembers(v []*string) *CreateDBCl return s } +// SetTags sets the Tags field's value. +func (s *CreateDBClusterEndpointInput) SetTags(v []*Tag) *CreateDBClusterEndpointInput { + s.Tags = v + return s +} + // This data type represents the information you need to connect to an Amazon // Aurora DB cluster. This data type is used as a response element in the following // actions: @@ -13837,7 +16491,8 @@ type CreateDBClusterInput struct { 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 is used. + // If you do not specify a value, then the default DB cluster parameter group + // for the specified DB engine and version is used. // // Constraints: // @@ -13853,8 +16508,8 @@ type CreateDBClusterInput struct { // Example: mySubnetgroup DBSubnetGroupName *string `type:"string"` - // The name for your database of up to 64 alpha-numeric characters. If you do - // not provide a name, Amazon RDS will not create a database in the DB cluster + // The name for your database of up to 64 alphanumeric characters. If you do + // not provide a name, Amazon RDS doesn't create a database in the DB cluster // you are creating. DatabaseName *string `type:"string"` @@ -13866,6 +16521,18 @@ type CreateDBClusterInput struct { // DestinationRegion is used for presigning the request to a given region. DestinationRegion *string `type:"string"` + // The Active Directory directory ID to create the DB cluster in. + // + // For Amazon Aurora DB clusters, Amazon RDS can use Kerberos Authentication + // to authenticate users that connect to the DB cluster. For more information, + // see Using Kerberos Authentication for Aurora MySQL (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurmysql-kerberos.html) + // in the Amazon Aurora User Guide. + 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 list of log types that need to be enabled for exporting to CloudWatch // Logs. The values in the list depend on the DB engine being used. For more // information, see Publishing Database Logs to Amazon CloudWatch Logs (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch) @@ -13900,6 +16567,17 @@ type CreateDBClusterInput struct { // The DB engine mode of the DB cluster, either provisioned, serverless, parallelquery, // global, or multimaster. + // + // Limitations and requirements apply to some DB engine modes. For more information, + // see the following sections in the Amazon Aurora User Guide: + // + // * Limitations of Aurora Serverless (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.html#aurora-serverless.limitations) + // + // * Limitations of Parallel Query (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-mysql-parallel-query.html#aurora-mysql-parallel-query-limitations) + // + // * Requirements for Aurora Global Databases (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-global-database.html#aurora-global-database.limitations) + // + // * Limitations of Multi-Master Clusters (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-multi-master.html#aurora-multi-master-limitations) EngineMode *string `type:"string"` // The version number of the database engine to use. @@ -13939,14 +16617,14 @@ type CreateDBClusterInput struct { // 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 an encryption key is not specified in KmsKeyId: + // If an encryption key isn't specified in KmsKeyId: // // * If ReplicationSourceIdentifier identifies an encrypted source, then // Amazon RDS will use the encryption key used to encrypt the source. Otherwise, // Amazon RDS will use your default encryption key. // // * If the StorageEncrypted parameter is enabled and ReplicationSourceIdentifier - // is not specified, then Amazon RDS will use your default encryption key. + // isn't specified, 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. @@ -14014,6 +16692,11 @@ type CreateDBClusterInput struct { // To learn how to generate a Signature Version 4 signed request, see Authenticating // Requests: Using Query Parameters (AWS Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) // and Signature Version 4 Signing Process (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). + // + // If you are using an AWS SDK tool or the AWS CLI, you can specify SourceRegion + // (or --source-region for the AWS CLI) instead of specifying PreSignedUrl manually. + // Specifying SourceRegion autogenerates a pre-signed URL that is a valid request + // for the operation that can be executed in the source AWS Region. PreSignedUrl *string `type:"string"` // The daily time range during which automated backups are created if automated @@ -14166,6 +16849,18 @@ func (s *CreateDBClusterInput) SetDestinationRegion(v string) *CreateDBClusterIn return s } +// SetDomain sets the Domain field's value. +func (s *CreateDBClusterInput) SetDomain(v string) *CreateDBClusterInput { + s.Domain = &v + return s +} + +// SetDomainIAMRoleName sets the DomainIAMRoleName field's value. +func (s *CreateDBClusterInput) SetDomainIAMRoleName(v string) *CreateDBClusterInput { + s.DomainIAMRoleName = &v + return s +} + // SetEnableCloudwatchLogsExports sets the EnableCloudwatchLogsExports field's value. func (s *CreateDBClusterInput) SetEnableCloudwatchLogsExports(v []*string) *CreateDBClusterInput { s.EnableCloudwatchLogsExports = v @@ -14440,7 +17135,7 @@ type CreateDBClusterSnapshotInput struct { _ struct{} `type:"structure"` // The identifier of the DB cluster to create a snapshot for. This parameter - // is not case-sensitive. + // isn't case-sensitive. // // Constraints: // @@ -14628,6 +17323,13 @@ type CreateDBInstanceInput struct { // Constraint: The AvailabilityZone parameter can't be specified if the DB instance // is a Multi-AZ deployment. The specified Availability Zone must be in the // same AWS Region as the current endpoint. + // + // If you're creating a DB instance in an RDS on VMware environment, specify + // the identifier of the custom Availability Zone to create the DB instance + // in. + // + // For more information about RDS on VMware, see the RDS on VMware User Guide. + // (https://docs.aws.amazon.com/AmazonRDS/latest/RDSonVMwareUserGuide/rds-on-vmware.html) AvailabilityZone *string `type:"string"` // The number of days for which automated backups are retained. Setting this @@ -14699,7 +17401,7 @@ type CreateDBInstanceInput struct { // 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. + // parameter isn't specified, no database is created in the DB instance. // // Constraints: // @@ -14710,7 +17412,7 @@ type CreateDBInstanceInput struct { // 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. + // parameter isn't specified, no database is created in the DB instance. // // Constraints: // @@ -14721,7 +17423,7 @@ type CreateDBInstanceInput struct { // 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 + // parameter isn't specified, the default "postgres" database is created in // the DB instance. // // Constraints: @@ -14752,7 +17454,7 @@ type CreateDBInstanceInput struct { // 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 + // is created. If this parameter isn't specified, no database is created in // the DB instance. // // Constraints: @@ -14763,8 +17465,8 @@ type CreateDBInstanceInput struct { DBName *string `type:"string"` // The name of the DB parameter group to associate with this DB instance. If - // you do not specify a value for DBParameterGroupName, then the default DBParameterGroup - // for the specified DB engine is used. + // you do not specify a value, then the default DB parameter group for the specified + // DB engine and version is used. // // Constraints: // @@ -14789,6 +17491,13 @@ type CreateDBInstanceInput struct { // The database can't be deleted when deletion protection is enabled. By default, // deletion protection is disabled. For more information, see Deleting a DB // Instance (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_DeleteInstance.html). + // + // Amazon Aurora + // + // Not applicable. You can enable or disable deletion protection for the DB + // cluster. For more information, see CreateDBCluster. DB instances in a DB + // cluster can be deleted even when deletion protection is enabled for the DB + // cluster. DeletionProtection *bool `type:"boolean"` // The Active Directory directory ID to create the DB instance in. Currently, @@ -14936,8 +17645,10 @@ type CreateDBInstanceInput struct { // values, see Amazon RDS Provisioned IOPS Storage to Improve Performance (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Storage.html#USER_PIOPS) // in the Amazon RDS User Guide. // - // Constraints: Must be a multiple between 1 and 50 of the storage amount for - // the DB instance. + // Constraints: For MariaDB, MySQL, Oracle, and PostgreSQL DB instances, must + // be a multiple between .5 and 50 of the storage amount for the DB instance. + // For SQL Server DB instances, must be a multiple between 1 and 50 of the storage + // amount for the DB instance. Iops *int64 `type:"integer"` // The AWS KMS key identifier for an encrypted DB instance. @@ -15089,7 +17800,7 @@ type CreateDBInstanceInput struct { // group. // // Permanent options, such as the TDE option for Oracle Advanced Security TDE, - // can't be removed from an option group, and that option group can't be removed + // can't be removed from an option group. Also, that option group can't be removed // from a DB instance once it is associated with a DB instance OptionGroupName *string `type:"string"` @@ -15212,13 +17923,13 @@ type CreateDBInstanceInput struct { // A value that indicates whether the DB instance is publicly accessible. When // the DB instance is publicly accessible, it is an Internet-facing instance // with a publicly resolvable DNS name, which resolves to a public IP address. - // When the DB instance is not publicly accessible, it is an internal instance + // When the DB instance isn't publicly accessible, it is an internal instance // with a DNS name that resolves to a private IP address. // // Default: The default behavior varies depending on whether DBSubnetGroupName // is specified. // - // If DBSubnetGroupName is not specified, and PubliclyAccessible is not specified, + // If DBSubnetGroupName isn't specified, and PubliclyAccessible isn't specified, // the following applies: // // * If the default VPC in the target region doesn’t have an Internet gateway @@ -15227,7 +17938,7 @@ type CreateDBInstanceInput struct { // * If the default VPC in the target region has an Internet gateway attached // to it, the DB instance is public. // - // If DBSubnetGroupName is specified, and PubliclyAccessible is not specified, + // If DBSubnetGroupName is specified, and PubliclyAccessible isn't specified, // the following applies: // // * If the subnets are part of a VPC that doesn’t have an Internet gateway @@ -15238,7 +17949,7 @@ type CreateDBInstanceInput struct { PubliclyAccessible *bool `type:"boolean"` // A value that indicates whether the DB instance is encrypted. By default, - // it is not encrypted. + // it isn't encrypted. // // Amazon Aurora // @@ -15653,6 +18364,9 @@ type CreateDBInstanceReadReplicaInput struct { // or the default DBParameterGroup for the specified DB engine for a cross region // Read Replica. // + // Currently, specifying a parameter group for this operation is only supported + // for Oracle DB instances. + // // Constraints: // // * Must be 1 to 255 letters, numbers, or hyphens. @@ -15664,7 +18378,7 @@ type CreateDBInstanceReadReplicaInput struct { // Specifies a DB subnet group for the DB instance. The new DB instance is 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. + // specified, then the new DB instance isn't created in a VPC. // // Constraints: // @@ -15804,9 +18518,8 @@ type CreateDBInstanceReadReplicaInput struct { // API action in the source AWS Region that contains the source DB instance. // // You must specify this parameter when you create an encrypted Read Replica - // from another AWS Region by using the Amazon RDS API. You can specify the - // --source-region option instead of this parameter when you create an encrypted - // Read Replica from another AWS Region by using the AWS CLI. + // from another AWS Region by using the Amazon RDS API. Don't specify PreSignedUrl + // when you are creating an encrypted Read Replica in the same AWS Region. // // The presigned URL must be a valid request for the CreateDBInstanceReadReplica // API action that can be executed in the source AWS Region that contains the @@ -15838,6 +18551,11 @@ type CreateDBInstanceReadReplicaInput struct { // To learn how to generate a Signature Version 4 signed request, see Authenticating // Requests: Using Query Parameters (AWS Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html) // and Signature Version 4 Signing Process (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). + // + // If you are using an AWS SDK tool or the AWS CLI, you can specify SourceRegion + // (or --source-region for the AWS CLI) instead of specifying PreSignedUrl manually. + // Specifying SourceRegion autogenerates a pre-signed URL that is a valid request + // for the operation that can be executed in the source AWS Region. PreSignedUrl *string `type:"string"` // The number of CPU cores and the number of threads per core for the DB instance @@ -15847,7 +18565,7 @@ type CreateDBInstanceReadReplicaInput struct { // A value that indicates whether the DB instance is publicly accessible. When // the DB instance is publicly accessible, it is an Internet-facing instance // with a publicly resolvable DNS name, which resolves to a public IP address. - // When the DB instance is not publicly accessible, it is an internal instance + // When the DB instance isn't publicly accessible, it is an internal instance // with a DNS name that resolves to a private IP address. For more information, // see CreateDBInstance. PubliclyAccessible *bool `type:"boolean"` @@ -16277,6 +18995,186 @@ func (s *CreateDBParameterGroupOutput) SetDBParameterGroup(v *DBParameterGroup) return s } +type CreateDBProxyInput struct { + _ struct{} `type:"structure"` + + // The authorization mechanism that the proxy uses. + // + // Auth is a required field + Auth []*UserAuthConfig `type:"list" required:"true"` + + // The identifier for the proxy. This name must be unique for all proxies owned + // by your AWS account in the specified AWS Region. An identifier must begin + // with a letter and must contain only ASCII letters, digits, and hyphens; it + // can't end with a hyphen or contain two consecutive hyphens. + // + // DBProxyName is a required field + DBProxyName *string `type:"string" required:"true"` + + // Whether the proxy includes detailed information about SQL statements in its + // logs. This information helps you to debug issues involving SQL behavior or + // the performance and scalability of the proxy connections. The debug information + // includes the text of SQL statements that you submit through the proxy. Thus, + // only enable this setting when needed for debugging, and only when you have + // security measures in place to safeguard any sensitive information that appears + // in the logs. + DebugLogging *bool `type:"boolean"` + + // The kinds of databases that the proxy can connect to. This value determines + // which database network protocol the proxy recognizes when it interprets network + // traffic to and from the database. Currently, this value is always MYSQL. + // The engine family applies to both RDS MySQL and Aurora MySQL. + // + // EngineFamily is a required field + EngineFamily *string `type:"string" required:"true" enum:"EngineFamily"` + + // The number of seconds that a connection to the proxy can be inactive before + // the proxy disconnects it. You can set this value higher or lower than the + // connection timeout limit for the associated database. + IdleClientTimeout *int64 `type:"integer"` + + // A Boolean parameter that specifies whether Transport Layer Security (TLS) + // encryption is required for connections to the proxy. By enabling this setting, + // you can enforce encrypted TLS connections to the proxy. + RequireTLS *bool `type:"boolean"` + + // The Amazon Resource Name (ARN) of the IAM role that the proxy uses to access + // secrets in AWS Secrets Manager. + // + // RoleArn is a required field + RoleArn *string `type:"string" required:"true"` + + // An optional set of key-value pairs to associate arbitrary data of your choosing + // with the proxy. + Tags []*Tag `locationNameList:"Tag" type:"list"` + + // One or more VPC security group IDs to associate with the new proxy. + VpcSecurityGroupIds []*string `type:"list"` + + // One or more VPC subnet IDs to associate with the new proxy. + // + // VpcSubnetIds is a required field + VpcSubnetIds []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s CreateDBProxyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDBProxyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateDBProxyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateDBProxyInput"} + if s.Auth == nil { + invalidParams.Add(request.NewErrParamRequired("Auth")) + } + if s.DBProxyName == nil { + invalidParams.Add(request.NewErrParamRequired("DBProxyName")) + } + if s.EngineFamily == nil { + invalidParams.Add(request.NewErrParamRequired("EngineFamily")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.VpcSubnetIds == nil { + invalidParams.Add(request.NewErrParamRequired("VpcSubnetIds")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuth sets the Auth field's value. +func (s *CreateDBProxyInput) SetAuth(v []*UserAuthConfig) *CreateDBProxyInput { + s.Auth = v + return s +} + +// SetDBProxyName sets the DBProxyName field's value. +func (s *CreateDBProxyInput) SetDBProxyName(v string) *CreateDBProxyInput { + s.DBProxyName = &v + return s +} + +// SetDebugLogging sets the DebugLogging field's value. +func (s *CreateDBProxyInput) SetDebugLogging(v bool) *CreateDBProxyInput { + s.DebugLogging = &v + return s +} + +// SetEngineFamily sets the EngineFamily field's value. +func (s *CreateDBProxyInput) SetEngineFamily(v string) *CreateDBProxyInput { + s.EngineFamily = &v + return s +} + +// SetIdleClientTimeout sets the IdleClientTimeout field's value. +func (s *CreateDBProxyInput) SetIdleClientTimeout(v int64) *CreateDBProxyInput { + s.IdleClientTimeout = &v + return s +} + +// SetRequireTLS sets the RequireTLS field's value. +func (s *CreateDBProxyInput) SetRequireTLS(v bool) *CreateDBProxyInput { + s.RequireTLS = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *CreateDBProxyInput) SetRoleArn(v string) *CreateDBProxyInput { + s.RoleArn = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateDBProxyInput) SetTags(v []*Tag) *CreateDBProxyInput { + s.Tags = v + return s +} + +// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. +func (s *CreateDBProxyInput) SetVpcSecurityGroupIds(v []*string) *CreateDBProxyInput { + s.VpcSecurityGroupIds = v + return s +} + +// SetVpcSubnetIds sets the VpcSubnetIds field's value. +func (s *CreateDBProxyInput) SetVpcSubnetIds(v []*string) *CreateDBProxyInput { + s.VpcSubnetIds = v + return s +} + +type CreateDBProxyOutput struct { + _ struct{} `type:"structure"` + + // The DBProxy structure corresponding to the new proxy. + DBProxy *DBProxy `type:"structure"` +} + +// String returns the string representation +func (s CreateDBProxyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateDBProxyOutput) GoString() string { + return s.String() +} + +// SetDBProxy sets the DBProxy field's value. +func (s *CreateDBProxyOutput) SetDBProxy(v *DBProxy) *CreateDBProxyOutput { + s.DBProxy = v + return s +} + type CreateDBSecurityGroupInput struct { _ struct{} `type:"structure"` @@ -16589,7 +19487,7 @@ type CreateEventSubscriptionInput struct { _ struct{} `type:"structure"` // A value that indicates whether to activate the subscription. If the event - // notification subscription is not activated, the subscription is created but + // notification subscription isn't activated, the subscription is created but // not active. Enabled *bool `type:"boolean"` @@ -16610,7 +19508,7 @@ type CreateEventSubscriptionInput struct { // The list of identifiers of the event sources for which events are 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 can't end with a hyphen or contain two consecutive hyphens. + // hyphens. It can't end with a hyphen or contain two consecutive hyphens. // // Constraints: // @@ -16631,7 +19529,7 @@ type CreateEventSubscriptionInput struct { // The type of source that is 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. + // to db-instance. if this value isn't specified, all events are returned. // // Valid values: db-instance | db-cluster | db-parameter-group | db-security-group // | db-snapshot | db-cluster-snapshot @@ -16968,6 +19866,64 @@ func (s *CreateOptionGroupOutput) SetOptionGroup(v *OptionGroup) *CreateOptionGr return s } +// A custom Availability Zone (AZ) is an on-premises AZ that is integrated with +// a VMware vSphere cluster. +// +// For more information about RDS on VMware, see the RDS on VMware User Guide. +// (https://docs.aws.amazon.com/AmazonRDS/latest/RDSonVMwareUserGuide/rds-on-vmware.html) +type CustomAvailabilityZone struct { + _ struct{} `type:"structure"` + + // The identifier of the custom AZ. + // + // Amazon RDS generates a unique identifier when a custom AZ is created. + CustomAvailabilityZoneId *string `type:"string"` + + // The name of the custom AZ. + CustomAvailabilityZoneName *string `type:"string"` + + // The status of the custom AZ. + CustomAvailabilityZoneStatus *string `type:"string"` + + // Information about the virtual private network (VPN) between the VMware vSphere + // cluster and the AWS website. + VpnDetails *VpnDetails `type:"structure"` +} + +// String returns the string representation +func (s CustomAvailabilityZone) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CustomAvailabilityZone) GoString() string { + return s.String() +} + +// SetCustomAvailabilityZoneId sets the CustomAvailabilityZoneId field's value. +func (s *CustomAvailabilityZone) SetCustomAvailabilityZoneId(v string) *CustomAvailabilityZone { + s.CustomAvailabilityZoneId = &v + return s +} + +// SetCustomAvailabilityZoneName sets the CustomAvailabilityZoneName field's value. +func (s *CustomAvailabilityZone) SetCustomAvailabilityZoneName(v string) *CustomAvailabilityZone { + s.CustomAvailabilityZoneName = &v + return s +} + +// SetCustomAvailabilityZoneStatus sets the CustomAvailabilityZoneStatus field's value. +func (s *CustomAvailabilityZone) SetCustomAvailabilityZoneStatus(v string) *CustomAvailabilityZone { + s.CustomAvailabilityZoneStatus = &v + return s +} + +// SetVpnDetails sets the VpnDetails field's value. +func (s *CustomAvailabilityZone) SetVpnDetails(v *VpnDetails) *CustomAvailabilityZone { + s.VpnDetails = v + return s +} + // Contains the details of an Amazon Aurora DB cluster. // // This data type is used as a response element in the DescribeDBClusters, StopDBCluster, @@ -16993,7 +19949,7 @@ type DBCluster struct { // For all database engines except Amazon Aurora, AllocatedStorage specifies // the allocated storage size in gibibytes (GiB). For Aurora, AllocatedStorage - // always returns 1, because Aurora DB cluster storage size is not fixed, but + // always returns 1, because Aurora DB cluster storage size isn't fixed, but // instead automatically adjusts as needed. AllocatedStorage *int64 `type:"integer"` @@ -17081,6 +20037,9 @@ type DBCluster struct { // can't be deleted when deletion protection is enabled. DeletionProtection *bool `type:"boolean"` + // The Active Directory Domain membership records associated with the DB cluster. + DomainMemberships []*DomainMembership `locationNameList:"DomainMembership" type:"list"` + // The earliest time to which a DB cluster can be backtracked. EarliestBacktrackTime *time.Time `type:"timestamp"` @@ -17359,6 +20318,12 @@ func (s *DBCluster) SetDeletionProtection(v bool) *DBCluster { return s } +// SetDomainMemberships sets the DomainMemberships field's value. +func (s *DBCluster) SetDomainMemberships(v []*DomainMembership) *DBCluster { + s.DomainMemberships = v + return s +} + // SetEarliestBacktrackTime sets the EarliestBacktrackTime field's value. func (s *DBCluster) SetEarliestBacktrackTime(v time.Time) *DBCluster { s.EarliestBacktrackTime = &v @@ -18173,7 +21138,7 @@ type DBEngineVersion struct { 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. + // CharacterSetName parameter of the CreateDBInstance API isn't specified. DefaultCharacterSet *CharacterSet `type:"structure"` // The name of the database engine. @@ -18556,7 +21521,7 @@ type DBInstance struct { // instance with multi-AZ support. SecondaryAvailabilityZone *string `type:"string"` - // The status of a Read Replica. If the instance is not a Read Replica, this + // The status of a Read Replica. If the instance isn't a Read Replica, this // is blank. StatusInfos []*DBInstanceStatusInfo `locationNameList:"DBInstanceStatusInfo" type:"list"` @@ -19244,7 +22209,7 @@ 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. + // isn't 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 @@ -19421,6 +22386,359 @@ func (s *DBParameterGroupStatus) SetParameterApplyStatus(v string) *DBParameterG return s } +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// The data structure representing a proxy managed by the RDS Proxy. +// +// This data type is used as a response element in the DescribeDBProxies action. +type DBProxy struct { + _ struct{} `type:"structure"` + + // One or more data structures specifying the authorization mechanism to connect + // to the associated RDS DB instance or Aurora DB cluster. + Auth []*UserAuthConfigInfo `type:"list"` + + // The date and time when the proxy was first created. + CreatedDate *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) for the proxy. + DBProxyArn *string `type:"string"` + + // The identifier for the proxy. This name must be unique for all proxies owned + // by your AWS account in the specified AWS Region. + DBProxyName *string `type:"string"` + + // Whether the proxy includes detailed information about SQL statements in its + // logs. This information helps you to debug issues involving SQL behavior or + // the performance and scalability of the proxy connections. The debug information + // includes the text of SQL statements that you submit through the proxy. Thus, + // only enable this setting when needed for debugging, and only when you have + // security measures in place to safeguard any sensitive information that appears + // in the logs. + DebugLogging *bool `type:"boolean"` + + // The endpoint that you can use to connect to the proxy. You include the endpoint + // value in the connection string for a database client application. + Endpoint *string `type:"string"` + + // Currently, this value is always MYSQL. The engine family applies to both + // RDS MySQL and Aurora MySQL. + EngineFamily *string `type:"string"` + + // The number of seconds a connection to the proxy can have no activity before + // the proxy drops the client connection. The proxy keeps the underlying database + // connection open and puts it back into the connection pool for reuse by later + // connection requests. + // + // Default: 1800 (30 minutes) + // + // Constraints: 1 to 28,800 + IdleClientTimeout *int64 `type:"integer"` + + // Indicates whether Transport Layer Security (TLS) encryption is required for + // connections to the proxy. + RequireTLS *bool `type:"boolean"` + + // The Amazon Resource Name (ARN) for the IAM role that the proxy uses to access + // Amazon Secrets Manager. + RoleArn *string `type:"string"` + + // The current status of this proxy. A status of available means the proxy is + // ready to handle requests. Other values indicate that you must wait for the + // proxy to be ready, or take some action to resolve an issue. + Status *string `type:"string" enum:"DBProxyStatus"` + + // The date and time when the proxy was last updated. + UpdatedDate *time.Time `type:"timestamp"` + + // Provides a list of VPC security groups that the proxy belongs to. + VpcSecurityGroupIds []*string `type:"list"` + + // The EC2 subnet IDs for the proxy. + VpcSubnetIds []*string `type:"list"` +} + +// String returns the string representation +func (s DBProxy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DBProxy) GoString() string { + return s.String() +} + +// SetAuth sets the Auth field's value. +func (s *DBProxy) SetAuth(v []*UserAuthConfigInfo) *DBProxy { + s.Auth = v + return s +} + +// SetCreatedDate sets the CreatedDate field's value. +func (s *DBProxy) SetCreatedDate(v time.Time) *DBProxy { + s.CreatedDate = &v + return s +} + +// SetDBProxyArn sets the DBProxyArn field's value. +func (s *DBProxy) SetDBProxyArn(v string) *DBProxy { + s.DBProxyArn = &v + return s +} + +// SetDBProxyName sets the DBProxyName field's value. +func (s *DBProxy) SetDBProxyName(v string) *DBProxy { + s.DBProxyName = &v + return s +} + +// SetDebugLogging sets the DebugLogging field's value. +func (s *DBProxy) SetDebugLogging(v bool) *DBProxy { + s.DebugLogging = &v + return s +} + +// SetEndpoint sets the Endpoint field's value. +func (s *DBProxy) SetEndpoint(v string) *DBProxy { + s.Endpoint = &v + return s +} + +// SetEngineFamily sets the EngineFamily field's value. +func (s *DBProxy) SetEngineFamily(v string) *DBProxy { + s.EngineFamily = &v + return s +} + +// SetIdleClientTimeout sets the IdleClientTimeout field's value. +func (s *DBProxy) SetIdleClientTimeout(v int64) *DBProxy { + s.IdleClientTimeout = &v + return s +} + +// SetRequireTLS sets the RequireTLS field's value. +func (s *DBProxy) SetRequireTLS(v bool) *DBProxy { + s.RequireTLS = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *DBProxy) SetRoleArn(v string) *DBProxy { + s.RoleArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DBProxy) SetStatus(v string) *DBProxy { + s.Status = &v + return s +} + +// SetUpdatedDate sets the UpdatedDate field's value. +func (s *DBProxy) SetUpdatedDate(v time.Time) *DBProxy { + s.UpdatedDate = &v + return s +} + +// SetVpcSecurityGroupIds sets the VpcSecurityGroupIds field's value. +func (s *DBProxy) SetVpcSecurityGroupIds(v []*string) *DBProxy { + s.VpcSecurityGroupIds = v + return s +} + +// SetVpcSubnetIds sets the VpcSubnetIds field's value. +func (s *DBProxy) SetVpcSubnetIds(v []*string) *DBProxy { + s.VpcSubnetIds = v + return s +} + +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// Contains the details for an RDS Proxy target. It represents an RDS DB instance +// or Aurora DB cluster that the proxy can connect to. One or more targets are +// associated with an RDS Proxy target group. +// +// This data type is used as a response element in the DescribeDBProxyTargets +// action. +type DBProxyTarget struct { + _ struct{} `type:"structure"` + + // The writer endpoint for the RDS DB instance or Aurora DB cluster. + Endpoint *string `type:"string"` + + // The port that the RDS Proxy uses to connect to the target RDS DB instance + // or Aurora DB cluster. + Port *int64 `type:"integer"` + + // The identifier representing the target. It can be the instance identifier + // for an RDS DB instance, or the cluster identifier for an Aurora DB cluster. + RdsResourceId *string `type:"string"` + + // The Amazon Resource Name (ARN) for the RDS DB instance or Aurora DB cluster. + TargetArn *string `type:"string"` + + // The DB cluster identifier when the target represents an Aurora DB cluster. + // This field is blank when the target represents an RDS DB instance. + TrackedClusterId *string `type:"string"` + + // Specifies the kind of database, such as an RDS DB instance or an Aurora DB + // cluster, that the target represents. + Type *string `type:"string" enum:"TargetType"` +} + +// String returns the string representation +func (s DBProxyTarget) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DBProxyTarget) GoString() string { + return s.String() +} + +// SetEndpoint sets the Endpoint field's value. +func (s *DBProxyTarget) SetEndpoint(v string) *DBProxyTarget { + s.Endpoint = &v + return s +} + +// SetPort sets the Port field's value. +func (s *DBProxyTarget) SetPort(v int64) *DBProxyTarget { + s.Port = &v + return s +} + +// SetRdsResourceId sets the RdsResourceId field's value. +func (s *DBProxyTarget) SetRdsResourceId(v string) *DBProxyTarget { + s.RdsResourceId = &v + return s +} + +// SetTargetArn sets the TargetArn field's value. +func (s *DBProxyTarget) SetTargetArn(v string) *DBProxyTarget { + s.TargetArn = &v + return s +} + +// SetTrackedClusterId sets the TrackedClusterId field's value. +func (s *DBProxyTarget) SetTrackedClusterId(v string) *DBProxyTarget { + s.TrackedClusterId = &v + return s +} + +// SetType sets the Type field's value. +func (s *DBProxyTarget) SetType(v string) *DBProxyTarget { + s.Type = &v + return s +} + +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// Represents a set of RDS DB instances, Aurora DB clusters, or both that a +// proxy can connect to. Currently, each target group is associated with exactly +// one RDS DB instance or Aurora DB cluster. +// +// This data type is used as a response element in the DescribeDBProxyTargetGroups +// action. +type DBProxyTargetGroup struct { + _ struct{} `type:"structure"` + + // The settings that determine the size and behavior of the connection pool + // for the target group. + ConnectionPoolConfig *ConnectionPoolConfigurationInfo `type:"structure"` + + // The date and time when the target group was first created. + CreatedDate *time.Time `type:"timestamp"` + + // The identifier for the RDS proxy associated with this target group. + DBProxyName *string `type:"string"` + + // Whether this target group is the first one used for connection requests by + // the associated proxy. Because each proxy is currently associated with a single + // target group, currently this setting is always true. + IsDefault *bool `type:"boolean"` + + // The current status of this target group. A status of available means the + // target group is correctly associated with a database. Other values indicate + // that you must wait for the target group to be ready, or take some action + // to resolve an issue. + Status *string `type:"string"` + + // The Amazon Resource Name (ARN) representing the target group. + TargetGroupArn *string `type:"string"` + + // The identifier for the target group. This name must be unique for all target + // groups owned by your AWS account in the specified AWS Region. + TargetGroupName *string `type:"string"` + + // The date and time when the target group was last updated. + UpdatedDate *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s DBProxyTargetGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DBProxyTargetGroup) GoString() string { + return s.String() +} + +// SetConnectionPoolConfig sets the ConnectionPoolConfig field's value. +func (s *DBProxyTargetGroup) SetConnectionPoolConfig(v *ConnectionPoolConfigurationInfo) *DBProxyTargetGroup { + s.ConnectionPoolConfig = v + return s +} + +// SetCreatedDate sets the CreatedDate field's value. +func (s *DBProxyTargetGroup) SetCreatedDate(v time.Time) *DBProxyTargetGroup { + s.CreatedDate = &v + return s +} + +// SetDBProxyName sets the DBProxyName field's value. +func (s *DBProxyTargetGroup) SetDBProxyName(v string) *DBProxyTargetGroup { + s.DBProxyName = &v + return s +} + +// SetIsDefault sets the IsDefault field's value. +func (s *DBProxyTargetGroup) SetIsDefault(v bool) *DBProxyTargetGroup { + s.IsDefault = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DBProxyTargetGroup) SetStatus(v string) *DBProxyTargetGroup { + s.Status = &v + return s +} + +// SetTargetGroupArn sets the TargetGroupArn field's value. +func (s *DBProxyTargetGroup) SetTargetGroupArn(v string) *DBProxyTargetGroup { + s.TargetGroupArn = &v + return s +} + +// SetTargetGroupName sets the TargetGroupName field's value. +func (s *DBProxyTargetGroup) SetTargetGroupName(v string) *DBProxyTargetGroup { + s.TargetGroupName = &v + return s +} + +// SetUpdatedDate sets the UpdatedDate field's value. +func (s *DBProxyTargetGroup) SetUpdatedDate(v time.Time) *DBProxyTargetGroup { + s.UpdatedDate = &v + return s +} + // Contains the details for an Amazon RDS DB security group. // // This data type is used as a response element in the DescribeDBSecurityGroups @@ -19980,6 +23298,71 @@ func (s *DBSubnetGroup) SetVpcId(v string) *DBSubnetGroup { return s } +type DeleteCustomAvailabilityZoneInput struct { + _ struct{} `type:"structure"` + + // The custom AZ identifier. + // + // CustomAvailabilityZoneId is a required field + CustomAvailabilityZoneId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteCustomAvailabilityZoneInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCustomAvailabilityZoneInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteCustomAvailabilityZoneInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteCustomAvailabilityZoneInput"} + if s.CustomAvailabilityZoneId == nil { + invalidParams.Add(request.NewErrParamRequired("CustomAvailabilityZoneId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCustomAvailabilityZoneId sets the CustomAvailabilityZoneId field's value. +func (s *DeleteCustomAvailabilityZoneInput) SetCustomAvailabilityZoneId(v string) *DeleteCustomAvailabilityZoneInput { + s.CustomAvailabilityZoneId = &v + return s +} + +type DeleteCustomAvailabilityZoneOutput struct { + _ struct{} `type:"structure"` + + // A custom Availability Zone (AZ) is an on-premises AZ that is integrated with + // a VMware vSphere cluster. + // + // For more information about RDS on VMware, see the RDS on VMware User Guide. + // (https://docs.aws.amazon.com/AmazonRDS/latest/RDSonVMwareUserGuide/rds-on-vmware.html) + CustomAvailabilityZone *CustomAvailabilityZone `type:"structure"` +} + +// String returns the string representation +func (s DeleteCustomAvailabilityZoneOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCustomAvailabilityZoneOutput) GoString() string { + return s.String() +} + +// SetCustomAvailabilityZone sets the CustomAvailabilityZone field's value. +func (s *DeleteCustomAvailabilityZoneOutput) SetCustomAvailabilityZone(v *CustomAvailabilityZone) *DeleteCustomAvailabilityZoneOutput { + s.CustomAvailabilityZone = v + return s +} + type DeleteDBClusterEndpointInput struct { _ struct{} `type:"structure"` @@ -20173,9 +23556,9 @@ type DeleteDBClusterInput struct { // A value that indicates whether to skip the creation of a final DB cluster // snapshot before the DB cluster is deleted. If skip is specified, no DB cluster - // snapshot is created. If skip is not specified, a DB cluster snapshot is created - // before the DB cluster is deleted. By default, skip is not specified, and - // the DB cluster snapshot is created. By default, this parameter is disabled. + // snapshot is created. If skip isn't specified, a DB cluster snapshot is created + // before the DB cluster is deleted. By default, skip isn't specified, and the + // DB cluster snapshot is created. By default, this parameter is disabled. // // You must specify a FinalDBSnapshotIdentifier parameter if SkipFinalSnapshot // is disabled. @@ -20478,18 +23861,16 @@ type DeleteDBInstanceInput struct { // A value that indicates whether to skip the creation of a final DB snapshot // before the DB instance is deleted. If skip is specified, no DB snapshot is - // created. If skip is not specified, a DB snapshot is created before the DB - // instance is deleted. By default, skip is not specified, and the DB snapshot + // created. If skip isn't specified, a DB snapshot is created before the DB + // instance is deleted. By default, skip isn't specified, and the DB snapshot // is created. // - // 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 skip is specified. + // 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 skip is specified. // // Specify skip when deleting a Read Replica. // - // The FinalDBSnapshotIdentifier parameter must be specified if skip is not - // specified. + // The FinalDBSnapshotIdentifier parameter must be specified if skip isn't specified. SkipFinalSnapshot *bool `type:"boolean"` } @@ -20625,6 +24006,67 @@ func (s DeleteDBParameterGroupOutput) GoString() string { return s.String() } +type DeleteDBProxyInput struct { + _ struct{} `type:"structure"` + + // The name of the DB proxy to delete. + // + // DBProxyName is a required field + DBProxyName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteDBProxyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDBProxyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteDBProxyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteDBProxyInput"} + if s.DBProxyName == nil { + invalidParams.Add(request.NewErrParamRequired("DBProxyName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDBProxyName sets the DBProxyName field's value. +func (s *DeleteDBProxyInput) SetDBProxyName(v string) *DeleteDBProxyInput { + s.DBProxyName = &v + return s +} + +type DeleteDBProxyOutput struct { + _ struct{} `type:"structure"` + + // The data structure representing the details of the DB proxy that you delete. + DBProxy *DBProxy `type:"structure"` +} + +// String returns the string representation +func (s DeleteDBProxyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteDBProxyOutput) GoString() string { + return s.String() +} + +// SetDBProxy sets the DBProxy field's value. +func (s *DeleteDBProxyOutput) SetDBProxy(v *DBProxy) *DeleteDBProxyOutput { + s.DBProxy = v + return s +} + type DeleteDBSecurityGroupInput struct { _ struct{} `type:"structure"` @@ -20939,6 +24381,133 @@ func (s *DeleteGlobalClusterOutput) SetGlobalCluster(v *GlobalCluster) *DeleteGl return s } +type DeleteInstallationMediaInput struct { + _ struct{} `type:"structure"` + + // The installation medium ID. + // + // InstallationMediaId is a required field + InstallationMediaId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteInstallationMediaInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteInstallationMediaInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteInstallationMediaInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteInstallationMediaInput"} + if s.InstallationMediaId == nil { + invalidParams.Add(request.NewErrParamRequired("InstallationMediaId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInstallationMediaId sets the InstallationMediaId field's value. +func (s *DeleteInstallationMediaInput) SetInstallationMediaId(v string) *DeleteInstallationMediaInput { + s.InstallationMediaId = &v + return s +} + +// Contains the installation media for a DB engine that requires an on-premises +// customer provided license, such as Microsoft SQL Server. +type DeleteInstallationMediaOutput struct { + _ struct{} `type:"structure"` + + // The custom Availability Zone (AZ) that contains the installation media. + CustomAvailabilityZoneId *string `type:"string"` + + // The DB engine. + Engine *string `type:"string"` + + // The path to the installation medium for the DB engine. + EngineInstallationMediaPath *string `type:"string"` + + // The engine version of the DB engine. + EngineVersion *string `type:"string"` + + // If an installation media failure occurred, the cause of the failure. + FailureCause *InstallationMediaFailureCause `type:"structure"` + + // The installation medium ID. + InstallationMediaId *string `type:"string"` + + // The path to the installation medium for the operating system associated with + // the DB engine. + OSInstallationMediaPath *string `type:"string"` + + // The status of the installation medium. + Status *string `type:"string"` +} + +// String returns the string representation +func (s DeleteInstallationMediaOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteInstallationMediaOutput) GoString() string { + return s.String() +} + +// SetCustomAvailabilityZoneId sets the CustomAvailabilityZoneId field's value. +func (s *DeleteInstallationMediaOutput) SetCustomAvailabilityZoneId(v string) *DeleteInstallationMediaOutput { + s.CustomAvailabilityZoneId = &v + return s +} + +// SetEngine sets the Engine field's value. +func (s *DeleteInstallationMediaOutput) SetEngine(v string) *DeleteInstallationMediaOutput { + s.Engine = &v + return s +} + +// SetEngineInstallationMediaPath sets the EngineInstallationMediaPath field's value. +func (s *DeleteInstallationMediaOutput) SetEngineInstallationMediaPath(v string) *DeleteInstallationMediaOutput { + s.EngineInstallationMediaPath = &v + return s +} + +// SetEngineVersion sets the EngineVersion field's value. +func (s *DeleteInstallationMediaOutput) SetEngineVersion(v string) *DeleteInstallationMediaOutput { + s.EngineVersion = &v + return s +} + +// SetFailureCause sets the FailureCause field's value. +func (s *DeleteInstallationMediaOutput) SetFailureCause(v *InstallationMediaFailureCause) *DeleteInstallationMediaOutput { + s.FailureCause = v + return s +} + +// SetInstallationMediaId sets the InstallationMediaId field's value. +func (s *DeleteInstallationMediaOutput) SetInstallationMediaId(v string) *DeleteInstallationMediaOutput { + s.InstallationMediaId = &v + return s +} + +// SetOSInstallationMediaPath sets the OSInstallationMediaPath field's value. +func (s *DeleteInstallationMediaOutput) SetOSInstallationMediaPath(v string) *DeleteInstallationMediaOutput { + s.OSInstallationMediaPath = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DeleteInstallationMediaOutput) SetStatus(v string) *DeleteInstallationMediaOutput { + s.Status = &v + return s +} + type DeleteOptionGroupInput struct { _ struct{} `type:"structure"` @@ -20993,6 +24562,85 @@ func (s DeleteOptionGroupOutput) GoString() string { return s.String() } +type DeregisterDBProxyTargetsInput struct { + _ struct{} `type:"structure"` + + // One or more DB cluster identifiers. + DBClusterIdentifiers []*string `type:"list"` + + // One or more DB instance identifiers. + DBInstanceIdentifiers []*string `type:"list"` + + // The identifier of the DBProxy that is associated with the DBProxyTargetGroup. + // + // DBProxyName is a required field + DBProxyName *string `type:"string" required:"true"` + + // The identifier of the DBProxyTargetGroup. + TargetGroupName *string `type:"string"` +} + +// String returns the string representation +func (s DeregisterDBProxyTargetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeregisterDBProxyTargetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeregisterDBProxyTargetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeregisterDBProxyTargetsInput"} + if s.DBProxyName == nil { + invalidParams.Add(request.NewErrParamRequired("DBProxyName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDBClusterIdentifiers sets the DBClusterIdentifiers field's value. +func (s *DeregisterDBProxyTargetsInput) SetDBClusterIdentifiers(v []*string) *DeregisterDBProxyTargetsInput { + s.DBClusterIdentifiers = v + return s +} + +// SetDBInstanceIdentifiers sets the DBInstanceIdentifiers field's value. +func (s *DeregisterDBProxyTargetsInput) SetDBInstanceIdentifiers(v []*string) *DeregisterDBProxyTargetsInput { + s.DBInstanceIdentifiers = v + return s +} + +// SetDBProxyName sets the DBProxyName field's value. +func (s *DeregisterDBProxyTargetsInput) SetDBProxyName(v string) *DeregisterDBProxyTargetsInput { + s.DBProxyName = &v + return s +} + +// SetTargetGroupName sets the TargetGroupName field's value. +func (s *DeregisterDBProxyTargetsInput) SetTargetGroupName(v string) *DeregisterDBProxyTargetsInput { + s.TargetGroupName = &v + return s +} + +type DeregisterDBProxyTargetsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeregisterDBProxyTargetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeregisterDBProxyTargetsOutput) GoString() string { + return s.String() +} + type DescribeAccountAttributesInput struct { _ struct{} `type:"structure"` } @@ -21044,7 +24692,7 @@ type DescribeCertificatesInput struct { // * Must match an existing CertificateIdentifier. CertificateIdentifier *string `type:"string"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous DescribeCertificates @@ -21054,7 +24702,7 @@ type DescribeCertificatesInput struct { // 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. + // is included in the response so you can retrieve the remaining results. // // Default: 100 // @@ -21151,6 +24799,119 @@ func (s *DescribeCertificatesOutput) SetMarker(v string) *DescribeCertificatesOu return s } +type DescribeCustomAvailabilityZonesInput struct { + _ struct{} `type:"structure"` + + // The custom AZ identifier. If this parameter is specified, information from + // only the specific custom AZ is returned. + CustomAvailabilityZoneId *string `type:"string"` + + // A filter that specifies one or more custom AZs to describe. + Filters []*Filter `locationNameList:"Filter" type:"list"` + + // An optional pagination token provided by a previous DescribeCustomAvailabilityZones + // 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 you can retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *int64 `type:"integer"` +} + +// String returns the string representation +func (s DescribeCustomAvailabilityZonesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCustomAvailabilityZonesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeCustomAvailabilityZonesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeCustomAvailabilityZonesInput"} + 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 +} + +// SetCustomAvailabilityZoneId sets the CustomAvailabilityZoneId field's value. +func (s *DescribeCustomAvailabilityZonesInput) SetCustomAvailabilityZoneId(v string) *DescribeCustomAvailabilityZonesInput { + s.CustomAvailabilityZoneId = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeCustomAvailabilityZonesInput) SetFilters(v []*Filter) *DescribeCustomAvailabilityZonesInput { + s.Filters = v + return s +} + +// SetMarker sets the Marker field's value. +func (s *DescribeCustomAvailabilityZonesInput) SetMarker(v string) *DescribeCustomAvailabilityZonesInput { + s.Marker = &v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeCustomAvailabilityZonesInput) SetMaxRecords(v int64) *DescribeCustomAvailabilityZonesInput { + s.MaxRecords = &v + return s +} + +type DescribeCustomAvailabilityZonesOutput struct { + _ struct{} `type:"structure"` + + // The list of CustomAvailabilityZone objects for the AWS account. + CustomAvailabilityZones []*CustomAvailabilityZone `locationNameList:"CustomAvailabilityZone" type:"list"` + + // An optional pagination token provided by a previous DescribeCustomAvailabilityZones + // 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 DescribeCustomAvailabilityZonesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCustomAvailabilityZonesOutput) GoString() string { + return s.String() +} + +// SetCustomAvailabilityZones sets the CustomAvailabilityZones field's value. +func (s *DescribeCustomAvailabilityZonesOutput) SetCustomAvailabilityZones(v []*CustomAvailabilityZone) *DescribeCustomAvailabilityZonesOutput { + s.CustomAvailabilityZones = v + return s +} + +// SetMarker sets the Marker field's value. +func (s *DescribeCustomAvailabilityZonesOutput) SetMarker(v string) *DescribeCustomAvailabilityZonesOutput { + s.Marker = &v + return s +} + type DescribeDBClusterBacktracksInput struct { _ struct{} `type:"structure"` @@ -21201,7 +24962,7 @@ type DescribeDBClusterBacktracksInput struct { // 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. + // is included in the response so you can retrieve the remaining results. // // Default: 100 // @@ -21280,7 +25041,7 @@ type DescribeDBClusterBacktracksOutput struct { // Contains a list of backtracks for the user. DBClusterBacktracks []*BacktrackDBClusterOutput `locationNameList:"DBClusterBacktrack" type:"list"` - // A pagination token that can be used in a subsequent DescribeDBClusterBacktracks + // A pagination token that can be used in a later DescribeDBClusterBacktracks // request. Marker *string `type:"string"` } @@ -21334,7 +25095,7 @@ type DescribeDBClusterEndpointsInput struct { // 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. + // is included in the response so you can retrieve the remaining results. // // Default: 100 // @@ -21447,7 +25208,7 @@ type DescribeDBClusterParameterGroupsInput struct { // * If supplied, must match the name of an existing DBClusterParameterGroup. DBClusterParameterGroupName *string `type:"string"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous DescribeDBClusterParameterGroups @@ -21457,7 +25218,7 @@ type DescribeDBClusterParameterGroupsInput struct { // 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. + // is included in the response so you can retrieve the remaining results. // // Default: 100 // @@ -21566,7 +25327,7 @@ type DescribeDBClusterParametersInput struct { // DBClusterParameterGroupName is a required field DBClusterParameterGroupName *string `type:"string" required:"true"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous DescribeDBClusterParameters @@ -21576,7 +25337,7 @@ type DescribeDBClusterParametersInput struct { // 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. + // is included in the response so you can retrieve the remaining results. // // Default: 100 // @@ -21758,7 +25519,7 @@ type DescribeDBClusterSnapshotsInput struct { // The ID of the DB cluster to retrieve the list of DB cluster snapshots for. // This parameter can't be used in conjunction with the DBClusterSnapshotIdentifier - // parameter. This parameter is not case-sensitive. + // parameter. This parameter isn't case-sensitive. // // Constraints: // @@ -21814,7 +25575,7 @@ type DescribeDBClusterSnapshotsInput struct { // 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. + // is included in the response so you can retrieve the remaining results. // // Default: 100 // @@ -21994,7 +25755,7 @@ type DescribeDBClustersInput struct { // 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. + // is included in the response so you can retrieve the remaining results. // // Default: 100 // @@ -22070,7 +25831,7 @@ type DescribeDBClustersOutput struct { // 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. + // A pagination token that can be used in a later DescribeDBClusters request. Marker *string `type:"string"` } @@ -22118,7 +25879,7 @@ type DescribeDBEngineVersionsInput struct { // Example: 5.1.49 EngineVersion *string `type:"string"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // A value that indicates whether to include engine versions that aren't available @@ -22148,7 +25909,7 @@ type DescribeDBEngineVersionsInput struct { // 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. + // in the response so you can retrieve the remaining results. // // Default: 100 // @@ -22322,7 +26083,7 @@ type DescribeDBInstanceAutomatedBackupsInput struct { // 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. + // is included in the response so that you can retrieve the remaining results. MaxRecords *int64 `type:"integer"` } @@ -22465,7 +26226,7 @@ type DescribeDBInstancesInput struct { // 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. + // is included in the response so that you can retrieve the remaining results. // // Default: 100 // @@ -22629,7 +26390,7 @@ type DescribeDBLogFilesInput struct { // string. FilenameContains *string `type:"string"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // The pagination token provided in the previous request. If this parameter @@ -22639,7 +26400,7 @@ type DescribeDBLogFilesInput struct { // 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. + // is included in the response so you can retrieve the remaining results. MaxRecords *int64 `type:"integer"` } @@ -22725,7 +26486,7 @@ type DescribeDBLogFilesOutput struct { // The DB log files returned. DescribeDBLogFiles []*DescribeDBLogFilesDetails `locationNameList:"DescribeDBLogFilesDetails" type:"list"` - // A pagination token that can be used in a subsequent DescribeDBLogFiles request. + // A pagination token that can be used in a later DescribeDBLogFiles request. Marker *string `type:"string"` } @@ -22761,7 +26522,7 @@ type DescribeDBParameterGroupsInput struct { // * If supplied, must match the name of an existing DBClusterParameterGroup. DBParameterGroupName *string `type:"string"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous DescribeDBParameterGroups @@ -22771,7 +26532,7 @@ type DescribeDBParameterGroupsInput struct { // 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. + // is included in the response so that you can retrieve the remaining results. // // Default: 100 // @@ -22881,7 +26642,7 @@ type DescribeDBParametersInput struct { // DBParameterGroupName is a required field DBParameterGroupName *string `type:"string" required:"true"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous DescribeDBParameters @@ -22891,7 +26652,7 @@ type DescribeDBParametersInput struct { // 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. + // is included in the response so that you can retrieve the remaining results. // // Default: 100 // @@ -23005,13 +26766,388 @@ func (s *DescribeDBParametersOutput) SetParameters(v []*Parameter) *DescribeDBPa return s } +type DescribeDBProxiesInput struct { + _ struct{} `type:"structure"` + + // The name of the DB proxy. + DBProxyName *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 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 `min:"20" type:"integer"` +} + +// String returns the string representation +func (s DescribeDBProxiesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDBProxiesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeDBProxiesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeDBProxiesInput"} + if s.MaxRecords != nil && *s.MaxRecords < 20 { + invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 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 +} + +// SetDBProxyName sets the DBProxyName field's value. +func (s *DescribeDBProxiesInput) SetDBProxyName(v string) *DescribeDBProxiesInput { + s.DBProxyName = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeDBProxiesInput) SetFilters(v []*Filter) *DescribeDBProxiesInput { + s.Filters = v + return s +} + +// SetMarker sets the Marker field's value. +func (s *DescribeDBProxiesInput) SetMarker(v string) *DescribeDBProxiesInput { + s.Marker = &v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeDBProxiesInput) SetMaxRecords(v int64) *DescribeDBProxiesInput { + s.MaxRecords = &v + return s +} + +type DescribeDBProxiesOutput struct { + _ struct{} `type:"structure"` + + // A return value representing an arbitrary number of DBProxy data structures. + DBProxies []*DBProxy `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 DescribeDBProxiesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDBProxiesOutput) GoString() string { + return s.String() +} + +// SetDBProxies sets the DBProxies field's value. +func (s *DescribeDBProxiesOutput) SetDBProxies(v []*DBProxy) *DescribeDBProxiesOutput { + s.DBProxies = v + return s +} + +// SetMarker sets the Marker field's value. +func (s *DescribeDBProxiesOutput) SetMarker(v string) *DescribeDBProxiesOutput { + s.Marker = &v + return s +} + +type DescribeDBProxyTargetGroupsInput struct { + _ struct{} `type:"structure"` + + // The identifier of the DBProxy associated with the target group. + // + // DBProxyName is a required field + DBProxyName *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 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 `min:"20" type:"integer"` + + // The identifier of the DBProxyTargetGroup to describe. + TargetGroupName *string `type:"string"` +} + +// String returns the string representation +func (s DescribeDBProxyTargetGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDBProxyTargetGroupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeDBProxyTargetGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeDBProxyTargetGroupsInput"} + if s.DBProxyName == nil { + invalidParams.Add(request.NewErrParamRequired("DBProxyName")) + } + if s.MaxRecords != nil && *s.MaxRecords < 20 { + invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 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 +} + +// SetDBProxyName sets the DBProxyName field's value. +func (s *DescribeDBProxyTargetGroupsInput) SetDBProxyName(v string) *DescribeDBProxyTargetGroupsInput { + s.DBProxyName = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeDBProxyTargetGroupsInput) SetFilters(v []*Filter) *DescribeDBProxyTargetGroupsInput { + s.Filters = v + return s +} + +// SetMarker sets the Marker field's value. +func (s *DescribeDBProxyTargetGroupsInput) SetMarker(v string) *DescribeDBProxyTargetGroupsInput { + s.Marker = &v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeDBProxyTargetGroupsInput) SetMaxRecords(v int64) *DescribeDBProxyTargetGroupsInput { + s.MaxRecords = &v + return s +} + +// SetTargetGroupName sets the TargetGroupName field's value. +func (s *DescribeDBProxyTargetGroupsInput) SetTargetGroupName(v string) *DescribeDBProxyTargetGroupsInput { + s.TargetGroupName = &v + return s +} + +type DescribeDBProxyTargetGroupsOutput 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"` + + // An arbitrary number of DBProxyTargetGroup objects, containing details of + // the corresponding target groups. + TargetGroups []*DBProxyTargetGroup `type:"list"` +} + +// String returns the string representation +func (s DescribeDBProxyTargetGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDBProxyTargetGroupsOutput) GoString() string { + return s.String() +} + +// SetMarker sets the Marker field's value. +func (s *DescribeDBProxyTargetGroupsOutput) SetMarker(v string) *DescribeDBProxyTargetGroupsOutput { + s.Marker = &v + return s +} + +// SetTargetGroups sets the TargetGroups field's value. +func (s *DescribeDBProxyTargetGroupsOutput) SetTargetGroups(v []*DBProxyTargetGroup) *DescribeDBProxyTargetGroupsOutput { + s.TargetGroups = v + return s +} + +type DescribeDBProxyTargetsInput struct { + _ struct{} `type:"structure"` + + // The identifier of the DBProxyTarget to describe. + // + // DBProxyName is a required field + DBProxyName *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 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 `min:"20" type:"integer"` + + // The identifier of the DBProxyTargetGroup to describe. + TargetGroupName *string `type:"string"` +} + +// String returns the string representation +func (s DescribeDBProxyTargetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDBProxyTargetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeDBProxyTargetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeDBProxyTargetsInput"} + if s.DBProxyName == nil { + invalidParams.Add(request.NewErrParamRequired("DBProxyName")) + } + if s.MaxRecords != nil && *s.MaxRecords < 20 { + invalidParams.Add(request.NewErrParamMinValue("MaxRecords", 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 +} + +// SetDBProxyName sets the DBProxyName field's value. +func (s *DescribeDBProxyTargetsInput) SetDBProxyName(v string) *DescribeDBProxyTargetsInput { + s.DBProxyName = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeDBProxyTargetsInput) SetFilters(v []*Filter) *DescribeDBProxyTargetsInput { + s.Filters = v + return s +} + +// SetMarker sets the Marker field's value. +func (s *DescribeDBProxyTargetsInput) SetMarker(v string) *DescribeDBProxyTargetsInput { + s.Marker = &v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeDBProxyTargetsInput) SetMaxRecords(v int64) *DescribeDBProxyTargetsInput { + s.MaxRecords = &v + return s +} + +// SetTargetGroupName sets the TargetGroupName field's value. +func (s *DescribeDBProxyTargetsInput) SetTargetGroupName(v string) *DescribeDBProxyTargetsInput { + s.TargetGroupName = &v + return s +} + +type DescribeDBProxyTargetsOutput 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"` + + // An arbitrary number of DBProxyTarget objects, containing details of the corresponding + // targets. + Targets []*DBProxyTarget `type:"list"` +} + +// String returns the string representation +func (s DescribeDBProxyTargetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDBProxyTargetsOutput) GoString() string { + return s.String() +} + +// SetMarker sets the Marker field's value. +func (s *DescribeDBProxyTargetsOutput) SetMarker(v string) *DescribeDBProxyTargetsOutput { + s.Marker = &v + return s +} + +// SetTargets sets the Targets field's value. +func (s *DescribeDBProxyTargetsOutput) SetTargets(v []*DBProxyTarget) *DescribeDBProxyTargetsOutput { + s.Targets = v + return s +} + 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. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous DescribeDBSecurityGroups @@ -23021,7 +27157,7 @@ type DescribeDBSecurityGroupsInput struct { // 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. + // is included in the response so that you can retrieve the remaining results. // // Default: 100 // @@ -23190,7 +27326,7 @@ type DescribeDBSnapshotsInput struct { // The ID of the DB instance to retrieve the list of DB snapshots for. This // parameter can't be used in conjunction with DBSnapshotIdentifier. This parameter - // is not case-sensitive. + // isn't case-sensitive. // // Constraints: // @@ -23251,7 +27387,7 @@ type DescribeDBSnapshotsInput struct { // 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. + // is included in the response so that you can retrieve the remaining results. // // Default: 100 // @@ -23415,7 +27551,7 @@ type DescribeDBSubnetGroupsInput struct { // The name of the DB subnet group to return details for. DBSubnetGroupName *string `type:"string"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous DescribeDBSubnetGroups @@ -23425,7 +27561,7 @@ type DescribeDBSubnetGroupsInput struct { // 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. + // is included in the response so that you can retrieve the remaining results. // // Default: 100 // @@ -23532,7 +27668,7 @@ type DescribeEngineDefaultClusterParametersInput struct { // DBParameterGroupFamily is a required field DBParameterGroupFamily *string `type:"string" required:"true"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous DescribeEngineDefaultClusterParameters @@ -23542,7 +27678,7 @@ type DescribeEngineDefaultClusterParametersInput struct { // 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. + // is included in the response so you can retrieve the remaining results. // // Default: 100 // @@ -23639,7 +27775,7 @@ type DescribeEngineDefaultParametersInput struct { // DBParameterGroupFamily is a required field DBParameterGroupFamily *string `type:"string" required:"true"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous DescribeEngineDefaultParameters @@ -23649,7 +27785,7 @@ type DescribeEngineDefaultParametersInput struct { // 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. + // is included in the response so you can retrieve the remaining results. // // Default: 100 // @@ -23741,7 +27877,7 @@ func (s *DescribeEngineDefaultParametersOutput) SetEngineDefaults(v *EngineDefau type DescribeEventCategoriesInput struct { _ struct{} `type:"structure"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // The type of source that is generating the events. @@ -23819,7 +27955,7 @@ func (s *DescribeEventCategoriesOutput) SetEventCategoriesMapList(v []*EventCate type DescribeEventSubscriptionsInput struct { _ struct{} `type:"structure"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous DescribeOrderableDBInstanceOptions @@ -23829,7 +27965,7 @@ type DescribeEventSubscriptionsInput struct { // 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. + // is included in the response so that you can retrieve the remaining results. // // Default: 100 // @@ -23948,7 +28084,7 @@ type DescribeEventsInput struct { // subscription. EventCategories []*string `locationNameList:"EventCategory" type:"list"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous DescribeEvents request. @@ -23958,7 +28094,7 @@ type DescribeEventsInput struct { // 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. + // is included in the response so that you can retrieve the remaining results. // // Default: 100 // @@ -24117,6 +28253,140 @@ func (s *DescribeEventsOutput) SetMarker(v string) *DescribeEventsOutput { return s } +type DescribeExportTasksInput struct { + _ struct{} `type:"structure"` + + // The identifier of the snapshot export task to be described. + ExportTaskIdentifier *string `type:"string"` + + // Filters specify one or more snapshot exports to describe. The filters are + // specified as name-value pairs that define what to include in the output. + // + // Supported filters include the following: + // + // * export-task-identifier - An identifier for the snapshot export task. + // + // * s3-bucket - The Amazon S3 bucket the snapshot is exported to. + // + // * source-arn - The Amazon Resource Name (ARN) of the snapshot exported + // to Amazon S3 + // + // * status - The status of the export task. + Filters []*Filter `locationNameList:"Filter" type:"list"` + + // An optional pagination token provided by a previous DescribeExportTasks request. + // If you specify this parameter, 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 value, a pagination token called a marker is included + // in the response. You can use the marker in a later DescribeExportTasks request + // to retrieve the remaining results. + // + // Default: 100 + // + // Constraints: Minimum 20, maximum 100. + MaxRecords *string `type:"string"` + + // The Amazon Resource Name (ARN) of the snapshot exported to Amazon S3. + SourceArn *string `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.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 +} + +// SetExportTaskIdentifier sets the ExportTaskIdentifier field's value. +func (s *DescribeExportTasksInput) SetExportTaskIdentifier(v string) *DescribeExportTasksInput { + s.ExportTaskIdentifier = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeExportTasksInput) SetFilters(v []*Filter) *DescribeExportTasksInput { + s.Filters = v + return s +} + +// SetMarker sets the Marker field's value. +func (s *DescribeExportTasksInput) SetMarker(v string) *DescribeExportTasksInput { + s.Marker = &v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeExportTasksInput) SetMaxRecords(v string) *DescribeExportTasksInput { + s.MaxRecords = &v + return s +} + +// SetSourceArn sets the SourceArn field's value. +func (s *DescribeExportTasksInput) SetSourceArn(v string) *DescribeExportTasksInput { + s.SourceArn = &v + return s +} + +type DescribeExportTasksOutput struct { + _ struct{} `type:"structure"` + + // Information about an export of a snapshot to Amazon S3. + ExportTasks []*ExportTask `locationNameList:"ExportTask" type:"list"` + + // A pagination token that can be used in a later DescribeExportTasks request. + // A marker is used for pagination to identify the location to begin output + // for the next response of DescribeExportTasks. + Marker *string `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 +} + +// SetMarker sets the Marker field's value. +func (s *DescribeExportTasksOutput) SetMarker(v string) *DescribeExportTasksOutput { + s.Marker = &v + return s +} + type DescribeGlobalClustersInput struct { _ struct{} `type:"structure"` @@ -24145,7 +28415,7 @@ type DescribeGlobalClustersInput struct { // 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. + // is included in the response so that you can retrieve the remaining results. // // Default: 100 // @@ -24241,6 +28511,123 @@ func (s *DescribeGlobalClustersOutput) SetMarker(v string) *DescribeGlobalCluste return s } +type DescribeInstallationMediaInput struct { + _ struct{} `type:"structure"` + + // A filter that specifies one or more installation media to describe. Supported + // filters include the following: + // + // * custom-availability-zone-id - Accepts custom Availability Zone (AZ) + // identifiers. The results list includes information about only the custom + // AZs identified by these identifiers. + // + // * engine - Accepts database engines. The results list includes information + // about only the database engines identified by these identifiers. For more + // information about the valid engines for installation media, see ImportInstallationMedia. + Filters []*Filter `locationNameList:"Filter" type:"list"` + + // The installation medium ID. + InstallationMediaId *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"` + + // An optional pagination token provided by a previous DescribeInstallationMedia + // request. If this parameter is specified, the response includes only records + // beyond the marker, up to the value specified by MaxRecords. + MaxRecords *int64 `type:"integer"` +} + +// String returns the string representation +func (s DescribeInstallationMediaInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInstallationMediaInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeInstallationMediaInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeInstallationMediaInput"} + 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 *DescribeInstallationMediaInput) SetFilters(v []*Filter) *DescribeInstallationMediaInput { + s.Filters = v + return s +} + +// SetInstallationMediaId sets the InstallationMediaId field's value. +func (s *DescribeInstallationMediaInput) SetInstallationMediaId(v string) *DescribeInstallationMediaInput { + s.InstallationMediaId = &v + return s +} + +// SetMarker sets the Marker field's value. +func (s *DescribeInstallationMediaInput) SetMarker(v string) *DescribeInstallationMediaInput { + s.Marker = &v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeInstallationMediaInput) SetMaxRecords(v int64) *DescribeInstallationMediaInput { + s.MaxRecords = &v + return s +} + +type DescribeInstallationMediaOutput struct { + _ struct{} `type:"structure"` + + // The list of InstallationMedia objects for the AWS account. + InstallationMedia []*InstallationMedia `locationNameList:"InstallationMedia" type:"list"` + + // An optional pagination token provided by a previous DescribeInstallationMedia + // 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 DescribeInstallationMediaOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeInstallationMediaOutput) GoString() string { + return s.String() +} + +// SetInstallationMedia sets the InstallationMedia field's value. +func (s *DescribeInstallationMediaOutput) SetInstallationMedia(v []*InstallationMedia) *DescribeInstallationMediaOutput { + s.InstallationMedia = v + return s +} + +// SetMarker sets the Marker field's value. +func (s *DescribeInstallationMediaOutput) SetMarker(v string) *DescribeInstallationMediaOutput { + s.Marker = &v + return s +} + type DescribeOptionGroupOptionsInput struct { _ struct{} `type:"structure"` @@ -24249,7 +28636,7 @@ type DescribeOptionGroupOptionsInput struct { // EngineName is a required field EngineName *string `type:"string" required:"true"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // If specified, filters the results to include only options for the specified @@ -24263,7 +28650,7 @@ type DescribeOptionGroupOptionsInput struct { // 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. + // is included in the response so that you can retrieve the remaining results. // // Default: 100 // @@ -24375,7 +28762,7 @@ type DescribeOptionGroupsInput struct { // a specific database engine. EngineName *string `type:"string"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // Filters the list of option groups to only include groups associated with @@ -24390,7 +28777,7 @@ type DescribeOptionGroupsInput struct { // 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. + // is included in the response so that you can retrieve the remaining results. // // Default: 100 // @@ -24519,7 +28906,7 @@ type DescribeOrderableDBInstanceOptionsInput struct { // available offerings matching the specified engine version. EngineVersion *string `type:"string"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // The license model filter value. Specify this parameter to show only the available @@ -24533,7 +28920,7 @@ type DescribeOrderableDBInstanceOptionsInput struct { // 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. + // is included in the response so that you can retrieve the remaining results. // // Default: 100 // @@ -24686,7 +29073,7 @@ type DescribePendingMaintenanceActionsInput struct { // 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. + // is included in the response so that you can retrieve the remaining results. // // Default: 100 // @@ -24799,7 +29186,7 @@ type DescribeReservedDBInstancesInput struct { // Valid Values: 1 | 3 | 31536000 | 94608000 Duration *string `type:"string"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // The lease identifier filter value. Specify this parameter to show only the @@ -24816,7 +29203,7 @@ type DescribeReservedDBInstancesInput struct { // 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. + // in the response so you can retrieve the remaining results. // // Default: 100 // @@ -24955,7 +29342,7 @@ type DescribeReservedDBInstancesOfferingsInput struct { // Valid Values: 1 | 3 | 31536000 | 94608000 Duration *string `type:"string"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous request. If this parameter @@ -24965,7 +29352,7 @@ type DescribeReservedDBInstancesOfferingsInput struct { // 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. + // in the response so you can retrieve the remaining results. // // Default: 100 // @@ -25154,7 +29541,7 @@ func (s *DescribeReservedDBInstancesOutput) SetReservedDBInstances(v []*Reserved type DescribeSourceRegionsInput struct { _ struct{} `type:"structure"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // An optional pagination token provided by a previous DescribeSourceRegions @@ -25164,7 +29551,7 @@ type DescribeSourceRegionsInput struct { // 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. + // is included in the response so you can retrieve the remaining results. // // Default: 100 // @@ -25333,7 +29720,8 @@ func (s *DescribeValidDBInstanceModificationsOutput) SetValidDBInstanceModificat return s } -// An Active Directory Domain membership record associated with the DB instance. +// An Active Directory Domain membership record associated with the DB instance +// or cluster. type DomainMembership struct { _ struct{} `type:"structure"` @@ -25347,8 +29735,8 @@ type DomainMembership struct { // Service. IAMRoleName *string `type:"string"` - // The status of the DB instance's Active Directory Domain membership, such - // as joined, pending-join, failed etc). + // The status of the Active Directory Domain membership for the DB instance + // or cluster. Values include joined, pending-join, failed, and so on. Status *string `type:"string"` } @@ -25453,8 +29841,8 @@ type DownloadDBLogFilePortionInput struct { // 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 NumberOfLines is specified and Marker isn't 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. @@ -25527,8 +29915,7 @@ type DownloadDBLogFilePortionOutput struct { // Entries from the specified log file. LogFileData *string `type:"string"` - // A pagination token that can be used in a subsequent DownloadDBLogFilePortion - // request. + // A pagination token that can be used in a later DownloadDBLogFilePortion request. Marker *string `type:"string"` } @@ -25937,10 +30324,180 @@ func (s *EventSubscription) SetSubscriptionCreationTime(v string) *EventSubscrip return s } +// Contains the details of a snapshot export to Amazon S3. +// +// This data type is used as a response element in the DescribeExportTasks action. +type ExportTask struct { + _ struct{} `type:"structure"` + + // The data exported from the snapshot. Valid values are the following: + // + // * database - Export all the data of the snapshot. + // + // * database.table [table-name] - Export a table of the snapshot. + // + // * database.schema [schema-name] - Export a database schema of the snapshot. + // This value isn't valid for RDS for MySQL, RDS for MariaDB, or Aurora MySQL. + // + // * database.schema.table [table-name] - Export a table of the database + // schema. This value isn't valid for RDS for MySQL, RDS for MariaDB, or + // Aurora MySQL. + ExportOnly []*string `type:"list"` + + // A unique identifier for the snapshot export task. This ID isn't an identifier + // for the Amazon S3 bucket where the snapshot is exported to. + ExportTaskIdentifier *string `type:"string"` + + // The reason the export failed, if it failed. + FailureCause *string `type:"string"` + + // The name of the IAM role that is used to write to Amazon S3 when exporting + // a snapshot. + IamRoleArn *string `type:"string"` + + // The ID of the AWS KMS key that is used to encrypt the snapshot when it's + // exported to Amazon S3. The KMS key ID is the Amazon Resource Name (ARN), + // the KMS key identifier, or the KMS key alias for the KMS encryption key. + // The IAM role used for the snapshot export must have encryption and decryption + // permissions to use this KMS key. + KmsKeyId *string `type:"string"` + + // The progress of the snapshot export task as a percentage. + PercentProgress *int64 `type:"integer"` + + // The Amazon S3 bucket that the snapshot is exported to. + S3Bucket *string `type:"string"` + + // The Amazon S3 bucket prefix that is the file name and path of the exported + // snapshot. + S3Prefix *string `type:"string"` + + // The time that the snapshot was created. + SnapshotTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of the snapshot exported to Amazon S3. + SourceArn *string `type:"string"` + + // The progress status of the export task. + Status *string `type:"string"` + + // The time that the snapshot export task completed. + TaskEndTime *time.Time `type:"timestamp"` + + // The time that the snapshot export task started. + TaskStartTime *time.Time `type:"timestamp"` + + // The total amount of data exported, in gigabytes. + TotalExtractedDataInGB *int64 `type:"integer"` + + // A warning about the snapshot export task. + WarningMessage *string `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() +} + +// SetExportOnly sets the ExportOnly field's value. +func (s *ExportTask) SetExportOnly(v []*string) *ExportTask { + s.ExportOnly = v + return s +} + +// SetExportTaskIdentifier sets the ExportTaskIdentifier field's value. +func (s *ExportTask) SetExportTaskIdentifier(v string) *ExportTask { + s.ExportTaskIdentifier = &v + return s +} + +// SetFailureCause sets the FailureCause field's value. +func (s *ExportTask) SetFailureCause(v string) *ExportTask { + s.FailureCause = &v + return s +} + +// SetIamRoleArn sets the IamRoleArn field's value. +func (s *ExportTask) SetIamRoleArn(v string) *ExportTask { + s.IamRoleArn = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *ExportTask) SetKmsKeyId(v string) *ExportTask { + s.KmsKeyId = &v + return s +} + +// SetPercentProgress sets the PercentProgress field's value. +func (s *ExportTask) SetPercentProgress(v int64) *ExportTask { + s.PercentProgress = &v + return s +} + +// SetS3Bucket sets the S3Bucket field's value. +func (s *ExportTask) SetS3Bucket(v string) *ExportTask { + s.S3Bucket = &v + return s +} + +// SetS3Prefix sets the S3Prefix field's value. +func (s *ExportTask) SetS3Prefix(v string) *ExportTask { + s.S3Prefix = &v + return s +} + +// SetSnapshotTime sets the SnapshotTime field's value. +func (s *ExportTask) SetSnapshotTime(v time.Time) *ExportTask { + s.SnapshotTime = &v + return s +} + +// SetSourceArn sets the SourceArn field's value. +func (s *ExportTask) SetSourceArn(v string) *ExportTask { + s.SourceArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ExportTask) SetStatus(v string) *ExportTask { + s.Status = &v + return s +} + +// SetTaskEndTime sets the TaskEndTime field's value. +func (s *ExportTask) SetTaskEndTime(v time.Time) *ExportTask { + s.TaskEndTime = &v + return s +} + +// SetTaskStartTime sets the TaskStartTime field's value. +func (s *ExportTask) SetTaskStartTime(v time.Time) *ExportTask { + s.TaskStartTime = &v + return s +} + +// SetTotalExtractedDataInGB sets the TotalExtractedDataInGB field's value. +func (s *ExportTask) SetTotalExtractedDataInGB(v int64) *ExportTask { + s.TotalExtractedDataInGB = &v + return s +} + +// SetWarningMessage sets the WarningMessage field's value. +func (s *ExportTask) SetWarningMessage(v string) *ExportTask { + s.WarningMessage = &v + return s +} + type FailoverDBClusterInput struct { _ struct{} `type:"structure"` - // A DB cluster identifier to force a failover for. This parameter is not case-sensitive. + // A DB cluster identifier to force a failover for. This parameter isn't case-sensitive. // // Constraints: // @@ -26276,10 +30833,338 @@ func (s *IPRange) SetStatus(v string) *IPRange { return s } +type ImportInstallationMediaInput struct { + _ struct{} `type:"structure"` + + // The identifier of the custom Availability Zone (AZ) to import the installation + // media to. + // + // CustomAvailabilityZoneId is a required field + CustomAvailabilityZoneId *string `type:"string" required:"true"` + + // The name of the database engine to be used for this instance. + // + // The list only includes supported DB engines that require an on-premises customer + // provided license. + // + // Valid Values: + // + // * sqlserver-ee + // + // * sqlserver-se + // + // * sqlserver-ex + // + // * sqlserver-web + // + // Engine is a required field + Engine *string `type:"string" required:"true"` + + // The path to the installation medium for the specified DB engine. + // + // Example: SQLServerISO/en_sql_server_2016_enterprise_x64_dvd_8701793.iso + // + // EngineInstallationMediaPath is a required field + EngineInstallationMediaPath *string `type:"string" required:"true"` + + // The version number of the database engine to use. + // + // For a list of valid engine versions, call DescribeDBEngineVersions. + // + // The following are the database engines and links to information about the + // major and minor versions. The list only includes DB engines that require + // an on-premises customer provided license. + // + // Microsoft SQL Server + // + // See Version and Feature Support on Amazon RDS (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_SQLServer.html#SQLServer.Concepts.General.FeatureSupport) + // in the Amazon RDS User Guide. + // + // EngineVersion is a required field + EngineVersion *string `type:"string" required:"true"` + + // The path to the installation medium for the operating system associated with + // the specified DB engine. + // + // Example: WindowsISO/en_windows_server_2016_x64_dvd_9327751.iso + // + // OSInstallationMediaPath is a required field + OSInstallationMediaPath *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ImportInstallationMediaInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportInstallationMediaInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ImportInstallationMediaInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ImportInstallationMediaInput"} + if s.CustomAvailabilityZoneId == nil { + invalidParams.Add(request.NewErrParamRequired("CustomAvailabilityZoneId")) + } + if s.Engine == nil { + invalidParams.Add(request.NewErrParamRequired("Engine")) + } + if s.EngineInstallationMediaPath == nil { + invalidParams.Add(request.NewErrParamRequired("EngineInstallationMediaPath")) + } + if s.EngineVersion == nil { + invalidParams.Add(request.NewErrParamRequired("EngineVersion")) + } + if s.OSInstallationMediaPath == nil { + invalidParams.Add(request.NewErrParamRequired("OSInstallationMediaPath")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCustomAvailabilityZoneId sets the CustomAvailabilityZoneId field's value. +func (s *ImportInstallationMediaInput) SetCustomAvailabilityZoneId(v string) *ImportInstallationMediaInput { + s.CustomAvailabilityZoneId = &v + return s +} + +// SetEngine sets the Engine field's value. +func (s *ImportInstallationMediaInput) SetEngine(v string) *ImportInstallationMediaInput { + s.Engine = &v + return s +} + +// SetEngineInstallationMediaPath sets the EngineInstallationMediaPath field's value. +func (s *ImportInstallationMediaInput) SetEngineInstallationMediaPath(v string) *ImportInstallationMediaInput { + s.EngineInstallationMediaPath = &v + return s +} + +// SetEngineVersion sets the EngineVersion field's value. +func (s *ImportInstallationMediaInput) SetEngineVersion(v string) *ImportInstallationMediaInput { + s.EngineVersion = &v + return s +} + +// SetOSInstallationMediaPath sets the OSInstallationMediaPath field's value. +func (s *ImportInstallationMediaInput) SetOSInstallationMediaPath(v string) *ImportInstallationMediaInput { + s.OSInstallationMediaPath = &v + return s +} + +// Contains the installation media for a DB engine that requires an on-premises +// customer provided license, such as Microsoft SQL Server. +type ImportInstallationMediaOutput struct { + _ struct{} `type:"structure"` + + // The custom Availability Zone (AZ) that contains the installation media. + CustomAvailabilityZoneId *string `type:"string"` + + // The DB engine. + Engine *string `type:"string"` + + // The path to the installation medium for the DB engine. + EngineInstallationMediaPath *string `type:"string"` + + // The engine version of the DB engine. + EngineVersion *string `type:"string"` + + // If an installation media failure occurred, the cause of the failure. + FailureCause *InstallationMediaFailureCause `type:"structure"` + + // The installation medium ID. + InstallationMediaId *string `type:"string"` + + // The path to the installation medium for the operating system associated with + // the DB engine. + OSInstallationMediaPath *string `type:"string"` + + // The status of the installation medium. + Status *string `type:"string"` +} + +// String returns the string representation +func (s ImportInstallationMediaOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ImportInstallationMediaOutput) GoString() string { + return s.String() +} + +// SetCustomAvailabilityZoneId sets the CustomAvailabilityZoneId field's value. +func (s *ImportInstallationMediaOutput) SetCustomAvailabilityZoneId(v string) *ImportInstallationMediaOutput { + s.CustomAvailabilityZoneId = &v + return s +} + +// SetEngine sets the Engine field's value. +func (s *ImportInstallationMediaOutput) SetEngine(v string) *ImportInstallationMediaOutput { + s.Engine = &v + return s +} + +// SetEngineInstallationMediaPath sets the EngineInstallationMediaPath field's value. +func (s *ImportInstallationMediaOutput) SetEngineInstallationMediaPath(v string) *ImportInstallationMediaOutput { + s.EngineInstallationMediaPath = &v + return s +} + +// SetEngineVersion sets the EngineVersion field's value. +func (s *ImportInstallationMediaOutput) SetEngineVersion(v string) *ImportInstallationMediaOutput { + s.EngineVersion = &v + return s +} + +// SetFailureCause sets the FailureCause field's value. +func (s *ImportInstallationMediaOutput) SetFailureCause(v *InstallationMediaFailureCause) *ImportInstallationMediaOutput { + s.FailureCause = v + return s +} + +// SetInstallationMediaId sets the InstallationMediaId field's value. +func (s *ImportInstallationMediaOutput) SetInstallationMediaId(v string) *ImportInstallationMediaOutput { + s.InstallationMediaId = &v + return s +} + +// SetOSInstallationMediaPath sets the OSInstallationMediaPath field's value. +func (s *ImportInstallationMediaOutput) SetOSInstallationMediaPath(v string) *ImportInstallationMediaOutput { + s.OSInstallationMediaPath = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *ImportInstallationMediaOutput) SetStatus(v string) *ImportInstallationMediaOutput { + s.Status = &v + return s +} + +// Contains the installation media for a DB engine that requires an on-premises +// customer provided license, such as Microsoft SQL Server. +type InstallationMedia struct { + _ struct{} `type:"structure"` + + // The custom Availability Zone (AZ) that contains the installation media. + CustomAvailabilityZoneId *string `type:"string"` + + // The DB engine. + Engine *string `type:"string"` + + // The path to the installation medium for the DB engine. + EngineInstallationMediaPath *string `type:"string"` + + // The engine version of the DB engine. + EngineVersion *string `type:"string"` + + // If an installation media failure occurred, the cause of the failure. + FailureCause *InstallationMediaFailureCause `type:"structure"` + + // The installation medium ID. + InstallationMediaId *string `type:"string"` + + // The path to the installation medium for the operating system associated with + // the DB engine. + OSInstallationMediaPath *string `type:"string"` + + // The status of the installation medium. + Status *string `type:"string"` +} + +// String returns the string representation +func (s InstallationMedia) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstallationMedia) GoString() string { + return s.String() +} + +// SetCustomAvailabilityZoneId sets the CustomAvailabilityZoneId field's value. +func (s *InstallationMedia) SetCustomAvailabilityZoneId(v string) *InstallationMedia { + s.CustomAvailabilityZoneId = &v + return s +} + +// SetEngine sets the Engine field's value. +func (s *InstallationMedia) SetEngine(v string) *InstallationMedia { + s.Engine = &v + return s +} + +// SetEngineInstallationMediaPath sets the EngineInstallationMediaPath field's value. +func (s *InstallationMedia) SetEngineInstallationMediaPath(v string) *InstallationMedia { + s.EngineInstallationMediaPath = &v + return s +} + +// SetEngineVersion sets the EngineVersion field's value. +func (s *InstallationMedia) SetEngineVersion(v string) *InstallationMedia { + s.EngineVersion = &v + return s +} + +// SetFailureCause sets the FailureCause field's value. +func (s *InstallationMedia) SetFailureCause(v *InstallationMediaFailureCause) *InstallationMedia { + s.FailureCause = v + return s +} + +// SetInstallationMediaId sets the InstallationMediaId field's value. +func (s *InstallationMedia) SetInstallationMediaId(v string) *InstallationMedia { + s.InstallationMediaId = &v + return s +} + +// SetOSInstallationMediaPath sets the OSInstallationMediaPath field's value. +func (s *InstallationMedia) SetOSInstallationMediaPath(v string) *InstallationMedia { + s.OSInstallationMediaPath = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *InstallationMedia) SetStatus(v string) *InstallationMedia { + s.Status = &v + return s +} + +// Contains the cause of an installation media failure. Installation media is +// used for a DB engine that requires an on-premises customer provided license, +// such as Microsoft SQL Server. +type InstallationMediaFailureCause struct { + _ struct{} `type:"structure"` + + // The reason that an installation media import failed. + Message *string `type:"string"` +} + +// String returns the string representation +func (s InstallationMediaFailureCause) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstallationMediaFailureCause) GoString() string { + return s.String() +} + +// SetMessage sets the Message field's value. +func (s *InstallationMediaFailureCause) SetMessage(v string) *InstallationMediaFailureCause { + s.Message = &v + return s +} + type ListTagsForResourceInput struct { _ struct{} `type:"structure"` - // This parameter is not currently supported. + // This parameter isn't currently supported. Filters []*Filter `locationNameList:"Filter" type:"list"` // The Amazon RDS resource with tags to be listed. This value is an Amazon Resource @@ -26393,6 +31278,65 @@ func (s *MinimumEngineVersionPerAllowedValue) SetMinimumEngineVersion(v string) return s } +type ModifyCertificatesInput struct { + _ struct{} `type:"structure"` + + // The new default certificate identifier to override the current one with. + // + // To determine the valid values, use the describe-certificates AWS CLI command + // or the DescribeCertificates API operation. + CertificateIdentifier *string `type:"string"` + + // A value that indicates whether to remove the override for the default certificate. + // If the override is removed, the default certificate is the system default. + RemoveCustomerOverride *bool `type:"boolean"` +} + +// String returns the string representation +func (s ModifyCertificatesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyCertificatesInput) GoString() string { + return s.String() +} + +// SetCertificateIdentifier sets the CertificateIdentifier field's value. +func (s *ModifyCertificatesInput) SetCertificateIdentifier(v string) *ModifyCertificatesInput { + s.CertificateIdentifier = &v + return s +} + +// SetRemoveCustomerOverride sets the RemoveCustomerOverride field's value. +func (s *ModifyCertificatesInput) SetRemoveCustomerOverride(v bool) *ModifyCertificatesInput { + s.RemoveCustomerOverride = &v + return s +} + +type ModifyCertificatesOutput struct { + _ struct{} `type:"structure"` + + // A CA certificate for an AWS account. + Certificate *Certificate `type:"structure"` +} + +// String returns the string representation +func (s ModifyCertificatesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyCertificatesOutput) GoString() string { + return s.String() +} + +// SetCertificate sets the Certificate field's value. +func (s *ModifyCertificatesOutput) SetCertificate(v *Certificate) *ModifyCertificatesOutput { + s.Certificate = v + return s +} + type ModifyCurrentDBClusterCapacityInput struct { _ struct{} `type:"structure"` @@ -26403,11 +31347,15 @@ type ModifyCurrentDBClusterCapacityInput struct { // // Constraints: // - // * Value must be 1, 2, 4, 8, 16, 32, 64, 128, or 256. + // * For Aurora MySQL, valid capacity values are 1, 2, 4, 8, 16, 32, 64, + // 128, and 256. + // + // * For Aurora PostgreSQL, valid capacity values are 2, 4, 8, 16, 32, 64, + // 192, and 384. Capacity *int64 `type:"integer"` // The DB cluster identifier for the cluster being modified. This parameter - // is not case-sensitive. + // isn't case-sensitive. // // Constraints: // @@ -26429,8 +31377,8 @@ type ModifyCurrentDBClusterCapacityInput struct { // ForceApplyCapacityChange, the default, sets the capacity to the specified // value as soon as possible. // - // RollbackCapacityChange ignores the capacity change if a scaling point is - // not found in the timeout period. + // RollbackCapacityChange ignores the capacity change if a scaling point isn't + // found in the timeout period. TimeoutAction *string `type:"string"` } @@ -26791,7 +31739,7 @@ type ModifyDBClusterInput struct { CopyTagsToSnapshot *bool `type:"boolean"` // The DB cluster identifier for the cluster being modified. This parameter - // is not case-sensitive. + // isn't case-sensitive. // // Constraints: This identifier must match the identifier of an existing DB // cluster. @@ -26824,6 +31772,15 @@ type ModifyDBClusterInput struct { // deletion protection is disabled. DeletionProtection *bool `type:"boolean"` + // The Active Directory directory ID to move the DB cluster to. Specify none + // to remove the cluster from its current domain. The domain must be created + // prior to this operation. + 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"` + // A value that indicates whether to enable the HTTP endpoint for an Aurora // Serverless DB cluster. By default, the HTTP endpoint is disabled. // @@ -27027,6 +31984,18 @@ func (s *ModifyDBClusterInput) SetDeletionProtection(v bool) *ModifyDBClusterInp return s } +// SetDomain sets the Domain field's value. +func (s *ModifyDBClusterInput) SetDomain(v string) *ModifyDBClusterInput { + s.Domain = &v + return s +} + +// SetDomainIAMRoleName sets the DomainIAMRoleName field's value. +func (s *ModifyDBClusterInput) SetDomainIAMRoleName(v string) *ModifyDBClusterInput { + s.DomainIAMRoleName = &v + return s +} + // SetEnableHttpEndpoint sets the EnableHttpEndpoint field's value. func (s *ModifyDBClusterInput) SetEnableHttpEndpoint(v bool) *ModifyDBClusterInput { s.EnableHttpEndpoint = &v @@ -27364,6 +32333,27 @@ type ModifyDBInstanceInput struct { // Indicates the certificate that needs to be associated with the instance. CACertificateIdentifier *string `type:"string"` + // A value that indicates whether the DB instance is restarted when you rotate + // your SSL/TLS certificate. + // + // By default, the DB instance is restarted when you rotate your SSL/TLS certificate. + // The certificate is not updated until the DB instance is restarted. + // + // Set this parameter only if you are not using SSL/TLS to connect to the DB + // instance. + // + // If you are using SSL/TLS to connect to the DB instance, follow the appropriate + // instructions for your DB engine to rotate your SSL/TLS certificate: + // + // * For more information about rotating your SSL/TLS certificate for RDS + // DB engines, see Rotating Your SSL/TLS Certificate. (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/UsingWithRDS.SSL-certificate-rotation.html) + // in the Amazon RDS User Guide. + // + // * For more information about rotating your SSL/TLS certificate for Aurora + // DB engines, see Rotating Your SSL/TLS Certificate (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.SSL-certificate-rotation.html) + // in the Amazon Aurora User Guide. + CertificateRotationRestart *bool `type:"boolean"` + // The configuration setting for the log types to be enabled for export to CloudWatch // Logs for a specific DB instance. // @@ -27475,7 +32465,7 @@ type ModifyDBInstanceInput struct { 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 + // move your DB instance to a different VPC. If your DB instance isn't 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) // in the Amazon RDS User Guide. @@ -27747,7 +32737,7 @@ type ModifyDBInstanceInput struct { // A value that indicates whether the DB instance is publicly accessible. When // the DB instance is publicly accessible, it is an Internet-facing instance // with a publicly resolvable DNS name, which resolves to a public IP address. - // When the DB instance is not publicly accessible, it is an internal instance + // When the DB instance isn't publicly accessible, it is an internal instance // with a DNS name that resolves to a private IP address. // // PubliclyAccessible only applies to DB instances in a VPC. The DB instance @@ -27865,6 +32855,12 @@ func (s *ModifyDBInstanceInput) SetCACertificateIdentifier(v string) *ModifyDBIn return s } +// SetCertificateRotationRestart sets the CertificateRotationRestart field's value. +func (s *ModifyDBInstanceInput) SetCertificateRotationRestart(v bool) *ModifyDBInstanceInput { + s.CertificateRotationRestart = &v + return s +} + // SetCloudwatchLogsExportConfiguration sets the CloudwatchLogsExportConfiguration field's value. func (s *ModifyDBInstanceInput) SetCloudwatchLogsExportConfiguration(v *CloudwatchLogsExportConfiguration) *ModifyDBInstanceInput { s.CloudwatchLogsExportConfiguration = v @@ -28114,7 +33110,7 @@ type ModifyDBParameterGroupInput struct { // 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 + // later arguments are optional. A maximum of 20 parameters can be modified // in a single request. // // Valid Values (for the application method): immediate | pending-reboot @@ -28165,6 +33161,239 @@ func (s *ModifyDBParameterGroupInput) SetParameters(v []*Parameter) *ModifyDBPar return s } +type ModifyDBProxyInput struct { + _ struct{} `type:"structure"` + + // The new authentication settings for the DBProxy. + Auth []*UserAuthConfig `type:"list"` + + // The identifier for the DBProxy to modify. + // + // DBProxyName is a required field + DBProxyName *string `type:"string" required:"true"` + + // Whether the proxy includes detailed information about SQL statements in its + // logs. This information helps you to debug issues involving SQL behavior or + // the performance and scalability of the proxy connections. The debug information + // includes the text of SQL statements that you submit through the proxy. Thus, + // only enable this setting when needed for debugging, and only when you have + // security measures in place to safeguard any sensitive information that appears + // in the logs. + DebugLogging *bool `type:"boolean"` + + // The number of seconds that a connection to the proxy can be inactive before + // the proxy disconnects it. You can set this value higher or lower than the + // connection timeout limit for the associated database. + IdleClientTimeout *int64 `type:"integer"` + + // The new identifier for the DBProxy. An identifier must begin with a letter + // and must contain only ASCII letters, digits, and hyphens; it can't end with + // a hyphen or contain two consecutive hyphens. + NewDBProxyName *string `type:"string"` + + // Whether Transport Layer Security (TLS) encryption is required for connections + // to the proxy. By enabling this setting, you can enforce encrypted TLS connections + // to the proxy, even if the associated database doesn't use TLS. + RequireTLS *bool `type:"boolean"` + + // The Amazon Resource Name (ARN) of the IAM role that the proxy uses to access + // secrets in AWS Secrets Manager. + RoleArn *string `type:"string"` + + // The new list of security groups for the DBProxy. + SecurityGroups []*string `type:"list"` +} + +// String returns the string representation +func (s ModifyDBProxyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyDBProxyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyDBProxyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyDBProxyInput"} + if s.DBProxyName == nil { + invalidParams.Add(request.NewErrParamRequired("DBProxyName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAuth sets the Auth field's value. +func (s *ModifyDBProxyInput) SetAuth(v []*UserAuthConfig) *ModifyDBProxyInput { + s.Auth = v + return s +} + +// SetDBProxyName sets the DBProxyName field's value. +func (s *ModifyDBProxyInput) SetDBProxyName(v string) *ModifyDBProxyInput { + s.DBProxyName = &v + return s +} + +// SetDebugLogging sets the DebugLogging field's value. +func (s *ModifyDBProxyInput) SetDebugLogging(v bool) *ModifyDBProxyInput { + s.DebugLogging = &v + return s +} + +// SetIdleClientTimeout sets the IdleClientTimeout field's value. +func (s *ModifyDBProxyInput) SetIdleClientTimeout(v int64) *ModifyDBProxyInput { + s.IdleClientTimeout = &v + return s +} + +// SetNewDBProxyName sets the NewDBProxyName field's value. +func (s *ModifyDBProxyInput) SetNewDBProxyName(v string) *ModifyDBProxyInput { + s.NewDBProxyName = &v + return s +} + +// SetRequireTLS sets the RequireTLS field's value. +func (s *ModifyDBProxyInput) SetRequireTLS(v bool) *ModifyDBProxyInput { + s.RequireTLS = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *ModifyDBProxyInput) SetRoleArn(v string) *ModifyDBProxyInput { + s.RoleArn = &v + return s +} + +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *ModifyDBProxyInput) SetSecurityGroups(v []*string) *ModifyDBProxyInput { + s.SecurityGroups = v + return s +} + +type ModifyDBProxyOutput struct { + _ struct{} `type:"structure"` + + // The DBProxy object representing the new settings for the proxy. + DBProxy *DBProxy `type:"structure"` +} + +// String returns the string representation +func (s ModifyDBProxyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyDBProxyOutput) GoString() string { + return s.String() +} + +// SetDBProxy sets the DBProxy field's value. +func (s *ModifyDBProxyOutput) SetDBProxy(v *DBProxy) *ModifyDBProxyOutput { + s.DBProxy = v + return s +} + +type ModifyDBProxyTargetGroupInput struct { + _ struct{} `type:"structure"` + + // The settings that determine the size and behavior of the connection pool + // for the target group. + ConnectionPoolConfig *ConnectionPoolConfiguration `type:"structure"` + + // The name of the new proxy to which to assign the target group. + // + // DBProxyName is a required field + DBProxyName *string `type:"string" required:"true"` + + // The new name for the modified DBProxyTarget. An identifier must begin with + // a letter and must contain only ASCII letters, digits, and hyphens; it can't + // end with a hyphen or contain two consecutive hyphens. + NewName *string `type:"string"` + + // The name of the new target group to assign to the proxy. + // + // TargetGroupName is a required field + TargetGroupName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ModifyDBProxyTargetGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyDBProxyTargetGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyDBProxyTargetGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyDBProxyTargetGroupInput"} + if s.DBProxyName == nil { + invalidParams.Add(request.NewErrParamRequired("DBProxyName")) + } + if s.TargetGroupName == nil { + invalidParams.Add(request.NewErrParamRequired("TargetGroupName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetConnectionPoolConfig sets the ConnectionPoolConfig field's value. +func (s *ModifyDBProxyTargetGroupInput) SetConnectionPoolConfig(v *ConnectionPoolConfiguration) *ModifyDBProxyTargetGroupInput { + s.ConnectionPoolConfig = v + return s +} + +// SetDBProxyName sets the DBProxyName field's value. +func (s *ModifyDBProxyTargetGroupInput) SetDBProxyName(v string) *ModifyDBProxyTargetGroupInput { + s.DBProxyName = &v + return s +} + +// SetNewName sets the NewName field's value. +func (s *ModifyDBProxyTargetGroupInput) SetNewName(v string) *ModifyDBProxyTargetGroupInput { + s.NewName = &v + return s +} + +// SetTargetGroupName sets the TargetGroupName field's value. +func (s *ModifyDBProxyTargetGroupInput) SetTargetGroupName(v string) *ModifyDBProxyTargetGroupInput { + s.TargetGroupName = &v + return s +} + +type ModifyDBProxyTargetGroupOutput struct { + _ struct{} `type:"structure"` + + // The settings of the modified DBProxyTarget. + DBProxyTargetGroup *DBProxyTargetGroup `type:"structure"` +} + +// String returns the string representation +func (s ModifyDBProxyTargetGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyDBProxyTargetGroupOutput) GoString() string { + return s.String() +} + +// SetDBProxyTargetGroup sets the DBProxyTargetGroup field's value. +func (s *ModifyDBProxyTargetGroupOutput) SetDBProxyTargetGroup(v *DBProxyTargetGroup) *ModifyDBProxyTargetGroupOutput { + s.DBProxyTargetGroup = v + return s +} + type ModifyDBSnapshotAttributeInput struct { _ struct{} `type:"structure"` @@ -28303,6 +33532,11 @@ type ModifyDBSnapshotInput struct { // * 11.2.0.4.v12 (supported for 11.2.0.2 DB snapshots) // // * 11.2.0.4.v11 (supported for 11.2.0.3 DB snapshots) + // + // PostgreSQL + // + // For the list of engine versions that are available for upgrading a DB snapshot, + // see Upgrading the PostgreSQL DB Engine for Amazon RDS (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.PostgreSQL.html#USER_UpgradeDBInstance.PostgreSQL.MajorVersion). EngineVersion *string `type:"string"` // The option group to identify with the upgraded DB snapshot. @@ -28494,7 +33728,7 @@ type ModifyEventSubscriptionInput struct { // The type of source that is 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. + // to db-instance. If this value isn't specified, all events are returned. // // Valid values: db-instance | db-parameter-group | db-security-group | db-snapshot SourceType *string `type:"string"` @@ -28591,7 +33825,7 @@ type ModifyGlobalClusterInput struct { DeletionProtection *bool `type:"boolean"` // The DB cluster identifier for the global cluster being modified. This parameter - // is not case-sensitive. + // isn't case-sensitive. // // Constraints: // @@ -29869,7 +35103,7 @@ type PendingMaintenanceAction struct { _ struct{} `type:"structure"` // The type of pending maintenance action that is available for the resource. - // Valid actions are system-update, db-upgrade, and hardware-maintenance. + // Valid actions are system-update, db-upgrade, hardware-maintenance, and ca-certificate-rotation. Action *string `type:"string"` // The date of the maintenance window when the action is applied. The maintenance @@ -30172,7 +35406,7 @@ type PromoteReadReplicaDBClusterInput struct { _ struct{} `type:"structure"` // The identifier of the DB cluster Read Replica to promote. This parameter - // is not case-sensitive. + // isn't case-sensitive. // // Constraints: // @@ -30508,7 +35742,7 @@ type RebootDBInstanceInput struct { // A value that indicates whether the reboot is conducted through a Multi-AZ // failover. // - // Constraint: You can't enable force failover if the instance is not configured + // Constraint: You can't enable force failover if the instance isn't configured // for Multi-AZ. ForceFailover *bool `type:"boolean"` } @@ -30607,6 +35841,95 @@ func (s *RecurringCharge) SetRecurringChargeFrequency(v string) *RecurringCharge return s } +type RegisterDBProxyTargetsInput struct { + _ struct{} `type:"structure"` + + // One or more DB cluster identifiers. + DBClusterIdentifiers []*string `type:"list"` + + // One or more DB instance identifiers. + DBInstanceIdentifiers []*string `type:"list"` + + // The identifier of the DBProxy that is associated with the DBProxyTargetGroup. + // + // DBProxyName is a required field + DBProxyName *string `type:"string" required:"true"` + + // The identifier of the DBProxyTargetGroup. + TargetGroupName *string `type:"string"` +} + +// String returns the string representation +func (s RegisterDBProxyTargetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterDBProxyTargetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RegisterDBProxyTargetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RegisterDBProxyTargetsInput"} + if s.DBProxyName == nil { + invalidParams.Add(request.NewErrParamRequired("DBProxyName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDBClusterIdentifiers sets the DBClusterIdentifiers field's value. +func (s *RegisterDBProxyTargetsInput) SetDBClusterIdentifiers(v []*string) *RegisterDBProxyTargetsInput { + s.DBClusterIdentifiers = v + return s +} + +// SetDBInstanceIdentifiers sets the DBInstanceIdentifiers field's value. +func (s *RegisterDBProxyTargetsInput) SetDBInstanceIdentifiers(v []*string) *RegisterDBProxyTargetsInput { + s.DBInstanceIdentifiers = v + return s +} + +// SetDBProxyName sets the DBProxyName field's value. +func (s *RegisterDBProxyTargetsInput) SetDBProxyName(v string) *RegisterDBProxyTargetsInput { + s.DBProxyName = &v + return s +} + +// SetTargetGroupName sets the TargetGroupName field's value. +func (s *RegisterDBProxyTargetsInput) SetTargetGroupName(v string) *RegisterDBProxyTargetsInput { + s.TargetGroupName = &v + return s +} + +type RegisterDBProxyTargetsOutput struct { + _ struct{} `type:"structure"` + + // One or more DBProxyTarget objects that are created when you register targets + // with a target group. + DBProxyTargets []*DBProxyTarget `type:"list"` +} + +// String returns the string representation +func (s RegisterDBProxyTargetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterDBProxyTargetsOutput) GoString() string { + return s.String() +} + +// SetDBProxyTargets sets the DBProxyTargets field's value. +func (s *RegisterDBProxyTargetsOutput) SetDBProxyTargets(v []*DBProxyTarget) *RegisterDBProxyTargetsOutput { + s.DBProxyTargets = v + return s +} + type RemoveFromGlobalClusterInput struct { _ struct{} `type:"structure"` @@ -31492,6 +36815,19 @@ type RestoreDBClusterFromS3Input struct { // deletion protection is disabled. DeletionProtection *bool `type:"boolean"` + // Specify the Active Directory directory ID to restore the DB cluster in. The + // domain must be created prior to this operation. + // + // For Amazon Aurora DB clusters, Amazon RDS can use Kerberos Authentication + // to authenticate users that connect to the DB cluster. For more information, + // see Using Kerberos Authentication for Aurora MySQL (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurmysql-kerberos.html) + // in the Amazon Aurora User Guide. + 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 list of logs that the restored DB cluster is to export to CloudWatch // Logs. The values in the list depend on the DB engine being used. For more // information, see Publishing Database Logs to Amazon CloudWatch Logs (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch) @@ -31771,6 +37107,18 @@ func (s *RestoreDBClusterFromS3Input) SetDeletionProtection(v bool) *RestoreDBCl return s } +// SetDomain sets the Domain field's value. +func (s *RestoreDBClusterFromS3Input) SetDomain(v string) *RestoreDBClusterFromS3Input { + s.Domain = &v + return s +} + +// SetDomainIAMRoleName sets the DomainIAMRoleName field's value. +func (s *RestoreDBClusterFromS3Input) SetDomainIAMRoleName(v string) *RestoreDBClusterFromS3Input { + s.DomainIAMRoleName = &v + return s +} + // SetEnableCloudwatchLogsExports sets the EnableCloudwatchLogsExports field's value. func (s *RestoreDBClusterFromS3Input) SetEnableCloudwatchLogsExports(v []*string) *RestoreDBClusterFromS3Input { s.EnableCloudwatchLogsExports = v @@ -31980,6 +37328,14 @@ type RestoreDBClusterFromSnapshotInput struct { // deletion protection is disabled. DeletionProtection *bool `type:"boolean"` + // Specify the Active Directory directory ID to restore the DB cluster in. The + // domain must be created prior to this operation. + 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 list of logs that the restored DB cluster is to export to Amazon CloudWatch // Logs. The values in the list depend on the DB engine being used. For more // information, see Publishing Database Logs to Amazon CloudWatch Logs (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch) @@ -32023,6 +37379,9 @@ type RestoreDBClusterFromSnapshotInput struct { // // aws rds describe-db-engine-versions --engine aurora-postgresql --query "DBEngineVersions[].EngineVersion" // + // If you aren't using the default engine version, then you must specify the + // engine version. + // // Aurora MySQL // // Example: 5.6.10a, 5.6.mysql_aurora.1.19.2, 5.7.12, 5.7.mysql_aurora.2.04.5 @@ -32047,8 +37406,8 @@ type RestoreDBClusterFromSnapshotInput struct { // then the restored DB cluster is encrypted using the KMS key that was used // to encrypt the DB snapshot or DB cluster snapshot. // - // * If the DB snapshot or DB cluster snapshot in SnapshotIdentifier is not - // encrypted, then the restored DB cluster is not encrypted. + // * If the DB snapshot or DB cluster snapshot in SnapshotIdentifier isn't + // encrypted, then the restored DB cluster isn't encrypted. KmsKeyId *string `type:"string"` // The name of the option group to use for the restored DB cluster. @@ -32162,6 +37521,18 @@ func (s *RestoreDBClusterFromSnapshotInput) SetDeletionProtection(v bool) *Resto return s } +// SetDomain sets the Domain field's value. +func (s *RestoreDBClusterFromSnapshotInput) SetDomain(v string) *RestoreDBClusterFromSnapshotInput { + s.Domain = &v + return s +} + +// SetDomainIAMRoleName sets the DomainIAMRoleName field's value. +func (s *RestoreDBClusterFromSnapshotInput) SetDomainIAMRoleName(v string) *RestoreDBClusterFromSnapshotInput { + s.DomainIAMRoleName = &v + return s +} + // SetEnableCloudwatchLogsExports sets the EnableCloudwatchLogsExports field's value. func (s *RestoreDBClusterFromSnapshotInput) SetEnableCloudwatchLogsExports(v []*string) *RestoreDBClusterFromSnapshotInput { s.EnableCloudwatchLogsExports = v @@ -32319,6 +37690,19 @@ type RestoreDBClusterToPointInTimeInput struct { // deletion protection is disabled. DeletionProtection *bool `type:"boolean"` + // Specify the Active Directory directory ID to restore the DB cluster in. The + // domain must be created prior to this operation. + // + // For Amazon Aurora DB clusters, Amazon RDS can use Kerberos Authentication + // to authenticate users that connect to the DB cluster. For more information, + // see Using Kerberos Authentication for Aurora MySQL (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurmysql-kerberos.html) + // in the Amazon Aurora User Guide. + 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 list of logs that the restored DB cluster is to export to CloudWatch // Logs. The values in the list depend on the DB engine being used. For more // information, see Publishing Database Logs to Amazon CloudWatch Logs (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch) @@ -32351,10 +37735,10 @@ type RestoreDBClusterToPointInTimeInput struct { // * 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 the DB cluster isn't encrypted, then the restored DB cluster isn't + // encrypted. // - // If DBClusterIdentifier refers to a DB cluster that is not encrypted, then + // If DBClusterIdentifier refers to a DB cluster that isn't encrypted, then // the restore request is rejected. KmsKeyId *string `type:"string"` @@ -32376,7 +37760,7 @@ type RestoreDBClusterToPointInTimeInput struct { // // * Must be before the latest restorable time for the DB instance // - // * Must be specified if UseLatestRestorableTime parameter is not provided + // * Must be specified if UseLatestRestorableTime parameter isn't provided // // * Can't be specified if the UseLatestRestorableTime parameter is enabled // @@ -32415,7 +37799,7 @@ type RestoreDBClusterToPointInTimeInput struct { Tags []*Tag `locationNameList:"Tag" type:"list"` // A value that indicates whether to restore the DB cluster to the latest restorable - // backup time. By default, the DB cluster is not restored to the latest restorable + // backup time. By default, the DB cluster isn't restored to the latest restorable // backup time. // // Constraints: Can't be specified if RestoreToTime parameter is provided. @@ -32487,6 +37871,18 @@ func (s *RestoreDBClusterToPointInTimeInput) SetDeletionProtection(v bool) *Rest return s } +// SetDomain sets the Domain field's value. +func (s *RestoreDBClusterToPointInTimeInput) SetDomain(v string) *RestoreDBClusterToPointInTimeInput { + s.Domain = &v + return s +} + +// SetDomainIAMRoleName sets the DomainIAMRoleName field's value. +func (s *RestoreDBClusterToPointInTimeInput) SetDomainIAMRoleName(v string) *RestoreDBClusterToPointInTimeInput { + s.DomainIAMRoleName = &v + return s +} + // SetEnableCloudwatchLogsExports sets the EnableCloudwatchLogsExports field's value. func (s *RestoreDBClusterToPointInTimeInput) SetEnableCloudwatchLogsExports(v []*string) *RestoreDBClusterToPointInTimeInput { s.EnableCloudwatchLogsExports = v @@ -32740,7 +38136,7 @@ type RestoreDBInstanceFromDBSnapshotInput struct { 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 + // I/O operations per second. If this parameter isn't specified, the IOPS value // is taken from the backup. If this parameter is set to 0, the new instance // is converted to a non-PIOPS instance. The conversion takes additional time, // though your DB instance is available for connections before the conversion @@ -32788,7 +38184,7 @@ type RestoreDBInstanceFromDBSnapshotInput struct { // A value that indicates whether the DB instance is publicly accessible. When // the DB instance is publicly accessible, it is an Internet-facing instance // with a publicly resolvable DNS name, which resolves to a public IP address. - // When the DB instance is not publicly accessible, it is an internal instance + // When the DB instance isn't publicly accessible, it is an internal instance // with a DNS name that resolves to a private IP address. For more information, // see CreateDBInstance. PubliclyAccessible *bool `type:"boolean"` @@ -33088,8 +38484,7 @@ type RestoreDBInstanceFromS3Input struct { // for your engine, see DB Instance Class (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Concepts.DBInstanceClass.html) // in the Amazon RDS User Guide. // - // Importing from Amazon S3 is not supported on the db.t2.micro DB instance - // class. + // Importing from Amazon S3 isn't supported on the db.t2.micro DB instance class. // // DBInstanceClass is a required field DBInstanceClass *string `type:"string" required:"true"` @@ -33301,7 +38696,7 @@ type RestoreDBInstanceFromS3Input struct { // A value that indicates whether the DB instance is publicly accessible. When // the DB instance is publicly accessible, it is an Internet-facing instance // with a publicly resolvable DNS name, which resolves to a public IP address. - // When the DB instance is not publicly accessible, it is an internal instance + // When the DB instance isn't publicly accessible, it is an internal instance // with a DNS name that resolves to a private IP address. For more information, // see CreateDBInstance. PubliclyAccessible *bool `type:"boolean"` @@ -33715,7 +39110,7 @@ type RestoreDBInstanceToPointInTimeInput struct { // The database name for the restored DB instance. // - // This parameter is not used for the MySQL or MariaDB engines. + // This parameter isn't used for the MySQL or MariaDB engines. DBName *string `type:"string"` // The name of the DB parameter group to associate with this DB instance. @@ -33821,7 +39216,7 @@ type RestoreDBInstanceToPointInTimeInput struct { // // SQL Server // - // Setting the IOPS value for the SQL Server database engine is not supported. + // Setting the IOPS value for the SQL Server database engine isn't supported. Iops *int64 `type:"integer"` // License model information for the restored DB instance. @@ -33858,7 +39253,7 @@ type RestoreDBInstanceToPointInTimeInput struct { // A value that indicates whether the DB instance is publicly accessible. When // the DB instance is publicly accessible, it is an Internet-facing instance // with a publicly resolvable DNS name, which resolves to a public IP address. - // When the DB instance is not publicly accessible, it is an internal instance + // When the DB instance isn't publicly accessible, it is an internal instance // with a DNS name that resolves to a private IP address. For more information, // see CreateDBInstance. PubliclyAccessible *bool `type:"boolean"` @@ -33924,8 +39319,8 @@ type RestoreDBInstanceToPointInTimeInput struct { UseDefaultProcessorFeatures *bool `type:"boolean"` // A value that indicates whether the DB instance is restored from the latest - // backup time. By default, the DB instance is not restored from the latest - // backup time. + // backup time. By default, the DB instance isn't restored from the latest backup + // time. // // Constraints: Can't be specified if the RestoreTime parameter is provided. UseLatestRestorableTime *bool `type:"boolean"` @@ -34226,8 +39621,8 @@ type RevokeDBSecurityGroupIngressInput struct { // 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 + // The AWS account number of the owner of the EC2 security group specified in + // the EC2SecurityGroupName parameter. The AWS access key ID isn't an acceptable // value. For VPC DB security groups, EC2SecurityGroupId must be provided. Otherwise, // EC2SecurityGroupOwnerId and either EC2SecurityGroupName or EC2SecurityGroupId // must be provided. @@ -34331,14 +39726,22 @@ type ScalingConfiguration struct { // The maximum capacity for an Aurora DB cluster in serverless DB engine mode. // - // Valid capacity values are 1, 2, 4, 8, 16, 32, 64, 128, and 256. + // For Aurora MySQL, valid capacity values are 1, 2, 4, 8, 16, 32, 64, 128, + // and 256. + // + // For Aurora PostgreSQL, valid capacity values are 2, 4, 8, 16, 32, 64, 192, + // and 384. // // The maximum capacity must be greater than or equal to the minimum capacity. MaxCapacity *int64 `type:"integer"` // The minimum capacity for an Aurora DB cluster in serverless DB engine mode. // - // Valid capacity values are 1, 2, 4, 8, 16, 32, 64, 128, and 256. + // For Aurora MySQL, valid capacity values are 1, 2, 4, 8, 16, 32, 64, 128, + // and 256. + // + // For Aurora PostgreSQL, valid capacity values are 2, 4, 8, 16, 32, 64, 192, + // and 384. // // The minimum capacity must be less than or equal to the maximum capacity. MinCapacity *int64 `type:"integer"` @@ -34353,7 +39756,7 @@ type ScalingConfiguration struct { // as possible. // // RollbackCapacityChange, the default, ignores the capacity change if a scaling - // point is not found in the timeout period. + // point isn't found in the timeout period. // // If you specify ForceApplyCapacityChange, connections that prevent Aurora // Serverless from finding a scaling point might be dropped. @@ -34786,6 +40189,307 @@ func (s *StartDBInstanceOutput) SetDBInstance(v *DBInstance) *StartDBInstanceOut return s } +type StartExportTaskInput struct { + _ struct{} `type:"structure"` + + // The data to be exported from the snapshot. If this parameter is not provided, + // all the snapshot data is exported. Valid values are the following: + // + // * database - Export all the data of the snapshot. + // + // * database.table [table-name] - Export a table of the snapshot. + // + // * database.schema [schema-name] - Export a database schema of the snapshot. + // This value isn't valid for RDS for MySQL, RDS for MariaDB, or Aurora MySQL. + // + // * database.schema.table [table-name] - Export a table of the database + // schema. This value isn't valid for RDS for MySQL, RDS for MariaDB, or + // Aurora MySQL. + ExportOnly []*string `type:"list"` + + // A unique identifier for the snapshot export task. This ID isn't an identifier + // for the Amazon S3 bucket where the snapshot is to be exported to. + // + // ExportTaskIdentifier is a required field + ExportTaskIdentifier *string `type:"string" required:"true"` + + // The name of the IAM role to use for writing to the Amazon S3 bucket when + // exporting a snapshot. + // + // IamRoleArn is a required field + IamRoleArn *string `type:"string" required:"true"` + + // The ID of the AWS KMS key to use to encrypt the snapshot exported to Amazon + // S3. The KMS key ID is the Amazon Resource Name (ARN), the KMS key identifier, + // or the KMS key alias for the KMS encryption key. The IAM role used for the + // snapshot export must have encryption and decryption permissions to use this + // KMS key. + // + // KmsKeyId is a required field + KmsKeyId *string `type:"string" required:"true"` + + // The name of the Amazon S3 bucket to export the snapshot to. + // + // S3BucketName is a required field + S3BucketName *string `type:"string" required:"true"` + + // The Amazon S3 bucket prefix to use as the file name and path of the exported + // snapshot. + S3Prefix *string `type:"string"` + + // The Amazon Resource Name (ARN) of the snapshot to export to Amazon S3. + // + // SourceArn is a required field + SourceArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s StartExportTaskInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartExportTaskInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartExportTaskInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartExportTaskInput"} + if s.ExportTaskIdentifier == nil { + invalidParams.Add(request.NewErrParamRequired("ExportTaskIdentifier")) + } + if s.IamRoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("IamRoleArn")) + } + if s.KmsKeyId == nil { + invalidParams.Add(request.NewErrParamRequired("KmsKeyId")) + } + if s.S3BucketName == nil { + invalidParams.Add(request.NewErrParamRequired("S3BucketName")) + } + if s.SourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("SourceArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetExportOnly sets the ExportOnly field's value. +func (s *StartExportTaskInput) SetExportOnly(v []*string) *StartExportTaskInput { + s.ExportOnly = v + return s +} + +// SetExportTaskIdentifier sets the ExportTaskIdentifier field's value. +func (s *StartExportTaskInput) SetExportTaskIdentifier(v string) *StartExportTaskInput { + s.ExportTaskIdentifier = &v + return s +} + +// SetIamRoleArn sets the IamRoleArn field's value. +func (s *StartExportTaskInput) SetIamRoleArn(v string) *StartExportTaskInput { + s.IamRoleArn = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *StartExportTaskInput) SetKmsKeyId(v string) *StartExportTaskInput { + s.KmsKeyId = &v + return s +} + +// SetS3BucketName sets the S3BucketName field's value. +func (s *StartExportTaskInput) SetS3BucketName(v string) *StartExportTaskInput { + s.S3BucketName = &v + return s +} + +// SetS3Prefix sets the S3Prefix field's value. +func (s *StartExportTaskInput) SetS3Prefix(v string) *StartExportTaskInput { + s.S3Prefix = &v + return s +} + +// SetSourceArn sets the SourceArn field's value. +func (s *StartExportTaskInput) SetSourceArn(v string) *StartExportTaskInput { + s.SourceArn = &v + return s +} + +// Contains the details of a snapshot export to Amazon S3. +// +// This data type is used as a response element in the DescribeExportTasks action. +type StartExportTaskOutput struct { + _ struct{} `type:"structure"` + + // The data exported from the snapshot. Valid values are the following: + // + // * database - Export all the data of the snapshot. + // + // * database.table [table-name] - Export a table of the snapshot. + // + // * database.schema [schema-name] - Export a database schema of the snapshot. + // This value isn't valid for RDS for MySQL, RDS for MariaDB, or Aurora MySQL. + // + // * database.schema.table [table-name] - Export a table of the database + // schema. This value isn't valid for RDS for MySQL, RDS for MariaDB, or + // Aurora MySQL. + ExportOnly []*string `type:"list"` + + // A unique identifier for the snapshot export task. This ID isn't an identifier + // for the Amazon S3 bucket where the snapshot is exported to. + ExportTaskIdentifier *string `type:"string"` + + // The reason the export failed, if it failed. + FailureCause *string `type:"string"` + + // The name of the IAM role that is used to write to Amazon S3 when exporting + // a snapshot. + IamRoleArn *string `type:"string"` + + // The ID of the AWS KMS key that is used to encrypt the snapshot when it's + // exported to Amazon S3. The KMS key ID is the Amazon Resource Name (ARN), + // the KMS key identifier, or the KMS key alias for the KMS encryption key. + // The IAM role used for the snapshot export must have encryption and decryption + // permissions to use this KMS key. + KmsKeyId *string `type:"string"` + + // The progress of the snapshot export task as a percentage. + PercentProgress *int64 `type:"integer"` + + // The Amazon S3 bucket that the snapshot is exported to. + S3Bucket *string `type:"string"` + + // The Amazon S3 bucket prefix that is the file name and path of the exported + // snapshot. + S3Prefix *string `type:"string"` + + // The time that the snapshot was created. + SnapshotTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of the snapshot exported to Amazon S3. + SourceArn *string `type:"string"` + + // The progress status of the export task. + Status *string `type:"string"` + + // The time that the snapshot export task completed. + TaskEndTime *time.Time `type:"timestamp"` + + // The time that the snapshot export task started. + TaskStartTime *time.Time `type:"timestamp"` + + // The total amount of data exported, in gigabytes. + TotalExtractedDataInGB *int64 `type:"integer"` + + // A warning about the snapshot export task. + WarningMessage *string `type:"string"` +} + +// String returns the string representation +func (s StartExportTaskOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartExportTaskOutput) GoString() string { + return s.String() +} + +// SetExportOnly sets the ExportOnly field's value. +func (s *StartExportTaskOutput) SetExportOnly(v []*string) *StartExportTaskOutput { + s.ExportOnly = v + return s +} + +// SetExportTaskIdentifier sets the ExportTaskIdentifier field's value. +func (s *StartExportTaskOutput) SetExportTaskIdentifier(v string) *StartExportTaskOutput { + s.ExportTaskIdentifier = &v + return s +} + +// SetFailureCause sets the FailureCause field's value. +func (s *StartExportTaskOutput) SetFailureCause(v string) *StartExportTaskOutput { + s.FailureCause = &v + return s +} + +// SetIamRoleArn sets the IamRoleArn field's value. +func (s *StartExportTaskOutput) SetIamRoleArn(v string) *StartExportTaskOutput { + s.IamRoleArn = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *StartExportTaskOutput) SetKmsKeyId(v string) *StartExportTaskOutput { + s.KmsKeyId = &v + return s +} + +// SetPercentProgress sets the PercentProgress field's value. +func (s *StartExportTaskOutput) SetPercentProgress(v int64) *StartExportTaskOutput { + s.PercentProgress = &v + return s +} + +// SetS3Bucket sets the S3Bucket field's value. +func (s *StartExportTaskOutput) SetS3Bucket(v string) *StartExportTaskOutput { + s.S3Bucket = &v + return s +} + +// SetS3Prefix sets the S3Prefix field's value. +func (s *StartExportTaskOutput) SetS3Prefix(v string) *StartExportTaskOutput { + s.S3Prefix = &v + return s +} + +// SetSnapshotTime sets the SnapshotTime field's value. +func (s *StartExportTaskOutput) SetSnapshotTime(v time.Time) *StartExportTaskOutput { + s.SnapshotTime = &v + return s +} + +// SetSourceArn sets the SourceArn field's value. +func (s *StartExportTaskOutput) SetSourceArn(v string) *StartExportTaskOutput { + s.SourceArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *StartExportTaskOutput) SetStatus(v string) *StartExportTaskOutput { + s.Status = &v + return s +} + +// SetTaskEndTime sets the TaskEndTime field's value. +func (s *StartExportTaskOutput) SetTaskEndTime(v time.Time) *StartExportTaskOutput { + s.TaskEndTime = &v + return s +} + +// SetTaskStartTime sets the TaskStartTime field's value. +func (s *StartExportTaskOutput) SetTaskStartTime(v time.Time) *StartExportTaskOutput { + s.TaskStartTime = &v + return s +} + +// SetTotalExtractedDataInGB sets the TotalExtractedDataInGB field's value. +func (s *StartExportTaskOutput) SetTotalExtractedDataInGB(v int64) *StartExportTaskOutput { + s.TotalExtractedDataInGB = &v + return s +} + +// SetWarningMessage sets the WarningMessage field's value. +func (s *StartExportTaskOutput) SetWarningMessage(v string) *StartExportTaskOutput { + s.WarningMessage = &v + return s +} + type StopActivityStreamInput struct { _ struct{} `type:"structure"` @@ -35188,6 +40892,146 @@ func (s *UpgradeTarget) SetIsMajorVersionUpgrade(v bool) *UpgradeTarget { return s } +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// Specifies the details of authentication used by a proxy to log in as a specific +// database user. +type UserAuthConfig struct { + _ struct{} `type:"structure"` + + // The type of authentication that the proxy uses for connections from the proxy + // to the underlying database. + AuthScheme *string `type:"string" enum:"AuthScheme"` + + // A user-specified description about the authentication used by a proxy to + // log in as a specific database user. + Description *string `type:"string"` + + // Whether to require or disallow AWS Identity and Access Management (IAM) authentication + // for connections to the proxy. + IAMAuth *string `type:"string" enum:"IAMAuthMode"` + + // The Amazon Resource Name (ARN) representing the secret that the proxy uses + // to authenticate to the RDS DB instance or Aurora DB cluster. These secrets + // are stored within Amazon Secrets Manager. + SecretArn *string `type:"string"` + + // The name of the database user to which the proxy connects. + UserName *string `type:"string"` +} + +// String returns the string representation +func (s UserAuthConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserAuthConfig) GoString() string { + return s.String() +} + +// SetAuthScheme sets the AuthScheme field's value. +func (s *UserAuthConfig) SetAuthScheme(v string) *UserAuthConfig { + s.AuthScheme = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *UserAuthConfig) SetDescription(v string) *UserAuthConfig { + s.Description = &v + return s +} + +// SetIAMAuth sets the IAMAuth field's value. +func (s *UserAuthConfig) SetIAMAuth(v string) *UserAuthConfig { + s.IAMAuth = &v + return s +} + +// SetSecretArn sets the SecretArn field's value. +func (s *UserAuthConfig) SetSecretArn(v string) *UserAuthConfig { + s.SecretArn = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *UserAuthConfig) SetUserName(v string) *UserAuthConfig { + s.UserName = &v + return s +} + +// +// This is prerelease documentation for the RDS Database Proxy feature in preview +// release. It is subject to change. +// +// Returns the details of authentication used by a proxy to log in as a specific +// database user. +type UserAuthConfigInfo struct { + _ struct{} `type:"structure"` + + // The type of authentication that the proxy uses for connections from the proxy + // to the underlying database. + AuthScheme *string `type:"string" enum:"AuthScheme"` + + // A user-specified description about the authentication used by a proxy to + // log in as a specific database user. + Description *string `type:"string"` + + // Whether to require or disallow AWS Identity and Access Management (IAM) authentication + // for connections to the proxy. + IAMAuth *string `type:"string" enum:"IAMAuthMode"` + + // The Amazon Resource Name (ARN) representing the secret that the proxy uses + // to authenticate to the RDS DB instance or Aurora DB cluster. These secrets + // are stored within Amazon Secrets Manager. + SecretArn *string `type:"string"` + + // The name of the database user to which the proxy connects. + UserName *string `type:"string"` +} + +// String returns the string representation +func (s UserAuthConfigInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserAuthConfigInfo) GoString() string { + return s.String() +} + +// SetAuthScheme sets the AuthScheme field's value. +func (s *UserAuthConfigInfo) SetAuthScheme(v string) *UserAuthConfigInfo { + s.AuthScheme = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *UserAuthConfigInfo) SetDescription(v string) *UserAuthConfigInfo { + s.Description = &v + return s +} + +// SetIAMAuth sets the IAMAuth field's value. +func (s *UserAuthConfigInfo) SetIAMAuth(v string) *UserAuthConfigInfo { + s.IAMAuth = &v + return s +} + +// SetSecretArn sets the SecretArn field's value. +func (s *UserAuthConfigInfo) SetSecretArn(v string) *UserAuthConfigInfo { + s.SecretArn = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *UserAuthConfigInfo) SetUserName(v string) *UserAuthConfigInfo { + s.UserName = &v + return s +} + // Information about valid modifications that you can make to your DB instance. // Contains the result of a successful call to the DescribeValidDBInstanceModifications // action. You can use this information when you call ModifyDBInstance. @@ -35322,6 +41166,80 @@ func (s *VpcSecurityGroupMembership) SetVpcSecurityGroupId(v string) *VpcSecurit return s } +// Information about the virtual private network (VPN) between the VMware vSphere +// cluster and the AWS website. +// +// For more information about RDS on VMware, see the RDS on VMware User Guide. +// (https://docs.aws.amazon.com/AmazonRDS/latest/RDSonVMwareUserGuide/rds-on-vmware.html) +type VpnDetails struct { + _ struct{} `type:"structure"` + + // The IP address of network traffic from AWS to your on-premises data center. + VpnGatewayIp *string `type:"string"` + + // The ID of the VPN. + VpnId *string `type:"string"` + + // The name of the VPN. + VpnName *string `type:"string"` + + // The preshared key (PSK) for the VPN. + VpnPSK *string `type:"string" sensitive:"true"` + + // The state of the VPN. + VpnState *string `type:"string"` + + // The IP address of network traffic from your on-premises data center. A custom + // AZ receives the network traffic. + VpnTunnelOriginatorIP *string `type:"string"` +} + +// String returns the string representation +func (s VpnDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpnDetails) GoString() string { + return s.String() +} + +// SetVpnGatewayIp sets the VpnGatewayIp field's value. +func (s *VpnDetails) SetVpnGatewayIp(v string) *VpnDetails { + s.VpnGatewayIp = &v + return s +} + +// SetVpnId sets the VpnId field's value. +func (s *VpnDetails) SetVpnId(v string) *VpnDetails { + s.VpnId = &v + return s +} + +// SetVpnName sets the VpnName field's value. +func (s *VpnDetails) SetVpnName(v string) *VpnDetails { + s.VpnName = &v + return s +} + +// SetVpnPSK sets the VpnPSK field's value. +func (s *VpnDetails) SetVpnPSK(v string) *VpnDetails { + s.VpnPSK = &v + return s +} + +// SetVpnState sets the VpnState field's value. +func (s *VpnDetails) SetVpnState(v string) *VpnDetails { + s.VpnState = &v + return s +} + +// SetVpnTunnelOriginatorIP sets the VpnTunnelOriginatorIP field's value. +func (s *VpnDetails) SetVpnTunnelOriginatorIP(v string) *VpnDetails { + s.VpnTunnelOriginatorIP = &v + return s +} + const ( // ActivityStreamModeSync is a ActivityStreamMode enum value ActivityStreamModeSync = "sync" @@ -35352,6 +41270,44 @@ const ( ApplyMethodPendingReboot = "pending-reboot" ) +const ( + // AuthSchemeSecrets is a AuthScheme enum value + AuthSchemeSecrets = "SECRETS" +) + +const ( + // DBProxyStatusAvailable is a DBProxyStatus enum value + DBProxyStatusAvailable = "available" + + // DBProxyStatusModifying is a DBProxyStatus enum value + DBProxyStatusModifying = "modifying" + + // DBProxyStatusIncompatibleNetwork is a DBProxyStatus enum value + DBProxyStatusIncompatibleNetwork = "incompatible-network" + + // DBProxyStatusInsufficientResourceLimits is a DBProxyStatus enum value + DBProxyStatusInsufficientResourceLimits = "insufficient-resource-limits" + + // DBProxyStatusCreating is a DBProxyStatus enum value + DBProxyStatusCreating = "creating" + + // DBProxyStatusDeleting is a DBProxyStatus enum value + DBProxyStatusDeleting = "deleting" +) + +const ( + // EngineFamilyMysql is a EngineFamily enum value + EngineFamilyMysql = "MYSQL" +) + +const ( + // IAMAuthModeDisabled is a IAMAuthMode enum value + IAMAuthModeDisabled = "DISABLED" + + // IAMAuthModeRequired is a IAMAuthMode enum value + IAMAuthModeRequired = "REQUIRED" +) + const ( // SourceTypeDbInstance is a SourceType enum value SourceTypeDbInstance = "db-instance" @@ -35371,3 +41327,14 @@ const ( // SourceTypeDbClusterSnapshot is a SourceType enum value SourceTypeDbClusterSnapshot = "db-cluster-snapshot" ) + +const ( + // TargetTypeRdsInstance is a TargetType enum value + TargetTypeRdsInstance = "RDS_INSTANCE" + + // TargetTypeRdsServerlessEndpoint is a TargetType enum value + TargetTypeRdsServerlessEndpoint = "RDS_SERVERLESS_ENDPOINT" + + // TargetTypeTrackedCluster is a TargetType enum value + TargetTypeTrackedCluster = "TRACKED_CLUSTER" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/rds/doc.go b/vendor/github.com/aws/aws-sdk-go/service/rds/doc.go index bf5140b1477..85e0405d463 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/rds/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/rds/doc.go @@ -6,9 +6,9 @@ // // 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, resizable 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. +// 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 @@ -21,13 +21,13 @@ // 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. +// or command line interface you can use to manage Amazon RDS. 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 // 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 index 86ee24482b0..d1178110658 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/rds/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/rds/errors.go @@ -7,18 +7,18 @@ const ( // ErrCodeAuthorizationAlreadyExistsFault for service response error code // "AuthorizationAlreadyExists". // - // The specified CIDRIP or Amazon EC2 security group is already authorized for - // the specified DB security group. + // The specified CIDR IP range or Amazon EC2 security group is already authorized + // for the specified DB security group. ErrCodeAuthorizationAlreadyExistsFault = "AuthorizationAlreadyExists" // ErrCodeAuthorizationNotFoundFault for service response error code // "AuthorizationNotFound". // - // The specified CIDRIP or Amazon EC2 security group isn't authorized for the - // specified DB security group. + // The specified CIDR IP range or Amazon EC2 security group might not be authorized + // for the specified DB security group. // - // RDS also may not be authorized by using IAM to perform necessary actions - // on your behalf. + // Or, RDS might not be authorized to perform necessary actions using IAM on + // your behalf. ErrCodeAuthorizationNotFoundFault = "AuthorizationNotFound" // ErrCodeAuthorizationQuotaExceededFault for service response error code @@ -37,6 +37,26 @@ const ( // CertificateIdentifier doesn't refer to an existing certificate. ErrCodeCertificateNotFoundFault = "CertificateNotFound" + // ErrCodeCustomAvailabilityZoneAlreadyExistsFault for service response error code + // "CustomAvailabilityZoneAlreadyExists". + // + // CustomAvailabilityZoneName is already used by an existing custom Availability + // Zone. + ErrCodeCustomAvailabilityZoneAlreadyExistsFault = "CustomAvailabilityZoneAlreadyExists" + + // ErrCodeCustomAvailabilityZoneNotFoundFault for service response error code + // "CustomAvailabilityZoneNotFound". + // + // CustomAvailabilityZoneId doesn't refer to an existing custom Availability + // Zone identifier. + ErrCodeCustomAvailabilityZoneNotFoundFault = "CustomAvailabilityZoneNotFound" + + // ErrCodeCustomAvailabilityZoneQuotaExceededFault for service response error code + // "CustomAvailabilityZoneQuotaExceeded". + // + // You have exceeded the maximum number of custom Availability Zones. + ErrCodeCustomAvailabilityZoneQuotaExceededFault = "CustomAvailabilityZoneQuotaExceeded" + // ErrCodeDBClusterAlreadyExistsFault for service response error code // "DBClusterAlreadyExistsFault". // @@ -156,7 +176,7 @@ const ( // ErrCodeDBInstanceRoleNotFoundFault for service response error code // "DBInstanceRoleNotFound". // - // The specified RoleArn value doesn't match the specifed feature for the DB + // The specified RoleArn value doesn't match the specified feature for the DB // instance. ErrCodeDBInstanceRoleNotFoundFault = "DBInstanceRoleNotFound" @@ -192,6 +212,48 @@ const ( // groups. ErrCodeDBParameterGroupQuotaExceededFault = "DBParameterGroupQuotaExceeded" + // ErrCodeDBProxyAlreadyExistsFault for service response error code + // "DBProxyTargetExistsFault". + // + // The specified proxy name must be unique for all proxies owned by your AWS + // account in the specified AWS Region. + ErrCodeDBProxyAlreadyExistsFault = "DBProxyTargetExistsFault" + + // ErrCodeDBProxyNotFoundFault for service response error code + // "DBProxyNotFoundFault". + // + // The specified proxy name doesn't correspond to a proxy owned by your AWS + // accoutn in the specified AWS Region. + ErrCodeDBProxyNotFoundFault = "DBProxyNotFoundFault" + + // ErrCodeDBProxyQuotaExceededFault for service response error code + // "DBProxyQuotaExceededFault". + // + // Your AWS account already has the maximum number of proxies in the specified + // AWS Region. + ErrCodeDBProxyQuotaExceededFault = "DBProxyQuotaExceededFault" + + // ErrCodeDBProxyTargetAlreadyRegisteredFault for service response error code + // "DBProxyTargetAlreadyRegisteredFault". + // + // The proxy is already associated with the specified RDS DB instance or Aurora + // DB cluster. + ErrCodeDBProxyTargetAlreadyRegisteredFault = "DBProxyTargetAlreadyRegisteredFault" + + // ErrCodeDBProxyTargetGroupNotFoundFault for service response error code + // "DBProxyTargetGroupNotFoundFault". + // + // The specified target group isn't available for a proxy owned by your AWS + // account in the specified AWS Region. + ErrCodeDBProxyTargetGroupNotFoundFault = "DBProxyTargetGroupNotFoundFault" + + // ErrCodeDBProxyTargetNotFoundFault for service response error code + // "DBProxyTargetNotFoundFault". + // + // The specified RDS DB instance or Aurora DB cluster isn't available for a + // proxy owned by your AWS account in the specified AWS Region. + ErrCodeDBProxyTargetNotFoundFault = "DBProxyTargetNotFoundFault" + // ErrCodeDBSecurityGroupAlreadyExistsFault for service response error code // "DBSecurityGroupAlreadyExists". // @@ -288,6 +350,18 @@ const ( // You have reached the maximum number of event subscriptions. ErrCodeEventSubscriptionQuotaExceededFault = "EventSubscriptionQuotaExceeded" + // ErrCodeExportTaskAlreadyExistsFault for service response error code + // "ExportTaskAlreadyExists". + // + // You can't start an export task that's already running. + ErrCodeExportTaskAlreadyExistsFault = "ExportTaskAlreadyExists" + + // ErrCodeExportTaskNotFoundFault for service response error code + // "ExportTaskNotFound". + // + // The export task doesn't exist. + ErrCodeExportTaskNotFoundFault = "ExportTaskNotFound" + // ErrCodeGlobalClusterAlreadyExistsFault for service response error code // "GlobalClusterAlreadyExistsFault". ErrCodeGlobalClusterAlreadyExistsFault = "GlobalClusterAlreadyExistsFault" @@ -300,6 +374,30 @@ const ( // "GlobalClusterQuotaExceededFault". ErrCodeGlobalClusterQuotaExceededFault = "GlobalClusterQuotaExceededFault" + // ErrCodeIamRoleMissingPermissionsFault for service response error code + // "IamRoleMissingPermissions". + // + // The IAM role requires additional permissions to export to an Amazon S3 bucket. + ErrCodeIamRoleMissingPermissionsFault = "IamRoleMissingPermissions" + + // ErrCodeIamRoleNotFoundFault for service response error code + // "IamRoleNotFound". + // + // The IAM role is missing for exporting to an Amazon S3 bucket. + ErrCodeIamRoleNotFoundFault = "IamRoleNotFound" + + // ErrCodeInstallationMediaAlreadyExistsFault for service response error code + // "InstallationMediaAlreadyExists". + // + // The specified installation medium has already been imported. + ErrCodeInstallationMediaAlreadyExistsFault = "InstallationMediaAlreadyExists" + + // ErrCodeInstallationMediaNotFoundFault for service response error code + // "InstallationMediaNotFound". + // + // InstallationMediaID doesn't refer to an existing installation medium. + ErrCodeInstallationMediaNotFoundFault = "InstallationMediaNotFound" + // ErrCodeInstanceQuotaExceededFault for service response error code // "InstanceQuotaExceeded". // @@ -374,6 +472,12 @@ const ( // is in this state. ErrCodeInvalidDBParameterGroupStateFault = "InvalidDBParameterGroupState" + // ErrCodeInvalidDBProxyStateFault for service response error code + // "InvalidDBProxyStateFault". + // + // The requested operation can't be performed while the proxy is in this state. + ErrCodeInvalidDBProxyStateFault = "InvalidDBProxyStateFault" + // ErrCodeInvalidDBSecurityGroupStateFault for service response error code // "InvalidDBSecurityGroupState". // @@ -412,6 +516,25 @@ const ( // retry the action. ErrCodeInvalidEventSubscriptionStateFault = "InvalidEventSubscriptionState" + // ErrCodeInvalidExportOnlyFault for service response error code + // "InvalidExportOnly". + // + // The export is invalid for exporting to an Amazon S3 bucket. + ErrCodeInvalidExportOnlyFault = "InvalidExportOnly" + + // ErrCodeInvalidExportSourceStateFault for service response error code + // "InvalidExportSourceState". + // + // The state of the export snapshot is invalid for exporting to an Amazon S3 + // bucket. + ErrCodeInvalidExportSourceStateFault = "InvalidExportSourceState" + + // ErrCodeInvalidExportTaskStateFault for service response error code + // "InvalidExportTaskStateFault". + // + // You can't cancel an export task that has completed. + ErrCodeInvalidExportTaskStateFault = "InvalidExportTaskStateFault" + // ErrCodeInvalidGlobalClusterStateFault for service response error code // "InvalidGlobalClusterStateFault". ErrCodeInvalidGlobalClusterStateFault = "InvalidGlobalClusterStateFault" 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 index f2d0efaf7d0..656abea7b00 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/rds/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/rds/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "rds" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "RDS" // ServiceID is a unique identifer of a specific service. + ServiceID = "RDS" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the RDS client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a RDS client from just a session. // svc := rds.New(mySession) // @@ -46,11 +48,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *RDS { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *RDS { svc := &RDS{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2014-10-31", }, 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 index de5136f63a3..8f2bbe0ee6e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/redshift/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/redshift/api.go @@ -447,7 +447,7 @@ func (c *Redshift) BatchModifyClusterSnapshotsRequest(input *BatchModifyClusterS // BatchModifyClusterSnapshots API operation for Amazon Redshift. // -// Modifies the settings for a list of snapshots. +// Modifies the settings for a set of cluster snapshots. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -532,7 +532,7 @@ func (c *Redshift) CancelResizeRequest(input *CancelResizeInput) (req *request.R // CancelResize API operation for Amazon Redshift. // -// Cancels a resize operation. +// Cancels a resize operation 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 @@ -728,7 +728,7 @@ func (c *Redshift) CreateClusterRequest(input *CreateClusterInput) (req *request // CreateCluster API operation for Amazon Redshift. // -// Creates a new cluster. +// Creates a new cluster with the specified parameters. // // To create a cluster in Virtual Private Cloud (VPC), you must provide a cluster // subnet group name. The cluster subnet group identifies the subnets of your @@ -1600,6 +1600,102 @@ func (c *Redshift) CreateHsmConfigurationWithContext(ctx aws.Context, input *Cre return out, req.Send() } +const opCreateScheduledAction = "CreateScheduledAction" + +// CreateScheduledActionRequest generates a "aws/request.Request" representing the +// client's request for the CreateScheduledAction operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateScheduledAction for more information on using the CreateScheduledAction +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateScheduledActionRequest method. +// req, resp := client.CreateScheduledActionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateScheduledAction +func (c *Redshift) CreateScheduledActionRequest(input *CreateScheduledActionInput) (req *request.Request, output *CreateScheduledActionOutput) { + op := &request.Operation{ + Name: opCreateScheduledAction, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateScheduledActionInput{} + } + + output = &CreateScheduledActionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateScheduledAction API operation for Amazon Redshift. +// +// Creates a scheduled action. A scheduled action contains a schedule and an +// Amazon Redshift API action. For example, you can create a schedule of when +// to run the ResizeCluster API 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 Redshift's +// API operation CreateScheduledAction for usage and error information. +// +// Returned Error Codes: +// * ErrCodeScheduledActionAlreadyExistsFault "ScheduledActionAlreadyExists" +// The scheduled action already exists. +// +// * ErrCodeScheduledActionQuotaExceededFault "ScheduledActionQuotaExceeded" +// The quota for scheduled actions exceeded. +// +// * ErrCodeScheduledActionTypeUnsupportedFault "ScheduledActionTypeUnsupported" +// The action type specified for a scheduled action is not supported. +// +// * ErrCodeInvalidScheduleFault "InvalidSchedule" +// The schedule you submitted isn't valid. +// +// * ErrCodeInvalidScheduledActionFault "InvalidScheduledAction" +// The scheduled action is not valid. +// +// * ErrCodeUnauthorizedOperation "UnauthorizedOperation" +// Your account is not authorized to perform the requested operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/CreateScheduledAction +func (c *Redshift) CreateScheduledAction(input *CreateScheduledActionInput) (*CreateScheduledActionOutput, error) { + req, out := c.CreateScheduledActionRequest(input) + return out, req.Send() +} + +// CreateScheduledActionWithContext is the same as CreateScheduledAction with the addition of +// the ability to pass a context and additional request options. +// +// See CreateScheduledAction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Redshift) CreateScheduledActionWithContext(ctx aws.Context, input *CreateScheduledActionInput, opts ...request.Option) (*CreateScheduledActionOutput, error) { + req, out := c.CreateScheduledActionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateSnapshotCopyGrant = "CreateSnapshotCopyGrant" // CreateSnapshotCopyGrantRequest generates a "aws/request.Request" representing the @@ -1747,7 +1843,7 @@ func (c *Redshift) CreateSnapshotScheduleRequest(input *CreateSnapshotScheduleIn // CreateSnapshotSchedule API operation for Amazon Redshift. // -// Creates a new snapshot schedule. +// Creates a snapshot schedule with the rate of every 12 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 @@ -1839,7 +1935,7 @@ func (c *Redshift) CreateTagsRequest(input *CreateTagsInput) (req *request.Reque // CreateTags API operation for Amazon Redshift. // -// Adds one or more tags to a specified resource. +// Adds tags to a cluster. // // A resource can have up to 50 tags. If you try to create more than 50 tags // for a resource, you will receive an error and the attempt will fail. @@ -1930,11 +2026,12 @@ func (c *Redshift) DeleteClusterRequest(input *DeleteClusterInput) (req *request // 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 (https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html) +// Deletes a previously provisioned cluster without its final snapshot being +// created. 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 +// (https://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 @@ -2605,6 +2702,89 @@ func (c *Redshift) DeleteHsmConfigurationWithContext(ctx aws.Context, input *Del return out, req.Send() } +const opDeleteScheduledAction = "DeleteScheduledAction" + +// DeleteScheduledActionRequest generates a "aws/request.Request" representing the +// client's request for the DeleteScheduledAction operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteScheduledAction for more information on using the DeleteScheduledAction +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteScheduledActionRequest method. +// req, resp := client.DeleteScheduledActionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteScheduledAction +func (c *Redshift) 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.Swap(query.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteScheduledAction API operation for Amazon Redshift. +// +// Deletes a 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 Amazon Redshift's +// API operation DeleteScheduledAction for usage and error information. +// +// Returned Error Codes: +// * ErrCodeScheduledActionNotFoundFault "ScheduledActionNotFound" +// The scheduled action cannot be found. +// +// * ErrCodeUnauthorizedOperation "UnauthorizedOperation" +// Your account is not authorized to perform the requested operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DeleteScheduledAction +func (c *Redshift) DeleteScheduledAction(input *DeleteScheduledActionInput) (*DeleteScheduledActionOutput, error) { + req, out := c.DeleteScheduledActionRequest(input) + return out, req.Send() +} + +// DeleteScheduledActionWithContext is the same as DeleteScheduledAction with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteScheduledAction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Redshift) DeleteScheduledActionWithContext(ctx aws.Context, input *DeleteScheduledActionInput, opts ...request.Option) (*DeleteScheduledActionOutput, error) { + req, out := c.DeleteScheduledActionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeleteSnapshotCopyGrant = "DeleteSnapshotCopyGrant" // DeleteSnapshotCopyGrantRequest generates a "aws/request.Request" representing the @@ -2818,8 +2998,8 @@ func (c *Redshift) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Reque // 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. +// Deletes 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 @@ -3162,10 +3342,12 @@ func (c *Redshift) DescribeClusterParameterGroupsPagesWithContext(ctx aws.Contex }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClusterParameterGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeClusterParameterGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3308,10 +3490,12 @@ func (c *Redshift) DescribeClusterParametersPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClusterParametersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeClusterParametersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3463,10 +3647,12 @@ func (c *Redshift) DescribeClusterSecurityGroupsPagesWithContext(ctx aws.Context }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClusterSecurityGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeClusterSecurityGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3618,10 +3804,12 @@ func (c *Redshift) DescribeClusterSnapshotsPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClusterSnapshotsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeClusterSnapshotsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3769,10 +3957,12 @@ func (c *Redshift) DescribeClusterSubnetGroupsPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClusterSubnetGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeClusterSubnetGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3985,10 +4175,12 @@ func (c *Redshift) DescribeClusterVersionsPagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClusterVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeClusterVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4136,10 +4328,12 @@ func (c *Redshift) DescribeClustersPagesWithContext(ctx aws.Context, input *Desc }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeClustersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeClustersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4270,10 +4464,12 @@ func (c *Redshift) DescribeDefaultClusterParametersPagesWithContext(ctx aws.Cont }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeDefaultClusterParametersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeDefaultClusterParametersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4497,10 +4693,12 @@ func (c *Redshift) DescribeEventSubscriptionsPagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventSubscriptionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEventSubscriptionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4630,10 +4828,12 @@ func (c *Redshift) DescribeEventsPagesWithContext(ctx aws.Context, input *Descri }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeEventsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4780,10 +4980,12 @@ func (c *Redshift) DescribeHsmClientCertificatesPagesWithContext(ctx aws.Context }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeHsmClientCertificatesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeHsmClientCertificatesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4930,10 +5132,12 @@ func (c *Redshift) DescribeHsmConfigurationsPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeHsmConfigurationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeHsmConfigurationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5085,6 +5289,13 @@ func (c *Redshift) DescribeNodeConfigurationOptionsRequest(input *DescribeNodeCo // The specified cluster snapshot is not in the available state, or other accounts // are authorized to access the snapshot. // +// * ErrCodeClusterNotFoundFault "ClusterNotFound" +// The ClusterIdentifier parameter does not refer to an existing cluster. +// +// * ErrCodeAccessToSnapshotDeniedFault "AccessToSnapshotDenied" +// The owner of the specified snapshot has not authorized your account to access +// the snapshot. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeNodeConfigurationOptions func (c *Redshift) DescribeNodeConfigurationOptions(input *DescribeNodeConfigurationOptionsInput) (*DescribeNodeConfigurationOptionsOutput, error) { req, out := c.DescribeNodeConfigurationOptionsRequest(input) @@ -5150,10 +5361,12 @@ func (c *Redshift) DescribeNodeConfigurationOptionsPagesWithContext(ctx aws.Cont }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeNodeConfigurationOptionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeNodeConfigurationOptionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5288,10 +5501,12 @@ func (c *Redshift) DescribeOrderableClusterOptionsPagesWithContext(ctx aws.Conte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeOrderableClusterOptionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeOrderableClusterOptionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5439,10 +5654,12 @@ func (c *Redshift) DescribeReservedNodeOfferingsPagesWithContext(ctx aws.Context }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedNodeOfferingsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReservedNodeOfferingsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5578,10 +5795,12 @@ func (c *Redshift) DescribeReservedNodesPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeReservedNodesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeReservedNodesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5673,113 +5892,253 @@ func (c *Redshift) DescribeResizeWithContext(ctx aws.Context, input *DescribeRes return out, req.Send() } -const opDescribeSnapshotCopyGrants = "DescribeSnapshotCopyGrants" +const opDescribeScheduledActions = "DescribeScheduledActions" -// DescribeSnapshotCopyGrantsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSnapshotCopyGrants operation. The "output" return +// DescribeScheduledActionsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeScheduledActions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeSnapshotCopyGrants for more information on using the DescribeSnapshotCopyGrants +// See DescribeScheduledActions for more information on using the DescribeScheduledActions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeSnapshotCopyGrantsRequest method. -// req, resp := client.DescribeSnapshotCopyGrantsRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeSnapshotCopyGrants -func (c *Redshift) DescribeSnapshotCopyGrantsRequest(input *DescribeSnapshotCopyGrantsInput) (req *request.Request, output *DescribeSnapshotCopyGrantsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeScheduledActions +func (c *Redshift) DescribeScheduledActionsRequest(input *DescribeScheduledActionsInput) (req *request.Request, output *DescribeScheduledActionsOutput) { op := &request.Operation{ - Name: opDescribeSnapshotCopyGrants, + Name: opDescribeScheduledActions, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"Marker"}, + OutputTokens: []string{"Marker"}, + LimitToken: "MaxRecords", + TruncationToken: "", + }, } if input == nil { - input = &DescribeSnapshotCopyGrantsInput{} + input = &DescribeScheduledActionsInput{} } - output = &DescribeSnapshotCopyGrantsOutput{} + output = &DescribeScheduledActionsOutput{} 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. +// DescribeScheduledActions API operation for Amazon Redshift. // -// For more information about managing snapshot copy grants, go to Amazon Redshift -// Database Encryption (https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-db-encryption.html) -// in the Amazon Redshift Cluster Management Guide. +// Describes properties of scheduled 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 Redshift's -// API operation DescribeSnapshotCopyGrants for usage and error information. +// API operation DescribeScheduledActions 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. +// * ErrCodeScheduledActionNotFoundFault "ScheduledActionNotFound" +// The scheduled action cannot be found. // -// * ErrCodeInvalidTagFault "InvalidTagFault" -// The tag is invalid. +// * ErrCodeUnauthorizedOperation "UnauthorizedOperation" +// Your account is not authorized to perform the requested operation. // -// See also, 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) +// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/DescribeScheduledActions +func (c *Redshift) DescribeScheduledActions(input *DescribeScheduledActionsInput) (*DescribeScheduledActionsOutput, error) { + req, out := c.DescribeScheduledActionsRequest(input) return out, req.Send() } -// DescribeSnapshotCopyGrantsWithContext is the same as DescribeSnapshotCopyGrants with the addition of +// DescribeScheduledActionsWithContext is the same as DescribeScheduledActions with the addition of // the ability to pass a context and additional request options. // -// See DescribeSnapshotCopyGrants for details on how to use this API operation. +// See DescribeScheduledActions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *Redshift) DescribeSnapshotCopyGrantsWithContext(ctx aws.Context, input *DescribeSnapshotCopyGrantsInput, opts ...request.Option) (*DescribeSnapshotCopyGrantsOutput, error) { - req, out := c.DescribeSnapshotCopyGrantsRequest(input) +func (c *Redshift) DescribeScheduledActionsWithContext(ctx aws.Context, input *DescribeScheduledActionsInput, opts ...request.Option) (*DescribeScheduledActionsOutput, error) { + req, out := c.DescribeScheduledActionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeSnapshotSchedules = "DescribeSnapshotSchedules" +// 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 *redshift.DescribeScheduledActionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *Redshift) DescribeScheduledActionsPages(input *DescribeScheduledActionsInput, fn func(*DescribeScheduledActionsOutput, bool) bool) error { + return c.DescribeScheduledActionsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// DescribeSnapshotSchedulesRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSnapshotSchedules operation. The "output" return +// DescribeScheduledActionsPagesWithContext same as DescribeScheduledActionsPages 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 *Redshift) DescribeScheduledActionsPagesWithContext(ctx aws.Context, input *DescribeScheduledActionsInput, fn func(*DescribeScheduledActionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeScheduledActionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeScheduledActionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeScheduledActionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeSnapshotCopyGrants = "DescribeSnapshotCopyGrants" + +// DescribeSnapshotCopyGrantsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeSnapshotCopyGrants operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeSnapshotSchedules for more information on using the DescribeSnapshotSchedules +// See DescribeSnapshotCopyGrants for more information on using the DescribeSnapshotCopyGrants // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeSnapshotSchedulesRequest method. -// req, resp := client.DescribeSnapshotSchedulesRequest(params) +// // 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) +// } +// +// See also, 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 (https://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. +// +// See also, 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) + return out, req.Send() +} + +// DescribeSnapshotCopyGrantsWithContext is the same as DescribeSnapshotCopyGrants with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeSnapshotCopyGrants for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Redshift) DescribeSnapshotCopyGrantsWithContext(ctx aws.Context, input *DescribeSnapshotCopyGrantsInput, opts ...request.Option) (*DescribeSnapshotCopyGrantsOutput, error) { + req, out := c.DescribeSnapshotCopyGrantsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeSnapshotSchedules = "DescribeSnapshotSchedules" + +// DescribeSnapshotSchedulesRequest generates a "aws/request.Request" representing the +// client's request for the DescribeSnapshotSchedules operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeSnapshotSchedules for more information on using the DescribeSnapshotSchedules +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeSnapshotSchedulesRequest method. +// req, resp := client.DescribeSnapshotSchedulesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled @@ -5879,7 +6238,7 @@ func (c *Redshift) DescribeStorageRequest(input *DescribeStorageInput) (req *req // DescribeStorage API operation for Amazon Redshift. // -// Returns the total amount of snapshot usage and provisioned storage in megabytes. +// Returns account level backups storage size and provisional storage. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6727,18 +7086,19 @@ func (c *Redshift) ModifyClusterRequest(input *ModifyClusterInput) (req *request // 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 (https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html) -// in the Amazon Redshift Cluster Management Guide. +// Modifies the settings for a cluster. // // 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. // +// You can add another security or parameter group, 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 (https://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. @@ -7049,8 +7409,7 @@ func (c *Redshift) ModifyClusterMaintenanceRequest(input *ModifyClusterMaintenan // ModifyClusterMaintenance API operation for Amazon Redshift. // -// Modifies the maintenance settings of a cluster. For example, you can defer -// a maintenance window. You can also update or cancel a deferment. +// Modifies the maintenance settings of 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 @@ -7219,6 +7578,9 @@ func (c *Redshift) ModifyClusterSnapshotRequest(input *ModifyClusterSnapshotInpu // // Modifies the settings for a snapshot. // +// This exanmple modifies the manual retention period setting for a cluster +// 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. @@ -7560,6 +7922,97 @@ func (c *Redshift) ModifyEventSubscriptionWithContext(ctx aws.Context, input *Mo return out, req.Send() } +const opModifyScheduledAction = "ModifyScheduledAction" + +// ModifyScheduledActionRequest generates a "aws/request.Request" representing the +// client's request for the ModifyScheduledAction operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ModifyScheduledAction for more information on using the ModifyScheduledAction +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ModifyScheduledActionRequest method. +// req, resp := client.ModifyScheduledActionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyScheduledAction +func (c *Redshift) ModifyScheduledActionRequest(input *ModifyScheduledActionInput) (req *request.Request, output *ModifyScheduledActionOutput) { + op := &request.Operation{ + Name: opModifyScheduledAction, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ModifyScheduledActionInput{} + } + + output = &ModifyScheduledActionOutput{} + req = c.newRequest(op, input, output) + return +} + +// ModifyScheduledAction API operation for Amazon Redshift. +// +// Modifies a 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 Amazon Redshift's +// API operation ModifyScheduledAction for usage and error information. +// +// Returned Error Codes: +// * ErrCodeScheduledActionNotFoundFault "ScheduledActionNotFound" +// The scheduled action cannot be found. +// +// * ErrCodeScheduledActionTypeUnsupportedFault "ScheduledActionTypeUnsupported" +// The action type specified for a scheduled action is not supported. +// +// * ErrCodeInvalidScheduleFault "InvalidSchedule" +// The schedule you submitted isn't valid. +// +// * ErrCodeInvalidScheduledActionFault "InvalidScheduledAction" +// The scheduled action is not valid. +// +// * ErrCodeUnauthorizedOperation "UnauthorizedOperation" +// Your account is not authorized to perform the requested operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/redshift-2012-12-01/ModifyScheduledAction +func (c *Redshift) ModifyScheduledAction(input *ModifyScheduledActionInput) (*ModifyScheduledActionOutput, error) { + req, out := c.ModifyScheduledActionRequest(input) + return out, req.Send() +} + +// ModifyScheduledActionWithContext is the same as ModifyScheduledAction with the addition of +// the ability to pass a context and additional request options. +// +// See ModifyScheduledAction for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Redshift) ModifyScheduledActionWithContext(ctx aws.Context, input *ModifyScheduledActionInput, opts ...request.Option) (*ModifyScheduledActionOutput, error) { + req, out := c.ModifyScheduledActionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opModifySnapshotCopyRetentionPeriod = "ModifySnapshotCopyRetentionPeriod" // ModifySnapshotCopyRetentionPeriodRequest generates a "aws/request.Request" representing the @@ -8070,7 +8523,7 @@ func (c *Redshift) ResizeClusterRequest(input *ResizeClusterInput) (req *request // Elastic resize operations have the following restrictions: // // * You can only resize clusters of the following types: dc2.large dc2.8xlarge -// ds2.xlarge ds2.8xlarge +// ds2.xlarge ds2.8xlarge ra3.16xlarge // // * The type of nodes that you add must match the node type for the cluster. // @@ -10793,7 +11246,7 @@ type CreateClusterInput struct { // Default: A random, system-chosen Availability Zone in the region that is // specified by the endpoint. // - // Example: us-east-1d + // Example: us-east-2d // // Constraint: The specified Availability Zone must be in the same region as // the current endpoint. @@ -10982,8 +11435,8 @@ type CreateClusterInput struct { // types, go to Working with Clusters (https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-clusters.html#how-many-nodes) // in the Amazon Redshift Cluster Management Guide. // - // Valid Values: ds2.xlarge | ds2.8xlarge | ds2.xlarge | ds2.8xlarge | dc1.large - // | dc1.8xlarge | dc2.large | dc2.8xlarge + // Valid Values: ds2.xlarge | ds2.8xlarge | dc1.large | dc1.8xlarge | dc2.large + // | dc2.8xlarge | ra3.16xlarge // // NodeType is a required field NodeType *string `type:"string" required:"true"` @@ -11759,8 +12212,8 @@ type CreateEventSubscriptionInput struct { // 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. + // Valid values: cluster, cluster-parameter-group, cluster-security-group, cluster-snapshot, + // and scheduled-action. SourceType *string `type:"string"` // The name of the event subscription to be created. @@ -12096,51 +12549,78 @@ func (s *CreateHsmConfigurationOutput) SetHsmConfiguration(v *HsmConfiguration) return s } -// The result of the CreateSnapshotCopyGrant action. -type CreateSnapshotCopyGrantInput struct { +type CreateScheduledActionInput 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"` + // If true, the schedule is enabled. If false, the scheduled action does not + // trigger. For more information about state of the scheduled action, see ScheduledAction. + Enable *bool `type:"boolean"` - // 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. + // The end time in UTC of the scheduled action. After this time, the scheduled + // action does not trigger. For more information about this parameter, see ScheduledAction. + EndTime *time.Time `type:"timestamp"` + + // The IAM role to assume to run the target action. For more information about + // this parameter, see ScheduledAction. // - // * Cannot end with a hyphen or contain two consecutive hyphens. + // IamRole is a required field + IamRole *string `type:"string" required:"true"` + + // The schedule in at( ) or cron( ) format. For more information about this + // parameter, see ScheduledAction. // - // * Must be unique for all clusters within an AWS account. + // Schedule is a required field + Schedule *string `type:"string" required:"true"` + + // The description of the scheduled action. + ScheduledActionDescription *string `type:"string"` + + // The name of the scheduled action. The name must be unique within an account. + // For more information about this parameter, see ScheduledAction. // - // SnapshotCopyGrantName is a required field - SnapshotCopyGrantName *string `type:"string" required:"true"` + // ScheduledActionName is a required field + ScheduledActionName *string `type:"string" required:"true"` - // A list of tag instances. - Tags []*Tag `locationNameList:"Tag" type:"list"` + // The start time in UTC of the scheduled action. Before this time, the scheduled + // action does not trigger. For more information about this parameter, see ScheduledAction. + StartTime *time.Time `type:"timestamp"` + + // A JSON format string of the Amazon Redshift API operation with input parameters. + // For more information about this parameter, see ScheduledAction. + // + // TargetAction is a required field + TargetAction *ScheduledActionType `type:"structure" required:"true"` } // String returns the string representation -func (s CreateSnapshotCopyGrantInput) String() string { +func (s CreateScheduledActionInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateSnapshotCopyGrantInput) GoString() string { +func (s CreateScheduledActionInput) 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")) +func (s *CreateScheduledActionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateScheduledActionInput"} + if s.IamRole == nil { + invalidParams.Add(request.NewErrParamRequired("IamRole")) + } + if s.Schedule == nil { + invalidParams.Add(request.NewErrParamRequired("Schedule")) + } + if s.ScheduledActionName == nil { + invalidParams.Add(request.NewErrParamRequired("ScheduledActionName")) + } + if s.TargetAction == nil { + invalidParams.Add(request.NewErrParamRequired("TargetAction")) + } + if s.TargetAction != nil { + if err := s.TargetAction.Validate(); err != nil { + invalidParams.AddNested("TargetAction", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -12149,73 +12629,290 @@ func (s *CreateSnapshotCopyGrantInput) Validate() error { return nil } -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateSnapshotCopyGrantInput) SetKmsKeyId(v string) *CreateSnapshotCopyGrantInput { - s.KmsKeyId = &v +// SetEnable sets the Enable field's value. +func (s *CreateScheduledActionInput) SetEnable(v bool) *CreateScheduledActionInput { + s.Enable = &v return s } -// SetSnapshotCopyGrantName sets the SnapshotCopyGrantName field's value. -func (s *CreateSnapshotCopyGrantInput) SetSnapshotCopyGrantName(v string) *CreateSnapshotCopyGrantInput { - s.SnapshotCopyGrantName = &v +// SetEndTime sets the EndTime field's value. +func (s *CreateScheduledActionInput) SetEndTime(v time.Time) *CreateScheduledActionInput { + s.EndTime = &v return s } -// SetTags sets the Tags field's value. -func (s *CreateSnapshotCopyGrantInput) SetTags(v []*Tag) *CreateSnapshotCopyGrantInput { - s.Tags = v +// SetIamRole sets the IamRole field's value. +func (s *CreateScheduledActionInput) SetIamRole(v string) *CreateScheduledActionInput { + s.IamRole = &v return s } -type CreateSnapshotCopyGrantOutput struct { - _ struct{} `type:"structure"` +// SetSchedule sets the Schedule field's value. +func (s *CreateScheduledActionInput) SetSchedule(v string) *CreateScheduledActionInput { + s.Schedule = &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 (https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-db-encryption.html) - // in the Amazon Redshift Cluster Management Guide. - SnapshotCopyGrant *SnapshotCopyGrant `type:"structure"` +// SetScheduledActionDescription sets the ScheduledActionDescription field's value. +func (s *CreateScheduledActionInput) SetScheduledActionDescription(v string) *CreateScheduledActionInput { + s.ScheduledActionDescription = &v + return s } -// String returns the string representation -func (s CreateSnapshotCopyGrantOutput) String() string { - return awsutil.Prettify(s) +// SetScheduledActionName sets the ScheduledActionName field's value. +func (s *CreateScheduledActionInput) SetScheduledActionName(v string) *CreateScheduledActionInput { + s.ScheduledActionName = &v + return s } -// GoString returns the string representation -func (s CreateSnapshotCopyGrantOutput) GoString() string { - return s.String() +// SetStartTime sets the StartTime field's value. +func (s *CreateScheduledActionInput) SetStartTime(v time.Time) *CreateScheduledActionInput { + s.StartTime = &v + return s } -// SetSnapshotCopyGrant sets the SnapshotCopyGrant field's value. -func (s *CreateSnapshotCopyGrantOutput) SetSnapshotCopyGrant(v *SnapshotCopyGrant) *CreateSnapshotCopyGrantOutput { - s.SnapshotCopyGrant = v +// SetTargetAction sets the TargetAction field's value. +func (s *CreateScheduledActionInput) SetTargetAction(v *ScheduledActionType) *CreateScheduledActionInput { + s.TargetAction = v return s } -type CreateSnapshotScheduleInput struct { +// Describes a scheduled action. You can use a scheduled action to trigger some +// Amazon Redshift API operations on a schedule. For information about which +// API operations can be scheduled, see ScheduledActionType. +type CreateScheduledActionOutput struct { _ struct{} `type:"structure"` - DryRun *bool `type:"boolean"` + // The end time in UTC when the schedule is no longer active. After this time, + // the scheduled action does not trigger. + EndTime *time.Time `type:"timestamp"` - NextInvocations *int64 `type:"integer"` + // The IAM role to assume to run the scheduled action. This IAM role must have + // permission to run the Amazon Redshift API operation in the scheduled action. + // This IAM role must allow the Amazon Redshift scheduler (Principal scheduler.redshift.amazonaws.com) + // to assume permissions on your behalf. For more information about the IAM + // role to use with the Amazon Redshift scheduler, see Using Identity-Based + // Policies for Amazon Redshift (https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-identity-based.html) + // in the Amazon Redshift Cluster Management Guide. + IamRole *string `type:"string"` - // The definition of the snapshot schedule. The definition is made up of schedule - // expressions, for example "cron(30 12 *)" or "rate(12 hours)". - ScheduleDefinitions []*string `locationNameList:"ScheduleDefinition" type:"list"` + // List of times when the scheduled action will run. + NextInvocations []*time.Time `locationNameList:"ScheduledActionTime" type:"list"` - // The description of the snapshot schedule. - ScheduleDescription *string `type:"string"` + // The schedule for a one-time (at format) or recurring (cron format) scheduled + // action. Schedule invocations must be separated by at least one hour. + // + // Format of at expressions is "at(yyyy-mm-ddThh:mm:ss)". For example, "at(2016-03-04T17:27:00)". + // + // Format of cron expressions is "cron(Minutes Hours Day-of-month Month Day-of-week + // Year)". For example, "cron(0 10 ? * MON *)". For more information, see Cron + // Expressions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions) + // in the Amazon CloudWatch Events User Guide. + Schedule *string `type:"string"` - // A unique identifier for a snapshot schedule. Only alphanumeric characters - // are allowed for the identifier. - ScheduleIdentifier *string `type:"string"` + // The description of the scheduled action. + ScheduledActionDescription *string `type:"string"` - // An optional set of tags you can use to search for the schedule. - Tags []*Tag `locationNameList:"Tag" type:"list"` + // The name of the scheduled action. + ScheduledActionName *string `type:"string"` + + // The start time in UTC when the schedule is active. Before this time, the + // scheduled action does not trigger. + StartTime *time.Time `type:"timestamp"` + + // The state of the scheduled action. For example, DISABLED. + State *string `type:"string" enum:"ScheduledActionState"` + + // A JSON format string of the Amazon Redshift API operation with input parameters. + // + // "{\"ResizeCluster\":{\"NodeType\":\"ds2.8xlarge\",\"ClusterIdentifier\":\"my-test-cluster\",\"NumberOfNodes\":3}}". + TargetAction *ScheduledActionType `type:"structure"` +} + +// String returns the string representation +func (s CreateScheduledActionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateScheduledActionOutput) GoString() string { + return s.String() +} + +// SetEndTime sets the EndTime field's value. +func (s *CreateScheduledActionOutput) SetEndTime(v time.Time) *CreateScheduledActionOutput { + s.EndTime = &v + return s +} + +// SetIamRole sets the IamRole field's value. +func (s *CreateScheduledActionOutput) SetIamRole(v string) *CreateScheduledActionOutput { + s.IamRole = &v + return s +} + +// SetNextInvocations sets the NextInvocations field's value. +func (s *CreateScheduledActionOutput) SetNextInvocations(v []*time.Time) *CreateScheduledActionOutput { + s.NextInvocations = v + return s +} + +// SetSchedule sets the Schedule field's value. +func (s *CreateScheduledActionOutput) SetSchedule(v string) *CreateScheduledActionOutput { + s.Schedule = &v + return s +} + +// SetScheduledActionDescription sets the ScheduledActionDescription field's value. +func (s *CreateScheduledActionOutput) SetScheduledActionDescription(v string) *CreateScheduledActionOutput { + s.ScheduledActionDescription = &v + return s +} + +// SetScheduledActionName sets the ScheduledActionName field's value. +func (s *CreateScheduledActionOutput) SetScheduledActionName(v string) *CreateScheduledActionOutput { + s.ScheduledActionName = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *CreateScheduledActionOutput) SetStartTime(v time.Time) *CreateScheduledActionOutput { + s.StartTime = &v + return s +} + +// SetState sets the State field's value. +func (s *CreateScheduledActionOutput) SetState(v string) *CreateScheduledActionOutput { + s.State = &v + return s +} + +// SetTargetAction sets the TargetAction field's value. +func (s *CreateScheduledActionOutput) SetTargetAction(v *ScheduledActionType) *CreateScheduledActionOutput { + s.TargetAction = v + return s +} + +// The result of the CreateSnapshotCopyGrant action. +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 +} + +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 (https://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 +} + +type CreateSnapshotScheduleInput struct { + _ struct{} `type:"structure"` + + DryRun *bool `type:"boolean"` + + NextInvocations *int64 `type:"integer"` + + // The definition of the snapshot schedule. The definition is made up of schedule + // expressions, for example "cron(30 12 *)" or "rate(12 hours)". + ScheduleDefinitions []*string `locationNameList:"ScheduleDefinition" type:"list"` + + // The description of the snapshot schedule. + ScheduleDescription *string `type:"string"` + + // A unique identifier for a snapshot schedule. Only alphanumeric characters + // are allowed for the identifier. + ScheduleIdentifier *string `type:"string"` + + // An optional set of tags you can use to search for the schedule. + Tags []*Tag `locationNameList:"Tag" type:"list"` } // String returns the string representation @@ -12348,7 +13045,7 @@ 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. + // For example, arn:aws:redshift:us-east-2:123456789:cluster:t1. // // ResourceName is a required field ResourceName *string `type:"string" required:"true"` @@ -13144,6 +13841,58 @@ func (s DeleteHsmConfigurationOutput) GoString() string { return s.String() } +type DeleteScheduledActionInput struct { + _ struct{} `type:"structure"` + + // The name of the scheduled action to delete. + // + // ScheduledActionName is a required field + ScheduledActionName *string `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.ScheduledActionName == nil { + invalidParams.Add(request.NewErrParamRequired("ScheduledActionName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetScheduledActionName sets the ScheduledActionName field's value. +func (s *DeleteScheduledActionInput) SetScheduledActionName(v string) *DeleteScheduledActionInput { + s.ScheduledActionName = &v + return s +} + +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() +} + // The result of the DeleteSnapshotCopyGrant action. type DeleteSnapshotCopyGrantInput struct { _ struct{} `type:"structure"` @@ -13254,7 +14003,7 @@ 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. + // For example, arn:aws:redshift:us-east-2:123456789:cluster:t1. // // ResourceName is a required field ResourceName *string `type:"string" required:"true"` @@ -14577,7 +15326,8 @@ type DescribeEventCategoriesInput struct { // 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. + // Valid values: cluster, cluster-snapshot, cluster-parameter-group, cluster-security-group, + // and scheduled-action. SourceType *string `type:"string"` } @@ -15185,12 +15935,18 @@ func (s *DescribeLoggingStatusInput) SetClusterIdentifier(v string) *DescribeLog type DescribeNodeConfigurationOptionsInput struct { _ struct{} `type:"structure"` - // The action type to evaluate for possible node configurations. Currently, - // it must be "restore-cluster". + // The action type to evaluate for possible node configurations. Specify "restore-cluster" + // to get configuration combinations based on an existing snapshot. Specify + // "recommend-node-config" to get configuration recommendations based on an + // existing cluster or snapshot. Specify "resize-cluster" to get configuration + // combinations for elastic resize based on an existing cluster. // // ActionType is a required field ActionType *string `type:"string" required:"true" enum:"ActionType"` + // The identifier of the cluster to evaluate for possible node configurations. + ClusterIdentifier *string `type:"string"` + // A set of name, operator, and value items to filter the results. Filters []*NodeConfigurationOptionsFilter `locationName:"Filter" locationNameList:"NodeConfigurationOptionsFilter" type:"list"` @@ -15249,6 +16005,12 @@ func (s *DescribeNodeConfigurationOptionsInput) SetActionType(v string) *Describ return s } +// SetClusterIdentifier sets the ClusterIdentifier field's value. +func (s *DescribeNodeConfigurationOptionsInput) SetClusterIdentifier(v string) *DescribeNodeConfigurationOptionsInput { + s.ClusterIdentifier = &v + return s +} + // SetFilters sets the Filters field's value. func (s *DescribeNodeConfigurationOptionsInput) SetFilters(v []*NodeConfigurationOptionsFilter) *DescribeNodeConfigurationOptionsInput { s.Filters = v @@ -15826,19 +16588,26 @@ func (s *DescribeResizeOutput) SetTotalResizeDataInMegaBytes(v int64) *DescribeR return s } -// The result of the DescribeSnapshotCopyGrants action. -type DescribeSnapshotCopyGrantsInput struct { +type DescribeScheduledActionsInput struct { _ struct{} `type:"structure"` + // If true, retrieve only active scheduled actions. If false, retrieve only + // disabled scheduled actions. + Active *bool `type:"boolean"` + + // The end time in UTC of the scheduled action to retrieve. Only active scheduled + // actions that have invocations before this time are retrieved. + EndTime *time.Time `type:"timestamp"` + + // List of scheduled action filters. + Filters []*ScheduledActionFilter `locationNameList:"ScheduledActionFilter" type:"list"` + // An optional parameter that specifies the starting point to return a set of - // response records. When the results of a DescribeSnapshotCopyGrant request + // response records. When the results of a DescribeScheduledActions 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 @@ -15851,43 +16620,194 @@ type DescribeSnapshotCopyGrantsInput struct { // Constraints: minimum 20, maximum 100. MaxRecords *int64 `type:"integer"` - // The name of the snapshot copy grant. - SnapshotCopyGrantName *string `type:"string"` + // The name of the scheduled action to retrieve. + ScheduledActionName *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"` + // The start time in UTC of the scheduled actions to retrieve. Only active scheduled + // actions that have invocations after this time are retrieved. + StartTime *time.Time `type:"timestamp"` - // 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"` + // The type of the scheduled actions to retrieve. + TargetActionType *string `type:"string" enum:"ScheduledActionTypeValues"` } // String returns the string representation -func (s DescribeSnapshotCopyGrantsInput) String() string { +func (s DescribeScheduledActionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeSnapshotCopyGrantsInput) GoString() string { +func (s DescribeScheduledActionsInput) GoString() string { return s.String() } -// SetMarker sets the Marker field's value. -func (s *DescribeSnapshotCopyGrantsInput) SetMarker(v string) *DescribeSnapshotCopyGrantsInput { - s.Marker = &v +// 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.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 +} + +// SetActive sets the Active field's value. +func (s *DescribeScheduledActionsInput) SetActive(v bool) *DescribeScheduledActionsInput { + s.Active = &v return s } -// SetMaxRecords sets the MaxRecords field's value. +// SetEndTime sets the EndTime field's value. +func (s *DescribeScheduledActionsInput) SetEndTime(v time.Time) *DescribeScheduledActionsInput { + s.EndTime = &v + return s +} + +// SetFilters sets the Filters field's value. +func (s *DescribeScheduledActionsInput) SetFilters(v []*ScheduledActionFilter) *DescribeScheduledActionsInput { + s.Filters = v + return s +} + +// SetMarker sets the Marker field's value. +func (s *DescribeScheduledActionsInput) SetMarker(v string) *DescribeScheduledActionsInput { + s.Marker = &v + return s +} + +// SetMaxRecords sets the MaxRecords field's value. +func (s *DescribeScheduledActionsInput) SetMaxRecords(v int64) *DescribeScheduledActionsInput { + s.MaxRecords = &v + return s +} + +// SetScheduledActionName sets the ScheduledActionName field's value. +func (s *DescribeScheduledActionsInput) SetScheduledActionName(v string) *DescribeScheduledActionsInput { + s.ScheduledActionName = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *DescribeScheduledActionsInput) SetStartTime(v time.Time) *DescribeScheduledActionsInput { + s.StartTime = &v + return s +} + +// SetTargetActionType sets the TargetActionType field's value. +func (s *DescribeScheduledActionsInput) SetTargetActionType(v string) *DescribeScheduledActionsInput { + s.TargetActionType = &v + return s +} + +type DescribeScheduledActionsOutput struct { + _ struct{} `type:"structure"` + + // An optional parameter that specifies the starting point to return a set of + // response records. When the results of a DescribeScheduledActions 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"` + + // List of retrieved scheduled actions. + ScheduledActions []*ScheduledAction `locationNameList:"ScheduledAction" 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() +} + +// SetMarker sets the Marker field's value. +func (s *DescribeScheduledActionsOutput) SetMarker(v string) *DescribeScheduledActionsOutput { + s.Marker = &v + return s +} + +// SetScheduledActions sets the ScheduledActions field's value. +func (s *DescribeScheduledActionsOutput) SetScheduledActions(v []*ScheduledAction) *DescribeScheduledActionsOutput { + s.ScheduledActions = v + return s +} + +// The result of the DescribeSnapshotCopyGrants action. +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 @@ -16215,7 +17135,7 @@ type DescribeTagsInput struct { 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. + // tags. For example, arn:aws:redshift:us-east-2:123456789:cluster:t1. ResourceName *string `type:"string"` // The type of resource with which you want to view tags. Valid resource types @@ -16968,8 +17888,9 @@ type EventSubscription struct { // 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. + // The source type of the events returned by the Amazon Redshift event notification, + // such as cluster, cluster-snapshot, cluster-parameter-group, cluster-security-group, + // or scheduled-action. SourceType *string `type:"string"` // The status of the Amazon Redshift event notification subscription. @@ -17921,11 +18842,13 @@ type ModifyClusterInput struct { // in the Amazon Redshift Cluster Management Guide. ElasticIp *string `type:"string"` - // Indicates whether the cluster is encrypted. If the cluster is encrypted and - // you provide a value for the KmsKeyId parameter, we will encrypt the cluster - // with the provided KmsKeyId. If you don't provide a KmsKeyId, we will encrypt - // with the default key. In the China region we will use legacy encryption if - // you specify that the cluster is encrypted. + // Indicates whether the cluster is encrypted. If the value is encrypted (true) + // and you provide a value for the KmsKeyId parameter, we encrypt the cluster + // with the provided KmsKeyId. If you don't provide a KmsKeyId, we encrypt with + // the default key. In the China region we use legacy encryption if you specify + // that the cluster is encrypted. + // + // If the value is not encrypted (false), then the cluster is decrypted. Encrypted *bool `type:"boolean"` // An option that specifies whether to create the cluster with enhanced VPC @@ -18012,28 +18935,20 @@ type ModifyClusterInput struct { // 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. + // For more information about resizing clusters, go to Resizing Clusters in + // Amazon Redshift (https://docs.aws.amazon.com/redshift/latest/mgmt/rs-resize-tutorial.html) + // in the Amazon Redshift Cluster Management Guide. // // Valid Values: ds2.xlarge | ds2.8xlarge | dc1.large | dc1.8xlarge | dc2.large - // | dc2.8xlarge + // | dc2.8xlarge | ra3.16xlarge 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. + // For more information about resizing clusters, go to Resizing Clusters in + // Amazon Redshift (https://docs.aws.amazon.com/redshift/latest/mgmt/rs-resize-tutorial.html) + // in the Amazon Redshift Cluster Management Guide. // // Valid Values: Integer greater than 0. NumberOfNodes *int64 `type:"integer"` @@ -18694,8 +19609,8 @@ type ModifyEventSubscriptionInput struct { // 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. + // Valid values: cluster, cluster-parameter-group, cluster-security-group, cluster-snapshot, + // and scheduled-action. SourceType *string `type:"string"` // The name of the modified Amazon Redshift event notification subscription. @@ -18792,6 +19707,234 @@ func (s *ModifyEventSubscriptionOutput) SetEventSubscription(v *EventSubscriptio return s } +type ModifyScheduledActionInput struct { + _ struct{} `type:"structure"` + + // A modified enable flag of the scheduled action. If true, the scheduled action + // is active. If false, the scheduled action is disabled. + Enable *bool `type:"boolean"` + + // A modified end time of the scheduled action. For more information about this + // parameter, see ScheduledAction. + EndTime *time.Time `type:"timestamp"` + + // A different IAM role to assume to run the target action. For more information + // about this parameter, see ScheduledAction. + IamRole *string `type:"string"` + + // A modified schedule in either at( ) or cron( ) format. For more information + // about this parameter, see ScheduledAction. + Schedule *string `type:"string"` + + // A modified description of the scheduled action. + ScheduledActionDescription *string `type:"string"` + + // The name of the scheduled action to modify. + // + // ScheduledActionName is a required field + ScheduledActionName *string `type:"string" required:"true"` + + // A modified start time of the scheduled action. For more information about + // this parameter, see ScheduledAction. + StartTime *time.Time `type:"timestamp"` + + // A modified JSON format of the scheduled action. For more information about + // this parameter, see ScheduledAction. + TargetAction *ScheduledActionType `type:"structure"` +} + +// String returns the string representation +func (s ModifyScheduledActionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyScheduledActionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyScheduledActionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyScheduledActionInput"} + if s.ScheduledActionName == nil { + invalidParams.Add(request.NewErrParamRequired("ScheduledActionName")) + } + if s.TargetAction != nil { + if err := s.TargetAction.Validate(); err != nil { + invalidParams.AddNested("TargetAction", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEnable sets the Enable field's value. +func (s *ModifyScheduledActionInput) SetEnable(v bool) *ModifyScheduledActionInput { + s.Enable = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *ModifyScheduledActionInput) SetEndTime(v time.Time) *ModifyScheduledActionInput { + s.EndTime = &v + return s +} + +// SetIamRole sets the IamRole field's value. +func (s *ModifyScheduledActionInput) SetIamRole(v string) *ModifyScheduledActionInput { + s.IamRole = &v + return s +} + +// SetSchedule sets the Schedule field's value. +func (s *ModifyScheduledActionInput) SetSchedule(v string) *ModifyScheduledActionInput { + s.Schedule = &v + return s +} + +// SetScheduledActionDescription sets the ScheduledActionDescription field's value. +func (s *ModifyScheduledActionInput) SetScheduledActionDescription(v string) *ModifyScheduledActionInput { + s.ScheduledActionDescription = &v + return s +} + +// SetScheduledActionName sets the ScheduledActionName field's value. +func (s *ModifyScheduledActionInput) SetScheduledActionName(v string) *ModifyScheduledActionInput { + s.ScheduledActionName = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *ModifyScheduledActionInput) SetStartTime(v time.Time) *ModifyScheduledActionInput { + s.StartTime = &v + return s +} + +// SetTargetAction sets the TargetAction field's value. +func (s *ModifyScheduledActionInput) SetTargetAction(v *ScheduledActionType) *ModifyScheduledActionInput { + s.TargetAction = v + return s +} + +// Describes a scheduled action. You can use a scheduled action to trigger some +// Amazon Redshift API operations on a schedule. For information about which +// API operations can be scheduled, see ScheduledActionType. +type ModifyScheduledActionOutput struct { + _ struct{} `type:"structure"` + + // The end time in UTC when the schedule is no longer active. After this time, + // the scheduled action does not trigger. + EndTime *time.Time `type:"timestamp"` + + // The IAM role to assume to run the scheduled action. This IAM role must have + // permission to run the Amazon Redshift API operation in the scheduled action. + // This IAM role must allow the Amazon Redshift scheduler (Principal scheduler.redshift.amazonaws.com) + // to assume permissions on your behalf. For more information about the IAM + // role to use with the Amazon Redshift scheduler, see Using Identity-Based + // Policies for Amazon Redshift (https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-identity-based.html) + // in the Amazon Redshift Cluster Management Guide. + IamRole *string `type:"string"` + + // List of times when the scheduled action will run. + NextInvocations []*time.Time `locationNameList:"ScheduledActionTime" type:"list"` + + // The schedule for a one-time (at format) or recurring (cron format) scheduled + // action. Schedule invocations must be separated by at least one hour. + // + // Format of at expressions is "at(yyyy-mm-ddThh:mm:ss)". For example, "at(2016-03-04T17:27:00)". + // + // Format of cron expressions is "cron(Minutes Hours Day-of-month Month Day-of-week + // Year)". For example, "cron(0 10 ? * MON *)". For more information, see Cron + // Expressions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions) + // in the Amazon CloudWatch Events User Guide. + Schedule *string `type:"string"` + + // The description of the scheduled action. + ScheduledActionDescription *string `type:"string"` + + // The name of the scheduled action. + ScheduledActionName *string `type:"string"` + + // The start time in UTC when the schedule is active. Before this time, the + // scheduled action does not trigger. + StartTime *time.Time `type:"timestamp"` + + // The state of the scheduled action. For example, DISABLED. + State *string `type:"string" enum:"ScheduledActionState"` + + // A JSON format string of the Amazon Redshift API operation with input parameters. + // + // "{\"ResizeCluster\":{\"NodeType\":\"ds2.8xlarge\",\"ClusterIdentifier\":\"my-test-cluster\",\"NumberOfNodes\":3}}". + TargetAction *ScheduledActionType `type:"structure"` +} + +// String returns the string representation +func (s ModifyScheduledActionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyScheduledActionOutput) GoString() string { + return s.String() +} + +// SetEndTime sets the EndTime field's value. +func (s *ModifyScheduledActionOutput) SetEndTime(v time.Time) *ModifyScheduledActionOutput { + s.EndTime = &v + return s +} + +// SetIamRole sets the IamRole field's value. +func (s *ModifyScheduledActionOutput) SetIamRole(v string) *ModifyScheduledActionOutput { + s.IamRole = &v + return s +} + +// SetNextInvocations sets the NextInvocations field's value. +func (s *ModifyScheduledActionOutput) SetNextInvocations(v []*time.Time) *ModifyScheduledActionOutput { + s.NextInvocations = v + return s +} + +// SetSchedule sets the Schedule field's value. +func (s *ModifyScheduledActionOutput) SetSchedule(v string) *ModifyScheduledActionOutput { + s.Schedule = &v + return s +} + +// SetScheduledActionDescription sets the ScheduledActionDescription field's value. +func (s *ModifyScheduledActionOutput) SetScheduledActionDescription(v string) *ModifyScheduledActionOutput { + s.ScheduledActionDescription = &v + return s +} + +// SetScheduledActionName sets the ScheduledActionName field's value. +func (s *ModifyScheduledActionOutput) SetScheduledActionName(v string) *ModifyScheduledActionOutput { + s.ScheduledActionName = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *ModifyScheduledActionOutput) SetStartTime(v time.Time) *ModifyScheduledActionOutput { + s.StartTime = &v + return s +} + +// SetState sets the State field's value. +func (s *ModifyScheduledActionOutput) SetState(v string) *ModifyScheduledActionOutput { + s.State = &v + return s +} + +// SetTargetAction sets the TargetAction field's value. +func (s *ModifyScheduledActionOutput) SetTargetAction(v *ScheduledActionType) *ModifyScheduledActionOutput { + s.TargetAction = v + return s +} + type ModifySnapshotCopyRetentionPeriodInput struct { _ struct{} `type:"structure"` @@ -19040,6 +20183,9 @@ type NodeConfigurationOption struct { // The estimated disk utilizaton percentage. EstimatedDiskUtilizationPercent *float64 `type:"double"` + // The category of the node configuration recommendation. + Mode *string `type:"string" enum:"Mode"` + // The node type, such as, "ds2.8xlarge". NodeType *string `type:"string"` @@ -19063,6 +20209,12 @@ func (s *NodeConfigurationOption) SetEstimatedDiskUtilizationPercent(v float64) return s } +// SetMode sets the Mode field's value. +func (s *NodeConfigurationOption) SetMode(v string) *NodeConfigurationOption { + s.Mode = &v + return s +} + // SetNodeType sets the NodeType field's value. func (s *NodeConfigurationOption) SetNodeType(v string) *NodeConfigurationOption { s.NodeType = &v @@ -19902,9 +21054,7 @@ type ResizeClusterInput struct { NodeType *string `type:"string"` // The new number of nodes for the cluster. - // - // NumberOfNodes is a required field - NumberOfNodes *int64 `type:"integer" required:"true"` + NumberOfNodes *int64 `type:"integer"` } // String returns the string representation @@ -19923,9 +21073,6 @@ func (s *ResizeClusterInput) Validate() error { if s.ClusterIdentifier == nil { invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) } - if s.NumberOfNodes == nil { - invalidParams.Add(request.NewErrParamRequired("NumberOfNodes")) - } if invalidParams.Len() > 0 { return invalidParams @@ -19963,6 +21110,83 @@ func (s *ResizeClusterInput) SetNumberOfNodes(v int64) *ResizeClusterInput { return s } +type ResizeClusterMessage struct { + _ struct{} `type:"structure"` + + // A boolean value indicating whether the resize operation is using the classic + // resize process. If you don't provide this parameter or set the value to false, + // the resize type is elastic. + Classic *bool `type:"boolean"` + + // The unique identifier for the cluster to resize. + // + // ClusterIdentifier is a required field + ClusterIdentifier *string `type:"string" required:"true"` + + // The new cluster type for the specified cluster. + ClusterType *string `type:"string"` + + // The new node type for the nodes you are adding. If not specified, the cluster's + // current node type is used. + NodeType *string `type:"string"` + + // The new number of nodes for the cluster. + NumberOfNodes *int64 `type:"integer"` +} + +// String returns the string representation +func (s ResizeClusterMessage) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResizeClusterMessage) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResizeClusterMessage) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResizeClusterMessage"} + if s.ClusterIdentifier == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterIdentifier")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClassic sets the Classic field's value. +func (s *ResizeClusterMessage) SetClassic(v bool) *ResizeClusterMessage { + s.Classic = &v + return s +} + +// SetClusterIdentifier sets the ClusterIdentifier field's value. +func (s *ResizeClusterMessage) SetClusterIdentifier(v string) *ResizeClusterMessage { + s.ClusterIdentifier = &v + return s +} + +// SetClusterType sets the ClusterType field's value. +func (s *ResizeClusterMessage) SetClusterType(v string) *ResizeClusterMessage { + s.ClusterType = &v + return s +} + +// SetNodeType sets the NodeType field's value. +func (s *ResizeClusterMessage) SetNodeType(v string) *ResizeClusterMessage { + s.NodeType = &v + return s +} + +// SetNumberOfNodes sets the NumberOfNodes field's value. +func (s *ResizeClusterMessage) SetNumberOfNodes(v int64) *ResizeClusterMessage { + s.NumberOfNodes = &v + return s +} + type ResizeClusterOutput struct { _ struct{} `type:"structure"` @@ -20044,7 +21268,7 @@ type RestoreFromClusterSnapshotInput struct { // // Default: A random, system-chosen Availability Zone. // - // Example: us-east-1a + // Example: us-east-2a AvailabilityZone *string `type:"string"` // The identifier of the cluster that will be created from restoring the snapshot. @@ -20426,21 +21650,26 @@ 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. + // Returns the average rate for a completed backup. This field is only updated + // when you restore to DC2 and DS2 node types. 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. + // of time it took a completed restore to finish. This field is only updated + // when you restore to DC2 and DS2 node types. ElapsedTimeInSeconds *int64 `type:"long"` // The estimate of the time remaining before the restore will complete. Returns - // 0 for a completed restore. + // 0 for a completed restore. This field is only updated when you restore to + // DC2 and DS2 node types. EstimatedTimeToCompletionInSeconds *int64 `type:"long"` // The number of megabytes that have been transferred from snapshot storage. + // This field is only updated when you restore to DC2 and DS2 node types. ProgressInMegaBytes *int64 `type:"long"` - // The size of the set of snapshot data used to restore the cluster. + // The size of the set of snapshot data used to restore the cluster. This field + // is only updated when you restore to DC2 and DS2 node types. SnapshotSizeInMegaBytes *int64 `type:"long"` // The status of the restore action. Returns starting, restoring, completed, @@ -20933,6 +22162,216 @@ func (s *RotateEncryptionKeyOutput) SetCluster(v *Cluster) *RotateEncryptionKeyO return s } +// Describes a scheduled action. You can use a scheduled action to trigger some +// Amazon Redshift API operations on a schedule. For information about which +// API operations can be scheduled, see ScheduledActionType. +type ScheduledAction struct { + _ struct{} `type:"structure"` + + // The end time in UTC when the schedule is no longer active. After this time, + // the scheduled action does not trigger. + EndTime *time.Time `type:"timestamp"` + + // The IAM role to assume to run the scheduled action. This IAM role must have + // permission to run the Amazon Redshift API operation in the scheduled action. + // This IAM role must allow the Amazon Redshift scheduler (Principal scheduler.redshift.amazonaws.com) + // to assume permissions on your behalf. For more information about the IAM + // role to use with the Amazon Redshift scheduler, see Using Identity-Based + // Policies for Amazon Redshift (https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-identity-based.html) + // in the Amazon Redshift Cluster Management Guide. + IamRole *string `type:"string"` + + // List of times when the scheduled action will run. + NextInvocations []*time.Time `locationNameList:"ScheduledActionTime" type:"list"` + + // The schedule for a one-time (at format) or recurring (cron format) scheduled + // action. Schedule invocations must be separated by at least one hour. + // + // Format of at expressions is "at(yyyy-mm-ddThh:mm:ss)". For example, "at(2016-03-04T17:27:00)". + // + // Format of cron expressions is "cron(Minutes Hours Day-of-month Month Day-of-week + // Year)". For example, "cron(0 10 ? * MON *)". For more information, see Cron + // Expressions (https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions) + // in the Amazon CloudWatch Events User Guide. + Schedule *string `type:"string"` + + // The description of the scheduled action. + ScheduledActionDescription *string `type:"string"` + + // The name of the scheduled action. + ScheduledActionName *string `type:"string"` + + // The start time in UTC when the schedule is active. Before this time, the + // scheduled action does not trigger. + StartTime *time.Time `type:"timestamp"` + + // The state of the scheduled action. For example, DISABLED. + State *string `type:"string" enum:"ScheduledActionState"` + + // A JSON format string of the Amazon Redshift API operation with input parameters. + // + // "{\"ResizeCluster\":{\"NodeType\":\"ds2.8xlarge\",\"ClusterIdentifier\":\"my-test-cluster\",\"NumberOfNodes\":3}}". + TargetAction *ScheduledActionType `type:"structure"` +} + +// String returns the string representation +func (s ScheduledAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ScheduledAction) GoString() string { + return s.String() +} + +// SetEndTime sets the EndTime field's value. +func (s *ScheduledAction) SetEndTime(v time.Time) *ScheduledAction { + s.EndTime = &v + return s +} + +// SetIamRole sets the IamRole field's value. +func (s *ScheduledAction) SetIamRole(v string) *ScheduledAction { + s.IamRole = &v + return s +} + +// SetNextInvocations sets the NextInvocations field's value. +func (s *ScheduledAction) SetNextInvocations(v []*time.Time) *ScheduledAction { + s.NextInvocations = v + return s +} + +// SetSchedule sets the Schedule field's value. +func (s *ScheduledAction) SetSchedule(v string) *ScheduledAction { + s.Schedule = &v + return s +} + +// SetScheduledActionDescription sets the ScheduledActionDescription field's value. +func (s *ScheduledAction) SetScheduledActionDescription(v string) *ScheduledAction { + s.ScheduledActionDescription = &v + return s +} + +// SetScheduledActionName sets the ScheduledActionName field's value. +func (s *ScheduledAction) SetScheduledActionName(v string) *ScheduledAction { + s.ScheduledActionName = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *ScheduledAction) SetStartTime(v time.Time) *ScheduledAction { + s.StartTime = &v + return s +} + +// SetState sets the State field's value. +func (s *ScheduledAction) SetState(v string) *ScheduledAction { + s.State = &v + return s +} + +// SetTargetAction sets the TargetAction field's value. +func (s *ScheduledAction) SetTargetAction(v *ScheduledActionType) *ScheduledAction { + s.TargetAction = v + return s +} + +// A set of elements to filter the returned scheduled actions. +type ScheduledActionFilter struct { + _ struct{} `type:"structure"` + + // The type of element to filter. + // + // Name is a required field + Name *string `type:"string" required:"true" enum:"ScheduledActionFilterName"` + + // List of values. Compare if the value (of type defined by Name) equals an + // item in the list of scheduled actions. + // + // Values is a required field + Values []*string `locationNameList:"item" type:"list" required:"true"` +} + +// String returns the string representation +func (s ScheduledActionFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ScheduledActionFilter) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ScheduledActionFilter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ScheduledActionFilter"} + 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 *ScheduledActionFilter) SetName(v string) *ScheduledActionFilter { + s.Name = &v + return s +} + +// SetValues sets the Values field's value. +func (s *ScheduledActionFilter) SetValues(v []*string) *ScheduledActionFilter { + s.Values = v + return s +} + +// The action type that specifies an Amazon Redshift API operation that is supported +// by the Amazon Redshift scheduler. +type ScheduledActionType struct { + _ struct{} `type:"structure"` + + // An action that runs a ResizeCluster API operation. + ResizeCluster *ResizeClusterMessage `type:"structure"` +} + +// String returns the string representation +func (s ScheduledActionType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ScheduledActionType) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ScheduledActionType) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ScheduledActionType"} + if s.ResizeCluster != nil { + if err := s.ResizeCluster.Validate(); err != nil { + invalidParams.AddNested("ResizeCluster", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResizeCluster sets the ResizeCluster field's value. +func (s *ScheduledActionType) SetResizeCluster(v *ResizeClusterMessage) *ScheduledActionType { + s.ResizeCluster = v + return s +} + // Describes a snapshot. type Snapshot struct { _ struct{} `type:"structure"` @@ -21777,7 +23216,7 @@ 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. + // arn:aws:redshift:us-east-2:123456789:cluster:t1. ResourceName *string `type:"string"` // The type of resource with which the tag is associated. Valid resource types @@ -21916,6 +23355,20 @@ func (s *VpcSecurityGroupMembership) SetVpcSecurityGroupId(v string) *VpcSecurit const ( // ActionTypeRestoreCluster is a ActionType enum value ActionTypeRestoreCluster = "restore-cluster" + + // ActionTypeRecommendNodeConfig is a ActionType enum value + ActionTypeRecommendNodeConfig = "recommend-node-config" + + // ActionTypeResizeCluster is a ActionType enum value + ActionTypeResizeCluster = "resize-cluster" +) + +const ( + // ModeStandard is a Mode enum value + ModeStandard = "standard" + + // ModeHighPerformance is a Mode enum value + ModeHighPerformance = "high-performance" ) const ( @@ -21927,6 +23380,9 @@ const ( // NodeConfigurationOptionsFilterNameEstimatedDiskUtilizationPercent is a NodeConfigurationOptionsFilterName enum value NodeConfigurationOptionsFilterNameEstimatedDiskUtilizationPercent = "EstimatedDiskUtilizationPercent" + + // NodeConfigurationOptionsFilterNameMode is a NodeConfigurationOptionsFilterName enum value + NodeConfigurationOptionsFilterNameMode = "Mode" ) const ( @@ -21979,6 +23435,27 @@ const ( ScheduleStateFailed = "FAILED" ) +const ( + // ScheduledActionFilterNameClusterIdentifier is a ScheduledActionFilterName enum value + ScheduledActionFilterNameClusterIdentifier = "cluster-identifier" + + // ScheduledActionFilterNameIamRole is a ScheduledActionFilterName enum value + ScheduledActionFilterNameIamRole = "iam-role" +) + +const ( + // ScheduledActionStateActive is a ScheduledActionState enum value + ScheduledActionStateActive = "ACTIVE" + + // ScheduledActionStateDisabled is a ScheduledActionState enum value + ScheduledActionStateDisabled = "DISABLED" +) + +const ( + // ScheduledActionTypeValuesResizeCluster is a ScheduledActionTypeValues enum value + ScheduledActionTypeValuesResizeCluster = "ResizeCluster" +) + const ( // SnapshotAttributeToSortBySourceType is a SnapshotAttributeToSortBy enum value SnapshotAttributeToSortBySourceType = "SOURCE_TYPE" @@ -22010,6 +23487,9 @@ const ( // SourceTypeClusterSnapshot is a SourceType enum value SourceTypeClusterSnapshot = "cluster-snapshot" + + // SourceTypeScheduledAction is a SourceType enum value + SourceTypeScheduledAction = "scheduled-action" ) const ( 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 index 406be5a3b2b..f710284ae43 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/redshift/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/redshift/errors.go @@ -381,6 +381,12 @@ const ( // The schedule you submitted isn't valid. ErrCodeInvalidScheduleFault = "InvalidSchedule" + // ErrCodeInvalidScheduledActionFault for service response error code + // "InvalidScheduledAction". + // + // The scheduled action is not valid. + ErrCodeInvalidScheduledActionFault = "InvalidScheduledAction" + // ErrCodeInvalidSnapshotCopyGrantStateFault for service response error code // "InvalidSnapshotCopyGrantStateFault". // @@ -512,6 +518,30 @@ const ( // The definition you submitted is not supported. ErrCodeScheduleDefinitionTypeUnsupportedFault = "ScheduleDefinitionTypeUnsupported" + // ErrCodeScheduledActionAlreadyExistsFault for service response error code + // "ScheduledActionAlreadyExists". + // + // The scheduled action already exists. + ErrCodeScheduledActionAlreadyExistsFault = "ScheduledActionAlreadyExists" + + // ErrCodeScheduledActionNotFoundFault for service response error code + // "ScheduledActionNotFound". + // + // The scheduled action cannot be found. + ErrCodeScheduledActionNotFoundFault = "ScheduledActionNotFound" + + // ErrCodeScheduledActionQuotaExceededFault for service response error code + // "ScheduledActionQuotaExceeded". + // + // The quota for scheduled actions exceeded. + ErrCodeScheduledActionQuotaExceededFault = "ScheduledActionQuotaExceeded" + + // ErrCodeScheduledActionTypeUnsupportedFault for service response error code + // "ScheduledActionTypeUnsupported". + // + // The action type specified for a scheduled action is not supported. + ErrCodeScheduledActionTypeUnsupportedFault = "ScheduledActionTypeUnsupported" + // ErrCodeSnapshotCopyAlreadyDisabledFault for service response error code // "SnapshotCopyAlreadyDisabledFault". // 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 index a750d141c62..c0dedf447dd 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/redshift/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/redshift/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "redshift" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Redshift" // ServiceID is a unique identifer of a specific service. + ServiceID = "Redshift" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Redshift client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Redshift client from just a session. // svc := redshift.New(mySession) // @@ -46,11 +48,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Redshift { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Redshift { svc := &Redshift{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2012-12-01", }, diff --git a/vendor/github.com/aws/aws-sdk-go/service/resourcegroups/api.go b/vendor/github.com/aws/aws-sdk-go/service/resourcegroups/api.go index 89989961e6e..4fa97b4d5e4 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/resourcegroups/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/resourcegroups/api.go @@ -8,6 +8,7 @@ import ( "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" ) const opCreateGroup = "CreateGroup" @@ -63,21 +64,21 @@ func (c *ResourceGroups) CreateGroupRequest(input *CreateGroupInput) (req *reque // See the AWS API reference guide for AWS Resource Groups's // API operation CreateGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request does not comply with validation rules that are defined for the // request parameters. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The caller is not authorized to make the request. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // The request uses an HTTP method which is not allowed for the specified resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The caller has exceeded throttling limits. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal error occurred while processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/CreateGroup @@ -156,24 +157,24 @@ func (c *ResourceGroups) DeleteGroupRequest(input *DeleteGroupInput) (req *reque // See the AWS API reference guide for AWS Resource Groups's // API operation DeleteGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request does not comply with validation rules that are defined for the // request parameters. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The caller is not authorized to make the request. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // One or more resources specified in the request do not exist. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // The request uses an HTTP method which is not allowed for the specified resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The caller has exceeded throttling limits. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal error occurred while processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/DeleteGroup @@ -251,24 +252,24 @@ func (c *ResourceGroups) GetGroupRequest(input *GetGroupInput) (req *request.Req // See the AWS API reference guide for AWS Resource Groups's // API operation GetGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request does not comply with validation rules that are defined for the // request parameters. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The caller is not authorized to make the request. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // One or more resources specified in the request do not exist. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // The request uses an HTTP method which is not allowed for the specified resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The caller has exceeded throttling limits. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal error occurred while processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/GetGroup @@ -346,24 +347,24 @@ func (c *ResourceGroups) GetGroupQueryRequest(input *GetGroupQueryInput) (req *r // See the AWS API reference guide for AWS Resource Groups's // API operation GetGroupQuery for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request does not comply with validation rules that are defined for the // request parameters. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The caller is not authorized to make the request. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // One or more resources specified in the request do not exist. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // The request uses an HTTP method which is not allowed for the specified resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The caller has exceeded throttling limits. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal error occurred while processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/GetGroupQuery @@ -442,24 +443,24 @@ func (c *ResourceGroups) GetTagsRequest(input *GetTagsInput) (req *request.Reque // See the AWS API reference guide for AWS Resource Groups's // API operation GetTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request does not comply with validation rules that are defined for the // request parameters. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The caller is not authorized to make the request. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // One or more resources specified in the request do not exist. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // The request uses an HTTP method which is not allowed for the specified resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The caller has exceeded throttling limits. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal error occurred while processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/GetTags @@ -544,28 +545,28 @@ func (c *ResourceGroups) ListGroupResourcesRequest(input *ListGroupResourcesInpu // See the AWS API reference guide for AWS Resource Groups's // API operation ListGroupResources for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request has not been applied because it lacks valid authentication credentials // for the target resource. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request does not comply with validation rules that are defined for the // request parameters. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The caller is not authorized to make the request. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // One or more resources specified in the request do not exist. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // The request uses an HTTP method which is not allowed for the specified resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The caller has exceeded throttling limits. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal error occurred while processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/ListGroupResources @@ -633,10 +634,12 @@ func (c *ResourceGroups) ListGroupResourcesPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGroupResourcesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListGroupResourcesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -699,21 +702,21 @@ func (c *ResourceGroups) ListGroupsRequest(input *ListGroupsInput) (req *request // See the AWS API reference guide for AWS Resource Groups's // API operation ListGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request does not comply with validation rules that are defined for the // request parameters. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The caller is not authorized to make the request. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // The request uses an HTTP method which is not allowed for the specified resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The caller has exceeded throttling limits. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal error occurred while processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/ListGroups @@ -781,10 +784,12 @@ func (c *ResourceGroups) ListGroupsPagesWithContext(ctx aws.Context, input *List }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -849,25 +854,25 @@ func (c *ResourceGroups) SearchResourcesRequest(input *SearchResourcesInput) (re // See the AWS API reference guide for AWS Resource Groups's // API operation SearchResources for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // The request has not been applied because it lacks valid authentication credentials // for the target resource. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // The request does not comply with validation rules that are defined for the // request parameters. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The caller is not authorized to make the request. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // The request uses an HTTP method which is not allowed for the specified resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The caller has exceeded throttling limits. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal error occurred while processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/SearchResources @@ -935,10 +940,12 @@ func (c *ResourceGroups) SearchResourcesPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SearchResourcesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*SearchResourcesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -996,24 +1003,24 @@ func (c *ResourceGroups) TagRequest(input *TagInput) (req *request.Request, outp // See the AWS API reference guide for AWS Resource Groups's // API operation Tag for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request does not comply with validation rules that are defined for the // request parameters. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The caller is not authorized to make the request. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // One or more resources specified in the request do not exist. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // The request uses an HTTP method which is not allowed for the specified resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The caller has exceeded throttling limits. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal error occurred while processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/Tag @@ -1091,24 +1098,24 @@ func (c *ResourceGroups) UntagRequest(input *UntagInput) (req *request.Request, // See the AWS API reference guide for AWS Resource Groups's // API operation Untag for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request does not comply with validation rules that are defined for the // request parameters. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The caller is not authorized to make the request. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // One or more resources specified in the request do not exist. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // The request uses an HTTP method which is not allowed for the specified resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The caller has exceeded throttling limits. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal error occurred while processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/Untag @@ -1187,24 +1194,24 @@ func (c *ResourceGroups) UpdateGroupRequest(input *UpdateGroupInput) (req *reque // See the AWS API reference guide for AWS Resource Groups's // API operation UpdateGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request does not comply with validation rules that are defined for the // request parameters. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The caller is not authorized to make the request. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // One or more resources specified in the request do not exist. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // The request uses an HTTP method which is not allowed for the specified resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The caller has exceeded throttling limits. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal error occurred while processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/UpdateGroup @@ -1282,24 +1289,24 @@ func (c *ResourceGroups) UpdateGroupQueryRequest(input *UpdateGroupQueryInput) ( // See the AWS API reference guide for AWS Resource Groups's // API operation UpdateGroupQuery for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // The request does not comply with validation rules that are defined for the // request parameters. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The caller is not authorized to make the request. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // One or more resources specified in the request do not exist. // -// * ErrCodeMethodNotAllowedException "MethodNotAllowedException" +// * MethodNotAllowedException // The request uses an HTTP method which is not allowed for the specified resource. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The caller has exceeded throttling limits. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // An internal error occurred while processing the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/resource-groups-2017-11-27/UpdateGroupQuery @@ -1324,6 +1331,63 @@ func (c *ResourceGroups) UpdateGroupQueryWithContext(ctx aws.Context, input *Upd return out, req.Send() } +// The request does not comply with validation rules that are defined for the +// request parameters. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + type CreateGroupInput struct { _ struct{} `type:"structure"` @@ -1516,6 +1580,62 @@ func (s *DeleteGroupOutput) SetGroup(v *Group) *DeleteGroupOutput { return s } +// The caller is not authorized to make the request. +type ForbiddenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s ForbiddenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ForbiddenException) GoString() string { + return s.String() +} + +func newErrorForbiddenException(v protocol.ResponseMetadata) error { + return &ForbiddenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ForbiddenException) Code() string { + return "ForbiddenException" +} + +// Message returns the exception's message. +func (s ForbiddenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ForbiddenException) OrigErr() error { + return nil +} + +func (s ForbiddenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ForbiddenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ForbiddenException) RequestID() string { + return s.respMetadata.RequestID +} + type GetGroupInput struct { _ struct{} `type:"structure"` @@ -1895,6 +2015,62 @@ func (s *GroupQuery) SetResourceQuery(v *ResourceQuery) *GroupQuery { return s } +// An internal error occurred while processing the request. +type InternalServerErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s InternalServerErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerErrorException) GoString() string { + return s.String() +} + +func newErrorInternalServerErrorException(v protocol.ResponseMetadata) error { + return &InternalServerErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerErrorException) Code() string { + return "InternalServerErrorException" +} + +// Message returns the exception's message. +func (s InternalServerErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerErrorException) OrigErr() error { + return nil +} + +func (s InternalServerErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerErrorException) RequestID() string { + return s.respMetadata.RequestID +} + type ListGroupResourcesInput struct { _ struct{} `type:"structure"` @@ -2146,6 +2322,118 @@ func (s *ListGroupsOutput) SetNextToken(v string) *ListGroupsOutput { return s } +// The request uses an HTTP method which is not allowed for the specified resource. +type MethodNotAllowedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s MethodNotAllowedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MethodNotAllowedException) GoString() string { + return s.String() +} + +func newErrorMethodNotAllowedException(v protocol.ResponseMetadata) error { + return &MethodNotAllowedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MethodNotAllowedException) Code() string { + return "MethodNotAllowedException" +} + +// Message returns the exception's message. +func (s MethodNotAllowedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MethodNotAllowedException) OrigErr() error { + return nil +} + +func (s MethodNotAllowedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MethodNotAllowedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MethodNotAllowedException) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more resources specified in the request do not exist. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // A two-part error structure that can occur in ListGroupResources or SearchResources // operations on CloudFormation stack-based queries. The error occurs if the // CloudFormation stack on which the query is based either does not exist, or @@ -2569,6 +2857,119 @@ func (s *TagOutput) SetTags(v map[string]*string) *TagOutput { return s } +// The caller has exceeded throttling limits. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request has not been applied because it lacks valid authentication credentials +// for the target resource. +type UnauthorizedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" min:"1" type:"string"` +} + +// String returns the string representation +func (s UnauthorizedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnauthorizedException) GoString() string { + return s.String() +} + +func newErrorUnauthorizedException(v protocol.ResponseMetadata) error { + return &UnauthorizedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnauthorizedException) Code() string { + return "UnauthorizedException" +} + +// Message returns the exception's message. +func (s UnauthorizedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnauthorizedException) OrigErr() error { + return nil +} + +func (s UnauthorizedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnauthorizedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnauthorizedException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagInput struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/resourcegroups/errors.go b/vendor/github.com/aws/aws-sdk-go/service/resourcegroups/errors.go index 02234d49436..0d0a2a074ca 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/resourcegroups/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/resourcegroups/errors.go @@ -2,6 +2,10 @@ package resourcegroups +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadRequestException for service response error code @@ -48,3 +52,13 @@ const ( // for the target resource. ErrCodeUnauthorizedException = "UnauthorizedException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadRequestException": newErrorBadRequestException, + "ForbiddenException": newErrorForbiddenException, + "InternalServerErrorException": newErrorInternalServerErrorException, + "MethodNotAllowedException": newErrorMethodNotAllowedException, + "NotFoundException": newErrorNotFoundException, + "TooManyRequestsException": newErrorTooManyRequestsException, + "UnauthorizedException": newErrorUnauthorizedException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/resourcegroups/service.go b/vendor/github.com/aws/aws-sdk-go/service/resourcegroups/service.go index 46a19ff2316..ec1a500adf5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/resourcegroups/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/resourcegroups/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "resource-groups" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Resource Groups" // ServiceID is a unique identifer of a specific service. + ServiceID = "Resource Groups" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ResourceGroups client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ResourceGroups client from just a session. // svc := resourcegroups.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *ResourceGroups { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "resource-groups" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ResourceGroups { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ResourceGroups { svc := &ResourceGroups{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-11-27", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 1f39309a234..c17f25d357d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/api.go @@ -3983,10 +3983,12 @@ func (c *Route53) ListHealthChecksPagesWithContext(ctx aws.Context, input *ListH }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListHealthChecksOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListHealthChecksOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4130,10 +4132,12 @@ func (c *Route53) ListHostedZonesPagesWithContext(ctx aws.Context, input *ListHo }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListHostedZonesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListHostedZonesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4555,10 +4559,12 @@ func (c *Route53) ListResourceRecordSetsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListResourceRecordSetsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListResourceRecordSetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } 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 index dd22cb2cd84..96f3e5fccf0 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/route53/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/route53/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "route53" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Route 53" // ServiceID is a unique identifer of a specific service. + ServiceID = "Route 53" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Route53 client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Route53 client from just a session. // svc := route53.New(mySession) // @@ -46,11 +48,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Route53 { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Route53 { svc := &Route53{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2013-04-01", }, diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53resolver/api.go b/vendor/github.com/aws/aws-sdk-go/service/route53resolver/api.go index 11a3f163c8e..721af4756d7 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/route53resolver/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/route53resolver/api.go @@ -69,26 +69,26 @@ func (c *Route53Resolver) AssociateResolverEndpointIpAddressRequest(input *Assoc // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation AssociateResolverEndpointIpAddress for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is invalid. // -// * ErrCodeResourceExistsException "ResourceExistsException" +// * ResourceExistsException // The resource that you tried to create already exists. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request caused one or more limits to be exceeded. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/AssociateResolverEndpointIpAddress @@ -170,26 +170,26 @@ func (c *Route53Resolver) AssociateResolverRuleRequest(input *AssociateResolverR // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation AssociateResolverRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is invalid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" +// * ResourceUnavailableException // The specified resource isn't available. // -// * ErrCodeResourceExistsException "ResourceExistsException" +// * ResourceExistsException // The resource that you tried to create already exists. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/AssociateResolverRule @@ -274,26 +274,26 @@ func (c *Route53Resolver) CreateResolverEndpointRequest(input *CreateResolverEnd // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation CreateResolverEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is invalid. // -// * ErrCodeResourceExistsException "ResourceExistsException" +// * ResourceExistsException // The resource that you tried to create already exists. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request caused one or more limits to be exceeded. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/CreateResolverEndpoint @@ -373,29 +373,29 @@ func (c *Route53Resolver) CreateResolverRuleRequest(input *CreateResolverRuleInp // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation CreateResolverRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is invalid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request caused one or more limits to be exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeResourceExistsException "ResourceExistsException" +// * ResourceExistsException // The resource that you tried to create already exists. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" +// * ResourceUnavailableException // The specified resource isn't available. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/CreateResolverRule @@ -480,20 +480,20 @@ func (c *Route53Resolver) DeleteResolverEndpointRequest(input *DeleteResolverEnd // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation DeleteResolverEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is invalid. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/DeleteResolverEndpoint @@ -573,20 +573,20 @@ func (c *Route53Resolver) DeleteResolverRuleRequest(input *DeleteResolverRuleInp // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation DeleteResolverRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // The resource that you tried to update or delete is currently in use. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/DeleteResolverRule @@ -668,23 +668,23 @@ func (c *Route53Resolver) DisassociateResolverEndpointIpAddressRequest(input *Di // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation DisassociateResolverEndpointIpAddress for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is invalid. // -// * ErrCodeResourceExistsException "ResourceExistsException" +// * ResourceExistsException // The resource that you tried to create already exists. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/DisassociateResolverEndpointIpAddress @@ -766,17 +766,17 @@ func (c *Route53Resolver) DisassociateResolverRuleRequest(input *DisassociateRes // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation DisassociateResolverRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/DisassociateResolverRule @@ -856,17 +856,17 @@ func (c *Route53Resolver) GetResolverEndpointRequest(input *GetResolverEndpointI // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation GetResolverEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/GetResolverEndpoint @@ -946,17 +946,17 @@ func (c *Route53Resolver) GetResolverRuleRequest(input *GetResolverRuleInput) (r // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation GetResolverRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/GetResolverRule @@ -1035,17 +1035,17 @@ func (c *Route53Resolver) GetResolverRuleAssociationRequest(input *GetResolverRu // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation GetResolverRuleAssociation for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/GetResolverRuleAssociation @@ -1125,14 +1125,14 @@ func (c *Route53Resolver) GetResolverRulePolicyRequest(input *GetResolverRulePol // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation GetResolverRulePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeUnknownResourceException "UnknownResourceException" +// * UnknownResourceException // The specified resource doesn't exist. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/GetResolverRulePolicy @@ -1216,20 +1216,20 @@ func (c *Route53Resolver) ListResolverEndpointIpAddressesRequest(input *ListReso // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation ListResolverEndpointIpAddresses for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The value that you specified for NextToken in a List request isn't valid. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/ListResolverEndpointIpAddresses @@ -1297,10 +1297,12 @@ func (c *Route53Resolver) ListResolverEndpointIpAddressesPagesWithContext(ctx aw }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListResolverEndpointIpAddressesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListResolverEndpointIpAddressesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1364,20 +1366,20 @@ func (c *Route53Resolver) ListResolverEndpointsRequest(input *ListResolverEndpoi // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation ListResolverEndpoints for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The value that you specified for NextToken in a List request isn't valid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is invalid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/ListResolverEndpoints @@ -1445,10 +1447,12 @@ func (c *Route53Resolver) ListResolverEndpointsPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListResolverEndpointsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListResolverEndpointsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1512,20 +1516,20 @@ func (c *Route53Resolver) ListResolverRuleAssociationsRequest(input *ListResolve // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation ListResolverRuleAssociations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The value that you specified for NextToken in a List request isn't valid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is invalid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/ListResolverRuleAssociations @@ -1593,10 +1597,12 @@ func (c *Route53Resolver) ListResolverRuleAssociationsPagesWithContext(ctx aws.C }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListResolverRuleAssociationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListResolverRuleAssociationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1659,20 +1665,20 @@ func (c *Route53Resolver) ListResolverRulesRequest(input *ListResolverRulesInput // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation ListResolverRules for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // The value that you specified for NextToken in a List request isn't valid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is invalid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/ListResolverRules @@ -1740,10 +1746,12 @@ func (c *Route53Resolver) ListResolverRulesPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListResolverRulesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListResolverRulesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1800,23 +1808,23 @@ func (c *Route53Resolver) ListTagsForResourceRequest(input *ListTagsForResourceI // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The value that you specified for NextToken in a List request isn't valid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is invalid. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/ListTagsForResource @@ -1895,17 +1903,17 @@ func (c *Route53Resolver) PutResolverRulePolicyRequest(input *PutResolverRulePol // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation PutResolverRulePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidPolicyDocument "InvalidPolicyDocument" +// Returned Error Types: +// * InvalidPolicyDocument // The specified resolver rule policy is invalid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeUnknownResourceException "UnknownResourceException" +// * UnknownResourceException // The specified resource doesn't exist. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/PutResolverRulePolicy @@ -1984,23 +1992,23 @@ func (c *Route53Resolver) TagResourceRequest(input *TagResourceInput) (req *requ // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeLimitExceededException "LimitExceededException" +// Returned Error Types: +// * LimitExceededException // The request caused one or more limits to be exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInvalidTagException "InvalidTagException" +// * InvalidTagException // The specified tag is invalid. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/TagResource @@ -2079,17 +2087,17 @@ func (c *Route53Resolver) UntagResourceRequest(input *UntagResourceInput) (req * // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/UntagResource @@ -2167,20 +2175,20 @@ func (c *Route53Resolver) UpdateResolverEndpointRequest(input *UpdateResolverEnd // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation UpdateResolverEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is invalid. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/UpdateResolverEndpoint @@ -2260,26 +2268,26 @@ func (c *Route53Resolver) UpdateResolverRuleRequest(input *UpdateResolverRuleInp // See the AWS API reference guide for Amazon Route 53 Resolver's // API operation UpdateResolverRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is invalid. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // One or more parameters in this request are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource doesn't exist. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" +// * ResourceUnavailableException // The specified resource isn't available. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request caused one or more limits to be exceeded. // -// * ErrCodeInternalServiceErrorException "InternalServiceErrorException" +// * InternalServiceErrorException // We encountered an unknown error. Try again in a few minutes. // -// * ErrCodeThrottlingException "ThrottlingException" +// * ThrottlingException // The request was throttled. Try again in a few minutes. // // See also, https://docs.aws.amazon.com/goto/WebAPI/route53resolver-2018-04-01/UpdateResolverRule @@ -3402,6 +3410,346 @@ func (s *GetResolverRulePolicyOutput) SetResolverRulePolicy(v string) *GetResolv return s } +// We encountered an unknown error. Try again in a few minutes. +type InternalServiceErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalServiceErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServiceErrorException) GoString() string { + return s.String() +} + +func newErrorInternalServiceErrorException(v protocol.ResponseMetadata) error { + return &InternalServiceErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServiceErrorException) Code() string { + return "InternalServiceErrorException" +} + +// Message returns the exception's message. +func (s InternalServiceErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServiceErrorException) OrigErr() error { + return nil +} + +func (s InternalServiceErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServiceErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServiceErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// The value that you specified for NextToken in a List request isn't valid. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNextTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more parameters in this request are not valid. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // For an InvalidParameterException error, the name of the parameter that's + // invalid. + FieldName *string `type:"string"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} + +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resolver rule policy is invalid. +type InvalidPolicyDocument struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidPolicyDocument) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPolicyDocument) GoString() string { + return s.String() +} + +func newErrorInvalidPolicyDocument(v protocol.ResponseMetadata) error { + return &InvalidPolicyDocument{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPolicyDocument) Code() string { + return "InvalidPolicyDocument" +} + +// Message returns the exception's message. +func (s InvalidPolicyDocument) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPolicyDocument) OrigErr() error { + return nil +} + +func (s InvalidPolicyDocument) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPolicyDocument) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPolicyDocument) RequestID() string { + return s.respMetadata.RequestID +} + +// The request is invalid. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified tag is invalid. +type InvalidTagException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidTagException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidTagException) GoString() string { + return s.String() +} + +func newErrorInvalidTagException(v protocol.ResponseMetadata) error { + return &InvalidTagException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidTagException) Code() string { + return "InvalidTagException" +} + +// Message returns the exception's message. +func (s InvalidTagException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTagException) OrigErr() error { + return nil +} + +func (s InvalidTagException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTagException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidTagException) RequestID() string { + return s.respMetadata.RequestID +} + // In an CreateResolverEndpoint request, a subnet and IP address that you want // to use for DNS queries. type IpAddressRequest struct { @@ -3602,6 +3950,66 @@ func (s *IpAddressUpdate) SetSubnetId(v string) *IpAddressUpdate { return s } +// The request caused one or more limits to be exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // For a LimitExceededException error, the type of resource that exceeded the + // current limit. + ResourceType *string `type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListResolverEndpointIpAddressesInput struct { _ struct{} `type:"structure"` @@ -4678,6 +5086,246 @@ func (s *ResolverRuleConfig) SetTargetIps(v []*TargetAddress) *ResolverRuleConfi return s } +// The resource that you tried to create already exists. +type ResourceExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // For a ResourceExistsException error, the type of resource that the error + // applies to. + ResourceType *string `type:"string"` +} + +// String returns the string representation +func (s ResourceExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceExistsException) GoString() string { + return s.String() +} + +func newErrorResourceExistsException(v protocol.ResponseMetadata) error { + return &ResourceExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceExistsException) Code() string { + return "ResourceExistsException" +} + +// Message returns the exception's message. +func (s ResourceExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceExistsException) OrigErr() error { + return nil +} + +func (s ResourceExistsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource that you tried to update or delete is currently in use. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // For a ResourceInUseException error, the type of resource that is currently + // in use. + ResourceType *string `type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource doesn't exist. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // For a ResourceNotFoundException error, the type of resource that doesn't + // exist. + ResourceType *string `type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource isn't available. +type ResourceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // For a ResourceUnavailableException error, the type of resource that isn't + // available. + ResourceType *string `type:"string"` +} + +// String returns the string representation +func (s ResourceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceUnavailableException) GoString() string { + return s.String() +} + +func newErrorResourceUnavailableException(v protocol.ResponseMetadata) error { + return &ResourceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceUnavailableException) Code() string { + return "ResourceUnavailableException" +} + +// Message returns the exception's message. +func (s ResourceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceUnavailableException) OrigErr() error { + return nil +} + +func (s ResourceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + // One tag that you want to add to the specified resource. A tag consists of // a Key (a name for the tag) and a Value. type Tag struct { @@ -4850,6 +5498,118 @@ func (s *TargetAddress) SetPort(v int64) *TargetAddress { return s } +// The request was throttled. Try again in a few minutes. +type ThrottlingException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ThrottlingException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ThrottlingException) GoString() string { + return s.String() +} + +func newErrorThrottlingException(v protocol.ResponseMetadata) error { + return &ThrottlingException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ThrottlingException) Code() string { + return "ThrottlingException" +} + +// Message returns the exception's message. +func (s ThrottlingException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ThrottlingException) OrigErr() error { + return nil +} + +func (s ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ThrottlingException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ThrottlingException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource doesn't exist. +type UnknownResourceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s UnknownResourceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnknownResourceException) GoString() string { + return s.String() +} + +func newErrorUnknownResourceException(v protocol.ResponseMetadata) error { + return &UnknownResourceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnknownResourceException) Code() string { + return "UnknownResourceException" +} + +// Message returns the exception's message. +func (s UnknownResourceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnknownResourceException) OrigErr() error { + return nil +} + +func (s UnknownResourceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnknownResourceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnknownResourceException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53resolver/errors.go b/vendor/github.com/aws/aws-sdk-go/service/route53resolver/errors.go index 0d410863ec0..a27e58d72e6 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/route53resolver/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/route53resolver/errors.go @@ -2,6 +2,10 @@ package route53resolver +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInternalServiceErrorException for service response error code @@ -82,3 +86,19 @@ const ( // The specified resource doesn't exist. ErrCodeUnknownResourceException = "UnknownResourceException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InternalServiceErrorException": newErrorInternalServiceErrorException, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "InvalidParameterException": newErrorInvalidParameterException, + "InvalidPolicyDocument": newErrorInvalidPolicyDocument, + "InvalidRequestException": newErrorInvalidRequestException, + "InvalidTagException": newErrorInvalidTagException, + "LimitExceededException": newErrorLimitExceededException, + "ResourceExistsException": newErrorResourceExistsException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ResourceUnavailableException": newErrorResourceUnavailableException, + "ThrottlingException": newErrorThrottlingException, + "UnknownResourceException": newErrorUnknownResourceException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/route53resolver/service.go b/vendor/github.com/aws/aws-sdk-go/service/route53resolver/service.go index 367e933ebb9..f54c4af745e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/route53resolver/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/route53resolver/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "Route53Resolver" // Name of service. EndpointsID = "route53resolver" // ID to lookup a service endpoint with. - ServiceID = "Route53Resolver" // ServiceID is a unique identifer of a specific service. + ServiceID = "Route53Resolver" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Route53Resolver client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Route53Resolver client from just a session. // svc := route53resolver.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := route53resolver.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *Route53Resolver { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Route53Resolver { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Route53Resolver { svc := &Route53Resolver{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-04-01", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 b4a4e8c4ad7..52e87308f69 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 @@ -7,7 +7,6 @@ import ( "fmt" "io" "sync" - "sync/atomic" "time" "github.com/aws/aws-sdk-go/aws" @@ -20,6 +19,7 @@ import ( "github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi" "github.com/aws/aws-sdk-go/private/protocol/rest" "github.com/aws/aws-sdk-go/private/protocol/restxml" + "github.com/aws/aws-sdk-go/service/s3/internal/arn" ) const opAbortMultipartUpload = "AbortMultipartUpload" @@ -66,11 +66,31 @@ func (c *S3) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) (req // AbortMultipartUpload API operation for Amazon Simple Storage Service. // -// Aborts a multipart upload. +// This operation aborts a multipart upload. After a multipart upload is aborted, +// no additional parts can be uploaded using that upload ID. The storage consumed +// by any previously uploaded parts will be freed. However, if any part uploads +// are currently in progress, those part uploads might or might not succeed. +// As a result, it might be necessary to abort a given multipart upload multiple +// times in order to completely free all storage consumed by all parts. // // To verify that all parts have been removed, so you don't get charged for -// the part storage, you should call the List Parts operation and ensure the -// parts list is empty. +// the part storage, you should call the ListParts operation and ensure that +// the parts list is empty. +// +// For information about permissions required to use the multipart upload API, +// see Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). +// +// The following operations are related to AbortMultipartUpload: +// +// * CreateMultipartUpload +// +// * UploadPart +// +// * CompleteMultipartUpload +// +// * ListParts +// +// * ListMultipartUploads // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -151,6 +171,64 @@ func (c *S3) CompleteMultipartUploadRequest(input *CompleteMultipartUploadInput) // // Completes a multipart upload by assembling previously uploaded parts. // +// You first initiate the multipart upload and then upload all parts using the +// UploadPart operation. After successfully uploading all relevant parts of +// an upload, you call this operation to complete the upload. Upon receiving +// this request, Amazon S3 concatenates all the parts in ascending order by +// part number to create a new object. In the Complete Multipart Upload request, +// you must provide the parts list. You must ensure that the parts list is complete. +// This operation concatenates the parts that you provide in the list. For each +// part in the list, you must provide the part number and the ETag value, returned +// after that part was uploaded. +// +// Processing of a Complete Multipart Upload request could take several minutes +// to complete. After Amazon S3 begins processing the request, it sends an HTTP +// response header that specifies a 200 OK response. While processing is in +// progress, Amazon S3 periodically sends white space characters to keep the +// connection from timing out. Because a request could fail after the initial +// 200 OK response has been sent, it is important that you check the response +// body to determine whether the request succeeded. +// +// Note that if CompleteMultipartUpload fails, applications should be prepared +// to retry the failed requests. For more information, see Amazon S3 Error Best +// Practices (https://docs.aws.amazon.com/AmazonS3/latest/dev/ErrorBestPractices.html). +// +// For more information about multipart uploads, see Uploading Objects Using +// Multipart Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html). +// +// For information about permissions required to use the multipart upload API, +// see Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). +// +// GetBucketLifecycle has the following special errors: +// +// * Error code: EntityTooSmall Description: Your proposed upload is smaller +// than the minimum allowed object size. Each part must be at least 5 MB +// in size, except the last part. 400 Bad Request +// +// * Error code: InvalidPart Description: One or more of the specified parts +// could not be found. The part might not have been uploaded, or the specified +// entity tag might not have matched the part's entity tag. 400 Bad Request +// +// * Error code: InvalidPartOrder Description: The list of parts was not +// in ascending order. The parts list must be specified in order by part +// number. 400 Bad Request +// +// * Error code: NoSuchUpload Description: The specified multipart upload +// does not exist. The upload ID might be invalid, or the multipart upload +// might have been aborted or completed. 404 Not Found +// +// The following operations are related to DeleteBucketMetricsConfiguration: +// +// * CreateMultipartUpload +// +// * UploadPart +// +// * AbortMultipartUpload +// +// * ListParts +// +// * ListMultipartUploads +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -225,6 +303,194 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, ou // // Creates a copy of an object that is already stored in Amazon S3. // +// You can store individual objects of up to 5 TB in Amazon S3. You create a +// copy of your object up to 5 GB in size in a single atomic operation using +// this API. However, for copying an object greater than 5 GB, you must use +// the multipart upload Upload Part - Copy API. For more information, see Copy +// Object Using the REST Multipart Upload API (https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjctsUsingRESTMPUapi.html). +// +// When copying an object, you can preserve all metadata (default) or specify +// new metadata. However, the ACL is not preserved and is set to private for +// the user making the request. To override the default ACL setting, specify +// a new ACL when generating a copy request. For more information, see Using +// ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html). +// +// Amazon S3 transfer acceleration does not support cross-region copies. If +// you request a cross-region copy using a transfer acceleration endpoint, you +// get a 400 Bad Request error. For more information about transfer acceleration, +// see Transfer Acceleration (https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html). +// +// All copy requests must be authenticated. Additionally, you must have read +// access to the source object and write access to the destination bucket. For +// more information, see REST Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html). +// Both the Region that you want to copy the object from and the Region that +// you want to copy the object to must be enabled for your account. +// +// To only copy an object under certain conditions, such as whether the Etag +// matches or whether the object was modified before or after a specified date, +// use the request parameters x-amz-copy-source-if-match, x-amz-copy-source-if-none-match, +// x-amz-copy-source-if-unmodified-since, or x-amz-copy-source-if-modified-since. +// +// All headers with the x-amz- prefix, including x-amz-copy-source, must be +// signed. +// +// You can use this operation to change the storage class of an object that +// is already stored in Amazon S3 using the StorageClass parameter. For more +// information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html). +// +// The source object that you are copying can be encrypted or unencrypted. If +// the source object is encrypted, it can be encrypted by server-side encryption +// using AWS managed encryption keys or by using a customer-provided encryption +// key. When copying an object, you can request that Amazon S3 encrypt the target +// object by using either the AWS managed encryption keys or by using your own +// encryption key. You can do this regardless of the form of server-side encryption +// that was used to encrypt the source, or even if the source object was not +// encrypted. For more information about server-side encryption, see Using Server-Side +// Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html). +// +// A copy request might return an error when Amazon S3 receives the copy request +// or while Amazon S3 is copying the files. If the error occurs before the copy +// operation starts, you receive a standard Amazon S3 error. If the error occurs +// during the copy operation, the error response is embedded in the 200 OK response. +// This means that a 200 OK response can contain either a success or an error. +// Design your application to parse the contents of the response and handle +// it appropriately. +// +// If the copy is successful, you receive a response with information about +// the copied object. +// +// If the request is an HTTP 1.1 request, the response is chunk encoded. If +// it were not, it would not contain the content-length, and you would need +// to read the entire body. +// +// Consider the following when using request headers: +// +// * Consideration 1 – If both the x-amz-copy-source-if-match and x-amz-copy-source-if-unmodified-since +// headers are present in the request and evaluate as follows, Amazon S3 +// returns 200 OK and copies the data: x-amz-copy-source-if-match condition +// evaluates to true x-amz-copy-source-if-unmodified-since condition evaluates +// to false +// +// * Consideration 2 – If both of the x-amz-copy-source-if-none-match and +// x-amz-copy-source-if-modified-since headers are present in the request +// and evaluate as follows, Amazon S3 returns the 412 Precondition Failed +// response code: x-amz-copy-source-if-none-match condition evaluates to +// false x-amz-copy-source-if-modified-since condition evaluates to true +// +// The copy request charge is based on the storage class and Region you specify +// for the destination object. For pricing information, see Amazon S3 Pricing +// (https://aws.amazon.com/s3/pricing/). +// +// Following are other considerations when using CopyObject: +// +// Versioning +// +// By default, x-amz-copy-source identifies the current version of an object +// to copy. (If the current version is a delete marker, Amazon S3 behaves as +// if the object was deleted.) To copy a different version, use the versionId +// subresource. +// +// If you enable versioning on the target bucket, Amazon S3 generates a unique +// version ID for the object being copied. This version ID is different from +// the version ID of the source object. Amazon S3 returns the version ID of +// the copied object in the x-amz-version-id response header in the response. +// +// If you do not enable versioning or suspend it on the target bucket, the version +// ID that Amazon S3 generates is always null. +// +// If the source object's storage class is GLACIER, you must restore a copy +// of this object before you can use it as a source object for the copy operation. +// For more information, see . +// +// Access Permissions +// +// When copying an object, you can optionally specify the accounts or groups +// that should be granted specific permissions on the new object. There are +// two ways to grant the permissions using the request headers: +// +// * Specify a canned ACL with the x-amz-acl request header. For more information, +// see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). +// +// * Specify access permissions explicitly with the x-amz-grant-read, x-amz-grant-read-acp, +// x-amz-grant-write-acp, and x-amz-grant-full-control headers. These parameters +// map to the set of permissions that Amazon S3 supports in an ACL. For more +// information, see Access Control List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html). +// +// You can use either a canned ACL or specify access permissions explicitly. +// You cannot do both. +// +// Server-Side- Encryption-Specific Request Headers +// +// To encrypt the target object, you must provide the appropriate encryption-related +// request headers. The one you use depends on whether you want to use AWS managed +// encryption keys or provide your own encryption key. +// +// * To encrypt the target object using server-side encryption with an AWS +// managed encryption key, provide the following request headers, as appropriate. +// x-amz-server-side​-encryption x-amz-server-side-encryption-aws-kms-key-id +// x-amz-server-side-encryption-context If you specify x-amz-server-side-encryption:aws:kms, +// but don't provide x-amz-server-side-encryption-aws-kms-key-id, Amazon +// S3 uses the AWS managed CMK in AWS KMS to protect the data. If you want +// to use a customer managed AWS KMS CMK, you must provide the x-amz-server-side-encryption-aws-kms-key-id +// of the symmetric customer managed CMK. Amazon S3 only supports symmetric +// CMKs and not asymmetric CMKs. For more information, see Using Symmetric +// and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the AWS Key Management Service Developer Guide. All GET and PUT requests +// for an object protected by AWS KMS fail if you don't make them with SSL +// or by using SigV4. For more information about server-side encryption with +// CMKs stored in AWS KMS (SSE-KMS), see Protecting Data Using Server-Side +// Encryption with CMKs stored in KMS (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). +// +// * To encrypt the target object using server-side encryption with an encryption +// key that you provide, use the following headers. x-amz-server-side​-encryption​-customer-algorithm +// x-amz-server-side​-encryption​-customer-key x-amz-server-side​-encryption​-customer-key-MD5 +// +// * If the source object is encrypted using server-side encryption with +// customer-provided encryption keys, you must use the following headers. +// x-amz-copy-source​-server-side​-encryption​-customer-algorithm x-amz-copy-source​-server-side​-encryption​-customer-key +// x-amz-copy-source-​server-side​-encryption​-customer-key-MD5 For +// more information about server-side encryption with CMKs stored in AWS +// KMS (SSE-KMS), see Protecting Data Using Server-Side Encryption with CMKs +// stored in Amazon KMS (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). +// +// Access-Control-List (ACL)-Specific Request Headers +// +// You also can use the following access control–related headers with this +// operation. By default, all objects are private. Only the owner has full access +// control. When adding a new object, you can grant permissions to individual +// AWS accounts or to predefined groups defined by Amazon S3. These permissions +// are then added to the access control list (ACL) on the object. For more information, +// see Using ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html). +// With this operation, you can grant access permissions using one of the following +// two methods: +// +// * Specify a canned ACL (x-amz-acl) — Amazon S3 supports a set of predefined +// ACLs, known as canned ACLs. Each canned ACL has a predefined set of grantees +// and permissions. For more information, see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). +// +// * Specify access permissions explicitly — To explicitly grant access +// permissions to specific AWS accounts or groups, use the following headers. +// Each header maps to specific permissions that Amazon S3 supports in an +// ACL. For more information, see Access Control List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html). +// In the header, you specify a list of grantees who get the specific permission. +// To grant permissions explicitly, use: x-amz-grant-read x-amz-grant-write +// x-amz-grant-read-acp x-amz-grant-write-acp x-amz-grant-full-control You +// specify each grantee as a type=value pair, where the type is one of the +// following: emailAddress – if the value specified is the email address +// of an AWS account id – if the value specified is the canonical user +// ID of an AWS account uri – if you are granting permissions to a predefined +// group For example, the following x-amz-grant-read header grants the AWS +// accounts identified by email addresses permissions to read object data +// and its metadata: x-amz-grant-read: emailAddress="xyz@amazon.com", emailAddress="abc@amazon.com" +// +// The following operations are related to CopyObject: +// +// * PutObject +// +// * GetObject +// +// For more information, see Copying Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjectsExamples.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. @@ -235,7 +501,7 @@ func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, ou // Returned Error Codes: // * ErrCodeObjectNotInActiveTierError "ObjectNotInActiveTierError" // The source object of the COPY operation is not in the active tier and is -// only stored in Amazon Glacier. +// only stored in Amazon S3 Glacier. // // See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObject func (c *S3) CopyObject(input *CopyObjectInput) (*CopyObjectOutput, error) { @@ -303,7 +569,60 @@ func (c *S3) CreateBucketRequest(input *CreateBucketInput) (req *request.Request // CreateBucket API operation for Amazon Simple Storage Service. // -// Creates a new bucket. +// Creates a new bucket. To create a bucket, you must register with Amazon S3 +// and have a valid AWS Access Key ID to authenticate requests. Anonymous requests +// are never allowed to create buckets. By creating the bucket, you become the +// bucket owner. +// +// Not every string is an acceptable bucket name. For information on bucket +// naming restrictions, see Working with Amazon S3 Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html). +// +// By default, the bucket is created in the US East (N. Virginia) Region. You +// can optionally specify a Region in the request body. You might choose a Region +// to optimize latency, minimize costs, or address regulatory requirements. +// For example, if you reside in Europe, you will probably find it advantageous +// to create buckets in the EU (Ireland) Region. For more information, see How +// to Select a Region for Your Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro). +// +// If you send your create bucket request to the s3.amazonaws.com endpoint, +// the request goes to the us-east-1 Region. Accordingly, the signature calculations +// in Signature Version 4 must use us-east-1 as the Region, even if the location +// constraint in the request specifies another Region where the bucket is to +// be created. If you create a bucket in a Region other than US East (N. Virginia), +// your application must be able to handle 307 redirect. For more information, +// see Virtual Hosting of Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html). +// +// When creating a bucket using this operation, you can optionally specify the +// accounts or groups that should be granted specific permissions on the bucket. +// There are two ways to grant the appropriate permissions using the request +// headers. +// +// * Specify a canned ACL using the x-amz-acl request header. Amazon S3 supports +// a set of predefined ACLs, known as canned ACLs. Each canned ACL has a +// predefined set of grantees and permissions. For more information, see +// Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). +// +// * Specify access permissions explicitly using the x-amz-grant-read, x-amz-grant-write, +// x-amz-grant-read-acp, x-amz-grant-write-acp, and x-amz-grant-full-control +// headers. These headers map to the set of permissions Amazon S3 supports +// in an ACL. For more information, see Access Control List (ACL) Overview +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html). You +// specify each grantee as a type=value pair, where the type is one of the +// following: emailAddress – if the value specified is the email address +// of an AWS account id – if the value specified is the canonical user +// ID of an AWS account uri – if you are granting permissions to a predefined +// group For example, the following x-amz-grant-read header grants the AWS +// accounts identified by email addresses permissions to read object data +// and its metadata: x-amz-grant-read: emailAddress="xyz@amazon.com", emailAddress="abc@amazon.com" +// +// You can use either a canned ACL or specify access permissions explicitly. +// You cannot do both. +// +// The following operations are related to CreateBucket: +// +// * PutObject +// +// * DeleteBucket // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -318,6 +637,11 @@ func (c *S3) CreateBucketRequest(input *CreateBucketInput) (req *request.Request // by all users of the system. Please select a different name and try again. // // * ErrCodeBucketAlreadyOwnedByYou "BucketAlreadyOwnedByYou" +// The bucket you tried to create already exists, and you own it. Amazon S3 +// returns this error in all AWS Regions except in the North Virginia Region. +// For legacy compatibility, if you re-create an existing bucket that you already +// own in the North Virginia Region, Amazon S3 returns 200 OK and resets the +// bucket access control lists (ACLs). // // See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucket func (c *S3) CreateBucket(input *CreateBucketInput) (*CreateBucketOutput, error) { @@ -385,13 +709,147 @@ func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (re // CreateMultipartUpload API operation for Amazon Simple Storage Service. // -// Initiates a multipart upload and returns an upload ID. +// This operation initiates a multipart upload and returns an upload ID. This +// upload ID is used to associate all of the parts in the specific multipart +// upload. You specify this upload ID in each of your subsequent upload part +// requests (see UploadPart). You also include this upload ID in the final request +// to either complete or abort the multipart upload request. // -// Note: After you initiate multipart upload and upload one or more parts, you -// must either complete or abort multipart upload in order to stop getting charged -// for storage of the uploaded parts. Only after you either complete or abort -// multipart upload, Amazon S3 frees up the parts storage and stops charging -// you for the parts storage. +// For more information about multipart uploads, see Multipart Upload Overview +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html). +// +// If you have configured a lifecycle rule to abort incomplete multipart uploads, +// the upload must complete within the number of days specified in the bucket +// lifecycle configuration. Otherwise, the incomplete multipart upload becomes +// eligible for an abort operation and Amazon S3 aborts the multipart upload. +// For more information, see Aborting Incomplete Multipart Uploads Using a Bucket +// Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config). +// +// For information about the permissions required to use the multipart upload +// API, see Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). +// +// For request signing, multipart upload is just a series of regular requests. +// You initiate a multipart upload, send one or more requests to upload parts, +// and then complete the multipart upload process. You sign each request individually. +// There is nothing special about signing multipart upload requests. For more +// information about signing, see Authenticating Requests (AWS Signature Version +// 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html). +// +// After you initiate a multipart upload and upload one or more parts, to stop +// being charged for storing the uploaded parts, you must either complete or +// abort the multipart upload. Amazon S3 frees up the space used to store the +// parts and stop charging you for storing them only after you either complete +// or abort a multipart upload. +// +// You can optionally request server-side encryption. For server-side encryption, +// Amazon S3 encrypts your data as it writes it to disks in its data centers +// and decrypts it when you access it. You can provide your own encryption key, +// or use AWS Key Management Service (AWS KMS) customer master keys (CMKs) or +// Amazon S3-managed encryption keys. If you choose to provide your own encryption +// key, the request headers you provide in UploadPart) and UploadPartCopy) requests +// must match the headers you used in the request to initiate the upload by +// using CreateMultipartUpload. +// +// To perform a multipart upload with encryption using an AWS KMS CMK, the requester +// must have permission to the kms:Encrypt, kms:Decrypt, kms:ReEncrypt*, kms:GenerateDataKey*, +// and kms:DescribeKey actions on the key. These permissions are required because +// Amazon S3 must decrypt and read data from the encrypted file parts before +// it completes the multipart upload. +// +// If your AWS Identity and Access Management (IAM) user or role is in the same +// AWS account as the AWS KMS CMK, then you must have these permissions on the +// key policy. If your IAM user or role belongs to a different account than +// the key, then you must have the permissions on both the key policy and your +// IAM user or role. +// +// For more information, see Protecting Data Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html). +// +// Access Permissions +// +// When copying an object, you can optionally specify the accounts or groups +// that should be granted specific permissions on the new object. There are +// two ways to grant the permissions using the request headers: +// +// * Specify a canned ACL with the x-amz-acl request header. For more information, +// see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). +// +// * Specify access permissions explicitly with the x-amz-grant-read, x-amz-grant-read-acp, +// x-amz-grant-write-acp, and x-amz-grant-full-control headers. These parameters +// map to the set of permissions that Amazon S3 supports in an ACL. For more +// information, see Access Control List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html). +// +// You can use either a canned ACL or specify access permissions explicitly. +// You cannot do both. +// +// Server-Side- Encryption-Specific Request Headers +// +// You can optionally tell Amazon S3 to encrypt data at rest using server-side +// encryption. Server-side encryption is for data encryption at rest. Amazon +// S3 encrypts your data as it writes it to disks in its data centers and decrypts +// it when you access it. The option you use depends on whether you want to +// use AWS managed encryption keys or provide your own encryption key. +// +// * Use encryption keys managed by Amazon S3 or customer master keys (CMKs) +// stored in AWS Key Management Service (AWS KMS) – If you want AWS to +// manage the keys used to encrypt data, specify the following headers in +// the request. x-amz-server-side​-encryption x-amz-server-side-encryption-aws-kms-key-id +// x-amz-server-side-encryption-context If you specify x-amz-server-side-encryption:aws:kms, +// but don't provide x-amz-server-side-encryption-aws-kms-key-id, Amazon +// S3 uses the AWS managed CMK in AWS KMS to protect the data. All GET and +// PUT requests for an object protected by AWS KMS fail if you don't make +// them with SSL or by using SigV4. For more information about server-side +// encryption with CMKs stored in AWS KMS (SSE-KMS), see Protecting Data +// Using Server-Side Encryption with CMKs stored in AWS KMS (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). +// +// * Use customer-provided encryption keys – If you want to manage your +// own encryption keys, provide all the following headers in the request. +// x-amz-server-side​-encryption​-customer-algorithm x-amz-server-side​-encryption​-customer-key +// x-amz-server-side​-encryption​-customer-key-MD5 For more information +// about server-side encryption with CMKs stored in AWS KMS (SSE-KMS), see +// Protecting Data Using Server-Side Encryption with CMKs stored in AWS KMS +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). +// +// Access-Control-List (ACL)-Specific Request Headers +// +// You also can use the following access control–related headers with this +// operation. By default, all objects are private. Only the owner has full access +// control. When adding a new object, you can grant permissions to individual +// AWS accounts or to predefined groups defined by Amazon S3. These permissions +// are then added to the access control list (ACL) on the object. For more information, +// see Using ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html). +// With this operation, you can grant access permissions using one of the following +// two methods: +// +// * Specify a canned ACL (x-amz-acl) — Amazon S3 supports a set of predefined +// ACLs, known as canned ACLs. Each canned ACL has a predefined set of grantees +// and permissions. For more information, see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). +// +// * Specify access permissions explicitly — To explicitly grant access +// permissions to specific AWS accounts or groups, use the following headers. +// Each header maps to specific permissions that Amazon S3 supports in an +// ACL. For more information, see Access Control List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html). +// In the header, you specify a list of grantees who get the specific permission. +// To grant permissions explicitly, use: x-amz-grant-read x-amz-grant-write +// x-amz-grant-read-acp x-amz-grant-write-acp x-amz-grant-full-control You +// specify each grantee as a type=value pair, where the type is one of the +// following: emailAddress – if the value specified is the email address +// of an AWS account id – if the value specified is the canonical user +// ID of an AWS account uri – if you are granting permissions to a predefined +// group For example, the following x-amz-grant-read header grants the AWS +// accounts identified by email addresses permissions to read object data +// and its metadata: x-amz-grant-read: emailAddress="xyz@amazon.com", emailAddress="abc@amazon.com" +// +// The following operations are related to CreateMultipartUpload: +// +// * UploadPart +// +// * CompleteMultipartUpload +// +// * AbortMultipartUpload +// +// * ListParts +// +// * ListMultipartUploads // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -466,8 +924,14 @@ func (c *S3) DeleteBucketRequest(input *DeleteBucketInput) (req *request.Request // DeleteBucket API operation for Amazon Simple Storage Service. // -// Deletes the bucket. All objects (including all object versions and Delete -// Markers) in the bucket must be deleted before the bucket itself can be deleted. +// Deletes the bucket. All objects (including all object versions and delete +// markers) in the bucket must be deleted before the bucket itself can be deleted. +// +// Related 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 @@ -547,7 +1011,20 @@ func (c *S3) DeleteBucketAnalyticsConfigurationRequest(input *DeleteBucketAnalyt // // To use this operation, you must have permissions to perform the s3:PutAnalyticsConfiguration // action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev//using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// For information about the Amazon S3 analytics feature, see Amazon S3 Analytics +// – Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html). +// +// The following operations are related to DeleteBucketAnalyticsConfiguration: +// +// * +// +// * +// +// * // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -622,7 +1099,20 @@ func (c *S3) DeleteBucketCorsRequest(input *DeleteBucketCorsInput) (req *request // DeleteBucketCors API operation for Amazon Simple Storage Service. // -// Deletes the CORS configuration information set for the bucket. +// Deletes the cors configuration information set for the bucket. +// +// To use this operation, you must have permission to perform the s3:PutBucketCORS +// action. The bucket owner has this permission by default and can grant this +// permission to others. +// +// For information about cors, see Enabling Cross-Origin Resource Sharing (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// Related Resources: +// +// * +// +// * RESTOPTIONSobject // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -697,7 +1187,23 @@ func (c *S3) DeleteBucketEncryptionRequest(input *DeleteBucketEncryptionInput) ( // DeleteBucketEncryption API operation for Amazon Simple Storage Service. // -// Deletes the server-side encryption configuration from the bucket. +// This implementation of the DELETE operation removes default encryption from +// the bucket. For information about the Amazon S3 default encryption feature, +// see Amazon S3 Default Bucket Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev//bucket-encryption.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// To use this operation, you must have permissions to perform the s3:PutEncryptionConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev//using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev//s3-access-control.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// Related Resources +// +// * PutBucketEncryption +// +// * GetBucketEncryption // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -775,6 +1281,23 @@ func (c *S3) DeleteBucketInventoryConfigurationRequest(input *DeleteBucketInvent // Deletes an inventory configuration (identified by the inventory ID) from // the bucket. // +// To use this operation, you must have permissions to perform the s3:PutInventoryConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// For information about the Amazon S3 inventory feature, see Amazon S3 Inventory +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html). +// +// Operations related to DeleteBucketInventoryConfiguration include: +// +// * GetBucketInventoryConfiguration +// +// * PutBucketInventoryConfiguration +// +// * ListBucketInventoryConfigurations +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -848,7 +1371,27 @@ func (c *S3) DeleteBucketLifecycleRequest(input *DeleteBucketLifecycleInput) (re // DeleteBucketLifecycle API operation for Amazon Simple Storage Service. // -// Deletes the lifecycle configuration from the bucket. +// Deletes the lifecycle configuration from the specified bucket. Amazon S3 +// removes all the lifecycle configuration rules in the lifecycle subresource +// associated with the bucket. Your objects never expire, and Amazon S3 no longer +// automatically deletes any objects on the basis of rules contained in the +// deleted lifecycle configuration. +// +// To use this operation, you must have permission to perform the s3:PutLifecycleConfiguration +// action. By default, the bucket owner has this permission and the bucket owner +// can grant this permission to others. +// +// There is usually some time lag before lifecycle configuration deletion is +// fully propagated to all the Amazon S3 systems. +// +// For more information about the object expiration, see Elements to Describe +// Lifecycle Actions (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#intro-lifecycle-rules-actions). +// +// Related actions include: +// +// * PutBucketLifecycleConfiguration +// +// * GetBucketLifecycleConfiguration // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -923,8 +1466,28 @@ func (c *S3) DeleteBucketMetricsConfigurationRequest(input *DeleteBucketMetricsC // DeleteBucketMetricsConfiguration API operation for Amazon Simple Storage Service. // -// Deletes a metrics configuration (specified by the metrics configuration ID) -// from the bucket. +// Deletes a metrics configuration for the Amazon CloudWatch request metrics +// (specified by the metrics configuration ID) from the bucket. Note that this +// doesn't include the daily storage metrics. +// +// To use this operation, you must have permissions to perform the s3:PutMetricsConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// For information about CloudWatch request metrics for Amazon S3, see Monitoring +// Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html). +// +// The following operations are related to DeleteBucketMetricsConfiguration: +// +// * GetBucketMetricsConfiguration +// +// * PutBucketMetricsConfiguration +// +// * ListBucketMetricsConfigurations +// +// * Monitoring Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.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 @@ -999,7 +1562,29 @@ func (c *S3) DeleteBucketPolicyRequest(input *DeleteBucketPolicyInput) (req *req // DeleteBucketPolicy API operation for Amazon Simple Storage Service. // -// Deletes the policy from the bucket. +// This implementation of the DELETE operation uses the policy subresource to +// delete the policy of a specified bucket. If you are using an identity other +// than the root user of the AWS account that owns the bucket, the calling identity +// must have the DeleteBucketPolicy permissions on the specified bucket and +// belong to the bucket owner's account to use this operation. +// +// If you don't have DeleteBucketPolicy permissions, Amazon S3 returns a 403 +// Access Denied error. If you have the correct permissions, but you're not +// using an identity that belongs to the bucket owner's account, Amazon S3 returns +// a 405 Method Not Allowed error. +// +// As a security precaution, the root user of the AWS account that owns a bucket +// can always use this operation, even if the policy explicitly denies the root +// user the ability to perform this action. +// +// For more information about bucket policies, see Using Bucket Policies and +// UserPolicies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html). +// +// The following operations are related to DeleteBucketPolicy +// +// * CreateBucket +// +// * DeleteObject // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1074,10 +1659,26 @@ func (c *S3) DeleteBucketReplicationRequest(input *DeleteBucketReplicationInput) // DeleteBucketReplication API operation for Amazon Simple Storage Service. // -// Deletes the replication configuration from the bucket. For information about -// replication configuration, see Cross-Region Replication (CRR) (https://docs.aws.amazon.com/AmazonS3/latest/dev/crr.html) +// Deletes the replication configuration from the bucket. +// +// To use this operation, you must have permissions to perform the s3:PutReplicationConfiguration +// action. The bucket owner has these permissions by default and can grant it +// to others. For more information about permissions, see Permissions Related +// to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// It can take a while for the deletion of a replication configuration to fully +// propagate. +// +// For information about replication configuration, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) // in the Amazon S3 Developer Guide. // +// The following operations are related to DeleteBucketReplication: +// +// * PutBucketReplication +// +// * GetBucketReplication +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1153,6 +1754,16 @@ func (c *S3) DeleteBucketTaggingRequest(input *DeleteBucketTaggingInput) (req *r // // Deletes the tags from the bucket. // +// To use this operation, you must have permission to perform the s3:PutBucketTagging +// action. By default, the bucket owner has this permission and can grant this +// permission to others. +// +// The following operations are related to DeleteBucketTagging: +// +// * GetBucketTagging +// +// * PutBucketTagging +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1226,7 +1837,26 @@ func (c *S3) DeleteBucketWebsiteRequest(input *DeleteBucketWebsiteInput) (req *r // DeleteBucketWebsite API operation for Amazon Simple Storage Service. // -// This operation removes the website configuration from the bucket. +// This operation removes the website configuration for a bucket. Amazon S3 +// returns a 200 OK response upon successfully deleting a website configuration +// on the specified bucket. You will get a 200 OK response if the website configuration +// you are trying to delete does not exist on the bucket. Amazon S3 returns +// a 404 response if the bucket specified in the request does not exist. +// +// This DELETE operation requires the S3:DeleteBucketWebsite permission. By +// default, only the bucket owner can delete the website configuration attached +// to a bucket. However, bucket owners can grant other users permission to delete +// the website configuration by writing a bucket policy granting them the S3:DeleteBucketWebsite +// permission. +// +// For more information about hosting websites, see Hosting Websites on Amazon +// S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html). +// +// The following operations are related to DeleteBucketWebsite: +// +// * GetBucketWebsite +// +// * PutBucketWebsite // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1304,6 +1934,29 @@ func (c *S3) DeleteObjectRequest(input *DeleteObjectInput) (req *request.Request // marker, which becomes the latest version of the object. If there isn't a // null version, Amazon S3 does not remove any objects. // +// To remove a specific version, you must be the bucket owner and you must use +// the version Id subresource. Using this subresource permanently deletes the +// version. If the object deleted is a delete marker, Amazon S3 sets the response +// header, x-amz-delete-marker, to true. +// +// If the object you want to delete is in a bucket where the bucket versioning +// configuration is MFA Delete enabled, you must include the x-amz-mfa request +// header in the DELETE versionId request. Requests that include x-amz-mfa must +// use HTTPS. +// +// For more information about MFA Delete, see Using MFA Delete (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMFADelete.html). +// To see sample requests that use versioning, see Sample Request (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html#ExampleVersionObjectDelete). +// +// You can delete objects by explicitly calling the DELETE Object API or configure +// its lifecycle (PutBucketLifecycle) to enable Amazon S3 to remove them for +// you. If you want to block users or accounts from removing or deleting objects +// from your bucket, you must deny them the s3:DeleteObject, s3:DeleteObjectVersion, +// and s3:PutLifeCycleConfiguration actions. +// +// The following operation is related to DeleteObject: +// +// * PutObject +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1376,7 +2029,21 @@ func (c *S3) DeleteObjectTaggingRequest(input *DeleteObjectTaggingInput) (req *r // DeleteObjectTagging API operation for Amazon Simple Storage Service. // -// Removes the tag-set from an existing object. +// Removes the entire tag set from the specified object. For more information +// about managing object tags, see Object Tagging (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html). +// +// To use this operation, you must have permission to perform the s3:DeleteObjectTagging +// action. +// +// To delete tags of a specific object version, add the versionId query parameter +// in the request. You will need permission for the s3:DeleteObjectVersionTagging +// action. +// +// The following operations are related to DeleteBucketMetricsConfiguration: +// +// * PutObjectTagging +// +// * GetObjectTagging // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1451,7 +2118,47 @@ func (c *S3) DeleteObjectsRequest(input *DeleteObjectsInput) (req *request.Reque // DeleteObjects API operation for Amazon Simple Storage Service. // // This operation enables you to delete multiple objects from a bucket using -// a single HTTP request. You may specify up to 1000 keys. +// a single HTTP request. If you know the object keys that you want to delete, +// then this operation provides a suitable alternative to sending individual +// delete requests, reducing per-request overhead. +// +// The request contains a list of up to 1000 keys that you want to delete. In +// the XML, you provide the object key names, and optionally, version IDs if +// you want to delete a specific version of the object from a versioning-enabled +// bucket. For each key, Amazon S3 performs a delete operation and returns the +// result of that delete, success, or failure, in the response. Note that if +// the object specified in the request is not found, Amazon S3 returns the result +// as deleted. +// +// The operation supports two modes for the response: verbose and quiet. By +// default, the operation uses verbose mode in which the response includes the +// result of deletion of each key in your request. In quiet mode the response +// includes only keys where the delete operation encountered an error. For a +// successful deletion, the operation does not return any information about +// the delete in the response body. +// +// When performing this operation on an MFA Delete enabled bucket, that attempts +// to delete any versioned objects, you must include an MFA token. If you do +// not provide one, the entire request will fail, even if there are non-versioned +// objects you are trying to delete. If you provide an invalid token, whether +// there are versioned keys in the request or not, the entire Multi-Object Delete +// request will fail. For information about MFA Delete, see MFA Delete (https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete). +// +// Finally, the Content-MD5 header is required for all Multi-Object Delete requests. +// Amazon S3 uses the header value to ensure that your request body has not +// been altered in transit. +// +// The following operations are related to DeleteObjects: +// +// * CreateMultipartUpload +// +// * UploadPart +// +// * CompleteMultipartUpload +// +// * ListParts +// +// * AbortMultipartUpload // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1526,7 +2233,21 @@ func (c *S3) DeletePublicAccessBlockRequest(input *DeletePublicAccessBlockInput) // DeletePublicAccessBlock API operation for Amazon Simple Storage Service. // -// Removes the PublicAccessBlock configuration from an Amazon S3 bucket. +// Removes the PublicAccessBlock configuration for an Amazon S3 bucket. To use +// this operation, you must have the s3:PutBucketPublicAccessBlock permission. +// For more information about permissions, see Permissions Related to Bucket +// Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// The following operations are related to DeleteBucketMetricsConfiguration: +// +// * Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) +// +// * GetPublicAccessBlock +// +// * PutPublicAccessBlock +// +// * GetBucketPolicyStatus // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1600,7 +2321,32 @@ func (c *S3) GetBucketAccelerateConfigurationRequest(input *GetBucketAccelerateC // GetBucketAccelerateConfiguration API operation for Amazon Simple Storage Service. // -// Returns the accelerate configuration of a bucket. +// This implementation of the GET operation uses the accelerate subresource +// to return the Transfer Acceleration state of a bucket, which is either Enabled +// or Suspended. Amazon S3 Transfer Acceleration is a bucket-level feature that +// enables you to perform faster data transfers to and from Amazon S3. +// +// To use this operation, you must have permission to perform the s3:GetAccelerateConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev//using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev//s3-access-control.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// You set the Transfer Acceleration state of an existing bucket to Enabled +// or Suspended by using the PutBucketAccelerateConfiguration operation. +// +// A GET accelerate request does not return a state value for a bucket that +// has no transfer acceleration state. A bucket has no Transfer Acceleration +// state if a state has never been set on the bucket. +// +// For more information about transfer acceleration, see Transfer Acceleration +// (https://docs.aws.amazon.com/AmazonS3/latest/dev//transfer-acceleration.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// Related Resources +// +// * PutBucketAccelerateConfiguration // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1674,7 +2420,15 @@ func (c *S3) GetBucketAclRequest(input *GetBucketAclInput) (req *request.Request // GetBucketAcl API operation for Amazon Simple Storage Service. // -// Gets the access control policy for the bucket. +// This implementation of the GET operation uses the acl subresource to return +// the access control list (ACL) of a bucket. To use GET to return the ACL of +// the bucket, you must have READ_ACP access to the bucket. If READ_ACP permission +// is granted to the anonymous user, you can return the ACL of the bucket without +// using an authorization header. +// +// Related 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 @@ -1748,8 +2502,27 @@ func (c *S3) GetBucketAnalyticsConfigurationRequest(input *GetBucketAnalyticsCon // GetBucketAnalyticsConfiguration API operation for Amazon Simple Storage Service. // -// Gets an analytics configuration for the bucket (specified by the analytics -// configuration ID). +// This implementation of the GET operation returns an analytics configuration +// (identified by the analytics configuration ID) from the bucket. +// +// To use this operation, you must have permissions to perform the s3:GetAnalyticsConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// For information about Amazon S3 analytics feature, see Amazon S3 Analytics +// – Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// Related 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 @@ -1823,7 +2596,20 @@ func (c *S3) GetBucketCorsRequest(input *GetBucketCorsInput) (req *request.Reque // GetBucketCors API operation for Amazon Simple Storage Service. // -// Returns the CORS configuration for the bucket. +// Returns the cors configuration information set for the bucket. +// +// To use this operation, you must have permission to perform the s3:GetBucketCORS +// action. By default, the bucket owner has this permission and can grant it +// to others. +// +// For more information about cors, see Enabling Cross-Origin Resource Sharing +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html). +// +// The following operations are related to GetBucketCors: +// +// * PutBucketCors +// +// * DeleteBucketCors // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1897,7 +2683,21 @@ func (c *S3) GetBucketEncryptionRequest(input *GetBucketEncryptionInput) (req *r // GetBucketEncryption API operation for Amazon Simple Storage Service. // -// Returns the server-side encryption configuration of a bucket. +// Returns the default encryption configuration for an Amazon S3 bucket. For +// information about the Amazon S3 default encryption feature, see Amazon S3 +// Default Bucket Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html). +// +// To use this operation, you must have permission to perform the s3:GetEncryptionConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// The following operations are related to GetBucketEncryption: +// +// * PutBucketEncryption +// +// * DeleteBucketEncryption // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1971,8 +2771,25 @@ func (c *S3) GetBucketInventoryConfigurationRequest(input *GetBucketInventoryCon // GetBucketInventoryConfiguration API operation for Amazon Simple Storage Service. // -// Returns an inventory configuration (identified by the inventory ID) from -// the bucket. +// Returns an inventory configuration (identified by the inventory configuration +// ID) from the bucket. +// +// To use this operation, you must have permissions to perform the s3:GetInventoryConfiguration +// action. The bucket owner has this permission by default and can grant this +// permission to others. For more information about permissions, see Permissions +// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// For information about the Amazon S3 inventory feature, see Amazon S3 Inventory +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html). +// +// The following operations are related to GetBucketInventoryConfiguration: +// +// * DeleteBucketInventoryConfiguration +// +// * ListBucketInventoryConfigurations +// +// * PutBucketInventoryConfiguration // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2051,7 +2868,34 @@ func (c *S3) GetBucketLifecycleRequest(input *GetBucketLifecycleInput) (req *req // GetBucketLifecycle API operation for Amazon Simple Storage Service. // -// No longer used, see the GetBucketLifecycleConfiguration operation. +// +// For an updated version of this API, see GetBucketLifecycleConfiguration. +// If you configured a bucket lifecycle using the filter element, you should +// see the updated version of this topic. This topic is provided for backward +// compatibility. +// +// Returns the lifecycle configuration information set on the bucket. For information +// about lifecycle configuration, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html). +// +// To use this operation, you must have permission to perform the s3:GetLifecycleConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// GetBucketLifecycle has the following special error: +// +// * Error code: NoSuchLifecycleConfiguration Description: The lifecycle +// configuration does not exist. HTTP Status Code: 404 Not Found SOAP Fault +// Code Prefix: Client +// +// The following operations are related to GetBucketLifecycle: +// +// * GetBucketLifecycleConfiguration +// +// * PutBucketLifecycle +// +// * DeleteBucketLifecycle // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2129,7 +2973,37 @@ func (c *S3) GetBucketLifecycleConfigurationRequest(input *GetBucketLifecycleCon // GetBucketLifecycleConfiguration API operation for Amazon Simple Storage Service. // -// Returns the lifecycle configuration information set on the bucket. +// +// Bucket lifecycle configuration now supports specifying a lifecycle rule using +// an object key name prefix, one or more object tags, or a combination of both. +// Accordingly, this section describes the latest API. The response describes +// the new filter element that you can use to specify a filter to select a subset +// of objects to which the rule applies. If you are still using previous version +// of the lifecycle configuration, it works. For the earlier API description, +// see GetBucketLifecycle. +// +// Returns the lifecycle configuration information set on the bucket. For information +// about lifecycle configuration, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html). +// +// To use this operation, you must have permission to perform the s3:GetLifecycleConfiguration +// action. The bucket owner has this permission, by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// GetBucketLifecycleConfiguration has the following special error: +// +// * Error code: NoSuchLifecycleConfiguration Description: The lifecycle +// configuration does not exist. HTTP Status Code: 404 Not Found SOAP Fault +// Code Prefix: Client +// +// The following operations are related to DeleteBucketMetricsConfiguration: +// +// * GetBucketLifecycle +// +// * PutBucketLifecycle +// +// * DeleteBucketLifecycle // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2203,7 +3077,17 @@ func (c *S3) GetBucketLocationRequest(input *GetBucketLocationInput) (req *reque // GetBucketLocation API operation for Amazon Simple Storage Service. // -// Returns the region the bucket resides in. +// Returns the Region the bucket resides in. You set the bucket's Region using +// the LocationConstraint request parameter in a CreateBucket request. For more +// information, see CreateBucket. +// +// To use this implementation of the operation, you must be the bucket owner. +// +// The following operations are related to GetBucketLocation: +// +// * GetObject +// +// * CreateBucket // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2280,6 +3164,12 @@ func (c *S3) GetBucketLoggingRequest(input *GetBucketLoggingInput) (req *request // Returns the logging status of a bucket and the permissions users have to // view and modify that status. To use GET, you must be the bucket owner. // +// The following operations are related to GetBucketLogging: +// +// * CreateBucket +// +// * PutBucketLogging +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2353,7 +3243,26 @@ func (c *S3) GetBucketMetricsConfigurationRequest(input *GetBucketMetricsConfigu // GetBucketMetricsConfiguration API operation for Amazon Simple Storage Service. // // Gets a metrics configuration (specified by the metrics configuration ID) -// from the bucket. +// from the bucket. Note that this doesn't include the daily storage metrics. +// +// To use this operation, you must have permissions to perform the s3:GetMetricsConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// For information about CloudWatch request metrics for Amazon S3, see Monitoring +// Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html). +// +// The following operations are related to GetBucketMetricsConfiguration: +// +// * PutBucketMetricsConfiguration +// +// * DeleteBucketMetricsConfiguration +// +// * ListBucketMetricsConfigurations +// +// * Monitoring Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.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 @@ -2432,7 +3341,7 @@ func (c *S3) GetBucketNotificationRequest(input *GetBucketNotificationConfigurat // GetBucketNotification API operation for Amazon Simple Storage Service. // -// No longer used, see the GetBucketNotificationConfiguration operation. +// No longer used, see GetBucketNotificationConfiguration. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2512,6 +3421,22 @@ func (c *S3) GetBucketNotificationConfigurationRequest(input *GetBucketNotificat // // Returns the notification configuration of a bucket. // +// If notifications are not enabled on the bucket, the operation returns an +// empty NotificationConfiguration element. +// +// By default, you must be the bucket owner to read the notification configuration +// of a bucket. However, the bucket owner can use a bucket policy to grant permission +// to other users to read this configuration with the s3:GetBucketNotification +// permission. +// +// For more information about setting and reading the notification configuration +// on a bucket, see Setting Up Notification of Bucket Events (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html). +// For more information about bucket policies, see Using Bucket Policies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html). +// +// The following operation is related to GetBucketNotification: +// +// * PutBucketNotification +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2584,7 +3509,26 @@ func (c *S3) GetBucketPolicyRequest(input *GetBucketPolicyInput) (req *request.R // GetBucketPolicy API operation for Amazon Simple Storage Service. // -// Returns the policy of a specified bucket. +// Returns the policy of a specified bucket. If you are using an identity other +// than the root user of the AWS account that owns the bucket, the calling identity +// must have the GetBucketPolicy permissions on the specified bucket and belong +// to the bucket owner's account in order to use this operation. +// +// If you don't have GetBucketPolicy permissions, Amazon S3 returns a 403 Access +// Denied error. If you have the correct permissions, but you're not using an +// identity that belongs to the bucket owner's account, Amazon S3 returns a +// 405 Method Not Allowed error. +// +// As a security precaution, the root user of the AWS account that owns a bucket +// can always use this operation, even if the policy explicitly denies the root +// user the ability to perform this action. +// +// For more information about bucket policies, see Using Bucket Policies and +// User Policies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html). +// +// The following operation is related to GetBucketPolicy: +// +// * GetObject // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2659,7 +3603,22 @@ func (c *S3) GetBucketPolicyStatusRequest(input *GetBucketPolicyStatusInput) (re // GetBucketPolicyStatus API operation for Amazon Simple Storage Service. // // Retrieves the policy status for an Amazon S3 bucket, indicating whether the -// bucket is public. +// bucket is public. In order to use this operation, you must have the s3:GetBucketPolicyStatus +// permission. For more information about Amazon S3 permissions, see Specifying +// Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html). +// +// For more information about when Amazon S3 considers a bucket public, see +// The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status). +// +// The following operations are related to GetBucketPolicyStatus: +// +// * Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) +// +// * GetPublicAccessBlock +// +// * PutPublicAccessBlock +// +// * DeletePublicAccessBlock // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2739,6 +3698,25 @@ func (c *S3) GetBucketReplicationRequest(input *GetBucketReplicationInput) (req // to all Amazon S3 systems. Therefore, a get request soon after put or delete // can return a wrong result. // +// For information about replication configuration, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// This operation requires permissions for the s3:GetReplicationConfiguration +// action. For more information about permissions, see Using Bucket Policies +// and User Policies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html). +// +// If you include the Filter element in a replication configuration, you must +// also include the DeleteMarkerReplication and Priority elements. The response +// also returns those elements. +// +// For information about GetBucketReplication errors, see ReplicationErrorCodeList +// +// The following operations are related to GetBucketReplication: +// +// * PutBucketReplication +// +// * DeleteBucketReplication +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2811,7 +3789,13 @@ func (c *S3) GetBucketRequestPaymentRequest(input *GetBucketRequestPaymentInput) // GetBucketRequestPayment API operation for Amazon Simple Storage Service. // -// Returns the request payment configuration of a bucket. +// Returns the request payment configuration of a bucket. To use this version +// of the operation, you must be the bucket owner. For more information, see +// Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html). +// +// The following operations are related to GetBucketRequestPayment: +// +// * ListObjects // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2887,6 +3871,21 @@ func (c *S3) GetBucketTaggingRequest(input *GetBucketTaggingInput) (req *request // // Returns the tag set associated with the bucket. // +// To use this operation, you must have permission to perform the s3:GetBucketTagging +// action. By default, the bucket owner has this permission and can grant this +// permission to others. +// +// GetBucketTagging has the following special error: +// +// * Error code: NoSuchTagSetError Description: There is no tag set associated +// with the bucket. +// +// The following operations are related to GetBucketTagging: +// +// * PutBucketTagging +// +// * DeleteBucketTagging +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -2961,6 +3960,20 @@ func (c *S3) GetBucketVersioningRequest(input *GetBucketVersioningInput) (req *r // // Returns the versioning state of a bucket. // +// To retrieve the versioning state of a bucket, you must be the bucket owner. +// +// This implementation also returns the MFA Delete status of the versioning +// state. If the MFA Delete status is enabled, the bucket owner must use an +// authentication device to change the versioning state of the bucket. +// +// The following operations are related to GetBucketVersioning: +// +// * GetObject +// +// * PutObject +// +// * DeleteObject +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -3033,7 +4046,21 @@ func (c *S3) GetBucketWebsiteRequest(input *GetBucketWebsiteInput) (req *request // GetBucketWebsite API operation for Amazon Simple Storage Service. // -// Returns the website configuration for a bucket. +// Returns the website configuration for a bucket. To host website on Amazon +// S3, you can configure a bucket as website by adding a website configuration. +// For more information about hosting websites, see Hosting Websites on Amazon +// S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html). +// +// This GET operation requires the S3:GetBucketWebsite permission. By default, +// only the bucket owner can read the bucket website configuration. However, +// bucket owners can allow other users to read the website configuration by +// writing a bucket policy granting them the S3:GetBucketWebsite permission. +// +// The following operations are related to DeleteBucketWebsite: +// +// * DeleteBucketWebsite +// +// * PutBucketWebsite // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3107,33 +4134,156 @@ func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, outp // GetObject API operation for Amazon Simple Storage Service. // -// Retrieves objects from Amazon S3. +// Retrieves objects from Amazon S3. To use GET, you must have READ access to +// the object. If you grant READ access to the anonymous user, you can return +// the object without using an authorization header. // -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. +// An Amazon S3 bucket has no directory hierarchy such as you would find in +// a typical computer file system. You can, however, create a logical hierarchy +// by using object key names that imply a folder structure. For example, instead +// of naming an object sample.jpg, you can name it photos/2006/February/sample.jpg. // -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetObject for usage and error information. +// To get an object from such a logical hierarchy, specify the full key name +// for the object in the GET operation. For a virtual hosted-style request example, +// if you have the object photos/2006/February/sample.jpg, specify the resource +// as /photos/2006/February/sample.jpg. For a path-style request example, if +// you have the object photos/2006/February/sample.jpg in the bucket named examplebucket, +// specify the resource as /examplebucket/photos/2006/February/sample.jpg. For +// more information about request types, see HTTP Host Header Bucket Specification +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingSpecifyBucket). // -// Returned Error Codes: -// * ErrCodeNoSuchKey "NoSuchKey" -// The specified key does not exist. +// To distribute large files to many people, you can save bandwidth costs by +// using BitTorrent. For more information, see Amazon S3 Torrent (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3Torrent.html). +// For more information about returning the ACL of an object, see GetObjectAcl. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObject -func (c *S3) GetObject(input *GetObjectInput) (*GetObjectOutput, error) { - req, out := c.GetObjectRequest(input) - return out, req.Send() -} - -// GetObjectWithContext is the same as GetObject with the addition of -// the ability to pass a context and additional request options. +// If the object you are retrieving is stored in the GLACIER or DEEP_ARCHIVE +// storage classes, before you can retrieve the object you must first restore +// a copy using . Otherwise, this operation returns an InvalidObjectStateError +// error. For information about restoring archived objects, see Restoring Archived +// Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html). // -// See GetObject for details on how to use this API operation. +// Encryption request headers, like x-amz-server-side-encryption, should not +// be sent for GET requests if your object uses server-side encryption with +// CMKs stored in AWS KMS (SSE-KMS) or server-side encryption with Amazon S3–managed +// encryption keys (SSE-S3). If your object does use these types of keys, you’ll +// get an HTTP 400 BadRequest error. // -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// If you encrypt an object by using server-side encryption with customer-provided +// encryption keys (SSE-C) when you store the object in Amazon S3, then when +// you GET the object, you must use the following headers: +// +// * x-amz-server-side​-encryption​-customer-algorithm +// +// * x-amz-server-side​-encryption​-customer-key +// +// * x-amz-server-side​-encryption​-customer-key-MD5 +// +// For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided +// Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html). +// +// Assuming you have permission to read object tags (permission for the s3:GetObjectVersionTagging +// action), the response also returns the x-amz-tagging-count header that provides +// the count of number of tags associated with the object. You can use GetObjectTagging +// to retrieve the tag set associated with an object. +// +// Permissions +// +// You need the s3:GetObject permission for this operation. For more information, +// see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html). +// If the object you request does not exist, the error Amazon S3 returns depends +// on whether you also have the s3:ListBucket permission. +// +// * If you have the s3:ListBucket permission on the bucket, Amazon S3 will +// return an HTTP status code 404 ("no such key") error. +// +// * If you don’t have the s3:ListBucket permission, Amazon S3 will return +// an HTTP status code 403 ("access denied") error. +// +// Versioning +// +// By default, the GET operation returns the current version of an object. To +// return a different version, use the versionId subresource. +// +// If the current version of the object is a delete marker, Amazon S3 behaves +// as if the object was deleted and includes x-amz-delete-marker: true in the +// response. +// +// For more information about versioning, see PutBucketVersioning. +// +// Overriding Response Header Values +// +// There are times when you want to override certain response header values +// in a GET response. For example, you might override the Content-Disposition +// response header value in your GET request. +// +// You can override values for a set of response headers using the following +// query parameters. These response header values are sent only on a successful +// request, that is, when status code 200 OK is returned. The set of headers +// you can override using these parameters is a subset of the headers that Amazon +// S3 accepts when you create an object. The response headers that you can override +// for the GET response are Content-Type, Content-Language, Expires, Cache-Control, +// Content-Disposition, and Content-Encoding. To override these header values +// in the GET response, you use the following request parameters. +// +// You must sign the request, either using an Authorization header or a presigned +// URL, when using these parameters. They cannot be used with an unsigned (anonymous) +// request. +// +// * response-content-type +// +// * response-content-language +// +// * response-expires +// +// * response-cache-control +// +// * response-content-disposition +// +// * response-content-encoding +// +// Additional Considerations about Request Headers +// +// If both of the If-Match and If-Unmodified-Since headers are present in the +// request as follows: If-Match condition evaluates to true, and; If-Unmodified-Since +// condition evaluates to false; then, S3 returns 200 OK and the data requested. +// +// If both of the If-None-Match and If-Modified-Since headers are present in +// the request as follows:If-None-Match condition evaluates to false, and; If-Modified-Since +// condition evaluates to true; then, S3 returns 304 Not Modified response code. +// +// For more information about conditional requests, see RFC 7232 (https://tools.ietf.org/html/rfc7232). +// +// The following operations are related to GetObject: +// +// * ListBuckets +// +// * GetObjectAcl +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's +// API operation GetObject for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchKey "NoSuchKey" +// The specified key does not exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObject +func (c *S3) GetObject(input *GetObjectInput) (*GetObjectOutput, error) { + req, out := c.GetObjectRequest(input) + return out, req.Send() +} + +// GetObjectWithContext is the same as GetObject with the addition of +// the ability to pass a context and additional request options. +// +// See GetObject for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. func (c *S3) GetObjectWithContext(ctx aws.Context, input *GetObjectInput, opts ...request.Option) (*GetObjectOutput, error) { req, out := c.GetObjectRequest(input) @@ -3186,7 +4336,21 @@ func (c *S3) GetObjectAclRequest(input *GetObjectAclInput) (req *request.Request // GetObjectAcl API operation for Amazon Simple Storage Service. // -// Returns the access control list (ACL) of an object. +// Returns the access control list (ACL) of an object. To use this operation, +// you must have READ_ACP access to the object. +// +// Versioning +// +// By default, GET returns ACL information about the current version of an object. +// To return ACL information about a different version, use the versionId subresource. +// +// The following operations are related to GetObjectAcl: +// +// * GetObject +// +// * DeleteObject +// +// * PutObject // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3265,7 +4429,8 @@ func (c *S3) GetObjectLegalHoldRequest(input *GetObjectLegalHoldInput) (req *req // GetObjectLegalHold API operation for Amazon Simple Storage Service. // -// Gets an object's current Legal Hold status. +// Gets an object's current Legal Hold status. For more information, see Locking +// Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.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 @@ -3339,9 +4504,10 @@ func (c *S3) GetObjectLockConfigurationRequest(input *GetObjectLockConfiguration // GetObjectLockConfiguration API operation for Amazon Simple Storage Service. // -// Gets the object lock configuration for a bucket. The rule specified in the -// object lock configuration will be applied by default to every new object -// placed in the specified bucket. +// Gets the Object Lock configuration for a bucket. The rule specified in the +// Object Lock configuration will be applied by default to every new object +// placed in the specified bucket. For more information, see Locking Objects +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.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 @@ -3415,7 +4581,8 @@ func (c *S3) GetObjectRetentionRequest(input *GetObjectRetentionInput) (req *req // GetObjectRetention API operation for Amazon Simple Storage Service. // -// Retrieves an object's retention settings. +// Retrieves an object's retention settings. For more information, see Locking +// Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.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 @@ -3489,7 +4656,25 @@ func (c *S3) GetObjectTaggingRequest(input *GetObjectTaggingInput) (req *request // GetObjectTagging API operation for Amazon Simple Storage Service. // -// Returns the tag-set of an object. +// Returns the tag-set of an object. You send the GET request against the tagging +// subresource associated with the object. +// +// To use this operation, you must have permission to perform the s3:GetObjectTagging +// action. By default, the GET operation returns information about current version +// of an object. For a versioned bucket, you can have multiple versions of an +// object in your bucket. To retrieve tags of any other version, use the versionId +// query parameter. You also need permission for the s3:GetObjectVersionTagging +// action. +// +// By default, the bucket owner has this permission and can grant this permission +// to others. +// +// For information about the Amazon S3 object tagging feature, see Object Tagging +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html). +// +// The following operation is related to GetObjectTagging: +// +// * PutObjectTagging // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3563,7 +4748,19 @@ func (c *S3) GetObjectTorrentRequest(input *GetObjectTorrentInput) (req *request // GetObjectTorrent API operation for Amazon Simple Storage Service. // -// Return torrent files from a bucket. +// Return torrent files from a bucket. BitTorrent can save you bandwidth when +// you're distributing large files. For more information about BitTorrent, see +// Amazon S3 Torrent (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3Torrent.html). +// +// You can get torrent only for objects that are less than 5 GB in size and +// that are not encrypted using server-side encryption with customer-provided +// encryption key. +// +// To use GET, you must have READ access to the object. +// +// The following operation is related to GetObjectTorrent: +// +// * GetObject // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3637,7 +4834,30 @@ func (c *S3) GetPublicAccessBlockRequest(input *GetPublicAccessBlockInput) (req // GetPublicAccessBlock API operation for Amazon Simple Storage Service. // -// Retrieves the PublicAccessBlock configuration for an Amazon S3 bucket. +// Retrieves the PublicAccessBlock configuration for an Amazon S3 bucket. To +// use this operation, you must have the s3:GetBucketPublicAccessBlock permission. +// For more information about Amazon S3 permissions, see Specifying Permissions +// in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html). +// +// When Amazon S3 evaluates the PublicAccessBlock configuration for a bucket +// or an object, it checks the PublicAccessBlock configuration for both the +// bucket (or the bucket that contains the object) and the bucket owner's account. +// If the PublicAccessBlock settings are different between the bucket and the +// account, Amazon S3 uses the most restrictive combination of the bucket-level +// and account-level settings. +// +// For more information about when Amazon S3 considers a bucket or an object +// public, see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status). +// +// The following operations are related to GetPublicAccessBlock: +// +// * Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) +// +// * PutPublicAccessBlock +// +// * GetPublicAccessBlock +// +// * DeletePublicAccessBlock // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3713,7 +4933,15 @@ func (c *S3) HeadBucketRequest(input *HeadBucketInput) (req *request.Request, ou // HeadBucket API operation for Amazon Simple Storage Service. // // This operation is useful to determine if a bucket exists and you have permission -// to access it. +// to access it. The operation returns a 200 OK if the bucket exists and you +// have permission to access it. Otherwise, the operation might return responses +// such as 404 Not Found and 403 Forbidden. +// +// To use this operation, you must have permissions to perform the s3:ListBucket +// action. The bucket owner has this permission by default and can grant this +// permission to others. For more information about permissions, see Permissions +// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.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 @@ -3796,6 +5024,63 @@ 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. // +// A HEAD request has the same options as a GET operation on an object. The +// response is identical to the GET response except that there is no response +// body. +// +// If you encrypt an object by using server-side encryption with customer-provided +// encryption keys (SSE-C) when you store the object in Amazon S3, then when +// you retrieve the metadata from the object, you must use the following headers: +// +// * x-amz-server-side​-encryption​-customer-algorithm +// +// * x-amz-server-side​-encryption​-customer-key +// +// * x-amz-server-side​-encryption​-customer-key-MD5 +// +// For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided +// Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html). +// +// Encryption request headers, like x-amz-server-side-encryption, should not +// be sent for GET requests if your object uses server-side encryption with +// CMKs stored in AWS KMS (SSE-KMS) or server-side encryption with Amazon S3–managed +// encryption keys (SSE-S3). If your object does use these types of keys, you’ll +// get an HTTP 400 BadRequest error. +// +// Request headers are limited to 8 KB in size. For more information, see Common +// Request Headers (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html). +// +// Consider the following when using request headers: +// +// * Consideration 1 – If both of the If-Match and If-Unmodified-Since +// headers are present in the request as follows: If-Match condition evaluates +// to true, and; If-Unmodified-Since condition evaluates to false; Then Amazon +// S3 returns 200 OK and the data requested. +// +// * Consideration 2 – If both of the If-None-Match and If-Modified-Since +// headers are present in the request as follows: If-None-Match condition +// evaluates to false, and; If-Modified-Since condition evaluates to true; +// Then Amazon S3 returns the 304 Not Modified response code. +// +// For more information about conditional requests, see RFC 7232 (https://tools.ietf.org/html/rfc7232). +// +// Permissions +// +// You need the s3:GetObject permission for this operation. For more information, +// see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html). +// If the object you request does not exist, the error Amazon S3 returns depends +// on whether you also have the s3:ListBucket permission. +// +// * If you have the s3:ListBucket permission on the bucket, Amazon S3 returns +// an HTTP status code 404 ("no such key") error. +// +// * If you don’t have the s3:ListBucket permission, Amazon S3 returns +// an HTTP status code 403 ("access denied") error. +// +// The following operation is related to HeadObject: +// +// * GetObject +// // See http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#RESTErrorResponses // for more information on returned errors. // @@ -3871,7 +5156,33 @@ func (c *S3) ListBucketAnalyticsConfigurationsRequest(input *ListBucketAnalytics // ListBucketAnalyticsConfigurations API operation for Amazon Simple Storage Service. // -// Lists the analytics configurations for the bucket. +// Lists the analytics configurations for the bucket. You can have up to 1,000 +// analytics configurations per bucket. +// +// This operation supports list pagination and does not return more than 100 +// configurations at a time. You should always check the IsTruncated element +// in the response. If there are no more configurations to list, IsTruncated +// is set to false. If there are more configurations to list, IsTruncated is +// set to true, and there will be a value in NextContinuationToken. You use +// the NextContinuationToken value to continue the pagination of the list by +// passing the value in continuation-token in the request to GET the next page. +// +// To use this operation, you must have permissions to perform the s3:GetAnalyticsConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// For information about Amazon S3 analytics feature, see Amazon S3 Analytics +// – Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html). +// +// The following operations are related to ListBucketAnalyticsConfigurations: +// +// * GetBucketAnalyticsConfiguration +// +// * DeleteBucketAnalyticsConfiguration +// +// * PutBucketAnalyticsConfiguration // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3945,7 +5256,33 @@ func (c *S3) ListBucketInventoryConfigurationsRequest(input *ListBucketInventory // ListBucketInventoryConfigurations API operation for Amazon Simple Storage Service. // -// Returns a list of inventory configurations for the bucket. +// Returns a list of inventory configurations for the bucket. You can have up +// to 1,000 analytics configurations per bucket. +// +// This operation supports list pagination and does not return more than 100 +// configurations at a time. Always check the IsTruncated element in the response. +// If there are no more configurations to list, IsTruncated is set to false. +// If there are more configurations to list, IsTruncated is set to true, and +// there is a value in NextContinuationToken. You use the NextContinuationToken +// value to continue the pagination of the list by passing the value in continuation-token +// in the request to GET the next page. +// +// To use this operation, you must have permissions to perform the s3:GetInventoryConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// For information about the Amazon S3 inventory feature, see Amazon S3 Inventory +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html) +// +// The following operations are related to ListBucketInventoryConfigurations: +// +// * GetBucketInventoryConfiguration +// +// * DeleteBucketInventoryConfiguration +// +// * PutBucketInventoryConfiguration // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4019,7 +5356,34 @@ func (c *S3) ListBucketMetricsConfigurationsRequest(input *ListBucketMetricsConf // ListBucketMetricsConfigurations API operation for Amazon Simple Storage Service. // -// Lists the metrics configurations for the bucket. +// Lists the metrics configurations for the bucket. The metrics configurations +// are only for the request metrics of the bucket and do not provide information +// on daily storage metrics. You can have up to 1,000 configurations per bucket. +// +// This operation supports list pagination and does not return more than 100 +// configurations at a time. Always check the IsTruncated element in the response. +// If there are no more configurations to list, IsTruncated is set to false. +// If there are more configurations to list, IsTruncated is set to true, and +// there is a value in NextContinuationToken. You use the NextContinuationToken +// value to continue the pagination of the list by passing the value in continuation-token +// in the request to GET the next page. +// +// To use this operation, you must have permissions to perform the s3:GetMetricsConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// For more information about metrics configurations and CloudWatch request +// metrics, see Monitoring Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html). +// +// The following operations are related to ListBucketMetricsConfigurations: +// +// * PutBucketMetricsConfiguration +// +// * GetBucketMetricsConfiguration +// +// * DeleteBucketMetricsConfiguration // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4173,7 +5537,40 @@ func (c *S3) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) (req // ListMultipartUploads API operation for Amazon Simple Storage Service. // -// This operation lists in-progress multipart uploads. +// This operation lists in-progress multipart uploads. An in-progress multipart +// upload is a multipart upload that has been initiated using the Initiate Multipart +// Upload request, but has not yet been completed or aborted. +// +// This operation returns at most 1,000 multipart uploads in the response. 1,000 +// multipart uploads is the maximum number of uploads a response can include, +// which is also the default value. You can further limit the number of uploads +// in a response by specifying the max-uploads parameter in the response. If +// additional multipart uploads satisfy the list criteria, the response will +// contain an IsTruncated element with the value true. To list the additional +// multipart uploads, use the key-marker and upload-id-marker request parameters. +// +// In the response, the uploads are sorted by key. If your application has initiated +// more than one multipart upload using the same object key, then uploads in +// the response are first sorted by key. Additionally, uploads are sorted in +// ascending order within each key by the upload initiation time. +// +// For more information on multipart uploads, see Uploading Objects Using Multipart +// Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html). +// +// For information on permissions required to use the multipart upload API, +// see Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). +// +// The following operations are related to ListMultipartUploads: +// +// * CreateMultipartUpload +// +// * UploadPart +// +// * CompleteMultipartUpload +// +// * ListParts +// +// * AbortMultipartUpload // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4246,10 +5643,12 @@ func (c *S3) ListMultipartUploadsPagesWithContext(ctx aws.Context, input *ListMu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListMultipartUploadsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListMultipartUploadsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4303,7 +5702,24 @@ func (c *S3) ListObjectVersionsRequest(input *ListObjectVersionsInput) (req *req // ListObjectVersions API operation for Amazon Simple Storage Service. // -// Returns metadata about all of the versions of objects in a bucket. +// Returns metadata about all of the versions of objects in a bucket. You can +// also use request parameters as selection criteria to return metadata about +// a subset of all the object versions. +// +// A 200 OK response can contain valid or invalid XML. Make sure to design your +// application to parse the contents of the response and handle it appropriately. +// +// To use this operation, you must have READ access to the bucket. +// +// The following operations are related to ListObjectVersions: +// +// * ListObjectsV2 +// +// * GetObject +// +// * PutObject +// +// * DeleteObject // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4376,10 +5792,12 @@ func (c *S3) ListObjectVersionsPagesWithContext(ctx aws.Context, input *ListObje }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListObjectVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListObjectVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4433,9 +5851,27 @@ func (c *S3) ListObjectsRequest(input *ListObjectsInput) (req *request.Request, // ListObjects API operation for Amazon Simple Storage Service. // -// Returns some or all (up to 1000) of the objects in a bucket. You can use +// Returns some or all (up to 1,000) of the objects in a bucket. You can use // the request parameters as selection criteria to return a subset of the objects -// in a bucket. +// in a bucket. A 200 OK response can contain valid or invalid XML. Be sure +// to design your application to parse the contents of the response and handle +// it appropriately. +// +// This API has been revised. We recommend that you use the newer version, ListObjectsV2, +// when developing applications. For backward compatibility, Amazon S3 continues +// to support ListObjects. +// +// The following operations are related to ListObjects: +// +// * ListObjectsV2 +// +// * GetObject +// +// * PutObject +// +// * CreateBucket +// +// * ListBuckets // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4513,10 +5949,12 @@ func (c *S3) ListObjectsPagesWithContext(ctx aws.Context, input *ListObjectsInpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListObjectsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListObjectsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4570,10 +6008,34 @@ func (c *S3) ListObjectsV2Request(input *ListObjectsV2Input) (req *request.Reque // ListObjectsV2 API operation for Amazon Simple Storage Service. // -// Returns some or all (up to 1000) of the objects in a bucket. You can use +// Returns some or all (up to 1,000) of the objects in a bucket. You can use // the request parameters as selection criteria to return a subset of the objects -// in a bucket. Note: ListObjectsV2 is the revised List Objects API and we recommend -// you use this revised API for new application development. +// in a bucket. A 200 OK response can contain valid or invalid XML. Make sure +// to design your application to parse the contents of the response and handle +// it appropriately. +// +// To use this operation, you must have READ access to the bucket. +// +// To use this operation in an AWS Identity and Access Management (IAM) policy, +// you must have permissions to perform the s3:ListBucket action. The bucket +// owner has this permission by default and can grant this permission to others. +// For more information about permissions, see Permissions Related to Bucket +// Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// This section describes the latest revision of the API. We recommend that +// you use this revised API for application development. For backward compatibility, +// Amazon S3 continues to support the prior version of this API, ListObjects. +// +// To get a list of your buckets, see ListBuckets. +// +// The following operations are related to ListObjectsV2: +// +// * GetObject +// +// * PutObject +// +// * CreateBucket // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4651,10 +6113,12 @@ func (c *S3) ListObjectsV2PagesWithContext(ctx aws.Context, input *ListObjectsV2 }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListObjectsV2Output), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListObjectsV2Output), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4709,6 +6173,33 @@ func (c *S3) ListPartsRequest(input *ListPartsInput) (req *request.Request, outp // ListParts API operation for Amazon Simple Storage Service. // // Lists the parts that have been uploaded for a specific multipart upload. +// This operation must include the upload ID, which you obtain by sending the +// initiate multipart upload request (see CreateMultipartUpload). This request +// returns a maximum of 1,000 uploaded parts. The default number of parts returned +// is 1,000 parts. You can restrict the number of parts returned by specifying +// the max-parts request parameter. If your multipart upload consists of more +// than 1,000 parts, the response returns an IsTruncated field with the value +// of true, and a NextPartNumberMarker element. In subsequent ListParts requests +// you can include the part-number-marker query string parameter and set its +// value to the NextPartNumberMarker field value from the previous response. +// +// For more information on multipart uploads, see Uploading Objects Using Multipart +// Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html). +// +// For information on permissions required to use the multipart upload API, +// see Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). +// +// The following operations are related to ListParts: +// +// * CreateMultipartUpload +// +// * UploadPart +// +// * CompleteMultipartUpload +// +// * AbortMultipartUpload +// +// * ListMultipartUploads // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4781,10 +6272,12 @@ func (c *S3) ListPartsPagesWithContext(ctx aws.Context, input *ListPartsInput, f }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPartsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPartsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4833,7 +6326,41 @@ func (c *S3) PutBucketAccelerateConfigurationRequest(input *PutBucketAccelerateC // PutBucketAccelerateConfiguration API operation for Amazon Simple Storage Service. // -// Sets the accelerate configuration of an existing bucket. +// Sets the accelerate configuration of an existing bucket. Amazon S3 Transfer +// Acceleration is a bucket-level feature that enables you to perform faster +// data transfers to Amazon S3. +// +// To use this operation, you must have permission to perform the s3:PutAccelerateConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// The Transfer Acceleration state of a bucket can be set to one of the following +// two values: +// +// * Enabled – Enables accelerated data transfers to the bucket. +// +// * Suspended – Disables accelerated data transfers to the bucket. +// +// The GetBucketAccelerateConfiguration operation returns the transfer acceleration +// state of a bucket. +// +// After setting the Transfer Acceleration state of a bucket to Enabled, it +// might take up to thirty minutes before the data transfer rates to the bucket +// increase. +// +// The name of the bucket used for Transfer Acceleration must be DNS-compliant +// and must not contain periods ("."). +// +// For more information about transfer acceleration, see Transfer Acceleration +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html). +// +// The following operations are related to PutBucketAccelerateConfiguration: +// +// * GetBucketAccelerateConfiguration +// +// * CreateBucket // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4908,7 +6435,80 @@ func (c *S3) PutBucketAclRequest(input *PutBucketAclInput) (req *request.Request // PutBucketAcl API operation for Amazon Simple Storage Service. // -// Sets the permissions on a bucket using access control lists (ACL). +// Sets the permissions on an existing bucket using access control lists (ACL). +// For more information, see Using ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html). +// To set the ACL of a bucket, you must have WRITE_ACP permission. +// +// You can use one of the following two ways to set a bucket's permissions: +// +// * Specify the ACL in the request body +// +// * Specify permissions using request headers +// +// You cannot specify access permission using both the body and the request +// headers. +// +// Depending on your application needs, you may choose to set the ACL on a bucket +// using either the request body or the headers. For example, if you have an +// existing application that updates a bucket ACL using the request body, then +// you can continue to use that approach. +// +// Access Permissions +// +// You can set access permissions using one of the following methods: +// +// * Specify a canned ACL with the x-amz-acl request header. Amazon S3 supports +// a set of predefined ACLs, known as canned ACLs. Each canned ACL has a +// predefined set of grantees and permissions. Specify the canned ACL name +// as the value of x-amz-acl. If you use this header, you cannot use other +// access control-specific headers in your request. For more information, +// see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). +// +// * Specify access permissions explicitly with the x-amz-grant-read, x-amz-grant-read-acp, +// x-amz-grant-write-acp, and x-amz-grant-full-control headers. When using +// these headers, you specify explicit access permissions and grantees (AWS +// accounts or Amazon S3 groups) who will receive the permission. If you +// use these ACL-specific headers, you cannot use the x-amz-acl header to +// set a canned ACL. These parameters map to the set of permissions that +// Amazon S3 supports in an ACL. For more information, see Access Control +// List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html). +// You specify each grantee as a type=value pair, where the type is one of +// the following: emailAddress – if the value specified is the email address +// of an AWS account id – if the value specified is the canonical user +// ID of an AWS account uri – if you are granting permissions to a predefined +// group For example, the following x-amz-grant-write header grants create, +// overwrite, and delete objects permission to LogDelivery group predefined +// by Amazon S3 and two AWS accounts identified by their email addresses. +// x-amz-grant-write: uri="http://acs.amazonaws.com/groups/s3/LogDelivery", +// emailAddress="xyz@amazon.com", emailAddress="abc@amazon.com" +// +// You can use either a canned ACL or specify access permissions explicitly. +// You cannot do both. +// +// Grantee Values +// +// You can specify the person (grantee) to whom you're assigning access rights +// (using request elements) in the following ways: +// +// * By Email address: <>Grantees@email.com<>lt;/Grantee> +// The grantee is resolved to the CanonicalUser and, in a response to a GET +// Object acl request, appears as the CanonicalUser. +// +// * By the person's ID: <>ID<><>GranteesEmail<> +// DisplayName is optional and ignored in the request +// +// * By URI: <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> +// +// Related Resources +// +// * CreateBucket +// +// * DeleteBucket +// +// * GetObjectAcl // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -4984,7 +6584,50 @@ func (c *S3) PutBucketAnalyticsConfigurationRequest(input *PutBucketAnalyticsCon // PutBucketAnalyticsConfiguration API operation for Amazon Simple Storage Service. // // Sets an analytics configuration for the bucket (specified by the analytics -// configuration ID). +// configuration ID). You can have up to 1,000 analytics configurations per +// bucket. +// +// You can choose to have storage class analysis export analysis reports sent +// to a comma-separated values (CSV) flat file. See the DataExport request element. +// Reports are updated daily and are based on the object filters that you configure. +// When selecting data export, you specify a destination bucket and an optional +// destination prefix where the file is written. You can export the data to +// a destination bucket in a different account. However, the destination bucket +// must be in the same Region as the bucket that you are making the PUT analytics +// configuration to. For more information, see Amazon S3 Analytics – Storage +// Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html). +// +// You must create a bucket policy on the destination bucket where the exported +// file is written to grant permissions to Amazon S3 to write objects to the +// bucket. For an example policy, see Granting Permissions for Amazon S3 Inventory +// and Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-9). +// +// To use this operation, you must have permissions to perform the s3:PutAnalyticsConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// Special Errors +// +// * HTTP Error: HTTP 400 Bad Request Code: InvalidArgument Cause: Invalid +// argument. +// +// * HTTP Error: HTTP 400 Bad Request Code: TooManyConfigurations Cause: +// You are attempting to create a new configuration but have already reached +// the 1,000-configuration limit. +// +// * HTTP Error: HTTP 403 Forbidden Code: AccessDenied Cause: You are not +// the owner of the specified bucket, or you do not have the s3:PutAnalyticsConfiguration +// bucket permission to set the configuration on the bucket. +// +// Related 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 @@ -5059,7 +6702,49 @@ func (c *S3) PutBucketCorsRequest(input *PutBucketCorsInput) (req *request.Reque // PutBucketCors API operation for Amazon Simple Storage Service. // -// Sets the CORS configuration for a bucket. +// Sets the cors configuration for your bucket. If the configuration exists, +// Amazon S3 replaces it. +// +// To use this operation, you must be allowed to perform the s3:PutBucketCORS +// action. By default, the bucket owner has this permission and can grant it +// to others. +// +// You set this configuration on a bucket so that the bucket can service cross-origin +// requests. For example, you might want to enable a request whose origin is +// http://www.example.com to access your Amazon S3 bucket at my.example.bucket.com +// by using the browser's XMLHttpRequest capability. +// +// To enable cross-origin resource sharing (CORS) on a bucket, you add the cors +// subresource to the bucket. The cors subresource is an XML document in which +// you configure rules that identify origins and the HTTP methods that can be +// executed on your bucket. The document is limited to 64 KB in size. +// +// When Amazon S3 receives a cross-origin request (or a pre-flight OPTIONS request) +// against a bucket, it evaluates the cors configuration on the bucket and uses +// the first CORSRule rule that matches the incoming browser request to enable +// a cross-origin request. For a rule to match, the following conditions must +// be met: +// +// * The request's Origin header must match AllowedOrigin elements. +// +// * The request method (for example, GET, PUT, HEAD, and so on) or the Access-Control-Request-Method +// header in case of a pre-flight OPTIONS request must be one of the AllowedMethod +// elements. +// +// * Every header specified in the Access-Control-Request-Headers request +// header of a pre-flight request must match an AllowedHeader element. +// +// For more information about CORS, go to Enabling Cross-Origin Resource Sharing +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the Amazon +// Simple Storage Service Developer Guide. +// +// Related Resources +// +// * GetBucketCors +// +// * DeleteBucketCors +// +// * RESTOPTIONSobject // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5134,8 +6819,28 @@ func (c *S3) PutBucketEncryptionRequest(input *PutBucketEncryptionInput) (req *r // PutBucketEncryption API operation for Amazon Simple Storage Service. // -// Creates a new server-side encryption configuration (or replaces an existing -// one, if present). +// This implementation of the PUT operation uses the encryption subresource +// to set the default encryption state of an existing bucket. +// +// This implementation of the PUT operation sets default encryption for a bucket +// using server-side encryption with Amazon S3-managed keys SSE-S3 or AWS KMS +// customer master keys (CMKs) (SSE-KMS). +// +// This operation requires AWS Signature Version 4. For more information, see +// Authenticating Requests (AWS Signature Version 4) (sig-v4-authenticating-requests.html). +// +// To use this operation, you must have permissions to perform the s3:PutEncryptionConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// Related Resources +// +// * GetBucketEncryption +// +// * DeleteBucketEncryption // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5210,8 +6915,54 @@ func (c *S3) PutBucketInventoryConfigurationRequest(input *PutBucketInventoryCon // PutBucketInventoryConfiguration API operation for Amazon Simple Storage Service. // -// Adds an inventory configuration (identified by the inventory ID) from the -// bucket. +// This implementation of the PUT operation adds an inventory configuration +// (identified by the inventory ID) to the bucket. You can have up to 1,000 +// inventory configurations per bucket. +// +// Amazon S3 inventory generates inventories of the objects in the bucket on +// a daily or weekly basis, and the results are published to a flat file. The +// bucket that is inventoried is called the source bucket, and the bucket where +// the inventory flat file is stored is called the destination bucket. The destination +// bucket must be in the same AWS Region as the source bucket. +// +// When you configure an inventory for a source bucket, you specify the destination +// bucket where you want the inventory to be stored, and whether to generate +// the inventory daily or weekly. You can also configure what object metadata +// to include and whether to inventory all object versions or only current versions. +// For more information, see Amazon S3 Inventory (https://docs.aws.amazon.com/AmazonS3/latest/dev//storage-inventory.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// You must create a bucket policy on the destination bucket to grant permissions +// to Amazon S3 to write objects to the bucket in the defined location. For +// an example policy, see Granting Permissions for Amazon S3 Inventory and Storage +// Class Analysis. (https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-9) +// +// To use this operation, you must have permissions to perform the s3:PutInventoryConfiguration +// action. The bucket owner has this permission by default and can grant this +// permission to others. For more information about permissions, see Permissions +// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev//using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev//s3-access-control.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// Special Errors +// +// * HTTP 400 Bad Request Error Code: InvalidArgument Cause: Invalid Argument +// +// * HTTP 400 Bad Request Error Code: TooManyConfigurations Cause: You are +// attempting to create a new configuration but have already reached the +// 1,000-configuration limit. +// +// * HTTP 403 Forbidden Error Code: AccessDenied Cause: You are not the owner +// of the specified bucket, or you do not have the s3:PutInventoryConfiguration +// bucket permission to set the configuration on the bucket +// +// Related Resources +// +// * GetBucketInventoryConfiguration +// +// * DeleteBucketInventoryConfiguration +// +// * ListBucketInventoryConfigurations // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5291,13 +7042,61 @@ func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) (req *req // PutBucketLifecycle API operation for Amazon Simple Storage Service. // -// No longer used, see the PutBucketLifecycleConfiguration operation. // -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. +// For an updated version of this API, see PutBucketLifecycleConfiguration. +// This version has been deprecated. Existing lifecycle configurations will +// work. For new lifecycle configurations, use the updated API. // -// See the AWS API reference guide for Amazon Simple Storage Service's +// Creates a new lifecycle configuration for the bucket or replaces an existing +// lifecycle configuration. For information about lifecycle configuration, see +// Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev//object-lifecycle-mgmt.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// By default, all Amazon S3 resources, including buckets, objects, and related +// subresources (for example, lifecycle configuration and website configuration) +// are private. Only the resource owner, the AWS account that created the resource, +// can access it. The resource owner can optionally grant access permissions +// to others by writing an access policy. For this operation, users must get +// the s3:PutLifecycleConfiguration permission. +// +// You can also explicitly deny permissions. Explicit denial also supersedes +// any other permissions. If you want to prevent users or accounts from removing +// or deleting objects from your bucket, you must deny them permissions for +// the following actions: +// +// * s3:DeleteObject +// +// * s3:DeleteObjectVersion +// +// * s3:PutLifecycleConfiguration +// +// For more information about permissions, see Managing Access Permissions to +// your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev//s3-access-control.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// For more examples of transitioning objects to storage classes such as STANDARD_IA +// or ONEZONE_IA, see Examples of Lifecycle Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev//intro-lifecycle-rules.html#lifecycle-configuration-examples). +// +// Related Resources +// +// * GetBucketLifecycle(Deprecated) +// +// * GetBucketLifecycleConfiguration +// +// * +// +// * By default, a resource owner—in this case, a bucket owner, which is +// the AWS account that created the bucket—can perform any of the operations. +// A resource owner can also grant others permission to perform the operation. +// For more information, see the following topics in the Amazon Simple Storage +// Service Developer Guide: Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev//using-with-s3-actions.html) +// Managing Access Permissions to your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev//s3-access-control.html) +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon Simple Storage Service's // API operation PutBucketLifecycle for usage and error information. // See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycle // @@ -5370,8 +7169,69 @@ func (c *S3) PutBucketLifecycleConfigurationRequest(input *PutBucketLifecycleCon // PutBucketLifecycleConfiguration API operation for Amazon Simple Storage Service. // -// Sets lifecycle configuration for your bucket. If a lifecycle configuration -// exists, it replaces it. +// Creates a new lifecycle configuration for the bucket or replaces an existing +// lifecycle configuration. For information about lifecycle configuration, see +// Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// Bucket lifecycle configuration now supports specifying a lifecycle rule using +// an object key name prefix, one or more object tags, or a combination of both. +// Accordingly, this section describes the latest API. The previous version +// of the API supported filtering based only on an object key name prefix, which +// is supported for backward compatibility. For the related API description, +// see PutBucketLifecycle. +// +// Rules +// +// You specify the lifecycle configuration in your request body. The lifecycle +// configuration is specified as XML consisting of one or more rules. Each rule +// consists of the following: +// +// * Filter identifying a subset of objects to which the rule applies. The +// filter can be based on a key name prefix, object tags, or a combination +// of both. +// +// * Status whether the rule is in effect. +// +// * One or more lifecycle transition and expiration actions that you want +// Amazon S3 to perform on the objects identified by the filter. If the state +// of your bucket is versioning-enabled or versioning-suspended, you can +// have many versions of the same object (one current version and zero or +// more noncurrent versions). Amazon S3 provides predefined actions that +// you can specify for current and noncurrent object versions. +// +// For more information, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) +// and Lifecycle Configuration Elements (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html). +// +// Permissions +// +// By default, all Amazon S3 resources are private, including buckets, objects, +// and related subresources (for example, lifecycle configuration and website +// configuration). Only the resource owner (that is, the AWS account that created +// it) can access the resource. The resource owner can optionally grant access +// permissions to others by writing an access policy. For this operation, a +// user must get the s3:PutLifecycleConfiguration permission. +// +// You can also explicitly deny permissions. Explicit deny also supersedes any +// other permissions. If you want to block users or accounts from removing or +// deleting objects from your bucket, you must deny them permissions for the +// following actions: +// +// * s3:DeleteObject +// +// * s3:DeleteObjectVersion +// +// * s3:PutLifecycleConfiguration +// +// For more information about permissions, see Managing Access Permissions to +// Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// The following are related to PutBucketLifecycleConfiguration: +// +// * Examples of Lifecycle Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-configuration-examples.html) +// +// * GetBucketLifecycleConfiguration +// +// * DeleteBucketLifecycle // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5447,9 +7307,52 @@ func (c *S3) PutBucketLoggingRequest(input *PutBucketLoggingInput) (req *request // PutBucketLogging API operation for Amazon Simple Storage Service. // // Set the logging parameters for a bucket and to specify permissions for who -// can view and modify the logging parameters. To set the logging status of +// can view and modify the logging parameters. All logs are saved to buckets +// in the same AWS Region as the source bucket. To set the logging status of // a bucket, you must be the bucket owner. // +// The bucket owner is automatically granted FULL_CONTROL to all logs. You use +// the Grantee request element to grant access to other people. The Permissions +// request element specifies the kind of access the grantee has to the logs. +// +// Grantee Values +// +// You can specify the person (grantee) to whom you're assigning access rights +// (using request elements) in the following ways: +// +// * By the person's ID: <>ID<><>GranteesEmail<> +// DisplayName is optional and ignored in the request. +// +// * By Email address: <>Grantees@email.com<> +// The grantee is resolved to the CanonicalUser and, in a response to a GET +// Object acl request, appears as the CanonicalUser. +// +// * By URI: <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> +// +// To enable logging, you use LoggingEnabled and its children request elements. +// To disable logging, you use an empty BucketLoggingStatus request element: +// +// +// +// For more information about server access logging, see Server Access Logging +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerLogs.html). +// +// For more information about creating a bucket, see CreateBucket. For more +// information about returning the logging status of a bucket, see GetBucketLogging. +// +// The following operations are related to PutBucketLogging: +// +// * PutObject +// +// * DeleteBucket +// +// * CreateBucket +// +// * GetBucketLogging +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -5524,7 +7427,33 @@ func (c *S3) PutBucketMetricsConfigurationRequest(input *PutBucketMetricsConfigu // PutBucketMetricsConfiguration API operation for Amazon Simple Storage Service. // // Sets a metrics configuration (specified by the metrics configuration ID) -// for the bucket. +// for the bucket. You can have up to 1,000 metrics configurations per bucket. +// If you're updating an existing metrics configuration, note that this is a +// full replacement of the existing metrics configuration. If you don't include +// the elements you want to keep, they are erased. +// +// To use this operation, you must have permissions to perform the s3:PutMetricsConfiguration +// action. The bucket owner has this permission by default. The bucket owner +// can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// For information about CloudWatch request metrics for Amazon S3, see Monitoring +// Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html). +// +// The following operations are related to PutBucketMetricsConfiguration: +// +// * DeleteBucketMetricsConfiguration +// +// * PutBucketMetricsConfiguration +// +// * ListBucketMetricsConfigurations +// +// GetBucketLifecycle has the following special error: +// +// * Error code: TooManyConfigurations Description: You are attempting to +// create a new configuration but have already reached the 1,000-configuration +// limit. HTTP Status Code: HTTP 400 Bad 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 @@ -5683,7 +7612,55 @@ func (c *S3) PutBucketNotificationConfigurationRequest(input *PutBucketNotificat // PutBucketNotificationConfiguration API operation for Amazon Simple Storage Service. // -// Enables notifications of specified events for a bucket. +// Enables notifications of specified events for a bucket. For more information +// about event notifications, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html). +// +// Using this API, you can replace an existing notification configuration. The +// configuration is an XML file that defines the event types that you want Amazon +// S3 to publish and the destination where you want Amazon S3 to publish an +// event notification when it detects an event of the specified type. +// +// By default, your bucket has no event notifications configured. That is, the +// notification configuration will be an empty NotificationConfiguration. +// +// +// +// +// +// This operation replaces the existing notification configuration with the +// configuration you include in the request body. +// +// After Amazon S3 receives this request, it first verifies that any Amazon +// Simple Notification Service (Amazon SNS) or Amazon Simple Queue Service (Amazon +// SQS) destination exists, and that the bucket owner has permission to publish +// to it by sending a test notification. In the case of AWS Lambda destinations, +// Amazon S3 verifies that the Lambda function permissions grant Amazon S3 permission +// to invoke the function from the Amazon S3 bucket. For more information, see +// Configuring Notifications for Amazon S3 Events (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html). +// +// You can disable notifications by adding the empty NotificationConfiguration +// element. +// +// By default, only the bucket owner can configure notifications on a bucket. +// However, bucket owners can use a bucket policy to grant permission to other +// users to set this configuration with s3:PutBucketNotification permission. +// +// The PUT notification is an atomic operation. For example, suppose your notification +// configuration includes SNS topic, SQS queue, and Lambda function configurations. +// When you send a PUT request with this configuration, Amazon S3 sends test +// messages to your SNS topic. If the message fails, the entire PUT operation +// will fail, and Amazon S3 will not add the configuration to your bucket. +// +// Responses +// +// If the configuration in the request body includes only one TopicConfiguration +// specifying only the s3:ReducedRedundancyLostObject event type, the response +// will also include the x-amz-sns-test-message-id header containing the message +// ID of the test notification sent to the topic. +// +// The following operation is related to PutBucketNotificationConfiguration: +// +// * GetBucketNotificationConfiguration // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5758,7 +7735,28 @@ func (c *S3) PutBucketPolicyRequest(input *PutBucketPolicyInput) (req *request.R // PutBucketPolicy API operation for Amazon Simple Storage Service. // -// Applies an Amazon S3 bucket policy to an Amazon S3 bucket. +// Applies an Amazon S3 bucket policy to an Amazon S3 bucket. If you are using +// an identity other than the root user of the AWS account that owns the bucket, +// the calling identity must have the PutBucketPolicy permissions on the specified +// bucket and belong to the bucket owner's account in order to use this operation. +// +// If you don't have PutBucketPolicy permissions, Amazon S3 returns a 403 Access +// Denied error. If you have the correct permissions, but you're not using an +// identity that belongs to the bucket owner's account, Amazon S3 returns a +// 405 Method Not Allowed error. +// +// As a security precaution, the root user of the AWS account that owns a bucket +// can always use this operation, even if the policy explicitly denies the root +// user the ability to perform this action. +// +// For more information about bucket policies, see Using Bucket Policies and +// User Policies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html). +// +// The following operations are related to PutBucketPolicy: +// +// * CreateBucket +// +// * DeleteBucket // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5834,9 +7832,56 @@ func (c *S3) PutBucketReplicationRequest(input *PutBucketReplicationInput) (req // PutBucketReplication API operation for Amazon Simple Storage Service. // // Creates a replication configuration or replaces an existing one. For more -// information, see Cross-Region Replication (CRR) (https://docs.aws.amazon.com/AmazonS3/latest/dev/crr.html) +// information, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) // in the Amazon S3 Developer Guide. // +// To perform this operation, the user or role performing the operation must +// have the iam:PassRole (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html) +// permission. +// +// Specify the replication configuration in the request body. In the replication +// configuration, you provide the name of the destination bucket where you want +// Amazon S3 to replicate objects, the IAM role that Amazon S3 can assume to +// replicate objects on your behalf, and other relevant information. +// +// A replication configuration must include at least one rule, and can contain +// a maximum of 1,000. Each rule identifies a subset of objects to replicate +// by filtering the objects in the source bucket. To choose additional subsets +// of objects to replicate, add a rule for each subset. All rules must specify +// the same destination bucket. +// +// To specify a subset of the objects in the source bucket to apply a replication +// rule to, add the Filter element as a child of the Rule element. You can filter +// objects based on an object key prefix, one or more object tags, or both. +// When you add the Filter element in the configuration, you must also add the +// following elements: DeleteMarkerReplication, Status, and Priority. +// +// For information about enabling versioning on a bucket, see Using Versioning +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html). +// +// By default, a resource owner, in this case the AWS account that created the +// bucket, can perform this operation. The resource owner can also grant others +// permissions to perform the operation. For more information about permissions, +// see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// Handling Replication of Encrypted Objects +// +// By default, Amazon S3 doesn't replicate objects that are stored at rest using +// server-side encryption with CMKs stored in AWS KMS. To replicate AWS KMS-encrypted +// objects, add the following: SourceSelectionCriteria, SseKmsEncryptedObjects, +// Status, EncryptionConfiguration, and ReplicaKmsKeyID. For information about +// replication configuration, see Replicating Objects Created with SSE Using +// CMKs stored in AWS KMS (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-config-for-kms-objects.html). +// +// For information on PutBucketReplication errors, see ReplicationErrorCodeList +// +// The following operations are related to PutBucketReplication: +// +// * GetBucketReplication +// +// * DeleteBucketReplication +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -5913,8 +7958,14 @@ func (c *S3) PutBucketRequestPaymentRequest(input *PutBucketRequestPaymentInput) // Sets the request payment configuration for a bucket. By default, the bucket // owner pays for downloads from the bucket. This configuration parameter enables // the bucket owner (only) to specify that the person requesting the download -// will be charged for the download. Documentation on requester pays buckets -// can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html +// will be charged for the download. For more information, see Requester Pays +// Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html). +// +// The following operations are related to PutBucketRequestPayment: +// +// * CreateBucket +// +// * GetBucketRequestPayment // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -5991,6 +8042,47 @@ func (c *S3) PutBucketTaggingRequest(input *PutBucketTaggingInput) (req *request // // Sets the tags for a bucket. // +// Use tags to organize your AWS bill to reflect your own cost structure. To +// do this, sign up to get your AWS account bill with tag key values included. +// Then, to see the cost of combined resources, organize your billing information +// according to resources with the same tag key values. For example, you can +// tag several resources with a specific application name, and then organize +// your billing information to see the total cost of that application across +// several services. For more information, see Cost Allocation and Tagging (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html). +// +// Within a bucket, if you add a tag that has the same key as an existing tag, +// the new value overwrites the old value. For more information, see Using Cost +// Allocation in Amazon S3 Bucket Tags (https://docs.aws.amazon.com/AmazonS3/latest/dev/CostAllocTagging.html). +// +// To use this operation, you must have permissions to perform the s3:PutBucketTagging +// action. The bucket owner has this permission by default and can grant this +// permission to others. For more information about permissions, see Permissions +// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html). +// +// PutBucketTagging has the following special errors: +// +// * Error code: InvalidTagError Description: The tag provided was not a +// valid tag. This error can occur if the tag did not pass input validation. +// For information about tag restrictions, see User-Defined Tag Restrictions +// (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2//allocation-tag-restrictions.html) +// and AWS-Generated Cost Allocation Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2//aws-tag-restrictions.html). +// +// * Error code: MalformedXMLError Description: The XML provided does not +// match the schema. +// +// * Error code: OperationAbortedError Description: A conflicting conditional +// operation is currently in progress against this resource. Please try again. +// +// * Error code: InternalError Description: The service was unable to apply +// the provided tag to the bucket. +// +// The following operations are related to PutBucketTagging: +// +// * GetBucketTagging +// +// * DeleteBucketTagging +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -6067,6 +8159,38 @@ func (c *S3) PutBucketVersioningRequest(input *PutBucketVersioningInput) (req *r // Sets the versioning state of an existing bucket. To set the versioning state, // you must be the bucket owner. // +// You can set the versioning state with one of the following values: +// +// Enabled—Enables versioning for the objects in the bucket. All objects added +// to the bucket receive a unique version ID. +// +// Suspended—Disables versioning for the objects in the bucket. All objects +// added to the bucket receive the version ID null. +// +// If the versioning state has never been set on a bucket, it has no versioning +// state; a GetBucketVersioning request does not return a versioning state value. +// +// If the bucket owner enables MFA Delete in the bucket versioning configuration, +// the bucket owner must include the x-amz-mfa request header and the Status +// and the MfaDelete request elements in a request to set the versioning state +// of the bucket. +// +// If you have an object expiration lifecycle policy in your non-versioned bucket +// and you want to maintain the same permanent delete behavior when you enable +// versioning, you must add a noncurrent expiration policy. The noncurrent expiration +// lifecycle policy will manage the deletes of the noncurrent object versions +// in the version-enabled bucket. (A version-enabled bucket maintains one current +// and zero or more noncurrent object versions.) For more information, see Lifecycle +// and Versioning (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-and-other-bucket-config). +// +// Related Resources +// +// * CreateBucket +// +// * DeleteBucket +// +// * GetBucketVersioning +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -6140,7 +8264,67 @@ func (c *S3) PutBucketWebsiteRequest(input *PutBucketWebsiteInput) (req *request // PutBucketWebsite API operation for Amazon Simple Storage Service. // -// Set the website configuration for a bucket. +// Sets the configuration of the website that is specified in the website subresource. +// To configure a bucket as a website, you can add this subresource on the bucket +// with website configuration information such as the file name of the index +// document and any redirect rules. For more information, see Hosting Websites +// on Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html). +// +// This PUT operation requires the S3:PutBucketWebsite permission. By default, +// only the bucket owner can configure the website attached to a bucket; however, +// bucket owners can allow other users to set the website configuration by writing +// a bucket policy that grants them the S3:PutBucketWebsite permission. +// +// To redirect all website requests sent to the bucket's website endpoint, you +// add a website configuration with the following elements. Because all requests +// are sent to another website, you don't need to provide index document name +// for the bucket. +// +// * WebsiteConfiguration +// +// * RedirectAllRequestsTo +// +// * HostName +// +// * Protocol +// +// If you want granular control over redirects, you can use the following elements +// to add routing rules that describe conditions for redirecting requests and +// information about the redirect destination. In this case, the website configuration +// must provide an index document for the bucket, because some requests might +// not be redirected. +// +// * WebsiteConfiguration +// +// * IndexDocument +// +// * Suffix +// +// * ErrorDocument +// +// * Key +// +// * RoutingRules +// +// * RoutingRule +// +// * Condition +// +// * HttpErrorCodeReturnedEquals +// +// * KeyPrefixEquals +// +// * Redirect +// +// * Protocol +// +// * HostName +// +// * ReplaceKeyPrefixWith +// +// * ReplaceKeyWith +// +// * HttpRedirectCode // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6214,7 +8398,179 @@ func (c *S3) PutObjectRequest(input *PutObjectInput) (req *request.Request, outp // PutObject API operation for Amazon Simple Storage Service. // -// Adds an object to a bucket. +// Adds an object to a bucket. You must have WRITE permissions on a bucket to +// add an object to it. +// +// Amazon S3 never adds partial objects; if you receive a success response, +// Amazon S3 added the entire object to the bucket. +// +// Amazon S3 is a distributed system. If it receives multiple write requests +// for the same object simultaneously, it overwrites all but the last object +// written. Amazon S3 does not provide object locking; if you need this, make +// sure to build it into your application layer or use versioning instead. +// +// To ensure that data is not corrupted traversing the network, use the Content-MD5 +// header. When you use this header, Amazon S3 checks the object against the +// provided MD5 value and, if they do not match, returns an error. Additionally, +// you can calculate the MD5 while putting an object to Amazon S3 and compare +// the returned ETag to the calculated MD5 value. +// +// To configure your application to send the request headers before sending +// the request body, use the 100-continue HTTP status code. For PUT operations, +// this helps you avoid sending the message body if the message is rejected +// based on the headers (for example, because authentication fails or a redirect +// occurs). For more information on the 100-continue HTTP status code, see Section +// 8.2.3 of http://www.ietf.org/rfc/rfc2616.txt (http://www.ietf.org/rfc/rfc2616.txt). +// +// You can optionally request server-side encryption. With server-side encryption, +// Amazon S3 encrypts your data as it writes it to disks in its data centers +// and decrypts the data when you access it. You have the option to provide +// your own encryption key or use AWS managed encryption keys. For more information, +// see Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html). +// +// Access Permissions +// +// You can optionally specify the accounts or groups that should be granted +// specific permissions on the new object. There are two ways to grant the permissions +// using the request headers: +// +// * Specify a canned ACL with the x-amz-acl request header. For more information, +// see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). +// +// * Specify access permissions explicitly with the x-amz-grant-read, x-amz-grant-read-acp, +// x-amz-grant-write-acp, and x-amz-grant-full-control headers. These parameters +// map to the set of permissions that Amazon S3 supports in an ACL. For more +// information, see Access Control List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html). +// +// You can use either a canned ACL or specify access permissions explicitly. +// You cannot do both. +// +// Server-Side- Encryption-Specific Request Headers +// +// You can optionally tell Amazon S3 to encrypt data at rest using server-side +// encryption. Server-side encryption is for data encryption at rest. Amazon +// S3 encrypts your data as it writes it to disks in its data centers and decrypts +// it when you access it. The option you use depends on whether you want to +// use AWS managed encryption keys or provide your own encryption key. +// +// * Use encryption keys managed by Amazon S3 or customer master keys (CMKs) +// stored in AWS Key Management Service (AWS KMS) – If you want AWS to +// manage the keys used to encrypt data, specify the following headers in +// the request. x-amz-server-side​-encryption x-amz-server-side-encryption-aws-kms-key-id +// x-amz-server-side-encryption-context If you specify x-amz-server-side-encryption:aws:kms, +// but don't provide x-amz-server-side-encryption-aws-kms-key-id, Amazon +// S3 uses the AWS managed CMK in AWS KMS to protect the data. If you want +// to use a customer managed AWS KMS CMK, you must provide the x-amz-server-side-encryption-aws-kms-key-id +// of the symmetric customer managed CMK. Amazon S3 only supports symmetric +// CMKs and not asymmetric CMKs. For more information, see Using Symmetric +// and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the AWS Key Management Service Developer Guide. All GET and PUT requests +// for an object protected by AWS KMS fail if you don't make them with SSL +// or by using SigV4. For more information about server-side encryption with +// CMKs stored in AWS KMS (SSE-KMS), see Protecting Data Using Server-Side +// Encryption with CMKs stored in AWS (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). +// +// * Use customer-provided encryption keys – If you want to manage your +// own encryption keys, provide all the following headers in the request. +// x-amz-server-side​-encryption​-customer-algorithm x-amz-server-side​-encryption​-customer-key +// x-amz-server-side​-encryption​-customer-key-MD5 For more information +// about server-side encryption with CMKs stored in KMS (SSE-KMS), see Protecting +// Data Using Server-Side Encryption with CMKs stored in AWS (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). +// +// Access-Control-List (ACL)-Specific Request Headers +// +// You also can use the following access control–related headers with this +// operation. By default, all objects are private. Only the owner has full access +// control. When adding a new object, you can grant permissions to individual +// AWS accounts or to predefined groups defined by Amazon S3. These permissions +// are then added to the Access Control List (ACL) on the object. For more information, +// see Using ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html). +// With this operation, you can grant access permissions using one of the following +// two methods: +// +// * Specify a canned ACL (x-amz-acl) — Amazon S3 supports a set of predefined +// ACLs, known as canned ACLs. Each canned ACL has a predefined set of grantees +// and permissions. For more information, see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). +// +// * Specify access permissions explicitly — To explicitly grant access +// permissions to specific AWS accounts or groups, use the following headers. +// Each header maps to specific permissions that Amazon S3 supports in an +// ACL. For more information, see Access Control List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html). +// In the header, you specify a list of grantees who get the specific permission. +// To grant permissions explicitly use: x-amz-grant-read x-amz-grant-write +// x-amz-grant-read-acp x-amz-grant-write-acp x-amz-grant-full-control You +// specify each grantee as a type=value pair, where the type is one of the +// following: emailAddress – if the value specified is the email address +// of an AWS account Using email addresses to specify a grantee is only supported +// in the following AWS Regions: US East (N. Virginia) US West (N. California) +// US West (Oregon) Asia Pacific (Singapore) Asia Pacific (Sydney) Asia Pacific +// (Tokyo) EU (Ireland) South America (São Paulo) For a list of all the +// Amazon S3 supported Regions and endpoints, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) +// in the AWS General Reference id – if the value specified is the canonical +// user ID of an AWS account uri – if you are granting permissions to a +// predefined group For example, the following x-amz-grant-read header grants +// the AWS accounts identified by email addresses permissions to read object +// data and its metadata: x-amz-grant-read: emailAddress="xyz@amazon.com", +// emailAddress="abc@amazon.com" +// +// Server-Side- Encryption-Specific Request Headers +// +// You can optionally tell Amazon S3 to encrypt data at rest using server-side +// encryption. Server-side encryption is for data encryption at rest. Amazon +// S3 encrypts your data as it writes it to disks in its data centers and decrypts +// it when you access it. The option you use depends on whether you want to +// use AWS-managed encryption keys or provide your own encryption key. +// +// * Use encryption keys managed by Amazon S3 or customer master keys (CMKs) +// stored in AWS Key Management Service (AWS KMS) – If you want AWS to +// manage the keys used to encrypt data, specify the following headers in +// the request. x-amz-server-side​-encryption x-amz-server-side-encryption-aws-kms-key-id +// x-amz-server-side-encryption-context If you specify x-amz-server-side-encryption:aws:kms, +// but don't provide x-amz-server-side-encryption-aws-kms-key-id, Amazon +// S3 uses the AWS managed CMK in AWS KMS to protect the data. If you want +// to use a customer managed AWS KMS CMK, you must provide the x-amz-server-side-encryption-aws-kms-key-id +// of the symmetric customer managed CMK. Amazon S3 only supports symmetric +// CMKs and not asymmetric CMKs. For more information, see Using Symmetric +// and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) +// in the AWS Key Management Service Developer Guide. All GET and PUT requests +// for an object protected by AWS KMS fail if you don't make them with SSL +// or by using SigV4. For more information about server-side encryption with +// CMKs stored in AWS KMS (SSE-KMS), see Protecting Data Using Server-Side +// Encryption with CMKs stored in AWS KMS (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). +// +// * Use customer-provided encryption keys – If you want to manage your +// own encryption keys, provide all the following headers in the request. +// If you use this feature, the ETag value that Amazon S3 returns in the +// response is not the MD5 of the object. x-amz-server-side​-encryption​-customer-algorithm +// x-amz-server-side​-encryption​-customer-key x-amz-server-side​-encryption​-customer-key-MD5 +// For more information about server-side encryption with CMKs stored in +// AWS KMS (SSE-KMS), see Protecting Data Using Server-Side Encryption with +// CMKs stored in AWS KMS (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). +// +// Storage Class Options +// +// By default, Amazon S3 uses the Standard storage class to store newly created +// objects. The Standard storage class provides high durability and high availability. +// You can specify other storage classes depending on the performance needs. +// For more information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// Versioning +// +// If you enable versioning for a bucket, Amazon S3 automatically generates +// a unique version ID for the object being stored. Amazon S3 returns this ID +// in the response using the x-amz-version-id response header. If versioning +// is suspended, Amazon S3 always uses null as the version ID for the object +// stored. For more information about returning the versioning state of a bucket, +// see GetBucketVersioning. If you enable versioning for a bucket, when Amazon +// S3 receives multiple write requests for the same object simultaneously, it +// stores all of the objects. +// +// Related Resources +// +// * CopyObject +// +// * DeleteObject // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6288,8 +8644,73 @@ func (c *S3) PutObjectAclRequest(input *PutObjectAclInput) (req *request.Request // PutObjectAcl API operation for Amazon Simple Storage Service. // -// uses the acl subresource to set the access control list (ACL) permissions -// for an object that already exists in a bucket +// Uses the acl subresource to set the access control list (ACL) permissions +// for an object that already exists in a bucket. You must have WRITE_ACP permission +// to set the ACL of an object. +// +// Depending on your application needs, you can choose to set the ACL on an +// object using either the request body or the headers. For example, if you +// have an existing application that updates a bucket ACL using the request +// body, you can continue to use that approach. +// +// Access Permissions +// +// You can set access permissions using one of the following methods: +// +// * Specify a canned ACL with the x-amz-acl request header. Amazon S3 supports +// a set of predefined ACLs, known as canned ACLs. Each canned ACL has a +// predefined set of grantees and permissions. Specify the canned ACL name +// as the value of x-amz-acl. If you use this header, you cannot use other +// access control-specific headers in your request. For more information, +// see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). +// +// * Specify access permissions explicitly with the x-amz-grant-read, x-amz-grant-read-acp, +// x-amz-grant-write-acp, and x-amz-grant-full-control headers. When using +// these headers, you specify explicit access permissions and grantees (AWS +// accounts or Amazon S3 groups) who will receive the permission. If you +// use these ACL-specific headers, you cannot use x-amz-acl header to set +// a canned ACL. These parameters map to the set of permissions that Amazon +// S3 supports in an ACL. For more information, see Access Control List (ACL) +// Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html). +// You specify each grantee as a type=value pair, where the type is one of +// the following: emailAddress – if the value specified is the email address +// of an AWS account id – if the value specified is the canonical user +// ID of an AWS account uri – if you are granting permissions to a predefined +// group For example, the following x-amz-grant-read header grants list objects +// permission to the two AWS accounts identified by their email addresses. +// x-amz-grant-read: emailAddress="xyz@amazon.com", emailAddress="abc@amazon.com" +// +// You can use either a canned ACL or specify access permissions explicitly. +// You cannot do both. +// +// Grantee Values +// +// You can specify the person (grantee) to whom you're assigning access rights +// (using request elements) in the following ways: +// +// * By Email address: <>Grantees@email.com<>lt;/Grantee> +// The grantee is resolved to the CanonicalUser and, in a response to a GET +// Object acl request, appears as the CanonicalUser. +// +// * By the person's ID: <>ID<><>GranteesEmail<> +// DisplayName is optional and ignored in the request. +// +// * By URI: <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> +// +// Versioning +// +// The ACL of an object is set at the object version level. By default, PUT +// sets the ACL of the current version of an object. To set the ACL of a different +// version, use the versionId subresource. +// +// Related Resources +// +// * CopyObject +// +// * GetObject // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6370,6 +8791,10 @@ func (c *S3) PutObjectLegalHoldRequest(input *PutObjectLegalHoldInput) (req *req // // Applies a Legal Hold configuration to the specified object. // +// Related Resources +// +// * Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.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. @@ -6442,10 +8867,17 @@ func (c *S3) PutObjectLockConfigurationRequest(input *PutObjectLockConfiguration // PutObjectLockConfiguration API operation for Amazon Simple Storage Service. // -// Places an object lock configuration on the specified bucket. The rule specified -// in the object lock configuration will be applied by default to every new +// Places an Object Lock configuration on the specified bucket. The rule specified +// in the Object Lock configuration will be applied by default to every new // object placed in the specified bucket. // +// DefaultRetention requires either Days or Years. You can't specify both at +// the same time. +// +// Related Resources +// +// * Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.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. @@ -6520,6 +8952,10 @@ func (c *S3) PutObjectRetentionRequest(input *PutObjectRetentionInput) (req *req // // Places an Object Retention configuration on an object. // +// Related Resources +// +// * Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.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. @@ -6594,6 +9030,43 @@ func (c *S3) PutObjectTaggingRequest(input *PutObjectTaggingInput) (req *request // // Sets the supplied tag-set to an object that already exists in a bucket // +// A tag is a key-value pair. You can associate tags with an object by sending +// a PUT request against the tagging subresource that is associated with the +// object. You can retrieve tags by sending a GET request. For more information, +// see GetObjectTagging. +// +// For tagging-related restrictions related to characters and encodings, see +// Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html). +// Note that Amazon S3 limits the maximum number of tags to 10 tags per object. +// +// To use this operation, you must have permission to perform the s3:PutObjectTagging +// action. By default, the bucket owner has this permission and can grant this +// permission to others. +// +// To put tags of any other version, use the versionId query parameter. You +// also need permission for the s3:PutObjectVersionTagging action. +// +// For information about the Amazon S3 object tagging feature, see Object Tagging +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html). +// +// Special Errors +// +// * Code: InvalidTagError Cause: The tag provided was not a valid tag. This +// error can occur if the tag did not pass input validation. For more information, +// see Object Tagging (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html). +// +// * Code: MalformedXMLError Cause: The XML provided does not match the schema. +// +// * Code: OperationAbortedError Cause: A conflicting conditional operation +// is currently in progress against this resource. Please try again. +// +// * Code: InternalError Cause: The service was unable to apply the provided +// tag to the object. +// +// Related Resources +// +// * GetObjectTagging +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -6668,7 +9141,29 @@ func (c *S3) PutPublicAccessBlockRequest(input *PutPublicAccessBlockInput) (req // PutPublicAccessBlock API operation for Amazon Simple Storage Service. // // Creates or modifies the PublicAccessBlock configuration for an Amazon S3 -// bucket. +// bucket. To use this operation, you must have the s3:PutBucketPublicAccessBlock +// permission. For more information about Amazon S3 permissions, see Specifying +// Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html). +// +// When Amazon S3 evaluates the PublicAccessBlock configuration for a bucket +// or an object, it checks the PublicAccessBlock configuration for both the +// bucket (or the bucket that contains the object) and the bucket owner's account. +// If the PublicAccessBlock configurations are different between the bucket +// and the account, Amazon S3 uses the most restrictive combination of the bucket-level +// and account-level settings. +// +// For more information about when Amazon S3 considers a bucket or an object +// public, see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status). +// +// Related Resources +// +// * GetPublicAccessBlock +// +// * DeletePublicAccessBlock +// +// * GetBucketPolicyStatus +// +// * Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.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 @@ -6744,6 +9239,190 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque // // Restores an archived copy of an object back into Amazon S3 // +// This operation performs the following types of requests: +// +// * select - Perform a select query on an archived object +// +// * restore an archive - Restore an archived object +// +// To use this operation, you must have permissions to perform the s3:RestoreObject +// and s3:GetObject actions. The bucket owner has this permission by default +// and can grant this permission to others. For more information about permissions, +// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) +// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// Querying Archives with Select Requests +// +// You use a select type of request to perform SQL queries on archived objects. +// The archived objects that are being queried by the select request must be +// formatted as uncompressed comma-separated values (CSV) files. You can run +// queries and custom analytics on your archived data without having to restore +// your data to a hotter Amazon S3 tier. For an overview about select requests, +// see Querying Archived Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/querying-glacier-archives.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// When making a select request, do the following: +// +// * Define an output location for the select query's output. This must be +// an Amazon S3 bucket in the same AWS Region as the bucket that contains +// the archive object that is being queried. The AWS account that initiates +// the job must have permissions to write to the S3 bucket. You can specify +// the storage class and encryption for the output objects stored in the +// bucket. For more information about output, see Querying Archived Objects +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/querying-glacier-archives.html) +// in the Amazon Simple Storage Service Developer Guide. For more information +// about the S3 structure in the request body, see the following: PutObject +// Managing Access with ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html) +// in the Amazon Simple Storage Service Developer Guide Protecting Data Using +// Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) +// in the Amazon Simple Storage Service Developer Guide +// +// * Define the SQL expression for the SELECT type of restoration for your +// query in the request body's SelectParameters structure. You can use expressions +// like the following examples. The following expression returns all records +// from the specified object. SELECT * FROM Object Assuming that you are +// not using any headers for data stored in the object, you can specify columns +// with positional headers. SELECT s._1, s._2 FROM Object s WHERE s._3 > +// 100 If you have headers and you set the fileHeaderInfo in the CSV structure +// in the request body to USE, you can specify headers in the query. (If +// you set the fileHeaderInfo field to IGNORE, the first row is skipped for +// the query.) You cannot mix ordinal positions with header column names. +// SELECT s.Id, s.FirstName, s.SSN FROM S3Object s +// +// For more information about using SQL with Glacier Select restore, see SQL +// Reference for Amazon S3 Select and Glacier Select (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-glacier-select-sql-reference.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// When making a select request, you can also do the following: +// +// * To expedite your queries, specify the Expedited tier. For more information +// about tiers, see "Restoring Archives," later in this topic. +// +// * Specify details about the data serialization format of both the input +// object that is being queried and the serialization of the CSV-encoded +// query results. +// +// The following are additional important facts about the select feature: +// +// * The output results are new Amazon S3 objects. Unlike archive retrievals, +// they are stored until explicitly deleted-manually or through a lifecycle +// policy. +// +// * You can issue more than one select request on the same Amazon S3 object. +// Amazon S3 doesn't deduplicate requests, so avoid issuing duplicate requests. +// +// * Amazon S3 accepts a select request even if the object has already been +// restored. A select request doesn’t return error response 409. +// +// Restoring Archives +// +// Objects in the GLACIER and DEEP_ARCHIVE storage classes are archived. To +// access an archived object, you must first initiate a restore request. This +// restores a temporary copy of the archived object. In a restore request, you +// specify the number of days that you want the restored copy to exist. After +// the specified period, Amazon S3 deletes the temporary copy but the object +// remains archived in the GLACIER or DEEP_ARCHIVE storage class that object +// was restored from. +// +// To restore a specific object version, you can provide a version ID. If you +// don't provide a version ID, Amazon S3 restores the current version. +// +// The time it takes restore jobs to finish depends on which storage class the +// object is being restored from and which data access tier you specify. +// +// When restoring an archived object (or using a select request), you can specify +// one of the following data access tier options in the Tier element of the +// request body: +// +// * Expedited - Expedited retrievals allow you to quickly access your data +// stored in the GLACIER storage class when occasional urgent requests for +// a subset of archives are required. For all but the largest archived objects +// (250 MB+), data accessed using Expedited retrievals are typically made +// available within 1–5 minutes. Provisioned capacity ensures that retrieval +// capacity for Expedited retrievals is available when you need it. Expedited +// retrievals and provisioned capacity are not available for the DEEP_ARCHIVE +// storage class. +// +// * Standard - Standard retrievals allow you to access any of your archived +// objects within several hours. This is the default option for the GLACIER +// and DEEP_ARCHIVE retrieval requests that do not specify the retrieval +// option. Standard retrievals typically complete within 3-5 hours from the +// GLACIER storage class and typically complete within 12 hours from the +// DEEP_ARCHIVE storage class. +// +// * Bulk - Bulk retrievals are Amazon S3 Glacier’s lowest-cost retrieval +// option, enabling you to retrieve large amounts, even petabytes, of data +// inexpensively in a day. Bulk retrievals typically complete within 5-12 +// hours from the GLACIER storage class and typically complete within 48 +// hours from the DEEP_ARCHIVE storage class. +// +// For more information about archive retrieval options and provisioned capacity +// for Expedited data access, see Restoring Archived Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// You can use Amazon S3 restore speed upgrade to change the restore speed to +// a faster speed while it is in progress. You upgrade the speed of an in-progress +// restoration by issuing another restore request to the same object, setting +// a new Tier request element. When issuing a request to upgrade the restore +// tier, you must choose a tier that is faster than the tier that the in-progress +// restore is using. You must not change any other parameters, such as the Days +// request element. For more information, see Upgrading the Speed of an In-Progress +// Restore (https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html#restoring-objects-upgrade-tier.title.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// To get the status of object restoration, you can send a HEAD request. Operations +// return the x-amz-restore header, which provides information about the restoration +// status, in the response. You can use Amazon S3 event notifications to notify +// you when a restore is initiated or completed. For more information, see Configuring +// Amazon S3 Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// After restoring an archived object, you can update the restoration period +// by reissuing the request with a new period. Amazon S3 updates the restoration +// period relative to the current time and charges only for the request-there +// are no data transfer charges. You cannot update the restoration period when +// Amazon S3 is actively processing your current restore request for the object. +// +// If your bucket has a lifecycle configuration with a rule that includes an +// expiration action, the object expiration overrides the life span that you +// specify in a restore request. For example, if you restore an object copy +// for 10 days, but the object is scheduled to expire in 3 days, Amazon S3 deletes +// the object in 3 days. For more information about lifecycle configuration, +// see PutBucketLifecycleConfiguration and Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) +// in Amazon Simple Storage Service Developer Guide. +// +// Responses +// +// A successful operation returns either the 200 OK or 202 Accepted status code. +// +// * If the object copy is not previously restored, then Amazon S3 returns +// 202 Accepted in the response. +// +// * If the object copy is previously restored, Amazon S3 returns 200 OK +// in the response. +// +// Special Errors +// +// * Code: RestoreAlreadyInProgress Cause: Object restore is already in progress. +// (This error does not apply to SELECT type requests.) HTTP Status Code: +// 409 Conflict SOAP Fault Code Prefix: Client +// +// * Code: GlacierExpeditedRetrievalNotAvailable Cause: Glacier expedited +// retrievals are currently not available. Try again later. (Returned if +// there is insufficient capacity to process the Expedited request. This +// error applies only to Expedited retrievals and not to Standard or Bulk +// retrievals.) HTTP Status Code: 503 SOAP Fault Code Prefix: N/A +// +// Related Resources +// +// * PutBucketLifecycleConfiguration +// +// * GetBucketNotificationConfiguration +// +// * SQL Reference for Amazon S3 Select and Glacier Select (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-glacier-select-sql-reference.html) +// in the Amazon Simple Storage 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. @@ -6753,7 +9432,7 @@ func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Reque // // Returned Error Codes: // * ErrCodeObjectAlreadyInActiveTierError "ObjectAlreadyInActiveTierError" -// This operation is not allowed against this storage tier +// This operation is not allowed against this storage tier. // // See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObject func (c *S3) RestoreObject(input *RestoreObjectInput) (*RestoreObjectOutput, error) { @@ -6816,20 +9495,104 @@ func (c *S3) SelectObjectContentRequest(input *SelectObjectContentInput) (req *r output = &SelectObjectContentOutput{} req = c.newRequest(op, input, output) + + es := newSelectObjectContentEventStream() + req.Handlers.Unmarshal.PushBack(es.setStreamCloser) + output.EventStream = es + req.Handlers.Send.Swap(client.LogHTTPResponseHandler.Name, client.LogHTTPResponseHeaderHandler) req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, rest.UnmarshalHandler) - req.Handlers.Unmarshal.PushBack(output.runEventStreamLoop) + req.Handlers.Unmarshal.PushBack(es.runOutputStream) + req.Handlers.Unmarshal.PushBack(es.runOnStreamPartClose) return } // SelectObjectContent API operation for Amazon Simple Storage Service. // // This operation filters the contents of an Amazon S3 object based on a simple -// Structured Query Language (SQL) statement. In the request, along with the -// SQL expression, you must also specify a data serialization format (JSON or -// CSV) of the object. Amazon S3 uses this to parse object data into records, -// and returns only records that match the specified SQL expression. You must -// also specify the data serialization format for the response. +// structured query language (SQL) statement. In the request, along with the +// SQL expression, you must also specify a data serialization format (JSON, +// CSV, or Apache Parquet) of the object. Amazon S3 uses this format to parse +// object data into records, and returns only records that match the specified +// SQL expression. You must also specify the data serialization format for the +// response. +// +// For more information about Amazon S3 Select, see Selecting Content from Objects +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/selecting-content-from-objects.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// For more information about using SQL with Amazon S3 Select, see SQL Reference +// for Amazon S3 Select and Glacier Select (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-glacier-select-sql-reference.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// Permissions +// +// You must have s3:GetObject permission for this operation. Amazon S3 Select +// does not support anonymous access. For more information about permissions, +// see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// Object Data Formats +// +// You can use Amazon S3 Select to query objects that have the following format +// properties: +// +// * CSV, JSON, and Parquet - Objects must be in CSV, JSON, or Parquet format. +// +// * UTF-8 - UTF-8 is the only encoding type Amazon S3 Select supports. +// +// * GZIP or BZIP2 - CSV and JSON files can be compressed using GZIP or BZIP2. +// GZIP and BZIP2 are the only compression formats that Amazon S3 Select +// supports for CSV and JSON files. Amazon S3 Select supports columnar compression +// for Parquet using GZIP or Snappy. Amazon S3 Select does not support whole-object +// compression for Parquet objects. +// +// * Server-side encryption - Amazon S3 Select supports querying objects +// that are protected with server-side encryption. For objects that are encrypted +// with customer-provided encryption keys (SSE-C), you must use HTTPS, and +// you must use the headers that are documented in the GetObject. For more +// information about SSE-C, see Server-Side Encryption (Using Customer-Provided +// Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) +// in the Amazon Simple Storage Service Developer Guide. For objects that +// are encrypted with Amazon S3 managed encryption keys (SSE-S3) and customer +// master keys (CMKs) stored in AWS Key Management Service (SSE-KMS), server-side +// encryption is handled transparently, so you don't need to specify anything. +// For more information about server-side encryption, including SSE-S3 and +// SSE-KMS, see Protecting Data Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// Working with the Response Body +// +// Given the response size is unknown, Amazon S3 Select streams the response +// as a series of messages and includes a Transfer-Encoding header with chunked +// as its value in the response. For more information, see RESTSelectObjectAppendix . +// +// GetObject Support +// +// The SelectObjectContent operation does not support the following GetObject +// functionality. For more information, see GetObject. +// +// * Range: While you can specify a scan range for a Amazon S3 Select request, +// see SelectObjectContentRequest$ScanRange in the request parameters below, +// you cannot specify the range of bytes of an object to return. +// +// * GLACIER, DEEP_ARCHIVE and REDUCED_REDUNDANCY storage classes: You cannot +// specify the GLACIER, DEEP_ARCHIVE, or REDUCED_REDUNDANCY storage classes. +// For more information, about storage classes see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#storage-class-intro) +// in the Amazon Simple Storage Service Developer Guide. +// +// Special Errors +// +// For a list of special errors for this operation and for general information +// about Amazon S3 errors and a list of error codes, see ErrorResponses +// +// Related Resources +// +// * GetObject +// +// * GetBucketLifecycleConfiguration +// +// * PutBucketLifecycleConfiguration // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -6859,6 +9622,147 @@ func (c *S3) SelectObjectContentWithContext(ctx aws.Context, input *SelectObject return out, req.Send() } +// SelectObjectContentEventStream provides the event stream handling for the SelectObjectContent. +type SelectObjectContentEventStream struct { + + // Reader is the EventStream reader for the SelectObjectContentEventStream + // events. This value is automatically set by the SDK when the API call is made + // Use this member when unit testing your code with the SDK to mock out the + // EventStream Reader. + // + // Must not be nil. + Reader SelectObjectContentEventStreamReader + + outputReader io.ReadCloser + + // StreamCloser is the io.Closer for the EventStream connection. For HTTP + // EventStream this is the response Body. The stream will be closed when + // the Close method of the EventStream is called. + StreamCloser io.Closer + + done chan struct{} + closeOnce sync.Once + err *eventstreamapi.OnceError +} + +func newSelectObjectContentEventStream() *SelectObjectContentEventStream { + return &SelectObjectContentEventStream{ + done: make(chan struct{}), + err: eventstreamapi.NewOnceError(), + } +} + +func (es *SelectObjectContentEventStream) setStreamCloser(r *request.Request) { + es.StreamCloser = r.HTTPResponse.Body +} + +func (es *SelectObjectContentEventStream) runOnStreamPartClose(r *request.Request) { + if es.done == nil { + return + } + go es.waitStreamPartClose() + +} + +func (es *SelectObjectContentEventStream) waitStreamPartClose() { + var outputErrCh <-chan struct{} + if v, ok := es.Reader.(interface{ ErrorSet() <-chan struct{} }); ok { + outputErrCh = v.ErrorSet() + } + var outputClosedCh <-chan struct{} + if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok { + outputClosedCh = v.Closed() + } + + select { + case <-es.done: + case <-outputErrCh: + es.err.SetError(es.Reader.Err()) + es.Close() + case <-outputClosedCh: + if err := es.Reader.Err(); err != nil { + es.err.SetError(es.Reader.Err()) + } + es.Close() + } +} + +// Events returns a channel to read events from. +// +// These events are: +// +// * ContinuationEvent +// * EndEvent +// * ProgressEvent +// * RecordsEvent +// * StatsEvent +func (es *SelectObjectContentEventStream) Events() <-chan SelectObjectContentEventStreamEvent { + return es.Reader.Events() +} + +func (es *SelectObjectContentEventStream) runOutputStream(r *request.Request) { + var opts []func(*eventstream.Decoder) + if r.Config.Logger != nil && r.Config.LogLevel.Matches(aws.LogDebugWithEventStreamBody) { + opts = append(opts, eventstream.DecodeWithLogger(r.Config.Logger)) + } + + unmarshalerForEvent := unmarshalerForSelectObjectContentEventStreamEvent{ + metadata: protocol.ResponseMetadata{ + StatusCode: r.HTTPResponse.StatusCode, + RequestID: r.RequestID, + }, + }.UnmarshalerForEventName + + decoder := eventstream.NewDecoder(r.HTTPResponse.Body, opts...) + eventReader := eventstreamapi.NewEventReader(decoder, + protocol.HandlerPayloadUnmarshal{ + Unmarshalers: r.Handlers.UnmarshalStream, + }, + unmarshalerForEvent, + ) + + es.outputReader = r.HTTPResponse.Body + es.Reader = newReadSelectObjectContentEventStream(eventReader) +} + +// Close closes the stream. This will also cause the stream to be closed. +// Close must be called when done using the stream API. Not calling Close +// may result in resource leaks. +// +// You can use the closing of the Reader's Events channel to terminate your +// application's read from the API's stream. +// +func (es *SelectObjectContentEventStream) Close() (err error) { + es.closeOnce.Do(es.safeClose) + return es.Err() +} + +func (es *SelectObjectContentEventStream) safeClose() { + if es.done != nil { + close(es.done) + } + + es.Reader.Close() + if es.outputReader != nil { + es.outputReader.Close() + } + + es.StreamCloser.Close() +} + +// Err returns any error that occurred while reading or writing EventStream +// Events from the service API's response. Returns nil if there were no errors. +func (es *SelectObjectContentEventStream) Err() error { + if err := es.err.Err(); err != nil { + return err + } + if err := es.Reader.Err(); err != nil { + return err + } + + return nil +} + const opUploadPart = "UploadPart" // UploadPartRequest generates a "aws/request.Request" representing the @@ -6905,12 +9809,87 @@ func (c *S3) UploadPartRequest(input *UploadPartInput) (req *request.Request, ou // // Uploads a part in a multipart upload. // +// In this operation, you provide part data in your request. However, you have +// an option to specify your existing Amazon S3 object as a data source for +// the part you are uploading. To upload a part from an existing object, you +// use the UploadPartCopy operation. +// +// You must initiate a multipart upload (see CreateMultipartUpload) before you +// can upload any part. In response to your initiate request, Amazon S3 returns +// an upload ID, a unique identifier, that you must include in your upload part +// request. +// +// Part numbers can be any number from 1 to 10,000, inclusive. A part number +// uniquely identifies a part and also defines its position within the object +// being created. If you upload a new part using the same part number that was +// used with a previous part, the previously uploaded part is overwritten. Each +// part must be at least 5 MB in size, except the last part. There is no size +// limit on the last part of your multipart upload. +// +// To ensure that data is not corrupted when traversing the network, specify +// the Content-MD5 header in the upload part request. Amazon S3 checks the part +// data against the provided MD5 value. If they do not match, Amazon S3 returns +// an error. +// // Note: After you initiate multipart upload and upload one or more parts, you // must either complete or abort multipart upload in order to stop getting charged // for storage of the uploaded parts. Only after you either complete or abort // multipart upload, Amazon S3 frees up the parts storage and stops charging // you for the parts storage. // +// For more information on multipart uploads, go to Multipart Upload Overview +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html) in the +// Amazon Simple Storage Service Developer Guide . +// +// For information on the permissions required to use the multipart upload API, +// go to Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// You can optionally request server-side encryption where Amazon S3 encrypts +// your data as it writes it to disks in its data centers and decrypts it for +// you when you access it. You have the option of providing your own encryption +// key, or you can use the AWS managed encryption keys. If you choose to provide +// your own encryption key, the request headers you provide in the request must +// match the headers you used in the request to initiate the upload by using +// CreateMultipartUpload. For more information, go to Using Server-Side Encryption +// (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// Server-side encryption is supported by the S3 Multipart Upload actions. Unless +// you are using a customer-provided encryption key, you don't need to specify +// the encryption parameters in each UploadPart request. Instead, you only need +// to specify the server-side encryption parameters in the initial Initiate +// Multipart request. For more information, see CreateMultipartUpload. +// +// If you requested server-side encryption using a customer-provided encryption +// key in your initiate multipart upload request, you must provide identical +// encryption information in each part upload using the following headers. +// +// * x-amz-server-side​-encryption​-customer-algorithm +// +// * x-amz-server-side​-encryption​-customer-key +// +// * x-amz-server-side​-encryption​-customer-key-MD5 +// +// Special Errors +// +// * Code: NoSuchUpload Cause: The specified multipart upload does not exist. +// The upload ID might be invalid, or the multipart upload might have been +// aborted or completed. HTTP Status Code: 404 Not Found SOAP Fault Code +// Prefix: Client +// +// Related Resources +// +// * CreateMultipartUpload +// +// * CompleteMultipartUpload +// +// * AbortMultipartUpload +// +// * ListParts +// +// * ListMultipartUploads +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -6983,7 +9962,94 @@ func (c *S3) UploadPartCopyRequest(input *UploadPartCopyInput) (req *request.Req // UploadPartCopy API operation for Amazon Simple Storage Service. // -// Uploads a part by copying data from an existing object as data source. +// Uploads a part by copying data from an existing object as data source. You +// specify the data source by adding the request header x-amz-copy-source in +// your request and a byte range by adding the request header x-amz-copy-source-range +// in your request. +// +// The minimum allowable part size for a multipart upload is 5 MB. For more +// information about multipart upload limits, go to Quick Facts (https://docs.aws.amazon.com/AmazonS3/latest/dev/qfacts.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// Instead of using an existing object as part data, you might use the UploadPart +// operation and provide data in your request. +// +// You must initiate a multipart upload before you can upload any part. In response +// to your initiate request. Amazon S3 returns a unique identifier, the upload +// ID, that you must include in your upload part request. +// +// For more information about using the UploadPartCopy operation, see the following: +// +// * For conceptual information about multipart uploads, see Uploading Objects +// Using Multipart Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// * For information about permissions required to use the multipart upload +// API, see Multipart Upload API and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// * For information about copying objects using a single atomic operation +// vs. the multipart upload, see Operations on Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectOperations.html) +// in the Amazon Simple Storage Service Developer Guide. +// +// * For information about using server-side encryption with customer-provided +// encryption keys with the UploadPartCopy operation, see CopyObject and +// UploadPart. +// +// Note the following additional considerations about the request headers x-amz-copy-source-if-match, +// x-amz-copy-source-if-none-match, x-amz-copy-source-if-unmodified-since, and +// x-amz-copy-source-if-modified-since: +// +// * Consideration 1 - If both of the x-amz-copy-source-if-match and x-amz-copy-source-if-unmodified-since +// headers are present in the request as follows: x-amz-copy-source-if-match +// condition evaluates to true, and; x-amz-copy-source-if-unmodified-since +// condition evaluates to false; Amazon S3 returns 200 OK and copies the +// data. +// +// * Consideration 2 - If both of the x-amz-copy-source-if-none-match and +// x-amz-copy-source-if-modified-since headers are present in the request +// as follows: x-amz-copy-source-if-none-match condition evaluates to false, +// and; x-amz-copy-source-if-modified-since condition evaluates to true; +// Amazon S3 returns 412 Precondition Failed response code. +// +// Versioning +// +// If your bucket has versioning enabled, you could have multiple versions of +// the same object. By default, x-amz-copy-source identifies the current version +// of the object to copy. If the current version is a delete marker and you +// don't specify a versionId in the x-amz-copy-source, Amazon S3 returns a 404 +// error, because the object does not exist. If you specify versionId in the +// x-amz-copy-source and the versionId is a delete marker, Amazon S3 returns +// an HTTP 400 error, because you are not allowed to specify a delete marker +// as a version for the x-amz-copy-source. +// +// You can optionally specify a specific version of the source object to copy +// by adding the versionId subresource as shown in the following example: +// +// x-amz-copy-source: /bucket/object?versionId=version id +// +// Special Errors +// +// * Code: NoSuchUpload Cause: The specified multipart upload does not exist. +// The upload ID might be invalid, or the multipart upload might have been +// aborted or completed. HTTP Status Code: 404 Not Found +// +// * Code: InvalidRequest Cause: The specified copy source is not supported +// as a byte-range copy source. HTTP Status Code: 400 Bad Request +// +// Related Resources +// +// * CreateMultipartUpload +// +// * UploadPart +// +// * CompleteMultipartUpload +// +// * AbortMultipartUpload +// +// * ListParts +// +// * ListMultipartUploads // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -7045,7 +10111,14 @@ func (s *AbortIncompleteMultipartUpload) SetDaysAfterInitiation(v int64) *AbortI type AbortMultipartUploadInput struct { _ struct{} `locationName:"AbortMultipartUploadRequest" type:"structure"` - // Name of the bucket to which the multipart upload was initiated. + // The bucket name to which the upload was taking place. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -7055,10 +10128,11 @@ type AbortMultipartUploadInput struct { // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` // Upload ID that identifies the multipart upload. @@ -7133,6 +10207,20 @@ func (s *AbortMultipartUploadInput) SetUploadId(v string) *AbortMultipartUploadI return s } +func (s *AbortMultipartUploadInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *AbortMultipartUploadInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type AbortMultipartUploadOutput struct { _ struct{} `type:"structure"` @@ -7335,9 +10423,6 @@ func (s *AnalyticsAndOperator) SetTags(v []*Tag) *AnalyticsAndOperator { // Specifies the configuration and any analyses for the analytics filter of // an Amazon S3 bucket. -// -// For more information, see GET Bucket analytics (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETAnalyticsConfig.html) -// in the Amazon Simple Storage Service API Reference. type AnalyticsConfiguration struct { _ struct{} `type:"structure"` @@ -7456,6 +10541,9 @@ func (s *AnalyticsExportDestination) SetS3BucketDestination(v *AnalyticsS3Bucket return s } +// The filter used to describe a set of objects for analyses. A filter must +// have exactly one prefix, one tag, or one conjunction (AnalyticsAndOperator). +// If no filter is provided, all objects will be considered in any analysis. type AnalyticsFilter struct { _ struct{} `type:"structure"` @@ -7518,6 +10606,7 @@ func (s *AnalyticsFilter) SetTag(v *Tag) *AnalyticsFilter { return s } +// Contains information about where to publish the analytics results. type AnalyticsS3BucketDestination struct { _ struct{} `type:"structure"` @@ -7596,6 +10685,8 @@ func (s *AnalyticsS3BucketDestination) SetPrefix(v string) *AnalyticsS3BucketDes return s } +// In terms of implementation, a Bucket is a resource. An Amazon S3 bucket name +// is globally unique, and the namespace is shared by all AWS accounts. type Bucket struct { _ struct{} `type:"structure"` @@ -7679,6 +10770,7 @@ func (s *BucketLifecycleConfiguration) SetRules(v []*LifecycleRule) *BucketLifec return s } +// Container for logging status information. type BucketLoggingStatus struct { _ struct{} `type:"structure"` @@ -7727,7 +10819,8 @@ func (s *BucketLoggingStatus) SetLoggingEnabled(v *LoggingEnabled) *BucketLoggin type CORSConfiguration struct { _ struct{} `type:"structure"` - // A set of allowed origins and methods. + // A set of origins and methods (cross-origin access that you want to allow). + // You can add up to 100 rules to the configuration. // // CORSRules is a required field CORSRules []*CORSRule `locationName:"CORSRule" type:"list" flattened:"true" required:"true"` @@ -7859,7 +10952,8 @@ func (s *CORSRule) SetMaxAgeSeconds(v int64) *CORSRule { return s } -// Describes how a CSV-formatted input object is formatted. +// Describes how an uncompressed comma-separated values (CSV)-formatted input +// object is formatted. type CSVInput struct { _ struct{} `type:"structure"` @@ -7868,24 +10962,45 @@ type CSVInput struct { // to TRUE may lower performance. AllowQuotedRecordDelimiter *bool `type:"boolean"` - // The single character used to indicate a row should be ignored when present - // at the start of a row. + // A single character used to indicate that a row should be ignored when the + // character is present at the start of that row. You can specify any character + // to indicate a comment line. Comments *string `type:"string"` - // The value used to separate individual fields in a record. + // A single character used to separate individual fields in a record. You can + // specify an arbitrary delimiter. FieldDelimiter *string `type:"string"` - // Describes the first line of input. Valid values: None, Ignore, Use. + // Describes the first line of input. Valid values are: + // + // * NONE: First line is not a header. + // + // * IGNORE: First line is a header, but you can't use the header values + // to indicate the column in an expression. You can use column position (such + // as _1, _2, …) to indicate the column (SELECT s._1 FROM OBJECT s). + // + // * Use: First line is a header, and you can use the header value to identify + // a column in an expression (SELECT "name" FROM OBJECT). FileHeaderInfo *string `type:"string" enum:"FileHeaderInfo"` - // Value used for escaping where the field delimiter is part of the value. + // A single character used for escaping when the field delimiter is part of + // the value. For example, if the value is a, b, Amazon S3 wraps this field + // value in quotation marks, as follows: " a , b ". + // + // Type: String + // + // Default: " + // + // Ancestors: CSV QuoteCharacter *string `type:"string"` - // The single character used for escaping the quote character inside an already - // escaped value. + // A single character used for escaping the quotation mark character inside + // an already escaped value. For example, the value """ a , b """ is parsed + // as " a , b ". QuoteEscapeCharacter *string `type:"string"` - // The value used to separate individual records. + // A single character used to separate individual records in the input. Instead + // of the default value, you can specify an arbitrary delimiter. RecordDelimiter *string `type:"string"` } @@ -7941,24 +11056,33 @@ func (s *CSVInput) SetRecordDelimiter(v string) *CSVInput { return s } -// Describes how CSV-formatted results are formatted. +// Describes how uncompressed comma-separated values (CSV)-formatted results +// are formatted. type CSVOutput struct { _ struct{} `type:"structure"` - // The value used to separate individual fields in a record. + // The value used to separate individual fields in a record. You can specify + // an arbitrary delimiter. FieldDelimiter *string `type:"string"` - // The value used for escaping where the field delimiter is part of the value. + // A single character used for escaping when the field delimiter is part of + // the value. For example, if the value is a, b, Amazon S3 wraps this field + // value in quotation marks, as follows: " a , b ". QuoteCharacter *string `type:"string"` - // Th single character used for escaping the quote character inside an already + // The single character used for escaping the quote character inside an already // escaped value. QuoteEscapeCharacter *string `type:"string"` - // Indicates whether or not all output fields should be quoted. + // Indicates whether to use quotation marks around output fields. + // + // * ALWAYS: Always use quotation marks for output fields. + // + // * ASNEEDED: Use quotation marks for output fields when needed. QuoteFields *string `type:"string" enum:"QuoteFields"` - // The value used to separate individual records. + // A single character used to separate individual records in the output. Instead + // of the default value, you can specify an arbitrary delimiter. RecordDelimiter *string `type:"string"` } @@ -8002,9 +11126,12 @@ func (s *CSVOutput) SetRecordDelimiter(v string) *CSVOutput { return s } +// Container for specifying the AWS Lambda notification configuration. type CloudFunctionConfiguration struct { _ struct{} `type:"structure"` + // Lambda cloud function ARN that Amazon S3 can invoke when it detects events + // of the specified type. CloudFunction *string `type:"string"` // The bucket event for which to send notifications. @@ -8012,12 +11139,14 @@ type CloudFunctionConfiguration struct { // Deprecated: Event has been deprecated Event *string `deprecated:"true" type:"string" enum:"Event"` + // Bucket events for which to send notifications. Events []*string `locationName:"Event" type:"list" flattened:"true"` // An optional unique identifier for configurations in a notification configuration. // If you don't provide one, Amazon S3 will assign an ID. Id *string `type:"string"` + // The role supporting the invocation of the Lambda function InvocationRole *string `type:"string"` } @@ -8061,9 +11190,15 @@ func (s *CloudFunctionConfiguration) SetInvocationRole(v string) *CloudFunctionC return s } +// Container for all (if there are any) keys between Prefix and the next occurrence +// of the string specified by a delimiter. CommonPrefixes lists keys that act +// like subdirectories in the directory specified by Prefix. For example, if +// the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, +// the common prefix is notes/summer/. type CommonPrefix struct { _ struct{} `type:"structure"` + // Container for the specified common prefix. Prefix *string `type:"string"` } @@ -8086,20 +11221,28 @@ func (s *CommonPrefix) SetPrefix(v string) *CommonPrefix { type CompleteMultipartUploadInput struct { _ struct{} `locationName:"CompleteMultipartUploadRequest" type:"structure" payload:"MultipartUpload"` + // Name of the bucket to which the multipart upload was initiated. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // Object key for which the multipart upload was initiated. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + // The container for the multipart upload request information. MultipartUpload *CompletedMultipartUpload `locationName:"CompleteMultipartUpload" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + // ID for the initiated multipart upload. + // // UploadId is a required field UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` } @@ -8176,35 +11319,61 @@ func (s *CompleteMultipartUploadInput) SetUploadId(v string) *CompleteMultipartU return s } +func (s *CompleteMultipartUploadInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *CompleteMultipartUploadInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type CompleteMultipartUploadOutput struct { _ struct{} `type:"structure"` + // The name of the bucket that contains the newly created object. Bucket *string `type:"string"` - // Entity tag of the object. + // Entity tag that identifies the newly created object's data. Objects with + // different object data will have different entity tags. The entity tag is + // an opaque string. The entity tag may or may not be an MD5 digest of the object + // data. If the entity tag is not an MD5 digest of the object data, it will + // contain one or more nonhexadecimal characters and/or will consist of less + // than 32 or more than 32 hexadecimal digits. ETag *string `type:"string"` // If the object expiration is configured, this will contain the expiration // date (expiry-date) and rule ID (rule-id). The value of rule-id is URL encoded. Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` + // The object key of the newly created object. Key *string `min:"1" type:"string"` + // The URI that identifies the newly created object. Location *string `type:"string"` // If present, indicates that the requester was successfully charged for the // request. RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - // If present, specifies the ID of the AWS Key Management Service (KMS) master - // encryption key that was used for the object. + // If present, specifies the ID of the AWS Key Management Service (AWS KMS) + // symmetric customer managed customer master key (CMK) that was used for the + // object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). + // If you specified server-side encryption either with an Amazon S3-managed + // encryption key or an AWS KMS customer master key (CMK) in your initiate multipart + // upload request, the response includes this header. It confirms the encryption + // algorithm that Amazon S3 used to encrypt the object. ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - // Version of the object. + // Version ID of the newly created object, in case the bucket has versioning + // turned on. VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` } @@ -8279,9 +11448,11 @@ func (s *CompleteMultipartUploadOutput) SetVersionId(v string) *CompleteMultipar return s } +// The container for the completed multipart upload details. type CompletedMultipartUpload struct { _ struct{} `type:"structure"` + // Array of CompletedPart data types. Parts []*CompletedPart `locationName:"Part" type:"list" flattened:"true"` } @@ -8301,6 +11472,7 @@ func (s *CompletedMultipartUpload) SetParts(v []*CompletedPart) *CompletedMultip return s } +// Details of the parts that were uploaded. type CompletedPart struct { _ struct{} `type:"structure"` @@ -8334,7 +11506,10 @@ func (s *CompletedPart) SetPartNumber(v int64) *CompletedPart { return s } -// Specifies a condition that must be met for a redirect to apply. +// A container for describing a condition that must be met for the specified +// redirect to apply. For example, 1. If request is for pages in the /docs folder, +// redirect to the /documents folder. 2. If request results in HTTP error 4xx, +// redirect request to another host where you might process the error. type Condition struct { _ struct{} `type:"structure"` @@ -8403,12 +11578,19 @@ func (s *ContinuationEvent) UnmarshalEvent( return nil } +func (s *ContinuationEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) + return msg, err +} + type CopyObjectInput struct { _ struct{} `locationName:"CopyObjectRequest" type:"structure"` // The canned ACL to apply to the object. ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` + // The name of the destination bucket. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -8448,7 +11630,8 @@ type CopyObjectInput struct { // Copies the object if it hasn't been modified since the specified time. CopySourceIfUnmodifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-unmodified-since" type:"timestamp"` - // Specifies the algorithm to use when decrypting the source object (e.g., AES256). + // Specifies the algorithm to use when decrypting the source object (for example, + // AES256). CopySourceSSECustomerAlgorithm *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-algorithm" type:"string"` // Specifies the customer-provided encryption key for Amazon S3 to use to decrypt @@ -8457,8 +11640,8 @@ type CopyObjectInput struct { CopySourceSSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key" type:"string" sensitive:"true"` // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. + // Amazon S3 uses this header for a message integrity check to ensure that the + // encryption key was transmitted without error. CopySourceSSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key-MD5" type:"string"` // The date and time at which the object is no longer cacheable. @@ -8476,6 +11659,8 @@ type CopyObjectInput struct { // Allows grantee to write the ACL for the applicable object. GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` + // The key of the destination object. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` @@ -8489,31 +11674,33 @@ type CopyObjectInput struct { // Specifies whether you want to apply a Legal Hold to the copied object. ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - // The object lock mode that you want to apply to the copied object. + // The Object Lock mode that you want to apply to the copied object. ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - // The date and time when you want the copied object's object lock to expire. + // The date and time when you want the copied object's Object Lock to expire. ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - // Specifies the algorithm to use to when encrypting the object (e.g., AES256). + // Specifies the algorithm to use to when encrypting the object (for example, + // AES256). SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting // data. This value is used to store the object and then it is discarded; Amazon - // does not store the encryption key. The key must be appropriate for use with - // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // S3 does not store the encryption key. The key must be appropriate for use + // with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm // header. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. + // Amazon S3 uses this header for a message integrity check to ensure that the + // encryption key was transmitted without error. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` // Specifies the AWS KMS Encryption Context to use for object encryption. The @@ -8523,12 +11710,14 @@ type CopyObjectInput struct { // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT // requests for an object protected by AWS KMS will fail if not made via SSL - // or using SigV4. Documentation on configuring any of the officially supported - // AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version + // or using SigV4. For information about configuring using any of the officially + // supported AWS SDKs and AWS CLI, see Specifying the Signature Version in Request + // Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) + // in the Amazon S3 Developer Guide. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). + // The server-side encryption algorithm used when storing this object in Amazon + // S3 (for example, AES256, aws:kms). ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` // The type of storage to use for the object. Defaults to 'STANDARD'. @@ -8536,7 +11725,7 @@ type CopyObjectInput struct { // The tag-set for the object destination object this value must be used in // conjunction with the TaggingDirective. The tag-set must be encoded as URL - // Query parameters + // Query parameters. Tagging *string `location:"header" locationName:"x-amz-tagging" type:"string"` // Specifies whether the object tag-set are copied from the source object or @@ -8827,11 +12016,27 @@ func (s *CopyObjectInput) SetWebsiteRedirectLocation(v string) *CopyObjectInput return s } +func (s *CopyObjectInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *CopyObjectInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type CopyObjectOutput struct { _ struct{} `type:"structure" payload:"CopyObjectResult"` + // Container for all response elements. CopyObjectResult *CopyObjectResult `type:"structure"` + // Version of the copied object in the destination bucket. CopySourceVersionId *string `location:"header" locationName:"x-amz-copy-source-version-id" type:"string"` // If the object expiration is configured, the response includes this header. @@ -8847,7 +12052,7 @@ type CopyObjectOutput struct { SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round trip message integrity + // the response will include this header to provide round-trip message integrity // verification of the customer-provided encryption key. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` @@ -8856,12 +12061,13 @@ type CopyObjectOutput struct { // the encryption context key-value pairs. SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - // If present, specifies the ID of the AWS Key Management Service (KMS) master - // encryption key that was used for the object. + // If present, specifies the ID of the AWS Key Management Service (AWS KMS) + // symmetric customer managed customer master key (CMK) that was used for the + // object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). + // The server-side encryption algorithm used when storing this object in Amazon + // S3 (for example, AES256, aws:kms). ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` // Version ID of the newly created copy. @@ -8938,11 +12144,16 @@ func (s *CopyObjectOutput) SetVersionId(v string) *CopyObjectOutput { return s } +// Container for all response elements. type CopyObjectResult struct { _ struct{} `type:"structure"` + // Returns the ETag of the new object. The ETag reflects only changes to the + // contents of an object, not its metadata. The source and destination ETag + // is identical for a successfully copied object. ETag *string `type:"string"` + // Returns the date that the object was last modified. LastModified *time.Time `type:"timestamp"` } @@ -8968,6 +12179,7 @@ func (s *CopyObjectResult) SetLastModified(v time.Time) *CopyObjectResult { return s } +// Container for all response elements. type CopyPartResult struct { _ struct{} `type:"structure"` @@ -9000,11 +12212,12 @@ func (s *CopyPartResult) SetLastModified(v time.Time) *CopyPartResult { return s } +// The configuration information for the bucket. type CreateBucketConfiguration struct { _ struct{} `type:"structure"` - // Specifies the region where the bucket will be created. If you don't specify - // a region, the bucket is created in US East (N. Virginia) Region (us-east-1). + // Specifies the Region where the bucket will be created. If you don't specify + // a Region, the bucket is created in the US East (N. Virginia) Region (us-east-1). LocationConstraint *string `type:"string" enum:"BucketLocationConstraint"` } @@ -9030,9 +12243,12 @@ type CreateBucketInput struct { // The canned ACL to apply to the bucket. ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"BucketCannedACL"` + // The name of the bucket to create. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The configuration information for the bucket. 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 @@ -9051,8 +12267,7 @@ type CreateBucketInput struct { // Allows grantee to write the ACL for the applicable bucket. GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` - // Specifies whether you want Amazon S3 object lock to be enabled for the new - // bucket. + // Specifies whether you want S3 Object Lock to be enabled for the new bucket. ObjectLockEnabledForBucket *bool `location:"header" locationName:"x-amz-bucket-object-lock-enabled" type:"boolean"` } @@ -9146,6 +12361,9 @@ func (s *CreateBucketInput) SetObjectLockEnabledForBucket(v bool) *CreateBucketI type CreateBucketOutput struct { _ struct{} `type:"structure"` + // Specifies the Region where the bucket will be created. If you are creating + // a bucket on the US East (N. Virginia) Region (us-east-1), you do not need + // to specify the location. Location *string `location:"header" locationName:"Location" type:"string"` } @@ -9171,6 +12389,8 @@ type CreateMultipartUploadInput struct { // The canned ACL to apply to the object. ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` + // The name of the bucket to which to initiate the upload + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -9206,6 +12426,8 @@ type CreateMultipartUploadInput struct { // Allows grantee to write the ACL for the applicable object. GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` + // Object key for which the multipart upload is to be initiated. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` @@ -9215,31 +12437,33 @@ type CreateMultipartUploadInput struct { // Specifies whether you want to apply a Legal Hold to the uploaded object. ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - // Specifies the object lock mode that you want to apply to the uploaded object. + // Specifies the Object Lock mode that you want to apply to the uploaded object. ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - // Specifies the date and time when you want the object lock to expire. + // Specifies the date and time when you want the Object Lock to expire. ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - // Specifies the algorithm to use to when encrypting the object (e.g., AES256). + // Specifies the algorithm to use to when encrypting the object (for example, + // AES256). SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting // data. This value is used to store the object and then it is discarded; Amazon - // does not store the encryption key. The key must be appropriate for use with - // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // S3 does not store the encryption key. The key must be appropriate for use + // with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm // header. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. + // Amazon S3 uses this header for a message integrity check to ensure that the + // encryption key was transmitted without error. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` // Specifies the AWS KMS Encryption Context to use for object encryption. The @@ -9247,20 +12471,22 @@ type CreateMultipartUploadInput struct { // encryption context key-value pairs. SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT - // requests for an object protected by AWS KMS will fail if not made via SSL - // or using SigV4. Documentation on configuring any of the officially supported - // AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version + // Specifies the ID of the symmetric customer managed AWS KMS CMK to use for + // object encryption. All GET and PUT requests for an object protected by AWS + // KMS will fail if not made via SSL or using SigV4. For information about configuring + // using any of the officially supported AWS SDKs and AWS CLI, see Specifying + // the Signature Version in Request Authentication (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) + // in the Amazon S3 Developer Guide. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). + // The server-side encryption algorithm used when storing this object in Amazon + // S3 (for example, AES256, aws:kms). ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` // The type of storage to use for the object. Defaults to 'STANDARD'. StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` - // The tag-set for the object. The tag-set must be encoded as URL Query parameters + // 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 @@ -9477,17 +12703,47 @@ func (s *CreateMultipartUploadInput) SetWebsiteRedirectLocation(v string) *Creat return s } +func (s *CreateMultipartUploadInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *CreateMultipartUploadInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type CreateMultipartUploadOutput struct { _ struct{} `type:"structure"` - // Date when multipart upload will become eligible for abort operation by lifecycle. + // If the bucket has a lifecycle rule configured with an action to abort incomplete + // multipart uploads and the prefix in the lifecycle rule matches the object + // name in the request, the response includes this header. The header indicates + // when the initiated multipart upload becomes eligible for an abort operation. + // For more information, see Aborting Incomplete Multipart Uploads Using a Bucket + // Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config). + // + // The response also includes the x-amz-abort-rule-id header that provides the + // ID of the lifecycle configuration rule that defines this action. AbortDate *time.Time `location:"header" locationName:"x-amz-abort-date" type:"timestamp"` - // Id of the lifecycle rule that makes a multipart upload eligible for abort - // operation. + // This header is returned along with the x-amz-abort-date header. It identifies + // the applicable lifecycle configuration rule that defines the action to abort + // incomplete multipart uploads. AbortRuleId *string `location:"header" locationName:"x-amz-abort-rule-id" type:"string"` // Name of the bucket to which the multipart upload was initiated. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. Bucket *string `locationName:"Bucket" type:"string"` // Object key for which the multipart upload was initiated. @@ -9503,7 +12759,7 @@ type CreateMultipartUploadOutput struct { SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round trip message integrity + // the response will include this header to provide round-trip message integrity // verification of the customer-provided encryption key. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` @@ -9512,12 +12768,13 @@ type CreateMultipartUploadOutput struct { // the encryption context key-value pairs. SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - // If present, specifies the ID of the AWS Key Management Service (KMS) master - // encryption key that was used for the object. + // If present, specifies the ID of the AWS Key Management Service (AWS KMS) + // symmetric customer managed customer master key (CMK) that was used for the + // object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). + // The server-side encryption algorithm used when storing this object in Amazon + // S3 (for example, AES256, aws:kms). ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` // ID for the initiated multipart upload. @@ -9607,7 +12864,7 @@ func (s *CreateMultipartUploadOutput) SetUploadId(v string) *CreateMultipartUplo return s } -// The container element for specifying the default object lock retention settings +// The container element for specifying the default Object Lock retention settings // for new objects placed in the specified bucket. type DefaultRetention struct { _ struct{} `type:"structure"` @@ -9615,7 +12872,7 @@ type DefaultRetention struct { // The number of days that you want to specify for the default retention period. Days *int64 `type:"integer"` - // The default object lock retention mode you want to apply to new objects placed + // The default Object Lock retention mode you want to apply to new objects placed // in the specified bucket. Mode *string `type:"string" enum:"ObjectLockRetentionMode"` @@ -9651,9 +12908,12 @@ func (s *DefaultRetention) SetYears(v int64) *DefaultRetention { return s } +// Container for the objects to delete. type Delete struct { _ struct{} `type:"structure"` + // The objects to delete. + // // Objects is a required field Objects []*ObjectIdentifier `locationName:"Object" type:"list" flattened:"true" required:"true"` @@ -9769,6 +13029,20 @@ func (s *DeleteBucketAnalyticsConfigurationInput) SetId(v string) *DeleteBucketA return s } +func (s *DeleteBucketAnalyticsConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *DeleteBucketAnalyticsConfigurationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type DeleteBucketAnalyticsConfigurationOutput struct { _ struct{} `type:"structure"` } @@ -9786,6 +13060,8 @@ func (s DeleteBucketAnalyticsConfigurationOutput) GoString() string { type DeleteBucketCorsInput struct { _ struct{} `locationName:"DeleteBucketCorsRequest" type:"structure"` + // Specifies the bucket whose cors configuration is being deleted. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -9829,6 +13105,20 @@ func (s *DeleteBucketCorsInput) getBucket() (v string) { return *s.Bucket } +func (s *DeleteBucketCorsInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *DeleteBucketCorsInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type DeleteBucketCorsOutput struct { _ struct{} `type:"structure"` } @@ -9892,6 +13182,20 @@ func (s *DeleteBucketEncryptionInput) getBucket() (v string) { return *s.Bucket } +func (s *DeleteBucketEncryptionInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *DeleteBucketEncryptionInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type DeleteBucketEncryptionOutput struct { _ struct{} `type:"structure"` } @@ -9909,6 +13213,8 @@ func (s DeleteBucketEncryptionOutput) GoString() string { type DeleteBucketInput struct { _ struct{} `locationName:"DeleteBucketRequest" type:"structure"` + // Specifies the bucket being deleted. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -9952,6 +13258,20 @@ func (s *DeleteBucketInput) getBucket() (v string) { return *s.Bucket } +func (s *DeleteBucketInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *DeleteBucketInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type DeleteBucketInventoryConfigurationInput struct { _ struct{} `locationName:"DeleteBucketInventoryConfigurationRequest" type:"structure"` @@ -10014,6 +13334,20 @@ func (s *DeleteBucketInventoryConfigurationInput) SetId(v string) *DeleteBucketI return s } +func (s *DeleteBucketInventoryConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *DeleteBucketInventoryConfigurationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type DeleteBucketInventoryConfigurationOutput struct { _ struct{} `type:"structure"` } @@ -10031,6 +13365,8 @@ func (s DeleteBucketInventoryConfigurationOutput) GoString() string { type DeleteBucketLifecycleInput struct { _ struct{} `locationName:"DeleteBucketLifecycleRequest" type:"structure"` + // The bucket name of the lifecycle to delete. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -10074,6 +13410,20 @@ func (s *DeleteBucketLifecycleInput) getBucket() (v string) { return *s.Bucket } +func (s *DeleteBucketLifecycleInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *DeleteBucketLifecycleInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type DeleteBucketLifecycleOutput struct { _ struct{} `type:"structure"` } @@ -10150,6 +13500,20 @@ func (s *DeleteBucketMetricsConfigurationInput) SetId(v string) *DeleteBucketMet return s } +func (s *DeleteBucketMetricsConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *DeleteBucketMetricsConfigurationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type DeleteBucketMetricsConfigurationOutput struct { _ struct{} `type:"structure"` } @@ -10181,6 +13545,8 @@ func (s DeleteBucketOutput) GoString() string { type DeleteBucketPolicyInput struct { _ struct{} `locationName:"DeleteBucketPolicyRequest" type:"structure"` + // The bucket name. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -10224,6 +13590,20 @@ func (s *DeleteBucketPolicyInput) getBucket() (v string) { return *s.Bucket } +func (s *DeleteBucketPolicyInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *DeleteBucketPolicyInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type DeleteBucketPolicyOutput struct { _ struct{} `type:"structure"` } @@ -10243,9 +13623,6 @@ type DeleteBucketReplicationInput struct { // The bucket name. // - // It can take a while to propagate the deletion of a replication configuration - // to all Amazon S3 systems. - // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -10289,6 +13666,20 @@ func (s *DeleteBucketReplicationInput) getBucket() (v string) { return *s.Bucket } +func (s *DeleteBucketReplicationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *DeleteBucketReplicationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type DeleteBucketReplicationOutput struct { _ struct{} `type:"structure"` } @@ -10306,6 +13697,8 @@ func (s DeleteBucketReplicationOutput) GoString() string { type DeleteBucketTaggingInput struct { _ struct{} `locationName:"DeleteBucketTaggingRequest" type:"structure"` + // The bucket that has the tag set to be removed. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -10349,6 +13742,20 @@ func (s *DeleteBucketTaggingInput) getBucket() (v string) { return *s.Bucket } +func (s *DeleteBucketTaggingInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *DeleteBucketTaggingInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type DeleteBucketTaggingOutput struct { _ struct{} `type:"structure"` } @@ -10366,6 +13773,8 @@ func (s DeleteBucketTaggingOutput) GoString() string { type DeleteBucketWebsiteInput struct { _ struct{} `locationName:"DeleteBucketWebsiteRequest" type:"structure"` + // The bucket name for which you want to remove the website configuration. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -10409,6 +13818,20 @@ func (s *DeleteBucketWebsiteInput) getBucket() (v string) { return *s.Bucket } +func (s *DeleteBucketWebsiteInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *DeleteBucketWebsiteInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type DeleteBucketWebsiteOutput struct { _ struct{} `type:"structure"` } @@ -10423,6 +13846,7 @@ func (s DeleteBucketWebsiteOutput) GoString() string { return s.String() } +// Information about the delete marker. type DeleteMarkerEntry struct { _ struct{} `type:"structure"` @@ -10436,6 +13860,7 @@ type DeleteMarkerEntry struct { // Date and time the object was last modified. LastModified *time.Time `type:"timestamp"` + // The account that created the delete marker.> Owner *Owner `type:"structure"` // Version ID of an object. @@ -10482,11 +13907,21 @@ func (s *DeleteMarkerEntry) SetVersionId(v string) *DeleteMarkerEntry { return s } -// Specifies whether Amazon S3 should replicate delete makers. +// Specifies whether Amazon S3 replicates the delete markers. If you specify +// a Filter, you must specify this element. However, in the latest version of +// replication configuration (when Filter is specified), Amazon S3 doesn't replicate +// delete markers. Therefore, the DeleteMarkerReplication element can contain +// only Disabled. For an example configuration, see Basic Rule +// Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-config-min-rule-config). +// +// If you don't specify the Filter element, Amazon S3 assumes that the replication +// configuration is the earlier version, V1. In the earlier version, Amazon +// S3 handled replication of delete markers differently. For more information, +// see Backward Compatibility (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations). type DeleteMarkerReplication struct { _ struct{} `type:"structure"` - // The status of the delete marker replication. + // Indicates whether to replicate delete markers. // // In the current implementation, Amazon S3 doesn't replicate the delete markers. // The status must be Disabled. @@ -10512,24 +13947,38 @@ func (s *DeleteMarkerReplication) SetStatus(v string) *DeleteMarkerReplication { type DeleteObjectInput struct { _ struct{} `locationName:"DeleteObjectRequest" type:"structure"` + // The bucket name of the bucket containing the object. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // Indicates whether Amazon S3 object lock should bypass governance-mode restrictions + // Indicates whether S3 Object Lock should bypass Governance-mode restrictions // to process this operation. BypassGovernanceRetention *bool `location:"header" locationName:"x-amz-bypass-governance-retention" type:"boolean"` + // Key name of the object to delete. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` // The concatenation of the authentication device's serial number, a space, - // and the value that is displayed on your authentication device. + // and the value that is displayed on your authentication device. Required to + // permanently delete a versioned object if versioning is configured with MFA + // delete enabled. MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` // VersionId used to reference a specific version of the object. @@ -10611,6 +14060,20 @@ func (s *DeleteObjectInput) SetVersionId(v string) *DeleteObjectInput { return s } +func (s *DeleteObjectInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *DeleteObjectInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type DeleteObjectOutput struct { _ struct{} `type:"structure"` @@ -10658,9 +14121,20 @@ func (s *DeleteObjectOutput) SetVersionId(v string) *DeleteObjectOutput { type DeleteObjectTaggingInput struct { _ struct{} `locationName:"DeleteObjectTaggingRequest" type:"structure"` + // The bucket name containing the objects from which to remove the tags. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // Name of the tag. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` @@ -10725,6 +14199,20 @@ func (s *DeleteObjectTaggingInput) SetVersionId(v string) *DeleteObjectTaggingIn return s } +func (s *DeleteObjectTaggingInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *DeleteObjectTaggingInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type DeleteObjectTaggingOutput struct { _ struct{} `type:"structure"` @@ -10751,25 +14239,39 @@ func (s *DeleteObjectTaggingOutput) SetVersionId(v string) *DeleteObjectTaggingO type DeleteObjectsInput struct { _ struct{} `locationName:"DeleteObjectsRequest" type:"structure" payload:"Delete"` + // The bucket name containing the objects to delete. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` // Specifies whether you want to delete this object even if it has a Governance-type - // object lock in place. You must have sufficient permissions to perform this + // Object Lock in place. You must have sufficient permissions to perform this // operation. BypassGovernanceRetention *bool `location:"header" locationName:"x-amz-bypass-governance-retention" type:"boolean"` + // Container for the request. + // // Delete is a required field 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. + // and the value that is displayed on your authentication device. Required to + // permanently delete a versioned object if versioning is configured with MFA + // delete enabled. MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` } @@ -10844,11 +14346,29 @@ func (s *DeleteObjectsInput) SetRequestPayer(v string) *DeleteObjectsInput { return s } +func (s *DeleteObjectsInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *DeleteObjectsInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type DeleteObjectsOutput struct { _ struct{} `type:"structure"` + // Container element for a successful delete. It identifies the object that + // was successfully deleted. Deleted []*DeletedObject `type:"list" flattened:"true"` + // Container for a failed delete operation that describes the object that Amazon + // S3 attempted to delete and the error it encountered. Errors []*Error `locationName:"Error" type:"list" flattened:"true"` // If present, indicates that the requester was successfully charged for the @@ -10932,6 +14452,20 @@ func (s *DeletePublicAccessBlockInput) getBucket() (v string) { return *s.Bucket } +func (s *DeletePublicAccessBlockInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *DeletePublicAccessBlockInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type DeletePublicAccessBlockOutput struct { _ struct{} `type:"structure"` } @@ -10946,15 +14480,24 @@ func (s DeletePublicAccessBlockOutput) GoString() string { return s.String() } +// Information about the deleted object. type DeletedObject struct { _ struct{} `type:"structure"` + // Specifies whether the versioned object that was permanently deleted was (true) + // or was not (false) a delete marker. In a simple DELETE, this header indicates + // whether (true) or not (false) a delete marker was created. DeleteMarker *bool `type:"boolean"` + // The version ID of the delete marker created as a result of the DELETE operation. + // If you delete a specific object version, the value returned by this header + // is the version ID of the object version deleted. DeleteMarkerVersionId *string `type:"string"` + // The name of the deleted object. Key *string `min:"1" type:"string"` + // The version ID of the deleted object. VersionId *string `type:"string"` } @@ -10993,7 +14536,7 @@ func (s *DeletedObject) SetVersionId(v string) *DeletedObject { } // Specifies information about where to publish analysis or configuration results -// for an Amazon S3 bucket. +// for an Amazon S3 bucket and S3 Replication Time Control (S3 RTC). type Destination struct { _ struct{} `type:"structure"` @@ -11008,17 +14551,12 @@ type Destination struct { // direct Amazon S3 to change replica ownership to the AWS account that owns // the destination bucket by specifying the AccessControlTranslation property, // this is the account ID of the destination bucket owner. For more information, - // see Cross-Region Replication Additional Configuration: Change Replica Owner - // (https://docs.aws.amazon.com/AmazonS3/latest/dev/crr-change-owner.html) in - // the Amazon Simple Storage Service Developer Guide. + // see Replication Additional Configuration: Changing the Replica Owner (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-change-owner.html) + // in the Amazon Simple Storage Service Developer Guide. Account *string `type:"string"` // The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to - // store replicas of the object identified by the rule. - // - // A replication configuration can replicate objects to only one destination - // bucket. If there are multiple rules in your replication configuration, all - // rules must specify the same destination bucket. + // store the results. // // Bucket is a required field Bucket *string `type:"string" required:"true"` @@ -11027,6 +14565,16 @@ type Destination struct { // is specified, you must specify this element. EncryptionConfiguration *EncryptionConfiguration `type:"structure"` + // A container specifying replication metrics-related settings enabling metrics + // and Amazon S3 events for S3 Replication Time Control (S3 RTC). Must be specified + // together with a ReplicationTime block. + Metrics *Metrics `type:"structure"` + + // A container specifying S3 Replication Time Control (S3 RTC), including whether + // S3 RTC is enabled and the time when all objects and operations on objects + // must be replicated. Must be specified together with a Metrics block. + ReplicationTime *ReplicationTime `type:"structure"` + // The storage class to use when replicating objects, such as standard or reduced // redundancy. By default, Amazon S3 uses the storage class of the source object // to create the object replica. @@ -11058,6 +14606,16 @@ func (s *Destination) Validate() error { invalidParams.AddNested("AccessControlTranslation", err.(request.ErrInvalidParams)) } } + if s.Metrics != nil { + if err := s.Metrics.Validate(); err != nil { + invalidParams.AddNested("Metrics", err.(request.ErrInvalidParams)) + } + } + if s.ReplicationTime != nil { + if err := s.ReplicationTime.Validate(); err != nil { + invalidParams.AddNested("ReplicationTime", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -11096,19 +14654,30 @@ func (s *Destination) SetEncryptionConfiguration(v *EncryptionConfiguration) *De return s } +// SetMetrics sets the Metrics field's value. +func (s *Destination) SetMetrics(v *Metrics) *Destination { + s.Metrics = v + return s +} + +// SetReplicationTime sets the ReplicationTime field's value. +func (s *Destination) SetReplicationTime(v *ReplicationTime) *Destination { + s.ReplicationTime = v + return s +} + // SetStorageClass sets the StorageClass field's value. func (s *Destination) SetStorageClass(v string) *Destination { s.StorageClass = &v return s } -// Describes the server-side encryption that will be applied to the restore -// results. +// Contains the type of server-side encryption used. type Encryption struct { _ struct{} `type:"structure"` // The server-side encryption algorithm used when storing job results in Amazon - // S3 (e.g., AES256, aws:kms). + // S3 (for example, AES256, aws:kms). // // EncryptionType is a required field EncryptionType *string `type:"string" required:"true" enum:"ServerSideEncryption"` @@ -11117,8 +14686,11 @@ type Encryption struct { // the encryption context for the restore results. KMSContext *string `type:"string"` - // If the encryption type is aws:kms, this optional value specifies the AWS - // KMS key ID to use for encryption of job results. + // If the encryption type is aws:kms, this optional value specifies the ID of + // the symmetric customer managed AWS KMS CMK to use for encryption of job results. + // Amazon S3 only supports symmetric CMKs. For more information, see Using Symmetric + // and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) + // in the AWS Key Management Service Developer Guide. KMSKeyId *string `type:"string" sensitive:"true"` } @@ -11168,8 +14740,12 @@ func (s *Encryption) SetKMSKeyId(v string) *Encryption { type EncryptionConfiguration struct { _ struct{} `type:"structure"` - // Specifies the AWS KMS Key ID (Key ARN or Alias ARN) for the destination bucket. - // Amazon S3 uses this key to encrypt replica objects. + // Specifies the ID (Key ARN or Alias ARN) of the customer managed customer + // master key (CMK) stored in AWS Key Management Service (KMS) for the destination + // bucket. Amazon S3 uses this key to encrypt replica objects. Amazon S3 only + // supports symmetric customer managed CMKs. For more information, see Using + // Symmetric and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) + // in the AWS Key Management Service Developer Guide. ReplicaKmsKeyID *string `type:"string"` } @@ -11189,6 +14765,9 @@ func (s *EncryptionConfiguration) SetReplicaKmsKeyID(v string) *EncryptionConfig return s } +// A message that indicates the request is complete and no more messages will +// be sent. You should not assume that the request is complete until the client +// receives an EndEvent. type EndEvent struct { _ struct{} `locationName:"EndEvent" type:"structure"` } @@ -11215,15 +14794,380 @@ func (s *EndEvent) UnmarshalEvent( return nil } +func (s *EndEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) + return msg, err +} + +// Container for all error elements. type Error struct { _ struct{} `type:"structure"` + // The error code is a string that uniquely identifies an error condition. It + // is meant to be read and understood by programs that detect and handle errors + // by type. + // + // Amazon S3 error codes + // + // * Code: AccessDenied Description: Access Denied HTTP Status Code: 403 + // Forbidden SOAP Fault Code Prefix: Client + // + // * Code: AccountProblem Description: There is a problem with your AWS account + // that prevents the operation from completing successfully. Contact AWS + // Support for further assistance. HTTP Status Code: 403 Forbidden SOAP Fault + // Code Prefix: Client + // + // * Code: AllAccessDisabled Description: All access to this Amazon S3 resource + // has been disabled. Contact AWS Support for further assistance. HTTP Status + // Code: 403 Forbidden SOAP Fault Code Prefix: Client + // + // * Code: AmbiguousGrantByEmailAddress Description: The email address you + // provided is associated with more than one account. HTTP Status Code: 400 + // Bad Request SOAP Fault Code Prefix: Client + // + // * Code: AuthorizationHeaderMalformed Description: The authorization header + // you provided is invalid. HTTP Status Code: 400 Bad Request HTTP Status + // Code: N/A + // + // * Code: BadDigest Description: The Content-MD5 you specified did not match + // what we received. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: + // Client + // + // * Code: BucketAlreadyExists Description: The requested bucket name is + // not available. The bucket namespace is shared by all users of the system. + // Please select a different name and try again. HTTP Status Code: 409 Conflict + // SOAP Fault Code Prefix: Client + // + // * Code: BucketAlreadyOwnedByYou Description: The bucket you tried to create + // already exists, and you own it. Amazon S3 returns this error in all AWS + // Regions except in the North Virginia Region. For legacy compatibility, + // if you re-create an existing bucket that you already own in the North + // Virginia Region, Amazon S3 returns 200 OK and resets the bucket access + // control lists (ACLs). Code: 409 Conflict (in all Regions except the North + // Virginia Region) SOAP Fault Code Prefix: Client + // + // * Code: BucketNotEmpty Description: The bucket you tried to delete is + // not empty. HTTP Status Code: 409 Conflict SOAP Fault Code Prefix: Client + // + // * Code: CredentialsNotSupported Description: This request does not support + // credentials. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: + // Client + // + // * Code: CrossLocationLoggingProhibited Description: Cross-location logging + // not allowed. Buckets in one geographic location cannot log information + // to a bucket in another location. HTTP Status Code: 403 Forbidden SOAP + // Fault Code Prefix: Client + // + // * Code: EntityTooSmall Description: Your proposed upload is smaller than + // the minimum allowed object size. HTTP Status Code: 400 Bad Request SOAP + // Fault Code Prefix: Client + // + // * Code: EntityTooLarge Description: Your proposed upload exceeds the maximum + // allowed object size. HTTP Status Code: 400 Bad Request SOAP Fault Code + // Prefix: Client + // + // * Code: ExpiredToken Description: The provided token has expired. HTTP + // Status Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: IllegalVersioningConfigurationException Description: Indicates + // that the versioning configuration specified in the request is invalid. + // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: IncompleteBody Description: You did not provide the number of + // bytes specified by the Content-Length HTTP header HTTP Status Code: 400 + // Bad Request SOAP Fault Code Prefix: Client + // + // * Code: IncorrectNumberOfFilesInPostRequest Description: POST requires + // exactly one file upload per request. HTTP Status Code: 400 Bad Request + // SOAP Fault Code Prefix: Client + // + // * Code: InlineDataTooLarge Description: Inline data exceeds the maximum + // allowed size. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: + // Client + // + // * Code: InternalError Description: We encountered an internal error. Please + // try again. HTTP Status Code: 500 Internal Server Error SOAP Fault Code + // Prefix: Server + // + // * Code: InvalidAccessKeyId Description: The AWS access key ID you provided + // does not exist in our records. HTTP Status Code: 403 Forbidden SOAP Fault + // Code Prefix: Client + // + // * Code: InvalidAddressingHeader Description: You must specify the Anonymous + // role. HTTP Status Code: N/A SOAP Fault Code Prefix: Client + // + // * Code: InvalidArgument Description: Invalid Argument HTTP Status Code: + // 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: InvalidBucketName Description: The specified bucket is not valid. + // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: InvalidBucketState Description: The request is not valid with + // the current state of the bucket. HTTP Status Code: 409 Conflict SOAP Fault + // Code Prefix: Client + // + // * Code: InvalidDigest Description: The Content-MD5 you specified is not + // valid. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: InvalidEncryptionAlgorithmError Description: The encryption request + // you specified is not valid. The valid value is AES256. HTTP Status Code: + // 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: InvalidLocationConstraint Description: The specified location + // constraint is not valid. For more information about Regions, see How to + // Select a Region for Your Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro). + // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: InvalidObjectState Description: The operation is not valid for + // the current state of the object. HTTP Status Code: 403 Forbidden SOAP + // Fault Code Prefix: Client + // + // * Code: InvalidPart Description: One or more of the specified parts could + // not be found. The part might not have been uploaded, or the specified + // entity tag might not have matched the part's entity tag. HTTP Status Code: + // 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: InvalidPartOrder Description: The list of parts was not in ascending + // order. Parts list must be specified in order by part number. HTTP Status + // Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: InvalidPayer Description: All access to this object has been disabled. + // Please contact AWS Support for further assistance. HTTP Status Code: 403 + // Forbidden SOAP Fault Code Prefix: Client + // + // * Code: InvalidPolicyDocument Description: The content of the form does + // not meet the conditions specified in the policy document. HTTP Status + // Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: InvalidRange Description: The requested range cannot be satisfied. + // HTTP Status Code: 416 Requested Range Not Satisfiable SOAP Fault Code + // Prefix: Client + // + // * Code: InvalidRequest Description: Please use AWS4-HMAC-SHA256. HTTP + // Status Code: 400 Bad Request Code: N/A + // + // * Code: InvalidRequest Description: SOAP requests must be made over an + // HTTPS connection. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: + // Client + // + // * Code: InvalidRequest Description: Amazon S3 Transfer Acceleration is + // not supported for buckets with non-DNS compliant names. HTTP Status Code: + // 400 Bad Request Code: N/A + // + // * Code: InvalidRequest Description: Amazon S3 Transfer Acceleration is + // not supported for buckets with periods (.) in their names. HTTP Status + // Code: 400 Bad Request Code: N/A + // + // * Code: InvalidRequest Description: Amazon S3 Transfer Accelerate endpoint + // only supports virtual style requests. HTTP Status Code: 400 Bad Request + // Code: N/A + // + // * Code: InvalidRequest Description: Amazon S3 Transfer Accelerate is not + // configured on this bucket. HTTP Status Code: 400 Bad Request Code: N/A + // + // * Code: InvalidRequest Description: Amazon S3 Transfer Accelerate is disabled + // on this bucket. HTTP Status Code: 400 Bad Request Code: N/A + // + // * Code: InvalidRequest Description: Amazon S3 Transfer Acceleration is + // not supported on this bucket. Contact AWS Support for more information. + // HTTP Status Code: 400 Bad Request Code: N/A + // + // * Code: InvalidRequest Description: Amazon S3 Transfer Acceleration cannot + // be enabled on this bucket. Contact AWS Support for more information. HTTP + // Status Code: 400 Bad Request Code: N/A + // + // * Code: InvalidSecurity Description: The provided security credentials + // are not valid. HTTP Status Code: 403 Forbidden SOAP Fault Code Prefix: + // Client + // + // * Code: InvalidSOAPRequest Description: The SOAP request body is invalid. + // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: InvalidStorageClass Description: The storage class you specified + // is not valid. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: + // Client + // + // * Code: InvalidTargetBucketForLogging Description: The target bucket for + // logging does not exist, is not owned by you, or does not have the appropriate + // grants for the log-delivery group. HTTP Status Code: 400 Bad Request SOAP + // Fault Code Prefix: Client + // + // * Code: InvalidToken Description: The provided token is malformed or otherwise + // invalid. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: InvalidURI Description: Couldn't parse the specified URI. HTTP + // Status Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: KeyTooLongError Description: Your key is too long. HTTP Status + // Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: MalformedACLError Description: The XML you provided was not well-formed + // or did not validate against our published schema. HTTP Status Code: 400 + // Bad Request SOAP Fault Code Prefix: Client + // + // * Code: MalformedPOSTRequest Description: The body of your POST request + // is not well-formed multipart/form-data. HTTP Status Code: 400 Bad Request + // SOAP Fault Code Prefix: Client + // + // * Code: MalformedXML Description: This happens when the user sends malformed + // XML (XML that doesn't conform to the published XSD) for the configuration. + // The error message is, "The XML you provided was not well-formed or did + // not validate against our published schema." HTTP Status Code: 400 Bad + // Request SOAP Fault Code Prefix: Client + // + // * Code: MaxMessageLengthExceeded Description: Your request was too big. + // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: MaxPostPreDataLengthExceededError Description: Your POST request + // fields preceding the upload file were too large. HTTP Status Code: 400 + // Bad Request SOAP Fault Code Prefix: Client + // + // * Code: MetadataTooLarge Description: Your metadata headers exceed the + // maximum allowed metadata size. HTTP Status Code: 400 Bad Request SOAP + // Fault Code Prefix: Client + // + // * Code: MethodNotAllowed Description: The specified method is not allowed + // against this resource. HTTP Status Code: 405 Method Not Allowed SOAP Fault + // Code Prefix: Client + // + // * Code: MissingAttachment Description: A SOAP attachment was expected, + // but none were found. HTTP Status Code: N/A SOAP Fault Code Prefix: Client + // + // * Code: MissingContentLength Description: You must provide the Content-Length + // HTTP header. HTTP Status Code: 411 Length Required SOAP Fault Code Prefix: + // Client + // + // * Code: MissingRequestBodyError Description: This happens when the user + // sends an empty XML document as a request. The error message is, "Request + // body is empty." HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: + // Client + // + // * Code: MissingSecurityElement Description: The SOAP 1.1 request is missing + // a security element. HTTP Status Code: 400 Bad Request SOAP Fault Code + // Prefix: Client + // + // * Code: MissingSecurityHeader Description: Your request is missing a required + // header. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: NoLoggingStatusForKey Description: There is no such thing as a + // logging status subresource for a key. HTTP Status Code: 400 Bad Request + // SOAP Fault Code Prefix: Client + // + // * Code: NoSuchBucket Description: The specified bucket does not exist. + // HTTP Status Code: 404 Not Found SOAP Fault Code Prefix: Client + // + // * Code: NoSuchBucketPolicy Description: The specified bucket does not + // have a bucket policy. HTTP Status Code: 404 Not Found SOAP Fault Code + // Prefix: Client + // + // * Code: NoSuchKey Description: The specified key does not exist. HTTP + // Status Code: 404 Not Found SOAP Fault Code Prefix: Client + // + // * Code: NoSuchLifecycleConfiguration Description: The lifecycle configuration + // does not exist. HTTP Status Code: 404 Not Found SOAP Fault Code Prefix: + // Client + // + // * Code: NoSuchUpload Description: The specified multipart upload does + // not exist. The upload ID might be invalid, or the multipart upload might + // have been aborted or completed. HTTP Status Code: 404 Not Found SOAP Fault + // Code Prefix: Client + // + // * Code: NoSuchVersion Description: Indicates that the version ID specified + // in the request does not match an existing version. HTTP Status Code: 404 + // Not Found SOAP Fault Code Prefix: Client + // + // * Code: NotImplemented Description: A header you provided implies functionality + // that is not implemented. HTTP Status Code: 501 Not Implemented SOAP Fault + // Code Prefix: Server + // + // * Code: NotSignedUp Description: Your account is not signed up for the + // Amazon S3 service. You must sign up before you can use Amazon S3. You + // can sign up at the following URL: https://aws.amazon.com/s3 HTTP Status + // Code: 403 Forbidden SOAP Fault Code Prefix: Client + // + // * Code: OperationAborted Description: A conflicting conditional operation + // is currently in progress against this resource. Try again. HTTP Status + // Code: 409 Conflict SOAP Fault Code Prefix: Client + // + // * Code: PermanentRedirect Description: The bucket you are attempting to + // access must be addressed using the specified endpoint. Send all future + // requests to this endpoint. HTTP Status Code: 301 Moved Permanently SOAP + // Fault Code Prefix: Client + // + // * Code: PreconditionFailed Description: At least one of the preconditions + // you specified did not hold. HTTP Status Code: 412 Precondition Failed + // SOAP Fault Code Prefix: Client + // + // * Code: Redirect Description: Temporary redirect. HTTP Status Code: 307 + // Moved Temporarily SOAP Fault Code Prefix: Client + // + // * Code: RestoreAlreadyInProgress Description: Object restore is already + // in progress. HTTP Status Code: 409 Conflict SOAP Fault Code Prefix: Client + // + // * Code: RequestIsNotMultiPartContent Description: Bucket POST must be + // of the enclosure-type multipart/form-data. HTTP Status Code: 400 Bad Request + // SOAP Fault Code Prefix: Client + // + // * Code: RequestTimeout Description: Your socket connection to the server + // was not read from or written to within the timeout period. HTTP Status + // Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: RequestTimeTooSkewed Description: The difference between the request + // time and the server's time is too large. HTTP Status Code: 403 Forbidden + // SOAP Fault Code Prefix: Client + // + // * Code: RequestTorrentOfBucketError Description: Requesting the torrent + // file of a bucket is not permitted. HTTP Status Code: 400 Bad Request SOAP + // Fault Code Prefix: Client + // + // * Code: SignatureDoesNotMatch Description: The request signature we calculated + // does not match the signature you provided. Check your AWS secret access + // key and signing method. For more information, see REST Authentication + // (https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html) + // and SOAP Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/SOAPAuthentication.html) + // for details. HTTP Status Code: 403 Forbidden SOAP Fault Code Prefix: Client + // + // * Code: ServiceUnavailable Description: Reduce your request rate. HTTP + // Status Code: 503 Service Unavailable SOAP Fault Code Prefix: Server + // + // * Code: SlowDown Description: Reduce your request rate. HTTP Status Code: + // 503 Slow Down SOAP Fault Code Prefix: Server + // + // * Code: TemporaryRedirect Description: You are being redirected to the + // bucket while DNS updates. HTTP Status Code: 307 Moved Temporarily SOAP + // Fault Code Prefix: Client + // + // * Code: TokenRefreshRequired Description: The provided token must be refreshed. + // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: TooManyBuckets Description: You have attempted to create more + // buckets than allowed. HTTP Status Code: 400 Bad Request SOAP Fault Code + // Prefix: Client + // + // * Code: UnexpectedContent Description: This request does not support content. + // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client + // + // * Code: UnresolvableGrantByEmailAddress Description: The email address + // you provided does not match any account on record. HTTP Status Code: 400 + // Bad Request SOAP Fault Code Prefix: Client + // + // * Code: UserKeyMustBeSpecified Description: The bucket POST must contain + // the specified field name. If it is specified, check the order of the fields. + // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client Code *string `type:"string"` + // The error key. Key *string `min:"1" type:"string"` + // The error message contains a generic description of the error condition in + // English. It is intended for a human audience. Simple programs display the + // message directly to the end user if they encounter an error condition they + // don't know how or don't care to handle. Sophisticated programs with more + // exhaustive error handling and proper internationalization are more likely + // to ignore the error message. Message *string `type:"string"` + // The version ID of the error. VersionId *string `type:"string"` } @@ -11261,6 +15205,7 @@ func (s *Error) SetVersionId(v string) *Error { return s } +// The error information. type ErrorDocument struct { _ struct{} `type:"structure"` @@ -11302,6 +15247,45 @@ func (s *ErrorDocument) SetKey(v string) *ErrorDocument { return s } +// Optional configuration to replicate existing source bucket objects. For more +// information, see Replicating Existing Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-what-is-isnot-replicated.html#existing-object-replication) +// in the Amazon S3 Developer Guide. +type ExistingObjectReplication struct { + _ struct{} `type:"structure"` + + // Status is a required field + Status *string `type:"string" required:"true" enum:"ExistingObjectReplicationStatus"` +} + +// String returns the string representation +func (s ExistingObjectReplication) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExistingObjectReplication) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ExistingObjectReplication) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ExistingObjectReplication"} + if s.Status == nil { + invalidParams.Add(request.NewErrParamRequired("Status")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetStatus sets the Status field's value. +func (s *ExistingObjectReplication) SetStatus(v string) *ExistingObjectReplication { + s.Status = &v + return s +} + // Specifies the Amazon S3 object key name to filter on and whether to filter // on the suffix or prefix of the key name. type FilterRule struct { @@ -11388,6 +15372,20 @@ func (s *GetBucketAccelerateConfigurationInput) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketAccelerateConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketAccelerateConfigurationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketAccelerateConfigurationOutput struct { _ struct{} `type:"structure"` @@ -11414,6 +15412,8 @@ func (s *GetBucketAccelerateConfigurationOutput) SetStatus(v string) *GetBucketA type GetBucketAclInput struct { _ struct{} `locationName:"GetBucketAclRequest" type:"structure"` + // Specifies the S3 bucket whose ACL is being requested. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -11457,12 +15457,27 @@ func (s *GetBucketAclInput) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketAclInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketAclInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketAclOutput struct { _ struct{} `type:"structure"` // A list of grants. Grants []*Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"` + // Container for the bucket owner's display name and ID. Owner *Owner `type:"structure"` } @@ -11550,6 +15565,20 @@ func (s *GetBucketAnalyticsConfigurationInput) SetId(v string) *GetBucketAnalyti return s } +func (s *GetBucketAnalyticsConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketAnalyticsConfigurationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketAnalyticsConfigurationOutput struct { _ struct{} `type:"structure" payload:"AnalyticsConfiguration"` @@ -11576,6 +15605,8 @@ func (s *GetBucketAnalyticsConfigurationOutput) SetAnalyticsConfiguration(v *Ana type GetBucketCorsInput struct { _ struct{} `locationName:"GetBucketCorsRequest" type:"structure"` + // The bucket name for which to get the cors configuration. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -11619,9 +15650,25 @@ func (s *GetBucketCorsInput) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketCorsInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketCorsInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketCorsOutput struct { _ struct{} `type:"structure"` + // A set of origins and methods (cross-origin access that you want to allow). + // You can add up to 100 rules to the configuration. CORSRules []*CORSRule `locationName:"CORSRule" type:"list" flattened:"true"` } @@ -11690,6 +15737,20 @@ func (s *GetBucketEncryptionInput) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketEncryptionInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketEncryptionInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketEncryptionOutput struct { _ struct{} `type:"structure" payload:"ServerSideEncryptionConfiguration"` @@ -11775,6 +15836,20 @@ func (s *GetBucketInventoryConfigurationInput) SetId(v string) *GetBucketInvento return s } +func (s *GetBucketInventoryConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketInventoryConfigurationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketInventoryConfigurationOutput struct { _ struct{} `type:"structure" payload:"InventoryConfiguration"` @@ -11801,6 +15876,8 @@ func (s *GetBucketInventoryConfigurationOutput) SetInventoryConfiguration(v *Inv type GetBucketLifecycleConfigurationInput struct { _ struct{} `locationName:"GetBucketLifecycleConfigurationRequest" type:"structure"` + // The name of the bucket for which to get the lifecycle information. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -11844,9 +15921,24 @@ func (s *GetBucketLifecycleConfigurationInput) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketLifecycleConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketLifecycleConfigurationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketLifecycleConfigurationOutput struct { _ struct{} `type:"structure"` + // Container for a lifecycle rule. Rules []*LifecycleRule `locationName:"Rule" type:"list" flattened:"true"` } @@ -11869,6 +15961,8 @@ func (s *GetBucketLifecycleConfigurationOutput) SetRules(v []*LifecycleRule) *Ge type GetBucketLifecycleInput struct { _ struct{} `locationName:"GetBucketLifecycleRequest" type:"structure"` + // The name of the bucket for which to get the lifecycle information. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -11912,9 +16006,24 @@ func (s *GetBucketLifecycleInput) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketLifecycleInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketLifecycleInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketLifecycleOutput struct { _ struct{} `type:"structure"` + // Container for a lifecycle rule. Rules []*Rule `locationName:"Rule" type:"list" flattened:"true"` } @@ -11937,6 +16046,8 @@ func (s *GetBucketLifecycleOutput) SetRules(v []*Rule) *GetBucketLifecycleOutput type GetBucketLocationInput struct { _ struct{} `locationName:"GetBucketLocationRequest" type:"structure"` + // The name of the bucket for which to get the location. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -11980,9 +16091,25 @@ func (s *GetBucketLocationInput) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketLocationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketLocationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketLocationOutput struct { _ struct{} `type:"structure"` + // Specifies the Region where the bucket resides. For a list of all the Amazon + // S3 supported location constraints by Region, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region). LocationConstraint *string `type:"string" enum:"BucketLocationConstraint"` } @@ -12005,6 +16132,8 @@ func (s *GetBucketLocationOutput) SetLocationConstraint(v string) *GetBucketLoca type GetBucketLoggingInput struct { _ struct{} `locationName:"GetBucketLoggingRequest" type:"structure"` + // The bucket name for which to get the logging information. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -12048,6 +16177,20 @@ func (s *GetBucketLoggingInput) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketLoggingInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketLoggingInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketLoggingOutput struct { _ struct{} `type:"structure"` @@ -12136,6 +16279,20 @@ func (s *GetBucketMetricsConfigurationInput) SetId(v string) *GetBucketMetricsCo return s } +func (s *GetBucketMetricsConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketMetricsConfigurationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketMetricsConfigurationOutput struct { _ struct{} `type:"structure" payload:"MetricsConfiguration"` @@ -12162,7 +16319,7 @@ func (s *GetBucketMetricsConfigurationOutput) SetMetricsConfiguration(v *Metrics type GetBucketNotificationConfigurationRequest struct { _ struct{} `locationName:"GetBucketNotificationConfigurationRequest" type:"structure"` - // Name of the bucket to get the notification configuration for. + // Name of the bucket for which to get the notification configuration // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -12207,9 +16364,25 @@ func (s *GetBucketNotificationConfigurationRequest) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketNotificationConfigurationRequest) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketNotificationConfigurationRequest) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketPolicyInput struct { _ struct{} `locationName:"GetBucketPolicyRequest" type:"structure"` + // The bucket name for which to get the bucket policy. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -12253,6 +16426,20 @@ func (s *GetBucketPolicyInput) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketPolicyInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketPolicyInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketPolicyOutput struct { _ struct{} `type:"structure" payload:"Policy"` @@ -12324,6 +16511,20 @@ func (s *GetBucketPolicyStatusInput) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketPolicyStatusInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketPolicyStatusInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketPolicyStatusOutput struct { _ struct{} `type:"structure" payload:"PolicyStatus"` @@ -12350,6 +16551,8 @@ func (s *GetBucketPolicyStatusOutput) SetPolicyStatus(v *PolicyStatus) *GetBucke type GetBucketReplicationInput struct { _ struct{} `locationName:"GetBucketReplicationRequest" type:"structure"` + // The bucket name for which to get the replication information. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -12393,6 +16596,20 @@ func (s *GetBucketReplicationInput) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketReplicationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketReplicationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketReplicationOutput struct { _ struct{} `type:"structure" payload:"ReplicationConfiguration"` @@ -12420,6 +16637,8 @@ func (s *GetBucketReplicationOutput) SetReplicationConfiguration(v *ReplicationC type GetBucketRequestPaymentInput struct { _ struct{} `locationName:"GetBucketRequestPaymentRequest" type:"structure"` + // The name of the bucket for which to get the payment request configuration + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -12463,6 +16682,20 @@ func (s *GetBucketRequestPaymentInput) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketRequestPaymentInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketRequestPaymentInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketRequestPaymentOutput struct { _ struct{} `type:"structure"` @@ -12489,6 +16722,8 @@ func (s *GetBucketRequestPaymentOutput) SetPayer(v string) *GetBucketRequestPaym type GetBucketTaggingInput struct { _ struct{} `locationName:"GetBucketTaggingRequest" type:"structure"` + // The name of the bucket for which to get the tagging information. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -12532,9 +16767,25 @@ func (s *GetBucketTaggingInput) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketTaggingInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketTaggingInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketTaggingOutput struct { _ struct{} `type:"structure"` + // Contains the tag set. + // // TagSet is a required field TagSet []*Tag `locationNameList:"Tag" type:"list" required:"true"` } @@ -12558,6 +16809,8 @@ func (s *GetBucketTaggingOutput) SetTagSet(v []*Tag) *GetBucketTaggingOutput { type GetBucketVersioningInput struct { _ struct{} `locationName:"GetBucketVersioningRequest" type:"structure"` + // The name of the bucket for which to get the versioning information. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -12601,6 +16854,20 @@ func (s *GetBucketVersioningInput) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketVersioningInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketVersioningInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketVersioningOutput struct { _ struct{} `type:"structure"` @@ -12638,6 +16905,8 @@ func (s *GetBucketVersioningOutput) SetStatus(v string) *GetBucketVersioningOutp type GetBucketWebsiteInput struct { _ struct{} `locationName:"GetBucketWebsiteRequest" type:"structure"` + // The bucket name for which to get the website configuration. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -12681,17 +16950,34 @@ func (s *GetBucketWebsiteInput) getBucket() (v string) { return *s.Bucket } +func (s *GetBucketWebsiteInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetBucketWebsiteInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetBucketWebsiteOutput struct { _ struct{} `type:"structure"` + // The name of the error document for the website. ErrorDocument *ErrorDocument `type:"structure"` + // The name of the index document for the website. IndexDocument *IndexDocument `type:"structure"` // Specifies the redirect behavior of all requests to a website endpoint of // an Amazon S3 bucket. RedirectAllRequestsTo *RedirectAllRequestsTo `type:"structure"` + // Rules that define when a redirect is applied and the redirect behavior. RoutingRules []*RoutingRule `locationNameList:"RoutingRule" type:"list"` } @@ -12732,16 +17018,28 @@ func (s *GetBucketWebsiteOutput) SetRoutingRules(v []*RoutingRule) *GetBucketWeb type GetObjectAclInput struct { _ struct{} `locationName:"GetObjectAclRequest" type:"structure"` + // The bucket name that contains the object for which to get the ACL information. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The key of the object for which to get the ACL information. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` // VersionId used to reference a specific version of the object. @@ -12811,12 +17109,27 @@ func (s *GetObjectAclInput) SetVersionId(v string) *GetObjectAclInput { return s } +func (s *GetObjectAclInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetObjectAclInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetObjectAclOutput struct { _ struct{} `type:"structure"` // A list of grants. Grants []*Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"` + // Container for the bucket owner's display name and ID. Owner *Owner `type:"structure"` // If present, indicates that the requester was successfully charged for the @@ -12855,6 +17168,15 @@ func (s *GetObjectAclOutput) SetRequestCharged(v string) *GetObjectAclOutput { type GetObjectInput struct { _ struct{} `locationName:"GetObjectRequest" type:"structure"` + // The bucket name containing the object. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -12874,6 +17196,8 @@ type GetObjectInput struct { // otherwise return a 412 (precondition failed). IfUnmodifiedSince *time.Time `location:"header" locationName:"If-Unmodified-Since" type:"timestamp"` + // Key of the object to get. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` @@ -12883,13 +17207,14 @@ type GetObjectInput struct { PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer"` // Downloads the specified range bytes of an object. For more information about - // the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. + // the HTTP Range header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. Range *string `location:"header" locationName:"Range" type:"string"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` // Sets the Cache-Control header of the response. @@ -12910,19 +17235,20 @@ type GetObjectInput struct { // Sets the Expires header of the response. ResponseExpires *time.Time `location:"querystring" locationName:"response-expires" type:"timestamp"` - // Specifies the algorithm to use to when encrypting the object (e.g., AES256). + // Specifies the algorithm to use to when encrypting the object (for example, + // AES256). SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting // data. This value is used to store the object and then it is discarded; Amazon - // does not store the encryption key. The key must be appropriate for use with - // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // S3 does not store the encryption key. The key must be appropriate for use + // with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm // header. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. + // Amazon S3 uses this header for a message integrity check to ensure that the + // encryption key was transmitted without error. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` // VersionId used to reference a specific version of the object. @@ -13089,10 +17415,32 @@ func (s *GetObjectInput) SetVersionId(v string) *GetObjectInput { return s } +func (s *GetObjectInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetObjectInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetObjectLegalHoldInput struct { _ struct{} `locationName:"GetObjectLegalHoldRequest" type:"structure"` - // The bucket containing the object whose Legal Hold status you want to retrieve. + // The bucket name containing the object whose Legal Hold status you want to + // retrieve. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -13102,10 +17450,11 @@ type GetObjectLegalHoldInput struct { // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` // The version ID of the object whose Legal Hold status you want to retrieve. @@ -13175,6 +17524,20 @@ func (s *GetObjectLegalHoldInput) SetVersionId(v string) *GetObjectLegalHoldInpu return s } +func (s *GetObjectLegalHoldInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetObjectLegalHoldInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetObjectLegalHoldOutput struct { _ struct{} `type:"structure" payload:"LegalHold"` @@ -13201,7 +17564,7 @@ func (s *GetObjectLegalHoldOutput) SetLegalHold(v *ObjectLockLegalHold) *GetObje type GetObjectLockConfigurationInput struct { _ struct{} `locationName:"GetObjectLockConfigurationRequest" type:"structure"` - // The bucket whose object lock configuration you want to retrieve. + // The bucket whose Object Lock configuration you want to retrieve. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -13239,17 +17602,31 @@ func (s *GetObjectLockConfigurationInput) SetBucket(v string) *GetObjectLockConf return s } -func (s *GetObjectLockConfigurationInput) getBucket() (v string) { +func (s *GetObjectLockConfigurationInput) getBucket() (v string) { + if s.Bucket == nil { + return v + } + return *s.Bucket +} + +func (s *GetObjectLockConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetObjectLockConfigurationInput) hasEndpointARN() bool { if s.Bucket == nil { - return v + return false } - return *s.Bucket + return arn.IsARN(*s.Bucket) } type GetObjectLockConfigurationOutput struct { _ struct{} `type:"structure" payload:"ObjectLockConfiguration"` - // The specified bucket's object lock configuration. + // The specified bucket's Object Lock configuration. ObjectLockConfiguration *ObjectLockConfiguration `type:"structure"` } @@ -13272,6 +17649,7 @@ func (s *GetObjectLockConfigurationOutput) SetObjectLockConfiguration(v *ObjectL type GetObjectOutput struct { _ struct{} `type:"structure" payload:"Body"` + // Indicates that a range of bytes was specified. AcceptRanges *string `location:"header" locationName:"accept-ranges" type:"string"` // Object data. @@ -13305,11 +17683,11 @@ type GetObjectOutput struct { DeleteMarker *bool `location:"header" locationName:"x-amz-delete-marker" type:"boolean"` // An ETag is an opaque identifier assigned by a web server to a specific version - // of a resource found at a URL + // of a resource found at a URL. ETag *string `location:"header" locationName:"ETag" type:"string"` // If the object expiration is configured (see PUT Bucket lifecycle), the response - // includes this header. It includes the expiry-date and rule-id key value pairs + // includes this header. It includes the expiry-date and rule-id key-value pairs // providing object expiration information. The value of the rule-id is URL // encoded. Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` @@ -13321,6 +17699,10 @@ type GetObjectOutput struct { LastModified *time.Time `location:"header" locationName:"Last-Modified" type:"timestamp"` // A map of metadata to store with the object in S3. + // + // By default unmarshaled keys are written as a map keys in following canonicalized format: + // the first letter and any letter following a hyphen will be capitalized, and the rest as lowercase. + // Set `aws.Config.LowerCaseHeaderMaps` to `true` to write unmarshaled keys to the map as lowercase. Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` // This is set to the number of metadata entries not returned in x-amz-meta @@ -13333,15 +17715,17 @@ type GetObjectOutput struct { // returned if you have permission to view an object's legal hold status. ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - // The object lock mode currently in place for this object. + // The Object Lock mode currently in place for this object. ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - // The date and time when this object's object lock will expire. + // The date and time when this object's Object Lock will expire. ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` // The count of parts this object has. PartsCount *int64 `location:"header" locationName:"x-amz-mp-parts-count" type:"integer"` + // Amazon S3 can return this if your request involves a bucket that is either + // a source or destination in a replication rule. ReplicationStatus *string `location:"header" locationName:"x-amz-replication-status" type:"string" enum:"ReplicationStatus"` // If present, indicates that the requester was successfully charged for the @@ -13358,18 +17742,21 @@ type GetObjectOutput struct { SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round trip message integrity + // the response will include this header to provide round-trip message integrity // verification of the customer-provided encryption key. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - // If present, specifies the ID of the AWS Key Management Service (KMS) master - // encryption key that was used for the object. + // If present, specifies the ID of the AWS Key Management Service (AWS KMS) + // symmetric customer managed customer master key (CMK) that was used for the + // object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). + // The server-side encryption algorithm used when storing this object in Amazon + // S3 (for example, AES256, aws:kms). ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` + // Provides storage class information of the object. Amazon S3 returns this + // header for all objects except for Standard storage class objects. StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` // The number of tags, if any, on the object. @@ -13583,7 +17970,15 @@ func (s *GetObjectOutput) SetWebsiteRedirectLocation(v string) *GetObjectOutput type GetObjectRetentionInput struct { _ struct{} `locationName:"GetObjectRetentionRequest" type:"structure"` - // The bucket containing the object whose retention settings you want to retrieve. + // The bucket name containing the object whose retention settings you want to + // retrieve. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -13593,10 +17988,11 @@ type GetObjectRetentionInput struct { // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` // The version ID for the object whose retention settings you want to retrieve. @@ -13666,6 +18062,20 @@ func (s *GetObjectRetentionInput) SetVersionId(v string) *GetObjectRetentionInpu return s } +func (s *GetObjectRetentionInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetObjectRetentionInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetObjectRetentionOutput struct { _ struct{} `type:"structure" payload:"Retention"` @@ -13692,12 +18102,24 @@ func (s *GetObjectRetentionOutput) SetRetention(v *ObjectLockRetention) *GetObje type GetObjectTaggingInput struct { _ struct{} `locationName:"GetObjectTaggingRequest" type:"structure"` + // The bucket name containing the object for which to get the tagging information. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // Object key for which to get the tagging information. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + // The versionId of the object for which to get the tagging information. VersionId *string `location:"querystring" locationName:"versionId" type:"string"` } @@ -13758,12 +18180,29 @@ func (s *GetObjectTaggingInput) SetVersionId(v string) *GetObjectTaggingInput { return s } +func (s *GetObjectTaggingInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetObjectTaggingInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetObjectTaggingOutput struct { _ struct{} `type:"structure"` + // Contains the tag set. + // // TagSet is a required field TagSet []*Tag `locationNameList:"Tag" type:"list" required:"true"` + // The versionId of the object for which you got the tagging information. VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` } @@ -13792,16 +18231,22 @@ func (s *GetObjectTaggingOutput) SetVersionId(v string) *GetObjectTaggingOutput type GetObjectTorrentInput struct { _ struct{} `locationName:"GetObjectTorrentRequest" type:"structure"` + // The name of the bucket containing the object for which to get the torrent + // files. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The object key for which to get the information. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` } @@ -13862,9 +18307,24 @@ func (s *GetObjectTorrentInput) SetRequestPayer(v string) *GetObjectTorrentInput return s } +func (s *GetObjectTorrentInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetObjectTorrentInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetObjectTorrentOutput struct { _ struct{} `type:"structure" payload:"Body"` + // A Bencoded dictionary as defined by the BitTorrent specification Body io.ReadCloser `type:"blob"` // If present, indicates that the requester was successfully charged for the @@ -13943,6 +18403,20 @@ func (s *GetPublicAccessBlockInput) getBucket() (v string) { return *s.Bucket } +func (s *GetPublicAccessBlockInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *GetPublicAccessBlockInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type GetPublicAccessBlockOutput struct { _ struct{} `type:"structure" payload:"PublicAccessBlockConfiguration"` @@ -13967,6 +18441,7 @@ func (s *GetPublicAccessBlockOutput) SetPublicAccessBlockConfiguration(v *Public return s } +// Container for Glacier job parameters. type GlacierJobParameters struct { _ struct{} `type:"structure"` @@ -14005,9 +18480,11 @@ func (s *GlacierJobParameters) SetTier(v string) *GlacierJobParameters { return s } +// Container for grant information. type Grant struct { _ struct{} `type:"structure"` + // The person being granted permissions. Grantee *Grantee `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` // Specifies the permission given to the grantee. @@ -14051,6 +18528,7 @@ func (s *Grant) SetPermission(v string) *Grant { return s } +// Container for the person being granted permissions. type Grantee struct { _ struct{} `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` @@ -14128,6 +18606,8 @@ func (s *Grantee) SetURI(v string) *Grantee { type HeadBucketInput struct { _ struct{} `locationName:"HeadBucketRequest" type:"structure"` + // The bucket name. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` } @@ -14171,6 +18651,20 @@ func (s *HeadBucketInput) getBucket() (v string) { return *s.Bucket } +func (s *HeadBucketInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *HeadBucketInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type HeadBucketOutput struct { _ struct{} `type:"structure"` } @@ -14188,6 +18682,8 @@ func (s HeadBucketOutput) GoString() string { type HeadObjectInput struct { _ struct{} `locationName:"HeadObjectRequest" type:"structure"` + // The name of the bucket containing the object. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -14207,6 +18703,8 @@ type HeadObjectInput struct { // otherwise return a 412 (precondition failed). IfUnmodifiedSince *time.Time `location:"header" locationName:"If-Unmodified-Since" type:"timestamp"` + // The object key. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` @@ -14217,28 +18715,30 @@ type HeadObjectInput struct { PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer"` // Downloads the specified range bytes of an object. For more information about - // the HTTP Range header, go to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. + // the HTTP Range header, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35. Range *string `location:"header" locationName:"Range" type:"string"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - // Specifies the algorithm to use to when encrypting the object (e.g., AES256). + // Specifies the algorithm to use to when encrypting the object (for example, + // AES256). SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting // data. This value is used to store the object and then it is discarded; Amazon - // does not store the encryption key. The key must be appropriate for use with - // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // S3 does not store the encryption key. The key must be appropriate for use + // with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm // header. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. + // Amazon S3 uses this header for a message integrity check to ensure that the + // encryption key was transmitted without error. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` // VersionId used to reference a specific version of the object. @@ -14369,9 +18869,24 @@ func (s *HeadObjectInput) SetVersionId(v string) *HeadObjectInput { return s } +func (s *HeadObjectInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *HeadObjectInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type HeadObjectOutput struct { _ struct{} `type:"structure"` + // Indicates that a range of bytes was specified. AcceptRanges *string `location:"header" locationName:"accept-ranges" type:"string"` // Specifies caching behavior along the request/reply chain. @@ -14399,11 +18914,11 @@ type HeadObjectOutput struct { DeleteMarker *bool `location:"header" locationName:"x-amz-delete-marker" type:"boolean"` // An ETag is an opaque identifier assigned by a web server to a specific version - // of a resource found at a URL + // of a resource found at a URL. ETag *string `location:"header" locationName:"ETag" type:"string"` // If the object expiration is configured (see PUT Bucket lifecycle), the response - // includes this header. It includes the expiry-date and rule-id key value pairs + // includes this header. It includes the expiry-date and rule-id key-value pairs // providing object expiration information. The value of the rule-id is URL // encoded. Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` @@ -14415,6 +18930,10 @@ type HeadObjectOutput struct { LastModified *time.Time `location:"header" locationName:"Last-Modified" type:"timestamp"` // A map of metadata to store with the object in S3. + // + // By default unmarshaled keys are written as a map keys in following canonicalized format: + // the first letter and any letter following a hyphen will be capitalized, and the rest as lowercase. + // Set `aws.Config.LowerCaseHeaderMaps` to `true` to write unmarshaled keys to the map as lowercase. Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` // This is set to the number of metadata entries not returned in x-amz-meta @@ -14423,26 +18942,69 @@ type HeadObjectOutput struct { // you can create metadata whose values are not legal HTTP headers. MissingMeta *int64 `location:"header" locationName:"x-amz-missing-meta" type:"integer"` - // The Legal Hold status for the specified object. + // Specifies whether a legal hold is in effect for this object. This header + // is only returned if the requester has the s3:GetObjectLegalHold permission. + // This header is not returned if the specified version of this object has never + // had a legal hold applied. For more information about S3 Object Lock, see + // Object Lock (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - // The object lock mode currently in place for this object. + // The Object Lock mode, if any, that's in effect for this object. This header + // is only returned if the requester has the s3:GetObjectRetention permission. + // For more information about S3 Object Lock, see Object Lock (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - // The date and time when this object's object lock expires. + // The date and time when the Object Lock retention period expires. This header + // is only returned if the requester has the s3:GetObjectRetention permission. ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` // The count of parts this object has. PartsCount *int64 `location:"header" locationName:"x-amz-mp-parts-count" type:"integer"` + // Amazon S3 can return this header if your request involves a bucket that is + // either a source or destination in a replication rule. + // + // In replication, you have a source bucket on which you configure replication + // and destination bucket where Amazon S3 stores object replicas. When you request + // an object (GetObject) or object metadata (HeadObject) from these buckets, + // Amazon S3 will return the x-amz-replication-status header in the response + // as follows: + // + // * If requesting an object from the source bucket — Amazon S3 will return + // the x-amz-replication-status header if the object in your request is eligible + // for replication. For example, suppose that in your replication configuration, + // you specify object prefix TaxDocs requesting Amazon S3 to replicate objects + // with key prefix TaxDocs. Any objects you upload with this key name prefix, + // for example TaxDocs/document1.pdf, are eligible for replication. For any + // object request with this key name prefix, Amazon S3 will return the x-amz-replication-status + // header with value PENDING, COMPLETED or FAILED indicating object replication + // status. + // + // * If requesting an object from the destination bucket — Amazon S3 will + // return the x-amz-replication-status header with value REPLICA if the object + // in your request is a replica that Amazon S3 created. + // + // For more information, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html). ReplicationStatus *string `location:"header" locationName:"x-amz-replication-status" type:"string" enum:"ReplicationStatus"` // If present, indicates that the requester was successfully charged for the // request. RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - // Provides information about object restoration operation and expiration time - // of the restored object copy. + // If the object is an archived object (an object whose storage class is GLACIER), + // the response includes this header if either the archive restoration is in + // progress (see RestoreObject or an archive copy is already restored. + // + // If an archive copy is already restored, the header value indicates when Amazon + // S3 is scheduled to delete the object copy. For example: + // + // x-amz-restore: ongoing-request="false", expiry-date="Fri, 23 Dec 2012 00:00:00 + // GMT" + // + // If the object restoration is in progress, the header returns the value ongoing-request="true". + // + // For more information about archiving objects, see Transitioning Objects: + // General Considerations (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-transition-general-considerations). Restore *string `location:"header" locationName:"x-amz-restore" type:"string"` // If server-side encryption with a customer-provided encryption key was requested, @@ -14451,18 +19013,25 @@ type HeadObjectOutput struct { SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round trip message integrity + // the response will include this header to provide round-trip message integrity // verification of the customer-provided encryption key. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - // If present, specifies the ID of the AWS Key Management Service (KMS) master - // encryption key that was used for the object. + // If present, specifies the ID of the AWS Key Management Service (AWS KMS) + // symmetric customer managed customer master key (CMK) that was used for the + // object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). + // If the object is stored using server-side encryption either with an AWS KMS + // customer master key (CMK) or an Amazon S3-managed encryption key, the response + // includes this header with the value of the server-side encryption algorithm + // used when storing this object in Amazon S3 (for example, AES256, aws:kms). ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` + // Provides storage class information of the object. Amazon S3 returns this + // header for all objects except for Standard storage class objects. + // + // For more information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html). StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` // Version of the object. @@ -14652,13 +19221,15 @@ func (s *HeadObjectOutput) SetWebsiteRedirectLocation(v string) *HeadObjectOutpu return s } +// Container for the Suffix element. type IndexDocument struct { _ struct{} `type:"structure"` // A suffix that is appended to a request that is for a directory on the website - // endpoint (e.g. if the suffix is index.html and you make a request to samplebucket/images/ - // the data that is returned will be for the object with the key name images/index.html) - // The suffix must not be empty and must not include a slash character. + // endpoint (for example,if the suffix is index.html and you make a request + // to samplebucket/images/ the data that is returned will be for the object + // with the key name images/index.html) The suffix must not be empty and must + // not include a slash character. // // Suffix is a required field Suffix *string `type:"string" required:"true"` @@ -14693,6 +19264,7 @@ func (s *IndexDocument) SetSuffix(v string) *IndexDocument { return s } +// Container element that identifies who initiated the multipart upload. type Initiator struct { _ struct{} `type:"structure"` @@ -14913,6 +19485,7 @@ func (s *InventoryConfiguration) SetSchedule(v *InventorySchedule) *InventoryCon return s } +// Specifies the inventory configuration for an Amazon S3 bucket. type InventoryDestination struct { _ struct{} `type:"structure"` @@ -14962,10 +19535,10 @@ func (s *InventoryDestination) SetS3BucketDestination(v *InventoryS3BucketDestin type InventoryEncryption struct { _ struct{} `type:"structure"` - // Specifies the use of SSE-KMS to encrypt delivered Inventory reports. + // Specifies the use of SSE-KMS to encrypt delivered inventory reports. SSEKMS *SSEKMS `locationName:"SSE-KMS" type:"structure"` - // Specifies the use of SSE-S3 to encrypt delivered Inventory reports. + // Specifies the use of SSE-S3 to encrypt delivered inventory reports. SSES3 *SSES3 `locationName:"SSE-S3" type:"structure"` } @@ -15006,6 +19579,8 @@ func (s *InventoryEncryption) SetSSES3(v *SSES3) *InventoryEncryption { return s } +// Specifies an inventory filter. The inventory only includes objects that meet +// the filter's criteria. type InventoryFilter struct { _ struct{} `type:"structure"` @@ -15044,13 +19619,15 @@ func (s *InventoryFilter) SetPrefix(v string) *InventoryFilter { return s } +// Contains the bucket name, file format, bucket owner (optional), and prefix +// (optional) where inventory results are published. type InventoryS3BucketDestination struct { _ struct{} `type:"structure"` // The ID of the account that owns the destination bucket. AccountId *string `type:"string"` - // The Amazon resource name (ARN) of the bucket where inventory results will + // The Amazon Resource Name (ARN) of the bucket where inventory results will // be published. // // Bucket is a required field @@ -15137,6 +19714,7 @@ func (s *InventoryS3BucketDestination) SetPrefix(v string) *InventoryS3BucketDes return s } +// Specifies the schedule for generating inventory results. type InventorySchedule struct { _ struct{} `type:"structure"` @@ -15175,6 +19753,7 @@ func (s *InventorySchedule) SetFrequency(v string) *InventorySchedule { return s } +// Specifies JSON as object's input serialization format. type JSONInput struct { _ struct{} `type:"structure"` @@ -15198,6 +19777,7 @@ func (s *JSONInput) SetType(v string) *JSONInput { return s } +// Specifies JSON as request's output serialization format. type JSONOutput struct { _ struct{} `type:"structure"` @@ -15225,7 +19805,7 @@ func (s *JSONOutput) SetRecordDelimiter(v string) *JSONOutput { type KeyFilter struct { _ struct{} `type:"structure"` - // A list of containers for the key value pair that defines the criteria for + // A list of containers for the key-value pair that defines the criteria for // the filter rule. FilterRules []*FilterRule `locationName:"FilterRule" type:"list" flattened:"true"` } @@ -15323,9 +19903,12 @@ func (s *LambdaFunctionConfiguration) SetLambdaFunctionArn(v string) *LambdaFunc return s } +// Container for lifecycle rules. You can add as many as 1000 rules. type LifecycleConfiguration struct { _ struct{} `type:"structure"` + // Specifies lifecycle configuration rules for an Amazon S3 bucket. + // // Rules is a required field Rules []*Rule `locationName:"Rule" type:"list" flattened:"true" required:"true"` } @@ -15369,6 +19952,7 @@ func (s *LifecycleConfiguration) SetRules(v []*Rule) *LifecycleConfiguration { return s } +// Container for the expiration for the lifecycle of the object. type LifecycleExpiration struct { _ struct{} `type:"structure"` @@ -15415,6 +19999,7 @@ func (s *LifecycleExpiration) SetExpiredObjectDeleteMarker(v bool) *LifecycleExp return s } +// A lifecycle rule for individual objects in an Amazon S3 bucket. type LifecycleRule struct { _ struct{} `type:"structure"` @@ -15425,6 +20010,8 @@ type LifecycleRule struct { // in the Amazon Simple Storage Service Developer Guide. AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `type:"structure"` + // Specifies the expiration for the lifecycle of the object in the form of date, + // days and, whether the object has a delete marker. Expiration *LifecycleExpiration `type:"structure"` // The Filter is used to identify objects that a Lifecycle Rule applies to. @@ -15441,6 +20028,11 @@ type LifecycleRule struct { // period in the object's lifetime. NoncurrentVersionExpiration *NoncurrentVersionExpiration `type:"structure"` + // Specifies the transition rule for the lifecycle rule that describes when + // noncurrent objects transition to a specific storage class. If your bucket + // is versioning-enabled (or versioning is suspended), you can set this action + // to request that Amazon S3 transition noncurrent object versions to a specific + // storage class at a set period in the object's lifetime. NoncurrentVersionTransitions []*NoncurrentVersionTransition `locationName:"NoncurrentVersionTransition" type:"list" flattened:"true"` // Prefix identifying one or more objects to which the rule applies. This is @@ -15455,6 +20047,7 @@ type LifecycleRule struct { // Status is a required field Status *string `type:"string" required:"true" enum:"ExpirationStatus"` + // Specifies when an Amazon S3 object transitions to a specified storage class. Transitions []*Transition `locationName:"Transition" type:"list" flattened:"true"` } @@ -15546,6 +20139,7 @@ func (s *LifecycleRule) SetTransitions(v []*Transition) *LifecycleRule { type LifecycleRuleAndOperator struct { _ struct{} `type:"structure"` + // Prefix identifying one or more objects to which the rule applies. Prefix *string `type:"string"` // All of these tags must exist in the object's tag set in order for the rule @@ -15718,13 +20312,28 @@ func (s *ListBucketAnalyticsConfigurationsInput) SetContinuationToken(v string) return s } +func (s *ListBucketAnalyticsConfigurationsInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *ListBucketAnalyticsConfigurationsInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type ListBucketAnalyticsConfigurationsOutput struct { _ struct{} `type:"structure"` // The list of analytics configurations for a bucket. AnalyticsConfigurationList []*AnalyticsConfiguration `locationName:"AnalyticsConfiguration" type:"list" flattened:"true"` - // The ContinuationToken that represents where this request began. + // The marker that is used as a starting point for this analytics configuration + // list response. This value is present if it was sent in the request. ContinuationToken *string `type:"string"` // Indicates whether the returned list of analytics configurations is complete. @@ -15832,6 +20441,20 @@ func (s *ListBucketInventoryConfigurationsInput) SetContinuationToken(v string) return s } +func (s *ListBucketInventoryConfigurationsInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *ListBucketInventoryConfigurationsInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type ListBucketInventoryConfigurationsOutput struct { _ struct{} `type:"structure"` @@ -15842,8 +20465,9 @@ type ListBucketInventoryConfigurationsOutput struct { // The list of inventory configurations for a bucket. InventoryConfigurationList []*InventoryConfiguration `locationName:"InventoryConfiguration" type:"list" flattened:"true"` - // Indicates whether the returned list of inventory configurations is truncated - // in this response. A value of true indicates that the list is truncated. + // Tells whether the returned list of inventory configurations is complete. + // A value of true indicates that the list is not complete and the NextContinuationToken + // is provided for a subsequent request. IsTruncated *bool `type:"boolean"` // The marker used to continue this inventory configuration listing. Use the @@ -15946,6 +20570,20 @@ func (s *ListBucketMetricsConfigurationsInput) SetContinuationToken(v string) *L return s } +func (s *ListBucketMetricsConfigurationsInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *ListBucketMetricsConfigurationsInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type ListBucketMetricsConfigurationsOutput struct { _ struct{} `type:"structure"` @@ -16019,8 +20657,10 @@ func (s ListBucketsInput) GoString() string { type ListBucketsOutput struct { _ struct{} `type:"structure"` + // The list of buckets owned by the requestor. Buckets []*Bucket `locationNameList:"Bucket" type:"list"` + // The owner of the buckets listed. Owner *Owner `type:"structure"` } @@ -16049,10 +20689,26 @@ func (s *ListBucketsOutput) SetOwner(v *Owner) *ListBucketsOutput { type ListMultipartUploadsInput struct { _ struct{} `locationName:"ListMultipartUploadsRequest" type:"structure"` + // Name of the bucket to which the multipart upload was initiated. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` // Character you use to group keys. + // + // All keys that contain the same string between the prefix, if specified, and + // the first occurrence of the delimiter after the prefix are grouped under + // a single result element, CommonPrefixes. If you don't specify the prefix + // parameter, then the substring starts at the beginning of the key. The keys + // that are grouped under CommonPrefixes result element are not returned elsewhere + // in the response. Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` // Requests Amazon S3 to encode the object keys in the response and specifies @@ -16065,6 +20721,13 @@ type ListMultipartUploadsInput struct { // Together with upload-id-marker, this parameter specifies the multipart upload // after which listing should begin. + // + // If upload-id-marker is not specified, only the keys lexicographically greater + // than the specified key-marker will be included in the list. + // + // If upload-id-marker is specified, any multipart uploads for a key equal to + // the key-marker might also be included, provided those multipart uploads have + // upload IDs lexicographically greater than the specified upload-id-marker. KeyMarker *string `location:"querystring" locationName:"key-marker" type:"string"` // Sets the maximum number of multipart uploads, from 1 to 1,000, to return @@ -16073,12 +20736,16 @@ type ListMultipartUploadsInput struct { MaxUploads *int64 `location:"querystring" locationName:"max-uploads" type:"integer"` // Lists in-progress uploads only for those keys that begin with the specified - // prefix. + // prefix. You can use prefixes to separate a bucket into different grouping + // of keys. (You can think of using prefix to make groups in the same way you'd + // use a folder in a file system.) Prefix *string `location:"querystring" locationName:"prefix" type:"string"` // Together with key-marker, specifies the multipart upload after which listing // should begin. If key-marker is not specified, the upload-id-marker parameter - // is ignored. + // is ignored. Otherwise, any multipart uploads for a key equal to the key-marker + // might be included in the list only if they have an upload ID lexicographically + // greater than the specified upload-id-marker. UploadIdMarker *string `location:"querystring" locationName:"upload-id-marker" type:"string"` } @@ -16157,17 +20824,42 @@ func (s *ListMultipartUploadsInput) SetUploadIdMarker(v string) *ListMultipartUp return s } +func (s *ListMultipartUploadsInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *ListMultipartUploadsInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type ListMultipartUploadsOutput struct { _ struct{} `type:"structure"` // Name of the bucket to which the multipart upload was initiated. Bucket *string `type:"string"` + // If you specify a delimiter in the request, then the result returns each distinct + // key prefix containing the delimiter in a CommonPrefixes element. The distinct + // key prefixes are returned in the Prefix child element. CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` + // Contains the delimiter you specified in the request. If you don't specify + // a delimiter in your request, this element is absent from the response. Delimiter *string `type:"string"` // Encoding type used by Amazon S3 to encode object keys in the response. + // + // If you specify encoding-type request parameter, Amazon S3 includes this element + // in the response, and returns encoded key name values in the following response + // elements: + // + // Delimiter, KeyMarker, Prefix, NextKeyMarker, Key. EncodingType *string `type:"string" enum:"EncodingType"` // Indicates whether the returned list of multipart uploads is truncated. A @@ -16198,6 +20890,8 @@ type ListMultipartUploadsOutput struct { // Upload ID after which listing began. UploadIdMarker *string `type:"string"` + // Container for elements related to a particular multipart upload. A response + // can contain zero or more Upload elements. Uploads []*MultipartUpload `locationName:"Upload" type:"list" flattened:"true"` } @@ -16293,10 +20987,23 @@ func (s *ListMultipartUploadsOutput) SetUploads(v []*MultipartUpload) *ListMulti type ListObjectVersionsInput struct { _ struct{} `locationName:"ListObjectVersionsRequest" type:"structure"` + // The bucket name that contains the objects. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // A delimiter is a character you use to group keys. + // A delimiter is a character that you specify to group keys. All keys that + // contain the same string between the prefix and the first occurrence of the + // delimiter are grouped under a single result element in CommonPrefixes. These + // groups are counted as one result against the max-keys limitation. These keys + // are not returned elsewhere in the response. Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` // Requests Amazon S3 to encode the object keys in the response and specifies @@ -16311,10 +21018,17 @@ type ListObjectVersionsInput struct { KeyMarker *string `location:"querystring" locationName:"key-marker" type:"string"` // Sets the maximum number of keys returned in the response. The response might - // contain fewer keys but will never contain more. + // contain fewer keys but will never contain more. If additional keys satisfy + // the search criteria, but were not returned because max-keys was exceeded, + // the response contains true. To return the additional + // keys, see key-marker and version-id-marker. MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` - // Limits the response to keys that begin with the specified prefix. + // Use this parameter to select only those keys that begin with the specified + // prefix. You can use prefixes to separate a bucket into different groupings + // of keys. (You can think of using prefix to make groups in the same way you'd + // use a folder in a file system.) You can use prefix with delimiter to roll + // up numerous objects into a single result under CommonPrefixes. Prefix *string `location:"querystring" locationName:"prefix" type:"string"` // Specifies the object version you want to start listing from. @@ -16396,42 +21110,81 @@ func (s *ListObjectVersionsInput) SetVersionIdMarker(v string) *ListObjectVersio return s } +func (s *ListObjectVersionsInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *ListObjectVersionsInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type ListObjectVersionsOutput struct { _ struct{} `type:"structure"` + // All of the keys rolled up into a common prefix count as a single return when + // calculating the number of returns. CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` + // Container for an object that is a delete marker. DeleteMarkers []*DeleteMarkerEntry `locationName:"DeleteMarker" type:"list" flattened:"true"` + // The delimiter grouping the included keys. A delimiter is a character that + // you specify to group keys. All keys that contain the same string between + // the prefix and the first occurrence of the delimiter are grouped under a + // single result element in CommonPrefixes. These groups are counted as one + // result against the max-keys limitation. These keys are not returned elsewhere + // in the response. Delimiter *string `type:"string"` - // Encoding type used by Amazon S3 to encode object keys in the response. + // Encoding type used by Amazon S3 to encode object key names in the XML response. + // + // If you specify encoding-type request parameter, Amazon S3 includes this element + // in the response, and returns encoded key name values in the following response + // elements: + // + // KeyMarker, NextKeyMarker, Prefix, Key, and Delimiter. EncodingType *string `type:"string" enum:"EncodingType"` - // A flag that indicates whether or not Amazon S3 returned all of the results - // that satisfied the search criteria. If your results were truncated, you can - // make a follow-up paginated request using the NextKeyMarker and NextVersionIdMarker + // A flag that indicates whether Amazon S3 returned all of the results that + // satisfied the search criteria. If your results were truncated, you can make + // a follow-up paginated request using the NextKeyMarker and NextVersionIdMarker // response parameters as a starting place in another request to return the // rest of the results. IsTruncated *bool `type:"boolean"` - // Marks the last Key returned in a truncated response. + // Marks the last key returned in a truncated response. KeyMarker *string `type:"string"` + // Specifies the maximum number of objects to return. MaxKeys *int64 `type:"integer"` + // Bucket name. Name *string `type:"string"` - // Use this value for the key marker request parameter in a subsequent request. + // When the number of responses exceeds the value of MaxKeys, NextKeyMarker + // specifies the first key not returned that satisfies the search criteria. + // Use this value for the key-marker request parameter in a subsequent request. NextKeyMarker *string `type:"string"` - // Use this value for the next version id marker parameter in a subsequent request. + // When the number of responses exceeds the value of MaxKeys, NextVersionIdMarker + // specifies the first object version not returned that satisfies the search + // criteria. Use this value for the version-id-marker request parameter in a + // subsequent request. NextVersionIdMarker *string `type:"string"` + // Selects objects that start with the value supplied by this parameter. Prefix *string `type:"string"` + // Marks the last version of the key returned in a truncated response. VersionIdMarker *string `type:"string"` + // Container for version information. Versions []*ObjectVersion `locationName:"Version" type:"list" flattened:"true"` } @@ -16526,6 +21279,8 @@ func (s *ListObjectVersionsOutput) SetVersions(v []*ObjectVersion) *ListObjectVe type ListObjectsInput struct { _ struct{} `locationName:"ListObjectsRequest" type:"structure"` + // The name of the bucket containing the objects. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -16631,26 +21386,65 @@ func (s *ListObjectsInput) SetRequestPayer(v string) *ListObjectsInput { return s } +func (s *ListObjectsInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *ListObjectsInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type ListObjectsOutput struct { _ struct{} `type:"structure"` + // All of the keys rolled up in a common prefix count as a single return when + // calculating the number of returns. + // + // A response can contain CommonPrefixes only if you specify a delimiter. + // + // CommonPrefixes contains all (if there are any) keys between Prefix and the + // next occurrence of the string specified by the delimiter. + // + // CommonPrefixes lists keys that act like subdirectories in the directory specified + // by Prefix. + // + // For example, if the prefix is notes/ and the delimiter is a slash (/) as + // in notes/summer/july, the common prefix is notes/summer/. All of the keys + // that roll up into a common prefix count as a single return when calculating + // the number of returns. CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` + // Metadata about each object returned. Contents []*Object `type:"list" flattened:"true"` + // Causes keys that contain the same string between the prefix and the first + // occurrence of the delimiter to be rolled up into a single result element + // in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere + // in the response. Each rolled-up result counts as only one return against + // the MaxKeys value. Delimiter *string `type:"string"` // Encoding type used by Amazon S3 to encode object keys in the response. EncodingType *string `type:"string" enum:"EncodingType"` - // A flag that indicates whether or not Amazon S3 returned all of the results - // that satisfied the search criteria. + // A flag that indicates whether Amazon S3 returned all of the results that + // satisfied the search criteria. IsTruncated *bool `type:"boolean"` + // Indicates where in the bucket listing begins. Marker is included in the response + // if it was sent with the request. Marker *string `type:"string"` + // The maximum number of keys returned in the response body. MaxKeys *int64 `type:"integer"` + // Bucket name. Name *string `type:"string"` // When response is truncated (the IsTruncated element value in the response @@ -16662,6 +21456,7 @@ type ListObjectsOutput struct { // subsequent request to get the next set of object keys. NextMarker *string `type:"string"` + // Keys that begin with the indicated prefix. Prefix *string `type:"string"` } @@ -16738,14 +21533,21 @@ func (s *ListObjectsOutput) SetPrefix(v string) *ListObjectsOutput { type ListObjectsV2Input struct { _ struct{} `locationName:"ListObjectsV2Request" type:"structure"` - // Name of the bucket to list. + // Bucket name to list. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` // ContinuationToken indicates Amazon S3 that the list is being continued on // this bucket with a token. ContinuationToken is obfuscated and is not a real - // key + // key. ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` // A delimiter is a character you use to group keys. @@ -16756,7 +21558,7 @@ type ListObjectsV2Input struct { // The owner field is not present in listV2 by default, if you want to return // owner field with each key in the result then set the fetch owner field to - // true + // true. FetchOwner *bool `location:"querystring" locationName:"fetch-owner" type:"boolean"` // Sets the maximum number of keys returned in the response. The response might @@ -16772,7 +21574,7 @@ type ListObjectsV2Input struct { RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` // StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts - // listing after this specified key. StartAfter can be any key in the bucket + // listing after this specified key. StartAfter can be any key in the bucket. StartAfter *string `location:"querystring" locationName:"start-after" type:"string"` } @@ -16863,29 +21665,65 @@ func (s *ListObjectsV2Input) SetStartAfter(v string) *ListObjectsV2Input { return s } +func (s *ListObjectsV2Input) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *ListObjectsV2Input) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type ListObjectsV2Output struct { _ struct{} `type:"structure"` + // All of the keys rolled up into a common prefix count as a single return when + // calculating the number of returns. + // + // A response can contain CommonPrefixes only if you specify a delimiter. + // // CommonPrefixes contains all (if there are any) keys between Prefix and the - // next occurrence of the string specified by delimiter + // next occurrence of the string specified by a delimiter. + // + // CommonPrefixes lists keys that act like subdirectories in the directory specified + // by Prefix. + // + // For example, if the prefix is notes/ and the delimiter is a slash (/) as + // in notes/summer/july, the common prefix is notes/summer/. All of the keys + // that roll up into a common prefix count as a single return when calculating + // the number of returns. CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` // Metadata about each object returned. Contents []*Object `type:"list" flattened:"true"` - // ContinuationToken indicates Amazon S3 that the list is being continued on - // this bucket with a token. ContinuationToken is obfuscated and is not a real - // key + // If ContinuationToken was sent with the request, it is included in the response. ContinuationToken *string `type:"string"` - // A delimiter is a character you use to group keys. + // Causes keys that contain the same string between the prefix and the first + // occurrence of the delimiter to be rolled up into a single result element + // in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere + // in the response. Each rolled-up result counts as only one return against + // the MaxKeys value. Delimiter *string `type:"string"` - // Encoding type used by Amazon S3 to encode object keys in the response. + // Encoding type used by Amazon S3 to encode object key names in the XML response. + // + // If you specify the encoding-type request parameter, Amazon S3 includes this + // element in the response, and returns encoded key name values in the following + // response elements: + // + // Delimiter, Prefix, Key, and StartAfter. EncodingType *string `type:"string" enum:"EncodingType"` - // A flag that indicates whether or not Amazon S3 returned all of the results - // that satisfied the search criteria. + // Set to false if all of the results were returned. Set to true if more keys + // are available to return. If the number of results exceeds that specified + // by MaxKeys, all of the results might not be returned. IsTruncated *bool `type:"boolean"` // KeyCount is the number of keys returned with this request. KeyCount will @@ -16897,20 +21735,26 @@ type ListObjectsV2Output struct { // contain fewer keys but will never contain more. MaxKeys *int64 `type:"integer"` - // Name of the bucket to list. + // Bucket name. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. Name *string `type:"string"` - // NextContinuationToken is sent when isTruncated is true which means there + // NextContinuationToken is sent when isTruncated is true, which means there // are more keys in the bucket that can be listed. The next list requests to // Amazon S3 can be continued with this NextContinuationToken. NextContinuationToken // is obfuscated and is not a real key NextContinuationToken *string `type:"string"` - // Limits the response to keys that begin with the specified prefix. + // Keys that begin with the indicated prefix. Prefix *string `type:"string"` - // StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts - // listing after this specified key. StartAfter can be any key in the bucket + // If StartAfter was sent with the request, it is included in the response. StartAfter *string `type:"string"` } @@ -16999,9 +21843,20 @@ func (s *ListObjectsV2Output) SetStartAfter(v string) *ListObjectsV2Output { type ListPartsInput struct { _ struct{} `locationName:"ListPartsRequest" type:"structure"` + // Name of the bucket to which the parts are being uploaded. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // Object key for which the multipart upload was initiated. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` @@ -17012,10 +21867,11 @@ type ListPartsInput struct { // part numbers will be listed. PartNumberMarker *int64 `location:"querystring" locationName:"part-number-marker" type:"integer"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` // Upload ID identifying the multipart upload whose parts are being listed. @@ -17102,23 +21958,51 @@ func (s *ListPartsInput) SetUploadId(v string) *ListPartsInput { return s } +func (s *ListPartsInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *ListPartsInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type ListPartsOutput struct { _ struct{} `type:"structure"` - // Date when multipart upload will become eligible for abort operation by lifecycle. + // If the bucket has a lifecycle rule configured with an action to abort incomplete + // multipart uploads and the prefix in the lifecycle rule matches the object + // name in the request, then the response includes this header indicating when + // the initiated multipart upload will become eligible for abort operation. + // For more information, see Aborting Incomplete Multipart Uploads Using a Bucket + // Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config). + // + // The response will also include the x-amz-abort-rule-id header that will provide + // the ID of the lifecycle configuration rule that defines this action. AbortDate *time.Time `location:"header" locationName:"x-amz-abort-date" type:"timestamp"` - // Id of the lifecycle rule that makes a multipart upload eligible for abort - // operation. + // This header is returned along with the x-amz-abort-date header. It identifies + // applicable lifecycle configuration rule that defines the action to abort + // incomplete multipart uploads. AbortRuleId *string `location:"header" locationName:"x-amz-abort-rule-id" type:"string"` // Name of the bucket to which the multipart upload was initiated. Bucket *string `type:"string"` - // Identifies who initiated the multipart upload. + // Container element that identifies who initiated the multipart upload. If + // the initiator is an AWS account, this element provides the same information + // as the Owner element. If the initiator is an IAM User, this element provides + // the user ARN and display name. Initiator *Initiator `type:"structure"` - // Indicates whether the returned list of parts is truncated. + // Indicates whether the returned list of parts is truncated. A true value indicates + // that the list was truncated. A list can be truncated if the number of parts + // exceeds the limit returned in the MaxParts element. IsTruncated *bool `type:"boolean"` // Object key for which the multipart upload was initiated. @@ -17132,18 +22016,26 @@ type ListPartsOutput struct { // in a subsequent request. NextPartNumberMarker *int64 `type:"integer"` + // Container element that identifies the object owner, after the object is created. + // If multipart upload is initiated by an IAM user, this element provides the + // parent account ID and display name. Owner *Owner `type:"structure"` - // Part number after which listing begins. + // When a list is truncated, this element specifies the last part in the list, + // as well as the value to use for the part-number-marker request parameter + // in a subsequent request. PartNumberMarker *int64 `type:"integer"` + // Container for elements related to a particular part. A response can contain + // zero or more Part elements. Parts []*Part `locationName:"Part" type:"list" flattened:"true"` // If present, indicates that the requester was successfully charged for the // request. RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - // The class of storage used to store the object. + // Class of storage (STANDARD or REDUCED_REDUNDANCY) used to store the uploaded + // object. StorageClass *string `type:"string" enum:"StorageClass"` // Upload ID identifying the multipart upload whose parts are being listed. @@ -17251,7 +22143,8 @@ func (s *ListPartsOutput) SetUploadId(v string) *ListPartsOutput { return s } -// Describes an S3 location that will receive the results of the restore request. +// Describes an Amazon S3 location that will receive the results of the restore +// request. type Location struct { _ struct{} `type:"structure"` @@ -17266,8 +22159,7 @@ type Location struct { // The canned ACL to apply to the restore results. CannedACL *string `type:"string" enum:"ObjectCannedACL"` - // Describes the server-side encryption that will be applied to the restore - // results. + // Contains the type of server-side encryption used. Encryption *Encryption `type:"structure"` // The prefix that is prepended to the restore results for this request. @@ -17389,13 +22281,14 @@ type LoggingEnabled struct { // Specifies the bucket where you want Amazon S3 to store server access logs. // You can have your logs delivered to any bucket that you own, including the // same bucket that is being logged. You can also configure multiple buckets - // to deliver their logs to the same target bucket. In this case you should + // to deliver their logs to the same target bucket. In this case, you should // choose a different TargetPrefix for each source bucket so that the delivered // log files can be distinguished by key. // // TargetBucket is a required field TargetBucket *string `type:"string" required:"true"` + // Container for granting information. TargetGrants []*TargetGrant `locationNameList:"Grant" type:"list"` // A prefix for all log object keys. If you store log files from multiple Amazon @@ -17464,8 +22357,10 @@ func (s *LoggingEnabled) SetTargetPrefix(v string) *LoggingEnabled { type MetadataEntry struct { _ struct{} `type:"structure"` + // Name of the Object. Name *string `type:"string"` + // Value of the Object. Value *string `type:"string"` } @@ -17491,6 +22386,65 @@ func (s *MetadataEntry) SetValue(v string) *MetadataEntry { return s } +// A container specifying replication metrics-related settings enabling metrics +// and Amazon S3 events for S3 Replication Time Control (S3 RTC). Must be specified +// together with a ReplicationTime block. +type Metrics struct { + _ struct{} `type:"structure"` + + // A container specifying the time threshold for emitting the s3:Replication:OperationMissedThreshold + // event. + // + // EventThreshold is a required field + EventThreshold *ReplicationTimeValue `type:"structure" required:"true"` + + // Specifies whether the replication metrics are enabled. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"MetricsStatus"` +} + +// String returns the string representation +func (s Metrics) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Metrics) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Metrics) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Metrics"} + if s.EventThreshold == nil { + invalidParams.Add(request.NewErrParamRequired("EventThreshold")) + } + if s.Status == nil { + invalidParams.Add(request.NewErrParamRequired("Status")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEventThreshold sets the EventThreshold field's value. +func (s *Metrics) SetEventThreshold(v *ReplicationTimeValue) *Metrics { + s.EventThreshold = v + return s +} + +// SetStatus sets the Status field's value. +func (s *Metrics) SetStatus(v string) *Metrics { + s.Status = &v + return s +} + +// A conjunction (logical AND) of predicates, which is used in evaluating a +// metrics filter. The operator must have at least two predicates, and an object +// must match all of the predicates in order for the filter to apply. type MetricsAndOperator struct { _ struct{} `type:"structure"` @@ -17604,6 +22558,9 @@ func (s *MetricsConfiguration) SetId(v string) *MetricsConfiguration { return s } +// Specifies a metrics configuration filter. The metrics configuration only +// includes objects that meet the filter's criteria. A filter must be a prefix, +// a tag, or a conjunction (MetricsAndOperator). type MetricsFilter struct { _ struct{} `type:"structure"` @@ -17667,6 +22624,7 @@ func (s *MetricsFilter) SetTag(v *Tag) *MetricsFilter { return s } +// Container for the MultipartUpload for the Amazon S3 object. type MultipartUpload struct { _ struct{} `type:"structure"` @@ -17679,6 +22637,7 @@ type MultipartUpload struct { // Key of the object for which the multipart upload was initiated. Key *string `min:"1" type:"string"` + // Specifies the owner of the object that is part of the multipart upload. Owner *Owner `type:"structure"` // The class of storage used to store the object. @@ -17778,8 +22737,8 @@ type NoncurrentVersionTransition struct { // Specifies the number of days an object is noncurrent before Amazon S3 can // perform the associated action. For information about the noncurrent days - // calculations, see How Amazon S3 Calculates When an Object Became Noncurrent - // (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-access-control.html) + // calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent + // (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations) // in the Amazon Simple Storage Service Developer Guide. NoncurrentDays *int64 `type:"integer"` @@ -17898,10 +22857,17 @@ func (s *NotificationConfiguration) SetTopicConfigurations(v []*TopicConfigurati type NotificationConfigurationDeprecated struct { _ struct{} `type:"structure"` + // Container for specifying the AWS Lambda notification configuration. CloudFunctionConfiguration *CloudFunctionConfiguration `type:"structure"` + // This data type is deprecated. This data type specifies the configuration + // for publishing messages to an Amazon Simple Queue Service (Amazon SQS) queue + // when Amazon S3 detects specified events. QueueConfiguration *QueueConfigurationDeprecated `type:"structure"` + // This data type is deprecated. A container for specifying the configuration + // for publication of messages to an Amazon Simple Notification Service (Amazon + // SNS) topic when Amazon S3 detects specified events. TopicConfiguration *TopicConfigurationDeprecated `type:"structure"` } @@ -17959,17 +22925,25 @@ func (s *NotificationConfigurationFilter) SetKey(v *KeyFilter) *NotificationConf return s } +// An object consists of data and its descriptive metadata. type Object struct { _ struct{} `type:"structure"` + // The entity tag is an MD5 hash of the object. ETag reflects only changes to + // the contents of an object, not its metadata. ETag *string `type:"string"` + // The name that you assign to an object. You use the object key to retrieve + // the object. Key *string `min:"1" type:"string"` + // The date the Object was Last Modified LastModified *time.Time `type:"timestamp"` + // The owner of the object Owner *Owner `type:"structure"` + // Size in bytes of the object Size *int64 `type:"integer"` // The class of storage used to store the object. @@ -18022,6 +22996,7 @@ func (s *Object) SetStorageClass(v string) *Object { return s } +// Object Identifier is unique value to identify objects. type ObjectIdentifier struct { _ struct{} `type:"structure"` @@ -18072,14 +23047,14 @@ func (s *ObjectIdentifier) SetVersionId(v string) *ObjectIdentifier { return s } -// The container element for object lock configuration parameters. +// The container element for Object Lock configuration parameters. type ObjectLockConfiguration struct { _ struct{} `type:"structure"` - // Indicates whether this bucket has an object lock configuration enabled. + // Indicates whether this bucket has an Object Lock configuration enabled. ObjectLockEnabled *string `type:"string" enum:"ObjectLockEnabled"` - // The object lock rule in place for the specified object. + // The Object Lock rule in place for the specified object. Rule *ObjectLockRule `type:"structure"` } @@ -18136,7 +23111,7 @@ type ObjectLockRetention struct { // Indicates the Retention mode for the specified object. Mode *string `type:"string" enum:"ObjectLockRetentionMode"` - // The date on which this object lock retention expires. + // The date on which this Object Lock Retention will expire. RetainUntilDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` } @@ -18162,7 +23137,7 @@ func (s *ObjectLockRetention) SetRetainUntilDate(v time.Time) *ObjectLockRetenti return s } -// The container element for an object lock rule. +// The container element for an Object Lock rule. type ObjectLockRule struct { _ struct{} `type:"structure"` @@ -18187,9 +23162,11 @@ func (s *ObjectLockRule) SetDefaultRetention(v *DefaultRetention) *ObjectLockRul return s } +// The version of an object. type ObjectVersion struct { _ struct{} `type:"structure"` + // The entity tag is an MD5 hash of that version of the object. ETag *string `type:"string"` // Specifies whether the object is (true) or is not (false) the latest version @@ -18202,6 +23179,7 @@ type ObjectVersion struct { // Date and time the object was last modified. LastModified *time.Time `type:"timestamp"` + // Specifies the owner of the object. Owner *Owner `type:"structure"` // Size in bytes of the object. @@ -18344,11 +23322,14 @@ func (s *OutputSerialization) SetJSON(v *JSONOutput) *OutputSerialization { return s } +// Container for the owner's display name and ID. type Owner struct { _ struct{} `type:"structure"` + // Container for the display name of the owner. DisplayName *string `type:"string"` + // Container for the ID of the owner. ID *string `type:"string"` } @@ -18374,6 +23355,7 @@ func (s *Owner) SetID(v string) *Owner { return s } +// Container for Parquet. type ParquetInput struct { _ struct{} `type:"structure"` } @@ -18388,6 +23370,7 @@ func (s ParquetInput) GoString() string { return s.String() } +// Container for elements related to a part. type Part struct { _ struct{} `type:"structure"` @@ -18464,6 +23447,7 @@ func (s *PolicyStatus) SetIsPublic(v bool) *PolicyStatus { return s } +// This data type contains information about progress of an operation. type Progress struct { _ struct{} `type:"structure"` @@ -18505,6 +23489,7 @@ func (s *Progress) SetBytesScanned(v int64) *Progress { return s } +// This data type contains information about the progress event of an operation. type ProgressEvent struct { _ struct{} `locationName:"ProgressEvent" type:"structure" payload:"Details"` @@ -18545,7 +23530,21 @@ func (s *ProgressEvent) UnmarshalEvent( return nil } -// Specifies the Block Public Access configuration for an Amazon S3 bucket. +func (s *ProgressEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + +// The PublicAccessBlock configuration that you want to apply to this Amazon +// S3 bucket. You can enable the configuration options in any combination. For +// more information about when Amazon S3 considers a bucket or object public, +// see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) +// in the Amazon Simple Storage Service Developer Guide. type PublicAccessBlockConfiguration struct { _ struct{} `type:"structure"` @@ -18558,6 +23557,8 @@ type PublicAccessBlockConfiguration struct { // // * PUT Object calls fail if the request includes a public ACL. // + // * PUT Bucket calls fail if the request includes a public ACL. + // // Enabling this setting doesn't affect existing policies or ACLs. BlockPublicAcls *bool `locationName:"BlockPublicAcls" type:"boolean"` @@ -18624,7 +23625,7 @@ func (s *PublicAccessBlockConfiguration) SetRestrictPublicBuckets(v bool) *Publi type PutBucketAccelerateConfigurationInput struct { _ struct{} `locationName:"PutBucketAccelerateConfigurationRequest" type:"structure" payload:"AccelerateConfiguration"` - // Specifies the Accelerate Configuration you want to set for the bucket. + // Container for setting the transfer acceleration state. // // AccelerateConfiguration is a required field AccelerateConfiguration *AccelerateConfiguration `locationName:"AccelerateConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` @@ -18683,6 +23684,20 @@ func (s *PutBucketAccelerateConfigurationInput) getBucket() (v string) { return *s.Bucket } +func (s *PutBucketAccelerateConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketAccelerateConfigurationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketAccelerateConfigurationOutput struct { _ struct{} `type:"structure"` } @@ -18706,6 +23721,8 @@ type PutBucketAclInput struct { // Contains the elements that set the ACL permissions for an object per grantee. AccessControlPolicy *AccessControlPolicy `locationName:"AccessControlPolicy" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + // The bucket to which to apply the ACL. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -18812,6 +23829,20 @@ func (s *PutBucketAclInput) SetGrantWriteACP(v string) *PutBucketAclInput { return s } +func (s *PutBucketAclInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketAclInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketAclOutput struct { _ struct{} `type:"structure"` } @@ -18907,6 +23938,20 @@ func (s *PutBucketAnalyticsConfigurationInput) SetId(v string) *PutBucketAnalyti return s } +func (s *PutBucketAnalyticsConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketAnalyticsConfigurationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketAnalyticsConfigurationOutput struct { _ struct{} `type:"structure"` } @@ -18924,12 +23969,14 @@ func (s PutBucketAnalyticsConfigurationOutput) GoString() string { type PutBucketCorsInput struct { _ struct{} `locationName:"PutBucketCorsRequest" type:"structure" payload:"CORSConfiguration"` + // Specifies the bucket impacted by the corsconfiguration. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` // Describes the cross-origin access configuration for objects in an Amazon // S3 bucket. For more information, see Enabling Cross-Origin Resource Sharing - // (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the Amazon + // (https://docs.aws.amazon.com/AmazonS3/latest/dev//cors.html) in the Amazon // Simple Storage Service Developer Guide. // // CORSConfiguration is a required field @@ -18989,6 +24036,20 @@ func (s *PutBucketCorsInput) SetCORSConfiguration(v *CORSConfiguration) *PutBuck return s } +func (s *PutBucketCorsInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketCorsInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketCorsOutput struct { _ struct{} `type:"structure"` } @@ -19007,9 +24068,9 @@ type PutBucketEncryptionInput struct { _ struct{} `locationName:"PutBucketEncryptionRequest" type:"structure" payload:"ServerSideEncryptionConfiguration"` // Specifies default encryption for a bucket using server-side encryption with - // Amazon S3-managed keys (SSE-S3) or AWS KMS-managed keys (SSE-KMS). For information - // about the Amazon S3 default encryption feature, see Amazon S3 Default Bucket - // Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) + // Amazon S3-managed keys (SSE-S3) or customer master keys stored in AWS KMS + // (SSE-KMS). For information about the Amazon S3 default encryption feature, + // see Amazon S3 Default Bucket Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field @@ -19074,6 +24135,20 @@ func (s *PutBucketEncryptionInput) SetServerSideEncryptionConfiguration(v *Serve return s } +func (s *PutBucketEncryptionInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketEncryptionInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketEncryptionOutput struct { _ struct{} `type:"structure"` } @@ -19169,6 +24244,20 @@ func (s *PutBucketInventoryConfigurationInput) SetInventoryConfiguration(v *Inve return s } +func (s *PutBucketInventoryConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketInventoryConfigurationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketInventoryConfigurationOutput struct { _ struct{} `type:"structure"` } @@ -19186,12 +24275,12 @@ func (s PutBucketInventoryConfigurationOutput) GoString() string { type PutBucketLifecycleConfigurationInput struct { _ struct{} `locationName:"PutBucketLifecycleConfigurationRequest" type:"structure" payload:"LifecycleConfiguration"` + // The name of the bucket for which to set the configuration. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // Specifies the lifecycle configuration for objects in an Amazon S3 bucket. - // For more information, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) - // in the Amazon Simple Storage Service Developer Guide. + // Container for lifecycle rules. You can add as many as 1,000 rules. LifecycleConfiguration *BucketLifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } @@ -19245,6 +24334,20 @@ func (s *PutBucketLifecycleConfigurationInput) SetLifecycleConfiguration(v *Buck return s } +func (s *PutBucketLifecycleConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketLifecycleConfigurationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketLifecycleConfigurationOutput struct { _ struct{} `type:"structure"` } @@ -19265,6 +24368,7 @@ type PutBucketLifecycleInput struct { // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // Container for lifecycle rules. You can add as many as 1000 rules. LifecycleConfiguration *LifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } @@ -19318,6 +24422,20 @@ func (s *PutBucketLifecycleInput) SetLifecycleConfiguration(v *LifecycleConfigur return s } +func (s *PutBucketLifecycleInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketLifecycleInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketLifecycleOutput struct { _ struct{} `type:"structure"` } @@ -19335,9 +24453,13 @@ func (s PutBucketLifecycleOutput) GoString() string { type PutBucketLoggingInput struct { _ struct{} `locationName:"PutBucketLoggingRequest" type:"structure" payload:"BucketLoggingStatus"` + // The name of the bucket for which to set the logging parameters. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // Container for logging status information. + // // BucketLoggingStatus is a required field BucketLoggingStatus *BucketLoggingStatus `locationName:"BucketLoggingStatus" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } @@ -19395,6 +24517,20 @@ func (s *PutBucketLoggingInput) SetBucketLoggingStatus(v *BucketLoggingStatus) * return s } +func (s *PutBucketLoggingInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketLoggingInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketLoggingOutput struct { _ struct{} `type:"structure"` } @@ -19490,6 +24626,20 @@ func (s *PutBucketMetricsConfigurationInput) SetMetricsConfiguration(v *MetricsC return s } +func (s *PutBucketMetricsConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketMetricsConfigurationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketMetricsConfigurationOutput struct { _ struct{} `type:"structure"` } @@ -19507,6 +24657,8 @@ func (s PutBucketMetricsConfigurationOutput) GoString() string { type PutBucketNotificationConfigurationInput struct { _ struct{} `locationName:"PutBucketNotificationConfigurationRequest" type:"structure" payload:"NotificationConfiguration"` + // The name of the bucket. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -19570,6 +24722,20 @@ func (s *PutBucketNotificationConfigurationInput) SetNotificationConfiguration(v return s } +func (s *PutBucketNotificationConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketNotificationConfigurationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketNotificationConfigurationOutput struct { _ struct{} `type:"structure"` } @@ -19587,9 +24753,13 @@ func (s PutBucketNotificationConfigurationOutput) GoString() string { type PutBucketNotificationInput struct { _ struct{} `locationName:"PutBucketNotificationRequest" type:"structure" payload:"NotificationConfiguration"` + // The name of the bucket. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // The container for the configuration. + // // NotificationConfiguration is a required field NotificationConfiguration *NotificationConfigurationDeprecated `locationName:"NotificationConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } @@ -19642,6 +24812,20 @@ func (s *PutBucketNotificationInput) SetNotificationConfiguration(v *Notificatio return s } +func (s *PutBucketNotificationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketNotificationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketNotificationOutput struct { _ struct{} `type:"structure"` } @@ -19659,6 +24843,8 @@ func (s PutBucketNotificationOutput) GoString() string { type PutBucketPolicyInput struct { _ struct{} `locationName:"PutBucketPolicyRequest" type:"structure" payload:"Policy"` + // The name of the bucket. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -19726,6 +24912,20 @@ func (s *PutBucketPolicyInput) SetPolicy(v string) *PutBucketPolicyInput { return s } +func (s *PutBucketPolicyInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketPolicyInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketPolicyOutput struct { _ struct{} `type:"structure"` } @@ -19743,6 +24943,8 @@ func (s PutBucketPolicyOutput) GoString() string { type PutBucketReplicationInput struct { _ struct{} `locationName:"PutBucketReplicationRequest" type:"structure" payload:"ReplicationConfiguration"` + // The name of the bucket + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -19752,7 +24954,6 @@ type PutBucketReplicationInput struct { // ReplicationConfiguration is a required field ReplicationConfiguration *ReplicationConfiguration `locationName:"ReplicationConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - // A token that allows Amazon S3 object lock to be enabled for an existing bucket. Token *string `location:"header" locationName:"x-amz-bucket-object-lock-token" type:"string"` } @@ -19815,6 +25016,20 @@ func (s *PutBucketReplicationInput) SetToken(v string) *PutBucketReplicationInpu return s } +func (s *PutBucketReplicationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketReplicationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketReplicationOutput struct { _ struct{} `type:"structure"` } @@ -19832,9 +25047,13 @@ func (s PutBucketReplicationOutput) GoString() string { type PutBucketRequestPaymentInput struct { _ struct{} `locationName:"PutBucketRequestPaymentRequest" type:"structure" payload:"RequestPaymentConfiguration"` + // The bucket name. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // Container for Payer. + // // RequestPaymentConfiguration is a required field RequestPaymentConfiguration *RequestPaymentConfiguration `locationName:"RequestPaymentConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } @@ -19892,6 +25111,20 @@ func (s *PutBucketRequestPaymentInput) SetRequestPaymentConfiguration(v *Request return s } +func (s *PutBucketRequestPaymentInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketRequestPaymentInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketRequestPaymentOutput struct { _ struct{} `type:"structure"` } @@ -19909,9 +25142,13 @@ func (s PutBucketRequestPaymentOutput) GoString() string { type PutBucketTaggingInput struct { _ struct{} `locationName:"PutBucketTaggingRequest" type:"structure" payload:"Tagging"` + // The bucket name. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // Container for the TagSet and Tag elements. + // // Tagging is a required field Tagging *Tagging `locationName:"Tagging" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` } @@ -19969,6 +25206,20 @@ func (s *PutBucketTaggingInput) SetTagging(v *Tagging) *PutBucketTaggingInput { return s } +func (s *PutBucketTaggingInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketTaggingInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketTaggingOutput struct { _ struct{} `type:"structure"` } @@ -19986,6 +25237,8 @@ func (s PutBucketTaggingOutput) GoString() string { type PutBucketVersioningInput struct { _ struct{} `locationName:"PutBucketVersioningRequest" type:"structure" payload:"VersioningConfiguration"` + // The bucket name. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -19993,9 +25246,7 @@ type PutBucketVersioningInput struct { // and the value that is displayed on your authentication device. MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` - // Describes the versioning state of an Amazon S3 bucket. For more information, - // see PUT Bucket versioning (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html) - // in the Amazon Simple Storage Service API Reference. + // Container for setting the versioning state. // // VersioningConfiguration is a required field VersioningConfiguration *VersioningConfiguration `locationName:"VersioningConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` @@ -20055,6 +25306,20 @@ func (s *PutBucketVersioningInput) SetVersioningConfiguration(v *VersioningConfi return s } +func (s *PutBucketVersioningInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketVersioningInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketVersioningOutput struct { _ struct{} `type:"structure"` } @@ -20072,10 +25337,12 @@ func (s PutBucketVersioningOutput) GoString() string { type PutBucketWebsiteInput struct { _ struct{} `locationName:"PutBucketWebsiteRequest" type:"structure" payload:"WebsiteConfiguration"` + // The bucket name. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // Specifies website configuration parameters for an Amazon S3 bucket. + // Container for the request. // // WebsiteConfiguration is a required field WebsiteConfiguration *WebsiteConfiguration `locationName:"WebsiteConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` @@ -20134,6 +25401,20 @@ func (s *PutBucketWebsiteInput) SetWebsiteConfiguration(v *WebsiteConfiguration) return s } +func (s *PutBucketWebsiteInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutBucketWebsiteInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutBucketWebsiteOutput struct { _ struct{} `type:"structure"` } @@ -20151,12 +25432,23 @@ func (s PutBucketWebsiteOutput) GoString() string { type PutObjectAclInput struct { _ struct{} `locationName:"PutObjectAclRequest" type:"structure" payload:"AccessControlPolicy"` - // The canned ACL to apply to the object. + // The canned ACL to apply to the object. For more information, see Canned ACL + // (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` // Contains the elements that set the ACL permissions for an object per grantee. AccessControlPolicy *AccessControlPolicy `locationName:"AccessControlPolicy" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + // The bucket name that contains the object to which you want to attach the + // ACL. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -20176,13 +25468,16 @@ type PutObjectAclInput struct { // Allows grantee to write the ACL for the applicable bucket. GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` + // Key for which the PUT operation was initiated. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` // VersionId used to reference a specific version of the object. @@ -20299,6 +25594,20 @@ func (s *PutObjectAclInput) SetVersionId(v string) *PutObjectAclInput { return s } +func (s *PutObjectAclInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutObjectAclInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutObjectAclOutput struct { _ struct{} `type:"structure"` @@ -20326,44 +25635,62 @@ func (s *PutObjectAclOutput) SetRequestCharged(v string) *PutObjectAclOutput { type PutObjectInput struct { _ struct{} `locationName:"PutObjectRequest" type:"structure" payload:"Body"` - // The canned ACL to apply to the object. + // The canned ACL to apply to the object. For more information, see Canned ACL + // (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` // Object data. Body io.ReadSeeker `type:"blob"` - // Name of the bucket to which the PUT operation was initiated. + // Bucket name to which the PUT operation was initiated. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // Specifies caching behavior along the request/reply chain. + // Can be used to specify caching behavior along the request/reply chain. For + // more information, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 + // (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9). CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` - // Specifies presentational information for the object. + // Specifies presentational information for the object. For more information, + // see http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1). ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` // Specifies what content encodings have been applied to the object and thus // what decoding mechanisms must be applied to obtain the media-type referenced - // by the Content-Type header field. + // by the Content-Type header field. For more information, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11 + // (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11). ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` // The language the content is in. ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` // Size of the body in bytes. This parameter is useful when the size of the - // body cannot be determined automatically. + // body cannot be determined automatically. For more information, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13 + // (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13). ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` - // The base64-encoded 128-bit MD5 digest of the part data. This parameter is - // auto-populated when using the command from the CLI. This parameted is required - // if object lock parameters are specified. + // The base64-encoded 128-bit MD5 digest of the message (without the headers) + // according to RFC 1864. This header can be used as a message integrity check + // to verify that the data is the same data that was originally sent. Although + // it is optional, we recommend using the Content-MD5 mechanism as an end-to-end + // integrity check. For more information about REST request authentication, + // see REST Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html). ContentMD5 *string `location:"header" locationName:"Content-MD5" type:"string"` - // A standard MIME type describing the format of the object data. + // A standard MIME type describing the format of the contents. For more information, + // see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17). ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - // The date and time at which the object is no longer cacheable. + // The date and time at which the object is no longer cacheable. For more information, + // see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21). Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp"` // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. @@ -20386,34 +25713,37 @@ type PutObjectInput struct { // A map of metadata to store with the object in S3. Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` - // The Legal Hold status that you want to apply to the specified object. + // Specifies whether a legal hold will be applied to this object. For more information + // about S3 Object Lock, see Object Lock (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - // The object lock mode that you want to apply to this object. + // The Object Lock mode that you want to apply to this object. ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - // The date and time when you want this object's object lock to expire. + // The date and time when you want this object's Object Lock to expire. ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - // Specifies the algorithm to use to when encrypting the object (e.g., AES256). + // Specifies the algorithm to use to when encrypting the object (for example, + // AES256). SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting // data. This value is used to store the object and then it is discarded; Amazon - // does not store the encryption key. The key must be appropriate for use with - // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // S3 does not store the encryption key. The key must be appropriate for use + // with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm // header. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. + // Amazon S3 uses this header for a message integrity check to ensure that the + // encryption key was transmitted without error. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` // Specifies the AWS KMS Encryption Context to use for object encryption. The @@ -20421,17 +25751,24 @@ type PutObjectInput struct { // encryption context key-value pairs. SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - // Specifies the AWS KMS key ID to use for object encryption. All GET and PUT - // requests for an object protected by AWS KMS will fail if not made via SSL - // or using SigV4. Documentation on configuring any of the officially supported - // AWS SDKs and CLI can be found at http://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version + // If x-amz-server-side-encryption is present and has the value of aws:kms, + // this header specifies the ID of the AWS Key Management Service (AWS KMS) + // symmetrical customer managed customer master key (CMK) that was used for + // the object. + // + // If the value of x-amz-server-side-encryption is aws:kms, this header specifies + // the ID of the symmetric customer managed AWS KMS CMK that will be used for + // the object. If you specify x-amz-server-side-encryption:aws:kms, but do not + // providex-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the AWS + // managed CMK in AWS to protect the data. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). + // The server-side encryption algorithm used when storing this object in Amazon + // S3 (for example, AES256, aws:kms). ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - // The type of storage to use for the object. Defaults to 'STANDARD'. + // If you don't specify, Standard is the default storage class. Amazon S3 supports + // other storage classes. 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. @@ -20440,7 +25777,22 @@ type PutObjectInput struct { // 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. + // the value of this header in the object metadata. For information about object + // metadata, see Object Key and Metadata (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html). + // + // In the following example, the request header sets the redirect to an object + // (anotherPage.html) in the same bucket: + // + // x-amz-website-redirect-location: /anotherPage.html + // + // In the following example, the request header sets the object redirect to + // another website: + // + // x-amz-website-redirect-location: http://www.example.com/ + // + // For more information about website hosting in Amazon S3, see Hosting Websites + // on Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html) + // and How to Configure Website Page Redirects (https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html). WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` } @@ -20670,10 +26022,32 @@ func (s *PutObjectInput) SetWebsiteRedirectLocation(v string) *PutObjectInput { return s } +func (s *PutObjectInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutObjectInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutObjectLegalHoldInput struct { _ struct{} `locationName:"PutObjectLegalHoldRequest" type:"structure" payload:"LegalHold"` - // The bucket containing the object that you want to place a Legal Hold on. + // The bucket name containing the object that you want to place a Legal Hold + // on. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -20687,10 +26061,11 @@ type PutObjectLegalHoldInput struct { // specified object. LegalHold *ObjectLockLegalHold `locationName:"LegalHold" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` // The version ID of the object that you want to place a Legal Hold on. @@ -20766,6 +26141,20 @@ func (s *PutObjectLegalHoldInput) SetVersionId(v string) *PutObjectLegalHoldInpu return s } +func (s *PutObjectLegalHoldInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutObjectLegalHoldInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutObjectLegalHoldOutput struct { _ struct{} `type:"structure"` @@ -20793,21 +26182,22 @@ func (s *PutObjectLegalHoldOutput) SetRequestCharged(v string) *PutObjectLegalHo type PutObjectLockConfigurationInput struct { _ struct{} `locationName:"PutObjectLockConfigurationRequest" type:"structure" payload:"ObjectLockConfiguration"` - // The bucket whose object lock configuration you want to create or replace. + // The bucket whose Object Lock configuration you want to create or replace. // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // The object lock configuration that you want to apply to the specified bucket. + // The Object Lock configuration that you want to apply to the specified bucket. ObjectLockConfiguration *ObjectLockConfiguration `locationName:"ObjectLockConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - // A token to allow Amazon S3 object lock to be enabled for an existing bucket. + // A token to allow Object Lock to be enabled for an existing bucket. Token *string `location:"header" locationName:"x-amz-bucket-object-lock-token" type:"string"` } @@ -20868,6 +26258,20 @@ func (s *PutObjectLockConfigurationInput) SetToken(v string) *PutObjectLockConfi return s } +func (s *PutObjectLockConfigurationInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutObjectLockConfigurationInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutObjectLockConfigurationOutput struct { _ struct{} `type:"structure"` @@ -20898,8 +26302,10 @@ type PutObjectOutput struct { // Entity tag for the uploaded object. ETag *string `location:"header" locationName:"ETag" type:"string"` - // If the object expiration is configured, this will contain the expiration - // date (expiry-date) and rule ID (rule-id). The value of rule-id is URL encoded. + // If the expiration is configured for the object (see PutBucketLifecycleConfiguration), + // the response includes this header. It includes the expiry-date and rule-id + // key-value pairs that provide information about object expiration. The value + // of the rule-id is URL encoded. Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` // If present, indicates that the requester was successfully charged for the @@ -20912,7 +26318,7 @@ type PutObjectOutput struct { SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round trip message integrity + // the response will include this header to provide round-trip message integrity // verification of the customer-provided encryption key. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` @@ -20921,12 +26327,16 @@ type PutObjectOutput struct { // the encryption context key-value pairs. SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - // If present, specifies the ID of the AWS Key Management Service (KMS) master - // encryption key that was used for the object. + // If x-amz-server-side-encryption is present and has the value of aws:kms, + // this header specifies the ID of the AWS Key Management Service (AWS KMS) + // symmetric customer managed customer master key (CMK) that was used for the + // object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). + // If you specified server-side encryption either with an AWS KMS customer master + // key (CMK) or Amazon S3-managed encryption key in your PUT request, the response + // includes this header. It confirms the encryption algorithm that Amazon S3 + // used to encrypt the object. ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` // Version of the object. @@ -21000,13 +26410,20 @@ func (s *PutObjectOutput) SetVersionId(v string) *PutObjectOutput { type PutObjectRetentionInput struct { _ struct{} `locationName:"PutObjectRetentionRequest" type:"structure" payload:"Retention"` - // The bucket that contains the object you want to apply this Object Retention + // The bucket name that contains the object you want to apply this Object Retention // configuration to. // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - // Indicates whether this operation should bypass Governance-mode restrictions.j + // Indicates whether this operation should bypass Governance-mode restrictions. BypassGovernanceRetention *bool `location:"header" locationName:"x-amz-bypass-governance-retention" type:"boolean"` // The key name for the object that you want to apply this Object Retention @@ -21015,10 +26432,11 @@ type PutObjectRetentionInput struct { // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` // The container element for the Object Retention configuration. @@ -21098,10 +26516,24 @@ func (s *PutObjectRetentionInput) SetRetention(v *ObjectLockRetention) *PutObjec return s } -// SetVersionId sets the VersionId field's value. -func (s *PutObjectRetentionInput) SetVersionId(v string) *PutObjectRetentionInput { - s.VersionId = &v - return s +// SetVersionId sets the VersionId field's value. +func (s *PutObjectRetentionInput) SetVersionId(v string) *PutObjectRetentionInput { + s.VersionId = &v + return s +} + +func (s *PutObjectRetentionInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutObjectRetentionInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) } type PutObjectRetentionOutput struct { @@ -21131,15 +26563,29 @@ func (s *PutObjectRetentionOutput) SetRequestCharged(v string) *PutObjectRetenti type PutObjectTaggingInput struct { _ struct{} `locationName:"PutObjectTaggingRequest" type:"structure" payload:"Tagging"` + // The bucket name containing the object. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // Name of the tag. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` + // Container for the TagSet and Tag elements + // // Tagging is a required field Tagging *Tagging `locationName:"Tagging" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + // The versionId of the object that the tag-set will be added to. VersionId *string `location:"querystring" locationName:"versionId" type:"string"` } @@ -21214,9 +26660,24 @@ func (s *PutObjectTaggingInput) SetVersionId(v string) *PutObjectTaggingInput { return s } +func (s *PutObjectTaggingInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutObjectTaggingInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutObjectTaggingOutput struct { _ struct{} `type:"structure"` + // The versionId of the object the tag-set was added to. VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` } @@ -21303,6 +26764,20 @@ func (s *PutPublicAccessBlockInput) SetPublicAccessBlockConfiguration(v *PublicA return s } +func (s *PutPublicAccessBlockInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *PutPublicAccessBlockInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type PutPublicAccessBlockOutput struct { _ struct{} `type:"structure"` } @@ -21322,6 +26797,8 @@ func (s PutPublicAccessBlockOutput) GoString() string { type QueueConfiguration struct { _ struct{} `type:"structure"` + // A collection of bucket events for which to send notifications + // // Events is a required field Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true"` @@ -21391,6 +26868,10 @@ func (s *QueueConfiguration) SetQueueArn(v string) *QueueConfiguration { return s } +// This data type is deprecated. Use QueueConfiguration for the same purposes. +// This data type specifies the configuration for publishing messages to an +// Amazon Simple Queue Service (Amazon SQS) queue when Amazon S3 detects specified +// events. type QueueConfigurationDeprecated struct { _ struct{} `type:"structure"` @@ -21399,12 +26880,15 @@ type QueueConfigurationDeprecated struct { // Deprecated: Event has been deprecated Event *string `deprecated:"true" type:"string" enum:"Event"` + // A collection of bucket events for which to send notifications Events []*string `locationName:"Event" type:"list" flattened:"true"` // An optional unique identifier for configurations in a notification configuration. // If you don't provide one, Amazon S3 will assign an ID. Id *string `type:"string"` + // The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 + // publishes a message when it detects events of the specified type. Queue *string `type:"string"` } @@ -21442,6 +26926,7 @@ func (s *QueueConfigurationDeprecated) SetQueue(v string) *QueueConfigurationDep return s } +// The container for the records event. type RecordsEvent struct { _ struct{} `locationName:"RecordsEvent" type:"structure" payload:"Payload"` @@ -21481,6 +26966,13 @@ func (s *RecordsEvent) UnmarshalEvent( return nil } +func (s *RecordsEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) + msg.Headers.Set(":content-type", eventstream.StringValue("application/octet-stream")) + msg.Payload = s.Payload + return msg, err +} + // Specifies how requests are redirected. In the event of an error, you can // specify a different error code to return. type Redirect struct { @@ -21608,7 +27100,7 @@ type ReplicationConfiguration struct { // The Amazon Resource Name (ARN) of the AWS Identity and Access Management // (IAM) role that Amazon S3 assumes when replicating objects. For more information, - // see How to Set Up Cross-Region Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/crr-how-setup.html) + // see How to Set Up Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-how-setup.html) // in the Amazon Simple Storage Service Developer Guide. // // Role is a required field @@ -21673,14 +27165,30 @@ func (s *ReplicationConfiguration) SetRules(v []*ReplicationRule) *ReplicationCo type ReplicationRule struct { _ struct{} `type:"structure"` - // Specifies whether Amazon S3 should replicate delete makers. + // Specifies whether Amazon S3 replicates the delete markers. If you specify + // a Filter, you must specify this element. However, in the latest version of + // replication configuration (when Filter is specified), Amazon S3 doesn't replicate + // delete markers. Therefore, the DeleteMarkerReplication element can contain + // only Disabled. For an example configuration, see Basic Rule + // Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-config-min-rule-config). + // + // If you don't specify the Filter element, Amazon S3 assumes that the replication + // configuration is the earlier version, V1. In the earlier version, Amazon + // S3 handled replication of delete markers differently. For more information, + // see Backward Compatibility (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations). DeleteMarkerReplication *DeleteMarkerReplication `type:"structure"` - // A container for information about the replication destination. + // A container for information about the replication destination and its configurations + // including enabling the S3 Replication Time Control (S3 RTC). // // Destination is a required field Destination *Destination `type:"structure" required:"true"` + // Optional configuration to replicate existing source bucket objects. For more + // information, see Replicating Existing Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-what-is-isnot-replicated.html#existing-object-replication) + // in the Amazon S3 Developer Guide. + ExistingObjectReplication *ExistingObjectReplication `type:"structure"` + // A filter that identifies the subset of objects to which the replication rule // applies. A Filter must specify exactly one Prefix, Tag, or an And child element. Filter *ReplicationRuleFilter `type:"structure"` @@ -21688,9 +27196,9 @@ type ReplicationRule struct { // A unique identifier for the rule. The maximum value is 255 characters. ID *string `type:"string"` - // An object keyname prefix that identifies the object or objects to which the - // rule applies. The maximum prefix length is 1,024 characters. To include all - // objects in a bucket, specify an empty string. + // An object key name prefix that identifies the object or objects to which + // the rule applies. The maximum prefix length is 1,024 characters. To include + // all objects in a bucket, specify an empty string. // // Deprecated: Prefix has been deprecated Prefix *string `deprecated:"true" type:"string"` @@ -21700,21 +27208,21 @@ type ReplicationRule struct { // when filtering. If two or more rules identify the same object based on a // specified filter, the rule with higher priority takes precedence. For example: // - // * Same object quality prefix based filter criteria If prefixes you specified + // * Same object quality prefix-based filter criteria if prefixes you specified // in multiple rules overlap // - // * Same object qualify tag based filter criteria specified in multiple + // * Same object qualify tag-based filter criteria specified in multiple // rules // - // For more information, see Cross-Region Replication (CRR) (https://docs.aws.amazon.com/AmazonS3/latest/dev/crr.html) - // in the Amazon S3 Developer Guide. + // For more information, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) + // in the Amazon Simple Storage Service Developer Guide. Priority *int64 `type:"integer"` // A container that describes additional filters for identifying the source // objects that you want to replicate. You can choose to enable or disable the // replication of these objects. Currently, Amazon S3 supports only the filter // that you can specify for objects created with server-side encryption using - // an AWS KMS-Managed Key (SSE-KMS). + // a customer master key (CMK) stored in AWS Key Management Service (SSE-KMS). SourceSelectionCriteria *SourceSelectionCriteria `type:"structure"` // Specifies whether the rule is enabled. @@ -21747,6 +27255,11 @@ func (s *ReplicationRule) Validate() error { invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) } } + if s.ExistingObjectReplication != nil { + if err := s.ExistingObjectReplication.Validate(); err != nil { + invalidParams.AddNested("ExistingObjectReplication", err.(request.ErrInvalidParams)) + } + } if s.Filter != nil { if err := s.Filter.Validate(); err != nil { invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) @@ -21776,6 +27289,12 @@ func (s *ReplicationRule) SetDestination(v *Destination) *ReplicationRule { return s } +// SetExistingObjectReplication sets the ExistingObjectReplication field's value. +func (s *ReplicationRule) SetExistingObjectReplication(v *ExistingObjectReplication) *ReplicationRule { + s.ExistingObjectReplication = v + return s +} + // SetFilter sets the Filter field's value. func (s *ReplicationRule) SetFilter(v *ReplicationRuleFilter) *ReplicationRule { s.Filter = v @@ -21812,11 +27331,25 @@ func (s *ReplicationRule) SetStatus(v string) *ReplicationRule { return s } +// A container for specifying rule filters. The filters determine the subset +// of objects to which the rule applies. This element is required only if you +// specify more than one filter. +// +// For example: +// +// * If you specify both a Prefix and a Tag filter, wrap these filters in +// an And tag. +// +// * If you specify a filter based on multiple tags, wrap the Tag elements +// in an And tag type ReplicationRuleAndOperator struct { _ struct{} `type:"structure"` + // An object key name prefix that identifies the subset of objects to which + // the rule applies. Prefix *string `type:"string"` + // An array of tags containing key and value pairs. Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` } @@ -21878,8 +27411,8 @@ type ReplicationRuleFilter struct { // in an And tag. And *ReplicationRuleAndOperator `type:"structure"` - // An object keyname prefix that identifies the subset of objects to which the - // rule applies. + // An object key name prefix that identifies the subset of objects to which + // the rule applies. Prefix *string `type:"string"` // A container for specifying a tag key and value. @@ -21936,6 +27469,91 @@ func (s *ReplicationRuleFilter) SetTag(v *Tag) *ReplicationRuleFilter { return s } +// A container specifying S3 Replication Time Control (S3 RTC) related information, +// including whether S3 RTC is enabled and the time when all objects and operations +// on objects must be replicated. Must be specified together with a Metrics +// block. +type ReplicationTime struct { + _ struct{} `type:"structure"` + + // Specifies whether the replication time is enabled. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"ReplicationTimeStatus"` + + // A container specifying the time by which replication should be complete for + // all objects and operations on objects. + // + // Time is a required field + Time *ReplicationTimeValue `type:"structure" required:"true"` +} + +// String returns the string representation +func (s ReplicationTime) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplicationTime) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ReplicationTime) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ReplicationTime"} + if s.Status == nil { + invalidParams.Add(request.NewErrParamRequired("Status")) + } + if s.Time == nil { + invalidParams.Add(request.NewErrParamRequired("Time")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetStatus sets the Status field's value. +func (s *ReplicationTime) SetStatus(v string) *ReplicationTime { + s.Status = &v + return s +} + +// SetTime sets the Time field's value. +func (s *ReplicationTime) SetTime(v *ReplicationTimeValue) *ReplicationTime { + s.Time = v + return s +} + +// A container specifying the time value for S3 Replication Time Control (S3 +// RTC) and replication metrics EventThreshold. +type ReplicationTimeValue struct { + _ struct{} `type:"structure"` + + // Contains an integer specifying time in minutes. + // + // Valid values: 15 minutes. + Minutes *int64 `type:"integer"` +} + +// String returns the string representation +func (s ReplicationTimeValue) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReplicationTimeValue) GoString() string { + return s.String() +} + +// SetMinutes sets the Minutes field's value. +func (s *ReplicationTimeValue) SetMinutes(v int64) *ReplicationTimeValue { + s.Minutes = &v + return s +} + +// Container for Payer. type RequestPaymentConfiguration struct { _ struct{} `type:"structure"` @@ -21974,6 +27592,7 @@ func (s *RequestPaymentConfiguration) SetPayer(v string) *RequestPaymentConfigur return s } +// Container for specifying if periodic QueryProgress messages should be sent. type RequestProgress struct { _ struct{} `type:"structure"` @@ -22001,21 +27620,34 @@ func (s *RequestProgress) SetEnabled(v bool) *RequestProgress { type RestoreObjectInput struct { _ struct{} `locationName:"RestoreObjectRequest" type:"structure" payload:"RestoreRequest"` + // The bucket name or containing the object to restore. + // + // When using this API with an access point, you must direct requests to the + // access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. + // When using this operation using an access point through the AWS SDKs, you + // provide the access point ARN in place of the bucket name. For more information + // about access point ARNs, see Using Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-access-points.html) + // in the Amazon Simple Storage Service Developer Guide. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` + // Object key for which the operation was initiated. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` // Container for restore job parameters. RestoreRequest *RestoreRequest `locationName:"RestoreRequest" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` + // VersionId used to reference a specific version of the object. VersionId *string `location:"querystring" locationName:"versionId" type:"string"` } @@ -22093,6 +27725,20 @@ func (s *RestoreObjectInput) SetVersionId(v string) *RestoreObjectInput { return s } +func (s *RestoreObjectInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *RestoreObjectInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type RestoreObjectOutput struct { _ struct{} `type:"structure"` @@ -22298,6 +27944,7 @@ type Rule struct { // in the Amazon Simple Storage Service Developer Guide. AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `type:"structure"` + // Specifies the expiration for the lifecycle of the object. Expiration *LifecycleExpiration `type:"structure"` // Unique identifier for the rule. The value can't be longer than 255 characters. @@ -22409,12 +28056,12 @@ func (s *Rule) SetTransition(v *Transition) *Rule { return s } -// Specifies the use of SSE-KMS to encrypt delivered Inventory reports. +// Specifies the use of SSE-KMS to encrypt delivered inventory reports. type SSEKMS struct { _ struct{} `locationName:"SSE-KMS" type:"structure"` - // Specifies the ID of the AWS Key Management Service (KMS) master encryption - // key to use for encrypting Inventory reports. + // Specifies the ID of the AWS Key Management Service (AWS KMS) symmetric customer + // managed customer master key (CMK) to use for encrypting inventory reports. // // KeyId is a required field KeyId *string `type:"string" required:"true" sensitive:"true"` @@ -22449,7 +28096,7 @@ func (s *SSEKMS) SetKeyId(v string) *SSEKMS { return s } -// Specifies the use of SSE-S3 to encrypt delivered Inventory reports. +// Specifies the use of SSE-S3 to encrypt delivered inventory reports. type SSES3 struct { _ struct{} `locationName:"SSE-S3" type:"structure"` } @@ -22464,75 +28111,51 @@ func (s SSES3) GoString() string { return s.String() } -// SelectObjectContentEventStream provides handling of EventStreams for -// the SelectObjectContent API. -// -// Use this type to receive SelectObjectContentEventStream events. The events -// can be read from the Events channel member. -// -// The events that can be received are: -// -// * ContinuationEvent -// * EndEvent -// * ProgressEvent -// * RecordsEvent -// * StatsEvent -type SelectObjectContentEventStream struct { - // Reader is the EventStream reader for the SelectObjectContentEventStream - // events. This value is automatically set by the SDK when the API call is made - // Use this member when unit testing your code with the SDK to mock out the - // EventStream Reader. - // - // Must not be nil. - Reader SelectObjectContentEventStreamReader +// Specifies the byte range of the object to get the records from. A record +// is processed when its first byte is contained by the range. This parameter +// is optional, but when specified, it must not be empty. See RFC 2616, Section +// 14.35.1 about how to specify the start and end of the range. +type ScanRange struct { + _ struct{} `type:"structure"` - // StreamCloser is the io.Closer for the EventStream connection. For HTTP - // EventStream this is the response Body. The stream will be closed when - // the Close method of the EventStream is called. - StreamCloser io.Closer + // Specifies the end of the byte range. This parameter is optional. Valid values: + // non-negative integers. The default value is one less than the size of the + // object being queried. If only the End parameter is supplied, it is interpreted + // to mean scan the last N bytes of the file. For example, 50 + // means scan the last 50 bytes. + End *int64 `type:"long"` + + // Specifies the start of the byte range. This parameter is optional. Valid + // values: non-negative integers. The default value is 0. If only start is supplied, + // it means scan from that point to the end of the file.For example; 50 + // means scan from byte 50 until the end of the file. + Start *int64 `type:"long"` } -// Close closes the EventStream. This will also cause the Events channel to be -// closed. You can use the closing of the Events channel to terminate your -// application's read from the API's EventStream. -// -// Will close the underlying EventStream reader. For EventStream over HTTP -// connection this will also close the HTTP connection. -// -// Close must be called when done using the EventStream API. Not calling Close -// may result in resource leaks. -func (es *SelectObjectContentEventStream) Close() (err error) { - es.Reader.Close() - return es.Err() +// String returns the string representation +func (s ScanRange) String() string { + return awsutil.Prettify(s) } -// Err returns any error that occurred while reading EventStream Events from -// the service API's response. Returns nil if there were no errors. -func (es *SelectObjectContentEventStream) Err() error { - if err := es.Reader.Err(); err != nil { - return err - } - es.StreamCloser.Close() +// GoString returns the string representation +func (s ScanRange) GoString() string { + return s.String() +} - return nil +// SetEnd sets the End field's value. +func (s *ScanRange) SetEnd(v int64) *ScanRange { + s.End = &v + return s } -// Events returns a channel to read EventStream Events from the -// SelectObjectContent API. -// -// These events are: -// -// * ContinuationEvent -// * EndEvent -// * ProgressEvent -// * RecordsEvent -// * StatsEvent -func (es *SelectObjectContentEventStream) Events() <-chan SelectObjectContentEventStreamEvent { - return es.Reader.Events() +// SetStart sets the Start field's value. +func (s *ScanRange) SetStart(v int64) *ScanRange { + s.Start = &v + return s } // SelectObjectContentEventStreamEvent groups together all EventStream -// events read from the SelectObjectContent API. +// events writes for SelectObjectContentEventStream. // // These events are: // @@ -22543,11 +28166,12 @@ func (es *SelectObjectContentEventStream) Events() <-chan SelectObjectContentEve // * StatsEvent type SelectObjectContentEventStreamEvent interface { eventSelectObjectContentEventStream() + eventstreamapi.Marshaler + eventstreamapi.Unmarshaler } -// SelectObjectContentEventStreamReader provides the interface for reading EventStream -// Events from the SelectObjectContent API. The -// default implementation for this interface will be SelectObjectContentEventStream. +// SelectObjectContentEventStreamReader provides the interface for reading to the stream. The +// default implementation for this interface will be SelectObjectContentEventStreamData. // // The reader's Close method must allow multiple concurrent calls. // @@ -22562,8 +28186,7 @@ type SelectObjectContentEventStreamReader interface { // Returns a channel of events as they are read from the event stream. Events() <-chan SelectObjectContentEventStreamEvent - // Close will close the underlying event stream reader. For event stream over - // HTTP this will also close the HTTP connection. + // Close will stop the reader reading events from the stream. Close() error // Returns any error that has occurred while reading from the event stream. @@ -22573,57 +28196,44 @@ type SelectObjectContentEventStreamReader interface { type readSelectObjectContentEventStream struct { eventReader *eventstreamapi.EventReader stream chan SelectObjectContentEventStreamEvent - errVal atomic.Value + err *eventstreamapi.OnceError done chan struct{} closeOnce sync.Once } -func newReadSelectObjectContentEventStream( - reader io.ReadCloser, - unmarshalers request.HandlerList, - logger aws.Logger, - logLevel aws.LogLevelType, -) *readSelectObjectContentEventStream { +func newReadSelectObjectContentEventStream(eventReader *eventstreamapi.EventReader) *readSelectObjectContentEventStream { r := &readSelectObjectContentEventStream{ - stream: make(chan SelectObjectContentEventStreamEvent), - done: make(chan struct{}), + eventReader: eventReader, + stream: make(chan SelectObjectContentEventStreamEvent), + done: make(chan struct{}), + err: eventstreamapi.NewOnceError(), } - - r.eventReader = eventstreamapi.NewEventReader( - reader, - protocol.HandlerPayloadUnmarshal{ - Unmarshalers: unmarshalers, - }, - r.unmarshalerForEventType, - ) - r.eventReader.UseLogger(logger, logLevel) + go r.readEventStream() return r } -// Close will close the underlying event stream reader. For EventStream over -// HTTP this will also close the HTTP connection. +// Close will close the underlying event stream reader. func (r *readSelectObjectContentEventStream) Close() error { r.closeOnce.Do(r.safeClose) - return r.Err() } +func (r *readSelectObjectContentEventStream) ErrorSet() <-chan struct{} { + return r.err.ErrorSet() +} + +func (r *readSelectObjectContentEventStream) Closed() <-chan struct{} { + return r.done +} + func (r *readSelectObjectContentEventStream) safeClose() { close(r.done) - err := r.eventReader.Close() - if err != nil { - r.errVal.Store(err) - } } func (r *readSelectObjectContentEventStream) Err() error { - if v := r.errVal.Load(); v != nil { - return v.(error) - } - - return nil + return r.err.Err() } func (r *readSelectObjectContentEventStream) Events() <-chan SelectObjectContentEventStreamEvent { @@ -22631,6 +28241,7 @@ func (r *readSelectObjectContentEventStream) Events() <-chan SelectObjectContent } func (r *readSelectObjectContentEventStream) readEventStream() { + defer r.Close() defer close(r.stream) for { @@ -22645,7 +28256,7 @@ func (r *readSelectObjectContentEventStream) readEventStream() { return default: } - r.errVal.Store(err) + r.err.SetError(err) return } @@ -22657,22 +28268,20 @@ func (r *readSelectObjectContentEventStream) readEventStream() { } } -func (r *readSelectObjectContentEventStream) unmarshalerForEventType( - eventType string, -) (eventstreamapi.Unmarshaler, error) { +type unmarshalerForSelectObjectContentEventStreamEvent struct { + metadata protocol.ResponseMetadata +} + +func (u unmarshalerForSelectObjectContentEventStreamEvent) UnmarshalerForEventName(eventType string) (eventstreamapi.Unmarshaler, error) { switch eventType { case "Cont": return &ContinuationEvent{}, nil - case "End": return &EndEvent{}, nil - case "Progress": return &ProgressEvent{}, nil - case "Records": return &RecordsEvent{}, nil - case "Stats": return &StatsEvent{}, nil default: @@ -22704,7 +28313,7 @@ type SelectObjectContentInput struct { // Expression is a required field Expression *string `type:"string" required:"true"` - // The type of the provided expression (for example., SQL). + // The type of the provided expression (for example, SQL). // // ExpressionType is a required field ExpressionType *string `type:"string" required:"true" enum:"ExpressionType"` @@ -22738,6 +28347,24 @@ type SelectObjectContentInput struct { // The SSE Customer Key MD5. For more information, see Server-Side Encryption // (Using Customer-Provided Encryption Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html). SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` + + // Specifies the byte range of the object to get the records from. A record + // is processed when its first byte is contained by the range. This parameter + // is optional, but when specified, it must not be empty. See RFC 2616, Section + // 14.35.1 about how to specify the start and end of the range. + // + // ScanRangemay be used in the following ways: + // + // * 50100 - process only + // the records starting between the bytes 50 and 100 (inclusive, counting + // from zero) + // + // * 50 - process only the records + // starting after the byte 50 + // + // * 50 - process only the records within + // the last 50 bytes of the file. + ScanRange *ScanRange `type:"structure"` } // String returns the string representation @@ -22858,11 +28485,30 @@ func (s *SelectObjectContentInput) SetSSECustomerKeyMD5(v string) *SelectObjectC return s } +// SetScanRange sets the ScanRange field's value. +func (s *SelectObjectContentInput) SetScanRange(v *ScanRange) *SelectObjectContentInput { + s.ScanRange = v + return s +} + +func (s *SelectObjectContentInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *SelectObjectContentInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type SelectObjectContentOutput struct { _ struct{} `type:"structure" payload:"Payload"` - // Use EventStream to use the API's stream. - EventStream *SelectObjectContentEventStream `type:"structure"` + EventStream *SelectObjectContentEventStream } // String returns the string representation @@ -22875,29 +28521,17 @@ func (s SelectObjectContentOutput) GoString() string { return s.String() } -// SetEventStream sets the EventStream field's value. func (s *SelectObjectContentOutput) SetEventStream(v *SelectObjectContentEventStream) *SelectObjectContentOutput { s.EventStream = v return s } +func (s *SelectObjectContentOutput) GetEventStream() *SelectObjectContentEventStream { + return s.EventStream +} -func (s *SelectObjectContentOutput) runEventStreamLoop(r *request.Request) { - if r.Error != nil { - return - } - reader := newReadSelectObjectContentEventStream( - r.HTTPResponse.Body, - r.Handlers.UnmarshalStream, - r.Config.Logger, - r.Config.LogLevel.Value(), - ) - go reader.readEventStream() - - eventStream := &SelectObjectContentEventStream{ - StreamCloser: r.HTTPResponse.Body, - Reader: reader, - } - s.EventStream = eventStream +// GetStream returns the type to interact with the event stream. +func (s *SelectObjectContentOutput) GetStream() *SelectObjectContentEventStream { + return s.EventStream } // Describes the parameters for Select job types. @@ -22909,7 +28543,7 @@ type SelectParameters struct { // Expression is a required field Expression *string `type:"string" required:"true"` - // The type of the provided expression (e.g., SQL). + // The type of the provided expression (for example, SQL). // // ExpressionType is a required field ExpressionType *string `type:"string" required:"true" enum:"ExpressionType"` @@ -23129,7 +28763,7 @@ func (s *ServerSideEncryptionRule) SetApplyServerSideEncryptionByDefault(v *Serv // objects that you want to replicate. You can choose to enable or disable the // replication of these objects. Currently, Amazon S3 supports only the filter // that you can specify for objects created with server-side encryption using -// an AWS KMS-Managed Key (SSE-KMS). +// a customer master key (CMK) stored in AWS Key Management Service (SSE-KMS). type SourceSelectionCriteria struct { _ struct{} `type:"structure"` @@ -23176,7 +28810,7 @@ type SseKmsEncryptedObjects struct { _ struct{} `type:"structure"` // Specifies whether Amazon S3 replicates objects created with server-side encryption - // using an AWS KMS-managed key. + // using a customer master key (CMK) stored in AWS Key Management Service. // // Status is a required field Status *string `type:"string" required:"true" enum:"SseKmsEncryptedObjectsStatus"` @@ -23211,6 +28845,7 @@ func (s *SseKmsEncryptedObjects) SetStatus(v string) *SseKmsEncryptedObjects { return s } +// Container for the stats details. type Stats struct { _ struct{} `type:"structure"` @@ -23252,6 +28887,7 @@ func (s *Stats) SetBytesScanned(v int64) *Stats { return s } +// Container for the Stats Event. type StatsEvent struct { _ struct{} `locationName:"StatsEvent" type:"structure" payload:"Details"` @@ -23292,6 +28928,16 @@ func (s *StatsEvent) UnmarshalEvent( return nil } +func (s *StatsEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { + msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) + var buf bytes.Buffer + if err = pm.MarshalPayload(&buf, s); err != nil { + return eventstream.Message{}, err + } + msg.Payload = buf.Bytes() + return msg, err +} + // Specifies data related to access patterns to be collected and made available // to analyze the tradeoffs between different storage classes for an Amazon // S3 bucket. @@ -23334,6 +28980,8 @@ func (s *StorageClassAnalysis) SetDataExport(v *StorageClassAnalysisDataExport) return s } +// Container for data related to the storage class analysis for an Amazon S3 +// bucket for export. type StorageClassAnalysisDataExport struct { _ struct{} `type:"structure"` @@ -23391,6 +29039,7 @@ func (s *StorageClassAnalysisDataExport) SetOutputSchemaVersion(v string) *Stora return s } +// A container of a key value name pair. type Tag struct { _ struct{} `type:"structure"` @@ -23446,9 +29095,12 @@ func (s *Tag) SetValue(v string) *Tag { return s } +// Container for TagSet elements. type Tagging struct { _ struct{} `type:"structure"` + // A collection for a set of tags + // // TagSet is a required field TagSet []*Tag `locationNameList:"Tag" type:"list" required:"true"` } @@ -23492,9 +29144,11 @@ func (s *Tagging) SetTagSet(v []*Tag) *Tagging { return s } +// Container for granting information. type TargetGrant struct { _ struct{} `type:"structure"` + // Container for the person being granted permissions. Grantee *Grantee `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` // Logging permissions assigned to the Grantee for the bucket. @@ -23617,6 +29271,10 @@ func (s *TopicConfiguration) SetTopicArn(v string) *TopicConfiguration { return s } +// A container for specifying the configuration for publication of messages +// to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 +// detects specified events. This data type is deprecated. Use TopicConfiguration +// instead. type TopicConfigurationDeprecated struct { _ struct{} `type:"structure"` @@ -23625,6 +29283,7 @@ type TopicConfigurationDeprecated struct { // Deprecated: Event has been deprecated Event *string `deprecated:"true" type:"string" enum:"Event"` + // A collection of events related to objects Events []*string `locationName:"Event" type:"list" flattened:"true"` // An optional unique identifier for configurations in a notification configuration. @@ -23717,6 +29376,8 @@ func (s *Transition) SetStorageClass(v string) *Transition { type UploadPartCopyInput struct { _ struct{} `locationName:"UploadPartCopyRequest" type:"structure"` + // The bucket name. + // // Bucket is a required field Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` @@ -23742,11 +29403,12 @@ type UploadPartCopyInput struct { // The range of bytes to copy from the source object. The range value must use // the form bytes=first-last, where the first and last are the zero-based byte // offsets to copy. For example, bytes=0-9 indicates that you want to copy the - // first ten bytes of the source. You can copy a range only if the source object + // first 10 bytes of the source. You can copy a range only if the source object // is greater than 5 MB. CopySourceRange *string `location:"header" locationName:"x-amz-copy-source-range" type:"string"` - // Specifies the algorithm to use when decrypting the source object (e.g., AES256). + // Specifies the algorithm to use when decrypting the source object (for example, + // AES256). CopySourceSSECustomerAlgorithm *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-algorithm" type:"string"` // Specifies the customer-provided encryption key for Amazon S3 to use to decrypt @@ -23755,10 +29417,12 @@ type UploadPartCopyInput struct { CopySourceSSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key" type:"string" sensitive:"true"` // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. + // Amazon S3 uses this header for a message integrity check to ensure that the + // encryption key was transmitted without error. CopySourceSSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key-MD5" type:"string"` + // Object key for which the multipart upload was initiated. + // // Key is a required field Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` @@ -23768,26 +29432,28 @@ type UploadPartCopyInput struct { // PartNumber is a required field PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - // Specifies the algorithm to use to when encrypting the object (e.g., AES256). + // Specifies the algorithm to use to when encrypting the object (for example, + // AES256). SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting // data. This value is used to store the object and then it is discarded; Amazon - // does not store the encryption key. The key must be appropriate for use with - // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // S3 does not store the encryption key. The key must be appropriate for use + // with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm // header. This must be the same encryption key specified in the initiate multipart // upload request. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. + // Amazon S3 uses this header for a message integrity check to ensure that the + // encryption key was transmitted without error. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` // Upload ID identifying the multipart upload whose part is being copied. @@ -23960,9 +29626,24 @@ func (s *UploadPartCopyInput) SetUploadId(v string) *UploadPartCopyInput { return s } +func (s *UploadPartCopyInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *UploadPartCopyInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type UploadPartCopyOutput struct { _ struct{} `type:"structure" payload:"CopyPartResult"` + // Container for all response elements. CopyPartResult *CopyPartResult `type:"structure"` // The version of the source object that was copied, if you have enabled versioning @@ -23979,16 +29660,17 @@ type UploadPartCopyOutput struct { SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round trip message integrity + // the response will include this header to provide round-trip message integrity // verification of the customer-provided encryption key. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - // If present, specifies the ID of the AWS Key Management Service (KMS) master - // encryption key that was used for the object. + // If present, specifies the ID of the AWS Key Management Service (AWS KMS) + // symmetric customer managed customer master key (CMK) that was used for the + // object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). + // The server-side encryption algorithm used when storing this object in Amazon + // S3 (for example, AES256, aws:kms). ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` } @@ -24060,7 +29742,7 @@ type UploadPartInput struct { ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` // The base64-encoded 128-bit MD5 digest of the part data. This parameter is - // auto-populated when using the command from the CLI. This parameted is required + // auto-populated when using the command from the CLI. This parameter is required // if object lock parameters are specified. ContentMD5 *string `location:"header" locationName:"Content-MD5" type:"string"` @@ -24075,26 +29757,28 @@ type UploadPartInput struct { // PartNumber is a required field PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer" required:"true"` - // Confirms that the requester knows that she or he will be charged for the - // request. Bucket owners need not specify this parameter in their requests. - // Documentation on downloading objects from requester pays buckets can be found - // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html + // Confirms that the requester knows that they will be charged for the request. + // Bucket owners need not specify this parameter in their requests. For information + // about downloading objects from requester pays buckets, see Downloading Objects + // in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) + // in the Amazon S3 Developer Guide. RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - // Specifies the algorithm to use to when encrypting the object (e.g., AES256). + // Specifies the algorithm to use to when encrypting the object (for example, + // AES256). SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting // data. This value is used to store the object and then it is discarded; Amazon - // does not store the encryption key. The key must be appropriate for use with - // the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm + // S3 does not store the encryption key. The key must be appropriate for use + // with the algorithm specified in the x-amz-server-side​-encryption​-customer-algorithm // header. This must be the same encryption key specified in the initiate multipart // upload request. SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure the encryption - // key was transmitted without error. + // Amazon S3 uses this header for a message integrity check to ensure that the + // encryption key was transmitted without error. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` // Upload ID identifying the multipart upload whose part is being uploaded. @@ -24221,6 +29905,20 @@ func (s *UploadPartInput) SetUploadId(v string) *UploadPartInput { return s } +func (s *UploadPartInput) getEndpointARN() (arn.Resource, error) { + if s.Bucket == nil { + return nil, fmt.Errorf("member Bucket is nil") + } + return parseEndpointARN(*s.Bucket) +} + +func (s *UploadPartInput) hasEndpointARN() bool { + if s.Bucket == nil { + return false + } + return arn.IsARN(*s.Bucket) +} + type UploadPartOutput struct { _ struct{} `type:"structure"` @@ -24237,16 +29935,16 @@ type UploadPartOutput struct { SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round trip message integrity + // the response will include this header to provide round-trip message integrity // verification of the customer-provided encryption key. SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - // If present, specifies the ID of the AWS Key Management Service (KMS) master - // encryption key that was used for the object. + // If present, specifies the ID of the AWS Key Management Service (AWS KMS) + // symmetric customer managed customer master key (CMK) was used for the object. SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - // The Server-side encryption algorithm used when storing this object in S3 - // (e.g., AES256, aws:kms). + // The server-side encryption algorithm used when storing this object in Amazon + // S3 (for example, AES256, aws:kms). ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` } @@ -24561,11 +30259,37 @@ const ( // EventS3ObjectRemovedDeleteMarkerCreated is a Event enum value EventS3ObjectRemovedDeleteMarkerCreated = "s3:ObjectRemoved:DeleteMarkerCreated" + // EventS3ObjectRestore is a Event enum value + EventS3ObjectRestore = "s3:ObjectRestore:*" + // EventS3ObjectRestorePost is a Event enum value EventS3ObjectRestorePost = "s3:ObjectRestore:Post" // EventS3ObjectRestoreCompleted is a Event enum value EventS3ObjectRestoreCompleted = "s3:ObjectRestore:Completed" + + // EventS3Replication is a Event enum value + EventS3Replication = "s3:Replication:*" + + // EventS3ReplicationOperationFailedReplication is a Event enum value + EventS3ReplicationOperationFailedReplication = "s3:Replication:OperationFailedReplication" + + // EventS3ReplicationOperationNotTracked is a Event enum value + EventS3ReplicationOperationNotTracked = "s3:Replication:OperationNotTracked" + + // EventS3ReplicationOperationMissedThreshold is a Event enum value + EventS3ReplicationOperationMissedThreshold = "s3:Replication:OperationMissedThreshold" + + // EventS3ReplicationOperationReplicatedAfterThreshold is a Event enum value + EventS3ReplicationOperationReplicatedAfterThreshold = "s3:Replication:OperationReplicatedAfterThreshold" +) + +const ( + // ExistingObjectReplicationStatusEnabled is a ExistingObjectReplicationStatus enum value + ExistingObjectReplicationStatusEnabled = "Enabled" + + // ExistingObjectReplicationStatusDisabled is a ExistingObjectReplicationStatus enum value + ExistingObjectReplicationStatusDisabled = "Disabled" ) const ( @@ -24657,6 +30381,9 @@ const ( // InventoryOptionalFieldObjectLockLegalHoldStatus is a InventoryOptionalField enum value InventoryOptionalFieldObjectLockLegalHoldStatus = "ObjectLockLegalHoldStatus" + + // InventoryOptionalFieldIntelligentTieringAccessTier is a InventoryOptionalField enum value + InventoryOptionalFieldIntelligentTieringAccessTier = "IntelligentTieringAccessTier" ) const ( @@ -24691,6 +30418,14 @@ const ( MetadataDirectiveReplace = "REPLACE" ) +const ( + // MetricsStatusEnabled is a MetricsStatus enum value + MetricsStatusEnabled = "Enabled" + + // MetricsStatusDisabled is a MetricsStatus enum value + MetricsStatusDisabled = "Disabled" +) + const ( // ObjectCannedACLPrivate is a ObjectCannedACL enum value ObjectCannedACLPrivate = "private" @@ -24839,6 +30574,14 @@ const ( ReplicationStatusReplica = "REPLICA" ) +const ( + // ReplicationTimeStatusEnabled is a ReplicationTimeStatus enum value + ReplicationTimeStatusEnabled = "Enabled" + + // ReplicationTimeStatusDisabled is a ReplicationTimeStatus enum value + ReplicationTimeStatusDisabled = "Disabled" +) + // If present, indicates that the requester was successfully charged for the // request. const ( @@ -24846,10 +30589,11 @@ const ( RequestChargedRequester = "requester" ) -// Confirms that the requester knows that she or he will be charged for the -// request. Bucket owners need not specify this parameter in their requests. -// Documentation on downloading objects from requester pays buckets can be found -// at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html +// Confirms that the requester knows that they will be charged for the request. +// Bucket owners need not specify this parameter in their requests. For information +// about downloading objects from requester pays buckets, see Downloading Objects +// in Requestor Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) +// in the Amazon S3 Developer Guide. const ( // RequestPayerRequester is a RequestPayer enum value RequestPayerRequester = "requester" 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 23d386b16c8..036d0b2e013 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 @@ -4,6 +4,7 @@ import ( "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/internal/s3err" + "github.com/aws/aws-sdk-go/service/s3/internal/arn" ) func init() { @@ -13,7 +14,7 @@ func init() { func defaultInitClientFn(c *client.Client) { // Support building custom endpoints based on config - c.Handlers.Build.PushFront(updateEndpointForS3Config) + c.Handlers.Build.PushFront(endpointHandler) // Require SSL when using SSE keys c.Handlers.Validate.PushBack(validateSSERequiresSSL) @@ -27,7 +28,7 @@ func defaultInitClientFn(c *client.Client) { } func defaultInitRequestFn(r *request.Request) { - // Add reuest handlers for specific platforms. + // Add request handlers for specific platforms. // e.g. 100-continue support for PUT requests using Go 1.6 platformRequestHandlers(r) @@ -73,3 +74,8 @@ type sseCustomerKeyGetter interface { type copySourceSSECustomerKeyGetter interface { getCopySourceSSECustomerKey() string } + +type endpointARNGetter interface { + getEndpointARN() (arn.Resource, error) + hasEndpointARN() bool +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go b/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go new file mode 100644 index 00000000000..c4048fbfb66 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go @@ -0,0 +1,233 @@ +package s3 + +import ( + "net/url" + "strings" + + "github.com/aws/aws-sdk-go/aws" + awsarn "github.com/aws/aws-sdk-go/aws/arn" + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/aws/endpoints" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/service/s3/internal/arn" +) + +// Used by shapes with members decorated as endpoint ARN. +func parseEndpointARN(v string) (arn.Resource, error) { + return arn.ParseResource(v, accessPointResourceParser) +} + +func accessPointResourceParser(a awsarn.ARN) (arn.Resource, error) { + resParts := arn.SplitResource(a.Resource) + switch resParts[0] { + case "accesspoint": + return arn.ParseAccessPointResource(a, resParts[1:]) + default: + return nil, arn.InvalidARNError{ARN: a, Reason: "unknown resource type"} + } +} + +func endpointHandler(req *request.Request) { + endpoint, ok := req.Params.(endpointARNGetter) + if !ok || !endpoint.hasEndpointARN() { + updateBucketEndpointFromParams(req) + return + } + + resource, err := endpoint.getEndpointARN() + if err != nil { + req.Error = newInvalidARNError(nil, err) + return + } + + resReq := resourceRequest{ + Resource: resource, + Request: req, + } + + if resReq.IsCrossPartition() { + req.Error = newClientPartitionMismatchError(resource, + req.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil) + return + } + + if !resReq.AllowCrossRegion() && resReq.IsCrossRegion() { + req.Error = newClientRegionMismatchError(resource, + req.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil) + return + } + + if resReq.HasCustomEndpoint() { + req.Error = newInvalidARNWithCustomEndpointError(resource, nil) + return + } + + switch tv := resource.(type) { + case arn.AccessPointARN: + err = updateRequestAccessPointEndpoint(req, tv) + if err != nil { + req.Error = err + } + default: + req.Error = newInvalidARNError(resource, nil) + } +} + +type resourceRequest struct { + Resource arn.Resource + Request *request.Request +} + +func (r resourceRequest) ARN() awsarn.ARN { + return r.Resource.GetARN() +} + +func (r resourceRequest) AllowCrossRegion() bool { + return aws.BoolValue(r.Request.Config.S3UseARNRegion) +} + +func (r resourceRequest) UseFIPS() bool { + return isFIPS(aws.StringValue(r.Request.Config.Region)) +} + +func (r resourceRequest) IsCrossPartition() bool { + return r.Request.ClientInfo.PartitionID != r.Resource.GetARN().Partition +} + +func (r resourceRequest) IsCrossRegion() bool { + return isCrossRegion(r.Request, r.Resource.GetARN().Region) +} + +func (r resourceRequest) HasCustomEndpoint() bool { + return len(aws.StringValue(r.Request.Config.Endpoint)) > 0 +} + +func isFIPS(clientRegion string) bool { + return strings.HasPrefix(clientRegion, "fips-") || strings.HasSuffix(clientRegion, "-fips") +} +func isCrossRegion(req *request.Request, otherRegion string) bool { + return req.ClientInfo.SigningRegion != otherRegion +} + +func updateBucketEndpointFromParams(r *request.Request) { + bucket, ok := bucketNameFromReqParams(r.Params) + if !ok { + // Ignore operation requests if the bucket name was not provided + // if this is an input validation error the validation handler + // will report it. + return + } + updateEndpointForS3Config(r, bucket) +} + +func updateRequestAccessPointEndpoint(req *request.Request, accessPoint arn.AccessPointARN) error { + // Accelerate not supported + if aws.BoolValue(req.Config.S3UseAccelerate) { + return newClientConfiguredForAccelerateError(accessPoint, + req.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil) + } + + // Ignore the disable host prefix for access points since custom endpoints + // are not supported. + req.Config.DisableEndpointHostPrefix = aws.Bool(false) + + if err := accessPointEndpointBuilder(accessPoint).Build(req); err != nil { + return err + } + + removeBucketFromPath(req.HTTPRequest.URL) + + return nil +} + +func removeBucketFromPath(u *url.URL) { + u.Path = strings.Replace(u.Path, "/{Bucket}", "", -1) + if u.Path == "" { + u.Path = "/" + } +} + +type accessPointEndpointBuilder arn.AccessPointARN + +const ( + accessPointPrefixLabel = "accesspoint" + accountIDPrefixLabel = "accountID" + accesPointPrefixTemplate = "{" + accessPointPrefixLabel + "}-{" + accountIDPrefixLabel + "}." +) + +func (a accessPointEndpointBuilder) Build(req *request.Request) error { + resolveRegion := arn.AccessPointARN(a).Region + cfgRegion := aws.StringValue(req.Config.Region) + + if isFIPS(cfgRegion) { + if aws.BoolValue(req.Config.S3UseARNRegion) && isCrossRegion(req, resolveRegion) { + // FIPS with cross region is not supported, the SDK must fail + // because there is no well defined method for SDK to construct a + // correct FIPS endpoint. + return newClientConfiguredForCrossRegionFIPSError(arn.AccessPointARN(a), + req.ClientInfo.PartitionID, cfgRegion, nil) + } + resolveRegion = cfgRegion + } + + endpoint, err := resolveRegionalEndpoint(req, resolveRegion) + if err != nil { + return newFailedToResolveEndpointError(arn.AccessPointARN(a), + req.ClientInfo.PartitionID, cfgRegion, err) + } + + if err = updateRequestEndpoint(req, endpoint.URL); err != nil { + return err + } + + const serviceEndpointLabel = "s3-accesspoint" + + // dualstack provided by endpoint resolver + cfgHost := req.HTTPRequest.URL.Host + if strings.HasPrefix(cfgHost, "s3") { + req.HTTPRequest.URL.Host = serviceEndpointLabel + cfgHost[2:] + } + + protocol.HostPrefixBuilder{ + Prefix: accesPointPrefixTemplate, + LabelsFn: a.hostPrefixLabelValues, + }.Build(req) + + req.ClientInfo.SigningName = endpoint.SigningName + req.ClientInfo.SigningRegion = endpoint.SigningRegion + + err = protocol.ValidateEndpointHost(req.Operation.Name, req.HTTPRequest.URL.Host) + if err != nil { + return newInvalidARNError(arn.AccessPointARN(a), err) + } + + return nil +} + +func (a accessPointEndpointBuilder) hostPrefixLabelValues() map[string]string { + return map[string]string{ + accessPointPrefixLabel: arn.AccessPointARN(a).AccessPointName, + accountIDPrefixLabel: arn.AccessPointARN(a).AccountID, + } +} + +func resolveRegionalEndpoint(r *request.Request, region string) (endpoints.ResolvedEndpoint, error) { + return r.Config.EndpointResolver.EndpointFor(EndpointsID, region, func(opts *endpoints.Options) { + opts.DisableSSL = aws.BoolValue(r.Config.DisableSSL) + opts.UseDualStack = aws.BoolValue(r.Config.UseDualStack) + opts.S3UsEast1RegionalEndpoint = endpoints.RegionalS3UsEast1Endpoint + }) +} + +func updateRequestEndpoint(r *request.Request, endpoint string) (err error) { + endpoint = endpoints.AddScheme(endpoint, aws.BoolValue(r.Config.DisableSSL)) + + r.HTTPRequest.URL, err = url.Parse(endpoint + r.Operation.HTTPPath) + if err != nil { + return awserr.New(request.ErrCodeSerialization, + "failed to parse endpoint URL", err) + } + + return nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_errors.go b/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_errors.go new file mode 100644 index 00000000000..9df03e78d39 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_errors.go @@ -0,0 +1,151 @@ +package s3 + +import ( + "fmt" + + "github.com/aws/aws-sdk-go/aws/awserr" + "github.com/aws/aws-sdk-go/service/s3/internal/arn" +) + +const ( + invalidARNErrorErrCode = "InvalidARNError" + configurationErrorErrCode = "ConfigurationError" +) + +type invalidARNError struct { + message string + resource arn.Resource + origErr error +} + +func (e invalidARNError) Error() string { + var extra string + if e.resource != nil { + extra = "ARN: " + e.resource.String() + } + return awserr.SprintError(e.Code(), e.Message(), extra, e.origErr) +} + +func (e invalidARNError) Code() string { + return invalidARNErrorErrCode +} + +func (e invalidARNError) Message() string { + return e.message +} + +func (e invalidARNError) OrigErr() error { + return e.origErr +} + +func newInvalidARNError(resource arn.Resource, err error) invalidARNError { + return invalidARNError{ + message: "invalid ARN", + origErr: err, + resource: resource, + } +} + +func newInvalidARNWithCustomEndpointError(resource arn.Resource, err error) invalidARNError { + return invalidARNError{ + message: "resource ARN not supported with custom client endpoints", + origErr: err, + resource: resource, + } +} + +// ARN not supported for the target partition +func newInvalidARNWithUnsupportedPartitionError(resource arn.Resource, err error) invalidARNError { + return invalidARNError{ + message: "resource ARN not supported for the target ARN partition", + origErr: err, + resource: resource, + } +} + +type configurationError struct { + message string + resource arn.Resource + clientPartitionID string + clientRegion string + origErr error +} + +func (e configurationError) Error() string { + extra := fmt.Sprintf("ARN: %s, client partition: %s, client region: %s", + e.resource, e.clientPartitionID, e.clientRegion) + + return awserr.SprintError(e.Code(), e.Message(), extra, e.origErr) +} + +func (e configurationError) Code() string { + return configurationErrorErrCode +} + +func (e configurationError) Message() string { + return e.message +} + +func (e configurationError) OrigErr() error { + return e.origErr +} + +func newClientPartitionMismatchError(resource arn.Resource, clientPartitionID, clientRegion string, err error) configurationError { + return configurationError{ + message: "client partition does not match provided ARN partition", + origErr: err, + resource: resource, + clientPartitionID: clientPartitionID, + clientRegion: clientRegion, + } +} + +func newClientRegionMismatchError(resource arn.Resource, clientPartitionID, clientRegion string, err error) configurationError { + return configurationError{ + message: "client region does not match provided ARN region", + origErr: err, + resource: resource, + clientPartitionID: clientPartitionID, + clientRegion: clientRegion, + } +} + +func newFailedToResolveEndpointError(resource arn.Resource, clientPartitionID, clientRegion string, err error) configurationError { + return configurationError{ + message: "endpoint resolver failed to find an endpoint for the provided ARN region", + origErr: err, + resource: resource, + clientPartitionID: clientPartitionID, + clientRegion: clientRegion, + } +} + +func newClientConfiguredForFIPSError(resource arn.Resource, clientPartitionID, clientRegion string, err error) configurationError { + return configurationError{ + message: "client configured for fips but cross-region resource ARN provided", + origErr: err, + resource: resource, + clientPartitionID: clientPartitionID, + clientRegion: clientRegion, + } +} + +func newClientConfiguredForAccelerateError(resource arn.Resource, clientPartitionID, clientRegion string, err error) configurationError { + return configurationError{ + message: "client configured for S3 Accelerate but is supported with resource ARN", + origErr: err, + resource: resource, + clientPartitionID: clientPartitionID, + clientRegion: clientRegion, + } +} + +func newClientConfiguredForCrossRegionFIPSError(resource arn.Resource, clientPartitionID, clientRegion string, err error) configurationError { + return configurationError{ + message: "client configured for FIPS with cross-region enabled but is supported with cross-region resource ARN", + origErr: err, + resource: resource, + clientPartitionID: clientPartitionID, + clientRegion: clientRegion, + } +} 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 931cb17bb05..49aeff16f20 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 @@ -13,6 +13,12 @@ const ( // ErrCodeBucketAlreadyOwnedByYou for service response error code // "BucketAlreadyOwnedByYou". + // + // The bucket you tried to create already exists, and you own it. Amazon S3 + // returns this error in all AWS Regions except in the North Virginia Region. + // For legacy compatibility, if you re-create an existing bucket that you already + // own in the North Virginia Region, Amazon S3 returns 200 OK and resets the + // bucket access control lists (ACLs). ErrCodeBucketAlreadyOwnedByYou = "BucketAlreadyOwnedByYou" // ErrCodeNoSuchBucket for service response error code @@ -36,13 +42,13 @@ const ( // ErrCodeObjectAlreadyInActiveTierError for service response error code // "ObjectAlreadyInActiveTierError". // - // This operation is not allowed against this storage tier + // This operation is not allowed against this storage tier. ErrCodeObjectAlreadyInActiveTierError = "ObjectAlreadyInActiveTierError" // ErrCodeObjectNotInActiveTierError for service response error code // "ObjectNotInActiveTierError". // // The source object of the COPY operation is not in the active tier and is - // only stored in Amazon Glacier. + // only stored in Amazon S3 Glacier. ErrCodeObjectNotInActiveTierError = "ObjectNotInActiveTierError" ) 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 a7fbc2de2f8..81cdec1ae75 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 @@ -30,10 +30,10 @@ var accelerateOpBlacklist = operationBlacklist{ opListBuckets, opCreateBucket, opDeleteBucket, } -// Request handler to automatically add the bucket name to the endpoint domain +// Automatically add the bucket name to the endpoint domain // if possible. This style of bucket is valid for all bucket names which are // DNS compatible and do not contain "." -func updateEndpointForS3Config(r *request.Request) { +func updateEndpointForS3Config(r *request.Request, bucketName string) { forceHostStyle := aws.BoolValue(r.Config.S3ForcePathStyle) accelerate := aws.BoolValue(r.Config.S3UseAccelerate) @@ -43,45 +43,29 @@ func updateEndpointForS3Config(r *request.Request) { r.Config.Logger.Log("ERROR: aws.Config.S3UseAccelerate is not compatible with aws.Config.S3ForcePathStyle, ignoring S3ForcePathStyle.") } } - updateEndpointForAccelerate(r) + updateEndpointForAccelerate(r, bucketName) } else if !forceHostStyle && r.Operation.Name != opGetBucketLocation { - updateEndpointForHostStyle(r) + updateEndpointForHostStyle(r, bucketName) } } -func updateEndpointForHostStyle(r *request.Request) { - bucket, ok := bucketNameFromReqParams(r.Params) - if !ok { - // Ignore operation requests if the bucketname was not provided - // if this is an input validation error the validation handler - // will report it. - return - } - - if !hostCompatibleBucketName(r.HTTPRequest.URL, bucket) { +func updateEndpointForHostStyle(r *request.Request, bucketName string) { + if !hostCompatibleBucketName(r.HTTPRequest.URL, bucketName) { // bucket name must be valid to put into the host return } - moveBucketToHost(r.HTTPRequest.URL, bucket) + moveBucketToHost(r.HTTPRequest.URL, bucketName) } var ( accelElem = []byte("s3-accelerate.dualstack.") ) -func updateEndpointForAccelerate(r *request.Request) { - bucket, ok := bucketNameFromReqParams(r.Params) - if !ok { - // Ignore operation requests if the bucketname was not provided - // if this is an input validation error the validation handler - // will report it. - return - } - - if !hostCompatibleBucketName(r.HTTPRequest.URL, bucket) { +func updateEndpointForAccelerate(r *request.Request, bucketName string) { + if !hostCompatibleBucketName(r.HTTPRequest.URL, bucketName) { r.Error = awserr.New("InvalidParameterException", - fmt.Sprintf("bucket name %s is not compatible with S3 Accelerate", bucket), + fmt.Sprintf("bucket name %s is not compatible with S3 Accelerate", bucketName), nil) return } @@ -106,7 +90,7 @@ func updateEndpointForAccelerate(r *request.Request) { r.HTTPRequest.URL.Host = strings.Join(parts, ".") - moveBucketToHost(r.HTTPRequest.URL, bucket) + moveBucketToHost(r.HTTPRequest.URL, bucketName) } // Attempts to retrieve the bucket name from the request input parameters. @@ -148,8 +132,5 @@ func dnsCompatibleBucketName(bucket string) bool { // moveBucketToHost moves the bucket name from the URI path to URL host. func moveBucketToHost(u *url.URL, bucket string) { u.Host = bucket + "." + u.Host - u.Path = strings.Replace(u.Path, "/{Bucket}", "", -1) - if u.Path == "" { - u.Path = "/" - } + removeBucketFromPath(u) } diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/internal/arn/accesspoint_arn.go b/vendor/github.com/aws/aws-sdk-go/service/s3/internal/arn/accesspoint_arn.go new file mode 100644 index 00000000000..2f93f96fd50 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/internal/arn/accesspoint_arn.go @@ -0,0 +1,45 @@ +package arn + +import ( + "strings" + + "github.com/aws/aws-sdk-go/aws/arn" +) + +// AccessPointARN provides representation +type AccessPointARN struct { + arn.ARN + AccessPointName string +} + +// GetARN returns the base ARN for the Access Point resource +func (a AccessPointARN) GetARN() arn.ARN { + return a.ARN +} + +// ParseAccessPointResource attempts to parse the ARN's resource as an +// AccessPoint resource. +func ParseAccessPointResource(a arn.ARN, resParts []string) (AccessPointARN, error) { + if len(a.Region) == 0 { + return AccessPointARN{}, InvalidARNError{a, "region not set"} + } + if len(a.AccountID) == 0 { + return AccessPointARN{}, InvalidARNError{a, "account-id not set"} + } + if len(resParts) == 0 { + return AccessPointARN{}, InvalidARNError{a, "resource-id not set"} + } + if len(resParts) > 1 { + return AccessPointARN{}, InvalidARNError{a, "sub resource not supported"} + } + + resID := resParts[0] + if len(strings.TrimSpace(resID)) == 0 { + return AccessPointARN{}, InvalidARNError{a, "resource-id not set"} + } + + return AccessPointARN{ + ARN: a, + AccessPointName: resID, + }, nil +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/internal/arn/arn.go b/vendor/github.com/aws/aws-sdk-go/service/s3/internal/arn/arn.go new file mode 100644 index 00000000000..a942d887f7a --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/internal/arn/arn.go @@ -0,0 +1,71 @@ +package arn + +import ( + "strings" + + "github.com/aws/aws-sdk-go/aws/arn" +) + +// Resource provides the interfaces abstracting ARNs of specific resource +// types. +type Resource interface { + GetARN() arn.ARN + String() string +} + +// ResourceParser provides the function for parsing an ARN's resource +// component into a typed resource. +type ResourceParser func(arn.ARN) (Resource, error) + +// ParseResource parses an AWS ARN into a typed resource for the S3 API. +func ParseResource(s string, resParser ResourceParser) (resARN Resource, err error) { + a, err := arn.Parse(s) + if err != nil { + return nil, err + } + + if len(a.Partition) == 0 { + return nil, InvalidARNError{a, "partition not set"} + } + if a.Service != "s3" { + return nil, InvalidARNError{a, "service is not S3"} + } + if len(a.Resource) == 0 { + return nil, InvalidARNError{a, "resource not set"} + } + + return resParser(a) +} + +// SplitResource splits the resource components by the ARN resource delimiters. +func SplitResource(v string) []string { + var parts []string + var offset int + + for offset <= len(v) { + idx := strings.IndexAny(v[offset:], "/:") + if idx < 0 { + parts = append(parts, v[offset:]) + break + } + parts = append(parts, v[offset:idx+offset]) + offset += idx + 1 + } + + return parts +} + +// IsARN returns whether the given string is an ARN +func IsARN(s string) bool { + return arn.IsARN(s) +} + +// InvalidARNError provides the error for an invalid ARN error. +type InvalidARNError struct { + ARN arn.ARN + Reason string +} + +func (e InvalidARNError) Error() string { + return "invalid Amazon S3 ARN, " + e.Reason + ", " + e.ARN.String() +} 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 d17dcc9dadc..b4c07b4d47e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "s3" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "S3" // ServiceID is a unique identifer of a specific service. + ServiceID = "S3" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the S3 client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a S3 client from just a session. // svc := s3.New(mySession) // @@ -46,11 +48,11 @@ const ( // svc := s3.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *S3 { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *S3 { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *S3 { svc := &S3{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2006-03-01", }, @@ -75,6 +78,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) + svc.Handlers.BuildStream.PushBackNamed(restxml.BuildHandler) svc.Handlers.UnmarshalStream.PushBackNamed(restxml.UnmarshalHandler) // Run custom client initialization if present diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3control/api.go b/vendor/github.com/aws/aws-sdk-go/service/s3control/api.go index f50a7d64cc0..fa5f473c8e3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3control/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3control/api.go @@ -13,6 +13,83 @@ import ( "github.com/aws/aws-sdk-go/private/protocol/restxml" ) +const opCreateAccessPoint = "CreateAccessPoint" + +// CreateAccessPointRequest generates a "aws/request.Request" representing the +// client's request for the CreateAccessPoint operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateAccessPoint for more information on using the CreateAccessPoint +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateAccessPointRequest method. +// req, resp := client.CreateAccessPointRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/CreateAccessPoint +func (c *S3Control) CreateAccessPointRequest(input *CreateAccessPointInput) (req *request.Request, output *CreateAccessPointOutput) { + op := &request.Operation{ + Name: opCreateAccessPoint, + HTTPMethod: "PUT", + HTTPPath: "/v20180820/accesspoint/{name}", + } + + if input == nil { + input = &CreateAccessPointInput{} + } + + output = &CreateAccessPointOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels)) + req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) + return +} + +// CreateAccessPoint API operation for AWS S3 Control. +// +// Creates an access point and associates it with the specified bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS S3 Control's +// API operation CreateAccessPoint for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/CreateAccessPoint +func (c *S3Control) CreateAccessPoint(input *CreateAccessPointInput) (*CreateAccessPointOutput, error) { + req, out := c.CreateAccessPointRequest(input) + return out, req.Send() +} + +// CreateAccessPointWithContext is the same as CreateAccessPoint with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAccessPoint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3Control) CreateAccessPointWithContext(ctx aws.Context, input *CreateAccessPointInput, opts ...request.Option) (*CreateAccessPointOutput, error) { + req, out := c.CreateAccessPointRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateJob = "CreateJob" // CreateJobRequest generates a "aws/request.Request" representing the @@ -99,6 +176,160 @@ func (c *S3Control) CreateJobWithContext(ctx aws.Context, input *CreateJobInput, return out, req.Send() } +const opDeleteAccessPoint = "DeleteAccessPoint" + +// DeleteAccessPointRequest generates a "aws/request.Request" representing the +// client's request for the DeleteAccessPoint operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteAccessPoint for more information on using the DeleteAccessPoint +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteAccessPointRequest method. +// req, resp := client.DeleteAccessPointRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteAccessPoint +func (c *S3Control) DeleteAccessPointRequest(input *DeleteAccessPointInput) (req *request.Request, output *DeleteAccessPointOutput) { + op := &request.Operation{ + Name: opDeleteAccessPoint, + HTTPMethod: "DELETE", + HTTPPath: "/v20180820/accesspoint/{name}", + } + + if input == nil { + input = &DeleteAccessPointInput{} + } + + output = &DeleteAccessPointOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels)) + req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) + return +} + +// DeleteAccessPoint API operation for AWS S3 Control. +// +// Deletes the specified access point. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS S3 Control's +// API operation DeleteAccessPoint for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteAccessPoint +func (c *S3Control) DeleteAccessPoint(input *DeleteAccessPointInput) (*DeleteAccessPointOutput, error) { + req, out := c.DeleteAccessPointRequest(input) + return out, req.Send() +} + +// DeleteAccessPointWithContext is the same as DeleteAccessPoint with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAccessPoint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3Control) DeleteAccessPointWithContext(ctx aws.Context, input *DeleteAccessPointInput, opts ...request.Option) (*DeleteAccessPointOutput, error) { + req, out := c.DeleteAccessPointRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteAccessPointPolicy = "DeleteAccessPointPolicy" + +// DeleteAccessPointPolicyRequest generates a "aws/request.Request" representing the +// client's request for the DeleteAccessPointPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteAccessPointPolicy for more information on using the DeleteAccessPointPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteAccessPointPolicyRequest method. +// req, resp := client.DeleteAccessPointPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteAccessPointPolicy +func (c *S3Control) DeleteAccessPointPolicyRequest(input *DeleteAccessPointPolicyInput) (req *request.Request, output *DeleteAccessPointPolicyOutput) { + op := &request.Operation{ + Name: opDeleteAccessPointPolicy, + HTTPMethod: "DELETE", + HTTPPath: "/v20180820/accesspoint/{name}/policy", + } + + if input == nil { + input = &DeleteAccessPointPolicyInput{} + } + + output = &DeleteAccessPointPolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels)) + req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) + return +} + +// DeleteAccessPointPolicy API operation for AWS S3 Control. +// +// Deletes the access point policy for the specified access point. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS S3 Control's +// API operation DeleteAccessPointPolicy for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/DeleteAccessPointPolicy +func (c *S3Control) DeleteAccessPointPolicy(input *DeleteAccessPointPolicyInput) (*DeleteAccessPointPolicyOutput, error) { + req, out := c.DeleteAccessPointPolicyRequest(input) + return out, req.Send() +} + +// DeleteAccessPointPolicyWithContext is the same as DeleteAccessPointPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAccessPointPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3Control) DeleteAccessPointPolicyWithContext(ctx aws.Context, input *DeleteAccessPointPolicyInput, opts ...request.Option) (*DeleteAccessPointPolicyOutput, error) { + req, out := c.DeleteAccessPointPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDeletePublicAccessBlock = "DeletePublicAccessBlock" // DeletePublicAccessBlockRequest generates a "aws/request.Request" representing the @@ -146,7 +377,7 @@ func (c *S3Control) DeletePublicAccessBlockRequest(input *DeletePublicAccessBloc // DeletePublicAccessBlock API operation for AWS S3 Control. // -// Deletes the block public access configuration for the specified account. +// Removes the PublicAccessBlock configuration for an Amazon Web Services 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 @@ -263,581 +494,1571 @@ func (c *S3Control) DescribeJobWithContext(ctx aws.Context, input *DescribeJobIn return out, req.Send() } -const opGetPublicAccessBlock = "GetPublicAccessBlock" +const opGetAccessPoint = "GetAccessPoint" -// GetPublicAccessBlockRequest generates a "aws/request.Request" representing the -// client's request for the GetPublicAccessBlock operation. The "output" return +// GetAccessPointRequest generates a "aws/request.Request" representing the +// client's request for the GetAccessPoint operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetPublicAccessBlock for more information on using the GetPublicAccessBlock +// See GetAccessPoint for more information on using the GetAccessPoint // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetPublicAccessBlockRequest method. -// req, resp := client.GetPublicAccessBlockRequest(params) +// // Example sending a request using the GetAccessPointRequest method. +// req, resp := client.GetAccessPointRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetPublicAccessBlock -func (c *S3Control) GetPublicAccessBlockRequest(input *GetPublicAccessBlockInput) (req *request.Request, output *GetPublicAccessBlockOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPoint +func (c *S3Control) GetAccessPointRequest(input *GetAccessPointInput) (req *request.Request, output *GetAccessPointOutput) { op := &request.Operation{ - Name: opGetPublicAccessBlock, + Name: opGetAccessPoint, HTTPMethod: "GET", - HTTPPath: "/v20180820/configuration/publicAccessBlock", + HTTPPath: "/v20180820/accesspoint/{name}", } if input == nil { - input = &GetPublicAccessBlockInput{} + input = &GetAccessPointInput{} } - output = &GetPublicAccessBlockOutput{} + output = &GetAccessPointOutput{} req = c.newRequest(op, input, output) req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels)) req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) return } -// GetPublicAccessBlock API operation for AWS S3 Control. +// GetAccessPoint API operation for AWS S3 Control. +// +// Returns configuration information about the specified access point. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS S3 Control's -// API operation GetPublicAccessBlock for usage and error information. -// -// Returned Error Codes: -// * ErrCodeNoSuchPublicAccessBlockConfiguration "NoSuchPublicAccessBlockConfiguration" -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetPublicAccessBlock -func (c *S3Control) GetPublicAccessBlock(input *GetPublicAccessBlockInput) (*GetPublicAccessBlockOutput, error) { - req, out := c.GetPublicAccessBlockRequest(input) +// API operation GetAccessPoint for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPoint +func (c *S3Control) GetAccessPoint(input *GetAccessPointInput) (*GetAccessPointOutput, error) { + req, out := c.GetAccessPointRequest(input) return out, req.Send() } -// GetPublicAccessBlockWithContext is the same as GetPublicAccessBlock with the addition of +// GetAccessPointWithContext is the same as GetAccessPoint with the addition of // the ability to pass a context and additional request options. // -// See GetPublicAccessBlock for details on how to use this API operation. +// See GetAccessPoint for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *S3Control) GetPublicAccessBlockWithContext(ctx aws.Context, input *GetPublicAccessBlockInput, opts ...request.Option) (*GetPublicAccessBlockOutput, error) { - req, out := c.GetPublicAccessBlockRequest(input) +func (c *S3Control) GetAccessPointWithContext(ctx aws.Context, input *GetAccessPointInput, opts ...request.Option) (*GetAccessPointOutput, error) { + req, out := c.GetAccessPointRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListJobs = "ListJobs" +const opGetAccessPointPolicy = "GetAccessPointPolicy" -// ListJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListJobs operation. The "output" return +// GetAccessPointPolicyRequest generates a "aws/request.Request" representing the +// client's request for the GetAccessPointPolicy operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListJobs for more information on using the ListJobs +// See GetAccessPointPolicy for more information on using the GetAccessPointPolicy // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListJobsRequest method. -// req, resp := client.ListJobsRequest(params) +// // Example sending a request using the GetAccessPointPolicyRequest method. +// req, resp := client.GetAccessPointPolicyRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListJobs -func (c *S3Control) ListJobsRequest(input *ListJobsInput) (req *request.Request, output *ListJobsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointPolicy +func (c *S3Control) GetAccessPointPolicyRequest(input *GetAccessPointPolicyInput) (req *request.Request, output *GetAccessPointPolicyOutput) { op := &request.Operation{ - Name: opListJobs, + Name: opGetAccessPointPolicy, HTTPMethod: "GET", - HTTPPath: "/v20180820/jobs", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, + HTTPPath: "/v20180820/accesspoint/{name}/policy", } if input == nil { - input = &ListJobsInput{} + input = &GetAccessPointPolicyInput{} } - output = &ListJobsOutput{} + output = &GetAccessPointPolicyOutput{} req = c.newRequest(op, input, output) req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels)) req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) return } -// ListJobs API operation for AWS S3 Control. +// GetAccessPointPolicy API operation for AWS S3 Control. // -// Lists current jobs and jobs that have ended within the last 30 days for the -// AWS account making the request. +// Returns the access point policy associated with the specified access point. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS S3 Control's -// API operation ListJobs for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" -// -// * ErrCodeInternalServiceException "InternalServiceException" -// -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListJobs -func (c *S3Control) ListJobs(input *ListJobsInput) (*ListJobsOutput, error) { - req, out := c.ListJobsRequest(input) +// API operation GetAccessPointPolicy for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointPolicy +func (c *S3Control) GetAccessPointPolicy(input *GetAccessPointPolicyInput) (*GetAccessPointPolicyOutput, error) { + req, out := c.GetAccessPointPolicyRequest(input) return out, req.Send() } -// ListJobsWithContext is the same as ListJobs with the addition of +// GetAccessPointPolicyWithContext is the same as GetAccessPointPolicy with the addition of // the ability to pass a context and additional request options. // -// See ListJobs for details on how to use this API operation. +// See GetAccessPointPolicy for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *S3Control) ListJobsWithContext(ctx aws.Context, input *ListJobsInput, opts ...request.Option) (*ListJobsOutput, error) { - req, out := c.ListJobsRequest(input) +func (c *S3Control) GetAccessPointPolicyWithContext(ctx aws.Context, input *GetAccessPointPolicyInput, opts ...request.Option) (*GetAccessPointPolicyOutput, error) { + req, out := c.GetAccessPointPolicyRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// 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. +const opGetAccessPointPolicyStatus = "GetAccessPointPolicyStatus" + +// GetAccessPointPolicyStatusRequest generates a "aws/request.Request" representing the +// client's request for the GetAccessPointPolicyStatus operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. // -// See ListJobs method for more information on how to use this operation. +// 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. // -// Note: This operation can generate multiple requests to a service. +// See GetAccessPointPolicyStatus for more information on using the GetAccessPointPolicyStatus +// API call, and error handling. // -// // Example iterating over at most 3 pages of a ListJobs operation. -// pageNum := 0 -// err := client.ListJobsPages(params, -// func(page *s3control.ListJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// 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. // -func (c *S3Control) ListJobsPages(input *ListJobsInput, fn func(*ListJobsOutput, bool) bool) error { - return c.ListJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListJobsPagesWithContext same as ListJobsPages 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 *S3Control) ListJobsPagesWithContext(ctx aws.Context, input *ListJobsInput, fn func(*ListJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, +// // Example sending a request using the GetAccessPointPolicyStatusRequest method. +// req, resp := client.GetAccessPointPolicyStatusRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointPolicyStatus +func (c *S3Control) GetAccessPointPolicyStatusRequest(input *GetAccessPointPolicyStatusInput) (req *request.Request, output *GetAccessPointPolicyStatusOutput) { + op := &request.Operation{ + Name: opGetAccessPointPolicyStatus, + HTTPMethod: "GET", + HTTPPath: "/v20180820/accesspoint/{name}/policyStatus", } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) + if input == nil { + input = &GetAccessPointPolicyStatusInput{} } - return p.Err() + + output = &GetAccessPointPolicyStatusOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels)) + req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) + return } -const opPutPublicAccessBlock = "PutPublicAccessBlock" +// GetAccessPointPolicyStatus API operation for AWS S3 Control. +// +// Indicates whether the specified access point currently has a policy that +// allows public access. For more information about public access through access +// points, see Managing Data Access with Amazon S3 Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-points.html) +// in the Amazon Simple Storage 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 S3 Control's +// API operation GetAccessPointPolicyStatus for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetAccessPointPolicyStatus +func (c *S3Control) GetAccessPointPolicyStatus(input *GetAccessPointPolicyStatusInput) (*GetAccessPointPolicyStatusOutput, error) { + req, out := c.GetAccessPointPolicyStatusRequest(input) + return out, req.Send() +} -// PutPublicAccessBlockRequest generates a "aws/request.Request" representing the -// client's request for the PutPublicAccessBlock operation. The "output" return +// GetAccessPointPolicyStatusWithContext is the same as GetAccessPointPolicyStatus with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccessPointPolicyStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3Control) GetAccessPointPolicyStatusWithContext(ctx aws.Context, input *GetAccessPointPolicyStatusInput, opts ...request.Option) (*GetAccessPointPolicyStatusOutput, error) { + req, out := c.GetAccessPointPolicyStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetPublicAccessBlock = "GetPublicAccessBlock" + +// GetPublicAccessBlockRequest generates a "aws/request.Request" representing the +// client's request for the GetPublicAccessBlock operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See PutPublicAccessBlock for more information on using the PutPublicAccessBlock +// See GetPublicAccessBlock for more information on using the GetPublicAccessBlock // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the PutPublicAccessBlockRequest method. -// req, resp := client.PutPublicAccessBlockRequest(params) +// // Example sending a request using the GetPublicAccessBlockRequest method. +// req, resp := client.GetPublicAccessBlockRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutPublicAccessBlock -func (c *S3Control) PutPublicAccessBlockRequest(input *PutPublicAccessBlockInput) (req *request.Request, output *PutPublicAccessBlockOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetPublicAccessBlock +func (c *S3Control) GetPublicAccessBlockRequest(input *GetPublicAccessBlockInput) (req *request.Request, output *GetPublicAccessBlockOutput) { op := &request.Operation{ - Name: opPutPublicAccessBlock, - HTTPMethod: "PUT", + Name: opGetPublicAccessBlock, + HTTPMethod: "GET", HTTPPath: "/v20180820/configuration/publicAccessBlock", } if input == nil { - input = &PutPublicAccessBlockInput{} + input = &GetPublicAccessBlockInput{} } - output = &PutPublicAccessBlockOutput{} + output = &GetPublicAccessBlockOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels)) req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) return } -// PutPublicAccessBlock API operation for AWS S3 Control. +// GetPublicAccessBlock API operation for AWS S3 Control. +// +// Retrieves the PublicAccessBlock configuration for an Amazon Web Services +// 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 S3 Control's -// API operation PutPublicAccessBlock for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutPublicAccessBlock -func (c *S3Control) PutPublicAccessBlock(input *PutPublicAccessBlockInput) (*PutPublicAccessBlockOutput, error) { - req, out := c.PutPublicAccessBlockRequest(input) +// API operation GetPublicAccessBlock for usage and error information. +// +// Returned Error Codes: +// * ErrCodeNoSuchPublicAccessBlockConfiguration "NoSuchPublicAccessBlockConfiguration" +// Amazon S3 throws this exception if you make a GetPublicAccessBlock request +// against an account that doesn't have a PublicAccessBlockConfiguration set. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/GetPublicAccessBlock +func (c *S3Control) GetPublicAccessBlock(input *GetPublicAccessBlockInput) (*GetPublicAccessBlockOutput, error) { + req, out := c.GetPublicAccessBlockRequest(input) return out, req.Send() } -// PutPublicAccessBlockWithContext is the same as PutPublicAccessBlock with the addition of +// GetPublicAccessBlockWithContext is the same as GetPublicAccessBlock with the addition of // the ability to pass a context and additional request options. // -// See PutPublicAccessBlock for details on how to use this API operation. +// See GetPublicAccessBlock for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *S3Control) PutPublicAccessBlockWithContext(ctx aws.Context, input *PutPublicAccessBlockInput, opts ...request.Option) (*PutPublicAccessBlockOutput, error) { - req, out := c.PutPublicAccessBlockRequest(input) +func (c *S3Control) GetPublicAccessBlockWithContext(ctx aws.Context, input *GetPublicAccessBlockInput, opts ...request.Option) (*GetPublicAccessBlockOutput, error) { + req, out := c.GetPublicAccessBlockRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateJobPriority = "UpdateJobPriority" +const opListAccessPoints = "ListAccessPoints" -// UpdateJobPriorityRequest generates a "aws/request.Request" representing the -// client's request for the UpdateJobPriority operation. The "output" return +// ListAccessPointsRequest generates a "aws/request.Request" representing the +// client's request for the ListAccessPoints operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateJobPriority for more information on using the UpdateJobPriority +// See ListAccessPoints for more information on using the ListAccessPoints // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateJobPriorityRequest method. -// req, resp := client.UpdateJobPriorityRequest(params) +// // Example sending a request using the ListAccessPointsRequest method. +// req, resp := client.ListAccessPointsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/UpdateJobPriority -func (c *S3Control) UpdateJobPriorityRequest(input *UpdateJobPriorityInput) (req *request.Request, output *UpdateJobPriorityOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListAccessPoints +func (c *S3Control) ListAccessPointsRequest(input *ListAccessPointsInput) (req *request.Request, output *ListAccessPointsOutput) { op := &request.Operation{ - Name: opUpdateJobPriority, - HTTPMethod: "POST", - HTTPPath: "/v20180820/jobs/{id}/priority", + Name: opListAccessPoints, + HTTPMethod: "GET", + HTTPPath: "/v20180820/accesspoint", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &UpdateJobPriorityInput{} + input = &ListAccessPointsInput{} } - output = &UpdateJobPriorityOutput{} + output = &ListAccessPointsOutput{} req = c.newRequest(op, input, output) req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels)) req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) return } -// UpdateJobPriority API operation for AWS S3 Control. +// ListAccessPoints API operation for AWS S3 Control. // -// Updates an existing job's priority. +// Returns a list of the access points currently associated with the specified +// bucket. You can retrieve up to 1000 access points per call. If the specified +// bucket has more than 1000 access points (or the number specified in maxResults, +// whichever is less), then the response will include a continuation token that +// you can use to list the additional access points. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for AWS S3 Control's -// API operation UpdateJobPriority for usage and error information. -// -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeInternalServiceException "InternalServiceException" -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/UpdateJobPriority -func (c *S3Control) UpdateJobPriority(input *UpdateJobPriorityInput) (*UpdateJobPriorityOutput, error) { - req, out := c.UpdateJobPriorityRequest(input) +// API operation ListAccessPoints for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListAccessPoints +func (c *S3Control) ListAccessPoints(input *ListAccessPointsInput) (*ListAccessPointsOutput, error) { + req, out := c.ListAccessPointsRequest(input) return out, req.Send() } -// UpdateJobPriorityWithContext is the same as UpdateJobPriority with the addition of +// ListAccessPointsWithContext is the same as ListAccessPoints with the addition of // the ability to pass a context and additional request options. // -// See UpdateJobPriority for details on how to use this API operation. +// See ListAccessPoints for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *S3Control) UpdateJobPriorityWithContext(ctx aws.Context, input *UpdateJobPriorityInput, opts ...request.Option) (*UpdateJobPriorityOutput, error) { - req, out := c.UpdateJobPriorityRequest(input) +func (c *S3Control) ListAccessPointsWithContext(ctx aws.Context, input *ListAccessPointsInput, opts ...request.Option) (*ListAccessPointsOutput, error) { + req, out := c.ListAccessPointsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateJobStatus = "UpdateJobStatus" +// ListAccessPointsPages iterates over the pages of a ListAccessPoints operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListAccessPoints 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 ListAccessPoints operation. +// pageNum := 0 +// err := client.ListAccessPointsPages(params, +// func(page *s3control.ListAccessPointsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *S3Control) ListAccessPointsPages(input *ListAccessPointsInput, fn func(*ListAccessPointsOutput, bool) bool) error { + return c.ListAccessPointsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// UpdateJobStatusRequest generates a "aws/request.Request" representing the -// client's request for the UpdateJobStatus operation. The "output" return +// ListAccessPointsPagesWithContext same as ListAccessPointsPages 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 *S3Control) ListAccessPointsPagesWithContext(ctx aws.Context, input *ListAccessPointsInput, fn func(*ListAccessPointsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAccessPointsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAccessPointsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListAccessPointsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListJobs = "ListJobs" + +// ListJobsRequest generates a "aws/request.Request" representing the +// client's request for the ListJobs operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateJobStatus for more information on using the UpdateJobStatus +// See ListJobs for more information on using the ListJobs // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateJobStatusRequest method. -// req, resp := client.UpdateJobStatusRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/UpdateJobStatus -func (c *S3Control) UpdateJobStatusRequest(input *UpdateJobStatusInput) (req *request.Request, output *UpdateJobStatusOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListJobs +func (c *S3Control) ListJobsRequest(input *ListJobsInput) (req *request.Request, output *ListJobsOutput) { op := &request.Operation{ - Name: opUpdateJobStatus, - HTTPMethod: "POST", - HTTPPath: "/v20180820/jobs/{id}/status", + Name: opListJobs, + HTTPMethod: "GET", + HTTPPath: "/v20180820/jobs", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &UpdateJobStatusInput{} + input = &ListJobsInput{} } - output = &UpdateJobStatusOutput{} + output = &ListJobsOutput{} req = c.newRequest(op, input, output) req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels)) req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) return } -// UpdateJobStatus API operation for AWS S3 Control. +// ListJobs API operation for AWS S3 Control. // -// Updates the status for the specified job. Use this operation to confirm that -// you want to run a job or to cancel an existing job. +// Lists current jobs and jobs that have ended within the last 30 days for the +// AWS account making 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 AWS S3 Control's -// API operation UpdateJobStatus for usage and error information. +// API operation ListJobs for usage and error information. // // Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" -// -// * ErrCodeTooManyRequestsException "TooManyRequestsException" -// -// * ErrCodeNotFoundException "NotFoundException" -// -// * ErrCodeJobStatusException "JobStatusException" +// * ErrCodeInvalidRequestException "InvalidRequestException" // // * ErrCodeInternalServiceException "InternalServiceException" // -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/UpdateJobStatus -func (c *S3Control) UpdateJobStatus(input *UpdateJobStatusInput) (*UpdateJobStatusOutput, error) { - req, out := c.UpdateJobStatusRequest(input) +// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/ListJobs +func (c *S3Control) ListJobs(input *ListJobsInput) (*ListJobsOutput, error) { + req, out := c.ListJobsRequest(input) return out, req.Send() } -// UpdateJobStatusWithContext is the same as UpdateJobStatus with the addition of +// ListJobsWithContext is the same as ListJobs with the addition of // the ability to pass a context and additional request options. // -// See UpdateJobStatus for details on how to use this API operation. +// See ListJobs for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *S3Control) UpdateJobStatusWithContext(ctx aws.Context, input *UpdateJobStatusInput, opts ...request.Option) (*UpdateJobStatusOutput, error) { - req, out := c.UpdateJobStatusRequest(input) +func (c *S3Control) ListJobsWithContext(ctx aws.Context, input *ListJobsInput, opts ...request.Option) (*ListJobsOutput, error) { + req, out := c.ListJobsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -type CreateJobInput struct { - _ struct{} `locationName:"CreateJobRequest" type:"structure" xmlURI:"http://awss3control.amazonaws.com/doc/2018-08-20/"` - - // AccountId is a required field - AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"` - - // An idempotency token to ensure that you don't accidentally submit the same - // request twice. You can use any string up to the maximum length. - ClientRequestToken *string `min:"1" type:"string" idempotencyToken:"true"` - - // Indicates whether confirmation is required before Amazon S3 runs the job. - // Confirmation is only required for jobs created through the Amazon S3 console. +// 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 *s3control.ListJobsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *S3Control) ListJobsPages(input *ListJobsInput, fn func(*ListJobsOutput, bool) bool) error { + return c.ListJobsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListJobsPagesWithContext same as ListJobsPages 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 *S3Control) ListJobsPagesWithContext(ctx aws.Context, input *ListJobsInput, fn func(*ListJobsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListJobsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListJobsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListJobsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opPutAccessPointPolicy = "PutAccessPointPolicy" + +// PutAccessPointPolicyRequest generates a "aws/request.Request" representing the +// client's request for the PutAccessPointPolicy operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutAccessPointPolicy for more information on using the PutAccessPointPolicy +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutAccessPointPolicyRequest method. +// req, resp := client.PutAccessPointPolicyRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutAccessPointPolicy +func (c *S3Control) PutAccessPointPolicyRequest(input *PutAccessPointPolicyInput) (req *request.Request, output *PutAccessPointPolicyOutput) { + op := &request.Operation{ + Name: opPutAccessPointPolicy, + HTTPMethod: "PUT", + HTTPPath: "/v20180820/accesspoint/{name}/policy", + } + + if input == nil { + input = &PutAccessPointPolicyInput{} + } + + output = &PutAccessPointPolicyOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels)) + req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) + return +} + +// PutAccessPointPolicy API operation for AWS S3 Control. +// +// Associates an access policy with the specified access point. Each access +// point can have only one policy, so a request made to this API replaces any +// existing policy associated with the specified access point. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS S3 Control's +// API operation PutAccessPointPolicy for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutAccessPointPolicy +func (c *S3Control) PutAccessPointPolicy(input *PutAccessPointPolicyInput) (*PutAccessPointPolicyOutput, error) { + req, out := c.PutAccessPointPolicyRequest(input) + return out, req.Send() +} + +// PutAccessPointPolicyWithContext is the same as PutAccessPointPolicy with the addition of +// the ability to pass a context and additional request options. +// +// See PutAccessPointPolicy for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3Control) PutAccessPointPolicyWithContext(ctx aws.Context, input *PutAccessPointPolicyInput, opts ...request.Option) (*PutAccessPointPolicyOutput, error) { + req, out := c.PutAccessPointPolicyRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutPublicAccessBlock = "PutPublicAccessBlock" + +// PutPublicAccessBlockRequest generates a "aws/request.Request" representing the +// client's request for the PutPublicAccessBlock operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutPublicAccessBlock for more information on using the PutPublicAccessBlock +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutPublicAccessBlockRequest method. +// req, resp := client.PutPublicAccessBlockRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutPublicAccessBlock +func (c *S3Control) PutPublicAccessBlockRequest(input *PutPublicAccessBlockInput) (req *request.Request, output *PutPublicAccessBlockOutput) { + op := &request.Operation{ + Name: opPutPublicAccessBlock, + HTTPMethod: "PUT", + HTTPPath: "/v20180820/configuration/publicAccessBlock", + } + + if input == nil { + input = &PutPublicAccessBlockInput{} + } + + output = &PutPublicAccessBlockOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels)) + req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) + return +} + +// PutPublicAccessBlock API operation for AWS S3 Control. +// +// Creates or modifies the PublicAccessBlock configuration for an Amazon Web +// Services 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 S3 Control's +// API operation PutPublicAccessBlock for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/PutPublicAccessBlock +func (c *S3Control) PutPublicAccessBlock(input *PutPublicAccessBlockInput) (*PutPublicAccessBlockOutput, error) { + req, out := c.PutPublicAccessBlockRequest(input) + return out, req.Send() +} + +// PutPublicAccessBlockWithContext is the same as PutPublicAccessBlock with the addition of +// the ability to pass a context and additional request options. +// +// See PutPublicAccessBlock for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3Control) PutPublicAccessBlockWithContext(ctx aws.Context, input *PutPublicAccessBlockInput, opts ...request.Option) (*PutPublicAccessBlockOutput, error) { + req, out := c.PutPublicAccessBlockRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateJobPriority = "UpdateJobPriority" + +// UpdateJobPriorityRequest generates a "aws/request.Request" representing the +// client's request for the UpdateJobPriority operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateJobPriority for more information on using the UpdateJobPriority +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateJobPriorityRequest method. +// req, resp := client.UpdateJobPriorityRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/UpdateJobPriority +func (c *S3Control) UpdateJobPriorityRequest(input *UpdateJobPriorityInput) (req *request.Request, output *UpdateJobPriorityOutput) { + op := &request.Operation{ + Name: opUpdateJobPriority, + HTTPMethod: "POST", + HTTPPath: "/v20180820/jobs/{id}/priority", + } + + if input == nil { + input = &UpdateJobPriorityInput{} + } + + output = &UpdateJobPriorityOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels)) + req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) + return +} + +// UpdateJobPriority API operation for AWS S3 Control. +// +// Updates an existing job's 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 AWS S3 Control's +// API operation UpdateJobPriority for usage and error information. +// +// Returned Error Codes: +// * ErrCodeBadRequestException "BadRequestException" +// +// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// +// * ErrCodeNotFoundException "NotFoundException" +// +// * ErrCodeInternalServiceException "InternalServiceException" +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/UpdateJobPriority +func (c *S3Control) UpdateJobPriority(input *UpdateJobPriorityInput) (*UpdateJobPriorityOutput, error) { + req, out := c.UpdateJobPriorityRequest(input) + return out, req.Send() +} + +// UpdateJobPriorityWithContext is the same as UpdateJobPriority with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateJobPriority for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3Control) UpdateJobPriorityWithContext(ctx aws.Context, input *UpdateJobPriorityInput, opts ...request.Option) (*UpdateJobPriorityOutput, error) { + req, out := c.UpdateJobPriorityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateJobStatus = "UpdateJobStatus" + +// UpdateJobStatusRequest generates a "aws/request.Request" representing the +// client's request for the UpdateJobStatus operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateJobStatus for more information on using the UpdateJobStatus +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateJobStatusRequest method. +// req, resp := client.UpdateJobStatusRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/UpdateJobStatus +func (c *S3Control) UpdateJobStatusRequest(input *UpdateJobStatusInput) (req *request.Request, output *UpdateJobStatusOutput) { + op := &request.Operation{ + Name: opUpdateJobStatus, + HTTPMethod: "POST", + HTTPPath: "/v20180820/jobs/{id}/status", + } + + if input == nil { + input = &UpdateJobStatusInput{} + } + + output = &UpdateJobStatusOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{AccountId}.", input.hostLabels)) + req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) + return +} + +// UpdateJobStatus API operation for AWS S3 Control. +// +// Updates the status for the specified job. Use this operation to confirm that +// you want to run a job or to cancel an existing 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 AWS S3 Control's +// API operation UpdateJobStatus for usage and error information. +// +// Returned Error Codes: +// * ErrCodeBadRequestException "BadRequestException" +// +// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// +// * ErrCodeNotFoundException "NotFoundException" +// +// * ErrCodeJobStatusException "JobStatusException" +// +// * ErrCodeInternalServiceException "InternalServiceException" +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/s3control-2018-08-20/UpdateJobStatus +func (c *S3Control) UpdateJobStatus(input *UpdateJobStatusInput) (*UpdateJobStatusOutput, error) { + req, out := c.UpdateJobStatusRequest(input) + return out, req.Send() +} + +// UpdateJobStatusWithContext is the same as UpdateJobStatus with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateJobStatus for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *S3Control) UpdateJobStatusWithContext(ctx aws.Context, input *UpdateJobStatusInput, opts ...request.Option) (*UpdateJobStatusOutput, error) { + req, out := c.UpdateJobStatusRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// An access point used to access a bucket. +type AccessPoint struct { + _ struct{} `type:"structure"` + + // The name of the bucket associated with this access point. + // + // Bucket is a required field + Bucket *string `min:"3" type:"string" required:"true"` + + // The name of this access point. + // + // Name is a required field + Name *string `min:"3" type:"string" required:"true"` + + // Indicates whether this access point allows access from the public Internet. + // If VpcConfiguration is specified for this access point, then NetworkOrigin + // is VPC, and the access point doesn't allow access from the public Internet. + // Otherwise, NetworkOrigin is Internet, and the access point allows access + // from the public Internet, subject to the access point and bucket access policies. + // + // NetworkOrigin is a required field + NetworkOrigin *string `type:"string" required:"true" enum:"NetworkOrigin"` + + // The Virtual Private Cloud (VPC) configuration for this access point, if one + // exists. + VpcConfiguration *VpcConfiguration `type:"structure"` +} + +// String returns the string representation +func (s AccessPoint) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessPoint) GoString() string { + return s.String() +} + +// SetBucket sets the Bucket field's value. +func (s *AccessPoint) SetBucket(v string) *AccessPoint { + s.Bucket = &v + return s +} + +// SetName sets the Name field's value. +func (s *AccessPoint) SetName(v string) *AccessPoint { + s.Name = &v + return s +} + +// SetNetworkOrigin sets the NetworkOrigin field's value. +func (s *AccessPoint) SetNetworkOrigin(v string) *AccessPoint { + s.NetworkOrigin = &v + return s +} + +// SetVpcConfiguration sets the VpcConfiguration field's value. +func (s *AccessPoint) SetVpcConfiguration(v *VpcConfiguration) *AccessPoint { + s.VpcConfiguration = v + return s +} + +type CreateAccessPointInput struct { + _ struct{} `locationName:"CreateAccessPointRequest" type:"structure" xmlURI:"http://awss3control.amazonaws.com/doc/2018-08-20/"` + + // The AWS account ID for the owner of the bucket for which you want to create + // an access point. + // + // AccountId is a required field + AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"` + + // The name of the bucket that you want to associate this access point with. + // + // Bucket is a required field + Bucket *string `min:"3" type:"string" required:"true"` + + // The name you want to assign to this access point. + // + // Name is a required field + Name *string `location:"uri" locationName:"name" min:"3" type:"string" required:"true"` + + // The PublicAccessBlock configuration that you want to apply to this Amazon + // S3 bucket. You can enable the configuration options in any combination. For + // more information about when Amazon S3 considers a bucket or object public, + // see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) + // in the Amazon Simple Storage Service Developer Guide. + PublicAccessBlockConfiguration *PublicAccessBlockConfiguration `type:"structure"` + + // If you include this field, Amazon S3 restricts access to this access point + // to requests from the specified Virtual Private Cloud (VPC). + VpcConfiguration *VpcConfiguration `type:"structure"` +} + +// String returns the string representation +func (s CreateAccessPointInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAccessPointInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateAccessPointInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateAccessPointInput"} + if s.AccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AccountId")) + } + if s.AccountId != nil && len(*s.AccountId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AccountId", 1)) + } + if s.Bucket == nil { + invalidParams.Add(request.NewErrParamRequired("Bucket")) + } + if s.Bucket != nil && len(*s.Bucket) < 3 { + invalidParams.Add(request.NewErrParamMinLen("Bucket", 3)) + } + 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.VpcConfiguration != nil { + if err := s.VpcConfiguration.Validate(); err != nil { + invalidParams.AddNested("VpcConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccountId sets the AccountId field's value. +func (s *CreateAccessPointInput) SetAccountId(v string) *CreateAccessPointInput { + s.AccountId = &v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *CreateAccessPointInput) SetBucket(v string) *CreateAccessPointInput { + s.Bucket = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateAccessPointInput) SetName(v string) *CreateAccessPointInput { + s.Name = &v + return s +} + +// SetPublicAccessBlockConfiguration sets the PublicAccessBlockConfiguration field's value. +func (s *CreateAccessPointInput) SetPublicAccessBlockConfiguration(v *PublicAccessBlockConfiguration) *CreateAccessPointInput { + s.PublicAccessBlockConfiguration = v + return s +} + +// SetVpcConfiguration sets the VpcConfiguration field's value. +func (s *CreateAccessPointInput) SetVpcConfiguration(v *VpcConfiguration) *CreateAccessPointInput { + s.VpcConfiguration = v + return s +} + +func (s *CreateAccessPointInput) hostLabels() map[string]string { + return map[string]string{ + "AccountId": aws.StringValue(s.AccountId), + } +} + +type CreateAccessPointOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CreateAccessPointOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAccessPointOutput) GoString() string { + return s.String() +} + +type CreateJobInput struct { + _ struct{} `locationName:"CreateJobRequest" type:"structure" xmlURI:"http://awss3control.amazonaws.com/doc/2018-08-20/"` + + // AccountId is a required field + AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"` + + // An idempotency token to ensure that you don't accidentally submit the same + // request twice. You can use any string up to the maximum length. + ClientRequestToken *string `min:"1" type:"string" idempotencyToken:"true"` + + // Indicates whether confirmation is required before Amazon S3 runs the job. + // Confirmation is only required for jobs created through the Amazon S3 console. ConfirmationRequired *bool `type:"boolean"` - // A description for this job. You can use any string within the permitted length. - // Descriptions don't need to be unique and can be used for multiple jobs. - Description *string `min:"1" type:"string"` + // A description for this job. You can use any string within the permitted length. + // Descriptions don't need to be unique and can be used for multiple jobs. + Description *string `min:"1" type:"string"` + + // Configuration parameters for the manifest. + // + // Manifest is a required field + Manifest *JobManifest `type:"structure" required:"true"` + + // The operation that you want this job to perform on each object listed in + // the manifest. For more information about the available operations, see Available + // Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-operations.html) + // in the Amazon Simple Storage Service Developer Guide. + // + // Operation is a required field + Operation *JobOperation `type:"structure" required:"true"` + + // The numerical priority for this job. Higher numbers indicate higher priority. + // + // Priority is a required field + Priority *int64 `type:"integer" required:"true"` + + // Configuration parameters for the optional job-completion report. + // + // Report is a required field + Report *JobReport `type:"structure" required:"true"` + + // The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) + // Role that batch operations will use to execute this job's operation on each + // object in the manifest. + // + // RoleArn is a required field + RoleArn *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateJobInput) String() string { + return awsutil.Prettify(s) +} - // Configuration parameters for the manifest. +// 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.AccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AccountId")) + } + if s.AccountId != nil && len(*s.AccountId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AccountId", 1)) + } + if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) + } + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 1)) + } + if s.Manifest == nil { + invalidParams.Add(request.NewErrParamRequired("Manifest")) + } + if s.Operation == nil { + invalidParams.Add(request.NewErrParamRequired("Operation")) + } + if s.Priority == nil { + invalidParams.Add(request.NewErrParamRequired("Priority")) + } + if s.Report == nil { + invalidParams.Add(request.NewErrParamRequired("Report")) + } + 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.Manifest != nil { + if err := s.Manifest.Validate(); err != nil { + invalidParams.AddNested("Manifest", err.(request.ErrInvalidParams)) + } + } + if s.Operation != nil { + if err := s.Operation.Validate(); err != nil { + invalidParams.AddNested("Operation", err.(request.ErrInvalidParams)) + } + } + if s.Report != nil { + if err := s.Report.Validate(); err != nil { + invalidParams.AddNested("Report", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccountId sets the AccountId field's value. +func (s *CreateJobInput) SetAccountId(v string) *CreateJobInput { + s.AccountId = &v + return s +} + +// SetClientRequestToken sets the ClientRequestToken field's value. +func (s *CreateJobInput) SetClientRequestToken(v string) *CreateJobInput { + s.ClientRequestToken = &v + return s +} + +// SetConfirmationRequired sets the ConfirmationRequired field's value. +func (s *CreateJobInput) SetConfirmationRequired(v bool) *CreateJobInput { + s.ConfirmationRequired = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateJobInput) SetDescription(v string) *CreateJobInput { + s.Description = &v + return s +} + +// SetManifest sets the Manifest field's value. +func (s *CreateJobInput) SetManifest(v *JobManifest) *CreateJobInput { + s.Manifest = v + return s +} + +// SetOperation sets the Operation field's value. +func (s *CreateJobInput) SetOperation(v *JobOperation) *CreateJobInput { + s.Operation = v + return s +} + +// SetPriority sets the Priority field's value. +func (s *CreateJobInput) SetPriority(v int64) *CreateJobInput { + s.Priority = &v + return s +} + +// SetReport sets the Report field's value. +func (s *CreateJobInput) SetReport(v *JobReport) *CreateJobInput { + s.Report = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *CreateJobInput) SetRoleArn(v string) *CreateJobInput { + s.RoleArn = &v + return s +} + +func (s *CreateJobInput) hostLabels() map[string]string { + return map[string]string{ + "AccountId": aws.StringValue(s.AccountId), + } +} + +type CreateJobOutput struct { + _ struct{} `type:"structure"` + + // The ID for this job. Amazon S3 generates this ID automatically and returns + // it after a successful Create Job request. + JobId *string `min:"5" type:"string"` +} + +// 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() +} + +// SetJobId sets the JobId field's value. +func (s *CreateJobOutput) SetJobId(v string) *CreateJobOutput { + s.JobId = &v + return s +} + +type DeleteAccessPointInput struct { + _ struct{} `locationName:"DeleteAccessPointRequest" type:"structure"` + + // The account ID for the account that owns the specified access point. // - // Manifest is a required field - Manifest *JobManifest `type:"structure" required:"true"` + // AccountId is a required field + AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"` - // The operation that you want this job to perform on each object listed in - // the manifest. For more information about the available operations, see Available - // Operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/batch-ops-operations.html) - // in the Amazon Simple Storage Service Developer Guide. + // The name of the access point you want to delete. // - // Operation is a required field - Operation *JobOperation `type:"structure" required:"true"` + // Name is a required field + Name *string `location:"uri" locationName:"name" min:"3" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteAccessPointInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAccessPointInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteAccessPointInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteAccessPointInput"} + if s.AccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AccountId")) + } + if s.AccountId != nil && len(*s.AccountId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AccountId", 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 invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccountId sets the AccountId field's value. +func (s *DeleteAccessPointInput) SetAccountId(v string) *DeleteAccessPointInput { + s.AccountId = &v + return s +} + +// SetName sets the Name field's value. +func (s *DeleteAccessPointInput) SetName(v string) *DeleteAccessPointInput { + s.Name = &v + return s +} + +func (s *DeleteAccessPointInput) hostLabels() map[string]string { + return map[string]string{ + "AccountId": aws.StringValue(s.AccountId), + } +} + +type DeleteAccessPointOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteAccessPointOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAccessPointOutput) GoString() string { + return s.String() +} + +type DeleteAccessPointPolicyInput struct { + _ struct{} `locationName:"DeleteAccessPointPolicyRequest" type:"structure"` + + // The account ID for the account that owns the specified access point. + // + // AccountId is a required field + AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"` + + // The name of the access point whose policy you want to delete. + // + // Name is a required field + Name *string `location:"uri" locationName:"name" min:"3" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteAccessPointPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAccessPointPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteAccessPointPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteAccessPointPolicyInput"} + if s.AccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AccountId")) + } + if s.AccountId != nil && len(*s.AccountId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AccountId", 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 invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccountId sets the AccountId field's value. +func (s *DeleteAccessPointPolicyInput) SetAccountId(v string) *DeleteAccessPointPolicyInput { + s.AccountId = &v + return s +} + +// SetName sets the Name field's value. +func (s *DeleteAccessPointPolicyInput) SetName(v string) *DeleteAccessPointPolicyInput { + s.Name = &v + return s +} + +func (s *DeleteAccessPointPolicyInput) hostLabels() map[string]string { + return map[string]string{ + "AccountId": aws.StringValue(s.AccountId), + } +} - // The numerical priority for this job. Higher numbers indicate higher priority. - // - // Priority is a required field - Priority *int64 `type:"integer" required:"true"` +type DeleteAccessPointPolicyOutput struct { + _ struct{} `type:"structure"` +} - // Configuration parameters for the optional job-completion report. - // - // Report is a required field - Report *JobReport `type:"structure" required:"true"` +// String returns the string representation +func (s DeleteAccessPointPolicyOutput) String() string { + return awsutil.Prettify(s) +} - // The Amazon Resource Name (ARN) for the Identity and Access Management (IAM) - // Role that batch operations will use to execute this job's operation on each - // object in the manifest. +// GoString returns the string representation +func (s DeleteAccessPointPolicyOutput) GoString() string { + return s.String() +} + +type DeletePublicAccessBlockInput struct { + _ struct{} `locationName:"DeletePublicAccessBlockRequest" type:"structure"` + + // The account ID for the Amazon Web Services account whose PublicAccessBlock + // configuration you want to remove. // - // RoleArn is a required field - RoleArn *string `min:"1" type:"string" required:"true"` + // AccountId is a required field + AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"` } // String returns the string representation -func (s CreateJobInput) String() string { +func (s DeletePublicAccessBlockInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateJobInput) GoString() string { +func (s DeletePublicAccessBlockInput) 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"} +func (s *DeletePublicAccessBlockInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeletePublicAccessBlockInput"} if s.AccountId == nil { invalidParams.Add(request.NewErrParamRequired("AccountId")) } if s.AccountId != nil && len(*s.AccountId) < 1 { invalidParams.Add(request.NewErrParamMinLen("AccountId", 1)) } - if s.ClientRequestToken != nil && len(*s.ClientRequestToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ClientRequestToken", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Manifest == nil { - invalidParams.Add(request.NewErrParamRequired("Manifest")) - } - if s.Operation == nil { - invalidParams.Add(request.NewErrParamRequired("Operation")) - } - if s.Priority == nil { - invalidParams.Add(request.NewErrParamRequired("Priority")) - } - if s.Report == nil { - invalidParams.Add(request.NewErrParamRequired("Report")) + + if invalidParams.Len() > 0 { + return invalidParams } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) + return nil +} + +// SetAccountId sets the AccountId field's value. +func (s *DeletePublicAccessBlockInput) SetAccountId(v string) *DeletePublicAccessBlockInput { + s.AccountId = &v + return s +} + +func (s *DeletePublicAccessBlockInput) hostLabels() map[string]string { + return map[string]string{ + "AccountId": aws.StringValue(s.AccountId), } - if s.RoleArn != nil && len(*s.RoleArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1)) +} + +type DeletePublicAccessBlockOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeletePublicAccessBlockOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeletePublicAccessBlockOutput) GoString() string { + return s.String() +} + +type DescribeJobInput struct { + _ struct{} `locationName:"DescribeJobRequest" type:"structure"` + + // AccountId is a required field + AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"` + + // The ID for the job whose information you want to retrieve. + // + // JobId is a required field + JobId *string `location:"uri" locationName:"id" min:"5" 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.Manifest != nil { - if err := s.Manifest.Validate(); err != nil { - invalidParams.AddNested("Manifest", err.(request.ErrInvalidParams)) - } + if s.AccountId != nil && len(*s.AccountId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AccountId", 1)) } - if s.Operation != nil { - if err := s.Operation.Validate(); err != nil { - invalidParams.AddNested("Operation", err.(request.ErrInvalidParams)) - } + if s.JobId == nil { + invalidParams.Add(request.NewErrParamRequired("JobId")) } - if s.Report != nil { - if err := s.Report.Validate(); err != nil { - invalidParams.AddNested("Report", err.(request.ErrInvalidParams)) - } + if s.JobId != nil && len(*s.JobId) < 5 { + invalidParams.Add(request.NewErrParamMinLen("JobId", 5)) } if invalidParams.Len() > 0 { @@ -847,118 +2068,228 @@ func (s *CreateJobInput) Validate() error { } // SetAccountId sets the AccountId field's value. -func (s *CreateJobInput) SetAccountId(v string) *CreateJobInput { +func (s *DescribeJobInput) SetAccountId(v string) *DescribeJobInput { s.AccountId = &v return s } -// SetClientRequestToken sets the ClientRequestToken field's value. -func (s *CreateJobInput) SetClientRequestToken(v string) *CreateJobInput { - s.ClientRequestToken = &v +// SetJobId sets the JobId field's value. +func (s *DescribeJobInput) SetJobId(v string) *DescribeJobInput { + s.JobId = &v return s } -// SetConfirmationRequired sets the ConfirmationRequired field's value. -func (s *CreateJobInput) SetConfirmationRequired(v bool) *CreateJobInput { - s.ConfirmationRequired = &v - return s +func (s *DescribeJobInput) hostLabels() map[string]string { + return map[string]string{ + "AccountId": aws.StringValue(s.AccountId), + } } -// SetDescription sets the Description field's value. -func (s *CreateJobInput) SetDescription(v string) *CreateJobInput { - s.Description = &v - return s +type DescribeJobOutput struct { + _ struct{} `type:"structure"` + + // Contains the configuration parameters and status for the job specified in + // the Describe Job request. + Job *JobDescriptor `type:"structure"` } -// SetManifest sets the Manifest field's value. -func (s *CreateJobInput) SetManifest(v *JobManifest) *CreateJobInput { - s.Manifest = v - return s +// String returns the string representation +func (s DescribeJobOutput) String() string { + return awsutil.Prettify(s) } -// SetOperation sets the Operation field's value. -func (s *CreateJobInput) SetOperation(v *JobOperation) *CreateJobInput { - s.Operation = v - return s +// GoString returns the string representation +func (s DescribeJobOutput) GoString() string { + return s.String() } -// SetPriority sets the Priority field's value. -func (s *CreateJobInput) SetPriority(v int64) *CreateJobInput { - s.Priority = &v +// SetJob sets the Job field's value. +func (s *DescribeJobOutput) SetJob(v *JobDescriptor) *DescribeJobOutput { + s.Job = v return s } -// SetReport sets the Report field's value. -func (s *CreateJobInput) SetReport(v *JobReport) *CreateJobInput { - s.Report = v +type GetAccessPointInput struct { + _ struct{} `locationName:"GetAccessPointRequest" type:"structure"` + + // The account ID for the account that owns the specified access point. + // + // AccountId is a required field + AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"` + + // The name of the access point whose configuration information you want to + // retrieve. + // + // Name is a required field + Name *string `location:"uri" locationName:"name" min:"3" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetAccessPointInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccessPointInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAccessPointInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAccessPointInput"} + if s.AccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AccountId")) + } + if s.AccountId != nil && len(*s.AccountId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AccountId", 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 invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccountId sets the AccountId field's value. +func (s *GetAccessPointInput) SetAccountId(v string) *GetAccessPointInput { + s.AccountId = &v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *CreateJobInput) SetRoleArn(v string) *CreateJobInput { - s.RoleArn = &v +// SetName sets the Name field's value. +func (s *GetAccessPointInput) SetName(v string) *GetAccessPointInput { + s.Name = &v return s } -func (s *CreateJobInput) hostLabels() map[string]string { +func (s *GetAccessPointInput) hostLabels() map[string]string { return map[string]string{ "AccountId": aws.StringValue(s.AccountId), } } -type CreateJobOutput struct { +type GetAccessPointOutput struct { _ struct{} `type:"structure"` - // The ID for this job. Amazon S3 generates this ID automatically and returns - // it after a successful Create Job request. - JobId *string `min:"5" type:"string"` + // The name of the bucket associated with the specified access point. + Bucket *string `min:"3" type:"string"` + + // The date and time when the specified access point was created. + CreationDate *time.Time `type:"timestamp"` + + // The name of the specified access point. + Name *string `min:"3" type:"string"` + + // Indicates whether this access point allows access from the public Internet. + // If VpcConfiguration is specified for this access point, then NetworkOrigin + // is VPC, and the access point doesn't allow access from the public Internet. + // Otherwise, NetworkOrigin is Internet, and the access point allows access + // from the public Internet, subject to the access point and bucket access policies. + NetworkOrigin *string `type:"string" enum:"NetworkOrigin"` + + // The PublicAccessBlock configuration that you want to apply to this Amazon + // S3 bucket. You can enable the configuration options in any combination. For + // more information about when Amazon S3 considers a bucket or object public, + // see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) + // in the Amazon Simple Storage Service Developer Guide. + PublicAccessBlockConfiguration *PublicAccessBlockConfiguration `type:"structure"` + + // Contains the Virtual Private Cloud (VPC) configuration for the specified + // access point. + VpcConfiguration *VpcConfiguration `type:"structure"` } // String returns the string representation -func (s CreateJobOutput) String() string { +func (s GetAccessPointOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateJobOutput) GoString() string { +func (s GetAccessPointOutput) GoString() string { return s.String() } -// SetJobId sets the JobId field's value. -func (s *CreateJobOutput) SetJobId(v string) *CreateJobOutput { - s.JobId = &v +// SetBucket sets the Bucket field's value. +func (s *GetAccessPointOutput) SetBucket(v string) *GetAccessPointOutput { + s.Bucket = &v return s } -type DeletePublicAccessBlockInput struct { - _ struct{} `locationName:"DeletePublicAccessBlockRequest" type:"structure"` +// SetCreationDate sets the CreationDate field's value. +func (s *GetAccessPointOutput) SetCreationDate(v time.Time) *GetAccessPointOutput { + s.CreationDate = &v + return s +} + +// SetName sets the Name field's value. +func (s *GetAccessPointOutput) SetName(v string) *GetAccessPointOutput { + s.Name = &v + return s +} + +// SetNetworkOrigin sets the NetworkOrigin field's value. +func (s *GetAccessPointOutput) SetNetworkOrigin(v string) *GetAccessPointOutput { + s.NetworkOrigin = &v + return s +} + +// SetPublicAccessBlockConfiguration sets the PublicAccessBlockConfiguration field's value. +func (s *GetAccessPointOutput) SetPublicAccessBlockConfiguration(v *PublicAccessBlockConfiguration) *GetAccessPointOutput { + s.PublicAccessBlockConfiguration = v + return s +} + +// SetVpcConfiguration sets the VpcConfiguration field's value. +func (s *GetAccessPointOutput) SetVpcConfiguration(v *VpcConfiguration) *GetAccessPointOutput { + s.VpcConfiguration = v + return s +} - // The account ID for the AWS account whose block public access configuration - // you want to delete. +type GetAccessPointPolicyInput struct { + _ struct{} `locationName:"GetAccessPointPolicyRequest" type:"structure"` + + // The account ID for the account that owns the specified access point. // // AccountId is a required field AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"` + + // The name of the access point whose policy you want to retrieve. + // + // Name is a required field + Name *string `location:"uri" locationName:"name" min:"3" type:"string" required:"true"` } // String returns the string representation -func (s DeletePublicAccessBlockInput) String() string { +func (s GetAccessPointPolicyInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeletePublicAccessBlockInput) GoString() string { +func (s GetAccessPointPolicyInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePublicAccessBlockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePublicAccessBlockInput"} +func (s *GetAccessPointPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAccessPointPolicyInput"} if s.AccountId == nil { invalidParams.Add(request.NewErrParamRequired("AccountId")) } if s.AccountId != nil && len(*s.AccountId) < 1 { invalidParams.Add(request.NewErrParamMinLen("AccountId", 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 invalidParams.Len() > 0 { return invalidParams @@ -967,67 +2298,84 @@ func (s *DeletePublicAccessBlockInput) Validate() error { } // SetAccountId sets the AccountId field's value. -func (s *DeletePublicAccessBlockInput) SetAccountId(v string) *DeletePublicAccessBlockInput { +func (s *GetAccessPointPolicyInput) SetAccountId(v string) *GetAccessPointPolicyInput { s.AccountId = &v return s } -func (s *DeletePublicAccessBlockInput) hostLabels() map[string]string { +// SetName sets the Name field's value. +func (s *GetAccessPointPolicyInput) SetName(v string) *GetAccessPointPolicyInput { + s.Name = &v + return s +} + +func (s *GetAccessPointPolicyInput) hostLabels() map[string]string { return map[string]string{ "AccountId": aws.StringValue(s.AccountId), } } -type DeletePublicAccessBlockOutput struct { +type GetAccessPointPolicyOutput struct { _ struct{} `type:"structure"` + + // The access point policy associated with the specified access point. + Policy *string `type:"string"` } // String returns the string representation -func (s DeletePublicAccessBlockOutput) String() string { +func (s GetAccessPointPolicyOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeletePublicAccessBlockOutput) GoString() string { +func (s GetAccessPointPolicyOutput) GoString() string { return s.String() } -type DescribeJobInput struct { - _ struct{} `locationName:"DescribeJobRequest" type:"structure"` +// SetPolicy sets the Policy field's value. +func (s *GetAccessPointPolicyOutput) SetPolicy(v string) *GetAccessPointPolicyOutput { + s.Policy = &v + return s +} +type GetAccessPointPolicyStatusInput struct { + _ struct{} `locationName:"GetAccessPointPolicyStatusRequest" type:"structure"` + + // The account ID for the account that owns the specified access point. + // // AccountId is a required field AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"` - // The ID for the job whose information you want to retrieve. + // The name of the access point whose policy status you want to retrieve. // - // JobId is a required field - JobId *string `location:"uri" locationName:"id" min:"5" type:"string" required:"true"` + // Name is a required field + Name *string `location:"uri" locationName:"name" min:"3" type:"string" required:"true"` } // String returns the string representation -func (s DescribeJobInput) String() string { +func (s GetAccessPointPolicyStatusInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeJobInput) GoString() string { +func (s GetAccessPointPolicyStatusInput) 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"} +func (s *GetAccessPointPolicyStatusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAccessPointPolicyStatusInput"} if s.AccountId == nil { invalidParams.Add(request.NewErrParamRequired("AccountId")) } if s.AccountId != nil && len(*s.AccountId) < 1 { invalidParams.Add(request.NewErrParamMinLen("AccountId", 1)) } - if s.JobId == nil { - invalidParams.Add(request.NewErrParamRequired("JobId")) + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) } - if s.JobId != nil && len(*s.JobId) < 5 { - invalidParams.Add(request.NewErrParamMinLen("JobId", 5)) + if s.Name != nil && len(*s.Name) < 3 { + invalidParams.Add(request.NewErrParamMinLen("Name", 3)) } if invalidParams.Len() > 0 { @@ -1037,50 +2385,52 @@ func (s *DescribeJobInput) Validate() error { } // SetAccountId sets the AccountId field's value. -func (s *DescribeJobInput) SetAccountId(v string) *DescribeJobInput { +func (s *GetAccessPointPolicyStatusInput) SetAccountId(v string) *GetAccessPointPolicyStatusInput { s.AccountId = &v return s } -// SetJobId sets the JobId field's value. -func (s *DescribeJobInput) SetJobId(v string) *DescribeJobInput { - s.JobId = &v +// SetName sets the Name field's value. +func (s *GetAccessPointPolicyStatusInput) SetName(v string) *GetAccessPointPolicyStatusInput { + s.Name = &v return s } -func (s *DescribeJobInput) hostLabels() map[string]string { +func (s *GetAccessPointPolicyStatusInput) hostLabels() map[string]string { return map[string]string{ "AccountId": aws.StringValue(s.AccountId), } } -type DescribeJobOutput struct { +type GetAccessPointPolicyStatusOutput struct { _ struct{} `type:"structure"` - // Contains the configuration parameters and status for the job specified in - // the Describe Job request. - Job *JobDescriptor `type:"structure"` + // Indicates the current policy status of the specified access point. + PolicyStatus *PolicyStatus `type:"structure"` } // String returns the string representation -func (s DescribeJobOutput) String() string { +func (s GetAccessPointPolicyStatusOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeJobOutput) GoString() string { +func (s GetAccessPointPolicyStatusOutput) GoString() string { return s.String() } -// SetJob sets the Job field's value. -func (s *DescribeJobOutput) SetJob(v *JobDescriptor) *DescribeJobOutput { - s.Job = v +// SetPolicyStatus sets the PolicyStatus field's value. +func (s *GetAccessPointPolicyStatusOutput) SetPolicyStatus(v *PolicyStatus) *GetAccessPointPolicyStatusOutput { + s.PolicyStatus = v return s } type GetPublicAccessBlockInput struct { _ struct{} `locationName:"GetPublicAccessBlockRequest" type:"structure"` + // The account ID for the Amazon Web Services account whose PublicAccessBlock + // configuration you want to retrieve. + // // AccountId is a required field AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"` } @@ -1126,6 +2476,8 @@ func (s *GetPublicAccessBlockInput) hostLabels() map[string]string { type GetPublicAccessBlockOutput struct { _ struct{} `type:"structure" payload:"PublicAccessBlockConfiguration"` + // The PublicAccessBlock configuration currently in effect for this Amazon Web + // Services account. PublicAccessBlockConfiguration *PublicAccessBlockConfiguration `type:"structure"` } @@ -1777,7 +3129,8 @@ func (s *JobProgressSummary) SetTotalNumberOfTasks(v int64) *JobProgressSummary type JobReport struct { _ struct{} `type:"structure"` - // The bucket where specified job-completion report will be stored. + // The Amazon Resource Name (ARN) for the bucket where specified job-completion + // report will be stored. Bucket *string `min:"1" type:"string"` // Indicates whether the specified job will generate a job-completion report. @@ -1895,6 +3248,131 @@ func (s *LambdaInvokeOperation) SetFunctionArn(v string) *LambdaInvokeOperation return s } +type ListAccessPointsInput struct { + _ struct{} `locationName:"ListAccessPointsRequest" type:"structure"` + + // The AWS account ID for owner of the bucket whose access points you want to + // list. + // + // AccountId is a required field + AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"` + + // The name of the bucket whose associated access points you want to list. + Bucket *string `location:"querystring" locationName:"bucket" min:"3" type:"string"` + + // The maximum number of access points that you want to include in the list. + // If the specified bucket has more than this number of access points, then + // the response will include a continuation token in the NextToken field that + // you can use to retrieve the next page of access points. + MaxResults *int64 `location:"querystring" locationName:"maxResults" min:"1" type:"integer"` + + // A continuation token. If a previous call to ListAccessPoints returned a continuation + // token in the NextToken field, then providing that value here causes Amazon + // S3 to retrieve the next page of results. + NextToken *string `location:"querystring" locationName:"nextToken" min:"1" type:"string"` +} + +// String returns the string representation +func (s ListAccessPointsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAccessPointsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListAccessPointsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAccessPointsInput"} + if s.AccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AccountId")) + } + if s.AccountId != nil && len(*s.AccountId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AccountId", 1)) + } + if s.Bucket != nil && len(*s.Bucket) < 3 { + invalidParams.Add(request.NewErrParamMinLen("Bucket", 3)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccountId sets the AccountId field's value. +func (s *ListAccessPointsInput) SetAccountId(v string) *ListAccessPointsInput { + s.AccountId = &v + return s +} + +// SetBucket sets the Bucket field's value. +func (s *ListAccessPointsInput) SetBucket(v string) *ListAccessPointsInput { + s.Bucket = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListAccessPointsInput) SetMaxResults(v int64) *ListAccessPointsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListAccessPointsInput) SetNextToken(v string) *ListAccessPointsInput { + s.NextToken = &v + return s +} + +func (s *ListAccessPointsInput) hostLabels() map[string]string { + return map[string]string{ + "AccountId": aws.StringValue(s.AccountId), + } +} + +type ListAccessPointsOutput struct { + _ struct{} `type:"structure"` + + // Contains identification and configuration information for one or more access + // points associated with the specified bucket. + AccessPointList []*AccessPoint `locationNameList:"AccessPoint" type:"list"` + + // If the specified bucket has more access points than can be returned in one + // call to this API, then this field contains a continuation token that you + // can provide in subsequent calls to this API to retrieve additional access + // points. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListAccessPointsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAccessPointsOutput) GoString() string { + return s.String() +} + +// SetAccessPointList sets the AccessPointList field's value. +func (s *ListAccessPointsOutput) SetAccessPointList(v []*AccessPoint) *ListAccessPointsOutput { + s.AccessPointList = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListAccessPointsOutput) SetNextToken(v string) *ListAccessPointsOutput { + s.NextToken = &v + return s +} + type ListJobsInput struct { _ struct{} `locationName:"ListJobsRequest" type:"structure"` @@ -2012,15 +3490,77 @@ func (s *ListJobsOutput) SetNextToken(v string) *ListJobsOutput { return s } +// Indicates whether this access point policy is public. For more information +// about how Amazon S3 evaluates policies to determine whether they are public, +// see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) +// in the Amazon Simple Storage Service Developer Guide. +type PolicyStatus struct { + _ struct{} `type:"structure"` + + IsPublic *bool `locationName:"IsPublic" type:"boolean"` +} + +// String returns the string representation +func (s PolicyStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PolicyStatus) GoString() string { + return s.String() +} + +// SetIsPublic sets the IsPublic field's value. +func (s *PolicyStatus) SetIsPublic(v bool) *PolicyStatus { + s.IsPublic = &v + return s +} + +// The PublicAccessBlock configuration that you want to apply to this Amazon +// S3 bucket. You can enable the configuration options in any combination. For +// more information about when Amazon S3 considers a bucket or object public, +// see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) +// in the Amazon Simple Storage Service Developer Guide. type PublicAccessBlockConfiguration struct { _ struct{} `type:"structure"` + // Specifies whether Amazon S3 should block public access control lists (ACLs) + // for buckets in this account. Setting this element to TRUE causes the following + // behavior: + // + // * PUT Bucket acl and PUT Object acl calls fail if the specified ACL is + // public. + // + // * PUT Object calls fail if the request includes a public ACL. + // + // * PUT Bucket calls fail if the request includes a public ACL. + // + // Enabling this setting doesn't affect existing policies or ACLs. BlockPublicAcls *bool `locationName:"BlockPublicAcls" type:"boolean"` + // Specifies whether Amazon S3 should block public bucket policies for buckets + // in this account. Setting this element to TRUE causes Amazon S3 to reject + // calls to PUT Bucket policy if the specified bucket policy allows public access. + // + // Enabling this setting doesn't affect existing bucket policies. BlockPublicPolicy *bool `locationName:"BlockPublicPolicy" type:"boolean"` + // Specifies whether Amazon S3 should ignore public ACLs for buckets in this + // account. Setting this element to TRUE causes Amazon S3 to ignore all public + // ACLs on buckets in this account and any objects that they contain. + // + // Enabling this setting doesn't affect the persistence of any existing ACLs + // and doesn't prevent new public ACLs from being set. IgnorePublicAcls *bool `locationName:"IgnorePublicAcls" type:"boolean"` + // Specifies whether Amazon S3 should restrict public bucket policies for buckets + // in this account. Setting this element to TRUE restricts access to buckets + // with public policies to only AWS services and authorized users within this + // account. + // + // Enabling this setting doesn't affect previously stored bucket policies, except + // that public and cross-account access within any public bucket policy, including + // non-public delegation to specific accounts, is blocked. RestrictPublicBuckets *bool `locationName:"RestrictPublicBuckets" type:"boolean"` } @@ -2058,12 +3598,115 @@ func (s *PublicAccessBlockConfiguration) SetRestrictPublicBuckets(v bool) *Publi return s } +type PutAccessPointPolicyInput struct { + _ struct{} `locationName:"PutAccessPointPolicyRequest" type:"structure" xmlURI:"http://awss3control.amazonaws.com/doc/2018-08-20/"` + + // The AWS account ID for owner of the bucket associated with the specified + // access point. + // + // AccountId is a required field + AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"` + + // The name of the access point that you want to associate with the specified + // policy. + // + // Name is a required field + Name *string `location:"uri" locationName:"name" min:"3" type:"string" required:"true"` + + // The policy that you want to apply to the specified access point. For more + // information about access point policies, see Managing Data Access with Amazon + // S3 Access Points (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-points.html) + // in the Amazon Simple Storage Service Developer Guide. + // + // Policy is a required field + Policy *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s PutAccessPointPolicyInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutAccessPointPolicyInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutAccessPointPolicyInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutAccessPointPolicyInput"} + if s.AccountId == nil { + invalidParams.Add(request.NewErrParamRequired("AccountId")) + } + if s.AccountId != nil && len(*s.AccountId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AccountId", 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.Policy == nil { + invalidParams.Add(request.NewErrParamRequired("Policy")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAccountId sets the AccountId field's value. +func (s *PutAccessPointPolicyInput) SetAccountId(v string) *PutAccessPointPolicyInput { + s.AccountId = &v + return s +} + +// SetName sets the Name field's value. +func (s *PutAccessPointPolicyInput) SetName(v string) *PutAccessPointPolicyInput { + s.Name = &v + return s +} + +// SetPolicy sets the Policy field's value. +func (s *PutAccessPointPolicyInput) SetPolicy(v string) *PutAccessPointPolicyInput { + s.Policy = &v + return s +} + +func (s *PutAccessPointPolicyInput) hostLabels() map[string]string { + return map[string]string{ + "AccountId": aws.StringValue(s.AccountId), + } +} + +type PutAccessPointPolicyOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutAccessPointPolicyOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutAccessPointPolicyOutput) GoString() string { + return s.String() +} + type PutPublicAccessBlockInput struct { _ struct{} `locationName:"PutPublicAccessBlockRequest" type:"structure" payload:"PublicAccessBlockConfiguration"` + // The account ID for the Amazon Web Services account whose PublicAccessBlock + // configuration you want to set. + // // AccountId is a required field AccountId *string `location:"header" locationName:"x-amz-account-id" type:"string" required:"true"` + // The PublicAccessBlock configuration that you want to apply to the specified + // Amazon Web Services account. + // // PublicAccessBlockConfiguration is a required field PublicAccessBlockConfiguration *PublicAccessBlockConfiguration `locationName:"PublicAccessBlockConfiguration" type:"structure" required:"true" xmlURI:"http://awss3control.amazonaws.com/doc/2018-08-20/"` } @@ -3115,6 +4758,49 @@ func (s *UpdateJobStatusOutput) SetStatusUpdateReason(v string) *UpdateJobStatus return s } +// The Virtual Private Cloud (VPC) configuration for an access point. +type VpcConfiguration struct { + _ struct{} `type:"structure"` + + // If this field is specified, this access point will only allow connections + // from the specified VPC ID. + // + // VpcId is a required field + VpcId *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s VpcConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VpcConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *VpcConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "VpcConfiguration"} + if s.VpcId == nil { + invalidParams.Add(request.NewErrParamRequired("VpcId")) + } + if s.VpcId != nil && len(*s.VpcId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VpcId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetVpcId sets the VpcId field's value. +func (s *VpcConfiguration) SetVpcId(v string) *VpcConfiguration { + s.VpcId = &v + return s +} + const ( // JobManifestFieldNameIgnore is a JobManifestFieldName enum value JobManifestFieldNameIgnore = "Ignore" @@ -3191,6 +4877,14 @@ const ( JobStatusSuspended = "Suspended" ) +const ( + // NetworkOriginInternet is a NetworkOrigin enum value + NetworkOriginInternet = "Internet" + + // NetworkOriginVpc is a NetworkOrigin enum value + NetworkOriginVpc = "VPC" +) + const ( // OperationNameLambdaInvoke is a OperationName enum value OperationNameLambdaInvoke = "LambdaInvoke" diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3control/errors.go b/vendor/github.com/aws/aws-sdk-go/service/s3control/errors.go index 59cc914a894..8f93d6b7707 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3control/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3control/errors.go @@ -30,6 +30,9 @@ const ( // ErrCodeNoSuchPublicAccessBlockConfiguration for service response error code // "NoSuchPublicAccessBlockConfiguration". + // + // Amazon S3 throws this exception if you make a GetPublicAccessBlock request + // against an account that doesn't have a PublicAccessBlockConfiguration set. ErrCodeNoSuchPublicAccessBlockConfiguration = "NoSuchPublicAccessBlockConfiguration" // ErrCodeNotFoundException for service response error code diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3control/service.go b/vendor/github.com/aws/aws-sdk-go/service/s3control/service.go index 377c9d55d55..de8fa2e2f0d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/s3control/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/s3control/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "S3 Control" // Name of service. EndpointsID = "s3-control" // ID to lookup a service endpoint with. - ServiceID = "S3 Control" // ServiceID is a unique identifer of a specific service. + ServiceID = "S3 Control" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the S3Control client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a S3Control client from just a session. // svc := s3control.New(mySession) // @@ -49,11 +51,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *S3Control { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "s3" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *S3Control { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *S3Control { svc := &S3Control{ Client: client.New( cfg, @@ -62,6 +64,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-08-20", }, diff --git a/vendor/github.com/aws/aws-sdk-go/service/sagemaker/api.go b/vendor/github.com/aws/aws-sdk-go/service/sagemaker/api.go index ed54c0f3258..9106e36ca89 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sagemaker/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sagemaker/api.go @@ -102,6 +102,91 @@ func (c *SageMaker) AddTagsWithContext(ctx aws.Context, input *AddTagsInput, opt return out, req.Send() } +const opAssociateTrialComponent = "AssociateTrialComponent" + +// AssociateTrialComponentRequest generates a "aws/request.Request" representing the +// client's request for the AssociateTrialComponent operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AssociateTrialComponent for more information on using the AssociateTrialComponent +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AssociateTrialComponentRequest method. +// req, resp := client.AssociateTrialComponentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/AssociateTrialComponent +func (c *SageMaker) AssociateTrialComponentRequest(input *AssociateTrialComponentInput) (req *request.Request, output *AssociateTrialComponentOutput) { + op := &request.Operation{ + Name: opAssociateTrialComponent, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AssociateTrialComponentInput{} + } + + output = &AssociateTrialComponentOutput{} + req = c.newRequest(op, input, output) + return +} + +// AssociateTrialComponent API operation for Amazon SageMaker Service. +// +// Associates a trial component with a trial. A trial component can be associated +// with multiple trials. To disassociate a trial component from a trial, call +// the DisassociateTrialComponent 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 SageMaker Service's +// API operation AssociateTrialComponent for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/AssociateTrialComponent +func (c *SageMaker) AssociateTrialComponent(input *AssociateTrialComponentInput) (*AssociateTrialComponentOutput, error) { + req, out := c.AssociateTrialComponentRequest(input) + return out, req.Send() +} + +// AssociateTrialComponentWithContext is the same as AssociateTrialComponent with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateTrialComponent for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) AssociateTrialComponentWithContext(ctx aws.Context, input *AssociateTrialComponentInput, opts ...request.Option) (*AssociateTrialComponentOutput, error) { + req, out := c.AssociateTrialComponentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateAlgorithm = "CreateAlgorithm" // CreateAlgorithmRequest generates a "aws/request.Request" representing the @@ -177,6 +262,179 @@ func (c *SageMaker) CreateAlgorithmWithContext(ctx aws.Context, input *CreateAlg return out, req.Send() } +const opCreateApp = "CreateApp" + +// CreateAppRequest generates a "aws/request.Request" representing the +// client's request for the CreateApp operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateApp for more information on using the CreateApp +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateAppRequest method. +// req, resp := client.CreateAppRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateApp +func (c *SageMaker) 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 Amazon SageMaker Service. +// +// Creates a running App for the specified UserProfile. Supported Apps are JupyterServer +// and KernelGateway. This operation is automatically invoked by Amazon SageMaker +// Amazon SageMaker Studio (Studio) upon access to the associated Studio Domain, +// and when new kernel configurations are selected by the user. A user may have +// multiple Apps active simultaneously. Apps will automatically terminate and +// be deleted when stopped from within Studio, or when the DeleteApp API is +// manually called. UserProfiles are limited to 5 concurrently running Apps +// 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 SageMaker Service's +// API operation CreateApp for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// * ResourceInUse +// Resource being accessed is in use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateApp +func (c *SageMaker) CreateApp(input *CreateAppInput) (*CreateAppOutput, error) { + req, out := c.CreateAppRequest(input) + return out, req.Send() +} + +// CreateAppWithContext is the same as CreateApp with the addition of +// the ability to pass a context and additional request options. +// +// See CreateApp for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) CreateAppWithContext(ctx aws.Context, input *CreateAppInput, opts ...request.Option) (*CreateAppOutput, error) { + req, out := c.CreateAppRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateAutoMLJob = "CreateAutoMLJob" + +// CreateAutoMLJobRequest generates a "aws/request.Request" representing the +// client's request for the CreateAutoMLJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateAutoMLJob for more information on using the CreateAutoMLJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateAutoMLJobRequest method. +// req, resp := client.CreateAutoMLJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateAutoMLJob +func (c *SageMaker) CreateAutoMLJobRequest(input *CreateAutoMLJobInput) (req *request.Request, output *CreateAutoMLJobOutput) { + op := &request.Operation{ + Name: opCreateAutoMLJob, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateAutoMLJobInput{} + } + + output = &CreateAutoMLJobOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateAutoMLJob API operation for Amazon SageMaker Service. +// +// Creates an AutoPilot 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 SageMaker Service's +// API operation CreateAutoMLJob for usage and error information. +// +// Returned Error Types: +// * ResourceInUse +// Resource being accessed is in use. +// +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateAutoMLJob +func (c *SageMaker) CreateAutoMLJob(input *CreateAutoMLJobInput) (*CreateAutoMLJobOutput, error) { + req, out := c.CreateAutoMLJobRequest(input) + return out, req.Send() +} + +// CreateAutoMLJobWithContext is the same as CreateAutoMLJob with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAutoMLJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) CreateAutoMLJobWithContext(ctx aws.Context, input *CreateAutoMLJobInput, opts ...request.Option) (*CreateAutoMLJobOutput, error) { + req, out := c.CreateAutoMLJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateCodeRepository = "CreateCodeRepository" // CreateCodeRepositoryRequest generates a "aws/request.Request" representing the @@ -339,11 +597,11 @@ func (c *SageMaker) CreateCompilationJobRequest(input *CreateCompilationJobInput // See the AWS API reference guide for Amazon SageMaker Service's // API operation CreateCompilationJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUse "ResourceInUse" +// Returned Error Types: +// * ResourceInUse // Resource being accessed is in use. // -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// * ResourceLimitExceeded // You have exceeded an Amazon SageMaker resource limit. For example, you might // have too many training jobs created. // @@ -369,6 +627,97 @@ func (c *SageMaker) CreateCompilationJobWithContext(ctx aws.Context, input *Crea return out, req.Send() } +const opCreateDomain = "CreateDomain" + +// CreateDomainRequest generates a "aws/request.Request" representing the +// client's request for the CreateDomain operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateDomain for more information on using the CreateDomain +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateDomainRequest method. +// req, resp := client.CreateDomainRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateDomain +func (c *SageMaker) 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 SageMaker Service. +// +// Creates a Domain for Amazon SageMaker Amazon SageMaker Studio (Studio), which +// can be accessed by end-users in a web browser. A Domain has an associated +// directory, list of authorized users, and a variety of security, application, +// policies, and Amazon Virtual Private Cloud configurations. An AWS account +// is limited to one Domain, per region. Users within a domain can share notebook +// files and other artifacts with each other. When a Domain is created, an Amazon +// Elastic File System (EFS) is also created for use by all of the users within +// the Domain. Each user receives a private home directory within the EFS for +// notebooks, Git repositories, and data 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 Amazon SageMaker Service's +// API operation CreateDomain for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// * ResourceInUse +// Resource being accessed is in use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateDomain +func (c *SageMaker) CreateDomain(input *CreateDomainInput) (*CreateDomainOutput, error) { + req, out := c.CreateDomainRequest(input) + return out, req.Send() +} + +// CreateDomainWithContext is the same as CreateDomain with the addition of +// the ability to pass a context and additional request options. +// +// See CreateDomain for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) CreateDomainWithContext(ctx aws.Context, input *CreateDomainInput, opts ...request.Option) (*CreateDomainOutput, error) { + req, out := c.CreateDomainRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateEndpoint = "CreateEndpoint" // CreateEndpointRequest generates a "aws/request.Request" representing the @@ -418,11 +767,15 @@ func (c *SageMaker) CreateEndpointRequest(input *CreateEndpointInput) (req *requ // You create the endpoint configuration with the CreateEndpointConfig (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpointConfig.html) // API. // -// Use this API only for hosting models using Amazon SageMaker hosting services. +// Use this API to deploy models using Amazon SageMaker hosting services. // -// You must not delete an EndpointConfig in use by an endpoint that is live -// or while the UpdateEndpoint or CreateEndpoint operations are being performed -// on the endpoint. To update an endpoint, you must create a new EndpointConfig. +// For an example that calls this method when deploying a model to Amazon SageMaker +// hosting services, see Deploy the Model to Amazon SageMaker Hosting Services +// (AWS SDK for Python (Boto 3)). (https://docs.aws.amazon.com/sagemaker/latest/dg/ex1-deploy-model.html#ex1-deploy-model-boto) +// +// You must not delete an EndpointConfig that is in use by an endpoint that +// is live or while the UpdateEndpoint or CreateEndpoint operations are being +// performed on the endpoint. To update an endpoint, you must create a new EndpointConfig. // // The endpoint name must be unique within an AWS Region in your AWS account. // @@ -435,15 +788,12 @@ func (c *SageMaker) CreateEndpointRequest(input *CreateEndpointInput) (req *requ // the status of an endpoint, use the DescribeEndpoint (https://docs.aws.amazon.com/sagemaker/latest/dg/API_DescribeEndpoint.html) // API. // -// For an example, see Exercise 1: Using the K-Means Algorithm Provided by Amazon -// SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/ex1.html). -// // If any of the models hosted at this endpoint get model data from an Amazon // S3 location, Amazon SageMaker uses AWS Security Token Service to download // model artifacts from the S3 path you provided. AWS STS is activated in your // IAM user account by default. If you previously deactivated AWS STS for a // region, you need to reactivate AWS STS for that region. For more information, -// see Activating and Deactivating AWS STS i an AWS Region (IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// see Activating and Deactivating AWS STS in an AWS Region (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) // in the AWS Identity and Access Management User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -453,8 +803,8 @@ func (c *SageMaker) CreateEndpointRequest(input *CreateEndpointInput) (req *requ // See the AWS API reference guide for Amazon SageMaker Service's // API operation CreateEndpoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// Returned Error Types: +// * ResourceLimitExceeded // You have exceeded an Amazon SageMaker resource limit. For example, you might // have too many training jobs created. // @@ -530,11 +880,11 @@ func (c *SageMaker) CreateEndpointConfigRequest(input *CreateEndpointConfigInput // Amazon SageMaker to provision. Then you call the CreateEndpoint (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html) // API. // -// Use this API only if you want to use Amazon SageMaker hosting services to -// deploy models into production. +// Use this API if you want to use Amazon SageMaker hosting services to deploy +// models into production. // -// In the request, you define one or more ProductionVariants, each of which -// identifies a model. Each ProductionVariant parameter also describes the resources +// In the request, you define a ProductionVariant, for each model that you want +// to deploy. Each ProductionVariant parameter also describes the resources // that you want Amazon SageMaker to provision. This includes the number and // type of ML compute instances to deploy. // @@ -544,6 +894,10 @@ func (c *SageMaker) CreateEndpointConfigRequest(input *CreateEndpointConfigInput // 2 for model A and 1 for model B. Amazon SageMaker distributes two-thirds // of the traffic to Model A, and one-third to model B. // +// For an example that calls this method when deploying a model to Amazon SageMaker +// hosting services, see Deploy the Model to Amazon SageMaker Hosting Services +// (AWS SDK for Python (Boto 3)). (https://docs.aws.amazon.com/sagemaker/latest/dg/ex1-deploy-model.html#ex1-deploy-model-boto) +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -551,8 +905,8 @@ func (c *SageMaker) CreateEndpointConfigRequest(input *CreateEndpointConfigInput // See the AWS API reference guide for Amazon SageMaker Service's // API operation CreateEndpointConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// Returned Error Types: +// * ResourceLimitExceeded // You have exceeded an Amazon SageMaker resource limit. For example, you might // have too many training jobs created. // @@ -578,6 +932,278 @@ func (c *SageMaker) CreateEndpointConfigWithContext(ctx aws.Context, input *Crea return out, req.Send() } +const opCreateExperiment = "CreateExperiment" + +// CreateExperimentRequest generates a "aws/request.Request" representing the +// client's request for the CreateExperiment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateExperiment for more information on using the CreateExperiment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateExperimentRequest method. +// req, resp := client.CreateExperimentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateExperiment +func (c *SageMaker) CreateExperimentRequest(input *CreateExperimentInput) (req *request.Request, output *CreateExperimentOutput) { + op := &request.Operation{ + Name: opCreateExperiment, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateExperimentInput{} + } + + output = &CreateExperimentOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateExperiment API operation for Amazon SageMaker Service. +// +// Creates an Amazon SageMaker experiment. An experiment is a collection of +// trials that are observed, compared and evaluated as a group. A trial is a +// set of steps, called trial components, that produce a machine learning model. +// +// The goal of an experiment is to determine the components that produce the +// best model. Multiple trials are performed, each one isolating and measuring +// the impact of a change to one or more inputs, while keeping the remaining +// inputs constant. +// +// When you use Amazon SageMaker Studio or the Amazon SageMaker Python SDK, +// all experiments, trials, and trial components are automatically tracked, +// logged, and indexed. When you use the AWS SDK for Python (Boto), you must +// use the logging APIs provided by the SDK. +// +// You can add tags to experiments, trials, trial components and then use the +// Search API to search for the tags. +// +// To add a description to an experiment, specify the optional Description parameter. +// To add a description later, or to change the description, call the UpdateExperiment +// API. +// +// To get a list of all your experiments, call the ListExperiments API. To view +// an experiment's properties, call the DescribeExperiment API. To get a list +// of all the trials associated with an experiment, call the ListTrials API. +// To create a trial call the CreateTrial 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 SageMaker Service's +// API operation CreateExperiment for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateExperiment +func (c *SageMaker) CreateExperiment(input *CreateExperimentInput) (*CreateExperimentOutput, error) { + req, out := c.CreateExperimentRequest(input) + return out, req.Send() +} + +// CreateExperimentWithContext is the same as CreateExperiment with the addition of +// the ability to pass a context and additional request options. +// +// See CreateExperiment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) CreateExperimentWithContext(ctx aws.Context, input *CreateExperimentInput, opts ...request.Option) (*CreateExperimentOutput, error) { + req, out := c.CreateExperimentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateFlowDefinition = "CreateFlowDefinition" + +// CreateFlowDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the CreateFlowDefinition operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateFlowDefinition for more information on using the CreateFlowDefinition +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateFlowDefinitionRequest method. +// req, resp := client.CreateFlowDefinitionRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateFlowDefinition +func (c *SageMaker) CreateFlowDefinitionRequest(input *CreateFlowDefinitionInput) (req *request.Request, output *CreateFlowDefinitionOutput) { + op := &request.Operation{ + Name: opCreateFlowDefinition, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateFlowDefinitionInput{} + } + + output = &CreateFlowDefinitionOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateFlowDefinition API operation for Amazon SageMaker Service. +// +// Creates a flow definition. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation CreateFlowDefinition for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// * ResourceInUse +// Resource being accessed is in use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateFlowDefinition +func (c *SageMaker) CreateFlowDefinition(input *CreateFlowDefinitionInput) (*CreateFlowDefinitionOutput, error) { + req, out := c.CreateFlowDefinitionRequest(input) + return out, req.Send() +} + +// CreateFlowDefinitionWithContext is the same as CreateFlowDefinition with the addition of +// the ability to pass a context and additional request options. +// +// See CreateFlowDefinition for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) CreateFlowDefinitionWithContext(ctx aws.Context, input *CreateFlowDefinitionInput, opts ...request.Option) (*CreateFlowDefinitionOutput, error) { + req, out := c.CreateFlowDefinitionRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateHumanTaskUi = "CreateHumanTaskUi" + +// CreateHumanTaskUiRequest generates a "aws/request.Request" representing the +// client's request for the CreateHumanTaskUi operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateHumanTaskUi for more information on using the CreateHumanTaskUi +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateHumanTaskUiRequest method. +// req, resp := client.CreateHumanTaskUiRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateHumanTaskUi +func (c *SageMaker) CreateHumanTaskUiRequest(input *CreateHumanTaskUiInput) (req *request.Request, output *CreateHumanTaskUiOutput) { + op := &request.Operation{ + Name: opCreateHumanTaskUi, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateHumanTaskUiInput{} + } + + output = &CreateHumanTaskUiOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateHumanTaskUi API operation for Amazon SageMaker Service. +// +// Defines the settings you will use for the human review workflow user interface. +// Reviewers will see a three-panel interface with an instruction area, the +// item to review, and an input area. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation CreateHumanTaskUi for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// * ResourceInUse +// Resource being accessed is in use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateHumanTaskUi +func (c *SageMaker) CreateHumanTaskUi(input *CreateHumanTaskUiInput) (*CreateHumanTaskUiOutput, error) { + req, out := c.CreateHumanTaskUiRequest(input) + return out, req.Send() +} + +// CreateHumanTaskUiWithContext is the same as CreateHumanTaskUi with the addition of +// the ability to pass a context and additional request options. +// +// See CreateHumanTaskUi for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) CreateHumanTaskUiWithContext(ctx aws.Context, input *CreateHumanTaskUiInput, opts ...request.Option) (*CreateHumanTaskUiOutput, error) { + req, out := c.CreateHumanTaskUiRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateHyperParameterTuningJob = "CreateHyperParameterTuningJob" // CreateHyperParameterTuningJobRequest generates a "aws/request.Request" representing the @@ -635,11 +1261,11 @@ func (c *SageMaker) CreateHyperParameterTuningJobRequest(input *CreateHyperParam // See the AWS API reference guide for Amazon SageMaker Service's // API operation CreateHyperParameterTuningJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUse "ResourceInUse" +// Returned Error Types: +// * ResourceInUse // Resource being accessed is in use. // -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// * ResourceLimitExceeded // You have exceeded an Amazon SageMaker resource limit. For example, you might // have too many training jobs created. // @@ -745,11 +1371,11 @@ func (c *SageMaker) CreateLabelingJobRequest(input *CreateLabelingJobInput) (req // See the AWS API reference guide for Amazon SageMaker Service's // API operation CreateLabelingJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUse "ResourceInUse" +// Returned Error Types: +// * ResourceInUse // Resource being accessed is in use. // -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// * ResourceLimitExceeded // You have exceeded an Amazon SageMaker resource limit. For example, you might // have too many training jobs created. // @@ -821,9 +1447,9 @@ func (c *SageMaker) CreateModelRequest(input *CreateModelInput) (req *request.Re // // Creates a model in Amazon SageMaker. In the request, you name the model and // describe a primary container. For the primary container, you specify the -// docker image containing inference code, artifacts (from prior training), -// and custom environment map that the inference code uses when you deploy the -// model for predictions. +// Docker image that contains inference code, artifacts (from prior training), +// and a custom environment map that the inference code uses when you deploy +// the model for predictions. // // Use this API to create a model if you want to use Amazon SageMaker hosting // services or run a batch transform job. @@ -833,6 +1459,10 @@ func (c *SageMaker) CreateModelRequest(input *CreateModelInput) (req *request.Re // then deploys all of the containers that you defined for the model in the // hosting environment. // +// For an example that calls this method when deploying a model to Amazon SageMaker +// hosting services, see Deploy the Model to Amazon SageMaker Hosting Services +// (AWS SDK for Python (Boto 3)). (https://docs.aws.amazon.com/sagemaker/latest/dg/ex1-deploy-model.html#ex1-deploy-model-boto) +// // To run a batch transform using your model, you start a job with the CreateTransformJob // API. Amazon SageMaker uses your model and your dataset to get inferences // which are then saved to a specified S3 location. @@ -854,8 +1484,8 @@ func (c *SageMaker) CreateModelRequest(input *CreateModelInput) (req *request.Re // See the AWS API reference guide for Amazon SageMaker Service's // API operation CreateModel for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// Returned Error Types: +// * ResourceLimitExceeded // You have exceeded an Amazon SageMaker resource limit. For example, you might // have too many training jobs created. // @@ -963,6 +1593,90 @@ func (c *SageMaker) CreateModelPackageWithContext(ctx aws.Context, input *Create return out, req.Send() } +const opCreateMonitoringSchedule = "CreateMonitoringSchedule" + +// CreateMonitoringScheduleRequest generates a "aws/request.Request" representing the +// client's request for the CreateMonitoringSchedule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateMonitoringSchedule for more information on using the CreateMonitoringSchedule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateMonitoringScheduleRequest method. +// req, resp := client.CreateMonitoringScheduleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateMonitoringSchedule +func (c *SageMaker) CreateMonitoringScheduleRequest(input *CreateMonitoringScheduleInput) (req *request.Request, output *CreateMonitoringScheduleOutput) { + op := &request.Operation{ + Name: opCreateMonitoringSchedule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateMonitoringScheduleInput{} + } + + output = &CreateMonitoringScheduleOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateMonitoringSchedule API operation for Amazon SageMaker Service. +// +// Creates a schedule that regularly starts Amazon SageMaker Processing Jobs +// to monitor the data captured for an Amazon SageMaker Endoint. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation CreateMonitoringSchedule for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// * ResourceInUse +// Resource being accessed is in use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateMonitoringSchedule +func (c *SageMaker) CreateMonitoringSchedule(input *CreateMonitoringScheduleInput) (*CreateMonitoringScheduleOutput, error) { + req, out := c.CreateMonitoringScheduleRequest(input) + return out, req.Send() +} + +// CreateMonitoringScheduleWithContext is the same as CreateMonitoringSchedule with the addition of +// the ability to pass a context and additional request options. +// +// See CreateMonitoringSchedule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) CreateMonitoringScheduleWithContext(ctx aws.Context, input *CreateMonitoringScheduleInput, opts ...request.Option) (*CreateMonitoringScheduleOutput, error) { + req, out := c.CreateMonitoringScheduleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateNotebookInstance = "CreateNotebookInstance" // CreateNotebookInstanceRequest generates a "aws/request.Request" representing the @@ -1053,8 +1767,8 @@ func (c *SageMaker) CreateNotebookInstanceRequest(input *CreateNotebookInstanceI // See the AWS API reference guide for Amazon SageMaker Service's // API operation CreateNotebookInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// Returned Error Types: +// * ResourceLimitExceeded // You have exceeded an Amazon SageMaker resource limit. For example, you might // have too many training jobs created. // @@ -1150,8 +1864,8 @@ func (c *SageMaker) CreateNotebookInstanceLifecycleConfigRequest(input *CreateNo // See the AWS API reference guide for Amazon SageMaker Service's // API operation CreateNotebookInstanceLifecycleConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// Returned Error Types: +// * ResourceLimitExceeded // You have exceeded an Amazon SageMaker resource limit. For example, you might // have too many training jobs created. // @@ -1177,6 +1891,89 @@ func (c *SageMaker) CreateNotebookInstanceLifecycleConfigWithContext(ctx aws.Con return out, req.Send() } +const opCreatePresignedDomainUrl = "CreatePresignedDomainUrl" + +// CreatePresignedDomainUrlRequest generates a "aws/request.Request" representing the +// client's request for the CreatePresignedDomainUrl operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreatePresignedDomainUrl for more information on using the CreatePresignedDomainUrl +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreatePresignedDomainUrlRequest method. +// req, resp := client.CreatePresignedDomainUrlRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreatePresignedDomainUrl +func (c *SageMaker) CreatePresignedDomainUrlRequest(input *CreatePresignedDomainUrlInput) (req *request.Request, output *CreatePresignedDomainUrlOutput) { + op := &request.Operation{ + Name: opCreatePresignedDomainUrl, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreatePresignedDomainUrlInput{} + } + + output = &CreatePresignedDomainUrlOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreatePresignedDomainUrl API operation for Amazon SageMaker Service. +// +// Creates a URL for a specified UserProfile in a Domain. When accessed in a +// web browser, the user will be automatically signed in to Amazon SageMaker +// Amazon SageMaker Studio (Studio), and granted access to all of the Apps and +// files associated with that Amazon Elastic File System (EFS). This operation +// can only be called when AuthMode equals 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 Amazon SageMaker Service's +// API operation CreatePresignedDomainUrl for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreatePresignedDomainUrl +func (c *SageMaker) CreatePresignedDomainUrl(input *CreatePresignedDomainUrlInput) (*CreatePresignedDomainUrlOutput, error) { + req, out := c.CreatePresignedDomainUrlRequest(input) + return out, req.Send() +} + +// CreatePresignedDomainUrlWithContext is the same as CreatePresignedDomainUrl with the addition of +// the ability to pass a context and additional request options. +// +// See CreatePresignedDomainUrl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) CreatePresignedDomainUrlWithContext(ctx aws.Context, input *CreatePresignedDomainUrlInput, opts ...request.Option) (*CreatePresignedDomainUrlOutput, error) { + req, out := c.CreatePresignedDomainUrlRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreatePresignedNotebookInstanceUrl = "CreatePresignedNotebookInstanceUrl" // CreatePresignedNotebookInstanceUrlRequest generates a "aws/request.Request" representing the @@ -1233,7 +2030,7 @@ func (c *SageMaker) CreatePresignedNotebookInstanceUrlRequest(input *CreatePresi // to a list of IP addresses that you specify. Use the NotIpAddress condition // operator and the aws:SourceIP condition context key to specify the list of // IP addresses that you want to have access to the notebook instance. For more -// information, see Limit Access to a Notebook Instance by IP Address (https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-ip-filter.html). +// information, see Limit Access to a Notebook Instance by IP Address (https://docs.aws.amazon.com/sagemaker/latest/dg/security_iam_id-based-policy-examples.html#nbi-ip-filter). // // The URL that you get from a call to is valid only for 5 minutes. If you try // to use the URL after the 5-minute limit expires, you are directed to the @@ -1267,6 +2064,92 @@ func (c *SageMaker) CreatePresignedNotebookInstanceUrlWithContext(ctx aws.Contex return out, req.Send() } +const opCreateProcessingJob = "CreateProcessingJob" + +// CreateProcessingJobRequest generates a "aws/request.Request" representing the +// client's request for the CreateProcessingJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateProcessingJob for more information on using the CreateProcessingJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateProcessingJobRequest method. +// req, resp := client.CreateProcessingJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateProcessingJob +func (c *SageMaker) CreateProcessingJobRequest(input *CreateProcessingJobInput) (req *request.Request, output *CreateProcessingJobOutput) { + op := &request.Operation{ + Name: opCreateProcessingJob, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateProcessingJobInput{} + } + + output = &CreateProcessingJobOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateProcessingJob API operation for Amazon SageMaker Service. +// +// Creates a processing 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 SageMaker Service's +// API operation CreateProcessingJob for usage and error information. +// +// Returned Error Types: +// * ResourceInUse +// Resource being accessed is in use. +// +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateProcessingJob +func (c *SageMaker) CreateProcessingJob(input *CreateProcessingJobInput) (*CreateProcessingJobOutput, error) { + req, out := c.CreateProcessingJobRequest(input) + return out, req.Send() +} + +// CreateProcessingJobWithContext is the same as CreateProcessingJob with the addition of +// the ability to pass a context and additional request options. +// +// See CreateProcessingJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) CreateProcessingJobWithContext(ctx aws.Context, input *CreateProcessingJobInput, opts ...request.Option) (*CreateProcessingJobOutput, error) { + req, out := c.CreateProcessingJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateTrainingJob = "CreateTrainingJob" // CreateTrainingJobRequest generates a "aws/request.Request" representing the @@ -1350,8 +2233,7 @@ func (c *SageMaker) CreateTrainingJobRequest(input *CreateTrainingJobInput) (req // // * StoppingCondition - To help cap training costs, use MaxRuntimeInSeconds // to set a time limit for training. Use MaxWaitTimeInSeconds to specify -// how long you are willing to to wait for a managed spot training job to -// complete. +// how long you are willing to wait for a managed spot training job to complete. // // For more information about Amazon SageMaker, see How It Works (https://docs.aws.amazon.com/sagemaker/latest/dg/how-it-works.html). // @@ -1362,14 +2244,17 @@ func (c *SageMaker) CreateTrainingJobRequest(input *CreateTrainingJobInput) (req // See the AWS API reference guide for Amazon SageMaker Service's // API operation CreateTrainingJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUse "ResourceInUse" +// Returned Error Types: +// * ResourceInUse // Resource being accessed is in use. // -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// * ResourceLimitExceeded // You have exceeded an Amazon SageMaker resource limit. For example, you might // have too many training jobs created. // +// * ResourceNotFound +// Resource being access is not found. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateTrainingJob func (c *SageMaker) CreateTrainingJob(input *CreateTrainingJobInput) (*CreateTrainingJobOutput, error) { req, out := c.CreateTrainingJobRequest(input) @@ -1460,8 +2345,8 @@ func (c *SageMaker) CreateTransformJobRequest(input *CreateTransformJobInput) (r // * TransformResources - Identifies the ML compute instances for the transform // job. // -// For more information about how batch transformation works Amazon SageMaker, -// see How It Works (https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform.html). +// For more information about how batch transformation works, see Batch Transform +// (https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform.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 @@ -1470,14 +2355,17 @@ func (c *SageMaker) CreateTransformJobRequest(input *CreateTransformJobInput) (r // See the AWS API reference guide for Amazon SageMaker Service's // API operation CreateTransformJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUse "ResourceInUse" +// Returned Error Types: +// * ResourceInUse // Resource being accessed is in use. // -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// * ResourceLimitExceeded // You have exceeded an Amazon SageMaker resource limit. For example, you might // have too many training jobs created. // +// * ResourceNotFound +// Resource being access is not found. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateTransformJob func (c *SageMaker) CreateTransformJob(input *CreateTransformJobInput) (*CreateTransformJobOutput, error) { req, out := c.CreateTransformJobRequest(input) @@ -1500,4396 +2388,4104 @@ func (c *SageMaker) CreateTransformJobWithContext(ctx aws.Context, input *Create return out, req.Send() } -const opCreateWorkteam = "CreateWorkteam" +const opCreateTrial = "CreateTrial" -// CreateWorkteamRequest generates a "aws/request.Request" representing the -// client's request for the CreateWorkteam operation. The "output" return +// CreateTrialRequest generates a "aws/request.Request" representing the +// client's request for the CreateTrial operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See CreateWorkteam for more information on using the CreateWorkteam +// See CreateTrial for more information on using the CreateTrial // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the CreateWorkteamRequest method. -// req, resp := client.CreateWorkteamRequest(params) +// // Example sending a request using the CreateTrialRequest method. +// req, resp := client.CreateTrialRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateWorkteam -func (c *SageMaker) CreateWorkteamRequest(input *CreateWorkteamInput) (req *request.Request, output *CreateWorkteamOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateTrial +func (c *SageMaker) CreateTrialRequest(input *CreateTrialInput) (req *request.Request, output *CreateTrialOutput) { op := &request.Operation{ - Name: opCreateWorkteam, + Name: opCreateTrial, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &CreateWorkteamInput{} + input = &CreateTrialInput{} } - output = &CreateWorkteamOutput{} + output = &CreateTrialOutput{} req = c.newRequest(op, input, output) return } -// CreateWorkteam API operation for Amazon SageMaker Service. +// CreateTrial API operation for Amazon SageMaker Service. // -// Creates a new work team for labeling your data. A work team is defined by -// one or more Amazon Cognito user pools. You must first create the user pools -// before you can create a work team. +// Creates an Amazon SageMaker trial. A trial is a set of steps called trial +// components that produce a machine learning model. A trial is part of a single +// Amazon SageMaker experiment. // -// You cannot create more than 25 work teams in an account and region. +// When you use Amazon SageMaker Studio or the Amazon SageMaker Python SDK, +// all experiments, trials, and trial components are automatically tracked, +// logged, and indexed. When you use the AWS SDK for Python (Boto), you must +// use the logging APIs provided by the SDK. +// +// You can add tags to a trial and then use the Search API to search for the +// tags. +// +// To get a list of all your trials, call the ListTrials API. To view a trial's +// properties, call the DescribeTrial API. To create a trial component, call +// the CreateTrialComponent 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 SageMaker Service's -// API operation CreateWorkteam for usage and error information. +// API operation CreateTrial for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceInUse "ResourceInUse" -// Resource being accessed is in use. +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. // -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// * ResourceLimitExceeded // You have exceeded an Amazon SageMaker resource limit. For example, you might // have too many training jobs created. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateWorkteam -func (c *SageMaker) CreateWorkteam(input *CreateWorkteamInput) (*CreateWorkteamOutput, error) { - req, out := c.CreateWorkteamRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateTrial +func (c *SageMaker) CreateTrial(input *CreateTrialInput) (*CreateTrialOutput, error) { + req, out := c.CreateTrialRequest(input) return out, req.Send() } -// CreateWorkteamWithContext is the same as CreateWorkteam with the addition of +// CreateTrialWithContext is the same as CreateTrial with the addition of // the ability to pass a context and additional request options. // -// See CreateWorkteam for details on how to use this API operation. +// See CreateTrial for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) CreateWorkteamWithContext(ctx aws.Context, input *CreateWorkteamInput, opts ...request.Option) (*CreateWorkteamOutput, error) { - req, out := c.CreateWorkteamRequest(input) +func (c *SageMaker) CreateTrialWithContext(ctx aws.Context, input *CreateTrialInput, opts ...request.Option) (*CreateTrialOutput, error) { + req, out := c.CreateTrialRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteAlgorithm = "DeleteAlgorithm" +const opCreateTrialComponent = "CreateTrialComponent" -// DeleteAlgorithmRequest generates a "aws/request.Request" representing the -// client's request for the DeleteAlgorithm operation. The "output" return +// CreateTrialComponentRequest generates a "aws/request.Request" representing the +// client's request for the CreateTrialComponent operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteAlgorithm for more information on using the DeleteAlgorithm +// See CreateTrialComponent for more information on using the CreateTrialComponent // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteAlgorithmRequest method. -// req, resp := client.DeleteAlgorithmRequest(params) +// // Example sending a request using the CreateTrialComponentRequest method. +// req, resp := client.CreateTrialComponentRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteAlgorithm -func (c *SageMaker) DeleteAlgorithmRequest(input *DeleteAlgorithmInput) (req *request.Request, output *DeleteAlgorithmOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateTrialComponent +func (c *SageMaker) CreateTrialComponentRequest(input *CreateTrialComponentInput) (req *request.Request, output *CreateTrialComponentOutput) { op := &request.Operation{ - Name: opDeleteAlgorithm, + Name: opCreateTrialComponent, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteAlgorithmInput{} + input = &CreateTrialComponentInput{} } - output = &DeleteAlgorithmOutput{} + output = &CreateTrialComponentOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DeleteAlgorithm API operation for Amazon SageMaker Service. +// CreateTrialComponent API operation for Amazon SageMaker Service. // -// Removes the specified algorithm from your account. +// Creates a trial component, which is a stage of a machine learning trial. +// A trial is composed of one or more trial components. A trial component can +// be used in multiple trials. +// +// Trial components include pre-processing jobs, training jobs, and batch transform +// jobs. +// +// When you use Amazon SageMaker Studio or the Amazon SageMaker Python SDK, +// all experiments, trials, and trial components are automatically tracked, +// logged, and indexed. When you use the AWS SDK for Python (Boto), you must +// use the logging APIs provided by the SDK. +// +// You can add tags to a trial component and then use the Search API to search +// for the tags. +// +// CreateTrialComponent can only be invoked from within an Amazon SageMaker +// managed environment. This includes Amazon SageMaker training jobs, processing +// jobs, transform jobs, and Amazon SageMaker notebooks. A call to CreateTrialComponent +// from outside one of these environments results 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 SageMaker Service's -// API operation DeleteAlgorithm for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteAlgorithm -func (c *SageMaker) DeleteAlgorithm(input *DeleteAlgorithmInput) (*DeleteAlgorithmOutput, error) { - req, out := c.DeleteAlgorithmRequest(input) +// API operation CreateTrialComponent for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateTrialComponent +func (c *SageMaker) CreateTrialComponent(input *CreateTrialComponentInput) (*CreateTrialComponentOutput, error) { + req, out := c.CreateTrialComponentRequest(input) return out, req.Send() } -// DeleteAlgorithmWithContext is the same as DeleteAlgorithm with the addition of +// CreateTrialComponentWithContext is the same as CreateTrialComponent with the addition of // the ability to pass a context and additional request options. // -// See DeleteAlgorithm for details on how to use this API operation. +// See CreateTrialComponent for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DeleteAlgorithmWithContext(ctx aws.Context, input *DeleteAlgorithmInput, opts ...request.Option) (*DeleteAlgorithmOutput, error) { - req, out := c.DeleteAlgorithmRequest(input) +func (c *SageMaker) CreateTrialComponentWithContext(ctx aws.Context, input *CreateTrialComponentInput, opts ...request.Option) (*CreateTrialComponentOutput, error) { + req, out := c.CreateTrialComponentRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteCodeRepository = "DeleteCodeRepository" +const opCreateUserProfile = "CreateUserProfile" -// DeleteCodeRepositoryRequest generates a "aws/request.Request" representing the -// client's request for the DeleteCodeRepository operation. The "output" return +// CreateUserProfileRequest generates a "aws/request.Request" representing the +// client's request for the CreateUserProfile operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteCodeRepository for more information on using the DeleteCodeRepository +// See CreateUserProfile for more information on using the CreateUserProfile // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteCodeRepositoryRequest method. -// req, resp := client.DeleteCodeRepositoryRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteCodeRepository -func (c *SageMaker) DeleteCodeRepositoryRequest(input *DeleteCodeRepositoryInput) (req *request.Request, output *DeleteCodeRepositoryOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateUserProfile +func (c *SageMaker) CreateUserProfileRequest(input *CreateUserProfileInput) (req *request.Request, output *CreateUserProfileOutput) { op := &request.Operation{ - Name: opDeleteCodeRepository, + Name: opCreateUserProfile, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteCodeRepositoryInput{} + input = &CreateUserProfileInput{} } - output = &DeleteCodeRepositoryOutput{} + output = &CreateUserProfileOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DeleteCodeRepository API operation for Amazon SageMaker Service. +// CreateUserProfile API operation for Amazon SageMaker Service. // -// Deletes the specified Git repository from your account. +// Creates a new user profile. A user profile represents a single user within +// a Domain, and is the main way to reference a "person" for the purposes of +// sharing, reporting and other user-oriented features. This entity is created +// during on-boarding. If an administrator invites a person by email or imports +// them from SSO, a new UserProfile is automatically created. This entity is +// the primary holder of settings for an individual user and has a reference +// to the user's private Amazon Elastic File System (EFS) home 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 Amazon SageMaker Service's -// API operation DeleteCodeRepository for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteCodeRepository -func (c *SageMaker) DeleteCodeRepository(input *DeleteCodeRepositoryInput) (*DeleteCodeRepositoryOutput, error) { - req, out := c.DeleteCodeRepositoryRequest(input) +// API operation CreateUserProfile for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// * ResourceInUse +// Resource being accessed is in use. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateUserProfile +func (c *SageMaker) CreateUserProfile(input *CreateUserProfileInput) (*CreateUserProfileOutput, error) { + req, out := c.CreateUserProfileRequest(input) return out, req.Send() } -// DeleteCodeRepositoryWithContext is the same as DeleteCodeRepository with the addition of +// CreateUserProfileWithContext is the same as CreateUserProfile with the addition of // the ability to pass a context and additional request options. // -// See DeleteCodeRepository for details on how to use this API operation. +// See CreateUserProfile for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DeleteCodeRepositoryWithContext(ctx aws.Context, input *DeleteCodeRepositoryInput, opts ...request.Option) (*DeleteCodeRepositoryOutput, error) { - req, out := c.DeleteCodeRepositoryRequest(input) +func (c *SageMaker) CreateUserProfileWithContext(ctx aws.Context, input *CreateUserProfileInput, opts ...request.Option) (*CreateUserProfileOutput, error) { + req, out := c.CreateUserProfileRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteEndpoint = "DeleteEndpoint" +const opCreateWorkteam = "CreateWorkteam" -// DeleteEndpointRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEndpoint operation. The "output" return +// CreateWorkteamRequest generates a "aws/request.Request" representing the +// client's request for the CreateWorkteam operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteEndpoint for more information on using the DeleteEndpoint +// See CreateWorkteam for more information on using the CreateWorkteam // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteEndpointRequest method. -// req, resp := client.DeleteEndpointRequest(params) +// // Example sending a request using the CreateWorkteamRequest method. +// req, resp := client.CreateWorkteamRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteEndpoint -func (c *SageMaker) DeleteEndpointRequest(input *DeleteEndpointInput) (req *request.Request, output *DeleteEndpointOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateWorkteam +func (c *SageMaker) CreateWorkteamRequest(input *CreateWorkteamInput) (req *request.Request, output *CreateWorkteamOutput) { op := &request.Operation{ - Name: opDeleteEndpoint, + Name: opCreateWorkteam, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteEndpointInput{} + input = &CreateWorkteamInput{} } - output = &DeleteEndpointOutput{} + output = &CreateWorkteamOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DeleteEndpoint API operation for Amazon SageMaker Service. +// CreateWorkteam API operation for Amazon SageMaker Service. // -// Deletes an endpoint. Amazon SageMaker frees up all of the resources that -// were deployed when the endpoint was created. +// Creates a new work team for labeling your data. A work team is defined by +// one or more Amazon Cognito user pools. You must first create the user pools +// before you can create a work team. // -// Amazon SageMaker retires any custom KMS key grants associated with the endpoint, -// meaning you don't need to use the RevokeGrant (http://docs.aws.amazon.com/kms/latest/APIReference/API_RevokeGrant.html) -// API call. +// You cannot create more than 25 work teams in an account and 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 SageMaker Service's -// API operation DeleteEndpoint for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteEndpoint -func (c *SageMaker) DeleteEndpoint(input *DeleteEndpointInput) (*DeleteEndpointOutput, error) { - req, out := c.DeleteEndpointRequest(input) +// API operation CreateWorkteam for usage and error information. +// +// Returned Error Types: +// * ResourceInUse +// Resource being accessed is in use. +// +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/CreateWorkteam +func (c *SageMaker) CreateWorkteam(input *CreateWorkteamInput) (*CreateWorkteamOutput, error) { + req, out := c.CreateWorkteamRequest(input) return out, req.Send() } -// DeleteEndpointWithContext is the same as DeleteEndpoint with the addition of +// CreateWorkteamWithContext is the same as CreateWorkteam with the addition of // the ability to pass a context and additional request options. // -// See DeleteEndpoint for details on how to use this API operation. +// See CreateWorkteam for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DeleteEndpointWithContext(ctx aws.Context, input *DeleteEndpointInput, opts ...request.Option) (*DeleteEndpointOutput, error) { - req, out := c.DeleteEndpointRequest(input) +func (c *SageMaker) CreateWorkteamWithContext(ctx aws.Context, input *CreateWorkteamInput, opts ...request.Option) (*CreateWorkteamOutput, error) { + req, out := c.CreateWorkteamRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteEndpointConfig = "DeleteEndpointConfig" +const opDeleteAlgorithm = "DeleteAlgorithm" -// DeleteEndpointConfigRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEndpointConfig operation. The "output" return +// DeleteAlgorithmRequest generates a "aws/request.Request" representing the +// client's request for the DeleteAlgorithm operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteEndpointConfig for more information on using the DeleteEndpointConfig +// See DeleteAlgorithm for more information on using the DeleteAlgorithm // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteEndpointConfigRequest method. -// req, resp := client.DeleteEndpointConfigRequest(params) +// // Example sending a request using the DeleteAlgorithmRequest method. +// req, resp := client.DeleteAlgorithmRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteEndpointConfig -func (c *SageMaker) DeleteEndpointConfigRequest(input *DeleteEndpointConfigInput) (req *request.Request, output *DeleteEndpointConfigOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteAlgorithm +func (c *SageMaker) DeleteAlgorithmRequest(input *DeleteAlgorithmInput) (req *request.Request, output *DeleteAlgorithmOutput) { op := &request.Operation{ - Name: opDeleteEndpointConfig, + Name: opDeleteAlgorithm, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteEndpointConfigInput{} + input = &DeleteAlgorithmInput{} } - output = &DeleteEndpointConfigOutput{} + output = &DeleteAlgorithmOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DeleteEndpointConfig API operation for Amazon SageMaker Service. +// DeleteAlgorithm API operation for Amazon SageMaker Service. // -// Deletes an endpoint configuration. The DeleteEndpointConfig API deletes only -// the specified configuration. It does not delete endpoints created using the -// configuration. +// Removes the specified algorithm 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 SageMaker Service's -// API operation DeleteEndpointConfig for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteEndpointConfig -func (c *SageMaker) DeleteEndpointConfig(input *DeleteEndpointConfigInput) (*DeleteEndpointConfigOutput, error) { - req, out := c.DeleteEndpointConfigRequest(input) +// API operation DeleteAlgorithm for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteAlgorithm +func (c *SageMaker) DeleteAlgorithm(input *DeleteAlgorithmInput) (*DeleteAlgorithmOutput, error) { + req, out := c.DeleteAlgorithmRequest(input) return out, req.Send() } -// DeleteEndpointConfigWithContext is the same as DeleteEndpointConfig with the addition of +// DeleteAlgorithmWithContext is the same as DeleteAlgorithm with the addition of // the ability to pass a context and additional request options. // -// See DeleteEndpointConfig for details on how to use this API operation. +// See DeleteAlgorithm for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DeleteEndpointConfigWithContext(ctx aws.Context, input *DeleteEndpointConfigInput, opts ...request.Option) (*DeleteEndpointConfigOutput, error) { - req, out := c.DeleteEndpointConfigRequest(input) +func (c *SageMaker) DeleteAlgorithmWithContext(ctx aws.Context, input *DeleteAlgorithmInput, opts ...request.Option) (*DeleteAlgorithmOutput, error) { + req, out := c.DeleteAlgorithmRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteModel = "DeleteModel" +const opDeleteApp = "DeleteApp" -// DeleteModelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteModel operation. The "output" return +// DeleteAppRequest generates a "aws/request.Request" representing the +// client's request for the DeleteApp operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteModel for more information on using the DeleteModel +// See DeleteApp for more information on using the DeleteApp // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteModelRequest method. -// req, resp := client.DeleteModelRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteModel -func (c *SageMaker) DeleteModelRequest(input *DeleteModelInput) (req *request.Request, output *DeleteModelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteApp +func (c *SageMaker) DeleteAppRequest(input *DeleteAppInput) (req *request.Request, output *DeleteAppOutput) { op := &request.Operation{ - Name: opDeleteModel, + Name: opDeleteApp, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteModelInput{} + input = &DeleteAppInput{} } - output = &DeleteModelOutput{} + output = &DeleteAppOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DeleteModel API operation for Amazon SageMaker Service. +// DeleteApp API operation for Amazon SageMaker Service. // -// Deletes a model. The DeleteModel API deletes only the model entry that was -// created in Amazon SageMaker when you called the CreateModel (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateModel.html) -// API. It does not delete model artifacts, inference code, or the IAM role -// that you specified when creating the model. +// Used to stop and delete an app. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation DeleteModel for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteModel -func (c *SageMaker) DeleteModel(input *DeleteModelInput) (*DeleteModelOutput, error) { - req, out := c.DeleteModelRequest(input) +// API operation DeleteApp for usage and error information. +// +// Returned Error Types: +// * ResourceInUse +// Resource being accessed is in use. +// +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteApp +func (c *SageMaker) DeleteApp(input *DeleteAppInput) (*DeleteAppOutput, error) { + req, out := c.DeleteAppRequest(input) return out, req.Send() } -// DeleteModelWithContext is the same as DeleteModel with the addition of +// DeleteAppWithContext is the same as DeleteApp with the addition of // the ability to pass a context and additional request options. // -// See DeleteModel for details on how to use this API operation. +// See DeleteApp for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DeleteModelWithContext(ctx aws.Context, input *DeleteModelInput, opts ...request.Option) (*DeleteModelOutput, error) { - req, out := c.DeleteModelRequest(input) +func (c *SageMaker) DeleteAppWithContext(ctx aws.Context, input *DeleteAppInput, opts ...request.Option) (*DeleteAppOutput, error) { + req, out := c.DeleteAppRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteModelPackage = "DeleteModelPackage" +const opDeleteCodeRepository = "DeleteCodeRepository" -// DeleteModelPackageRequest generates a "aws/request.Request" representing the -// client's request for the DeleteModelPackage operation. The "output" return +// DeleteCodeRepositoryRequest generates a "aws/request.Request" representing the +// client's request for the DeleteCodeRepository operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteModelPackage for more information on using the DeleteModelPackage +// See DeleteCodeRepository for more information on using the DeleteCodeRepository // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteModelPackageRequest method. -// req, resp := client.DeleteModelPackageRequest(params) +// // Example sending a request using the DeleteCodeRepositoryRequest method. +// req, resp := client.DeleteCodeRepositoryRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteModelPackage -func (c *SageMaker) DeleteModelPackageRequest(input *DeleteModelPackageInput) (req *request.Request, output *DeleteModelPackageOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteCodeRepository +func (c *SageMaker) DeleteCodeRepositoryRequest(input *DeleteCodeRepositoryInput) (req *request.Request, output *DeleteCodeRepositoryOutput) { op := &request.Operation{ - Name: opDeleteModelPackage, + Name: opDeleteCodeRepository, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteModelPackageInput{} + input = &DeleteCodeRepositoryInput{} } - output = &DeleteModelPackageOutput{} + output = &DeleteCodeRepositoryOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DeleteModelPackage API operation for Amazon SageMaker Service. -// -// Deletes a model package. +// DeleteCodeRepository API operation for Amazon SageMaker Service. // -// A model package is used to create Amazon SageMaker models or list on AWS -// Marketplace. Buyers can subscribe to model packages listed on AWS Marketplace -// to create models in Amazon SageMaker. +// Deletes the specified Git repository 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 SageMaker Service's -// API operation DeleteModelPackage for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteModelPackage -func (c *SageMaker) DeleteModelPackage(input *DeleteModelPackageInput) (*DeleteModelPackageOutput, error) { - req, out := c.DeleteModelPackageRequest(input) +// API operation DeleteCodeRepository for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteCodeRepository +func (c *SageMaker) DeleteCodeRepository(input *DeleteCodeRepositoryInput) (*DeleteCodeRepositoryOutput, error) { + req, out := c.DeleteCodeRepositoryRequest(input) return out, req.Send() } -// DeleteModelPackageWithContext is the same as DeleteModelPackage with the addition of +// DeleteCodeRepositoryWithContext is the same as DeleteCodeRepository with the addition of // the ability to pass a context and additional request options. // -// See DeleteModelPackage for details on how to use this API operation. +// See DeleteCodeRepository for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DeleteModelPackageWithContext(ctx aws.Context, input *DeleteModelPackageInput, opts ...request.Option) (*DeleteModelPackageOutput, error) { - req, out := c.DeleteModelPackageRequest(input) +func (c *SageMaker) DeleteCodeRepositoryWithContext(ctx aws.Context, input *DeleteCodeRepositoryInput, opts ...request.Option) (*DeleteCodeRepositoryOutput, error) { + req, out := c.DeleteCodeRepositoryRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteNotebookInstance = "DeleteNotebookInstance" +const opDeleteDomain = "DeleteDomain" -// DeleteNotebookInstanceRequest generates a "aws/request.Request" representing the -// client's request for the DeleteNotebookInstance operation. The "output" return +// DeleteDomainRequest generates a "aws/request.Request" representing the +// client's request for the DeleteDomain operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteNotebookInstance for more information on using the DeleteNotebookInstance +// See DeleteDomain for more information on using the DeleteDomain // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteNotebookInstanceRequest method. -// req, resp := client.DeleteNotebookInstanceRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteNotebookInstance -func (c *SageMaker) DeleteNotebookInstanceRequest(input *DeleteNotebookInstanceInput) (req *request.Request, output *DeleteNotebookInstanceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteDomain +func (c *SageMaker) DeleteDomainRequest(input *DeleteDomainInput) (req *request.Request, output *DeleteDomainOutput) { op := &request.Operation{ - Name: opDeleteNotebookInstance, + Name: opDeleteDomain, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteNotebookInstanceInput{} + input = &DeleteDomainInput{} } - output = &DeleteNotebookInstanceOutput{} + output = &DeleteDomainOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DeleteNotebookInstance API operation for Amazon SageMaker Service. -// -// Deletes an Amazon SageMaker notebook instance. Before you can delete a notebook -// instance, you must call the StopNotebookInstance API. +// DeleteDomain API operation for Amazon SageMaker Service. // -// When you delete a notebook instance, you lose all of your data. Amazon SageMaker -// removes the ML compute instance, and deletes the ML storage volume and the -// network interface associated with the notebook instance. +// Used to delete a domain. If you on-boarded with IAM mode, you will need to +// delete your domain to on-board again using SSO. Use with caution. All of +// the members of the domain will lose access to their EFS volume, including +// data, notebooks, and other 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 Amazon SageMaker Service's -// API operation DeleteNotebookInstance for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteNotebookInstance -func (c *SageMaker) DeleteNotebookInstance(input *DeleteNotebookInstanceInput) (*DeleteNotebookInstanceOutput, error) { - req, out := c.DeleteNotebookInstanceRequest(input) +// API operation DeleteDomain for usage and error information. +// +// Returned Error Types: +// * ResourceInUse +// Resource being accessed is in use. +// +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteDomain +func (c *SageMaker) DeleteDomain(input *DeleteDomainInput) (*DeleteDomainOutput, error) { + req, out := c.DeleteDomainRequest(input) return out, req.Send() } -// DeleteNotebookInstanceWithContext is the same as DeleteNotebookInstance with the addition of +// DeleteDomainWithContext is the same as DeleteDomain with the addition of // the ability to pass a context and additional request options. // -// See DeleteNotebookInstance for details on how to use this API operation. +// See DeleteDomain for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DeleteNotebookInstanceWithContext(ctx aws.Context, input *DeleteNotebookInstanceInput, opts ...request.Option) (*DeleteNotebookInstanceOutput, error) { - req, out := c.DeleteNotebookInstanceRequest(input) +func (c *SageMaker) DeleteDomainWithContext(ctx aws.Context, input *DeleteDomainInput, opts ...request.Option) (*DeleteDomainOutput, error) { + req, out := c.DeleteDomainRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteNotebookInstanceLifecycleConfig = "DeleteNotebookInstanceLifecycleConfig" +const opDeleteEndpoint = "DeleteEndpoint" -// DeleteNotebookInstanceLifecycleConfigRequest generates a "aws/request.Request" representing the -// client's request for the DeleteNotebookInstanceLifecycleConfig operation. The "output" return +// DeleteEndpointRequest generates a "aws/request.Request" representing the +// client's request for the DeleteEndpoint operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteNotebookInstanceLifecycleConfig for more information on using the DeleteNotebookInstanceLifecycleConfig +// See DeleteEndpoint for more information on using the DeleteEndpoint // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteNotebookInstanceLifecycleConfigRequest method. -// req, resp := client.DeleteNotebookInstanceLifecycleConfigRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteNotebookInstanceLifecycleConfig -func (c *SageMaker) DeleteNotebookInstanceLifecycleConfigRequest(input *DeleteNotebookInstanceLifecycleConfigInput) (req *request.Request, output *DeleteNotebookInstanceLifecycleConfigOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteEndpoint +func (c *SageMaker) DeleteEndpointRequest(input *DeleteEndpointInput) (req *request.Request, output *DeleteEndpointOutput) { op := &request.Operation{ - Name: opDeleteNotebookInstanceLifecycleConfig, + Name: opDeleteEndpoint, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteNotebookInstanceLifecycleConfigInput{} + input = &DeleteEndpointInput{} } - output = &DeleteNotebookInstanceLifecycleConfigOutput{} + output = &DeleteEndpointOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DeleteNotebookInstanceLifecycleConfig API operation for Amazon SageMaker Service. +// DeleteEndpoint API operation for Amazon SageMaker Service. // -// Deletes a notebook instance lifecycle configuration. +// Deletes an endpoint. Amazon SageMaker frees up all of the resources that +// were deployed when the endpoint was created. +// +// Amazon SageMaker retires any custom KMS key grants associated with the endpoint, +// meaning you don't need to use the RevokeGrant (http://docs.aws.amazon.com/kms/latest/APIReference/API_RevokeGrant.html) +// API 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 SageMaker Service's -// API operation DeleteNotebookInstanceLifecycleConfig for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteNotebookInstanceLifecycleConfig -func (c *SageMaker) DeleteNotebookInstanceLifecycleConfig(input *DeleteNotebookInstanceLifecycleConfigInput) (*DeleteNotebookInstanceLifecycleConfigOutput, error) { - req, out := c.DeleteNotebookInstanceLifecycleConfigRequest(input) +// API operation DeleteEndpoint for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteEndpoint +func (c *SageMaker) DeleteEndpoint(input *DeleteEndpointInput) (*DeleteEndpointOutput, error) { + req, out := c.DeleteEndpointRequest(input) return out, req.Send() } -// DeleteNotebookInstanceLifecycleConfigWithContext is the same as DeleteNotebookInstanceLifecycleConfig with the addition of +// DeleteEndpointWithContext is the same as DeleteEndpoint with the addition of // the ability to pass a context and additional request options. // -// See DeleteNotebookInstanceLifecycleConfig for details on how to use this API operation. +// See DeleteEndpoint for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DeleteNotebookInstanceLifecycleConfigWithContext(ctx aws.Context, input *DeleteNotebookInstanceLifecycleConfigInput, opts ...request.Option) (*DeleteNotebookInstanceLifecycleConfigOutput, error) { - req, out := c.DeleteNotebookInstanceLifecycleConfigRequest(input) +func (c *SageMaker) DeleteEndpointWithContext(ctx aws.Context, input *DeleteEndpointInput, opts ...request.Option) (*DeleteEndpointOutput, error) { + req, out := c.DeleteEndpointRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteTags = "DeleteTags" +const opDeleteEndpointConfig = "DeleteEndpointConfig" -// DeleteTagsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTags operation. The "output" return +// DeleteEndpointConfigRequest generates a "aws/request.Request" representing the +// client's request for the DeleteEndpointConfig operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteTags for more information on using the DeleteTags +// See DeleteEndpointConfig for more information on using the DeleteEndpointConfig // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteTagsRequest method. -// req, resp := client.DeleteTagsRequest(params) +// // Example sending a request using the DeleteEndpointConfigRequest method. +// req, resp := client.DeleteEndpointConfigRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteTags -func (c *SageMaker) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, output *DeleteTagsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteEndpointConfig +func (c *SageMaker) DeleteEndpointConfigRequest(input *DeleteEndpointConfigInput) (req *request.Request, output *DeleteEndpointConfigOutput) { op := &request.Operation{ - Name: opDeleteTags, + Name: opDeleteEndpointConfig, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteTagsInput{} + input = &DeleteEndpointConfigInput{} } - output = &DeleteTagsOutput{} + output = &DeleteEndpointConfigOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DeleteTags API operation for Amazon SageMaker Service. -// -// Deletes the specified tags from an Amazon SageMaker resource. -// -// To list a resource's tags, use the ListTags API. +// DeleteEndpointConfig API operation for Amazon SageMaker Service. // -// When you call this API to delete tags from a hyperparameter tuning job, the -// deleted tags are not removed from training jobs that the hyperparameter tuning -// job launched before you called this API. +// Deletes an endpoint configuration. The DeleteEndpointConfig API deletes only +// the specified configuration. It does not delete endpoints created using the +// 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 SageMaker Service's -// API operation DeleteTags for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteTags -func (c *SageMaker) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { - req, out := c.DeleteTagsRequest(input) +// API operation DeleteEndpointConfig for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteEndpointConfig +func (c *SageMaker) DeleteEndpointConfig(input *DeleteEndpointConfigInput) (*DeleteEndpointConfigOutput, error) { + req, out := c.DeleteEndpointConfigRequest(input) return out, req.Send() } -// DeleteTagsWithContext is the same as DeleteTags with the addition of +// DeleteEndpointConfigWithContext is the same as DeleteEndpointConfig with the addition of // the ability to pass a context and additional request options. // -// See DeleteTags for details on how to use this API operation. +// See DeleteEndpointConfig for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DeleteTagsWithContext(ctx aws.Context, input *DeleteTagsInput, opts ...request.Option) (*DeleteTagsOutput, error) { - req, out := c.DeleteTagsRequest(input) +func (c *SageMaker) DeleteEndpointConfigWithContext(ctx aws.Context, input *DeleteEndpointConfigInput, opts ...request.Option) (*DeleteEndpointConfigOutput, error) { + req, out := c.DeleteEndpointConfigRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDeleteWorkteam = "DeleteWorkteam" +const opDeleteExperiment = "DeleteExperiment" -// DeleteWorkteamRequest generates a "aws/request.Request" representing the -// client's request for the DeleteWorkteam operation. The "output" return +// DeleteExperimentRequest generates a "aws/request.Request" representing the +// client's request for the DeleteExperiment operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DeleteWorkteam for more information on using the DeleteWorkteam +// See DeleteExperiment for more information on using the DeleteExperiment // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DeleteWorkteamRequest method. -// req, resp := client.DeleteWorkteamRequest(params) +// // Example sending a request using the DeleteExperimentRequest method. +// req, resp := client.DeleteExperimentRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteWorkteam -func (c *SageMaker) DeleteWorkteamRequest(input *DeleteWorkteamInput) (req *request.Request, output *DeleteWorkteamOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteExperiment +func (c *SageMaker) DeleteExperimentRequest(input *DeleteExperimentInput) (req *request.Request, output *DeleteExperimentOutput) { op := &request.Operation{ - Name: opDeleteWorkteam, + Name: opDeleteExperiment, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DeleteWorkteamInput{} + input = &DeleteExperimentInput{} } - output = &DeleteWorkteamOutput{} + output = &DeleteExperimentOutput{} req = c.newRequest(op, input, output) return } -// DeleteWorkteam API operation for Amazon SageMaker Service. +// DeleteExperiment API operation for Amazon SageMaker Service. // -// Deletes an existing work team. This operation can't be undone. +// Deletes an Amazon SageMaker experiment. All trials associated with the experiment +// must be deleted first. Use the ListTrials API to get a list of the trials +// associated with the experiment. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation DeleteWorkteam for usage and error information. +// API operation DeleteExperiment for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" -// You have exceeded an Amazon SageMaker resource limit. For example, you might -// have too many training jobs created. +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteWorkteam -func (c *SageMaker) DeleteWorkteam(input *DeleteWorkteamInput) (*DeleteWorkteamOutput, error) { - req, out := c.DeleteWorkteamRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteExperiment +func (c *SageMaker) DeleteExperiment(input *DeleteExperimentInput) (*DeleteExperimentOutput, error) { + req, out := c.DeleteExperimentRequest(input) return out, req.Send() } -// DeleteWorkteamWithContext is the same as DeleteWorkteam with the addition of +// DeleteExperimentWithContext is the same as DeleteExperiment with the addition of // the ability to pass a context and additional request options. // -// See DeleteWorkteam for details on how to use this API operation. +// See DeleteExperiment for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DeleteWorkteamWithContext(ctx aws.Context, input *DeleteWorkteamInput, opts ...request.Option) (*DeleteWorkteamOutput, error) { - req, out := c.DeleteWorkteamRequest(input) +func (c *SageMaker) DeleteExperimentWithContext(ctx aws.Context, input *DeleteExperimentInput, opts ...request.Option) (*DeleteExperimentOutput, error) { + req, out := c.DeleteExperimentRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeAlgorithm = "DescribeAlgorithm" +const opDeleteFlowDefinition = "DeleteFlowDefinition" -// DescribeAlgorithmRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAlgorithm operation. The "output" return +// DeleteFlowDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the DeleteFlowDefinition operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeAlgorithm for more information on using the DescribeAlgorithm +// See DeleteFlowDefinition for more information on using the DeleteFlowDefinition // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeAlgorithmRequest method. -// req, resp := client.DescribeAlgorithmRequest(params) +// // Example sending a request using the DeleteFlowDefinitionRequest method. +// req, resp := client.DeleteFlowDefinitionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeAlgorithm -func (c *SageMaker) DescribeAlgorithmRequest(input *DescribeAlgorithmInput) (req *request.Request, output *DescribeAlgorithmOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteFlowDefinition +func (c *SageMaker) DeleteFlowDefinitionRequest(input *DeleteFlowDefinitionInput) (req *request.Request, output *DeleteFlowDefinitionOutput) { op := &request.Operation{ - Name: opDescribeAlgorithm, + Name: opDeleteFlowDefinition, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeAlgorithmInput{} + input = &DeleteFlowDefinitionInput{} } - output = &DescribeAlgorithmOutput{} + output = &DeleteFlowDefinitionOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DescribeAlgorithm API operation for Amazon SageMaker Service. +// DeleteFlowDefinition API operation for Amazon SageMaker Service. // -// Returns a description of the specified algorithm that is in your account. +// Deletes the specified flow definition. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation DescribeAlgorithm for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeAlgorithm -func (c *SageMaker) DescribeAlgorithm(input *DescribeAlgorithmInput) (*DescribeAlgorithmOutput, error) { - req, out := c.DescribeAlgorithmRequest(input) +// API operation DeleteFlowDefinition for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteFlowDefinition +func (c *SageMaker) DeleteFlowDefinition(input *DeleteFlowDefinitionInput) (*DeleteFlowDefinitionOutput, error) { + req, out := c.DeleteFlowDefinitionRequest(input) return out, req.Send() } -// DescribeAlgorithmWithContext is the same as DescribeAlgorithm with the addition of +// DeleteFlowDefinitionWithContext is the same as DeleteFlowDefinition with the addition of // the ability to pass a context and additional request options. // -// See DescribeAlgorithm for details on how to use this API operation. +// See DeleteFlowDefinition for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DescribeAlgorithmWithContext(ctx aws.Context, input *DescribeAlgorithmInput, opts ...request.Option) (*DescribeAlgorithmOutput, error) { - req, out := c.DescribeAlgorithmRequest(input) +func (c *SageMaker) DeleteFlowDefinitionWithContext(ctx aws.Context, input *DeleteFlowDefinitionInput, opts ...request.Option) (*DeleteFlowDefinitionOutput, error) { + req, out := c.DeleteFlowDefinitionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeCodeRepository = "DescribeCodeRepository" +const opDeleteModel = "DeleteModel" -// DescribeCodeRepositoryRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCodeRepository operation. The "output" return +// DeleteModelRequest generates a "aws/request.Request" representing the +// client's request for the DeleteModel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeCodeRepository for more information on using the DescribeCodeRepository +// See DeleteModel for more information on using the DeleteModel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeCodeRepositoryRequest method. -// req, resp := client.DescribeCodeRepositoryRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeCodeRepository -func (c *SageMaker) DescribeCodeRepositoryRequest(input *DescribeCodeRepositoryInput) (req *request.Request, output *DescribeCodeRepositoryOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteModel +func (c *SageMaker) DeleteModelRequest(input *DeleteModelInput) (req *request.Request, output *DeleteModelOutput) { op := &request.Operation{ - Name: opDescribeCodeRepository, + Name: opDeleteModel, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeCodeRepositoryInput{} + input = &DeleteModelInput{} } - output = &DescribeCodeRepositoryOutput{} + output = &DeleteModelOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DescribeCodeRepository API operation for Amazon SageMaker Service. +// DeleteModel API operation for Amazon SageMaker Service. // -// Gets details about the specified Git repository. +// Deletes a model. The DeleteModel API deletes only the model entry that was +// created in Amazon SageMaker when you called the CreateModel (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateModel.html) +// API. It does not delete model artifacts, inference code, or the IAM role +// that you specified when creating the 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 SageMaker Service's -// API operation DescribeCodeRepository for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeCodeRepository -func (c *SageMaker) DescribeCodeRepository(input *DescribeCodeRepositoryInput) (*DescribeCodeRepositoryOutput, error) { - req, out := c.DescribeCodeRepositoryRequest(input) +// API operation DeleteModel for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteModel +func (c *SageMaker) DeleteModel(input *DeleteModelInput) (*DeleteModelOutput, error) { + req, out := c.DeleteModelRequest(input) return out, req.Send() } -// DescribeCodeRepositoryWithContext is the same as DescribeCodeRepository with the addition of +// DeleteModelWithContext is the same as DeleteModel with the addition of // the ability to pass a context and additional request options. // -// See DescribeCodeRepository for details on how to use this API operation. +// See DeleteModel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DescribeCodeRepositoryWithContext(ctx aws.Context, input *DescribeCodeRepositoryInput, opts ...request.Option) (*DescribeCodeRepositoryOutput, error) { - req, out := c.DescribeCodeRepositoryRequest(input) +func (c *SageMaker) DeleteModelWithContext(ctx aws.Context, input *DeleteModelInput, opts ...request.Option) (*DeleteModelOutput, error) { + req, out := c.DeleteModelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeCompilationJob = "DescribeCompilationJob" +const opDeleteModelPackage = "DeleteModelPackage" -// DescribeCompilationJobRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCompilationJob operation. The "output" return +// DeleteModelPackageRequest generates a "aws/request.Request" representing the +// client's request for the DeleteModelPackage operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeCompilationJob for more information on using the DescribeCompilationJob +// See DeleteModelPackage for more information on using the DeleteModelPackage // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeCompilationJobRequest method. -// req, resp := client.DescribeCompilationJobRequest(params) +// // Example sending a request using the DeleteModelPackageRequest method. +// req, resp := client.DeleteModelPackageRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeCompilationJob -func (c *SageMaker) DescribeCompilationJobRequest(input *DescribeCompilationJobInput) (req *request.Request, output *DescribeCompilationJobOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteModelPackage +func (c *SageMaker) DeleteModelPackageRequest(input *DeleteModelPackageInput) (req *request.Request, output *DeleteModelPackageOutput) { op := &request.Operation{ - Name: opDescribeCompilationJob, + Name: opDeleteModelPackage, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeCompilationJobInput{} + input = &DeleteModelPackageInput{} } - output = &DescribeCompilationJobOutput{} + output = &DeleteModelPackageOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DescribeCompilationJob API operation for Amazon SageMaker Service. +// DeleteModelPackage API operation for Amazon SageMaker Service. // -// Returns information about a model compilation job. +// Deletes a model package. // -// To create a model compilation job, use CreateCompilationJob. To get information -// about multiple model compilation jobs, use ListCompilationJobs. +// A model package is used to create Amazon SageMaker models or list on AWS +// Marketplace. Buyers can subscribe to model packages listed on AWS Marketplace +// to create models in Amazon SageMaker. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation DescribeCompilationJob for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFound "ResourceNotFound" -// Resource being access is not found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeCompilationJob -func (c *SageMaker) DescribeCompilationJob(input *DescribeCompilationJobInput) (*DescribeCompilationJobOutput, error) { - req, out := c.DescribeCompilationJobRequest(input) +// API operation DeleteModelPackage for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteModelPackage +func (c *SageMaker) DeleteModelPackage(input *DeleteModelPackageInput) (*DeleteModelPackageOutput, error) { + req, out := c.DeleteModelPackageRequest(input) return out, req.Send() } -// DescribeCompilationJobWithContext is the same as DescribeCompilationJob with the addition of +// DeleteModelPackageWithContext is the same as DeleteModelPackage with the addition of // the ability to pass a context and additional request options. // -// See DescribeCompilationJob for details on how to use this API operation. +// See DeleteModelPackage for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DescribeCompilationJobWithContext(ctx aws.Context, input *DescribeCompilationJobInput, opts ...request.Option) (*DescribeCompilationJobOutput, error) { - req, out := c.DescribeCompilationJobRequest(input) +func (c *SageMaker) DeleteModelPackageWithContext(ctx aws.Context, input *DeleteModelPackageInput, opts ...request.Option) (*DeleteModelPackageOutput, error) { + req, out := c.DeleteModelPackageRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeEndpoint = "DescribeEndpoint" +const opDeleteMonitoringSchedule = "DeleteMonitoringSchedule" -// DescribeEndpointRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEndpoint operation. The "output" return +// DeleteMonitoringScheduleRequest generates a "aws/request.Request" representing the +// client's request for the DeleteMonitoringSchedule operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeEndpoint for more information on using the DescribeEndpoint +// See DeleteMonitoringSchedule for more information on using the DeleteMonitoringSchedule // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeEndpointRequest method. -// req, resp := client.DescribeEndpointRequest(params) +// // Example sending a request using the DeleteMonitoringScheduleRequest method. +// req, resp := client.DeleteMonitoringScheduleRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeEndpoint -func (c *SageMaker) DescribeEndpointRequest(input *DescribeEndpointInput) (req *request.Request, output *DescribeEndpointOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteMonitoringSchedule +func (c *SageMaker) DeleteMonitoringScheduleRequest(input *DeleteMonitoringScheduleInput) (req *request.Request, output *DeleteMonitoringScheduleOutput) { op := &request.Operation{ - Name: opDescribeEndpoint, + Name: opDeleteMonitoringSchedule, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeEndpointInput{} + input = &DeleteMonitoringScheduleInput{} } - output = &DescribeEndpointOutput{} + output = &DeleteMonitoringScheduleOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DescribeEndpoint API operation for Amazon SageMaker Service. +// DeleteMonitoringSchedule API operation for Amazon SageMaker Service. // -// Returns the description of an endpoint. +// Deletes a monitoring schedule. Also stops the schedule had not already been +// stopped. This does not delete the job execution history of the monitoring +// 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 SageMaker Service's -// API operation DescribeEndpoint for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeEndpoint -func (c *SageMaker) DescribeEndpoint(input *DescribeEndpointInput) (*DescribeEndpointOutput, error) { - req, out := c.DescribeEndpointRequest(input) +// API operation DeleteMonitoringSchedule for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteMonitoringSchedule +func (c *SageMaker) DeleteMonitoringSchedule(input *DeleteMonitoringScheduleInput) (*DeleteMonitoringScheduleOutput, error) { + req, out := c.DeleteMonitoringScheduleRequest(input) return out, req.Send() } -// DescribeEndpointWithContext is the same as DescribeEndpoint with the addition of +// DeleteMonitoringScheduleWithContext is the same as DeleteMonitoringSchedule with the addition of // the ability to pass a context and additional request options. // -// See DescribeEndpoint for details on how to use this API operation. +// See DeleteMonitoringSchedule for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DescribeEndpointWithContext(ctx aws.Context, input *DescribeEndpointInput, opts ...request.Option) (*DescribeEndpointOutput, error) { - req, out := c.DescribeEndpointRequest(input) +func (c *SageMaker) DeleteMonitoringScheduleWithContext(ctx aws.Context, input *DeleteMonitoringScheduleInput, opts ...request.Option) (*DeleteMonitoringScheduleOutput, error) { + req, out := c.DeleteMonitoringScheduleRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeEndpointConfig = "DescribeEndpointConfig" +const opDeleteNotebookInstance = "DeleteNotebookInstance" -// DescribeEndpointConfigRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEndpointConfig operation. The "output" return +// DeleteNotebookInstanceRequest generates a "aws/request.Request" representing the +// client's request for the DeleteNotebookInstance operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeEndpointConfig for more information on using the DescribeEndpointConfig +// See DeleteNotebookInstance for more information on using the DeleteNotebookInstance // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeEndpointConfigRequest method. -// req, resp := client.DescribeEndpointConfigRequest(params) +// // Example sending a request using the DeleteNotebookInstanceRequest method. +// req, resp := client.DeleteNotebookInstanceRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeEndpointConfig -func (c *SageMaker) DescribeEndpointConfigRequest(input *DescribeEndpointConfigInput) (req *request.Request, output *DescribeEndpointConfigOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteNotebookInstance +func (c *SageMaker) DeleteNotebookInstanceRequest(input *DeleteNotebookInstanceInput) (req *request.Request, output *DeleteNotebookInstanceOutput) { op := &request.Operation{ - Name: opDescribeEndpointConfig, + Name: opDeleteNotebookInstance, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeEndpointConfigInput{} + input = &DeleteNotebookInstanceInput{} } - output = &DescribeEndpointConfigOutput{} + output = &DeleteNotebookInstanceOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DescribeEndpointConfig API operation for Amazon SageMaker Service. +// DeleteNotebookInstance API operation for Amazon SageMaker Service. // -// Returns the description of an endpoint configuration created using the CreateEndpointConfig -// API. +// Deletes an Amazon SageMaker notebook instance. Before you can delete a notebook +// instance, you must call the StopNotebookInstance API. +// +// When you delete a notebook instance, you lose all of your data. Amazon SageMaker +// removes the ML compute instance, and deletes the ML storage volume and the +// network interface associated with the notebook 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 SageMaker Service's -// API operation DescribeEndpointConfig for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeEndpointConfig -func (c *SageMaker) DescribeEndpointConfig(input *DescribeEndpointConfigInput) (*DescribeEndpointConfigOutput, error) { - req, out := c.DescribeEndpointConfigRequest(input) +// API operation DeleteNotebookInstance for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteNotebookInstance +func (c *SageMaker) DeleteNotebookInstance(input *DeleteNotebookInstanceInput) (*DeleteNotebookInstanceOutput, error) { + req, out := c.DeleteNotebookInstanceRequest(input) return out, req.Send() } -// DescribeEndpointConfigWithContext is the same as DescribeEndpointConfig with the addition of +// DeleteNotebookInstanceWithContext is the same as DeleteNotebookInstance with the addition of // the ability to pass a context and additional request options. // -// See DescribeEndpointConfig for details on how to use this API operation. +// See DeleteNotebookInstance for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DescribeEndpointConfigWithContext(ctx aws.Context, input *DescribeEndpointConfigInput, opts ...request.Option) (*DescribeEndpointConfigOutput, error) { - req, out := c.DescribeEndpointConfigRequest(input) +func (c *SageMaker) DeleteNotebookInstanceWithContext(ctx aws.Context, input *DeleteNotebookInstanceInput, opts ...request.Option) (*DeleteNotebookInstanceOutput, error) { + req, out := c.DeleteNotebookInstanceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeHyperParameterTuningJob = "DescribeHyperParameterTuningJob" +const opDeleteNotebookInstanceLifecycleConfig = "DeleteNotebookInstanceLifecycleConfig" -// DescribeHyperParameterTuningJobRequest generates a "aws/request.Request" representing the -// client's request for the DescribeHyperParameterTuningJob operation. The "output" return +// DeleteNotebookInstanceLifecycleConfigRequest generates a "aws/request.Request" representing the +// client's request for the DeleteNotebookInstanceLifecycleConfig operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeHyperParameterTuningJob for more information on using the DescribeHyperParameterTuningJob +// See DeleteNotebookInstanceLifecycleConfig for more information on using the DeleteNotebookInstanceLifecycleConfig // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeHyperParameterTuningJobRequest method. -// req, resp := client.DescribeHyperParameterTuningJobRequest(params) +// // Example sending a request using the DeleteNotebookInstanceLifecycleConfigRequest method. +// req, resp := client.DeleteNotebookInstanceLifecycleConfigRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeHyperParameterTuningJob -func (c *SageMaker) DescribeHyperParameterTuningJobRequest(input *DescribeHyperParameterTuningJobInput) (req *request.Request, output *DescribeHyperParameterTuningJobOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteNotebookInstanceLifecycleConfig +func (c *SageMaker) DeleteNotebookInstanceLifecycleConfigRequest(input *DeleteNotebookInstanceLifecycleConfigInput) (req *request.Request, output *DeleteNotebookInstanceLifecycleConfigOutput) { op := &request.Operation{ - Name: opDescribeHyperParameterTuningJob, + Name: opDeleteNotebookInstanceLifecycleConfig, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeHyperParameterTuningJobInput{} + input = &DeleteNotebookInstanceLifecycleConfigInput{} } - output = &DescribeHyperParameterTuningJobOutput{} + output = &DeleteNotebookInstanceLifecycleConfigOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DescribeHyperParameterTuningJob API operation for Amazon SageMaker Service. +// DeleteNotebookInstanceLifecycleConfig API operation for Amazon SageMaker Service. // -// Gets a description of a hyperparameter tuning job. +// Deletes a notebook instance lifecycle 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 SageMaker Service's -// API operation DescribeHyperParameterTuningJob for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFound "ResourceNotFound" -// Resource being access is not found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeHyperParameterTuningJob -func (c *SageMaker) DescribeHyperParameterTuningJob(input *DescribeHyperParameterTuningJobInput) (*DescribeHyperParameterTuningJobOutput, error) { - req, out := c.DescribeHyperParameterTuningJobRequest(input) +// API operation DeleteNotebookInstanceLifecycleConfig for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteNotebookInstanceLifecycleConfig +func (c *SageMaker) DeleteNotebookInstanceLifecycleConfig(input *DeleteNotebookInstanceLifecycleConfigInput) (*DeleteNotebookInstanceLifecycleConfigOutput, error) { + req, out := c.DeleteNotebookInstanceLifecycleConfigRequest(input) return out, req.Send() } -// DescribeHyperParameterTuningJobWithContext is the same as DescribeHyperParameterTuningJob with the addition of +// DeleteNotebookInstanceLifecycleConfigWithContext is the same as DeleteNotebookInstanceLifecycleConfig with the addition of // the ability to pass a context and additional request options. // -// See DescribeHyperParameterTuningJob for details on how to use this API operation. +// See DeleteNotebookInstanceLifecycleConfig for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DescribeHyperParameterTuningJobWithContext(ctx aws.Context, input *DescribeHyperParameterTuningJobInput, opts ...request.Option) (*DescribeHyperParameterTuningJobOutput, error) { - req, out := c.DescribeHyperParameterTuningJobRequest(input) +func (c *SageMaker) DeleteNotebookInstanceLifecycleConfigWithContext(ctx aws.Context, input *DeleteNotebookInstanceLifecycleConfigInput, opts ...request.Option) (*DeleteNotebookInstanceLifecycleConfigOutput, error) { + req, out := c.DeleteNotebookInstanceLifecycleConfigRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeLabelingJob = "DescribeLabelingJob" +const opDeleteTags = "DeleteTags" -// DescribeLabelingJobRequest generates a "aws/request.Request" representing the -// client's request for the DescribeLabelingJob operation. The "output" return +// DeleteTagsRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTags operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeLabelingJob for more information on using the DescribeLabelingJob +// See DeleteTags for more information on using the DeleteTags // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeLabelingJobRequest method. -// req, resp := client.DescribeLabelingJobRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeLabelingJob -func (c *SageMaker) DescribeLabelingJobRequest(input *DescribeLabelingJobInput) (req *request.Request, output *DescribeLabelingJobOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteTags +func (c *SageMaker) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Request, output *DeleteTagsOutput) { op := &request.Operation{ - Name: opDescribeLabelingJob, + Name: opDeleteTags, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeLabelingJobInput{} + input = &DeleteTagsInput{} } - output = &DescribeLabelingJobOutput{} + output = &DeleteTagsOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DescribeLabelingJob API operation for Amazon SageMaker Service. +// DeleteTags API operation for Amazon SageMaker Service. // -// Gets information about a labeling job. +// Deletes the specified tags from an Amazon SageMaker resource. +// +// To list a resource's tags, use the ListTags API. +// +// When you call this API to delete tags from a hyperparameter tuning job, the +// deleted tags are not removed from training jobs that the hyperparameter tuning +// job launched before you called 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 Amazon SageMaker Service's -// API operation DescribeLabelingJob for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFound "ResourceNotFound" -// Resource being access is not found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeLabelingJob -func (c *SageMaker) DescribeLabelingJob(input *DescribeLabelingJobInput) (*DescribeLabelingJobOutput, error) { - req, out := c.DescribeLabelingJobRequest(input) +// API operation DeleteTags for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteTags +func (c *SageMaker) DeleteTags(input *DeleteTagsInput) (*DeleteTagsOutput, error) { + req, out := c.DeleteTagsRequest(input) return out, req.Send() } -// DescribeLabelingJobWithContext is the same as DescribeLabelingJob with the addition of +// DeleteTagsWithContext is the same as DeleteTags with the addition of // the ability to pass a context and additional request options. // -// See DescribeLabelingJob for details on how to use this API operation. +// See DeleteTags for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DescribeLabelingJobWithContext(ctx aws.Context, input *DescribeLabelingJobInput, opts ...request.Option) (*DescribeLabelingJobOutput, error) { - req, out := c.DescribeLabelingJobRequest(input) +func (c *SageMaker) DeleteTagsWithContext(ctx aws.Context, input *DeleteTagsInput, opts ...request.Option) (*DeleteTagsOutput, error) { + req, out := c.DeleteTagsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeModel = "DescribeModel" +const opDeleteTrial = "DeleteTrial" -// DescribeModelRequest generates a "aws/request.Request" representing the -// client's request for the DescribeModel operation. The "output" return +// DeleteTrialRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTrial operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeModel for more information on using the DescribeModel +// See DeleteTrial for more information on using the DeleteTrial // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeModelRequest method. -// req, resp := client.DescribeModelRequest(params) +// // Example sending a request using the DeleteTrialRequest method. +// req, resp := client.DeleteTrialRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeModel -func (c *SageMaker) DescribeModelRequest(input *DescribeModelInput) (req *request.Request, output *DescribeModelOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteTrial +func (c *SageMaker) DeleteTrialRequest(input *DeleteTrialInput) (req *request.Request, output *DeleteTrialOutput) { op := &request.Operation{ - Name: opDescribeModel, + Name: opDeleteTrial, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeModelInput{} + input = &DeleteTrialInput{} } - output = &DescribeModelOutput{} + output = &DeleteTrialOutput{} req = c.newRequest(op, input, output) return } -// DescribeModel API operation for Amazon SageMaker Service. +// DeleteTrial API operation for Amazon SageMaker Service. // -// Describes a model that you created using the CreateModel API. +// Deletes the specified trial. All trial components that make up the trial +// must be deleted first. Use the DescribeTrialComponent API to get the list +// of trial components. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation DescribeModel for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeModel -func (c *SageMaker) DescribeModel(input *DescribeModelInput) (*DescribeModelOutput, error) { - req, out := c.DescribeModelRequest(input) +// API operation DeleteTrial for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteTrial +func (c *SageMaker) DeleteTrial(input *DeleteTrialInput) (*DeleteTrialOutput, error) { + req, out := c.DeleteTrialRequest(input) return out, req.Send() } -// DescribeModelWithContext is the same as DescribeModel with the addition of +// DeleteTrialWithContext is the same as DeleteTrial with the addition of // the ability to pass a context and additional request options. // -// See DescribeModel for details on how to use this API operation. +// See DeleteTrial for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DescribeModelWithContext(ctx aws.Context, input *DescribeModelInput, opts ...request.Option) (*DescribeModelOutput, error) { - req, out := c.DescribeModelRequest(input) +func (c *SageMaker) DeleteTrialWithContext(ctx aws.Context, input *DeleteTrialInput, opts ...request.Option) (*DeleteTrialOutput, error) { + req, out := c.DeleteTrialRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeModelPackage = "DescribeModelPackage" +const opDeleteTrialComponent = "DeleteTrialComponent" -// DescribeModelPackageRequest generates a "aws/request.Request" representing the -// client's request for the DescribeModelPackage operation. The "output" return +// DeleteTrialComponentRequest generates a "aws/request.Request" representing the +// client's request for the DeleteTrialComponent operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeModelPackage for more information on using the DescribeModelPackage +// See DeleteTrialComponent for more information on using the DeleteTrialComponent // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeModelPackageRequest method. -// req, resp := client.DescribeModelPackageRequest(params) +// // Example sending a request using the DeleteTrialComponentRequest method. +// req, resp := client.DeleteTrialComponentRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeModelPackage -func (c *SageMaker) DescribeModelPackageRequest(input *DescribeModelPackageInput) (req *request.Request, output *DescribeModelPackageOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteTrialComponent +func (c *SageMaker) DeleteTrialComponentRequest(input *DeleteTrialComponentInput) (req *request.Request, output *DeleteTrialComponentOutput) { op := &request.Operation{ - Name: opDescribeModelPackage, + Name: opDeleteTrialComponent, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeModelPackageInput{} + input = &DeleteTrialComponentInput{} } - output = &DescribeModelPackageOutput{} + output = &DeleteTrialComponentOutput{} req = c.newRequest(op, input, output) return } -// DescribeModelPackage API operation for Amazon SageMaker Service. +// DeleteTrialComponent API operation for Amazon SageMaker Service. // -// Returns a description of the specified model package, which is used to create -// Amazon SageMaker models or list them on AWS Marketplace. -// -// To create models in Amazon SageMaker, buyers can subscribe to model packages -// listed on AWS Marketplace. +// Deletes the specified trial component. A trial component must be disassociated +// from all trials before the trial component can be deleted. To disassociate +// a trial component from a trial, call the DisassociateTrialComponent 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 SageMaker Service's -// API operation DescribeModelPackage for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeModelPackage -func (c *SageMaker) DescribeModelPackage(input *DescribeModelPackageInput) (*DescribeModelPackageOutput, error) { - req, out := c.DescribeModelPackageRequest(input) +// API operation DeleteTrialComponent for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteTrialComponent +func (c *SageMaker) DeleteTrialComponent(input *DeleteTrialComponentInput) (*DeleteTrialComponentOutput, error) { + req, out := c.DeleteTrialComponentRequest(input) return out, req.Send() } -// DescribeModelPackageWithContext is the same as DescribeModelPackage with the addition of +// DeleteTrialComponentWithContext is the same as DeleteTrialComponent with the addition of // the ability to pass a context and additional request options. // -// See DescribeModelPackage for details on how to use this API operation. +// See DeleteTrialComponent for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DescribeModelPackageWithContext(ctx aws.Context, input *DescribeModelPackageInput, opts ...request.Option) (*DescribeModelPackageOutput, error) { - req, out := c.DescribeModelPackageRequest(input) +func (c *SageMaker) DeleteTrialComponentWithContext(ctx aws.Context, input *DeleteTrialComponentInput, opts ...request.Option) (*DeleteTrialComponentOutput, error) { + req, out := c.DeleteTrialComponentRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeNotebookInstance = "DescribeNotebookInstance" +const opDeleteUserProfile = "DeleteUserProfile" -// DescribeNotebookInstanceRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNotebookInstance operation. The "output" return +// DeleteUserProfileRequest generates a "aws/request.Request" representing the +// client's request for the DeleteUserProfile operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeNotebookInstance for more information on using the DescribeNotebookInstance +// See DeleteUserProfile for more information on using the DeleteUserProfile // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeNotebookInstanceRequest method. -// req, resp := client.DescribeNotebookInstanceRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeNotebookInstance -func (c *SageMaker) DescribeNotebookInstanceRequest(input *DescribeNotebookInstanceInput) (req *request.Request, output *DescribeNotebookInstanceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteUserProfile +func (c *SageMaker) DeleteUserProfileRequest(input *DeleteUserProfileInput) (req *request.Request, output *DeleteUserProfileOutput) { op := &request.Operation{ - Name: opDescribeNotebookInstance, + Name: opDeleteUserProfile, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeNotebookInstanceInput{} + input = &DeleteUserProfileInput{} } - output = &DescribeNotebookInstanceOutput{} + output = &DeleteUserProfileOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// DescribeNotebookInstance API operation for Amazon SageMaker Service. +// DeleteUserProfile API operation for Amazon SageMaker Service. // -// Returns information about a notebook instance. +// Deletes a user profile. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation DescribeNotebookInstance for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeNotebookInstance -func (c *SageMaker) DescribeNotebookInstance(input *DescribeNotebookInstanceInput) (*DescribeNotebookInstanceOutput, error) { - req, out := c.DescribeNotebookInstanceRequest(input) +// API operation DeleteUserProfile for usage and error information. +// +// Returned Error Types: +// * ResourceInUse +// Resource being accessed is in use. +// +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteUserProfile +func (c *SageMaker) DeleteUserProfile(input *DeleteUserProfileInput) (*DeleteUserProfileOutput, error) { + req, out := c.DeleteUserProfileRequest(input) return out, req.Send() } -// DescribeNotebookInstanceWithContext is the same as DescribeNotebookInstance with the addition of +// DeleteUserProfileWithContext is the same as DeleteUserProfile with the addition of // the ability to pass a context and additional request options. // -// See DescribeNotebookInstance for details on how to use this API operation. +// See DeleteUserProfile for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DescribeNotebookInstanceWithContext(ctx aws.Context, input *DescribeNotebookInstanceInput, opts ...request.Option) (*DescribeNotebookInstanceOutput, error) { - req, out := c.DescribeNotebookInstanceRequest(input) +func (c *SageMaker) DeleteUserProfileWithContext(ctx aws.Context, input *DeleteUserProfileInput, opts ...request.Option) (*DeleteUserProfileOutput, error) { + req, out := c.DeleteUserProfileRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeNotebookInstanceLifecycleConfig = "DescribeNotebookInstanceLifecycleConfig" +const opDeleteWorkteam = "DeleteWorkteam" -// DescribeNotebookInstanceLifecycleConfigRequest generates a "aws/request.Request" representing the -// client's request for the DescribeNotebookInstanceLifecycleConfig operation. The "output" return +// DeleteWorkteamRequest generates a "aws/request.Request" representing the +// client's request for the DeleteWorkteam operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeNotebookInstanceLifecycleConfig for more information on using the DescribeNotebookInstanceLifecycleConfig +// See DeleteWorkteam for more information on using the DeleteWorkteam // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeNotebookInstanceLifecycleConfigRequest method. -// req, resp := client.DescribeNotebookInstanceLifecycleConfigRequest(params) +// // Example sending a request using the DeleteWorkteamRequest method. +// req, resp := client.DeleteWorkteamRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeNotebookInstanceLifecycleConfig -func (c *SageMaker) DescribeNotebookInstanceLifecycleConfigRequest(input *DescribeNotebookInstanceLifecycleConfigInput) (req *request.Request, output *DescribeNotebookInstanceLifecycleConfigOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteWorkteam +func (c *SageMaker) DeleteWorkteamRequest(input *DeleteWorkteamInput) (req *request.Request, output *DeleteWorkteamOutput) { op := &request.Operation{ - Name: opDescribeNotebookInstanceLifecycleConfig, + Name: opDeleteWorkteam, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeNotebookInstanceLifecycleConfigInput{} + input = &DeleteWorkteamInput{} } - output = &DescribeNotebookInstanceLifecycleConfigOutput{} + output = &DeleteWorkteamOutput{} req = c.newRequest(op, input, output) return } -// DescribeNotebookInstanceLifecycleConfig API operation for Amazon SageMaker Service. -// -// Returns a description of a notebook instance lifecycle configuration. +// DeleteWorkteam API operation for Amazon SageMaker Service. // -// For information about notebook instance lifestyle configurations, see Step -// 2.1: (Optional) Customize a Notebook Instance (https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html). +// Deletes an existing work team. This operation can't be undone. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation DescribeNotebookInstanceLifecycleConfig for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeNotebookInstanceLifecycleConfig -func (c *SageMaker) DescribeNotebookInstanceLifecycleConfig(input *DescribeNotebookInstanceLifecycleConfigInput) (*DescribeNotebookInstanceLifecycleConfigOutput, error) { - req, out := c.DescribeNotebookInstanceLifecycleConfigRequest(input) +// API operation DeleteWorkteam for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DeleteWorkteam +func (c *SageMaker) DeleteWorkteam(input *DeleteWorkteamInput) (*DeleteWorkteamOutput, error) { + req, out := c.DeleteWorkteamRequest(input) return out, req.Send() } -// DescribeNotebookInstanceLifecycleConfigWithContext is the same as DescribeNotebookInstanceLifecycleConfig with the addition of +// DeleteWorkteamWithContext is the same as DeleteWorkteam with the addition of // the ability to pass a context and additional request options. // -// See DescribeNotebookInstanceLifecycleConfig for details on how to use this API operation. +// See DeleteWorkteam for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DescribeNotebookInstanceLifecycleConfigWithContext(ctx aws.Context, input *DescribeNotebookInstanceLifecycleConfigInput, opts ...request.Option) (*DescribeNotebookInstanceLifecycleConfigOutput, error) { - req, out := c.DescribeNotebookInstanceLifecycleConfigRequest(input) +func (c *SageMaker) DeleteWorkteamWithContext(ctx aws.Context, input *DeleteWorkteamInput, opts ...request.Option) (*DeleteWorkteamOutput, error) { + req, out := c.DeleteWorkteamRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeSubscribedWorkteam = "DescribeSubscribedWorkteam" +const opDescribeAlgorithm = "DescribeAlgorithm" -// DescribeSubscribedWorkteamRequest generates a "aws/request.Request" representing the -// client's request for the DescribeSubscribedWorkteam operation. The "output" return +// DescribeAlgorithmRequest generates a "aws/request.Request" representing the +// client's request for the DescribeAlgorithm operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeSubscribedWorkteam for more information on using the DescribeSubscribedWorkteam +// See DescribeAlgorithm for more information on using the DescribeAlgorithm // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeSubscribedWorkteamRequest method. -// req, resp := client.DescribeSubscribedWorkteamRequest(params) +// // Example sending a request using the DescribeAlgorithmRequest method. +// req, resp := client.DescribeAlgorithmRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeSubscribedWorkteam -func (c *SageMaker) DescribeSubscribedWorkteamRequest(input *DescribeSubscribedWorkteamInput) (req *request.Request, output *DescribeSubscribedWorkteamOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeAlgorithm +func (c *SageMaker) DescribeAlgorithmRequest(input *DescribeAlgorithmInput) (req *request.Request, output *DescribeAlgorithmOutput) { op := &request.Operation{ - Name: opDescribeSubscribedWorkteam, + Name: opDescribeAlgorithm, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeSubscribedWorkteamInput{} + input = &DescribeAlgorithmInput{} } - output = &DescribeSubscribedWorkteamOutput{} + output = &DescribeAlgorithmOutput{} req = c.newRequest(op, input, output) return } -// DescribeSubscribedWorkteam API operation for Amazon SageMaker Service. +// DescribeAlgorithm API operation for Amazon SageMaker Service. // -// Gets information about a work team provided by a vendor. It returns details -// about the subscription with a vendor in the AWS Marketplace. +// Returns a description of the specified algorithm that is 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 SageMaker Service's -// API operation DescribeSubscribedWorkteam for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeSubscribedWorkteam -func (c *SageMaker) DescribeSubscribedWorkteam(input *DescribeSubscribedWorkteamInput) (*DescribeSubscribedWorkteamOutput, error) { - req, out := c.DescribeSubscribedWorkteamRequest(input) +// API operation DescribeAlgorithm for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeAlgorithm +func (c *SageMaker) DescribeAlgorithm(input *DescribeAlgorithmInput) (*DescribeAlgorithmOutput, error) { + req, out := c.DescribeAlgorithmRequest(input) return out, req.Send() } -// DescribeSubscribedWorkteamWithContext is the same as DescribeSubscribedWorkteam with the addition of +// DescribeAlgorithmWithContext is the same as DescribeAlgorithm with the addition of // the ability to pass a context and additional request options. // -// See DescribeSubscribedWorkteam for details on how to use this API operation. +// See DescribeAlgorithm for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DescribeSubscribedWorkteamWithContext(ctx aws.Context, input *DescribeSubscribedWorkteamInput, opts ...request.Option) (*DescribeSubscribedWorkteamOutput, error) { - req, out := c.DescribeSubscribedWorkteamRequest(input) +func (c *SageMaker) DescribeAlgorithmWithContext(ctx aws.Context, input *DescribeAlgorithmInput, opts ...request.Option) (*DescribeAlgorithmOutput, error) { + req, out := c.DescribeAlgorithmRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeTrainingJob = "DescribeTrainingJob" +const opDescribeApp = "DescribeApp" -// DescribeTrainingJobRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTrainingJob operation. The "output" return +// DescribeAppRequest generates a "aws/request.Request" representing the +// client's request for the DescribeApp operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeTrainingJob for more information on using the DescribeTrainingJob +// See DescribeApp for more information on using the DescribeApp // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeTrainingJobRequest method. -// req, resp := client.DescribeTrainingJobRequest(params) +// // Example sending a request using the DescribeAppRequest method. +// req, resp := client.DescribeAppRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeTrainingJob -func (c *SageMaker) DescribeTrainingJobRequest(input *DescribeTrainingJobInput) (req *request.Request, output *DescribeTrainingJobOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeApp +func (c *SageMaker) DescribeAppRequest(input *DescribeAppInput) (req *request.Request, output *DescribeAppOutput) { op := &request.Operation{ - Name: opDescribeTrainingJob, + Name: opDescribeApp, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeTrainingJobInput{} + input = &DescribeAppInput{} } - output = &DescribeTrainingJobOutput{} + output = &DescribeAppOutput{} req = c.newRequest(op, input, output) return } -// DescribeTrainingJob API operation for Amazon SageMaker Service. +// DescribeApp API operation for Amazon SageMaker Service. // -// Returns information about a training job. +// Describes the app. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation DescribeTrainingJob for usage and error information. +// API operation DescribeApp for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFound "ResourceNotFound" +// Returned Error Types: +// * ResourceNotFound // Resource being access is not found. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeTrainingJob -func (c *SageMaker) DescribeTrainingJob(input *DescribeTrainingJobInput) (*DescribeTrainingJobOutput, error) { - req, out := c.DescribeTrainingJobRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeApp +func (c *SageMaker) DescribeApp(input *DescribeAppInput) (*DescribeAppOutput, error) { + req, out := c.DescribeAppRequest(input) return out, req.Send() } -// DescribeTrainingJobWithContext is the same as DescribeTrainingJob with the addition of +// DescribeAppWithContext is the same as DescribeApp with the addition of // the ability to pass a context and additional request options. // -// See DescribeTrainingJob for details on how to use this API operation. +// See DescribeApp for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DescribeTrainingJobWithContext(ctx aws.Context, input *DescribeTrainingJobInput, opts ...request.Option) (*DescribeTrainingJobOutput, error) { - req, out := c.DescribeTrainingJobRequest(input) +func (c *SageMaker) DescribeAppWithContext(ctx aws.Context, input *DescribeAppInput, opts ...request.Option) (*DescribeAppOutput, error) { + req, out := c.DescribeAppRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeTransformJob = "DescribeTransformJob" +const opDescribeAutoMLJob = "DescribeAutoMLJob" -// DescribeTransformJobRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTransformJob operation. The "output" return +// DescribeAutoMLJobRequest generates a "aws/request.Request" representing the +// client's request for the DescribeAutoMLJob operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeTransformJob for more information on using the DescribeTransformJob +// See DescribeAutoMLJob for more information on using the DescribeAutoMLJob // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeTransformJobRequest method. -// req, resp := client.DescribeTransformJobRequest(params) +// // Example sending a request using the DescribeAutoMLJobRequest method. +// req, resp := client.DescribeAutoMLJobRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeTransformJob -func (c *SageMaker) DescribeTransformJobRequest(input *DescribeTransformJobInput) (req *request.Request, output *DescribeTransformJobOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeAutoMLJob +func (c *SageMaker) DescribeAutoMLJobRequest(input *DescribeAutoMLJobInput) (req *request.Request, output *DescribeAutoMLJobOutput) { op := &request.Operation{ - Name: opDescribeTransformJob, + Name: opDescribeAutoMLJob, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeTransformJobInput{} + input = &DescribeAutoMLJobInput{} } - output = &DescribeTransformJobOutput{} + output = &DescribeAutoMLJobOutput{} req = c.newRequest(op, input, output) return } -// DescribeTransformJob API operation for Amazon SageMaker Service. +// DescribeAutoMLJob API operation for Amazon SageMaker Service. // -// Returns information about a transform job. +// Returns information about an Amazon SageMaker 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 SageMaker Service's -// API operation DescribeTransformJob for usage and error information. +// API operation DescribeAutoMLJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFound "ResourceNotFound" +// Returned Error Types: +// * ResourceNotFound // Resource being access is not found. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeTransformJob -func (c *SageMaker) DescribeTransformJob(input *DescribeTransformJobInput) (*DescribeTransformJobOutput, error) { - req, out := c.DescribeTransformJobRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeAutoMLJob +func (c *SageMaker) DescribeAutoMLJob(input *DescribeAutoMLJobInput) (*DescribeAutoMLJobOutput, error) { + req, out := c.DescribeAutoMLJobRequest(input) return out, req.Send() } -// DescribeTransformJobWithContext is the same as DescribeTransformJob with the addition of +// DescribeAutoMLJobWithContext is the same as DescribeAutoMLJob with the addition of // the ability to pass a context and additional request options. // -// See DescribeTransformJob for details on how to use this API operation. +// See DescribeAutoMLJob for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DescribeTransformJobWithContext(ctx aws.Context, input *DescribeTransformJobInput, opts ...request.Option) (*DescribeTransformJobOutput, error) { - req, out := c.DescribeTransformJobRequest(input) +func (c *SageMaker) DescribeAutoMLJobWithContext(ctx aws.Context, input *DescribeAutoMLJobInput, opts ...request.Option) (*DescribeAutoMLJobOutput, error) { + req, out := c.DescribeAutoMLJobRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opDescribeWorkteam = "DescribeWorkteam" +const opDescribeCodeRepository = "DescribeCodeRepository" -// DescribeWorkteamRequest generates a "aws/request.Request" representing the -// client's request for the DescribeWorkteam operation. The "output" return +// DescribeCodeRepositoryRequest generates a "aws/request.Request" representing the +// client's request for the DescribeCodeRepository operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See DescribeWorkteam for more information on using the DescribeWorkteam +// See DescribeCodeRepository for more information on using the DescribeCodeRepository // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the DescribeWorkteamRequest method. -// req, resp := client.DescribeWorkteamRequest(params) +// // Example sending a request using the DescribeCodeRepositoryRequest method. +// req, resp := client.DescribeCodeRepositoryRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeWorkteam -func (c *SageMaker) DescribeWorkteamRequest(input *DescribeWorkteamInput) (req *request.Request, output *DescribeWorkteamOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeCodeRepository +func (c *SageMaker) DescribeCodeRepositoryRequest(input *DescribeCodeRepositoryInput) (req *request.Request, output *DescribeCodeRepositoryOutput) { op := &request.Operation{ - Name: opDescribeWorkteam, + Name: opDescribeCodeRepository, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &DescribeWorkteamInput{} + input = &DescribeCodeRepositoryInput{} } - output = &DescribeWorkteamOutput{} + output = &DescribeCodeRepositoryOutput{} req = c.newRequest(op, input, output) return } -// DescribeWorkteam API operation for Amazon SageMaker Service. +// DescribeCodeRepository API operation for Amazon SageMaker Service. // -// Gets information about a specific work team. You can see information such -// as the create date, the last updated date, membership information, and the -// work team's Amazon Resource Name (ARN). +// Gets details about the specified Git 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 SageMaker Service's -// API operation DescribeWorkteam for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeWorkteam -func (c *SageMaker) DescribeWorkteam(input *DescribeWorkteamInput) (*DescribeWorkteamOutput, error) { - req, out := c.DescribeWorkteamRequest(input) +// API operation DescribeCodeRepository for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeCodeRepository +func (c *SageMaker) DescribeCodeRepository(input *DescribeCodeRepositoryInput) (*DescribeCodeRepositoryOutput, error) { + req, out := c.DescribeCodeRepositoryRequest(input) return out, req.Send() } -// DescribeWorkteamWithContext is the same as DescribeWorkteam with the addition of +// DescribeCodeRepositoryWithContext is the same as DescribeCodeRepository with the addition of // the ability to pass a context and additional request options. // -// See DescribeWorkteam for details on how to use this API operation. +// See DescribeCodeRepository for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) DescribeWorkteamWithContext(ctx aws.Context, input *DescribeWorkteamInput, opts ...request.Option) (*DescribeWorkteamOutput, error) { - req, out := c.DescribeWorkteamRequest(input) +func (c *SageMaker) DescribeCodeRepositoryWithContext(ctx aws.Context, input *DescribeCodeRepositoryInput, opts ...request.Option) (*DescribeCodeRepositoryOutput, error) { + req, out := c.DescribeCodeRepositoryRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opGetSearchSuggestions = "GetSearchSuggestions" +const opDescribeCompilationJob = "DescribeCompilationJob" -// GetSearchSuggestionsRequest generates a "aws/request.Request" representing the -// client's request for the GetSearchSuggestions operation. The "output" return +// DescribeCompilationJobRequest generates a "aws/request.Request" representing the +// client's request for the DescribeCompilationJob operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See GetSearchSuggestions for more information on using the GetSearchSuggestions +// See DescribeCompilationJob for more information on using the DescribeCompilationJob // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the GetSearchSuggestionsRequest method. -// req, resp := client.GetSearchSuggestionsRequest(params) +// // Example sending a request using the DescribeCompilationJobRequest method. +// req, resp := client.DescribeCompilationJobRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/GetSearchSuggestions -func (c *SageMaker) GetSearchSuggestionsRequest(input *GetSearchSuggestionsInput) (req *request.Request, output *GetSearchSuggestionsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeCompilationJob +func (c *SageMaker) DescribeCompilationJobRequest(input *DescribeCompilationJobInput) (req *request.Request, output *DescribeCompilationJobOutput) { op := &request.Operation{ - Name: opGetSearchSuggestions, + Name: opDescribeCompilationJob, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &GetSearchSuggestionsInput{} + input = &DescribeCompilationJobInput{} } - output = &GetSearchSuggestionsOutput{} + output = &DescribeCompilationJobOutput{} req = c.newRequest(op, input, output) return } -// GetSearchSuggestions API operation for Amazon SageMaker Service. +// DescribeCompilationJob API operation for Amazon SageMaker Service. // -// An auto-complete API for the search functionality in the Amazon SageMaker -// console. It returns suggestions of possible matches for the property name -// to use in Search queries. Provides suggestions for HyperParameters, Tags, -// and Metrics. +// Returns information about a model compilation job. +// +// To create a model compilation job, use CreateCompilationJob. To get information +// about multiple model compilation jobs, use ListCompilationJobs. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation GetSearchSuggestions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/GetSearchSuggestions -func (c *SageMaker) GetSearchSuggestions(input *GetSearchSuggestionsInput) (*GetSearchSuggestionsOutput, error) { - req, out := c.GetSearchSuggestionsRequest(input) +// API operation DescribeCompilationJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeCompilationJob +func (c *SageMaker) DescribeCompilationJob(input *DescribeCompilationJobInput) (*DescribeCompilationJobOutput, error) { + req, out := c.DescribeCompilationJobRequest(input) return out, req.Send() } -// GetSearchSuggestionsWithContext is the same as GetSearchSuggestions with the addition of +// DescribeCompilationJobWithContext is the same as DescribeCompilationJob with the addition of // the ability to pass a context and additional request options. // -// See GetSearchSuggestions for details on how to use this API operation. +// See DescribeCompilationJob for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) GetSearchSuggestionsWithContext(ctx aws.Context, input *GetSearchSuggestionsInput, opts ...request.Option) (*GetSearchSuggestionsOutput, error) { - req, out := c.GetSearchSuggestionsRequest(input) +func (c *SageMaker) DescribeCompilationJobWithContext(ctx aws.Context, input *DescribeCompilationJobInput, opts ...request.Option) (*DescribeCompilationJobOutput, error) { + req, out := c.DescribeCompilationJobRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListAlgorithms = "ListAlgorithms" +const opDescribeDomain = "DescribeDomain" -// ListAlgorithmsRequest generates a "aws/request.Request" representing the -// client's request for the ListAlgorithms operation. The "output" return +// DescribeDomainRequest generates a "aws/request.Request" representing the +// client's request for the DescribeDomain operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListAlgorithms for more information on using the ListAlgorithms +// See DescribeDomain for more information on using the DescribeDomain // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListAlgorithmsRequest method. -// req, resp := client.ListAlgorithmsRequest(params) +// // Example sending a request using the DescribeDomainRequest method. +// req, resp := client.DescribeDomainRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListAlgorithms -func (c *SageMaker) ListAlgorithmsRequest(input *ListAlgorithmsInput) (req *request.Request, output *ListAlgorithmsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeDomain +func (c *SageMaker) DescribeDomainRequest(input *DescribeDomainInput) (req *request.Request, output *DescribeDomainOutput) { op := &request.Operation{ - Name: opListAlgorithms, + Name: opDescribeDomain, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ListAlgorithmsInput{} + input = &DescribeDomainInput{} } - output = &ListAlgorithmsOutput{} + output = &DescribeDomainOutput{} req = c.newRequest(op, input, output) return } -// ListAlgorithms API operation for Amazon SageMaker Service. +// DescribeDomain API operation for Amazon SageMaker Service. // -// Lists the machine learning algorithms that have been created. +// The desciption of the 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 SageMaker Service's -// API operation ListAlgorithms for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListAlgorithms -func (c *SageMaker) ListAlgorithms(input *ListAlgorithmsInput) (*ListAlgorithmsOutput, error) { - req, out := c.ListAlgorithmsRequest(input) +// API operation DescribeDomain for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeDomain +func (c *SageMaker) DescribeDomain(input *DescribeDomainInput) (*DescribeDomainOutput, error) { + req, out := c.DescribeDomainRequest(input) return out, req.Send() } -// ListAlgorithmsWithContext is the same as ListAlgorithms with the addition of +// DescribeDomainWithContext is the same as DescribeDomain with the addition of // the ability to pass a context and additional request options. // -// See ListAlgorithms for details on how to use this API operation. +// See DescribeDomain for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListAlgorithmsWithContext(ctx aws.Context, input *ListAlgorithmsInput, opts ...request.Option) (*ListAlgorithmsOutput, error) { - req, out := c.ListAlgorithmsRequest(input) +func (c *SageMaker) DescribeDomainWithContext(ctx aws.Context, input *DescribeDomainInput, opts ...request.Option) (*DescribeDomainOutput, error) { + req, out := c.DescribeDomainRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListCodeRepositories = "ListCodeRepositories" +const opDescribeEndpoint = "DescribeEndpoint" -// ListCodeRepositoriesRequest generates a "aws/request.Request" representing the -// client's request for the ListCodeRepositories operation. The "output" return +// DescribeEndpointRequest generates a "aws/request.Request" representing the +// client's request for the DescribeEndpoint operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListCodeRepositories for more information on using the ListCodeRepositories +// See DescribeEndpoint for more information on using the DescribeEndpoint // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListCodeRepositoriesRequest method. -// req, resp := client.ListCodeRepositoriesRequest(params) +// // Example sending a request using the DescribeEndpointRequest method. +// req, resp := client.DescribeEndpointRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListCodeRepositories -func (c *SageMaker) ListCodeRepositoriesRequest(input *ListCodeRepositoriesInput) (req *request.Request, output *ListCodeRepositoriesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeEndpoint +func (c *SageMaker) DescribeEndpointRequest(input *DescribeEndpointInput) (req *request.Request, output *DescribeEndpointOutput) { op := &request.Operation{ - Name: opListCodeRepositories, + Name: opDescribeEndpoint, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ListCodeRepositoriesInput{} + input = &DescribeEndpointInput{} } - output = &ListCodeRepositoriesOutput{} + output = &DescribeEndpointOutput{} req = c.newRequest(op, input, output) return } -// ListCodeRepositories API operation for Amazon SageMaker Service. +// DescribeEndpoint API operation for Amazon SageMaker Service. // -// Gets a list of the Git repositories in your account. +// Returns the description of 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 Amazon SageMaker Service's -// API operation ListCodeRepositories for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListCodeRepositories -func (c *SageMaker) ListCodeRepositories(input *ListCodeRepositoriesInput) (*ListCodeRepositoriesOutput, error) { - req, out := c.ListCodeRepositoriesRequest(input) +// API operation DescribeEndpoint for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeEndpoint +func (c *SageMaker) DescribeEndpoint(input *DescribeEndpointInput) (*DescribeEndpointOutput, error) { + req, out := c.DescribeEndpointRequest(input) return out, req.Send() } -// ListCodeRepositoriesWithContext is the same as ListCodeRepositories with the addition of +// DescribeEndpointWithContext is the same as DescribeEndpoint with the addition of // the ability to pass a context and additional request options. // -// See ListCodeRepositories for details on how to use this API operation. +// See DescribeEndpoint for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListCodeRepositoriesWithContext(ctx aws.Context, input *ListCodeRepositoriesInput, opts ...request.Option) (*ListCodeRepositoriesOutput, error) { - req, out := c.ListCodeRepositoriesRequest(input) +func (c *SageMaker) DescribeEndpointWithContext(ctx aws.Context, input *DescribeEndpointInput, opts ...request.Option) (*DescribeEndpointOutput, error) { + req, out := c.DescribeEndpointRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListCompilationJobs = "ListCompilationJobs" +const opDescribeEndpointConfig = "DescribeEndpointConfig" -// ListCompilationJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListCompilationJobs operation. The "output" return +// DescribeEndpointConfigRequest generates a "aws/request.Request" representing the +// client's request for the DescribeEndpointConfig operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListCompilationJobs for more information on using the ListCompilationJobs +// See DescribeEndpointConfig for more information on using the DescribeEndpointConfig // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListCompilationJobsRequest method. -// req, resp := client.ListCompilationJobsRequest(params) +// // Example sending a request using the DescribeEndpointConfigRequest method. +// req, resp := client.DescribeEndpointConfigRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListCompilationJobs -func (c *SageMaker) ListCompilationJobsRequest(input *ListCompilationJobsInput) (req *request.Request, output *ListCompilationJobsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeEndpointConfig +func (c *SageMaker) DescribeEndpointConfigRequest(input *DescribeEndpointConfigInput) (req *request.Request, output *DescribeEndpointConfigOutput) { op := &request.Operation{ - Name: opListCompilationJobs, + Name: opDescribeEndpointConfig, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListCompilationJobsInput{} + input = &DescribeEndpointConfigInput{} } - output = &ListCompilationJobsOutput{} + output = &DescribeEndpointConfigOutput{} req = c.newRequest(op, input, output) return } -// ListCompilationJobs API operation for Amazon SageMaker Service. -// -// Lists model compilation jobs that satisfy various filters. +// DescribeEndpointConfig API operation for Amazon SageMaker Service. // -// To create a model compilation job, use CreateCompilationJob. To get information -// about a particular model compilation job you have created, use DescribeCompilationJob. +// Returns the description of an endpoint configuration created using the CreateEndpointConfig +// 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 SageMaker Service's -// API operation ListCompilationJobs for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListCompilationJobs -func (c *SageMaker) ListCompilationJobs(input *ListCompilationJobsInput) (*ListCompilationJobsOutput, error) { - req, out := c.ListCompilationJobsRequest(input) +// API operation DescribeEndpointConfig for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeEndpointConfig +func (c *SageMaker) DescribeEndpointConfig(input *DescribeEndpointConfigInput) (*DescribeEndpointConfigOutput, error) { + req, out := c.DescribeEndpointConfigRequest(input) return out, req.Send() } -// ListCompilationJobsWithContext is the same as ListCompilationJobs with the addition of +// DescribeEndpointConfigWithContext is the same as DescribeEndpointConfig with the addition of // the ability to pass a context and additional request options. // -// See ListCompilationJobs for details on how to use this API operation. +// See DescribeEndpointConfig for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListCompilationJobsWithContext(ctx aws.Context, input *ListCompilationJobsInput, opts ...request.Option) (*ListCompilationJobsOutput, error) { - req, out := c.ListCompilationJobsRequest(input) +func (c *SageMaker) DescribeEndpointConfigWithContext(ctx aws.Context, input *DescribeEndpointConfigInput, opts ...request.Option) (*DescribeEndpointConfigOutput, error) { + req, out := c.DescribeEndpointConfigRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListCompilationJobsPages iterates over the pages of a ListCompilationJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCompilationJobs 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 ListCompilationJobs operation. -// pageNum := 0 -// err := client.ListCompilationJobsPages(params, -// func(page *sagemaker.ListCompilationJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListCompilationJobsPages(input *ListCompilationJobsInput, fn func(*ListCompilationJobsOutput, bool) bool) error { - return c.ListCompilationJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCompilationJobsPagesWithContext same as ListCompilationJobsPages 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 *SageMaker) ListCompilationJobsPagesWithContext(ctx aws.Context, input *ListCompilationJobsInput, fn func(*ListCompilationJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListCompilationJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListCompilationJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCompilationJobsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListEndpointConfigs = "ListEndpointConfigs" +const opDescribeExperiment = "DescribeExperiment" -// ListEndpointConfigsRequest generates a "aws/request.Request" representing the -// client's request for the ListEndpointConfigs operation. The "output" return +// DescribeExperimentRequest generates a "aws/request.Request" representing the +// client's request for the DescribeExperiment operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListEndpointConfigs for more information on using the ListEndpointConfigs +// See DescribeExperiment for more information on using the DescribeExperiment // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListEndpointConfigsRequest method. -// req, resp := client.ListEndpointConfigsRequest(params) +// // Example sending a request using the DescribeExperimentRequest method. +// req, resp := client.DescribeExperimentRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListEndpointConfigs -func (c *SageMaker) ListEndpointConfigsRequest(input *ListEndpointConfigsInput) (req *request.Request, output *ListEndpointConfigsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeExperiment +func (c *SageMaker) DescribeExperimentRequest(input *DescribeExperimentInput) (req *request.Request, output *DescribeExperimentOutput) { op := &request.Operation{ - Name: opListEndpointConfigs, + Name: opDescribeExperiment, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListEndpointConfigsInput{} + input = &DescribeExperimentInput{} } - output = &ListEndpointConfigsOutput{} + output = &DescribeExperimentOutput{} req = c.newRequest(op, input, output) return } -// ListEndpointConfigs API operation for Amazon SageMaker Service. +// DescribeExperiment API operation for Amazon SageMaker Service. // -// Lists endpoint configurations. +// Provides a list of an experiment's properties. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation ListEndpointConfigs for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListEndpointConfigs -func (c *SageMaker) ListEndpointConfigs(input *ListEndpointConfigsInput) (*ListEndpointConfigsOutput, error) { - req, out := c.ListEndpointConfigsRequest(input) +// API operation DescribeExperiment for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeExperiment +func (c *SageMaker) DescribeExperiment(input *DescribeExperimentInput) (*DescribeExperimentOutput, error) { + req, out := c.DescribeExperimentRequest(input) return out, req.Send() } -// ListEndpointConfigsWithContext is the same as ListEndpointConfigs with the addition of +// DescribeExperimentWithContext is the same as DescribeExperiment with the addition of // the ability to pass a context and additional request options. // -// See ListEndpointConfigs for details on how to use this API operation. +// See DescribeExperiment for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListEndpointConfigsWithContext(ctx aws.Context, input *ListEndpointConfigsInput, opts ...request.Option) (*ListEndpointConfigsOutput, error) { - req, out := c.ListEndpointConfigsRequest(input) +func (c *SageMaker) DescribeExperimentWithContext(ctx aws.Context, input *DescribeExperimentInput, opts ...request.Option) (*DescribeExperimentOutput, error) { + req, out := c.DescribeExperimentRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListEndpointConfigsPages iterates over the pages of a ListEndpointConfigs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEndpointConfigs 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 ListEndpointConfigs operation. -// pageNum := 0 -// err := client.ListEndpointConfigsPages(params, -// func(page *sagemaker.ListEndpointConfigsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListEndpointConfigsPages(input *ListEndpointConfigsInput, fn func(*ListEndpointConfigsOutput, bool) bool) error { - return c.ListEndpointConfigsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEndpointConfigsPagesWithContext same as ListEndpointConfigsPages 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 *SageMaker) ListEndpointConfigsPagesWithContext(ctx aws.Context, input *ListEndpointConfigsInput, fn func(*ListEndpointConfigsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListEndpointConfigsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListEndpointConfigsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEndpointConfigsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListEndpoints = "ListEndpoints" +const opDescribeFlowDefinition = "DescribeFlowDefinition" -// ListEndpointsRequest generates a "aws/request.Request" representing the -// client's request for the ListEndpoints operation. The "output" return +// DescribeFlowDefinitionRequest generates a "aws/request.Request" representing the +// client's request for the DescribeFlowDefinition operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListEndpoints for more information on using the ListEndpoints +// See DescribeFlowDefinition for more information on using the DescribeFlowDefinition // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListEndpointsRequest method. -// req, resp := client.ListEndpointsRequest(params) +// // Example sending a request using the DescribeFlowDefinitionRequest method. +// req, resp := client.DescribeFlowDefinitionRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListEndpoints -func (c *SageMaker) ListEndpointsRequest(input *ListEndpointsInput) (req *request.Request, output *ListEndpointsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeFlowDefinition +func (c *SageMaker) DescribeFlowDefinitionRequest(input *DescribeFlowDefinitionInput) (req *request.Request, output *DescribeFlowDefinitionOutput) { op := &request.Operation{ - Name: opListEndpoints, + Name: opDescribeFlowDefinition, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListEndpointsInput{} + input = &DescribeFlowDefinitionInput{} } - output = &ListEndpointsOutput{} + output = &DescribeFlowDefinitionOutput{} req = c.newRequest(op, input, output) return } -// ListEndpoints API operation for Amazon SageMaker Service. +// DescribeFlowDefinition API operation for Amazon SageMaker Service. // -// Lists endpoints. +// Returns information about the specified flow definition. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation ListEndpoints for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListEndpoints -func (c *SageMaker) ListEndpoints(input *ListEndpointsInput) (*ListEndpointsOutput, error) { - req, out := c.ListEndpointsRequest(input) +// API operation DescribeFlowDefinition for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeFlowDefinition +func (c *SageMaker) DescribeFlowDefinition(input *DescribeFlowDefinitionInput) (*DescribeFlowDefinitionOutput, error) { + req, out := c.DescribeFlowDefinitionRequest(input) return out, req.Send() } -// ListEndpointsWithContext is the same as ListEndpoints with the addition of +// DescribeFlowDefinitionWithContext is the same as DescribeFlowDefinition with the addition of // the ability to pass a context and additional request options. // -// See ListEndpoints for details on how to use this API operation. +// See DescribeFlowDefinition for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListEndpointsWithContext(ctx aws.Context, input *ListEndpointsInput, opts ...request.Option) (*ListEndpointsOutput, error) { - req, out := c.ListEndpointsRequest(input) +func (c *SageMaker) DescribeFlowDefinitionWithContext(ctx aws.Context, input *DescribeFlowDefinitionInput, opts ...request.Option) (*DescribeFlowDefinitionOutput, error) { + req, out := c.DescribeFlowDefinitionRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListEndpointsPages iterates over the pages of a ListEndpoints operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. +const opDescribeHumanTaskUi = "DescribeHumanTaskUi" + +// DescribeHumanTaskUiRequest generates a "aws/request.Request" representing the +// client's request for the DescribeHumanTaskUi operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. // -// See ListEndpoints method for more information on how to use this operation. +// 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. // -// Note: This operation can generate multiple requests to a service. +// See DescribeHumanTaskUi for more information on using the DescribeHumanTaskUi +// API call, and error handling. // -// // Example iterating over at most 3 pages of a ListEndpoints operation. -// pageNum := 0 -// err := client.ListEndpointsPages(params, -// func(page *sagemaker.ListEndpointsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// 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. // -func (c *SageMaker) ListEndpointsPages(input *ListEndpointsInput, fn func(*ListEndpointsOutput, bool) bool) error { - return c.ListEndpointsPagesWithContext(aws.BackgroundContext(), input, fn) +// +// // Example sending a request using the DescribeHumanTaskUiRequest method. +// req, resp := client.DescribeHumanTaskUiRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeHumanTaskUi +func (c *SageMaker) DescribeHumanTaskUiRequest(input *DescribeHumanTaskUiInput) (req *request.Request, output *DescribeHumanTaskUiOutput) { + op := &request.Operation{ + Name: opDescribeHumanTaskUi, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeHumanTaskUiInput{} + } + + output = &DescribeHumanTaskUiOutput{} + req = c.newRequest(op, input, output) + return } -// ListEndpointsPagesWithContext same as ListEndpointsPages except -// it takes a Context and allows setting request options on the pages. +// DescribeHumanTaskUi API operation for Amazon SageMaker Service. +// +// Returns information about the requested human task user 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 SageMaker Service's +// API operation DescribeHumanTaskUi for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeHumanTaskUi +func (c *SageMaker) DescribeHumanTaskUi(input *DescribeHumanTaskUiInput) (*DescribeHumanTaskUiOutput, error) { + req, out := c.DescribeHumanTaskUiRequest(input) + return out, req.Send() +} + +// DescribeHumanTaskUiWithContext is the same as DescribeHumanTaskUi with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeHumanTaskUi for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListEndpointsPagesWithContext(ctx aws.Context, input *ListEndpointsInput, fn func(*ListEndpointsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListEndpointsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListEndpointsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEndpointsOutput), !p.HasNextPage()) - } - return p.Err() +func (c *SageMaker) DescribeHumanTaskUiWithContext(ctx aws.Context, input *DescribeHumanTaskUiInput, opts ...request.Option) (*DescribeHumanTaskUiOutput, error) { + req, out := c.DescribeHumanTaskUiRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -const opListHyperParameterTuningJobs = "ListHyperParameterTuningJobs" +const opDescribeHyperParameterTuningJob = "DescribeHyperParameterTuningJob" -// ListHyperParameterTuningJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListHyperParameterTuningJobs operation. The "output" return +// DescribeHyperParameterTuningJobRequest generates a "aws/request.Request" representing the +// client's request for the DescribeHyperParameterTuningJob operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListHyperParameterTuningJobs for more information on using the ListHyperParameterTuningJobs +// See DescribeHyperParameterTuningJob for more information on using the DescribeHyperParameterTuningJob // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListHyperParameterTuningJobsRequest method. -// req, resp := client.ListHyperParameterTuningJobsRequest(params) +// // Example sending a request using the DescribeHyperParameterTuningJobRequest method. +// req, resp := client.DescribeHyperParameterTuningJobRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListHyperParameterTuningJobs -func (c *SageMaker) ListHyperParameterTuningJobsRequest(input *ListHyperParameterTuningJobsInput) (req *request.Request, output *ListHyperParameterTuningJobsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeHyperParameterTuningJob +func (c *SageMaker) DescribeHyperParameterTuningJobRequest(input *DescribeHyperParameterTuningJobInput) (req *request.Request, output *DescribeHyperParameterTuningJobOutput) { op := &request.Operation{ - Name: opListHyperParameterTuningJobs, + Name: opDescribeHyperParameterTuningJob, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListHyperParameterTuningJobsInput{} + input = &DescribeHyperParameterTuningJobInput{} } - output = &ListHyperParameterTuningJobsOutput{} + output = &DescribeHyperParameterTuningJobOutput{} req = c.newRequest(op, input, output) return } -// ListHyperParameterTuningJobs API operation for Amazon SageMaker Service. +// DescribeHyperParameterTuningJob API operation for Amazon SageMaker Service. // -// Gets a list of HyperParameterTuningJobSummary objects that describe the hyperparameter -// tuning jobs launched in your account. +// Gets a description of a hyperparameter tuning 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 SageMaker Service's -// API operation ListHyperParameterTuningJobs for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListHyperParameterTuningJobs -func (c *SageMaker) ListHyperParameterTuningJobs(input *ListHyperParameterTuningJobsInput) (*ListHyperParameterTuningJobsOutput, error) { - req, out := c.ListHyperParameterTuningJobsRequest(input) +// API operation DescribeHyperParameterTuningJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeHyperParameterTuningJob +func (c *SageMaker) DescribeHyperParameterTuningJob(input *DescribeHyperParameterTuningJobInput) (*DescribeHyperParameterTuningJobOutput, error) { + req, out := c.DescribeHyperParameterTuningJobRequest(input) return out, req.Send() } -// ListHyperParameterTuningJobsWithContext is the same as ListHyperParameterTuningJobs with the addition of +// DescribeHyperParameterTuningJobWithContext is the same as DescribeHyperParameterTuningJob with the addition of // the ability to pass a context and additional request options. // -// See ListHyperParameterTuningJobs for details on how to use this API operation. +// See DescribeHyperParameterTuningJob for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListHyperParameterTuningJobsWithContext(ctx aws.Context, input *ListHyperParameterTuningJobsInput, opts ...request.Option) (*ListHyperParameterTuningJobsOutput, error) { - req, out := c.ListHyperParameterTuningJobsRequest(input) - req.SetContext(ctx) +func (c *SageMaker) DescribeHyperParameterTuningJobWithContext(ctx aws.Context, input *DescribeHyperParameterTuningJobInput, opts ...request.Option) (*DescribeHyperParameterTuningJobOutput, error) { + req, out := c.DescribeHyperParameterTuningJobRequest(input) + req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListHyperParameterTuningJobsPages iterates over the pages of a ListHyperParameterTuningJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListHyperParameterTuningJobs 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 ListHyperParameterTuningJobs operation. -// pageNum := 0 -// err := client.ListHyperParameterTuningJobsPages(params, -// func(page *sagemaker.ListHyperParameterTuningJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListHyperParameterTuningJobsPages(input *ListHyperParameterTuningJobsInput, fn func(*ListHyperParameterTuningJobsOutput, bool) bool) error { - return c.ListHyperParameterTuningJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListHyperParameterTuningJobsPagesWithContext same as ListHyperParameterTuningJobsPages 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 *SageMaker) ListHyperParameterTuningJobsPagesWithContext(ctx aws.Context, input *ListHyperParameterTuningJobsInput, fn func(*ListHyperParameterTuningJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListHyperParameterTuningJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListHyperParameterTuningJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListHyperParameterTuningJobsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListLabelingJobs = "ListLabelingJobs" +const opDescribeLabelingJob = "DescribeLabelingJob" -// ListLabelingJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListLabelingJobs operation. The "output" return +// DescribeLabelingJobRequest generates a "aws/request.Request" representing the +// client's request for the DescribeLabelingJob operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListLabelingJobs for more information on using the ListLabelingJobs +// See DescribeLabelingJob for more information on using the DescribeLabelingJob // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListLabelingJobsRequest method. -// req, resp := client.ListLabelingJobsRequest(params) +// // Example sending a request using the DescribeLabelingJobRequest method. +// req, resp := client.DescribeLabelingJobRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListLabelingJobs -func (c *SageMaker) ListLabelingJobsRequest(input *ListLabelingJobsInput) (req *request.Request, output *ListLabelingJobsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeLabelingJob +func (c *SageMaker) DescribeLabelingJobRequest(input *DescribeLabelingJobInput) (req *request.Request, output *DescribeLabelingJobOutput) { op := &request.Operation{ - Name: opListLabelingJobs, + Name: opDescribeLabelingJob, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListLabelingJobsInput{} + input = &DescribeLabelingJobInput{} } - output = &ListLabelingJobsOutput{} + output = &DescribeLabelingJobOutput{} req = c.newRequest(op, input, output) return } -// ListLabelingJobs API operation for Amazon SageMaker Service. +// DescribeLabelingJob API operation for Amazon SageMaker Service. // -// Gets a list of labeling jobs. +// Gets information about a labeling 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 SageMaker Service's -// API operation ListLabelingJobs for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListLabelingJobs -func (c *SageMaker) ListLabelingJobs(input *ListLabelingJobsInput) (*ListLabelingJobsOutput, error) { - req, out := c.ListLabelingJobsRequest(input) +// API operation DescribeLabelingJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeLabelingJob +func (c *SageMaker) DescribeLabelingJob(input *DescribeLabelingJobInput) (*DescribeLabelingJobOutput, error) { + req, out := c.DescribeLabelingJobRequest(input) return out, req.Send() } -// ListLabelingJobsWithContext is the same as ListLabelingJobs with the addition of +// DescribeLabelingJobWithContext is the same as DescribeLabelingJob with the addition of // the ability to pass a context and additional request options. // -// See ListLabelingJobs for details on how to use this API operation. +// See DescribeLabelingJob for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListLabelingJobsWithContext(ctx aws.Context, input *ListLabelingJobsInput, opts ...request.Option) (*ListLabelingJobsOutput, error) { - req, out := c.ListLabelingJobsRequest(input) +func (c *SageMaker) DescribeLabelingJobWithContext(ctx aws.Context, input *DescribeLabelingJobInput, opts ...request.Option) (*DescribeLabelingJobOutput, error) { + req, out := c.DescribeLabelingJobRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListLabelingJobsPages iterates over the pages of a ListLabelingJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListLabelingJobs 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 ListLabelingJobs operation. -// pageNum := 0 -// err := client.ListLabelingJobsPages(params, -// func(page *sagemaker.ListLabelingJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListLabelingJobsPages(input *ListLabelingJobsInput, fn func(*ListLabelingJobsOutput, bool) bool) error { - return c.ListLabelingJobsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListLabelingJobsPagesWithContext same as ListLabelingJobsPages 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 *SageMaker) ListLabelingJobsPagesWithContext(ctx aws.Context, input *ListLabelingJobsInput, fn func(*ListLabelingJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListLabelingJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListLabelingJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListLabelingJobsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListLabelingJobsForWorkteam = "ListLabelingJobsForWorkteam" +const opDescribeModel = "DescribeModel" -// ListLabelingJobsForWorkteamRequest generates a "aws/request.Request" representing the -// client's request for the ListLabelingJobsForWorkteam operation. The "output" return +// DescribeModelRequest generates a "aws/request.Request" representing the +// client's request for the DescribeModel operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListLabelingJobsForWorkteam for more information on using the ListLabelingJobsForWorkteam +// See DescribeModel for more information on using the DescribeModel // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListLabelingJobsForWorkteamRequest method. -// req, resp := client.ListLabelingJobsForWorkteamRequest(params) +// // Example sending a request using the DescribeModelRequest method. +// req, resp := client.DescribeModelRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListLabelingJobsForWorkteam -func (c *SageMaker) ListLabelingJobsForWorkteamRequest(input *ListLabelingJobsForWorkteamInput) (req *request.Request, output *ListLabelingJobsForWorkteamOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeModel +func (c *SageMaker) DescribeModelRequest(input *DescribeModelInput) (req *request.Request, output *DescribeModelOutput) { op := &request.Operation{ - Name: opListLabelingJobsForWorkteam, + Name: opDescribeModel, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListLabelingJobsForWorkteamInput{} + input = &DescribeModelInput{} } - output = &ListLabelingJobsForWorkteamOutput{} + output = &DescribeModelOutput{} req = c.newRequest(op, input, output) return } -// ListLabelingJobsForWorkteam API operation for Amazon SageMaker Service. +// DescribeModel API operation for Amazon SageMaker Service. // -// Gets a list of labeling jobs assigned to a specified work team. +// Describes a model that you created using the CreateModel 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 SageMaker Service's -// API operation ListLabelingJobsForWorkteam for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFound "ResourceNotFound" -// Resource being access is not found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListLabelingJobsForWorkteam -func (c *SageMaker) ListLabelingJobsForWorkteam(input *ListLabelingJobsForWorkteamInput) (*ListLabelingJobsForWorkteamOutput, error) { - req, out := c.ListLabelingJobsForWorkteamRequest(input) +// API operation DescribeModel for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeModel +func (c *SageMaker) DescribeModel(input *DescribeModelInput) (*DescribeModelOutput, error) { + req, out := c.DescribeModelRequest(input) return out, req.Send() } -// ListLabelingJobsForWorkteamWithContext is the same as ListLabelingJobsForWorkteam with the addition of +// DescribeModelWithContext is the same as DescribeModel with the addition of // the ability to pass a context and additional request options. // -// See ListLabelingJobsForWorkteam for details on how to use this API operation. +// See DescribeModel for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListLabelingJobsForWorkteamWithContext(ctx aws.Context, input *ListLabelingJobsForWorkteamInput, opts ...request.Option) (*ListLabelingJobsForWorkteamOutput, error) { - req, out := c.ListLabelingJobsForWorkteamRequest(input) +func (c *SageMaker) DescribeModelWithContext(ctx aws.Context, input *DescribeModelInput, opts ...request.Option) (*DescribeModelOutput, error) { + req, out := c.DescribeModelRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListLabelingJobsForWorkteamPages iterates over the pages of a ListLabelingJobsForWorkteam operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListLabelingJobsForWorkteam 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 ListLabelingJobsForWorkteam operation. -// pageNum := 0 -// err := client.ListLabelingJobsForWorkteamPages(params, -// func(page *sagemaker.ListLabelingJobsForWorkteamOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListLabelingJobsForWorkteamPages(input *ListLabelingJobsForWorkteamInput, fn func(*ListLabelingJobsForWorkteamOutput, bool) bool) error { - return c.ListLabelingJobsForWorkteamPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListLabelingJobsForWorkteamPagesWithContext same as ListLabelingJobsForWorkteamPages 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 *SageMaker) ListLabelingJobsForWorkteamPagesWithContext(ctx aws.Context, input *ListLabelingJobsForWorkteamInput, fn func(*ListLabelingJobsForWorkteamOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListLabelingJobsForWorkteamInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListLabelingJobsForWorkteamRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListLabelingJobsForWorkteamOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListModelPackages = "ListModelPackages" +const opDescribeModelPackage = "DescribeModelPackage" -// ListModelPackagesRequest generates a "aws/request.Request" representing the -// client's request for the ListModelPackages operation. The "output" return +// DescribeModelPackageRequest generates a "aws/request.Request" representing the +// client's request for the DescribeModelPackage operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListModelPackages for more information on using the ListModelPackages +// See DescribeModelPackage for more information on using the DescribeModelPackage // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListModelPackagesRequest method. -// req, resp := client.ListModelPackagesRequest(params) +// // Example sending a request using the DescribeModelPackageRequest method. +// req, resp := client.DescribeModelPackageRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListModelPackages -func (c *SageMaker) ListModelPackagesRequest(input *ListModelPackagesInput) (req *request.Request, output *ListModelPackagesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeModelPackage +func (c *SageMaker) DescribeModelPackageRequest(input *DescribeModelPackageInput) (req *request.Request, output *DescribeModelPackageOutput) { op := &request.Operation{ - Name: opListModelPackages, + Name: opDescribeModelPackage, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ListModelPackagesInput{} + input = &DescribeModelPackageInput{} } - output = &ListModelPackagesOutput{} + output = &DescribeModelPackageOutput{} req = c.newRequest(op, input, output) return } -// ListModelPackages API operation for Amazon SageMaker Service. +// DescribeModelPackage API operation for Amazon SageMaker Service. // -// Lists the model packages that have been created. +// Returns a description of the specified model package, which is used to create +// Amazon SageMaker models or list them on AWS Marketplace. +// +// To create models in Amazon SageMaker, buyers can subscribe to model packages +// listed on AWS Marketplace. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation ListModelPackages for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListModelPackages -func (c *SageMaker) ListModelPackages(input *ListModelPackagesInput) (*ListModelPackagesOutput, error) { - req, out := c.ListModelPackagesRequest(input) +// API operation DescribeModelPackage for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeModelPackage +func (c *SageMaker) DescribeModelPackage(input *DescribeModelPackageInput) (*DescribeModelPackageOutput, error) { + req, out := c.DescribeModelPackageRequest(input) return out, req.Send() } -// ListModelPackagesWithContext is the same as ListModelPackages with the addition of +// DescribeModelPackageWithContext is the same as DescribeModelPackage with the addition of // the ability to pass a context and additional request options. // -// See ListModelPackages for details on how to use this API operation. +// See DescribeModelPackage for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListModelPackagesWithContext(ctx aws.Context, input *ListModelPackagesInput, opts ...request.Option) (*ListModelPackagesOutput, error) { - req, out := c.ListModelPackagesRequest(input) +func (c *SageMaker) DescribeModelPackageWithContext(ctx aws.Context, input *DescribeModelPackageInput, opts ...request.Option) (*DescribeModelPackageOutput, error) { + req, out := c.DescribeModelPackageRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opListModels = "ListModels" +const opDescribeMonitoringSchedule = "DescribeMonitoringSchedule" -// ListModelsRequest generates a "aws/request.Request" representing the -// client's request for the ListModels operation. The "output" return +// DescribeMonitoringScheduleRequest generates a "aws/request.Request" representing the +// client's request for the DescribeMonitoringSchedule operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListModels for more information on using the ListModels +// See DescribeMonitoringSchedule for more information on using the DescribeMonitoringSchedule // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListModelsRequest method. -// req, resp := client.ListModelsRequest(params) +// // Example sending a request using the DescribeMonitoringScheduleRequest method. +// req, resp := client.DescribeMonitoringScheduleRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListModels -func (c *SageMaker) ListModelsRequest(input *ListModelsInput) (req *request.Request, output *ListModelsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeMonitoringSchedule +func (c *SageMaker) DescribeMonitoringScheduleRequest(input *DescribeMonitoringScheduleInput) (req *request.Request, output *DescribeMonitoringScheduleOutput) { op := &request.Operation{ - Name: opListModels, + Name: opDescribeMonitoringSchedule, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListModelsInput{} + input = &DescribeMonitoringScheduleInput{} } - output = &ListModelsOutput{} + output = &DescribeMonitoringScheduleOutput{} req = c.newRequest(op, input, output) return } -// ListModels API operation for Amazon SageMaker Service. +// DescribeMonitoringSchedule API operation for Amazon SageMaker Service. // -// Lists models created with the CreateModel (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateModel.html) -// API. +// Describes the schedule for a monitoring 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 SageMaker Service's -// API operation ListModels for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListModels -func (c *SageMaker) ListModels(input *ListModelsInput) (*ListModelsOutput, error) { - req, out := c.ListModelsRequest(input) +// API operation DescribeMonitoringSchedule for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeMonitoringSchedule +func (c *SageMaker) DescribeMonitoringSchedule(input *DescribeMonitoringScheduleInput) (*DescribeMonitoringScheduleOutput, error) { + req, out := c.DescribeMonitoringScheduleRequest(input) return out, req.Send() } -// ListModelsWithContext is the same as ListModels with the addition of +// DescribeMonitoringScheduleWithContext is the same as DescribeMonitoringSchedule with the addition of // the ability to pass a context and additional request options. // -// See ListModels for details on how to use this API operation. +// See DescribeMonitoringSchedule for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListModelsWithContext(ctx aws.Context, input *ListModelsInput, opts ...request.Option) (*ListModelsOutput, error) { - req, out := c.ListModelsRequest(input) +func (c *SageMaker) DescribeMonitoringScheduleWithContext(ctx aws.Context, input *DescribeMonitoringScheduleInput, opts ...request.Option) (*DescribeMonitoringScheduleOutput, error) { + req, out := c.DescribeMonitoringScheduleRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListModelsPages iterates over the pages of a ListModels operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListModels 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 ListModels operation. -// pageNum := 0 -// err := client.ListModelsPages(params, -// func(page *sagemaker.ListModelsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListModelsPages(input *ListModelsInput, fn func(*ListModelsOutput, bool) bool) error { - return c.ListModelsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListModelsPagesWithContext same as ListModelsPages 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 *SageMaker) ListModelsPagesWithContext(ctx aws.Context, input *ListModelsInput, fn func(*ListModelsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListModelsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListModelsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListModelsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListNotebookInstanceLifecycleConfigs = "ListNotebookInstanceLifecycleConfigs" +const opDescribeNotebookInstance = "DescribeNotebookInstance" -// ListNotebookInstanceLifecycleConfigsRequest generates a "aws/request.Request" representing the -// client's request for the ListNotebookInstanceLifecycleConfigs operation. The "output" return +// DescribeNotebookInstanceRequest generates a "aws/request.Request" representing the +// client's request for the DescribeNotebookInstance operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListNotebookInstanceLifecycleConfigs for more information on using the ListNotebookInstanceLifecycleConfigs +// See DescribeNotebookInstance for more information on using the DescribeNotebookInstance // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListNotebookInstanceLifecycleConfigsRequest method. -// req, resp := client.ListNotebookInstanceLifecycleConfigsRequest(params) +// // Example sending a request using the DescribeNotebookInstanceRequest method. +// req, resp := client.DescribeNotebookInstanceRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListNotebookInstanceLifecycleConfigs -func (c *SageMaker) ListNotebookInstanceLifecycleConfigsRequest(input *ListNotebookInstanceLifecycleConfigsInput) (req *request.Request, output *ListNotebookInstanceLifecycleConfigsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeNotebookInstance +func (c *SageMaker) DescribeNotebookInstanceRequest(input *DescribeNotebookInstanceInput) (req *request.Request, output *DescribeNotebookInstanceOutput) { op := &request.Operation{ - Name: opListNotebookInstanceLifecycleConfigs, + Name: opDescribeNotebookInstance, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListNotebookInstanceLifecycleConfigsInput{} + input = &DescribeNotebookInstanceInput{} } - output = &ListNotebookInstanceLifecycleConfigsOutput{} + output = &DescribeNotebookInstanceOutput{} req = c.newRequest(op, input, output) return } -// ListNotebookInstanceLifecycleConfigs API operation for Amazon SageMaker Service. +// DescribeNotebookInstance API operation for Amazon SageMaker Service. // -// Lists notebook instance lifestyle configurations created with the CreateNotebookInstanceLifecycleConfig -// API. +// Returns information about a notebook 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 SageMaker Service's -// API operation ListNotebookInstanceLifecycleConfigs for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListNotebookInstanceLifecycleConfigs -func (c *SageMaker) ListNotebookInstanceLifecycleConfigs(input *ListNotebookInstanceLifecycleConfigsInput) (*ListNotebookInstanceLifecycleConfigsOutput, error) { - req, out := c.ListNotebookInstanceLifecycleConfigsRequest(input) +// API operation DescribeNotebookInstance for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeNotebookInstance +func (c *SageMaker) DescribeNotebookInstance(input *DescribeNotebookInstanceInput) (*DescribeNotebookInstanceOutput, error) { + req, out := c.DescribeNotebookInstanceRequest(input) return out, req.Send() } -// ListNotebookInstanceLifecycleConfigsWithContext is the same as ListNotebookInstanceLifecycleConfigs with the addition of +// DescribeNotebookInstanceWithContext is the same as DescribeNotebookInstance with the addition of // the ability to pass a context and additional request options. // -// See ListNotebookInstanceLifecycleConfigs for details on how to use this API operation. +// See DescribeNotebookInstance for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListNotebookInstanceLifecycleConfigsWithContext(ctx aws.Context, input *ListNotebookInstanceLifecycleConfigsInput, opts ...request.Option) (*ListNotebookInstanceLifecycleConfigsOutput, error) { - req, out := c.ListNotebookInstanceLifecycleConfigsRequest(input) +func (c *SageMaker) DescribeNotebookInstanceWithContext(ctx aws.Context, input *DescribeNotebookInstanceInput, opts ...request.Option) (*DescribeNotebookInstanceOutput, error) { + req, out := c.DescribeNotebookInstanceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListNotebookInstanceLifecycleConfigsPages iterates over the pages of a ListNotebookInstanceLifecycleConfigs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListNotebookInstanceLifecycleConfigs 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 ListNotebookInstanceLifecycleConfigs operation. -// pageNum := 0 -// err := client.ListNotebookInstanceLifecycleConfigsPages(params, -// func(page *sagemaker.ListNotebookInstanceLifecycleConfigsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListNotebookInstanceLifecycleConfigsPages(input *ListNotebookInstanceLifecycleConfigsInput, fn func(*ListNotebookInstanceLifecycleConfigsOutput, bool) bool) error { - return c.ListNotebookInstanceLifecycleConfigsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListNotebookInstanceLifecycleConfigsPagesWithContext same as ListNotebookInstanceLifecycleConfigsPages 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 *SageMaker) ListNotebookInstanceLifecycleConfigsPagesWithContext(ctx aws.Context, input *ListNotebookInstanceLifecycleConfigsInput, fn func(*ListNotebookInstanceLifecycleConfigsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListNotebookInstanceLifecycleConfigsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListNotebookInstanceLifecycleConfigsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListNotebookInstanceLifecycleConfigsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListNotebookInstances = "ListNotebookInstances" +const opDescribeNotebookInstanceLifecycleConfig = "DescribeNotebookInstanceLifecycleConfig" -// ListNotebookInstancesRequest generates a "aws/request.Request" representing the -// client's request for the ListNotebookInstances operation. The "output" return +// DescribeNotebookInstanceLifecycleConfigRequest generates a "aws/request.Request" representing the +// client's request for the DescribeNotebookInstanceLifecycleConfig operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListNotebookInstances for more information on using the ListNotebookInstances +// See DescribeNotebookInstanceLifecycleConfig for more information on using the DescribeNotebookInstanceLifecycleConfig // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListNotebookInstancesRequest method. -// req, resp := client.ListNotebookInstancesRequest(params) +// // Example sending a request using the DescribeNotebookInstanceLifecycleConfigRequest method. +// req, resp := client.DescribeNotebookInstanceLifecycleConfigRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListNotebookInstances -func (c *SageMaker) ListNotebookInstancesRequest(input *ListNotebookInstancesInput) (req *request.Request, output *ListNotebookInstancesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeNotebookInstanceLifecycleConfig +func (c *SageMaker) DescribeNotebookInstanceLifecycleConfigRequest(input *DescribeNotebookInstanceLifecycleConfigInput) (req *request.Request, output *DescribeNotebookInstanceLifecycleConfigOutput) { op := &request.Operation{ - Name: opListNotebookInstances, + Name: opDescribeNotebookInstanceLifecycleConfig, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListNotebookInstancesInput{} + input = &DescribeNotebookInstanceLifecycleConfigInput{} } - output = &ListNotebookInstancesOutput{} + output = &DescribeNotebookInstanceLifecycleConfigOutput{} req = c.newRequest(op, input, output) return } -// ListNotebookInstances API operation for Amazon SageMaker Service. +// DescribeNotebookInstanceLifecycleConfig API operation for Amazon SageMaker Service. // -// Returns a list of the Amazon SageMaker notebook instances in the requester's -// account in an AWS Region. +// Returns a description of a notebook instance lifecycle configuration. +// +// For information about notebook instance lifestyle configurations, see Step +// 2.1: (Optional) Customize a Notebook Instance (https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.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 SageMaker Service's -// API operation ListNotebookInstances for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListNotebookInstances -func (c *SageMaker) ListNotebookInstances(input *ListNotebookInstancesInput) (*ListNotebookInstancesOutput, error) { - req, out := c.ListNotebookInstancesRequest(input) +// API operation DescribeNotebookInstanceLifecycleConfig for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeNotebookInstanceLifecycleConfig +func (c *SageMaker) DescribeNotebookInstanceLifecycleConfig(input *DescribeNotebookInstanceLifecycleConfigInput) (*DescribeNotebookInstanceLifecycleConfigOutput, error) { + req, out := c.DescribeNotebookInstanceLifecycleConfigRequest(input) return out, req.Send() } -// ListNotebookInstancesWithContext is the same as ListNotebookInstances with the addition of +// DescribeNotebookInstanceLifecycleConfigWithContext is the same as DescribeNotebookInstanceLifecycleConfig with the addition of // the ability to pass a context and additional request options. // -// See ListNotebookInstances for details on how to use this API operation. +// See DescribeNotebookInstanceLifecycleConfig for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListNotebookInstancesWithContext(ctx aws.Context, input *ListNotebookInstancesInput, opts ...request.Option) (*ListNotebookInstancesOutput, error) { - req, out := c.ListNotebookInstancesRequest(input) +func (c *SageMaker) DescribeNotebookInstanceLifecycleConfigWithContext(ctx aws.Context, input *DescribeNotebookInstanceLifecycleConfigInput, opts ...request.Option) (*DescribeNotebookInstanceLifecycleConfigOutput, error) { + req, out := c.DescribeNotebookInstanceLifecycleConfigRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListNotebookInstancesPages iterates over the pages of a ListNotebookInstances operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListNotebookInstances 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 ListNotebookInstances operation. -// pageNum := 0 -// err := client.ListNotebookInstancesPages(params, -// func(page *sagemaker.ListNotebookInstancesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListNotebookInstancesPages(input *ListNotebookInstancesInput, fn func(*ListNotebookInstancesOutput, bool) bool) error { - return c.ListNotebookInstancesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListNotebookInstancesPagesWithContext same as ListNotebookInstancesPages 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 *SageMaker) ListNotebookInstancesPagesWithContext(ctx aws.Context, input *ListNotebookInstancesInput, fn func(*ListNotebookInstancesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListNotebookInstancesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListNotebookInstancesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListNotebookInstancesOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListSubscribedWorkteams = "ListSubscribedWorkteams" +const opDescribeProcessingJob = "DescribeProcessingJob" -// ListSubscribedWorkteamsRequest generates a "aws/request.Request" representing the -// client's request for the ListSubscribedWorkteams operation. The "output" return +// DescribeProcessingJobRequest generates a "aws/request.Request" representing the +// client's request for the DescribeProcessingJob operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListSubscribedWorkteams for more information on using the ListSubscribedWorkteams +// See DescribeProcessingJob for more information on using the DescribeProcessingJob // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListSubscribedWorkteamsRequest method. -// req, resp := client.ListSubscribedWorkteamsRequest(params) +// // Example sending a request using the DescribeProcessingJobRequest method. +// req, resp := client.DescribeProcessingJobRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListSubscribedWorkteams -func (c *SageMaker) ListSubscribedWorkteamsRequest(input *ListSubscribedWorkteamsInput) (req *request.Request, output *ListSubscribedWorkteamsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeProcessingJob +func (c *SageMaker) DescribeProcessingJobRequest(input *DescribeProcessingJobInput) (req *request.Request, output *DescribeProcessingJobOutput) { op := &request.Operation{ - Name: opListSubscribedWorkteams, + Name: opDescribeProcessingJob, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListSubscribedWorkteamsInput{} + input = &DescribeProcessingJobInput{} } - output = &ListSubscribedWorkteamsOutput{} + output = &DescribeProcessingJobOutput{} req = c.newRequest(op, input, output) return } -// ListSubscribedWorkteams API operation for Amazon SageMaker Service. +// DescribeProcessingJob API operation for Amazon SageMaker Service. // -// Gets a list of the work teams that you are subscribed to in the AWS Marketplace. -// The list may be empty if no work team satisfies the filter specified in the -// NameContains parameter. +// Returns a description of a processing 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 SageMaker Service's -// API operation ListSubscribedWorkteams for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListSubscribedWorkteams -func (c *SageMaker) ListSubscribedWorkteams(input *ListSubscribedWorkteamsInput) (*ListSubscribedWorkteamsOutput, error) { - req, out := c.ListSubscribedWorkteamsRequest(input) +// API operation DescribeProcessingJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeProcessingJob +func (c *SageMaker) DescribeProcessingJob(input *DescribeProcessingJobInput) (*DescribeProcessingJobOutput, error) { + req, out := c.DescribeProcessingJobRequest(input) return out, req.Send() } -// ListSubscribedWorkteamsWithContext is the same as ListSubscribedWorkteams with the addition of +// DescribeProcessingJobWithContext is the same as DescribeProcessingJob with the addition of // the ability to pass a context and additional request options. // -// See ListSubscribedWorkteams for details on how to use this API operation. +// See DescribeProcessingJob for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListSubscribedWorkteamsWithContext(ctx aws.Context, input *ListSubscribedWorkteamsInput, opts ...request.Option) (*ListSubscribedWorkteamsOutput, error) { - req, out := c.ListSubscribedWorkteamsRequest(input) +func (c *SageMaker) DescribeProcessingJobWithContext(ctx aws.Context, input *DescribeProcessingJobInput, opts ...request.Option) (*DescribeProcessingJobOutput, error) { + req, out := c.DescribeProcessingJobRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListSubscribedWorkteamsPages iterates over the pages of a ListSubscribedWorkteams operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListSubscribedWorkteams 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 ListSubscribedWorkteams operation. -// pageNum := 0 -// err := client.ListSubscribedWorkteamsPages(params, -// func(page *sagemaker.ListSubscribedWorkteamsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListSubscribedWorkteamsPages(input *ListSubscribedWorkteamsInput, fn func(*ListSubscribedWorkteamsOutput, bool) bool) error { - return c.ListSubscribedWorkteamsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListSubscribedWorkteamsPagesWithContext same as ListSubscribedWorkteamsPages 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 *SageMaker) ListSubscribedWorkteamsPagesWithContext(ctx aws.Context, input *ListSubscribedWorkteamsInput, fn func(*ListSubscribedWorkteamsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListSubscribedWorkteamsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListSubscribedWorkteamsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSubscribedWorkteamsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListTags = "ListTags" +const opDescribeSubscribedWorkteam = "DescribeSubscribedWorkteam" -// ListTagsRequest generates a "aws/request.Request" representing the -// client's request for the ListTags operation. The "output" return +// DescribeSubscribedWorkteamRequest generates a "aws/request.Request" representing the +// client's request for the DescribeSubscribedWorkteam operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListTags for more information on using the ListTags +// See DescribeSubscribedWorkteam for more information on using the DescribeSubscribedWorkteam // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListTagsRequest method. -// req, resp := client.ListTagsRequest(params) +// // Example sending a request using the DescribeSubscribedWorkteamRequest method. +// req, resp := client.DescribeSubscribedWorkteamRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTags -func (c *SageMaker) ListTagsRequest(input *ListTagsInput) (req *request.Request, output *ListTagsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeSubscribedWorkteam +func (c *SageMaker) DescribeSubscribedWorkteamRequest(input *DescribeSubscribedWorkteamInput) (req *request.Request, output *DescribeSubscribedWorkteamOutput) { op := &request.Operation{ - Name: opListTags, + Name: opDescribeSubscribedWorkteam, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListTagsInput{} + input = &DescribeSubscribedWorkteamInput{} } - output = &ListTagsOutput{} + output = &DescribeSubscribedWorkteamOutput{} req = c.newRequest(op, input, output) return } -// ListTags API operation for Amazon SageMaker Service. +// DescribeSubscribedWorkteam API operation for Amazon SageMaker Service. // -// Returns the tags for the specified Amazon SageMaker resource. +// Gets information about a work team provided by a vendor. It returns details +// about the subscription with a vendor in the AWS Marketplace. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation ListTags for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTags -func (c *SageMaker) ListTags(input *ListTagsInput) (*ListTagsOutput, error) { - req, out := c.ListTagsRequest(input) +// API operation DescribeSubscribedWorkteam for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeSubscribedWorkteam +func (c *SageMaker) DescribeSubscribedWorkteam(input *DescribeSubscribedWorkteamInput) (*DescribeSubscribedWorkteamOutput, error) { + req, out := c.DescribeSubscribedWorkteamRequest(input) return out, req.Send() } -// ListTagsWithContext is the same as ListTags with the addition of +// DescribeSubscribedWorkteamWithContext is the same as DescribeSubscribedWorkteam with the addition of // the ability to pass a context and additional request options. // -// See ListTags for details on how to use this API operation. +// See DescribeSubscribedWorkteam for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListTagsWithContext(ctx aws.Context, input *ListTagsInput, opts ...request.Option) (*ListTagsOutput, error) { - req, out := c.ListTagsRequest(input) +func (c *SageMaker) DescribeSubscribedWorkteamWithContext(ctx aws.Context, input *DescribeSubscribedWorkteamInput, opts ...request.Option) (*DescribeSubscribedWorkteamOutput, error) { + req, out := c.DescribeSubscribedWorkteamRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListTagsPages iterates over the pages of a ListTags operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTags 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 ListTags operation. -// pageNum := 0 -// err := client.ListTagsPages(params, -// func(page *sagemaker.ListTagsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -// -func (c *SageMaker) ListTagsPages(input *ListTagsInput, fn func(*ListTagsOutput, bool) bool) error { - return c.ListTagsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTagsPagesWithContext same as ListTagsPages 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 *SageMaker) ListTagsPagesWithContext(ctx aws.Context, input *ListTagsInput, fn func(*ListTagsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTagsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTagsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagsOutput), !p.HasNextPage()) - } - return p.Err() -} - -const opListTrainingJobs = "ListTrainingJobs" +const opDescribeTrainingJob = "DescribeTrainingJob" -// ListTrainingJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListTrainingJobs operation. The "output" return +// DescribeTrainingJobRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTrainingJob operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListTrainingJobs for more information on using the ListTrainingJobs +// See DescribeTrainingJob for more information on using the DescribeTrainingJob // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListTrainingJobsRequest method. -// req, resp := client.ListTrainingJobsRequest(params) +// // Example sending a request using the DescribeTrainingJobRequest method. +// req, resp := client.DescribeTrainingJobRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTrainingJobs -func (c *SageMaker) ListTrainingJobsRequest(input *ListTrainingJobsInput) (req *request.Request, output *ListTrainingJobsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeTrainingJob +func (c *SageMaker) DescribeTrainingJobRequest(input *DescribeTrainingJobInput) (req *request.Request, output *DescribeTrainingJobOutput) { op := &request.Operation{ - Name: opListTrainingJobs, + Name: opDescribeTrainingJob, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListTrainingJobsInput{} + input = &DescribeTrainingJobInput{} } - output = &ListTrainingJobsOutput{} + output = &DescribeTrainingJobOutput{} req = c.newRequest(op, input, output) return } -// ListTrainingJobs API operation for Amazon SageMaker Service. +// DescribeTrainingJob API operation for Amazon SageMaker Service. // -// Lists training jobs. +// Returns information about a training 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 SageMaker Service's -// API operation ListTrainingJobs for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTrainingJobs -func (c *SageMaker) ListTrainingJobs(input *ListTrainingJobsInput) (*ListTrainingJobsOutput, error) { - req, out := c.ListTrainingJobsRequest(input) +// API operation DescribeTrainingJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeTrainingJob +func (c *SageMaker) DescribeTrainingJob(input *DescribeTrainingJobInput) (*DescribeTrainingJobOutput, error) { + req, out := c.DescribeTrainingJobRequest(input) return out, req.Send() } -// ListTrainingJobsWithContext is the same as ListTrainingJobs with the addition of +// DescribeTrainingJobWithContext is the same as DescribeTrainingJob with the addition of // the ability to pass a context and additional request options. // -// See ListTrainingJobs for details on how to use this API operation. +// See DescribeTrainingJob for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListTrainingJobsWithContext(ctx aws.Context, input *ListTrainingJobsInput, opts ...request.Option) (*ListTrainingJobsOutput, error) { - req, out := c.ListTrainingJobsRequest(input) +func (c *SageMaker) DescribeTrainingJobWithContext(ctx aws.Context, input *DescribeTrainingJobInput, opts ...request.Option) (*DescribeTrainingJobOutput, error) { + req, out := c.DescribeTrainingJobRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListTrainingJobsPages iterates over the pages of a ListTrainingJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. +const opDescribeTransformJob = "DescribeTransformJob" + +// DescribeTransformJobRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTransformJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. // -// See ListTrainingJobs method for more information on how to use this operation. +// 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. // -// Note: This operation can generate multiple requests to a service. +// See DescribeTransformJob for more information on using the DescribeTransformJob +// API call, and error handling. // -// // Example iterating over at most 3 pages of a ListTrainingJobs operation. -// pageNum := 0 -// err := client.ListTrainingJobsPages(params, -// func(page *sagemaker.ListTrainingJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// 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. // -func (c *SageMaker) ListTrainingJobsPages(input *ListTrainingJobsInput, fn func(*ListTrainingJobsOutput, bool) bool) error { - return c.ListTrainingJobsPagesWithContext(aws.BackgroundContext(), input, fn) +// +// // Example sending a request using the DescribeTransformJobRequest method. +// req, resp := client.DescribeTransformJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeTransformJob +func (c *SageMaker) DescribeTransformJobRequest(input *DescribeTransformJobInput) (req *request.Request, output *DescribeTransformJobOutput) { + op := &request.Operation{ + Name: opDescribeTransformJob, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeTransformJobInput{} + } + + output = &DescribeTransformJobOutput{} + req = c.newRequest(op, input, output) + return } -// ListTrainingJobsPagesWithContext same as ListTrainingJobsPages except -// it takes a Context and allows setting request options on the pages. +// DescribeTransformJob API operation for Amazon SageMaker Service. +// +// Returns information about a transform 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 SageMaker Service's +// API operation DescribeTransformJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeTransformJob +func (c *SageMaker) DescribeTransformJob(input *DescribeTransformJobInput) (*DescribeTransformJobOutput, error) { + req, out := c.DescribeTransformJobRequest(input) + return out, req.Send() +} + +// DescribeTransformJobWithContext is the same as DescribeTransformJob with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTransformJob for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListTrainingJobsPagesWithContext(ctx aws.Context, input *ListTrainingJobsInput, fn func(*ListTrainingJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTrainingJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTrainingJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTrainingJobsOutput), !p.HasNextPage()) - } - return p.Err() +func (c *SageMaker) DescribeTransformJobWithContext(ctx aws.Context, input *DescribeTransformJobInput, opts ...request.Option) (*DescribeTransformJobOutput, error) { + req, out := c.DescribeTransformJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -const opListTrainingJobsForHyperParameterTuningJob = "ListTrainingJobsForHyperParameterTuningJob" +const opDescribeTrial = "DescribeTrial" -// ListTrainingJobsForHyperParameterTuningJobRequest generates a "aws/request.Request" representing the -// client's request for the ListTrainingJobsForHyperParameterTuningJob operation. The "output" return +// DescribeTrialRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTrial operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListTrainingJobsForHyperParameterTuningJob for more information on using the ListTrainingJobsForHyperParameterTuningJob +// See DescribeTrial for more information on using the DescribeTrial // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListTrainingJobsForHyperParameterTuningJobRequest method. -// req, resp := client.ListTrainingJobsForHyperParameterTuningJobRequest(params) +// // Example sending a request using the DescribeTrialRequest method. +// req, resp := client.DescribeTrialRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTrainingJobsForHyperParameterTuningJob -func (c *SageMaker) ListTrainingJobsForHyperParameterTuningJobRequest(input *ListTrainingJobsForHyperParameterTuningJobInput) (req *request.Request, output *ListTrainingJobsForHyperParameterTuningJobOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeTrial +func (c *SageMaker) DescribeTrialRequest(input *DescribeTrialInput) (req *request.Request, output *DescribeTrialOutput) { op := &request.Operation{ - Name: opListTrainingJobsForHyperParameterTuningJob, + Name: opDescribeTrial, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListTrainingJobsForHyperParameterTuningJobInput{} + input = &DescribeTrialInput{} } - output = &ListTrainingJobsForHyperParameterTuningJobOutput{} + output = &DescribeTrialOutput{} req = c.newRequest(op, input, output) return } -// ListTrainingJobsForHyperParameterTuningJob API operation for Amazon SageMaker Service. +// DescribeTrial API operation for Amazon SageMaker Service. // -// Gets a list of TrainingJobSummary objects that describe the training jobs -// that a hyperparameter tuning job launched. +// Provides a list of a trial's properties. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation ListTrainingJobsForHyperParameterTuningJob for usage and error information. +// API operation DescribeTrial for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFound "ResourceNotFound" +// Returned Error Types: +// * ResourceNotFound // Resource being access is not found. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTrainingJobsForHyperParameterTuningJob -func (c *SageMaker) ListTrainingJobsForHyperParameterTuningJob(input *ListTrainingJobsForHyperParameterTuningJobInput) (*ListTrainingJobsForHyperParameterTuningJobOutput, error) { - req, out := c.ListTrainingJobsForHyperParameterTuningJobRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeTrial +func (c *SageMaker) DescribeTrial(input *DescribeTrialInput) (*DescribeTrialOutput, error) { + req, out := c.DescribeTrialRequest(input) return out, req.Send() } -// ListTrainingJobsForHyperParameterTuningJobWithContext is the same as ListTrainingJobsForHyperParameterTuningJob with the addition of +// DescribeTrialWithContext is the same as DescribeTrial with the addition of // the ability to pass a context and additional request options. // -// See ListTrainingJobsForHyperParameterTuningJob for details on how to use this API operation. +// See DescribeTrial for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListTrainingJobsForHyperParameterTuningJobWithContext(ctx aws.Context, input *ListTrainingJobsForHyperParameterTuningJobInput, opts ...request.Option) (*ListTrainingJobsForHyperParameterTuningJobOutput, error) { - req, out := c.ListTrainingJobsForHyperParameterTuningJobRequest(input) +func (c *SageMaker) DescribeTrialWithContext(ctx aws.Context, input *DescribeTrialInput, opts ...request.Option) (*DescribeTrialOutput, error) { + req, out := c.DescribeTrialRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListTrainingJobsForHyperParameterTuningJobPages iterates over the pages of a ListTrainingJobsForHyperParameterTuningJob operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. +const opDescribeTrialComponent = "DescribeTrialComponent" + +// DescribeTrialComponentRequest generates a "aws/request.Request" representing the +// client's request for the DescribeTrialComponent operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. // -// See ListTrainingJobsForHyperParameterTuningJob method for more information on how to use this operation. +// 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. // -// Note: This operation can generate multiple requests to a service. +// See DescribeTrialComponent for more information on using the DescribeTrialComponent +// API call, and error handling. // -// // Example iterating over at most 3 pages of a ListTrainingJobsForHyperParameterTuningJob operation. -// pageNum := 0 -// err := client.ListTrainingJobsForHyperParameterTuningJobPages(params, -// func(page *sagemaker.ListTrainingJobsForHyperParameterTuningJobOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// 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. // -func (c *SageMaker) ListTrainingJobsForHyperParameterTuningJobPages(input *ListTrainingJobsForHyperParameterTuningJobInput, fn func(*ListTrainingJobsForHyperParameterTuningJobOutput, bool) bool) error { - return c.ListTrainingJobsForHyperParameterTuningJobPagesWithContext(aws.BackgroundContext(), input, fn) +// +// // Example sending a request using the DescribeTrialComponentRequest method. +// req, resp := client.DescribeTrialComponentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeTrialComponent +func (c *SageMaker) DescribeTrialComponentRequest(input *DescribeTrialComponentInput) (req *request.Request, output *DescribeTrialComponentOutput) { + op := &request.Operation{ + Name: opDescribeTrialComponent, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeTrialComponentInput{} + } + + output = &DescribeTrialComponentOutput{} + req = c.newRequest(op, input, output) + return } -// ListTrainingJobsForHyperParameterTuningJobPagesWithContext same as ListTrainingJobsForHyperParameterTuningJobPages except -// it takes a Context and allows setting request options on the pages. +// DescribeTrialComponent API operation for Amazon SageMaker Service. +// +// Provides a list of a trials component's properties. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation DescribeTrialComponent for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeTrialComponent +func (c *SageMaker) DescribeTrialComponent(input *DescribeTrialComponentInput) (*DescribeTrialComponentOutput, error) { + req, out := c.DescribeTrialComponentRequest(input) + return out, req.Send() +} + +// DescribeTrialComponentWithContext is the same as DescribeTrialComponent with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeTrialComponent for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListTrainingJobsForHyperParameterTuningJobPagesWithContext(ctx aws.Context, input *ListTrainingJobsForHyperParameterTuningJobInput, fn func(*ListTrainingJobsForHyperParameterTuningJobOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTrainingJobsForHyperParameterTuningJobInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTrainingJobsForHyperParameterTuningJobRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTrainingJobsForHyperParameterTuningJobOutput), !p.HasNextPage()) - } - return p.Err() +func (c *SageMaker) DescribeTrialComponentWithContext(ctx aws.Context, input *DescribeTrialComponentInput, opts ...request.Option) (*DescribeTrialComponentOutput, error) { + req, out := c.DescribeTrialComponentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -const opListTransformJobs = "ListTransformJobs" +const opDescribeUserProfile = "DescribeUserProfile" -// ListTransformJobsRequest generates a "aws/request.Request" representing the -// client's request for the ListTransformJobs operation. The "output" return +// DescribeUserProfileRequest generates a "aws/request.Request" representing the +// client's request for the DescribeUserProfile operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListTransformJobs for more information on using the ListTransformJobs +// See DescribeUserProfile for more information on using the DescribeUserProfile // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListTransformJobsRequest method. -// req, resp := client.ListTransformJobsRequest(params) +// // Example sending a request using the DescribeUserProfileRequest method. +// req, resp := client.DescribeUserProfileRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTransformJobs -func (c *SageMaker) ListTransformJobsRequest(input *ListTransformJobsInput) (req *request.Request, output *ListTransformJobsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeUserProfile +func (c *SageMaker) DescribeUserProfileRequest(input *DescribeUserProfileInput) (req *request.Request, output *DescribeUserProfileOutput) { op := &request.Operation{ - Name: opListTransformJobs, + Name: opDescribeUserProfile, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListTransformJobsInput{} + input = &DescribeUserProfileInput{} } - output = &ListTransformJobsOutput{} + output = &DescribeUserProfileOutput{} req = c.newRequest(op, input, output) return } -// ListTransformJobs API operation for Amazon SageMaker Service. +// DescribeUserProfile API operation for Amazon SageMaker Service. // -// Lists transform jobs. +// Describes the user profile. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation ListTransformJobs for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTransformJobs -func (c *SageMaker) ListTransformJobs(input *ListTransformJobsInput) (*ListTransformJobsOutput, error) { - req, out := c.ListTransformJobsRequest(input) +// API operation DescribeUserProfile for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeUserProfile +func (c *SageMaker) DescribeUserProfile(input *DescribeUserProfileInput) (*DescribeUserProfileOutput, error) { + req, out := c.DescribeUserProfileRequest(input) return out, req.Send() } -// ListTransformJobsWithContext is the same as ListTransformJobs with the addition of +// DescribeUserProfileWithContext is the same as DescribeUserProfile with the addition of // the ability to pass a context and additional request options. // -// See ListTransformJobs for details on how to use this API operation. +// See DescribeUserProfile for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListTransformJobsWithContext(ctx aws.Context, input *ListTransformJobsInput, opts ...request.Option) (*ListTransformJobsOutput, error) { - req, out := c.ListTransformJobsRequest(input) +func (c *SageMaker) DescribeUserProfileWithContext(ctx aws.Context, input *DescribeUserProfileInput, opts ...request.Option) (*DescribeUserProfileOutput, error) { + req, out := c.DescribeUserProfileRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListTransformJobsPages iterates over the pages of a ListTransformJobs operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. +const opDescribeWorkforce = "DescribeWorkforce" + +// DescribeWorkforceRequest generates a "aws/request.Request" representing the +// client's request for the DescribeWorkforce operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. // -// See ListTransformJobs method for more information on how to use this operation. +// 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. // -// Note: This operation can generate multiple requests to a service. +// See DescribeWorkforce for more information on using the DescribeWorkforce +// API call, and error handling. // -// // Example iterating over at most 3 pages of a ListTransformJobs operation. -// pageNum := 0 -// err := client.ListTransformJobsPages(params, -// func(page *sagemaker.ListTransformJobsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// 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. // -func (c *SageMaker) ListTransformJobsPages(input *ListTransformJobsInput, fn func(*ListTransformJobsOutput, bool) bool) error { - return c.ListTransformJobsPagesWithContext(aws.BackgroundContext(), input, fn) +// +// // Example sending a request using the DescribeWorkforceRequest method. +// req, resp := client.DescribeWorkforceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeWorkforce +func (c *SageMaker) DescribeWorkforceRequest(input *DescribeWorkforceInput) (req *request.Request, output *DescribeWorkforceOutput) { + op := &request.Operation{ + Name: opDescribeWorkforce, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeWorkforceInput{} + } + + output = &DescribeWorkforceOutput{} + req = c.newRequest(op, input, output) + return } -// ListTransformJobsPagesWithContext same as ListTransformJobsPages except -// it takes a Context and allows setting request options on the pages. +// DescribeWorkforce API operation for Amazon SageMaker Service. +// +// Lists private workforce information, including workforce name, Amazon Resource +// Name (ARN), and, if applicable, allowed IP address ranges (CIDRs (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html)). +// Allowable IP address ranges are the IP addresses that workers can use to +// access tasks. +// +// This operation applies only to private workforces. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation DescribeWorkforce for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeWorkforce +func (c *SageMaker) DescribeWorkforce(input *DescribeWorkforceInput) (*DescribeWorkforceOutput, error) { + req, out := c.DescribeWorkforceRequest(input) + return out, req.Send() +} + +// DescribeWorkforceWithContext is the same as DescribeWorkforce with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeWorkforce for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListTransformJobsPagesWithContext(ctx aws.Context, input *ListTransformJobsInput, fn func(*ListTransformJobsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTransformJobsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTransformJobsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTransformJobsOutput), !p.HasNextPage()) - } - return p.Err() +func (c *SageMaker) DescribeWorkforceWithContext(ctx aws.Context, input *DescribeWorkforceInput, opts ...request.Option) (*DescribeWorkforceOutput, error) { + req, out := c.DescribeWorkforceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -const opListWorkteams = "ListWorkteams" +const opDescribeWorkteam = "DescribeWorkteam" -// ListWorkteamsRequest generates a "aws/request.Request" representing the -// client's request for the ListWorkteams operation. The "output" return +// DescribeWorkteamRequest generates a "aws/request.Request" representing the +// client's request for the DescribeWorkteam operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ListWorkteams for more information on using the ListWorkteams +// See DescribeWorkteam for more information on using the DescribeWorkteam // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ListWorkteamsRequest method. -// req, resp := client.ListWorkteamsRequest(params) +// // Example sending a request using the DescribeWorkteamRequest method. +// req, resp := client.DescribeWorkteamRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListWorkteams -func (c *SageMaker) ListWorkteamsRequest(input *ListWorkteamsInput) (req *request.Request, output *ListWorkteamsOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeWorkteam +func (c *SageMaker) DescribeWorkteamRequest(input *DescribeWorkteamInput) (req *request.Request, output *DescribeWorkteamOutput) { op := &request.Operation{ - Name: opListWorkteams, + Name: opDescribeWorkteam, HTTPMethod: "POST", HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, } if input == nil { - input = &ListWorkteamsInput{} + input = &DescribeWorkteamInput{} } - output = &ListWorkteamsOutput{} + output = &DescribeWorkteamOutput{} req = c.newRequest(op, input, output) return } -// ListWorkteams API operation for Amazon SageMaker Service. +// DescribeWorkteam API operation for Amazon SageMaker Service. // -// Gets a list of work teams that you have defined in a region. The list may -// be empty if no work team satisfies the filter specified in the NameContains -// parameter. +// Gets information about a specific work team. You can see information such +// as the create date, the last updated date, membership information, and the +// work team's Amazon Resource Name (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 SageMaker Service's -// API operation ListWorkteams for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListWorkteams -func (c *SageMaker) ListWorkteams(input *ListWorkteamsInput) (*ListWorkteamsOutput, error) { - req, out := c.ListWorkteamsRequest(input) +// API operation DescribeWorkteam for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DescribeWorkteam +func (c *SageMaker) DescribeWorkteam(input *DescribeWorkteamInput) (*DescribeWorkteamOutput, error) { + req, out := c.DescribeWorkteamRequest(input) return out, req.Send() } -// ListWorkteamsWithContext is the same as ListWorkteams with the addition of +// DescribeWorkteamWithContext is the same as DescribeWorkteam with the addition of // the ability to pass a context and additional request options. // -// See ListWorkteams for details on how to use this API operation. +// See DescribeWorkteam for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListWorkteamsWithContext(ctx aws.Context, input *ListWorkteamsInput, opts ...request.Option) (*ListWorkteamsOutput, error) { - req, out := c.ListWorkteamsRequest(input) +func (c *SageMaker) DescribeWorkteamWithContext(ctx aws.Context, input *DescribeWorkteamInput, opts ...request.Option) (*DescribeWorkteamOutput, error) { + req, out := c.DescribeWorkteamRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// ListWorkteamsPages iterates over the pages of a ListWorkteams operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. +const opDisassociateTrialComponent = "DisassociateTrialComponent" + +// DisassociateTrialComponentRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateTrialComponent operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. // -// See ListWorkteams method for more information on how to use this operation. +// 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. // -// Note: This operation can generate multiple requests to a service. +// See DisassociateTrialComponent for more information on using the DisassociateTrialComponent +// API call, and error handling. // -// // Example iterating over at most 3 pages of a ListWorkteams operation. -// pageNum := 0 -// err := client.ListWorkteamsPages(params, -// func(page *sagemaker.ListWorkteamsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) +// 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. // -func (c *SageMaker) ListWorkteamsPages(input *ListWorkteamsInput, fn func(*ListWorkteamsOutput, bool) bool) error { - return c.ListWorkteamsPagesWithContext(aws.BackgroundContext(), input, fn) +// +// // Example sending a request using the DisassociateTrialComponentRequest method. +// req, resp := client.DisassociateTrialComponentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DisassociateTrialComponent +func (c *SageMaker) DisassociateTrialComponentRequest(input *DisassociateTrialComponentInput) (req *request.Request, output *DisassociateTrialComponentOutput) { + op := &request.Operation{ + Name: opDisassociateTrialComponent, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DisassociateTrialComponentInput{} + } + + output = &DisassociateTrialComponentOutput{} + req = c.newRequest(op, input, output) + return } -// ListWorkteamsPagesWithContext same as ListWorkteamsPages except -// it takes a Context and allows setting request options on the pages. +// DisassociateTrialComponent API operation for Amazon SageMaker Service. +// +// Disassociates a trial component from a trial. This doesn't effect other trials +// the component is associated with. Before you can delete a component, you +// must disassociate the component from all trials it is associated with. To +// associate a trial component with a trial, call the AssociateTrialComponent +// API. +// +// To get a list of the trials a component is associated with, use the Search +// API. Specify ExperimentTrialComponent for the Resource parameter. The list +// appears in the response under Results.TrialComponent.Parents. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation DisassociateTrialComponent for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/DisassociateTrialComponent +func (c *SageMaker) DisassociateTrialComponent(input *DisassociateTrialComponentInput) (*DisassociateTrialComponentOutput, error) { + req, out := c.DisassociateTrialComponentRequest(input) + return out, req.Send() +} + +// DisassociateTrialComponentWithContext is the same as DisassociateTrialComponent with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateTrialComponent for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) ListWorkteamsPagesWithContext(ctx aws.Context, input *ListWorkteamsInput, fn func(*ListWorkteamsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListWorkteamsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListWorkteamsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListWorkteamsOutput), !p.HasNextPage()) - } - return p.Err() +func (c *SageMaker) DisassociateTrialComponentWithContext(ctx aws.Context, input *DisassociateTrialComponentInput, opts ...request.Option) (*DisassociateTrialComponentOutput, error) { + req, out := c.DisassociateTrialComponentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -const opRenderUiTemplate = "RenderUiTemplate" +const opGetSearchSuggestions = "GetSearchSuggestions" -// RenderUiTemplateRequest generates a "aws/request.Request" representing the -// client's request for the RenderUiTemplate operation. The "output" return +// GetSearchSuggestionsRequest generates a "aws/request.Request" representing the +// client's request for the GetSearchSuggestions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RenderUiTemplate for more information on using the RenderUiTemplate +// See GetSearchSuggestions for more information on using the GetSearchSuggestions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RenderUiTemplateRequest method. -// req, resp := client.RenderUiTemplateRequest(params) +// // Example sending a request using the GetSearchSuggestionsRequest method. +// req, resp := client.GetSearchSuggestionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/RenderUiTemplate -func (c *SageMaker) RenderUiTemplateRequest(input *RenderUiTemplateInput) (req *request.Request, output *RenderUiTemplateOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/GetSearchSuggestions +func (c *SageMaker) GetSearchSuggestionsRequest(input *GetSearchSuggestionsInput) (req *request.Request, output *GetSearchSuggestionsOutput) { op := &request.Operation{ - Name: opRenderUiTemplate, + Name: opGetSearchSuggestions, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RenderUiTemplateInput{} + input = &GetSearchSuggestionsInput{} } - output = &RenderUiTemplateOutput{} + output = &GetSearchSuggestionsOutput{} req = c.newRequest(op, input, output) return } -// RenderUiTemplate API operation for Amazon SageMaker Service. +// GetSearchSuggestions API operation for Amazon SageMaker Service. // -// Renders the UI template so that you can preview the worker's experience. +// An auto-complete API for the search functionality in the Amazon SageMaker +// console. It returns suggestions of possible matches for the property name +// to use in Search queries. Provides suggestions for HyperParameters, Tags, +// and 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 SageMaker Service's -// API operation RenderUiTemplate for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/RenderUiTemplate -func (c *SageMaker) RenderUiTemplate(input *RenderUiTemplateInput) (*RenderUiTemplateOutput, error) { - req, out := c.RenderUiTemplateRequest(input) +// API operation GetSearchSuggestions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/GetSearchSuggestions +func (c *SageMaker) GetSearchSuggestions(input *GetSearchSuggestionsInput) (*GetSearchSuggestionsOutput, error) { + req, out := c.GetSearchSuggestionsRequest(input) return out, req.Send() } -// RenderUiTemplateWithContext is the same as RenderUiTemplate with the addition of +// GetSearchSuggestionsWithContext is the same as GetSearchSuggestions with the addition of // the ability to pass a context and additional request options. // -// See RenderUiTemplate for details on how to use this API operation. +// See GetSearchSuggestions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) RenderUiTemplateWithContext(ctx aws.Context, input *RenderUiTemplateInput, opts ...request.Option) (*RenderUiTemplateOutput, error) { - req, out := c.RenderUiTemplateRequest(input) +func (c *SageMaker) GetSearchSuggestionsWithContext(ctx aws.Context, input *GetSearchSuggestionsInput, opts ...request.Option) (*GetSearchSuggestionsOutput, error) { + req, out := c.GetSearchSuggestionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opSearch = "Search" +const opListAlgorithms = "ListAlgorithms" -// SearchRequest generates a "aws/request.Request" representing the -// client's request for the Search operation. The "output" return +// ListAlgorithmsRequest generates a "aws/request.Request" representing the +// client's request for the ListAlgorithms operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See Search for more information on using the Search +// See ListAlgorithms for more information on using the ListAlgorithms // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the SearchRequest method. -// req, resp := client.SearchRequest(params) +// // Example sending a request using the ListAlgorithmsRequest method. +// req, resp := client.ListAlgorithmsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/Search -func (c *SageMaker) SearchRequest(input *SearchInput) (req *request.Request, output *SearchOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListAlgorithms +func (c *SageMaker) ListAlgorithmsRequest(input *ListAlgorithmsInput) (req *request.Request, output *ListAlgorithmsOutput) { op := &request.Operation{ - Name: opSearch, + Name: opListAlgorithms, HTTPMethod: "POST", HTTPPath: "/", Paginator: &request.Paginator{ @@ -5901,1362 +6497,19121 @@ func (c *SageMaker) SearchRequest(input *SearchInput) (req *request.Request, out } if input == nil { - input = &SearchInput{} + input = &ListAlgorithmsInput{} } - output = &SearchOutput{} + output = &ListAlgorithmsOutput{} req = c.newRequest(op, input, output) return } -// Search API operation for Amazon SageMaker Service. -// -// Finds Amazon SageMaker resources that match a search query. Matching resource -// objects are returned as a list of SearchResult objects in the response. You -// can sort the search results by any resource property in a ascending or descending -// order. +// ListAlgorithms API operation for Amazon SageMaker Service. // -// You can query against the following value types: numerical, text, Booleans, -// and timestamps. +// Lists the machine learning algorithms that have been 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 SageMaker Service's -// API operation Search for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/Search -func (c *SageMaker) Search(input *SearchInput) (*SearchOutput, error) { - req, out := c.SearchRequest(input) +// API operation ListAlgorithms for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListAlgorithms +func (c *SageMaker) ListAlgorithms(input *ListAlgorithmsInput) (*ListAlgorithmsOutput, error) { + req, out := c.ListAlgorithmsRequest(input) return out, req.Send() } -// SearchWithContext is the same as Search with the addition of +// ListAlgorithmsWithContext is the same as ListAlgorithms with the addition of // the ability to pass a context and additional request options. // -// See Search for details on how to use this API operation. +// See ListAlgorithms for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) SearchWithContext(ctx aws.Context, input *SearchInput, opts ...request.Option) (*SearchOutput, error) { - req, out := c.SearchRequest(input) +func (c *SageMaker) ListAlgorithmsWithContext(ctx aws.Context, input *ListAlgorithmsInput, opts ...request.Option) (*ListAlgorithmsOutput, error) { + req, out := c.ListAlgorithmsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// SearchPages iterates over the pages of a Search operation, +// ListAlgorithmsPages iterates over the pages of a ListAlgorithms operation, // calling the "fn" function with the response data for each page. To stop // iterating, return false from the fn function. // -// See Search method for more information on how to use this operation. +// See ListAlgorithms 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 Search operation. +// // Example iterating over at most 3 pages of a ListAlgorithms operation. // pageNum := 0 -// err := client.SearchPages(params, -// func(page *sagemaker.SearchOutput, lastPage bool) bool { +// err := client.ListAlgorithmsPages(params, +// func(page *sagemaker.ListAlgorithmsOutput, lastPage bool) bool { // pageNum++ // fmt.Println(page) // return pageNum <= 3 // }) // -func (c *SageMaker) SearchPages(input *SearchInput, fn func(*SearchOutput, bool) bool) error { - return c.SearchPagesWithContext(aws.BackgroundContext(), input, fn) +func (c *SageMaker) ListAlgorithmsPages(input *ListAlgorithmsInput, fn func(*ListAlgorithmsOutput, bool) bool) error { + return c.ListAlgorithmsPagesWithContext(aws.BackgroundContext(), input, fn) } -// SearchPagesWithContext same as SearchPages except +// ListAlgorithmsPagesWithContext same as ListAlgorithmsPages 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 *SageMaker) SearchPagesWithContext(ctx aws.Context, input *SearchInput, fn func(*SearchOutput, bool) bool, opts ...request.Option) error { +func (c *SageMaker) ListAlgorithmsPagesWithContext(ctx aws.Context, input *ListAlgorithmsInput, fn func(*ListAlgorithmsOutput, bool) bool, opts ...request.Option) error { p := request.Pagination{ NewRequest: func() (*request.Request, error) { - var inCpy *SearchInput + var inCpy *ListAlgorithmsInput if input != nil { tmp := *input inCpy = &tmp } - req, _ := c.SearchRequest(inCpy) + req, _ := c.ListAlgorithmsRequest(inCpy) req.SetContext(ctx) req.ApplyOptions(opts...) return req, nil }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SearchOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAlgorithmsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } -const opStartNotebookInstance = "StartNotebookInstance" +const opListApps = "ListApps" -// StartNotebookInstanceRequest generates a "aws/request.Request" representing the -// client's request for the StartNotebookInstance operation. The "output" return +// ListAppsRequest generates a "aws/request.Request" representing the +// client's request for the ListApps operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StartNotebookInstance for more information on using the StartNotebookInstance +// See ListApps for more information on using the ListApps // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StartNotebookInstanceRequest method. -// req, resp := client.StartNotebookInstanceRequest(params) +// // Example sending a request using the ListAppsRequest method. +// req, resp := client.ListAppsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StartNotebookInstance -func (c *SageMaker) StartNotebookInstanceRequest(input *StartNotebookInstanceInput) (req *request.Request, output *StartNotebookInstanceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListApps +func (c *SageMaker) ListAppsRequest(input *ListAppsInput) (req *request.Request, output *ListAppsOutput) { op := &request.Operation{ - Name: opStartNotebookInstance, + Name: opListApps, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &StartNotebookInstanceInput{} + input = &ListAppsInput{} } - output = &StartNotebookInstanceOutput{} + output = &ListAppsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// StartNotebookInstance API operation for Amazon SageMaker Service. +// ListApps API operation for Amazon SageMaker Service. // -// Launches an ML compute instance with the latest version of the libraries -// and attaches your ML storage volume. After configuring the notebook instance, -// Amazon SageMaker sets the notebook instance status to InService. A notebook -// instance's status must be InService before you can connect to your Jupyter -// notebook. +// Lists apps. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation StartNotebookInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" -// You have exceeded an Amazon SageMaker resource limit. For example, you might -// have too many training jobs created. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StartNotebookInstance -func (c *SageMaker) StartNotebookInstance(input *StartNotebookInstanceInput) (*StartNotebookInstanceOutput, error) { - req, out := c.StartNotebookInstanceRequest(input) +// API operation ListApps for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListApps +func (c *SageMaker) ListApps(input *ListAppsInput) (*ListAppsOutput, error) { + req, out := c.ListAppsRequest(input) return out, req.Send() } -// StartNotebookInstanceWithContext is the same as StartNotebookInstance with the addition of +// ListAppsWithContext is the same as ListApps with the addition of // the ability to pass a context and additional request options. // -// See StartNotebookInstance for details on how to use this API operation. +// See ListApps for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) StartNotebookInstanceWithContext(ctx aws.Context, input *StartNotebookInstanceInput, opts ...request.Option) (*StartNotebookInstanceOutput, error) { - req, out := c.StartNotebookInstanceRequest(input) +func (c *SageMaker) ListAppsWithContext(ctx aws.Context, input *ListAppsInput, opts ...request.Option) (*ListAppsOutput, error) { + req, out := c.ListAppsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopCompilationJob = "StopCompilationJob" +// ListAppsPages iterates over the pages of a ListApps operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListApps 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 ListApps operation. +// pageNum := 0 +// err := client.ListAppsPages(params, +// func(page *sagemaker.ListAppsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListAppsPages(input *ListAppsInput, fn func(*ListAppsOutput, bool) bool) error { + return c.ListAppsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// StopCompilationJobRequest generates a "aws/request.Request" representing the -// client's request for the StopCompilationJob operation. The "output" return +// ListAppsPagesWithContext same as ListAppsPages 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 *SageMaker) ListAppsPagesWithContext(ctx aws.Context, input *ListAppsInput, fn func(*ListAppsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAppsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAppsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListAppsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListAutoMLJobs = "ListAutoMLJobs" + +// ListAutoMLJobsRequest generates a "aws/request.Request" representing the +// client's request for the ListAutoMLJobs operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopCompilationJob for more information on using the StopCompilationJob +// See ListAutoMLJobs for more information on using the ListAutoMLJobs // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopCompilationJobRequest method. -// req, resp := client.StopCompilationJobRequest(params) +// // Example sending a request using the ListAutoMLJobsRequest method. +// req, resp := client.ListAutoMLJobsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopCompilationJob -func (c *SageMaker) StopCompilationJobRequest(input *StopCompilationJobInput) (req *request.Request, output *StopCompilationJobOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListAutoMLJobs +func (c *SageMaker) ListAutoMLJobsRequest(input *ListAutoMLJobsInput) (req *request.Request, output *ListAutoMLJobsOutput) { op := &request.Operation{ - Name: opStopCompilationJob, + Name: opListAutoMLJobs, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &StopCompilationJobInput{} + input = &ListAutoMLJobsInput{} } - output = &StopCompilationJobOutput{} + output = &ListAutoMLJobsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// StopCompilationJob API operation for Amazon SageMaker Service. -// -// Stops a model compilation job. -// -// To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal. This -// gracefully shuts the job down. If the job hasn't stopped, it sends the SIGKILL -// signal. +// ListAutoMLJobs API operation for Amazon SageMaker Service. // -// When it receives a StopCompilationJob request, Amazon SageMaker changes the -// CompilationJobSummary$CompilationJobStatus of the job to Stopping. After -// Amazon SageMaker stops the job, it sets the CompilationJobSummary$CompilationJobStatus -// to Stopped. +// Request a list of jobs. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation StopCompilationJob for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFound "ResourceNotFound" -// Resource being access is not found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopCompilationJob -func (c *SageMaker) StopCompilationJob(input *StopCompilationJobInput) (*StopCompilationJobOutput, error) { - req, out := c.StopCompilationJobRequest(input) +// API operation ListAutoMLJobs for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListAutoMLJobs +func (c *SageMaker) ListAutoMLJobs(input *ListAutoMLJobsInput) (*ListAutoMLJobsOutput, error) { + req, out := c.ListAutoMLJobsRequest(input) return out, req.Send() } -// StopCompilationJobWithContext is the same as StopCompilationJob with the addition of +// ListAutoMLJobsWithContext is the same as ListAutoMLJobs with the addition of // the ability to pass a context and additional request options. // -// See StopCompilationJob for details on how to use this API operation. +// See ListAutoMLJobs for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) StopCompilationJobWithContext(ctx aws.Context, input *StopCompilationJobInput, opts ...request.Option) (*StopCompilationJobOutput, error) { - req, out := c.StopCompilationJobRequest(input) +func (c *SageMaker) ListAutoMLJobsWithContext(ctx aws.Context, input *ListAutoMLJobsInput, opts ...request.Option) (*ListAutoMLJobsOutput, error) { + req, out := c.ListAutoMLJobsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopHyperParameterTuningJob = "StopHyperParameterTuningJob" +// ListAutoMLJobsPages iterates over the pages of a ListAutoMLJobs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListAutoMLJobs 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 ListAutoMLJobs operation. +// pageNum := 0 +// err := client.ListAutoMLJobsPages(params, +// func(page *sagemaker.ListAutoMLJobsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListAutoMLJobsPages(input *ListAutoMLJobsInput, fn func(*ListAutoMLJobsOutput, bool) bool) error { + return c.ListAutoMLJobsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// StopHyperParameterTuningJobRequest generates a "aws/request.Request" representing the -// client's request for the StopHyperParameterTuningJob operation. The "output" return +// ListAutoMLJobsPagesWithContext same as ListAutoMLJobsPages 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 *SageMaker) ListAutoMLJobsPagesWithContext(ctx aws.Context, input *ListAutoMLJobsInput, fn func(*ListAutoMLJobsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAutoMLJobsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAutoMLJobsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListAutoMLJobsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListCandidatesForAutoMLJob = "ListCandidatesForAutoMLJob" + +// ListCandidatesForAutoMLJobRequest generates a "aws/request.Request" representing the +// client's request for the ListCandidatesForAutoMLJob operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopHyperParameterTuningJob for more information on using the StopHyperParameterTuningJob +// See ListCandidatesForAutoMLJob for more information on using the ListCandidatesForAutoMLJob // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopHyperParameterTuningJobRequest method. -// req, resp := client.StopHyperParameterTuningJobRequest(params) +// // Example sending a request using the ListCandidatesForAutoMLJobRequest method. +// req, resp := client.ListCandidatesForAutoMLJobRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopHyperParameterTuningJob -func (c *SageMaker) StopHyperParameterTuningJobRequest(input *StopHyperParameterTuningJobInput) (req *request.Request, output *StopHyperParameterTuningJobOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListCandidatesForAutoMLJob +func (c *SageMaker) ListCandidatesForAutoMLJobRequest(input *ListCandidatesForAutoMLJobInput) (req *request.Request, output *ListCandidatesForAutoMLJobOutput) { op := &request.Operation{ - Name: opStopHyperParameterTuningJob, + Name: opListCandidatesForAutoMLJob, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &StopHyperParameterTuningJobInput{} + input = &ListCandidatesForAutoMLJobInput{} } - output = &StopHyperParameterTuningJobOutput{} + output = &ListCandidatesForAutoMLJobOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// StopHyperParameterTuningJob API operation for Amazon SageMaker Service. -// -// Stops a running hyperparameter tuning job and all running training jobs that -// the tuning job launched. +// ListCandidatesForAutoMLJob API operation for Amazon SageMaker Service. // -// All model artifacts output from the training jobs are stored in Amazon Simple -// Storage Service (Amazon S3). All data that the training jobs write to Amazon -// CloudWatch Logs are still available in CloudWatch. After the tuning job moves -// to the Stopped state, it releases all reserved resources for the tuning job. +// List the Candidates created for the 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 SageMaker Service's -// API operation StopHyperParameterTuningJob for usage and error information. +// API operation ListCandidatesForAutoMLJob for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFound "ResourceNotFound" +// Returned Error Types: +// * ResourceNotFound // Resource being access is not found. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopHyperParameterTuningJob -func (c *SageMaker) StopHyperParameterTuningJob(input *StopHyperParameterTuningJobInput) (*StopHyperParameterTuningJobOutput, error) { - req, out := c.StopHyperParameterTuningJobRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListCandidatesForAutoMLJob +func (c *SageMaker) ListCandidatesForAutoMLJob(input *ListCandidatesForAutoMLJobInput) (*ListCandidatesForAutoMLJobOutput, error) { + req, out := c.ListCandidatesForAutoMLJobRequest(input) return out, req.Send() } -// StopHyperParameterTuningJobWithContext is the same as StopHyperParameterTuningJob with the addition of +// ListCandidatesForAutoMLJobWithContext is the same as ListCandidatesForAutoMLJob with the addition of // the ability to pass a context and additional request options. // -// See StopHyperParameterTuningJob for details on how to use this API operation. +// See ListCandidatesForAutoMLJob for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) StopHyperParameterTuningJobWithContext(ctx aws.Context, input *StopHyperParameterTuningJobInput, opts ...request.Option) (*StopHyperParameterTuningJobOutput, error) { - req, out := c.StopHyperParameterTuningJobRequest(input) +func (c *SageMaker) ListCandidatesForAutoMLJobWithContext(ctx aws.Context, input *ListCandidatesForAutoMLJobInput, opts ...request.Option) (*ListCandidatesForAutoMLJobOutput, error) { + req, out := c.ListCandidatesForAutoMLJobRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopLabelingJob = "StopLabelingJob" - -// StopLabelingJobRequest generates a "aws/request.Request" representing the -// client's request for the StopLabelingJob operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. +// ListCandidatesForAutoMLJobPages iterates over the pages of a ListCandidatesForAutoMLJob operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. // -// See StopLabelingJob for more information on using the StopLabelingJob -// API call, and error handling. +// See ListCandidatesForAutoMLJob method for more information on how to use this operation. // -// 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: This operation can generate multiple requests to a service. // +// // Example iterating over at most 3 pages of a ListCandidatesForAutoMLJob operation. +// pageNum := 0 +// err := client.ListCandidatesForAutoMLJobPages(params, +// func(page *sagemaker.ListCandidatesForAutoMLJobOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) // -// // Example sending a request using the StopLabelingJobRequest method. -// req, resp := client.StopLabelingJobRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopLabelingJob -func (c *SageMaker) StopLabelingJobRequest(input *StopLabelingJobInput) (req *request.Request, output *StopLabelingJobOutput) { - op := &request.Operation{ - Name: opStopLabelingJob, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopLabelingJobInput{} - } - - output = &StopLabelingJobOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopLabelingJob API operation for Amazon SageMaker Service. -// -// Stops a running labeling job. A job that is stopped cannot be restarted. -// Any results obtained before the job is stopped are placed in the Amazon S3 -// output bucket. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon SageMaker Service's -// API operation StopLabelingJob for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFound "ResourceNotFound" -// Resource being access is not found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopLabelingJob -func (c *SageMaker) StopLabelingJob(input *StopLabelingJobInput) (*StopLabelingJobOutput, error) { - req, out := c.StopLabelingJobRequest(input) - return out, req.Send() +func (c *SageMaker) ListCandidatesForAutoMLJobPages(input *ListCandidatesForAutoMLJobInput, fn func(*ListCandidatesForAutoMLJobOutput, bool) bool) error { + return c.ListCandidatesForAutoMLJobPagesWithContext(aws.BackgroundContext(), input, fn) } -// StopLabelingJobWithContext is the same as StopLabelingJob with the addition of -// the ability to pass a context and additional request options. -// -// See StopLabelingJob for details on how to use this API operation. +// ListCandidatesForAutoMLJobPagesWithContext same as ListCandidatesForAutoMLJobPages 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 *SageMaker) StopLabelingJobWithContext(ctx aws.Context, input *StopLabelingJobInput, opts ...request.Option) (*StopLabelingJobOutput, error) { - req, out := c.StopLabelingJobRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() +func (c *SageMaker) ListCandidatesForAutoMLJobPagesWithContext(ctx aws.Context, input *ListCandidatesForAutoMLJobInput, fn func(*ListCandidatesForAutoMLJobOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListCandidatesForAutoMLJobInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListCandidatesForAutoMLJobRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListCandidatesForAutoMLJobOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() } -const opStopNotebookInstance = "StopNotebookInstance" +const opListCodeRepositories = "ListCodeRepositories" -// StopNotebookInstanceRequest generates a "aws/request.Request" representing the -// client's request for the StopNotebookInstance operation. The "output" return +// ListCodeRepositoriesRequest generates a "aws/request.Request" representing the +// client's request for the ListCodeRepositories operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopNotebookInstance for more information on using the StopNotebookInstance +// See ListCodeRepositories for more information on using the ListCodeRepositories // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopNotebookInstanceRequest method. -// req, resp := client.StopNotebookInstanceRequest(params) +// // Example sending a request using the ListCodeRepositoriesRequest method. +// req, resp := client.ListCodeRepositoriesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopNotebookInstance -func (c *SageMaker) StopNotebookInstanceRequest(input *StopNotebookInstanceInput) (req *request.Request, output *StopNotebookInstanceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListCodeRepositories +func (c *SageMaker) ListCodeRepositoriesRequest(input *ListCodeRepositoriesInput) (req *request.Request, output *ListCodeRepositoriesOutput) { op := &request.Operation{ - Name: opStopNotebookInstance, + Name: opListCodeRepositories, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &StopNotebookInstanceInput{} + input = &ListCodeRepositoriesInput{} } - output = &StopNotebookInstanceOutput{} + output = &ListCodeRepositoriesOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// StopNotebookInstance API operation for Amazon SageMaker Service. -// -// Terminates the ML compute instance. Before terminating the instance, Amazon -// SageMaker disconnects the ML storage volume from it. Amazon SageMaker preserves -// the ML storage volume. Amazon SageMaker stops charging you for the ML compute -// instance when you call StopNotebookInstance. +// ListCodeRepositories API operation for Amazon SageMaker Service. // -// To access data on the ML storage volume for a notebook instance that has -// been terminated, call the StartNotebookInstance API. StartNotebookInstance -// launches another ML compute instance, configures it, and attaches the preserved -// ML storage volume so you can continue your work. +// Gets a list of the Git repositories 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 SageMaker Service's -// API operation StopNotebookInstance for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopNotebookInstance -func (c *SageMaker) StopNotebookInstance(input *StopNotebookInstanceInput) (*StopNotebookInstanceOutput, error) { - req, out := c.StopNotebookInstanceRequest(input) +// API operation ListCodeRepositories for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListCodeRepositories +func (c *SageMaker) ListCodeRepositories(input *ListCodeRepositoriesInput) (*ListCodeRepositoriesOutput, error) { + req, out := c.ListCodeRepositoriesRequest(input) return out, req.Send() } -// StopNotebookInstanceWithContext is the same as StopNotebookInstance with the addition of +// ListCodeRepositoriesWithContext is the same as ListCodeRepositories with the addition of // the ability to pass a context and additional request options. // -// See StopNotebookInstance for details on how to use this API operation. +// See ListCodeRepositories for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) StopNotebookInstanceWithContext(ctx aws.Context, input *StopNotebookInstanceInput, opts ...request.Option) (*StopNotebookInstanceOutput, error) { - req, out := c.StopNotebookInstanceRequest(input) +func (c *SageMaker) ListCodeRepositoriesWithContext(ctx aws.Context, input *ListCodeRepositoriesInput, opts ...request.Option) (*ListCodeRepositoriesOutput, error) { + req, out := c.ListCodeRepositoriesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopTrainingJob = "StopTrainingJob" +// ListCodeRepositoriesPages iterates over the pages of a ListCodeRepositories operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListCodeRepositories 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 ListCodeRepositories operation. +// pageNum := 0 +// err := client.ListCodeRepositoriesPages(params, +// func(page *sagemaker.ListCodeRepositoriesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListCodeRepositoriesPages(input *ListCodeRepositoriesInput, fn func(*ListCodeRepositoriesOutput, bool) bool) error { + return c.ListCodeRepositoriesPagesWithContext(aws.BackgroundContext(), input, fn) +} -// StopTrainingJobRequest generates a "aws/request.Request" representing the -// client's request for the StopTrainingJob operation. The "output" return +// ListCodeRepositoriesPagesWithContext same as ListCodeRepositoriesPages 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 *SageMaker) ListCodeRepositoriesPagesWithContext(ctx aws.Context, input *ListCodeRepositoriesInput, fn func(*ListCodeRepositoriesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListCodeRepositoriesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListCodeRepositoriesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListCodeRepositoriesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListCompilationJobs = "ListCompilationJobs" + +// ListCompilationJobsRequest generates a "aws/request.Request" representing the +// client's request for the ListCompilationJobs operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopTrainingJob for more information on using the StopTrainingJob +// See ListCompilationJobs for more information on using the ListCompilationJobs // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopTrainingJobRequest method. -// req, resp := client.StopTrainingJobRequest(params) +// // Example sending a request using the ListCompilationJobsRequest method. +// req, resp := client.ListCompilationJobsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopTrainingJob -func (c *SageMaker) StopTrainingJobRequest(input *StopTrainingJobInput) (req *request.Request, output *StopTrainingJobOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListCompilationJobs +func (c *SageMaker) ListCompilationJobsRequest(input *ListCompilationJobsInput) (req *request.Request, output *ListCompilationJobsOutput) { op := &request.Operation{ - Name: opStopTrainingJob, + Name: opListCompilationJobs, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &StopTrainingJobInput{} + input = &ListCompilationJobsInput{} } - output = &StopTrainingJobOutput{} + output = &ListCompilationJobsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// StopTrainingJob API operation for Amazon SageMaker Service. +// ListCompilationJobs API operation for Amazon SageMaker Service. // -// Stops a training job. To stop a job, Amazon SageMaker sends the algorithm -// the SIGTERM signal, which delays job termination for 120 seconds. Algorithms -// might use this 120-second window to save the model artifacts, so the results -// of the training is not lost. +// Lists model compilation jobs that satisfy various filters. // -// When it receives a StopTrainingJob request, Amazon SageMaker changes the -// status of the job to Stopping. After Amazon SageMaker stops the job, it sets -// the status to Stopped. +// To create a model compilation job, use CreateCompilationJob. To get information +// about a particular model compilation job you have created, use DescribeCompilationJob. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation StopTrainingJob for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFound "ResourceNotFound" -// Resource being access is not found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopTrainingJob -func (c *SageMaker) StopTrainingJob(input *StopTrainingJobInput) (*StopTrainingJobOutput, error) { - req, out := c.StopTrainingJobRequest(input) +// API operation ListCompilationJobs for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListCompilationJobs +func (c *SageMaker) ListCompilationJobs(input *ListCompilationJobsInput) (*ListCompilationJobsOutput, error) { + req, out := c.ListCompilationJobsRequest(input) return out, req.Send() } -// StopTrainingJobWithContext is the same as StopTrainingJob with the addition of +// ListCompilationJobsWithContext is the same as ListCompilationJobs with the addition of // the ability to pass a context and additional request options. // -// See StopTrainingJob for details on how to use this API operation. +// See ListCompilationJobs for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) StopTrainingJobWithContext(ctx aws.Context, input *StopTrainingJobInput, opts ...request.Option) (*StopTrainingJobOutput, error) { - req, out := c.StopTrainingJobRequest(input) +func (c *SageMaker) ListCompilationJobsWithContext(ctx aws.Context, input *ListCompilationJobsInput, opts ...request.Option) (*ListCompilationJobsOutput, error) { + req, out := c.ListCompilationJobsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopTransformJob = "StopTransformJob" +// ListCompilationJobsPages iterates over the pages of a ListCompilationJobs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListCompilationJobs 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 ListCompilationJobs operation. +// pageNum := 0 +// err := client.ListCompilationJobsPages(params, +// func(page *sagemaker.ListCompilationJobsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListCompilationJobsPages(input *ListCompilationJobsInput, fn func(*ListCompilationJobsOutput, bool) bool) error { + return c.ListCompilationJobsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// StopTransformJobRequest generates a "aws/request.Request" representing the -// client's request for the StopTransformJob operation. The "output" return +// ListCompilationJobsPagesWithContext same as ListCompilationJobsPages 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 *SageMaker) ListCompilationJobsPagesWithContext(ctx aws.Context, input *ListCompilationJobsInput, fn func(*ListCompilationJobsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListCompilationJobsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListCompilationJobsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListCompilationJobsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListDomains = "ListDomains" + +// ListDomainsRequest generates a "aws/request.Request" representing the +// client's request for the ListDomains operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopTransformJob for more information on using the StopTransformJob +// See ListDomains for more information on using the ListDomains // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopTransformJobRequest method. -// req, resp := client.StopTransformJobRequest(params) +// // 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) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopTransformJob -func (c *SageMaker) StopTransformJobRequest(input *StopTransformJobInput) (req *request.Request, output *StopTransformJobOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListDomains +func (c *SageMaker) ListDomainsRequest(input *ListDomainsInput) (req *request.Request, output *ListDomainsOutput) { op := &request.Operation{ - Name: opStopTransformJob, + Name: opListDomains, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &StopTransformJobInput{} + input = &ListDomainsInput{} } - output = &StopTransformJobOutput{} + output = &ListDomainsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// StopTransformJob API operation for Amazon SageMaker Service. -// -// Stops a transform job. +// ListDomains API operation for Amazon SageMaker Service. // -// When Amazon SageMaker receives a StopTransformJob request, the status of -// the job changes to Stopping. After Amazon SageMaker stops the job, the status -// is set to Stopped. When you stop a transform job before it is completed, -// Amazon SageMaker doesn't store the job's output in Amazon S3. +// Lists the domains. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon SageMaker Service's -// API operation StopTransformJob for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceNotFound "ResourceNotFound" -// Resource being access is not found. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopTransformJob -func (c *SageMaker) StopTransformJob(input *StopTransformJobInput) (*StopTransformJobOutput, error) { - req, out := c.StopTransformJobRequest(input) +// API operation ListDomains for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListDomains +func (c *SageMaker) ListDomains(input *ListDomainsInput) (*ListDomainsOutput, error) { + req, out := c.ListDomainsRequest(input) return out, req.Send() } -// StopTransformJobWithContext is the same as StopTransformJob with the addition of +// ListDomainsWithContext is the same as ListDomains with the addition of // the ability to pass a context and additional request options. // -// See StopTransformJob for details on how to use this API operation. +// See ListDomains for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) StopTransformJobWithContext(ctx aws.Context, input *StopTransformJobInput, opts ...request.Option) (*StopTransformJobOutput, error) { - req, out := c.StopTransformJobRequest(input) +func (c *SageMaker) ListDomainsWithContext(ctx aws.Context, input *ListDomainsInput, opts ...request.Option) (*ListDomainsOutput, error) { + req, out := c.ListDomainsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateCodeRepository = "UpdateCodeRepository" +// 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 *sagemaker.ListDomainsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListDomainsPages(input *ListDomainsInput, fn func(*ListDomainsOutput, bool) bool) error { + return c.ListDomainsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// UpdateCodeRepositoryRequest generates a "aws/request.Request" representing the -// client's request for the UpdateCodeRepository operation. The "output" return +// ListDomainsPagesWithContext same as ListDomainsPages 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 *SageMaker) ListDomainsPagesWithContext(ctx aws.Context, input *ListDomainsInput, fn func(*ListDomainsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListDomainsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListDomainsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListDomainsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListEndpointConfigs = "ListEndpointConfigs" + +// ListEndpointConfigsRequest generates a "aws/request.Request" representing the +// client's request for the ListEndpointConfigs operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateCodeRepository for more information on using the UpdateCodeRepository +// See ListEndpointConfigs for more information on using the ListEndpointConfigs // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateCodeRepositoryRequest method. -// req, resp := client.UpdateCodeRepositoryRequest(params) +// // Example sending a request using the ListEndpointConfigsRequest method. +// req, resp := client.ListEndpointConfigsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateCodeRepository -func (c *SageMaker) UpdateCodeRepositoryRequest(input *UpdateCodeRepositoryInput) (req *request.Request, output *UpdateCodeRepositoryOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListEndpointConfigs +func (c *SageMaker) ListEndpointConfigsRequest(input *ListEndpointConfigsInput) (req *request.Request, output *ListEndpointConfigsOutput) { op := &request.Operation{ - Name: opUpdateCodeRepository, + Name: opListEndpointConfigs, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &UpdateCodeRepositoryInput{} + input = &ListEndpointConfigsInput{} } - output = &UpdateCodeRepositoryOutput{} + output = &ListEndpointConfigsOutput{} req = c.newRequest(op, input, output) return } -// UpdateCodeRepository API operation for Amazon SageMaker Service. +// ListEndpointConfigs API operation for Amazon SageMaker Service. // -// Updates the specified Git repository with the specified values. +// Lists endpoint 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 Amazon SageMaker Service's -// API operation UpdateCodeRepository for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateCodeRepository -func (c *SageMaker) UpdateCodeRepository(input *UpdateCodeRepositoryInput) (*UpdateCodeRepositoryOutput, error) { - req, out := c.UpdateCodeRepositoryRequest(input) +// API operation ListEndpointConfigs for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListEndpointConfigs +func (c *SageMaker) ListEndpointConfigs(input *ListEndpointConfigsInput) (*ListEndpointConfigsOutput, error) { + req, out := c.ListEndpointConfigsRequest(input) return out, req.Send() } -// UpdateCodeRepositoryWithContext is the same as UpdateCodeRepository with the addition of +// ListEndpointConfigsWithContext is the same as ListEndpointConfigs with the addition of // the ability to pass a context and additional request options. // -// See UpdateCodeRepository for details on how to use this API operation. +// See ListEndpointConfigs for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) UpdateCodeRepositoryWithContext(ctx aws.Context, input *UpdateCodeRepositoryInput, opts ...request.Option) (*UpdateCodeRepositoryOutput, error) { - req, out := c.UpdateCodeRepositoryRequest(input) +func (c *SageMaker) ListEndpointConfigsWithContext(ctx aws.Context, input *ListEndpointConfigsInput, opts ...request.Option) (*ListEndpointConfigsOutput, error) { + req, out := c.ListEndpointConfigsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateEndpoint = "UpdateEndpoint" +// ListEndpointConfigsPages iterates over the pages of a ListEndpointConfigs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListEndpointConfigs 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 ListEndpointConfigs operation. +// pageNum := 0 +// err := client.ListEndpointConfigsPages(params, +// func(page *sagemaker.ListEndpointConfigsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListEndpointConfigsPages(input *ListEndpointConfigsInput, fn func(*ListEndpointConfigsOutput, bool) bool) error { + return c.ListEndpointConfigsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// UpdateEndpointRequest generates a "aws/request.Request" representing the -// client's request for the UpdateEndpoint operation. The "output" return +// ListEndpointConfigsPagesWithContext same as ListEndpointConfigsPages 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 *SageMaker) ListEndpointConfigsPagesWithContext(ctx aws.Context, input *ListEndpointConfigsInput, fn func(*ListEndpointConfigsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListEndpointConfigsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListEndpointConfigsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListEndpointConfigsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListEndpoints = "ListEndpoints" + +// ListEndpointsRequest generates a "aws/request.Request" representing the +// client's request for the ListEndpoints operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateEndpoint for more information on using the UpdateEndpoint +// See ListEndpoints for more information on using the ListEndpoints // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateEndpointRequest method. -// req, resp := client.UpdateEndpointRequest(params) +// // Example sending a request using the ListEndpointsRequest method. +// req, resp := client.ListEndpointsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateEndpoint -func (c *SageMaker) UpdateEndpointRequest(input *UpdateEndpointInput) (req *request.Request, output *UpdateEndpointOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListEndpoints +func (c *SageMaker) ListEndpointsRequest(input *ListEndpointsInput) (req *request.Request, output *ListEndpointsOutput) { op := &request.Operation{ - Name: opUpdateEndpoint, + Name: opListEndpoints, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &UpdateEndpointInput{} + input = &ListEndpointsInput{} } - output = &UpdateEndpointOutput{} + output = &ListEndpointsOutput{} req = c.newRequest(op, input, output) return } -// UpdateEndpoint API operation for Amazon SageMaker Service. -// -// Deploys the new EndpointConfig specified in the request, switches to using -// newly created endpoint, and then deletes resources provisioned for the endpoint -// using the previous EndpointConfig (there is no availability loss). -// -// When Amazon SageMaker receives the request, it sets the endpoint status to -// Updating. After updating the endpoint, it sets the status to InService. To -// check the status of an endpoint, use the DescribeEndpoint (https://docs.aws.amazon.com/sagemaker/latest/dg/API_DescribeEndpoint.html) -// API. +// ListEndpoints API operation for Amazon SageMaker Service. // -// You must not delete an EndpointConfig in use by an endpoint that is live -// or while the UpdateEndpoint or CreateEndpoint operations are being performed -// on the endpoint. To update an endpoint, you must create a new EndpointConfig. +// Lists 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 SageMaker Service's -// API operation UpdateEndpoint for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" -// You have exceeded an Amazon SageMaker resource limit. For example, you might -// have too many training jobs created. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateEndpoint -func (c *SageMaker) UpdateEndpoint(input *UpdateEndpointInput) (*UpdateEndpointOutput, error) { - req, out := c.UpdateEndpointRequest(input) +// API operation ListEndpoints for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListEndpoints +func (c *SageMaker) ListEndpoints(input *ListEndpointsInput) (*ListEndpointsOutput, error) { + req, out := c.ListEndpointsRequest(input) return out, req.Send() } -// UpdateEndpointWithContext is the same as UpdateEndpoint with the addition of +// ListEndpointsWithContext is the same as ListEndpoints with the addition of // the ability to pass a context and additional request options. // -// See UpdateEndpoint for details on how to use this API operation. +// See ListEndpoints for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) UpdateEndpointWithContext(ctx aws.Context, input *UpdateEndpointInput, opts ...request.Option) (*UpdateEndpointOutput, error) { - req, out := c.UpdateEndpointRequest(input) +func (c *SageMaker) ListEndpointsWithContext(ctx aws.Context, input *ListEndpointsInput, opts ...request.Option) (*ListEndpointsOutput, error) { + req, out := c.ListEndpointsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateEndpointWeightsAndCapacities = "UpdateEndpointWeightsAndCapacities" +// ListEndpointsPages iterates over the pages of a ListEndpoints operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListEndpoints 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 ListEndpoints operation. +// pageNum := 0 +// err := client.ListEndpointsPages(params, +// func(page *sagemaker.ListEndpointsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListEndpointsPages(input *ListEndpointsInput, fn func(*ListEndpointsOutput, bool) bool) error { + return c.ListEndpointsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// UpdateEndpointWeightsAndCapacitiesRequest generates a "aws/request.Request" representing the -// client's request for the UpdateEndpointWeightsAndCapacities operation. The "output" return +// ListEndpointsPagesWithContext same as ListEndpointsPages 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 *SageMaker) ListEndpointsPagesWithContext(ctx aws.Context, input *ListEndpointsInput, fn func(*ListEndpointsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListEndpointsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListEndpointsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListEndpointsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListExperiments = "ListExperiments" + +// ListExperimentsRequest generates a "aws/request.Request" representing the +// client's request for the ListExperiments operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateEndpointWeightsAndCapacities for more information on using the UpdateEndpointWeightsAndCapacities +// See ListExperiments for more information on using the ListExperiments // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateEndpointWeightsAndCapacitiesRequest method. -// req, resp := client.UpdateEndpointWeightsAndCapacitiesRequest(params) +// // Example sending a request using the ListExperimentsRequest method. +// req, resp := client.ListExperimentsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateEndpointWeightsAndCapacities -func (c *SageMaker) UpdateEndpointWeightsAndCapacitiesRequest(input *UpdateEndpointWeightsAndCapacitiesInput) (req *request.Request, output *UpdateEndpointWeightsAndCapacitiesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListExperiments +func (c *SageMaker) ListExperimentsRequest(input *ListExperimentsInput) (req *request.Request, output *ListExperimentsOutput) { op := &request.Operation{ - Name: opUpdateEndpointWeightsAndCapacities, + Name: opListExperiments, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &UpdateEndpointWeightsAndCapacitiesInput{} + input = &ListExperimentsInput{} } - output = &UpdateEndpointWeightsAndCapacitiesOutput{} + output = &ListExperimentsOutput{} req = c.newRequest(op, input, output) return } -// UpdateEndpointWeightsAndCapacities API operation for Amazon SageMaker Service. +// ListExperiments API operation for Amazon SageMaker Service. // -// Updates variant weight of one or more variants associated with an existing -// endpoint, or capacity of one variant associated with an existing endpoint. -// When it receives the request, Amazon SageMaker sets the endpoint status to -// Updating. After updating the endpoint, it sets the status to InService. To -// check the status of an endpoint, use the DescribeEndpoint (https://docs.aws.amazon.com/sagemaker/latest/dg/API_DescribeEndpoint.html) -// API. +// Lists all the experiments in your account. The list can be filtered to show +// only experiments that were created in a specific time range. The list can +// be sorted by experiment name or creation 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 SageMaker Service's -// API operation UpdateEndpointWeightsAndCapacities for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" -// You have exceeded an Amazon SageMaker resource limit. For example, you might -// have too many training jobs created. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateEndpointWeightsAndCapacities -func (c *SageMaker) UpdateEndpointWeightsAndCapacities(input *UpdateEndpointWeightsAndCapacitiesInput) (*UpdateEndpointWeightsAndCapacitiesOutput, error) { - req, out := c.UpdateEndpointWeightsAndCapacitiesRequest(input) +// API operation ListExperiments for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListExperiments +func (c *SageMaker) ListExperiments(input *ListExperimentsInput) (*ListExperimentsOutput, error) { + req, out := c.ListExperimentsRequest(input) return out, req.Send() } -// UpdateEndpointWeightsAndCapacitiesWithContext is the same as UpdateEndpointWeightsAndCapacities with the addition of +// ListExperimentsWithContext is the same as ListExperiments with the addition of // the ability to pass a context and additional request options. // -// See UpdateEndpointWeightsAndCapacities for details on how to use this API operation. +// See ListExperiments for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) UpdateEndpointWeightsAndCapacitiesWithContext(ctx aws.Context, input *UpdateEndpointWeightsAndCapacitiesInput, opts ...request.Option) (*UpdateEndpointWeightsAndCapacitiesOutput, error) { - req, out := c.UpdateEndpointWeightsAndCapacitiesRequest(input) +func (c *SageMaker) ListExperimentsWithContext(ctx aws.Context, input *ListExperimentsInput, opts ...request.Option) (*ListExperimentsOutput, error) { + req, out := c.ListExperimentsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateNotebookInstance = "UpdateNotebookInstance" +// ListExperimentsPages iterates over the pages of a ListExperiments operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListExperiments 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 ListExperiments operation. +// pageNum := 0 +// err := client.ListExperimentsPages(params, +// func(page *sagemaker.ListExperimentsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListExperimentsPages(input *ListExperimentsInput, fn func(*ListExperimentsOutput, bool) bool) error { + return c.ListExperimentsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// UpdateNotebookInstanceRequest generates a "aws/request.Request" representing the -// client's request for the UpdateNotebookInstance operation. The "output" return +// ListExperimentsPagesWithContext same as ListExperimentsPages 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 *SageMaker) ListExperimentsPagesWithContext(ctx aws.Context, input *ListExperimentsInput, fn func(*ListExperimentsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListExperimentsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListExperimentsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListExperimentsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListFlowDefinitions = "ListFlowDefinitions" + +// ListFlowDefinitionsRequest generates a "aws/request.Request" representing the +// client's request for the ListFlowDefinitions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateNotebookInstance for more information on using the UpdateNotebookInstance +// See ListFlowDefinitions for more information on using the ListFlowDefinitions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateNotebookInstanceRequest method. -// req, resp := client.UpdateNotebookInstanceRequest(params) +// // Example sending a request using the ListFlowDefinitionsRequest method. +// req, resp := client.ListFlowDefinitionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateNotebookInstance -func (c *SageMaker) UpdateNotebookInstanceRequest(input *UpdateNotebookInstanceInput) (req *request.Request, output *UpdateNotebookInstanceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListFlowDefinitions +func (c *SageMaker) ListFlowDefinitionsRequest(input *ListFlowDefinitionsInput) (req *request.Request, output *ListFlowDefinitionsOutput) { op := &request.Operation{ - Name: opUpdateNotebookInstance, + Name: opListFlowDefinitions, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &UpdateNotebookInstanceInput{} + input = &ListFlowDefinitionsInput{} } - output = &UpdateNotebookInstanceOutput{} + output = &ListFlowDefinitionsOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateNotebookInstance API operation for Amazon SageMaker Service. +// ListFlowDefinitions API operation for Amazon SageMaker Service. // -// Updates a notebook instance. NotebookInstance updates include upgrading or -// downgrading the ML compute instance used for your notebook instance to accommodate -// changes in your workload requirements. +// Returns information about the flow definitions 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 SageMaker Service's -// API operation UpdateNotebookInstance for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" -// You have exceeded an Amazon SageMaker resource limit. For example, you might -// have too many training jobs created. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateNotebookInstance -func (c *SageMaker) UpdateNotebookInstance(input *UpdateNotebookInstanceInput) (*UpdateNotebookInstanceOutput, error) { - req, out := c.UpdateNotebookInstanceRequest(input) +// API operation ListFlowDefinitions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListFlowDefinitions +func (c *SageMaker) ListFlowDefinitions(input *ListFlowDefinitionsInput) (*ListFlowDefinitionsOutput, error) { + req, out := c.ListFlowDefinitionsRequest(input) return out, req.Send() } -// UpdateNotebookInstanceWithContext is the same as UpdateNotebookInstance with the addition of +// ListFlowDefinitionsWithContext is the same as ListFlowDefinitions with the addition of // the ability to pass a context and additional request options. // -// See UpdateNotebookInstance for details on how to use this API operation. +// See ListFlowDefinitions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) UpdateNotebookInstanceWithContext(ctx aws.Context, input *UpdateNotebookInstanceInput, opts ...request.Option) (*UpdateNotebookInstanceOutput, error) { - req, out := c.UpdateNotebookInstanceRequest(input) +func (c *SageMaker) ListFlowDefinitionsWithContext(ctx aws.Context, input *ListFlowDefinitionsInput, opts ...request.Option) (*ListFlowDefinitionsOutput, error) { + req, out := c.ListFlowDefinitionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateNotebookInstanceLifecycleConfig = "UpdateNotebookInstanceLifecycleConfig" +// ListFlowDefinitionsPages iterates over the pages of a ListFlowDefinitions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListFlowDefinitions 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 ListFlowDefinitions operation. +// pageNum := 0 +// err := client.ListFlowDefinitionsPages(params, +// func(page *sagemaker.ListFlowDefinitionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListFlowDefinitionsPages(input *ListFlowDefinitionsInput, fn func(*ListFlowDefinitionsOutput, bool) bool) error { + return c.ListFlowDefinitionsPagesWithContext(aws.BackgroundContext(), input, fn) +} -// UpdateNotebookInstanceLifecycleConfigRequest generates a "aws/request.Request" representing the -// client's request for the UpdateNotebookInstanceLifecycleConfig operation. The "output" return +// ListFlowDefinitionsPagesWithContext same as ListFlowDefinitionsPages 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 *SageMaker) ListFlowDefinitionsPagesWithContext(ctx aws.Context, input *ListFlowDefinitionsInput, fn func(*ListFlowDefinitionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListFlowDefinitionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListFlowDefinitionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListFlowDefinitionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListHumanTaskUis = "ListHumanTaskUis" + +// ListHumanTaskUisRequest generates a "aws/request.Request" representing the +// client's request for the ListHumanTaskUis operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateNotebookInstanceLifecycleConfig for more information on using the UpdateNotebookInstanceLifecycleConfig +// See ListHumanTaskUis for more information on using the ListHumanTaskUis // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateNotebookInstanceLifecycleConfigRequest method. -// req, resp := client.UpdateNotebookInstanceLifecycleConfigRequest(params) +// // Example sending a request using the ListHumanTaskUisRequest method. +// req, resp := client.ListHumanTaskUisRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateNotebookInstanceLifecycleConfig -func (c *SageMaker) UpdateNotebookInstanceLifecycleConfigRequest(input *UpdateNotebookInstanceLifecycleConfigInput) (req *request.Request, output *UpdateNotebookInstanceLifecycleConfigOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListHumanTaskUis +func (c *SageMaker) ListHumanTaskUisRequest(input *ListHumanTaskUisInput) (req *request.Request, output *ListHumanTaskUisOutput) { op := &request.Operation{ - Name: opUpdateNotebookInstanceLifecycleConfig, + Name: opListHumanTaskUis, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &UpdateNotebookInstanceLifecycleConfigInput{} + input = &ListHumanTaskUisInput{} } - output = &UpdateNotebookInstanceLifecycleConfigOutput{} + output = &ListHumanTaskUisOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateNotebookInstanceLifecycleConfig API operation for Amazon SageMaker Service. +// ListHumanTaskUis API operation for Amazon SageMaker Service. // -// Updates a notebook instance lifecycle configuration created with the CreateNotebookInstanceLifecycleConfig -// API. +// Returns information about the human task user interfaces 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 SageMaker Service's -// API operation UpdateNotebookInstanceLifecycleConfig for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" -// You have exceeded an Amazon SageMaker resource limit. For example, you might -// have too many training jobs created. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateNotebookInstanceLifecycleConfig -func (c *SageMaker) UpdateNotebookInstanceLifecycleConfig(input *UpdateNotebookInstanceLifecycleConfigInput) (*UpdateNotebookInstanceLifecycleConfigOutput, error) { - req, out := c.UpdateNotebookInstanceLifecycleConfigRequest(input) +// API operation ListHumanTaskUis for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListHumanTaskUis +func (c *SageMaker) ListHumanTaskUis(input *ListHumanTaskUisInput) (*ListHumanTaskUisOutput, error) { + req, out := c.ListHumanTaskUisRequest(input) return out, req.Send() } -// UpdateNotebookInstanceLifecycleConfigWithContext is the same as UpdateNotebookInstanceLifecycleConfig with the addition of +// ListHumanTaskUisWithContext is the same as ListHumanTaskUis with the addition of // the ability to pass a context and additional request options. // -// See UpdateNotebookInstanceLifecycleConfig for details on how to use this API operation. +// See ListHumanTaskUis for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) UpdateNotebookInstanceLifecycleConfigWithContext(ctx aws.Context, input *UpdateNotebookInstanceLifecycleConfigInput, opts ...request.Option) (*UpdateNotebookInstanceLifecycleConfigOutput, error) { - req, out := c.UpdateNotebookInstanceLifecycleConfigRequest(input) +func (c *SageMaker) ListHumanTaskUisWithContext(ctx aws.Context, input *ListHumanTaskUisInput, opts ...request.Option) (*ListHumanTaskUisOutput, error) { + req, out := c.ListHumanTaskUisRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateWorkteam = "UpdateWorkteam" +// ListHumanTaskUisPages iterates over the pages of a ListHumanTaskUis operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListHumanTaskUis 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 ListHumanTaskUis operation. +// pageNum := 0 +// err := client.ListHumanTaskUisPages(params, +// func(page *sagemaker.ListHumanTaskUisOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListHumanTaskUisPages(input *ListHumanTaskUisInput, fn func(*ListHumanTaskUisOutput, bool) bool) error { + return c.ListHumanTaskUisPagesWithContext(aws.BackgroundContext(), input, fn) +} -// UpdateWorkteamRequest generates a "aws/request.Request" representing the -// client's request for the UpdateWorkteam operation. The "output" return +// ListHumanTaskUisPagesWithContext same as ListHumanTaskUisPages 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 *SageMaker) ListHumanTaskUisPagesWithContext(ctx aws.Context, input *ListHumanTaskUisInput, fn func(*ListHumanTaskUisOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListHumanTaskUisInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListHumanTaskUisRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListHumanTaskUisOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListHyperParameterTuningJobs = "ListHyperParameterTuningJobs" + +// ListHyperParameterTuningJobsRequest generates a "aws/request.Request" representing the +// client's request for the ListHyperParameterTuningJobs operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateWorkteam for more information on using the UpdateWorkteam +// See ListHyperParameterTuningJobs for more information on using the ListHyperParameterTuningJobs // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateWorkteamRequest method. -// req, resp := client.UpdateWorkteamRequest(params) +// // Example sending a request using the ListHyperParameterTuningJobsRequest method. +// req, resp := client.ListHyperParameterTuningJobsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateWorkteam -func (c *SageMaker) UpdateWorkteamRequest(input *UpdateWorkteamInput) (req *request.Request, output *UpdateWorkteamOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListHyperParameterTuningJobs +func (c *SageMaker) ListHyperParameterTuningJobsRequest(input *ListHyperParameterTuningJobsInput) (req *request.Request, output *ListHyperParameterTuningJobsOutput) { op := &request.Operation{ - Name: opUpdateWorkteam, + Name: opListHyperParameterTuningJobs, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { - input = &UpdateWorkteamInput{} + input = &ListHyperParameterTuningJobsInput{} } - output = &UpdateWorkteamOutput{} + output = &ListHyperParameterTuningJobsOutput{} req = c.newRequest(op, input, output) return } -// UpdateWorkteam API operation for Amazon SageMaker Service. +// ListHyperParameterTuningJobs API operation for Amazon SageMaker Service. // -// Updates an existing work team with new member definitions or description. +// Gets a list of HyperParameterTuningJobSummary objects that describe the hyperparameter +// tuning jobs launched 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 SageMaker Service's -// API operation UpdateWorkteam for usage and error information. -// -// Returned Error Codes: -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" -// You have exceeded an Amazon SageMaker resource limit. For example, you might -// have too many training jobs created. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateWorkteam -func (c *SageMaker) UpdateWorkteam(input *UpdateWorkteamInput) (*UpdateWorkteamOutput, error) { - req, out := c.UpdateWorkteamRequest(input) +// API operation ListHyperParameterTuningJobs for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListHyperParameterTuningJobs +func (c *SageMaker) ListHyperParameterTuningJobs(input *ListHyperParameterTuningJobsInput) (*ListHyperParameterTuningJobsOutput, error) { + req, out := c.ListHyperParameterTuningJobsRequest(input) return out, req.Send() } -// UpdateWorkteamWithContext is the same as UpdateWorkteam with the addition of +// ListHyperParameterTuningJobsWithContext is the same as ListHyperParameterTuningJobs with the addition of // the ability to pass a context and additional request options. // -// See UpdateWorkteam for details on how to use this API operation. +// See ListHyperParameterTuningJobs for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *SageMaker) UpdateWorkteamWithContext(ctx aws.Context, input *UpdateWorkteamInput, opts ...request.Option) (*UpdateWorkteamOutput, error) { - req, out := c.UpdateWorkteamRequest(input) +func (c *SageMaker) ListHyperParameterTuningJobsWithContext(ctx aws.Context, input *ListHyperParameterTuningJobsInput, opts ...request.Option) (*ListHyperParameterTuningJobsOutput, error) { + req, out := c.ListHyperParameterTuningJobsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -type AddTagsInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource that you want to tag. - // - // ResourceArn is a required field - ResourceArn *string `type:"string" required:"true"` - - // An array of Tag objects. Each tag is a key-value pair. Only the key parameter - // is required. If you don't specify a value, Amazon SageMaker sets the value - // to an empty string. - // - // 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() +// ListHyperParameterTuningJobsPages iterates over the pages of a ListHyperParameterTuningJobs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListHyperParameterTuningJobs 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 ListHyperParameterTuningJobs operation. +// pageNum := 0 +// err := client.ListHyperParameterTuningJobsPages(params, +// func(page *sagemaker.ListHyperParameterTuningJobsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListHyperParameterTuningJobsPages(input *ListHyperParameterTuningJobsInput, fn func(*ListHyperParameterTuningJobsOutput, bool) bool) error { + return c.ListHyperParameterTuningJobsPagesWithContext(aws.BackgroundContext(), input, fn) } -// 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.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - 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)) +// ListHyperParameterTuningJobsPagesWithContext same as ListHyperParameterTuningJobsPages 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 *SageMaker) ListHyperParameterTuningJobsPagesWithContext(ctx aws.Context, input *ListHyperParameterTuningJobsInput, fn func(*ListHyperParameterTuningJobsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListHyperParameterTuningJobsInput + if input != nil { + tmp := *input + inCpy = &tmp } - } + req, _ := c.ListHyperParameterTuningJobsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, } - if invalidParams.Len() > 0 { - return invalidParams + for p.Next() { + if !fn(p.Page().(*ListHyperParameterTuningJobsOutput), !p.HasNextPage()) { + break + } } - return nil -} -// SetResourceArn sets the ResourceArn field's value. -func (s *AddTagsInput) SetResourceArn(v string) *AddTagsInput { - s.ResourceArn = &v - return s + return p.Err() } -// SetTags sets the Tags field's value. -func (s *AddTagsInput) SetTags(v []*Tag) *AddTagsInput { - s.Tags = v - return s -} +const opListLabelingJobs = "ListLabelingJobs" -type AddTagsOutput struct { - _ struct{} `type:"structure"` +// ListLabelingJobsRequest generates a "aws/request.Request" representing the +// client's request for the ListLabelingJobs operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListLabelingJobs for more information on using the ListLabelingJobs +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListLabelingJobsRequest method. +// req, resp := client.ListLabelingJobsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListLabelingJobs +func (c *SageMaker) ListLabelingJobsRequest(input *ListLabelingJobsInput) (req *request.Request, output *ListLabelingJobsOutput) { + op := &request.Operation{ + Name: opListLabelingJobs, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } - // A list of tags associated with the Amazon SageMaker resource. - Tags []*Tag `type:"list"` -} + if input == nil { + input = &ListLabelingJobsInput{} + } -// String returns the string representation -func (s AddTagsOutput) String() string { - return awsutil.Prettify(s) + output = &ListLabelingJobsOutput{} + req = c.newRequest(op, input, output) + return } -// GoString returns the string representation -func (s AddTagsOutput) GoString() string { - return s.String() +// ListLabelingJobs API operation for Amazon SageMaker Service. +// +// Gets a list of labeling jobs. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation ListLabelingJobs for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListLabelingJobs +func (c *SageMaker) ListLabelingJobs(input *ListLabelingJobsInput) (*ListLabelingJobsOutput, error) { + req, out := c.ListLabelingJobsRequest(input) + return out, req.Send() } -// SetTags sets the Tags field's value. -func (s *AddTagsOutput) SetTags(v []*Tag) *AddTagsOutput { - s.Tags = v - return s +// ListLabelingJobsWithContext is the same as ListLabelingJobs with the addition of +// the ability to pass a context and additional request options. +// +// See ListLabelingJobs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListLabelingJobsWithContext(ctx aws.Context, input *ListLabelingJobsInput, opts ...request.Option) (*ListLabelingJobsOutput, error) { + req, out := c.ListLabelingJobsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -// Specifies the training algorithm to use in a CreateTrainingJob (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateTrainingJob.html) -// request. +// ListLabelingJobsPages iterates over the pages of a ListLabelingJobs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. // -// For more information about algorithms provided by Amazon SageMaker, see Algorithms -// (https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html). For information -// about using your own algorithms, see Using Your Own Algorithms with Amazon -// SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html). -type AlgorithmSpecification struct { - _ struct{} `type:"structure"` +// See ListLabelingJobs 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 ListLabelingJobs operation. +// pageNum := 0 +// err := client.ListLabelingJobsPages(params, +// func(page *sagemaker.ListLabelingJobsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListLabelingJobsPages(input *ListLabelingJobsInput, fn func(*ListLabelingJobsOutput, bool) bool) error { + return c.ListLabelingJobsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListLabelingJobsPagesWithContext same as ListLabelingJobsPages 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 *SageMaker) ListLabelingJobsPagesWithContext(ctx aws.Context, input *ListLabelingJobsInput, fn func(*ListLabelingJobsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListLabelingJobsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListLabelingJobsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListLabelingJobsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListLabelingJobsForWorkteam = "ListLabelingJobsForWorkteam" + +// ListLabelingJobsForWorkteamRequest generates a "aws/request.Request" representing the +// client's request for the ListLabelingJobsForWorkteam operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListLabelingJobsForWorkteam for more information on using the ListLabelingJobsForWorkteam +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListLabelingJobsForWorkteamRequest method. +// req, resp := client.ListLabelingJobsForWorkteamRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListLabelingJobsForWorkteam +func (c *SageMaker) ListLabelingJobsForWorkteamRequest(input *ListLabelingJobsForWorkteamInput) (req *request.Request, output *ListLabelingJobsForWorkteamOutput) { + op := &request.Operation{ + Name: opListLabelingJobsForWorkteam, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListLabelingJobsForWorkteamInput{} + } + + output = &ListLabelingJobsForWorkteamOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListLabelingJobsForWorkteam API operation for Amazon SageMaker Service. +// +// Gets a list of labeling jobs assigned to a specified work team. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation ListLabelingJobsForWorkteam for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListLabelingJobsForWorkteam +func (c *SageMaker) ListLabelingJobsForWorkteam(input *ListLabelingJobsForWorkteamInput) (*ListLabelingJobsForWorkteamOutput, error) { + req, out := c.ListLabelingJobsForWorkteamRequest(input) + return out, req.Send() +} + +// ListLabelingJobsForWorkteamWithContext is the same as ListLabelingJobsForWorkteam with the addition of +// the ability to pass a context and additional request options. +// +// See ListLabelingJobsForWorkteam for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListLabelingJobsForWorkteamWithContext(ctx aws.Context, input *ListLabelingJobsForWorkteamInput, opts ...request.Option) (*ListLabelingJobsForWorkteamOutput, error) { + req, out := c.ListLabelingJobsForWorkteamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListLabelingJobsForWorkteamPages iterates over the pages of a ListLabelingJobsForWorkteam operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListLabelingJobsForWorkteam 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 ListLabelingJobsForWorkteam operation. +// pageNum := 0 +// err := client.ListLabelingJobsForWorkteamPages(params, +// func(page *sagemaker.ListLabelingJobsForWorkteamOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListLabelingJobsForWorkteamPages(input *ListLabelingJobsForWorkteamInput, fn func(*ListLabelingJobsForWorkteamOutput, bool) bool) error { + return c.ListLabelingJobsForWorkteamPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListLabelingJobsForWorkteamPagesWithContext same as ListLabelingJobsForWorkteamPages 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 *SageMaker) ListLabelingJobsForWorkteamPagesWithContext(ctx aws.Context, input *ListLabelingJobsForWorkteamInput, fn func(*ListLabelingJobsForWorkteamOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListLabelingJobsForWorkteamInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListLabelingJobsForWorkteamRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListLabelingJobsForWorkteamOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListModelPackages = "ListModelPackages" + +// ListModelPackagesRequest generates a "aws/request.Request" representing the +// client's request for the ListModelPackages operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListModelPackages for more information on using the ListModelPackages +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListModelPackagesRequest method. +// req, resp := client.ListModelPackagesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListModelPackages +func (c *SageMaker) ListModelPackagesRequest(input *ListModelPackagesInput) (req *request.Request, output *ListModelPackagesOutput) { + op := &request.Operation{ + Name: opListModelPackages, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListModelPackagesInput{} + } + + output = &ListModelPackagesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListModelPackages API operation for Amazon SageMaker Service. +// +// Lists the model packages that have been 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 SageMaker Service's +// API operation ListModelPackages for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListModelPackages +func (c *SageMaker) ListModelPackages(input *ListModelPackagesInput) (*ListModelPackagesOutput, error) { + req, out := c.ListModelPackagesRequest(input) + return out, req.Send() +} + +// ListModelPackagesWithContext is the same as ListModelPackages with the addition of +// the ability to pass a context and additional request options. +// +// See ListModelPackages for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListModelPackagesWithContext(ctx aws.Context, input *ListModelPackagesInput, opts ...request.Option) (*ListModelPackagesOutput, error) { + req, out := c.ListModelPackagesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListModelPackagesPages iterates over the pages of a ListModelPackages operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListModelPackages 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 ListModelPackages operation. +// pageNum := 0 +// err := client.ListModelPackagesPages(params, +// func(page *sagemaker.ListModelPackagesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListModelPackagesPages(input *ListModelPackagesInput, fn func(*ListModelPackagesOutput, bool) bool) error { + return c.ListModelPackagesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListModelPackagesPagesWithContext same as ListModelPackagesPages 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 *SageMaker) ListModelPackagesPagesWithContext(ctx aws.Context, input *ListModelPackagesInput, fn func(*ListModelPackagesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListModelPackagesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListModelPackagesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListModelPackagesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListModels = "ListModels" + +// ListModelsRequest generates a "aws/request.Request" representing the +// client's request for the ListModels operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListModels for more information on using the ListModels +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListModelsRequest method. +// req, resp := client.ListModelsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListModels +func (c *SageMaker) ListModelsRequest(input *ListModelsInput) (req *request.Request, output *ListModelsOutput) { + op := &request.Operation{ + Name: opListModels, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListModelsInput{} + } + + output = &ListModelsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListModels API operation for Amazon SageMaker Service. +// +// Lists models created with the CreateModel (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateModel.html) +// 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 SageMaker Service's +// API operation ListModels for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListModels +func (c *SageMaker) ListModels(input *ListModelsInput) (*ListModelsOutput, error) { + req, out := c.ListModelsRequest(input) + return out, req.Send() +} + +// ListModelsWithContext is the same as ListModels with the addition of +// the ability to pass a context and additional request options. +// +// See ListModels for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListModelsWithContext(ctx aws.Context, input *ListModelsInput, opts ...request.Option) (*ListModelsOutput, error) { + req, out := c.ListModelsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListModelsPages iterates over the pages of a ListModels operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListModels 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 ListModels operation. +// pageNum := 0 +// err := client.ListModelsPages(params, +// func(page *sagemaker.ListModelsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListModelsPages(input *ListModelsInput, fn func(*ListModelsOutput, bool) bool) error { + return c.ListModelsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListModelsPagesWithContext same as ListModelsPages 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 *SageMaker) ListModelsPagesWithContext(ctx aws.Context, input *ListModelsInput, fn func(*ListModelsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListModelsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListModelsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListModelsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListMonitoringExecutions = "ListMonitoringExecutions" + +// ListMonitoringExecutionsRequest generates a "aws/request.Request" representing the +// client's request for the ListMonitoringExecutions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListMonitoringExecutions for more information on using the ListMonitoringExecutions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListMonitoringExecutionsRequest method. +// req, resp := client.ListMonitoringExecutionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListMonitoringExecutions +func (c *SageMaker) ListMonitoringExecutionsRequest(input *ListMonitoringExecutionsInput) (req *request.Request, output *ListMonitoringExecutionsOutput) { + op := &request.Operation{ + Name: opListMonitoringExecutions, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListMonitoringExecutionsInput{} + } + + output = &ListMonitoringExecutionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListMonitoringExecutions API operation for Amazon SageMaker Service. +// +// Returns list of all monitoring job 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 SageMaker Service's +// API operation ListMonitoringExecutions for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListMonitoringExecutions +func (c *SageMaker) ListMonitoringExecutions(input *ListMonitoringExecutionsInput) (*ListMonitoringExecutionsOutput, error) { + req, out := c.ListMonitoringExecutionsRequest(input) + return out, req.Send() +} + +// ListMonitoringExecutionsWithContext is the same as ListMonitoringExecutions with the addition of +// the ability to pass a context and additional request options. +// +// See ListMonitoringExecutions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListMonitoringExecutionsWithContext(ctx aws.Context, input *ListMonitoringExecutionsInput, opts ...request.Option) (*ListMonitoringExecutionsOutput, error) { + req, out := c.ListMonitoringExecutionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListMonitoringExecutionsPages iterates over the pages of a ListMonitoringExecutions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListMonitoringExecutions 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 ListMonitoringExecutions operation. +// pageNum := 0 +// err := client.ListMonitoringExecutionsPages(params, +// func(page *sagemaker.ListMonitoringExecutionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListMonitoringExecutionsPages(input *ListMonitoringExecutionsInput, fn func(*ListMonitoringExecutionsOutput, bool) bool) error { + return c.ListMonitoringExecutionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListMonitoringExecutionsPagesWithContext same as ListMonitoringExecutionsPages 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 *SageMaker) ListMonitoringExecutionsPagesWithContext(ctx aws.Context, input *ListMonitoringExecutionsInput, fn func(*ListMonitoringExecutionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListMonitoringExecutionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListMonitoringExecutionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListMonitoringExecutionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListMonitoringSchedules = "ListMonitoringSchedules" + +// ListMonitoringSchedulesRequest generates a "aws/request.Request" representing the +// client's request for the ListMonitoringSchedules operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListMonitoringSchedules for more information on using the ListMonitoringSchedules +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListMonitoringSchedulesRequest method. +// req, resp := client.ListMonitoringSchedulesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListMonitoringSchedules +func (c *SageMaker) ListMonitoringSchedulesRequest(input *ListMonitoringSchedulesInput) (req *request.Request, output *ListMonitoringSchedulesOutput) { + op := &request.Operation{ + Name: opListMonitoringSchedules, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListMonitoringSchedulesInput{} + } + + output = &ListMonitoringSchedulesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListMonitoringSchedules API operation for Amazon SageMaker Service. +// +// Returns list of all monitoring schedules. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation ListMonitoringSchedules for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListMonitoringSchedules +func (c *SageMaker) ListMonitoringSchedules(input *ListMonitoringSchedulesInput) (*ListMonitoringSchedulesOutput, error) { + req, out := c.ListMonitoringSchedulesRequest(input) + return out, req.Send() +} + +// ListMonitoringSchedulesWithContext is the same as ListMonitoringSchedules with the addition of +// the ability to pass a context and additional request options. +// +// See ListMonitoringSchedules for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListMonitoringSchedulesWithContext(ctx aws.Context, input *ListMonitoringSchedulesInput, opts ...request.Option) (*ListMonitoringSchedulesOutput, error) { + req, out := c.ListMonitoringSchedulesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListMonitoringSchedulesPages iterates over the pages of a ListMonitoringSchedules operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListMonitoringSchedules 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 ListMonitoringSchedules operation. +// pageNum := 0 +// err := client.ListMonitoringSchedulesPages(params, +// func(page *sagemaker.ListMonitoringSchedulesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListMonitoringSchedulesPages(input *ListMonitoringSchedulesInput, fn func(*ListMonitoringSchedulesOutput, bool) bool) error { + return c.ListMonitoringSchedulesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListMonitoringSchedulesPagesWithContext same as ListMonitoringSchedulesPages 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 *SageMaker) ListMonitoringSchedulesPagesWithContext(ctx aws.Context, input *ListMonitoringSchedulesInput, fn func(*ListMonitoringSchedulesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListMonitoringSchedulesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListMonitoringSchedulesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListMonitoringSchedulesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListNotebookInstanceLifecycleConfigs = "ListNotebookInstanceLifecycleConfigs" + +// ListNotebookInstanceLifecycleConfigsRequest generates a "aws/request.Request" representing the +// client's request for the ListNotebookInstanceLifecycleConfigs operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListNotebookInstanceLifecycleConfigs for more information on using the ListNotebookInstanceLifecycleConfigs +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListNotebookInstanceLifecycleConfigsRequest method. +// req, resp := client.ListNotebookInstanceLifecycleConfigsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListNotebookInstanceLifecycleConfigs +func (c *SageMaker) ListNotebookInstanceLifecycleConfigsRequest(input *ListNotebookInstanceLifecycleConfigsInput) (req *request.Request, output *ListNotebookInstanceLifecycleConfigsOutput) { + op := &request.Operation{ + Name: opListNotebookInstanceLifecycleConfigs, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListNotebookInstanceLifecycleConfigsInput{} + } + + output = &ListNotebookInstanceLifecycleConfigsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListNotebookInstanceLifecycleConfigs API operation for Amazon SageMaker Service. +// +// Lists notebook instance lifestyle configurations created with the CreateNotebookInstanceLifecycleConfig +// 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 SageMaker Service's +// API operation ListNotebookInstanceLifecycleConfigs for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListNotebookInstanceLifecycleConfigs +func (c *SageMaker) ListNotebookInstanceLifecycleConfigs(input *ListNotebookInstanceLifecycleConfigsInput) (*ListNotebookInstanceLifecycleConfigsOutput, error) { + req, out := c.ListNotebookInstanceLifecycleConfigsRequest(input) + return out, req.Send() +} + +// ListNotebookInstanceLifecycleConfigsWithContext is the same as ListNotebookInstanceLifecycleConfigs with the addition of +// the ability to pass a context and additional request options. +// +// See ListNotebookInstanceLifecycleConfigs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListNotebookInstanceLifecycleConfigsWithContext(ctx aws.Context, input *ListNotebookInstanceLifecycleConfigsInput, opts ...request.Option) (*ListNotebookInstanceLifecycleConfigsOutput, error) { + req, out := c.ListNotebookInstanceLifecycleConfigsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListNotebookInstanceLifecycleConfigsPages iterates over the pages of a ListNotebookInstanceLifecycleConfigs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListNotebookInstanceLifecycleConfigs 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 ListNotebookInstanceLifecycleConfigs operation. +// pageNum := 0 +// err := client.ListNotebookInstanceLifecycleConfigsPages(params, +// func(page *sagemaker.ListNotebookInstanceLifecycleConfigsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListNotebookInstanceLifecycleConfigsPages(input *ListNotebookInstanceLifecycleConfigsInput, fn func(*ListNotebookInstanceLifecycleConfigsOutput, bool) bool) error { + return c.ListNotebookInstanceLifecycleConfigsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListNotebookInstanceLifecycleConfigsPagesWithContext same as ListNotebookInstanceLifecycleConfigsPages 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 *SageMaker) ListNotebookInstanceLifecycleConfigsPagesWithContext(ctx aws.Context, input *ListNotebookInstanceLifecycleConfigsInput, fn func(*ListNotebookInstanceLifecycleConfigsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListNotebookInstanceLifecycleConfigsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListNotebookInstanceLifecycleConfigsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListNotebookInstanceLifecycleConfigsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListNotebookInstances = "ListNotebookInstances" + +// ListNotebookInstancesRequest generates a "aws/request.Request" representing the +// client's request for the ListNotebookInstances operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListNotebookInstances for more information on using the ListNotebookInstances +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListNotebookInstancesRequest method. +// req, resp := client.ListNotebookInstancesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListNotebookInstances +func (c *SageMaker) ListNotebookInstancesRequest(input *ListNotebookInstancesInput) (req *request.Request, output *ListNotebookInstancesOutput) { + op := &request.Operation{ + Name: opListNotebookInstances, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListNotebookInstancesInput{} + } + + output = &ListNotebookInstancesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListNotebookInstances API operation for Amazon SageMaker Service. +// +// Returns a list of the Amazon SageMaker notebook instances in the requester's +// account 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 SageMaker Service's +// API operation ListNotebookInstances for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListNotebookInstances +func (c *SageMaker) ListNotebookInstances(input *ListNotebookInstancesInput) (*ListNotebookInstancesOutput, error) { + req, out := c.ListNotebookInstancesRequest(input) + return out, req.Send() +} + +// ListNotebookInstancesWithContext is the same as ListNotebookInstances with the addition of +// the ability to pass a context and additional request options. +// +// See ListNotebookInstances for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListNotebookInstancesWithContext(ctx aws.Context, input *ListNotebookInstancesInput, opts ...request.Option) (*ListNotebookInstancesOutput, error) { + req, out := c.ListNotebookInstancesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListNotebookInstancesPages iterates over the pages of a ListNotebookInstances operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListNotebookInstances 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 ListNotebookInstances operation. +// pageNum := 0 +// err := client.ListNotebookInstancesPages(params, +// func(page *sagemaker.ListNotebookInstancesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListNotebookInstancesPages(input *ListNotebookInstancesInput, fn func(*ListNotebookInstancesOutput, bool) bool) error { + return c.ListNotebookInstancesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListNotebookInstancesPagesWithContext same as ListNotebookInstancesPages 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 *SageMaker) ListNotebookInstancesPagesWithContext(ctx aws.Context, input *ListNotebookInstancesInput, fn func(*ListNotebookInstancesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListNotebookInstancesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListNotebookInstancesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListNotebookInstancesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListProcessingJobs = "ListProcessingJobs" + +// ListProcessingJobsRequest generates a "aws/request.Request" representing the +// client's request for the ListProcessingJobs operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListProcessingJobs for more information on using the ListProcessingJobs +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListProcessingJobsRequest method. +// req, resp := client.ListProcessingJobsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListProcessingJobs +func (c *SageMaker) ListProcessingJobsRequest(input *ListProcessingJobsInput) (req *request.Request, output *ListProcessingJobsOutput) { + op := &request.Operation{ + Name: opListProcessingJobs, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListProcessingJobsInput{} + } + + output = &ListProcessingJobsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListProcessingJobs API operation for Amazon SageMaker Service. +// +// Lists processing jobs that satisfy various filters. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation ListProcessingJobs for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListProcessingJobs +func (c *SageMaker) ListProcessingJobs(input *ListProcessingJobsInput) (*ListProcessingJobsOutput, error) { + req, out := c.ListProcessingJobsRequest(input) + return out, req.Send() +} + +// ListProcessingJobsWithContext is the same as ListProcessingJobs with the addition of +// the ability to pass a context and additional request options. +// +// See ListProcessingJobs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListProcessingJobsWithContext(ctx aws.Context, input *ListProcessingJobsInput, opts ...request.Option) (*ListProcessingJobsOutput, error) { + req, out := c.ListProcessingJobsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListProcessingJobsPages iterates over the pages of a ListProcessingJobs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListProcessingJobs 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 ListProcessingJobs operation. +// pageNum := 0 +// err := client.ListProcessingJobsPages(params, +// func(page *sagemaker.ListProcessingJobsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListProcessingJobsPages(input *ListProcessingJobsInput, fn func(*ListProcessingJobsOutput, bool) bool) error { + return c.ListProcessingJobsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListProcessingJobsPagesWithContext same as ListProcessingJobsPages 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 *SageMaker) ListProcessingJobsPagesWithContext(ctx aws.Context, input *ListProcessingJobsInput, fn func(*ListProcessingJobsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListProcessingJobsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListProcessingJobsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListProcessingJobsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListSubscribedWorkteams = "ListSubscribedWorkteams" + +// ListSubscribedWorkteamsRequest generates a "aws/request.Request" representing the +// client's request for the ListSubscribedWorkteams operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListSubscribedWorkteams for more information on using the ListSubscribedWorkteams +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListSubscribedWorkteamsRequest method. +// req, resp := client.ListSubscribedWorkteamsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListSubscribedWorkteams +func (c *SageMaker) ListSubscribedWorkteamsRequest(input *ListSubscribedWorkteamsInput) (req *request.Request, output *ListSubscribedWorkteamsOutput) { + op := &request.Operation{ + Name: opListSubscribedWorkteams, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListSubscribedWorkteamsInput{} + } + + output = &ListSubscribedWorkteamsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListSubscribedWorkteams API operation for Amazon SageMaker Service. +// +// Gets a list of the work teams that you are subscribed to in the AWS Marketplace. +// The list may be empty if no work team satisfies the filter specified in the +// NameContains 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 SageMaker Service's +// API operation ListSubscribedWorkteams for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListSubscribedWorkteams +func (c *SageMaker) ListSubscribedWorkteams(input *ListSubscribedWorkteamsInput) (*ListSubscribedWorkteamsOutput, error) { + req, out := c.ListSubscribedWorkteamsRequest(input) + return out, req.Send() +} + +// ListSubscribedWorkteamsWithContext is the same as ListSubscribedWorkteams with the addition of +// the ability to pass a context and additional request options. +// +// See ListSubscribedWorkteams for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListSubscribedWorkteamsWithContext(ctx aws.Context, input *ListSubscribedWorkteamsInput, opts ...request.Option) (*ListSubscribedWorkteamsOutput, error) { + req, out := c.ListSubscribedWorkteamsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListSubscribedWorkteamsPages iterates over the pages of a ListSubscribedWorkteams operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListSubscribedWorkteams 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 ListSubscribedWorkteams operation. +// pageNum := 0 +// err := client.ListSubscribedWorkteamsPages(params, +// func(page *sagemaker.ListSubscribedWorkteamsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListSubscribedWorkteamsPages(input *ListSubscribedWorkteamsInput, fn func(*ListSubscribedWorkteamsOutput, bool) bool) error { + return c.ListSubscribedWorkteamsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListSubscribedWorkteamsPagesWithContext same as ListSubscribedWorkteamsPages 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 *SageMaker) ListSubscribedWorkteamsPagesWithContext(ctx aws.Context, input *ListSubscribedWorkteamsInput, fn func(*ListSubscribedWorkteamsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListSubscribedWorkteamsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListSubscribedWorkteamsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListSubscribedWorkteamsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTags = "ListTags" + +// ListTagsRequest generates a "aws/request.Request" representing the +// client's request for the ListTags operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTags for more information on using the ListTags +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsRequest method. +// req, resp := client.ListTagsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTags +func (c *SageMaker) ListTagsRequest(input *ListTagsInput) (req *request.Request, output *ListTagsOutput) { + op := &request.Operation{ + Name: opListTags, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListTagsInput{} + } + + output = &ListTagsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTags API operation for Amazon SageMaker Service. +// +// Returns the tags for the specified Amazon SageMaker 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 SageMaker Service's +// API operation ListTags for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTags +func (c *SageMaker) ListTags(input *ListTagsInput) (*ListTagsOutput, error) { + req, out := c.ListTagsRequest(input) + return out, req.Send() +} + +// ListTagsWithContext is the same as ListTags with the addition of +// the ability to pass a context and additional request options. +// +// See ListTags for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListTagsWithContext(ctx aws.Context, input *ListTagsInput, opts ...request.Option) (*ListTagsOutput, error) { + req, out := c.ListTagsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListTagsPages iterates over the pages of a ListTags operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTags 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 ListTags operation. +// pageNum := 0 +// err := client.ListTagsPages(params, +// func(page *sagemaker.ListTagsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListTagsPages(input *ListTagsInput, fn func(*ListTagsOutput, bool) bool) error { + return c.ListTagsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListTagsPagesWithContext same as ListTagsPages 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 *SageMaker) ListTagsPagesWithContext(ctx aws.Context, input *ListTagsInput, fn func(*ListTagsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTagsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTagsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTagsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTrainingJobs = "ListTrainingJobs" + +// ListTrainingJobsRequest generates a "aws/request.Request" representing the +// client's request for the ListTrainingJobs operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTrainingJobs for more information on using the ListTrainingJobs +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTrainingJobsRequest method. +// req, resp := client.ListTrainingJobsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTrainingJobs +func (c *SageMaker) ListTrainingJobsRequest(input *ListTrainingJobsInput) (req *request.Request, output *ListTrainingJobsOutput) { + op := &request.Operation{ + Name: opListTrainingJobs, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListTrainingJobsInput{} + } + + output = &ListTrainingJobsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTrainingJobs API operation for Amazon SageMaker Service. +// +// Lists training jobs. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation ListTrainingJobs for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTrainingJobs +func (c *SageMaker) ListTrainingJobs(input *ListTrainingJobsInput) (*ListTrainingJobsOutput, error) { + req, out := c.ListTrainingJobsRequest(input) + return out, req.Send() +} + +// ListTrainingJobsWithContext is the same as ListTrainingJobs with the addition of +// the ability to pass a context and additional request options. +// +// See ListTrainingJobs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListTrainingJobsWithContext(ctx aws.Context, input *ListTrainingJobsInput, opts ...request.Option) (*ListTrainingJobsOutput, error) { + req, out := c.ListTrainingJobsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListTrainingJobsPages iterates over the pages of a ListTrainingJobs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTrainingJobs 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 ListTrainingJobs operation. +// pageNum := 0 +// err := client.ListTrainingJobsPages(params, +// func(page *sagemaker.ListTrainingJobsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListTrainingJobsPages(input *ListTrainingJobsInput, fn func(*ListTrainingJobsOutput, bool) bool) error { + return c.ListTrainingJobsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListTrainingJobsPagesWithContext same as ListTrainingJobsPages 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 *SageMaker) ListTrainingJobsPagesWithContext(ctx aws.Context, input *ListTrainingJobsInput, fn func(*ListTrainingJobsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTrainingJobsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTrainingJobsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTrainingJobsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTrainingJobsForHyperParameterTuningJob = "ListTrainingJobsForHyperParameterTuningJob" + +// ListTrainingJobsForHyperParameterTuningJobRequest generates a "aws/request.Request" representing the +// client's request for the ListTrainingJobsForHyperParameterTuningJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTrainingJobsForHyperParameterTuningJob for more information on using the ListTrainingJobsForHyperParameterTuningJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTrainingJobsForHyperParameterTuningJobRequest method. +// req, resp := client.ListTrainingJobsForHyperParameterTuningJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTrainingJobsForHyperParameterTuningJob +func (c *SageMaker) ListTrainingJobsForHyperParameterTuningJobRequest(input *ListTrainingJobsForHyperParameterTuningJobInput) (req *request.Request, output *ListTrainingJobsForHyperParameterTuningJobOutput) { + op := &request.Operation{ + Name: opListTrainingJobsForHyperParameterTuningJob, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListTrainingJobsForHyperParameterTuningJobInput{} + } + + output = &ListTrainingJobsForHyperParameterTuningJobOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTrainingJobsForHyperParameterTuningJob API operation for Amazon SageMaker Service. +// +// Gets a list of TrainingJobSummary objects that describe the training jobs +// that a hyperparameter tuning job launched. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation ListTrainingJobsForHyperParameterTuningJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTrainingJobsForHyperParameterTuningJob +func (c *SageMaker) ListTrainingJobsForHyperParameterTuningJob(input *ListTrainingJobsForHyperParameterTuningJobInput) (*ListTrainingJobsForHyperParameterTuningJobOutput, error) { + req, out := c.ListTrainingJobsForHyperParameterTuningJobRequest(input) + return out, req.Send() +} + +// ListTrainingJobsForHyperParameterTuningJobWithContext is the same as ListTrainingJobsForHyperParameterTuningJob with the addition of +// the ability to pass a context and additional request options. +// +// See ListTrainingJobsForHyperParameterTuningJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListTrainingJobsForHyperParameterTuningJobWithContext(ctx aws.Context, input *ListTrainingJobsForHyperParameterTuningJobInput, opts ...request.Option) (*ListTrainingJobsForHyperParameterTuningJobOutput, error) { + req, out := c.ListTrainingJobsForHyperParameterTuningJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListTrainingJobsForHyperParameterTuningJobPages iterates over the pages of a ListTrainingJobsForHyperParameterTuningJob operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTrainingJobsForHyperParameterTuningJob 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 ListTrainingJobsForHyperParameterTuningJob operation. +// pageNum := 0 +// err := client.ListTrainingJobsForHyperParameterTuningJobPages(params, +// func(page *sagemaker.ListTrainingJobsForHyperParameterTuningJobOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListTrainingJobsForHyperParameterTuningJobPages(input *ListTrainingJobsForHyperParameterTuningJobInput, fn func(*ListTrainingJobsForHyperParameterTuningJobOutput, bool) bool) error { + return c.ListTrainingJobsForHyperParameterTuningJobPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListTrainingJobsForHyperParameterTuningJobPagesWithContext same as ListTrainingJobsForHyperParameterTuningJobPages 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 *SageMaker) ListTrainingJobsForHyperParameterTuningJobPagesWithContext(ctx aws.Context, input *ListTrainingJobsForHyperParameterTuningJobInput, fn func(*ListTrainingJobsForHyperParameterTuningJobOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTrainingJobsForHyperParameterTuningJobInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTrainingJobsForHyperParameterTuningJobRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTrainingJobsForHyperParameterTuningJobOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTransformJobs = "ListTransformJobs" + +// ListTransformJobsRequest generates a "aws/request.Request" representing the +// client's request for the ListTransformJobs operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTransformJobs for more information on using the ListTransformJobs +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTransformJobsRequest method. +// req, resp := client.ListTransformJobsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTransformJobs +func (c *SageMaker) ListTransformJobsRequest(input *ListTransformJobsInput) (req *request.Request, output *ListTransformJobsOutput) { + op := &request.Operation{ + Name: opListTransformJobs, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListTransformJobsInput{} + } + + output = &ListTransformJobsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTransformJobs API operation for Amazon SageMaker Service. +// +// Lists transform jobs. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation ListTransformJobs for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTransformJobs +func (c *SageMaker) ListTransformJobs(input *ListTransformJobsInput) (*ListTransformJobsOutput, error) { + req, out := c.ListTransformJobsRequest(input) + return out, req.Send() +} + +// ListTransformJobsWithContext is the same as ListTransformJobs with the addition of +// the ability to pass a context and additional request options. +// +// See ListTransformJobs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListTransformJobsWithContext(ctx aws.Context, input *ListTransformJobsInput, opts ...request.Option) (*ListTransformJobsOutput, error) { + req, out := c.ListTransformJobsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListTransformJobsPages iterates over the pages of a ListTransformJobs operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTransformJobs 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 ListTransformJobs operation. +// pageNum := 0 +// err := client.ListTransformJobsPages(params, +// func(page *sagemaker.ListTransformJobsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListTransformJobsPages(input *ListTransformJobsInput, fn func(*ListTransformJobsOutput, bool) bool) error { + return c.ListTransformJobsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListTransformJobsPagesWithContext same as ListTransformJobsPages 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 *SageMaker) ListTransformJobsPagesWithContext(ctx aws.Context, input *ListTransformJobsInput, fn func(*ListTransformJobsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTransformJobsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTransformJobsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTransformJobsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTrialComponents = "ListTrialComponents" + +// ListTrialComponentsRequest generates a "aws/request.Request" representing the +// client's request for the ListTrialComponents operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTrialComponents for more information on using the ListTrialComponents +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTrialComponentsRequest method. +// req, resp := client.ListTrialComponentsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTrialComponents +func (c *SageMaker) ListTrialComponentsRequest(input *ListTrialComponentsInput) (req *request.Request, output *ListTrialComponentsOutput) { + op := &request.Operation{ + Name: opListTrialComponents, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListTrialComponentsInput{} + } + + output = &ListTrialComponentsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTrialComponents API operation for Amazon SageMaker Service. +// +// Lists the trial components in your account. You can sort the list by trial +// component name or creation time. You can filter the list to show only components +// that were created in a specific time range. You can also filter on one of +// the following: +// +// * ExperimentName +// +// * SourceArn +// +// * TrialName +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation ListTrialComponents for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTrialComponents +func (c *SageMaker) ListTrialComponents(input *ListTrialComponentsInput) (*ListTrialComponentsOutput, error) { + req, out := c.ListTrialComponentsRequest(input) + return out, req.Send() +} + +// ListTrialComponentsWithContext is the same as ListTrialComponents with the addition of +// the ability to pass a context and additional request options. +// +// See ListTrialComponents for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListTrialComponentsWithContext(ctx aws.Context, input *ListTrialComponentsInput, opts ...request.Option) (*ListTrialComponentsOutput, error) { + req, out := c.ListTrialComponentsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListTrialComponentsPages iterates over the pages of a ListTrialComponents operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTrialComponents 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 ListTrialComponents operation. +// pageNum := 0 +// err := client.ListTrialComponentsPages(params, +// func(page *sagemaker.ListTrialComponentsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListTrialComponentsPages(input *ListTrialComponentsInput, fn func(*ListTrialComponentsOutput, bool) bool) error { + return c.ListTrialComponentsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListTrialComponentsPagesWithContext same as ListTrialComponentsPages 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 *SageMaker) ListTrialComponentsPagesWithContext(ctx aws.Context, input *ListTrialComponentsInput, fn func(*ListTrialComponentsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTrialComponentsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTrialComponentsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTrialComponentsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTrials = "ListTrials" + +// ListTrialsRequest generates a "aws/request.Request" representing the +// client's request for the ListTrials operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTrials for more information on using the ListTrials +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTrialsRequest method. +// req, resp := client.ListTrialsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTrials +func (c *SageMaker) ListTrialsRequest(input *ListTrialsInput) (req *request.Request, output *ListTrialsOutput) { + op := &request.Operation{ + Name: opListTrials, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListTrialsInput{} + } + + output = &ListTrialsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListTrials API operation for Amazon SageMaker Service. +// +// Lists the trials in your account. Specify an experiment name to limit the +// list to the trials that are part of that experiment. Specify a trial component +// name to limit the list to the trials that associated with that trial component. +// The list can be filtered to show only trials that were created in a specific +// time range. The list can be sorted by trial name or creation 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 SageMaker Service's +// API operation ListTrials for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListTrials +func (c *SageMaker) ListTrials(input *ListTrialsInput) (*ListTrialsOutput, error) { + req, out := c.ListTrialsRequest(input) + return out, req.Send() +} + +// ListTrialsWithContext is the same as ListTrials with the addition of +// the ability to pass a context and additional request options. +// +// See ListTrials for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListTrialsWithContext(ctx aws.Context, input *ListTrialsInput, opts ...request.Option) (*ListTrialsOutput, error) { + req, out := c.ListTrialsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListTrialsPages iterates over the pages of a ListTrials operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListTrials 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 ListTrials operation. +// pageNum := 0 +// err := client.ListTrialsPages(params, +// func(page *sagemaker.ListTrialsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListTrialsPages(input *ListTrialsInput, fn func(*ListTrialsOutput, bool) bool) error { + return c.ListTrialsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListTrialsPagesWithContext same as ListTrialsPages 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 *SageMaker) ListTrialsPagesWithContext(ctx aws.Context, input *ListTrialsInput, fn func(*ListTrialsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListTrialsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListTrialsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListTrialsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListUserProfiles = "ListUserProfiles" + +// ListUserProfilesRequest generates a "aws/request.Request" representing the +// client's request for the ListUserProfiles operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListUserProfiles for more information on using the ListUserProfiles +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListUserProfilesRequest method. +// req, resp := client.ListUserProfilesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListUserProfiles +func (c *SageMaker) ListUserProfilesRequest(input *ListUserProfilesInput) (req *request.Request, output *ListUserProfilesOutput) { + op := &request.Operation{ + Name: opListUserProfiles, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListUserProfilesInput{} + } + + output = &ListUserProfilesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListUserProfiles API operation for Amazon SageMaker Service. +// +// Lists user profiles. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation ListUserProfiles for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListUserProfiles +func (c *SageMaker) ListUserProfiles(input *ListUserProfilesInput) (*ListUserProfilesOutput, error) { + req, out := c.ListUserProfilesRequest(input) + return out, req.Send() +} + +// ListUserProfilesWithContext is the same as ListUserProfiles with the addition of +// the ability to pass a context and additional request options. +// +// See ListUserProfiles for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListUserProfilesWithContext(ctx aws.Context, input *ListUserProfilesInput, opts ...request.Option) (*ListUserProfilesOutput, error) { + req, out := c.ListUserProfilesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListUserProfilesPages iterates over the pages of a ListUserProfiles operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListUserProfiles 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 ListUserProfiles operation. +// pageNum := 0 +// err := client.ListUserProfilesPages(params, +// func(page *sagemaker.ListUserProfilesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListUserProfilesPages(input *ListUserProfilesInput, fn func(*ListUserProfilesOutput, bool) bool) error { + return c.ListUserProfilesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListUserProfilesPagesWithContext same as ListUserProfilesPages 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 *SageMaker) ListUserProfilesPagesWithContext(ctx aws.Context, input *ListUserProfilesInput, fn func(*ListUserProfilesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListUserProfilesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListUserProfilesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListUserProfilesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListWorkteams = "ListWorkteams" + +// ListWorkteamsRequest generates a "aws/request.Request" representing the +// client's request for the ListWorkteams operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListWorkteams for more information on using the ListWorkteams +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListWorkteamsRequest method. +// req, resp := client.ListWorkteamsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListWorkteams +func (c *SageMaker) ListWorkteamsRequest(input *ListWorkteamsInput) (req *request.Request, output *ListWorkteamsOutput) { + op := &request.Operation{ + Name: opListWorkteams, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListWorkteamsInput{} + } + + output = &ListWorkteamsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListWorkteams API operation for Amazon SageMaker Service. +// +// Gets a list of work teams that you have defined in a region. The list may +// be empty if no work team satisfies the filter specified in the NameContains +// 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 SageMaker Service's +// API operation ListWorkteams for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/ListWorkteams +func (c *SageMaker) ListWorkteams(input *ListWorkteamsInput) (*ListWorkteamsOutput, error) { + req, out := c.ListWorkteamsRequest(input) + return out, req.Send() +} + +// ListWorkteamsWithContext is the same as ListWorkteams with the addition of +// the ability to pass a context and additional request options. +// +// See ListWorkteams for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) ListWorkteamsWithContext(ctx aws.Context, input *ListWorkteamsInput, opts ...request.Option) (*ListWorkteamsOutput, error) { + req, out := c.ListWorkteamsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListWorkteamsPages iterates over the pages of a ListWorkteams operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListWorkteams 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 ListWorkteams operation. +// pageNum := 0 +// err := client.ListWorkteamsPages(params, +// func(page *sagemaker.ListWorkteamsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) ListWorkteamsPages(input *ListWorkteamsInput, fn func(*ListWorkteamsOutput, bool) bool) error { + return c.ListWorkteamsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListWorkteamsPagesWithContext same as ListWorkteamsPages 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 *SageMaker) ListWorkteamsPagesWithContext(ctx aws.Context, input *ListWorkteamsInput, fn func(*ListWorkteamsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListWorkteamsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListWorkteamsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListWorkteamsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opRenderUiTemplate = "RenderUiTemplate" + +// RenderUiTemplateRequest generates a "aws/request.Request" representing the +// client's request for the RenderUiTemplate operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RenderUiTemplate for more information on using the RenderUiTemplate +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RenderUiTemplateRequest method. +// req, resp := client.RenderUiTemplateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/RenderUiTemplate +func (c *SageMaker) RenderUiTemplateRequest(input *RenderUiTemplateInput) (req *request.Request, output *RenderUiTemplateOutput) { + op := &request.Operation{ + Name: opRenderUiTemplate, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RenderUiTemplateInput{} + } + + output = &RenderUiTemplateOutput{} + req = c.newRequest(op, input, output) + return +} + +// RenderUiTemplate API operation for Amazon SageMaker Service. +// +// Renders the UI template so that you can preview the worker's experience. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation RenderUiTemplate for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/RenderUiTemplate +func (c *SageMaker) RenderUiTemplate(input *RenderUiTemplateInput) (*RenderUiTemplateOutput, error) { + req, out := c.RenderUiTemplateRequest(input) + return out, req.Send() +} + +// RenderUiTemplateWithContext is the same as RenderUiTemplate with the addition of +// the ability to pass a context and additional request options. +// +// See RenderUiTemplate for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) RenderUiTemplateWithContext(ctx aws.Context, input *RenderUiTemplateInput, opts ...request.Option) (*RenderUiTemplateOutput, error) { + req, out := c.RenderUiTemplateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opSearch = "Search" + +// SearchRequest generates a "aws/request.Request" representing the +// client's request for the Search operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See Search for more information on using the Search +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the SearchRequest method. +// req, resp := client.SearchRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/Search +func (c *SageMaker) SearchRequest(input *SearchInput) (req *request.Request, output *SearchOutput) { + op := &request.Operation{ + Name: opSearch, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &SearchInput{} + } + + output = &SearchOutput{} + req = c.newRequest(op, input, output) + return +} + +// Search API operation for Amazon SageMaker Service. +// +// Finds Amazon SageMaker resources that match a search query. Matching resource +// objects are returned as a list of SearchResult objects in the response. You +// can sort the search results by any resource property in a ascending or descending +// order. +// +// You can query against the following value types: numeric, text, Boolean, +// and timestamp. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation Search for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/Search +func (c *SageMaker) Search(input *SearchInput) (*SearchOutput, error) { + req, out := c.SearchRequest(input) + return out, req.Send() +} + +// SearchWithContext is the same as Search with the addition of +// the ability to pass a context and additional request options. +// +// See Search for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) SearchWithContext(ctx aws.Context, input *SearchInput, opts ...request.Option) (*SearchOutput, error) { + req, out := c.SearchRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// SearchPages iterates over the pages of a Search operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See Search 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 Search operation. +// pageNum := 0 +// err := client.SearchPages(params, +// func(page *sagemaker.SearchOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SageMaker) SearchPages(input *SearchInput, fn func(*SearchOutput, bool) bool) error { + return c.SearchPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// SearchPagesWithContext same as SearchPages 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 *SageMaker) SearchPagesWithContext(ctx aws.Context, input *SearchInput, fn func(*SearchOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *SearchInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.SearchRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*SearchOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opStartMonitoringSchedule = "StartMonitoringSchedule" + +// StartMonitoringScheduleRequest generates a "aws/request.Request" representing the +// client's request for the StartMonitoringSchedule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartMonitoringSchedule for more information on using the StartMonitoringSchedule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartMonitoringScheduleRequest method. +// req, resp := client.StartMonitoringScheduleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StartMonitoringSchedule +func (c *SageMaker) StartMonitoringScheduleRequest(input *StartMonitoringScheduleInput) (req *request.Request, output *StartMonitoringScheduleOutput) { + op := &request.Operation{ + Name: opStartMonitoringSchedule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StartMonitoringScheduleInput{} + } + + output = &StartMonitoringScheduleOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StartMonitoringSchedule API operation for Amazon SageMaker Service. +// +// Starts a previously stopped monitoring schedule. +// +// New monitoring schedules are immediately started after 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 Amazon SageMaker Service's +// API operation StartMonitoringSchedule for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StartMonitoringSchedule +func (c *SageMaker) StartMonitoringSchedule(input *StartMonitoringScheduleInput) (*StartMonitoringScheduleOutput, error) { + req, out := c.StartMonitoringScheduleRequest(input) + return out, req.Send() +} + +// StartMonitoringScheduleWithContext is the same as StartMonitoringSchedule with the addition of +// the ability to pass a context and additional request options. +// +// See StartMonitoringSchedule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) StartMonitoringScheduleWithContext(ctx aws.Context, input *StartMonitoringScheduleInput, opts ...request.Option) (*StartMonitoringScheduleOutput, error) { + req, out := c.StartMonitoringScheduleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStartNotebookInstance = "StartNotebookInstance" + +// StartNotebookInstanceRequest generates a "aws/request.Request" representing the +// client's request for the StartNotebookInstance operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartNotebookInstance for more information on using the StartNotebookInstance +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartNotebookInstanceRequest method. +// req, resp := client.StartNotebookInstanceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StartNotebookInstance +func (c *SageMaker) StartNotebookInstanceRequest(input *StartNotebookInstanceInput) (req *request.Request, output *StartNotebookInstanceOutput) { + op := &request.Operation{ + Name: opStartNotebookInstance, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StartNotebookInstanceInput{} + } + + output = &StartNotebookInstanceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StartNotebookInstance API operation for Amazon SageMaker Service. +// +// Launches an ML compute instance with the latest version of the libraries +// and attaches your ML storage volume. After configuring the notebook instance, +// Amazon SageMaker sets the notebook instance status to InService. A notebook +// instance's status must be InService before you can connect to your Jupyter +// notebook. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation StartNotebookInstance for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StartNotebookInstance +func (c *SageMaker) StartNotebookInstance(input *StartNotebookInstanceInput) (*StartNotebookInstanceOutput, error) { + req, out := c.StartNotebookInstanceRequest(input) + return out, req.Send() +} + +// StartNotebookInstanceWithContext is the same as StartNotebookInstance with the addition of +// the ability to pass a context and additional request options. +// +// See StartNotebookInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) StartNotebookInstanceWithContext(ctx aws.Context, input *StartNotebookInstanceInput, opts ...request.Option) (*StartNotebookInstanceOutput, error) { + req, out := c.StartNotebookInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopAutoMLJob = "StopAutoMLJob" + +// StopAutoMLJobRequest generates a "aws/request.Request" representing the +// client's request for the StopAutoMLJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopAutoMLJob for more information on using the StopAutoMLJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopAutoMLJobRequest method. +// req, resp := client.StopAutoMLJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopAutoMLJob +func (c *SageMaker) StopAutoMLJobRequest(input *StopAutoMLJobInput) (req *request.Request, output *StopAutoMLJobOutput) { + op := &request.Operation{ + Name: opStopAutoMLJob, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StopAutoMLJobInput{} + } + + output = &StopAutoMLJobOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StopAutoMLJob API operation for Amazon SageMaker Service. +// +// A method for forcing the termination of a running 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 SageMaker Service's +// API operation StopAutoMLJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopAutoMLJob +func (c *SageMaker) StopAutoMLJob(input *StopAutoMLJobInput) (*StopAutoMLJobOutput, error) { + req, out := c.StopAutoMLJobRequest(input) + return out, req.Send() +} + +// StopAutoMLJobWithContext is the same as StopAutoMLJob with the addition of +// the ability to pass a context and additional request options. +// +// See StopAutoMLJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) StopAutoMLJobWithContext(ctx aws.Context, input *StopAutoMLJobInput, opts ...request.Option) (*StopAutoMLJobOutput, error) { + req, out := c.StopAutoMLJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopCompilationJob = "StopCompilationJob" + +// StopCompilationJobRequest generates a "aws/request.Request" representing the +// client's request for the StopCompilationJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopCompilationJob for more information on using the StopCompilationJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopCompilationJobRequest method. +// req, resp := client.StopCompilationJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopCompilationJob +func (c *SageMaker) StopCompilationJobRequest(input *StopCompilationJobInput) (req *request.Request, output *StopCompilationJobOutput) { + op := &request.Operation{ + Name: opStopCompilationJob, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StopCompilationJobInput{} + } + + output = &StopCompilationJobOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StopCompilationJob API operation for Amazon SageMaker Service. +// +// Stops a model compilation job. +// +// To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal. This +// gracefully shuts the job down. If the job hasn't stopped, it sends the SIGKILL +// signal. +// +// When it receives a StopCompilationJob request, Amazon SageMaker changes the +// CompilationJobSummary$CompilationJobStatus of the job to Stopping. After +// Amazon SageMaker stops the job, it sets the CompilationJobSummary$CompilationJobStatus +// to 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 SageMaker Service's +// API operation StopCompilationJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopCompilationJob +func (c *SageMaker) StopCompilationJob(input *StopCompilationJobInput) (*StopCompilationJobOutput, error) { + req, out := c.StopCompilationJobRequest(input) + return out, req.Send() +} + +// StopCompilationJobWithContext is the same as StopCompilationJob with the addition of +// the ability to pass a context and additional request options. +// +// See StopCompilationJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) StopCompilationJobWithContext(ctx aws.Context, input *StopCompilationJobInput, opts ...request.Option) (*StopCompilationJobOutput, error) { + req, out := c.StopCompilationJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopHyperParameterTuningJob = "StopHyperParameterTuningJob" + +// StopHyperParameterTuningJobRequest generates a "aws/request.Request" representing the +// client's request for the StopHyperParameterTuningJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopHyperParameterTuningJob for more information on using the StopHyperParameterTuningJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopHyperParameterTuningJobRequest method. +// req, resp := client.StopHyperParameterTuningJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopHyperParameterTuningJob +func (c *SageMaker) StopHyperParameterTuningJobRequest(input *StopHyperParameterTuningJobInput) (req *request.Request, output *StopHyperParameterTuningJobOutput) { + op := &request.Operation{ + Name: opStopHyperParameterTuningJob, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StopHyperParameterTuningJobInput{} + } + + output = &StopHyperParameterTuningJobOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StopHyperParameterTuningJob API operation for Amazon SageMaker Service. +// +// Stops a running hyperparameter tuning job and all running training jobs that +// the tuning job launched. +// +// All model artifacts output from the training jobs are stored in Amazon Simple +// Storage Service (Amazon S3). All data that the training jobs write to Amazon +// CloudWatch Logs are still available in CloudWatch. After the tuning job moves +// to the Stopped state, it releases all reserved resources for the tuning 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 SageMaker Service's +// API operation StopHyperParameterTuningJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopHyperParameterTuningJob +func (c *SageMaker) StopHyperParameterTuningJob(input *StopHyperParameterTuningJobInput) (*StopHyperParameterTuningJobOutput, error) { + req, out := c.StopHyperParameterTuningJobRequest(input) + return out, req.Send() +} + +// StopHyperParameterTuningJobWithContext is the same as StopHyperParameterTuningJob with the addition of +// the ability to pass a context and additional request options. +// +// See StopHyperParameterTuningJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) StopHyperParameterTuningJobWithContext(ctx aws.Context, input *StopHyperParameterTuningJobInput, opts ...request.Option) (*StopHyperParameterTuningJobOutput, error) { + req, out := c.StopHyperParameterTuningJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopLabelingJob = "StopLabelingJob" + +// StopLabelingJobRequest generates a "aws/request.Request" representing the +// client's request for the StopLabelingJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopLabelingJob for more information on using the StopLabelingJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopLabelingJobRequest method. +// req, resp := client.StopLabelingJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopLabelingJob +func (c *SageMaker) StopLabelingJobRequest(input *StopLabelingJobInput) (req *request.Request, output *StopLabelingJobOutput) { + op := &request.Operation{ + Name: opStopLabelingJob, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StopLabelingJobInput{} + } + + output = &StopLabelingJobOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StopLabelingJob API operation for Amazon SageMaker Service. +// +// Stops a running labeling job. A job that is stopped cannot be restarted. +// Any results obtained before the job is stopped are placed in the Amazon S3 +// output bucket. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation StopLabelingJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopLabelingJob +func (c *SageMaker) StopLabelingJob(input *StopLabelingJobInput) (*StopLabelingJobOutput, error) { + req, out := c.StopLabelingJobRequest(input) + return out, req.Send() +} + +// StopLabelingJobWithContext is the same as StopLabelingJob with the addition of +// the ability to pass a context and additional request options. +// +// See StopLabelingJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) StopLabelingJobWithContext(ctx aws.Context, input *StopLabelingJobInput, opts ...request.Option) (*StopLabelingJobOutput, error) { + req, out := c.StopLabelingJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopMonitoringSchedule = "StopMonitoringSchedule" + +// StopMonitoringScheduleRequest generates a "aws/request.Request" representing the +// client's request for the StopMonitoringSchedule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopMonitoringSchedule for more information on using the StopMonitoringSchedule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopMonitoringScheduleRequest method. +// req, resp := client.StopMonitoringScheduleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopMonitoringSchedule +func (c *SageMaker) StopMonitoringScheduleRequest(input *StopMonitoringScheduleInput) (req *request.Request, output *StopMonitoringScheduleOutput) { + op := &request.Operation{ + Name: opStopMonitoringSchedule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StopMonitoringScheduleInput{} + } + + output = &StopMonitoringScheduleOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StopMonitoringSchedule API operation for Amazon SageMaker Service. +// +// Stops a previously started monitoring 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 SageMaker Service's +// API operation StopMonitoringSchedule for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopMonitoringSchedule +func (c *SageMaker) StopMonitoringSchedule(input *StopMonitoringScheduleInput) (*StopMonitoringScheduleOutput, error) { + req, out := c.StopMonitoringScheduleRequest(input) + return out, req.Send() +} + +// StopMonitoringScheduleWithContext is the same as StopMonitoringSchedule with the addition of +// the ability to pass a context and additional request options. +// +// See StopMonitoringSchedule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) StopMonitoringScheduleWithContext(ctx aws.Context, input *StopMonitoringScheduleInput, opts ...request.Option) (*StopMonitoringScheduleOutput, error) { + req, out := c.StopMonitoringScheduleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopNotebookInstance = "StopNotebookInstance" + +// StopNotebookInstanceRequest generates a "aws/request.Request" representing the +// client's request for the StopNotebookInstance operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopNotebookInstance for more information on using the StopNotebookInstance +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopNotebookInstanceRequest method. +// req, resp := client.StopNotebookInstanceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopNotebookInstance +func (c *SageMaker) StopNotebookInstanceRequest(input *StopNotebookInstanceInput) (req *request.Request, output *StopNotebookInstanceOutput) { + op := &request.Operation{ + Name: opStopNotebookInstance, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StopNotebookInstanceInput{} + } + + output = &StopNotebookInstanceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StopNotebookInstance API operation for Amazon SageMaker Service. +// +// Terminates the ML compute instance. Before terminating the instance, Amazon +// SageMaker disconnects the ML storage volume from it. Amazon SageMaker preserves +// the ML storage volume. Amazon SageMaker stops charging you for the ML compute +// instance when you call StopNotebookInstance. +// +// To access data on the ML storage volume for a notebook instance that has +// been terminated, call the StartNotebookInstance API. StartNotebookInstance +// launches another ML compute instance, configures it, and attaches the preserved +// ML storage volume so you can continue your work. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation StopNotebookInstance for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopNotebookInstance +func (c *SageMaker) StopNotebookInstance(input *StopNotebookInstanceInput) (*StopNotebookInstanceOutput, error) { + req, out := c.StopNotebookInstanceRequest(input) + return out, req.Send() +} + +// StopNotebookInstanceWithContext is the same as StopNotebookInstance with the addition of +// the ability to pass a context and additional request options. +// +// See StopNotebookInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) StopNotebookInstanceWithContext(ctx aws.Context, input *StopNotebookInstanceInput, opts ...request.Option) (*StopNotebookInstanceOutput, error) { + req, out := c.StopNotebookInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopProcessingJob = "StopProcessingJob" + +// StopProcessingJobRequest generates a "aws/request.Request" representing the +// client's request for the StopProcessingJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopProcessingJob for more information on using the StopProcessingJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopProcessingJobRequest method. +// req, resp := client.StopProcessingJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopProcessingJob +func (c *SageMaker) StopProcessingJobRequest(input *StopProcessingJobInput) (req *request.Request, output *StopProcessingJobOutput) { + op := &request.Operation{ + Name: opStopProcessingJob, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StopProcessingJobInput{} + } + + output = &StopProcessingJobOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StopProcessingJob API operation for Amazon SageMaker Service. +// +// Stops a processing 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 SageMaker Service's +// API operation StopProcessingJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopProcessingJob +func (c *SageMaker) StopProcessingJob(input *StopProcessingJobInput) (*StopProcessingJobOutput, error) { + req, out := c.StopProcessingJobRequest(input) + return out, req.Send() +} + +// StopProcessingJobWithContext is the same as StopProcessingJob with the addition of +// the ability to pass a context and additional request options. +// +// See StopProcessingJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) StopProcessingJobWithContext(ctx aws.Context, input *StopProcessingJobInput, opts ...request.Option) (*StopProcessingJobOutput, error) { + req, out := c.StopProcessingJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopTrainingJob = "StopTrainingJob" + +// StopTrainingJobRequest generates a "aws/request.Request" representing the +// client's request for the StopTrainingJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopTrainingJob for more information on using the StopTrainingJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopTrainingJobRequest method. +// req, resp := client.StopTrainingJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopTrainingJob +func (c *SageMaker) StopTrainingJobRequest(input *StopTrainingJobInput) (req *request.Request, output *StopTrainingJobOutput) { + op := &request.Operation{ + Name: opStopTrainingJob, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StopTrainingJobInput{} + } + + output = &StopTrainingJobOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StopTrainingJob API operation for Amazon SageMaker Service. +// +// Stops a training job. To stop a job, Amazon SageMaker sends the algorithm +// the SIGTERM signal, which delays job termination for 120 seconds. Algorithms +// might use this 120-second window to save the model artifacts, so the results +// of the training is not lost. +// +// When it receives a StopTrainingJob request, Amazon SageMaker changes the +// status of the job to Stopping. After Amazon SageMaker stops the job, it sets +// the status to 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 SageMaker Service's +// API operation StopTrainingJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopTrainingJob +func (c *SageMaker) StopTrainingJob(input *StopTrainingJobInput) (*StopTrainingJobOutput, error) { + req, out := c.StopTrainingJobRequest(input) + return out, req.Send() +} + +// StopTrainingJobWithContext is the same as StopTrainingJob with the addition of +// the ability to pass a context and additional request options. +// +// See StopTrainingJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) StopTrainingJobWithContext(ctx aws.Context, input *StopTrainingJobInput, opts ...request.Option) (*StopTrainingJobOutput, error) { + req, out := c.StopTrainingJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opStopTransformJob = "StopTransformJob" + +// StopTransformJobRequest generates a "aws/request.Request" representing the +// client's request for the StopTransformJob operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopTransformJob for more information on using the StopTransformJob +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopTransformJobRequest method. +// req, resp := client.StopTransformJobRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopTransformJob +func (c *SageMaker) StopTransformJobRequest(input *StopTransformJobInput) (req *request.Request, output *StopTransformJobOutput) { + op := &request.Operation{ + Name: opStopTransformJob, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StopTransformJobInput{} + } + + output = &StopTransformJobOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// StopTransformJob API operation for Amazon SageMaker Service. +// +// Stops a transform job. +// +// When Amazon SageMaker receives a StopTransformJob request, the status of +// the job changes to Stopping. After Amazon SageMaker stops the job, the status +// is set to Stopped. When you stop a transform job before it is completed, +// Amazon SageMaker doesn't store the job's output in Amazon S3. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation StopTransformJob for usage and error information. +// +// Returned Error Types: +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/StopTransformJob +func (c *SageMaker) StopTransformJob(input *StopTransformJobInput) (*StopTransformJobOutput, error) { + req, out := c.StopTransformJobRequest(input) + return out, req.Send() +} + +// StopTransformJobWithContext is the same as StopTransformJob with the addition of +// the ability to pass a context and additional request options. +// +// See StopTransformJob for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) StopTransformJobWithContext(ctx aws.Context, input *StopTransformJobInput, opts ...request.Option) (*StopTransformJobOutput, error) { + req, out := c.StopTransformJobRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateCodeRepository = "UpdateCodeRepository" + +// UpdateCodeRepositoryRequest generates a "aws/request.Request" representing the +// client's request for the UpdateCodeRepository operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateCodeRepository for more information on using the UpdateCodeRepository +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateCodeRepositoryRequest method. +// req, resp := client.UpdateCodeRepositoryRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateCodeRepository +func (c *SageMaker) UpdateCodeRepositoryRequest(input *UpdateCodeRepositoryInput) (req *request.Request, output *UpdateCodeRepositoryOutput) { + op := &request.Operation{ + Name: opUpdateCodeRepository, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateCodeRepositoryInput{} + } + + output = &UpdateCodeRepositoryOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateCodeRepository API operation for Amazon SageMaker Service. +// +// Updates the specified Git repository with the specified 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 SageMaker Service's +// API operation UpdateCodeRepository for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateCodeRepository +func (c *SageMaker) UpdateCodeRepository(input *UpdateCodeRepositoryInput) (*UpdateCodeRepositoryOutput, error) { + req, out := c.UpdateCodeRepositoryRequest(input) + return out, req.Send() +} + +// UpdateCodeRepositoryWithContext is the same as UpdateCodeRepository with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateCodeRepository for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) UpdateCodeRepositoryWithContext(ctx aws.Context, input *UpdateCodeRepositoryInput, opts ...request.Option) (*UpdateCodeRepositoryOutput, error) { + req, out := c.UpdateCodeRepositoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateDomain = "UpdateDomain" + +// UpdateDomainRequest generates a "aws/request.Request" representing the +// client's request for the UpdateDomain operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateDomain for more information on using the UpdateDomain +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateDomainRequest method. +// req, resp := client.UpdateDomainRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateDomain +func (c *SageMaker) UpdateDomainRequest(input *UpdateDomainInput) (req *request.Request, output *UpdateDomainOutput) { + op := &request.Operation{ + Name: opUpdateDomain, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateDomainInput{} + } + + output = &UpdateDomainOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateDomain API operation for Amazon SageMaker Service. +// +// Updates a domain. Changes will impact all of the people in the 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 SageMaker Service's +// API operation UpdateDomain for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// * ResourceInUse +// Resource being accessed is in use. +// +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateDomain +func (c *SageMaker) UpdateDomain(input *UpdateDomainInput) (*UpdateDomainOutput, error) { + req, out := c.UpdateDomainRequest(input) + return out, req.Send() +} + +// UpdateDomainWithContext is the same as UpdateDomain with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateDomain for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) UpdateDomainWithContext(ctx aws.Context, input *UpdateDomainInput, opts ...request.Option) (*UpdateDomainOutput, error) { + req, out := c.UpdateDomainRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateEndpoint = "UpdateEndpoint" + +// UpdateEndpointRequest generates a "aws/request.Request" representing the +// client's request for the UpdateEndpoint operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateEndpoint for more information on using the UpdateEndpoint +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateEndpointRequest method. +// req, resp := client.UpdateEndpointRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateEndpoint +func (c *SageMaker) UpdateEndpointRequest(input *UpdateEndpointInput) (req *request.Request, output *UpdateEndpointOutput) { + op := &request.Operation{ + Name: opUpdateEndpoint, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateEndpointInput{} + } + + output = &UpdateEndpointOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateEndpoint API operation for Amazon SageMaker Service. +// +// Deploys the new EndpointConfig specified in the request, switches to using +// newly created endpoint, and then deletes resources provisioned for the endpoint +// using the previous EndpointConfig (there is no availability loss). +// +// When Amazon SageMaker receives the request, it sets the endpoint status to +// Updating. After updating the endpoint, it sets the status to InService. To +// check the status of an endpoint, use the DescribeEndpoint (https://docs.aws.amazon.com/sagemaker/latest/dg/API_DescribeEndpoint.html) +// API. +// +// You must not delete an EndpointConfig in use by an endpoint that is live +// or while the UpdateEndpoint or CreateEndpoint operations are being performed +// on the endpoint. To update an endpoint, you must create a new EndpointConfig. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation UpdateEndpoint for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateEndpoint +func (c *SageMaker) UpdateEndpoint(input *UpdateEndpointInput) (*UpdateEndpointOutput, error) { + req, out := c.UpdateEndpointRequest(input) + return out, req.Send() +} + +// UpdateEndpointWithContext is the same as UpdateEndpoint with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateEndpoint for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) UpdateEndpointWithContext(ctx aws.Context, input *UpdateEndpointInput, opts ...request.Option) (*UpdateEndpointOutput, error) { + req, out := c.UpdateEndpointRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateEndpointWeightsAndCapacities = "UpdateEndpointWeightsAndCapacities" + +// UpdateEndpointWeightsAndCapacitiesRequest generates a "aws/request.Request" representing the +// client's request for the UpdateEndpointWeightsAndCapacities operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateEndpointWeightsAndCapacities for more information on using the UpdateEndpointWeightsAndCapacities +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateEndpointWeightsAndCapacitiesRequest method. +// req, resp := client.UpdateEndpointWeightsAndCapacitiesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateEndpointWeightsAndCapacities +func (c *SageMaker) UpdateEndpointWeightsAndCapacitiesRequest(input *UpdateEndpointWeightsAndCapacitiesInput) (req *request.Request, output *UpdateEndpointWeightsAndCapacitiesOutput) { + op := &request.Operation{ + Name: opUpdateEndpointWeightsAndCapacities, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateEndpointWeightsAndCapacitiesInput{} + } + + output = &UpdateEndpointWeightsAndCapacitiesOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateEndpointWeightsAndCapacities API operation for Amazon SageMaker Service. +// +// Updates variant weight of one or more variants associated with an existing +// endpoint, or capacity of one variant associated with an existing endpoint. +// When it receives the request, Amazon SageMaker sets the endpoint status to +// Updating. After updating the endpoint, it sets the status to InService. To +// check the status of an endpoint, use the DescribeEndpoint (https://docs.aws.amazon.com/sagemaker/latest/dg/API_DescribeEndpoint.html) +// 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 SageMaker Service's +// API operation UpdateEndpointWeightsAndCapacities for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateEndpointWeightsAndCapacities +func (c *SageMaker) UpdateEndpointWeightsAndCapacities(input *UpdateEndpointWeightsAndCapacitiesInput) (*UpdateEndpointWeightsAndCapacitiesOutput, error) { + req, out := c.UpdateEndpointWeightsAndCapacitiesRequest(input) + return out, req.Send() +} + +// UpdateEndpointWeightsAndCapacitiesWithContext is the same as UpdateEndpointWeightsAndCapacities with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateEndpointWeightsAndCapacities for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) UpdateEndpointWeightsAndCapacitiesWithContext(ctx aws.Context, input *UpdateEndpointWeightsAndCapacitiesInput, opts ...request.Option) (*UpdateEndpointWeightsAndCapacitiesOutput, error) { + req, out := c.UpdateEndpointWeightsAndCapacitiesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateExperiment = "UpdateExperiment" + +// UpdateExperimentRequest generates a "aws/request.Request" representing the +// client's request for the UpdateExperiment operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateExperiment for more information on using the UpdateExperiment +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateExperimentRequest method. +// req, resp := client.UpdateExperimentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateExperiment +func (c *SageMaker) UpdateExperimentRequest(input *UpdateExperimentInput) (req *request.Request, output *UpdateExperimentOutput) { + op := &request.Operation{ + Name: opUpdateExperiment, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateExperimentInput{} + } + + output = &UpdateExperimentOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateExperiment API operation for Amazon SageMaker Service. +// +// Adds, updates, or removes the description of an experiment. Updates the display +// name of an experiment. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation UpdateExperiment for usage and error information. +// +// Returned Error Types: +// * ConflictException +// There was a conflict when you attempted to modify an experiment, trial, or +// trial component. +// +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateExperiment +func (c *SageMaker) UpdateExperiment(input *UpdateExperimentInput) (*UpdateExperimentOutput, error) { + req, out := c.UpdateExperimentRequest(input) + return out, req.Send() +} + +// UpdateExperimentWithContext is the same as UpdateExperiment with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateExperiment for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) UpdateExperimentWithContext(ctx aws.Context, input *UpdateExperimentInput, opts ...request.Option) (*UpdateExperimentOutput, error) { + req, out := c.UpdateExperimentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateMonitoringSchedule = "UpdateMonitoringSchedule" + +// UpdateMonitoringScheduleRequest generates a "aws/request.Request" representing the +// client's request for the UpdateMonitoringSchedule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateMonitoringSchedule for more information on using the UpdateMonitoringSchedule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateMonitoringScheduleRequest method. +// req, resp := client.UpdateMonitoringScheduleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateMonitoringSchedule +func (c *SageMaker) UpdateMonitoringScheduleRequest(input *UpdateMonitoringScheduleInput) (req *request.Request, output *UpdateMonitoringScheduleOutput) { + op := &request.Operation{ + Name: opUpdateMonitoringSchedule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateMonitoringScheduleInput{} + } + + output = &UpdateMonitoringScheduleOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateMonitoringSchedule API operation for Amazon SageMaker Service. +// +// Updates a previously created 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 SageMaker Service's +// API operation UpdateMonitoringSchedule for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateMonitoringSchedule +func (c *SageMaker) UpdateMonitoringSchedule(input *UpdateMonitoringScheduleInput) (*UpdateMonitoringScheduleOutput, error) { + req, out := c.UpdateMonitoringScheduleRequest(input) + return out, req.Send() +} + +// UpdateMonitoringScheduleWithContext is the same as UpdateMonitoringSchedule with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateMonitoringSchedule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) UpdateMonitoringScheduleWithContext(ctx aws.Context, input *UpdateMonitoringScheduleInput, opts ...request.Option) (*UpdateMonitoringScheduleOutput, error) { + req, out := c.UpdateMonitoringScheduleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateNotebookInstance = "UpdateNotebookInstance" + +// UpdateNotebookInstanceRequest generates a "aws/request.Request" representing the +// client's request for the UpdateNotebookInstance operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateNotebookInstance for more information on using the UpdateNotebookInstance +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateNotebookInstanceRequest method. +// req, resp := client.UpdateNotebookInstanceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateNotebookInstance +func (c *SageMaker) UpdateNotebookInstanceRequest(input *UpdateNotebookInstanceInput) (req *request.Request, output *UpdateNotebookInstanceOutput) { + op := &request.Operation{ + Name: opUpdateNotebookInstance, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateNotebookInstanceInput{} + } + + output = &UpdateNotebookInstanceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateNotebookInstance API operation for Amazon SageMaker Service. +// +// Updates a notebook instance. NotebookInstance updates include upgrading or +// downgrading the ML compute instance used for your notebook instance to accommodate +// changes in your workload requirements. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation UpdateNotebookInstance for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateNotebookInstance +func (c *SageMaker) UpdateNotebookInstance(input *UpdateNotebookInstanceInput) (*UpdateNotebookInstanceOutput, error) { + req, out := c.UpdateNotebookInstanceRequest(input) + return out, req.Send() +} + +// UpdateNotebookInstanceWithContext is the same as UpdateNotebookInstance with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateNotebookInstance for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) UpdateNotebookInstanceWithContext(ctx aws.Context, input *UpdateNotebookInstanceInput, opts ...request.Option) (*UpdateNotebookInstanceOutput, error) { + req, out := c.UpdateNotebookInstanceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateNotebookInstanceLifecycleConfig = "UpdateNotebookInstanceLifecycleConfig" + +// UpdateNotebookInstanceLifecycleConfigRequest generates a "aws/request.Request" representing the +// client's request for the UpdateNotebookInstanceLifecycleConfig operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateNotebookInstanceLifecycleConfig for more information on using the UpdateNotebookInstanceLifecycleConfig +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateNotebookInstanceLifecycleConfigRequest method. +// req, resp := client.UpdateNotebookInstanceLifecycleConfigRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateNotebookInstanceLifecycleConfig +func (c *SageMaker) UpdateNotebookInstanceLifecycleConfigRequest(input *UpdateNotebookInstanceLifecycleConfigInput) (req *request.Request, output *UpdateNotebookInstanceLifecycleConfigOutput) { + op := &request.Operation{ + Name: opUpdateNotebookInstanceLifecycleConfig, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateNotebookInstanceLifecycleConfigInput{} + } + + output = &UpdateNotebookInstanceLifecycleConfigOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateNotebookInstanceLifecycleConfig API operation for Amazon SageMaker Service. +// +// Updates a notebook instance lifecycle configuration created with the CreateNotebookInstanceLifecycleConfig +// 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 SageMaker Service's +// API operation UpdateNotebookInstanceLifecycleConfig for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateNotebookInstanceLifecycleConfig +func (c *SageMaker) UpdateNotebookInstanceLifecycleConfig(input *UpdateNotebookInstanceLifecycleConfigInput) (*UpdateNotebookInstanceLifecycleConfigOutput, error) { + req, out := c.UpdateNotebookInstanceLifecycleConfigRequest(input) + return out, req.Send() +} + +// UpdateNotebookInstanceLifecycleConfigWithContext is the same as UpdateNotebookInstanceLifecycleConfig with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateNotebookInstanceLifecycleConfig for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) UpdateNotebookInstanceLifecycleConfigWithContext(ctx aws.Context, input *UpdateNotebookInstanceLifecycleConfigInput, opts ...request.Option) (*UpdateNotebookInstanceLifecycleConfigOutput, error) { + req, out := c.UpdateNotebookInstanceLifecycleConfigRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateTrial = "UpdateTrial" + +// UpdateTrialRequest generates a "aws/request.Request" representing the +// client's request for the UpdateTrial operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateTrial for more information on using the UpdateTrial +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateTrialRequest method. +// req, resp := client.UpdateTrialRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateTrial +func (c *SageMaker) UpdateTrialRequest(input *UpdateTrialInput) (req *request.Request, output *UpdateTrialOutput) { + op := &request.Operation{ + Name: opUpdateTrial, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateTrialInput{} + } + + output = &UpdateTrialOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateTrial API operation for Amazon SageMaker Service. +// +// Updates the display name of a trial. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation UpdateTrial for usage and error information. +// +// Returned Error Types: +// * ConflictException +// There was a conflict when you attempted to modify an experiment, trial, or +// trial component. +// +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateTrial +func (c *SageMaker) UpdateTrial(input *UpdateTrialInput) (*UpdateTrialOutput, error) { + req, out := c.UpdateTrialRequest(input) + return out, req.Send() +} + +// UpdateTrialWithContext is the same as UpdateTrial with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTrial for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) UpdateTrialWithContext(ctx aws.Context, input *UpdateTrialInput, opts ...request.Option) (*UpdateTrialOutput, error) { + req, out := c.UpdateTrialRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateTrialComponent = "UpdateTrialComponent" + +// UpdateTrialComponentRequest generates a "aws/request.Request" representing the +// client's request for the UpdateTrialComponent operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateTrialComponent for more information on using the UpdateTrialComponent +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateTrialComponentRequest method. +// req, resp := client.UpdateTrialComponentRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateTrialComponent +func (c *SageMaker) UpdateTrialComponentRequest(input *UpdateTrialComponentInput) (req *request.Request, output *UpdateTrialComponentOutput) { + op := &request.Operation{ + Name: opUpdateTrialComponent, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateTrialComponentInput{} + } + + output = &UpdateTrialComponentOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateTrialComponent API operation for Amazon SageMaker Service. +// +// Updates one or more properties of a trial component. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation UpdateTrialComponent for usage and error information. +// +// Returned Error Types: +// * ConflictException +// There was a conflict when you attempted to modify an experiment, trial, or +// trial component. +// +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateTrialComponent +func (c *SageMaker) UpdateTrialComponent(input *UpdateTrialComponentInput) (*UpdateTrialComponentOutput, error) { + req, out := c.UpdateTrialComponentRequest(input) + return out, req.Send() +} + +// UpdateTrialComponentWithContext is the same as UpdateTrialComponent with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateTrialComponent for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) UpdateTrialComponentWithContext(ctx aws.Context, input *UpdateTrialComponentInput, opts ...request.Option) (*UpdateTrialComponentOutput, error) { + req, out := c.UpdateTrialComponentRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateUserProfile = "UpdateUserProfile" + +// UpdateUserProfileRequest generates a "aws/request.Request" representing the +// client's request for the UpdateUserProfile operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateUserProfile for more information on using the UpdateUserProfile +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateUserProfileRequest method. +// req, resp := client.UpdateUserProfileRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateUserProfile +func (c *SageMaker) 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) + return +} + +// UpdateUserProfile API operation for Amazon SageMaker Service. +// +// Updates a user profile. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation UpdateUserProfile for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// * ResourceInUse +// Resource being accessed is in use. +// +// * ResourceNotFound +// Resource being access is not found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateUserProfile +func (c *SageMaker) UpdateUserProfile(input *UpdateUserProfileInput) (*UpdateUserProfileOutput, error) { + req, out := c.UpdateUserProfileRequest(input) + return out, req.Send() +} + +// UpdateUserProfileWithContext is the same as UpdateUserProfile with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateUserProfile for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) UpdateUserProfileWithContext(ctx aws.Context, input *UpdateUserProfileInput, opts ...request.Option) (*UpdateUserProfileOutput, error) { + req, out := c.UpdateUserProfileRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateWorkforce = "UpdateWorkforce" + +// UpdateWorkforceRequest generates a "aws/request.Request" representing the +// client's request for the UpdateWorkforce operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateWorkforce for more information on using the UpdateWorkforce +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateWorkforceRequest method. +// req, resp := client.UpdateWorkforceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateWorkforce +func (c *SageMaker) UpdateWorkforceRequest(input *UpdateWorkforceInput) (req *request.Request, output *UpdateWorkforceOutput) { + op := &request.Operation{ + Name: opUpdateWorkforce, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateWorkforceInput{} + } + + output = &UpdateWorkforceOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateWorkforce API operation for Amazon SageMaker Service. +// +// Restricts access to tasks assigned to workers in the specified workforce +// to those within specific ranges of IP addresses. You specify allowed IP addresses +// by creating a list of up to four CIDRs (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html). +// +// By default, a workforce isn't restricted to specific IP addresses. If you +// specify a range of IP addresses, workers who attempt to access tasks using +// any IP address outside the specified range are denied access and get a Not +// Found error message on the worker portal. After restricting access with this +// operation, you can see the allowed IP values for a private workforce with +// the operation. +// +// This operation applies only to private workforces. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation UpdateWorkforce for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateWorkforce +func (c *SageMaker) UpdateWorkforce(input *UpdateWorkforceInput) (*UpdateWorkforceOutput, error) { + req, out := c.UpdateWorkforceRequest(input) + return out, req.Send() +} + +// UpdateWorkforceWithContext is the same as UpdateWorkforce with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateWorkforce for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) UpdateWorkforceWithContext(ctx aws.Context, input *UpdateWorkforceInput, opts ...request.Option) (*UpdateWorkforceOutput, error) { + req, out := c.UpdateWorkforceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateWorkteam = "UpdateWorkteam" + +// UpdateWorkteamRequest generates a "aws/request.Request" representing the +// client's request for the UpdateWorkteam operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateWorkteam for more information on using the UpdateWorkteam +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateWorkteamRequest method. +// req, resp := client.UpdateWorkteamRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateWorkteam +func (c *SageMaker) UpdateWorkteamRequest(input *UpdateWorkteamInput) (req *request.Request, output *UpdateWorkteamOutput) { + op := &request.Operation{ + Name: opUpdateWorkteam, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateWorkteamInput{} + } + + output = &UpdateWorkteamOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateWorkteam API operation for Amazon SageMaker Service. +// +// Updates an existing work team with new member definitions or description. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon SageMaker Service's +// API operation UpdateWorkteam for usage and error information. +// +// Returned Error Types: +// * ResourceLimitExceeded +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/UpdateWorkteam +func (c *SageMaker) UpdateWorkteam(input *UpdateWorkteamInput) (*UpdateWorkteamOutput, error) { + req, out := c.UpdateWorkteamRequest(input) + return out, req.Send() +} + +// UpdateWorkteamWithContext is the same as UpdateWorkteam with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateWorkteam for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SageMaker) UpdateWorkteamWithContext(ctx aws.Context, input *UpdateWorkteamInput, opts ...request.Option) (*UpdateWorkteamOutput, error) { + req, out := c.UpdateWorkteamRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +type AddTagsInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource that you want to tag. + // + // ResourceArn is a required field + ResourceArn *string `type:"string" required:"true"` + + // An array of Tag objects. Each tag is a key-value pair. Only the key parameter + // is required. If you don't specify a value, Amazon SageMaker sets the value + // to an empty string. + // + // 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.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) + } + 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 *AddTagsInput) SetResourceArn(v string) *AddTagsInput { + s.ResourceArn = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *AddTagsInput) SetTags(v []*Tag) *AddTagsInput { + s.Tags = v + return s +} + +type AddTagsOutput struct { + _ struct{} `type:"structure"` + + // A list of tags associated with the Amazon SageMaker resource. + Tags []*Tag `type:"list"` +} + +// 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() +} + +// SetTags sets the Tags field's value. +func (s *AddTagsOutput) SetTags(v []*Tag) *AddTagsOutput { + s.Tags = v + return s +} + +// Specifies the training algorithm to use in a CreateTrainingJob (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateTrainingJob.html) +// request. +// +// For more information about algorithms provided by Amazon SageMaker, see Algorithms +// (https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html). For information +// about using your own algorithms, see Using Your Own Algorithms with Amazon +// SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html). +type AlgorithmSpecification struct { + _ struct{} `type:"structure"` + + // The name of the algorithm resource to use for the training job. This must + // be an algorithm resource that you created or subscribe to on AWS Marketplace. + // If you specify a value for this parameter, you can't specify a value for + // TrainingImage. + AlgorithmName *string `min:"1" type:"string"` + + // To generate and save time-series metrics during training, set to true. The + // default is false and time-series metrics aren't generated except in the following + // cases: + // + // * You use one of the Amazon SageMaker built-in algorithms + // + // * You use one of the following Prebuilt Amazon SageMaker Docker Images + // (https://docs.aws.amazon.com/sagemaker/latest/dg/pre-built-containers-frameworks-deep-learning.html): + // Tensorflow (version >= 1.15) MXNet (version >= 1.6) PyTorch (version >= + // 1.3) + // + // * You specify at least one MetricDefinition + EnableSageMakerMetricsTimeSeries *bool `type:"boolean"` + + // A list of metric definition objects. Each object specifies the metric name + // and regular expressions used to parse algorithm logs. Amazon SageMaker publishes + // each metric to Amazon CloudWatch. + MetricDefinitions []*MetricDefinition `type:"list"` + + // The registry path of the Docker image that contains the training algorithm. + // For information about docker registry paths for built-in algorithms, see + // Algorithms Provided by Amazon SageMaker: Common Parameters (https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-algo-docker-registry-paths.html). + // Amazon SageMaker supports both registry/repository[:tag] and registry/repository[@digest] + // image path formats. For more information, see Using Your Own Algorithms with + // Amazon SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html). + TrainingImage *string `type:"string"` + + // The input mode that the algorithm supports. For the input modes that Amazon + // SageMaker algorithms support, see Algorithms (https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html). + // If an algorithm supports the File input mode, Amazon SageMaker downloads + // the training data from S3 to the provisioned ML storage Volume, and mounts + // the directory to docker volume for training container. If an algorithm supports + // the Pipe input mode, Amazon SageMaker streams data directly from S3 to the + // container. + // + // In File mode, make sure you provision ML storage volume with sufficient capacity + // to accommodate the data download from S3. In addition to the training data, + // the ML storage volume also stores the output model. The algorithm container + // use ML storage volume to also store intermediate information, if any. + // + // For distributed algorithms using File mode, training data is distributed + // uniformly, and your training duration is predictable if the input data objects + // size is approximately same. Amazon SageMaker does not split the files any + // further for model training. If the object sizes are skewed, training won't + // be optimal as the data distribution is also skewed where one host in a training + // cluster is overloaded, thus becoming bottleneck in training. + // + // TrainingInputMode is a required field + TrainingInputMode *string `type:"string" required:"true" enum:"TrainingInputMode"` +} + +// String returns the string representation +func (s AlgorithmSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AlgorithmSpecification) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AlgorithmSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AlgorithmSpecification"} + if s.AlgorithmName != nil && len(*s.AlgorithmName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AlgorithmName", 1)) + } + if s.TrainingInputMode == nil { + invalidParams.Add(request.NewErrParamRequired("TrainingInputMode")) + } + if s.MetricDefinitions != nil { + for i, v := range s.MetricDefinitions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricDefinitions", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAlgorithmName sets the AlgorithmName field's value. +func (s *AlgorithmSpecification) SetAlgorithmName(v string) *AlgorithmSpecification { + s.AlgorithmName = &v + return s +} + +// SetEnableSageMakerMetricsTimeSeries sets the EnableSageMakerMetricsTimeSeries field's value. +func (s *AlgorithmSpecification) SetEnableSageMakerMetricsTimeSeries(v bool) *AlgorithmSpecification { + s.EnableSageMakerMetricsTimeSeries = &v + return s +} + +// SetMetricDefinitions sets the MetricDefinitions field's value. +func (s *AlgorithmSpecification) SetMetricDefinitions(v []*MetricDefinition) *AlgorithmSpecification { + s.MetricDefinitions = v + return s +} + +// SetTrainingImage sets the TrainingImage field's value. +func (s *AlgorithmSpecification) SetTrainingImage(v string) *AlgorithmSpecification { + s.TrainingImage = &v + return s +} + +// SetTrainingInputMode sets the TrainingInputMode field's value. +func (s *AlgorithmSpecification) SetTrainingInputMode(v string) *AlgorithmSpecification { + s.TrainingInputMode = &v + return s +} + +// Specifies the validation and image scan statuses of the algorithm. +type AlgorithmStatusDetails struct { + _ struct{} `type:"structure"` + + // The status of the scan of the algorithm's Docker image container. + ImageScanStatuses []*AlgorithmStatusItem `type:"list"` + + // The status of algorithm validation. + ValidationStatuses []*AlgorithmStatusItem `type:"list"` +} + +// String returns the string representation +func (s AlgorithmStatusDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AlgorithmStatusDetails) GoString() string { + return s.String() +} + +// SetImageScanStatuses sets the ImageScanStatuses field's value. +func (s *AlgorithmStatusDetails) SetImageScanStatuses(v []*AlgorithmStatusItem) *AlgorithmStatusDetails { + s.ImageScanStatuses = v + return s +} + +// SetValidationStatuses sets the ValidationStatuses field's value. +func (s *AlgorithmStatusDetails) SetValidationStatuses(v []*AlgorithmStatusItem) *AlgorithmStatusDetails { + s.ValidationStatuses = v + return s +} + +// Represents the overall status of an algorithm. +type AlgorithmStatusItem struct { + _ struct{} `type:"structure"` + + // if the overall status is Failed, the reason for the failure. + FailureReason *string `type:"string"` + + // The name of the algorithm for which the overall status is being reported. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The current status. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"DetailedAlgorithmStatus"` +} + +// String returns the string representation +func (s AlgorithmStatusItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AlgorithmStatusItem) GoString() string { + return s.String() +} + +// SetFailureReason sets the FailureReason field's value. +func (s *AlgorithmStatusItem) SetFailureReason(v string) *AlgorithmStatusItem { + s.FailureReason = &v + return s +} + +// SetName sets the Name field's value. +func (s *AlgorithmStatusItem) SetName(v string) *AlgorithmStatusItem { + s.Name = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *AlgorithmStatusItem) SetStatus(v string) *AlgorithmStatusItem { + s.Status = &v + return s +} + +// Provides summary information about an algorithm. +type AlgorithmSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the algorithm. + // + // AlgorithmArn is a required field + AlgorithmArn *string `min:"1" type:"string" required:"true"` + + // A brief description of the algorithm. + AlgorithmDescription *string `type:"string"` + + // The name of the algorithm that is described by the summary. + // + // AlgorithmName is a required field + AlgorithmName *string `min:"1" type:"string" required:"true"` + + // The overall status of the algorithm. + // + // AlgorithmStatus is a required field + AlgorithmStatus *string `type:"string" required:"true" enum:"AlgorithmStatus"` + + // A timestamp that shows when the algorithm was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` +} + +// String returns the string representation +func (s AlgorithmSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AlgorithmSummary) GoString() string { + return s.String() +} + +// SetAlgorithmArn sets the AlgorithmArn field's value. +func (s *AlgorithmSummary) SetAlgorithmArn(v string) *AlgorithmSummary { + s.AlgorithmArn = &v + return s +} + +// SetAlgorithmDescription sets the AlgorithmDescription field's value. +func (s *AlgorithmSummary) SetAlgorithmDescription(v string) *AlgorithmSummary { + s.AlgorithmDescription = &v + return s +} + +// SetAlgorithmName sets the AlgorithmName field's value. +func (s *AlgorithmSummary) SetAlgorithmName(v string) *AlgorithmSummary { + s.AlgorithmName = &v + return s +} + +// SetAlgorithmStatus sets the AlgorithmStatus field's value. +func (s *AlgorithmSummary) SetAlgorithmStatus(v string) *AlgorithmSummary { + s.AlgorithmStatus = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *AlgorithmSummary) SetCreationTime(v time.Time) *AlgorithmSummary { + s.CreationTime = &v + return s +} + +// Defines a training job and a batch transform job that Amazon SageMaker runs +// to validate your algorithm. +// +// The data provided in the validation profile is made available to your buyers +// on AWS Marketplace. +type AlgorithmValidationProfile struct { + _ struct{} `type:"structure"` + + // The name of the profile for the algorithm. The name must have 1 to 63 characters. + // Valid characters are a-z, A-Z, 0-9, and - (hyphen). + // + // ProfileName is a required field + ProfileName *string `min:"1" type:"string" required:"true"` + + // The TrainingJobDefinition object that describes the training job that Amazon + // SageMaker runs to validate your algorithm. + // + // TrainingJobDefinition is a required field + TrainingJobDefinition *TrainingJobDefinition `type:"structure" required:"true"` + + // The TransformJobDefinition object that describes the transform job that Amazon + // SageMaker runs to validate your algorithm. + TransformJobDefinition *TransformJobDefinition `type:"structure"` +} + +// String returns the string representation +func (s AlgorithmValidationProfile) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AlgorithmValidationProfile) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AlgorithmValidationProfile) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AlgorithmValidationProfile"} + if s.ProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("ProfileName")) + } + if s.ProfileName != nil && len(*s.ProfileName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ProfileName", 1)) + } + if s.TrainingJobDefinition == nil { + invalidParams.Add(request.NewErrParamRequired("TrainingJobDefinition")) + } + if s.TrainingJobDefinition != nil { + if err := s.TrainingJobDefinition.Validate(); err != nil { + invalidParams.AddNested("TrainingJobDefinition", err.(request.ErrInvalidParams)) + } + } + if s.TransformJobDefinition != nil { + if err := s.TransformJobDefinition.Validate(); err != nil { + invalidParams.AddNested("TransformJobDefinition", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetProfileName sets the ProfileName field's value. +func (s *AlgorithmValidationProfile) SetProfileName(v string) *AlgorithmValidationProfile { + s.ProfileName = &v + return s +} + +// SetTrainingJobDefinition sets the TrainingJobDefinition field's value. +func (s *AlgorithmValidationProfile) SetTrainingJobDefinition(v *TrainingJobDefinition) *AlgorithmValidationProfile { + s.TrainingJobDefinition = v + return s +} + +// SetTransformJobDefinition sets the TransformJobDefinition field's value. +func (s *AlgorithmValidationProfile) SetTransformJobDefinition(v *TransformJobDefinition) *AlgorithmValidationProfile { + s.TransformJobDefinition = v + return s +} + +// Specifies configurations for one or more training jobs that Amazon SageMaker +// runs to test the algorithm. +type AlgorithmValidationSpecification struct { + _ struct{} `type:"structure"` + + // An array of AlgorithmValidationProfile objects, each of which specifies a + // training job and batch transform job that Amazon SageMaker runs to validate + // your algorithm. + // + // ValidationProfiles is a required field + ValidationProfiles []*AlgorithmValidationProfile `min:"1" type:"list" required:"true"` + + // The IAM roles that Amazon SageMaker uses to run the training jobs. + // + // ValidationRole is a required field + ValidationRole *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s AlgorithmValidationSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AlgorithmValidationSpecification) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AlgorithmValidationSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AlgorithmValidationSpecification"} + if s.ValidationProfiles == nil { + invalidParams.Add(request.NewErrParamRequired("ValidationProfiles")) + } + if s.ValidationProfiles != nil && len(s.ValidationProfiles) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ValidationProfiles", 1)) + } + if s.ValidationRole == nil { + invalidParams.Add(request.NewErrParamRequired("ValidationRole")) + } + if s.ValidationRole != nil && len(*s.ValidationRole) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ValidationRole", 20)) + } + if s.ValidationProfiles != nil { + for i, v := range s.ValidationProfiles { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ValidationProfiles", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetValidationProfiles sets the ValidationProfiles field's value. +func (s *AlgorithmValidationSpecification) SetValidationProfiles(v []*AlgorithmValidationProfile) *AlgorithmValidationSpecification { + s.ValidationProfiles = v + return s +} + +// SetValidationRole sets the ValidationRole field's value. +func (s *AlgorithmValidationSpecification) SetValidationRole(v string) *AlgorithmValidationSpecification { + s.ValidationRole = &v + return s +} + +// Configures how labels are consolidated across human workers. +type AnnotationConsolidationConfig struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of a Lambda function implements the logic + // for annotation consolidation. + // + // For the built-in bounding box, image classification, semantic segmentation, + // and text classification task types, Amazon SageMaker Ground Truth provides + // the following Lambda functions: + // + // * Bounding box - Finds the most similar boxes from different workers based + // on the Jaccard index of the boxes. arn:aws:lambda:us-east-1:432418664414:function:ACS-BoundingBox + // arn:aws:lambda:us-east-2:266458841044:function:ACS-BoundingBox arn:aws:lambda:us-west-2:081040173940:function:ACS-BoundingBox + // arn:aws:lambda:eu-west-1:568282634449:function:ACS-BoundingBox arn:aws:lambda:ap-northeast-1:477331159723:function:ACS-BoundingBox + // arn:aws:lambda:ap-southeast-2:454466003867:function:ACS-BoundingBox arn:aws:lambda:ap-south-1:565803892007:function:ACS-BoundingBox + // arn:aws:lambda:eu-central-1:203001061592:function:ACS-BoundingBox arn:aws:lambda:ap-northeast-2:845288260483:function:ACS-BoundingBox + // arn:aws:lambda:eu-west-2:487402164563:function:ACS-BoundingBox arn:aws:lambda:ap-southeast-1:377565633583:function:ACS-BoundingBox + // arn:aws:lambda:ca-central-1:918755190332:function:ACS-BoundingBox + // + // * Image classification - Uses a variant of the Expectation Maximization + // approach to estimate the true class of an image based on annotations from + // individual workers. arn:aws:lambda:us-east-1:432418664414:function:ACS-ImageMultiClass + // arn:aws:lambda:us-east-2:266458841044:function:ACS-ImageMultiClass arn:aws:lambda:us-west-2:081040173940:function:ACS-ImageMultiClass + // arn:aws:lambda:eu-west-1:568282634449:function:ACS-ImageMultiClass arn:aws:lambda:ap-northeast-1:477331159723:function:ACS-ImageMultiClass + // arn:aws:lambda:ap-southeast-2:454466003867:function:ACS-ImageMultiClass + // arn:aws:lambda:ap-south-1:565803892007:function:ACS-ImageMultiClass arn:aws:lambda:eu-central-1:203001061592:function:ACS-ImageMultiClass + // arn:aws:lambda:ap-northeast-2:845288260483:function:ACS-ImageMultiClass + // arn:aws:lambda:eu-west-2:487402164563:function:ACS-ImageMultiClass arn:aws:lambda:ap-southeast-1:377565633583:function:ACS-ImageMultiClass + // arn:aws:lambda:ca-central-1:918755190332:function:ACS-ImageMultiClass + // + // * Semantic segmentation - Treats each pixel in an image as a multi-class + // classification and treats pixel annotations from workers as "votes" for + // the correct label. arn:aws:lambda:us-east-1:432418664414:function:ACS-SemanticSegmentation + // arn:aws:lambda:us-east-2:266458841044:function:ACS-SemanticSegmentation + // arn:aws:lambda:us-west-2:081040173940:function:ACS-SemanticSegmentation + // arn:aws:lambda:eu-west-1:568282634449:function:ACS-SemanticSegmentation + // arn:aws:lambda:ap-northeast-1:477331159723:function:ACS-SemanticSegmentation + // arn:aws:lambda:ap-southeast-2:454466003867:function:ACS-SemanticSegmentation + // arn:aws:lambda:ap-south-1:565803892007:function:ACS-SemanticSegmentation + // arn:aws:lambda:eu-central-1:203001061592:function:ACS-SemanticSegmentation + // arn:aws:lambda:ap-northeast-2:845288260483:function:ACS-SemanticSegmentation + // arn:aws:lambda:eu-west-2:487402164563:function:ACS-SemanticSegmentation + // arn:aws:lambda:ap-southeast-1:377565633583:function:ACS-SemanticSegmentation + // arn:aws:lambda:ca-central-1:918755190332:function:ACS-SemanticSegmentation + // + // * Text classification - Uses a variant of the Expectation Maximization + // approach to estimate the true class of text based on annotations from + // individual workers. arn:aws:lambda:us-east-1:432418664414:function:ACS-TextMultiClass + // arn:aws:lambda:us-east-2:266458841044:function:ACS-TextMultiClass arn:aws:lambda:us-west-2:081040173940:function:ACS-TextMultiClass + // arn:aws:lambda:eu-west-1:568282634449:function:ACS-TextMultiClass arn:aws:lambda:ap-northeast-1:477331159723:function:ACS-TextMultiClass + // arn:aws:lambda:ap-southeast-2:454466003867:function:ACS-TextMultiClass + // arn:aws:lambda:ap-south-1:565803892007:function:ACS-TextMultiClass arn:aws:lambda:eu-central-1:203001061592:function:ACS-TextMultiClass + // arn:aws:lambda:ap-northeast-2:845288260483:function:ACS-TextMultiClass + // arn:aws:lambda:eu-west-2:487402164563:function:ACS-TextMultiClass arn:aws:lambda:ap-southeast-1:377565633583:function:ACS-TextMultiClass + // arn:aws:lambda:ca-central-1:918755190332:function:ACS-TextMultiClass + // + // * Named entity recognition - Groups similar selections and calculates + // aggregate boundaries, resolving to most-assigned label. arn:aws:lambda:us-east-1:432418664414:function:ACS-NamedEntityRecognition + // arn:aws:lambda:us-east-2:266458841044:function:ACS-NamedEntityRecognition + // arn:aws:lambda:us-west-2:081040173940:function:ACS-NamedEntityRecognition + // arn:aws:lambda:eu-west-1:568282634449:function:ACS-NamedEntityRecognition + // arn:aws:lambda:ap-northeast-1:477331159723:function:ACS-NamedEntityRecognition + // arn:aws:lambda:ap-southeast-2:454466003867:function:ACS-NamedEntityRecognition + // arn:aws:lambda:ap-south-1:565803892007:function:ACS-NamedEntityRecognition + // arn:aws:lambda:eu-central-1:203001061592:function:ACS-NamedEntityRecognition + // arn:aws:lambda:ap-northeast-2:845288260483:function:ACS-NamedEntityRecognition + // arn:aws:lambda:eu-west-2:487402164563:function:ACS-NamedEntityRecognition + // arn:aws:lambda:ap-southeast-1:377565633583:function:ACS-NamedEntityRecognition + // arn:aws:lambda:ca-central-1:918755190332:function:ACS-NamedEntityRecognition + // + // * Bounding box verification - Uses a variant of the Expectation Maximization + // approach to estimate the true class of verification judgement for bounding + // box labels based on annotations from individual workers. arn:aws:lambda:us-east-1:432418664414:function:ACS-VerificationBoundingBox + // arn:aws:lambda:us-east-2:266458841044:function:ACS-VerificationBoundingBox + // arn:aws:lambda:us-west-2:081040173940:function:ACS-VerificationBoundingBox + // arn:aws:lambda:eu-west-1:568282634449:function:ACS-VerificationBoundingBox + // arn:aws:lambda:ap-northeast-1:477331159723:function:ACS-VerificationBoundingBox + // arn:aws:lambda:ap-southeast-2:454466003867:function:ACS-VerificationBoundingBox + // arn:aws:lambda:ap-south-1:565803892007:function:ACS-VerificationBoundingBox + // arn:aws:lambda:eu-central-1:203001061592:function:ACS-VerificationBoundingBox + // arn:aws:lambda:ap-northeast-2:845288260483:function:ACS-VerificationBoundingBox + // arn:aws:lambda:eu-west-2:487402164563:function:ACS-VerificationBoundingBox + // arn:aws:lambda:ap-southeast-1:377565633583:function:ACS-VerificationBoundingBox + // arn:aws:lambda:ca-central-1:918755190332:function:ACS-VerificationBoundingBox + // + // * Semantic segmentation verification - Uses a variant of the Expectation + // Maximization approach to estimate the true class of verification judgment + // for semantic segmentation labels based on annotations from individual + // workers. arn:aws:lambda:us-east-1:432418664414:function:ACS-VerificationSemanticSegmentation + // arn:aws:lambda:us-east-2:266458841044:function:ACS-VerificationSemanticSegmentation + // arn:aws:lambda:us-west-2:081040173940:function:ACS-VerificationSemanticSegmentation + // arn:aws:lambda:eu-west-1:568282634449:function:ACS-VerificationSemanticSegmentation + // arn:aws:lambda:ap-northeast-1:477331159723:function:ACS-VerificationSemanticSegmentation + // arn:aws:lambda:ap-southeast-2:454466003867:function:ACS-VerificationSemanticSegmentation + // arn:aws:lambda:ap-south-1:565803892007:function:ACS-VerificationSemanticSegmentation + // arn:aws:lambda:eu-central-1:203001061592:function:ACS-VerificationSemanticSegmentation + // arn:aws:lambda:ap-northeast-2:845288260483:function:ACS-VerificationSemanticSegmentation + // arn:aws:lambda:eu-west-2:487402164563:function:ACS-VerificationSemanticSegmentation + // arn:aws:lambda:ap-southeast-1:377565633583:function:ACS-VerificationSemanticSegmentation + // arn:aws:lambda:ca-central-1:918755190332:function:ACS-VerificationSemanticSegmentation + // + // * Bounding box adjustment - Finds the most similar boxes from different + // workers based on the Jaccard index of the adjusted annotations. arn:aws:lambda:us-east-1:432418664414:function:ACS-AdjustmentBoundingBox + // arn:aws:lambda:us-east-2:266458841044:function:ACS-AdjustmentBoundingBox + // arn:aws:lambda:us-west-2:081040173940:function:ACS-AdjustmentBoundingBox + // arn:aws:lambda:eu-west-1:568282634449:function:ACS-AdjustmentBoundingBox + // arn:aws:lambda:ap-northeast-1:477331159723:function:ACS-AdjustmentBoundingBox + // arn:aws:lambda:ap-southeast-2:454466003867:function:ACS-AdjustmentBoundingBox + // arn:aws:lambda:ap-south-1:565803892007:function:ACS-AdjustmentBoundingBox + // arn:aws:lambda:eu-central-1:203001061592:function:ACS-AdjustmentBoundingBox + // arn:aws:lambda:ap-northeast-2:845288260483:function:ACS-AdjustmentBoundingBox + // arn:aws:lambda:eu-west-2:487402164563:function:ACS-AdjustmentBoundingBox + // arn:aws:lambda:ap-southeast-1:377565633583:function:ACS-AdjustmentBoundingBox + // arn:aws:lambda:ca-central-1:918755190332:function:ACS-AdjustmentBoundingBox + // + // * Semantic segmentation adjustment - Treats each pixel in an image as + // a multi-class classification and treats pixel adjusted annotations from + // workers as "votes" for the correct label. arn:aws:lambda:us-east-1:432418664414:function:ACS-AdjustmentSemanticSegmentation + // arn:aws:lambda:us-east-2:266458841044:function:ACS-AdjustmentSemanticSegmentation + // arn:aws:lambda:us-west-2:081040173940:function:ACS-AdjustmentSemanticSegmentation + // arn:aws:lambda:eu-west-1:568282634449:function:ACS-AdjustmentSemanticSegmentation + // arn:aws:lambda:ap-northeast-1:477331159723:function:ACS-AdjustmentSemanticSegmentation + // arn:aws:lambda:ap-southeast-2:454466003867:function:ACS-AdjustmentSemanticSegmentation + // arn:aws:lambda:ap-south-1:565803892007:function:ACS-AdjustmentSemanticSegmentation + // arn:aws:lambda:eu-central-1:203001061592:function:ACS-AdjustmentSemanticSegmentation + // arn:aws:lambda:ap-northeast-2:845288260483:function:ACS-AdjustmentSemanticSegmentation + // arn:aws:lambda:eu-west-2:487402164563:function:ACS-AdjustmentSemanticSegmentation + // arn:aws:lambda:ap-southeast-1:377565633583:function:ACS-AdjustmentSemanticSegmentation + // arn:aws:lambda:ca-central-1:918755190332:function:ACS-AdjustmentSemanticSegmentation + // + // For more information, see Annotation Consolidation (https://docs.aws.amazon.com/sagemaker/latest/dg/sms-annotation-consolidation.html). + // + // AnnotationConsolidationLambdaArn is a required field + AnnotationConsolidationLambdaArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AnnotationConsolidationConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AnnotationConsolidationConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AnnotationConsolidationConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AnnotationConsolidationConfig"} + if s.AnnotationConsolidationLambdaArn == nil { + invalidParams.Add(request.NewErrParamRequired("AnnotationConsolidationLambdaArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAnnotationConsolidationLambdaArn sets the AnnotationConsolidationLambdaArn field's value. +func (s *AnnotationConsolidationConfig) SetAnnotationConsolidationLambdaArn(v string) *AnnotationConsolidationConfig { + s.AnnotationConsolidationLambdaArn = &v + return s +} + +// The app's details. +type AppDetails struct { + _ struct{} `type:"structure"` + + // The name of the app. + AppName *string `type:"string"` + + // The type of app. + AppType *string `type:"string" enum:"AppType"` + + // The creation time. + CreationTime *time.Time `type:"timestamp"` + + // The domain ID. + DomainId *string `type:"string"` + + // The status. + Status *string `type:"string" enum:"AppStatus"` + + // The user profile name. + UserProfileName *string `type:"string"` +} + +// String returns the string representation +func (s AppDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AppDetails) GoString() string { + return s.String() +} + +// SetAppName sets the AppName field's value. +func (s *AppDetails) SetAppName(v string) *AppDetails { + s.AppName = &v + return s +} + +// SetAppType sets the AppType field's value. +func (s *AppDetails) SetAppType(v string) *AppDetails { + s.AppType = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *AppDetails) SetCreationTime(v time.Time) *AppDetails { + s.CreationTime = &v + return s +} + +// SetDomainId sets the DomainId field's value. +func (s *AppDetails) SetDomainId(v string) *AppDetails { + s.DomainId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *AppDetails) SetStatus(v string) *AppDetails { + s.Status = &v + return s +} + +// SetUserProfileName sets the UserProfileName field's value. +func (s *AppDetails) SetUserProfileName(v string) *AppDetails { + s.UserProfileName = &v + return s +} + +// Configuration to run a processing job in a specified container image. +type AppSpecification struct { + _ struct{} `type:"structure"` + + // The arguments for a container used to run a processing job. + ContainerArguments []*string `min:"1" type:"list"` + + // The entrypoint for a container used to run a processing job. + ContainerEntrypoint []*string `min:"1" type:"list"` + + // The container image to be run by the processing job. + // + // ImageUri is a required field + ImageUri *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AppSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AppSpecification) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AppSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AppSpecification"} + if s.ContainerArguments != nil && len(s.ContainerArguments) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ContainerArguments", 1)) + } + if s.ContainerEntrypoint != nil && len(s.ContainerEntrypoint) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ContainerEntrypoint", 1)) + } + if s.ImageUri == nil { + invalidParams.Add(request.NewErrParamRequired("ImageUri")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetContainerArguments sets the ContainerArguments field's value. +func (s *AppSpecification) SetContainerArguments(v []*string) *AppSpecification { + s.ContainerArguments = v + return s +} + +// SetContainerEntrypoint sets the ContainerEntrypoint field's value. +func (s *AppSpecification) SetContainerEntrypoint(v []*string) *AppSpecification { + s.ContainerEntrypoint = v + return s +} + +// SetImageUri sets the ImageUri field's value. +func (s *AppSpecification) SetImageUri(v string) *AppSpecification { + s.ImageUri = &v + return s +} + +type AssociateTrialComponentInput struct { + _ struct{} `type:"structure"` + + // The name of the component to associated with the trial. + // + // TrialComponentName is a required field + TrialComponentName *string `min:"1" type:"string" required:"true"` + + // The name of the trial to associate with. + // + // TrialName is a required field + TrialName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s AssociateTrialComponentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateTrialComponentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssociateTrialComponentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssociateTrialComponentInput"} + if s.TrialComponentName == nil { + invalidParams.Add(request.NewErrParamRequired("TrialComponentName")) + } + if s.TrialComponentName != nil && len(*s.TrialComponentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialComponentName", 1)) + } + if s.TrialName == nil { + invalidParams.Add(request.NewErrParamRequired("TrialName")) + } + if s.TrialName != nil && len(*s.TrialName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTrialComponentName sets the TrialComponentName field's value. +func (s *AssociateTrialComponentInput) SetTrialComponentName(v string) *AssociateTrialComponentInput { + s.TrialComponentName = &v + return s +} + +// SetTrialName sets the TrialName field's value. +func (s *AssociateTrialComponentInput) SetTrialName(v string) *AssociateTrialComponentInput { + s.TrialName = &v + return s +} + +type AssociateTrialComponentOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the trial. + TrialArn *string `type:"string"` + + // The ARN of the trial component. + TrialComponentArn *string `type:"string"` +} + +// String returns the string representation +func (s AssociateTrialComponentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateTrialComponentOutput) GoString() string { + return s.String() +} + +// SetTrialArn sets the TrialArn field's value. +func (s *AssociateTrialComponentOutput) SetTrialArn(v string) *AssociateTrialComponentOutput { + s.TrialArn = &v + return s +} + +// SetTrialComponentArn sets the TrialComponentArn field's value. +func (s *AssociateTrialComponentOutput) SetTrialComponentArn(v string) *AssociateTrialComponentOutput { + s.TrialComponentArn = &v + return s +} + +// An AutoPilot job will return recommendations, or candidates. Each candidate +// has futher details about the steps involed, and the status. +type AutoMLCandidate struct { + _ struct{} `type:"structure"` + + // The candidate name. + // + // CandidateName is a required field + CandidateName *string `min:"1" type:"string" required:"true"` + + // The candidate's status. + // + // CandidateStatus is a required field + CandidateStatus *string `type:"string" required:"true" enum:"CandidateStatus"` + + // The candidate's steps. + // + // CandidateSteps is a required field + CandidateSteps []*AutoMLCandidateStep `type:"list" required:"true"` + + // The creation time. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // The end time. + EndTime *time.Time `type:"timestamp"` + + // The failure reason. + FailureReason *string `type:"string"` + + // The candidate result from a job. + FinalAutoMLJobObjectiveMetric *FinalAutoMLJobObjectiveMetric `type:"structure"` + + // The inference containers. + InferenceContainers []*AutoMLContainerDefinition `type:"list"` + + // The last modified time. + // + // LastModifiedTime is a required field + LastModifiedTime *time.Time `type:"timestamp" required:"true"` + + // The objective status. + // + // ObjectiveStatus is a required field + ObjectiveStatus *string `type:"string" required:"true" enum:"ObjectiveStatus"` +} + +// String returns the string representation +func (s AutoMLCandidate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoMLCandidate) GoString() string { + return s.String() +} + +// SetCandidateName sets the CandidateName field's value. +func (s *AutoMLCandidate) SetCandidateName(v string) *AutoMLCandidate { + s.CandidateName = &v + return s +} + +// SetCandidateStatus sets the CandidateStatus field's value. +func (s *AutoMLCandidate) SetCandidateStatus(v string) *AutoMLCandidate { + s.CandidateStatus = &v + return s +} + +// SetCandidateSteps sets the CandidateSteps field's value. +func (s *AutoMLCandidate) SetCandidateSteps(v []*AutoMLCandidateStep) *AutoMLCandidate { + s.CandidateSteps = v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *AutoMLCandidate) SetCreationTime(v time.Time) *AutoMLCandidate { + s.CreationTime = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *AutoMLCandidate) SetEndTime(v time.Time) *AutoMLCandidate { + s.EndTime = &v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *AutoMLCandidate) SetFailureReason(v string) *AutoMLCandidate { + s.FailureReason = &v + return s +} + +// SetFinalAutoMLJobObjectiveMetric sets the FinalAutoMLJobObjectiveMetric field's value. +func (s *AutoMLCandidate) SetFinalAutoMLJobObjectiveMetric(v *FinalAutoMLJobObjectiveMetric) *AutoMLCandidate { + s.FinalAutoMLJobObjectiveMetric = v + return s +} + +// SetInferenceContainers sets the InferenceContainers field's value. +func (s *AutoMLCandidate) SetInferenceContainers(v []*AutoMLContainerDefinition) *AutoMLCandidate { + s.InferenceContainers = v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *AutoMLCandidate) SetLastModifiedTime(v time.Time) *AutoMLCandidate { + s.LastModifiedTime = &v + return s +} + +// SetObjectiveStatus sets the ObjectiveStatus field's value. +func (s *AutoMLCandidate) SetObjectiveStatus(v string) *AutoMLCandidate { + s.ObjectiveStatus = &v + return s +} + +// Information about the steps for a Candidate, and what step it is working +// on. +type AutoMLCandidateStep struct { + _ struct{} `type:"structure"` + + // The ARN for the Candidate's step. + // + // CandidateStepArn is a required field + CandidateStepArn *string `min:"1" type:"string" required:"true"` + + // The name for the Candidate's step. + // + // CandidateStepName is a required field + CandidateStepName *string `min:"1" type:"string" required:"true"` + + // Whether the Candidate is at the transform, training, or processing step. + // + // CandidateStepType is a required field + CandidateStepType *string `type:"string" required:"true" enum:"CandidateStepType"` +} + +// String returns the string representation +func (s AutoMLCandidateStep) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoMLCandidateStep) GoString() string { + return s.String() +} + +// SetCandidateStepArn sets the CandidateStepArn field's value. +func (s *AutoMLCandidateStep) SetCandidateStepArn(v string) *AutoMLCandidateStep { + s.CandidateStepArn = &v + return s +} + +// SetCandidateStepName sets the CandidateStepName field's value. +func (s *AutoMLCandidateStep) SetCandidateStepName(v string) *AutoMLCandidateStep { + s.CandidateStepName = &v + return s +} + +// SetCandidateStepType sets the CandidateStepType field's value. +func (s *AutoMLCandidateStep) SetCandidateStepType(v string) *AutoMLCandidateStep { + s.CandidateStepType = &v + return s +} + +// Similar to Channel. A channel is a named input source that training algorithms +// can consume. Refer to Channel for detailed descriptions. +type AutoMLChannel struct { + _ struct{} `type:"structure"` + + // You can use Gzip or None. The default value is None. + CompressionType *string `type:"string" enum:"CompressionType"` + + // The data source. + // + // DataSource is a required field + DataSource *AutoMLDataSource `type:"structure" required:"true"` + + // The name of the target variable in supervised learning, a.k.a. 'y'. + // + // TargetAttributeName is a required field + TargetAttributeName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s AutoMLChannel) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoMLChannel) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AutoMLChannel) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AutoMLChannel"} + if s.DataSource == nil { + invalidParams.Add(request.NewErrParamRequired("DataSource")) + } + if s.TargetAttributeName == nil { + invalidParams.Add(request.NewErrParamRequired("TargetAttributeName")) + } + if s.TargetAttributeName != nil && len(*s.TargetAttributeName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TargetAttributeName", 1)) + } + if s.DataSource != nil { + if err := s.DataSource.Validate(); err != nil { + invalidParams.AddNested("DataSource", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCompressionType sets the CompressionType field's value. +func (s *AutoMLChannel) SetCompressionType(v string) *AutoMLChannel { + s.CompressionType = &v + return s +} + +// SetDataSource sets the DataSource field's value. +func (s *AutoMLChannel) SetDataSource(v *AutoMLDataSource) *AutoMLChannel { + s.DataSource = v + return s +} + +// SetTargetAttributeName sets the TargetAttributeName field's value. +func (s *AutoMLChannel) SetTargetAttributeName(v string) *AutoMLChannel { + s.TargetAttributeName = &v + return s +} + +// A list of container definitions that describe the different containers that +// make up one AutoML candidate. Refer to ContainerDefinition for more details. +type AutoMLContainerDefinition struct { + _ struct{} `type:"structure"` + + // Environment variables to set in the container. Refer to ContainerDefinition + // for more details. + Environment map[string]*string `type:"map"` + + // The ECR path of the container. Refer to ContainerDefinition for more details. + // + // Image is a required field + Image *string `type:"string" required:"true"` + + // The location of the model artifacts. Refer to ContainerDefinition for more + // details. + // + // ModelDataUrl is a required field + ModelDataUrl *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AutoMLContainerDefinition) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoMLContainerDefinition) GoString() string { + return s.String() +} + +// SetEnvironment sets the Environment field's value. +func (s *AutoMLContainerDefinition) SetEnvironment(v map[string]*string) *AutoMLContainerDefinition { + s.Environment = v + return s +} + +// SetImage sets the Image field's value. +func (s *AutoMLContainerDefinition) SetImage(v string) *AutoMLContainerDefinition { + s.Image = &v + return s +} + +// SetModelDataUrl sets the ModelDataUrl field's value. +func (s *AutoMLContainerDefinition) SetModelDataUrl(v string) *AutoMLContainerDefinition { + s.ModelDataUrl = &v + return s +} + +// The data source for the AutoPilot job. +type AutoMLDataSource struct { + _ struct{} `type:"structure"` + + // The Amazon S3 location of the data. + // + // S3DataSource is a required field + S3DataSource *AutoMLS3DataSource `type:"structure" required:"true"` +} + +// String returns the string representation +func (s AutoMLDataSource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoMLDataSource) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AutoMLDataSource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AutoMLDataSource"} + if s.S3DataSource == nil { + invalidParams.Add(request.NewErrParamRequired("S3DataSource")) + } + if s.S3DataSource != nil { + if err := s.S3DataSource.Validate(); err != nil { + invalidParams.AddNested("S3DataSource", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetS3DataSource sets the S3DataSource field's value. +func (s *AutoMLDataSource) SetS3DataSource(v *AutoMLS3DataSource) *AutoMLDataSource { + s.S3DataSource = v + return s +} + +// Artifacts that are generation during a job. +type AutoMLJobArtifacts struct { + _ struct{} `type:"structure"` + + // The URL to the notebook location. + CandidateDefinitionNotebookLocation *string `min:"1" type:"string"` + + // The URL to the notebook location. + DataExplorationNotebookLocation *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s AutoMLJobArtifacts) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoMLJobArtifacts) GoString() string { + return s.String() +} + +// SetCandidateDefinitionNotebookLocation sets the CandidateDefinitionNotebookLocation field's value. +func (s *AutoMLJobArtifacts) SetCandidateDefinitionNotebookLocation(v string) *AutoMLJobArtifacts { + s.CandidateDefinitionNotebookLocation = &v + return s +} + +// SetDataExplorationNotebookLocation sets the DataExplorationNotebookLocation field's value. +func (s *AutoMLJobArtifacts) SetDataExplorationNotebookLocation(v string) *AutoMLJobArtifacts { + s.DataExplorationNotebookLocation = &v + return s +} + +// How long a job is allowed to run, or how many candidates a job is allowed +// to generate. +type AutoMLJobCompletionCriteria struct { + _ struct{} `type:"structure"` + + // The maximum time, in seconds, an AutoML job is allowed to wait for a trial + // to complete. It must be equal to or greater than MaxRuntimePerTrainingJobInSeconds. + MaxAutoMLJobRuntimeInSeconds *int64 `min:"1" type:"integer"` + + // The maximum number of times a training job is allowed to run. + MaxCandidates *int64 `min:"1" type:"integer"` + + // The maximum time, in seconds, a job is allowed to run. + MaxRuntimePerTrainingJobInSeconds *int64 `min:"1" type:"integer"` +} + +// String returns the string representation +func (s AutoMLJobCompletionCriteria) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoMLJobCompletionCriteria) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AutoMLJobCompletionCriteria) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AutoMLJobCompletionCriteria"} + if s.MaxAutoMLJobRuntimeInSeconds != nil && *s.MaxAutoMLJobRuntimeInSeconds < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxAutoMLJobRuntimeInSeconds", 1)) + } + if s.MaxCandidates != nil && *s.MaxCandidates < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxCandidates", 1)) + } + if s.MaxRuntimePerTrainingJobInSeconds != nil && *s.MaxRuntimePerTrainingJobInSeconds < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxRuntimePerTrainingJobInSeconds", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxAutoMLJobRuntimeInSeconds sets the MaxAutoMLJobRuntimeInSeconds field's value. +func (s *AutoMLJobCompletionCriteria) SetMaxAutoMLJobRuntimeInSeconds(v int64) *AutoMLJobCompletionCriteria { + s.MaxAutoMLJobRuntimeInSeconds = &v + return s +} + +// SetMaxCandidates sets the MaxCandidates field's value. +func (s *AutoMLJobCompletionCriteria) SetMaxCandidates(v int64) *AutoMLJobCompletionCriteria { + s.MaxCandidates = &v + return s +} + +// SetMaxRuntimePerTrainingJobInSeconds sets the MaxRuntimePerTrainingJobInSeconds field's value. +func (s *AutoMLJobCompletionCriteria) SetMaxRuntimePerTrainingJobInSeconds(v int64) *AutoMLJobCompletionCriteria { + s.MaxRuntimePerTrainingJobInSeconds = &v + return s +} + +// A collection of settings used for a job. +type AutoMLJobConfig struct { + _ struct{} `type:"structure"` + + // How long a job is allowed to run, or how many candidates a job is allowed + // to generate. + CompletionCriteria *AutoMLJobCompletionCriteria `type:"structure"` + + // Security configuration for traffic encryption or Amazon VPC settings. + SecurityConfig *AutoMLSecurityConfig `type:"structure"` +} + +// String returns the string representation +func (s AutoMLJobConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoMLJobConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AutoMLJobConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AutoMLJobConfig"} + if s.CompletionCriteria != nil { + if err := s.CompletionCriteria.Validate(); err != nil { + invalidParams.AddNested("CompletionCriteria", err.(request.ErrInvalidParams)) + } + } + if s.SecurityConfig != nil { + if err := s.SecurityConfig.Validate(); err != nil { + invalidParams.AddNested("SecurityConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCompletionCriteria sets the CompletionCriteria field's value. +func (s *AutoMLJobConfig) SetCompletionCriteria(v *AutoMLJobCompletionCriteria) *AutoMLJobConfig { + s.CompletionCriteria = v + return s +} + +// SetSecurityConfig sets the SecurityConfig field's value. +func (s *AutoMLJobConfig) SetSecurityConfig(v *AutoMLSecurityConfig) *AutoMLJobConfig { + s.SecurityConfig = v + return s +} + +// Applies a metric to minimize or maximize for the job's objective. +type AutoMLJobObjective struct { + _ struct{} `type:"structure"` + + // The name of the metric. + // + // MetricName is a required field + MetricName *string `type:"string" required:"true" enum:"AutoMLMetricEnum"` +} + +// String returns the string representation +func (s AutoMLJobObjective) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoMLJobObjective) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AutoMLJobObjective) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AutoMLJobObjective"} + if s.MetricName == nil { + invalidParams.Add(request.NewErrParamRequired("MetricName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMetricName sets the MetricName field's value. +func (s *AutoMLJobObjective) SetMetricName(v string) *AutoMLJobObjective { + s.MetricName = &v + return s +} + +// Provides a summary about a job. +type AutoMLJobSummary struct { + _ struct{} `type:"structure"` + + // The ARN of the job. + // + // AutoMLJobArn is a required field + AutoMLJobArn *string `min:"1" type:"string" required:"true"` + + // The name of the object you are requesting. + // + // AutoMLJobName is a required field + AutoMLJobName *string `min:"1" type:"string" required:"true"` + + // The job's secondary status. + // + // AutoMLJobSecondaryStatus is a required field + AutoMLJobSecondaryStatus *string `type:"string" required:"true" enum:"AutoMLJobSecondaryStatus"` + + // The job's status. + // + // AutoMLJobStatus is a required field + AutoMLJobStatus *string `type:"string" required:"true" enum:"AutoMLJobStatus"` + + // When the job was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // The end time. + EndTime *time.Time `type:"timestamp"` + + // The failure reason. + FailureReason *string `type:"string"` + + // When the job was last modified. + // + // LastModifiedTime is a required field + LastModifiedTime *time.Time `type:"timestamp" required:"true"` +} + +// String returns the string representation +func (s AutoMLJobSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoMLJobSummary) GoString() string { + return s.String() +} + +// SetAutoMLJobArn sets the AutoMLJobArn field's value. +func (s *AutoMLJobSummary) SetAutoMLJobArn(v string) *AutoMLJobSummary { + s.AutoMLJobArn = &v + return s +} + +// SetAutoMLJobName sets the AutoMLJobName field's value. +func (s *AutoMLJobSummary) SetAutoMLJobName(v string) *AutoMLJobSummary { + s.AutoMLJobName = &v + return s +} + +// SetAutoMLJobSecondaryStatus sets the AutoMLJobSecondaryStatus field's value. +func (s *AutoMLJobSummary) SetAutoMLJobSecondaryStatus(v string) *AutoMLJobSummary { + s.AutoMLJobSecondaryStatus = &v + return s +} + +// SetAutoMLJobStatus sets the AutoMLJobStatus field's value. +func (s *AutoMLJobSummary) SetAutoMLJobStatus(v string) *AutoMLJobSummary { + s.AutoMLJobStatus = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *AutoMLJobSummary) SetCreationTime(v time.Time) *AutoMLJobSummary { + s.CreationTime = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *AutoMLJobSummary) SetEndTime(v time.Time) *AutoMLJobSummary { + s.EndTime = &v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *AutoMLJobSummary) SetFailureReason(v string) *AutoMLJobSummary { + s.FailureReason = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *AutoMLJobSummary) SetLastModifiedTime(v time.Time) *AutoMLJobSummary { + s.LastModifiedTime = &v + return s +} + +// The output data configuration. +type AutoMLOutputDataConfig struct { + _ struct{} `type:"structure"` + + // The AWS KMS encryption key ID. + KmsKeyId *string `type:"string"` + + // The Amazon S3 output path. Must be 128 characters or less. + // + // S3OutputPath is a required field + S3OutputPath *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AutoMLOutputDataConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoMLOutputDataConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AutoMLOutputDataConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AutoMLOutputDataConfig"} + if s.S3OutputPath == nil { + invalidParams.Add(request.NewErrParamRequired("S3OutputPath")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *AutoMLOutputDataConfig) SetKmsKeyId(v string) *AutoMLOutputDataConfig { + s.KmsKeyId = &v + return s +} + +// SetS3OutputPath sets the S3OutputPath field's value. +func (s *AutoMLOutputDataConfig) SetS3OutputPath(v string) *AutoMLOutputDataConfig { + s.S3OutputPath = &v + return s +} + +// The Amazon S3 data source. +type AutoMLS3DataSource struct { + _ struct{} `type:"structure"` + + // The data type. + // + // S3DataType is a required field + S3DataType *string `type:"string" required:"true" enum:"AutoMLS3DataType"` + + // The URL to the Amazon S3 data source. + // + // S3Uri is a required field + S3Uri *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AutoMLS3DataSource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoMLS3DataSource) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AutoMLS3DataSource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AutoMLS3DataSource"} + if s.S3DataType == nil { + invalidParams.Add(request.NewErrParamRequired("S3DataType")) + } + if s.S3Uri == nil { + invalidParams.Add(request.NewErrParamRequired("S3Uri")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetS3DataType sets the S3DataType field's value. +func (s *AutoMLS3DataSource) SetS3DataType(v string) *AutoMLS3DataSource { + s.S3DataType = &v + return s +} + +// SetS3Uri sets the S3Uri field's value. +func (s *AutoMLS3DataSource) SetS3Uri(v string) *AutoMLS3DataSource { + s.S3Uri = &v + return s +} + +// Security options. +type AutoMLSecurityConfig struct { + _ struct{} `type:"structure"` + + // Whether to use traffic encryption between the container layers. + EnableInterContainerTrafficEncryption *bool `type:"boolean"` + + // The key used to encrypt stored data. + VolumeKmsKeyId *string `type:"string"` + + // VPC configuration. + VpcConfig *VpcConfig `type:"structure"` +} + +// String returns the string representation +func (s AutoMLSecurityConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutoMLSecurityConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AutoMLSecurityConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AutoMLSecurityConfig"} + if s.VpcConfig != nil { + if err := s.VpcConfig.Validate(); err != nil { + invalidParams.AddNested("VpcConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEnableInterContainerTrafficEncryption sets the EnableInterContainerTrafficEncryption field's value. +func (s *AutoMLSecurityConfig) SetEnableInterContainerTrafficEncryption(v bool) *AutoMLSecurityConfig { + s.EnableInterContainerTrafficEncryption = &v + return s +} + +// SetVolumeKmsKeyId sets the VolumeKmsKeyId field's value. +func (s *AutoMLSecurityConfig) SetVolumeKmsKeyId(v string) *AutoMLSecurityConfig { + s.VolumeKmsKeyId = &v + return s +} + +// SetVpcConfig sets the VpcConfig field's value. +func (s *AutoMLSecurityConfig) SetVpcConfig(v *VpcConfig) *AutoMLSecurityConfig { + s.VpcConfig = v + return s +} + +type CaptureContentTypeHeader struct { + _ struct{} `type:"structure"` + + CsvContentTypes []*string `min:"1" type:"list"` + + JsonContentTypes []*string `min:"1" type:"list"` +} + +// String returns the string representation +func (s CaptureContentTypeHeader) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CaptureContentTypeHeader) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CaptureContentTypeHeader) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CaptureContentTypeHeader"} + if s.CsvContentTypes != nil && len(s.CsvContentTypes) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CsvContentTypes", 1)) + } + if s.JsonContentTypes != nil && len(s.JsonContentTypes) < 1 { + invalidParams.Add(request.NewErrParamMinLen("JsonContentTypes", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCsvContentTypes sets the CsvContentTypes field's value. +func (s *CaptureContentTypeHeader) SetCsvContentTypes(v []*string) *CaptureContentTypeHeader { + s.CsvContentTypes = v + return s +} + +// SetJsonContentTypes sets the JsonContentTypes field's value. +func (s *CaptureContentTypeHeader) SetJsonContentTypes(v []*string) *CaptureContentTypeHeader { + s.JsonContentTypes = v + return s +} + +type CaptureOption struct { + _ struct{} `type:"structure"` + + // CaptureMode is a required field + CaptureMode *string `type:"string" required:"true" enum:"CaptureMode"` +} + +// String returns the string representation +func (s CaptureOption) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CaptureOption) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CaptureOption) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CaptureOption"} + if s.CaptureMode == nil { + invalidParams.Add(request.NewErrParamRequired("CaptureMode")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCaptureMode sets the CaptureMode field's value. +func (s *CaptureOption) SetCaptureMode(v string) *CaptureOption { + s.CaptureMode = &v + return s +} + +// A list of categorical hyperparameters to tune. +type CategoricalParameterRange struct { + _ struct{} `type:"structure"` + + // The name of the categorical hyperparameter to tune. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // A list of the categories for the hyperparameter. + // + // Values is a required field + Values []*string `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s CategoricalParameterRange) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CategoricalParameterRange) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CategoricalParameterRange) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CategoricalParameterRange"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + 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 +} + +// SetName sets the Name field's value. +func (s *CategoricalParameterRange) SetName(v string) *CategoricalParameterRange { + s.Name = &v + return s +} + +// SetValues sets the Values field's value. +func (s *CategoricalParameterRange) SetValues(v []*string) *CategoricalParameterRange { + s.Values = v + return s +} + +// Defines the possible values for a categorical hyperparameter. +type CategoricalParameterRangeSpecification struct { + _ struct{} `type:"structure"` + + // The allowed categories for the hyperparameter. + // + // Values is a required field + Values []*string `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s CategoricalParameterRangeSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CategoricalParameterRangeSpecification) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CategoricalParameterRangeSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CategoricalParameterRangeSpecification"} + 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 +} + +// SetValues sets the Values field's value. +func (s *CategoricalParameterRangeSpecification) SetValues(v []*string) *CategoricalParameterRangeSpecification { + s.Values = v + return s +} + +// A channel is a named input source that training algorithms can consume. +type Channel struct { + _ struct{} `type:"structure"` + + // The name of the channel. + // + // ChannelName is a required field + ChannelName *string `min:"1" type:"string" required:"true"` + + // If training data is compressed, the compression type. The default value is + // None. CompressionType is used only in Pipe input mode. In File mode, leave + // this field unset or set it to None. + CompressionType *string `type:"string" enum:"CompressionType"` + + // The MIME type of the data. + ContentType *string `type:"string"` + + // The location of the channel data. + // + // DataSource is a required field + DataSource *DataSource `type:"structure" required:"true"` + + // (Optional) The input mode to use for the data channel in a training job. + // If you don't set a value for InputMode, Amazon SageMaker uses the value set + // for TrainingInputMode. Use this parameter to override the TrainingInputMode + // setting in a AlgorithmSpecification request when you have a channel that + // needs a different input mode from the training job's general setting. To + // download the data from Amazon Simple Storage Service (Amazon S3) to the provisioned + // ML storage volume, and mount the directory to a Docker volume, use File input + // mode. To stream data directly from Amazon S3 to the container, choose Pipe + // input mode. + // + // To use a model for incremental training, choose File input model. + InputMode *string `type:"string" enum:"TrainingInputMode"` + + // Specify RecordIO as the value when input data is in raw format but the training + // algorithm requires the RecordIO format. In this case, Amazon SageMaker wraps + // each individual S3 object in a RecordIO record. If the input data is already + // in RecordIO format, you don't need to set this attribute. For more information, + // see Create a Dataset Using RecordIO (https://mxnet.apache.org/api/architecture/note_data_loading#data-format). + // + // In File mode, leave this field unset or set it to None. + RecordWrapperType *string `type:"string" enum:"RecordWrapper"` + + // A configuration for a shuffle option for input data in a channel. If you + // use S3Prefix for S3DataType, this shuffles the results of the S3 key prefix + // matches. If you use ManifestFile, the order of the S3 object references in + // the ManifestFile is shuffled. If you use AugmentedManifestFile, the order + // of the JSON lines in the AugmentedManifestFile is shuffled. The shuffling + // order is determined using the Seed value. + // + // For Pipe input mode, shuffling is done at the start of every epoch. With + // large datasets this ensures that the order of the training data is different + // for each epoch, it helps reduce bias and possible overfitting. In a multi-node + // training job when ShuffleConfig is combined with S3DataDistributionType of + // ShardedByS3Key, the data is shuffled across nodes so that the content sent + // to a particular node on the first epoch might be sent to a different node + // on the second epoch. + ShuffleConfig *ShuffleConfig `type:"structure"` +} + +// String returns the string representation +func (s Channel) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Channel) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Channel) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Channel"} + if s.ChannelName == nil { + invalidParams.Add(request.NewErrParamRequired("ChannelName")) + } + if s.ChannelName != nil && len(*s.ChannelName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) + } + if s.DataSource == nil { + invalidParams.Add(request.NewErrParamRequired("DataSource")) + } + if s.DataSource != nil { + if err := s.DataSource.Validate(); err != nil { + invalidParams.AddNested("DataSource", err.(request.ErrInvalidParams)) + } + } + if s.ShuffleConfig != nil { + if err := s.ShuffleConfig.Validate(); err != nil { + invalidParams.AddNested("ShuffleConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetChannelName sets the ChannelName field's value. +func (s *Channel) SetChannelName(v string) *Channel { + s.ChannelName = &v + return s +} + +// SetCompressionType sets the CompressionType field's value. +func (s *Channel) SetCompressionType(v string) *Channel { + s.CompressionType = &v + return s +} + +// SetContentType sets the ContentType field's value. +func (s *Channel) SetContentType(v string) *Channel { + s.ContentType = &v + return s +} + +// SetDataSource sets the DataSource field's value. +func (s *Channel) SetDataSource(v *DataSource) *Channel { + s.DataSource = v + return s +} + +// SetInputMode sets the InputMode field's value. +func (s *Channel) SetInputMode(v string) *Channel { + s.InputMode = &v + return s +} + +// SetRecordWrapperType sets the RecordWrapperType field's value. +func (s *Channel) SetRecordWrapperType(v string) *Channel { + s.RecordWrapperType = &v + return s +} + +// SetShuffleConfig sets the ShuffleConfig field's value. +func (s *Channel) SetShuffleConfig(v *ShuffleConfig) *Channel { + s.ShuffleConfig = v + return s +} + +// Defines a named input source, called a channel, to be used by an algorithm. +type ChannelSpecification struct { + _ struct{} `type:"structure"` + + // A brief description of the channel. + Description *string `type:"string"` + + // Indicates whether the channel is required by the algorithm. + IsRequired *bool `type:"boolean"` + + // The name of the channel. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The allowed compression types, if data compression is used. + SupportedCompressionTypes []*string `type:"list"` + + // The supported MIME types for the data. + // + // SupportedContentTypes is a required field + SupportedContentTypes []*string `type:"list" required:"true"` + + // The allowed input mode, either FILE or PIPE. + // + // In FILE mode, Amazon SageMaker copies the data from the input source onto + // the local Amazon Elastic Block Store (Amazon EBS) volumes before starting + // your training algorithm. This is the most commonly used input mode. + // + // In PIPE mode, Amazon SageMaker streams input data from the source directly + // to your algorithm without using the EBS volume. + // + // SupportedInputModes is a required field + SupportedInputModes []*string `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s ChannelSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ChannelSpecification) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ChannelSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ChannelSpecification"} + 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.SupportedContentTypes == nil { + invalidParams.Add(request.NewErrParamRequired("SupportedContentTypes")) + } + if s.SupportedInputModes == nil { + invalidParams.Add(request.NewErrParamRequired("SupportedInputModes")) + } + if s.SupportedInputModes != nil && len(s.SupportedInputModes) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SupportedInputModes", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDescription sets the Description field's value. +func (s *ChannelSpecification) SetDescription(v string) *ChannelSpecification { + s.Description = &v + return s +} + +// SetIsRequired sets the IsRequired field's value. +func (s *ChannelSpecification) SetIsRequired(v bool) *ChannelSpecification { + s.IsRequired = &v + return s +} + +// SetName sets the Name field's value. +func (s *ChannelSpecification) SetName(v string) *ChannelSpecification { + s.Name = &v + return s +} + +// SetSupportedCompressionTypes sets the SupportedCompressionTypes field's value. +func (s *ChannelSpecification) SetSupportedCompressionTypes(v []*string) *ChannelSpecification { + s.SupportedCompressionTypes = v + return s +} + +// SetSupportedContentTypes sets the SupportedContentTypes field's value. +func (s *ChannelSpecification) SetSupportedContentTypes(v []*string) *ChannelSpecification { + s.SupportedContentTypes = v + return s +} + +// SetSupportedInputModes sets the SupportedInputModes field's value. +func (s *ChannelSpecification) SetSupportedInputModes(v []*string) *ChannelSpecification { + s.SupportedInputModes = v + return s +} + +// Contains information about the output location for managed spot training +// checkpoint data. +type CheckpointConfig struct { + _ struct{} `type:"structure"` + + // (Optional) The local directory where checkpoints are written. The default + // directory is /opt/ml/checkpoints/. + LocalPath *string `type:"string"` + + // Identifies the S3 path where you want Amazon SageMaker to store checkpoints. + // For example, s3://bucket-name/key-name-prefix. + // + // S3Uri is a required field + S3Uri *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CheckpointConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CheckpointConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CheckpointConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CheckpointConfig"} + if s.S3Uri == nil { + invalidParams.Add(request.NewErrParamRequired("S3Uri")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLocalPath sets the LocalPath field's value. +func (s *CheckpointConfig) SetLocalPath(v string) *CheckpointConfig { + s.LocalPath = &v + return s +} + +// SetS3Uri sets the S3Uri field's value. +func (s *CheckpointConfig) SetS3Uri(v string) *CheckpointConfig { + s.S3Uri = &v + return s +} + +// Specifies summary information about a Git repository. +type CodeRepositorySummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the Git repository. + // + // CodeRepositoryArn is a required field + CodeRepositoryArn *string `min:"1" type:"string" required:"true"` + + // The name of the Git repository. + // + // CodeRepositoryName is a required field + CodeRepositoryName *string `min:"1" type:"string" required:"true"` + + // The date and time that the Git repository was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // Configuration details for the Git repository, including the URL where it + // is located and the ARN of the AWS Secrets Manager secret that contains the + // credentials used to access the repository. + GitConfig *GitConfig `type:"structure"` + + // The date and time that the Git repository was last modified. + // + // LastModifiedTime is a required field + LastModifiedTime *time.Time `type:"timestamp" required:"true"` +} + +// String returns the string representation +func (s CodeRepositorySummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CodeRepositorySummary) GoString() string { + return s.String() +} + +// SetCodeRepositoryArn sets the CodeRepositoryArn field's value. +func (s *CodeRepositorySummary) SetCodeRepositoryArn(v string) *CodeRepositorySummary { + s.CodeRepositoryArn = &v + return s +} + +// SetCodeRepositoryName sets the CodeRepositoryName field's value. +func (s *CodeRepositorySummary) SetCodeRepositoryName(v string) *CodeRepositorySummary { + s.CodeRepositoryName = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *CodeRepositorySummary) SetCreationTime(v time.Time) *CodeRepositorySummary { + s.CreationTime = &v + return s +} + +// SetGitConfig sets the GitConfig field's value. +func (s *CodeRepositorySummary) SetGitConfig(v *GitConfig) *CodeRepositorySummary { + s.GitConfig = v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *CodeRepositorySummary) SetLastModifiedTime(v time.Time) *CodeRepositorySummary { + s.LastModifiedTime = &v + return s +} + +// Identifies a Amazon Cognito user group. A user group can be used in on or +// more work teams. +type CognitoMemberDefinition struct { + _ struct{} `type:"structure"` + + // An identifier for an application client. You must create the app client ID + // using Amazon Cognito. + // + // ClientId is a required field + ClientId *string `min:"1" type:"string" required:"true"` + + // An identifier for a user group. + // + // UserGroup is a required field + UserGroup *string `min:"1" type:"string" required:"true"` + + // An identifier for a user pool. The user pool must be in the same region as + // the service that you are calling. + // + // UserPool is a required field + UserPool *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CognitoMemberDefinition) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CognitoMemberDefinition) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CognitoMemberDefinition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CognitoMemberDefinition"} + 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.UserGroup == nil { + invalidParams.Add(request.NewErrParamRequired("UserGroup")) + } + if s.UserGroup != nil && len(*s.UserGroup) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserGroup", 1)) + } + if s.UserPool == nil { + invalidParams.Add(request.NewErrParamRequired("UserPool")) + } + if s.UserPool != nil && len(*s.UserPool) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserPool", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetClientId sets the ClientId field's value. +func (s *CognitoMemberDefinition) SetClientId(v string) *CognitoMemberDefinition { + s.ClientId = &v + return s +} + +// SetUserGroup sets the UserGroup field's value. +func (s *CognitoMemberDefinition) SetUserGroup(v string) *CognitoMemberDefinition { + s.UserGroup = &v + return s +} + +// SetUserPool sets the UserPool field's value. +func (s *CognitoMemberDefinition) SetUserPool(v string) *CognitoMemberDefinition { + s.UserPool = &v + return s +} + +// Configuration information for tensor collections. +type CollectionConfiguration struct { + _ struct{} `type:"structure"` + + // The name of the tensor collection. The name must be unique relative to other + // rule configuration names. + CollectionName *string `min:"1" type:"string"` + + // Parameter values for the tensor collection. The allowed parameters are "name", + // "include_regex", "reduction_config", "save_config", "tensor_names", and "save_histogram". + CollectionParameters map[string]*string `type:"map"` +} + +// String returns the string representation +func (s CollectionConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CollectionConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CollectionConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CollectionConfiguration"} + if s.CollectionName != nil && len(*s.CollectionName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CollectionName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCollectionName sets the CollectionName field's value. +func (s *CollectionConfiguration) SetCollectionName(v string) *CollectionConfiguration { + s.CollectionName = &v + return s +} + +// SetCollectionParameters sets the CollectionParameters field's value. +func (s *CollectionConfiguration) SetCollectionParameters(v map[string]*string) *CollectionConfiguration { + s.CollectionParameters = v + return s +} + +// A summary of a model compilation job. +type CompilationJobSummary struct { + _ struct{} `type:"structure"` + + // The time when the model compilation job completed. + CompilationEndTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of the model compilation job. + // + // CompilationJobArn is a required field + CompilationJobArn *string `type:"string" required:"true"` + + // The name of the model compilation job that you want a summary for. + // + // CompilationJobName is a required field + CompilationJobName *string `min:"1" type:"string" required:"true"` + + // The status of the model compilation job. + // + // CompilationJobStatus is a required field + CompilationJobStatus *string `type:"string" required:"true" enum:"CompilationJobStatus"` + + // The time when the model compilation job started. + CompilationStartTime *time.Time `type:"timestamp"` + + // The type of device that the model will run on after compilation has completed. + // + // CompilationTargetDevice is a required field + CompilationTargetDevice *string `type:"string" required:"true" enum:"TargetDevice"` + + // The time when the model compilation job was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // The time when the model compilation job was last modified. + LastModifiedTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s CompilationJobSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CompilationJobSummary) GoString() string { + return s.String() +} + +// SetCompilationEndTime sets the CompilationEndTime field's value. +func (s *CompilationJobSummary) SetCompilationEndTime(v time.Time) *CompilationJobSummary { + s.CompilationEndTime = &v + return s +} + +// SetCompilationJobArn sets the CompilationJobArn field's value. +func (s *CompilationJobSummary) SetCompilationJobArn(v string) *CompilationJobSummary { + s.CompilationJobArn = &v + return s +} + +// SetCompilationJobName sets the CompilationJobName field's value. +func (s *CompilationJobSummary) SetCompilationJobName(v string) *CompilationJobSummary { + s.CompilationJobName = &v + return s +} + +// SetCompilationJobStatus sets the CompilationJobStatus field's value. +func (s *CompilationJobSummary) SetCompilationJobStatus(v string) *CompilationJobSummary { + s.CompilationJobStatus = &v + return s +} + +// SetCompilationStartTime sets the CompilationStartTime field's value. +func (s *CompilationJobSummary) SetCompilationStartTime(v time.Time) *CompilationJobSummary { + s.CompilationStartTime = &v + return s +} + +// SetCompilationTargetDevice sets the CompilationTargetDevice field's value. +func (s *CompilationJobSummary) SetCompilationTargetDevice(v string) *CompilationJobSummary { + s.CompilationTargetDevice = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *CompilationJobSummary) SetCreationTime(v time.Time) *CompilationJobSummary { + s.CreationTime = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *CompilationJobSummary) SetLastModifiedTime(v time.Time) *CompilationJobSummary { + s.LastModifiedTime = &v + return s +} + +// There was a conflict when you attempted to modify an experiment, trial, or +// trial component. +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictException) GoString() string { + return s.String() +} + +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" +} + +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil +} + +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID +} + +// Describes the container, as part of model definition. +type ContainerDefinition struct { + _ struct{} `type:"structure"` + + // This parameter is ignored for models that contain only a PrimaryContainer. + // + // When a ContainerDefinition is part of an inference pipeline, the value of + // the parameter uniquely identifies the container for the purposes of logging + // and metrics. For information, see Use Logs and Metrics to Monitor an Inference + // Pipeline (https://docs.aws.amazon.com/sagemaker/latest/dg/inference-pipeline-logs-metrics.html). + // If you don't specify a value for this parameter for a ContainerDefinition + // that is part of an inference pipeline, a unique name is automatically assigned + // based on the position of the ContainerDefinition in the pipeline. If you + // specify a value for the ContainerHostName for any ContainerDefinition that + // is part of an inference pipeline, you must specify a value for the ContainerHostName + // parameter of every ContainerDefinition in that pipeline. + ContainerHostname *string `type:"string"` + + // The environment variables to set in the Docker container. Each key and value + // in the Environment string to string map can have length of up to 1024. We + // support up to 16 entries in the map. + Environment map[string]*string `type:"map"` + + // The Amazon EC2 Container Registry (Amazon ECR) path where inference code + // is stored. If you are using your own custom algorithm instead of an algorithm + // provided by Amazon SageMaker, the inference code must meet Amazon SageMaker + // requirements. Amazon SageMaker supports both registry/repository[:tag] and + // registry/repository[@digest] image path formats. For more information, see + // Using Your Own Algorithms with Amazon SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html) + Image *string `type:"string"` + + // Whether the container hosts a single model or multiple models. + Mode *string `type:"string" enum:"ContainerMode"` + + // The S3 path where the model artifacts, which result from model training, + // are stored. This path must point to a single gzip compressed tar archive + // (.tar.gz suffix). The S3 path is required for Amazon SageMaker built-in algorithms, + // but not if you use your own algorithms. For more information on built-in + // algorithms, see Common Parameters (https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-algo-docker-registry-paths.html). + // + // If you provide a value for this parameter, Amazon SageMaker uses AWS Security + // Token Service to download model artifacts from the S3 path you provide. AWS + // STS is activated in your IAM user account by default. If you previously deactivated + // AWS STS for a region, you need to reactivate AWS STS for that region. For + // more information, see Activating and Deactivating AWS STS in an AWS Region + // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) + // in the AWS Identity and Access Management User Guide. + // + // If you use a built-in algorithm to create a model, Amazon SageMaker requires + // that you provide a S3 path to the model artifacts in ModelDataUrl. + ModelDataUrl *string `type:"string"` + + // The name or Amazon Resource Name (ARN) of the model package to use to create + // the model. + ModelPackageName *string `min:"1" 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.ModelPackageName != nil && len(*s.ModelPackageName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ModelPackageName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetContainerHostname sets the ContainerHostname field's value. +func (s *ContainerDefinition) SetContainerHostname(v string) *ContainerDefinition { + s.ContainerHostname = &v + return s +} + +// SetEnvironment sets the Environment field's value. +func (s *ContainerDefinition) SetEnvironment(v map[string]*string) *ContainerDefinition { + s.Environment = v + return s +} + +// SetImage sets the Image field's value. +func (s *ContainerDefinition) SetImage(v string) *ContainerDefinition { + s.Image = &v + return s +} + +// SetMode sets the Mode field's value. +func (s *ContainerDefinition) SetMode(v string) *ContainerDefinition { + s.Mode = &v + return s +} + +// SetModelDataUrl sets the ModelDataUrl field's value. +func (s *ContainerDefinition) SetModelDataUrl(v string) *ContainerDefinition { + s.ModelDataUrl = &v + return s +} + +// SetModelPackageName sets the ModelPackageName field's value. +func (s *ContainerDefinition) SetModelPackageName(v string) *ContainerDefinition { + s.ModelPackageName = &v + return s +} + +// A list of continuous hyperparameters to tune. +type ContinuousParameterRange struct { + _ struct{} `type:"structure"` + + // The maximum value for the hyperparameter. The tuning job uses floating-point + // values between MinValue value and this value for tuning. + // + // MaxValue is a required field + MaxValue *string `type:"string" required:"true"` + + // The minimum value for the hyperparameter. The tuning job uses floating-point + // values between this value and MaxValuefor tuning. + // + // MinValue is a required field + MinValue *string `type:"string" required:"true"` + + // The name of the continuous hyperparameter to tune. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // The scale that hyperparameter tuning uses to search the hyperparameter range. + // For information about choosing a hyperparameter scale, see Hyperparameter + // Scaling (https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-define-ranges.html#scaling-type). + // One of the following values: + // + // Auto + // + // Amazon SageMaker hyperparameter tuning chooses the best scale for the hyperparameter. + // + // Linear + // + // Hyperparameter tuning searches the values in the hyperparameter range by + // using a linear scale. + // + // Logarithmic + // + // Hyperparameter tuning searches the values in the hyperparameter range by + // using a logarithmic scale. + // + // Logarithmic scaling works only for ranges that have only values greater than + // 0. + // + // ReverseLogarithmic + // + // Hyperparameter tuning searches the values in the hyperparameter range by + // using a reverse logarithmic scale. + // + // Reverse logarithmic scaling works only for ranges that are entirely within + // the range 0<=x<1.0. + ScalingType *string `type:"string" enum:"HyperParameterScalingType"` +} + +// String returns the string representation +func (s ContinuousParameterRange) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ContinuousParameterRange) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ContinuousParameterRange) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ContinuousParameterRange"} + if s.MaxValue == nil { + invalidParams.Add(request.NewErrParamRequired("MaxValue")) + } + if s.MinValue == nil { + invalidParams.Add(request.NewErrParamRequired("MinValue")) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxValue sets the MaxValue field's value. +func (s *ContinuousParameterRange) SetMaxValue(v string) *ContinuousParameterRange { + s.MaxValue = &v + return s +} + +// SetMinValue sets the MinValue field's value. +func (s *ContinuousParameterRange) SetMinValue(v string) *ContinuousParameterRange { + s.MinValue = &v + return s +} + +// SetName sets the Name field's value. +func (s *ContinuousParameterRange) SetName(v string) *ContinuousParameterRange { + s.Name = &v + return s +} + +// SetScalingType sets the ScalingType field's value. +func (s *ContinuousParameterRange) SetScalingType(v string) *ContinuousParameterRange { + s.ScalingType = &v + return s +} + +// Defines the possible values for a continuous hyperparameter. +type ContinuousParameterRangeSpecification struct { + _ struct{} `type:"structure"` + + // The maximum floating-point value allowed. + // + // MaxValue is a required field + MaxValue *string `type:"string" required:"true"` + + // The minimum floating-point value allowed. + // + // MinValue is a required field + MinValue *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ContinuousParameterRangeSpecification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ContinuousParameterRangeSpecification) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ContinuousParameterRangeSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ContinuousParameterRangeSpecification"} + if s.MaxValue == nil { + invalidParams.Add(request.NewErrParamRequired("MaxValue")) + } + if s.MinValue == nil { + invalidParams.Add(request.NewErrParamRequired("MinValue")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxValue sets the MaxValue field's value. +func (s *ContinuousParameterRangeSpecification) SetMaxValue(v string) *ContinuousParameterRangeSpecification { + s.MaxValue = &v + return s +} + +// SetMinValue sets the MinValue field's value. +func (s *ContinuousParameterRangeSpecification) SetMinValue(v string) *ContinuousParameterRangeSpecification { + s.MinValue = &v + return s +} + +type CreateAlgorithmInput struct { + _ struct{} `type:"structure"` + + // A description of the algorithm. + AlgorithmDescription *string `type:"string"` + + // The name of the algorithm. + // + // AlgorithmName is a required field + AlgorithmName *string `min:"1" type:"string" required:"true"` + + // Whether to certify the algorithm so that it can be listed in AWS Marketplace. + CertifyForMarketplace *bool `type:"boolean"` + + // Specifies details about inference jobs that the algorithm runs, including + // the following: + // + // * The Amazon ECR paths of containers that contain the inference code and + // model artifacts. + // + // * The instance types that the algorithm supports for transform jobs and + // real-time endpoints used for inference. + // + // * The input and output content formats that the algorithm supports for + // inference. + InferenceSpecification *InferenceSpecification `type:"structure"` + + // Specifies details about training jobs run by this algorithm, including the + // following: + // + // * The Amazon ECR path of the container and the version digest of the algorithm. + // + // * The hyperparameters that the algorithm supports. + // + // * The instance types that the algorithm supports for training. + // + // * Whether the algorithm supports distributed training. + // + // * The metrics that the algorithm emits to Amazon CloudWatch. + // + // * Which metrics that the algorithm emits can be used as the objective + // metric for hyperparameter tuning jobs. + // + // * The input channels that the algorithm supports for training data. For + // example, an algorithm might support train, validation, and test channels. + // + // TrainingSpecification is a required field + TrainingSpecification *TrainingSpecification `type:"structure" required:"true"` + + // Specifies configurations for one or more training jobs and that Amazon SageMaker + // runs to test the algorithm's training code and, optionally, one or more batch + // transform jobs that Amazon SageMaker runs to test the algorithm's inference + // code. + ValidationSpecification *AlgorithmValidationSpecification `type:"structure"` +} + +// String returns the string representation +func (s CreateAlgorithmInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAlgorithmInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateAlgorithmInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateAlgorithmInput"} + if s.AlgorithmName == nil { + invalidParams.Add(request.NewErrParamRequired("AlgorithmName")) + } + if s.AlgorithmName != nil && len(*s.AlgorithmName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AlgorithmName", 1)) + } + if s.TrainingSpecification == nil { + invalidParams.Add(request.NewErrParamRequired("TrainingSpecification")) + } + if s.InferenceSpecification != nil { + if err := s.InferenceSpecification.Validate(); err != nil { + invalidParams.AddNested("InferenceSpecification", err.(request.ErrInvalidParams)) + } + } + if s.TrainingSpecification != nil { + if err := s.TrainingSpecification.Validate(); err != nil { + invalidParams.AddNested("TrainingSpecification", err.(request.ErrInvalidParams)) + } + } + if s.ValidationSpecification != nil { + if err := s.ValidationSpecification.Validate(); err != nil { + invalidParams.AddNested("ValidationSpecification", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAlgorithmDescription sets the AlgorithmDescription field's value. +func (s *CreateAlgorithmInput) SetAlgorithmDescription(v string) *CreateAlgorithmInput { + s.AlgorithmDescription = &v + return s +} + +// SetAlgorithmName sets the AlgorithmName field's value. +func (s *CreateAlgorithmInput) SetAlgorithmName(v string) *CreateAlgorithmInput { + s.AlgorithmName = &v + return s +} + +// SetCertifyForMarketplace sets the CertifyForMarketplace field's value. +func (s *CreateAlgorithmInput) SetCertifyForMarketplace(v bool) *CreateAlgorithmInput { + s.CertifyForMarketplace = &v + return s +} + +// SetInferenceSpecification sets the InferenceSpecification field's value. +func (s *CreateAlgorithmInput) SetInferenceSpecification(v *InferenceSpecification) *CreateAlgorithmInput { + s.InferenceSpecification = v + return s +} + +// SetTrainingSpecification sets the TrainingSpecification field's value. +func (s *CreateAlgorithmInput) SetTrainingSpecification(v *TrainingSpecification) *CreateAlgorithmInput { + s.TrainingSpecification = v + return s +} + +// SetValidationSpecification sets the ValidationSpecification field's value. +func (s *CreateAlgorithmInput) SetValidationSpecification(v *AlgorithmValidationSpecification) *CreateAlgorithmInput { + s.ValidationSpecification = v + return s +} + +type CreateAlgorithmOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the new algorithm. + // + // AlgorithmArn is a required field + AlgorithmArn *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateAlgorithmOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAlgorithmOutput) GoString() string { + return s.String() +} + +// SetAlgorithmArn sets the AlgorithmArn field's value. +func (s *CreateAlgorithmOutput) SetAlgorithmArn(v string) *CreateAlgorithmOutput { + s.AlgorithmArn = &v + return s +} + +type CreateAppInput struct { + _ struct{} `type:"structure"` + + // The name of the app. + // + // AppName is a required field + AppName *string `type:"string" required:"true"` + + // The type of app. + // + // AppType is a required field + AppType *string `type:"string" required:"true" enum:"AppType"` + + // The domain ID. + // + // DomainId is a required field + DomainId *string `type:"string" required:"true"` + + // The instance type and quantity. + ResourceSpec *ResourceSpec `type:"structure"` + + // Each tag consists of a key and an optional value. Tag keys must be unique + // per resource. + Tags []*Tag `type:"list"` + + // The user profile name. + // + // UserProfileName is a required field + UserProfileName *string `type:"string" required:"true"` +} + +// 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.AppName == nil { + invalidParams.Add(request.NewErrParamRequired("AppName")) + } + if s.AppType == nil { + invalidParams.Add(request.NewErrParamRequired("AppType")) + } + if s.DomainId == nil { + invalidParams.Add(request.NewErrParamRequired("DomainId")) + } + if s.UserProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("UserProfileName")) + } + 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 +} + +// SetAppName sets the AppName field's value. +func (s *CreateAppInput) SetAppName(v string) *CreateAppInput { + s.AppName = &v + return s +} + +// SetAppType sets the AppType field's value. +func (s *CreateAppInput) SetAppType(v string) *CreateAppInput { + s.AppType = &v + return s +} + +// SetDomainId sets the DomainId field's value. +func (s *CreateAppInput) SetDomainId(v string) *CreateAppInput { + s.DomainId = &v + return s +} + +// SetResourceSpec sets the ResourceSpec field's value. +func (s *CreateAppInput) SetResourceSpec(v *ResourceSpec) *CreateAppInput { + s.ResourceSpec = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateAppInput) SetTags(v []*Tag) *CreateAppInput { + s.Tags = v + return s +} + +// SetUserProfileName sets the UserProfileName field's value. +func (s *CreateAppInput) SetUserProfileName(v string) *CreateAppInput { + s.UserProfileName = &v + return s +} + +type CreateAppOutput struct { + _ struct{} `type:"structure"` + + // The app's Amazon Resource Name (ARN). + AppArn *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() +} + +// SetAppArn sets the AppArn field's value. +func (s *CreateAppOutput) SetAppArn(v string) *CreateAppOutput { + s.AppArn = &v + return s +} + +type CreateAutoMLJobInput struct { + _ struct{} `type:"structure"` + + // Contains CompletionCriteria and SecurityConfig. + AutoMLJobConfig *AutoMLJobConfig `type:"structure"` + + // Identifies an AutoPilot job. Must be unique to your account and is case-insensitive. + // + // AutoMLJobName is a required field + AutoMLJobName *string `min:"1" type:"string" required:"true"` + + // Defines the job's objective. You provide a MetricName and AutoML will infer + // minimize or maximize. If this is not provided, the most commonly used ObjectiveMetric + // for problem type will be selected. + AutoMLJobObjective *AutoMLJobObjective `type:"structure"` + + // This will generate possible candidates without training a model. A candidate + // is a combination of data preprocessors, algorithms, and algorithm parameter + // settings. + GenerateCandidateDefinitionsOnly *bool `type:"boolean"` + + // Similar to InputDataConfig supported by Tuning. Format(s) supported: CSV. + // + // InputDataConfig is a required field + InputDataConfig []*AutoMLChannel `min:"1" type:"list" required:"true"` + + // Similar to OutputDataConfig supported by Tuning. Format(s) supported: CSV. + // + // OutputDataConfig is a required field + OutputDataConfig *AutoMLOutputDataConfig `type:"structure" required:"true"` + + // Defines the kind of preprocessing and algorithms intended for the candidates. + // Options include: BinaryClassification, MulticlassClassification, and Regression. + ProblemType *string `type:"string" enum:"ProblemType"` + + // The ARN of the role that will be used to access the data. + // + // RoleArn is a required field + RoleArn *string `min:"20" type:"string" required:"true"` + + // Each tag consists of a key and an optional value. Tag keys must be unique + // per resource. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s CreateAutoMLJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAutoMLJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateAutoMLJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateAutoMLJobInput"} + if s.AutoMLJobName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoMLJobName")) + } + if s.AutoMLJobName != nil && len(*s.AutoMLJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoMLJobName", 1)) + } + if s.InputDataConfig == nil { + invalidParams.Add(request.NewErrParamRequired("InputDataConfig")) + } + if s.InputDataConfig != nil && len(s.InputDataConfig) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InputDataConfig", 1)) + } + if s.OutputDataConfig == nil { + invalidParams.Add(request.NewErrParamRequired("OutputDataConfig")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.RoleArn != nil && len(*s.RoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) + } + if s.AutoMLJobConfig != nil { + if err := s.AutoMLJobConfig.Validate(); err != nil { + invalidParams.AddNested("AutoMLJobConfig", err.(request.ErrInvalidParams)) + } + } + if s.AutoMLJobObjective != nil { + if err := s.AutoMLJobObjective.Validate(); err != nil { + invalidParams.AddNested("AutoMLJobObjective", err.(request.ErrInvalidParams)) + } + } + if s.InputDataConfig != nil { + for i, v := range s.InputDataConfig { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputDataConfig", i), err.(request.ErrInvalidParams)) + } + } + } + if s.OutputDataConfig != nil { + if err := s.OutputDataConfig.Validate(); err != nil { + invalidParams.AddNested("OutputDataConfig", 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 +} + +// SetAutoMLJobConfig sets the AutoMLJobConfig field's value. +func (s *CreateAutoMLJobInput) SetAutoMLJobConfig(v *AutoMLJobConfig) *CreateAutoMLJobInput { + s.AutoMLJobConfig = v + return s +} + +// SetAutoMLJobName sets the AutoMLJobName field's value. +func (s *CreateAutoMLJobInput) SetAutoMLJobName(v string) *CreateAutoMLJobInput { + s.AutoMLJobName = &v + return s +} + +// SetAutoMLJobObjective sets the AutoMLJobObjective field's value. +func (s *CreateAutoMLJobInput) SetAutoMLJobObjective(v *AutoMLJobObjective) *CreateAutoMLJobInput { + s.AutoMLJobObjective = v + return s +} + +// SetGenerateCandidateDefinitionsOnly sets the GenerateCandidateDefinitionsOnly field's value. +func (s *CreateAutoMLJobInput) SetGenerateCandidateDefinitionsOnly(v bool) *CreateAutoMLJobInput { + s.GenerateCandidateDefinitionsOnly = &v + return s +} + +// SetInputDataConfig sets the InputDataConfig field's value. +func (s *CreateAutoMLJobInput) SetInputDataConfig(v []*AutoMLChannel) *CreateAutoMLJobInput { + s.InputDataConfig = v + return s +} + +// SetOutputDataConfig sets the OutputDataConfig field's value. +func (s *CreateAutoMLJobInput) SetOutputDataConfig(v *AutoMLOutputDataConfig) *CreateAutoMLJobInput { + s.OutputDataConfig = v + return s +} + +// SetProblemType sets the ProblemType field's value. +func (s *CreateAutoMLJobInput) SetProblemType(v string) *CreateAutoMLJobInput { + s.ProblemType = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *CreateAutoMLJobInput) SetRoleArn(v string) *CreateAutoMLJobInput { + s.RoleArn = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateAutoMLJobInput) SetTags(v []*Tag) *CreateAutoMLJobInput { + s.Tags = v + return s +} + +type CreateAutoMLJobOutput struct { + _ struct{} `type:"structure"` + + // When a job is created, it is assigned a unique ARN. + // + // AutoMLJobArn is a required field + AutoMLJobArn *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateAutoMLJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateAutoMLJobOutput) GoString() string { + return s.String() +} + +// SetAutoMLJobArn sets the AutoMLJobArn field's value. +func (s *CreateAutoMLJobOutput) SetAutoMLJobArn(v string) *CreateAutoMLJobOutput { + s.AutoMLJobArn = &v + return s +} + +type CreateCodeRepositoryInput struct { + _ struct{} `type:"structure"` + + // The name of the Git repository. The name must have 1 to 63 characters. Valid + // characters are a-z, A-Z, 0-9, and - (hyphen). + // + // CodeRepositoryName is a required field + CodeRepositoryName *string `min:"1" type:"string" required:"true"` + + // Specifies details about the repository, including the URL where the repository + // is located, the default branch, and credentials to use to access the repository. + // + // GitConfig is a required field + GitConfig *GitConfig `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateCodeRepositoryInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCodeRepositoryInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateCodeRepositoryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateCodeRepositoryInput"} + if s.CodeRepositoryName == nil { + invalidParams.Add(request.NewErrParamRequired("CodeRepositoryName")) + } + if s.CodeRepositoryName != nil && len(*s.CodeRepositoryName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CodeRepositoryName", 1)) + } + if s.GitConfig == nil { + invalidParams.Add(request.NewErrParamRequired("GitConfig")) + } + if s.GitConfig != nil { + if err := s.GitConfig.Validate(); err != nil { + invalidParams.AddNested("GitConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCodeRepositoryName sets the CodeRepositoryName field's value. +func (s *CreateCodeRepositoryInput) SetCodeRepositoryName(v string) *CreateCodeRepositoryInput { + s.CodeRepositoryName = &v + return s +} + +// SetGitConfig sets the GitConfig field's value. +func (s *CreateCodeRepositoryInput) SetGitConfig(v *GitConfig) *CreateCodeRepositoryInput { + s.GitConfig = v + return s +} + +type CreateCodeRepositoryOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the new repository. + // + // CodeRepositoryArn is a required field + CodeRepositoryArn *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateCodeRepositoryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCodeRepositoryOutput) GoString() string { + return s.String() +} + +// SetCodeRepositoryArn sets the CodeRepositoryArn field's value. +func (s *CreateCodeRepositoryOutput) SetCodeRepositoryArn(v string) *CreateCodeRepositoryOutput { + s.CodeRepositoryArn = &v + return s +} + +type CreateCompilationJobInput struct { + _ struct{} `type:"structure"` + + // A name for the model compilation job. The name must be unique within the + // AWS Region and within your AWS account. + // + // CompilationJobName is a required field + CompilationJobName *string `min:"1" type:"string" required:"true"` + + // Provides information about the location of input model artifacts, the name + // and shape of the expected data inputs, and the framework in which the model + // was trained. + // + // InputConfig is a required field + InputConfig *InputConfig `type:"structure" required:"true"` + + // Provides information about the output location for the compiled model and + // the target device the model runs on. + // + // OutputConfig is a required field + OutputConfig *OutputConfig `type:"structure" required:"true"` + + // The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker + // to perform tasks on your behalf. + // + // During model compilation, Amazon SageMaker needs your permission to: + // + // * Read input data from an S3 bucket + // + // * Write model artifacts to an S3 bucket + // + // * Write logs to Amazon CloudWatch Logs + // + // * Publish metrics to Amazon CloudWatch + // + // You grant permissions for all of these tasks to an IAM role. To pass this + // role to Amazon SageMaker, the caller of this API must have the iam:PassRole + // permission. For more information, see Amazon SageMaker Roles. (https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html) + // + // RoleArn is a required field + RoleArn *string `min:"20" type:"string" required:"true"` + + // Specifies a limit to how long a model compilation job can run. When the job + // reaches the time limit, Amazon SageMaker ends the compilation job. Use this + // API to cap model training costs. + // + // StoppingCondition is a required field + StoppingCondition *StoppingCondition `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateCompilationJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCompilationJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateCompilationJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateCompilationJobInput"} + if s.CompilationJobName == nil { + invalidParams.Add(request.NewErrParamRequired("CompilationJobName")) + } + if s.CompilationJobName != nil && len(*s.CompilationJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CompilationJobName", 1)) + } + if s.InputConfig == nil { + invalidParams.Add(request.NewErrParamRequired("InputConfig")) + } + if s.OutputConfig == nil { + invalidParams.Add(request.NewErrParamRequired("OutputConfig")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.RoleArn != nil && len(*s.RoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) + } + if s.StoppingCondition == nil { + invalidParams.Add(request.NewErrParamRequired("StoppingCondition")) + } + if s.InputConfig != nil { + if err := s.InputConfig.Validate(); err != nil { + invalidParams.AddNested("InputConfig", err.(request.ErrInvalidParams)) + } + } + if s.OutputConfig != nil { + if err := s.OutputConfig.Validate(); err != nil { + invalidParams.AddNested("OutputConfig", err.(request.ErrInvalidParams)) + } + } + if s.StoppingCondition != nil { + if err := s.StoppingCondition.Validate(); err != nil { + invalidParams.AddNested("StoppingCondition", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCompilationJobName sets the CompilationJobName field's value. +func (s *CreateCompilationJobInput) SetCompilationJobName(v string) *CreateCompilationJobInput { + s.CompilationJobName = &v + return s +} + +// SetInputConfig sets the InputConfig field's value. +func (s *CreateCompilationJobInput) SetInputConfig(v *InputConfig) *CreateCompilationJobInput { + s.InputConfig = v + return s +} + +// SetOutputConfig sets the OutputConfig field's value. +func (s *CreateCompilationJobInput) SetOutputConfig(v *OutputConfig) *CreateCompilationJobInput { + s.OutputConfig = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *CreateCompilationJobInput) SetRoleArn(v string) *CreateCompilationJobInput { + s.RoleArn = &v + return s +} + +// SetStoppingCondition sets the StoppingCondition field's value. +func (s *CreateCompilationJobInput) SetStoppingCondition(v *StoppingCondition) *CreateCompilationJobInput { + s.StoppingCondition = v + return s +} + +type CreateCompilationJobOutput struct { + _ struct{} `type:"structure"` + + // If the action is successful, the service sends back an HTTP 200 response. + // Amazon SageMaker returns the following data in JSON format: + // + // * CompilationJobArn: The Amazon Resource Name (ARN) of the compiled job. + // + // CompilationJobArn is a required field + CompilationJobArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateCompilationJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateCompilationJobOutput) GoString() string { + return s.String() +} + +// SetCompilationJobArn sets the CompilationJobArn field's value. +func (s *CreateCompilationJobOutput) SetCompilationJobArn(v string) *CreateCompilationJobOutput { + s.CompilationJobArn = &v + return s +} + +type CreateDomainInput struct { + _ struct{} `type:"structure"` + + // The mode of authentication that member use to access the domain. + // + // AuthMode is a required field + AuthMode *string `type:"string" required:"true" enum:"AuthMode"` + + // The default user settings. + // + // DefaultUserSettings is a required field + DefaultUserSettings *UserSettings `type:"structure" required:"true"` + + // A name for the domain. + // + // DomainName is a required field + DomainName *string `type:"string" required:"true"` + + // The AWS Key Management Service encryption key ID. + HomeEfsFileSystemKmsKeyId *string `type:"string"` + + // Security setting to limit to a set of subnets. + // + // SubnetIds is a required field + SubnetIds []*string `min:"1" type:"list" required:"true"` + + // Each tag consists of a key and an optional value. Tag keys must be unique + // per resource. + Tags []*Tag `type:"list"` + + // Security setting to limit the domain's communication to a Amazon Virtual + // Private Cloud. + // + // VpcId is a required field + VpcId *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.AuthMode == nil { + invalidParams.Add(request.NewErrParamRequired("AuthMode")) + } + if s.DefaultUserSettings == nil { + invalidParams.Add(request.NewErrParamRequired("DefaultUserSettings")) + } + if s.DomainName == nil { + invalidParams.Add(request.NewErrParamRequired("DomainName")) + } + if s.SubnetIds == nil { + invalidParams.Add(request.NewErrParamRequired("SubnetIds")) + } + if s.SubnetIds != nil && len(s.SubnetIds) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SubnetIds", 1)) + } + if s.VpcId == nil { + invalidParams.Add(request.NewErrParamRequired("VpcId")) + } + if s.DefaultUserSettings != nil { + if err := s.DefaultUserSettings.Validate(); err != nil { + invalidParams.AddNested("DefaultUserSettings", 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 +} + +// SetAuthMode sets the AuthMode field's value. +func (s *CreateDomainInput) SetAuthMode(v string) *CreateDomainInput { + s.AuthMode = &v + return s +} + +// SetDefaultUserSettings sets the DefaultUserSettings field's value. +func (s *CreateDomainInput) SetDefaultUserSettings(v *UserSettings) *CreateDomainInput { + s.DefaultUserSettings = v + return s +} + +// SetDomainName sets the DomainName field's value. +func (s *CreateDomainInput) SetDomainName(v string) *CreateDomainInput { + s.DomainName = &v + return s +} + +// SetHomeEfsFileSystemKmsKeyId sets the HomeEfsFileSystemKmsKeyId field's value. +func (s *CreateDomainInput) SetHomeEfsFileSystemKmsKeyId(v string) *CreateDomainInput { + s.HomeEfsFileSystemKmsKeyId = &v + return s +} + +// SetSubnetIds sets the SubnetIds field's value. +func (s *CreateDomainInput) SetSubnetIds(v []*string) *CreateDomainInput { + s.SubnetIds = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateDomainInput) SetTags(v []*Tag) *CreateDomainInput { + s.Tags = v + return s +} + +// SetVpcId sets the VpcId field's value. +func (s *CreateDomainInput) SetVpcId(v string) *CreateDomainInput { + s.VpcId = &v + return s +} + +type CreateDomainOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the created domain. + DomainArn *string `type:"string"` + + // The URL to the created domain. + Url *string `type:"string"` +} + +// 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() +} + +// SetDomainArn sets the DomainArn field's value. +func (s *CreateDomainOutput) SetDomainArn(v string) *CreateDomainOutput { + s.DomainArn = &v + return s +} + +// SetUrl sets the Url field's value. +func (s *CreateDomainOutput) SetUrl(v string) *CreateDomainOutput { + s.Url = &v + return s +} + +type CreateEndpointConfigInput struct { + _ struct{} `type:"structure"` + + DataCaptureConfig *DataCaptureConfig `type:"structure"` + + // The name of the endpoint configuration. You specify this name in a CreateEndpoint + // (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html) + // request. + // + // EndpointConfigName is a required field + EndpointConfigName *string `type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of a AWS Key Management Service key that Amazon + // SageMaker uses to encrypt data on the storage volume attached to the ML compute + // instance that hosts the endpoint. + // + // The KmsKeyId can be any of the following formats: + // + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Alias name: alias/ExampleAlias + // + // * Alias name ARN: arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias + // + // The KMS key policy must grant permission to the IAM role that you specify + // in your CreateEndpoint, UpdateEndpoint requests. For more information, refer + // to the AWS Key Management Service section Using Key Policies in AWS KMS (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) + // + // Certain Nitro-based instances include local storage, dependent on the instance + // type. Local storage volumes are encrypted using a hardware module on the + // instance. You can't request a KmsKeyId when using an instance type with local + // storage. If any of the models that you specify in the ProductionVariants + // parameter use nitro-based instances with local storage, do not specify a + // value for the KmsKeyId parameter. If you specify a value for KmsKeyId when + // using any nitro-based instances with local storage, the call to CreateEndpointConfig + // fails. + // + // For a list of instance types that support local instance storage, see Instance + // Store Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#instance-store-volumes). + // + // For more information about local instance storage encryption, see SSD Instance + // Store Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ssd-instance-store.html). + KmsKeyId *string `type:"string"` + + // An list of ProductionVariant objects, one for each model that you want to + // host at this endpoint. + // + // ProductionVariants is a required field + ProductionVariants []*ProductionVariant `min:"1" type:"list" required:"true"` + + // A list of key-value pairs. For more information, see Using Cost Allocation + // Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) + // in the AWS Billing and Cost Management User Guide. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s CreateEndpointConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateEndpointConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateEndpointConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateEndpointConfigInput"} + if s.EndpointConfigName == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointConfigName")) + } + if s.ProductionVariants == nil { + invalidParams.Add(request.NewErrParamRequired("ProductionVariants")) + } + if s.ProductionVariants != nil && len(s.ProductionVariants) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ProductionVariants", 1)) + } + if s.DataCaptureConfig != nil { + if err := s.DataCaptureConfig.Validate(); err != nil { + invalidParams.AddNested("DataCaptureConfig", err.(request.ErrInvalidParams)) + } + } + if s.ProductionVariants != nil { + for i, v := range s.ProductionVariants { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ProductionVariants", 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 +} + +// SetDataCaptureConfig sets the DataCaptureConfig field's value. +func (s *CreateEndpointConfigInput) SetDataCaptureConfig(v *DataCaptureConfig) *CreateEndpointConfigInput { + s.DataCaptureConfig = v + return s +} + +// SetEndpointConfigName sets the EndpointConfigName field's value. +func (s *CreateEndpointConfigInput) SetEndpointConfigName(v string) *CreateEndpointConfigInput { + s.EndpointConfigName = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *CreateEndpointConfigInput) SetKmsKeyId(v string) *CreateEndpointConfigInput { + s.KmsKeyId = &v + return s +} + +// SetProductionVariants sets the ProductionVariants field's value. +func (s *CreateEndpointConfigInput) SetProductionVariants(v []*ProductionVariant) *CreateEndpointConfigInput { + s.ProductionVariants = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateEndpointConfigInput) SetTags(v []*Tag) *CreateEndpointConfigInput { + s.Tags = v + return s +} + +type CreateEndpointConfigOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the endpoint configuration. + // + // EndpointConfigArn is a required field + EndpointConfigArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateEndpointConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateEndpointConfigOutput) GoString() string { + return s.String() +} + +// SetEndpointConfigArn sets the EndpointConfigArn field's value. +func (s *CreateEndpointConfigOutput) SetEndpointConfigArn(v string) *CreateEndpointConfigOutput { + s.EndpointConfigArn = &v + return s +} + +type CreateEndpointInput struct { + _ struct{} `type:"structure"` + + // The name of an endpoint configuration. For more information, see CreateEndpointConfig + // (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpointConfig.html). + // + // EndpointConfigName is a required field + EndpointConfigName *string `type:"string" required:"true"` + + // The name of the endpoint. The name must be unique within an AWS Region in + // your AWS account. + // + // EndpointName is a required field + EndpointName *string `type:"string" required:"true"` + + // An array of key-value pairs. For more information, see Using Cost Allocation + // Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what)in + // the AWS Billing and Cost Management User Guide. + Tags []*Tag `type:"list"` +} + +// 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.EndpointConfigName == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointConfigName")) + } + if s.EndpointName == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointName")) + } + 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 +} + +// SetEndpointConfigName sets the EndpointConfigName field's value. +func (s *CreateEndpointInput) SetEndpointConfigName(v string) *CreateEndpointInput { + s.EndpointConfigName = &v + return s +} + +// SetEndpointName sets the EndpointName field's value. +func (s *CreateEndpointInput) SetEndpointName(v string) *CreateEndpointInput { + s.EndpointName = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateEndpointInput) SetTags(v []*Tag) *CreateEndpointInput { + s.Tags = v + return s +} + +type CreateEndpointOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the endpoint. + // + // EndpointArn is a required field + EndpointArn *string `min:"20" type:"string" required:"true"` +} + +// 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() +} + +// SetEndpointArn sets the EndpointArn field's value. +func (s *CreateEndpointOutput) SetEndpointArn(v string) *CreateEndpointOutput { + s.EndpointArn = &v + return s +} + +type CreateExperimentInput struct { + _ struct{} `type:"structure"` + + // The description of the experiment. + Description *string `type:"string"` + + // The name of the experiment as displayed. The name doesn't need to be unique. + // If you don't specify DisplayName, the value in ExperimentName is displayed. + DisplayName *string `min:"1" type:"string"` + + // The name of the experiment. The name must be unique in your AWS account and + // is not case-sensitive. + // + // ExperimentName is a required field + ExperimentName *string `min:"1" type:"string" required:"true"` + + // A list of tags to associate with the experiment. You can use Search API to + // search on the tags. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s CreateExperimentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateExperimentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateExperimentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateExperimentInput"} + if s.DisplayName != nil && len(*s.DisplayName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) + } + if s.ExperimentName == nil { + invalidParams.Add(request.NewErrParamRequired("ExperimentName")) + } + if s.ExperimentName != nil && len(*s.ExperimentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ExperimentName", 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 +} + +// SetDescription sets the Description field's value. +func (s *CreateExperimentInput) SetDescription(v string) *CreateExperimentInput { + s.Description = &v + return s +} + +// SetDisplayName sets the DisplayName field's value. +func (s *CreateExperimentInput) SetDisplayName(v string) *CreateExperimentInput { + s.DisplayName = &v + return s +} + +// SetExperimentName sets the ExperimentName field's value. +func (s *CreateExperimentInput) SetExperimentName(v string) *CreateExperimentInput { + s.ExperimentName = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateExperimentInput) SetTags(v []*Tag) *CreateExperimentInput { + s.Tags = v + return s +} + +type CreateExperimentOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the experiment. + ExperimentArn *string `type:"string"` +} + +// String returns the string representation +func (s CreateExperimentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateExperimentOutput) GoString() string { + return s.String() +} + +// SetExperimentArn sets the ExperimentArn field's value. +func (s *CreateExperimentOutput) SetExperimentArn(v string) *CreateExperimentOutput { + s.ExperimentArn = &v + return s +} + +type CreateFlowDefinitionInput struct { + _ struct{} `type:"structure"` + + // The name of your flow definition. + // + // FlowDefinitionName is a required field + FlowDefinitionName *string `min:"1" type:"string" required:"true"` + + // An object containing information about the events that trigger a human workflow. + HumanLoopActivationConfig *HumanLoopActivationConfig `type:"structure"` + + // An object containing information about the tasks the human reviewers will + // perform. + // + // HumanLoopConfig is a required field + HumanLoopConfig *HumanLoopConfig `type:"structure" required:"true"` + + // An object containing information about where the human review results will + // be uploaded. + // + // OutputConfig is a required field + OutputConfig *FlowDefinitionOutputConfig `type:"structure" required:"true"` + + // The Amazon Resource Name (ARN) of the role needed to call other services + // on your behalf. For example, arn:aws:iam::1234567890:role/service-role/AmazonSageMaker-ExecutionRole-20180111T151298. + // + // RoleArn is a required field + RoleArn *string `min:"20" type:"string" required:"true"` + + // An array of key-value pairs that contain metadata to help you categorize + // and organize a flow definition. Each tag consists of a key and a value, both + // of which you define. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s CreateFlowDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateFlowDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateFlowDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateFlowDefinitionInput"} + if s.FlowDefinitionName == nil { + invalidParams.Add(request.NewErrParamRequired("FlowDefinitionName")) + } + if s.FlowDefinitionName != nil && len(*s.FlowDefinitionName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FlowDefinitionName", 1)) + } + if s.HumanLoopConfig == nil { + invalidParams.Add(request.NewErrParamRequired("HumanLoopConfig")) + } + if s.OutputConfig == nil { + invalidParams.Add(request.NewErrParamRequired("OutputConfig")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.RoleArn != nil && len(*s.RoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) + } + if s.HumanLoopActivationConfig != nil { + if err := s.HumanLoopActivationConfig.Validate(); err != nil { + invalidParams.AddNested("HumanLoopActivationConfig", err.(request.ErrInvalidParams)) + } + } + if s.HumanLoopConfig != nil { + if err := s.HumanLoopConfig.Validate(); err != nil { + invalidParams.AddNested("HumanLoopConfig", err.(request.ErrInvalidParams)) + } + } + if s.OutputConfig != nil { + if err := s.OutputConfig.Validate(); err != nil { + invalidParams.AddNested("OutputConfig", 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 +} + +// SetFlowDefinitionName sets the FlowDefinitionName field's value. +func (s *CreateFlowDefinitionInput) SetFlowDefinitionName(v string) *CreateFlowDefinitionInput { + s.FlowDefinitionName = &v + return s +} + +// SetHumanLoopActivationConfig sets the HumanLoopActivationConfig field's value. +func (s *CreateFlowDefinitionInput) SetHumanLoopActivationConfig(v *HumanLoopActivationConfig) *CreateFlowDefinitionInput { + s.HumanLoopActivationConfig = v + return s +} + +// SetHumanLoopConfig sets the HumanLoopConfig field's value. +func (s *CreateFlowDefinitionInput) SetHumanLoopConfig(v *HumanLoopConfig) *CreateFlowDefinitionInput { + s.HumanLoopConfig = v + return s +} + +// SetOutputConfig sets the OutputConfig field's value. +func (s *CreateFlowDefinitionInput) SetOutputConfig(v *FlowDefinitionOutputConfig) *CreateFlowDefinitionInput { + s.OutputConfig = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *CreateFlowDefinitionInput) SetRoleArn(v string) *CreateFlowDefinitionInput { + s.RoleArn = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateFlowDefinitionInput) SetTags(v []*Tag) *CreateFlowDefinitionInput { + s.Tags = v + return s +} + +type CreateFlowDefinitionOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the flow definition you create. + // + // FlowDefinitionArn is a required field + FlowDefinitionArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateFlowDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateFlowDefinitionOutput) GoString() string { + return s.String() +} + +// SetFlowDefinitionArn sets the FlowDefinitionArn field's value. +func (s *CreateFlowDefinitionOutput) SetFlowDefinitionArn(v string) *CreateFlowDefinitionOutput { + s.FlowDefinitionArn = &v + return s +} + +type CreateHumanTaskUiInput struct { + _ struct{} `type:"structure"` + + // The name of the user interface you are creating. + // + // HumanTaskUiName is a required field + HumanTaskUiName *string `min:"1" type:"string" required:"true"` + + // An array of key-value pairs that contain metadata to help you categorize + // and organize a human review workflow user interface. Each tag consists of + // a key and a value, both of which you define. + Tags []*Tag `type:"list"` + + // The Liquid template for the worker user interface. + // + // UiTemplate is a required field + UiTemplate *UiTemplate `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateHumanTaskUiInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateHumanTaskUiInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateHumanTaskUiInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateHumanTaskUiInput"} + if s.HumanTaskUiName == nil { + invalidParams.Add(request.NewErrParamRequired("HumanTaskUiName")) + } + if s.HumanTaskUiName != nil && len(*s.HumanTaskUiName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("HumanTaskUiName", 1)) + } + if s.UiTemplate == nil { + invalidParams.Add(request.NewErrParamRequired("UiTemplate")) + } + 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 s.UiTemplate != nil { + if err := s.UiTemplate.Validate(); err != nil { + invalidParams.AddNested("UiTemplate", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHumanTaskUiName sets the HumanTaskUiName field's value. +func (s *CreateHumanTaskUiInput) SetHumanTaskUiName(v string) *CreateHumanTaskUiInput { + s.HumanTaskUiName = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateHumanTaskUiInput) SetTags(v []*Tag) *CreateHumanTaskUiInput { + s.Tags = v + return s +} + +// SetUiTemplate sets the UiTemplate field's value. +func (s *CreateHumanTaskUiInput) SetUiTemplate(v *UiTemplate) *CreateHumanTaskUiInput { + s.UiTemplate = v + return s +} + +type CreateHumanTaskUiOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the human review workflow user interface + // you create. + // + // HumanTaskUiArn is a required field + HumanTaskUiArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateHumanTaskUiOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateHumanTaskUiOutput) GoString() string { + return s.String() +} + +// SetHumanTaskUiArn sets the HumanTaskUiArn field's value. +func (s *CreateHumanTaskUiOutput) SetHumanTaskUiArn(v string) *CreateHumanTaskUiOutput { + s.HumanTaskUiArn = &v + return s +} + +type CreateHyperParameterTuningJobInput struct { + _ struct{} `type:"structure"` + + // The HyperParameterTuningJobConfig object that describes the tuning job, including + // the search strategy, the objective metric used to evaluate training jobs, + // ranges of parameters to search, and resource limits for the tuning job. For + // more information, see automatic-model-tuning + // + // HyperParameterTuningJobConfig is a required field + HyperParameterTuningJobConfig *HyperParameterTuningJobConfig `type:"structure" required:"true"` + + // The name of the tuning job. This name is the prefix for the names of all + // training jobs that this tuning job launches. The name must be unique within + // the same AWS account and AWS Region. The name must have { } to { } characters. + // Valid characters are a-z, A-Z, 0-9, and : + = @ _ % - (hyphen). The name + // is not case sensitive. + // + // HyperParameterTuningJobName is a required field + HyperParameterTuningJobName *string `min:"1" type:"string" required:"true"` + + // An array of key-value pairs. You can use tags to categorize your AWS resources + // in different ways, for example, by purpose, owner, or environment. For more + // information, see AWS Tagging Strategies (https://aws.amazon.com/answers/account-management/aws-tagging-strategies/). + // + // Tags that you specify for the tuning job are also added to all training jobs + // that the tuning job launches. + Tags []*Tag `type:"list"` + + // The HyperParameterTrainingJobDefinition object that describes the training + // jobs that this tuning job launches, including static hyperparameters, input + // data configuration, output data configuration, resource configuration, and + // stopping condition. + TrainingJobDefinition *HyperParameterTrainingJobDefinition `type:"structure"` + + TrainingJobDefinitions []*HyperParameterTrainingJobDefinition `min:"1" type:"list"` + + // Specifies the configuration for starting the hyperparameter tuning job using + // one or more previous tuning jobs as a starting point. The results of previous + // tuning jobs are used to inform which combinations of hyperparameters to search + // over in the new tuning job. + // + // All training jobs launched by the new hyperparameter tuning job are evaluated + // by using the objective metric. If you specify IDENTICAL_DATA_AND_ALGORITHM + // as the WarmStartType value for the warm start configuration, the training + // job that performs the best in the new tuning job is compared to the best + // training jobs from the parent tuning jobs. From these, the training job that + // performs the best as measured by the objective metric is returned as the + // overall best training job. + // + // All training jobs launched by parent hyperparameter tuning jobs and the new + // hyperparameter tuning jobs count against the limit of training jobs for the + // tuning job. + WarmStartConfig *HyperParameterTuningJobWarmStartConfig `type:"structure"` +} + +// String returns the string representation +func (s CreateHyperParameterTuningJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateHyperParameterTuningJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateHyperParameterTuningJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateHyperParameterTuningJobInput"} + if s.HyperParameterTuningJobConfig == nil { + invalidParams.Add(request.NewErrParamRequired("HyperParameterTuningJobConfig")) + } + if s.HyperParameterTuningJobName == nil { + invalidParams.Add(request.NewErrParamRequired("HyperParameterTuningJobName")) + } + if s.HyperParameterTuningJobName != nil && len(*s.HyperParameterTuningJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("HyperParameterTuningJobName", 1)) + } + if s.TrainingJobDefinitions != nil && len(s.TrainingJobDefinitions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrainingJobDefinitions", 1)) + } + if s.HyperParameterTuningJobConfig != nil { + if err := s.HyperParameterTuningJobConfig.Validate(); err != nil { + invalidParams.AddNested("HyperParameterTuningJobConfig", 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 s.TrainingJobDefinition != nil { + if err := s.TrainingJobDefinition.Validate(); err != nil { + invalidParams.AddNested("TrainingJobDefinition", err.(request.ErrInvalidParams)) + } + } + if s.TrainingJobDefinitions != nil { + for i, v := range s.TrainingJobDefinitions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TrainingJobDefinitions", i), err.(request.ErrInvalidParams)) + } + } + } + if s.WarmStartConfig != nil { + if err := s.WarmStartConfig.Validate(); err != nil { + invalidParams.AddNested("WarmStartConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHyperParameterTuningJobConfig sets the HyperParameterTuningJobConfig field's value. +func (s *CreateHyperParameterTuningJobInput) SetHyperParameterTuningJobConfig(v *HyperParameterTuningJobConfig) *CreateHyperParameterTuningJobInput { + s.HyperParameterTuningJobConfig = v + return s +} + +// SetHyperParameterTuningJobName sets the HyperParameterTuningJobName field's value. +func (s *CreateHyperParameterTuningJobInput) SetHyperParameterTuningJobName(v string) *CreateHyperParameterTuningJobInput { + s.HyperParameterTuningJobName = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateHyperParameterTuningJobInput) SetTags(v []*Tag) *CreateHyperParameterTuningJobInput { + s.Tags = v + return s +} + +// SetTrainingJobDefinition sets the TrainingJobDefinition field's value. +func (s *CreateHyperParameterTuningJobInput) SetTrainingJobDefinition(v *HyperParameterTrainingJobDefinition) *CreateHyperParameterTuningJobInput { + s.TrainingJobDefinition = v + return s +} + +// SetTrainingJobDefinitions sets the TrainingJobDefinitions field's value. +func (s *CreateHyperParameterTuningJobInput) SetTrainingJobDefinitions(v []*HyperParameterTrainingJobDefinition) *CreateHyperParameterTuningJobInput { + s.TrainingJobDefinitions = v + return s +} + +// SetWarmStartConfig sets the WarmStartConfig field's value. +func (s *CreateHyperParameterTuningJobInput) SetWarmStartConfig(v *HyperParameterTuningJobWarmStartConfig) *CreateHyperParameterTuningJobInput { + s.WarmStartConfig = v + return s +} + +type CreateHyperParameterTuningJobOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the tuning job. Amazon SageMaker assigns + // an ARN to a hyperparameter tuning job when you create it. + // + // HyperParameterTuningJobArn is a required field + HyperParameterTuningJobArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateHyperParameterTuningJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateHyperParameterTuningJobOutput) GoString() string { + return s.String() +} + +// SetHyperParameterTuningJobArn sets the HyperParameterTuningJobArn field's value. +func (s *CreateHyperParameterTuningJobOutput) SetHyperParameterTuningJobArn(v string) *CreateHyperParameterTuningJobOutput { + s.HyperParameterTuningJobArn = &v + return s +} + +type CreateLabelingJobInput struct { + _ struct{} `type:"structure"` + + // Configures the labeling task and how it is presented to workers; including, + // but not limited to price, keywords, and batch size (task count). + // + // HumanTaskConfig is a required field + HumanTaskConfig *HumanTaskConfig `type:"structure" required:"true"` + + // Input data for the labeling job, such as the Amazon S3 location of the data + // objects and the location of the manifest file that describes the data objects. + // + // InputConfig is a required field + InputConfig *LabelingJobInputConfig `type:"structure" required:"true"` + + // The attribute name to use for the label in the output manifest file. This + // is the key for the key/value pair formed with the label that a worker assigns + // to the object. The name can't end with "-metadata". If you are running a + // semantic segmentation labeling job, the attribute name must end with "-ref". + // If you are running any other kind of labeling job, the attribute name must + // not end with "-ref". + // + // LabelAttributeName is a required field + LabelAttributeName *string `min:"1" type:"string" required:"true"` + + // The S3 URL of the file that defines the categories used to label the data + // objects. + // + // The file is a JSON structure in the following format: + // + // { + // + // "document-version": "2018-11-28" + // + // "labels": [ + // + // { + // + // "label": "label 1" + // + // }, + // + // { + // + // "label": "label 2" + // + // }, + // + // ... + // + // { + // + // "label": "label n" + // + // } + // + // ] + // + // } + LabelCategoryConfigS3Uri *string `type:"string"` + + // Configures the information required to perform automated data labeling. + LabelingJobAlgorithmsConfig *LabelingJobAlgorithmsConfig `type:"structure"` + + // The name of the labeling job. This name is used to identify the job in a + // list of labeling jobs. + // + // LabelingJobName is a required field + LabelingJobName *string `min:"1" type:"string" required:"true"` + + // The location of the output data and the AWS Key Management Service key ID + // for the key used to encrypt the output data, if any. + // + // OutputConfig is a required field + OutputConfig *LabelingJobOutputConfig `type:"structure" required:"true"` + + // The Amazon Resource Number (ARN) that Amazon SageMaker assumes to perform + // tasks on your behalf during data labeling. You must grant this role the necessary + // permissions so that Amazon SageMaker can successfully complete data labeling. + // + // RoleArn is a required field + RoleArn *string `min:"20" type:"string" required:"true"` + + // A set of conditions for stopping the labeling job. If any of the conditions + // are met, the job is automatically stopped. You can use these conditions to + // control the cost of data labeling. + StoppingConditions *LabelingJobStoppingConditions `type:"structure"` + + // An array of key/value pairs. For more information, see Using Cost Allocation + // Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) + // in the AWS Billing and Cost Management User Guide. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s CreateLabelingJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLabelingJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateLabelingJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateLabelingJobInput"} + if s.HumanTaskConfig == nil { + invalidParams.Add(request.NewErrParamRequired("HumanTaskConfig")) + } + if s.InputConfig == nil { + invalidParams.Add(request.NewErrParamRequired("InputConfig")) + } + if s.LabelAttributeName == nil { + invalidParams.Add(request.NewErrParamRequired("LabelAttributeName")) + } + if s.LabelAttributeName != nil && len(*s.LabelAttributeName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LabelAttributeName", 1)) + } + if s.LabelingJobName == nil { + invalidParams.Add(request.NewErrParamRequired("LabelingJobName")) + } + if s.LabelingJobName != nil && len(*s.LabelingJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LabelingJobName", 1)) + } + if s.OutputConfig == nil { + invalidParams.Add(request.NewErrParamRequired("OutputConfig")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.RoleArn != nil && len(*s.RoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) + } + if s.HumanTaskConfig != nil { + if err := s.HumanTaskConfig.Validate(); err != nil { + invalidParams.AddNested("HumanTaskConfig", err.(request.ErrInvalidParams)) + } + } + if s.InputConfig != nil { + if err := s.InputConfig.Validate(); err != nil { + invalidParams.AddNested("InputConfig", err.(request.ErrInvalidParams)) + } + } + if s.LabelingJobAlgorithmsConfig != nil { + if err := s.LabelingJobAlgorithmsConfig.Validate(); err != nil { + invalidParams.AddNested("LabelingJobAlgorithmsConfig", err.(request.ErrInvalidParams)) + } + } + if s.OutputConfig != nil { + if err := s.OutputConfig.Validate(); err != nil { + invalidParams.AddNested("OutputConfig", err.(request.ErrInvalidParams)) + } + } + if s.StoppingConditions != nil { + if err := s.StoppingConditions.Validate(); err != nil { + invalidParams.AddNested("StoppingConditions", 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 +} + +// SetHumanTaskConfig sets the HumanTaskConfig field's value. +func (s *CreateLabelingJobInput) SetHumanTaskConfig(v *HumanTaskConfig) *CreateLabelingJobInput { + s.HumanTaskConfig = v + return s +} + +// SetInputConfig sets the InputConfig field's value. +func (s *CreateLabelingJobInput) SetInputConfig(v *LabelingJobInputConfig) *CreateLabelingJobInput { + s.InputConfig = v + return s +} + +// SetLabelAttributeName sets the LabelAttributeName field's value. +func (s *CreateLabelingJobInput) SetLabelAttributeName(v string) *CreateLabelingJobInput { + s.LabelAttributeName = &v + return s +} + +// SetLabelCategoryConfigS3Uri sets the LabelCategoryConfigS3Uri field's value. +func (s *CreateLabelingJobInput) SetLabelCategoryConfigS3Uri(v string) *CreateLabelingJobInput { + s.LabelCategoryConfigS3Uri = &v + return s +} + +// SetLabelingJobAlgorithmsConfig sets the LabelingJobAlgorithmsConfig field's value. +func (s *CreateLabelingJobInput) SetLabelingJobAlgorithmsConfig(v *LabelingJobAlgorithmsConfig) *CreateLabelingJobInput { + s.LabelingJobAlgorithmsConfig = v + return s +} + +// SetLabelingJobName sets the LabelingJobName field's value. +func (s *CreateLabelingJobInput) SetLabelingJobName(v string) *CreateLabelingJobInput { + s.LabelingJobName = &v + return s +} + +// SetOutputConfig sets the OutputConfig field's value. +func (s *CreateLabelingJobInput) SetOutputConfig(v *LabelingJobOutputConfig) *CreateLabelingJobInput { + s.OutputConfig = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *CreateLabelingJobInput) SetRoleArn(v string) *CreateLabelingJobInput { + s.RoleArn = &v + return s +} + +// SetStoppingConditions sets the StoppingConditions field's value. +func (s *CreateLabelingJobInput) SetStoppingConditions(v *LabelingJobStoppingConditions) *CreateLabelingJobInput { + s.StoppingConditions = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateLabelingJobInput) SetTags(v []*Tag) *CreateLabelingJobInput { + s.Tags = v + return s +} + +type CreateLabelingJobOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the labeling job. You use this ARN to identify + // the labeling job. + // + // LabelingJobArn is a required field + LabelingJobArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateLabelingJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateLabelingJobOutput) GoString() string { + return s.String() +} + +// SetLabelingJobArn sets the LabelingJobArn field's value. +func (s *CreateLabelingJobOutput) SetLabelingJobArn(v string) *CreateLabelingJobOutput { + s.LabelingJobArn = &v + return s +} + +type CreateModelInput struct { + _ struct{} `type:"structure"` + + // Specifies the containers in the inference pipeline. + Containers []*ContainerDefinition `type:"list"` + + // Isolates the model container. No inbound or outbound network calls can be + // made to or from the model container. + EnableNetworkIsolation *bool `type:"boolean"` + + // The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker can + // assume to access model artifacts and docker image for deployment on ML compute + // instances or for batch transform jobs. Deploying on ML compute instances + // is part of model hosting. For more information, see Amazon SageMaker Roles + // (https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html). + // + // To be able to pass this role to Amazon SageMaker, the caller of this API + // must have the iam:PassRole permission. + // + // ExecutionRoleArn is a required field + ExecutionRoleArn *string `min:"20" type:"string" required:"true"` + + // The name of the new model. + // + // ModelName is a required field + ModelName *string `type:"string" required:"true"` + + // The location of the primary docker image containing inference code, associated + // artifacts, and custom environment map that the inference code uses when the + // model is deployed for predictions. + PrimaryContainer *ContainerDefinition `type:"structure"` + + // An array of key-value pairs. For more information, see Using Cost Allocation + // Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) + // in the AWS Billing and Cost Management User Guide. + Tags []*Tag `type:"list"` + + // A VpcConfig (https://docs.aws.amazon.com/sagemaker/latest/dg/API_VpcConfig.html) + // object that specifies the VPC that you want your model to connect to. Control + // access to and from your model container by configuring the VPC. VpcConfig + // is used in hosting services and in batch transform. For more information, + // see Protect Endpoints by Using an Amazon Virtual Private Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/host-vpc.html) + // and Protect Data in Batch Transform Jobs by Using an Amazon Virtual Private + // Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/batch-vpc.html). + VpcConfig *VpcConfig `type:"structure"` +} + +// 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.ExecutionRoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("ExecutionRoleArn")) + } + if s.ExecutionRoleArn != nil && len(*s.ExecutionRoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleArn", 20)) + } + if s.ModelName == nil { + invalidParams.Add(request.NewErrParamRequired("ModelName")) + } + if s.Containers != nil { + for i, v := range s.Containers { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Containers", i), err.(request.ErrInvalidParams)) + } + } + } + if s.PrimaryContainer != nil { + if err := s.PrimaryContainer.Validate(); err != nil { + invalidParams.AddNested("PrimaryContainer", 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 s.VpcConfig != nil { + if err := s.VpcConfig.Validate(); err != nil { + invalidParams.AddNested("VpcConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetContainers sets the Containers field's value. +func (s *CreateModelInput) SetContainers(v []*ContainerDefinition) *CreateModelInput { + s.Containers = v + return s +} + +// SetEnableNetworkIsolation sets the EnableNetworkIsolation field's value. +func (s *CreateModelInput) SetEnableNetworkIsolation(v bool) *CreateModelInput { + s.EnableNetworkIsolation = &v + return s +} + +// SetExecutionRoleArn sets the ExecutionRoleArn field's value. +func (s *CreateModelInput) SetExecutionRoleArn(v string) *CreateModelInput { + s.ExecutionRoleArn = &v + return s +} + +// SetModelName sets the ModelName field's value. +func (s *CreateModelInput) SetModelName(v string) *CreateModelInput { + s.ModelName = &v + return s +} + +// SetPrimaryContainer sets the PrimaryContainer field's value. +func (s *CreateModelInput) SetPrimaryContainer(v *ContainerDefinition) *CreateModelInput { + s.PrimaryContainer = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateModelInput) SetTags(v []*Tag) *CreateModelInput { + s.Tags = v + return s +} + +// SetVpcConfig sets the VpcConfig field's value. +func (s *CreateModelInput) SetVpcConfig(v *VpcConfig) *CreateModelInput { + s.VpcConfig = v + return s +} + +type CreateModelOutput struct { + _ struct{} `type:"structure"` + + // The ARN of the model created in Amazon SageMaker. + // + // ModelArn is a required field + ModelArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateModelOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateModelOutput) GoString() string { + return s.String() +} + +// SetModelArn sets the ModelArn field's value. +func (s *CreateModelOutput) SetModelArn(v string) *CreateModelOutput { + s.ModelArn = &v + return s +} + +type CreateModelPackageInput struct { + _ struct{} `type:"structure"` + + // Whether to certify the model package for listing on AWS Marketplace. + CertifyForMarketplace *bool `type:"boolean"` + + // Specifies details about inference jobs that can be run with models based + // on this model package, including the following: + // + // * The Amazon ECR paths of containers that contain the inference code and + // model artifacts. + // + // * The instance types that the model package supports for transform jobs + // and real-time endpoints used for inference. + // + // * The input and output content formats that the model package supports + // for inference. + InferenceSpecification *InferenceSpecification `type:"structure"` + + // A description of the model package. + ModelPackageDescription *string `type:"string"` + + // The name of the model package. The name must have 1 to 63 characters. Valid + // characters are a-z, A-Z, 0-9, and - (hyphen). + // + // ModelPackageName is a required field + ModelPackageName *string `min:"1" type:"string" required:"true"` + + // Details about the algorithm that was used to create the model package. + SourceAlgorithmSpecification *SourceAlgorithmSpecification `type:"structure"` + + // Specifies configurations for one or more transform jobs that Amazon SageMaker + // runs to test the model package. + ValidationSpecification *ModelPackageValidationSpecification `type:"structure"` +} + +// String returns the string representation +func (s CreateModelPackageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateModelPackageInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateModelPackageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateModelPackageInput"} + if s.ModelPackageName == nil { + invalidParams.Add(request.NewErrParamRequired("ModelPackageName")) + } + if s.ModelPackageName != nil && len(*s.ModelPackageName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ModelPackageName", 1)) + } + if s.InferenceSpecification != nil { + if err := s.InferenceSpecification.Validate(); err != nil { + invalidParams.AddNested("InferenceSpecification", err.(request.ErrInvalidParams)) + } + } + if s.SourceAlgorithmSpecification != nil { + if err := s.SourceAlgorithmSpecification.Validate(); err != nil { + invalidParams.AddNested("SourceAlgorithmSpecification", err.(request.ErrInvalidParams)) + } + } + if s.ValidationSpecification != nil { + if err := s.ValidationSpecification.Validate(); err != nil { + invalidParams.AddNested("ValidationSpecification", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCertifyForMarketplace sets the CertifyForMarketplace field's value. +func (s *CreateModelPackageInput) SetCertifyForMarketplace(v bool) *CreateModelPackageInput { + s.CertifyForMarketplace = &v + return s +} + +// SetInferenceSpecification sets the InferenceSpecification field's value. +func (s *CreateModelPackageInput) SetInferenceSpecification(v *InferenceSpecification) *CreateModelPackageInput { + s.InferenceSpecification = v + return s +} + +// SetModelPackageDescription sets the ModelPackageDescription field's value. +func (s *CreateModelPackageInput) SetModelPackageDescription(v string) *CreateModelPackageInput { + s.ModelPackageDescription = &v + return s +} + +// SetModelPackageName sets the ModelPackageName field's value. +func (s *CreateModelPackageInput) SetModelPackageName(v string) *CreateModelPackageInput { + s.ModelPackageName = &v + return s +} + +// SetSourceAlgorithmSpecification sets the SourceAlgorithmSpecification field's value. +func (s *CreateModelPackageInput) SetSourceAlgorithmSpecification(v *SourceAlgorithmSpecification) *CreateModelPackageInput { + s.SourceAlgorithmSpecification = v + return s +} + +// SetValidationSpecification sets the ValidationSpecification field's value. +func (s *CreateModelPackageInput) SetValidationSpecification(v *ModelPackageValidationSpecification) *CreateModelPackageInput { + s.ValidationSpecification = v + return s +} + +type CreateModelPackageOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the new model package. + // + // ModelPackageArn is a required field + ModelPackageArn *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateModelPackageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateModelPackageOutput) GoString() string { + return s.String() +} + +// SetModelPackageArn sets the ModelPackageArn field's value. +func (s *CreateModelPackageOutput) SetModelPackageArn(v string) *CreateModelPackageOutput { + s.ModelPackageArn = &v + return s +} + +type CreateMonitoringScheduleInput struct { + _ struct{} `type:"structure"` + + // The configuration object that specifies the monitoring schedule and defines + // the monitoring job. + // + // MonitoringScheduleConfig is a required field + MonitoringScheduleConfig *MonitoringScheduleConfig `type:"structure" required:"true"` + + // The name of the monitoring schedule. The name must be unique within an AWS + // Region within an AWS account. + // + // MonitoringScheduleName is a required field + MonitoringScheduleName *string `min:"1" type:"string" required:"true"` + + // (Optional) An array of key-value pairs. For more information, see Using Cost + // Allocation Tags (https://docs-aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-whatURL) + // in the AWS Billing and Cost Management User Guide. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s CreateMonitoringScheduleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateMonitoringScheduleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateMonitoringScheduleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateMonitoringScheduleInput"} + if s.MonitoringScheduleConfig == nil { + invalidParams.Add(request.NewErrParamRequired("MonitoringScheduleConfig")) + } + if s.MonitoringScheduleName == nil { + invalidParams.Add(request.NewErrParamRequired("MonitoringScheduleName")) + } + if s.MonitoringScheduleName != nil && len(*s.MonitoringScheduleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MonitoringScheduleName", 1)) + } + if s.MonitoringScheduleConfig != nil { + if err := s.MonitoringScheduleConfig.Validate(); err != nil { + invalidParams.AddNested("MonitoringScheduleConfig", 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 +} + +// SetMonitoringScheduleConfig sets the MonitoringScheduleConfig field's value. +func (s *CreateMonitoringScheduleInput) SetMonitoringScheduleConfig(v *MonitoringScheduleConfig) *CreateMonitoringScheduleInput { + s.MonitoringScheduleConfig = v + return s +} + +// SetMonitoringScheduleName sets the MonitoringScheduleName field's value. +func (s *CreateMonitoringScheduleInput) SetMonitoringScheduleName(v string) *CreateMonitoringScheduleInput { + s.MonitoringScheduleName = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateMonitoringScheduleInput) SetTags(v []*Tag) *CreateMonitoringScheduleInput { + s.Tags = v + return s +} + +type CreateMonitoringScheduleOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the monitoring schedule. + // + // MonitoringScheduleArn is a required field + MonitoringScheduleArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateMonitoringScheduleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateMonitoringScheduleOutput) GoString() string { + return s.String() +} + +// SetMonitoringScheduleArn sets the MonitoringScheduleArn field's value. +func (s *CreateMonitoringScheduleOutput) SetMonitoringScheduleArn(v string) *CreateMonitoringScheduleOutput { + s.MonitoringScheduleArn = &v + return s +} + +type CreateNotebookInstanceInput struct { + _ struct{} `type:"structure"` + + // A list of Elastic Inference (EI) instance types to associate with this notebook + // instance. Currently, only one instance type can be associated with a notebook + // instance. For more information, see Using Elastic Inference in Amazon SageMaker + // (https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html). + AcceleratorTypes []*string `type:"list"` + + // An array of up to three Git repositories to associate with the notebook instance. + // These can be either the names of Git repositories stored as resources in + // your account, or the URL of Git repositories in AWS CodeCommit (https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html) + // or in any other Git repository. These repositories are cloned at the same + // level as the default repository of your notebook instance. For more information, + // see Associating Git Repositories with Amazon SageMaker Notebook Instances + // (https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html). + AdditionalCodeRepositories []*string `type:"list"` + + // A Git repository to associate with the notebook instance as its default code + // repository. This can be either the name of a Git repository stored as a resource + // in your account, or the URL of a Git repository in AWS CodeCommit (https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html) + // or in any other Git repository. When you open a notebook instance, it opens + // in the directory that contains this repository. For more information, see + // Associating Git Repositories with Amazon SageMaker Notebook Instances (https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html). + DefaultCodeRepository *string `min:"1" type:"string"` + + // Sets whether Amazon SageMaker provides internet access to the notebook instance. + // If you set this to Disabled this notebook instance will be able to access + // resources only in your VPC, and will not be able to connect to Amazon SageMaker + // training and endpoint services unless your configure a NAT Gateway in your + // VPC. + // + // For more information, see Notebook Instances Are Internet-Enabled by Default + // (https://docs.aws.amazon.com/sagemaker/latest/dg/appendix-additional-considerations.html#appendix-notebook-and-internet-access). + // You can set the value of this parameter to Disabled only if you set a value + // for the SubnetId parameter. + DirectInternetAccess *string `type:"string" enum:"DirectInternetAccess"` + + // The type of ML compute instance to launch for the notebook instance. + // + // InstanceType is a required field + InstanceType *string `type:"string" required:"true" enum:"InstanceType"` + + // The Amazon Resource Name (ARN) of a AWS Key Management Service key that Amazon + // SageMaker uses to encrypt data on the storage volume attached to your notebook + // instance. The KMS key you provide must be enabled. For information, see Enabling + // and Disabling Keys (https://docs.aws.amazon.com/kms/latest/developerguide/enabling-keys.html) + // in the AWS Key Management Service Developer Guide. + KmsKeyId *string `type:"string"` + + // The name of a lifecycle configuration to associate with the notebook instance. + // For information about lifestyle configurations, see Step 2.1: (Optional) + // Customize a Notebook Instance (https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html). + LifecycleConfigName *string `type:"string"` + + // The name of the new notebook instance. + // + // NotebookInstanceName is a required field + NotebookInstanceName *string `type:"string" required:"true"` + + // When you send any requests to AWS resources from the notebook instance, Amazon + // SageMaker assumes this role to perform tasks on your behalf. You must grant + // this role necessary permissions so Amazon SageMaker can perform these tasks. + // The policy must allow the Amazon SageMaker service principal (sagemaker.amazonaws.com) + // permissions to assume this role. For more information, see Amazon SageMaker + // Roles (https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html). + // + // To be able to pass this role to Amazon SageMaker, the caller of this API + // must have the iam:PassRole permission. + // + // RoleArn is a required field + RoleArn *string `min:"20" type:"string" required:"true"` + + // Whether root access is enabled or disabled for users of the notebook instance. + // The default value is Enabled. + // + // Lifecycle configurations need root access to be able to set up a notebook + // instance. Because of this, lifecycle configurations associated with a notebook + // instance always run with root access even if you disable root access for + // users. + RootAccess *string `type:"string" enum:"RootAccess"` + + // The VPC security group IDs, in the form sg-xxxxxxxx. The security groups + // must be for the same VPC as specified in the subnet. + SecurityGroupIds []*string `type:"list"` + + // The ID of the subnet in a VPC to which you would like to have a connectivity + // from your ML compute instance. + SubnetId *string `type:"string"` + + // A list of tags to associate with the notebook instance. You can add tags + // later by using the CreateTags API. + Tags []*Tag `type:"list"` + + // The size, in GB, of the ML storage volume to attach to the notebook instance. + // The default value is 5 GB. + VolumeSizeInGB *int64 `min:"5" type:"integer"` +} + +// String returns the string representation +func (s CreateNotebookInstanceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNotebookInstanceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateNotebookInstanceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateNotebookInstanceInput"} + if s.DefaultCodeRepository != nil && len(*s.DefaultCodeRepository) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DefaultCodeRepository", 1)) + } + if s.InstanceType == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceType")) + } + if s.NotebookInstanceName == nil { + invalidParams.Add(request.NewErrParamRequired("NotebookInstanceName")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.RoleArn != nil && len(*s.RoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) + } + if s.VolumeSizeInGB != nil && *s.VolumeSizeInGB < 5 { + invalidParams.Add(request.NewErrParamMinValue("VolumeSizeInGB", 5)) + } + 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 +} + +// SetAcceleratorTypes sets the AcceleratorTypes field's value. +func (s *CreateNotebookInstanceInput) SetAcceleratorTypes(v []*string) *CreateNotebookInstanceInput { + s.AcceleratorTypes = v + return s +} + +// SetAdditionalCodeRepositories sets the AdditionalCodeRepositories field's value. +func (s *CreateNotebookInstanceInput) SetAdditionalCodeRepositories(v []*string) *CreateNotebookInstanceInput { + s.AdditionalCodeRepositories = v + return s +} + +// SetDefaultCodeRepository sets the DefaultCodeRepository field's value. +func (s *CreateNotebookInstanceInput) SetDefaultCodeRepository(v string) *CreateNotebookInstanceInput { + s.DefaultCodeRepository = &v + return s +} + +// SetDirectInternetAccess sets the DirectInternetAccess field's value. +func (s *CreateNotebookInstanceInput) SetDirectInternetAccess(v string) *CreateNotebookInstanceInput { + s.DirectInternetAccess = &v + return s +} + +// SetInstanceType sets the InstanceType field's value. +func (s *CreateNotebookInstanceInput) SetInstanceType(v string) *CreateNotebookInstanceInput { + s.InstanceType = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *CreateNotebookInstanceInput) SetKmsKeyId(v string) *CreateNotebookInstanceInput { + s.KmsKeyId = &v + return s +} + +// SetLifecycleConfigName sets the LifecycleConfigName field's value. +func (s *CreateNotebookInstanceInput) SetLifecycleConfigName(v string) *CreateNotebookInstanceInput { + s.LifecycleConfigName = &v + return s +} + +// SetNotebookInstanceName sets the NotebookInstanceName field's value. +func (s *CreateNotebookInstanceInput) SetNotebookInstanceName(v string) *CreateNotebookInstanceInput { + s.NotebookInstanceName = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *CreateNotebookInstanceInput) SetRoleArn(v string) *CreateNotebookInstanceInput { + s.RoleArn = &v + return s +} + +// SetRootAccess sets the RootAccess field's value. +func (s *CreateNotebookInstanceInput) SetRootAccess(v string) *CreateNotebookInstanceInput { + s.RootAccess = &v + return s +} + +// SetSecurityGroupIds sets the SecurityGroupIds field's value. +func (s *CreateNotebookInstanceInput) SetSecurityGroupIds(v []*string) *CreateNotebookInstanceInput { + s.SecurityGroupIds = v + return s +} + +// SetSubnetId sets the SubnetId field's value. +func (s *CreateNotebookInstanceInput) SetSubnetId(v string) *CreateNotebookInstanceInput { + s.SubnetId = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateNotebookInstanceInput) SetTags(v []*Tag) *CreateNotebookInstanceInput { + s.Tags = v + return s +} + +// SetVolumeSizeInGB sets the VolumeSizeInGB field's value. +func (s *CreateNotebookInstanceInput) SetVolumeSizeInGB(v int64) *CreateNotebookInstanceInput { + s.VolumeSizeInGB = &v + return s +} + +type CreateNotebookInstanceLifecycleConfigInput struct { + _ struct{} `type:"structure"` + + // The name of the lifecycle configuration. + // + // NotebookInstanceLifecycleConfigName is a required field + NotebookInstanceLifecycleConfigName *string `type:"string" required:"true"` + + // A shell script that runs only once, when you create a notebook instance. + // The shell script must be a base64-encoded string. + OnCreate []*NotebookInstanceLifecycleHook `type:"list"` + + // A shell script that runs every time you start a notebook instance, including + // when you create the notebook instance. The shell script must be a base64-encoded + // string. + OnStart []*NotebookInstanceLifecycleHook `type:"list"` +} + +// String returns the string representation +func (s CreateNotebookInstanceLifecycleConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNotebookInstanceLifecycleConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateNotebookInstanceLifecycleConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateNotebookInstanceLifecycleConfigInput"} + if s.NotebookInstanceLifecycleConfigName == nil { + invalidParams.Add(request.NewErrParamRequired("NotebookInstanceLifecycleConfigName")) + } + if s.OnCreate != nil { + for i, v := range s.OnCreate { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OnCreate", i), err.(request.ErrInvalidParams)) + } + } + } + if s.OnStart != nil { + for i, v := range s.OnStart { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OnStart", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNotebookInstanceLifecycleConfigName sets the NotebookInstanceLifecycleConfigName field's value. +func (s *CreateNotebookInstanceLifecycleConfigInput) SetNotebookInstanceLifecycleConfigName(v string) *CreateNotebookInstanceLifecycleConfigInput { + s.NotebookInstanceLifecycleConfigName = &v + return s +} + +// SetOnCreate sets the OnCreate field's value. +func (s *CreateNotebookInstanceLifecycleConfigInput) SetOnCreate(v []*NotebookInstanceLifecycleHook) *CreateNotebookInstanceLifecycleConfigInput { + s.OnCreate = v + return s +} + +// SetOnStart sets the OnStart field's value. +func (s *CreateNotebookInstanceLifecycleConfigInput) SetOnStart(v []*NotebookInstanceLifecycleHook) *CreateNotebookInstanceLifecycleConfigInput { + s.OnStart = v + return s +} + +type CreateNotebookInstanceLifecycleConfigOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the lifecycle configuration. + NotebookInstanceLifecycleConfigArn *string `type:"string"` +} + +// String returns the string representation +func (s CreateNotebookInstanceLifecycleConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNotebookInstanceLifecycleConfigOutput) GoString() string { + return s.String() +} + +// SetNotebookInstanceLifecycleConfigArn sets the NotebookInstanceLifecycleConfigArn field's value. +func (s *CreateNotebookInstanceLifecycleConfigOutput) SetNotebookInstanceLifecycleConfigArn(v string) *CreateNotebookInstanceLifecycleConfigOutput { + s.NotebookInstanceLifecycleConfigArn = &v + return s +} + +type CreateNotebookInstanceOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the notebook instance. + NotebookInstanceArn *string `type:"string"` +} + +// String returns the string representation +func (s CreateNotebookInstanceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateNotebookInstanceOutput) GoString() string { + return s.String() +} + +// SetNotebookInstanceArn sets the NotebookInstanceArn field's value. +func (s *CreateNotebookInstanceOutput) SetNotebookInstanceArn(v string) *CreateNotebookInstanceOutput { + s.NotebookInstanceArn = &v + return s +} + +type CreatePresignedDomainUrlInput struct { + _ struct{} `type:"structure"` + + // The domain ID. + // + // DomainId is a required field + DomainId *string `type:"string" required:"true"` + + // The session expiration duration in seconds. + SessionExpirationDurationInSeconds *int64 `min:"1800" type:"integer"` + + // The name of the UserProfile to sign-in as. + // + // UserProfileName is a required field + UserProfileName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreatePresignedDomainUrlInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePresignedDomainUrlInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreatePresignedDomainUrlInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreatePresignedDomainUrlInput"} + if s.DomainId == nil { + invalidParams.Add(request.NewErrParamRequired("DomainId")) + } + if s.SessionExpirationDurationInSeconds != nil && *s.SessionExpirationDurationInSeconds < 1800 { + invalidParams.Add(request.NewErrParamMinValue("SessionExpirationDurationInSeconds", 1800)) + } + if s.UserProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("UserProfileName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDomainId sets the DomainId field's value. +func (s *CreatePresignedDomainUrlInput) SetDomainId(v string) *CreatePresignedDomainUrlInput { + s.DomainId = &v + return s +} + +// SetSessionExpirationDurationInSeconds sets the SessionExpirationDurationInSeconds field's value. +func (s *CreatePresignedDomainUrlInput) SetSessionExpirationDurationInSeconds(v int64) *CreatePresignedDomainUrlInput { + s.SessionExpirationDurationInSeconds = &v + return s +} + +// SetUserProfileName sets the UserProfileName field's value. +func (s *CreatePresignedDomainUrlInput) SetUserProfileName(v string) *CreatePresignedDomainUrlInput { + s.UserProfileName = &v + return s +} + +type CreatePresignedDomainUrlOutput struct { + _ struct{} `type:"structure"` + + // The presigned URL. + AuthorizedUrl *string `type:"string"` +} + +// String returns the string representation +func (s CreatePresignedDomainUrlOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePresignedDomainUrlOutput) GoString() string { + return s.String() +} + +// SetAuthorizedUrl sets the AuthorizedUrl field's value. +func (s *CreatePresignedDomainUrlOutput) SetAuthorizedUrl(v string) *CreatePresignedDomainUrlOutput { + s.AuthorizedUrl = &v + return s +} + +type CreatePresignedNotebookInstanceUrlInput struct { + _ struct{} `type:"structure"` + + // The name of the notebook instance. + // + // NotebookInstanceName is a required field + NotebookInstanceName *string `type:"string" required:"true"` + + // The duration of the session, in seconds. The default is 12 hours. + SessionExpirationDurationInSeconds *int64 `min:"1800" type:"integer"` +} + +// String returns the string representation +func (s CreatePresignedNotebookInstanceUrlInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePresignedNotebookInstanceUrlInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreatePresignedNotebookInstanceUrlInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreatePresignedNotebookInstanceUrlInput"} + if s.NotebookInstanceName == nil { + invalidParams.Add(request.NewErrParamRequired("NotebookInstanceName")) + } + if s.SessionExpirationDurationInSeconds != nil && *s.SessionExpirationDurationInSeconds < 1800 { + invalidParams.Add(request.NewErrParamMinValue("SessionExpirationDurationInSeconds", 1800)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNotebookInstanceName sets the NotebookInstanceName field's value. +func (s *CreatePresignedNotebookInstanceUrlInput) SetNotebookInstanceName(v string) *CreatePresignedNotebookInstanceUrlInput { + s.NotebookInstanceName = &v + return s +} + +// SetSessionExpirationDurationInSeconds sets the SessionExpirationDurationInSeconds field's value. +func (s *CreatePresignedNotebookInstanceUrlInput) SetSessionExpirationDurationInSeconds(v int64) *CreatePresignedNotebookInstanceUrlInput { + s.SessionExpirationDurationInSeconds = &v + return s +} + +type CreatePresignedNotebookInstanceUrlOutput struct { + _ struct{} `type:"structure"` + + // A JSON object that contains the URL string. + AuthorizedUrl *string `type:"string"` +} + +// String returns the string representation +func (s CreatePresignedNotebookInstanceUrlOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreatePresignedNotebookInstanceUrlOutput) GoString() string { + return s.String() +} + +// SetAuthorizedUrl sets the AuthorizedUrl field's value. +func (s *CreatePresignedNotebookInstanceUrlOutput) SetAuthorizedUrl(v string) *CreatePresignedNotebookInstanceUrlOutput { + s.AuthorizedUrl = &v + return s +} + +type CreateProcessingJobInput struct { + _ struct{} `type:"structure"` + + // Configures the processing job to run a specified Docker container image. + // + // AppSpecification is a required field + AppSpecification *AppSpecification `type:"structure" required:"true"` + + // Sets the environment variables in the Docker container. + Environment map[string]*string `type:"map"` + + // Configuration for the experiment. + ExperimentConfig *ExperimentConfig `type:"structure"` + + // Networking options for a processing job. + NetworkConfig *NetworkConfig `type:"structure"` + + // For each input, data is downloaded from S3 into the processing container + // before the processing job begins running if "S3InputMode" is set to File. + ProcessingInputs []*ProcessingInput `type:"list"` + + // The name of the processing job. The name must be unique within an AWS Region + // in the AWS account. + // + // ProcessingJobName is a required field + ProcessingJobName *string `min:"1" type:"string" required:"true"` + + // Output configuration for the processing job. + ProcessingOutputConfig *ProcessingOutputConfig `type:"structure"` + + // Identifies the resources, ML compute instances, and ML storage volumes to + // deploy for a processing job. In distributed training, you specify more than + // one instance. + // + // ProcessingResources is a required field + ProcessingResources *ProcessingResources `type:"structure" required:"true"` + + // The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume + // to perform tasks on your behalf. + // + // RoleArn is a required field + RoleArn *string `min:"20" type:"string" required:"true"` + + // The time limit for how long the processing job is allowed to run. + StoppingCondition *ProcessingStoppingCondition `type:"structure"` + + // (Optional) An array of key-value pairs. For more information, see Using Cost + // Allocation Tags (https://docs-aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-whatURL) + // in the AWS Billing and Cost Management User Guide. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s CreateProcessingJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateProcessingJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateProcessingJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateProcessingJobInput"} + if s.AppSpecification == nil { + invalidParams.Add(request.NewErrParamRequired("AppSpecification")) + } + if s.ProcessingJobName == nil { + invalidParams.Add(request.NewErrParamRequired("ProcessingJobName")) + } + if s.ProcessingJobName != nil && len(*s.ProcessingJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ProcessingJobName", 1)) + } + if s.ProcessingResources == nil { + invalidParams.Add(request.NewErrParamRequired("ProcessingResources")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.RoleArn != nil && len(*s.RoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) + } + if s.AppSpecification != nil { + if err := s.AppSpecification.Validate(); err != nil { + invalidParams.AddNested("AppSpecification", err.(request.ErrInvalidParams)) + } + } + if s.ExperimentConfig != nil { + if err := s.ExperimentConfig.Validate(); err != nil { + invalidParams.AddNested("ExperimentConfig", err.(request.ErrInvalidParams)) + } + } + if s.NetworkConfig != nil { + if err := s.NetworkConfig.Validate(); err != nil { + invalidParams.AddNested("NetworkConfig", err.(request.ErrInvalidParams)) + } + } + if s.ProcessingInputs != nil { + for i, v := range s.ProcessingInputs { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ProcessingInputs", i), err.(request.ErrInvalidParams)) + } + } + } + if s.ProcessingOutputConfig != nil { + if err := s.ProcessingOutputConfig.Validate(); err != nil { + invalidParams.AddNested("ProcessingOutputConfig", err.(request.ErrInvalidParams)) + } + } + if s.ProcessingResources != nil { + if err := s.ProcessingResources.Validate(); err != nil { + invalidParams.AddNested("ProcessingResources", err.(request.ErrInvalidParams)) + } + } + if s.StoppingCondition != nil { + if err := s.StoppingCondition.Validate(); err != nil { + invalidParams.AddNested("StoppingCondition", 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 +} + +// SetAppSpecification sets the AppSpecification field's value. +func (s *CreateProcessingJobInput) SetAppSpecification(v *AppSpecification) *CreateProcessingJobInput { + s.AppSpecification = v + return s +} + +// SetEnvironment sets the Environment field's value. +func (s *CreateProcessingJobInput) SetEnvironment(v map[string]*string) *CreateProcessingJobInput { + s.Environment = v + return s +} + +// SetExperimentConfig sets the ExperimentConfig field's value. +func (s *CreateProcessingJobInput) SetExperimentConfig(v *ExperimentConfig) *CreateProcessingJobInput { + s.ExperimentConfig = v + return s +} + +// SetNetworkConfig sets the NetworkConfig field's value. +func (s *CreateProcessingJobInput) SetNetworkConfig(v *NetworkConfig) *CreateProcessingJobInput { + s.NetworkConfig = v + return s +} + +// SetProcessingInputs sets the ProcessingInputs field's value. +func (s *CreateProcessingJobInput) SetProcessingInputs(v []*ProcessingInput) *CreateProcessingJobInput { + s.ProcessingInputs = v + return s +} + +// SetProcessingJobName sets the ProcessingJobName field's value. +func (s *CreateProcessingJobInput) SetProcessingJobName(v string) *CreateProcessingJobInput { + s.ProcessingJobName = &v + return s +} + +// SetProcessingOutputConfig sets the ProcessingOutputConfig field's value. +func (s *CreateProcessingJobInput) SetProcessingOutputConfig(v *ProcessingOutputConfig) *CreateProcessingJobInput { + s.ProcessingOutputConfig = v + return s +} + +// SetProcessingResources sets the ProcessingResources field's value. +func (s *CreateProcessingJobInput) SetProcessingResources(v *ProcessingResources) *CreateProcessingJobInput { + s.ProcessingResources = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *CreateProcessingJobInput) SetRoleArn(v string) *CreateProcessingJobInput { + s.RoleArn = &v + return s +} + +// SetStoppingCondition sets the StoppingCondition field's value. +func (s *CreateProcessingJobInput) SetStoppingCondition(v *ProcessingStoppingCondition) *CreateProcessingJobInput { + s.StoppingCondition = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateProcessingJobInput) SetTags(v []*Tag) *CreateProcessingJobInput { + s.Tags = v + return s +} + +type CreateProcessingJobOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the processing job. + // + // ProcessingJobArn is a required field + ProcessingJobArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateProcessingJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateProcessingJobOutput) GoString() string { + return s.String() +} + +// SetProcessingJobArn sets the ProcessingJobArn field's value. +func (s *CreateProcessingJobOutput) SetProcessingJobArn(v string) *CreateProcessingJobOutput { + s.ProcessingJobArn = &v + return s +} + +type CreateTrainingJobInput struct { + _ struct{} `type:"structure"` + + // The registry path of the Docker image that contains the training algorithm + // and algorithm-specific metadata, including the input mode. For more information + // about algorithms provided by Amazon SageMaker, see Algorithms (https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html). + // For information about providing your own algorithms, see Using Your Own Algorithms + // with Amazon SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html). + // + // AlgorithmSpecification is a required field + AlgorithmSpecification *AlgorithmSpecification `type:"structure" required:"true"` + + // Contains information about the output location for managed spot training + // checkpoint data. + CheckpointConfig *CheckpointConfig `type:"structure"` + + // Configuration information for the debug hook parameters, collection configuration, + // and storage paths. + DebugHookConfig *DebugHookConfig `type:"structure"` + + // Configuration information for debugging rules. + DebugRuleConfigurations []*DebugRuleConfiguration `type:"list"` + + // To encrypt all communications between ML compute instances in distributed + // training, choose True. Encryption provides greater security for distributed + // training, but training might take longer. How long it takes depends on the + // amount of communication between compute instances, especially if you use + // a deep learning algorithm in distributed training. For more information, + // see Protect Communications Between ML Compute Instances in a Distributed + // Training Job (https://docs.aws.amazon.com/sagemaker/latest/dg/train-encrypt.html). + EnableInterContainerTrafficEncryption *bool `type:"boolean"` + + // To train models using managed spot training, choose True. Managed spot training + // provides a fully managed and scalable infrastructure for training machine + // learning models. this option is useful when training jobs can be interrupted + // and when there is flexibility when the training job is run. + // + // The complete and intermediate results of jobs are stored in an Amazon S3 + // bucket, and can be used as a starting point to train models incrementally. + // Amazon SageMaker provides metrics and logs in CloudWatch. They can be used + // to see when managed spot training jobs are running, interrupted, resumed, + // or completed. + EnableManagedSpotTraining *bool `type:"boolean"` + + // Isolates the training container. No inbound or outbound network calls can + // be made, except for calls between peers within a training cluster for distributed + // training. If you enable network isolation for training jobs that are configured + // to use a VPC, Amazon SageMaker downloads and uploads customer data and model + // artifacts through the specified VPC, but the training container does not + // have network access. + EnableNetworkIsolation *bool `type:"boolean"` + + // Configuration for the experiment. + ExperimentConfig *ExperimentConfig `type:"structure"` + + // Algorithm-specific parameters that influence the quality of the model. You + // set hyperparameters before you start the learning process. For a list of + // hyperparameters for each training algorithm provided by Amazon SageMaker, + // see Algorithms (https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html). + // + // You can specify a maximum of 100 hyperparameters. Each hyperparameter is + // a key-value pair. Each key and value is limited to 256 characters, as specified + // by the Length Constraint. + HyperParameters map[string]*string `type:"map"` + + // An array of Channel objects. Each channel is a named input source. InputDataConfig + // describes the input data and its location. + // + // Algorithms can accept input data from one or more channels. For example, + // an algorithm might have two channels of input data, training_data and validation_data. + // The configuration for each channel provides the S3, EFS, or FSx location + // where the input data is stored. It also provides information about the stored + // data: the MIME type, compression method, and whether the data is wrapped + // in RecordIO format. + // + // Depending on the input mode that the algorithm supports, Amazon SageMaker + // either copies input data files from an S3 bucket to a local directory in + // the Docker container, or makes it available as input streams. For example, + // if you specify an EFS location, input data files will be made available as + // input streams. They do not need to be downloaded. + InputDataConfig []*Channel `min:"1" type:"list"` + + // Specifies the path to the S3 location where you want to store model artifacts. + // Amazon SageMaker creates subfolders for the artifacts. + // + // OutputDataConfig is a required field + OutputDataConfig *OutputDataConfig `type:"structure" required:"true"` + + // The resources, including the ML compute instances and ML storage volumes, + // to use for model training. + // + // ML storage volumes store model artifacts and incremental states. Training + // algorithms might also use ML storage volumes for scratch space. If you want + // Amazon SageMaker to use the ML storage volume to store the training data, + // choose File as the TrainingInputMode in the algorithm specification. For + // distributed training algorithms, specify an instance count greater than 1. + // + // ResourceConfig is a required field + ResourceConfig *ResourceConfig `type:"structure" required:"true"` + + // The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume + // to perform tasks on your behalf. + // + // During model training, Amazon SageMaker needs your permission to read input + // data from an S3 bucket, download a Docker image that contains training code, + // write model artifacts to an S3 bucket, write logs to Amazon CloudWatch Logs, + // and publish metrics to Amazon CloudWatch. You grant permissions for all of + // these tasks to an IAM role. For more information, see Amazon SageMaker Roles + // (https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html). + // + // To be able to pass this role to Amazon SageMaker, the caller of this API + // must have the iam:PassRole permission. + // + // RoleArn is a required field + RoleArn *string `min:"20" type:"string" required:"true"` + + // Specifies a limit to how long a model training job can run. When the job + // reaches the time limit, Amazon SageMaker ends the training job. Use this + // API to cap model training costs. + // + // To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal, which + // delays job termination for 120 seconds. Algorithms can use this 120-second + // window to save the model artifacts, so the results of training are not lost. + // + // StoppingCondition is a required field + StoppingCondition *StoppingCondition `type:"structure" required:"true"` + + // An array of key-value pairs. For more information, see Using Cost Allocation + // Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) + // in the AWS Billing and Cost Management User Guide. + Tags []*Tag `type:"list"` + + // Configuration of storage locations for TensorBoard output. + TensorBoardOutputConfig *TensorBoardOutputConfig `type:"structure"` + + // The name of the training job. The name must be unique within an AWS Region + // in an AWS account. + // + // TrainingJobName is a required field + TrainingJobName *string `min:"1" type:"string" required:"true"` + + // A VpcConfig object that specifies the VPC that you want your training job + // to connect to. Control access to and from your training container by configuring + // the VPC. For more information, see Protect Training Jobs by Using an Amazon + // Virtual Private Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html). + VpcConfig *VpcConfig `type:"structure"` +} + +// String returns the string representation +func (s CreateTrainingJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTrainingJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTrainingJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTrainingJobInput"} + if s.AlgorithmSpecification == nil { + invalidParams.Add(request.NewErrParamRequired("AlgorithmSpecification")) + } + if s.InputDataConfig != nil && len(s.InputDataConfig) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InputDataConfig", 1)) + } + if s.OutputDataConfig == nil { + invalidParams.Add(request.NewErrParamRequired("OutputDataConfig")) + } + if s.ResourceConfig == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceConfig")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.RoleArn != nil && len(*s.RoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) + } + if s.StoppingCondition == nil { + invalidParams.Add(request.NewErrParamRequired("StoppingCondition")) + } + if s.TrainingJobName == nil { + invalidParams.Add(request.NewErrParamRequired("TrainingJobName")) + } + if s.TrainingJobName != nil && len(*s.TrainingJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrainingJobName", 1)) + } + if s.AlgorithmSpecification != nil { + if err := s.AlgorithmSpecification.Validate(); err != nil { + invalidParams.AddNested("AlgorithmSpecification", err.(request.ErrInvalidParams)) + } + } + if s.CheckpointConfig != nil { + if err := s.CheckpointConfig.Validate(); err != nil { + invalidParams.AddNested("CheckpointConfig", err.(request.ErrInvalidParams)) + } + } + if s.DebugHookConfig != nil { + if err := s.DebugHookConfig.Validate(); err != nil { + invalidParams.AddNested("DebugHookConfig", err.(request.ErrInvalidParams)) + } + } + if s.DebugRuleConfigurations != nil { + for i, v := range s.DebugRuleConfigurations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DebugRuleConfigurations", i), err.(request.ErrInvalidParams)) + } + } + } + if s.ExperimentConfig != nil { + if err := s.ExperimentConfig.Validate(); err != nil { + invalidParams.AddNested("ExperimentConfig", err.(request.ErrInvalidParams)) + } + } + if s.InputDataConfig != nil { + for i, v := range s.InputDataConfig { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputDataConfig", i), err.(request.ErrInvalidParams)) + } + } + } + if s.OutputDataConfig != nil { + if err := s.OutputDataConfig.Validate(); err != nil { + invalidParams.AddNested("OutputDataConfig", err.(request.ErrInvalidParams)) + } + } + if s.ResourceConfig != nil { + if err := s.ResourceConfig.Validate(); err != nil { + invalidParams.AddNested("ResourceConfig", err.(request.ErrInvalidParams)) + } + } + if s.StoppingCondition != nil { + if err := s.StoppingCondition.Validate(); err != nil { + invalidParams.AddNested("StoppingCondition", 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 s.TensorBoardOutputConfig != nil { + if err := s.TensorBoardOutputConfig.Validate(); err != nil { + invalidParams.AddNested("TensorBoardOutputConfig", err.(request.ErrInvalidParams)) + } + } + if s.VpcConfig != nil { + if err := s.VpcConfig.Validate(); err != nil { + invalidParams.AddNested("VpcConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAlgorithmSpecification sets the AlgorithmSpecification field's value. +func (s *CreateTrainingJobInput) SetAlgorithmSpecification(v *AlgorithmSpecification) *CreateTrainingJobInput { + s.AlgorithmSpecification = v + return s +} + +// SetCheckpointConfig sets the CheckpointConfig field's value. +func (s *CreateTrainingJobInput) SetCheckpointConfig(v *CheckpointConfig) *CreateTrainingJobInput { + s.CheckpointConfig = v + return s +} + +// SetDebugHookConfig sets the DebugHookConfig field's value. +func (s *CreateTrainingJobInput) SetDebugHookConfig(v *DebugHookConfig) *CreateTrainingJobInput { + s.DebugHookConfig = v + return s +} + +// SetDebugRuleConfigurations sets the DebugRuleConfigurations field's value. +func (s *CreateTrainingJobInput) SetDebugRuleConfigurations(v []*DebugRuleConfiguration) *CreateTrainingJobInput { + s.DebugRuleConfigurations = v + return s +} + +// SetEnableInterContainerTrafficEncryption sets the EnableInterContainerTrafficEncryption field's value. +func (s *CreateTrainingJobInput) SetEnableInterContainerTrafficEncryption(v bool) *CreateTrainingJobInput { + s.EnableInterContainerTrafficEncryption = &v + return s +} + +// SetEnableManagedSpotTraining sets the EnableManagedSpotTraining field's value. +func (s *CreateTrainingJobInput) SetEnableManagedSpotTraining(v bool) *CreateTrainingJobInput { + s.EnableManagedSpotTraining = &v + return s +} + +// SetEnableNetworkIsolation sets the EnableNetworkIsolation field's value. +func (s *CreateTrainingJobInput) SetEnableNetworkIsolation(v bool) *CreateTrainingJobInput { + s.EnableNetworkIsolation = &v + return s +} + +// SetExperimentConfig sets the ExperimentConfig field's value. +func (s *CreateTrainingJobInput) SetExperimentConfig(v *ExperimentConfig) *CreateTrainingJobInput { + s.ExperimentConfig = v + return s +} + +// SetHyperParameters sets the HyperParameters field's value. +func (s *CreateTrainingJobInput) SetHyperParameters(v map[string]*string) *CreateTrainingJobInput { + s.HyperParameters = v + return s +} + +// SetInputDataConfig sets the InputDataConfig field's value. +func (s *CreateTrainingJobInput) SetInputDataConfig(v []*Channel) *CreateTrainingJobInput { + s.InputDataConfig = v + return s +} + +// SetOutputDataConfig sets the OutputDataConfig field's value. +func (s *CreateTrainingJobInput) SetOutputDataConfig(v *OutputDataConfig) *CreateTrainingJobInput { + s.OutputDataConfig = v + return s +} + +// SetResourceConfig sets the ResourceConfig field's value. +func (s *CreateTrainingJobInput) SetResourceConfig(v *ResourceConfig) *CreateTrainingJobInput { + s.ResourceConfig = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *CreateTrainingJobInput) SetRoleArn(v string) *CreateTrainingJobInput { + s.RoleArn = &v + return s +} + +// SetStoppingCondition sets the StoppingCondition field's value. +func (s *CreateTrainingJobInput) SetStoppingCondition(v *StoppingCondition) *CreateTrainingJobInput { + s.StoppingCondition = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateTrainingJobInput) SetTags(v []*Tag) *CreateTrainingJobInput { + s.Tags = v + return s +} + +// SetTensorBoardOutputConfig sets the TensorBoardOutputConfig field's value. +func (s *CreateTrainingJobInput) SetTensorBoardOutputConfig(v *TensorBoardOutputConfig) *CreateTrainingJobInput { + s.TensorBoardOutputConfig = v + return s +} + +// SetTrainingJobName sets the TrainingJobName field's value. +func (s *CreateTrainingJobInput) SetTrainingJobName(v string) *CreateTrainingJobInput { + s.TrainingJobName = &v + return s +} + +// SetVpcConfig sets the VpcConfig field's value. +func (s *CreateTrainingJobInput) SetVpcConfig(v *VpcConfig) *CreateTrainingJobInput { + s.VpcConfig = v + return s +} + +type CreateTrainingJobOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the training job. + // + // TrainingJobArn is a required field + TrainingJobArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateTrainingJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTrainingJobOutput) GoString() string { + return s.String() +} + +// SetTrainingJobArn sets the TrainingJobArn field's value. +func (s *CreateTrainingJobOutput) SetTrainingJobArn(v string) *CreateTrainingJobOutput { + s.TrainingJobArn = &v + return s +} + +type CreateTransformJobInput struct { + _ struct{} `type:"structure"` + + // Specifies the number of records to include in a mini-batch for an HTTP inference + // request. A record is a single unit of input data that inference can be made + // on. For example, a single line in a CSV file is a record. + // + // To enable the batch strategy, you must set the SplitType property of the + // DataProcessing object to Line, RecordIO, or TFRecord. + // + // To use only one record when making an HTTP invocation request to a container, + // set BatchStrategy to SingleRecord and SplitType to Line. + // + // To fit as many records in a mini-batch as can fit within the MaxPayloadInMB + // limit, set BatchStrategy to MultiRecord and SplitType to Line. + BatchStrategy *string `type:"string" enum:"BatchStrategy"` + + // The data structure used to specify the data to be used for inference in a + // batch transform job and to associate the data that is relevant to the prediction + // results in the output. The input filter provided allows you to exclude input + // data that is not needed for inference in a batch transform job. The output + // filter provided allows you to include input data relevant to interpreting + // the predictions in the output from the job. For more information, see Associate + // Prediction Results with their Corresponding Input Records (https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform-data-processing.html). + DataProcessing *DataProcessing `type:"structure"` + + // The environment variables to set in the Docker container. We support up to + // 16 key and values entries in the map. + Environment map[string]*string `type:"map"` + + // Configuration for the experiment. + ExperimentConfig *ExperimentConfig `type:"structure"` + + // The maximum number of parallel requests that can be sent to each instance + // in a transform job. If MaxConcurrentTransforms is set to 0 or left unset, + // Amazon SageMaker checks the optional execution-parameters to determine the + // settings for your chosen algorithm. If the execution-parameters endpoint + // is not enabled, the default value is 1. For more information on execution-parameters, + // see How Containers Serve Requests (https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-batch-code.html#your-algorithms-batch-code-how-containe-serves-requests). + // For built-in algorithms, you don't need to set a value for MaxConcurrentTransforms. + MaxConcurrentTransforms *int64 `type:"integer"` + + // The maximum allowed size of the payload, in MB. A payload is the data portion + // of a record (without metadata). The value in MaxPayloadInMB must be greater + // than, or equal to, the size of a single record. To estimate the size of a + // record in MB, divide the size of your dataset by the number of records. To + // ensure that the records fit within the maximum payload size, we recommend + // using a slightly larger value. The default value is 6 MB. + // + // For cases where the payload might be arbitrarily large and is transmitted + // using HTTP chunked encoding, set the value to 0. This feature works only + // in supported algorithms. Currently, Amazon SageMaker built-in algorithms + // do not support HTTP chunked encoding. + MaxPayloadInMB *int64 `type:"integer"` + + // The name of the model that you want to use for the transform job. ModelName + // must be the name of an existing Amazon SageMaker model within an AWS Region + // in an AWS account. + // + // ModelName is a required field + ModelName *string `type:"string" required:"true"` + + // (Optional) An array of key-value pairs. For more information, see Using Cost + // Allocation Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) + // in the AWS Billing and Cost Management User Guide. + Tags []*Tag `type:"list"` + + // Describes the input source and the way the transform job consumes it. + // + // TransformInput is a required field + TransformInput *TransformInput `type:"structure" required:"true"` + + // The name of the transform job. The name must be unique within an AWS Region + // in an AWS account. + // + // TransformJobName is a required field + TransformJobName *string `min:"1" type:"string" required:"true"` + + // Describes the results of the transform job. + // + // TransformOutput is a required field + TransformOutput *TransformOutput `type:"structure" required:"true"` + + // Describes the resources, including ML instance types and ML instance count, + // to use for the transform job. + // + // TransformResources is a required field + TransformResources *TransformResources `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateTransformJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTransformJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTransformJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTransformJobInput"} + if s.ModelName == nil { + invalidParams.Add(request.NewErrParamRequired("ModelName")) + } + if s.TransformInput == nil { + invalidParams.Add(request.NewErrParamRequired("TransformInput")) + } + if s.TransformJobName == nil { + invalidParams.Add(request.NewErrParamRequired("TransformJobName")) + } + if s.TransformJobName != nil && len(*s.TransformJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TransformJobName", 1)) + } + if s.TransformOutput == nil { + invalidParams.Add(request.NewErrParamRequired("TransformOutput")) + } + if s.TransformResources == nil { + invalidParams.Add(request.NewErrParamRequired("TransformResources")) + } + if s.ExperimentConfig != nil { + if err := s.ExperimentConfig.Validate(); err != nil { + invalidParams.AddNested("ExperimentConfig", 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 s.TransformInput != nil { + if err := s.TransformInput.Validate(); err != nil { + invalidParams.AddNested("TransformInput", err.(request.ErrInvalidParams)) + } + } + if s.TransformOutput != nil { + if err := s.TransformOutput.Validate(); err != nil { + invalidParams.AddNested("TransformOutput", err.(request.ErrInvalidParams)) + } + } + if s.TransformResources != nil { + if err := s.TransformResources.Validate(); err != nil { + invalidParams.AddNested("TransformResources", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBatchStrategy sets the BatchStrategy field's value. +func (s *CreateTransformJobInput) SetBatchStrategy(v string) *CreateTransformJobInput { + s.BatchStrategy = &v + return s +} + +// SetDataProcessing sets the DataProcessing field's value. +func (s *CreateTransformJobInput) SetDataProcessing(v *DataProcessing) *CreateTransformJobInput { + s.DataProcessing = v + return s +} + +// SetEnvironment sets the Environment field's value. +func (s *CreateTransformJobInput) SetEnvironment(v map[string]*string) *CreateTransformJobInput { + s.Environment = v + return s +} + +// SetExperimentConfig sets the ExperimentConfig field's value. +func (s *CreateTransformJobInput) SetExperimentConfig(v *ExperimentConfig) *CreateTransformJobInput { + s.ExperimentConfig = v + return s +} + +// SetMaxConcurrentTransforms sets the MaxConcurrentTransforms field's value. +func (s *CreateTransformJobInput) SetMaxConcurrentTransforms(v int64) *CreateTransformJobInput { + s.MaxConcurrentTransforms = &v + return s +} + +// SetMaxPayloadInMB sets the MaxPayloadInMB field's value. +func (s *CreateTransformJobInput) SetMaxPayloadInMB(v int64) *CreateTransformJobInput { + s.MaxPayloadInMB = &v + return s +} + +// SetModelName sets the ModelName field's value. +func (s *CreateTransformJobInput) SetModelName(v string) *CreateTransformJobInput { + s.ModelName = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateTransformJobInput) SetTags(v []*Tag) *CreateTransformJobInput { + s.Tags = v + return s +} + +// SetTransformInput sets the TransformInput field's value. +func (s *CreateTransformJobInput) SetTransformInput(v *TransformInput) *CreateTransformJobInput { + s.TransformInput = v + return s +} + +// SetTransformJobName sets the TransformJobName field's value. +func (s *CreateTransformJobInput) SetTransformJobName(v string) *CreateTransformJobInput { + s.TransformJobName = &v + return s +} + +// SetTransformOutput sets the TransformOutput field's value. +func (s *CreateTransformJobInput) SetTransformOutput(v *TransformOutput) *CreateTransformJobInput { + s.TransformOutput = v + return s +} + +// SetTransformResources sets the TransformResources field's value. +func (s *CreateTransformJobInput) SetTransformResources(v *TransformResources) *CreateTransformJobInput { + s.TransformResources = v + return s +} + +type CreateTransformJobOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the transform job. + // + // TransformJobArn is a required field + TransformJobArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateTransformJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTransformJobOutput) GoString() string { + return s.String() +} + +// SetTransformJobArn sets the TransformJobArn field's value. +func (s *CreateTransformJobOutput) SetTransformJobArn(v string) *CreateTransformJobOutput { + s.TransformJobArn = &v + return s +} + +type CreateTrialComponentInput struct { + _ struct{} `type:"structure"` + + // The name of the component as displayed. The name doesn't need to be unique. + // If DisplayName isn't specified, TrialComponentName is displayed. + DisplayName *string `min:"1" type:"string"` + + // When the component ended. + EndTime *time.Time `type:"timestamp"` + + // The input artifacts for the component. Examples of input artifacts are datasets, + // algorithms, hyperparameters, source code, and instance types. + InputArtifacts map[string]*TrialComponentArtifact `type:"map"` + + // The output artifacts for the component. Examples of output artifacts are + // metrics, snapshots, logs, and images. + OutputArtifacts map[string]*TrialComponentArtifact `type:"map"` + + // The hyperparameters for the component. + Parameters map[string]*TrialComponentParameterValue `type:"map"` + + // When the component started. + StartTime *time.Time `type:"timestamp"` + + // The status of the component. States include: + // + // * InProgress + // + // * Completed + // + // * Failed + Status *TrialComponentStatus `type:"structure"` + + // A list of tags to associate with the component. You can use Search API to + // search on the tags. + Tags []*Tag `type:"list"` + + // The name of the component. The name must be unique in your AWS account and + // is not case-sensitive. + // + // TrialComponentName is a required field + TrialComponentName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateTrialComponentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTrialComponentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTrialComponentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTrialComponentInput"} + if s.DisplayName != nil && len(*s.DisplayName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) + } + if s.TrialComponentName == nil { + invalidParams.Add(request.NewErrParamRequired("TrialComponentName")) + } + if s.TrialComponentName != nil && len(*s.TrialComponentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialComponentName", 1)) + } + 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 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 +} + +// SetDisplayName sets the DisplayName field's value. +func (s *CreateTrialComponentInput) SetDisplayName(v string) *CreateTrialComponentInput { + s.DisplayName = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *CreateTrialComponentInput) SetEndTime(v time.Time) *CreateTrialComponentInput { + s.EndTime = &v + return s +} + +// SetInputArtifacts sets the InputArtifacts field's value. +func (s *CreateTrialComponentInput) SetInputArtifacts(v map[string]*TrialComponentArtifact) *CreateTrialComponentInput { + s.InputArtifacts = v + return s +} + +// SetOutputArtifacts sets the OutputArtifacts field's value. +func (s *CreateTrialComponentInput) SetOutputArtifacts(v map[string]*TrialComponentArtifact) *CreateTrialComponentInput { + s.OutputArtifacts = v + return s +} + +// SetParameters sets the Parameters field's value. +func (s *CreateTrialComponentInput) SetParameters(v map[string]*TrialComponentParameterValue) *CreateTrialComponentInput { + s.Parameters = v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *CreateTrialComponentInput) SetStartTime(v time.Time) *CreateTrialComponentInput { + s.StartTime = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *CreateTrialComponentInput) SetStatus(v *TrialComponentStatus) *CreateTrialComponentInput { + s.Status = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateTrialComponentInput) SetTags(v []*Tag) *CreateTrialComponentInput { + s.Tags = v + return s +} + +// SetTrialComponentName sets the TrialComponentName field's value. +func (s *CreateTrialComponentInput) SetTrialComponentName(v string) *CreateTrialComponentInput { + s.TrialComponentName = &v + return s +} + +type CreateTrialComponentOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the trial component. + TrialComponentArn *string `type:"string"` +} + +// String returns the string representation +func (s CreateTrialComponentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTrialComponentOutput) GoString() string { + return s.String() +} + +// SetTrialComponentArn sets the TrialComponentArn field's value. +func (s *CreateTrialComponentOutput) SetTrialComponentArn(v string) *CreateTrialComponentOutput { + s.TrialComponentArn = &v + return s +} + +type CreateTrialInput struct { + _ struct{} `type:"structure"` + + // The name of the trial as displayed. The name doesn't need to be unique. If + // DisplayName isn't specified, TrialName is displayed. + DisplayName *string `min:"1" type:"string"` + + // The name of the experiment to associate the trial with. + // + // ExperimentName is a required field + ExperimentName *string `min:"1" type:"string" required:"true"` + + // A list of tags to associate with the trial. You can use Search API to search + // on the tags. + Tags []*Tag `type:"list"` + + // The name of the trial. The name must be unique in your AWS account and is + // not case-sensitive. + // + // TrialName is a required field + TrialName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateTrialInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTrialInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateTrialInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateTrialInput"} + if s.DisplayName != nil && len(*s.DisplayName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) + } + if s.ExperimentName == nil { + invalidParams.Add(request.NewErrParamRequired("ExperimentName")) + } + if s.ExperimentName != nil && len(*s.ExperimentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ExperimentName", 1)) + } + if s.TrialName == nil { + invalidParams.Add(request.NewErrParamRequired("TrialName")) + } + if s.TrialName != nil && len(*s.TrialName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialName", 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 +} + +// SetDisplayName sets the DisplayName field's value. +func (s *CreateTrialInput) SetDisplayName(v string) *CreateTrialInput { + s.DisplayName = &v + return s +} + +// SetExperimentName sets the ExperimentName field's value. +func (s *CreateTrialInput) SetExperimentName(v string) *CreateTrialInput { + s.ExperimentName = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateTrialInput) SetTags(v []*Tag) *CreateTrialInput { + s.Tags = v + return s +} + +// SetTrialName sets the TrialName field's value. +func (s *CreateTrialInput) SetTrialName(v string) *CreateTrialInput { + s.TrialName = &v + return s +} + +type CreateTrialOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the trial. + TrialArn *string `type:"string"` +} + +// String returns the string representation +func (s CreateTrialOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateTrialOutput) GoString() string { + return s.String() +} + +// SetTrialArn sets the TrialArn field's value. +func (s *CreateTrialOutput) SetTrialArn(v string) *CreateTrialOutput { + s.TrialArn = &v + return s +} + +type CreateUserProfileInput struct { + _ struct{} `type:"structure"` + + // The ID of the associated Domain. + // + // DomainId is a required field + DomainId *string `type:"string" required:"true"` + + // A specifier for the type of value specified in SingleSignOnUserValue. Currently, + // the only supported value is "UserName". If the Domain's AuthMode is SSO, + // this field is required. If the Domain's AuthMode is not SSO, this field cannot + // be specified. + SingleSignOnUserIdentifier *string `type:"string"` + + // The username of the associated AWS Single Sign-On User for this UserProfile. + // If the Domain's AuthMode is SSO, this field is required, and must match a + // valid username of a user in your directory. If the Domain's AuthMode is not + // SSO, this field cannot be specified. + SingleSignOnUserValue *string `type:"string"` + + // Each tag consists of a key and an optional value. Tag keys must be unique + // per resource. + Tags []*Tag `type:"list"` + + // A name for the UserProfile. + // + // UserProfileName is a required field + UserProfileName *string `type:"string" required:"true"` + + // A collection of settings. + UserSettings *UserSettings `type:"structure"` +} + +// 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.DomainId == nil { + invalidParams.Add(request.NewErrParamRequired("DomainId")) + } + if s.UserProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("UserProfileName")) + } + 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 s.UserSettings != nil { + if err := s.UserSettings.Validate(); err != nil { + invalidParams.AddNested("UserSettings", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDomainId sets the DomainId field's value. +func (s *CreateUserProfileInput) SetDomainId(v string) *CreateUserProfileInput { + s.DomainId = &v + return s +} + +// SetSingleSignOnUserIdentifier sets the SingleSignOnUserIdentifier field's value. +func (s *CreateUserProfileInput) SetSingleSignOnUserIdentifier(v string) *CreateUserProfileInput { + s.SingleSignOnUserIdentifier = &v + return s +} + +// SetSingleSignOnUserValue sets the SingleSignOnUserValue field's value. +func (s *CreateUserProfileInput) SetSingleSignOnUserValue(v string) *CreateUserProfileInput { + s.SingleSignOnUserValue = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateUserProfileInput) SetTags(v []*Tag) *CreateUserProfileInput { + s.Tags = v + return s +} + +// SetUserProfileName sets the UserProfileName field's value. +func (s *CreateUserProfileInput) SetUserProfileName(v string) *CreateUserProfileInput { + s.UserProfileName = &v + return s +} + +// SetUserSettings sets the UserSettings field's value. +func (s *CreateUserProfileInput) SetUserSettings(v *UserSettings) *CreateUserProfileInput { + s.UserSettings = v + return s +} + +type CreateUserProfileOutput struct { + _ struct{} `type:"structure"` + + // The user profile Amazon Resource Name (ARN). + UserProfileArn *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() +} + +// SetUserProfileArn sets the UserProfileArn field's value. +func (s *CreateUserProfileOutput) SetUserProfileArn(v string) *CreateUserProfileOutput { + s.UserProfileArn = &v + return s +} + +type CreateWorkteamInput struct { + _ struct{} `type:"structure"` + + // A description of the work team. + // + // Description is a required field + Description *string `min:"1" type:"string" required:"true"` + + // A list of MemberDefinition objects that contains objects that identify the + // Amazon Cognito user pool that makes up the work team. For more information, + // see Amazon Cognito User Pools (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html). + // + // All of the CognitoMemberDefinition objects that make up the member definition + // must have the same ClientId and UserPool values. + // + // MemberDefinitions is a required field + MemberDefinitions []*MemberDefinition `min:"1" type:"list" required:"true"` + + // Configures notification of workers regarding available or expiring work items. + NotificationConfiguration *NotificationConfiguration `type:"structure"` + + // An array of key-value pairs. + // + // For more information, see Resource Tag (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) + // and Using Cost Allocation Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) + // in the AWS Billing and Cost Management User Guide. + Tags []*Tag `type:"list"` + + // The name of the work team. Use this name to identify the work team. + // + // WorkteamName is a required field + WorkteamName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s CreateWorkteamInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateWorkteamInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateWorkteamInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateWorkteamInput"} + if s.Description == nil { + invalidParams.Add(request.NewErrParamRequired("Description")) + } + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 1)) + } + if s.MemberDefinitions == nil { + invalidParams.Add(request.NewErrParamRequired("MemberDefinitions")) + } + if s.MemberDefinitions != nil && len(s.MemberDefinitions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MemberDefinitions", 1)) + } + if s.WorkteamName == nil { + invalidParams.Add(request.NewErrParamRequired("WorkteamName")) + } + if s.WorkteamName != nil && len(*s.WorkteamName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("WorkteamName", 1)) + } + if s.MemberDefinitions != nil { + for i, v := range s.MemberDefinitions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MemberDefinitions", 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 +} + +// SetDescription sets the Description field's value. +func (s *CreateWorkteamInput) SetDescription(v string) *CreateWorkteamInput { + s.Description = &v + return s +} + +// SetMemberDefinitions sets the MemberDefinitions field's value. +func (s *CreateWorkteamInput) SetMemberDefinitions(v []*MemberDefinition) *CreateWorkteamInput { + s.MemberDefinitions = v + return s +} + +// SetNotificationConfiguration sets the NotificationConfiguration field's value. +func (s *CreateWorkteamInput) SetNotificationConfiguration(v *NotificationConfiguration) *CreateWorkteamInput { + s.NotificationConfiguration = v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateWorkteamInput) SetTags(v []*Tag) *CreateWorkteamInput { + s.Tags = v + return s +} + +// SetWorkteamName sets the WorkteamName field's value. +func (s *CreateWorkteamInput) SetWorkteamName(v string) *CreateWorkteamInput { + s.WorkteamName = &v + return s +} + +type CreateWorkteamOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the work team. You can use this ARN to + // identify the work team. + WorkteamArn *string `type:"string"` +} + +// String returns the string representation +func (s CreateWorkteamOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateWorkteamOutput) GoString() string { + return s.String() +} + +// SetWorkteamArn sets the WorkteamArn field's value. +func (s *CreateWorkteamOutput) SetWorkteamArn(v string) *CreateWorkteamOutput { + s.WorkteamArn = &v + return s +} + +type DataCaptureConfig struct { + _ struct{} `type:"structure"` + + CaptureContentTypeHeader *CaptureContentTypeHeader `type:"structure"` + + // CaptureOptions is a required field + CaptureOptions []*CaptureOption `min:"1" type:"list" required:"true"` + + // DestinationS3Uri is a required field + DestinationS3Uri *string `type:"string" required:"true"` + + EnableCapture *bool `type:"boolean"` + + // InitialSamplingPercentage is a required field + InitialSamplingPercentage *int64 `type:"integer" required:"true"` + + KmsKeyId *string `type:"string"` +} + +// String returns the string representation +func (s DataCaptureConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataCaptureConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DataCaptureConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DataCaptureConfig"} + if s.CaptureOptions == nil { + invalidParams.Add(request.NewErrParamRequired("CaptureOptions")) + } + if s.CaptureOptions != nil && len(s.CaptureOptions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CaptureOptions", 1)) + } + if s.DestinationS3Uri == nil { + invalidParams.Add(request.NewErrParamRequired("DestinationS3Uri")) + } + if s.InitialSamplingPercentage == nil { + invalidParams.Add(request.NewErrParamRequired("InitialSamplingPercentage")) + } + if s.CaptureContentTypeHeader != nil { + if err := s.CaptureContentTypeHeader.Validate(); err != nil { + invalidParams.AddNested("CaptureContentTypeHeader", err.(request.ErrInvalidParams)) + } + } + if s.CaptureOptions != nil { + for i, v := range s.CaptureOptions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CaptureOptions", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCaptureContentTypeHeader sets the CaptureContentTypeHeader field's value. +func (s *DataCaptureConfig) SetCaptureContentTypeHeader(v *CaptureContentTypeHeader) *DataCaptureConfig { + s.CaptureContentTypeHeader = v + return s +} + +// SetCaptureOptions sets the CaptureOptions field's value. +func (s *DataCaptureConfig) SetCaptureOptions(v []*CaptureOption) *DataCaptureConfig { + s.CaptureOptions = v + return s +} + +// SetDestinationS3Uri sets the DestinationS3Uri field's value. +func (s *DataCaptureConfig) SetDestinationS3Uri(v string) *DataCaptureConfig { + s.DestinationS3Uri = &v + return s +} + +// SetEnableCapture sets the EnableCapture field's value. +func (s *DataCaptureConfig) SetEnableCapture(v bool) *DataCaptureConfig { + s.EnableCapture = &v + return s +} + +// SetInitialSamplingPercentage sets the InitialSamplingPercentage field's value. +func (s *DataCaptureConfig) SetInitialSamplingPercentage(v int64) *DataCaptureConfig { + s.InitialSamplingPercentage = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *DataCaptureConfig) SetKmsKeyId(v string) *DataCaptureConfig { + s.KmsKeyId = &v + return s +} + +type DataCaptureConfigSummary struct { + _ struct{} `type:"structure"` + + // CaptureStatus is a required field + CaptureStatus *string `type:"string" required:"true" enum:"CaptureStatus"` + + // CurrentSamplingPercentage is a required field + CurrentSamplingPercentage *int64 `type:"integer" required:"true"` + + // DestinationS3Uri is a required field + DestinationS3Uri *string `type:"string" required:"true"` + + // EnableCapture is a required field + EnableCapture *bool `type:"boolean" required:"true"` + + // KmsKeyId is a required field + KmsKeyId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DataCaptureConfigSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataCaptureConfigSummary) GoString() string { + return s.String() +} + +// SetCaptureStatus sets the CaptureStatus field's value. +func (s *DataCaptureConfigSummary) SetCaptureStatus(v string) *DataCaptureConfigSummary { + s.CaptureStatus = &v + return s +} + +// SetCurrentSamplingPercentage sets the CurrentSamplingPercentage field's value. +func (s *DataCaptureConfigSummary) SetCurrentSamplingPercentage(v int64) *DataCaptureConfigSummary { + s.CurrentSamplingPercentage = &v + return s +} + +// SetDestinationS3Uri sets the DestinationS3Uri field's value. +func (s *DataCaptureConfigSummary) SetDestinationS3Uri(v string) *DataCaptureConfigSummary { + s.DestinationS3Uri = &v + return s +} + +// SetEnableCapture sets the EnableCapture field's value. +func (s *DataCaptureConfigSummary) SetEnableCapture(v bool) *DataCaptureConfigSummary { + s.EnableCapture = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *DataCaptureConfigSummary) SetKmsKeyId(v string) *DataCaptureConfigSummary { + s.KmsKeyId = &v + return s +} + +// The data structure used to specify the data to be used for inference in a +// batch transform job and to associate the data that is relevant to the prediction +// results in the output. The input filter provided allows you to exclude input +// data that is not needed for inference in a batch transform job. The output +// filter provided allows you to include input data relevant to interpreting +// the predictions in the output from the job. For more information, see Associate +// Prediction Results with their Corresponding Input Records (https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform-data-processing.html). +type DataProcessing struct { + _ struct{} `type:"structure"` + + // A JSONPath (https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform-data-processing.html#data-processing-operators) + // expression used to select a portion of the input data to pass to the algorithm. + // Use the InputFilter parameter to exclude fields, such as an ID column, from + // the input. If you want Amazon SageMaker to pass the entire input dataset + // to the algorithm, accept the default value $. + // + // Examples: "$", "$[1:]", "$.features" + InputFilter *string `type:"string"` + + // Specifies the source of the data to join with the transformed data. The valid + // values are None and Input. The default value is None, which specifies not + // to join the input with the transformed data. If you want the batch transform + // job to join the original input data with the transformed data, set JoinSource + // to Input. + // + // For JSON or JSONLines objects, such as a JSON array, Amazon SageMaker adds + // the transformed data to the input JSON object in an attribute called SageMakerOutput. + // The joined result for JSON must be a key-value pair object. If the input + // is not a key-value pair object, Amazon SageMaker creates a new JSON file. + // In the new JSON file, and the input data is stored under the SageMakerInput + // key and the results are stored in SageMakerOutput. + // + // For CSV files, Amazon SageMaker combines the transformed data with the input + // data at the end of the input data and stores it in the output file. The joined + // data has the joined input data followed by the transformed data and the output + // is a CSV file. + JoinSource *string `type:"string" enum:"JoinSource"` + + // A JSONPath (https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform-data-processing.html#data-processing-operators) + // expression used to select a portion of the joined dataset to save in the + // output file for a batch transform job. If you want Amazon SageMaker to store + // the entire input dataset in the output file, leave the default value, $. + // If you specify indexes that aren't within the dimension size of the joined + // dataset, you get an error. + // + // Examples: "$", "$[0,5:]", "$['id','SageMakerOutput']" + OutputFilter *string `type:"string"` +} + +// String returns the string representation +func (s DataProcessing) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DataProcessing) GoString() string { + return s.String() +} + +// SetInputFilter sets the InputFilter field's value. +func (s *DataProcessing) SetInputFilter(v string) *DataProcessing { + s.InputFilter = &v + return s +} + +// SetJoinSource sets the JoinSource field's value. +func (s *DataProcessing) SetJoinSource(v string) *DataProcessing { + s.JoinSource = &v + return s +} + +// SetOutputFilter sets the OutputFilter field's value. +func (s *DataProcessing) SetOutputFilter(v string) *DataProcessing { + s.OutputFilter = &v + return s +} + +// Describes the location of the channel data. +type DataSource struct { + _ struct{} `type:"structure"` + + // The file system that is associated with a channel. + FileSystemDataSource *FileSystemDataSource `type:"structure"` + + // The S3 location of the data source that is associated with a channel. + S3DataSource *S3DataSource `type:"structure"` +} + +// 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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DataSource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DataSource"} + if s.FileSystemDataSource != nil { + if err := s.FileSystemDataSource.Validate(); err != nil { + invalidParams.AddNested("FileSystemDataSource", err.(request.ErrInvalidParams)) + } + } + if s.S3DataSource != nil { + if err := s.S3DataSource.Validate(); err != nil { + invalidParams.AddNested("S3DataSource", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFileSystemDataSource sets the FileSystemDataSource field's value. +func (s *DataSource) SetFileSystemDataSource(v *FileSystemDataSource) *DataSource { + s.FileSystemDataSource = v + return s +} + +// SetS3DataSource sets the S3DataSource field's value. +func (s *DataSource) SetS3DataSource(v *S3DataSource) *DataSource { + s.S3DataSource = v + return s +} + +// Configuration information for the debug hook parameters, collection configuration, +// and storage paths. +type DebugHookConfig struct { + _ struct{} `type:"structure"` + + // Configuration information for tensor collections. + CollectionConfigurations []*CollectionConfiguration `type:"list"` + + // Configuration information for the debug hook parameters. + HookParameters map[string]*string `type:"map"` + + // Path to local storage location for tensors. Defaults to /opt/ml/output/tensors/. + LocalPath *string `type:"string"` + + // Path to Amazon S3 storage location for tensors. + // + // S3OutputPath is a required field + S3OutputPath *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DebugHookConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DebugHookConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DebugHookConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DebugHookConfig"} + if s.S3OutputPath == nil { + invalidParams.Add(request.NewErrParamRequired("S3OutputPath")) + } + if s.CollectionConfigurations != nil { + for i, v := range s.CollectionConfigurations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CollectionConfigurations", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCollectionConfigurations sets the CollectionConfigurations field's value. +func (s *DebugHookConfig) SetCollectionConfigurations(v []*CollectionConfiguration) *DebugHookConfig { + s.CollectionConfigurations = v + return s +} + +// SetHookParameters sets the HookParameters field's value. +func (s *DebugHookConfig) SetHookParameters(v map[string]*string) *DebugHookConfig { + s.HookParameters = v + return s +} + +// SetLocalPath sets the LocalPath field's value. +func (s *DebugHookConfig) SetLocalPath(v string) *DebugHookConfig { + s.LocalPath = &v + return s +} + +// SetS3OutputPath sets the S3OutputPath field's value. +func (s *DebugHookConfig) SetS3OutputPath(v string) *DebugHookConfig { + s.S3OutputPath = &v + return s +} + +// Configuration information for debugging rules. +type DebugRuleConfiguration struct { + _ struct{} `type:"structure"` + + // The instance type to deploy for a training job. + InstanceType *string `type:"string" enum:"ProcessingInstanceType"` + + // Path to local storage location for output of rules. Defaults to /opt/ml/processing/output/rule/. + LocalPath *string `type:"string"` + + // The name of the rule configuration. It must be unique relative to other rule + // configuration names. + // + // RuleConfigurationName is a required field + RuleConfigurationName *string `min:"1" type:"string" required:"true"` + + // The Amazon Elastic Container (ECR) Image for the managed rule evaluation. + // + // RuleEvaluatorImage is a required field + RuleEvaluatorImage *string `type:"string" required:"true"` + + // Runtime configuration for rule container. + RuleParameters map[string]*string `type:"map"` + + // Path to Amazon S3 storage location for rules. + S3OutputPath *string `type:"string"` + + // The size, in GB, of the ML storage volume attached to the processing instance. + VolumeSizeInGB *int64 `type:"integer"` +} + +// String returns the string representation +func (s DebugRuleConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DebugRuleConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DebugRuleConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DebugRuleConfiguration"} + if s.RuleConfigurationName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleConfigurationName")) + } + if s.RuleConfigurationName != nil && len(*s.RuleConfigurationName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleConfigurationName", 1)) + } + if s.RuleEvaluatorImage == nil { + invalidParams.Add(request.NewErrParamRequired("RuleEvaluatorImage")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetInstanceType sets the InstanceType field's value. +func (s *DebugRuleConfiguration) SetInstanceType(v string) *DebugRuleConfiguration { + s.InstanceType = &v + return s +} + +// SetLocalPath sets the LocalPath field's value. +func (s *DebugRuleConfiguration) SetLocalPath(v string) *DebugRuleConfiguration { + s.LocalPath = &v + return s +} + +// SetRuleConfigurationName sets the RuleConfigurationName field's value. +func (s *DebugRuleConfiguration) SetRuleConfigurationName(v string) *DebugRuleConfiguration { + s.RuleConfigurationName = &v + return s +} + +// SetRuleEvaluatorImage sets the RuleEvaluatorImage field's value. +func (s *DebugRuleConfiguration) SetRuleEvaluatorImage(v string) *DebugRuleConfiguration { + s.RuleEvaluatorImage = &v + return s +} + +// SetRuleParameters sets the RuleParameters field's value. +func (s *DebugRuleConfiguration) SetRuleParameters(v map[string]*string) *DebugRuleConfiguration { + s.RuleParameters = v + return s +} + +// SetS3OutputPath sets the S3OutputPath field's value. +func (s *DebugRuleConfiguration) SetS3OutputPath(v string) *DebugRuleConfiguration { + s.S3OutputPath = &v + return s +} + +// SetVolumeSizeInGB sets the VolumeSizeInGB field's value. +func (s *DebugRuleConfiguration) SetVolumeSizeInGB(v int64) *DebugRuleConfiguration { + s.VolumeSizeInGB = &v + return s +} + +// Information about the status of the rule evaluation. +type DebugRuleEvaluationStatus struct { + _ struct{} `type:"structure"` + + // Timestamp when the rule evaluation status was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The name of the rule configuration + RuleConfigurationName *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the rule evaluation job. + RuleEvaluationJobArn *string `type:"string"` + + // Status of the rule evaluation. + RuleEvaluationStatus *string `type:"string" enum:"RuleEvaluationStatus"` + + // Details from the rule evaluation. + StatusDetails *string `type:"string"` +} + +// String returns the string representation +func (s DebugRuleEvaluationStatus) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DebugRuleEvaluationStatus) GoString() string { + return s.String() +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DebugRuleEvaluationStatus) SetLastModifiedTime(v time.Time) *DebugRuleEvaluationStatus { + s.LastModifiedTime = &v + return s +} + +// SetRuleConfigurationName sets the RuleConfigurationName field's value. +func (s *DebugRuleEvaluationStatus) SetRuleConfigurationName(v string) *DebugRuleEvaluationStatus { + s.RuleConfigurationName = &v + return s +} + +// SetRuleEvaluationJobArn sets the RuleEvaluationJobArn field's value. +func (s *DebugRuleEvaluationStatus) SetRuleEvaluationJobArn(v string) *DebugRuleEvaluationStatus { + s.RuleEvaluationJobArn = &v + return s +} + +// SetRuleEvaluationStatus sets the RuleEvaluationStatus field's value. +func (s *DebugRuleEvaluationStatus) SetRuleEvaluationStatus(v string) *DebugRuleEvaluationStatus { + s.RuleEvaluationStatus = &v + return s +} + +// SetStatusDetails sets the StatusDetails field's value. +func (s *DebugRuleEvaluationStatus) SetStatusDetails(v string) *DebugRuleEvaluationStatus { + s.StatusDetails = &v + return s +} + +type DeleteAlgorithmInput struct { + _ struct{} `type:"structure"` + + // The name of the algorithm to delete. + // + // AlgorithmName is a required field + AlgorithmName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteAlgorithmInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAlgorithmInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteAlgorithmInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteAlgorithmInput"} + if s.AlgorithmName == nil { + invalidParams.Add(request.NewErrParamRequired("AlgorithmName")) + } + if s.AlgorithmName != nil && len(*s.AlgorithmName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AlgorithmName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAlgorithmName sets the AlgorithmName field's value. +func (s *DeleteAlgorithmInput) SetAlgorithmName(v string) *DeleteAlgorithmInput { + s.AlgorithmName = &v + return s +} + +type DeleteAlgorithmOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteAlgorithmOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAlgorithmOutput) GoString() string { + return s.String() +} + +type DeleteAppInput struct { + _ struct{} `type:"structure"` + + // The name of the app. + // + // AppName is a required field + AppName *string `type:"string" required:"true"` + + // The type of app. + // + // AppType is a required field + AppType *string `type:"string" required:"true" enum:"AppType"` + + // The domain ID. + // + // DomainId is a required field + DomainId *string `type:"string" required:"true"` + + // The user profile name. + // + // UserProfileName is a required field + UserProfileName *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.AppName == nil { + invalidParams.Add(request.NewErrParamRequired("AppName")) + } + if s.AppType == nil { + invalidParams.Add(request.NewErrParamRequired("AppType")) + } + if s.DomainId == nil { + invalidParams.Add(request.NewErrParamRequired("DomainId")) + } + if s.UserProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("UserProfileName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAppName sets the AppName field's value. +func (s *DeleteAppInput) SetAppName(v string) *DeleteAppInput { + s.AppName = &v + return s +} + +// SetAppType sets the AppType field's value. +func (s *DeleteAppInput) SetAppType(v string) *DeleteAppInput { + s.AppType = &v + return s +} + +// SetDomainId sets the DomainId field's value. +func (s *DeleteAppInput) SetDomainId(v string) *DeleteAppInput { + s.DomainId = &v + return s +} + +// SetUserProfileName sets the UserProfileName field's value. +func (s *DeleteAppInput) SetUserProfileName(v string) *DeleteAppInput { + s.UserProfileName = &v + return s +} + +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() +} + +type DeleteCodeRepositoryInput struct { + _ struct{} `type:"structure"` + + // The name of the Git repository to delete. + // + // CodeRepositoryName is a required field + CodeRepositoryName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteCodeRepositoryInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCodeRepositoryInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteCodeRepositoryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteCodeRepositoryInput"} + if s.CodeRepositoryName == nil { + invalidParams.Add(request.NewErrParamRequired("CodeRepositoryName")) + } + if s.CodeRepositoryName != nil && len(*s.CodeRepositoryName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CodeRepositoryName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCodeRepositoryName sets the CodeRepositoryName field's value. +func (s *DeleteCodeRepositoryInput) SetCodeRepositoryName(v string) *DeleteCodeRepositoryInput { + s.CodeRepositoryName = &v + return s +} + +type DeleteCodeRepositoryOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteCodeRepositoryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteCodeRepositoryOutput) GoString() string { + return s.String() +} + +type DeleteDomainInput struct { + _ struct{} `type:"structure"` + + // The domain ID. + // + // DomainId is a required field + DomainId *string `type:"string" required:"true"` + + // The retention policy for this domain, which specifies which resources will + // be retained after the Domain is deleted. By default, all resources are retained + // (not automatically deleted). + RetentionPolicy *RetentionPolicy `type:"structure"` +} + +// 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.DomainId == nil { + invalidParams.Add(request.NewErrParamRequired("DomainId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDomainId sets the DomainId field's value. +func (s *DeleteDomainInput) SetDomainId(v string) *DeleteDomainInput { + s.DomainId = &v + return s +} + +// SetRetentionPolicy sets the RetentionPolicy field's value. +func (s *DeleteDomainInput) SetRetentionPolicy(v *RetentionPolicy) *DeleteDomainInput { + s.RetentionPolicy = v + return s +} + +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() +} + +type DeleteEndpointConfigInput struct { + _ struct{} `type:"structure"` + + // The name of the endpoint configuration that you want to delete. + // + // EndpointConfigName is a required field + EndpointConfigName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteEndpointConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteEndpointConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteEndpointConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteEndpointConfigInput"} + if s.EndpointConfigName == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointConfigName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEndpointConfigName sets the EndpointConfigName field's value. +func (s *DeleteEndpointConfigInput) SetEndpointConfigName(v string) *DeleteEndpointConfigInput { + s.EndpointConfigName = &v + return s +} + +type DeleteEndpointConfigOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteEndpointConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteEndpointConfigOutput) GoString() string { + return s.String() +} + +type DeleteEndpointInput struct { + _ struct{} `type:"structure"` + + // The name of the endpoint that you want to delete. + // + // EndpointName is a required field + EndpointName *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.EndpointName == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEndpointName sets the EndpointName field's value. +func (s *DeleteEndpointInput) SetEndpointName(v string) *DeleteEndpointInput { + s.EndpointName = &v + return s +} + +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() +} + +type DeleteExperimentInput struct { + _ struct{} `type:"structure"` + + // The name of the experiment to delete. + // + // ExperimentName is a required field + ExperimentName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteExperimentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteExperimentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteExperimentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteExperimentInput"} + if s.ExperimentName == nil { + invalidParams.Add(request.NewErrParamRequired("ExperimentName")) + } + if s.ExperimentName != nil && len(*s.ExperimentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ExperimentName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetExperimentName sets the ExperimentName field's value. +func (s *DeleteExperimentInput) SetExperimentName(v string) *DeleteExperimentInput { + s.ExperimentName = &v + return s +} + +type DeleteExperimentOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the experiment that is being deleted. + ExperimentArn *string `type:"string"` +} + +// String returns the string representation +func (s DeleteExperimentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteExperimentOutput) GoString() string { + return s.String() +} + +// SetExperimentArn sets the ExperimentArn field's value. +func (s *DeleteExperimentOutput) SetExperimentArn(v string) *DeleteExperimentOutput { + s.ExperimentArn = &v + return s +} + +type DeleteFlowDefinitionInput struct { + _ struct{} `type:"structure"` + + // The name of the flow definition you are deleting. + // + // FlowDefinitionName is a required field + FlowDefinitionName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteFlowDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFlowDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteFlowDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteFlowDefinitionInput"} + if s.FlowDefinitionName == nil { + invalidParams.Add(request.NewErrParamRequired("FlowDefinitionName")) + } + if s.FlowDefinitionName != nil && len(*s.FlowDefinitionName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FlowDefinitionName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFlowDefinitionName sets the FlowDefinitionName field's value. +func (s *DeleteFlowDefinitionInput) SetFlowDefinitionName(v string) *DeleteFlowDefinitionInput { + s.FlowDefinitionName = &v + return s +} + +type DeleteFlowDefinitionOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteFlowDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteFlowDefinitionOutput) GoString() string { + return s.String() +} + +type DeleteModelInput struct { + _ struct{} `type:"structure"` + + // The name of the model to delete. + // + // ModelName is a required field + ModelName *string `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 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 +} + +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() +} + +type DeleteModelPackageInput struct { + _ struct{} `type:"structure"` + + // The name of the model package. The name must have 1 to 63 characters. Valid + // characters are a-z, A-Z, 0-9, and - (hyphen). + // + // ModelPackageName is a required field + ModelPackageName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteModelPackageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteModelPackageInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteModelPackageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteModelPackageInput"} + if s.ModelPackageName == nil { + invalidParams.Add(request.NewErrParamRequired("ModelPackageName")) + } + if s.ModelPackageName != nil && len(*s.ModelPackageName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ModelPackageName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetModelPackageName sets the ModelPackageName field's value. +func (s *DeleteModelPackageInput) SetModelPackageName(v string) *DeleteModelPackageInput { + s.ModelPackageName = &v + return s +} + +type DeleteModelPackageOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteModelPackageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteModelPackageOutput) GoString() string { + return s.String() +} + +type DeleteMonitoringScheduleInput struct { + _ struct{} `type:"structure"` + + // The name of the monitoring schedule to delete. + // + // MonitoringScheduleName is a required field + MonitoringScheduleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteMonitoringScheduleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMonitoringScheduleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteMonitoringScheduleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteMonitoringScheduleInput"} + if s.MonitoringScheduleName == nil { + invalidParams.Add(request.NewErrParamRequired("MonitoringScheduleName")) + } + if s.MonitoringScheduleName != nil && len(*s.MonitoringScheduleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MonitoringScheduleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMonitoringScheduleName sets the MonitoringScheduleName field's value. +func (s *DeleteMonitoringScheduleInput) SetMonitoringScheduleName(v string) *DeleteMonitoringScheduleInput { + s.MonitoringScheduleName = &v + return s +} + +type DeleteMonitoringScheduleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteMonitoringScheduleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMonitoringScheduleOutput) GoString() string { + return s.String() +} + +type DeleteNotebookInstanceInput struct { + _ struct{} `type:"structure"` + + // The name of the Amazon SageMaker notebook instance to delete. + // + // NotebookInstanceName is a required field + NotebookInstanceName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteNotebookInstanceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNotebookInstanceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteNotebookInstanceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteNotebookInstanceInput"} + if s.NotebookInstanceName == nil { + invalidParams.Add(request.NewErrParamRequired("NotebookInstanceName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNotebookInstanceName sets the NotebookInstanceName field's value. +func (s *DeleteNotebookInstanceInput) SetNotebookInstanceName(v string) *DeleteNotebookInstanceInput { + s.NotebookInstanceName = &v + return s +} + +type DeleteNotebookInstanceLifecycleConfigInput struct { + _ struct{} `type:"structure"` + + // The name of the lifecycle configuration to delete. + // + // NotebookInstanceLifecycleConfigName is a required field + NotebookInstanceLifecycleConfigName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteNotebookInstanceLifecycleConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNotebookInstanceLifecycleConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteNotebookInstanceLifecycleConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteNotebookInstanceLifecycleConfigInput"} + if s.NotebookInstanceLifecycleConfigName == nil { + invalidParams.Add(request.NewErrParamRequired("NotebookInstanceLifecycleConfigName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNotebookInstanceLifecycleConfigName sets the NotebookInstanceLifecycleConfigName field's value. +func (s *DeleteNotebookInstanceLifecycleConfigInput) SetNotebookInstanceLifecycleConfigName(v string) *DeleteNotebookInstanceLifecycleConfigInput { + s.NotebookInstanceLifecycleConfigName = &v + return s +} + +type DeleteNotebookInstanceLifecycleConfigOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteNotebookInstanceLifecycleConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNotebookInstanceLifecycleConfigOutput) GoString() string { + return s.String() +} + +type DeleteNotebookInstanceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteNotebookInstanceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteNotebookInstanceOutput) GoString() string { + return s.String() +} + +type DeleteTagsInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource whose tags you want to delete. + // + // ResourceArn is a required field + ResourceArn *string `type:"string" required:"true"` + + // An array or one or more tag keys to delete. + // + // TagKeys is a required field + TagKeys []*string `min:"1" 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.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) + } + 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 +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *DeleteTagsInput) SetResourceArn(v string) *DeleteTagsInput { + s.ResourceArn = &v + return s +} + +// SetTagKeys sets the TagKeys field's value. +func (s *DeleteTagsInput) SetTagKeys(v []*string) *DeleteTagsInput { + s.TagKeys = v + return s +} + +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() +} + +type DeleteTrialComponentInput struct { + _ struct{} `type:"structure"` + + // The name of the component to delete. + // + // TrialComponentName is a required field + TrialComponentName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteTrialComponentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTrialComponentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteTrialComponentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTrialComponentInput"} + if s.TrialComponentName == nil { + invalidParams.Add(request.NewErrParamRequired("TrialComponentName")) + } + if s.TrialComponentName != nil && len(*s.TrialComponentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialComponentName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTrialComponentName sets the TrialComponentName field's value. +func (s *DeleteTrialComponentInput) SetTrialComponentName(v string) *DeleteTrialComponentInput { + s.TrialComponentName = &v + return s +} + +type DeleteTrialComponentOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the component is being deleted. + TrialComponentArn *string `type:"string"` +} + +// String returns the string representation +func (s DeleteTrialComponentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTrialComponentOutput) GoString() string { + return s.String() +} + +// SetTrialComponentArn sets the TrialComponentArn field's value. +func (s *DeleteTrialComponentOutput) SetTrialComponentArn(v string) *DeleteTrialComponentOutput { + s.TrialComponentArn = &v + return s +} + +type DeleteTrialInput struct { + _ struct{} `type:"structure"` + + // The name of the trial to delete. + // + // TrialName is a required field + TrialName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteTrialInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTrialInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteTrialInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTrialInput"} + if s.TrialName == nil { + invalidParams.Add(request.NewErrParamRequired("TrialName")) + } + if s.TrialName != nil && len(*s.TrialName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTrialName sets the TrialName field's value. +func (s *DeleteTrialInput) SetTrialName(v string) *DeleteTrialInput { + s.TrialName = &v + return s +} + +type DeleteTrialOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the trial that is being deleted. + TrialArn *string `type:"string"` +} + +// String returns the string representation +func (s DeleteTrialOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteTrialOutput) GoString() string { + return s.String() +} + +// SetTrialArn sets the TrialArn field's value. +func (s *DeleteTrialOutput) SetTrialArn(v string) *DeleteTrialOutput { + s.TrialArn = &v + return s +} + +type DeleteUserProfileInput struct { + _ struct{} `type:"structure"` + + // The domain ID. + // + // DomainId is a required field + DomainId *string `type:"string" required:"true"` + + // The user profile name. + // + // UserProfileName is a required field + UserProfileName *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.DomainId == nil { + invalidParams.Add(request.NewErrParamRequired("DomainId")) + } + if s.UserProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("UserProfileName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDomainId sets the DomainId field's value. +func (s *DeleteUserProfileInput) SetDomainId(v string) *DeleteUserProfileInput { + s.DomainId = &v + return s +} + +// SetUserProfileName sets the UserProfileName field's value. +func (s *DeleteUserProfileInput) SetUserProfileName(v string) *DeleteUserProfileInput { + s.UserProfileName = &v + return s +} + +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() +} + +type DeleteWorkteamInput struct { + _ struct{} `type:"structure"` + + // The name of the work team to delete. + // + // WorkteamName is a required field + WorkteamName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteWorkteamInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteWorkteamInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteWorkteamInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteWorkteamInput"} + if s.WorkteamName == nil { + invalidParams.Add(request.NewErrParamRequired("WorkteamName")) + } + if s.WorkteamName != nil && len(*s.WorkteamName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("WorkteamName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetWorkteamName sets the WorkteamName field's value. +func (s *DeleteWorkteamInput) SetWorkteamName(v string) *DeleteWorkteamInput { + s.WorkteamName = &v + return s +} + +type DeleteWorkteamOutput struct { + _ struct{} `type:"structure"` + + // Returns true if the work team was successfully deleted; otherwise, returns + // false. + // + // Success is a required field + Success *bool `type:"boolean" required:"true"` +} + +// String returns the string representation +func (s DeleteWorkteamOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteWorkteamOutput) GoString() string { + return s.String() +} + +// SetSuccess sets the Success field's value. +func (s *DeleteWorkteamOutput) SetSuccess(v bool) *DeleteWorkteamOutput { + s.Success = &v + return s +} + +// Gets the Amazon EC2 Container Registry path of the docker image of the model +// that is hosted in this ProductionVariant. +// +// If you used the registry/repository[:tag] form to specify the image path +// of the primary container when you created the model hosted in this ProductionVariant, +// the path resolves to a path of the form registry/repository[@digest]. A digest +// is a hash value that identifies a specific version of an image. For information +// about Amazon ECR paths, see Pulling an Image (https://docs.aws.amazon.com/AmazonECR/latest/userguide/docker-pull-ecr-image.html) +// in the Amazon ECR User Guide. +type DeployedImage struct { + _ struct{} `type:"structure"` + + // The date and time when the image path for the model resolved to the ResolvedImage + ResolutionTime *time.Time `type:"timestamp"` + + // The specific digest path of the image hosted in this ProductionVariant. + ResolvedImage *string `type:"string"` + + // The image path you specified when you created the model. + SpecifiedImage *string `type:"string"` +} + +// String returns the string representation +func (s DeployedImage) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeployedImage) GoString() string { + return s.String() +} + +// SetResolutionTime sets the ResolutionTime field's value. +func (s *DeployedImage) SetResolutionTime(v time.Time) *DeployedImage { + s.ResolutionTime = &v + return s +} + +// SetResolvedImage sets the ResolvedImage field's value. +func (s *DeployedImage) SetResolvedImage(v string) *DeployedImage { + s.ResolvedImage = &v + return s +} + +// SetSpecifiedImage sets the SpecifiedImage field's value. +func (s *DeployedImage) SetSpecifiedImage(v string) *DeployedImage { + s.SpecifiedImage = &v + return s +} + +type DescribeAlgorithmInput struct { + _ struct{} `type:"structure"` + + // The name of the algorithm to describe. + // + // AlgorithmName is a required field + AlgorithmName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeAlgorithmInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAlgorithmInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeAlgorithmInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeAlgorithmInput"} + if s.AlgorithmName == nil { + invalidParams.Add(request.NewErrParamRequired("AlgorithmName")) + } + if s.AlgorithmName != nil && len(*s.AlgorithmName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AlgorithmName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAlgorithmName sets the AlgorithmName field's value. +func (s *DescribeAlgorithmInput) SetAlgorithmName(v string) *DescribeAlgorithmInput { + s.AlgorithmName = &v + return s +} + +type DescribeAlgorithmOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the algorithm. + // + // AlgorithmArn is a required field + AlgorithmArn *string `min:"1" type:"string" required:"true"` + + // A brief summary about the algorithm. + AlgorithmDescription *string `type:"string"` + + // The name of the algorithm being described. + // + // AlgorithmName is a required field + AlgorithmName *string `min:"1" type:"string" required:"true"` + + // The current status of the algorithm. + // + // AlgorithmStatus is a required field + AlgorithmStatus *string `type:"string" required:"true" enum:"AlgorithmStatus"` + + // Details about the current status of the algorithm. + // + // AlgorithmStatusDetails is a required field + AlgorithmStatusDetails *AlgorithmStatusDetails `type:"structure" required:"true"` + + // Whether the algorithm is certified to be listed in AWS Marketplace. + CertifyForMarketplace *bool `type:"boolean"` + + // A timestamp specifying when the algorithm was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // Details about inference jobs that the algorithm runs. + InferenceSpecification *InferenceSpecification `type:"structure"` + + // The product identifier of the algorithm. + ProductId *string `type:"string"` + + // Details about training jobs run by this algorithm. + // + // TrainingSpecification is a required field + TrainingSpecification *TrainingSpecification `type:"structure" required:"true"` + + // Details about configurations for one or more training jobs that Amazon SageMaker + // runs to test the algorithm. + ValidationSpecification *AlgorithmValidationSpecification `type:"structure"` +} + +// String returns the string representation +func (s DescribeAlgorithmOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAlgorithmOutput) GoString() string { + return s.String() +} + +// SetAlgorithmArn sets the AlgorithmArn field's value. +func (s *DescribeAlgorithmOutput) SetAlgorithmArn(v string) *DescribeAlgorithmOutput { + s.AlgorithmArn = &v + return s +} + +// SetAlgorithmDescription sets the AlgorithmDescription field's value. +func (s *DescribeAlgorithmOutput) SetAlgorithmDescription(v string) *DescribeAlgorithmOutput { + s.AlgorithmDescription = &v + return s +} + +// SetAlgorithmName sets the AlgorithmName field's value. +func (s *DescribeAlgorithmOutput) SetAlgorithmName(v string) *DescribeAlgorithmOutput { + s.AlgorithmName = &v + return s +} + +// SetAlgorithmStatus sets the AlgorithmStatus field's value. +func (s *DescribeAlgorithmOutput) SetAlgorithmStatus(v string) *DescribeAlgorithmOutput { + s.AlgorithmStatus = &v + return s +} + +// SetAlgorithmStatusDetails sets the AlgorithmStatusDetails field's value. +func (s *DescribeAlgorithmOutput) SetAlgorithmStatusDetails(v *AlgorithmStatusDetails) *DescribeAlgorithmOutput { + s.AlgorithmStatusDetails = v + return s +} + +// SetCertifyForMarketplace sets the CertifyForMarketplace field's value. +func (s *DescribeAlgorithmOutput) SetCertifyForMarketplace(v bool) *DescribeAlgorithmOutput { + s.CertifyForMarketplace = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeAlgorithmOutput) SetCreationTime(v time.Time) *DescribeAlgorithmOutput { + s.CreationTime = &v + return s +} + +// SetInferenceSpecification sets the InferenceSpecification field's value. +func (s *DescribeAlgorithmOutput) SetInferenceSpecification(v *InferenceSpecification) *DescribeAlgorithmOutput { + s.InferenceSpecification = v + return s +} + +// SetProductId sets the ProductId field's value. +func (s *DescribeAlgorithmOutput) SetProductId(v string) *DescribeAlgorithmOutput { + s.ProductId = &v + return s +} + +// SetTrainingSpecification sets the TrainingSpecification field's value. +func (s *DescribeAlgorithmOutput) SetTrainingSpecification(v *TrainingSpecification) *DescribeAlgorithmOutput { + s.TrainingSpecification = v + return s +} + +// SetValidationSpecification sets the ValidationSpecification field's value. +func (s *DescribeAlgorithmOutput) SetValidationSpecification(v *AlgorithmValidationSpecification) *DescribeAlgorithmOutput { + s.ValidationSpecification = v + return s +} + +type DescribeAppInput struct { + _ struct{} `type:"structure"` + + // The name of the app. + // + // AppName is a required field + AppName *string `type:"string" required:"true"` + + // The type of app. + // + // AppType is a required field + AppType *string `type:"string" required:"true" enum:"AppType"` + + // The domain ID. + // + // DomainId is a required field + DomainId *string `type:"string" required:"true"` + + // The user profile name. + // + // UserProfileName is a required field + UserProfileName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeAppInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAppInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeAppInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeAppInput"} + if s.AppName == nil { + invalidParams.Add(request.NewErrParamRequired("AppName")) + } + if s.AppType == nil { + invalidParams.Add(request.NewErrParamRequired("AppType")) + } + if s.DomainId == nil { + invalidParams.Add(request.NewErrParamRequired("DomainId")) + } + if s.UserProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("UserProfileName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAppName sets the AppName field's value. +func (s *DescribeAppInput) SetAppName(v string) *DescribeAppInput { + s.AppName = &v + return s +} + +// SetAppType sets the AppType field's value. +func (s *DescribeAppInput) SetAppType(v string) *DescribeAppInput { + s.AppType = &v + return s +} + +// SetDomainId sets the DomainId field's value. +func (s *DescribeAppInput) SetDomainId(v string) *DescribeAppInput { + s.DomainId = &v + return s +} + +// SetUserProfileName sets the UserProfileName field's value. +func (s *DescribeAppInput) SetUserProfileName(v string) *DescribeAppInput { + s.UserProfileName = &v + return s +} + +type DescribeAppOutput struct { + _ struct{} `type:"structure"` + + // The app's Amazon Resource Name (ARN). + AppArn *string `type:"string"` + + // The name of the app. + AppName *string `type:"string"` + + // The type of app. + AppType *string `type:"string" enum:"AppType"` + + // The creation time. + CreationTime *time.Time `type:"timestamp"` + + // The domain ID. + DomainId *string `type:"string"` + + // The failure reason. + FailureReason *string `type:"string"` + + // The timestamp of the last health check. + LastHealthCheckTimestamp *time.Time `type:"timestamp"` + + // The timestamp of the last user's activity. + LastUserActivityTimestamp *time.Time `type:"timestamp"` + + // The instance type and quantity. + ResourceSpec *ResourceSpec `type:"structure"` + + // The status. + Status *string `type:"string" enum:"AppStatus"` + + // The user profile name. + UserProfileName *string `type:"string"` +} + +// String returns the string representation +func (s DescribeAppOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAppOutput) GoString() string { + return s.String() +} + +// SetAppArn sets the AppArn field's value. +func (s *DescribeAppOutput) SetAppArn(v string) *DescribeAppOutput { + s.AppArn = &v + return s +} + +// SetAppName sets the AppName field's value. +func (s *DescribeAppOutput) SetAppName(v string) *DescribeAppOutput { + s.AppName = &v + return s +} + +// SetAppType sets the AppType field's value. +func (s *DescribeAppOutput) SetAppType(v string) *DescribeAppOutput { + s.AppType = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeAppOutput) SetCreationTime(v time.Time) *DescribeAppOutput { + s.CreationTime = &v + return s +} + +// SetDomainId sets the DomainId field's value. +func (s *DescribeAppOutput) SetDomainId(v string) *DescribeAppOutput { + s.DomainId = &v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *DescribeAppOutput) SetFailureReason(v string) *DescribeAppOutput { + s.FailureReason = &v + return s +} + +// SetLastHealthCheckTimestamp sets the LastHealthCheckTimestamp field's value. +func (s *DescribeAppOutput) SetLastHealthCheckTimestamp(v time.Time) *DescribeAppOutput { + s.LastHealthCheckTimestamp = &v + return s +} + +// SetLastUserActivityTimestamp sets the LastUserActivityTimestamp field's value. +func (s *DescribeAppOutput) SetLastUserActivityTimestamp(v time.Time) *DescribeAppOutput { + s.LastUserActivityTimestamp = &v + return s +} + +// SetResourceSpec sets the ResourceSpec field's value. +func (s *DescribeAppOutput) SetResourceSpec(v *ResourceSpec) *DescribeAppOutput { + s.ResourceSpec = v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeAppOutput) SetStatus(v string) *DescribeAppOutput { + s.Status = &v + return s +} + +// SetUserProfileName sets the UserProfileName field's value. +func (s *DescribeAppOutput) SetUserProfileName(v string) *DescribeAppOutput { + s.UserProfileName = &v + return s +} + +type DescribeAutoMLJobInput struct { + _ struct{} `type:"structure"` + + // Request information about a job using that job's unique name. + // + // AutoMLJobName is a required field + AutoMLJobName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeAutoMLJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAutoMLJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeAutoMLJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeAutoMLJobInput"} + if s.AutoMLJobName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoMLJobName")) + } + if s.AutoMLJobName != nil && len(*s.AutoMLJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoMLJobName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAutoMLJobName sets the AutoMLJobName field's value. +func (s *DescribeAutoMLJobInput) SetAutoMLJobName(v string) *DescribeAutoMLJobInput { + s.AutoMLJobName = &v + return s +} + +type DescribeAutoMLJobOutput struct { + _ struct{} `type:"structure"` + + // Returns the job's ARN. + // + // AutoMLJobArn is a required field + AutoMLJobArn *string `min:"1" type:"string" required:"true"` + + // Returns information on the job's artifacts found in AutoMLJobArtifacts. + AutoMLJobArtifacts *AutoMLJobArtifacts `type:"structure"` + + // Returns the job's config. + AutoMLJobConfig *AutoMLJobConfig `type:"structure"` + + // Returns the name of a job. + // + // AutoMLJobName is a required field + AutoMLJobName *string `min:"1" type:"string" required:"true"` + + // Returns the job's objective. + AutoMLJobObjective *AutoMLJobObjective `type:"structure"` + + // Returns the job's AutoMLJobSecondaryStatus. + // + // AutoMLJobSecondaryStatus is a required field + AutoMLJobSecondaryStatus *string `type:"string" required:"true" enum:"AutoMLJobSecondaryStatus"` + + // Returns the job's AutoMLJobStatus. + // + // AutoMLJobStatus is a required field + AutoMLJobStatus *string `type:"string" required:"true" enum:"AutoMLJobStatus"` + + // Returns the job's BestCandidate. + BestCandidate *AutoMLCandidate `type:"structure"` + + // Returns the job's creation time. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // Returns the job's end time. + EndTime *time.Time `type:"timestamp"` + + // Returns the job's FailureReason. + FailureReason *string `type:"string"` + + // Returns the job's output from GenerateCandidateDefinitionsOnly. + GenerateCandidateDefinitionsOnly *bool `type:"boolean"` + + // Returns the job's input data config. + // + // InputDataConfig is a required field + InputDataConfig []*AutoMLChannel `min:"1" type:"list" required:"true"` + + // Returns the job's last modified time. + // + // LastModifiedTime is a required field + LastModifiedTime *time.Time `type:"timestamp" required:"true"` + + // Returns the job's output data config. + // + // OutputDataConfig is a required field + OutputDataConfig *AutoMLOutputDataConfig `type:"structure" required:"true"` + + // Returns the job's problem type. + ProblemType *string `type:"string" enum:"ProblemType"` + + // This contains ProblemType, AutoMLJobObjective and CompletionCriteria. They're + // auto-inferred values, if not provided by you. If you do provide them, then + // they'll be the same as provided. + ResolvedAttributes *ResolvedAttributes `type:"structure"` + + // The Amazon Resource Name (ARN) of the AWS Identity and Access Management + // (IAM) role that has read permission to the input data location and write + // permission to the output data location in Amazon S3. + // + // RoleArn is a required field + RoleArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeAutoMLJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAutoMLJobOutput) GoString() string { + return s.String() +} + +// SetAutoMLJobArn sets the AutoMLJobArn field's value. +func (s *DescribeAutoMLJobOutput) SetAutoMLJobArn(v string) *DescribeAutoMLJobOutput { + s.AutoMLJobArn = &v + return s +} + +// SetAutoMLJobArtifacts sets the AutoMLJobArtifacts field's value. +func (s *DescribeAutoMLJobOutput) SetAutoMLJobArtifacts(v *AutoMLJobArtifacts) *DescribeAutoMLJobOutput { + s.AutoMLJobArtifacts = v + return s +} + +// SetAutoMLJobConfig sets the AutoMLJobConfig field's value. +func (s *DescribeAutoMLJobOutput) SetAutoMLJobConfig(v *AutoMLJobConfig) *DescribeAutoMLJobOutput { + s.AutoMLJobConfig = v + return s +} + +// SetAutoMLJobName sets the AutoMLJobName field's value. +func (s *DescribeAutoMLJobOutput) SetAutoMLJobName(v string) *DescribeAutoMLJobOutput { + s.AutoMLJobName = &v + return s +} + +// SetAutoMLJobObjective sets the AutoMLJobObjective field's value. +func (s *DescribeAutoMLJobOutput) SetAutoMLJobObjective(v *AutoMLJobObjective) *DescribeAutoMLJobOutput { + s.AutoMLJobObjective = v + return s +} + +// SetAutoMLJobSecondaryStatus sets the AutoMLJobSecondaryStatus field's value. +func (s *DescribeAutoMLJobOutput) SetAutoMLJobSecondaryStatus(v string) *DescribeAutoMLJobOutput { + s.AutoMLJobSecondaryStatus = &v + return s +} + +// SetAutoMLJobStatus sets the AutoMLJobStatus field's value. +func (s *DescribeAutoMLJobOutput) SetAutoMLJobStatus(v string) *DescribeAutoMLJobOutput { + s.AutoMLJobStatus = &v + return s +} + +// SetBestCandidate sets the BestCandidate field's value. +func (s *DescribeAutoMLJobOutput) SetBestCandidate(v *AutoMLCandidate) *DescribeAutoMLJobOutput { + s.BestCandidate = v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeAutoMLJobOutput) SetCreationTime(v time.Time) *DescribeAutoMLJobOutput { + s.CreationTime = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *DescribeAutoMLJobOutput) SetEndTime(v time.Time) *DescribeAutoMLJobOutput { + s.EndTime = &v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *DescribeAutoMLJobOutput) SetFailureReason(v string) *DescribeAutoMLJobOutput { + s.FailureReason = &v + return s +} + +// SetGenerateCandidateDefinitionsOnly sets the GenerateCandidateDefinitionsOnly field's value. +func (s *DescribeAutoMLJobOutput) SetGenerateCandidateDefinitionsOnly(v bool) *DescribeAutoMLJobOutput { + s.GenerateCandidateDefinitionsOnly = &v + return s +} + +// SetInputDataConfig sets the InputDataConfig field's value. +func (s *DescribeAutoMLJobOutput) SetInputDataConfig(v []*AutoMLChannel) *DescribeAutoMLJobOutput { + s.InputDataConfig = v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeAutoMLJobOutput) SetLastModifiedTime(v time.Time) *DescribeAutoMLJobOutput { + s.LastModifiedTime = &v + return s +} + +// SetOutputDataConfig sets the OutputDataConfig field's value. +func (s *DescribeAutoMLJobOutput) SetOutputDataConfig(v *AutoMLOutputDataConfig) *DescribeAutoMLJobOutput { + s.OutputDataConfig = v + return s +} + +// SetProblemType sets the ProblemType field's value. +func (s *DescribeAutoMLJobOutput) SetProblemType(v string) *DescribeAutoMLJobOutput { + s.ProblemType = &v + return s +} + +// SetResolvedAttributes sets the ResolvedAttributes field's value. +func (s *DescribeAutoMLJobOutput) SetResolvedAttributes(v *ResolvedAttributes) *DescribeAutoMLJobOutput { + s.ResolvedAttributes = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *DescribeAutoMLJobOutput) SetRoleArn(v string) *DescribeAutoMLJobOutput { + s.RoleArn = &v + return s +} + +type DescribeCodeRepositoryInput struct { + _ struct{} `type:"structure"` + + // The name of the Git repository to describe. + // + // CodeRepositoryName is a required field + CodeRepositoryName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeCodeRepositoryInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCodeRepositoryInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeCodeRepositoryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeCodeRepositoryInput"} + if s.CodeRepositoryName == nil { + invalidParams.Add(request.NewErrParamRequired("CodeRepositoryName")) + } + if s.CodeRepositoryName != nil && len(*s.CodeRepositoryName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CodeRepositoryName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCodeRepositoryName sets the CodeRepositoryName field's value. +func (s *DescribeCodeRepositoryInput) SetCodeRepositoryName(v string) *DescribeCodeRepositoryInput { + s.CodeRepositoryName = &v + return s +} + +type DescribeCodeRepositoryOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the Git repository. + // + // CodeRepositoryArn is a required field + CodeRepositoryArn *string `min:"1" type:"string" required:"true"` + + // The name of the Git repository. + // + // CodeRepositoryName is a required field + CodeRepositoryName *string `min:"1" type:"string" required:"true"` + + // The date and time that the repository was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // Configuration details about the repository, including the URL where the repository + // is located, the default branch, and the Amazon Resource Name (ARN) of the + // AWS Secrets Manager secret that contains the credentials used to access the + // repository. + GitConfig *GitConfig `type:"structure"` + + // The date and time that the repository was last changed. + // + // LastModifiedTime is a required field + LastModifiedTime *time.Time `type:"timestamp" required:"true"` +} + +// String returns the string representation +func (s DescribeCodeRepositoryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCodeRepositoryOutput) GoString() string { + return s.String() +} + +// SetCodeRepositoryArn sets the CodeRepositoryArn field's value. +func (s *DescribeCodeRepositoryOutput) SetCodeRepositoryArn(v string) *DescribeCodeRepositoryOutput { + s.CodeRepositoryArn = &v + return s +} + +// SetCodeRepositoryName sets the CodeRepositoryName field's value. +func (s *DescribeCodeRepositoryOutput) SetCodeRepositoryName(v string) *DescribeCodeRepositoryOutput { + s.CodeRepositoryName = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeCodeRepositoryOutput) SetCreationTime(v time.Time) *DescribeCodeRepositoryOutput { + s.CreationTime = &v + return s +} + +// SetGitConfig sets the GitConfig field's value. +func (s *DescribeCodeRepositoryOutput) SetGitConfig(v *GitConfig) *DescribeCodeRepositoryOutput { + s.GitConfig = v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeCodeRepositoryOutput) SetLastModifiedTime(v time.Time) *DescribeCodeRepositoryOutput { + s.LastModifiedTime = &v + return s +} + +type DescribeCompilationJobInput struct { + _ struct{} `type:"structure"` + + // The name of the model compilation job that you want information about. + // + // CompilationJobName is a required field + CompilationJobName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeCompilationJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCompilationJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeCompilationJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeCompilationJobInput"} + if s.CompilationJobName == nil { + invalidParams.Add(request.NewErrParamRequired("CompilationJobName")) + } + if s.CompilationJobName != nil && len(*s.CompilationJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CompilationJobName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCompilationJobName sets the CompilationJobName field's value. +func (s *DescribeCompilationJobInput) SetCompilationJobName(v string) *DescribeCompilationJobInput { + s.CompilationJobName = &v + return s +} + +type DescribeCompilationJobOutput struct { + _ struct{} `type:"structure"` + + // The time when the model compilation job on a compilation job instance ended. + // For a successful or stopped job, this is when the job's model artifacts have + // finished uploading. For a failed job, this is when Amazon SageMaker detected + // that the job failed. + CompilationEndTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker assumes + // to perform the model compilation job. + // + // CompilationJobArn is a required field + CompilationJobArn *string `type:"string" required:"true"` + + // The name of the model compilation job. + // + // CompilationJobName is a required field + CompilationJobName *string `min:"1" type:"string" required:"true"` + + // The status of the model compilation job. + // + // CompilationJobStatus is a required field + CompilationJobStatus *string `type:"string" required:"true" enum:"CompilationJobStatus"` + + // The time when the model compilation job started the CompilationJob instances. + // + // You are billed for the time between this timestamp and the timestamp in the + // DescribeCompilationJobResponse$CompilationEndTime field. In Amazon CloudWatch + // Logs, the start time might be later than this time. That's because it takes + // time to download the compilation job, which depends on the size of the compilation + // job container. + CompilationStartTime *time.Time `type:"timestamp"` + + // The time that the model compilation job was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // If a model compilation job failed, the reason it failed. + // + // FailureReason is a required field + FailureReason *string `type:"string" required:"true"` + + // Information about the location in Amazon S3 of the input model artifacts, + // the name and shape of the expected data inputs, and the framework in which + // the model was trained. + // + // InputConfig is a required field + InputConfig *InputConfig `type:"structure" required:"true"` + + // The time that the status of the model compilation job was last modified. + // + // LastModifiedTime is a required field + LastModifiedTime *time.Time `type:"timestamp" required:"true"` + + // Information about the location in Amazon S3 that has been configured for + // storing the model artifacts used in the compilation job. + // + // ModelArtifacts is a required field + ModelArtifacts *ModelArtifacts `type:"structure" required:"true"` + + // Information about the output location for the compiled model and the target + // device that the model runs on. + // + // OutputConfig is a required field + OutputConfig *OutputConfig `type:"structure" required:"true"` + + // The Amazon Resource Name (ARN) of the model compilation job. + // + // RoleArn is a required field + RoleArn *string `min:"20" type:"string" required:"true"` + + // Specifies a limit to how long a model compilation job can run. When the job + // reaches the time limit, Amazon SageMaker ends the compilation job. Use this + // API to cap model training costs. + // + // StoppingCondition is a required field + StoppingCondition *StoppingCondition `type:"structure" required:"true"` +} + +// String returns the string representation +func (s DescribeCompilationJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeCompilationJobOutput) GoString() string { + return s.String() +} + +// SetCompilationEndTime sets the CompilationEndTime field's value. +func (s *DescribeCompilationJobOutput) SetCompilationEndTime(v time.Time) *DescribeCompilationJobOutput { + s.CompilationEndTime = &v + return s +} + +// SetCompilationJobArn sets the CompilationJobArn field's value. +func (s *DescribeCompilationJobOutput) SetCompilationJobArn(v string) *DescribeCompilationJobOutput { + s.CompilationJobArn = &v + return s +} + +// SetCompilationJobName sets the CompilationJobName field's value. +func (s *DescribeCompilationJobOutput) SetCompilationJobName(v string) *DescribeCompilationJobOutput { + s.CompilationJobName = &v + return s +} + +// SetCompilationJobStatus sets the CompilationJobStatus field's value. +func (s *DescribeCompilationJobOutput) SetCompilationJobStatus(v string) *DescribeCompilationJobOutput { + s.CompilationJobStatus = &v + return s +} + +// SetCompilationStartTime sets the CompilationStartTime field's value. +func (s *DescribeCompilationJobOutput) SetCompilationStartTime(v time.Time) *DescribeCompilationJobOutput { + s.CompilationStartTime = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeCompilationJobOutput) SetCreationTime(v time.Time) *DescribeCompilationJobOutput { + s.CreationTime = &v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *DescribeCompilationJobOutput) SetFailureReason(v string) *DescribeCompilationJobOutput { + s.FailureReason = &v + return s +} + +// SetInputConfig sets the InputConfig field's value. +func (s *DescribeCompilationJobOutput) SetInputConfig(v *InputConfig) *DescribeCompilationJobOutput { + s.InputConfig = v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeCompilationJobOutput) SetLastModifiedTime(v time.Time) *DescribeCompilationJobOutput { + s.LastModifiedTime = &v + return s +} + +// SetModelArtifacts sets the ModelArtifacts field's value. +func (s *DescribeCompilationJobOutput) SetModelArtifacts(v *ModelArtifacts) *DescribeCompilationJobOutput { + s.ModelArtifacts = v + return s +} + +// SetOutputConfig sets the OutputConfig field's value. +func (s *DescribeCompilationJobOutput) SetOutputConfig(v *OutputConfig) *DescribeCompilationJobOutput { + s.OutputConfig = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *DescribeCompilationJobOutput) SetRoleArn(v string) *DescribeCompilationJobOutput { + s.RoleArn = &v + return s +} + +// SetStoppingCondition sets the StoppingCondition field's value. +func (s *DescribeCompilationJobOutput) SetStoppingCondition(v *StoppingCondition) *DescribeCompilationJobOutput { + s.StoppingCondition = v + return s +} + +type DescribeDomainInput struct { + _ struct{} `type:"structure"` + + // The domain ID. + // + // DomainId is a required field + DomainId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeDomainInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDomainInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeDomainInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeDomainInput"} + if s.DomainId == nil { + invalidParams.Add(request.NewErrParamRequired("DomainId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDomainId sets the DomainId field's value. +func (s *DescribeDomainInput) SetDomainId(v string) *DescribeDomainInput { + s.DomainId = &v + return s +} + +type DescribeDomainOutput struct { + _ struct{} `type:"structure"` + + // The domain's authentication mode. + AuthMode *string `type:"string" enum:"AuthMode"` + + // The creation time. + CreationTime *time.Time `type:"timestamp"` + + // Settings which are applied to all UserProfile in this domain, if settings + // are not explicitly specified in a given UserProfile. + DefaultUserSettings *UserSettings `type:"structure"` + + // The domain's Amazon Resource Name (ARN). + DomainArn *string `type:"string"` + + // The domain ID. + DomainId *string `type:"string"` + + // The domain name. + DomainName *string `type:"string"` + + // The failure reason. + FailureReason *string `type:"string"` + + // The ID of the Amazon Elastic File System (EFS) managed by this Domain. + HomeEfsFileSystemId *string `type:"string"` + + // The AWS Key Management Service encryption key ID. + HomeEfsFileSystemKmsKeyId *string `type:"string"` + + // The last modified time. + LastModifiedTime *time.Time `type:"timestamp"` + + // The SSO managed application instance ID. + SingleSignOnManagedApplicationInstanceId *string `type:"string"` + + // The status. + Status *string `type:"string" enum:"DomainStatus"` + + // Security setting to limit to a set of subnets. + SubnetIds []*string `min:"1" type:"list"` + + // The domain's URL. + Url *string `type:"string"` + + // The ID of the Amazon Virtual Private Cloud. + VpcId *string `type:"string"` +} + +// String returns the string representation +func (s DescribeDomainOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeDomainOutput) GoString() string { + return s.String() +} + +// SetAuthMode sets the AuthMode field's value. +func (s *DescribeDomainOutput) SetAuthMode(v string) *DescribeDomainOutput { + s.AuthMode = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeDomainOutput) SetCreationTime(v time.Time) *DescribeDomainOutput { + s.CreationTime = &v + return s +} + +// SetDefaultUserSettings sets the DefaultUserSettings field's value. +func (s *DescribeDomainOutput) SetDefaultUserSettings(v *UserSettings) *DescribeDomainOutput { + s.DefaultUserSettings = v + return s +} + +// SetDomainArn sets the DomainArn field's value. +func (s *DescribeDomainOutput) SetDomainArn(v string) *DescribeDomainOutput { + s.DomainArn = &v + return s +} + +// SetDomainId sets the DomainId field's value. +func (s *DescribeDomainOutput) SetDomainId(v string) *DescribeDomainOutput { + s.DomainId = &v + return s +} + +// SetDomainName sets the DomainName field's value. +func (s *DescribeDomainOutput) SetDomainName(v string) *DescribeDomainOutput { + s.DomainName = &v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *DescribeDomainOutput) SetFailureReason(v string) *DescribeDomainOutput { + s.FailureReason = &v + return s +} + +// SetHomeEfsFileSystemId sets the HomeEfsFileSystemId field's value. +func (s *DescribeDomainOutput) SetHomeEfsFileSystemId(v string) *DescribeDomainOutput { + s.HomeEfsFileSystemId = &v + return s +} + +// SetHomeEfsFileSystemKmsKeyId sets the HomeEfsFileSystemKmsKeyId field's value. +func (s *DescribeDomainOutput) SetHomeEfsFileSystemKmsKeyId(v string) *DescribeDomainOutput { + s.HomeEfsFileSystemKmsKeyId = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeDomainOutput) SetLastModifiedTime(v time.Time) *DescribeDomainOutput { + s.LastModifiedTime = &v + return s +} + +// SetSingleSignOnManagedApplicationInstanceId sets the SingleSignOnManagedApplicationInstanceId field's value. +func (s *DescribeDomainOutput) SetSingleSignOnManagedApplicationInstanceId(v string) *DescribeDomainOutput { + s.SingleSignOnManagedApplicationInstanceId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeDomainOutput) SetStatus(v string) *DescribeDomainOutput { + s.Status = &v + return s +} + +// SetSubnetIds sets the SubnetIds field's value. +func (s *DescribeDomainOutput) SetSubnetIds(v []*string) *DescribeDomainOutput { + s.SubnetIds = v + return s +} + +// SetUrl sets the Url field's value. +func (s *DescribeDomainOutput) SetUrl(v string) *DescribeDomainOutput { + s.Url = &v + return s +} + +// SetVpcId sets the VpcId field's value. +func (s *DescribeDomainOutput) SetVpcId(v string) *DescribeDomainOutput { + s.VpcId = &v + return s +} + +type DescribeEndpointConfigInput struct { + _ struct{} `type:"structure"` + + // The name of the endpoint configuration. + // + // EndpointConfigName is a required field + EndpointConfigName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeEndpointConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEndpointConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeEndpointConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeEndpointConfigInput"} + if s.EndpointConfigName == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointConfigName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEndpointConfigName sets the EndpointConfigName field's value. +func (s *DescribeEndpointConfigInput) SetEndpointConfigName(v string) *DescribeEndpointConfigInput { + s.EndpointConfigName = &v + return s +} + +type DescribeEndpointConfigOutput struct { + _ struct{} `type:"structure"` + + // A timestamp that shows when the endpoint configuration was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + DataCaptureConfig *DataCaptureConfig `type:"structure"` + + // The Amazon Resource Name (ARN) of the endpoint configuration. + // + // EndpointConfigArn is a required field + EndpointConfigArn *string `min:"20" type:"string" required:"true"` + + // Name of the Amazon SageMaker endpoint configuration. + // + // EndpointConfigName is a required field + EndpointConfigName *string `type:"string" required:"true"` + + // AWS KMS key ID Amazon SageMaker uses to encrypt data when storing it on the + // ML storage volume attached to the instance. + KmsKeyId *string `type:"string"` + + // An array of ProductionVariant objects, one for each model that you want to + // host at this endpoint. + // + // ProductionVariants is a required field + ProductionVariants []*ProductionVariant `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s DescribeEndpointConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEndpointConfigOutput) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeEndpointConfigOutput) SetCreationTime(v time.Time) *DescribeEndpointConfigOutput { + s.CreationTime = &v + return s +} + +// SetDataCaptureConfig sets the DataCaptureConfig field's value. +func (s *DescribeEndpointConfigOutput) SetDataCaptureConfig(v *DataCaptureConfig) *DescribeEndpointConfigOutput { + s.DataCaptureConfig = v + return s +} + +// SetEndpointConfigArn sets the EndpointConfigArn field's value. +func (s *DescribeEndpointConfigOutput) SetEndpointConfigArn(v string) *DescribeEndpointConfigOutput { + s.EndpointConfigArn = &v + return s +} + +// SetEndpointConfigName sets the EndpointConfigName field's value. +func (s *DescribeEndpointConfigOutput) SetEndpointConfigName(v string) *DescribeEndpointConfigOutput { + s.EndpointConfigName = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *DescribeEndpointConfigOutput) SetKmsKeyId(v string) *DescribeEndpointConfigOutput { + s.KmsKeyId = &v + return s +} + +// SetProductionVariants sets the ProductionVariants field's value. +func (s *DescribeEndpointConfigOutput) SetProductionVariants(v []*ProductionVariant) *DescribeEndpointConfigOutput { + s.ProductionVariants = v + return s +} + +type DescribeEndpointInput struct { + _ struct{} `type:"structure"` + + // The name of the endpoint. + // + // EndpointName is a required field + EndpointName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeEndpointInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEndpointInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeEndpointInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeEndpointInput"} + if s.EndpointName == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEndpointName sets the EndpointName field's value. +func (s *DescribeEndpointInput) SetEndpointName(v string) *DescribeEndpointInput { + s.EndpointName = &v + return s +} + +type DescribeEndpointOutput struct { + _ struct{} `type:"structure"` + + // A timestamp that shows when the endpoint was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + DataCaptureConfig *DataCaptureConfigSummary `type:"structure"` + + // The Amazon Resource Name (ARN) of the endpoint. + // + // EndpointArn is a required field + EndpointArn *string `min:"20" type:"string" required:"true"` + + // The name of the endpoint configuration associated with this endpoint. + // + // EndpointConfigName is a required field + EndpointConfigName *string `type:"string" required:"true"` + + // Name of the endpoint. + // + // EndpointName is a required field + EndpointName *string `type:"string" required:"true"` + + // The status of the endpoint. + // + // * OutOfService: Endpoint is not available to take incoming requests. + // + // * Creating: CreateEndpoint is executing. + // + // * Updating: UpdateEndpoint or UpdateEndpointWeightsAndCapacities is executing. + // + // * SystemUpdating: Endpoint is undergoing maintenance and cannot be updated + // or deleted or re-scaled until it has completed. This maintenance operation + // does not change any customer-specified values such as VPC config, KMS + // encryption, model, instance type, or instance count. + // + // * RollingBack: Endpoint fails to scale up or down or change its variant + // weight and is in the process of rolling back to its previous configuration. + // Once the rollback completes, endpoint returns to an InService status. + // This transitional status only applies to an endpoint that has autoscaling + // enabled and is undergoing variant weight or capacity changes as part of + // an UpdateEndpointWeightsAndCapacities call or when the UpdateEndpointWeightsAndCapacities + // operation is called explicitly. + // + // * InService: Endpoint is available to process incoming requests. + // + // * Deleting: DeleteEndpoint is executing. + // + // * Failed: Endpoint could not be created, updated, or re-scaled. Use DescribeEndpointOutput$FailureReason + // for information about the failure. DeleteEndpoint is the only operation + // that can be performed on a failed endpoint. + // + // EndpointStatus is a required field + EndpointStatus *string `type:"string" required:"true" enum:"EndpointStatus"` + + // If the status of the endpoint is Failed, the reason why it failed. + FailureReason *string `type:"string"` + + // A timestamp that shows when the endpoint was last modified. + // + // LastModifiedTime is a required field + LastModifiedTime *time.Time `type:"timestamp" required:"true"` + + // An array of ProductionVariantSummary objects, one for each model hosted behind + // this endpoint. + ProductionVariants []*ProductionVariantSummary `min:"1" type:"list"` +} + +// String returns the string representation +func (s DescribeEndpointOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeEndpointOutput) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeEndpointOutput) SetCreationTime(v time.Time) *DescribeEndpointOutput { + s.CreationTime = &v + return s +} + +// SetDataCaptureConfig sets the DataCaptureConfig field's value. +func (s *DescribeEndpointOutput) SetDataCaptureConfig(v *DataCaptureConfigSummary) *DescribeEndpointOutput { + s.DataCaptureConfig = v + return s +} + +// SetEndpointArn sets the EndpointArn field's value. +func (s *DescribeEndpointOutput) SetEndpointArn(v string) *DescribeEndpointOutput { + s.EndpointArn = &v + return s +} + +// SetEndpointConfigName sets the EndpointConfigName field's value. +func (s *DescribeEndpointOutput) SetEndpointConfigName(v string) *DescribeEndpointOutput { + s.EndpointConfigName = &v + return s +} + +// SetEndpointName sets the EndpointName field's value. +func (s *DescribeEndpointOutput) SetEndpointName(v string) *DescribeEndpointOutput { + s.EndpointName = &v + return s +} + +// SetEndpointStatus sets the EndpointStatus field's value. +func (s *DescribeEndpointOutput) SetEndpointStatus(v string) *DescribeEndpointOutput { + s.EndpointStatus = &v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *DescribeEndpointOutput) SetFailureReason(v string) *DescribeEndpointOutput { + s.FailureReason = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeEndpointOutput) SetLastModifiedTime(v time.Time) *DescribeEndpointOutput { + s.LastModifiedTime = &v + return s +} + +// SetProductionVariants sets the ProductionVariants field's value. +func (s *DescribeEndpointOutput) SetProductionVariants(v []*ProductionVariantSummary) *DescribeEndpointOutput { + s.ProductionVariants = v + return s +} + +type DescribeExperimentInput struct { + _ struct{} `type:"structure"` + + // The name of the experiment to describe. + // + // ExperimentName is a required field + ExperimentName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeExperimentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeExperimentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeExperimentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeExperimentInput"} + if s.ExperimentName == nil { + invalidParams.Add(request.NewErrParamRequired("ExperimentName")) + } + if s.ExperimentName != nil && len(*s.ExperimentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ExperimentName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetExperimentName sets the ExperimentName field's value. +func (s *DescribeExperimentInput) SetExperimentName(v string) *DescribeExperimentInput { + s.ExperimentName = &v + return s +} + +type DescribeExperimentOutput struct { + _ struct{} `type:"structure"` + + // Who created the experiment. + CreatedBy *UserContext `type:"structure"` + + // When the experiment was created. + CreationTime *time.Time `type:"timestamp"` + + // The description of the experiment. + Description *string `type:"string"` + + // The name of the experiment as displayed. If DisplayName isn't specified, + // ExperimentName is displayed. + DisplayName *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the experiment. + ExperimentArn *string `type:"string"` + + // The name of the experiment. + ExperimentName *string `min:"1" type:"string"` + + // Who last modified the experiment. + LastModifiedBy *UserContext `type:"structure"` + + // When the experiment was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The ARN of the source and, optionally, the type. + Source *ExperimentSource `type:"structure"` +} + +// String returns the string representation +func (s DescribeExperimentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeExperimentOutput) GoString() string { + return s.String() +} + +// SetCreatedBy sets the CreatedBy field's value. +func (s *DescribeExperimentOutput) SetCreatedBy(v *UserContext) *DescribeExperimentOutput { + s.CreatedBy = v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeExperimentOutput) SetCreationTime(v time.Time) *DescribeExperimentOutput { + s.CreationTime = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *DescribeExperimentOutput) SetDescription(v string) *DescribeExperimentOutput { + s.Description = &v + return s +} + +// SetDisplayName sets the DisplayName field's value. +func (s *DescribeExperimentOutput) SetDisplayName(v string) *DescribeExperimentOutput { + s.DisplayName = &v + return s +} + +// SetExperimentArn sets the ExperimentArn field's value. +func (s *DescribeExperimentOutput) SetExperimentArn(v string) *DescribeExperimentOutput { + s.ExperimentArn = &v + return s +} + +// SetExperimentName sets the ExperimentName field's value. +func (s *DescribeExperimentOutput) SetExperimentName(v string) *DescribeExperimentOutput { + s.ExperimentName = &v + return s +} + +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *DescribeExperimentOutput) SetLastModifiedBy(v *UserContext) *DescribeExperimentOutput { + s.LastModifiedBy = v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeExperimentOutput) SetLastModifiedTime(v time.Time) *DescribeExperimentOutput { + s.LastModifiedTime = &v + return s +} + +// SetSource sets the Source field's value. +func (s *DescribeExperimentOutput) SetSource(v *ExperimentSource) *DescribeExperimentOutput { + s.Source = v + return s +} + +type DescribeFlowDefinitionInput struct { + _ struct{} `type:"structure"` + + // The name of the flow definition. + // + // FlowDefinitionName is a required field + FlowDefinitionName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeFlowDefinitionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeFlowDefinitionInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeFlowDefinitionInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeFlowDefinitionInput"} + if s.FlowDefinitionName == nil { + invalidParams.Add(request.NewErrParamRequired("FlowDefinitionName")) + } + if s.FlowDefinitionName != nil && len(*s.FlowDefinitionName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("FlowDefinitionName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFlowDefinitionName sets the FlowDefinitionName field's value. +func (s *DescribeFlowDefinitionInput) SetFlowDefinitionName(v string) *DescribeFlowDefinitionInput { + s.FlowDefinitionName = &v + return s +} + +type DescribeFlowDefinitionOutput struct { + _ struct{} `type:"structure"` + + // The timestamp when the flow definition was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + FailureReason *string `type:"string"` + + // The Amazon Resource Name (ARN) of the flow defintion. + // + // FlowDefinitionArn is a required field + FlowDefinitionArn *string `type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the flow definition. + // + // FlowDefinitionName is a required field + FlowDefinitionName *string `min:"1" type:"string" required:"true"` + + // The status of the flow definition. Valid values are listed below. + // + // FlowDefinitionStatus is a required field + FlowDefinitionStatus *string `type:"string" required:"true" enum:"FlowDefinitionStatus"` + + // An object containing information about what triggers a human review workflow. + HumanLoopActivationConfig *HumanLoopActivationConfig `type:"structure"` + + // An object containing information about who works on the task, the workforce + // task price, and other task details. + // + // HumanLoopConfig is a required field + HumanLoopConfig *HumanLoopConfig `type:"structure" required:"true"` + + // An object containing information about the output file. + // + // OutputConfig is a required field + OutputConfig *FlowDefinitionOutputConfig `type:"structure" required:"true"` + + // The Amazon Resource Name (ARN) of the AWS Identity and Access Management + // (IAM) execution role for the flow definition. + // + // RoleArn is a required field + RoleArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeFlowDefinitionOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeFlowDefinitionOutput) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeFlowDefinitionOutput) SetCreationTime(v time.Time) *DescribeFlowDefinitionOutput { + s.CreationTime = &v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *DescribeFlowDefinitionOutput) SetFailureReason(v string) *DescribeFlowDefinitionOutput { + s.FailureReason = &v + return s +} + +// SetFlowDefinitionArn sets the FlowDefinitionArn field's value. +func (s *DescribeFlowDefinitionOutput) SetFlowDefinitionArn(v string) *DescribeFlowDefinitionOutput { + s.FlowDefinitionArn = &v + return s +} + +// SetFlowDefinitionName sets the FlowDefinitionName field's value. +func (s *DescribeFlowDefinitionOutput) SetFlowDefinitionName(v string) *DescribeFlowDefinitionOutput { + s.FlowDefinitionName = &v + return s +} + +// SetFlowDefinitionStatus sets the FlowDefinitionStatus field's value. +func (s *DescribeFlowDefinitionOutput) SetFlowDefinitionStatus(v string) *DescribeFlowDefinitionOutput { + s.FlowDefinitionStatus = &v + return s +} + +// SetHumanLoopActivationConfig sets the HumanLoopActivationConfig field's value. +func (s *DescribeFlowDefinitionOutput) SetHumanLoopActivationConfig(v *HumanLoopActivationConfig) *DescribeFlowDefinitionOutput { + s.HumanLoopActivationConfig = v + return s +} + +// SetHumanLoopConfig sets the HumanLoopConfig field's value. +func (s *DescribeFlowDefinitionOutput) SetHumanLoopConfig(v *HumanLoopConfig) *DescribeFlowDefinitionOutput { + s.HumanLoopConfig = v + return s +} + +// SetOutputConfig sets the OutputConfig field's value. +func (s *DescribeFlowDefinitionOutput) SetOutputConfig(v *FlowDefinitionOutputConfig) *DescribeFlowDefinitionOutput { + s.OutputConfig = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *DescribeFlowDefinitionOutput) SetRoleArn(v string) *DescribeFlowDefinitionOutput { + s.RoleArn = &v + return s +} + +type DescribeHumanTaskUiInput struct { + _ struct{} `type:"structure"` + + // The name of the human task user interface you want information about. + // + // HumanTaskUiName is a required field + HumanTaskUiName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeHumanTaskUiInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeHumanTaskUiInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeHumanTaskUiInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeHumanTaskUiInput"} + if s.HumanTaskUiName == nil { + invalidParams.Add(request.NewErrParamRequired("HumanTaskUiName")) + } + if s.HumanTaskUiName != nil && len(*s.HumanTaskUiName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("HumanTaskUiName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHumanTaskUiName sets the HumanTaskUiName field's value. +func (s *DescribeHumanTaskUiInput) SetHumanTaskUiName(v string) *DescribeHumanTaskUiInput { + s.HumanTaskUiName = &v + return s +} + +type DescribeHumanTaskUiOutput struct { + _ struct{} `type:"structure"` + + // The timestamp when the human task user interface was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // The Amazon Resource Name (ARN) of the human task user interface. + // + // HumanTaskUiArn is a required field + HumanTaskUiArn *string `type:"string" required:"true"` + + // The name of the human task user interface. + // + // HumanTaskUiName is a required field + HumanTaskUiName *string `min:"1" type:"string" required:"true"` + + // Container for user interface template information. + // + // UiTemplate is a required field + UiTemplate *UiTemplateInfo `type:"structure" required:"true"` +} + +// String returns the string representation +func (s DescribeHumanTaskUiOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeHumanTaskUiOutput) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeHumanTaskUiOutput) SetCreationTime(v time.Time) *DescribeHumanTaskUiOutput { + s.CreationTime = &v + return s +} + +// SetHumanTaskUiArn sets the HumanTaskUiArn field's value. +func (s *DescribeHumanTaskUiOutput) SetHumanTaskUiArn(v string) *DescribeHumanTaskUiOutput { + s.HumanTaskUiArn = &v + return s +} + +// SetHumanTaskUiName sets the HumanTaskUiName field's value. +func (s *DescribeHumanTaskUiOutput) SetHumanTaskUiName(v string) *DescribeHumanTaskUiOutput { + s.HumanTaskUiName = &v + return s +} + +// SetUiTemplate sets the UiTemplate field's value. +func (s *DescribeHumanTaskUiOutput) SetUiTemplate(v *UiTemplateInfo) *DescribeHumanTaskUiOutput { + s.UiTemplate = v + return s +} + +type DescribeHyperParameterTuningJobInput struct { + _ struct{} `type:"structure"` + + // The name of the tuning job to describe. + // + // HyperParameterTuningJobName is a required field + HyperParameterTuningJobName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeHyperParameterTuningJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeHyperParameterTuningJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeHyperParameterTuningJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeHyperParameterTuningJobInput"} + if s.HyperParameterTuningJobName == nil { + invalidParams.Add(request.NewErrParamRequired("HyperParameterTuningJobName")) + } + if s.HyperParameterTuningJobName != nil && len(*s.HyperParameterTuningJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("HyperParameterTuningJobName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHyperParameterTuningJobName sets the HyperParameterTuningJobName field's value. +func (s *DescribeHyperParameterTuningJobInput) SetHyperParameterTuningJobName(v string) *DescribeHyperParameterTuningJobInput { + s.HyperParameterTuningJobName = &v + return s +} + +type DescribeHyperParameterTuningJobOutput struct { + _ struct{} `type:"structure"` + + // A TrainingJobSummary object that describes the training job that completed + // with the best current HyperParameterTuningJobObjective. + BestTrainingJob *HyperParameterTrainingJobSummary `type:"structure"` + + // The date and time that the tuning job started. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // If the tuning job failed, the reason it failed. + FailureReason *string `type:"string"` + + // The date and time that the tuning job ended. + HyperParameterTuningEndTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of the tuning job. + // + // HyperParameterTuningJobArn is a required field + HyperParameterTuningJobArn *string `type:"string" required:"true"` + + // The HyperParameterTuningJobConfig object that specifies the configuration + // of the tuning job. + // + // HyperParameterTuningJobConfig is a required field + HyperParameterTuningJobConfig *HyperParameterTuningJobConfig `type:"structure" required:"true"` + + // The name of the tuning job. + // + // HyperParameterTuningJobName is a required field + HyperParameterTuningJobName *string `min:"1" type:"string" required:"true"` + + // The status of the tuning job: InProgress, Completed, Failed, Stopping, or + // Stopped. + // + // HyperParameterTuningJobStatus is a required field + HyperParameterTuningJobStatus *string `type:"string" required:"true" enum:"HyperParameterTuningJobStatus"` + + // The date and time that the status of the tuning job was modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The ObjectiveStatusCounters object that specifies the number of training + // jobs, categorized by the status of their final objective metric, that this + // tuning job launched. + // + // ObjectiveStatusCounters is a required field + ObjectiveStatusCounters *ObjectiveStatusCounters `type:"structure" required:"true"` + + // If the hyperparameter tuning job is an warm start tuning job with a WarmStartType + // of IDENTICAL_DATA_AND_ALGORITHM, this is the TrainingJobSummary for the training + // job with the best objective metric value of all training jobs launched by + // this tuning job and all parent jobs specified for the warm start tuning job. + OverallBestTrainingJob *HyperParameterTrainingJobSummary `type:"structure"` + + // The HyperParameterTrainingJobDefinition object that specifies the definition + // of the training jobs that this tuning job launches. + TrainingJobDefinition *HyperParameterTrainingJobDefinition `type:"structure"` + + TrainingJobDefinitions []*HyperParameterTrainingJobDefinition `min:"1" type:"list"` + + // The TrainingJobStatusCounters object that specifies the number of training + // jobs, categorized by status, that this tuning job launched. + // + // TrainingJobStatusCounters is a required field + TrainingJobStatusCounters *TrainingJobStatusCounters `type:"structure" required:"true"` + + // The configuration for starting the hyperparameter parameter tuning job using + // one or more previous tuning jobs as a starting point. The results of previous + // tuning jobs are used to inform which combinations of hyperparameters to search + // over in the new tuning job. + WarmStartConfig *HyperParameterTuningJobWarmStartConfig `type:"structure"` +} + +// String returns the string representation +func (s DescribeHyperParameterTuningJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeHyperParameterTuningJobOutput) GoString() string { + return s.String() +} + +// SetBestTrainingJob sets the BestTrainingJob field's value. +func (s *DescribeHyperParameterTuningJobOutput) SetBestTrainingJob(v *HyperParameterTrainingJobSummary) *DescribeHyperParameterTuningJobOutput { + s.BestTrainingJob = v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeHyperParameterTuningJobOutput) SetCreationTime(v time.Time) *DescribeHyperParameterTuningJobOutput { + s.CreationTime = &v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *DescribeHyperParameterTuningJobOutput) SetFailureReason(v string) *DescribeHyperParameterTuningJobOutput { + s.FailureReason = &v + return s +} + +// SetHyperParameterTuningEndTime sets the HyperParameterTuningEndTime field's value. +func (s *DescribeHyperParameterTuningJobOutput) SetHyperParameterTuningEndTime(v time.Time) *DescribeHyperParameterTuningJobOutput { + s.HyperParameterTuningEndTime = &v + return s +} + +// SetHyperParameterTuningJobArn sets the HyperParameterTuningJobArn field's value. +func (s *DescribeHyperParameterTuningJobOutput) SetHyperParameterTuningJobArn(v string) *DescribeHyperParameterTuningJobOutput { + s.HyperParameterTuningJobArn = &v + return s +} + +// SetHyperParameterTuningJobConfig sets the HyperParameterTuningJobConfig field's value. +func (s *DescribeHyperParameterTuningJobOutput) SetHyperParameterTuningJobConfig(v *HyperParameterTuningJobConfig) *DescribeHyperParameterTuningJobOutput { + s.HyperParameterTuningJobConfig = v + return s +} + +// SetHyperParameterTuningJobName sets the HyperParameterTuningJobName field's value. +func (s *DescribeHyperParameterTuningJobOutput) SetHyperParameterTuningJobName(v string) *DescribeHyperParameterTuningJobOutput { + s.HyperParameterTuningJobName = &v + return s +} + +// SetHyperParameterTuningJobStatus sets the HyperParameterTuningJobStatus field's value. +func (s *DescribeHyperParameterTuningJobOutput) SetHyperParameterTuningJobStatus(v string) *DescribeHyperParameterTuningJobOutput { + s.HyperParameterTuningJobStatus = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeHyperParameterTuningJobOutput) SetLastModifiedTime(v time.Time) *DescribeHyperParameterTuningJobOutput { + s.LastModifiedTime = &v + return s +} + +// SetObjectiveStatusCounters sets the ObjectiveStatusCounters field's value. +func (s *DescribeHyperParameterTuningJobOutput) SetObjectiveStatusCounters(v *ObjectiveStatusCounters) *DescribeHyperParameterTuningJobOutput { + s.ObjectiveStatusCounters = v + return s +} + +// SetOverallBestTrainingJob sets the OverallBestTrainingJob field's value. +func (s *DescribeHyperParameterTuningJobOutput) SetOverallBestTrainingJob(v *HyperParameterTrainingJobSummary) *DescribeHyperParameterTuningJobOutput { + s.OverallBestTrainingJob = v + return s +} + +// SetTrainingJobDefinition sets the TrainingJobDefinition field's value. +func (s *DescribeHyperParameterTuningJobOutput) SetTrainingJobDefinition(v *HyperParameterTrainingJobDefinition) *DescribeHyperParameterTuningJobOutput { + s.TrainingJobDefinition = v + return s +} + +// SetTrainingJobDefinitions sets the TrainingJobDefinitions field's value. +func (s *DescribeHyperParameterTuningJobOutput) SetTrainingJobDefinitions(v []*HyperParameterTrainingJobDefinition) *DescribeHyperParameterTuningJobOutput { + s.TrainingJobDefinitions = v + return s +} + +// SetTrainingJobStatusCounters sets the TrainingJobStatusCounters field's value. +func (s *DescribeHyperParameterTuningJobOutput) SetTrainingJobStatusCounters(v *TrainingJobStatusCounters) *DescribeHyperParameterTuningJobOutput { + s.TrainingJobStatusCounters = v + return s +} + +// SetWarmStartConfig sets the WarmStartConfig field's value. +func (s *DescribeHyperParameterTuningJobOutput) SetWarmStartConfig(v *HyperParameterTuningJobWarmStartConfig) *DescribeHyperParameterTuningJobOutput { + s.WarmStartConfig = v + return s +} + +type DescribeLabelingJobInput struct { + _ struct{} `type:"structure"` + + // The name of the labeling job to return information for. + // + // LabelingJobName is a required field + LabelingJobName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeLabelingJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLabelingJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeLabelingJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeLabelingJobInput"} + if s.LabelingJobName == nil { + invalidParams.Add(request.NewErrParamRequired("LabelingJobName")) + } + if s.LabelingJobName != nil && len(*s.LabelingJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LabelingJobName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLabelingJobName sets the LabelingJobName field's value. +func (s *DescribeLabelingJobInput) SetLabelingJobName(v string) *DescribeLabelingJobInput { + s.LabelingJobName = &v + return s +} + +type DescribeLabelingJobOutput struct { + _ struct{} `type:"structure"` + + // The date and time that the labeling job was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // If the job failed, the reason that it failed. + FailureReason *string `type:"string"` + + // Configuration information required for human workers to complete a labeling + // task. + // + // HumanTaskConfig is a required field + HumanTaskConfig *HumanTaskConfig `type:"structure" required:"true"` + + // Input configuration information for the labeling job, such as the Amazon + // S3 location of the data objects and the location of the manifest file that + // describes the data objects. + // + // InputConfig is a required field + InputConfig *LabelingJobInputConfig `type:"structure" required:"true"` + + // A unique identifier for work done as part of a labeling job. + // + // JobReferenceCode is a required field + JobReferenceCode *string `min:"1" type:"string" required:"true"` + + // The attribute used as the label in the output manifest file. + LabelAttributeName *string `min:"1" type:"string"` + + // The S3 location of the JSON file that defines the categories used to label + // data objects. Please note the following label-category limits: + // + // * Semantic segmentation labeling jobs using automated labeling: 20 labels + // + // * Box bounding labeling jobs (all): 10 labels + // + // The file is a JSON structure in the following format: + // + // { + // + // "document-version": "2018-11-28" + // + // "labels": [ + // + // { + // + // "label": "label 1" + // + // }, + // + // { + // + // "label": "label 2" + // + // }, + // + // ... + // + // { + // + // "label": "label n" + // + // } + // + // ] + // + // } + LabelCategoryConfigS3Uri *string `type:"string"` + + // Provides a breakdown of the number of data objects labeled by humans, the + // number of objects labeled by machine, the number of objects than couldn't + // be labeled, and the total number of objects labeled. + // + // LabelCounters is a required field + LabelCounters *LabelCounters `type:"structure" required:"true"` + + // Configuration information for automated data labeling. + LabelingJobAlgorithmsConfig *LabelingJobAlgorithmsConfig `type:"structure"` + + // The Amazon Resource Name (ARN) of the labeling job. + // + // LabelingJobArn is a required field + LabelingJobArn *string `type:"string" required:"true"` + + // The name assigned to the labeling job when it was created. + // + // LabelingJobName is a required field + LabelingJobName *string `min:"1" type:"string" required:"true"` + + // The location of the output produced by the labeling job. + LabelingJobOutput *LabelingJobOutput `type:"structure"` + + // The processing status of the labeling job. + // + // LabelingJobStatus is a required field + LabelingJobStatus *string `type:"string" required:"true" enum:"LabelingJobStatus"` + + // The date and time that the labeling job was last updated. + // + // LastModifiedTime is a required field + LastModifiedTime *time.Time `type:"timestamp" required:"true"` + + // The location of the job's output data and the AWS Key Management Service + // key ID for the key used to encrypt the output data, if any. + // + // OutputConfig is a required field + OutputConfig *LabelingJobOutputConfig `type:"structure" required:"true"` + + // The Amazon Resource Name (ARN) that Amazon SageMaker assumes to perform tasks + // on your behalf during data labeling. + // + // RoleArn is a required field + RoleArn *string `min:"20" type:"string" required:"true"` + + // A set of conditions for stopping a labeling job. If any of the conditions + // are met, the job is automatically stopped. + StoppingConditions *LabelingJobStoppingConditions `type:"structure"` + + // An array of key/value pairs. For more information, see Using Cost Allocation + // Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) + // in the AWS Billing and Cost Management User Guide. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s DescribeLabelingJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeLabelingJobOutput) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeLabelingJobOutput) SetCreationTime(v time.Time) *DescribeLabelingJobOutput { + s.CreationTime = &v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *DescribeLabelingJobOutput) SetFailureReason(v string) *DescribeLabelingJobOutput { + s.FailureReason = &v + return s +} + +// SetHumanTaskConfig sets the HumanTaskConfig field's value. +func (s *DescribeLabelingJobOutput) SetHumanTaskConfig(v *HumanTaskConfig) *DescribeLabelingJobOutput { + s.HumanTaskConfig = v + return s +} + +// SetInputConfig sets the InputConfig field's value. +func (s *DescribeLabelingJobOutput) SetInputConfig(v *LabelingJobInputConfig) *DescribeLabelingJobOutput { + s.InputConfig = v + return s +} + +// SetJobReferenceCode sets the JobReferenceCode field's value. +func (s *DescribeLabelingJobOutput) SetJobReferenceCode(v string) *DescribeLabelingJobOutput { + s.JobReferenceCode = &v + return s +} + +// SetLabelAttributeName sets the LabelAttributeName field's value. +func (s *DescribeLabelingJobOutput) SetLabelAttributeName(v string) *DescribeLabelingJobOutput { + s.LabelAttributeName = &v + return s +} + +// SetLabelCategoryConfigS3Uri sets the LabelCategoryConfigS3Uri field's value. +func (s *DescribeLabelingJobOutput) SetLabelCategoryConfigS3Uri(v string) *DescribeLabelingJobOutput { + s.LabelCategoryConfigS3Uri = &v + return s +} + +// SetLabelCounters sets the LabelCounters field's value. +func (s *DescribeLabelingJobOutput) SetLabelCounters(v *LabelCounters) *DescribeLabelingJobOutput { + s.LabelCounters = v + return s +} + +// SetLabelingJobAlgorithmsConfig sets the LabelingJobAlgorithmsConfig field's value. +func (s *DescribeLabelingJobOutput) SetLabelingJobAlgorithmsConfig(v *LabelingJobAlgorithmsConfig) *DescribeLabelingJobOutput { + s.LabelingJobAlgorithmsConfig = v + return s +} + +// SetLabelingJobArn sets the LabelingJobArn field's value. +func (s *DescribeLabelingJobOutput) SetLabelingJobArn(v string) *DescribeLabelingJobOutput { + s.LabelingJobArn = &v + return s +} + +// SetLabelingJobName sets the LabelingJobName field's value. +func (s *DescribeLabelingJobOutput) SetLabelingJobName(v string) *DescribeLabelingJobOutput { + s.LabelingJobName = &v + return s +} + +// SetLabelingJobOutput sets the LabelingJobOutput field's value. +func (s *DescribeLabelingJobOutput) SetLabelingJobOutput(v *LabelingJobOutput) *DescribeLabelingJobOutput { + s.LabelingJobOutput = v + return s +} + +// SetLabelingJobStatus sets the LabelingJobStatus field's value. +func (s *DescribeLabelingJobOutput) SetLabelingJobStatus(v string) *DescribeLabelingJobOutput { + s.LabelingJobStatus = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeLabelingJobOutput) SetLastModifiedTime(v time.Time) *DescribeLabelingJobOutput { + s.LastModifiedTime = &v + return s +} + +// SetOutputConfig sets the OutputConfig field's value. +func (s *DescribeLabelingJobOutput) SetOutputConfig(v *LabelingJobOutputConfig) *DescribeLabelingJobOutput { + s.OutputConfig = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *DescribeLabelingJobOutput) SetRoleArn(v string) *DescribeLabelingJobOutput { + s.RoleArn = &v + return s +} + +// SetStoppingConditions sets the StoppingConditions field's value. +func (s *DescribeLabelingJobOutput) SetStoppingConditions(v *LabelingJobStoppingConditions) *DescribeLabelingJobOutput { + s.StoppingConditions = v + return s +} + +// SetTags sets the Tags field's value. +func (s *DescribeLabelingJobOutput) SetTags(v []*Tag) *DescribeLabelingJobOutput { + s.Tags = v + return s +} + +type DescribeModelInput struct { + _ struct{} `type:"structure"` + + // The name of the model. + // + // ModelName is a required field + ModelName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeModelInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeModelInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeModelInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeModelInput"} + if s.ModelName == nil { + invalidParams.Add(request.NewErrParamRequired("ModelName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetModelName sets the ModelName field's value. +func (s *DescribeModelInput) SetModelName(v string) *DescribeModelInput { + s.ModelName = &v + return s +} + +type DescribeModelOutput struct { + _ struct{} `type:"structure"` + + // The containers in the inference pipeline. + Containers []*ContainerDefinition `type:"list"` + + // A timestamp that shows when the model was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // If True, no inbound or outbound network calls can be made to or from the + // model container. + EnableNetworkIsolation *bool `type:"boolean"` + + // The Amazon Resource Name (ARN) of the IAM role that you specified for the + // model. + // + // ExecutionRoleArn is a required field + ExecutionRoleArn *string `min:"20" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the model. + // + // ModelArn is a required field + ModelArn *string `min:"20" type:"string" required:"true"` + + // Name of the Amazon SageMaker model. + // + // ModelName is a required field + ModelName *string `type:"string" required:"true"` + + // The location of the primary inference code, associated artifacts, and custom + // environment map that the inference code uses when it is deployed in production. + PrimaryContainer *ContainerDefinition `type:"structure"` + + // A VpcConfig object that specifies the VPC that this model has access to. + // For more information, see Protect Endpoints by Using an Amazon Virtual Private + // Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/host-vpc.html) + VpcConfig *VpcConfig `type:"structure"` +} + +// String returns the string representation +func (s DescribeModelOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeModelOutput) GoString() string { + return s.String() +} + +// SetContainers sets the Containers field's value. +func (s *DescribeModelOutput) SetContainers(v []*ContainerDefinition) *DescribeModelOutput { + s.Containers = v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeModelOutput) SetCreationTime(v time.Time) *DescribeModelOutput { + s.CreationTime = &v + return s +} + +// SetEnableNetworkIsolation sets the EnableNetworkIsolation field's value. +func (s *DescribeModelOutput) SetEnableNetworkIsolation(v bool) *DescribeModelOutput { + s.EnableNetworkIsolation = &v + return s +} + +// SetExecutionRoleArn sets the ExecutionRoleArn field's value. +func (s *DescribeModelOutput) SetExecutionRoleArn(v string) *DescribeModelOutput { + s.ExecutionRoleArn = &v + return s +} + +// SetModelArn sets the ModelArn field's value. +func (s *DescribeModelOutput) SetModelArn(v string) *DescribeModelOutput { + s.ModelArn = &v + return s +} + +// SetModelName sets the ModelName field's value. +func (s *DescribeModelOutput) SetModelName(v string) *DescribeModelOutput { + s.ModelName = &v + return s +} + +// SetPrimaryContainer sets the PrimaryContainer field's value. +func (s *DescribeModelOutput) SetPrimaryContainer(v *ContainerDefinition) *DescribeModelOutput { + s.PrimaryContainer = v + return s +} + +// SetVpcConfig sets the VpcConfig field's value. +func (s *DescribeModelOutput) SetVpcConfig(v *VpcConfig) *DescribeModelOutput { + s.VpcConfig = v + return s +} + +type DescribeModelPackageInput struct { + _ struct{} `type:"structure"` + + // The name of the model package to describe. + // + // ModelPackageName is a required field + ModelPackageName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeModelPackageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeModelPackageInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeModelPackageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeModelPackageInput"} + if s.ModelPackageName == nil { + invalidParams.Add(request.NewErrParamRequired("ModelPackageName")) + } + if s.ModelPackageName != nil && len(*s.ModelPackageName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ModelPackageName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetModelPackageName sets the ModelPackageName field's value. +func (s *DescribeModelPackageInput) SetModelPackageName(v string) *DescribeModelPackageInput { + s.ModelPackageName = &v + return s +} + +type DescribeModelPackageOutput struct { + _ struct{} `type:"structure"` + + // Whether the model package is certified for listing on AWS Marketplace. + CertifyForMarketplace *bool `type:"boolean"` + + // A timestamp specifying when the model package was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // Details about inference jobs that can be run with models based on this model + // package. + InferenceSpecification *InferenceSpecification `type:"structure"` + + // The Amazon Resource Name (ARN) of the model package. + // + // ModelPackageArn is a required field + ModelPackageArn *string `min:"1" type:"string" required:"true"` + + // A brief summary of the model package. + ModelPackageDescription *string `type:"string"` + + // The name of the model package being described. + // + // ModelPackageName is a required field + ModelPackageName *string `min:"1" type:"string" required:"true"` + + // The current status of the model package. + // + // ModelPackageStatus is a required field + ModelPackageStatus *string `type:"string" required:"true" enum:"ModelPackageStatus"` + + // Details about the current status of the model package. + // + // ModelPackageStatusDetails is a required field + ModelPackageStatusDetails *ModelPackageStatusDetails `type:"structure" required:"true"` + + // Details about the algorithm that was used to create the model package. + SourceAlgorithmSpecification *SourceAlgorithmSpecification `type:"structure"` + + // Configurations for one or more transform jobs that Amazon SageMaker runs + // to test the model package. + ValidationSpecification *ModelPackageValidationSpecification `type:"structure"` +} + +// String returns the string representation +func (s DescribeModelPackageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeModelPackageOutput) GoString() string { + return s.String() +} + +// SetCertifyForMarketplace sets the CertifyForMarketplace field's value. +func (s *DescribeModelPackageOutput) SetCertifyForMarketplace(v bool) *DescribeModelPackageOutput { + s.CertifyForMarketplace = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeModelPackageOutput) SetCreationTime(v time.Time) *DescribeModelPackageOutput { + s.CreationTime = &v + return s +} + +// SetInferenceSpecification sets the InferenceSpecification field's value. +func (s *DescribeModelPackageOutput) SetInferenceSpecification(v *InferenceSpecification) *DescribeModelPackageOutput { + s.InferenceSpecification = v + return s +} + +// SetModelPackageArn sets the ModelPackageArn field's value. +func (s *DescribeModelPackageOutput) SetModelPackageArn(v string) *DescribeModelPackageOutput { + s.ModelPackageArn = &v + return s +} + +// SetModelPackageDescription sets the ModelPackageDescription field's value. +func (s *DescribeModelPackageOutput) SetModelPackageDescription(v string) *DescribeModelPackageOutput { + s.ModelPackageDescription = &v + return s +} + +// SetModelPackageName sets the ModelPackageName field's value. +func (s *DescribeModelPackageOutput) SetModelPackageName(v string) *DescribeModelPackageOutput { + s.ModelPackageName = &v + return s +} + +// SetModelPackageStatus sets the ModelPackageStatus field's value. +func (s *DescribeModelPackageOutput) SetModelPackageStatus(v string) *DescribeModelPackageOutput { + s.ModelPackageStatus = &v + return s +} + +// SetModelPackageStatusDetails sets the ModelPackageStatusDetails field's value. +func (s *DescribeModelPackageOutput) SetModelPackageStatusDetails(v *ModelPackageStatusDetails) *DescribeModelPackageOutput { + s.ModelPackageStatusDetails = v + return s +} + +// SetSourceAlgorithmSpecification sets the SourceAlgorithmSpecification field's value. +func (s *DescribeModelPackageOutput) SetSourceAlgorithmSpecification(v *SourceAlgorithmSpecification) *DescribeModelPackageOutput { + s.SourceAlgorithmSpecification = v + return s +} + +// SetValidationSpecification sets the ValidationSpecification field's value. +func (s *DescribeModelPackageOutput) SetValidationSpecification(v *ModelPackageValidationSpecification) *DescribeModelPackageOutput { + s.ValidationSpecification = v + return s +} + +type DescribeMonitoringScheduleInput struct { + _ struct{} `type:"structure"` + + // Name of a previously created monitoring schedule. + // + // MonitoringScheduleName is a required field + MonitoringScheduleName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeMonitoringScheduleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeMonitoringScheduleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeMonitoringScheduleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeMonitoringScheduleInput"} + if s.MonitoringScheduleName == nil { + invalidParams.Add(request.NewErrParamRequired("MonitoringScheduleName")) + } + if s.MonitoringScheduleName != nil && len(*s.MonitoringScheduleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MonitoringScheduleName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMonitoringScheduleName sets the MonitoringScheduleName field's value. +func (s *DescribeMonitoringScheduleInput) SetMonitoringScheduleName(v string) *DescribeMonitoringScheduleInput { + s.MonitoringScheduleName = &v + return s +} + +type DescribeMonitoringScheduleOutput struct { + _ struct{} `type:"structure"` + + // The time at which the monitoring job was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // The name of the endpoint for the monitoring job. + EndpointName *string `type:"string"` + + // A string, up to one KB in size, that contains the reason a monitoring job + // failed, if it failed. + FailureReason *string `type:"string"` + + // The time at which the monitoring job was last modified. + // + // LastModifiedTime is a required field + LastModifiedTime *time.Time `type:"timestamp" required:"true"` + + // Describes metadata on the last execution to run, if there was one. + LastMonitoringExecutionSummary *MonitoringExecutionSummary `type:"structure"` + + // The Amazon Resource Name (ARN) of the monitoring schedule. + // + // MonitoringScheduleArn is a required field + MonitoringScheduleArn *string `type:"string" required:"true"` + + // The configuration object that specifies the monitoring schedule and defines + // the monitoring job. + // + // MonitoringScheduleConfig is a required field + MonitoringScheduleConfig *MonitoringScheduleConfig `type:"structure" required:"true"` + + // Name of the monitoring schedule. + // + // MonitoringScheduleName is a required field + MonitoringScheduleName *string `min:"1" type:"string" required:"true"` + + // The status of an monitoring job. + // + // MonitoringScheduleStatus is a required field + MonitoringScheduleStatus *string `type:"string" required:"true" enum:"ScheduleStatus"` +} + +// String returns the string representation +func (s DescribeMonitoringScheduleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeMonitoringScheduleOutput) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeMonitoringScheduleOutput) SetCreationTime(v time.Time) *DescribeMonitoringScheduleOutput { + s.CreationTime = &v + return s +} + +// SetEndpointName sets the EndpointName field's value. +func (s *DescribeMonitoringScheduleOutput) SetEndpointName(v string) *DescribeMonitoringScheduleOutput { + s.EndpointName = &v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *DescribeMonitoringScheduleOutput) SetFailureReason(v string) *DescribeMonitoringScheduleOutput { + s.FailureReason = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeMonitoringScheduleOutput) SetLastModifiedTime(v time.Time) *DescribeMonitoringScheduleOutput { + s.LastModifiedTime = &v + return s +} + +// SetLastMonitoringExecutionSummary sets the LastMonitoringExecutionSummary field's value. +func (s *DescribeMonitoringScheduleOutput) SetLastMonitoringExecutionSummary(v *MonitoringExecutionSummary) *DescribeMonitoringScheduleOutput { + s.LastMonitoringExecutionSummary = v + return s +} + +// SetMonitoringScheduleArn sets the MonitoringScheduleArn field's value. +func (s *DescribeMonitoringScheduleOutput) SetMonitoringScheduleArn(v string) *DescribeMonitoringScheduleOutput { + s.MonitoringScheduleArn = &v + return s +} + +// SetMonitoringScheduleConfig sets the MonitoringScheduleConfig field's value. +func (s *DescribeMonitoringScheduleOutput) SetMonitoringScheduleConfig(v *MonitoringScheduleConfig) *DescribeMonitoringScheduleOutput { + s.MonitoringScheduleConfig = v + return s +} + +// SetMonitoringScheduleName sets the MonitoringScheduleName field's value. +func (s *DescribeMonitoringScheduleOutput) SetMonitoringScheduleName(v string) *DescribeMonitoringScheduleOutput { + s.MonitoringScheduleName = &v + return s +} + +// SetMonitoringScheduleStatus sets the MonitoringScheduleStatus field's value. +func (s *DescribeMonitoringScheduleOutput) SetMonitoringScheduleStatus(v string) *DescribeMonitoringScheduleOutput { + s.MonitoringScheduleStatus = &v + return s +} + +type DescribeNotebookInstanceInput struct { + _ struct{} `type:"structure"` + + // The name of the notebook instance that you want information about. + // + // NotebookInstanceName is a required field + NotebookInstanceName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeNotebookInstanceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNotebookInstanceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeNotebookInstanceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeNotebookInstanceInput"} + if s.NotebookInstanceName == nil { + invalidParams.Add(request.NewErrParamRequired("NotebookInstanceName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNotebookInstanceName sets the NotebookInstanceName field's value. +func (s *DescribeNotebookInstanceInput) SetNotebookInstanceName(v string) *DescribeNotebookInstanceInput { + s.NotebookInstanceName = &v + return s +} + +type DescribeNotebookInstanceLifecycleConfigInput struct { + _ struct{} `type:"structure"` + + // The name of the lifecycle configuration to describe. + // + // NotebookInstanceLifecycleConfigName is a required field + NotebookInstanceLifecycleConfigName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeNotebookInstanceLifecycleConfigInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNotebookInstanceLifecycleConfigInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeNotebookInstanceLifecycleConfigInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeNotebookInstanceLifecycleConfigInput"} + if s.NotebookInstanceLifecycleConfigName == nil { + invalidParams.Add(request.NewErrParamRequired("NotebookInstanceLifecycleConfigName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetNotebookInstanceLifecycleConfigName sets the NotebookInstanceLifecycleConfigName field's value. +func (s *DescribeNotebookInstanceLifecycleConfigInput) SetNotebookInstanceLifecycleConfigName(v string) *DescribeNotebookInstanceLifecycleConfigInput { + s.NotebookInstanceLifecycleConfigName = &v + return s +} + +type DescribeNotebookInstanceLifecycleConfigOutput struct { + _ struct{} `type:"structure"` + + // A timestamp that tells when the lifecycle configuration was created. + CreationTime *time.Time `type:"timestamp"` + + // A timestamp that tells when the lifecycle configuration was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of the lifecycle configuration. + NotebookInstanceLifecycleConfigArn *string `type:"string"` + + // The name of the lifecycle configuration. + NotebookInstanceLifecycleConfigName *string `type:"string"` + + // The shell script that runs only once, when you create a notebook instance. + OnCreate []*NotebookInstanceLifecycleHook `type:"list"` + + // The shell script that runs every time you start a notebook instance, including + // when you create the notebook instance. + OnStart []*NotebookInstanceLifecycleHook `type:"list"` +} + +// String returns the string representation +func (s DescribeNotebookInstanceLifecycleConfigOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNotebookInstanceLifecycleConfigOutput) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeNotebookInstanceLifecycleConfigOutput) SetCreationTime(v time.Time) *DescribeNotebookInstanceLifecycleConfigOutput { + s.CreationTime = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeNotebookInstanceLifecycleConfigOutput) SetLastModifiedTime(v time.Time) *DescribeNotebookInstanceLifecycleConfigOutput { + s.LastModifiedTime = &v + return s +} + +// SetNotebookInstanceLifecycleConfigArn sets the NotebookInstanceLifecycleConfigArn field's value. +func (s *DescribeNotebookInstanceLifecycleConfigOutput) SetNotebookInstanceLifecycleConfigArn(v string) *DescribeNotebookInstanceLifecycleConfigOutput { + s.NotebookInstanceLifecycleConfigArn = &v + return s +} + +// SetNotebookInstanceLifecycleConfigName sets the NotebookInstanceLifecycleConfigName field's value. +func (s *DescribeNotebookInstanceLifecycleConfigOutput) SetNotebookInstanceLifecycleConfigName(v string) *DescribeNotebookInstanceLifecycleConfigOutput { + s.NotebookInstanceLifecycleConfigName = &v + return s +} + +// SetOnCreate sets the OnCreate field's value. +func (s *DescribeNotebookInstanceLifecycleConfigOutput) SetOnCreate(v []*NotebookInstanceLifecycleHook) *DescribeNotebookInstanceLifecycleConfigOutput { + s.OnCreate = v + return s +} + +// SetOnStart sets the OnStart field's value. +func (s *DescribeNotebookInstanceLifecycleConfigOutput) SetOnStart(v []*NotebookInstanceLifecycleHook) *DescribeNotebookInstanceLifecycleConfigOutput { + s.OnStart = v + return s +} + +type DescribeNotebookInstanceOutput struct { + _ struct{} `type:"structure"` + + // A list of the Elastic Inference (EI) instance types associated with this + // notebook instance. Currently only one EI instance type can be associated + // with a notebook instance. For more information, see Using Elastic Inference + // in Amazon SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html). + AcceleratorTypes []*string `type:"list"` + + // An array of up to three Git repositories associated with the notebook instance. + // These can be either the names of Git repositories stored as resources in + // your account, or the URL of Git repositories in AWS CodeCommit (https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html) + // or in any other Git repository. These repositories are cloned at the same + // level as the default repository of your notebook instance. For more information, + // see Associating Git Repositories with Amazon SageMaker Notebook Instances + // (https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html). + AdditionalCodeRepositories []*string `type:"list"` + + // A timestamp. Use this parameter to return the time when the notebook instance + // was created + CreationTime *time.Time `type:"timestamp"` + + // The Git repository associated with the notebook instance as its default code + // repository. This can be either the name of a Git repository stored as a resource + // in your account, or the URL of a Git repository in AWS CodeCommit (https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html) + // or in any other Git repository. When you open a notebook instance, it opens + // in the directory that contains this repository. For more information, see + // Associating Git Repositories with Amazon SageMaker Notebook Instances (https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html). + DefaultCodeRepository *string `min:"1" type:"string"` + + // Describes whether Amazon SageMaker provides internet access to the notebook + // instance. If this value is set to Disabled, the notebook instance does not + // have internet access, and cannot connect to Amazon SageMaker training and + // endpoint services. + // + // For more information, see Notebook Instances Are Internet-Enabled by Default + // (https://docs.aws.amazon.com/sagemaker/latest/dg/appendix-additional-considerations.html#appendix-notebook-and-internet-access). + DirectInternetAccess *string `type:"string" enum:"DirectInternetAccess"` + + // If status is Failed, the reason it failed. + FailureReason *string `type:"string"` + + // The type of ML compute instance running on the notebook instance. + InstanceType *string `type:"string" enum:"InstanceType"` + + // The AWS KMS key ID Amazon SageMaker uses to encrypt data when storing it + // on the ML storage volume attached to the instance. + KmsKeyId *string `type:"string"` + + // A timestamp. Use this parameter to retrieve the time when the notebook instance + // was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The network interface IDs that Amazon SageMaker created at the time of creating + // the instance. + NetworkInterfaceId *string `type:"string"` + + // The Amazon Resource Name (ARN) of the notebook instance. + NotebookInstanceArn *string `type:"string"` + + // Returns the name of a notebook instance lifecycle configuration. + // + // For information about notebook instance lifestyle configurations, see Step + // 2.1: (Optional) Customize a Notebook Instance (https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html) + NotebookInstanceLifecycleConfigName *string `type:"string"` + + // The name of the Amazon SageMaker notebook instance. + NotebookInstanceName *string `type:"string"` + + // The status of the notebook instance. + NotebookInstanceStatus *string `type:"string" enum:"NotebookInstanceStatus"` + + // The Amazon Resource Name (ARN) of the IAM role associated with the instance. + RoleArn *string `min:"20" type:"string"` + + // Whether root access is enabled or disabled for users of the notebook instance. + // + // Lifecycle configurations need root access to be able to set up a notebook + // instance. Because of this, lifecycle configurations associated with a notebook + // instance always run with root access even if you disable root access for + // users. + RootAccess *string `type:"string" enum:"RootAccess"` + + // The IDs of the VPC security groups. + SecurityGroups []*string `type:"list"` + + // The ID of the VPC subnet. + SubnetId *string `type:"string"` + + // The URL that you use to connect to the Jupyter notebook that is running in + // your notebook instance. + Url *string `type:"string"` + + // The size, in GB, of the ML storage volume attached to the notebook instance. + VolumeSizeInGB *int64 `min:"5" type:"integer"` +} + +// String returns the string representation +func (s DescribeNotebookInstanceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeNotebookInstanceOutput) GoString() string { + return s.String() +} + +// SetAcceleratorTypes sets the AcceleratorTypes field's value. +func (s *DescribeNotebookInstanceOutput) SetAcceleratorTypes(v []*string) *DescribeNotebookInstanceOutput { + s.AcceleratorTypes = v + return s +} + +// SetAdditionalCodeRepositories sets the AdditionalCodeRepositories field's value. +func (s *DescribeNotebookInstanceOutput) SetAdditionalCodeRepositories(v []*string) *DescribeNotebookInstanceOutput { + s.AdditionalCodeRepositories = v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeNotebookInstanceOutput) SetCreationTime(v time.Time) *DescribeNotebookInstanceOutput { + s.CreationTime = &v + return s +} + +// SetDefaultCodeRepository sets the DefaultCodeRepository field's value. +func (s *DescribeNotebookInstanceOutput) SetDefaultCodeRepository(v string) *DescribeNotebookInstanceOutput { + s.DefaultCodeRepository = &v + return s +} + +// SetDirectInternetAccess sets the DirectInternetAccess field's value. +func (s *DescribeNotebookInstanceOutput) SetDirectInternetAccess(v string) *DescribeNotebookInstanceOutput { + s.DirectInternetAccess = &v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *DescribeNotebookInstanceOutput) SetFailureReason(v string) *DescribeNotebookInstanceOutput { + s.FailureReason = &v + return s +} + +// SetInstanceType sets the InstanceType field's value. +func (s *DescribeNotebookInstanceOutput) SetInstanceType(v string) *DescribeNotebookInstanceOutput { + s.InstanceType = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *DescribeNotebookInstanceOutput) SetKmsKeyId(v string) *DescribeNotebookInstanceOutput { + s.KmsKeyId = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeNotebookInstanceOutput) SetLastModifiedTime(v time.Time) *DescribeNotebookInstanceOutput { + s.LastModifiedTime = &v + return s +} + +// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. +func (s *DescribeNotebookInstanceOutput) SetNetworkInterfaceId(v string) *DescribeNotebookInstanceOutput { + s.NetworkInterfaceId = &v + return s +} + +// SetNotebookInstanceArn sets the NotebookInstanceArn field's value. +func (s *DescribeNotebookInstanceOutput) SetNotebookInstanceArn(v string) *DescribeNotebookInstanceOutput { + s.NotebookInstanceArn = &v + return s +} + +// SetNotebookInstanceLifecycleConfigName sets the NotebookInstanceLifecycleConfigName field's value. +func (s *DescribeNotebookInstanceOutput) SetNotebookInstanceLifecycleConfigName(v string) *DescribeNotebookInstanceOutput { + s.NotebookInstanceLifecycleConfigName = &v + return s +} + +// SetNotebookInstanceName sets the NotebookInstanceName field's value. +func (s *DescribeNotebookInstanceOutput) SetNotebookInstanceName(v string) *DescribeNotebookInstanceOutput { + s.NotebookInstanceName = &v + return s +} + +// SetNotebookInstanceStatus sets the NotebookInstanceStatus field's value. +func (s *DescribeNotebookInstanceOutput) SetNotebookInstanceStatus(v string) *DescribeNotebookInstanceOutput { + s.NotebookInstanceStatus = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *DescribeNotebookInstanceOutput) SetRoleArn(v string) *DescribeNotebookInstanceOutput { + s.RoleArn = &v + return s +} + +// SetRootAccess sets the RootAccess field's value. +func (s *DescribeNotebookInstanceOutput) SetRootAccess(v string) *DescribeNotebookInstanceOutput { + s.RootAccess = &v + return s +} + +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *DescribeNotebookInstanceOutput) SetSecurityGroups(v []*string) *DescribeNotebookInstanceOutput { + s.SecurityGroups = v + return s +} + +// SetSubnetId sets the SubnetId field's value. +func (s *DescribeNotebookInstanceOutput) SetSubnetId(v string) *DescribeNotebookInstanceOutput { + s.SubnetId = &v + return s +} + +// SetUrl sets the Url field's value. +func (s *DescribeNotebookInstanceOutput) SetUrl(v string) *DescribeNotebookInstanceOutput { + s.Url = &v + return s +} + +// SetVolumeSizeInGB sets the VolumeSizeInGB field's value. +func (s *DescribeNotebookInstanceOutput) SetVolumeSizeInGB(v int64) *DescribeNotebookInstanceOutput { + s.VolumeSizeInGB = &v + return s +} + +type DescribeProcessingJobInput struct { + _ struct{} `type:"structure"` + + // The name of the processing job. The name must be unique within an AWS Region + // in the AWS account. + // + // ProcessingJobName is a required field + ProcessingJobName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeProcessingJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeProcessingJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeProcessingJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeProcessingJobInput"} + if s.ProcessingJobName == nil { + invalidParams.Add(request.NewErrParamRequired("ProcessingJobName")) + } + if s.ProcessingJobName != nil && len(*s.ProcessingJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ProcessingJobName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetProcessingJobName sets the ProcessingJobName field's value. +func (s *DescribeProcessingJobInput) SetProcessingJobName(v string) *DescribeProcessingJobInput { + s.ProcessingJobName = &v + return s +} + +type DescribeProcessingJobOutput struct { + _ struct{} `type:"structure"` + + // Configures the processing job to run a specified container image. + // + // AppSpecification is a required field + AppSpecification *AppSpecification `type:"structure" required:"true"` + + // The ARN of an AutoML job associated with this processing job. + AutoMLJobArn *string `min:"1" type:"string"` + + // The time at which the processing job was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // The environment variables set in the Docker container. + Environment map[string]*string `type:"map"` + + // An optional string, up to one KB in size, that contains metadata from the + // processing container when the processing job exits. + ExitMessage *string `type:"string"` + + // The configuration information used to create an experiment. + ExperimentConfig *ExperimentConfig `type:"structure"` + + // A string, up to one KB in size, that contains the reason a processing job + // failed, if it failed. + FailureReason *string `type:"string"` + + // The time at which the processing job was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The ARN of a monitoring schedule for an endpoint associated with this processing + // job. + MonitoringScheduleArn *string `type:"string"` + + // Networking options for a processing job. + NetworkConfig *NetworkConfig `type:"structure"` + + // The time at which the processing job completed. + ProcessingEndTime *time.Time `type:"timestamp"` + + // The inputs for a processing job. + ProcessingInputs []*ProcessingInput `type:"list"` + + // The Amazon Resource Name (ARN) of the processing job. + // + // ProcessingJobArn is a required field + ProcessingJobArn *string `type:"string" required:"true"` + + // The name of the processing job. The name must be unique within an AWS Region + // in the AWS account. + // + // ProcessingJobName is a required field + ProcessingJobName *string `min:"1" type:"string" required:"true"` + + // Provides the status of a processing job. + // + // ProcessingJobStatus is a required field + ProcessingJobStatus *string `type:"string" required:"true" enum:"ProcessingJobStatus"` + + // Output configuration for the processing job. + ProcessingOutputConfig *ProcessingOutputConfig `type:"structure"` + + // Identifies the resources, ML compute instances, and ML storage volumes to + // deploy for a processing job. In distributed training, you specify more than + // one instance. + // + // ProcessingResources is a required field + ProcessingResources *ProcessingResources `type:"structure" required:"true"` + + // The time at which the processing job started. + ProcessingStartTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume + // to perform tasks on your behalf. + RoleArn *string `min:"20" type:"string"` + + // The time limit for how long the processing job is allowed to run. + StoppingCondition *ProcessingStoppingCondition `type:"structure"` + + // The ARN of a training job associated with this processing job. + TrainingJobArn *string `type:"string"` +} + +// String returns the string representation +func (s DescribeProcessingJobOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeProcessingJobOutput) GoString() string { + return s.String() +} + +// SetAppSpecification sets the AppSpecification field's value. +func (s *DescribeProcessingJobOutput) SetAppSpecification(v *AppSpecification) *DescribeProcessingJobOutput { + s.AppSpecification = v + return s +} + +// SetAutoMLJobArn sets the AutoMLJobArn field's value. +func (s *DescribeProcessingJobOutput) SetAutoMLJobArn(v string) *DescribeProcessingJobOutput { + s.AutoMLJobArn = &v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeProcessingJobOutput) SetCreationTime(v time.Time) *DescribeProcessingJobOutput { + s.CreationTime = &v + return s +} + +// SetEnvironment sets the Environment field's value. +func (s *DescribeProcessingJobOutput) SetEnvironment(v map[string]*string) *DescribeProcessingJobOutput { + s.Environment = v + return s +} + +// SetExitMessage sets the ExitMessage field's value. +func (s *DescribeProcessingJobOutput) SetExitMessage(v string) *DescribeProcessingJobOutput { + s.ExitMessage = &v + return s +} + +// SetExperimentConfig sets the ExperimentConfig field's value. +func (s *DescribeProcessingJobOutput) SetExperimentConfig(v *ExperimentConfig) *DescribeProcessingJobOutput { + s.ExperimentConfig = v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *DescribeProcessingJobOutput) SetFailureReason(v string) *DescribeProcessingJobOutput { + s.FailureReason = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeProcessingJobOutput) SetLastModifiedTime(v time.Time) *DescribeProcessingJobOutput { + s.LastModifiedTime = &v + return s +} + +// SetMonitoringScheduleArn sets the MonitoringScheduleArn field's value. +func (s *DescribeProcessingJobOutput) SetMonitoringScheduleArn(v string) *DescribeProcessingJobOutput { + s.MonitoringScheduleArn = &v + return s +} + +// SetNetworkConfig sets the NetworkConfig field's value. +func (s *DescribeProcessingJobOutput) SetNetworkConfig(v *NetworkConfig) *DescribeProcessingJobOutput { + s.NetworkConfig = v + return s +} + +// SetProcessingEndTime sets the ProcessingEndTime field's value. +func (s *DescribeProcessingJobOutput) SetProcessingEndTime(v time.Time) *DescribeProcessingJobOutput { + s.ProcessingEndTime = &v + return s +} + +// SetProcessingInputs sets the ProcessingInputs field's value. +func (s *DescribeProcessingJobOutput) SetProcessingInputs(v []*ProcessingInput) *DescribeProcessingJobOutput { + s.ProcessingInputs = v + return s +} + +// SetProcessingJobArn sets the ProcessingJobArn field's value. +func (s *DescribeProcessingJobOutput) SetProcessingJobArn(v string) *DescribeProcessingJobOutput { + s.ProcessingJobArn = &v + return s +} + +// SetProcessingJobName sets the ProcessingJobName field's value. +func (s *DescribeProcessingJobOutput) SetProcessingJobName(v string) *DescribeProcessingJobOutput { + s.ProcessingJobName = &v + return s +} + +// SetProcessingJobStatus sets the ProcessingJobStatus field's value. +func (s *DescribeProcessingJobOutput) SetProcessingJobStatus(v string) *DescribeProcessingJobOutput { + s.ProcessingJobStatus = &v + return s +} + +// SetProcessingOutputConfig sets the ProcessingOutputConfig field's value. +func (s *DescribeProcessingJobOutput) SetProcessingOutputConfig(v *ProcessingOutputConfig) *DescribeProcessingJobOutput { + s.ProcessingOutputConfig = v + return s +} + +// SetProcessingResources sets the ProcessingResources field's value. +func (s *DescribeProcessingJobOutput) SetProcessingResources(v *ProcessingResources) *DescribeProcessingJobOutput { + s.ProcessingResources = v + return s +} + +// SetProcessingStartTime sets the ProcessingStartTime field's value. +func (s *DescribeProcessingJobOutput) SetProcessingStartTime(v time.Time) *DescribeProcessingJobOutput { + s.ProcessingStartTime = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *DescribeProcessingJobOutput) SetRoleArn(v string) *DescribeProcessingJobOutput { + s.RoleArn = &v + return s +} + +// SetStoppingCondition sets the StoppingCondition field's value. +func (s *DescribeProcessingJobOutput) SetStoppingCondition(v *ProcessingStoppingCondition) *DescribeProcessingJobOutput { + s.StoppingCondition = v + return s +} + +// SetTrainingJobArn sets the TrainingJobArn field's value. +func (s *DescribeProcessingJobOutput) SetTrainingJobArn(v string) *DescribeProcessingJobOutput { + s.TrainingJobArn = &v + return s +} + +type DescribeSubscribedWorkteamInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the subscribed work team to describe. + // + // WorkteamArn is a required field + WorkteamArn *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeSubscribedWorkteamInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSubscribedWorkteamInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeSubscribedWorkteamInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeSubscribedWorkteamInput"} + if s.WorkteamArn == nil { + invalidParams.Add(request.NewErrParamRequired("WorkteamArn")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetWorkteamArn sets the WorkteamArn field's value. +func (s *DescribeSubscribedWorkteamInput) SetWorkteamArn(v string) *DescribeSubscribedWorkteamInput { + s.WorkteamArn = &v + return s +} + +type DescribeSubscribedWorkteamOutput struct { + _ struct{} `type:"structure"` + + // A Workteam instance that contains information about the work team. + // + // SubscribedWorkteam is a required field + SubscribedWorkteam *SubscribedWorkteam `type:"structure" required:"true"` +} + +// String returns the string representation +func (s DescribeSubscribedWorkteamOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeSubscribedWorkteamOutput) GoString() string { + return s.String() +} + +// SetSubscribedWorkteam sets the SubscribedWorkteam field's value. +func (s *DescribeSubscribedWorkteamOutput) SetSubscribedWorkteam(v *SubscribedWorkteam) *DescribeSubscribedWorkteamOutput { + s.SubscribedWorkteam = v + return s +} + +type DescribeTrainingJobInput struct { + _ struct{} `type:"structure"` + + // The name of the training job. + // + // TrainingJobName is a required field + TrainingJobName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeTrainingJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTrainingJobInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeTrainingJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTrainingJobInput"} + if s.TrainingJobName == nil { + invalidParams.Add(request.NewErrParamRequired("TrainingJobName")) + } + if s.TrainingJobName != nil && len(*s.TrainingJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrainingJobName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetTrainingJobName sets the TrainingJobName field's value. +func (s *DescribeTrainingJobInput) SetTrainingJobName(v string) *DescribeTrainingJobInput { + s.TrainingJobName = &v + return s +} + +type DescribeTrainingJobOutput struct { + _ struct{} `type:"structure"` + + // Information about the algorithm used for training, and algorithm metadata. + // + // AlgorithmSpecification is a required field + AlgorithmSpecification *AlgorithmSpecification `type:"structure" required:"true"` + + AutoMLJobArn *string `min:"1" type:"string"` + + // The billable time in seconds. + // + // You can calculate the savings from using managed spot training using the + // formula (1 - BillableTimeInSeconds / TrainingTimeInSeconds) * 100. For example, + // if BillableTimeInSeconds is 100 and TrainingTimeInSeconds is 500, the savings + // is 80%. + BillableTimeInSeconds *int64 `min:"1" type:"integer"` + + // Contains information about the output location for managed spot training + // checkpoint data. + CheckpointConfig *CheckpointConfig `type:"structure"` + + // A timestamp that indicates when the training job was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // Configuration information for the debug hook parameters, collection configuration, + // and storage paths. + DebugHookConfig *DebugHookConfig `type:"structure"` + + // Configuration information for debugging rules. + DebugRuleConfigurations []*DebugRuleConfiguration `type:"list"` + + // Status about the debug rule evaluation. + DebugRuleEvaluationStatuses []*DebugRuleEvaluationStatus `type:"list"` + + // To encrypt all communications between ML compute instances in distributed + // training, choose True. Encryption provides greater security for distributed + // training, but training might take longer. How long it takes depends on the + // amount of communication between compute instances, especially if you use + // a deep learning algorithms in distributed training. + EnableInterContainerTrafficEncryption *bool `type:"boolean"` + + // A Boolean indicating whether managed spot training is enabled (True) or not + // (False). + EnableManagedSpotTraining *bool `type:"boolean"` + + // If you want to allow inbound or outbound network calls, except for calls + // between peers within a training cluster for distributed training, choose + // True. If you enable network isolation for training jobs that are configured + // to use a VPC, Amazon SageMaker downloads and uploads customer data and model + // artifacts through the specified VPC, but the training container does not + // have network access. + EnableNetworkIsolation *bool `type:"boolean"` + + // Configuration for the experiment. + ExperimentConfig *ExperimentConfig `type:"structure"` + + // If the training job failed, the reason it failed. + FailureReason *string `type:"string"` + + // A collection of MetricData objects that specify the names, values, and dates + // and times that the training algorithm emitted to Amazon CloudWatch. + FinalMetricDataList []*MetricData `type:"list"` + + // Algorithm-specific parameters. + HyperParameters map[string]*string `type:"map"` + + // An array of Channel objects that describes each data input channel. + InputDataConfig []*Channel `min:"1" type:"list"` + + // The Amazon Resource Name (ARN) of the Amazon SageMaker Ground Truth labeling + // job that created the transform or training job. + LabelingJobArn *string `type:"string"` - // The name of the algorithm resource to use for the training job. This must - // be an algorithm resource that you created or subscribe to on AWS Marketplace. - // If you specify a value for this parameter, you can't specify a value for - // TrainingImage. - AlgorithmName *string `min:"1" type:"string"` + // A timestamp that indicates when the status of the training job was last modified. + LastModifiedTime *time.Time `type:"timestamp"` - // A list of metric definition objects. Each object specifies the metric name - // and regular expressions used to parse algorithm logs. Amazon SageMaker publishes - // each metric to Amazon CloudWatch. - MetricDefinitions []*MetricDefinition `type:"list"` + // Information about the Amazon S3 location that is configured for storing model + // artifacts. + // + // ModelArtifacts is a required field + ModelArtifacts *ModelArtifacts `type:"structure" required:"true"` - // The registry path of the Docker image that contains the training algorithm. - // For information about docker registry paths for built-in algorithms, see - // Algorithms Provided by Amazon SageMaker: Common Parameters (https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-algo-docker-registry-paths.html). - // Amazon SageMaker supports both registry/repository[:tag] and registry/repository[@digest] - // image path formats. For more information, see Using Your Own Algorithms with - // Amazon SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html). - TrainingImage *string `type:"string"` + // The S3 path where model artifacts that you configured when creating the job + // are stored. Amazon SageMaker creates subfolders for model artifacts. + OutputDataConfig *OutputDataConfig `type:"structure"` - // The input mode that the algorithm supports. For the input modes that Amazon - // SageMaker algorithms support, see Algorithms (https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html). - // If an algorithm supports the File input mode, Amazon SageMaker downloads - // the training data from S3 to the provisioned ML storage Volume, and mounts - // the directory to docker volume for training container. If an algorithm supports - // the Pipe input mode, Amazon SageMaker streams data directly from S3 to the - // container. + // Resources, including ML compute instances and ML storage volumes, that are + // configured for model training. // - // In File mode, make sure you provision ML storage volume with sufficient capacity - // to accommodate the data download from S3. In addition to the training data, - // the ML storage volume also stores the output model. The algorithm container - // use ML storage volume to also store intermediate information, if any. + // ResourceConfig is a required field + ResourceConfig *ResourceConfig `type:"structure" required:"true"` + + // The AWS Identity and Access Management (IAM) role configured for the training + // job. + RoleArn *string `min:"20" type:"string"` + + // Provides detailed information about the state of the training job. For detailed + // information on the secondary status of the training job, see StatusMessage + // under SecondaryStatusTransition. // - // For distributed algorithms using File mode, training data is distributed - // uniformly, and your training duration is predictable if the input data objects - // size is approximately same. Amazon SageMaker does not split the files any - // further for model training. If the object sizes are skewed, training won't - // be optimal as the data distribution is also skewed where one host in a training - // cluster is overloaded, thus becoming bottleneck in training. + // Amazon SageMaker provides primary statuses and secondary statuses that apply + // to each of them: // - // TrainingInputMode is a required field - TrainingInputMode *string `type:"string" required:"true" enum:"TrainingInputMode"` + // InProgress + // + // * Starting - Starting the training job. + // + // * Downloading - An optional stage for algorithms that support File training + // input mode. It indicates that data is being downloaded to the ML storage + // volumes. + // + // * Training - Training is in progress. + // + // * Interrupted - The job stopped because the managed spot training instances + // were interrupted. + // + // * Uploading - Training is complete and the model artifacts are being uploaded + // to the S3 location. + // + // Completed + // + // * Completed - The training job has completed. + // + // Failed + // + // * Failed - The training job has failed. The reason for the failure is + // returned in the FailureReason field of DescribeTrainingJobResponse. + // + // Stopped + // + // * MaxRuntimeExceeded - The job stopped because it exceeded the maximum + // allowed runtime. + // + // * MaxWaitTmeExceeded - The job stopped because it exceeded the maximum + // allowed wait time. + // + // * Stopped - The training job has stopped. + // + // Stopping + // + // * Stopping - Stopping the training job. + // + // Valid values for SecondaryStatus are subject to change. + // + // We no longer support the following secondary statuses: + // + // * LaunchingMLInstances + // + // * PreparingTrainingStack + // + // * DownloadingTrainingImage + // + // SecondaryStatus is a required field + SecondaryStatus *string `type:"string" required:"true" enum:"SecondaryStatus"` + + // A history of all of the secondary statuses that the training job has transitioned + // through. + SecondaryStatusTransitions []*SecondaryStatusTransition `type:"list"` + + // Specifies a limit to how long a model training job can run. It also specifies + // the maximum time to wait for a spot instance. When the job reaches the time + // limit, Amazon SageMaker ends the training job. Use this API to cap model + // training costs. + // + // To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal, which + // delays job termination for 120 seconds. Algorithms can use this 120-second + // window to save the model artifacts, so the results of training are not lost. + // + // StoppingCondition is a required field + StoppingCondition *StoppingCondition `type:"structure" required:"true"` + + // Configuration of storage locations for TensorBoard output. + TensorBoardOutputConfig *TensorBoardOutputConfig `type:"structure"` + + // Indicates the time when the training job ends on training instances. You + // are billed for the time interval between the value of TrainingStartTime and + // this time. For successful jobs and stopped jobs, this is the time after model + // artifacts are uploaded. For failed jobs, this is the time when Amazon SageMaker + // detects a job failure. + TrainingEndTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of the training job. + // + // TrainingJobArn is a required field + TrainingJobArn *string `type:"string" required:"true"` + + // Name of the model training job. + // + // TrainingJobName is a required field + TrainingJobName *string `min:"1" type:"string" required:"true"` + + // The status of the training job. + // + // Amazon SageMaker provides the following training job statuses: + // + // * InProgress - The training is in progress. + // + // * Completed - The training job has completed. + // + // * Failed - The training job has failed. To see the reason for the failure, + // see the FailureReason field in the response to a DescribeTrainingJobResponse + // call. + // + // * Stopping - The training job is stopping. + // + // * Stopped - The training job has stopped. + // + // For more detailed information, see SecondaryStatus. + // + // TrainingJobStatus is a required field + TrainingJobStatus *string `type:"string" required:"true" enum:"TrainingJobStatus"` + + // Indicates the time when the training job starts on training instances. You + // are billed for the time interval between this time and the value of TrainingEndTime. + // The start time in CloudWatch Logs might be later than this time. The difference + // is due to the time it takes to download the training data and to the size + // of the training container. + TrainingStartTime *time.Time `type:"timestamp"` + + // The training time in seconds. + TrainingTimeInSeconds *int64 `min:"1" type:"integer"` + + // The Amazon Resource Name (ARN) of the associated hyperparameter tuning job + // if the training job was launched by a hyperparameter tuning job. + TuningJobArn *string `type:"string"` + + // A VpcConfig object that specifies the VPC that this training job has access + // to. For more information, see Protect Training Jobs by Using an Amazon Virtual + // Private Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html). + VpcConfig *VpcConfig `type:"structure"` } // String returns the string representation -func (s AlgorithmSpecification) String() string { +func (s DescribeTrainingJobOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AlgorithmSpecification) GoString() string { +func (s DescribeTrainingJobOutput) GoString() string { + return s.String() +} + +// SetAlgorithmSpecification sets the AlgorithmSpecification field's value. +func (s *DescribeTrainingJobOutput) SetAlgorithmSpecification(v *AlgorithmSpecification) *DescribeTrainingJobOutput { + s.AlgorithmSpecification = v + return s +} + +// SetAutoMLJobArn sets the AutoMLJobArn field's value. +func (s *DescribeTrainingJobOutput) SetAutoMLJobArn(v string) *DescribeTrainingJobOutput { + s.AutoMLJobArn = &v + return s +} + +// SetBillableTimeInSeconds sets the BillableTimeInSeconds field's value. +func (s *DescribeTrainingJobOutput) SetBillableTimeInSeconds(v int64) *DescribeTrainingJobOutput { + s.BillableTimeInSeconds = &v + return s +} + +// SetCheckpointConfig sets the CheckpointConfig field's value. +func (s *DescribeTrainingJobOutput) SetCheckpointConfig(v *CheckpointConfig) *DescribeTrainingJobOutput { + s.CheckpointConfig = v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeTrainingJobOutput) SetCreationTime(v time.Time) *DescribeTrainingJobOutput { + s.CreationTime = &v + return s +} + +// SetDebugHookConfig sets the DebugHookConfig field's value. +func (s *DescribeTrainingJobOutput) SetDebugHookConfig(v *DebugHookConfig) *DescribeTrainingJobOutput { + s.DebugHookConfig = v + return s +} + +// SetDebugRuleConfigurations sets the DebugRuleConfigurations field's value. +func (s *DescribeTrainingJobOutput) SetDebugRuleConfigurations(v []*DebugRuleConfiguration) *DescribeTrainingJobOutput { + s.DebugRuleConfigurations = v + return s +} + +// SetDebugRuleEvaluationStatuses sets the DebugRuleEvaluationStatuses field's value. +func (s *DescribeTrainingJobOutput) SetDebugRuleEvaluationStatuses(v []*DebugRuleEvaluationStatus) *DescribeTrainingJobOutput { + s.DebugRuleEvaluationStatuses = v + return s +} + +// SetEnableInterContainerTrafficEncryption sets the EnableInterContainerTrafficEncryption field's value. +func (s *DescribeTrainingJobOutput) SetEnableInterContainerTrafficEncryption(v bool) *DescribeTrainingJobOutput { + s.EnableInterContainerTrafficEncryption = &v + return s +} + +// SetEnableManagedSpotTraining sets the EnableManagedSpotTraining field's value. +func (s *DescribeTrainingJobOutput) SetEnableManagedSpotTraining(v bool) *DescribeTrainingJobOutput { + s.EnableManagedSpotTraining = &v + return s +} + +// SetEnableNetworkIsolation sets the EnableNetworkIsolation field's value. +func (s *DescribeTrainingJobOutput) SetEnableNetworkIsolation(v bool) *DescribeTrainingJobOutput { + s.EnableNetworkIsolation = &v + return s +} + +// SetExperimentConfig sets the ExperimentConfig field's value. +func (s *DescribeTrainingJobOutput) SetExperimentConfig(v *ExperimentConfig) *DescribeTrainingJobOutput { + s.ExperimentConfig = v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *DescribeTrainingJobOutput) SetFailureReason(v string) *DescribeTrainingJobOutput { + s.FailureReason = &v + return s +} + +// SetFinalMetricDataList sets the FinalMetricDataList field's value. +func (s *DescribeTrainingJobOutput) SetFinalMetricDataList(v []*MetricData) *DescribeTrainingJobOutput { + s.FinalMetricDataList = v + return s +} + +// SetHyperParameters sets the HyperParameters field's value. +func (s *DescribeTrainingJobOutput) SetHyperParameters(v map[string]*string) *DescribeTrainingJobOutput { + s.HyperParameters = v + return s +} + +// SetInputDataConfig sets the InputDataConfig field's value. +func (s *DescribeTrainingJobOutput) SetInputDataConfig(v []*Channel) *DescribeTrainingJobOutput { + s.InputDataConfig = v + return s +} + +// SetLabelingJobArn sets the LabelingJobArn field's value. +func (s *DescribeTrainingJobOutput) SetLabelingJobArn(v string) *DescribeTrainingJobOutput { + s.LabelingJobArn = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeTrainingJobOutput) SetLastModifiedTime(v time.Time) *DescribeTrainingJobOutput { + s.LastModifiedTime = &v + return s +} + +// SetModelArtifacts sets the ModelArtifacts field's value. +func (s *DescribeTrainingJobOutput) SetModelArtifacts(v *ModelArtifacts) *DescribeTrainingJobOutput { + s.ModelArtifacts = v + return s +} + +// SetOutputDataConfig sets the OutputDataConfig field's value. +func (s *DescribeTrainingJobOutput) SetOutputDataConfig(v *OutputDataConfig) *DescribeTrainingJobOutput { + s.OutputDataConfig = v + return s +} + +// SetResourceConfig sets the ResourceConfig field's value. +func (s *DescribeTrainingJobOutput) SetResourceConfig(v *ResourceConfig) *DescribeTrainingJobOutput { + s.ResourceConfig = v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *DescribeTrainingJobOutput) SetRoleArn(v string) *DescribeTrainingJobOutput { + s.RoleArn = &v + return s +} + +// SetSecondaryStatus sets the SecondaryStatus field's value. +func (s *DescribeTrainingJobOutput) SetSecondaryStatus(v string) *DescribeTrainingJobOutput { + s.SecondaryStatus = &v + return s +} + +// SetSecondaryStatusTransitions sets the SecondaryStatusTransitions field's value. +func (s *DescribeTrainingJobOutput) SetSecondaryStatusTransitions(v []*SecondaryStatusTransition) *DescribeTrainingJobOutput { + s.SecondaryStatusTransitions = v + return s +} + +// SetStoppingCondition sets the StoppingCondition field's value. +func (s *DescribeTrainingJobOutput) SetStoppingCondition(v *StoppingCondition) *DescribeTrainingJobOutput { + s.StoppingCondition = v + return s +} + +// SetTensorBoardOutputConfig sets the TensorBoardOutputConfig field's value. +func (s *DescribeTrainingJobOutput) SetTensorBoardOutputConfig(v *TensorBoardOutputConfig) *DescribeTrainingJobOutput { + s.TensorBoardOutputConfig = v + return s +} + +// SetTrainingEndTime sets the TrainingEndTime field's value. +func (s *DescribeTrainingJobOutput) SetTrainingEndTime(v time.Time) *DescribeTrainingJobOutput { + s.TrainingEndTime = &v + return s +} + +// SetTrainingJobArn sets the TrainingJobArn field's value. +func (s *DescribeTrainingJobOutput) SetTrainingJobArn(v string) *DescribeTrainingJobOutput { + s.TrainingJobArn = &v + return s +} + +// SetTrainingJobName sets the TrainingJobName field's value. +func (s *DescribeTrainingJobOutput) SetTrainingJobName(v string) *DescribeTrainingJobOutput { + s.TrainingJobName = &v + return s +} + +// SetTrainingJobStatus sets the TrainingJobStatus field's value. +func (s *DescribeTrainingJobOutput) SetTrainingJobStatus(v string) *DescribeTrainingJobOutput { + s.TrainingJobStatus = &v + return s +} + +// SetTrainingStartTime sets the TrainingStartTime field's value. +func (s *DescribeTrainingJobOutput) SetTrainingStartTime(v time.Time) *DescribeTrainingJobOutput { + s.TrainingStartTime = &v + return s +} + +// SetTrainingTimeInSeconds sets the TrainingTimeInSeconds field's value. +func (s *DescribeTrainingJobOutput) SetTrainingTimeInSeconds(v int64) *DescribeTrainingJobOutput { + s.TrainingTimeInSeconds = &v + return s +} + +// SetTuningJobArn sets the TuningJobArn field's value. +func (s *DescribeTrainingJobOutput) SetTuningJobArn(v string) *DescribeTrainingJobOutput { + s.TuningJobArn = &v + return s +} + +// SetVpcConfig sets the VpcConfig field's value. +func (s *DescribeTrainingJobOutput) SetVpcConfig(v *VpcConfig) *DescribeTrainingJobOutput { + s.VpcConfig = v + return s +} + +type DescribeTransformJobInput struct { + _ struct{} `type:"structure"` + + // The name of the transform job that you want to view details of. + // + // TransformJobName is a required field + TransformJobName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeTransformJobInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeTransformJobInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *AlgorithmSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AlgorithmSpecification"} - if s.AlgorithmName != nil && len(*s.AlgorithmName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AlgorithmName", 1)) - } - if s.TrainingInputMode == nil { - invalidParams.Add(request.NewErrParamRequired("TrainingInputMode")) +func (s *DescribeTransformJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTransformJobInput"} + if s.TransformJobName == nil { + invalidParams.Add(request.NewErrParamRequired("TransformJobName")) } - if s.MetricDefinitions != nil { - for i, v := range s.MetricDefinitions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricDefinitions", i), err.(request.ErrInvalidParams)) - } - } + if s.TransformJobName != nil && len(*s.TransformJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TransformJobName", 1)) } if invalidParams.Len() > 0 { @@ -7265,233 +25620,260 @@ func (s *AlgorithmSpecification) Validate() error { return nil } -// SetAlgorithmName sets the AlgorithmName field's value. -func (s *AlgorithmSpecification) SetAlgorithmName(v string) *AlgorithmSpecification { - s.AlgorithmName = &v +// SetTransformJobName sets the TransformJobName field's value. +func (s *DescribeTransformJobInput) SetTransformJobName(v string) *DescribeTransformJobInput { + s.TransformJobName = &v return s } -// SetMetricDefinitions sets the MetricDefinitions field's value. -func (s *AlgorithmSpecification) SetMetricDefinitions(v []*MetricDefinition) *AlgorithmSpecification { - s.MetricDefinitions = v - return s -} +type DescribeTransformJobOutput struct { + _ struct{} `type:"structure"` -// SetTrainingImage sets the TrainingImage field's value. -func (s *AlgorithmSpecification) SetTrainingImage(v string) *AlgorithmSpecification { - s.TrainingImage = &v - return s -} + AutoMLJobArn *string `min:"1" type:"string"` -// SetTrainingInputMode sets the TrainingInputMode field's value. -func (s *AlgorithmSpecification) SetTrainingInputMode(v string) *AlgorithmSpecification { - s.TrainingInputMode = &v - return s -} + // Specifies the number of records to include in a mini-batch for an HTTP inference + // request. A record is a single unit of input data that inference can be made + // on. For example, a single line in a CSV file is a record. + // + // To enable the batch strategy, you must set SplitType to Line, RecordIO, or + // TFRecord. + BatchStrategy *string `type:"string" enum:"BatchStrategy"` + + // A timestamp that shows when the transform Job was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // The data structure used to specify the data to be used for inference in a + // batch transform job and to associate the data that is relevant to the prediction + // results in the output. The input filter provided allows you to exclude input + // data that is not needed for inference in a batch transform job. The output + // filter provided allows you to include input data relevant to interpreting + // the predictions in the output from the job. For more information, see Associate + // Prediction Results with their Corresponding Input Records (https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform-data-processing.html). + DataProcessing *DataProcessing `type:"structure"` + + // The environment variables to set in the Docker container. We support up to + // 16 key and values entries in the map. + Environment map[string]*string `type:"map"` + + // Configuration for the experiment. + ExperimentConfig *ExperimentConfig `type:"structure"` + + // If the transform job failed, FailureReason describes why it failed. A transform + // job creates a log file, which includes error messages, and stores it as an + // Amazon S3 object. For more information, see Log Amazon SageMaker Events with + // Amazon CloudWatch (https://docs.aws.amazon.com/sagemaker/latest/dg/logging-cloudwatch.html). + FailureReason *string `type:"string"` + + // The Amazon Resource Name (ARN) of the Amazon SageMaker Ground Truth labeling + // job that created the transform or training job. + LabelingJobArn *string `type:"string"` + + // The maximum number of parallel requests on each instance node that can be + // launched in a transform job. The default value is 1. + MaxConcurrentTransforms *int64 `type:"integer"` + + // The maximum payload size, in MB, used in the transform job. + MaxPayloadInMB *int64 `type:"integer"` + + // The name of the model used in the transform job. + // + // ModelName is a required field + ModelName *string `type:"string" required:"true"` + + // Indicates when the transform job has been completed, or has stopped or failed. + // You are billed for the time interval between this time and the value of TransformStartTime. + TransformEndTime *time.Time `type:"timestamp"` + + // Describes the dataset to be transformed and the Amazon S3 location where + // it is stored. + // + // TransformInput is a required field + TransformInput *TransformInput `type:"structure" required:"true"` + + // The Amazon Resource Name (ARN) of the transform job. + // + // TransformJobArn is a required field + TransformJobArn *string `type:"string" required:"true"` + + // The name of the transform job. + // + // TransformJobName is a required field + TransformJobName *string `min:"1" type:"string" required:"true"` + + // The status of the transform job. If the transform job failed, the reason + // is returned in the FailureReason field. + // + // TransformJobStatus is a required field + TransformJobStatus *string `type:"string" required:"true" enum:"TransformJobStatus"` -// Specifies the validation and image scan statuses of the algorithm. -type AlgorithmStatusDetails struct { - _ struct{} `type:"structure"` + // Identifies the Amazon S3 location where you want Amazon SageMaker to save + // the results from the transform job. + TransformOutput *TransformOutput `type:"structure"` - // The status of the scan of the algorithm's Docker image container. - ImageScanStatuses []*AlgorithmStatusItem `type:"list"` + // Describes the resources, including ML instance types and ML instance count, + // to use for the transform job. + // + // TransformResources is a required field + TransformResources *TransformResources `type:"structure" required:"true"` - // The status of algorithm validation. - ValidationStatuses []*AlgorithmStatusItem `type:"list"` + // Indicates when the transform job starts on ML instances. You are billed for + // the time interval between this time and the value of TransformEndTime. + TransformStartTime *time.Time `type:"timestamp"` } // String returns the string representation -func (s AlgorithmStatusDetails) String() string { +func (s DescribeTransformJobOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AlgorithmStatusDetails) GoString() string { +func (s DescribeTransformJobOutput) GoString() string { return s.String() } -// SetImageScanStatuses sets the ImageScanStatuses field's value. -func (s *AlgorithmStatusDetails) SetImageScanStatuses(v []*AlgorithmStatusItem) *AlgorithmStatusDetails { - s.ImageScanStatuses = v +// SetAutoMLJobArn sets the AutoMLJobArn field's value. +func (s *DescribeTransformJobOutput) SetAutoMLJobArn(v string) *DescribeTransformJobOutput { + s.AutoMLJobArn = &v return s } -// SetValidationStatuses sets the ValidationStatuses field's value. -func (s *AlgorithmStatusDetails) SetValidationStatuses(v []*AlgorithmStatusItem) *AlgorithmStatusDetails { - s.ValidationStatuses = v +// SetBatchStrategy sets the BatchStrategy field's value. +func (s *DescribeTransformJobOutput) SetBatchStrategy(v string) *DescribeTransformJobOutput { + s.BatchStrategy = &v return s } -// Represents the overall status of an algorithm. -type AlgorithmStatusItem struct { - _ struct{} `type:"structure"` - - // if the overall status is Failed, the reason for the failure. - FailureReason *string `type:"string"` - - // The name of the algorithm for which the overall status is being reported. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeTransformJobOutput) SetCreationTime(v time.Time) *DescribeTransformJobOutput { + s.CreationTime = &v + return s +} - // The current status. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"DetailedAlgorithmStatus"` +// SetDataProcessing sets the DataProcessing field's value. +func (s *DescribeTransformJobOutput) SetDataProcessing(v *DataProcessing) *DescribeTransformJobOutput { + s.DataProcessing = v + return s } -// String returns the string representation -func (s AlgorithmStatusItem) String() string { - return awsutil.Prettify(s) +// SetEnvironment sets the Environment field's value. +func (s *DescribeTransformJobOutput) SetEnvironment(v map[string]*string) *DescribeTransformJobOutput { + s.Environment = v + return s } -// GoString returns the string representation -func (s AlgorithmStatusItem) GoString() string { - return s.String() +// SetExperimentConfig sets the ExperimentConfig field's value. +func (s *DescribeTransformJobOutput) SetExperimentConfig(v *ExperimentConfig) *DescribeTransformJobOutput { + s.ExperimentConfig = v + return s } // SetFailureReason sets the FailureReason field's value. -func (s *AlgorithmStatusItem) SetFailureReason(v string) *AlgorithmStatusItem { +func (s *DescribeTransformJobOutput) SetFailureReason(v string) *DescribeTransformJobOutput { s.FailureReason = &v return s } -// SetName sets the Name field's value. -func (s *AlgorithmStatusItem) SetName(v string) *AlgorithmStatusItem { - s.Name = &v +// SetLabelingJobArn sets the LabelingJobArn field's value. +func (s *DescribeTransformJobOutput) SetLabelingJobArn(v string) *DescribeTransformJobOutput { + s.LabelingJobArn = &v return s } -// SetStatus sets the Status field's value. -func (s *AlgorithmStatusItem) SetStatus(v string) *AlgorithmStatusItem { - s.Status = &v +// SetMaxConcurrentTransforms sets the MaxConcurrentTransforms field's value. +func (s *DescribeTransformJobOutput) SetMaxConcurrentTransforms(v int64) *DescribeTransformJobOutput { + s.MaxConcurrentTransforms = &v return s } -// Provides summary information about an algorithm. -type AlgorithmSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the algorithm. - // - // AlgorithmArn is a required field - AlgorithmArn *string `min:"1" type:"string" required:"true"` - - // A brief description of the algorithm. - AlgorithmDescription *string `type:"string"` - - // The name of the algorithm that is described by the summary. - // - // AlgorithmName is a required field - AlgorithmName *string `min:"1" type:"string" required:"true"` +// SetMaxPayloadInMB sets the MaxPayloadInMB field's value. +func (s *DescribeTransformJobOutput) SetMaxPayloadInMB(v int64) *DescribeTransformJobOutput { + s.MaxPayloadInMB = &v + return s +} - // The overall status of the algorithm. - // - // AlgorithmStatus is a required field - AlgorithmStatus *string `type:"string" required:"true" enum:"AlgorithmStatus"` +// SetModelName sets the ModelName field's value. +func (s *DescribeTransformJobOutput) SetModelName(v string) *DescribeTransformJobOutput { + s.ModelName = &v + return s +} - // A timestamp that shows when the algorithm was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` +// SetTransformEndTime sets the TransformEndTime field's value. +func (s *DescribeTransformJobOutput) SetTransformEndTime(v time.Time) *DescribeTransformJobOutput { + s.TransformEndTime = &v + return s } -// String returns the string representation -func (s AlgorithmSummary) String() string { - return awsutil.Prettify(s) +// SetTransformInput sets the TransformInput field's value. +func (s *DescribeTransformJobOutput) SetTransformInput(v *TransformInput) *DescribeTransformJobOutput { + s.TransformInput = v + return s } -// GoString returns the string representation -func (s AlgorithmSummary) GoString() string { - return s.String() +// SetTransformJobArn sets the TransformJobArn field's value. +func (s *DescribeTransformJobOutput) SetTransformJobArn(v string) *DescribeTransformJobOutput { + s.TransformJobArn = &v + return s } -// SetAlgorithmArn sets the AlgorithmArn field's value. -func (s *AlgorithmSummary) SetAlgorithmArn(v string) *AlgorithmSummary { - s.AlgorithmArn = &v +// SetTransformJobName sets the TransformJobName field's value. +func (s *DescribeTransformJobOutput) SetTransformJobName(v string) *DescribeTransformJobOutput { + s.TransformJobName = &v return s } -// SetAlgorithmDescription sets the AlgorithmDescription field's value. -func (s *AlgorithmSummary) SetAlgorithmDescription(v string) *AlgorithmSummary { - s.AlgorithmDescription = &v +// SetTransformJobStatus sets the TransformJobStatus field's value. +func (s *DescribeTransformJobOutput) SetTransformJobStatus(v string) *DescribeTransformJobOutput { + s.TransformJobStatus = &v return s } -// SetAlgorithmName sets the AlgorithmName field's value. -func (s *AlgorithmSummary) SetAlgorithmName(v string) *AlgorithmSummary { - s.AlgorithmName = &v +// SetTransformOutput sets the TransformOutput field's value. +func (s *DescribeTransformJobOutput) SetTransformOutput(v *TransformOutput) *DescribeTransformJobOutput { + s.TransformOutput = v return s } -// SetAlgorithmStatus sets the AlgorithmStatus field's value. -func (s *AlgorithmSummary) SetAlgorithmStatus(v string) *AlgorithmSummary { - s.AlgorithmStatus = &v +// SetTransformResources sets the TransformResources field's value. +func (s *DescribeTransformJobOutput) SetTransformResources(v *TransformResources) *DescribeTransformJobOutput { + s.TransformResources = v return s } -// SetCreationTime sets the CreationTime field's value. -func (s *AlgorithmSummary) SetCreationTime(v time.Time) *AlgorithmSummary { - s.CreationTime = &v +// SetTransformStartTime sets the TransformStartTime field's value. +func (s *DescribeTransformJobOutput) SetTransformStartTime(v time.Time) *DescribeTransformJobOutput { + s.TransformStartTime = &v return s } -// Defines a training job and a batch transform job that Amazon SageMaker runs -// to validate your algorithm. -// -// The data provided in the validation profile is made available to your buyers -// on AWS Marketplace. -type AlgorithmValidationProfile struct { +type DescribeTrialComponentInput struct { _ struct{} `type:"structure"` - // The name of the profile for the algorithm. The name must have 1 to 63 characters. - // Valid characters are a-z, A-Z, 0-9, and - (hyphen). - // - // ProfileName is a required field - ProfileName *string `min:"1" type:"string" required:"true"` - - // The TrainingJobDefinition object that describes the training job that Amazon - // SageMaker runs to validate your algorithm. + // The name of the trial component to describe. // - // TrainingJobDefinition is a required field - TrainingJobDefinition *TrainingJobDefinition `type:"structure" required:"true"` - - // The TransformJobDefinition object that describes the transform job that Amazon - // SageMaker runs to validate your algorithm. - TransformJobDefinition *TransformJobDefinition `type:"structure"` + // TrialComponentName is a required field + TrialComponentName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s AlgorithmValidationProfile) String() string { +func (s DescribeTrialComponentInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AlgorithmValidationProfile) GoString() string { +func (s DescribeTrialComponentInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *AlgorithmValidationProfile) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AlgorithmValidationProfile"} - if s.ProfileName == nil { - invalidParams.Add(request.NewErrParamRequired("ProfileName")) - } - if s.ProfileName != nil && len(*s.ProfileName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProfileName", 1)) - } - if s.TrainingJobDefinition == nil { - invalidParams.Add(request.NewErrParamRequired("TrainingJobDefinition")) - } - if s.TrainingJobDefinition != nil { - if err := s.TrainingJobDefinition.Validate(); err != nil { - invalidParams.AddNested("TrainingJobDefinition", err.(request.ErrInvalidParams)) - } +func (s *DescribeTrialComponentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTrialComponentInput"} + if s.TrialComponentName == nil { + invalidParams.Add(request.NewErrParamRequired("TrialComponentName")) } - if s.TransformJobDefinition != nil { - if err := s.TransformJobDefinition.Validate(); err != nil { - invalidParams.AddNested("TransformJobDefinition", err.(request.ErrInvalidParams)) - } + if s.TrialComponentName != nil && len(*s.TrialComponentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialComponentName", 1)) } if invalidParams.Len() > 0 { @@ -7500,286 +25882,195 @@ func (s *AlgorithmValidationProfile) Validate() error { return nil } -// SetProfileName sets the ProfileName field's value. -func (s *AlgorithmValidationProfile) SetProfileName(v string) *AlgorithmValidationProfile { - s.ProfileName = &v +// SetTrialComponentName sets the TrialComponentName field's value. +func (s *DescribeTrialComponentInput) SetTrialComponentName(v string) *DescribeTrialComponentInput { + s.TrialComponentName = &v return s } -// SetTrainingJobDefinition sets the TrainingJobDefinition field's value. -func (s *AlgorithmValidationProfile) SetTrainingJobDefinition(v *TrainingJobDefinition) *AlgorithmValidationProfile { - s.TrainingJobDefinition = v - return s -} +type DescribeTrialComponentOutput struct { + _ struct{} `type:"structure"` -// SetTransformJobDefinition sets the TransformJobDefinition field's value. -func (s *AlgorithmValidationProfile) SetTransformJobDefinition(v *TransformJobDefinition) *AlgorithmValidationProfile { - s.TransformJobDefinition = v - return s -} + // Who created the component. + CreatedBy *UserContext `type:"structure"` -// Specifies configurations for one or more training jobs that Amazon SageMaker -// runs to test the algorithm. -type AlgorithmValidationSpecification struct { - _ struct{} `type:"structure"` + // When the component was created. + CreationTime *time.Time `type:"timestamp"` - // An array of AlgorithmValidationProfile objects, each of which specifies a - // training job and batch transform job that Amazon SageMaker runs to validate - // your algorithm. - // - // ValidationProfiles is a required field - ValidationProfiles []*AlgorithmValidationProfile `min:"1" type:"list" required:"true"` + // The name of the component as displayed. If DisplayName isn't specified, TrialComponentName + // is displayed. + DisplayName *string `min:"1" type:"string"` - // The IAM roles that Amazon SageMaker uses to run the training jobs. + // When the component ended. + EndTime *time.Time `type:"timestamp"` + + // The input artifacts of the component. + InputArtifacts map[string]*TrialComponentArtifact `type:"map"` + + // Who last modified the component. + LastModifiedBy *UserContext `type:"structure"` + + // When the component was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The metrics for the component. + Metrics []*TrialComponentMetricSummary `type:"list"` + + // The output artifacts of the component. + OutputArtifacts map[string]*TrialComponentArtifact `type:"map"` + + // The hyperparameters of the component. + Parameters map[string]*TrialComponentParameterValue `type:"map"` + + // The Amazon Resource Name (ARN) of the source and, optionally, the job type. + Source *TrialComponentSource `type:"structure"` + + // When the component started. + StartTime *time.Time `type:"timestamp"` + + // The status of the component. States include: // - // ValidationRole is a required field - ValidationRole *string `min:"20" type:"string" required:"true"` + // * InProgress + // + // * Completed + // + // * Failed + Status *TrialComponentStatus `type:"structure"` + + // The Amazon Resource Name (ARN) of the trial component. + TrialComponentArn *string `type:"string"` + + // The name of the trial component. + TrialComponentName *string `min:"1" type:"string"` } // String returns the string representation -func (s AlgorithmValidationSpecification) String() string { +func (s DescribeTrialComponentOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AlgorithmValidationSpecification) GoString() string { +func (s DescribeTrialComponentOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AlgorithmValidationSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AlgorithmValidationSpecification"} - if s.ValidationProfiles == nil { - invalidParams.Add(request.NewErrParamRequired("ValidationProfiles")) - } - if s.ValidationProfiles != nil && len(s.ValidationProfiles) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ValidationProfiles", 1)) - } - if s.ValidationRole == nil { - invalidParams.Add(request.NewErrParamRequired("ValidationRole")) - } - if s.ValidationRole != nil && len(*s.ValidationRole) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ValidationRole", 20)) - } - if s.ValidationProfiles != nil { - for i, v := range s.ValidationProfiles { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ValidationProfiles", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCreatedBy sets the CreatedBy field's value. +func (s *DescribeTrialComponentOutput) SetCreatedBy(v *UserContext) *DescribeTrialComponentOutput { + s.CreatedBy = v + return s } -// SetValidationProfiles sets the ValidationProfiles field's value. -func (s *AlgorithmValidationSpecification) SetValidationProfiles(v []*AlgorithmValidationProfile) *AlgorithmValidationSpecification { - s.ValidationProfiles = v +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeTrialComponentOutput) SetCreationTime(v time.Time) *DescribeTrialComponentOutput { + s.CreationTime = &v return s } -// SetValidationRole sets the ValidationRole field's value. -func (s *AlgorithmValidationSpecification) SetValidationRole(v string) *AlgorithmValidationSpecification { - s.ValidationRole = &v +// SetDisplayName sets the DisplayName field's value. +func (s *DescribeTrialComponentOutput) SetDisplayName(v string) *DescribeTrialComponentOutput { + s.DisplayName = &v return s } -// Configures how labels are consolidated across human workers. -type AnnotationConsolidationConfig struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of a Lambda function implements the logic - // for annotation consolidation. - // - // For the built-in bounding box, image classification, semantic segmentation, - // and text classification task types, Amazon SageMaker Ground Truth provides - // the following Lambda functions: - // - // * Bounding box - Finds the most similar boxes from different workers based - // on the Jaccard index of the boxes. arn:aws:lambda:us-east-1:432418664414:function:ACS-BoundingBox - // arn:aws:lambda:us-east-2:266458841044:function:ACS-BoundingBox arn:aws:lambda:us-west-2:081040173940:function:ACS-BoundingBox - // arn:aws:lambda:eu-west-1:568282634449:function:ACS-BoundingBox arn:aws:lambda:ap-northeast-1:477331159723:function:ACS-BoundingBox - // arn:aws:lambda:ap-southeast-2:454466003867:function:ACS-BoundingBox arn:aws:lambda:ap-south-1:565803892007:function:ACS-BoundingBox - // arn:aws:lambda:eu-central-1:203001061592:function:ACS-BoundingBox arn:aws:lambda:ap-northeast-2:845288260483:function:ACS-BoundingBox - // arn:aws:lambda:eu-west-2:487402164563:function:ACS-BoundingBox arn:aws:lambda:ap-southeast-1:377565633583:function:ACS-BoundingBox - // arn:aws:lambda:ca-central-1:918755190332:function:ACS-BoundingBox - // - // * Image classification - Uses a variant of the Expectation Maximization - // approach to estimate the true class of an image based on annotations from - // individual workers. arn:aws:lambda:us-east-1:432418664414:function:ACS-ImageMultiClass - // arn:aws:lambda:us-east-2:266458841044:function:ACS-ImageMultiClass arn:aws:lambda:us-west-2:081040173940:function:ACS-ImageMultiClass - // arn:aws:lambda:eu-west-1:568282634449:function:ACS-ImageMultiClass arn:aws:lambda:ap-northeast-1:477331159723:function:ACS-ImageMultiClass - // arn:aws:lambda:ap-southeast-2:454466003867:function:ACS-ImageMultiClass - // arn:aws:lambda:ap-south-1:565803892007:function:ACS-ImageMultiClass arn:aws:lambda:eu-central-1:203001061592:function:ACS-ImageMultiClass - // arn:aws:lambda:ap-northeast-2:845288260483:function:ACS-ImageMultiClass - // arn:aws:lambda:eu-west-2:487402164563:function:ACS-ImageMultiClass arn:aws:lambda:ap-southeast-1:377565633583:function:ACS-ImageMultiClass - // arn:aws:lambda:ca-central-1:918755190332:function:ACS-ImageMultiClass - // - // * Semantic segmentation - Treats each pixel in an image as a multi-class - // classification and treats pixel annotations from workers as "votes" for - // the correct label. arn:aws:lambda:us-east-1:432418664414:function:ACS-SemanticSegmentation - // arn:aws:lambda:us-east-2:266458841044:function:ACS-SemanticSegmentation - // arn:aws:lambda:us-west-2:081040173940:function:ACS-SemanticSegmentation - // arn:aws:lambda:eu-west-1:568282634449:function:ACS-SemanticSegmentation - // arn:aws:lambda:ap-northeast-1:477331159723:function:ACS-SemanticSegmentation - // arn:aws:lambda:ap-southeast-2:454466003867:function:ACS-SemanticSegmentation - // arn:aws:lambda:ap-south-1:565803892007:function:ACS-SemanticSegmentation - // arn:aws:lambda:eu-central-1:203001061592:function:ACS-SemanticSegmentation - // arn:aws:lambda:ap-northeast-2:845288260483:function:ACS-SemanticSegmentation - // arn:aws:lambda:eu-west-2:487402164563:function:ACS-SemanticSegmentation - // arn:aws:lambda:ap-southeast-1:377565633583:function:ACS-SemanticSegmentation - // arn:aws:lambda:ca-central-1:918755190332:function:ACS-SemanticSegmentation - // - // * Text classification - Uses a variant of the Expectation Maximization - // approach to estimate the true class of text based on annotations from - // individual workers. arn:aws:lambda:us-east-1:432418664414:function:ACS-TextMultiClass - // arn:aws:lambda:us-east-2:266458841044:function:ACS-TextMultiClass arn:aws:lambda:us-west-2:081040173940:function:ACS-TextMultiClass - // arn:aws:lambda:eu-west-1:568282634449:function:ACS-TextMultiClass arn:aws:lambda:ap-northeast-1:477331159723:function:ACS-TextMultiClass - // arn:aws:lambda:ap-southeast-2:454466003867:function:ACS-TextMultiClass - // arn:aws:lambda:ap-south-1:565803892007:function:ACS-TextMultiClass arn:aws:lambda:eu-central-1:203001061592:function:ACS-TextMultiClass - // arn:aws:lambda:ap-northeast-2:845288260483:function:ACS-TextMultiClass - // arn:aws:lambda:eu-west-2:487402164563:function:ACS-TextMultiClass arn:aws:lambda:ap-southeast-1:377565633583:function:ACS-TextMultiClass - // arn:aws:lambda:ca-central-1:918755190332:function:ACS-TextMultiClass - // - // * Named entity eecognition - Groups similar selections and calculates - // aggregate boundaries, resolving to most-assigned label. arn:aws:lambda:us-east-1:432418664414:function:ACS-NamedEntityRecognition - // arn:aws:lambda:us-east-2:266458841044:function:ACS-NamedEntityRecognition - // arn:aws:lambda:us-west-2:081040173940:function:ACS-NamedEntityRecognition - // arn:aws:lambda:eu-west-1:568282634449:function:ACS-NamedEntityRecognition - // arn:aws:lambda:ap-northeast-1:477331159723:function:ACS-NamedEntityRecognition - // arn:aws:lambda:ap-southeast-2:454466003867:function:ACS-NamedEntityRecognition - // arn:aws:lambda:ap-south-1:565803892007:function:ACS-NamedEntityRecognition - // arn:aws:lambda:eu-central-1:203001061592:function:ACS-NamedEntityRecognition - // arn:aws:lambda:ap-northeast-2:845288260483:function:ACS-NamedEntityRecognition - // arn:aws:lambda:eu-west-2:487402164563:function:ACS-NamedEntityRecognition - // arn:aws:lambda:ap-southeast-1:377565633583:function:ACS-NamedEntityRecognition - // arn:aws:lambda:ca-central-1:918755190332:function:ACS-NamedEntityRecognition - // - // For more information, see Annotation Consolidation (https://docs.aws.amazon.com/sagemaker/latest/dg/sms-annotation-consolidation.html). - // - // AnnotationConsolidationLambdaArn is a required field - AnnotationConsolidationLambdaArn *string `type:"string" required:"true"` +// SetEndTime sets the EndTime field's value. +func (s *DescribeTrialComponentOutput) SetEndTime(v time.Time) *DescribeTrialComponentOutput { + s.EndTime = &v + return s } -// String returns the string representation -func (s AnnotationConsolidationConfig) String() string { - return awsutil.Prettify(s) +// SetInputArtifacts sets the InputArtifacts field's value. +func (s *DescribeTrialComponentOutput) SetInputArtifacts(v map[string]*TrialComponentArtifact) *DescribeTrialComponentOutput { + s.InputArtifacts = v + return s } -// GoString returns the string representation -func (s AnnotationConsolidationConfig) GoString() string { - return s.String() +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *DescribeTrialComponentOutput) SetLastModifiedBy(v *UserContext) *DescribeTrialComponentOutput { + s.LastModifiedBy = v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnnotationConsolidationConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnnotationConsolidationConfig"} - if s.AnnotationConsolidationLambdaArn == nil { - invalidParams.Add(request.NewErrParamRequired("AnnotationConsolidationLambdaArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeTrialComponentOutput) SetLastModifiedTime(v time.Time) *DescribeTrialComponentOutput { + s.LastModifiedTime = &v + return s } -// SetAnnotationConsolidationLambdaArn sets the AnnotationConsolidationLambdaArn field's value. -func (s *AnnotationConsolidationConfig) SetAnnotationConsolidationLambdaArn(v string) *AnnotationConsolidationConfig { - s.AnnotationConsolidationLambdaArn = &v +// SetMetrics sets the Metrics field's value. +func (s *DescribeTrialComponentOutput) SetMetrics(v []*TrialComponentMetricSummary) *DescribeTrialComponentOutput { + s.Metrics = v return s } -// A list of categorical hyperparameters to tune. -type CategoricalParameterRange struct { - _ struct{} `type:"structure"` - - // The name of the categorical hyperparameter to tune. - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // A list of the categories for the hyperparameter. - // - // Values is a required field - Values []*string `min:"1" type:"list" required:"true"` +// SetOutputArtifacts sets the OutputArtifacts field's value. +func (s *DescribeTrialComponentOutput) SetOutputArtifacts(v map[string]*TrialComponentArtifact) *DescribeTrialComponentOutput { + s.OutputArtifacts = v + return s } -// String returns the string representation -func (s CategoricalParameterRange) String() string { - return awsutil.Prettify(s) +// SetParameters sets the Parameters field's value. +func (s *DescribeTrialComponentOutput) SetParameters(v map[string]*TrialComponentParameterValue) *DescribeTrialComponentOutput { + s.Parameters = v + return s } -// GoString returns the string representation -func (s CategoricalParameterRange) GoString() string { - return s.String() +// SetSource sets the Source field's value. +func (s *DescribeTrialComponentOutput) SetSource(v *TrialComponentSource) *DescribeTrialComponentOutput { + s.Source = v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CategoricalParameterRange) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CategoricalParameterRange"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) - } - if s.Values != nil && len(s.Values) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Values", 1)) - } +// SetStartTime sets the StartTime field's value. +func (s *DescribeTrialComponentOutput) SetStartTime(v time.Time) *DescribeTrialComponentOutput { + s.StartTime = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetStatus sets the Status field's value. +func (s *DescribeTrialComponentOutput) SetStatus(v *TrialComponentStatus) *DescribeTrialComponentOutput { + s.Status = v + return s } -// SetName sets the Name field's value. -func (s *CategoricalParameterRange) SetName(v string) *CategoricalParameterRange { - s.Name = &v +// SetTrialComponentArn sets the TrialComponentArn field's value. +func (s *DescribeTrialComponentOutput) SetTrialComponentArn(v string) *DescribeTrialComponentOutput { + s.TrialComponentArn = &v return s } -// SetValues sets the Values field's value. -func (s *CategoricalParameterRange) SetValues(v []*string) *CategoricalParameterRange { - s.Values = v +// SetTrialComponentName sets the TrialComponentName field's value. +func (s *DescribeTrialComponentOutput) SetTrialComponentName(v string) *DescribeTrialComponentOutput { + s.TrialComponentName = &v return s } -// Defines the possible values for a categorical hyperparameter. -type CategoricalParameterRangeSpecification struct { +type DescribeTrialInput struct { _ struct{} `type:"structure"` - // The allowed categories for the hyperparameter. + // The name of the trial to describe. // - // Values is a required field - Values []*string `min:"1" type:"list" required:"true"` + // TrialName is a required field + TrialName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s CategoricalParameterRangeSpecification) String() string { +func (s DescribeTrialInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CategoricalParameterRangeSpecification) GoString() string { +func (s DescribeTrialInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CategoricalParameterRangeSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CategoricalParameterRangeSpecification"} - if s.Values == nil { - invalidParams.Add(request.NewErrParamRequired("Values")) +func (s *DescribeTrialInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTrialInput"} + if s.TrialName == nil { + invalidParams.Add(request.NewErrParamRequired("TrialName")) } - if s.Values != nil && len(s.Values) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Values", 1)) + if s.TrialName != nil && len(*s.TrialName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialName", 1)) } if invalidParams.Len() > 0 { @@ -7788,217 +26079,140 @@ func (s *CategoricalParameterRangeSpecification) Validate() error { return nil } -// SetValues sets the Values field's value. -func (s *CategoricalParameterRangeSpecification) SetValues(v []*string) *CategoricalParameterRangeSpecification { - s.Values = v +// SetTrialName sets the TrialName field's value. +func (s *DescribeTrialInput) SetTrialName(v string) *DescribeTrialInput { + s.TrialName = &v return s } -// A channel is a named input source that training algorithms can consume. -type Channel struct { +type DescribeTrialOutput struct { _ struct{} `type:"structure"` - // The name of the channel. - // - // ChannelName is a required field - ChannelName *string `min:"1" type:"string" required:"true"` - - // If training data is compressed, the compression type. The default value is - // None. CompressionType is used only in Pipe input mode. In File mode, leave - // this field unset or set it to None. - CompressionType *string `type:"string" enum:"CompressionType"` - - // The MIME type of the data. - ContentType *string `type:"string"` - - // The location of the channel data. - // - // DataSource is a required field - DataSource *DataSource `type:"structure" required:"true"` - - // (Optional) The input mode to use for the data channel in a training job. - // If you don't set a value for InputMode, Amazon SageMaker uses the value set - // for TrainingInputMode. Use this parameter to override the TrainingInputMode - // setting in a AlgorithmSpecification request when you have a channel that - // needs a different input mode from the training job's general setting. To - // download the data from Amazon Simple Storage Service (Amazon S3) to the provisioned - // ML storage volume, and mount the directory to a Docker volume, use File input - // mode. To stream data directly from Amazon S3 to the container, choose Pipe - // input mode. - // - // To use a model for incremental training, choose File input model. - InputMode *string `type:"string" enum:"TrainingInputMode"` + // Who created the trial. + CreatedBy *UserContext `type:"structure"` - // Specify RecordIO as the value when input data is in raw format but the training - // algorithm requires the RecordIO format. In this case, Amazon SageMaker wraps - // each individual S3 object in a RecordIO record. If the input data is already - // in RecordIO format, you don't need to set this attribute. For more information, - // see Create a Dataset Using RecordIO (https://mxnet.incubator.apache.org/architecture/note_data_loading.html#data-format). - // - // In File mode, leave this field unset or set it to None. - RecordWrapperType *string `type:"string" enum:"RecordWrapper"` + // When the trial was created. + CreationTime *time.Time `type:"timestamp"` - // A configuration for a shuffle option for input data in a channel. If you - // use S3Prefix for S3DataType, this shuffles the results of the S3 key prefix - // matches. If you use ManifestFile, the order of the S3 object references in - // the ManifestFile is shuffled. If you use AugmentedManifestFile, the order - // of the JSON lines in the AugmentedManifestFile is shuffled. The shuffling - // order is determined using the Seed value. - // - // For Pipe input mode, shuffling is done at the start of every epoch. With - // large datasets this ensures that the order of the training data is different - // for each epoch, it helps reduce bias and possible overfitting. In a multi-node - // training job when ShuffleConfig is combined with S3DataDistributionType of - // ShardedByS3Key, the data is shuffled across nodes so that the content sent - // to a particular node on the first epoch might be sent to a different node - // on the second epoch. - ShuffleConfig *ShuffleConfig `type:"structure"` + // The name of the trial as displayed. If DisplayName isn't specified, TrialName + // is displayed. + DisplayName *string `min:"1" type:"string"` + + // The name of the experiment the trial is part of. + ExperimentName *string `min:"1" type:"string"` + + // Who last modified the trial. + LastModifiedBy *UserContext `type:"structure"` + + // When the trial was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of the source and, optionally, the job type. + Source *TrialSource `type:"structure"` + + // The Amazon Resource Name (ARN) of the trial. + TrialArn *string `type:"string"` + + // The name of the trial. + TrialName *string `min:"1" type:"string"` } // String returns the string representation -func (s Channel) String() string { +func (s DescribeTrialOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Channel) GoString() string { +func (s DescribeTrialOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *Channel) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Channel"} - if s.ChannelName == nil { - invalidParams.Add(request.NewErrParamRequired("ChannelName")) - } - if s.ChannelName != nil && len(*s.ChannelName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ChannelName", 1)) - } - if s.DataSource == nil { - invalidParams.Add(request.NewErrParamRequired("DataSource")) - } - if s.DataSource != nil { - if err := s.DataSource.Validate(); err != nil { - invalidParams.AddNested("DataSource", err.(request.ErrInvalidParams)) - } - } - if s.ShuffleConfig != nil { - if err := s.ShuffleConfig.Validate(); err != nil { - invalidParams.AddNested("ShuffleConfig", err.(request.ErrInvalidParams)) - } - } +// SetCreatedBy sets the CreatedBy field's value. +func (s *DescribeTrialOutput) SetCreatedBy(v *UserContext) *DescribeTrialOutput { + s.CreatedBy = v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeTrialOutput) SetCreationTime(v time.Time) *DescribeTrialOutput { + s.CreationTime = &v + return s } -// SetChannelName sets the ChannelName field's value. -func (s *Channel) SetChannelName(v string) *Channel { - s.ChannelName = &v +// SetDisplayName sets the DisplayName field's value. +func (s *DescribeTrialOutput) SetDisplayName(v string) *DescribeTrialOutput { + s.DisplayName = &v return s } -// SetCompressionType sets the CompressionType field's value. -func (s *Channel) SetCompressionType(v string) *Channel { - s.CompressionType = &v +// SetExperimentName sets the ExperimentName field's value. +func (s *DescribeTrialOutput) SetExperimentName(v string) *DescribeTrialOutput { + s.ExperimentName = &v return s } -// SetContentType sets the ContentType field's value. -func (s *Channel) SetContentType(v string) *Channel { - s.ContentType = &v +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *DescribeTrialOutput) SetLastModifiedBy(v *UserContext) *DescribeTrialOutput { + s.LastModifiedBy = v return s } -// SetDataSource sets the DataSource field's value. -func (s *Channel) SetDataSource(v *DataSource) *Channel { - s.DataSource = v +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeTrialOutput) SetLastModifiedTime(v time.Time) *DescribeTrialOutput { + s.LastModifiedTime = &v return s } -// SetInputMode sets the InputMode field's value. -func (s *Channel) SetInputMode(v string) *Channel { - s.InputMode = &v +// SetSource sets the Source field's value. +func (s *DescribeTrialOutput) SetSource(v *TrialSource) *DescribeTrialOutput { + s.Source = v return s } -// SetRecordWrapperType sets the RecordWrapperType field's value. -func (s *Channel) SetRecordWrapperType(v string) *Channel { - s.RecordWrapperType = &v +// SetTrialArn sets the TrialArn field's value. +func (s *DescribeTrialOutput) SetTrialArn(v string) *DescribeTrialOutput { + s.TrialArn = &v return s } -// SetShuffleConfig sets the ShuffleConfig field's value. -func (s *Channel) SetShuffleConfig(v *ShuffleConfig) *Channel { - s.ShuffleConfig = v +// SetTrialName sets the TrialName field's value. +func (s *DescribeTrialOutput) SetTrialName(v string) *DescribeTrialOutput { + s.TrialName = &v return s } -// Defines a named input source, called a channel, to be used by an algorithm. -type ChannelSpecification struct { +type DescribeUserProfileInput struct { _ struct{} `type:"structure"` - // A brief description of the channel. - Description *string `type:"string"` - - // Indicates whether the channel is required by the algorithm. - IsRequired *bool `type:"boolean"` - - // The name of the channel. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The allowed compression types, if data compression is used. - SupportedCompressionTypes []*string `type:"list"` - - // The supported MIME types for the data. + // The domain ID. // - // SupportedContentTypes is a required field - SupportedContentTypes []*string `type:"list" required:"true"` + // DomainId is a required field + DomainId *string `type:"string" required:"true"` - // The allowed input mode, either FILE or PIPE. - // - // In FILE mode, Amazon SageMaker copies the data from the input source onto - // the local Amazon Elastic Block Store (Amazon EBS) volumes before starting - // your training algorithm. This is the most commonly used input mode. - // - // In PIPE mode, Amazon SageMaker streams input data from the source directly - // to your algorithm without using the EBS volume. + // The user profile name. // - // SupportedInputModes is a required field - SupportedInputModes []*string `min:"1" type:"list" required:"true"` + // UserProfileName is a required field + UserProfileName *string `type:"string" required:"true"` } // String returns the string representation -func (s ChannelSpecification) String() string { +func (s DescribeUserProfileInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ChannelSpecification) GoString() string { +func (s DescribeUserProfileInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ChannelSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ChannelSpecification"} - 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.SupportedContentTypes == nil { - invalidParams.Add(request.NewErrParamRequired("SupportedContentTypes")) +func (s *DescribeUserProfileInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeUserProfileInput"} + if s.DomainId == nil { + invalidParams.Add(request.NewErrParamRequired("DomainId")) } - if s.SupportedInputModes == nil { - invalidParams.Add(request.NewErrParamRequired("SupportedInputModes")) - } - if s.SupportedInputModes != nil && len(s.SupportedInputModes) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SupportedInputModes", 1)) + if s.UserProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("UserProfileName")) } if invalidParams.Len() > 0 { @@ -8007,73 +26221,160 @@ func (s *ChannelSpecification) Validate() error { return nil } -// SetDescription sets the Description field's value. -func (s *ChannelSpecification) SetDescription(v string) *ChannelSpecification { - s.Description = &v +// SetDomainId sets the DomainId field's value. +func (s *DescribeUserProfileInput) SetDomainId(v string) *DescribeUserProfileInput { + s.DomainId = &v return s } -// SetIsRequired sets the IsRequired field's value. -func (s *ChannelSpecification) SetIsRequired(v bool) *ChannelSpecification { - s.IsRequired = &v +// SetUserProfileName sets the UserProfileName field's value. +func (s *DescribeUserProfileInput) SetUserProfileName(v string) *DescribeUserProfileInput { + s.UserProfileName = &v return s } -// SetName sets the Name field's value. -func (s *ChannelSpecification) SetName(v string) *ChannelSpecification { - s.Name = &v +type DescribeUserProfileOutput struct { + _ struct{} `type:"structure"` + + // The creation time. + CreationTime *time.Time `type:"timestamp"` + + // The domain ID. + DomainId *string `type:"string"` + + // The failure reason. + FailureReason *string `type:"string"` + + // The homa Amazon Elastic File System (EFS) Uid. + HomeEfsFileSystemUid *string `type:"string"` + + // The last modified time. + LastModifiedTime *time.Time `type:"timestamp"` + + // The SSO user identifier. + SingleSignOnUserIdentifier *string `type:"string"` + + // The SSO user value. + SingleSignOnUserValue *string `type:"string"` + + // The status. + Status *string `type:"string" enum:"UserProfileStatus"` + + // The user profile Amazon Resource Name (ARN). + UserProfileArn *string `type:"string"` + + // The user profile name. + UserProfileName *string `type:"string"` + + // A collection of settings. + UserSettings *UserSettings `type:"structure"` +} + +// String returns the string representation +func (s DescribeUserProfileOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeUserProfileOutput) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *DescribeUserProfileOutput) SetCreationTime(v time.Time) *DescribeUserProfileOutput { + s.CreationTime = &v return s } -// SetSupportedCompressionTypes sets the SupportedCompressionTypes field's value. -func (s *ChannelSpecification) SetSupportedCompressionTypes(v []*string) *ChannelSpecification { - s.SupportedCompressionTypes = v +// SetDomainId sets the DomainId field's value. +func (s *DescribeUserProfileOutput) SetDomainId(v string) *DescribeUserProfileOutput { + s.DomainId = &v return s } -// SetSupportedContentTypes sets the SupportedContentTypes field's value. -func (s *ChannelSpecification) SetSupportedContentTypes(v []*string) *ChannelSpecification { - s.SupportedContentTypes = v +// SetFailureReason sets the FailureReason field's value. +func (s *DescribeUserProfileOutput) SetFailureReason(v string) *DescribeUserProfileOutput { + s.FailureReason = &v return s } -// SetSupportedInputModes sets the SupportedInputModes field's value. -func (s *ChannelSpecification) SetSupportedInputModes(v []*string) *ChannelSpecification { - s.SupportedInputModes = v +// SetHomeEfsFileSystemUid sets the HomeEfsFileSystemUid field's value. +func (s *DescribeUserProfileOutput) SetHomeEfsFileSystemUid(v string) *DescribeUserProfileOutput { + s.HomeEfsFileSystemUid = &v return s } -// Contains information about the output location for managed spot training -// checkpoint data. -type CheckpointConfig struct { - _ struct{} `type:"structure"` +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DescribeUserProfileOutput) SetLastModifiedTime(v time.Time) *DescribeUserProfileOutput { + s.LastModifiedTime = &v + return s +} - // (Optional) The local directory where checkpoints are written. The default - // directory is /opt/ml/checkpoints/. - LocalPath *string `type:"string"` +// SetSingleSignOnUserIdentifier sets the SingleSignOnUserIdentifier field's value. +func (s *DescribeUserProfileOutput) SetSingleSignOnUserIdentifier(v string) *DescribeUserProfileOutput { + s.SingleSignOnUserIdentifier = &v + return s +} - // Identifies the S3 path where you want Amazon SageMaker to store checkpoints. - // For example, s3://bucket-name/key-name-prefix. +// SetSingleSignOnUserValue sets the SingleSignOnUserValue field's value. +func (s *DescribeUserProfileOutput) SetSingleSignOnUserValue(v string) *DescribeUserProfileOutput { + s.SingleSignOnUserValue = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeUserProfileOutput) SetStatus(v string) *DescribeUserProfileOutput { + s.Status = &v + return s +} + +// SetUserProfileArn sets the UserProfileArn field's value. +func (s *DescribeUserProfileOutput) SetUserProfileArn(v string) *DescribeUserProfileOutput { + s.UserProfileArn = &v + return s +} + +// SetUserProfileName sets the UserProfileName field's value. +func (s *DescribeUserProfileOutput) SetUserProfileName(v string) *DescribeUserProfileOutput { + s.UserProfileName = &v + return s +} + +// SetUserSettings sets the UserSettings field's value. +func (s *DescribeUserProfileOutput) SetUserSettings(v *UserSettings) *DescribeUserProfileOutput { + s.UserSettings = v + return s +} + +type DescribeWorkforceInput struct { + _ struct{} `type:"structure"` + + // The name of the private workforce whose access you want to restrict. WorkforceName + // is automatically set to default when a workforce is created and cannot be + // modified. // - // S3Uri is a required field - S3Uri *string `type:"string" required:"true"` + // WorkforceName is a required field + WorkforceName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s CheckpointConfig) String() string { +func (s DescribeWorkforceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CheckpointConfig) GoString() string { +func (s DescribeWorkforceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CheckpointConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CheckpointConfig"} - if s.S3Uri == nil { - invalidParams.Add(request.NewErrParamRequired("S3Uri")) +func (s *DescribeWorkforceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeWorkforceInput"} + if s.WorkforceName == nil { + invalidParams.Add(request.NewErrParamRequired("WorkforceName")) + } + if s.WorkforceName != nil && len(*s.WorkforceName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("WorkforceName", 1)) } if invalidParams.Len() > 0 { @@ -8082,141 +26383,141 @@ func (s *CheckpointConfig) Validate() error { return nil } -// SetLocalPath sets the LocalPath field's value. -func (s *CheckpointConfig) SetLocalPath(v string) *CheckpointConfig { - s.LocalPath = &v - return s -} - -// SetS3Uri sets the S3Uri field's value. -func (s *CheckpointConfig) SetS3Uri(v string) *CheckpointConfig { - s.S3Uri = &v +// SetWorkforceName sets the WorkforceName field's value. +func (s *DescribeWorkforceInput) SetWorkforceName(v string) *DescribeWorkforceInput { + s.WorkforceName = &v return s } -// Specifies summary information about a Git repository. -type CodeRepositorySummary struct { +type DescribeWorkforceOutput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the Git repository. + // A single private workforce, which is automatically created when you create + // your first private work team. You can create one private work force in each + // AWS Region. By default, any workforce-related API operation used in a specific + // region will apply to the workforce created in that region. To learn how to + // create a private workforce, see Create a Private Workforce (https://docs.aws.amazon.com/sagemaker/latest/dg/sms-workforce-create-private.html). // - // CodeRepositoryArn is a required field - CodeRepositoryArn *string `min:"1" type:"string" required:"true"` + // Workforce is a required field + Workforce *Workforce `type:"structure" required:"true"` +} - // The name of the Git repository. - // - // CodeRepositoryName is a required field - CodeRepositoryName *string `min:"1" type:"string" required:"true"` +// String returns the string representation +func (s DescribeWorkforceOutput) String() string { + return awsutil.Prettify(s) +} - // The date and time that the Git repository was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` +// GoString returns the string representation +func (s DescribeWorkforceOutput) GoString() string { + return s.String() +} - // Configuration details for the Git repository, including the URL where it - // is located and the ARN of the AWS Secrets Manager secret that contains the - // credentials used to access the repository. - GitConfig *GitConfig `type:"structure"` +// SetWorkforce sets the Workforce field's value. +func (s *DescribeWorkforceOutput) SetWorkforce(v *Workforce) *DescribeWorkforceOutput { + s.Workforce = v + return s +} - // The date and time that the Git repository was last modified. +type DescribeWorkteamInput struct { + _ struct{} `type:"structure"` + + // The name of the work team to return a description of. // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `type:"timestamp" required:"true"` + // WorkteamName is a required field + WorkteamName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s CodeRepositorySummary) String() string { +func (s DescribeWorkteamInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CodeRepositorySummary) GoString() string { +func (s DescribeWorkteamInput) GoString() string { return s.String() } -// SetCodeRepositoryArn sets the CodeRepositoryArn field's value. -func (s *CodeRepositorySummary) SetCodeRepositoryArn(v string) *CodeRepositorySummary { - s.CodeRepositoryArn = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeWorkteamInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeWorkteamInput"} + if s.WorkteamName == nil { + invalidParams.Add(request.NewErrParamRequired("WorkteamName")) + } + if s.WorkteamName != nil && len(*s.WorkteamName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("WorkteamName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetCodeRepositoryName sets the CodeRepositoryName field's value. -func (s *CodeRepositorySummary) SetCodeRepositoryName(v string) *CodeRepositorySummary { - s.CodeRepositoryName = &v +// SetWorkteamName sets the WorkteamName field's value. +func (s *DescribeWorkteamInput) SetWorkteamName(v string) *DescribeWorkteamInput { + s.WorkteamName = &v return s } -// SetCreationTime sets the CreationTime field's value. -func (s *CodeRepositorySummary) SetCreationTime(v time.Time) *CodeRepositorySummary { - s.CreationTime = &v - return s +type DescribeWorkteamOutput struct { + _ struct{} `type:"structure"` + + // A Workteam instance that contains information about the work team. + // + // Workteam is a required field + Workteam *Workteam `type:"structure" required:"true"` } -// SetGitConfig sets the GitConfig field's value. -func (s *CodeRepositorySummary) SetGitConfig(v *GitConfig) *CodeRepositorySummary { - s.GitConfig = v - return s +// String returns the string representation +func (s DescribeWorkteamOutput) String() string { + return awsutil.Prettify(s) } -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *CodeRepositorySummary) SetLastModifiedTime(v time.Time) *CodeRepositorySummary { - s.LastModifiedTime = &v +// GoString returns the string representation +func (s DescribeWorkteamOutput) GoString() string { + return s.String() +} + +// SetWorkteam sets the Workteam field's value. +func (s *DescribeWorkteamOutput) SetWorkteam(v *Workteam) *DescribeWorkteamOutput { + s.Workteam = v return s } -// Identifies a Amazon Cognito user group. A user group can be used in on or -// more work teams. -type CognitoMemberDefinition struct { +// Specifies weight and capacity values for a production variant. +type DesiredWeightAndCapacity struct { _ struct{} `type:"structure"` - // An identifier for an application client. You must create the app client ID - // using Amazon Cognito. - // - // ClientId is a required field - ClientId *string `min:"1" type:"string" required:"true"` + // The variant's capacity. + DesiredInstanceCount *int64 `min:"1" type:"integer"` - // An identifier for a user group. - // - // UserGroup is a required field - UserGroup *string `min:"1" type:"string" required:"true"` + // The variant's weight. + DesiredWeight *float64 `type:"float"` - // An identifier for a user pool. The user pool must be in the same region as - // the service that you are calling. + // The name of the variant to update. // - // UserPool is a required field - UserPool *string `min:"1" type:"string" required:"true"` + // VariantName is a required field + VariantName *string `type:"string" required:"true"` } // String returns the string representation -func (s CognitoMemberDefinition) String() string { +func (s DesiredWeightAndCapacity) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CognitoMemberDefinition) GoString() string { +func (s DesiredWeightAndCapacity) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CognitoMemberDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CognitoMemberDefinition"} - 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.UserGroup == nil { - invalidParams.Add(request.NewErrParamRequired("UserGroup")) - } - if s.UserGroup != nil && len(*s.UserGroup) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserGroup", 1)) - } - if s.UserPool == nil { - invalidParams.Add(request.NewErrParamRequired("UserPool")) +func (s *DesiredWeightAndCapacity) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DesiredWeightAndCapacity"} + if s.DesiredInstanceCount != nil && *s.DesiredInstanceCount < 1 { + invalidParams.Add(request.NewErrParamMinValue("DesiredInstanceCount", 1)) } - if s.UserPool != nil && len(*s.UserPool) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserPool", 1)) + if s.VariantName == nil { + invalidParams.Add(request.NewErrParamRequired("VariantName")) } if invalidParams.Len() > 0 { @@ -8225,367 +26526,282 @@ func (s *CognitoMemberDefinition) Validate() error { return nil } -// SetClientId sets the ClientId field's value. -func (s *CognitoMemberDefinition) SetClientId(v string) *CognitoMemberDefinition { - s.ClientId = &v +// SetDesiredInstanceCount sets the DesiredInstanceCount field's value. +func (s *DesiredWeightAndCapacity) SetDesiredInstanceCount(v int64) *DesiredWeightAndCapacity { + s.DesiredInstanceCount = &v return s } -// SetUserGroup sets the UserGroup field's value. -func (s *CognitoMemberDefinition) SetUserGroup(v string) *CognitoMemberDefinition { - s.UserGroup = &v +// SetDesiredWeight sets the DesiredWeight field's value. +func (s *DesiredWeightAndCapacity) SetDesiredWeight(v float64) *DesiredWeightAndCapacity { + s.DesiredWeight = &v return s } -// SetUserPool sets the UserPool field's value. -func (s *CognitoMemberDefinition) SetUserPool(v string) *CognitoMemberDefinition { - s.UserPool = &v +// SetVariantName sets the VariantName field's value. +func (s *DesiredWeightAndCapacity) SetVariantName(v string) *DesiredWeightAndCapacity { + s.VariantName = &v return s } -// A summary of a model compilation job. -type CompilationJobSummary struct { +type DisassociateTrialComponentInput struct { _ struct{} `type:"structure"` - // The time when the model compilation job completed. - CompilationEndTime *time.Time `type:"timestamp"` - - // The Amazon Resource Name (ARN) of the model compilation job. - // - // CompilationJobArn is a required field - CompilationJobArn *string `type:"string" required:"true"` - - // The name of the model compilation job that you want a summary for. - // - // CompilationJobName is a required field - CompilationJobName *string `min:"1" type:"string" required:"true"` - - // The status of the model compilation job. - // - // CompilationJobStatus is a required field - CompilationJobStatus *string `type:"string" required:"true" enum:"CompilationJobStatus"` - - // The time when the model compilation job started. - CompilationStartTime *time.Time `type:"timestamp"` - - // The type of device that the model will run on after compilation has completed. + // The name of the component to disassociate from the trial. // - // CompilationTargetDevice is a required field - CompilationTargetDevice *string `type:"string" required:"true" enum:"TargetDevice"` + // TrialComponentName is a required field + TrialComponentName *string `min:"1" type:"string" required:"true"` - // The time when the model compilation job was created. + // The name of the trial to disassociate from. // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` - - // The time when the model compilation job was last modified. - LastModifiedTime *time.Time `type:"timestamp"` + // TrialName is a required field + TrialName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s CompilationJobSummary) String() string { +func (s DisassociateTrialComponentInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CompilationJobSummary) GoString() string { +func (s DisassociateTrialComponentInput) GoString() string { return s.String() } -// SetCompilationEndTime sets the CompilationEndTime field's value. -func (s *CompilationJobSummary) SetCompilationEndTime(v time.Time) *CompilationJobSummary { - s.CompilationEndTime = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisassociateTrialComponentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisassociateTrialComponentInput"} + if s.TrialComponentName == nil { + invalidParams.Add(request.NewErrParamRequired("TrialComponentName")) + } + if s.TrialComponentName != nil && len(*s.TrialComponentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialComponentName", 1)) + } + if s.TrialName == nil { + invalidParams.Add(request.NewErrParamRequired("TrialName")) + } + if s.TrialName != nil && len(*s.TrialName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetCompilationJobArn sets the CompilationJobArn field's value. -func (s *CompilationJobSummary) SetCompilationJobArn(v string) *CompilationJobSummary { - s.CompilationJobArn = &v +// SetTrialComponentName sets the TrialComponentName field's value. +func (s *DisassociateTrialComponentInput) SetTrialComponentName(v string) *DisassociateTrialComponentInput { + s.TrialComponentName = &v return s } -// SetCompilationJobName sets the CompilationJobName field's value. -func (s *CompilationJobSummary) SetCompilationJobName(v string) *CompilationJobSummary { - s.CompilationJobName = &v +// SetTrialName sets the TrialName field's value. +func (s *DisassociateTrialComponentInput) SetTrialName(v string) *DisassociateTrialComponentInput { + s.TrialName = &v return s } -// SetCompilationJobStatus sets the CompilationJobStatus field's value. -func (s *CompilationJobSummary) SetCompilationJobStatus(v string) *CompilationJobSummary { - s.CompilationJobStatus = &v - return s +type DisassociateTrialComponentOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the trial. + TrialArn *string `type:"string"` + + // The ARN of the trial component. + TrialComponentArn *string `type:"string"` } -// SetCompilationStartTime sets the CompilationStartTime field's value. -func (s *CompilationJobSummary) SetCompilationStartTime(v time.Time) *CompilationJobSummary { - s.CompilationStartTime = &v - return s +// String returns the string representation +func (s DisassociateTrialComponentOutput) String() string { + return awsutil.Prettify(s) } -// SetCompilationTargetDevice sets the CompilationTargetDevice field's value. -func (s *CompilationJobSummary) SetCompilationTargetDevice(v string) *CompilationJobSummary { - s.CompilationTargetDevice = &v - return s +// GoString returns the string representation +func (s DisassociateTrialComponentOutput) GoString() string { + return s.String() } -// SetCreationTime sets the CreationTime field's value. -func (s *CompilationJobSummary) SetCreationTime(v time.Time) *CompilationJobSummary { - s.CreationTime = &v +// SetTrialArn sets the TrialArn field's value. +func (s *DisassociateTrialComponentOutput) SetTrialArn(v string) *DisassociateTrialComponentOutput { + s.TrialArn = &v return s } -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *CompilationJobSummary) SetLastModifiedTime(v time.Time) *CompilationJobSummary { - s.LastModifiedTime = &v +// SetTrialComponentArn sets the TrialComponentArn field's value. +func (s *DisassociateTrialComponentOutput) SetTrialComponentArn(v string) *DisassociateTrialComponentOutput { + s.TrialComponentArn = &v return s } -// Describes the container, as part of model definition. -type ContainerDefinition struct { +// The domain's details. +type DomainDetails struct { _ struct{} `type:"structure"` - // This parameter is ignored for models that contain only a PrimaryContainer. - // - // When a ContainerDefinition is part of an inference pipeline, the value of - // ths parameter uniquely identifies the container for the purposes of logging - // and metrics. For information, see Use Logs and Metrics to Monitor an Inference - // Pipeline (https://docs.aws.amazon.com/sagemaker/latest/dg/inference-pipeline-logs-metrics.html). - // If you don't specify a value for this parameter for a ContainerDefinition - // that is part of an inference pipeline, a unique name is automatically assigned - // based on the position of the ContainerDefinition in the pipeline. If you - // specify a value for the ContainerHostName for any ContainerDefinition that - // is part of an inference pipeline, you must specify a value for the ContainerHostName - // parameter of every ContainerDefinition in that pipeline. - ContainerHostname *string `type:"string"` + // The creation time. + CreationTime *time.Time `type:"timestamp"` - // The environment variables to set in the Docker container. Each key and value - // in the Environment string to string map can have length of up to 1024. We - // support up to 16 entries in the map. - Environment map[string]*string `type:"map"` + // The domain's Amazon Resource Name (ARN). + DomainArn *string `type:"string"` - // The Amazon EC2 Container Registry (Amazon ECR) path where inference code - // is stored. If you are using your own custom algorithm instead of an algorithm - // provided by Amazon SageMaker, the inference code must meet Amazon SageMaker - // requirements. Amazon SageMaker supports both registry/repository[:tag] and - // registry/repository[@digest] image path formats. For more information, see - // Using Your Own Algorithms with Amazon SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html) - Image *string `type:"string"` + // The domain ID. + DomainId *string `type:"string"` - // The S3 path where the model artifacts, which result from model training, - // are stored. This path must point to a single gzip compressed tar archive - // (.tar.gz suffix). The S3 path is required for Amazon SageMaker built-in algorithms, - // but not if you use your own algorithms. For more information on built-in - // algorithms, see Common Parameters (https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-algo-docker-registry-paths.html). - // - // If you provide a value for this parameter, Amazon SageMaker uses AWS Security - // Token Service to download model artifacts from the S3 path you provide. AWS - // STS is activated in your IAM user account by default. If you previously deactivated - // AWS STS for a region, you need to reactivate AWS STS for that region. For - // more information, see Activating and Deactivating AWS STS in an AWS Region - // (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) - // in the AWS Identity and Access Management User Guide. - // - // If you use a built-in algorithm to create a model, Amazon SageMaker requires - // that you provide a S3 path to the model artifacts in ModelDataUrl. - ModelDataUrl *string `type:"string"` + // The domain name. + DomainName *string `type:"string"` - // The name or Amazon Resource Name (ARN) of the model package to use to create - // the model. - ModelPackageName *string `min:"1" type:"string"` + // The last modified time. + LastModifiedTime *time.Time `type:"timestamp"` + + // The status. + Status *string `type:"string" enum:"DomainStatus"` + + // The domain's URL. + Url *string `type:"string"` } // String returns the string representation -func (s ContainerDefinition) String() string { +func (s DomainDetails) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ContainerDefinition) GoString() string { +func (s DomainDetails) 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.ModelPackageName != nil && len(*s.ModelPackageName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ModelPackageName", 1)) - } +// SetCreationTime sets the CreationTime field's value. +func (s *DomainDetails) SetCreationTime(v time.Time) *DomainDetails { + s.CreationTime = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetDomainArn sets the DomainArn field's value. +func (s *DomainDetails) SetDomainArn(v string) *DomainDetails { + s.DomainArn = &v + return s } -// SetContainerHostname sets the ContainerHostname field's value. -func (s *ContainerDefinition) SetContainerHostname(v string) *ContainerDefinition { - s.ContainerHostname = &v +// SetDomainId sets the DomainId field's value. +func (s *DomainDetails) SetDomainId(v string) *DomainDetails { + s.DomainId = &v return s } -// SetEnvironment sets the Environment field's value. -func (s *ContainerDefinition) SetEnvironment(v map[string]*string) *ContainerDefinition { - s.Environment = v +// SetDomainName sets the DomainName field's value. +func (s *DomainDetails) SetDomainName(v string) *DomainDetails { + s.DomainName = &v return s } -// SetImage sets the Image field's value. -func (s *ContainerDefinition) SetImage(v string) *ContainerDefinition { - s.Image = &v +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *DomainDetails) SetLastModifiedTime(v time.Time) *DomainDetails { + s.LastModifiedTime = &v return s } -// SetModelDataUrl sets the ModelDataUrl field's value. -func (s *ContainerDefinition) SetModelDataUrl(v string) *ContainerDefinition { - s.ModelDataUrl = &v +// SetStatus sets the Status field's value. +func (s *DomainDetails) SetStatus(v string) *DomainDetails { + s.Status = &v return s } -// SetModelPackageName sets the ModelPackageName field's value. -func (s *ContainerDefinition) SetModelPackageName(v string) *ContainerDefinition { - s.ModelPackageName = &v +// SetUrl sets the Url field's value. +func (s *DomainDetails) SetUrl(v string) *DomainDetails { + s.Url = &v return s } -// A list of continuous hyperparameters to tune. -type ContinuousParameterRange struct { +// Provides summary information for an endpoint configuration. +type EndpointConfigSummary struct { _ struct{} `type:"structure"` - // The maximum value for the hyperparameter. The tuning job uses floating-point - // values between MinValue value and this value for tuning. - // - // MaxValue is a required field - MaxValue *string `type:"string" required:"true"` - - // The minimum value for the hyperparameter. The tuning job uses floating-point - // values between this value and MaxValuefor tuning. + // A timestamp that shows when the endpoint configuration was created. // - // MinValue is a required field - MinValue *string `type:"string" required:"true"` + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` - // The name of the continuous hyperparameter to tune. + // The Amazon Resource Name (ARN) of the endpoint configuration. // - // Name is a required field - Name *string `type:"string" required:"true"` + // EndpointConfigArn is a required field + EndpointConfigArn *string `min:"20" type:"string" required:"true"` - // The scale that hyperparameter tuning uses to search the hyperparameter range. - // For information about choosing a hyperparameter scale, see Hyperparameter - // Scaling (https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-define-ranges.html#scaling-type). - // One of the following values: - // - // Auto - // - // Amazon SageMaker hyperparameter tuning chooses the best scale for the hyperparameter. - // - // Linear - // - // Hyperparameter tuning searches the values in the hyperparameter range by - // using a linear scale. - // - // Logarithmic - // - // Hyperparameter tuning searches the values in the hyperparameter range by - // using a logarithmic scale. - // - // Logarithmic scaling works only for ranges that have only values greater than - // 0. - // - // ReverseLogarithmic - // - // Hyperparemeter tuning searches the values in the hyperparameter range by - // using a reverse logarithmic scale. + // The name of the endpoint configuration. // - // Reverse logarithmic scaling works only for ranges that are entirely within - // the range 0<=x<1.0. - ScalingType *string `type:"string" enum:"HyperParameterScalingType"` + // EndpointConfigName is a required field + EndpointConfigName *string `type:"string" required:"true"` } // String returns the string representation -func (s ContinuousParameterRange) String() string { +func (s EndpointConfigSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ContinuousParameterRange) GoString() string { +func (s EndpointConfigSummary) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ContinuousParameterRange) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ContinuousParameterRange"} - if s.MaxValue == nil { - invalidParams.Add(request.NewErrParamRequired("MaxValue")) - } - if s.MinValue == nil { - invalidParams.Add(request.NewErrParamRequired("MinValue")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxValue sets the MaxValue field's value. -func (s *ContinuousParameterRange) SetMaxValue(v string) *ContinuousParameterRange { - s.MaxValue = &v - return s -} - -// SetMinValue sets the MinValue field's value. -func (s *ContinuousParameterRange) SetMinValue(v string) *ContinuousParameterRange { - s.MinValue = &v +// SetCreationTime sets the CreationTime field's value. +func (s *EndpointConfigSummary) SetCreationTime(v time.Time) *EndpointConfigSummary { + s.CreationTime = &v return s } -// SetName sets the Name field's value. -func (s *ContinuousParameterRange) SetName(v string) *ContinuousParameterRange { - s.Name = &v +// SetEndpointConfigArn sets the EndpointConfigArn field's value. +func (s *EndpointConfigSummary) SetEndpointConfigArn(v string) *EndpointConfigSummary { + s.EndpointConfigArn = &v return s } -// SetScalingType sets the ScalingType field's value. -func (s *ContinuousParameterRange) SetScalingType(v string) *ContinuousParameterRange { - s.ScalingType = &v +// SetEndpointConfigName sets the EndpointConfigName field's value. +func (s *EndpointConfigSummary) SetEndpointConfigName(v string) *EndpointConfigSummary { + s.EndpointConfigName = &v return s } -// Defines the possible values for a continuous hyperparameter. -type ContinuousParameterRangeSpecification struct { +// Input object for the endpoint +type EndpointInput struct { _ struct{} `type:"structure"` - // The maximum floating-point value allowed. + // An endpoint in customer's account which has enabled DataCaptureConfig enabled. // - // MaxValue is a required field - MaxValue *string `type:"string" required:"true"` + // EndpointName is a required field + EndpointName *string `type:"string" required:"true"` - // The minimum floating-point value allowed. + // Path to the filesystem where the endpoint data is available to the container. // - // MinValue is a required field - MinValue *string `type:"string" required:"true"` + // LocalPath is a required field + LocalPath *string `type:"string" required:"true"` + + // Whether input data distributed in Amazon S3 is fully replicated or sharded + // by an S3 key. Defauts to FullyReplicated + S3DataDistributionType *string `type:"string" enum:"ProcessingS3DataDistributionType"` + + // Whether the Pipe or File is used as the input mode for transfering data for + // the monitoring job. Pipe mode is recommended for large datasets. File mode + // is useful for small files that fit in memory. Defaults to File. + S3InputMode *string `type:"string" enum:"ProcessingS3InputMode"` } // String returns the string representation -func (s ContinuousParameterRangeSpecification) String() string { +func (s EndpointInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ContinuousParameterRangeSpecification) GoString() string { +func (s EndpointInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ContinuousParameterRangeSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ContinuousParameterRangeSpecification"} - if s.MaxValue == nil { - invalidParams.Add(request.NewErrParamRequired("MaxValue")) +func (s *EndpointInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EndpointInput"} + if s.EndpointName == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointName")) } - if s.MinValue == nil { - invalidParams.Add(request.NewErrParamRequired("MinValue")) + if s.LocalPath == nil { + invalidParams.Add(request.NewErrParamRequired("LocalPath")) } if invalidParams.Len() > 0 { @@ -8594,221 +26810,274 @@ func (s *ContinuousParameterRangeSpecification) Validate() error { return nil } -// SetMaxValue sets the MaxValue field's value. -func (s *ContinuousParameterRangeSpecification) SetMaxValue(v string) *ContinuousParameterRangeSpecification { - s.MaxValue = &v +// SetEndpointName sets the EndpointName field's value. +func (s *EndpointInput) SetEndpointName(v string) *EndpointInput { + s.EndpointName = &v return s } -// SetMinValue sets the MinValue field's value. -func (s *ContinuousParameterRangeSpecification) SetMinValue(v string) *ContinuousParameterRangeSpecification { - s.MinValue = &v +// SetLocalPath sets the LocalPath field's value. +func (s *EndpointInput) SetLocalPath(v string) *EndpointInput { + s.LocalPath = &v return s } -type CreateAlgorithmInput struct { - _ struct{} `type:"structure"` +// SetS3DataDistributionType sets the S3DataDistributionType field's value. +func (s *EndpointInput) SetS3DataDistributionType(v string) *EndpointInput { + s.S3DataDistributionType = &v + return s +} - // A description of the algorithm. - AlgorithmDescription *string `type:"string"` +// SetS3InputMode sets the S3InputMode field's value. +func (s *EndpointInput) SetS3InputMode(v string) *EndpointInput { + s.S3InputMode = &v + return s +} - // The name of the algorithm. +// Provides summary information for an endpoint. +type EndpointSummary struct { + _ struct{} `type:"structure"` + + // A timestamp that shows when the endpoint was created. // - // AlgorithmName is a required field - AlgorithmName *string `min:"1" type:"string" required:"true"` + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` - // Whether to certify the algorithm so that it can be listed in AWS Marketplace. - CertifyForMarketplace *bool `type:"boolean"` + // The Amazon Resource Name (ARN) of the endpoint. + // + // EndpointArn is a required field + EndpointArn *string `min:"20" type:"string" required:"true"` - // Specifies details about inference jobs that the algorithm runs, including - // the following: + // The name of the endpoint. // - // * The Amazon ECR paths of containers that contain the inference code and - // model artifacts. + // EndpointName is a required field + EndpointName *string `type:"string" required:"true"` + + // The status of the endpoint. // - // * The instance types that the algorithm supports for transform jobs and - // real-time endpoints used for inference. + // * OutOfService: Endpoint is not available to take incoming requests. // - // * The input and output content formats that the algorithm supports for - // inference. - InferenceSpecification *InferenceSpecification `type:"structure"` - - // Specifies details about training jobs run by this algorithm, including the - // following: + // * Creating: CreateEndpoint is executing. // - // * The Amazon ECR path of the container and the version digest of the algorithm. + // * Updating: UpdateEndpoint or UpdateEndpointWeightsAndCapacities is executing. // - // * The hyperparameters that the algorithm supports. + // * SystemUpdating: Endpoint is undergoing maintenance and cannot be updated + // or deleted or re-scaled until it has completed. This maintenance operation + // does not change any customer-specified values such as VPC config, KMS + // encryption, model, instance type, or instance count. // - // * The instance types that the algorithm supports for training. + // * RollingBack: Endpoint fails to scale up or down or change its variant + // weight and is in the process of rolling back to its previous configuration. + // Once the rollback completes, endpoint returns to an InService status. + // This transitional status only applies to an endpoint that has autoscaling + // enabled and is undergoing variant weight or capacity changes as part of + // an UpdateEndpointWeightsAndCapacities call or when the UpdateEndpointWeightsAndCapacities + // operation is called explicitly. // - // * Whether the algorithm supports distributed training. + // * InService: Endpoint is available to process incoming requests. // - // * The metrics that the algorithm emits to Amazon CloudWatch. + // * Deleting: DeleteEndpoint is executing. // - // * Which metrics that the algorithm emits can be used as the objective - // metric for hyperparameter tuning jobs. + // * Failed: Endpoint could not be created, updated, or re-scaled. Use DescribeEndpointOutput$FailureReason + // for information about the failure. DeleteEndpoint is the only operation + // that can be performed on a failed endpoint. // - // * The input channels that the algorithm supports for training data. For - // example, an algorithm might support train, validation, and test channels. + // To get a list of endpoints with a specified status, use the ListEndpointsInput$StatusEquals + // filter. // - // TrainingSpecification is a required field - TrainingSpecification *TrainingSpecification `type:"structure" required:"true"` + // EndpointStatus is a required field + EndpointStatus *string `type:"string" required:"true" enum:"EndpointStatus"` - // Specifies configurations for one or more training jobs and that Amazon SageMaker - // runs to test the algorithm's training code and, optionally, one or more batch - // transform jobs that Amazon SageMaker runs to test the algorithm's inference - // code. - ValidationSpecification *AlgorithmValidationSpecification `type:"structure"` + // A timestamp that shows when the endpoint was last modified. + // + // LastModifiedTime is a required field + LastModifiedTime *time.Time `type:"timestamp" required:"true"` } // String returns the string representation -func (s CreateAlgorithmInput) String() string { +func (s EndpointSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateAlgorithmInput) GoString() string { +func (s EndpointSummary) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAlgorithmInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAlgorithmInput"} - if s.AlgorithmName == nil { - invalidParams.Add(request.NewErrParamRequired("AlgorithmName")) - } - if s.AlgorithmName != nil && len(*s.AlgorithmName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AlgorithmName", 1)) - } - if s.TrainingSpecification == nil { - invalidParams.Add(request.NewErrParamRequired("TrainingSpecification")) - } - if s.InferenceSpecification != nil { - if err := s.InferenceSpecification.Validate(); err != nil { - invalidParams.AddNested("InferenceSpecification", err.(request.ErrInvalidParams)) - } - } - if s.TrainingSpecification != nil { - if err := s.TrainingSpecification.Validate(); err != nil { - invalidParams.AddNested("TrainingSpecification", err.(request.ErrInvalidParams)) - } - } - if s.ValidationSpecification != nil { - if err := s.ValidationSpecification.Validate(); err != nil { - invalidParams.AddNested("ValidationSpecification", err.(request.ErrInvalidParams)) - } - } +// SetCreationTime sets the CreationTime field's value. +func (s *EndpointSummary) SetCreationTime(v time.Time) *EndpointSummary { + s.CreationTime = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetEndpointArn sets the EndpointArn field's value. +func (s *EndpointSummary) SetEndpointArn(v string) *EndpointSummary { + s.EndpointArn = &v + return s } -// SetAlgorithmDescription sets the AlgorithmDescription field's value. -func (s *CreateAlgorithmInput) SetAlgorithmDescription(v string) *CreateAlgorithmInput { - s.AlgorithmDescription = &v +// SetEndpointName sets the EndpointName field's value. +func (s *EndpointSummary) SetEndpointName(v string) *EndpointSummary { + s.EndpointName = &v return s } -// SetAlgorithmName sets the AlgorithmName field's value. -func (s *CreateAlgorithmInput) SetAlgorithmName(v string) *CreateAlgorithmInput { - s.AlgorithmName = &v +// SetEndpointStatus sets the EndpointStatus field's value. +func (s *EndpointSummary) SetEndpointStatus(v string) *EndpointSummary { + s.EndpointStatus = &v return s } -// SetCertifyForMarketplace sets the CertifyForMarketplace field's value. -func (s *CreateAlgorithmInput) SetCertifyForMarketplace(v bool) *CreateAlgorithmInput { - s.CertifyForMarketplace = &v +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *EndpointSummary) SetLastModifiedTime(v time.Time) *EndpointSummary { + s.LastModifiedTime = &v return s } -// SetInferenceSpecification sets the InferenceSpecification field's value. -func (s *CreateAlgorithmInput) SetInferenceSpecification(v *InferenceSpecification) *CreateAlgorithmInput { - s.InferenceSpecification = v +// A summary of the properties of an experiment as returned by the Search API. +type Experiment struct { + _ struct{} `type:"structure"` + + // Information about the user who created or modified an experiment, trial, + // or trial component. + CreatedBy *UserContext `type:"structure"` + + // When the experiment was created. + CreationTime *time.Time `type:"timestamp"` + + // The description of the experiment. + Description *string `type:"string"` + + // The name of the experiment as displayed. If DisplayName isn't specified, + // ExperimentName is displayed. + DisplayName *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the experiment. + ExperimentArn *string `type:"string"` + + // The name of the experiment. + ExperimentName *string `min:"1" type:"string"` + + // Information about the user who created or modified an experiment, trial, + // or trial component. + LastModifiedBy *UserContext `type:"structure"` + + // When the experiment was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The source of the experiment. + Source *ExperimentSource `type:"structure"` + + // The list of tags that are associated with the experiment. You can use Search + // API to search on the tags. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s Experiment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Experiment) GoString() string { + return s.String() +} + +// SetCreatedBy sets the CreatedBy field's value. +func (s *Experiment) SetCreatedBy(v *UserContext) *Experiment { + s.CreatedBy = v return s } -// SetTrainingSpecification sets the TrainingSpecification field's value. -func (s *CreateAlgorithmInput) SetTrainingSpecification(v *TrainingSpecification) *CreateAlgorithmInput { - s.TrainingSpecification = v +// SetCreationTime sets the CreationTime field's value. +func (s *Experiment) SetCreationTime(v time.Time) *Experiment { + s.CreationTime = &v return s } -// SetValidationSpecification sets the ValidationSpecification field's value. -func (s *CreateAlgorithmInput) SetValidationSpecification(v *AlgorithmValidationSpecification) *CreateAlgorithmInput { - s.ValidationSpecification = v +// SetDescription sets the Description field's value. +func (s *Experiment) SetDescription(v string) *Experiment { + s.Description = &v return s } -type CreateAlgorithmOutput struct { - _ struct{} `type:"structure"` +// SetDisplayName sets the DisplayName field's value. +func (s *Experiment) SetDisplayName(v string) *Experiment { + s.DisplayName = &v + return s +} - // The Amazon Resource Name (ARN) of the new algorithm. - // - // AlgorithmArn is a required field - AlgorithmArn *string `min:"1" type:"string" required:"true"` +// SetExperimentArn sets the ExperimentArn field's value. +func (s *Experiment) SetExperimentArn(v string) *Experiment { + s.ExperimentArn = &v + return s } -// String returns the string representation -func (s CreateAlgorithmOutput) String() string { - return awsutil.Prettify(s) +// SetExperimentName sets the ExperimentName field's value. +func (s *Experiment) SetExperimentName(v string) *Experiment { + s.ExperimentName = &v + return s } -// GoString returns the string representation -func (s CreateAlgorithmOutput) GoString() string { - return s.String() +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *Experiment) SetLastModifiedBy(v *UserContext) *Experiment { + s.LastModifiedBy = v + return s } -// SetAlgorithmArn sets the AlgorithmArn field's value. -func (s *CreateAlgorithmOutput) SetAlgorithmArn(v string) *CreateAlgorithmOutput { - s.AlgorithmArn = &v +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *Experiment) SetLastModifiedTime(v time.Time) *Experiment { + s.LastModifiedTime = &v return s } -type CreateCodeRepositoryInput struct { +// SetSource sets the Source field's value. +func (s *Experiment) SetSource(v *ExperimentSource) *Experiment { + s.Source = v + return s +} + +// SetTags sets the Tags field's value. +func (s *Experiment) SetTags(v []*Tag) *Experiment { + s.Tags = v + return s +} + +// Configuration for the experiment. +type ExperimentConfig struct { _ struct{} `type:"structure"` - // The name of the Git repository. The name must have 1 to 63 characters. Valid - // characters are a-z, A-Z, 0-9, and - (hyphen). - // - // CodeRepositoryName is a required field - CodeRepositoryName *string `min:"1" type:"string" required:"true"` + // The name of the experiment. + ExperimentName *string `min:"1" type:"string"` - // Specifies details about the repository, including the URL where the repository - // is located, the default branch, and credentials to use to access the repository. - // - // GitConfig is a required field - GitConfig *GitConfig `type:"structure" required:"true"` + // Display name for the trial component. + TrialComponentDisplayName *string `min:"1" type:"string"` + + // The name of the trial. + TrialName *string `min:"1" type:"string"` } // String returns the string representation -func (s CreateCodeRepositoryInput) String() string { +func (s ExperimentConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateCodeRepositoryInput) GoString() string { +func (s ExperimentConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCodeRepositoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCodeRepositoryInput"} - if s.CodeRepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("CodeRepositoryName")) - } - if s.CodeRepositoryName != nil && len(*s.CodeRepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CodeRepositoryName", 1)) +func (s *ExperimentConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ExperimentConfig"} + if s.ExperimentName != nil && len(*s.ExperimentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ExperimentName", 1)) } - if s.GitConfig == nil { - invalidParams.Add(request.NewErrParamRequired("GitConfig")) + if s.TrialComponentDisplayName != nil && len(*s.TrialComponentDisplayName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialComponentDisplayName", 1)) } - if s.GitConfig != nil { - if err := s.GitConfig.Validate(); err != nil { - invalidParams.AddNested("GitConfig", err.(request.ErrInvalidParams)) - } + if s.TrialName != nil && len(*s.TrialName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialName", 1)) } if invalidParams.Len() > 0 { @@ -8817,287 +27086,343 @@ func (s *CreateCodeRepositoryInput) Validate() error { return nil } -// SetCodeRepositoryName sets the CodeRepositoryName field's value. -func (s *CreateCodeRepositoryInput) SetCodeRepositoryName(v string) *CreateCodeRepositoryInput { - s.CodeRepositoryName = &v +// SetExperimentName sets the ExperimentName field's value. +func (s *ExperimentConfig) SetExperimentName(v string) *ExperimentConfig { + s.ExperimentName = &v return s } -// SetGitConfig sets the GitConfig field's value. -func (s *CreateCodeRepositoryInput) SetGitConfig(v *GitConfig) *CreateCodeRepositoryInput { - s.GitConfig = v +// SetTrialComponentDisplayName sets the TrialComponentDisplayName field's value. +func (s *ExperimentConfig) SetTrialComponentDisplayName(v string) *ExperimentConfig { + s.TrialComponentDisplayName = &v return s } -type CreateCodeRepositoryOutput struct { +// SetTrialName sets the TrialName field's value. +func (s *ExperimentConfig) SetTrialName(v string) *ExperimentConfig { + s.TrialName = &v + return s +} + +// The source of the experiment. +type ExperimentSource struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the new repository. + // The Amazon Resource Name (ARN) of the source. // - // CodeRepositoryArn is a required field - CodeRepositoryArn *string `min:"1" type:"string" required:"true"` + // SourceArn is a required field + SourceArn *string `type:"string" required:"true"` + + // The source type. + SourceType *string `type:"string"` } // String returns the string representation -func (s CreateCodeRepositoryOutput) String() string { +func (s ExperimentSource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateCodeRepositoryOutput) GoString() string { +func (s ExperimentSource) GoString() string { return s.String() } -// SetCodeRepositoryArn sets the CodeRepositoryArn field's value. -func (s *CreateCodeRepositoryOutput) SetCodeRepositoryArn(v string) *CreateCodeRepositoryOutput { - s.CodeRepositoryArn = &v +// SetSourceArn sets the SourceArn field's value. +func (s *ExperimentSource) SetSourceArn(v string) *ExperimentSource { + s.SourceArn = &v return s } -type CreateCompilationJobInput struct { +// SetSourceType sets the SourceType field's value. +func (s *ExperimentSource) SetSourceType(v string) *ExperimentSource { + s.SourceType = &v + return s +} + +// A summary of the properties of an experiment. To get the complete set of +// properties, call the DescribeExperiment API and provide the ExperimentName. +type ExperimentSummary struct { _ struct{} `type:"structure"` - // A name for the model compilation job. The name must be unique within the - // AWS Region and within your AWS account. - // - // CompilationJobName is a required field - CompilationJobName *string `min:"1" type:"string" required:"true"` + // When the experiment was created. + CreationTime *time.Time `type:"timestamp"` - // Provides information about the location of input model artifacts, the name - // and shape of the expected data inputs, and the framework in which the model - // was trained. - // - // InputConfig is a required field - InputConfig *InputConfig `type:"structure" required:"true"` + // The name of the experiment as displayed. If DisplayName isn't specified, + // ExperimentName is displayed. + DisplayName *string `min:"1" type:"string"` - // Provides information about the output location for the compiled model and - // the target device the model runs on. - // - // OutputConfig is a required field - OutputConfig *OutputConfig `type:"structure" required:"true"` + // The Amazon Resource Name (ARN) of the experiment. + ExperimentArn *string `type:"string"` - // The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker - // to perform tasks on your behalf. - // - // During model compilation, Amazon SageMaker needs your permission to: - // - // * Read input data from an S3 bucket - // - // * Write model artifacts to an S3 bucket - // - // * Write logs to Amazon CloudWatch Logs - // - // * Publish metrics to Amazon CloudWatch - // - // You grant permissions for all of these tasks to an IAM role. To pass this - // role to Amazon SageMaker, the caller of this API must have the iam:PassRole - // permission. For more information, see Amazon SageMaker Roles. (https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html) - // - // RoleArn is a required field - RoleArn *string `min:"20" type:"string" required:"true"` + // The name of the experiment. + ExperimentName *string `min:"1" type:"string"` - // Specifies a limit to how long a model compilation job can run. When the job - // reaches the time limit, Amazon SageMaker ends the compilation job. Use this - // API to cap model training costs. - // - // StoppingCondition is a required field - StoppingCondition *StoppingCondition `type:"structure" required:"true"` + // The source of the experiment. + ExperimentSource *ExperimentSource `type:"structure"` + + // When the experiment was last modified. + LastModifiedTime *time.Time `type:"timestamp"` } // String returns the string representation -func (s CreateCompilationJobInput) String() string { +func (s ExperimentSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateCompilationJobInput) GoString() string { +func (s ExperimentSummary) GoString() string { return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateCompilationJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateCompilationJobInput"} - if s.CompilationJobName == nil { - invalidParams.Add(request.NewErrParamRequired("CompilationJobName")) - } - if s.CompilationJobName != nil && len(*s.CompilationJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CompilationJobName", 1)) - } - if s.InputConfig == nil { - invalidParams.Add(request.NewErrParamRequired("InputConfig")) - } - if s.OutputConfig == nil { - invalidParams.Add(request.NewErrParamRequired("OutputConfig")) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) - } - if s.StoppingCondition == nil { - invalidParams.Add(request.NewErrParamRequired("StoppingCondition")) - } - if s.InputConfig != nil { - if err := s.InputConfig.Validate(); err != nil { - invalidParams.AddNested("InputConfig", err.(request.ErrInvalidParams)) - } - } - if s.OutputConfig != nil { - if err := s.OutputConfig.Validate(); err != nil { - invalidParams.AddNested("OutputConfig", err.(request.ErrInvalidParams)) - } - } - if s.StoppingCondition != nil { - if err := s.StoppingCondition.Validate(); err != nil { - invalidParams.AddNested("StoppingCondition", err.(request.ErrInvalidParams)) - } - } +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCreationTime sets the CreationTime field's value. +func (s *ExperimentSummary) SetCreationTime(v time.Time) *ExperimentSummary { + s.CreationTime = &v + return s } -// SetCompilationJobName sets the CompilationJobName field's value. -func (s *CreateCompilationJobInput) SetCompilationJobName(v string) *CreateCompilationJobInput { - s.CompilationJobName = &v +// SetDisplayName sets the DisplayName field's value. +func (s *ExperimentSummary) SetDisplayName(v string) *ExperimentSummary { + s.DisplayName = &v return s } -// SetInputConfig sets the InputConfig field's value. -func (s *CreateCompilationJobInput) SetInputConfig(v *InputConfig) *CreateCompilationJobInput { - s.InputConfig = v +// SetExperimentArn sets the ExperimentArn field's value. +func (s *ExperimentSummary) SetExperimentArn(v string) *ExperimentSummary { + s.ExperimentArn = &v return s } -// SetOutputConfig sets the OutputConfig field's value. -func (s *CreateCompilationJobInput) SetOutputConfig(v *OutputConfig) *CreateCompilationJobInput { - s.OutputConfig = v +// SetExperimentName sets the ExperimentName field's value. +func (s *ExperimentSummary) SetExperimentName(v string) *ExperimentSummary { + s.ExperimentName = &v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *CreateCompilationJobInput) SetRoleArn(v string) *CreateCompilationJobInput { - s.RoleArn = &v +// SetExperimentSource sets the ExperimentSource field's value. +func (s *ExperimentSummary) SetExperimentSource(v *ExperimentSource) *ExperimentSummary { + s.ExperimentSource = v return s } -// SetStoppingCondition sets the StoppingCondition field's value. -func (s *CreateCompilationJobInput) SetStoppingCondition(v *StoppingCondition) *CreateCompilationJobInput { - s.StoppingCondition = v +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *ExperimentSummary) SetLastModifiedTime(v time.Time) *ExperimentSummary { + s.LastModifiedTime = &v return s } -type CreateCompilationJobOutput struct { +// Specifies a file system data source for a channel. +type FileSystemDataSource struct { _ struct{} `type:"structure"` - // If the action is successful, the service sends back an HTTP 200 response. - // Amazon SageMaker returns the following data in JSON format: + // The full path to the directory to associate with the channel. // - // * CompilationJobArn: The Amazon Resource Name (ARN) of the compiled job. + // DirectoryPath is a required field + DirectoryPath *string `type:"string" required:"true"` + + // The access mode of the mount of the directory associated with the channel. + // A directory can be mounted either in ro (read-only) or rw (read-write) mode. // - // CompilationJobArn is a required field - CompilationJobArn *string `type:"string" required:"true"` + // FileSystemAccessMode is a required field + FileSystemAccessMode *string `type:"string" required:"true" enum:"FileSystemAccessMode"` + + // The file system id. + // + // FileSystemId is a required field + FileSystemId *string `min:"11" type:"string" required:"true"` + + // The file system type. + // + // FileSystemType is a required field + FileSystemType *string `type:"string" required:"true" enum:"FileSystemType"` } // String returns the string representation -func (s CreateCompilationJobOutput) String() string { +func (s FileSystemDataSource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateCompilationJobOutput) GoString() string { +func (s FileSystemDataSource) GoString() string { return s.String() } -// SetCompilationJobArn sets the CompilationJobArn field's value. -func (s *CreateCompilationJobOutput) SetCompilationJobArn(v string) *CreateCompilationJobOutput { - s.CompilationJobArn = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *FileSystemDataSource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "FileSystemDataSource"} + if s.DirectoryPath == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryPath")) + } + if s.FileSystemAccessMode == nil { + invalidParams.Add(request.NewErrParamRequired("FileSystemAccessMode")) + } + if s.FileSystemId == nil { + invalidParams.Add(request.NewErrParamRequired("FileSystemId")) + } + if s.FileSystemId != nil && len(*s.FileSystemId) < 11 { + invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 11)) + } + if s.FileSystemType == nil { + invalidParams.Add(request.NewErrParamRequired("FileSystemType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDirectoryPath sets the DirectoryPath field's value. +func (s *FileSystemDataSource) SetDirectoryPath(v string) *FileSystemDataSource { + s.DirectoryPath = &v return s } -type CreateEndpointConfigInput struct { +// SetFileSystemAccessMode sets the FileSystemAccessMode field's value. +func (s *FileSystemDataSource) SetFileSystemAccessMode(v string) *FileSystemDataSource { + s.FileSystemAccessMode = &v + return s +} + +// SetFileSystemId sets the FileSystemId field's value. +func (s *FileSystemDataSource) SetFileSystemId(v string) *FileSystemDataSource { + s.FileSystemId = &v + return s +} + +// SetFileSystemType sets the FileSystemType field's value. +func (s *FileSystemDataSource) SetFileSystemType(v string) *FileSystemDataSource { + s.FileSystemType = &v + return s +} + +// A conditional statement for a search expression that includes a resource +// property, a Boolean operator, and a value. +// +// If you don't specify an Operator and a Value, the filter searches for only +// the specified property. For example, defining a Filter for the FailureReason +// for the TrainingJob Resource searches for training job objects that have +// a value in the FailureReason field. +// +// If you specify a Value, but not an Operator, Amazon SageMaker uses the equals +// operator as the default. +// +// In search, there are several property types: +// +// Metrics +// +// To define a metric filter, enter a value using the form "Metrics.", +// where is a metric name. For example, the following filter searches +// for training jobs with an "accuracy" metric greater than "0.9": +// +// { +// +// "Name": "Metrics.accuracy", +// +// "Operator": "GREATER_THAN", +// +// "Value": "0.9" +// +// } +// +// HyperParameters +// +// To define a hyperparameter filter, enter a value with the form "HyperParameters.". +// Decimal hyperparameter values are treated as a decimal in a comparison if +// the specified Value is also a decimal value. If the specified Value is an +// integer, the decimal hyperparameter values are treated as integers. For example, +// the following filter is satisfied by training jobs with a "learning_rate" +// hyperparameter that is less than "0.5": +// +// { +// +// "Name": "HyperParameters.learning_rate", +// +// "Operator": "LESS_THAN", +// +// "Value": "0.5" +// +// } +// +// Tags +// +// To define a tag filter, enter a value with the form "Tags.". +type Filter struct { _ struct{} `type:"structure"` - // The name of the endpoint configuration. You specify this name in a CreateEndpoint - // (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpoint.html) - // request. + // A property name. For example, TrainingJobName. For the list of valid property + // names returned in a search result for each supported resource, see TrainingJob + // properties. You must specify a valid property name for the resource. // - // EndpointConfigName is a required field - EndpointConfigName *string `type:"string" required:"true"` + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` - // The Amazon Resource Name (ARN) of a AWS Key Management Service key that Amazon - // SageMaker uses to encrypt data on the storage volume attached to the ML compute - // instance that hosts the endpoint. + // A Boolean binary operator that is used to evaluate the filter. The operator + // field contains one of the following values: // - // Nitro-based instances do not support encryption with AWS KMS. If any of the - // models that you specify in the ProductionVariants parameter use nitro-based - // instances, do not specify a value for the KmsKeyId parameter. If you specify - // a value for KmsKeyId when using any nitro-based instances, the call to CreateEndpointConfig - // fails. + // Equals // - // For a list of nitro-based instances, see Nitro-based Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances) - // in the Amazon Elastic Compute Cloud User Guide for Linux Instances. + // The specified resource in Name equals the specified Value. // - // For more information about storage volumes on nitro-based instances, see - // Amazon EBS and NVMe on Linux Instances (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/nvme-ebs-volumes.html). - KmsKeyId *string `type:"string"` - - // An list of ProductionVariant objects, one for each model that you want to - // host at this endpoint. + // NotEquals // - // ProductionVariants is a required field - ProductionVariants []*ProductionVariant `min:"1" type:"list" required:"true"` + // The specified resource in Name does not equal the specified Value. + // + // GreaterThan + // + // The specified resource in Name is greater than the specified Value. Not supported + // for text-based properties. + // + // GreaterThanOrEqualTo + // + // The specified resource in Name is greater than or equal to the specified + // Value. Not supported for text-based properties. + // + // LessThan + // + // The specified resource in Name is less than the specified Value. Not supported + // for text-based properties. + // + // LessThanOrEqualTo + // + // The specified resource in Name is less than or equal to the specified Value. + // Not supported for text-based properties. + // + // Contains + // + // Only supported for text-based properties. The word-list of the property contains + // the specified Value. A SearchExpression can include only one Contains operator. + // + // If you have specified a filter Value, the default is Equals. + Operator *string `type:"string" enum:"Operator"` - // A list of key-value pairs. For more information, see Using Cost Allocation - // Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) - // in the AWS Billing and Cost Management User Guide. - Tags []*Tag `type:"list"` + // A value used with Resource and Operator to determine if objects satisfy the + // filter's condition. For numerical properties, Value must be an integer or + // floating-point decimal. For timestamp properties, Value must be an ISO 8601 + // date-time string of the following format: YYYY-mm-dd'T'HH:MM:SS. + Value *string `min:"1" type:"string"` } // String returns the string representation -func (s CreateEndpointConfigInput) String() string { +func (s Filter) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateEndpointConfigInput) GoString() string { +func (s Filter) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEndpointConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEndpointConfigInput"} - if s.EndpointConfigName == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointConfigName")) - } - if s.ProductionVariants == nil { - invalidParams.Add(request.NewErrParamRequired("ProductionVariants")) - } - if s.ProductionVariants != nil && len(s.ProductionVariants) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProductionVariants", 1)) +func (s *Filter) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Filter"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) } - if s.ProductionVariants != nil { - for i, v := range s.ProductionVariants { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ProductionVariants", i), err.(request.ErrInvalidParams)) - } - } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 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 s.Value != nil && len(*s.Value) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Value", 1)) } if invalidParams.Len() > 0 { @@ -9106,486 +27431,353 @@ func (s *CreateEndpointConfigInput) Validate() error { return nil } -// SetEndpointConfigName sets the EndpointConfigName field's value. -func (s *CreateEndpointConfigInput) SetEndpointConfigName(v string) *CreateEndpointConfigInput { - s.EndpointConfigName = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateEndpointConfigInput) SetKmsKeyId(v string) *CreateEndpointConfigInput { - s.KmsKeyId = &v +// SetName sets the Name field's value. +func (s *Filter) SetName(v string) *Filter { + s.Name = &v return s } -// SetProductionVariants sets the ProductionVariants field's value. -func (s *CreateEndpointConfigInput) SetProductionVariants(v []*ProductionVariant) *CreateEndpointConfigInput { - s.ProductionVariants = v +// SetOperator sets the Operator field's value. +func (s *Filter) SetOperator(v string) *Filter { + s.Operator = &v return s } -// SetTags sets the Tags field's value. -func (s *CreateEndpointConfigInput) SetTags(v []*Tag) *CreateEndpointConfigInput { - s.Tags = v +// SetValue sets the Value field's value. +func (s *Filter) SetValue(v string) *Filter { + s.Value = &v return s } -type CreateEndpointConfigOutput struct { +// The candidate result from a job. +type FinalAutoMLJobObjectiveMetric struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the endpoint configuration. + // The name of the metric. // - // EndpointConfigArn is a required field - EndpointConfigArn *string `min:"20" type:"string" required:"true"` + // MetricName is a required field + MetricName *string `type:"string" required:"true" enum:"AutoMLMetricEnum"` + + // The metric type used. + Type *string `type:"string" enum:"AutoMLJobObjectiveType"` + + // The value of the metric. + // + // Value is a required field + Value *float64 `type:"float" required:"true"` } // String returns the string representation -func (s CreateEndpointConfigOutput) String() string { +func (s FinalAutoMLJobObjectiveMetric) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateEndpointConfigOutput) GoString() string { +func (s FinalAutoMLJobObjectiveMetric) GoString() string { return s.String() } -// SetEndpointConfigArn sets the EndpointConfigArn field's value. -func (s *CreateEndpointConfigOutput) SetEndpointConfigArn(v string) *CreateEndpointConfigOutput { - s.EndpointConfigArn = &v +// SetMetricName sets the MetricName field's value. +func (s *FinalAutoMLJobObjectiveMetric) SetMetricName(v string) *FinalAutoMLJobObjectiveMetric { + s.MetricName = &v return s } -type CreateEndpointInput struct { +// SetType sets the Type field's value. +func (s *FinalAutoMLJobObjectiveMetric) SetType(v string) *FinalAutoMLJobObjectiveMetric { + s.Type = &v + return s +} + +// SetValue sets the Value field's value. +func (s *FinalAutoMLJobObjectiveMetric) SetValue(v float64) *FinalAutoMLJobObjectiveMetric { + s.Value = &v + return s +} + +// Shows the final value for the objective metric for a training job that was +// launched by a hyperparameter tuning job. You define the objective metric +// in the HyperParameterTuningJobObjective parameter of HyperParameterTuningJobConfig. +type FinalHyperParameterTuningJobObjectiveMetric struct { _ struct{} `type:"structure"` - // The name of an endpoint configuration. For more information, see CreateEndpointConfig - // (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpointConfig.html). + // The name of the objective metric. // - // EndpointConfigName is a required field - EndpointConfigName *string `type:"string" required:"true"` + // MetricName is a required field + MetricName *string `min:"1" type:"string" required:"true"` - // The name of the endpoint. The name must be unique within an AWS Region in - // your AWS account. - // - // EndpointName is a required field - EndpointName *string `type:"string" required:"true"` + // Whether to minimize or maximize the objective metric. Valid values are Minimize + // and Maximize. + Type *string `type:"string" enum:"HyperParameterTuningJobObjectiveType"` - // An array of key-value pairs. For more information, see Using Cost Allocation - // Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what)in - // the AWS Billing and Cost Management User Guide. - Tags []*Tag `type:"list"` + // The value of the objective metric. + // + // Value is a required field + Value *float64 `type:"float" required:"true"` } // String returns the string representation -func (s CreateEndpointInput) String() string { +func (s FinalHyperParameterTuningJobObjectiveMetric) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateEndpointInput) GoString() string { +func (s FinalHyperParameterTuningJobObjectiveMetric) 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.EndpointConfigName == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointConfigName")) - } - if s.EndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointName")) - } - 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 -} - -// SetEndpointConfigName sets the EndpointConfigName field's value. -func (s *CreateEndpointInput) SetEndpointConfigName(v string) *CreateEndpointInput { - s.EndpointConfigName = &v +// SetMetricName sets the MetricName field's value. +func (s *FinalHyperParameterTuningJobObjectiveMetric) SetMetricName(v string) *FinalHyperParameterTuningJobObjectiveMetric { + s.MetricName = &v return s } -// SetEndpointName sets the EndpointName field's value. -func (s *CreateEndpointInput) SetEndpointName(v string) *CreateEndpointInput { - s.EndpointName = &v +// SetType sets the Type field's value. +func (s *FinalHyperParameterTuningJobObjectiveMetric) SetType(v string) *FinalHyperParameterTuningJobObjectiveMetric { + s.Type = &v return s } -// SetTags sets the Tags field's value. -func (s *CreateEndpointInput) SetTags(v []*Tag) *CreateEndpointInput { - s.Tags = v +// SetValue sets the Value field's value. +func (s *FinalHyperParameterTuningJobObjectiveMetric) SetValue(v float64) *FinalHyperParameterTuningJobObjectiveMetric { + s.Value = &v return s } -type CreateEndpointOutput struct { +// Contains information about where human output will be stored. +type FlowDefinitionOutputConfig struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the endpoint. + // The Amazon Key Management Service (KMS) key ID for server-side encryption. + KmsKeyId *string `type:"string"` + + // The Amazon S3 path where the object containing human output will be made + // available. // - // EndpointArn is a required field - EndpointArn *string `min:"20" type:"string" required:"true"` + // S3OutputPath is a required field + S3OutputPath *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateEndpointOutput) String() string { +func (s FlowDefinitionOutputConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateEndpointOutput) GoString() string { +func (s FlowDefinitionOutputConfig) GoString() string { return s.String() } -// SetEndpointArn sets the EndpointArn field's value. -func (s *CreateEndpointOutput) SetEndpointArn(v string) *CreateEndpointOutput { - s.EndpointArn = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *FlowDefinitionOutputConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "FlowDefinitionOutputConfig"} + if s.S3OutputPath == nil { + invalidParams.Add(request.NewErrParamRequired("S3OutputPath")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *FlowDefinitionOutputConfig) SetKmsKeyId(v string) *FlowDefinitionOutputConfig { + s.KmsKeyId = &v return s } -type CreateHyperParameterTuningJobInput struct { +// SetS3OutputPath sets the S3OutputPath field's value. +func (s *FlowDefinitionOutputConfig) SetS3OutputPath(v string) *FlowDefinitionOutputConfig { + s.S3OutputPath = &v + return s +} + +// Contains summary information about the flow definition. +type FlowDefinitionSummary struct { _ struct{} `type:"structure"` - // The HyperParameterTuningJobConfig object that describes the tuning job, including - // the search strategy, the objective metric used to evaluate training jobs, - // ranges of parameters to search, and resource limits for the tuning job. For - // more information, see automatic-model-tuning + // The timestamp when SageMaker created the flow definition. // - // HyperParameterTuningJobConfig is a required field - HyperParameterTuningJobConfig *HyperParameterTuningJobConfig `type:"structure" required:"true"` + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` - // The name of the tuning job. This name is the prefix for the names of all - // training jobs that this tuning job launches. The name must be unique within - // the same AWS account and AWS Region. The name must have { } to { } characters. - // Valid characters are a-z, A-Z, 0-9, and : + = @ _ % - (hyphen). The name - // is not case sensitive. - // - // HyperParameterTuningJobName is a required field - HyperParameterTuningJobName *string `min:"1" type:"string" required:"true"` + // The reason why the flow definition creation failed. A failure reason is returned + // only when the flow definition status is Failed. + FailureReason *string `type:"string"` - // An array of key-value pairs. You can use tags to categorize your AWS resources - // in different ways, for example, by purpose, owner, or environment. For more - // information, see AWS Tagging Strategies (https://docs.aws.amazon.com/https:/aws.amazon.com/answers/account-management/aws-tagging-strategies/). + // The Amazon Resource Name (ARN) of the flow definition. // - // Tags that you specify for the tuning job are also added to all training jobs - // that the tuning job launches. - Tags []*Tag `type:"list"` + // FlowDefinitionArn is a required field + FlowDefinitionArn *string `type:"string" required:"true"` - // The HyperParameterTrainingJobDefinition object that describes the training - // jobs that this tuning job launches, including static hyperparameters, input - // data configuration, output data configuration, resource configuration, and - // stopping condition. - TrainingJobDefinition *HyperParameterTrainingJobDefinition `type:"structure"` - - // Specifies the configuration for starting the hyperparameter tuning job using - // one or more previous tuning jobs as a starting point. The results of previous - // tuning jobs are used to inform which combinations of hyperparameters to search - // over in the new tuning job. + // The name of the flow definition. // - // All training jobs launched by the new hyperparameter tuning job are evaluated - // by using the objective metric. If you specify IDENTICAL_DATA_AND_ALGORITHM - // as the WarmStartType value for the warm start configuration, the training - // job that performs the best in the new tuning job is compared to the best - // training jobs from the parent tuning jobs. From these, the training job that - // performs the best as measured by the objective metric is returned as the - // overall best training job. + // FlowDefinitionName is a required field + FlowDefinitionName *string `min:"1" type:"string" required:"true"` + + // The status of the flow definition. Valid values: // - // All training jobs launched by parent hyperparameter tuning jobs and the new - // hyperparameter tuning jobs count against the limit of training jobs for the - // tuning job. - WarmStartConfig *HyperParameterTuningJobWarmStartConfig `type:"structure"` + // FlowDefinitionStatus is a required field + FlowDefinitionStatus *string `type:"string" required:"true" enum:"FlowDefinitionStatus"` } // String returns the string representation -func (s CreateHyperParameterTuningJobInput) String() string { +func (s FlowDefinitionSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateHyperParameterTuningJobInput) GoString() string { +func (s FlowDefinitionSummary) GoString() string { return s.String() } - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateHyperParameterTuningJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateHyperParameterTuningJobInput"} - if s.HyperParameterTuningJobConfig == nil { - invalidParams.Add(request.NewErrParamRequired("HyperParameterTuningJobConfig")) - } - if s.HyperParameterTuningJobName == nil { - invalidParams.Add(request.NewErrParamRequired("HyperParameterTuningJobName")) - } - if s.HyperParameterTuningJobName != nil && len(*s.HyperParameterTuningJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("HyperParameterTuningJobName", 1)) - } - if s.HyperParameterTuningJobConfig != nil { - if err := s.HyperParameterTuningJobConfig.Validate(); err != nil { - invalidParams.AddNested("HyperParameterTuningJobConfig", 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 s.TrainingJobDefinition != nil { - if err := s.TrainingJobDefinition.Validate(); err != nil { - invalidParams.AddNested("TrainingJobDefinition", err.(request.ErrInvalidParams)) - } - } - if s.WarmStartConfig != nil { - if err := s.WarmStartConfig.Validate(); err != nil { - invalidParams.AddNested("WarmStartConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHyperParameterTuningJobConfig sets the HyperParameterTuningJobConfig field's value. -func (s *CreateHyperParameterTuningJobInput) SetHyperParameterTuningJobConfig(v *HyperParameterTuningJobConfig) *CreateHyperParameterTuningJobInput { - s.HyperParameterTuningJobConfig = v + +// SetCreationTime sets the CreationTime field's value. +func (s *FlowDefinitionSummary) SetCreationTime(v time.Time) *FlowDefinitionSummary { + s.CreationTime = &v return s } -// SetHyperParameterTuningJobName sets the HyperParameterTuningJobName field's value. -func (s *CreateHyperParameterTuningJobInput) SetHyperParameterTuningJobName(v string) *CreateHyperParameterTuningJobInput { - s.HyperParameterTuningJobName = &v +// SetFailureReason sets the FailureReason field's value. +func (s *FlowDefinitionSummary) SetFailureReason(v string) *FlowDefinitionSummary { + s.FailureReason = &v return s } -// SetTags sets the Tags field's value. -func (s *CreateHyperParameterTuningJobInput) SetTags(v []*Tag) *CreateHyperParameterTuningJobInput { - s.Tags = v +// SetFlowDefinitionArn sets the FlowDefinitionArn field's value. +func (s *FlowDefinitionSummary) SetFlowDefinitionArn(v string) *FlowDefinitionSummary { + s.FlowDefinitionArn = &v return s } -// SetTrainingJobDefinition sets the TrainingJobDefinition field's value. -func (s *CreateHyperParameterTuningJobInput) SetTrainingJobDefinition(v *HyperParameterTrainingJobDefinition) *CreateHyperParameterTuningJobInput { - s.TrainingJobDefinition = v +// SetFlowDefinitionName sets the FlowDefinitionName field's value. +func (s *FlowDefinitionSummary) SetFlowDefinitionName(v string) *FlowDefinitionSummary { + s.FlowDefinitionName = &v return s } -// SetWarmStartConfig sets the WarmStartConfig field's value. -func (s *CreateHyperParameterTuningJobInput) SetWarmStartConfig(v *HyperParameterTuningJobWarmStartConfig) *CreateHyperParameterTuningJobInput { - s.WarmStartConfig = v +// SetFlowDefinitionStatus sets the FlowDefinitionStatus field's value. +func (s *FlowDefinitionSummary) SetFlowDefinitionStatus(v string) *FlowDefinitionSummary { + s.FlowDefinitionStatus = &v return s } -type CreateHyperParameterTuningJobOutput struct { +type GetSearchSuggestionsInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the tuning job. Amazon SageMaker assigns - // an ARN to a hyperparameter tuning job when you create it. + // The name of the Amazon SageMaker resource to Search for. // - // HyperParameterTuningJobArn is a required field - HyperParameterTuningJobArn *string `type:"string" required:"true"` + // Resource is a required field + Resource *string `type:"string" required:"true" enum:"ResourceType"` + + // Limits the property names that are included in the response. + SuggestionQuery *SuggestionQuery `type:"structure"` } // String returns the string representation -func (s CreateHyperParameterTuningJobOutput) String() string { +func (s GetSearchSuggestionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateHyperParameterTuningJobOutput) GoString() string { +func (s GetSearchSuggestionsInput) GoString() string { return s.String() } -// SetHyperParameterTuningJobArn sets the HyperParameterTuningJobArn field's value. -func (s *CreateHyperParameterTuningJobOutput) SetHyperParameterTuningJobArn(v string) *CreateHyperParameterTuningJobOutput { - s.HyperParameterTuningJobArn = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetSearchSuggestionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetSearchSuggestionsInput"} + if s.Resource == nil { + invalidParams.Add(request.NewErrParamRequired("Resource")) + } + if s.SuggestionQuery != nil { + if err := s.SuggestionQuery.Validate(); err != nil { + invalidParams.AddNested("SuggestionQuery", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResource sets the Resource field's value. +func (s *GetSearchSuggestionsInput) SetResource(v string) *GetSearchSuggestionsInput { + s.Resource = &v return s } -type CreateLabelingJobInput struct { +// SetSuggestionQuery sets the SuggestionQuery field's value. +func (s *GetSearchSuggestionsInput) SetSuggestionQuery(v *SuggestionQuery) *GetSearchSuggestionsInput { + s.SuggestionQuery = v + return s +} + +type GetSearchSuggestionsOutput struct { _ struct{} `type:"structure"` - // Configures the information required for human workers to complete a labeling - // task. - // - // HumanTaskConfig is a required field - HumanTaskConfig *HumanTaskConfig `type:"structure" required:"true"` + // A list of property names for a Resource that match a SuggestionQuery. + PropertyNameSuggestions []*PropertyNameSuggestion `type:"list"` +} - // Input data for the labeling job, such as the Amazon S3 location of the data - // objects and the location of the manifest file that describes the data objects. - // - // InputConfig is a required field - InputConfig *LabelingJobInputConfig `type:"structure" required:"true"` +// String returns the string representation +func (s GetSearchSuggestionsOutput) String() string { + return awsutil.Prettify(s) +} - // The attribute name to use for the label in the output manifest file. This - // is the key for the key/value pair formed with the label that a worker assigns - // to the object. The name can't end with "-metadata". If you are running a - // semantic segmentation labeling job, the attribute name must end with "-ref". - // If you are running any other kind of labeling job, the attribute name must - // not end with "-ref". - // - // LabelAttributeName is a required field - LabelAttributeName *string `min:"1" type:"string" required:"true"` +// GoString returns the string representation +func (s GetSearchSuggestionsOutput) GoString() string { + return s.String() +} - // The S3 URL of the file that defines the categories used to label the data - // objects. - // - // The file is a JSON structure in the following format: - // - // { - // - // "document-version": "2018-11-28" - // - // "labels": [ - // - // { - // - // "label": "label 1" - // - // }, - // - // { - // - // "label": "label 2" - // - // }, - // - // ... - // - // { - // - // "label": "label n" - // - // } - // - // ] - // - // } - LabelCategoryConfigS3Uri *string `type:"string"` +// SetPropertyNameSuggestions sets the PropertyNameSuggestions field's value. +func (s *GetSearchSuggestionsOutput) SetPropertyNameSuggestions(v []*PropertyNameSuggestion) *GetSearchSuggestionsOutput { + s.PropertyNameSuggestions = v + return s +} - // Configures the information required to perform automated data labeling. - LabelingJobAlgorithmsConfig *LabelingJobAlgorithmsConfig `type:"structure"` +// Specifies configuration details for a Git repository in your AWS account. +type GitConfig struct { + _ struct{} `type:"structure"` - // The name of the labeling job. This name is used to identify the job in a - // list of labeling jobs. - // - // LabelingJobName is a required field - LabelingJobName *string `min:"1" type:"string" required:"true"` + // The default branch for the Git repository. + Branch *string `min:"1" type:"string"` - // The location of the output data and the AWS Key Management Service key ID - // for the key used to encrypt the output data, if any. + // The URL where the Git repository is located. // - // OutputConfig is a required field - OutputConfig *LabelingJobOutputConfig `type:"structure" required:"true"` + // RepositoryUrl is a required field + RepositoryUrl *string `type:"string" required:"true"` - // The Amazon Resource Number (ARN) that Amazon SageMaker assumes to perform - // tasks on your behalf during data labeling. You must grant this role the necessary - // permissions so that Amazon SageMaker can successfully complete data labeling. + // The Amazon Resource Name (ARN) of the AWS Secrets Manager secret that contains + // the credentials used to access the git repository. The secret must have a + // staging label of AWSCURRENT and must be in the following format: // - // RoleArn is a required field - RoleArn *string `min:"20" type:"string" required:"true"` - - // A set of conditions for stopping the labeling job. If any of the conditions - // are met, the job is automatically stopped. You can use these conditions to - // control the cost of data labeling. - StoppingConditions *LabelingJobStoppingConditions `type:"structure"` - - // An array of key/value pairs. For more information, see Using Cost Allocation - // Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) - // in the AWS Billing and Cost Management User Guide. - Tags []*Tag `type:"list"` + // {"username": UserName, "password": Password} + SecretArn *string `min:"1" type:"string"` } // String returns the string representation -func (s CreateLabelingJobInput) String() string { +func (s GitConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateLabelingJobInput) GoString() string { +func (s GitConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateLabelingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateLabelingJobInput"} - if s.HumanTaskConfig == nil { - invalidParams.Add(request.NewErrParamRequired("HumanTaskConfig")) - } - if s.InputConfig == nil { - invalidParams.Add(request.NewErrParamRequired("InputConfig")) - } - if s.LabelAttributeName == nil { - invalidParams.Add(request.NewErrParamRequired("LabelAttributeName")) - } - if s.LabelAttributeName != nil && len(*s.LabelAttributeName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LabelAttributeName", 1)) - } - if s.LabelingJobName == nil { - invalidParams.Add(request.NewErrParamRequired("LabelingJobName")) - } - if s.LabelingJobName != nil && len(*s.LabelingJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LabelingJobName", 1)) - } - if s.OutputConfig == nil { - invalidParams.Add(request.NewErrParamRequired("OutputConfig")) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) - } - if s.HumanTaskConfig != nil { - if err := s.HumanTaskConfig.Validate(); err != nil { - invalidParams.AddNested("HumanTaskConfig", err.(request.ErrInvalidParams)) - } - } - if s.InputConfig != nil { - if err := s.InputConfig.Validate(); err != nil { - invalidParams.AddNested("InputConfig", err.(request.ErrInvalidParams)) - } - } - if s.LabelingJobAlgorithmsConfig != nil { - if err := s.LabelingJobAlgorithmsConfig.Validate(); err != nil { - invalidParams.AddNested("LabelingJobAlgorithmsConfig", err.(request.ErrInvalidParams)) - } - } - if s.OutputConfig != nil { - if err := s.OutputConfig.Validate(); err != nil { - invalidParams.AddNested("OutputConfig", err.(request.ErrInvalidParams)) - } +func (s *GitConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GitConfig"} + if s.Branch != nil && len(*s.Branch) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Branch", 1)) } - if s.StoppingConditions != nil { - if err := s.StoppingConditions.Validate(); err != nil { - invalidParams.AddNested("StoppingConditions", err.(request.ErrInvalidParams)) - } + if s.RepositoryUrl == nil { + invalidParams.Add(request.NewErrParamRequired("RepositoryUrl")) } - 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 s.SecretArn != nil && len(*s.SecretArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SecretArn", 1)) } if invalidParams.Len() > 0 { @@ -9594,192 +27786,467 @@ func (s *CreateLabelingJobInput) Validate() error { return nil } -// SetHumanTaskConfig sets the HumanTaskConfig field's value. -func (s *CreateLabelingJobInput) SetHumanTaskConfig(v *HumanTaskConfig) *CreateLabelingJobInput { - s.HumanTaskConfig = v +// SetBranch sets the Branch field's value. +func (s *GitConfig) SetBranch(v string) *GitConfig { + s.Branch = &v return s } -// SetInputConfig sets the InputConfig field's value. -func (s *CreateLabelingJobInput) SetInputConfig(v *LabelingJobInputConfig) *CreateLabelingJobInput { - s.InputConfig = v +// SetRepositoryUrl sets the RepositoryUrl field's value. +func (s *GitConfig) SetRepositoryUrl(v string) *GitConfig { + s.RepositoryUrl = &v return s } -// SetLabelAttributeName sets the LabelAttributeName field's value. -func (s *CreateLabelingJobInput) SetLabelAttributeName(v string) *CreateLabelingJobInput { - s.LabelAttributeName = &v +// SetSecretArn sets the SecretArn field's value. +func (s *GitConfig) SetSecretArn(v string) *GitConfig { + s.SecretArn = &v return s } -// SetLabelCategoryConfigS3Uri sets the LabelCategoryConfigS3Uri field's value. -func (s *CreateLabelingJobInput) SetLabelCategoryConfigS3Uri(v string) *CreateLabelingJobInput { - s.LabelCategoryConfigS3Uri = &v - return s +// Specifies configuration details for a Git repository when the repository +// is updated. +type GitConfigForUpdate struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the AWS Secrets Manager secret that contains + // the credentials used to access the git repository. The secret must have a + // staging label of AWSCURRENT and must be in the following format: + // + // {"username": UserName, "password": Password} + SecretArn *string `min:"1" type:"string"` } -// SetLabelingJobAlgorithmsConfig sets the LabelingJobAlgorithmsConfig field's value. -func (s *CreateLabelingJobInput) SetLabelingJobAlgorithmsConfig(v *LabelingJobAlgorithmsConfig) *CreateLabelingJobInput { - s.LabelingJobAlgorithmsConfig = v - return s +// String returns the string representation +func (s GitConfigForUpdate) String() string { + return awsutil.Prettify(s) } -// SetLabelingJobName sets the LabelingJobName field's value. -func (s *CreateLabelingJobInput) SetLabelingJobName(v string) *CreateLabelingJobInput { - s.LabelingJobName = &v - return s +// GoString returns the string representation +func (s GitConfigForUpdate) GoString() string { + return s.String() } -// SetOutputConfig sets the OutputConfig field's value. -func (s *CreateLabelingJobInput) SetOutputConfig(v *LabelingJobOutputConfig) *CreateLabelingJobInput { - s.OutputConfig = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *GitConfigForUpdate) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GitConfigForUpdate"} + if s.SecretArn != nil && len(*s.SecretArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SecretArn", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetRoleArn sets the RoleArn field's value. -func (s *CreateLabelingJobInput) SetRoleArn(v string) *CreateLabelingJobInput { - s.RoleArn = &v +// SetSecretArn sets the SecretArn field's value. +func (s *GitConfigForUpdate) SetSecretArn(v string) *GitConfigForUpdate { + s.SecretArn = &v return s } -// SetStoppingConditions sets the StoppingConditions field's value. -func (s *CreateLabelingJobInput) SetStoppingConditions(v *LabelingJobStoppingConditions) *CreateLabelingJobInput { - s.StoppingConditions = v - return s +// Defines under what conditions SageMaker creates a human loop. Used within . +type HumanLoopActivationConditionsConfig struct { + _ struct{} `type:"structure"` + + // JSON expressing use-case specific conditions declaratively. If any condition + // is matched, atomic tasks are created against the configured work team. The + // set of conditions is different for Rekognition and Textract. + // + // HumanLoopActivationConditions is a required field + HumanLoopActivationConditions aws.JSONValue `type:"jsonvalue" required:"true"` } -// SetTags sets the Tags field's value. -func (s *CreateLabelingJobInput) SetTags(v []*Tag) *CreateLabelingJobInput { - s.Tags = v +// String returns the string representation +func (s HumanLoopActivationConditionsConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HumanLoopActivationConditionsConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *HumanLoopActivationConditionsConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HumanLoopActivationConditionsConfig"} + if s.HumanLoopActivationConditions == nil { + invalidParams.Add(request.NewErrParamRequired("HumanLoopActivationConditions")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHumanLoopActivationConditions sets the HumanLoopActivationConditions field's value. +func (s *HumanLoopActivationConditionsConfig) SetHumanLoopActivationConditions(v aws.JSONValue) *HumanLoopActivationConditionsConfig { + s.HumanLoopActivationConditions = v return s } -type CreateLabelingJobOutput struct { +// Provides information about how and under what conditions SageMaker creates +// a human loop. If HumanLoopActivationConfig is not given, then all requests +// go to humans. +type HumanLoopActivationConfig struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the labeling job. You use this ARN to identify - // the labeling job. + // Container structure for defining under what conditions SageMaker creates + // a human loop. // - // LabelingJobArn is a required field - LabelingJobArn *string `type:"string" required:"true"` + // HumanLoopActivationConditionsConfig is a required field + HumanLoopActivationConditionsConfig *HumanLoopActivationConditionsConfig `type:"structure" required:"true"` + + // Container for configuring the source of human task requests. + // + // HumanLoopRequestSource is a required field + HumanLoopRequestSource *HumanLoopRequestSource `type:"structure" required:"true"` } // String returns the string representation -func (s CreateLabelingJobOutput) String() string { +func (s HumanLoopActivationConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateLabelingJobOutput) GoString() string { +func (s HumanLoopActivationConfig) GoString() string { return s.String() } -// SetLabelingJobArn sets the LabelingJobArn field's value. -func (s *CreateLabelingJobOutput) SetLabelingJobArn(v string) *CreateLabelingJobOutput { - s.LabelingJobArn = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *HumanLoopActivationConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HumanLoopActivationConfig"} + if s.HumanLoopActivationConditionsConfig == nil { + invalidParams.Add(request.NewErrParamRequired("HumanLoopActivationConditionsConfig")) + } + if s.HumanLoopRequestSource == nil { + invalidParams.Add(request.NewErrParamRequired("HumanLoopRequestSource")) + } + if s.HumanLoopActivationConditionsConfig != nil { + if err := s.HumanLoopActivationConditionsConfig.Validate(); err != nil { + invalidParams.AddNested("HumanLoopActivationConditionsConfig", err.(request.ErrInvalidParams)) + } + } + if s.HumanLoopRequestSource != nil { + if err := s.HumanLoopRequestSource.Validate(); err != nil { + invalidParams.AddNested("HumanLoopRequestSource", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHumanLoopActivationConditionsConfig sets the HumanLoopActivationConditionsConfig field's value. +func (s *HumanLoopActivationConfig) SetHumanLoopActivationConditionsConfig(v *HumanLoopActivationConditionsConfig) *HumanLoopActivationConfig { + s.HumanLoopActivationConditionsConfig = v return s } -type CreateModelInput struct { - _ struct{} `type:"structure"` +// SetHumanLoopRequestSource sets the HumanLoopRequestSource field's value. +func (s *HumanLoopActivationConfig) SetHumanLoopRequestSource(v *HumanLoopRequestSource) *HumanLoopActivationConfig { + s.HumanLoopRequestSource = v + return s +} - // Specifies the containers in the inference pipeline. - Containers []*ContainerDefinition `type:"list"` +// Describes the work to be performed by human workers. +type HumanLoopConfig struct { + _ struct{} `type:"structure"` - // Isolates the model container. No inbound or outbound network calls can be - // made to or from the model container. + // The Amazon Resource Name (ARN) of the human task user interface. // - // The Semantic Segmentation built-in algorithm does not support network isolation. - EnableNetworkIsolation *bool `type:"boolean"` + // HumanTaskUiArn is a required field + HumanTaskUiArn *string `type:"string" required:"true"` - // The Amazon Resource Name (ARN) of the IAM role that Amazon SageMaker can - // assume to access model artifacts and docker image for deployment on ML compute - // instances or for batch transform jobs. Deploying on ML compute instances - // is part of model hosting. For more information, see Amazon SageMaker Roles - // (https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html). + // Defines the amount of money paid to an Amazon Mechanical Turk worker for + // each task performed. // - // To be able to pass this role to Amazon SageMaker, the caller of this API - // must have the iam:PassRole permission. + // Use one of the following prices for bounding box tasks. Prices are in US + // dollars and should be based on the complexity of the task; the longer it + // takes in your initial testing, the more you should offer. // - // ExecutionRoleArn is a required field - ExecutionRoleArn *string `min:"20" type:"string" required:"true"` + // * 0.036 + // + // * 0.048 + // + // * 0.060 + // + // * 0.072 + // + // * 0.120 + // + // * 0.240 + // + // * 0.360 + // + // * 0.480 + // + // * 0.600 + // + // * 0.720 + // + // * 0.840 + // + // * 0.960 + // + // * 1.080 + // + // * 1.200 + // + // Use one of the following prices for image classification, text classification, + // and custom tasks. Prices are in US dollars. + // + // * 0.012 + // + // * 0.024 + // + // * 0.036 + // + // * 0.048 + // + // * 0.060 + // + // * 0.072 + // + // * 0.120 + // + // * 0.240 + // + // * 0.360 + // + // * 0.480 + // + // * 0.600 + // + // * 0.720 + // + // * 0.840 + // + // * 0.960 + // + // * 1.080 + // + // * 1.200 + // + // Use one of the following prices for semantic segmentation tasks. Prices are + // in US dollars. + // + // * 0.840 + // + // * 0.960 + // + // * 1.080 + // + // * 1.200 + // + // Use one of the following prices for Textract AnalyzeDocument Important Form + // Key Amazon Augmented AI review tasks. Prices are in US dollars. + // + // * 2.400 + // + // * 2.280 + // + // * 2.160 + // + // * 2.040 + // + // * 1.920 + // + // * 1.800 + // + // * 1.680 + // + // * 1.560 + // + // * 1.440 + // + // * 1.320 + // + // * 1.200 + // + // * 1.080 + // + // * 0.960 + // + // * 0.840 + // + // * 0.720 + // + // * 0.600 + // + // * 0.480 + // + // * 0.360 + // + // * 0.240 + // + // * 0.120 + // + // * 0.072 + // + // * 0.060 + // + // * 0.048 + // + // * 0.036 + // + // * 0.024 + // + // * 0.012 + // + // Use one of the following prices for Rekognition DetectModerationLabels Amazon + // Augmented AI review tasks. Prices are in US dollars. + // + // * 1.200 + // + // * 1.080 + // + // * 0.960 + // + // * 0.840 + // + // * 0.720 + // + // * 0.600 + // + // * 0.480 + // + // * 0.360 + // + // * 0.240 + // + // * 0.120 + // + // * 0.072 + // + // * 0.060 + // + // * 0.048 + // + // * 0.036 + // + // * 0.024 + // + // * 0.012 + // + // Use one of the following prices for Amazon Augmented AI custom human review + // tasks. Prices are in US dollars. + // + // * 1.200 + // + // * 1.080 + // + // * 0.960 + // + // * 0.840 + // + // * 0.720 + // + // * 0.600 + // + // * 0.480 + // + // * 0.360 + // + // * 0.240 + // + // * 0.120 + // + // * 0.072 + // + // * 0.060 + // + // * 0.048 + // + // * 0.036 + // + // * 0.024 + // + // * 0.012 + PublicWorkforceTaskPrice *PublicWorkforceTaskPrice `type:"structure"` - // The name of the new model. + // The length of time that a task remains available for labeling by human workers. + TaskAvailabilityLifetimeInSeconds *int64 `min:"1" type:"integer"` + + // The number of distinct workers who will perform the same task on each object. + // For example, if TaskCount is set to 3 for an image classification labeling + // job, three workers will classify each input image. Increasing TaskCount can + // improve label accuracy. // - // ModelName is a required field - ModelName *string `type:"string" required:"true"` + // TaskCount is a required field + TaskCount *int64 `min:"1" type:"integer" required:"true"` - // The location of the primary docker image containing inference code, associated - // artifacts, and custom environment map that the inference code uses when the - // model is deployed for predictions. - PrimaryContainer *ContainerDefinition `type:"structure"` + // A description for the human worker task. + // + // TaskDescription is a required field + TaskDescription *string `min:"1" type:"string" required:"true"` - // An array of key-value pairs. For more information, see Using Cost Allocation - // Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) - // in the AWS Billing and Cost Management User Guide. - Tags []*Tag `type:"list"` + // Keywords used to describe the task so that workers can discover the task. + TaskKeywords []*string `min:"1" type:"list"` - // A VpcConfig (https://docs.aws.amazon.com/sagemaker/latest/dg/API_VpcConfig.html) - // object that specifies the VPC that you want your model to connect to. Control - // access to and from your model container by configuring the VPC. VpcConfig - // is used in hosting services and in batch transform. For more information, - // see Protect Endpoints by Using an Amazon Virtual Private Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/host-vpc.html) - // and Protect Data in Batch Transform Jobs by Using an Amazon Virtual Private - // Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/batch-vpc.html). - VpcConfig *VpcConfig `type:"structure"` + // The amount of time that a worker has to complete a task. + TaskTimeLimitInSeconds *int64 `min:"30" type:"integer"` + + // A title for the human worker task. + // + // TaskTitle is a required field + TaskTitle *string `min:"1" type:"string" required:"true"` + + // Amazon Resource Name (ARN) of a team of workers. + // + // WorkteamArn is a required field + WorkteamArn *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateModelInput) String() string { +func (s HumanLoopConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateModelInput) GoString() string { +func (s HumanLoopConfig) 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.ExecutionRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("ExecutionRoleArn")) +func (s *HumanLoopConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HumanLoopConfig"} + if s.HumanTaskUiArn == nil { + invalidParams.Add(request.NewErrParamRequired("HumanTaskUiArn")) } - if s.ExecutionRoleArn != nil && len(*s.ExecutionRoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ExecutionRoleArn", 20)) + if s.TaskAvailabilityLifetimeInSeconds != nil && *s.TaskAvailabilityLifetimeInSeconds < 1 { + invalidParams.Add(request.NewErrParamMinValue("TaskAvailabilityLifetimeInSeconds", 1)) } - if s.ModelName == nil { - invalidParams.Add(request.NewErrParamRequired("ModelName")) + if s.TaskCount == nil { + invalidParams.Add(request.NewErrParamRequired("TaskCount")) } - if s.Containers != nil { - for i, v := range s.Containers { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Containers", i), err.(request.ErrInvalidParams)) - } - } + if s.TaskCount != nil && *s.TaskCount < 1 { + invalidParams.Add(request.NewErrParamMinValue("TaskCount", 1)) } - if s.PrimaryContainer != nil { - if err := s.PrimaryContainer.Validate(); err != nil { - invalidParams.AddNested("PrimaryContainer", err.(request.ErrInvalidParams)) - } + if s.TaskDescription == nil { + invalidParams.Add(request.NewErrParamRequired("TaskDescription")) } - 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 s.TaskDescription != nil && len(*s.TaskDescription) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TaskDescription", 1)) } - if s.VpcConfig != nil { - if err := s.VpcConfig.Validate(); err != nil { - invalidParams.AddNested("VpcConfig", err.(request.ErrInvalidParams)) - } + if s.TaskKeywords != nil && len(s.TaskKeywords) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TaskKeywords", 1)) + } + if s.TaskTimeLimitInSeconds != nil && *s.TaskTimeLimitInSeconds < 30 { + invalidParams.Add(request.NewErrParamMinValue("TaskTimeLimitInSeconds", 30)) + } + if s.TaskTitle == nil { + invalidParams.Add(request.NewErrParamRequired("TaskTitle")) + } + if s.TaskTitle != nil && len(*s.TaskTitle) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TaskTitle", 1)) + } + if s.WorkteamArn == nil { + invalidParams.Add(request.NewErrParamRequired("WorkteamArn")) } if invalidParams.Len() > 0 { @@ -9788,142 +28255,87 @@ func (s *CreateModelInput) Validate() error { return nil } -// SetContainers sets the Containers field's value. -func (s *CreateModelInput) SetContainers(v []*ContainerDefinition) *CreateModelInput { - s.Containers = v +// SetHumanTaskUiArn sets the HumanTaskUiArn field's value. +func (s *HumanLoopConfig) SetHumanTaskUiArn(v string) *HumanLoopConfig { + s.HumanTaskUiArn = &v return s } -// SetEnableNetworkIsolation sets the EnableNetworkIsolation field's value. -func (s *CreateModelInput) SetEnableNetworkIsolation(v bool) *CreateModelInput { - s.EnableNetworkIsolation = &v +// SetPublicWorkforceTaskPrice sets the PublicWorkforceTaskPrice field's value. +func (s *HumanLoopConfig) SetPublicWorkforceTaskPrice(v *PublicWorkforceTaskPrice) *HumanLoopConfig { + s.PublicWorkforceTaskPrice = v return s } -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *CreateModelInput) SetExecutionRoleArn(v string) *CreateModelInput { - s.ExecutionRoleArn = &v +// SetTaskAvailabilityLifetimeInSeconds sets the TaskAvailabilityLifetimeInSeconds field's value. +func (s *HumanLoopConfig) SetTaskAvailabilityLifetimeInSeconds(v int64) *HumanLoopConfig { + s.TaskAvailabilityLifetimeInSeconds = &v return s } -// SetModelName sets the ModelName field's value. -func (s *CreateModelInput) SetModelName(v string) *CreateModelInput { - s.ModelName = &v +// SetTaskCount sets the TaskCount field's value. +func (s *HumanLoopConfig) SetTaskCount(v int64) *HumanLoopConfig { + s.TaskCount = &v return s } -// SetPrimaryContainer sets the PrimaryContainer field's value. -func (s *CreateModelInput) SetPrimaryContainer(v *ContainerDefinition) *CreateModelInput { - s.PrimaryContainer = v +// SetTaskDescription sets the TaskDescription field's value. +func (s *HumanLoopConfig) SetTaskDescription(v string) *HumanLoopConfig { + s.TaskDescription = &v return s } -// SetTags sets the Tags field's value. -func (s *CreateModelInput) SetTags(v []*Tag) *CreateModelInput { - s.Tags = v +// SetTaskKeywords sets the TaskKeywords field's value. +func (s *HumanLoopConfig) SetTaskKeywords(v []*string) *HumanLoopConfig { + s.TaskKeywords = v return s } -// SetVpcConfig sets the VpcConfig field's value. -func (s *CreateModelInput) SetVpcConfig(v *VpcConfig) *CreateModelInput { - s.VpcConfig = v +// SetTaskTimeLimitInSeconds sets the TaskTimeLimitInSeconds field's value. +func (s *HumanLoopConfig) SetTaskTimeLimitInSeconds(v int64) *HumanLoopConfig { + s.TaskTimeLimitInSeconds = &v return s } -type CreateModelOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the model created in Amazon SageMaker. - // - // ModelArn is a required field - ModelArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateModelOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateModelOutput) GoString() string { - return s.String() +// SetTaskTitle sets the TaskTitle field's value. +func (s *HumanLoopConfig) SetTaskTitle(v string) *HumanLoopConfig { + s.TaskTitle = &v + return s } -// SetModelArn sets the ModelArn field's value. -func (s *CreateModelOutput) SetModelArn(v string) *CreateModelOutput { - s.ModelArn = &v +// SetWorkteamArn sets the WorkteamArn field's value. +func (s *HumanLoopConfig) SetWorkteamArn(v string) *HumanLoopConfig { + s.WorkteamArn = &v return s } -type CreateModelPackageInput struct { +// Container for configuring the source of human task requests. +type HumanLoopRequestSource struct { _ struct{} `type:"structure"` - // Whether to certify the model package for listing on AWS Marketplace. - CertifyForMarketplace *bool `type:"boolean"` - - // Specifies details about inference jobs that can be run with models based - // on this model package, including the following: - // - // * The Amazon ECR paths of containers that contain the inference code and - // model artifacts. - // - // * The instance types that the model package supports for transform jobs - // and real-time endpoints used for inference. - // - // * The input and output content formats that the model package supports - // for inference. - InferenceSpecification *InferenceSpecification `type:"structure"` - - // A description of the model package. - ModelPackageDescription *string `type:"string"` - - // The name of the model package. The name must have 1 to 63 characters. Valid - // characters are a-z, A-Z, 0-9, and - (hyphen). + // Specifies whether Amazon Rekognition or Amazon Textract are used as the integration + // source. The default field settings and JSON parsing rules are different based + // on the integration source. Valid values: // - // ModelPackageName is a required field - ModelPackageName *string `min:"1" type:"string" required:"true"` - - // Details about the algorithm that was used to create the model package. - SourceAlgorithmSpecification *SourceAlgorithmSpecification `type:"structure"` - - // Specifies configurations for one or more transform jobs that Amazon SageMaker - // runs to test the model package. - ValidationSpecification *ModelPackageValidationSpecification `type:"structure"` + // AwsManagedHumanLoopRequestSource is a required field + AwsManagedHumanLoopRequestSource *string `type:"string" required:"true" enum:"AwsManagedHumanLoopRequestSource"` } // String returns the string representation -func (s CreateModelPackageInput) String() string { +func (s HumanLoopRequestSource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateModelPackageInput) GoString() string { +func (s HumanLoopRequestSource) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateModelPackageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateModelPackageInput"} - if s.ModelPackageName == nil { - invalidParams.Add(request.NewErrParamRequired("ModelPackageName")) - } - if s.ModelPackageName != nil && len(*s.ModelPackageName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ModelPackageName", 1)) - } - if s.InferenceSpecification != nil { - if err := s.InferenceSpecification.Validate(); err != nil { - invalidParams.AddNested("InferenceSpecification", err.(request.ErrInvalidParams)) - } - } - if s.SourceAlgorithmSpecification != nil { - if err := s.SourceAlgorithmSpecification.Validate(); err != nil { - invalidParams.AddNested("SourceAlgorithmSpecification", err.(request.ErrInvalidParams)) - } - } - if s.ValidationSpecification != nil { - if err := s.ValidationSpecification.Validate(); err != nil { - invalidParams.AddNested("ValidationSpecification", err.(request.ErrInvalidParams)) - } +func (s *HumanLoopRequestSource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HumanLoopRequestSource"} + if s.AwsManagedHumanLoopRequestSource == nil { + invalidParams.Add(request.NewErrParamRequired("AwsManagedHumanLoopRequestSource")) } if invalidParams.Len() > 0 { @@ -9932,205 +28344,390 @@ func (s *CreateModelPackageInput) Validate() error { return nil } -// SetCertifyForMarketplace sets the CertifyForMarketplace field's value. -func (s *CreateModelPackageInput) SetCertifyForMarketplace(v bool) *CreateModelPackageInput { - s.CertifyForMarketplace = &v - return s -} - -// SetInferenceSpecification sets the InferenceSpecification field's value. -func (s *CreateModelPackageInput) SetInferenceSpecification(v *InferenceSpecification) *CreateModelPackageInput { - s.InferenceSpecification = v - return s -} - -// SetModelPackageDescription sets the ModelPackageDescription field's value. -func (s *CreateModelPackageInput) SetModelPackageDescription(v string) *CreateModelPackageInput { - s.ModelPackageDescription = &v - return s -} - -// SetModelPackageName sets the ModelPackageName field's value. -func (s *CreateModelPackageInput) SetModelPackageName(v string) *CreateModelPackageInput { - s.ModelPackageName = &v - return s -} - -// SetSourceAlgorithmSpecification sets the SourceAlgorithmSpecification field's value. -func (s *CreateModelPackageInput) SetSourceAlgorithmSpecification(v *SourceAlgorithmSpecification) *CreateModelPackageInput { - s.SourceAlgorithmSpecification = v - return s -} - -// SetValidationSpecification sets the ValidationSpecification field's value. -func (s *CreateModelPackageInput) SetValidationSpecification(v *ModelPackageValidationSpecification) *CreateModelPackageInput { - s.ValidationSpecification = v +// SetAwsManagedHumanLoopRequestSource sets the AwsManagedHumanLoopRequestSource field's value. +func (s *HumanLoopRequestSource) SetAwsManagedHumanLoopRequestSource(v string) *HumanLoopRequestSource { + s.AwsManagedHumanLoopRequestSource = &v return s } -type CreateModelPackageOutput struct { +// Information required for human workers to complete a labeling task. +type HumanTaskConfig struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the new model package. + // Configures how labels are consolidated across human workers. // - // ModelPackageArn is a required field - ModelPackageArn *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s CreateModelPackageOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateModelPackageOutput) GoString() string { - return s.String() -} - -// SetModelPackageArn sets the ModelPackageArn field's value. -func (s *CreateModelPackageOutput) SetModelPackageArn(v string) *CreateModelPackageOutput { - s.ModelPackageArn = &v - return s -} - -type CreateNotebookInstanceInput struct { - _ struct{} `type:"structure"` - - // A list of Elastic Inference (EI) instance types to associate with this notebook - // instance. Currently, only one instance type can be associated with a notebook - // instance. For more information, see Using Elastic Inference in Amazon SageMaker - // (https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html). - AcceleratorTypes []*string `type:"list"` - - // An array of up to three Git repositories to associate with the notebook instance. - // These can be either the names of Git repositories stored as resources in - // your account, or the URL of Git repositories in AWS CodeCommit (codecommit/latest/userguide/welcome.html) - // or in any other Git repository. These repositories are cloned at the same - // level as the default repository of your notebook instance. For more information, - // see Associating Git Repositories with Amazon SageMaker Notebook Instances - // (https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html). - AdditionalCodeRepositories []*string `type:"list"` + // AnnotationConsolidationConfig is a required field + AnnotationConsolidationConfig *AnnotationConsolidationConfig `type:"structure" required:"true"` - // A Git repository to associate with the notebook instance as its default code - // repository. This can be either the name of a Git repository stored as a resource - // in your account, or the URL of a Git repository in AWS CodeCommit (https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html) - // or in any other Git repository. When you open a notebook instance, it opens - // in the directory that contains this repository. For more information, see - // Associating Git Repositories with Amazon SageMaker Notebook Instances (https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html). - DefaultCodeRepository *string `min:"1" type:"string"` + // Defines the maximum number of data objects that can be labeled by human workers + // at the same time. Also referred to as batch size. Each object may have more + // than one worker at one time. The default value is 1000 objects. + MaxConcurrentTaskCount *int64 `min:"1" type:"integer"` - // Sets whether Amazon SageMaker provides internet access to the notebook instance. - // If you set this to Disabled this notebook instance will be able to access - // resources only in your VPC, and will not be able to connect to Amazon SageMaker - // training and endpoint services unless your configure a NAT Gateway in your - // VPC. + // The number of human workers that will label an object. // - // For more information, see Notebook Instances Are Internet-Enabled by Default - // (https://docs.aws.amazon.com/sagemaker/latest/dg/appendix-additional-considerations.html#appendix-notebook-and-internet-access). - // You can set the value of this parameter to Disabled only if you set a value - // for the SubnetId parameter. - DirectInternetAccess *string `type:"string" enum:"DirectInternetAccess"` + // NumberOfHumanWorkersPerDataObject is a required field + NumberOfHumanWorkersPerDataObject *int64 `min:"1" type:"integer" required:"true"` - // The type of ML compute instance to launch for the notebook instance. + // The Amazon Resource Name (ARN) of a Lambda function that is run before a + // data object is sent to a human worker. Use this function to provide input + // to a custom labeling job. // - // InstanceType is a required field - InstanceType *string `type:"string" required:"true" enum:"InstanceType"` - - // The Amazon Resource Name (ARN) of a AWS Key Management Service key that Amazon - // SageMaker uses to encrypt data on the storage volume attached to your notebook - // instance. The KMS key you provide must be enabled. For information, see Enabling - // and Disabling Keys (https://docs.aws.amazon.com/kms/latest/developerguide/enabling-keys.html) - // in the AWS Key Management Service Developer Guide. - KmsKeyId *string `type:"string"` - - // The name of a lifecycle configuration to associate with the notebook instance. - // For information about lifestyle configurations, see Step 2.1: (Optional) - // Customize a Notebook Instance (https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html). - LifecycleConfigName *string `type:"string"` - - // The name of the new notebook instance. + // For the built-in bounding box, image classification, semantic segmentation, + // and text classification task types, Amazon SageMaker Ground Truth provides + // the following Lambda functions: // - // NotebookInstanceName is a required field - NotebookInstanceName *string `type:"string" required:"true"` - - // When you send any requests to AWS resources from the notebook instance, Amazon - // SageMaker assumes this role to perform tasks on your behalf. You must grant - // this role necessary permissions so Amazon SageMaker can perform these tasks. - // The policy must allow the Amazon SageMaker service principal (sagemaker.amazonaws.com) - // permissionsto to assume this role. For more information, see Amazon SageMaker - // Roles (https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html). + // US East (Northern Virginia) (us-east-1): // - // To be able to pass this role to Amazon SageMaker, the caller of this API - // must have the iam:PassRole permission. + // * arn:aws:lambda:us-east-1:432418664414:function:PRE-BoundingBox // - // RoleArn is a required field - RoleArn *string `min:"20" type:"string" required:"true"` + // * arn:aws:lambda:us-east-1:432418664414:function:PRE-ImageMultiClass + // + // * arn:aws:lambda:us-east-1:432418664414:function:PRE-SemanticSegmentation + // + // * arn:aws:lambda:us-east-1:432418664414:function:PRE-TextMultiClass + // + // * arn:aws:lambda:us-east-1:432418664414:function:PRE-NamedEntityRecognition + // + // * arn:aws:lambda:us-east-1:432418664414:function:PRE-VerificationBoundingBox + // + // * arn:aws:lambda:us-east-1:432418664414:function:PRE-VerificationSemanticSegmentation + // + // * arn:aws:lambda:us-east-1:432418664414:function:PRE-AdjustmentBoundingBox + // + // * arn:aws:lambda:us-east-1:432418664414:function:PRE-AdjustmentSemanticSegmentation + // + // US East (Ohio) (us-east-2): + // + // * arn:aws:lambda:us-east-2:266458841044:function:PRE-BoundingBox + // + // * arn:aws:lambda:us-east-2:266458841044:function:PRE-ImageMultiClass + // + // * arn:aws:lambda:us-east-2:266458841044:function:PRE-SemanticSegmentation + // + // * arn:aws:lambda:us-east-2:266458841044:function:PRE-TextMultiClass + // + // * arn:aws:lambda:us-east-2:266458841044:function:PRE-NamedEntityRecognition + // + // * arn:aws:lambda:us-east-2:266458841044:function:PRE-VerificationBoundingBox + // + // * arn:aws:lambda:us-east-2:266458841044:function:PRE-VerificationSemanticSegmentation + // + // * arn:aws:lambda:us-east-2:266458841044:function:PRE-AdjustmentBoundingBox + // + // * arn:aws:lambda:us-east-2:266458841044:function:PRE-AdjustmentSemanticSegmentation + // + // US West (Oregon) (us-west-2): + // + // * arn:aws:lambda:us-west-2:081040173940:function:PRE-BoundingBox + // + // * arn:aws:lambda:us-west-2:081040173940:function:PRE-ImageMultiClass + // + // * arn:aws:lambda:us-west-2:081040173940:function:PRE-SemanticSegmentation + // + // * arn:aws:lambda:us-west-2:081040173940:function:PRE-TextMultiClass + // + // * arn:aws:lambda:us-west-2:081040173940:function:PRE-NamedEntityRecognition + // + // * arn:aws:lambda:us-west-2:081040173940:function:PRE-VerificationBoundingBox + // + // * arn:aws:lambda:us-west-2:081040173940:function:PRE-VerificationSemanticSegmentation + // + // * arn:aws:lambda:us-west-2:081040173940:function:PRE-AdjustmentBoundingBox + // + // * arn:aws:lambda:us-west-2:081040173940:function:PRE-AdjustmentSemanticSegmentation + // + // Canada (Central) (ca-central-1): + // + // * arn:aws:lambda:ca-central-1:918755190332:function:PRE-BoundingBox + // + // * arn:aws:lambda:ca-central-1:918755190332:function:PRE-ImageMultiClass + // + // * arn:aws:lambda:ca-central-1:918755190332:function:PRE-SemanticSegmentation + // + // * arn:aws:lambda:ca-central-1:918755190332:function:PRE-TextMultiClass + // + // * arn:aws:lambda:ca-central-1:918755190332:function:PRE-NamedEntityRecognition + // + // * arn:aws:lambda:ca-central-1:918755190332:function:PRE-VerificationBoundingBox + // + // * arn:aws:lambda:ca-central-1:918755190332:function:PRE-VerificationSemanticSegmentation + // + // * arn:aws:lambda:ca-central-1:918755190332:function:PRE-AdjustmentBoundingBox + // + // * arn:aws:lambda:ca-central-1:918755190332:function:PRE-AdjustmentSemanticSegmentation + // + // EU (Ireland) (eu-west-1): + // + // * arn:aws:lambda:eu-west-1:568282634449:function:PRE-BoundingBox + // + // * arn:aws:lambda:eu-west-1:568282634449:function:PRE-ImageMultiClass + // + // * arn:aws:lambda:eu-west-1:568282634449:function:PRE-SemanticSegmentation + // + // * arn:aws:lambda:eu-west-1:568282634449:function:PRE-TextMultiClass + // + // * arn:aws:lambda:eu-west-1:568282634449:function:PRE-NamedEntityRecognition + // + // * arn:aws:lambda:eu-west-1:568282634449:function:PRE-VerificationBoundingBox + // + // * arn:aws:lambda:eu-west-1:568282634449:function:PRE-VerificationSemanticSegmentation + // + // * arn:aws:lambda:eu-west-1:568282634449:function:PRE-AdjustmentBoundingBox + // + // * arn:aws:lambda:eu-west-1:568282634449:function:PRE-AdjustmentSemanticSegmentation + // + // EU (London) (eu-west-2): + // + // * arn:aws:lambda:eu-west-2:487402164563:function:PRE-BoundingBox + // + // * arn:aws:lambda:eu-west-2:487402164563:function:PRE-ImageMultiClass + // + // * arn:aws:lambda:eu-west-2:487402164563:function:PRE-SemanticSegmentation + // + // * arn:aws:lambda:eu-west-2:487402164563:function:PRE-TextMultiClass + // + // * arn:aws:lambda:eu-west-2:487402164563:function:PRE-NamedEntityRecognition + // + // * arn:aws:lambda:eu-west-2:487402164563:function:PRE-VerificationBoundingBox + // + // * arn:aws:lambda:eu-west-2:487402164563:function:PRE-VerificationSemanticSegmentation + // + // * arn:aws:lambda:eu-west-2:487402164563:function:PRE-AdjustmentBoundingBox + // + // * arn:aws:lambda:eu-west-2:487402164563:function:PRE-AdjustmentSemanticSegmentation + // + // EU Frankfurt (eu-central-1): + // + // * arn:aws:lambda:eu-central-1:203001061592:function:PRE-BoundingBox + // + // * arn:aws:lambda:eu-central-1:203001061592:function:PRE-ImageMultiClass + // + // * arn:aws:lambda:eu-central-1:203001061592:function:PRE-SemanticSegmentation + // + // * arn:aws:lambda:eu-central-1:203001061592:function:PRE-TextMultiClass + // + // * arn:aws:lambda:eu-central-1:203001061592:function:PRE-NamedEntityRecognition + // + // * arn:aws:lambda:eu-central-1:203001061592:function:PRE-VerificationBoundingBox + // + // * arn:aws:lambda:eu-central-1:203001061592:function:PRE-VerificationSemanticSegmentation + // + // * arn:aws:lambda:eu-central-1:203001061592:function:PRE-AdjustmentBoundingBox + // + // * arn:aws:lambda:eu-central-1:203001061592:function:PRE-AdjustmentSemanticSegmentation + // + // Asia Pacific (Tokyo) (ap-northeast-1): + // + // * arn:aws:lambda:ap-northeast-1:477331159723:function:PRE-BoundingBox + // + // * arn:aws:lambda:ap-northeast-1:477331159723:function:PRE-ImageMultiClass + // + // * arn:aws:lambda:ap-northeast-1:477331159723:function:PRE-SemanticSegmentation + // + // * arn:aws:lambda:ap-northeast-1:477331159723:function:PRE-TextMultiClass + // + // * arn:aws:lambda:ap-northeast-1:477331159723:function:PRE-NamedEntityRecognition + // + // * arn:aws:lambda:ap-northeast-1:477331159723:function:PRE-VerificationBoundingBox + // + // * arn:aws:lambda:ap-northeast-1:477331159723:function:PRE-VerificationSemanticSegmentation + // + // * arn:aws:lambda:ap-northeast-1:477331159723:function:PRE-AdjustmentBoundingBox + // + // * arn:aws:lambda:ap-northeast-1:477331159723:function:PRE-AdjustmentSemanticSegmentation + // + // Asia Pacific (Seoul) (ap-northeast-2): + // + // * arn:aws:lambda:ap-northeast-2:845288260483:function:PRE-BoundingBox + // + // * arn:aws:lambda:ap-northeast-2:845288260483:function:PRE-ImageMultiClass + // + // * arn:aws:lambda:ap-northeast-2:845288260483:function:PRE-SemanticSegmentation + // + // * arn:aws:lambda:ap-northeast-2:845288260483:function:PRE-TextMultiClass + // + // * arn:aws:lambda:ap-northeast-2:845288260483:function:PRE-NamedEntityRecognition + // + // * arn:aws:lambda:ap-northeast-2:845288260483:function:PRE-VerificationBoundingBox + // + // * arn:aws:lambda:ap-northeast-2:845288260483:function:PRE-VerificationSemanticSegmentation + // + // * arn:aws:lambda:ap-northeast-2:845288260483:function:PRE-AdjustmentBoundingBox + // + // * arn:aws:lambda:ap-northeast-2:845288260483:function:PRE-AdjustmentSemanticSegmentation + // + // Asia Pacific (Mumbai) (ap-south-1): + // + // * arn:aws:lambda:ap-south-1:565803892007:function:PRE-BoundingBox + // + // * arn:aws:lambda:ap-south-1:565803892007:function:PRE-ImageMultiClass + // + // * arn:aws:lambda:ap-south-1:565803892007:function:PRE-SemanticSegmentation + // + // * arn:aws:lambda:ap-south-1:565803892007:function:PRE-TextMultiClass + // + // * arn:aws:lambda:ap-south-1:565803892007:function:PRE-NamedEntityRecognition + // + // * arn:aws:lambda:ap-south-1:565803892007:function:PRE-VerificationBoundingBox + // + // * arn:aws:lambda:ap-south-1:565803892007:function:PRE-VerificationSemanticSegmentation + // + // * arn:aws:lambda:ap-south-1:565803892007:function:PRE-AdjustmentBoundingBox + // + // * arn:aws:lambda:ap-south-1:565803892007:function:PRE-AdjustmentSemanticSegmentation + // + // Asia Pacific (Singapore) (ap-southeast-1): + // + // * arn:aws:lambda:ap-southeast-1:377565633583:function:PRE-BoundingBox + // + // * arn:aws:lambda:ap-southeast-1:377565633583:function:PRE-ImageMultiClass + // + // * arn:aws:lambda:ap-southeast-1:377565633583:function:PRE-SemanticSegmentation + // + // * arn:aws:lambda:ap-southeast-1:377565633583:function:PRE-TextMultiClass + // + // * arn:aws:lambda:ap-southeast-1:377565633583:function:PRE-NamedEntityRecognition + // + // * arn:aws:lambda:ap-southeast-1:377565633583:function:PRE-VerificationBoundingBox + // + // * arn:aws:lambda:ap-southeast-1:377565633583:function:PRE-VerificationSemanticSegmentation + // + // * arn:aws:lambda:ap-southeast-1:377565633583:function:PRE-AdjustmentBoundingBox + // + // * arn:aws:lambda:ap-southeast-1:377565633583:function:PRE-AdjustmentSemanticSegmentation + // + // Asia Pacific (Sydney) (ap-southeast-2): + // + // * arn:aws:lambda:ap-southeast-2:454466003867:function:PRE-BoundingBox + // + // * arn:aws:lambda:ap-southeast-2:454466003867:function:PRE-ImageMultiClass + // + // * arn:aws:lambda:ap-southeast-2:454466003867:function:PRE-SemanticSegmentation + // + // * arn:aws:lambda:ap-southeast-2:454466003867:function:PRE-TextMultiClass + // + // * arn:aws:lambda:ap-southeast-2:454466003867:function:PRE-NamedEntityRecognition + // + // * arn:aws:lambda:ap-southeast-2:454466003867:function:PRE-VerificationBoundingBox + // + // * arn:aws:lambda:ap-southeast-2:454466003867:function:PRE-VerificationSemanticSegmentation + // + // * arn:aws:lambda:ap-southeast-2:454466003867:function:PRE-AdjustmentBoundingBox + // + // * arn:aws:lambda:ap-southeast-2:454466003867:function:PRE-AdjustmentSemanticSegmentation + // + // PreHumanTaskLambdaArn is a required field + PreHumanTaskLambdaArn *string `type:"string" required:"true"` - // Whether root access is enabled or disabled for users of the notebook instance. - // The default value is Enabled. + // The price that you pay for each task performed by an Amazon Mechanical Turk + // worker. + PublicWorkforceTaskPrice *PublicWorkforceTaskPrice `type:"structure"` + + // The length of time that a task remains available for labeling by human workers. + // If you choose the Amazon Mechanical Turk workforce, the maximum is 12 hours + // (43200). The default value is 864000 seconds (1 day). For private and vendor + // workforces, the maximum is as listed. + TaskAvailabilityLifetimeInSeconds *int64 `min:"60" type:"integer"` + + // A description of the task for your human workers. // - // Lifecycle configurations need root access to be able to set up a notebook - // instance. Because of this, lifecycle configurations associated with a notebook - // instance always run with root access even if you disable root access for - // users. - RootAccess *string `type:"string" enum:"RootAccess"` + // TaskDescription is a required field + TaskDescription *string `min:"1" type:"string" required:"true"` - // The VPC security group IDs, in the form sg-xxxxxxxx. The security groups - // must be for the same VPC as specified in the subnet. - SecurityGroupIds []*string `type:"list"` + // Keywords used to describe the task so that workers on Amazon Mechanical Turk + // can discover the task. + TaskKeywords []*string `min:"1" type:"list"` - // The ID of the subnet in a VPC to which you would like to have a connectivity - // from your ML compute instance. - SubnetId *string `type:"string"` + // The amount of time that a worker has to complete a task. + // + // TaskTimeLimitInSeconds is a required field + TaskTimeLimitInSeconds *int64 `min:"30" type:"integer" required:"true"` - // A list of tags to associate with the notebook instance. You can add tags - // later by using the CreateTags API. - Tags []*Tag `type:"list"` + // A title for the task for your human workers. + // + // TaskTitle is a required field + TaskTitle *string `min:"1" type:"string" required:"true"` - // The size, in GB, of the ML storage volume to attach to the notebook instance. - // The default value is 5 GB. - VolumeSizeInGB *int64 `min:"5" type:"integer"` + // Information about the user interface that workers use to complete the labeling + // task. + // + // UiConfig is a required field + UiConfig *UiConfig `type:"structure" required:"true"` + + // The Amazon Resource Name (ARN) of the work team assigned to complete the + // tasks. + // + // WorkteamArn is a required field + WorkteamArn *string `type:"string" required:"true"` } // String returns the string representation -func (s CreateNotebookInstanceInput) String() string { +func (s HumanTaskConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateNotebookInstanceInput) GoString() string { +func (s HumanTaskConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateNotebookInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateNotebookInstanceInput"} - if s.DefaultCodeRepository != nil && len(*s.DefaultCodeRepository) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DefaultCodeRepository", 1)) +func (s *HumanTaskConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HumanTaskConfig"} + if s.AnnotationConsolidationConfig == nil { + invalidParams.Add(request.NewErrParamRequired("AnnotationConsolidationConfig")) } - if s.InstanceType == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceType")) + if s.MaxConcurrentTaskCount != nil && *s.MaxConcurrentTaskCount < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxConcurrentTaskCount", 1)) } - if s.NotebookInstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("NotebookInstanceName")) + if s.NumberOfHumanWorkersPerDataObject == nil { + invalidParams.Add(request.NewErrParamRequired("NumberOfHumanWorkersPerDataObject")) } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) + if s.NumberOfHumanWorkersPerDataObject != nil && *s.NumberOfHumanWorkersPerDataObject < 1 { + invalidParams.Add(request.NewErrParamMinValue("NumberOfHumanWorkersPerDataObject", 1)) } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) + if s.PreHumanTaskLambdaArn == nil { + invalidParams.Add(request.NewErrParamRequired("PreHumanTaskLambdaArn")) } - if s.VolumeSizeInGB != nil && *s.VolumeSizeInGB < 5 { - invalidParams.Add(request.NewErrParamMinValue("VolumeSizeInGB", 5)) + if s.TaskAvailabilityLifetimeInSeconds != nil && *s.TaskAvailabilityLifetimeInSeconds < 60 { + invalidParams.Add(request.NewErrParamMinValue("TaskAvailabilityLifetimeInSeconds", 60)) } - 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 s.TaskDescription == nil { + invalidParams.Add(request.NewErrParamRequired("TaskDescription")) + } + if s.TaskDescription != nil && len(*s.TaskDescription) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TaskDescription", 1)) + } + if s.TaskKeywords != nil && len(s.TaskKeywords) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TaskKeywords", 1)) + } + if s.TaskTimeLimitInSeconds == nil { + invalidParams.Add(request.NewErrParamRequired("TaskTimeLimitInSeconds")) + } + if s.TaskTimeLimitInSeconds != nil && *s.TaskTimeLimitInSeconds < 30 { + invalidParams.Add(request.NewErrParamMinValue("TaskTimeLimitInSeconds", 30)) + } + if s.TaskTitle == nil { + invalidParams.Add(request.NewErrParamRequired("TaskTitle")) + } + if s.TaskTitle != nil && len(*s.TaskTitle) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TaskTitle", 1)) + } + if s.UiConfig == nil { + invalidParams.Add(request.NewErrParamRequired("UiConfig")) + } + if s.WorkteamArn == nil { + invalidParams.Add(request.NewErrParamRequired("WorkteamArn")) + } + if s.AnnotationConsolidationConfig != nil { + if err := s.AnnotationConsolidationConfig.Validate(); err != nil { + invalidParams.AddNested("AnnotationConsolidationConfig", err.(request.ErrInvalidParams)) + } + } + if s.UiConfig != nil { + if err := s.UiConfig.Validate(); err != nil { + invalidParams.AddNested("UiConfig", err.(request.ErrInvalidParams)) } } @@ -10140,141 +28737,190 @@ func (s *CreateNotebookInstanceInput) Validate() error { return nil } -// SetAcceleratorTypes sets the AcceleratorTypes field's value. -func (s *CreateNotebookInstanceInput) SetAcceleratorTypes(v []*string) *CreateNotebookInstanceInput { - s.AcceleratorTypes = v +// SetAnnotationConsolidationConfig sets the AnnotationConsolidationConfig field's value. +func (s *HumanTaskConfig) SetAnnotationConsolidationConfig(v *AnnotationConsolidationConfig) *HumanTaskConfig { + s.AnnotationConsolidationConfig = v return s } -// SetAdditionalCodeRepositories sets the AdditionalCodeRepositories field's value. -func (s *CreateNotebookInstanceInput) SetAdditionalCodeRepositories(v []*string) *CreateNotebookInstanceInput { - s.AdditionalCodeRepositories = v +// SetMaxConcurrentTaskCount sets the MaxConcurrentTaskCount field's value. +func (s *HumanTaskConfig) SetMaxConcurrentTaskCount(v int64) *HumanTaskConfig { + s.MaxConcurrentTaskCount = &v return s } -// SetDefaultCodeRepository sets the DefaultCodeRepository field's value. -func (s *CreateNotebookInstanceInput) SetDefaultCodeRepository(v string) *CreateNotebookInstanceInput { - s.DefaultCodeRepository = &v +// SetNumberOfHumanWorkersPerDataObject sets the NumberOfHumanWorkersPerDataObject field's value. +func (s *HumanTaskConfig) SetNumberOfHumanWorkersPerDataObject(v int64) *HumanTaskConfig { + s.NumberOfHumanWorkersPerDataObject = &v return s } -// SetDirectInternetAccess sets the DirectInternetAccess field's value. -func (s *CreateNotebookInstanceInput) SetDirectInternetAccess(v string) *CreateNotebookInstanceInput { - s.DirectInternetAccess = &v +// SetPreHumanTaskLambdaArn sets the PreHumanTaskLambdaArn field's value. +func (s *HumanTaskConfig) SetPreHumanTaskLambdaArn(v string) *HumanTaskConfig { + s.PreHumanTaskLambdaArn = &v return s } -// SetInstanceType sets the InstanceType field's value. -func (s *CreateNotebookInstanceInput) SetInstanceType(v string) *CreateNotebookInstanceInput { - s.InstanceType = &v +// SetPublicWorkforceTaskPrice sets the PublicWorkforceTaskPrice field's value. +func (s *HumanTaskConfig) SetPublicWorkforceTaskPrice(v *PublicWorkforceTaskPrice) *HumanTaskConfig { + s.PublicWorkforceTaskPrice = v return s } -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateNotebookInstanceInput) SetKmsKeyId(v string) *CreateNotebookInstanceInput { - s.KmsKeyId = &v +// SetTaskAvailabilityLifetimeInSeconds sets the TaskAvailabilityLifetimeInSeconds field's value. +func (s *HumanTaskConfig) SetTaskAvailabilityLifetimeInSeconds(v int64) *HumanTaskConfig { + s.TaskAvailabilityLifetimeInSeconds = &v return s } -// SetLifecycleConfigName sets the LifecycleConfigName field's value. -func (s *CreateNotebookInstanceInput) SetLifecycleConfigName(v string) *CreateNotebookInstanceInput { - s.LifecycleConfigName = &v +// SetTaskDescription sets the TaskDescription field's value. +func (s *HumanTaskConfig) SetTaskDescription(v string) *HumanTaskConfig { + s.TaskDescription = &v return s } -// SetNotebookInstanceName sets the NotebookInstanceName field's value. -func (s *CreateNotebookInstanceInput) SetNotebookInstanceName(v string) *CreateNotebookInstanceInput { - s.NotebookInstanceName = &v +// SetTaskKeywords sets the TaskKeywords field's value. +func (s *HumanTaskConfig) SetTaskKeywords(v []*string) *HumanTaskConfig { + s.TaskKeywords = v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *CreateNotebookInstanceInput) SetRoleArn(v string) *CreateNotebookInstanceInput { - s.RoleArn = &v +// SetTaskTimeLimitInSeconds sets the TaskTimeLimitInSeconds field's value. +func (s *HumanTaskConfig) SetTaskTimeLimitInSeconds(v int64) *HumanTaskConfig { + s.TaskTimeLimitInSeconds = &v return s } -// SetRootAccess sets the RootAccess field's value. -func (s *CreateNotebookInstanceInput) SetRootAccess(v string) *CreateNotebookInstanceInput { - s.RootAccess = &v +// SetTaskTitle sets the TaskTitle field's value. +func (s *HumanTaskConfig) SetTaskTitle(v string) *HumanTaskConfig { + s.TaskTitle = &v return s } -// SetSecurityGroupIds sets the SecurityGroupIds field's value. -func (s *CreateNotebookInstanceInput) SetSecurityGroupIds(v []*string) *CreateNotebookInstanceInput { - s.SecurityGroupIds = v +// SetUiConfig sets the UiConfig field's value. +func (s *HumanTaskConfig) SetUiConfig(v *UiConfig) *HumanTaskConfig { + s.UiConfig = v return s } -// SetSubnetId sets the SubnetId field's value. -func (s *CreateNotebookInstanceInput) SetSubnetId(v string) *CreateNotebookInstanceInput { - s.SubnetId = &v +// SetWorkteamArn sets the WorkteamArn field's value. +func (s *HumanTaskConfig) SetWorkteamArn(v string) *HumanTaskConfig { + s.WorkteamArn = &v return s } -// SetTags sets the Tags field's value. -func (s *CreateNotebookInstanceInput) SetTags(v []*Tag) *CreateNotebookInstanceInput { - s.Tags = v +// Container for human task user interface information. +type HumanTaskUiSummary struct { + _ struct{} `type:"structure"` + + // A timestamp when SageMaker created the human task user interface. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // The Amazon Resource Name (ARN) of the human task user interface. + // + // HumanTaskUiArn is a required field + HumanTaskUiArn *string `type:"string" required:"true"` + + // The name of the human task user interface. + // + // HumanTaskUiName is a required field + HumanTaskUiName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s HumanTaskUiSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HumanTaskUiSummary) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *HumanTaskUiSummary) SetCreationTime(v time.Time) *HumanTaskUiSummary { + s.CreationTime = &v return s } -// SetVolumeSizeInGB sets the VolumeSizeInGB field's value. -func (s *CreateNotebookInstanceInput) SetVolumeSizeInGB(v int64) *CreateNotebookInstanceInput { - s.VolumeSizeInGB = &v +// SetHumanTaskUiArn sets the HumanTaskUiArn field's value. +func (s *HumanTaskUiSummary) SetHumanTaskUiArn(v string) *HumanTaskUiSummary { + s.HumanTaskUiArn = &v return s } -type CreateNotebookInstanceLifecycleConfigInput struct { +// SetHumanTaskUiName sets the HumanTaskUiName field's value. +func (s *HumanTaskUiSummary) SetHumanTaskUiName(v string) *HumanTaskUiSummary { + s.HumanTaskUiName = &v + return s +} + +// Specifies which training algorithm to use for training jobs that a hyperparameter +// tuning job launches and the metrics to monitor. +type HyperParameterAlgorithmSpecification struct { _ struct{} `type:"structure"` - // The name of the lifecycle configuration. - // - // NotebookInstanceLifecycleConfigName is a required field - NotebookInstanceLifecycleConfigName *string `type:"string" required:"true"` + // The name of the resource algorithm to use for the hyperparameter tuning job. + // If you specify a value for this parameter, do not specify a value for TrainingImage. + AlgorithmName *string `min:"1" type:"string"` - // A shell script that runs only once, when you create a notebook instance. - // The shell script must be a base64-encoded string. - OnCreate []*NotebookInstanceLifecycleHook `type:"list"` + // An array of MetricDefinition objects that specify the metrics that the algorithm + // emits. + MetricDefinitions []*MetricDefinition `type:"list"` - // A shell script that runs every time you start a notebook instance, including - // when you create the notebook instance. The shell script must be a base64-encoded - // string. - OnStart []*NotebookInstanceLifecycleHook `type:"list"` + // The registry path of the Docker image that contains the training algorithm. + // For information about Docker registry paths for built-in algorithms, see + // Algorithms Provided by Amazon SageMaker: Common Parameters (https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-algo-docker-registry-paths.html). + // Amazon SageMaker supports both registry/repository[:tag] and registry/repository[@digest] + // image path formats. For more information, see Using Your Own Algorithms with + // Amazon SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html). + TrainingImage *string `type:"string"` + + // The input mode that the algorithm supports: File or Pipe. In File input mode, + // Amazon SageMaker downloads the training data from Amazon S3 to the storage + // volume that is attached to the training instance and mounts the directory + // to the Docker volume for the training container. In Pipe input mode, Amazon + // SageMaker streams data directly from Amazon S3 to the container. + // + // If you specify File mode, make sure that you provision the storage volume + // that is attached to the training instance with enough capacity to accommodate + // the training data downloaded from Amazon S3, the model artifacts, and intermediate + // information. + // + // For more information about input modes, see Algorithms (https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html). + // + // TrainingInputMode is a required field + TrainingInputMode *string `type:"string" required:"true" enum:"TrainingInputMode"` } // String returns the string representation -func (s CreateNotebookInstanceLifecycleConfigInput) String() string { +func (s HyperParameterAlgorithmSpecification) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateNotebookInstanceLifecycleConfigInput) GoString() string { +func (s HyperParameterAlgorithmSpecification) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateNotebookInstanceLifecycleConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateNotebookInstanceLifecycleConfigInput"} - if s.NotebookInstanceLifecycleConfigName == nil { - invalidParams.Add(request.NewErrParamRequired("NotebookInstanceLifecycleConfigName")) +func (s *HyperParameterAlgorithmSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HyperParameterAlgorithmSpecification"} + if s.AlgorithmName != nil && len(*s.AlgorithmName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AlgorithmName", 1)) } - if s.OnCreate != nil { - for i, v := range s.OnCreate { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OnCreate", i), err.(request.ErrInvalidParams)) - } - } + if s.TrainingInputMode == nil { + invalidParams.Add(request.NewErrParamRequired("TrainingInputMode")) } - if s.OnStart != nil { - for i, v := range s.OnStart { + if s.MetricDefinitions != nil { + for i, v := range s.MetricDefinitions { if v == nil { continue } if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OnStart", i), err.(request.ErrInvalidParams)) + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricDefinitions", i), err.(request.ErrInvalidParams)) } } } @@ -10285,100 +28931,86 @@ func (s *CreateNotebookInstanceLifecycleConfigInput) Validate() error { return nil } -// SetNotebookInstanceLifecycleConfigName sets the NotebookInstanceLifecycleConfigName field's value. -func (s *CreateNotebookInstanceLifecycleConfigInput) SetNotebookInstanceLifecycleConfigName(v string) *CreateNotebookInstanceLifecycleConfigInput { - s.NotebookInstanceLifecycleConfigName = &v +// SetAlgorithmName sets the AlgorithmName field's value. +func (s *HyperParameterAlgorithmSpecification) SetAlgorithmName(v string) *HyperParameterAlgorithmSpecification { + s.AlgorithmName = &v return s } -// SetOnCreate sets the OnCreate field's value. -func (s *CreateNotebookInstanceLifecycleConfigInput) SetOnCreate(v []*NotebookInstanceLifecycleHook) *CreateNotebookInstanceLifecycleConfigInput { - s.OnCreate = v +// SetMetricDefinitions sets the MetricDefinitions field's value. +func (s *HyperParameterAlgorithmSpecification) SetMetricDefinitions(v []*MetricDefinition) *HyperParameterAlgorithmSpecification { + s.MetricDefinitions = v return s } -// SetOnStart sets the OnStart field's value. -func (s *CreateNotebookInstanceLifecycleConfigInput) SetOnStart(v []*NotebookInstanceLifecycleHook) *CreateNotebookInstanceLifecycleConfigInput { - s.OnStart = v +// SetTrainingImage sets the TrainingImage field's value. +func (s *HyperParameterAlgorithmSpecification) SetTrainingImage(v string) *HyperParameterAlgorithmSpecification { + s.TrainingImage = &v return s } -type CreateNotebookInstanceLifecycleConfigOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the lifecycle configuration. - NotebookInstanceLifecycleConfigArn *string `type:"string"` -} - -// String returns the string representation -func (s CreateNotebookInstanceLifecycleConfigOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateNotebookInstanceLifecycleConfigOutput) GoString() string { - return s.String() -} - -// SetNotebookInstanceLifecycleConfigArn sets the NotebookInstanceLifecycleConfigArn field's value. -func (s *CreateNotebookInstanceLifecycleConfigOutput) SetNotebookInstanceLifecycleConfigArn(v string) *CreateNotebookInstanceLifecycleConfigOutput { - s.NotebookInstanceLifecycleConfigArn = &v +// SetTrainingInputMode sets the TrainingInputMode field's value. +func (s *HyperParameterAlgorithmSpecification) SetTrainingInputMode(v string) *HyperParameterAlgorithmSpecification { + s.TrainingInputMode = &v return s } -type CreateNotebookInstanceOutput struct { +// Defines a hyperparameter to be used by an algorithm. +type HyperParameterSpecification struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the notebook instance. - NotebookInstanceArn *string `type:"string"` -} - -// String returns the string representation -func (s CreateNotebookInstanceOutput) String() string { - return awsutil.Prettify(s) -} + // The default value for this hyperparameter. If a default value is specified, + // a hyperparameter cannot be required. + DefaultValue *string `type:"string"` -// GoString returns the string representation -func (s CreateNotebookInstanceOutput) GoString() string { - return s.String() -} + // A brief description of the hyperparameter. + Description *string `type:"string"` -// SetNotebookInstanceArn sets the NotebookInstanceArn field's value. -func (s *CreateNotebookInstanceOutput) SetNotebookInstanceArn(v string) *CreateNotebookInstanceOutput { - s.NotebookInstanceArn = &v - return s -} + // Indicates whether this hyperparameter is required. + IsRequired *bool `type:"boolean"` -type CreatePresignedNotebookInstanceUrlInput struct { - _ struct{} `type:"structure"` + // Indicates whether this hyperparameter is tunable in a hyperparameter tuning + // job. + IsTunable *bool `type:"boolean"` - // The name of the notebook instance. + // The name of this hyperparameter. The name must be unique. // - // NotebookInstanceName is a required field - NotebookInstanceName *string `type:"string" required:"true"` + // Name is a required field + Name *string `type:"string" required:"true"` - // The duration of the session, in seconds. The default is 12 hours. - SessionExpirationDurationInSeconds *int64 `min:"1800" type:"integer"` + // The allowed range for this hyperparameter. + Range *ParameterRange `type:"structure"` + + // The type of this hyperparameter. The valid types are Integer, Continuous, + // Categorical, and FreeText. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"ParameterType"` } // String returns the string representation -func (s CreatePresignedNotebookInstanceUrlInput) String() string { +func (s HyperParameterSpecification) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreatePresignedNotebookInstanceUrlInput) GoString() string { +func (s HyperParameterSpecification) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePresignedNotebookInstanceUrlInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePresignedNotebookInstanceUrlInput"} - if s.NotebookInstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("NotebookInstanceName")) +func (s *HyperParameterSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HyperParameterSpecification"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) } - if s.SessionExpirationDurationInSeconds != nil && *s.SessionExpirationDurationInSeconds < 1800 { - invalidParams.Add(request.NewErrParamMinValue("SessionExpirationDurationInSeconds", 1800)) + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + if s.Range != nil { + if err := s.Range.Validate(); err != nil { + invalidParams.AddNested("Range", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -10387,194 +29019,168 @@ func (s *CreatePresignedNotebookInstanceUrlInput) Validate() error { return nil } -// SetNotebookInstanceName sets the NotebookInstanceName field's value. -func (s *CreatePresignedNotebookInstanceUrlInput) SetNotebookInstanceName(v string) *CreatePresignedNotebookInstanceUrlInput { - s.NotebookInstanceName = &v +// SetDefaultValue sets the DefaultValue field's value. +func (s *HyperParameterSpecification) SetDefaultValue(v string) *HyperParameterSpecification { + s.DefaultValue = &v return s } -// SetSessionExpirationDurationInSeconds sets the SessionExpirationDurationInSeconds field's value. -func (s *CreatePresignedNotebookInstanceUrlInput) SetSessionExpirationDurationInSeconds(v int64) *CreatePresignedNotebookInstanceUrlInput { - s.SessionExpirationDurationInSeconds = &v +// SetDescription sets the Description field's value. +func (s *HyperParameterSpecification) SetDescription(v string) *HyperParameterSpecification { + s.Description = &v return s } -type CreatePresignedNotebookInstanceUrlOutput struct { - _ struct{} `type:"structure"` +// SetIsRequired sets the IsRequired field's value. +func (s *HyperParameterSpecification) SetIsRequired(v bool) *HyperParameterSpecification { + s.IsRequired = &v + return s +} - // A JSON object that contains the URL string. - AuthorizedUrl *string `type:"string"` +// SetIsTunable sets the IsTunable field's value. +func (s *HyperParameterSpecification) SetIsTunable(v bool) *HyperParameterSpecification { + s.IsTunable = &v + return s } -// String returns the string representation -func (s CreatePresignedNotebookInstanceUrlOutput) String() string { - return awsutil.Prettify(s) +// SetName sets the Name field's value. +func (s *HyperParameterSpecification) SetName(v string) *HyperParameterSpecification { + s.Name = &v + return s } -// GoString returns the string representation -func (s CreatePresignedNotebookInstanceUrlOutput) GoString() string { - return s.String() +// SetRange sets the Range field's value. +func (s *HyperParameterSpecification) SetRange(v *ParameterRange) *HyperParameterSpecification { + s.Range = v + return s } -// SetAuthorizedUrl sets the AuthorizedUrl field's value. -func (s *CreatePresignedNotebookInstanceUrlOutput) SetAuthorizedUrl(v string) *CreatePresignedNotebookInstanceUrlOutput { - s.AuthorizedUrl = &v +// SetType sets the Type field's value. +func (s *HyperParameterSpecification) SetType(v string) *HyperParameterSpecification { + s.Type = &v return s } -type CreateTrainingJobInput struct { +// Defines the training jobs launched by a hyperparameter tuning job. +type HyperParameterTrainingJobDefinition struct { _ struct{} `type:"structure"` - // The registry path of the Docker image that contains the training algorithm - // and algorithm-specific metadata, including the input mode. For more information - // about algorithms provided by Amazon SageMaker, see Algorithms (https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html). - // For information about providing your own algorithms, see Using Your Own Algorithms - // with Amazon SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html). + // The HyperParameterAlgorithmSpecification object that specifies the resource + // algorithm to use for the training jobs that the tuning job launches. // // AlgorithmSpecification is a required field - AlgorithmSpecification *AlgorithmSpecification `type:"structure" required:"true"` + AlgorithmSpecification *HyperParameterAlgorithmSpecification `type:"structure" required:"true"` // Contains information about the output location for managed spot training // checkpoint data. CheckpointConfig *CheckpointConfig `type:"structure"` + // The job definition name. + DefinitionName *string `min:"1" type:"string"` + // To encrypt all communications between ML compute instances in distributed // training, choose True. Encryption provides greater security for distributed // training, but training might take longer. How long it takes depends on the // amount of communication between compute instances, especially if you use - // a deep learning algorithm in distributed training. For more information, - // see Protect Communications Between ML Compute Instances in a Distributed - // Training Job (https://docs.aws.amazon.com/sagemaker/latest/dg/train-encrypt.html). + // a deep learning algorithm in distributed training. EnableInterContainerTrafficEncryption *bool `type:"boolean"` - // To train models using managed spot training, choose True. Managed spot training - // provides a fully managed and scalable infrastructure for training machine - // learning models. this option is useful when training jobs can be interrupted - // and when there is flexibility when the training job is run. - // - // The complete and intermediate results of jobs are stored in an Amazon S3 - // bucket, and can be used as a starting point to train models incrementally. - // Amazon SageMaker provides metrics and logs in CloudWatch. They can be used - // to see when managed spot training jobs are running, interrupted, resumed, - // or completed. + // A Boolean indicating whether managed spot training is enabled (True) or not + // (False). EnableManagedSpotTraining *bool `type:"boolean"` // Isolates the training container. No inbound or outbound network calls can // be made, except for calls between peers within a training cluster for distributed - // training. If you enable network isolation for training jobs that are configured + // training. If network isolation is used for training jobs that are configured // to use a VPC, Amazon SageMaker downloads and uploads customer data and model // artifacts through the specified VPC, but the training container does not // have network access. - // - // The Semantic Segmentation built-in algorithm does not support network isolation. EnableNetworkIsolation *bool `type:"boolean"` - // Algorithm-specific parameters that influence the quality of the model. You - // set hyperparameters before you start the learning process. For a list of - // hyperparameters for each training algorithm provided by Amazon SageMaker, - // see Algorithms (https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html). + // Specifies ranges of integer, continuous, and categorical hyperparameters + // that a hyperparameter tuning job searches. The hyperparameter tuning job + // launches training jobs with hyperparameter values within these ranges to + // find the combination of values that result in the training job with the best + // performance as measured by the objective metric of the hyperparameter tuning + // job. // - // You can specify a maximum of 100 hyperparameters. Each hyperparameter is - // a key-value pair. Each key and value is limited to 256 characters, as specified - // by the Length Constraint. - HyperParameters map[string]*string `type:"map"` + // You can specify a maximum of 20 hyperparameters that a hyperparameter tuning + // job can search over. Every possible value of a categorical parameter range + // counts against this limit. + HyperParameterRanges *ParameterRanges `type:"structure"` - // An array of Channel objects. Each channel is a named input source. InputDataConfig - // describes the input data and its location. - // - // Algorithms can accept input data from one or more channels. For example, - // an algorithm might have two channels of input data, training_data and validation_data. - // The configuration for each channel provides the S3, EFS, or FSx location - // where the input data is stored. It also provides information about the stored - // data: the MIME type, compression method, and whether the data is wrapped - // in RecordIO format. - // - // Depending on the input mode that the algorithm supports, Amazon SageMaker - // either copies input data files from an S3 bucket to a local directory in - // the Docker container, or makes it available as input streams. For example, - // if you specify an EFS location, input data files will be made available as - // input streams. They do not need to be downloaded. + // An array of Channel objects that specify the input for the training jobs + // that the tuning job launches. InputDataConfig []*Channel `min:"1" type:"list"` - // Specifies the path to the S3 location where you want to store model artifacts. - // Amazon SageMaker creates subfolders for the artifacts. + // Specifies the path to the Amazon S3 bucket where you store model artifacts + // from the training jobs that the tuning job launches. // // OutputDataConfig is a required field OutputDataConfig *OutputDataConfig `type:"structure" required:"true"` - // The resources, including the ML compute instances and ML storage volumes, - // to use for model training. + // The resources, including the compute instances and storage volumes, to use + // for the training jobs that the tuning job launches. // - // ML storage volumes store model artifacts and incremental states. Training - // algorithms might also use ML storage volumes for scratch space. If you want - // Amazon SageMaker to use the ML storage volume to store the training data, - // choose File as the TrainingInputMode in the algorithm specification. For - // distributed training algorithms, specify an instance count greater than 1. + // Storage volumes store model artifacts and incremental states. Training algorithms + // might also use storage volumes for scratch space. If you want Amazon SageMaker + // to use the storage volume to store the training data, choose File as the + // TrainingInputMode in the algorithm specification. For distributed training + // algorithms, specify an instance count greater than 1. // // ResourceConfig is a required field ResourceConfig *ResourceConfig `type:"structure" required:"true"` - // The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume - // to perform tasks on your behalf. - // - // During model training, Amazon SageMaker needs your permission to read input - // data from an S3 bucket, download a Docker image that contains training code, - // write model artifacts to an S3 bucket, write logs to Amazon CloudWatch Logs, - // and publish metrics to Amazon CloudWatch. You grant permissions for all of - // these tasks to an IAM role. For more information, see Amazon SageMaker Roles - // (https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-roles.html). - // - // To be able to pass this role to Amazon SageMaker, the caller of this API - // must have the iam:PassRole permission. + // The Amazon Resource Name (ARN) of the IAM role associated with the training + // jobs that the tuning job launches. // // RoleArn is a required field RoleArn *string `min:"20" type:"string" required:"true"` - // Specifies a limit to how long a model training job can run. When the job - // reaches the time limit, Amazon SageMaker ends the training job. Use this - // API to cap model training costs. - // - // To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal, which - // delays job termination for 120 seconds. Algorithms can use this 120-second - // window to save the model artifacts, so the results of training are not lost. + // Specifies the values of hyperparameters that do not change for the tuning + // job. + StaticHyperParameters map[string]*string `type:"map"` + + // Specifies a limit to how long a model hyperparameter training job can run. + // It also specifies how long you are willing to wait for a managed spot training + // job to complete. When the job reaches the a limit, Amazon SageMaker ends + // the training job. Use this API to cap model training costs. // // StoppingCondition is a required field StoppingCondition *StoppingCondition `type:"structure" required:"true"` - // An array of key-value pairs. For more information, see Using Cost Allocation - // Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) - // in the AWS Billing and Cost Management User Guide. - Tags []*Tag `type:"list"` - - // The name of the training job. The name must be unique within an AWS Region - // in an AWS account. - // - // TrainingJobName is a required field - TrainingJobName *string `min:"1" type:"string" required:"true"` + // Defines the objective metric for a hyperparameter tuning job. Hyperparameter + // tuning uses the value of this metric to evaluate the training jobs it launches, + // and returns the training job that results in either the highest or lowest + // value for this metric, depending on the value you specify for the Type parameter. + TuningObjective *HyperParameterTuningJobObjective `type:"structure"` - // A VpcConfig object that specifies the VPC that you want your training job - // to connect to. Control access to and from your training container by configuring - // the VPC. For more information, see Protect Training Jobs by Using an Amazon - // Virtual Private Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html). + // The VpcConfig object that specifies the VPC that you want the training jobs + // that this hyperparameter tuning job launches to connect to. Control access + // to and from your training container by configuring the VPC. For more information, + // see Protect Training Jobs by Using an Amazon Virtual Private Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html). VpcConfig *VpcConfig `type:"structure"` } // String returns the string representation -func (s CreateTrainingJobInput) String() string { +func (s HyperParameterTrainingJobDefinition) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTrainingJobInput) GoString() string { +func (s HyperParameterTrainingJobDefinition) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTrainingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTrainingJobInput"} +func (s *HyperParameterTrainingJobDefinition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HyperParameterTrainingJobDefinition"} if s.AlgorithmSpecification == nil { invalidParams.Add(request.NewErrParamRequired("AlgorithmSpecification")) } + if s.DefinitionName != nil && len(*s.DefinitionName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DefinitionName", 1)) + } if s.InputDataConfig != nil && len(s.InputDataConfig) < 1 { invalidParams.Add(request.NewErrParamMinLen("InputDataConfig", 1)) } @@ -10593,12 +29199,6 @@ func (s *CreateTrainingJobInput) Validate() error { if s.StoppingCondition == nil { invalidParams.Add(request.NewErrParamRequired("StoppingCondition")) } - if s.TrainingJobName == nil { - invalidParams.Add(request.NewErrParamRequired("TrainingJobName")) - } - if s.TrainingJobName != nil && len(*s.TrainingJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TrainingJobName", 1)) - } if s.AlgorithmSpecification != nil { if err := s.AlgorithmSpecification.Validate(); err != nil { invalidParams.AddNested("AlgorithmSpecification", err.(request.ErrInvalidParams)) @@ -10609,6 +29209,11 @@ func (s *CreateTrainingJobInput) Validate() error { invalidParams.AddNested("CheckpointConfig", err.(request.ErrInvalidParams)) } } + if s.HyperParameterRanges != nil { + if err := s.HyperParameterRanges.Validate(); err != nil { + invalidParams.AddNested("HyperParameterRanges", err.(request.ErrInvalidParams)) + } + } if s.InputDataConfig != nil { for i, v := range s.InputDataConfig { if v == nil { @@ -10634,14 +29239,9 @@ func (s *CreateTrainingJobInput) Validate() error { invalidParams.AddNested("StoppingCondition", 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 s.TuningObjective != nil { + if err := s.TuningObjective.Validate(); err != nil { + invalidParams.AddNested("TuningObjective", err.(request.ErrInvalidParams)) } } if s.VpcConfig != nil { @@ -10657,255 +29257,329 @@ func (s *CreateTrainingJobInput) Validate() error { } // SetAlgorithmSpecification sets the AlgorithmSpecification field's value. -func (s *CreateTrainingJobInput) SetAlgorithmSpecification(v *AlgorithmSpecification) *CreateTrainingJobInput { +func (s *HyperParameterTrainingJobDefinition) SetAlgorithmSpecification(v *HyperParameterAlgorithmSpecification) *HyperParameterTrainingJobDefinition { s.AlgorithmSpecification = v return s } // SetCheckpointConfig sets the CheckpointConfig field's value. -func (s *CreateTrainingJobInput) SetCheckpointConfig(v *CheckpointConfig) *CreateTrainingJobInput { +func (s *HyperParameterTrainingJobDefinition) SetCheckpointConfig(v *CheckpointConfig) *HyperParameterTrainingJobDefinition { s.CheckpointConfig = v return s } +// SetDefinitionName sets the DefinitionName field's value. +func (s *HyperParameterTrainingJobDefinition) SetDefinitionName(v string) *HyperParameterTrainingJobDefinition { + s.DefinitionName = &v + return s +} + // SetEnableInterContainerTrafficEncryption sets the EnableInterContainerTrafficEncryption field's value. -func (s *CreateTrainingJobInput) SetEnableInterContainerTrafficEncryption(v bool) *CreateTrainingJobInput { +func (s *HyperParameterTrainingJobDefinition) SetEnableInterContainerTrafficEncryption(v bool) *HyperParameterTrainingJobDefinition { s.EnableInterContainerTrafficEncryption = &v return s } // SetEnableManagedSpotTraining sets the EnableManagedSpotTraining field's value. -func (s *CreateTrainingJobInput) SetEnableManagedSpotTraining(v bool) *CreateTrainingJobInput { +func (s *HyperParameterTrainingJobDefinition) SetEnableManagedSpotTraining(v bool) *HyperParameterTrainingJobDefinition { s.EnableManagedSpotTraining = &v return s } // SetEnableNetworkIsolation sets the EnableNetworkIsolation field's value. -func (s *CreateTrainingJobInput) SetEnableNetworkIsolation(v bool) *CreateTrainingJobInput { +func (s *HyperParameterTrainingJobDefinition) SetEnableNetworkIsolation(v bool) *HyperParameterTrainingJobDefinition { s.EnableNetworkIsolation = &v return s } -// SetHyperParameters sets the HyperParameters field's value. -func (s *CreateTrainingJobInput) SetHyperParameters(v map[string]*string) *CreateTrainingJobInput { - s.HyperParameters = v +// SetHyperParameterRanges sets the HyperParameterRanges field's value. +func (s *HyperParameterTrainingJobDefinition) SetHyperParameterRanges(v *ParameterRanges) *HyperParameterTrainingJobDefinition { + s.HyperParameterRanges = v return s } // SetInputDataConfig sets the InputDataConfig field's value. -func (s *CreateTrainingJobInput) SetInputDataConfig(v []*Channel) *CreateTrainingJobInput { +func (s *HyperParameterTrainingJobDefinition) SetInputDataConfig(v []*Channel) *HyperParameterTrainingJobDefinition { s.InputDataConfig = v return s } // SetOutputDataConfig sets the OutputDataConfig field's value. -func (s *CreateTrainingJobInput) SetOutputDataConfig(v *OutputDataConfig) *CreateTrainingJobInput { +func (s *HyperParameterTrainingJobDefinition) SetOutputDataConfig(v *OutputDataConfig) *HyperParameterTrainingJobDefinition { s.OutputDataConfig = v return s } // SetResourceConfig sets the ResourceConfig field's value. -func (s *CreateTrainingJobInput) SetResourceConfig(v *ResourceConfig) *CreateTrainingJobInput { +func (s *HyperParameterTrainingJobDefinition) SetResourceConfig(v *ResourceConfig) *HyperParameterTrainingJobDefinition { s.ResourceConfig = v return s } // SetRoleArn sets the RoleArn field's value. -func (s *CreateTrainingJobInput) SetRoleArn(v string) *CreateTrainingJobInput { +func (s *HyperParameterTrainingJobDefinition) SetRoleArn(v string) *HyperParameterTrainingJobDefinition { s.RoleArn = &v return s } -// SetStoppingCondition sets the StoppingCondition field's value. -func (s *CreateTrainingJobInput) SetStoppingCondition(v *StoppingCondition) *CreateTrainingJobInput { - s.StoppingCondition = v +// SetStaticHyperParameters sets the StaticHyperParameters field's value. +func (s *HyperParameterTrainingJobDefinition) SetStaticHyperParameters(v map[string]*string) *HyperParameterTrainingJobDefinition { + s.StaticHyperParameters = v return s } -// SetTags sets the Tags field's value. -func (s *CreateTrainingJobInput) SetTags(v []*Tag) *CreateTrainingJobInput { - s.Tags = v +// SetStoppingCondition sets the StoppingCondition field's value. +func (s *HyperParameterTrainingJobDefinition) SetStoppingCondition(v *StoppingCondition) *HyperParameterTrainingJobDefinition { + s.StoppingCondition = v return s } -// SetTrainingJobName sets the TrainingJobName field's value. -func (s *CreateTrainingJobInput) SetTrainingJobName(v string) *CreateTrainingJobInput { - s.TrainingJobName = &v +// SetTuningObjective sets the TuningObjective field's value. +func (s *HyperParameterTrainingJobDefinition) SetTuningObjective(v *HyperParameterTuningJobObjective) *HyperParameterTrainingJobDefinition { + s.TuningObjective = v return s } // SetVpcConfig sets the VpcConfig field's value. -func (s *CreateTrainingJobInput) SetVpcConfig(v *VpcConfig) *CreateTrainingJobInput { +func (s *HyperParameterTrainingJobDefinition) SetVpcConfig(v *VpcConfig) *HyperParameterTrainingJobDefinition { s.VpcConfig = v return s } -type CreateTrainingJobOutput struct { +// Specifies summary information about a training job. +type HyperParameterTrainingJobSummary struct { _ struct{} `type:"structure"` + // The date and time that the training job was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // The reason that the training job failed. + FailureReason *string `type:"string"` + + // The FinalHyperParameterTuningJobObjectiveMetric object that specifies the + // value of the objective metric of the tuning job that launched this training + // job. + FinalHyperParameterTuningJobObjectiveMetric *FinalHyperParameterTuningJobObjectiveMetric `type:"structure"` + + // The status of the objective metric for the training job: + // + // * Succeeded: The final objective metric for the training job was evaluated + // by the hyperparameter tuning job and used in the hyperparameter tuning + // process. + // + // * Pending: The training job is in progress and evaluation of its final + // objective metric is pending. + // + // * Failed: The final objective metric for the training job was not evaluated, + // and was not used in the hyperparameter tuning process. This typically + // occurs when the training job failed or did not emit an objective metric. + ObjectiveStatus *string `type:"string" enum:"ObjectiveStatus"` + + // Specifies the time when the training job ends on training instances. You + // are billed for the time interval between the value of TrainingStartTime and + // this time. For successful jobs and stopped jobs, this is the time after model + // artifacts are uploaded. For failed jobs, this is the time when Amazon SageMaker + // detects a job failure. + TrainingEndTime *time.Time `type:"timestamp"` + // The Amazon Resource Name (ARN) of the training job. // // TrainingJobArn is a required field TrainingJobArn *string `type:"string" required:"true"` + + // The training job definition name. + TrainingJobDefinitionName *string `min:"1" type:"string"` + + // The name of the training job. + // + // TrainingJobName is a required field + TrainingJobName *string `min:"1" type:"string" required:"true"` + + // The status of the training job. + // + // TrainingJobStatus is a required field + TrainingJobStatus *string `type:"string" required:"true" enum:"TrainingJobStatus"` + + // The date and time that the training job started. + TrainingStartTime *time.Time `type:"timestamp"` + + // A list of the hyperparameters for which you specified ranges to search. + // + // TunedHyperParameters is a required field + TunedHyperParameters map[string]*string `type:"map" required:"true"` + + // The HyperParameter tuning job that launched the training job. + TuningJobName *string `min:"1" type:"string"` } // String returns the string representation -func (s CreateTrainingJobOutput) String() string { +func (s HyperParameterTrainingJobSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTrainingJobOutput) GoString() string { +func (s HyperParameterTrainingJobSummary) GoString() string { return s.String() } +// SetCreationTime sets the CreationTime field's value. +func (s *HyperParameterTrainingJobSummary) SetCreationTime(v time.Time) *HyperParameterTrainingJobSummary { + s.CreationTime = &v + return s +} + +// SetFailureReason sets the FailureReason field's value. +func (s *HyperParameterTrainingJobSummary) SetFailureReason(v string) *HyperParameterTrainingJobSummary { + s.FailureReason = &v + return s +} + +// SetFinalHyperParameterTuningJobObjectiveMetric sets the FinalHyperParameterTuningJobObjectiveMetric field's value. +func (s *HyperParameterTrainingJobSummary) SetFinalHyperParameterTuningJobObjectiveMetric(v *FinalHyperParameterTuningJobObjectiveMetric) *HyperParameterTrainingJobSummary { + s.FinalHyperParameterTuningJobObjectiveMetric = v + return s +} + +// SetObjectiveStatus sets the ObjectiveStatus field's value. +func (s *HyperParameterTrainingJobSummary) SetObjectiveStatus(v string) *HyperParameterTrainingJobSummary { + s.ObjectiveStatus = &v + return s +} + +// SetTrainingEndTime sets the TrainingEndTime field's value. +func (s *HyperParameterTrainingJobSummary) SetTrainingEndTime(v time.Time) *HyperParameterTrainingJobSummary { + s.TrainingEndTime = &v + return s +} + // SetTrainingJobArn sets the TrainingJobArn field's value. -func (s *CreateTrainingJobOutput) SetTrainingJobArn(v string) *CreateTrainingJobOutput { +func (s *HyperParameterTrainingJobSummary) SetTrainingJobArn(v string) *HyperParameterTrainingJobSummary { s.TrainingJobArn = &v return s } -type CreateTransformJobInput struct { - _ struct{} `type:"structure"` +// SetTrainingJobDefinitionName sets the TrainingJobDefinitionName field's value. +func (s *HyperParameterTrainingJobSummary) SetTrainingJobDefinitionName(v string) *HyperParameterTrainingJobSummary { + s.TrainingJobDefinitionName = &v + return s +} - // Specifies the number of records to include in a mini-batch for an HTTP inference - // request. A record is a single unit of input data that inference can be made - // on. For example, a single line in a CSV file is a record. - // - // To enable the batch strategy, you must set SplitType to Line, RecordIO, or - // TFRecord. - // - // To use only one record when making an HTTP invocation request to a container, - // set BatchStrategy to SingleRecord and SplitType to Line. - // - // To fit as many records in a mini-batch as can fit within the MaxPayloadInMB - // limit, set BatchStrategy to MultiRecord and SplitType to Line. - BatchStrategy *string `type:"string" enum:"BatchStrategy"` +// SetTrainingJobName sets the TrainingJobName field's value. +func (s *HyperParameterTrainingJobSummary) SetTrainingJobName(v string) *HyperParameterTrainingJobSummary { + s.TrainingJobName = &v + return s +} - // The data structure used to specify the data to be used for inference in a - // batch transform job and to associate the data that is relevant to the prediction - // results in the output. The input filter provided allows you to exclude input - // data that is not needed for inference in a batch transform job. The output - // filter provided allows you to include input data relevant to interpreting - // the predictions in the output from the job. For more information, see Associate - // Prediction Results with their Corresponding Input Records (https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform-data-processing.html). - DataProcessing *DataProcessing `type:"structure"` +// SetTrainingJobStatus sets the TrainingJobStatus field's value. +func (s *HyperParameterTrainingJobSummary) SetTrainingJobStatus(v string) *HyperParameterTrainingJobSummary { + s.TrainingJobStatus = &v + return s +} - // The environment variables to set in the Docker container. We support up to - // 16 key and values entries in the map. - Environment map[string]*string `type:"map"` +// SetTrainingStartTime sets the TrainingStartTime field's value. +func (s *HyperParameterTrainingJobSummary) SetTrainingStartTime(v time.Time) *HyperParameterTrainingJobSummary { + s.TrainingStartTime = &v + return s +} - // The maximum number of parallel requests that can be sent to each instance - // in a transform job. If MaxConcurrentTransforms is set to 0 or left unset, - // Amazon SageMaker checks the optional execution-parameters to determine the - // optimal settings for your chosen algorithm. If the execution-parameters endpoint - // is not enabled, the default value is 1. For more information on execution-parameters, - // see How Containers Serve Requests (https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms-batch-code.html#your-algorithms-batch-code-how-containe-serves-requests). - // For built-in algorithms, you don't need to set a value for MaxConcurrentTransforms. - MaxConcurrentTransforms *int64 `type:"integer"` +// SetTunedHyperParameters sets the TunedHyperParameters field's value. +func (s *HyperParameterTrainingJobSummary) SetTunedHyperParameters(v map[string]*string) *HyperParameterTrainingJobSummary { + s.TunedHyperParameters = v + return s +} - // The maximum allowed size of the payload, in MB. A payload is the data portion - // of a record (without metadata). The value in MaxPayloadInMB must be greater - // than, or equal to, the size of a single record. To estimate the size of a - // record in MB, divide the size of your dataset by the number of records. To - // ensure that the records fit within the maximum payload size, we recommend - // using a slightly larger value. The default value is 6 MB. - // - // For cases where the payload might be arbitrarily large and is transmitted - // using HTTP chunked encoding, set the value to 0. This feature works only - // in supported algorithms. Currently, Amazon SageMaker built-in algorithms - // do not support HTTP chunked encoding. - MaxPayloadInMB *int64 `type:"integer"` +// SetTuningJobName sets the TuningJobName field's value. +func (s *HyperParameterTrainingJobSummary) SetTuningJobName(v string) *HyperParameterTrainingJobSummary { + s.TuningJobName = &v + return s +} - // The name of the model that you want to use for the transform job. ModelName - // must be the name of an existing Amazon SageMaker model within an AWS Region - // in an AWS account. - // - // ModelName is a required field - ModelName *string `type:"string" required:"true"` +// Configures a hyperparameter tuning job. +type HyperParameterTuningJobConfig struct { + _ struct{} `type:"structure"` - // (Optional) An array of key-value pairs. For more information, see Using Cost - // Allocation Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) - // in the AWS Billing and Cost Management User Guide. - Tags []*Tag `type:"list"` + // The HyperParameterTuningJobObjective object that specifies the objective + // metric for this tuning job. + HyperParameterTuningJobObjective *HyperParameterTuningJobObjective `type:"structure"` - // Describes the input source and the way the transform job consumes it. - // - // TransformInput is a required field - TransformInput *TransformInput `type:"structure" required:"true"` + // The ParameterRanges object that specifies the ranges of hyperparameters that + // this tuning job searches. + ParameterRanges *ParameterRanges `type:"structure"` - // The name of the transform job. The name must be unique within an AWS Region - // in an AWS account. + // The ResourceLimits object that specifies the maximum number of training jobs + // and parallel training jobs for this tuning job. // - // TransformJobName is a required field - TransformJobName *string `min:"1" type:"string" required:"true"` + // ResourceLimits is a required field + ResourceLimits *ResourceLimits `type:"structure" required:"true"` - // Describes the results of the transform job. + // Specifies how hyperparameter tuning chooses the combinations of hyperparameter + // values to use for the training job it launches. To use the Bayesian search + // strategy, set this to Bayesian. To randomly search, set it to Random. For + // information about search strategies, see How Hyperparameter Tuning Works + // (https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-how-it-works.html). // - // TransformOutput is a required field - TransformOutput *TransformOutput `type:"structure" required:"true"` + // Strategy is a required field + Strategy *string `type:"string" required:"true" enum:"HyperParameterTuningJobStrategyType"` - // Describes the resources, including ML instance types and ML instance count, - // to use for the transform job. + // Specifies whether to use early stopping for training jobs launched by the + // hyperparameter tuning job. This can be one of the following values (the default + // value is OFF): // - // TransformResources is a required field - TransformResources *TransformResources `type:"structure" required:"true"` + // OFF + // + // Training jobs launched by the hyperparameter tuning job do not use early + // stopping. + // + // AUTO + // + // Amazon SageMaker stops training jobs launched by the hyperparameter tuning + // job when they are unlikely to perform better than previously completed training + // jobs. For more information, see Stop Training Jobs Early (https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-early-stopping.html). + TrainingJobEarlyStoppingType *string `type:"string" enum:"TrainingJobEarlyStoppingType"` + + // The tuning job's completion criteria. + TuningJobCompletionCriteria *TuningJobCompletionCriteria `type:"structure"` } // String returns the string representation -func (s CreateTransformJobInput) String() string { +func (s HyperParameterTuningJobConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTransformJobInput) GoString() string { +func (s HyperParameterTuningJobConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTransformJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTransformJobInput"} - if s.ModelName == nil { - invalidParams.Add(request.NewErrParamRequired("ModelName")) - } - if s.TransformInput == nil { - invalidParams.Add(request.NewErrParamRequired("TransformInput")) - } - if s.TransformJobName == nil { - invalidParams.Add(request.NewErrParamRequired("TransformJobName")) - } - if s.TransformJobName != nil && len(*s.TransformJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TransformJobName", 1)) - } - if s.TransformOutput == nil { - invalidParams.Add(request.NewErrParamRequired("TransformOutput")) +func (s *HyperParameterTuningJobConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HyperParameterTuningJobConfig"} + if s.ResourceLimits == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceLimits")) } - if s.TransformResources == nil { - invalidParams.Add(request.NewErrParamRequired("TransformResources")) + if s.Strategy == nil { + invalidParams.Add(request.NewErrParamRequired("Strategy")) } - 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 s.HyperParameterTuningJobObjective != nil { + if err := s.HyperParameterTuningJobObjective.Validate(); err != nil { + invalidParams.AddNested("HyperParameterTuningJobObjective", err.(request.ErrInvalidParams)) } } - if s.TransformInput != nil { - if err := s.TransformInput.Validate(); err != nil { - invalidParams.AddNested("TransformInput", err.(request.ErrInvalidParams)) + if s.ParameterRanges != nil { + if err := s.ParameterRanges.Validate(); err != nil { + invalidParams.AddNested("ParameterRanges", err.(request.ErrInvalidParams)) } } - if s.TransformOutput != nil { - if err := s.TransformOutput.Validate(); err != nil { - invalidParams.AddNested("TransformOutput", err.(request.ErrInvalidParams)) + if s.ResourceLimits != nil { + if err := s.ResourceLimits.Validate(); err != nil { + invalidParams.AddNested("ResourceLimits", err.(request.ErrInvalidParams)) } } - if s.TransformResources != nil { - if err := s.TransformResources.Validate(); err != nil { - invalidParams.AddNested("TransformResources", err.(request.ErrInvalidParams)) + if s.TuningJobCompletionCriteria != nil { + if err := s.TuningJobCompletionCriteria.Validate(); err != nil { + invalidParams.AddNested("TuningJobCompletionCriteria", err.(request.ErrInvalidParams)) } } @@ -10915,179 +29589,408 @@ func (s *CreateTransformJobInput) Validate() error { return nil } -// SetBatchStrategy sets the BatchStrategy field's value. -func (s *CreateTransformJobInput) SetBatchStrategy(v string) *CreateTransformJobInput { - s.BatchStrategy = &v - return s +// SetHyperParameterTuningJobObjective sets the HyperParameterTuningJobObjective field's value. +func (s *HyperParameterTuningJobConfig) SetHyperParameterTuningJobObjective(v *HyperParameterTuningJobObjective) *HyperParameterTuningJobConfig { + s.HyperParameterTuningJobObjective = v + return s +} + +// SetParameterRanges sets the ParameterRanges field's value. +func (s *HyperParameterTuningJobConfig) SetParameterRanges(v *ParameterRanges) *HyperParameterTuningJobConfig { + s.ParameterRanges = v + return s +} + +// SetResourceLimits sets the ResourceLimits field's value. +func (s *HyperParameterTuningJobConfig) SetResourceLimits(v *ResourceLimits) *HyperParameterTuningJobConfig { + s.ResourceLimits = v + return s +} + +// SetStrategy sets the Strategy field's value. +func (s *HyperParameterTuningJobConfig) SetStrategy(v string) *HyperParameterTuningJobConfig { + s.Strategy = &v + return s +} + +// SetTrainingJobEarlyStoppingType sets the TrainingJobEarlyStoppingType field's value. +func (s *HyperParameterTuningJobConfig) SetTrainingJobEarlyStoppingType(v string) *HyperParameterTuningJobConfig { + s.TrainingJobEarlyStoppingType = &v + return s +} + +// SetTuningJobCompletionCriteria sets the TuningJobCompletionCriteria field's value. +func (s *HyperParameterTuningJobConfig) SetTuningJobCompletionCriteria(v *TuningJobCompletionCriteria) *HyperParameterTuningJobConfig { + s.TuningJobCompletionCriteria = v + return s +} + +// Defines the objective metric for a hyperparameter tuning job. Hyperparameter +// tuning uses the value of this metric to evaluate the training jobs it launches, +// and returns the training job that results in either the highest or lowest +// value for this metric, depending on the value you specify for the Type parameter. +type HyperParameterTuningJobObjective struct { + _ struct{} `type:"structure"` + + // The name of the metric to use for the objective metric. + // + // MetricName is a required field + MetricName *string `min:"1" type:"string" required:"true"` + + // Whether to minimize or maximize the objective metric. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"HyperParameterTuningJobObjectiveType"` +} + +// String returns the string representation +func (s HyperParameterTuningJobObjective) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HyperParameterTuningJobObjective) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *HyperParameterTuningJobObjective) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HyperParameterTuningJobObjective"} + 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.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMetricName sets the MetricName field's value. +func (s *HyperParameterTuningJobObjective) SetMetricName(v string) *HyperParameterTuningJobObjective { + s.MetricName = &v + return s +} + +// SetType sets the Type field's value. +func (s *HyperParameterTuningJobObjective) SetType(v string) *HyperParameterTuningJobObjective { + s.Type = &v + return s +} + +// Provides summary information about a hyperparameter tuning job. +type HyperParameterTuningJobSummary struct { + _ struct{} `type:"structure"` + + // The date and time that the tuning job was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // The date and time that the tuning job ended. + HyperParameterTuningEndTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of the tuning job. + // + // HyperParameterTuningJobArn is a required field + HyperParameterTuningJobArn *string `type:"string" required:"true"` + + // The name of the tuning job. + // + // HyperParameterTuningJobName is a required field + HyperParameterTuningJobName *string `min:"1" type:"string" required:"true"` + + // The status of the tuning job. + // + // HyperParameterTuningJobStatus is a required field + HyperParameterTuningJobStatus *string `type:"string" required:"true" enum:"HyperParameterTuningJobStatus"` + + // The date and time that the tuning job was modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The ObjectiveStatusCounters object that specifies the numbers of training + // jobs, categorized by objective metric status, that this tuning job launched. + // + // ObjectiveStatusCounters is a required field + ObjectiveStatusCounters *ObjectiveStatusCounters `type:"structure" required:"true"` + + // The ResourceLimits object that specifies the maximum number of training jobs + // and parallel training jobs allowed for this tuning job. + ResourceLimits *ResourceLimits `type:"structure"` + + // Specifies the search strategy hyperparameter tuning uses to choose which + // hyperparameters to use for each iteration. Currently, the only valid value + // is Bayesian. + // + // Strategy is a required field + Strategy *string `type:"string" required:"true" enum:"HyperParameterTuningJobStrategyType"` + + // The TrainingJobStatusCounters object that specifies the numbers of training + // jobs, categorized by status, that this tuning job launched. + // + // TrainingJobStatusCounters is a required field + TrainingJobStatusCounters *TrainingJobStatusCounters `type:"structure" required:"true"` +} + +// String returns the string representation +func (s HyperParameterTuningJobSummary) String() string { + return awsutil.Prettify(s) } -// SetDataProcessing sets the DataProcessing field's value. -func (s *CreateTransformJobInput) SetDataProcessing(v *DataProcessing) *CreateTransformJobInput { - s.DataProcessing = v +// GoString returns the string representation +func (s HyperParameterTuningJobSummary) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *HyperParameterTuningJobSummary) SetCreationTime(v time.Time) *HyperParameterTuningJobSummary { + s.CreationTime = &v return s } -// SetEnvironment sets the Environment field's value. -func (s *CreateTransformJobInput) SetEnvironment(v map[string]*string) *CreateTransformJobInput { - s.Environment = v +// SetHyperParameterTuningEndTime sets the HyperParameterTuningEndTime field's value. +func (s *HyperParameterTuningJobSummary) SetHyperParameterTuningEndTime(v time.Time) *HyperParameterTuningJobSummary { + s.HyperParameterTuningEndTime = &v return s } -// SetMaxConcurrentTransforms sets the MaxConcurrentTransforms field's value. -func (s *CreateTransformJobInput) SetMaxConcurrentTransforms(v int64) *CreateTransformJobInput { - s.MaxConcurrentTransforms = &v +// SetHyperParameterTuningJobArn sets the HyperParameterTuningJobArn field's value. +func (s *HyperParameterTuningJobSummary) SetHyperParameterTuningJobArn(v string) *HyperParameterTuningJobSummary { + s.HyperParameterTuningJobArn = &v return s } -// SetMaxPayloadInMB sets the MaxPayloadInMB field's value. -func (s *CreateTransformJobInput) SetMaxPayloadInMB(v int64) *CreateTransformJobInput { - s.MaxPayloadInMB = &v +// SetHyperParameterTuningJobName sets the HyperParameterTuningJobName field's value. +func (s *HyperParameterTuningJobSummary) SetHyperParameterTuningJobName(v string) *HyperParameterTuningJobSummary { + s.HyperParameterTuningJobName = &v return s } -// SetModelName sets the ModelName field's value. -func (s *CreateTransformJobInput) SetModelName(v string) *CreateTransformJobInput { - s.ModelName = &v +// SetHyperParameterTuningJobStatus sets the HyperParameterTuningJobStatus field's value. +func (s *HyperParameterTuningJobSummary) SetHyperParameterTuningJobStatus(v string) *HyperParameterTuningJobSummary { + s.HyperParameterTuningJobStatus = &v return s } -// SetTags sets the Tags field's value. -func (s *CreateTransformJobInput) SetTags(v []*Tag) *CreateTransformJobInput { - s.Tags = v +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *HyperParameterTuningJobSummary) SetLastModifiedTime(v time.Time) *HyperParameterTuningJobSummary { + s.LastModifiedTime = &v return s } -// SetTransformInput sets the TransformInput field's value. -func (s *CreateTransformJobInput) SetTransformInput(v *TransformInput) *CreateTransformJobInput { - s.TransformInput = v +// SetObjectiveStatusCounters sets the ObjectiveStatusCounters field's value. +func (s *HyperParameterTuningJobSummary) SetObjectiveStatusCounters(v *ObjectiveStatusCounters) *HyperParameterTuningJobSummary { + s.ObjectiveStatusCounters = v return s } -// SetTransformJobName sets the TransformJobName field's value. -func (s *CreateTransformJobInput) SetTransformJobName(v string) *CreateTransformJobInput { - s.TransformJobName = &v +// SetResourceLimits sets the ResourceLimits field's value. +func (s *HyperParameterTuningJobSummary) SetResourceLimits(v *ResourceLimits) *HyperParameterTuningJobSummary { + s.ResourceLimits = v return s } -// SetTransformOutput sets the TransformOutput field's value. -func (s *CreateTransformJobInput) SetTransformOutput(v *TransformOutput) *CreateTransformJobInput { - s.TransformOutput = v +// SetStrategy sets the Strategy field's value. +func (s *HyperParameterTuningJobSummary) SetStrategy(v string) *HyperParameterTuningJobSummary { + s.Strategy = &v return s } -// SetTransformResources sets the TransformResources field's value. -func (s *CreateTransformJobInput) SetTransformResources(v *TransformResources) *CreateTransformJobInput { - s.TransformResources = v +// SetTrainingJobStatusCounters sets the TrainingJobStatusCounters field's value. +func (s *HyperParameterTuningJobSummary) SetTrainingJobStatusCounters(v *TrainingJobStatusCounters) *HyperParameterTuningJobSummary { + s.TrainingJobStatusCounters = v return s } -type CreateTransformJobOutput struct { +// Specifies the configuration for a hyperparameter tuning job that uses one +// or more previous hyperparameter tuning jobs as a starting point. The results +// of previous tuning jobs are used to inform which combinations of hyperparameters +// to search over in the new tuning job. +// +// All training jobs launched by the new hyperparameter tuning job are evaluated +// by using the objective metric, and the training job that performs the best +// is compared to the best training jobs from the parent tuning jobs. From these, +// the training job that performs the best as measured by the objective metric +// is returned as the overall best training job. +// +// All training jobs launched by parent hyperparameter tuning jobs and the new +// hyperparameter tuning jobs count against the limit of training jobs for the +// tuning job. +type HyperParameterTuningJobWarmStartConfig struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the transform job. + // An array of hyperparameter tuning jobs that are used as the starting point + // for the new hyperparameter tuning job. For more information about warm starting + // a hyperparameter tuning job, see Using a Previous Hyperparameter Tuning Job + // as a Starting Point (https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-warm-start.html). // - // TransformJobArn is a required field - TransformJobArn *string `type:"string" required:"true"` + // Hyperparameter tuning jobs created before October 1, 2018 cannot be used + // as parent jobs for warm start tuning jobs. + // + // ParentHyperParameterTuningJobs is a required field + ParentHyperParameterTuningJobs []*ParentHyperParameterTuningJob `min:"1" type:"list" required:"true"` + + // Specifies one of the following: + // + // IDENTICAL_DATA_AND_ALGORITHM + // + // The new hyperparameter tuning job uses the same input data and training image + // as the parent tuning jobs. You can change the hyperparameter ranges to search + // and the maximum number of training jobs that the hyperparameter tuning job + // launches. You cannot use a new version of the training algorithm, unless + // the changes in the new version do not affect the algorithm itself. For example, + // changes that improve logging or adding support for a different data format + // are allowed. You can also change hyperparameters from tunable to static, + // and from static to tunable, but the total number of static plus tunable hyperparameters + // must remain the same as it is in all parent jobs. The objective metric for + // the new tuning job must be the same as for all parent jobs. + // + // TRANSFER_LEARNING + // + // The new hyperparameter tuning job can include input data, hyperparameter + // ranges, maximum number of concurrent training jobs, and maximum number of + // training jobs that are different than those of its parent hyperparameter + // tuning jobs. The training image can also be a different version from the + // version used in the parent hyperparameter tuning job. You can also change + // hyperparameters from tunable to static, and from static to tunable, but the + // total number of static plus tunable hyperparameters must remain the same + // as it is in all parent jobs. The objective metric for the new tuning job + // must be the same as for all parent jobs. + // + // WarmStartType is a required field + WarmStartType *string `type:"string" required:"true" enum:"HyperParameterTuningJobWarmStartType"` } // String returns the string representation -func (s CreateTransformJobOutput) String() string { +func (s HyperParameterTuningJobWarmStartConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTransformJobOutput) GoString() string { +func (s HyperParameterTuningJobWarmStartConfig) GoString() string { return s.String() } -// SetTransformJobArn sets the TransformJobArn field's value. -func (s *CreateTransformJobOutput) SetTransformJobArn(v string) *CreateTransformJobOutput { - s.TransformJobArn = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *HyperParameterTuningJobWarmStartConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HyperParameterTuningJobWarmStartConfig"} + if s.ParentHyperParameterTuningJobs == nil { + invalidParams.Add(request.NewErrParamRequired("ParentHyperParameterTuningJobs")) + } + if s.ParentHyperParameterTuningJobs != nil && len(s.ParentHyperParameterTuningJobs) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ParentHyperParameterTuningJobs", 1)) + } + if s.WarmStartType == nil { + invalidParams.Add(request.NewErrParamRequired("WarmStartType")) + } + if s.ParentHyperParameterTuningJobs != nil { + for i, v := range s.ParentHyperParameterTuningJobs { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ParentHyperParameterTuningJobs", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetParentHyperParameterTuningJobs sets the ParentHyperParameterTuningJobs field's value. +func (s *HyperParameterTuningJobWarmStartConfig) SetParentHyperParameterTuningJobs(v []*ParentHyperParameterTuningJob) *HyperParameterTuningJobWarmStartConfig { + s.ParentHyperParameterTuningJobs = v return s } -type CreateWorkteamInput struct { +// SetWarmStartType sets the WarmStartType field's value. +func (s *HyperParameterTuningJobWarmStartConfig) SetWarmStartType(v string) *HyperParameterTuningJobWarmStartConfig { + s.WarmStartType = &v + return s +} + +// Defines how to perform inference generation after a training job is run. +type InferenceSpecification struct { _ struct{} `type:"structure"` - // A description of the work team. + // The Amazon ECR registry path of the Docker image that contains the inference + // code. // - // Description is a required field - Description *string `min:"1" type:"string" required:"true"` + // Containers is a required field + Containers []*ModelPackageContainerDefinition `min:"1" type:"list" required:"true"` - // A list of MemberDefinition objects that contains objects that identify the - // Amazon Cognito user pool that makes up the work team. For more information, - // see Amazon Cognito User Pools (https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-identity-pools.html). - // - // All of the CognitoMemberDefinition objects that make up the member definition - // must have the same ClientId and UserPool values. + // The supported MIME types for the input data. // - // MemberDefinitions is a required field - MemberDefinitions []*MemberDefinition `min:"1" type:"list" required:"true"` + // SupportedContentTypes is a required field + SupportedContentTypes []*string `type:"list" required:"true"` - // Configures notification of workers regarding available or expiring work items. - NotificationConfiguration *NotificationConfiguration `type:"structure"` + // A list of the instance types that are used to generate inferences in real-time. + // + // SupportedRealtimeInferenceInstanceTypes is a required field + SupportedRealtimeInferenceInstanceTypes []*string `type:"list" required:"true"` - // An array of key-value pairs. + // The supported MIME types for the output data. // - // For more information, see Resource Tag (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-resource-tags.html) - // and Using Cost Allocation Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) - // in the AWS Billing and Cost Management User Guide. - Tags []*Tag `type:"list"` + // SupportedResponseMIMETypes is a required field + SupportedResponseMIMETypes []*string `type:"list" required:"true"` - // The name of the work team. Use this name to identify the work team. + // A list of the instance types on which a transformation job can be run or + // on which an endpoint can be deployed. // - // WorkteamName is a required field - WorkteamName *string `min:"1" type:"string" required:"true"` + // SupportedTransformInstanceTypes is a required field + SupportedTransformInstanceTypes []*string `min:"1" type:"list" required:"true"` } // String returns the string representation -func (s CreateWorkteamInput) String() string { +func (s InferenceSpecification) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateWorkteamInput) GoString() string { +func (s InferenceSpecification) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateWorkteamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateWorkteamInput"} - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) +func (s *InferenceSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InferenceSpecification"} + if s.Containers == nil { + invalidParams.Add(request.NewErrParamRequired("Containers")) } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) + if s.Containers != nil && len(s.Containers) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Containers", 1)) } - if s.MemberDefinitions == nil { - invalidParams.Add(request.NewErrParamRequired("MemberDefinitions")) + if s.SupportedContentTypes == nil { + invalidParams.Add(request.NewErrParamRequired("SupportedContentTypes")) } - if s.MemberDefinitions != nil && len(s.MemberDefinitions) < 1 { - invalidParams.Add(request.NewErrParamMinLen("MemberDefinitions", 1)) + if s.SupportedRealtimeInferenceInstanceTypes == nil { + invalidParams.Add(request.NewErrParamRequired("SupportedRealtimeInferenceInstanceTypes")) } - if s.WorkteamName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkteamName")) + if s.SupportedResponseMIMETypes == nil { + invalidParams.Add(request.NewErrParamRequired("SupportedResponseMIMETypes")) } - if s.WorkteamName != nil && len(*s.WorkteamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkteamName", 1)) + if s.SupportedTransformInstanceTypes == nil { + invalidParams.Add(request.NewErrParamRequired("SupportedTransformInstanceTypes")) } - if s.MemberDefinitions != nil { - for i, v := range s.MemberDefinitions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MemberDefinitions", i), err.(request.ErrInvalidParams)) - } - } + if s.SupportedTransformInstanceTypes != nil && len(s.SupportedTransformInstanceTypes) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SupportedTransformInstanceTypes", 1)) } - if s.Tags != nil { - for i, v := range s.Tags { + if s.Containers != nil { + for i, v := range s.Containers { if v == nil { continue } if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Containers", i), err.(request.ErrInvalidParams)) } } } @@ -11098,170 +30001,125 @@ func (s *CreateWorkteamInput) Validate() error { return nil } -// SetDescription sets the Description field's value. -func (s *CreateWorkteamInput) SetDescription(v string) *CreateWorkteamInput { - s.Description = &v - return s -} - -// SetMemberDefinitions sets the MemberDefinitions field's value. -func (s *CreateWorkteamInput) SetMemberDefinitions(v []*MemberDefinition) *CreateWorkteamInput { - s.MemberDefinitions = v +// SetContainers sets the Containers field's value. +func (s *InferenceSpecification) SetContainers(v []*ModelPackageContainerDefinition) *InferenceSpecification { + s.Containers = v return s } -// SetNotificationConfiguration sets the NotificationConfiguration field's value. -func (s *CreateWorkteamInput) SetNotificationConfiguration(v *NotificationConfiguration) *CreateWorkteamInput { - s.NotificationConfiguration = v +// SetSupportedContentTypes sets the SupportedContentTypes field's value. +func (s *InferenceSpecification) SetSupportedContentTypes(v []*string) *InferenceSpecification { + s.SupportedContentTypes = v return s } -// SetTags sets the Tags field's value. -func (s *CreateWorkteamInput) SetTags(v []*Tag) *CreateWorkteamInput { - s.Tags = v +// SetSupportedRealtimeInferenceInstanceTypes sets the SupportedRealtimeInferenceInstanceTypes field's value. +func (s *InferenceSpecification) SetSupportedRealtimeInferenceInstanceTypes(v []*string) *InferenceSpecification { + s.SupportedRealtimeInferenceInstanceTypes = v return s } -// SetWorkteamName sets the WorkteamName field's value. -func (s *CreateWorkteamInput) SetWorkteamName(v string) *CreateWorkteamInput { - s.WorkteamName = &v +// SetSupportedResponseMIMETypes sets the SupportedResponseMIMETypes field's value. +func (s *InferenceSpecification) SetSupportedResponseMIMETypes(v []*string) *InferenceSpecification { + s.SupportedResponseMIMETypes = v return s } -type CreateWorkteamOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the work team. You can use this ARN to - // identify the work team. - WorkteamArn *string `type:"string"` -} - -// String returns the string representation -func (s CreateWorkteamOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s CreateWorkteamOutput) GoString() string { - return s.String() -} - -// SetWorkteamArn sets the WorkteamArn field's value. -func (s *CreateWorkteamOutput) SetWorkteamArn(v string) *CreateWorkteamOutput { - s.WorkteamArn = &v +// SetSupportedTransformInstanceTypes sets the SupportedTransformInstanceTypes field's value. +func (s *InferenceSpecification) SetSupportedTransformInstanceTypes(v []*string) *InferenceSpecification { + s.SupportedTransformInstanceTypes = v return s } -// The data structure used to specify the data to be used for inference in a -// batch transform job and to associate the data that is relevant to the prediction -// results in the output. The input filter provided allows you to exclude input -// data that is not needed for inference in a batch transform job. The output -// filter provided allows you to include input data relevant to interpreting -// the predictions in the output from the job. For more information, see Associate -// Prediction Results with their Corresponding Input Records (https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform-data-processing.html). -type DataProcessing struct { +// Contains information about the location of input model artifacts, the name +// and shape of the expected data inputs, and the framework in which the model +// was trained. +type InputConfig struct { _ struct{} `type:"structure"` - // A JSONPath (https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform-data-processing.html#data-processing-operators) - // expression used to select a portion of the input data to pass to the algorithm. - // Use the InputFilter parameter to exclude fields, such as an ID column, from - // the input. If you want Amazon SageMaker to pass the entire input dataset - // to the algorithm, accept the default value $. + // Specifies the name and shape of the expected data inputs for your trained + // model with a JSON dictionary form. The data inputs are InputConfig$Framework + // specific. // - // Examples: "$", "$[1:]", "$.features" - InputFilter *string `type:"string"` - - // Specifies the source of the data to join with the transformed data. The valid - // values are None and Input The default value is None which specifies not to - // join the input with the transformed data. If you want the batch transform - // job to join the original input data with the transformed data, set JoinSource - // to Input. + // * TensorFlow: You must specify the name and shape (NHWC format) of the + // expected data inputs using a dictionary format for your trained model. + // The dictionary formats required for the console and CLI are different. + // Examples for one input: If using the console, {"input":[1,1024,1024,3]} + // If using the CLI, {\"input\":[1,1024,1024,3]} Examples for two inputs: + // If using the console, {"data1": [1,28,28,1], "data2":[1,28,28,1]} If using + // the CLI, {\"data1\": [1,28,28,1], \"data2\":[1,28,28,1]} // - // For JSON or JSONLines objects, such as a JSON array, Amazon SageMaker adds - // the transformed data to the input JSON object in an attribute called SageMakerOutput. - // The joined result for JSON must be a key-value pair object. If the input - // is not a key-value pair object, Amazon SageMaker creates a new JSON file. - // In the new JSON file, and the input data is stored under the SageMakerInput - // key and the results are stored in SageMakerOutput. + // * KERAS: You must specify the name and shape (NCHW format) of expected + // data inputs using a dictionary format for your trained model. Note that + // while Keras model artifacts should be uploaded in NHWC (channel-last) + // format, DataInputConfig should be specified in NCHW (channel-first) format. + // The dictionary formats required for the console and CLI are different. + // Examples for one input: If using the console, {"input_1":[1,3,224,224]} + // If using the CLI, {\"input_1\":[1,3,224,224]} Examples for two inputs: + // If using the console, {"input_1": [1,3,224,224], "input_2":[1,3,224,224]} + // If using the CLI, {\"input_1\": [1,3,224,224], \"input_2\":[1,3,224,224]} // - // For CSV files, Amazon SageMaker combines the transformed data with the input - // data at the end of the input data and stores it in the output file. The joined - // data has the joined input data followed by the transformed data and the output - // is a CSV file. - JoinSource *string `type:"string" enum:"JoinSource"` - - // A JSONPath (https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform-data-processing.html#data-processing-operators) - // expression used to select a portion of the joined dataset to save in the - // output file for a batch transform job. If you want Amazon SageMaker to store - // the entire input dataset in the output file, leave the default value, $. - // If you specify indexes that aren't within the dimension size of the joined - // dataset, you get an error. + // * MXNET/ONNX: You must specify the name and shape (NCHW format) of the + // expected data inputs in order using a dictionary format for your trained + // model. The dictionary formats required for the console and CLI are different. + // Examples for one input: If using the console, {"data":[1,3,1024,1024]} + // If using the CLI, {\"data\":[1,3,1024,1024]} Examples for two inputs: + // If using the console, {"var1": [1,1,28,28], "var2":[1,1,28,28]} If using + // the CLI, {\"var1\": [1,1,28,28], \"var2\":[1,1,28,28]} // - // Examples: "$", "$[0,5:]", "$['id','SageMakerOutput']" - OutputFilter *string `type:"string"` -} - -// String returns the string representation -func (s DataProcessing) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DataProcessing) GoString() string { - return s.String() -} - -// SetInputFilter sets the InputFilter field's value. -func (s *DataProcessing) SetInputFilter(v string) *DataProcessing { - s.InputFilter = &v - return s -} - -// SetJoinSource sets the JoinSource field's value. -func (s *DataProcessing) SetJoinSource(v string) *DataProcessing { - s.JoinSource = &v - return s -} - -// SetOutputFilter sets the OutputFilter field's value. -func (s *DataProcessing) SetOutputFilter(v string) *DataProcessing { - s.OutputFilter = &v - return s -} - -// Describes the location of the channel data. -type DataSource struct { - _ struct{} `type:"structure"` + // * PyTorch: You can either specify the name and shape (NCHW format) of + // expected data inputs in order using a dictionary format for your trained + // model or you can specify the shape only using a list format. The dictionary + // formats required for the console and CLI are different. The list formats + // for the console and CLI are the same. Examples for one input in dictionary + // format: If using the console, {"input0":[1,3,224,224]} If using the CLI, + // {\"input0\":[1,3,224,224]} Example for one input in list format: [[1,3,224,224]] + // Examples for two inputs in dictionary format: If using the console, {"input0":[1,3,224,224], + // "input1":[1,3,224,224]} If using the CLI, {\"input0\":[1,3,224,224], \"input1\":[1,3,224,224]} + // Example for two inputs in list format: [[1,3,224,224], [1,3,224,224]] + // + // * XGBOOST: input data name and shape are not needed. + // + // DataInputConfig is a required field + DataInputConfig *string `min:"1" type:"string" required:"true"` - // The file system that is associated with a channel. - FileSystemDataSource *FileSystemDataSource `type:"structure"` + // Identifies the framework in which the model was trained. For example: TENSORFLOW. + // + // Framework is a required field + Framework *string `type:"string" required:"true" enum:"Framework"` - // The S3 location of the data source that is associated with a channel. - S3DataSource *S3DataSource `type:"structure"` + // The S3 path where the model artifacts, which result from model training, + // are stored. This path must point to a single gzip compressed tar archive + // (.tar.gz suffix). + // + // S3Uri is a required field + S3Uri *string `type:"string" required:"true"` } // String returns the string representation -func (s DataSource) String() string { +func (s InputConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DataSource) GoString() string { +func (s InputConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DataSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DataSource"} - if s.FileSystemDataSource != nil { - if err := s.FileSystemDataSource.Validate(); err != nil { - invalidParams.AddNested("FileSystemDataSource", err.(request.ErrInvalidParams)) - } +func (s *InputConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "InputConfig"} + if s.DataInputConfig == nil { + invalidParams.Add(request.NewErrParamRequired("DataInputConfig")) } - if s.S3DataSource != nil { - if err := s.S3DataSource.Validate(); err != nil { - invalidParams.AddNested("S3DataSource", err.(request.ErrInvalidParams)) - } + if s.DataInputConfig != nil && len(*s.DataInputConfig) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DataInputConfig", 1)) + } + if s.Framework == nil { + invalidParams.Add(request.NewErrParamRequired("Framework")) + } + if s.S3Uri == nil { + invalidParams.Add(request.NewErrParamRequired("S3Uri")) } if invalidParams.Len() > 0 { @@ -11270,45 +30128,89 @@ func (s *DataSource) Validate() error { return nil } -// SetFileSystemDataSource sets the FileSystemDataSource field's value. -func (s *DataSource) SetFileSystemDataSource(v *FileSystemDataSource) *DataSource { - s.FileSystemDataSource = v +// SetDataInputConfig sets the DataInputConfig field's value. +func (s *InputConfig) SetDataInputConfig(v string) *InputConfig { + s.DataInputConfig = &v return s } -// SetS3DataSource sets the S3DataSource field's value. -func (s *DataSource) SetS3DataSource(v *S3DataSource) *DataSource { - s.S3DataSource = v +// SetFramework sets the Framework field's value. +func (s *InputConfig) SetFramework(v string) *InputConfig { + s.Framework = &v return s } -type DeleteAlgorithmInput struct { +// SetS3Uri sets the S3Uri field's value. +func (s *InputConfig) SetS3Uri(v string) *InputConfig { + s.S3Uri = &v + return s +} + +// For a hyperparameter of the integer type, specifies the range that a hyperparameter +// tuning job searches. +type IntegerParameterRange struct { _ struct{} `type:"structure"` - // The name of the algorithm to delete. + // The maximum value of the hyperparameter to search. + // + // MaxValue is a required field + MaxValue *string `type:"string" required:"true"` + + // The minimum value of the hyperparameter to search. + // + // MinValue is a required field + MinValue *string `type:"string" required:"true"` + + // The name of the hyperparameter to search. + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // The scale that hyperparameter tuning uses to search the hyperparameter range. + // For information about choosing a hyperparameter scale, see Hyperparameter + // Scaling (https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-define-ranges.html#scaling-type). + // One of the following values: + // + // Auto // - // AlgorithmName is a required field - AlgorithmName *string `min:"1" type:"string" required:"true"` + // Amazon SageMaker hyperparameter tuning chooses the best scale for the hyperparameter. + // + // Linear + // + // Hyperparameter tuning searches the values in the hyperparameter range by + // using a linear scale. + // + // Logarithmic + // + // Hyperparameter tuning searches the values in the hyperparameter range by + // using a logarithmic scale. + // + // Logarithmic scaling works only for ranges that have only values greater than + // 0. + ScalingType *string `type:"string" enum:"HyperParameterScalingType"` } // String returns the string representation -func (s DeleteAlgorithmInput) String() string { +func (s IntegerParameterRange) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteAlgorithmInput) GoString() string { +func (s IntegerParameterRange) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteAlgorithmInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteAlgorithmInput"} - if s.AlgorithmName == nil { - invalidParams.Add(request.NewErrParamRequired("AlgorithmName")) +func (s *IntegerParameterRange) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "IntegerParameterRange"} + if s.MaxValue == nil { + invalidParams.Add(request.NewErrParamRequired("MaxValue")) } - if s.AlgorithmName != nil && len(*s.AlgorithmName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AlgorithmName", 1)) + if s.MinValue == nil { + invalidParams.Add(request.NewErrParamRequired("MinValue")) + } + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) } if invalidParams.Len() > 0 { @@ -11317,53 +30219,63 @@ func (s *DeleteAlgorithmInput) Validate() error { return nil } -// SetAlgorithmName sets the AlgorithmName field's value. -func (s *DeleteAlgorithmInput) SetAlgorithmName(v string) *DeleteAlgorithmInput { - s.AlgorithmName = &v +// SetMaxValue sets the MaxValue field's value. +func (s *IntegerParameterRange) SetMaxValue(v string) *IntegerParameterRange { + s.MaxValue = &v return s } -type DeleteAlgorithmOutput struct { - _ struct{} `type:"structure"` +// SetMinValue sets the MinValue field's value. +func (s *IntegerParameterRange) SetMinValue(v string) *IntegerParameterRange { + s.MinValue = &v + return s } -// String returns the string representation -func (s DeleteAlgorithmOutput) String() string { - return awsutil.Prettify(s) +// SetName sets the Name field's value. +func (s *IntegerParameterRange) SetName(v string) *IntegerParameterRange { + s.Name = &v + return s } -// GoString returns the string representation -func (s DeleteAlgorithmOutput) GoString() string { - return s.String() +// SetScalingType sets the ScalingType field's value. +func (s *IntegerParameterRange) SetScalingType(v string) *IntegerParameterRange { + s.ScalingType = &v + return s } -type DeleteCodeRepositoryInput struct { +// Defines the possible values for an integer hyperparameter. +type IntegerParameterRangeSpecification struct { _ struct{} `type:"structure"` - // The name of the Git repository to delete. + // The maximum integer value allowed. // - // CodeRepositoryName is a required field - CodeRepositoryName *string `min:"1" type:"string" required:"true"` + // MaxValue is a required field + MaxValue *string `type:"string" required:"true"` + + // The minimum integer value allowed. + // + // MinValue is a required field + MinValue *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteCodeRepositoryInput) String() string { +func (s IntegerParameterRangeSpecification) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteCodeRepositoryInput) GoString() string { +func (s IntegerParameterRangeSpecification) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteCodeRepositoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteCodeRepositoryInput"} - if s.CodeRepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("CodeRepositoryName")) +func (s *IntegerParameterRangeSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "IntegerParameterRangeSpecification"} + if s.MaxValue == nil { + invalidParams.Add(request.NewErrParamRequired("MaxValue")) } - if s.CodeRepositoryName != nil && len(*s.CodeRepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CodeRepositoryName", 1)) + if s.MinValue == nil { + invalidParams.Add(request.NewErrParamRequired("MinValue")) } if invalidParams.Len() > 0 { @@ -11372,210 +30284,215 @@ func (s *DeleteCodeRepositoryInput) Validate() error { return nil } -// SetCodeRepositoryName sets the CodeRepositoryName field's value. -func (s *DeleteCodeRepositoryInput) SetCodeRepositoryName(v string) *DeleteCodeRepositoryInput { - s.CodeRepositoryName = &v +// SetMaxValue sets the MaxValue field's value. +func (s *IntegerParameterRangeSpecification) SetMaxValue(v string) *IntegerParameterRangeSpecification { + s.MaxValue = &v return s } -type DeleteCodeRepositoryOutput struct { +// SetMinValue sets the MinValue field's value. +func (s *IntegerParameterRangeSpecification) SetMinValue(v string) *IntegerParameterRangeSpecification { + s.MinValue = &v + return s +} + +// Jupyter server's app settings. +type JupyterServerAppSettings struct { _ struct{} `type:"structure"` + + // The instance type and quantity. + DefaultResourceSpec *ResourceSpec `type:"structure"` } // String returns the string representation -func (s DeleteCodeRepositoryOutput) String() string { +func (s JupyterServerAppSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteCodeRepositoryOutput) GoString() string { +func (s JupyterServerAppSettings) GoString() string { return s.String() } -type DeleteEndpointConfigInput struct { +// SetDefaultResourceSpec sets the DefaultResourceSpec field's value. +func (s *JupyterServerAppSettings) SetDefaultResourceSpec(v *ResourceSpec) *JupyterServerAppSettings { + s.DefaultResourceSpec = v + return s +} + +// The kernel gateway app settings. +type KernelGatewayAppSettings struct { _ struct{} `type:"structure"` - // The name of the endpoint configuration that you want to delete. - // - // EndpointConfigName is a required field - EndpointConfigName *string `type:"string" required:"true"` + // The instance type and quantity. + DefaultResourceSpec *ResourceSpec `type:"structure"` } // String returns the string representation -func (s DeleteEndpointConfigInput) String() string { +func (s KernelGatewayAppSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteEndpointConfigInput) GoString() string { +func (s KernelGatewayAppSettings) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEndpointConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEndpointConfigInput"} - if s.EndpointConfigName == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointConfigName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndpointConfigName sets the EndpointConfigName field's value. -func (s *DeleteEndpointConfigInput) SetEndpointConfigName(v string) *DeleteEndpointConfigInput { - s.EndpointConfigName = &v +// SetDefaultResourceSpec sets the DefaultResourceSpec field's value. +func (s *KernelGatewayAppSettings) SetDefaultResourceSpec(v *ResourceSpec) *KernelGatewayAppSettings { + s.DefaultResourceSpec = v return s } -type DeleteEndpointConfigOutput struct { +// Provides a breakdown of the number of objects labeled. +type LabelCounters struct { _ struct{} `type:"structure"` -} -// String returns the string representation -func (s DeleteEndpointConfigOutput) String() string { - return awsutil.Prettify(s) -} + // The total number of objects that could not be labeled due to an error. + FailedNonRetryableError *int64 `type:"integer"` -// GoString returns the string representation -func (s DeleteEndpointConfigOutput) GoString() string { - return s.String() -} + // The total number of objects labeled by a human worker. + HumanLabeled *int64 `type:"integer"` -type DeleteEndpointInput struct { - _ struct{} `type:"structure"` + // The total number of objects labeled by automated data labeling. + MachineLabeled *int64 `type:"integer"` - // The name of the endpoint that you want to delete. - // - // EndpointName is a required field - EndpointName *string `type:"string" required:"true"` + // The total number of objects labeled. + TotalLabeled *int64 `type:"integer"` + + // The total number of objects not yet labeled. + Unlabeled *int64 `type:"integer"` } // String returns the string representation -func (s DeleteEndpointInput) String() string { +func (s LabelCounters) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteEndpointInput) GoString() string { +func (s LabelCounters) 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.EndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetFailedNonRetryableError sets the FailedNonRetryableError field's value. +func (s *LabelCounters) SetFailedNonRetryableError(v int64) *LabelCounters { + s.FailedNonRetryableError = &v + return s } -// SetEndpointName sets the EndpointName field's value. -func (s *DeleteEndpointInput) SetEndpointName(v string) *DeleteEndpointInput { - s.EndpointName = &v +// SetHumanLabeled sets the HumanLabeled field's value. +func (s *LabelCounters) SetHumanLabeled(v int64) *LabelCounters { + s.HumanLabeled = &v return s } -type DeleteEndpointOutput struct { - _ struct{} `type:"structure"` +// SetMachineLabeled sets the MachineLabeled field's value. +func (s *LabelCounters) SetMachineLabeled(v int64) *LabelCounters { + s.MachineLabeled = &v + return s } -// String returns the string representation -func (s DeleteEndpointOutput) String() string { - return awsutil.Prettify(s) +// SetTotalLabeled sets the TotalLabeled field's value. +func (s *LabelCounters) SetTotalLabeled(v int64) *LabelCounters { + s.TotalLabeled = &v + return s } -// GoString returns the string representation -func (s DeleteEndpointOutput) GoString() string { - return s.String() +// SetUnlabeled sets the Unlabeled field's value. +func (s *LabelCounters) SetUnlabeled(v int64) *LabelCounters { + s.Unlabeled = &v + return s } -type DeleteModelInput struct { +// Provides counts for human-labeled tasks in the labeling job. +type LabelCountersForWorkteam struct { _ struct{} `type:"structure"` - // The name of the model to delete. - // - // ModelName is a required field - ModelName *string `type:"string" required:"true"` + // The total number of data objects labeled by a human worker. + HumanLabeled *int64 `type:"integer"` + + // The total number of data objects that need to be labeled by a human worker. + PendingHuman *int64 `type:"integer"` + + // The total number of tasks in the labeling job. + Total *int64 `type:"integer"` } // String returns the string representation -func (s DeleteModelInput) String() string { +func (s LabelCountersForWorkteam) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteModelInput) GoString() string { +func (s LabelCountersForWorkteam) 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 invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetModelName sets the ModelName field's value. -func (s *DeleteModelInput) SetModelName(v string) *DeleteModelInput { - s.ModelName = &v +// SetHumanLabeled sets the HumanLabeled field's value. +func (s *LabelCountersForWorkteam) SetHumanLabeled(v int64) *LabelCountersForWorkteam { + s.HumanLabeled = &v return s } -type DeleteModelOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteModelOutput) String() string { - return awsutil.Prettify(s) +// SetPendingHuman sets the PendingHuman field's value. +func (s *LabelCountersForWorkteam) SetPendingHuman(v int64) *LabelCountersForWorkteam { + s.PendingHuman = &v + return s } -// GoString returns the string representation -func (s DeleteModelOutput) GoString() string { - return s.String() +// SetTotal sets the Total field's value. +func (s *LabelCountersForWorkteam) SetTotal(v int64) *LabelCountersForWorkteam { + s.Total = &v + return s } -type DeleteModelPackageInput struct { +// Provides configuration information for auto-labeling of your data objects. +// A LabelingJobAlgorithmsConfig object must be supplied in order to use auto-labeling. +type LabelingJobAlgorithmsConfig struct { _ struct{} `type:"structure"` - // The name of the model package. The name must have 1 to 63 characters. Valid - // characters are a-z, A-Z, 0-9, and - (hyphen). + // At the end of an auto-label job Amazon SageMaker Ground Truth sends the Amazon + // Resource Nam (ARN) of the final model used for auto-labeling. You can use + // this model as the starting point for subsequent similar jobs by providing + // the ARN of the model here. + InitialActiveLearningModelArn *string `min:"20" type:"string"` + + // Specifies the Amazon Resource Name (ARN) of the algorithm used for auto-labeling. + // You must select one of the following ARNs: // - // ModelPackageName is a required field - ModelPackageName *string `min:"1" type:"string" required:"true"` + // * Image classification arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/image-classification + // + // * Text classification arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/text-classification + // + // * Object detection arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/object-detection + // + // * Semantic Segmentation arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/semantic-segmentation + // + // LabelingJobAlgorithmSpecificationArn is a required field + LabelingJobAlgorithmSpecificationArn *string `type:"string" required:"true"` + + // Provides configuration information for a labeling job. + LabelingJobResourceConfig *LabelingJobResourceConfig `type:"structure"` } // String returns the string representation -func (s DeleteModelPackageInput) String() string { +func (s LabelingJobAlgorithmsConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteModelPackageInput) GoString() string { +func (s LabelingJobAlgorithmsConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteModelPackageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteModelPackageInput"} - if s.ModelPackageName == nil { - invalidParams.Add(request.NewErrParamRequired("ModelPackageName")) +func (s *LabelingJobAlgorithmsConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LabelingJobAlgorithmsConfig"} + if s.InitialActiveLearningModelArn != nil && len(*s.InitialActiveLearningModelArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("InitialActiveLearningModelArn", 20)) } - if s.ModelPackageName != nil && len(*s.ModelPackageName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ModelPackageName", 1)) + if s.LabelingJobAlgorithmSpecificationArn == nil { + invalidParams.Add(request.NewErrParamRequired("LabelingJobAlgorithmSpecificationArn")) } if invalidParams.Len() > 0 { @@ -11584,50 +30501,81 @@ func (s *DeleteModelPackageInput) Validate() error { return nil } -// SetModelPackageName sets the ModelPackageName field's value. -func (s *DeleteModelPackageInput) SetModelPackageName(v string) *DeleteModelPackageInput { - s.ModelPackageName = &v +// SetInitialActiveLearningModelArn sets the InitialActiveLearningModelArn field's value. +func (s *LabelingJobAlgorithmsConfig) SetInitialActiveLearningModelArn(v string) *LabelingJobAlgorithmsConfig { + s.InitialActiveLearningModelArn = &v return s } -type DeleteModelPackageOutput struct { +// SetLabelingJobAlgorithmSpecificationArn sets the LabelingJobAlgorithmSpecificationArn field's value. +func (s *LabelingJobAlgorithmsConfig) SetLabelingJobAlgorithmSpecificationArn(v string) *LabelingJobAlgorithmsConfig { + s.LabelingJobAlgorithmSpecificationArn = &v + return s +} + +// SetLabelingJobResourceConfig sets the LabelingJobResourceConfig field's value. +func (s *LabelingJobAlgorithmsConfig) SetLabelingJobResourceConfig(v *LabelingJobResourceConfig) *LabelingJobAlgorithmsConfig { + s.LabelingJobResourceConfig = v + return s +} + +// Attributes of the data specified by the customer. Use these to describe the +// data to be labeled. +type LabelingJobDataAttributes struct { _ struct{} `type:"structure"` + + // Declares that your content is free of personally identifiable information + // or adult content. Amazon SageMaker may restrict the Amazon Mechanical Turk + // workers that can view your task based on this information. + ContentClassifiers []*string `type:"list"` } // String returns the string representation -func (s DeleteModelPackageOutput) String() string { +func (s LabelingJobDataAttributes) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteModelPackageOutput) GoString() string { +func (s LabelingJobDataAttributes) GoString() string { return s.String() } -type DeleteNotebookInstanceInput struct { +// SetContentClassifiers sets the ContentClassifiers field's value. +func (s *LabelingJobDataAttributes) SetContentClassifiers(v []*string) *LabelingJobDataAttributes { + s.ContentClassifiers = v + return s +} + +// Provides information about the location of input data. +type LabelingJobDataSource struct { _ struct{} `type:"structure"` - // The name of the Amazon SageMaker notebook instance to delete. + // The Amazon S3 location of the input data objects. // - // NotebookInstanceName is a required field - NotebookInstanceName *string `type:"string" required:"true"` + // S3DataSource is a required field + S3DataSource *LabelingJobS3DataSource `type:"structure" required:"true"` } // String returns the string representation -func (s DeleteNotebookInstanceInput) String() string { +func (s LabelingJobDataSource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteNotebookInstanceInput) GoString() string { +func (s LabelingJobDataSource) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNotebookInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNotebookInstanceInput"} - if s.NotebookInstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("NotebookInstanceName")) +func (s *LabelingJobDataSource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LabelingJobDataSource"} + if s.S3DataSource == nil { + invalidParams.Add(request.NewErrParamRequired("S3DataSource")) + } + if s.S3DataSource != nil { + if err := s.S3DataSource.Validate(); err != nil { + invalidParams.AddNested("S3DataSource", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -11636,113 +30584,119 @@ func (s *DeleteNotebookInstanceInput) Validate() error { return nil } -// SetNotebookInstanceName sets the NotebookInstanceName field's value. -func (s *DeleteNotebookInstanceInput) SetNotebookInstanceName(v string) *DeleteNotebookInstanceInput { - s.NotebookInstanceName = &v +// SetS3DataSource sets the S3DataSource field's value. +func (s *LabelingJobDataSource) SetS3DataSource(v *LabelingJobS3DataSource) *LabelingJobDataSource { + s.S3DataSource = v return s } -type DeleteNotebookInstanceLifecycleConfigInput struct { +// Provides summary information for a work team. +type LabelingJobForWorkteamSummary struct { _ struct{} `type:"structure"` - // The name of the lifecycle configuration to delete. + // The date and time that the labeling job was created. // - // NotebookInstanceLifecycleConfigName is a required field - NotebookInstanceLifecycleConfigName *string `type:"string" required:"true"` + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // A unique identifier for a labeling job. You can use this to refer to a specific + // labeling job. + // + // JobReferenceCode is a required field + JobReferenceCode *string `min:"1" type:"string" required:"true"` + + // Provides information about the progress of a labeling job. + LabelCounters *LabelCountersForWorkteam `type:"structure"` + + // The name of the labeling job that the work team is assigned to. + LabelingJobName *string `min:"1" type:"string"` + + // The configured number of workers per data object. + NumberOfHumanWorkersPerDataObject *int64 `min:"1" type:"integer"` + + // WorkRequesterAccountId is a required field + WorkRequesterAccountId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteNotebookInstanceLifecycleConfigInput) String() string { +func (s LabelingJobForWorkteamSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteNotebookInstanceLifecycleConfigInput) GoString() string { +func (s LabelingJobForWorkteamSummary) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteNotebookInstanceLifecycleConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteNotebookInstanceLifecycleConfigInput"} - if s.NotebookInstanceLifecycleConfigName == nil { - invalidParams.Add(request.NewErrParamRequired("NotebookInstanceLifecycleConfigName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNotebookInstanceLifecycleConfigName sets the NotebookInstanceLifecycleConfigName field's value. -func (s *DeleteNotebookInstanceLifecycleConfigInput) SetNotebookInstanceLifecycleConfigName(v string) *DeleteNotebookInstanceLifecycleConfigInput { - s.NotebookInstanceLifecycleConfigName = &v +// SetCreationTime sets the CreationTime field's value. +func (s *LabelingJobForWorkteamSummary) SetCreationTime(v time.Time) *LabelingJobForWorkteamSummary { + s.CreationTime = &v return s } -type DeleteNotebookInstanceLifecycleConfigOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DeleteNotebookInstanceLifecycleConfigOutput) String() string { - return awsutil.Prettify(s) +// SetJobReferenceCode sets the JobReferenceCode field's value. +func (s *LabelingJobForWorkteamSummary) SetJobReferenceCode(v string) *LabelingJobForWorkteamSummary { + s.JobReferenceCode = &v + return s } -// GoString returns the string representation -func (s DeleteNotebookInstanceLifecycleConfigOutput) GoString() string { - return s.String() +// SetLabelCounters sets the LabelCounters field's value. +func (s *LabelingJobForWorkteamSummary) SetLabelCounters(v *LabelCountersForWorkteam) *LabelingJobForWorkteamSummary { + s.LabelCounters = v + return s } -type DeleteNotebookInstanceOutput struct { - _ struct{} `type:"structure"` +// SetLabelingJobName sets the LabelingJobName field's value. +func (s *LabelingJobForWorkteamSummary) SetLabelingJobName(v string) *LabelingJobForWorkteamSummary { + s.LabelingJobName = &v + return s } -// String returns the string representation -func (s DeleteNotebookInstanceOutput) String() string { - return awsutil.Prettify(s) +// SetNumberOfHumanWorkersPerDataObject sets the NumberOfHumanWorkersPerDataObject field's value. +func (s *LabelingJobForWorkteamSummary) SetNumberOfHumanWorkersPerDataObject(v int64) *LabelingJobForWorkteamSummary { + s.NumberOfHumanWorkersPerDataObject = &v + return s } -// GoString returns the string representation -func (s DeleteNotebookInstanceOutput) GoString() string { - return s.String() +// SetWorkRequesterAccountId sets the WorkRequesterAccountId field's value. +func (s *LabelingJobForWorkteamSummary) SetWorkRequesterAccountId(v string) *LabelingJobForWorkteamSummary { + s.WorkRequesterAccountId = &v + return s } -type DeleteTagsInput struct { +// Input configuration information for a labeling job. +type LabelingJobInputConfig struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the resource whose tags you want to delete. - // - // ResourceArn is a required field - ResourceArn *string `type:"string" required:"true"` + // Attributes of the data specified by the customer. + DataAttributes *LabelingJobDataAttributes `type:"structure"` - // An array or one or more tag keys to delete. + // The location of the input data. // - // TagKeys is a required field - TagKeys []*string `min:"1" type:"list" required:"true"` + // DataSource is a required field + DataSource *LabelingJobDataSource `type:"structure" required:"true"` } // String returns the string representation -func (s DeleteTagsInput) String() string { +func (s LabelingJobInputConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTagsInput) GoString() string { +func (s LabelingJobInputConfig) 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.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) +func (s *LabelingJobInputConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LabelingJobInputConfig"} + if s.DataSource == nil { + invalidParams.Add(request.NewErrParamRequired("DataSource")) } - if s.TagKeys != nil && len(s.TagKeys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TagKeys", 1)) + if s.DataSource != nil { + if err := s.DataSource.Validate(); err != nil { + invalidParams.AddNested("DataSource", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -11751,59 +30705,98 @@ func (s *DeleteTagsInput) Validate() error { return nil } -// SetResourceArn sets the ResourceArn field's value. -func (s *DeleteTagsInput) SetResourceArn(v string) *DeleteTagsInput { - s.ResourceArn = &v +// SetDataAttributes sets the DataAttributes field's value. +func (s *LabelingJobInputConfig) SetDataAttributes(v *LabelingJobDataAttributes) *LabelingJobInputConfig { + s.DataAttributes = v return s } -// SetTagKeys sets the TagKeys field's value. -func (s *DeleteTagsInput) SetTagKeys(v []*string) *DeleteTagsInput { - s.TagKeys = v +// SetDataSource sets the DataSource field's value. +func (s *LabelingJobInputConfig) SetDataSource(v *LabelingJobDataSource) *LabelingJobInputConfig { + s.DataSource = v return s } -type DeleteTagsOutput struct { +// Specifies the location of the output produced by the labeling job. +type LabelingJobOutput struct { _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) for the most recent Amazon SageMaker model + // trained as part of automated data labeling. + FinalActiveLearningModelArn *string `min:"20" type:"string"` + + // The Amazon S3 bucket location of the manifest file for labeled data. + // + // OutputDatasetS3Uri is a required field + OutputDatasetS3Uri *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteTagsOutput) String() string { +func (s LabelingJobOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTagsOutput) GoString() string { +func (s LabelingJobOutput) GoString() string { return s.String() } -type DeleteWorkteamInput struct { +// SetFinalActiveLearningModelArn sets the FinalActiveLearningModelArn field's value. +func (s *LabelingJobOutput) SetFinalActiveLearningModelArn(v string) *LabelingJobOutput { + s.FinalActiveLearningModelArn = &v + return s +} + +// SetOutputDatasetS3Uri sets the OutputDatasetS3Uri field's value. +func (s *LabelingJobOutput) SetOutputDatasetS3Uri(v string) *LabelingJobOutput { + s.OutputDatasetS3Uri = &v + return s +} + +// Output configuration information for a labeling job. +type LabelingJobOutputConfig struct { _ struct{} `type:"structure"` - // The name of the work team to delete. + // The AWS Key Management Service ID of the key used to encrypt the output data, + // if any. // - // WorkteamName is a required field - WorkteamName *string `min:"1" type:"string" required:"true"` + // If you use a KMS key ID or an alias of your master key, the Amazon SageMaker + // execution role must include permissions to call kms:Encrypt. If you don't + // provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon + // S3 for your role's account. Amazon SageMaker uses server-side encryption + // with KMS-managed keys for LabelingJobOutputConfig. If you use a bucket policy + // with an s3:PutObject permission that only allows objects with server-side + // encryption, set the condition key of s3:x-amz-server-side-encryption to "aws:kms". + // For more information, see KMS-Managed Encryption Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) + // in the Amazon Simple Storage Service Developer Guide. + // + // The KMS key policy must grant permission to the IAM role that you specify + // in your CreateLabelingJob request. For more information, see Using Key Policies + // in AWS KMS (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) + // in the AWS Key Management Service Developer Guide. + KmsKeyId *string `type:"string"` + + // The Amazon S3 location to write output data. + // + // S3OutputPath is a required field + S3OutputPath *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteWorkteamInput) String() string { +func (s LabelingJobOutputConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteWorkteamInput) GoString() string { +func (s LabelingJobOutputConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteWorkteamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteWorkteamInput"} - if s.WorkteamName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkteamName")) - } - if s.WorkteamName != nil && len(*s.WorkteamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkteamName", 1)) +func (s *LabelingJobOutputConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LabelingJobOutputConfig"} + if s.S3OutputPath == nil { + invalidParams.Add(request.NewErrParamRequired("S3OutputPath")) } if invalidParams.Len() > 0 { @@ -11812,115 +30805,122 @@ func (s *DeleteWorkteamInput) Validate() error { return nil } -// SetWorkteamName sets the WorkteamName field's value. -func (s *DeleteWorkteamInput) SetWorkteamName(v string) *DeleteWorkteamInput { - s.WorkteamName = &v +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *LabelingJobOutputConfig) SetKmsKeyId(v string) *LabelingJobOutputConfig { + s.KmsKeyId = &v return s } -type DeleteWorkteamOutput struct { +// SetS3OutputPath sets the S3OutputPath field's value. +func (s *LabelingJobOutputConfig) SetS3OutputPath(v string) *LabelingJobOutputConfig { + s.S3OutputPath = &v + return s +} + +// Provides configuration information for labeling jobs. +type LabelingJobResourceConfig struct { _ struct{} `type:"structure"` - // Returns true if the work team was successfully deleted; otherwise, returns - // false. + // The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to + // encrypt data on the storage volume attached to the ML compute instance(s) + // that run the training job. The VolumeKmsKeyId can be any of the following + // formats: // - // Success is a required field - Success *bool `type:"boolean" required:"true"` + // * // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab" + // + // * // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + VolumeKmsKeyId *string `type:"string"` } // String returns the string representation -func (s DeleteWorkteamOutput) String() string { +func (s LabelingJobResourceConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteWorkteamOutput) GoString() string { +func (s LabelingJobResourceConfig) GoString() string { return s.String() } -// SetSuccess sets the Success field's value. -func (s *DeleteWorkteamOutput) SetSuccess(v bool) *DeleteWorkteamOutput { - s.Success = &v +// SetVolumeKmsKeyId sets the VolumeKmsKeyId field's value. +func (s *LabelingJobResourceConfig) SetVolumeKmsKeyId(v string) *LabelingJobResourceConfig { + s.VolumeKmsKeyId = &v return s } -// Gets the Amazon EC2 Container Registry path of the docker image of the model -// that is hosted in this ProductionVariant. -// -// If you used the registry/repository[:tag] form to specify the image path -// of the primary container when you created the model hosted in this ProductionVariant, -// the path resolves to a path of the form registry/repository[@digest]. A digest -// is a hash value that identifies a specific version of an image. For information -// about Amazon ECR paths, see Pulling an Image (https://docs.aws.amazon.com/AmazonECR/latest/userguide/docker-pull-ecr-image.html) -// in the Amazon ECR User Guide. -type DeployedImage struct { +// The Amazon S3 location of the input data objects. +type LabelingJobS3DataSource struct { _ struct{} `type:"structure"` - // The date and time when the image path for the model resolved to the ResolvedImage - ResolutionTime *time.Time `type:"timestamp"` - - // The specific digest path of the image hosted in this ProductionVariant. - ResolvedImage *string `type:"string"` - - // The image path you specified when you created the model. - SpecifiedImage *string `type:"string"` + // The Amazon S3 location of the manifest file that describes the input data + // objects. + // + // ManifestS3Uri is a required field + ManifestS3Uri *string `type:"string" required:"true"` } // String returns the string representation -func (s DeployedImage) String() string { +func (s LabelingJobS3DataSource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeployedImage) GoString() string { +func (s LabelingJobS3DataSource) GoString() string { return s.String() } -// SetResolutionTime sets the ResolutionTime field's value. -func (s *DeployedImage) SetResolutionTime(v time.Time) *DeployedImage { - s.ResolutionTime = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *LabelingJobS3DataSource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LabelingJobS3DataSource"} + if s.ManifestS3Uri == nil { + invalidParams.Add(request.NewErrParamRequired("ManifestS3Uri")) + } -// SetResolvedImage sets the ResolvedImage field's value. -func (s *DeployedImage) SetResolvedImage(v string) *DeployedImage { - s.ResolvedImage = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetSpecifiedImage sets the SpecifiedImage field's value. -func (s *DeployedImage) SetSpecifiedImage(v string) *DeployedImage { - s.SpecifiedImage = &v +// SetManifestS3Uri sets the ManifestS3Uri field's value. +func (s *LabelingJobS3DataSource) SetManifestS3Uri(v string) *LabelingJobS3DataSource { + s.ManifestS3Uri = &v return s } -type DescribeAlgorithmInput struct { +// A set of conditions for stopping a labeling job. If any of the conditions +// are met, the job is automatically stopped. You can use these conditions to +// control the cost of data labeling. +// +// Labeling jobs fail after 30 days with an appropriate client error message. +type LabelingJobStoppingConditions struct { _ struct{} `type:"structure"` - // The name of the algorithm to describe. - // - // AlgorithmName is a required field - AlgorithmName *string `min:"1" type:"string" required:"true"` + // The maximum number of objects that can be labeled by human workers. + MaxHumanLabeledObjectCount *int64 `min:"1" type:"integer"` + + // The maximum number of input data objects that should be labeled. + MaxPercentageOfInputDatasetLabeled *int64 `min:"1" type:"integer"` } // String returns the string representation -func (s DescribeAlgorithmInput) String() string { +func (s LabelingJobStoppingConditions) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAlgorithmInput) GoString() string { +func (s LabelingJobStoppingConditions) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAlgorithmInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAlgorithmInput"} - if s.AlgorithmName == nil { - invalidParams.Add(request.NewErrParamRequired("AlgorithmName")) +func (s *LabelingJobStoppingConditions) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LabelingJobStoppingConditions"} + if s.MaxHumanLabeledObjectCount != nil && *s.MaxHumanLabeledObjectCount < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxHumanLabeledObjectCount", 1)) } - if s.AlgorithmName != nil && len(*s.AlgorithmName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AlgorithmName", 1)) + if s.MaxPercentageOfInputDatasetLabeled != nil && *s.MaxPercentageOfInputDatasetLabeled < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxPercentageOfInputDatasetLabeled", 1)) } if invalidParams.Len() > 0 { @@ -11929,165 +30929,204 @@ func (s *DescribeAlgorithmInput) Validate() error { return nil } -// SetAlgorithmName sets the AlgorithmName field's value. -func (s *DescribeAlgorithmInput) SetAlgorithmName(v string) *DescribeAlgorithmInput { - s.AlgorithmName = &v +// SetMaxHumanLabeledObjectCount sets the MaxHumanLabeledObjectCount field's value. +func (s *LabelingJobStoppingConditions) SetMaxHumanLabeledObjectCount(v int64) *LabelingJobStoppingConditions { + s.MaxHumanLabeledObjectCount = &v return s } -type DescribeAlgorithmOutput struct { +// SetMaxPercentageOfInputDatasetLabeled sets the MaxPercentageOfInputDatasetLabeled field's value. +func (s *LabelingJobStoppingConditions) SetMaxPercentageOfInputDatasetLabeled(v int64) *LabelingJobStoppingConditions { + s.MaxPercentageOfInputDatasetLabeled = &v + return s +} + +// Provides summary information about a labeling job. +type LabelingJobSummary struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the algorithm. + // The Amazon Resource Name (ARN) of the Lambda function used to consolidate + // the annotations from individual workers into a label for a data object. For + // more information, see Annotation Consolidation (https://docs.aws.amazon.com/sagemaker/latest/dg/sms-annotation-consolidation.html). + AnnotationConsolidationLambdaArn *string `type:"string"` + + // The date and time that the job was created (timestamp). // - // AlgorithmArn is a required field - AlgorithmArn *string `min:"1" type:"string" required:"true"` + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` - // A brief summary about the algorithm. - AlgorithmDescription *string `type:"string"` + // If the LabelingJobStatus field is Failed, this field contains a description + // of the error. + FailureReason *string `type:"string"` - // The name of the algorithm being described. + // Input configuration for the labeling job. + InputConfig *LabelingJobInputConfig `type:"structure"` + + // Counts showing the progress of the labeling job. // - // AlgorithmName is a required field - AlgorithmName *string `min:"1" type:"string" required:"true"` + // LabelCounters is a required field + LabelCounters *LabelCounters `type:"structure" required:"true"` - // The current status of the algorithm. + // The Amazon Resource Name (ARN) assigned to the labeling job when it was created. // - // AlgorithmStatus is a required field - AlgorithmStatus *string `type:"string" required:"true" enum:"AlgorithmStatus"` + // LabelingJobArn is a required field + LabelingJobArn *string `type:"string" required:"true"` - // Details about the current status of the algorithm. + // The name of the labeling job. // - // AlgorithmStatusDetails is a required field - AlgorithmStatusDetails *AlgorithmStatusDetails `type:"structure" required:"true"` + // LabelingJobName is a required field + LabelingJobName *string `min:"1" type:"string" required:"true"` - // Whether the algorithm is certified to be listed in AWS Marketplace. - CertifyForMarketplace *bool `type:"boolean"` + // The location of the output produced by the labeling job. + LabelingJobOutput *LabelingJobOutput `type:"structure"` - // A timestamp specifying when the algorithm was created. + // The current status of the labeling job. // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` - - // Details about inference jobs that the algorithm runs. - InferenceSpecification *InferenceSpecification `type:"structure"` + // LabelingJobStatus is a required field + LabelingJobStatus *string `type:"string" required:"true" enum:"LabelingJobStatus"` - // The product identifier of the algorithm. - ProductId *string `type:"string"` + // The date and time that the job was last modified (timestamp). + // + // LastModifiedTime is a required field + LastModifiedTime *time.Time `type:"timestamp" required:"true"` - // Details about training jobs run by this algorithm. + // The Amazon Resource Name (ARN) of a Lambda function. The function is run + // before each data object is sent to a worker. // - // TrainingSpecification is a required field - TrainingSpecification *TrainingSpecification `type:"structure" required:"true"` + // PreHumanTaskLambdaArn is a required field + PreHumanTaskLambdaArn *string `type:"string" required:"true"` - // Details about configurations for one or more training jobs that Amazon SageMaker - // runs to test the algorithm. - ValidationSpecification *AlgorithmValidationSpecification `type:"structure"` + // The Amazon Resource Name (ARN) of the work team assigned to the job. + // + // WorkteamArn is a required field + WorkteamArn *string `type:"string" required:"true"` } // String returns the string representation -func (s DescribeAlgorithmOutput) String() string { +func (s LabelingJobSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAlgorithmOutput) GoString() string { +func (s LabelingJobSummary) GoString() string { return s.String() } -// SetAlgorithmArn sets the AlgorithmArn field's value. -func (s *DescribeAlgorithmOutput) SetAlgorithmArn(v string) *DescribeAlgorithmOutput { - s.AlgorithmArn = &v +// SetAnnotationConsolidationLambdaArn sets the AnnotationConsolidationLambdaArn field's value. +func (s *LabelingJobSummary) SetAnnotationConsolidationLambdaArn(v string) *LabelingJobSummary { + s.AnnotationConsolidationLambdaArn = &v return s } -// SetAlgorithmDescription sets the AlgorithmDescription field's value. -func (s *DescribeAlgorithmOutput) SetAlgorithmDescription(v string) *DescribeAlgorithmOutput { - s.AlgorithmDescription = &v +// SetCreationTime sets the CreationTime field's value. +func (s *LabelingJobSummary) SetCreationTime(v time.Time) *LabelingJobSummary { + s.CreationTime = &v return s } -// SetAlgorithmName sets the AlgorithmName field's value. -func (s *DescribeAlgorithmOutput) SetAlgorithmName(v string) *DescribeAlgorithmOutput { - s.AlgorithmName = &v +// SetFailureReason sets the FailureReason field's value. +func (s *LabelingJobSummary) SetFailureReason(v string) *LabelingJobSummary { + s.FailureReason = &v return s } -// SetAlgorithmStatus sets the AlgorithmStatus field's value. -func (s *DescribeAlgorithmOutput) SetAlgorithmStatus(v string) *DescribeAlgorithmOutput { - s.AlgorithmStatus = &v +// SetInputConfig sets the InputConfig field's value. +func (s *LabelingJobSummary) SetInputConfig(v *LabelingJobInputConfig) *LabelingJobSummary { + s.InputConfig = v return s } -// SetAlgorithmStatusDetails sets the AlgorithmStatusDetails field's value. -func (s *DescribeAlgorithmOutput) SetAlgorithmStatusDetails(v *AlgorithmStatusDetails) *DescribeAlgorithmOutput { - s.AlgorithmStatusDetails = v +// SetLabelCounters sets the LabelCounters field's value. +func (s *LabelingJobSummary) SetLabelCounters(v *LabelCounters) *LabelingJobSummary { + s.LabelCounters = v return s } -// SetCertifyForMarketplace sets the CertifyForMarketplace field's value. -func (s *DescribeAlgorithmOutput) SetCertifyForMarketplace(v bool) *DescribeAlgorithmOutput { - s.CertifyForMarketplace = &v +// SetLabelingJobArn sets the LabelingJobArn field's value. +func (s *LabelingJobSummary) SetLabelingJobArn(v string) *LabelingJobSummary { + s.LabelingJobArn = &v return s } -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeAlgorithmOutput) SetCreationTime(v time.Time) *DescribeAlgorithmOutput { - s.CreationTime = &v +// SetLabelingJobName sets the LabelingJobName field's value. +func (s *LabelingJobSummary) SetLabelingJobName(v string) *LabelingJobSummary { + s.LabelingJobName = &v return s } -// SetInferenceSpecification sets the InferenceSpecification field's value. -func (s *DescribeAlgorithmOutput) SetInferenceSpecification(v *InferenceSpecification) *DescribeAlgorithmOutput { - s.InferenceSpecification = v +// SetLabelingJobOutput sets the LabelingJobOutput field's value. +func (s *LabelingJobSummary) SetLabelingJobOutput(v *LabelingJobOutput) *LabelingJobSummary { + s.LabelingJobOutput = v return s } -// SetProductId sets the ProductId field's value. -func (s *DescribeAlgorithmOutput) SetProductId(v string) *DescribeAlgorithmOutput { - s.ProductId = &v +// SetLabelingJobStatus sets the LabelingJobStatus field's value. +func (s *LabelingJobSummary) SetLabelingJobStatus(v string) *LabelingJobSummary { + s.LabelingJobStatus = &v return s } -// SetTrainingSpecification sets the TrainingSpecification field's value. -func (s *DescribeAlgorithmOutput) SetTrainingSpecification(v *TrainingSpecification) *DescribeAlgorithmOutput { - s.TrainingSpecification = v +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *LabelingJobSummary) SetLastModifiedTime(v time.Time) *LabelingJobSummary { + s.LastModifiedTime = &v return s } -// SetValidationSpecification sets the ValidationSpecification field's value. -func (s *DescribeAlgorithmOutput) SetValidationSpecification(v *AlgorithmValidationSpecification) *DescribeAlgorithmOutput { - s.ValidationSpecification = v +// SetPreHumanTaskLambdaArn sets the PreHumanTaskLambdaArn field's value. +func (s *LabelingJobSummary) SetPreHumanTaskLambdaArn(v string) *LabelingJobSummary { + s.PreHumanTaskLambdaArn = &v return s } -type DescribeCodeRepositoryInput struct { +// SetWorkteamArn sets the WorkteamArn field's value. +func (s *LabelingJobSummary) SetWorkteamArn(v string) *LabelingJobSummary { + s.WorkteamArn = &v + return s +} + +type ListAlgorithmsInput struct { _ struct{} `type:"structure"` - // The name of the Git repository to describe. - // - // CodeRepositoryName is a required field - CodeRepositoryName *string `min:"1" type:"string" required:"true"` + // A filter that returns only algorithms created after the specified time (timestamp). + CreationTimeAfter *time.Time `type:"timestamp"` + + // A filter that returns only algorithms created before the specified time (timestamp). + CreationTimeBefore *time.Time `type:"timestamp"` + + // The maximum number of algorithms to return in the response. + MaxResults *int64 `min:"1" type:"integer"` + + // A string in the algorithm name. This filter returns only algorithms whose + // name contains the specified string. + NameContains *string `type:"string"` + + // If the response to a previous ListAlgorithms request was truncated, the response + // includes a NextToken. To retrieve the next set of algorithms, use the token + // in the next request. + NextToken *string `type:"string"` + + // The parameter by which to sort the results. The default is CreationTime. + SortBy *string `type:"string" enum:"AlgorithmSortBy"` + + // The sort order for the results. The default is Ascending. + SortOrder *string `type:"string" enum:"SortOrder"` } // String returns the string representation -func (s DescribeCodeRepositoryInput) String() string { +func (s ListAlgorithmsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeCodeRepositoryInput) GoString() string { +func (s ListAlgorithmsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeCodeRepositoryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeCodeRepositoryInput"} - if s.CodeRepositoryName == nil { - invalidParams.Add(request.NewErrParamRequired("CodeRepositoryName")) - } - if s.CodeRepositoryName != nil && len(*s.CodeRepositoryName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CodeRepositoryName", 1)) +func (s *ListAlgorithmsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAlgorithmsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -12096,316 +31135,248 @@ func (s *DescribeCodeRepositoryInput) Validate() error { return nil } -// SetCodeRepositoryName sets the CodeRepositoryName field's value. -func (s *DescribeCodeRepositoryInput) SetCodeRepositoryName(v string) *DescribeCodeRepositoryInput { - s.CodeRepositoryName = &v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListAlgorithmsInput) SetCreationTimeAfter(v time.Time) *ListAlgorithmsInput { + s.CreationTimeAfter = &v return s } -type DescribeCodeRepositoryOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Git repository. - // - // CodeRepositoryArn is a required field - CodeRepositoryArn *string `min:"1" type:"string" required:"true"` - - // The name of the Git repository. - // - // CodeRepositoryName is a required field - CodeRepositoryName *string `min:"1" type:"string" required:"true"` - - // The date and time that the repository was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` - - // Configuration details about the repository, including the URL where the repository - // is located, the default branch, and the Amazon Resource Name (ARN) of the - // AWS Secrets Manager secret that contains the credentials used to access the - // repository. - GitConfig *GitConfig `type:"structure"` - - // The date and time that the repository was last changed. - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `type:"timestamp" required:"true"` -} - -// String returns the string representation -func (s DescribeCodeRepositoryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCodeRepositoryOutput) GoString() string { - return s.String() -} - -// SetCodeRepositoryArn sets the CodeRepositoryArn field's value. -func (s *DescribeCodeRepositoryOutput) SetCodeRepositoryArn(v string) *DescribeCodeRepositoryOutput { - s.CodeRepositoryArn = &v +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListAlgorithmsInput) SetCreationTimeBefore(v time.Time) *ListAlgorithmsInput { + s.CreationTimeBefore = &v return s } -// SetCodeRepositoryName sets the CodeRepositoryName field's value. -func (s *DescribeCodeRepositoryOutput) SetCodeRepositoryName(v string) *DescribeCodeRepositoryOutput { - s.CodeRepositoryName = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListAlgorithmsInput) SetMaxResults(v int64) *ListAlgorithmsInput { + s.MaxResults = &v return s } -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeCodeRepositoryOutput) SetCreationTime(v time.Time) *DescribeCodeRepositoryOutput { - s.CreationTime = &v +// SetNameContains sets the NameContains field's value. +func (s *ListAlgorithmsInput) SetNameContains(v string) *ListAlgorithmsInput { + s.NameContains = &v return s } -// SetGitConfig sets the GitConfig field's value. -func (s *DescribeCodeRepositoryOutput) SetGitConfig(v *GitConfig) *DescribeCodeRepositoryOutput { - s.GitConfig = v +// SetNextToken sets the NextToken field's value. +func (s *ListAlgorithmsInput) SetNextToken(v string) *ListAlgorithmsInput { + s.NextToken = &v return s } -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *DescribeCodeRepositoryOutput) SetLastModifiedTime(v time.Time) *DescribeCodeRepositoryOutput { - s.LastModifiedTime = &v +// SetSortBy sets the SortBy field's value. +func (s *ListAlgorithmsInput) SetSortBy(v string) *ListAlgorithmsInput { + s.SortBy = &v return s } -type DescribeCompilationJobInput struct { - _ struct{} `type:"structure"` - - // The name of the model compilation job that you want information about. - // - // CompilationJobName is a required field - CompilationJobName *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation -func (s DescribeCompilationJobInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeCompilationJobInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeCompilationJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeCompilationJobInput"} - if s.CompilationJobName == nil { - invalidParams.Add(request.NewErrParamRequired("CompilationJobName")) - } - if s.CompilationJobName != nil && len(*s.CompilationJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CompilationJobName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCompilationJobName sets the CompilationJobName field's value. -func (s *DescribeCompilationJobInput) SetCompilationJobName(v string) *DescribeCompilationJobInput { - s.CompilationJobName = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListAlgorithmsInput) SetSortOrder(v string) *ListAlgorithmsInput { + s.SortOrder = &v return s } -type DescribeCompilationJobOutput struct { +type ListAlgorithmsOutput struct { _ struct{} `type:"structure"` - // The time when the model compilation job on a compilation job instance ended. - // For a successful or stopped job, this is when the job's model artifacts have - // finished uploading. For a failed job, this is when Amazon SageMaker detected - // that the job failed. - CompilationEndTime *time.Time `type:"timestamp"` - - // The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker assumes - // to perform the model compilation job. + // >An array of AlgorithmSummary objects, each of which lists an algorithm. // - // CompilationJobArn is a required field - CompilationJobArn *string `type:"string" required:"true"` + // AlgorithmSummaryList is a required field + AlgorithmSummaryList []*AlgorithmSummary `type:"list" required:"true"` - // The name of the model compilation job. - // - // CompilationJobName is a required field - CompilationJobName *string `min:"1" type:"string" required:"true"` + // If the response is truncated, Amazon SageMaker returns this token. To retrieve + // the next set of algorithms, use it in the subsequent request. + NextToken *string `type:"string"` +} - // The status of the model compilation job. - // - // CompilationJobStatus is a required field - CompilationJobStatus *string `type:"string" required:"true" enum:"CompilationJobStatus"` +// String returns the string representation +func (s ListAlgorithmsOutput) String() string { + return awsutil.Prettify(s) +} - // The time when the model compilation job started the CompilationJob instances. - // - // You are billed for the time between this timestamp and the timestamp in the - // DescribeCompilationJobResponse$CompilationEndTime field. In Amazon CloudWatch - // Logs, the start time might be later than this time. That's because it takes - // time to download the compilation job, which depends on the size of the compilation - // job container. - CompilationStartTime *time.Time `type:"timestamp"` +// GoString returns the string representation +func (s ListAlgorithmsOutput) GoString() string { + return s.String() +} - // The time that the model compilation job was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` +// SetAlgorithmSummaryList sets the AlgorithmSummaryList field's value. +func (s *ListAlgorithmsOutput) SetAlgorithmSummaryList(v []*AlgorithmSummary) *ListAlgorithmsOutput { + s.AlgorithmSummaryList = v + return s +} - // If a model compilation job failed, the reason it failed. - // - // FailureReason is a required field - FailureReason *string `type:"string" required:"true"` +// SetNextToken sets the NextToken field's value. +func (s *ListAlgorithmsOutput) SetNextToken(v string) *ListAlgorithmsOutput { + s.NextToken = &v + return s +} - // Information about the location in Amazon S3 of the input model artifacts, - // the name and shape of the expected data inputs, and the framework in which - // the model was trained. - // - // InputConfig is a required field - InputConfig *InputConfig `type:"structure" required:"true"` +type ListAppsInput struct { + _ struct{} `type:"structure"` - // The time that the status of the model compilation job was last modified. - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `type:"timestamp" required:"true"` + // A parameter to search for the domain ID. + DomainIdEquals *string `type:"string"` - // Information about the location in Amazon S3 that has been configured for - // storing the model artifacts used in the compilation job. - // - // ModelArtifacts is a required field - ModelArtifacts *ModelArtifacts `type:"structure" required:"true"` + // Returns a list up to a specified limit. + MaxResults *int64 `min:"1" type:"integer"` - // Information about the output location for the compiled model and the target - // device that the model runs on. - // - // OutputConfig is a required field - OutputConfig *OutputConfig `type:"structure" required:"true"` + // If the previous response was truncated, you will receive this token. Use + // it in your next request to receive the next set of results. + NextToken *string `type:"string"` - // The Amazon Resource Name (ARN) of the model compilation job. - // - // RoleArn is a required field - RoleArn *string `min:"20" type:"string" required:"true"` + // The parameter by which to sort the results. The default is CreationTime. + SortBy *string `type:"string" enum:"AppSortKey"` - // Specifies a limit to how long a model compilation job can run. When the job - // reaches the time limit, Amazon SageMaker ends the compilation job. Use this - // API to cap model training costs. - // - // StoppingCondition is a required field - StoppingCondition *StoppingCondition `type:"structure" required:"true"` + // The sort order for the results. The default is Ascending. + SortOrder *string `type:"string" enum:"SortOrder"` + + // A parameter to search by user profile name. + UserProfileNameEquals *string `type:"string"` } // String returns the string representation -func (s DescribeCompilationJobOutput) String() string { +func (s ListAppsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeCompilationJobOutput) GoString() string { +func (s ListAppsInput) GoString() string { return s.String() } -// SetCompilationEndTime sets the CompilationEndTime field's value. -func (s *DescribeCompilationJobOutput) SetCompilationEndTime(v time.Time) *DescribeCompilationJobOutput { - s.CompilationEndTime = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListAppsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAppsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } -// SetCompilationJobArn sets the CompilationJobArn field's value. -func (s *DescribeCompilationJobOutput) SetCompilationJobArn(v string) *DescribeCompilationJobOutput { - s.CompilationJobArn = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetCompilationJobName sets the CompilationJobName field's value. -func (s *DescribeCompilationJobOutput) SetCompilationJobName(v string) *DescribeCompilationJobOutput { - s.CompilationJobName = &v +// SetDomainIdEquals sets the DomainIdEquals field's value. +func (s *ListAppsInput) SetDomainIdEquals(v string) *ListAppsInput { + s.DomainIdEquals = &v return s } -// SetCompilationJobStatus sets the CompilationJobStatus field's value. -func (s *DescribeCompilationJobOutput) SetCompilationJobStatus(v string) *DescribeCompilationJobOutput { - s.CompilationJobStatus = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListAppsInput) SetMaxResults(v int64) *ListAppsInput { + s.MaxResults = &v return s } -// SetCompilationStartTime sets the CompilationStartTime field's value. -func (s *DescribeCompilationJobOutput) SetCompilationStartTime(v time.Time) *DescribeCompilationJobOutput { - s.CompilationStartTime = &v +// SetNextToken sets the NextToken field's value. +func (s *ListAppsInput) SetNextToken(v string) *ListAppsInput { + s.NextToken = &v return s } -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeCompilationJobOutput) SetCreationTime(v time.Time) *DescribeCompilationJobOutput { - s.CreationTime = &v +// SetSortBy sets the SortBy field's value. +func (s *ListAppsInput) SetSortBy(v string) *ListAppsInput { + s.SortBy = &v return s } -// SetFailureReason sets the FailureReason field's value. -func (s *DescribeCompilationJobOutput) SetFailureReason(v string) *DescribeCompilationJobOutput { - s.FailureReason = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListAppsInput) SetSortOrder(v string) *ListAppsInput { + s.SortOrder = &v return s } -// SetInputConfig sets the InputConfig field's value. -func (s *DescribeCompilationJobOutput) SetInputConfig(v *InputConfig) *DescribeCompilationJobOutput { - s.InputConfig = v +// SetUserProfileNameEquals sets the UserProfileNameEquals field's value. +func (s *ListAppsInput) SetUserProfileNameEquals(v string) *ListAppsInput { + s.UserProfileNameEquals = &v return s } -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *DescribeCompilationJobOutput) SetLastModifiedTime(v time.Time) *DescribeCompilationJobOutput { - s.LastModifiedTime = &v - return s +type ListAppsOutput struct { + _ struct{} `type:"structure"` + + // The list of apps. + Apps []*AppDetails `type:"list"` + + // If the previous response was truncated, you will receive this token. Use + // it in your next request to receive the next set of results. + NextToken *string `type:"string"` } -// SetModelArtifacts sets the ModelArtifacts field's value. -func (s *DescribeCompilationJobOutput) SetModelArtifacts(v *ModelArtifacts) *DescribeCompilationJobOutput { - s.ModelArtifacts = v - return s +// String returns the string representation +func (s ListAppsOutput) String() string { + return awsutil.Prettify(s) } -// SetOutputConfig sets the OutputConfig field's value. -func (s *DescribeCompilationJobOutput) SetOutputConfig(v *OutputConfig) *DescribeCompilationJobOutput { - s.OutputConfig = v - return s +// GoString returns the string representation +func (s ListAppsOutput) GoString() string { + return s.String() } -// SetRoleArn sets the RoleArn field's value. -func (s *DescribeCompilationJobOutput) SetRoleArn(v string) *DescribeCompilationJobOutput { - s.RoleArn = &v +// SetApps sets the Apps field's value. +func (s *ListAppsOutput) SetApps(v []*AppDetails) *ListAppsOutput { + s.Apps = v return s } -// SetStoppingCondition sets the StoppingCondition field's value. -func (s *DescribeCompilationJobOutput) SetStoppingCondition(v *StoppingCondition) *DescribeCompilationJobOutput { - s.StoppingCondition = v +// SetNextToken sets the NextToken field's value. +func (s *ListAppsOutput) SetNextToken(v string) *ListAppsOutput { + s.NextToken = &v return s } -type DescribeEndpointConfigInput struct { +type ListAutoMLJobsInput struct { _ struct{} `type:"structure"` - // The name of the endpoint configuration. - // - // EndpointConfigName is a required field - EndpointConfigName *string `type:"string" required:"true"` + // Request a list of jobs, using a filter for time. + CreationTimeAfter *time.Time `type:"timestamp"` + + // Request a list of jobs, using a filter for time. + CreationTimeBefore *time.Time `type:"timestamp"` + + // Request a list of jobs, using a filter for time. + LastModifiedTimeAfter *time.Time `type:"timestamp"` + + // Request a list of jobs, using a filter for time. + LastModifiedTimeBefore *time.Time `type:"timestamp"` + + // Request a list of jobs up to a specified limit. + MaxResults *int64 `min:"1" type:"integer"` + + // Request a list of jobs, using a search filter for name. + NameContains *string `type:"string"` + + // If the previous response was truncated, you will receive this token. Use + // it in your next request to receive the next set of results. + NextToken *string `type:"string"` + + // The parameter by which to sort the results. The default is AutoMLJobName. + SortBy *string `type:"string" enum:"AutoMLSortBy"` + + // The sort order for the results. The default is Descending. + SortOrder *string `type:"string" enum:"AutoMLSortOrder"` + + // Request a list of jobs, using a filter for status. + StatusEquals *string `type:"string" enum:"AutoMLJobStatus"` } // String returns the string representation -func (s DescribeEndpointConfigInput) String() string { +func (s ListAutoMLJobsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeEndpointConfigInput) GoString() string { +func (s ListAutoMLJobsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEndpointConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEndpointConfigInput"} - if s.EndpointConfigName == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointConfigName")) +func (s *ListAutoMLJobsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAutoMLJobsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -12414,759 +31385,590 @@ func (s *DescribeEndpointConfigInput) Validate() error { return nil } -// SetEndpointConfigName sets the EndpointConfigName field's value. -func (s *DescribeEndpointConfigInput) SetEndpointConfigName(v string) *DescribeEndpointConfigInput { - s.EndpointConfigName = &v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListAutoMLJobsInput) SetCreationTimeAfter(v time.Time) *ListAutoMLJobsInput { + s.CreationTimeAfter = &v return s } -type DescribeEndpointConfigOutput struct { - _ struct{} `type:"structure"` - - // A timestamp that shows when the endpoint configuration was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` - - // The Amazon Resource Name (ARN) of the endpoint configuration. - // - // EndpointConfigArn is a required field - EndpointConfigArn *string `min:"20" type:"string" required:"true"` - - // Name of the Amazon SageMaker endpoint configuration. - // - // EndpointConfigName is a required field - EndpointConfigName *string `type:"string" required:"true"` - - // AWS KMS key ID Amazon SageMaker uses to encrypt data when storing it on the - // ML storage volume attached to the instance. - KmsKeyId *string `type:"string"` +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListAutoMLJobsInput) SetCreationTimeBefore(v time.Time) *ListAutoMLJobsInput { + s.CreationTimeBefore = &v + return s +} - // An array of ProductionVariant objects, one for each model that you want to - // host at this endpoint. - // - // ProductionVariants is a required field - ProductionVariants []*ProductionVariant `min:"1" type:"list" required:"true"` +// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. +func (s *ListAutoMLJobsInput) SetLastModifiedTimeAfter(v time.Time) *ListAutoMLJobsInput { + s.LastModifiedTimeAfter = &v + return s } -// String returns the string representation -func (s DescribeEndpointConfigOutput) String() string { - return awsutil.Prettify(s) +// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. +func (s *ListAutoMLJobsInput) SetLastModifiedTimeBefore(v time.Time) *ListAutoMLJobsInput { + s.LastModifiedTimeBefore = &v + return s } -// GoString returns the string representation -func (s DescribeEndpointConfigOutput) GoString() string { - return s.String() +// SetMaxResults sets the MaxResults field's value. +func (s *ListAutoMLJobsInput) SetMaxResults(v int64) *ListAutoMLJobsInput { + s.MaxResults = &v + return s } -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeEndpointConfigOutput) SetCreationTime(v time.Time) *DescribeEndpointConfigOutput { - s.CreationTime = &v +// SetNameContains sets the NameContains field's value. +func (s *ListAutoMLJobsInput) SetNameContains(v string) *ListAutoMLJobsInput { + s.NameContains = &v return s } -// SetEndpointConfigArn sets the EndpointConfigArn field's value. -func (s *DescribeEndpointConfigOutput) SetEndpointConfigArn(v string) *DescribeEndpointConfigOutput { - s.EndpointConfigArn = &v +// SetNextToken sets the NextToken field's value. +func (s *ListAutoMLJobsInput) SetNextToken(v string) *ListAutoMLJobsInput { + s.NextToken = &v return s } -// SetEndpointConfigName sets the EndpointConfigName field's value. -func (s *DescribeEndpointConfigOutput) SetEndpointConfigName(v string) *DescribeEndpointConfigOutput { - s.EndpointConfigName = &v +// SetSortBy sets the SortBy field's value. +func (s *ListAutoMLJobsInput) SetSortBy(v string) *ListAutoMLJobsInput { + s.SortBy = &v return s } -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *DescribeEndpointConfigOutput) SetKmsKeyId(v string) *DescribeEndpointConfigOutput { - s.KmsKeyId = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListAutoMLJobsInput) SetSortOrder(v string) *ListAutoMLJobsInput { + s.SortOrder = &v return s } -// SetProductionVariants sets the ProductionVariants field's value. -func (s *DescribeEndpointConfigOutput) SetProductionVariants(v []*ProductionVariant) *DescribeEndpointConfigOutput { - s.ProductionVariants = v +// SetStatusEquals sets the StatusEquals field's value. +func (s *ListAutoMLJobsInput) SetStatusEquals(v string) *ListAutoMLJobsInput { + s.StatusEquals = &v return s } -type DescribeEndpointInput struct { +type ListAutoMLJobsOutput struct { _ struct{} `type:"structure"` - // The name of the endpoint. + // Returns a summary list of jobs. // - // EndpointName is a required field - EndpointName *string `type:"string" required:"true"` + // AutoMLJobSummaries is a required field + AutoMLJobSummaries []*AutoMLJobSummary `type:"list" required:"true"` + + // If the previous response was truncated, you will receive this token. Use + // it in your next request to receive the next set of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeEndpointInput) String() string { +func (s ListAutoMLJobsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeEndpointInput) GoString() string { +func (s ListAutoMLJobsOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEndpointInput"} - if s.EndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetAutoMLJobSummaries sets the AutoMLJobSummaries field's value. +func (s *ListAutoMLJobsOutput) SetAutoMLJobSummaries(v []*AutoMLJobSummary) *ListAutoMLJobsOutput { + s.AutoMLJobSummaries = v + return s } -// SetEndpointName sets the EndpointName field's value. -func (s *DescribeEndpointInput) SetEndpointName(v string) *DescribeEndpointInput { - s.EndpointName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListAutoMLJobsOutput) SetNextToken(v string) *ListAutoMLJobsOutput { + s.NextToken = &v return s } -type DescribeEndpointOutput struct { +type ListCandidatesForAutoMLJobInput struct { _ struct{} `type:"structure"` - // A timestamp that shows when the endpoint was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` - - // The Amazon Resource Name (ARN) of the endpoint. + // List the Candidates created for the job by providing the job's name. // - // EndpointArn is a required field - EndpointArn *string `min:"20" type:"string" required:"true"` + // AutoMLJobName is a required field + AutoMLJobName *string `min:"1" type:"string" required:"true"` - // The name of the endpoint configuration associated with this endpoint. - // - // EndpointConfigName is a required field - EndpointConfigName *string `type:"string" required:"true"` + // List the Candidates for the job and filter by candidate name. + CandidateNameEquals *string `min:"1" type:"string"` - // Name of the endpoint. - // - // EndpointName is a required field - EndpointName *string `type:"string" required:"true"` + // List the job's Candidates up to a specified limit. + MaxResults *int64 `min:"1" type:"integer"` - // The status of the endpoint. - // - // * OutOfService: Endpoint is not available to take incoming requests. - // - // * Creating: CreateEndpoint is executing. - // - // * Updating: UpdateEndpoint or UpdateEndpointWeightsAndCapacities is executing. - // - // * SystemUpdating: Endpoint is undergoing maintenance and cannot be updated - // or deleted or re-scaled until it has completed. This maintenance operation - // does not change any customer-specified values such as VPC config, KMS - // encryption, model, instance type, or instance count. - // - // * RollingBack: Endpoint fails to scale up or down or change its variant - // weight and is in the process of rolling back to its previous configuration. - // Once the rollback completes, endpoint returns to an InService status. - // This transitional status only applies to an endpoint that has autoscaling - // enabled and is undergoing variant weight or capacity changes as part of - // an UpdateEndpointWeightsAndCapacities call or when the UpdateEndpointWeightsAndCapacities - // operation is called explicitly. - // - // * InService: Endpoint is available to process incoming requests. - // - // * Deleting: DeleteEndpoint is executing. - // - // * Failed: Endpoint could not be created, updated, or re-scaled. Use DescribeEndpointOutput$FailureReason - // for information about the failure. DeleteEndpoint is the only operation - // that can be performed on a failed endpoint. - // - // EndpointStatus is a required field - EndpointStatus *string `type:"string" required:"true" enum:"EndpointStatus"` + // If the previous response was truncated, you will receive this token. Use + // it in your next request to receive the next set of results. + NextToken *string `type:"string"` - // If the status of the endpoint is Failed, the reason why it failed. - FailureReason *string `type:"string"` + // The parameter by which to sort the results. The default is Descending. + SortBy *string `type:"string" enum:"CandidateSortBy"` - // A timestamp that shows when the endpoint was last modified. - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `type:"timestamp" required:"true"` + // The sort order for the results. The default is Ascending. + SortOrder *string `type:"string" enum:"AutoMLSortOrder"` - // An array of ProductionVariantSummary objects, one for each model hosted behind - // this endpoint. - ProductionVariants []*ProductionVariantSummary `min:"1" type:"list"` + // List the Candidates for the job and filter by status. + StatusEquals *string `type:"string" enum:"CandidateStatus"` } // String returns the string representation -func (s DescribeEndpointOutput) String() string { +func (s ListCandidatesForAutoMLJobInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeEndpointOutput) GoString() string { +func (s ListCandidatesForAutoMLJobInput) GoString() string { return s.String() } -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeEndpointOutput) SetCreationTime(v time.Time) *DescribeEndpointOutput { - s.CreationTime = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListCandidatesForAutoMLJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListCandidatesForAutoMLJobInput"} + if s.AutoMLJobName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoMLJobName")) + } + if s.AutoMLJobName != nil && len(*s.AutoMLJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoMLJobName", 1)) + } + if s.CandidateNameEquals != nil && len(*s.CandidateNameEquals) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CandidateNameEquals", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetEndpointArn sets the EndpointArn field's value. -func (s *DescribeEndpointOutput) SetEndpointArn(v string) *DescribeEndpointOutput { - s.EndpointArn = &v +// SetAutoMLJobName sets the AutoMLJobName field's value. +func (s *ListCandidatesForAutoMLJobInput) SetAutoMLJobName(v string) *ListCandidatesForAutoMLJobInput { + s.AutoMLJobName = &v return s } -// SetEndpointConfigName sets the EndpointConfigName field's value. -func (s *DescribeEndpointOutput) SetEndpointConfigName(v string) *DescribeEndpointOutput { - s.EndpointConfigName = &v +// SetCandidateNameEquals sets the CandidateNameEquals field's value. +func (s *ListCandidatesForAutoMLJobInput) SetCandidateNameEquals(v string) *ListCandidatesForAutoMLJobInput { + s.CandidateNameEquals = &v return s } -// SetEndpointName sets the EndpointName field's value. -func (s *DescribeEndpointOutput) SetEndpointName(v string) *DescribeEndpointOutput { - s.EndpointName = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListCandidatesForAutoMLJobInput) SetMaxResults(v int64) *ListCandidatesForAutoMLJobInput { + s.MaxResults = &v return s } -// SetEndpointStatus sets the EndpointStatus field's value. -func (s *DescribeEndpointOutput) SetEndpointStatus(v string) *DescribeEndpointOutput { - s.EndpointStatus = &v +// SetNextToken sets the NextToken field's value. +func (s *ListCandidatesForAutoMLJobInput) SetNextToken(v string) *ListCandidatesForAutoMLJobInput { + s.NextToken = &v return s } -// SetFailureReason sets the FailureReason field's value. -func (s *DescribeEndpointOutput) SetFailureReason(v string) *DescribeEndpointOutput { - s.FailureReason = &v +// SetSortBy sets the SortBy field's value. +func (s *ListCandidatesForAutoMLJobInput) SetSortBy(v string) *ListCandidatesForAutoMLJobInput { + s.SortBy = &v return s } -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *DescribeEndpointOutput) SetLastModifiedTime(v time.Time) *DescribeEndpointOutput { - s.LastModifiedTime = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListCandidatesForAutoMLJobInput) SetSortOrder(v string) *ListCandidatesForAutoMLJobInput { + s.SortOrder = &v return s } -// SetProductionVariants sets the ProductionVariants field's value. -func (s *DescribeEndpointOutput) SetProductionVariants(v []*ProductionVariantSummary) *DescribeEndpointOutput { - s.ProductionVariants = v +// SetStatusEquals sets the StatusEquals field's value. +func (s *ListCandidatesForAutoMLJobInput) SetStatusEquals(v string) *ListCandidatesForAutoMLJobInput { + s.StatusEquals = &v return s } -type DescribeHyperParameterTuningJobInput struct { +type ListCandidatesForAutoMLJobOutput struct { _ struct{} `type:"structure"` - // The name of the tuning job to describe. + // Summaries about the Candidates. // - // HyperParameterTuningJobName is a required field - HyperParameterTuningJobName *string `min:"1" type:"string" required:"true"` + // Candidates is a required field + Candidates []*AutoMLCandidate `type:"list" required:"true"` + + // If the previous response was truncated, you will receive this token. Use + // it in your next request to receive the next set of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeHyperParameterTuningJobInput) String() string { +func (s ListCandidatesForAutoMLJobOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeHyperParameterTuningJobInput) GoString() string { +func (s ListCandidatesForAutoMLJobOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeHyperParameterTuningJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeHyperParameterTuningJobInput"} - if s.HyperParameterTuningJobName == nil { - invalidParams.Add(request.NewErrParamRequired("HyperParameterTuningJobName")) - } - if s.HyperParameterTuningJobName != nil && len(*s.HyperParameterTuningJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("HyperParameterTuningJobName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCandidates sets the Candidates field's value. +func (s *ListCandidatesForAutoMLJobOutput) SetCandidates(v []*AutoMLCandidate) *ListCandidatesForAutoMLJobOutput { + s.Candidates = v + return s } -// SetHyperParameterTuningJobName sets the HyperParameterTuningJobName field's value. -func (s *DescribeHyperParameterTuningJobInput) SetHyperParameterTuningJobName(v string) *DescribeHyperParameterTuningJobInput { - s.HyperParameterTuningJobName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListCandidatesForAutoMLJobOutput) SetNextToken(v string) *ListCandidatesForAutoMLJobOutput { + s.NextToken = &v return s } -type DescribeHyperParameterTuningJobOutput struct { +type ListCodeRepositoriesInput struct { _ struct{} `type:"structure"` - // A TrainingJobSummary object that describes the training job that completed - // with the best current HyperParameterTuningJobObjective. - BestTrainingJob *HyperParameterTrainingJobSummary `type:"structure"` - - // The date and time that the tuning job started. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` - - // If the tuning job failed, the reason it failed. - FailureReason *string `type:"string"` - - // The date and time that the tuning job ended. - HyperParameterTuningEndTime *time.Time `type:"timestamp"` - - // The Amazon Resource Name (ARN) of the tuning job. - // - // HyperParameterTuningJobArn is a required field - HyperParameterTuningJobArn *string `type:"string" required:"true"` - - // The HyperParameterTuningJobConfig object that specifies the configuration - // of the tuning job. - // - // HyperParameterTuningJobConfig is a required field - HyperParameterTuningJobConfig *HyperParameterTuningJobConfig `type:"structure" required:"true"` - - // The name of the tuning job. - // - // HyperParameterTuningJobName is a required field - HyperParameterTuningJobName *string `min:"1" type:"string" required:"true"` + // A filter that returns only Git repositories that were created after the specified + // time. + CreationTimeAfter *time.Time `type:"timestamp"` - // The status of the tuning job: InProgress, Completed, Failed, Stopping, or - // Stopped. - // - // HyperParameterTuningJobStatus is a required field - HyperParameterTuningJobStatus *string `type:"string" required:"true" enum:"HyperParameterTuningJobStatus"` + // A filter that returns only Git repositories that were created before the + // specified time. + CreationTimeBefore *time.Time `type:"timestamp"` - // The date and time that the status of the tuning job was modified. - LastModifiedTime *time.Time `type:"timestamp"` + // A filter that returns only Git repositories that were last modified after + // the specified time. + LastModifiedTimeAfter *time.Time `type:"timestamp"` - // The ObjectiveStatusCounters object that specifies the number of training - // jobs, categorized by the status of their final objective metric, that this - // tuning job launched. - // - // ObjectiveStatusCounters is a required field - ObjectiveStatusCounters *ObjectiveStatusCounters `type:"structure" required:"true"` + // A filter that returns only Git repositories that were last modified before + // the specified time. + LastModifiedTimeBefore *time.Time `type:"timestamp"` - // If the hyperparameter tuning job is an warm start tuning job with a WarmStartType - // of IDENTICAL_DATA_AND_ALGORITHM, this is the TrainingJobSummary for the training - // job with the best objective metric value of all training jobs launched by - // this tuning job and all parent jobs specified for the warm start tuning job. - OverallBestTrainingJob *HyperParameterTrainingJobSummary `type:"structure"` + // The maximum number of Git repositories to return in the response. + MaxResults *int64 `min:"1" type:"integer"` - // The HyperParameterTrainingJobDefinition object that specifies the definition - // of the training jobs that this tuning job launches. - TrainingJobDefinition *HyperParameterTrainingJobDefinition `type:"structure"` + // A string in the Git repositories name. This filter returns only repositories + // whose name contains the specified string. + NameContains *string `type:"string"` - // The TrainingJobStatusCounters object that specifies the number of training - // jobs, categorized by status, that this tuning job launched. - // - // TrainingJobStatusCounters is a required field - TrainingJobStatusCounters *TrainingJobStatusCounters `type:"structure" required:"true"` + // If the result of a ListCodeRepositoriesOutput request was truncated, the + // response includes a NextToken. To get the next set of Git repositories, use + // the token in the next request. + NextToken *string `type:"string"` - // The configuration for starting the hyperparameter parameter tuning job using - // one or more previous tuning jobs as a starting point. The results of previous - // tuning jobs are used to inform which combinations of hyperparameters to search - // over in the new tuning job. - WarmStartConfig *HyperParameterTuningJobWarmStartConfig `type:"structure"` + // The field to sort results by. The default is Name. + SortBy *string `type:"string" enum:"CodeRepositorySortBy"` + + // The sort order for results. The default is Ascending. + SortOrder *string `type:"string" enum:"CodeRepositorySortOrder"` } // String returns the string representation -func (s DescribeHyperParameterTuningJobOutput) String() string { +func (s ListCodeRepositoriesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeHyperParameterTuningJobOutput) GoString() string { +func (s ListCodeRepositoriesInput) GoString() string { return s.String() } -// SetBestTrainingJob sets the BestTrainingJob field's value. -func (s *DescribeHyperParameterTuningJobOutput) SetBestTrainingJob(v *HyperParameterTrainingJobSummary) *DescribeHyperParameterTuningJobOutput { - s.BestTrainingJob = v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeHyperParameterTuningJobOutput) SetCreationTime(v time.Time) *DescribeHyperParameterTuningJobOutput { - s.CreationTime = &v - return s -} - -// SetFailureReason sets the FailureReason field's value. -func (s *DescribeHyperParameterTuningJobOutput) SetFailureReason(v string) *DescribeHyperParameterTuningJobOutput { - s.FailureReason = &v - return s -} - -// SetHyperParameterTuningEndTime sets the HyperParameterTuningEndTime field's value. -func (s *DescribeHyperParameterTuningJobOutput) SetHyperParameterTuningEndTime(v time.Time) *DescribeHyperParameterTuningJobOutput { - s.HyperParameterTuningEndTime = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListCodeRepositoriesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListCodeRepositoriesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } -// SetHyperParameterTuningJobArn sets the HyperParameterTuningJobArn field's value. -func (s *DescribeHyperParameterTuningJobOutput) SetHyperParameterTuningJobArn(v string) *DescribeHyperParameterTuningJobOutput { - s.HyperParameterTuningJobArn = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetHyperParameterTuningJobConfig sets the HyperParameterTuningJobConfig field's value. -func (s *DescribeHyperParameterTuningJobOutput) SetHyperParameterTuningJobConfig(v *HyperParameterTuningJobConfig) *DescribeHyperParameterTuningJobOutput { - s.HyperParameterTuningJobConfig = v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListCodeRepositoriesInput) SetCreationTimeAfter(v time.Time) *ListCodeRepositoriesInput { + s.CreationTimeAfter = &v return s } -// SetHyperParameterTuningJobName sets the HyperParameterTuningJobName field's value. -func (s *DescribeHyperParameterTuningJobOutput) SetHyperParameterTuningJobName(v string) *DescribeHyperParameterTuningJobOutput { - s.HyperParameterTuningJobName = &v +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListCodeRepositoriesInput) SetCreationTimeBefore(v time.Time) *ListCodeRepositoriesInput { + s.CreationTimeBefore = &v return s } -// SetHyperParameterTuningJobStatus sets the HyperParameterTuningJobStatus field's value. -func (s *DescribeHyperParameterTuningJobOutput) SetHyperParameterTuningJobStatus(v string) *DescribeHyperParameterTuningJobOutput { - s.HyperParameterTuningJobStatus = &v +// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. +func (s *ListCodeRepositoriesInput) SetLastModifiedTimeAfter(v time.Time) *ListCodeRepositoriesInput { + s.LastModifiedTimeAfter = &v return s } -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *DescribeHyperParameterTuningJobOutput) SetLastModifiedTime(v time.Time) *DescribeHyperParameterTuningJobOutput { - s.LastModifiedTime = &v +// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. +func (s *ListCodeRepositoriesInput) SetLastModifiedTimeBefore(v time.Time) *ListCodeRepositoriesInput { + s.LastModifiedTimeBefore = &v return s } -// SetObjectiveStatusCounters sets the ObjectiveStatusCounters field's value. -func (s *DescribeHyperParameterTuningJobOutput) SetObjectiveStatusCounters(v *ObjectiveStatusCounters) *DescribeHyperParameterTuningJobOutput { - s.ObjectiveStatusCounters = v +// SetMaxResults sets the MaxResults field's value. +func (s *ListCodeRepositoriesInput) SetMaxResults(v int64) *ListCodeRepositoriesInput { + s.MaxResults = &v return s } -// SetOverallBestTrainingJob sets the OverallBestTrainingJob field's value. -func (s *DescribeHyperParameterTuningJobOutput) SetOverallBestTrainingJob(v *HyperParameterTrainingJobSummary) *DescribeHyperParameterTuningJobOutput { - s.OverallBestTrainingJob = v +// SetNameContains sets the NameContains field's value. +func (s *ListCodeRepositoriesInput) SetNameContains(v string) *ListCodeRepositoriesInput { + s.NameContains = &v return s } -// SetTrainingJobDefinition sets the TrainingJobDefinition field's value. -func (s *DescribeHyperParameterTuningJobOutput) SetTrainingJobDefinition(v *HyperParameterTrainingJobDefinition) *DescribeHyperParameterTuningJobOutput { - s.TrainingJobDefinition = v +// SetNextToken sets the NextToken field's value. +func (s *ListCodeRepositoriesInput) SetNextToken(v string) *ListCodeRepositoriesInput { + s.NextToken = &v return s } -// SetTrainingJobStatusCounters sets the TrainingJobStatusCounters field's value. -func (s *DescribeHyperParameterTuningJobOutput) SetTrainingJobStatusCounters(v *TrainingJobStatusCounters) *DescribeHyperParameterTuningJobOutput { - s.TrainingJobStatusCounters = v +// SetSortBy sets the SortBy field's value. +func (s *ListCodeRepositoriesInput) SetSortBy(v string) *ListCodeRepositoriesInput { + s.SortBy = &v return s } -// SetWarmStartConfig sets the WarmStartConfig field's value. -func (s *DescribeHyperParameterTuningJobOutput) SetWarmStartConfig(v *HyperParameterTuningJobWarmStartConfig) *DescribeHyperParameterTuningJobOutput { - s.WarmStartConfig = v +// SetSortOrder sets the SortOrder field's value. +func (s *ListCodeRepositoriesInput) SetSortOrder(v string) *ListCodeRepositoriesInput { + s.SortOrder = &v return s } -type DescribeLabelingJobInput struct { +type ListCodeRepositoriesOutput struct { _ struct{} `type:"structure"` - // The name of the labeling job to return information for. + // Gets a list of summaries of the Git repositories. Each summary specifies + // the following values for the repository: // - // LabelingJobName is a required field - LabelingJobName *string `min:"1" type:"string" required:"true"` + // * Name + // + // * Amazon Resource Name (ARN) + // + // * Creation time + // + // * Last modified time + // + // * Configuration information, including the URL location of the repository + // and the ARN of the AWS Secrets Manager secret that contains the credentials + // used to access the repository. + // + // CodeRepositorySummaryList is a required field + CodeRepositorySummaryList []*CodeRepositorySummary `type:"list" required:"true"` + + // If the result of a ListCodeRepositoriesOutput request was truncated, the + // response includes a NextToken. To get the next set of Git repositories, use + // the token in the next request. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeLabelingJobInput) String() string { +func (s ListCodeRepositoriesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeLabelingJobInput) GoString() string { +func (s ListCodeRepositoriesOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeLabelingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeLabelingJobInput"} - if s.LabelingJobName == nil { - invalidParams.Add(request.NewErrParamRequired("LabelingJobName")) - } - if s.LabelingJobName != nil && len(*s.LabelingJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LabelingJobName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCodeRepositorySummaryList sets the CodeRepositorySummaryList field's value. +func (s *ListCodeRepositoriesOutput) SetCodeRepositorySummaryList(v []*CodeRepositorySummary) *ListCodeRepositoriesOutput { + s.CodeRepositorySummaryList = v + return s } -// SetLabelingJobName sets the LabelingJobName field's value. -func (s *DescribeLabelingJobInput) SetLabelingJobName(v string) *DescribeLabelingJobInput { - s.LabelingJobName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListCodeRepositoriesOutput) SetNextToken(v string) *ListCodeRepositoriesOutput { + s.NextToken = &v return s } -type DescribeLabelingJobOutput struct { +type ListCompilationJobsInput struct { _ struct{} `type:"structure"` - // The date and time that the labeling job was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` - - // If the job failed, the reason that it failed. - FailureReason *string `type:"string"` - - // Configuration information required for human workers to complete a labeling - // task. - // - // HumanTaskConfig is a required field - HumanTaskConfig *HumanTaskConfig `type:"structure" required:"true"` - - // Input configuration information for the labeling job, such as the Amazon - // S3 location of the data objects and the location of the manifest file that - // describes the data objects. - // - // InputConfig is a required field - InputConfig *LabelingJobInputConfig `type:"structure" required:"true"` - - // A unique identifier for work done as part of a labeling job. - // - // JobReferenceCode is a required field - JobReferenceCode *string `min:"1" type:"string" required:"true"` - - // The attribute used as the label in the output manifest file. - LabelAttributeName *string `min:"1" type:"string"` - - // The S3 location of the JSON file that defines the categories used to label - // data objects. - // - // The file is a JSON structure in the following format: - // - // { - // - // "document-version": "2018-11-28" - // - // "labels": [ - // - // { - // - // "label": "label 1" - // - // }, - // - // { - // - // "label": "label 2" - // - // }, - // - // ... - // - // { - // - // "label": "label n" - // - // } - // - // ] - // - // } - LabelCategoryConfigS3Uri *string `type:"string"` - - // Provides a breakdown of the number of data objects labeled by humans, the - // number of objects labeled by machine, the number of objects than couldn't - // be labeled, and the total number of objects labeled. - // - // LabelCounters is a required field - LabelCounters *LabelCounters `type:"structure" required:"true"` - - // Configuration information for automated data labeling. - LabelingJobAlgorithmsConfig *LabelingJobAlgorithmsConfig `type:"structure"` + // A filter that returns the model compilation jobs that were created after + // a specified time. + CreationTimeAfter *time.Time `type:"timestamp"` - // The Amazon Resource Name (ARN) of the labeling job. - // - // LabelingJobArn is a required field - LabelingJobArn *string `type:"string" required:"true"` + // A filter that returns the model compilation jobs that were created before + // a specified time. + CreationTimeBefore *time.Time `type:"timestamp"` - // The name assigned to the labeling job when it was created. - // - // LabelingJobName is a required field - LabelingJobName *string `min:"1" type:"string" required:"true"` + // A filter that returns the model compilation jobs that were modified after + // a specified time. + LastModifiedTimeAfter *time.Time `type:"timestamp"` - // The location of the output produced by the labeling job. - LabelingJobOutput *LabelingJobOutput `type:"structure"` + // A filter that returns the model compilation jobs that were modified before + // a specified time. + LastModifiedTimeBefore *time.Time `type:"timestamp"` - // The processing status of the labeling job. - // - // LabelingJobStatus is a required field - LabelingJobStatus *string `type:"string" required:"true" enum:"LabelingJobStatus"` + // The maximum number of model compilation jobs to return in the response. + MaxResults *int64 `min:"1" type:"integer"` - // The date and time that the labeling job was last updated. - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `type:"timestamp" required:"true"` + // A filter that returns the model compilation jobs whose name contains a specified + // string. + NameContains *string `type:"string"` - // The location of the job's output data and the AWS Key Management Service - // key ID for the key used to encrypt the output data, if any. - // - // OutputConfig is a required field - OutputConfig *LabelingJobOutputConfig `type:"structure" required:"true"` + // If the result of the previous ListCompilationJobs request was truncated, + // the response includes a NextToken. To retrieve the next set of model compilation + // jobs, use the token in the next request. + NextToken *string `type:"string"` - // The Amazon Resource Name (ARN) that Amazon SageMaker assumes to perform tasks - // on your behalf during data labeling. - // - // RoleArn is a required field - RoleArn *string `min:"20" type:"string" required:"true"` + // The field by which to sort results. The default is CreationTime. + SortBy *string `type:"string" enum:"ListCompilationJobsSortBy"` - // A set of conditions for stopping a labeling job. If any of the conditions - // are met, the job is automatically stopped. - StoppingConditions *LabelingJobStoppingConditions `type:"structure"` + // The sort order for results. The default is Ascending. + SortOrder *string `type:"string" enum:"SortOrder"` - // An array of key/value pairs. For more information, see Using Cost Allocation - // Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) - // in the AWS Billing and Cost Management User Guide. - Tags []*Tag `type:"list"` + // A filter that retrieves model compilation jobs with a specific DescribeCompilationJobResponse$CompilationJobStatus + // status. + StatusEquals *string `type:"string" enum:"CompilationJobStatus"` } // String returns the string representation -func (s DescribeLabelingJobOutput) String() string { +func (s ListCompilationJobsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeLabelingJobOutput) GoString() string { +func (s ListCompilationJobsInput) GoString() string { return s.String() } -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeLabelingJobOutput) SetCreationTime(v time.Time) *DescribeLabelingJobOutput { - s.CreationTime = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListCompilationJobsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListCompilationJobsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } -// SetFailureReason sets the FailureReason field's value. -func (s *DescribeLabelingJobOutput) SetFailureReason(v string) *DescribeLabelingJobOutput { - s.FailureReason = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetHumanTaskConfig sets the HumanTaskConfig field's value. -func (s *DescribeLabelingJobOutput) SetHumanTaskConfig(v *HumanTaskConfig) *DescribeLabelingJobOutput { - s.HumanTaskConfig = v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListCompilationJobsInput) SetCreationTimeAfter(v time.Time) *ListCompilationJobsInput { + s.CreationTimeAfter = &v return s } -// SetInputConfig sets the InputConfig field's value. -func (s *DescribeLabelingJobOutput) SetInputConfig(v *LabelingJobInputConfig) *DescribeLabelingJobOutput { - s.InputConfig = v +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListCompilationJobsInput) SetCreationTimeBefore(v time.Time) *ListCompilationJobsInput { + s.CreationTimeBefore = &v return s } -// SetJobReferenceCode sets the JobReferenceCode field's value. -func (s *DescribeLabelingJobOutput) SetJobReferenceCode(v string) *DescribeLabelingJobOutput { - s.JobReferenceCode = &v +// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. +func (s *ListCompilationJobsInput) SetLastModifiedTimeAfter(v time.Time) *ListCompilationJobsInput { + s.LastModifiedTimeAfter = &v return s } -// SetLabelAttributeName sets the LabelAttributeName field's value. -func (s *DescribeLabelingJobOutput) SetLabelAttributeName(v string) *DescribeLabelingJobOutput { - s.LabelAttributeName = &v +// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. +func (s *ListCompilationJobsInput) SetLastModifiedTimeBefore(v time.Time) *ListCompilationJobsInput { + s.LastModifiedTimeBefore = &v return s } -// SetLabelCategoryConfigS3Uri sets the LabelCategoryConfigS3Uri field's value. -func (s *DescribeLabelingJobOutput) SetLabelCategoryConfigS3Uri(v string) *DescribeLabelingJobOutput { - s.LabelCategoryConfigS3Uri = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListCompilationJobsInput) SetMaxResults(v int64) *ListCompilationJobsInput { + s.MaxResults = &v return s } -// SetLabelCounters sets the LabelCounters field's value. -func (s *DescribeLabelingJobOutput) SetLabelCounters(v *LabelCounters) *DescribeLabelingJobOutput { - s.LabelCounters = v +// SetNameContains sets the NameContains field's value. +func (s *ListCompilationJobsInput) SetNameContains(v string) *ListCompilationJobsInput { + s.NameContains = &v return s } -// SetLabelingJobAlgorithmsConfig sets the LabelingJobAlgorithmsConfig field's value. -func (s *DescribeLabelingJobOutput) SetLabelingJobAlgorithmsConfig(v *LabelingJobAlgorithmsConfig) *DescribeLabelingJobOutput { - s.LabelingJobAlgorithmsConfig = v +// SetNextToken sets the NextToken field's value. +func (s *ListCompilationJobsInput) SetNextToken(v string) *ListCompilationJobsInput { + s.NextToken = &v return s } -// SetLabelingJobArn sets the LabelingJobArn field's value. -func (s *DescribeLabelingJobOutput) SetLabelingJobArn(v string) *DescribeLabelingJobOutput { - s.LabelingJobArn = &v +// SetSortBy sets the SortBy field's value. +func (s *ListCompilationJobsInput) SetSortBy(v string) *ListCompilationJobsInput { + s.SortBy = &v return s } -// SetLabelingJobName sets the LabelingJobName field's value. -func (s *DescribeLabelingJobOutput) SetLabelingJobName(v string) *DescribeLabelingJobOutput { - s.LabelingJobName = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListCompilationJobsInput) SetSortOrder(v string) *ListCompilationJobsInput { + s.SortOrder = &v return s } -// SetLabelingJobOutput sets the LabelingJobOutput field's value. -func (s *DescribeLabelingJobOutput) SetLabelingJobOutput(v *LabelingJobOutput) *DescribeLabelingJobOutput { - s.LabelingJobOutput = v +// SetStatusEquals sets the StatusEquals field's value. +func (s *ListCompilationJobsInput) SetStatusEquals(v string) *ListCompilationJobsInput { + s.StatusEquals = &v return s } -// SetLabelingJobStatus sets the LabelingJobStatus field's value. -func (s *DescribeLabelingJobOutput) SetLabelingJobStatus(v string) *DescribeLabelingJobOutput { - s.LabelingJobStatus = &v - return s -} +type ListCompilationJobsOutput struct { + _ struct{} `type:"structure"` -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *DescribeLabelingJobOutput) SetLastModifiedTime(v time.Time) *DescribeLabelingJobOutput { - s.LastModifiedTime = &v - return s + // An array of CompilationJobSummary objects, each describing a model compilation + // job. + // + // CompilationJobSummaries is a required field + CompilationJobSummaries []*CompilationJobSummary `type:"list" required:"true"` + + // If the response is truncated, Amazon SageMaker returns this NextToken. To + // retrieve the next set of model compilation jobs, use this token in the next + // request. + NextToken *string `type:"string"` } -// SetOutputConfig sets the OutputConfig field's value. -func (s *DescribeLabelingJobOutput) SetOutputConfig(v *LabelingJobOutputConfig) *DescribeLabelingJobOutput { - s.OutputConfig = v - return s +// String returns the string representation +func (s ListCompilationJobsOutput) String() string { + return awsutil.Prettify(s) } -// SetRoleArn sets the RoleArn field's value. -func (s *DescribeLabelingJobOutput) SetRoleArn(v string) *DescribeLabelingJobOutput { - s.RoleArn = &v - return s +// GoString returns the string representation +func (s ListCompilationJobsOutput) GoString() string { + return s.String() } -// SetStoppingConditions sets the StoppingConditions field's value. -func (s *DescribeLabelingJobOutput) SetStoppingConditions(v *LabelingJobStoppingConditions) *DescribeLabelingJobOutput { - s.StoppingConditions = v +// SetCompilationJobSummaries sets the CompilationJobSummaries field's value. +func (s *ListCompilationJobsOutput) SetCompilationJobSummaries(v []*CompilationJobSummary) *ListCompilationJobsOutput { + s.CompilationJobSummaries = v return s } -// SetTags sets the Tags field's value. -func (s *DescribeLabelingJobOutput) SetTags(v []*Tag) *DescribeLabelingJobOutput { - s.Tags = v +// SetNextToken sets the NextToken field's value. +func (s *ListCompilationJobsOutput) SetNextToken(v string) *ListCompilationJobsOutput { + s.NextToken = &v return s } -type DescribeModelInput struct { +type ListDomainsInput struct { _ struct{} `type:"structure"` - // The name of the model. - // - // ModelName is a required field - ModelName *string `type:"string" required:"true"` + // Returns a list up to a specified limit. + MaxResults *int64 `min:"1" type:"integer"` + + // If the previous response was truncated, you will receive this token. Use + // it in your next request to receive the next set of results. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeModelInput) String() string { +func (s ListDomainsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeModelInput) GoString() string { +func (s ListDomainsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeModelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeModelInput"} - if s.ModelName == nil { - invalidParams.Add(request.NewErrParamRequired("ModelName")) +func (s *ListDomainsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListDomainsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -13175,332 +31977,379 @@ func (s *DescribeModelInput) Validate() error { return nil } -// SetModelName sets the ModelName field's value. -func (s *DescribeModelInput) SetModelName(v string) *DescribeModelInput { - s.ModelName = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListDomainsInput) SetMaxResults(v int64) *ListDomainsInput { + s.MaxResults = &v return s } -type DescribeModelOutput struct { +// SetNextToken sets the NextToken field's value. +func (s *ListDomainsInput) SetNextToken(v string) *ListDomainsInput { + s.NextToken = &v + return s +} + +type ListDomainsOutput struct { _ struct{} `type:"structure"` - // The containers in the inference pipeline. - Containers []*ContainerDefinition `type:"list"` + // The list of domains. + Domains []*DomainDetails `type:"list"` - // A timestamp that shows when the model was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` + // If the previous response was truncated, you will receive this token. Use + // it in your next request to receive the next set of results. + NextToken *string `type:"string"` +} - // If True, no inbound or outbound network calls can be made to or from the - // model container. - // - // The Semantic Segmentation built-in algorithm does not support network isolation. - EnableNetworkIsolation *bool `type:"boolean"` +// String returns the string representation +func (s ListDomainsOutput) String() string { + return awsutil.Prettify(s) +} - // The Amazon Resource Name (ARN) of the IAM role that you specified for the - // model. - // - // ExecutionRoleArn is a required field - ExecutionRoleArn *string `min:"20" type:"string" required:"true"` +// GoString returns the string representation +func (s ListDomainsOutput) GoString() string { + return s.String() +} - // The Amazon Resource Name (ARN) of the model. - // - // ModelArn is a required field - ModelArn *string `min:"20" type:"string" required:"true"` +// SetDomains sets the Domains field's value. +func (s *ListDomainsOutput) SetDomains(v []*DomainDetails) *ListDomainsOutput { + s.Domains = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListDomainsOutput) SetNextToken(v string) *ListDomainsOutput { + s.NextToken = &v + return s +} + +type ListEndpointConfigsInput struct { + _ struct{} `type:"structure"` + + // A filter that returns only endpoint configurations with a creation time greater + // than or equal to the specified time (timestamp). + CreationTimeAfter *time.Time `type:"timestamp"` + + // A filter that returns only endpoint configurations created before the specified + // time (timestamp). + CreationTimeBefore *time.Time `type:"timestamp"` + + // The maximum number of training jobs to return in the response. + MaxResults *int64 `min:"1" type:"integer"` - // Name of the Amazon SageMaker model. - // - // ModelName is a required field - ModelName *string `type:"string" required:"true"` + // A string in the endpoint configuration name. This filter returns only endpoint + // configurations whose name contains the specified string. + NameContains *string `type:"string"` - // The location of the primary inference code, associated artifacts, and custom - // environment map that the inference code uses when it is deployed in production. - PrimaryContainer *ContainerDefinition `type:"structure"` + // If the result of the previous ListEndpointConfig request was truncated, the + // response includes a NextToken. To retrieve the next set of endpoint configurations, + // use the token in the next request. + NextToken *string `type:"string"` - // A VpcConfig object that specifies the VPC that this model has access to. - // For more information, see Protect Endpoints by Using an Amazon Virtual Private - // Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/host-vpc.html) - VpcConfig *VpcConfig `type:"structure"` + // The field to sort results by. The default is CreationTime. + SortBy *string `type:"string" enum:"EndpointConfigSortKey"` + + // The sort order for results. The default is Descending. + SortOrder *string `type:"string" enum:"OrderKey"` } // String returns the string representation -func (s DescribeModelOutput) String() string { +func (s ListEndpointConfigsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeModelOutput) GoString() string { +func (s ListEndpointConfigsInput) GoString() string { return s.String() } -// SetContainers sets the Containers field's value. -func (s *DescribeModelOutput) SetContainers(v []*ContainerDefinition) *DescribeModelOutput { - s.Containers = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListEndpointConfigsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListEndpointConfigsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeModelOutput) SetCreationTime(v time.Time) *DescribeModelOutput { - s.CreationTime = &v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListEndpointConfigsInput) SetCreationTimeAfter(v time.Time) *ListEndpointConfigsInput { + s.CreationTimeAfter = &v return s } -// SetEnableNetworkIsolation sets the EnableNetworkIsolation field's value. -func (s *DescribeModelOutput) SetEnableNetworkIsolation(v bool) *DescribeModelOutput { - s.EnableNetworkIsolation = &v +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListEndpointConfigsInput) SetCreationTimeBefore(v time.Time) *ListEndpointConfigsInput { + s.CreationTimeBefore = &v return s } -// SetExecutionRoleArn sets the ExecutionRoleArn field's value. -func (s *DescribeModelOutput) SetExecutionRoleArn(v string) *DescribeModelOutput { - s.ExecutionRoleArn = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListEndpointConfigsInput) SetMaxResults(v int64) *ListEndpointConfigsInput { + s.MaxResults = &v return s } -// SetModelArn sets the ModelArn field's value. -func (s *DescribeModelOutput) SetModelArn(v string) *DescribeModelOutput { - s.ModelArn = &v +// SetNameContains sets the NameContains field's value. +func (s *ListEndpointConfigsInput) SetNameContains(v string) *ListEndpointConfigsInput { + s.NameContains = &v return s } -// SetModelName sets the ModelName field's value. -func (s *DescribeModelOutput) SetModelName(v string) *DescribeModelOutput { - s.ModelName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListEndpointConfigsInput) SetNextToken(v string) *ListEndpointConfigsInput { + s.NextToken = &v return s } -// SetPrimaryContainer sets the PrimaryContainer field's value. -func (s *DescribeModelOutput) SetPrimaryContainer(v *ContainerDefinition) *DescribeModelOutput { - s.PrimaryContainer = v +// SetSortBy sets the SortBy field's value. +func (s *ListEndpointConfigsInput) SetSortBy(v string) *ListEndpointConfigsInput { + s.SortBy = &v return s } -// SetVpcConfig sets the VpcConfig field's value. -func (s *DescribeModelOutput) SetVpcConfig(v *VpcConfig) *DescribeModelOutput { - s.VpcConfig = v +// SetSortOrder sets the SortOrder field's value. +func (s *ListEndpointConfigsInput) SetSortOrder(v string) *ListEndpointConfigsInput { + s.SortOrder = &v return s } -type DescribeModelPackageInput struct { +type ListEndpointConfigsOutput struct { _ struct{} `type:"structure"` - // The name of the model package to describe. + // An array of endpoint configurations. // - // ModelPackageName is a required field - ModelPackageName *string `min:"1" type:"string" required:"true"` + // EndpointConfigs is a required field + EndpointConfigs []*EndpointConfigSummary `type:"list" required:"true"` + + // If the response is truncated, Amazon SageMaker returns this token. To retrieve + // the next set of endpoint configurations, use it in the subsequent request + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeModelPackageInput) String() string { +func (s ListEndpointConfigsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeModelPackageInput) GoString() string { +func (s ListEndpointConfigsOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeModelPackageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeModelPackageInput"} - if s.ModelPackageName == nil { - invalidParams.Add(request.NewErrParamRequired("ModelPackageName")) - } - if s.ModelPackageName != nil && len(*s.ModelPackageName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ModelPackageName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetEndpointConfigs sets the EndpointConfigs field's value. +func (s *ListEndpointConfigsOutput) SetEndpointConfigs(v []*EndpointConfigSummary) *ListEndpointConfigsOutput { + s.EndpointConfigs = v + return s } -// SetModelPackageName sets the ModelPackageName field's value. -func (s *DescribeModelPackageInput) SetModelPackageName(v string) *DescribeModelPackageInput { - s.ModelPackageName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListEndpointConfigsOutput) SetNextToken(v string) *ListEndpointConfigsOutput { + s.NextToken = &v return s } -type DescribeModelPackageOutput struct { +type ListEndpointsInput struct { _ struct{} `type:"structure"` - // Whether the model package is certified for listing on AWS Marketplace. - CertifyForMarketplace *bool `type:"boolean"` + // A filter that returns only endpoints with a creation time greater than or + // equal to the specified time (timestamp). + CreationTimeAfter *time.Time `type:"timestamp"` - // A timestamp specifying when the model package was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` + // A filter that returns only endpoints that were created before the specified + // time (timestamp). + CreationTimeBefore *time.Time `type:"timestamp"` - // Details about inference jobs that can be run with models based on this model - // package. - InferenceSpecification *InferenceSpecification `type:"structure"` + // A filter that returns only endpoints that were modified after the specified + // timestamp. + LastModifiedTimeAfter *time.Time `type:"timestamp"` - // The Amazon Resource Name (ARN) of the model package. - // - // ModelPackageArn is a required field - ModelPackageArn *string `min:"1" type:"string" required:"true"` + // A filter that returns only endpoints that were modified before the specified + // timestamp. + LastModifiedTimeBefore *time.Time `type:"timestamp"` - // A brief summary of the model package. - ModelPackageDescription *string `type:"string"` + // The maximum number of endpoints to return in the response. + MaxResults *int64 `min:"1" type:"integer"` - // The name of the model package being described. - // - // ModelPackageName is a required field - ModelPackageName *string `min:"1" type:"string" required:"true"` + // A string in endpoint names. This filter returns only endpoints whose name + // contains the specified string. + NameContains *string `type:"string"` - // The current status of the model package. - // - // ModelPackageStatus is a required field - ModelPackageStatus *string `type:"string" required:"true" enum:"ModelPackageStatus"` + // If the result of a ListEndpoints request was truncated, the response includes + // a NextToken. To retrieve the next set of endpoints, use the token in the + // next request. + NextToken *string `type:"string"` - // Details about the current status of the model package. - // - // ModelPackageStatusDetails is a required field - ModelPackageStatusDetails *ModelPackageStatusDetails `type:"structure" required:"true"` + // Sorts the list of results. The default is CreationTime. + SortBy *string `type:"string" enum:"EndpointSortKey"` - // Details about the algorithm that was used to create the model package. - SourceAlgorithmSpecification *SourceAlgorithmSpecification `type:"structure"` + // The sort order for results. The default is Descending. + SortOrder *string `type:"string" enum:"OrderKey"` - // Configurations for one or more transform jobs that Amazon SageMaker runs - // to test the model package. - ValidationSpecification *ModelPackageValidationSpecification `type:"structure"` + // A filter that returns only endpoints with the specified status. + StatusEquals *string `type:"string" enum:"EndpointStatus"` } // String returns the string representation -func (s DescribeModelPackageOutput) String() string { +func (s ListEndpointsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeModelPackageOutput) GoString() string { +func (s ListEndpointsInput) GoString() string { return s.String() } -// SetCertifyForMarketplace sets the CertifyForMarketplace field's value. -func (s *DescribeModelPackageOutput) SetCertifyForMarketplace(v bool) *DescribeModelPackageOutput { - s.CertifyForMarketplace = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListEndpointsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListEndpointsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListEndpointsInput) SetCreationTimeAfter(v time.Time) *ListEndpointsInput { + s.CreationTimeAfter = &v return s } -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeModelPackageOutput) SetCreationTime(v time.Time) *DescribeModelPackageOutput { - s.CreationTime = &v +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListEndpointsInput) SetCreationTimeBefore(v time.Time) *ListEndpointsInput { + s.CreationTimeBefore = &v return s } -// SetInferenceSpecification sets the InferenceSpecification field's value. -func (s *DescribeModelPackageOutput) SetInferenceSpecification(v *InferenceSpecification) *DescribeModelPackageOutput { - s.InferenceSpecification = v +// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. +func (s *ListEndpointsInput) SetLastModifiedTimeAfter(v time.Time) *ListEndpointsInput { + s.LastModifiedTimeAfter = &v return s } -// SetModelPackageArn sets the ModelPackageArn field's value. -func (s *DescribeModelPackageOutput) SetModelPackageArn(v string) *DescribeModelPackageOutput { - s.ModelPackageArn = &v +// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. +func (s *ListEndpointsInput) SetLastModifiedTimeBefore(v time.Time) *ListEndpointsInput { + s.LastModifiedTimeBefore = &v return s } -// SetModelPackageDescription sets the ModelPackageDescription field's value. -func (s *DescribeModelPackageOutput) SetModelPackageDescription(v string) *DescribeModelPackageOutput { - s.ModelPackageDescription = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListEndpointsInput) SetMaxResults(v int64) *ListEndpointsInput { + s.MaxResults = &v return s } -// SetModelPackageName sets the ModelPackageName field's value. -func (s *DescribeModelPackageOutput) SetModelPackageName(v string) *DescribeModelPackageOutput { - s.ModelPackageName = &v +// SetNameContains sets the NameContains field's value. +func (s *ListEndpointsInput) SetNameContains(v string) *ListEndpointsInput { + s.NameContains = &v return s } -// SetModelPackageStatus sets the ModelPackageStatus field's value. -func (s *DescribeModelPackageOutput) SetModelPackageStatus(v string) *DescribeModelPackageOutput { - s.ModelPackageStatus = &v +// SetNextToken sets the NextToken field's value. +func (s *ListEndpointsInput) SetNextToken(v string) *ListEndpointsInput { + s.NextToken = &v return s } -// SetModelPackageStatusDetails sets the ModelPackageStatusDetails field's value. -func (s *DescribeModelPackageOutput) SetModelPackageStatusDetails(v *ModelPackageStatusDetails) *DescribeModelPackageOutput { - s.ModelPackageStatusDetails = v +// SetSortBy sets the SortBy field's value. +func (s *ListEndpointsInput) SetSortBy(v string) *ListEndpointsInput { + s.SortBy = &v return s } -// SetSourceAlgorithmSpecification sets the SourceAlgorithmSpecification field's value. -func (s *DescribeModelPackageOutput) SetSourceAlgorithmSpecification(v *SourceAlgorithmSpecification) *DescribeModelPackageOutput { - s.SourceAlgorithmSpecification = v +// SetSortOrder sets the SortOrder field's value. +func (s *ListEndpointsInput) SetSortOrder(v string) *ListEndpointsInput { + s.SortOrder = &v return s } -// SetValidationSpecification sets the ValidationSpecification field's value. -func (s *DescribeModelPackageOutput) SetValidationSpecification(v *ModelPackageValidationSpecification) *DescribeModelPackageOutput { - s.ValidationSpecification = v +// SetStatusEquals sets the StatusEquals field's value. +func (s *ListEndpointsInput) SetStatusEquals(v string) *ListEndpointsInput { + s.StatusEquals = &v return s } -type DescribeNotebookInstanceInput struct { +type ListEndpointsOutput struct { _ struct{} `type:"structure"` - // The name of the notebook instance that you want information about. + // An array or endpoint objects. // - // NotebookInstanceName is a required field - NotebookInstanceName *string `type:"string" required:"true"` + // Endpoints is a required field + Endpoints []*EndpointSummary `type:"list" required:"true"` + + // If the response is truncated, Amazon SageMaker returns this token. To retrieve + // the next set of training jobs, use it in the subsequent request. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeNotebookInstanceInput) String() string { +func (s ListEndpointsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeNotebookInstanceInput) GoString() string { +func (s ListEndpointsOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeNotebookInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeNotebookInstanceInput"} - if s.NotebookInstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("NotebookInstanceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetEndpoints sets the Endpoints field's value. +func (s *ListEndpointsOutput) SetEndpoints(v []*EndpointSummary) *ListEndpointsOutput { + s.Endpoints = v + return s } -// SetNotebookInstanceName sets the NotebookInstanceName field's value. -func (s *DescribeNotebookInstanceInput) SetNotebookInstanceName(v string) *DescribeNotebookInstanceInput { - s.NotebookInstanceName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListEndpointsOutput) SetNextToken(v string) *ListEndpointsOutput { + s.NextToken = &v return s } -type DescribeNotebookInstanceLifecycleConfigInput struct { +type ListExperimentsInput struct { _ struct{} `type:"structure"` - // The name of the lifecycle configuration to describe. - // - // NotebookInstanceLifecycleConfigName is a required field - NotebookInstanceLifecycleConfigName *string `type:"string" required:"true"` + // A filter that returns only experiments created after the specified time. + CreatedAfter *time.Time `type:"timestamp"` + + // A filter that returns only experiments created before the specified time. + CreatedBefore *time.Time `type:"timestamp"` + + // The maximum number of experiments to return in the response. The default + // value is 10. + MaxResults *int64 `min:"1" type:"integer"` + + // If the previous call to ListExperiments didn't return the full set of experiments, + // the call returns a token for getting the next set of experiments. + NextToken *string `type:"string"` + + // The property used to sort results. The default value is CreationTime. + SortBy *string `type:"string" enum:"SortExperimentsBy"` + + // The sort order. The default value is Descending. + SortOrder *string `type:"string" enum:"SortOrder"` } // String returns the string representation -func (s DescribeNotebookInstanceLifecycleConfigInput) String() string { +func (s ListExperimentsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeNotebookInstanceLifecycleConfigInput) GoString() string { +func (s ListExperimentsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeNotebookInstanceLifecycleConfigInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeNotebookInstanceLifecycleConfigInput"} - if s.NotebookInstanceLifecycleConfigName == nil { - invalidParams.Add(request.NewErrParamRequired("NotebookInstanceLifecycleConfigName")) +func (s *ListExperimentsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListExperimentsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -13509,332 +32358,224 @@ func (s *DescribeNotebookInstanceLifecycleConfigInput) Validate() error { return nil } -// SetNotebookInstanceLifecycleConfigName sets the NotebookInstanceLifecycleConfigName field's value. -func (s *DescribeNotebookInstanceLifecycleConfigInput) SetNotebookInstanceLifecycleConfigName(v string) *DescribeNotebookInstanceLifecycleConfigInput { - s.NotebookInstanceLifecycleConfigName = &v - return s -} - -type DescribeNotebookInstanceLifecycleConfigOutput struct { - _ struct{} `type:"structure"` - - // A timestamp that tells when the lifecycle configuration was created. - CreationTime *time.Time `type:"timestamp"` - - // A timestamp that tells when the lifecycle configuration was last modified. - LastModifiedTime *time.Time `type:"timestamp"` - - // The Amazon Resource Name (ARN) of the lifecycle configuration. - NotebookInstanceLifecycleConfigArn *string `type:"string"` - - // The name of the lifecycle configuration. - NotebookInstanceLifecycleConfigName *string `type:"string"` - - // The shell script that runs only once, when you create a notebook instance. - OnCreate []*NotebookInstanceLifecycleHook `type:"list"` - - // The shell script that runs every time you start a notebook instance, including - // when you create the notebook instance. - OnStart []*NotebookInstanceLifecycleHook `type:"list"` -} - -// String returns the string representation -func (s DescribeNotebookInstanceLifecycleConfigOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s DescribeNotebookInstanceLifecycleConfigOutput) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeNotebookInstanceLifecycleConfigOutput) SetCreationTime(v time.Time) *DescribeNotebookInstanceLifecycleConfigOutput { - s.CreationTime = &v +// SetCreatedAfter sets the CreatedAfter field's value. +func (s *ListExperimentsInput) SetCreatedAfter(v time.Time) *ListExperimentsInput { + s.CreatedAfter = &v return s } -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *DescribeNotebookInstanceLifecycleConfigOutput) SetLastModifiedTime(v time.Time) *DescribeNotebookInstanceLifecycleConfigOutput { - s.LastModifiedTime = &v +// SetCreatedBefore sets the CreatedBefore field's value. +func (s *ListExperimentsInput) SetCreatedBefore(v time.Time) *ListExperimentsInput { + s.CreatedBefore = &v return s } -// SetNotebookInstanceLifecycleConfigArn sets the NotebookInstanceLifecycleConfigArn field's value. -func (s *DescribeNotebookInstanceLifecycleConfigOutput) SetNotebookInstanceLifecycleConfigArn(v string) *DescribeNotebookInstanceLifecycleConfigOutput { - s.NotebookInstanceLifecycleConfigArn = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListExperimentsInput) SetMaxResults(v int64) *ListExperimentsInput { + s.MaxResults = &v return s } -// SetNotebookInstanceLifecycleConfigName sets the NotebookInstanceLifecycleConfigName field's value. -func (s *DescribeNotebookInstanceLifecycleConfigOutput) SetNotebookInstanceLifecycleConfigName(v string) *DescribeNotebookInstanceLifecycleConfigOutput { - s.NotebookInstanceLifecycleConfigName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListExperimentsInput) SetNextToken(v string) *ListExperimentsInput { + s.NextToken = &v return s } -// SetOnCreate sets the OnCreate field's value. -func (s *DescribeNotebookInstanceLifecycleConfigOutput) SetOnCreate(v []*NotebookInstanceLifecycleHook) *DescribeNotebookInstanceLifecycleConfigOutput { - s.OnCreate = v +// SetSortBy sets the SortBy field's value. +func (s *ListExperimentsInput) SetSortBy(v string) *ListExperimentsInput { + s.SortBy = &v return s } -// SetOnStart sets the OnStart field's value. -func (s *DescribeNotebookInstanceLifecycleConfigOutput) SetOnStart(v []*NotebookInstanceLifecycleHook) *DescribeNotebookInstanceLifecycleConfigOutput { - s.OnStart = v +// SetSortOrder sets the SortOrder field's value. +func (s *ListExperimentsInput) SetSortOrder(v string) *ListExperimentsInput { + s.SortOrder = &v return s } -type DescribeNotebookInstanceOutput struct { +type ListExperimentsOutput struct { _ struct{} `type:"structure"` - // A list of the Elastic Inference (EI) instance types associated with this - // notebook instance. Currently only one EI instance type can be associated - // with a notebook instance. For more information, see Using Elastic Inference - // in Amazon SageMaker (sagemaker/latest/dg/ei.html). - AcceleratorTypes []*string `type:"list"` - - // An array of up to three Git repositories associated with the notebook instance. - // These can be either the names of Git repositories stored as resources in - // your account, or the URL of Git repositories in AWS CodeCommit (https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html) - // or in any other Git repository. These repositories are cloned at the same - // level as the default repository of your notebook instance. For more information, - // see Associating Git Repositories with Amazon SageMaker Notebook Instances - // (https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html). - AdditionalCodeRepositories []*string `type:"list"` - - // A timestamp. Use this parameter to return the time when the notebook instance - // was created - CreationTime *time.Time `type:"timestamp"` - - // The Git repository associated with the notebook instance as its default code - // repository. This can be either the name of a Git repository stored as a resource - // in your account, or the URL of a Git repository in AWS CodeCommit (https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html) - // or in any other Git repository. When you open a notebook instance, it opens - // in the directory that contains this repository. For more information, see - // Associating Git Repositories with Amazon SageMaker Notebook Instances (https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html). - DefaultCodeRepository *string `min:"1" type:"string"` - - // Describes whether Amazon SageMaker provides internet access to the notebook - // instance. If this value is set to Disabled, the notebook instance does not - // have internet access, and cannot connect to Amazon SageMaker training and - // endpoint services. - // - // For more information, see Notebook Instances Are Internet-Enabled by Default - // (https://docs.aws.amazon.com/sagemaker/latest/dg/appendix-additional-considerations.html#appendix-notebook-and-internet-access). - DirectInternetAccess *string `type:"string" enum:"DirectInternetAccess"` - - // If status is Failed, the reason it failed. - FailureReason *string `type:"string"` - - // The type of ML compute instance running on the notebook instance. - InstanceType *string `type:"string" enum:"InstanceType"` - - // The AWS KMS key ID Amazon SageMaker uses to encrypt data when storing it - // on the ML storage volume attached to the instance. - KmsKeyId *string `type:"string"` - - // A timestamp. Use this parameter to retrieve the time when the notebook instance - // was last modified. - LastModifiedTime *time.Time `type:"timestamp"` - - // The network interface IDs that Amazon SageMaker created at the time of creating - // the instance. - NetworkInterfaceId *string `type:"string"` - - // The Amazon Resource Name (ARN) of the notebook instance. - NotebookInstanceArn *string `type:"string"` - - // Returns the name of a notebook instance lifecycle configuration. - // - // For information about notebook instance lifestyle configurations, see Step - // 2.1: (Optional) Customize a Notebook Instance (https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html) - NotebookInstanceLifecycleConfigName *string `type:"string"` - - // The name of the Amazon SageMaker notebook instance. - NotebookInstanceName *string `type:"string"` - - // The status of the notebook instance. - NotebookInstanceStatus *string `type:"string" enum:"NotebookInstanceStatus"` - - // The Amazon Resource Name (ARN) of the IAM role associated with the instance. - RoleArn *string `min:"20" type:"string"` - - // Whether root access is enabled or disabled for users of the notebook instance. - // - // Lifecycle configurations need root access to be able to set up a notebook - // instance. Because of this, lifecycle configurations associated with a notebook - // instance always run with root access even if you disable root access for - // users. - RootAccess *string `type:"string" enum:"RootAccess"` - - // The IDs of the VPC security groups. - SecurityGroups []*string `type:"list"` - - // The ID of the VPC subnet. - SubnetId *string `type:"string"` - - // The URL that you use to connect to the Jupyter notebook that is running in - // your notebook instance. - Url *string `type:"string"` + // A list of the summaries of your experiments. + ExperimentSummaries []*ExperimentSummary `type:"list"` - // The size, in GB, of the ML storage volume attached to the notebook instance. - VolumeSizeInGB *int64 `min:"5" type:"integer"` + // A token for getting the next set of experiments, if there are any. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeNotebookInstanceOutput) String() string { +func (s ListExperimentsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeNotebookInstanceOutput) GoString() string { +func (s ListExperimentsOutput) GoString() string { return s.String() } -// SetAcceleratorTypes sets the AcceleratorTypes field's value. -func (s *DescribeNotebookInstanceOutput) SetAcceleratorTypes(v []*string) *DescribeNotebookInstanceOutput { - s.AcceleratorTypes = v +// SetExperimentSummaries sets the ExperimentSummaries field's value. +func (s *ListExperimentsOutput) SetExperimentSummaries(v []*ExperimentSummary) *ListExperimentsOutput { + s.ExperimentSummaries = v return s } -// SetAdditionalCodeRepositories sets the AdditionalCodeRepositories field's value. -func (s *DescribeNotebookInstanceOutput) SetAdditionalCodeRepositories(v []*string) *DescribeNotebookInstanceOutput { - s.AdditionalCodeRepositories = v +// SetNextToken sets the NextToken field's value. +func (s *ListExperimentsOutput) SetNextToken(v string) *ListExperimentsOutput { + s.NextToken = &v return s } -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeNotebookInstanceOutput) SetCreationTime(v time.Time) *DescribeNotebookInstanceOutput { - s.CreationTime = &v - return s -} +type ListFlowDefinitionsInput struct { + _ struct{} `type:"structure"` -// SetDefaultCodeRepository sets the DefaultCodeRepository field's value. -func (s *DescribeNotebookInstanceOutput) SetDefaultCodeRepository(v string) *DescribeNotebookInstanceOutput { - s.DefaultCodeRepository = &v - return s -} + // A filter that returns only flow definitions with a creation time greater + // than or equal to the specified timestamp. + CreationTimeAfter *time.Time `type:"timestamp"` -// SetDirectInternetAccess sets the DirectInternetAccess field's value. -func (s *DescribeNotebookInstanceOutput) SetDirectInternetAccess(v string) *DescribeNotebookInstanceOutput { - s.DirectInternetAccess = &v - return s -} + // A filter that returns only flow definitions that were created before the + // specified timestamp. + CreationTimeBefore *time.Time `type:"timestamp"` -// SetFailureReason sets the FailureReason field's value. -func (s *DescribeNotebookInstanceOutput) SetFailureReason(v string) *DescribeNotebookInstanceOutput { - s.FailureReason = &v - return s -} + // The total number of items to return. If the total number of available items + // is more than the value specified in MaxResults, then a NextToken will be + // provided in the output that you can use to resume pagination. + MaxResults *int64 `min:"1" type:"integer"` -// SetInstanceType sets the InstanceType field's value. -func (s *DescribeNotebookInstanceOutput) SetInstanceType(v string) *DescribeNotebookInstanceOutput { - s.InstanceType = &v - return s + // A token to resume pagination. + NextToken *string `type:"string"` + + // An optional value that specifies whether you want the results sorted in Ascending + // or Descending order. + SortOrder *string `type:"string" enum:"SortOrder"` } -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *DescribeNotebookInstanceOutput) SetKmsKeyId(v string) *DescribeNotebookInstanceOutput { - s.KmsKeyId = &v - return s +// String returns the string representation +func (s ListFlowDefinitionsInput) String() string { + return awsutil.Prettify(s) } -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *DescribeNotebookInstanceOutput) SetLastModifiedTime(v time.Time) *DescribeNotebookInstanceOutput { - s.LastModifiedTime = &v - return s +// GoString returns the string representation +func (s ListFlowDefinitionsInput) GoString() string { + return s.String() } -// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. -func (s *DescribeNotebookInstanceOutput) SetNetworkInterfaceId(v string) *DescribeNotebookInstanceOutput { - s.NetworkInterfaceId = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListFlowDefinitionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListFlowDefinitionsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetNotebookInstanceArn sets the NotebookInstanceArn field's value. -func (s *DescribeNotebookInstanceOutput) SetNotebookInstanceArn(v string) *DescribeNotebookInstanceOutput { - s.NotebookInstanceArn = &v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListFlowDefinitionsInput) SetCreationTimeAfter(v time.Time) *ListFlowDefinitionsInput { + s.CreationTimeAfter = &v return s } -// SetNotebookInstanceLifecycleConfigName sets the NotebookInstanceLifecycleConfigName field's value. -func (s *DescribeNotebookInstanceOutput) SetNotebookInstanceLifecycleConfigName(v string) *DescribeNotebookInstanceOutput { - s.NotebookInstanceLifecycleConfigName = &v +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListFlowDefinitionsInput) SetCreationTimeBefore(v time.Time) *ListFlowDefinitionsInput { + s.CreationTimeBefore = &v return s } -// SetNotebookInstanceName sets the NotebookInstanceName field's value. -func (s *DescribeNotebookInstanceOutput) SetNotebookInstanceName(v string) *DescribeNotebookInstanceOutput { - s.NotebookInstanceName = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListFlowDefinitionsInput) SetMaxResults(v int64) *ListFlowDefinitionsInput { + s.MaxResults = &v return s } -// SetNotebookInstanceStatus sets the NotebookInstanceStatus field's value. -func (s *DescribeNotebookInstanceOutput) SetNotebookInstanceStatus(v string) *DescribeNotebookInstanceOutput { - s.NotebookInstanceStatus = &v +// SetNextToken sets the NextToken field's value. +func (s *ListFlowDefinitionsInput) SetNextToken(v string) *ListFlowDefinitionsInput { + s.NextToken = &v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *DescribeNotebookInstanceOutput) SetRoleArn(v string) *DescribeNotebookInstanceOutput { - s.RoleArn = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListFlowDefinitionsInput) SetSortOrder(v string) *ListFlowDefinitionsInput { + s.SortOrder = &v return s } -// SetRootAccess sets the RootAccess field's value. -func (s *DescribeNotebookInstanceOutput) SetRootAccess(v string) *DescribeNotebookInstanceOutput { - s.RootAccess = &v - return s +type ListFlowDefinitionsOutput struct { + _ struct{} `type:"structure"` + + // An array of objects describing the flow definitions. + // + // FlowDefinitionSummaries is a required field + FlowDefinitionSummaries []*FlowDefinitionSummary `type:"list" required:"true"` + + // A token to resume pagination. + NextToken *string `type:"string"` } -// SetSecurityGroups sets the SecurityGroups field's value. -func (s *DescribeNotebookInstanceOutput) SetSecurityGroups(v []*string) *DescribeNotebookInstanceOutput { - s.SecurityGroups = v - return s +// String returns the string representation +func (s ListFlowDefinitionsOutput) String() string { + return awsutil.Prettify(s) } -// SetSubnetId sets the SubnetId field's value. -func (s *DescribeNotebookInstanceOutput) SetSubnetId(v string) *DescribeNotebookInstanceOutput { - s.SubnetId = &v - return s +// GoString returns the string representation +func (s ListFlowDefinitionsOutput) GoString() string { + return s.String() } -// SetUrl sets the Url field's value. -func (s *DescribeNotebookInstanceOutput) SetUrl(v string) *DescribeNotebookInstanceOutput { - s.Url = &v +// SetFlowDefinitionSummaries sets the FlowDefinitionSummaries field's value. +func (s *ListFlowDefinitionsOutput) SetFlowDefinitionSummaries(v []*FlowDefinitionSummary) *ListFlowDefinitionsOutput { + s.FlowDefinitionSummaries = v return s } -// SetVolumeSizeInGB sets the VolumeSizeInGB field's value. -func (s *DescribeNotebookInstanceOutput) SetVolumeSizeInGB(v int64) *DescribeNotebookInstanceOutput { - s.VolumeSizeInGB = &v +// SetNextToken sets the NextToken field's value. +func (s *ListFlowDefinitionsOutput) SetNextToken(v string) *ListFlowDefinitionsOutput { + s.NextToken = &v return s } -type DescribeSubscribedWorkteamInput struct { +type ListHumanTaskUisInput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the subscribed work team to describe. - // - // WorkteamArn is a required field - WorkteamArn *string `type:"string" required:"true"` + // A filter that returns only human task user interfaces with a creation time + // greater than or equal to the specified timestamp. + CreationTimeAfter *time.Time `type:"timestamp"` + + // A filter that returns only human task user interfaces that were created before + // the specified timestamp. + CreationTimeBefore *time.Time `type:"timestamp"` + + // The total number of items to return. If the total number of available items + // is more than the value specified in MaxResults, then a NextToken will be + // provided in the output that you can use to resume pagination. + MaxResults *int64 `min:"1" type:"integer"` + + // A token to resume pagination. + NextToken *string `type:"string"` + + // An optional value that specifies whether you want the results sorted in Ascending + // or Descending order. + SortOrder *string `type:"string" enum:"SortOrder"` } // String returns the string representation -func (s DescribeSubscribedWorkteamInput) String() string { +func (s ListHumanTaskUisInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeSubscribedWorkteamInput) GoString() string { +func (s ListHumanTaskUisInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeSubscribedWorkteamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeSubscribedWorkteamInput"} - if s.WorkteamArn == nil { - invalidParams.Add(request.NewErrParamRequired("WorkteamArn")) +func (s *ListHumanTaskUisInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListHumanTaskUisInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -13843,64 +32584,126 @@ func (s *DescribeSubscribedWorkteamInput) Validate() error { return nil } -// SetWorkteamArn sets the WorkteamArn field's value. -func (s *DescribeSubscribedWorkteamInput) SetWorkteamArn(v string) *DescribeSubscribedWorkteamInput { - s.WorkteamArn = &v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListHumanTaskUisInput) SetCreationTimeAfter(v time.Time) *ListHumanTaskUisInput { + s.CreationTimeAfter = &v return s } -type DescribeSubscribedWorkteamOutput struct { +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListHumanTaskUisInput) SetCreationTimeBefore(v time.Time) *ListHumanTaskUisInput { + s.CreationTimeBefore = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListHumanTaskUisInput) SetMaxResults(v int64) *ListHumanTaskUisInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListHumanTaskUisInput) SetNextToken(v string) *ListHumanTaskUisInput { + s.NextToken = &v + return s +} + +// SetSortOrder sets the SortOrder field's value. +func (s *ListHumanTaskUisInput) SetSortOrder(v string) *ListHumanTaskUisInput { + s.SortOrder = &v + return s +} + +type ListHumanTaskUisOutput struct { _ struct{} `type:"structure"` - // A Workteam instance that contains information about the work team. + // An array of objects describing the human task user interfaces. // - // SubscribedWorkteam is a required field - SubscribedWorkteam *SubscribedWorkteam `type:"structure" required:"true"` + // HumanTaskUiSummaries is a required field + HumanTaskUiSummaries []*HumanTaskUiSummary `type:"list" required:"true"` + + // A token to resume pagination. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeSubscribedWorkteamOutput) String() string { +func (s ListHumanTaskUisOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeSubscribedWorkteamOutput) GoString() string { +func (s ListHumanTaskUisOutput) GoString() string { return s.String() } -// SetSubscribedWorkteam sets the SubscribedWorkteam field's value. -func (s *DescribeSubscribedWorkteamOutput) SetSubscribedWorkteam(v *SubscribedWorkteam) *DescribeSubscribedWorkteamOutput { - s.SubscribedWorkteam = v +// SetHumanTaskUiSummaries sets the HumanTaskUiSummaries field's value. +func (s *ListHumanTaskUisOutput) SetHumanTaskUiSummaries(v []*HumanTaskUiSummary) *ListHumanTaskUisOutput { + s.HumanTaskUiSummaries = v return s } -type DescribeTrainingJobInput struct { +// SetNextToken sets the NextToken field's value. +func (s *ListHumanTaskUisOutput) SetNextToken(v string) *ListHumanTaskUisOutput { + s.NextToken = &v + return s +} + +type ListHyperParameterTuningJobsInput struct { _ struct{} `type:"structure"` - // The name of the training job. - // - // TrainingJobName is a required field - TrainingJobName *string `min:"1" type:"string" required:"true"` + // A filter that returns only tuning jobs that were created after the specified + // time. + CreationTimeAfter *time.Time `type:"timestamp"` + + // A filter that returns only tuning jobs that were created before the specified + // time. + CreationTimeBefore *time.Time `type:"timestamp"` + + // A filter that returns only tuning jobs that were modified after the specified + // time. + LastModifiedTimeAfter *time.Time `type:"timestamp"` + + // A filter that returns only tuning jobs that were modified before the specified + // time. + LastModifiedTimeBefore *time.Time `type:"timestamp"` + + // The maximum number of tuning jobs to return. The default value is 10. + MaxResults *int64 `min:"1" type:"integer"` + + // A string in the tuning job name. This filter returns only tuning jobs whose + // name contains the specified string. + NameContains *string `type:"string"` + + // If the result of the previous ListHyperParameterTuningJobs request was truncated, + // the response includes a NextToken. To retrieve the next set of tuning jobs, + // use the token in the next request. + NextToken *string `type:"string"` + + // The field to sort results by. The default is Name. + SortBy *string `type:"string" enum:"HyperParameterTuningJobSortByOptions"` + + // The sort order for results. The default is Ascending. + SortOrder *string `type:"string" enum:"SortOrder"` + + // A filter that returns only tuning jobs with the specified status. + StatusEquals *string `type:"string" enum:"HyperParameterTuningJobStatus"` } // String returns the string representation -func (s DescribeTrainingJobInput) String() string { +func (s ListHyperParameterTuningJobsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeTrainingJobInput) GoString() string { +func (s ListHyperParameterTuningJobsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTrainingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTrainingJobInput"} - if s.TrainingJobName == nil { - invalidParams.Add(request.NewErrParamRequired("TrainingJobName")) - } - if s.TrainingJobName != nil && len(*s.TrainingJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TrainingJobName", 1)) +func (s *ListHyperParameterTuningJobsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListHyperParameterTuningJobsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -13909,436 +32712,453 @@ func (s *DescribeTrainingJobInput) Validate() error { return nil } -// SetTrainingJobName sets the TrainingJobName field's value. -func (s *DescribeTrainingJobInput) SetTrainingJobName(v string) *DescribeTrainingJobInput { - s.TrainingJobName = &v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListHyperParameterTuningJobsInput) SetCreationTimeAfter(v time.Time) *ListHyperParameterTuningJobsInput { + s.CreationTimeAfter = &v return s } -type DescribeTrainingJobOutput struct { - _ struct{} `type:"structure"` +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListHyperParameterTuningJobsInput) SetCreationTimeBefore(v time.Time) *ListHyperParameterTuningJobsInput { + s.CreationTimeBefore = &v + return s +} - // Information about the algorithm used for training, and algorithm metadata. - // - // AlgorithmSpecification is a required field - AlgorithmSpecification *AlgorithmSpecification `type:"structure" required:"true"` +// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. +func (s *ListHyperParameterTuningJobsInput) SetLastModifiedTimeAfter(v time.Time) *ListHyperParameterTuningJobsInput { + s.LastModifiedTimeAfter = &v + return s +} - // The billable time in seconds. - // - // You can calculate the savings from using managed spot training using the - // formula (1 - BillableTimeInSeconds / TrainingTimeInSeconds) * 100. For example, - // if BillableTimeInSeconds is 100 and TrainingTimeInSeconds is 500, the savings - // is 80%. - BillableTimeInSeconds *int64 `min:"1" type:"integer"` +// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. +func (s *ListHyperParameterTuningJobsInput) SetLastModifiedTimeBefore(v time.Time) *ListHyperParameterTuningJobsInput { + s.LastModifiedTimeBefore = &v + return s +} - // Contains information about the output location for managed spot training - // checkpoint data. - CheckpointConfig *CheckpointConfig `type:"structure"` +// SetMaxResults sets the MaxResults field's value. +func (s *ListHyperParameterTuningJobsInput) SetMaxResults(v int64) *ListHyperParameterTuningJobsInput { + s.MaxResults = &v + return s +} - // A timestamp that indicates when the training job was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` +// SetNameContains sets the NameContains field's value. +func (s *ListHyperParameterTuningJobsInput) SetNameContains(v string) *ListHyperParameterTuningJobsInput { + s.NameContains = &v + return s +} - // To encrypt all communications between ML compute instances in distributed - // training, choose True. Encryption provides greater security for distributed - // training, but training might take longer. How long it takes depends on the - // amount of communication between compute instances, especially if you use - // a deep learning algorithms in distributed training. - EnableInterContainerTrafficEncryption *bool `type:"boolean"` +// SetNextToken sets the NextToken field's value. +func (s *ListHyperParameterTuningJobsInput) SetNextToken(v string) *ListHyperParameterTuningJobsInput { + s.NextToken = &v + return s +} - // A Boolean indicating whether managed spot training is enabled (True) or not - // (False). - EnableManagedSpotTraining *bool `type:"boolean"` +// SetSortBy sets the SortBy field's value. +func (s *ListHyperParameterTuningJobsInput) SetSortBy(v string) *ListHyperParameterTuningJobsInput { + s.SortBy = &v + return s +} - // If you want to allow inbound or outbound network calls, except for calls - // between peers within a training cluster for distributed training, choose - // True. If you enable network isolation for training jobs that are configured - // to use a VPC, Amazon SageMaker downloads and uploads customer data and model - // artifacts through the specified VPC, but the training container does not - // have network access. - // - // The Semantic Segmentation built-in algorithm does not support network isolation. - EnableNetworkIsolation *bool `type:"boolean"` +// SetSortOrder sets the SortOrder field's value. +func (s *ListHyperParameterTuningJobsInput) SetSortOrder(v string) *ListHyperParameterTuningJobsInput { + s.SortOrder = &v + return s +} - // If the training job failed, the reason it failed. - FailureReason *string `type:"string"` +// SetStatusEquals sets the StatusEquals field's value. +func (s *ListHyperParameterTuningJobsInput) SetStatusEquals(v string) *ListHyperParameterTuningJobsInput { + s.StatusEquals = &v + return s +} - // A collection of MetricData objects that specify the names, values, and dates - // and times that the training algorithm emitted to Amazon CloudWatch. - FinalMetricDataList []*MetricData `type:"list"` +type ListHyperParameterTuningJobsOutput struct { + _ struct{} `type:"structure"` - // Algorithm-specific parameters. - HyperParameters map[string]*string `type:"map"` + // A list of HyperParameterTuningJobSummary objects that describe the tuning + // jobs that the ListHyperParameterTuningJobs request returned. + // + // HyperParameterTuningJobSummaries is a required field + HyperParameterTuningJobSummaries []*HyperParameterTuningJobSummary `type:"list" required:"true"` - // An array of Channel objects that describes each data input channel. - InputDataConfig []*Channel `min:"1" type:"list"` + // If the result of this ListHyperParameterTuningJobs request was truncated, + // the response includes a NextToken. To retrieve the next set of tuning jobs, + // use the token in the next request. + NextToken *string `type:"string"` +} - // The Amazon Resource Name (ARN) of the Amazon SageMaker Ground Truth labeling - // job that created the transform or training job. - LabelingJobArn *string `type:"string"` +// String returns the string representation +func (s ListHyperParameterTuningJobsOutput) String() string { + return awsutil.Prettify(s) +} - // A timestamp that indicates when the status of the training job was last modified. - LastModifiedTime *time.Time `type:"timestamp"` +// GoString returns the string representation +func (s ListHyperParameterTuningJobsOutput) GoString() string { + return s.String() +} - // Information about the Amazon S3 location that is configured for storing model - // artifacts. - // - // ModelArtifacts is a required field - ModelArtifacts *ModelArtifacts `type:"structure" required:"true"` +// SetHyperParameterTuningJobSummaries sets the HyperParameterTuningJobSummaries field's value. +func (s *ListHyperParameterTuningJobsOutput) SetHyperParameterTuningJobSummaries(v []*HyperParameterTuningJobSummary) *ListHyperParameterTuningJobsOutput { + s.HyperParameterTuningJobSummaries = v + return s +} - // The S3 path where model artifacts that you configured when creating the job - // are stored. Amazon SageMaker creates subfolders for model artifacts. - OutputDataConfig *OutputDataConfig `type:"structure"` +// SetNextToken sets the NextToken field's value. +func (s *ListHyperParameterTuningJobsOutput) SetNextToken(v string) *ListHyperParameterTuningJobsOutput { + s.NextToken = &v + return s +} - // Resources, including ML compute instances and ML storage volumes, that are - // configured for model training. - // - // ResourceConfig is a required field - ResourceConfig *ResourceConfig `type:"structure" required:"true"` +type ListLabelingJobsForWorkteamInput struct { + _ struct{} `type:"structure"` - // The AWS Identity and Access Management (IAM) role configured for the training - // job. - RoleArn *string `min:"20" type:"string"` + // A filter that returns only labeling jobs created after the specified time + // (timestamp). + CreationTimeAfter *time.Time `type:"timestamp"` - // Provides detailed information about the state of the training job. For detailed - // information on the secondary status of the training job, see StatusMessage - // under SecondaryStatusTransition. - // - // Amazon SageMaker provides primary statuses and secondary statuses that apply - // to each of them: - // - // InProgress - // - // * Starting - Starting the training job. - // - // * Downloading - An optional stage for algorithms that support File training - // input mode. It indicates that data is being downloaded to the ML storage - // volumes. - // - // * Training - Training is in progress. - // - // * Interrupted - The job stopped because the managed spot training instances - // were interrupted. - // - // * Uploading - Training is complete and the model artifacts are being uploaded - // to the S3 location. - // - // Completed - // - // * Completed - The training job has completed. - // - // Failed - // - // * Failed - The training job has failed. The reason for the failure is - // returned in the FailureReason field of DescribeTrainingJobResponse. - // - // Stopped - // - // * MaxRuntimeExceeded - The job stopped because it exceeded the maximum - // allowed runtime. - // - // * MaxWaitTmeExceeded - The job stopped because it exceeded the maximum - // allowed wait time. - // - // * Stopped - The training job has stopped. - // - // Stopping - // - // * Stopping - Stopping the training job. - // - // Valid values for SecondaryStatus are subject to change. - // - // We no longer support the following secondary statuses: - // - // * LaunchingMLInstances - // - // * PreparingTrainingStack - // - // * DownloadingTrainingImage - // - // SecondaryStatus is a required field - SecondaryStatus *string `type:"string" required:"true" enum:"SecondaryStatus"` + // A filter that returns only labeling jobs created before the specified time + // (timestamp). + CreationTimeBefore *time.Time `type:"timestamp"` - // A history of all of the secondary statuses that the training job has transitioned - // through. - SecondaryStatusTransitions []*SecondaryStatusTransition `type:"list"` + // A filter the limits jobs to only the ones whose job reference code contains + // the specified string. + JobReferenceCodeContains *string `min:"1" type:"string"` - // Specifies a limit to how long a model training job can run. It also specifies - // the maximum time to wait for a spot instance. When the job reaches the time - // limit, Amazon SageMaker ends the training job. Use this API to cap model - // training costs. - // - // To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal, which - // delays job termination for 120 seconds. Algorithms can use this 120-second - // window to save the model artifacts, so the results of training are not lost. - // - // StoppingCondition is a required field - StoppingCondition *StoppingCondition `type:"structure" required:"true"` + // The maximum number of labeling jobs to return in each page of the response. + MaxResults *int64 `min:"1" type:"integer"` - // Indicates the time when the training job ends on training instances. You - // are billed for the time interval between the value of TrainingStartTime and - // this time. For successful jobs and stopped jobs, this is the time after model - // artifacts are uploaded. For failed jobs, this is the time when Amazon SageMaker - // detects a job failure. - TrainingEndTime *time.Time `type:"timestamp"` + // If the result of the previous ListLabelingJobsForWorkteam request was truncated, + // the response includes a NextToken. To retrieve the next set of labeling jobs, + // use the token in the next request. + NextToken *string `type:"string"` - // The Amazon Resource Name (ARN) of the training job. - // - // TrainingJobArn is a required field - TrainingJobArn *string `type:"string" required:"true"` + // The field to sort results by. The default is CreationTime. + SortBy *string `type:"string" enum:"ListLabelingJobsForWorkteamSortByOptions"` - // Name of the model training job. - // - // TrainingJobName is a required field - TrainingJobName *string `min:"1" type:"string" required:"true"` + // The sort order for results. The default is Ascending. + SortOrder *string `type:"string" enum:"SortOrder"` - // The status of the training job. - // - // Amazon SageMaker provides the following training job statuses: - // - // * InProgress - The training is in progress. - // - // * Completed - The training job has completed. - // - // * Failed - The training job has failed. To see the reason for the failure, - // see the FailureReason field in the response to a DescribeTrainingJobResponse - // call. - // - // * Stopping - The training job is stopping. - // - // * Stopped - The training job has stopped. - // - // For more detailed information, see SecondaryStatus. + // The Amazon Resource Name (ARN) of the work team for which you want to see + // labeling jobs for. // - // TrainingJobStatus is a required field - TrainingJobStatus *string `type:"string" required:"true" enum:"TrainingJobStatus"` + // WorkteamArn is a required field + WorkteamArn *string `type:"string" required:"true"` +} - // Indicates the time when the training job starts on training instances. You - // are billed for the time interval between this time and the value of TrainingEndTime. - // The start time in CloudWatch Logs might be later than this time. The difference - // is due to the time it takes to download the training data and to the size - // of the training container. - TrainingStartTime *time.Time `type:"timestamp"` +// String returns the string representation +func (s ListLabelingJobsForWorkteamInput) String() string { + return awsutil.Prettify(s) +} - // The training time in seconds. - TrainingTimeInSeconds *int64 `min:"1" type:"integer"` +// GoString returns the string representation +func (s ListLabelingJobsForWorkteamInput) GoString() string { + return s.String() +} - // The Amazon Resource Name (ARN) of the associated hyperparameter tuning job - // if the training job was launched by a hyperparameter tuning job. - TuningJobArn *string `type:"string"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListLabelingJobsForWorkteamInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListLabelingJobsForWorkteamInput"} + if s.JobReferenceCodeContains != nil && len(*s.JobReferenceCodeContains) < 1 { + invalidParams.Add(request.NewErrParamMinLen("JobReferenceCodeContains", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.WorkteamArn == nil { + invalidParams.Add(request.NewErrParamRequired("WorkteamArn")) + } - // A VpcConfig object that specifies the VPC that this training job has access - // to. For more information, see Protect Training Jobs by Using an Amazon Virtual - // Private Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html). - VpcConfig *VpcConfig `type:"structure"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// String returns the string representation -func (s DescribeTrainingJobOutput) String() string { - return awsutil.Prettify(s) +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListLabelingJobsForWorkteamInput) SetCreationTimeAfter(v time.Time) *ListLabelingJobsForWorkteamInput { + s.CreationTimeAfter = &v + return s } -// GoString returns the string representation -func (s DescribeTrainingJobOutput) GoString() string { - return s.String() +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListLabelingJobsForWorkteamInput) SetCreationTimeBefore(v time.Time) *ListLabelingJobsForWorkteamInput { + s.CreationTimeBefore = &v + return s } -// SetAlgorithmSpecification sets the AlgorithmSpecification field's value. -func (s *DescribeTrainingJobOutput) SetAlgorithmSpecification(v *AlgorithmSpecification) *DescribeTrainingJobOutput { - s.AlgorithmSpecification = v +// SetJobReferenceCodeContains sets the JobReferenceCodeContains field's value. +func (s *ListLabelingJobsForWorkteamInput) SetJobReferenceCodeContains(v string) *ListLabelingJobsForWorkteamInput { + s.JobReferenceCodeContains = &v return s } -// SetBillableTimeInSeconds sets the BillableTimeInSeconds field's value. -func (s *DescribeTrainingJobOutput) SetBillableTimeInSeconds(v int64) *DescribeTrainingJobOutput { - s.BillableTimeInSeconds = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListLabelingJobsForWorkteamInput) SetMaxResults(v int64) *ListLabelingJobsForWorkteamInput { + s.MaxResults = &v return s } -// SetCheckpointConfig sets the CheckpointConfig field's value. -func (s *DescribeTrainingJobOutput) SetCheckpointConfig(v *CheckpointConfig) *DescribeTrainingJobOutput { - s.CheckpointConfig = v +// SetNextToken sets the NextToken field's value. +func (s *ListLabelingJobsForWorkteamInput) SetNextToken(v string) *ListLabelingJobsForWorkteamInput { + s.NextToken = &v return s } -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeTrainingJobOutput) SetCreationTime(v time.Time) *DescribeTrainingJobOutput { - s.CreationTime = &v +// SetSortBy sets the SortBy field's value. +func (s *ListLabelingJobsForWorkteamInput) SetSortBy(v string) *ListLabelingJobsForWorkteamInput { + s.SortBy = &v return s } -// SetEnableInterContainerTrafficEncryption sets the EnableInterContainerTrafficEncryption field's value. -func (s *DescribeTrainingJobOutput) SetEnableInterContainerTrafficEncryption(v bool) *DescribeTrainingJobOutput { - s.EnableInterContainerTrafficEncryption = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListLabelingJobsForWorkteamInput) SetSortOrder(v string) *ListLabelingJobsForWorkteamInput { + s.SortOrder = &v return s } -// SetEnableManagedSpotTraining sets the EnableManagedSpotTraining field's value. -func (s *DescribeTrainingJobOutput) SetEnableManagedSpotTraining(v bool) *DescribeTrainingJobOutput { - s.EnableManagedSpotTraining = &v +// SetWorkteamArn sets the WorkteamArn field's value. +func (s *ListLabelingJobsForWorkteamInput) SetWorkteamArn(v string) *ListLabelingJobsForWorkteamInput { + s.WorkteamArn = &v return s } -// SetEnableNetworkIsolation sets the EnableNetworkIsolation field's value. -func (s *DescribeTrainingJobOutput) SetEnableNetworkIsolation(v bool) *DescribeTrainingJobOutput { - s.EnableNetworkIsolation = &v - return s +type ListLabelingJobsForWorkteamOutput struct { + _ struct{} `type:"structure"` + + // An array of LabelingJobSummary objects, each describing a labeling job. + // + // LabelingJobSummaryList is a required field + LabelingJobSummaryList []*LabelingJobForWorkteamSummary `type:"list" required:"true"` + + // If the response is truncated, Amazon SageMaker returns this token. To retrieve + // the next set of labeling jobs, use it in the subsequent request. + NextToken *string `type:"string"` } -// SetFailureReason sets the FailureReason field's value. -func (s *DescribeTrainingJobOutput) SetFailureReason(v string) *DescribeTrainingJobOutput { - s.FailureReason = &v - return s +// String returns the string representation +func (s ListLabelingJobsForWorkteamOutput) String() string { + return awsutil.Prettify(s) } -// SetFinalMetricDataList sets the FinalMetricDataList field's value. -func (s *DescribeTrainingJobOutput) SetFinalMetricDataList(v []*MetricData) *DescribeTrainingJobOutput { - s.FinalMetricDataList = v - return s +// GoString returns the string representation +func (s ListLabelingJobsForWorkteamOutput) GoString() string { + return s.String() } -// SetHyperParameters sets the HyperParameters field's value. -func (s *DescribeTrainingJobOutput) SetHyperParameters(v map[string]*string) *DescribeTrainingJobOutput { - s.HyperParameters = v +// SetLabelingJobSummaryList sets the LabelingJobSummaryList field's value. +func (s *ListLabelingJobsForWorkteamOutput) SetLabelingJobSummaryList(v []*LabelingJobForWorkteamSummary) *ListLabelingJobsForWorkteamOutput { + s.LabelingJobSummaryList = v return s } -// SetInputDataConfig sets the InputDataConfig field's value. -func (s *DescribeTrainingJobOutput) SetInputDataConfig(v []*Channel) *DescribeTrainingJobOutput { - s.InputDataConfig = v +// SetNextToken sets the NextToken field's value. +func (s *ListLabelingJobsForWorkteamOutput) SetNextToken(v string) *ListLabelingJobsForWorkteamOutput { + s.NextToken = &v return s } -// SetLabelingJobArn sets the LabelingJobArn field's value. -func (s *DescribeTrainingJobOutput) SetLabelingJobArn(v string) *DescribeTrainingJobOutput { - s.LabelingJobArn = &v - return s +type ListLabelingJobsInput struct { + _ struct{} `type:"structure"` + + // A filter that returns only labeling jobs created after the specified time + // (timestamp). + CreationTimeAfter *time.Time `type:"timestamp"` + + // A filter that returns only labeling jobs created before the specified time + // (timestamp). + CreationTimeBefore *time.Time `type:"timestamp"` + + // A filter that returns only labeling jobs modified after the specified time + // (timestamp). + LastModifiedTimeAfter *time.Time `type:"timestamp"` + + // A filter that returns only labeling jobs modified before the specified time + // (timestamp). + LastModifiedTimeBefore *time.Time `type:"timestamp"` + + // The maximum number of labeling jobs to return in each page of the response. + MaxResults *int64 `min:"1" type:"integer"` + + // A string in the labeling job name. This filter returns only labeling jobs + // whose name contains the specified string. + NameContains *string `type:"string"` + + // If the result of the previous ListLabelingJobs request was truncated, the + // response includes a NextToken. To retrieve the next set of labeling jobs, + // use the token in the next request. + NextToken *string `type:"string"` + + // The field to sort results by. The default is CreationTime. + SortBy *string `type:"string" enum:"SortBy"` + + // The sort order for results. The default is Ascending. + SortOrder *string `type:"string" enum:"SortOrder"` + + // A filter that retrieves only labeling jobs with a specific status. + StatusEquals *string `type:"string" enum:"LabelingJobStatus"` } -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *DescribeTrainingJobOutput) SetLastModifiedTime(v time.Time) *DescribeTrainingJobOutput { - s.LastModifiedTime = &v - return s +// String returns the string representation +func (s ListLabelingJobsInput) String() string { + return awsutil.Prettify(s) } -// SetModelArtifacts sets the ModelArtifacts field's value. -func (s *DescribeTrainingJobOutput) SetModelArtifacts(v *ModelArtifacts) *DescribeTrainingJobOutput { - s.ModelArtifacts = v - return s +// GoString returns the string representation +func (s ListLabelingJobsInput) GoString() string { + return s.String() } -// SetOutputDataConfig sets the OutputDataConfig field's value. -func (s *DescribeTrainingJobOutput) SetOutputDataConfig(v *OutputDataConfig) *DescribeTrainingJobOutput { - s.OutputDataConfig = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListLabelingJobsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListLabelingJobsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetResourceConfig sets the ResourceConfig field's value. -func (s *DescribeTrainingJobOutput) SetResourceConfig(v *ResourceConfig) *DescribeTrainingJobOutput { - s.ResourceConfig = v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListLabelingJobsInput) SetCreationTimeAfter(v time.Time) *ListLabelingJobsInput { + s.CreationTimeAfter = &v return s } -// SetRoleArn sets the RoleArn field's value. -func (s *DescribeTrainingJobOutput) SetRoleArn(v string) *DescribeTrainingJobOutput { - s.RoleArn = &v +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListLabelingJobsInput) SetCreationTimeBefore(v time.Time) *ListLabelingJobsInput { + s.CreationTimeBefore = &v return s } -// SetSecondaryStatus sets the SecondaryStatus field's value. -func (s *DescribeTrainingJobOutput) SetSecondaryStatus(v string) *DescribeTrainingJobOutput { - s.SecondaryStatus = &v +// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. +func (s *ListLabelingJobsInput) SetLastModifiedTimeAfter(v time.Time) *ListLabelingJobsInput { + s.LastModifiedTimeAfter = &v return s } -// SetSecondaryStatusTransitions sets the SecondaryStatusTransitions field's value. -func (s *DescribeTrainingJobOutput) SetSecondaryStatusTransitions(v []*SecondaryStatusTransition) *DescribeTrainingJobOutput { - s.SecondaryStatusTransitions = v +// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. +func (s *ListLabelingJobsInput) SetLastModifiedTimeBefore(v time.Time) *ListLabelingJobsInput { + s.LastModifiedTimeBefore = &v return s } -// SetStoppingCondition sets the StoppingCondition field's value. -func (s *DescribeTrainingJobOutput) SetStoppingCondition(v *StoppingCondition) *DescribeTrainingJobOutput { - s.StoppingCondition = v +// SetMaxResults sets the MaxResults field's value. +func (s *ListLabelingJobsInput) SetMaxResults(v int64) *ListLabelingJobsInput { + s.MaxResults = &v return s } -// SetTrainingEndTime sets the TrainingEndTime field's value. -func (s *DescribeTrainingJobOutput) SetTrainingEndTime(v time.Time) *DescribeTrainingJobOutput { - s.TrainingEndTime = &v +// SetNameContains sets the NameContains field's value. +func (s *ListLabelingJobsInput) SetNameContains(v string) *ListLabelingJobsInput { + s.NameContains = &v return s } -// SetTrainingJobArn sets the TrainingJobArn field's value. -func (s *DescribeTrainingJobOutput) SetTrainingJobArn(v string) *DescribeTrainingJobOutput { - s.TrainingJobArn = &v +// SetNextToken sets the NextToken field's value. +func (s *ListLabelingJobsInput) SetNextToken(v string) *ListLabelingJobsInput { + s.NextToken = &v return s } -// SetTrainingJobName sets the TrainingJobName field's value. -func (s *DescribeTrainingJobOutput) SetTrainingJobName(v string) *DescribeTrainingJobOutput { - s.TrainingJobName = &v +// SetSortBy sets the SortBy field's value. +func (s *ListLabelingJobsInput) SetSortBy(v string) *ListLabelingJobsInput { + s.SortBy = &v return s } -// SetTrainingJobStatus sets the TrainingJobStatus field's value. -func (s *DescribeTrainingJobOutput) SetTrainingJobStatus(v string) *DescribeTrainingJobOutput { - s.TrainingJobStatus = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListLabelingJobsInput) SetSortOrder(v string) *ListLabelingJobsInput { + s.SortOrder = &v return s } -// SetTrainingStartTime sets the TrainingStartTime field's value. -func (s *DescribeTrainingJobOutput) SetTrainingStartTime(v time.Time) *DescribeTrainingJobOutput { - s.TrainingStartTime = &v +// SetStatusEquals sets the StatusEquals field's value. +func (s *ListLabelingJobsInput) SetStatusEquals(v string) *ListLabelingJobsInput { + s.StatusEquals = &v return s } -// SetTrainingTimeInSeconds sets the TrainingTimeInSeconds field's value. -func (s *DescribeTrainingJobOutput) SetTrainingTimeInSeconds(v int64) *DescribeTrainingJobOutput { - s.TrainingTimeInSeconds = &v - return s +type ListLabelingJobsOutput struct { + _ struct{} `type:"structure"` + + // An array of LabelingJobSummary objects, each describing a labeling job. + LabelingJobSummaryList []*LabelingJobSummary `type:"list"` + + // If the response is truncated, Amazon SageMaker returns this token. To retrieve + // the next set of labeling jobs, use it in the subsequent request. + NextToken *string `type:"string"` } -// SetTuningJobArn sets the TuningJobArn field's value. -func (s *DescribeTrainingJobOutput) SetTuningJobArn(v string) *DescribeTrainingJobOutput { - s.TuningJobArn = &v +// String returns the string representation +func (s ListLabelingJobsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListLabelingJobsOutput) GoString() string { + return s.String() +} + +// SetLabelingJobSummaryList sets the LabelingJobSummaryList field's value. +func (s *ListLabelingJobsOutput) SetLabelingJobSummaryList(v []*LabelingJobSummary) *ListLabelingJobsOutput { + s.LabelingJobSummaryList = v return s } -// SetVpcConfig sets the VpcConfig field's value. -func (s *DescribeTrainingJobOutput) SetVpcConfig(v *VpcConfig) *DescribeTrainingJobOutput { - s.VpcConfig = v +// SetNextToken sets the NextToken field's value. +func (s *ListLabelingJobsOutput) SetNextToken(v string) *ListLabelingJobsOutput { + s.NextToken = &v return s } -type DescribeTransformJobInput struct { +type ListModelPackagesInput struct { _ struct{} `type:"structure"` - // The name of the transform job that you want to view details of. - // - // TransformJobName is a required field - TransformJobName *string `min:"1" type:"string" required:"true"` + // A filter that returns only model packages created after the specified time + // (timestamp). + CreationTimeAfter *time.Time `type:"timestamp"` + + // A filter that returns only model packages created before the specified time + // (timestamp). + CreationTimeBefore *time.Time `type:"timestamp"` + + // The maximum number of model packages to return in the response. + MaxResults *int64 `min:"1" type:"integer"` + + // A string in the model package name. This filter returns only model packages + // whose name contains the specified string. + NameContains *string `type:"string"` + + // If the response to a previous ListModelPackages request was truncated, the + // response includes a NextToken. To retrieve the next set of model packages, + // use the token in the next request. + NextToken *string `type:"string"` + + // The parameter by which to sort the results. The default is CreationTime. + SortBy *string `type:"string" enum:"ModelPackageSortBy"` + + // The sort order for the results. The default is Ascending. + SortOrder *string `type:"string" enum:"SortOrder"` } // String returns the string representation -func (s DescribeTransformJobInput) String() string { +func (s ListModelPackagesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeTransformJobInput) GoString() string { +func (s ListModelPackagesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeTransformJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeTransformJobInput"} - if s.TransformJobName == nil { - invalidParams.Add(request.NewErrParamRequired("TransformJobName")) - } - if s.TransformJobName != nil && len(*s.TransformJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TransformJobName", 1)) +func (s *ListModelPackagesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListModelPackagesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -14347,316 +33167,277 @@ func (s *DescribeTransformJobInput) Validate() error { return nil } -// SetTransformJobName sets the TransformJobName field's value. -func (s *DescribeTransformJobInput) SetTransformJobName(v string) *DescribeTransformJobInput { - s.TransformJobName = &v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListModelPackagesInput) SetCreationTimeAfter(v time.Time) *ListModelPackagesInput { + s.CreationTimeAfter = &v return s } -type DescribeTransformJobOutput struct { - _ struct{} `type:"structure"` - - // Specifies the number of records to include in a mini-batch for an HTTP inference - // request. A record is a single unit of input data that inference can be made - // on. For example, a single line in a CSV file is a record. - // - // To enable the batch strategy, you must set SplitType to Line, RecordIO, or - // TFRecord. - BatchStrategy *string `type:"string" enum:"BatchStrategy"` - - // A timestamp that shows when the transform Job was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` - - // The data structure used to specify the data to be used for inference in a - // batch transform job and to associate the data that is relevant to the prediction - // results in the output. The input filter provided allows you to exclude input - // data that is not needed for inference in a batch transform job. The output - // filter provided allows you to include input data relevant to interpreting - // the predictions in the output from the job. For more information, see Associate - // Prediction Results with their Corresponding Input Records (https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform-data-processing.html). - DataProcessing *DataProcessing `type:"structure"` - - // The environment variables to set in the Docker container. We support up to - // 16 key and values entries in the map. - Environment map[string]*string `type:"map"` - - // If the transform job failed, FailureReason describes why it failed. A transform - // job creates a log file, which includes error messages, and stores it as an - // Amazon S3 object. For more information, see Log Amazon SageMaker Events with - // Amazon CloudWatch (https://docs.aws.amazon.com/sagemaker/latest/dg/logging-cloudwatch.html). - FailureReason *string `type:"string"` - - // The Amazon Resource Name (ARN) of the Amazon SageMaker Ground Truth labeling - // job that created the transform or training job. - LabelingJobArn *string `type:"string"` - - // The maximum number of parallel requests on each instance node that can be - // launched in a transform job. The default value is 1. - MaxConcurrentTransforms *int64 `type:"integer"` - - // The maximum payload size, in MB, used in the transform job. - MaxPayloadInMB *int64 `type:"integer"` - - // The name of the model used in the transform job. - // - // ModelName is a required field - ModelName *string `type:"string" required:"true"` +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListModelPackagesInput) SetCreationTimeBefore(v time.Time) *ListModelPackagesInput { + s.CreationTimeBefore = &v + return s +} - // Indicates when the transform job has been completed, or has stopped or failed. - // You are billed for the time interval between this time and the value of TransformStartTime. - TransformEndTime *time.Time `type:"timestamp"` +// SetMaxResults sets the MaxResults field's value. +func (s *ListModelPackagesInput) SetMaxResults(v int64) *ListModelPackagesInput { + s.MaxResults = &v + return s +} - // Describes the dataset to be transformed and the Amazon S3 location where - // it is stored. - // - // TransformInput is a required field - TransformInput *TransformInput `type:"structure" required:"true"` +// SetNameContains sets the NameContains field's value. +func (s *ListModelPackagesInput) SetNameContains(v string) *ListModelPackagesInput { + s.NameContains = &v + return s +} - // The Amazon Resource Name (ARN) of the transform job. - // - // TransformJobArn is a required field - TransformJobArn *string `type:"string" required:"true"` +// SetNextToken sets the NextToken field's value. +func (s *ListModelPackagesInput) SetNextToken(v string) *ListModelPackagesInput { + s.NextToken = &v + return s +} - // The name of the transform job. - // - // TransformJobName is a required field - TransformJobName *string `min:"1" type:"string" required:"true"` +// SetSortBy sets the SortBy field's value. +func (s *ListModelPackagesInput) SetSortBy(v string) *ListModelPackagesInput { + s.SortBy = &v + return s +} - // The status of the transform job. If the transform job failed, the reason - // is returned in the FailureReason field. - // - // TransformJobStatus is a required field - TransformJobStatus *string `type:"string" required:"true" enum:"TransformJobStatus"` +// SetSortOrder sets the SortOrder field's value. +func (s *ListModelPackagesInput) SetSortOrder(v string) *ListModelPackagesInput { + s.SortOrder = &v + return s +} - // Identifies the Amazon S3 location where you want Amazon SageMaker to save - // the results from the transform job. - TransformOutput *TransformOutput `type:"structure"` +type ListModelPackagesOutput struct { + _ struct{} `type:"structure"` - // Describes the resources, including ML instance types and ML instance count, - // to use for the transform job. + // An array of ModelPackageSummary objects, each of which lists a model package. // - // TransformResources is a required field - TransformResources *TransformResources `type:"structure" required:"true"` + // ModelPackageSummaryList is a required field + ModelPackageSummaryList []*ModelPackageSummary `type:"list" required:"true"` - // Indicates when the transform job starts on ML instances. You are billed for - // the time interval between this time and the value of TransformEndTime. - TransformStartTime *time.Time `type:"timestamp"` + // If the response is truncated, Amazon SageMaker returns this token. To retrieve + // the next set of model packages, use it in the subsequent request. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeTransformJobOutput) String() string { +func (s ListModelPackagesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeTransformJobOutput) GoString() string { +func (s ListModelPackagesOutput) GoString() string { return s.String() } -// SetBatchStrategy sets the BatchStrategy field's value. -func (s *DescribeTransformJobOutput) SetBatchStrategy(v string) *DescribeTransformJobOutput { - s.BatchStrategy = &v +// SetModelPackageSummaryList sets the ModelPackageSummaryList field's value. +func (s *ListModelPackagesOutput) SetModelPackageSummaryList(v []*ModelPackageSummary) *ListModelPackagesOutput { + s.ModelPackageSummaryList = v return s } -// SetCreationTime sets the CreationTime field's value. -func (s *DescribeTransformJobOutput) SetCreationTime(v time.Time) *DescribeTransformJobOutput { - s.CreationTime = &v +// SetNextToken sets the NextToken field's value. +func (s *ListModelPackagesOutput) SetNextToken(v string) *ListModelPackagesOutput { + s.NextToken = &v return s } -// SetDataProcessing sets the DataProcessing field's value. -func (s *DescribeTransformJobOutput) SetDataProcessing(v *DataProcessing) *DescribeTransformJobOutput { - s.DataProcessing = v - return s -} +type ListModelsInput struct { + _ struct{} `type:"structure"` -// SetEnvironment sets the Environment field's value. -func (s *DescribeTransformJobOutput) SetEnvironment(v map[string]*string) *DescribeTransformJobOutput { - s.Environment = v - return s -} + // A filter that returns only models with a creation time greater than or equal + // to the specified time (timestamp). + CreationTimeAfter *time.Time `type:"timestamp"` -// SetFailureReason sets the FailureReason field's value. -func (s *DescribeTransformJobOutput) SetFailureReason(v string) *DescribeTransformJobOutput { - s.FailureReason = &v - return s -} + // A filter that returns only models created before the specified time (timestamp). + CreationTimeBefore *time.Time `type:"timestamp"` -// SetLabelingJobArn sets the LabelingJobArn field's value. -func (s *DescribeTransformJobOutput) SetLabelingJobArn(v string) *DescribeTransformJobOutput { - s.LabelingJobArn = &v - return s + // The maximum number of models to return in the response. + MaxResults *int64 `min:"1" type:"integer"` + + // A string in the training job name. This filter returns only models in the + // training job whose name contains the specified string. + NameContains *string `type:"string"` + + // If the response to a previous ListModels request was truncated, the response + // includes a NextToken. To retrieve the next set of models, use the token in + // the next request. + NextToken *string `type:"string"` + + // Sorts the list of results. The default is CreationTime. + SortBy *string `type:"string" enum:"ModelSortKey"` + + // The sort order for results. The default is Descending. + SortOrder *string `type:"string" enum:"OrderKey"` } -// SetMaxConcurrentTransforms sets the MaxConcurrentTransforms field's value. -func (s *DescribeTransformJobOutput) SetMaxConcurrentTransforms(v int64) *DescribeTransformJobOutput { - s.MaxConcurrentTransforms = &v - return s +// String returns the string representation +func (s ListModelsInput) String() string { + return awsutil.Prettify(s) } -// SetMaxPayloadInMB sets the MaxPayloadInMB field's value. -func (s *DescribeTransformJobOutput) SetMaxPayloadInMB(v int64) *DescribeTransformJobOutput { - s.MaxPayloadInMB = &v - return s +// GoString returns the string representation +func (s ListModelsInput) GoString() string { + return s.String() } -// SetModelName sets the ModelName field's value. -func (s *DescribeTransformJobOutput) SetModelName(v string) *DescribeTransformJobOutput { - s.ModelName = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListModelsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListModelsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } -// SetTransformEndTime sets the TransformEndTime field's value. -func (s *DescribeTransformJobOutput) SetTransformEndTime(v time.Time) *DescribeTransformJobOutput { - s.TransformEndTime = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetTransformInput sets the TransformInput field's value. -func (s *DescribeTransformJobOutput) SetTransformInput(v *TransformInput) *DescribeTransformJobOutput { - s.TransformInput = v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListModelsInput) SetCreationTimeAfter(v time.Time) *ListModelsInput { + s.CreationTimeAfter = &v return s } -// SetTransformJobArn sets the TransformJobArn field's value. -func (s *DescribeTransformJobOutput) SetTransformJobArn(v string) *DescribeTransformJobOutput { - s.TransformJobArn = &v +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListModelsInput) SetCreationTimeBefore(v time.Time) *ListModelsInput { + s.CreationTimeBefore = &v return s } -// SetTransformJobName sets the TransformJobName field's value. -func (s *DescribeTransformJobOutput) SetTransformJobName(v string) *DescribeTransformJobOutput { - s.TransformJobName = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListModelsInput) SetMaxResults(v int64) *ListModelsInput { + s.MaxResults = &v return s } -// SetTransformJobStatus sets the TransformJobStatus field's value. -func (s *DescribeTransformJobOutput) SetTransformJobStatus(v string) *DescribeTransformJobOutput { - s.TransformJobStatus = &v +// SetNameContains sets the NameContains field's value. +func (s *ListModelsInput) SetNameContains(v string) *ListModelsInput { + s.NameContains = &v return s } -// SetTransformOutput sets the TransformOutput field's value. -func (s *DescribeTransformJobOutput) SetTransformOutput(v *TransformOutput) *DescribeTransformJobOutput { - s.TransformOutput = v +// SetNextToken sets the NextToken field's value. +func (s *ListModelsInput) SetNextToken(v string) *ListModelsInput { + s.NextToken = &v return s } -// SetTransformResources sets the TransformResources field's value. -func (s *DescribeTransformJobOutput) SetTransformResources(v *TransformResources) *DescribeTransformJobOutput { - s.TransformResources = v +// SetSortBy sets the SortBy field's value. +func (s *ListModelsInput) SetSortBy(v string) *ListModelsInput { + s.SortBy = &v return s } -// SetTransformStartTime sets the TransformStartTime field's value. -func (s *DescribeTransformJobOutput) SetTransformStartTime(v time.Time) *DescribeTransformJobOutput { - s.TransformStartTime = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListModelsInput) SetSortOrder(v string) *ListModelsInput { + s.SortOrder = &v return s } -type DescribeWorkteamInput struct { +type ListModelsOutput struct { _ struct{} `type:"structure"` - // The name of the work team to return a description of. + // An array of ModelSummary objects, each of which lists a model. // - // WorkteamName is a required field - WorkteamName *string `min:"1" type:"string" required:"true"` + // Models is a required field + Models []*ModelSummary `type:"list" required:"true"` + + // If the response is truncated, Amazon SageMaker returns this token. To retrieve + // the next set of models, use it in the subsequent request. + NextToken *string `type:"string"` } // String returns the string representation -func (s DescribeWorkteamInput) String() string { +func (s ListModelsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeWorkteamInput) GoString() string { +func (s ListModelsOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeWorkteamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeWorkteamInput"} - if s.WorkteamName == nil { - invalidParams.Add(request.NewErrParamRequired("WorkteamName")) - } - if s.WorkteamName != nil && len(*s.WorkteamName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkteamName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetModels sets the Models field's value. +func (s *ListModelsOutput) SetModels(v []*ModelSummary) *ListModelsOutput { + s.Models = v + return s } -// SetWorkteamName sets the WorkteamName field's value. -func (s *DescribeWorkteamInput) SetWorkteamName(v string) *DescribeWorkteamInput { - s.WorkteamName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListModelsOutput) SetNextToken(v string) *ListModelsOutput { + s.NextToken = &v return s } -type DescribeWorkteamOutput struct { +type ListMonitoringExecutionsInput struct { _ struct{} `type:"structure"` - // A Workteam instance that contains information about the work team. - // - // Workteam is a required field - Workteam *Workteam `type:"structure" required:"true"` -} + // A filter that returns only jobs created after a specified time. + CreationTimeAfter *time.Time `type:"timestamp"` -// String returns the string representation -func (s DescribeWorkteamOutput) String() string { - return awsutil.Prettify(s) -} + // A filter that returns only jobs created before a specified time. + CreationTimeBefore *time.Time `type:"timestamp"` -// GoString returns the string representation -func (s DescribeWorkteamOutput) GoString() string { - return s.String() -} + // Name of a specific endpoint to fetch jobs for. + EndpointName *string `type:"string"` -// SetWorkteam sets the Workteam field's value. -func (s *DescribeWorkteamOutput) SetWorkteam(v *Workteam) *DescribeWorkteamOutput { - s.Workteam = v - return s -} + // A filter that returns only jobs modified before a specified time. + LastModifiedTimeAfter *time.Time `type:"timestamp"` -// Specifies weight and capacity values for a production variant. -type DesiredWeightAndCapacity struct { - _ struct{} `type:"structure"` + // A filter that returns only jobs modified after a specified time. + LastModifiedTimeBefore *time.Time `type:"timestamp"` - // The variant's capacity. - DesiredInstanceCount *int64 `min:"1" type:"integer"` + // The maximum number of jobs to return in the response. The default value is + // 10. + MaxResults *int64 `min:"1" type:"integer"` - // The variant's weight. - DesiredWeight *float64 `type:"float"` + // Name of a specific schedule to fetch jobs for. + MonitoringScheduleName *string `min:"1" type:"string"` - // The name of the variant to update. - // - // VariantName is a required field - VariantName *string `type:"string" required:"true"` + // The token returned if the response is truncated. To retrieve the next set + // of job executions, use it in the next request. + NextToken *string `type:"string"` + + // Filter for jobs scheduled after a specified time. + ScheduledTimeAfter *time.Time `type:"timestamp"` + + // Filter for jobs scheduled before a specified time. + ScheduledTimeBefore *time.Time `type:"timestamp"` + + // Whether to sort results by Status, CreationTime, ScheduledTime field. The + // default is CreationTime. + SortBy *string `type:"string" enum:"MonitoringExecutionSortKey"` + + // Whether to sort the results in Ascending or Descending order. The default + // is Descending. + SortOrder *string `type:"string" enum:"SortOrder"` + + // A filter that retrieves only jobs with a specific status. + StatusEquals *string `type:"string" enum:"ExecutionStatus"` } // String returns the string representation -func (s DesiredWeightAndCapacity) String() string { +func (s ListMonitoringExecutionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DesiredWeightAndCapacity) GoString() string { +func (s ListMonitoringExecutionsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DesiredWeightAndCapacity) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DesiredWeightAndCapacity"} - if s.DesiredInstanceCount != nil && *s.DesiredInstanceCount < 1 { - invalidParams.Add(request.NewErrParamMinValue("DesiredInstanceCount", 1)) +func (s *ListMonitoringExecutionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListMonitoringExecutionsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } - if s.VariantName == nil { - invalidParams.Add(request.NewErrParamRequired("VariantName")) + if s.MonitoringScheduleName != nil && len(*s.MonitoringScheduleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MonitoringScheduleName", 1)) } if invalidParams.Len() > 0 { @@ -14665,225 +33446,180 @@ func (s *DesiredWeightAndCapacity) Validate() error { return nil } -// SetDesiredInstanceCount sets the DesiredInstanceCount field's value. -func (s *DesiredWeightAndCapacity) SetDesiredInstanceCount(v int64) *DesiredWeightAndCapacity { - s.DesiredInstanceCount = &v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListMonitoringExecutionsInput) SetCreationTimeAfter(v time.Time) *ListMonitoringExecutionsInput { + s.CreationTimeAfter = &v return s } -// SetDesiredWeight sets the DesiredWeight field's value. -func (s *DesiredWeightAndCapacity) SetDesiredWeight(v float64) *DesiredWeightAndCapacity { - s.DesiredWeight = &v +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListMonitoringExecutionsInput) SetCreationTimeBefore(v time.Time) *ListMonitoringExecutionsInput { + s.CreationTimeBefore = &v return s } -// SetVariantName sets the VariantName field's value. -func (s *DesiredWeightAndCapacity) SetVariantName(v string) *DesiredWeightAndCapacity { - s.VariantName = &v +// SetEndpointName sets the EndpointName field's value. +func (s *ListMonitoringExecutionsInput) SetEndpointName(v string) *ListMonitoringExecutionsInput { + s.EndpointName = &v return s } -// Provides summary information for an endpoint configuration. -type EndpointConfigSummary struct { - _ struct{} `type:"structure"` - - // A timestamp that shows when the endpoint configuration was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` - - // The Amazon Resource Name (ARN) of the endpoint configuration. - // - // EndpointConfigArn is a required field - EndpointConfigArn *string `min:"20" type:"string" required:"true"` +// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. +func (s *ListMonitoringExecutionsInput) SetLastModifiedTimeAfter(v time.Time) *ListMonitoringExecutionsInput { + s.LastModifiedTimeAfter = &v + return s +} - // The name of the endpoint configuration. - // - // EndpointConfigName is a required field - EndpointConfigName *string `type:"string" required:"true"` +// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. +func (s *ListMonitoringExecutionsInput) SetLastModifiedTimeBefore(v time.Time) *ListMonitoringExecutionsInput { + s.LastModifiedTimeBefore = &v + return s } -// String returns the string representation -func (s EndpointConfigSummary) String() string { - return awsutil.Prettify(s) +// SetMaxResults sets the MaxResults field's value. +func (s *ListMonitoringExecutionsInput) SetMaxResults(v int64) *ListMonitoringExecutionsInput { + s.MaxResults = &v + return s } -// GoString returns the string representation -func (s EndpointConfigSummary) GoString() string { - return s.String() +// SetMonitoringScheduleName sets the MonitoringScheduleName field's value. +func (s *ListMonitoringExecutionsInput) SetMonitoringScheduleName(v string) *ListMonitoringExecutionsInput { + s.MonitoringScheduleName = &v + return s } -// SetCreationTime sets the CreationTime field's value. -func (s *EndpointConfigSummary) SetCreationTime(v time.Time) *EndpointConfigSummary { - s.CreationTime = &v +// SetNextToken sets the NextToken field's value. +func (s *ListMonitoringExecutionsInput) SetNextToken(v string) *ListMonitoringExecutionsInput { + s.NextToken = &v return s } -// SetEndpointConfigArn sets the EndpointConfigArn field's value. -func (s *EndpointConfigSummary) SetEndpointConfigArn(v string) *EndpointConfigSummary { - s.EndpointConfigArn = &v +// SetScheduledTimeAfter sets the ScheduledTimeAfter field's value. +func (s *ListMonitoringExecutionsInput) SetScheduledTimeAfter(v time.Time) *ListMonitoringExecutionsInput { + s.ScheduledTimeAfter = &v return s } -// SetEndpointConfigName sets the EndpointConfigName field's value. -func (s *EndpointConfigSummary) SetEndpointConfigName(v string) *EndpointConfigSummary { - s.EndpointConfigName = &v +// SetScheduledTimeBefore sets the ScheduledTimeBefore field's value. +func (s *ListMonitoringExecutionsInput) SetScheduledTimeBefore(v time.Time) *ListMonitoringExecutionsInput { + s.ScheduledTimeBefore = &v return s } -// Provides summary information for an endpoint. -type EndpointSummary struct { - _ struct{} `type:"structure"` +// SetSortBy sets the SortBy field's value. +func (s *ListMonitoringExecutionsInput) SetSortBy(v string) *ListMonitoringExecutionsInput { + s.SortBy = &v + return s +} - // A timestamp that shows when the endpoint was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` +// SetSortOrder sets the SortOrder field's value. +func (s *ListMonitoringExecutionsInput) SetSortOrder(v string) *ListMonitoringExecutionsInput { + s.SortOrder = &v + return s +} - // The Amazon Resource Name (ARN) of the endpoint. - // - // EndpointArn is a required field - EndpointArn *string `min:"20" type:"string" required:"true"` +// SetStatusEquals sets the StatusEquals field's value. +func (s *ListMonitoringExecutionsInput) SetStatusEquals(v string) *ListMonitoringExecutionsInput { + s.StatusEquals = &v + return s +} - // The name of the endpoint. - // - // EndpointName is a required field - EndpointName *string `type:"string" required:"true"` +type ListMonitoringExecutionsOutput struct { + _ struct{} `type:"structure"` - // The status of the endpoint. - // - // * OutOfService: Endpoint is not available to take incoming requests. - // - // * Creating: CreateEndpoint is executing. - // - // * Updating: UpdateEndpoint or UpdateEndpointWeightsAndCapacities is executing. - // - // * SystemUpdating: Endpoint is undergoing maintenance and cannot be updated - // or deleted or re-scaled until it has completed. This maintenance operation - // does not change any customer-specified values such as VPC config, KMS - // encryption, model, instance type, or instance count. - // - // * RollingBack: Endpoint fails to scale up or down or change its variant - // weight and is in the process of rolling back to its previous configuration. - // Once the rollback completes, endpoint returns to an InService status. - // This transitional status only applies to an endpoint that has autoscaling - // enabled and is undergoing variant weight or capacity changes as part of - // an UpdateEndpointWeightsAndCapacities call or when the UpdateEndpointWeightsAndCapacities - // operation is called explicitly. - // - // * InService: Endpoint is available to process incoming requests. - // - // * Deleting: DeleteEndpoint is executing. - // - // * Failed: Endpoint could not be created, updated, or re-scaled. Use DescribeEndpointOutput$FailureReason - // for information about the failure. DeleteEndpoint is the only operation - // that can be performed on a failed endpoint. - // - // To get a list of endpoints with a specified status, use the ListEndpointsInput$StatusEquals - // filter. + // A JSON array in which each element is a summary for a monitoring execution. // - // EndpointStatus is a required field - EndpointStatus *string `type:"string" required:"true" enum:"EndpointStatus"` + // MonitoringExecutionSummaries is a required field + MonitoringExecutionSummaries []*MonitoringExecutionSummary `type:"list" required:"true"` - // A timestamp that shows when the endpoint was last modified. - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `type:"timestamp" required:"true"` + // If the response is truncated, Amazon SageMaker returns this token. To retrieve + // the next set of jobs, use it in the subsequent reques + NextToken *string `type:"string"` } // String returns the string representation -func (s EndpointSummary) String() string { +func (s ListMonitoringExecutionsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s EndpointSummary) GoString() string { +func (s ListMonitoringExecutionsOutput) GoString() string { return s.String() } -// SetCreationTime sets the CreationTime field's value. -func (s *EndpointSummary) SetCreationTime(v time.Time) *EndpointSummary { - s.CreationTime = &v +// SetMonitoringExecutionSummaries sets the MonitoringExecutionSummaries field's value. +func (s *ListMonitoringExecutionsOutput) SetMonitoringExecutionSummaries(v []*MonitoringExecutionSummary) *ListMonitoringExecutionsOutput { + s.MonitoringExecutionSummaries = v return s } -// SetEndpointArn sets the EndpointArn field's value. -func (s *EndpointSummary) SetEndpointArn(v string) *EndpointSummary { - s.EndpointArn = &v +// SetNextToken sets the NextToken field's value. +func (s *ListMonitoringExecutionsOutput) SetNextToken(v string) *ListMonitoringExecutionsOutput { + s.NextToken = &v return s } -// SetEndpointName sets the EndpointName field's value. -func (s *EndpointSummary) SetEndpointName(v string) *EndpointSummary { - s.EndpointName = &v - return s -} +type ListMonitoringSchedulesInput struct { + _ struct{} `type:"structure"` -// SetEndpointStatus sets the EndpointStatus field's value. -func (s *EndpointSummary) SetEndpointStatus(v string) *EndpointSummary { - s.EndpointStatus = &v - return s -} + // A filter that returns only monitoring schedules created after a specified + // time. + CreationTimeAfter *time.Time `type:"timestamp"` -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *EndpointSummary) SetLastModifiedTime(v time.Time) *EndpointSummary { - s.LastModifiedTime = &v - return s -} + // A filter that returns only monitoring schedules created before a specified + // time. + CreationTimeBefore *time.Time `type:"timestamp"` -// Specifies a file system data source for a channel. -type FileSystemDataSource struct { - _ struct{} `type:"structure"` + // Name of a specific endpoint to fetch schedules for. + EndpointName *string `type:"string"` - // The full path to the directory to associate with the channel. - // - // DirectoryPath is a required field - DirectoryPath *string `type:"string" required:"true"` + // A filter that returns only monitoring schedules modified after a specified + // time. + LastModifiedTimeAfter *time.Time `type:"timestamp"` - // The access mode of the mount of the directory associated with the channel. - // A directory can be mounted either in ro (read-only) or rw (read-write) mode. - // - // FileSystemAccessMode is a required field - FileSystemAccessMode *string `type:"string" required:"true" enum:"FileSystemAccessMode"` + // A filter that returns only monitoring schedules modified before a specified + // time. + LastModifiedTimeBefore *time.Time `type:"timestamp"` - // The file system id. - // - // FileSystemId is a required field - FileSystemId *string `min:"11" type:"string" required:"true"` + // The maximum number of jobs to return in the response. The default value is + // 10. + MaxResults *int64 `min:"1" type:"integer"` - // The file system type. - // - // FileSystemType is a required field - FileSystemType *string `type:"string" required:"true" enum:"FileSystemType"` + // Filter for monitoring schedules whose name contains a specified string. + NameContains *string `type:"string"` + + // The token returned if the response is truncated. To retrieve the next set + // of job executions, use it in the next request. + NextToken *string `type:"string"` + + // Whether to sort results by Status, CreationTime, ScheduledTime field. The + // default is CreationTime. + SortBy *string `type:"string" enum:"MonitoringScheduleSortKey"` + + // Whether to sort the results in Ascending or Descending order. The default + // is Descending. + SortOrder *string `type:"string" enum:"SortOrder"` + + // A filter that returns only monitoring schedules modified before a specified + // time. + StatusEquals *string `type:"string" enum:"ScheduleStatus"` } // String returns the string representation -func (s FileSystemDataSource) String() string { +func (s ListMonitoringSchedulesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s FileSystemDataSource) GoString() string { +func (s ListMonitoringSchedulesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *FileSystemDataSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "FileSystemDataSource"} - if s.DirectoryPath == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryPath")) - } - if s.FileSystemAccessMode == nil { - invalidParams.Add(request.NewErrParamRequired("FileSystemAccessMode")) - } - if s.FileSystemId == nil { - invalidParams.Add(request.NewErrParamRequired("FileSystemId")) - } - if s.FileSystemId != nil && len(*s.FileSystemId) < 11 { - invalidParams.Add(request.NewErrParamMinLen("FileSystemId", 11)) - } - if s.FileSystemType == nil { - invalidParams.Add(request.NewErrParamRequired("FileSystemType")) +func (s *ListMonitoringSchedulesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListMonitoringSchedulesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -14892,266 +33628,160 @@ func (s *FileSystemDataSource) Validate() error { return nil } -// SetDirectoryPath sets the DirectoryPath field's value. -func (s *FileSystemDataSource) SetDirectoryPath(v string) *FileSystemDataSource { - s.DirectoryPath = &v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListMonitoringSchedulesInput) SetCreationTimeAfter(v time.Time) *ListMonitoringSchedulesInput { + s.CreationTimeAfter = &v return s } -// SetFileSystemAccessMode sets the FileSystemAccessMode field's value. -func (s *FileSystemDataSource) SetFileSystemAccessMode(v string) *FileSystemDataSource { - s.FileSystemAccessMode = &v +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListMonitoringSchedulesInput) SetCreationTimeBefore(v time.Time) *ListMonitoringSchedulesInput { + s.CreationTimeBefore = &v return s } -// SetFileSystemId sets the FileSystemId field's value. -func (s *FileSystemDataSource) SetFileSystemId(v string) *FileSystemDataSource { - s.FileSystemId = &v +// SetEndpointName sets the EndpointName field's value. +func (s *ListMonitoringSchedulesInput) SetEndpointName(v string) *ListMonitoringSchedulesInput { + s.EndpointName = &v return s } -// SetFileSystemType sets the FileSystemType field's value. -func (s *FileSystemDataSource) SetFileSystemType(v string) *FileSystemDataSource { - s.FileSystemType = &v +// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. +func (s *ListMonitoringSchedulesInput) SetLastModifiedTimeAfter(v time.Time) *ListMonitoringSchedulesInput { + s.LastModifiedTimeAfter = &v return s } -// A conditional statement for a search expression that includes a Boolean operator, -// a resource property, and a value. -// -// If you don't specify an Operator and a Value, the filter searches for only -// the specified property. For example, defining a Filter for the FailureReason -// for the TrainingJob Resource searches for training job objects that have -// a value in the FailureReason field. -// -// If you specify a Value, but not an Operator, Amazon SageMaker uses the equals -// operator as the default. -// -// In search, there are several property types: -// -// Metrics -// -// To define a metric filter, enter a value using the form "Metrics.", -// where is a metric name. For example, the following filter searches -// for training jobs with an "accuracy" metric greater than "0.9": -// -// { -// -// "Name": "Metrics.accuracy", -// -// "Operator": "GREATER_THAN", -// -// "Value": "0.9" -// -// } -// -// HyperParameters -// -// To define a hyperparameter filter, enter a value with the form "HyperParameters.". -// Decimal hyperparameter values are treated as a decimal in a comparison if -// the specified Value is also a decimal value. If the specified Value is an -// integer, the decimal hyperparameter values are treated as integers. For example, -// the following filter is satisfied by training jobs with a "learning_rate" -// hyperparameter that is less than "0.5": -// -// { -// -// "Name": "HyperParameters.learning_rate", -// -// "Operator": "LESS_THAN", -// -// "Value": "0.5" -// -// } -// -// Tags -// -// To define a tag filter, enter a value with the form "Tags.". -type Filter struct { - _ struct{} `type:"structure"` - - // A property name. For example, TrainingJobName. For the list of valid property - // names returned in a search result for each supported resource, see TrainingJob - // properties. You must specify a valid property name for the resource. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // A Boolean binary operator that is used to evaluate the filter. The operator - // field contains one of the following values: - // - // Equals - // - // The specified resource in Name equals the specified Value. - // - // NotEquals - // - // The specified resource in Name does not equal the specified Value. - // - // GreaterThan - // - // The specified resource in Name is greater than the specified Value. Not supported - // for text-based properties. - // - // GreaterThanOrEqualTo - // - // The specified resource in Name is greater than or equal to the specified - // Value. Not supported for text-based properties. - // - // LessThan - // - // The specified resource in Name is less than the specified Value. Not supported - // for text-based properties. - // - // LessThanOrEqualTo - // - // The specified resource in Name is less than or equal to the specified Value. - // Not supported for text-based properties. - // - // Contains - // - // Only supported for text-based properties. The word-list of the property contains - // the specified Value. - // - // If you have specified a filter Value, the default is Equals. - Operator *string `type:"string" enum:"Operator"` - - // A value used with Resource and Operator to determine if objects satisfy the - // filter's condition. For numerical properties, Value must be an integer or - // floating-point decimal. For timestamp properties, Value must be an ISO 8601 - // date-time string of the following format: YYYY-mm-dd'T'HH:MM:SS. - Value *string `min:"1" type:"string"` -} - -// 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() +// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. +func (s *ListMonitoringSchedulesInput) SetLastModifiedTimeBefore(v time.Time) *ListMonitoringSchedulesInput { + s.LastModifiedTimeBefore = &v + return s } -// 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.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)) - } +// SetMaxResults sets the MaxResults field's value. +func (s *ListMonitoringSchedulesInput) SetMaxResults(v int64) *ListMonitoringSchedulesInput { + s.MaxResults = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetNameContains sets the NameContains field's value. +func (s *ListMonitoringSchedulesInput) SetNameContains(v string) *ListMonitoringSchedulesInput { + s.NameContains = &v + return s } -// SetName sets the Name field's value. -func (s *Filter) SetName(v string) *Filter { - s.Name = &v +// SetNextToken sets the NextToken field's value. +func (s *ListMonitoringSchedulesInput) SetNextToken(v string) *ListMonitoringSchedulesInput { + s.NextToken = &v return s } -// SetOperator sets the Operator field's value. -func (s *Filter) SetOperator(v string) *Filter { - s.Operator = &v +// SetSortBy sets the SortBy field's value. +func (s *ListMonitoringSchedulesInput) SetSortBy(v string) *ListMonitoringSchedulesInput { + s.SortBy = &v return s } -// SetValue sets the Value field's value. -func (s *Filter) SetValue(v string) *Filter { - s.Value = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListMonitoringSchedulesInput) SetSortOrder(v string) *ListMonitoringSchedulesInput { + s.SortOrder = &v return s } -// Shows the final value for the objective metric for a training job that was -// launched by a hyperparameter tuning job. You define the objective metric -// in the HyperParameterTuningJobObjective parameter of HyperParameterTuningJobConfig. -type FinalHyperParameterTuningJobObjectiveMetric struct { +// SetStatusEquals sets the StatusEquals field's value. +func (s *ListMonitoringSchedulesInput) SetStatusEquals(v string) *ListMonitoringSchedulesInput { + s.StatusEquals = &v + return s +} + +type ListMonitoringSchedulesOutput struct { _ struct{} `type:"structure"` - // The name of the objective metric. + // A JSON array in which each element is a summary for a monitoring schedule. // - // MetricName is a required field - MetricName *string `min:"1" type:"string" required:"true"` - - // Whether to minimize or maximize the objective metric. Valid values are Minimize - // and Maximize. - Type *string `type:"string" enum:"HyperParameterTuningJobObjectiveType"` + // MonitoringScheduleSummaries is a required field + MonitoringScheduleSummaries []*MonitoringScheduleSummary `type:"list" required:"true"` - // The value of the objective metric. - // - // Value is a required field - Value *float64 `type:"float" required:"true"` + // If the response is truncated, Amazon SageMaker returns this token. To retrieve + // the next set of jobs, use it in the subsequent reques + NextToken *string `type:"string"` } // String returns the string representation -func (s FinalHyperParameterTuningJobObjectiveMetric) String() string { +func (s ListMonitoringSchedulesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s FinalHyperParameterTuningJobObjectiveMetric) GoString() string { +func (s ListMonitoringSchedulesOutput) GoString() string { return s.String() } -// SetMetricName sets the MetricName field's value. -func (s *FinalHyperParameterTuningJobObjectiveMetric) SetMetricName(v string) *FinalHyperParameterTuningJobObjectiveMetric { - s.MetricName = &v - return s -} - -// SetType sets the Type field's value. -func (s *FinalHyperParameterTuningJobObjectiveMetric) SetType(v string) *FinalHyperParameterTuningJobObjectiveMetric { - s.Type = &v +// SetMonitoringScheduleSummaries sets the MonitoringScheduleSummaries field's value. +func (s *ListMonitoringSchedulesOutput) SetMonitoringScheduleSummaries(v []*MonitoringScheduleSummary) *ListMonitoringSchedulesOutput { + s.MonitoringScheduleSummaries = v return s } -// SetValue sets the Value field's value. -func (s *FinalHyperParameterTuningJobObjectiveMetric) SetValue(v float64) *FinalHyperParameterTuningJobObjectiveMetric { - s.Value = &v +// SetNextToken sets the NextToken field's value. +func (s *ListMonitoringSchedulesOutput) SetNextToken(v string) *ListMonitoringSchedulesOutput { + s.NextToken = &v return s } -type GetSearchSuggestionsInput struct { +type ListNotebookInstanceLifecycleConfigsInput struct { _ struct{} `type:"structure"` - // The name of the Amazon SageMaker resource to Search for. The only valid Resource - // value is TrainingJob. - // - // Resource is a required field - Resource *string `type:"string" required:"true" enum:"ResourceType"` + // A filter that returns only lifecycle configurations that were created after + // the specified time (timestamp). + CreationTimeAfter *time.Time `type:"timestamp"` - // Limits the property names that are included in the response. - SuggestionQuery *SuggestionQuery `type:"structure"` + // A filter that returns only lifecycle configurations that were created before + // the specified time (timestamp). + CreationTimeBefore *time.Time `type:"timestamp"` + + // A filter that returns only lifecycle configurations that were modified after + // the specified time (timestamp). + LastModifiedTimeAfter *time.Time `type:"timestamp"` + + // A filter that returns only lifecycle configurations that were modified before + // the specified time (timestamp). + LastModifiedTimeBefore *time.Time `type:"timestamp"` + + // The maximum number of lifecycle configurations to return in the response. + MaxResults *int64 `min:"1" type:"integer"` + + // A string in the lifecycle configuration name. This filter returns only lifecycle + // configurations whose name contains the specified string. + NameContains *string `type:"string"` + + // If the result of a ListNotebookInstanceLifecycleConfigs request was truncated, + // the response includes a NextToken. To get the next set of lifecycle configurations, + // use the token in the next request. + NextToken *string `type:"string"` + + // Sorts the list of results. The default is CreationTime. + SortBy *string `type:"string" enum:"NotebookInstanceLifecycleConfigSortKey"` + + // The sort order for results. + SortOrder *string `type:"string" enum:"NotebookInstanceLifecycleConfigSortOrder"` } // String returns the string representation -func (s GetSearchSuggestionsInput) String() string { +func (s ListNotebookInstanceLifecycleConfigsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetSearchSuggestionsInput) GoString() string { +func (s ListNotebookInstanceLifecycleConfigsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GetSearchSuggestionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetSearchSuggestionsInput"} - if s.Resource == nil { - invalidParams.Add(request.NewErrParamRequired("Resource")) - } - if s.SuggestionQuery != nil { - if err := s.SuggestionQuery.Validate(); err != nil { - invalidParams.AddNested("SuggestionQuery", err.(request.ErrInvalidParams)) - } +func (s *ListNotebookInstanceLifecycleConfigsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListNotebookInstanceLifecycleConfigsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -15160,82 +33790,172 @@ func (s *GetSearchSuggestionsInput) Validate() error { return nil } -// SetResource sets the Resource field's value. -func (s *GetSearchSuggestionsInput) SetResource(v string) *GetSearchSuggestionsInput { - s.Resource = &v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListNotebookInstanceLifecycleConfigsInput) SetCreationTimeAfter(v time.Time) *ListNotebookInstanceLifecycleConfigsInput { + s.CreationTimeAfter = &v return s } -// SetSuggestionQuery sets the SuggestionQuery field's value. -func (s *GetSearchSuggestionsInput) SetSuggestionQuery(v *SuggestionQuery) *GetSearchSuggestionsInput { - s.SuggestionQuery = v +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListNotebookInstanceLifecycleConfigsInput) SetCreationTimeBefore(v time.Time) *ListNotebookInstanceLifecycleConfigsInput { + s.CreationTimeBefore = &v return s } -type GetSearchSuggestionsOutput struct { +// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. +func (s *ListNotebookInstanceLifecycleConfigsInput) SetLastModifiedTimeAfter(v time.Time) *ListNotebookInstanceLifecycleConfigsInput { + s.LastModifiedTimeAfter = &v + return s +} + +// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. +func (s *ListNotebookInstanceLifecycleConfigsInput) SetLastModifiedTimeBefore(v time.Time) *ListNotebookInstanceLifecycleConfigsInput { + s.LastModifiedTimeBefore = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListNotebookInstanceLifecycleConfigsInput) SetMaxResults(v int64) *ListNotebookInstanceLifecycleConfigsInput { + s.MaxResults = &v + return s +} + +// SetNameContains sets the NameContains field's value. +func (s *ListNotebookInstanceLifecycleConfigsInput) SetNameContains(v string) *ListNotebookInstanceLifecycleConfigsInput { + s.NameContains = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListNotebookInstanceLifecycleConfigsInput) SetNextToken(v string) *ListNotebookInstanceLifecycleConfigsInput { + s.NextToken = &v + return s +} + +// SetSortBy sets the SortBy field's value. +func (s *ListNotebookInstanceLifecycleConfigsInput) SetSortBy(v string) *ListNotebookInstanceLifecycleConfigsInput { + s.SortBy = &v + return s +} + +// SetSortOrder sets the SortOrder field's value. +func (s *ListNotebookInstanceLifecycleConfigsInput) SetSortOrder(v string) *ListNotebookInstanceLifecycleConfigsInput { + s.SortOrder = &v + return s +} + +type ListNotebookInstanceLifecycleConfigsOutput struct { _ struct{} `type:"structure"` - // A list of property names for a Resource that match a SuggestionQuery. - PropertyNameSuggestions []*PropertyNameSuggestion `type:"list"` + // If the response is truncated, Amazon SageMaker returns this token. To get + // the next set of lifecycle configurations, use it in the next request. + NextToken *string `type:"string"` + + // An array of NotebookInstanceLifecycleConfiguration objects, each listing + // a lifecycle configuration. + NotebookInstanceLifecycleConfigs []*NotebookInstanceLifecycleConfigSummary `type:"list"` } // String returns the string representation -func (s GetSearchSuggestionsOutput) String() string { +func (s ListNotebookInstanceLifecycleConfigsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GetSearchSuggestionsOutput) GoString() string { +func (s ListNotebookInstanceLifecycleConfigsOutput) GoString() string { return s.String() } -// SetPropertyNameSuggestions sets the PropertyNameSuggestions field's value. -func (s *GetSearchSuggestionsOutput) SetPropertyNameSuggestions(v []*PropertyNameSuggestion) *GetSearchSuggestionsOutput { - s.PropertyNameSuggestions = v +// SetNextToken sets the NextToken field's value. +func (s *ListNotebookInstanceLifecycleConfigsOutput) SetNextToken(v string) *ListNotebookInstanceLifecycleConfigsOutput { + s.NextToken = &v return s } -// Specifies configuration details for a Git repository in your AWS account. -type GitConfig struct { +// SetNotebookInstanceLifecycleConfigs sets the NotebookInstanceLifecycleConfigs field's value. +func (s *ListNotebookInstanceLifecycleConfigsOutput) SetNotebookInstanceLifecycleConfigs(v []*NotebookInstanceLifecycleConfigSummary) *ListNotebookInstanceLifecycleConfigsOutput { + s.NotebookInstanceLifecycleConfigs = v + return s +} + +type ListNotebookInstancesInput struct { _ struct{} `type:"structure"` - // The default branch for the Git repository. - Branch *string `min:"1" type:"string"` + // A filter that returns only notebook instances with associated with the specified + // git repository. + AdditionalCodeRepositoryEquals *string `min:"1" type:"string"` - // The URL where the Git repository is located. - // - // RepositoryUrl is a required field - RepositoryUrl *string `type:"string" required:"true"` + // A filter that returns only notebook instances that were created after the + // specified time (timestamp). + CreationTimeAfter *time.Time `type:"timestamp"` - // The Amazon Resource Name (ARN) of the AWS Secrets Manager secret that contains - // the credentials used to access the git repository. The secret must have a - // staging label of AWSCURRENT and must be in the following format: + // A filter that returns only notebook instances that were created before the + // specified time (timestamp). + CreationTimeBefore *time.Time `type:"timestamp"` + + // A string in the name or URL of a Git repository associated with this notebook + // instance. This filter returns only notebook instances associated with a git + // repository with a name that contains the specified string. + DefaultCodeRepositoryContains *string `type:"string"` + + // A filter that returns only notebook instances that were modified after the + // specified time (timestamp). + LastModifiedTimeAfter *time.Time `type:"timestamp"` + + // A filter that returns only notebook instances that were modified before the + // specified time (timestamp). + LastModifiedTimeBefore *time.Time `type:"timestamp"` + + // The maximum number of notebook instances to return. + MaxResults *int64 `min:"1" type:"integer"` + + // A string in the notebook instances' name. This filter returns only notebook + // instances whose name contains the specified string. + NameContains *string `type:"string"` + + // If the previous call to the ListNotebookInstances is truncated, the response + // includes a NextToken. You can use this token in your subsequent ListNotebookInstances + // request to fetch the next set of notebook instances. // - // {"username": UserName, "password": Password} - SecretArn *string `min:"1" type:"string"` + // You might specify a filter or a sort order in your request. When response + // is truncated, you must use the same values for the filer and sort order in + // the next request. + NextToken *string `type:"string"` + + // A string in the name of a notebook instances lifecycle configuration associated + // with this notebook instance. This filter returns only notebook instances + // associated with a lifecycle configuration with a name that contains the specified + // string. + NotebookInstanceLifecycleConfigNameContains *string `type:"string"` + + // The field to sort results by. The default is Name. + SortBy *string `type:"string" enum:"NotebookInstanceSortKey"` + + // The sort order for results. + SortOrder *string `type:"string" enum:"NotebookInstanceSortOrder"` + + // A filter that returns only notebook instances with the specified status. + StatusEquals *string `type:"string" enum:"NotebookInstanceStatus"` } // String returns the string representation -func (s GitConfig) String() string { +func (s ListNotebookInstancesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s GitConfig) GoString() string { +func (s ListNotebookInstancesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *GitConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GitConfig"} - if s.Branch != nil && len(*s.Branch) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Branch", 1)) - } - if s.RepositoryUrl == nil { - invalidParams.Add(request.NewErrParamRequired("RepositoryUrl")) +func (s *ListNotebookInstancesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListNotebookInstancesInput"} + if s.AdditionalCodeRepositoryEquals != nil && len(*s.AdditionalCodeRepositoryEquals) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AdditionalCodeRepositoryEquals", 1)) } - if s.SecretArn != nil && len(*s.SecretArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SecretArn", 1)) + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -15244,347 +33964,171 @@ func (s *GitConfig) Validate() error { return nil } -// SetBranch sets the Branch field's value. -func (s *GitConfig) SetBranch(v string) *GitConfig { - s.Branch = &v +// SetAdditionalCodeRepositoryEquals sets the AdditionalCodeRepositoryEquals field's value. +func (s *ListNotebookInstancesInput) SetAdditionalCodeRepositoryEquals(v string) *ListNotebookInstancesInput { + s.AdditionalCodeRepositoryEquals = &v return s } -// SetRepositoryUrl sets the RepositoryUrl field's value. -func (s *GitConfig) SetRepositoryUrl(v string) *GitConfig { - s.RepositoryUrl = &v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListNotebookInstancesInput) SetCreationTimeAfter(v time.Time) *ListNotebookInstancesInput { + s.CreationTimeAfter = &v return s } -// SetSecretArn sets the SecretArn field's value. -func (s *GitConfig) SetSecretArn(v string) *GitConfig { - s.SecretArn = &v +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListNotebookInstancesInput) SetCreationTimeBefore(v time.Time) *ListNotebookInstancesInput { + s.CreationTimeBefore = &v return s } -// Specifies configuration details for a Git repository when the repository -// is updated. -type GitConfigForUpdate struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the AWS Secrets Manager secret that contains - // the credentials used to access the git repository. The secret must have a - // staging label of AWSCURRENT and must be in the following format: - // - // {"username": UserName, "password": Password} - SecretArn *string `min:"1" type:"string"` +// SetDefaultCodeRepositoryContains sets the DefaultCodeRepositoryContains field's value. +func (s *ListNotebookInstancesInput) SetDefaultCodeRepositoryContains(v string) *ListNotebookInstancesInput { + s.DefaultCodeRepositoryContains = &v + return s } -// String returns the string representation -func (s GitConfigForUpdate) String() string { - return awsutil.Prettify(s) +// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. +func (s *ListNotebookInstancesInput) SetLastModifiedTimeAfter(v time.Time) *ListNotebookInstancesInput { + s.LastModifiedTimeAfter = &v + return s } -// GoString returns the string representation -func (s GitConfigForUpdate) GoString() string { - return s.String() +// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. +func (s *ListNotebookInstancesInput) SetLastModifiedTimeBefore(v time.Time) *ListNotebookInstancesInput { + s.LastModifiedTimeBefore = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *GitConfigForUpdate) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GitConfigForUpdate"} - if s.SecretArn != nil && len(*s.SecretArn) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SecretArn", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetMaxResults sets the MaxResults field's value. +func (s *ListNotebookInstancesInput) SetMaxResults(v int64) *ListNotebookInstancesInput { + s.MaxResults = &v + return s } -// SetSecretArn sets the SecretArn field's value. -func (s *GitConfigForUpdate) SetSecretArn(v string) *GitConfigForUpdate { - s.SecretArn = &v +// SetNameContains sets the NameContains field's value. +func (s *ListNotebookInstancesInput) SetNameContains(v string) *ListNotebookInstancesInput { + s.NameContains = &v return s } -// Information required for human workers to complete a labeling task. -type HumanTaskConfig struct { - _ struct{} `type:"structure"` - - // Configures how labels are consolidated across human workers. - // - // AnnotationConsolidationConfig is a required field - AnnotationConsolidationConfig *AnnotationConsolidationConfig `type:"structure" required:"true"` +// SetNextToken sets the NextToken field's value. +func (s *ListNotebookInstancesInput) SetNextToken(v string) *ListNotebookInstancesInput { + s.NextToken = &v + return s +} - // Defines the maximum number of data objects that can be labeled by human workers - // at the same time. Each object may have more than one worker at one time. - MaxConcurrentTaskCount *int64 `min:"1" type:"integer"` +// SetNotebookInstanceLifecycleConfigNameContains sets the NotebookInstanceLifecycleConfigNameContains field's value. +func (s *ListNotebookInstancesInput) SetNotebookInstanceLifecycleConfigNameContains(v string) *ListNotebookInstancesInput { + s.NotebookInstanceLifecycleConfigNameContains = &v + return s +} - // The number of human workers that will label an object. - // - // NumberOfHumanWorkersPerDataObject is a required field - NumberOfHumanWorkersPerDataObject *int64 `min:"1" type:"integer" required:"true"` +// SetSortBy sets the SortBy field's value. +func (s *ListNotebookInstancesInput) SetSortBy(v string) *ListNotebookInstancesInput { + s.SortBy = &v + return s +} - // The Amazon Resource Name (ARN) of a Lambda function that is run before a - // data object is sent to a human worker. Use this function to provide input - // to a custom labeling job. - // - // For the built-in bounding box, image classification, semantic segmentation, - // and text classification task types, Amazon SageMaker Ground Truth provides - // the following Lambda functions: - // - // US East (Northern Virginia) (us-east-1): - // - // * arn:aws:lambda:us-east-1:432418664414:function:PRE-BoundingBox - // - // * arn:aws:lambda:us-east-1:432418664414:function:PRE-ImageMultiClass - // - // * arn:aws:lambda:us-east-1:432418664414:function:PRE-SemanticSegmentation - // - // * arn:aws:lambda:us-east-1:432418664414:function:PRE-TextMultiClass - // - // * arn:aws:lambda:us-east-1:432418664414:function:PRE-NamedEntityRecognition - // - // US East (Ohio) (us-east-2): - // - // * arn:aws:lambda:us-east-2:266458841044:function:PRE-BoundingBox - // - // * arn:aws:lambda:us-east-2:266458841044:function:PRE-ImageMultiClass - // - // * arn:aws:lambda:us-east-2:266458841044:function:PRE-SemanticSegmentation - // - // * arn:aws:lambda:us-east-2:266458841044:function:PRE-TextMultiClass - // - // * arn:aws:lambda:us-east-2:266458841044:function:PRE-NamedEntityRecognition - // - // US West (Oregon) (us-west-2): - // - // * arn:aws:lambda:us-west-2:081040173940:function:PRE-BoundingBox - // - // * arn:aws:lambda:us-west-2:081040173940:function:PRE-ImageMultiClass - // - // * arn:aws:lambda:us-west-2:081040173940:function:PRE-SemanticSegmentation - // - // * arn:aws:lambda:us-west-2:081040173940:function:PRE-TextMultiClass - // - // * arn:aws:lambda:us-west-2:081040173940:function:PRE-NamedEntityRecognition - // - // Canada (Central) (ca-central-1): - // - // * arn:awslambda:ca-central-1:918755190332:function:PRE-BoundingBox - // - // * arn:awslambda:ca-central-1:918755190332:function:PRE-ImageMultiClass - // - // * arn:awslambda:ca-central-1:918755190332:function:PRE-SemanticSegmentation - // - // * arn:awslambda:ca-central-1:918755190332:function:PRE-TextMultiClass - // - // * arn:awslambda:ca-central-1:918755190332:function:PRE-NamedEntityRecognition - // - // EU (Ireland) (eu-west-1): - // - // * arn:aws:lambda:eu-west-1:568282634449:function:PRE-BoundingBox - // - // * arn:aws:lambda:eu-west-1:568282634449:function:PRE-ImageMultiClass - // - // * arn:aws:lambda:eu-west-1:568282634449:function:PRE-SemanticSegmentation - // - // * arn:aws:lambda:eu-west-1:568282634449:function:PRE-TextMultiClass - // - // * arn:aws:lambda:eu-west-1:568282634449:function:PRE-NamedEntityRecognition - // - // EU (London) (eu-west-2): - // - // * arn:awslambda:eu-west-2:487402164563:function:PRE-BoundingBox - // - // * arn:awslambda:eu-west-2:487402164563:function:PRE-ImageMultiClass - // - // * arn:awslambda:eu-west-2:487402164563:function:PRE-SemanticSegmentation - // - // * arn:awslambda:eu-west-2:487402164563:function:PRE-TextMultiClass - // - // * arn:awslambda:eu-west-2:487402164563:function:PRE-NamedEntityRecognition - // - // EU Frankfurt (eu-central-1): - // - // * arn:awslambda:eu-central-1:203001061592:function:PRE-BoundingBox - // - // * arn:awslambda:eu-central-1:203001061592:function:PRE-ImageMultiClass - // - // * arn:awslambda:eu-central-1:203001061592:function:PRE-SemanticSegmentation - // - // * arn:awslambda:eu-central-1:203001061592:function:PRE-TextMultiClass - // - // * arn:awslambda:eu-central-1:203001061592:function:PRE-NamedEntityRecognition - // - // Asia Pacific (Tokyo) (ap-northeast-1): - // - // * arn:aws:lambda:ap-northeast-1:477331159723:function:PRE-BoundingBox - // - // * arn:aws:lambda:ap-northeast-1:477331159723:function:PRE-ImageMultiClass - // - // * arn:aws:lambda:ap-northeast-1:477331159723:function:PRE-SemanticSegmentation - // - // * arn:aws:lambda:ap-northeast-1:477331159723:function:PRE-TextMultiClass - // - // * arn:aws:lambda:ap-northeast-1:477331159723:function:PRE-NamedEntityRecognition - // - // Asia Pacific (Seoul) (ap-northeast-2): - // - // * arn:awslambda:ap-northeast-2:845288260483:function:PRE-BoundingBox - // - // * arn:awslambda:ap-northeast-2:845288260483:function:PRE-ImageMultiClass - // - // * arn:awslambda:ap-northeast-2:845288260483:function:PRE-SemanticSegmentation - // - // * arn:awslambda:ap-northeast-2:845288260483:function:PRE-TextMultiClass - // - // * arn:awslambda:ap-northeast-2:845288260483:function:PRE-NamedEntityRecognition - // - // Asia Pacific (Mumbai) (ap-south-1): - // - // * arn:awslambda:ap-south-1:565803892007:function:PRE-BoundingBox - // - // * arn:awslambda:ap-south-1:565803892007:function:PRE-ImageMultiClass - // - // * arn:awslambda:ap-south-1:565803892007:function:PRE-SemanticSegmentation - // - // * arn:awslambda:ap-south-1:565803892007:function:PRE-TextMultiClass - // - // * arn:awslambda:ap-south-1:565803892007:function:PRE-NamedEntityRecognition - // - // Asia Pacific (Singapore) (ap-southeast-1): - // - // * arn:awslambda:ap-southeast-1:377565633583:function:PRE-BoundingBox - // - // * arn:awslambda:ap-southeast-1:377565633583:function:PRE-ImageMultiClass - // - // * arn:awslambda:ap-southeast-1:377565633583:function:PRE-SemanticSegmentation - // - // * arn:awslambda:ap-southeast-1:377565633583:function:PRE-TextMultiClass - // - // * arn:awslambda:ap-southeast-1:377565633583:function:PRE-NamedEntityRecognition - // - // Asia Pacific (Sydney) (ap-southeast-2): - // - // * arn:aws:lambda:ap-southeast-2:454466003867:function:PRE-BoundingBox - // - // * arn:aws:lambda:ap-southeast-2:454466003867:function:PRE-ImageMultiClass - // - // * arn:aws:lambda:ap-southeast-2:454466003867:function:PRE-SemanticSegmentation - // - // * arn:aws:lambda:ap-southeast-2:454466003867:function:PRE-TextMultiClass - // - // * arn:aws:lambda:ap-southeast-2:454466003867:function:PRE-NamedEntityRecognition - // - // PreHumanTaskLambdaArn is a required field - PreHumanTaskLambdaArn *string `type:"string" required:"true"` +// SetSortOrder sets the SortOrder field's value. +func (s *ListNotebookInstancesInput) SetSortOrder(v string) *ListNotebookInstancesInput { + s.SortOrder = &v + return s +} - // The price that you pay for each task performed by an Amazon Mechanical Turk - // worker. - PublicWorkforceTaskPrice *PublicWorkforceTaskPrice `type:"structure"` +// SetStatusEquals sets the StatusEquals field's value. +func (s *ListNotebookInstancesInput) SetStatusEquals(v string) *ListNotebookInstancesInput { + s.StatusEquals = &v + return s +} - // The length of time that a task remains available for labeling by human workers. - // If you choose the Amazon Mechanical Turk workforce, the maximum is 12 hours - // (43200). For private and vendor workforces, the maximum is as listed. - TaskAvailabilityLifetimeInSeconds *int64 `min:"1" type:"integer"` +type ListNotebookInstancesOutput struct { + _ struct{} `type:"structure"` - // A description of the task for your human workers. - // - // TaskDescription is a required field - TaskDescription *string `min:"1" type:"string" required:"true"` + // If the response to the previous ListNotebookInstances request was truncated, + // Amazon SageMaker returns this token. To retrieve the next set of notebook + // instances, use the token in the next request. + NextToken *string `type:"string"` - // Keywords used to describe the task so that workers on Amazon Mechanical Turk - // can discover the task. - TaskKeywords []*string `min:"1" type:"list"` + // An array of NotebookInstanceSummary objects, one for each notebook instance. + NotebookInstances []*NotebookInstanceSummary `type:"list"` +} - // The amount of time that a worker has to complete a task. - // - // TaskTimeLimitInSeconds is a required field - TaskTimeLimitInSeconds *int64 `min:"30" type:"integer" required:"true"` +// String returns the string representation +func (s ListNotebookInstancesOutput) String() string { + return awsutil.Prettify(s) +} - // A title for the task for your human workers. - // - // TaskTitle is a required field - TaskTitle *string `min:"1" type:"string" required:"true"` +// GoString returns the string representation +func (s ListNotebookInstancesOutput) GoString() string { + return s.String() +} - // Information about the user interface that workers use to complete the labeling - // task. - // - // UiConfig is a required field - UiConfig *UiConfig `type:"structure" required:"true"` +// SetNextToken sets the NextToken field's value. +func (s *ListNotebookInstancesOutput) SetNextToken(v string) *ListNotebookInstancesOutput { + s.NextToken = &v + return s +} - // The Amazon Resource Name (ARN) of the work team assigned to complete the - // tasks. - // - // WorkteamArn is a required field - WorkteamArn *string `type:"string" required:"true"` +// SetNotebookInstances sets the NotebookInstances field's value. +func (s *ListNotebookInstancesOutput) SetNotebookInstances(v []*NotebookInstanceSummary) *ListNotebookInstancesOutput { + s.NotebookInstances = v + return s +} + +type ListProcessingJobsInput struct { + _ struct{} `type:"structure"` + + // A filter that returns only processing jobs created after the specified time. + CreationTimeAfter *time.Time `type:"timestamp"` + + // A filter that returns only processing jobs created after the specified time. + CreationTimeBefore *time.Time `type:"timestamp"` + + // A filter that returns only processing jobs modified after the specified time. + LastModifiedTimeAfter *time.Time `type:"timestamp"` + + // A filter that returns only processing jobs modified before the specified + // time. + LastModifiedTimeBefore *time.Time `type:"timestamp"` + + // The maximum number of processing jobs to return in the response. + MaxResults *int64 `min:"1" type:"integer"` + + // A string in the processing job name. This filter returns only processing + // jobs whose name contains the specified string. + NameContains *string `type:"string"` + + // If the result of the previous ListProcessingJobs request was truncated, the + // response includes a NextToken. To retrieve the next set of processing jobs, + // use the token in the next request. + NextToken *string `type:"string"` + + // The field to sort results by. The default is CreationTime. + SortBy *string `type:"string" enum:"SortBy"` + + // The sort order for results. The default is Ascending. + SortOrder *string `type:"string" enum:"SortOrder"` + + // A filter that retrieves only processing jobs with a specific status. + StatusEquals *string `type:"string" enum:"ProcessingJobStatus"` } // String returns the string representation -func (s HumanTaskConfig) String() string { +func (s ListProcessingJobsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HumanTaskConfig) GoString() string { +func (s ListProcessingJobsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *HumanTaskConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HumanTaskConfig"} - if s.AnnotationConsolidationConfig == nil { - invalidParams.Add(request.NewErrParamRequired("AnnotationConsolidationConfig")) - } - if s.MaxConcurrentTaskCount != nil && *s.MaxConcurrentTaskCount < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxConcurrentTaskCount", 1)) - } - if s.NumberOfHumanWorkersPerDataObject == nil { - invalidParams.Add(request.NewErrParamRequired("NumberOfHumanWorkersPerDataObject")) - } - if s.NumberOfHumanWorkersPerDataObject != nil && *s.NumberOfHumanWorkersPerDataObject < 1 { - invalidParams.Add(request.NewErrParamMinValue("NumberOfHumanWorkersPerDataObject", 1)) - } - if s.PreHumanTaskLambdaArn == nil { - invalidParams.Add(request.NewErrParamRequired("PreHumanTaskLambdaArn")) - } - if s.TaskAvailabilityLifetimeInSeconds != nil && *s.TaskAvailabilityLifetimeInSeconds < 1 { - invalidParams.Add(request.NewErrParamMinValue("TaskAvailabilityLifetimeInSeconds", 1)) - } - if s.TaskDescription == nil { - invalidParams.Add(request.NewErrParamRequired("TaskDescription")) - } - if s.TaskDescription != nil && len(*s.TaskDescription) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskDescription", 1)) - } - if s.TaskKeywords != nil && len(s.TaskKeywords) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskKeywords", 1)) - } - if s.TaskTimeLimitInSeconds == nil { - invalidParams.Add(request.NewErrParamRequired("TaskTimeLimitInSeconds")) - } - if s.TaskTimeLimitInSeconds != nil && *s.TaskTimeLimitInSeconds < 30 { - invalidParams.Add(request.NewErrParamMinValue("TaskTimeLimitInSeconds", 30)) - } - if s.TaskTitle == nil { - invalidParams.Add(request.NewErrParamRequired("TaskTitle")) - } - if s.TaskTitle != nil && len(*s.TaskTitle) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TaskTitle", 1)) - } - if s.UiConfig == nil { - invalidParams.Add(request.NewErrParamRequired("UiConfig")) - } - if s.WorkteamArn == nil { - invalidParams.Add(request.NewErrParamRequired("WorkteamArn")) - } - if s.AnnotationConsolidationConfig != nil { - if err := s.AnnotationConsolidationConfig.Validate(); err != nil { - invalidParams.AddNested("AnnotationConsolidationConfig", err.(request.ErrInvalidParams)) - } - } - if s.UiConfig != nil { - if err := s.UiConfig.Validate(); err != nil { - invalidParams.AddNested("UiConfig", err.(request.ErrInvalidParams)) - } +func (s *ListProcessingJobsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListProcessingJobsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -15593,144 +34137,135 @@ func (s *HumanTaskConfig) Validate() error { return nil } -// SetAnnotationConsolidationConfig sets the AnnotationConsolidationConfig field's value. -func (s *HumanTaskConfig) SetAnnotationConsolidationConfig(v *AnnotationConsolidationConfig) *HumanTaskConfig { - s.AnnotationConsolidationConfig = v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListProcessingJobsInput) SetCreationTimeAfter(v time.Time) *ListProcessingJobsInput { + s.CreationTimeAfter = &v return s } -// SetMaxConcurrentTaskCount sets the MaxConcurrentTaskCount field's value. -func (s *HumanTaskConfig) SetMaxConcurrentTaskCount(v int64) *HumanTaskConfig { - s.MaxConcurrentTaskCount = &v +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListProcessingJobsInput) SetCreationTimeBefore(v time.Time) *ListProcessingJobsInput { + s.CreationTimeBefore = &v return s } -// SetNumberOfHumanWorkersPerDataObject sets the NumberOfHumanWorkersPerDataObject field's value. -func (s *HumanTaskConfig) SetNumberOfHumanWorkersPerDataObject(v int64) *HumanTaskConfig { - s.NumberOfHumanWorkersPerDataObject = &v +// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. +func (s *ListProcessingJobsInput) SetLastModifiedTimeAfter(v time.Time) *ListProcessingJobsInput { + s.LastModifiedTimeAfter = &v return s } -// SetPreHumanTaskLambdaArn sets the PreHumanTaskLambdaArn field's value. -func (s *HumanTaskConfig) SetPreHumanTaskLambdaArn(v string) *HumanTaskConfig { - s.PreHumanTaskLambdaArn = &v +// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. +func (s *ListProcessingJobsInput) SetLastModifiedTimeBefore(v time.Time) *ListProcessingJobsInput { + s.LastModifiedTimeBefore = &v return s } -// SetPublicWorkforceTaskPrice sets the PublicWorkforceTaskPrice field's value. -func (s *HumanTaskConfig) SetPublicWorkforceTaskPrice(v *PublicWorkforceTaskPrice) *HumanTaskConfig { - s.PublicWorkforceTaskPrice = v +// SetMaxResults sets the MaxResults field's value. +func (s *ListProcessingJobsInput) SetMaxResults(v int64) *ListProcessingJobsInput { + s.MaxResults = &v return s } -// SetTaskAvailabilityLifetimeInSeconds sets the TaskAvailabilityLifetimeInSeconds field's value. -func (s *HumanTaskConfig) SetTaskAvailabilityLifetimeInSeconds(v int64) *HumanTaskConfig { - s.TaskAvailabilityLifetimeInSeconds = &v +// SetNameContains sets the NameContains field's value. +func (s *ListProcessingJobsInput) SetNameContains(v string) *ListProcessingJobsInput { + s.NameContains = &v return s } -// SetTaskDescription sets the TaskDescription field's value. -func (s *HumanTaskConfig) SetTaskDescription(v string) *HumanTaskConfig { - s.TaskDescription = &v +// SetNextToken sets the NextToken field's value. +func (s *ListProcessingJobsInput) SetNextToken(v string) *ListProcessingJobsInput { + s.NextToken = &v return s } -// SetTaskKeywords sets the TaskKeywords field's value. -func (s *HumanTaskConfig) SetTaskKeywords(v []*string) *HumanTaskConfig { - s.TaskKeywords = v +// SetSortBy sets the SortBy field's value. +func (s *ListProcessingJobsInput) SetSortBy(v string) *ListProcessingJobsInput { + s.SortBy = &v return s } -// SetTaskTimeLimitInSeconds sets the TaskTimeLimitInSeconds field's value. -func (s *HumanTaskConfig) SetTaskTimeLimitInSeconds(v int64) *HumanTaskConfig { - s.TaskTimeLimitInSeconds = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListProcessingJobsInput) SetSortOrder(v string) *ListProcessingJobsInput { + s.SortOrder = &v return s } -// SetTaskTitle sets the TaskTitle field's value. -func (s *HumanTaskConfig) SetTaskTitle(v string) *HumanTaskConfig { - s.TaskTitle = &v +// SetStatusEquals sets the StatusEquals field's value. +func (s *ListProcessingJobsInput) SetStatusEquals(v string) *ListProcessingJobsInput { + s.StatusEquals = &v return s } -// SetUiConfig sets the UiConfig field's value. -func (s *HumanTaskConfig) SetUiConfig(v *UiConfig) *HumanTaskConfig { - s.UiConfig = v +type ListProcessingJobsOutput struct { + _ struct{} `type:"structure"` + + // If the response is truncated, Amazon SageMaker returns this token. To retrieve + // the next set of processing jobs, use it in the subsequent request. + NextToken *string `type:"string"` + + // An array of ProcessingJobSummary objects, each listing a processing job. + // + // ProcessingJobSummaries is a required field + ProcessingJobSummaries []*ProcessingJobSummary `type:"list" required:"true"` +} + +// String returns the string representation +func (s ListProcessingJobsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListProcessingJobsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListProcessingJobsOutput) SetNextToken(v string) *ListProcessingJobsOutput { + s.NextToken = &v return s } -// SetWorkteamArn sets the WorkteamArn field's value. -func (s *HumanTaskConfig) SetWorkteamArn(v string) *HumanTaskConfig { - s.WorkteamArn = &v +// SetProcessingJobSummaries sets the ProcessingJobSummaries field's value. +func (s *ListProcessingJobsOutput) SetProcessingJobSummaries(v []*ProcessingJobSummary) *ListProcessingJobsOutput { + s.ProcessingJobSummaries = v return s } -// Specifies which training algorithm to use for training jobs that a hyperparameter -// tuning job launches and the metrics to monitor. -type HyperParameterAlgorithmSpecification struct { +type ListSubscribedWorkteamsInput struct { _ struct{} `type:"structure"` - // The name of the resource algorithm to use for the hyperparameter tuning job. - // If you specify a value for this parameter, do not specify a value for TrainingImage. - AlgorithmName *string `min:"1" type:"string"` - - // An array of MetricDefinition objects that specify the metrics that the algorithm - // emits. - MetricDefinitions []*MetricDefinition `type:"list"` + // The maximum number of work teams to return in each page of the response. + MaxResults *int64 `min:"1" type:"integer"` - // The registry path of the Docker image that contains the training algorithm. - // For information about Docker registry paths for built-in algorithms, see - // Algorithms Provided by Amazon SageMaker: Common Parameters (https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-algo-docker-registry-paths.html). - // Amazon SageMaker supports both registry/repository[:tag] and registry/repository[@digest] - // image path formats. For more information, see Using Your Own Algorithms with - // Amazon SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html). - TrainingImage *string `type:"string"` + // A string in the work team name. This filter returns only work teams whose + // name contains the specified string. + NameContains *string `min:"1" type:"string"` - // The input mode that the algorithm supports: File or Pipe. In File input mode, - // Amazon SageMaker downloads the training data from Amazon S3 to the storage - // volume that is attached to the training instance and mounts the directory - // to the Docker volume for the training container. In Pipe input mode, Amazon - // SageMaker streams data directly from Amazon S3 to the container. - // - // If you specify File mode, make sure that you provision the storage volume - // that is attached to the training instance with enough capacity to accommodate - // the training data downloaded from Amazon S3, the model artifacts, and intermediate - // information. - // - // For more information about input modes, see Algorithms (https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html). - // - // TrainingInputMode is a required field - TrainingInputMode *string `type:"string" required:"true" enum:"TrainingInputMode"` + // If the result of the previous ListSubscribedWorkteams request was truncated, + // the response includes a NextToken. To retrieve the next set of labeling jobs, + // use the token in the next request. + NextToken *string `type:"string"` } // String returns the string representation -func (s HyperParameterAlgorithmSpecification) String() string { +func (s ListSubscribedWorkteamsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HyperParameterAlgorithmSpecification) GoString() string { +func (s ListSubscribedWorkteamsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *HyperParameterAlgorithmSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HyperParameterAlgorithmSpecification"} - if s.AlgorithmName != nil && len(*s.AlgorithmName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AlgorithmName", 1)) - } - if s.TrainingInputMode == nil { - invalidParams.Add(request.NewErrParamRequired("TrainingInputMode")) +func (s *ListSubscribedWorkteamsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListSubscribedWorkteamsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } - if s.MetricDefinitions != nil { - for i, v := range s.MetricDefinitions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricDefinitions", i), err.(request.ErrInvalidParams)) - } - } + if s.NameContains != nil && len(*s.NameContains) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NameContains", 1)) } if invalidParams.Len() > 0 { @@ -15739,86 +34274,94 @@ func (s *HyperParameterAlgorithmSpecification) Validate() error { return nil } -// SetAlgorithmName sets the AlgorithmName field's value. -func (s *HyperParameterAlgorithmSpecification) SetAlgorithmName(v string) *HyperParameterAlgorithmSpecification { - s.AlgorithmName = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListSubscribedWorkteamsInput) SetMaxResults(v int64) *ListSubscribedWorkteamsInput { + s.MaxResults = &v return s } -// SetMetricDefinitions sets the MetricDefinitions field's value. -func (s *HyperParameterAlgorithmSpecification) SetMetricDefinitions(v []*MetricDefinition) *HyperParameterAlgorithmSpecification { - s.MetricDefinitions = v +// SetNameContains sets the NameContains field's value. +func (s *ListSubscribedWorkteamsInput) SetNameContains(v string) *ListSubscribedWorkteamsInput { + s.NameContains = &v return s } -// SetTrainingImage sets the TrainingImage field's value. -func (s *HyperParameterAlgorithmSpecification) SetTrainingImage(v string) *HyperParameterAlgorithmSpecification { - s.TrainingImage = &v +// SetNextToken sets the NextToken field's value. +func (s *ListSubscribedWorkteamsInput) SetNextToken(v string) *ListSubscribedWorkteamsInput { + s.NextToken = &v return s } -// SetTrainingInputMode sets the TrainingInputMode field's value. -func (s *HyperParameterAlgorithmSpecification) SetTrainingInputMode(v string) *HyperParameterAlgorithmSpecification { - s.TrainingInputMode = &v - return s +type ListSubscribedWorkteamsOutput struct { + _ struct{} `type:"structure"` + + // If the response is truncated, Amazon SageMaker returns this token. To retrieve + // the next set of work teams, use it in the subsequent request. + NextToken *string `type:"string"` + + // An array of Workteam objects, each describing a work team. + // + // SubscribedWorkteams is a required field + SubscribedWorkteams []*SubscribedWorkteam `type:"list" required:"true"` } -// Defines a hyperparameter to be used by an algorithm. -type HyperParameterSpecification struct { - _ struct{} `type:"structure"` +// String returns the string representation +func (s ListSubscribedWorkteamsOutput) String() string { + return awsutil.Prettify(s) +} - // The default value for this hyperparameter. If a default value is specified, - // a hyperparameter cannot be required. - DefaultValue *string `type:"string"` +// GoString returns the string representation +func (s ListSubscribedWorkteamsOutput) GoString() string { + return s.String() +} - // A brief description of the hyperparameter. - Description *string `type:"string"` +// SetNextToken sets the NextToken field's value. +func (s *ListSubscribedWorkteamsOutput) SetNextToken(v string) *ListSubscribedWorkteamsOutput { + s.NextToken = &v + return s +} - // Indicates whether this hyperparameter is required. - IsRequired *bool `type:"boolean"` +// SetSubscribedWorkteams sets the SubscribedWorkteams field's value. +func (s *ListSubscribedWorkteamsOutput) SetSubscribedWorkteams(v []*SubscribedWorkteam) *ListSubscribedWorkteamsOutput { + s.SubscribedWorkteams = v + return s +} - // Indicates whether this hyperparameter is tunable in a hyperparameter tuning - // job. - IsTunable *bool `type:"boolean"` +type ListTagsInput struct { + _ struct{} `type:"structure"` - // The name of this hyperparameter. The name must be unique. - // - // Name is a required field - Name *string `type:"string" required:"true"` + // Maximum number of tags to return. + MaxResults *int64 `min:"50" type:"integer"` - // The allowed range for this hyperparameter. - Range *ParameterRange `type:"structure"` + // If the response to the previous ListTags request is truncated, Amazon SageMaker + // returns this token. To retrieve the next set of tags, use it in the subsequent + // request. + NextToken *string `type:"string"` - // The type of this hyperparameter. The valid types are Integer, Continuous, - // Categorical, and FreeText. + // The Amazon Resource Name (ARN) of the resource whose tags you want to retrieve. // - // Type is a required field - Type *string `type:"string" required:"true" enum:"ParameterType"` + // ResourceArn is a required field + ResourceArn *string `type:"string" required:"true"` } // String returns the string representation -func (s HyperParameterSpecification) String() string { +func (s ListTagsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HyperParameterSpecification) GoString() string { +func (s ListTagsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *HyperParameterSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HyperParameterSpecification"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) +func (s *ListTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTagsInput"} + if s.MaxResults != nil && *s.MaxResults < 50 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 50)) } - if s.Range != nil { - if err := s.Range.Validate(); err != nil { - invalidParams.AddNested("Range", err.(request.ErrInvalidParams)) - } + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) } if invalidParams.Len() > 0 { @@ -15827,203 +34370,107 @@ func (s *HyperParameterSpecification) Validate() error { return nil } -// SetDefaultValue sets the DefaultValue field's value. -func (s *HyperParameterSpecification) SetDefaultValue(v string) *HyperParameterSpecification { - s.DefaultValue = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListTagsInput) SetMaxResults(v int64) *ListTagsInput { + s.MaxResults = &v return s } -// SetDescription sets the Description field's value. -func (s *HyperParameterSpecification) SetDescription(v string) *HyperParameterSpecification { - s.Description = &v +// SetNextToken sets the NextToken field's value. +func (s *ListTagsInput) SetNextToken(v string) *ListTagsInput { + s.NextToken = &v return s } -// SetIsRequired sets the IsRequired field's value. -func (s *HyperParameterSpecification) SetIsRequired(v bool) *HyperParameterSpecification { - s.IsRequired = &v +// SetResourceArn sets the ResourceArn field's value. +func (s *ListTagsInput) SetResourceArn(v string) *ListTagsInput { + s.ResourceArn = &v return s } -// SetIsTunable sets the IsTunable field's value. -func (s *HyperParameterSpecification) SetIsTunable(v bool) *HyperParameterSpecification { - s.IsTunable = &v - return s +type ListTagsOutput struct { + _ struct{} `type:"structure"` + + // If response is truncated, Amazon SageMaker includes a token in the response. + // You can use this token in your subsequent request to fetch next set of tokens. + NextToken *string `type:"string"` + + // An array of Tag objects, each with a tag key and a value. + Tags []*Tag `type:"list"` } -// SetName sets the Name field's value. -func (s *HyperParameterSpecification) SetName(v string) *HyperParameterSpecification { - s.Name = &v - return s +// String returns the string representation +func (s ListTagsOutput) String() string { + return awsutil.Prettify(s) } -// SetRange sets the Range field's value. -func (s *HyperParameterSpecification) SetRange(v *ParameterRange) *HyperParameterSpecification { - s.Range = v +// 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 } -// SetType sets the Type field's value. -func (s *HyperParameterSpecification) SetType(v string) *HyperParameterSpecification { - s.Type = &v +// SetTags sets the Tags field's value. +func (s *ListTagsOutput) SetTags(v []*Tag) *ListTagsOutput { + s.Tags = v return s } -// Defines the training jobs launched by a hyperparameter tuning job. -type HyperParameterTrainingJobDefinition struct { +type ListTrainingJobsForHyperParameterTuningJobInput struct { _ struct{} `type:"structure"` - // The HyperParameterAlgorithmSpecification object that specifies the resource - // algorithm to use for the training jobs that the tuning job launches. - // - // AlgorithmSpecification is a required field - AlgorithmSpecification *HyperParameterAlgorithmSpecification `type:"structure" required:"true"` - - // Contains information about the output location for managed spot training - // checkpoint data. - CheckpointConfig *CheckpointConfig `type:"structure"` - - // To encrypt all communications between ML compute instances in distributed - // training, choose True. Encryption provides greater security for distributed - // training, but training might take longer. How long it takes depends on the - // amount of communication between compute instances, especially if you use - // a deep learning algorithm in distributed training. - EnableInterContainerTrafficEncryption *bool `type:"boolean"` - - // A Boolean indicating whether managed spot training is enabled (True) or not - // (False). - EnableManagedSpotTraining *bool `type:"boolean"` - - // Isolates the training container. No inbound or outbound network calls can - // be made, except for calls between peers within a training cluster for distributed - // training. If network isolation is used for training jobs that are configured - // to use a VPC, Amazon SageMaker downloads and uploads customer data and model - // artifacts through the specified VPC, but the training container does not - // have network access. - // - // The Semantic Segmentation built-in algorithm does not support network isolation. - EnableNetworkIsolation *bool `type:"boolean"` - - // An array of Channel objects that specify the input for the training jobs - // that the tuning job launches. - InputDataConfig []*Channel `min:"1" type:"list"` - - // Specifies the path to the Amazon S3 bucket where you store model artifacts - // from the training jobs that the tuning job launches. - // - // OutputDataConfig is a required field - OutputDataConfig *OutputDataConfig `type:"structure" required:"true"` - - // The resources, including the compute instances and storage volumes, to use - // for the training jobs that the tuning job launches. - // - // Storage volumes store model artifacts and incremental states. Training algorithms - // might also use storage volumes for scratch space. If you want Amazon SageMaker - // to use the storage volume to store the training data, choose File as the - // TrainingInputMode in the algorithm specification. For distributed training - // algorithms, specify an instance count greater than 1. + // The name of the tuning job whose training jobs you want to list. // - // ResourceConfig is a required field - ResourceConfig *ResourceConfig `type:"structure" required:"true"` + // HyperParameterTuningJobName is a required field + HyperParameterTuningJobName *string `min:"1" type:"string" required:"true"` - // The Amazon Resource Name (ARN) of the IAM role associated with the training - // jobs that the tuning job launches. - // - // RoleArn is a required field - RoleArn *string `min:"20" type:"string" required:"true"` + // The maximum number of training jobs to return. The default value is 10. + MaxResults *int64 `min:"1" type:"integer"` - // Specifies the values of hyperparameters that do not change for the tuning - // job. - StaticHyperParameters map[string]*string `type:"map"` + // If the result of the previous ListTrainingJobsForHyperParameterTuningJob + // request was truncated, the response includes a NextToken. To retrieve the + // next set of training jobs, use the token in the next request. + NextToken *string `type:"string"` - // Specifies a limit to how long a model hyperparameter training job can run. - // It also specifies how long you are willing to wait for a managed spot training - // job to complete. When the job reaches the a limit, Amazon SageMaker ends - // the training job. Use this API to cap model training costs. + // The field to sort results by. The default is Name. // - // StoppingCondition is a required field - StoppingCondition *StoppingCondition `type:"structure" required:"true"` + // If the value of this field is FinalObjectiveMetricValue, any training jobs + // that did not return an objective metric are not listed. + SortBy *string `type:"string" enum:"TrainingJobSortByOptions"` - // The VpcConfig object that specifies the VPC that you want the training jobs - // that this hyperparameter tuning job launches to connect to. Control access - // to and from your training container by configuring the VPC. For more information, - // see Protect Training Jobs by Using an Amazon Virtual Private Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html). - VpcConfig *VpcConfig `type:"structure"` + // The sort order for results. The default is Ascending. + SortOrder *string `type:"string" enum:"SortOrder"` + + // A filter that returns only training jobs with the specified status. + StatusEquals *string `type:"string" enum:"TrainingJobStatus"` } // String returns the string representation -func (s HyperParameterTrainingJobDefinition) String() string { +func (s ListTrainingJobsForHyperParameterTuningJobInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HyperParameterTrainingJobDefinition) GoString() string { +func (s ListTrainingJobsForHyperParameterTuningJobInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *HyperParameterTrainingJobDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HyperParameterTrainingJobDefinition"} - if s.AlgorithmSpecification == nil { - invalidParams.Add(request.NewErrParamRequired("AlgorithmSpecification")) - } - if s.InputDataConfig != nil && len(s.InputDataConfig) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InputDataConfig", 1)) - } - if s.OutputDataConfig == nil { - invalidParams.Add(request.NewErrParamRequired("OutputDataConfig")) - } - if s.ResourceConfig == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceConfig")) - } - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) - } - if s.StoppingCondition == nil { - invalidParams.Add(request.NewErrParamRequired("StoppingCondition")) - } - if s.AlgorithmSpecification != nil { - if err := s.AlgorithmSpecification.Validate(); err != nil { - invalidParams.AddNested("AlgorithmSpecification", err.(request.ErrInvalidParams)) - } - } - if s.CheckpointConfig != nil { - if err := s.CheckpointConfig.Validate(); err != nil { - invalidParams.AddNested("CheckpointConfig", err.(request.ErrInvalidParams)) - } - } - if s.InputDataConfig != nil { - for i, v := range s.InputDataConfig { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputDataConfig", i), err.(request.ErrInvalidParams)) - } - } - } - if s.OutputDataConfig != nil { - if err := s.OutputDataConfig.Validate(); err != nil { - invalidParams.AddNested("OutputDataConfig", err.(request.ErrInvalidParams)) - } - } - if s.ResourceConfig != nil { - if err := s.ResourceConfig.Validate(); err != nil { - invalidParams.AddNested("ResourceConfig", err.(request.ErrInvalidParams)) - } +func (s *ListTrainingJobsForHyperParameterTuningJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTrainingJobsForHyperParameterTuningJobInput"} + if s.HyperParameterTuningJobName == nil { + invalidParams.Add(request.NewErrParamRequired("HyperParameterTuningJobName")) } - if s.StoppingCondition != nil { - if err := s.StoppingCondition.Validate(); err != nil { - invalidParams.AddNested("StoppingCondition", err.(request.ErrInvalidParams)) - } + if s.HyperParameterTuningJobName != nil && len(*s.HyperParameterTuningJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("HyperParameterTuningJobName", 1)) } - if s.VpcConfig != nil { - if err := s.VpcConfig.Validate(); err != nil { - invalidParams.AddNested("VpcConfig", err.(request.ErrInvalidParams)) - } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -16032,296 +34479,291 @@ func (s *HyperParameterTrainingJobDefinition) Validate() error { return nil } -// SetAlgorithmSpecification sets the AlgorithmSpecification field's value. -func (s *HyperParameterTrainingJobDefinition) SetAlgorithmSpecification(v *HyperParameterAlgorithmSpecification) *HyperParameterTrainingJobDefinition { - s.AlgorithmSpecification = v +// SetHyperParameterTuningJobName sets the HyperParameterTuningJobName field's value. +func (s *ListTrainingJobsForHyperParameterTuningJobInput) SetHyperParameterTuningJobName(v string) *ListTrainingJobsForHyperParameterTuningJobInput { + s.HyperParameterTuningJobName = &v return s } -// SetCheckpointConfig sets the CheckpointConfig field's value. -func (s *HyperParameterTrainingJobDefinition) SetCheckpointConfig(v *CheckpointConfig) *HyperParameterTrainingJobDefinition { - s.CheckpointConfig = v +// SetMaxResults sets the MaxResults field's value. +func (s *ListTrainingJobsForHyperParameterTuningJobInput) SetMaxResults(v int64) *ListTrainingJobsForHyperParameterTuningJobInput { + s.MaxResults = &v return s } -// SetEnableInterContainerTrafficEncryption sets the EnableInterContainerTrafficEncryption field's value. -func (s *HyperParameterTrainingJobDefinition) SetEnableInterContainerTrafficEncryption(v bool) *HyperParameterTrainingJobDefinition { - s.EnableInterContainerTrafficEncryption = &v +// SetNextToken sets the NextToken field's value. +func (s *ListTrainingJobsForHyperParameterTuningJobInput) SetNextToken(v string) *ListTrainingJobsForHyperParameterTuningJobInput { + s.NextToken = &v return s } -// SetEnableManagedSpotTraining sets the EnableManagedSpotTraining field's value. -func (s *HyperParameterTrainingJobDefinition) SetEnableManagedSpotTraining(v bool) *HyperParameterTrainingJobDefinition { - s.EnableManagedSpotTraining = &v +// SetSortBy sets the SortBy field's value. +func (s *ListTrainingJobsForHyperParameterTuningJobInput) SetSortBy(v string) *ListTrainingJobsForHyperParameterTuningJobInput { + s.SortBy = &v return s } -// SetEnableNetworkIsolation sets the EnableNetworkIsolation field's value. -func (s *HyperParameterTrainingJobDefinition) SetEnableNetworkIsolation(v bool) *HyperParameterTrainingJobDefinition { - s.EnableNetworkIsolation = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListTrainingJobsForHyperParameterTuningJobInput) SetSortOrder(v string) *ListTrainingJobsForHyperParameterTuningJobInput { + s.SortOrder = &v return s } -// SetInputDataConfig sets the InputDataConfig field's value. -func (s *HyperParameterTrainingJobDefinition) SetInputDataConfig(v []*Channel) *HyperParameterTrainingJobDefinition { - s.InputDataConfig = v +// SetStatusEquals sets the StatusEquals field's value. +func (s *ListTrainingJobsForHyperParameterTuningJobInput) SetStatusEquals(v string) *ListTrainingJobsForHyperParameterTuningJobInput { + s.StatusEquals = &v return s } -// SetOutputDataConfig sets the OutputDataConfig field's value. -func (s *HyperParameterTrainingJobDefinition) SetOutputDataConfig(v *OutputDataConfig) *HyperParameterTrainingJobDefinition { - s.OutputDataConfig = v - return s -} +type ListTrainingJobsForHyperParameterTuningJobOutput struct { + _ struct{} `type:"structure"` -// SetResourceConfig sets the ResourceConfig field's value. -func (s *HyperParameterTrainingJobDefinition) SetResourceConfig(v *ResourceConfig) *HyperParameterTrainingJobDefinition { - s.ResourceConfig = v - return s + // If the result of this ListTrainingJobsForHyperParameterTuningJob request + // was truncated, the response includes a NextToken. To retrieve the next set + // of training jobs, use the token in the next request. + NextToken *string `type:"string"` + + // A list of TrainingJobSummary objects that describe the training jobs that + // the ListTrainingJobsForHyperParameterTuningJob request returned. + // + // TrainingJobSummaries is a required field + TrainingJobSummaries []*HyperParameterTrainingJobSummary `type:"list" required:"true"` } -// SetRoleArn sets the RoleArn field's value. -func (s *HyperParameterTrainingJobDefinition) SetRoleArn(v string) *HyperParameterTrainingJobDefinition { - s.RoleArn = &v - return s +// String returns the string representation +func (s ListTrainingJobsForHyperParameterTuningJobOutput) String() string { + return awsutil.Prettify(s) } -// SetStaticHyperParameters sets the StaticHyperParameters field's value. -func (s *HyperParameterTrainingJobDefinition) SetStaticHyperParameters(v map[string]*string) *HyperParameterTrainingJobDefinition { - s.StaticHyperParameters = v - return s +// GoString returns the string representation +func (s ListTrainingJobsForHyperParameterTuningJobOutput) GoString() string { + return s.String() } -// SetStoppingCondition sets the StoppingCondition field's value. -func (s *HyperParameterTrainingJobDefinition) SetStoppingCondition(v *StoppingCondition) *HyperParameterTrainingJobDefinition { - s.StoppingCondition = v +// SetNextToken sets the NextToken field's value. +func (s *ListTrainingJobsForHyperParameterTuningJobOutput) SetNextToken(v string) *ListTrainingJobsForHyperParameterTuningJobOutput { + s.NextToken = &v return s } -// SetVpcConfig sets the VpcConfig field's value. -func (s *HyperParameterTrainingJobDefinition) SetVpcConfig(v *VpcConfig) *HyperParameterTrainingJobDefinition { - s.VpcConfig = v +// SetTrainingJobSummaries sets the TrainingJobSummaries field's value. +func (s *ListTrainingJobsForHyperParameterTuningJobOutput) SetTrainingJobSummaries(v []*HyperParameterTrainingJobSummary) *ListTrainingJobsForHyperParameterTuningJobOutput { + s.TrainingJobSummaries = v return s } -// Specifies summary information about a training job. -type HyperParameterTrainingJobSummary struct { +type ListTrainingJobsInput struct { _ struct{} `type:"structure"` - // The date and time that the training job was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` - - // The reason that the training job failed. - FailureReason *string `type:"string"` + // A filter that returns only training jobs created after the specified time + // (timestamp). + CreationTimeAfter *time.Time `type:"timestamp"` - // The FinalHyperParameterTuningJobObjectiveMetric object that specifies the - // value of the objective metric of the tuning job that launched this training - // job. - FinalHyperParameterTuningJobObjectiveMetric *FinalHyperParameterTuningJobObjectiveMetric `type:"structure"` + // A filter that returns only training jobs created before the specified time + // (timestamp). + CreationTimeBefore *time.Time `type:"timestamp"` - // The status of the objective metric for the training job: - // - // * Succeeded: The final objective metric for the training job was evaluated - // by the hyperparameter tuning job and used in the hyperparameter tuning - // process. - // - // * Pending: The training job is in progress and evaluation of its final - // objective metric is pending. - // - // * Failed: The final objective metric for the training job was not evaluated, - // and was not used in the hyperparameter tuning process. This typically - // occurs when the training job failed or did not emit an objective metric. - ObjectiveStatus *string `type:"string" enum:"ObjectiveStatus"` + // A filter that returns only training jobs modified after the specified time + // (timestamp). + LastModifiedTimeAfter *time.Time `type:"timestamp"` - // Specifies the time when the training job ends on training instances. You - // are billed for the time interval between the value of TrainingStartTime and - // this time. For successful jobs and stopped jobs, this is the time after model - // artifacts are uploaded. For failed jobs, this is the time when Amazon SageMaker - // detects a job failure. - TrainingEndTime *time.Time `type:"timestamp"` + // A filter that returns only training jobs modified before the specified time + // (timestamp). + LastModifiedTimeBefore *time.Time `type:"timestamp"` - // The Amazon Resource Name (ARN) of the training job. - // - // TrainingJobArn is a required field - TrainingJobArn *string `type:"string" required:"true"` + // The maximum number of training jobs to return in the response. + MaxResults *int64 `min:"1" type:"integer"` - // The name of the training job. - // - // TrainingJobName is a required field - TrainingJobName *string `min:"1" type:"string" required:"true"` + // A string in the training job name. This filter returns only training jobs + // whose name contains the specified string. + NameContains *string `type:"string"` - // The status of the training job. - // - // TrainingJobStatus is a required field - TrainingJobStatus *string `type:"string" required:"true" enum:"TrainingJobStatus"` + // If the result of the previous ListTrainingJobs request was truncated, the + // response includes a NextToken. To retrieve the next set of training jobs, + // use the token in the next request. + NextToken *string `type:"string"` - // The date and time that the training job started. - TrainingStartTime *time.Time `type:"timestamp"` + // The field to sort results by. The default is CreationTime. + SortBy *string `type:"string" enum:"SortBy"` - // A list of the hyperparameters for which you specified ranges to search. - // - // TunedHyperParameters is a required field - TunedHyperParameters map[string]*string `type:"map" required:"true"` + // The sort order for results. The default is Ascending. + SortOrder *string `type:"string" enum:"SortOrder"` - // The HyperParameter tuning job that launched the training job. - TuningJobName *string `min:"1" type:"string"` + // A filter that retrieves only training jobs with a specific status. + StatusEquals *string `type:"string" enum:"TrainingJobStatus"` } // String returns the string representation -func (s HyperParameterTrainingJobSummary) String() string { +func (s ListTrainingJobsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HyperParameterTrainingJobSummary) GoString() string { +func (s ListTrainingJobsInput) GoString() string { return s.String() } -// SetCreationTime sets the CreationTime field's value. -func (s *HyperParameterTrainingJobSummary) SetCreationTime(v time.Time) *HyperParameterTrainingJobSummary { - s.CreationTime = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTrainingJobsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTrainingJobsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListTrainingJobsInput) SetCreationTimeAfter(v time.Time) *ListTrainingJobsInput { + s.CreationTimeAfter = &v return s } -// SetFailureReason sets the FailureReason field's value. -func (s *HyperParameterTrainingJobSummary) SetFailureReason(v string) *HyperParameterTrainingJobSummary { - s.FailureReason = &v +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListTrainingJobsInput) SetCreationTimeBefore(v time.Time) *ListTrainingJobsInput { + s.CreationTimeBefore = &v return s } -// SetFinalHyperParameterTuningJobObjectiveMetric sets the FinalHyperParameterTuningJobObjectiveMetric field's value. -func (s *HyperParameterTrainingJobSummary) SetFinalHyperParameterTuningJobObjectiveMetric(v *FinalHyperParameterTuningJobObjectiveMetric) *HyperParameterTrainingJobSummary { - s.FinalHyperParameterTuningJobObjectiveMetric = v +// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. +func (s *ListTrainingJobsInput) SetLastModifiedTimeAfter(v time.Time) *ListTrainingJobsInput { + s.LastModifiedTimeAfter = &v return s } -// SetObjectiveStatus sets the ObjectiveStatus field's value. -func (s *HyperParameterTrainingJobSummary) SetObjectiveStatus(v string) *HyperParameterTrainingJobSummary { - s.ObjectiveStatus = &v +// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. +func (s *ListTrainingJobsInput) SetLastModifiedTimeBefore(v time.Time) *ListTrainingJobsInput { + s.LastModifiedTimeBefore = &v return s } -// SetTrainingEndTime sets the TrainingEndTime field's value. -func (s *HyperParameterTrainingJobSummary) SetTrainingEndTime(v time.Time) *HyperParameterTrainingJobSummary { - s.TrainingEndTime = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListTrainingJobsInput) SetMaxResults(v int64) *ListTrainingJobsInput { + s.MaxResults = &v return s } -// SetTrainingJobArn sets the TrainingJobArn field's value. -func (s *HyperParameterTrainingJobSummary) SetTrainingJobArn(v string) *HyperParameterTrainingJobSummary { - s.TrainingJobArn = &v +// SetNameContains sets the NameContains field's value. +func (s *ListTrainingJobsInput) SetNameContains(v string) *ListTrainingJobsInput { + s.NameContains = &v return s } -// SetTrainingJobName sets the TrainingJobName field's value. -func (s *HyperParameterTrainingJobSummary) SetTrainingJobName(v string) *HyperParameterTrainingJobSummary { - s.TrainingJobName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListTrainingJobsInput) SetNextToken(v string) *ListTrainingJobsInput { + s.NextToken = &v return s } -// SetTrainingJobStatus sets the TrainingJobStatus field's value. -func (s *HyperParameterTrainingJobSummary) SetTrainingJobStatus(v string) *HyperParameterTrainingJobSummary { - s.TrainingJobStatus = &v +// SetSortBy sets the SortBy field's value. +func (s *ListTrainingJobsInput) SetSortBy(v string) *ListTrainingJobsInput { + s.SortBy = &v return s } -// SetTrainingStartTime sets the TrainingStartTime field's value. -func (s *HyperParameterTrainingJobSummary) SetTrainingStartTime(v time.Time) *HyperParameterTrainingJobSummary { - s.TrainingStartTime = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListTrainingJobsInput) SetSortOrder(v string) *ListTrainingJobsInput { + s.SortOrder = &v return s } -// SetTunedHyperParameters sets the TunedHyperParameters field's value. -func (s *HyperParameterTrainingJobSummary) SetTunedHyperParameters(v map[string]*string) *HyperParameterTrainingJobSummary { - s.TunedHyperParameters = v +// SetStatusEquals sets the StatusEquals field's value. +func (s *ListTrainingJobsInput) SetStatusEquals(v string) *ListTrainingJobsInput { + s.StatusEquals = &v return s } -// SetTuningJobName sets the TuningJobName field's value. -func (s *HyperParameterTrainingJobSummary) SetTuningJobName(v string) *HyperParameterTrainingJobSummary { - s.TuningJobName = &v +type ListTrainingJobsOutput struct { + _ struct{} `type:"structure"` + + // If the response is truncated, Amazon SageMaker returns this token. To retrieve + // the next set of training jobs, use it in the subsequent request. + NextToken *string `type:"string"` + + // An array of TrainingJobSummary objects, each listing a training job. + // + // TrainingJobSummaries is a required field + TrainingJobSummaries []*TrainingJobSummary `type:"list" required:"true"` +} + +// String returns the string representation +func (s ListTrainingJobsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListTrainingJobsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTrainingJobsOutput) SetNextToken(v string) *ListTrainingJobsOutput { + s.NextToken = &v return s } -// Configures a hyperparameter tuning job. -type HyperParameterTuningJobConfig struct { +// SetTrainingJobSummaries sets the TrainingJobSummaries field's value. +func (s *ListTrainingJobsOutput) SetTrainingJobSummaries(v []*TrainingJobSummary) *ListTrainingJobsOutput { + s.TrainingJobSummaries = v + return s +} + +type ListTransformJobsInput struct { _ struct{} `type:"structure"` - // The HyperParameterTuningJobObjective object that specifies the objective - // metric for this tuning job. - HyperParameterTuningJobObjective *HyperParameterTuningJobObjective `type:"structure"` + // A filter that returns only transform jobs created after the specified time. + CreationTimeAfter *time.Time `type:"timestamp"` - // The ParameterRanges object that specifies the ranges of hyperparameters that - // this tuning job searches. - ParameterRanges *ParameterRanges `type:"structure"` + // A filter that returns only transform jobs created before the specified time. + CreationTimeBefore *time.Time `type:"timestamp"` - // The ResourceLimits object that specifies the maximum number of training jobs - // and parallel training jobs for this tuning job. - // - // ResourceLimits is a required field - ResourceLimits *ResourceLimits `type:"structure" required:"true"` + // A filter that returns only transform jobs modified after the specified time. + LastModifiedTimeAfter *time.Time `type:"timestamp"` - // Specifies how hyperparameter tuning chooses the combinations of hyperparameter - // values to use for the training job it launches. To use the Bayesian search - // stategy, set this to Bayesian. To randomly search, set it to Random. For - // information about search strategies, see How Hyperparameter Tuning Works - // (https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-how-it-works.html). - // - // Strategy is a required field - Strategy *string `type:"string" required:"true" enum:"HyperParameterTuningJobStrategyType"` + // A filter that returns only transform jobs modified before the specified time. + LastModifiedTimeBefore *time.Time `type:"timestamp"` - // Specifies whether to use early stopping for training jobs launched by the - // hyperparameter tuning job. This can be one of the following values (the default - // value is OFF): - // - // OFF - // - // Training jobs launched by the hyperparameter tuning job do not use early - // stopping. - // - // AUTO - // - // Amazon SageMaker stops training jobs launched by the hyperparameter tuning - // job when they are unlikely to perform better than previously completed training - // jobs. For more information, see Stop Training Jobs Early (https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-early-stopping.html). - TrainingJobEarlyStoppingType *string `type:"string" enum:"TrainingJobEarlyStoppingType"` + // The maximum number of transform jobs to return in the response. The default + // value is 10. + MaxResults *int64 `min:"1" type:"integer"` + + // A string in the transform job name. This filter returns only transform jobs + // whose name contains the specified string. + NameContains *string `type:"string"` + + // If the result of the previous ListTransformJobs request was truncated, the + // response includes a NextToken. To retrieve the next set of transform jobs, + // use the token in the next request. + NextToken *string `type:"string"` + + // The field to sort results by. The default is CreationTime. + SortBy *string `type:"string" enum:"SortBy"` + + // The sort order for results. The default is Descending. + SortOrder *string `type:"string" enum:"SortOrder"` + + // A filter that retrieves only transform jobs with a specific status. + StatusEquals *string `type:"string" enum:"TransformJobStatus"` } // String returns the string representation -func (s HyperParameterTuningJobConfig) String() string { +func (s ListTransformJobsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HyperParameterTuningJobConfig) GoString() string { +func (s ListTransformJobsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *HyperParameterTuningJobConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HyperParameterTuningJobConfig"} - if s.ResourceLimits == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceLimits")) - } - if s.Strategy == nil { - invalidParams.Add(request.NewErrParamRequired("Strategy")) - } - if s.HyperParameterTuningJobObjective != nil { - if err := s.HyperParameterTuningJobObjective.Validate(); err != nil { - invalidParams.AddNested("HyperParameterTuningJobObjective", err.(request.ErrInvalidParams)) - } - } - if s.ParameterRanges != nil { - if err := s.ParameterRanges.Validate(); err != nil { - invalidParams.AddNested("ParameterRanges", err.(request.ErrInvalidParams)) - } - } - if s.ResourceLimits != nil { - if err := s.ResourceLimits.Validate(); err != nil { - invalidParams.AddNested("ResourceLimits", err.(request.ErrInvalidParams)) - } +func (s *ListTransformJobsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTransformJobsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -16330,404 +34772,305 @@ func (s *HyperParameterTuningJobConfig) Validate() error { return nil } -// SetHyperParameterTuningJobObjective sets the HyperParameterTuningJobObjective field's value. -func (s *HyperParameterTuningJobConfig) SetHyperParameterTuningJobObjective(v *HyperParameterTuningJobObjective) *HyperParameterTuningJobConfig { - s.HyperParameterTuningJobObjective = v +// SetCreationTimeAfter sets the CreationTimeAfter field's value. +func (s *ListTransformJobsInput) SetCreationTimeAfter(v time.Time) *ListTransformJobsInput { + s.CreationTimeAfter = &v return s } -// SetParameterRanges sets the ParameterRanges field's value. -func (s *HyperParameterTuningJobConfig) SetParameterRanges(v *ParameterRanges) *HyperParameterTuningJobConfig { - s.ParameterRanges = v +// SetCreationTimeBefore sets the CreationTimeBefore field's value. +func (s *ListTransformJobsInput) SetCreationTimeBefore(v time.Time) *ListTransformJobsInput { + s.CreationTimeBefore = &v + return s +} + +// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. +func (s *ListTransformJobsInput) SetLastModifiedTimeAfter(v time.Time) *ListTransformJobsInput { + s.LastModifiedTimeAfter = &v + return s +} + +// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. +func (s *ListTransformJobsInput) SetLastModifiedTimeBefore(v time.Time) *ListTransformJobsInput { + s.LastModifiedTimeBefore = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListTransformJobsInput) SetMaxResults(v int64) *ListTransformJobsInput { + s.MaxResults = &v + return s +} + +// SetNameContains sets the NameContains field's value. +func (s *ListTransformJobsInput) SetNameContains(v string) *ListTransformJobsInput { + s.NameContains = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListTransformJobsInput) SetNextToken(v string) *ListTransformJobsInput { + s.NextToken = &v return s } -// SetResourceLimits sets the ResourceLimits field's value. -func (s *HyperParameterTuningJobConfig) SetResourceLimits(v *ResourceLimits) *HyperParameterTuningJobConfig { - s.ResourceLimits = v +// SetSortBy sets the SortBy field's value. +func (s *ListTransformJobsInput) SetSortBy(v string) *ListTransformJobsInput { + s.SortBy = &v return s } -// SetStrategy sets the Strategy field's value. -func (s *HyperParameterTuningJobConfig) SetStrategy(v string) *HyperParameterTuningJobConfig { - s.Strategy = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListTransformJobsInput) SetSortOrder(v string) *ListTransformJobsInput { + s.SortOrder = &v return s } -// SetTrainingJobEarlyStoppingType sets the TrainingJobEarlyStoppingType field's value. -func (s *HyperParameterTuningJobConfig) SetTrainingJobEarlyStoppingType(v string) *HyperParameterTuningJobConfig { - s.TrainingJobEarlyStoppingType = &v +// SetStatusEquals sets the StatusEquals field's value. +func (s *ListTransformJobsInput) SetStatusEquals(v string) *ListTransformJobsInput { + s.StatusEquals = &v return s } -// Defines the objective metric for a hyperparameter tuning job. Hyperparameter -// tuning uses the value of this metric to evaluate the training jobs it launches, -// and returns the training job that results in either the highest or lowest -// value for this metric, depending on the value you specify for the Type parameter. -type HyperParameterTuningJobObjective struct { +type ListTransformJobsOutput struct { _ struct{} `type:"structure"` - // The name of the metric to use for the objective metric. - // - // MetricName is a required field - MetricName *string `min:"1" type:"string" required:"true"` + // If the response is truncated, Amazon SageMaker returns this token. To retrieve + // the next set of transform jobs, use it in the next request. + NextToken *string `type:"string"` - // Whether to minimize or maximize the objective metric. + // An array of TransformJobSummary objects. // - // Type is a required field - Type *string `type:"string" required:"true" enum:"HyperParameterTuningJobObjectiveType"` + // TransformJobSummaries is a required field + TransformJobSummaries []*TransformJobSummary `type:"list" required:"true"` } // String returns the string representation -func (s HyperParameterTuningJobObjective) String() string { +func (s ListTransformJobsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HyperParameterTuningJobObjective) GoString() string { +func (s ListTransformJobsOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *HyperParameterTuningJobObjective) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HyperParameterTuningJobObjective"} - 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.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMetricName sets the MetricName field's value. -func (s *HyperParameterTuningJobObjective) SetMetricName(v string) *HyperParameterTuningJobObjective { - s.MetricName = &v +// SetNextToken sets the NextToken field's value. +func (s *ListTransformJobsOutput) SetNextToken(v string) *ListTransformJobsOutput { + s.NextToken = &v return s } -// SetType sets the Type field's value. -func (s *HyperParameterTuningJobObjective) SetType(v string) *HyperParameterTuningJobObjective { - s.Type = &v +// SetTransformJobSummaries sets the TransformJobSummaries field's value. +func (s *ListTransformJobsOutput) SetTransformJobSummaries(v []*TransformJobSummary) *ListTransformJobsOutput { + s.TransformJobSummaries = v return s } -// Provides summary information about a hyperparameter tuning job. -type HyperParameterTuningJobSummary struct { +type ListTrialComponentsInput struct { _ struct{} `type:"structure"` - // The date and time that the tuning job was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` - - // The date and time that the tuning job ended. - HyperParameterTuningEndTime *time.Time `type:"timestamp"` + // A filter that returns only components created after the specified time. + CreatedAfter *time.Time `type:"timestamp"` - // The Amazon Resource Name (ARN) of the tuning job. - // - // HyperParameterTuningJobArn is a required field - HyperParameterTuningJobArn *string `type:"string" required:"true"` + // A filter that returns only components created before the specified time. + CreatedBefore *time.Time `type:"timestamp"` - // The name of the tuning job. - // - // HyperParameterTuningJobName is a required field - HyperParameterTuningJobName *string `min:"1" type:"string" required:"true"` + // A filter that returns only components that are part of the specified experiment. + // If you specify ExperimentName, you can't filter by SourceArn or TrialName. + ExperimentName *string `min:"1" type:"string"` - // The status of the tuning job. - // - // HyperParameterTuningJobStatus is a required field - HyperParameterTuningJobStatus *string `type:"string" required:"true" enum:"HyperParameterTuningJobStatus"` + // The maximum number of components to return in the response. The default value + // is 10. + MaxResults *int64 `min:"1" type:"integer"` - // The date and time that the tuning job was modified. - LastModifiedTime *time.Time `type:"timestamp"` + // If the previous call to ListTrialComponents didn't return the full set of + // components, the call returns a token for getting the next set of components. + NextToken *string `type:"string"` - // The ObjectiveStatusCounters object that specifies the numbers of training - // jobs, categorized by objective metric status, that this tuning job launched. - // - // ObjectiveStatusCounters is a required field - ObjectiveStatusCounters *ObjectiveStatusCounters `type:"structure" required:"true"` + // The property used to sort results. The default value is CreationTime. + SortBy *string `type:"string" enum:"SortTrialComponentsBy"` - // The ResourceLimits object that specifies the maximum number of training jobs - // and parallel training jobs allowed for this tuning job. - ResourceLimits *ResourceLimits `type:"structure"` + // The sort order. The default value is Descending. + SortOrder *string `type:"string" enum:"SortOrder"` - // Specifies the search strategy hyperparameter tuning uses to choose which - // hyperparameters to use for each iteration. Currently, the only valid value - // is Bayesian. - // - // Strategy is a required field - Strategy *string `type:"string" required:"true" enum:"HyperParameterTuningJobStrategyType"` + // A filter that returns only components that have the specified source Amazon + // Resource Name (ARN). If you specify SourceArn, you can't filter by ExperimentName + // or TrialName. + SourceArn *string `type:"string"` - // The TrainingJobStatusCounters object that specifies the numbers of training - // jobs, categorized by status, that this tuning job launched. - // - // TrainingJobStatusCounters is a required field - TrainingJobStatusCounters *TrainingJobStatusCounters `type:"structure" required:"true"` + // A filter that returns only components that are part of the specified trial. + // If you specify TrialName, you can't filter by ExperimentName or SourceArn. + TrialName *string `min:"1" type:"string"` } // String returns the string representation -func (s HyperParameterTuningJobSummary) String() string { +func (s ListTrialComponentsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HyperParameterTuningJobSummary) GoString() string { +func (s ListTrialComponentsInput) GoString() string { return s.String() } -// SetCreationTime sets the CreationTime field's value. -func (s *HyperParameterTuningJobSummary) SetCreationTime(v time.Time) *HyperParameterTuningJobSummary { - s.CreationTime = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListTrialComponentsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTrialComponentsInput"} + if s.ExperimentName != nil && len(*s.ExperimentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ExperimentName", 1)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.TrialName != nil && len(*s.TrialName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetHyperParameterTuningEndTime sets the HyperParameterTuningEndTime field's value. -func (s *HyperParameterTuningJobSummary) SetHyperParameterTuningEndTime(v time.Time) *HyperParameterTuningJobSummary { - s.HyperParameterTuningEndTime = &v +// SetCreatedAfter sets the CreatedAfter field's value. +func (s *ListTrialComponentsInput) SetCreatedAfter(v time.Time) *ListTrialComponentsInput { + s.CreatedAfter = &v return s } -// SetHyperParameterTuningJobArn sets the HyperParameterTuningJobArn field's value. -func (s *HyperParameterTuningJobSummary) SetHyperParameterTuningJobArn(v string) *HyperParameterTuningJobSummary { - s.HyperParameterTuningJobArn = &v +// SetCreatedBefore sets the CreatedBefore field's value. +func (s *ListTrialComponentsInput) SetCreatedBefore(v time.Time) *ListTrialComponentsInput { + s.CreatedBefore = &v return s } -// SetHyperParameterTuningJobName sets the HyperParameterTuningJobName field's value. -func (s *HyperParameterTuningJobSummary) SetHyperParameterTuningJobName(v string) *HyperParameterTuningJobSummary { - s.HyperParameterTuningJobName = &v +// SetExperimentName sets the ExperimentName field's value. +func (s *ListTrialComponentsInput) SetExperimentName(v string) *ListTrialComponentsInput { + s.ExperimentName = &v return s } -// SetHyperParameterTuningJobStatus sets the HyperParameterTuningJobStatus field's value. -func (s *HyperParameterTuningJobSummary) SetHyperParameterTuningJobStatus(v string) *HyperParameterTuningJobSummary { - s.HyperParameterTuningJobStatus = &v +// SetMaxResults sets the MaxResults field's value. +func (s *ListTrialComponentsInput) SetMaxResults(v int64) *ListTrialComponentsInput { + s.MaxResults = &v return s } -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *HyperParameterTuningJobSummary) SetLastModifiedTime(v time.Time) *HyperParameterTuningJobSummary { - s.LastModifiedTime = &v +// SetNextToken sets the NextToken field's value. +func (s *ListTrialComponentsInput) SetNextToken(v string) *ListTrialComponentsInput { + s.NextToken = &v return s } -// SetObjectiveStatusCounters sets the ObjectiveStatusCounters field's value. -func (s *HyperParameterTuningJobSummary) SetObjectiveStatusCounters(v *ObjectiveStatusCounters) *HyperParameterTuningJobSummary { - s.ObjectiveStatusCounters = v +// SetSortBy sets the SortBy field's value. +func (s *ListTrialComponentsInput) SetSortBy(v string) *ListTrialComponentsInput { + s.SortBy = &v return s } -// SetResourceLimits sets the ResourceLimits field's value. -func (s *HyperParameterTuningJobSummary) SetResourceLimits(v *ResourceLimits) *HyperParameterTuningJobSummary { - s.ResourceLimits = v +// SetSortOrder sets the SortOrder field's value. +func (s *ListTrialComponentsInput) SetSortOrder(v string) *ListTrialComponentsInput { + s.SortOrder = &v return s } -// SetStrategy sets the Strategy field's value. -func (s *HyperParameterTuningJobSummary) SetStrategy(v string) *HyperParameterTuningJobSummary { - s.Strategy = &v +// SetSourceArn sets the SourceArn field's value. +func (s *ListTrialComponentsInput) SetSourceArn(v string) *ListTrialComponentsInput { + s.SourceArn = &v return s } -// SetTrainingJobStatusCounters sets the TrainingJobStatusCounters field's value. -func (s *HyperParameterTuningJobSummary) SetTrainingJobStatusCounters(v *TrainingJobStatusCounters) *HyperParameterTuningJobSummary { - s.TrainingJobStatusCounters = v +// SetTrialName sets the TrialName field's value. +func (s *ListTrialComponentsInput) SetTrialName(v string) *ListTrialComponentsInput { + s.TrialName = &v return s } -// Specifies the configuration for a hyperparameter tuning job that uses one -// or more previous hyperparameter tuning jobs as a starting point. The results -// of previous tuning jobs are used to inform which combinations of hyperparameters -// to search over in the new tuning job. -// -// All training jobs launched by the new hyperparameter tuning job are evaluated -// by using the objective metric, and the training job that performs the best -// is compared to the best training jobs from the parent tuning jobs. From these, -// the training job that performs the best as measured by the objective metric -// is returned as the overall best training job. -// -// All training jobs launched by parent hyperparameter tuning jobs and the new -// hyperparameter tuning jobs count against the limit of training jobs for the -// tuning job. -type HyperParameterTuningJobWarmStartConfig struct { +type ListTrialComponentsOutput struct { _ struct{} `type:"structure"` - // An array of hyperparameter tuning jobs that are used as the starting point - // for the new hyperparameter tuning job. For more information about warm starting - // a hyperparameter tuning job, see Using a Previous Hyperparameter Tuning Job - // as a Starting Point (https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-warm-start.html). - // - // Hyperparameter tuning jobs created before October 1, 2018 cannot be used - // as parent jobs for warm start tuning jobs. - // - // ParentHyperParameterTuningJobs is a required field - ParentHyperParameterTuningJobs []*ParentHyperParameterTuningJob `min:"1" type:"list" required:"true"` + // A token for getting the next set of components, if there are any. + NextToken *string `type:"string"` - // Specifies one of the following: - // - // IDENTICAL_DATA_AND_ALGORITHM - // - // The new hyperparameter tuning job uses the same input data and training image - // as the parent tuning jobs. You can change the hyperparameter ranges to search - // and the maximum number of training jobs that the hyperparameter tuning job - // launches. You cannot use a new version of the training algorithm, unless - // the changes in the new version do not affect the algorithm itself. For example, - // changes that improve logging or adding support for a different data format - // are allowed. You can also change hyperparameters from tunable to static, - // and from static to tunable, but the total number of static plus tunable hyperparameters - // must remain the same as it is in all parent jobs. The objective metric for - // the new tuning job must be the same as for all parent jobs. - // - // TRANSFER_LEARNING - // - // The new hyperparameter tuning job can include input data, hyperparameter - // ranges, maximum number of concurrent training jobs, and maximum number of - // training jobs that are different than those of its parent hyperparameter - // tuning jobs. The training image can also be a different version from the - // version used in the parent hyperparameter tuning job. You can also change - // hyperparameters from tunable to static, and from static to tunable, but the - // total number of static plus tunable hyperparameters must remain the same - // as it is in all parent jobs. The objective metric for the new tuning job - // must be the same as for all parent jobs. - // - // WarmStartType is a required field - WarmStartType *string `type:"string" required:"true" enum:"HyperParameterTuningJobWarmStartType"` + // A list of the summaries of your trial components. + TrialComponentSummaries []*TrialComponentSummary `type:"list"` } // String returns the string representation -func (s HyperParameterTuningJobWarmStartConfig) String() string { +func (s ListTrialComponentsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s HyperParameterTuningJobWarmStartConfig) GoString() string { +func (s ListTrialComponentsOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *HyperParameterTuningJobWarmStartConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HyperParameterTuningJobWarmStartConfig"} - if s.ParentHyperParameterTuningJobs == nil { - invalidParams.Add(request.NewErrParamRequired("ParentHyperParameterTuningJobs")) - } - if s.ParentHyperParameterTuningJobs != nil && len(s.ParentHyperParameterTuningJobs) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ParentHyperParameterTuningJobs", 1)) - } - if s.WarmStartType == nil { - invalidParams.Add(request.NewErrParamRequired("WarmStartType")) - } - if s.ParentHyperParameterTuningJobs != nil { - for i, v := range s.ParentHyperParameterTuningJobs { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ParentHyperParameterTuningJobs", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetParentHyperParameterTuningJobs sets the ParentHyperParameterTuningJobs field's value. -func (s *HyperParameterTuningJobWarmStartConfig) SetParentHyperParameterTuningJobs(v []*ParentHyperParameterTuningJob) *HyperParameterTuningJobWarmStartConfig { - s.ParentHyperParameterTuningJobs = v +// SetNextToken sets the NextToken field's value. +func (s *ListTrialComponentsOutput) SetNextToken(v string) *ListTrialComponentsOutput { + s.NextToken = &v return s } -// SetWarmStartType sets the WarmStartType field's value. -func (s *HyperParameterTuningJobWarmStartConfig) SetWarmStartType(v string) *HyperParameterTuningJobWarmStartConfig { - s.WarmStartType = &v +// SetTrialComponentSummaries sets the TrialComponentSummaries field's value. +func (s *ListTrialComponentsOutput) SetTrialComponentSummaries(v []*TrialComponentSummary) *ListTrialComponentsOutput { + s.TrialComponentSummaries = v return s } -// Defines how to perform inference generation after a training job is run. -type InferenceSpecification struct { +type ListTrialsInput struct { _ struct{} `type:"structure"` - // The Amazon ECR registry path of the Docker image that contains the inference - // code. - // - // Containers is a required field - Containers []*ModelPackageContainerDefinition `min:"1" type:"list" required:"true"` + // A filter that returns only trials created after the specified time. + CreatedAfter *time.Time `type:"timestamp"` - // The supported MIME types for the input data. - // - // SupportedContentTypes is a required field - SupportedContentTypes []*string `type:"list" required:"true"` + // A filter that returns only trials created before the specified time. + CreatedBefore *time.Time `type:"timestamp"` - // A list of the instance types that are used to generate inferences in real-time. - // - // SupportedRealtimeInferenceInstanceTypes is a required field - SupportedRealtimeInferenceInstanceTypes []*string `type:"list" required:"true"` + // A filter that returns only trials that are part of the specified experiment. + ExperimentName *string `min:"1" type:"string"` - // The supported MIME types for the output data. - // - // SupportedResponseMIMETypes is a required field - SupportedResponseMIMETypes []*string `type:"list" required:"true"` + // The maximum number of trials to return in the response. The default value + // is 10. + MaxResults *int64 `min:"1" type:"integer"` - // A list of the instance types on which a transformation job can be run or - // on which an endpoint can be deployed. - // - // SupportedTransformInstanceTypes is a required field - SupportedTransformInstanceTypes []*string `min:"1" type:"list" required:"true"` + // If the previous call to ListTrials didn't return the full set of trials, + // the call returns a token for getting the next set of trials. + NextToken *string `type:"string"` + + // The property used to sort results. The default value is CreationTime. + SortBy *string `type:"string" enum:"SortTrialsBy"` + + // The sort order. The default value is Descending. + SortOrder *string `type:"string" enum:"SortOrder"` + + // A filter that returns only trials that are associated with the specified + // trial component. + TrialComponentName *string `min:"1" type:"string"` } // String returns the string representation -func (s InferenceSpecification) String() string { +func (s ListTrialsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InferenceSpecification) GoString() string { +func (s ListTrialsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *InferenceSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InferenceSpecification"} - if s.Containers == nil { - invalidParams.Add(request.NewErrParamRequired("Containers")) - } - if s.Containers != nil && len(s.Containers) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Containers", 1)) - } - if s.SupportedContentTypes == nil { - invalidParams.Add(request.NewErrParamRequired("SupportedContentTypes")) - } - if s.SupportedRealtimeInferenceInstanceTypes == nil { - invalidParams.Add(request.NewErrParamRequired("SupportedRealtimeInferenceInstanceTypes")) - } - if s.SupportedResponseMIMETypes == nil { - invalidParams.Add(request.NewErrParamRequired("SupportedResponseMIMETypes")) +func (s *ListTrialsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListTrialsInput"} + if s.ExperimentName != nil && len(*s.ExperimentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ExperimentName", 1)) } - if s.SupportedTransformInstanceTypes == nil { - invalidParams.Add(request.NewErrParamRequired("SupportedTransformInstanceTypes")) - } - if s.SupportedTransformInstanceTypes != nil && len(s.SupportedTransformInstanceTypes) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SupportedTransformInstanceTypes", 1)) + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } - if s.Containers != nil { - for i, v := range s.Containers { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Containers", i), err.(request.ErrInvalidParams)) - } - } + if s.TrialComponentName != nil && len(*s.TrialComponentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialComponentName", 1)) } if invalidParams.Len() > 0 { @@ -16736,206 +35079,124 @@ func (s *InferenceSpecification) Validate() error { return nil } -// SetContainers sets the Containers field's value. -func (s *InferenceSpecification) SetContainers(v []*ModelPackageContainerDefinition) *InferenceSpecification { - s.Containers = v +// SetCreatedAfter sets the CreatedAfter field's value. +func (s *ListTrialsInput) SetCreatedAfter(v time.Time) *ListTrialsInput { + s.CreatedAfter = &v return s } -// SetSupportedContentTypes sets the SupportedContentTypes field's value. -func (s *InferenceSpecification) SetSupportedContentTypes(v []*string) *InferenceSpecification { - s.SupportedContentTypes = v +// SetCreatedBefore sets the CreatedBefore field's value. +func (s *ListTrialsInput) SetCreatedBefore(v time.Time) *ListTrialsInput { + s.CreatedBefore = &v return s } -// SetSupportedRealtimeInferenceInstanceTypes sets the SupportedRealtimeInferenceInstanceTypes field's value. -func (s *InferenceSpecification) SetSupportedRealtimeInferenceInstanceTypes(v []*string) *InferenceSpecification { - s.SupportedRealtimeInferenceInstanceTypes = v +// SetExperimentName sets the ExperimentName field's value. +func (s *ListTrialsInput) SetExperimentName(v string) *ListTrialsInput { + s.ExperimentName = &v return s } -// SetSupportedResponseMIMETypes sets the SupportedResponseMIMETypes field's value. -func (s *InferenceSpecification) SetSupportedResponseMIMETypes(v []*string) *InferenceSpecification { - s.SupportedResponseMIMETypes = v +// SetMaxResults sets the MaxResults field's value. +func (s *ListTrialsInput) SetMaxResults(v int64) *ListTrialsInput { + s.MaxResults = &v return s } -// SetSupportedTransformInstanceTypes sets the SupportedTransformInstanceTypes field's value. -func (s *InferenceSpecification) SetSupportedTransformInstanceTypes(v []*string) *InferenceSpecification { - s.SupportedTransformInstanceTypes = v +// SetNextToken sets the NextToken field's value. +func (s *ListTrialsInput) SetNextToken(v string) *ListTrialsInput { + s.NextToken = &v return s } -// Contains information about the location of input model artifacts, the name -// and shape of the expected data inputs, and the framework in which the model -// was trained. -type InputConfig struct { - _ struct{} `type:"structure"` +// SetSortBy sets the SortBy field's value. +func (s *ListTrialsInput) SetSortBy(v string) *ListTrialsInput { + s.SortBy = &v + return s +} - // Specifies the name and shape of the expected data inputs for your trained - // model with a JSON dictionary form. The data inputs are InputConfig$Framework - // specific. - // - // * TensorFlow: You must specify the name and shape (NHWC format) of the - // expected data inputs using a dictionary format for your trained model. - // The dictionary formats required for the console and CLI are different. - // Examples for one input: If using the console, {"input":[1,1024,1024,3]} - // If using the CLI, {\"input\":[1,1024,1024,3]} Examples for two inputs: - // If using the console, {"data1": [1,28,28,1], "data2":[1,28,28,1]} If using - // the CLI, {\"data1\": [1,28,28,1], \"data2\":[1,28,28,1]} - // - // * MXNET/ONNX: You must specify the name and shape (NCHW format) of the - // expected data inputs in order using a dictionary format for your trained - // model. The dictionary formats required for the console and CLI are different. - // Examples for one input: If using the console, {"data":[1,3,1024,1024]} - // If using the CLI, {\"data\":[1,3,1024,1024]} Examples for two inputs: - // If using the console, {"var1": [1,1,28,28], "var2":[1,1,28,28]} If using - // the CLI, {\"var1\": [1,1,28,28], \"var2\":[1,1,28,28]} - // - // * PyTorch: You can either specify the name and shape (NCHW format) of - // expected data inputs in order using a dictionary format for your trained - // model or you can specify the shape only using a list format. The dictionary - // formats required for the console and CLI are different. The list formats - // for the console and CLI are the same. Examples for one input in dictionary - // format: If using the console, {"input0":[1,3,224,224]} If using the CLI, - // {\"input0\":[1,3,224,224]} Example for one input in list format: [[1,3,224,224]] - // Examples for two inputs in dictionary format: If using the console, {"input0":[1,3,224,224], - // "input1":[1,3,224,224]} If using the CLI, {\"input0\":[1,3,224,224], \"input1\":[1,3,224,224]} - // Example for two inputs in list format: [[1,3,224,224], [1,3,224,224]] - // - // * XGBOOST: input data name and shape are not needed. - // - // DataInputConfig is a required field - DataInputConfig *string `min:"1" type:"string" required:"true"` +// SetSortOrder sets the SortOrder field's value. +func (s *ListTrialsInput) SetSortOrder(v string) *ListTrialsInput { + s.SortOrder = &v + return s +} - // Identifies the framework in which the model was trained. For example: TENSORFLOW. - // - // Framework is a required field - Framework *string `type:"string" required:"true" enum:"Framework"` +// SetTrialComponentName sets the TrialComponentName field's value. +func (s *ListTrialsInput) SetTrialComponentName(v string) *ListTrialsInput { + s.TrialComponentName = &v + return s +} - // The S3 path where the model artifacts, which result from model training, - // are stored. This path must point to a single gzip compressed tar archive - // (.tar.gz suffix). - // - // S3Uri is a required field - S3Uri *string `type:"string" required:"true"` +type ListTrialsOutput struct { + _ struct{} `type:"structure"` + + // A token for getting the next set of trials, if there are any. + NextToken *string `type:"string"` + + // A list of the summaries of your trials. + TrialSummaries []*TrialSummary `type:"list"` } // String returns the string representation -func (s InputConfig) String() string { +func (s ListTrialsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InputConfig) GoString() string { +func (s ListTrialsOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *InputConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InputConfig"} - if s.DataInputConfig == nil { - invalidParams.Add(request.NewErrParamRequired("DataInputConfig")) - } - if s.DataInputConfig != nil && len(*s.DataInputConfig) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DataInputConfig", 1)) - } - if s.Framework == nil { - invalidParams.Add(request.NewErrParamRequired("Framework")) - } - if s.S3Uri == nil { - invalidParams.Add(request.NewErrParamRequired("S3Uri")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataInputConfig sets the DataInputConfig field's value. -func (s *InputConfig) SetDataInputConfig(v string) *InputConfig { - s.DataInputConfig = &v - return s -} - -// SetFramework sets the Framework field's value. -func (s *InputConfig) SetFramework(v string) *InputConfig { - s.Framework = &v +// SetNextToken sets the NextToken field's value. +func (s *ListTrialsOutput) SetNextToken(v string) *ListTrialsOutput { + s.NextToken = &v return s } -// SetS3Uri sets the S3Uri field's value. -func (s *InputConfig) SetS3Uri(v string) *InputConfig { - s.S3Uri = &v +// SetTrialSummaries sets the TrialSummaries field's value. +func (s *ListTrialsOutput) SetTrialSummaries(v []*TrialSummary) *ListTrialsOutput { + s.TrialSummaries = v return s } -// For a hyperparameter of the integer type, specifies the range that a hyperparameter -// tuning job searches. -type IntegerParameterRange struct { +type ListUserProfilesInput struct { _ struct{} `type:"structure"` - // The maximum value of the hyperparameter to search. - // - // MaxValue is a required field - MaxValue *string `type:"string" required:"true"` + // A parameter by which to filter the results. + DomainIdEquals *string `type:"string"` - // The minimum value of the hyperparameter to search. - // - // MinValue is a required field - MinValue *string `type:"string" required:"true"` + // Returns a list up to a specified limit. + MaxResults *int64 `min:"1" type:"integer"` - // The name of the hyperparameter to search. - // - // Name is a required field - Name *string `type:"string" required:"true"` + // If the previous response was truncated, you will receive this token. Use + // it in your next request to receive the next set of results. + NextToken *string `type:"string"` - // The scale that hyperparameter tuning uses to search the hyperparameter range. - // For information about choosing a hyperparameter scale, see Hyperparameter - // Scaling (https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-define-ranges.html#scaling-type). - // One of the following values: - // - // Auto - // - // Amazon SageMaker hyperparameter tuning chooses the best scale for the hyperparameter. - // - // Linear - // - // Hyperparameter tuning searches the values in the hyperparameter range by - // using a linear scale. - // - // Logarithmic - // - // Hyperparemeter tuning searches the values in the hyperparameter range by - // using a logarithmic scale. - // - // Logarithmic scaling works only for ranges that have only values greater than - // 0. - ScalingType *string `type:"string" enum:"HyperParameterScalingType"` + // The parameter by which to sort the results. The default is CreationTime. + SortBy *string `type:"string" enum:"UserProfileSortKey"` + + // The sort order for the results. The default is Ascending. + SortOrder *string `type:"string" enum:"SortOrder"` + + // A parameter by which to filter the results. + UserProfileNameContains *string `type:"string"` } // String returns the string representation -func (s IntegerParameterRange) String() string { +func (s ListUserProfilesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s IntegerParameterRange) GoString() string { +func (s ListUserProfilesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *IntegerParameterRange) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IntegerParameterRange"} - if s.MaxValue == nil { - invalidParams.Add(request.NewErrParamRequired("MaxValue")) - } - if s.MinValue == nil { - invalidParams.Add(request.NewErrParamRequired("MinValue")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) +func (s *ListUserProfilesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListUserProfilesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if invalidParams.Len() > 0 { @@ -16944,232 +35205,213 @@ func (s *IntegerParameterRange) Validate() error { return nil } -// SetMaxValue sets the MaxValue field's value. -func (s *IntegerParameterRange) SetMaxValue(v string) *IntegerParameterRange { - s.MaxValue = &v +// SetDomainIdEquals sets the DomainIdEquals field's value. +func (s *ListUserProfilesInput) SetDomainIdEquals(v string) *ListUserProfilesInput { + s.DomainIdEquals = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListUserProfilesInput) SetMaxResults(v int64) *ListUserProfilesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListUserProfilesInput) SetNextToken(v string) *ListUserProfilesInput { + s.NextToken = &v return s } -// SetMinValue sets the MinValue field's value. -func (s *IntegerParameterRange) SetMinValue(v string) *IntegerParameterRange { - s.MinValue = &v +// SetSortBy sets the SortBy field's value. +func (s *ListUserProfilesInput) SetSortBy(v string) *ListUserProfilesInput { + s.SortBy = &v return s } -// SetName sets the Name field's value. -func (s *IntegerParameterRange) SetName(v string) *IntegerParameterRange { - s.Name = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListUserProfilesInput) SetSortOrder(v string) *ListUserProfilesInput { + s.SortOrder = &v return s } -// SetScalingType sets the ScalingType field's value. -func (s *IntegerParameterRange) SetScalingType(v string) *IntegerParameterRange { - s.ScalingType = &v +// SetUserProfileNameContains sets the UserProfileNameContains field's value. +func (s *ListUserProfilesInput) SetUserProfileNameContains(v string) *ListUserProfilesInput { + s.UserProfileNameContains = &v return s } -// Defines the possible values for an integer hyperparameter. -type IntegerParameterRangeSpecification struct { +type ListUserProfilesOutput struct { _ struct{} `type:"structure"` - // The maximum integer value allowed. - // - // MaxValue is a required field - MaxValue *string `type:"string" required:"true"` + // If the previous response was truncated, you will receive this token. Use + // it in your next request to receive the next set of results. + NextToken *string `type:"string"` - // The minimum integer value allowed. - // - // MinValue is a required field - MinValue *string `type:"string" required:"true"` + // The list of user profiles. + UserProfiles []*UserProfileDetails `type:"list"` } // String returns the string representation -func (s IntegerParameterRangeSpecification) String() string { +func (s ListUserProfilesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s IntegerParameterRangeSpecification) GoString() string { +func (s ListUserProfilesOutput) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *IntegerParameterRangeSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IntegerParameterRangeSpecification"} - if s.MaxValue == nil { - invalidParams.Add(request.NewErrParamRequired("MaxValue")) - } - if s.MinValue == nil { - invalidParams.Add(request.NewErrParamRequired("MinValue")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxValue sets the MaxValue field's value. -func (s *IntegerParameterRangeSpecification) SetMaxValue(v string) *IntegerParameterRangeSpecification { - s.MaxValue = &v +// SetNextToken sets the NextToken field's value. +func (s *ListUserProfilesOutput) SetNextToken(v string) *ListUserProfilesOutput { + s.NextToken = &v return s } -// SetMinValue sets the MinValue field's value. -func (s *IntegerParameterRangeSpecification) SetMinValue(v string) *IntegerParameterRangeSpecification { - s.MinValue = &v +// SetUserProfiles sets the UserProfiles field's value. +func (s *ListUserProfilesOutput) SetUserProfiles(v []*UserProfileDetails) *ListUserProfilesOutput { + s.UserProfiles = v return s } -// Provides a breakdown of the number of objects labeled. -type LabelCounters struct { +type ListWorkteamsInput struct { _ struct{} `type:"structure"` - // The total number of objects that could not be labeled due to an error. - FailedNonRetryableError *int64 `type:"integer"` + // The maximum number of work teams to return in each page of the response. + MaxResults *int64 `min:"1" type:"integer"` - // The total number of objects labeled by a human worker. - HumanLabeled *int64 `type:"integer"` + // A string in the work team's name. This filter returns only work teams whose + // name contains the specified string. + NameContains *string `min:"1" type:"string"` - // The total number of objects labeled by automated data labeling. - MachineLabeled *int64 `type:"integer"` + // If the result of the previous ListWorkteams request was truncated, the response + // includes a NextToken. To retrieve the next set of labeling jobs, use the + // token in the next request. + NextToken *string `type:"string"` - // The total number of objects labeled. - TotalLabeled *int64 `type:"integer"` + // The field to sort results by. The default is CreationTime. + SortBy *string `type:"string" enum:"ListWorkteamsSortByOptions"` - // The total number of objects not yet labeled. - Unlabeled *int64 `type:"integer"` + // The sort order for results. The default is Ascending. + SortOrder *string `type:"string" enum:"SortOrder"` } // String returns the string representation -func (s LabelCounters) String() string { +func (s ListWorkteamsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LabelCounters) GoString() string { +func (s ListWorkteamsInput) GoString() string { return s.String() } -// SetFailedNonRetryableError sets the FailedNonRetryableError field's value. -func (s *LabelCounters) SetFailedNonRetryableError(v int64) *LabelCounters { - s.FailedNonRetryableError = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListWorkteamsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListWorkteamsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NameContains != nil && len(*s.NameContains) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NameContains", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListWorkteamsInput) SetMaxResults(v int64) *ListWorkteamsInput { + s.MaxResults = &v return s } -// SetHumanLabeled sets the HumanLabeled field's value. -func (s *LabelCounters) SetHumanLabeled(v int64) *LabelCounters { - s.HumanLabeled = &v +// SetNameContains sets the NameContains field's value. +func (s *ListWorkteamsInput) SetNameContains(v string) *ListWorkteamsInput { + s.NameContains = &v return s } -// SetMachineLabeled sets the MachineLabeled field's value. -func (s *LabelCounters) SetMachineLabeled(v int64) *LabelCounters { - s.MachineLabeled = &v +// SetNextToken sets the NextToken field's value. +func (s *ListWorkteamsInput) SetNextToken(v string) *ListWorkteamsInput { + s.NextToken = &v return s } -// SetTotalLabeled sets the TotalLabeled field's value. -func (s *LabelCounters) SetTotalLabeled(v int64) *LabelCounters { - s.TotalLabeled = &v +// SetSortBy sets the SortBy field's value. +func (s *ListWorkteamsInput) SetSortBy(v string) *ListWorkteamsInput { + s.SortBy = &v return s } -// SetUnlabeled sets the Unlabeled field's value. -func (s *LabelCounters) SetUnlabeled(v int64) *LabelCounters { - s.Unlabeled = &v +// SetSortOrder sets the SortOrder field's value. +func (s *ListWorkteamsInput) SetSortOrder(v string) *ListWorkteamsInput { + s.SortOrder = &v return s } -// Provides counts for human-labeled tasks in the labeling job. -type LabelCountersForWorkteam struct { +type ListWorkteamsOutput struct { _ struct{} `type:"structure"` - // The total number of data objects labeled by a human worker. - HumanLabeled *int64 `type:"integer"` - - // The total number of data objects that need to be labeled by a human worker. - PendingHuman *int64 `type:"integer"` + // If the response is truncated, Amazon SageMaker returns this token. To retrieve + // the next set of work teams, use it in the subsequent request. + NextToken *string `type:"string"` - // The total number of tasks in the labeling job. - Total *int64 `type:"integer"` + // An array of Workteam objects, each describing a work team. + // + // Workteams is a required field + Workteams []*Workteam `type:"list" required:"true"` } // String returns the string representation -func (s LabelCountersForWorkteam) String() string { +func (s ListWorkteamsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LabelCountersForWorkteam) GoString() string { +func (s ListWorkteamsOutput) GoString() string { return s.String() } -// SetHumanLabeled sets the HumanLabeled field's value. -func (s *LabelCountersForWorkteam) SetHumanLabeled(v int64) *LabelCountersForWorkteam { - s.HumanLabeled = &v - return s -} - -// SetPendingHuman sets the PendingHuman field's value. -func (s *LabelCountersForWorkteam) SetPendingHuman(v int64) *LabelCountersForWorkteam { - s.PendingHuman = &v +// SetNextToken sets the NextToken field's value. +func (s *ListWorkteamsOutput) SetNextToken(v string) *ListWorkteamsOutput { + s.NextToken = &v return s } -// SetTotal sets the Total field's value. -func (s *LabelCountersForWorkteam) SetTotal(v int64) *LabelCountersForWorkteam { - s.Total = &v +// SetWorkteams sets the Workteams field's value. +func (s *ListWorkteamsOutput) SetWorkteams(v []*Workteam) *ListWorkteamsOutput { + s.Workteams = v return s } -// Provides configuration information for auto-labeling of your data objects. -// A LabelingJobAlgorithmsConfig object must be supplied in order to use auto-labeling. -type LabelingJobAlgorithmsConfig struct { +// Defines the Amazon Cognito user group that is part of a work team. +type MemberDefinition struct { _ struct{} `type:"structure"` - // At the end of an auto-label job Amazon SageMaker Ground Truth sends the Amazon - // Resource Nam (ARN) of the final model used for auto-labeling. You can use - // this model as the starting point for subsequent similar jobs by providing - // the ARN of the model here. - InitialActiveLearningModelArn *string `min:"20" type:"string"` - - // Specifies the Amazon Resource Name (ARN) of the algorithm used for auto-labeling. - // You must select one of the following ARNs: - // - // * Image classification arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/image-classification - // - // * Text classification arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/text-classification - // - // * Object detection arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/object-detection - // - // * Semantic Segmentation arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/semantic-segmentation - // - // LabelingJobAlgorithmSpecificationArn is a required field - LabelingJobAlgorithmSpecificationArn *string `type:"string" required:"true"` - - // Provides configuration information for a labeling job. - LabelingJobResourceConfig *LabelingJobResourceConfig `type:"structure"` + // The Amazon Cognito user group that is part of the work team. + CognitoMemberDefinition *CognitoMemberDefinition `type:"structure"` } // String returns the string representation -func (s LabelingJobAlgorithmsConfig) String() string { +func (s MemberDefinition) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LabelingJobAlgorithmsConfig) GoString() string { +func (s MemberDefinition) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *LabelingJobAlgorithmsConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LabelingJobAlgorithmsConfig"} - if s.InitialActiveLearningModelArn != nil && len(*s.InitialActiveLearningModelArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("InitialActiveLearningModelArn", 20)) - } - if s.LabelingJobAlgorithmSpecificationArn == nil { - invalidParams.Add(request.NewErrParamRequired("LabelingJobAlgorithmSpecificationArn")) +func (s *MemberDefinition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MemberDefinition"} + if s.CognitoMemberDefinition != nil { + if err := s.CognitoMemberDefinition.Validate(); err != nil { + invalidParams.AddNested("CognitoMemberDefinition", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -17178,81 +35420,99 @@ func (s *LabelingJobAlgorithmsConfig) Validate() error { return nil } -// SetInitialActiveLearningModelArn sets the InitialActiveLearningModelArn field's value. -func (s *LabelingJobAlgorithmsConfig) SetInitialActiveLearningModelArn(v string) *LabelingJobAlgorithmsConfig { - s.InitialActiveLearningModelArn = &v +// SetCognitoMemberDefinition sets the CognitoMemberDefinition field's value. +func (s *MemberDefinition) SetCognitoMemberDefinition(v *CognitoMemberDefinition) *MemberDefinition { + s.CognitoMemberDefinition = v return s } -// SetLabelingJobAlgorithmSpecificationArn sets the LabelingJobAlgorithmSpecificationArn field's value. -func (s *LabelingJobAlgorithmsConfig) SetLabelingJobAlgorithmSpecificationArn(v string) *LabelingJobAlgorithmsConfig { - s.LabelingJobAlgorithmSpecificationArn = &v - return s -} +// The name, value, and date and time of a metric that was emitted to Amazon +// CloudWatch. +type MetricData struct { + _ struct{} `type:"structure"` -// SetLabelingJobResourceConfig sets the LabelingJobResourceConfig field's value. -func (s *LabelingJobAlgorithmsConfig) SetLabelingJobResourceConfig(v *LabelingJobResourceConfig) *LabelingJobAlgorithmsConfig { - s.LabelingJobResourceConfig = v - return s -} + // The name of the metric. + MetricName *string `min:"1" type:"string"` -// Attributes of the data specified by the customer. Use these to describe the -// data to be labeled. -type LabelingJobDataAttributes struct { - _ struct{} `type:"structure"` + // The date and time that the algorithm emitted the metric. + Timestamp *time.Time `type:"timestamp"` - // Declares that your content is free of personally identifiable information - // or adult content. Amazon SageMaker may restrict the Amazon Mechanical Turk - // workers that can view your task based on this information. - ContentClassifiers []*string `type:"list"` + // The value of the metric. + Value *float64 `type:"float"` } // String returns the string representation -func (s LabelingJobDataAttributes) String() string { +func (s MetricData) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LabelingJobDataAttributes) GoString() string { +func (s MetricData) GoString() string { return s.String() } -// SetContentClassifiers sets the ContentClassifiers field's value. -func (s *LabelingJobDataAttributes) SetContentClassifiers(v []*string) *LabelingJobDataAttributes { - s.ContentClassifiers = v +// SetMetricName sets the MetricName field's value. +func (s *MetricData) SetMetricName(v string) *MetricData { + s.MetricName = &v return s } -// Provides information about the location of input data. -type LabelingJobDataSource struct { +// SetTimestamp sets the Timestamp field's value. +func (s *MetricData) SetTimestamp(v time.Time) *MetricData { + s.Timestamp = &v + return s +} + +// SetValue sets the Value field's value. +func (s *MetricData) SetValue(v float64) *MetricData { + s.Value = &v + return s +} + +// Specifies a metric that the training algorithm writes to stderr or stdout +// . Amazon SageMakerhyperparameter tuning captures all defined metrics. You +// specify one metric that a hyperparameter tuning job uses as its objective +// metric to choose the best training job. +type MetricDefinition struct { _ struct{} `type:"structure"` - // The Amazon S3 location of the input data objects. + // The name of the metric. // - // S3DataSource is a required field - S3DataSource *LabelingJobS3DataSource `type:"structure" required:"true"` + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // A regular expression that searches the output of a training job and gets + // the value of the metric. For more information about using regular expressions + // to define metrics, see Defining Objective Metrics (https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-define-metrics.html). + // + // Regex is a required field + Regex *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s LabelingJobDataSource) String() string { +func (s MetricDefinition) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LabelingJobDataSource) GoString() string { +func (s MetricDefinition) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *LabelingJobDataSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LabelingJobDataSource"} - if s.S3DataSource == nil { - invalidParams.Add(request.NewErrParamRequired("S3DataSource")) +func (s *MetricDefinition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MetricDefinition"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) } - if s.S3DataSource != nil { - if err := s.S3DataSource.Validate(); err != nil { - invalidParams.AddNested("S3DataSource", err.(request.ErrInvalidParams)) - } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.Regex == nil { + invalidParams.Add(request.NewErrParamRequired("Regex")) + } + if s.Regex != nil && len(*s.Regex) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Regex", 1)) } if invalidParams.Len() > 0 { @@ -17261,296 +35521,326 @@ func (s *LabelingJobDataSource) Validate() error { return nil } -// SetS3DataSource sets the S3DataSource field's value. -func (s *LabelingJobDataSource) SetS3DataSource(v *LabelingJobS3DataSource) *LabelingJobDataSource { - s.S3DataSource = v +// SetName sets the Name field's value. +func (s *MetricDefinition) SetName(v string) *MetricDefinition { + s.Name = &v return s } -// Provides summary information for a work team. -type LabelingJobForWorkteamSummary struct { +// SetRegex sets the Regex field's value. +func (s *MetricDefinition) SetRegex(v string) *MetricDefinition { + s.Regex = &v + return s +} + +// Provides information about the location that is configured for storing model +// artifacts. +type ModelArtifacts struct { _ struct{} `type:"structure"` - // The date and time that the labeling job was created. + // The path of the S3 object that contains the model artifacts. For example, + // s3://bucket-name/keynameprefix/model.tar.gz. // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` + // S3ModelArtifacts is a required field + S3ModelArtifacts *string `type:"string" required:"true"` +} - // A unique identifier for a labeling job. You can use this to refer to a specific - // labeling job. - // - // JobReferenceCode is a required field - JobReferenceCode *string `min:"1" type:"string" required:"true"` +// String returns the string representation +func (s ModelArtifacts) String() string { + return awsutil.Prettify(s) +} - // Provides information about the progress of a labeling job. - LabelCounters *LabelCountersForWorkteam `type:"structure"` +// GoString returns the string representation +func (s ModelArtifacts) GoString() string { + return s.String() +} - // The name of the labeling job that the work team is assigned to. - LabelingJobName *string `min:"1" type:"string"` +// SetS3ModelArtifacts sets the S3ModelArtifacts field's value. +func (s *ModelArtifacts) SetS3ModelArtifacts(v string) *ModelArtifacts { + s.S3ModelArtifacts = &v + return s +} - // The configured number of workers per data object. - NumberOfHumanWorkersPerDataObject *int64 `min:"1" type:"integer"` +// Describes the Docker container for the model package. +type ModelPackageContainerDefinition struct { + _ struct{} `type:"structure"` - // WorkRequesterAccountId is a required field - WorkRequesterAccountId *string `type:"string" required:"true"` + // The DNS host name for the Docker container. + ContainerHostname *string `type:"string"` + + // The Amazon EC2 Container Registry (Amazon ECR) path where inference code + // is stored. + // + // If you are using your own custom algorithm instead of an algorithm provided + // by Amazon SageMaker, the inference code must meet Amazon SageMaker requirements. + // Amazon SageMaker supports both registry/repository[:tag] and registry/repository[@digest] + // image path formats. For more information, see Using Your Own Algorithms with + // Amazon SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html). + // + // Image is a required field + Image *string `type:"string" required:"true"` + + // An MD5 hash of the training algorithm that identifies the Docker image used + // for training. + ImageDigest *string `type:"string"` + + // The Amazon S3 path where the model artifacts, which result from model training, + // are stored. This path must point to a single gzip compressed tar archive + // (.tar.gz suffix). + ModelDataUrl *string `type:"string"` + + // The AWS Marketplace product ID of the model package. + ProductId *string `type:"string"` } // String returns the string representation -func (s LabelingJobForWorkteamSummary) String() string { +func (s ModelPackageContainerDefinition) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LabelingJobForWorkteamSummary) GoString() string { +func (s ModelPackageContainerDefinition) GoString() string { return s.String() } -// SetCreationTime sets the CreationTime field's value. -func (s *LabelingJobForWorkteamSummary) SetCreationTime(v time.Time) *LabelingJobForWorkteamSummary { - s.CreationTime = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModelPackageContainerDefinition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModelPackageContainerDefinition"} + if s.Image == nil { + invalidParams.Add(request.NewErrParamRequired("Image")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetJobReferenceCode sets the JobReferenceCode field's value. -func (s *LabelingJobForWorkteamSummary) SetJobReferenceCode(v string) *LabelingJobForWorkteamSummary { - s.JobReferenceCode = &v +// SetContainerHostname sets the ContainerHostname field's value. +func (s *ModelPackageContainerDefinition) SetContainerHostname(v string) *ModelPackageContainerDefinition { + s.ContainerHostname = &v return s } -// SetLabelCounters sets the LabelCounters field's value. -func (s *LabelingJobForWorkteamSummary) SetLabelCounters(v *LabelCountersForWorkteam) *LabelingJobForWorkteamSummary { - s.LabelCounters = v +// SetImage sets the Image field's value. +func (s *ModelPackageContainerDefinition) SetImage(v string) *ModelPackageContainerDefinition { + s.Image = &v return s } -// SetLabelingJobName sets the LabelingJobName field's value. -func (s *LabelingJobForWorkteamSummary) SetLabelingJobName(v string) *LabelingJobForWorkteamSummary { - s.LabelingJobName = &v +// SetImageDigest sets the ImageDigest field's value. +func (s *ModelPackageContainerDefinition) SetImageDigest(v string) *ModelPackageContainerDefinition { + s.ImageDigest = &v return s } -// SetNumberOfHumanWorkersPerDataObject sets the NumberOfHumanWorkersPerDataObject field's value. -func (s *LabelingJobForWorkteamSummary) SetNumberOfHumanWorkersPerDataObject(v int64) *LabelingJobForWorkteamSummary { - s.NumberOfHumanWorkersPerDataObject = &v +// SetModelDataUrl sets the ModelDataUrl field's value. +func (s *ModelPackageContainerDefinition) SetModelDataUrl(v string) *ModelPackageContainerDefinition { + s.ModelDataUrl = &v return s } -// SetWorkRequesterAccountId sets the WorkRequesterAccountId field's value. -func (s *LabelingJobForWorkteamSummary) SetWorkRequesterAccountId(v string) *LabelingJobForWorkteamSummary { - s.WorkRequesterAccountId = &v +// SetProductId sets the ProductId field's value. +func (s *ModelPackageContainerDefinition) SetProductId(v string) *ModelPackageContainerDefinition { + s.ProductId = &v return s } -// Input configuration information for a labeling job. -type LabelingJobInputConfig struct { +// Specifies the validation and image scan statuses of the model package. +type ModelPackageStatusDetails struct { _ struct{} `type:"structure"` - // Attributes of the data specified by the customer. - DataAttributes *LabelingJobDataAttributes `type:"structure"` + // The status of the scan of the Docker image container for the model package. + ImageScanStatuses []*ModelPackageStatusItem `type:"list"` - // The location of the input data. + // The validation status of the model package. // - // DataSource is a required field - DataSource *LabelingJobDataSource `type:"structure" required:"true"` + // ValidationStatuses is a required field + ValidationStatuses []*ModelPackageStatusItem `type:"list" required:"true"` } // String returns the string representation -func (s LabelingJobInputConfig) String() string { +func (s ModelPackageStatusDetails) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LabelingJobInputConfig) GoString() string { +func (s ModelPackageStatusDetails) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *LabelingJobInputConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LabelingJobInputConfig"} - if s.DataSource == nil { - invalidParams.Add(request.NewErrParamRequired("DataSource")) - } - if s.DataSource != nil { - if err := s.DataSource.Validate(); err != nil { - invalidParams.AddNested("DataSource", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataAttributes sets the DataAttributes field's value. -func (s *LabelingJobInputConfig) SetDataAttributes(v *LabelingJobDataAttributes) *LabelingJobInputConfig { - s.DataAttributes = v +// SetImageScanStatuses sets the ImageScanStatuses field's value. +func (s *ModelPackageStatusDetails) SetImageScanStatuses(v []*ModelPackageStatusItem) *ModelPackageStatusDetails { + s.ImageScanStatuses = v return s } -// SetDataSource sets the DataSource field's value. -func (s *LabelingJobInputConfig) SetDataSource(v *LabelingJobDataSource) *LabelingJobInputConfig { - s.DataSource = v +// SetValidationStatuses sets the ValidationStatuses field's value. +func (s *ModelPackageStatusDetails) SetValidationStatuses(v []*ModelPackageStatusItem) *ModelPackageStatusDetails { + s.ValidationStatuses = v return s } -// Specifies the location of the output produced by the labeling job. -type LabelingJobOutput struct { +// Represents the overall status of a model package. +type ModelPackageStatusItem struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) for the most recent Amazon SageMaker model - // trained as part of automated data labeling. - FinalActiveLearningModelArn *string `min:"20" type:"string"` + // if the overall status is Failed, the reason for the failure. + FailureReason *string `type:"string"` - // The Amazon S3 bucket location of the manifest file for labeled data. + // The name of the model package for which the overall status is being reported. // - // OutputDatasetS3Uri is a required field - OutputDatasetS3Uri *string `type:"string" required:"true"` + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The current status. + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"DetailedModelPackageStatus"` } // String returns the string representation -func (s LabelingJobOutput) String() string { +func (s ModelPackageStatusItem) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LabelingJobOutput) GoString() string { +func (s ModelPackageStatusItem) GoString() string { return s.String() } -// SetFinalActiveLearningModelArn sets the FinalActiveLearningModelArn field's value. -func (s *LabelingJobOutput) SetFinalActiveLearningModelArn(v string) *LabelingJobOutput { - s.FinalActiveLearningModelArn = &v +// SetFailureReason sets the FailureReason field's value. +func (s *ModelPackageStatusItem) SetFailureReason(v string) *ModelPackageStatusItem { + s.FailureReason = &v return s } -// SetOutputDatasetS3Uri sets the OutputDatasetS3Uri field's value. -func (s *LabelingJobOutput) SetOutputDatasetS3Uri(v string) *LabelingJobOutput { - s.OutputDatasetS3Uri = &v +// SetName sets the Name field's value. +func (s *ModelPackageStatusItem) SetName(v string) *ModelPackageStatusItem { + s.Name = &v return s } -// Output configuration information for a labeling job. -type LabelingJobOutputConfig struct { +// SetStatus sets the Status field's value. +func (s *ModelPackageStatusItem) SetStatus(v string) *ModelPackageStatusItem { + s.Status = &v + return s +} + +// Provides summary information about a model package. +type ModelPackageSummary struct { _ struct{} `type:"structure"` - // The AWS Key Management Service ID of the key used to encrypt the output data, - // if any. + // A timestamp that shows when the model package was created. // - // If you use a KMS key ID or an alias of your master key, the Amazon SageMaker - // execution role must include permissions to call kms:Encrypt. If you don't - // provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon - // S3 for your role's account. Amazon SageMaker uses server-side encryption - // with KMS-managed keys for LabelingJobOutputConfig. If you use a bucket policy - // with an s3:PutObject permission that only allows objects with server-side - // encryption, set the condition key of s3:x-amz-server-side-encryption to "aws:kms". - // For more information, see KMS-Managed Encryption Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) - // in the Amazon Simple Storage Service Developer Guide. + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // The Amazon Resource Name (ARN) of the model package. // - // The KMS key policy must grant permission to the IAM role that you specify - // in your CreateLabelingJob request. For more information, see Using Key Policies - // in AWS KMS (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) - // in the AWS Key Management Service Developer Guide. - KmsKeyId *string `type:"string"` + // ModelPackageArn is a required field + ModelPackageArn *string `min:"1" type:"string" required:"true"` - // The Amazon S3 location to write output data. + // A brief description of the model package. + ModelPackageDescription *string `type:"string"` + + // The name of the model package. // - // S3OutputPath is a required field - S3OutputPath *string `type:"string" required:"true"` + // ModelPackageName is a required field + ModelPackageName *string `min:"1" type:"string" required:"true"` + + // The overall status of the model package. + // + // ModelPackageStatus is a required field + ModelPackageStatus *string `type:"string" required:"true" enum:"ModelPackageStatus"` } // String returns the string representation -func (s LabelingJobOutputConfig) String() string { +func (s ModelPackageSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LabelingJobOutputConfig) GoString() string { +func (s ModelPackageSummary) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *LabelingJobOutputConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LabelingJobOutputConfig"} - if s.S3OutputPath == nil { - invalidParams.Add(request.NewErrParamRequired("S3OutputPath")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *LabelingJobOutputConfig) SetKmsKeyId(v string) *LabelingJobOutputConfig { - s.KmsKeyId = &v +// SetCreationTime sets the CreationTime field's value. +func (s *ModelPackageSummary) SetCreationTime(v time.Time) *ModelPackageSummary { + s.CreationTime = &v return s } -// SetS3OutputPath sets the S3OutputPath field's value. -func (s *LabelingJobOutputConfig) SetS3OutputPath(v string) *LabelingJobOutputConfig { - s.S3OutputPath = &v +// SetModelPackageArn sets the ModelPackageArn field's value. +func (s *ModelPackageSummary) SetModelPackageArn(v string) *ModelPackageSummary { + s.ModelPackageArn = &v return s } -// Provides configuration information for labeling jobs. -type LabelingJobResourceConfig struct { - _ struct{} `type:"structure"` - - // The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to - // encrypt data on the storage volume attached to the ML compute instance(s) - // that run the training job. The VolumeKmsKeyId can be any of the following - // formats: - // - // * // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab" - // - // * // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" - VolumeKmsKeyId *string `type:"string"` -} - -// String returns the string representation -func (s LabelingJobResourceConfig) String() string { - return awsutil.Prettify(s) +// SetModelPackageDescription sets the ModelPackageDescription field's value. +func (s *ModelPackageSummary) SetModelPackageDescription(v string) *ModelPackageSummary { + s.ModelPackageDescription = &v + return s } -// GoString returns the string representation -func (s LabelingJobResourceConfig) GoString() string { - return s.String() +// SetModelPackageName sets the ModelPackageName field's value. +func (s *ModelPackageSummary) SetModelPackageName(v string) *ModelPackageSummary { + s.ModelPackageName = &v + return s } -// SetVolumeKmsKeyId sets the VolumeKmsKeyId field's value. -func (s *LabelingJobResourceConfig) SetVolumeKmsKeyId(v string) *LabelingJobResourceConfig { - s.VolumeKmsKeyId = &v +// SetModelPackageStatus sets the ModelPackageStatus field's value. +func (s *ModelPackageSummary) SetModelPackageStatus(v string) *ModelPackageSummary { + s.ModelPackageStatus = &v return s } -// The Amazon S3 location of the input data objects. -type LabelingJobS3DataSource struct { +// Contains data, such as the inputs and targeted instance types that are used +// in the process of validating the model package. +// +// The data provided in the validation profile is made available to your buyers +// on AWS Marketplace. +type ModelPackageValidationProfile struct { _ struct{} `type:"structure"` - // The Amazon S3 location of the manifest file that describes the input data - // objects. + // The name of the profile for the model package. // - // ManifestS3Uri is a required field - ManifestS3Uri *string `type:"string" required:"true"` + // ProfileName is a required field + ProfileName *string `min:"1" type:"string" required:"true"` + + // The TransformJobDefinition object that describes the transform job used for + // the validation of the model package. + // + // TransformJobDefinition is a required field + TransformJobDefinition *TransformJobDefinition `type:"structure" required:"true"` } // String returns the string representation -func (s LabelingJobS3DataSource) String() string { +func (s ModelPackageValidationProfile) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LabelingJobS3DataSource) GoString() string { +func (s ModelPackageValidationProfile) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *LabelingJobS3DataSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LabelingJobS3DataSource"} - if s.ManifestS3Uri == nil { - invalidParams.Add(request.NewErrParamRequired("ManifestS3Uri")) +func (s *ModelPackageValidationProfile) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModelPackageValidationProfile"} + if s.ProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("ProfileName")) + } + if s.ProfileName != nil && len(*s.ProfileName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ProfileName", 1)) + } + if s.TransformJobDefinition == nil { + invalidParams.Add(request.NewErrParamRequired("TransformJobDefinition")) + } + if s.TransformJobDefinition != nil { + if err := s.TransformJobDefinition.Validate(); err != nil { + invalidParams.AddNested("TransformJobDefinition", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -17559,43 +35849,69 @@ func (s *LabelingJobS3DataSource) Validate() error { return nil } -// SetManifestS3Uri sets the ManifestS3Uri field's value. -func (s *LabelingJobS3DataSource) SetManifestS3Uri(v string) *LabelingJobS3DataSource { - s.ManifestS3Uri = &v +// SetProfileName sets the ProfileName field's value. +func (s *ModelPackageValidationProfile) SetProfileName(v string) *ModelPackageValidationProfile { + s.ProfileName = &v return s } -// A set of conditions for stopping a labeling job. If any of the conditions -// are met, the job is automatically stopped. You can use these conditions to -// control the cost of data labeling. -type LabelingJobStoppingConditions struct { +// SetTransformJobDefinition sets the TransformJobDefinition field's value. +func (s *ModelPackageValidationProfile) SetTransformJobDefinition(v *TransformJobDefinition) *ModelPackageValidationProfile { + s.TransformJobDefinition = v + return s +} + +// Specifies batch transform jobs that Amazon SageMaker runs to validate your +// model package. +type ModelPackageValidationSpecification struct { _ struct{} `type:"structure"` - // The maximum number of objects that can be labeled by human workers. - MaxHumanLabeledObjectCount *int64 `min:"1" type:"integer"` + // An array of ModelPackageValidationProfile objects, each of which specifies + // a batch transform job that Amazon SageMaker runs to validate your model package. + // + // ValidationProfiles is a required field + ValidationProfiles []*ModelPackageValidationProfile `min:"1" type:"list" required:"true"` - // The maximum number of input data objects that should be labeled. - MaxPercentageOfInputDatasetLabeled *int64 `min:"1" type:"integer"` + // The IAM roles to be used for the validation of the model package. + // + // ValidationRole is a required field + ValidationRole *string `min:"20" type:"string" required:"true"` } // String returns the string representation -func (s LabelingJobStoppingConditions) String() string { +func (s ModelPackageValidationSpecification) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LabelingJobStoppingConditions) GoString() string { +func (s ModelPackageValidationSpecification) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *LabelingJobStoppingConditions) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LabelingJobStoppingConditions"} - if s.MaxHumanLabeledObjectCount != nil && *s.MaxHumanLabeledObjectCount < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxHumanLabeledObjectCount", 1)) +func (s *ModelPackageValidationSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModelPackageValidationSpecification"} + if s.ValidationProfiles == nil { + invalidParams.Add(request.NewErrParamRequired("ValidationProfiles")) } - if s.MaxPercentageOfInputDatasetLabeled != nil && *s.MaxPercentageOfInputDatasetLabeled < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxPercentageOfInputDatasetLabeled", 1)) + if s.ValidationProfiles != nil && len(s.ValidationProfiles) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ValidationProfiles", 1)) + } + if s.ValidationRole == nil { + invalidParams.Add(request.NewErrParamRequired("ValidationRole")) + } + if s.ValidationRole != nil && len(*s.ValidationRole) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ValidationRole", 20)) + } + if s.ValidationProfiles != nil { + for i, v := range s.ValidationProfiles { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ValidationProfiles", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -17604,204 +35920,113 @@ func (s *LabelingJobStoppingConditions) Validate() error { return nil } -// SetMaxHumanLabeledObjectCount sets the MaxHumanLabeledObjectCount field's value. -func (s *LabelingJobStoppingConditions) SetMaxHumanLabeledObjectCount(v int64) *LabelingJobStoppingConditions { - s.MaxHumanLabeledObjectCount = &v +// SetValidationProfiles sets the ValidationProfiles field's value. +func (s *ModelPackageValidationSpecification) SetValidationProfiles(v []*ModelPackageValidationProfile) *ModelPackageValidationSpecification { + s.ValidationProfiles = v return s } -// SetMaxPercentageOfInputDatasetLabeled sets the MaxPercentageOfInputDatasetLabeled field's value. -func (s *LabelingJobStoppingConditions) SetMaxPercentageOfInputDatasetLabeled(v int64) *LabelingJobStoppingConditions { - s.MaxPercentageOfInputDatasetLabeled = &v +// SetValidationRole sets the ValidationRole field's value. +func (s *ModelPackageValidationSpecification) SetValidationRole(v string) *ModelPackageValidationSpecification { + s.ValidationRole = &v return s } -// Provides summary information about a labeling job. -type LabelingJobSummary struct { +// Provides summary information about a model. +type ModelSummary struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the Lambda function used to consolidate - // the annotations from individual workers into a label for a data object. For - // more information, see Annotation Consolidation (https://docs.aws.amazon.com/sagemaker/latest/dg/sms-annotation-consolidation.html). - AnnotationConsolidationLambdaArn *string `type:"string"` - - // The date and time that the job was created (timestamp). + // A timestamp that indicates when the model was created. // // CreationTime is a required field CreationTime *time.Time `type:"timestamp" required:"true"` - // If the LabelingJobStatus field is Failed, this field contains a description - // of the error. - FailureReason *string `type:"string"` - - // Input configuration for the labeling job. - InputConfig *LabelingJobInputConfig `type:"structure"` - - // Counts showing the progress of the labeling job. - // - // LabelCounters is a required field - LabelCounters *LabelCounters `type:"structure" required:"true"` - - // The Amazon Resource Name (ARN) assigned to the labeling job when it was created. - // - // LabelingJobArn is a required field - LabelingJobArn *string `type:"string" required:"true"` - - // The name of the labeling job. - // - // LabelingJobName is a required field - LabelingJobName *string `min:"1" type:"string" required:"true"` - - // The location of the output produced by the labeling job. - LabelingJobOutput *LabelingJobOutput `type:"structure"` - - // The current status of the labeling job. - // - // LabelingJobStatus is a required field - LabelingJobStatus *string `type:"string" required:"true" enum:"LabelingJobStatus"` - - // The date and time that the job was last modified (timestamp). - // - // LastModifiedTime is a required field - LastModifiedTime *time.Time `type:"timestamp" required:"true"` - - // The Amazon Resource Name (ARN) of a Lambda function. The function is run - // before each data object is sent to a worker. + // The Amazon Resource Name (ARN) of the model. // - // PreHumanTaskLambdaArn is a required field - PreHumanTaskLambdaArn *string `type:"string" required:"true"` + // ModelArn is a required field + ModelArn *string `min:"20" type:"string" required:"true"` - // The Amazon Resource Name (ARN) of the work team assigned to the job. + // The name of the model that you want a summary for. // - // WorkteamArn is a required field - WorkteamArn *string `type:"string" required:"true"` + // ModelName is a required field + ModelName *string `type:"string" required:"true"` } // String returns the string representation -func (s LabelingJobSummary) String() string { +func (s ModelSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LabelingJobSummary) GoString() string { +func (s ModelSummary) GoString() string { return s.String() } -// SetAnnotationConsolidationLambdaArn sets the AnnotationConsolidationLambdaArn field's value. -func (s *LabelingJobSummary) SetAnnotationConsolidationLambdaArn(v string) *LabelingJobSummary { - s.AnnotationConsolidationLambdaArn = &v - return s -} - // SetCreationTime sets the CreationTime field's value. -func (s *LabelingJobSummary) SetCreationTime(v time.Time) *LabelingJobSummary { +func (s *ModelSummary) SetCreationTime(v time.Time) *ModelSummary { s.CreationTime = &v return s } -// SetFailureReason sets the FailureReason field's value. -func (s *LabelingJobSummary) SetFailureReason(v string) *LabelingJobSummary { - s.FailureReason = &v - return s -} - -// SetInputConfig sets the InputConfig field's value. -func (s *LabelingJobSummary) SetInputConfig(v *LabelingJobInputConfig) *LabelingJobSummary { - s.InputConfig = v - return s -} - -// SetLabelCounters sets the LabelCounters field's value. -func (s *LabelingJobSummary) SetLabelCounters(v *LabelCounters) *LabelingJobSummary { - s.LabelCounters = v - return s -} - -// SetLabelingJobArn sets the LabelingJobArn field's value. -func (s *LabelingJobSummary) SetLabelingJobArn(v string) *LabelingJobSummary { - s.LabelingJobArn = &v - return s -} - -// SetLabelingJobName sets the LabelingJobName field's value. -func (s *LabelingJobSummary) SetLabelingJobName(v string) *LabelingJobSummary { - s.LabelingJobName = &v - return s -} - -// SetLabelingJobOutput sets the LabelingJobOutput field's value. -func (s *LabelingJobSummary) SetLabelingJobOutput(v *LabelingJobOutput) *LabelingJobSummary { - s.LabelingJobOutput = v - return s -} - -// SetLabelingJobStatus sets the LabelingJobStatus field's value. -func (s *LabelingJobSummary) SetLabelingJobStatus(v string) *LabelingJobSummary { - s.LabelingJobStatus = &v - return s -} - -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *LabelingJobSummary) SetLastModifiedTime(v time.Time) *LabelingJobSummary { - s.LastModifiedTime = &v - return s -} - -// SetPreHumanTaskLambdaArn sets the PreHumanTaskLambdaArn field's value. -func (s *LabelingJobSummary) SetPreHumanTaskLambdaArn(v string) *LabelingJobSummary { - s.PreHumanTaskLambdaArn = &v +// SetModelArn sets the ModelArn field's value. +func (s *ModelSummary) SetModelArn(v string) *ModelSummary { + s.ModelArn = &v return s } -// SetWorkteamArn sets the WorkteamArn field's value. -func (s *LabelingJobSummary) SetWorkteamArn(v string) *LabelingJobSummary { - s.WorkteamArn = &v +// SetModelName sets the ModelName field's value. +func (s *ModelSummary) SetModelName(v string) *ModelSummary { + s.ModelName = &v return s } -type ListAlgorithmsInput struct { +// Container image configuration object for the monitoring job. +type MonitoringAppSpecification struct { _ struct{} `type:"structure"` - // A filter that returns only algorithms created after the specified time (timestamp). - CreationTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only algorithms created before the specified time (timestamp). - CreationTimeBefore *time.Time `type:"timestamp"` - - // The maximum number of algorithms to return in the response. - MaxResults *int64 `min:"1" type:"integer"` + // An array of arguments for the container used to run the monitoring job. + ContainerArguments []*string `min:"1" type:"list"` - // A string in the algorithm name. This filter returns only algorithms whose - // name contains the specified string. - NameContains *string `type:"string"` + // Specifies the entrypoint for a container used to run the monitoring job. + ContainerEntrypoint []*string `min:"1" type:"list"` - // If the response to a previous ListAlgorithms request was truncated, the response - // includes a NextToken. To retrieve the next set of algorithms, use the token - // in the next request. - NextToken *string `type:"string"` + // The container image to be run by the monitoring job. + // + // ImageUri is a required field + ImageUri *string `type:"string" required:"true"` - // The parameter by which to sort the results. The default is CreationTime. - SortBy *string `type:"string" enum:"AlgorithmSortBy"` + // An Amazon S3 URI to a script that is called after analysis has been performed. + // Applicable only for the built-in (first party) containers. + PostAnalyticsProcessorSourceUri *string `type:"string"` - // The sort order for the results. The default is Ascending. - SortOrder *string `type:"string" enum:"SortOrder"` + // An Amazon S3 URI to a script that is called per row prior to running analysis. + // It can base64 decode the payload and convert it into a flatted json so that + // the built-in container can use the converted data. Applicable only for the + // built-in (first party) containers. + RecordPreprocessorSourceUri *string `type:"string"` } // String returns the string representation -func (s ListAlgorithmsInput) String() string { +func (s MonitoringAppSpecification) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListAlgorithmsInput) GoString() string { +func (s MonitoringAppSpecification) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListAlgorithmsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAlgorithmsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *MonitoringAppSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MonitoringAppSpecification"} + if s.ContainerArguments != nil && len(s.ContainerArguments) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ContainerArguments", 1)) + } + if s.ContainerEntrypoint != nil && len(s.ContainerEntrypoint) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ContainerEntrypoint", 1)) + } + if s.ImageUri == nil { + invalidParams.Add(request.NewErrParamRequired("ImageUri")) } if invalidParams.Len() > 0 { @@ -17810,136 +36035,128 @@ func (s *ListAlgorithmsInput) Validate() error { return nil } -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListAlgorithmsInput) SetCreationTimeAfter(v time.Time) *ListAlgorithmsInput { - s.CreationTimeAfter = &v - return s -} - -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListAlgorithmsInput) SetCreationTimeBefore(v time.Time) *ListAlgorithmsInput { - s.CreationTimeBefore = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAlgorithmsInput) SetMaxResults(v int64) *ListAlgorithmsInput { - s.MaxResults = &v +// SetContainerArguments sets the ContainerArguments field's value. +func (s *MonitoringAppSpecification) SetContainerArguments(v []*string) *MonitoringAppSpecification { + s.ContainerArguments = v return s } -// SetNameContains sets the NameContains field's value. -func (s *ListAlgorithmsInput) SetNameContains(v string) *ListAlgorithmsInput { - s.NameContains = &v +// SetContainerEntrypoint sets the ContainerEntrypoint field's value. +func (s *MonitoringAppSpecification) SetContainerEntrypoint(v []*string) *MonitoringAppSpecification { + s.ContainerEntrypoint = v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListAlgorithmsInput) SetNextToken(v string) *ListAlgorithmsInput { - s.NextToken = &v +// SetImageUri sets the ImageUri field's value. +func (s *MonitoringAppSpecification) SetImageUri(v string) *MonitoringAppSpecification { + s.ImageUri = &v return s } -// SetSortBy sets the SortBy field's value. -func (s *ListAlgorithmsInput) SetSortBy(v string) *ListAlgorithmsInput { - s.SortBy = &v +// SetPostAnalyticsProcessorSourceUri sets the PostAnalyticsProcessorSourceUri field's value. +func (s *MonitoringAppSpecification) SetPostAnalyticsProcessorSourceUri(v string) *MonitoringAppSpecification { + s.PostAnalyticsProcessorSourceUri = &v return s } -// SetSortOrder sets the SortOrder field's value. -func (s *ListAlgorithmsInput) SetSortOrder(v string) *ListAlgorithmsInput { - s.SortOrder = &v +// SetRecordPreprocessorSourceUri sets the RecordPreprocessorSourceUri field's value. +func (s *MonitoringAppSpecification) SetRecordPreprocessorSourceUri(v string) *MonitoringAppSpecification { + s.RecordPreprocessorSourceUri = &v return s } -type ListAlgorithmsOutput struct { +// Configuration for monitoring constraints and monitoring statistics. These +// baseline resources are compared against the results of the current job from +// the series of jobs scheduled to collect data periodically. +type MonitoringBaselineConfig struct { _ struct{} `type:"structure"` - // >An array of AlgorithmSummary objects, each of which lists an algorithm. - // - // AlgorithmSummaryList is a required field - AlgorithmSummaryList []*AlgorithmSummary `type:"list" required:"true"` + // The baseline constraint file in Amazon S3 that the current monitoring job + // should validated against. + ConstraintsResource *MonitoringConstraintsResource `type:"structure"` - // If the response is truncated, Amazon SageMaker returns this token. To retrieve - // the next set of algorithms, use it in the subsequent request. - NextToken *string `type:"string"` + // The baseline statistics file in Amazon S3 that the current monitoring job + // should be validated against. + StatisticsResource *MonitoringStatisticsResource `type:"structure"` } // String returns the string representation -func (s ListAlgorithmsOutput) String() string { +func (s MonitoringBaselineConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListAlgorithmsOutput) GoString() string { +func (s MonitoringBaselineConfig) GoString() string { return s.String() } -// SetAlgorithmSummaryList sets the AlgorithmSummaryList field's value. -func (s *ListAlgorithmsOutput) SetAlgorithmSummaryList(v []*AlgorithmSummary) *ListAlgorithmsOutput { - s.AlgorithmSummaryList = v +// SetConstraintsResource sets the ConstraintsResource field's value. +func (s *MonitoringBaselineConfig) SetConstraintsResource(v *MonitoringConstraintsResource) *MonitoringBaselineConfig { + s.ConstraintsResource = v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListAlgorithmsOutput) SetNextToken(v string) *ListAlgorithmsOutput { - s.NextToken = &v +// SetStatisticsResource sets the StatisticsResource field's value. +func (s *MonitoringBaselineConfig) SetStatisticsResource(v *MonitoringStatisticsResource) *MonitoringBaselineConfig { + s.StatisticsResource = v return s } -type ListCodeRepositoriesInput struct { +// Configuration for the cluster used to run model monitoring jobs. +type MonitoringClusterConfig struct { _ struct{} `type:"structure"` - // A filter that returns only Git repositories that were created after the specified - // time. - CreationTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only Git repositories that were created before the - // specified time. - CreationTimeBefore *time.Time `type:"timestamp"` - - // A filter that returns only Git repositories that were last modified after - // the specified time. - LastModifiedTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only Git repositories that were last modified before - // the specified time. - LastModifiedTimeBefore *time.Time `type:"timestamp"` - - // The maximum number of Git repositories to return in the response. - MaxResults *int64 `min:"1" type:"integer"` - - // A string in the Git repositories name. This filter returns only repositories - // whose name contains the specified string. - NameContains *string `type:"string"` + // The number of ML compute instances to use in the model monitoring job. For + // distributed processing jobs, specify a value greater than 1. The default + // value is 1. + // + // InstanceCount is a required field + InstanceCount *int64 `min:"1" type:"integer" required:"true"` - // If the result of a ListCodeRepositoriesOutput request was truncated, the - // response includes a NextToken. To get the next set of Git repositories, use - // the token in the next request. - NextToken *string `type:"string"` + // The ML compute instance type for the processing job. + // + // InstanceType is a required field + InstanceType *string `type:"string" required:"true" enum:"ProcessingInstanceType"` - // The field to sort results by. The default is Name. - SortBy *string `type:"string" enum:"CodeRepositorySortBy"` + // The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to + // encrypt data on the storage volume attached to the ML compute instance(s) + // that run the model monitoring job. + VolumeKmsKeyId *string `type:"string"` - // The sort order for results. The default is Ascending. - SortOrder *string `type:"string" enum:"CodeRepositorySortOrder"` + // The size of the ML storage volume, in gigabytes, that you want to provision. + // You must specify sufficient ML storage for your scenario. + // + // VolumeSizeInGB is a required field + VolumeSizeInGB *int64 `min:"1" type:"integer" required:"true"` } // String returns the string representation -func (s ListCodeRepositoriesInput) String() string { +func (s MonitoringClusterConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListCodeRepositoriesInput) GoString() string { +func (s MonitoringClusterConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListCodeRepositoriesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCodeRepositoriesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *MonitoringClusterConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MonitoringClusterConfig"} + if s.InstanceCount == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceCount")) + } + if s.InstanceCount != nil && *s.InstanceCount < 1 { + invalidParams.Add(request.NewErrParamMinValue("InstanceCount", 1)) + } + if s.InstanceType == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceType")) + } + if s.VolumeSizeInGB == nil { + invalidParams.Add(request.NewErrParamRequired("VolumeSizeInGB")) + } + if s.VolumeSizeInGB != nil && *s.VolumeSizeInGB < 1 { + invalidParams.Add(request.NewErrParamMinValue("VolumeSizeInGB", 1)) } if invalidParams.Len() > 0 { @@ -17948,316 +36165,311 @@ func (s *ListCodeRepositoriesInput) Validate() error { return nil } -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListCodeRepositoriesInput) SetCreationTimeAfter(v time.Time) *ListCodeRepositoriesInput { - s.CreationTimeAfter = &v - return s -} - -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListCodeRepositoriesInput) SetCreationTimeBefore(v time.Time) *ListCodeRepositoriesInput { - s.CreationTimeBefore = &v - return s -} - -// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. -func (s *ListCodeRepositoriesInput) SetLastModifiedTimeAfter(v time.Time) *ListCodeRepositoriesInput { - s.LastModifiedTimeAfter = &v - return s -} - -// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. -func (s *ListCodeRepositoriesInput) SetLastModifiedTimeBefore(v time.Time) *ListCodeRepositoriesInput { - s.LastModifiedTimeBefore = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListCodeRepositoriesInput) SetMaxResults(v int64) *ListCodeRepositoriesInput { - s.MaxResults = &v - return s -} - -// SetNameContains sets the NameContains field's value. -func (s *ListCodeRepositoriesInput) SetNameContains(v string) *ListCodeRepositoriesInput { - s.NameContains = &v +// SetInstanceCount sets the InstanceCount field's value. +func (s *MonitoringClusterConfig) SetInstanceCount(v int64) *MonitoringClusterConfig { + s.InstanceCount = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListCodeRepositoriesInput) SetNextToken(v string) *ListCodeRepositoriesInput { - s.NextToken = &v +// SetInstanceType sets the InstanceType field's value. +func (s *MonitoringClusterConfig) SetInstanceType(v string) *MonitoringClusterConfig { + s.InstanceType = &v return s } -// SetSortBy sets the SortBy field's value. -func (s *ListCodeRepositoriesInput) SetSortBy(v string) *ListCodeRepositoriesInput { - s.SortBy = &v +// SetVolumeKmsKeyId sets the VolumeKmsKeyId field's value. +func (s *MonitoringClusterConfig) SetVolumeKmsKeyId(v string) *MonitoringClusterConfig { + s.VolumeKmsKeyId = &v return s } -// SetSortOrder sets the SortOrder field's value. -func (s *ListCodeRepositoriesInput) SetSortOrder(v string) *ListCodeRepositoriesInput { - s.SortOrder = &v +// SetVolumeSizeInGB sets the VolumeSizeInGB field's value. +func (s *MonitoringClusterConfig) SetVolumeSizeInGB(v int64) *MonitoringClusterConfig { + s.VolumeSizeInGB = &v return s } -type ListCodeRepositoriesOutput struct { +// The constraints resource for a monitoring job. +type MonitoringConstraintsResource struct { _ struct{} `type:"structure"` - // Gets a list of summaries of the Git repositories. Each summary specifies - // the following values for the repository: - // - // * Name - // - // * Amazon Resource Name (ARN) - // - // * Creation time - // - // * Last modified time - // - // * Configuration information, including the URL location of the repository - // and the ARN of the AWS Secrets Manager secret that contains the credentials - // used to access the repository. - // - // CodeRepositorySummaryList is a required field - CodeRepositorySummaryList []*CodeRepositorySummary `type:"list" required:"true"` - - // If the result of a ListCodeRepositoriesOutput request was truncated, the - // response includes a NextToken. To get the next set of Git repositories, use - // the token in the next request. - NextToken *string `type:"string"` + // The Amazon S3 URI for the constraints resource. + S3Uri *string `type:"string"` } // String returns the string representation -func (s ListCodeRepositoriesOutput) String() string { +func (s MonitoringConstraintsResource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListCodeRepositoriesOutput) GoString() string { +func (s MonitoringConstraintsResource) GoString() string { return s.String() } -// SetCodeRepositorySummaryList sets the CodeRepositorySummaryList field's value. -func (s *ListCodeRepositoriesOutput) SetCodeRepositorySummaryList(v []*CodeRepositorySummary) *ListCodeRepositoriesOutput { - s.CodeRepositorySummaryList = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCodeRepositoriesOutput) SetNextToken(v string) *ListCodeRepositoriesOutput { - s.NextToken = &v +// SetS3Uri sets the S3Uri field's value. +func (s *MonitoringConstraintsResource) SetS3Uri(v string) *MonitoringConstraintsResource { + s.S3Uri = &v return s } -type ListCompilationJobsInput struct { +// Summary of information about the last monitoring job to run. +type MonitoringExecutionSummary struct { _ struct{} `type:"structure"` - // A filter that returns the model compilation jobs that were created after - // a specified time. - CreationTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns the model compilation jobs that were created before - // a specified time. - CreationTimeBefore *time.Time `type:"timestamp"` - - // A filter that returns the model compilation jobs that were modified after - // a specified time. - LastModifiedTimeAfter *time.Time `type:"timestamp"` + // The time at which the monitoring job was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` - // A filter that returns the model compilation jobs that were modified before - // a specified time. - LastModifiedTimeBefore *time.Time `type:"timestamp"` + // The name of teh endpoint used to run the monitoring job. + EndpointName *string `type:"string"` - // The maximum number of model compilation jobs to return in the response. - MaxResults *int64 `min:"1" type:"integer"` + // Contains the reason a monitoring job failed, if it failed. + FailureReason *string `type:"string"` - // A filter that returns the model compilation jobs whose name contains a specified - // string. - NameContains *string `type:"string"` + // A timestamp that indicates the last time the monitoring job was modified. + // + // LastModifiedTime is a required field + LastModifiedTime *time.Time `type:"timestamp" required:"true"` - // If the result of the previous ListCompilationJobs request was truncated, - // the response includes a NextToken. To retrieve the next set of model compilation - // jobs, use the token in the next request. - NextToken *string `type:"string"` + // The status of the monitoring job. + // + // MonitoringExecutionStatus is a required field + MonitoringExecutionStatus *string `type:"string" required:"true" enum:"ExecutionStatus"` - // The field by which to sort results. The default is CreationTime. - SortBy *string `type:"string" enum:"ListCompilationJobsSortBy"` + // The name of the monitoring schedule. + // + // MonitoringScheduleName is a required field + MonitoringScheduleName *string `min:"1" type:"string" required:"true"` - // The sort order for results. The default is Ascending. - SortOrder *string `type:"string" enum:"SortOrder"` + // The Amazon Resource Name (ARN) of the monitoring job. + ProcessingJobArn *string `type:"string"` - // A filter that retrieves model compilation jobs with a specific DescribeCompilationJobResponse$CompilationJobStatus - // status. - StatusEquals *string `type:"string" enum:"CompilationJobStatus"` + // The time the monitoring job was scheduled. + // + // ScheduledTime is a required field + ScheduledTime *time.Time `type:"timestamp" required:"true"` } // String returns the string representation -func (s ListCompilationJobsInput) String() string { +func (s MonitoringExecutionSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListCompilationJobsInput) GoString() string { +func (s MonitoringExecutionSummary) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCompilationJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCompilationJobsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListCompilationJobsInput) SetCreationTimeAfter(v time.Time) *ListCompilationJobsInput { - s.CreationTimeAfter = &v - return s -} - -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListCompilationJobsInput) SetCreationTimeBefore(v time.Time) *ListCompilationJobsInput { - s.CreationTimeBefore = &v - return s -} - -// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. -func (s *ListCompilationJobsInput) SetLastModifiedTimeAfter(v time.Time) *ListCompilationJobsInput { - s.LastModifiedTimeAfter = &v +// SetCreationTime sets the CreationTime field's value. +func (s *MonitoringExecutionSummary) SetCreationTime(v time.Time) *MonitoringExecutionSummary { + s.CreationTime = &v return s } -// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. -func (s *ListCompilationJobsInput) SetLastModifiedTimeBefore(v time.Time) *ListCompilationJobsInput { - s.LastModifiedTimeBefore = &v +// SetEndpointName sets the EndpointName field's value. +func (s *MonitoringExecutionSummary) SetEndpointName(v string) *MonitoringExecutionSummary { + s.EndpointName = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListCompilationJobsInput) SetMaxResults(v int64) *ListCompilationJobsInput { - s.MaxResults = &v +// SetFailureReason sets the FailureReason field's value. +func (s *MonitoringExecutionSummary) SetFailureReason(v string) *MonitoringExecutionSummary { + s.FailureReason = &v return s } -// SetNameContains sets the NameContains field's value. -func (s *ListCompilationJobsInput) SetNameContains(v string) *ListCompilationJobsInput { - s.NameContains = &v +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *MonitoringExecutionSummary) SetLastModifiedTime(v time.Time) *MonitoringExecutionSummary { + s.LastModifiedTime = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListCompilationJobsInput) SetNextToken(v string) *ListCompilationJobsInput { - s.NextToken = &v +// SetMonitoringExecutionStatus sets the MonitoringExecutionStatus field's value. +func (s *MonitoringExecutionSummary) SetMonitoringExecutionStatus(v string) *MonitoringExecutionSummary { + s.MonitoringExecutionStatus = &v return s } -// SetSortBy sets the SortBy field's value. -func (s *ListCompilationJobsInput) SetSortBy(v string) *ListCompilationJobsInput { - s.SortBy = &v +// SetMonitoringScheduleName sets the MonitoringScheduleName field's value. +func (s *MonitoringExecutionSummary) SetMonitoringScheduleName(v string) *MonitoringExecutionSummary { + s.MonitoringScheduleName = &v return s } -// SetSortOrder sets the SortOrder field's value. -func (s *ListCompilationJobsInput) SetSortOrder(v string) *ListCompilationJobsInput { - s.SortOrder = &v +// SetProcessingJobArn sets the ProcessingJobArn field's value. +func (s *MonitoringExecutionSummary) SetProcessingJobArn(v string) *MonitoringExecutionSummary { + s.ProcessingJobArn = &v return s } -// SetStatusEquals sets the StatusEquals field's value. -func (s *ListCompilationJobsInput) SetStatusEquals(v string) *ListCompilationJobsInput { - s.StatusEquals = &v +// SetScheduledTime sets the ScheduledTime field's value. +func (s *MonitoringExecutionSummary) SetScheduledTime(v time.Time) *MonitoringExecutionSummary { + s.ScheduledTime = &v return s } -type ListCompilationJobsOutput struct { +// The inputs for a monitoring job. +type MonitoringInput struct { _ struct{} `type:"structure"` - // An array of CompilationJobSummary objects, each describing a model compilation - // job. + // The endpoint for a monitoring job. // - // CompilationJobSummaries is a required field - CompilationJobSummaries []*CompilationJobSummary `type:"list" required:"true"` - - // If the response is truncated, Amazon SageMaker returns this NextToken. To - // retrieve the next set of model compilation jobs, use this token in the next - // request. - NextToken *string `type:"string"` + // EndpointInput is a required field + EndpointInput *EndpointInput `type:"structure" required:"true"` } // String returns the string representation -func (s ListCompilationJobsOutput) String() string { +func (s MonitoringInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListCompilationJobsOutput) GoString() string { +func (s MonitoringInput) GoString() string { return s.String() } -// SetCompilationJobSummaries sets the CompilationJobSummaries field's value. -func (s *ListCompilationJobsOutput) SetCompilationJobSummaries(v []*CompilationJobSummary) *ListCompilationJobsOutput { - s.CompilationJobSummaries = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *MonitoringInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MonitoringInput"} + if s.EndpointInput == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointInput")) + } + if s.EndpointInput != nil { + if err := s.EndpointInput.Validate(); err != nil { + invalidParams.AddNested("EndpointInput", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetNextToken sets the NextToken field's value. -func (s *ListCompilationJobsOutput) SetNextToken(v string) *ListCompilationJobsOutput { - s.NextToken = &v +// SetEndpointInput sets the EndpointInput field's value. +func (s *MonitoringInput) SetEndpointInput(v *EndpointInput) *MonitoringInput { + s.EndpointInput = v return s } -type ListEndpointConfigsInput struct { +// Defines the monitoring job. +type MonitoringJobDefinition struct { _ struct{} `type:"structure"` - // A filter that returns only endpoint configurations with a creation time greater - // than or equal to the specified time (timestamp). - CreationTimeAfter *time.Time `type:"timestamp"` + // Baseline configuration used to validate that the data conforms to the specified + // constraints and statistics + BaselineConfig *MonitoringBaselineConfig `type:"structure"` - // A filter that returns only endpoint configurations created before the specified - // time (timestamp). - CreationTimeBefore *time.Time `type:"timestamp"` + // Sets the environment variables in the Docker container. + Environment map[string]*string `type:"map"` - // The maximum number of training jobs to return in the response. - MaxResults *int64 `min:"1" type:"integer"` + // Configures the monitoring job to run a specified Docker container image. + // + // MonitoringAppSpecification is a required field + MonitoringAppSpecification *MonitoringAppSpecification `type:"structure" required:"true"` - // A string in the endpoint configuration name. This filter returns only endpoint - // configurations whose name contains the specified string. - NameContains *string `type:"string"` + // The array of inputs for the monitoring job. Currently we support monitoring + // an Amazon SageMaker Endpoint. + // + // MonitoringInputs is a required field + MonitoringInputs []*MonitoringInput `min:"1" type:"list" required:"true"` - // If the result of the previous ListEndpointConfig request was truncated, the - // response includes a NextToken. To retrieve the next set of endpoint configurations, - // use the token in the next request. - NextToken *string `type:"string"` + // The array of outputs from the monitoring job to be uploaded to Amazon Simple + // Storage Service (Amazon S3). + // + // MonitoringOutputConfig is a required field + MonitoringOutputConfig *MonitoringOutputConfig `type:"structure" required:"true"` - // The field to sort results by. The default is CreationTime. - SortBy *string `type:"string" enum:"EndpointConfigSortKey"` + // Identifies the resources, ML compute instances, and ML storage volumes to + // deploy for a monitoring job. In distributed processing, you specify more + // than one instance. + // + // MonitoringResources is a required field + MonitoringResources *MonitoringResources `type:"structure" required:"true"` - // The sort order for results. The default is Descending. - SortOrder *string `type:"string" enum:"OrderKey"` + // Specifies networking options for an monitoring job. + NetworkConfig *NetworkConfig `type:"structure"` + + // The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume + // to perform tasks on your behalf. + // + // RoleArn is a required field + RoleArn *string `min:"20" type:"string" required:"true"` + + // Specifies a time limit for how long the monitoring job is allowed to run. + StoppingCondition *MonitoringStoppingCondition `type:"structure"` } // String returns the string representation -func (s ListEndpointConfigsInput) String() string { +func (s MonitoringJobDefinition) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListEndpointConfigsInput) GoString() string { +func (s MonitoringJobDefinition) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListEndpointConfigsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEndpointConfigsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *MonitoringJobDefinition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MonitoringJobDefinition"} + if s.MonitoringAppSpecification == nil { + invalidParams.Add(request.NewErrParamRequired("MonitoringAppSpecification")) + } + if s.MonitoringInputs == nil { + invalidParams.Add(request.NewErrParamRequired("MonitoringInputs")) + } + if s.MonitoringInputs != nil && len(s.MonitoringInputs) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MonitoringInputs", 1)) + } + if s.MonitoringOutputConfig == nil { + invalidParams.Add(request.NewErrParamRequired("MonitoringOutputConfig")) + } + if s.MonitoringResources == nil { + invalidParams.Add(request.NewErrParamRequired("MonitoringResources")) + } + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) + } + if s.RoleArn != nil && len(*s.RoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) + } + if s.MonitoringAppSpecification != nil { + if err := s.MonitoringAppSpecification.Validate(); err != nil { + invalidParams.AddNested("MonitoringAppSpecification", err.(request.ErrInvalidParams)) + } + } + if s.MonitoringInputs != nil { + for i, v := range s.MonitoringInputs { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MonitoringInputs", i), err.(request.ErrInvalidParams)) + } + } + } + if s.MonitoringOutputConfig != nil { + if err := s.MonitoringOutputConfig.Validate(); err != nil { + invalidParams.AddNested("MonitoringOutputConfig", err.(request.ErrInvalidParams)) + } + } + if s.MonitoringResources != nil { + if err := s.MonitoringResources.Validate(); err != nil { + invalidParams.AddNested("MonitoringResources", err.(request.ErrInvalidParams)) + } + } + if s.NetworkConfig != nil { + if err := s.NetworkConfig.Validate(); err != nil { + invalidParams.AddNested("NetworkConfig", err.(request.ErrInvalidParams)) + } + } + if s.StoppingCondition != nil { + if err := s.StoppingCondition.Validate(); err != nil { + invalidParams.AddNested("StoppingCondition", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -18266,139 +36478,148 @@ func (s *ListEndpointConfigsInput) Validate() error { return nil } -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListEndpointConfigsInput) SetCreationTimeAfter(v time.Time) *ListEndpointConfigsInput { - s.CreationTimeAfter = &v +// SetBaselineConfig sets the BaselineConfig field's value. +func (s *MonitoringJobDefinition) SetBaselineConfig(v *MonitoringBaselineConfig) *MonitoringJobDefinition { + s.BaselineConfig = v return s } -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListEndpointConfigsInput) SetCreationTimeBefore(v time.Time) *ListEndpointConfigsInput { - s.CreationTimeBefore = &v +// SetEnvironment sets the Environment field's value. +func (s *MonitoringJobDefinition) SetEnvironment(v map[string]*string) *MonitoringJobDefinition { + s.Environment = v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListEndpointConfigsInput) SetMaxResults(v int64) *ListEndpointConfigsInput { - s.MaxResults = &v +// SetMonitoringAppSpecification sets the MonitoringAppSpecification field's value. +func (s *MonitoringJobDefinition) SetMonitoringAppSpecification(v *MonitoringAppSpecification) *MonitoringJobDefinition { + s.MonitoringAppSpecification = v return s } -// SetNameContains sets the NameContains field's value. -func (s *ListEndpointConfigsInput) SetNameContains(v string) *ListEndpointConfigsInput { - s.NameContains = &v +// SetMonitoringInputs sets the MonitoringInputs field's value. +func (s *MonitoringJobDefinition) SetMonitoringInputs(v []*MonitoringInput) *MonitoringJobDefinition { + s.MonitoringInputs = v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListEndpointConfigsInput) SetNextToken(v string) *ListEndpointConfigsInput { - s.NextToken = &v +// SetMonitoringOutputConfig sets the MonitoringOutputConfig field's value. +func (s *MonitoringJobDefinition) SetMonitoringOutputConfig(v *MonitoringOutputConfig) *MonitoringJobDefinition { + s.MonitoringOutputConfig = v return s } -// SetSortBy sets the SortBy field's value. -func (s *ListEndpointConfigsInput) SetSortBy(v string) *ListEndpointConfigsInput { - s.SortBy = &v +// SetMonitoringResources sets the MonitoringResources field's value. +func (s *MonitoringJobDefinition) SetMonitoringResources(v *MonitoringResources) *MonitoringJobDefinition { + s.MonitoringResources = v return s } -// SetSortOrder sets the SortOrder field's value. -func (s *ListEndpointConfigsInput) SetSortOrder(v string) *ListEndpointConfigsInput { - s.SortOrder = &v +// SetNetworkConfig sets the NetworkConfig field's value. +func (s *MonitoringJobDefinition) SetNetworkConfig(v *NetworkConfig) *MonitoringJobDefinition { + s.NetworkConfig = v return s } -type ListEndpointConfigsOutput struct { +// SetRoleArn sets the RoleArn field's value. +func (s *MonitoringJobDefinition) SetRoleArn(v string) *MonitoringJobDefinition { + s.RoleArn = &v + return s +} + +// SetStoppingCondition sets the StoppingCondition field's value. +func (s *MonitoringJobDefinition) SetStoppingCondition(v *MonitoringStoppingCondition) *MonitoringJobDefinition { + s.StoppingCondition = v + return s +} + +// The output object for a monitoring job. +type MonitoringOutput struct { _ struct{} `type:"structure"` - // An array of endpoint configurations. + // The Amazon S3 storage location where the results of a monitoring job are + // saved. // - // EndpointConfigs is a required field - EndpointConfigs []*EndpointConfigSummary `type:"list" required:"true"` - - // If the response is truncated, Amazon SageMaker returns this token. To retrieve - // the next set of endpoint configurations, use it in the subsequent request - NextToken *string `type:"string"` + // S3Output is a required field + S3Output *MonitoringS3Output `type:"structure" required:"true"` } // String returns the string representation -func (s ListEndpointConfigsOutput) String() string { +func (s MonitoringOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListEndpointConfigsOutput) GoString() string { +func (s MonitoringOutput) GoString() string { return s.String() } -// SetEndpointConfigs sets the EndpointConfigs field's value. -func (s *ListEndpointConfigsOutput) SetEndpointConfigs(v []*EndpointConfigSummary) *ListEndpointConfigsOutput { - s.EndpointConfigs = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *MonitoringOutput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MonitoringOutput"} + if s.S3Output == nil { + invalidParams.Add(request.NewErrParamRequired("S3Output")) + } + if s.S3Output != nil { + if err := s.S3Output.Validate(); err != nil { + invalidParams.AddNested("S3Output", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetNextToken sets the NextToken field's value. -func (s *ListEndpointConfigsOutput) SetNextToken(v string) *ListEndpointConfigsOutput { - s.NextToken = &v +// SetS3Output sets the S3Output field's value. +func (s *MonitoringOutput) SetS3Output(v *MonitoringS3Output) *MonitoringOutput { + s.S3Output = v return s } -type ListEndpointsInput struct { +// The output configuration for monitoring jobs. +type MonitoringOutputConfig struct { _ struct{} `type:"structure"` - // A filter that returns only endpoints with a creation time greater than or - // equal to the specified time (timestamp). - CreationTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only endpoints that were created before the specified - // time (timestamp). - CreationTimeBefore *time.Time `type:"timestamp"` - - // A filter that returns only endpoints that were modified after the specified - // timestamp. - LastModifiedTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only endpoints that were modified before the specified - // timestamp. - LastModifiedTimeBefore *time.Time `type:"timestamp"` - - // The maximum number of endpoints to return in the response. - MaxResults *int64 `min:"1" type:"integer"` - - // A string in endpoint names. This filter returns only endpoints whose name - // contains the specified string. - NameContains *string `type:"string"` - - // If the result of a ListEndpoints request was truncated, the response includes - // a NextToken. To retrieve the next set of endpoints, use the token in the - // next request. - NextToken *string `type:"string"` - - // Sorts the list of results. The default is CreationTime. - SortBy *string `type:"string" enum:"EndpointSortKey"` - - // The sort order for results. The default is Descending. - SortOrder *string `type:"string" enum:"OrderKey"` + // The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to + // encrypt the model artifacts at rest using Amazon S3 server-side encryption. + KmsKeyId *string `type:"string"` - // A filter that returns only endpoints with the specified status. - StatusEquals *string `type:"string" enum:"EndpointStatus"` + // Monitoring outputs for monitoring jobs. This is where the output of the periodic + // monitoring jobs is uploaded. + // + // MonitoringOutputs is a required field + MonitoringOutputs []*MonitoringOutput `min:"1" type:"list" required:"true"` } // String returns the string representation -func (s ListEndpointsInput) String() string { +func (s MonitoringOutputConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListEndpointsInput) GoString() string { +func (s MonitoringOutputConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListEndpointsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEndpointsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *MonitoringOutputConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MonitoringOutputConfig"} + if s.MonitoringOutputs == nil { + invalidParams.Add(request.NewErrParamRequired("MonitoringOutputs")) + } + if s.MonitoringOutputs != nil && len(s.MonitoringOutputs) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MonitoringOutputs", 1)) + } + if s.MonitoringOutputs != nil { + for i, v := range s.MonitoringOutputs { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MonitoringOutputs", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -18407,157 +36628,167 @@ func (s *ListEndpointsInput) Validate() error { return nil } -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListEndpointsInput) SetCreationTimeAfter(v time.Time) *ListEndpointsInput { - s.CreationTimeAfter = &v - return s -} - -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListEndpointsInput) SetCreationTimeBefore(v time.Time) *ListEndpointsInput { - s.CreationTimeBefore = &v +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *MonitoringOutputConfig) SetKmsKeyId(v string) *MonitoringOutputConfig { + s.KmsKeyId = &v return s } -// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. -func (s *ListEndpointsInput) SetLastModifiedTimeAfter(v time.Time) *ListEndpointsInput { - s.LastModifiedTimeAfter = &v +// SetMonitoringOutputs sets the MonitoringOutputs field's value. +func (s *MonitoringOutputConfig) SetMonitoringOutputs(v []*MonitoringOutput) *MonitoringOutputConfig { + s.MonitoringOutputs = v return s } -// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. -func (s *ListEndpointsInput) SetLastModifiedTimeBefore(v time.Time) *ListEndpointsInput { - s.LastModifiedTimeBefore = &v - return s -} +// Identifies the resources to deploy for a monitoring job. +type MonitoringResources struct { + _ struct{} `type:"structure"` -// SetMaxResults sets the MaxResults field's value. -func (s *ListEndpointsInput) SetMaxResults(v int64) *ListEndpointsInput { - s.MaxResults = &v - return s + // The configuration for the cluster resources used to run the processing job. + // + // ClusterConfig is a required field + ClusterConfig *MonitoringClusterConfig `type:"structure" required:"true"` } -// SetNameContains sets the NameContains field's value. -func (s *ListEndpointsInput) SetNameContains(v string) *ListEndpointsInput { - s.NameContains = &v - return s +// String returns the string representation +func (s MonitoringResources) String() string { + return awsutil.Prettify(s) } -// SetNextToken sets the NextToken field's value. -func (s *ListEndpointsInput) SetNextToken(v string) *ListEndpointsInput { - s.NextToken = &v - return s +// GoString returns the string representation +func (s MonitoringResources) GoString() string { + return s.String() } -// SetSortBy sets the SortBy field's value. -func (s *ListEndpointsInput) SetSortBy(v string) *ListEndpointsInput { - s.SortBy = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *MonitoringResources) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MonitoringResources"} + if s.ClusterConfig == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterConfig")) + } + if s.ClusterConfig != nil { + if err := s.ClusterConfig.Validate(); err != nil { + invalidParams.AddNested("ClusterConfig", err.(request.ErrInvalidParams)) + } + } -// SetSortOrder sets the SortOrder field's value. -func (s *ListEndpointsInput) SetSortOrder(v string) *ListEndpointsInput { - s.SortOrder = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetStatusEquals sets the StatusEquals field's value. -func (s *ListEndpointsInput) SetStatusEquals(v string) *ListEndpointsInput { - s.StatusEquals = &v +// SetClusterConfig sets the ClusterConfig field's value. +func (s *MonitoringResources) SetClusterConfig(v *MonitoringClusterConfig) *MonitoringResources { + s.ClusterConfig = v return s } -type ListEndpointsOutput struct { +// Information about where and how you want to store the results of a monitoring +// job. +type MonitoringS3Output struct { _ struct{} `type:"structure"` - // An array or endpoint objects. + // The local path to the Amazon S3 storage location where Amazon SageMaker saves + // the results of a monitoring job. LocalPath is an absolute path for the output + // data. // - // Endpoints is a required field - Endpoints []*EndpointSummary `type:"list" required:"true"` + // LocalPath is a required field + LocalPath *string `type:"string" required:"true"` - // If the response is truncated, Amazon SageMaker returns this token. To retrieve - // the next set of training jobs, use it in the subsequent request. - NextToken *string `type:"string"` + // Whether to upload the results of the monitoring job continuously or after + // the job completes. + S3UploadMode *string `type:"string" enum:"ProcessingS3UploadMode"` + + // A URI that identifies the Amazon S3 storage location where Amazon SageMaker + // saves the results of a monitoring job. + // + // S3Uri is a required field + S3Uri *string `type:"string" required:"true"` } // String returns the string representation -func (s ListEndpointsOutput) String() string { +func (s MonitoringS3Output) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListEndpointsOutput) GoString() string { +func (s MonitoringS3Output) GoString() string { return s.String() } -// SetEndpoints sets the Endpoints field's value. -func (s *ListEndpointsOutput) SetEndpoints(v []*EndpointSummary) *ListEndpointsOutput { - s.Endpoints = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *MonitoringS3Output) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MonitoringS3Output"} + if s.LocalPath == nil { + invalidParams.Add(request.NewErrParamRequired("LocalPath")) + } + if s.S3Uri == nil { + invalidParams.Add(request.NewErrParamRequired("S3Uri")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetNextToken sets the NextToken field's value. -func (s *ListEndpointsOutput) SetNextToken(v string) *ListEndpointsOutput { - s.NextToken = &v +// SetLocalPath sets the LocalPath field's value. +func (s *MonitoringS3Output) SetLocalPath(v string) *MonitoringS3Output { + s.LocalPath = &v return s } -type ListHyperParameterTuningJobsInput struct { - _ struct{} `type:"structure"` - - // A filter that returns only tuning jobs that were created after the specified - // time. - CreationTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only tuning jobs that were created before the specified - // time. - CreationTimeBefore *time.Time `type:"timestamp"` - - // A filter that returns only tuning jobs that were modified after the specified - // time. - LastModifiedTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only tuning jobs that were modified before the specified - // time. - LastModifiedTimeBefore *time.Time `type:"timestamp"` - - // The maximum number of tuning jobs to return. The default value is 10. - MaxResults *int64 `min:"1" type:"integer"` - - // A string in the tuning job name. This filter returns only tuning jobs whose - // name contains the specified string. - NameContains *string `type:"string"` - - // If the result of the previous ListHyperParameterTuningJobs request was truncated, - // the response includes a NextToken. To retrieve the next set of tuning jobs, - // use the token in the next request. - NextToken *string `type:"string"` +// SetS3UploadMode sets the S3UploadMode field's value. +func (s *MonitoringS3Output) SetS3UploadMode(v string) *MonitoringS3Output { + s.S3UploadMode = &v + return s +} - // The field to sort results by. The default is Name. - SortBy *string `type:"string" enum:"HyperParameterTuningJobSortByOptions"` +// SetS3Uri sets the S3Uri field's value. +func (s *MonitoringS3Output) SetS3Uri(v string) *MonitoringS3Output { + s.S3Uri = &v + return s +} - // The sort order for results. The default is Ascending. - SortOrder *string `type:"string" enum:"SortOrder"` +// Configures the monitoring schedule and defines the monitoring job. +type MonitoringScheduleConfig struct { + _ struct{} `type:"structure"` - // A filter that returns only tuning jobs with the specified status. - StatusEquals *string `type:"string" enum:"HyperParameterTuningJobStatus"` + // Defines the monitoring job. + // + // MonitoringJobDefinition is a required field + MonitoringJobDefinition *MonitoringJobDefinition `type:"structure" required:"true"` + + // Configures the monitoring schedule. + ScheduleConfig *ScheduleConfig `type:"structure"` } // String returns the string representation -func (s ListHyperParameterTuningJobsInput) String() string { +func (s MonitoringScheduleConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListHyperParameterTuningJobsInput) GoString() string { +func (s MonitoringScheduleConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListHyperParameterTuningJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListHyperParameterTuningJobsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *MonitoringScheduleConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MonitoringScheduleConfig"} + if s.MonitoringJobDefinition == nil { + invalidParams.Add(request.NewErrParamRequired("MonitoringJobDefinition")) + } + if s.MonitoringJobDefinition != nil { + if err := s.MonitoringJobDefinition.Validate(); err != nil { + invalidParams.AddNested("MonitoringJobDefinition", err.(request.ErrInvalidParams)) + } + } + if s.ScheduleConfig != nil { + if err := s.ScheduleConfig.Validate(); err != nil { + invalidParams.AddNested("ScheduleConfig", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -18566,160 +36797,149 @@ func (s *ListHyperParameterTuningJobsInput) Validate() error { return nil } -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListHyperParameterTuningJobsInput) SetCreationTimeAfter(v time.Time) *ListHyperParameterTuningJobsInput { - s.CreationTimeAfter = &v +// SetMonitoringJobDefinition sets the MonitoringJobDefinition field's value. +func (s *MonitoringScheduleConfig) SetMonitoringJobDefinition(v *MonitoringJobDefinition) *MonitoringScheduleConfig { + s.MonitoringJobDefinition = v return s } -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListHyperParameterTuningJobsInput) SetCreationTimeBefore(v time.Time) *ListHyperParameterTuningJobsInput { - s.CreationTimeBefore = &v +// SetScheduleConfig sets the ScheduleConfig field's value. +func (s *MonitoringScheduleConfig) SetScheduleConfig(v *ScheduleConfig) *MonitoringScheduleConfig { + s.ScheduleConfig = v return s } -// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. -func (s *ListHyperParameterTuningJobsInput) SetLastModifiedTimeAfter(v time.Time) *ListHyperParameterTuningJobsInput { - s.LastModifiedTimeAfter = &v - return s +// Summarizes the monitoring schedule. +type MonitoringScheduleSummary struct { + _ struct{} `type:"structure"` + + // The creation time of the monitoring schedule. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // The name of the endpoint using the monitoring schedule. + EndpointName *string `type:"string"` + + // The last time the monitoring schedule was modified. + // + // LastModifiedTime is a required field + LastModifiedTime *time.Time `type:"timestamp" required:"true"` + + // The Amazon Resource Name (ARN) of the monitoring schedule. + // + // MonitoringScheduleArn is a required field + MonitoringScheduleArn *string `type:"string" required:"true"` + + // The name of the monitoring schedule. + // + // MonitoringScheduleName is a required field + MonitoringScheduleName *string `min:"1" type:"string" required:"true"` + + // The status of the monitoring schedule. + // + // MonitoringScheduleStatus is a required field + MonitoringScheduleStatus *string `type:"string" required:"true" enum:"ScheduleStatus"` } -// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. -func (s *ListHyperParameterTuningJobsInput) SetLastModifiedTimeBefore(v time.Time) *ListHyperParameterTuningJobsInput { - s.LastModifiedTimeBefore = &v - return s +// String returns the string representation +func (s MonitoringScheduleSummary) String() string { + return awsutil.Prettify(s) } -// SetMaxResults sets the MaxResults field's value. -func (s *ListHyperParameterTuningJobsInput) SetMaxResults(v int64) *ListHyperParameterTuningJobsInput { - s.MaxResults = &v +// GoString returns the string representation +func (s MonitoringScheduleSummary) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *MonitoringScheduleSummary) SetCreationTime(v time.Time) *MonitoringScheduleSummary { + s.CreationTime = &v return s } -// SetNameContains sets the NameContains field's value. -func (s *ListHyperParameterTuningJobsInput) SetNameContains(v string) *ListHyperParameterTuningJobsInput { - s.NameContains = &v +// SetEndpointName sets the EndpointName field's value. +func (s *MonitoringScheduleSummary) SetEndpointName(v string) *MonitoringScheduleSummary { + s.EndpointName = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListHyperParameterTuningJobsInput) SetNextToken(v string) *ListHyperParameterTuningJobsInput { - s.NextToken = &v +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *MonitoringScheduleSummary) SetLastModifiedTime(v time.Time) *MonitoringScheduleSummary { + s.LastModifiedTime = &v return s } -// SetSortBy sets the SortBy field's value. -func (s *ListHyperParameterTuningJobsInput) SetSortBy(v string) *ListHyperParameterTuningJobsInput { - s.SortBy = &v +// SetMonitoringScheduleArn sets the MonitoringScheduleArn field's value. +func (s *MonitoringScheduleSummary) SetMonitoringScheduleArn(v string) *MonitoringScheduleSummary { + s.MonitoringScheduleArn = &v return s } -// SetSortOrder sets the SortOrder field's value. -func (s *ListHyperParameterTuningJobsInput) SetSortOrder(v string) *ListHyperParameterTuningJobsInput { - s.SortOrder = &v +// SetMonitoringScheduleName sets the MonitoringScheduleName field's value. +func (s *MonitoringScheduleSummary) SetMonitoringScheduleName(v string) *MonitoringScheduleSummary { + s.MonitoringScheduleName = &v return s } -// SetStatusEquals sets the StatusEquals field's value. -func (s *ListHyperParameterTuningJobsInput) SetStatusEquals(v string) *ListHyperParameterTuningJobsInput { - s.StatusEquals = &v +// SetMonitoringScheduleStatus sets the MonitoringScheduleStatus field's value. +func (s *MonitoringScheduleSummary) SetMonitoringScheduleStatus(v string) *MonitoringScheduleSummary { + s.MonitoringScheduleStatus = &v return s } -type ListHyperParameterTuningJobsOutput struct { +// The statistics resource for a monitoring job. +type MonitoringStatisticsResource struct { _ struct{} `type:"structure"` - // A list of HyperParameterTuningJobSummary objects that describe the tuning - // jobs that the ListHyperParameterTuningJobs request returned. - // - // HyperParameterTuningJobSummaries is a required field - HyperParameterTuningJobSummaries []*HyperParameterTuningJobSummary `type:"list" required:"true"` - - // If the result of this ListHyperParameterTuningJobs request was truncated, - // the response includes a NextToken. To retrieve the next set of tuning jobs, - // use the token in the next request. - NextToken *string `type:"string"` + // The Amazon S3 URI for the statistics resource. + S3Uri *string `type:"string"` } // String returns the string representation -func (s ListHyperParameterTuningJobsOutput) String() string { +func (s MonitoringStatisticsResource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListHyperParameterTuningJobsOutput) GoString() string { +func (s MonitoringStatisticsResource) GoString() string { return s.String() } -// SetHyperParameterTuningJobSummaries sets the HyperParameterTuningJobSummaries field's value. -func (s *ListHyperParameterTuningJobsOutput) SetHyperParameterTuningJobSummaries(v []*HyperParameterTuningJobSummary) *ListHyperParameterTuningJobsOutput { - s.HyperParameterTuningJobSummaries = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListHyperParameterTuningJobsOutput) SetNextToken(v string) *ListHyperParameterTuningJobsOutput { - s.NextToken = &v +// SetS3Uri sets the S3Uri field's value. +func (s *MonitoringStatisticsResource) SetS3Uri(v string) *MonitoringStatisticsResource { + s.S3Uri = &v return s } -type ListLabelingJobsForWorkteamInput struct { +// A time limit for how long the monitoring job is allowed to run before stopping. +type MonitoringStoppingCondition struct { _ struct{} `type:"structure"` - // A filter that returns only labeling jobs created after the specified time - // (timestamp). - CreationTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only labeling jobs created before the specified time - // (timestamp). - CreationTimeBefore *time.Time `type:"timestamp"` - - // A filter the limits jobs to only the ones whose job reference code contains - // the specified string. - JobReferenceCodeContains *string `min:"1" type:"string"` - - // The maximum number of labeling jobs to return in each page of the response. - MaxResults *int64 `min:"1" type:"integer"` - - // If the result of the previous ListLabelingJobsForWorkteam request was truncated, - // the response includes a NextToken. To retrieve the next set of labeling jobs, - // use the token in the next request. - NextToken *string `type:"string"` - - // The field to sort results by. The default is CreationTime. - SortBy *string `type:"string" enum:"ListLabelingJobsForWorkteamSortByOptions"` - - // The sort order for results. The default is Ascending. - SortOrder *string `type:"string" enum:"SortOrder"` - - // The Amazon Resource Name (ARN) of the work team for which you want to see - // labeling jobs for. + // The maximum runtime allowed in seconds. // - // WorkteamArn is a required field - WorkteamArn *string `type:"string" required:"true"` + // MaxRuntimeInSeconds is a required field + MaxRuntimeInSeconds *int64 `min:"1" type:"integer" required:"true"` } // String returns the string representation -func (s ListLabelingJobsForWorkteamInput) String() string { +func (s MonitoringStoppingCondition) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListLabelingJobsForWorkteamInput) GoString() string { +func (s MonitoringStoppingCondition) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListLabelingJobsForWorkteamInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListLabelingJobsForWorkteamInput"} - if s.JobReferenceCodeContains != nil && len(*s.JobReferenceCodeContains) < 1 { - invalidParams.Add(request.NewErrParamMinLen("JobReferenceCodeContains", 1)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *MonitoringStoppingCondition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MonitoringStoppingCondition"} + if s.MaxRuntimeInSeconds == nil { + invalidParams.Add(request.NewErrParamRequired("MaxRuntimeInSeconds")) } - if s.WorkteamArn == nil { - invalidParams.Add(request.NewErrParamRequired("WorkteamArn")) + if s.MaxRuntimeInSeconds != nil && *s.MaxRuntimeInSeconds < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxRuntimeInSeconds", 1)) } if invalidParams.Len() > 0 { @@ -18728,145 +36948,135 @@ func (s *ListLabelingJobsForWorkteamInput) Validate() error { return nil } -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListLabelingJobsForWorkteamInput) SetCreationTimeAfter(v time.Time) *ListLabelingJobsForWorkteamInput { - s.CreationTimeAfter = &v - return s -} - -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListLabelingJobsForWorkteamInput) SetCreationTimeBefore(v time.Time) *ListLabelingJobsForWorkteamInput { - s.CreationTimeBefore = &v - return s -} - -// SetJobReferenceCodeContains sets the JobReferenceCodeContains field's value. -func (s *ListLabelingJobsForWorkteamInput) SetJobReferenceCodeContains(v string) *ListLabelingJobsForWorkteamInput { - s.JobReferenceCodeContains = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListLabelingJobsForWorkteamInput) SetMaxResults(v int64) *ListLabelingJobsForWorkteamInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListLabelingJobsForWorkteamInput) SetNextToken(v string) *ListLabelingJobsForWorkteamInput { - s.NextToken = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListLabelingJobsForWorkteamInput) SetSortBy(v string) *ListLabelingJobsForWorkteamInput { - s.SortBy = &v - return s -} - -// SetSortOrder sets the SortOrder field's value. -func (s *ListLabelingJobsForWorkteamInput) SetSortOrder(v string) *ListLabelingJobsForWorkteamInput { - s.SortOrder = &v - return s -} - -// SetWorkteamArn sets the WorkteamArn field's value. -func (s *ListLabelingJobsForWorkteamInput) SetWorkteamArn(v string) *ListLabelingJobsForWorkteamInput { - s.WorkteamArn = &v +// SetMaxRuntimeInSeconds sets the MaxRuntimeInSeconds field's value. +func (s *MonitoringStoppingCondition) SetMaxRuntimeInSeconds(v int64) *MonitoringStoppingCondition { + s.MaxRuntimeInSeconds = &v return s } -type ListLabelingJobsForWorkteamOutput struct { +// Defines a list of NestedFilters objects. To satisfy the conditions specified +// in the NestedFilters call, a resource must satisfy the conditions of all +// of the filters. +// +// For example, you could define a NestedFilters using the training job's InputDataConfig +// property to filter on Channel objects. +// +// A NestedFilters object contains multiple filters. For example, to find all +// training jobs whose name contains train and that have cat/data in their S3Uri +// (specified in InputDataConfig), you need to create a NestedFilters object +// that specifies the InputDataConfig property with the following Filter objects: +// +// * '{Name:"InputDataConfig.ChannelName", "Operator":"EQUALS", "Value":"train"}', +// +// * '{Name:"InputDataConfig.DataSource.S3DataSource.S3Uri", "Operator":"CONTAINS", +// "Value":"cat/data"}' +type NestedFilters struct { _ struct{} `type:"structure"` - // An array of LabelingJobSummary objects, each describing a labeling job. + // A list of filters. Each filter acts on a property. Filters must contain at + // least one Filters value. For example, a NestedFilters call might include + // a filter on the PropertyName parameter of the InputDataConfig property: InputDataConfig.DataSource.S3DataSource.S3Uri. // - // LabelingJobSummaryList is a required field - LabelingJobSummaryList []*LabelingJobForWorkteamSummary `type:"list" required:"true"` + // Filters is a required field + Filters []*Filter `min:"1" type:"list" required:"true"` - // If the response is truncated, Amazon SageMaker returns this token. To retrieve - // the next set of labeling jobs, use it in the subsequent request. - NextToken *string `type:"string"` + // The name of the property to use in the nested filters. The value must match + // a listed property name, such as InputDataConfig. + // + // NestedPropertyName is a required field + NestedPropertyName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s ListLabelingJobsForWorkteamOutput) String() string { +func (s NestedFilters) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListLabelingJobsForWorkteamOutput) GoString() string { +func (s NestedFilters) GoString() string { return s.String() } -// SetLabelingJobSummaryList sets the LabelingJobSummaryList field's value. -func (s *ListLabelingJobsForWorkteamOutput) SetLabelingJobSummaryList(v []*LabelingJobForWorkteamSummary) *ListLabelingJobsForWorkteamOutput { - s.LabelingJobSummaryList = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *NestedFilters) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "NestedFilters"} + if s.Filters == nil { + invalidParams.Add(request.NewErrParamRequired("Filters")) + } + if s.Filters != nil && len(s.Filters) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Filters", 1)) + } + if s.NestedPropertyName == nil { + invalidParams.Add(request.NewErrParamRequired("NestedPropertyName")) + } + if s.NestedPropertyName != nil && len(*s.NestedPropertyName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NestedPropertyName", 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 *NestedFilters) SetFilters(v []*Filter) *NestedFilters { + s.Filters = v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListLabelingJobsForWorkteamOutput) SetNextToken(v string) *ListLabelingJobsForWorkteamOutput { - s.NextToken = &v +// SetNestedPropertyName sets the NestedPropertyName field's value. +func (s *NestedFilters) SetNestedPropertyName(v string) *NestedFilters { + s.NestedPropertyName = &v return s } -type ListLabelingJobsInput struct { +// Networking options for a job, such as network traffic encryption between +// containers, whether to allow inbound and outbound network calls to and from +// containers, and the VPC subnets and security groups to use for VPC-enabled +// jobs. +type NetworkConfig struct { _ struct{} `type:"structure"` - // A filter that returns only labeling jobs created after the specified time - // (timestamp). - CreationTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only labeling jobs created before the specified time - // (timestamp). - CreationTimeBefore *time.Time `type:"timestamp"` - - // A filter that returns only labeling jobs modified after the specified time - // (timestamp). - LastModifiedTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only labeling jobs modified before the specified time - // (timestamp). - LastModifiedTimeBefore *time.Time `type:"timestamp"` - - // The maximum number of labeling jobs to return in each page of the response. - MaxResults *int64 `min:"1" type:"integer"` - - // A string in the labeling job name. This filter returns only labeling jobs - // whose name contains the specified string. - NameContains *string `type:"string"` - - // If the result of the previous ListLabelingJobs request was truncated, the - // response includes a NextToken. To retrieve the next set of labeling jobs, - // use the token in the next request. - NextToken *string `type:"string"` - - // The field to sort results by. The default is CreationTime. - SortBy *string `type:"string" enum:"SortBy"` - - // The sort order for results. The default is Ascending. - SortOrder *string `type:"string" enum:"SortOrder"` + // Whether to allow inbound and outbound network calls to and from the containers + // used for the processing job. + EnableNetworkIsolation *bool `type:"boolean"` - // A filter that retrieves only labeling jobs with a specific status. - StatusEquals *string `type:"string" enum:"LabelingJobStatus"` + // Specifies a VPC that your training jobs and hosted models have access to. + // Control access to and from your training and model containers by configuring + // the VPC. For more information, see Protect Endpoints by Using an Amazon Virtual + // Private Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/host-vpc.html) + // and Protect Training Jobs by Using an Amazon Virtual Private Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html). + VpcConfig *VpcConfig `type:"structure"` } // String returns the string representation -func (s ListLabelingJobsInput) String() string { +func (s NetworkConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListLabelingJobsInput) GoString() string { +func (s NetworkConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListLabelingJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListLabelingJobsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *NetworkConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "NetworkConfig"} + if s.VpcConfig != nil { + if err := s.VpcConfig.Validate(); err != nil { + invalidParams.AddNested("VpcConfig", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -18875,273 +37085,362 @@ func (s *ListLabelingJobsInput) Validate() error { return nil } -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListLabelingJobsInput) SetCreationTimeAfter(v time.Time) *ListLabelingJobsInput { - s.CreationTimeAfter = &v +// SetEnableNetworkIsolation sets the EnableNetworkIsolation field's value. +func (s *NetworkConfig) SetEnableNetworkIsolation(v bool) *NetworkConfig { + s.EnableNetworkIsolation = &v return s } -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListLabelingJobsInput) SetCreationTimeBefore(v time.Time) *ListLabelingJobsInput { - s.CreationTimeBefore = &v +// SetVpcConfig sets the VpcConfig field's value. +func (s *NetworkConfig) SetVpcConfig(v *VpcConfig) *NetworkConfig { + s.VpcConfig = v return s } -// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. -func (s *ListLabelingJobsInput) SetLastModifiedTimeAfter(v time.Time) *ListLabelingJobsInput { - s.LastModifiedTimeAfter = &v - return s -} +// Provides a summary of a notebook instance lifecycle configuration. +type NotebookInstanceLifecycleConfigSummary struct { + _ struct{} `type:"structure"` -// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. -func (s *ListLabelingJobsInput) SetLastModifiedTimeBefore(v time.Time) *ListLabelingJobsInput { - s.LastModifiedTimeBefore = &v - return s + // A timestamp that tells when the lifecycle configuration was created. + CreationTime *time.Time `type:"timestamp"` + + // A timestamp that tells when the lifecycle configuration was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of the lifecycle configuration. + // + // NotebookInstanceLifecycleConfigArn is a required field + NotebookInstanceLifecycleConfigArn *string `type:"string" required:"true"` + + // The name of the lifecycle configuration. + // + // NotebookInstanceLifecycleConfigName is a required field + NotebookInstanceLifecycleConfigName *string `type:"string" required:"true"` } -// SetMaxResults sets the MaxResults field's value. -func (s *ListLabelingJobsInput) SetMaxResults(v int64) *ListLabelingJobsInput { - s.MaxResults = &v - return s +// String returns the string representation +func (s NotebookInstanceLifecycleConfigSummary) String() string { + return awsutil.Prettify(s) } -// SetNameContains sets the NameContains field's value. -func (s *ListLabelingJobsInput) SetNameContains(v string) *ListLabelingJobsInput { - s.NameContains = &v - return s +// GoString returns the string representation +func (s NotebookInstanceLifecycleConfigSummary) GoString() string { + return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListLabelingJobsInput) SetNextToken(v string) *ListLabelingJobsInput { - s.NextToken = &v +// SetCreationTime sets the CreationTime field's value. +func (s *NotebookInstanceLifecycleConfigSummary) SetCreationTime(v time.Time) *NotebookInstanceLifecycleConfigSummary { + s.CreationTime = &v return s } -// SetSortBy sets the SortBy field's value. -func (s *ListLabelingJobsInput) SetSortBy(v string) *ListLabelingJobsInput { - s.SortBy = &v +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *NotebookInstanceLifecycleConfigSummary) SetLastModifiedTime(v time.Time) *NotebookInstanceLifecycleConfigSummary { + s.LastModifiedTime = &v return s } -// SetSortOrder sets the SortOrder field's value. -func (s *ListLabelingJobsInput) SetSortOrder(v string) *ListLabelingJobsInput { - s.SortOrder = &v +// SetNotebookInstanceLifecycleConfigArn sets the NotebookInstanceLifecycleConfigArn field's value. +func (s *NotebookInstanceLifecycleConfigSummary) SetNotebookInstanceLifecycleConfigArn(v string) *NotebookInstanceLifecycleConfigSummary { + s.NotebookInstanceLifecycleConfigArn = &v return s } -// SetStatusEquals sets the StatusEquals field's value. -func (s *ListLabelingJobsInput) SetStatusEquals(v string) *ListLabelingJobsInput { - s.StatusEquals = &v +// SetNotebookInstanceLifecycleConfigName sets the NotebookInstanceLifecycleConfigName field's value. +func (s *NotebookInstanceLifecycleConfigSummary) SetNotebookInstanceLifecycleConfigName(v string) *NotebookInstanceLifecycleConfigSummary { + s.NotebookInstanceLifecycleConfigName = &v return s } -type ListLabelingJobsOutput struct { +// Contains the notebook instance lifecycle configuration script. +// +// Each lifecycle configuration script has a limit of 16384 characters. +// +// The value of the $PATH environment variable that is available to both scripts +// is /sbin:bin:/usr/sbin:/usr/bin. +// +// View CloudWatch Logs for notebook instance lifecycle configurations in log +// group /aws/sagemaker/NotebookInstances in log stream [notebook-instance-name]/[LifecycleConfigHook]. +// +// Lifecycle configuration scripts cannot run for longer than 5 minutes. If +// a script runs for longer than 5 minutes, it fails and the notebook instance +// is not created or started. +// +// For information about notebook instance lifestyle configurations, see Step +// 2.1: (Optional) Customize a Notebook Instance (https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html). +type NotebookInstanceLifecycleHook struct { _ struct{} `type:"structure"` - // An array of LabelingJobSummary objects, each describing a labeling job. - LabelingJobSummaryList []*LabelingJobSummary `type:"list"` - - // If the response is truncated, Amazon SageMaker returns this token. To retrieve - // the next set of labeling jobs, use it in the subsequent request. - NextToken *string `type:"string"` + // A base64-encoded string that contains a shell script for a notebook instance + // lifecycle configuration. + Content *string `min:"1" type:"string"` } // String returns the string representation -func (s ListLabelingJobsOutput) String() string { +func (s NotebookInstanceLifecycleHook) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListLabelingJobsOutput) GoString() string { +func (s NotebookInstanceLifecycleHook) GoString() string { return s.String() } -// SetLabelingJobSummaryList sets the LabelingJobSummaryList field's value. -func (s *ListLabelingJobsOutput) SetLabelingJobSummaryList(v []*LabelingJobSummary) *ListLabelingJobsOutput { - s.LabelingJobSummaryList = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *NotebookInstanceLifecycleHook) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "NotebookInstanceLifecycleHook"} + if s.Content != nil && len(*s.Content) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Content", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetNextToken sets the NextToken field's value. -func (s *ListLabelingJobsOutput) SetNextToken(v string) *ListLabelingJobsOutput { - s.NextToken = &v +// SetContent sets the Content field's value. +func (s *NotebookInstanceLifecycleHook) SetContent(v string) *NotebookInstanceLifecycleHook { + s.Content = &v return s } -type ListModelPackagesInput struct { +// Provides summary information for an Amazon SageMaker notebook instance. +type NotebookInstanceSummary struct { _ struct{} `type:"structure"` - // A filter that returns only model packages created after the specified time - // (timestamp). - CreationTimeAfter *time.Time `type:"timestamp"` + // An array of up to three Git repositories associated with the notebook instance. + // These can be either the names of Git repositories stored as resources in + // your account, or the URL of Git repositories in AWS CodeCommit (https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html) + // or in any other Git repository. These repositories are cloned at the same + // level as the default repository of your notebook instance. For more information, + // see Associating Git Repositories with Amazon SageMaker Notebook Instances + // (https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html). + AdditionalCodeRepositories []*string `type:"list"` - // A filter that returns only model packages created before the specified time - // (timestamp). - CreationTimeBefore *time.Time `type:"timestamp"` + // A timestamp that shows when the notebook instance was created. + CreationTime *time.Time `type:"timestamp"` - // The maximum number of model packages to return in the response. - MaxResults *int64 `min:"1" type:"integer"` + // The Git repository associated with the notebook instance as its default code + // repository. This can be either the name of a Git repository stored as a resource + // in your account, or the URL of a Git repository in AWS CodeCommit (https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html) + // or in any other Git repository. When you open a notebook instance, it opens + // in the directory that contains this repository. For more information, see + // Associating Git Repositories with Amazon SageMaker Notebook Instances (https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html). + DefaultCodeRepository *string `min:"1" type:"string"` - // A string in the model package name. This filter returns only model packages - // whose name contains the specified string. - NameContains *string `type:"string"` + // The type of ML compute instance that the notebook instance is running on. + InstanceType *string `type:"string" enum:"InstanceType"` - // If the response to a previous ListModelPackages request was truncated, the - // response includes a NextToken. To retrieve the next set of model packages, - // use the token in the next request. - NextToken *string `type:"string"` + // A timestamp that shows when the notebook instance was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of the notebook instance. + // + // NotebookInstanceArn is a required field + NotebookInstanceArn *string `type:"string" required:"true"` + + // The name of a notebook instance lifecycle configuration associated with this + // notebook instance. + // + // For information about notebook instance lifestyle configurations, see Step + // 2.1: (Optional) Customize a Notebook Instance (https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html). + NotebookInstanceLifecycleConfigName *string `type:"string"` + + // The name of the notebook instance that you want a summary for. + // + // NotebookInstanceName is a required field + NotebookInstanceName *string `type:"string" required:"true"` - // The parameter by which to sort the results. The default is CreationTime. - SortBy *string `type:"string" enum:"ModelPackageSortBy"` + // The status of the notebook instance. + NotebookInstanceStatus *string `type:"string" enum:"NotebookInstanceStatus"` - // The sort order for the results. The default is Ascending. - SortOrder *string `type:"string" enum:"SortOrder"` + // The URL that you use to connect to the Jupyter instance running in your notebook + // instance. + Url *string `type:"string"` } // String returns the string representation -func (s ListModelPackagesInput) String() string { +func (s NotebookInstanceSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListModelPackagesInput) GoString() string { +func (s NotebookInstanceSummary) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListModelPackagesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListModelPackagesInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } +// SetAdditionalCodeRepositories sets the AdditionalCodeRepositories field's value. +func (s *NotebookInstanceSummary) SetAdditionalCodeRepositories(v []*string) *NotebookInstanceSummary { + s.AdditionalCodeRepositories = v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCreationTime sets the CreationTime field's value. +func (s *NotebookInstanceSummary) SetCreationTime(v time.Time) *NotebookInstanceSummary { + s.CreationTime = &v + return s } -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListModelPackagesInput) SetCreationTimeAfter(v time.Time) *ListModelPackagesInput { - s.CreationTimeAfter = &v +// SetDefaultCodeRepository sets the DefaultCodeRepository field's value. +func (s *NotebookInstanceSummary) SetDefaultCodeRepository(v string) *NotebookInstanceSummary { + s.DefaultCodeRepository = &v return s } -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListModelPackagesInput) SetCreationTimeBefore(v time.Time) *ListModelPackagesInput { - s.CreationTimeBefore = &v +// SetInstanceType sets the InstanceType field's value. +func (s *NotebookInstanceSummary) SetInstanceType(v string) *NotebookInstanceSummary { + s.InstanceType = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListModelPackagesInput) SetMaxResults(v int64) *ListModelPackagesInput { - s.MaxResults = &v +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *NotebookInstanceSummary) SetLastModifiedTime(v time.Time) *NotebookInstanceSummary { + s.LastModifiedTime = &v return s } -// SetNameContains sets the NameContains field's value. -func (s *ListModelPackagesInput) SetNameContains(v string) *ListModelPackagesInput { - s.NameContains = &v +// SetNotebookInstanceArn sets the NotebookInstanceArn field's value. +func (s *NotebookInstanceSummary) SetNotebookInstanceArn(v string) *NotebookInstanceSummary { + s.NotebookInstanceArn = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListModelPackagesInput) SetNextToken(v string) *ListModelPackagesInput { - s.NextToken = &v +// SetNotebookInstanceLifecycleConfigName sets the NotebookInstanceLifecycleConfigName field's value. +func (s *NotebookInstanceSummary) SetNotebookInstanceLifecycleConfigName(v string) *NotebookInstanceSummary { + s.NotebookInstanceLifecycleConfigName = &v return s } -// SetSortBy sets the SortBy field's value. -func (s *ListModelPackagesInput) SetSortBy(v string) *ListModelPackagesInput { - s.SortBy = &v +// SetNotebookInstanceName sets the NotebookInstanceName field's value. +func (s *NotebookInstanceSummary) SetNotebookInstanceName(v string) *NotebookInstanceSummary { + s.NotebookInstanceName = &v return s } -// SetSortOrder sets the SortOrder field's value. -func (s *ListModelPackagesInput) SetSortOrder(v string) *ListModelPackagesInput { - s.SortOrder = &v +// SetNotebookInstanceStatus sets the NotebookInstanceStatus field's value. +func (s *NotebookInstanceSummary) SetNotebookInstanceStatus(v string) *NotebookInstanceSummary { + s.NotebookInstanceStatus = &v return s } -type ListModelPackagesOutput struct { - _ struct{} `type:"structure"` +// SetUrl sets the Url field's value. +func (s *NotebookInstanceSummary) SetUrl(v string) *NotebookInstanceSummary { + s.Url = &v + return s +} - // An array of ModelPackageSummary objects, each of which lists a model package. - // - // ModelPackageSummaryList is a required field - ModelPackageSummaryList []*ModelPackageSummary `type:"list" required:"true"` +// Configures SNS notifications of available or expiring work items for work +// teams. +type NotificationConfiguration struct { + _ struct{} `type:"structure"` - // If the response is truncated, Amazon SageMaker returns this token. To retrieve - // the next set of model packages, use it in the subsequent request. - NextToken *string `type:"string"` + // The ARN for the SNS topic to which notifications should be published. + NotificationTopicArn *string `type:"string"` } // String returns the string representation -func (s ListModelPackagesOutput) String() string { +func (s NotificationConfiguration) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListModelPackagesOutput) GoString() string { +func (s NotificationConfiguration) GoString() string { return s.String() } -// SetModelPackageSummaryList sets the ModelPackageSummaryList field's value. -func (s *ListModelPackagesOutput) SetModelPackageSummaryList(v []*ModelPackageSummary) *ListModelPackagesOutput { - s.ModelPackageSummaryList = v +// SetNotificationTopicArn sets the NotificationTopicArn field's value. +func (s *NotificationConfiguration) SetNotificationTopicArn(v string) *NotificationConfiguration { + s.NotificationTopicArn = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListModelPackagesOutput) SetNextToken(v string) *ListModelPackagesOutput { - s.NextToken = &v - return s +// Specifies the number of training jobs that this hyperparameter tuning job +// launched, categorized by the status of their objective metric. The objective +// metric status shows whether the final objective metric for the training job +// has been evaluated by the tuning job and used in the hyperparameter tuning +// process. +type ObjectiveStatusCounters struct { + _ struct{} `type:"structure"` + + // The number of training jobs whose final objective metric was not evaluated + // and used in the hyperparameter tuning process. This typically occurs when + // the training job failed or did not emit an objective metric. + Failed *int64 `type:"integer"` + + // The number of training jobs that are in progress and pending evaluation of + // their final objective metric. + Pending *int64 `type:"integer"` + + // The number of training jobs whose final objective metric was evaluated by + // the hyperparameter tuning job and used in the hyperparameter tuning process. + Succeeded *int64 `type:"integer"` } -type ListModelsInput struct { - _ struct{} `type:"structure"` +// String returns the string representation +func (s ObjectiveStatusCounters) String() string { + return awsutil.Prettify(s) +} - // A filter that returns only models with a creation time greater than or equal - // to the specified time (timestamp). - CreationTimeAfter *time.Time `type:"timestamp"` +// GoString returns the string representation +func (s ObjectiveStatusCounters) GoString() string { + return s.String() +} - // A filter that returns only models created before the specified time (timestamp). - CreationTimeBefore *time.Time `type:"timestamp"` +// SetFailed sets the Failed field's value. +func (s *ObjectiveStatusCounters) SetFailed(v int64) *ObjectiveStatusCounters { + s.Failed = &v + return s +} - // The maximum number of models to return in the response. - MaxResults *int64 `min:"1" type:"integer"` +// SetPending sets the Pending field's value. +func (s *ObjectiveStatusCounters) SetPending(v int64) *ObjectiveStatusCounters { + s.Pending = &v + return s +} - // A string in the training job name. This filter returns only models in the - // training job whose name contains the specified string. - NameContains *string `type:"string"` +// SetSucceeded sets the Succeeded field's value. +func (s *ObjectiveStatusCounters) SetSucceeded(v int64) *ObjectiveStatusCounters { + s.Succeeded = &v + return s +} - // If the response to a previous ListModels request was truncated, the response - // includes a NextToken. To retrieve the next set of models, use the token in - // the next request. - NextToken *string `type:"string"` +// Contains information about the output location for the compiled model and +// the device (target) that the model runs on. +type OutputConfig struct { + _ struct{} `type:"structure"` - // Sorts the list of results. The default is CreationTime. - SortBy *string `type:"string" enum:"ModelSortKey"` + // Identifies the S3 path where you want Amazon SageMaker to store the model + // artifacts. For example, s3://bucket-name/key-name-prefix. + // + // S3OutputLocation is a required field + S3OutputLocation *string `type:"string" required:"true"` - // The sort order for results. The default is Descending. - SortOrder *string `type:"string" enum:"OrderKey"` + // Identifies the device that you want to run your model on after it has been + // compiled. For example: ml_c5. + // + // TargetDevice is a required field + TargetDevice *string `type:"string" required:"true" enum:"TargetDevice"` } // String returns the string representation -func (s ListModelsInput) String() string { +func (s OutputConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListModelsInput) GoString() string { +func (s OutputConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListModelsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListModelsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *OutputConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "OutputConfig"} + if s.S3OutputLocation == nil { + invalidParams.Add(request.NewErrParamRequired("S3OutputLocation")) + } + if s.TargetDevice == nil { + invalidParams.Add(request.NewErrParamRequired("TargetDevice")) } if invalidParams.Len() > 0 { @@ -19150,136 +37449,231 @@ func (s *ListModelsInput) Validate() error { return nil } -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListModelsInput) SetCreationTimeAfter(v time.Time) *ListModelsInput { - s.CreationTimeAfter = &v +// SetS3OutputLocation sets the S3OutputLocation field's value. +func (s *OutputConfig) SetS3OutputLocation(v string) *OutputConfig { + s.S3OutputLocation = &v return s } -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListModelsInput) SetCreationTimeBefore(v time.Time) *ListModelsInput { - s.CreationTimeBefore = &v +// SetTargetDevice sets the TargetDevice field's value. +func (s *OutputConfig) SetTargetDevice(v string) *OutputConfig { + s.TargetDevice = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListModelsInput) SetMaxResults(v int64) *ListModelsInput { - s.MaxResults = &v - return s +// Provides information about how to store model training results (model artifacts). +type OutputDataConfig struct { + _ struct{} `type:"structure"` + + // The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to + // encrypt the model artifacts at rest using Amazon S3 server-side encryption. + // The KmsKeyId can be any of the following formats: + // + // * // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab" + // + // * // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + // + // * // KMS Key Alias "alias/ExampleAlias" + // + // * // Amazon Resource Name (ARN) of a KMS Key Alias "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias" + // + // If you use a KMS key ID or an alias of your master key, the Amazon SageMaker + // execution role must include permissions to call kms:Encrypt. If you don't + // provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon + // S3 for your role's account. Amazon SageMaker uses server-side encryption + // with KMS-managed keys for OutputDataConfig. If you use a bucket policy with + // an s3:PutObject permission that only allows objects with server-side encryption, + // set the condition key of s3:x-amz-server-side-encryption to "aws:kms". For + // more information, see KMS-Managed Encryption Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) + // in the Amazon Simple Storage Service Developer Guide. + // + // The KMS key policy must grant permission to the IAM role that you specify + // in your CreateTrainingJob, CreateTransformJob, or CreateHyperParameterTuningJob + // requests. For more information, see Using Key Policies in AWS KMS (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) + // in the AWS Key Management Service Developer Guide. + KmsKeyId *string `type:"string"` + + // Identifies the S3 path where you want Amazon SageMaker to store the model + // artifacts. For example, s3://bucket-name/key-name-prefix. + // + // S3OutputPath is a required field + S3OutputPath *string `type:"string" required:"true"` } -// SetNameContains sets the NameContains field's value. -func (s *ListModelsInput) SetNameContains(v string) *ListModelsInput { - s.NameContains = &v - return s +// String returns the string representation +func (s OutputDataConfig) String() string { + return awsutil.Prettify(s) } -// SetNextToken sets the NextToken field's value. -func (s *ListModelsInput) SetNextToken(v string) *ListModelsInput { - s.NextToken = &v - return s +// GoString returns the string representation +func (s OutputDataConfig) GoString() string { + return s.String() } -// SetSortBy sets the SortBy field's value. -func (s *ListModelsInput) SetSortBy(v string) *ListModelsInput { - s.SortBy = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *OutputDataConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "OutputDataConfig"} + if s.S3OutputPath == nil { + invalidParams.Add(request.NewErrParamRequired("S3OutputPath")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *OutputDataConfig) SetKmsKeyId(v string) *OutputDataConfig { + s.KmsKeyId = &v return s } -// SetSortOrder sets the SortOrder field's value. -func (s *ListModelsInput) SetSortOrder(v string) *ListModelsInput { - s.SortOrder = &v +// SetS3OutputPath sets the S3OutputPath field's value. +func (s *OutputDataConfig) SetS3OutputPath(v string) *OutputDataConfig { + s.S3OutputPath = &v return s } -type ListModelsOutput struct { +// Defines the possible values for categorical, continuous, and integer hyperparameters +// to be used by an algorithm. +type ParameterRange struct { _ struct{} `type:"structure"` - // An array of ModelSummary objects, each of which lists a model. - // - // Models is a required field - Models []*ModelSummary `type:"list" required:"true"` + // A CategoricalParameterRangeSpecification object that defines the possible + // values for a categorical hyperparameter. + CategoricalParameterRangeSpecification *CategoricalParameterRangeSpecification `type:"structure"` - // If the response is truncated, Amazon SageMaker returns this token. To retrieve - // the next set of models, use it in the subsequent request. - NextToken *string `type:"string"` + // A ContinuousParameterRangeSpecification object that defines the possible + // values for a continuous hyperparameter. + ContinuousParameterRangeSpecification *ContinuousParameterRangeSpecification `type:"structure"` + + // A IntegerParameterRangeSpecification object that defines the possible values + // for an integer hyperparameter. + IntegerParameterRangeSpecification *IntegerParameterRangeSpecification `type:"structure"` } // String returns the string representation -func (s ListModelsOutput) String() string { +func (s ParameterRange) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListModelsOutput) GoString() string { +func (s ParameterRange) GoString() string { return s.String() } -// SetModels sets the Models field's value. -func (s *ListModelsOutput) SetModels(v []*ModelSummary) *ListModelsOutput { - s.Models = v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ParameterRange) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ParameterRange"} + if s.CategoricalParameterRangeSpecification != nil { + if err := s.CategoricalParameterRangeSpecification.Validate(); err != nil { + invalidParams.AddNested("CategoricalParameterRangeSpecification", err.(request.ErrInvalidParams)) + } + } + if s.ContinuousParameterRangeSpecification != nil { + if err := s.ContinuousParameterRangeSpecification.Validate(); err != nil { + invalidParams.AddNested("ContinuousParameterRangeSpecification", err.(request.ErrInvalidParams)) + } + } + if s.IntegerParameterRangeSpecification != nil { + if err := s.IntegerParameterRangeSpecification.Validate(); err != nil { + invalidParams.AddNested("IntegerParameterRangeSpecification", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetNextToken sets the NextToken field's value. -func (s *ListModelsOutput) SetNextToken(v string) *ListModelsOutput { - s.NextToken = &v +// SetCategoricalParameterRangeSpecification sets the CategoricalParameterRangeSpecification field's value. +func (s *ParameterRange) SetCategoricalParameterRangeSpecification(v *CategoricalParameterRangeSpecification) *ParameterRange { + s.CategoricalParameterRangeSpecification = v return s } -type ListNotebookInstanceLifecycleConfigsInput struct { - _ struct{} `type:"structure"` - - // A filter that returns only lifecycle configurations that were created after - // the specified time (timestamp). - CreationTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only lifecycle configurations that were created before - // the specified time (timestamp). - CreationTimeBefore *time.Time `type:"timestamp"` - - // A filter that returns only lifecycle configurations that were modified after - // the specified time (timestamp). - LastModifiedTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only lifecycle configurations that were modified before - // the specified time (timestamp). - LastModifiedTimeBefore *time.Time `type:"timestamp"` +// SetContinuousParameterRangeSpecification sets the ContinuousParameterRangeSpecification field's value. +func (s *ParameterRange) SetContinuousParameterRangeSpecification(v *ContinuousParameterRangeSpecification) *ParameterRange { + s.ContinuousParameterRangeSpecification = v + return s +} - // The maximum number of lifecycle configurations to return in the response. - MaxResults *int64 `min:"1" type:"integer"` +// SetIntegerParameterRangeSpecification sets the IntegerParameterRangeSpecification field's value. +func (s *ParameterRange) SetIntegerParameterRangeSpecification(v *IntegerParameterRangeSpecification) *ParameterRange { + s.IntegerParameterRangeSpecification = v + return s +} - // A string in the lifecycle configuration name. This filter returns only lifecycle - // configurations whose name contains the specified string. - NameContains *string `type:"string"` +// Specifies ranges of integer, continuous, and categorical hyperparameters +// that a hyperparameter tuning job searches. The hyperparameter tuning job +// launches training jobs with hyperparameter values within these ranges to +// find the combination of values that result in the training job with the best +// performance as measured by the objective metric of the hyperparameter tuning +// job. +// +// You can specify a maximum of 20 hyperparameters that a hyperparameter tuning +// job can search over. Every possible value of a categorical parameter range +// counts against this limit. +type ParameterRanges struct { + _ struct{} `type:"structure"` - // If the result of a ListNotebookInstanceLifecycleConfigs request was truncated, - // the response includes a NextToken. To get the next set of lifecycle configurations, - // use the token in the next request. - NextToken *string `type:"string"` + // The array of CategoricalParameterRange objects that specify ranges of categorical + // hyperparameters that a hyperparameter tuning job searches. + CategoricalParameterRanges []*CategoricalParameterRange `type:"list"` - // Sorts the list of results. The default is CreationTime. - SortBy *string `type:"string" enum:"NotebookInstanceLifecycleConfigSortKey"` + // The array of ContinuousParameterRange objects that specify ranges of continuous + // hyperparameters that a hyperparameter tuning job searches. + ContinuousParameterRanges []*ContinuousParameterRange `type:"list"` - // The sort order for results. - SortOrder *string `type:"string" enum:"NotebookInstanceLifecycleConfigSortOrder"` + // The array of IntegerParameterRange objects that specify ranges of integer + // hyperparameters that a hyperparameter tuning job searches. + IntegerParameterRanges []*IntegerParameterRange `type:"list"` } // String returns the string representation -func (s ListNotebookInstanceLifecycleConfigsInput) String() string { +func (s ParameterRanges) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListNotebookInstanceLifecycleConfigsInput) GoString() string { +func (s ParameterRanges) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListNotebookInstanceLifecycleConfigsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListNotebookInstanceLifecycleConfigsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *ParameterRanges) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ParameterRanges"} + if s.CategoricalParameterRanges != nil { + for i, v := range s.CategoricalParameterRanges { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CategoricalParameterRanges", i), err.(request.ErrInvalidParams)) + } + } + } + if s.ContinuousParameterRanges != nil { + for i, v := range s.ContinuousParameterRanges { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ContinuousParameterRanges", i), err.(request.ErrInvalidParams)) + } + } + } + if s.IntegerParameterRanges != nil { + for i, v := range s.IntegerParameterRanges { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "IntegerParameterRanges", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -19288,172 +37682,222 @@ func (s *ListNotebookInstanceLifecycleConfigsInput) Validate() error { return nil } -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListNotebookInstanceLifecycleConfigsInput) SetCreationTimeAfter(v time.Time) *ListNotebookInstanceLifecycleConfigsInput { - s.CreationTimeAfter = &v +// SetCategoricalParameterRanges sets the CategoricalParameterRanges field's value. +func (s *ParameterRanges) SetCategoricalParameterRanges(v []*CategoricalParameterRange) *ParameterRanges { + s.CategoricalParameterRanges = v return s } -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListNotebookInstanceLifecycleConfigsInput) SetCreationTimeBefore(v time.Time) *ListNotebookInstanceLifecycleConfigsInput { - s.CreationTimeBefore = &v +// SetContinuousParameterRanges sets the ContinuousParameterRanges field's value. +func (s *ParameterRanges) SetContinuousParameterRanges(v []*ContinuousParameterRange) *ParameterRanges { + s.ContinuousParameterRanges = v return s } -// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. -func (s *ListNotebookInstanceLifecycleConfigsInput) SetLastModifiedTimeAfter(v time.Time) *ListNotebookInstanceLifecycleConfigsInput { - s.LastModifiedTimeAfter = &v +// SetIntegerParameterRanges sets the IntegerParameterRanges field's value. +func (s *ParameterRanges) SetIntegerParameterRanges(v []*IntegerParameterRange) *ParameterRanges { + s.IntegerParameterRanges = v return s } -// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. -func (s *ListNotebookInstanceLifecycleConfigsInput) SetLastModifiedTimeBefore(v time.Time) *ListNotebookInstanceLifecycleConfigsInput { - s.LastModifiedTimeBefore = &v - return s -} +// The trial that a trial component is associated with and the experiment the +// trial is part of. A component might not be associated with a trial. A component +// can be associated with multiple trials. +type Parent struct { + _ struct{} `type:"structure"` -// SetMaxResults sets the MaxResults field's value. -func (s *ListNotebookInstanceLifecycleConfigsInput) SetMaxResults(v int64) *ListNotebookInstanceLifecycleConfigsInput { - s.MaxResults = &v - return s + // The name of the experiment. + ExperimentName *string `min:"1" type:"string"` + + // The name of the trial. + TrialName *string `min:"1" type:"string"` } -// SetNameContains sets the NameContains field's value. -func (s *ListNotebookInstanceLifecycleConfigsInput) SetNameContains(v string) *ListNotebookInstanceLifecycleConfigsInput { - s.NameContains = &v - return s +// String returns the string representation +func (s Parent) String() string { + return awsutil.Prettify(s) } -// SetNextToken sets the NextToken field's value. -func (s *ListNotebookInstanceLifecycleConfigsInput) SetNextToken(v string) *ListNotebookInstanceLifecycleConfigsInput { - s.NextToken = &v - return s +// GoString returns the string representation +func (s Parent) GoString() string { + return s.String() } -// SetSortBy sets the SortBy field's value. -func (s *ListNotebookInstanceLifecycleConfigsInput) SetSortBy(v string) *ListNotebookInstanceLifecycleConfigsInput { - s.SortBy = &v +// SetExperimentName sets the ExperimentName field's value. +func (s *Parent) SetExperimentName(v string) *Parent { + s.ExperimentName = &v return s } -// SetSortOrder sets the SortOrder field's value. -func (s *ListNotebookInstanceLifecycleConfigsInput) SetSortOrder(v string) *ListNotebookInstanceLifecycleConfigsInput { - s.SortOrder = &v +// SetTrialName sets the TrialName field's value. +func (s *Parent) SetTrialName(v string) *Parent { + s.TrialName = &v return s } -type ListNotebookInstanceLifecycleConfigsOutput struct { +// A previously completed or stopped hyperparameter tuning job to be used as +// a starting point for a new hyperparameter tuning job. +type ParentHyperParameterTuningJob struct { _ struct{} `type:"structure"` - // If the response is truncated, Amazon SageMaker returns this token. To get - // the next set of lifecycle configurations, use it in the next request. - NextToken *string `type:"string"` - - // An array of NotebookInstanceLifecycleConfiguration objects, each listing - // a lifecycle configuration. - NotebookInstanceLifecycleConfigs []*NotebookInstanceLifecycleConfigSummary `type:"list"` + // The name of the hyperparameter tuning job to be used as a starting point + // for a new hyperparameter tuning job. + HyperParameterTuningJobName *string `min:"1" type:"string"` } // String returns the string representation -func (s ListNotebookInstanceLifecycleConfigsOutput) String() string { +func (s ParentHyperParameterTuningJob) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListNotebookInstanceLifecycleConfigsOutput) GoString() string { +func (s ParentHyperParameterTuningJob) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListNotebookInstanceLifecycleConfigsOutput) SetNextToken(v string) *ListNotebookInstanceLifecycleConfigsOutput { - s.NextToken = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ParentHyperParameterTuningJob) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ParentHyperParameterTuningJob"} + if s.HyperParameterTuningJobName != nil && len(*s.HyperParameterTuningJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("HyperParameterTuningJobName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetNotebookInstanceLifecycleConfigs sets the NotebookInstanceLifecycleConfigs field's value. -func (s *ListNotebookInstanceLifecycleConfigsOutput) SetNotebookInstanceLifecycleConfigs(v []*NotebookInstanceLifecycleConfigSummary) *ListNotebookInstanceLifecycleConfigsOutput { - s.NotebookInstanceLifecycleConfigs = v +// SetHyperParameterTuningJobName sets the HyperParameterTuningJobName field's value. +func (s *ParentHyperParameterTuningJob) SetHyperParameterTuningJobName(v string) *ParentHyperParameterTuningJob { + s.HyperParameterTuningJobName = &v return s } -type ListNotebookInstancesInput struct { +// Configuration for the cluster used to run a processing job. +type ProcessingClusterConfig struct { _ struct{} `type:"structure"` - // A filter that returns only notebook instances with associated with the specified - // git repository. - AdditionalCodeRepositoryEquals *string `min:"1" type:"string"` + // The number of ML compute instances to use in the processing job. For distributed + // processing jobs, specify a value greater than 1. The default value is 1. + // + // InstanceCount is a required field + InstanceCount *int64 `min:"1" type:"integer" required:"true"` - // A filter that returns only notebook instances that were created after the - // specified time (timestamp). - CreationTimeAfter *time.Time `type:"timestamp"` + // The ML compute instance type for the processing job. + // + // InstanceType is a required field + InstanceType *string `type:"string" required:"true" enum:"ProcessingInstanceType"` - // A filter that returns only notebook instances that were created before the - // specified time (timestamp). - CreationTimeBefore *time.Time `type:"timestamp"` + // The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to + // encrypt data on the storage volume attached to the ML compute instance(s) + // that run the processing job. + VolumeKmsKeyId *string `type:"string"` - // A string in the name or URL of a Git repository associated with this notebook - // instance. This filter returns only notebook instances associated with a git - // repository with a name that contains the specified string. - DefaultCodeRepositoryContains *string `type:"string"` + // The size of the ML storage volume in gigabytes that you want to provision. + // You must specify sufficient ML storage for your scenario. + // + // VolumeSizeInGB is a required field + VolumeSizeInGB *int64 `min:"1" type:"integer" required:"true"` +} - // A filter that returns only notebook instances that were modified after the - // specified time (timestamp). - LastModifiedTimeAfter *time.Time `type:"timestamp"` +// String returns the string representation +func (s ProcessingClusterConfig) String() string { + return awsutil.Prettify(s) +} - // A filter that returns only notebook instances that were modified before the - // specified time (timestamp). - LastModifiedTimeBefore *time.Time `type:"timestamp"` +// GoString returns the string representation +func (s ProcessingClusterConfig) GoString() string { + return s.String() +} - // The maximum number of notebook instances to return. - MaxResults *int64 `min:"1" type:"integer"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *ProcessingClusterConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProcessingClusterConfig"} + if s.InstanceCount == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceCount")) + } + if s.InstanceCount != nil && *s.InstanceCount < 1 { + invalidParams.Add(request.NewErrParamMinValue("InstanceCount", 1)) + } + if s.InstanceType == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceType")) + } + if s.VolumeSizeInGB == nil { + invalidParams.Add(request.NewErrParamRequired("VolumeSizeInGB")) + } + if s.VolumeSizeInGB != nil && *s.VolumeSizeInGB < 1 { + invalidParams.Add(request.NewErrParamMinValue("VolumeSizeInGB", 1)) + } - // A string in the notebook instances' name. This filter returns only notebook - // instances whose name contains the specified string. - NameContains *string `type:"string"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // If the previous call to the ListNotebookInstances is truncated, the response - // includes a NextToken. You can use this token in your subsequent ListNotebookInstances - // request to fetch the next set of notebook instances. - // - // You might specify a filter or a sort order in your request. When response - // is truncated, you must use the same values for the filer and sort order in - // the next request. - NextToken *string `type:"string"` +// SetInstanceCount sets the InstanceCount field's value. +func (s *ProcessingClusterConfig) SetInstanceCount(v int64) *ProcessingClusterConfig { + s.InstanceCount = &v + return s +} - // A string in the name of a notebook instances lifecycle configuration associated - // with this notebook instance. This filter returns only notebook instances - // associated with a lifecycle configuration with a name that contains the specified - // string. - NotebookInstanceLifecycleConfigNameContains *string `type:"string"` +// SetInstanceType sets the InstanceType field's value. +func (s *ProcessingClusterConfig) SetInstanceType(v string) *ProcessingClusterConfig { + s.InstanceType = &v + return s +} - // The field to sort results by. The default is Name. - SortBy *string `type:"string" enum:"NotebookInstanceSortKey"` +// SetVolumeKmsKeyId sets the VolumeKmsKeyId field's value. +func (s *ProcessingClusterConfig) SetVolumeKmsKeyId(v string) *ProcessingClusterConfig { + s.VolumeKmsKeyId = &v + return s +} - // The sort order for results. - SortOrder *string `type:"string" enum:"NotebookInstanceSortOrder"` +// SetVolumeSizeInGB sets the VolumeSizeInGB field's value. +func (s *ProcessingClusterConfig) SetVolumeSizeInGB(v int64) *ProcessingClusterConfig { + s.VolumeSizeInGB = &v + return s +} - // A filter that returns only notebook instances with the specified status. - StatusEquals *string `type:"string" enum:"NotebookInstanceStatus"` +// The inputs for a processing job. +type ProcessingInput struct { + _ struct{} `type:"structure"` + + // The name of the inputs for the processing job. + // + // InputName is a required field + InputName *string `type:"string" required:"true"` + + // The S3 inputs for the processing job. + // + // S3Input is a required field + S3Input *ProcessingS3Input `type:"structure" required:"true"` } // String returns the string representation -func (s ListNotebookInstancesInput) String() string { +func (s ProcessingInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListNotebookInstancesInput) GoString() string { +func (s ProcessingInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListNotebookInstancesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListNotebookInstancesInput"} - if s.AdditionalCodeRepositoryEquals != nil && len(*s.AdditionalCodeRepositoryEquals) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AdditionalCodeRepositoryEquals", 1)) +func (s *ProcessingInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProcessingInput"} + if s.InputName == nil { + invalidParams.Add(request.NewErrParamRequired("InputName")) } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + if s.S3Input == nil { + invalidParams.Add(request.NewErrParamRequired("S3Input")) + } + if s.S3Input != nil { + if err := s.S3Input.Validate(); err != nil { + invalidParams.AddNested("S3Input", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -19462,152 +37906,214 @@ func (s *ListNotebookInstancesInput) Validate() error { return nil } -// SetAdditionalCodeRepositoryEquals sets the AdditionalCodeRepositoryEquals field's value. -func (s *ListNotebookInstancesInput) SetAdditionalCodeRepositoryEquals(v string) *ListNotebookInstancesInput { - s.AdditionalCodeRepositoryEquals = &v +// SetInputName sets the InputName field's value. +func (s *ProcessingInput) SetInputName(v string) *ProcessingInput { + s.InputName = &v return s } -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListNotebookInstancesInput) SetCreationTimeAfter(v time.Time) *ListNotebookInstancesInput { - s.CreationTimeAfter = &v +// SetS3Input sets the S3Input field's value. +func (s *ProcessingInput) SetS3Input(v *ProcessingS3Input) *ProcessingInput { + s.S3Input = v return s } -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListNotebookInstancesInput) SetCreationTimeBefore(v time.Time) *ListNotebookInstancesInput { - s.CreationTimeBefore = &v - return s +// Summary of information about a processing job. +type ProcessingJobSummary struct { + _ struct{} `type:"structure"` + + // The time at which the processing job was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // An optional string, up to one KB in size, that contains metadata from the + // processing container when the processing job exits. + ExitMessage *string `type:"string"` + + // A string, up to one KB in size, that contains the reason a processing job + // failed, if it failed. + FailureReason *string `type:"string"` + + // A timestamp that indicates the last time the processing job was modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The time at which the processing job completed. + ProcessingEndTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of the processing job.. + // + // ProcessingJobArn is a required field + ProcessingJobArn *string `type:"string" required:"true"` + + // The name of the processing job. + // + // ProcessingJobName is a required field + ProcessingJobName *string `min:"1" type:"string" required:"true"` + + // The status of the processing job. + // + // ProcessingJobStatus is a required field + ProcessingJobStatus *string `type:"string" required:"true" enum:"ProcessingJobStatus"` } -// SetDefaultCodeRepositoryContains sets the DefaultCodeRepositoryContains field's value. -func (s *ListNotebookInstancesInput) SetDefaultCodeRepositoryContains(v string) *ListNotebookInstancesInput { - s.DefaultCodeRepositoryContains = &v - return s +// String returns the string representation +func (s ProcessingJobSummary) String() string { + return awsutil.Prettify(s) } -// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. -func (s *ListNotebookInstancesInput) SetLastModifiedTimeAfter(v time.Time) *ListNotebookInstancesInput { - s.LastModifiedTimeAfter = &v - return s +// GoString returns the string representation +func (s ProcessingJobSummary) GoString() string { + return s.String() } -// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. -func (s *ListNotebookInstancesInput) SetLastModifiedTimeBefore(v time.Time) *ListNotebookInstancesInput { - s.LastModifiedTimeBefore = &v +// SetCreationTime sets the CreationTime field's value. +func (s *ProcessingJobSummary) SetCreationTime(v time.Time) *ProcessingJobSummary { + s.CreationTime = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListNotebookInstancesInput) SetMaxResults(v int64) *ListNotebookInstancesInput { - s.MaxResults = &v +// SetExitMessage sets the ExitMessage field's value. +func (s *ProcessingJobSummary) SetExitMessage(v string) *ProcessingJobSummary { + s.ExitMessage = &v return s } -// SetNameContains sets the NameContains field's value. -func (s *ListNotebookInstancesInput) SetNameContains(v string) *ListNotebookInstancesInput { - s.NameContains = &v +// SetFailureReason sets the FailureReason field's value. +func (s *ProcessingJobSummary) SetFailureReason(v string) *ProcessingJobSummary { + s.FailureReason = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListNotebookInstancesInput) SetNextToken(v string) *ListNotebookInstancesInput { - s.NextToken = &v +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *ProcessingJobSummary) SetLastModifiedTime(v time.Time) *ProcessingJobSummary { + s.LastModifiedTime = &v return s } -// SetNotebookInstanceLifecycleConfigNameContains sets the NotebookInstanceLifecycleConfigNameContains field's value. -func (s *ListNotebookInstancesInput) SetNotebookInstanceLifecycleConfigNameContains(v string) *ListNotebookInstancesInput { - s.NotebookInstanceLifecycleConfigNameContains = &v +// SetProcessingEndTime sets the ProcessingEndTime field's value. +func (s *ProcessingJobSummary) SetProcessingEndTime(v time.Time) *ProcessingJobSummary { + s.ProcessingEndTime = &v return s } -// SetSortBy sets the SortBy field's value. -func (s *ListNotebookInstancesInput) SetSortBy(v string) *ListNotebookInstancesInput { - s.SortBy = &v +// SetProcessingJobArn sets the ProcessingJobArn field's value. +func (s *ProcessingJobSummary) SetProcessingJobArn(v string) *ProcessingJobSummary { + s.ProcessingJobArn = &v return s } -// SetSortOrder sets the SortOrder field's value. -func (s *ListNotebookInstancesInput) SetSortOrder(v string) *ListNotebookInstancesInput { - s.SortOrder = &v +// SetProcessingJobName sets the ProcessingJobName field's value. +func (s *ProcessingJobSummary) SetProcessingJobName(v string) *ProcessingJobSummary { + s.ProcessingJobName = &v return s } -// SetStatusEquals sets the StatusEquals field's value. -func (s *ListNotebookInstancesInput) SetStatusEquals(v string) *ListNotebookInstancesInput { - s.StatusEquals = &v +// SetProcessingJobStatus sets the ProcessingJobStatus field's value. +func (s *ProcessingJobSummary) SetProcessingJobStatus(v string) *ProcessingJobSummary { + s.ProcessingJobStatus = &v return s } -type ListNotebookInstancesOutput struct { +// Describes the results of a processing job. +type ProcessingOutput struct { _ struct{} `type:"structure"` - // If the response to the previous ListNotebookInstances request was truncated, - // Amazon SageMaker returns this token. To retrieve the next set of notebook - // instances, use the token in the next request. - NextToken *string `type:"string"` + // The name for the processing job output. + // + // OutputName is a required field + OutputName *string `type:"string" required:"true"` - // An array of NotebookInstanceSummary objects, one for each notebook instance. - NotebookInstances []*NotebookInstanceSummary `type:"list"` + // Configuration for processing job outputs in Amazon S3. + // + // S3Output is a required field + S3Output *ProcessingS3Output `type:"structure" required:"true"` } // String returns the string representation -func (s ListNotebookInstancesOutput) String() string { +func (s ProcessingOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListNotebookInstancesOutput) GoString() string { +func (s ProcessingOutput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListNotebookInstancesOutput) SetNextToken(v string) *ListNotebookInstancesOutput { - s.NextToken = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *ProcessingOutput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProcessingOutput"} + if s.OutputName == nil { + invalidParams.Add(request.NewErrParamRequired("OutputName")) + } + if s.S3Output == nil { + invalidParams.Add(request.NewErrParamRequired("S3Output")) + } + if s.S3Output != nil { + if err := s.S3Output.Validate(); err != nil { + invalidParams.AddNested("S3Output", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOutputName sets the OutputName field's value. +func (s *ProcessingOutput) SetOutputName(v string) *ProcessingOutput { + s.OutputName = &v return s } -// SetNotebookInstances sets the NotebookInstances field's value. -func (s *ListNotebookInstancesOutput) SetNotebookInstances(v []*NotebookInstanceSummary) *ListNotebookInstancesOutput { - s.NotebookInstances = v +// SetS3Output sets the S3Output field's value. +func (s *ProcessingOutput) SetS3Output(v *ProcessingS3Output) *ProcessingOutput { + s.S3Output = v return s } -type ListSubscribedWorkteamsInput struct { +// The output configuration for the processing job. +type ProcessingOutputConfig struct { _ struct{} `type:"structure"` - // The maximum number of work teams to return in each page of the response. - MaxResults *int64 `min:"1" type:"integer"` - - // A string in the work team name. This filter returns only work teams whose - // name contains the specified string. - NameContains *string `min:"1" type:"string"` + // The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to + // encrypt the processing job output. KmsKeyId can be an ID of a KMS key, ARN + // of a KMS key, alias of a KMS key, or alias of a KMS key. The KmsKeyId is + // applied to all outputs. + KmsKeyId *string `type:"string"` - // If the result of the previous ListSubscribedWorkteams request was truncated, - // the response includes a NextToken. To retrieve the next set of labeling jobs, - // use the token in the next request. - NextToken *string `type:"string"` + // Output configuration information for a processing job. + // + // Outputs is a required field + Outputs []*ProcessingOutput `type:"list" required:"true"` } // String returns the string representation -func (s ListSubscribedWorkteamsInput) String() string { +func (s ProcessingOutputConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListSubscribedWorkteamsInput) GoString() string { +func (s ProcessingOutputConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListSubscribedWorkteamsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListSubscribedWorkteamsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *ProcessingOutputConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProcessingOutputConfig"} + if s.Outputs == nil { + invalidParams.Add(request.NewErrParamRequired("Outputs")) } - if s.NameContains != nil && len(*s.NameContains) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NameContains", 1)) + 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 invalidParams.Len() > 0 { @@ -19616,94 +38122,133 @@ func (s *ListSubscribedWorkteamsInput) Validate() error { return nil } -// SetMaxResults sets the MaxResults field's value. -func (s *ListSubscribedWorkteamsInput) SetMaxResults(v int64) *ListSubscribedWorkteamsInput { - s.MaxResults = &v - return s -} - -// SetNameContains sets the NameContains field's value. -func (s *ListSubscribedWorkteamsInput) SetNameContains(v string) *ListSubscribedWorkteamsInput { - s.NameContains = &v +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *ProcessingOutputConfig) SetKmsKeyId(v string) *ProcessingOutputConfig { + s.KmsKeyId = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListSubscribedWorkteamsInput) SetNextToken(v string) *ListSubscribedWorkteamsInput { - s.NextToken = &v +// SetOutputs sets the Outputs field's value. +func (s *ProcessingOutputConfig) SetOutputs(v []*ProcessingOutput) *ProcessingOutputConfig { + s.Outputs = v return s } -type ListSubscribedWorkteamsOutput struct { +// Identifies the resources, ML compute instances, and ML storage volumes to +// deploy for a processing job. In distributed training, you specify more than +// one instance. +type ProcessingResources struct { _ struct{} `type:"structure"` - // If the response is truncated, Amazon SageMaker returns this token. To retrieve - // the next set of work teams, use it in the subsequent request. - NextToken *string `type:"string"` - - // An array of Workteam objects, each describing a work team. + // The configuration for the resources in a cluster used to run the processing + // job. // - // SubscribedWorkteams is a required field - SubscribedWorkteams []*SubscribedWorkteam `type:"list" required:"true"` + // ClusterConfig is a required field + ClusterConfig *ProcessingClusterConfig `type:"structure" required:"true"` } // String returns the string representation -func (s ListSubscribedWorkteamsOutput) String() string { +func (s ProcessingResources) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListSubscribedWorkteamsOutput) GoString() string { +func (s ProcessingResources) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListSubscribedWorkteamsOutput) SetNextToken(v string) *ListSubscribedWorkteamsOutput { - s.NextToken = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ProcessingResources) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProcessingResources"} + if s.ClusterConfig == nil { + invalidParams.Add(request.NewErrParamRequired("ClusterConfig")) + } + if s.ClusterConfig != nil { + if err := s.ClusterConfig.Validate(); err != nil { + invalidParams.AddNested("ClusterConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetSubscribedWorkteams sets the SubscribedWorkteams field's value. -func (s *ListSubscribedWorkteamsOutput) SetSubscribedWorkteams(v []*SubscribedWorkteam) *ListSubscribedWorkteamsOutput { - s.SubscribedWorkteams = v +// SetClusterConfig sets the ClusterConfig field's value. +func (s *ProcessingResources) SetClusterConfig(v *ProcessingClusterConfig) *ProcessingResources { + s.ClusterConfig = v return s } -type ListTagsInput struct { +// Information about where and how you want to obtain the inputs for an processing +// job. +type ProcessingS3Input struct { _ struct{} `type:"structure"` - // Maximum number of tags to return. - MaxResults *int64 `min:"50" type:"integer"` + // The local path to the Amazon S3 bucket where you want Amazon SageMaker to + // download the inputs to run a processing job. LocalPath is an absolute path + // to the input data. + // + // LocalPath is a required field + LocalPath *string `type:"string" required:"true"` - // If the response to the previous ListTags request is truncated, Amazon SageMaker - // returns this token. To retrieve the next set of tags, use it in the subsequent - // request. - NextToken *string `type:"string"` + // Whether to use Gzip compresion for Amazon S3 storage. + S3CompressionType *string `type:"string" enum:"ProcessingS3CompressionType"` - // The Amazon Resource Name (ARN) of the resource whose tags you want to retrieve. + // Whether the data stored in Amazon S3 is FullyReplicated or ShardedByS3Key. + S3DataDistributionType *string `type:"string" enum:"ProcessingS3DataDistributionType"` + + // Whether you use an S3Prefix or a ManifestFile for the data type. If you choose + // S3Prefix, S3Uri identifies a key name prefix. Amazon SageMaker uses all objects + // with the specified key name prefix for the processing job. If you choose + // ManifestFile, S3Uri identifies an object that is a manifest file containing + // a list of object keys that you want Amazon SageMaker to use for the processing + // job. // - // ResourceArn is a required field - ResourceArn *string `type:"string" required:"true"` + // S3DataType is a required field + S3DataType *string `type:"string" required:"true" enum:"ProcessingS3DataType"` + + // Wether to use File or Pipe input mode. In File mode, Amazon SageMaker copies + // the data from the input source onto the local Amazon Elastic Block Store + // (Amazon EBS) volumes before starting your training algorithm. This is the + // most commonly used input mode. In Pipe mode, Amazon SageMaker streams input + // data from the source directly to your algorithm without using the EBS volume. + // + // S3InputMode is a required field + S3InputMode *string `type:"string" required:"true" enum:"ProcessingS3InputMode"` + + // The URI for the Amazon S3 storage where you want Amazon SageMaker to download + // the artifacts needed to run a processing job. + // + // S3Uri is a required field + S3Uri *string `type:"string" required:"true"` } // String returns the string representation -func (s ListTagsInput) String() string { +func (s ProcessingS3Input) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTagsInput) GoString() string { +func (s ProcessingS3Input) 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.MaxResults != nil && *s.MaxResults < 50 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 50)) +func (s *ProcessingS3Input) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProcessingS3Input"} + if s.LocalPath == nil { + invalidParams.Add(request.NewErrParamRequired("LocalPath")) } - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) + if s.S3DataType == nil { + invalidParams.Add(request.NewErrParamRequired("S3DataType")) + } + if s.S3InputMode == nil { + invalidParams.Add(request.NewErrParamRequired("S3InputMode")) + } + if s.S3Uri == nil { + invalidParams.Add(request.NewErrParamRequired("S3Uri")) } if invalidParams.Len() > 0 { @@ -19712,107 +38257,88 @@ func (s *ListTagsInput) Validate() error { return nil } -// SetMaxResults sets the MaxResults field's value. -func (s *ListTagsInput) SetMaxResults(v int64) *ListTagsInput { - s.MaxResults = &v +// SetLocalPath sets the LocalPath field's value. +func (s *ProcessingS3Input) SetLocalPath(v string) *ProcessingS3Input { + s.LocalPath = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListTagsInput) SetNextToken(v string) *ListTagsInput { - s.NextToken = &v +// SetS3CompressionType sets the S3CompressionType field's value. +func (s *ProcessingS3Input) SetS3CompressionType(v string) *ProcessingS3Input { + s.S3CompressionType = &v return s } -// SetResourceArn sets the ResourceArn field's value. -func (s *ListTagsInput) SetResourceArn(v string) *ListTagsInput { - s.ResourceArn = &v +// SetS3DataDistributionType sets the S3DataDistributionType field's value. +func (s *ProcessingS3Input) SetS3DataDistributionType(v string) *ProcessingS3Input { + s.S3DataDistributionType = &v return s } -type ListTagsOutput struct { - _ struct{} `type:"structure"` - - // If response is truncated, Amazon SageMaker includes a token in the response. - // You can use this token in your subsequent request to fetch next set of tokens. - NextToken *string `type:"string"` - - // An array of Tag objects, each with a tag key and a value. - Tags []*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() +// SetS3DataType sets the S3DataType field's value. +func (s *ProcessingS3Input) SetS3DataType(v string) *ProcessingS3Input { + s.S3DataType = &v + return s } -// SetNextToken sets the NextToken field's value. -func (s *ListTagsOutput) SetNextToken(v string) *ListTagsOutput { - s.NextToken = &v +// SetS3InputMode sets the S3InputMode field's value. +func (s *ProcessingS3Input) SetS3InputMode(v string) *ProcessingS3Input { + s.S3InputMode = &v return s } -// SetTags sets the Tags field's value. -func (s *ListTagsOutput) SetTags(v []*Tag) *ListTagsOutput { - s.Tags = v +// SetS3Uri sets the S3Uri field's value. +func (s *ProcessingS3Input) SetS3Uri(v string) *ProcessingS3Input { + s.S3Uri = &v return s } -type ListTrainingJobsForHyperParameterTuningJobInput struct { +// Information about where and how you want to store the results of an processing +// job. +type ProcessingS3Output struct { _ struct{} `type:"structure"` - // The name of the tuning job whose training jobs you want to list. + // The local path to the Amazon S3 bucket where you want Amazon SageMaker to + // save the results of an processing job. LocalPath is an absolute path to the + // input data. // - // HyperParameterTuningJobName is a required field - HyperParameterTuningJobName *string `min:"1" type:"string" required:"true"` - - // The maximum number of training jobs to return. The default value is 10. - MaxResults *int64 `min:"1" type:"integer"` - - // If the result of the previous ListTrainingJobsForHyperParameterTuningJob - // request was truncated, the response includes a NextToken. To retrieve the - // next set of training jobs, use the token in the next request. - NextToken *string `type:"string"` + // LocalPath is a required field + LocalPath *string `type:"string" required:"true"` - // The field to sort results by. The default is Name. + // Whether to upload the results of the processing job continuously or after + // the job completes. // - // If the value of this field is FinalObjectiveMetricValue, any training jobs - // that did not return an objective metric are not listed. - SortBy *string `type:"string" enum:"TrainingJobSortByOptions"` - - // The sort order for results. The default is Ascending. - SortOrder *string `type:"string" enum:"SortOrder"` + // S3UploadMode is a required field + S3UploadMode *string `type:"string" required:"true" enum:"ProcessingS3UploadMode"` - // A filter that returns only training jobs with the specified status. - StatusEquals *string `type:"string" enum:"TrainingJobStatus"` + // A URI that identifies the Amazon S3 bucket where you want Amazon SageMaker + // to save the results of a processing job. + // + // S3Uri is a required field + S3Uri *string `type:"string" required:"true"` } // String returns the string representation -func (s ListTrainingJobsForHyperParameterTuningJobInput) String() string { +func (s ProcessingS3Output) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTrainingJobsForHyperParameterTuningJobInput) GoString() string { +func (s ProcessingS3Output) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListTrainingJobsForHyperParameterTuningJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTrainingJobsForHyperParameterTuningJobInput"} - if s.HyperParameterTuningJobName == nil { - invalidParams.Add(request.NewErrParamRequired("HyperParameterTuningJobName")) +func (s *ProcessingS3Output) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProcessingS3Output"} + if s.LocalPath == nil { + invalidParams.Add(request.NewErrParamRequired("LocalPath")) } - if s.HyperParameterTuningJobName != nil && len(*s.HyperParameterTuningJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("HyperParameterTuningJobName", 1)) + if s.S3UploadMode == nil { + invalidParams.Add(request.NewErrParamRequired("S3UploadMode")) } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + if s.S3Uri == nil { + invalidParams.Add(request.NewErrParamRequired("S3Uri")) } if invalidParams.Len() > 0 { @@ -19821,135 +38347,132 @@ func (s *ListTrainingJobsForHyperParameterTuningJobInput) Validate() error { return nil } -// SetHyperParameterTuningJobName sets the HyperParameterTuningJobName field's value. -func (s *ListTrainingJobsForHyperParameterTuningJobInput) SetHyperParameterTuningJobName(v string) *ListTrainingJobsForHyperParameterTuningJobInput { - s.HyperParameterTuningJobName = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTrainingJobsForHyperParameterTuningJobInput) SetMaxResults(v int64) *ListTrainingJobsForHyperParameterTuningJobInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTrainingJobsForHyperParameterTuningJobInput) SetNextToken(v string) *ListTrainingJobsForHyperParameterTuningJobInput { - s.NextToken = &v - return s -} - -// SetSortBy sets the SortBy field's value. -func (s *ListTrainingJobsForHyperParameterTuningJobInput) SetSortBy(v string) *ListTrainingJobsForHyperParameterTuningJobInput { - s.SortBy = &v +// SetLocalPath sets the LocalPath field's value. +func (s *ProcessingS3Output) SetLocalPath(v string) *ProcessingS3Output { + s.LocalPath = &v return s } -// SetSortOrder sets the SortOrder field's value. -func (s *ListTrainingJobsForHyperParameterTuningJobInput) SetSortOrder(v string) *ListTrainingJobsForHyperParameterTuningJobInput { - s.SortOrder = &v +// SetS3UploadMode sets the S3UploadMode field's value. +func (s *ProcessingS3Output) SetS3UploadMode(v string) *ProcessingS3Output { + s.S3UploadMode = &v return s } -// SetStatusEquals sets the StatusEquals field's value. -func (s *ListTrainingJobsForHyperParameterTuningJobInput) SetStatusEquals(v string) *ListTrainingJobsForHyperParameterTuningJobInput { - s.StatusEquals = &v +// SetS3Uri sets the S3Uri field's value. +func (s *ProcessingS3Output) SetS3Uri(v string) *ProcessingS3Output { + s.S3Uri = &v return s } -type ListTrainingJobsForHyperParameterTuningJobOutput struct { +// Specifies a time limit for how long the processing job is allowed to run. +type ProcessingStoppingCondition struct { _ struct{} `type:"structure"` - // If the result of this ListTrainingJobsForHyperParameterTuningJob request - // was truncated, the response includes a NextToken. To retrieve the next set - // of training jobs, use the token in the next request. - NextToken *string `type:"string"` - - // A list of TrainingJobSummary objects that describe the training jobs that - // the ListTrainingJobsForHyperParameterTuningJob request returned. + // Specifies the maximum runtime in seconds. // - // TrainingJobSummaries is a required field - TrainingJobSummaries []*HyperParameterTrainingJobSummary `type:"list" required:"true"` + // MaxRuntimeInSeconds is a required field + MaxRuntimeInSeconds *int64 `min:"1" type:"integer" required:"true"` } // String returns the string representation -func (s ListTrainingJobsForHyperParameterTuningJobOutput) String() string { +func (s ProcessingStoppingCondition) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTrainingJobsForHyperParameterTuningJobOutput) GoString() string { +func (s ProcessingStoppingCondition) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListTrainingJobsForHyperParameterTuningJobOutput) SetNextToken(v string) *ListTrainingJobsForHyperParameterTuningJobOutput { - s.NextToken = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ProcessingStoppingCondition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProcessingStoppingCondition"} + if s.MaxRuntimeInSeconds == nil { + invalidParams.Add(request.NewErrParamRequired("MaxRuntimeInSeconds")) + } + if s.MaxRuntimeInSeconds != nil && *s.MaxRuntimeInSeconds < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxRuntimeInSeconds", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetTrainingJobSummaries sets the TrainingJobSummaries field's value. -func (s *ListTrainingJobsForHyperParameterTuningJobOutput) SetTrainingJobSummaries(v []*HyperParameterTrainingJobSummary) *ListTrainingJobsForHyperParameterTuningJobOutput { - s.TrainingJobSummaries = v +// SetMaxRuntimeInSeconds sets the MaxRuntimeInSeconds field's value. +func (s *ProcessingStoppingCondition) SetMaxRuntimeInSeconds(v int64) *ProcessingStoppingCondition { + s.MaxRuntimeInSeconds = &v return s } -type ListTrainingJobsInput struct { +// Identifies a model that you want to host and the resources to deploy for +// hosting it. If you are deploying multiple models, tell Amazon SageMaker how +// to distribute traffic among the models by specifying variant weights. +type ProductionVariant struct { _ struct{} `type:"structure"` - // A filter that returns only training jobs created after the specified time - // (timestamp). - CreationTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only training jobs created before the specified time - // (timestamp). - CreationTimeBefore *time.Time `type:"timestamp"` - - // A filter that returns only training jobs modified after the specified time - // (timestamp). - LastModifiedTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only training jobs modified before the specified time - // (timestamp). - LastModifiedTimeBefore *time.Time `type:"timestamp"` - - // The maximum number of training jobs to return in the response. - MaxResults *int64 `min:"1" type:"integer"` + // The size of the Elastic Inference (EI) instance to use for the production + // variant. EI instances provide on-demand GPU computing for inference. For + // more information, see Using Elastic Inference in Amazon SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html). + AcceleratorType *string `type:"string" enum:"ProductionVariantAcceleratorType"` - // A string in the training job name. This filter returns only training jobs - // whose name contains the specified string. - NameContains *string `type:"string"` + // Number of instances to launch initially. + // + // InitialInstanceCount is a required field + InitialInstanceCount *int64 `min:"1" type:"integer" required:"true"` - // If the result of the previous ListTrainingJobs request was truncated, the - // response includes a NextToken. To retrieve the next set of training jobs, - // use the token in the next request. - NextToken *string `type:"string"` + // Determines initial traffic distribution among all of the models that you + // specify in the endpoint configuration. The traffic to a production variant + // is determined by the ratio of the VariantWeight to the sum of all VariantWeight + // values across all ProductionVariants. If unspecified, it defaults to 1.0. + InitialVariantWeight *float64 `type:"float"` - // The field to sort results by. The default is CreationTime. - SortBy *string `type:"string" enum:"SortBy"` + // The ML compute instance type. + // + // InstanceType is a required field + InstanceType *string `type:"string" required:"true" enum:"ProductionVariantInstanceType"` - // The sort order for results. The default is Ascending. - SortOrder *string `type:"string" enum:"SortOrder"` + // The name of the model that you want to host. This is the name that you specified + // when creating the model. + // + // ModelName is a required field + ModelName *string `type:"string" required:"true"` - // A filter that retrieves only training jobs with a specific status. - StatusEquals *string `type:"string" enum:"TrainingJobStatus"` + // The name of the production variant. + // + // VariantName is a required field + VariantName *string `type:"string" required:"true"` } // String returns the string representation -func (s ListTrainingJobsInput) String() string { +func (s ProductionVariant) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTrainingJobsInput) GoString() string { +func (s ProductionVariant) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListTrainingJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTrainingJobsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *ProductionVariant) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ProductionVariant"} + if s.InitialInstanceCount == nil { + invalidParams.Add(request.NewErrParamRequired("InitialInstanceCount")) + } + if s.InitialInstanceCount != nil && *s.InitialInstanceCount < 1 { + invalidParams.Add(request.NewErrParamMinValue("InitialInstanceCount", 1)) + } + if s.InstanceType == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceType")) + } + if s.ModelName == nil { + invalidParams.Add(request.NewErrParamRequired("ModelName")) + } + if s.VariantName == nil { + invalidParams.Add(request.NewErrParamRequired("VariantName")) } if invalidParams.Len() > 0 { @@ -19958,154 +38481,145 @@ func (s *ListTrainingJobsInput) Validate() error { return nil } -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListTrainingJobsInput) SetCreationTimeAfter(v time.Time) *ListTrainingJobsInput { - s.CreationTimeAfter = &v +// SetAcceleratorType sets the AcceleratorType field's value. +func (s *ProductionVariant) SetAcceleratorType(v string) *ProductionVariant { + s.AcceleratorType = &v return s } -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListTrainingJobsInput) SetCreationTimeBefore(v time.Time) *ListTrainingJobsInput { - s.CreationTimeBefore = &v +// SetInitialInstanceCount sets the InitialInstanceCount field's value. +func (s *ProductionVariant) SetInitialInstanceCount(v int64) *ProductionVariant { + s.InitialInstanceCount = &v return s } -// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. -func (s *ListTrainingJobsInput) SetLastModifiedTimeAfter(v time.Time) *ListTrainingJobsInput { - s.LastModifiedTimeAfter = &v +// SetInitialVariantWeight sets the InitialVariantWeight field's value. +func (s *ProductionVariant) SetInitialVariantWeight(v float64) *ProductionVariant { + s.InitialVariantWeight = &v return s } -// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. -func (s *ListTrainingJobsInput) SetLastModifiedTimeBefore(v time.Time) *ListTrainingJobsInput { - s.LastModifiedTimeBefore = &v +// SetInstanceType sets the InstanceType field's value. +func (s *ProductionVariant) SetInstanceType(v string) *ProductionVariant { + s.InstanceType = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *ListTrainingJobsInput) SetMaxResults(v int64) *ListTrainingJobsInput { - s.MaxResults = &v +// SetModelName sets the ModelName field's value. +func (s *ProductionVariant) SetModelName(v string) *ProductionVariant { + s.ModelName = &v return s } -// SetNameContains sets the NameContains field's value. -func (s *ListTrainingJobsInput) SetNameContains(v string) *ListTrainingJobsInput { - s.NameContains = &v +// SetVariantName sets the VariantName field's value. +func (s *ProductionVariant) SetVariantName(v string) *ProductionVariant { + s.VariantName = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *ListTrainingJobsInput) SetNextToken(v string) *ListTrainingJobsInput { - s.NextToken = &v - return s -} +// Describes weight and capacities for a production variant associated with +// an endpoint. If you sent a request to the UpdateEndpointWeightsAndCapacities +// API and the endpoint status is Updating, you get different desired and current +// values. +type ProductionVariantSummary struct { + _ struct{} `type:"structure"` -// SetSortBy sets the SortBy field's value. -func (s *ListTrainingJobsInput) SetSortBy(v string) *ListTrainingJobsInput { - s.SortBy = &v - return s -} + // The number of instances associated with the variant. + CurrentInstanceCount *int64 `min:"1" type:"integer"` -// SetSortOrder sets the SortOrder field's value. -func (s *ListTrainingJobsInput) SetSortOrder(v string) *ListTrainingJobsInput { - s.SortOrder = &v - return s -} + // The weight associated with the variant. + CurrentWeight *float64 `type:"float"` -// SetStatusEquals sets the StatusEquals field's value. -func (s *ListTrainingJobsInput) SetStatusEquals(v string) *ListTrainingJobsInput { - s.StatusEquals = &v - return s -} + // An array of DeployedImage objects that specify the Amazon EC2 Container Registry + // paths of the inference images deployed on instances of this ProductionVariant. + DeployedImages []*DeployedImage `type:"list"` -type ListTrainingJobsOutput struct { - _ struct{} `type:"structure"` + // The number of instances requested in the UpdateEndpointWeightsAndCapacities + // request. + DesiredInstanceCount *int64 `min:"1" type:"integer"` - // If the response is truncated, Amazon SageMaker returns this token. To retrieve - // the next set of training jobs, use it in the subsequent request. - NextToken *string `type:"string"` + // The requested weight, as specified in the UpdateEndpointWeightsAndCapacities + // request. + DesiredWeight *float64 `type:"float"` - // An array of TrainingJobSummary objects, each listing a training job. + // The name of the variant. // - // TrainingJobSummaries is a required field - TrainingJobSummaries []*TrainingJobSummary `type:"list" required:"true"` + // VariantName is a required field + VariantName *string `type:"string" required:"true"` } // String returns the string representation -func (s ListTrainingJobsOutput) String() string { +func (s ProductionVariantSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTrainingJobsOutput) GoString() string { +func (s ProductionVariantSummary) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListTrainingJobsOutput) SetNextToken(v string) *ListTrainingJobsOutput { - s.NextToken = &v +// SetCurrentInstanceCount sets the CurrentInstanceCount field's value. +func (s *ProductionVariantSummary) SetCurrentInstanceCount(v int64) *ProductionVariantSummary { + s.CurrentInstanceCount = &v return s } -// SetTrainingJobSummaries sets the TrainingJobSummaries field's value. -func (s *ListTrainingJobsOutput) SetTrainingJobSummaries(v []*TrainingJobSummary) *ListTrainingJobsOutput { - s.TrainingJobSummaries = v +// SetCurrentWeight sets the CurrentWeight field's value. +func (s *ProductionVariantSummary) SetCurrentWeight(v float64) *ProductionVariantSummary { + s.CurrentWeight = &v return s } -type ListTransformJobsInput struct { - _ struct{} `type:"structure"` - - // A filter that returns only transform jobs created after the specified time. - CreationTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only transform jobs created before the specified time. - CreationTimeBefore *time.Time `type:"timestamp"` - - // A filter that returns only transform jobs modified after the specified time. - LastModifiedTimeAfter *time.Time `type:"timestamp"` - - // A filter that returns only transform jobs modified before the specified time. - LastModifiedTimeBefore *time.Time `type:"timestamp"` - - // The maximum number of transform jobs to return in the response. The default - // value is 10. - MaxResults *int64 `min:"1" type:"integer"` +// SetDeployedImages sets the DeployedImages field's value. +func (s *ProductionVariantSummary) SetDeployedImages(v []*DeployedImage) *ProductionVariantSummary { + s.DeployedImages = v + return s +} - // A string in the transform job name. This filter returns only transform jobs - // whose name contains the specified string. - NameContains *string `type:"string"` +// SetDesiredInstanceCount sets the DesiredInstanceCount field's value. +func (s *ProductionVariantSummary) SetDesiredInstanceCount(v int64) *ProductionVariantSummary { + s.DesiredInstanceCount = &v + return s +} - // If the result of the previous ListTransformJobs request was truncated, the - // response includes a NextToken. To retrieve the next set of transform jobs, - // use the token in the next request. - NextToken *string `type:"string"` +// SetDesiredWeight sets the DesiredWeight field's value. +func (s *ProductionVariantSummary) SetDesiredWeight(v float64) *ProductionVariantSummary { + s.DesiredWeight = &v + return s +} - // The field to sort results by. The default is CreationTime. - SortBy *string `type:"string" enum:"SortBy"` +// SetVariantName sets the VariantName field's value. +func (s *ProductionVariantSummary) SetVariantName(v string) *ProductionVariantSummary { + s.VariantName = &v + return s +} - // The sort order for results. The default is Descending. - SortOrder *string `type:"string" enum:"SortOrder"` +// Part of the SuggestionQuery type. Specifies a hint for retrieving property +// names that begin with the specified text. +type PropertyNameQuery struct { + _ struct{} `type:"structure"` - // A filter that retrieves only transform jobs with a specific status. - StatusEquals *string `type:"string" enum:"TransformJobStatus"` + // Text that begins a property's name. + // + // PropertyNameHint is a required field + PropertyNameHint *string `type:"string" required:"true"` } // String returns the string representation -func (s ListTransformJobsInput) String() string { +func (s PropertyNameQuery) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTransformJobsInput) GoString() string { +func (s PropertyNameQuery) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListTransformJobsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTransformJobsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *PropertyNameQuery) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PropertyNameQuery"} + if s.PropertyNameHint == nil { + invalidParams.Add(request.NewErrParamRequired("PropertyNameHint")) } if invalidParams.Len() > 0 { @@ -20114,141 +38628,321 @@ func (s *ListTransformJobsInput) Validate() error { return nil } -// SetCreationTimeAfter sets the CreationTimeAfter field's value. -func (s *ListTransformJobsInput) SetCreationTimeAfter(v time.Time) *ListTransformJobsInput { - s.CreationTimeAfter = &v - return s -} - -// SetCreationTimeBefore sets the CreationTimeBefore field's value. -func (s *ListTransformJobsInput) SetCreationTimeBefore(v time.Time) *ListTransformJobsInput { - s.CreationTimeBefore = &v - return s -} - -// SetLastModifiedTimeAfter sets the LastModifiedTimeAfter field's value. -func (s *ListTransformJobsInput) SetLastModifiedTimeAfter(v time.Time) *ListTransformJobsInput { - s.LastModifiedTimeAfter = &v - return s -} - -// SetLastModifiedTimeBefore sets the LastModifiedTimeBefore field's value. -func (s *ListTransformJobsInput) SetLastModifiedTimeBefore(v time.Time) *ListTransformJobsInput { - s.LastModifiedTimeBefore = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTransformJobsInput) SetMaxResults(v int64) *ListTransformJobsInput { - s.MaxResults = &v +// SetPropertyNameHint sets the PropertyNameHint field's value. +func (s *PropertyNameQuery) SetPropertyNameHint(v string) *PropertyNameQuery { + s.PropertyNameHint = &v return s } -// SetNameContains sets the NameContains field's value. -func (s *ListTransformJobsInput) SetNameContains(v string) *ListTransformJobsInput { - s.NameContains = &v - return s -} +// A property name returned from a GetSearchSuggestions call that specifies +// a value in the PropertyNameQuery field. +type PropertyNameSuggestion struct { + _ struct{} `type:"structure"` -// SetNextToken sets the NextToken field's value. -func (s *ListTransformJobsInput) SetNextToken(v string) *ListTransformJobsInput { - s.NextToken = &v - return s + // A suggested property name based on what you entered in the search textbox + // in the Amazon SageMaker console. + PropertyName *string `min:"1" type:"string"` } -// SetSortBy sets the SortBy field's value. -func (s *ListTransformJobsInput) SetSortBy(v string) *ListTransformJobsInput { - s.SortBy = &v - return s +// String returns the string representation +func (s PropertyNameSuggestion) String() string { + return awsutil.Prettify(s) } -// SetSortOrder sets the SortOrder field's value. -func (s *ListTransformJobsInput) SetSortOrder(v string) *ListTransformJobsInput { - s.SortOrder = &v - return s +// GoString returns the string representation +func (s PropertyNameSuggestion) GoString() string { + return s.String() } -// SetStatusEquals sets the StatusEquals field's value. -func (s *ListTransformJobsInput) SetStatusEquals(v string) *ListTransformJobsInput { - s.StatusEquals = &v +// SetPropertyName sets the PropertyName field's value. +func (s *PropertyNameSuggestion) SetPropertyName(v string) *PropertyNameSuggestion { + s.PropertyName = &v return s } -type ListTransformJobsOutput struct { +// Defines the amount of money paid to an Amazon Mechanical Turk worker for +// each task performed. +// +// Use one of the following prices for bounding box tasks. Prices are in US +// dollars and should be based on the complexity of the task; the longer it +// takes in your initial testing, the more you should offer. +// +// * 0.036 +// +// * 0.048 +// +// * 0.060 +// +// * 0.072 +// +// * 0.120 +// +// * 0.240 +// +// * 0.360 +// +// * 0.480 +// +// * 0.600 +// +// * 0.720 +// +// * 0.840 +// +// * 0.960 +// +// * 1.080 +// +// * 1.200 +// +// Use one of the following prices for image classification, text classification, +// and custom tasks. Prices are in US dollars. +// +// * 0.012 +// +// * 0.024 +// +// * 0.036 +// +// * 0.048 +// +// * 0.060 +// +// * 0.072 +// +// * 0.120 +// +// * 0.240 +// +// * 0.360 +// +// * 0.480 +// +// * 0.600 +// +// * 0.720 +// +// * 0.840 +// +// * 0.960 +// +// * 1.080 +// +// * 1.200 +// +// Use one of the following prices for semantic segmentation tasks. Prices are +// in US dollars. +// +// * 0.840 +// +// * 0.960 +// +// * 1.080 +// +// * 1.200 +// +// Use one of the following prices for Textract AnalyzeDocument Important Form +// Key Amazon Augmented AI review tasks. Prices are in US dollars. +// +// * 2.400 +// +// * 2.280 +// +// * 2.160 +// +// * 2.040 +// +// * 1.920 +// +// * 1.800 +// +// * 1.680 +// +// * 1.560 +// +// * 1.440 +// +// * 1.320 +// +// * 1.200 +// +// * 1.080 +// +// * 0.960 +// +// * 0.840 +// +// * 0.720 +// +// * 0.600 +// +// * 0.480 +// +// * 0.360 +// +// * 0.240 +// +// * 0.120 +// +// * 0.072 +// +// * 0.060 +// +// * 0.048 +// +// * 0.036 +// +// * 0.024 +// +// * 0.012 +// +// Use one of the following prices for Rekognition DetectModerationLabels Amazon +// Augmented AI review tasks. Prices are in US dollars. +// +// * 1.200 +// +// * 1.080 +// +// * 0.960 +// +// * 0.840 +// +// * 0.720 +// +// * 0.600 +// +// * 0.480 +// +// * 0.360 +// +// * 0.240 +// +// * 0.120 +// +// * 0.072 +// +// * 0.060 +// +// * 0.048 +// +// * 0.036 +// +// * 0.024 +// +// * 0.012 +// +// Use one of the following prices for Amazon Augmented AI custom human review +// tasks. Prices are in US dollars. +// +// * 1.200 +// +// * 1.080 +// +// * 0.960 +// +// * 0.840 +// +// * 0.720 +// +// * 0.600 +// +// * 0.480 +// +// * 0.360 +// +// * 0.240 +// +// * 0.120 +// +// * 0.072 +// +// * 0.060 +// +// * 0.048 +// +// * 0.036 +// +// * 0.024 +// +// * 0.012 +type PublicWorkforceTaskPrice struct { _ struct{} `type:"structure"` - // If the response is truncated, Amazon SageMaker returns this token. To retrieve - // the next set of transform jobs, use it in the next request. - NextToken *string `type:"string"` - - // An array of TransformJobSummary objects. - // - // TransformJobSummaries is a required field - TransformJobSummaries []*TransformJobSummary `type:"list" required:"true"` + // Defines the amount of money paid to an Amazon Mechanical Turk worker in United + // States dollars. + AmountInUsd *USD `type:"structure"` } // String returns the string representation -func (s ListTransformJobsOutput) String() string { +func (s PublicWorkforceTaskPrice) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListTransformJobsOutput) GoString() string { +func (s PublicWorkforceTaskPrice) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListTransformJobsOutput) SetNextToken(v string) *ListTransformJobsOutput { - s.NextToken = &v - return s -} - -// SetTransformJobSummaries sets the TransformJobSummaries field's value. -func (s *ListTransformJobsOutput) SetTransformJobSummaries(v []*TransformJobSummary) *ListTransformJobsOutput { - s.TransformJobSummaries = v +// SetAmountInUsd sets the AmountInUsd field's value. +func (s *PublicWorkforceTaskPrice) SetAmountInUsd(v *USD) *PublicWorkforceTaskPrice { + s.AmountInUsd = v return s } -type ListWorkteamsInput struct { +type RenderUiTemplateInput struct { _ struct{} `type:"structure"` - // The maximum number of work teams to return in each page of the response. - MaxResults *int64 `min:"1" type:"integer"` - - // A string in the work team's name. This filter returns only work teams whose - // name contains the specified string. - NameContains *string `min:"1" type:"string"` - - // If the result of the previous ListWorkteams request was truncated, the response - // includes a NextToken. To retrieve the next set of labeling jobs, use the - // token in the next request. - NextToken *string `type:"string"` + // The Amazon Resource Name (ARN) that has access to the S3 objects that are + // used by the template. + // + // RoleArn is a required field + RoleArn *string `min:"20" type:"string" required:"true"` - // The field to sort results by. The default is CreationTime. - SortBy *string `type:"string" enum:"ListWorkteamsSortByOptions"` + // A RenderableTask object containing a representative task to render. + // + // Task is a required field + Task *RenderableTask `type:"structure" required:"true"` - // The sort order for results. The default is Ascending. - SortOrder *string `type:"string" enum:"SortOrder"` + // A Template object containing the worker UI template to render. + // + // UiTemplate is a required field + UiTemplate *UiTemplate `type:"structure" required:"true"` } // String returns the string representation -func (s ListWorkteamsInput) String() string { +func (s RenderUiTemplateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListWorkteamsInput) GoString() string { +func (s RenderUiTemplateInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListWorkteamsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListWorkteamsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *RenderUiTemplateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RenderUiTemplateInput"} + if s.RoleArn == nil { + invalidParams.Add(request.NewErrParamRequired("RoleArn")) } - if s.NameContains != nil && len(*s.NameContains) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NameContains", 1)) + if s.RoleArn != nil && len(*s.RoleArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) + } + if s.Task == nil { + invalidParams.Add(request.NewErrParamRequired("Task")) + } + if s.UiTemplate == nil { + invalidParams.Add(request.NewErrParamRequired("UiTemplate")) + } + if s.Task != nil { + if err := s.Task.Validate(); err != nil { + invalidParams.AddNested("Task", err.(request.ErrInvalidParams)) + } + } + if s.UiTemplate != nil { + if err := s.UiTemplate.Validate(); err != nil { + invalidParams.AddNested("UiTemplate", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -20257,96 +38951,92 @@ func (s *ListWorkteamsInput) Validate() error { return nil } -// SetMaxResults sets the MaxResults field's value. -func (s *ListWorkteamsInput) SetMaxResults(v int64) *ListWorkteamsInput { - s.MaxResults = &v - return s -} - -// SetNameContains sets the NameContains field's value. -func (s *ListWorkteamsInput) SetNameContains(v string) *ListWorkteamsInput { - s.NameContains = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListWorkteamsInput) SetNextToken(v string) *ListWorkteamsInput { - s.NextToken = &v +// SetRoleArn sets the RoleArn field's value. +func (s *RenderUiTemplateInput) SetRoleArn(v string) *RenderUiTemplateInput { + s.RoleArn = &v return s } -// SetSortBy sets the SortBy field's value. -func (s *ListWorkteamsInput) SetSortBy(v string) *ListWorkteamsInput { - s.SortBy = &v +// SetTask sets the Task field's value. +func (s *RenderUiTemplateInput) SetTask(v *RenderableTask) *RenderUiTemplateInput { + s.Task = v return s } -// SetSortOrder sets the SortOrder field's value. -func (s *ListWorkteamsInput) SetSortOrder(v string) *ListWorkteamsInput { - s.SortOrder = &v +// SetUiTemplate sets the UiTemplate field's value. +func (s *RenderUiTemplateInput) SetUiTemplate(v *UiTemplate) *RenderUiTemplateInput { + s.UiTemplate = v return s } -type ListWorkteamsOutput struct { +type RenderUiTemplateOutput struct { _ struct{} `type:"structure"` - // If the response is truncated, Amazon SageMaker returns this token. To retrieve - // the next set of work teams, use it in the subsequent request. - NextToken *string `type:"string"` + // A list of one or more RenderingError objects if any were encountered while + // rendering the template. If there were no errors, the list is empty. + // + // Errors is a required field + Errors []*RenderingError `type:"list" required:"true"` - // An array of Workteam objects, each describing a work team. + // A Liquid template that renders the HTML for the worker UI. // - // Workteams is a required field - Workteams []*Workteam `type:"list" required:"true"` + // RenderedContent is a required field + RenderedContent *string `type:"string" required:"true"` } // String returns the string representation -func (s ListWorkteamsOutput) String() string { +func (s RenderUiTemplateOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListWorkteamsOutput) GoString() string { +func (s RenderUiTemplateOutput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *ListWorkteamsOutput) SetNextToken(v string) *ListWorkteamsOutput { - s.NextToken = &v +// SetErrors sets the Errors field's value. +func (s *RenderUiTemplateOutput) SetErrors(v []*RenderingError) *RenderUiTemplateOutput { + s.Errors = v return s } -// SetWorkteams sets the Workteams field's value. -func (s *ListWorkteamsOutput) SetWorkteams(v []*Workteam) *ListWorkteamsOutput { - s.Workteams = v +// SetRenderedContent sets the RenderedContent field's value. +func (s *RenderUiTemplateOutput) SetRenderedContent(v string) *RenderUiTemplateOutput { + s.RenderedContent = &v return s } -// Defines the Amazon Cognito user group that is part of a work team. -type MemberDefinition struct { +// Contains input values for a task. +type RenderableTask struct { _ struct{} `type:"structure"` - // The Amazon Cognito user group that is part of the work team. - CognitoMemberDefinition *CognitoMemberDefinition `type:"structure"` + // A JSON object that contains values for the variables defined in the template. + // It is made available to the template under the substitution variable task.input. + // For example, if you define a variable task.input.text in your template, you + // can supply the variable in the JSON object as "text": "sample text". + // + // Input is a required field + Input *string `min:"2" type:"string" required:"true"` } // String returns the string representation -func (s MemberDefinition) String() string { +func (s RenderableTask) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MemberDefinition) GoString() string { +func (s RenderableTask) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *MemberDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MemberDefinition"} - if s.CognitoMemberDefinition != nil { - if err := s.CognitoMemberDefinition.Validate(); err != nil { - invalidParams.AddNested("CognitoMemberDefinition", err.(request.ErrInvalidParams)) - } +func (s *RenderableTask) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RenderableTask"} + if s.Input == nil { + invalidParams.Add(request.NewErrParamRequired("Input")) + } + if s.Input != nil && len(*s.Input) < 2 { + invalidParams.Add(request.NewErrParamMinLen("Input", 2)) } if invalidParams.Len() > 0 { @@ -20355,99 +39045,181 @@ func (s *MemberDefinition) Validate() error { return nil } -// SetCognitoMemberDefinition sets the CognitoMemberDefinition field's value. -func (s *MemberDefinition) SetCognitoMemberDefinition(v *CognitoMemberDefinition) *MemberDefinition { - s.CognitoMemberDefinition = v +// SetInput sets the Input field's value. +func (s *RenderableTask) SetInput(v string) *RenderableTask { + s.Input = &v return s } -// The name, value, and date and time of a metric that was emitted to Amazon -// CloudWatch. -type MetricData struct { +// A description of an error that occurred while rendering the template. +type RenderingError struct { _ struct{} `type:"structure"` - // The name of the metric. - MetricName *string `min:"1" type:"string"` + // A unique identifier for a specific class of errors. + // + // Code is a required field + Code *string `type:"string" required:"true"` - // The date and time that the algorithm emitted the metric. - Timestamp *time.Time `type:"timestamp"` + // A human-readable message describing the error. + // + // Message is a required field + Message *string `type:"string" required:"true"` +} - // The value of the metric. - Value *float64 `type:"float"` +// String returns the string representation +func (s RenderingError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RenderingError) GoString() string { + return s.String() +} + +// SetCode sets the Code field's value. +func (s *RenderingError) SetCode(v string) *RenderingError { + s.Code = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *RenderingError) SetMessage(v string) *RenderingError { + s.Message = &v + return s +} + +// The resolved attributes. +type ResolvedAttributes struct { + _ struct{} `type:"structure"` + + // Applies a metric to minimize or maximize for the job's objective. + AutoMLJobObjective *AutoMLJobObjective `type:"structure"` + + // How long a job is allowed to run, or how many candidates a job is allowed + // to generate. + CompletionCriteria *AutoMLJobCompletionCriteria `type:"structure"` + + // The problem type. + ProblemType *string `type:"string" enum:"ProblemType"` } // String returns the string representation -func (s MetricData) String() string { +func (s ResolvedAttributes) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MetricData) GoString() string { +func (s ResolvedAttributes) GoString() string { return s.String() } -// SetMetricName sets the MetricName field's value. -func (s *MetricData) SetMetricName(v string) *MetricData { - s.MetricName = &v +// SetAutoMLJobObjective sets the AutoMLJobObjective field's value. +func (s *ResolvedAttributes) SetAutoMLJobObjective(v *AutoMLJobObjective) *ResolvedAttributes { + s.AutoMLJobObjective = v return s } -// SetTimestamp sets the Timestamp field's value. -func (s *MetricData) SetTimestamp(v time.Time) *MetricData { - s.Timestamp = &v +// SetCompletionCriteria sets the CompletionCriteria field's value. +func (s *ResolvedAttributes) SetCompletionCriteria(v *AutoMLJobCompletionCriteria) *ResolvedAttributes { + s.CompletionCriteria = v return s } -// SetValue sets the Value field's value. -func (s *MetricData) SetValue(v float64) *MetricData { - s.Value = &v +// SetProblemType sets the ProblemType field's value. +func (s *ResolvedAttributes) SetProblemType(v string) *ResolvedAttributes { + s.ProblemType = &v return s } -// Specifies a metric that the training algorithm writes to stderr or stdout -// . Amazon SageMakerhyperparameter tuning captures all defined metrics. You -// specify one metric that a hyperparameter tuning job uses as its objective -// metric to choose the best training job. -type MetricDefinition struct { +// Describes the resources, including ML compute instances and ML storage volumes, +// to use for model training. +type ResourceConfig struct { _ struct{} `type:"structure"` - // The name of the metric. + // The number of ML compute instances to use. For distributed training, provide + // a value greater than 1. // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` + // InstanceCount is a required field + InstanceCount *int64 `min:"1" type:"integer" required:"true"` - // A regular expression that searches the output of a training job and gets - // the value of the metric. For more information about using regular expressions - // to define metrics, see Defining Objective Metrics (https://docs.aws.amazon.com/sagemaker/latest/dg/automatic-model-tuning-define-metrics.html). + // The ML compute instance type. // - // Regex is a required field - Regex *string `min:"1" type:"string" required:"true"` + // InstanceType is a required field + InstanceType *string `type:"string" required:"true" enum:"TrainingInstanceType"` + + // The AWS KMS key that Amazon SageMaker uses to encrypt data on the storage + // volume attached to the ML compute instance(s) that run the training job. + // + // Certain Nitro-based instances include local storage, dependent on the instance + // type. Local storage volumes are encrypted using a hardware module on the + // instance. You can't request a VolumeKmsKeyId when using an instance type + // with local storage. + // + // For a list of instance types that support local instance storage, see Instance + // Store Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#instance-store-volumes). + // + // For more information about local instance storage encryption, see SSD Instance + // Store Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ssd-instance-store.html). + // + // The VolumeKmsKeyId can be in any of the following formats: + // + // * // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab" + // + // * // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + VolumeKmsKeyId *string `type:"string"` + + // The size of the ML storage volume that you want to provision. + // + // ML storage volumes store model artifacts and incremental states. Training + // algorithms might also use the ML storage volume for scratch space. If you + // want to store the training data in the ML storage volume, choose File as + // the TrainingInputMode in the algorithm specification. + // + // You must specify sufficient ML storage for your scenario. + // + // Amazon SageMaker supports only the General Purpose SSD (gp2) ML storage volume + // type. + // + // Certain Nitro-based instances include local storage with a fixed total size, + // dependent on the instance type. When using these instances for training, + // Amazon SageMaker mounts the local instance storage instead of Amazon EBS + // gp2 storage. You can't request a VolumeSizeInGB greater than the total size + // of the local instance storage. + // + // For a list of instance types that support local instance storage, including + // the total size per instance type, see Instance Store Volumes (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/InstanceStorage.html#instance-store-volumes). + // + // VolumeSizeInGB is a required field + VolumeSizeInGB *int64 `min:"1" type:"integer" required:"true"` } // String returns the string representation -func (s MetricDefinition) String() string { +func (s ResourceConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s MetricDefinition) GoString() string { +func (s ResourceConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *MetricDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MetricDefinition"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) +func (s *ResourceConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResourceConfig"} + if s.InstanceCount == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceCount")) } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + if s.InstanceCount != nil && *s.InstanceCount < 1 { + invalidParams.Add(request.NewErrParamMinValue("InstanceCount", 1)) } - if s.Regex == nil { - invalidParams.Add(request.NewErrParamRequired("Regex")) + if s.InstanceType == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceType")) } - if s.Regex != nil && len(*s.Regex) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Regex", 1)) + if s.VolumeSizeInGB == nil { + invalidParams.Add(request.NewErrParamRequired("VolumeSizeInGB")) + } + if s.VolumeSizeInGB != nil && *s.VolumeSizeInGB < 1 { + invalidParams.Add(request.NewErrParamMinValue("VolumeSizeInGB", 1)) } if invalidParams.Len() > 0 { @@ -20456,397 +39228,399 @@ func (s *MetricDefinition) Validate() error { return nil } -// SetName sets the Name field's value. -func (s *MetricDefinition) SetName(v string) *MetricDefinition { - s.Name = &v +// SetInstanceCount sets the InstanceCount field's value. +func (s *ResourceConfig) SetInstanceCount(v int64) *ResourceConfig { + s.InstanceCount = &v return s } -// SetRegex sets the Regex field's value. -func (s *MetricDefinition) SetRegex(v string) *MetricDefinition { - s.Regex = &v +// SetInstanceType sets the InstanceType field's value. +func (s *ResourceConfig) SetInstanceType(v string) *ResourceConfig { + s.InstanceType = &v return s } -// Provides information about the location that is configured for storing model -// artifacts. -type ModelArtifacts struct { - _ struct{} `type:"structure"` - - // The path of the S3 object that contains the model artifacts. For example, - // s3://bucket-name/keynameprefix/model.tar.gz. - // - // S3ModelArtifacts is a required field - S3ModelArtifacts *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s ModelArtifacts) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s ModelArtifacts) GoString() string { - return s.String() +// SetVolumeKmsKeyId sets the VolumeKmsKeyId field's value. +func (s *ResourceConfig) SetVolumeKmsKeyId(v string) *ResourceConfig { + s.VolumeKmsKeyId = &v + return s } -// SetS3ModelArtifacts sets the S3ModelArtifacts field's value. -func (s *ModelArtifacts) SetS3ModelArtifacts(v string) *ModelArtifacts { - s.S3ModelArtifacts = &v +// SetVolumeSizeInGB sets the VolumeSizeInGB field's value. +func (s *ResourceConfig) SetVolumeSizeInGB(v int64) *ResourceConfig { + s.VolumeSizeInGB = &v return s } -// Describes the Docker container for the model package. -type ModelPackageContainerDefinition struct { - _ struct{} `type:"structure"` - - // The DNS host name for the Docker container. - ContainerHostname *string `type:"string"` - - // The Amazon EC2 Container Registry (Amazon ECR) path where inference code - // is stored. - // - // If you are using your own custom algorithm instead of an algorithm provided - // by Amazon SageMaker, the inference code must meet Amazon SageMaker requirements. - // Amazon SageMaker supports both registry/repository[:tag] and registry/repository[@digest] - // image path formats. For more information, see Using Your Own Algorithms with - // Amazon SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/your-algorithms.html). - // - // Image is a required field - Image *string `type:"string" required:"true"` - - // An MD5 hash of the training algorithm that identifies the Docker image used - // for training. - ImageDigest *string `type:"string"` - - // The Amazon S3 path where the model artifacts, which result from model training, - // are stored. This path must point to a single gzip compressed tar archive - // (.tar.gz suffix). - ModelDataUrl *string `type:"string"` +// Resource being accessed is in use. +type ResourceInUse struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The AWS Marketplace product ID of the model package. - ProductId *string `type:"string"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s ModelPackageContainerDefinition) String() string { +func (s ResourceInUse) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModelPackageContainerDefinition) GoString() string { +func (s ResourceInUse) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModelPackageContainerDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModelPackageContainerDefinition"} - if s.Image == nil { - invalidParams.Add(request.NewErrParamRequired("Image")) - } - - if invalidParams.Len() > 0 { - return invalidParams +func newErrorResourceInUse(v protocol.ResponseMetadata) error { + return &ResourceInUse{ + respMetadata: v, } - return nil } -// SetContainerHostname sets the ContainerHostname field's value. -func (s *ModelPackageContainerDefinition) SetContainerHostname(v string) *ModelPackageContainerDefinition { - s.ContainerHostname = &v - return s +// Code returns the exception type name. +func (s ResourceInUse) Code() string { + return "ResourceInUse" } -// SetImage sets the Image field's value. -func (s *ModelPackageContainerDefinition) SetImage(v string) *ModelPackageContainerDefinition { - s.Image = &v - return s +// Message returns the exception's message. +func (s ResourceInUse) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetImageDigest sets the ImageDigest field's value. -func (s *ModelPackageContainerDefinition) SetImageDigest(v string) *ModelPackageContainerDefinition { - s.ImageDigest = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUse) OrigErr() error { + return nil } -// SetModelDataUrl sets the ModelDataUrl field's value. -func (s *ModelPackageContainerDefinition) SetModelDataUrl(v string) *ModelPackageContainerDefinition { - s.ModelDataUrl = &v - return s +func (s ResourceInUse) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetProductId sets the ProductId field's value. -func (s *ModelPackageContainerDefinition) SetProductId(v string) *ModelPackageContainerDefinition { - s.ProductId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUse) StatusCode() int { + return s.respMetadata.StatusCode } -// Specifies the validation and image scan statuses of the model package. -type ModelPackageStatusDetails struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s ResourceInUse) RequestID() string { + return s.respMetadata.RequestID +} - // The status of the scan of the Docker image container for the model package. - ImageScanStatuses []*ModelPackageStatusItem `type:"list"` +// You have exceeded an Amazon SageMaker resource limit. For example, you might +// have too many training jobs created. +type ResourceLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The validation status of the model package. - // - // ValidationStatuses is a required field - ValidationStatuses []*ModelPackageStatusItem `type:"list" required:"true"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s ModelPackageStatusDetails) String() string { +func (s ResourceLimitExceeded) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModelPackageStatusDetails) GoString() string { +func (s ResourceLimitExceeded) GoString() string { return s.String() } -// SetImageScanStatuses sets the ImageScanStatuses field's value. -func (s *ModelPackageStatusDetails) SetImageScanStatuses(v []*ModelPackageStatusItem) *ModelPackageStatusDetails { - s.ImageScanStatuses = v - return s +func newErrorResourceLimitExceeded(v protocol.ResponseMetadata) error { + return &ResourceLimitExceeded{ + respMetadata: v, + } } -// SetValidationStatuses sets the ValidationStatuses field's value. -func (s *ModelPackageStatusDetails) SetValidationStatuses(v []*ModelPackageStatusItem) *ModelPackageStatusDetails { - s.ValidationStatuses = v - return s +// Code returns the exception type name. +func (s ResourceLimitExceeded) Code() string { + return "ResourceLimitExceeded" } -// Represents the overall status of a model package. -type ModelPackageStatusItem struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s ResourceLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // if the overall status is Failed, the reason for the failure. - FailureReason *string `type:"string"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceLimitExceeded) OrigErr() error { + return nil +} - // The name of the model package for which the overall status is being reported. +func (s ResourceLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + +// Specifies the maximum number of training jobs and parallel training jobs +// that a hyperparameter tuning job can launch. +type ResourceLimits struct { + _ struct{} `type:"structure"` + + // The maximum number of training jobs that a hyperparameter tuning job can + // launch. // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` + // MaxNumberOfTrainingJobs is a required field + MaxNumberOfTrainingJobs *int64 `min:"1" type:"integer" required:"true"` - // The current status. + // The maximum number of concurrent training jobs that a hyperparameter tuning + // job can launch. // - // Status is a required field - Status *string `type:"string" required:"true" enum:"DetailedModelPackageStatus"` + // MaxParallelTrainingJobs is a required field + MaxParallelTrainingJobs *int64 `min:"1" type:"integer" required:"true"` } // String returns the string representation -func (s ModelPackageStatusItem) String() string { +func (s ResourceLimits) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModelPackageStatusItem) GoString() string { +func (s ResourceLimits) GoString() string { return s.String() } -// SetFailureReason sets the FailureReason field's value. -func (s *ModelPackageStatusItem) SetFailureReason(v string) *ModelPackageStatusItem { - s.FailureReason = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResourceLimits) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResourceLimits"} + if s.MaxNumberOfTrainingJobs == nil { + invalidParams.Add(request.NewErrParamRequired("MaxNumberOfTrainingJobs")) + } + if s.MaxNumberOfTrainingJobs != nil && *s.MaxNumberOfTrainingJobs < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxNumberOfTrainingJobs", 1)) + } + if s.MaxParallelTrainingJobs == nil { + invalidParams.Add(request.NewErrParamRequired("MaxParallelTrainingJobs")) + } + if s.MaxParallelTrainingJobs != nil && *s.MaxParallelTrainingJobs < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxParallelTrainingJobs", 1)) + } -// SetName sets the Name field's value. -func (s *ModelPackageStatusItem) SetName(v string) *ModelPackageStatusItem { - s.Name = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetStatus sets the Status field's value. -func (s *ModelPackageStatusItem) SetStatus(v string) *ModelPackageStatusItem { - s.Status = &v +// SetMaxNumberOfTrainingJobs sets the MaxNumberOfTrainingJobs field's value. +func (s *ResourceLimits) SetMaxNumberOfTrainingJobs(v int64) *ResourceLimits { + s.MaxNumberOfTrainingJobs = &v return s } -// Provides summary information about a model package. -type ModelPackageSummary struct { - _ struct{} `type:"structure"` - - // A timestamp that shows when the model package was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` - - // The Amazon Resource Name (ARN) of the model package. - // - // ModelPackageArn is a required field - ModelPackageArn *string `min:"1" type:"string" required:"true"` - - // A brief description of the model package. - ModelPackageDescription *string `type:"string"` +// SetMaxParallelTrainingJobs sets the MaxParallelTrainingJobs field's value. +func (s *ResourceLimits) SetMaxParallelTrainingJobs(v int64) *ResourceLimits { + s.MaxParallelTrainingJobs = &v + return s +} - // The name of the model package. - // - // ModelPackageName is a required field - ModelPackageName *string `min:"1" type:"string" required:"true"` +// Resource being access is not found. +type ResourceNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The overall status of the model package. - // - // ModelPackageStatus is a required field - ModelPackageStatus *string `type:"string" required:"true" enum:"ModelPackageStatus"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s ModelPackageSummary) String() string { +func (s ResourceNotFound) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModelPackageSummary) GoString() string { +func (s ResourceNotFound) GoString() string { return s.String() } -// SetCreationTime sets the CreationTime field's value. -func (s *ModelPackageSummary) SetCreationTime(v time.Time) *ModelPackageSummary { - s.CreationTime = &v - return s +func newErrorResourceNotFound(v protocol.ResponseMetadata) error { + return &ResourceNotFound{ + respMetadata: v, + } } -// SetModelPackageArn sets the ModelPackageArn field's value. -func (s *ModelPackageSummary) SetModelPackageArn(v string) *ModelPackageSummary { - s.ModelPackageArn = &v - return s +// Code returns the exception type name. +func (s ResourceNotFound) Code() string { + return "ResourceNotFound" } -// SetModelPackageDescription sets the ModelPackageDescription field's value. -func (s *ModelPackageSummary) SetModelPackageDescription(v string) *ModelPackageSummary { - s.ModelPackageDescription = &v - return s +// Message returns the exception's message. +func (s ResourceNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetModelPackageName sets the ModelPackageName field's value. -func (s *ModelPackageSummary) SetModelPackageName(v string) *ModelPackageSummary { - s.ModelPackageName = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFound) OrigErr() error { + return nil } -// SetModelPackageStatus sets the ModelPackageStatus field's value. -func (s *ModelPackageSummary) SetModelPackageStatus(v string) *ModelPackageSummary { - s.ModelPackageStatus = &v - return s +func (s ResourceNotFound) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// Contains data, such as the inputs and targeted instance types that are used -// in the process of validating the model package. -// -// The data provided in the validation profile is made available to your buyers -// on AWS Marketplace. -type ModelPackageValidationProfile struct { +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFound) RequestID() string { + return s.respMetadata.RequestID +} + +// The instance type and quantity. +type ResourceSpec struct { _ struct{} `type:"structure"` - // The name of the profile for the model package. - // - // ProfileName is a required field - ProfileName *string `min:"1" type:"string" required:"true"` + // The Amazon Resource Name (ARN) of the environment. + EnvironmentArn *string `type:"string"` - // The TransformJobDefinition object that describes the transform job used for - // the validation of the model package. - // - // TransformJobDefinition is a required field - TransformJobDefinition *TransformJobDefinition `type:"structure" required:"true"` + // The instance type. + InstanceType *string `type:"string" enum:"AppInstanceType"` } // String returns the string representation -func (s ModelPackageValidationProfile) String() string { +func (s ResourceSpec) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModelPackageValidationProfile) GoString() string { +func (s ResourceSpec) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModelPackageValidationProfile) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModelPackageValidationProfile"} - if s.ProfileName == nil { - invalidParams.Add(request.NewErrParamRequired("ProfileName")) - } - if s.ProfileName != nil && len(*s.ProfileName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ProfileName", 1)) - } - if s.TransformJobDefinition == nil { - invalidParams.Add(request.NewErrParamRequired("TransformJobDefinition")) - } - if s.TransformJobDefinition != nil { - if err := s.TransformJobDefinition.Validate(); err != nil { - invalidParams.AddNested("TransformJobDefinition", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetEnvironmentArn sets the EnvironmentArn field's value. +func (s *ResourceSpec) SetEnvironmentArn(v string) *ResourceSpec { + s.EnvironmentArn = &v + return s } -// SetProfileName sets the ProfileName field's value. -func (s *ModelPackageValidationProfile) SetProfileName(v string) *ModelPackageValidationProfile { - s.ProfileName = &v +// SetInstanceType sets the InstanceType field's value. +func (s *ResourceSpec) SetInstanceType(v string) *ResourceSpec { + s.InstanceType = &v return s } -// SetTransformJobDefinition sets the TransformJobDefinition field's value. -func (s *ModelPackageValidationProfile) SetTransformJobDefinition(v *TransformJobDefinition) *ModelPackageValidationProfile { - s.TransformJobDefinition = v +// The retention policy. +type RetentionPolicy struct { + _ struct{} `type:"structure"` + + // The home Amazon Elastic File System (EFS). + HomeEfsFileSystem *string `type:"string" enum:"RetentionType"` +} + +// String returns the string representation +func (s RetentionPolicy) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RetentionPolicy) GoString() string { + return s.String() +} + +// SetHomeEfsFileSystem sets the HomeEfsFileSystem field's value. +func (s *RetentionPolicy) SetHomeEfsFileSystem(v string) *RetentionPolicy { + s.HomeEfsFileSystem = &v return s } -// Specifies batch transform jobs that Amazon SageMaker runs to validate your -// model package. -type ModelPackageValidationSpecification struct { +// Describes the S3 data source. +type S3DataSource struct { _ struct{} `type:"structure"` - // An array of ModelPackageValidationProfile objects, each of which specifies - // a batch transform job that Amazon SageMaker runs to validate your model package. + // A list of one or more attribute names to use that are found in a specified + // augmented manifest file. + AttributeNames []*string `type:"list"` + + // If you want Amazon SageMaker to replicate the entire dataset on each ML compute + // instance that is launched for model training, specify FullyReplicated. // - // ValidationProfiles is a required field - ValidationProfiles []*ModelPackageValidationProfile `min:"1" type:"list" required:"true"` + // If you want Amazon SageMaker to replicate a subset of data on each ML compute + // instance that is launched for model training, specify ShardedByS3Key. If + // there are n ML compute instances launched for a training job, each instance + // gets approximately 1/n of the number of S3 objects. In this case, model training + // on each machine uses only the subset of training data. + // + // Don't choose more ML compute instances for training than available S3 objects. + // If you do, some nodes won't get any data and you will pay for nodes that + // aren't getting any training data. This applies in both File and Pipe modes. + // Keep this in mind when developing algorithms. + // + // In distributed training, where you use multiple ML compute EC2 instances, + // you might choose ShardedByS3Key. If the algorithm requires copying training + // data to the ML storage volume (when TrainingInputMode is set to File), this + // copies 1/n of the number of objects. + S3DataDistributionType *string `type:"string" enum:"S3DataDistribution"` - // The IAM roles to be used for the validation of the model package. + // If you choose S3Prefix, S3Uri identifies a key name prefix. Amazon SageMaker + // uses all objects that match the specified key name prefix for model training. // - // ValidationRole is a required field - ValidationRole *string `min:"20" type:"string" required:"true"` + // If you choose ManifestFile, S3Uri identifies an object that is a manifest + // file containing a list of object keys that you want Amazon SageMaker to use + // for model training. + // + // If you choose AugmentedManifestFile, S3Uri identifies an object that is an + // augmented manifest file in JSON lines format. This file contains the data + // you want to use for model training. AugmentedManifestFile can only be used + // if the Channel's input mode is Pipe. + // + // S3DataType is a required field + S3DataType *string `type:"string" required:"true" enum:"S3DataType"` + + // Depending on the value specified for the S3DataType, identifies either a + // key name prefix or a manifest. For example: + // + // * A key name prefix might look like this: s3://bucketname/exampleprefix. + // + // * A manifest might look like this: s3://bucketname/example.manifest The + // manifest is an S3 object which is a JSON file with the following format: + // The preceding JSON matches the following s3Uris: [ {"prefix": "s3://customer_bucket/some/prefix/"}, + // "relative/path/to/custdata-1", "relative/path/custdata-2", ... "relative/path/custdata-N" + // ] The preceding JSON matches the following s3Uris: s3://customer_bucket/some/prefix/relative/path/to/custdata-1 + // s3://customer_bucket/some/prefix/relative/path/custdata-2 ... s3://customer_bucket/some/prefix/relative/path/custdata-N + // The complete set of s3uris in this manifest is the input data for the + // channel for this datasource. The object that each s3uris points to must + // be readable by the IAM role that Amazon SageMaker uses to perform tasks + // on your behalf. + // + // S3Uri is a required field + S3Uri *string `type:"string" required:"true"` } // String returns the string representation -func (s ModelPackageValidationSpecification) String() string { +func (s S3DataSource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModelPackageValidationSpecification) GoString() string { +func (s S3DataSource) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ModelPackageValidationSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModelPackageValidationSpecification"} - if s.ValidationProfiles == nil { - invalidParams.Add(request.NewErrParamRequired("ValidationProfiles")) - } - if s.ValidationProfiles != nil && len(s.ValidationProfiles) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ValidationProfiles", 1)) - } - if s.ValidationRole == nil { - invalidParams.Add(request.NewErrParamRequired("ValidationRole")) - } - if s.ValidationRole != nil && len(*s.ValidationRole) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ValidationRole", 20)) +func (s *S3DataSource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "S3DataSource"} + if s.S3DataType == nil { + invalidParams.Add(request.NewErrParamRequired("S3DataType")) } - if s.ValidationProfiles != nil { - for i, v := range s.ValidationProfiles { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ValidationProfiles", i), err.(request.ErrInvalidParams)) - } - } + if s.S3Uri == nil { + invalidParams.Add(request.NewErrParamRequired("S3Uri")) } if invalidParams.Len() > 0 { @@ -20855,123 +39629,162 @@ func (s *ModelPackageValidationSpecification) Validate() error { return nil } -// SetValidationProfiles sets the ValidationProfiles field's value. -func (s *ModelPackageValidationSpecification) SetValidationProfiles(v []*ModelPackageValidationProfile) *ModelPackageValidationSpecification { - s.ValidationProfiles = v +// SetAttributeNames sets the AttributeNames field's value. +func (s *S3DataSource) SetAttributeNames(v []*string) *S3DataSource { + s.AttributeNames = v return s } -// SetValidationRole sets the ValidationRole field's value. -func (s *ModelPackageValidationSpecification) SetValidationRole(v string) *ModelPackageValidationSpecification { - s.ValidationRole = &v +// SetS3DataDistributionType sets the S3DataDistributionType field's value. +func (s *S3DataSource) SetS3DataDistributionType(v string) *S3DataSource { + s.S3DataDistributionType = &v return s } -// Provides summary information about a model. -type ModelSummary struct { +// SetS3DataType sets the S3DataType field's value. +func (s *S3DataSource) SetS3DataType(v string) *S3DataSource { + s.S3DataType = &v + return s +} + +// SetS3Uri sets the S3Uri field's value. +func (s *S3DataSource) SetS3Uri(v string) *S3DataSource { + s.S3Uri = &v + return s +} + +// Configuration details about the monitoring schedule. +type ScheduleConfig struct { _ struct{} `type:"structure"` - // A timestamp that indicates when the model was created. + // A cron expression that describes details about the monitoring schedule. // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` - - // The Amazon Resource Name (ARN) of the model. + // Currently the only supported cron expressions are: // - // ModelArn is a required field - ModelArn *string `min:"20" type:"string" required:"true"` - - // The name of the model that you want a summary for. + // * If you want to set the job to start every hour, please use the following: + // Hourly: cron(0 * ? * * *) // - // ModelName is a required field - ModelName *string `type:"string" required:"true"` + // * If you want to start the job daily: cron(0 [00-23] ? * * *) + // + // For example, the following are valid cron expressions: + // + // * Daily at noon UTC: cron(0 12 ? * * *) + // + // * Daily at midnight UTC: cron(0 0 ? * * *) + // + // To support running every 6, 12 hours, the following are also supported: + // + // cron(0 [00-23]/[01-24] ? * * *) + // + // For example, the following are valid cron expressions: + // + // * Every 12 hours, starting at 5pm UTC: cron(0 17/12 ? * * *) + // + // * Every two hours starting at midnight: cron(0 0/2 ? * * *) + // + // * Even though the cron expression is set to start at 5PM UTC, note that + // there could be a delay of 0-20 minutes from the actual requested time + // to run the execution. + // + // * We recommend that if you would like a daily schedule, you do not provide + // this parameter. Amazon SageMaker will pick a time for running every day. + // + // ScheduleExpression is a required field + ScheduleExpression *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s ModelSummary) String() string { +func (s ScheduleConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModelSummary) GoString() string { +func (s ScheduleConfig) GoString() string { return s.String() } -// SetCreationTime sets the CreationTime field's value. -func (s *ModelSummary) SetCreationTime(v time.Time) *ModelSummary { - s.CreationTime = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *ScheduleConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ScheduleConfig"} + if s.ScheduleExpression == nil { + invalidParams.Add(request.NewErrParamRequired("ScheduleExpression")) + } + if s.ScheduleExpression != nil && len(*s.ScheduleExpression) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ScheduleExpression", 1)) + } -// SetModelArn sets the ModelArn field's value. -func (s *ModelSummary) SetModelArn(v string) *ModelSummary { - s.ModelArn = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetModelName sets the ModelName field's value. -func (s *ModelSummary) SetModelName(v string) *ModelSummary { - s.ModelName = &v +// SetScheduleExpression sets the ScheduleExpression field's value. +func (s *ScheduleConfig) SetScheduleExpression(v string) *ScheduleConfig { + s.ScheduleExpression = &v return s } -// Defines a list of NestedFilters objects. To satisfy the conditions specified -// in the NestedFilters call, a resource must satisfy the conditions of all -// of the filters. +// A multi-expression that searches for the specified resource or resources +// in a search. All resource objects that satisfy the expression's condition +// are included in the search results. You must specify at least one subexpression, +// filter, or nested filter. A SearchExpression can contain up to twenty elements. // -// For example, you could define a NestedFilters using the training job's InputDataConfig -// property to filter on Channel objects. +// A SearchExpression contains the following components: // -// A NestedFilters object contains multiple filters. For example, to find all -// training jobs whose name contains train and that have cat/data in their S3Uri -// (specified in InputDataConfig), you need to create a NestedFilters object -// that specifies the InputDataConfig property with the following Filter objects: +// * A list of Filter objects. Each filter defines a simple Boolean expression +// comprised of a resource property name, Boolean operator, and value. A +// SearchExpression can include only one Contains operator. // -// * '{Name:"InputDataConfig.ChannelName", "Operator":"EQUALS", "Value":"train"}', +// * A list of NestedFilter objects. Each nested filter defines a list of +// Boolean expressions using a list of resource properties. A nested filter +// is satisfied if a single object in the list satisfies all Boolean expressions. // -// * '{Name:"InputDataConfig.DataSource.S3DataSource.S3Uri", "Operator":"CONTAINS", -// "Value":"cat/data"}' -type NestedFilters struct { +// * A list of SearchExpression objects. A search expression object can be +// nested in a list of search expression objects. +// +// * A Boolean operator: And or Or. +type SearchExpression struct { _ struct{} `type:"structure"` - // A list of filters. Each filter acts on a property. Filters must contain at - // least one Filters value. For example, a NestedFilters call might include - // a filter on the PropertyName parameter of the InputDataConfig property: InputDataConfig.DataSource.S3DataSource.S3Uri. - // - // Filters is a required field - Filters []*Filter `min:"1" type:"list" required:"true"` + // A list of filter objects. + Filters []*Filter `min:"1" type:"list"` - // The name of the property to use in the nested filters. The value must match - // a listed property name, such as InputDataConfig . - // - // NestedPropertyName is a required field - NestedPropertyName *string `min:"1" type:"string" required:"true"` + // A list of nested filter objects. + NestedFilters []*NestedFilters `min:"1" type:"list"` + + // A Boolean operator used to evaluate the search expression. If you want every + // conditional statement in all lists to be satisfied for the entire search + // expression to be true, specify And. If only a single conditional statement + // needs to be true for the entire search expression to be true, specify Or. + // The default value is And. + Operator *string `type:"string" enum:"BooleanOperator"` + + // A list of search expression objects. + SubExpressions []*SearchExpression `min:"1" type:"list"` } // String returns the string representation -func (s NestedFilters) String() string { +func (s SearchExpression) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s NestedFilters) GoString() string { +func (s SearchExpression) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *NestedFilters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NestedFilters"} - if s.Filters == nil { - invalidParams.Add(request.NewErrParamRequired("Filters")) - } +func (s *SearchExpression) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SearchExpression"} if s.Filters != nil && len(s.Filters) < 1 { invalidParams.Add(request.NewErrParamMinLen("Filters", 1)) } - if s.NestedPropertyName == nil { - invalidParams.Add(request.NewErrParamRequired("NestedPropertyName")) + if s.NestedFilters != nil && len(s.NestedFilters) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NestedFilters", 1)) } - if s.NestedPropertyName != nil && len(*s.NestedPropertyName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NestedPropertyName", 1)) + if s.SubExpressions != nil && len(s.SubExpressions) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SubExpressions", 1)) } if s.Filters != nil { for i, v := range s.Filters { @@ -20983,6 +39796,26 @@ func (s *NestedFilters) Validate() error { } } } + if s.NestedFilters != nil { + for i, v := range s.NestedFilters { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NestedFilters", i), err.(request.ErrInvalidParams)) + } + } + } + if s.SubExpressions != nil { + for i, v := range s.SubExpressions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SubExpressions", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -20991,111 +39824,88 @@ func (s *NestedFilters) Validate() error { } // SetFilters sets the Filters field's value. -func (s *NestedFilters) SetFilters(v []*Filter) *NestedFilters { +func (s *SearchExpression) SetFilters(v []*Filter) *SearchExpression { s.Filters = v return s } -// SetNestedPropertyName sets the NestedPropertyName field's value. -func (s *NestedFilters) SetNestedPropertyName(v string) *NestedFilters { - s.NestedPropertyName = &v +// SetNestedFilters sets the NestedFilters field's value. +func (s *SearchExpression) SetNestedFilters(v []*NestedFilters) *SearchExpression { + s.NestedFilters = v return s } -// Provides a summary of a notebook instance lifecycle configuration. -type NotebookInstanceLifecycleConfigSummary struct { - _ struct{} `type:"structure"` - - // A timestamp that tells when the lifecycle configuration was created. - CreationTime *time.Time `type:"timestamp"` - - // A timestamp that tells when the lifecycle configuration was last modified. - LastModifiedTime *time.Time `type:"timestamp"` - - // The Amazon Resource Name (ARN) of the lifecycle configuration. - // - // NotebookInstanceLifecycleConfigArn is a required field - NotebookInstanceLifecycleConfigArn *string `type:"string" required:"true"` - - // The name of the lifecycle configuration. - // - // NotebookInstanceLifecycleConfigName is a required field - NotebookInstanceLifecycleConfigName *string `type:"string" required:"true"` +// SetOperator sets the Operator field's value. +func (s *SearchExpression) SetOperator(v string) *SearchExpression { + s.Operator = &v + return s } -// String returns the string representation -func (s NotebookInstanceLifecycleConfigSummary) String() string { - return awsutil.Prettify(s) +// SetSubExpressions sets the SubExpressions field's value. +func (s *SearchExpression) SetSubExpressions(v []*SearchExpression) *SearchExpression { + s.SubExpressions = v + return s } -// GoString returns the string representation -func (s NotebookInstanceLifecycleConfigSummary) GoString() string { - return s.String() -} +type SearchInput struct { + _ struct{} `type:"structure"` -// SetCreationTime sets the CreationTime field's value. -func (s *NotebookInstanceLifecycleConfigSummary) SetCreationTime(v time.Time) *NotebookInstanceLifecycleConfigSummary { - s.CreationTime = &v - return s -} + // The maximum number of results to return in a SearchResponse. + MaxResults *int64 `min:"1" type:"integer"` -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *NotebookInstanceLifecycleConfigSummary) SetLastModifiedTime(v time.Time) *NotebookInstanceLifecycleConfigSummary { - s.LastModifiedTime = &v - return s -} + // If more than MaxResults resource objects match the specified SearchExpression, + // the SearchResponse includes a NextToken. The NextToken can be passed to the + // next SearchRequest to continue retrieving results for the specified SearchExpression + // and Sort parameters. + NextToken *string `type:"string"` -// SetNotebookInstanceLifecycleConfigArn sets the NotebookInstanceLifecycleConfigArn field's value. -func (s *NotebookInstanceLifecycleConfigSummary) SetNotebookInstanceLifecycleConfigArn(v string) *NotebookInstanceLifecycleConfigSummary { - s.NotebookInstanceLifecycleConfigArn = &v - return s -} + // The name of the Amazon SageMaker resource to search for. + // + // Resource is a required field + Resource *string `type:"string" required:"true" enum:"ResourceType"` -// SetNotebookInstanceLifecycleConfigName sets the NotebookInstanceLifecycleConfigName field's value. -func (s *NotebookInstanceLifecycleConfigSummary) SetNotebookInstanceLifecycleConfigName(v string) *NotebookInstanceLifecycleConfigSummary { - s.NotebookInstanceLifecycleConfigName = &v - return s -} + // A Boolean conditional statement. Resource objects must satisfy this condition + // to be included in search results. You must provide at least one subexpression, + // filter, or nested filter. The maximum number of recursive SubExpressions, + // NestedFilters, and Filters that can be included in a SearchExpression object + // is 50. + SearchExpression *SearchExpression `type:"structure"` -// Contains the notebook instance lifecycle configuration script. -// -// Each lifecycle configuration script has a limit of 16384 characters. -// -// The value of the $PATH environment variable that is available to both scripts -// is /sbin:bin:/usr/sbin:/usr/bin. -// -// View CloudWatch Logs for notebook instance lifecycle configurations in log -// group /aws/sagemaker/NotebookInstances in log stream [notebook-instance-name]/[LifecycleConfigHook]. -// -// Lifecycle configuration scripts cannot run for longer than 5 minutes. If -// a script runs for longer than 5 minutes, it fails and the notebook instance -// is not created or started. -// -// For information about notebook instance lifestyle configurations, see Step -// 2.1: (Optional) Customize a Notebook Instance (https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html). -type NotebookInstanceLifecycleHook struct { - _ struct{} `type:"structure"` + // The name of the resource property used to sort the SearchResults. The default + // is LastModifiedTime. + SortBy *string `min:"1" type:"string"` - // A base64-encoded string that contains a shell script for a notebook instance - // lifecycle configuration. - Content *string `min:"1" type:"string"` + // How SearchResults are ordered. Valid values are Ascending or Descending. + // The default is Descending. + SortOrder *string `type:"string" enum:"SearchSortOrder"` } // String returns the string representation -func (s NotebookInstanceLifecycleHook) String() string { +func (s SearchInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s NotebookInstanceLifecycleHook) GoString() string { +func (s SearchInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *NotebookInstanceLifecycleHook) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NotebookInstanceLifecycleHook"} - if s.Content != nil && len(*s.Content) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Content", 1)) +func (s *SearchInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SearchInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.Resource == nil { + invalidParams.Add(request.NewErrParamRequired("Resource")) + } + if s.SortBy != nil && len(*s.SortBy) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SortBy", 1)) + } + if s.SearchExpression != nil { + if err := s.SearchExpression.Validate(); err != nil { + invalidParams.AddNested("SearchExpression", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -21104,248 +39914,349 @@ func (s *NotebookInstanceLifecycleHook) Validate() error { return nil } -// SetContent sets the Content field's value. -func (s *NotebookInstanceLifecycleHook) SetContent(v string) *NotebookInstanceLifecycleHook { - s.Content = &v +// SetMaxResults sets the MaxResults field's value. +func (s *SearchInput) SetMaxResults(v int64) *SearchInput { + s.MaxResults = &v return s } -// Provides summary information for an Amazon SageMaker notebook instance. -type NotebookInstanceSummary struct { - _ struct{} `type:"structure"` - - // An array of up to three Git repositories associated with the notebook instance. - // These can be either the names of Git repositories stored as resources in - // your account, or the URL of Git repositories in AWS CodeCommit (https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html) - // or in any other Git repository. These repositories are cloned at the same - // level as the default repository of your notebook instance. For more information, - // see Associating Git Repositories with Amazon SageMaker Notebook Instances - // (https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html). - AdditionalCodeRepositories []*string `type:"list"` - - // A timestamp that shows when the notebook instance was created. - CreationTime *time.Time `type:"timestamp"` - - // The Git repository associated with the notebook instance as its default code - // repository. This can be either the name of a Git repository stored as a resource - // in your account, or the URL of a Git repository in AWS CodeCommit (https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html) - // or in any other Git repository. When you open a notebook instance, it opens - // in the directory that contains this repository. For more information, see - // Associating Git Repositories with Amazon SageMaker Notebook Instances (https://docs.aws.amazon.com/sagemaker/latest/dg/nbi-git-repo.html). - DefaultCodeRepository *string `min:"1" type:"string"` +// SetNextToken sets the NextToken field's value. +func (s *SearchInput) SetNextToken(v string) *SearchInput { + s.NextToken = &v + return s +} - // The type of ML compute instance that the notebook instance is running on. - InstanceType *string `type:"string" enum:"InstanceType"` +// SetResource sets the Resource field's value. +func (s *SearchInput) SetResource(v string) *SearchInput { + s.Resource = &v + return s +} - // A timestamp that shows when the notebook instance was last modified. - LastModifiedTime *time.Time `type:"timestamp"` +// SetSearchExpression sets the SearchExpression field's value. +func (s *SearchInput) SetSearchExpression(v *SearchExpression) *SearchInput { + s.SearchExpression = v + return s +} - // The Amazon Resource Name (ARN) of the notebook instance. - // - // NotebookInstanceArn is a required field - NotebookInstanceArn *string `type:"string" required:"true"` +// SetSortBy sets the SortBy field's value. +func (s *SearchInput) SetSortBy(v string) *SearchInput { + s.SortBy = &v + return s +} - // The name of a notebook instance lifecycle configuration associated with this - // notebook instance. - // - // For information about notebook instance lifestyle configurations, see Step - // 2.1: (Optional) Customize a Notebook Instance (https://docs.aws.amazon.com/sagemaker/latest/dg/notebook-lifecycle-config.html). - NotebookInstanceLifecycleConfigName *string `type:"string"` +// SetSortOrder sets the SortOrder field's value. +func (s *SearchInput) SetSortOrder(v string) *SearchInput { + s.SortOrder = &v + return s +} - // The name of the notebook instance that you want a summary for. - // - // NotebookInstanceName is a required field - NotebookInstanceName *string `type:"string" required:"true"` +type SearchOutput struct { + _ struct{} `type:"structure"` - // The status of the notebook instance. - NotebookInstanceStatus *string `type:"string" enum:"NotebookInstanceStatus"` + // If the result of the previous Search request was truncated, the response + // includes a NextToken. To retrieve the next set of results, use the token + // in the next request. + NextToken *string `type:"string"` - // The URL that you use to connect to the Jupyter instance running in your notebook - // instance. - Url *string `type:"string"` + // A list of SearchResult objects. + Results []*SearchRecord `type:"list"` } // String returns the string representation -func (s NotebookInstanceSummary) String() string { +func (s SearchOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s NotebookInstanceSummary) GoString() string { +func (s SearchOutput) GoString() string { return s.String() } -// SetAdditionalCodeRepositories sets the AdditionalCodeRepositories field's value. -func (s *NotebookInstanceSummary) SetAdditionalCodeRepositories(v []*string) *NotebookInstanceSummary { - s.AdditionalCodeRepositories = v +// SetNextToken sets the NextToken field's value. +func (s *SearchOutput) SetNextToken(v string) *SearchOutput { + s.NextToken = &v return s } -// SetCreationTime sets the CreationTime field's value. -func (s *NotebookInstanceSummary) SetCreationTime(v time.Time) *NotebookInstanceSummary { - s.CreationTime = &v +// SetResults sets the Results field's value. +func (s *SearchOutput) SetResults(v []*SearchRecord) *SearchOutput { + s.Results = v return s } -// SetDefaultCodeRepository sets the DefaultCodeRepository field's value. -func (s *NotebookInstanceSummary) SetDefaultCodeRepository(v string) *NotebookInstanceSummary { - s.DefaultCodeRepository = &v - return s -} +// An individual search result record that contains a single resource object. +type SearchRecord struct { + _ struct{} `type:"structure"` -// SetInstanceType sets the InstanceType field's value. -func (s *NotebookInstanceSummary) SetInstanceType(v string) *NotebookInstanceSummary { - s.InstanceType = &v - return s + // A summary of the properties of an experiment. + Experiment *Experiment `type:"structure"` + + // A TrainingJob object that is returned as part of a Search request. + TrainingJob *TrainingJob `type:"structure"` + + // A summary of the properties of a trial. + Trial *Trial `type:"structure"` + + // A summary of the properties of a trial component. + TrialComponent *TrialComponent `type:"structure"` } -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *NotebookInstanceSummary) SetLastModifiedTime(v time.Time) *NotebookInstanceSummary { - s.LastModifiedTime = &v - return s +// String returns the string representation +func (s SearchRecord) String() string { + return awsutil.Prettify(s) } -// SetNotebookInstanceArn sets the NotebookInstanceArn field's value. -func (s *NotebookInstanceSummary) SetNotebookInstanceArn(v string) *NotebookInstanceSummary { - s.NotebookInstanceArn = &v - return s +// GoString returns the string representation +func (s SearchRecord) GoString() string { + return s.String() } -// SetNotebookInstanceLifecycleConfigName sets the NotebookInstanceLifecycleConfigName field's value. -func (s *NotebookInstanceSummary) SetNotebookInstanceLifecycleConfigName(v string) *NotebookInstanceSummary { - s.NotebookInstanceLifecycleConfigName = &v +// SetExperiment sets the Experiment field's value. +func (s *SearchRecord) SetExperiment(v *Experiment) *SearchRecord { + s.Experiment = v return s } -// SetNotebookInstanceName sets the NotebookInstanceName field's value. -func (s *NotebookInstanceSummary) SetNotebookInstanceName(v string) *NotebookInstanceSummary { - s.NotebookInstanceName = &v +// SetTrainingJob sets the TrainingJob field's value. +func (s *SearchRecord) SetTrainingJob(v *TrainingJob) *SearchRecord { + s.TrainingJob = v return s } -// SetNotebookInstanceStatus sets the NotebookInstanceStatus field's value. -func (s *NotebookInstanceSummary) SetNotebookInstanceStatus(v string) *NotebookInstanceSummary { - s.NotebookInstanceStatus = &v +// SetTrial sets the Trial field's value. +func (s *SearchRecord) SetTrial(v *Trial) *SearchRecord { + s.Trial = v return s } -// SetUrl sets the Url field's value. -func (s *NotebookInstanceSummary) SetUrl(v string) *NotebookInstanceSummary { - s.Url = &v +// SetTrialComponent sets the TrialComponent field's value. +func (s *SearchRecord) SetTrialComponent(v *TrialComponent) *SearchRecord { + s.TrialComponent = v return s } -// Configures SNS notifications of available or expiring work items for work -// teams. -type NotificationConfiguration struct { +// An array element of DescribeTrainingJobResponse$SecondaryStatusTransitions. +// It provides additional details about a status that the training job has transitioned +// through. A training job can be in one of several states, for example, starting, +// downloading, training, or uploading. Within each state, there are a number +// of intermediate states. For example, within the starting state, Amazon SageMaker +// could be starting the training job or launching the ML instances. These transitional +// states are referred to as the job's secondary status. +type SecondaryStatusTransition struct { _ struct{} `type:"structure"` - // The ARN for the SNS topic to which notifications should be published. - NotificationTopicArn *string `type:"string"` + // A timestamp that shows when the training job transitioned out of this secondary + // status state into another secondary status state or when the training job + // has ended. + EndTime *time.Time `type:"timestamp"` + + // A timestamp that shows when the training job transitioned to the current + // secondary status state. + // + // StartTime is a required field + StartTime *time.Time `type:"timestamp" required:"true"` + + // Contains a secondary status information from a training job. + // + // Status might be one of the following secondary statuses: + // + // InProgress + // + // * Starting - Starting the training job. + // + // * Downloading - An optional stage for algorithms that support File training + // input mode. It indicates that data is being downloaded to the ML storage + // volumes. + // + // * Training - Training is in progress. + // + // * Uploading - Training is complete and the model artifacts are being uploaded + // to the S3 location. + // + // Completed + // + // * Completed - The training job has completed. + // + // Failed + // + // * Failed - The training job has failed. The reason for the failure is + // returned in the FailureReason field of DescribeTrainingJobResponse. + // + // Stopped + // + // * MaxRuntimeExceeded - The job stopped because it exceeded the maximum + // allowed runtime. + // + // * Stopped - The training job has stopped. + // + // Stopping + // + // * Stopping - Stopping the training job. + // + // We no longer support the following secondary statuses: + // + // * LaunchingMLInstances + // + // * PreparingTrainingStack + // + // * DownloadingTrainingImage + // + // Status is a required field + Status *string `type:"string" required:"true" enum:"SecondaryStatus"` + + // A detailed description of the progress within a secondary status. + // + // Amazon SageMaker provides secondary statuses and status messages that apply + // to each of them: + // + // Starting + // + // * Starting the training job. + // + // * Launching requested ML instances. + // + // * Insufficient capacity error from EC2 while launching instances, retrying! + // + // * Launched instance was unhealthy, replacing it! + // + // * Preparing the instances for training. + // + // Training + // + // * Downloading the training image. + // + // * Training image download completed. Training in progress. + // + // Status messages are subject to change. Therefore, we recommend not including + // them in code that programmatically initiates actions. For examples, don't + // use status messages in if statements. + // + // To have an overview of your training job's progress, view TrainingJobStatus + // and SecondaryStatus in DescribeTrainingJob, and StatusMessage together. For + // example, at the start of a training job, you might see the following: + // + // * TrainingJobStatus - InProgress + // + // * SecondaryStatus - Training + // + // * StatusMessage - Downloading the training image + StatusMessage *string `type:"string"` } // String returns the string representation -func (s NotificationConfiguration) String() string { +func (s SecondaryStatusTransition) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s NotificationConfiguration) GoString() string { +func (s SecondaryStatusTransition) GoString() string { return s.String() } -// SetNotificationTopicArn sets the NotificationTopicArn field's value. -func (s *NotificationConfiguration) SetNotificationTopicArn(v string) *NotificationConfiguration { - s.NotificationTopicArn = &v +// SetEndTime sets the EndTime field's value. +func (s *SecondaryStatusTransition) SetEndTime(v time.Time) *SecondaryStatusTransition { + s.EndTime = &v return s } -// Specifies the number of training jobs that this hyperparameter tuning job -// launched, categorized by the status of their objective metric. The objective -// metric status shows whether the final objective metric for the training job -// has been evaluated by the tuning job and used in the hyperparameter tuning -// process. -type ObjectiveStatusCounters struct { +// SetStartTime sets the StartTime field's value. +func (s *SecondaryStatusTransition) SetStartTime(v time.Time) *SecondaryStatusTransition { + s.StartTime = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *SecondaryStatusTransition) SetStatus(v string) *SecondaryStatusTransition { + s.Status = &v + return s +} + +// SetStatusMessage sets the StatusMessage field's value. +func (s *SecondaryStatusTransition) SetStatusMessage(v string) *SecondaryStatusTransition { + s.StatusMessage = &v + return s +} + +// The sharing settings. +type SharingSettings struct { _ struct{} `type:"structure"` - // The number of training jobs whose final objective metric was not evaluated - // and used in the hyperparameter tuning process. This typically occurs when - // the training job failed or did not emit an objective metric. - Failed *int64 `type:"integer"` + // The notebook output option. + NotebookOutputOption *string `type:"string" enum:"NotebookOutputOption"` - // The number of training jobs that are in progress and pending evaluation of - // their final objective metric. - Pending *int64 `type:"integer"` + // The AWS Key Management Service encryption key ID. + S3KmsKeyId *string `type:"string"` - // The number of training jobs whose final objective metric was evaluated by - // the hyperparameter tuning job and used in the hyperparameter tuning process. - Succeeded *int64 `type:"integer"` + // The Amazon S3 output path. + S3OutputPath *string `type:"string"` } // String returns the string representation -func (s ObjectiveStatusCounters) String() string { +func (s SharingSettings) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ObjectiveStatusCounters) GoString() string { +func (s SharingSettings) GoString() string { return s.String() } -// SetFailed sets the Failed field's value. -func (s *ObjectiveStatusCounters) SetFailed(v int64) *ObjectiveStatusCounters { - s.Failed = &v +// SetNotebookOutputOption sets the NotebookOutputOption field's value. +func (s *SharingSettings) SetNotebookOutputOption(v string) *SharingSettings { + s.NotebookOutputOption = &v return s } -// SetPending sets the Pending field's value. -func (s *ObjectiveStatusCounters) SetPending(v int64) *ObjectiveStatusCounters { - s.Pending = &v +// SetS3KmsKeyId sets the S3KmsKeyId field's value. +func (s *SharingSettings) SetS3KmsKeyId(v string) *SharingSettings { + s.S3KmsKeyId = &v return s } -// SetSucceeded sets the Succeeded field's value. -func (s *ObjectiveStatusCounters) SetSucceeded(v int64) *ObjectiveStatusCounters { - s.Succeeded = &v +// SetS3OutputPath sets the S3OutputPath field's value. +func (s *SharingSettings) SetS3OutputPath(v string) *SharingSettings { + s.S3OutputPath = &v return s } -// Contains information about the output location for the compiled model and -// the device (target) that the model runs on. -type OutputConfig struct { +// A configuration for a shuffle option for input data in a channel. If you +// use S3Prefix for S3DataType, the results of the S3 key prefix matches are +// shuffled. If you use ManifestFile, the order of the S3 object references +// in the ManifestFile is shuffled. If you use AugmentedManifestFile, the order +// of the JSON lines in the AugmentedManifestFile is shuffled. The shuffling +// order is determined using the Seed value. +// +// For Pipe input mode, when ShuffleConfig is specified shuffling is done at +// the start of every epoch. With large datasets, this ensures that the order +// of the training data is different for each epoch, and it helps reduce bias +// and possible overfitting. In a multi-node training job when ShuffleConfig +// is combined with S3DataDistributionType of ShardedByS3Key, the data is shuffled +// across nodes so that the content sent to a particular node on the first epoch +// might be sent to a different node on the second epoch. +type ShuffleConfig struct { _ struct{} `type:"structure"` - // Identifies the S3 path where you want Amazon SageMaker to store the model - // artifacts. For example, s3://bucket-name/key-name-prefix. - // - // S3OutputLocation is a required field - S3OutputLocation *string `type:"string" required:"true"` - - // Identifies the device that you want to run your model on after it has been - // compiled. For example: ml_c5. + // Determines the shuffling order in ShuffleConfig value. // - // TargetDevice is a required field - TargetDevice *string `type:"string" required:"true" enum:"TargetDevice"` + // Seed is a required field + Seed *int64 `type:"long" required:"true"` } // String returns the string representation -func (s OutputConfig) String() string { +func (s ShuffleConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s OutputConfig) GoString() string { +func (s ShuffleConfig) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *OutputConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OutputConfig"} - if s.S3OutputLocation == nil { - invalidParams.Add(request.NewErrParamRequired("S3OutputLocation")) - } - if s.TargetDevice == nil { - invalidParams.Add(request.NewErrParamRequired("TargetDevice")) +func (s *ShuffleConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ShuffleConfig"} + if s.Seed == nil { + invalidParams.Add(request.NewErrParamRequired("Seed")) } if invalidParams.Len() > 0 { @@ -21354,72 +40265,49 @@ func (s *OutputConfig) Validate() error { return nil } -// SetS3OutputLocation sets the S3OutputLocation field's value. -func (s *OutputConfig) SetS3OutputLocation(v string) *OutputConfig { - s.S3OutputLocation = &v - return s -} - -// SetTargetDevice sets the TargetDevice field's value. -func (s *OutputConfig) SetTargetDevice(v string) *OutputConfig { - s.TargetDevice = &v +// SetSeed sets the Seed field's value. +func (s *ShuffleConfig) SetSeed(v int64) *ShuffleConfig { + s.Seed = &v return s } -// Provides information about how to store model training results (model artifacts). -type OutputDataConfig struct { +// Specifies an algorithm that was used to create the model package. The algorithm +// must be either an algorithm resource in your Amazon SageMaker account or +// an algorithm in AWS Marketplace that you are subscribed to. +type SourceAlgorithm struct { _ struct{} `type:"structure"` - // The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to - // encrypt the model artifacts at rest using Amazon S3 server-side encryption. - // The KmsKeyId can be any of the following formats: - // - // * // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab" - // - // * // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" - // - // * // KMS Key Alias "alias/ExampleAlias" - // - // * // Amazon Resource Name (ARN) of a KMS Key Alias "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias" - // - // If you use a KMS key ID or an alias of your master key, the Amazon SageMaker - // execution role must include permissions to call kms:Encrypt. If you don't - // provide a KMS key ID, Amazon SageMaker uses the default KMS key for Amazon - // S3 for your role's account. Amazon SageMaker uses server-side encryption - // with KMS-managed keys for OutputDataConfig. If you use a bucket policy with - // an s3:PutObject permission that only allows objects with server-side encryption, - // set the condition key of s3:x-amz-server-side-encryption to "aws:kms". For - // more information, see KMS-Managed Encryption Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) - // in the Amazon Simple Storage Service Developer Guide. + // The name of an algorithm that was used to create the model package. The algorithm + // must be either an algorithm resource in your Amazon SageMaker account or + // an algorithm in AWS Marketplace that you are subscribed to. // - // The KMS key policy must grant permission to the IAM role that you specify - // in your CreateTrainingJob, CreateTransformJob, or CreateHyperParameterTuningJob - // requests. For more information, see Using Key Policies in AWS KMS (https://docs.aws.amazon.com/http:/docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) - // in the AWS Key Management Service Developer Guide. - KmsKeyId *string `type:"string"` + // AlgorithmName is a required field + AlgorithmName *string `min:"1" type:"string" required:"true"` - // Identifies the S3 path where you want Amazon SageMaker to store the model - // artifacts. For example, s3://bucket-name/key-name-prefix. - // - // S3OutputPath is a required field - S3OutputPath *string `type:"string" required:"true"` + // The Amazon S3 path where the model artifacts, which result from model training, + // are stored. This path must point to a single gzip compressed tar archive + // (.tar.gz suffix). + ModelDataUrl *string `type:"string"` } // String returns the string representation -func (s OutputDataConfig) String() string { +func (s SourceAlgorithm) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s OutputDataConfig) GoString() string { +func (s SourceAlgorithm) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *OutputDataConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OutputDataConfig"} - if s.S3OutputPath == nil { - invalidParams.Add(request.NewErrParamRequired("S3OutputPath")) +func (s *SourceAlgorithm) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SourceAlgorithm"} + if s.AlgorithmName == nil { + invalidParams.Add(request.NewErrParamRequired("AlgorithmName")) + } + if s.AlgorithmName != nil && len(*s.AlgorithmName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AlgorithmName", 1)) } if invalidParams.Len() > 0 { @@ -21428,62 +40316,55 @@ func (s *OutputDataConfig) Validate() error { return nil } -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *OutputDataConfig) SetKmsKeyId(v string) *OutputDataConfig { - s.KmsKeyId = &v +// SetAlgorithmName sets the AlgorithmName field's value. +func (s *SourceAlgorithm) SetAlgorithmName(v string) *SourceAlgorithm { + s.AlgorithmName = &v return s } -// SetS3OutputPath sets the S3OutputPath field's value. -func (s *OutputDataConfig) SetS3OutputPath(v string) *OutputDataConfig { - s.S3OutputPath = &v +// SetModelDataUrl sets the ModelDataUrl field's value. +func (s *SourceAlgorithm) SetModelDataUrl(v string) *SourceAlgorithm { + s.ModelDataUrl = &v return s } -// Defines the possible values for categorical, continuous, and integer hyperparameters -// to be used by an algorithm. -type ParameterRange struct { +// A list of algorithms that were used to create a model package. +type SourceAlgorithmSpecification struct { _ struct{} `type:"structure"` - // A CategoricalParameterRangeSpecification object that defines the possible - // values for a categorical hyperparameter. - CategoricalParameterRangeSpecification *CategoricalParameterRangeSpecification `type:"structure"` - - // A ContinuousParameterRangeSpecification object that defines the possible - // values for a continuous hyperparameter. - ContinuousParameterRangeSpecification *ContinuousParameterRangeSpecification `type:"structure"` - - // A IntegerParameterRangeSpecification object that defines the possible values - // for an integer hyperparameter. - IntegerParameterRangeSpecification *IntegerParameterRangeSpecification `type:"structure"` + // A list of the algorithms that were used to create a model package. + // + // SourceAlgorithms is a required field + SourceAlgorithms []*SourceAlgorithm `min:"1" type:"list" required:"true"` } // String returns the string representation -func (s ParameterRange) String() string { +func (s SourceAlgorithmSpecification) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ParameterRange) GoString() string { +func (s SourceAlgorithmSpecification) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ParameterRange) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ParameterRange"} - if s.CategoricalParameterRangeSpecification != nil { - if err := s.CategoricalParameterRangeSpecification.Validate(); err != nil { - invalidParams.AddNested("CategoricalParameterRangeSpecification", err.(request.ErrInvalidParams)) - } +func (s *SourceAlgorithmSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SourceAlgorithmSpecification"} + if s.SourceAlgorithms == nil { + invalidParams.Add(request.NewErrParamRequired("SourceAlgorithms")) } - if s.ContinuousParameterRangeSpecification != nil { - if err := s.ContinuousParameterRangeSpecification.Validate(); err != nil { - invalidParams.AddNested("ContinuousParameterRangeSpecification", err.(request.ErrInvalidParams)) - } + if s.SourceAlgorithms != nil && len(s.SourceAlgorithms) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SourceAlgorithms", 1)) } - if s.IntegerParameterRangeSpecification != nil { - if err := s.IntegerParameterRangeSpecification.Validate(); err != nil { - invalidParams.AddNested("IntegerParameterRangeSpecification", err.(request.ErrInvalidParams)) + if s.SourceAlgorithms != nil { + for i, v := range s.SourceAlgorithms { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SourceAlgorithms", i), err.(request.ErrInvalidParams)) + } } } @@ -21493,92 +40374,86 @@ func (s *ParameterRange) Validate() error { return nil } -// SetCategoricalParameterRangeSpecification sets the CategoricalParameterRangeSpecification field's value. -func (s *ParameterRange) SetCategoricalParameterRangeSpecification(v *CategoricalParameterRangeSpecification) *ParameterRange { - s.CategoricalParameterRangeSpecification = v +// SetSourceAlgorithms sets the SourceAlgorithms field's value. +func (s *SourceAlgorithmSpecification) SetSourceAlgorithms(v []*SourceAlgorithm) *SourceAlgorithmSpecification { + s.SourceAlgorithms = v return s } -// SetContinuousParameterRangeSpecification sets the ContinuousParameterRangeSpecification field's value. -func (s *ParameterRange) SetContinuousParameterRangeSpecification(v *ContinuousParameterRangeSpecification) *ParameterRange { - s.ContinuousParameterRangeSpecification = v - return s +// A list of IP address ranges (CIDRs (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html)). +// Used to create an allow list of IP addresses for a private workforce. For +// more information, see . +type SourceIpConfig struct { + _ struct{} `type:"structure"` + + // A list of one to four Classless Inter-Domain Routing (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html) + // (CIDR) values. + // + // Maximum: Four CIDR values + // + // The following Length Constraints apply to individual CIDR values in the CIDR + // value list. + // + // Cidrs is a required field + Cidrs []*string `type:"list" required:"true"` } -// SetIntegerParameterRangeSpecification sets the IntegerParameterRangeSpecification field's value. -func (s *ParameterRange) SetIntegerParameterRangeSpecification(v *IntegerParameterRangeSpecification) *ParameterRange { - s.IntegerParameterRangeSpecification = v - return s +// String returns the string representation +func (s SourceIpConfig) String() string { + return awsutil.Prettify(s) } -// Specifies ranges of integer, continuous, and categorical hyperparameters -// that a hyperparameter tuning job searches. The hyperparameter tuning job -// launches training jobs with hyperparameter values within these ranges to -// find the combination of values that result in the training job with the best -// performance as measured by the objective metric of the hyperparameter tuning -// job. -// -// You can specify a maximum of 20 hyperparameters that a hyperparameter tuning -// job can search over. Every possible value of a categorical parameter range -// counts against this limit. -type ParameterRanges struct { - _ struct{} `type:"structure"` +// GoString returns the string representation +func (s SourceIpConfig) GoString() string { + return s.String() +} - // The array of CategoricalParameterRange objects that specify ranges of categorical - // hyperparameters that a hyperparameter tuning job searches. - CategoricalParameterRanges []*CategoricalParameterRange `type:"list"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *SourceIpConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SourceIpConfig"} + if s.Cidrs == nil { + invalidParams.Add(request.NewErrParamRequired("Cidrs")) + } - // The array of ContinuousParameterRange objects that specify ranges of continuous - // hyperparameters that a hyperparameter tuning job searches. - ContinuousParameterRanges []*ContinuousParameterRange `type:"list"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // The array of IntegerParameterRange objects that specify ranges of integer - // hyperparameters that a hyperparameter tuning job searches. - IntegerParameterRanges []*IntegerParameterRange `type:"list"` +// SetCidrs sets the Cidrs field's value. +func (s *SourceIpConfig) SetCidrs(v []*string) *SourceIpConfig { + s.Cidrs = v + return s +} + +type StartMonitoringScheduleInput struct { + _ struct{} `type:"structure"` + + // The name of the schedule to start. + // + // MonitoringScheduleName is a required field + MonitoringScheduleName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s ParameterRanges) String() string { +func (s StartMonitoringScheduleInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ParameterRanges) GoString() string { +func (s StartMonitoringScheduleInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ParameterRanges) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ParameterRanges"} - if s.CategoricalParameterRanges != nil { - for i, v := range s.CategoricalParameterRanges { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CategoricalParameterRanges", i), err.(request.ErrInvalidParams)) - } - } - } - if s.ContinuousParameterRanges != nil { - for i, v := range s.ContinuousParameterRanges { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ContinuousParameterRanges", i), err.(request.ErrInvalidParams)) - } - } +func (s *StartMonitoringScheduleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartMonitoringScheduleInput"} + if s.MonitoringScheduleName == nil { + invalidParams.Add(request.NewErrParamRequired("MonitoringScheduleName")) } - if s.IntegerParameterRanges != nil { - for i, v := range s.IntegerParameterRanges { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "IntegerParameterRanges", i), err.(request.ErrInvalidParams)) - } - } + if s.MonitoringScheduleName != nil && len(*s.MonitoringScheduleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MonitoringScheduleName", 1)) } if invalidParams.Len() > 0 { @@ -21587,49 +40462,50 @@ func (s *ParameterRanges) Validate() error { return nil } -// SetCategoricalParameterRanges sets the CategoricalParameterRanges field's value. -func (s *ParameterRanges) SetCategoricalParameterRanges(v []*CategoricalParameterRange) *ParameterRanges { - s.CategoricalParameterRanges = v +// SetMonitoringScheduleName sets the MonitoringScheduleName field's value. +func (s *StartMonitoringScheduleInput) SetMonitoringScheduleName(v string) *StartMonitoringScheduleInput { + s.MonitoringScheduleName = &v return s } -// SetContinuousParameterRanges sets the ContinuousParameterRanges field's value. -func (s *ParameterRanges) SetContinuousParameterRanges(v []*ContinuousParameterRange) *ParameterRanges { - s.ContinuousParameterRanges = v - return s +type StartMonitoringScheduleOutput struct { + _ struct{} `type:"structure"` } -// SetIntegerParameterRanges sets the IntegerParameterRanges field's value. -func (s *ParameterRanges) SetIntegerParameterRanges(v []*IntegerParameterRange) *ParameterRanges { - s.IntegerParameterRanges = v - return s +// String returns the string representation +func (s StartMonitoringScheduleOutput) String() string { + return awsutil.Prettify(s) } -// A previously completed or stopped hyperparameter tuning job to be used as -// a starting point for a new hyperparameter tuning job. -type ParentHyperParameterTuningJob struct { +// GoString returns the string representation +func (s StartMonitoringScheduleOutput) GoString() string { + return s.String() +} + +type StartNotebookInstanceInput struct { _ struct{} `type:"structure"` - // The name of the hyperparameter tuning job to be used as a starting point - // for a new hyperparameter tuning job. - HyperParameterTuningJobName *string `min:"1" type:"string"` + // The name of the notebook instance to start. + // + // NotebookInstanceName is a required field + NotebookInstanceName *string `type:"string" required:"true"` } // String returns the string representation -func (s ParentHyperParameterTuningJob) String() string { +func (s StartNotebookInstanceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ParentHyperParameterTuningJob) GoString() string { +func (s StartNotebookInstanceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ParentHyperParameterTuningJob) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ParentHyperParameterTuningJob"} - if s.HyperParameterTuningJobName != nil && len(*s.HyperParameterTuningJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("HyperParameterTuningJobName", 1)) +func (s *StartNotebookInstanceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartNotebookInstanceInput"} + if s.NotebookInstanceName == nil { + invalidParams.Add(request.NewErrParamRequired("NotebookInstanceName")) } if invalidParams.Len() > 0 { @@ -21638,78 +40514,53 @@ func (s *ParentHyperParameterTuningJob) Validate() error { return nil } -// SetHyperParameterTuningJobName sets the HyperParameterTuningJobName field's value. -func (s *ParentHyperParameterTuningJob) SetHyperParameterTuningJobName(v string) *ParentHyperParameterTuningJob { - s.HyperParameterTuningJobName = &v +// SetNotebookInstanceName sets the NotebookInstanceName field's value. +func (s *StartNotebookInstanceInput) SetNotebookInstanceName(v string) *StartNotebookInstanceInput { + s.NotebookInstanceName = &v return s } -// Identifies a model that you want to host and the resources to deploy for -// hosting it. If you are deploying multiple models, tell Amazon SageMaker how -// to distribute traffic among the models by specifying variant weights. -type ProductionVariant struct { +type StartNotebookInstanceOutput struct { _ struct{} `type:"structure"` +} - // The size of the Elastic Inference (EI) instance to use for the production - // variant. EI instances provide on-demand GPU computing for inference. For - // more information, see Using Elastic Inference in Amazon SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html). - AcceleratorType *string `type:"string" enum:"ProductionVariantAcceleratorType"` - - // Number of instances to launch initially. - // - // InitialInstanceCount is a required field - InitialInstanceCount *int64 `min:"1" type:"integer" required:"true"` - - // Determines initial traffic distribution among all of the models that you - // specify in the endpoint configuration. The traffic to a production variant - // is determined by the ratio of the VariantWeight to the sum of all VariantWeight - // values across all ProductionVariants. If unspecified, it defaults to 1.0. - InitialVariantWeight *float64 `type:"float"` +// String returns the string representation +func (s StartNotebookInstanceOutput) String() string { + return awsutil.Prettify(s) +} - // The ML compute instance type. - // - // InstanceType is a required field - InstanceType *string `type:"string" required:"true" enum:"ProductionVariantInstanceType"` +// GoString returns the string representation +func (s StartNotebookInstanceOutput) GoString() string { + return s.String() +} - // The name of the model that you want to host. This is the name that you specified - // when creating the model. - // - // ModelName is a required field - ModelName *string `type:"string" required:"true"` +type StopAutoMLJobInput struct { + _ struct{} `type:"structure"` - // The name of the production variant. + // The name of the object you are requesting. // - // VariantName is a required field - VariantName *string `type:"string" required:"true"` + // AutoMLJobName is a required field + AutoMLJobName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s ProductionVariant) String() string { +func (s StopAutoMLJobInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ProductionVariant) GoString() string { +func (s StopAutoMLJobInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ProductionVariant) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ProductionVariant"} - if s.InitialInstanceCount == nil { - invalidParams.Add(request.NewErrParamRequired("InitialInstanceCount")) - } - if s.InitialInstanceCount != nil && *s.InitialInstanceCount < 1 { - invalidParams.Add(request.NewErrParamMinValue("InitialInstanceCount", 1)) - } - if s.InstanceType == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceType")) +func (s *StopAutoMLJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopAutoMLJobInput"} + if s.AutoMLJobName == nil { + invalidParams.Add(request.NewErrParamRequired("AutoMLJobName")) } - if s.ModelName == nil { - invalidParams.Add(request.NewErrParamRequired("ModelName")) - } - if s.VariantName == nil { - invalidParams.Add(request.NewErrParamRequired("VariantName")) + if s.AutoMLJobName != nil && len(*s.AutoMLJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AutoMLJobName", 1)) } if invalidParams.Len() > 0 { @@ -21718,146 +40569,108 @@ func (s *ProductionVariant) Validate() error { return nil } -// SetAcceleratorType sets the AcceleratorType field's value. -func (s *ProductionVariant) SetAcceleratorType(v string) *ProductionVariant { - s.AcceleratorType = &v - return s -} - -// SetInitialInstanceCount sets the InitialInstanceCount field's value. -func (s *ProductionVariant) SetInitialInstanceCount(v int64) *ProductionVariant { - s.InitialInstanceCount = &v - return s -} - -// SetInitialVariantWeight sets the InitialVariantWeight field's value. -func (s *ProductionVariant) SetInitialVariantWeight(v float64) *ProductionVariant { - s.InitialVariantWeight = &v +// SetAutoMLJobName sets the AutoMLJobName field's value. +func (s *StopAutoMLJobInput) SetAutoMLJobName(v string) *StopAutoMLJobInput { + s.AutoMLJobName = &v return s } -// SetInstanceType sets the InstanceType field's value. -func (s *ProductionVariant) SetInstanceType(v string) *ProductionVariant { - s.InstanceType = &v - return s +type StopAutoMLJobOutput struct { + _ struct{} `type:"structure"` } -// SetModelName sets the ModelName field's value. -func (s *ProductionVariant) SetModelName(v string) *ProductionVariant { - s.ModelName = &v - return s +// String returns the string representation +func (s StopAutoMLJobOutput) String() string { + return awsutil.Prettify(s) } -// SetVariantName sets the VariantName field's value. -func (s *ProductionVariant) SetVariantName(v string) *ProductionVariant { - s.VariantName = &v - return s +// GoString returns the string representation +func (s StopAutoMLJobOutput) GoString() string { + return s.String() } -// Describes weight and capacities for a production variant associated with -// an endpoint. If you sent a request to the UpdateEndpointWeightsAndCapacities -// API and the endpoint status is Updating, you get different desired and current -// values. -type ProductionVariantSummary struct { +type StopCompilationJobInput struct { _ struct{} `type:"structure"` - // The number of instances associated with the variant. - CurrentInstanceCount *int64 `min:"1" type:"integer"` - - // The weight associated with the variant. - CurrentWeight *float64 `type:"float"` - - // An array of DeployedImage objects that specify the Amazon EC2 Container Registry - // paths of the inference images deployed on instances of this ProductionVariant. - DeployedImages []*DeployedImage `type:"list"` - - // The number of instances requested in the UpdateEndpointWeightsAndCapacities - // request. - DesiredInstanceCount *int64 `min:"1" type:"integer"` - - // The requested weight, as specified in the UpdateEndpointWeightsAndCapacities - // request. - DesiredWeight *float64 `type:"float"` - - // The name of the variant. + // The name of the model compilation job to stop. // - // VariantName is a required field - VariantName *string `type:"string" required:"true"` + // CompilationJobName is a required field + CompilationJobName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s ProductionVariantSummary) String() string { +func (s StopCompilationJobInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ProductionVariantSummary) GoString() string { +func (s StopCompilationJobInput) GoString() string { return s.String() } -// SetCurrentInstanceCount sets the CurrentInstanceCount field's value. -func (s *ProductionVariantSummary) SetCurrentInstanceCount(v int64) *ProductionVariantSummary { - s.CurrentInstanceCount = &v - return s -} +// Validate inspects the fields of the type to determine if they are valid. +func (s *StopCompilationJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopCompilationJobInput"} + if s.CompilationJobName == nil { + invalidParams.Add(request.NewErrParamRequired("CompilationJobName")) + } + if s.CompilationJobName != nil && len(*s.CompilationJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CompilationJobName", 1)) + } -// SetCurrentWeight sets the CurrentWeight field's value. -func (s *ProductionVariantSummary) SetCurrentWeight(v float64) *ProductionVariantSummary { - s.CurrentWeight = &v - return s + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetDeployedImages sets the DeployedImages field's value. -func (s *ProductionVariantSummary) SetDeployedImages(v []*DeployedImage) *ProductionVariantSummary { - s.DeployedImages = v +// SetCompilationJobName sets the CompilationJobName field's value. +func (s *StopCompilationJobInput) SetCompilationJobName(v string) *StopCompilationJobInput { + s.CompilationJobName = &v return s } -// SetDesiredInstanceCount sets the DesiredInstanceCount field's value. -func (s *ProductionVariantSummary) SetDesiredInstanceCount(v int64) *ProductionVariantSummary { - s.DesiredInstanceCount = &v - return s +type StopCompilationJobOutput struct { + _ struct{} `type:"structure"` } -// SetDesiredWeight sets the DesiredWeight field's value. -func (s *ProductionVariantSummary) SetDesiredWeight(v float64) *ProductionVariantSummary { - s.DesiredWeight = &v - return s +// String returns the string representation +func (s StopCompilationJobOutput) String() string { + return awsutil.Prettify(s) } -// SetVariantName sets the VariantName field's value. -func (s *ProductionVariantSummary) SetVariantName(v string) *ProductionVariantSummary { - s.VariantName = &v - return s +// GoString returns the string representation +func (s StopCompilationJobOutput) GoString() string { + return s.String() } -// A type of SuggestionQuery. A suggestion query for retrieving property names -// that match the specified hint. -type PropertyNameQuery struct { +type StopHyperParameterTuningJobInput struct { _ struct{} `type:"structure"` - // Text that is part of a property's name. The property names of hyperparameter, - // metric, and tag key names that begin with the specified text in the PropertyNameHint. + // The name of the tuning job to stop. // - // PropertyNameHint is a required field - PropertyNameHint *string `type:"string" required:"true"` + // HyperParameterTuningJobName is a required field + HyperParameterTuningJobName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s PropertyNameQuery) String() string { +func (s StopHyperParameterTuningJobInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PropertyNameQuery) GoString() string { +func (s StopHyperParameterTuningJobInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *PropertyNameQuery) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PropertyNameQuery"} - if s.PropertyNameHint == nil { - invalidParams.Add(request.NewErrParamRequired("PropertyNameHint")) +func (s *StopHyperParameterTuningJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopHyperParameterTuningJobInput"} + if s.HyperParameterTuningJobName == nil { + invalidParams.Add(request.NewErrParamRequired("HyperParameterTuningJobName")) + } + if s.HyperParameterTuningJobName != nil && len(*s.HyperParameterTuningJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("HyperParameterTuningJobName", 1)) } if invalidParams.Len() > 0 { @@ -21866,196 +40679,108 @@ func (s *PropertyNameQuery) Validate() error { return nil } -// SetPropertyNameHint sets the PropertyNameHint field's value. -func (s *PropertyNameQuery) SetPropertyNameHint(v string) *PropertyNameQuery { - s.PropertyNameHint = &v +// SetHyperParameterTuningJobName sets the HyperParameterTuningJobName field's value. +func (s *StopHyperParameterTuningJobInput) SetHyperParameterTuningJobName(v string) *StopHyperParameterTuningJobInput { + s.HyperParameterTuningJobName = &v return s } -// A property name returned from a GetSearchSuggestions call that specifies -// a value in the PropertyNameQuery field. -type PropertyNameSuggestion struct { +type StopHyperParameterTuningJobOutput struct { _ struct{} `type:"structure"` - - // A suggested property name based on what you entered in the search textbox - // in the Amazon SageMaker console. - PropertyName *string `min:"1" type:"string"` } // String returns the string representation -func (s PropertyNameSuggestion) String() string { +func (s StopHyperParameterTuningJobOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PropertyNameSuggestion) GoString() string { +func (s StopHyperParameterTuningJobOutput) GoString() string { return s.String() } -// SetPropertyName sets the PropertyName field's value. -func (s *PropertyNameSuggestion) SetPropertyName(v string) *PropertyNameSuggestion { - s.PropertyName = &v - return s -} - -// Defines the amount of money paid to an Amazon Mechanical Turk worker for -// each task performed. -// -// Use one of the following prices for bounding box tasks. Prices are in US -// dollars and should be based on the complexity of the task; the longer it -// takes in your initial testing, the more you should offer. -// -// * 0.036 -// -// * 0.048 -// -// * 0.060 -// -// * 0.072 -// -// * 0.120 -// -// * 0.240 -// -// * 0.360 -// -// * 0.480 -// -// * 0.600 -// -// * 0.720 -// -// * 0.840 -// -// * 0.960 -// -// * 1.080 -// -// * 1.200 -// -// Use one of the following prices for image classification, text classification, -// and custom tasks. Prices are in US dollars. -// -// * 0.012 -// -// * 0.024 -// -// * 0.036 -// -// * 0.048 -// -// * 0.060 -// -// * 0.072 -// -// * 0.120 -// -// * 0.240 -// -// * 0.360 -// -// * 0.480 -// -// * 0.600 -// -// * 0.720 -// -// * 0.840 -// -// * 0.960 -// -// * 1.080 -// -// * 1.200 -// -// Use one of the following prices for semantic segmentation tasks. Prices are -// in US dollars. -// -// * 0.840 -// -// * 0.960 -// -// * 1.080 -// -// * 1.200 -type PublicWorkforceTaskPrice struct { +type StopLabelingJobInput struct { _ struct{} `type:"structure"` - // Defines the amount of money paid to an Amazon Mechanical Turk worker in United - // States dollars. - AmountInUsd *USD `type:"structure"` + // The name of the labeling job to stop. + // + // LabelingJobName is a required field + LabelingJobName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s PublicWorkforceTaskPrice) String() string { +func (s StopLabelingJobInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s PublicWorkforceTaskPrice) GoString() string { +func (s StopLabelingJobInput) GoString() string { return s.String() } -// SetAmountInUsd sets the AmountInUsd field's value. -func (s *PublicWorkforceTaskPrice) SetAmountInUsd(v *USD) *PublicWorkforceTaskPrice { - s.AmountInUsd = v +// Validate inspects the fields of the type to determine if they are valid. +func (s *StopLabelingJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopLabelingJobInput"} + if s.LabelingJobName == nil { + invalidParams.Add(request.NewErrParamRequired("LabelingJobName")) + } + if s.LabelingJobName != nil && len(*s.LabelingJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LabelingJobName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLabelingJobName sets the LabelingJobName field's value. +func (s *StopLabelingJobInput) SetLabelingJobName(v string) *StopLabelingJobInput { + s.LabelingJobName = &v return s } -type RenderUiTemplateInput struct { +type StopLabelingJobOutput struct { _ struct{} `type:"structure"` +} - // The Amazon Resource Name (ARN) that has access to the S3 objects that are - // used by the template. - // - // RoleArn is a required field - RoleArn *string `min:"20" type:"string" required:"true"` +// String returns the string representation +func (s StopLabelingJobOutput) String() string { + return awsutil.Prettify(s) +} - // A RenderableTask object containing a representative task to render. - // - // Task is a required field - Task *RenderableTask `type:"structure" required:"true"` +// GoString returns the string representation +func (s StopLabelingJobOutput) GoString() string { + return s.String() +} - // A Template object containing the worker UI template to render. +type StopMonitoringScheduleInput struct { + _ struct{} `type:"structure"` + + // The name of the schedule to stop. // - // UiTemplate is a required field - UiTemplate *UiTemplate `type:"structure" required:"true"` + // MonitoringScheduleName is a required field + MonitoringScheduleName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s RenderUiTemplateInput) String() string { +func (s StopMonitoringScheduleInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RenderUiTemplateInput) GoString() string { +func (s StopMonitoringScheduleInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *RenderUiTemplateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RenderUiTemplateInput"} - if s.RoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("RoleArn")) - } - if s.RoleArn != nil && len(*s.RoleArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("RoleArn", 20)) - } - if s.Task == nil { - invalidParams.Add(request.NewErrParamRequired("Task")) - } - if s.UiTemplate == nil { - invalidParams.Add(request.NewErrParamRequired("UiTemplate")) - } - if s.Task != nil { - if err := s.Task.Validate(); err != nil { - invalidParams.AddNested("Task", err.(request.ErrInvalidParams)) - } +func (s *StopMonitoringScheduleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopMonitoringScheduleInput"} + if s.MonitoringScheduleName == nil { + invalidParams.Add(request.NewErrParamRequired("MonitoringScheduleName")) } - if s.UiTemplate != nil { - if err := s.UiTemplate.Validate(); err != nil { - invalidParams.AddNested("UiTemplate", err.(request.ErrInvalidParams)) - } + if s.MonitoringScheduleName != nil && len(*s.MonitoringScheduleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MonitoringScheduleName", 1)) } if invalidParams.Len() > 0 { @@ -22064,92 +40789,105 @@ func (s *RenderUiTemplateInput) Validate() error { return nil } -// SetRoleArn sets the RoleArn field's value. -func (s *RenderUiTemplateInput) SetRoleArn(v string) *RenderUiTemplateInput { - s.RoleArn = &v +// SetMonitoringScheduleName sets the MonitoringScheduleName field's value. +func (s *StopMonitoringScheduleInput) SetMonitoringScheduleName(v string) *StopMonitoringScheduleInput { + s.MonitoringScheduleName = &v return s } -// SetTask sets the Task field's value. -func (s *RenderUiTemplateInput) SetTask(v *RenderableTask) *RenderUiTemplateInput { - s.Task = v - return s +type StopMonitoringScheduleOutput struct { + _ struct{} `type:"structure"` } -// SetUiTemplate sets the UiTemplate field's value. -func (s *RenderUiTemplateInput) SetUiTemplate(v *UiTemplate) *RenderUiTemplateInput { - s.UiTemplate = v - return s +// String returns the string representation +func (s StopMonitoringScheduleOutput) String() string { + return awsutil.Prettify(s) } -type RenderUiTemplateOutput struct { +// GoString returns the string representation +func (s StopMonitoringScheduleOutput) GoString() string { + return s.String() +} + +type StopNotebookInstanceInput struct { _ struct{} `type:"structure"` - // A list of one or more RenderingError objects if any were encountered while - // rendering the template. If there were no errors, the list is empty. + // The name of the notebook instance to terminate. // - // Errors is a required field - Errors []*RenderingError `type:"list" required:"true"` + // NotebookInstanceName is a required field + NotebookInstanceName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s StopNotebookInstanceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StopNotebookInstanceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StopNotebookInstanceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopNotebookInstanceInput"} + if s.NotebookInstanceName == nil { + invalidParams.Add(request.NewErrParamRequired("NotebookInstanceName")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // A Liquid template that renders the HTML for the worker UI. - // - // RenderedContent is a required field - RenderedContent *string `type:"string" required:"true"` +// SetNotebookInstanceName sets the NotebookInstanceName field's value. +func (s *StopNotebookInstanceInput) SetNotebookInstanceName(v string) *StopNotebookInstanceInput { + s.NotebookInstanceName = &v + return s +} + +type StopNotebookInstanceOutput struct { + _ struct{} `type:"structure"` } // String returns the string representation -func (s RenderUiTemplateOutput) String() string { +func (s StopNotebookInstanceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RenderUiTemplateOutput) GoString() string { +func (s StopNotebookInstanceOutput) GoString() string { return s.String() } -// SetErrors sets the Errors field's value. -func (s *RenderUiTemplateOutput) SetErrors(v []*RenderingError) *RenderUiTemplateOutput { - s.Errors = v - return s -} - -// SetRenderedContent sets the RenderedContent field's value. -func (s *RenderUiTemplateOutput) SetRenderedContent(v string) *RenderUiTemplateOutput { - s.RenderedContent = &v - return s -} - -// Contains input values for a task. -type RenderableTask struct { +type StopProcessingJobInput struct { _ struct{} `type:"structure"` - // A JSON object that contains values for the variables defined in the template. - // It is made available to the template under the substitution variable task.input. - // For example, if you define a variable task.input.text in your template, you - // can supply the variable in the JSON object as "text": "sample text". + // The name of the processing job to stop. // - // Input is a required field - Input *string `min:"2" type:"string" required:"true"` + // ProcessingJobName is a required field + ProcessingJobName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s RenderableTask) String() string { +func (s StopProcessingJobInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RenderableTask) GoString() string { +func (s StopProcessingJobInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *RenderableTask) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RenderableTask"} - if s.Input == nil { - invalidParams.Add(request.NewErrParamRequired("Input")) +func (s *StopProcessingJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopProcessingJobInput"} + if s.ProcessingJobName == nil { + invalidParams.Add(request.NewErrParamRequired("ProcessingJobName")) } - if s.Input != nil && len(*s.Input) < 2 { - invalidParams.Add(request.NewErrParamMinLen("Input", 2)) + if s.ProcessingJobName != nil && len(*s.ProcessingJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ProcessingJobName", 1)) } if invalidParams.Len() > 0 { @@ -22158,118 +40896,108 @@ func (s *RenderableTask) Validate() error { return nil } -// SetInput sets the Input field's value. -func (s *RenderableTask) SetInput(v string) *RenderableTask { - s.Input = &v +// SetProcessingJobName sets the ProcessingJobName field's value. +func (s *StopProcessingJobInput) SetProcessingJobName(v string) *StopProcessingJobInput { + s.ProcessingJobName = &v return s } -// A description of an error that occurred while rendering the template. -type RenderingError struct { +type StopProcessingJobOutput struct { _ struct{} `type:"structure"` +} - // A unique identifier for a specific class of errors. - // - // Code is a required field - Code *string `type:"string" required:"true"` +// String returns the string representation +func (s StopProcessingJobOutput) String() string { + return awsutil.Prettify(s) +} - // A human-readable message describing the error. +// GoString returns the string representation +func (s StopProcessingJobOutput) GoString() string { + return s.String() +} + +type StopTrainingJobInput struct { + _ struct{} `type:"structure"` + + // The name of the training job to stop. // - // Message is a required field - Message *string `type:"string" required:"true"` + // TrainingJobName is a required field + TrainingJobName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s RenderingError) String() string { +func (s StopTrainingJobInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RenderingError) GoString() string { +func (s StopTrainingJobInput) GoString() string { return s.String() } -// SetCode sets the Code field's value. -func (s *RenderingError) SetCode(v string) *RenderingError { - s.Code = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *StopTrainingJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopTrainingJobInput"} + if s.TrainingJobName == nil { + invalidParams.Add(request.NewErrParamRequired("TrainingJobName")) + } + if s.TrainingJobName != nil && len(*s.TrainingJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrainingJobName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetMessage sets the Message field's value. -func (s *RenderingError) SetMessage(v string) *RenderingError { - s.Message = &v +// SetTrainingJobName sets the TrainingJobName field's value. +func (s *StopTrainingJobInput) SetTrainingJobName(v string) *StopTrainingJobInput { + s.TrainingJobName = &v return s } -// Describes the resources, including ML compute instances and ML storage volumes, -// to use for model training. -type ResourceConfig struct { +type StopTrainingJobOutput struct { _ struct{} `type:"structure"` +} - // The number of ML compute instances to use. For distributed training, provide - // a value greater than 1. - // - // InstanceCount is a required field - InstanceCount *int64 `min:"1" type:"integer" required:"true"` +// String returns the string representation +func (s StopTrainingJobOutput) String() string { + return awsutil.Prettify(s) +} - // The ML compute instance type. - // - // InstanceType is a required field - InstanceType *string `type:"string" required:"true" enum:"TrainingInstanceType"` +// GoString returns the string representation +func (s StopTrainingJobOutput) GoString() string { + return s.String() +} - // The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to - // encrypt data on the storage volume attached to the ML compute instance(s) - // that run the training job. The VolumeKmsKeyId can be any of the following - // formats: - // - // * // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab" - // - // * // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" - VolumeKmsKeyId *string `type:"string"` +type StopTransformJobInput struct { + _ struct{} `type:"structure"` - // The size of the ML storage volume that you want to provision. - // - // ML storage volumes store model artifacts and incremental states. Training - // algorithms might also use the ML storage volume for scratch space. If you - // want to store the training data in the ML storage volume, choose File as - // the TrainingInputMode in the algorithm specification. - // - // You must specify sufficient ML storage for your scenario. - // - // Amazon SageMaker supports only the General Purpose SSD (gp2) ML storage volume - // type. + // The name of the transform job to stop. // - // VolumeSizeInGB is a required field - VolumeSizeInGB *int64 `min:"1" type:"integer" required:"true"` + // TransformJobName is a required field + TransformJobName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s ResourceConfig) String() string { +func (s StopTransformJobInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ResourceConfig) GoString() string { +func (s StopTransformJobInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ResourceConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResourceConfig"} - if s.InstanceCount == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceCount")) - } - if s.InstanceCount != nil && *s.InstanceCount < 1 { - invalidParams.Add(request.NewErrParamMinValue("InstanceCount", 1)) - } - if s.InstanceType == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceType")) - } - if s.VolumeSizeInGB == nil { - invalidParams.Add(request.NewErrParamRequired("VolumeSizeInGB")) +func (s *StopTransformJobInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StopTransformJobInput"} + if s.TransformJobName == nil { + invalidParams.Add(request.NewErrParamRequired("TransformJobName")) } - if s.VolumeSizeInGB != nil && *s.VolumeSizeInGB < 1 { - invalidParams.Add(request.NewErrParamMinValue("VolumeSizeInGB", 1)) + if s.TransformJobName != nil && len(*s.TransformJobName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TransformJobName", 1)) } if invalidParams.Len() > 0 { @@ -22278,72 +41006,79 @@ func (s *ResourceConfig) Validate() error { return nil } -// SetInstanceCount sets the InstanceCount field's value. -func (s *ResourceConfig) SetInstanceCount(v int64) *ResourceConfig { - s.InstanceCount = &v +// SetTransformJobName sets the TransformJobName field's value. +func (s *StopTransformJobInput) SetTransformJobName(v string) *StopTransformJobInput { + s.TransformJobName = &v return s } -// SetInstanceType sets the InstanceType field's value. -func (s *ResourceConfig) SetInstanceType(v string) *ResourceConfig { - s.InstanceType = &v - return s +type StopTransformJobOutput struct { + _ struct{} `type:"structure"` } -// SetVolumeKmsKeyId sets the VolumeKmsKeyId field's value. -func (s *ResourceConfig) SetVolumeKmsKeyId(v string) *ResourceConfig { - s.VolumeKmsKeyId = &v - return s +// String returns the string representation +func (s StopTransformJobOutput) String() string { + return awsutil.Prettify(s) } -// SetVolumeSizeInGB sets the VolumeSizeInGB field's value. -func (s *ResourceConfig) SetVolumeSizeInGB(v int64) *ResourceConfig { - s.VolumeSizeInGB = &v - return s +// GoString returns the string representation +func (s StopTransformJobOutput) GoString() string { + return s.String() } -// Specifies the maximum number of training jobs and parallel training jobs -// that a hyperparameter tuning job can launch. -type ResourceLimits struct { +// Specifies a limit to how long a model training or compilation job can run. +// It also specifies how long you are willing to wait for a managed spot training +// job to complete. When the job reaches the time limit, Amazon SageMaker ends +// the training or compilation job. Use this API to cap model training costs. +// +// To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal, which +// delays job termination for 120 seconds. Algorithms can use this 120-second +// window to save the model artifacts, so the results of training are not lost. +// +// The training algorithms provided by Amazon SageMaker automatically save the +// intermediate results of a model training job when possible. This attempt +// to save artifacts is only a best effort case as model might not be in a state +// from which it can be saved. For example, if training has just started, the +// model might not be ready to save. When saved, this intermediate data is a +// valid model artifact. You can use it to create a model with CreateModel. +// +// The Neural Topic Model (NTM) currently does not support saving intermediate +// model artifacts. When training NTMs, make sure that the maximum runtime is +// sufficient for the training job to complete. +type StoppingCondition struct { _ struct{} `type:"structure"` - // The maximum number of training jobs that a hyperparameter tuning job can - // launch. - // - // MaxNumberOfTrainingJobs is a required field - MaxNumberOfTrainingJobs *int64 `min:"1" type:"integer" required:"true"` + // The maximum length of time, in seconds, that the training or compilation + // job can run. If job does not complete during this time, Amazon SageMaker + // ends the job. If value is not specified, default value is 1 day. The maximum + // value is 28 days. + MaxRuntimeInSeconds *int64 `min:"1" type:"integer"` - // The maximum number of concurrent training jobs that a hyperparameter tuning - // job can launch. - // - // MaxParallelTrainingJobs is a required field - MaxParallelTrainingJobs *int64 `min:"1" type:"integer" required:"true"` + // The maximum length of time, in seconds, how long you are willing to wait + // for a managed spot training job to complete. It is the amount of time spent + // waiting for Spot capacity plus the amount of time the training job runs. + // It must be equal to or greater than MaxRuntimeInSeconds. + MaxWaitTimeInSeconds *int64 `min:"1" type:"integer"` } // String returns the string representation -func (s ResourceLimits) String() string { +func (s StoppingCondition) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ResourceLimits) GoString() string { +func (s StoppingCondition) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ResourceLimits) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ResourceLimits"} - if s.MaxNumberOfTrainingJobs == nil { - invalidParams.Add(request.NewErrParamRequired("MaxNumberOfTrainingJobs")) - } - if s.MaxNumberOfTrainingJobs != nil && *s.MaxNumberOfTrainingJobs < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxNumberOfTrainingJobs", 1)) - } - if s.MaxParallelTrainingJobs == nil { - invalidParams.Add(request.NewErrParamRequired("MaxParallelTrainingJobs")) +func (s *StoppingCondition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StoppingCondition"} + if s.MaxRuntimeInSeconds != nil && *s.MaxRuntimeInSeconds < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxRuntimeInSeconds", 1)) } - if s.MaxParallelTrainingJobs != nil && *s.MaxParallelTrainingJobs < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxParallelTrainingJobs", 1)) + if s.MaxWaitTimeInSeconds != nil && *s.MaxWaitTimeInSeconds < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxWaitTimeInSeconds", 1)) } if invalidParams.Len() > 0 { @@ -22352,218 +41087,105 @@ func (s *ResourceLimits) Validate() error { return nil } -// SetMaxNumberOfTrainingJobs sets the MaxNumberOfTrainingJobs field's value. -func (s *ResourceLimits) SetMaxNumberOfTrainingJobs(v int64) *ResourceLimits { - s.MaxNumberOfTrainingJobs = &v +// SetMaxRuntimeInSeconds sets the MaxRuntimeInSeconds field's value. +func (s *StoppingCondition) SetMaxRuntimeInSeconds(v int64) *StoppingCondition { + s.MaxRuntimeInSeconds = &v return s } -// SetMaxParallelTrainingJobs sets the MaxParallelTrainingJobs field's value. -func (s *ResourceLimits) SetMaxParallelTrainingJobs(v int64) *ResourceLimits { - s.MaxParallelTrainingJobs = &v +// SetMaxWaitTimeInSeconds sets the MaxWaitTimeInSeconds field's value. +func (s *StoppingCondition) SetMaxWaitTimeInSeconds(v int64) *StoppingCondition { + s.MaxWaitTimeInSeconds = &v return s } -// Describes the S3 data source. -type S3DataSource struct { +// Describes a work team of a vendor that does the a labelling job. +type SubscribedWorkteam struct { _ struct{} `type:"structure"` - // A list of one or more attribute names to use that are found in a specified - // augmented manifest file. - AttributeNames []*string `type:"list"` + ListingId *string `type:"string"` - // If you want Amazon SageMaker to replicate the entire dataset on each ML compute - // instance that is launched for model training, specify FullyReplicated. - // - // If you want Amazon SageMaker to replicate a subset of data on each ML compute - // instance that is launched for model training, specify ShardedByS3Key. If - // there are n ML compute instances launched for a training job, each instance - // gets approximately 1/n of the number of S3 objects. In this case, model training - // on each machine uses only the subset of training data. - // - // Don't choose more ML compute instances for training than available S3 objects. - // If you do, some nodes won't get any data and you will pay for nodes that - // aren't getting any training data. This applies in both File and Pipe modes. - // Keep this in mind when developing algorithms. - // - // In distributed training, where you use multiple ML compute EC2 instances, - // you might choose ShardedByS3Key. If the algorithm requires copying training - // data to the ML storage volume (when TrainingInputMode is set to File), this - // copies 1/n of the number of objects. - S3DataDistributionType *string `type:"string" enum:"S3DataDistribution"` + // The description of the vendor from the Amazon Marketplace. + MarketplaceDescription *string `min:"1" type:"string"` - // If you choose S3Prefix, S3Uri identifies a key name prefix. Amazon SageMaker - // uses all objects that match the specified key name prefix for model training. - // - // If you choose ManifestFile, S3Uri identifies an object that is a manifest - // file containing a list of object keys that you want Amazon SageMaker to use - // for model training. - // - // If you choose AugmentedManifestFile, S3Uri identifies an object that is an - // augmented manifest file in JSON lines format. This file contains the data - // you want to use for model training. AugmentedManifestFile can only be used - // if the Channel's input mode is Pipe. - // - // S3DataType is a required field - S3DataType *string `type:"string" required:"true" enum:"S3DataType"` + // The title of the service provided by the vendor in the Amazon Marketplace. + MarketplaceTitle *string `min:"1" type:"string"` - // Depending on the value specified for the S3DataType, identifies either a - // key name prefix or a manifest. For example: - // - // * A key name prefix might look like this: s3://bucketname/exampleprefix. - // - // * A manifest might look like this: s3://bucketname/example.manifest The - // manifest is an S3 object which is a JSON file with the following format: - // [ {"prefix": "s3://customer_bucket/some/prefix/"}, "relative/path/to/custdata-1", - // "relative/path/custdata-2", ... ] The preceding JSON matches the following - // s3Uris: s3://customer_bucket/some/prefix/relative/path/to/custdata-1 s3://customer_bucket/some/prefix/relative/path/custdata-2 - // ... The complete set of s3uris in this manifest is the input data for - // the channel for this datasource. The object that each s3uris points to - // must be readable by the IAM role that Amazon SageMaker uses to perform - // tasks on your behalf. + // The name of the vendor in the Amazon Marketplace. + SellerName *string `type:"string"` + + // The Amazon Resource Name (ARN) of the vendor that you have subscribed. // - // S3Uri is a required field - S3Uri *string `type:"string" required:"true"` + // WorkteamArn is a required field + WorkteamArn *string `type:"string" required:"true"` } // String returns the string representation -func (s S3DataSource) String() string { +func (s SubscribedWorkteam) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s S3DataSource) GoString() string { +func (s SubscribedWorkteam) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3DataSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3DataSource"} - if s.S3DataType == nil { - invalidParams.Add(request.NewErrParamRequired("S3DataType")) - } - if s.S3Uri == nil { - invalidParams.Add(request.NewErrParamRequired("S3Uri")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetListingId sets the ListingId field's value. +func (s *SubscribedWorkteam) SetListingId(v string) *SubscribedWorkteam { + s.ListingId = &v + return s } -// SetAttributeNames sets the AttributeNames field's value. -func (s *S3DataSource) SetAttributeNames(v []*string) *S3DataSource { - s.AttributeNames = v +// SetMarketplaceDescription sets the MarketplaceDescription field's value. +func (s *SubscribedWorkteam) SetMarketplaceDescription(v string) *SubscribedWorkteam { + s.MarketplaceDescription = &v return s } -// SetS3DataDistributionType sets the S3DataDistributionType field's value. -func (s *S3DataSource) SetS3DataDistributionType(v string) *S3DataSource { - s.S3DataDistributionType = &v +// SetMarketplaceTitle sets the MarketplaceTitle field's value. +func (s *SubscribedWorkteam) SetMarketplaceTitle(v string) *SubscribedWorkteam { + s.MarketplaceTitle = &v return s } -// SetS3DataType sets the S3DataType field's value. -func (s *S3DataSource) SetS3DataType(v string) *S3DataSource { - s.S3DataType = &v +// SetSellerName sets the SellerName field's value. +func (s *SubscribedWorkteam) SetSellerName(v string) *SubscribedWorkteam { + s.SellerName = &v return s } -// SetS3Uri sets the S3Uri field's value. -func (s *S3DataSource) SetS3Uri(v string) *S3DataSource { - s.S3Uri = &v +// SetWorkteamArn sets the WorkteamArn field's value. +func (s *SubscribedWorkteam) SetWorkteamArn(v string) *SubscribedWorkteam { + s.WorkteamArn = &v return s } -// A multi-expression that searches for the specified resource or resources -// in a search. All resource objects that satisfy the expression's condition -// are included in the search results. You must specify at least one subexpression, -// filter, or nested filter. A SearchExpression can contain up to twenty elements. -// -// A SearchExpression contains the following components: -// -// * A list of Filter objects. Each filter defines a simple Boolean expression -// comprised of a resource property name, Boolean operator, and value. -// -// * A list of NestedFilter objects. Each nested filter defines a list of -// Boolean expressions using a list of resource properties. A nested filter -// is satisfied if a single object in the list satisfies all Boolean expressions. -// -// * A list of SearchExpression objects. A search expression object can be -// nested in a list of search expression objects. -// -// * A Boolean operator: And or Or. -type SearchExpression struct { +// Specified in the GetSearchSuggestions request. Limits the property names +// that are included in the response. +type SuggestionQuery struct { _ struct{} `type:"structure"` - // A list of filter objects. - Filters []*Filter `min:"1" type:"list"` - - // A list of nested filter objects. - NestedFilters []*NestedFilters `min:"1" type:"list"` - - // A Boolean operator used to evaluate the search expression. If you want every - // conditional statement in all lists to be satisfied for the entire search - // expression to be true, specify And. If only a single conditional statement - // needs to be true for the entire search expression to be true, specify Or. - // The default value is And. - Operator *string `type:"string" enum:"BooleanOperator"` - - // A list of search expression objects. - SubExpressions []*SearchExpression `min:"1" type:"list"` + // Defines a property name hint. Only property names that begin with the specified + // hint are included in the response. + PropertyNameQuery *PropertyNameQuery `type:"structure"` } // String returns the string representation -func (s SearchExpression) String() string { +func (s SuggestionQuery) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SearchExpression) GoString() string { +func (s SuggestionQuery) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *SearchExpression) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchExpression"} - if s.Filters != nil && len(s.Filters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Filters", 1)) - } - if s.NestedFilters != nil && len(s.NestedFilters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NestedFilters", 1)) - } - if s.SubExpressions != nil && len(s.SubExpressions) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SubExpressions", 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.NestedFilters != nil { - for i, v := range s.NestedFilters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "NestedFilters", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SubExpressions != nil { - for i, v := range s.SubExpressions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SubExpressions", i), err.(request.ErrInvalidParams)) - } +func (s *SuggestionQuery) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SuggestionQuery"} + if s.PropertyNameQuery != nil { + if err := s.PropertyNameQuery.Validate(); err != nil { + invalidParams.AddNested("PropertyNameQuery", err.(request.ErrInvalidParams)) } } @@ -22573,90 +41195,48 @@ func (s *SearchExpression) Validate() error { return nil } -// SetFilters sets the Filters field's value. -func (s *SearchExpression) SetFilters(v []*Filter) *SearchExpression { - s.Filters = v - return s -} - -// SetNestedFilters sets the NestedFilters field's value. -func (s *SearchExpression) SetNestedFilters(v []*NestedFilters) *SearchExpression { - s.NestedFilters = v - return s -} - -// SetOperator sets the Operator field's value. -func (s *SearchExpression) SetOperator(v string) *SearchExpression { - s.Operator = &v - return s -} - -// SetSubExpressions sets the SubExpressions field's value. -func (s *SearchExpression) SetSubExpressions(v []*SearchExpression) *SearchExpression { - s.SubExpressions = v +// SetPropertyNameQuery sets the PropertyNameQuery field's value. +func (s *SuggestionQuery) SetPropertyNameQuery(v *PropertyNameQuery) *SuggestionQuery { + s.PropertyNameQuery = v return s } -type SearchInput struct { - _ struct{} `type:"structure"` - - // The maximum number of results to return in a SearchResponse. - MaxResults *int64 `min:"1" type:"integer"` - - // If more than MaxResults resource objects match the specified SearchExpression, - // the SearchResponse includes a NextToken. The NextToken can be passed to the - // next SearchRequest to continue retrieving results for the specified SearchExpression - // and Sort parameters. - NextToken *string `type:"string"` - - // The name of the Amazon SageMaker resource to search for. Currently, the only - // valid Resource value is TrainingJob. - // - // Resource is a required field - Resource *string `type:"string" required:"true" enum:"ResourceType"` - - // A Boolean conditional statement. Resource objects must satisfy this condition - // to be included in search results. You must provide at least one subexpression, - // filter, or nested filter. The maximum number of recursive SubExpressions, - // NestedFilters, and Filters that can be included in a SearchExpression object - // is 50. - SearchExpression *SearchExpression `type:"structure"` +// Describes a tag. +type Tag struct { + _ struct{} `type:"structure"` - // The name of the resource property used to sort the SearchResults. The default - // is LastModifiedTime. - SortBy *string `min:"1" type:"string"` + // The tag key. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` - // How SearchResults are ordered. Valid values are Ascending or Descending. - // The default is Descending. - SortOrder *string `type:"string" enum:"SearchSortOrder"` + // The tag value. + // + // Value is a required field + Value *string `type:"string" required:"true"` } // String returns the string representation -func (s SearchInput) String() string { +func (s Tag) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SearchInput) GoString() string { +func (s Tag) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *SearchInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SearchInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.Resource == nil { - invalidParams.Add(request.NewErrParamRequired("Resource")) +func (s *Tag) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Tag"} + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) } - if s.SortBy != nil && len(*s.SortBy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SortBy", 1)) + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) } - if s.SearchExpression != nil { - if err := s.SearchExpression.Validate(); err != nil { - invalidParams.AddNested("SearchExpression", err.(request.ErrInvalidParams)) - } + if s.Value == nil { + invalidParams.Add(request.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { @@ -22665,124 +41245,181 @@ func (s *SearchInput) Validate() error { return nil } -// SetMaxResults sets the MaxResults field's value. -func (s *SearchInput) SetMaxResults(v int64) *SearchInput { - s.MaxResults = &v +// SetKey sets the Key field's value. +func (s *Tag) SetKey(v string) *Tag { + s.Key = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *SearchInput) SetNextToken(v string) *SearchInput { - s.NextToken = &v +// SetValue sets the Value field's value. +func (s *Tag) SetValue(v string) *Tag { + s.Value = &v return s } -// SetResource sets the Resource field's value. -func (s *SearchInput) SetResource(v string) *SearchInput { - s.Resource = &v - return s +// The TensorBoard app settings. +type TensorBoardAppSettings struct { + _ struct{} `type:"structure"` + + // The instance type and quantity. + DefaultResourceSpec *ResourceSpec `type:"structure"` } -// SetSearchExpression sets the SearchExpression field's value. -func (s *SearchInput) SetSearchExpression(v *SearchExpression) *SearchInput { - s.SearchExpression = v - return s +// String returns the string representation +func (s TensorBoardAppSettings) String() string { + return awsutil.Prettify(s) } -// SetSortBy sets the SortBy field's value. -func (s *SearchInput) SetSortBy(v string) *SearchInput { - s.SortBy = &v - return s +// GoString returns the string representation +func (s TensorBoardAppSettings) GoString() string { + return s.String() } -// SetSortOrder sets the SortOrder field's value. -func (s *SearchInput) SetSortOrder(v string) *SearchInput { - s.SortOrder = &v +// SetDefaultResourceSpec sets the DefaultResourceSpec field's value. +func (s *TensorBoardAppSettings) SetDefaultResourceSpec(v *ResourceSpec) *TensorBoardAppSettings { + s.DefaultResourceSpec = v return s } -type SearchOutput struct { +// Configuration of storage locations for TensorBoard output. +type TensorBoardOutputConfig struct { _ struct{} `type:"structure"` - // If the result of the previous Search request was truncated, the response - // includes a NextToken. To retrieve the next set of results, use the token - // in the next request. - NextToken *string `type:"string"` + // Path to local storage location for tensorBoard output. Defaults to /opt/ml/output/tensorboard. + LocalPath *string `type:"string"` - // A list of SearchResult objects. - Results []*SearchRecord `type:"list"` + // Path to Amazon S3 storage location for TensorBoard output. + // + // S3OutputPath is a required field + S3OutputPath *string `type:"string" required:"true"` } // String returns the string representation -func (s SearchOutput) String() string { +func (s TensorBoardOutputConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SearchOutput) GoString() string { +func (s TensorBoardOutputConfig) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *SearchOutput) SetNextToken(v string) *SearchOutput { - s.NextToken = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *TensorBoardOutputConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TensorBoardOutputConfig"} + if s.S3OutputPath == nil { + invalidParams.Add(request.NewErrParamRequired("S3OutputPath")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLocalPath sets the LocalPath field's value. +func (s *TensorBoardOutputConfig) SetLocalPath(v string) *TensorBoardOutputConfig { + s.LocalPath = &v return s } -// SetResults sets the Results field's value. -func (s *SearchOutput) SetResults(v []*SearchRecord) *SearchOutput { - s.Results = v +// SetS3OutputPath sets the S3OutputPath field's value. +func (s *TensorBoardOutputConfig) SetS3OutputPath(v string) *TensorBoardOutputConfig { + s.S3OutputPath = &v return s } -// An individual search result record that contains a single resource object. -type SearchRecord struct { +// Contains information about a training job. +type TrainingJob struct { _ struct{} `type:"structure"` - // A TrainingJob object that is returned as part of a Search request. - TrainingJob *TrainingJob `type:"structure"` -} + // Information about the algorithm used for training, and algorithm metadata. + AlgorithmSpecification *AlgorithmSpecification `type:"structure"` -// String returns the string representation -func (s SearchRecord) String() string { - return awsutil.Prettify(s) -} + // The Amazon Resource Name (ARN) of the job. + AutoMLJobArn *string `min:"1" type:"string"` -// GoString returns the string representation -func (s SearchRecord) GoString() string { - return s.String() -} + // The billable time in seconds. + BillableTimeInSeconds *int64 `min:"1" type:"integer"` -// SetTrainingJob sets the TrainingJob field's value. -func (s *SearchRecord) SetTrainingJob(v *TrainingJob) *SearchRecord { - s.TrainingJob = v - return s -} + // Contains information about the output location for managed spot training + // checkpoint data. + CheckpointConfig *CheckpointConfig `type:"structure"` -// An array element of DescribeTrainingJobResponse$SecondaryStatusTransitions. -// It provides additional details about a status that the training job has transitioned -// through. A training job can be in one of several states, for example, starting, -// downloading, training, or uploading. Within each state, there are a number -// of intermediate states. For example, within the starting state, Amazon SageMaker -// could be starting the training job or launching the ML instances. These transitional -// states are referred to as the job's secondary status. -type SecondaryStatusTransition struct { - _ struct{} `type:"structure"` + // A timestamp that indicates when the training job was created. + CreationTime *time.Time `type:"timestamp"` - // A timestamp that shows when the training job transitioned out of this secondary - // status state into another secondary status state or when the training job - // has ended. - EndTime *time.Time `type:"timestamp"` + // Configuration information for the debug hook parameters, collection configuration, + // and storage paths. + DebugHookConfig *DebugHookConfig `type:"structure"` - // A timestamp that shows when the training job transitioned to the current - // secondary status state. - // - // StartTime is a required field - StartTime *time.Time `type:"timestamp" required:"true"` + // Information about the debug rule configuration. + DebugRuleConfigurations []*DebugRuleConfiguration `type:"list"` - // Contains a secondary status information from a training job. + // Information about the evaluation status of the rules for the training job. + DebugRuleEvaluationStatuses []*DebugRuleEvaluationStatus `type:"list"` + + // To encrypt all communications between ML compute instances in distributed + // training, choose True. Encryption provides greater security for distributed + // training, but training might take longer. How long it takes depends on the + // amount of communication between compute instances, especially if you use + // a deep learning algorithm in distributed training. + EnableInterContainerTrafficEncryption *bool `type:"boolean"` + + // When true, enables managed spot training using Amazon EC2 Spot instances + // to run training jobs instead of on-demand instances. For more information, + // see model-managed-spot-training. + EnableManagedSpotTraining *bool `type:"boolean"` + + // If the TrainingJob was created with network isolation, the value is set to + // true. If network isolation is enabled, nodes can't communicate beyond the + // VPC they run in. + EnableNetworkIsolation *bool `type:"boolean"` + + // Configuration for the experiment. + ExperimentConfig *ExperimentConfig `type:"structure"` + + // If the training job failed, the reason it failed. + FailureReason *string `type:"string"` + + // A list of final metric values that are set when the training job completes. + // Used only if the training job was configured to use metrics. + FinalMetricDataList []*MetricData `type:"list"` + + // Algorithm-specific parameters. + HyperParameters map[string]*string `type:"map"` + + // An array of Channel objects that describes each data input channel. + InputDataConfig []*Channel `min:"1" type:"list"` + + // The Amazon Resource Name (ARN) of the labeling job. + LabelingJobArn *string `type:"string"` + + // A timestamp that indicates when the status of the training job was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // Information about the Amazon S3 location that is configured for storing model + // artifacts. + ModelArtifacts *ModelArtifacts `type:"structure"` + + // The S3 path where model artifacts that you configured when creating the job + // are stored. Amazon SageMaker creates subfolders for model artifacts. + OutputDataConfig *OutputDataConfig `type:"structure"` + + // Resources, including ML compute instances and ML storage volumes, that are + // configured for model training. + ResourceConfig *ResourceConfig `type:"structure"` + + // The AWS Identity and Access Management (IAM) role configured for the training + // job. + RoleArn *string `min:"20" type:"string"` + + // Provides detailed information about the state of the training job. For detailed + // information about the secondary status of the training job, see StatusMessage + // under SecondaryStatusTransition. // - // Status might be one of the following secondary statuses: + // Amazon SageMaker provides primary statuses and secondary statuses that apply + // to each of them: // // InProgress // @@ -22817,6 +41454,8 @@ type SecondaryStatusTransition struct { // // * Stopping - Stopping the training job. // + // Valid values for SecondaryStatus are subject to change. + // // We no longer support the following secondary statuses: // // * LaunchingMLInstances @@ -22824,433 +41463,404 @@ type SecondaryStatusTransition struct { // * PreparingTrainingStack // // * DownloadingTrainingImage - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"SecondaryStatus"` + SecondaryStatus *string `type:"string" enum:"SecondaryStatus"` - // A detailed description of the progress within a secondary status. - // - // Amazon SageMaker provides secondary statuses and status messages that apply - // to each of them: - // - // Starting - // - // * Starting the training job. - // - // * Launching requested ML instances. - // - // * Insufficient capacity error from EC2 while launching instances, retrying! - // - // * Launched instance was unhealthy, replacing it! - // - // * Preparing the instances for training. + // A history of all of the secondary statuses that the training job has transitioned + // through. + SecondaryStatusTransitions []*SecondaryStatusTransition `type:"list"` + + // Specifies a limit to how long a model training job can run. When the job + // reaches the time limit, Amazon SageMaker ends the training job. Use this + // API to cap model training costs. // - // Training + // To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal, which + // delays job termination for 120 seconds. Algorithms can use this 120-second + // window to save the model artifacts, so the results of training are not lost. + StoppingCondition *StoppingCondition `type:"structure"` + + // An array of key-value pairs. For more information, see Using Cost Allocation + // Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) + // in the AWS Billing and Cost Management User Guide. + Tags []*Tag `type:"list"` + + // Configuration of storage locations for TensorBoard output. + TensorBoardOutputConfig *TensorBoardOutputConfig `type:"structure"` + + // Indicates the time when the training job ends on training instances. You + // are billed for the time interval between the value of TrainingStartTime and + // this time. For successful jobs and stopped jobs, this is the time after model + // artifacts are uploaded. For failed jobs, this is the time when Amazon SageMaker + // detects a job failure. + TrainingEndTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of the training job. + TrainingJobArn *string `type:"string"` + + // The name of the training job. + TrainingJobName *string `min:"1" type:"string"` + + // The status of the training job. // - // * Downloading the training image. + // Training job statuses are: // - // * Training image download completed. Training in progress. + // * InProgress - The training is in progress. // - // Status messages are subject to change. Therefore, we recommend not including - // them in code that programmatically initiates actions. For examples, don't - // use status messages in if statements. + // * Completed - The training job has completed. // - // To have an overview of your training job's progress, view TrainingJobStatus - // and SecondaryStatus in DescribeTrainingJob, and StatusMessage together. For - // example, at the start of a training job, you might see the following: + // * Failed - The training job has failed. To see the reason for the failure, + // see the FailureReason field in the response to a DescribeTrainingJobResponse + // call. // - // * TrainingJobStatus - InProgress + // * Stopping - The training job is stopping. // - // * SecondaryStatus - Training + // * Stopped - The training job has stopped. // - // * StatusMessage - Downloading the training image - StatusMessage *string `type:"string"` -} - -// String returns the string representation -func (s SecondaryStatusTransition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SecondaryStatusTransition) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *SecondaryStatusTransition) SetEndTime(v time.Time) *SecondaryStatusTransition { - s.EndTime = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *SecondaryStatusTransition) SetStartTime(v time.Time) *SecondaryStatusTransition { - s.StartTime = &v - return s -} + // For more detailed information, see SecondaryStatus. + TrainingJobStatus *string `type:"string" enum:"TrainingJobStatus"` -// SetStatus sets the Status field's value. -func (s *SecondaryStatusTransition) SetStatus(v string) *SecondaryStatusTransition { - s.Status = &v - return s -} + // Indicates the time when the training job starts on training instances. You + // are billed for the time interval between this time and the value of TrainingEndTime. + // The start time in CloudWatch Logs might be later than this time. The difference + // is due to the time it takes to download the training data and to the size + // of the training container. + TrainingStartTime *time.Time `type:"timestamp"` -// SetStatusMessage sets the StatusMessage field's value. -func (s *SecondaryStatusTransition) SetStatusMessage(v string) *SecondaryStatusTransition { - s.StatusMessage = &v - return s -} + // The training time in seconds. + TrainingTimeInSeconds *int64 `min:"1" type:"integer"` -// A configuration for a shuffle option for input data in a channel. If you -// use S3Prefix for S3DataType, the results of the S3 key prefix matches are -// shuffled. If you use ManifestFile, the order of the S3 object references -// in the ManifestFile is shuffled. If you use AugmentedManifestFile, the order -// of the JSON lines in the AugmentedManifestFile is shuffled. The shuffling -// order is determined using the Seed value. -// -// For Pipe input mode, shuffling is done at the start of every epoch. With -// large datasets, this ensures that the order of the training data is different -// for each epoch, and it helps reduce bias and possible overfitting. In a multi-node -// training job when ShuffleConfig is combined with S3DataDistributionType of -// ShardedByS3Key, the data is shuffled across nodes so that the content sent -// to a particular node on the first epoch might be sent to a different node -// on the second epoch. -type ShuffleConfig struct { - _ struct{} `type:"structure"` + // The Amazon Resource Name (ARN) of the associated hyperparameter tuning job + // if the training job was launched by a hyperparameter tuning job. + TuningJobArn *string `type:"string"` - // Determines the shuffling order in ShuffleConfig value. - // - // Seed is a required field - Seed *int64 `type:"long" required:"true"` + // A VpcConfig object that specifies the VPC that this training job has access + // to. For more information, see Protect Training Jobs by Using an Amazon Virtual + // Private Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html). + VpcConfig *VpcConfig `type:"structure"` } // String returns the string representation -func (s ShuffleConfig) String() string { +func (s TrainingJob) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ShuffleConfig) GoString() string { +func (s TrainingJob) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ShuffleConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ShuffleConfig"} - if s.Seed == nil { - invalidParams.Add(request.NewErrParamRequired("Seed")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSeed sets the Seed field's value. -func (s *ShuffleConfig) SetSeed(v int64) *ShuffleConfig { - s.Seed = &v +// SetAlgorithmSpecification sets the AlgorithmSpecification field's value. +func (s *TrainingJob) SetAlgorithmSpecification(v *AlgorithmSpecification) *TrainingJob { + s.AlgorithmSpecification = v return s } -// Specifies an algorithm that was used to create the model package. The algorithm -// must be either an algorithm resource in your Amazon SageMaker account or -// an algorithm in AWS Marketplace that you are subscribed to. -type SourceAlgorithm struct { - _ struct{} `type:"structure"` - - // The name of an algorithm that was used to create the model package. The algorithm - // must be either an algorithm resource in your Amazon SageMaker account or - // an algorithm in AWS Marketplace that you are subscribed to. - // - // AlgorithmName is a required field - AlgorithmName *string `min:"1" type:"string" required:"true"` - - // The Amazon S3 path where the model artifacts, which result from model training, - // are stored. This path must point to a single gzip compressed tar archive - // (.tar.gz suffix). - ModelDataUrl *string `type:"string"` -} - -// String returns the string representation -func (s SourceAlgorithm) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SourceAlgorithm) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SourceAlgorithm) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SourceAlgorithm"} - if s.AlgorithmName == nil { - invalidParams.Add(request.NewErrParamRequired("AlgorithmName")) - } - if s.AlgorithmName != nil && len(*s.AlgorithmName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AlgorithmName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAlgorithmName sets the AlgorithmName field's value. -func (s *SourceAlgorithm) SetAlgorithmName(v string) *SourceAlgorithm { - s.AlgorithmName = &v +// SetAutoMLJobArn sets the AutoMLJobArn field's value. +func (s *TrainingJob) SetAutoMLJobArn(v string) *TrainingJob { + s.AutoMLJobArn = &v return s } -// SetModelDataUrl sets the ModelDataUrl field's value. -func (s *SourceAlgorithm) SetModelDataUrl(v string) *SourceAlgorithm { - s.ModelDataUrl = &v +// SetBillableTimeInSeconds sets the BillableTimeInSeconds field's value. +func (s *TrainingJob) SetBillableTimeInSeconds(v int64) *TrainingJob { + s.BillableTimeInSeconds = &v return s } -// A list of algorithms that were used to create a model package. -type SourceAlgorithmSpecification struct { - _ struct{} `type:"structure"` - - // A list of the algorithms that were used to create a model package. - // - // SourceAlgorithms is a required field - SourceAlgorithms []*SourceAlgorithm `min:"1" type:"list" required:"true"` -} - -// String returns the string representation -func (s SourceAlgorithmSpecification) String() string { - return awsutil.Prettify(s) +// SetCheckpointConfig sets the CheckpointConfig field's value. +func (s *TrainingJob) SetCheckpointConfig(v *CheckpointConfig) *TrainingJob { + s.CheckpointConfig = v + return s } -// GoString returns the string representation -func (s SourceAlgorithmSpecification) GoString() string { - return s.String() +// SetCreationTime sets the CreationTime field's value. +func (s *TrainingJob) SetCreationTime(v time.Time) *TrainingJob { + s.CreationTime = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *SourceAlgorithmSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SourceAlgorithmSpecification"} - if s.SourceAlgorithms == nil { - invalidParams.Add(request.NewErrParamRequired("SourceAlgorithms")) - } - if s.SourceAlgorithms != nil && len(s.SourceAlgorithms) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SourceAlgorithms", 1)) - } - if s.SourceAlgorithms != nil { - for i, v := range s.SourceAlgorithms { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SourceAlgorithms", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetDebugHookConfig sets the DebugHookConfig field's value. +func (s *TrainingJob) SetDebugHookConfig(v *DebugHookConfig) *TrainingJob { + s.DebugHookConfig = v + return s } -// SetSourceAlgorithms sets the SourceAlgorithms field's value. -func (s *SourceAlgorithmSpecification) SetSourceAlgorithms(v []*SourceAlgorithm) *SourceAlgorithmSpecification { - s.SourceAlgorithms = v +// SetDebugRuleConfigurations sets the DebugRuleConfigurations field's value. +func (s *TrainingJob) SetDebugRuleConfigurations(v []*DebugRuleConfiguration) *TrainingJob { + s.DebugRuleConfigurations = v return s } -type StartNotebookInstanceInput struct { - _ struct{} `type:"structure"` - - // The name of the notebook instance to start. - // - // NotebookInstanceName is a required field - NotebookInstanceName *string `type:"string" required:"true"` +// SetDebugRuleEvaluationStatuses sets the DebugRuleEvaluationStatuses field's value. +func (s *TrainingJob) SetDebugRuleEvaluationStatuses(v []*DebugRuleEvaluationStatus) *TrainingJob { + s.DebugRuleEvaluationStatuses = v + return s } -// String returns the string representation -func (s StartNotebookInstanceInput) String() string { - return awsutil.Prettify(s) +// SetEnableInterContainerTrafficEncryption sets the EnableInterContainerTrafficEncryption field's value. +func (s *TrainingJob) SetEnableInterContainerTrafficEncryption(v bool) *TrainingJob { + s.EnableInterContainerTrafficEncryption = &v + return s } -// GoString returns the string representation -func (s StartNotebookInstanceInput) GoString() string { - return s.String() +// SetEnableManagedSpotTraining sets the EnableManagedSpotTraining field's value. +func (s *TrainingJob) SetEnableManagedSpotTraining(v bool) *TrainingJob { + s.EnableManagedSpotTraining = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartNotebookInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartNotebookInstanceInput"} - if s.NotebookInstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("NotebookInstanceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetEnableNetworkIsolation sets the EnableNetworkIsolation field's value. +func (s *TrainingJob) SetEnableNetworkIsolation(v bool) *TrainingJob { + s.EnableNetworkIsolation = &v + return s } -// SetNotebookInstanceName sets the NotebookInstanceName field's value. -func (s *StartNotebookInstanceInput) SetNotebookInstanceName(v string) *StartNotebookInstanceInput { - s.NotebookInstanceName = &v +// SetExperimentConfig sets the ExperimentConfig field's value. +func (s *TrainingJob) SetExperimentConfig(v *ExperimentConfig) *TrainingJob { + s.ExperimentConfig = v return s } -type StartNotebookInstanceOutput struct { - _ struct{} `type:"structure"` +// SetFailureReason sets the FailureReason field's value. +func (s *TrainingJob) SetFailureReason(v string) *TrainingJob { + s.FailureReason = &v + return s } -// String returns the string representation -func (s StartNotebookInstanceOutput) String() string { - return awsutil.Prettify(s) +// SetFinalMetricDataList sets the FinalMetricDataList field's value. +func (s *TrainingJob) SetFinalMetricDataList(v []*MetricData) *TrainingJob { + s.FinalMetricDataList = v + return s } -// GoString returns the string representation -func (s StartNotebookInstanceOutput) GoString() string { - return s.String() +// SetHyperParameters sets the HyperParameters field's value. +func (s *TrainingJob) SetHyperParameters(v map[string]*string) *TrainingJob { + s.HyperParameters = v + return s } -type StopCompilationJobInput struct { - _ struct{} `type:"structure"` +// SetInputDataConfig sets the InputDataConfig field's value. +func (s *TrainingJob) SetInputDataConfig(v []*Channel) *TrainingJob { + s.InputDataConfig = v + return s +} - // The name of the model compilation job to stop. - // - // CompilationJobName is a required field - CompilationJobName *string `min:"1" type:"string" required:"true"` +// SetLabelingJobArn sets the LabelingJobArn field's value. +func (s *TrainingJob) SetLabelingJobArn(v string) *TrainingJob { + s.LabelingJobArn = &v + return s } -// String returns the string representation -func (s StopCompilationJobInput) String() string { - return awsutil.Prettify(s) +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *TrainingJob) SetLastModifiedTime(v time.Time) *TrainingJob { + s.LastModifiedTime = &v + return s } -// GoString returns the string representation -func (s StopCompilationJobInput) GoString() string { - return s.String() +// SetModelArtifacts sets the ModelArtifacts field's value. +func (s *TrainingJob) SetModelArtifacts(v *ModelArtifacts) *TrainingJob { + s.ModelArtifacts = v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopCompilationJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopCompilationJobInput"} - if s.CompilationJobName == nil { - invalidParams.Add(request.NewErrParamRequired("CompilationJobName")) - } - if s.CompilationJobName != nil && len(*s.CompilationJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CompilationJobName", 1)) - } +// SetOutputDataConfig sets the OutputDataConfig field's value. +func (s *TrainingJob) SetOutputDataConfig(v *OutputDataConfig) *TrainingJob { + s.OutputDataConfig = v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetResourceConfig sets the ResourceConfig field's value. +func (s *TrainingJob) SetResourceConfig(v *ResourceConfig) *TrainingJob { + s.ResourceConfig = v + return s } -// SetCompilationJobName sets the CompilationJobName field's value. -func (s *StopCompilationJobInput) SetCompilationJobName(v string) *StopCompilationJobInput { - s.CompilationJobName = &v +// SetRoleArn sets the RoleArn field's value. +func (s *TrainingJob) SetRoleArn(v string) *TrainingJob { + s.RoleArn = &v return s } -type StopCompilationJobOutput struct { - _ struct{} `type:"structure"` +// SetSecondaryStatus sets the SecondaryStatus field's value. +func (s *TrainingJob) SetSecondaryStatus(v string) *TrainingJob { + s.SecondaryStatus = &v + return s } -// String returns the string representation -func (s StopCompilationJobOutput) String() string { - return awsutil.Prettify(s) +// SetSecondaryStatusTransitions sets the SecondaryStatusTransitions field's value. +func (s *TrainingJob) SetSecondaryStatusTransitions(v []*SecondaryStatusTransition) *TrainingJob { + s.SecondaryStatusTransitions = v + return s } -// GoString returns the string representation -func (s StopCompilationJobOutput) GoString() string { - return s.String() +// SetStoppingCondition sets the StoppingCondition field's value. +func (s *TrainingJob) SetStoppingCondition(v *StoppingCondition) *TrainingJob { + s.StoppingCondition = v + return s } -type StopHyperParameterTuningJobInput struct { - _ struct{} `type:"structure"` +// SetTags sets the Tags field's value. +func (s *TrainingJob) SetTags(v []*Tag) *TrainingJob { + s.Tags = v + return s +} - // The name of the tuning job to stop. - // - // HyperParameterTuningJobName is a required field - HyperParameterTuningJobName *string `min:"1" type:"string" required:"true"` +// SetTensorBoardOutputConfig sets the TensorBoardOutputConfig field's value. +func (s *TrainingJob) SetTensorBoardOutputConfig(v *TensorBoardOutputConfig) *TrainingJob { + s.TensorBoardOutputConfig = v + return s } -// String returns the string representation -func (s StopHyperParameterTuningJobInput) String() string { - return awsutil.Prettify(s) +// SetTrainingEndTime sets the TrainingEndTime field's value. +func (s *TrainingJob) SetTrainingEndTime(v time.Time) *TrainingJob { + s.TrainingEndTime = &v + return s } -// GoString returns the string representation -func (s StopHyperParameterTuningJobInput) GoString() string { - return s.String() +// SetTrainingJobArn sets the TrainingJobArn field's value. +func (s *TrainingJob) SetTrainingJobArn(v string) *TrainingJob { + s.TrainingJobArn = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopHyperParameterTuningJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopHyperParameterTuningJobInput"} - if s.HyperParameterTuningJobName == nil { - invalidParams.Add(request.NewErrParamRequired("HyperParameterTuningJobName")) - } - if s.HyperParameterTuningJobName != nil && len(*s.HyperParameterTuningJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("HyperParameterTuningJobName", 1)) - } +// SetTrainingJobName sets the TrainingJobName field's value. +func (s *TrainingJob) SetTrainingJobName(v string) *TrainingJob { + s.TrainingJobName = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetTrainingJobStatus sets the TrainingJobStatus field's value. +func (s *TrainingJob) SetTrainingJobStatus(v string) *TrainingJob { + s.TrainingJobStatus = &v + return s } -// SetHyperParameterTuningJobName sets the HyperParameterTuningJobName field's value. -func (s *StopHyperParameterTuningJobInput) SetHyperParameterTuningJobName(v string) *StopHyperParameterTuningJobInput { - s.HyperParameterTuningJobName = &v +// SetTrainingStartTime sets the TrainingStartTime field's value. +func (s *TrainingJob) SetTrainingStartTime(v time.Time) *TrainingJob { + s.TrainingStartTime = &v return s } -type StopHyperParameterTuningJobOutput struct { - _ struct{} `type:"structure"` +// SetTrainingTimeInSeconds sets the TrainingTimeInSeconds field's value. +func (s *TrainingJob) SetTrainingTimeInSeconds(v int64) *TrainingJob { + s.TrainingTimeInSeconds = &v + return s } -// String returns the string representation -func (s StopHyperParameterTuningJobOutput) String() string { - return awsutil.Prettify(s) +// SetTuningJobArn sets the TuningJobArn field's value. +func (s *TrainingJob) SetTuningJobArn(v string) *TrainingJob { + s.TuningJobArn = &v + return s } -// GoString returns the string representation -func (s StopHyperParameterTuningJobOutput) GoString() string { - return s.String() +// SetVpcConfig sets the VpcConfig field's value. +func (s *TrainingJob) SetVpcConfig(v *VpcConfig) *TrainingJob { + s.VpcConfig = v + return s } -type StopLabelingJobInput struct { +// Defines the input needed to run a training job using the algorithm. +type TrainingJobDefinition struct { _ struct{} `type:"structure"` - // The name of the labeling job to stop. + // The hyperparameters used for the training job. + HyperParameters map[string]*string `type:"map"` + + // An array of Channel objects, each of which specifies an input source. // - // LabelingJobName is a required field - LabelingJobName *string `min:"1" type:"string" required:"true"` + // InputDataConfig is a required field + InputDataConfig []*Channel `min:"1" type:"list" required:"true"` + + // the path to the S3 bucket where you want to store model artifacts. Amazon + // SageMaker creates subfolders for the artifacts. + // + // OutputDataConfig is a required field + OutputDataConfig *OutputDataConfig `type:"structure" required:"true"` + + // The resources, including the ML compute instances and ML storage volumes, + // to use for model training. + // + // ResourceConfig is a required field + ResourceConfig *ResourceConfig `type:"structure" required:"true"` + + // Specifies a limit to how long a model training job can run. When the job + // reaches the time limit, Amazon SageMaker ends the training job. Use this + // API to cap model training costs. + // + // To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal, which + // delays job termination for 120 seconds. Algorithms can use this 120-second + // window to save the model artifacts. + // + // StoppingCondition is a required field + StoppingCondition *StoppingCondition `type:"structure" required:"true"` + + // The input mode used by the algorithm for the training job. For the input + // modes that Amazon SageMaker algorithms support, see Algorithms (https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html). + // + // If an algorithm supports the File input mode, Amazon SageMaker downloads + // the training data from S3 to the provisioned ML storage Volume, and mounts + // the directory to docker volume for training container. If an algorithm supports + // the Pipe input mode, Amazon SageMaker streams data directly from S3 to the + // container. + // + // TrainingInputMode is a required field + TrainingInputMode *string `type:"string" required:"true" enum:"TrainingInputMode"` } // String returns the string representation -func (s StopLabelingJobInput) String() string { +func (s TrainingJobDefinition) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s StopLabelingJobInput) GoString() string { +func (s TrainingJobDefinition) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *StopLabelingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopLabelingJobInput"} - if s.LabelingJobName == nil { - invalidParams.Add(request.NewErrParamRequired("LabelingJobName")) +func (s *TrainingJobDefinition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TrainingJobDefinition"} + if s.InputDataConfig == nil { + invalidParams.Add(request.NewErrParamRequired("InputDataConfig")) } - if s.LabelingJobName != nil && len(*s.LabelingJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LabelingJobName", 1)) + if s.InputDataConfig != nil && len(s.InputDataConfig) < 1 { + invalidParams.Add(request.NewErrParamMinLen("InputDataConfig", 1)) + } + if s.OutputDataConfig == nil { + invalidParams.Add(request.NewErrParamRequired("OutputDataConfig")) + } + if s.ResourceConfig == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceConfig")) + } + if s.StoppingCondition == nil { + invalidParams.Add(request.NewErrParamRequired("StoppingCondition")) + } + if s.TrainingInputMode == nil { + invalidParams.Add(request.NewErrParamRequired("TrainingInputMode")) + } + if s.InputDataConfig != nil { + for i, v := range s.InputDataConfig { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputDataConfig", i), err.(request.ErrInvalidParams)) + } + } + } + if s.OutputDataConfig != nil { + if err := s.OutputDataConfig.Validate(); err != nil { + invalidParams.AddNested("OutputDataConfig", err.(request.ErrInvalidParams)) + } + } + if s.ResourceConfig != nil { + if err := s.ResourceConfig.Validate(); err != nil { + invalidParams.AddNested("ResourceConfig", err.(request.ErrInvalidParams)) + } + } + if s.StoppingCondition != nil { + if err := s.StoppingCondition.Validate(); err != nil { + invalidParams.AddNested("StoppingCondition", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -23259,241 +41869,294 @@ func (s *StopLabelingJobInput) Validate() error { return nil } -// SetLabelingJobName sets the LabelingJobName field's value. -func (s *StopLabelingJobInput) SetLabelingJobName(v string) *StopLabelingJobInput { - s.LabelingJobName = &v +// SetHyperParameters sets the HyperParameters field's value. +func (s *TrainingJobDefinition) SetHyperParameters(v map[string]*string) *TrainingJobDefinition { + s.HyperParameters = v return s } -type StopLabelingJobOutput struct { - _ struct{} `type:"structure"` +// SetInputDataConfig sets the InputDataConfig field's value. +func (s *TrainingJobDefinition) SetInputDataConfig(v []*Channel) *TrainingJobDefinition { + s.InputDataConfig = v + return s } -// String returns the string representation -func (s StopLabelingJobOutput) String() string { - return awsutil.Prettify(s) +// SetOutputDataConfig sets the OutputDataConfig field's value. +func (s *TrainingJobDefinition) SetOutputDataConfig(v *OutputDataConfig) *TrainingJobDefinition { + s.OutputDataConfig = v + return s } -// GoString returns the string representation -func (s StopLabelingJobOutput) GoString() string { - return s.String() +// SetResourceConfig sets the ResourceConfig field's value. +func (s *TrainingJobDefinition) SetResourceConfig(v *ResourceConfig) *TrainingJobDefinition { + s.ResourceConfig = v + return s } -type StopNotebookInstanceInput struct { +// SetStoppingCondition sets the StoppingCondition field's value. +func (s *TrainingJobDefinition) SetStoppingCondition(v *StoppingCondition) *TrainingJobDefinition { + s.StoppingCondition = v + return s +} + +// SetTrainingInputMode sets the TrainingInputMode field's value. +func (s *TrainingJobDefinition) SetTrainingInputMode(v string) *TrainingJobDefinition { + s.TrainingInputMode = &v + return s +} + +// The numbers of training jobs launched by a hyperparameter tuning job, categorized +// by status. +type TrainingJobStatusCounters struct { _ struct{} `type:"structure"` - // The name of the notebook instance to terminate. - // - // NotebookInstanceName is a required field - NotebookInstanceName *string `type:"string" required:"true"` + // The number of completed training jobs launched by the hyperparameter tuning + // job. + Completed *int64 `type:"integer"` + + // The number of in-progress training jobs launched by a hyperparameter tuning + // job. + InProgress *int64 `type:"integer"` + + // The number of training jobs that failed and can't be retried. A failed training + // job can't be retried if it failed because a client error occurred. + NonRetryableError *int64 `type:"integer"` + + // The number of training jobs that failed, but can be retried. A failed training + // job can be retried only if it failed because an internal service error occurred. + RetryableError *int64 `type:"integer"` + + // The number of training jobs launched by a hyperparameter tuning job that + // were manually stopped. + Stopped *int64 `type:"integer"` } // String returns the string representation -func (s StopNotebookInstanceInput) String() string { +func (s TrainingJobStatusCounters) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s StopNotebookInstanceInput) GoString() string { +func (s TrainingJobStatusCounters) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopNotebookInstanceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopNotebookInstanceInput"} - if s.NotebookInstanceName == nil { - invalidParams.Add(request.NewErrParamRequired("NotebookInstanceName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCompleted sets the Completed field's value. +func (s *TrainingJobStatusCounters) SetCompleted(v int64) *TrainingJobStatusCounters { + s.Completed = &v + return s } -// SetNotebookInstanceName sets the NotebookInstanceName field's value. -func (s *StopNotebookInstanceInput) SetNotebookInstanceName(v string) *StopNotebookInstanceInput { - s.NotebookInstanceName = &v +// SetInProgress sets the InProgress field's value. +func (s *TrainingJobStatusCounters) SetInProgress(v int64) *TrainingJobStatusCounters { + s.InProgress = &v return s } -type StopNotebookInstanceOutput struct { - _ struct{} `type:"structure"` +// SetNonRetryableError sets the NonRetryableError field's value. +func (s *TrainingJobStatusCounters) SetNonRetryableError(v int64) *TrainingJobStatusCounters { + s.NonRetryableError = &v + return s } -// String returns the string representation -func (s StopNotebookInstanceOutput) String() string { - return awsutil.Prettify(s) +// SetRetryableError sets the RetryableError field's value. +func (s *TrainingJobStatusCounters) SetRetryableError(v int64) *TrainingJobStatusCounters { + s.RetryableError = &v + return s } -// GoString returns the string representation -func (s StopNotebookInstanceOutput) GoString() string { - return s.String() +// SetStopped sets the Stopped field's value. +func (s *TrainingJobStatusCounters) SetStopped(v int64) *TrainingJobStatusCounters { + s.Stopped = &v + return s } -type StopTrainingJobInput struct { +// Provides summary information about a training job. +type TrainingJobSummary struct { _ struct{} `type:"structure"` - // The name of the training job to stop. + // A timestamp that shows when the training job was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` + + // Timestamp when the training job was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // A timestamp that shows when the training job ended. This field is set only + // if the training job has one of the terminal statuses (Completed, Failed, + // or Stopped). + TrainingEndTime *time.Time `type:"timestamp"` + + // The Amazon Resource Name (ARN) of the training job. + // + // TrainingJobArn is a required field + TrainingJobArn *string `type:"string" required:"true"` + + // The name of the training job that you want a summary for. // // TrainingJobName is a required field TrainingJobName *string `min:"1" type:"string" required:"true"` + + // The status of the training job. + // + // TrainingJobStatus is a required field + TrainingJobStatus *string `type:"string" required:"true" enum:"TrainingJobStatus"` } // String returns the string representation -func (s StopTrainingJobInput) String() string { +func (s TrainingJobSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s StopTrainingJobInput) GoString() string { +func (s TrainingJobSummary) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopTrainingJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopTrainingJobInput"} - if s.TrainingJobName == nil { - invalidParams.Add(request.NewErrParamRequired("TrainingJobName")) - } - if s.TrainingJobName != nil && len(*s.TrainingJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TrainingJobName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTrainingJobName sets the TrainingJobName field's value. -func (s *StopTrainingJobInput) SetTrainingJobName(v string) *StopTrainingJobInput { - s.TrainingJobName = &v +// SetCreationTime sets the CreationTime field's value. +func (s *TrainingJobSummary) SetCreationTime(v time.Time) *TrainingJobSummary { + s.CreationTime = &v return s } -type StopTrainingJobOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s StopTrainingJobOutput) String() string { - return awsutil.Prettify(s) +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *TrainingJobSummary) SetLastModifiedTime(v time.Time) *TrainingJobSummary { + s.LastModifiedTime = &v + return s } -// GoString returns the string representation -func (s StopTrainingJobOutput) GoString() string { - return s.String() +// SetTrainingEndTime sets the TrainingEndTime field's value. +func (s *TrainingJobSummary) SetTrainingEndTime(v time.Time) *TrainingJobSummary { + s.TrainingEndTime = &v + return s } -type StopTransformJobInput struct { - _ struct{} `type:"structure"` - - // The name of the transform job to stop. - // - // TransformJobName is a required field - TransformJobName *string `min:"1" type:"string" required:"true"` +// SetTrainingJobArn sets the TrainingJobArn field's value. +func (s *TrainingJobSummary) SetTrainingJobArn(v string) *TrainingJobSummary { + s.TrainingJobArn = &v + return s } -// String returns the string representation -func (s StopTransformJobInput) String() string { - return awsutil.Prettify(s) +// SetTrainingJobName sets the TrainingJobName field's value. +func (s *TrainingJobSummary) SetTrainingJobName(v string) *TrainingJobSummary { + s.TrainingJobName = &v + return s } -// GoString returns the string representation -func (s StopTransformJobInput) GoString() string { - return s.String() +// SetTrainingJobStatus sets the TrainingJobStatus field's value. +func (s *TrainingJobSummary) SetTrainingJobStatus(v string) *TrainingJobSummary { + s.TrainingJobStatus = &v + return s } -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopTransformJobInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopTransformJobInput"} - if s.TransformJobName == nil { - invalidParams.Add(request.NewErrParamRequired("TransformJobName")) - } - if s.TransformJobName != nil && len(*s.TransformJobName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TransformJobName", 1)) - } +// Defines how the algorithm is used for a training job. +type TrainingSpecification struct { + _ struct{} `type:"structure"` - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} + // A list of MetricDefinition objects, which are used for parsing metrics generated + // by the algorithm. + MetricDefinitions []*MetricDefinition `type:"list"` -// SetTransformJobName sets the TransformJobName field's value. -func (s *StopTransformJobInput) SetTransformJobName(v string) *StopTransformJobInput { - s.TransformJobName = &v - return s -} + // A list of the HyperParameterSpecification objects, that define the supported + // hyperparameters. This is required if the algorithm supports automatic model + // tuning.> + SupportedHyperParameters []*HyperParameterSpecification `type:"list"` -type StopTransformJobOutput struct { - _ struct{} `type:"structure"` -} + // A list of the instance types that this algorithm can use for training. + // + // SupportedTrainingInstanceTypes is a required field + SupportedTrainingInstanceTypes []*string `type:"list" required:"true"` -// String returns the string representation -func (s StopTransformJobOutput) String() string { - return awsutil.Prettify(s) -} + // A list of the metrics that the algorithm emits that can be used as the objective + // metric in a hyperparameter tuning job. + SupportedTuningJobObjectiveMetrics []*HyperParameterTuningJobObjective `type:"list"` -// GoString returns the string representation -func (s StopTransformJobOutput) GoString() string { - return s.String() -} + // Indicates whether the algorithm supports distributed training. If set to + // false, buyers can't request more than one instance during training. + SupportsDistributedTraining *bool `type:"boolean"` -// Specifies a limit to how long a model training or compilation job can run. -// It also specifies how long you are willing to wait for a managed spot training -// job to complete. When the job reaches the time limit, Amazon SageMaker ends -// the training or compilation job. Use this API to cap model training costs. -// -// To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal, which -// delays job termination for 120 seconds. Algorithms can use this 120-second -// window to save the model artifacts, so the results of training are not lost. -// -// The training algorithms provided by Amazon SageMaker automatically save the -// intermediate results of a model training job when possible. This attempt -// to save artifacts is only a best effort case as model might not be in a state -// from which it can be saved. For example, if training has just started, the -// model might not be ready to save. When saved, this intermediate data is a -// valid model artifact. You can use it to create a model with CreateModel. -// -// The Neural Topic Model (NTM) currently does not support saving intermediate -// model artifacts. When training NTMs, make sure that the maximum runtime is -// sufficient for the training job to complete. -type StoppingCondition struct { - _ struct{} `type:"structure"` + // A list of ChannelSpecification objects, which specify the input sources to + // be used by the algorithm. + // + // TrainingChannels is a required field + TrainingChannels []*ChannelSpecification `min:"1" type:"list" required:"true"` - // The maximum length of time, in seconds, that the training or compilation - // job can run. If job does not complete during this time, Amazon SageMaker - // ends the job. If value is not specified, default value is 1 day. The maximum - // value is 28 days. - MaxRuntimeInSeconds *int64 `min:"1" type:"integer"` + // The Amazon ECR registry path of the Docker image that contains the training + // algorithm. + // + // TrainingImage is a required field + TrainingImage *string `type:"string" required:"true"` - // The maximum length of time, in seconds, how long you are willing to wait - // for a managed spot training job to complete. It is the amount of time spent - // waiting for Spot capacity plus the amount of time the training job runs. - // It must be equal to or greater than MaxRuntimeInSeconds. - MaxWaitTimeInSeconds *int64 `min:"1" type:"integer"` + // An MD5 hash of the training algorithm that identifies the Docker image used + // for training. + TrainingImageDigest *string `type:"string"` } // String returns the string representation -func (s StoppingCondition) String() string { +func (s TrainingSpecification) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s StoppingCondition) GoString() string { +func (s TrainingSpecification) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *StoppingCondition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StoppingCondition"} - if s.MaxRuntimeInSeconds != nil && *s.MaxRuntimeInSeconds < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxRuntimeInSeconds", 1)) +func (s *TrainingSpecification) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TrainingSpecification"} + if s.SupportedTrainingInstanceTypes == nil { + invalidParams.Add(request.NewErrParamRequired("SupportedTrainingInstanceTypes")) } - if s.MaxWaitTimeInSeconds != nil && *s.MaxWaitTimeInSeconds < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxWaitTimeInSeconds", 1)) + if s.TrainingChannels == nil { + invalidParams.Add(request.NewErrParamRequired("TrainingChannels")) + } + if s.TrainingChannels != nil && len(s.TrainingChannels) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrainingChannels", 1)) + } + if s.TrainingImage == nil { + invalidParams.Add(request.NewErrParamRequired("TrainingImage")) + } + if s.MetricDefinitions != nil { + for i, v := range s.MetricDefinitions { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricDefinitions", i), err.(request.ErrInvalidParams)) + } + } + } + if s.SupportedHyperParameters != nil { + for i, v := range s.SupportedHyperParameters { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SupportedHyperParameters", i), err.(request.ErrInvalidParams)) + } + } + } + if s.SupportedTuningJobObjectiveMetrics != nil { + for i, v := range s.SupportedTuningJobObjectiveMetrics { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SupportedTuningJobObjectiveMetrics", i), err.(request.ErrInvalidParams)) + } + } + } + if s.TrainingChannels != nil { + for i, v := range s.TrainingChannels { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TrainingChannels", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -23502,104 +42165,83 @@ func (s *StoppingCondition) Validate() error { return nil } -// SetMaxRuntimeInSeconds sets the MaxRuntimeInSeconds field's value. -func (s *StoppingCondition) SetMaxRuntimeInSeconds(v int64) *StoppingCondition { - s.MaxRuntimeInSeconds = &v +// SetMetricDefinitions sets the MetricDefinitions field's value. +func (s *TrainingSpecification) SetMetricDefinitions(v []*MetricDefinition) *TrainingSpecification { + s.MetricDefinitions = v return s } -// SetMaxWaitTimeInSeconds sets the MaxWaitTimeInSeconds field's value. -func (s *StoppingCondition) SetMaxWaitTimeInSeconds(v int64) *StoppingCondition { - s.MaxWaitTimeInSeconds = &v +// SetSupportedHyperParameters sets the SupportedHyperParameters field's value. +func (s *TrainingSpecification) SetSupportedHyperParameters(v []*HyperParameterSpecification) *TrainingSpecification { + s.SupportedHyperParameters = v return s } -// Describes a work team of a vendor that does the a labelling job. -type SubscribedWorkteam struct { - _ struct{} `type:"structure"` - - ListingId *string `type:"string"` - - // The description of the vendor from the Amazon Marketplace. - MarketplaceDescription *string `min:"1" type:"string"` - - // The title of the service provided by the vendor in the Amazon Marketplace. - MarketplaceTitle *string `min:"1" type:"string"` - - // The name of the vendor in the Amazon Marketplace. - SellerName *string `type:"string"` - - // The Amazon Resource Name (ARN) of the vendor that you have subscribed. - // - // WorkteamArn is a required field - WorkteamArn *string `type:"string" required:"true"` -} - -// String returns the string representation -func (s SubscribedWorkteam) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation -func (s SubscribedWorkteam) GoString() string { - return s.String() +// SetSupportedTrainingInstanceTypes sets the SupportedTrainingInstanceTypes field's value. +func (s *TrainingSpecification) SetSupportedTrainingInstanceTypes(v []*string) *TrainingSpecification { + s.SupportedTrainingInstanceTypes = v + return s } -// SetListingId sets the ListingId field's value. -func (s *SubscribedWorkteam) SetListingId(v string) *SubscribedWorkteam { - s.ListingId = &v +// SetSupportedTuningJobObjectiveMetrics sets the SupportedTuningJobObjectiveMetrics field's value. +func (s *TrainingSpecification) SetSupportedTuningJobObjectiveMetrics(v []*HyperParameterTuningJobObjective) *TrainingSpecification { + s.SupportedTuningJobObjectiveMetrics = v return s } -// SetMarketplaceDescription sets the MarketplaceDescription field's value. -func (s *SubscribedWorkteam) SetMarketplaceDescription(v string) *SubscribedWorkteam { - s.MarketplaceDescription = &v +// SetSupportsDistributedTraining sets the SupportsDistributedTraining field's value. +func (s *TrainingSpecification) SetSupportsDistributedTraining(v bool) *TrainingSpecification { + s.SupportsDistributedTraining = &v return s } -// SetMarketplaceTitle sets the MarketplaceTitle field's value. -func (s *SubscribedWorkteam) SetMarketplaceTitle(v string) *SubscribedWorkteam { - s.MarketplaceTitle = &v +// SetTrainingChannels sets the TrainingChannels field's value. +func (s *TrainingSpecification) SetTrainingChannels(v []*ChannelSpecification) *TrainingSpecification { + s.TrainingChannels = v return s } -// SetSellerName sets the SellerName field's value. -func (s *SubscribedWorkteam) SetSellerName(v string) *SubscribedWorkteam { - s.SellerName = &v +// SetTrainingImage sets the TrainingImage field's value. +func (s *TrainingSpecification) SetTrainingImage(v string) *TrainingSpecification { + s.TrainingImage = &v return s } -// SetWorkteamArn sets the WorkteamArn field's value. -func (s *SubscribedWorkteam) SetWorkteamArn(v string) *SubscribedWorkteam { - s.WorkteamArn = &v +// SetTrainingImageDigest sets the TrainingImageDigest field's value. +func (s *TrainingSpecification) SetTrainingImageDigest(v string) *TrainingSpecification { + s.TrainingImageDigest = &v return s } -// Limits the property names that are included in the response. -type SuggestionQuery struct { +// Describes the location of the channel data. +type TransformDataSource struct { _ struct{} `type:"structure"` - // A type of SuggestionQuery. Defines a property name hint. Only property names - // that match the specified hint are included in the response. - PropertyNameQuery *PropertyNameQuery `type:"structure"` + // The S3 location of the data source that is associated with a channel. + // + // S3DataSource is a required field + S3DataSource *TransformS3DataSource `type:"structure" required:"true"` } // String returns the string representation -func (s SuggestionQuery) String() string { +func (s TransformDataSource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s SuggestionQuery) GoString() string { +func (s TransformDataSource) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *SuggestionQuery) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SuggestionQuery"} - if s.PropertyNameQuery != nil { - if err := s.PropertyNameQuery.Validate(); err != nil { - invalidParams.AddNested("PropertyNameQuery", err.(request.ErrInvalidParams)) +func (s *TransformDataSource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TransformDataSource"} + if s.S3DataSource == nil { + invalidParams.Add(request.NewErrParamRequired("S3DataSource")) + } + if s.S3DataSource != nil { + if err := s.S3DataSource.Validate(); err != nil { + invalidParams.AddNested("S3DataSource", err.(request.ErrInvalidParams)) } } @@ -23609,48 +42251,80 @@ func (s *SuggestionQuery) Validate() error { return nil } -// SetPropertyNameQuery sets the PropertyNameQuery field's value. -func (s *SuggestionQuery) SetPropertyNameQuery(v *PropertyNameQuery) *SuggestionQuery { - s.PropertyNameQuery = v +// SetS3DataSource sets the S3DataSource field's value. +func (s *TransformDataSource) SetS3DataSource(v *TransformS3DataSource) *TransformDataSource { + s.S3DataSource = v return s } -// Describes a tag. -type Tag struct { +// Describes the input source of a transform job and the way the transform job +// consumes it. +type TransformInput struct { _ struct{} `type:"structure"` - // The tag key. + // If your transform data is compressed, specify the compression type. Amazon + // SageMaker automatically decompresses the data for the transform job accordingly. + // The default value is None. + CompressionType *string `type:"string" enum:"CompressionType"` + + // The multipurpose internet mail extension (MIME) type of the data. Amazon + // SageMaker uses the MIME type with each http call to transfer data to the + // transform job. + ContentType *string `type:"string"` + + // Describes the location of the channel data, which is, the S3 location of + // the input data that the model can consume. // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` + // DataSource is a required field + DataSource *TransformDataSource `type:"structure" required:"true"` - // The tag value. + // The method to use to split the transform job's data files into smaller batches. + // Splitting is necessary when the total size of each object is too large to + // fit in a single request. You can also use data splitting to improve performance + // by processing multiple concurrent mini-batches. The default value for SplitType + // is None, which indicates that input data files are not split, and request + // payloads contain the entire contents of an input object. Set the value of + // this parameter to Line to split records on a newline character boundary. + // SplitType also supports a number of record-oriented binary data formats. // - // Value is a required field - Value *string `type:"string" required:"true"` + // When splitting is enabled, the size of a mini-batch depends on the values + // of the BatchStrategy and MaxPayloadInMB parameters. When the value of BatchStrategy + // is MultiRecord, Amazon SageMaker sends the maximum number of records in each + // request, up to the MaxPayloadInMB limit. If the value of BatchStrategy is + // SingleRecord, Amazon SageMaker sends individual records in each request. + // + // Some data formats represent a record as a binary payload wrapped with extra + // padding bytes. When splitting is applied to a binary data format, padding + // is removed if the value of BatchStrategy is set to SingleRecord. Padding + // is not removed if the value of BatchStrategy is set to MultiRecord. + // + // For more information about RecordIO, see Create a Dataset Using RecordIO + // (https://mxnet.apache.org/api/faq/recordio) in the MXNet documentation. For + // more information about TFRecord, see Consuming TFRecord data (https://www.tensorflow.org/guide/datasets#consuming_tfrecord_data) + // in the TensorFlow documentation. + SplitType *string `type:"string" enum:"SplitType"` } // String returns the string representation -func (s Tag) String() string { +func (s TransformInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s Tag) GoString() string { +func (s TransformInput) 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)) +func (s *TransformInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TransformInput"} + if s.DataSource == nil { + invalidParams.Add(request.NewErrParamRequired("DataSource")) } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) + if s.DataSource != nil { + if err := s.DataSource.Validate(); err != nil { + invalidParams.AddNested("DataSource", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -23659,456 +42333,487 @@ func (s *Tag) Validate() error { return nil } -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v +// SetCompressionType sets the CompressionType field's value. +func (s *TransformInput) SetCompressionType(v string) *TransformInput { + s.CompressionType = &v return s } -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v +// SetContentType sets the ContentType field's value. +func (s *TransformInput) SetContentType(v string) *TransformInput { + s.ContentType = &v return s } -// Contains information about a training job. -type TrainingJob struct { +// SetDataSource sets the DataSource field's value. +func (s *TransformInput) SetDataSource(v *TransformDataSource) *TransformInput { + s.DataSource = v + return s +} + +// SetSplitType sets the SplitType field's value. +func (s *TransformInput) SetSplitType(v string) *TransformInput { + s.SplitType = &v + return s +} + +// Defines the input needed to run a transform job using the inference specification +// specified in the algorithm. +type TransformJobDefinition struct { _ struct{} `type:"structure"` - // Information about the algorithm used for training, and algorithm metadata. - AlgorithmSpecification *AlgorithmSpecification `type:"structure"` + // A string that determines the number of records included in a single mini-batch. + // + // SingleRecord means only one record is used per mini-batch. MultiRecord means + // a mini-batch is set to contain as many records that can fit within the MaxPayloadInMB + // limit. + BatchStrategy *string `type:"string" enum:"BatchStrategy"` - // A timestamp that indicates when the training job was created. - CreationTime *time.Time `type:"timestamp"` + // The environment variables to set in the Docker container. We support up to + // 16 key and values entries in the map. + Environment map[string]*string `type:"map"` - // To encrypt all communications between ML compute instances in distributed - // training, choose True. Encryption provides greater security for distributed - // training, but training might take longer. How long it takes depends on the - // amount of communication between compute instances, especially if you use - // a deep learning algorithm in distributed training. - EnableInterContainerTrafficEncryption *bool `type:"boolean"` + // The maximum number of parallel requests that can be sent to each instance + // in a transform job. The default value is 1. + MaxConcurrentTransforms *int64 `type:"integer"` - // If the TrainingJob was created with network isolation, the value is set to - // true. If network isolation is enabled, nodes can't communicate beyond the - // VPC they run in. - EnableNetworkIsolation *bool `type:"boolean"` + // The maximum payload size allowed, in MB. A payload is the data portion of + // a record (without metadata). + MaxPayloadInMB *int64 `type:"integer"` - // If the training job failed, the reason it failed. - FailureReason *string `type:"string"` + // A description of the input source and the way the transform job consumes + // it. + // + // TransformInput is a required field + TransformInput *TransformInput `type:"structure" required:"true"` - // A list of final metric values that are set when the training job completes. - // Used only if the training job was configured to use metrics. - FinalMetricDataList []*MetricData `type:"list"` + // Identifies the Amazon S3 location where you want Amazon SageMaker to save + // the results from the transform job. + // + // TransformOutput is a required field + TransformOutput *TransformOutput `type:"structure" required:"true"` - // Algorithm-specific parameters. - HyperParameters map[string]*string `type:"map"` + // Identifies the ML compute instances for the transform job. + // + // TransformResources is a required field + TransformResources *TransformResources `type:"structure" required:"true"` +} - // An array of Channel objects that describes each data input channel. - InputDataConfig []*Channel `min:"1" type:"list"` +// String returns the string representation +func (s TransformJobDefinition) String() string { + return awsutil.Prettify(s) +} - // The Amazon Resource Name (ARN) of the labeling job. - LabelingJobArn *string `type:"string"` +// GoString returns the string representation +func (s TransformJobDefinition) GoString() string { + return s.String() +} - // A timestamp that indicates when the status of the training job was last modified. - LastModifiedTime *time.Time `type:"timestamp"` +// Validate inspects the fields of the type to determine if they are valid. +func (s *TransformJobDefinition) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TransformJobDefinition"} + if s.TransformInput == nil { + invalidParams.Add(request.NewErrParamRequired("TransformInput")) + } + if s.TransformOutput == nil { + invalidParams.Add(request.NewErrParamRequired("TransformOutput")) + } + if s.TransformResources == nil { + invalidParams.Add(request.NewErrParamRequired("TransformResources")) + } + if s.TransformInput != nil { + if err := s.TransformInput.Validate(); err != nil { + invalidParams.AddNested("TransformInput", err.(request.ErrInvalidParams)) + } + } + if s.TransformOutput != nil { + if err := s.TransformOutput.Validate(); err != nil { + invalidParams.AddNested("TransformOutput", err.(request.ErrInvalidParams)) + } + } + if s.TransformResources != nil { + if err := s.TransformResources.Validate(); err != nil { + invalidParams.AddNested("TransformResources", err.(request.ErrInvalidParams)) + } + } - // Information about the Amazon S3 location that is configured for storing model - // artifacts. - ModelArtifacts *ModelArtifacts `type:"structure"` + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} - // The S3 path where model artifacts that you configured when creating the job - // are stored. Amazon SageMaker creates subfolders for model artifacts. - OutputDataConfig *OutputDataConfig `type:"structure"` +// SetBatchStrategy sets the BatchStrategy field's value. +func (s *TransformJobDefinition) SetBatchStrategy(v string) *TransformJobDefinition { + s.BatchStrategy = &v + return s +} - // Resources, including ML compute instances and ML storage volumes, that are - // configured for model training. - ResourceConfig *ResourceConfig `type:"structure"` +// SetEnvironment sets the Environment field's value. +func (s *TransformJobDefinition) SetEnvironment(v map[string]*string) *TransformJobDefinition { + s.Environment = v + return s +} - // The AWS Identity and Access Management (IAM) role configured for the training - // job. - RoleArn *string `min:"20" type:"string"` +// SetMaxConcurrentTransforms sets the MaxConcurrentTransforms field's value. +func (s *TransformJobDefinition) SetMaxConcurrentTransforms(v int64) *TransformJobDefinition { + s.MaxConcurrentTransforms = &v + return s +} - // Provides detailed information about the state of the training job. For detailed - // information about the secondary status of the training job, see StatusMessage - // under SecondaryStatusTransition. - // - // Amazon SageMaker provides primary statuses and secondary statuses that apply - // to each of them: - // - // InProgress - // - // * Starting - Starting the training job. - // - // * Downloading - An optional stage for algorithms that support File training - // input mode. It indicates that data is being downloaded to the ML storage - // volumes. - // - // * Training - Training is in progress. - // - // * Uploading - Training is complete and the model artifacts are being uploaded - // to the S3 location. - // - // Completed - // - // * Completed - The training job has completed. - // - // Failed - // - // * Failed - The training job has failed. The reason for the failure is - // returned in the FailureReason field of DescribeTrainingJobResponse. - // - // Stopped - // - // * MaxRuntimeExceeded - The job stopped because it exceeded the maximum - // allowed runtime. - // - // * Stopped - The training job has stopped. - // - // Stopping - // - // * Stopping - Stopping the training job. - // - // Valid values for SecondaryStatus are subject to change. - // - // We no longer support the following secondary statuses: - // - // * LaunchingMLInstances - // - // * PreparingTrainingStack - // - // * DownloadingTrainingImage - SecondaryStatus *string `type:"string" enum:"SecondaryStatus"` +// SetMaxPayloadInMB sets the MaxPayloadInMB field's value. +func (s *TransformJobDefinition) SetMaxPayloadInMB(v int64) *TransformJobDefinition { + s.MaxPayloadInMB = &v + return s +} + +// SetTransformInput sets the TransformInput field's value. +func (s *TransformJobDefinition) SetTransformInput(v *TransformInput) *TransformJobDefinition { + s.TransformInput = v + return s +} - // A history of all of the secondary statuses that the training job has transitioned - // through. - SecondaryStatusTransitions []*SecondaryStatusTransition `type:"list"` +// SetTransformOutput sets the TransformOutput field's value. +func (s *TransformJobDefinition) SetTransformOutput(v *TransformOutput) *TransformJobDefinition { + s.TransformOutput = v + return s +} - // Specifies a limit to how long a model training job can run. When the job - // reaches the time limit, Amazon SageMaker ends the training job. Use this - // API to cap model training costs. - // - // To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal, which - // delays job termination for 120 seconds. Algorithms can use this 120-second - // window to save the model artifacts, so the results of training are not lost. - StoppingCondition *StoppingCondition `type:"structure"` +// SetTransformResources sets the TransformResources field's value. +func (s *TransformJobDefinition) SetTransformResources(v *TransformResources) *TransformJobDefinition { + s.TransformResources = v + return s +} - // An array of key-value pairs. For more information, see Using Cost Allocation - // Tags (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-what) - // in the AWS Billing and Cost Management User Guide. - Tags []*Tag `type:"list"` +// Provides a summary of a transform job. Multiple TransformJobSummary objects +// are returned as a list after in response to a ListTransformJobs call. +type TransformJobSummary struct { + _ struct{} `type:"structure"` - // Indicates the time when the training job ends on training instances. You - // are billed for the time interval between the value of TrainingStartTime and - // this time. For successful jobs and stopped jobs, this is the time after model - // artifacts are uploaded. For failed jobs, this is the time when Amazon SageMaker - // detects a job failure. - TrainingEndTime *time.Time `type:"timestamp"` + // A timestamp that shows when the transform Job was created. + // + // CreationTime is a required field + CreationTime *time.Time `type:"timestamp" required:"true"` - // The Amazon Resource Name (ARN) of the training job. - TrainingJobArn *string `type:"string"` + // If the transform job failed, the reason it failed. + FailureReason *string `type:"string"` - // The name of the training job. - TrainingJobName *string `min:"1" type:"string"` + // Indicates when the transform job was last modified. + LastModifiedTime *time.Time `type:"timestamp"` - // The status of the training job. - // - // Training job statuses are: - // - // * InProgress - The training is in progress. - // - // * Completed - The training job has completed. - // - // * Failed - The training job has failed. To see the reason for the failure, - // see the FailureReason field in the response to a DescribeTrainingJobResponse - // call. - // - // * Stopping - The training job is stopping. - // - // * Stopped - The training job has stopped. - // - // For more detailed information, see SecondaryStatus. - TrainingJobStatus *string `type:"string" enum:"TrainingJobStatus"` + // Indicates when the transform job ends on compute instances. For successful + // jobs and stopped jobs, this is the exact time recorded after the results + // are uploaded. For failed jobs, this is when Amazon SageMaker detected that + // the job failed. + TransformEndTime *time.Time `type:"timestamp"` - // Indicates the time when the training job starts on training instances. You - // are billed for the time interval between this time and the value of TrainingEndTime. - // The start time in CloudWatch Logs might be later than this time. The difference - // is due to the time it takes to download the training data and to the size - // of the training container. - TrainingStartTime *time.Time `type:"timestamp"` + // The Amazon Resource Name (ARN) of the transform job. + // + // TransformJobArn is a required field + TransformJobArn *string `type:"string" required:"true"` - // The Amazon Resource Name (ARN) of the associated hyperparameter tuning job - // if the training job was launched by a hyperparameter tuning job. - TuningJobArn *string `type:"string"` + // The name of the transform job. + // + // TransformJobName is a required field + TransformJobName *string `min:"1" type:"string" required:"true"` - // A VpcConfig object that specifies the VPC that this training job has access - // to. For more information, see Protect Training Jobs by Using an Amazon Virtual - // Private Cloud (https://docs.aws.amazon.com/sagemaker/latest/dg/train-vpc.html). - VpcConfig *VpcConfig `type:"structure"` + // The status of the transform job. + // + // TransformJobStatus is a required field + TransformJobStatus *string `type:"string" required:"true" enum:"TransformJobStatus"` } // String returns the string representation -func (s TrainingJob) String() string { +func (s TransformJobSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TrainingJob) GoString() string { +func (s TransformJobSummary) GoString() string { return s.String() } -// SetAlgorithmSpecification sets the AlgorithmSpecification field's value. -func (s *TrainingJob) SetAlgorithmSpecification(v *AlgorithmSpecification) *TrainingJob { - s.AlgorithmSpecification = v - return s -} - // SetCreationTime sets the CreationTime field's value. -func (s *TrainingJob) SetCreationTime(v time.Time) *TrainingJob { +func (s *TransformJobSummary) SetCreationTime(v time.Time) *TransformJobSummary { s.CreationTime = &v return s } -// SetEnableInterContainerTrafficEncryption sets the EnableInterContainerTrafficEncryption field's value. -func (s *TrainingJob) SetEnableInterContainerTrafficEncryption(v bool) *TrainingJob { - s.EnableInterContainerTrafficEncryption = &v - return s -} - -// SetEnableNetworkIsolation sets the EnableNetworkIsolation field's value. -func (s *TrainingJob) SetEnableNetworkIsolation(v bool) *TrainingJob { - s.EnableNetworkIsolation = &v - return s -} - // SetFailureReason sets the FailureReason field's value. -func (s *TrainingJob) SetFailureReason(v string) *TrainingJob { +func (s *TransformJobSummary) SetFailureReason(v string) *TransformJobSummary { s.FailureReason = &v return s } -// SetFinalMetricDataList sets the FinalMetricDataList field's value. -func (s *TrainingJob) SetFinalMetricDataList(v []*MetricData) *TrainingJob { - s.FinalMetricDataList = v +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *TransformJobSummary) SetLastModifiedTime(v time.Time) *TransformJobSummary { + s.LastModifiedTime = &v return s } -// SetHyperParameters sets the HyperParameters field's value. -func (s *TrainingJob) SetHyperParameters(v map[string]*string) *TrainingJob { - s.HyperParameters = v +// SetTransformEndTime sets the TransformEndTime field's value. +func (s *TransformJobSummary) SetTransformEndTime(v time.Time) *TransformJobSummary { + s.TransformEndTime = &v return s } -// SetInputDataConfig sets the InputDataConfig field's value. -func (s *TrainingJob) SetInputDataConfig(v []*Channel) *TrainingJob { - s.InputDataConfig = v +// SetTransformJobArn sets the TransformJobArn field's value. +func (s *TransformJobSummary) SetTransformJobArn(v string) *TransformJobSummary { + s.TransformJobArn = &v return s } -// SetLabelingJobArn sets the LabelingJobArn field's value. -func (s *TrainingJob) SetLabelingJobArn(v string) *TrainingJob { - s.LabelingJobArn = &v +// SetTransformJobName sets the TransformJobName field's value. +func (s *TransformJobSummary) SetTransformJobName(v string) *TransformJobSummary { + s.TransformJobName = &v return s } -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *TrainingJob) SetLastModifiedTime(v time.Time) *TrainingJob { - s.LastModifiedTime = &v +// SetTransformJobStatus sets the TransformJobStatus field's value. +func (s *TransformJobSummary) SetTransformJobStatus(v string) *TransformJobSummary { + s.TransformJobStatus = &v return s } -// SetModelArtifacts sets the ModelArtifacts field's value. -func (s *TrainingJob) SetModelArtifacts(v *ModelArtifacts) *TrainingJob { - s.ModelArtifacts = v - return s +// Describes the results of a transform job. +type TransformOutput struct { + _ struct{} `type:"structure"` + + // The MIME type used to specify the output data. Amazon SageMaker uses the + // MIME type with each http call to transfer data from the transform job. + Accept *string `type:"string"` + + // Defines how to assemble the results of the transform job as a single S3 object. + // Choose a format that is most convenient to you. To concatenate the results + // in binary format, specify None. To add a newline character at the end of + // every transformed record, specify Line. + AssembleWith *string `type:"string" enum:"AssemblyType"` + + // The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to + // encrypt the model artifacts at rest using Amazon S3 server-side encryption. + // The KmsKeyId can be any of the following formats: + // + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Alias name: alias/ExampleAlias + // + // * Alias name ARN: arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias + // + // If you don't provide a KMS key ID, Amazon SageMaker uses the default KMS + // key for Amazon S3 for your role's account. For more information, see KMS-Managed + // Encryption Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) + // in the Amazon Simple Storage Service Developer Guide. + // + // The KMS key policy must grant permission to the IAM role that you specify + // in your CreateModel request. For more information, see Using Key Policies + // in AWS KMS (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) + // in the AWS Key Management Service Developer Guide. + KmsKeyId *string `type:"string"` + + // The Amazon S3 path where you want Amazon SageMaker to store the results of + // the transform job. For example, s3://bucket-name/key-name-prefix. + // + // For every S3 object used as input for the transform job, batch transform + // stores the transformed data with an .out suffix in a corresponding subfolder + // in the location in the output prefix. For example, for the input data stored + // at s3://bucket-name/input-name-prefix/dataset01/data.csv, batch transform + // stores the transformed data at s3://bucket-name/output-name-prefix/input-name-prefix/data.csv.out. + // Batch transform doesn't upload partially processed objects. For an input + // S3 object that contains multiple records, it creates an .out file only if + // the transform job succeeds on the entire file. When the input contains multiple + // S3 objects, the batch transform job processes the listed S3 objects and uploads + // only the output for successfully processed objects. If any object fails in + // the transform job batch transform marks the job as failed to prompt investigation. + // + // S3OutputPath is a required field + S3OutputPath *string `type:"string" required:"true"` } -// SetOutputDataConfig sets the OutputDataConfig field's value. -func (s *TrainingJob) SetOutputDataConfig(v *OutputDataConfig) *TrainingJob { - s.OutputDataConfig = v - return s +// String returns the string representation +func (s TransformOutput) String() string { + return awsutil.Prettify(s) } -// SetResourceConfig sets the ResourceConfig field's value. -func (s *TrainingJob) SetResourceConfig(v *ResourceConfig) *TrainingJob { - s.ResourceConfig = v - return s +// GoString returns the string representation +func (s TransformOutput) GoString() string { + return s.String() } -// SetRoleArn sets the RoleArn field's value. -func (s *TrainingJob) SetRoleArn(v string) *TrainingJob { - s.RoleArn = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *TransformOutput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TransformOutput"} + if s.S3OutputPath == nil { + invalidParams.Add(request.NewErrParamRequired("S3OutputPath")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetSecondaryStatus sets the SecondaryStatus field's value. -func (s *TrainingJob) SetSecondaryStatus(v string) *TrainingJob { - s.SecondaryStatus = &v +// SetAccept sets the Accept field's value. +func (s *TransformOutput) SetAccept(v string) *TransformOutput { + s.Accept = &v return s } -// SetSecondaryStatusTransitions sets the SecondaryStatusTransitions field's value. -func (s *TrainingJob) SetSecondaryStatusTransitions(v []*SecondaryStatusTransition) *TrainingJob { - s.SecondaryStatusTransitions = v +// SetAssembleWith sets the AssembleWith field's value. +func (s *TransformOutput) SetAssembleWith(v string) *TransformOutput { + s.AssembleWith = &v return s } -// SetStoppingCondition sets the StoppingCondition field's value. -func (s *TrainingJob) SetStoppingCondition(v *StoppingCondition) *TrainingJob { - s.StoppingCondition = v +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *TransformOutput) SetKmsKeyId(v string) *TransformOutput { + s.KmsKeyId = &v return s } -// SetTags sets the Tags field's value. -func (s *TrainingJob) SetTags(v []*Tag) *TrainingJob { - s.Tags = v +// SetS3OutputPath sets the S3OutputPath field's value. +func (s *TransformOutput) SetS3OutputPath(v string) *TransformOutput { + s.S3OutputPath = &v return s } -// SetTrainingEndTime sets the TrainingEndTime field's value. -func (s *TrainingJob) SetTrainingEndTime(v time.Time) *TrainingJob { - s.TrainingEndTime = &v - return s +// Describes the resources, including ML instance types and ML instance count, +// to use for transform job. +type TransformResources struct { + _ struct{} `type:"structure"` + + // The number of ML compute instances to use in the transform job. For distributed + // transform jobs, specify a value greater than 1. The default value is 1. + // + // InstanceCount is a required field + InstanceCount *int64 `min:"1" type:"integer" required:"true"` + + // The ML compute instance type for the transform job. If you are using built-in + // algorithms to transform moderately sized datasets, we recommend using ml.m4.xlarge + // or ml.m5.large instance types. + // + // InstanceType is a required field + InstanceType *string `type:"string" required:"true" enum:"TransformInstanceType"` + + // The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to + // encrypt model data on the storage volume attached to the ML compute instance(s) + // that run the batch transform job. The VolumeKmsKeyId can be any of the following + // formats: + // + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key ARN: arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Alias name: alias/ExampleAlias + // + // * Alias name ARN: arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias + VolumeKmsKeyId *string `type:"string"` } -// SetTrainingJobArn sets the TrainingJobArn field's value. -func (s *TrainingJob) SetTrainingJobArn(v string) *TrainingJob { - s.TrainingJobArn = &v - return s +// String returns the string representation +func (s TransformResources) String() string { + return awsutil.Prettify(s) } -// SetTrainingJobName sets the TrainingJobName field's value. -func (s *TrainingJob) SetTrainingJobName(v string) *TrainingJob { - s.TrainingJobName = &v - return s +// GoString returns the string representation +func (s TransformResources) GoString() string { + return s.String() } -// SetTrainingJobStatus sets the TrainingJobStatus field's value. -func (s *TrainingJob) SetTrainingJobStatus(v string) *TrainingJob { - s.TrainingJobStatus = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *TransformResources) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TransformResources"} + if s.InstanceCount == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceCount")) + } + if s.InstanceCount != nil && *s.InstanceCount < 1 { + invalidParams.Add(request.NewErrParamMinValue("InstanceCount", 1)) + } + if s.InstanceType == nil { + invalidParams.Add(request.NewErrParamRequired("InstanceType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetTrainingStartTime sets the TrainingStartTime field's value. -func (s *TrainingJob) SetTrainingStartTime(v time.Time) *TrainingJob { - s.TrainingStartTime = &v +// SetInstanceCount sets the InstanceCount field's value. +func (s *TransformResources) SetInstanceCount(v int64) *TransformResources { + s.InstanceCount = &v return s } -// SetTuningJobArn sets the TuningJobArn field's value. -func (s *TrainingJob) SetTuningJobArn(v string) *TrainingJob { - s.TuningJobArn = &v +// SetInstanceType sets the InstanceType field's value. +func (s *TransformResources) SetInstanceType(v string) *TransformResources { + s.InstanceType = &v return s } -// SetVpcConfig sets the VpcConfig field's value. -func (s *TrainingJob) SetVpcConfig(v *VpcConfig) *TrainingJob { - s.VpcConfig = v +// SetVolumeKmsKeyId sets the VolumeKmsKeyId field's value. +func (s *TransformResources) SetVolumeKmsKeyId(v string) *TransformResources { + s.VolumeKmsKeyId = &v return s } -// Defines the input needed to run a training job using the algorithm. -type TrainingJobDefinition struct { +// Describes the S3 data source. +type TransformS3DataSource struct { _ struct{} `type:"structure"` - // The hyperparameters used for the training job. - HyperParameters map[string]*string `type:"map"` - - // An array of Channel objects, each of which specifies an input source. - // - // InputDataConfig is a required field - InputDataConfig []*Channel `min:"1" type:"list" required:"true"` - - // the path to the S3 bucket where you want to store model artifacts. Amazon - // SageMaker creates subfolders for the artifacts. + // If you choose S3Prefix, S3Uri identifies a key name prefix. Amazon SageMaker + // uses all objects with the specified key name prefix for batch transform. // - // OutputDataConfig is a required field - OutputDataConfig *OutputDataConfig `type:"structure" required:"true"` - - // The resources, including the ML compute instances and ML storage volumes, - // to use for model training. + // If you choose ManifestFile, S3Uri identifies an object that is a manifest + // file containing a list of object keys that you want Amazon SageMaker to use + // for batch transform. // - // ResourceConfig is a required field - ResourceConfig *ResourceConfig `type:"structure" required:"true"` - - // Specifies a limit to how long a model training job can run. When the job - // reaches the time limit, Amazon SageMaker ends the training job. Use this - // API to cap model training costs. + // The following values are compatible: ManifestFile, S3Prefix // - // To stop a job, Amazon SageMaker sends the algorithm the SIGTERM signal, which - // delays job termination for 120 seconds. Algorithms can use this 120-second - // window to save the model artifacts. + // The following value is not compatible: AugmentedManifestFile // - // StoppingCondition is a required field - StoppingCondition *StoppingCondition `type:"structure" required:"true"` + // S3DataType is a required field + S3DataType *string `type:"string" required:"true" enum:"S3DataType"` - // The input mode used by the algorithm for the training job. For the input - // modes that Amazon SageMaker algorithms support, see Algorithms (https://docs.aws.amazon.com/sagemaker/latest/dg/algos.html). + // Depending on the value specified for the S3DataType, identifies either a + // key name prefix or a manifest. For example: // - // If an algorithm supports the File input mode, Amazon SageMaker downloads - // the training data from S3 to the provisioned ML storage Volume, and mounts - // the directory to docker volume for training container. If an algorithm supports - // the Pipe input mode, Amazon SageMaker streams data directly from S3 to the - // container. + // * A key name prefix might look like this: s3://bucketname/exampleprefix. // - // TrainingInputMode is a required field - TrainingInputMode *string `type:"string" required:"true" enum:"TrainingInputMode"` + // * A manifest might look like this: s3://bucketname/example.manifest The + // manifest is an S3 object which is a JSON file with the following format: + // [ {"prefix": "s3://customer_bucket/some/prefix/"}, "relative/path/to/custdata-1", + // "relative/path/custdata-2", ... "relative/path/custdata-N" ] The preceding + // JSON matches the following s3Uris: s3://customer_bucket/some/prefix/relative/path/to/custdata-1 + // s3://customer_bucket/some/prefix/relative/path/custdata-2 ... s3://customer_bucket/some/prefix/relative/path/custdata-N + // The complete set of S3Uris in this manifest constitutes the input data + // for the channel for this datasource. The object that each S3Uris points + // to must be readable by the IAM role that Amazon SageMaker uses to perform + // tasks on your behalf. + // + // S3Uri is a required field + S3Uri *string `type:"string" required:"true"` } // String returns the string representation -func (s TrainingJobDefinition) String() string { +func (s TransformS3DataSource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TrainingJobDefinition) GoString() string { +func (s TransformS3DataSource) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *TrainingJobDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TrainingJobDefinition"} - if s.InputDataConfig == nil { - invalidParams.Add(request.NewErrParamRequired("InputDataConfig")) - } - if s.InputDataConfig != nil && len(s.InputDataConfig) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InputDataConfig", 1)) - } - if s.OutputDataConfig == nil { - invalidParams.Add(request.NewErrParamRequired("OutputDataConfig")) - } - if s.ResourceConfig == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceConfig")) - } - if s.StoppingCondition == nil { - invalidParams.Add(request.NewErrParamRequired("StoppingCondition")) - } - if s.TrainingInputMode == nil { - invalidParams.Add(request.NewErrParamRequired("TrainingInputMode")) - } - if s.InputDataConfig != nil { - for i, v := range s.InputDataConfig { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InputDataConfig", i), err.(request.ErrInvalidParams)) - } - } - } - if s.OutputDataConfig != nil { - if err := s.OutputDataConfig.Validate(); err != nil { - invalidParams.AddNested("OutputDataConfig", err.(request.ErrInvalidParams)) - } - } - if s.ResourceConfig != nil { - if err := s.ResourceConfig.Validate(); err != nil { - invalidParams.AddNested("ResourceConfig", err.(request.ErrInvalidParams)) - } +func (s *TransformS3DataSource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TransformS3DataSource"} + if s.S3DataType == nil { + invalidParams.Add(request.NewErrParamRequired("S3DataType")) } - if s.StoppingCondition != nil { - if err := s.StoppingCondition.Validate(); err != nil { - invalidParams.AddNested("StoppingCondition", err.(request.ErrInvalidParams)) - } + if s.S3Uri == nil { + invalidParams.Add(request.NewErrParamRequired("S3Uri")) } if invalidParams.Len() > 0 { @@ -24117,294 +42822,358 @@ func (s *TrainingJobDefinition) Validate() error { return nil } -// SetHyperParameters sets the HyperParameters field's value. -func (s *TrainingJobDefinition) SetHyperParameters(v map[string]*string) *TrainingJobDefinition { - s.HyperParameters = v +// SetS3DataType sets the S3DataType field's value. +func (s *TransformS3DataSource) SetS3DataType(v string) *TransformS3DataSource { + s.S3DataType = &v return s } -// SetInputDataConfig sets the InputDataConfig field's value. -func (s *TrainingJobDefinition) SetInputDataConfig(v []*Channel) *TrainingJobDefinition { - s.InputDataConfig = v +// SetS3Uri sets the S3Uri field's value. +func (s *TransformS3DataSource) SetS3Uri(v string) *TransformS3DataSource { + s.S3Uri = &v + return s +} + +// A summary of the properties of a trial as returned by the Search API. +type Trial struct { + _ struct{} `type:"structure"` + + // Information about the user who created or modified an experiment, trial, + // or trial component. + CreatedBy *UserContext `type:"structure"` + + // When the trial was created. + CreationTime *time.Time `type:"timestamp"` + + // The name of the trial as displayed. If DisplayName isn't specified, TrialName + // is displayed. + DisplayName *string `min:"1" type:"string"` + + // The name of the experiment the trial is part of. + ExperimentName *string `min:"1" type:"string"` + + // Information about the user who created or modified an experiment, trial, + // or trial component. + LastModifiedBy *UserContext `type:"structure"` + + // Who last modified the trial. + LastModifiedTime *time.Time `type:"timestamp"` + + // The source of the trial. + Source *TrialSource `type:"structure"` + + // The list of tags that are associated with the trial. You can use Search API + // to search on the tags. + Tags []*Tag `type:"list"` + + // The Amazon Resource Name (ARN) of the trial. + TrialArn *string `type:"string"` + + // A list of the components associated with the trial. For each component, a + // summary of the component's properties is included. + TrialComponentSummaries []*TrialComponentSimpleSummary `type:"list"` + + // The name of the trial. + TrialName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s Trial) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Trial) GoString() string { + return s.String() +} + +// SetCreatedBy sets the CreatedBy field's value. +func (s *Trial) SetCreatedBy(v *UserContext) *Trial { + s.CreatedBy = v + return s +} + +// SetCreationTime sets the CreationTime field's value. +func (s *Trial) SetCreationTime(v time.Time) *Trial { + s.CreationTime = &v + return s +} + +// SetDisplayName sets the DisplayName field's value. +func (s *Trial) SetDisplayName(v string) *Trial { + s.DisplayName = &v + return s +} + +// SetExperimentName sets the ExperimentName field's value. +func (s *Trial) SetExperimentName(v string) *Trial { + s.ExperimentName = &v + return s +} + +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *Trial) SetLastModifiedBy(v *UserContext) *Trial { + s.LastModifiedBy = v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *Trial) SetLastModifiedTime(v time.Time) *Trial { + s.LastModifiedTime = &v + return s +} + +// SetSource sets the Source field's value. +func (s *Trial) SetSource(v *TrialSource) *Trial { + s.Source = v return s } -// SetOutputDataConfig sets the OutputDataConfig field's value. -func (s *TrainingJobDefinition) SetOutputDataConfig(v *OutputDataConfig) *TrainingJobDefinition { - s.OutputDataConfig = v +// SetTags sets the Tags field's value. +func (s *Trial) SetTags(v []*Tag) *Trial { + s.Tags = v return s } -// SetResourceConfig sets the ResourceConfig field's value. -func (s *TrainingJobDefinition) SetResourceConfig(v *ResourceConfig) *TrainingJobDefinition { - s.ResourceConfig = v +// SetTrialArn sets the TrialArn field's value. +func (s *Trial) SetTrialArn(v string) *Trial { + s.TrialArn = &v return s } -// SetStoppingCondition sets the StoppingCondition field's value. -func (s *TrainingJobDefinition) SetStoppingCondition(v *StoppingCondition) *TrainingJobDefinition { - s.StoppingCondition = v +// SetTrialComponentSummaries sets the TrialComponentSummaries field's value. +func (s *Trial) SetTrialComponentSummaries(v []*TrialComponentSimpleSummary) *Trial { + s.TrialComponentSummaries = v return s } -// SetTrainingInputMode sets the TrainingInputMode field's value. -func (s *TrainingJobDefinition) SetTrainingInputMode(v string) *TrainingJobDefinition { - s.TrainingInputMode = &v +// SetTrialName sets the TrialName field's value. +func (s *Trial) SetTrialName(v string) *Trial { + s.TrialName = &v return s } -// The numbers of training jobs launched by a hyperparameter tuning job, categorized -// by status. -type TrainingJobStatusCounters struct { +// A summary of the properties of a trial component as returned by the Search +// API. +type TrialComponent struct { _ struct{} `type:"structure"` - // The number of completed training jobs launched by the hyperparameter tuning - // job. - Completed *int64 `type:"integer"` + // Information about the user who created or modified an experiment, trial, + // or trial component. + CreatedBy *UserContext `type:"structure"` - // The number of in-progress training jobs launched by a hyperparameter tuning - // job. - InProgress *int64 `type:"integer"` + // When the component was created. + CreationTime *time.Time `type:"timestamp"` - // The number of training jobs that failed and can't be retried. A failed training - // job can't be retried if it failed because a client error occurred. - NonRetryableError *int64 `type:"integer"` + // The name of the component as displayed. If DisplayName isn't specified, TrialComponentName + // is displayed. + DisplayName *string `min:"1" type:"string"` - // The number of training jobs that failed, but can be retried. A failed training - // job can be retried only if it failed because an internal service error occurred. - RetryableError *int64 `type:"integer"` + // When the component ended. + EndTime *time.Time `type:"timestamp"` - // The number of training jobs launched by a hyperparameter tuning job that - // were manually stopped. - Stopped *int64 `type:"integer"` + // The input artifacts of the component. + InputArtifacts map[string]*TrialComponentArtifact `type:"map"` + + // Information about the user who created or modified an experiment, trial, + // or trial component. + LastModifiedBy *UserContext `type:"structure"` + + // When the component was last modified. + LastModifiedTime *time.Time `type:"timestamp"` + + // The metrics for the component. + Metrics []*TrialComponentMetricSummary `type:"list"` + + // The output artifacts of the component. + OutputArtifacts map[string]*TrialComponentArtifact `type:"map"` + + // The hyperparameters of the component. + Parameters map[string]*TrialComponentParameterValue `type:"map"` + + // An array of the parents of the component. A parent is a trial the component + // is associated with and the experiment the trial is part of. A component might + // not have any parents. + Parents []*Parent `type:"list"` + + // The source of the trial component. + Source *TrialComponentSource `type:"structure"` + + // The source of the trial component.> + SourceDetail *TrialComponentSourceDetail `type:"structure"` + + // When the component started. + StartTime *time.Time `type:"timestamp"` + + // The status of the trial component. + Status *TrialComponentStatus `type:"structure"` + + // The list of tags that are associated with the component. You can use Search + // API to search on the tags. + Tags []*Tag `type:"list"` + + // The Amazon Resource Name (ARN) of the trial component. + TrialComponentArn *string `type:"string"` + + // The name of the trial component. + TrialComponentName *string `min:"1" type:"string"` } // String returns the string representation -func (s TrainingJobStatusCounters) String() string { +func (s TrialComponent) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TrainingJobStatusCounters) GoString() string { +func (s TrialComponent) GoString() string { return s.String() } -// SetCompleted sets the Completed field's value. -func (s *TrainingJobStatusCounters) SetCompleted(v int64) *TrainingJobStatusCounters { - s.Completed = &v +// SetCreatedBy sets the CreatedBy field's value. +func (s *TrialComponent) SetCreatedBy(v *UserContext) *TrialComponent { + s.CreatedBy = v return s } -// SetInProgress sets the InProgress field's value. -func (s *TrainingJobStatusCounters) SetInProgress(v int64) *TrainingJobStatusCounters { - s.InProgress = &v +// SetCreationTime sets the CreationTime field's value. +func (s *TrialComponent) SetCreationTime(v time.Time) *TrialComponent { + s.CreationTime = &v return s } -// SetNonRetryableError sets the NonRetryableError field's value. -func (s *TrainingJobStatusCounters) SetNonRetryableError(v int64) *TrainingJobStatusCounters { - s.NonRetryableError = &v +// SetDisplayName sets the DisplayName field's value. +func (s *TrialComponent) SetDisplayName(v string) *TrialComponent { + s.DisplayName = &v return s } -// SetRetryableError sets the RetryableError field's value. -func (s *TrainingJobStatusCounters) SetRetryableError(v int64) *TrainingJobStatusCounters { - s.RetryableError = &v +// SetEndTime sets the EndTime field's value. +func (s *TrialComponent) SetEndTime(v time.Time) *TrialComponent { + s.EndTime = &v return s } -// SetStopped sets the Stopped field's value. -func (s *TrainingJobStatusCounters) SetStopped(v int64) *TrainingJobStatusCounters { - s.Stopped = &v +// SetInputArtifacts sets the InputArtifacts field's value. +func (s *TrialComponent) SetInputArtifacts(v map[string]*TrialComponentArtifact) *TrialComponent { + s.InputArtifacts = v return s } -// Provides summary information about a training job. -type TrainingJobSummary struct { - _ struct{} `type:"structure"` - - // A timestamp that shows when the training job was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` - - // Timestamp when the training job was last modified. - LastModifiedTime *time.Time `type:"timestamp"` +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *TrialComponent) SetLastModifiedBy(v *UserContext) *TrialComponent { + s.LastModifiedBy = v + return s +} - // A timestamp that shows when the training job ended. This field is set only - // if the training job has one of the terminal statuses (Completed, Failed, - // or Stopped). - TrainingEndTime *time.Time `type:"timestamp"` +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *TrialComponent) SetLastModifiedTime(v time.Time) *TrialComponent { + s.LastModifiedTime = &v + return s +} - // The Amazon Resource Name (ARN) of the training job. - // - // TrainingJobArn is a required field - TrainingJobArn *string `type:"string" required:"true"` +// SetMetrics sets the Metrics field's value. +func (s *TrialComponent) SetMetrics(v []*TrialComponentMetricSummary) *TrialComponent { + s.Metrics = v + return s +} - // The name of the training job that you want a summary for. - // - // TrainingJobName is a required field - TrainingJobName *string `min:"1" type:"string" required:"true"` +// SetOutputArtifacts sets the OutputArtifacts field's value. +func (s *TrialComponent) SetOutputArtifacts(v map[string]*TrialComponentArtifact) *TrialComponent { + s.OutputArtifacts = v + return s +} - // The status of the training job. - // - // TrainingJobStatus is a required field - TrainingJobStatus *string `type:"string" required:"true" enum:"TrainingJobStatus"` +// SetParameters sets the Parameters field's value. +func (s *TrialComponent) SetParameters(v map[string]*TrialComponentParameterValue) *TrialComponent { + s.Parameters = v + return s } -// String returns the string representation -func (s TrainingJobSummary) String() string { - return awsutil.Prettify(s) +// SetParents sets the Parents field's value. +func (s *TrialComponent) SetParents(v []*Parent) *TrialComponent { + s.Parents = v + return s } -// GoString returns the string representation -func (s TrainingJobSummary) GoString() string { - return s.String() +// SetSource sets the Source field's value. +func (s *TrialComponent) SetSource(v *TrialComponentSource) *TrialComponent { + s.Source = v + return s } -// SetCreationTime sets the CreationTime field's value. -func (s *TrainingJobSummary) SetCreationTime(v time.Time) *TrainingJobSummary { - s.CreationTime = &v +// SetSourceDetail sets the SourceDetail field's value. +func (s *TrialComponent) SetSourceDetail(v *TrialComponentSourceDetail) *TrialComponent { + s.SourceDetail = v return s } -// SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *TrainingJobSummary) SetLastModifiedTime(v time.Time) *TrainingJobSummary { - s.LastModifiedTime = &v +// SetStartTime sets the StartTime field's value. +func (s *TrialComponent) SetStartTime(v time.Time) *TrialComponent { + s.StartTime = &v return s } -// SetTrainingEndTime sets the TrainingEndTime field's value. -func (s *TrainingJobSummary) SetTrainingEndTime(v time.Time) *TrainingJobSummary { - s.TrainingEndTime = &v +// SetStatus sets the Status field's value. +func (s *TrialComponent) SetStatus(v *TrialComponentStatus) *TrialComponent { + s.Status = v return s } -// SetTrainingJobArn sets the TrainingJobArn field's value. -func (s *TrainingJobSummary) SetTrainingJobArn(v string) *TrainingJobSummary { - s.TrainingJobArn = &v +// SetTags sets the Tags field's value. +func (s *TrialComponent) SetTags(v []*Tag) *TrialComponent { + s.Tags = v return s } -// SetTrainingJobName sets the TrainingJobName field's value. -func (s *TrainingJobSummary) SetTrainingJobName(v string) *TrainingJobSummary { - s.TrainingJobName = &v +// SetTrialComponentArn sets the TrialComponentArn field's value. +func (s *TrialComponent) SetTrialComponentArn(v string) *TrialComponent { + s.TrialComponentArn = &v return s } -// SetTrainingJobStatus sets the TrainingJobStatus field's value. -func (s *TrainingJobSummary) SetTrainingJobStatus(v string) *TrainingJobSummary { - s.TrainingJobStatus = &v +// SetTrialComponentName sets the TrialComponentName field's value. +func (s *TrialComponent) SetTrialComponentName(v string) *TrialComponent { + s.TrialComponentName = &v return s } -// Defines how the algorithm is used for a training job. -type TrainingSpecification struct { +// Represents an input or output artifact of a trial component. You specify +// TrialComponentArtifact as part of the InputArtifacts and OutputArtifacts +// parameters in the CreateTrialComponent request. +// +// Examples of input artifacts are datasets, algorithms, hyperparameters, source +// code, and instance types. Examples of output artifacts are metrics, snapshots, +// logs, and images. +type TrialComponentArtifact struct { _ struct{} `type:"structure"` - // A list of MetricDefinition objects, which are used for parsing metrics generated - // by the algorithm. - MetricDefinitions []*MetricDefinition `type:"list"` - - // A list of the HyperParameterSpecification objects, that define the supported - // hyperparameters. This is required if the algorithm supports automatic model - // tuning.> - SupportedHyperParameters []*HyperParameterSpecification `type:"list"` - - // A list of the instance types that this algorithm can use for training. - // - // SupportedTrainingInstanceTypes is a required field - SupportedTrainingInstanceTypes []*string `type:"list" required:"true"` - - // A list of the metrics that the algorithm emits that can be used as the objective - // metric in a hyperparameter tuning job. - SupportedTuningJobObjectiveMetrics []*HyperParameterTuningJobObjective `type:"list"` - - // Indicates whether the algorithm supports distributed training. If set to - // false, buyers can’t request more than one instance during training. - SupportsDistributedTraining *bool `type:"boolean"` - - // A list of ChannelSpecification objects, which specify the input sources to - // be used by the algorithm. - // - // TrainingChannels is a required field - TrainingChannels []*ChannelSpecification `min:"1" type:"list" required:"true"` + // The media type of the artifact, which indicates the type of data in the artifact + // file. The media type consists of a type and a subtype concatenated with a + // slash (/) character, for example, text/csv, image/jpeg, and s3/uri. The type + // specifies the category of the media. The subtype specifies the kind of data. + MediaType *string `type:"string"` - // The Amazon ECR registry path of the Docker image that contains the training - // algorithm. + // The location of the artifact. // - // TrainingImage is a required field - TrainingImage *string `type:"string" required:"true"` - - // An MD5 hash of the training algorithm that identifies the Docker image used - // for training. - TrainingImageDigest *string `type:"string"` + // Value is a required field + Value *string `type:"string" required:"true"` } // String returns the string representation -func (s TrainingSpecification) String() string { +func (s TrialComponentArtifact) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TrainingSpecification) GoString() string { +func (s TrialComponentArtifact) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *TrainingSpecification) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TrainingSpecification"} - if s.SupportedTrainingInstanceTypes == nil { - invalidParams.Add(request.NewErrParamRequired("SupportedTrainingInstanceTypes")) - } - if s.TrainingChannels == nil { - invalidParams.Add(request.NewErrParamRequired("TrainingChannels")) - } - if s.TrainingChannels != nil && len(s.TrainingChannels) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TrainingChannels", 1)) - } - if s.TrainingImage == nil { - invalidParams.Add(request.NewErrParamRequired("TrainingImage")) - } - if s.MetricDefinitions != nil { - for i, v := range s.MetricDefinitions { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "MetricDefinitions", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SupportedHyperParameters != nil { - for i, v := range s.SupportedHyperParameters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SupportedHyperParameters", i), err.(request.ErrInvalidParams)) - } - } - } - if s.SupportedTuningJobObjectiveMetrics != nil { - for i, v := range s.SupportedTuningJobObjectiveMetrics { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "SupportedTuningJobObjectiveMetrics", i), err.(request.ErrInvalidParams)) - } - } - } - if s.TrainingChannels != nil { - for i, v := range s.TrainingChannels { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TrainingChannels", i), err.(request.ErrInvalidParams)) - } - } +func (s *TrialComponentArtifact) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TrialComponentArtifact"} + if s.Value == nil { + invalidParams.Add(request.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { @@ -24413,650 +43182,567 @@ func (s *TrainingSpecification) Validate() error { return nil } -// SetMetricDefinitions sets the MetricDefinitions field's value. -func (s *TrainingSpecification) SetMetricDefinitions(v []*MetricDefinition) *TrainingSpecification { - s.MetricDefinitions = v +// SetMediaType sets the MediaType field's value. +func (s *TrialComponentArtifact) SetMediaType(v string) *TrialComponentArtifact { + s.MediaType = &v return s } -// SetSupportedHyperParameters sets the SupportedHyperParameters field's value. -func (s *TrainingSpecification) SetSupportedHyperParameters(v []*HyperParameterSpecification) *TrainingSpecification { - s.SupportedHyperParameters = v +// SetValue sets the Value field's value. +func (s *TrialComponentArtifact) SetValue(v string) *TrialComponentArtifact { + s.Value = &v return s } -// SetSupportedTrainingInstanceTypes sets the SupportedTrainingInstanceTypes field's value. -func (s *TrainingSpecification) SetSupportedTrainingInstanceTypes(v []*string) *TrainingSpecification { - s.SupportedTrainingInstanceTypes = v +// A summary of the metrics of a trial component. +type TrialComponentMetricSummary struct { + _ struct{} `type:"structure"` + + // The average value of the metric. + Avg *float64 `type:"double"` + + // The number of samples used to generate the metric. + Count *int64 `type:"integer"` + + // The most recent value of the metric. + Last *float64 `type:"double"` + + // The maximum value of the metric. + Max *float64 `type:"double"` + + // The name of the metric. + MetricName *string `min:"1" type:"string"` + + // The minimum value of the metric. + Min *float64 `type:"double"` + + // The Amazon Resource Name (ARN) of the source. + SourceArn *string `type:"string"` + + // The standard deviation of the metric. + StdDev *float64 `type:"double"` + + // When the metric was last updated. + TimeStamp *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s TrialComponentMetricSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TrialComponentMetricSummary) GoString() string { + return s.String() +} + +// SetAvg sets the Avg field's value. +func (s *TrialComponentMetricSummary) SetAvg(v float64) *TrialComponentMetricSummary { + s.Avg = &v return s } -// SetSupportedTuningJobObjectiveMetrics sets the SupportedTuningJobObjectiveMetrics field's value. -func (s *TrainingSpecification) SetSupportedTuningJobObjectiveMetrics(v []*HyperParameterTuningJobObjective) *TrainingSpecification { - s.SupportedTuningJobObjectiveMetrics = v +// SetCount sets the Count field's value. +func (s *TrialComponentMetricSummary) SetCount(v int64) *TrialComponentMetricSummary { + s.Count = &v return s } -// SetSupportsDistributedTraining sets the SupportsDistributedTraining field's value. -func (s *TrainingSpecification) SetSupportsDistributedTraining(v bool) *TrainingSpecification { - s.SupportsDistributedTraining = &v +// SetLast sets the Last field's value. +func (s *TrialComponentMetricSummary) SetLast(v float64) *TrialComponentMetricSummary { + s.Last = &v return s } -// SetTrainingChannels sets the TrainingChannels field's value. -func (s *TrainingSpecification) SetTrainingChannels(v []*ChannelSpecification) *TrainingSpecification { - s.TrainingChannels = v +// SetMax sets the Max field's value. +func (s *TrialComponentMetricSummary) SetMax(v float64) *TrialComponentMetricSummary { + s.Max = &v return s } -// SetTrainingImage sets the TrainingImage field's value. -func (s *TrainingSpecification) SetTrainingImage(v string) *TrainingSpecification { - s.TrainingImage = &v +// SetMetricName sets the MetricName field's value. +func (s *TrialComponentMetricSummary) SetMetricName(v string) *TrialComponentMetricSummary { + s.MetricName = &v return s } -// SetTrainingImageDigest sets the TrainingImageDigest field's value. -func (s *TrainingSpecification) SetTrainingImageDigest(v string) *TrainingSpecification { - s.TrainingImageDigest = &v +// SetMin sets the Min field's value. +func (s *TrialComponentMetricSummary) SetMin(v float64) *TrialComponentMetricSummary { + s.Min = &v return s } -// Describes the location of the channel data. -type TransformDataSource struct { +// SetSourceArn sets the SourceArn field's value. +func (s *TrialComponentMetricSummary) SetSourceArn(v string) *TrialComponentMetricSummary { + s.SourceArn = &v + return s +} + +// SetStdDev sets the StdDev field's value. +func (s *TrialComponentMetricSummary) SetStdDev(v float64) *TrialComponentMetricSummary { + s.StdDev = &v + return s +} + +// SetTimeStamp sets the TimeStamp field's value. +func (s *TrialComponentMetricSummary) SetTimeStamp(v time.Time) *TrialComponentMetricSummary { + s.TimeStamp = &v + return s +} + +// The value of a hyperparameter. Only one of NumberValue or StringValue can +// be specified. +// +// This object is specified in the CreateTrialComponent request. +type TrialComponentParameterValue struct { _ struct{} `type:"structure"` - // The S3 location of the data source that is associated with a channel. - // - // S3DataSource is a required field - S3DataSource *TransformS3DataSource `type:"structure" required:"true"` + // The numeric value of a numeric hyperparameter. If you specify a value for + // this parameter, you can't specify the StringValue parameter. + NumberValue *float64 `type:"double"` + + // The string value of a categorical hyperparameter. If you specify a value + // for this parameter, you can't specify the NumberValue parameter. + StringValue *string `type:"string"` } // String returns the string representation -func (s TransformDataSource) String() string { +func (s TrialComponentParameterValue) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TransformDataSource) GoString() string { +func (s TrialComponentParameterValue) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *TransformDataSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TransformDataSource"} - if s.S3DataSource == nil { - invalidParams.Add(request.NewErrParamRequired("S3DataSource")) - } - if s.S3DataSource != nil { - if err := s.S3DataSource.Validate(); err != nil { - invalidParams.AddNested("S3DataSource", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetNumberValue sets the NumberValue field's value. +func (s *TrialComponentParameterValue) SetNumberValue(v float64) *TrialComponentParameterValue { + s.NumberValue = &v + return s } -// SetS3DataSource sets the S3DataSource field's value. -func (s *TransformDataSource) SetS3DataSource(v *TransformS3DataSource) *TransformDataSource { - s.S3DataSource = v +// SetStringValue sets the StringValue field's value. +func (s *TrialComponentParameterValue) SetStringValue(v string) *TrialComponentParameterValue { + s.StringValue = &v return s } -// Describes the input source of a transform job and the way the transform job -// consumes it. -type TransformInput struct { +// A short summary of a trial component. +type TrialComponentSimpleSummary struct { _ struct{} `type:"structure"` - // If your transform data is compressed, specify the compression type. Amazon - // SageMaker automatically decompresses the data for the transform job accordingly. - // The default value is None. - CompressionType *string `type:"string" enum:"CompressionType"` + // Information about the user who created or modified an experiment, trial, + // or trial component. + CreatedBy *UserContext `type:"structure"` - // The multipurpose internet mail extension (MIME) type of the data. Amazon - // SageMaker uses the MIME type with each http call to transfer data to the - // transform job. - ContentType *string `type:"string"` + // When the component was created. + CreationTime *time.Time `type:"timestamp"` - // Describes the location of the channel data, which is, the S3 location of - // the input data that the model can consume. - // - // DataSource is a required field - DataSource *TransformDataSource `type:"structure" required:"true"` + // The Amazon Resource Name (ARN) of the trial component. + TrialComponentArn *string `type:"string"` - // The method to use to split the transform job's data files into smaller batches. - // Splitting is necessary when the total size of each object is too large to - // fit in a single request. You can also use data splitting to improve performance - // by processing multiple concurrent mini-batches. The default value for SplitType - // is None, which indicates that input data files are not split, and request - // payloads contain the entire contents of an input object. Set the value of - // this parameter to Line to split records on a newline character boundary. - // SplitType also supports a number of record-oriented binary data formats. - // - // When splitting is enabled, the size of a mini-batch depends on the values - // of the BatchStrategy and MaxPayloadInMB parameters. When the value of BatchStrategy - // is MultiRecord, Amazon SageMaker sends the maximum number of records in each - // request, up to the MaxPayloadInMB limit. If the value of BatchStrategy is - // SingleRecord, Amazon SageMaker sends individual records in each request. - // - // Some data formats represent a record as a binary payload wrapped with extra - // padding bytes. When splitting is applied to a binary data format, padding - // is removed if the value of BatchStrategy is set to SingleRecord. Padding - // is not removed if the value of BatchStrategy is set to MultiRecord. - // - // For more information about the RecordIO, see Data Format (http://mxnet.io/architecture/note_data_loading.html#data-format) - // in the MXNet documentation. For more information about the TFRecord, see - // Consuming TFRecord data (https://www.tensorflow.org/guide/datasets#consuming_tfrecord_data) - // in the TensorFlow documentation. - SplitType *string `type:"string" enum:"SplitType"` + // The name of the trial component. + TrialComponentName *string `min:"1" type:"string"` + + // The source of the trial component. + TrialComponentSource *TrialComponentSource `type:"structure"` } // String returns the string representation -func (s TransformInput) String() string { +func (s TrialComponentSimpleSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TransformInput) GoString() string { +func (s TrialComponentSimpleSummary) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *TransformInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TransformInput"} - if s.DataSource == nil { - invalidParams.Add(request.NewErrParamRequired("DataSource")) - } - if s.DataSource != nil { - if err := s.DataSource.Validate(); err != nil { - invalidParams.AddNested("DataSource", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetCreatedBy sets the CreatedBy field's value. +func (s *TrialComponentSimpleSummary) SetCreatedBy(v *UserContext) *TrialComponentSimpleSummary { + s.CreatedBy = v + return s } -// SetCompressionType sets the CompressionType field's value. -func (s *TransformInput) SetCompressionType(v string) *TransformInput { - s.CompressionType = &v +// SetCreationTime sets the CreationTime field's value. +func (s *TrialComponentSimpleSummary) SetCreationTime(v time.Time) *TrialComponentSimpleSummary { + s.CreationTime = &v return s } -// SetContentType sets the ContentType field's value. -func (s *TransformInput) SetContentType(v string) *TransformInput { - s.ContentType = &v +// SetTrialComponentArn sets the TrialComponentArn field's value. +func (s *TrialComponentSimpleSummary) SetTrialComponentArn(v string) *TrialComponentSimpleSummary { + s.TrialComponentArn = &v return s } -// SetDataSource sets the DataSource field's value. -func (s *TransformInput) SetDataSource(v *TransformDataSource) *TransformInput { - s.DataSource = v +// SetTrialComponentName sets the TrialComponentName field's value. +func (s *TrialComponentSimpleSummary) SetTrialComponentName(v string) *TrialComponentSimpleSummary { + s.TrialComponentName = &v return s } -// SetSplitType sets the SplitType field's value. -func (s *TransformInput) SetSplitType(v string) *TransformInput { - s.SplitType = &v +// SetTrialComponentSource sets the TrialComponentSource field's value. +func (s *TrialComponentSimpleSummary) SetTrialComponentSource(v *TrialComponentSource) *TrialComponentSimpleSummary { + s.TrialComponentSource = v return s } -// Defines the input needed to run a transform job using the inference specification -// specified in the algorithm. -type TransformJobDefinition struct { +// The source of the trial component. +type TrialComponentSource struct { _ struct{} `type:"structure"` - // A string that determines the number of records included in a single mini-batch. + // The Amazon Resource Name (ARN) of the source. // - // SingleRecord means only one record is used per mini-batch. MultiRecord means - // a mini-batch is set to contain as many records that can fit within the MaxPayloadInMB - // limit. - BatchStrategy *string `type:"string" enum:"BatchStrategy"` + // SourceArn is a required field + SourceArn *string `type:"string" required:"true"` - // The environment variables to set in the Docker container. We support up to - // 16 key and values entries in the map. - Environment map[string]*string `type:"map"` + // The source job type. + SourceType *string `type:"string"` +} - // The maximum number of parallel requests that can be sent to each instance - // in a transform job. The default value is 1. - MaxConcurrentTransforms *int64 `type:"integer"` +// String returns the string representation +func (s TrialComponentSource) String() string { + return awsutil.Prettify(s) +} - // The maximum payload size allowed, in MB. A payload is the data portion of - // a record (without metadata). - MaxPayloadInMB *int64 `type:"integer"` +// GoString returns the string representation +func (s TrialComponentSource) GoString() string { + return s.String() +} - // A description of the input source and the way the transform job consumes - // it. - // - // TransformInput is a required field - TransformInput *TransformInput `type:"structure" required:"true"` +// SetSourceArn sets the SourceArn field's value. +func (s *TrialComponentSource) SetSourceArn(v string) *TrialComponentSource { + s.SourceArn = &v + return s +} - // Identifies the Amazon S3 location where you want Amazon SageMaker to save - // the results from the transform job. - // - // TransformOutput is a required field - TransformOutput *TransformOutput `type:"structure" required:"true"` +// SetSourceType sets the SourceType field's value. +func (s *TrialComponentSource) SetSourceType(v string) *TrialComponentSource { + s.SourceType = &v + return s +} - // Identifies the ML compute instances for the transform job. - // - // TransformResources is a required field - TransformResources *TransformResources `type:"structure" required:"true"` +// Detailed information about the source of a trial component. +type TrialComponentSourceDetail struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the source. + SourceArn *string `type:"string"` + + // Contains information about a training job. + TrainingJob *TrainingJob `type:"structure"` } // String returns the string representation -func (s TransformJobDefinition) String() string { +func (s TrialComponentSourceDetail) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TransformJobDefinition) GoString() string { +func (s TrialComponentSourceDetail) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *TransformJobDefinition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TransformJobDefinition"} - if s.TransformInput == nil { - invalidParams.Add(request.NewErrParamRequired("TransformInput")) - } - if s.TransformOutput == nil { - invalidParams.Add(request.NewErrParamRequired("TransformOutput")) - } - if s.TransformResources == nil { - invalidParams.Add(request.NewErrParamRequired("TransformResources")) - } - if s.TransformInput != nil { - if err := s.TransformInput.Validate(); err != nil { - invalidParams.AddNested("TransformInput", err.(request.ErrInvalidParams)) - } - } - if s.TransformOutput != nil { - if err := s.TransformOutput.Validate(); err != nil { - invalidParams.AddNested("TransformOutput", err.(request.ErrInvalidParams)) - } - } - if s.TransformResources != nil { - if err := s.TransformResources.Validate(); err != nil { - invalidParams.AddNested("TransformResources", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBatchStrategy sets the BatchStrategy field's value. -func (s *TransformJobDefinition) SetBatchStrategy(v string) *TransformJobDefinition { - s.BatchStrategy = &v +// SetSourceArn sets the SourceArn field's value. +func (s *TrialComponentSourceDetail) SetSourceArn(v string) *TrialComponentSourceDetail { + s.SourceArn = &v return s } -// SetEnvironment sets the Environment field's value. -func (s *TransformJobDefinition) SetEnvironment(v map[string]*string) *TransformJobDefinition { - s.Environment = v +// SetTrainingJob sets the TrainingJob field's value. +func (s *TrialComponentSourceDetail) SetTrainingJob(v *TrainingJob) *TrialComponentSourceDetail { + s.TrainingJob = v return s } -// SetMaxConcurrentTransforms sets the MaxConcurrentTransforms field's value. -func (s *TransformJobDefinition) SetMaxConcurrentTransforms(v int64) *TransformJobDefinition { - s.MaxConcurrentTransforms = &v - return s -} +// The status of the trial component. +type TrialComponentStatus struct { + _ struct{} `type:"structure"` -// SetMaxPayloadInMB sets the MaxPayloadInMB field's value. -func (s *TransformJobDefinition) SetMaxPayloadInMB(v int64) *TransformJobDefinition { - s.MaxPayloadInMB = &v - return s + // If the component failed, a message describing why. + Message *string `type:"string"` + + // The status of the trial component. + PrimaryStatus *string `type:"string" enum:"TrialComponentPrimaryStatus"` } -// SetTransformInput sets the TransformInput field's value. -func (s *TransformJobDefinition) SetTransformInput(v *TransformInput) *TransformJobDefinition { - s.TransformInput = v - return s +// String returns the string representation +func (s TrialComponentStatus) String() string { + return awsutil.Prettify(s) } -// SetTransformOutput sets the TransformOutput field's value. -func (s *TransformJobDefinition) SetTransformOutput(v *TransformOutput) *TransformJobDefinition { - s.TransformOutput = v +// GoString returns the string representation +func (s TrialComponentStatus) GoString() string { + return s.String() +} + +// SetMessage sets the Message field's value. +func (s *TrialComponentStatus) SetMessage(v string) *TrialComponentStatus { + s.Message = &v return s } -// SetTransformResources sets the TransformResources field's value. -func (s *TransformJobDefinition) SetTransformResources(v *TransformResources) *TransformJobDefinition { - s.TransformResources = v +// SetPrimaryStatus sets the PrimaryStatus field's value. +func (s *TrialComponentStatus) SetPrimaryStatus(v string) *TrialComponentStatus { + s.PrimaryStatus = &v return s } -// Provides a summary of a transform job. Multiple TransformJobSummary objects -// are returned as a list after in response to a ListTransformJobs call. -type TransformJobSummary struct { +// A summary of the properties of a trial component. To get all the properties, +// call the DescribeTrialComponent API and provide the TrialComponentName. +type TrialComponentSummary struct { _ struct{} `type:"structure"` - // A timestamp that shows when the transform Job was created. - // - // CreationTime is a required field - CreationTime *time.Time `type:"timestamp" required:"true"` + // Who created the component. + CreatedBy *UserContext `type:"structure"` - // If the transform job failed, the reason it failed. - FailureReason *string `type:"string"` + // When the component was created. + CreationTime *time.Time `type:"timestamp"` - // Indicates when the transform job was last modified. + // The name of the component as displayed. If DisplayName isn't specified, TrialComponentName + // is displayed. + DisplayName *string `min:"1" type:"string"` + + // When the component ended. + EndTime *time.Time `type:"timestamp"` + + // Who last modified the component. + LastModifiedBy *UserContext `type:"structure"` + + // When the component was last modified. LastModifiedTime *time.Time `type:"timestamp"` - // Indicates when the transform job ends on compute instances. For successful - // jobs and stopped jobs, this is the exact time recorded after the results - // are uploaded. For failed jobs, this is when Amazon SageMaker detected that - // the job failed. - TransformEndTime *time.Time `type:"timestamp"` + // When the component started. + StartTime *time.Time `type:"timestamp"` - // The Amazon Resource Name (ARN) of the transform job. + // The status of the component. States include: // - // TransformJobArn is a required field - TransformJobArn *string `type:"string" required:"true"` - - // The name of the transform job. + // * InProgress // - // TransformJobName is a required field - TransformJobName *string `min:"1" type:"string" required:"true"` - - // The status of the transform job. + // * Completed // - // TransformJobStatus is a required field - TransformJobStatus *string `type:"string" required:"true" enum:"TransformJobStatus"` + // * Failed + Status *TrialComponentStatus `type:"structure"` + + // The ARN of the trial component. + TrialComponentArn *string `type:"string"` + + // The name of the trial component. + TrialComponentName *string `min:"1" type:"string"` + + // The source of the trial component. + TrialComponentSource *TrialComponentSource `type:"structure"` } // String returns the string representation -func (s TransformJobSummary) String() string { +func (s TrialComponentSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TransformJobSummary) GoString() string { +func (s TrialComponentSummary) GoString() string { return s.String() } +// SetCreatedBy sets the CreatedBy field's value. +func (s *TrialComponentSummary) SetCreatedBy(v *UserContext) *TrialComponentSummary { + s.CreatedBy = v + return s +} + // SetCreationTime sets the CreationTime field's value. -func (s *TransformJobSummary) SetCreationTime(v time.Time) *TransformJobSummary { +func (s *TrialComponentSummary) SetCreationTime(v time.Time) *TrialComponentSummary { s.CreationTime = &v return s } -// SetFailureReason sets the FailureReason field's value. -func (s *TransformJobSummary) SetFailureReason(v string) *TransformJobSummary { - s.FailureReason = &v +// SetDisplayName sets the DisplayName field's value. +func (s *TrialComponentSummary) SetDisplayName(v string) *TrialComponentSummary { + s.DisplayName = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *TrialComponentSummary) SetEndTime(v time.Time) *TrialComponentSummary { + s.EndTime = &v + return s +} + +// SetLastModifiedBy sets the LastModifiedBy field's value. +func (s *TrialComponentSummary) SetLastModifiedBy(v *UserContext) *TrialComponentSummary { + s.LastModifiedBy = v return s } // SetLastModifiedTime sets the LastModifiedTime field's value. -func (s *TransformJobSummary) SetLastModifiedTime(v time.Time) *TransformJobSummary { +func (s *TrialComponentSummary) SetLastModifiedTime(v time.Time) *TrialComponentSummary { s.LastModifiedTime = &v return s } -// SetTransformEndTime sets the TransformEndTime field's value. -func (s *TransformJobSummary) SetTransformEndTime(v time.Time) *TransformJobSummary { - s.TransformEndTime = &v +// SetStartTime sets the StartTime field's value. +func (s *TrialComponentSummary) SetStartTime(v time.Time) *TrialComponentSummary { + s.StartTime = &v return s } -// SetTransformJobArn sets the TransformJobArn field's value. -func (s *TransformJobSummary) SetTransformJobArn(v string) *TransformJobSummary { - s.TransformJobArn = &v +// SetStatus sets the Status field's value. +func (s *TrialComponentSummary) SetStatus(v *TrialComponentStatus) *TrialComponentSummary { + s.Status = v return s } -// SetTransformJobName sets the TransformJobName field's value. -func (s *TransformJobSummary) SetTransformJobName(v string) *TransformJobSummary { - s.TransformJobName = &v +// SetTrialComponentArn sets the TrialComponentArn field's value. +func (s *TrialComponentSummary) SetTrialComponentArn(v string) *TrialComponentSummary { + s.TrialComponentArn = &v return s } -// SetTransformJobStatus sets the TransformJobStatus field's value. -func (s *TransformJobSummary) SetTransformJobStatus(v string) *TransformJobSummary { - s.TransformJobStatus = &v +// SetTrialComponentName sets the TrialComponentName field's value. +func (s *TrialComponentSummary) SetTrialComponentName(v string) *TrialComponentSummary { + s.TrialComponentName = &v return s } -// Describes the results of a transform job. -type TransformOutput struct { - _ struct{} `type:"structure"` - - // The MIME type used to specify the output data. Amazon SageMaker uses the - // MIME type with each http call to transfer data from the transform job. - Accept *string `type:"string"` +// SetTrialComponentSource sets the TrialComponentSource field's value. +func (s *TrialComponentSummary) SetTrialComponentSource(v *TrialComponentSource) *TrialComponentSummary { + s.TrialComponentSource = v + return s +} - // Defines how to assemble the results of the transform job as a single S3 object. - // Choose a format that is most convenient to you. To concatenate the results - // in binary format, specify None. To add a newline character at the end of - // every transformed record, specify Line. - AssembleWith *string `type:"string" enum:"AssemblyType"` +// The source of the trial. +type TrialSource struct { + _ struct{} `type:"structure"` - // The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to - // encrypt the model artifacts at rest using Amazon S3 server-side encryption. - // The KmsKeyId can be any of the following formats: - // - // * // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab" - // - // * // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" + // The Amazon Resource Name (ARN) of the source. // - // * // KMS Key Alias "alias/ExampleAlias" - // - // * // Amazon Resource Name (ARN) of a KMS Key Alias "arn:aws:kms:us-west-2:111122223333:alias/ExampleAlias" - // - // If you don't provide a KMS key ID, Amazon SageMaker uses the default KMS - // key for Amazon S3 for your role's account. For more information, see KMS-Managed - // Encryption Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html) - // in the Amazon Simple Storage Service Developer Guide. - // - // The KMS key policy must grant permission to the IAM role that you specify - // in your CreateTramsformJob request. For more information, see Using Key Policies - // in AWS KMS (http://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) - // in the AWS Key Management Service Developer Guide. - KmsKeyId *string `type:"string"` + // SourceArn is a required field + SourceArn *string `type:"string" required:"true"` - // The Amazon S3 path where you want Amazon SageMaker to store the results of - // the transform job. For example, s3://bucket-name/key-name-prefix. - // - // For every S3 object used as input for the transform job, batch transform - // stores the transformed data with an .out suffix in a corresponding subfolder - // in the location in the output prefix. For example, for the input data stored - // at s3://bucket-name/input-name-prefix/dataset01/data.csv, batch transform - // stores the transformed data at s3://bucket-name/output-name-prefix/input-name-prefix/data.csv.out. - // Batch transform doesn't upload partially processed objects. For an input - // S3 object that contains multiple records, it creates an .out file only if - // the transform job succeeds on the entire file. When the input contains multiple - // S3 objects, the batch transform job processes the listed S3 objects and uploads - // only the output for successfully processed objects. If any object fails in - // the transform job batch transform marks the job as failed to prompt investigation. - // - // S3OutputPath is a required field - S3OutputPath *string `type:"string" required:"true"` + // The source job type. + SourceType *string `type:"string"` } // String returns the string representation -func (s TransformOutput) String() string { +func (s TrialSource) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TransformOutput) GoString() string { +func (s TrialSource) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *TransformOutput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TransformOutput"} - if s.S3OutputPath == nil { - invalidParams.Add(request.NewErrParamRequired("S3OutputPath")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccept sets the Accept field's value. -func (s *TransformOutput) SetAccept(v string) *TransformOutput { - s.Accept = &v +// SetSourceArn sets the SourceArn field's value. +func (s *TrialSource) SetSourceArn(v string) *TrialSource { + s.SourceArn = &v return s } -// SetAssembleWith sets the AssembleWith field's value. -func (s *TransformOutput) SetAssembleWith(v string) *TransformOutput { - s.AssembleWith = &v +// SetSourceType sets the SourceType field's value. +func (s *TrialSource) SetSourceType(v string) *TrialSource { + s.SourceType = &v return s } -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *TransformOutput) SetKmsKeyId(v string) *TransformOutput { - s.KmsKeyId = &v - return s -} +// A summary of the properties of a trial. To get the complete set of properties, +// call the DescribeTrial API and provide the TrialName. +type TrialSummary struct { + _ struct{} `type:"structure"` -// SetS3OutputPath sets the S3OutputPath field's value. -func (s *TransformOutput) SetS3OutputPath(v string) *TransformOutput { - s.S3OutputPath = &v - return s -} + // When the trial was created. + CreationTime *time.Time `type:"timestamp"` -// Describes the resources, including ML instance types and ML instance count, -// to use for transform job. -type TransformResources struct { - _ struct{} `type:"structure"` + // The name of the trial as displayed. If DisplayName isn't specified, TrialName + // is displayed. + DisplayName *string `min:"1" type:"string"` - // The number of ML compute instances to use in the transform job. For distributed - // transform jobs, specify a value greater than 1. The default value is 1. - // - // InstanceCount is a required field - InstanceCount *int64 `min:"1" type:"integer" required:"true"` + // When the trial was last modified. + LastModifiedTime *time.Time `type:"timestamp"` - // The ML compute instance type for the transform job. If you are using built-in - // algorithms to transform moderately sized datasets, we recommend using ml.m4.xlarge - // or ml.m5.large instance types. - // - // InstanceType is a required field - InstanceType *string `type:"string" required:"true" enum:"TransformInstanceType"` + // The Amazon Resource Name (ARN) of the trial. + TrialArn *string `type:"string"` - // The AWS Key Management Service (AWS KMS) key that Amazon SageMaker uses to - // encrypt data on the storage volume attached to the ML compute instance(s) - // that run the batch transform job. The VolumeKmsKeyId can be any of the following - // formats: - // - // * // KMS Key ID "1234abcd-12ab-34cd-56ef-1234567890ab" - // - // * // Amazon Resource Name (ARN) of a KMS Key "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" - VolumeKmsKeyId *string `type:"string"` + // The name of the trial. + TrialName *string `min:"1" type:"string"` + + // The source of the trial. + TrialSource *TrialSource `type:"structure"` } // String returns the string representation -func (s TransformResources) String() string { +func (s TrialSummary) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TransformResources) GoString() string { +func (s TrialSummary) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *TransformResources) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TransformResources"} - if s.InstanceCount == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceCount")) - } - if s.InstanceCount != nil && *s.InstanceCount < 1 { - invalidParams.Add(request.NewErrParamMinValue("InstanceCount", 1)) - } - if s.InstanceType == nil { - invalidParams.Add(request.NewErrParamRequired("InstanceType")) - } +// SetCreationTime sets the CreationTime field's value. +func (s *TrialSummary) SetCreationTime(v time.Time) *TrialSummary { + s.CreationTime = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetDisplayName sets the DisplayName field's value. +func (s *TrialSummary) SetDisplayName(v string) *TrialSummary { + s.DisplayName = &v + return s } -// SetInstanceCount sets the InstanceCount field's value. -func (s *TransformResources) SetInstanceCount(v int64) *TransformResources { - s.InstanceCount = &v +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *TrialSummary) SetLastModifiedTime(v time.Time) *TrialSummary { + s.LastModifiedTime = &v return s } -// SetInstanceType sets the InstanceType field's value. -func (s *TransformResources) SetInstanceType(v string) *TransformResources { - s.InstanceType = &v +// SetTrialArn sets the TrialArn field's value. +func (s *TrialSummary) SetTrialArn(v string) *TrialSummary { + s.TrialArn = &v return s } -// SetVolumeKmsKeyId sets the VolumeKmsKeyId field's value. -func (s *TransformResources) SetVolumeKmsKeyId(v string) *TransformResources { - s.VolumeKmsKeyId = &v +// SetTrialName sets the TrialName field's value. +func (s *TrialSummary) SetTrialName(v string) *TrialSummary { + s.TrialName = &v return s } -// Describes the S3 data source. -type TransformS3DataSource struct { - _ struct{} `type:"structure"` +// SetTrialSource sets the TrialSource field's value. +func (s *TrialSummary) SetTrialSource(v *TrialSource) *TrialSummary { + s.TrialSource = v + return s +} - // If you choose S3Prefix, S3Uri identifies a key name prefix. Amazon SageMaker - // uses all objects with the specified key name prefix for batch transform. - // - // If you choose ManifestFile, S3Uri identifies an object that is a manifest - // file containing a list of object keys that you want Amazon SageMaker to use - // for batch transform. - // - // The following values are compatible: ManifestFile, S3Prefix - // - // The following value is not compatible: AugmentedManifestFile - // - // S3DataType is a required field - S3DataType *string `type:"string" required:"true" enum:"S3DataType"` +// The job completion criteria. +type TuningJobCompletionCriteria struct { + _ struct{} `type:"structure"` - // Depending on the value specified for the S3DataType, identifies either a - // key name prefix or a manifest. For example: + // The objective metric's value. // - // * A key name prefix might look like this: s3://bucketname/exampleprefix. - // - // * A manifest might look like this: s3://bucketname/example.manifest The - // manifest is an S3 object which is a JSON file with the following format: - // [ {"prefix": "s3://customer_bucket/some/prefix/"}, "relative/path/to/custdata-1", - // "relative/path/custdata-2", ... ] The preceding JSON matches the following - // S3Uris: s3://customer_bucket/some/prefix/relative/path/to/custdata-1 s3://customer_bucket/some/prefix/relative/path/custdata-1 - // ... The complete set of S3Uris in this manifest constitutes the input - // data for the channel for this datasource. The object that each S3Uris - // points to must be readable by the IAM role that Amazon SageMaker uses - // to perform tasks on your behalf. - // - // S3Uri is a required field - S3Uri *string `type:"string" required:"true"` + // TargetObjectiveMetricValue is a required field + TargetObjectiveMetricValue *float64 `type:"float" required:"true"` } // String returns the string representation -func (s TransformS3DataSource) String() string { +func (s TuningJobCompletionCriteria) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s TransformS3DataSource) GoString() string { +func (s TuningJobCompletionCriteria) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *TransformS3DataSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TransformS3DataSource"} - if s.S3DataType == nil { - invalidParams.Add(request.NewErrParamRequired("S3DataType")) - } - if s.S3Uri == nil { - invalidParams.Add(request.NewErrParamRequired("S3Uri")) +func (s *TuningJobCompletionCriteria) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TuningJobCompletionCriteria"} + if s.TargetObjectiveMetricValue == nil { + invalidParams.Add(request.NewErrParamRequired("TargetObjectiveMetricValue")) } if invalidParams.Len() > 0 { @@ -25065,15 +43751,9 @@ func (s *TransformS3DataSource) Validate() error { return nil } -// SetS3DataType sets the S3DataType field's value. -func (s *TransformS3DataSource) SetS3DataType(v string) *TransformS3DataSource { - s.S3DataType = &v - return s -} - -// SetS3Uri sets the S3Uri field's value. -func (s *TransformS3DataSource) SetS3Uri(v string) *TransformS3DataSource { - s.S3Uri = &v +// SetTargetObjectiveMetricValue sets the TargetObjectiveMetricValue field's value. +func (s *TuningJobCompletionCriteria) SetTargetObjectiveMetricValue(v float64) *TuningJobCompletionCriteria { + s.TargetObjectiveMetricValue = &v return s } @@ -25202,6 +43882,39 @@ func (s *UiTemplate) SetContent(v string) *UiTemplate { return s } +// Container for user interface template information. +type UiTemplateInfo struct { + _ struct{} `type:"structure"` + + // The SHA 256 hash that you used to create the request signature. + ContentSha256 *string `min:"1" type:"string"` + + // The URL for the user interface template. + Url *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s UiTemplateInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UiTemplateInfo) GoString() string { + return s.String() +} + +// SetContentSha256 sets the ContentSha256 field's value. +func (s *UiTemplateInfo) SetContentSha256(v string) *UiTemplateInfo { + s.ContentSha256 = &v + return s +} + +// SetUrl sets the Url field's value. +func (s *UiTemplateInfo) SetUrl(v string) *UiTemplateInfo { + s.Url = &v + return s +} + type UpdateCodeRepositoryInput struct { _ struct{} `type:"structure"` @@ -25272,53 +43985,337 @@ type UpdateCodeRepositoryOutput struct { } // String returns the string representation -func (s UpdateCodeRepositoryOutput) String() string { +func (s UpdateCodeRepositoryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateCodeRepositoryOutput) GoString() string { + return s.String() +} + +// SetCodeRepositoryArn sets the CodeRepositoryArn field's value. +func (s *UpdateCodeRepositoryOutput) SetCodeRepositoryArn(v string) *UpdateCodeRepositoryOutput { + s.CodeRepositoryArn = &v + return s +} + +type UpdateDomainInput struct { + _ struct{} `type:"structure"` + + // A collection of settings. + DefaultUserSettings *UserSettings `type:"structure"` + + // The domain ID. + // + // DomainId is a required field + DomainId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateDomainInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateDomainInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateDomainInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateDomainInput"} + if s.DomainId == nil { + invalidParams.Add(request.NewErrParamRequired("DomainId")) + } + if s.DefaultUserSettings != nil { + if err := s.DefaultUserSettings.Validate(); err != nil { + invalidParams.AddNested("DefaultUserSettings", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDefaultUserSettings sets the DefaultUserSettings field's value. +func (s *UpdateDomainInput) SetDefaultUserSettings(v *UserSettings) *UpdateDomainInput { + s.DefaultUserSettings = v + return s +} + +// SetDomainId sets the DomainId field's value. +func (s *UpdateDomainInput) SetDomainId(v string) *UpdateDomainInput { + s.DomainId = &v + return s +} + +type UpdateDomainOutput struct { + _ struct{} `type:"structure"` + + // The domain Amazon Resource Name (ARN). + DomainArn *string `type:"string"` +} + +// String returns the string representation +func (s UpdateDomainOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateDomainOutput) GoString() string { + return s.String() +} + +// SetDomainArn sets the DomainArn field's value. +func (s *UpdateDomainOutput) SetDomainArn(v string) *UpdateDomainOutput { + s.DomainArn = &v + return s +} + +type UpdateEndpointInput struct { + _ struct{} `type:"structure"` + + // The name of the new endpoint configuration. + // + // EndpointConfigName is a required field + EndpointConfigName *string `type:"string" required:"true"` + + // The name of the endpoint whose configuration you want to update. + // + // EndpointName is a required field + EndpointName *string `type:"string" required:"true"` + + // When you are updating endpoint resources with RetainAllVariantProperties + // (https://docs.aws.amazon.com/sagemaker/latest/dg/API_UpdateEndpoint.html#SageMaker-UpdateEndpoint-request-RetainAllVariantProperties), + // whose value is set to true, ExcludeRetainedVariantProperties specifies the + // list of type VariantProperty (https://docs.aws.amazon.com/sagemaker/latest/dg/API_VariantProperty.html) + // to override with the values provided by EndpointConfig. If you don't specify + // a value for ExcludeAllVariantProperties, no variant properties are overridden. + ExcludeRetainedVariantProperties []*VariantProperty `type:"list"` + + // When updating endpoint resources, enables or disables the retention of variant + // properties, such as the instance count or the variant weight. To retain the + // variant properties of an endpoint when updating it, set RetainAllVariantProperties + // to true. To use the variant properties specified in a new EndpointConfig + // call when updating an endpoint, set RetainAllVariantProperties to false. + RetainAllVariantProperties *bool `type:"boolean"` +} + +// String returns the string representation +func (s UpdateEndpointInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateEndpointInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateEndpointInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateEndpointInput"} + if s.EndpointConfigName == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointConfigName")) + } + if s.EndpointName == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointName")) + } + if s.ExcludeRetainedVariantProperties != nil { + for i, v := range s.ExcludeRetainedVariantProperties { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ExcludeRetainedVariantProperties", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEndpointConfigName sets the EndpointConfigName field's value. +func (s *UpdateEndpointInput) SetEndpointConfigName(v string) *UpdateEndpointInput { + s.EndpointConfigName = &v + return s +} + +// SetEndpointName sets the EndpointName field's value. +func (s *UpdateEndpointInput) SetEndpointName(v string) *UpdateEndpointInput { + s.EndpointName = &v + return s +} + +// SetExcludeRetainedVariantProperties sets the ExcludeRetainedVariantProperties field's value. +func (s *UpdateEndpointInput) SetExcludeRetainedVariantProperties(v []*VariantProperty) *UpdateEndpointInput { + s.ExcludeRetainedVariantProperties = v + return s +} + +// SetRetainAllVariantProperties sets the RetainAllVariantProperties field's value. +func (s *UpdateEndpointInput) SetRetainAllVariantProperties(v bool) *UpdateEndpointInput { + s.RetainAllVariantProperties = &v + return s +} + +type UpdateEndpointOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the endpoint. + // + // EndpointArn is a required field + EndpointArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateEndpointOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateEndpointOutput) GoString() string { + return s.String() +} + +// SetEndpointArn sets the EndpointArn field's value. +func (s *UpdateEndpointOutput) SetEndpointArn(v string) *UpdateEndpointOutput { + s.EndpointArn = &v + return s +} + +type UpdateEndpointWeightsAndCapacitiesInput struct { + _ struct{} `type:"structure"` + + // An object that provides new capacity and weight values for a variant. + // + // DesiredWeightsAndCapacities is a required field + DesiredWeightsAndCapacities []*DesiredWeightAndCapacity `min:"1" type:"list" required:"true"` + + // The name of an existing Amazon SageMaker endpoint. + // + // EndpointName is a required field + EndpointName *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateEndpointWeightsAndCapacitiesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateEndpointWeightsAndCapacitiesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateEndpointWeightsAndCapacitiesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateEndpointWeightsAndCapacitiesInput"} + if s.DesiredWeightsAndCapacities == nil { + invalidParams.Add(request.NewErrParamRequired("DesiredWeightsAndCapacities")) + } + if s.DesiredWeightsAndCapacities != nil && len(s.DesiredWeightsAndCapacities) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DesiredWeightsAndCapacities", 1)) + } + if s.EndpointName == nil { + invalidParams.Add(request.NewErrParamRequired("EndpointName")) + } + if s.DesiredWeightsAndCapacities != nil { + for i, v := range s.DesiredWeightsAndCapacities { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DesiredWeightsAndCapacities", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDesiredWeightsAndCapacities sets the DesiredWeightsAndCapacities field's value. +func (s *UpdateEndpointWeightsAndCapacitiesInput) SetDesiredWeightsAndCapacities(v []*DesiredWeightAndCapacity) *UpdateEndpointWeightsAndCapacitiesInput { + s.DesiredWeightsAndCapacities = v + return s +} + +// SetEndpointName sets the EndpointName field's value. +func (s *UpdateEndpointWeightsAndCapacitiesInput) SetEndpointName(v string) *UpdateEndpointWeightsAndCapacitiesInput { + s.EndpointName = &v + return s +} + +type UpdateEndpointWeightsAndCapacitiesOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the updated endpoint. + // + // EndpointArn is a required field + EndpointArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateEndpointWeightsAndCapacitiesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateCodeRepositoryOutput) GoString() string { +func (s UpdateEndpointWeightsAndCapacitiesOutput) GoString() string { return s.String() } -// SetCodeRepositoryArn sets the CodeRepositoryArn field's value. -func (s *UpdateCodeRepositoryOutput) SetCodeRepositoryArn(v string) *UpdateCodeRepositoryOutput { - s.CodeRepositoryArn = &v +// SetEndpointArn sets the EndpointArn field's value. +func (s *UpdateEndpointWeightsAndCapacitiesOutput) SetEndpointArn(v string) *UpdateEndpointWeightsAndCapacitiesOutput { + s.EndpointArn = &v return s } -type UpdateEndpointInput struct { +type UpdateExperimentInput struct { _ struct{} `type:"structure"` - // The name of the new endpoint configuration. - // - // EndpointConfigName is a required field - EndpointConfigName *string `type:"string" required:"true"` + // The description of the experiment. + Description *string `type:"string"` - // The name of the endpoint whose configuration you want to update. + // The name of the experiment as displayed. The name doesn't need to be unique. + // If DisplayName isn't specified, ExperimentName is displayed. + DisplayName *string `min:"1" type:"string"` + + // The name of the experiment to update. // - // EndpointName is a required field - EndpointName *string `type:"string" required:"true"` + // ExperimentName is a required field + ExperimentName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s UpdateEndpointInput) String() string { +func (s UpdateExperimentInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateEndpointInput) GoString() string { +func (s UpdateExperimentInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateEndpointInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateEndpointInput"} - if s.EndpointConfigName == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointConfigName")) +func (s *UpdateExperimentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateExperimentInput"} + if s.DisplayName != nil && len(*s.DisplayName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) } - if s.EndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointName")) + if s.ExperimentName == nil { + invalidParams.Add(request.NewErrParamRequired("ExperimentName")) + } + if s.ExperimentName != nil && len(*s.ExperimentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ExperimentName", 1)) } if invalidParams.Len() > 0 { @@ -25327,87 +44324,88 @@ func (s *UpdateEndpointInput) Validate() error { return nil } -// SetEndpointConfigName sets the EndpointConfigName field's value. -func (s *UpdateEndpointInput) SetEndpointConfigName(v string) *UpdateEndpointInput { - s.EndpointConfigName = &v +// SetDescription sets the Description field's value. +func (s *UpdateExperimentInput) SetDescription(v string) *UpdateExperimentInput { + s.Description = &v return s } -// SetEndpointName sets the EndpointName field's value. -func (s *UpdateEndpointInput) SetEndpointName(v string) *UpdateEndpointInput { - s.EndpointName = &v +// SetDisplayName sets the DisplayName field's value. +func (s *UpdateExperimentInput) SetDisplayName(v string) *UpdateExperimentInput { + s.DisplayName = &v return s } -type UpdateEndpointOutput struct { +// SetExperimentName sets the ExperimentName field's value. +func (s *UpdateExperimentInput) SetExperimentName(v string) *UpdateExperimentInput { + s.ExperimentName = &v + return s +} + +type UpdateExperimentOutput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the endpoint. - // - // EndpointArn is a required field - EndpointArn *string `min:"20" type:"string" required:"true"` + // The Amazon Resource Name (ARN) of the experiment. + ExperimentArn *string `type:"string"` } // String returns the string representation -func (s UpdateEndpointOutput) String() string { +func (s UpdateExperimentOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateEndpointOutput) GoString() string { +func (s UpdateExperimentOutput) GoString() string { return s.String() } -// SetEndpointArn sets the EndpointArn field's value. -func (s *UpdateEndpointOutput) SetEndpointArn(v string) *UpdateEndpointOutput { - s.EndpointArn = &v +// SetExperimentArn sets the ExperimentArn field's value. +func (s *UpdateExperimentOutput) SetExperimentArn(v string) *UpdateExperimentOutput { + s.ExperimentArn = &v return s } -type UpdateEndpointWeightsAndCapacitiesInput struct { +type UpdateMonitoringScheduleInput struct { _ struct{} `type:"structure"` - // An object that provides new capacity and weight values for a variant. + // The configuration object that specifies the monitoring schedule and defines + // the monitoring job. // - // DesiredWeightsAndCapacities is a required field - DesiredWeightsAndCapacities []*DesiredWeightAndCapacity `min:"1" type:"list" required:"true"` + // MonitoringScheduleConfig is a required field + MonitoringScheduleConfig *MonitoringScheduleConfig `type:"structure" required:"true"` - // The name of an existing Amazon SageMaker endpoint. + // The name of the monitoring schedule. The name must be unique within an AWS + // Region within an AWS account. // - // EndpointName is a required field - EndpointName *string `type:"string" required:"true"` + // MonitoringScheduleName is a required field + MonitoringScheduleName *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s UpdateEndpointWeightsAndCapacitiesInput) String() string { +func (s UpdateMonitoringScheduleInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateEndpointWeightsAndCapacitiesInput) GoString() string { +func (s UpdateMonitoringScheduleInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateEndpointWeightsAndCapacitiesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateEndpointWeightsAndCapacitiesInput"} - if s.DesiredWeightsAndCapacities == nil { - invalidParams.Add(request.NewErrParamRequired("DesiredWeightsAndCapacities")) +func (s *UpdateMonitoringScheduleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateMonitoringScheduleInput"} + if s.MonitoringScheduleConfig == nil { + invalidParams.Add(request.NewErrParamRequired("MonitoringScheduleConfig")) } - if s.DesiredWeightsAndCapacities != nil && len(s.DesiredWeightsAndCapacities) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DesiredWeightsAndCapacities", 1)) + if s.MonitoringScheduleName == nil { + invalidParams.Add(request.NewErrParamRequired("MonitoringScheduleName")) } - if s.EndpointName == nil { - invalidParams.Add(request.NewErrParamRequired("EndpointName")) + if s.MonitoringScheduleName != nil && len(*s.MonitoringScheduleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("MonitoringScheduleName", 1)) } - if s.DesiredWeightsAndCapacities != nil { - for i, v := range s.DesiredWeightsAndCapacities { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "DesiredWeightsAndCapacities", i), err.(request.ErrInvalidParams)) - } + if s.MonitoringScheduleConfig != nil { + if err := s.MonitoringScheduleConfig.Validate(); err != nil { + invalidParams.AddNested("MonitoringScheduleConfig", err.(request.ErrInvalidParams)) } } @@ -25417,40 +44415,40 @@ func (s *UpdateEndpointWeightsAndCapacitiesInput) Validate() error { return nil } -// SetDesiredWeightsAndCapacities sets the DesiredWeightsAndCapacities field's value. -func (s *UpdateEndpointWeightsAndCapacitiesInput) SetDesiredWeightsAndCapacities(v []*DesiredWeightAndCapacity) *UpdateEndpointWeightsAndCapacitiesInput { - s.DesiredWeightsAndCapacities = v +// SetMonitoringScheduleConfig sets the MonitoringScheduleConfig field's value. +func (s *UpdateMonitoringScheduleInput) SetMonitoringScheduleConfig(v *MonitoringScheduleConfig) *UpdateMonitoringScheduleInput { + s.MonitoringScheduleConfig = v return s } -// SetEndpointName sets the EndpointName field's value. -func (s *UpdateEndpointWeightsAndCapacitiesInput) SetEndpointName(v string) *UpdateEndpointWeightsAndCapacitiesInput { - s.EndpointName = &v +// SetMonitoringScheduleName sets the MonitoringScheduleName field's value. +func (s *UpdateMonitoringScheduleInput) SetMonitoringScheduleName(v string) *UpdateMonitoringScheduleInput { + s.MonitoringScheduleName = &v return s } -type UpdateEndpointWeightsAndCapacitiesOutput struct { +type UpdateMonitoringScheduleOutput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the updated endpoint. + // The Amazon Resource Name (ARN) of the monitoring schedule. // - // EndpointArn is a required field - EndpointArn *string `min:"20" type:"string" required:"true"` + // MonitoringScheduleArn is a required field + MonitoringScheduleArn *string `type:"string" required:"true"` } // String returns the string representation -func (s UpdateEndpointWeightsAndCapacitiesOutput) String() string { +func (s UpdateMonitoringScheduleOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s UpdateEndpointWeightsAndCapacitiesOutput) GoString() string { +func (s UpdateMonitoringScheduleOutput) GoString() string { return s.String() } -// SetEndpointArn sets the EndpointArn field's value. -func (s *UpdateEndpointWeightsAndCapacitiesOutput) SetEndpointArn(v string) *UpdateEndpointWeightsAndCapacitiesOutput { - s.EndpointArn = &v +// SetMonitoringScheduleArn sets the MonitoringScheduleArn field's value. +func (s *UpdateMonitoringScheduleOutput) SetMonitoringScheduleArn(v string) *UpdateMonitoringScheduleOutput { + s.MonitoringScheduleArn = &v return s } @@ -25460,7 +44458,7 @@ type UpdateNotebookInstanceInput struct { // A list of the Elastic Inference (EI) instance types to associate with this // notebook instance. Currently only one EI instance type can be associated // with a notebook instance. For more information, see Using Elastic Inference - // in Amazon SageMaker (sagemaker/latest/dg/ei.html). + // in Amazon SageMaker (https://docs.aws.amazon.com/sagemaker/latest/dg/ei.html). AcceleratorTypes []*string `type:"list"` // An array of up to three Git repositories to associate with the notebook instance. @@ -25760,6 +44758,439 @@ func (s UpdateNotebookInstanceOutput) GoString() string { return s.String() } +type UpdateTrialComponentInput struct { + _ struct{} `type:"structure"` + + // The name of the component as displayed. The name doesn't need to be unique. + // If DisplayName isn't specified, TrialComponentName is displayed. + DisplayName *string `min:"1" type:"string"` + + // When the component ended. + EndTime *time.Time `type:"timestamp"` + + // Replaces all of the component's input artifacts with the specified artifacts. + InputArtifacts map[string]*TrialComponentArtifact `type:"map"` + + // The input artifacts to remove from the component. + InputArtifactsToRemove []*string `type:"list"` + + // Replaces all of the component's output artifacts with the specified artifacts. + OutputArtifacts map[string]*TrialComponentArtifact `type:"map"` + + // The output artifacts to remove from the component. + OutputArtifactsToRemove []*string `type:"list"` + + // Replaces all of the component's hyperparameters with the specified hyperparameters. + Parameters map[string]*TrialComponentParameterValue `type:"map"` + + // The hyperparameters to remove from the component. + ParametersToRemove []*string `type:"list"` + + // When the component started. + StartTime *time.Time `type:"timestamp"` + + // The new status of the component. + Status *TrialComponentStatus `type:"structure"` + + // The name of the component to update. + // + // TrialComponentName is a required field + TrialComponentName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateTrialComponentInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTrialComponentInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateTrialComponentInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateTrialComponentInput"} + if s.DisplayName != nil && len(*s.DisplayName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) + } + if s.TrialComponentName == nil { + invalidParams.Add(request.NewErrParamRequired("TrialComponentName")) + } + if s.TrialComponentName != nil && len(*s.TrialComponentName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialComponentName", 1)) + } + 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 +} + +// SetDisplayName sets the DisplayName field's value. +func (s *UpdateTrialComponentInput) SetDisplayName(v string) *UpdateTrialComponentInput { + s.DisplayName = &v + return s +} + +// SetEndTime sets the EndTime field's value. +func (s *UpdateTrialComponentInput) SetEndTime(v time.Time) *UpdateTrialComponentInput { + s.EndTime = &v + return s +} + +// SetInputArtifacts sets the InputArtifacts field's value. +func (s *UpdateTrialComponentInput) SetInputArtifacts(v map[string]*TrialComponentArtifact) *UpdateTrialComponentInput { + s.InputArtifacts = v + return s +} + +// SetInputArtifactsToRemove sets the InputArtifactsToRemove field's value. +func (s *UpdateTrialComponentInput) SetInputArtifactsToRemove(v []*string) *UpdateTrialComponentInput { + s.InputArtifactsToRemove = v + return s +} + +// SetOutputArtifacts sets the OutputArtifacts field's value. +func (s *UpdateTrialComponentInput) SetOutputArtifacts(v map[string]*TrialComponentArtifact) *UpdateTrialComponentInput { + s.OutputArtifacts = v + return s +} + +// SetOutputArtifactsToRemove sets the OutputArtifactsToRemove field's value. +func (s *UpdateTrialComponentInput) SetOutputArtifactsToRemove(v []*string) *UpdateTrialComponentInput { + s.OutputArtifactsToRemove = v + return s +} + +// SetParameters sets the Parameters field's value. +func (s *UpdateTrialComponentInput) SetParameters(v map[string]*TrialComponentParameterValue) *UpdateTrialComponentInput { + s.Parameters = v + return s +} + +// SetParametersToRemove sets the ParametersToRemove field's value. +func (s *UpdateTrialComponentInput) SetParametersToRemove(v []*string) *UpdateTrialComponentInput { + s.ParametersToRemove = v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *UpdateTrialComponentInput) SetStartTime(v time.Time) *UpdateTrialComponentInput { + s.StartTime = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *UpdateTrialComponentInput) SetStatus(v *TrialComponentStatus) *UpdateTrialComponentInput { + s.Status = v + return s +} + +// SetTrialComponentName sets the TrialComponentName field's value. +func (s *UpdateTrialComponentInput) SetTrialComponentName(v string) *UpdateTrialComponentInput { + s.TrialComponentName = &v + return s +} + +type UpdateTrialComponentOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the trial component. + TrialComponentArn *string `type:"string"` +} + +// String returns the string representation +func (s UpdateTrialComponentOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTrialComponentOutput) GoString() string { + return s.String() +} + +// SetTrialComponentArn sets the TrialComponentArn field's value. +func (s *UpdateTrialComponentOutput) SetTrialComponentArn(v string) *UpdateTrialComponentOutput { + s.TrialComponentArn = &v + return s +} + +type UpdateTrialInput struct { + _ struct{} `type:"structure"` + + // The name of the trial as displayed. The name doesn't need to be unique. If + // DisplayName isn't specified, TrialName is displayed. + DisplayName *string `min:"1" type:"string"` + + // The name of the trial to update. + // + // TrialName is a required field + TrialName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateTrialInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTrialInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateTrialInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateTrialInput"} + if s.DisplayName != nil && len(*s.DisplayName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DisplayName", 1)) + } + if s.TrialName == nil { + invalidParams.Add(request.NewErrParamRequired("TrialName")) + } + if s.TrialName != nil && len(*s.TrialName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TrialName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDisplayName sets the DisplayName field's value. +func (s *UpdateTrialInput) SetDisplayName(v string) *UpdateTrialInput { + s.DisplayName = &v + return s +} + +// SetTrialName sets the TrialName field's value. +func (s *UpdateTrialInput) SetTrialName(v string) *UpdateTrialInput { + s.TrialName = &v + return s +} + +type UpdateTrialOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the trial. + TrialArn *string `type:"string"` +} + +// String returns the string representation +func (s UpdateTrialOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateTrialOutput) GoString() string { + return s.String() +} + +// SetTrialArn sets the TrialArn field's value. +func (s *UpdateTrialOutput) SetTrialArn(v string) *UpdateTrialOutput { + s.TrialArn = &v + return s +} + +type UpdateUserProfileInput struct { + _ struct{} `type:"structure"` + + // The domain ID. + // + // DomainId is a required field + DomainId *string `type:"string" required:"true"` + + // The user profile name. + // + // UserProfileName is a required field + UserProfileName *string `type:"string" required:"true"` + + // A collection of settings. + UserSettings *UserSettings `type:"structure"` +} + +// 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.DomainId == nil { + invalidParams.Add(request.NewErrParamRequired("DomainId")) + } + if s.UserProfileName == nil { + invalidParams.Add(request.NewErrParamRequired("UserProfileName")) + } + if s.UserSettings != nil { + if err := s.UserSettings.Validate(); err != nil { + invalidParams.AddNested("UserSettings", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDomainId sets the DomainId field's value. +func (s *UpdateUserProfileInput) SetDomainId(v string) *UpdateUserProfileInput { + s.DomainId = &v + return s +} + +// SetUserProfileName sets the UserProfileName field's value. +func (s *UpdateUserProfileInput) SetUserProfileName(v string) *UpdateUserProfileInput { + s.UserProfileName = &v + return s +} + +// SetUserSettings sets the UserSettings field's value. +func (s *UpdateUserProfileInput) SetUserSettings(v *UserSettings) *UpdateUserProfileInput { + s.UserSettings = v + return s +} + +type UpdateUserProfileOutput struct { + _ struct{} `type:"structure"` + + // The user profile Amazon Resource Name (ARN). + UserProfileArn *string `type:"string"` +} + +// 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() +} + +// SetUserProfileArn sets the UserProfileArn field's value. +func (s *UpdateUserProfileOutput) SetUserProfileArn(v string) *UpdateUserProfileOutput { + s.UserProfileArn = &v + return s +} + +type UpdateWorkforceInput struct { + _ struct{} `type:"structure"` + + // A list of one to four worker IP address ranges (CIDRs (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html)) + // that can be used to access tasks assigned to this workforce. + // + // Maximum: Four CIDR values + SourceIpConfig *SourceIpConfig `type:"structure"` + + // The name of the private workforce whose access you want to restrict. WorkforceName + // is automatically set to default when a workforce is created and cannot be + // modified. + // + // WorkforceName is a required field + WorkforceName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateWorkforceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateWorkforceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateWorkforceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateWorkforceInput"} + if s.WorkforceName == nil { + invalidParams.Add(request.NewErrParamRequired("WorkforceName")) + } + if s.WorkforceName != nil && len(*s.WorkforceName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("WorkforceName", 1)) + } + if s.SourceIpConfig != nil { + if err := s.SourceIpConfig.Validate(); err != nil { + invalidParams.AddNested("SourceIpConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSourceIpConfig sets the SourceIpConfig field's value. +func (s *UpdateWorkforceInput) SetSourceIpConfig(v *SourceIpConfig) *UpdateWorkforceInput { + s.SourceIpConfig = v + return s +} + +// SetWorkforceName sets the WorkforceName field's value. +func (s *UpdateWorkforceInput) SetWorkforceName(v string) *UpdateWorkforceInput { + s.WorkforceName = &v + return s +} + +type UpdateWorkforceOutput struct { + _ struct{} `type:"structure"` + + // A single private workforce, which is automatically created when you create + // your first private work team. You can create one private work force in each + // AWS Region. By default, any workforce-related API operation used in a specific + // region will apply to the workforce created in that region. To learn how to + // create a private workforce, see Create a Private Workforce (https://docs.aws.amazon.com/sagemaker/latest/dg/sms-workforce-create-private.html). + // + // Workforce is a required field + Workforce *Workforce `type:"structure" required:"true"` +} + +// String returns the string representation +func (s UpdateWorkforceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateWorkforceOutput) GoString() string { + return s.String() +} + +// SetWorkforce sets the Workforce field's value. +func (s *UpdateWorkforceOutput) SetWorkforce(v *Workforce) *UpdateWorkforceOutput { + s.Workforce = v + return s +} + type UpdateWorkteamInput struct { _ struct{} `type:"structure"` @@ -25869,6 +45300,245 @@ func (s *UpdateWorkteamOutput) SetWorkteam(v *Workteam) *UpdateWorkteamOutput { return s } +// Information about the user who created or modified an experiment, trial, +// or trial component. +type UserContext struct { + _ struct{} `type:"structure"` + + // The domain associated with the user. + DomainId *string `type:"string"` + + // The Amazon Resource Name (ARN) of the user's profile. + UserProfileArn *string `type:"string"` + + // The name of the user's profile. + UserProfileName *string `type:"string"` +} + +// String returns the string representation +func (s UserContext) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserContext) GoString() string { + return s.String() +} + +// SetDomainId sets the DomainId field's value. +func (s *UserContext) SetDomainId(v string) *UserContext { + s.DomainId = &v + return s +} + +// SetUserProfileArn sets the UserProfileArn field's value. +func (s *UserContext) SetUserProfileArn(v string) *UserContext { + s.UserProfileArn = &v + return s +} + +// SetUserProfileName sets the UserProfileName field's value. +func (s *UserContext) SetUserProfileName(v string) *UserContext { + s.UserProfileName = &v + return s +} + +// The user profile details. +type UserProfileDetails struct { + _ struct{} `type:"structure"` + + // The creation time. + CreationTime *time.Time `type:"timestamp"` + + // The domain ID. + DomainId *string `type:"string"` + + // The last modified time. + LastModifiedTime *time.Time `type:"timestamp"` + + // The status. + Status *string `type:"string" enum:"UserProfileStatus"` + + // The user profile name. + UserProfileName *string `type:"string"` +} + +// String returns the string representation +func (s UserProfileDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserProfileDetails) GoString() string { + return s.String() +} + +// SetCreationTime sets the CreationTime field's value. +func (s *UserProfileDetails) SetCreationTime(v time.Time) *UserProfileDetails { + s.CreationTime = &v + return s +} + +// SetDomainId sets the DomainId field's value. +func (s *UserProfileDetails) SetDomainId(v string) *UserProfileDetails { + s.DomainId = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *UserProfileDetails) SetLastModifiedTime(v time.Time) *UserProfileDetails { + s.LastModifiedTime = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *UserProfileDetails) SetStatus(v string) *UserProfileDetails { + s.Status = &v + return s +} + +// SetUserProfileName sets the UserProfileName field's value. +func (s *UserProfileDetails) SetUserProfileName(v string) *UserProfileDetails { + s.UserProfileName = &v + return s +} + +// A collection of settings. +type UserSettings struct { + _ struct{} `type:"structure"` + + // The execution role for the user. + ExecutionRole *string `min:"20" type:"string"` + + // The Jupyter server's app settings. + JupyterServerAppSettings *JupyterServerAppSettings `type:"structure"` + + // The kernel gateway app settings. + KernelGatewayAppSettings *KernelGatewayAppSettings `type:"structure"` + + // The security groups. + SecurityGroups []*string `type:"list"` + + // The sharing settings. + SharingSettings *SharingSettings `type:"structure"` + + // The TensorBoard app settings. + TensorBoardAppSettings *TensorBoardAppSettings `type:"structure"` +} + +// String returns the string representation +func (s UserSettings) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UserSettings) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UserSettings) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UserSettings"} + if s.ExecutionRole != nil && len(*s.ExecutionRole) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ExecutionRole", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetExecutionRole sets the ExecutionRole field's value. +func (s *UserSettings) SetExecutionRole(v string) *UserSettings { + s.ExecutionRole = &v + return s +} + +// SetJupyterServerAppSettings sets the JupyterServerAppSettings field's value. +func (s *UserSettings) SetJupyterServerAppSettings(v *JupyterServerAppSettings) *UserSettings { + s.JupyterServerAppSettings = v + return s +} + +// SetKernelGatewayAppSettings sets the KernelGatewayAppSettings field's value. +func (s *UserSettings) SetKernelGatewayAppSettings(v *KernelGatewayAppSettings) *UserSettings { + s.KernelGatewayAppSettings = v + return s +} + +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *UserSettings) SetSecurityGroups(v []*string) *UserSettings { + s.SecurityGroups = v + return s +} + +// SetSharingSettings sets the SharingSettings field's value. +func (s *UserSettings) SetSharingSettings(v *SharingSettings) *UserSettings { + s.SharingSettings = v + return s +} + +// SetTensorBoardAppSettings sets the TensorBoardAppSettings field's value. +func (s *UserSettings) SetTensorBoardAppSettings(v *TensorBoardAppSettings) *UserSettings { + s.TensorBoardAppSettings = v + return s +} + +// Specifies a production variant property type for an Endpoint. +// +// If you are updating an endpoint with the RetainAllVariantProperties (https://docs.aws.amazon.com/sagemaker/latest/dg/API_UpdateEndpoint.html#SageMaker-UpdateEndpoint-request-RetainAllVariantProperties) +// option set to true, the VariantProperty objects listed in ExcludeRetainedVariantProperties +// (https://docs.aws.amazon.com/sagemaker/latest/dg/API_UpdateEndpoint.html#SageMaker-UpdateEndpoint-request-ExcludeRetainedVariantProperties) +// override the existing variant properties of the endpoint. +type VariantProperty struct { + _ struct{} `type:"structure"` + + // The type of variant property. The supported values are: + // + // * DesiredInstanceCount: Overrides the existing variant instance counts + // using the InitialInstanceCount (https://docs.aws.amazon.com/sagemaker/latest/dg/API_ProductionVariant.html#SageMaker-Type-ProductionVariant-InitialInstanceCount) + // values in the ProductionVariants (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpointConfig.html#SageMaker-CreateEndpointConfig-request-ProductionVariants). + // + // * DesiredWeight: Overrides the existing variant weights using the InitialVariantWeight + // (https://docs.aws.amazon.com/sagemaker/latest/dg/API_ProductionVariant.html#SageMaker-Type-ProductionVariant-InitialVariantWeight) + // values in the ProductionVariants (https://docs.aws.amazon.com/sagemaker/latest/dg/API_CreateEndpointConfig.html#SageMaker-CreateEndpointConfig-request-ProductionVariants). + // + // * DataCaptureConfig: (Not currently supported.) + // + // VariantPropertyType is a required field + VariantPropertyType *string `type:"string" required:"true" enum:"VariantPropertyType"` +} + +// String returns the string representation +func (s VariantProperty) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VariantProperty) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *VariantProperty) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "VariantProperty"} + if s.VariantPropertyType == nil { + invalidParams.Add(request.NewErrParamRequired("VariantPropertyType")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetVariantPropertyType sets the VariantPropertyType field's value. +func (s *VariantProperty) SetVariantPropertyType(v string) *VariantProperty { + s.VariantPropertyType = &v + return s +} + // Specifies a VPC that your training jobs and hosted models have access to. // Control access to and from your training and model containers by configuring // the VPC. For more information, see Protect Endpoints by Using an Amazon Virtual @@ -25884,12 +45554,8 @@ type VpcConfig struct { SecurityGroupIds []*string `min:"1" type:"list" required:"true"` // The ID of the subnets in the VPC to which you want to connect your training - // job or model. - // - // Amazon EC2 P3 accelerated computing instances are not available in the c/d/e - // availability zones of region us-east-1. If you want to create endpoints with - // P3 instances in VPC mode in region us-east-1, create subnets in a/b/f availability - // zones instead. + // job or model. For information about the availability of specific instance + // types, see Supported Instance Types and Availability Zones (https://docs.aws.amazon.com/sagemaker/latest/dg/instance-types-az.html). // // Subnets is a required field Subnets []*string `min:"1" type:"list" required:"true"` @@ -25939,6 +45605,70 @@ func (s *VpcConfig) SetSubnets(v []*string) *VpcConfig { return s } +// A single private workforce, which is automatically created when you create +// your first private work team. You can create one private work force in each +// AWS Region. By default, any workforce-related API operation used in a specific +// region will apply to the workforce created in that region. To learn how to +// create a private workforce, see Create a Private Workforce (https://docs.aws.amazon.com/sagemaker/latest/dg/sms-workforce-create-private.html). +type Workforce struct { + _ struct{} `type:"structure"` + + // The most recent date that was used to successfully add one or more IP address + // ranges (CIDRs (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html)) + // to a private workforce's allow list. + LastUpdatedDate *time.Time `type:"timestamp"` + + // A list of one to four IP address ranges (CIDRs (https://docs.aws.amazon.com/vpc/latest/userguide/VPC_Subnets.html)) + // to be added to the workforce allow list. + SourceIpConfig *SourceIpConfig `type:"structure"` + + // The Amazon Resource Name (ARN) of the private workforce. + // + // WorkforceArn is a required field + WorkforceArn *string `type:"string" required:"true"` + + // The name of the private workforce whose access you want to restrict. WorkforceName + // is automatically set to default when a workforce is created and cannot be + // modified. + // + // WorkforceName is a required field + WorkforceName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s Workforce) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Workforce) GoString() string { + return s.String() +} + +// SetLastUpdatedDate sets the LastUpdatedDate field's value. +func (s *Workforce) SetLastUpdatedDate(v time.Time) *Workforce { + s.LastUpdatedDate = &v + return s +} + +// SetSourceIpConfig sets the SourceIpConfig field's value. +func (s *Workforce) SetSourceIpConfig(v *SourceIpConfig) *Workforce { + s.SourceIpConfig = v + return s +} + +// SetWorkforceArn sets the WorkforceArn field's value. +func (s *Workforce) SetWorkforceArn(v string) *Workforce { + s.WorkforceArn = &v + return s +} + +// SetWorkforceName sets the WorkforceName field's value. +func (s *Workforce) SetWorkforceName(v string) *Workforce { + s.WorkforceName = &v + return s +} + // Provides details about a labeling work team. type Workteam struct { _ struct{} `type:"structure"` @@ -26070,6 +45800,137 @@ const ( AlgorithmStatusDeleting = "Deleting" ) +const ( + // AppInstanceTypeSystem is a AppInstanceType enum value + AppInstanceTypeSystem = "system" + + // AppInstanceTypeMlT3Micro is a AppInstanceType enum value + AppInstanceTypeMlT3Micro = "ml.t3.micro" + + // AppInstanceTypeMlT3Small is a AppInstanceType enum value + AppInstanceTypeMlT3Small = "ml.t3.small" + + // AppInstanceTypeMlT3Medium is a AppInstanceType enum value + AppInstanceTypeMlT3Medium = "ml.t3.medium" + + // AppInstanceTypeMlT3Large is a AppInstanceType enum value + AppInstanceTypeMlT3Large = "ml.t3.large" + + // AppInstanceTypeMlT3Xlarge is a AppInstanceType enum value + AppInstanceTypeMlT3Xlarge = "ml.t3.xlarge" + + // AppInstanceTypeMlT32xlarge is a AppInstanceType enum value + AppInstanceTypeMlT32xlarge = "ml.t3.2xlarge" + + // AppInstanceTypeMlM5Large is a AppInstanceType enum value + AppInstanceTypeMlM5Large = "ml.m5.large" + + // AppInstanceTypeMlM5Xlarge is a AppInstanceType enum value + AppInstanceTypeMlM5Xlarge = "ml.m5.xlarge" + + // AppInstanceTypeMlM52xlarge is a AppInstanceType enum value + AppInstanceTypeMlM52xlarge = "ml.m5.2xlarge" + + // AppInstanceTypeMlM54xlarge is a AppInstanceType enum value + AppInstanceTypeMlM54xlarge = "ml.m5.4xlarge" + + // AppInstanceTypeMlM58xlarge is a AppInstanceType enum value + AppInstanceTypeMlM58xlarge = "ml.m5.8xlarge" + + // AppInstanceTypeMlM512xlarge is a AppInstanceType enum value + AppInstanceTypeMlM512xlarge = "ml.m5.12xlarge" + + // AppInstanceTypeMlM516xlarge is a AppInstanceType enum value + AppInstanceTypeMlM516xlarge = "ml.m5.16xlarge" + + // AppInstanceTypeMlM524xlarge is a AppInstanceType enum value + AppInstanceTypeMlM524xlarge = "ml.m5.24xlarge" + + // AppInstanceTypeMlC5Large is a AppInstanceType enum value + AppInstanceTypeMlC5Large = "ml.c5.large" + + // AppInstanceTypeMlC5Xlarge is a AppInstanceType enum value + AppInstanceTypeMlC5Xlarge = "ml.c5.xlarge" + + // AppInstanceTypeMlC52xlarge is a AppInstanceType enum value + AppInstanceTypeMlC52xlarge = "ml.c5.2xlarge" + + // AppInstanceTypeMlC54xlarge is a AppInstanceType enum value + AppInstanceTypeMlC54xlarge = "ml.c5.4xlarge" + + // AppInstanceTypeMlC59xlarge is a AppInstanceType enum value + AppInstanceTypeMlC59xlarge = "ml.c5.9xlarge" + + // AppInstanceTypeMlC512xlarge is a AppInstanceType enum value + AppInstanceTypeMlC512xlarge = "ml.c5.12xlarge" + + // AppInstanceTypeMlC518xlarge is a AppInstanceType enum value + AppInstanceTypeMlC518xlarge = "ml.c5.18xlarge" + + // AppInstanceTypeMlC524xlarge is a AppInstanceType enum value + AppInstanceTypeMlC524xlarge = "ml.c5.24xlarge" + + // AppInstanceTypeMlP32xlarge is a AppInstanceType enum value + AppInstanceTypeMlP32xlarge = "ml.p3.2xlarge" + + // AppInstanceTypeMlP38xlarge is a AppInstanceType enum value + AppInstanceTypeMlP38xlarge = "ml.p3.8xlarge" + + // AppInstanceTypeMlP316xlarge is a AppInstanceType enum value + AppInstanceTypeMlP316xlarge = "ml.p3.16xlarge" + + // AppInstanceTypeMlG4dnXlarge is a AppInstanceType enum value + AppInstanceTypeMlG4dnXlarge = "ml.g4dn.xlarge" + + // AppInstanceTypeMlG4dn2xlarge is a AppInstanceType enum value + AppInstanceTypeMlG4dn2xlarge = "ml.g4dn.2xlarge" + + // AppInstanceTypeMlG4dn4xlarge is a AppInstanceType enum value + AppInstanceTypeMlG4dn4xlarge = "ml.g4dn.4xlarge" + + // AppInstanceTypeMlG4dn8xlarge is a AppInstanceType enum value + AppInstanceTypeMlG4dn8xlarge = "ml.g4dn.8xlarge" + + // AppInstanceTypeMlG4dn12xlarge is a AppInstanceType enum value + AppInstanceTypeMlG4dn12xlarge = "ml.g4dn.12xlarge" + + // AppInstanceTypeMlG4dn16xlarge is a AppInstanceType enum value + AppInstanceTypeMlG4dn16xlarge = "ml.g4dn.16xlarge" +) + +const ( + // AppSortKeyCreationTime is a AppSortKey enum value + AppSortKeyCreationTime = "CreationTime" +) + +const ( + // AppStatusDeleted is a AppStatus enum value + AppStatusDeleted = "Deleted" + + // AppStatusDeleting is a AppStatus enum value + AppStatusDeleting = "Deleting" + + // AppStatusFailed is a AppStatus enum value + AppStatusFailed = "Failed" + + // AppStatusInService is a AppStatus enum value + AppStatusInService = "InService" + + // AppStatusPending is a AppStatus enum value + AppStatusPending = "Pending" +) + +const ( + // AppTypeJupyterServer is a AppType enum value + AppTypeJupyterServer = "JupyterServer" + + // AppTypeKernelGateway is a AppType enum value + AppTypeKernelGateway = "KernelGateway" + + // AppTypeTensorBoard is a AppType enum value + AppTypeTensorBoard = "TensorBoard" +) + const ( // AssemblyTypeNone is a AssemblyType enum value AssemblyTypeNone = "None" @@ -26078,6 +45939,120 @@ const ( AssemblyTypeLine = "Line" ) +const ( + // AuthModeSso is a AuthMode enum value + AuthModeSso = "SSO" + + // AuthModeIam is a AuthMode enum value + AuthModeIam = "IAM" +) + +const ( + // AutoMLJobObjectiveTypeMaximize is a AutoMLJobObjectiveType enum value + AutoMLJobObjectiveTypeMaximize = "Maximize" + + // AutoMLJobObjectiveTypeMinimize is a AutoMLJobObjectiveType enum value + AutoMLJobObjectiveTypeMinimize = "Minimize" +) + +const ( + // AutoMLJobSecondaryStatusStarting is a AutoMLJobSecondaryStatus enum value + AutoMLJobSecondaryStatusStarting = "Starting" + + // AutoMLJobSecondaryStatusAnalyzingData is a AutoMLJobSecondaryStatus enum value + AutoMLJobSecondaryStatusAnalyzingData = "AnalyzingData" + + // AutoMLJobSecondaryStatusFeatureEngineering is a AutoMLJobSecondaryStatus enum value + AutoMLJobSecondaryStatusFeatureEngineering = "FeatureEngineering" + + // AutoMLJobSecondaryStatusModelTuning is a AutoMLJobSecondaryStatus enum value + AutoMLJobSecondaryStatusModelTuning = "ModelTuning" + + // AutoMLJobSecondaryStatusMaxCandidatesReached is a AutoMLJobSecondaryStatus enum value + AutoMLJobSecondaryStatusMaxCandidatesReached = "MaxCandidatesReached" + + // AutoMLJobSecondaryStatusFailed is a AutoMLJobSecondaryStatus enum value + AutoMLJobSecondaryStatusFailed = "Failed" + + // AutoMLJobSecondaryStatusStopped is a AutoMLJobSecondaryStatus enum value + AutoMLJobSecondaryStatusStopped = "Stopped" + + // AutoMLJobSecondaryStatusMaxAutoMljobRuntimeReached is a AutoMLJobSecondaryStatus enum value + AutoMLJobSecondaryStatusMaxAutoMljobRuntimeReached = "MaxAutoMLJobRuntimeReached" + + // AutoMLJobSecondaryStatusStopping is a AutoMLJobSecondaryStatus enum value + AutoMLJobSecondaryStatusStopping = "Stopping" + + // AutoMLJobSecondaryStatusCandidateDefinitionsGenerated is a AutoMLJobSecondaryStatus enum value + AutoMLJobSecondaryStatusCandidateDefinitionsGenerated = "CandidateDefinitionsGenerated" +) + +const ( + // AutoMLJobStatusCompleted is a AutoMLJobStatus enum value + AutoMLJobStatusCompleted = "Completed" + + // AutoMLJobStatusInProgress is a AutoMLJobStatus enum value + AutoMLJobStatusInProgress = "InProgress" + + // AutoMLJobStatusFailed is a AutoMLJobStatus enum value + AutoMLJobStatusFailed = "Failed" + + // AutoMLJobStatusStopped is a AutoMLJobStatus enum value + AutoMLJobStatusStopped = "Stopped" + + // AutoMLJobStatusStopping is a AutoMLJobStatus enum value + AutoMLJobStatusStopping = "Stopping" +) + +const ( + // AutoMLMetricEnumAccuracy is a AutoMLMetricEnum enum value + AutoMLMetricEnumAccuracy = "Accuracy" + + // AutoMLMetricEnumMse is a AutoMLMetricEnum enum value + AutoMLMetricEnumMse = "MSE" + + // AutoMLMetricEnumF1 is a AutoMLMetricEnum enum value + AutoMLMetricEnumF1 = "F1" + + // AutoMLMetricEnumF1macro is a AutoMLMetricEnum enum value + AutoMLMetricEnumF1macro = "F1macro" +) + +const ( + // AutoMLS3DataTypeManifestFile is a AutoMLS3DataType enum value + AutoMLS3DataTypeManifestFile = "ManifestFile" + + // AutoMLS3DataTypeS3prefix is a AutoMLS3DataType enum value + AutoMLS3DataTypeS3prefix = "S3Prefix" +) + +const ( + // AutoMLSortByName is a AutoMLSortBy enum value + AutoMLSortByName = "Name" + + // AutoMLSortByCreationTime is a AutoMLSortBy enum value + AutoMLSortByCreationTime = "CreationTime" + + // AutoMLSortByStatus is a AutoMLSortBy enum value + AutoMLSortByStatus = "Status" +) + +const ( + // AutoMLSortOrderAscending is a AutoMLSortOrder enum value + AutoMLSortOrderAscending = "Ascending" + + // AutoMLSortOrderDescending is a AutoMLSortOrder enum value + AutoMLSortOrderDescending = "Descending" +) + +const ( + // AwsManagedHumanLoopRequestSourceAwsRekognitionDetectModerationLabelsImageV3 is a AwsManagedHumanLoopRequestSource enum value + AwsManagedHumanLoopRequestSourceAwsRekognitionDetectModerationLabelsImageV3 = "AWS/Rekognition/DetectModerationLabels/Image/V3" + + // AwsManagedHumanLoopRequestSourceAwsTextractAnalyzeDocumentFormsV1 is a AwsManagedHumanLoopRequestSource enum value + AwsManagedHumanLoopRequestSourceAwsTextractAnalyzeDocumentFormsV1 = "AWS/Textract/AnalyzeDocument/Forms/V1" +) + const ( // BatchStrategyMultiRecord is a BatchStrategy enum value BatchStrategyMultiRecord = "MultiRecord" @@ -26094,6 +46069,61 @@ const ( BooleanOperatorOr = "Or" ) +const ( + // CandidateSortByCreationTime is a CandidateSortBy enum value + CandidateSortByCreationTime = "CreationTime" + + // CandidateSortByStatus is a CandidateSortBy enum value + CandidateSortByStatus = "Status" + + // CandidateSortByFinalObjectiveMetricValue is a CandidateSortBy enum value + CandidateSortByFinalObjectiveMetricValue = "FinalObjectiveMetricValue" +) + +const ( + // CandidateStatusCompleted is a CandidateStatus enum value + CandidateStatusCompleted = "Completed" + + // CandidateStatusInProgress is a CandidateStatus enum value + CandidateStatusInProgress = "InProgress" + + // CandidateStatusFailed is a CandidateStatus enum value + CandidateStatusFailed = "Failed" + + // CandidateStatusStopped is a CandidateStatus enum value + CandidateStatusStopped = "Stopped" + + // CandidateStatusStopping is a CandidateStatus enum value + CandidateStatusStopping = "Stopping" +) + +const ( + // CandidateStepTypeAwsSageMakerTrainingJob is a CandidateStepType enum value + CandidateStepTypeAwsSageMakerTrainingJob = "AWS::SageMaker::TrainingJob" + + // CandidateStepTypeAwsSageMakerTransformJob is a CandidateStepType enum value + CandidateStepTypeAwsSageMakerTransformJob = "AWS::SageMaker::TransformJob" + + // CandidateStepTypeAwsSageMakerProcessingJob is a CandidateStepType enum value + CandidateStepTypeAwsSageMakerProcessingJob = "AWS::SageMaker::ProcessingJob" +) + +const ( + // CaptureModeInput is a CaptureMode enum value + CaptureModeInput = "Input" + + // CaptureModeOutput is a CaptureMode enum value + CaptureModeOutput = "Output" +) + +const ( + // CaptureStatusStarted is a CaptureStatus enum value + CaptureStatusStarted = "Started" + + // CaptureStatusStopped is a CaptureStatus enum value + CaptureStatusStopped = "Stopped" +) + const ( // CodeRepositorySortByName is a CodeRepositorySortBy enum value CodeRepositorySortByName = "Name" @@ -26141,6 +46171,14 @@ const ( CompressionTypeGzip = "Gzip" ) +const ( + // ContainerModeSingleModel is a ContainerMode enum value + ContainerModeSingleModel = "SingleModel" + + // ContainerModeMultiModel is a ContainerMode enum value + ContainerModeMultiModel = "MultiModel" +) + const ( // ContentClassifierFreeOfPersonallyIdentifiableInformation is a ContentClassifier enum value ContentClassifierFreeOfPersonallyIdentifiableInformation = "FreeOfPersonallyIdentifiableInformation" @@ -26185,6 +46223,20 @@ const ( DirectInternetAccessDisabled = "Disabled" ) +const ( + // DomainStatusDeleting is a DomainStatus enum value + DomainStatusDeleting = "Deleting" + + // DomainStatusFailed is a DomainStatus enum value + DomainStatusFailed = "Failed" + + // DomainStatusInService is a DomainStatus enum value + DomainStatusInService = "InService" + + // DomainStatusPending is a DomainStatus enum value + DomainStatusPending = "Pending" +) + const ( // EndpointConfigSortKeyName is a EndpointConfigSortKey enum value EndpointConfigSortKeyName = "Name" @@ -26230,6 +46282,29 @@ const ( EndpointStatusFailed = "Failed" ) +const ( + // ExecutionStatusPending is a ExecutionStatus enum value + ExecutionStatusPending = "Pending" + + // ExecutionStatusCompleted is a ExecutionStatus enum value + ExecutionStatusCompleted = "Completed" + + // ExecutionStatusCompletedWithViolations is a ExecutionStatus enum value + ExecutionStatusCompletedWithViolations = "CompletedWithViolations" + + // ExecutionStatusInProgress is a ExecutionStatus enum value + ExecutionStatusInProgress = "InProgress" + + // ExecutionStatusFailed is a ExecutionStatus enum value + ExecutionStatusFailed = "Failed" + + // ExecutionStatusStopping is a ExecutionStatus enum value + ExecutionStatusStopping = "Stopping" + + // ExecutionStatusStopped is a ExecutionStatus enum value + ExecutionStatusStopped = "Stopped" +) + const ( // FileSystemAccessModeRw is a FileSystemAccessMode enum value FileSystemAccessModeRw = "rw" @@ -26246,10 +46321,30 @@ const ( FileSystemTypeFsxLustre = "FSxLustre" ) +const ( + // FlowDefinitionStatusInitializing is a FlowDefinitionStatus enum value + FlowDefinitionStatusInitializing = "Initializing" + + // FlowDefinitionStatusActive is a FlowDefinitionStatus enum value + FlowDefinitionStatusActive = "Active" + + // FlowDefinitionStatusFailed is a FlowDefinitionStatus enum value + FlowDefinitionStatusFailed = "Failed" + + // FlowDefinitionStatusDeleting is a FlowDefinitionStatus enum value + FlowDefinitionStatusDeleting = "Deleting" + + // FlowDefinitionStatusDeleted is a FlowDefinitionStatus enum value + FlowDefinitionStatusDeleted = "Deleted" +) + const ( // FrameworkTensorflow is a Framework enum value FrameworkTensorflow = "TENSORFLOW" + // FrameworkKeras is a Framework enum value + FrameworkKeras = "KERAS" + // FrameworkMxnet is a Framework enum value FrameworkMxnet = "MXNET" @@ -26529,6 +46624,28 @@ const ( ModelSortKeyCreationTime = "CreationTime" ) +const ( + // MonitoringExecutionSortKeyCreationTime is a MonitoringExecutionSortKey enum value + MonitoringExecutionSortKeyCreationTime = "CreationTime" + + // MonitoringExecutionSortKeyScheduledTime is a MonitoringExecutionSortKey enum value + MonitoringExecutionSortKeyScheduledTime = "ScheduledTime" + + // MonitoringExecutionSortKeyStatus is a MonitoringExecutionSortKey enum value + MonitoringExecutionSortKeyStatus = "Status" +) + +const ( + // MonitoringScheduleSortKeyName is a MonitoringScheduleSortKey enum value + MonitoringScheduleSortKeyName = "Name" + + // MonitoringScheduleSortKeyCreationTime is a MonitoringScheduleSortKey enum value + MonitoringScheduleSortKeyCreationTime = "CreationTime" + + // MonitoringScheduleSortKeyStatus is a MonitoringScheduleSortKey enum value + MonitoringScheduleSortKeyStatus = "Status" +) + const ( // NotebookInstanceAcceleratorTypeMlEia1Medium is a NotebookInstanceAcceleratorType enum value NotebookInstanceAcceleratorTypeMlEia1Medium = "ml.eia1.medium" @@ -26538,6 +46655,15 @@ const ( // NotebookInstanceAcceleratorTypeMlEia1Xlarge is a NotebookInstanceAcceleratorType enum value NotebookInstanceAcceleratorTypeMlEia1Xlarge = "ml.eia1.xlarge" + + // NotebookInstanceAcceleratorTypeMlEia2Medium is a NotebookInstanceAcceleratorType enum value + NotebookInstanceAcceleratorTypeMlEia2Medium = "ml.eia2.medium" + + // NotebookInstanceAcceleratorTypeMlEia2Large is a NotebookInstanceAcceleratorType enum value + NotebookInstanceAcceleratorTypeMlEia2Large = "ml.eia2.large" + + // NotebookInstanceAcceleratorTypeMlEia2Xlarge is a NotebookInstanceAcceleratorType enum value + NotebookInstanceAcceleratorTypeMlEia2Xlarge = "ml.eia2.xlarge" ) const ( @@ -26601,6 +46727,14 @@ const ( NotebookInstanceStatusUpdating = "Updating" ) +const ( + // NotebookOutputOptionAllowed is a NotebookOutputOption enum value + NotebookOutputOptionAllowed = "Allowed" + + // NotebookOutputOptionDisabled is a NotebookOutputOption enum value + NotebookOutputOptionDisabled = "Disabled" +) + const ( // ObjectiveStatusSucceeded is a ObjectiveStatus enum value ObjectiveStatusSucceeded = "Succeeded" @@ -26633,6 +46767,12 @@ const ( // OperatorContains is a Operator enum value OperatorContains = "Contains" + + // OperatorExists is a Operator enum value + OperatorExists = "Exists" + + // OperatorNotExists is a Operator enum value + OperatorNotExists = "NotExists" ) const ( @@ -26657,6 +46797,190 @@ const ( ParameterTypeFreeText = "FreeText" ) +const ( + // ProblemTypeBinaryClassification is a ProblemType enum value + ProblemTypeBinaryClassification = "BinaryClassification" + + // ProblemTypeMulticlassClassification is a ProblemType enum value + ProblemTypeMulticlassClassification = "MulticlassClassification" + + // ProblemTypeRegression is a ProblemType enum value + ProblemTypeRegression = "Regression" +) + +const ( + // ProcessingInstanceTypeMlT3Medium is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlT3Medium = "ml.t3.medium" + + // ProcessingInstanceTypeMlT3Large is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlT3Large = "ml.t3.large" + + // ProcessingInstanceTypeMlT3Xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlT3Xlarge = "ml.t3.xlarge" + + // ProcessingInstanceTypeMlT32xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlT32xlarge = "ml.t3.2xlarge" + + // ProcessingInstanceTypeMlM4Xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlM4Xlarge = "ml.m4.xlarge" + + // ProcessingInstanceTypeMlM42xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlM42xlarge = "ml.m4.2xlarge" + + // ProcessingInstanceTypeMlM44xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlM44xlarge = "ml.m4.4xlarge" + + // ProcessingInstanceTypeMlM410xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlM410xlarge = "ml.m4.10xlarge" + + // ProcessingInstanceTypeMlM416xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlM416xlarge = "ml.m4.16xlarge" + + // ProcessingInstanceTypeMlC4Xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlC4Xlarge = "ml.c4.xlarge" + + // ProcessingInstanceTypeMlC42xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlC42xlarge = "ml.c4.2xlarge" + + // ProcessingInstanceTypeMlC44xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlC44xlarge = "ml.c4.4xlarge" + + // ProcessingInstanceTypeMlC48xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlC48xlarge = "ml.c4.8xlarge" + + // ProcessingInstanceTypeMlP2Xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlP2Xlarge = "ml.p2.xlarge" + + // ProcessingInstanceTypeMlP28xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlP28xlarge = "ml.p2.8xlarge" + + // ProcessingInstanceTypeMlP216xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlP216xlarge = "ml.p2.16xlarge" + + // ProcessingInstanceTypeMlP32xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlP32xlarge = "ml.p3.2xlarge" + + // ProcessingInstanceTypeMlP38xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlP38xlarge = "ml.p3.8xlarge" + + // ProcessingInstanceTypeMlP316xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlP316xlarge = "ml.p3.16xlarge" + + // ProcessingInstanceTypeMlC5Xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlC5Xlarge = "ml.c5.xlarge" + + // ProcessingInstanceTypeMlC52xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlC52xlarge = "ml.c5.2xlarge" + + // ProcessingInstanceTypeMlC54xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlC54xlarge = "ml.c5.4xlarge" + + // ProcessingInstanceTypeMlC59xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlC59xlarge = "ml.c5.9xlarge" + + // ProcessingInstanceTypeMlC518xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlC518xlarge = "ml.c5.18xlarge" + + // ProcessingInstanceTypeMlM5Large is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlM5Large = "ml.m5.large" + + // ProcessingInstanceTypeMlM5Xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlM5Xlarge = "ml.m5.xlarge" + + // ProcessingInstanceTypeMlM52xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlM52xlarge = "ml.m5.2xlarge" + + // ProcessingInstanceTypeMlM54xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlM54xlarge = "ml.m5.4xlarge" + + // ProcessingInstanceTypeMlM512xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlM512xlarge = "ml.m5.12xlarge" + + // ProcessingInstanceTypeMlM524xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlM524xlarge = "ml.m5.24xlarge" + + // ProcessingInstanceTypeMlR5Large is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlR5Large = "ml.r5.large" + + // ProcessingInstanceTypeMlR5Xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlR5Xlarge = "ml.r5.xlarge" + + // ProcessingInstanceTypeMlR52xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlR52xlarge = "ml.r5.2xlarge" + + // ProcessingInstanceTypeMlR54xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlR54xlarge = "ml.r5.4xlarge" + + // ProcessingInstanceTypeMlR58xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlR58xlarge = "ml.r5.8xlarge" + + // ProcessingInstanceTypeMlR512xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlR512xlarge = "ml.r5.12xlarge" + + // ProcessingInstanceTypeMlR516xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlR516xlarge = "ml.r5.16xlarge" + + // ProcessingInstanceTypeMlR524xlarge is a ProcessingInstanceType enum value + ProcessingInstanceTypeMlR524xlarge = "ml.r5.24xlarge" +) + +const ( + // ProcessingJobStatusInProgress is a ProcessingJobStatus enum value + ProcessingJobStatusInProgress = "InProgress" + + // ProcessingJobStatusCompleted is a ProcessingJobStatus enum value + ProcessingJobStatusCompleted = "Completed" + + // ProcessingJobStatusFailed is a ProcessingJobStatus enum value + ProcessingJobStatusFailed = "Failed" + + // ProcessingJobStatusStopping is a ProcessingJobStatus enum value + ProcessingJobStatusStopping = "Stopping" + + // ProcessingJobStatusStopped is a ProcessingJobStatus enum value + ProcessingJobStatusStopped = "Stopped" +) + +const ( + // ProcessingS3CompressionTypeNone is a ProcessingS3CompressionType enum value + ProcessingS3CompressionTypeNone = "None" + + // ProcessingS3CompressionTypeGzip is a ProcessingS3CompressionType enum value + ProcessingS3CompressionTypeGzip = "Gzip" +) + +const ( + // ProcessingS3DataDistributionTypeFullyReplicated is a ProcessingS3DataDistributionType enum value + ProcessingS3DataDistributionTypeFullyReplicated = "FullyReplicated" + + // ProcessingS3DataDistributionTypeShardedByS3key is a ProcessingS3DataDistributionType enum value + ProcessingS3DataDistributionTypeShardedByS3key = "ShardedByS3Key" +) + +const ( + // ProcessingS3DataTypeManifestFile is a ProcessingS3DataType enum value + ProcessingS3DataTypeManifestFile = "ManifestFile" + + // ProcessingS3DataTypeS3prefix is a ProcessingS3DataType enum value + ProcessingS3DataTypeS3prefix = "S3Prefix" +) + +const ( + // ProcessingS3InputModePipe is a ProcessingS3InputMode enum value + ProcessingS3InputModePipe = "Pipe" + + // ProcessingS3InputModeFile is a ProcessingS3InputMode enum value + ProcessingS3InputModeFile = "File" +) + +const ( + // ProcessingS3UploadModeContinuous is a ProcessingS3UploadMode enum value + ProcessingS3UploadModeContinuous = "Continuous" + + // ProcessingS3UploadModeEndOfJob is a ProcessingS3UploadMode enum value + ProcessingS3UploadModeEndOfJob = "EndOfJob" +) + const ( // ProductionVariantAcceleratorTypeMlEia1Medium is a ProductionVariantAcceleratorType enum value ProductionVariantAcceleratorTypeMlEia1Medium = "ml.eia1.medium" @@ -26666,6 +46990,15 @@ const ( // ProductionVariantAcceleratorTypeMlEia1Xlarge is a ProductionVariantAcceleratorType enum value ProductionVariantAcceleratorTypeMlEia1Xlarge = "ml.eia1.xlarge" + + // ProductionVariantAcceleratorTypeMlEia2Medium is a ProductionVariantAcceleratorType enum value + ProductionVariantAcceleratorTypeMlEia2Medium = "ml.eia2.medium" + + // ProductionVariantAcceleratorTypeMlEia2Large is a ProductionVariantAcceleratorType enum value + ProductionVariantAcceleratorTypeMlEia2Large = "ml.eia2.large" + + // ProductionVariantAcceleratorTypeMlEia2Xlarge is a ProductionVariantAcceleratorType enum value + ProductionVariantAcceleratorTypeMlEia2Xlarge = "ml.eia2.xlarge" ) const ( @@ -26714,6 +47047,24 @@ const ( // ProductionVariantInstanceTypeMlM524xlarge is a ProductionVariantInstanceType enum value ProductionVariantInstanceTypeMlM524xlarge = "ml.m5.24xlarge" + // ProductionVariantInstanceTypeMlM5dLarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlM5dLarge = "ml.m5d.large" + + // ProductionVariantInstanceTypeMlM5dXlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlM5dXlarge = "ml.m5d.xlarge" + + // ProductionVariantInstanceTypeMlM5d2xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlM5d2xlarge = "ml.m5d.2xlarge" + + // ProductionVariantInstanceTypeMlM5d4xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlM5d4xlarge = "ml.m5d.4xlarge" + + // ProductionVariantInstanceTypeMlM5d12xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlM5d12xlarge = "ml.m5d.12xlarge" + + // ProductionVariantInstanceTypeMlM5d24xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlM5d24xlarge = "ml.m5d.24xlarge" + // ProductionVariantInstanceTypeMlC4Large is a ProductionVariantInstanceType enum value ProductionVariantInstanceTypeMlC4Large = "ml.c4.large" @@ -26765,6 +47116,24 @@ const ( // ProductionVariantInstanceTypeMlC518xlarge is a ProductionVariantInstanceType enum value ProductionVariantInstanceTypeMlC518xlarge = "ml.c5.18xlarge" + // ProductionVariantInstanceTypeMlC5dLarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlC5dLarge = "ml.c5d.large" + + // ProductionVariantInstanceTypeMlC5dXlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlC5dXlarge = "ml.c5d.xlarge" + + // ProductionVariantInstanceTypeMlC5d2xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlC5d2xlarge = "ml.c5d.2xlarge" + + // ProductionVariantInstanceTypeMlC5d4xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlC5d4xlarge = "ml.c5d.4xlarge" + + // ProductionVariantInstanceTypeMlC5d9xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlC5d9xlarge = "ml.c5d.9xlarge" + + // ProductionVariantInstanceTypeMlC5d18xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlC5d18xlarge = "ml.c5d.18xlarge" + // ProductionVariantInstanceTypeMlG4dnXlarge is a ProductionVariantInstanceType enum value ProductionVariantInstanceTypeMlG4dnXlarge = "ml.g4dn.xlarge" @@ -26800,6 +47169,36 @@ const ( // ProductionVariantInstanceTypeMlR524xlarge is a ProductionVariantInstanceType enum value ProductionVariantInstanceTypeMlR524xlarge = "ml.r5.24xlarge" + + // ProductionVariantInstanceTypeMlR5dLarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlR5dLarge = "ml.r5d.large" + + // ProductionVariantInstanceTypeMlR5dXlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlR5dXlarge = "ml.r5d.xlarge" + + // ProductionVariantInstanceTypeMlR5d2xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlR5d2xlarge = "ml.r5d.2xlarge" + + // ProductionVariantInstanceTypeMlR5d4xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlR5d4xlarge = "ml.r5d.4xlarge" + + // ProductionVariantInstanceTypeMlR5d12xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlR5d12xlarge = "ml.r5d.12xlarge" + + // ProductionVariantInstanceTypeMlR5d24xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlR5d24xlarge = "ml.r5d.24xlarge" + + // ProductionVariantInstanceTypeMlInf1Xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlInf1Xlarge = "ml.inf1.xlarge" + + // ProductionVariantInstanceTypeMlInf12xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlInf12xlarge = "ml.inf1.2xlarge" + + // ProductionVariantInstanceTypeMlInf16xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlInf16xlarge = "ml.inf1.6xlarge" + + // ProductionVariantInstanceTypeMlInf124xlarge is a ProductionVariantInstanceType enum value + ProductionVariantInstanceTypeMlInf124xlarge = "ml.inf1.24xlarge" ) const ( @@ -26813,6 +47212,23 @@ const ( const ( // ResourceTypeTrainingJob is a ResourceType enum value ResourceTypeTrainingJob = "TrainingJob" + + // ResourceTypeExperiment is a ResourceType enum value + ResourceTypeExperiment = "Experiment" + + // ResourceTypeExperimentTrial is a ResourceType enum value + ResourceTypeExperimentTrial = "ExperimentTrial" + + // ResourceTypeExperimentTrialComponent is a ResourceType enum value + ResourceTypeExperimentTrialComponent = "ExperimentTrialComponent" +) + +const ( + // RetentionTypeRetain is a RetentionType enum value + RetentionTypeRetain = "Retain" + + // RetentionTypeDelete is a RetentionType enum value + RetentionTypeDelete = "Delete" ) const ( @@ -26823,6 +47239,26 @@ const ( RootAccessDisabled = "Disabled" ) +const ( + // RuleEvaluationStatusInProgress is a RuleEvaluationStatus enum value + RuleEvaluationStatusInProgress = "InProgress" + + // RuleEvaluationStatusNoIssuesFound is a RuleEvaluationStatus enum value + RuleEvaluationStatusNoIssuesFound = "NoIssuesFound" + + // RuleEvaluationStatusIssuesFound is a RuleEvaluationStatus enum value + RuleEvaluationStatusIssuesFound = "IssuesFound" + + // RuleEvaluationStatusError is a RuleEvaluationStatus enum value + RuleEvaluationStatusError = "Error" + + // RuleEvaluationStatusStopping is a RuleEvaluationStatus enum value + RuleEvaluationStatusStopping = "Stopping" + + // RuleEvaluationStatusStopped is a RuleEvaluationStatus enum value + RuleEvaluationStatusStopped = "Stopped" +) + const ( // S3DataDistributionFullyReplicated is a S3DataDistribution enum value S3DataDistributionFullyReplicated = "FullyReplicated" @@ -26842,6 +47278,20 @@ const ( S3DataTypeAugmentedManifestFile = "AugmentedManifestFile" ) +const ( + // ScheduleStatusPending is a ScheduleStatus enum value + ScheduleStatusPending = "Pending" + + // ScheduleStatusFailed is a ScheduleStatus enum value + ScheduleStatusFailed = "Failed" + + // ScheduleStatusScheduled is a ScheduleStatus enum value + ScheduleStatusScheduled = "Scheduled" + + // ScheduleStatusStopped is a ScheduleStatus enum value + ScheduleStatusStopped = "Stopped" +) + const ( // SearchSortOrderAscending is a SearchSortOrder enum value SearchSortOrderAscending = "Ascending" @@ -26905,6 +47355,14 @@ const ( SortByStatus = "Status" ) +const ( + // SortExperimentsByName is a SortExperimentsBy enum value + SortExperimentsByName = "Name" + + // SortExperimentsByCreationTime is a SortExperimentsBy enum value + SortExperimentsByCreationTime = "CreationTime" +) + const ( // SortOrderAscending is a SortOrder enum value SortOrderAscending = "Ascending" @@ -26913,6 +47371,22 @@ const ( SortOrderDescending = "Descending" ) +const ( + // SortTrialComponentsByName is a SortTrialComponentsBy enum value + SortTrialComponentsByName = "Name" + + // SortTrialComponentsByCreationTime is a SortTrialComponentsBy enum value + SortTrialComponentsByCreationTime = "CreationTime" +) + +const ( + // SortTrialsByName is a SortTrialsBy enum value + SortTrialsByName = "Name" + + // SortTrialsByCreationTime is a SortTrialsBy enum value + SortTrialsByCreationTime = "CreationTime" +) + const ( // SplitTypeNone is a SplitType enum value SplitTypeNone = "None" @@ -26949,6 +47423,9 @@ const ( // TargetDeviceMlP3 is a TargetDevice enum value TargetDeviceMlP3 = "ml_p3" + // TargetDeviceMlInf1 is a TargetDevice enum value + TargetDeviceMlInf1 = "ml_inf1" + // TargetDeviceJetsonTx1 is a TargetDevice enum value TargetDeviceJetsonTx1 = "jetson_tx1" @@ -26958,9 +47435,15 @@ const ( // TargetDeviceJetsonNano is a TargetDevice enum value TargetDeviceJetsonNano = "jetson_nano" + // TargetDeviceJetsonXavier is a TargetDevice enum value + TargetDeviceJetsonXavier = "jetson_xavier" + // TargetDeviceRasp3b is a TargetDevice enum value TargetDeviceRasp3b = "rasp3b" + // TargetDeviceImx8qm is a TargetDevice enum value + TargetDeviceImx8qm = "imx8qm" + // TargetDeviceDeeplens is a TargetDevice enum value TargetDeviceDeeplens = "deeplens" @@ -26981,6 +47464,9 @@ const ( // TargetDeviceQcs603 is a TargetDevice enum value TargetDeviceQcs603 = "qcs603" + + // TargetDeviceAmbaCv22 is a TargetDevice enum value + TargetDeviceAmbaCv22 = "amba_cv22" ) const ( @@ -27007,6 +47493,24 @@ const ( // TrainingInstanceTypeMlM416xlarge is a TrainingInstanceType enum value TrainingInstanceTypeMlM416xlarge = "ml.m4.16xlarge" + // TrainingInstanceTypeMlG4dnXlarge is a TrainingInstanceType enum value + TrainingInstanceTypeMlG4dnXlarge = "ml.g4dn.xlarge" + + // TrainingInstanceTypeMlG4dn2xlarge is a TrainingInstanceType enum value + TrainingInstanceTypeMlG4dn2xlarge = "ml.g4dn.2xlarge" + + // TrainingInstanceTypeMlG4dn4xlarge is a TrainingInstanceType enum value + TrainingInstanceTypeMlG4dn4xlarge = "ml.g4dn.4xlarge" + + // TrainingInstanceTypeMlG4dn8xlarge is a TrainingInstanceType enum value + TrainingInstanceTypeMlG4dn8xlarge = "ml.g4dn.8xlarge" + + // TrainingInstanceTypeMlG4dn12xlarge is a TrainingInstanceType enum value + TrainingInstanceTypeMlG4dn12xlarge = "ml.g4dn.12xlarge" + + // TrainingInstanceTypeMlG4dn16xlarge is a TrainingInstanceType enum value + TrainingInstanceTypeMlG4dn16xlarge = "ml.g4dn.16xlarge" + // TrainingInstanceTypeMlM5Large is a TrainingInstanceType enum value TrainingInstanceTypeMlM5Large = "ml.m5.large" @@ -27209,3 +47713,47 @@ const ( // TransformJobStatusStopped is a TransformJobStatus enum value TransformJobStatusStopped = "Stopped" ) + +const ( + // TrialComponentPrimaryStatusInProgress is a TrialComponentPrimaryStatus enum value + TrialComponentPrimaryStatusInProgress = "InProgress" + + // TrialComponentPrimaryStatusCompleted is a TrialComponentPrimaryStatus enum value + TrialComponentPrimaryStatusCompleted = "Completed" + + // TrialComponentPrimaryStatusFailed is a TrialComponentPrimaryStatus enum value + TrialComponentPrimaryStatusFailed = "Failed" +) + +const ( + // UserProfileSortKeyCreationTime is a UserProfileSortKey enum value + UserProfileSortKeyCreationTime = "CreationTime" + + // UserProfileSortKeyLastModifiedTime is a UserProfileSortKey enum value + UserProfileSortKeyLastModifiedTime = "LastModifiedTime" +) + +const ( + // UserProfileStatusDeleting is a UserProfileStatus enum value + UserProfileStatusDeleting = "Deleting" + + // UserProfileStatusFailed is a UserProfileStatus enum value + UserProfileStatusFailed = "Failed" + + // UserProfileStatusInService is a UserProfileStatus enum value + UserProfileStatusInService = "InService" + + // UserProfileStatusPending is a UserProfileStatus enum value + UserProfileStatusPending = "Pending" +) + +const ( + // VariantPropertyTypeDesiredInstanceCount is a VariantPropertyType enum value + VariantPropertyTypeDesiredInstanceCount = "DesiredInstanceCount" + + // VariantPropertyTypeDesiredWeight is a VariantPropertyType enum value + VariantPropertyTypeDesiredWeight = "DesiredWeight" + + // VariantPropertyTypeDataCaptureConfig is a VariantPropertyType enum value + VariantPropertyTypeDataCaptureConfig = "DataCaptureConfig" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/sagemaker/errors.go b/vendor/github.com/aws/aws-sdk-go/service/sagemaker/errors.go index d7fd2c45754..c201ba6a4ce 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sagemaker/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sagemaker/errors.go @@ -2,8 +2,19 @@ package sagemaker +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( + // ErrCodeConflictException for service response error code + // "ConflictException". + // + // There was a conflict when you attempted to modify an experiment, trial, or + // trial component. + ErrCodeConflictException = "ConflictException" + // ErrCodeResourceInUse for service response error code // "ResourceInUse". // @@ -23,3 +34,10 @@ const ( // Resource being access is not found. ErrCodeResourceNotFound = "ResourceNotFound" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ConflictException": newErrorConflictException, + "ResourceInUse": newErrorResourceInUse, + "ResourceLimitExceeded": newErrorResourceLimitExceeded, + "ResourceNotFound": newErrorResourceNotFound, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sagemaker/service.go b/vendor/github.com/aws/aws-sdk-go/service/sagemaker/service.go index 7ae1df73414..b2b649cfb5a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sagemaker/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sagemaker/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "sagemaker" // Name of service. EndpointsID = "api.sagemaker" // ID to lookup a service endpoint with. - ServiceID = "SageMaker" // ServiceID is a unique identifer of a specific service. + ServiceID = "SageMaker" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the SageMaker client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a SageMaker client from just a session. // svc := sagemaker.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *SageMaker { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "sagemaker" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *SageMaker { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *SageMaker { svc := &SageMaker{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-07-24", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/sagemaker/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/sagemaker/waiters.go index e4054f0ffaf..bf9de125973 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sagemaker/waiters.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sagemaker/waiters.go @@ -269,6 +269,67 @@ func (c *SageMaker) WaitUntilNotebookInstanceStoppedWithContext(ctx aws.Context, return w.WaitWithContext(ctx) } +// WaitUntilProcessingJobCompletedOrStopped uses the SageMaker API operation +// DescribeProcessingJob to wait for a condition to be met before returning. +// If the condition is not met within the max attempt window, an error will +// be returned. +func (c *SageMaker) WaitUntilProcessingJobCompletedOrStopped(input *DescribeProcessingJobInput) error { + return c.WaitUntilProcessingJobCompletedOrStoppedWithContext(aws.BackgroundContext(), input) +} + +// WaitUntilProcessingJobCompletedOrStoppedWithContext is an extended version of WaitUntilProcessingJobCompletedOrStopped. +// 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 *SageMaker) WaitUntilProcessingJobCompletedOrStoppedWithContext(ctx aws.Context, input *DescribeProcessingJobInput, opts ...request.WaiterOption) error { + w := request.Waiter{ + Name: "WaitUntilProcessingJobCompletedOrStopped", + MaxAttempts: 60, + Delay: request.ConstantWaiterDelay(60 * time.Second), + Acceptors: []request.WaiterAcceptor{ + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "ProcessingJobStatus", + Expected: "Completed", + }, + { + State: request.SuccessWaiterState, + Matcher: request.PathWaiterMatch, Argument: "ProcessingJobStatus", + Expected: "Stopped", + }, + { + State: request.FailureWaiterState, + Matcher: request.PathWaiterMatch, Argument: "ProcessingJobStatus", + Expected: "Failed", + }, + { + State: request.FailureWaiterState, + Matcher: request.ErrorWaiterMatch, + Expected: "ValidationException", + }, + }, + Logger: c.Config.Logger, + NewRequest: func(opts []request.Option) (*request.Request, error) { + var inCpy *DescribeProcessingJobInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeProcessingJobRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + w.ApplyOptions(opts...) + + return w.WaitWithContext(ctx) +} + // WaitUntilTrainingJobCompletedOrStopped uses the SageMaker API operation // DescribeTrainingJob to wait for a condition to be met before returning. // If the condition is not met within the max attempt window, an error will diff --git a/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/api.go b/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/api.go index b002302edc0..5362b3503f1 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/api.go @@ -107,17 +107,17 @@ func (c *SecretsManager) CancelRotateSecretRequest(input *CancelRotateSecretInpu // See the AWS API reference guide for AWS Secrets Manager's // API operation CancelRotateSecret for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // You provided an invalid value for a parameter. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // You provided a parameter value that is not valid for the current state of // the resource. // @@ -276,11 +276,11 @@ func (c *SecretsManager) CreateSecretRequest(input *CreateSecretInput) (req *req // See the AWS API reference guide for AWS Secrets Manager's // API operation CreateSecret for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // You provided an invalid value for a parameter. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // You provided a parameter value that is not valid for the current state of // the resource. // @@ -293,29 +293,29 @@ func (c *SecretsManager) CreateSecretRequest(input *CreateSecretInput) (req *req // Lambda function ARN configured and you didn't include such an ARN as a // parameter in this call. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request failed because it would exceed one of the Secrets Manager internal // limits. // -// * ErrCodeEncryptionFailure "EncryptionFailure" +// * EncryptionFailure // Secrets Manager can't encrypt the protected secret text using the provided // KMS key. Check that the customer master key (CMK) is available, enabled, // and not in an invalid state. For more information, see How Key State Affects // Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html). // -// * ErrCodeResourceExistsException "ResourceExistsException" +// * ResourceExistsException // A resource with the ID you requested already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocumentException" +// * MalformedPolicyDocumentException // The policy document that you provided isn't valid. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" +// * PreconditionNotMetException // The request failed because you did not complete all the prerequisite steps. // // See also, https://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/CreateSecret @@ -408,14 +408,14 @@ func (c *SecretsManager) DeleteResourcePolicyRequest(input *DeleteResourcePolicy // See the AWS API reference guide for AWS Secrets Manager's // API operation DeleteResourcePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // You provided a parameter value that is not valid for the current state of // the resource. // @@ -538,14 +538,14 @@ func (c *SecretsManager) DeleteSecretRequest(input *DeleteSecretInput) (req *req // See the AWS API reference guide for AWS Secrets Manager's // API operation DeleteSecret for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // You provided an invalid value for a parameter. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // You provided a parameter value that is not valid for the current state of // the resource. // @@ -558,7 +558,7 @@ func (c *SecretsManager) DeleteSecretRequest(input *DeleteSecretInput) (req *req // Lambda function ARN configured and you didn't include such an ARN as a // parameter in this call. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/DeleteSecret @@ -654,11 +654,11 @@ func (c *SecretsManager) DescribeSecretRequest(input *DescribeSecretInput) (req // See the AWS API reference guide for AWS Secrets Manager's // API operation DescribeSecret for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/DescribeSecret @@ -745,11 +745,11 @@ func (c *SecretsManager) GetRandomPasswordRequest(input *GetRandomPasswordInput) // See the AWS API reference guide for AWS Secrets Manager's // API operation GetRandomPassword for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // You provided an invalid value for a parameter. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // You provided a parameter value that is not valid for the current state of // the resource. // @@ -762,7 +762,7 @@ func (c *SecretsManager) GetRandomPasswordRequest(input *GetRandomPasswordInput) // Lambda function ARN configured and you didn't include such an ARN as a // parameter in this call. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/GetRandomPassword @@ -858,14 +858,14 @@ func (c *SecretsManager) GetResourcePolicyRequest(input *GetResourcePolicyInput) // See the AWS API reference guide for AWS Secrets Manager's // API operation GetResourcePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // You provided a parameter value that is not valid for the current state of // the resource. // @@ -971,14 +971,14 @@ func (c *SecretsManager) GetSecretValueRequest(input *GetSecretValueInput) (req // See the AWS API reference guide for AWS Secrets Manager's // API operation GetSecretValue for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // You provided an invalid value for a parameter. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // You provided a parameter value that is not valid for the current state of // the resource. // @@ -991,11 +991,11 @@ func (c *SecretsManager) GetSecretValueRequest(input *GetSecretValueInput) (req // Lambda function ARN configured and you didn't include such an ARN as a // parameter in this call. // -// * ErrCodeDecryptionFailure "DecryptionFailure" +// * DecryptionFailure // Secrets Manager can't decrypt the protected secret text using the provided // KMS key. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/GetSecretValue @@ -1098,14 +1098,14 @@ func (c *SecretsManager) ListSecretVersionIdsRequest(input *ListSecretVersionIds // See the AWS API reference guide for AWS Secrets Manager's // API operation ListSecretVersionIds for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// Returned Error Types: +// * InvalidNextTokenException // You provided an invalid NextToken value. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/ListSecretVersionIds @@ -1173,10 +1173,12 @@ func (c *SecretsManager) ListSecretVersionIdsPagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSecretVersionIdsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListSecretVersionIdsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1258,14 +1260,14 @@ func (c *SecretsManager) ListSecretsRequest(input *ListSecretsInput) (req *reque // See the AWS API reference guide for AWS Secrets Manager's // API operation ListSecrets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // You provided an invalid value for a parameter. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // You provided an invalid NextToken value. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/ListSecrets @@ -1333,10 +1335,12 @@ func (c *SecretsManager) ListSecretsPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSecretsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListSecretsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1418,20 +1422,20 @@ func (c *SecretsManager) PutResourcePolicyRequest(input *PutResourcePolicyInput) // See the AWS API reference guide for AWS Secrets Manager's // API operation PutResourcePolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocumentException" +// Returned Error Types: +// * MalformedPolicyDocumentException // The policy document that you provided isn't valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // You provided an invalid value for a parameter. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // You provided a parameter value that is not valid for the current state of // the resource. // @@ -1588,11 +1592,11 @@ func (c *SecretsManager) PutSecretValueRequest(input *PutSecretValueInput) (req // See the AWS API reference guide for AWS Secrets Manager's // API operation PutSecretValue for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // You provided an invalid value for a parameter. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // You provided a parameter value that is not valid for the current state of // the resource. // @@ -1605,23 +1609,23 @@ func (c *SecretsManager) PutSecretValueRequest(input *PutSecretValueInput) (req // Lambda function ARN configured and you didn't include such an ARN as a // parameter in this call. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request failed because it would exceed one of the Secrets Manager internal // limits. // -// * ErrCodeEncryptionFailure "EncryptionFailure" +// * EncryptionFailure // Secrets Manager can't encrypt the protected secret text using the provided // KMS key. Check that the customer master key (CMK) is available, enabled, // and not in an invalid state. For more information, see How Key State Affects // Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html). // -// * ErrCodeResourceExistsException "ResourceExistsException" +// * ResourceExistsException // A resource with the ID you requested already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/PutSecretValue @@ -1710,14 +1714,14 @@ func (c *SecretsManager) RestoreSecretRequest(input *RestoreSecretInput) (req *r // See the AWS API reference guide for AWS Secrets Manager's // API operation RestoreSecret for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // You provided an invalid value for a parameter. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // You provided a parameter value that is not valid for the current state of // the resource. // @@ -1730,7 +1734,7 @@ func (c *SecretsManager) RestoreSecretRequest(input *RestoreSecretInput) (req *r // Lambda function ARN configured and you didn't include such an ARN as a // parameter in this call. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/RestoreSecret @@ -1863,17 +1867,17 @@ func (c *SecretsManager) RotateSecretRequest(input *RotateSecretInput) (req *req // See the AWS API reference guide for AWS Secrets Manager's // API operation RotateSecret for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // You provided an invalid value for a parameter. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // You provided a parameter value that is not valid for the current state of // the resource. // @@ -2004,11 +2008,11 @@ func (c *SecretsManager) TagResourceRequest(input *TagResourceInput) (req *reque // See the AWS API reference guide for AWS Secrets Manager's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // You provided a parameter value that is not valid for the current state of // the resource. // @@ -2021,10 +2025,10 @@ func (c *SecretsManager) TagResourceRequest(input *TagResourceInput) (req *reque // Lambda function ARN configured and you didn't include such an ARN as a // parameter in this call. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // You provided an invalid value for a parameter. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/TagResource @@ -2124,11 +2128,11 @@ func (c *SecretsManager) UntagResourceRequest(input *UntagResourceInput) (req *r // See the AWS API reference guide for AWS Secrets Manager's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // You provided a parameter value that is not valid for the current state of // the resource. // @@ -2141,10 +2145,10 @@ func (c *SecretsManager) UntagResourceRequest(input *UntagResourceInput) (req *r // Lambda function ARN configured and you didn't include such an ARN as a // parameter in this call. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // You provided an invalid value for a parameter. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/UntagResource @@ -2285,11 +2289,11 @@ func (c *SecretsManager) UpdateSecretRequest(input *UpdateSecretInput) (req *req // See the AWS API reference guide for AWS Secrets Manager's // API operation UpdateSecret for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterException "InvalidParameterException" +// Returned Error Types: +// * InvalidParameterException // You provided an invalid value for a parameter. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // You provided a parameter value that is not valid for the current state of // the resource. // @@ -2302,29 +2306,29 @@ func (c *SecretsManager) UpdateSecretRequest(input *UpdateSecretInput) (req *req // Lambda function ARN configured and you didn't include such an ARN as a // parameter in this call. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request failed because it would exceed one of the Secrets Manager internal // limits. // -// * ErrCodeEncryptionFailure "EncryptionFailure" +// * EncryptionFailure // Secrets Manager can't encrypt the protected secret text using the provided // KMS key. Check that the customer master key (CMK) is available, enabled, // and not in an invalid state. For more information, see How Key State Affects // Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html). // -// * ErrCodeResourceExistsException "ResourceExistsException" +// * ResourceExistsException // A resource with the ID you requested already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeMalformedPolicyDocumentException "MalformedPolicyDocumentException" +// * MalformedPolicyDocumentException // The policy document that you provided isn't valid. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // -// * ErrCodePreconditionNotMetException "PreconditionNotMetException" +// * PreconditionNotMetException // The request failed because you did not complete all the prerequisite steps. // // See also, https://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/UpdateSecret @@ -2434,14 +2438,14 @@ func (c *SecretsManager) UpdateSecretVersionStageRequest(input *UpdateSecretVers // See the AWS API reference guide for AWS Secrets Manager's // API operation UpdateSecretVersionStage for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // We can't find the resource that you asked for. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // You provided an invalid value for a parameter. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // You provided a parameter value that is not valid for the current state of // the resource. // @@ -2454,11 +2458,11 @@ func (c *SecretsManager) UpdateSecretVersionStageRequest(input *UpdateSecretVers // Lambda function ARN configured and you didn't include such an ARN as a // parameter in this call. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request failed because it would exceed one of the Secrets Manager internal // limits. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/secretsmanager-2017-10-17/UpdateSecretVersionStage @@ -2867,6 +2871,63 @@ func (s *CreateSecretOutput) SetVersionId(v string) *CreateSecretOutput { return s } +// Secrets Manager can't decrypt the protected secret text using the provided +// KMS key. +type DecryptionFailure struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DecryptionFailure) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DecryptionFailure) GoString() string { + return s.String() +} + +func newErrorDecryptionFailure(v protocol.ResponseMetadata) error { + return &DecryptionFailure{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DecryptionFailure) Code() string { + return "DecryptionFailure" +} + +// Message returns the exception's message. +func (s DecryptionFailure) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DecryptionFailure) OrigErr() error { + return nil +} + +func (s DecryptionFailure) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DecryptionFailure) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DecryptionFailure) RequestID() string { + return s.respMetadata.RequestID +} + type DeleteResourcePolicyInput struct { _ struct{} `type:"structure"` @@ -3181,6 +3242,7 @@ type DescribeSecretOutput struct { // The user-provided friendly name of the secret. Name *string `min:"1" type:"string"` + // Returns the name of the service that created this secret. OwningService *string `min:"1" type:"string"` // Specifies whether automatic rotation is enabled for this secret. @@ -3304,6 +3366,65 @@ func (s *DescribeSecretOutput) SetVersionIdsToStages(v map[string][]*string) *De return s } +// Secrets Manager can't encrypt the protected secret text using the provided +// KMS key. Check that the customer master key (CMK) is available, enabled, +// and not in an invalid state. For more information, see How Key State Affects +// Use of a Customer Master Key (http://docs.aws.amazon.com/kms/latest/developerguide/key-state.html). +type EncryptionFailure struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s EncryptionFailure) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EncryptionFailure) GoString() string { + return s.String() +} + +func newErrorEncryptionFailure(v protocol.ResponseMetadata) error { + return &EncryptionFailure{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EncryptionFailure) Code() string { + return "EncryptionFailure" +} + +// Message returns the exception's message. +func (s EncryptionFailure) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EncryptionFailure) OrigErr() error { + return nil +} + +func (s EncryptionFailure) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EncryptionFailure) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EncryptionFailure) RequestID() string { + return s.respMetadata.RequestID +} + type GetRandomPasswordInput struct { _ struct{} `type:"structure"` @@ -3742,6 +3863,297 @@ func (s *GetSecretValueOutput) SetVersionStages(v []*string) *GetSecretValueOutp return s } +// An error occurred on the server side. +type InternalServiceError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalServiceError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServiceError) GoString() string { + return s.String() +} + +func newErrorInternalServiceError(v protocol.ResponseMetadata) error { + return &InternalServiceError{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServiceError) Code() string { + return "InternalServiceError" +} + +// Message returns the exception's message. +func (s InternalServiceError) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServiceError) OrigErr() error { + return nil +} + +func (s InternalServiceError) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServiceError) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServiceError) RequestID() string { + return s.respMetadata.RequestID +} + +// You provided an invalid NextToken value. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNextTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// You provided an invalid value for a parameter. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} + +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// You provided a parameter value that is not valid for the current state of +// the resource. +// +// Possible causes: +// +// * You tried to perform the operation on a secret that's currently marked +// deleted. +// +// * You tried to enable rotation on a secret that doesn't already have a +// Lambda function ARN configured and you didn't include such an ARN as a +// parameter in this call. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request failed because it would exceed one of the Secrets Manager internal +// limits. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListSecretVersionIdsInput struct { _ struct{} `type:"structure"` @@ -4003,6 +4415,118 @@ func (s *ListSecretsOutput) SetSecretList(v []*SecretListEntry) *ListSecretsOutp return s } +// The policy document that you provided isn't valid. +type MalformedPolicyDocumentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s MalformedPolicyDocumentException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MalformedPolicyDocumentException) GoString() string { + return s.String() +} + +func newErrorMalformedPolicyDocumentException(v protocol.ResponseMetadata) error { + return &MalformedPolicyDocumentException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MalformedPolicyDocumentException) Code() string { + return "MalformedPolicyDocumentException" +} + +// Message returns the exception's message. +func (s MalformedPolicyDocumentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MalformedPolicyDocumentException) OrigErr() error { + return nil +} + +func (s MalformedPolicyDocumentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MalformedPolicyDocumentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MalformedPolicyDocumentException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request failed because you did not complete all the prerequisite steps. +type PreconditionNotMetException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s PreconditionNotMetException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PreconditionNotMetException) GoString() string { + return s.String() +} + +func newErrorPreconditionNotMetException(v protocol.ResponseMetadata) error { + return &PreconditionNotMetException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PreconditionNotMetException) Code() string { + return "PreconditionNotMetException" +} + +// Message returns the exception's message. +func (s PreconditionNotMetException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PreconditionNotMetException) OrigErr() error { + return nil +} + +func (s PreconditionNotMetException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PreconditionNotMetException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PreconditionNotMetException) RequestID() string { + return s.respMetadata.RequestID +} + type PutResourcePolicyInput struct { _ struct{} `type:"structure"` @@ -4330,6 +4854,118 @@ func (s *PutSecretValueOutput) SetVersionStages(v []*string) *PutSecretValueOutp return s } +// A resource with the ID you requested already exists. +type ResourceExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceExistsException) GoString() string { + return s.String() +} + +func newErrorResourceExistsException(v protocol.ResponseMetadata) error { + return &ResourceExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceExistsException) Code() string { + return "ResourceExistsException" +} + +// Message returns the exception's message. +func (s ResourceExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceExistsException) OrigErr() error { + return nil +} + +func (s ResourceExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// We can't find the resource that you asked for. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + type RestoreSecretInput struct { _ struct{} `type:"structure"` @@ -4655,9 +5291,10 @@ type SecretListEntry struct { // in the folder prod. Name *string `min:"1" type:"string"` + // Returns the name of the service that created the secret. OwningService *string `min:"1" type:"string"` - // Indicated whether automatic, scheduled rotation is enabled for this secret. + // Indicates whether automatic, scheduled rotation is enabled for this secret. RotationEnabled *bool `type:"boolean"` // The ARN of an AWS Lambda function that's invoked by Secrets Manager to rotate diff --git a/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/errors.go b/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/errors.go index b3c0c48fdcc..df82716bb59 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/errors.go @@ -2,6 +2,10 @@ package secretsmanager +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeDecryptionFailure for service response error code @@ -85,3 +89,17 @@ const ( // We can't find the resource that you asked for. ErrCodeResourceNotFoundException = "ResourceNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "DecryptionFailure": newErrorDecryptionFailure, + "EncryptionFailure": newErrorEncryptionFailure, + "InternalServiceError": newErrorInternalServiceError, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "InvalidParameterException": newErrorInvalidParameterException, + "InvalidRequestException": newErrorInvalidRequestException, + "LimitExceededException": newErrorLimitExceededException, + "MalformedPolicyDocumentException": newErrorMalformedPolicyDocumentException, + "PreconditionNotMetException": newErrorPreconditionNotMetException, + "ResourceExistsException": newErrorResourceExistsException, + "ResourceNotFoundException": newErrorResourceNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/service.go b/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/service.go index c4758e96dac..abb0bee7ac5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/secretsmanager/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "secretsmanager" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Secrets Manager" // ServiceID is a unique identifer of a specific service. + ServiceID = "Secrets Manager" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the SecretsManager client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a SecretsManager client from just a session. // svc := secretsmanager.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *SecretsManager { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "secretsmanager" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *SecretsManager { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *SecretsManager { svc := &SecretsManager{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-10-17", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/securityhub/api.go b/vendor/github.com/aws/aws-sdk-go/service/securityhub/api.go index f402a069940..7f62ce48eba 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/securityhub/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/securityhub/api.go @@ -59,9 +59,10 @@ func (c *SecurityHub) AcceptInvitationRequest(input *AcceptInvitationInput) (req // AcceptInvitation API operation for AWS SecurityHub. // // Accepts the invitation to be a member account and be monitored by the Security -// Hub master account that the invitation was sent from. When the member account -// accepts the invitation, permission is granted to the master account to view -// findings generated in the member account. +// Hub master account that the invitation was sent from. +// +// When the member account accepts the invitation, permission is granted to +// the master account to view findings generated in the member 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 @@ -70,22 +71,22 @@ func (c *SecurityHub) AcceptInvitationRequest(input *AcceptInvitationInput) (req // See the AWS API reference guide for AWS SecurityHub's // API operation AcceptInvitation for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/AcceptInvitation @@ -155,7 +156,9 @@ func (c *SecurityHub) BatchDisableStandardsRequest(input *BatchDisableStandardsI // BatchDisableStandards API operation for AWS SecurityHub. // // Disables the standards specified by the provided StandardsSubscriptionArns. -// For more information, see Standards Supported in AWS Security Hub (https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards.html). +// +// For more information, see Security Standards (https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards.html) +// section of the AWS Security Hub User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -164,18 +167,18 @@ func (c *SecurityHub) BatchDisableStandardsRequest(input *BatchDisableStandardsI // See the AWS API reference guide for AWS SecurityHub's // API operation BatchDisableStandards for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // @@ -245,9 +248,11 @@ func (c *SecurityHub) BatchEnableStandardsRequest(input *BatchEnableStandardsInp // BatchEnableStandards API operation for AWS SecurityHub. // -// Enables the standards specified by the provided standardsArn. In this release, -// only CIS AWS Foundations standards are supported. For more information, see -// Standards Supported in AWS Security Hub (https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards.html). +// Enables the standards specified by the provided StandardsArn. To obtain the +// ARN for a standard, use the DescribeStandards operation. +// +// For more information, see the Security Standards (https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-standards.html) +// section of the AWS Security Hub User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -256,18 +261,18 @@ func (c *SecurityHub) BatchEnableStandardsRequest(input *BatchEnableStandardsInp // See the AWS API reference guide for AWS SecurityHub's // API operation BatchEnableStandards for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // @@ -339,8 +344,10 @@ func (c *SecurityHub) BatchImportFindingsRequest(input *BatchImportFindingsInput // // Imports security findings generated from an integrated third-party product // into Security Hub. This action is requested by the integrated product to -// import its findings into Security Hub. The maximum allowed size for a finding -// is 240 Kb. An error is returned for any finding larger than 240 Kb. +// import its findings into Security Hub. +// +// The maximum allowed size for a finding is 240 Kb. An error is returned for +// any finding larger than 240 Kb. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -349,19 +356,19 @@ func (c *SecurityHub) BatchImportFindingsRequest(input *BatchImportFindingsInput // See the AWS API reference guide for AWS SecurityHub's // API operation BatchImportFindings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/BatchImportFindings @@ -430,9 +437,10 @@ func (c *SecurityHub) CreateActionTargetRequest(input *CreateActionTargetInput) // CreateActionTarget API operation for AWS SecurityHub. // -// Creates a custom action target in Security Hub. You can use custom actions -// on findings and insights in Security Hub to trigger target actions in Amazon -// CloudWatch Events. +// Creates a custom action target in Security Hub. +// +// You can use custom actions on findings and insights in Security Hub to trigger +// target actions in Amazon CloudWatch Events. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -441,22 +449,22 @@ func (c *SecurityHub) CreateActionTargetRequest(input *CreateActionTargetInput) // See the AWS API reference guide for AWS SecurityHub's // API operation CreateActionTarget for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // The resource specified in the request conflicts with an existing resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/CreateActionTarget @@ -527,7 +535,8 @@ func (c *SecurityHub) CreateInsightRequest(input *CreateInsightInput) (req *requ // // Creates a custom insight in Security Hub. An insight is a consolidation of // findings that relate to a security issue that requires attention or remediation. -// Use the GroupByAttribute to group the related findings in the insight. +// +// To group the related findings in the insight, use the GroupByAttribute. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -536,22 +545,22 @@ func (c *SecurityHub) CreateInsightRequest(input *CreateInsightInput) (req *requ // See the AWS API reference guide for AWS SecurityHub's // API operation CreateInsight for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // The resource specified in the request conflicts with an existing resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/CreateInsight @@ -623,20 +632,21 @@ func (c *SecurityHub) CreateMembersRequest(input *CreateMembersInput) (req *requ // Creates a member association in Security Hub between the specified accounts // and the account used to make the request, which is the master account. To // successfully create a member, you must use this action from an account that -// already has Security Hub enabled. You can use the EnableSecurityHub to enable -// Security Hub. +// already has Security Hub enabled. To enable Security Hub, you can use the +// EnableSecurityHub operation. // // After you use CreateMembers to create member account associations in Security -// Hub, you need to use the InviteMembers action, which invites the accounts -// to enable Security Hub and become member accounts in Security Hub. If the -// invitation is accepted by the account owner, the account becomes a member +// Hub, you must use the InviteMembers operation to invite the accounts to enable +// Security Hub and become member accounts in Security Hub. +// +// If the account owner accepts the invitation, the account becomes a member // account in Security Hub, and a permission policy is added that permits the // master account to view the findings generated in the member account. When -// Security Hub is enabled in the invited account, findings start being sent +// Security Hub is enabled in the invited account, findings start to be sent // to both the member and master accounts. // -// You can remove the association between the master and member accounts by -// using the DisassociateFromMasterAccount or DisassociateMembers operation. +// To remove the association between the master and member accounts, use the +// DisassociateFromMasterAccount or DisassociateMembers 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 @@ -645,22 +655,22 @@ func (c *SecurityHub) CreateMembersRequest(input *CreateMembersInput) (req *requ // See the AWS API reference guide for AWS SecurityHub's // API operation CreateMembers for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // The resource specified in the request conflicts with an existing resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/CreateMembers @@ -738,18 +748,18 @@ func (c *SecurityHub) DeclineInvitationsRequest(input *DeclineInvitationsInput) // See the AWS API reference guide for AWS SecurityHub's // API operation DeclineInvitations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/DeclineInvitations @@ -818,9 +828,10 @@ func (c *SecurityHub) DeleteActionTargetRequest(input *DeleteActionTargetInput) // DeleteActionTarget API operation for AWS SecurityHub. // -// Deletes a custom action target from Security Hub. Deleting a custom action -// target doesn't affect any findings or insights that were already sent to -// Amazon CloudWatch Events using the custom action. +// Deletes a custom action target from Security Hub. +// +// Deleting a custom action target does not affect any findings or insights +// that were already sent to Amazon CloudWatch Events using the custom 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 @@ -829,18 +840,18 @@ func (c *SecurityHub) DeleteActionTargetRequest(input *DeleteActionTargetInput) // See the AWS API reference guide for AWS SecurityHub's // API operation DeleteActionTarget for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/DeleteActionTarget @@ -918,22 +929,22 @@ func (c *SecurityHub) DeleteInsightRequest(input *DeleteInsightInput) (req *requ // See the AWS API reference guide for AWS SecurityHub's // API operation DeleteInsight for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/DeleteInsight @@ -1011,22 +1022,22 @@ func (c *SecurityHub) DeleteInvitationsRequest(input *DeleteInvitationsInput) (r // See the AWS API reference guide for AWS SecurityHub's // API operation DeleteInvitations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/DeleteInvitations @@ -1104,22 +1115,22 @@ func (c *SecurityHub) DeleteMembersRequest(input *DeleteMembersInput) (req *requ // See the AWS API reference guide for AWS SecurityHub's // API operation DeleteMembers for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/DeleteMembers @@ -1203,18 +1214,18 @@ func (c *SecurityHub) DescribeActionTargetsRequest(input *DescribeActionTargetsI // See the AWS API reference guide for AWS SecurityHub's // API operation DescribeActionTargets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/DescribeActionTargets @@ -1282,10 +1293,12 @@ func (c *SecurityHub) DescribeActionTargetsPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeActionTargetsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeActionTargetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1343,22 +1356,22 @@ func (c *SecurityHub) DescribeHubRequest(input *DescribeHubInput) (req *request. // See the AWS API reference guide for AWS SecurityHub's // API operation DescribeHub for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/DescribeHub @@ -1433,8 +1446,8 @@ func (c *SecurityHub) DescribeProductsRequest(input *DescribeProductsInput) (req // DescribeProducts API operation for AWS SecurityHub. // -// Returns information about the products available that you can subscribe to -// and integrate with Security Hub to consolidate findings. +// Returns information about the available products that you can subscribe to +// and integrate with Security Hub in order to consolidate 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 @@ -1443,18 +1456,18 @@ func (c *SecurityHub) DescribeProductsRequest(input *DescribeProductsInput) (req // See the AWS API reference guide for AWS SecurityHub's // API operation DescribeProducts for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // @@ -1523,10 +1536,309 @@ func (c *SecurityHub) DescribeProductsPagesWithContext(ctx aws.Context, input *D }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeProductsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeProductsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeStandards = "DescribeStandards" + +// DescribeStandardsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeStandards operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeStandards for more information on using the DescribeStandards +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeStandardsRequest method. +// req, resp := client.DescribeStandardsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/DescribeStandards +func (c *SecurityHub) DescribeStandardsRequest(input *DescribeStandardsInput) (req *request.Request, output *DescribeStandardsOutput) { + op := &request.Operation{ + Name: opDescribeStandards, + HTTPMethod: "GET", + HTTPPath: "/standards", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeStandardsInput{} + } + + output = &DescribeStandardsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeStandards API operation for AWS SecurityHub. +// +// Returns a list of the available standards in Security Hub. +// +// For each standard, the results include the standard ARN, the name, and a +// description. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS SecurityHub's +// API operation DescribeStandards for usage and error information. +// +// Returned Error Types: +// * InternalException +// Internal server error. +// +// * InvalidInputException +// The request was rejected because you supplied an invalid or out-of-range +// value for an input parameter. +// +// * InvalidAccessException +// AWS Security Hub isn't enabled for the account used to make this request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/DescribeStandards +func (c *SecurityHub) DescribeStandards(input *DescribeStandardsInput) (*DescribeStandardsOutput, error) { + req, out := c.DescribeStandardsRequest(input) + return out, req.Send() +} + +// DescribeStandardsWithContext is the same as DescribeStandards with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeStandards for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SecurityHub) DescribeStandardsWithContext(ctx aws.Context, input *DescribeStandardsInput, opts ...request.Option) (*DescribeStandardsOutput, error) { + req, out := c.DescribeStandardsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeStandardsPages iterates over the pages of a DescribeStandards operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeStandards 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 DescribeStandards operation. +// pageNum := 0 +// err := client.DescribeStandardsPages(params, +// func(page *securityhub.DescribeStandardsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SecurityHub) DescribeStandardsPages(input *DescribeStandardsInput, fn func(*DescribeStandardsOutput, bool) bool) error { + return c.DescribeStandardsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeStandardsPagesWithContext same as DescribeStandardsPages 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 *SecurityHub) DescribeStandardsPagesWithContext(ctx aws.Context, input *DescribeStandardsInput, fn func(*DescribeStandardsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeStandardsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStandardsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeStandardsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opDescribeStandardsControls = "DescribeStandardsControls" + +// DescribeStandardsControlsRequest generates a "aws/request.Request" representing the +// client's request for the DescribeStandardsControls operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeStandardsControls for more information on using the DescribeStandardsControls +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeStandardsControlsRequest method. +// req, resp := client.DescribeStandardsControlsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/DescribeStandardsControls +func (c *SecurityHub) DescribeStandardsControlsRequest(input *DescribeStandardsControlsInput) (req *request.Request, output *DescribeStandardsControlsOutput) { + op := &request.Operation{ + Name: opDescribeStandardsControls, + HTTPMethod: "GET", + HTTPPath: "/standards/controls/{StandardsSubscriptionArn+}", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &DescribeStandardsControlsInput{} + } + + output = &DescribeStandardsControlsOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeStandardsControls API operation for AWS SecurityHub. +// +// Returns a list of security standards controls. +// +// For each control, the results include information about whether it is currently +// enabled, the severity, and a link to remediation 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 SecurityHub's +// API operation DescribeStandardsControls for usage and error information. +// +// Returned Error Types: +// * InternalException +// Internal server error. +// +// * InvalidInputException +// The request was rejected because you supplied an invalid or out-of-range +// value for an input parameter. +// +// * InvalidAccessException +// AWS Security Hub isn't enabled for the account used to make this request. +// +// * ResourceNotFoundException +// The request was rejected because we can't find the specified resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/DescribeStandardsControls +func (c *SecurityHub) DescribeStandardsControls(input *DescribeStandardsControlsInput) (*DescribeStandardsControlsOutput, error) { + req, out := c.DescribeStandardsControlsRequest(input) + return out, req.Send() +} + +// DescribeStandardsControlsWithContext is the same as DescribeStandardsControls with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeStandardsControls for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SecurityHub) DescribeStandardsControlsWithContext(ctx aws.Context, input *DescribeStandardsControlsInput, opts ...request.Option) (*DescribeStandardsControlsOutput, error) { + req, out := c.DescribeStandardsControlsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// DescribeStandardsControlsPages iterates over the pages of a DescribeStandardsControls operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See DescribeStandardsControls 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 DescribeStandardsControls operation. +// pageNum := 0 +// err := client.DescribeStandardsControlsPages(params, +// func(page *securityhub.DescribeStandardsControlsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SecurityHub) DescribeStandardsControlsPages(input *DescribeStandardsControlsInput, fn func(*DescribeStandardsControlsOutput, bool) bool) error { + return c.DescribeStandardsControlsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// DescribeStandardsControlsPagesWithContext same as DescribeStandardsControlsPages 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 *SecurityHub) DescribeStandardsControlsPagesWithContext(ctx aws.Context, input *DescribeStandardsControlsInput, fn func(*DescribeStandardsControlsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *DescribeStandardsControlsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.DescribeStandardsControlsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*DescribeStandardsControlsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1575,9 +1887,9 @@ func (c *SecurityHub) DisableImportFindingsForProductRequest(input *DisableImpor // DisableImportFindingsForProduct API operation for AWS SecurityHub. // -// Disables the integration of the specified product with Security Hub. Findings -// from that product are no longer sent to Security Hub after the integration -// is disabled. +// Disables the integration of the specified product with Security Hub. After +// the integration is disabled, findings from that product are no longer sent +// to Security Hub. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1586,21 +1898,21 @@ func (c *SecurityHub) DisableImportFindingsForProductRequest(input *DisableImpor // See the AWS API reference guide for AWS SecurityHub's // API operation DisableImportFindingsForProduct for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // @@ -1673,14 +1985,18 @@ func (c *SecurityHub) DisableSecurityHubRequest(input *DisableSecurityHubInput) // // Disables Security Hub in your account only in the current Region. To disable // Security Hub in all Regions, you must submit one request per Region where -// you have enabled Security Hub. When you disable Security Hub for a master -// account, it doesn't disable Security Hub for any associated member accounts. +// you have enabled Security Hub. +// +// When you disable Security Hub for a master account, it doesn't disable Security +// Hub for any associated member accounts. // // When you disable Security Hub, your existing findings and insights and any -// Security Hub configuration settings are deleted after 90 days and can't be -// recovered. Any standards that were enabled are disabled, and your master -// and member account associations are removed. If you want to save your existing -// findings, you must export them before you disable Security Hub. +// Security Hub configuration settings are deleted after 90 days and cannot +// be recovered. Any standards that were enabled are disabled, and your master +// and member account associations are removed. +// +// If you want to save your existing findings, you must export them before you +// disable Security Hub. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1689,18 +2005,18 @@ func (c *SecurityHub) DisableSecurityHubRequest(input *DisableSecurityHubInput) // See the AWS API reference guide for AWS SecurityHub's // API operation DisableSecurityHub for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/DisableSecurityHub @@ -1780,22 +2096,22 @@ func (c *SecurityHub) DisassociateFromMasterAccountRequest(input *DisassociateFr // See the AWS API reference guide for AWS SecurityHub's // API operation DisassociateFromMasterAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/DisassociateFromMasterAccount @@ -1874,22 +2190,22 @@ func (c *SecurityHub) DisassociateMembersRequest(input *DisassociateMembersInput // See the AWS API reference guide for AWS SecurityHub's // API operation DisassociateMembers for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/DisassociateMembers @@ -1959,9 +2275,10 @@ func (c *SecurityHub) EnableImportFindingsForProductRequest(input *EnableImportF // EnableImportFindingsForProduct API operation for AWS SecurityHub. // // Enables the integration of a partner product with Security Hub. Integrated -// products send findings to Security Hub. When you enable a product integration, -// a permission policy that grants permission for the product to send findings -// to Security Hub is applied. +// products send findings to Security Hub. +// +// When you enable a product integration, a permission policy that grants permission +// for the product to send findings to Security Hub is applied. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1970,21 +2287,21 @@ func (c *SecurityHub) EnableImportFindingsForProductRequest(input *EnableImportF // See the AWS API reference guide for AWS SecurityHub's // API operation EnableImportFindingsForProduct for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // The resource specified in the request conflicts with an existing resource. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // @@ -2056,10 +2373,20 @@ func (c *SecurityHub) EnableSecurityHubRequest(input *EnableSecurityHubInput) (r // EnableSecurityHub API operation for AWS SecurityHub. // // Enables Security Hub for your account in the current Region or the Region -// you specify in the request. When you enable Security Hub, you grant to Security -// Hub the permissions necessary to gather findings from AWS Config, Amazon -// GuardDuty, Amazon Inspector, and Amazon Macie. To learn more, see Setting -// Up AWS Security Hub (https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-settingup.html). +// you specify in the request. +// +// When you enable Security Hub, you grant to Security Hub the permissions necessary +// to gather findings from AWS Config, Amazon GuardDuty, Amazon Inspector, and +// Amazon Macie. +// +// When you use the EnableSecurityHub operation to enable Security Hub, you +// also automatically enable the CIS AWS Foundations standard. You do not enable +// the Payment Card Industry Data Security Standard (PCI DSS) standard. To enable +// a standard, use the BatchEnableStandards operation. To disable a standard, +// use the BatchDisableStandards operation. +// +// To learn more, see Setting Up AWS Security Hub (https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-settingup.html) +// in the AWS Security Hub User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2068,21 +2395,21 @@ func (c *SecurityHub) EnableSecurityHubRequest(input *EnableSecurityHubInput) (r // See the AWS API reference guide for AWS SecurityHub's // API operation EnableSecurityHub for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeResourceConflictException "ResourceConflictException" +// * ResourceConflictException // The resource specified in the request conflicts with an existing resource. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You don't have permission to perform the action specified in the request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/EnableSecurityHub @@ -2138,6 +2465,12 @@ func (c *SecurityHub) GetEnabledStandardsRequest(input *GetEnabledStandardsInput Name: opGetEnabledStandards, HTTPMethod: "POST", HTTPPath: "/standards/get", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -2160,18 +2493,18 @@ func (c *SecurityHub) GetEnabledStandardsRequest(input *GetEnabledStandardsInput // See the AWS API reference guide for AWS SecurityHub's // API operation GetEnabledStandards for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // @@ -2197,21 +2530,73 @@ func (c *SecurityHub) GetEnabledStandardsWithContext(ctx aws.Context, input *Get return out, req.Send() } -const opGetFindings = "GetFindings" - -// GetFindingsRequest generates a "aws/request.Request" representing the -// client's request for the GetFindings operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. +// GetEnabledStandardsPages iterates over the pages of a GetEnabledStandards operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. // -// 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 GetEnabledStandards method for more information on how to use this operation. // -// See GetFindings for more information on using the GetFindings -// API call, and error handling. +// Note: This operation can generate multiple requests to a service. // -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// // Example iterating over at most 3 pages of a GetEnabledStandards operation. +// pageNum := 0 +// err := client.GetEnabledStandardsPages(params, +// func(page *securityhub.GetEnabledStandardsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SecurityHub) GetEnabledStandardsPages(input *GetEnabledStandardsInput, fn func(*GetEnabledStandardsOutput, bool) bool) error { + return c.GetEnabledStandardsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// GetEnabledStandardsPagesWithContext same as GetEnabledStandardsPages 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 *SecurityHub) GetEnabledStandardsPagesWithContext(ctx aws.Context, input *GetEnabledStandardsInput, fn func(*GetEnabledStandardsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *GetEnabledStandardsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.GetEnabledStandardsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*GetEnabledStandardsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opGetFindings = "GetFindings" + +// GetFindingsRequest generates a "aws/request.Request" representing the +// client's request for the GetFindings operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetFindings for more information on using the GetFindings +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. // // // // Example sending a request using the GetFindingsRequest method. @@ -2256,18 +2641,18 @@ func (c *SecurityHub) GetFindingsRequest(input *GetFindingsInput) (req *request. // See the AWS API reference guide for AWS SecurityHub's // API operation GetFindings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // @@ -2336,10 +2721,12 @@ func (c *SecurityHub) GetFindingsPagesWithContext(ctx aws.Context, input *GetFin }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetFindingsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetFindingsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2387,7 +2774,7 @@ func (c *SecurityHub) GetInsightResultsRequest(input *GetInsightResultsInput) (r // GetInsightResults API operation for AWS SecurityHub. // -// Lists the results of the Security Hub insight that the insight ARN specifies. +// Lists the results of the Security Hub insight specified by the insight 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 @@ -2396,22 +2783,22 @@ func (c *SecurityHub) GetInsightResultsRequest(input *GetInsightResultsInput) (r // See the AWS API reference guide for AWS SecurityHub's // API operation GetInsightResults for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/GetInsightResults @@ -2486,7 +2873,7 @@ func (c *SecurityHub) GetInsightsRequest(input *GetInsightsInput) (req *request. // GetInsights API operation for AWS SecurityHub. // -// Lists and describes insights that insight ARNs specify. +// Lists and describes insights for the specified insight ARNs. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2495,22 +2882,22 @@ func (c *SecurityHub) GetInsightsRequest(input *GetInsightsInput) (req *request. // See the AWS API reference guide for AWS SecurityHub's // API operation GetInsights for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/GetInsights @@ -2578,10 +2965,12 @@ func (c *SecurityHub) GetInsightsPagesWithContext(ctx aws.Context, input *GetIns }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetInsightsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetInsightsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2639,18 +3028,18 @@ func (c *SecurityHub) GetInvitationsCountRequest(input *GetInvitationsCountInput // See the AWS API reference guide for AWS SecurityHub's // API operation GetInvitationsCount for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // @@ -2720,8 +3109,8 @@ func (c *SecurityHub) GetMasterAccountRequest(input *GetMasterAccountInput) (req // GetMasterAccount API operation for AWS SecurityHub. // -// Provides the details for the Security Hub master account to the current member -// account. +// Provides the details for the Security Hub master account for the current +// member 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 @@ -2730,22 +3119,22 @@ func (c *SecurityHub) GetMasterAccountRequest(input *GetMasterAccountInput) (req // See the AWS API reference guide for AWS SecurityHub's // API operation GetMasterAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/GetMasterAccount @@ -2814,8 +3203,8 @@ func (c *SecurityHub) GetMembersRequest(input *GetMembersInput) (req *request.Re // GetMembers API operation for AWS SecurityHub. // -// Returns the details on the Security Hub member accounts that the account -// IDs specify. +// Returns the details for the Security Hub member accounts for the specified +// account IDs. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -2824,22 +3213,22 @@ func (c *SecurityHub) GetMembersRequest(input *GetMembersInput) (req *request.Re // See the AWS API reference guide for AWS SecurityHub's // API operation GetMembers for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/GetMembers @@ -2909,11 +3298,14 @@ func (c *SecurityHub) InviteMembersRequest(input *InviteMembersInput) (req *requ // InviteMembers API operation for AWS SecurityHub. // // Invites other AWS accounts to become member accounts for the Security Hub -// master account that the invitation is sent from. Before you can use this -// action to invite a member, you must first create the member account in Security -// Hub by using the CreateMembers action. When the account owner accepts the -// invitation to become a member account and enables Security Hub, the master -// account can view the findings generated from member account. +// master account that the invitation is sent from. +// +// Before you can use this action to invite a member, you must first use the +// CreateMembers action to create the member account in Security Hub. +// +// When the account owner accepts the invitation to become a member account +// and enables Security Hub, the master account can view the findings generated +// from the member 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 @@ -2922,22 +3314,22 @@ func (c *SecurityHub) InviteMembersRequest(input *InviteMembersInput) (req *requ // See the AWS API reference guide for AWS SecurityHub's // API operation InviteMembers for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/InviteMembers @@ -3012,8 +3404,8 @@ func (c *SecurityHub) ListEnabledProductsForImportRequest(input *ListEnabledProd // ListEnabledProductsForImport API operation for AWS SecurityHub. // -// Lists all findings-generating solutions (products) whose findings you have -// subscribed to receive in Security Hub. +// Lists all findings-generating solutions (products) that you are subscribed +// to receive findings from in Security Hub. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3022,15 +3414,15 @@ func (c *SecurityHub) ListEnabledProductsForImportRequest(input *ListEnabledProd // See the AWS API reference guide for AWS SecurityHub's // API operation ListEnabledProductsForImport for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/ListEnabledProductsForImport @@ -3098,10 +3490,12 @@ func (c *SecurityHub) ListEnabledProductsForImportPagesWithContext(ctx aws.Conte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEnabledProductsForImportOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListEnabledProductsForImportOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3136,6 +3530,12 @@ func (c *SecurityHub) ListInvitationsRequest(input *ListInvitationsInput) (req * Name: opListInvitations, HTTPMethod: "GET", HTTPPath: "/invitations", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -3159,18 +3559,18 @@ func (c *SecurityHub) ListInvitationsRequest(input *ListInvitationsInput) (req * // See the AWS API reference guide for AWS SecurityHub's // API operation ListInvitations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // @@ -3196,6 +3596,58 @@ func (c *SecurityHub) ListInvitationsWithContext(ctx aws.Context, input *ListInv return out, req.Send() } +// ListInvitationsPages iterates over the pages of a ListInvitations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListInvitations 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 ListInvitations operation. +// pageNum := 0 +// err := client.ListInvitationsPages(params, +// func(page *securityhub.ListInvitationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SecurityHub) ListInvitationsPages(input *ListInvitationsInput, fn func(*ListInvitationsOutput, bool) bool) error { + return c.ListInvitationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListInvitationsPagesWithContext same as ListInvitationsPages 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 *SecurityHub) ListInvitationsPagesWithContext(ctx aws.Context, input *ListInvitationsInput, fn func(*ListInvitationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListInvitationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListInvitationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListInvitationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opListMembers = "ListMembers" // ListMembersRequest generates a "aws/request.Request" representing the @@ -3227,6 +3679,12 @@ func (c *SecurityHub) ListMembersRequest(input *ListMembersInput) (req *request. Name: opListMembers, HTTPMethod: "GET", HTTPPath: "/members", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, } if input == nil { @@ -3250,18 +3708,18 @@ func (c *SecurityHub) ListMembersRequest(input *ListMembersInput) (req *request. // See the AWS API reference guide for AWS SecurityHub's // API operation ListMembers for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // @@ -3287,6 +3745,58 @@ func (c *SecurityHub) ListMembersWithContext(ctx aws.Context, input *ListMembers return out, req.Send() } +// ListMembersPages iterates over the pages of a ListMembers operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListMembers 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 ListMembers operation. +// pageNum := 0 +// err := client.ListMembersPages(params, +// func(page *securityhub.ListMembersOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *SecurityHub) ListMembersPages(input *ListMembersInput, fn func(*ListMembersOutput, bool) bool) error { + return c.ListMembersPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListMembersPagesWithContext same as ListMembersPages 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 *SecurityHub) ListMembersPagesWithContext(ctx aws.Context, input *ListMembersInput, fn func(*ListMembersOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListMembersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListMembersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListMembersOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opListTagsForResource = "ListTagsForResource" // ListTagsForResourceRequest generates a "aws/request.Request" representing the @@ -3340,15 +3850,15 @@ func (c *SecurityHub) ListTagsForResourceRequest(input *ListTagsForResourceInput // See the AWS API reference guide for AWS SecurityHub's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/ListTagsForResource @@ -3427,15 +3937,15 @@ func (c *SecurityHub) TagResourceRequest(input *TagResourceInput) (req *request. // See the AWS API reference guide for AWS SecurityHub's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/TagResource @@ -3514,15 +4024,15 @@ func (c *SecurityHub) UntagResourceRequest(input *UntagResourceInput) (req *requ // See the AWS API reference guide for AWS SecurityHub's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/UntagResource @@ -3601,21 +4111,21 @@ func (c *SecurityHub) UpdateActionTargetRequest(input *UpdateActionTargetInput) // See the AWS API reference guide for AWS SecurityHub's // API operation UpdateActionTarget for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/UpdateActionTarget @@ -3696,22 +4206,22 @@ func (c *SecurityHub) UpdateFindingsRequest(input *UpdateFindingsInput) (req *re // See the AWS API reference guide for AWS SecurityHub's // API operation UpdateFindings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/UpdateFindings @@ -3781,7 +4291,7 @@ func (c *SecurityHub) UpdateInsightRequest(input *UpdateInsightInput) (req *requ // UpdateInsight API operation for AWS SecurityHub. // -// Updates the Security Hub insight that the insight ARN specifies. +// Updates the Security Hub insight identified by the specified insight 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 @@ -3790,22 +4300,22 @@ func (c *SecurityHub) UpdateInsightRequest(input *UpdateInsightInput) (req *requ // See the AWS API reference guide for AWS SecurityHub's // API operation UpdateInsight for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalException "InternalException" +// Returned Error Types: +// * InternalException // Internal server error. // -// * ErrCodeInvalidInputException "InvalidInputException" +// * InvalidInputException // The request was rejected because you supplied an invalid or out-of-range // value for an input parameter. // -// * ErrCodeInvalidAccessException "InvalidAccessException" +// * InvalidAccessException // AWS Security Hub isn't enabled for the account used to make this request. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The request was rejected because it attempted to create resources beyond // the current AWS account limits. The error code describes the limit exceeded. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The request was rejected because we can't find the specified resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/UpdateInsight @@ -3830,6 +4340,97 @@ func (c *SecurityHub) UpdateInsightWithContext(ctx aws.Context, input *UpdateIns return out, req.Send() } +const opUpdateStandardsControl = "UpdateStandardsControl" + +// UpdateStandardsControlRequest generates a "aws/request.Request" representing the +// client's request for the UpdateStandardsControl operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateStandardsControl for more information on using the UpdateStandardsControl +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateStandardsControlRequest method. +// req, resp := client.UpdateStandardsControlRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/UpdateStandardsControl +func (c *SecurityHub) UpdateStandardsControlRequest(input *UpdateStandardsControlInput) (req *request.Request, output *UpdateStandardsControlOutput) { + op := &request.Operation{ + Name: opUpdateStandardsControl, + HTTPMethod: "PATCH", + HTTPPath: "/standards/control/{StandardsControlArn+}", + } + + if input == nil { + input = &UpdateStandardsControlInput{} + } + + output = &UpdateStandardsControlOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(restjson.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateStandardsControl API operation for AWS SecurityHub. +// +// Used to control whether an individual security standard control is enabled +// or disabled. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS SecurityHub's +// API operation UpdateStandardsControl for usage and error information. +// +// Returned Error Types: +// * InternalException +// Internal server error. +// +// * InvalidInputException +// The request was rejected because you supplied an invalid or out-of-range +// value for an input parameter. +// +// * InvalidAccessException +// AWS Security Hub isn't enabled for the account used to make this request. +// +// * ResourceNotFoundException +// The request was rejected because we can't find the specified resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26/UpdateStandardsControl +func (c *SecurityHub) UpdateStandardsControl(input *UpdateStandardsControlInput) (*UpdateStandardsControlOutput, error) { + req, out := c.UpdateStandardsControlRequest(input) + return out, req.Send() +} + +// UpdateStandardsControlWithContext is the same as UpdateStandardsControl with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateStandardsControl for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SecurityHub) UpdateStandardsControlWithContext(ctx aws.Context, input *UpdateStandardsControlInput, opts ...request.Option) (*UpdateStandardsControlOutput, error) { + req, out := c.UpdateStandardsControlRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + type AcceptInvitationInput struct { _ struct{} `type:"structure"` @@ -3896,6 +4497,64 @@ func (s AcceptInvitationOutput) GoString() string { return s.String() } +// You don't have permission to perform the action specified in the request. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + // The details of an AWS account. type AccountDetails struct { _ struct{} `type:"structure"` @@ -3977,141 +4636,2574 @@ func (s *ActionTarget) SetName(v string) *ActionTarget { return s } -// The details of an Amazon EC2 instance. -type AwsEc2InstanceDetails struct { +// Information about an Availability Zone. +type AvailabilityZone struct { _ struct{} `type:"structure"` - // The IAM profile ARN of the instance. - IamInstanceProfileArn *string `type:"string"` + // The ID of the subnet. You can specify one subnet per Availability Zone. + SubnetId *string `type:"string"` - // The Amazon Machine Image (AMI) ID of the instance. - ImageId *string `type:"string"` + // The name of the Availability Zone. + ZoneName *string `type:"string"` +} - // The IPv4 addresses associated with the instance. - IpV4Addresses []*string `type:"list"` +// String returns the string representation +func (s AvailabilityZone) String() string { + return awsutil.Prettify(s) +} - // The IPv6 addresses associated with the instance. - IpV6Addresses []*string `type:"list"` +// GoString returns the string representation +func (s AvailabilityZone) GoString() string { + return s.String() +} - // The key name associated with the instance. - KeyName *string `type:"string"` +// SetSubnetId sets the SubnetId field's value. +func (s *AvailabilityZone) SetSubnetId(v string) *AvailabilityZone { + s.SubnetId = &v + return s +} - // The date/time the instance was launched. +// SetZoneName sets the ZoneName field's value. +func (s *AvailabilityZone) SetZoneName(v string) *AvailabilityZone { + s.ZoneName = &v + return s +} + +// A distribution configuration. +type AwsCloudFrontDistributionDetails struct { + _ struct{} `type:"structure"` + + // The domain name corresponding to the distribution. + DomainName *string `type:"string"` + + // The entity tag is a hash of the object. + ETag *string `type:"string"` + + // The date and time that the distribution was last modified. + LastModifiedTime *string `type:"string"` + + // A complex type that controls whether access logs are written for the distribution. + Logging *AwsCloudFrontDistributionLogging `type:"structure"` + + // A complex type that contains information about origins for this distribution. + Origins *AwsCloudFrontDistributionOrigins `type:"structure"` + + // Indicates the current status of the distribution. + Status *string `type:"string"` + + // A unique identifier that specifies the AWS WAF web ACL, if any, to associate + // with this distribution. + WebAclId *string `type:"string"` +} + +// String returns the string representation +func (s AwsCloudFrontDistributionDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsCloudFrontDistributionDetails) GoString() string { + return s.String() +} + +// SetDomainName sets the DomainName field's value. +func (s *AwsCloudFrontDistributionDetails) SetDomainName(v string) *AwsCloudFrontDistributionDetails { + s.DomainName = &v + return s +} + +// SetETag sets the ETag field's value. +func (s *AwsCloudFrontDistributionDetails) SetETag(v string) *AwsCloudFrontDistributionDetails { + s.ETag = &v + return s +} + +// SetLastModifiedTime sets the LastModifiedTime field's value. +func (s *AwsCloudFrontDistributionDetails) SetLastModifiedTime(v string) *AwsCloudFrontDistributionDetails { + s.LastModifiedTime = &v + return s +} + +// SetLogging sets the Logging field's value. +func (s *AwsCloudFrontDistributionDetails) SetLogging(v *AwsCloudFrontDistributionLogging) *AwsCloudFrontDistributionDetails { + s.Logging = v + return s +} + +// SetOrigins sets the Origins field's value. +func (s *AwsCloudFrontDistributionDetails) SetOrigins(v *AwsCloudFrontDistributionOrigins) *AwsCloudFrontDistributionDetails { + s.Origins = v + return s +} + +// SetStatus sets the Status field's value. +func (s *AwsCloudFrontDistributionDetails) SetStatus(v string) *AwsCloudFrontDistributionDetails { + s.Status = &v + return s +} + +// SetWebAclId sets the WebAclId field's value. +func (s *AwsCloudFrontDistributionDetails) SetWebAclId(v string) *AwsCloudFrontDistributionDetails { + s.WebAclId = &v + return s +} + +// A complex type that controls whether access logs are written for the distribution. +type AwsCloudFrontDistributionLogging struct { + _ struct{} `type:"structure"` + + // The Amazon S3 bucket to store the access logs in. + Bucket *string `type:"string"` + + // With this field, you can enable or disable the selected distribution. + Enabled *bool `type:"boolean"` + + // Specifies whether you want CloudFront to include cookies in access logs. + IncludeCookies *bool `type:"boolean"` + + // An optional string that you want CloudFront to use as a prefix to the access + // log filenames for this distribution. + Prefix *string `type:"string"` +} + +// String returns the string representation +func (s AwsCloudFrontDistributionLogging) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsCloudFrontDistributionLogging) GoString() string { + return s.String() +} + +// SetBucket sets the Bucket field's value. +func (s *AwsCloudFrontDistributionLogging) SetBucket(v string) *AwsCloudFrontDistributionLogging { + s.Bucket = &v + return s +} + +// SetEnabled sets the Enabled field's value. +func (s *AwsCloudFrontDistributionLogging) SetEnabled(v bool) *AwsCloudFrontDistributionLogging { + s.Enabled = &v + return s +} + +// SetIncludeCookies sets the IncludeCookies field's value. +func (s *AwsCloudFrontDistributionLogging) SetIncludeCookies(v bool) *AwsCloudFrontDistributionLogging { + s.IncludeCookies = &v + return s +} + +// SetPrefix sets the Prefix field's value. +func (s *AwsCloudFrontDistributionLogging) SetPrefix(v string) *AwsCloudFrontDistributionLogging { + s.Prefix = &v + return s +} + +// A complex type that describes the Amazon S3 bucket, HTTP server (for example, +// a web server), Amazon MediaStore, or other server from which CloudFront gets +// your files. +type AwsCloudFrontDistributionOriginItem struct { + _ struct{} `type:"structure"` + + // Amazon S3 origins: The DNS name of the Amazon S3 bucket from which you want + // CloudFront to get objects for this origin. + DomainName *string `type:"string"` + + // A unique identifier for the origin or origin group. + Id *string `type:"string"` + + // An optional element that causes CloudFront to request your content from a + // directory in your Amazon S3 bucket or your custom origin. + OriginPath *string `type:"string"` +} + +// String returns the string representation +func (s AwsCloudFrontDistributionOriginItem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsCloudFrontDistributionOriginItem) GoString() string { + return s.String() +} + +// SetDomainName sets the DomainName field's value. +func (s *AwsCloudFrontDistributionOriginItem) SetDomainName(v string) *AwsCloudFrontDistributionOriginItem { + s.DomainName = &v + return s +} + +// SetId sets the Id field's value. +func (s *AwsCloudFrontDistributionOriginItem) SetId(v string) *AwsCloudFrontDistributionOriginItem { + s.Id = &v + return s +} + +// SetOriginPath sets the OriginPath field's value. +func (s *AwsCloudFrontDistributionOriginItem) SetOriginPath(v string) *AwsCloudFrontDistributionOriginItem { + s.OriginPath = &v + return s +} + +// A complex type that contains information about origins and origin groups +// for this distribution. +type AwsCloudFrontDistributionOrigins struct { + _ struct{} `type:"structure"` + + // A complex type that contains origins or origin groups for this distribution. + Items []*AwsCloudFrontDistributionOriginItem `type:"list"` +} + +// String returns the string representation +func (s AwsCloudFrontDistributionOrigins) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsCloudFrontDistributionOrigins) GoString() string { + return s.String() +} + +// SetItems sets the Items field's value. +func (s *AwsCloudFrontDistributionOrigins) SetItems(v []*AwsCloudFrontDistributionOriginItem) *AwsCloudFrontDistributionOrigins { + s.Items = v + return s +} + +// Information about an AWS CodeBuild project. +type AwsCodeBuildProjectDetails struct { + _ struct{} `type:"structure"` + + // The AWS Key Management Service (AWS KMS) customer master key (CMK) used to + // encrypt the build output artifacts. + // + // You can specify either the Amazon Resource Name (ARN) of the CMK or, if available, + // the CMK alias (using the format alias/alias-name). + EncryptionKey *string `type:"string"` + + // Information about the build environment for this build project. + Environment *AwsCodeBuildProjectEnvironment `type:"structure"` + + // The name of the build project. + Name *string `type:"string"` + + // The ARN of the IAM role that enables AWS CodeBuild to interact with dependent + // AWS services on behalf of the AWS account. + ServiceRole *string `type:"string"` + + // Information about the build input source code for this build project. + Source *AwsCodeBuildProjectSource `type:"structure"` + + // Information about the VPC configuration that AWS CodeBuild accesses. + VpcConfig *AwsCodeBuildProjectVpcConfig `type:"structure"` +} + +// String returns the string representation +func (s AwsCodeBuildProjectDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsCodeBuildProjectDetails) GoString() string { + return s.String() +} + +// SetEncryptionKey sets the EncryptionKey field's value. +func (s *AwsCodeBuildProjectDetails) SetEncryptionKey(v string) *AwsCodeBuildProjectDetails { + s.EncryptionKey = &v + return s +} + +// SetEnvironment sets the Environment field's value. +func (s *AwsCodeBuildProjectDetails) SetEnvironment(v *AwsCodeBuildProjectEnvironment) *AwsCodeBuildProjectDetails { + s.Environment = v + return s +} + +// SetName sets the Name field's value. +func (s *AwsCodeBuildProjectDetails) SetName(v string) *AwsCodeBuildProjectDetails { + s.Name = &v + return s +} + +// SetServiceRole sets the ServiceRole field's value. +func (s *AwsCodeBuildProjectDetails) SetServiceRole(v string) *AwsCodeBuildProjectDetails { + s.ServiceRole = &v + return s +} + +// SetSource sets the Source field's value. +func (s *AwsCodeBuildProjectDetails) SetSource(v *AwsCodeBuildProjectSource) *AwsCodeBuildProjectDetails { + s.Source = v + return s +} + +// SetVpcConfig sets the VpcConfig field's value. +func (s *AwsCodeBuildProjectDetails) SetVpcConfig(v *AwsCodeBuildProjectVpcConfig) *AwsCodeBuildProjectDetails { + s.VpcConfig = v + return s +} + +// Information about the build environment for this build project. +type AwsCodeBuildProjectEnvironment struct { + _ struct{} `type:"structure"` + + // The certificate to use with this build project. + Certificate *string `type:"string"` + + // The type of credentials AWS CodeBuild uses to pull images in your build. + // + // Valid values: + // + // * CODEBUILD specifies that AWS CodeBuild uses its own credentials. This + // requires that you modify your ECR repository policy to trust the AWS CodeBuild + // service principal. + // + // * SERVICE_ROLE specifies that AWS CodeBuild uses your build project's + // service role. + // + // When you use a cross-account or private registry image, you must use SERVICE_ROLE + // credentials. When you use an AWS CodeBuild curated image, you must use CODEBUILD + // credentials. + ImagePullCredentialsType *string `type:"string"` + + // The credentials for access to a private registry. + RegistryCredential *AwsCodeBuildProjectEnvironmentRegistryCredential `type:"structure"` + + // The type of build environment to use for related builds. + // + // The environment type ARM_CONTAINER is available only in regions US East (N. + // Virginia), US East (Ohio), US West (Oregon), Europe (Ireland), Asia Pacific + // (Mumbai), Asia Pacific (Tokyo), Asia Pacific (Sydney), and Europe (Frankfurt). + // + // The environment type LINUX_CONTAINER with compute type build.general1.2xlarge + // is available only in regions US East (N. Virginia), US East (N. Virginia), + // US West (Oregon), Canada (Central), Europe (Ireland), Europe (London), Europe + // (Frankfurt), Asia Pacific (Tokyo), Asia Pacific (Seoul), Asia Pacific (Singapore), + // Asia Pacific (Sydney), China (Beijing), and China (Ningxia). + // + // The environment type LINUX_GPU_CONTAINER is available only in regions US + // East (N. Virginia), US East (N. Virginia), US West (Oregon), Canada (Central), + // Europe (Ireland), Europe (London), Europe (Frankfurt), Asia Pacific (Tokyo), + // Asia Pacific (Seoul), Asia Pacific (Singapore), Asia Pacific (Sydney) , China + // (Beijing), and China (Ningxia). + // + // Valid values: WINDOWS_CONTAINER | LINUX_CONTAINER | LINUX_GPU_CONTAINER | + // ARM_CONTAINER + Type *string `type:"string"` +} + +// String returns the string representation +func (s AwsCodeBuildProjectEnvironment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsCodeBuildProjectEnvironment) GoString() string { + return s.String() +} + +// SetCertificate sets the Certificate field's value. +func (s *AwsCodeBuildProjectEnvironment) SetCertificate(v string) *AwsCodeBuildProjectEnvironment { + s.Certificate = &v + return s +} + +// SetImagePullCredentialsType sets the ImagePullCredentialsType field's value. +func (s *AwsCodeBuildProjectEnvironment) SetImagePullCredentialsType(v string) *AwsCodeBuildProjectEnvironment { + s.ImagePullCredentialsType = &v + return s +} + +// SetRegistryCredential sets the RegistryCredential field's value. +func (s *AwsCodeBuildProjectEnvironment) SetRegistryCredential(v *AwsCodeBuildProjectEnvironmentRegistryCredential) *AwsCodeBuildProjectEnvironment { + s.RegistryCredential = v + return s +} + +// SetType sets the Type field's value. +func (s *AwsCodeBuildProjectEnvironment) SetType(v string) *AwsCodeBuildProjectEnvironment { + s.Type = &v + return s +} + +// The credentials for access to a private registry. +type AwsCodeBuildProjectEnvironmentRegistryCredential struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) or name of credentials created using AWS Secrets + // Manager. + // + // The credential can use the name of the credentials only if they exist in + // your current AWS Region. + Credential *string `type:"string"` + + // The service that created the credentials to access a private Docker registry. + // + // The valid value,SECRETS_MANAGER, is for AWS Secrets Manager. + CredentialProvider *string `type:"string"` +} + +// String returns the string representation +func (s AwsCodeBuildProjectEnvironmentRegistryCredential) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsCodeBuildProjectEnvironmentRegistryCredential) GoString() string { + return s.String() +} + +// SetCredential sets the Credential field's value. +func (s *AwsCodeBuildProjectEnvironmentRegistryCredential) SetCredential(v string) *AwsCodeBuildProjectEnvironmentRegistryCredential { + s.Credential = &v + return s +} + +// SetCredentialProvider sets the CredentialProvider field's value. +func (s *AwsCodeBuildProjectEnvironmentRegistryCredential) SetCredentialProvider(v string) *AwsCodeBuildProjectEnvironmentRegistryCredential { + s.CredentialProvider = &v + return s +} + +// Information about the build input source code for this build project. +type AwsCodeBuildProjectSource struct { + _ struct{} `type:"structure"` + + // Information about the Git clone depth for the build project. + GitCloneDepth *int64 `type:"integer"` + + // Whether to ignore SSL warnings while connecting to the project source code. + InsecureSsl *bool `type:"boolean"` + + // 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 ignores 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 buildspec file + // (for example, https://git-codecommit.region-ID.amazonaws.com/v1/repos/repo-name + // ). + // + // * For source code in an S3 input bucket, one of the following. The path + // to the ZIP file that contains the source code (for example, bucket-name/path/to/object-name.zip). + // The path to the folder that contains the source code (for example, bucket-name/path/to/source-code/folder/). + // + // * For source code in a GitHub repository, the HTTPS clone URL to the repository + // that contains the source and the buildspec file. + // + // * For source code in a Bitbucket repository, the HTTPS clone URL to the + // repository that contains the source and the buildspec file. + Location *string `type:"string"` + + // The type of repository that contains the source code to be built. Valid values + // are: + // + // * BITBUCKET - The source code is in a Bitbucket repository. + // + // * 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. + // + // * GITHUB_ENTERPRISE - The source code is in a GitHub Enterprise repository. + // + // * NO_SOURCE - The project does not have input source code. + // + // * S3 - The source code is in an S3 input bucket. + Type *string `type:"string"` +} + +// String returns the string representation +func (s AwsCodeBuildProjectSource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsCodeBuildProjectSource) GoString() string { + return s.String() +} + +// SetGitCloneDepth sets the GitCloneDepth field's value. +func (s *AwsCodeBuildProjectSource) SetGitCloneDepth(v int64) *AwsCodeBuildProjectSource { + s.GitCloneDepth = &v + return s +} + +// SetInsecureSsl sets the InsecureSsl field's value. +func (s *AwsCodeBuildProjectSource) SetInsecureSsl(v bool) *AwsCodeBuildProjectSource { + s.InsecureSsl = &v + return s +} + +// SetLocation sets the Location field's value. +func (s *AwsCodeBuildProjectSource) SetLocation(v string) *AwsCodeBuildProjectSource { + s.Location = &v + return s +} + +// SetType sets the Type field's value. +func (s *AwsCodeBuildProjectSource) SetType(v string) *AwsCodeBuildProjectSource { + s.Type = &v + return s +} + +// Information about the VPC configuration that AWS CodeBuild accesses. +type AwsCodeBuildProjectVpcConfig struct { + _ struct{} `type:"structure"` + + // A list of one or more security group IDs in your Amazon VPC. + SecurityGroupIds []*string `type:"list"` + + // A list of one or more subnet IDs in your Amazon VPC. + Subnets []*string `type:"list"` + + // The ID of the VPC. + VpcId *string `type:"string"` +} + +// String returns the string representation +func (s AwsCodeBuildProjectVpcConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsCodeBuildProjectVpcConfig) GoString() string { + return s.String() +} + +// SetSecurityGroupIds sets the SecurityGroupIds field's value. +func (s *AwsCodeBuildProjectVpcConfig) SetSecurityGroupIds(v []*string) *AwsCodeBuildProjectVpcConfig { + s.SecurityGroupIds = v + return s +} + +// SetSubnets sets the Subnets field's value. +func (s *AwsCodeBuildProjectVpcConfig) SetSubnets(v []*string) *AwsCodeBuildProjectVpcConfig { + s.Subnets = v + return s +} + +// SetVpcId sets the VpcId field's value. +func (s *AwsCodeBuildProjectVpcConfig) SetVpcId(v string) *AwsCodeBuildProjectVpcConfig { + s.VpcId = &v + return s +} + +// The details of an Amazon EC2 instance. +type AwsEc2InstanceDetails struct { + _ struct{} `type:"structure"` + + // The IAM profile ARN of the instance. + IamInstanceProfileArn *string `type:"string"` + + // The Amazon Machine Image (AMI) ID of the instance. + ImageId *string `type:"string"` + + // The IPv4 addresses associated with the instance. + IpV4Addresses []*string `type:"list"` + + // The IPv6 addresses associated with the instance. + IpV6Addresses []*string `type:"list"` + + // The key name associated with the instance. + KeyName *string `type:"string"` + + // The date/time the instance was launched. LaunchedAt *string `type:"string"` - // The identifier of the subnet that the instance was launched in. - SubnetId *string `type:"string"` + // The identifier of the subnet that the instance was launched in. + SubnetId *string `type:"string"` + + // The instance type of the instance. + Type *string `type:"string"` + + // The identifier of the VPC that the instance was launched in. + VpcId *string `type:"string"` +} + +// String returns the string representation +func (s AwsEc2InstanceDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsEc2InstanceDetails) GoString() string { + return s.String() +} + +// SetIamInstanceProfileArn sets the IamInstanceProfileArn field's value. +func (s *AwsEc2InstanceDetails) SetIamInstanceProfileArn(v string) *AwsEc2InstanceDetails { + s.IamInstanceProfileArn = &v + return s +} + +// SetImageId sets the ImageId field's value. +func (s *AwsEc2InstanceDetails) SetImageId(v string) *AwsEc2InstanceDetails { + s.ImageId = &v + return s +} + +// SetIpV4Addresses sets the IpV4Addresses field's value. +func (s *AwsEc2InstanceDetails) SetIpV4Addresses(v []*string) *AwsEc2InstanceDetails { + s.IpV4Addresses = v + return s +} + +// SetIpV6Addresses sets the IpV6Addresses field's value. +func (s *AwsEc2InstanceDetails) SetIpV6Addresses(v []*string) *AwsEc2InstanceDetails { + s.IpV6Addresses = v + return s +} + +// SetKeyName sets the KeyName field's value. +func (s *AwsEc2InstanceDetails) SetKeyName(v string) *AwsEc2InstanceDetails { + s.KeyName = &v + return s +} + +// SetLaunchedAt sets the LaunchedAt field's value. +func (s *AwsEc2InstanceDetails) SetLaunchedAt(v string) *AwsEc2InstanceDetails { + s.LaunchedAt = &v + return s +} + +// SetSubnetId sets the SubnetId field's value. +func (s *AwsEc2InstanceDetails) SetSubnetId(v string) *AwsEc2InstanceDetails { + s.SubnetId = &v + return s +} + +// SetType sets the Type field's value. +func (s *AwsEc2InstanceDetails) SetType(v string) *AwsEc2InstanceDetails { + s.Type = &v + return s +} + +// SetVpcId sets the VpcId field's value. +func (s *AwsEc2InstanceDetails) SetVpcId(v string) *AwsEc2InstanceDetails { + s.VpcId = &v + return s +} + +// Information about the network interface attachment. +type AwsEc2NetworkInterfaceAttachment struct { + _ struct{} `type:"structure"` + + // The timestamp indicating when the attachment initiated. + AttachTime *string `type:"string"` + + // The identifier of the network interface attachment + AttachmentId *string `type:"string"` + + // Indicates whether the network interface is deleted when the instance is terminated. + DeleteOnTermination *bool `type:"boolean"` + + // The device index of the network interface attachment on the instance. + DeviceIndex *int64 `type:"integer"` + + // The ID of the instance. + InstanceId *string `type:"string"` + + // The AWS account ID of the owner of the instance. + InstanceOwnerId *string `type:"string"` + + // The attachment state. + // + // Valid values: attaching | attached | detaching | detached + Status *string `type:"string"` +} + +// String returns the string representation +func (s AwsEc2NetworkInterfaceAttachment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsEc2NetworkInterfaceAttachment) GoString() string { + return s.String() +} + +// SetAttachTime sets the AttachTime field's value. +func (s *AwsEc2NetworkInterfaceAttachment) SetAttachTime(v string) *AwsEc2NetworkInterfaceAttachment { + s.AttachTime = &v + return s +} + +// SetAttachmentId sets the AttachmentId field's value. +func (s *AwsEc2NetworkInterfaceAttachment) SetAttachmentId(v string) *AwsEc2NetworkInterfaceAttachment { + s.AttachmentId = &v + return s +} + +// SetDeleteOnTermination sets the DeleteOnTermination field's value. +func (s *AwsEc2NetworkInterfaceAttachment) SetDeleteOnTermination(v bool) *AwsEc2NetworkInterfaceAttachment { + s.DeleteOnTermination = &v + return s +} + +// SetDeviceIndex sets the DeviceIndex field's value. +func (s *AwsEc2NetworkInterfaceAttachment) SetDeviceIndex(v int64) *AwsEc2NetworkInterfaceAttachment { + s.DeviceIndex = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *AwsEc2NetworkInterfaceAttachment) SetInstanceId(v string) *AwsEc2NetworkInterfaceAttachment { + s.InstanceId = &v + return s +} + +// SetInstanceOwnerId sets the InstanceOwnerId field's value. +func (s *AwsEc2NetworkInterfaceAttachment) SetInstanceOwnerId(v string) *AwsEc2NetworkInterfaceAttachment { + s.InstanceOwnerId = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *AwsEc2NetworkInterfaceAttachment) SetStatus(v string) *AwsEc2NetworkInterfaceAttachment { + s.Status = &v + return s +} + +// Details about the network interface +type AwsEc2NetworkInterfaceDetails struct { + _ struct{} `type:"structure"` + + // The network interface attachment. + Attachment *AwsEc2NetworkInterfaceAttachment `type:"structure"` + + // The ID of the network interface. + NetworkInterfaceId *string `type:"string"` + + // Security groups for the network interface. + SecurityGroups []*AwsEc2NetworkInterfaceSecurityGroup `type:"list"` + + // Indicates whether traffic to or from the instance is validated. + SourceDestCheck *bool `type:"boolean"` +} + +// String returns the string representation +func (s AwsEc2NetworkInterfaceDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsEc2NetworkInterfaceDetails) GoString() string { + return s.String() +} + +// SetAttachment sets the Attachment field's value. +func (s *AwsEc2NetworkInterfaceDetails) SetAttachment(v *AwsEc2NetworkInterfaceAttachment) *AwsEc2NetworkInterfaceDetails { + s.Attachment = v + return s +} + +// SetNetworkInterfaceId sets the NetworkInterfaceId field's value. +func (s *AwsEc2NetworkInterfaceDetails) SetNetworkInterfaceId(v string) *AwsEc2NetworkInterfaceDetails { + s.NetworkInterfaceId = &v + return s +} + +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *AwsEc2NetworkInterfaceDetails) SetSecurityGroups(v []*AwsEc2NetworkInterfaceSecurityGroup) *AwsEc2NetworkInterfaceDetails { + s.SecurityGroups = v + return s +} + +// SetSourceDestCheck sets the SourceDestCheck field's value. +func (s *AwsEc2NetworkInterfaceDetails) SetSourceDestCheck(v bool) *AwsEc2NetworkInterfaceDetails { + s.SourceDestCheck = &v + return s +} + +// A security group associated with the network interface. +type AwsEc2NetworkInterfaceSecurityGroup struct { + _ struct{} `type:"structure"` + + // The ID of the security group. + GroupId *string `type:"string"` + + // The name of the security group. + GroupName *string `type:"string"` +} + +// String returns the string representation +func (s AwsEc2NetworkInterfaceSecurityGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsEc2NetworkInterfaceSecurityGroup) GoString() string { + return s.String() +} + +// SetGroupId sets the GroupId field's value. +func (s *AwsEc2NetworkInterfaceSecurityGroup) SetGroupId(v string) *AwsEc2NetworkInterfaceSecurityGroup { + s.GroupId = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *AwsEc2NetworkInterfaceSecurityGroup) SetGroupName(v string) *AwsEc2NetworkInterfaceSecurityGroup { + s.GroupName = &v + return s +} + +// Details about an EC2 security group. +type AwsEc2SecurityGroupDetails struct { + _ struct{} `type:"structure"` + + // The ID of the security group. + GroupId *string `type:"string"` + + // The name of the security group. + GroupName *string `type:"string"` + + // The inbound rules associated with the security group. + IpPermissions []*AwsEc2SecurityGroupIpPermission `type:"list"` + + // [VPC only] The outbound rules associated with the security group. + IpPermissionsEgress []*AwsEc2SecurityGroupIpPermission `type:"list"` + + // The AWS account ID of the owner of the security group. + OwnerId *string `type:"string"` + + // [VPC only] The ID of the VPC for the security group. + VpcId *string `type:"string"` +} + +// String returns the string representation +func (s AwsEc2SecurityGroupDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsEc2SecurityGroupDetails) GoString() string { + return s.String() +} + +// SetGroupId sets the GroupId field's value. +func (s *AwsEc2SecurityGroupDetails) SetGroupId(v string) *AwsEc2SecurityGroupDetails { + s.GroupId = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *AwsEc2SecurityGroupDetails) SetGroupName(v string) *AwsEc2SecurityGroupDetails { + s.GroupName = &v + return s +} + +// SetIpPermissions sets the IpPermissions field's value. +func (s *AwsEc2SecurityGroupDetails) SetIpPermissions(v []*AwsEc2SecurityGroupIpPermission) *AwsEc2SecurityGroupDetails { + s.IpPermissions = v + return s +} + +// SetIpPermissionsEgress sets the IpPermissionsEgress field's value. +func (s *AwsEc2SecurityGroupDetails) SetIpPermissionsEgress(v []*AwsEc2SecurityGroupIpPermission) *AwsEc2SecurityGroupDetails { + s.IpPermissionsEgress = v + return s +} + +// SetOwnerId sets the OwnerId field's value. +func (s *AwsEc2SecurityGroupDetails) SetOwnerId(v string) *AwsEc2SecurityGroupDetails { + s.OwnerId = &v + return s +} + +// SetVpcId sets the VpcId field's value. +func (s *AwsEc2SecurityGroupDetails) SetVpcId(v string) *AwsEc2SecurityGroupDetails { + s.VpcId = &v + return s +} + +// An IP permission for an EC2 security group. +type AwsEc2SecurityGroupIpPermission struct { + _ struct{} `type:"structure"` + + // The start of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 + // type number. + // + // A value of -1 indicates all ICMP/ICMPv6 types. If you specify all ICMP/ICMPv6 + // types, you must specify all codes. + FromPort *int64 `type:"integer"` + + // The IP protocol name (tcp, udp, icmp, icmpv6) or number. + // + // [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 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 icmpv6, the port range is optional. If you omit the port range, traffic + // for all types and codes is allowed. + IpProtocol *string `type:"string"` + + // The IPv4 ranges. + IpRanges []*AwsEc2SecurityGroupIpRange `type:"list"` + + // The IPv6 ranges. + Ipv6Ranges []*AwsEc2SecurityGroupIpv6Range `type:"list"` + + // [VPC only] The prefix list IDs for an AWS service. With outbound rules, this + // is the AWS service to access through a VPC endpoint from instances associated + // with the security group. + PrefixListIds []*AwsEc2SecurityGroupPrefixListId `type:"list"` + + // The end of the port range for the TCP and UDP protocols, or an ICMP/ICMPv6 + // code. + // + // A value of -1 indicates all ICMP/ICMPv6 codes. If you specify all ICMP/ICMPv6 + // types, you must specify all codes. + ToPort *int64 `type:"integer"` + + // The security group and AWS account ID pairs. + UserIdGroupPairs []*AwsEc2SecurityGroupUserIdGroupPair `type:"list"` +} + +// String returns the string representation +func (s AwsEc2SecurityGroupIpPermission) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsEc2SecurityGroupIpPermission) GoString() string { + return s.String() +} + +// SetFromPort sets the FromPort field's value. +func (s *AwsEc2SecurityGroupIpPermission) SetFromPort(v int64) *AwsEc2SecurityGroupIpPermission { + s.FromPort = &v + return s +} + +// SetIpProtocol sets the IpProtocol field's value. +func (s *AwsEc2SecurityGroupIpPermission) SetIpProtocol(v string) *AwsEc2SecurityGroupIpPermission { + s.IpProtocol = &v + return s +} + +// SetIpRanges sets the IpRanges field's value. +func (s *AwsEc2SecurityGroupIpPermission) SetIpRanges(v []*AwsEc2SecurityGroupIpRange) *AwsEc2SecurityGroupIpPermission { + s.IpRanges = v + return s +} + +// SetIpv6Ranges sets the Ipv6Ranges field's value. +func (s *AwsEc2SecurityGroupIpPermission) SetIpv6Ranges(v []*AwsEc2SecurityGroupIpv6Range) *AwsEc2SecurityGroupIpPermission { + s.Ipv6Ranges = v + return s +} + +// SetPrefixListIds sets the PrefixListIds field's value. +func (s *AwsEc2SecurityGroupIpPermission) SetPrefixListIds(v []*AwsEc2SecurityGroupPrefixListId) *AwsEc2SecurityGroupIpPermission { + s.PrefixListIds = v + return s +} + +// SetToPort sets the ToPort field's value. +func (s *AwsEc2SecurityGroupIpPermission) SetToPort(v int64) *AwsEc2SecurityGroupIpPermission { + s.ToPort = &v + return s +} + +// SetUserIdGroupPairs sets the UserIdGroupPairs field's value. +func (s *AwsEc2SecurityGroupIpPermission) SetUserIdGroupPairs(v []*AwsEc2SecurityGroupUserIdGroupPair) *AwsEc2SecurityGroupIpPermission { + s.UserIdGroupPairs = v + return s +} + +// A range of IPv4 addresses. +type AwsEc2SecurityGroupIpRange struct { + _ struct{} `type:"structure"` + + // The IPv4 CIDR range. You can either specify either a CIDR range or a source + // security group, but not both. To specify a single IPv4 address, use the /32 + // prefix length. + CidrIp *string `type:"string"` +} + +// String returns the string representation +func (s AwsEc2SecurityGroupIpRange) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsEc2SecurityGroupIpRange) GoString() string { + return s.String() +} + +// SetCidrIp sets the CidrIp field's value. +func (s *AwsEc2SecurityGroupIpRange) SetCidrIp(v string) *AwsEc2SecurityGroupIpRange { + s.CidrIp = &v + return s +} + +// A range of IPv6 addresses. +type AwsEc2SecurityGroupIpv6Range struct { + _ struct{} `type:"structure"` + + // The IPv6 CIDR range. You can either specify either a CIDR range or a source + // security group, but not both. To specify a single IPv6 address, use the /128 + // prefix length. + CidrIpv6 *string `type:"string"` +} + +// String returns the string representation +func (s AwsEc2SecurityGroupIpv6Range) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsEc2SecurityGroupIpv6Range) GoString() string { + return s.String() +} + +// SetCidrIpv6 sets the CidrIpv6 field's value. +func (s *AwsEc2SecurityGroupIpv6Range) SetCidrIpv6(v string) *AwsEc2SecurityGroupIpv6Range { + s.CidrIpv6 = &v + return s +} + +// A prefix list ID. +type AwsEc2SecurityGroupPrefixListId struct { + _ struct{} `type:"structure"` + + // The ID of the prefix. + PrefixListId *string `type:"string"` +} + +// String returns the string representation +func (s AwsEc2SecurityGroupPrefixListId) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsEc2SecurityGroupPrefixListId) GoString() string { + return s.String() +} + +// SetPrefixListId sets the PrefixListId field's value. +func (s *AwsEc2SecurityGroupPrefixListId) SetPrefixListId(v string) *AwsEc2SecurityGroupPrefixListId { + s.PrefixListId = &v + return s +} + +// A relationship between a security group and a user. +type AwsEc2SecurityGroupUserIdGroupPair struct { + _ struct{} `type:"structure"` + + // The ID of the security group. + GroupId *string `type:"string"` + + // The name of the security group. + GroupName *string `type:"string"` + + // The status of a VPC peering connection, if applicable. + PeeringStatus *string `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 in the response. If the referenced security group + // is deleted, this value is not returned. + // + // [EC2-Classic] Required when adding or removing rules that reference a security + // group in another AWS. + UserId *string `type:"string"` + + // The ID of the VPC for the referenced security group, if applicable. + VpcId *string `type:"string"` + + // The ID of the VPC peering connection, if applicable. + VpcPeeringConnectionId *string `type:"string"` +} + +// String returns the string representation +func (s AwsEc2SecurityGroupUserIdGroupPair) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsEc2SecurityGroupUserIdGroupPair) GoString() string { + return s.String() +} + +// SetGroupId sets the GroupId field's value. +func (s *AwsEc2SecurityGroupUserIdGroupPair) SetGroupId(v string) *AwsEc2SecurityGroupUserIdGroupPair { + s.GroupId = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *AwsEc2SecurityGroupUserIdGroupPair) SetGroupName(v string) *AwsEc2SecurityGroupUserIdGroupPair { + s.GroupName = &v + return s +} + +// SetPeeringStatus sets the PeeringStatus field's value. +func (s *AwsEc2SecurityGroupUserIdGroupPair) SetPeeringStatus(v string) *AwsEc2SecurityGroupUserIdGroupPair { + s.PeeringStatus = &v + return s +} + +// SetUserId sets the UserId field's value. +func (s *AwsEc2SecurityGroupUserIdGroupPair) SetUserId(v string) *AwsEc2SecurityGroupUserIdGroupPair { + s.UserId = &v + return s +} + +// SetVpcId sets the VpcId field's value. +func (s *AwsEc2SecurityGroupUserIdGroupPair) SetVpcId(v string) *AwsEc2SecurityGroupUserIdGroupPair { + s.VpcId = &v + return s +} + +// SetVpcPeeringConnectionId sets the VpcPeeringConnectionId field's value. +func (s *AwsEc2SecurityGroupUserIdGroupPair) SetVpcPeeringConnectionId(v string) *AwsEc2SecurityGroupUserIdGroupPair { + s.VpcPeeringConnectionId = &v + return s +} + +// Information about an Elasticsearch domain. +type AwsElasticsearchDomainDetails struct { + _ struct{} `type:"structure"` + + // IAM policy document specifying the access policies for the new Amazon ES + // domain. + AccessPolicies *string `type:"string"` + + // Additional options for the domain endpoint. + DomainEndpointOptions *AwsElasticsearchDomainDomainEndpointOptions `type:"structure"` + + // Unique identifier for an Amazon ES domain. + DomainId *string `type:"string"` + + // Name of an Amazon ES domain. + // + // Domain names are unique across all domains owned by the same account within + // an AWS Region. + // + // Domain names must start with a lowercase letter and must be between 3 and + // 28 characters. + // + // Valid characters are a-z (lowercase only), 0-9, and – (hyphen). + DomainName *string `type:"string"` + + // Elasticsearch version. + ElasticsearchVersion *string `type:"string"` + + // Details about the configuration for encryption at rest. + EncryptionAtRestOptions *AwsElasticsearchDomainEncryptionAtRestOptions `type:"structure"` + + // Domain-specific endpoint used to submit index, search, and data upload requests + // to an Amazon ES domain. + // + // The endpoint is a service URL. + Endpoint *string `type:"string"` + + // The key-value pair that exists if the Amazon ES domain uses VPC endpoints. + Endpoints map[string]*string `type:"map"` + + // Details about the configuration for node-to-node encryption. + NodeToNodeEncryptionOptions *AwsElasticsearchDomainNodeToNodeEncryptionOptions `type:"structure"` + + // Information that Amazon ES derives based on VPCOptions for the domain. + VPCOptions *AwsElasticsearchDomainVPCOptions `type:"structure"` +} + +// String returns the string representation +func (s AwsElasticsearchDomainDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsElasticsearchDomainDetails) GoString() string { + return s.String() +} + +// SetAccessPolicies sets the AccessPolicies field's value. +func (s *AwsElasticsearchDomainDetails) SetAccessPolicies(v string) *AwsElasticsearchDomainDetails { + s.AccessPolicies = &v + return s +} + +// SetDomainEndpointOptions sets the DomainEndpointOptions field's value. +func (s *AwsElasticsearchDomainDetails) SetDomainEndpointOptions(v *AwsElasticsearchDomainDomainEndpointOptions) *AwsElasticsearchDomainDetails { + s.DomainEndpointOptions = v + return s +} + +// SetDomainId sets the DomainId field's value. +func (s *AwsElasticsearchDomainDetails) SetDomainId(v string) *AwsElasticsearchDomainDetails { + s.DomainId = &v + return s +} + +// SetDomainName sets the DomainName field's value. +func (s *AwsElasticsearchDomainDetails) SetDomainName(v string) *AwsElasticsearchDomainDetails { + s.DomainName = &v + return s +} + +// SetElasticsearchVersion sets the ElasticsearchVersion field's value. +func (s *AwsElasticsearchDomainDetails) SetElasticsearchVersion(v string) *AwsElasticsearchDomainDetails { + s.ElasticsearchVersion = &v + return s +} + +// SetEncryptionAtRestOptions sets the EncryptionAtRestOptions field's value. +func (s *AwsElasticsearchDomainDetails) SetEncryptionAtRestOptions(v *AwsElasticsearchDomainEncryptionAtRestOptions) *AwsElasticsearchDomainDetails { + s.EncryptionAtRestOptions = v + return s +} + +// SetEndpoint sets the Endpoint field's value. +func (s *AwsElasticsearchDomainDetails) SetEndpoint(v string) *AwsElasticsearchDomainDetails { + s.Endpoint = &v + return s +} + +// SetEndpoints sets the Endpoints field's value. +func (s *AwsElasticsearchDomainDetails) SetEndpoints(v map[string]*string) *AwsElasticsearchDomainDetails { + s.Endpoints = v + return s +} + +// SetNodeToNodeEncryptionOptions sets the NodeToNodeEncryptionOptions field's value. +func (s *AwsElasticsearchDomainDetails) SetNodeToNodeEncryptionOptions(v *AwsElasticsearchDomainNodeToNodeEncryptionOptions) *AwsElasticsearchDomainDetails { + s.NodeToNodeEncryptionOptions = v + return s +} + +// SetVPCOptions sets the VPCOptions field's value. +func (s *AwsElasticsearchDomainDetails) SetVPCOptions(v *AwsElasticsearchDomainVPCOptions) *AwsElasticsearchDomainDetails { + s.VPCOptions = v + return s +} + +// Additional options for the domain endpoint, such as whether to require HTTPS +// for all traffic. +type AwsElasticsearchDomainDomainEndpointOptions struct { + _ struct{} `type:"structure"` + + // Whether to require that all traffic to the domain arrive over HTTPS. + EnforceHTTPS *bool `type:"boolean"` + + // The TLS security policy to apply to the HTTPS endpoint of the Elasticsearch + // domain. + // + // Valid values: + // + // * Policy-Min-TLS-1-0-2019-07, which supports TLSv1.0 and higher + // + // * Policy-Min-TLS-1-2-2019-07, which only supports TLSv1.2 + TLSSecurityPolicy *string `type:"string"` +} + +// String returns the string representation +func (s AwsElasticsearchDomainDomainEndpointOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsElasticsearchDomainDomainEndpointOptions) GoString() string { + return s.String() +} + +// SetEnforceHTTPS sets the EnforceHTTPS field's value. +func (s *AwsElasticsearchDomainDomainEndpointOptions) SetEnforceHTTPS(v bool) *AwsElasticsearchDomainDomainEndpointOptions { + s.EnforceHTTPS = &v + return s +} + +// SetTLSSecurityPolicy sets the TLSSecurityPolicy field's value. +func (s *AwsElasticsearchDomainDomainEndpointOptions) SetTLSSecurityPolicy(v string) *AwsElasticsearchDomainDomainEndpointOptions { + s.TLSSecurityPolicy = &v + return s +} + +// Details about the configuration for encryption at rest. +type AwsElasticsearchDomainEncryptionAtRestOptions struct { + _ struct{} `type:"structure"` + + // Whether encryption at rest is enabled. + Enabled *bool `type:"boolean"` + + // The KMS key ID. Takes the form 1a2a3a4-1a2a-3a4a-5a6a-1a2a3a4a5a6a. + KmsKeyId *string `type:"string"` +} + +// String returns the string representation +func (s AwsElasticsearchDomainEncryptionAtRestOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsElasticsearchDomainEncryptionAtRestOptions) GoString() string { + return s.String() +} + +// SetEnabled sets the Enabled field's value. +func (s *AwsElasticsearchDomainEncryptionAtRestOptions) SetEnabled(v bool) *AwsElasticsearchDomainEncryptionAtRestOptions { + s.Enabled = &v + return s +} + +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *AwsElasticsearchDomainEncryptionAtRestOptions) SetKmsKeyId(v string) *AwsElasticsearchDomainEncryptionAtRestOptions { + s.KmsKeyId = &v + return s +} + +// Details about the configuration for node-to-node encryption. +type AwsElasticsearchDomainNodeToNodeEncryptionOptions struct { + _ struct{} `type:"structure"` + + // Whether node-to-node encryption is enabled. + Enabled *bool `type:"boolean"` +} + +// String returns the string representation +func (s AwsElasticsearchDomainNodeToNodeEncryptionOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsElasticsearchDomainNodeToNodeEncryptionOptions) GoString() string { + return s.String() +} + +// SetEnabled sets the Enabled field's value. +func (s *AwsElasticsearchDomainNodeToNodeEncryptionOptions) SetEnabled(v bool) *AwsElasticsearchDomainNodeToNodeEncryptionOptions { + s.Enabled = &v + return s +} + +// Information that Amazon ES derives based on VPCOptions for the domain. +type AwsElasticsearchDomainVPCOptions struct { + _ struct{} `type:"structure"` + + // The list of Availability Zones associated with the VPC subnets. + AvailabilityZones []*string `type:"list"` + + // The list of security group IDs associated with the VPC endpoints for the + // domain. + SecurityGroupIds []*string `type:"list"` + + // A list of subnet IDs associated with the VPC endpoints for the domain. + SubnetIds []*string `type:"list"` + + // ID for the VPC. + VPCId *string `type:"string"` +} + +// String returns the string representation +func (s AwsElasticsearchDomainVPCOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsElasticsearchDomainVPCOptions) GoString() string { + return s.String() +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *AwsElasticsearchDomainVPCOptions) SetAvailabilityZones(v []*string) *AwsElasticsearchDomainVPCOptions { + s.AvailabilityZones = v + return s +} + +// SetSecurityGroupIds sets the SecurityGroupIds field's value. +func (s *AwsElasticsearchDomainVPCOptions) SetSecurityGroupIds(v []*string) *AwsElasticsearchDomainVPCOptions { + s.SecurityGroupIds = v + return s +} + +// SetSubnetIds sets the SubnetIds field's value. +func (s *AwsElasticsearchDomainVPCOptions) SetSubnetIds(v []*string) *AwsElasticsearchDomainVPCOptions { + s.SubnetIds = v + return s +} + +// SetVPCId sets the VPCId field's value. +func (s *AwsElasticsearchDomainVPCOptions) SetVPCId(v string) *AwsElasticsearchDomainVPCOptions { + s.VPCId = &v + return s +} + +// Information about a load balancer. +type AwsElbv2LoadBalancerDetails 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 *string `type:"string"` + + // 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"` + + // The nodes of an Internet-facing load balancer have public IP addresses. + Scheme *string `type:"string"` + + // 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"` + + // The ID of the VPC for the load balancer. + VpcId *string `type:"string"` +} + +// String returns the string representation +func (s AwsElbv2LoadBalancerDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsElbv2LoadBalancerDetails) GoString() string { + return s.String() +} + +// SetAvailabilityZones sets the AvailabilityZones field's value. +func (s *AwsElbv2LoadBalancerDetails) SetAvailabilityZones(v []*AvailabilityZone) *AwsElbv2LoadBalancerDetails { + s.AvailabilityZones = v + return s +} + +// SetCanonicalHostedZoneId sets the CanonicalHostedZoneId field's value. +func (s *AwsElbv2LoadBalancerDetails) SetCanonicalHostedZoneId(v string) *AwsElbv2LoadBalancerDetails { + s.CanonicalHostedZoneId = &v + return s +} + +// SetCreatedTime sets the CreatedTime field's value. +func (s *AwsElbv2LoadBalancerDetails) SetCreatedTime(v string) *AwsElbv2LoadBalancerDetails { + s.CreatedTime = &v + return s +} + +// SetDNSName sets the DNSName field's value. +func (s *AwsElbv2LoadBalancerDetails) SetDNSName(v string) *AwsElbv2LoadBalancerDetails { + s.DNSName = &v + return s +} + +// SetIpAddressType sets the IpAddressType field's value. +func (s *AwsElbv2LoadBalancerDetails) SetIpAddressType(v string) *AwsElbv2LoadBalancerDetails { + s.IpAddressType = &v + return s +} + +// SetScheme sets the Scheme field's value. +func (s *AwsElbv2LoadBalancerDetails) SetScheme(v string) *AwsElbv2LoadBalancerDetails { + s.Scheme = &v + return s +} + +// SetSecurityGroups sets the SecurityGroups field's value. +func (s *AwsElbv2LoadBalancerDetails) SetSecurityGroups(v []*string) *AwsElbv2LoadBalancerDetails { + s.SecurityGroups = v + return s +} + +// SetState sets the State field's value. +func (s *AwsElbv2LoadBalancerDetails) SetState(v *LoadBalancerState) *AwsElbv2LoadBalancerDetails { + s.State = v + return s +} + +// SetType sets the Type field's value. +func (s *AwsElbv2LoadBalancerDetails) SetType(v string) *AwsElbv2LoadBalancerDetails { + s.Type = &v + return s +} + +// SetVpcId sets the VpcId field's value. +func (s *AwsElbv2LoadBalancerDetails) SetVpcId(v string) *AwsElbv2LoadBalancerDetails { + s.VpcId = &v + return s +} + +// IAM access key details related to a finding. +type AwsIamAccessKeyDetails struct { + _ struct{} `type:"structure"` + + // The creation date/time of the IAM access key related to a finding. + CreatedAt *string `type:"string"` + + // The ID of the principal associated with an access key. + PrincipalId *string `type:"string"` + + // The name of the principal. + PrincipalName *string `type:"string"` + + // The type of principal associated with an access key. + PrincipalType *string `type:"string"` + + // The status of the IAM access key related to a finding. + Status *string `type:"string" enum:"AwsIamAccessKeyStatus"` + + // The user associated with the IAM access key related to a finding. + // + // The UserName parameter has been replaced with the PrincipalName parameter + // because access keys can also be assigned to principals that are not IAM users. + // + // Deprecated: This field is deprecated, use PrincipalName instead. + UserName *string `deprecated:"true" type:"string"` +} + +// String returns the string representation +func (s AwsIamAccessKeyDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsIamAccessKeyDetails) GoString() string { + return s.String() +} + +// SetCreatedAt sets the CreatedAt field's value. +func (s *AwsIamAccessKeyDetails) SetCreatedAt(v string) *AwsIamAccessKeyDetails { + s.CreatedAt = &v + return s +} + +// SetPrincipalId sets the PrincipalId field's value. +func (s *AwsIamAccessKeyDetails) SetPrincipalId(v string) *AwsIamAccessKeyDetails { + s.PrincipalId = &v + return s +} + +// SetPrincipalName sets the PrincipalName field's value. +func (s *AwsIamAccessKeyDetails) SetPrincipalName(v string) *AwsIamAccessKeyDetails { + s.PrincipalName = &v + return s +} + +// SetPrincipalType sets the PrincipalType field's value. +func (s *AwsIamAccessKeyDetails) SetPrincipalType(v string) *AwsIamAccessKeyDetails { + s.PrincipalType = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *AwsIamAccessKeyDetails) SetStatus(v string) *AwsIamAccessKeyDetails { + s.Status = &v + return s +} + +// SetUserName sets the UserName field's value. +func (s *AwsIamAccessKeyDetails) SetUserName(v string) *AwsIamAccessKeyDetails { + s.UserName = &v + return s +} + +// Contains information about an IAM role, including all of the role's policies. +type AwsIamRoleDetails struct { + _ struct{} `type:"structure"` + + // The trust policy that grants permission to assume the role. + AssumeRolePolicyDocument *string `min:"1" type:"string"` + + // The date and time, in ISO 8601 date-time format, when the role was created. + CreateDate *string `type:"string"` + + // The maximum session duration (in seconds) that you want to set for the specified + // role. + MaxSessionDuration *int64 `type:"integer"` + + // The path to the role. + Path *string `type:"string"` + + // The stable and unique string identifying the role. + RoleId *string `type:"string"` + + // The friendly name that identifies the role. + RoleName *string `type:"string"` +} + +// String returns the string representation +func (s AwsIamRoleDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsIamRoleDetails) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AwsIamRoleDetails) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AwsIamRoleDetails"} + if s.AssumeRolePolicyDocument != nil && len(*s.AssumeRolePolicyDocument) < 1 { + invalidParams.Add(request.NewErrParamMinLen("AssumeRolePolicyDocument", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAssumeRolePolicyDocument sets the AssumeRolePolicyDocument field's value. +func (s *AwsIamRoleDetails) SetAssumeRolePolicyDocument(v string) *AwsIamRoleDetails { + s.AssumeRolePolicyDocument = &v + return s +} + +// SetCreateDate sets the CreateDate field's value. +func (s *AwsIamRoleDetails) SetCreateDate(v string) *AwsIamRoleDetails { + s.CreateDate = &v + return s +} + +// SetMaxSessionDuration sets the MaxSessionDuration field's value. +func (s *AwsIamRoleDetails) SetMaxSessionDuration(v int64) *AwsIamRoleDetails { + s.MaxSessionDuration = &v + return s +} + +// SetPath sets the Path field's value. +func (s *AwsIamRoleDetails) SetPath(v string) *AwsIamRoleDetails { + s.Path = &v + return s +} + +// SetRoleId sets the RoleId field's value. +func (s *AwsIamRoleDetails) SetRoleId(v string) *AwsIamRoleDetails { + s.RoleId = &v + return s +} + +// SetRoleName sets the RoleName field's value. +func (s *AwsIamRoleDetails) SetRoleName(v string) *AwsIamRoleDetails { + s.RoleName = &v + return s +} + +// Contains metadata about a customer master key (CMK). +type AwsKmsKeyDetails struct { + _ struct{} `type:"structure"` + + // The twelve-digit account ID of the AWS account that owns the CMK. + AWSAccountId *string `type:"string"` + + // The date and time when the CMK was created. + CreationDate *float64 `type:"double"` + + // The globally unique identifier for the CMK. + KeyId *string `type:"string"` + + // The manager of the CMK. CMKs in your AWS account are either customer managed + // or AWS managed. + KeyManager *string `type:"string"` + + // The state of the CMK. + KeyState *string `type:"string"` + + // 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. + // + // When this value is AWS_CLOUDHSM, the key material was created in the AWS + // CloudHSM cluster associated with a custom key store. + Origin *string `type:"string"` +} + +// String returns the string representation +func (s AwsKmsKeyDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsKmsKeyDetails) GoString() string { + return s.String() +} + +// SetAWSAccountId sets the AWSAccountId field's value. +func (s *AwsKmsKeyDetails) SetAWSAccountId(v string) *AwsKmsKeyDetails { + s.AWSAccountId = &v + return s +} + +// SetCreationDate sets the CreationDate field's value. +func (s *AwsKmsKeyDetails) SetCreationDate(v float64) *AwsKmsKeyDetails { + s.CreationDate = &v + return s +} + +// SetKeyId sets the KeyId field's value. +func (s *AwsKmsKeyDetails) SetKeyId(v string) *AwsKmsKeyDetails { + s.KeyId = &v + return s +} + +// SetKeyManager sets the KeyManager field's value. +func (s *AwsKmsKeyDetails) SetKeyManager(v string) *AwsKmsKeyDetails { + s.KeyManager = &v + return s +} + +// SetKeyState sets the KeyState field's value. +func (s *AwsKmsKeyDetails) SetKeyState(v string) *AwsKmsKeyDetails { + s.KeyState = &v + return s +} + +// SetOrigin sets the Origin field's value. +func (s *AwsKmsKeyDetails) SetOrigin(v string) *AwsKmsKeyDetails { + s.Origin = &v + return s +} + +// The code for the Lambda function. You can specify either an object in Amazon +// S3, or upload a deployment package directly. +type AwsLambdaFunctionCode struct { + _ struct{} `type:"structure"` + + // An Amazon S3 bucket in the same AWS Region as your function. The bucket can + // be in a different AWS account. + S3Bucket *string `type:"string"` + + // The Amazon S3 key of the deployment package. + S3Key *string `type:"string"` + + // For versioned objects, the version of the deployment package object to use. + S3ObjectVersion *string `type:"string"` + + // The base64-encoded contents of the deployment package. AWS SDK and AWS CLI + // clients handle the encoding for you. + ZipFile *string `type:"string"` +} + +// String returns the string representation +func (s AwsLambdaFunctionCode) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsLambdaFunctionCode) GoString() string { + return s.String() +} + +// SetS3Bucket sets the S3Bucket field's value. +func (s *AwsLambdaFunctionCode) SetS3Bucket(v string) *AwsLambdaFunctionCode { + s.S3Bucket = &v + return s +} + +// SetS3Key sets the S3Key field's value. +func (s *AwsLambdaFunctionCode) SetS3Key(v string) *AwsLambdaFunctionCode { + s.S3Key = &v + return s +} + +// SetS3ObjectVersion sets the S3ObjectVersion field's value. +func (s *AwsLambdaFunctionCode) SetS3ObjectVersion(v string) *AwsLambdaFunctionCode { + s.S3ObjectVersion = &v + return s +} + +// SetZipFile sets the ZipFile field's value. +func (s *AwsLambdaFunctionCode) SetZipFile(v string) *AwsLambdaFunctionCode { + s.ZipFile = &v + return s +} + +// The dead-letter queue for failed asynchronous invocations. +type AwsLambdaFunctionDeadLetterConfig struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of an Amazon SQS queue or Amazon SNS topic. + TargetArn *string `type:"string"` +} + +// String returns the string representation +func (s AwsLambdaFunctionDeadLetterConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsLambdaFunctionDeadLetterConfig) GoString() string { + return s.String() +} + +// SetTargetArn sets the TargetArn field's value. +func (s *AwsLambdaFunctionDeadLetterConfig) SetTargetArn(v string) *AwsLambdaFunctionDeadLetterConfig { + s.TargetArn = &v + return s +} + +// Details about a function's configuration. +type AwsLambdaFunctionDetails struct { + _ struct{} `type:"structure"` + + // An AwsLambdaFunctionCode object. + Code *AwsLambdaFunctionCode `type:"structure"` + + // The SHA256 hash of the function's deployment package. + CodeSha256 *string `type:"string"` + + // The function's dead letter queue. + DeadLetterConfig *AwsLambdaFunctionDeadLetterConfig `type:"structure"` + + // The function's environment variables. + Environment *AwsLambdaFunctionEnvironment `type:"structure"` + + // The name of the function. + FunctionName *string `type:"string"` + + // The function that Lambda calls to begin executing your function. + Handler *string `type:"string"` + + // The KMS key that's used to encrypt the function's environment variables. + // This key is only returned if you've configured a customer managed CMK. + KmsKeyArn *string `type:"string"` + + // The date and time that the function was last updated, in ISO-8601 format + // (YYYY-MM-DDThh:mm:ss.sTZD). + LastModified *string `type:"string"` + + // The function's layers. + Layers []*AwsLambdaFunctionLayer `type:"list"` + + // For Lambda@Edge functions, the ARN of the master function. + MasterArn *string `type:"string"` + + // The memory that's allocated to the function. + MemorySize *int64 `type:"integer"` + + // The latest updated revision of the function or alias. + RevisionId *string `type:"string"` + + // The function's execution role. + Role *string `type:"string"` + + // The runtime environment for the Lambda function. + Runtime *string `type:"string"` + + // The amount of time that Lambda allows a function to run before stopping it. + Timeout *int64 `type:"integer"` + + // The function's AWS X-Ray tracing configuration. + TracingConfig *AwsLambdaFunctionTracingConfig `type:"structure"` + + // The version of the Lambda function. + Version *string `type:"string"` + + // The function's networking configuration. + VpcConfig *AwsLambdaFunctionVpcConfig `type:"structure"` +} + +// String returns the string representation +func (s AwsLambdaFunctionDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsLambdaFunctionDetails) GoString() string { + return s.String() +} + +// SetCode sets the Code field's value. +func (s *AwsLambdaFunctionDetails) SetCode(v *AwsLambdaFunctionCode) *AwsLambdaFunctionDetails { + s.Code = v + return s +} + +// SetCodeSha256 sets the CodeSha256 field's value. +func (s *AwsLambdaFunctionDetails) SetCodeSha256(v string) *AwsLambdaFunctionDetails { + s.CodeSha256 = &v + return s +} + +// SetDeadLetterConfig sets the DeadLetterConfig field's value. +func (s *AwsLambdaFunctionDetails) SetDeadLetterConfig(v *AwsLambdaFunctionDeadLetterConfig) *AwsLambdaFunctionDetails { + s.DeadLetterConfig = v + return s +} + +// SetEnvironment sets the Environment field's value. +func (s *AwsLambdaFunctionDetails) SetEnvironment(v *AwsLambdaFunctionEnvironment) *AwsLambdaFunctionDetails { + s.Environment = v + return s +} + +// SetFunctionName sets the FunctionName field's value. +func (s *AwsLambdaFunctionDetails) SetFunctionName(v string) *AwsLambdaFunctionDetails { + s.FunctionName = &v + return s +} + +// SetHandler sets the Handler field's value. +func (s *AwsLambdaFunctionDetails) SetHandler(v string) *AwsLambdaFunctionDetails { + s.Handler = &v + return s +} + +// SetKmsKeyArn sets the KmsKeyArn field's value. +func (s *AwsLambdaFunctionDetails) SetKmsKeyArn(v string) *AwsLambdaFunctionDetails { + s.KmsKeyArn = &v + return s +} - // The instance type of the instance. - Type *string `type:"string"` +// SetLastModified sets the LastModified field's value. +func (s *AwsLambdaFunctionDetails) SetLastModified(v string) *AwsLambdaFunctionDetails { + s.LastModified = &v + return s +} - // The identifier of the VPC that the instance was launched in. +// SetLayers sets the Layers field's value. +func (s *AwsLambdaFunctionDetails) SetLayers(v []*AwsLambdaFunctionLayer) *AwsLambdaFunctionDetails { + s.Layers = v + return s +} + +// SetMasterArn sets the MasterArn field's value. +func (s *AwsLambdaFunctionDetails) SetMasterArn(v string) *AwsLambdaFunctionDetails { + s.MasterArn = &v + return s +} + +// SetMemorySize sets the MemorySize field's value. +func (s *AwsLambdaFunctionDetails) SetMemorySize(v int64) *AwsLambdaFunctionDetails { + s.MemorySize = &v + return s +} + +// SetRevisionId sets the RevisionId field's value. +func (s *AwsLambdaFunctionDetails) SetRevisionId(v string) *AwsLambdaFunctionDetails { + s.RevisionId = &v + return s +} + +// SetRole sets the Role field's value. +func (s *AwsLambdaFunctionDetails) SetRole(v string) *AwsLambdaFunctionDetails { + s.Role = &v + return s +} + +// SetRuntime sets the Runtime field's value. +func (s *AwsLambdaFunctionDetails) SetRuntime(v string) *AwsLambdaFunctionDetails { + s.Runtime = &v + return s +} + +// SetTimeout sets the Timeout field's value. +func (s *AwsLambdaFunctionDetails) SetTimeout(v int64) *AwsLambdaFunctionDetails { + s.Timeout = &v + return s +} + +// SetTracingConfig sets the TracingConfig field's value. +func (s *AwsLambdaFunctionDetails) SetTracingConfig(v *AwsLambdaFunctionTracingConfig) *AwsLambdaFunctionDetails { + s.TracingConfig = v + return s +} + +// SetVersion sets the Version field's value. +func (s *AwsLambdaFunctionDetails) SetVersion(v string) *AwsLambdaFunctionDetails { + s.Version = &v + return s +} + +// SetVpcConfig sets the VpcConfig field's value. +func (s *AwsLambdaFunctionDetails) SetVpcConfig(v *AwsLambdaFunctionVpcConfig) *AwsLambdaFunctionDetails { + s.VpcConfig = v + return s +} + +// A function's environment variable settings. +type AwsLambdaFunctionEnvironment struct { + _ struct{} `type:"structure"` + + // An AwsLambdaFunctionEnvironmentError object. + Error *AwsLambdaFunctionEnvironmentError `type:"structure"` + + // Environment variable key-value pairs. + Variables map[string]*string `type:"map"` +} + +// String returns the string representation +func (s AwsLambdaFunctionEnvironment) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsLambdaFunctionEnvironment) GoString() string { + return s.String() +} + +// SetError sets the Error field's value. +func (s *AwsLambdaFunctionEnvironment) SetError(v *AwsLambdaFunctionEnvironmentError) *AwsLambdaFunctionEnvironment { + s.Error = v + return s +} + +// SetVariables sets the Variables field's value. +func (s *AwsLambdaFunctionEnvironment) SetVariables(v map[string]*string) *AwsLambdaFunctionEnvironment { + s.Variables = v + return s +} + +// Error messages for environment variables that couldn't be applied. +type AwsLambdaFunctionEnvironmentError struct { + _ struct{} `type:"structure"` + + // The error code. + ErrorCode *string `type:"string"` + + // The error message. + Message *string `type:"string"` +} + +// String returns the string representation +func (s AwsLambdaFunctionEnvironmentError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsLambdaFunctionEnvironmentError) GoString() string { + return s.String() +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *AwsLambdaFunctionEnvironmentError) SetErrorCode(v string) *AwsLambdaFunctionEnvironmentError { + s.ErrorCode = &v + return s +} + +// SetMessage sets the Message field's value. +func (s *AwsLambdaFunctionEnvironmentError) SetMessage(v string) *AwsLambdaFunctionEnvironmentError { + s.Message = &v + return s +} + +// An AWS Lambda layer. +type AwsLambdaFunctionLayer struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the function layer. + Arn *string `type:"string"` + + // The size of the layer archive in bytes. + CodeSize *int64 `type:"integer"` +} + +// String returns the string representation +func (s AwsLambdaFunctionLayer) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsLambdaFunctionLayer) GoString() string { + return s.String() +} + +// SetArn sets the Arn field's value. +func (s *AwsLambdaFunctionLayer) SetArn(v string) *AwsLambdaFunctionLayer { + s.Arn = &v + return s +} + +// SetCodeSize sets the CodeSize field's value. +func (s *AwsLambdaFunctionLayer) SetCodeSize(v int64) *AwsLambdaFunctionLayer { + s.CodeSize = &v + return s +} + +// The function's AWS X-Ray tracing configuration. +type AwsLambdaFunctionTracingConfig struct { + _ struct{} `type:"structure"` + + // The tracing mode. + Mode *string `type:"string"` +} + +// String returns the string representation +func (s AwsLambdaFunctionTracingConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsLambdaFunctionTracingConfig) GoString() string { + return s.String() +} + +// SetMode sets the Mode field's value. +func (s *AwsLambdaFunctionTracingConfig) SetMode(v string) *AwsLambdaFunctionTracingConfig { + s.Mode = &v + return s +} + +// The VPC security groups and subnets that are attached to a Lambda function. +// For more information, see VPC Settings. +type AwsLambdaFunctionVpcConfig struct { + _ struct{} `type:"structure"` + + // A list of VPC security groups IDs. + SecurityGroupIds []*string `type:"list"` + + // A list of VPC subnet IDs. + SubnetIds []*string `type:"list"` + + // The ID of the VPC. VpcId *string `type:"string"` } // String returns the string representation -func (s AwsEc2InstanceDetails) String() string { +func (s AwsLambdaFunctionVpcConfig) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AwsEc2InstanceDetails) GoString() string { +func (s AwsLambdaFunctionVpcConfig) GoString() string { return s.String() } -// SetIamInstanceProfileArn sets the IamInstanceProfileArn field's value. -func (s *AwsEc2InstanceDetails) SetIamInstanceProfileArn(v string) *AwsEc2InstanceDetails { - s.IamInstanceProfileArn = &v +// SetSecurityGroupIds sets the SecurityGroupIds field's value. +func (s *AwsLambdaFunctionVpcConfig) SetSecurityGroupIds(v []*string) *AwsLambdaFunctionVpcConfig { + s.SecurityGroupIds = v + return s +} + +// SetSubnetIds sets the SubnetIds field's value. +func (s *AwsLambdaFunctionVpcConfig) SetSubnetIds(v []*string) *AwsLambdaFunctionVpcConfig { + s.SubnetIds = v + return s +} + +// SetVpcId sets the VpcId field's value. +func (s *AwsLambdaFunctionVpcConfig) SetVpcId(v string) *AwsLambdaFunctionVpcConfig { + s.VpcId = &v + return s +} + +// Details about a Lambda layer version. +type AwsLambdaLayerVersionDetails struct { + _ struct{} `type:"structure"` + + // The layer's compatible runtimes. Maximum number of 5 items. + // + // Valid values: nodejs10.x | nodejs12.x | java8 | java11 | python2.7 | python3.6 + // | python3.7 | python3.8 | dotnetcore1.0 | dotnetcore2.1 | go1.x | ruby2.5 + // | provided + CompatibleRuntimes []*string `type:"list"` + + // The date that the version was created, in ISO 8601 format. For example, 2018-11-27T15:10:45.123+0000. + CreatedDate *string `type:"string"` + + // The version number. + Version *int64 `type:"long"` +} + +// String returns the string representation +func (s AwsLambdaLayerVersionDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsLambdaLayerVersionDetails) GoString() string { + return s.String() +} + +// SetCompatibleRuntimes sets the CompatibleRuntimes field's value. +func (s *AwsLambdaLayerVersionDetails) SetCompatibleRuntimes(v []*string) *AwsLambdaLayerVersionDetails { + s.CompatibleRuntimes = v + return s +} + +// SetCreatedDate sets the CreatedDate field's value. +func (s *AwsLambdaLayerVersionDetails) SetCreatedDate(v string) *AwsLambdaLayerVersionDetails { + s.CreatedDate = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *AwsLambdaLayerVersionDetails) SetVersion(v int64) *AwsLambdaLayerVersionDetails { + s.Version = &v + return s +} + +// An AWS Identity and Access Management (IAM) role associated with the DB instance. +type AwsRdsDbInstanceAssociatedRole struct { + _ struct{} `type:"structure"` + + // The name of the feature associated with the IAM)role. + FeatureName *string `type:"string"` + + // The Amazon Resource Name (ARN) of the IAM role that is associated with the + // DB instance. + RoleArn *string `type:"string"` + + // Describes the state of the association between the IAM role and the DB instance. + // The Status property returns one of the following values: + // + // * ACTIVE - the IAM role ARN is associated with the DB instance and can + // be used to access other AWS services on your behalf. + // + // * PENDING - the IAM role ARN is being associated with the DB instance. + // + // * INVALID - the IAM role ARN is associated with the DB instance, but the + // DB instance 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 AwsRdsDbInstanceAssociatedRole) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsRdsDbInstanceAssociatedRole) GoString() string { + return s.String() +} + +// SetFeatureName sets the FeatureName field's value. +func (s *AwsRdsDbInstanceAssociatedRole) SetFeatureName(v string) *AwsRdsDbInstanceAssociatedRole { + s.FeatureName = &v + return s +} + +// SetRoleArn sets the RoleArn field's value. +func (s *AwsRdsDbInstanceAssociatedRole) SetRoleArn(v string) *AwsRdsDbInstanceAssociatedRole { + s.RoleArn = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *AwsRdsDbInstanceAssociatedRole) SetStatus(v string) *AwsRdsDbInstanceAssociatedRole { + s.Status = &v + return s +} + +// Contains the details of an Amazon RDS DB instance. +type AwsRdsDbInstanceDetails struct { + _ struct{} `type:"structure"` + + // The AWS Identity and Access Management (IAM) roles associated with the DB + // instance. + AssociatedRoles []*AwsRdsDbInstanceAssociatedRole `type:"list"` + + // The identifier of the CA certificate for this DB instance. + CACertificateIdentifier *string `type:"string"` + + // 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"` + + // 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"` + + // The meaning of this parameter differs according to the database engine you + // use. + // + // MySQL, MariaDB, SQL Server, PostgreSQL + // + // 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. + // + // 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"` + + // 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 AWS Region-unique, immutable identifier for the DB instance. This identifier + // is found in AWS CloudTrail log entries whenever the AWS KMS key for the DB + // instance is accessed. + DbiResourceId *string `type:"string"` + + // Indicates whether the DB instance has deletion protection enabled. + // + // When deletion protection is enabled, the database cannot be deleted. + DeletionProtection *bool `type:"boolean"` + + // Specifies the connection endpoint. + Endpoint *AwsRdsDbInstanceEndpoint `type:"structure"` + + // Provides the name of the database engine to use for this DB instance. + Engine *string `type:"string"` + + // Indicates the database engine version. + EngineVersion *string `type:"string"` + + // True if mapping of AWS Identity and Access Management (IAM) accounts to database + // accounts is enabled, and otherwise false. + // + // IAM database authentication can be enabled for the following database engines. + // + // * For MySQL 5.6, minor version 5.6.34 or higher + // + // * For MySQL 5.7, minor version 5.7.16 or higher + // + // * Aurora 5.6 or higher + IAMDatabaseAuthenticationEnabled *bool `type:"boolean"` + + // Provides the date and time the DB instance was created. + InstanceCreateTime *string `type:"string"` + + // If StorageEncrypted is true, the AWS KMS key identifier for the encrypted + // DB instance. + KmsKeyId *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. + PubliclyAccessible *bool `type:"boolean"` + + // Specifies whether the DB instance is encrypted. + StorageEncrypted *bool `type:"boolean"` + + // The ARN from the key store with which the instance is associated for TDE + // encryption. + TdeCredentialArn *string `type:"string"` + + // A list of VPC security groups that the DB instance belongs to. + VpcSecurityGroups []*AwsRdsDbInstanceVpcSecurityGroup `type:"list"` +} + +// String returns the string representation +func (s AwsRdsDbInstanceDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsRdsDbInstanceDetails) GoString() string { + return s.String() +} + +// SetAssociatedRoles sets the AssociatedRoles field's value. +func (s *AwsRdsDbInstanceDetails) SetAssociatedRoles(v []*AwsRdsDbInstanceAssociatedRole) *AwsRdsDbInstanceDetails { + s.AssociatedRoles = v + return s +} + +// SetCACertificateIdentifier sets the CACertificateIdentifier field's value. +func (s *AwsRdsDbInstanceDetails) SetCACertificateIdentifier(v string) *AwsRdsDbInstanceDetails { + s.CACertificateIdentifier = &v + return s +} + +// SetDBClusterIdentifier sets the DBClusterIdentifier field's value. +func (s *AwsRdsDbInstanceDetails) SetDBClusterIdentifier(v string) *AwsRdsDbInstanceDetails { + s.DBClusterIdentifier = &v + return s +} + +// SetDBInstanceClass sets the DBInstanceClass field's value. +func (s *AwsRdsDbInstanceDetails) SetDBInstanceClass(v string) *AwsRdsDbInstanceDetails { + s.DBInstanceClass = &v + return s +} + +// SetDBInstanceIdentifier sets the DBInstanceIdentifier field's value. +func (s *AwsRdsDbInstanceDetails) SetDBInstanceIdentifier(v string) *AwsRdsDbInstanceDetails { + s.DBInstanceIdentifier = &v + return s +} + +// SetDBName sets the DBName field's value. +func (s *AwsRdsDbInstanceDetails) SetDBName(v string) *AwsRdsDbInstanceDetails { + s.DBName = &v + return s +} + +// SetDbInstancePort sets the DbInstancePort field's value. +func (s *AwsRdsDbInstanceDetails) SetDbInstancePort(v int64) *AwsRdsDbInstanceDetails { + s.DbInstancePort = &v + return s +} + +// SetDbiResourceId sets the DbiResourceId field's value. +func (s *AwsRdsDbInstanceDetails) SetDbiResourceId(v string) *AwsRdsDbInstanceDetails { + s.DbiResourceId = &v + return s +} + +// SetDeletionProtection sets the DeletionProtection field's value. +func (s *AwsRdsDbInstanceDetails) SetDeletionProtection(v bool) *AwsRdsDbInstanceDetails { + s.DeletionProtection = &v + return s +} + +// SetEndpoint sets the Endpoint field's value. +func (s *AwsRdsDbInstanceDetails) SetEndpoint(v *AwsRdsDbInstanceEndpoint) *AwsRdsDbInstanceDetails { + s.Endpoint = v + return s +} + +// SetEngine sets the Engine field's value. +func (s *AwsRdsDbInstanceDetails) SetEngine(v string) *AwsRdsDbInstanceDetails { + s.Engine = &v return s } -// SetImageId sets the ImageId field's value. -func (s *AwsEc2InstanceDetails) SetImageId(v string) *AwsEc2InstanceDetails { - s.ImageId = &v +// SetEngineVersion sets the EngineVersion field's value. +func (s *AwsRdsDbInstanceDetails) SetEngineVersion(v string) *AwsRdsDbInstanceDetails { + s.EngineVersion = &v return s } -// SetIpV4Addresses sets the IpV4Addresses field's value. -func (s *AwsEc2InstanceDetails) SetIpV4Addresses(v []*string) *AwsEc2InstanceDetails { - s.IpV4Addresses = v +// SetIAMDatabaseAuthenticationEnabled sets the IAMDatabaseAuthenticationEnabled field's value. +func (s *AwsRdsDbInstanceDetails) SetIAMDatabaseAuthenticationEnabled(v bool) *AwsRdsDbInstanceDetails { + s.IAMDatabaseAuthenticationEnabled = &v return s } -// SetIpV6Addresses sets the IpV6Addresses field's value. -func (s *AwsEc2InstanceDetails) SetIpV6Addresses(v []*string) *AwsEc2InstanceDetails { - s.IpV6Addresses = v +// SetInstanceCreateTime sets the InstanceCreateTime field's value. +func (s *AwsRdsDbInstanceDetails) SetInstanceCreateTime(v string) *AwsRdsDbInstanceDetails { + s.InstanceCreateTime = &v return s } -// SetKeyName sets the KeyName field's value. -func (s *AwsEc2InstanceDetails) SetKeyName(v string) *AwsEc2InstanceDetails { - s.KeyName = &v +// SetKmsKeyId sets the KmsKeyId field's value. +func (s *AwsRdsDbInstanceDetails) SetKmsKeyId(v string) *AwsRdsDbInstanceDetails { + s.KmsKeyId = &v return s } -// SetLaunchedAt sets the LaunchedAt field's value. -func (s *AwsEc2InstanceDetails) SetLaunchedAt(v string) *AwsEc2InstanceDetails { - s.LaunchedAt = &v +// SetPubliclyAccessible sets the PubliclyAccessible field's value. +func (s *AwsRdsDbInstanceDetails) SetPubliclyAccessible(v bool) *AwsRdsDbInstanceDetails { + s.PubliclyAccessible = &v return s } -// SetSubnetId sets the SubnetId field's value. -func (s *AwsEc2InstanceDetails) SetSubnetId(v string) *AwsEc2InstanceDetails { - s.SubnetId = &v +// SetStorageEncrypted sets the StorageEncrypted field's value. +func (s *AwsRdsDbInstanceDetails) SetStorageEncrypted(v bool) *AwsRdsDbInstanceDetails { + s.StorageEncrypted = &v return s } -// SetType sets the Type field's value. -func (s *AwsEc2InstanceDetails) SetType(v string) *AwsEc2InstanceDetails { - s.Type = &v +// SetTdeCredentialArn sets the TdeCredentialArn field's value. +func (s *AwsRdsDbInstanceDetails) SetTdeCredentialArn(v string) *AwsRdsDbInstanceDetails { + s.TdeCredentialArn = &v return s } -// SetVpcId sets the VpcId field's value. -func (s *AwsEc2InstanceDetails) SetVpcId(v string) *AwsEc2InstanceDetails { - s.VpcId = &v +// SetVpcSecurityGroups sets the VpcSecurityGroups field's value. +func (s *AwsRdsDbInstanceDetails) SetVpcSecurityGroups(v []*AwsRdsDbInstanceVpcSecurityGroup) *AwsRdsDbInstanceDetails { + s.VpcSecurityGroups = v return s } -// IAM access key details related to a finding. -type AwsIamAccessKeyDetails struct { +// Specifies the connection endpoint. +type AwsRdsDbInstanceEndpoint struct { _ struct{} `type:"structure"` - // The creation date/time of the IAM access key related to a finding. - CreatedAt *string `type:"string"` + // Specifies the DNS address of the DB instance. + Address *string `type:"string"` - // The status of the IAM access key related to a finding. - Status *string `type:"string" enum:"AwsIamAccessKeyStatus"` + // Specifies the ID that Amazon Route 53 assigns when you create a hosted zone. + HostedZoneId *string `type:"string"` - // The user associated with the IAM access key related to a finding. - UserName *string `type:"string"` + // Specifies the port that the database engine is listening on. + Port *int64 `type:"integer"` } // String returns the string representation -func (s AwsIamAccessKeyDetails) String() string { +func (s AwsRdsDbInstanceEndpoint) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AwsIamAccessKeyDetails) GoString() string { +func (s AwsRdsDbInstanceEndpoint) GoString() string { return s.String() } -// SetCreatedAt sets the CreatedAt field's value. -func (s *AwsIamAccessKeyDetails) SetCreatedAt(v string) *AwsIamAccessKeyDetails { - s.CreatedAt = &v +// SetAddress sets the Address field's value. +func (s *AwsRdsDbInstanceEndpoint) SetAddress(v string) *AwsRdsDbInstanceEndpoint { + s.Address = &v + return s +} + +// SetHostedZoneId sets the HostedZoneId field's value. +func (s *AwsRdsDbInstanceEndpoint) SetHostedZoneId(v string) *AwsRdsDbInstanceEndpoint { + s.HostedZoneId = &v return s } +// SetPort sets the Port field's value. +func (s *AwsRdsDbInstanceEndpoint) SetPort(v int64) *AwsRdsDbInstanceEndpoint { + s.Port = &v + return s +} + +// A VPC security groups that the DB instance belongs to. +type AwsRdsDbInstanceVpcSecurityGroup 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 AwsRdsDbInstanceVpcSecurityGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsRdsDbInstanceVpcSecurityGroup) GoString() string { + return s.String() +} + // SetStatus sets the Status field's value. -func (s *AwsIamAccessKeyDetails) SetStatus(v string) *AwsIamAccessKeyDetails { +func (s *AwsRdsDbInstanceVpcSecurityGroup) SetStatus(v string) *AwsRdsDbInstanceVpcSecurityGroup { s.Status = &v return s } -// SetUserName sets the UserName field's value. -func (s *AwsIamAccessKeyDetails) SetUserName(v string) *AwsIamAccessKeyDetails { - s.UserName = &v +// SetVpcSecurityGroupId sets the VpcSecurityGroupId field's value. +func (s *AwsRdsDbInstanceVpcSecurityGroup) SetVpcSecurityGroupId(v string) *AwsRdsDbInstanceVpcSecurityGroup { + s.VpcSecurityGroupId = &v return s } @@ -4150,11 +7242,11 @@ func (s *AwsS3BucketDetails) SetOwnerName(v string) *AwsS3BucketDetails { // Provides consistent format for the contents of the Security Hub-aggregated // findings. AwsSecurityFinding format enables you to share findings between -// AWS security services and third-party solutions, and compliance checks. +// AWS security services and third-party solutions, and security standards checks. // // A finding is a potential security issue generated either by AWS services // (Amazon GuardDuty, Amazon Inspector, and Amazon Macie) or by the integrated -// third-party solutions and compliance checks. +// third-party solutions and standards checks. type AwsSecurityFinding struct { _ struct{} `type:"structure"` @@ -4164,12 +7256,13 @@ type AwsSecurityFinding struct { AwsAccountId *string `type:"string" required:"true"` // This data type is exclusive to findings that are generated as the result - // of a check run against a specific rule in a supported standard (for example, - // CIS AWS Foundations). Contains compliance-related finding details. + // of a check run against a specific rule in a supported security standard, + // such as CIS AWS Foundations. Contains security standard-related finding details. Compliance *Compliance `type:"structure"` // A finding's confidence. Confidence is defined as the likelihood that a finding // accurately identifies the behavior or issue that it was intended to identify. + // // Confidence is scored on a 0-100 basis using a ratio scale, where 0 means // zero percent confidence and 100 means 100 percent confidence. Confidence *int64 `type:"integer"` @@ -4181,6 +7274,7 @@ type AwsSecurityFinding struct { CreatedAt *string `type:"string" required:"true"` // The level of importance assigned to the resources associated with the finding. + // // A score of 0 means that the underlying resources have no criticality, and // a score of 100 is reserved for the most critical resources. Criticality *int64 `type:"integer"` @@ -4265,7 +7359,7 @@ type AwsSecurityFinding struct { // provider's solution. SourceUrl *string `type:"string"` - // Threat intel details related to a finding. + // Threat intelligence details related to a finding. ThreatIntelIndicators []*ThreatIntelIndicator `type:"list"` // A finding's title. @@ -4591,12 +7685,13 @@ type AwsSecurityFindingFilters struct { CompanyName []*StringFilter `type:"list"` // Exclusive to findings that are generated as the result of a check run against - // a specific rule in a supported standard (for example, CIS AWS Foundations). - // Contains compliance-related finding details. + // a specific rule in a supported standard, such as CIS AWS Foundations. Contains + // security standard-related finding details. ComplianceStatus []*StringFilter `type:"list"` // A finding's confidence. Confidence is defined as the likelihood that a finding // accurately identifies the behavior or issue that it was intended to identify. + // // Confidence is scored on a 0-100 basis using a ratio scale, where 0 means // zero percent confidence and 100 means 100 percent confidence. Confidence []*NumberFilter `type:"list"` @@ -4606,6 +7701,7 @@ type AwsSecurityFindingFilters struct { CreatedAt []*DateFilter `type:"list"` // The level of importance assigned to the resources associated with the finding. + // // A score of 0 means that the underlying resources have no criticality, and // a score of 100 is reserved for the most critical resources. Criticality []*NumberFilter `type:"list"` @@ -4745,7 +7841,7 @@ type AwsSecurityFindingFilters struct { // The key name associated with the instance. ResourceAwsEc2InstanceKeyName []*StringFilter `type:"list"` - // The date/time the instance was launched. + // The date and time the instance was launched. ResourceAwsEc2InstanceLaunchedAt []*DateFilter `type:"list"` // The identifier of the subnet that the instance was launched in. @@ -4818,22 +7914,22 @@ type AwsSecurityFindingFilters struct { // provider's solution. SourceUrl []*StringFilter `type:"list"` - // The category of a threat intel indicator. + // The category of a threat intelligence indicator. ThreatIntelIndicatorCategory []*StringFilter `type:"list"` - // The date/time of the last observation of a threat intel indicator. + // The date/time of the last observation of a threat intelligence indicator. ThreatIntelIndicatorLastObservedAt []*DateFilter `type:"list"` - // The source of the threat intel. + // The source of the threat intelligence. ThreatIntelIndicatorSource []*StringFilter `type:"list"` - // The URL for more details from the source of the threat intel. + // The URL for more details from the source of the threat intelligence. ThreatIntelIndicatorSourceUrl []*StringFilter `type:"list"` - // The type of a threat intel indicator. + // The type of a threat intelligence indicator. ThreatIntelIndicatorType []*StringFilter `type:"list"` - // The value of a threat intel indicator. + // The value of a threat intelligence indicator. ThreatIntelIndicatorValue []*StringFilter `type:"list"` // A finding's title. @@ -5228,141 +8324,424 @@ func (s *AwsSecurityFindingFilters) SetResourceContainerLaunchedAt(v []*DateFilt return s } -// SetResourceContainerName sets the ResourceContainerName field's value. -func (s *AwsSecurityFindingFilters) SetResourceContainerName(v []*StringFilter) *AwsSecurityFindingFilters { - s.ResourceContainerName = v - return s +// SetResourceContainerName sets the ResourceContainerName field's value. +func (s *AwsSecurityFindingFilters) SetResourceContainerName(v []*StringFilter) *AwsSecurityFindingFilters { + s.ResourceContainerName = v + return s +} + +// SetResourceDetailsOther sets the ResourceDetailsOther field's value. +func (s *AwsSecurityFindingFilters) SetResourceDetailsOther(v []*MapFilter) *AwsSecurityFindingFilters { + s.ResourceDetailsOther = v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *AwsSecurityFindingFilters) SetResourceId(v []*StringFilter) *AwsSecurityFindingFilters { + s.ResourceId = v + return s +} + +// SetResourcePartition sets the ResourcePartition field's value. +func (s *AwsSecurityFindingFilters) SetResourcePartition(v []*StringFilter) *AwsSecurityFindingFilters { + s.ResourcePartition = v + return s +} + +// SetResourceRegion sets the ResourceRegion field's value. +func (s *AwsSecurityFindingFilters) SetResourceRegion(v []*StringFilter) *AwsSecurityFindingFilters { + s.ResourceRegion = v + return s +} + +// SetResourceTags sets the ResourceTags field's value. +func (s *AwsSecurityFindingFilters) SetResourceTags(v []*MapFilter) *AwsSecurityFindingFilters { + s.ResourceTags = v + return s +} + +// SetResourceType sets the ResourceType field's value. +func (s *AwsSecurityFindingFilters) SetResourceType(v []*StringFilter) *AwsSecurityFindingFilters { + s.ResourceType = v + return s +} + +// SetSeverityLabel sets the SeverityLabel field's value. +func (s *AwsSecurityFindingFilters) SetSeverityLabel(v []*StringFilter) *AwsSecurityFindingFilters { + s.SeverityLabel = v + return s +} + +// SetSeverityNormalized sets the SeverityNormalized field's value. +func (s *AwsSecurityFindingFilters) SetSeverityNormalized(v []*NumberFilter) *AwsSecurityFindingFilters { + s.SeverityNormalized = v + return s +} + +// SetSeverityProduct sets the SeverityProduct field's value. +func (s *AwsSecurityFindingFilters) SetSeverityProduct(v []*NumberFilter) *AwsSecurityFindingFilters { + s.SeverityProduct = v + return s +} + +// SetSourceUrl sets the SourceUrl field's value. +func (s *AwsSecurityFindingFilters) SetSourceUrl(v []*StringFilter) *AwsSecurityFindingFilters { + s.SourceUrl = v + return s +} + +// SetThreatIntelIndicatorCategory sets the ThreatIntelIndicatorCategory field's value. +func (s *AwsSecurityFindingFilters) SetThreatIntelIndicatorCategory(v []*StringFilter) *AwsSecurityFindingFilters { + s.ThreatIntelIndicatorCategory = v + return s +} + +// SetThreatIntelIndicatorLastObservedAt sets the ThreatIntelIndicatorLastObservedAt field's value. +func (s *AwsSecurityFindingFilters) SetThreatIntelIndicatorLastObservedAt(v []*DateFilter) *AwsSecurityFindingFilters { + s.ThreatIntelIndicatorLastObservedAt = v + return s +} + +// SetThreatIntelIndicatorSource sets the ThreatIntelIndicatorSource field's value. +func (s *AwsSecurityFindingFilters) SetThreatIntelIndicatorSource(v []*StringFilter) *AwsSecurityFindingFilters { + s.ThreatIntelIndicatorSource = v + return s +} + +// SetThreatIntelIndicatorSourceUrl sets the ThreatIntelIndicatorSourceUrl field's value. +func (s *AwsSecurityFindingFilters) SetThreatIntelIndicatorSourceUrl(v []*StringFilter) *AwsSecurityFindingFilters { + s.ThreatIntelIndicatorSourceUrl = v + return s +} + +// SetThreatIntelIndicatorType sets the ThreatIntelIndicatorType field's value. +func (s *AwsSecurityFindingFilters) SetThreatIntelIndicatorType(v []*StringFilter) *AwsSecurityFindingFilters { + s.ThreatIntelIndicatorType = v + return s +} + +// SetThreatIntelIndicatorValue sets the ThreatIntelIndicatorValue field's value. +func (s *AwsSecurityFindingFilters) SetThreatIntelIndicatorValue(v []*StringFilter) *AwsSecurityFindingFilters { + s.ThreatIntelIndicatorValue = v + return s +} + +// SetTitle sets the Title field's value. +func (s *AwsSecurityFindingFilters) SetTitle(v []*StringFilter) *AwsSecurityFindingFilters { + s.Title = v + return s +} + +// SetType sets the Type field's value. +func (s *AwsSecurityFindingFilters) SetType(v []*StringFilter) *AwsSecurityFindingFilters { + s.Type = v + return s +} + +// SetUpdatedAt sets the UpdatedAt field's value. +func (s *AwsSecurityFindingFilters) SetUpdatedAt(v []*DateFilter) *AwsSecurityFindingFilters { + s.UpdatedAt = v + return s +} + +// SetUserDefinedFields sets the UserDefinedFields field's value. +func (s *AwsSecurityFindingFilters) SetUserDefinedFields(v []*MapFilter) *AwsSecurityFindingFilters { + s.UserDefinedFields = v + return s +} + +// SetVerificationState sets the VerificationState field's value. +func (s *AwsSecurityFindingFilters) SetVerificationState(v []*StringFilter) *AwsSecurityFindingFilters { + s.VerificationState = v + return s +} + +// SetWorkflowState sets the WorkflowState field's value. +func (s *AwsSecurityFindingFilters) SetWorkflowState(v []*StringFilter) *AwsSecurityFindingFilters { + s.WorkflowState = v + return s +} + +// A wrapper type for the topic's Amazon Resource Name (ARN). +type AwsSnsTopicDetails struct { + _ struct{} `type:"structure"` + + // The ID of an AWS-managed customer master key (CMK) for Amazon SNS or a custom + // CMK. + KmsMasterKeyId *string `type:"string"` + + // The subscription's owner. + Owner *string `type:"string"` + + // Subscription is an embedded property that describes the subscription endpoints + // of an Amazon SNS topic. + Subscription []*AwsSnsTopicSubscription `type:"list"` + + // The name of the topic. + TopicName *string `type:"string"` +} + +// String returns the string representation +func (s AwsSnsTopicDetails) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsSnsTopicDetails) GoString() string { + return s.String() +} + +// SetKmsMasterKeyId sets the KmsMasterKeyId field's value. +func (s *AwsSnsTopicDetails) SetKmsMasterKeyId(v string) *AwsSnsTopicDetails { + s.KmsMasterKeyId = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *AwsSnsTopicDetails) SetOwner(v string) *AwsSnsTopicDetails { + s.Owner = &v + return s +} + +// SetSubscription sets the Subscription field's value. +func (s *AwsSnsTopicDetails) SetSubscription(v []*AwsSnsTopicSubscription) *AwsSnsTopicDetails { + s.Subscription = v + return s +} + +// SetTopicName sets the TopicName field's value. +func (s *AwsSnsTopicDetails) SetTopicName(v string) *AwsSnsTopicDetails { + s.TopicName = &v + return s +} + +// A wrapper type for the attributes of an Amazon SNS subscription. +type AwsSnsTopicSubscription struct { + _ struct{} `type:"structure"` + + // The subscription's endpoint (format depends on the protocol). + Endpoint *string `type:"string"` + + // The subscription's protocol. + Protocol *string `type:"string"` +} + +// String returns the string representation +func (s AwsSnsTopicSubscription) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AwsSnsTopicSubscription) GoString() string { + return s.String() +} + +// SetEndpoint sets the Endpoint field's value. +func (s *AwsSnsTopicSubscription) SetEndpoint(v string) *AwsSnsTopicSubscription { + s.Endpoint = &v + return s +} + +// SetProtocol sets the Protocol field's value. +func (s *AwsSnsTopicSubscription) SetProtocol(v string) *AwsSnsTopicSubscription { + s.Protocol = &v + return s +} + +// Data about a queue. +type AwsSqsQueueDetails struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the dead-letter queue to which Amazon SQS + // moves messages after the value of maxReceiveCount is exceeded. + DeadLetterTargetArn *string `type:"string"` + + // The length of time, in seconds, for which Amazon SQS can reuse a data key + // to encrypt or decrypt messages before calling AWS KMS again. + KmsDataKeyReusePeriodSeconds *int64 `type:"integer"` + + // The ID of an AWS-managed customer master key (CMK) for Amazon SQS or a custom + // CMK. + KmsMasterKeyId *string `type:"string"` + + // The name of the new queue. + QueueName *string `type:"string"` } -// SetResourceDetailsOther sets the ResourceDetailsOther field's value. -func (s *AwsSecurityFindingFilters) SetResourceDetailsOther(v []*MapFilter) *AwsSecurityFindingFilters { - s.ResourceDetailsOther = v - return s +// String returns the string representation +func (s AwsSqsQueueDetails) String() string { + return awsutil.Prettify(s) } -// SetResourceId sets the ResourceId field's value. -func (s *AwsSecurityFindingFilters) SetResourceId(v []*StringFilter) *AwsSecurityFindingFilters { - s.ResourceId = v - return s +// GoString returns the string representation +func (s AwsSqsQueueDetails) GoString() string { + return s.String() } -// SetResourcePartition sets the ResourcePartition field's value. -func (s *AwsSecurityFindingFilters) SetResourcePartition(v []*StringFilter) *AwsSecurityFindingFilters { - s.ResourcePartition = v +// SetDeadLetterTargetArn sets the DeadLetterTargetArn field's value. +func (s *AwsSqsQueueDetails) SetDeadLetterTargetArn(v string) *AwsSqsQueueDetails { + s.DeadLetterTargetArn = &v return s } -// SetResourceRegion sets the ResourceRegion field's value. -func (s *AwsSecurityFindingFilters) SetResourceRegion(v []*StringFilter) *AwsSecurityFindingFilters { - s.ResourceRegion = v +// SetKmsDataKeyReusePeriodSeconds sets the KmsDataKeyReusePeriodSeconds field's value. +func (s *AwsSqsQueueDetails) SetKmsDataKeyReusePeriodSeconds(v int64) *AwsSqsQueueDetails { + s.KmsDataKeyReusePeriodSeconds = &v return s } -// SetResourceTags sets the ResourceTags field's value. -func (s *AwsSecurityFindingFilters) SetResourceTags(v []*MapFilter) *AwsSecurityFindingFilters { - s.ResourceTags = v +// SetKmsMasterKeyId sets the KmsMasterKeyId field's value. +func (s *AwsSqsQueueDetails) SetKmsMasterKeyId(v string) *AwsSqsQueueDetails { + s.KmsMasterKeyId = &v return s } -// SetResourceType sets the ResourceType field's value. -func (s *AwsSecurityFindingFilters) SetResourceType(v []*StringFilter) *AwsSecurityFindingFilters { - s.ResourceType = v +// SetQueueName sets the QueueName field's value. +func (s *AwsSqsQueueDetails) SetQueueName(v string) *AwsSqsQueueDetails { + s.QueueName = &v return s } -// SetSeverityLabel sets the SeverityLabel field's value. -func (s *AwsSecurityFindingFilters) SetSeverityLabel(v []*StringFilter) *AwsSecurityFindingFilters { - s.SeverityLabel = v - return s +// Details about a WAF WebACL. +type AwsWafWebAclDetails struct { + _ struct{} `type:"structure"` + + // The action to perform if none of the Rules contained in the WebACL match. + DefaultAction *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 `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 []*AwsWafWebAclRule `type:"list"` + + // A unique identifier for a WebACL. + WebAclId *string `type:"string"` } -// SetSeverityNormalized sets the SeverityNormalized field's value. -func (s *AwsSecurityFindingFilters) SetSeverityNormalized(v []*NumberFilter) *AwsSecurityFindingFilters { - s.SeverityNormalized = v - return s +// String returns the string representation +func (s AwsWafWebAclDetails) String() string { + return awsutil.Prettify(s) } -// SetSeverityProduct sets the SeverityProduct field's value. -func (s *AwsSecurityFindingFilters) SetSeverityProduct(v []*NumberFilter) *AwsSecurityFindingFilters { - s.SeverityProduct = v - return s +// GoString returns the string representation +func (s AwsWafWebAclDetails) GoString() string { + return s.String() } -// SetSourceUrl sets the SourceUrl field's value. -func (s *AwsSecurityFindingFilters) SetSourceUrl(v []*StringFilter) *AwsSecurityFindingFilters { - s.SourceUrl = v +// SetDefaultAction sets the DefaultAction field's value. +func (s *AwsWafWebAclDetails) SetDefaultAction(v string) *AwsWafWebAclDetails { + s.DefaultAction = &v return s } -// SetThreatIntelIndicatorCategory sets the ThreatIntelIndicatorCategory field's value. -func (s *AwsSecurityFindingFilters) SetThreatIntelIndicatorCategory(v []*StringFilter) *AwsSecurityFindingFilters { - s.ThreatIntelIndicatorCategory = v +// SetName sets the Name field's value. +func (s *AwsWafWebAclDetails) SetName(v string) *AwsWafWebAclDetails { + s.Name = &v return s } -// SetThreatIntelIndicatorLastObservedAt sets the ThreatIntelIndicatorLastObservedAt field's value. -func (s *AwsSecurityFindingFilters) SetThreatIntelIndicatorLastObservedAt(v []*DateFilter) *AwsSecurityFindingFilters { - s.ThreatIntelIndicatorLastObservedAt = v +// SetRules sets the Rules field's value. +func (s *AwsWafWebAclDetails) SetRules(v []*AwsWafWebAclRule) *AwsWafWebAclDetails { + s.Rules = v return s } -// SetThreatIntelIndicatorSource sets the ThreatIntelIndicatorSource field's value. -func (s *AwsSecurityFindingFilters) SetThreatIntelIndicatorSource(v []*StringFilter) *AwsSecurityFindingFilters { - s.ThreatIntelIndicatorSource = v +// SetWebAclId sets the WebAclId field's value. +func (s *AwsWafWebAclDetails) SetWebAclId(v string) *AwsWafWebAclDetails { + s.WebAclId = &v return s } -// SetThreatIntelIndicatorSourceUrl sets the ThreatIntelIndicatorSourceUrl field's value. -func (s *AwsSecurityFindingFilters) SetThreatIntelIndicatorSourceUrl(v []*StringFilter) *AwsSecurityFindingFilters { - s.ThreatIntelIndicatorSourceUrl = v - return s +// Details for a rule in a WAF WebACL. +type AwsWafWebAclRule struct { + _ struct{} `type:"structure"` + + // Specifies the action that CloudFront or AWS WAF takes when a web request + // matches the conditions in the Rule. + Action *WafAction `type:"structure"` + + // Rules to exclude from a rule group. + ExcludedRules []*WafExcludedRule `type:"list"` + + // Use the OverrideAction to test your RuleGroup. + // + // Any rule in a RuleGroup can potentially block a request. If you set the OverrideAction + // to None, the RuleGroup blocks a request if any individual rule in the RuleGroup + // matches the request and is configured to block that request. + // + // However, if you first want to test the RuleGroup, set the OverrideAction + // to Count. The RuleGroup then overrides any block action specified by individual + // rules contained within the group. Instead of blocking matching requests, + // those requests are counted. + // + // ActivatedRule|OverrideAction applies only when updating or adding a RuleGroup + // to a WebACL. In this case you do not use ActivatedRule|Action. For all other + // update requests, ActivatedRule|Action is used instead of ActivatedRule|OverrideAction. + OverrideAction *WafOverrideAction `type:"structure"` + + // 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 do not need to be consecutive. + Priority *int64 `type:"integer"` + + // The identifier for a Rule. + RuleId *string `type:"string"` + + // The rule type. + // + // Valid values: REGULAR | RATE_BASED | GROUP + // + // The default is REGULAR. + Type *string `type:"string"` } -// SetThreatIntelIndicatorType sets the ThreatIntelIndicatorType field's value. -func (s *AwsSecurityFindingFilters) SetThreatIntelIndicatorType(v []*StringFilter) *AwsSecurityFindingFilters { - s.ThreatIntelIndicatorType = v - return s +// String returns the string representation +func (s AwsWafWebAclRule) String() string { + return awsutil.Prettify(s) } -// SetThreatIntelIndicatorValue sets the ThreatIntelIndicatorValue field's value. -func (s *AwsSecurityFindingFilters) SetThreatIntelIndicatorValue(v []*StringFilter) *AwsSecurityFindingFilters { - s.ThreatIntelIndicatorValue = v - return s +// GoString returns the string representation +func (s AwsWafWebAclRule) GoString() string { + return s.String() } -// SetTitle sets the Title field's value. -func (s *AwsSecurityFindingFilters) SetTitle(v []*StringFilter) *AwsSecurityFindingFilters { - s.Title = v +// SetAction sets the Action field's value. +func (s *AwsWafWebAclRule) SetAction(v *WafAction) *AwsWafWebAclRule { + s.Action = v return s } -// SetType sets the Type field's value. -func (s *AwsSecurityFindingFilters) SetType(v []*StringFilter) *AwsSecurityFindingFilters { - s.Type = v +// SetExcludedRules sets the ExcludedRules field's value. +func (s *AwsWafWebAclRule) SetExcludedRules(v []*WafExcludedRule) *AwsWafWebAclRule { + s.ExcludedRules = v return s } -// SetUpdatedAt sets the UpdatedAt field's value. -func (s *AwsSecurityFindingFilters) SetUpdatedAt(v []*DateFilter) *AwsSecurityFindingFilters { - s.UpdatedAt = v +// SetOverrideAction sets the OverrideAction field's value. +func (s *AwsWafWebAclRule) SetOverrideAction(v *WafOverrideAction) *AwsWafWebAclRule { + s.OverrideAction = v return s } -// SetUserDefinedFields sets the UserDefinedFields field's value. -func (s *AwsSecurityFindingFilters) SetUserDefinedFields(v []*MapFilter) *AwsSecurityFindingFilters { - s.UserDefinedFields = v +// SetPriority sets the Priority field's value. +func (s *AwsWafWebAclRule) SetPriority(v int64) *AwsWafWebAclRule { + s.Priority = &v return s } -// SetVerificationState sets the VerificationState field's value. -func (s *AwsSecurityFindingFilters) SetVerificationState(v []*StringFilter) *AwsSecurityFindingFilters { - s.VerificationState = v +// SetRuleId sets the RuleId field's value. +func (s *AwsWafWebAclRule) SetRuleId(v string) *AwsWafWebAclRule { + s.RuleId = &v return s } -// SetWorkflowState sets the WorkflowState field's value. -func (s *AwsSecurityFindingFilters) SetWorkflowState(v []*StringFilter) *AwsSecurityFindingFilters { - s.WorkflowState = v +// SetType sets the Type field's value. +func (s *AwsWafWebAclRule) SetType(v string) *AwsWafWebAclRule { + s.Type = &v return s } @@ -5433,11 +8812,7 @@ func (s *BatchDisableStandardsOutput) SetStandardsSubscriptions(v []*StandardsSu type BatchEnableStandardsInput struct { _ struct{} `type:"structure"` - // The list of standards compliance checks to enable. - // - // In this release, Security Hub supports only the CIS AWS Foundations standard. - // - // The ARN for the standard is arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0. + // The list of standards checks to enable. // // StandardsSubscriptionRequests is a required field StandardsSubscriptionRequests []*StandardsSubscriptionRequest `min:"1" type:"list" required:"true"` @@ -5513,6 +8888,7 @@ type BatchImportFindingsInput struct { // A list of findings to import. To successfully import a finding, it must follow // the AWS Security Finding Format (https://docs.aws.amazon.com/securityhub/latest/userguide/securityhub-findings-format.html). + // Maximum of 100 findings per request. // // Findings is a required field Findings []*AwsSecurityFinding `type:"list" required:"true"` @@ -5565,7 +8941,7 @@ type BatchImportFindingsOutput struct { // FailedCount is a required field FailedCount *int64 `type:"integer" required:"true"` - // The list of the findings that failed to import. + // The list of findings that failed to import. FailedFindings []*ImportFindingsError `type:"list"` // The number of findings that were successfully imported. @@ -5603,12 +8979,26 @@ func (s *BatchImportFindingsOutput) SetSuccessCount(v int64) *BatchImportFinding } // Exclusive to findings that are generated as the result of a check run against -// a specific rule in a supported standard (for example, CIS AWS Foundations). -// Contains compliance-related finding details. +// a specific rule in a supported security standard, such as CIS AWS Foundations. +// Contains security standard-related finding details. +// +// Values include the following: +// +// * Allowed values are the following: PASSED - Standards check passed for +// all evaluated resources. WARNING - Some information is missing or this +// check is not supported given your configuration. FAILED - Standards check +// failed for at least one evaluated resource. NOT_AVAILABLE - Check could +// not be performed due to a service outage, API error, or because the result +// of the AWS Config evaluation was NOT_APPLICABLE. If the AWS Config evaluation +// result was NOT_APPLICABLE, then after 3 days, Security Hub automatically +// archives the finding. type Compliance struct { _ struct{} `type:"structure"` - // The result of a compliance check. + // List of requirements that are related to a standards control. + RelatedRequirements []*string `type:"list"` + + // The result of a standards check. Status *string `type:"string" enum:"ComplianceStatus"` } @@ -5622,6 +9012,12 @@ func (s Compliance) GoString() string { return s.String() } +// SetRelatedRequirements sets the RelatedRequirements field's value. +func (s *Compliance) SetRelatedRequirements(v []*string) *Compliance { + s.RelatedRequirements = v + return s +} + // SetStatus sets the Status field's value. func (s *Compliance) SetStatus(v string) *Compliance { s.Status = &v @@ -5774,8 +9170,8 @@ type CreateInsightInput struct { _ struct{} `type:"structure"` // One or more attributes used to filter the findings included in the insight. - // Only findings that match the criteria defined in the filters are included - // in the insight. + // The insight only includes findings that match the criteria defined in the + // filters. // // Filters is a required field Filters *AwsSecurityFindingFilters `type:"structure" required:"true"` @@ -5866,8 +9262,8 @@ func (s *CreateInsightOutput) SetInsightArn(v string) *CreateInsightOutput { type CreateMembersInput struct { _ struct{} `type:"structure"` - // A list of account ID and email address pairs of the accounts to associate - // with the Security Hub master account. + // The list of accounts to associate with the Security Hub master account. For + // each account, the list includes the account ID and the email address. AccountDetails []*AccountDetails `type:"list"` } @@ -5890,8 +9286,8 @@ func (s *CreateMembersInput) SetAccountDetails(v []*AccountDetails) *CreateMembe type CreateMembersOutput struct { _ struct{} `type:"structure"` - // A list of account ID and email address pairs of the AWS accounts that weren't - // processed. + // The list of AWS accounts that were not processed. For each account, the list + // includes the account ID and the email address. UnprocessedAccounts []*Result `type:"list"` } @@ -5989,8 +9385,8 @@ func (s *DateRange) SetValue(v int64) *DateRange { type DeclineInvitationsInput struct { _ struct{} `type:"structure"` - // A list of account IDs that specify the accounts that invitations to Security - // Hub are declined from. + // The list of account IDs for the accounts from which to decline the invitations + // to Security Hub. // // AccountIds is a required field AccountIds []*string `type:"list" required:"true"` @@ -6028,8 +9424,8 @@ func (s *DeclineInvitationsInput) SetAccountIds(v []*string) *DeclineInvitations type DeclineInvitationsOutput struct { _ struct{} `type:"structure"` - // A list of account ID and email address pairs of the AWS accounts that weren't - // processed. + // The list of AWS accounts that were not processed. For each account, the list + // includes the account ID and the email address. UnprocessedAccounts []*Result `type:"list"` } @@ -6184,7 +9580,7 @@ func (s *DeleteInsightOutput) SetInsightArn(v string) *DeleteInsightOutput { type DeleteInvitationsInput struct { _ struct{} `type:"structure"` - // A list of the account IDs that sent the invitations to delete. + // The list of the account IDs that sent the invitations to delete. // // AccountIds is a required field AccountIds []*string `type:"list" required:"true"` @@ -6222,8 +9618,8 @@ func (s *DeleteInvitationsInput) SetAccountIds(v []*string) *DeleteInvitationsIn type DeleteInvitationsOutput struct { _ struct{} `type:"structure"` - // A list of account ID and email address pairs of the AWS accounts that invitations - // weren't deleted for. + // The list of AWS accounts for which the invitations were not deleted. For + // each account, the list includes the account ID and the email address. UnprocessedAccounts []*Result `type:"list"` } @@ -6246,7 +9642,7 @@ func (s *DeleteInvitationsOutput) SetUnprocessedAccounts(v []*Result) *DeleteInv type DeleteMembersInput struct { _ struct{} `type:"structure"` - // A list of account IDs of the member accounts to delete. + // The list of account IDs for the member accounts to delete. AccountIds []*string `type:"list"` } @@ -6269,8 +9665,8 @@ func (s *DeleteMembersInput) SetAccountIds(v []*string) *DeleteMembersInput { type DeleteMembersOutput struct { _ struct{} `type:"structure"` - // A list of account ID and email address pairs of the AWS accounts that weren't - // deleted. + // The list of AWS accounts that were not deleted. For each account, the list + // includes the account ID and the email address. UnprocessedAccounts []*Result `type:"list"` } @@ -6299,7 +9695,11 @@ type DescribeActionTargetsInput struct { // The maximum number of results to return. MaxResults *int64 `min:"1" type:"integer"` - // The token that is required for pagination. + // The token that is required for pagination. On your first call to the DescribeActionTargets + // operation, set the value of this parameter to NULL. + // + // For subsequent calls to the operation, to continue listing data, set the + // value of this parameter to the value returned from the previous response. NextToken *string `type:"string"` } @@ -6353,7 +9753,7 @@ type DescribeActionTargetsOutput struct { // ActionTargets is a required field ActionTargets []*ActionTarget `type:"list" required:"true"` - // The token that is required for pagination. + // The pagination token to use to request the next page of results. NextToken *string `type:"string"` } @@ -6405,7 +9805,7 @@ func (s *DescribeHubInput) SetHubArn(v string) *DescribeHubInput { type DescribeHubOutput struct { _ struct{} `type:"structure"` - // The ARN of the Hub resource retrieved. + // The ARN of the Hub resource that was retrieved. HubArn *string `type:"string"` // The date and time when Security Hub was enabled in the account. @@ -6440,7 +9840,11 @@ type DescribeProductsInput struct { // The maximum number of results to return. MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - // The token that is required for pagination. + // The token that is required for pagination. On your first call to the DescribeProducts + // operation, set the value of this parameter to NULL. + // + // For subsequent calls to the operation, to continue listing data, set the + // value of this parameter to the value returned from the previous response. NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` } @@ -6482,7 +9886,7 @@ func (s *DescribeProductsInput) SetNextToken(v string) *DescribeProductsInput { type DescribeProductsOutput struct { _ struct{} `type:"structure"` - // The token that is required for pagination. + // The pagination token to use to request the next page of results. NextToken *string `type:"string"` // A list of products, including details for each product. @@ -6507,9 +9911,188 @@ func (s *DescribeProductsOutput) SetNextToken(v string) *DescribeProductsOutput return s } -// SetProducts sets the Products field's value. -func (s *DescribeProductsOutput) SetProducts(v []*Product) *DescribeProductsOutput { - s.Products = v +// SetProducts sets the Products field's value. +func (s *DescribeProductsOutput) SetProducts(v []*Product) *DescribeProductsOutput { + s.Products = v + return s +} + +type DescribeStandardsControlsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of security standard controls to return. + MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` + + // The token that is required for pagination. On your first call to the DescribeStandardsControls + // operation, set the value of this parameter to NULL. + // + // For subsequent calls to the operation, to continue listing data, set the + // value of this parameter to the value returned from the previous response. + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` + + // The ARN of a resource that represents your subscription to a supported standard. + // + // StandardsSubscriptionArn is a required field + StandardsSubscriptionArn *string `location:"uri" locationName:"StandardsSubscriptionArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeStandardsControlsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeStandardsControlsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeStandardsControlsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeStandardsControlsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.StandardsSubscriptionArn == nil { + invalidParams.Add(request.NewErrParamRequired("StandardsSubscriptionArn")) + } + if s.StandardsSubscriptionArn != nil && len(*s.StandardsSubscriptionArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StandardsSubscriptionArn", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeStandardsControlsInput) SetMaxResults(v int64) *DescribeStandardsControlsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeStandardsControlsInput) SetNextToken(v string) *DescribeStandardsControlsInput { + s.NextToken = &v + return s +} + +// SetStandardsSubscriptionArn sets the StandardsSubscriptionArn field's value. +func (s *DescribeStandardsControlsInput) SetStandardsSubscriptionArn(v string) *DescribeStandardsControlsInput { + s.StandardsSubscriptionArn = &v + return s +} + +type DescribeStandardsControlsOutput struct { + _ struct{} `type:"structure"` + + // A list of security standards controls. + Controls []*StandardsControl `type:"list"` + + // The pagination token to use to request the next page of results. + NextToken *string `type:"string"` +} + +// String returns the string representation +func (s DescribeStandardsControlsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeStandardsControlsOutput) GoString() string { + return s.String() +} + +// SetControls sets the Controls field's value. +func (s *DescribeStandardsControlsOutput) SetControls(v []*StandardsControl) *DescribeStandardsControlsOutput { + s.Controls = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeStandardsControlsOutput) SetNextToken(v string) *DescribeStandardsControlsOutput { + s.NextToken = &v + return s +} + +type DescribeStandardsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of standards to return. + MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` + + // The token that is required for pagination. On your first call to the DescribeStandards + // operation, set the value of this parameter to NULL. + // + // For subsequent calls to the operation, to continue listing data, set the + // value of this parameter to the value returned from the previous response. + NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` +} + +// String returns the string representation +func (s DescribeStandardsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeStandardsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeStandardsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeStandardsInput"} + 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 *DescribeStandardsInput) SetMaxResults(v int64) *DescribeStandardsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeStandardsInput) SetNextToken(v string) *DescribeStandardsInput { + s.NextToken = &v + return s +} + +type DescribeStandardsOutput struct { + _ struct{} `type:"structure"` + + // The pagination token to use to request the next page of results. + NextToken *string `type:"string"` + + // A list of available standards. + Standards []*Standard `type:"list"` +} + +// String returns the string representation +func (s DescribeStandardsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeStandardsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeStandardsOutput) SetNextToken(v string) *DescribeStandardsOutput { + s.NextToken = &v + return s +} + +// SetStandards sets the Standards field's value. +func (s *DescribeStandardsOutput) SetStandards(v []*Standard) *DescribeStandardsOutput { + s.Standards = v return s } @@ -6778,13 +10361,14 @@ type GetEnabledStandardsInput struct { // The maximum number of results to return in the response. MaxResults *int64 `min:"1" type:"integer"` - // Paginates results. On your first call to the GetEnabledStandards operation, - // set the value of this parameter to NULL. For subsequent calls to the operation, - // fill nextToken in the request with the value of nextToken from the previous - // response to continue listing data. + // The token that is required for pagination. On your first call to the GetEnabledStandards + // operation, set the value of this parameter to NULL. + // + // For subsequent calls to the operation, to continue listing data, set the + // value of this parameter to the value returned from the previous response. NextToken *string `type:"string"` - // A list of the standards subscription ARNs for the standards to retrieve. + // The list of the standards subscription ARNs for the standards to retrieve. StandardsSubscriptionArns []*string `min:"1" type:"list"` } @@ -6835,11 +10419,11 @@ func (s *GetEnabledStandardsInput) SetStandardsSubscriptionArns(v []*string) *Ge type GetEnabledStandardsOutput struct { _ struct{} `type:"structure"` - // The token that is required for pagination. + // The pagination token to use to request the next page of results. NextToken *string `type:"string"` - // A list of StandardsSubscriptions objects that include information about the - // enabled standards. + // The list of StandardsSubscriptions objects that include information about + // the enabled standards. StandardsSubscriptions []*StandardsSubscription `type:"list"` } @@ -6868,20 +10452,21 @@ func (s *GetEnabledStandardsOutput) SetStandardsSubscriptions(v []*StandardsSubs type GetFindingsInput struct { _ struct{} `type:"structure"` - // The findings attributes used to define a condition to filter the findings - // returned. + // The finding attributes used to define a condition to filter the returned + // findings. Filters *AwsSecurityFindingFilters `type:"structure"` // The maximum number of findings to return. MaxResults *int64 `min:"1" type:"integer"` - // Paginates results. On your first call to the GetFindings operation, set the - // value of this parameter to NULL. For subsequent calls to the operation, fill - // nextToken in the request with the value of nextToken from the previous response - // to continue listing data. + // The token that is required for pagination. On your first call to the GetFindings + // operation, set the value of this parameter to NULL. + // + // For subsequent calls to the operation, to continue listing data, set the + // value of this parameter to the value returned from the previous response. NextToken *string `type:"string"` - // Findings attributes used to sort the list of findings returned. + // The finding attributes used to sort the list of returned findings. SortCriteria []*SortCriterion `type:"list"` } @@ -6940,7 +10525,7 @@ type GetFindingsOutput struct { // Findings is a required field Findings []*AwsSecurityFinding `type:"list" required:"true"` - // The token that is required for pagination. + // The pagination token to use to request the next page of results. NextToken *string `type:"string"` } @@ -6969,7 +10554,7 @@ func (s *GetFindingsOutput) SetNextToken(v string) *GetFindingsOutput { type GetInsightResultsInput struct { _ struct{} `type:"structure"` - // The ARN of the insight whose results you want to see. + // The ARN of the insight for which to return results. // // InsightArn is a required field InsightArn *string `location:"uri" locationName:"InsightArn" type:"string" required:"true"` @@ -7035,16 +10620,17 @@ func (s *GetInsightResultsOutput) SetInsightResults(v *InsightResults) *GetInsig type GetInsightsInput struct { _ struct{} `type:"structure"` - // The ARNs of the insights that you want to describe. + // The ARNs of the insights to describe. InsightArns []*string `type:"list"` - // The maximum number of items that you want in the response. + // The maximum number of items to return in the response. MaxResults *int64 `min:"1" type:"integer"` - // Paginates results. On your first call to the GetInsights operation, set the - // value of this parameter to NULL. For subsequent calls to the operation, fill - // nextToken in the request with the value of nextToken from the previous response - // to continue listing data. + // The token that is required for pagination. On your first call to the GetInsights + // operation, set the value of this parameter to NULL. + // + // For subsequent calls to the operation, to continue listing data, set the + // value of this parameter to the value returned from the previous response. NextToken *string `type:"string"` } @@ -7097,7 +10683,7 @@ type GetInsightsOutput struct { // Insights is a required field Insights []*Insight `type:"list" required:"true"` - // The token that is required for pagination. + // The pagination token to use to request the next page of results. NextToken *string `type:"string"` } @@ -7202,8 +10788,8 @@ func (s *GetMasterAccountOutput) SetMaster(v *Invitation) *GetMasterAccountOutpu type GetMembersInput struct { _ struct{} `type:"structure"` - // A list of account IDs for the Security Hub member accounts that you want - // to return the details for. + // The list of account IDs for the Security Hub member accounts to return the + // details for. // // AccountIds is a required field AccountIds []*string `type:"list" required:"true"` @@ -7241,11 +10827,11 @@ func (s *GetMembersInput) SetAccountIds(v []*string) *GetMembersInput { type GetMembersOutput struct { _ struct{} `type:"structure"` - // A list of details about the Security Hub member accounts. + // The list of details about the Security Hub member accounts. Members []*Member `type:"list"` - // A list of account ID and email address pairs of the AWS accounts that couldn't - // be processed. + // The list of AWS accounts that could not be processed. For each account, the + // list includes the account ID and the email address. UnprocessedAccounts []*Result `type:"list"` } @@ -7271,7 +10857,7 @@ func (s *GetMembersOutput) SetUnprocessedAccounts(v []*Result) *GetMembersOutput return s } -// Includes details of the list of the findings that can't be imported. +// Includes details of the list of the findings that cannot be imported. type ImportFindingsError struct { _ struct{} `type:"structure"` @@ -7324,8 +10910,8 @@ type Insight struct { _ struct{} `type:"structure"` // One or more attributes used to filter the findings included in the insight. - // Only findings that match the criteria defined in the filters are included - // in the insight. + // The insight only includes findings that match the criteria defined in the + // filters. // // Filters is a required field Filters *AwsSecurityFindingFilters `type:"structure" required:"true"` @@ -7470,6 +11056,181 @@ func (s *InsightResults) SetResultValues(v []*InsightResultValue) *InsightResult return s } +// Internal server error. +type InternalException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalException) GoString() string { + return s.String() +} + +func newErrorInternalException(v protocol.ResponseMetadata) error { + return &InternalException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalException) Code() string { + return "InternalException" +} + +// Message returns the exception's message. +func (s InternalException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalException) OrigErr() error { + return nil +} + +func (s InternalException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS Security Hub isn't enabled for the account used to make this request. +type InvalidAccessException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidAccessException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidAccessException) GoString() string { + return s.String() +} + +func newErrorInvalidAccessException(v protocol.ResponseMetadata) error { + return &InvalidAccessException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidAccessException) Code() string { + return "InvalidAccessException" +} + +// Message returns the exception's message. +func (s InvalidAccessException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAccessException) OrigErr() error { + return nil +} + +func (s InvalidAccessException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAccessException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAccessException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request was rejected because you supplied an invalid or out-of-range +// value for an input parameter. +type InvalidInputException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidInputException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInputException) GoString() string { + return s.String() +} + +func newErrorInvalidInputException(v protocol.ResponseMetadata) error { + return &InvalidInputException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInputException) Code() string { + return "InvalidInputException" +} + +// Message returns the exception's message. +func (s InvalidInputException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInputException) OrigErr() error { + return nil +} + +func (s InvalidInputException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInputException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInputException) RequestID() string { + return s.respMetadata.RequestID +} + // Details about an invitation. type Invitation struct { _ struct{} `type:"structure"` @@ -7484,7 +11245,7 @@ type Invitation struct { // The timestamp of when the invitation was sent. InvitedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` - // The current status of the association between member and master accounts. + // The current status of the association between the member and master accounts. MemberStatus *string `type:"string"` } @@ -7525,8 +11286,8 @@ func (s *Invitation) SetMemberStatus(v string) *Invitation { type InviteMembersInput struct { _ struct{} `type:"structure"` - // A list of IDs of the AWS accounts that you want to invite to Security Hub - // as members. + // The list of account IDs of the AWS accounts to invite to Security Hub as + // members. AccountIds []*string `type:"list"` } @@ -7549,8 +11310,8 @@ func (s *InviteMembersInput) SetAccountIds(v []*string) *InviteMembersInput { type InviteMembersOutput struct { _ struct{} `type:"structure"` - // A list of account ID and email address pairs of the AWS accounts that couldn't - // be processed. + // The list of AWS accounts that could not be processed. For each account, the + // list includes the account ID and the email address. UnprocessedAccounts []*Result `type:"list"` } @@ -7618,16 +11379,76 @@ func (s *KeywordFilter) SetValue(v string) *KeywordFilter { return s } +// The request was rejected because it attempted to create resources beyond +// the current AWS account limits. The error code describes the limit exceeded. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListEnabledProductsForImportInput struct { _ struct{} `type:"structure"` - // The maximum number of items that you want in the response. + // The maximum number of items to return in the response. MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - // Paginates results. On your first call to the ListEnabledProductsForImport - // operation, set the value of this parameter to NULL. For subsequent calls - // to the operation, fill nextToken in the request with the value of NextToken - // from the previous response to continue listing data. + // The token that is required for pagination. On your first call to the ListEnabledProductsForImport + // operation, set the value of this parameter to NULL. + // + // For subsequent calls to the operation, to continue listing data, set the + // value of this parameter to the value returned from the previous response. NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` } @@ -7669,10 +11490,10 @@ func (s *ListEnabledProductsForImportInput) SetNextToken(v string) *ListEnabledP type ListEnabledProductsForImportOutput struct { _ struct{} `type:"structure"` - // The token that is required for pagination. + // The pagination token to use to request the next page of results. NextToken *string `type:"string"` - // A list of ARNs for the resources that represent your subscriptions to products. + // The list of ARNs for the resources that represent your subscriptions to products. ProductSubscriptions []*string `type:"list"` } @@ -7701,13 +11522,14 @@ func (s *ListEnabledProductsForImportOutput) SetProductSubscriptions(v []*string type ListInvitationsInput struct { _ struct{} `type:"structure"` - // The maximum number of items that you want in the response. + // The maximum number of items to return in the response. MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - // Paginates results. On your first call to the ListInvitations operation, set - // the value of this parameter to NULL. For subsequent calls to the operation, - // fill nextToken in the request with the value of NextToken from the previous - // response to continue listing data. + // The token that is required for pagination. On your first call to the ListInvitations + // operation, set the value of this parameter to NULL. + // + // For subsequent calls to the operation, to continue listing data, set the + // value of this parameter to the value returned from the previous response. NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` } @@ -7752,7 +11574,7 @@ type ListInvitationsOutput struct { // The details of the invitations returned by the operation. Invitations []*Invitation `type:"list"` - // The token that is required for pagination. + // The pagination token to use to request the next page of results. NextToken *string `type:"string"` } @@ -7781,20 +11603,24 @@ func (s *ListInvitationsOutput) SetNextToken(v string) *ListInvitationsOutput { type ListMembersInput struct { _ struct{} `type:"structure"` - // The maximum number of items that you want in the response. + // The maximum number of items to return in the response. MaxResults *int64 `location:"querystring" locationName:"MaxResults" min:"1" type:"integer"` - // Paginates results. Set the value of this parameter to NULL on your first - // call to the ListMembers operation. For subsequent calls to the operation, - // fill nextToken in the request with the value of nextToken from the previous - // response to continue listing data. + // The token that is required for pagination. On your first call to the ListMembers + // operation, set the value of this parameter to NULL. + // + // For subsequent calls to the operation, to continue listing data, set the + // value of this parameter to the value returned from the previous response. NextToken *string `location:"querystring" locationName:"NextToken" type:"string"` - // Specifies which member accounts the response includes based on their relationship - // status with the master account. The default value is TRUE. If onlyAssociated - // is set to TRUE, the response includes member accounts whose relationship - // status with the master is set to ENABLED or DISABLED. If onlyAssociated is - // set to FALSE, the response includes all existing member accounts. + // Specifies which member accounts to include in the response based on their + // relationship status with the master account. The default value is TRUE. + // + // If OnlyAssociated is set to TRUE, the response includes member accounts whose + // relationship status with the master is set to ENABLED or DISABLED. + // + // If OnlyAssociated is set to FALSE, the response includes all existing member + // accounts. OnlyAssociated *bool `location:"querystring" locationName:"OnlyAssociated" type:"boolean"` } @@ -7845,7 +11671,7 @@ type ListMembersOutput struct { // Member details returned by the operation. Members []*Member `type:"list"` - // The token that is required for pagination. + // The pagination token to use to request the next page of results. NextToken *string `type:"string"` } @@ -7935,6 +11761,44 @@ func (s *ListTagsForResourceOutput) SetTags(v map[string]*string) *ListTagsForRe return s } +// Information about the state of the load balancer. +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"` + + // 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 +} + // A list of malware related to a finding. type Malware struct { _ struct{} `type:"structure"` @@ -8481,6 +12345,16 @@ type Product struct { // A description of the product. Description *string `type:"string"` + // The types of integration that the product supports. Available values are + // the following. + // + // * SEND_FINDINGS_TO_SECURITY_HUB - Indicates that the integration sends + // findings to Security Hub. + // + // * RECEIVE_FINDINGS_FROM_SECURITY_HUB - Indicates that the integration + // receives findings from Security Hub. + IntegrationTypes []*string `type:"list"` + // The URL for the page that contains more information about the product. MarketplaceUrl *string `type:"string"` @@ -8530,6 +12404,12 @@ func (s *Product) SetDescription(v string) *Product { return s } +// SetIntegrationTypes sets the IntegrationTypes field's value. +func (s *Product) SetIntegrationTypes(v []*string) *Product { + s.IntegrationTypes = v + return s +} + // SetMarketplaceUrl sets the MarketplaceUrl field's value. func (s *Product) SetMarketplaceUrl(v string) *Product { s.MarketplaceUrl = &v @@ -8689,7 +12569,12 @@ type Resource struct { // processed. Tags map[string]*string `type:"map"` - // The type of the resource that details are provided for. + // The type of the resource that details are provided for. If possible, set + // Type to one of the supported resource types. For example, if the resource + // is an EC2 instance, then set Type to AwsEc2Instance. + // + // If the resource does not match any of the provided types, then set Type to + // Other. // // Type is a required field Type *string `type:"string" required:"true"` @@ -8714,6 +12599,11 @@ func (s *Resource) Validate() error { if s.Type == nil { invalidParams.Add(request.NewErrParamRequired("Type")) } + if s.Details != nil { + if err := s.Details.Validate(); err != nil { + invalidParams.AddNested("Details", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -8757,23 +12647,142 @@ func (s *Resource) SetType(v string) *Resource { return s } +// The resource specified in the request conflicts with an existing resource. +type ResourceConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceConflictException) GoString() string { + return s.String() +} + +func newErrorResourceConflictException(v protocol.ResponseMetadata) error { + return &ResourceConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceConflictException) Code() string { + return "ResourceConflictException" +} + +// Message returns the exception's message. +func (s ResourceConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceConflictException) OrigErr() error { + return nil +} + +func (s ResourceConflictException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceConflictException) RequestID() string { + return s.respMetadata.RequestID +} + // Additional details about a resource related to a finding. +// +// To provide the details, use the object that corresponds to the resource type. +// For example, if the resource type is AwsEc2Instance, then you use the AwsEc2Instance +// object to provide the details. +// +// If the type-specific object does not contain all of the fields you want to +// populate, then you use the Other object to populate those additional fields. +// +// You also use the Other object to populate the details when the selected type +// does not have a corresponding object. type ResourceDetails struct { _ struct{} `type:"structure"` + // Details about a CloudFront distribution. + AwsCloudFrontDistribution *AwsCloudFrontDistributionDetails `type:"structure"` + + // Details for an AWS CodeBuild project. + AwsCodeBuildProject *AwsCodeBuildProjectDetails `type:"structure"` + // Details about an Amazon EC2 instance related to a finding. AwsEc2Instance *AwsEc2InstanceDetails `type:"structure"` + // Details for an AWS EC2 network interface. + AwsEc2NetworkInterface *AwsEc2NetworkInterfaceDetails `type:"structure"` + + // Details for an EC2 security group. + AwsEc2SecurityGroup *AwsEc2SecurityGroupDetails `type:"structure"` + + // Details for an Elasticsearch domain. + AwsElasticsearchDomain *AwsElasticsearchDomainDetails `type:"structure"` + + // Details about a load balancer. + AwsElbv2LoadBalancer *AwsElbv2LoadBalancerDetails `type:"structure"` + // Details about an IAM access key related to a finding. AwsIamAccessKey *AwsIamAccessKeyDetails `type:"structure"` + // Details about an IAM role. + AwsIamRole *AwsIamRoleDetails `type:"structure"` + + // Details about a KMS key. + AwsKmsKey *AwsKmsKeyDetails `type:"structure"` + + // Details about a Lambda function. + AwsLambdaFunction *AwsLambdaFunctionDetails `type:"structure"` + + // Details for a Lambda layer version. + AwsLambdaLayerVersion *AwsLambdaLayerVersionDetails `type:"structure"` + + // Details for an RDS database instance. + AwsRdsDbInstance *AwsRdsDbInstanceDetails `type:"structure"` + // Details about an Amazon S3 Bucket related to a finding. AwsS3Bucket *AwsS3BucketDetails `type:"structure"` + // Details about an SNS topic. + AwsSnsTopic *AwsSnsTopicDetails `type:"structure"` + + // Details about an SQS queue. + AwsSqsQueue *AwsSqsQueueDetails `type:"structure"` + + // Details for a WAF WebACL. + AwsWafWebAcl *AwsWafWebAclDetails `type:"structure"` + // Details about a container resource related to a finding. Container *ContainerDetails `type:"structure"` - // Details about a resource that doesn't have a specific type defined. + // Details about a resource that are not available in a type-specific details + // object. Use the Other object in the following cases. + // + // * The type-specific object does not contain all of the fields that you + // want to populate. In this case, first use the type-specific object to + // populate those fields. Use the Other object to populate the fields that + // are missing from the type-specific object. + // + // * The resource type does not have a corresponding object. This includes + // resources for which the type is Other. Other map[string]*string `type:"map"` } @@ -8782,20 +12791,101 @@ func (s ResourceDetails) String() string { return awsutil.Prettify(s) } -// GoString returns the string representation -func (s ResourceDetails) GoString() string { - return s.String() +// GoString returns the string representation +func (s ResourceDetails) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResourceDetails) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResourceDetails"} + if s.AwsIamRole != nil { + if err := s.AwsIamRole.Validate(); err != nil { + invalidParams.AddNested("AwsIamRole", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsCloudFrontDistribution sets the AwsCloudFrontDistribution field's value. +func (s *ResourceDetails) SetAwsCloudFrontDistribution(v *AwsCloudFrontDistributionDetails) *ResourceDetails { + s.AwsCloudFrontDistribution = v + return s +} + +// SetAwsCodeBuildProject sets the AwsCodeBuildProject field's value. +func (s *ResourceDetails) SetAwsCodeBuildProject(v *AwsCodeBuildProjectDetails) *ResourceDetails { + s.AwsCodeBuildProject = v + return s +} + +// SetAwsEc2Instance sets the AwsEc2Instance field's value. +func (s *ResourceDetails) SetAwsEc2Instance(v *AwsEc2InstanceDetails) *ResourceDetails { + s.AwsEc2Instance = v + return s +} + +// SetAwsEc2NetworkInterface sets the AwsEc2NetworkInterface field's value. +func (s *ResourceDetails) SetAwsEc2NetworkInterface(v *AwsEc2NetworkInterfaceDetails) *ResourceDetails { + s.AwsEc2NetworkInterface = v + return s +} + +// SetAwsEc2SecurityGroup sets the AwsEc2SecurityGroup field's value. +func (s *ResourceDetails) SetAwsEc2SecurityGroup(v *AwsEc2SecurityGroupDetails) *ResourceDetails { + s.AwsEc2SecurityGroup = v + return s +} + +// SetAwsElasticsearchDomain sets the AwsElasticsearchDomain field's value. +func (s *ResourceDetails) SetAwsElasticsearchDomain(v *AwsElasticsearchDomainDetails) *ResourceDetails { + s.AwsElasticsearchDomain = v + return s +} + +// SetAwsElbv2LoadBalancer sets the AwsElbv2LoadBalancer field's value. +func (s *ResourceDetails) SetAwsElbv2LoadBalancer(v *AwsElbv2LoadBalancerDetails) *ResourceDetails { + s.AwsElbv2LoadBalancer = v + return s +} + +// SetAwsIamAccessKey sets the AwsIamAccessKey field's value. +func (s *ResourceDetails) SetAwsIamAccessKey(v *AwsIamAccessKeyDetails) *ResourceDetails { + s.AwsIamAccessKey = v + return s +} + +// SetAwsIamRole sets the AwsIamRole field's value. +func (s *ResourceDetails) SetAwsIamRole(v *AwsIamRoleDetails) *ResourceDetails { + s.AwsIamRole = v + return s +} + +// SetAwsKmsKey sets the AwsKmsKey field's value. +func (s *ResourceDetails) SetAwsKmsKey(v *AwsKmsKeyDetails) *ResourceDetails { + s.AwsKmsKey = v + return s +} + +// SetAwsLambdaFunction sets the AwsLambdaFunction field's value. +func (s *ResourceDetails) SetAwsLambdaFunction(v *AwsLambdaFunctionDetails) *ResourceDetails { + s.AwsLambdaFunction = v + return s } -// SetAwsEc2Instance sets the AwsEc2Instance field's value. -func (s *ResourceDetails) SetAwsEc2Instance(v *AwsEc2InstanceDetails) *ResourceDetails { - s.AwsEc2Instance = v +// SetAwsLambdaLayerVersion sets the AwsLambdaLayerVersion field's value. +func (s *ResourceDetails) SetAwsLambdaLayerVersion(v *AwsLambdaLayerVersionDetails) *ResourceDetails { + s.AwsLambdaLayerVersion = v return s } -// SetAwsIamAccessKey sets the AwsIamAccessKey field's value. -func (s *ResourceDetails) SetAwsIamAccessKey(v *AwsIamAccessKeyDetails) *ResourceDetails { - s.AwsIamAccessKey = v +// SetAwsRdsDbInstance sets the AwsRdsDbInstance field's value. +func (s *ResourceDetails) SetAwsRdsDbInstance(v *AwsRdsDbInstanceDetails) *ResourceDetails { + s.AwsRdsDbInstance = v return s } @@ -8805,6 +12895,24 @@ func (s *ResourceDetails) SetAwsS3Bucket(v *AwsS3BucketDetails) *ResourceDetails return s } +// SetAwsSnsTopic sets the AwsSnsTopic field's value. +func (s *ResourceDetails) SetAwsSnsTopic(v *AwsSnsTopicDetails) *ResourceDetails { + s.AwsSnsTopic = v + return s +} + +// SetAwsSqsQueue sets the AwsSqsQueue field's value. +func (s *ResourceDetails) SetAwsSqsQueue(v *AwsSqsQueueDetails) *ResourceDetails { + s.AwsSqsQueue = v + return s +} + +// SetAwsWafWebAcl sets the AwsWafWebAcl field's value. +func (s *ResourceDetails) SetAwsWafWebAcl(v *AwsWafWebAclDetails) *ResourceDetails { + s.AwsWafWebAcl = v + return s +} + // SetContainer sets the Container field's value. func (s *ResourceDetails) SetContainer(v *ContainerDetails) *ResourceDetails { s.Container = v @@ -8817,14 +12925,72 @@ func (s *ResourceDetails) SetOther(v map[string]*string) *ResourceDetails { return s } -// Details about the account that wasn't processed. +// The request was rejected because we can't find the specified resource. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Code_ *string `locationName:"Code" type:"string"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Details about the account that was not processed. type Result struct { _ struct{} `type:"structure"` - // An AWS account ID of the account that wasn't be processed. + // An AWS account ID of the account that was not processed. AccountId *string `type:"string"` - // The reason that the account wasn't be processed. + // The reason that the account was not processed. ProcessingResult *string `type:"string"` } @@ -8932,15 +13098,167 @@ func (s *SortCriterion) SetSortOrder(v string) *SortCriterion { return s } +// Provides information about a specific standard. +type Standard struct { + _ struct{} `type:"structure"` + + // A description of the standard. + Description *string `type:"string"` + + // The name of the standard. + Name *string `type:"string"` + + // The ARN of a standard. + StandardsArn *string `type:"string"` +} + +// String returns the string representation +func (s Standard) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Standard) GoString() string { + return s.String() +} + +// SetDescription sets the Description field's value. +func (s *Standard) SetDescription(v string) *Standard { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *Standard) SetName(v string) *Standard { + s.Name = &v + return s +} + +// SetStandardsArn sets the StandardsArn field's value. +func (s *Standard) SetStandardsArn(v string) *Standard { + s.StandardsArn = &v + return s +} + +// Details for an individual security standard control. +type StandardsControl struct { + _ struct{} `type:"structure"` + + // The identifier of the security standard control. + ControlId *string `type:"string"` + + // The current status of the security standard control. Indicates whether the + // control is enabled or disabled. Security Hub does not check against disabled + // controls. + ControlStatus *string `type:"string" enum:"ControlStatus"` + + // The date and time that the status of the security standard control was most + // recently updated. + ControlStatusUpdatedAt *time.Time `type:"timestamp" timestampFormat:"iso8601"` + + // The longer description of the security standard control. Provides information + // about what the control is checking for. + Description *string `type:"string"` + + // The reason provided for the most recent change in status for the control. + DisabledReason *string `type:"string"` + + // The list of requirements that are related to this control. + RelatedRequirements []*string `type:"list"` + + // A link to remediation information for the control in the Security Hub user + // documentation. + RemediationUrl *string `type:"string"` + + // The severity of findings generated from this security standard control. + // + // The finding severity is based on an assessment of how easy it would be to + // compromise AWS resources if the issue is detected. + SeverityRating *string `type:"string" enum:"SeverityRating"` + + // The ARN of the security standard control. + StandardsControlArn *string `type:"string"` + + // The title of the security standard control. + Title *string `type:"string"` +} + +// String returns the string representation +func (s StandardsControl) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StandardsControl) GoString() string { + return s.String() +} + +// SetControlId sets the ControlId field's value. +func (s *StandardsControl) SetControlId(v string) *StandardsControl { + s.ControlId = &v + return s +} + +// SetControlStatus sets the ControlStatus field's value. +func (s *StandardsControl) SetControlStatus(v string) *StandardsControl { + s.ControlStatus = &v + return s +} + +// SetControlStatusUpdatedAt sets the ControlStatusUpdatedAt field's value. +func (s *StandardsControl) SetControlStatusUpdatedAt(v time.Time) *StandardsControl { + s.ControlStatusUpdatedAt = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *StandardsControl) SetDescription(v string) *StandardsControl { + s.Description = &v + return s +} + +// SetDisabledReason sets the DisabledReason field's value. +func (s *StandardsControl) SetDisabledReason(v string) *StandardsControl { + s.DisabledReason = &v + return s +} + +// SetRelatedRequirements sets the RelatedRequirements field's value. +func (s *StandardsControl) SetRelatedRequirements(v []*string) *StandardsControl { + s.RelatedRequirements = v + return s +} + +// SetRemediationUrl sets the RemediationUrl field's value. +func (s *StandardsControl) SetRemediationUrl(v string) *StandardsControl { + s.RemediationUrl = &v + return s +} + +// SetSeverityRating sets the SeverityRating field's value. +func (s *StandardsControl) SetSeverityRating(v string) *StandardsControl { + s.SeverityRating = &v + return s +} + +// SetStandardsControlArn sets the StandardsControlArn field's value. +func (s *StandardsControl) SetStandardsControlArn(v string) *StandardsControl { + s.StandardsControlArn = &v + return s +} + +// SetTitle sets the Title field's value. +func (s *StandardsControl) SetTitle(v string) *StandardsControl { + s.Title = &v + return s +} + // A resource that represents your subscription to a supported standard. type StandardsSubscription struct { _ struct{} `type:"structure"` // The ARN of a standard. // - // In this release, Security Hub supports only the CIS AWS Foundations standard, - // which uses the following ARN: arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0. - // // StandardsArn is a required field StandardsArn *string `type:"string" required:"true"` @@ -8998,11 +13316,8 @@ func (s *StandardsSubscription) SetStandardsSubscriptionArn(v string) *Standards type StandardsSubscriptionRequest struct { _ struct{} `type:"structure"` - // The ARN of the standard that you want to enable. - // - // In this release, Security Hub only supports the CIS AWS Foundations standard. - // - // Its ARN is arn:aws:securityhub:::ruleset/cis-aws-foundations-benchmark/v/1.2.0. + // The ARN of the standard that you want to enable. To view the list of available + // standards and their ARNs, use the DescribeStandards operation. // // StandardsArn is a required field StandardsArn *string `type:"string" required:"true"` @@ -9151,28 +13466,28 @@ func (s TagResourceOutput) GoString() string { return s.String() } -// Details about the threat intel related to a finding. +// Details about the threat intelligence related to a finding. type ThreatIntelIndicator struct { _ struct{} `type:"structure"` - // The category of a threat intel indicator. + // The category of a threat intelligence indicator. Category *string `type:"string" enum:"ThreatIntelIndicatorCategory"` - // The date and time when the most recent instance of a threat intel indicator - // was observed. + // The date and time when the most recent instance of a threat intelligence + // indicator was observed. LastObservedAt *string `type:"string"` - // The source of the threat intel indicator. + // The source of the threat intelligence indicator. Source *string `type:"string"` // The URL to the page or site where you can get more information about the - // threat intel indicator. + // threat intelligence indicator. SourceUrl *string `type:"string"` - // The type of a threat intel indicator. + // The type of threat intelligence indicator. Type *string `type:"string" enum:"ThreatIntelIndicatorType"` - // The value of a threat intel indicator. + // The value of a threat intelligence indicator. Value *string `type:"string"` } @@ -9524,6 +13839,166 @@ func (s UpdateInsightOutput) GoString() string { return s.String() } +type UpdateStandardsControlInput struct { + _ struct{} `type:"structure"` + + // The updated status of the security standard control. + ControlStatus *string `type:"string" enum:"ControlStatus"` + + // A description of the reason why you are disabling a security standard control. + DisabledReason *string `type:"string"` + + // The ARN of the security standard control to enable or disable. + // + // StandardsControlArn is a required field + StandardsControlArn *string `location:"uri" locationName:"StandardsControlArn" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateStandardsControlInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateStandardsControlInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateStandardsControlInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateStandardsControlInput"} + if s.StandardsControlArn == nil { + invalidParams.Add(request.NewErrParamRequired("StandardsControlArn")) + } + if s.StandardsControlArn != nil && len(*s.StandardsControlArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("StandardsControlArn", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetControlStatus sets the ControlStatus field's value. +func (s *UpdateStandardsControlInput) SetControlStatus(v string) *UpdateStandardsControlInput { + s.ControlStatus = &v + return s +} + +// SetDisabledReason sets the DisabledReason field's value. +func (s *UpdateStandardsControlInput) SetDisabledReason(v string) *UpdateStandardsControlInput { + s.DisabledReason = &v + return s +} + +// SetStandardsControlArn sets the StandardsControlArn field's value. +func (s *UpdateStandardsControlInput) SetStandardsControlArn(v string) *UpdateStandardsControlInput { + s.StandardsControlArn = &v + return s +} + +type UpdateStandardsControlOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateStandardsControlOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateStandardsControlOutput) GoString() string { + return s.String() +} + +// Details about the action that CloudFront or AWS WAF takes when a web request +// matches the conditions in the Rule. +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 *string `type:"string"` +} + +// 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() +} + +// SetType sets the Type field's value. +func (s *WafAction) SetType(v string) *WafAction { + s.Type = &v + return s +} + +// Details about a rule to exclude from a rule group. +type WafExcludedRule struct { + _ struct{} `type:"structure"` + + // The unique identifier for the rule to exclude from the rule group. + RuleId *string `type:"string"` +} + +// String returns the string representation +func (s WafExcludedRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WafExcludedRule) GoString() string { + return s.String() +} + +// SetRuleId sets the RuleId field's value. +func (s *WafExcludedRule) SetRuleId(v string) *WafExcludedRule { + s.RuleId = &v + return s +} + +// Details about an override action for a rule. +type WafOverrideAction struct { + _ struct{} `type:"structure"` + + // COUNT overrides the action specified by the individual rule within a RuleGroup . + // + // If set to NONE, the rule's action takes place. + Type *string `type:"string"` +} + +// String returns the string representation +func (s WafOverrideAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WafOverrideAction) GoString() string { + return s.String() +} + +// SetType sets the Type field's value. +func (s *WafOverrideAction) SetType(v string) *WafOverrideAction { + s.Type = &v + return s +} + const ( // AwsIamAccessKeyStatusActive is a AwsIamAccessKeyStatus enum value AwsIamAccessKeyStatusActive = "Active" @@ -9546,11 +14021,27 @@ const ( ComplianceStatusNotAvailable = "NOT_AVAILABLE" ) +const ( + // ControlStatusEnabled is a ControlStatus enum value + ControlStatusEnabled = "ENABLED" + + // ControlStatusDisabled is a ControlStatus enum value + ControlStatusDisabled = "DISABLED" +) + const ( // DateRangeUnitDays is a DateRangeUnit enum value DateRangeUnitDays = "DAYS" ) +const ( + // IntegrationTypeSendFindingsToSecurityHub is a IntegrationType enum value + IntegrationTypeSendFindingsToSecurityHub = "SEND_FINDINGS_TO_SECURITY_HUB" + + // IntegrationTypeReceiveFindingsFromSecurityHub is a IntegrationType enum value + IntegrationTypeReceiveFindingsFromSecurityHub = "RECEIVE_FINDINGS_FROM_SECURITY_HUB" +) + const ( // MalwareStateObserved is a MalwareState enum value MalwareStateObserved = "OBSERVED" @@ -9641,6 +14132,20 @@ const ( RecordStateArchived = "ARCHIVED" ) +const ( + // SeverityRatingLow is a SeverityRating enum value + SeverityRatingLow = "LOW" + + // SeverityRatingMedium is a SeverityRating enum value + SeverityRatingMedium = "MEDIUM" + + // SeverityRatingHigh is a SeverityRating enum value + SeverityRatingHigh = "HIGH" + + // SeverityRatingCritical is a SeverityRating enum value + SeverityRatingCritical = "CRITICAL" +) + const ( // SortOrderAsc is a SortOrder enum value SortOrderAsc = "asc" diff --git a/vendor/github.com/aws/aws-sdk-go/service/securityhub/doc.go b/vendor/github.com/aws/aws-sdk-go/service/securityhub/doc.go index 266765f2379..f849ae65093 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/securityhub/doc.go +++ b/vendor/github.com/aws/aws-sdk-go/service/securityhub/doc.go @@ -4,8 +4,8 @@ // requests to AWS SecurityHub. // // Security Hub provides you with a comprehensive view of the security state -// of your AWS environment and resources. It also provides you with the compliance -// status of your environment based on CIS AWS Foundations compliance checks. +// of your AWS environment and resources. It also provides you with the readiness +// status of your environment based on controls from supported security standards. // Security Hub collects security data from AWS accounts, services, and integrated // third-party products and helps you analyze security trends in your environment // to identify the highest priority security issues. For more information about @@ -16,11 +16,24 @@ // that you specify in your request. Any configuration or settings change that // results from the operation is applied only to that Region. To make the same // change in other Regions, execute the same command for each Region to apply -// the change to. For example, if your Region is set to us-west-2, when you -// use CreateMembers to add a member account to Security Hub, the association -// of the member account with the master account is created only in the us-west-2 -// Region. Security Hub must be enabled for the member account in the same Region -// that the invite was sent from. +// the change to. +// +// For example, if your Region is set to us-west-2, when you use CreateMembers +// to add a member account to Security Hub, the association of the member account +// with the master account is created only in the us-west-2 Region. Security +// Hub must be enabled for the member account in the same Region that the invitation +// was sent from. +// +// The following throttling limits apply to using Security Hub API operations. +// +// * GetFindings - RateLimit of 3 requests per second. BurstLimit of 6 requests +// per second. +// +// * UpdateFindings - RateLimit of 1 request per second. BurstLimit of 5 +// requests per second. +// +// * All other operations - RateLimit of 10 requests per second. BurstLimit +// of 30 requests per second. // // See https://docs.aws.amazon.com/goto/WebAPI/securityhub-2018-10-26 for more information on this service. // diff --git a/vendor/github.com/aws/aws-sdk-go/service/securityhub/errors.go b/vendor/github.com/aws/aws-sdk-go/service/securityhub/errors.go index ea15ffb030d..eb6cf77147f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/securityhub/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/securityhub/errors.go @@ -2,6 +2,10 @@ package securityhub +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccessDeniedException for service response error code @@ -48,3 +52,13 @@ const ( // The request was rejected because we can't find the specified resource. ErrCodeResourceNotFoundException = "ResourceNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "InternalException": newErrorInternalException, + "InvalidAccessException": newErrorInvalidAccessException, + "InvalidInputException": newErrorInvalidInputException, + "LimitExceededException": newErrorLimitExceededException, + "ResourceConflictException": newErrorResourceConflictException, + "ResourceNotFoundException": newErrorResourceNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/securityhub/service.go b/vendor/github.com/aws/aws-sdk-go/service/securityhub/service.go index 113ce37f3e1..09819115950 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/securityhub/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/securityhub/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "SecurityHub" // Name of service. EndpointsID = "securityhub" // ID to lookup a service endpoint with. - ServiceID = "SecurityHub" // ServiceID is a unique identifer of a specific service. + ServiceID = "SecurityHub" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the SecurityHub client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a SecurityHub client from just a session. // svc := securityhub.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *SecurityHub { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "securityhub" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *SecurityHub { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *SecurityHub { svc := &SecurityHub{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-10-26", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/serverlessapplicationrepository/api.go b/vendor/github.com/aws/aws-sdk-go/service/serverlessapplicationrepository/api.go index 1639d64fe0d..32f6c86b85e 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/serverlessapplicationrepository/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/serverlessapplicationrepository/api.go @@ -66,22 +66,22 @@ func (c *ServerlessApplicationRepository) CreateApplicationRequest(input *Create // See the AWS API reference guide for AWSServerlessApplicationRepository's // API operation CreateApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// Returned Error Types: +// * TooManyRequestsException // The client is sending more than the allowed number of requests per unit of // time. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // One of the parameters in the request is invalid. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The AWS Serverless Application Repository service encountered an internal // error. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The resource already exists. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The client is not authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/serverlessrepo-2017-09-08/CreateApplication @@ -159,22 +159,22 @@ func (c *ServerlessApplicationRepository) CreateApplicationVersionRequest(input // See the AWS API reference guide for AWSServerlessApplicationRepository's // API operation CreateApplicationVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// Returned Error Types: +// * TooManyRequestsException // The client is sending more than the allowed number of requests per unit of // time. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // One of the parameters in the request is invalid. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The AWS Serverless Application Repository service encountered an internal // error. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The resource already exists. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The client is not authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/serverlessrepo-2017-09-08/CreateApplicationVersion @@ -252,19 +252,19 @@ func (c *ServerlessApplicationRepository) CreateCloudFormationChangeSetRequest(i // See the AWS API reference guide for AWSServerlessApplicationRepository's // API operation CreateCloudFormationChangeSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// Returned Error Types: +// * TooManyRequestsException // The client is sending more than the allowed number of requests per unit of // time. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // One of the parameters in the request is invalid. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The AWS Serverless Application Repository service encountered an internal // error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The client is not authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/serverlessrepo-2017-09-08/CreateCloudFormationChangeSet @@ -342,23 +342,23 @@ func (c *ServerlessApplicationRepository) CreateCloudFormationTemplateRequest(in // See the AWS API reference guide for AWSServerlessApplicationRepository's // API operation CreateCloudFormationTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource (for example, an access policy statement) specified in the request // doesn't exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The client is sending more than the allowed number of requests per unit of // time. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // One of the parameters in the request is invalid. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The AWS Serverless Application Repository service encountered an internal // error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The client is not authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/serverlessrepo-2017-09-08/CreateCloudFormationTemplate @@ -437,26 +437,26 @@ func (c *ServerlessApplicationRepository) DeleteApplicationRequest(input *Delete // See the AWS API reference guide for AWSServerlessApplicationRepository's // API operation DeleteApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // One of the parameters in the request is invalid. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The AWS Serverless Application Repository service encountered an internal // error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The client is not authenticated. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource (for example, an access policy statement) specified in the request // doesn't exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The client is sending more than the allowed number of requests per unit of // time. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The resource already exists. // // See also, https://docs.aws.amazon.com/goto/WebAPI/serverlessrepo-2017-09-08/DeleteApplication @@ -534,23 +534,23 @@ func (c *ServerlessApplicationRepository) GetApplicationRequest(input *GetApplic // See the AWS API reference guide for AWSServerlessApplicationRepository's // API operation GetApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource (for example, an access policy statement) specified in the request // doesn't exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The client is sending more than the allowed number of requests per unit of // time. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // One of the parameters in the request is invalid. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The AWS Serverless Application Repository service encountered an internal // error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The client is not authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/serverlessrepo-2017-09-08/GetApplication @@ -628,23 +628,23 @@ func (c *ServerlessApplicationRepository) GetApplicationPolicyRequest(input *Get // See the AWS API reference guide for AWSServerlessApplicationRepository's // API operation GetApplicationPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource (for example, an access policy statement) specified in the request // doesn't exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The client is sending more than the allowed number of requests per unit of // time. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // One of the parameters in the request is invalid. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The AWS Serverless Application Repository service encountered an internal // error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The client is not authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/serverlessrepo-2017-09-08/GetApplicationPolicy @@ -722,23 +722,23 @@ func (c *ServerlessApplicationRepository) GetCloudFormationTemplateRequest(input // See the AWS API reference guide for AWSServerlessApplicationRepository's // API operation GetCloudFormationTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource (for example, an access policy statement) specified in the request // doesn't exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The client is sending more than the allowed number of requests per unit of // time. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // One of the parameters in the request is invalid. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The AWS Serverless Application Repository service encountered an internal // error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The client is not authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/serverlessrepo-2017-09-08/GetCloudFormationTemplate @@ -822,23 +822,23 @@ func (c *ServerlessApplicationRepository) ListApplicationDependenciesRequest(inp // See the AWS API reference guide for AWSServerlessApplicationRepository's // API operation ListApplicationDependencies for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource (for example, an access policy statement) specified in the request // doesn't exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The client is sending more than the allowed number of requests per unit of // time. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // One of the parameters in the request is invalid. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The AWS Serverless Application Repository service encountered an internal // error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The client is not authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/serverlessrepo-2017-09-08/ListApplicationDependencies @@ -906,10 +906,12 @@ func (c *ServerlessApplicationRepository) ListApplicationDependenciesPagesWithCo }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListApplicationDependenciesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListApplicationDependenciesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -972,23 +974,23 @@ func (c *ServerlessApplicationRepository) ListApplicationVersionsRequest(input * // See the AWS API reference guide for AWSServerlessApplicationRepository's // API operation ListApplicationVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource (for example, an access policy statement) specified in the request // doesn't exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The client is sending more than the allowed number of requests per unit of // time. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // One of the parameters in the request is invalid. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The AWS Serverless Application Repository service encountered an internal // error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The client is not authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/serverlessrepo-2017-09-08/ListApplicationVersions @@ -1056,10 +1058,12 @@ func (c *ServerlessApplicationRepository) ListApplicationVersionsPagesWithContex }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListApplicationVersionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListApplicationVersionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1122,19 +1126,19 @@ func (c *ServerlessApplicationRepository) ListApplicationsRequest(input *ListApp // See the AWS API reference guide for AWSServerlessApplicationRepository's // API operation ListApplications for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource (for example, an access policy statement) specified in the request // doesn't exist. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // One of the parameters in the request is invalid. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The AWS Serverless Application Repository service encountered an internal // error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The client is not authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/serverlessrepo-2017-09-08/ListApplications @@ -1202,10 +1206,12 @@ func (c *ServerlessApplicationRepository) ListApplicationsPagesWithContext(ctx a }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListApplicationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListApplicationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1263,23 +1269,23 @@ func (c *ServerlessApplicationRepository) PutApplicationPolicyRequest(input *Put // See the AWS API reference guide for AWSServerlessApplicationRepository's // API operation PutApplicationPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeNotFoundException "NotFoundException" +// Returned Error Types: +// * NotFoundException // The resource (for example, an access policy statement) specified in the request // doesn't exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The client is sending more than the allowed number of requests per unit of // time. // -// * ErrCodeBadRequestException "BadRequestException" +// * BadRequestException // One of the parameters in the request is invalid. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The AWS Serverless Application Repository service encountered an internal // error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The client is not authenticated. // // See also, https://docs.aws.amazon.com/goto/WebAPI/serverlessrepo-2017-09-08/PutApplicationPolicy @@ -1357,26 +1363,26 @@ func (c *ServerlessApplicationRepository) UpdateApplicationRequest(input *Update // See the AWS API reference guide for AWSServerlessApplicationRepository's // API operation UpdateApplication for usage and error information. // -// Returned Error Codes: -// * ErrCodeBadRequestException "BadRequestException" +// Returned Error Types: +// * BadRequestException // One of the parameters in the request is invalid. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The AWS Serverless Application Repository service encountered an internal // error. // -// * ErrCodeForbiddenException "ForbiddenException" +// * ForbiddenException // The client is not authenticated. // -// * ErrCodeNotFoundException "NotFoundException" +// * NotFoundException // The resource (for example, an access policy statement) specified in the request // doesn't exist. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The client is sending more than the allowed number of requests per unit of // time. // -// * ErrCodeConflictException "ConflictException" +// * ConflictException // The resource already exists. // // See also, https://docs.aws.amazon.com/goto/WebAPI/serverlessrepo-2017-09-08/UpdateApplication @@ -1611,6 +1617,126 @@ func (s *ApplicationSummary) SetSpdxLicenseId(v string) *ApplicationSummary { return s } +// One of the parameters in the request is invalid. +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // 400 + ErrorCode *string `locationName:"errorCode" type:"string"` + + // One of the parameters in the request is invalid. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "BadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource already exists. +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // 409 + ErrorCode *string `locationName:"errorCode" type:"string"` + + // The resource already exists. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictException) GoString() string { + return s.String() +} + +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" +} + +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil +} + +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID +} + type CreateApplicationOutput struct { _ struct{} `type:"structure"` @@ -1624,6 +1750,8 @@ type CreateApplicationOutput struct { HomePageUrl *string `locationName:"homePageUrl" type:"string"` + IsVerifiedAuthor *bool `locationName:"isVerifiedAuthor" type:"boolean"` + Labels []*string `locationName:"labels" type:"list"` LicenseUrl *string `locationName:"licenseUrl" type:"string"` @@ -1634,6 +1762,8 @@ type CreateApplicationOutput struct { SpdxLicenseId *string `locationName:"spdxLicenseId" type:"string"` + VerifiedAuthorUrl *string `locationName:"verifiedAuthorUrl" type:"string"` + // Application version details. Version *Version `locationName:"version" type:"structure"` } @@ -1678,6 +1808,12 @@ func (s *CreateApplicationOutput) SetHomePageUrl(v string) *CreateApplicationOut return s } +// SetIsVerifiedAuthor sets the IsVerifiedAuthor field's value. +func (s *CreateApplicationOutput) SetIsVerifiedAuthor(v bool) *CreateApplicationOutput { + s.IsVerifiedAuthor = &v + return s +} + // SetLabels sets the Labels field's value. func (s *CreateApplicationOutput) SetLabels(v []*string) *CreateApplicationOutput { s.Labels = v @@ -1708,6 +1844,12 @@ func (s *CreateApplicationOutput) SetSpdxLicenseId(v string) *CreateApplicationO return s } +// SetVerifiedAuthorUrl sets the VerifiedAuthorUrl field's value. +func (s *CreateApplicationOutput) SetVerifiedAuthorUrl(v string) *CreateApplicationOutput { + s.VerifiedAuthorUrl = &v + return s +} + // SetVersion sets the Version field's value. func (s *CreateApplicationOutput) SetVersion(v *Version) *CreateApplicationOutput { s.Version = v @@ -2425,6 +2567,66 @@ func (s DeleteApplicationOutput) GoString() string { return s.String() } +// The client is not authenticated. +type ForbiddenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // 403 + ErrorCode *string `locationName:"errorCode" type:"string"` + + // The client is not authenticated. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ForbiddenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ForbiddenException) GoString() string { + return s.String() +} + +func newErrorForbiddenException(v protocol.ResponseMetadata) error { + return &ForbiddenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ForbiddenException) Code() string { + return "ForbiddenException" +} + +// Message returns the exception's message. +func (s ForbiddenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ForbiddenException) OrigErr() error { + return nil +} + +func (s ForbiddenException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ForbiddenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ForbiddenException) RequestID() string { + return s.respMetadata.RequestID +} + type GetApplicationInput struct { _ struct{} `type:"structure"` @@ -2485,6 +2687,8 @@ type GetApplicationOutput struct { HomePageUrl *string `locationName:"homePageUrl" type:"string"` + IsVerifiedAuthor *bool `locationName:"isVerifiedAuthor" type:"boolean"` + Labels []*string `locationName:"labels" type:"list"` LicenseUrl *string `locationName:"licenseUrl" type:"string"` @@ -2495,6 +2699,8 @@ type GetApplicationOutput struct { SpdxLicenseId *string `locationName:"spdxLicenseId" type:"string"` + VerifiedAuthorUrl *string `locationName:"verifiedAuthorUrl" type:"string"` + // Application version details. Version *Version `locationName:"version" type:"structure"` } @@ -2539,6 +2745,12 @@ func (s *GetApplicationOutput) SetHomePageUrl(v string) *GetApplicationOutput { return s } +// SetIsVerifiedAuthor sets the IsVerifiedAuthor field's value. +func (s *GetApplicationOutput) SetIsVerifiedAuthor(v bool) *GetApplicationOutput { + s.IsVerifiedAuthor = &v + return s +} + // SetLabels sets the Labels field's value. func (s *GetApplicationOutput) SetLabels(v []*string) *GetApplicationOutput { s.Labels = v @@ -2569,6 +2781,12 @@ func (s *GetApplicationOutput) SetSpdxLicenseId(v string) *GetApplicationOutput return s } +// SetVerifiedAuthorUrl sets the VerifiedAuthorUrl field's value. +func (s *GetApplicationOutput) SetVerifiedAuthorUrl(v string) *GetApplicationOutput { + s.VerifiedAuthorUrl = &v + return s +} + // SetVersion sets the Version field's value. func (s *GetApplicationOutput) SetVersion(v *Version) *GetApplicationOutput { s.Version = v @@ -2760,6 +2978,68 @@ func (s *GetCloudFormationTemplateOutput) SetTemplateUrl(v string) *GetCloudForm return s } +// The AWS Serverless Application Repository service encountered an internal +// error. +type InternalServerErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // 500 + ErrorCode *string `locationName:"errorCode" type:"string"` + + // The AWS Serverless Application Repository service encountered an internal + // error. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalServerErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerErrorException) GoString() string { + return s.String() +} + +func newErrorInternalServerErrorException(v protocol.ResponseMetadata) error { + return &InternalServerErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerErrorException) Code() string { + return "InternalServerErrorException" +} + +// Message returns the exception's message. +func (s InternalServerErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerErrorException) OrigErr() error { + return nil +} + +func (s InternalServerErrorException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerErrorException) RequestID() string { + return s.respMetadata.RequestID +} + type ListApplicationDependenciesInput struct { _ struct{} `type:"structure"` @@ -3017,6 +3297,68 @@ func (s *ListApplicationsOutput) SetNextToken(v string) *ListApplicationsOutput return s } +// The resource (for example, an access policy statement) specified in the request +// doesn't exist. +type NotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // 404 + ErrorCode *string `locationName:"errorCode" type:"string"` + + // The resource (for example, an access policy statement) specified in the request + // doesn't exist. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotFoundException) GoString() string { + return s.String() +} + +func newErrorNotFoundException(v protocol.ResponseMetadata) error { + return &NotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NotFoundException) Code() string { + return "NotFoundException" +} + +// Message returns the exception's message. +func (s NotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NotFoundException) OrigErr() error { + return nil +} + +func (s NotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Parameters supported by the application. type ParameterDefinition struct { _ struct{} `type:"structure"` @@ -3513,6 +3855,68 @@ func (s *Tag) SetValue(v string) *Tag { return s } +// The client is sending more than the allowed number of requests per unit of +// time. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // 429 + ErrorCode *string `locationName:"errorCode" type:"string"` + + // The client is sending more than the allowed number of requests per unit of + // time. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + type UpdateApplicationOutput struct { _ struct{} `type:"structure"` @@ -3526,6 +3930,8 @@ type UpdateApplicationOutput struct { HomePageUrl *string `locationName:"homePageUrl" type:"string"` + IsVerifiedAuthor *bool `locationName:"isVerifiedAuthor" type:"boolean"` + Labels []*string `locationName:"labels" type:"list"` LicenseUrl *string `locationName:"licenseUrl" type:"string"` @@ -3536,6 +3942,8 @@ type UpdateApplicationOutput struct { SpdxLicenseId *string `locationName:"spdxLicenseId" type:"string"` + VerifiedAuthorUrl *string `locationName:"verifiedAuthorUrl" type:"string"` + // Application version details. Version *Version `locationName:"version" type:"structure"` } @@ -3580,6 +3988,12 @@ func (s *UpdateApplicationOutput) SetHomePageUrl(v string) *UpdateApplicationOut return s } +// SetIsVerifiedAuthor sets the IsVerifiedAuthor field's value. +func (s *UpdateApplicationOutput) SetIsVerifiedAuthor(v bool) *UpdateApplicationOutput { + s.IsVerifiedAuthor = &v + return s +} + // SetLabels sets the Labels field's value. func (s *UpdateApplicationOutput) SetLabels(v []*string) *UpdateApplicationOutput { s.Labels = v @@ -3610,6 +4024,12 @@ func (s *UpdateApplicationOutput) SetSpdxLicenseId(v string) *UpdateApplicationO return s } +// SetVerifiedAuthorUrl sets the VerifiedAuthorUrl field's value. +func (s *UpdateApplicationOutput) SetVerifiedAuthorUrl(v string) *UpdateApplicationOutput { + s.VerifiedAuthorUrl = &v + return s +} + // SetVersion sets the Version field's value. func (s *UpdateApplicationOutput) SetVersion(v *Version) *UpdateApplicationOutput { s.Version = v diff --git a/vendor/github.com/aws/aws-sdk-go/service/serverlessapplicationrepository/errors.go b/vendor/github.com/aws/aws-sdk-go/service/serverlessapplicationrepository/errors.go index 2855c3aec7c..a6cae0c919f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/serverlessapplicationrepository/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/serverlessapplicationrepository/errors.go @@ -2,6 +2,10 @@ package serverlessapplicationrepository +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadRequestException for service response error code @@ -43,3 +47,12 @@ const ( // time. ErrCodeTooManyRequestsException = "TooManyRequestsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "BadRequestException": newErrorBadRequestException, + "ConflictException": newErrorConflictException, + "ForbiddenException": newErrorForbiddenException, + "InternalServerErrorException": newErrorInternalServerErrorException, + "NotFoundException": newErrorNotFoundException, + "TooManyRequestsException": newErrorTooManyRequestsException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/serverlessapplicationrepository/service.go b/vendor/github.com/aws/aws-sdk-go/service/serverlessapplicationrepository/service.go index 5702ab93313..289f4a111f6 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/serverlessapplicationrepository/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/serverlessapplicationrepository/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "serverlessrepo" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "ServerlessApplicationRepository" // ServiceID is a unique identifer of a specific service. + ServiceID = "ServerlessApplicationRepository" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ServerlessApplicationRepository client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ServerlessApplicationRepository client from just a session. // svc := serverlessapplicationrepository.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *ServerlessApplicationRep if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "serverlessrepo" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ServerlessApplicationRepository { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ServerlessApplicationRepository { svc := &ServerlessApplicationRepository{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-09-08", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/servicecatalog/api.go b/vendor/github.com/aws/aws-sdk-go/service/servicecatalog/api.go index 3083863c8fd..4644fc01373 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/servicecatalog/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/servicecatalog/api.go @@ -67,14 +67,14 @@ func (c *ServiceCatalog) AcceptPortfolioShareRequest(input *AcceptPortfolioShare // See the AWS API reference guide for AWS Service Catalog's // API operation AcceptPortfolioShare for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The current limits of the service would have been exceeded by this operation. // Decrease your resource use or increase your service limits and retry the // operation. @@ -155,19 +155,19 @@ func (c *ServiceCatalog) AssociateBudgetWithResourceRequest(input *AssociateBudg // See the AWS API reference guide for AWS Service Catalog's // API operation AssociateBudgetWithResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeDuplicateResourceException "DuplicateResourceException" +// * DuplicateResourceException // The specified resource is a duplicate. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The current limits of the service would have been exceeded by this operation. // Decrease your resource use or increase your service limits and retry the // operation. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/AssociateBudgetWithResource @@ -246,14 +246,14 @@ func (c *ServiceCatalog) AssociatePrincipalWithPortfolioRequest(input *Associate // See the AWS API reference guide for AWS Service Catalog's // API operation AssociatePrincipalWithPortfolio for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The current limits of the service would have been exceeded by this operation. // Decrease your resource use or increase your service limits and retry the // operation. @@ -334,14 +334,14 @@ func (c *ServiceCatalog) AssociateProductWithPortfolioRequest(input *AssociatePr // See the AWS API reference guide for AWS Service Catalog's // API operation AssociateProductWithPortfolio for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The current limits of the service would have been exceeded by this operation. // Decrease your resource use or increase your service limits and retry the // operation. @@ -422,14 +422,14 @@ func (c *ServiceCatalog) AssociateServiceActionWithProvisioningArtifactRequest(i // See the AWS API reference guide for AWS Service Catalog's // API operation AssociateServiceActionWithProvisioningArtifact for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeDuplicateResourceException "DuplicateResourceException" +// * DuplicateResourceException // The specified resource is a duplicate. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The current limits of the service would have been exceeded by this operation. // Decrease your resource use or increase your service limits and retry the // operation. @@ -510,27 +510,27 @@ func (c *ServiceCatalog) AssociateTagOptionWithResourceRequest(input *AssociateT // See the AWS API reference guide for AWS Service Catalog's // API operation AssociateTagOptionWithResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeTagOptionNotMigratedException "TagOptionNotMigratedException" +// Returned Error Types: +// * TagOptionNotMigratedException // An operation requiring TagOptions failed because the TagOptions migration // process has not been performed for this account. Please use the AWS console // to perform the migration process before retrying the operation. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The current limits of the service would have been exceeded by this operation. // Decrease your resource use or increase your service limits and retry the // operation. // -// * ErrCodeDuplicateResourceException "DuplicateResourceException" +// * DuplicateResourceException // The specified resource is a duplicate. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // An attempt was made to modify a resource that is in a state that is not valid. // Check your resources to ensure that they are in valid states before retrying // the operation. @@ -610,8 +610,8 @@ func (c *ServiceCatalog) BatchAssociateServiceActionWithProvisioningArtifactRequ // See the AWS API reference guide for AWS Service Catalog's // API operation BatchAssociateServiceActionWithProvisioningArtifact for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/BatchAssociateServiceActionWithProvisioningArtifact @@ -690,8 +690,8 @@ func (c *ServiceCatalog) BatchDisassociateServiceActionFromProvisioningArtifactR // See the AWS API reference guide for AWS Service Catalog's // API operation BatchDisassociateServiceActionFromProvisioningArtifact for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/BatchDisassociateServiceActionFromProvisioningArtifact @@ -776,11 +776,11 @@ func (c *ServiceCatalog) CopyProductRequest(input *CopyProductInput) (req *reque // See the AWS API reference guide for AWS Service Catalog's // API operation CopyProduct for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CopyProduct @@ -858,19 +858,19 @@ func (c *ServiceCatalog) CreateConstraintRequest(input *CreateConstraintInput) ( // See the AWS API reference guide for AWS Service Catalog's // API operation CreateConstraint for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The current limits of the service would have been exceeded by this operation. // Decrease your resource use or increase your service limits and retry the // operation. // -// * ErrCodeDuplicateResourceException "DuplicateResourceException" +// * DuplicateResourceException // The specified resource is a duplicate. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/CreateConstraint @@ -948,16 +948,16 @@ func (c *ServiceCatalog) CreatePortfolioRequest(input *CreatePortfolioInput) (re // See the AWS API reference guide for AWS Service Catalog's // API operation CreatePortfolio for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The current limits of the service would have been exceeded by this operation. // Decrease your resource use or increase your service limits and retry the // operation. // -// * ErrCodeTagOptionNotMigratedException "TagOptionNotMigratedException" +// * TagOptionNotMigratedException // An operation requiring TagOptions failed because the TagOptions migration // process has not been performed for this account. Please use the AWS console // to perform the migration process before retrying the operation. @@ -1040,22 +1040,22 @@ func (c *ServiceCatalog) CreatePortfolioShareRequest(input *CreatePortfolioShare // See the AWS API reference guide for AWS Service Catalog's // API operation CreatePortfolioShare for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The current limits of the service would have been exceeded by this operation. // Decrease your resource use or increase your service limits and retry the // operation. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeOperationNotSupportedException "OperationNotSupportedException" +// * OperationNotSupportedException // The operation is not supported. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // An attempt was made to modify a resource that is in a state that is not valid. // Check your resources to ensure that they are in valid states before retrying // the operation. @@ -1135,16 +1135,16 @@ func (c *ServiceCatalog) CreateProductRequest(input *CreateProductInput) (req *r // See the AWS API reference guide for AWS Service Catalog's // API operation CreateProduct for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The current limits of the service would have been exceeded by this operation. // Decrease your resource use or increase your service limits and retry the // operation. // -// * ErrCodeTagOptionNotMigratedException "TagOptionNotMigratedException" +// * TagOptionNotMigratedException // An operation requiring TagOptions failed because the TagOptions migration // process has not been performed for this account. Please use the AWS console // to perform the migration process before retrying the operation. @@ -1232,14 +1232,14 @@ func (c *ServiceCatalog) CreateProvisionedProductPlanRequest(input *CreateProvis // See the AWS API reference guide for AWS Service Catalog's // API operation CreateProvisionedProductPlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // An attempt was made to modify a resource that is in a state that is not valid. // Check your resources to ensure that they are in valid states before retrying // the operation. @@ -1323,14 +1323,14 @@ func (c *ServiceCatalog) CreateProvisioningArtifactRequest(input *CreateProvisio // See the AWS API reference guide for AWS Service Catalog's // API operation CreateProvisioningArtifact for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The current limits of the service would have been exceeded by this operation. // Decrease your resource use or increase your service limits and retry the // operation. @@ -1410,11 +1410,11 @@ func (c *ServiceCatalog) CreateServiceActionRequest(input *CreateServiceActionIn // See the AWS API reference guide for AWS Service Catalog's // API operation CreateServiceAction for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The current limits of the service would have been exceeded by this operation. // Decrease your resource use or increase your service limits and retry the // operation. @@ -1494,16 +1494,16 @@ func (c *ServiceCatalog) CreateTagOptionRequest(input *CreateTagOptionInput) (re // See the AWS API reference guide for AWS Service Catalog's // API operation CreateTagOption for usage and error information. // -// Returned Error Codes: -// * ErrCodeTagOptionNotMigratedException "TagOptionNotMigratedException" +// Returned Error Types: +// * TagOptionNotMigratedException // An operation requiring TagOptions failed because the TagOptions migration // process has not been performed for this account. Please use the AWS console // to perform the migration process before retrying the operation. // -// * ErrCodeDuplicateResourceException "DuplicateResourceException" +// * DuplicateResourceException // The specified resource is a duplicate. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The current limits of the service would have been exceeded by this operation. // Decrease your resource use or increase your service limits and retry the // operation. @@ -1584,11 +1584,11 @@ func (c *ServiceCatalog) DeleteConstraintRequest(input *DeleteConstraintInput) ( // See the AWS API reference guide for AWS Service Catalog's // API operation DeleteConstraint for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteConstraint @@ -1670,18 +1670,18 @@ func (c *ServiceCatalog) DeletePortfolioRequest(input *DeletePortfolioInput) (re // See the AWS API reference guide for AWS Service Catalog's // API operation DeletePortfolio for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // A resource that is currently in use. Ensure that the resource is not in use // and retry the operation. // -// * ErrCodeTagOptionNotMigratedException "TagOptionNotMigratedException" +// * TagOptionNotMigratedException // An operation requiring TagOptions failed because the TagOptions migration // process has not been performed for this account. Please use the AWS console // to perform the migration process before retrying the operation. @@ -1763,17 +1763,17 @@ func (c *ServiceCatalog) DeletePortfolioShareRequest(input *DeletePortfolioShare // See the AWS API reference guide for AWS Service Catalog's // API operation DeletePortfolioShare for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeOperationNotSupportedException "OperationNotSupportedException" +// * OperationNotSupportedException // The operation is not supported. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // An attempt was made to modify a resource that is in a state that is not valid. // Check your resources to ensure that they are in valid states before retrying // the operation. @@ -1857,18 +1857,18 @@ func (c *ServiceCatalog) DeleteProductRequest(input *DeleteProductInput) (req *r // See the AWS API reference guide for AWS Service Catalog's // API operation DeleteProduct for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // A resource that is currently in use. Ensure that the resource is not in use // and retry the operation. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeTagOptionNotMigratedException "TagOptionNotMigratedException" +// * TagOptionNotMigratedException // An operation requiring TagOptions failed because the TagOptions migration // process has not been performed for this account. Please use the AWS console // to perform the migration process before retrying the operation. @@ -1949,11 +1949,11 @@ func (c *ServiceCatalog) DeleteProvisionedProductPlanRequest(input *DeleteProvis // See the AWS API reference guide for AWS Service Catalog's // API operation DeleteProvisionedProductPlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteProvisionedProductPlan @@ -2037,15 +2037,15 @@ func (c *ServiceCatalog) DeleteProvisioningArtifactRequest(input *DeleteProvisio // See the AWS API reference guide for AWS Service Catalog's // API operation DeleteProvisioningArtifact for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // A resource that is currently in use. Ensure that the resource is not in use // and retry the operation. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteProvisioningArtifact @@ -2124,11 +2124,11 @@ func (c *ServiceCatalog) DeleteServiceActionRequest(input *DeleteServiceActionIn // See the AWS API reference guide for AWS Service Catalog's // API operation DeleteServiceAction for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // A resource that is currently in use. Ensure that the resource is not in use // and retry the operation. // @@ -2210,17 +2210,17 @@ func (c *ServiceCatalog) DeleteTagOptionRequest(input *DeleteTagOptionInput) (re // See the AWS API reference guide for AWS Service Catalog's // API operation DeleteTagOption for usage and error information. // -// Returned Error Codes: -// * ErrCodeTagOptionNotMigratedException "TagOptionNotMigratedException" +// Returned Error Types: +// * TagOptionNotMigratedException // An operation requiring TagOptions failed because the TagOptions migration // process has not been performed for this account. Please use the AWS console // to perform the migration process before retrying the operation. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // A resource that is currently in use. Ensure that the resource is not in use // and retry the operation. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DeleteTagOption @@ -2298,8 +2298,8 @@ func (c *ServiceCatalog) DescribeConstraintRequest(input *DescribeConstraintInpu // See the AWS API reference guide for AWS Service Catalog's // API operation DescribeConstraint for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeConstraint @@ -2377,8 +2377,8 @@ func (c *ServiceCatalog) DescribeCopyProductStatusRequest(input *DescribeCopyPro // See the AWS API reference guide for AWS Service Catalog's // API operation DescribeCopyProductStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeCopyProductStatus @@ -2456,8 +2456,8 @@ func (c *ServiceCatalog) DescribePortfolioRequest(input *DescribePortfolioInput) // See the AWS API reference guide for AWS Service Catalog's // API operation DescribePortfolio for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribePortfolio @@ -2536,14 +2536,14 @@ func (c *ServiceCatalog) DescribePortfolioShareStatusRequest(input *DescribePort // See the AWS API reference guide for AWS Service Catalog's // API operation DescribePortfolioShareStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeOperationNotSupportedException "OperationNotSupportedException" +// * OperationNotSupportedException // The operation is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribePortfolioShareStatus @@ -2621,11 +2621,11 @@ func (c *ServiceCatalog) DescribeProductRequest(input *DescribeProductInput) (re // See the AWS API reference guide for AWS Service Catalog's // API operation DescribeProduct for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProduct @@ -2704,8 +2704,8 @@ func (c *ServiceCatalog) DescribeProductAsAdminRequest(input *DescribeProductAsA // See the AWS API reference guide for AWS Service Catalog's // API operation DescribeProductAsAdmin for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProductAsAdmin @@ -2783,11 +2783,11 @@ func (c *ServiceCatalog) DescribeProductViewRequest(input *DescribeProductViewIn // See the AWS API reference guide for AWS Service Catalog's // API operation DescribeProductView for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProductView @@ -2865,8 +2865,8 @@ func (c *ServiceCatalog) DescribeProvisionedProductRequest(input *DescribeProvis // See the AWS API reference guide for AWS Service Catalog's // API operation DescribeProvisionedProduct for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisionedProduct @@ -2944,11 +2944,11 @@ func (c *ServiceCatalog) DescribeProvisionedProductPlanRequest(input *DescribePr // See the AWS API reference guide for AWS Service Catalog's // API operation DescribeProvisionedProductPlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisionedProductPlan @@ -3027,8 +3027,8 @@ func (c *ServiceCatalog) DescribeProvisioningArtifactRequest(input *DescribeProv // See the AWS API reference guide for AWS Service Catalog's // API operation DescribeProvisioningArtifact for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisioningArtifact @@ -3114,11 +3114,11 @@ func (c *ServiceCatalog) DescribeProvisioningParametersRequest(input *DescribePr // See the AWS API reference guide for AWS Service Catalog's // API operation DescribeProvisioningParameters for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeProvisioningParameters @@ -3205,8 +3205,8 @@ func (c *ServiceCatalog) DescribeRecordRequest(input *DescribeRecordInput) (req // See the AWS API reference guide for AWS Service Catalog's // API operation DescribeRecord for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeRecord @@ -3284,8 +3284,8 @@ func (c *ServiceCatalog) DescribeServiceActionRequest(input *DescribeServiceActi // See the AWS API reference guide for AWS Service Catalog's // API operation DescribeServiceAction for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeServiceAction @@ -3354,6 +3354,9 @@ func (c *ServiceCatalog) DescribeServiceActionExecutionParametersRequest(input * // DescribeServiceActionExecutionParameters API operation for AWS Service Catalog. // +// Finds the default parameters for a specific self-service action on a specific +// provisioned product and returns a map of the results to 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. @@ -3361,11 +3364,11 @@ func (c *ServiceCatalog) DescribeServiceActionExecutionParametersRequest(input * // See the AWS API reference guide for AWS Service Catalog's // API operation DescribeServiceActionExecutionParameters for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeServiceActionExecutionParameters @@ -3443,13 +3446,13 @@ func (c *ServiceCatalog) DescribeTagOptionRequest(input *DescribeTagOptionInput) // See the AWS API reference guide for AWS Service Catalog's // API operation DescribeTagOption for usage and error information. // -// Returned Error Codes: -// * ErrCodeTagOptionNotMigratedException "TagOptionNotMigratedException" +// Returned Error Types: +// * TagOptionNotMigratedException // An operation requiring TagOptions failed because the TagOptions migration // process has not been performed for this account. Please use the AWS console // to perform the migration process before retrying the operation. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DescribeTagOption @@ -3532,16 +3535,16 @@ func (c *ServiceCatalog) DisableAWSOrganizationsAccessRequest(input *DisableAWSO // See the AWS API reference guide for AWS Service Catalog's // API operation DisableAWSOrganizationsAccess for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // An attempt was made to modify a resource that is in a state that is not valid. // Check your resources to ensure that they are in valid states before retrying // the operation. // -// * ErrCodeOperationNotSupportedException "OperationNotSupportedException" +// * OperationNotSupportedException // The operation is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisableAWSOrganizationsAccess @@ -3620,8 +3623,8 @@ func (c *ServiceCatalog) DisassociateBudgetFromResourceRequest(input *Disassocia // See the AWS API reference guide for AWS Service Catalog's // API operation DisassociateBudgetFromResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociateBudgetFromResource @@ -3700,11 +3703,11 @@ func (c *ServiceCatalog) DisassociatePrincipalFromPortfolioRequest(input *Disass // See the AWS API reference guide for AWS Service Catalog's // API operation DisassociatePrincipalFromPortfolio for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociatePrincipalFromPortfolio @@ -3783,15 +3786,15 @@ func (c *ServiceCatalog) DisassociateProductFromPortfolioRequest(input *Disassoc // See the AWS API reference guide for AWS Service Catalog's // API operation DisassociateProductFromPortfolio for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeResourceInUseException "ResourceInUseException" +// * ResourceInUseException // A resource that is currently in use. Ensure that the resource is not in use // and retry the operation. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociateProductFromPortfolio @@ -3871,8 +3874,8 @@ func (c *ServiceCatalog) DisassociateServiceActionFromProvisioningArtifactReques // See the AWS API reference guide for AWS Service Catalog's // API operation DisassociateServiceActionFromProvisioningArtifact for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociateServiceActionFromProvisioningArtifact @@ -3951,13 +3954,13 @@ func (c *ServiceCatalog) DisassociateTagOptionFromResourceRequest(input *Disasso // See the AWS API reference guide for AWS Service Catalog's // API operation DisassociateTagOptionFromResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeTagOptionNotMigratedException "TagOptionNotMigratedException" +// Returned Error Types: +// * TagOptionNotMigratedException // An operation requiring TagOptions failed because the TagOptions migration // process has not been performed for this account. Please use the AWS console // to perform the migration process before retrying the operation. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/DisassociateTagOptionFromResource @@ -4043,16 +4046,16 @@ func (c *ServiceCatalog) EnableAWSOrganizationsAccessRequest(input *EnableAWSOrg // See the AWS API reference guide for AWS Service Catalog's // API operation EnableAWSOrganizationsAccess for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // An attempt was made to modify a resource that is in a state that is not valid. // Check your resources to ensure that they are in valid states before retrying // the operation. // -// * ErrCodeOperationNotSupportedException "OperationNotSupportedException" +// * OperationNotSupportedException // The operation is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/EnableAWSOrganizationsAccess @@ -4131,14 +4134,14 @@ func (c *ServiceCatalog) ExecuteProvisionedProductPlanRequest(input *ExecuteProv // See the AWS API reference guide for AWS Service Catalog's // API operation ExecuteProvisionedProductPlan for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // An attempt was made to modify a resource that is in a state that is not valid. // Check your resources to ensure that they are in valid states before retrying // the operation. @@ -4218,14 +4221,14 @@ func (c *ServiceCatalog) ExecuteProvisionedProductServiceActionRequest(input *Ex // See the AWS API reference guide for AWS Service Catalog's // API operation ExecuteProvisionedProductServiceAction for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // An attempt was made to modify a resource that is in a state that is not valid. // Check your resources to ensure that they are in valid states before retrying // the operation. @@ -4306,11 +4309,11 @@ func (c *ServiceCatalog) GetAWSOrganizationsAccessStatusRequest(input *GetAWSOrg // See the AWS API reference guide for AWS Service Catalog's // API operation GetAWSOrganizationsAccessStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeOperationNotSupportedException "OperationNotSupportedException" +// * OperationNotSupportedException // The operation is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/GetAWSOrganizationsAccessStatus @@ -4394,11 +4397,11 @@ func (c *ServiceCatalog) ListAcceptedPortfolioSharesRequest(input *ListAcceptedP // See the AWS API reference guide for AWS Service Catalog's // API operation ListAcceptedPortfolioShares for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeOperationNotSupportedException "OperationNotSupportedException" +// * OperationNotSupportedException // The operation is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListAcceptedPortfolioShares @@ -4466,10 +4469,12 @@ func (c *ServiceCatalog) ListAcceptedPortfolioSharesPagesWithContext(ctx aws.Con }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAcceptedPortfolioSharesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAcceptedPortfolioSharesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4532,11 +4537,11 @@ func (c *ServiceCatalog) ListBudgetsForResourceRequest(input *ListBudgetsForReso // See the AWS API reference guide for AWS Service Catalog's // API operation ListBudgetsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListBudgetsForResource @@ -4604,10 +4609,12 @@ func (c *ServiceCatalog) ListBudgetsForResourcePagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListBudgetsForResourceOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListBudgetsForResourceOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4670,11 +4677,11 @@ func (c *ServiceCatalog) ListConstraintsForPortfolioRequest(input *ListConstrain // See the AWS API reference guide for AWS Service Catalog's // API operation ListConstraintsForPortfolio for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListConstraintsForPortfolio @@ -4742,10 +4749,12 @@ func (c *ServiceCatalog) ListConstraintsForPortfolioPagesWithContext(ctx aws.Con }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListConstraintsForPortfolioOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListConstraintsForPortfolioOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4810,11 +4819,11 @@ func (c *ServiceCatalog) ListLaunchPathsRequest(input *ListLaunchPathsInput) (re // See the AWS API reference guide for AWS Service Catalog's // API operation ListLaunchPaths for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListLaunchPaths @@ -4882,10 +4891,12 @@ func (c *ServiceCatalog) ListLaunchPathsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListLaunchPathsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListLaunchPathsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4949,14 +4960,14 @@ func (c *ServiceCatalog) ListOrganizationPortfolioAccessRequest(input *ListOrgan // See the AWS API reference guide for AWS Service Catalog's // API operation ListOrganizationPortfolioAccess for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeOperationNotSupportedException "OperationNotSupportedException" +// * OperationNotSupportedException // The operation is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListOrganizationPortfolioAccess @@ -5024,10 +5035,12 @@ func (c *ServiceCatalog) ListOrganizationPortfolioAccessPagesWithContext(ctx aws }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOrganizationPortfolioAccessOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListOrganizationPortfolioAccessOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5062,6 +5075,12 @@ func (c *ServiceCatalog) ListPortfolioAccessRequest(input *ListPortfolioAccessIn Name: opListPortfolioAccess, HTTPMethod: "POST", HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"PageToken"}, + OutputTokens: []string{"NextPageToken"}, + LimitToken: "PageSize", + TruncationToken: "", + }, } if input == nil { @@ -5084,10 +5103,13 @@ func (c *ServiceCatalog) ListPortfolioAccessRequest(input *ListPortfolioAccessIn // See the AWS API reference guide for AWS Service Catalog's // API operation ListPortfolioAccess for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // +// * InvalidParametersException +// One or more parameters provided to the operation are not valid. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPortfolioAccess func (c *ServiceCatalog) ListPortfolioAccess(input *ListPortfolioAccessInput) (*ListPortfolioAccessOutput, error) { req, out := c.ListPortfolioAccessRequest(input) @@ -5110,6 +5132,58 @@ func (c *ServiceCatalog) ListPortfolioAccessWithContext(ctx aws.Context, input * return out, req.Send() } +// ListPortfolioAccessPages iterates over the pages of a ListPortfolioAccess operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListPortfolioAccess 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 ListPortfolioAccess operation. +// pageNum := 0 +// err := client.ListPortfolioAccessPages(params, +// func(page *servicecatalog.ListPortfolioAccessOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *ServiceCatalog) ListPortfolioAccessPages(input *ListPortfolioAccessInput, fn func(*ListPortfolioAccessOutput, bool) bool) error { + return c.ListPortfolioAccessPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListPortfolioAccessPagesWithContext same as ListPortfolioAccessPages 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 *ServiceCatalog) ListPortfolioAccessPagesWithContext(ctx aws.Context, input *ListPortfolioAccessInput, fn func(*ListPortfolioAccessOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListPortfolioAccessInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListPortfolioAccessRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListPortfolioAccessOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + const opListPortfolios = "ListPortfolios" // ListPortfoliosRequest generates a "aws/request.Request" representing the @@ -5169,8 +5243,8 @@ func (c *ServiceCatalog) ListPortfoliosRequest(input *ListPortfoliosInput) (req // See the AWS API reference guide for AWS Service Catalog's // API operation ListPortfolios for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPortfolios @@ -5238,10 +5312,12 @@ func (c *ServiceCatalog) ListPortfoliosPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPortfoliosOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPortfoliosOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5304,11 +5380,11 @@ func (c *ServiceCatalog) ListPortfoliosForProductRequest(input *ListPortfoliosFo // See the AWS API reference guide for AWS Service Catalog's // API operation ListPortfoliosForProduct for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPortfoliosForProduct @@ -5376,10 +5452,12 @@ func (c *ServiceCatalog) ListPortfoliosForProductPagesWithContext(ctx aws.Contex }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPortfoliosForProductOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPortfoliosForProductOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5442,11 +5520,11 @@ func (c *ServiceCatalog) ListPrincipalsForPortfolioRequest(input *ListPrincipals // See the AWS API reference guide for AWS Service Catalog's // API operation ListPrincipalsForPortfolio for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListPrincipalsForPortfolio @@ -5514,10 +5592,12 @@ func (c *ServiceCatalog) ListPrincipalsForPortfolioPagesWithContext(ctx aws.Cont }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPrincipalsForPortfolioOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPrincipalsForPortfolioOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5575,11 +5655,11 @@ func (c *ServiceCatalog) ListProvisionedProductPlansRequest(input *ListProvision // See the AWS API reference guide for AWS Service Catalog's // API operation ListProvisionedProductPlans for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListProvisionedProductPlans @@ -5658,11 +5738,11 @@ func (c *ServiceCatalog) ListProvisioningArtifactsRequest(input *ListProvisionin // See the AWS API reference guide for AWS Service Catalog's // API operation ListProvisioningArtifacts for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListProvisioningArtifacts @@ -5747,11 +5827,11 @@ func (c *ServiceCatalog) ListProvisioningArtifactsForServiceActionRequest(input // See the AWS API reference guide for AWS Service Catalog's // API operation ListProvisioningArtifactsForServiceAction for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListProvisioningArtifactsForServiceAction @@ -5819,10 +5899,12 @@ func (c *ServiceCatalog) ListProvisioningArtifactsForServiceActionPagesWithConte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListProvisioningArtifactsForServiceActionOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListProvisioningArtifactsForServiceActionOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5879,8 +5961,8 @@ func (c *ServiceCatalog) ListRecordHistoryRequest(input *ListRecordHistoryInput) // See the AWS API reference guide for AWS Service Catalog's // API operation ListRecordHistory for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListRecordHistory @@ -5964,16 +6046,16 @@ func (c *ServiceCatalog) ListResourcesForTagOptionRequest(input *ListResourcesFo // See the AWS API reference guide for AWS Service Catalog's // API operation ListResourcesForTagOption for usage and error information. // -// Returned Error Codes: -// * ErrCodeTagOptionNotMigratedException "TagOptionNotMigratedException" +// Returned Error Types: +// * TagOptionNotMigratedException // An operation requiring TagOptions failed because the TagOptions migration // process has not been performed for this account. Please use the AWS console // to perform the migration process before retrying the operation. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListResourcesForTagOption @@ -6041,10 +6123,12 @@ func (c *ServiceCatalog) ListResourcesForTagOptionPagesWithContext(ctx aws.Conte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListResourcesForTagOptionOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListResourcesForTagOptionOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6107,8 +6191,8 @@ func (c *ServiceCatalog) ListServiceActionsRequest(input *ListServiceActionsInpu // See the AWS API reference guide for AWS Service Catalog's // API operation ListServiceActions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListServiceActions @@ -6176,10 +6260,12 @@ func (c *ServiceCatalog) ListServiceActionsPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListServiceActionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListServiceActionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6243,11 +6329,11 @@ func (c *ServiceCatalog) ListServiceActionsForProvisioningArtifactRequest(input // See the AWS API reference guide for AWS Service Catalog's // API operation ListServiceActionsForProvisioningArtifact for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListServiceActionsForProvisioningArtifact @@ -6315,10 +6401,12 @@ func (c *ServiceCatalog) ListServiceActionsForProvisioningArtifactPagesWithConte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListServiceActionsForProvisioningArtifactOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListServiceActionsForProvisioningArtifactOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6377,11 +6465,11 @@ func (c *ServiceCatalog) ListStackInstancesForProvisionedProductRequest(input *L // See the AWS API reference guide for AWS Service Catalog's // API operation ListStackInstancesForProvisionedProduct for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListStackInstancesForProvisionedProduct @@ -6465,13 +6553,13 @@ func (c *ServiceCatalog) ListTagOptionsRequest(input *ListTagOptionsInput) (req // See the AWS API reference guide for AWS Service Catalog's // API operation ListTagOptions for usage and error information. // -// Returned Error Codes: -// * ErrCodeTagOptionNotMigratedException "TagOptionNotMigratedException" +// Returned Error Types: +// * TagOptionNotMigratedException // An operation requiring TagOptions failed because the TagOptions migration // process has not been performed for this account. Please use the AWS console // to perform the migration process before retrying the operation. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ListTagOptions @@ -6539,10 +6627,12 @@ func (c *ServiceCatalog) ListTagOptionsPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagOptionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTagOptionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6609,14 +6699,14 @@ func (c *ServiceCatalog) ProvisionProductRequest(input *ProvisionProductInput) ( // See the AWS API reference guide for AWS Service Catalog's // API operation ProvisionProduct for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeDuplicateResourceException "DuplicateResourceException" +// * DuplicateResourceException // The specified resource is a duplicate. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ProvisionProduct @@ -6695,8 +6785,8 @@ func (c *ServiceCatalog) RejectPortfolioShareRequest(input *RejectPortfolioShare // See the AWS API reference guide for AWS Service Catalog's // API operation RejectPortfolioShare for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/RejectPortfolioShare @@ -6776,8 +6866,8 @@ func (c *ServiceCatalog) ScanProvisionedProductsRequest(input *ScanProvisionedPr // See the AWS API reference guide for AWS Service Catalog's // API operation ScanProvisionedProducts for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/ScanProvisionedProducts @@ -6861,8 +6951,8 @@ func (c *ServiceCatalog) SearchProductsRequest(input *SearchProductsInput) (req // See the AWS API reference guide for AWS Service Catalog's // API operation SearchProducts for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/SearchProducts @@ -6930,10 +7020,12 @@ func (c *ServiceCatalog) SearchProductsPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SearchProductsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*SearchProductsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6996,11 +7088,11 @@ func (c *ServiceCatalog) SearchProductsAsAdminRequest(input *SearchProductsAsAdm // See the AWS API reference guide for AWS Service Catalog's // API operation SearchProductsAsAdmin for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/SearchProductsAsAdmin @@ -7068,10 +7160,12 @@ func (c *ServiceCatalog) SearchProductsAsAdminPagesWithContext(ctx aws.Context, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SearchProductsAsAdminOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*SearchProductsAsAdminOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7134,8 +7228,8 @@ func (c *ServiceCatalog) SearchProvisionedProductsRequest(input *SearchProvision // See the AWS API reference guide for AWS Service Catalog's // API operation SearchProvisionedProducts for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/SearchProvisionedProducts @@ -7203,10 +7297,12 @@ func (c *ServiceCatalog) SearchProvisionedProductsPagesWithContext(ctx aws.Conte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SearchProvisionedProductsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*SearchProvisionedProductsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7268,8 +7364,8 @@ func (c *ServiceCatalog) TerminateProvisionedProductRequest(input *TerminateProv // See the AWS API reference guide for AWS Service Catalog's // API operation TerminateProvisionedProduct for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/TerminateProvisionedProduct @@ -7347,11 +7443,11 @@ func (c *ServiceCatalog) UpdateConstraintRequest(input *UpdateConstraintInput) ( // See the AWS API reference guide for AWS Service Catalog's // API operation UpdateConstraint for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateConstraint @@ -7431,19 +7527,19 @@ func (c *ServiceCatalog) UpdatePortfolioRequest(input *UpdatePortfolioInput) (re // See the AWS API reference guide for AWS Service Catalog's // API operation UpdatePortfolio for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeLimitExceededException "LimitExceededException" +// * LimitExceededException // The current limits of the service would have been exceeded by this operation. // Decrease your resource use or increase your service limits and retry the // operation. // -// * ErrCodeTagOptionNotMigratedException "TagOptionNotMigratedException" +// * TagOptionNotMigratedException // An operation requiring TagOptions failed because the TagOptions migration // process has not been performed for this account. Please use the AWS console // to perform the migration process before retrying the operation. @@ -7523,14 +7619,14 @@ func (c *ServiceCatalog) UpdateProductRequest(input *UpdateProductInput) (req *r // See the AWS API reference guide for AWS Service Catalog's // API operation UpdateProduct for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeTagOptionNotMigratedException "TagOptionNotMigratedException" +// * TagOptionNotMigratedException // An operation requiring TagOptions failed because the TagOptions migration // process has not been performed for this account. Please use the AWS console // to perform the migration process before retrying the operation. @@ -7617,11 +7713,11 @@ func (c *ServiceCatalog) UpdateProvisionedProductRequest(input *UpdateProvisione // See the AWS API reference guide for AWS Service Catalog's // API operation UpdateProvisionedProduct for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateProvisionedProduct @@ -7699,14 +7795,14 @@ func (c *ServiceCatalog) UpdateProvisionedProductPropertiesRequest(input *Update // See the AWS API reference guide for AWS Service Catalog's // API operation UpdateProvisionedProductProperties for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParametersException "InvalidParametersException" +// Returned Error Types: +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidStateException "InvalidStateException" +// * InvalidStateException // An attempt was made to modify a resource that is in a state that is not valid. // Check your resources to ensure that they are in valid states before retrying // the operation. @@ -7790,11 +7886,11 @@ func (c *ServiceCatalog) UpdateProvisioningArtifactRequest(input *UpdateProvisio // See the AWS API reference guide for AWS Service Catalog's // API operation UpdateProvisioningArtifact for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateProvisioningArtifact @@ -7872,11 +7968,11 @@ func (c *ServiceCatalog) UpdateServiceActionRequest(input *UpdateServiceActionIn // See the AWS API reference guide for AWS Service Catalog's // API operation UpdateServiceAction for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateServiceAction @@ -7954,19 +8050,19 @@ func (c *ServiceCatalog) UpdateTagOptionRequest(input *UpdateTagOptionInput) (re // See the AWS API reference guide for AWS Service Catalog's // API operation UpdateTagOption for usage and error information. // -// Returned Error Codes: -// * ErrCodeTagOptionNotMigratedException "TagOptionNotMigratedException" +// Returned Error Types: +// * TagOptionNotMigratedException // An operation requiring TagOptions failed because the TagOptions migration // process has not been performed for this account. Please use the AWS console // to perform the migration process before retrying the operation. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The specified resource was not found. // -// * ErrCodeDuplicateResourceException "DuplicateResourceException" +// * DuplicateResourceException // The specified resource is a duplicate. // -// * ErrCodeInvalidParametersException "InvalidParametersException" +// * InvalidParametersException // One or more parameters provided to the operation are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicecatalog-2015-12-10/UpdateTagOption @@ -10143,7 +10239,7 @@ type CreateServiceActionInput struct { // // The list of parameters in JSON format. // - // For example: [{\"Name\":\"InstanceId\",\"Type\":\"TARGET\"}]. + // For example: [{\"Name\":\"InstanceId\",\"Type\":\"TARGET\"}] or [{\"Name\":\"InstanceId\",\"Type\":\"TEXT_VALUE\"}]. // // Definition is a required field Definition map[string]*string `min:"1" type:"map" required:"true"` @@ -12247,11 +12343,22 @@ func (s *DescribeRecordOutput) SetRecordOutputs(v []*RecordOutput) *DescribeReco type DescribeServiceActionExecutionParametersInput struct { _ struct{} `type:"structure"` + // The language code. + // + // * en - English (default) + // + // * jp - Japanese + // + // * zh - Chinese AcceptLanguage *string `type:"string"` + // The identifier of the provisioned product. + // // ProvisionedProductId is a required field ProvisionedProductId *string `min:"1" type:"string" required:"true"` + // The self-service action identifier. + // // ServiceActionId is a required field ServiceActionId *string `min:"1" type:"string" required:"true"` } @@ -12309,6 +12416,7 @@ func (s *DescribeServiceActionExecutionParametersInput) SetServiceActionId(v str type DescribeServiceActionExecutionParametersOutput struct { _ struct{} `type:"structure"` + // The parameters of the self-service action. ServiceActionParameters []*ExecutionParameter `type:"list"` } @@ -12919,6 +13027,62 @@ func (s DisassociateTagOptionFromResourceOutput) GoString() string { return s.String() } +// The specified resource is a duplicate. +type DuplicateResourceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DuplicateResourceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DuplicateResourceException) GoString() string { + return s.String() +} + +func newErrorDuplicateResourceException(v protocol.ResponseMetadata) error { + return &DuplicateResourceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DuplicateResourceException) Code() string { + return "DuplicateResourceException" +} + +// Message returns the exception's message. +func (s DuplicateResourceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DuplicateResourceException) OrigErr() error { + return nil +} + +func (s DuplicateResourceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DuplicateResourceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DuplicateResourceException) RequestID() string { + return s.respMetadata.RequestID +} + type EnableAWSOrganizationsAccessInput struct { _ struct{} `type:"structure"` } @@ -13055,6 +13219,11 @@ type ExecuteProvisionedProductServiceActionInput struct { // An idempotency token that uniquely identifies the execute request. ExecuteToken *string `min:"1" type:"string" idempotencyToken:"true"` + // A map of all self-service action parameters and their values. If a provided + // parameter is of a special type, such as TARGET, the provided value will override + // the default value generated by AWS Service Catalog. If the parameters field + // is not provided, no additional parameters are passed and default values will + // be used for any special parameters such as TARGET. Parameters map[string][]*string `min:"1" type:"map"` // The identifier of the provisioned product. @@ -13160,13 +13329,18 @@ func (s *ExecuteProvisionedProductServiceActionOutput) SetRecordDetail(v *Record return s } +// Details of an execution parameter value that is passed to a self-service +// action when executed on a provisioned product. type ExecutionParameter struct { _ struct{} `type:"structure"` + // The default values for the execution parameter. DefaultValues []*string `type:"list"` + // The name of the execution parameter. Name *string `min:"1" type:"string"` + // The execution parameter type. Type *string `min:"1" type:"string"` } @@ -13296,6 +13470,120 @@ func (s *GetAWSOrganizationsAccessStatusOutput) SetAccessStatus(v string) *GetAW return s } +// One or more parameters provided to the operation are not valid. +type InvalidParametersException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParametersException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParametersException) GoString() string { + return s.String() +} + +func newErrorInvalidParametersException(v protocol.ResponseMetadata) error { + return &InvalidParametersException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParametersException) Code() string { + return "InvalidParametersException" +} + +// Message returns the exception's message. +func (s InvalidParametersException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParametersException) OrigErr() error { + return nil +} + +func (s InvalidParametersException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParametersException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParametersException) RequestID() string { + return s.respMetadata.RequestID +} + +// An attempt was made to modify a resource that is in a state that is not valid. +// Check your resources to ensure that they are in valid states before retrying +// the operation. +type InvalidStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidStateException) GoString() string { + return s.String() +} + +func newErrorInvalidStateException(v protocol.ResponseMetadata) error { + return &InvalidStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidStateException) Code() string { + return "InvalidStateException" +} + +// Message returns the exception's message. +func (s InvalidStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidStateException) OrigErr() error { + return nil +} + +func (s InvalidStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidStateException) RequestID() string { + return s.respMetadata.RequestID +} + // Summary information about a product path for a user. type LaunchPathSummary struct { _ struct{} `type:"structure"` @@ -13347,6 +13635,64 @@ func (s *LaunchPathSummary) SetTags(v []*Tag) *LaunchPathSummary { return s } +// The current limits of the service would have been exceeded by this operation. +// Decrease your resource use or increase your service limits and retry the +// operation. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListAcceptedPortfolioSharesInput struct { _ struct{} `type:"structure"` @@ -13921,6 +14267,17 @@ type ListPortfolioAccessInput struct { // * zh - Chinese AcceptLanguage *string `type:"string"` + // The ID of an organization node the portfolio is shared with. All children + // of this node with an inherited portfolio share will be returned. + OrganizationParentId *string `min:"1" type:"string"` + + // The maximum number of items to return with this call. + PageSize *int64 `type:"integer"` + + // The page token for the next set of results. To retrieve the first set of + // results, use null. + PageToken *string `type:"string"` + // The portfolio identifier. // // PortfolioId is a required field @@ -13940,6 +14297,9 @@ func (s ListPortfolioAccessInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *ListPortfolioAccessInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ListPortfolioAccessInput"} + if s.OrganizationParentId != nil && len(*s.OrganizationParentId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OrganizationParentId", 1)) + } if s.PortfolioId == nil { invalidParams.Add(request.NewErrParamRequired("PortfolioId")) } @@ -13959,6 +14319,24 @@ func (s *ListPortfolioAccessInput) SetAcceptLanguage(v string) *ListPortfolioAcc return s } +// SetOrganizationParentId sets the OrganizationParentId field's value. +func (s *ListPortfolioAccessInput) SetOrganizationParentId(v string) *ListPortfolioAccessInput { + s.OrganizationParentId = &v + return s +} + +// SetPageSize sets the PageSize field's value. +func (s *ListPortfolioAccessInput) SetPageSize(v int64) *ListPortfolioAccessInput { + s.PageSize = &v + return s +} + +// SetPageToken sets the PageToken field's value. +func (s *ListPortfolioAccessInput) SetPageToken(v string) *ListPortfolioAccessInput { + s.PageToken = &v + return s +} + // SetPortfolioId sets the PortfolioId field's value. func (s *ListPortfolioAccessInput) SetPortfolioId(v string) *ListPortfolioAccessInput { s.PortfolioId = &v @@ -15313,6 +15691,62 @@ func (s *ListTagOptionsOutput) SetTagOptionDetails(v []*TagOptionDetail) *ListTa return s } +// The operation is not supported. +type OperationNotSupportedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s OperationNotSupportedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OperationNotSupportedException) GoString() string { + return s.String() +} + +func newErrorOperationNotSupportedException(v protocol.ResponseMetadata) error { + return &OperationNotSupportedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OperationNotSupportedException) Code() string { + return "OperationNotSupportedException" +} + +// Message returns the exception's message. +func (s OperationNotSupportedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OperationNotSupportedException) OrigErr() error { + return nil +} + +func (s OperationNotSupportedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OperationNotSupportedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OperationNotSupportedException) RequestID() string { + return s.respMetadata.RequestID +} + // Information about the organization node. type OrganizationNode struct { _ struct{} `type:"structure"` @@ -17606,6 +18040,119 @@ func (s *ResourceDetail) SetName(v string) *ResourceDetail { return s } +// A resource that is currently in use. Ensure that the resource is not in use +// and retry the operation. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource was not found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Information about a change to a resource attribute. type ResourceTargetDefinition struct { _ struct{} `type:"structure"` @@ -18540,6 +19087,64 @@ func (s *TagOptionDetail) SetValue(v string) *TagOptionDetail { return s } +// An operation requiring TagOptions failed because the TagOptions migration +// process has not been performed for this account. Please use the AWS console +// to perform the migration process before retrying the operation. +type TagOptionNotMigratedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TagOptionNotMigratedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagOptionNotMigratedException) GoString() string { + return s.String() +} + +func newErrorTagOptionNotMigratedException(v protocol.ResponseMetadata) error { + return &TagOptionNotMigratedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagOptionNotMigratedException) Code() string { + return "TagOptionNotMigratedException" +} + +// Message returns the exception's message. +func (s TagOptionNotMigratedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagOptionNotMigratedException) OrigErr() error { + return nil +} + +func (s TagOptionNotMigratedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagOptionNotMigratedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagOptionNotMigratedException) RequestID() string { + return s.respMetadata.RequestID +} + // Summary information about a TagOption. type TagOptionSummary struct { _ struct{} `type:"structure"` @@ -19532,6 +20137,9 @@ type UpdateProvisioningArtifactInput struct { AcceptLanguage *string `type:"string"` // Indicates whether the product version is active. + // + // Inactive provisioning artifacts are invisible to end users. End users cannot + // launch or update a provisioned product from an inactive provisioning artifact. Active *bool `type:"boolean"` // The updated description of the provisioning artifact. diff --git a/vendor/github.com/aws/aws-sdk-go/service/servicecatalog/errors.go b/vendor/github.com/aws/aws-sdk-go/service/servicecatalog/errors.go index 357d9e52f5d..5fed488c09a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/servicecatalog/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/servicecatalog/errors.go @@ -2,6 +2,10 @@ package servicecatalog +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeDuplicateResourceException for service response error code @@ -59,3 +63,14 @@ const ( // to perform the migration process before retrying the operation. ErrCodeTagOptionNotMigratedException = "TagOptionNotMigratedException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "DuplicateResourceException": newErrorDuplicateResourceException, + "InvalidParametersException": newErrorInvalidParametersException, + "InvalidStateException": newErrorInvalidStateException, + "LimitExceededException": newErrorLimitExceededException, + "OperationNotSupportedException": newErrorOperationNotSupportedException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "TagOptionNotMigratedException": newErrorTagOptionNotMigratedException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/servicecatalog/service.go b/vendor/github.com/aws/aws-sdk-go/service/servicecatalog/service.go index f15a5b8024d..fcab9489853 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/servicecatalog/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/servicecatalog/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "servicecatalog" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Service Catalog" // ServiceID is a unique identifer of a specific service. + ServiceID = "Service Catalog" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ServiceCatalog client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ServiceCatalog client from just a session. // svc := servicecatalog.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := servicecatalog.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *ServiceCatalog { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ServiceCatalog { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ServiceCatalog { svc := &ServiceCatalog{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-12-10", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/servicediscovery/api.go b/vendor/github.com/aws/aws-sdk-go/service/servicediscovery/api.go index 66ec55240a8..0fee972596d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/servicediscovery/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/servicediscovery/api.go @@ -72,20 +72,20 @@ func (c *ServiceDiscovery) CreateHttpNamespaceRequest(input *CreateHttpNamespace // See the AWS API reference guide for AWS Cloud Map's // API operation CreateHttpNamespace for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" +// Returned Error Types: +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. // -// * ErrCodeNamespaceAlreadyExists "NamespaceAlreadyExists" +// * NamespaceAlreadyExists // The namespace that you're trying to create already exists. // -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// * ResourceLimitExceeded // The resource can't be created because you've reached the limit on the number // of resources. // -// * ErrCodeDuplicateRequest "DuplicateRequest" +// * DuplicateRequest // The operation is already in progress. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/CreateHttpNamespace @@ -169,20 +169,20 @@ func (c *ServiceDiscovery) CreatePrivateDnsNamespaceRequest(input *CreatePrivate // See the AWS API reference guide for AWS Cloud Map's // API operation CreatePrivateDnsNamespace for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" +// Returned Error Types: +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. // -// * ErrCodeNamespaceAlreadyExists "NamespaceAlreadyExists" +// * NamespaceAlreadyExists // The namespace that you're trying to create already exists. // -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// * ResourceLimitExceeded // The resource can't be created because you've reached the limit on the number // of resources. // -// * ErrCodeDuplicateRequest "DuplicateRequest" +// * DuplicateRequest // The operation is already in progress. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/CreatePrivateDnsNamespace @@ -266,20 +266,20 @@ func (c *ServiceDiscovery) CreatePublicDnsNamespaceRequest(input *CreatePublicDn // See the AWS API reference guide for AWS Cloud Map's // API operation CreatePublicDnsNamespace for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" +// Returned Error Types: +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. // -// * ErrCodeNamespaceAlreadyExists "NamespaceAlreadyExists" +// * NamespaceAlreadyExists // The namespace that you're trying to create already exists. // -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// * ResourceLimitExceeded // The resource can't be created because you've reached the limit on the number // of resources. // -// * ErrCodeDuplicateRequest "DuplicateRequest" +// * DuplicateRequest // The operation is already in progress. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/CreatePublicDnsNamespace @@ -370,20 +370,20 @@ func (c *ServiceDiscovery) CreateServiceRequest(input *CreateServiceInput) (req // See the AWS API reference guide for AWS Cloud Map's // API operation CreateService for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" +// Returned Error Types: +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. // -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// * ResourceLimitExceeded // The resource can't be created because you've reached the limit on the number // of resources. // -// * ErrCodeNamespaceNotFound "NamespaceNotFound" +// * NamespaceNotFound // No namespace exists with the specified ID. // -// * ErrCodeServiceAlreadyExists "ServiceAlreadyExists" +// * ServiceAlreadyExists // The service can't be created because a service with the same name already // exists. // @@ -463,20 +463,20 @@ func (c *ServiceDiscovery) DeleteNamespaceRequest(input *DeleteNamespaceInput) ( // See the AWS API reference guide for AWS Cloud Map's // API operation DeleteNamespace for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" +// Returned Error Types: +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. // -// * ErrCodeNamespaceNotFound "NamespaceNotFound" +// * NamespaceNotFound // No namespace exists with the specified ID. // -// * ErrCodeResourceInUse "ResourceInUse" +// * ResourceInUse // The specified resource can't be deleted because it contains other resources. // For example, you can't delete a service that contains any instances. // -// * ErrCodeDuplicateRequest "DuplicateRequest" +// * DuplicateRequest // The operation is already in progress. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/DeleteNamespace @@ -556,16 +556,16 @@ func (c *ServiceDiscovery) DeleteServiceRequest(input *DeleteServiceInput) (req // See the AWS API reference guide for AWS Cloud Map's // API operation DeleteService for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" +// Returned Error Types: +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. // -// * ErrCodeServiceNotFound "ServiceNotFound" +// * ServiceNotFound // No service exists with the specified ID. // -// * ErrCodeResourceInUse "ResourceInUse" +// * ResourceInUse // The specified resource can't be deleted because it contains other resources. // For example, you can't delete a service that contains any instances. // @@ -645,24 +645,24 @@ func (c *ServiceDiscovery) DeregisterInstanceRequest(input *DeregisterInstanceIn // See the AWS API reference guide for AWS Cloud Map's // API operation DeregisterInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeDuplicateRequest "DuplicateRequest" +// Returned Error Types: +// * DuplicateRequest // The operation is already in progress. // -// * ErrCodeInvalidInput "InvalidInput" +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. // -// * ErrCodeInstanceNotFound "InstanceNotFound" +// * InstanceNotFound // No instance exists with the specified ID, or the instance was recently registered, // and information about the instance hasn't propagated yet. // -// * ErrCodeResourceInUse "ResourceInUse" +// * ResourceInUse // The specified resource can't be deleted because it contains other resources. // For example, you can't delete a service that contains any instances. // -// * ErrCodeServiceNotFound "ServiceNotFound" +// * ServiceNotFound // No service exists with the specified ID. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/DeregisterInstance @@ -742,14 +742,14 @@ func (c *ServiceDiscovery) DiscoverInstancesRequest(input *DiscoverInstancesInpu // See the AWS API reference guide for AWS Cloud Map's // API operation DiscoverInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceNotFound "ServiceNotFound" +// Returned Error Types: +// * ServiceNotFound // No service exists with the specified ID. // -// * ErrCodeNamespaceNotFound "NamespaceNotFound" +// * NamespaceNotFound // No namespace exists with the specified ID. // -// * ErrCodeInvalidInput "InvalidInput" +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. @@ -829,17 +829,17 @@ func (c *ServiceDiscovery) GetInstanceRequest(input *GetInstanceInput) (req *req // See the AWS API reference guide for AWS Cloud Map's // API operation GetInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeInstanceNotFound "InstanceNotFound" +// Returned Error Types: +// * InstanceNotFound // No instance exists with the specified ID, or the instance was recently registered, // and information about the instance hasn't propagated yet. // -// * ErrCodeInvalidInput "InvalidInput" +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. // -// * ErrCodeServiceNotFound "ServiceNotFound" +// * ServiceNotFound // No service exists with the specified ID. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/GetInstance @@ -927,17 +927,17 @@ func (c *ServiceDiscovery) GetInstancesHealthStatusRequest(input *GetInstancesHe // See the AWS API reference guide for AWS Cloud Map's // API operation GetInstancesHealthStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeInstanceNotFound "InstanceNotFound" +// Returned Error Types: +// * InstanceNotFound // No instance exists with the specified ID, or the instance was recently registered, // and information about the instance hasn't propagated yet. // -// * ErrCodeInvalidInput "InvalidInput" +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. // -// * ErrCodeServiceNotFound "ServiceNotFound" +// * ServiceNotFound // No service exists with the specified ID. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/GetInstancesHealthStatus @@ -1005,10 +1005,12 @@ func (c *ServiceDiscovery) GetInstancesHealthStatusPagesWithContext(ctx aws.Cont }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetInstancesHealthStatusOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetInstancesHealthStatusOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1065,13 +1067,13 @@ func (c *ServiceDiscovery) GetNamespaceRequest(input *GetNamespaceInput) (req *r // See the AWS API reference guide for AWS Cloud Map's // API operation GetNamespace for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" +// Returned Error Types: +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. // -// * ErrCodeNamespaceNotFound "NamespaceNotFound" +// * NamespaceNotFound // No namespace exists with the specified ID. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/GetNamespace @@ -1152,13 +1154,13 @@ func (c *ServiceDiscovery) GetOperationRequest(input *GetOperationInput) (req *r // See the AWS API reference guide for AWS Cloud Map's // API operation GetOperation for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" +// Returned Error Types: +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. // -// * ErrCodeOperationNotFound "OperationNotFound" +// * OperationNotFound // No operation exists with the specified ID. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/GetOperation @@ -1236,13 +1238,13 @@ func (c *ServiceDiscovery) GetServiceRequest(input *GetServiceInput) (req *reque // See the AWS API reference guide for AWS Cloud Map's // API operation GetService for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" +// Returned Error Types: +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. // -// * ErrCodeServiceNotFound "ServiceNotFound" +// * ServiceNotFound // No service exists with the specified ID. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/GetService @@ -1327,11 +1329,11 @@ func (c *ServiceDiscovery) ListInstancesRequest(input *ListInstancesInput) (req // See the AWS API reference guide for AWS Cloud Map's // API operation ListInstances for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceNotFound "ServiceNotFound" +// Returned Error Types: +// * ServiceNotFound // No service exists with the specified ID. // -// * ErrCodeInvalidInput "InvalidInput" +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. @@ -1401,10 +1403,12 @@ func (c *ServiceDiscovery) ListInstancesPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListInstancesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListInstancesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1468,8 +1472,8 @@ func (c *ServiceDiscovery) ListNamespacesRequest(input *ListNamespacesInput) (re // See the AWS API reference guide for AWS Cloud Map's // API operation ListNamespaces for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" +// Returned Error Types: +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. @@ -1539,10 +1543,12 @@ func (c *ServiceDiscovery) ListNamespacesPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListNamespacesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListNamespacesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1605,8 +1611,8 @@ func (c *ServiceDiscovery) ListOperationsRequest(input *ListOperationsInput) (re // See the AWS API reference guide for AWS Cloud Map's // API operation ListOperations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" +// Returned Error Types: +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. @@ -1676,10 +1682,12 @@ func (c *ServiceDiscovery) ListOperationsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListOperationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListOperationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1743,8 +1751,8 @@ func (c *ServiceDiscovery) ListServicesRequest(input *ListServicesInput) (req *r // See the AWS API reference guide for AWS Cloud Map's // API operation ListServices for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidInput "InvalidInput" +// Returned Error Types: +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. @@ -1814,10 +1822,12 @@ func (c *ServiceDiscovery) ListServicesPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListServicesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListServicesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1906,24 +1916,24 @@ func (c *ServiceDiscovery) RegisterInstanceRequest(input *RegisterInstanceInput) // See the AWS API reference guide for AWS Cloud Map's // API operation RegisterInstance for usage and error information. // -// Returned Error Codes: -// * ErrCodeDuplicateRequest "DuplicateRequest" +// Returned Error Types: +// * DuplicateRequest // The operation is already in progress. // -// * ErrCodeInvalidInput "InvalidInput" +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. // -// * ErrCodeResourceInUse "ResourceInUse" +// * ResourceInUse // The specified resource can't be deleted because it contains other resources. // For example, you can't delete a service that contains any instances. // -// * ErrCodeResourceLimitExceeded "ResourceLimitExceeded" +// * ResourceLimitExceeded // The resource can't be created because you've reached the limit on the number // of resources. // -// * ErrCodeServiceNotFound "ServiceNotFound" +// * ServiceNotFound // No service exists with the specified ID. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/RegisterInstance @@ -2010,19 +2020,19 @@ func (c *ServiceDiscovery) UpdateInstanceCustomHealthStatusRequest(input *Update // See the AWS API reference guide for AWS Cloud Map's // API operation UpdateInstanceCustomHealthStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeInstanceNotFound "InstanceNotFound" +// Returned Error Types: +// * InstanceNotFound // No instance exists with the specified ID, or the instance was recently registered, // and information about the instance hasn't propagated yet. // -// * ErrCodeServiceNotFound "ServiceNotFound" +// * ServiceNotFound // No service exists with the specified ID. // -// * ErrCodeCustomHealthNotFound "CustomHealthNotFound" +// * CustomHealthNotFound // The health check for the instance that is specified by ServiceId and InstanceId // is not a custom health check. // -// * ErrCodeInvalidInput "InvalidInput" +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. @@ -2117,16 +2127,16 @@ func (c *ServiceDiscovery) UpdateServiceRequest(input *UpdateServiceInput) (req // See the AWS API reference guide for AWS Cloud Map's // API operation UpdateService for usage and error information. // -// Returned Error Codes: -// * ErrCodeDuplicateRequest "DuplicateRequest" +// Returned Error Types: +// * DuplicateRequest // The operation is already in progress. // -// * ErrCodeInvalidInput "InvalidInput" +// * InvalidInput // One or more specified values aren't valid. For example, a required value // might be missing, a numeric value might be outside the allowed range, or // a string value might exceed length constraints. // -// * ErrCodeServiceNotFound "ServiceNotFound" +// * ServiceNotFound // No service exists with the specified ID. // // See also, https://docs.aws.amazon.com/goto/WebAPI/servicediscovery-2017-03-14/UpdateService @@ -2559,6 +2569,63 @@ func (s *CreateServiceOutput) SetService(v *Service) *CreateServiceOutput { return s } +// The health check for the instance that is specified by ServiceId and InstanceId +// is not a custom health check. +type CustomHealthNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s CustomHealthNotFound) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CustomHealthNotFound) GoString() string { + return s.String() +} + +func newErrorCustomHealthNotFound(v protocol.ResponseMetadata) error { + return &CustomHealthNotFound{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CustomHealthNotFound) Code() string { + return "CustomHealthNotFound" +} + +// Message returns the exception's message. +func (s CustomHealthNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CustomHealthNotFound) OrigErr() error { + return nil +} + +func (s CustomHealthNotFound) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CustomHealthNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CustomHealthNotFound) RequestID() string { + return s.respMetadata.RequestID +} + type DeleteNamespaceInput struct { _ struct{} `type:"structure"` @@ -3179,6 +3246,65 @@ func (s *DnsRecord) SetType(v string) *DnsRecord { return s } +// The operation is already in progress. +type DuplicateRequest struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The ID of the operation that is already in progress. + DuplicateOperationId *string `type:"string"` + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DuplicateRequest) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DuplicateRequest) GoString() string { + return s.String() +} + +func newErrorDuplicateRequest(v protocol.ResponseMetadata) error { + return &DuplicateRequest{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DuplicateRequest) Code() string { + return "DuplicateRequest" +} + +// Message returns the exception's message. +func (s DuplicateRequest) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DuplicateRequest) OrigErr() error { + return nil +} + +func (s DuplicateRequest) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DuplicateRequest) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DuplicateRequest) RequestID() string { + return s.respMetadata.RequestID +} + type GetInstanceInput struct { _ struct{} `type:"structure"` @@ -4022,6 +4148,63 @@ func (s *Instance) SetId(v string) *Instance { return s } +// No instance exists with the specified ID, or the instance was recently registered, +// and information about the instance hasn't propagated yet. +type InstanceNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InstanceNotFound) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InstanceNotFound) GoString() string { + return s.String() +} + +func newErrorInstanceNotFound(v protocol.ResponseMetadata) error { + return &InstanceNotFound{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InstanceNotFound) Code() string { + return "InstanceNotFound" +} + +// Message returns the exception's message. +func (s InstanceNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InstanceNotFound) OrigErr() error { + return nil +} + +func (s InstanceNotFound) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InstanceNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InstanceNotFound) RequestID() string { + return s.respMetadata.RequestID +} + // A complex type that contains information about the instances that you registered // by using a specified service. type InstanceSummary struct { @@ -4079,6 +4262,64 @@ func (s *InstanceSummary) SetId(v string) *InstanceSummary { return s } +// One or more specified values aren't valid. For example, a required value +// might be missing, a numeric value might be outside the allowed range, or +// a string value might exceed length constraints. +type InvalidInput struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInput) GoString() string { + return s.String() +} + +func newErrorInvalidInput(v protocol.ResponseMetadata) error { + return &InvalidInput{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInput) Code() string { + return "InvalidInput" +} + +// Message returns the exception's message. +func (s InvalidInput) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInput) OrigErr() error { + return nil +} + +func (s InvalidInput) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInput) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInput) RequestID() string { + return s.respMetadata.RequestID +} + type ListInstancesInput struct { _ struct{} `type:"structure"` @@ -4638,6 +4879,68 @@ func (s *Namespace) SetType(v string) *Namespace { return s } +// The namespace that you're trying to create already exists. +type NamespaceAlreadyExists struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The CreatorRequestId that was used to create the namespace. + CreatorRequestId *string `type:"string"` + + Message_ *string `locationName:"Message" type:"string"` + + // The ID of the existing namespace. + NamespaceId *string `type:"string"` +} + +// String returns the string representation +func (s NamespaceAlreadyExists) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NamespaceAlreadyExists) GoString() string { + return s.String() +} + +func newErrorNamespaceAlreadyExists(v protocol.ResponseMetadata) error { + return &NamespaceAlreadyExists{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NamespaceAlreadyExists) Code() string { + return "NamespaceAlreadyExists" +} + +// Message returns the exception's message. +func (s NamespaceAlreadyExists) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NamespaceAlreadyExists) OrigErr() error { + return nil +} + +func (s NamespaceAlreadyExists) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NamespaceAlreadyExists) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NamespaceAlreadyExists) RequestID() string { + return s.respMetadata.RequestID +} + // A complex type that identifies the namespaces that you want to list. You // can choose to list public or private namespaces. type NamespaceFilter struct { @@ -4714,6 +5017,62 @@ func (s *NamespaceFilter) SetValues(v []*string) *NamespaceFilter { return s } +// No namespace exists with the specified ID. +type NamespaceNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s NamespaceNotFound) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NamespaceNotFound) GoString() string { + return s.String() +} + +func newErrorNamespaceNotFound(v protocol.ResponseMetadata) error { + return &NamespaceNotFound{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NamespaceNotFound) Code() string { + return "NamespaceNotFound" +} + +// Message returns the exception's message. +func (s NamespaceNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NamespaceNotFound) OrigErr() error { + return nil +} + +func (s NamespaceNotFound) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NamespaceNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NamespaceNotFound) RequestID() string { + return s.respMetadata.RequestID +} + // A complex type that contains information that is specific to the namespace // type. type NamespaceProperties struct { @@ -5062,6 +5421,62 @@ func (s *OperationFilter) SetValues(v []*string) *OperationFilter { return s } +// No operation exists with the specified ID. +type OperationNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s OperationNotFound) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OperationNotFound) GoString() string { + return s.String() +} + +func newErrorOperationNotFound(v protocol.ResponseMetadata) error { + return &OperationNotFound{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OperationNotFound) Code() string { + return "OperationNotFound" +} + +// Message returns the exception's message. +func (s OperationNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OperationNotFound) OrigErr() error { + return nil +} + +func (s OperationNotFound) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OperationNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OperationNotFound) RequestID() string { + return s.respMetadata.RequestID +} + // A complex type that contains information about an operation that matches // the criteria that you specified in a ListOperations request. type OperationSummary struct { @@ -5307,6 +5722,120 @@ func (s *RegisterInstanceOutput) SetOperationId(v string) *RegisterInstanceOutpu return s } +// The specified resource can't be deleted because it contains other resources. +// For example, you can't delete a service that contains any instances. +type ResourceInUse struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUse) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUse) GoString() string { + return s.String() +} + +func newErrorResourceInUse(v protocol.ResponseMetadata) error { + return &ResourceInUse{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUse) Code() string { + return "ResourceInUse" +} + +// Message returns the exception's message. +func (s ResourceInUse) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUse) OrigErr() error { + return nil +} + +func (s ResourceInUse) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUse) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUse) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource can't be created because you've reached the limit on the number +// of resources. +type ResourceLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceLimitExceeded) GoString() string { + return s.String() +} + +func newErrorResourceLimitExceeded(v protocol.ResponseMetadata) error { + return &ResourceLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceLimitExceeded) Code() string { + return "ResourceLimitExceeded" +} + +// Message returns the exception's message. +func (s ResourceLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceLimitExceeded) OrigErr() error { + return nil +} + +func (s ResourceLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + // A complex type that contains information about the specified service. type Service struct { _ struct{} `type:"structure"` @@ -5439,6 +5968,69 @@ func (s *Service) SetNamespaceId(v string) *Service { return s } +// The service can't be created because a service with the same name already +// exists. +type ServiceAlreadyExists struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The CreatorRequestId that was used to create the service. + CreatorRequestId *string `type:"string"` + + Message_ *string `locationName:"Message" type:"string"` + + // The ID of the existing service. + ServiceId *string `type:"string"` +} + +// String returns the string representation +func (s ServiceAlreadyExists) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceAlreadyExists) GoString() string { + return s.String() +} + +func newErrorServiceAlreadyExists(v protocol.ResponseMetadata) error { + return &ServiceAlreadyExists{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceAlreadyExists) Code() string { + return "ServiceAlreadyExists" +} + +// Message returns the exception's message. +func (s ServiceAlreadyExists) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceAlreadyExists) OrigErr() error { + return nil +} + +func (s ServiceAlreadyExists) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceAlreadyExists) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceAlreadyExists) RequestID() string { + return s.respMetadata.RequestID +} + // A complex type that contains changes to an existing service. type ServiceChange struct { _ struct{} `type:"structure"` @@ -5637,6 +6229,62 @@ func (s *ServiceFilter) SetValues(v []*string) *ServiceFilter { return s } +// No service exists with the specified ID. +type ServiceNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ServiceNotFound) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceNotFound) GoString() string { + return s.String() +} + +func newErrorServiceNotFound(v protocol.ResponseMetadata) error { + return &ServiceNotFound{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceNotFound) Code() string { + return "ServiceNotFound" +} + +// Message returns the exception's message. +func (s ServiceNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceNotFound) OrigErr() error { + return nil +} + +func (s ServiceNotFound) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceNotFound) RequestID() string { + return s.respMetadata.RequestID +} + // A complex type that contains information about a specified service. type ServiceSummary struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/servicediscovery/errors.go b/vendor/github.com/aws/aws-sdk-go/service/servicediscovery/errors.go index 0238a42ba47..0e4e0085797 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/servicediscovery/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/servicediscovery/errors.go @@ -2,6 +2,10 @@ package servicediscovery +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeCustomHealthNotFound for service response error code @@ -77,3 +81,17 @@ const ( // No service exists with the specified ID. ErrCodeServiceNotFound = "ServiceNotFound" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "CustomHealthNotFound": newErrorCustomHealthNotFound, + "DuplicateRequest": newErrorDuplicateRequest, + "InstanceNotFound": newErrorInstanceNotFound, + "InvalidInput": newErrorInvalidInput, + "NamespaceAlreadyExists": newErrorNamespaceAlreadyExists, + "NamespaceNotFound": newErrorNamespaceNotFound, + "OperationNotFound": newErrorOperationNotFound, + "ResourceInUse": newErrorResourceInUse, + "ResourceLimitExceeded": newErrorResourceLimitExceeded, + "ServiceAlreadyExists": newErrorServiceAlreadyExists, + "ServiceNotFound": newErrorServiceNotFound, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/servicediscovery/service.go b/vendor/github.com/aws/aws-sdk-go/service/servicediscovery/service.go index 3463e12c241..eee9f932853 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/servicediscovery/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/servicediscovery/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "servicediscovery" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "ServiceDiscovery" // ServiceID is a unique identifer of a specific service. + ServiceID = "ServiceDiscovery" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ServiceDiscovery client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ServiceDiscovery client from just a session. // svc := servicediscovery.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := servicediscovery.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *ServiceDiscovery { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ServiceDiscovery { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ServiceDiscovery { svc := &ServiceDiscovery{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2017-03-14", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/servicequotas/api.go b/vendor/github.com/aws/aws-sdk-go/service/servicequotas/api.go index 82f88b31bd3..e1df5bbc1b9 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/servicequotas/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/servicequotas/api.go @@ -3,6 +3,7 @@ package servicequotas import ( + "fmt" "time" "github.com/aws/aws-sdk-go/aws" @@ -71,33 +72,33 @@ func (c *ServiceQuotas) AssociateServiceQuotaTemplateRequest(input *AssociateSer // See the AWS API reference guide for Service Quotas's // API operation AssociateServiceQuotaTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeDependencyAccessDeniedException "DependencyAccessDeniedException" +// Returned Error Types: +// * DependencyAccessDeniedException // You can't perform this action because a dependency does not have access. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // -// * ErrCodeAWSServiceAccessNotEnabledException "AWSServiceAccessNotEnabledException" +// * AWSServiceAccessNotEnabledException // The action you attempted is not allowed unless Service Access with Service // Quotas is enabled in your organization. To enable, call AssociateServiceQuotaTemplate. // -// * ErrCodeOrganizationNotInAllFeaturesModeException "OrganizationNotInAllFeaturesModeException" +// * OrganizationNotInAllFeaturesModeException // The organization that your account belongs to, is not in All Features mode. // To enable all features mode, see EnableAllFeatures (https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAllFeatures.html). // -// * ErrCodeTemplatesNotAvailableInRegionException "TemplatesNotAvailableInRegionException" +// * TemplatesNotAvailableInRegionException // The Service Quotas template is not available in the Region where you are // making the request. Please make the request in us-east-1. // -// * ErrCodeNoAvailableOrganizationException "NoAvailableOrganizationException" +// * NoAvailableOrganizationException // The account making this call is not a member of an organization. // // See also, https://docs.aws.amazon.com/goto/WebAPI/service-quotas-2019-06-24/AssociateServiceQuotaTemplate @@ -176,35 +177,35 @@ func (c *ServiceQuotas) DeleteServiceQuotaIncreaseRequestFromTemplateRequest(inp // See the AWS API reference guide for Service Quotas's // API operation DeleteServiceQuotaIncreaseRequestFromTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeDependencyAccessDeniedException "DependencyAccessDeniedException" +// * DependencyAccessDeniedException // You can't perform this action because a dependency does not have access. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // -// * ErrCodeNoSuchResourceException "NoSuchResourceException" +// * NoSuchResourceException // The specified resource does not exist. // -// * ErrCodeIllegalArgumentException "IllegalArgumentException" +// * IllegalArgumentException // Invalid input was provided. // -// * ErrCodeAWSServiceAccessNotEnabledException "AWSServiceAccessNotEnabledException" +// * AWSServiceAccessNotEnabledException // The action you attempted is not allowed unless Service Access with Service // Quotas is enabled in your organization. To enable, call AssociateServiceQuotaTemplate. // -// * ErrCodeTemplatesNotAvailableInRegionException "TemplatesNotAvailableInRegionException" +// * TemplatesNotAvailableInRegionException // The Service Quotas template is not available in the Region where you are // making the request. Please make the request in us-east-1. // -// * ErrCodeNoAvailableOrganizationException "NoAvailableOrganizationException" +// * NoAvailableOrganizationException // The account making this call is not a member of an organization. // // See also, https://docs.aws.amazon.com/goto/WebAPI/service-quotas-2019-06-24/DeleteServiceQuotaIncreaseRequestFromTemplate @@ -291,34 +292,34 @@ func (c *ServiceQuotas) DisassociateServiceQuotaTemplateRequest(input *Disassoci // See the AWS API reference guide for Service Quotas's // API operation DisassociateServiceQuotaTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeDependencyAccessDeniedException "DependencyAccessDeniedException" +// Returned Error Types: +// * DependencyAccessDeniedException // You can't perform this action because a dependency does not have access. // -// * ErrCodeServiceQuotaTemplateNotInUseException "ServiceQuotaTemplateNotInUseException" +// * ServiceQuotaTemplateNotInUseException // The quota request template is not associated with your organization. // // To use the template, call AssociateServiceQuotaTemplate. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // -// * ErrCodeAWSServiceAccessNotEnabledException "AWSServiceAccessNotEnabledException" +// * AWSServiceAccessNotEnabledException // The action you attempted is not allowed unless Service Access with Service // Quotas is enabled in your organization. To enable, call AssociateServiceQuotaTemplate. // -// * ErrCodeTemplatesNotAvailableInRegionException "TemplatesNotAvailableInRegionException" +// * TemplatesNotAvailableInRegionException // The Service Quotas template is not available in the Region where you are // making the request. Please make the request in us-east-1. // -// * ErrCodeNoAvailableOrganizationException "NoAvailableOrganizationException" +// * NoAvailableOrganizationException // The account making this call is not a member of an organization. // // See also, https://docs.aws.amazon.com/goto/WebAPI/service-quotas-2019-06-24/DisassociateServiceQuotaTemplate @@ -397,20 +398,20 @@ func (c *ServiceQuotas) GetAWSDefaultServiceQuotaRequest(input *GetAWSDefaultSer // See the AWS API reference guide for Service Quotas's // API operation GetAWSDefaultServiceQuota for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeNoSuchResourceException "NoSuchResourceException" +// * NoSuchResourceException // The specified resource does not exist. // -// * ErrCodeIllegalArgumentException "IllegalArgumentException" +// * IllegalArgumentException // Invalid input was provided. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // @@ -491,34 +492,34 @@ func (c *ServiceQuotas) GetAssociationForServiceQuotaTemplateRequest(input *GetA // See the AWS API reference guide for Service Quotas's // API operation GetAssociationForServiceQuotaTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeDependencyAccessDeniedException "DependencyAccessDeniedException" +// Returned Error Types: +// * DependencyAccessDeniedException // You can't perform this action because a dependency does not have access. // -// * ErrCodeServiceQuotaTemplateNotInUseException "ServiceQuotaTemplateNotInUseException" +// * ServiceQuotaTemplateNotInUseException // The quota request template is not associated with your organization. // // To use the template, call AssociateServiceQuotaTemplate. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // -// * ErrCodeAWSServiceAccessNotEnabledException "AWSServiceAccessNotEnabledException" +// * AWSServiceAccessNotEnabledException // The action you attempted is not allowed unless Service Access with Service // Quotas is enabled in your organization. To enable, call AssociateServiceQuotaTemplate. // -// * ErrCodeTemplatesNotAvailableInRegionException "TemplatesNotAvailableInRegionException" +// * TemplatesNotAvailableInRegionException // The Service Quotas template is not available in the Region where you are // making the request. Please make the request in us-east-1. // -// * ErrCodeNoAvailableOrganizationException "NoAvailableOrganizationException" +// * NoAvailableOrganizationException // The account making this call is not a member of an organization. // // See also, https://docs.aws.amazon.com/goto/WebAPI/service-quotas-2019-06-24/GetAssociationForServiceQuotaTemplate @@ -596,20 +597,20 @@ func (c *ServiceQuotas) GetRequestedServiceQuotaChangeRequest(input *GetRequeste // See the AWS API reference guide for Service Quotas's // API operation GetRequestedServiceQuotaChange for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeNoSuchResourceException "NoSuchResourceException" +// * NoSuchResourceException // The specified resource does not exist. // -// * ErrCodeIllegalArgumentException "IllegalArgumentException" +// * IllegalArgumentException // Invalid input was provided. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // @@ -691,20 +692,20 @@ func (c *ServiceQuotas) GetServiceQuotaRequest(input *GetServiceQuotaInput) (req // See the AWS API reference guide for Service Quotas's // API operation GetServiceQuota for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeNoSuchResourceException "NoSuchResourceException" +// * NoSuchResourceException // The specified resource does not exist. // -// * ErrCodeIllegalArgumentException "IllegalArgumentException" +// * IllegalArgumentException // Invalid input was provided. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // @@ -783,35 +784,35 @@ func (c *ServiceQuotas) GetServiceQuotaIncreaseRequestFromTemplateRequest(input // See the AWS API reference guide for Service Quotas's // API operation GetServiceQuotaIncreaseRequestFromTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeDependencyAccessDeniedException "DependencyAccessDeniedException" +// * DependencyAccessDeniedException // You can't perform this action because a dependency does not have access. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // -// * ErrCodeNoSuchResourceException "NoSuchResourceException" +// * NoSuchResourceException // The specified resource does not exist. // -// * ErrCodeIllegalArgumentException "IllegalArgumentException" +// * IllegalArgumentException // Invalid input was provided. // -// * ErrCodeAWSServiceAccessNotEnabledException "AWSServiceAccessNotEnabledException" +// * AWSServiceAccessNotEnabledException // The action you attempted is not allowed unless Service Access with Service // Quotas is enabled in your organization. To enable, call AssociateServiceQuotaTemplate. // -// * ErrCodeTemplatesNotAvailableInRegionException "TemplatesNotAvailableInRegionException" +// * TemplatesNotAvailableInRegionException // The Service Quotas template is not available in the Region where you are // making the request. Please make the request in us-east-1. // -// * ErrCodeNoAvailableOrganizationException "NoAvailableOrganizationException" +// * NoAvailableOrganizationException // The account making this call is not a member of an organization. // // See also, https://docs.aws.amazon.com/goto/WebAPI/service-quotas-2019-06-24/GetServiceQuotaIncreaseRequestFromTemplate @@ -906,23 +907,23 @@ func (c *ServiceQuotas) ListAWSDefaultServiceQuotasRequest(input *ListAWSDefault // See the AWS API reference guide for Service Quotas's // API operation ListAWSDefaultServiceQuotas for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeNoSuchResourceException "NoSuchResourceException" +// * NoSuchResourceException // The specified resource does not exist. // -// * ErrCodeIllegalArgumentException "IllegalArgumentException" +// * IllegalArgumentException // Invalid input was provided. // -// * ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException" +// * InvalidPaginationTokenException // Invalid input was provided. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // @@ -991,10 +992,12 @@ func (c *ServiceQuotas) ListAWSDefaultServiceQuotasPagesWithContext(ctx aws.Cont }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAWSDefaultServiceQuotasOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAWSDefaultServiceQuotasOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1057,23 +1060,23 @@ func (c *ServiceQuotas) ListRequestedServiceQuotaChangeHistoryRequest(input *Lis // See the AWS API reference guide for Service Quotas's // API operation ListRequestedServiceQuotaChangeHistory for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeNoSuchResourceException "NoSuchResourceException" +// * NoSuchResourceException // The specified resource does not exist. // -// * ErrCodeIllegalArgumentException "IllegalArgumentException" +// * IllegalArgumentException // Invalid input was provided. // -// * ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException" +// * InvalidPaginationTokenException // Invalid input was provided. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // @@ -1142,10 +1145,12 @@ func (c *ServiceQuotas) ListRequestedServiceQuotaChangeHistoryPagesWithContext(c }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRequestedServiceQuotaChangeHistoryOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListRequestedServiceQuotaChangeHistoryOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1211,23 +1216,23 @@ func (c *ServiceQuotas) ListRequestedServiceQuotaChangeHistoryByQuotaRequest(inp // See the AWS API reference guide for Service Quotas's // API operation ListRequestedServiceQuotaChangeHistoryByQuota for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeNoSuchResourceException "NoSuchResourceException" +// * NoSuchResourceException // The specified resource does not exist. // -// * ErrCodeIllegalArgumentException "IllegalArgumentException" +// * IllegalArgumentException // Invalid input was provided. // -// * ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException" +// * InvalidPaginationTokenException // Invalid input was provided. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // @@ -1296,10 +1301,12 @@ func (c *ServiceQuotas) ListRequestedServiceQuotaChangeHistoryByQuotaPagesWithCo }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListRequestedServiceQuotaChangeHistoryByQuotaOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListRequestedServiceQuotaChangeHistoryByQuotaOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1362,32 +1369,32 @@ func (c *ServiceQuotas) ListServiceQuotaIncreaseRequestsInTemplateRequest(input // See the AWS API reference guide for Service Quotas's // API operation ListServiceQuotaIncreaseRequestsInTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeDependencyAccessDeniedException "DependencyAccessDeniedException" +// * DependencyAccessDeniedException // You can't perform this action because a dependency does not have access. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // -// * ErrCodeIllegalArgumentException "IllegalArgumentException" +// * IllegalArgumentException // Invalid input was provided. // -// * ErrCodeAWSServiceAccessNotEnabledException "AWSServiceAccessNotEnabledException" +// * AWSServiceAccessNotEnabledException // The action you attempted is not allowed unless Service Access with Service // Quotas is enabled in your organization. To enable, call AssociateServiceQuotaTemplate. // -// * ErrCodeTemplatesNotAvailableInRegionException "TemplatesNotAvailableInRegionException" +// * TemplatesNotAvailableInRegionException // The Service Quotas template is not available in the Region where you are // making the request. Please make the request in us-east-1. // -// * ErrCodeNoAvailableOrganizationException "NoAvailableOrganizationException" +// * NoAvailableOrganizationException // The account making this call is not a member of an organization. // // See also, https://docs.aws.amazon.com/goto/WebAPI/service-quotas-2019-06-24/ListServiceQuotaIncreaseRequestsInTemplate @@ -1455,10 +1462,12 @@ func (c *ServiceQuotas) ListServiceQuotaIncreaseRequestsInTemplatePagesWithConte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListServiceQuotaIncreaseRequestsInTemplateOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListServiceQuotaIncreaseRequestsInTemplateOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1529,23 +1538,23 @@ func (c *ServiceQuotas) ListServiceQuotasRequest(input *ListServiceQuotasInput) // See the AWS API reference guide for Service Quotas's // API operation ListServiceQuotas for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeNoSuchResourceException "NoSuchResourceException" +// * NoSuchResourceException // The specified resource does not exist. // -// * ErrCodeIllegalArgumentException "IllegalArgumentException" +// * IllegalArgumentException // Invalid input was provided. // -// * ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException" +// * InvalidPaginationTokenException // Invalid input was provided. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // @@ -1614,10 +1623,12 @@ func (c *ServiceQuotas) ListServiceQuotasPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListServiceQuotasOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListServiceQuotasOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1682,20 +1693,20 @@ func (c *ServiceQuotas) ListServicesRequest(input *ListServicesInput) (req *requ // See the AWS API reference guide for Service Quotas's // API operation ListServices for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeIllegalArgumentException "IllegalArgumentException" +// * IllegalArgumentException // Invalid input was provided. // -// * ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException" +// * InvalidPaginationTokenException // Invalid input was provided. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // @@ -1764,10 +1775,12 @@ func (c *ServiceQuotas) ListServicesPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListServicesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListServicesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1827,40 +1840,40 @@ func (c *ServiceQuotas) PutServiceQuotaIncreaseRequestIntoTemplateRequest(input // See the AWS API reference guide for Service Quotas's // API operation PutServiceQuotaIncreaseRequestIntoTemplate for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeDependencyAccessDeniedException "DependencyAccessDeniedException" +// * DependencyAccessDeniedException // You can't perform this action because a dependency does not have access. // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // -// * ErrCodeIllegalArgumentException "IllegalArgumentException" +// * IllegalArgumentException // Invalid input was provided. // -// * ErrCodeQuotaExceededException "QuotaExceededException" +// * QuotaExceededException // You have exceeded your service quota. To perform the requested action, remove // some of the relevant resources, or use Service Quotas to request a service // quota increase. // -// * ErrCodeNoSuchResourceException "NoSuchResourceException" +// * NoSuchResourceException // The specified resource does not exist. // -// * ErrCodeAWSServiceAccessNotEnabledException "AWSServiceAccessNotEnabledException" +// * AWSServiceAccessNotEnabledException // The action you attempted is not allowed unless Service Access with Service // Quotas is enabled in your organization. To enable, call AssociateServiceQuotaTemplate. // -// * ErrCodeTemplatesNotAvailableInRegionException "TemplatesNotAvailableInRegionException" +// * TemplatesNotAvailableInRegionException // The Service Quotas template is not available in the Region where you are // making the request. Please make the request in us-east-1. // -// * ErrCodeNoAvailableOrganizationException "NoAvailableOrganizationException" +// * NoAvailableOrganizationException // The account making this call is not a member of an organization. // // See also, https://docs.aws.amazon.com/goto/WebAPI/service-quotas-2019-06-24/PutServiceQuotaIncreaseRequestIntoTemplate @@ -1939,34 +1952,34 @@ func (c *ServiceQuotas) RequestServiceQuotaIncreaseRequest(input *RequestService // See the AWS API reference guide for Service Quotas's // API operation RequestServiceQuotaIncrease for usage and error information. // -// Returned Error Codes: -// * ErrCodeDependencyAccessDeniedException "DependencyAccessDeniedException" +// Returned Error Types: +// * DependencyAccessDeniedException // You can't perform this action because a dependency does not have access. // -// * ErrCodeQuotaExceededException "QuotaExceededException" +// * QuotaExceededException // You have exceeded your service quota. To perform the requested action, remove // some of the relevant resources, or use Service Quotas to request a service // quota increase. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // You do not have sufficient access to perform this action. // -// * ErrCodeNoSuchResourceException "NoSuchResourceException" +// * NoSuchResourceException // The specified resource does not exist. // -// * ErrCodeIllegalArgumentException "IllegalArgumentException" +// * IllegalArgumentException // Invalid input was provided. // -// * ErrCodeInvalidResourceStateException "InvalidResourceStateException" +// * InvalidResourceStateException // Invalid input was provided for the . // -// * ErrCodeServiceException "ServiceException" +// * ServiceException // Something went wrong. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // Due to throttling, the request was denied. Slow down the rate of request // calls, or request an increase for this quota. // @@ -1992,6 +2005,119 @@ func (c *ServiceQuotas) RequestServiceQuotaIncreaseWithContext(ctx aws.Context, return out, req.Send() } +// The action you attempted is not allowed unless Service Access with Service +// Quotas is enabled in your organization. To enable, call AssociateServiceQuotaTemplate. +type AWSServiceAccessNotEnabledException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AWSServiceAccessNotEnabledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AWSServiceAccessNotEnabledException) GoString() string { + return s.String() +} + +func newErrorAWSServiceAccessNotEnabledException(v protocol.ResponseMetadata) error { + return &AWSServiceAccessNotEnabledException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AWSServiceAccessNotEnabledException) Code() string { + return "AWSServiceAccessNotEnabledException" +} + +// Message returns the exception's message. +func (s AWSServiceAccessNotEnabledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AWSServiceAccessNotEnabledException) OrigErr() error { + return nil +} + +func (s AWSServiceAccessNotEnabledException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AWSServiceAccessNotEnabledException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AWSServiceAccessNotEnabledException) RequestID() string { + return s.respMetadata.RequestID +} + +// You do not have sufficient access to perform this action. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + type AssociateServiceQuotaTemplateInput struct { _ struct{} `type:"structure"` } @@ -2109,6 +2235,62 @@ func (s DeleteServiceQuotaIncreaseRequestFromTemplateOutput) GoString() string { return s.String() } +// You can't perform this action because a dependency does not have access. +type DependencyAccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DependencyAccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DependencyAccessDeniedException) GoString() string { + return s.String() +} + +func newErrorDependencyAccessDeniedException(v protocol.ResponseMetadata) error { + return &DependencyAccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DependencyAccessDeniedException) Code() string { + return "DependencyAccessDeniedException" +} + +// Message returns the exception's message. +func (s DependencyAccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DependencyAccessDeniedException) OrigErr() error { + return nil +} + +func (s DependencyAccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DependencyAccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DependencyAccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + type DisassociateServiceQuotaTemplateInput struct { _ struct{} `type:"structure"` } @@ -2547,6 +2729,174 @@ func (s *GetServiceQuotaOutput) SetQuota(v *ServiceQuota) *GetServiceQuotaOutput return s } +// Invalid input was provided. +type IllegalArgumentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s IllegalArgumentException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IllegalArgumentException) GoString() string { + return s.String() +} + +func newErrorIllegalArgumentException(v protocol.ResponseMetadata) error { + return &IllegalArgumentException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IllegalArgumentException) Code() string { + return "IllegalArgumentException" +} + +// Message returns the exception's message. +func (s IllegalArgumentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IllegalArgumentException) OrigErr() error { + return nil +} + +func (s IllegalArgumentException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IllegalArgumentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IllegalArgumentException) RequestID() string { + return s.respMetadata.RequestID +} + +// Invalid input was provided. +type InvalidPaginationTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidPaginationTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPaginationTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidPaginationTokenException(v protocol.ResponseMetadata) error { + return &InvalidPaginationTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPaginationTokenException) Code() string { + return "InvalidPaginationTokenException" +} + +// Message returns the exception's message. +func (s InvalidPaginationTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPaginationTokenException) OrigErr() error { + return nil +} + +func (s InvalidPaginationTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPaginationTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPaginationTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// Invalid input was provided for the . +type InvalidResourceStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidResourceStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidResourceStateException) GoString() string { + return s.String() +} + +func newErrorInvalidResourceStateException(v protocol.ResponseMetadata) error { + return &InvalidResourceStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidResourceStateException) Code() string { + return "InvalidResourceStateException" +} + +// Message returns the exception's message. +func (s InvalidResourceStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidResourceStateException) OrigErr() error { + return nil +} + +func (s InvalidResourceStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidResourceStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidResourceStateException) RequestID() string { + return s.respMetadata.RequestID +} + type ListAWSDefaultServiceQuotasInput struct { _ struct{} `type:"structure"` @@ -3286,6 +3636,175 @@ func (s *MetricInfo) SetMetricStatisticRecommendation(v string) *MetricInfo { return s } +// The account making this call is not a member of an organization. +type NoAvailableOrganizationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s NoAvailableOrganizationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NoAvailableOrganizationException) GoString() string { + return s.String() +} + +func newErrorNoAvailableOrganizationException(v protocol.ResponseMetadata) error { + return &NoAvailableOrganizationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NoAvailableOrganizationException) Code() string { + return "NoAvailableOrganizationException" +} + +// Message returns the exception's message. +func (s NoAvailableOrganizationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoAvailableOrganizationException) OrigErr() error { + return nil +} + +func (s NoAvailableOrganizationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NoAvailableOrganizationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NoAvailableOrganizationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource does not exist. +type NoSuchResourceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s NoSuchResourceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NoSuchResourceException) GoString() string { + return s.String() +} + +func newErrorNoSuchResourceException(v protocol.ResponseMetadata) error { + return &NoSuchResourceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NoSuchResourceException) Code() string { + return "NoSuchResourceException" +} + +// Message returns the exception's message. +func (s NoSuchResourceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoSuchResourceException) OrigErr() error { + return nil +} + +func (s NoSuchResourceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NoSuchResourceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NoSuchResourceException) RequestID() string { + return s.respMetadata.RequestID +} + +// The organization that your account belongs to, is not in All Features mode. +// To enable all features mode, see EnableAllFeatures (https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAllFeatures.html). +type OrganizationNotInAllFeaturesModeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s OrganizationNotInAllFeaturesModeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationNotInAllFeaturesModeException) GoString() string { + return s.String() +} + +func newErrorOrganizationNotInAllFeaturesModeException(v protocol.ResponseMetadata) error { + return &OrganizationNotInAllFeaturesModeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OrganizationNotInAllFeaturesModeException) Code() string { + return "OrganizationNotInAllFeaturesModeException" +} + +// Message returns the exception's message. +func (s OrganizationNotInAllFeaturesModeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OrganizationNotInAllFeaturesModeException) OrigErr() error { + return nil +} + +func (s OrganizationNotInAllFeaturesModeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OrganizationNotInAllFeaturesModeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OrganizationNotInAllFeaturesModeException) RequestID() string { + return s.respMetadata.RequestID +} + type PutServiceQuotaIncreaseRequestIntoTemplateInput struct { _ struct{} `type:"structure"` @@ -3398,6 +3917,64 @@ func (s *PutServiceQuotaIncreaseRequestIntoTemplateOutput) SetServiceQuotaIncrea return s } +// You have exceeded your service quota. To perform the requested action, remove +// some of the relevant resources, or use Service Quotas to request a service +// quota increase. +type QuotaExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s QuotaExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s QuotaExceededException) GoString() string { + return s.String() +} + +func newErrorQuotaExceededException(v protocol.ResponseMetadata) error { + return &QuotaExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s QuotaExceededException) Code() string { + return "QuotaExceededException" +} + +// Message returns the exception's message. +func (s QuotaExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s QuotaExceededException) OrigErr() error { + return nil +} + +func (s QuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s QuotaExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s QuotaExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // A structure that contains information about the quota period. type QuotaPeriod struct { _ struct{} `type:"structure"` @@ -3669,6 +4246,118 @@ func (s *RequestedServiceQuotaChange) SetUnit(v string) *RequestedServiceQuotaCh return s } +// The specified resource already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// Something went wrong. +type ServiceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ServiceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceException) GoString() string { + return s.String() +} + +func newErrorServiceException(v protocol.ResponseMetadata) error { + return &ServiceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceException) Code() string { + return "ServiceException" +} + +// Message returns the exception's message. +func (s ServiceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceException) OrigErr() error { + return nil +} + +func (s ServiceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceException) RequestID() string { + return s.respMetadata.RequestID +} + // A structure that contains the ServiceName and ServiceCode. It does not include // all details of the service quota. To get those values, use the ListServiceQuotas // operation. @@ -3916,6 +4605,178 @@ func (s *ServiceQuotaIncreaseRequestInTemplate) SetUnit(v string) *ServiceQuotaI return s } +// The quota request template is not associated with your organization. +// +// To use the template, call AssociateServiceQuotaTemplate. +type ServiceQuotaTemplateNotInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ServiceQuotaTemplateNotInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceQuotaTemplateNotInUseException) GoString() string { + return s.String() +} + +func newErrorServiceQuotaTemplateNotInUseException(v protocol.ResponseMetadata) error { + return &ServiceQuotaTemplateNotInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceQuotaTemplateNotInUseException) Code() string { + return "ServiceQuotaTemplateNotInUseException" +} + +// Message returns the exception's message. +func (s ServiceQuotaTemplateNotInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceQuotaTemplateNotInUseException) OrigErr() error { + return nil +} + +func (s ServiceQuotaTemplateNotInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceQuotaTemplateNotInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceQuotaTemplateNotInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The Service Quotas template is not available in the Region where you are +// making the request. Please make the request in us-east-1. +type TemplatesNotAvailableInRegionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s TemplatesNotAvailableInRegionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TemplatesNotAvailableInRegionException) GoString() string { + return s.String() +} + +func newErrorTemplatesNotAvailableInRegionException(v protocol.ResponseMetadata) error { + return &TemplatesNotAvailableInRegionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TemplatesNotAvailableInRegionException) Code() string { + return "TemplatesNotAvailableInRegionException" +} + +// Message returns the exception's message. +func (s TemplatesNotAvailableInRegionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TemplatesNotAvailableInRegionException) OrigErr() error { + return nil +} + +func (s TemplatesNotAvailableInRegionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TemplatesNotAvailableInRegionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TemplatesNotAvailableInRegionException) RequestID() string { + return s.respMetadata.RequestID +} + +// Due to throttling, the request was denied. Slow down the rate of request +// calls, or request an increase for this quota. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + const ( // ErrorCodeDependencyAccessDeniedError is a ErrorCode enum value ErrorCodeDependencyAccessDeniedError = "DEPENDENCY_ACCESS_DENIED_ERROR" diff --git a/vendor/github.com/aws/aws-sdk-go/service/servicequotas/errors.go b/vendor/github.com/aws/aws-sdk-go/service/servicequotas/errors.go index 6afc7a200bc..664f268e1e9 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/servicequotas/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/servicequotas/errors.go @@ -2,6 +2,10 @@ package servicequotas +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAWSServiceAccessNotEnabledException for service response error code @@ -102,3 +106,21 @@ const ( // calls, or request an increase for this quota. ErrCodeTooManyRequestsException = "TooManyRequestsException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AWSServiceAccessNotEnabledException": newErrorAWSServiceAccessNotEnabledException, + "AccessDeniedException": newErrorAccessDeniedException, + "DependencyAccessDeniedException": newErrorDependencyAccessDeniedException, + "IllegalArgumentException": newErrorIllegalArgumentException, + "InvalidPaginationTokenException": newErrorInvalidPaginationTokenException, + "InvalidResourceStateException": newErrorInvalidResourceStateException, + "NoAvailableOrganizationException": newErrorNoAvailableOrganizationException, + "NoSuchResourceException": newErrorNoSuchResourceException, + "OrganizationNotInAllFeaturesModeException": newErrorOrganizationNotInAllFeaturesModeException, + "QuotaExceededException": newErrorQuotaExceededException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ServiceException": newErrorServiceException, + "ServiceQuotaTemplateNotInUseException": newErrorServiceQuotaTemplateNotInUseException, + "TemplatesNotAvailableInRegionException": newErrorTemplatesNotAvailableInRegionException, + "TooManyRequestsException": newErrorTooManyRequestsException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/servicequotas/service.go b/vendor/github.com/aws/aws-sdk-go/service/servicequotas/service.go index 6404a922552..4020a5393ba 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/servicequotas/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/servicequotas/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "Service Quotas" // Name of service. EndpointsID = "servicequotas" // ID to lookup a service endpoint with. - ServiceID = "Service Quotas" // ServiceID is a unique identifer of a specific service. + ServiceID = "Service Quotas" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the ServiceQuotas client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a ServiceQuotas client from just a session. // svc := servicequotas.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := servicequotas.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *ServiceQuotas { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *ServiceQuotas { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *ServiceQuotas { svc := &ServiceQuotas{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2019-06-24", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index d2b4340785f..5a2bc39fdbc 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ses/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ses/api.go @@ -3188,10 +3188,12 @@ func (c *SES) ListCustomVerificationEmailTemplatesPagesWithContext(ctx aws.Conte }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCustomVerificationEmailTemplatesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListCustomVerificationEmailTemplatesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3322,10 +3324,12 @@ func (c *SES) ListIdentitiesPagesWithContext(ctx aws.Context, input *ListIdentit }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListIdentitiesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListIdentitiesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } 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 index 0e33b771f53..20afce37bfd 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ses/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ses/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "email" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "SES" // ServiceID is a unique identifer of a specific service. + ServiceID = "SES" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the SES client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a SES client from just a session. // svc := ses.New(mySession) // @@ -49,11 +51,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *SES { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "ses" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *SES { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *SES { svc := &SES{ Client: client.New( cfg, @@ -62,6 +64,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2010-12-01", }, 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 index 4696345998b..062b082f319 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sfn/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sfn/api.go @@ -81,15 +81,15 @@ func (c *SFN) CreateActivityRequest(input *CreateActivityInput) (req *request.Re // See the AWS API reference guide for AWS Step Functions's // API operation CreateActivity for usage and error information. // -// Returned Error Codes: -// * ErrCodeActivityLimitExceeded "ActivityLimitExceeded" +// Returned Error Types: +// * ActivityLimitExceeded // The maximum number of activities has been reached. Existing activities must // be deleted before a new activity can be created. // -// * ErrCodeInvalidName "InvalidName" +// * InvalidName // The provided name is invalid. // -// * ErrCodeTooManyTags "TooManyTags" +// * TooManyTags // You've exceeded the number of tags allowed for a resource. See the Limits // Topic (https://docs.aws.amazon.com/step-functions/latest/dg/limits.html) // in the AWS Step Functions Developer Guide. @@ -163,17 +163,19 @@ func (c *SFN) CreateStateMachineRequest(input *CreateStateMachineInput) (req *re // Creates a state machine. A state machine consists of a collection of states // that can do work (Task states), determine to which states to transition next // (Choice states), stop an execution with an error (Fail states), and so on. -// State machines are specified using a JSON-based, structured language. +// State machines are specified using a JSON-based, structured language. For +// more information, see Amazon States Language (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html) +// in the AWS Step Functions User Guide. // // This operation is eventually consistent. The results are best effort and // may not reflect very recent updates and changes. // // CreateStateMachine is an idempotent API. Subsequent requests won’t create // a duplicate resource if it was already created. CreateStateMachine's idempotency -// check is based on the state machine name and definition. If a following request -// has a different roleArn or tags, Step Functions will ignore these differences -// and treat it as an idempotent request of the previous. In this case, roleArn -// and tags will not be updated, even if they are different. +// check is based on the state machine name, definition, type, and LoggingConfiguration. +// If a following request has a different roleArn or tags, Step Functions will +// ignore these differences and treat it as an idempotent request of the previous. +// In this case, roleArn and tags will not be updated, even if they are different. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -182,28 +184,32 @@ func (c *SFN) CreateStateMachineRequest(input *CreateStateMachineInput) (req *re // See the AWS API reference guide for AWS Step Functions's // API operation CreateStateMachine for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArn "InvalidArn" +// Returned Error Types: +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // -// * ErrCodeInvalidDefinition "InvalidDefinition" +// * InvalidDefinition // The provided Amazon States Language definition is invalid. // -// * ErrCodeInvalidName "InvalidName" +// * InvalidName // The provided name is invalid. // -// * ErrCodeStateMachineAlreadyExists "StateMachineAlreadyExists" +// * InvalidLoggingConfiguration +// +// * StateMachineAlreadyExists // A state machine with the same name but a different definition or role ARN // already exists. // -// * ErrCodeStateMachineDeleting "StateMachineDeleting" +// * StateMachineDeleting // The specified state machine is being deleted. // -// * ErrCodeStateMachineLimitExceeded "StateMachineLimitExceeded" +// * StateMachineLimitExceeded // The maximum number of state machines has been reached. Existing state machines // must be deleted before a new state machine can be created. // -// * ErrCodeTooManyTags "TooManyTags" +// * StateMachineTypeNotSupported +// +// * TooManyTags // You've exceeded the number of tags allowed for a resource. See the Limits // Topic (https://docs.aws.amazon.com/step-functions/latest/dg/limits.html) // in the AWS Step Functions Developer Guide. @@ -284,8 +290,8 @@ func (c *SFN) DeleteActivityRequest(input *DeleteActivityInput) (req *request.Re // See the AWS API reference guide for AWS Step Functions's // API operation DeleteActivity for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArn "InvalidArn" +// Returned Error Types: +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DeleteActivity @@ -356,11 +362,11 @@ func (c *SFN) DeleteStateMachineRequest(input *DeleteStateMachineInput) (req *re // 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 deletion process. Each state -// machine execution is deleted the next time it makes a state transition. +// machine's status to DELETING and begins the deletion process. // -// The state machine itself is deleted after all executions are completed or -// deleted. +// For EXPRESSstate machines, the deletion will happen eventually (usually less +// than a minute). Running executions may emit logs after DeleteStateMachine +// API is 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 @@ -369,8 +375,8 @@ func (c *SFN) DeleteStateMachineRequest(input *DeleteStateMachineInput) (req *re // See the AWS API reference guide for AWS Step Functions's // API operation DeleteStateMachine for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArn "InvalidArn" +// Returned Error Types: +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DeleteStateMachine @@ -451,11 +457,11 @@ func (c *SFN) DescribeActivityRequest(input *DescribeActivityInput) (req *reques // See the AWS API reference guide for AWS Step Functions's // API operation DescribeActivity for usage and error information. // -// Returned Error Codes: -// * ErrCodeActivityDoesNotExist "ActivityDoesNotExist" +// Returned Error Types: +// * ActivityDoesNotExist // The specified activity does not exist. // -// * ErrCodeInvalidArn "InvalidArn" +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeActivity @@ -529,6 +535,8 @@ func (c *SFN) DescribeExecutionRequest(input *DescribeExecutionInput) (req *requ // This operation is eventually consistent. The results are best effort and // may not reflect very recent updates and changes. // +// This API action is not supported by EXPRESS state machines. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -536,11 +544,11 @@ func (c *SFN) DescribeExecutionRequest(input *DescribeExecutionInput) (req *requ // See the AWS API reference guide for AWS Step Functions's // API operation DescribeExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeExecutionDoesNotExist "ExecutionDoesNotExist" +// Returned Error Types: +// * ExecutionDoesNotExist // The specified execution does not exist. // -// * ErrCodeInvalidArn "InvalidArn" +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeExecution @@ -621,11 +629,11 @@ func (c *SFN) DescribeStateMachineRequest(input *DescribeStateMachineInput) (req // See the AWS API reference guide for AWS Step Functions's // API operation DescribeStateMachine for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArn "InvalidArn" +// Returned Error Types: +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // -// * ErrCodeStateMachineDoesNotExist "StateMachineDoesNotExist" +// * StateMachineDoesNotExist // The specified state machine does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeStateMachine @@ -699,6 +707,8 @@ func (c *SFN) DescribeStateMachineForExecutionRequest(input *DescribeStateMachin // This operation is eventually consistent. The results are best effort and // may not reflect very recent updates and changes. // +// This API action is not supported by EXPRESS state machines. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -706,11 +716,11 @@ func (c *SFN) DescribeStateMachineForExecutionRequest(input *DescribeStateMachin // See the AWS API reference guide for AWS Step Functions's // API operation DescribeStateMachineForExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeExecutionDoesNotExist "ExecutionDoesNotExist" +// Returned Error Types: +// * ExecutionDoesNotExist // The specified execution does not exist. // -// * ErrCodeInvalidArn "InvalidArn" +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/DescribeStateMachineForExecution @@ -801,15 +811,15 @@ func (c *SFN) GetActivityTaskRequest(input *GetActivityTaskInput) (req *request. // See the AWS API reference guide for AWS Step Functions's // API operation GetActivityTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeActivityDoesNotExist "ActivityDoesNotExist" +// Returned Error Types: +// * ActivityDoesNotExist // The specified activity does not exist. // -// * ErrCodeActivityWorkerLimitExceeded "ActivityWorkerLimitExceeded" +// * ActivityWorkerLimitExceeded // The maximum number of workers concurrently polling for activity tasks has // been reached. // -// * ErrCodeInvalidArn "InvalidArn" +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/GetActivityTask @@ -894,6 +904,8 @@ func (c *SFN) GetExecutionHistoryRequest(input *GetExecutionHistoryInput) (req * // unchanged. Each pagination token expires after 24 hours. Using an expired // pagination token will return an HTTP 400 InvalidToken error. // +// This API action is not supported by EXPRESS state machines. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -901,14 +913,14 @@ func (c *SFN) GetExecutionHistoryRequest(input *GetExecutionHistoryInput) (req * // See the AWS API reference guide for AWS Step Functions's // API operation GetExecutionHistory for usage and error information. // -// Returned Error Codes: -// * ErrCodeExecutionDoesNotExist "ExecutionDoesNotExist" +// Returned Error Types: +// * ExecutionDoesNotExist // The specified execution does not exist. // -// * ErrCodeInvalidArn "InvalidArn" +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // -// * ErrCodeInvalidToken "InvalidToken" +// * InvalidToken // The provided token is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/GetExecutionHistory @@ -976,10 +988,12 @@ func (c *SFN) GetExecutionHistoryPagesWithContext(ctx aws.Context, input *GetExe }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetExecutionHistoryOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetExecutionHistoryOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1051,8 +1065,8 @@ func (c *SFN) ListActivitiesRequest(input *ListActivitiesInput) (req *request.Re // See the AWS API reference guide for AWS Step Functions's // API operation ListActivities for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidToken "InvalidToken" +// Returned Error Types: +// * InvalidToken // The provided token is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListActivities @@ -1120,10 +1134,12 @@ func (c *SFN) ListActivitiesPagesWithContext(ctx aws.Context, input *ListActivit }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListActivitiesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListActivitiesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1189,6 +1205,8 @@ func (c *SFN) ListExecutionsRequest(input *ListExecutionsInput) (req *request.Re // This operation is eventually consistent. The results are best effort and // may not reflect very recent updates and changes. // +// This API action is not supported by EXPRESS state machines. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1196,16 +1214,18 @@ func (c *SFN) ListExecutionsRequest(input *ListExecutionsInput) (req *request.Re // See the AWS API reference guide for AWS Step Functions's // API operation ListExecutions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArn "InvalidArn" +// Returned Error Types: +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // -// * ErrCodeInvalidToken "InvalidToken" +// * InvalidToken // The provided token is invalid. // -// * ErrCodeStateMachineDoesNotExist "StateMachineDoesNotExist" +// * StateMachineDoesNotExist // The specified state machine does not exist. // +// * StateMachineTypeNotSupported +// // See also, 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) @@ -1271,10 +1291,12 @@ func (c *SFN) ListExecutionsPagesWithContext(ctx aws.Context, input *ListExecuti }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListExecutionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListExecutionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1346,8 +1368,8 @@ func (c *SFN) ListStateMachinesRequest(input *ListStateMachinesInput) (req *requ // See the AWS API reference guide for AWS Step Functions's // API operation ListStateMachines for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidToken "InvalidToken" +// Returned Error Types: +// * InvalidToken // The provided token is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/ListStateMachines @@ -1415,10 +1437,12 @@ func (c *SFN) ListStateMachinesPagesWithContext(ctx aws.Context, input *ListStat }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListStateMachinesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListStateMachinesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1478,11 +1502,11 @@ func (c *SFN) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req * // See the AWS API reference guide for AWS Step Functions's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArn "InvalidArn" +// Returned Error Types: +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // -// * ErrCodeResourceNotFound "ResourceNotFound" +// * ResourceNotFound // Could not find the referenced resource. Only state machine and activity ARNs // are supported. // @@ -1563,13 +1587,13 @@ func (c *SFN) SendTaskFailureRequest(input *SendTaskFailureInput) (req *request. // See the AWS API reference guide for AWS Step Functions's // API operation SendTaskFailure for usage and error information. // -// Returned Error Codes: -// * ErrCodeTaskDoesNotExist "TaskDoesNotExist" +// Returned Error Types: +// * TaskDoesNotExist // -// * ErrCodeInvalidToken "InvalidToken" +// * InvalidToken // The provided token is invalid. // -// * ErrCodeTaskTimedOut "TaskTimedOut" +// * TaskTimedOut // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskFailure func (c *SFN) SendTaskFailure(input *SendTaskFailureInput) (*SendTaskFailureOutput, error) { @@ -1661,13 +1685,13 @@ func (c *SFN) SendTaskHeartbeatRequest(input *SendTaskHeartbeatInput) (req *requ // See the AWS API reference guide for AWS Step Functions's // API operation SendTaskHeartbeat for usage and error information. // -// Returned Error Codes: -// * ErrCodeTaskDoesNotExist "TaskDoesNotExist" +// Returned Error Types: +// * TaskDoesNotExist // -// * ErrCodeInvalidToken "InvalidToken" +// * InvalidToken // The provided token is invalid. // -// * ErrCodeTaskTimedOut "TaskTimedOut" +// * TaskTimedOut // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskHeartbeat func (c *SFN) SendTaskHeartbeat(input *SendTaskHeartbeatInput) (*SendTaskHeartbeatOutput, error) { @@ -1746,16 +1770,16 @@ func (c *SFN) SendTaskSuccessRequest(input *SendTaskSuccessInput) (req *request. // See the AWS API reference guide for AWS Step Functions's // API operation SendTaskSuccess for usage and error information. // -// Returned Error Codes: -// * ErrCodeTaskDoesNotExist "TaskDoesNotExist" +// Returned Error Types: +// * TaskDoesNotExist // -// * ErrCodeInvalidOutput "InvalidOutput" +// * InvalidOutput // The provided JSON output data is invalid. // -// * ErrCodeInvalidToken "InvalidToken" +// * InvalidToken // The provided token is invalid. // -// * ErrCodeTaskTimedOut "TaskTimedOut" +// * TaskTimedOut // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/SendTaskSuccess func (c *SFN) SendTaskSuccess(input *SendTaskSuccessInput) (*SendTaskSuccessOutput, error) { @@ -1838,29 +1862,29 @@ func (c *SFN) StartExecutionRequest(input *StartExecutionInput) (req *request.Re // See the AWS API reference guide for AWS Step Functions's // API operation StartExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeExecutionLimitExceeded "ExecutionLimitExceeded" +// Returned Error Types: +// * 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" +// * ExecutionAlreadyExists // The execution has the same name as another execution (but a different input). // // Executions with the same name and input are considered idempotent. // -// * ErrCodeInvalidArn "InvalidArn" +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // -// * ErrCodeInvalidExecutionInput "InvalidExecutionInput" +// * InvalidExecutionInput // The provided JSON input data is invalid. // -// * ErrCodeInvalidName "InvalidName" +// * InvalidName // The provided name is invalid. // -// * ErrCodeStateMachineDoesNotExist "StateMachineDoesNotExist" +// * StateMachineDoesNotExist // The specified state machine does not exist. // -// * ErrCodeStateMachineDeleting "StateMachineDeleting" +// * StateMachineDeleting // The specified state machine is being deleted. // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StartExecution @@ -1931,6 +1955,8 @@ func (c *SFN) StopExecutionRequest(input *StopExecutionInput) (req *request.Requ // // Stops an execution. // +// This API action is not supported by EXPRESS state machines. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1938,11 +1964,11 @@ func (c *SFN) StopExecutionRequest(input *StopExecutionInput) (req *request.Requ // See the AWS API reference guide for AWS Step Functions's // API operation StopExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeExecutionDoesNotExist "ExecutionDoesNotExist" +// Returned Error Types: +// * ExecutionDoesNotExist // The specified execution does not exist. // -// * ErrCodeInvalidArn "InvalidArn" +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/StopExecution @@ -2029,15 +2055,15 @@ func (c *SFN) TagResourceRequest(input *TagResourceInput) (req *request.Request, // See the AWS API reference guide for AWS Step Functions's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArn "InvalidArn" +// Returned Error Types: +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // -// * ErrCodeResourceNotFound "ResourceNotFound" +// * ResourceNotFound // Could not find the referenced resource. Only state machine and activity ARNs // are supported. // -// * ErrCodeTooManyTags "TooManyTags" +// * TooManyTags // You've exceeded the number of tags allowed for a resource. See the Limits // Topic (https://docs.aws.amazon.com/step-functions/latest/dg/limits.html) // in the AWS Step Functions Developer Guide. @@ -2118,11 +2144,11 @@ func (c *SFN) UntagResourceRequest(input *UntagResourceInput) (req *request.Requ // See the AWS API reference guide for AWS Step Functions's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArn "InvalidArn" +// Returned Error Types: +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // -// * ErrCodeResourceNotFound "ResourceNotFound" +// * ResourceNotFound // Could not find the referenced resource. Only state machine and activity ARNs // are supported. // @@ -2192,10 +2218,10 @@ func (c *SFN) UpdateStateMachineRequest(input *UpdateStateMachineInput) (req *re // UpdateStateMachine API operation for AWS Step Functions. // -// Updates an existing state machine by modifying its definition and/or roleArn. -// Running executions will continue to use the previous definition and roleArn. -// You must include at least one of definition or roleArn or you will receive -// a MissingRequiredParameter error. +// Updates an existing state machine by modifying its definition, roleArn, or +// loggingConfiguration. Running executions will continue to use the previous +// definition and roleArn. You must include at least one of definition or roleArn +// or you will receive a MissingRequiredParameter error. // // All StartExecution calls within a few seconds will use the updated definition // and roleArn. Executions started immediately after calling UpdateStateMachine @@ -2208,21 +2234,23 @@ func (c *SFN) UpdateStateMachineRequest(input *UpdateStateMachineInput) (req *re // See the AWS API reference guide for AWS Step Functions's // API operation UpdateStateMachine for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidArn "InvalidArn" +// Returned Error Types: +// * InvalidArn // The provided Amazon Resource Name (ARN) is invalid. // -// * ErrCodeInvalidDefinition "InvalidDefinition" +// * InvalidDefinition // The provided Amazon States Language definition is invalid. // -// * ErrCodeMissingRequiredParameter "MissingRequiredParameter" +// * InvalidLoggingConfiguration +// +// * MissingRequiredParameter // Request is missing a required parameter. This error occurs if both definition // and roleArn are not specified. // -// * ErrCodeStateMachineDeleting "StateMachineDeleting" +// * StateMachineDeleting // The specified state machine is being deleted. // -// * ErrCodeStateMachineDoesNotExist "StateMachineDoesNotExist" +// * StateMachineDoesNotExist // The specified state machine does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/states-2016-11-23/UpdateStateMachine @@ -2247,6 +2275,62 @@ func (c *SFN) UpdateStateMachineWithContext(ctx aws.Context, input *UpdateStateM return out, req.Send() } +// The specified activity does not exist. +type ActivityDoesNotExist struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ActivityDoesNotExist) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ActivityDoesNotExist) GoString() string { + return s.String() +} + +func newErrorActivityDoesNotExist(v protocol.ResponseMetadata) error { + return &ActivityDoesNotExist{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ActivityDoesNotExist) Code() string { + return "ActivityDoesNotExist" +} + +// Message returns the exception's message. +func (s ActivityDoesNotExist) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ActivityDoesNotExist) OrigErr() error { + return nil +} + +func (s ActivityDoesNotExist) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ActivityDoesNotExist) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ActivityDoesNotExist) RequestID() string { + return s.respMetadata.RequestID +} + // Contains details about an activity that failed during an execution. type ActivityFailedEventDetails struct { _ struct{} `type:"structure"` @@ -2280,6 +2364,63 @@ func (s *ActivityFailedEventDetails) SetError(v string) *ActivityFailedEventDeta return s } +// The maximum number of activities has been reached. Existing activities must +// be deleted before a new activity can be created. +type ActivityLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ActivityLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ActivityLimitExceeded) GoString() string { + return s.String() +} + +func newErrorActivityLimitExceeded(v protocol.ResponseMetadata) error { + return &ActivityLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ActivityLimitExceeded) Code() string { + return "ActivityLimitExceeded" +} + +// Message returns the exception's message. +func (s ActivityLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ActivityLimitExceeded) OrigErr() error { + return nil +} + +func (s ActivityLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ActivityLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ActivityLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + // Contains details about an activity. type ActivityListItem struct { _ struct{} `type:"structure"` @@ -2308,6 +2449,9 @@ type ActivityListItem struct { // // * control characters (U+0000-001F, U+007F-009F) // + // To enable logging with CloudWatch Logs, the name should only contain 0-9, + // A-Z, a-z, - and _. + // // Name is a required field Name *string `locationName:"name" min:"1" type:"string" required:"true"` } @@ -2510,6 +2654,100 @@ func (s *ActivityTimedOutEventDetails) SetError(v string) *ActivityTimedOutEvent return s } +// The maximum number of workers concurrently polling for activity tasks has +// been reached. +type ActivityWorkerLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ActivityWorkerLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ActivityWorkerLimitExceeded) GoString() string { + return s.String() +} + +func newErrorActivityWorkerLimitExceeded(v protocol.ResponseMetadata) error { + return &ActivityWorkerLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ActivityWorkerLimitExceeded) Code() string { + return "ActivityWorkerLimitExceeded" +} + +// Message returns the exception's message. +func (s ActivityWorkerLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ActivityWorkerLimitExceeded) OrigErr() error { + return nil +} + +func (s ActivityWorkerLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ActivityWorkerLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ActivityWorkerLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + +type CloudWatchLogsLogGroup struct { + _ struct{} `type:"structure"` + + // The ARN of the the CloudWatch log group to which you want your logs emitted + // to. The ARN must end with :* + LogGroupArn *string `locationName:"logGroupArn" min:"1" type:"string"` +} + +// String returns the string representation +func (s CloudWatchLogsLogGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CloudWatchLogsLogGroup) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CloudWatchLogsLogGroup) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CloudWatchLogsLogGroup"} + if s.LogGroupArn != nil && len(*s.LogGroupArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LogGroupArn", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLogGroupArn sets the LogGroupArn field's value. +func (s *CloudWatchLogsLogGroup) SetLogGroupArn(v string) *CloudWatchLogsLogGroup { + s.LogGroupArn = &v + return s +} + type CreateActivityInput struct { _ struct{} `type:"structure"` @@ -2530,6 +2768,9 @@ type CreateActivityInput struct { // // * control characters (U+0000-001F, U+007F-009F) // + // To enable logging with CloudWatch Logs, the name should only contain 0-9, + // A-Z, a-z, - and _. + // // Name is a required field Name *string `locationName:"name" min:"1" type:"string" required:"true"` @@ -2638,6 +2879,13 @@ type CreateStateMachineInput struct { // Definition is a required field Definition *string `locationName:"definition" min:"1" type:"string" required:"true" sensitive:"true"` + // Defines what execution history events are logged and where they are logged. + // + // By default, the level is set to OFF. For more information see Log Levels + // (https://docs.aws.amazon.com/step-functions/latest/dg/cloudwatch-log-level.html) + // in the AWS Step Functions User Guide. + LoggingConfiguration *LoggingConfiguration `locationName:"loggingConfiguration" type:"structure"` + // The name of the state machine. // // A name must not contain: @@ -2652,6 +2900,9 @@ type CreateStateMachineInput struct { // // * control characters (U+0000-001F, U+007F-009F) // + // To enable logging with CloudWatch Logs, the name should only contain 0-9, + // A-Z, a-z, - and _. + // // Name is a required field Name *string `locationName:"name" min:"1" type:"string" required:"true"` @@ -2670,6 +2921,11 @@ type CreateStateMachineInput struct { // Tags may only contain Unicode letters, digits, white space, or these symbols: // _ . : / = + - @. Tags []*Tag `locationName:"tags" type:"list"` + + // Determines whether a Standard or Express state machine is created. The default + // is STANDARD. You cannot update the type of a state machine once it has been + // created. + Type *string `locationName:"type" type:"string" enum:"StateMachineType"` } // String returns the string representation @@ -2703,6 +2959,11 @@ func (s *CreateStateMachineInput) Validate() error { if s.RoleArn != nil && len(*s.RoleArn) < 1 { invalidParams.Add(request.NewErrParamMinLen("RoleArn", 1)) } + if s.LoggingConfiguration != nil { + if err := s.LoggingConfiguration.Validate(); err != nil { + invalidParams.AddNested("LoggingConfiguration", err.(request.ErrInvalidParams)) + } + } if s.Tags != nil { for i, v := range s.Tags { if v == nil { @@ -2726,6 +2987,12 @@ func (s *CreateStateMachineInput) SetDefinition(v string) *CreateStateMachineInp return s } +// SetLoggingConfiguration sets the LoggingConfiguration field's value. +func (s *CreateStateMachineInput) SetLoggingConfiguration(v *LoggingConfiguration) *CreateStateMachineInput { + s.LoggingConfiguration = v + return s +} + // SetName sets the Name field's value. func (s *CreateStateMachineInput) SetName(v string) *CreateStateMachineInput { s.Name = &v @@ -2744,6 +3011,12 @@ func (s *CreateStateMachineInput) SetTags(v []*Tag) *CreateStateMachineInput { return s } +// SetType sets the Type field's value. +func (s *CreateStateMachineInput) SetType(v string) *CreateStateMachineInput { + s.Type = &v + return s +} + type CreateStateMachineOutput struct { _ struct{} `type:"structure"` @@ -2958,6 +3231,9 @@ type DescribeActivityOutput struct { // // * control characters (U+0000-001F, U+007F-009F) // + // To enable logging with CloudWatch Logs, the name should only contain 0-9, + // A-Z, a-z, - and _. + // // Name is a required field Name *string `locationName:"name" min:"1" type:"string" required:"true"` } @@ -3034,7 +3310,7 @@ func (s *DescribeExecutionInput) SetExecutionArn(v string) *DescribeExecutionInp type DescribeExecutionOutput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) that identifies the execution. + // The Amazon Resource Name (ARN) that id entifies the execution. // // ExecutionArn is a required field ExecutionArn *string `locationName:"executionArn" min:"1" type:"string" required:"true"` @@ -3057,6 +3333,9 @@ type DescribeExecutionOutput struct { // * special characters " # % \ ^ | ~ ` $ & , ; : / // // * control characters (U+0000-001F, U+007F-009F) + // + // To enable logging with CloudWatch Logs, the name should only contain 0-9, + // A-Z, a-z, - and _. Name *string `locationName:"name" min:"1" type:"string"` // The JSON output data of the execution. @@ -3193,6 +3472,9 @@ type DescribeStateMachineForExecutionOutput struct { // Definition is a required field Definition *string `locationName:"definition" min:"1" type:"string" required:"true" sensitive:"true"` + // The LoggingConfiguration data type is used to set CloudWatch Logs options. + LoggingConfiguration *LoggingConfiguration `locationName:"loggingConfiguration" type:"structure"` + // The name of the state machine associated with the execution. // // Name is a required field @@ -3232,6 +3514,12 @@ func (s *DescribeStateMachineForExecutionOutput) SetDefinition(v string) *Descri return s } +// SetLoggingConfiguration sets the LoggingConfiguration field's value. +func (s *DescribeStateMachineForExecutionOutput) SetLoggingConfiguration(v *LoggingConfiguration) *DescribeStateMachineForExecutionOutput { + s.LoggingConfiguration = v + return s +} + // SetName sets the Name field's value. func (s *DescribeStateMachineForExecutionOutput) SetName(v string) *DescribeStateMachineForExecutionOutput { s.Name = &v @@ -3311,6 +3599,9 @@ type DescribeStateMachineOutput struct { // Definition is a required field Definition *string `locationName:"definition" min:"1" type:"string" required:"true" sensitive:"true"` + // The LoggingConfiguration data type is used to set CloudWatch Logs options. + LoggingConfiguration *LoggingConfiguration `locationName:"loggingConfiguration" type:"structure"` + // The name of the state machine. // // A name must not contain: @@ -3325,6 +3616,9 @@ type DescribeStateMachineOutput struct { // // * control characters (U+0000-001F, U+007F-009F) // + // To enable logging with CloudWatch Logs, the name should only contain 0-9, + // A-Z, a-z, - and _. + // // Name is a required field Name *string `locationName:"name" min:"1" type:"string" required:"true"` @@ -3342,6 +3636,11 @@ type DescribeStateMachineOutput struct { // The current status of the state machine. Status *string `locationName:"status" type:"string" enum:"StateMachineStatus"` + + // The type of the state machine (STANDARD or EXPRESS). + // + // Type is a required field + Type *string `locationName:"type" type:"string" required:"true" enum:"StateMachineType"` } // String returns the string representation @@ -3366,6 +3665,12 @@ func (s *DescribeStateMachineOutput) SetDefinition(v string) *DescribeStateMachi return s } +// SetLoggingConfiguration sets the LoggingConfiguration field's value. +func (s *DescribeStateMachineOutput) SetLoggingConfiguration(v *LoggingConfiguration) *DescribeStateMachineOutput { + s.LoggingConfiguration = v + return s +} + // SetName sets the Name field's value. func (s *DescribeStateMachineOutput) SetName(v string) *DescribeStateMachineOutput { s.Name = &v @@ -3390,6 +3695,12 @@ func (s *DescribeStateMachineOutput) SetStatus(v string) *DescribeStateMachineOu return s } +// SetType sets the Type field's value. +func (s *DescribeStateMachineOutput) SetType(v string) *DescribeStateMachineOutput { + s.Type = &v + return s +} + // Contains details about an abort of an execution. type ExecutionAbortedEventDetails struct { _ struct{} `type:"structure"` @@ -3423,6 +3734,120 @@ func (s *ExecutionAbortedEventDetails) SetError(v string) *ExecutionAbortedEvent return s } +// The execution has the same name as another execution (but a different input). +// +// Executions with the same name and input are considered idempotent. +type ExecutionAlreadyExists struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ExecutionAlreadyExists) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExecutionAlreadyExists) GoString() string { + return s.String() +} + +func newErrorExecutionAlreadyExists(v protocol.ResponseMetadata) error { + return &ExecutionAlreadyExists{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ExecutionAlreadyExists) Code() string { + return "ExecutionAlreadyExists" +} + +// Message returns the exception's message. +func (s ExecutionAlreadyExists) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ExecutionAlreadyExists) OrigErr() error { + return nil +} + +func (s ExecutionAlreadyExists) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ExecutionAlreadyExists) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ExecutionAlreadyExists) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified execution does not exist. +type ExecutionDoesNotExist struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ExecutionDoesNotExist) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExecutionDoesNotExist) GoString() string { + return s.String() +} + +func newErrorExecutionDoesNotExist(v protocol.ResponseMetadata) error { + return &ExecutionDoesNotExist{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ExecutionDoesNotExist) Code() string { + return "ExecutionDoesNotExist" +} + +// Message returns the exception's message. +func (s ExecutionDoesNotExist) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ExecutionDoesNotExist) OrigErr() error { + return nil +} + +func (s ExecutionDoesNotExist) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ExecutionDoesNotExist) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ExecutionDoesNotExist) RequestID() string { + return s.respMetadata.RequestID +} + // Contains details about an execution failure event. type ExecutionFailedEventDetails struct { _ struct{} `type:"structure"` @@ -3456,11 +3881,68 @@ func (s *ExecutionFailedEventDetails) SetError(v string) *ExecutionFailedEventDe return s } +// The maximum number of running executions has been reached. Running executions +// must end or be stopped before a new execution can be started. +type ExecutionLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ExecutionLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExecutionLimitExceeded) GoString() string { + return s.String() +} + +func newErrorExecutionLimitExceeded(v protocol.ResponseMetadata) error { + return &ExecutionLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ExecutionLimitExceeded) Code() string { + return "ExecutionLimitExceeded" +} + +// Message returns the exception's message. +func (s ExecutionLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ExecutionLimitExceeded) OrigErr() error { + return nil +} + +func (s ExecutionLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ExecutionLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ExecutionLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + // Contains details about an execution. type ExecutionListItem struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) that identifies the execution. + // The Amazon Resource Name (ARN) that id entifies the execution. // // ExecutionArn is a required field ExecutionArn *string `locationName:"executionArn" min:"1" type:"string" required:"true"` @@ -3479,6 +3961,9 @@ type ExecutionListItem struct { // // * control characters (U+0000-001F, U+007F-009F) // + // To enable logging with CloudWatch Logs, the name should only contain 0-9, + // A-Z, a-z, - and _. + // // Name is a required field Name *string `locationName:"name" min:"1" type:"string" required:"true"` @@ -4195,24 +4680,415 @@ func (s *HistoryEvent) SetType(v string) *HistoryEvent { return s } -// Contains details about a lambda function that failed during an execution. -type LambdaFunctionFailedEventDetails struct { - _ struct{} `type:"structure"` - - // A more detailed explanation of the cause of the failure. - Cause *string `locationName:"cause" type:"string" sensitive:"true"` +// The provided Amazon Resource Name (ARN) is invalid. +type InvalidArn struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The error code of the failure. - Error *string `locationName:"error" type:"string" sensitive:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s LambdaFunctionFailedEventDetails) String() string { +func (s InvalidArn) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LambdaFunctionFailedEventDetails) GoString() string { +func (s InvalidArn) GoString() string { + return s.String() +} + +func newErrorInvalidArn(v protocol.ResponseMetadata) error { + return &InvalidArn{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidArn) Code() string { + return "InvalidArn" +} + +// Message returns the exception's message. +func (s InvalidArn) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidArn) OrigErr() error { + return nil +} + +func (s InvalidArn) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidArn) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidArn) RequestID() string { + return s.respMetadata.RequestID +} + +// The provided Amazon States Language definition is invalid. +type InvalidDefinition struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidDefinition) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDefinition) GoString() string { + return s.String() +} + +func newErrorInvalidDefinition(v protocol.ResponseMetadata) error { + return &InvalidDefinition{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDefinition) Code() string { + return "InvalidDefinition" +} + +// Message returns the exception's message. +func (s InvalidDefinition) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDefinition) OrigErr() error { + return nil +} + +func (s InvalidDefinition) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDefinition) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDefinition) RequestID() string { + return s.respMetadata.RequestID +} + +// The provided JSON input data is invalid. +type InvalidExecutionInput struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidExecutionInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidExecutionInput) GoString() string { + return s.String() +} + +func newErrorInvalidExecutionInput(v protocol.ResponseMetadata) error { + return &InvalidExecutionInput{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidExecutionInput) Code() string { + return "InvalidExecutionInput" +} + +// Message returns the exception's message. +func (s InvalidExecutionInput) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidExecutionInput) OrigErr() error { + return nil +} + +func (s InvalidExecutionInput) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidExecutionInput) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidExecutionInput) RequestID() string { + return s.respMetadata.RequestID +} + +type InvalidLoggingConfiguration struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidLoggingConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidLoggingConfiguration) GoString() string { + return s.String() +} + +func newErrorInvalidLoggingConfiguration(v protocol.ResponseMetadata) error { + return &InvalidLoggingConfiguration{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidLoggingConfiguration) Code() string { + return "InvalidLoggingConfiguration" +} + +// Message returns the exception's message. +func (s InvalidLoggingConfiguration) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidLoggingConfiguration) OrigErr() error { + return nil +} + +func (s InvalidLoggingConfiguration) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidLoggingConfiguration) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidLoggingConfiguration) RequestID() string { + return s.respMetadata.RequestID +} + +// The provided name is invalid. +type InvalidName struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidName) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidName) GoString() string { + return s.String() +} + +func newErrorInvalidName(v protocol.ResponseMetadata) error { + return &InvalidName{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidName) Code() string { + return "InvalidName" +} + +// Message returns the exception's message. +func (s InvalidName) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidName) OrigErr() error { + return nil +} + +func (s InvalidName) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidName) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidName) RequestID() string { + return s.respMetadata.RequestID +} + +// The provided JSON output data is invalid. +type InvalidOutput struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidOutput) GoString() string { + return s.String() +} + +func newErrorInvalidOutput(v protocol.ResponseMetadata) error { + return &InvalidOutput{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidOutput) Code() string { + return "InvalidOutput" +} + +// Message returns the exception's message. +func (s InvalidOutput) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidOutput) OrigErr() error { + return nil +} + +func (s InvalidOutput) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidOutput) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidOutput) RequestID() string { + return s.respMetadata.RequestID +} + +// The provided token is invalid. +type InvalidToken struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidToken) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidToken) GoString() string { + return s.String() +} + +func newErrorInvalidToken(v protocol.ResponseMetadata) error { + return &InvalidToken{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidToken) Code() string { + return "InvalidToken" +} + +// Message returns the exception's message. +func (s InvalidToken) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidToken) OrigErr() error { + return nil +} + +func (s InvalidToken) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidToken) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidToken) RequestID() string { + return s.respMetadata.RequestID +} + +// Contains details about a lambda function that failed during an execution. +type LambdaFunctionFailedEventDetails struct { + _ struct{} `type:"structure"` + + // A more detailed explanation of the cause of the failure. + Cause *string `locationName:"cause" type:"string" sensitive:"true"` + + // The error code of the failure. + Error *string `locationName:"error" type:"string" sensitive:"true"` +} + +// 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() } @@ -4763,6 +5639,110 @@ func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput return s } +type LogDestination struct { + _ struct{} `type:"structure"` + + // An object describing a CloudWatch log group. For more information, see AWS::Logs::LogGroup + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html) + // in the AWS CloudFormation User Guide. + CloudWatchLogsLogGroup *CloudWatchLogsLogGroup `locationName:"cloudWatchLogsLogGroup" type:"structure"` +} + +// String returns the string representation +func (s LogDestination) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LogDestination) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LogDestination) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LogDestination"} + if s.CloudWatchLogsLogGroup != nil { + if err := s.CloudWatchLogsLogGroup.Validate(); err != nil { + invalidParams.AddNested("CloudWatchLogsLogGroup", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCloudWatchLogsLogGroup sets the CloudWatchLogsLogGroup field's value. +func (s *LogDestination) SetCloudWatchLogsLogGroup(v *CloudWatchLogsLogGroup) *LogDestination { + s.CloudWatchLogsLogGroup = v + return s +} + +// The LoggingConfiguration data type is used to set CloudWatch Logs options. +type LoggingConfiguration struct { + _ struct{} `type:"structure"` + + // An array of objects that describes where your execution history events will + // be logged. Limited to size 1. Required, if your log level is not set to OFF. + Destinations []*LogDestination `locationName:"destinations" type:"list"` + + // Determines whether execution data is included in your log. When set to FALSE, + // data is excluded. + IncludeExecutionData *bool `locationName:"includeExecutionData" type:"boolean"` + + // Defines which category of execution history events are logged. + Level *string `locationName:"level" type:"string" enum:"LogLevel"` +} + +// String returns the string representation +func (s LoggingConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LoggingConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LoggingConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LoggingConfiguration"} + if s.Destinations != nil { + for i, v := range s.Destinations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Destinations", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDestinations sets the Destinations field's value. +func (s *LoggingConfiguration) SetDestinations(v []*LogDestination) *LoggingConfiguration { + s.Destinations = v + return s +} + +// SetIncludeExecutionData sets the IncludeExecutionData field's value. +func (s *LoggingConfiguration) SetIncludeExecutionData(v bool) *LoggingConfiguration { + s.IncludeExecutionData = &v + return s +} + +// SetLevel sets the Level field's value. +func (s *LoggingConfiguration) SetLevel(v string) *LoggingConfiguration { + s.Level = &v + return s +} + // Contains details about an iteration of a Map state. type MapIterationEventDetails struct { _ struct{} `type:"structure"` @@ -4814,10 +5794,126 @@ func (s MapStateStartedEventDetails) GoString() string { return s.String() } -// SetLength sets the Length field's value. -func (s *MapStateStartedEventDetails) SetLength(v int64) *MapStateStartedEventDetails { - s.Length = &v - return s +// SetLength sets the Length field's value. +func (s *MapStateStartedEventDetails) SetLength(v int64) *MapStateStartedEventDetails { + s.Length = &v + return s +} + +// Request is missing a required parameter. This error occurs if both definition +// and roleArn are not specified. +type MissingRequiredParameter struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s MissingRequiredParameter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MissingRequiredParameter) GoString() string { + return s.String() +} + +func newErrorMissingRequiredParameter(v protocol.ResponseMetadata) error { + return &MissingRequiredParameter{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MissingRequiredParameter) Code() string { + return "MissingRequiredParameter" +} + +// Message returns the exception's message. +func (s MissingRequiredParameter) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MissingRequiredParameter) OrigErr() error { + return nil +} + +func (s MissingRequiredParameter) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MissingRequiredParameter) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MissingRequiredParameter) RequestID() string { + return s.respMetadata.RequestID +} + +// Could not find the referenced resource. Only state machine and activity ARNs +// are supported. +type ResourceNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + ResourceName *string `locationName:"resourceName" min:"1" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFound) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFound) GoString() string { + return s.String() +} + +func newErrorResourceNotFound(v protocol.ResponseMetadata) error { + return &ResourceNotFound{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFound) Code() string { + return "ResourceNotFound" +} + +// Message returns the exception's message. +func (s ResourceNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFound) OrigErr() error { + return nil +} + +func (s ResourceNotFound) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFound) RequestID() string { + return s.respMetadata.RequestID } type SendTaskFailureInput struct { @@ -5050,6 +6146,9 @@ type StartExecutionInput struct { // * special characters " # % \ ^ | ~ ` $ & , ; : / // // * control characters (U+0000-001F, U+007F-009F) + // + // To enable logging with CloudWatch Logs, the name should only contain 0-9, + // A-Z, a-z, - and _. Name *string `locationName:"name" min:"1" type:"string"` // The Amazon Resource Name (ARN) of the state machine to execute. @@ -5108,7 +6207,7 @@ func (s *StartExecutionInput) SetStateMachineArn(v string) *StartExecutionInput type StartExecutionOutput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) that identifies the execution. + // The Amazon Resource Name (ARN) that id entifies the execution. // // ExecutionArn is a required field ExecutionArn *string `locationName:"executionArn" min:"1" type:"string" required:"true"` @@ -5194,6 +6293,9 @@ type StateExitedEventDetails struct { // // * control characters (U+0000-001F, U+007F-009F) // + // To enable logging with CloudWatch Logs, the name should only contain 0-9, + // A-Z, a-z, - and _. + // // Name is a required field Name *string `locationName:"name" min:"1" type:"string" required:"true"` @@ -5223,6 +6325,232 @@ func (s *StateExitedEventDetails) SetOutput(v string) *StateExitedEventDetails { return s } +// A state machine with the same name but a different definition or role ARN +// already exists. +type StateMachineAlreadyExists struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s StateMachineAlreadyExists) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StateMachineAlreadyExists) GoString() string { + return s.String() +} + +func newErrorStateMachineAlreadyExists(v protocol.ResponseMetadata) error { + return &StateMachineAlreadyExists{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s StateMachineAlreadyExists) Code() string { + return "StateMachineAlreadyExists" +} + +// Message returns the exception's message. +func (s StateMachineAlreadyExists) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s StateMachineAlreadyExists) OrigErr() error { + return nil +} + +func (s StateMachineAlreadyExists) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s StateMachineAlreadyExists) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s StateMachineAlreadyExists) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified state machine is being deleted. +type StateMachineDeleting struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s StateMachineDeleting) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StateMachineDeleting) GoString() string { + return s.String() +} + +func newErrorStateMachineDeleting(v protocol.ResponseMetadata) error { + return &StateMachineDeleting{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s StateMachineDeleting) Code() string { + return "StateMachineDeleting" +} + +// Message returns the exception's message. +func (s StateMachineDeleting) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s StateMachineDeleting) OrigErr() error { + return nil +} + +func (s StateMachineDeleting) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s StateMachineDeleting) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s StateMachineDeleting) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified state machine does not exist. +type StateMachineDoesNotExist struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s StateMachineDoesNotExist) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StateMachineDoesNotExist) GoString() string { + return s.String() +} + +func newErrorStateMachineDoesNotExist(v protocol.ResponseMetadata) error { + return &StateMachineDoesNotExist{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s StateMachineDoesNotExist) Code() string { + return "StateMachineDoesNotExist" +} + +// Message returns the exception's message. +func (s StateMachineDoesNotExist) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s StateMachineDoesNotExist) OrigErr() error { + return nil +} + +func (s StateMachineDoesNotExist) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s StateMachineDoesNotExist) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s StateMachineDoesNotExist) RequestID() string { + return s.respMetadata.RequestID +} + +// The maximum number of state machines has been reached. Existing state machines +// must be deleted before a new state machine can be created. +type StateMachineLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s StateMachineLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StateMachineLimitExceeded) GoString() string { + return s.String() +} + +func newErrorStateMachineLimitExceeded(v protocol.ResponseMetadata) error { + return &StateMachineLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s StateMachineLimitExceeded) Code() string { + return "StateMachineLimitExceeded" +} + +// Message returns the exception's message. +func (s StateMachineLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s StateMachineLimitExceeded) OrigErr() error { + return nil +} + +func (s StateMachineLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s StateMachineLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s StateMachineLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + // Contains details about the state machine. type StateMachineListItem struct { _ struct{} `type:"structure"` @@ -5246,6 +6574,9 @@ type StateMachineListItem struct { // // * control characters (U+0000-001F, U+007F-009F) // + // To enable logging with CloudWatch Logs, the name should only contain 0-9, + // A-Z, a-z, - and _. + // // Name is a required field Name *string `locationName:"name" min:"1" type:"string" required:"true"` @@ -5253,6 +6584,9 @@ type StateMachineListItem struct { // // StateMachineArn is a required field StateMachineArn *string `locationName:"stateMachineArn" min:"1" type:"string" required:"true"` + + // Type is a required field + Type *string `locationName:"type" type:"string" required:"true" enum:"StateMachineType"` } // String returns the string representation @@ -5283,6 +6617,67 @@ func (s *StateMachineListItem) SetStateMachineArn(v string) *StateMachineListIte return s } +// SetType sets the Type field's value. +func (s *StateMachineListItem) SetType(v string) *StateMachineListItem { + s.Type = &v + return s +} + +type StateMachineTypeNotSupported struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s StateMachineTypeNotSupported) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StateMachineTypeNotSupported) GoString() string { + return s.String() +} + +func newErrorStateMachineTypeNotSupported(v protocol.ResponseMetadata) error { + return &StateMachineTypeNotSupported{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s StateMachineTypeNotSupported) Code() string { + return "StateMachineTypeNotSupported" +} + +// Message returns the exception's message. +func (s StateMachineTypeNotSupported) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s StateMachineTypeNotSupported) OrigErr() error { + return nil +} + +func (s StateMachineTypeNotSupported) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s StateMachineTypeNotSupported) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s StateMachineTypeNotSupported) RequestID() string { + return s.respMetadata.RequestID +} + type StopExecutionInput struct { _ struct{} `type:"structure"` @@ -5504,6 +6899,61 @@ func (s TagResourceOutput) GoString() string { return s.String() } +type TaskDoesNotExist struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TaskDoesNotExist) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TaskDoesNotExist) GoString() string { + return s.String() +} + +func newErrorTaskDoesNotExist(v protocol.ResponseMetadata) error { + return &TaskDoesNotExist{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TaskDoesNotExist) Code() string { + return "TaskDoesNotExist" +} + +// Message returns the exception's message. +func (s TaskDoesNotExist) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TaskDoesNotExist) OrigErr() error { + return nil +} + +func (s TaskDoesNotExist) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TaskDoesNotExist) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TaskDoesNotExist) RequestID() string { + return s.respMetadata.RequestID +} + // Contains details about a task failure event. type TaskFailedEventDetails struct { _ struct{} `type:"structure"` @@ -5867,6 +7317,61 @@ func (s *TaskSucceededEventDetails) SetResourceType(v string) *TaskSucceededEven return s } +type TaskTimedOut struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TaskTimedOut) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TaskTimedOut) GoString() string { + return s.String() +} + +func newErrorTaskTimedOut(v protocol.ResponseMetadata) error { + return &TaskTimedOut{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TaskTimedOut) Code() string { + return "TaskTimedOut" +} + +// Message returns the exception's message. +func (s TaskTimedOut) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TaskTimedOut) OrigErr() error { + return nil +} + +func (s TaskTimedOut) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TaskTimedOut) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TaskTimedOut) RequestID() string { + return s.respMetadata.RequestID +} + // Contains details about a resource timeout that occurred during an execution. type TaskTimedOutEventDetails struct { _ struct{} `type:"structure"` @@ -5922,6 +7427,66 @@ func (s *TaskTimedOutEventDetails) SetResourceType(v string) *TaskTimedOutEventD return s } +// You've exceeded the number of tags allowed for a resource. See the Limits +// Topic (https://docs.aws.amazon.com/step-functions/latest/dg/limits.html) +// in the AWS Step Functions Developer Guide. +type TooManyTags struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + ResourceName *string `locationName:"resourceName" min:"1" type:"string"` +} + +// String returns the string representation +func (s TooManyTags) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyTags) GoString() string { + return s.String() +} + +func newErrorTooManyTags(v protocol.ResponseMetadata) error { + return &TooManyTags{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyTags) Code() string { + return "TooManyTags" +} + +// Message returns the exception's message. +func (s TooManyTags) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTags) OrigErr() error { + return nil +} + +func (s TooManyTags) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTags) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyTags) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -5998,6 +7563,9 @@ type UpdateStateMachineInput struct { // Language (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html). Definition *string `locationName:"definition" min:"1" type:"string" sensitive:"true"` + // The LoggingConfiguration data type is used to set CloudWatch Logs options. + LoggingConfiguration *LoggingConfiguration `locationName:"loggingConfiguration" type:"structure"` + // The Amazon Resource Name (ARN) of the IAM role of the state machine. RoleArn *string `locationName:"roleArn" min:"1" type:"string"` @@ -6032,6 +7600,11 @@ func (s *UpdateStateMachineInput) Validate() error { if s.StateMachineArn != nil && len(*s.StateMachineArn) < 1 { invalidParams.Add(request.NewErrParamMinLen("StateMachineArn", 1)) } + if s.LoggingConfiguration != nil { + if err := s.LoggingConfiguration.Validate(); err != nil { + invalidParams.AddNested("LoggingConfiguration", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -6045,6 +7618,12 @@ func (s *UpdateStateMachineInput) SetDefinition(v string) *UpdateStateMachineInp return s } +// SetLoggingConfiguration sets the LoggingConfiguration field's value. +func (s *UpdateStateMachineInput) SetLoggingConfiguration(v *LoggingConfiguration) *UpdateStateMachineInput { + s.LoggingConfiguration = v + return s +} + // SetRoleArn sets the RoleArn field's value. func (s *UpdateStateMachineInput) SetRoleArn(v string) *UpdateStateMachineInput { s.RoleArn = &v @@ -6266,6 +7845,20 @@ const ( HistoryEventTypeWaitStateExited = "WaitStateExited" ) +const ( + // LogLevelAll is a LogLevel enum value + LogLevelAll = "ALL" + + // LogLevelError is a LogLevel enum value + LogLevelError = "ERROR" + + // LogLevelFatal is a LogLevel enum value + LogLevelFatal = "FATAL" + + // LogLevelOff is a LogLevel enum value + LogLevelOff = "OFF" +) + const ( // StateMachineStatusActive is a StateMachineStatus enum value StateMachineStatusActive = "ACTIVE" @@ -6273,3 +7866,11 @@ const ( // StateMachineStatusDeleting is a StateMachineStatus enum value StateMachineStatusDeleting = "DELETING" ) + +const ( + // StateMachineTypeStandard is a StateMachineType enum value + StateMachineTypeStandard = "STANDARD" + + // StateMachineTypeExpress is a StateMachineType enum value + StateMachineTypeExpress = "EXPRESS" +) 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 index b05b4021a24..1bebc5bb2f2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sfn/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sfn/errors.go @@ -2,6 +2,10 @@ package sfn +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeActivityDoesNotExist for service response error code @@ -63,6 +67,10 @@ const ( // The provided JSON input data is invalid. ErrCodeInvalidExecutionInput = "InvalidExecutionInput" + // ErrCodeInvalidLoggingConfiguration for service response error code + // "InvalidLoggingConfiguration". + ErrCodeInvalidLoggingConfiguration = "InvalidLoggingConfiguration" + // ErrCodeInvalidName for service response error code // "InvalidName". // @@ -121,6 +129,10 @@ const ( // must be deleted before a new state machine can be created. ErrCodeStateMachineLimitExceeded = "StateMachineLimitExceeded" + // ErrCodeStateMachineTypeNotSupported for service response error code + // "StateMachineTypeNotSupported". + ErrCodeStateMachineTypeNotSupported = "StateMachineTypeNotSupported" + // ErrCodeTaskDoesNotExist for service response error code // "TaskDoesNotExist". ErrCodeTaskDoesNotExist = "TaskDoesNotExist" @@ -137,3 +149,29 @@ const ( // in the AWS Step Functions Developer Guide. ErrCodeTooManyTags = "TooManyTags" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ActivityDoesNotExist": newErrorActivityDoesNotExist, + "ActivityLimitExceeded": newErrorActivityLimitExceeded, + "ActivityWorkerLimitExceeded": newErrorActivityWorkerLimitExceeded, + "ExecutionAlreadyExists": newErrorExecutionAlreadyExists, + "ExecutionDoesNotExist": newErrorExecutionDoesNotExist, + "ExecutionLimitExceeded": newErrorExecutionLimitExceeded, + "InvalidArn": newErrorInvalidArn, + "InvalidDefinition": newErrorInvalidDefinition, + "InvalidExecutionInput": newErrorInvalidExecutionInput, + "InvalidLoggingConfiguration": newErrorInvalidLoggingConfiguration, + "InvalidName": newErrorInvalidName, + "InvalidOutput": newErrorInvalidOutput, + "InvalidToken": newErrorInvalidToken, + "MissingRequiredParameter": newErrorMissingRequiredParameter, + "ResourceNotFound": newErrorResourceNotFound, + "StateMachineAlreadyExists": newErrorStateMachineAlreadyExists, + "StateMachineDeleting": newErrorStateMachineDeleting, + "StateMachineDoesNotExist": newErrorStateMachineDoesNotExist, + "StateMachineLimitExceeded": newErrorStateMachineLimitExceeded, + "StateMachineTypeNotSupported": newErrorStateMachineTypeNotSupported, + "TaskDoesNotExist": newErrorTaskDoesNotExist, + "TaskTimedOut": newErrorTaskTimedOut, + "TooManyTags": newErrorTooManyTags, +} 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 index 2436268f075..dbd7207e776 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sfn/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sfn/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "states" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "SFN" // ServiceID is a unique identifer of a specific service. + ServiceID = "SFN" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the SFN client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a SFN client from just a session. // svc := sfn.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *SFN { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *SFN { svc := &SFN{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-11-23", JSONVersion: "1.0", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/shield/api.go b/vendor/github.com/aws/aws-sdk-go/service/shield/api.go index aa23ff9860e..3155bfa30ac 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/shield/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/shield/api.go @@ -73,39 +73,39 @@ func (c *Shield) AssociateDRTLogBucketRequest(input *AssociateDRTLogBucketInput) // See the AWS API reference guide for AWS Shield's // API operation AssociateDRTLogBucket for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // Exception that indicates that the operation would not cause any change to // occur. // -// * ErrCodeNoAssociatedRoleException "NoAssociatedRoleException" +// * NoAssociatedRoleException // The ARN of the role that you specifed does not exist. // -// * ErrCodeLimitsExceededException "LimitsExceededException" +// * LimitsExceededException // Exception that indicates that the operation would exceed a limit. // // Type is the type of limit that would be exceeded. // // Limit is the threshold that would be exceeded. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // Exception that indicates that the parameters passed to the API are invalid. // -// * ErrCodeAccessDeniedForDependencyException "AccessDeniedForDependencyException" +// * AccessDeniedForDependencyException // In order to grant the necessary access to the DDoS Response Team, the user -// submitting AssociateDRTRole must have the iam:PassRole permission. This error +// submitting the request must have the iam:PassRole permission. This error // indicates the user did not have the appropriate permissions. For more information, // see Granting a User Permissions to Pass a Role to an AWS Service (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html). // -// * ErrCodeOptimisticLockException "OptimisticLockException" +// * OptimisticLockException // Exception that indicates that the protection state has been modified by another // client. You can retry the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception indicating the specified resource does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/AssociateDRTLogBucket @@ -211,29 +211,29 @@ func (c *Shield) AssociateDRTRoleRequest(input *AssociateDRTRoleInput) (req *req // See the AWS API reference guide for AWS Shield's // API operation AssociateDRTRole for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // Exception that indicates that the operation would not cause any change to // occur. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // Exception that indicates that the parameters passed to the API are invalid. // -// * ErrCodeAccessDeniedForDependencyException "AccessDeniedForDependencyException" +// * AccessDeniedForDependencyException // In order to grant the necessary access to the DDoS Response Team, the user -// submitting AssociateDRTRole must have the iam:PassRole permission. This error +// submitting the request must have the iam:PassRole permission. This error // indicates the user did not have the appropriate permissions. For more information, // see Granting a User Permissions to Pass a Role to an AWS Service (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html). // -// * ErrCodeOptimisticLockException "OptimisticLockException" +// * OptimisticLockException // Exception that indicates that the protection state has been modified by another // client. You can retry the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception indicating the specified resource does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/AssociateDRTRole @@ -258,6 +258,111 @@ func (c *Shield) AssociateDRTRoleWithContext(ctx aws.Context, input *AssociateDR return out, req.Send() } +const opAssociateHealthCheck = "AssociateHealthCheck" + +// AssociateHealthCheckRequest generates a "aws/request.Request" representing the +// client's request for the AssociateHealthCheck operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AssociateHealthCheck for more information on using the AssociateHealthCheck +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AssociateHealthCheckRequest method. +// req, resp := client.AssociateHealthCheckRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/AssociateHealthCheck +func (c *Shield) AssociateHealthCheckRequest(input *AssociateHealthCheckInput) (req *request.Request, output *AssociateHealthCheckOutput) { + op := &request.Operation{ + Name: opAssociateHealthCheck, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AssociateHealthCheckInput{} + } + + output = &AssociateHealthCheckOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// AssociateHealthCheck API operation for AWS Shield. +// +// Adds health-based detection to the Shield Advanced protection for a resource. +// Shield Advanced health-based detection uses the health of your AWS resource +// to improve responsiveness and accuracy in attack detection and mitigation. +// +// You define the health check in Route 53 and then associate it with your Shield +// Advanced protection. For more information, see Shield Advanced Health-Based +// Detection (https://docs.aws.amazon.com/waf/latest/developerguide/ddos-overview.html#ddos-advanced-health-check-option) +// in the AWS WAF and AWS Shield Developer Guide (https://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 Shield's +// API operation AssociateHealthCheck for usage and error information. +// +// Returned Error Types: +// * InternalErrorException +// Exception that indicates that a problem occurred with the service infrastructure. +// You can retry the request. +// +// * LimitsExceededException +// Exception that indicates that the operation would exceed a limit. +// +// Type is the type of limit that would be exceeded. +// +// Limit is the threshold that would be exceeded. +// +// * ResourceNotFoundException +// Exception indicating the specified resource does not exist. +// +// * InvalidParameterException +// Exception that indicates that the parameters passed to the API are invalid. +// +// * OptimisticLockException +// Exception that indicates that the protection state has been modified by another +// client. You can retry the request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/AssociateHealthCheck +func (c *Shield) AssociateHealthCheck(input *AssociateHealthCheckInput) (*AssociateHealthCheckOutput, error) { + req, out := c.AssociateHealthCheckRequest(input) + return out, req.Send() +} + +// AssociateHealthCheckWithContext is the same as AssociateHealthCheck with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateHealthCheck for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Shield) AssociateHealthCheckWithContext(ctx aws.Context, input *AssociateHealthCheckInput, opts ...request.Option) (*AssociateHealthCheckOutput, error) { + req, out := c.AssociateHealthCheckRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opCreateProtection = "CreateProtection" // CreateProtectionRequest generates a "aws/request.Request" representing the @@ -320,34 +425,34 @@ func (c *Shield) CreateProtectionRequest(input *CreateProtectionInput) (req *req // See the AWS API reference guide for AWS Shield's // API operation CreateProtection for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeInvalidResourceException "InvalidResourceException" +// * InvalidResourceException // Exception that indicates that the resource is invalid. You might not have // access to the resource, or the resource might not exist. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // Exception that indicates that the operation would not cause any change to // occur. // -// * ErrCodeLimitsExceededException "LimitsExceededException" +// * LimitsExceededException // Exception that indicates that the operation would exceed a limit. // // Type is the type of limit that would be exceeded. // // Limit is the threshold that would be exceeded. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // Exception indicating the specified resource already exists. // -// * ErrCodeOptimisticLockException "OptimisticLockException" +// * OptimisticLockException // Exception that indicates that the protection state has been modified by another // client. You can retry the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception indicating the specified resource does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/CreateProtection @@ -439,12 +544,12 @@ func (c *Shield) CreateSubscriptionRequest(input *CreateSubscriptionInput) (req // See the AWS API reference guide for AWS Shield's // API operation CreateSubscription for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // Exception indicating the specified resource already exists. // // See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/CreateSubscription @@ -523,15 +628,15 @@ func (c *Shield) DeleteProtectionRequest(input *DeleteProtectionInput) (req *req // See the AWS API reference guide for AWS Shield's // API operation DeleteProtection for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception indicating the specified resource does not exist. // -// * ErrCodeOptimisticLockException "OptimisticLockException" +// * OptimisticLockException // Exception that indicates that the protection state has been modified by another // client. You can retry the request. // @@ -618,18 +723,18 @@ func (c *Shield) DeleteSubscriptionRequest(input *DeleteSubscriptionInput) (req // See the AWS API reference guide for AWS Shield's // API operation DeleteSubscription for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeLockedSubscriptionException "LockedSubscriptionException" +// * LockedSubscriptionException // You are trying to update a subscription that has not yet completed the 1-year // commitment. You can change the AutoRenew parameter during the last 30 days // of your subscription. This exception indicates that you are attempting to // change AutoRenew prior to that period. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception indicating the specified resource does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/DeleteSubscription @@ -711,12 +816,12 @@ func (c *Shield) DescribeAttackRequest(input *DescribeAttackInput) (req *request // See the AWS API reference guide for AWS Shield's // API operation DescribeAttack for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // Exception that indicates the specified AttackId does not exist, or the requester // does not have the appropriate permissions to access the AttackId. // @@ -797,12 +902,12 @@ func (c *Shield) DescribeDRTAccessRequest(input *DescribeDRTAccessInput) (req *r // See the AWS API reference guide for AWS Shield's // API operation DescribeDRTAccess for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception indicating the specified resource does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/DescribeDRTAccess @@ -881,12 +986,12 @@ func (c *Shield) DescribeEmergencyContactSettingsRequest(input *DescribeEmergenc // See the AWS API reference guide for AWS Shield's // API operation DescribeEmergencyContactSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception indicating the specified resource does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/DescribeEmergencyContactSettings @@ -964,15 +1069,15 @@ func (c *Shield) DescribeProtectionRequest(input *DescribeProtectionInput) (req // See the AWS API reference guide for AWS Shield's // API operation DescribeProtection for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // Exception that indicates that the parameters passed to the API are invalid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception indicating the specified resource does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/DescribeProtection @@ -1050,12 +1155,12 @@ func (c *Shield) DescribeSubscriptionRequest(input *DescribeSubscriptionInput) ( // See the AWS API reference guide for AWS Shield's // API operation DescribeSubscription for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception indicating the specified resource does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/DescribeSubscription @@ -1142,29 +1247,29 @@ func (c *Shield) DisassociateDRTLogBucketRequest(input *DisassociateDRTLogBucket // See the AWS API reference guide for AWS Shield's // API operation DisassociateDRTLogBucket for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // Exception that indicates that the operation would not cause any change to // occur. // -// * ErrCodeNoAssociatedRoleException "NoAssociatedRoleException" +// * NoAssociatedRoleException // The ARN of the role that you specifed does not exist. // -// * ErrCodeAccessDeniedForDependencyException "AccessDeniedForDependencyException" +// * AccessDeniedForDependencyException // In order to grant the necessary access to the DDoS Response Team, the user -// submitting AssociateDRTRole must have the iam:PassRole permission. This error +// submitting the request must have the iam:PassRole permission. This error // indicates the user did not have the appropriate permissions. For more information, // see Granting a User Permissions to Pass a Role to an AWS Service (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html). // -// * ErrCodeOptimisticLockException "OptimisticLockException" +// * OptimisticLockException // Exception that indicates that the protection state has been modified by another // client. You can retry the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception indicating the specified resource does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/DisassociateDRTLogBucket @@ -1250,20 +1355,20 @@ func (c *Shield) DisassociateDRTRoleRequest(input *DisassociateDRTRoleInput) (re // See the AWS API reference guide for AWS Shield's // API operation DisassociateDRTRole for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // Exception that indicates that the operation would not cause any change to // occur. // -// * ErrCodeOptimisticLockException "OptimisticLockException" +// * OptimisticLockException // Exception that indicates that the protection state has been modified by another // client. You can retry the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception indicating the specified resource does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/DisassociateDRTRole @@ -1288,6 +1393,105 @@ func (c *Shield) DisassociateDRTRoleWithContext(ctx aws.Context, input *Disassoc return out, req.Send() } +const opDisassociateHealthCheck = "DisassociateHealthCheck" + +// DisassociateHealthCheckRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateHealthCheck operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DisassociateHealthCheck for more information on using the DisassociateHealthCheck +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DisassociateHealthCheckRequest method. +// req, resp := client.DisassociateHealthCheckRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/DisassociateHealthCheck +func (c *Shield) DisassociateHealthCheckRequest(input *DisassociateHealthCheckInput) (req *request.Request, output *DisassociateHealthCheckOutput) { + op := &request.Operation{ + Name: opDisassociateHealthCheck, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DisassociateHealthCheckInput{} + } + + output = &DisassociateHealthCheckOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DisassociateHealthCheck API operation for AWS Shield. +// +// Removes health-based detection from the Shield Advanced protection for a +// resource. Shield Advanced health-based detection uses the health of your +// AWS resource to improve responsiveness and accuracy in attack detection and +// mitigation. +// +// You define the health check in Route 53 and then associate or disassociate +// it with your Shield Advanced protection. For more information, see Shield +// Advanced Health-Based Detection (https://docs.aws.amazon.com/waf/latest/developerguide/ddos-overview.html#ddos-advanced-health-check-option) +// in the AWS WAF and AWS Shield Developer Guide (https://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 Shield's +// API operation DisassociateHealthCheck for usage and error information. +// +// Returned Error Types: +// * InternalErrorException +// Exception that indicates that a problem occurred with the service infrastructure. +// You can retry the request. +// +// * InvalidParameterException +// Exception that indicates that the parameters passed to the API are invalid. +// +// * ResourceNotFoundException +// Exception indicating the specified resource does not exist. +// +// * OptimisticLockException +// Exception that indicates that the protection state has been modified by another +// client. You can retry the request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/DisassociateHealthCheck +func (c *Shield) DisassociateHealthCheck(input *DisassociateHealthCheckInput) (*DisassociateHealthCheckOutput, error) { + req, out := c.DisassociateHealthCheckRequest(input) + return out, req.Send() +} + +// DisassociateHealthCheckWithContext is the same as DisassociateHealthCheck with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateHealthCheck for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *Shield) DisassociateHealthCheckWithContext(ctx aws.Context, input *DisassociateHealthCheckInput, opts ...request.Option) (*DisassociateHealthCheckOutput, error) { + req, out := c.DisassociateHealthCheckRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetSubscriptionState = "GetSubscriptionState" // GetSubscriptionStateRequest generates a "aws/request.Request" representing the @@ -1341,8 +1545,8 @@ func (c *Shield) GetSubscriptionStateRequest(input *GetSubscriptionStateInput) ( // See the AWS API reference guide for AWS Shield's // API operation GetSubscriptionState for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // @@ -1422,15 +1626,15 @@ func (c *Shield) ListAttacksRequest(input *ListAttacksInput) (req *request.Reque // See the AWS API reference guide for AWS Shield's // API operation ListAttacks for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // Exception that indicates that the parameters passed to the API are invalid. // -// * ErrCodeInvalidOperationException "InvalidOperationException" +// * InvalidOperationException // Exception that indicates that the operation would not cause any change to // occur. // @@ -1509,15 +1713,15 @@ func (c *Shield) ListProtectionsRequest(input *ListProtectionsInput) (req *reque // See the AWS API reference guide for AWS Shield's // API operation ListProtections for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception indicating the specified resource does not exist. // -// * ErrCodeInvalidPaginationTokenException "InvalidPaginationTokenException" +// * InvalidPaginationTokenException // Exception that indicates that the NextToken specified in the request is invalid. // Submit the request using the NextToken value that was returned in the response. // @@ -1598,19 +1802,19 @@ func (c *Shield) UpdateEmergencyContactSettingsRequest(input *UpdateEmergencyCon // See the AWS API reference guide for AWS Shield's // API operation UpdateEmergencyContactSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // Exception that indicates that the parameters passed to the API are invalid. // -// * ErrCodeOptimisticLockException "OptimisticLockException" +// * OptimisticLockException // Exception that indicates that the protection state has been modified by another // client. You can retry the request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception indicating the specified resource does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/shield-2016-06-02/UpdateEmergencyContactSettings @@ -1690,24 +1894,24 @@ func (c *Shield) UpdateSubscriptionRequest(input *UpdateSubscriptionInput) (req // See the AWS API reference guide for AWS Shield's // API operation UpdateSubscription for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "InternalErrorException" +// Returned Error Types: +// * InternalErrorException // Exception that indicates that a problem occurred with the service infrastructure. // You can retry the request. // -// * ErrCodeLockedSubscriptionException "LockedSubscriptionException" +// * LockedSubscriptionException // You are trying to update a subscription that has not yet completed the 1-year // commitment. You can change the AutoRenew parameter during the last 30 days // of your subscription. This exception indicates that you are attempting to // change AutoRenew prior to that period. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // Exception indicating the specified resource does not exist. // -// * ErrCodeInvalidParameterException "InvalidParameterException" +// * InvalidParameterException // Exception that indicates that the parameters passed to the API are invalid. // -// * ErrCodeOptimisticLockException "OptimisticLockException" +// * OptimisticLockException // Exception that indicates that the protection state has been modified by another // client. You can retry the request. // @@ -1733,6 +1937,122 @@ func (c *Shield) UpdateSubscriptionWithContext(ctx aws.Context, input *UpdateSub return out, req.Send() } +// Exception that indicates the specified AttackId does not exist, or the requester +// does not have the appropriate permissions to access the AttackId. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +// In order to grant the necessary access to the DDoS Response Team, the user +// submitting the request must have the iam:PassRole permission. This error +// indicates the user did not have the appropriate permissions. For more information, +// see Granting a User Permissions to Pass a Role to an AWS Service (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html). +type AccessDeniedForDependencyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedForDependencyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedForDependencyException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedForDependencyException(v protocol.ResponseMetadata) error { + return &AccessDeniedForDependencyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedForDependencyException) Code() string { + return "AccessDeniedForDependencyException" +} + +// Message returns the exception's message. +func (s AccessDeniedForDependencyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedForDependencyException) OrigErr() error { + return nil +} + +func (s AccessDeniedForDependencyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedForDependencyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedForDependencyException) RequestID() string { + return s.respMetadata.RequestID +} + type AssociateDRTLogBucketInput struct { _ struct{} `type:"structure"` @@ -1849,6 +2169,80 @@ func (s AssociateDRTRoleOutput) GoString() string { return s.String() } +type AssociateHealthCheckInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the health check to associate with the + // protection. + // + // HealthCheckArn is a required field + HealthCheckArn *string `min:"1" type:"string" required:"true"` + + // The unique identifier (ID) for the Protection object to add the health check + // association to. + // + // ProtectionId is a required field + ProtectionId *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s AssociateHealthCheckInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateHealthCheckInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssociateHealthCheckInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssociateHealthCheckInput"} + if s.HealthCheckArn == nil { + invalidParams.Add(request.NewErrParamRequired("HealthCheckArn")) + } + if s.HealthCheckArn != nil && len(*s.HealthCheckArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("HealthCheckArn", 1)) + } + if s.ProtectionId == nil { + invalidParams.Add(request.NewErrParamRequired("ProtectionId")) + } + if s.ProtectionId != nil && len(*s.ProtectionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ProtectionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHealthCheckArn sets the HealthCheckArn field's value. +func (s *AssociateHealthCheckInput) SetHealthCheckArn(v string) *AssociateHealthCheckInput { + s.HealthCheckArn = &v + return s +} + +// SetProtectionId sets the ProtectionId field's value. +func (s *AssociateHealthCheckInput) SetProtectionId(v string) *AssociateHealthCheckInput { + s.ProtectionId = &v + return s +} + +type AssociateHealthCheckOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AssociateHealthCheckOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateHealthCheckOutput) GoString() string { + return s.String() +} + // The details of a DDoS attack. type AttackDetail struct { _ struct{} `type:"structure"` @@ -2717,19 +3111,93 @@ func (s DisassociateDRTRoleOutput) GoString() string { return s.String() } -// Contact information that the DRT can use to contact you during a suspected -// attack. -type EmergencyContact struct { +type DisassociateHealthCheckInput struct { _ struct{} `type:"structure"` - // An email address that the DRT can use to contact you during a suspected attack. + // The Amazon Resource Name (ARN) of the health check that is associated with + // the protection. // - // EmailAddress is a required field - EmailAddress *string `min:"1" type:"string" required:"true"` -} + // HealthCheckArn is a required field + HealthCheckArn *string `min:"1" type:"string" required:"true"` -// String returns the string representation -func (s EmergencyContact) String() string { + // The unique identifier (ID) for the Protection object to remove the health + // check association from. + // + // ProtectionId is a required field + ProtectionId *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DisassociateHealthCheckInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateHealthCheckInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisassociateHealthCheckInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisassociateHealthCheckInput"} + if s.HealthCheckArn == nil { + invalidParams.Add(request.NewErrParamRequired("HealthCheckArn")) + } + if s.HealthCheckArn != nil && len(*s.HealthCheckArn) < 1 { + invalidParams.Add(request.NewErrParamMinLen("HealthCheckArn", 1)) + } + if s.ProtectionId == nil { + invalidParams.Add(request.NewErrParamRequired("ProtectionId")) + } + if s.ProtectionId != nil && len(*s.ProtectionId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ProtectionId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetHealthCheckArn sets the HealthCheckArn field's value. +func (s *DisassociateHealthCheckInput) SetHealthCheckArn(v string) *DisassociateHealthCheckInput { + s.HealthCheckArn = &v + return s +} + +// SetProtectionId sets the ProtectionId field's value. +func (s *DisassociateHealthCheckInput) SetProtectionId(v string) *DisassociateHealthCheckInput { + s.ProtectionId = &v + return s +} + +type DisassociateHealthCheckOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DisassociateHealthCheckOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateHealthCheckOutput) GoString() string { + return s.String() +} + +// Contact information that the DRT can use to contact you during a suspected +// attack. +type EmergencyContact struct { + _ struct{} `type:"structure"` + + // An email address that the DRT can use to contact you during a suspected attack. + // + // EmailAddress is a required field + EmailAddress *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s EmergencyContact) String() string { return awsutil.Prettify(s) } @@ -2799,6 +3267,290 @@ func (s *GetSubscriptionStateOutput) SetSubscriptionState(v string) *GetSubscrip return s } +// Exception that indicates that a problem occurred with the service infrastructure. +// You can retry the request. +type InternalErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalErrorException) GoString() string { + return s.String() +} + +func newErrorInternalErrorException(v protocol.ResponseMetadata) error { + return &InternalErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalErrorException) Code() string { + return "InternalErrorException" +} + +// Message returns the exception's message. +func (s InternalErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalErrorException) OrigErr() error { + return nil +} + +func (s InternalErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// Exception that indicates that the operation would not cause any change to +// occur. +type InvalidOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidOperationException) GoString() string { + return s.String() +} + +func newErrorInvalidOperationException(v protocol.ResponseMetadata) error { + return &InvalidOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidOperationException) Code() string { + return "InvalidOperationException" +} + +// Message returns the exception's message. +func (s InvalidOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidOperationException) OrigErr() error { + return nil +} + +func (s InvalidOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidOperationException) RequestID() string { + return s.respMetadata.RequestID +} + +// Exception that indicates that the NextToken specified in the request is invalid. +// Submit the request using the NextToken value that was returned in the response. +type InvalidPaginationTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidPaginationTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPaginationTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidPaginationTokenException(v protocol.ResponseMetadata) error { + return &InvalidPaginationTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPaginationTokenException) Code() string { + return "InvalidPaginationTokenException" +} + +// Message returns the exception's message. +func (s InvalidPaginationTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPaginationTokenException) OrigErr() error { + return nil +} + +func (s InvalidPaginationTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPaginationTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPaginationTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// Exception that indicates that the parameters passed to the API are invalid. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} + +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// Exception that indicates that the resource is invalid. You might not have +// access to the resource, or the resource might not exist. +type InvalidResourceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidResourceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidResourceException) GoString() string { + return s.String() +} + +func newErrorInvalidResourceException(v protocol.ResponseMetadata) error { + return &InvalidResourceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidResourceException) Code() string { + return "InvalidResourceException" +} + +// Message returns the exception's message. +func (s InvalidResourceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidResourceException) OrigErr() error { + return nil +} + +func (s InvalidResourceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidResourceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidResourceException) RequestID() string { + return s.respMetadata.RequestID +} + // Specifies how many protections of a given type you can create. type Limit struct { _ struct{} `type:"structure"` @@ -2832,6 +3584,70 @@ func (s *Limit) SetType(v string) *Limit { return s } +// Exception that indicates that the operation would exceed a limit. +// +// Type is the type of limit that would be exceeded. +// +// Limit is the threshold that would be exceeded. +type LimitsExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Limit *int64 `type:"long"` + + Message_ *string `locationName:"message" type:"string"` + + Type *string `type:"string"` +} + +// String returns the string representation +func (s LimitsExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitsExceededException) GoString() string { + return s.String() +} + +func newErrorLimitsExceededException(v protocol.ResponseMetadata) error { + return &LimitsExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitsExceededException) Code() string { + return "LimitsExceededException" +} + +// Message returns the exception's message. +func (s LimitsExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitsExceededException) OrigErr() error { + return nil +} + +func (s LimitsExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitsExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitsExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type ListAttacksInput struct { _ struct{} `type:"structure"` @@ -3051,6 +3867,65 @@ func (s *ListProtectionsOutput) SetProtections(v []*Protection) *ListProtections return s } +// You are trying to update a subscription that has not yet completed the 1-year +// commitment. You can change the AutoRenew parameter during the last 30 days +// of your subscription. This exception indicates that you are attempting to +// change AutoRenew prior to that period. +type LockedSubscriptionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LockedSubscriptionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LockedSubscriptionException) GoString() string { + return s.String() +} + +func newErrorLockedSubscriptionException(v protocol.ResponseMetadata) error { + return &LockedSubscriptionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LockedSubscriptionException) Code() string { + return "LockedSubscriptionException" +} + +// Message returns the exception's message. +func (s LockedSubscriptionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LockedSubscriptionException) OrigErr() error { + return nil +} + +func (s LockedSubscriptionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LockedSubscriptionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LockedSubscriptionException) RequestID() string { + return s.respMetadata.RequestID +} + // The mitigation applied to a DDoS attack. type Mitigation struct { _ struct{} `type:"structure"` @@ -3075,10 +3950,127 @@ func (s *Mitigation) SetMitigationName(v string) *Mitigation { return s } +// The ARN of the role that you specifed does not exist. +type NoAssociatedRoleException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NoAssociatedRoleException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NoAssociatedRoleException) GoString() string { + return s.String() +} + +func newErrorNoAssociatedRoleException(v protocol.ResponseMetadata) error { + return &NoAssociatedRoleException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NoAssociatedRoleException) Code() string { + return "NoAssociatedRoleException" +} + +// Message returns the exception's message. +func (s NoAssociatedRoleException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NoAssociatedRoleException) OrigErr() error { + return nil +} + +func (s NoAssociatedRoleException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NoAssociatedRoleException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NoAssociatedRoleException) RequestID() string { + return s.respMetadata.RequestID +} + +// Exception that indicates that the protection state has been modified by another +// client. You can retry the request. +type OptimisticLockException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s OptimisticLockException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OptimisticLockException) GoString() string { + return s.String() +} + +func newErrorOptimisticLockException(v protocol.ResponseMetadata) error { + return &OptimisticLockException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OptimisticLockException) Code() string { + return "OptimisticLockException" +} + +// Message returns the exception's message. +func (s OptimisticLockException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OptimisticLockException) OrigErr() error { + return nil +} + +func (s OptimisticLockException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OptimisticLockException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OptimisticLockException) RequestID() string { + return s.respMetadata.RequestID +} + // An object that represents a resource that is under DDoS protection. type Protection struct { _ struct{} `type:"structure"` + // The unique identifier (ID) for the Route 53 health check that's associated + // with the protection. + HealthCheckIds []*string `type:"list"` + // The unique identifier (ID) of the protection. Id *string `min:"1" type:"string"` @@ -3099,6 +4091,12 @@ func (s Protection) GoString() string { return s.String() } +// SetHealthCheckIds sets the HealthCheckIds field's value. +func (s *Protection) SetHealthCheckIds(v []*string) *Protection { + s.HealthCheckIds = v + return s +} + // SetId sets the Id field's value. func (s *Protection) SetId(v string) *Protection { s.Id = &v @@ -3117,6 +4115,118 @@ func (s *Protection) SetResourceArn(v string) *Protection { return s } +// Exception indicating the specified resource already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// Exception indicating the specified resource does not exist. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // The attack information for the specified SubResource. type SubResourceSummary struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/shield/errors.go b/vendor/github.com/aws/aws-sdk-go/service/shield/errors.go index cb5b021a0c7..a0af389f673 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/shield/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/shield/errors.go @@ -2,6 +2,10 @@ package shield +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccessDeniedException for service response error code @@ -15,7 +19,7 @@ const ( // "AccessDeniedForDependencyException". // // In order to grant the necessary access to the DDoS Response Team, the user - // submitting AssociateDRTRole must have the iam:PassRole permission. This error + // submitting the request must have the iam:PassRole permission. This error // indicates the user did not have the appropriate permissions. For more information, // see Granting a User Permissions to Pass a Role to an AWS Service (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html). ErrCodeAccessDeniedForDependencyException = "AccessDeniedForDependencyException" @@ -98,3 +102,19 @@ const ( // Exception indicating the specified resource does not exist. ErrCodeResourceNotFoundException = "ResourceNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "AccessDeniedForDependencyException": newErrorAccessDeniedForDependencyException, + "InternalErrorException": newErrorInternalErrorException, + "InvalidOperationException": newErrorInvalidOperationException, + "InvalidPaginationTokenException": newErrorInvalidPaginationTokenException, + "InvalidParameterException": newErrorInvalidParameterException, + "InvalidResourceException": newErrorInvalidResourceException, + "LimitsExceededException": newErrorLimitsExceededException, + "LockedSubscriptionException": newErrorLockedSubscriptionException, + "NoAssociatedRoleException": newErrorNoAssociatedRoleException, + "OptimisticLockException": newErrorOptimisticLockException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceNotFoundException": newErrorResourceNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/shield/service.go b/vendor/github.com/aws/aws-sdk-go/service/shield/service.go index b7a62ef92f6..a831fb21d27 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/shield/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/shield/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "shield" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Shield" // ServiceID is a unique identifer of a specific service. + ServiceID = "Shield" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Shield client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Shield client from just a session. // svc := shield.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := shield.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *Shield { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Shield { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Shield { svc := &Shield{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-06-02", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index efa04ba80d6..a00895099ba 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/simpledb/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/simpledb/api.go @@ -838,10 +838,12 @@ func (c *SimpleDB) ListDomainsPagesWithContext(ctx aws.Context, input *ListDomai }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDomainsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDomainsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1134,10 +1136,12 @@ func (c *SimpleDB) SelectPagesWithContext(ctx aws.Context, input *SelectInput, f }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*SelectOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*SelectOutput), !p.HasNextPage()) { + break + } } + return p.Err() } 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 index d4de27413cb..e71bb4bb706 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/simpledb/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/simpledb/service.go @@ -32,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "sdb" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "SimpleDB" // ServiceID is a unique identifer of a specific service. + ServiceID = "SimpleDB" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the SimpleDB client with a session. @@ -40,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a SimpleDB client from just a session. // svc := simpledb.New(mySession) // @@ -47,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *SimpleDB { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *SimpleDB { svc := &SimpleDB{ Client: client.New( cfg, @@ -60,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2009-04-15", }, 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 index 477d52e0faf..780b1884323 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sns/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sns/api.go @@ -345,27 +345,18 @@ func (c *SNS) CreatePlatformApplicationRequest(input *CreatePlatformApplicationI // 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, +// "SSL certificate". For FCM, 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 +// For APNS/APNS_SANDBOX, PlatformCredential is "private key". For FCM, 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 (https://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 (https://docs.aws.amazon.com/sns/latest/dg/mobile-push-apns.html), -// Getting Started with Amazon Device Messaging (https://docs.aws.amazon.com/sns/latest/dg/mobile-push-adm.html), -// Getting Started with Baidu Cloud Push (https://docs.aws.amazon.com/sns/latest/dg/mobile-push-baidu.html), -// Getting Started with Google Cloud Messaging for Android (https://docs.aws.amazon.com/sns/latest/dg/mobile-push-gcm.html), -// Getting Started with MPNS (https://docs.aws.amazon.com/sns/latest/dg/mobile-push-mpns.html), -// or Getting Started with WNS (https://docs.aws.amazon.com/sns/latest/dg/mobile-push-wns.html). +// CreatePlatformEndpoint 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 @@ -451,7 +442,7 @@ func (c *SNS) CreatePlatformEndpointRequest(input *CreatePlatformEndpointInput) // 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 +// notification services, such as FCM 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 @@ -755,7 +746,7 @@ func (c *SNS) DeletePlatformApplicationRequest(input *DeletePlatformApplicationI // 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 +// services, such as APNS and FCM. For more information, see Using Amazon SNS // Mobile Push Notifications (https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -946,7 +937,7 @@ func (c *SNS) GetEndpointAttributesRequest(input *GetEndpointAttributesInput) (r // 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 +// notification services, such as FCM and APNS. For more information, see Using // Amazon SNS Mobile Push Notifications (https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1036,7 +1027,7 @@ func (c *SNS) GetPlatformApplicationAttributesRequest(input *GetPlatformApplicat // 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 +// push notification services, such as APNS and FCM. For more information, see // Using Amazon SNS Mobile Push Notifications (https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -1404,7 +1395,7 @@ func (c *SNS) ListEndpointsByPlatformApplicationRequest(input *ListEndpointsByPl // 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 +// notification service, such as FCM 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 @@ -1499,10 +1490,12 @@ func (c *SNS) ListEndpointsByPlatformApplicationPagesWithContext(ctx aws.Context }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListEndpointsByPlatformApplicationOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListEndpointsByPlatformApplicationOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1654,7 +1647,7 @@ func (c *SNS) ListPlatformApplicationsRequest(input *ListPlatformApplicationsInp // 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 +// services, such as APNS and FCM. 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 @@ -1746,10 +1739,12 @@ func (c *SNS) ListPlatformApplicationsPagesWithContext(ctx aws.Context, input *L }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListPlatformApplicationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListPlatformApplicationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1892,10 +1887,12 @@ func (c *SNS) ListSubscriptionsPagesWithContext(ctx aws.Context, input *ListSubs }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSubscriptionsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListSubscriptionsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2041,10 +2038,12 @@ func (c *SNS) ListSubscriptionsByTopicPagesWithContext(ctx aws.Context, input *L }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListSubscriptionsByTopicOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListSubscriptionsByTopicOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2281,10 +2280,12 @@ func (c *SNS) ListTopicsPagesWithContext(ctx aws.Context, input *ListTopicsInput }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTopicsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTopicsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2659,7 +2660,7 @@ func (c *SNS) SetEndpointAttributesRequest(input *SetEndpointAttributesInput) (r // 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 +// push notification services, such as FCM and APNS. For more information, see // Using Amazon SNS Mobile Push Notifications (https://docs.aws.amazon.com/sns/latest/dg/SNSMobilePush.html). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -2750,7 +2751,7 @@ func (c *SNS) SetPlatformApplicationAttributesRequest(input *SetPlatformApplicat // 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 +// push notification services, such as APNS and FCM. For more information, see // Using Amazon SNS Mobile Push Notifications (https://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 (https://docs.aws.amazon.com/sns/latest/dg/sns-msg-status.html). @@ -3247,11 +3248,9 @@ func (c *SNS) TagResourceRequest(input *TagResourceInput) (req *request.Request, // * A new tag with a key identical to that of an existing tag overwrites // the existing tag. // -// * Tagging actions are limited to 10 TPS per AWS account. If your application -// requires a higher throughput, file a technical support request (https://console.aws.amazon.com/support/home#/case/create?issueType=technical). -// -// For a full list of tag restrictions, see Limits Related to Topics (https://docs.aws.amazon.com/sns/latest/dg/sns-limits.html#limits-topics) -// in the Amazon SNS Developer Guide. +// * Tagging actions are limited to 10 TPS per AWS account, per AWS region. +// If your application requires a higher throughput, file a technical support +// request (https://console.aws.amazon.com/support/home#/case/create?issueType=technical). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -3522,7 +3521,7 @@ type AddPermissionInput struct { // The action you want to allow for the specified principal(s). // - // Valid values: any Amazon SNS action name. + // Valid values: Any Amazon SNS action name, for example Publish. // // ActionName is a required field ActionName []*string `type:"list" required:"true"` @@ -3783,7 +3782,8 @@ type CreatePlatformApplicationInput struct { 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). + // (Apple Push Notification Service), APNS_SANDBOX, and FCM (Firebase Cloud + // Messaging). // // Platform is a required field Platform *string `type:"string" required:"true"` @@ -3880,7 +3880,7 @@ type CreatePlatformEndpointInput struct { // 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 + // you need the device token. Alternatively, when using FCM or ADM, the device // token equivalent is called the registration ID. // // Token is a required field @@ -3996,6 +3996,9 @@ type CreateTopicInput struct { Name *string `type:"string" required:"true"` // The list of tags to add to a new topic. + // + // To be able to tag a topic on creation, you must have the sns:CreateTopic + // and sns:TagResource permissions. Tags []*Tag `type:"list"` } @@ -4322,6 +4325,7 @@ type GetEndpointAttributesOutput struct { // * 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. + // The device token for the iOS platform is returned in lowercase. Attributes map[string]*string `type:"map"` } @@ -4538,6 +4542,13 @@ type GetSubscriptionAttributesOutput struct { // subscription. Raw messages are free of JSON formatting and can be sent // to HTTP/S and Amazon SQS endpoints. // + // * RedrivePolicy – When specified, sends undeliverable messages to the + // specified Amazon SQS dead-letter queue. Messages that can't be delivered + // due to client errors (for example, when the subscribed endpoint is unreachable) + // or server errors (for example, when the service that powers the subscribed + // endpoint becomes unavailable) are held in the dead-letter queue for further + // analysis or reprocessing. + // // * SubscriptionArn – The subscription's ARN. // // * TopicArn – The topic ARN that the subscription is associated with. @@ -4605,28 +4616,35 @@ type GetTopicAttributesOutput struct { // A map of the topic's attributes. Attributes in this map include the following: // - // * TopicArn – the topic's ARN + // * DeliveryPolicy – The JSON serialization of the topic's delivery policy. + // + // * DisplayName – The human-readable name used in the From field for notifications + // to email and email-json endpoints. // - // * Owner – the AWS account ID of the topic's owner + // * Owner – The AWS account ID of the topic's owner. // - // * Policy – the JSON serialization of the topic's access control policy + // * 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 + // * SubscriptionsConfirmed – The number of confirmed subscriptions for + // the topic. // - // * SubscriptionsPending – the number of subscriptions pending confirmation - // on this topic + // * SubscriptionsDeleted – The number of deleted subscriptions for the + // topic. // - // * SubscriptionsConfirmed – the number of confirmed subscriptions on - // this topic + // * SubscriptionsPending – The number of subscriptions pending confirmation + // for the topic. // - // * SubscriptionsDeleted – the number of deleted subscriptions on this - // topic + // * TopicArn – The topic's ARN. // - // * DeliveryPolicy – the JSON serialization of the topic's delivery policy + // * EffectiveDeliveryPolicy – Yhe JSON serialization of the effective + // delivery policy, taking system defaults into account. + // + // The following attribute applies only to server-side-encryption (https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html): // - // * EffectiveDeliveryPolicy – the JSON serialization of the effective - // delivery policy that takes into account system defaults + // * KmsMasterKeyId - The ID of an AWS-managed customer master key (CMK) + // for Amazon SNS or a custom CMK. For more information, see Key Terms (https://docs.aws.amazon.com/sns/latest/dg/sns-server-side-encryption.html#sse-key-terms). + // For more examples, see KeyId (https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html#API_DescribeKey_RequestParameters) + // in the AWS Key Management Service API Reference. Attributes map[string]*string `type:"map"` } @@ -5275,9 +5293,6 @@ type PublishInput struct { // The message you want to send. // - // The Message parameter is always a string. If you set MessageStructure to - // json, you must string-encode the Message parameter. - // // If you are publishing to a topic and 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 @@ -5341,11 +5356,6 @@ type PublishInput struct { // 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 - // (https://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"` @@ -5632,11 +5642,11 @@ type SetPlatformApplicationAttributesInput struct { // // * 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 + // FCM, 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, + // For APNS/APNS_SANDBOX, PlatformPrincipal is SSL certificate. For FCM, // PlatformPrincipal is not applicable. For ADM, PlatformPrincipal is "client // id". // @@ -5871,6 +5881,13 @@ type SetSubscriptionAttributesInput struct { // to process JSON formatting, which is otherwise created for Amazon SNS // metadata. // + // * RedrivePolicy – When specified, sends undeliverable messages to the + // specified Amazon SQS dead-letter queue. Messages that can't be delivered + // due to client errors (for example, when the subscribed endpoint is unreachable) + // or server errors (for example, when the service that powers the subscribed + // endpoint becomes unavailable) are held in the dead-letter queue for further + // analysis or reprocessing. + // // AttributeName is a required field AttributeName *string `type:"string" required:"true"` @@ -6055,13 +6072,20 @@ type SubscribeInput struct { // to Amazon SQS or HTTP/S endpoints. This eliminates the need for the endpoints // to process JSON formatting, which is otherwise created for Amazon SNS // metadata. + // + // * RedrivePolicy – When specified, sends undeliverable messages to the + // specified Amazon SQS dead-letter queue. Messages that can't be delivered + // due to client errors (for example, when the subscribed endpoint is unreachable) + // or server errors (for example, when the service that powers the subscribed + // endpoint becomes unavailable) are held in the dead-letter queue for further + // analysis or reprocessing. Attributes map[string]*string `type:"map"` // The endpoint that you want to receive notifications. Endpoints vary by protocol: // - // * For the http protocol, the endpoint is an URL beginning with "https://" + // * 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 https protocol, the endpoint is a URL beginning with https:// // // * For the email protocol, the endpoint is an email address // @@ -6075,7 +6099,8 @@ type SubscribeInput struct { // * 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. + // * For the lambda protocol, the endpoint is the ARN of an Amazon Lambda + // function. Endpoint *string `type:"string"` // The protocol you want to use. Supported protocols include: @@ -6095,7 +6120,7 @@ type SubscribeInput struct { // * 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. + // * lambda – delivery of JSON-encoded message to an Amazon Lambda function. // // Protocol is a required field Protocol *string `type:"string" required:"true"` @@ -6103,14 +6128,16 @@ type SubscribeInput struct { // Sets whether the response from the Subscribe request includes the subscription // ARN, even if the subscription is not yet confirmed. // - // If you set this parameter to false, the response includes the ARN for confirmed - // subscriptions, but it includes an ARN value of "pending subscription" for - // subscriptions that are not yet confirmed. A subscription becomes confirmed - // when the subscriber calls the ConfirmSubscription action with a confirmation - // token. + // * If you have the subscription ARN returned, the response includes the + // ARN in all cases, even if the subscription is not yet confirmed. + // + // * If you don't have the subscription ARN returned, in addition to the + // ARN for confirmed subscriptions, the response also includes the pending + // subscription ARN value for subscriptions that aren't yet confirmed. A + // subscription becomes confirmed when the subscriber calls the ConfirmSubscription + // action with a confirmation token. // - // If you set this parameter to true, the response includes the ARN in all cases, - // even if the subscription is not yet confirmed. + // If you set this parameter to true, . // // The default value is false. ReturnSubscriptionArn *bool `type:"boolean"` 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 index 96d7c8ba05c..21b616043d8 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sns/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sns/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "sns" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "SNS" // ServiceID is a unique identifer of a specific service. + ServiceID = "SNS" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the SNS client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a SNS client from just a session. // svc := sns.New(mySession) // @@ -46,11 +48,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *SNS { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *SNS { svc := &SNS{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2010-03-31", }, 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 index d463ecf0ddb..f4f61420740 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sqs/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sqs/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "sqs" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "SQS" // ServiceID is a unique identifer of a specific service. + ServiceID = "SQS" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the SQS client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a SQS client from just a session. // svc := sqs.New(mySession) // @@ -46,11 +48,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *SQS { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *SQS { svc := &SQS{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2012-11-05", }, 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 index 4c2bb71ffe1..989c4580f17 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ssm/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ssm/api.go @@ -86,23 +86,23 @@ func (c *SSM) AddTagsToResourceRequest(input *AddTagsToResourceInput) (req *requ // 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" +// Returned Error Types: +// * InvalidResourceType // The resource type is not valid. For example, if you are attempting to tag // an instance, the instance must be a registered, managed instance. // -// * ErrCodeInvalidResourceId "InvalidResourceId" +// * InvalidResourceId // The resource ID is not valid. Verify that you entered the correct ID and // try again. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeTooManyTagsError "TooManyTagsError" +// * TooManyTagsError // The Targets parameter includes too many tags. Remove one or more tags and // try the command again. // -// * ErrCodeTooManyUpdates "TooManyUpdates" +// * TooManyUpdates // There are concurrent updates for a resource that supports one update at a // time. // @@ -183,13 +183,13 @@ func (c *SSM) CancelCommandRequest(input *CancelCommandInput) (req *request.Requ // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidCommandId "InvalidCommandId" +// * InvalidCommandId // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -201,7 +201,7 @@ func (c *SSM) CancelCommandRequest(input *CancelCommandInput) (req *request.Requ // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeDuplicateInstanceId "DuplicateInstanceId" +// * DuplicateInstanceId // You cannot specify an instance ID in more than one association. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CancelCommand @@ -281,16 +281,17 @@ func (c *SSM) CancelMaintenanceWindowExecutionRequest(input *CancelMaintenanceWi // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation CancelMaintenanceWindowExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeDoesNotExistException "DoesNotExistException" +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CancelMaintenanceWindowExecution func (c *SSM) CancelMaintenanceWindowExecution(input *CancelMaintenanceWindowExecutionInput) (*CancelMaintenanceWindowExecutionOutput, error) { @@ -358,11 +359,18 @@ func (c *SSM) CreateActivationRequest(input *CreateActivationInput) (req *reques // 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 AWS Systems Manager -// for Hybrid Environments (http://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-managedinstances.html). +// Generates an activation code and activation ID you can use to register your +// on-premises server or virtual machine (VM) with Systems Manager. Registering +// these machines with Systems Manager makes it possible to manage them using +// Systems Manager capabilities. You use the activation code and ID when installing +// SSM Agent on machines in your hybrid environment. For more information about +// requirements for managing on-premises instances and VMs using Systems Manager, +// see Setting Up AWS Systems Manager for Hybrid Environments (http://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-managedinstances.html) +// in the AWS Systems Manager User Guide. +// +// On-premises servers or VMs that are registered with Systems Manager and Amazon +// EC2 instances that you manage with Systems Manager are all called 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 @@ -371,8 +379,8 @@ func (c *SSM) CreateActivationRequest(input *CreateActivationInput) (req *reques // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateActivation @@ -458,23 +466,23 @@ func (c *SSM) CreateAssociationRequest(input *CreateAssociationInput) (req *requ // 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" +// Returned Error Types: +// * AssociationAlreadyExists // The specified association already exists. // -// * ErrCodeAssociationLimitExceeded "AssociationLimitExceeded" +// * AssociationLimitExceeded // You can have at most 2,000 active associations. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidDocument "InvalidDocument" +// * InvalidDocument // The specified document does not exist. // -// * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" +// * InvalidDocumentVersion // The document version is not valid or does not exist. // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -486,23 +494,23 @@ func (c *SSM) CreateAssociationRequest(input *CreateAssociationInput) (req *requ // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeUnsupportedPlatformType "UnsupportedPlatformType" +// * UnsupportedPlatformType // The document does not support the platform type of the given instance ID(s). // For example, you sent an document for a Windows instance to a Linux instance. // -// * ErrCodeInvalidOutputLocation "InvalidOutputLocation" +// * InvalidOutputLocation // The output location is not valid or does not exist. // -// * ErrCodeInvalidParameters "InvalidParameters" +// * InvalidParameters // You must specify values for all required parameters in the Systems Manager // document. You can only supply values to parameters defined in the Systems // Manager document. // -// * ErrCodeInvalidTarget "InvalidTarget" +// * 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" +// * InvalidSchedule // The schedule is invalid. Verify your cron or rate expression and try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociation @@ -588,17 +596,17 @@ func (c *SSM) CreateAssociationBatchRequest(input *CreateAssociationBatchInput) // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidDocument "InvalidDocument" +// * InvalidDocument // The specified document does not exist. // -// * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" +// * InvalidDocumentVersion // The document version is not valid or does not exist. // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -610,29 +618,29 @@ func (c *SSM) CreateAssociationBatchRequest(input *CreateAssociationBatchInput) // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeInvalidParameters "InvalidParameters" +// * InvalidParameters // You must specify values for all required parameters in the Systems Manager // document. You can only supply values to parameters defined in the Systems // Manager document. // -// * ErrCodeDuplicateInstanceId "DuplicateInstanceId" +// * DuplicateInstanceId // You cannot specify an instance ID in more than one association. // -// * ErrCodeAssociationLimitExceeded "AssociationLimitExceeded" +// * AssociationLimitExceeded // You can have at most 2,000 active associations. // -// * ErrCodeUnsupportedPlatformType "UnsupportedPlatformType" +// * UnsupportedPlatformType // The document does not support the platform type of the given instance ID(s). // For example, you sent an document for a Windows instance to a Linux instance. // -// * ErrCodeInvalidOutputLocation "InvalidOutputLocation" +// * InvalidOutputLocation // The output location is not valid or does not exist. // -// * ErrCodeInvalidTarget "InvalidTarget" +// * 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" +// * InvalidSchedule // The schedule is invalid. Verify your cron or rate expression and try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateAssociationBatch @@ -713,23 +721,23 @@ func (c *SSM) CreateDocumentRequest(input *CreateDocumentInput) (req *request.Re // 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" +// Returned Error Types: +// * DocumentAlreadyExists // The specified document already exists. // -// * ErrCodeMaxDocumentSizeExceeded "MaxDocumentSizeExceeded" +// * MaxDocumentSizeExceeded // The size limit of a document is 64 KB. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidDocumentContent "InvalidDocumentContent" +// * InvalidDocumentContent // The content for the document is not valid. // -// * ErrCodeDocumentLimitExceeded "DocumentLimitExceeded" +// * DocumentLimitExceeded // You can have at most 500 active Systems Manager documents. // -// * ErrCodeInvalidDocumentSchemaVersion "InvalidDocumentSchemaVersion" +// * InvalidDocumentSchemaVersion // The version of the document schema is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateDocument @@ -800,6 +808,13 @@ func (c *SSM) CreateMaintenanceWindowRequest(input *CreateMaintenanceWindowInput // // Creates a new maintenance window. // +// The value you specify for Duration determines the specific end time for the +// maintenance window based on the time it begins. No maintenance window tasks +// are permitted to start after the resulting endtime minus the number of hours +// you specify for Cutoff. For example, if the maintenance window starts at +// 3 PM, the duration is three hours, and the value you specify for Cutoff is +// one hour, no maintenance window tasks can start after 5 PM. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -807,19 +822,20 @@ func (c *SSM) CreateMaintenanceWindowRequest(input *CreateMaintenanceWindowInput // 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" +// Returned Error Types: +// * 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. +// * ResourceLimitExceededException +// Error returned when the caller has exceeded the default resource quotas. // For example, too many maintenance windows or patch baselines have been created. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateMaintenanceWindow @@ -906,18 +922,18 @@ func (c *SSM) CreateOpsItemRequest(input *CreateOpsItemInput) (req *request.Requ // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation CreateOpsItem for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeOpsItemAlreadyExistsException "OpsItemAlreadyExistsException" +// * OpsItemAlreadyExistsException // The OpsItem already exists. // -// * ErrCodeOpsItemLimitExceededException "OpsItemLimitExceededException" -// The request caused OpsItems to exceed one or more limits. For information -// about OpsItem limits, see What are the resource limits for OpsCenter? (http://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-learn-more.html#OpsCenter-learn-more-limits). +// * OpsItemLimitExceededException +// The request caused OpsItems to exceed one or more quotas. For information +// about OpsItem quotas, see What are the resource limits for OpsCenter? (http://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-learn-more.html#OpsCenter-learn-more-limits). // -// * ErrCodeOpsItemInvalidParameterException "OpsItemInvalidParameterException" +// * OpsItemInvalidParameterException // A specified parameter argument isn't valid. Verify the available arguments // and try again. // @@ -999,19 +1015,20 @@ func (c *SSM) CreatePatchBaselineRequest(input *CreatePatchBaselineInput) (req * // 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" +// Returned Error Types: +// * 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. +// * ResourceLimitExceededException +// Error returned when the caller has exceeded the default resource quotas. // For example, too many maintenance windows or patch baselines have been created. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreatePatchBaseline @@ -1081,17 +1098,32 @@ func (c *SSM) CreateResourceDataSyncRequest(input *CreateResourceDataSyncInput) // CreateResourceDataSync API operation for Amazon Simple Systems Manager (SSM). // -// Creates a resource data sync configuration to a single bucket in Amazon S3. -// This is an asynchronous operation that returns immediately. After a successful -// initial sync is completed, the system continuously syncs data to the Amazon -// S3 bucket. To check the status of the sync, use the ListResourceDataSync. +// A resource data sync helps you view data from multiple sources in a single +// location. Systems Manager offers two types of resource data sync: SyncToDestination +// and SyncFromSource. +// +// You can configure Systems Manager Inventory to use the SyncToDestination +// type to synchronize Inventory data from multiple AWS Regions to a single +// Amazon S3 bucket. For more information, see Configuring Resource Data Sync +// for Inventory (http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-datasync.html) +// in the AWS Systems Manager User Guide. +// +// You can configure Systems Manager Explorer to use the SyncFromSource type +// to synchronize operational work items (OpsItems) and operational data (OpsData) +// from multiple AWS Regions to a single Amazon S3 bucket. This type can synchronize +// OpsItems and OpsData from multiple AWS accounts and Regions or EntireOrganization +// by using AWS Organizations. For more information, see Setting Up Explorer +// to Display Data from Multiple Accounts and Regions (http://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html) +// in the AWS Systems Manager User Guide. +// +// A resource data sync is an asynchronous operation that returns immediately. +// After a successful initial sync is completed, the system continuously syncs +// data. To check the status of a sync, use the ListResourceDataSync. // // By default, data is not encrypted in Amazon S3. We strongly recommend that // you enable encryption in Amazon S3 to ensure secure data storage. We also // recommend that you secure access to the Amazon S3 bucket by creating a restrictive -// bucket policy. For more information, see Configuring Resource Data Sync for -// Inventory (http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-inventory-datasync.html) -// in the AWS Systems Manager User Guide. +// bucket 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 @@ -1100,17 +1132,17 @@ func (c *SSM) CreateResourceDataSyncRequest(input *CreateResourceDataSyncInput) // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation CreateResourceDataSync for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeResourceDataSyncCountExceededException "ResourceDataSyncCountExceededException" +// * ResourceDataSyncCountExceededException // You have exceeded the allowed maximum sync configurations. // -// * ErrCodeResourceDataSyncAlreadyExistsException "ResourceDataSyncAlreadyExistsException" +// * ResourceDataSyncAlreadyExistsException // A sync configuration with the same name already exists. // -// * ErrCodeResourceDataSyncInvalidConfigurationException "ResourceDataSyncInvalidConfigurationException" +// * ResourceDataSyncInvalidConfigurationException // The specified sync configuration is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/CreateResourceDataSync @@ -1192,19 +1224,19 @@ func (c *SSM) DeleteActivationRequest(input *DeleteActivationInput) (req *reques // 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" +// Returned Error Types: +// * InvalidActivationId // The activation ID is not valid. Verify the you entered the correct ActivationId // or ActivationCode and try again. // -// * ErrCodeInvalidActivation "InvalidActivation" +// * InvalidActivation // The activation is not valid. The activation might have been deleted, or the // ActivationId and the ActivationCode do not match. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeTooManyUpdates "TooManyUpdates" +// * TooManyUpdates // There are concurrent updates for a resource that supports one update at a // time. // @@ -1289,17 +1321,17 @@ func (c *SSM) DeleteAssociationRequest(input *DeleteAssociationInput) (req *requ // 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" +// Returned Error Types: +// * AssociationDoesNotExist // The specified association does not exist. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidDocument "InvalidDocument" +// * InvalidDocument // The specified document does not exist. // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -1311,7 +1343,7 @@ func (c *SSM) DeleteAssociationRequest(input *DeleteAssociationInput) (req *requ // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeTooManyUpdates "TooManyUpdates" +// * TooManyUpdates // There are concurrent updates for a resource that supports one update at a // time. // @@ -1395,18 +1427,18 @@ func (c *SSM) DeleteDocumentRequest(input *DeleteDocumentInput) (req *request.Re // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidDocument "InvalidDocument" +// * InvalidDocument // The specified document does not exist. // -// * ErrCodeInvalidDocumentOperation "InvalidDocumentOperation" +// * 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" +// * AssociatedInstances // You must disassociate a document from all instances before you can delete // it. // @@ -1487,22 +1519,22 @@ func (c *SSM) DeleteInventoryRequest(input *DeleteInventoryInput) (req *request. // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation DeleteInventory for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidTypeNameException "InvalidTypeNameException" +// * InvalidTypeNameException // The parameter type name is not valid. // -// * ErrCodeInvalidOptionException "InvalidOptionException" +// * InvalidOptionException // The delete inventory option specified is not valid. Verify the option and // try again. // -// * ErrCodeInvalidDeleteInventoryParametersException "InvalidDeleteInventoryParametersException" +// * InvalidDeleteInventoryParametersException // One or more of the parameters specified for the delete operation is not valid. // Verify all parameters and try again. // -// * ErrCodeInvalidInventoryRequestException "InvalidInventoryRequestException" +// * InvalidInventoryRequestException // The request is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteInventory @@ -1580,8 +1612,8 @@ func (c *SSM) DeleteMaintenanceWindowRequest(input *DeleteMaintenanceWindowInput // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteMaintenanceWindow @@ -1660,11 +1692,11 @@ func (c *SSM) DeleteParameterRequest(input *DeleteParameterInput) (req *request. // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeParameterNotFound "ParameterNotFound" +// * ParameterNotFound // The parameter could not be found. Verify the name and try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteParameter @@ -1742,8 +1774,8 @@ func (c *SSM) DeleteParametersRequest(input *DeleteParametersInput) (req *reques // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation DeleteParameters for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteParameters @@ -1821,12 +1853,12 @@ func (c *SSM) DeletePatchBaselineRequest(input *DeletePatchBaselineInput) (req * // 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" +// Returned Error Types: +// * ResourceInUseException // Error returned if an attempt is made to delete a patch baseline that is registered // for a patch group. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeletePatchBaseline @@ -1897,9 +1929,8 @@ func (c *SSM) DeleteResourceDataSyncRequest(input *DeleteResourceDataSyncInput) // DeleteResourceDataSync API operation for Amazon Simple Systems Manager (SSM). // // Deletes a Resource Data Sync configuration. After the configuration is deleted, -// changes to inventory data on managed instances are no longer synced with -// the target Amazon S3 bucket. Deleting a sync configuration does not delete -// data in the target Amazon S3 bucket. +// changes to data on managed instances are no longer synced to or from the +// target. Deleting a sync configuration does not delete 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 @@ -1908,13 +1939,16 @@ func (c *SSM) DeleteResourceDataSyncRequest(input *DeleteResourceDataSyncInput) // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation DeleteResourceDataSync for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeResourceDataSyncNotFoundException "ResourceDataSyncNotFoundException" +// * ResourceDataSyncNotFoundException // The specified sync name was not found. // +// * ResourceDataSyncInvalidConfigurationException +// The specified sync configuration is invalid. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeleteResourceDataSync func (c *SSM) DeleteResourceDataSync(input *DeleteResourceDataSyncInput) (*DeleteResourceDataSyncOutput, error) { req, out := c.DeleteResourceDataSyncRequest(input) @@ -1993,8 +2027,8 @@ func (c *SSM) DeregisterManagedInstanceRequest(input *DeregisterManagedInstanceI // 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" +// Returned Error Types: +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -2006,7 +2040,7 @@ func (c *SSM) DeregisterManagedInstanceRequest(input *DeregisterManagedInstanceI // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterManagedInstance @@ -2084,12 +2118,12 @@ func (c *SSM) DeregisterPatchBaselineForPatchGroupRequest(input *DeregisterPatch // 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" +// Returned Error Types: +// * InvalidResourceId // The resource ID is not valid. Verify that you entered the correct ID and // try again. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterPatchBaselineForPatchGroup @@ -2167,18 +2201,19 @@ func (c *SSM) DeregisterTargetFromMaintenanceWindowRequest(input *DeregisterTarg // 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" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeTargetInUseException "TargetInUseException" +// * TargetInUseException // You specified the Safe option for the DeregisterTargetFromMaintenanceWindow // operation, but the target is still referenced in a task. // @@ -2257,15 +2292,16 @@ func (c *SSM) DeregisterTaskFromMaintenanceWindowRequest(input *DeregisterTaskFr // 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" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DeregisterTaskFromMaintenanceWindow @@ -2351,15 +2387,15 @@ func (c *SSM) DescribeActivationsRequest(input *DescribeActivationsInput) (req * // 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" +// Returned Error Types: +// * InvalidFilter // The filter name is not valid. Verify the you entered the correct name and // try again. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeActivations @@ -2427,10 +2463,12 @@ func (c *SSM) DescribeActivationsPagesWithContext(ctx aws.Context, input *Descri }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeActivationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeActivationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2491,22 +2529,22 @@ func (c *SSM) DescribeAssociationRequest(input *DescribeAssociationInput) (req * // 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" +// Returned Error Types: +// * AssociationDoesNotExist // The specified association does not exist. // -// * ErrCodeInvalidAssociationVersion "InvalidAssociationVersion" +// * InvalidAssociationVersion // The version you specified is not valid. Use ListAssociationVersions to view // all versions of an association according to the association ID. Or, use the // $LATEST parameter to view the latest version of the association. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidDocument "InvalidDocument" +// * InvalidDocument // The specified document does not exist. // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -2594,17 +2632,17 @@ func (c *SSM) DescribeAssociationExecutionTargetsRequest(input *DescribeAssociat // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation DescribeAssociationExecutionTargets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeAssociationDoesNotExist "AssociationDoesNotExist" +// * AssociationDoesNotExist // The specified association does not exist. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // -// * ErrCodeAssociationExecutionDoesNotExist "AssociationExecutionDoesNotExist" +// * AssociationExecutionDoesNotExist // The specified execution ID does not exist. Verify the ID number and try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAssociationExecutionTargets @@ -2682,14 +2720,14 @@ func (c *SSM) DescribeAssociationExecutionsRequest(input *DescribeAssociationExe // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation DescribeAssociationExecutions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeAssociationDoesNotExist "AssociationDoesNotExist" +// * AssociationDoesNotExist // The specified association does not exist. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAssociationExecutions @@ -2767,17 +2805,17 @@ func (c *SSM) DescribeAutomationExecutionsRequest(input *DescribeAutomationExecu // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation DescribeAutomationExecutions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidFilterKey "InvalidFilterKey" +// Returned Error Types: +// * InvalidFilterKey // The specified key is not valid. // -// * ErrCodeInvalidFilterValue "InvalidFilterValue" +// * InvalidFilterValue // The filter value is not valid. Verify the value and try again. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAutomationExecutions @@ -2856,21 +2894,21 @@ func (c *SSM) DescribeAutomationStepExecutionsRequest(input *DescribeAutomationS // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation DescribeAutomationStepExecutions for usage and error information. // -// Returned Error Codes: -// * ErrCodeAutomationExecutionNotFoundException "AutomationExecutionNotFoundException" +// Returned Error Types: +// * AutomationExecutionNotFoundException // There is no automation execution information for the requested automation // execution ID. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // -// * ErrCodeInvalidFilterKey "InvalidFilterKey" +// * InvalidFilterKey // The specified key is not valid. // -// * ErrCodeInvalidFilterValue "InvalidFilterValue" +// * InvalidFilterValue // The filter value is not valid. Verify the value and try again. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAutomationStepExecutions @@ -2948,8 +2986,8 @@ func (c *SSM) DescribeAvailablePatchesRequest(input *DescribeAvailablePatchesInp // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeAvailablePatches @@ -3027,14 +3065,14 @@ func (c *SSM) DescribeDocumentRequest(input *DescribeDocumentInput) (req *reques // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidDocument "InvalidDocument" +// * InvalidDocument // The specified document does not exist. // -// * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" +// * InvalidDocumentVersion // The document version is not valid or does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeDocument @@ -3114,14 +3152,14 @@ func (c *SSM) DescribeDocumentPermissionRequest(input *DescribeDocumentPermissio // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidDocument "InvalidDocument" +// * InvalidDocument // The specified document does not exist. // -// * ErrCodeInvalidPermissionType "InvalidPermissionType" +// * InvalidPermissionType // The permission type is not supported. Share is the only supported permission // type. // @@ -3200,11 +3238,11 @@ func (c *SSM) DescribeEffectiveInstanceAssociationsRequest(input *DescribeEffect // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -3216,7 +3254,7 @@ func (c *SSM) DescribeEffectiveInstanceAssociationsRequest(input *DescribeEffect // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeEffectiveInstanceAssociations @@ -3296,24 +3334,25 @@ func (c *SSM) DescribeEffectivePatchesForPatchBaselineRequest(input *DescribeEff // 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" +// Returned Error Types: +// * InvalidResourceId // The resource ID is not valid. Verify that you entered the correct ID and // try again. // -// * ErrCodeDoesNotExistException "DoesNotExistException" +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeUnsupportedOperatingSystem "UnsupportedOperatingSystem" +// * UnsupportedOperatingSystem // The operating systems you specified is not supported, or the operation is // not supported for the operating system. Valid operating systems include: // Windows, AmazonLinux, RedhatEnterpriseLinux, and Ubuntu. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeEffectivePatchesForPatchBaseline @@ -3391,11 +3430,11 @@ func (c *SSM) DescribeInstanceAssociationsStatusRequest(input *DescribeInstanceA // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -3407,7 +3446,7 @@ func (c *SSM) DescribeInstanceAssociationsStatusRequest(input *DescribeInstanceA // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstanceAssociationsStatus @@ -3500,11 +3539,11 @@ func (c *SSM) DescribeInstanceInformationRequest(input *DescribeInstanceInformat // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -3516,13 +3555,13 @@ func (c *SSM) DescribeInstanceInformationRequest(input *DescribeInstanceInformat // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // -// * ErrCodeInvalidInstanceInformationFilterValue "InvalidInstanceInformationFilterValue" +// * InvalidInstanceInformationFilterValue // The specified filter value is not valid. // -// * ErrCodeInvalidFilterKey "InvalidFilterKey" +// * InvalidFilterKey // The specified key is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstanceInformation @@ -3590,10 +3629,12 @@ func (c *SSM) DescribeInstanceInformationPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeInstanceInformationOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeInstanceInformationOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3650,11 +3691,11 @@ func (c *SSM) DescribeInstancePatchStatesRequest(input *DescribeInstancePatchSta // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchStates @@ -3733,15 +3774,15 @@ func (c *SSM) DescribeInstancePatchStatesForPatchGroupRequest(input *DescribeIns // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidFilter "InvalidFilter" +// * InvalidFilter // The filter name is not valid. Verify the you entered the correct name and // try again. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatchStatesForPatchGroup @@ -3820,11 +3861,11 @@ func (c *SSM) DescribeInstancePatchesRequest(input *DescribeInstancePatchesInput // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -3836,11 +3877,11 @@ func (c *SSM) DescribeInstancePatchesRequest(input *DescribeInstancePatchesInput // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeInvalidFilter "InvalidFilter" +// * InvalidFilter // The filter name is not valid. Verify the you entered the correct name and // try again. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInstancePatches @@ -3918,15 +3959,15 @@ func (c *SSM) DescribeInventoryDeletionsRequest(input *DescribeInventoryDeletion // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation DescribeInventoryDeletions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidDeletionIdException "InvalidDeletionIdException" +// * InvalidDeletionIdException // The ID specified for the delete operation does not exist or is not valid. // Verify the ID and try again. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeInventoryDeletions @@ -4005,15 +4046,16 @@ func (c *SSM) DescribeMaintenanceWindowExecutionTaskInvocationsRequest(input *De // 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" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionTaskInvocations @@ -4091,15 +4133,16 @@ func (c *SSM) DescribeMaintenanceWindowExecutionTasksRequest(input *DescribeMain // 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" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutionTasks @@ -4179,8 +4222,8 @@ func (c *SSM) DescribeMaintenanceWindowExecutionsRequest(input *DescribeMaintena // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowExecutions @@ -4258,16 +4301,17 @@ func (c *SSM) DescribeMaintenanceWindowScheduleRequest(input *DescribeMaintenanc // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation DescribeMaintenanceWindowSchedule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeDoesNotExistException "DoesNotExistException" +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowSchedule func (c *SSM) DescribeMaintenanceWindowSchedule(input *DescribeMaintenanceWindowScheduleInput) (*DescribeMaintenanceWindowScheduleOutput, error) { @@ -4344,15 +4388,16 @@ func (c *SSM) DescribeMaintenanceWindowTargetsRequest(input *DescribeMaintenance // 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" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowTargets @@ -4430,15 +4475,16 @@ func (c *SSM) DescribeMaintenanceWindowTasksRequest(input *DescribeMaintenanceWi // 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" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowTasks @@ -4516,8 +4562,8 @@ func (c *SSM) DescribeMaintenanceWindowsRequest(input *DescribeMaintenanceWindow // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindows @@ -4596,8 +4642,8 @@ func (c *SSM) DescribeMaintenanceWindowsForTargetRequest(input *DescribeMaintena // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation DescribeMaintenanceWindowsForTarget for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeMaintenanceWindowsForTarget @@ -4684,8 +4730,8 @@ func (c *SSM) DescribeOpsItemsRequest(input *DescribeOpsItemsInput) (req *reques // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation DescribeOpsItems for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeOpsItems @@ -4777,21 +4823,21 @@ func (c *SSM) DescribeParametersRequest(input *DescribeParametersInput) (req *re // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidFilterKey "InvalidFilterKey" +// * InvalidFilterKey // The specified key is not valid. // -// * ErrCodeInvalidFilterOption "InvalidFilterOption" +// * InvalidFilterOption // The specified filter option is not valid. Valid options are Equals and BeginsWith. // For Path filter, valid options are Recursive and OneLevel. // -// * ErrCodeInvalidFilterValue "InvalidFilterValue" +// * InvalidFilterValue // The filter value is not valid. Verify the value and try again. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeParameters @@ -4859,10 +4905,12 @@ func (c *SSM) DescribeParametersPagesWithContext(ctx aws.Context, input *Describ }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeParametersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeParametersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4919,8 +4967,8 @@ func (c *SSM) DescribePatchBaselinesRequest(input *DescribePatchBaselinesInput) // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchBaselines @@ -4998,11 +5046,11 @@ func (c *SSM) DescribePatchGroupStateRequest(input *DescribePatchGroupStateInput // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchGroupState @@ -5080,8 +5128,8 @@ func (c *SSM) DescribePatchGroupsRequest(input *DescribePatchGroupsInput) (req * // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchGroups @@ -5194,8 +5242,8 @@ func (c *SSM) DescribePatchPropertiesRequest(input *DescribePatchPropertiesInput // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation DescribePatchProperties for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribePatchProperties @@ -5274,14 +5322,14 @@ func (c *SSM) DescribeSessionsRequest(input *DescribeSessionsInput) (req *reques // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation DescribeSessions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidFilterKey "InvalidFilterKey" +// * InvalidFilterKey // The specified key is not valid. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/DescribeSessions @@ -5359,12 +5407,12 @@ func (c *SSM) GetAutomationExecutionRequest(input *GetAutomationExecutionInput) // 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" +// Returned Error Types: +// * AutomationExecutionNotFoundException // There is no automation execution information for the requested automation // execution ID. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetAutomationExecution @@ -5389,6 +5437,103 @@ func (c *SSM) GetAutomationExecutionWithContext(ctx aws.Context, input *GetAutom return out, req.Send() } +const opGetCalendarState = "GetCalendarState" + +// GetCalendarStateRequest generates a "aws/request.Request" representing the +// client's request for the GetCalendarState operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetCalendarState for more information on using the GetCalendarState +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetCalendarStateRequest method. +// req, resp := client.GetCalendarStateRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetCalendarState +func (c *SSM) GetCalendarStateRequest(input *GetCalendarStateInput) (req *request.Request, output *GetCalendarStateOutput) { + op := &request.Operation{ + Name: opGetCalendarState, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetCalendarStateInput{} + } + + output = &GetCalendarStateOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetCalendarState API operation for Amazon Simple Systems Manager (SSM). +// +// Gets the state of the AWS Systems Manager Change Calendar at an optional, +// specified time. If you specify a time, GetCalendarState returns the state +// of the calendar at a specific time, and returns the next time that the Change +// Calendar state will transition. If you do not specify a time, GetCalendarState +// assumes the current time. Change Calendar entries have two possible states: +// OPEN or CLOSED. For more information about Systems Manager Change Calendar, +// see AWS Systems Manager Change Calendar (https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-change-calendar.html) +// in the AWS Systems Manager User Guide. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// 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 GetCalendarState for usage and error information. +// +// Returned Error Types: +// * InternalServerError +// An error occurred on the server side. +// +// * InvalidDocument +// The specified document does not exist. +// +// * InvalidDocumentType +// The document type is not valid. Valid document types are described in the +// DocumentType property. +// +// * UnsupportedCalendarException +// The calendar entry contained in the specified Systems Manager document is +// not supported. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetCalendarState +func (c *SSM) GetCalendarState(input *GetCalendarStateInput) (*GetCalendarStateOutput, error) { + req, out := c.GetCalendarStateRequest(input) + return out, req.Send() +} + +// GetCalendarStateWithContext is the same as GetCalendarState with the addition of +// the ability to pass a context and additional request options. +// +// See GetCalendarState for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SSM) GetCalendarStateWithContext(ctx aws.Context, input *GetCalendarStateInput, opts ...request.Option) (*GetCalendarStateOutput, error) { + req, out := c.GetCalendarStateRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opGetCommandInvocation = "GetCommandInvocation" // GetCommandInvocationRequest generates a "aws/request.Request" representing the @@ -5443,13 +5588,13 @@ func (c *SSM) GetCommandInvocationRequest(input *GetCommandInvocationInput) (req // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidCommandId "InvalidCommandId" +// * InvalidCommandId // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -5461,10 +5606,10 @@ func (c *SSM) GetCommandInvocationRequest(input *GetCommandInvocationInput) (req // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeInvalidPluginName "InvalidPluginName" +// * InvalidPluginName // The plugin name is not valid. // -// * ErrCodeInvocationDoesNotExist "InvocationDoesNotExist" +// * InvocationDoesNotExist // The command ID and instance ID you specified did not match any invocations. // Verify the command ID and the instance ID and try again. // @@ -5544,8 +5689,8 @@ func (c *SSM) GetConnectionStatusRequest(input *GetConnectionStatusInput) (req * // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation GetConnectionStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetConnectionStatus @@ -5628,8 +5773,8 @@ func (c *SSM) GetDefaultPatchBaselineRequest(input *GetDefaultPatchBaselineInput // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDefaultPatchBaseline @@ -5708,16 +5853,16 @@ func (c *SSM) GetDeployablePatchSnapshotForInstanceRequest(input *GetDeployableP // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeUnsupportedOperatingSystem "UnsupportedOperatingSystem" +// * UnsupportedOperatingSystem // The operating systems you specified is not supported, or the operation is // not supported for the operating system. Valid operating systems include: // Windows, AmazonLinux, RedhatEnterpriseLinux, and Ubuntu. // -// * ErrCodeUnsupportedFeatureRequiredException "UnsupportedFeatureRequiredException" +// * UnsupportedFeatureRequiredException // Microsoft application patching is only available on EC2 instances and Advanced // Instances. To patch Microsoft applications on on-premises servers and VMs, // you must enable Advanced Instances. For more information, see Using the Advanced-Instances @@ -5799,14 +5944,14 @@ func (c *SSM) GetDocumentRequest(input *GetDocumentInput) (req *request.Request, // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidDocument "InvalidDocument" +// * InvalidDocument // The specified document does not exist. // -// * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" +// * InvalidDocumentVersion // The document version is not valid or does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetDocument @@ -5884,28 +6029,28 @@ func (c *SSM) GetInventoryRequest(input *GetInventoryInput) (req *request.Reques // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidFilter "InvalidFilter" +// * InvalidFilter // The filter name is not valid. Verify the you entered the correct name and // try again. // -// * ErrCodeInvalidInventoryGroupException "InvalidInventoryGroupException" +// * InvalidInventoryGroupException // The specified inventory group is not valid. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // -// * ErrCodeInvalidTypeNameException "InvalidTypeNameException" +// * InvalidTypeNameException // The parameter type name is not valid. // -// * ErrCodeInvalidAggregatorException "InvalidAggregatorException" +// * InvalidAggregatorException // The specified aggregator is not valid for inventory groups. Verify that the // aggregator uses a valid inventory type such as AWS:Application or AWS:InstanceInformation. // -// * ErrCodeInvalidResultAttributeException "InvalidResultAttributeException" +// * InvalidResultAttributeException // The specified inventory item result attribute is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetInventory @@ -5984,14 +6129,14 @@ func (c *SSM) GetInventorySchemaRequest(input *GetInventorySchemaInput) (req *re // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidTypeNameException "InvalidTypeNameException" +// * InvalidTypeNameException // The parameter type name is not valid. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetInventorySchema @@ -6069,15 +6214,16 @@ func (c *SSM) GetMaintenanceWindowRequest(input *GetMaintenanceWindowInput) (req // 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" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindow @@ -6155,15 +6301,16 @@ func (c *SSM) GetMaintenanceWindowExecutionRequest(input *GetMaintenanceWindowEx // 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" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecution @@ -6242,15 +6389,16 @@ func (c *SSM) GetMaintenanceWindowExecutionTaskRequest(input *GetMaintenanceWind // 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" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecutionTask @@ -6328,15 +6476,16 @@ func (c *SSM) GetMaintenanceWindowExecutionTaskInvocationRequest(input *GetMaint // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation GetMaintenanceWindowExecutionTaskInvocation for usage and error information. // -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowExecutionTaskInvocation @@ -6414,15 +6563,16 @@ func (c *SSM) GetMaintenanceWindowTaskRequest(input *GetMaintenanceWindowTaskInp // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation GetMaintenanceWindowTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetMaintenanceWindowTask @@ -6509,11 +6659,11 @@ func (c *SSM) GetOpsItemRequest(input *GetOpsItemInput) (req *request.Request, o // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation GetOpsItem for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeOpsItemNotFoundException "OpsItemNotFoundException" +// * OpsItemNotFoundException // The specified OpsItem ID doesn't exist. Verify the ID and try again. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetOpsItem @@ -6591,21 +6741,24 @@ func (c *SSM) GetOpsSummaryRequest(input *GetOpsSummaryInput) (req *request.Requ // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation GetOpsSummary for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidFilter "InvalidFilter" +// * ResourceDataSyncNotFoundException +// The specified sync name was not found. +// +// * InvalidFilter // The filter name is not valid. Verify the you entered the correct name and // try again. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // -// * ErrCodeInvalidTypeNameException "InvalidTypeNameException" +// * InvalidTypeNameException // The parameter type name is not valid. // -// * ErrCodeInvalidAggregatorException "InvalidAggregatorException" +// * InvalidAggregatorException // The specified aggregator is not valid for inventory groups. Verify that the // aggregator uses a valid inventory type such as AWS:Application or AWS:InstanceInformation. // @@ -6685,17 +6838,17 @@ func (c *SSM) GetParameterRequest(input *GetParameterInput) (req *request.Reques // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation GetParameter for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidKeyId "InvalidKeyId" +// * InvalidKeyId // The query key ID is not valid. // -// * ErrCodeParameterNotFound "ParameterNotFound" +// * ParameterNotFound // The parameter could not be found. Verify the name and try again. // -// * ErrCodeParameterVersionNotFound "ParameterVersionNotFound" +// * ParameterVersionNotFound // The specified parameter version was not found. Verify the parameter name // and version, and try again. // @@ -6780,17 +6933,17 @@ func (c *SSM) GetParameterHistoryRequest(input *GetParameterHistoryInput) (req * // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeParameterNotFound "ParameterNotFound" +// * ParameterNotFound // The parameter could not be found. Verify the name and try again. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // -// * ErrCodeInvalidKeyId "InvalidKeyId" +// * InvalidKeyId // The query key ID is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParameterHistory @@ -6858,10 +7011,12 @@ func (c *SSM) GetParameterHistoryPagesWithContext(ctx aws.Context, input *GetPar }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetParameterHistoryOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetParameterHistoryOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -6919,11 +7074,11 @@ func (c *SSM) GetParametersRequest(input *GetParametersInput) (req *request.Requ // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation GetParameters for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidKeyId "InvalidKeyId" +// Returned Error Types: +// * InvalidKeyId // The query key ID is not valid. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParameters @@ -6998,9 +7153,7 @@ func (c *SSM) GetParametersByPathRequest(input *GetParametersByPathInput) (req * // GetParametersByPath API operation for Amazon Simple Systems Manager (SSM). // -// Retrieve parameters in a specific hierarchy. For more information, see Working -// with Systems Manager Parameters (http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-paramstore-working.html) -// in the AWS Systems Manager User Guide. +// Retrieve information about one or more parameters in a specific hierarchy. // // Request results are returned on a best-effort basis. If you specify MaxResults // in the request, the response includes information up to the limit specified. @@ -7010,8 +7163,6 @@ func (c *SSM) GetParametersByPathRequest(input *GetParametersByPathInput) (req * // that point and a NextToken. You can specify the NextToken in a subsequent // call to get the next set of results. // -// This API action doesn't support filtering by 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. @@ -7019,24 +7170,24 @@ func (c *SSM) GetParametersByPathRequest(input *GetParametersByPathInput) (req * // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation GetParametersByPath for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidFilterKey "InvalidFilterKey" +// * InvalidFilterKey // The specified key is not valid. // -// * ErrCodeInvalidFilterOption "InvalidFilterOption" +// * InvalidFilterOption // The specified filter option is not valid. Valid options are Equals and BeginsWith. // For Path filter, valid options are Recursive and OneLevel. // -// * ErrCodeInvalidFilterValue "InvalidFilterValue" +// * InvalidFilterValue // The filter value is not valid. Verify the value and try again. // -// * ErrCodeInvalidKeyId "InvalidKeyId" +// * InvalidKeyId // The query key ID is not valid. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetParametersByPath @@ -7104,10 +7255,12 @@ func (c *SSM) GetParametersByPathPagesWithContext(ctx aws.Context, input *GetPar }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetParametersByPathOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetParametersByPathOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7164,19 +7317,20 @@ func (c *SSM) GetPatchBaselineRequest(input *GetPatchBaselineInput) (req *reques // 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" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInvalidResourceId "InvalidResourceId" +// * InvalidResourceId // The resource ID is not valid. Verify that you entered the correct ID and // try again. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetPatchBaseline @@ -7255,8 +7409,8 @@ func (c *SSM) GetPatchBaselineForPatchGroupRequest(input *GetPatchBaselineForPat // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/GetPatchBaselineForPatchGroup @@ -7348,11 +7502,11 @@ func (c *SSM) GetServiceSettingRequest(input *GetServiceSettingInput) (req *requ // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation GetServiceSetting for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeServiceSettingNotFound "ServiceSettingNotFound" +// * ServiceSettingNotFound // The specified service setting was not found. Either the service name or the // setting has not been provisioned by the AWS service team. // @@ -7459,22 +7613,22 @@ func (c *SSM) LabelParameterVersionRequest(input *LabelParameterVersionInput) (r // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation LabelParameterVersion for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeTooManyUpdates "TooManyUpdates" +// * TooManyUpdates // There are concurrent updates for a resource that supports one update at a // time. // -// * ErrCodeParameterNotFound "ParameterNotFound" +// * ParameterNotFound // The parameter could not be found. Verify the name and try again. // -// * ErrCodeParameterVersionNotFound "ParameterVersionNotFound" +// * ParameterVersionNotFound // The specified parameter version was not found. Verify the parameter name // and version, and try again. // -// * ErrCodeParameterVersionLabelLimitExceeded "ParameterVersionLabelLimitExceeded" +// * ParameterVersionLabelLimitExceeded // A parameter version can have a maximum of ten labels. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/LabelParameterVersion @@ -7552,14 +7706,14 @@ func (c *SSM) ListAssociationVersionsRequest(input *ListAssociationVersionsInput // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation ListAssociationVersions for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // -// * ErrCodeAssociationDoesNotExist "AssociationDoesNotExist" +// * AssociationDoesNotExist // The specified association does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListAssociationVersions @@ -7634,7 +7788,9 @@ func (c *SSM) ListAssociationsRequest(input *ListAssociationsInput) (req *reques // ListAssociations API operation for Amazon Simple Systems Manager (SSM). // -// Lists the associations for the specified Systems Manager document or instance. +// Returns all State Manager associations in the current AWS account and Region. +// You can limit the results to a specific State Manager association document +// or instance by specifying a 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 @@ -7643,11 +7799,11 @@ func (c *SSM) ListAssociationsRequest(input *ListAssociationsInput) (req *reques // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListAssociations @@ -7715,10 +7871,12 @@ func (c *SSM) ListAssociationsPagesWithContext(ctx aws.Context, input *ListAssoc }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListAssociationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListAssociationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7785,13 +7943,13 @@ func (c *SSM) ListCommandInvocationsRequest(input *ListCommandInvocationsInput) // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidCommandId "InvalidCommandId" +// * InvalidCommandId // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -7803,10 +7961,10 @@ func (c *SSM) ListCommandInvocationsRequest(input *ListCommandInvocationsInput) // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeInvalidFilterKey "InvalidFilterKey" +// * InvalidFilterKey // The specified key is not valid. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListCommandInvocations @@ -7874,10 +8032,12 @@ func (c *SSM) ListCommandInvocationsPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCommandInvocationsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListCommandInvocationsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -7940,13 +8100,13 @@ func (c *SSM) ListCommandsRequest(input *ListCommandsInput) (req *request.Reques // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidCommandId "InvalidCommandId" +// * InvalidCommandId // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -7958,10 +8118,10 @@ func (c *SSM) ListCommandsRequest(input *ListCommandsInput) (req *request.Reques // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeInvalidFilterKey "InvalidFilterKey" +// * InvalidFilterKey // The specified key is not valid. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListCommands @@ -8029,10 +8189,12 @@ func (c *SSM) ListCommandsPagesWithContext(ctx aws.Context, input *ListCommandsI }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListCommandsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListCommandsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8092,23 +8254,23 @@ func (c *SSM) ListComplianceItemsRequest(input *ListComplianceItemsInput) (req * // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation ListComplianceItems for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidResourceType "InvalidResourceType" +// Returned Error Types: +// * InvalidResourceType // The resource type is not valid. For example, if you are attempting to tag // an instance, the instance must be a registered, managed instance. // -// * ErrCodeInvalidResourceId "InvalidResourceId" +// * InvalidResourceId // The resource ID is not valid. Verify that you entered the correct ID and // try again. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidFilter "InvalidFilter" +// * InvalidFilter // The filter name is not valid. Verify the you entered the correct name and // try again. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListComplianceItems @@ -8188,15 +8350,15 @@ func (c *SSM) ListComplianceSummariesRequest(input *ListComplianceSummariesInput // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation ListComplianceSummaries for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidFilter "InvalidFilter" +// Returned Error Types: +// * InvalidFilter // The filter name is not valid. Verify the you entered the correct name and // try again. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListComplianceSummaries @@ -8274,14 +8436,14 @@ func (c *SSM) ListDocumentVersionsRequest(input *ListDocumentVersionsInput) (req // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // -// * ErrCodeInvalidDocument "InvalidDocument" +// * InvalidDocument // The specified document does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListDocumentVersions @@ -8356,7 +8518,8 @@ func (c *SSM) ListDocumentsRequest(input *ListDocumentsInput) (req *request.Requ // ListDocuments API operation for Amazon Simple Systems Manager (SSM). // -// Describes one or more of your Systems Manager documents. +// Returns all Systems Manager (SSM) documents in the current AWS account and +// Region. You can limit the results of this request by using a 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 @@ -8365,14 +8528,14 @@ func (c *SSM) ListDocumentsRequest(input *ListDocumentsInput) (req *request.Requ // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // -// * ErrCodeInvalidFilterKey "InvalidFilterKey" +// * InvalidFilterKey // The specified key is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListDocuments @@ -8440,10 +8603,12 @@ func (c *SSM) ListDocumentsPagesWithContext(ctx aws.Context, input *ListDocument }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDocumentsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDocumentsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -8500,11 +8665,11 @@ func (c *SSM) ListInventoryEntriesRequest(input *ListInventoryEntriesInput) (req // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -8516,14 +8681,14 @@ func (c *SSM) ListInventoryEntriesRequest(input *ListInventoryEntriesInput) (req // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeInvalidTypeNameException "InvalidTypeNameException" +// * InvalidTypeNameException // The parameter type name is not valid. // -// * ErrCodeInvalidFilter "InvalidFilter" +// * InvalidFilter // The filter name is not valid. Verify the you entered the correct name and // try again. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListInventoryEntries @@ -8603,15 +8768,15 @@ func (c *SSM) ListResourceComplianceSummariesRequest(input *ListResourceComplian // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation ListResourceComplianceSummaries for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidFilter "InvalidFilter" +// Returned Error Types: +// * InvalidFilter // The filter name is not valid. Verify the you entered the correct name and // try again. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListResourceComplianceSummaries @@ -8698,11 +8863,14 @@ func (c *SSM) ListResourceDataSyncRequest(input *ListResourceDataSyncInput) (req // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation ListResourceDataSync for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * ResourceDataSyncInvalidConfigurationException +// The specified sync configuration is invalid. +// +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidNextToken "InvalidNextToken" +// * InvalidNextToken // The specified token is not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListResourceDataSync @@ -8780,16 +8948,16 @@ func (c *SSM) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req * // 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" +// Returned Error Types: +// * InvalidResourceType // The resource type is not valid. For example, if you are attempting to tag // an instance, the instance must be a registered, managed instance. // -// * ErrCodeInvalidResourceId "InvalidResourceId" +// * InvalidResourceId // The resource ID is not valid. Verify that you entered the correct ID and // try again. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ListTagsForResource @@ -8871,23 +9039,23 @@ func (c *SSM) ModifyDocumentPermissionRequest(input *ModifyDocumentPermissionInp // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidDocument "InvalidDocument" +// * InvalidDocument // The specified document does not exist. // -// * ErrCodeInvalidPermissionType "InvalidPermissionType" +// * InvalidPermissionType // The permission type is not supported. Share is the only supported permission // type. // -// * ErrCodeDocumentPermissionLimit "DocumentPermissionLimit" +// * 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" +// * DocumentLimitExceeded // You can have at most 500 active Systems Manager documents. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ModifyDocumentPermission @@ -9007,28 +9175,28 @@ func (c *SSM) PutComplianceItemsRequest(input *PutComplianceItemsInput) (req *re // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation PutComplianceItems for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidItemContentException "InvalidItemContentException" +// * InvalidItemContentException // One or more content items is not valid. // -// * ErrCodeTotalSizeLimitExceededException "TotalSizeLimitExceededException" +// * TotalSizeLimitExceededException // The size of inventory data has exceeded the total size limit for the resource. // -// * ErrCodeItemSizeLimitExceededException "ItemSizeLimitExceededException" +// * ItemSizeLimitExceededException // The inventory item size has exceeded the size limit. // -// * ErrCodeComplianceTypeCountLimitExceededException "ComplianceTypeCountLimitExceededException" +// * ComplianceTypeCountLimitExceededException // You specified too many custom compliance types. You can specify a maximum // of 10 different types. // -// * ErrCodeInvalidResourceType "InvalidResourceType" +// * InvalidResourceType // The resource type is not valid. For example, if you are attempting to tag // an instance, the instance must be a registered, managed instance. // -// * ErrCodeInvalidResourceId "InvalidResourceId" +// * InvalidResourceId // The resource ID is not valid. Verify that you entered the correct ID and // try again. // @@ -9109,11 +9277,11 @@ func (c *SSM) PutInventoryRequest(input *PutInventoryInput) (req *request.Reques // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -9125,40 +9293,40 @@ func (c *SSM) PutInventoryRequest(input *PutInventoryInput) (req *request.Reques // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeInvalidTypeNameException "InvalidTypeNameException" +// * InvalidTypeNameException // The parameter type name is not valid. // -// * ErrCodeInvalidItemContentException "InvalidItemContentException" +// * InvalidItemContentException // One or more content items is not valid. // -// * ErrCodeTotalSizeLimitExceededException "TotalSizeLimitExceededException" +// * TotalSizeLimitExceededException // The size of inventory data has exceeded the total size limit for the resource. // -// * ErrCodeItemSizeLimitExceededException "ItemSizeLimitExceededException" +// * ItemSizeLimitExceededException // The inventory item size has exceeded the size limit. // -// * ErrCodeItemContentMismatchException "ItemContentMismatchException" +// * ItemContentMismatchException // The inventory item has invalid content. // -// * ErrCodeCustomSchemaCountLimitExceededException "CustomSchemaCountLimitExceededException" +// * CustomSchemaCountLimitExceededException // You have exceeded the limit for custom schemas. Delete one or more custom // schemas and try again. // -// * ErrCodeUnsupportedInventorySchemaVersionException "UnsupportedInventorySchemaVersionException" +// * 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. // -// * ErrCodeUnsupportedInventoryItemContextException "UnsupportedInventoryItemContextException" +// * UnsupportedInventoryItemContextException // The Context attribute that you specified for the InventoryItem is not allowed // for this inventory type. You can only use the Context attribute with inventory // types like AWS:ComplianceItem. // -// * ErrCodeInvalidInventoryItemContextException "InvalidInventoryItemContextException" +// * InvalidInventoryItemContextException // You specified invalid keys or values in the Context attribute for InventoryItem. // Verify the keys and values, and try again. // -// * ErrCodeSubTypeCountLimitExceededException "SubTypeCountLimitExceededException" +// * SubTypeCountLimitExceededException // The sub-type count exceeded the limit for the inventory type. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/PutInventory @@ -9236,58 +9404,58 @@ func (c *SSM) PutParameterRequest(input *PutParameterInput) (req *request.Reques // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidKeyId "InvalidKeyId" +// * InvalidKeyId // The query key ID is not valid. // -// * ErrCodeParameterLimitExceeded "ParameterLimitExceeded" +// * ParameterLimitExceeded // You have exceeded the number of parameters for this AWS account. Delete one // or more parameters and try again. // -// * ErrCodeTooManyUpdates "TooManyUpdates" +// * TooManyUpdates // There are concurrent updates for a resource that supports one update at a // time. // -// * ErrCodeParameterAlreadyExists "ParameterAlreadyExists" +// * ParameterAlreadyExists // The parameter already exists. You can't create duplicate parameters. // -// * ErrCodeHierarchyLevelLimitExceededException "HierarchyLevelLimitExceededException" +// * HierarchyLevelLimitExceededException // A hierarchy can have a maximum of 15 levels. For more information, see Requirements // and Constraints for Parameter Names (http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-parameter-name-constraints.html) // in the AWS Systems Manager User Guide. // -// * ErrCodeHierarchyTypeMismatchException "HierarchyTypeMismatchException" +// * HierarchyTypeMismatchException // Parameter Store does not support changing a parameter type in a hierarchy. // For example, you can't change a parameter from a String type to a SecureString // type. You must create a new, unique parameter. // -// * ErrCodeInvalidAllowedPatternException "InvalidAllowedPatternException" +// * InvalidAllowedPatternException // The request does not meet the regular expression requirement. // -// * ErrCodeParameterMaxVersionLimitExceeded "ParameterMaxVersionLimitExceeded" +// * ParameterMaxVersionLimitExceeded // The parameter exceeded the maximum number of allowed versions. // -// * ErrCodeParameterPatternMismatchException "ParameterPatternMismatchException" +// * ParameterPatternMismatchException // The parameter name is not valid. // -// * ErrCodeUnsupportedParameterType "UnsupportedParameterType" +// * UnsupportedParameterType // The parameter type is not supported. // -// * ErrCodePoliciesLimitExceededException "PoliciesLimitExceededException" +// * PoliciesLimitExceededException // You specified more than the maximum number of allowed policies for the parameter. // The maximum is 10. // -// * ErrCodeInvalidPolicyTypeException "InvalidPolicyTypeException" +// * InvalidPolicyTypeException // The policy type is not supported. Parameter Store supports the following // policy types: Expiration, ExpirationNotification, and NoChangeNotification. // -// * ErrCodeInvalidPolicyAttributeException "InvalidPolicyAttributeException" +// * InvalidPolicyAttributeException // A policy attribute or its value is invalid. // -// * ErrCodeIncompatiblePolicyException "IncompatiblePolicyException" +// * IncompatiblePolicyException // There is a conflict in the policies specified for this parameter. You can't, // for example, specify two Expiration policies for a parameter. Review your // policies, and try again. @@ -9372,19 +9540,20 @@ func (c *SSM) RegisterDefaultPatchBaselineRequest(input *RegisterDefaultPatchBas // 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" +// Returned Error Types: +// * InvalidResourceId // The resource ID is not valid. Verify that you entered the correct ID and // try again. // -// * ErrCodeDoesNotExistException "DoesNotExistException" +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterDefaultPatchBaseline @@ -9462,30 +9631,32 @@ func (c *SSM) RegisterPatchBaselineForPatchGroupRequest(input *RegisterPatchBase // 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" +// Returned Error Types: +// * 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" +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInvalidResourceId "InvalidResourceId" +// * 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. +// * ResourceLimitExceededException +// Error returned when the caller has exceeded the default resource quotas. // For example, too many maintenance windows or patch baselines have been created. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterPatchBaselineForPatchGroup @@ -9563,26 +9734,28 @@ func (c *SSM) RegisterTargetWithMaintenanceWindowRequest(input *RegisterTargetWi // 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" +// Returned Error Types: +// * 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" +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" -// Error returned when the caller has exceeded the default resource limits. +// * ResourceLimitExceededException +// Error returned when the caller has exceeded the default resource quotas. // For example, too many maintenance windows or patch baselines have been created. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterTargetWithMaintenanceWindow @@ -9660,30 +9833,32 @@ func (c *SSM) RegisterTaskWithMaintenanceWindowRequest(input *RegisterTaskWithMa // 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" +// Returned Error Types: +// * 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" +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" -// Error returned when the caller has exceeded the default resource limits. +// * ResourceLimitExceededException +// Error returned when the caller has exceeded the default resource quotas. // For example, too many maintenance windows or patch baselines have been created. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeFeatureNotAvailableException "FeatureNotAvailableException" +// * FeatureNotAvailableException // You attempted to register a LAMBDA or STEP_FUNCTIONS task in a region where // the corresponding service is not available. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/RegisterTaskWithMaintenanceWindow @@ -9762,19 +9937,19 @@ func (c *SSM) RemoveTagsFromResourceRequest(input *RemoveTagsFromResourceInput) // 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" +// Returned Error Types: +// * InvalidResourceType // The resource type is not valid. For example, if you are attempting to tag // an instance, the instance must be a registered, managed instance. // -// * ErrCodeInvalidResourceId "InvalidResourceId" +// * InvalidResourceId // The resource ID is not valid. Verify that you entered the correct ID and // try again. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeTooManyUpdates "TooManyUpdates" +// * TooManyUpdates // There are concurrent updates for a resource that supports one update at a // time. // @@ -9868,15 +10043,15 @@ func (c *SSM) ResetServiceSettingRequest(input *ResetServiceSettingInput) (req * // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation ResetServiceSetting for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeServiceSettingNotFound "ServiceSettingNotFound" +// * ServiceSettingNotFound // The specified service setting was not found. Either the service name or the // setting has not been provisioned by the AWS service team. // -// * ErrCodeTooManyUpdates "TooManyUpdates" +// * TooManyUpdates // There are concurrent updates for a resource that supports one update at a // time. // @@ -9959,15 +10134,16 @@ func (c *SSM) ResumeSessionRequest(input *ResumeSessionInput) (req *request.Requ // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation ResumeSession for usage and error information. // -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/ResumeSession @@ -10047,19 +10223,19 @@ func (c *SSM) SendAutomationSignalRequest(input *SendAutomationSignalInput) (req // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation SendAutomationSignal for usage and error information. // -// Returned Error Codes: -// * ErrCodeAutomationExecutionNotFoundException "AutomationExecutionNotFoundException" +// Returned Error Types: +// * AutomationExecutionNotFoundException // There is no automation execution information for the requested automation // execution ID. // -// * ErrCodeAutomationStepNotFoundException "AutomationStepNotFoundException" +// * AutomationStepNotFoundException // The specified step name and execution ID don't exist. Verify the information // and try again. // -// * ErrCodeInvalidAutomationSignalException "InvalidAutomationSignalException" +// * InvalidAutomationSignalException // The signal is not valid for the current Automation execution. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/SendAutomationSignal @@ -10137,14 +10313,14 @@ func (c *SSM) SendCommandRequest(input *SendCommandInput) (req *request.Request, // 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" +// Returned Error Types: +// * DuplicateInstanceId // You cannot specify an instance ID in more than one association. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -10156,35 +10332,35 @@ func (c *SSM) SendCommandRequest(input *SendCommandInput) (req *request.Request, // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeInvalidDocument "InvalidDocument" +// * InvalidDocument // The specified document does not exist. // -// * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" +// * InvalidDocumentVersion // The document version is not valid or does not exist. // -// * ErrCodeInvalidOutputFolder "InvalidOutputFolder" +// * InvalidOutputFolder // The S3 bucket does not exist. // -// * ErrCodeInvalidParameters "InvalidParameters" +// * InvalidParameters // You must specify values for all required parameters in the Systems Manager // document. You can only supply values to parameters defined in the Systems // Manager document. // -// * ErrCodeUnsupportedPlatformType "UnsupportedPlatformType" +// * UnsupportedPlatformType // The document does not support the platform type of the given instance ID(s). // For example, you sent an document for a Windows instance to a Linux instance. // -// * ErrCodeMaxDocumentSizeExceeded "MaxDocumentSizeExceeded" +// * MaxDocumentSizeExceeded // The size limit of a document is 64 KB. // -// * ErrCodeInvalidRole "InvalidRole" +// * 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 Configuring Amazon SNS Notifications for Run Command (http://docs.aws.amazon.com/systems-manager/latest/userguide/rc-sns-notifications.html) // in the AWS Systems Manager User Guide. // -// * ErrCodeInvalidNotificationConfig "InvalidNotificationConfig" +// * InvalidNotificationConfig // One or more configuration items is not valid. Verify that a valid Amazon // Resource Name (ARN) was provided for an Amazon SNS topic. // @@ -10265,11 +10441,11 @@ func (c *SSM) StartAssociationsOnceRequest(input *StartAssociationsOnceInput) (r // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation StartAssociationsOnce for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidAssociation "InvalidAssociation" +// Returned Error Types: +// * InvalidAssociation // The association is not valid or does not exist. // -// * ErrCodeAssociationDoesNotExist "AssociationDoesNotExist" +// * AssociationDoesNotExist // The specified association does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StartAssociationsOnce @@ -10347,31 +10523,31 @@ func (c *SSM) StartAutomationExecutionRequest(input *StartAutomationExecutionInp // 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" +// Returned Error Types: +// * AutomationDefinitionNotFoundException // An Automation document with the specified name could not be found. // -// * ErrCodeInvalidAutomationExecutionParametersException "InvalidAutomationExecutionParametersException" +// * 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" +// * AutomationExecutionLimitExceededException // The number of simultaneously running Automation executions exceeded the allowable // limit. // -// * ErrCodeAutomationDefinitionVersionNotFoundException "AutomationDefinitionVersionNotFoundException" +// * AutomationDefinitionVersionNotFoundException // An Automation document with the specified name and version could not be found. // -// * ErrCodeIdempotentParameterMismatch "IdempotentParameterMismatch" +// * 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. // -// * ErrCodeInvalidTarget "InvalidTarget" +// * 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. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StartAutomationExecution @@ -10449,6 +10625,9 @@ func (c *SSM) StartSessionRequest(input *StartSessionInput) (req *request.Reques // For information, see Install the Session Manager Plugin for the AWS CLI (http://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html) // in the AWS Systems Manager User Guide. // +// AWS Tools for PowerShell usage: Start-SSMSession is not currently supported +// by AWS Tools for PowerShell on Windows local machines. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -10456,17 +10635,17 @@ func (c *SSM) StartSessionRequest(input *StartSessionInput) (req *request.Reques // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation StartSession for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidDocument "InvalidDocument" +// Returned Error Types: +// * InvalidDocument // The specified document does not exist. // -// * ErrCodeTargetNotConnected "TargetNotConnected" +// * TargetNotConnected // The specified target instance for the session is not fully configured for // use with Session Manager. For more information, see Getting Started with // Session Manager (http://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started.html) // in the AWS Systems Manager User Guide. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StartSession @@ -10545,15 +10724,15 @@ func (c *SSM) StopAutomationExecutionRequest(input *StopAutomationExecutionInput // 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" +// Returned Error Types: +// * AutomationExecutionNotFoundException // There is no automation execution information for the requested automation // execution ID. // -// * ErrCodeInvalidAutomationStatusUpdateException "InvalidAutomationStatusUpdateException" +// * InvalidAutomationStatusUpdateException // The specified update status operation is not valid. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/StopAutomationExecution @@ -10633,15 +10812,16 @@ func (c *SSM) TerminateSessionRequest(input *TerminateSessionInput) (req *reques // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation TerminateSession for usage and error information. // -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/TerminateSession @@ -10730,47 +10910,47 @@ func (c *SSM) UpdateAssociationRequest(input *UpdateAssociationInput) (req *requ // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidSchedule "InvalidSchedule" +// * InvalidSchedule // The schedule is invalid. Verify your cron or rate expression and try again. // -// * ErrCodeInvalidParameters "InvalidParameters" +// * InvalidParameters // You must specify values for all required parameters in the Systems Manager // document. You can only supply values to parameters defined in the Systems // Manager document. // -// * ErrCodeInvalidOutputLocation "InvalidOutputLocation" +// * InvalidOutputLocation // The output location is not valid or does not exist. // -// * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" +// * InvalidDocumentVersion // The document version is not valid or does not exist. // -// * ErrCodeAssociationDoesNotExist "AssociationDoesNotExist" +// * AssociationDoesNotExist // The specified association does not exist. // -// * ErrCodeInvalidUpdate "InvalidUpdate" +// * InvalidUpdate // The update is not valid. // -// * ErrCodeTooManyUpdates "TooManyUpdates" +// * TooManyUpdates // There are concurrent updates for a resource that supports one update at a // time. // -// * ErrCodeInvalidDocument "InvalidDocument" +// * InvalidDocument // The specified document does not exist. // -// * ErrCodeInvalidTarget "InvalidTarget" +// * 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. // -// * ErrCodeInvalidAssociationVersion "InvalidAssociationVersion" +// * InvalidAssociationVersion // The version you specified is not valid. Use ListAssociationVersions to view // all versions of an association according to the association ID. Or, use the // $LATEST parameter to view the latest version of the association. // -// * ErrCodeAssociationVersionLimitExceeded "AssociationVersionLimitExceeded" +// * AssociationVersionLimitExceeded // You have reached the maximum number versions allowed for an association. // Each association has a limit of 1,000 versions. // @@ -10850,11 +11030,11 @@ func (c *SSM) UpdateAssociationStatusRequest(input *UpdateAssociationStatusInput // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidInstanceId "InvalidInstanceId" +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -10866,16 +11046,16 @@ func (c *SSM) UpdateAssociationStatusRequest(input *UpdateAssociationStatusInput // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeInvalidDocument "InvalidDocument" +// * InvalidDocument // The specified document does not exist. // -// * ErrCodeAssociationDoesNotExist "AssociationDoesNotExist" +// * AssociationDoesNotExist // The specified association does not exist. // -// * ErrCodeStatusUnchanged "StatusUnchanged" +// * StatusUnchanged // The updated status is the same as the current status. // -// * ErrCodeTooManyUpdates "TooManyUpdates" +// * TooManyUpdates // There are concurrent updates for a resource that supports one update at a // time. // @@ -10954,38 +11134,38 @@ func (c *SSM) UpdateDocumentRequest(input *UpdateDocumentInput) (req *request.Re // 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" +// Returned Error Types: +// * MaxDocumentSizeExceeded // The size limit of a document is 64 KB. // -// * ErrCodeDocumentVersionLimitExceeded "DocumentVersionLimitExceeded" +// * DocumentVersionLimitExceeded // The document has too many versions. Delete one or more document versions // and try again. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeDuplicateDocumentContent "DuplicateDocumentContent" +// * DuplicateDocumentContent // The content of the association document matches another document. Change // the content of the document and try again. // -// * ErrCodeDuplicateDocumentVersionName "DuplicateDocumentVersionName" +// * DuplicateDocumentVersionName // The version name has already been used in this document. Specify a different // version name, and then try again. // -// * ErrCodeInvalidDocumentContent "InvalidDocumentContent" +// * InvalidDocumentContent // The content for the document is not valid. // -// * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" +// * InvalidDocumentVersion // The document version is not valid or does not exist. // -// * ErrCodeInvalidDocumentSchemaVersion "InvalidDocumentSchemaVersion" +// * InvalidDocumentSchemaVersion // The version of the document schema is not supported. // -// * ErrCodeInvalidDocument "InvalidDocument" +// * InvalidDocument // The specified document does not exist. // -// * ErrCodeInvalidDocumentOperation "InvalidDocumentOperation" +// * InvalidDocumentOperation // You attempted to delete a document while it is still shared. You must stop // sharing the document before you can delete it. // @@ -11064,17 +11244,17 @@ func (c *SSM) UpdateDocumentDefaultVersionRequest(input *UpdateDocumentDefaultVe // 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" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeInvalidDocument "InvalidDocument" +// * InvalidDocument // The specified document does not exist. // -// * ErrCodeInvalidDocumentVersion "InvalidDocumentVersion" +// * InvalidDocumentVersion // The document version is not valid or does not exist. // -// * ErrCodeInvalidDocumentSchemaVersion "InvalidDocumentSchemaVersion" +// * InvalidDocumentSchemaVersion // The version of the document schema is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateDocumentDefaultVersion @@ -11145,6 +11325,13 @@ func (c *SSM) UpdateMaintenanceWindowRequest(input *UpdateMaintenanceWindowInput // // Updates an existing maintenance window. Only specified parameters are modified. // +// The value you specify for Duration determines the specific end time for the +// maintenance window based on the time it begins. No maintenance window tasks +// are permitted to start after the resulting endtime minus the number of hours +// you specify for Cutoff. For example, if the maintenance window starts at +// 3 PM, the duration is three hours, and the value you specify for Cutoff is +// one hour, no maintenance window tasks can start after 5 PM. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -11152,15 +11339,16 @@ func (c *SSM) UpdateMaintenanceWindowRequest(input *UpdateMaintenanceWindowInput // 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" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateMaintenanceWindow @@ -11255,15 +11443,16 @@ func (c *SSM) UpdateMaintenanceWindowTargetRequest(input *UpdateMaintenanceWindo // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation UpdateMaintenanceWindowTarget for usage and error information. // -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateMaintenanceWindowTarget @@ -11360,15 +11549,16 @@ func (c *SSM) UpdateMaintenanceWindowTaskRequest(input *UpdateMaintenanceWindowT // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation UpdateMaintenanceWindowTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeDoesNotExistException "DoesNotExistException" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateMaintenanceWindowTask @@ -11448,8 +11638,8 @@ func (c *SSM) UpdateManagedInstanceRoleRequest(input *UpdateManagedInstanceRoleI // 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" +// Returned Error Types: +// * InvalidInstanceId // The following problems can cause this exception: // // You do not have permission to access the instance. @@ -11461,7 +11651,7 @@ func (c *SSM) UpdateManagedInstanceRoleRequest(input *UpdateManagedInstanceRoleI // The instance is not in valid state. Valid states are: Running, Pending, Stopped, // Stopping. Invalid states are: Shutting-down and Terminated. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateManagedInstanceRole @@ -11549,21 +11739,21 @@ func (c *SSM) UpdateOpsItemRequest(input *UpdateOpsItemInput) (req *request.Requ // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation UpdateOpsItem for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeOpsItemNotFoundException "OpsItemNotFoundException" +// * OpsItemNotFoundException // The specified OpsItem ID doesn't exist. Verify the ID and try again. // -// * ErrCodeOpsItemAlreadyExistsException "OpsItemAlreadyExistsException" +// * OpsItemAlreadyExistsException // The OpsItem already exists. // -// * ErrCodeOpsItemLimitExceededException "OpsItemLimitExceededException" -// The request caused OpsItems to exceed one or more limits. For information -// about OpsItem limits, see What are the resource limits for OpsCenter? (http://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-learn-more.html#OpsCenter-learn-more-limits). +// * OpsItemLimitExceededException +// The request caused OpsItems to exceed one or more quotas. For information +// about OpsItem quotas, see What are the resource limits for OpsCenter? (http://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-learn-more.html#OpsCenter-learn-more-limits). // -// * ErrCodeOpsItemInvalidParameterException "OpsItemInvalidParameterException" +// * OpsItemInvalidParameterException // A specified parameter argument isn't valid. Verify the available arguments // and try again. // @@ -11646,15 +11836,16 @@ func (c *SSM) UpdatePatchBaselineRequest(input *UpdatePatchBaselineInput) (req * // 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" +// Returned Error Types: +// * DoesNotExistException // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // -// For information about resource limits in Systems Manager, see AWS Systems -// Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An error occurred on the server side. // // See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdatePatchBaseline @@ -11679,6 +11870,101 @@ func (c *SSM) UpdatePatchBaselineWithContext(ctx aws.Context, input *UpdatePatch return out, req.Send() } +const opUpdateResourceDataSync = "UpdateResourceDataSync" + +// UpdateResourceDataSyncRequest generates a "aws/request.Request" representing the +// client's request for the UpdateResourceDataSync operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateResourceDataSync for more information on using the UpdateResourceDataSync +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateResourceDataSyncRequest method. +// req, resp := client.UpdateResourceDataSyncRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateResourceDataSync +func (c *SSM) UpdateResourceDataSyncRequest(input *UpdateResourceDataSyncInput) (req *request.Request, output *UpdateResourceDataSyncOutput) { + op := &request.Operation{ + Name: opUpdateResourceDataSync, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateResourceDataSyncInput{} + } + + output = &UpdateResourceDataSyncOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateResourceDataSync API operation for Amazon Simple Systems Manager (SSM). +// +// Update a resource data sync. After you create a resource data sync for a +// Region, you can't change the account options for that sync. For example, +// if you create a sync in the us-east-2 (Ohio) Region and you choose the Include +// only the current account option, you can't edit that sync later and choose +// the Include all accounts from my AWS Organizations configuration option. +// Instead, you must delete the first resource data sync, and create 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 Simple Systems Manager (SSM)'s +// API operation UpdateResourceDataSync for usage and error information. +// +// Returned Error Types: +// * ResourceDataSyncNotFoundException +// The specified sync name was not found. +// +// * ResourceDataSyncInvalidConfigurationException +// The specified sync configuration is invalid. +// +// * ResourceDataSyncConflictException +// Another UpdateResourceDataSync request is being processed. Wait a few minutes +// and try again. +// +// * InternalServerError +// An error occurred on the server side. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/ssm-2014-11-06/UpdateResourceDataSync +func (c *SSM) UpdateResourceDataSync(input *UpdateResourceDataSyncInput) (*UpdateResourceDataSyncOutput, error) { + req, out := c.UpdateResourceDataSyncRequest(input) + return out, req.Send() +} + +// UpdateResourceDataSyncWithContext is the same as UpdateResourceDataSync with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateResourceDataSync for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *SSM) UpdateResourceDataSyncWithContext(ctx aws.Context, input *UpdateResourceDataSyncInput, opts ...request.Option) (*UpdateResourceDataSyncOutput, error) { + req, out := c.UpdateResourceDataSyncRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opUpdateServiceSetting = "UpdateServiceSetting" // UpdateServiceSettingRequest generates a "aws/request.Request" representing the @@ -11747,15 +12033,15 @@ func (c *SSM) UpdateServiceSettingRequest(input *UpdateServiceSettingInput) (req // See the AWS API reference guide for Amazon Simple Systems Manager (SSM)'s // API operation UpdateServiceSetting for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalServerError "InternalServerError" +// Returned Error Types: +// * InternalServerError // An error occurred on the server side. // -// * ErrCodeServiceSettingNotFound "ServiceSettingNotFound" +// * ServiceSettingNotFound // The specified service setting was not found. Either the service name or the // setting has not been provisioned by the AWS service team. // -// * ErrCodeTooManyUpdates "TooManyUpdates" +// * TooManyUpdates // There are concurrent updates for a resource that supports one update at a // time. // @@ -11781,6 +12067,40 @@ func (c *SSM) UpdateServiceSettingWithContext(ctx aws.Context, input *UpdateServ return out, req.Send() } +// Information includes the AWS account ID where the current document is shared +// and the version shared with that account. +type AccountSharingInfo struct { + _ struct{} `type:"structure"` + + // The AWS account ID where the current document is shared. + AccountId *string `type:"string"` + + // The version of the current document shared with the account. + SharedDocumentVersion *string `type:"string"` +} + +// String returns the string representation +func (s AccountSharingInfo) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountSharingInfo) GoString() string { + return s.String() +} + +// SetAccountId sets the AccountId field's value. +func (s *AccountSharingInfo) SetAccountId(v string) *AccountSharingInfo { + s.AccountId = &v + return s +} + +// SetSharedDocumentVersion sets the SharedDocumentVersion field's value. +func (s *AccountSharingInfo) SetSharedDocumentVersion(v string) *AccountSharingInfo { + s.SharedDocumentVersion = &v + return s +} + // 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. @@ -12002,6 +12322,120 @@ func (s AddTagsToResourceOutput) GoString() string { return s.String() } +// 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. +type AlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorAlreadyExistsException(v protocol.ResponseMetadata) error { + return &AlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AlreadyExistsException) Code() string { + return "AlreadyExistsException" +} + +// Message returns the exception's message. +func (s AlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AlreadyExistsException) OrigErr() error { + return nil +} + +func (s AlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// You must disassociate a document from all instances before you can delete +// it. +type AssociatedInstances struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AssociatedInstances) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociatedInstances) GoString() string { + return s.String() +} + +func newErrorAssociatedInstances(v protocol.ResponseMetadata) error { + return &AssociatedInstances{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AssociatedInstances) Code() string { + return "AssociatedInstances" +} + +// Message returns the exception's message. +func (s AssociatedInstances) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AssociatedInstances) OrigErr() error { + return nil +} + +func (s AssociatedInstances) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AssociatedInstances) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AssociatedInstances) RequestID() string { + return s.respMetadata.RequestID +} + // Describes an association of a Systems Manager document and an instance. type Association struct { _ struct{} `type:"structure"` @@ -12108,6 +12542,62 @@ func (s *Association) SetTargets(v []*Target) *Association { return s } +// The specified association already exists. +type AssociationAlreadyExists struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AssociationAlreadyExists) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociationAlreadyExists) GoString() string { + return s.String() +} + +func newErrorAssociationAlreadyExists(v protocol.ResponseMetadata) error { + return &AssociationAlreadyExists{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AssociationAlreadyExists) Code() string { + return "AssociationAlreadyExists" +} + +// Message returns the exception's message. +func (s AssociationAlreadyExists) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AssociationAlreadyExists) OrigErr() error { + return nil +} + +func (s AssociationAlreadyExists) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AssociationAlreadyExists) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AssociationAlreadyExists) RequestID() string { + return s.respMetadata.RequestID +} + // Describes the parameters for a document. type AssociationDescription struct { _ struct{} `type:"structure"` @@ -12324,6 +12814,62 @@ func (s *AssociationDescription) SetTargets(v []*Target) *AssociationDescription return s } +// The specified association does not exist. +type AssociationDoesNotExist struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AssociationDoesNotExist) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociationDoesNotExist) GoString() string { + return s.String() +} + +func newErrorAssociationDoesNotExist(v protocol.ResponseMetadata) error { + return &AssociationDoesNotExist{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AssociationDoesNotExist) Code() string { + return "AssociationDoesNotExist" +} + +// Message returns the exception's message. +func (s AssociationDoesNotExist) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AssociationDoesNotExist) OrigErr() error { + return nil +} + +func (s AssociationDoesNotExist) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AssociationDoesNotExist) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AssociationDoesNotExist) RequestID() string { + return s.respMetadata.RequestID +} + // Includes information about the specified association. type AssociationExecution struct { _ struct{} `type:"structure"` @@ -12412,6 +12958,62 @@ func (s *AssociationExecution) SetStatus(v string) *AssociationExecution { return s } +// The specified execution ID does not exist. Verify the ID number and try again. +type AssociationExecutionDoesNotExist struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AssociationExecutionDoesNotExist) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociationExecutionDoesNotExist) GoString() string { + return s.String() +} + +func newErrorAssociationExecutionDoesNotExist(v protocol.ResponseMetadata) error { + return &AssociationExecutionDoesNotExist{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AssociationExecutionDoesNotExist) Code() string { + return "AssociationExecutionDoesNotExist" +} + +// Message returns the exception's message. +func (s AssociationExecutionDoesNotExist) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AssociationExecutionDoesNotExist) OrigErr() error { + return nil +} + +func (s AssociationExecutionDoesNotExist) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AssociationExecutionDoesNotExist) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AssociationExecutionDoesNotExist) RequestID() string { + return s.respMetadata.RequestID +} + // Filters used in the request. type AssociationExecutionFilter struct { _ struct{} `type:"structure"` @@ -12690,6 +13292,62 @@ func (s *AssociationFilter) SetValue(v string) *AssociationFilter { return s } +// You can have at most 2,000 active associations. +type AssociationLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AssociationLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociationLimitExceeded) GoString() string { + return s.String() +} + +func newErrorAssociationLimitExceeded(v protocol.ResponseMetadata) error { + return &AssociationLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AssociationLimitExceeded) Code() string { + return "AssociationLimitExceeded" +} + +// Message returns the exception's message. +func (s AssociationLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AssociationLimitExceeded) OrigErr() error { + return nil +} + +func (s AssociationLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AssociationLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AssociationLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + // Information about the association. type AssociationOverview struct { _ struct{} `type:"structure"` @@ -12970,6 +13628,63 @@ func (s *AssociationVersionInfo) SetTargets(v []*Target) *AssociationVersionInfo return s } +// You have reached the maximum number versions allowed for an association. +// Each association has a limit of 1,000 versions. +type AssociationVersionLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AssociationVersionLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociationVersionLimitExceeded) GoString() string { + return s.String() +} + +func newErrorAssociationVersionLimitExceeded(v protocol.ResponseMetadata) error { + return &AssociationVersionLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AssociationVersionLimitExceeded) Code() string { + return "AssociationVersionLimitExceeded" +} + +// Message returns the exception's message. +func (s AssociationVersionLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AssociationVersionLimitExceeded) OrigErr() error { + return nil +} + +func (s AssociationVersionLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AssociationVersionLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AssociationVersionLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + // A structure that includes attributes that describe a document attachment. type AttachmentContent struct { _ struct{} `type:"structure"` @@ -13054,16 +13769,35 @@ func (s *AttachmentInformation) SetName(v string) *AttachmentInformation { return s } -// A key and value pair that identifies the location of an attachment to a document. +// Identifying information about a document attachment, including the file name +// and a key-value pair that identifies the location of an attachment to a document. type AttachmentsSource struct { _ struct{} `type:"structure"` - // The key of a key and value pair that identifies the location of an attachment + // The key of a key-value pair that identifies the location of an attachment // to a document. Key *string `type:"string" enum:"AttachmentsSourceKey"` - // The URL of the location of a document attachment, such as the URL of an Amazon - // S3 bucket. + // The name of the document attachment file. + Name *string `type:"string"` + + // The value of a key-value pair that identifies the location of an attachment + // to a document. The format for Value depends on the type of key you specify. + // + // * For the key SourceUrl, the value is an S3 bucket location. For example: + // "Values": [ "s3://my-bucket/my-folder" ] + // + // * For the key S3FileUrl, the value is a file in an S3 bucket. For example: + // "Values": [ "s3://my-bucket/my-folder/my-file.py" ] + // + // * For the key AttachmentReference, the value is constructed from the name + // of another SSM document in your account, a version number of that document, + // and a file attached to that document version that you want to reuse. For + // example: "Values": [ "MyOtherDocument/3/my-other-file.py" ] However, if + // the SSM document is shared with you from another account, the full SSM + // document ARN must be specified instead of the document name only. For + // example: "Values": [ "arn:aws:ssm:us-east-2:111122223333:document/OtherAccountDocument/3/their-file.py" + // ] Values []*string `min:"1" type:"list"` } @@ -13096,12 +13830,130 @@ func (s *AttachmentsSource) SetKey(v string) *AttachmentsSource { return s } +// SetName sets the Name field's value. +func (s *AttachmentsSource) SetName(v string) *AttachmentsSource { + s.Name = &v + return s +} + // SetValues sets the Values field's value. func (s *AttachmentsSource) SetValues(v []*string) *AttachmentsSource { s.Values = v return s } +// An Automation document with the specified name could not be found. +type AutomationDefinitionNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AutomationDefinitionNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutomationDefinitionNotFoundException) GoString() string { + return s.String() +} + +func newErrorAutomationDefinitionNotFoundException(v protocol.ResponseMetadata) error { + return &AutomationDefinitionNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AutomationDefinitionNotFoundException) Code() string { + return "AutomationDefinitionNotFoundException" +} + +// Message returns the exception's message. +func (s AutomationDefinitionNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AutomationDefinitionNotFoundException) OrigErr() error { + return nil +} + +func (s AutomationDefinitionNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AutomationDefinitionNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AutomationDefinitionNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// An Automation document with the specified name and version could not be found. +type AutomationDefinitionVersionNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AutomationDefinitionVersionNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutomationDefinitionVersionNotFoundException) GoString() string { + return s.String() +} + +func newErrorAutomationDefinitionVersionNotFoundException(v protocol.ResponseMetadata) error { + return &AutomationDefinitionVersionNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AutomationDefinitionVersionNotFoundException) Code() string { + return "AutomationDefinitionVersionNotFoundException" +} + +// Message returns the exception's message. +func (s AutomationDefinitionVersionNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AutomationDefinitionVersionNotFoundException) OrigErr() error { + return nil +} + +func (s AutomationDefinitionVersionNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AutomationDefinitionVersionNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AutomationDefinitionVersionNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // Detailed information about the current state of an individual Automation // execution. type AutomationExecution struct { @@ -13410,6 +14262,63 @@ func (s *AutomationExecutionFilter) SetValues(v []*string) *AutomationExecutionF return s } +// The number of simultaneously running Automation executions exceeded the allowable +// limit. +type AutomationExecutionLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AutomationExecutionLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutomationExecutionLimitExceededException) GoString() string { + return s.String() +} + +func newErrorAutomationExecutionLimitExceededException(v protocol.ResponseMetadata) error { + return &AutomationExecutionLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AutomationExecutionLimitExceededException) Code() string { + return "AutomationExecutionLimitExceededException" +} + +// Message returns the exception's message. +func (s AutomationExecutionLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AutomationExecutionLimitExceededException) OrigErr() error { + return nil +} + +func (s AutomationExecutionLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AutomationExecutionLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AutomationExecutionLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Details about a specific Automation execution. type AutomationExecutionMetadata struct { _ struct{} `type:"structure"` @@ -13417,8 +14326,7 @@ type AutomationExecutionMetadata struct { // The execution ID. AutomationExecutionId *string `min:"36" type:"string"` - // The status of the execution. Valid values include: Running, Succeeded, Failed, - // Timed out, or Cancelled. + // The status of the execution. AutomationExecutionStatus *string `type:"string" enum:"AutomationExecutionStatus"` // Use this filter with DescribeAutomationExecutions. Specify either Local or @@ -13447,7 +14355,7 @@ type AutomationExecutionMetadata struct { // still in progress. ExecutionEndTime *time.Time `type:"timestamp"` - // The time the execution started.> + // The time the execution started. ExecutionStartTime *time.Time `type:"timestamp"` // The list of execution outputs as defined in the Automation document. @@ -13629,6 +14537,120 @@ func (s *AutomationExecutionMetadata) SetTargets(v []*Target) *AutomationExecuti return s } +// There is no automation execution information for the requested automation +// execution ID. +type AutomationExecutionNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AutomationExecutionNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutomationExecutionNotFoundException) GoString() string { + return s.String() +} + +func newErrorAutomationExecutionNotFoundException(v protocol.ResponseMetadata) error { + return &AutomationExecutionNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AutomationExecutionNotFoundException) Code() string { + return "AutomationExecutionNotFoundException" +} + +// Message returns the exception's message. +func (s AutomationExecutionNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AutomationExecutionNotFoundException) OrigErr() error { + return nil +} + +func (s AutomationExecutionNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AutomationExecutionNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AutomationExecutionNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified step name and execution ID don't exist. Verify the information +// and try again. +type AutomationStepNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s AutomationStepNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AutomationStepNotFoundException) GoString() string { + return s.String() +} + +func newErrorAutomationStepNotFoundException(v protocol.ResponseMetadata) error { + return &AutomationStepNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AutomationStepNotFoundException) Code() string { + return "AutomationStepNotFoundException" +} + +// Message returns the exception's message. +func (s AutomationStepNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AutomationStepNotFoundException) OrigErr() error { + return nil +} + +func (s AutomationStepNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AutomationStepNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AutomationStepNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + type CancelCommandInput struct { _ struct{} `type:"structure"` @@ -14658,7 +15680,7 @@ type ComplianceItem struct { // An ID for the compliance item. For example, if the compliance item is a Windows // patch, the ID could be the number of the KB article; for example: KB4010320. - Id *string `min:"1" type:"string"` + Id *string `type:"string"` // An ID for the resource. For a managed instance, this is the instance ID. ResourceId *string `min:"1" type:"string"` @@ -14753,7 +15775,7 @@ type ComplianceItemEntry struct { // The compliance item ID. For example, if the compliance item is a Windows // patch, the ID could be the number of the KB article. - Id *string `min:"1" type:"string"` + Id *string `type:"string"` // The severity of the compliance status. Severity can be one of the following: // Critical, High, Medium, Low, Informational, Unspecified. @@ -14785,9 +15807,6 @@ func (s ComplianceItemEntry) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *ComplianceItemEntry) Validate() error { invalidParams := request.ErrInvalidParams{Context: "ComplianceItemEntry"} - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } if s.Severity == nil { invalidParams.Add(request.NewErrParamRequired("Severity")) } @@ -14933,6 +15952,63 @@ func (s *ComplianceSummaryItem) SetNonCompliantSummary(v *NonCompliantSummary) * return s } +// You specified too many custom compliance types. You can specify a maximum +// of 10 different types. +type ComplianceTypeCountLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ComplianceTypeCountLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ComplianceTypeCountLimitExceededException) GoString() string { + return s.String() +} + +func newErrorComplianceTypeCountLimitExceededException(v protocol.ResponseMetadata) error { + return &ComplianceTypeCountLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ComplianceTypeCountLimitExceededException) Code() string { + return "ComplianceTypeCountLimitExceededException" +} + +// Message returns the exception's message. +func (s ComplianceTypeCountLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ComplianceTypeCountLimitExceededException) OrigErr() error { + return nil +} + +func (s ComplianceTypeCountLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ComplianceTypeCountLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ComplianceTypeCountLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // A summary of resources that are compliant. The summary is organized according // to the resource count for each compliance type. type CompliantSummary struct { @@ -14970,14 +16046,15 @@ func (s *CompliantSummary) SetSeveritySummary(v *SeveritySummary) *CompliantSumm 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. + // The name of the registered, managed instance as it will appear in the Systems + // Manager console or when you use the AWS command line tools to list Systems + // Manager resources. // // Do not enter personally identifiable information in this field. DefaultInstanceName *string `type:"string"` // A user-defined description of the resource that you want to register with - // Amazon EC2. + // Systems Manager. // // Do not enter personally identifiable information in this field. Description *string `type:"string"` @@ -14987,7 +16064,10 @@ type CreateActivationInput struct { ExpirationDate *time.Time `type:"timestamp"` // The Amazon Identity and Access Management (IAM) role that you want to assign - // to the managed instance. + // to the managed instance. This IAM role must provide AssumeRole permissions + // for the Systems Manager service principal ssm.amazonaws.com. For more information, + // see Create an IAM Service Role for a Hybrid Environment (http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-service-role.html) + // in the AWS Systems Manager User Guide. // // IamRole is a required field IamRole *string `type:"string" required:"true"` @@ -15433,10 +16513,11 @@ type CreateAssociationInput struct { // The instance ID. // // InstanceId has been deprecated. To specify an instance ID for an association, - // use the Targets parameter. If you use the parameter InstanceId, you cannot - // use the parameters AssociationName, DocumentVersion, MaxErrors, MaxConcurrency, - // OutputLocation, or ScheduleExpression. To use these parameters, you must - // use the Targets parameter. + // use the Targets parameter. Requests that include the parameter InstanceID + // with SSM documents that use schema version 2.0 or later will fail. In addition, + // if you use the parameter InstanceId, you cannot use the parameters AssociationName, + // DocumentVersion, MaxErrors, MaxConcurrency, OutputLocation, or ScheduleExpression. + // To use these parameters, you must use the Targets parameter. InstanceId *string `type:"string"` // The maximum number of targets allowed to run the association at the same @@ -15658,12 +16739,11 @@ type CreateDocumentInput struct { // Content is a required field Content *string `min:"1" type:"string" required:"true"` - // Specify the document format for the request. The document format can be either - // JSON or YAML. JSON is the default format. + // Specify the document format for the request. The document format can be JSON, + // YAML, or TEXT. JSON is the default format. DocumentFormat *string `type:"string" enum:"DocumentFormat"` - // The type of document to create. Valid document types include: Command, Policy, - // Automation, Session, and Package. + // The type of document to create. DocumentType *string `type:"string" enum:"DocumentType"` // A name for the Systems Manager document. @@ -15680,6 +16760,10 @@ type CreateDocumentInput struct { // Name is a required field Name *string `type:"string" required:"true"` + // A list of SSM documents required by a document. For example, an ApplicationConfiguration + // document requires an ApplicationConfigurationSchema document. + Requires []*DocumentRequires `min:"1" type:"list"` + // Optional metadata that you assign to a resource. Tags enable you to categorize // a resource in different ways, such as by purpose, owner, or environment. // For example, you might want to tag an SSM document to identify the types @@ -15730,6 +16814,9 @@ func (s *CreateDocumentInput) Validate() error { if s.Name == nil { invalidParams.Add(request.NewErrParamRequired("Name")) } + if s.Requires != nil && len(s.Requires) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Requires", 1)) + } if s.Attachments != nil { for i, v := range s.Attachments { if v == nil { @@ -15740,6 +16827,16 @@ func (s *CreateDocumentInput) Validate() error { } } } + if s.Requires != nil { + for i, v := range s.Requires { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Requires", i), err.(request.ErrInvalidParams)) + } + } + } if s.Tags != nil { for i, v := range s.Tags { if v == nil { @@ -15787,6 +16884,12 @@ func (s *CreateDocumentInput) SetName(v string) *CreateDocumentInput { return s } +// SetRequires sets the Requires field's value. +func (s *CreateDocumentInput) SetRequires(v []*DocumentRequires) *CreateDocumentInput { + s.Requires = v + return s +} + // SetTags sets the Tags field's value. func (s *CreateDocumentInput) SetTags(v []*Tag) *CreateDocumentInput { s.Tags = v @@ -16055,6 +17158,9 @@ func (s *CreateMaintenanceWindowOutput) SetWindowId(v string) *CreateMaintenance type CreateOpsItemInput struct { _ struct{} `type:"structure"` + // Specify a category to assign to an OpsItem. + Category *string `min:"1" type:"string"` + // Information about the OpsItem. // // Description is a required field @@ -16095,6 +17201,9 @@ type CreateOpsItemInput struct { // impacted resources, or statuses for the impacted resource. RelatedOpsItems []*RelatedOpsItem `type:"list"` + // Specify a severity to assign to an OpsItem. + Severity *string `min:"1" type:"string"` + // The origin of the OpsItem, such as Amazon EC2 or AWS Systems Manager. // // Source is a required field @@ -16132,6 +17241,9 @@ func (s CreateOpsItemInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *CreateOpsItemInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "CreateOpsItemInput"} + if s.Category != nil && len(*s.Category) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Category", 1)) + } if s.Description == nil { invalidParams.Add(request.NewErrParamRequired("Description")) } @@ -16141,6 +17253,9 @@ func (s *CreateOpsItemInput) Validate() error { if s.Priority != nil && *s.Priority < 1 { invalidParams.Add(request.NewErrParamMinValue("Priority", 1)) } + if s.Severity != nil && len(*s.Severity) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Severity", 1)) + } if s.Source == nil { invalidParams.Add(request.NewErrParamRequired("Source")) } @@ -16180,6 +17295,12 @@ func (s *CreateOpsItemInput) Validate() error { return nil } +// SetCategory sets the Category field's value. +func (s *CreateOpsItemInput) SetCategory(v string) *CreateOpsItemInput { + s.Category = &v + return s +} + // SetDescription sets the Description field's value. func (s *CreateOpsItemInput) SetDescription(v string) *CreateOpsItemInput { s.Description = &v @@ -16210,6 +17331,12 @@ func (s *CreateOpsItemInput) SetRelatedOpsItems(v []*RelatedOpsItem) *CreateOpsI return s } +// SetSeverity sets the Severity field's value. +func (s *CreateOpsItemInput) SetSeverity(v string) *CreateOpsItemInput { + s.Severity = &v + return s +} + // SetSource sets the Source field's value. func (s *CreateOpsItemInput) SetSource(v string) *CreateOpsItemInput { s.Source = &v @@ -16501,14 +17628,21 @@ type CreateResourceDataSyncInput struct { _ struct{} `type:"structure"` // Amazon S3 configuration details for the sync. - // - // S3Destination is a required field - S3Destination *ResourceDataSyncS3Destination `type:"structure" required:"true"` + S3Destination *ResourceDataSyncS3Destination `type:"structure"` // A name for the configuration. // // SyncName is a required field SyncName *string `min:"1" type:"string" required:"true"` + + // Specify information about the data sources to synchronize. + SyncSource *ResourceDataSyncSource `type:"structure"` + + // Specify SyncToDestination to create a resource data sync that synchronizes + // data from multiple AWS Regions to an Amazon S3 bucket. Specify SyncFromSource + // to synchronize data from multiple AWS accounts and Regions, as listed in + // AWS Organizations. + SyncType *string `min:"1" type:"string"` } // String returns the string representation @@ -16524,20 +17658,25 @@ func (s CreateResourceDataSyncInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *CreateResourceDataSyncInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "CreateResourceDataSyncInput"} - if s.S3Destination == nil { - invalidParams.Add(request.NewErrParamRequired("S3Destination")) - } if s.SyncName == nil { invalidParams.Add(request.NewErrParamRequired("SyncName")) } if s.SyncName != nil && len(*s.SyncName) < 1 { invalidParams.Add(request.NewErrParamMinLen("SyncName", 1)) } + if s.SyncType != nil && len(*s.SyncType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SyncType", 1)) + } if s.S3Destination != nil { if err := s.S3Destination.Validate(); err != nil { invalidParams.AddNested("S3Destination", err.(request.ErrInvalidParams)) } } + if s.SyncSource != nil { + if err := s.SyncSource.Validate(); err != nil { + invalidParams.AddNested("SyncSource", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -16557,6 +17696,18 @@ func (s *CreateResourceDataSyncInput) SetSyncName(v string) *CreateResourceDataS return s } +// SetSyncSource sets the SyncSource field's value. +func (s *CreateResourceDataSyncInput) SetSyncSource(v *ResourceDataSyncSource) *CreateResourceDataSyncInput { + s.SyncSource = v + return s +} + +// SetSyncType sets the SyncType field's value. +func (s *CreateResourceDataSyncInput) SetSyncType(v string) *CreateResourceDataSyncInput { + s.SyncType = &v + return s +} + type CreateResourceDataSyncOutput struct { _ struct{} `type:"structure"` } @@ -16571,6 +17722,63 @@ func (s CreateResourceDataSyncOutput) GoString() string { return s.String() } +// You have exceeded the limit for custom schemas. Delete one or more custom +// schemas and try again. +type CustomSchemaCountLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s CustomSchemaCountLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CustomSchemaCountLimitExceededException) GoString() string { + return s.String() +} + +func newErrorCustomSchemaCountLimitExceededException(v protocol.ResponseMetadata) error { + return &CustomSchemaCountLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s CustomSchemaCountLimitExceededException) Code() string { + return "CustomSchemaCountLimitExceededException" +} + +// Message returns the exception's message. +func (s CustomSchemaCountLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s CustomSchemaCountLimitExceededException) OrigErr() error { + return nil +} + +func (s CustomSchemaCountLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s CustomSchemaCountLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s CustomSchemaCountLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type DeleteActivationInput struct { _ struct{} `type:"structure"` @@ -16685,6 +17893,12 @@ type DeleteDocumentInput struct { // versions of the document are deleted. DocumentVersion *string `type:"string"` + // Some SSM document types require that you specify a Force flag before you + // can delete the document. For example, you must specify a Force flag to delete + // a document of type ApplicationConfigurationSchema. You can restrict access + // to the Force flag in an AWS Identity and Access Management (IAM) policy. + Force *bool `type:"boolean"` + // The name of the document. // // Name is a required field @@ -16724,6 +17938,12 @@ func (s *DeleteDocumentInput) SetDocumentVersion(v string) *DeleteDocumentInput return s } +// SetForce sets the Force field's value. +func (s *DeleteDocumentInput) SetForce(v bool) *DeleteDocumentInput { + s.Force = &v + return s +} + // SetName sets the Name field's value. func (s *DeleteDocumentInput) SetName(v string) *DeleteDocumentInput { s.Name = &v @@ -17147,6 +18367,9 @@ type DeleteResourceDataSyncInput struct { // // SyncName is a required field SyncName *string `min:"1" type:"string" required:"true"` + + // Specify the type of resource data sync to delete. + SyncType *string `min:"1" type:"string"` } // String returns the string representation @@ -17168,6 +18391,9 @@ func (s *DeleteResourceDataSyncInput) Validate() error { if s.SyncName != nil && len(*s.SyncName) < 1 { invalidParams.Add(request.NewErrParamMinLen("SyncName", 1)) } + if s.SyncType != nil && len(*s.SyncType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SyncType", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -17181,6 +18407,12 @@ func (s *DeleteResourceDataSyncInput) SetSyncName(v string) *DeleteResourceDataS return s } +// SetSyncType sets the SyncType field's value. +func (s *DeleteResourceDataSyncInput) SetSyncType(v string) *DeleteResourceDataSyncInput { + s.SyncType = &v + return s +} + type DeleteResourceDataSyncOutput struct { _ struct{} `type:"structure"` } @@ -18459,6 +19691,10 @@ type DescribeDocumentPermissionOutput struct { // The account IDs that have permission to use this document. The ID can be // either an AWS account or All. AccountIds []*string `type:"list"` + + // A list of of AWS accounts where the current document is shared and the version + // shared with each account. + AccountSharingInfoList []*AccountSharingInfo `type:"list"` } // String returns the string representation @@ -18477,6 +19713,12 @@ func (s *DescribeDocumentPermissionOutput) SetAccountIds(v []*string) *DescribeD return s } +// SetAccountSharingInfoList sets the AccountSharingInfoList field's value. +func (s *DescribeDocumentPermissionOutput) SetAccountSharingInfoList(v []*AccountSharingInfo) *DescribeDocumentPermissionOutput { + s.AccountSharingInfoList = v + return s +} + type DescribeEffectiveInstanceAssociationsInput struct { _ struct{} `type:"structure"` @@ -20437,7 +21679,7 @@ func (s *DescribeOpsItemsOutput) SetOpsItemSummaries(v []*OpsItemSummary) *Descr type DescribeParametersInput struct { _ struct{} `type:"structure"` - // One or more filters. Use a filter to return a more specific list of results. + // This data type is deprecated. Instead, use ParameterFilters. Filters []*ParametersFilter `type:"list"` // The maximum number of items to return for this call. The call also returns @@ -20713,6 +21955,11 @@ type DescribePatchGroupStateOutput struct { // The number of instances with installed patches. InstancesWithInstalledPatches *int64 `type:"integer"` + // The number of instances with patches installed by Patch Manager that have + // not been rebooted after the patch installation. The status of these instances + // is NON_COMPLIANT. + InstancesWithInstalledPendingRebootPatches *int64 `type:"integer"` + // The number of instances with patches installed that are specified in a RejectedPatches // list. Patches with a status of INSTALLED_REJECTED were typically installed // before they were added to a RejectedPatches list. @@ -20766,6 +22013,12 @@ func (s *DescribePatchGroupStateOutput) SetInstancesWithInstalledPatches(v int64 return s } +// SetInstancesWithInstalledPendingRebootPatches sets the InstancesWithInstalledPendingRebootPatches field's value. +func (s *DescribePatchGroupStateOutput) SetInstancesWithInstalledPendingRebootPatches(v int64) *DescribePatchGroupStateOutput { + s.InstancesWithInstalledPendingRebootPatches = &v + return s +} + // SetInstancesWithInstalledRejectedPatches sets the InstancesWithInstalledRejectedPatches field's value. func (s *DescribePatchGroupStateOutput) SetInstancesWithInstalledRejectedPatches(v int64) *DescribePatchGroupStateOutput { s.InstancesWithInstalledRejectedPatches = &v @@ -21128,6 +22381,62 @@ func (s *DescribeSessionsOutput) SetSessions(v []*Session) *DescribeSessionsOutp return s } +// The specified document already exists. +type DocumentAlreadyExists struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DocumentAlreadyExists) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DocumentAlreadyExists) GoString() string { + return s.String() +} + +func newErrorDocumentAlreadyExists(v protocol.ResponseMetadata) error { + return &DocumentAlreadyExists{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DocumentAlreadyExists) Code() string { + return "DocumentAlreadyExists" +} + +// Message returns the exception's message. +func (s DocumentAlreadyExists) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DocumentAlreadyExists) OrigErr() error { + return nil +} + +func (s DocumentAlreadyExists) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DocumentAlreadyExists) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DocumentAlreadyExists) RequestID() string { + return s.respMetadata.RequestID +} + // A default version of a document. type DocumentDefaultVersionDescription struct { _ struct{} `type:"structure"` @@ -21221,6 +22530,10 @@ type DocumentDescription struct { // The list of OS platforms compatible with this Systems Manager document. PlatformTypes []*string `type:"list"` + // A list of SSM documents required by a document. For example, an ApplicationConfiguration + // document requires an ApplicationConfigurationSchema document. + Requires []*DocumentRequires `min:"1" type:"list"` + // The schema version. SchemaVersion *string `type:"string"` @@ -21343,6 +22656,12 @@ func (s *DocumentDescription) SetPlatformTypes(v []*string) *DocumentDescription return s } +// SetRequires sets the Requires field's value. +func (s *DocumentDescription) SetRequires(v []*DocumentRequires) *DocumentDescription { + s.Requires = v + return s +} + // SetSchemaVersion sets the SchemaVersion field's value. func (s *DocumentDescription) SetSchemaVersion(v string) *DocumentDescription { s.SchemaVersion = &v @@ -21463,6 +22782,10 @@ type DocumentIdentifier struct { // The operating system platform. PlatformTypes []*string `type:"list"` + // A list of SSM documents required by a document. For example, an ApplicationConfiguration + // document requires an ApplicationConfigurationSchema document. + Requires []*DocumentRequires `min:"1" type:"list"` + // The schema version. SchemaVersion *string `type:"string"` @@ -21527,6 +22850,12 @@ func (s *DocumentIdentifier) SetPlatformTypes(v []*string) *DocumentIdentifier { return s } +// SetRequires sets the Requires field's value. +func (s *DocumentIdentifier) SetRequires(v []*DocumentRequires) *DocumentIdentifier { + s.Requires = v + return s +} + // SetSchemaVersion sets the SchemaVersion field's value. func (s *DocumentIdentifier) SetSchemaVersion(v string) *DocumentIdentifier { s.SchemaVersion = &v @@ -21621,6 +22950,62 @@ func (s *DocumentKeyValuesFilter) SetValues(v []*string) *DocumentKeyValuesFilte return s } +// You can have at most 500 active Systems Manager documents. +type DocumentLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DocumentLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DocumentLimitExceeded) GoString() string { + return s.String() +} + +func newErrorDocumentLimitExceeded(v protocol.ResponseMetadata) error { + return &DocumentLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DocumentLimitExceeded) Code() string { + return "DocumentLimitExceeded" +} + +// Message returns the exception's message. +func (s DocumentLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DocumentLimitExceeded) OrigErr() error { + return nil +} + +func (s DocumentLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DocumentLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DocumentLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + // Parameters specified in a System Manager document that run on the server // when the command is run. type DocumentParameter struct { @@ -21675,6 +23060,113 @@ func (s *DocumentParameter) SetType(v string) *DocumentParameter { return s } +// 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. +type DocumentPermissionLimit struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DocumentPermissionLimit) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DocumentPermissionLimit) GoString() string { + return s.String() +} + +func newErrorDocumentPermissionLimit(v protocol.ResponseMetadata) error { + return &DocumentPermissionLimit{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DocumentPermissionLimit) Code() string { + return "DocumentPermissionLimit" +} + +// Message returns the exception's message. +func (s DocumentPermissionLimit) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DocumentPermissionLimit) OrigErr() error { + return nil +} + +func (s DocumentPermissionLimit) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DocumentPermissionLimit) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DocumentPermissionLimit) RequestID() string { + return s.respMetadata.RequestID +} + +// An SSM document required by the current document. +type DocumentRequires struct { + _ struct{} `type:"structure"` + + // The name of the required SSM document. The name can be an Amazon Resource + // Name (ARN). + // + // Name is a required field + Name *string `type:"string" required:"true"` + + // The document version required by the current document. + Version *string `type:"string"` +} + +// String returns the string representation +func (s DocumentRequires) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DocumentRequires) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DocumentRequires) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DocumentRequires"} + 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 *DocumentRequires) SetName(v string) *DocumentRequires { + s.Name = &v + return s +} + +// SetVersion sets the Version field's value. +func (s *DocumentRequires) SetVersion(v string) *DocumentRequires { + s.Version = &v + return s +} + // Version information about the document. type DocumentVersionInfo struct { _ struct{} `type:"structure"` @@ -21768,6 +23260,294 @@ func (s *DocumentVersionInfo) SetVersionName(v string) *DocumentVersionInfo { return s } +// The document has too many versions. Delete one or more document versions +// and try again. +type DocumentVersionLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DocumentVersionLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DocumentVersionLimitExceeded) GoString() string { + return s.String() +} + +func newErrorDocumentVersionLimitExceeded(v protocol.ResponseMetadata) error { + return &DocumentVersionLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DocumentVersionLimitExceeded) Code() string { + return "DocumentVersionLimitExceeded" +} + +// Message returns the exception's message. +func (s DocumentVersionLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DocumentVersionLimitExceeded) OrigErr() error { + return nil +} + +func (s DocumentVersionLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DocumentVersionLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DocumentVersionLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + +// Error returned when the ID specified for a resource, such as a maintenance +// window or Patch baseline, doesn't exist. +// +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. +type DoesNotExistException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DoesNotExistException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DoesNotExistException) GoString() string { + return s.String() +} + +func newErrorDoesNotExistException(v protocol.ResponseMetadata) error { + return &DoesNotExistException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DoesNotExistException) Code() string { + return "DoesNotExistException" +} + +// Message returns the exception's message. +func (s DoesNotExistException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DoesNotExistException) OrigErr() error { + return nil +} + +func (s DoesNotExistException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DoesNotExistException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DoesNotExistException) RequestID() string { + return s.respMetadata.RequestID +} + +// The content of the association document matches another document. Change +// the content of the document and try again. +type DuplicateDocumentContent struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DuplicateDocumentContent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DuplicateDocumentContent) GoString() string { + return s.String() +} + +func newErrorDuplicateDocumentContent(v protocol.ResponseMetadata) error { + return &DuplicateDocumentContent{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DuplicateDocumentContent) Code() string { + return "DuplicateDocumentContent" +} + +// Message returns the exception's message. +func (s DuplicateDocumentContent) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DuplicateDocumentContent) OrigErr() error { + return nil +} + +func (s DuplicateDocumentContent) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DuplicateDocumentContent) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DuplicateDocumentContent) RequestID() string { + return s.respMetadata.RequestID +} + +// The version name has already been used in this document. Specify a different +// version name, and then try again. +type DuplicateDocumentVersionName struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DuplicateDocumentVersionName) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DuplicateDocumentVersionName) GoString() string { + return s.String() +} + +func newErrorDuplicateDocumentVersionName(v protocol.ResponseMetadata) error { + return &DuplicateDocumentVersionName{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DuplicateDocumentVersionName) Code() string { + return "DuplicateDocumentVersionName" +} + +// Message returns the exception's message. +func (s DuplicateDocumentVersionName) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DuplicateDocumentVersionName) OrigErr() error { + return nil +} + +func (s DuplicateDocumentVersionName) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DuplicateDocumentVersionName) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DuplicateDocumentVersionName) RequestID() string { + return s.respMetadata.RequestID +} + +// You cannot specify an instance ID in more than one association. +type DuplicateInstanceId struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DuplicateInstanceId) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DuplicateInstanceId) GoString() string { + return s.String() +} + +func newErrorDuplicateInstanceId(v protocol.ResponseMetadata) error { + return &DuplicateInstanceId{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DuplicateInstanceId) Code() string { + return "DuplicateInstanceId" +} + +// Message returns the exception's message. +func (s DuplicateInstanceId) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DuplicateInstanceId) OrigErr() error { + return nil +} + +func (s DuplicateInstanceId) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DuplicateInstanceId) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DuplicateInstanceId) RequestID() string { + return s.respMetadata.RequestID +} + // 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, @@ -21895,6 +23675,63 @@ func (s *FailureDetails) SetFailureType(v string) *FailureDetails { return s } +// You attempted to register a LAMBDA or STEP_FUNCTIONS task in a region where +// the corresponding service is not available. +type FeatureNotAvailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s FeatureNotAvailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s FeatureNotAvailableException) GoString() string { + return s.String() +} + +func newErrorFeatureNotAvailableException(v protocol.ResponseMetadata) error { + return &FeatureNotAvailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s FeatureNotAvailableException) Code() string { + return "FeatureNotAvailableException" +} + +// Message returns the exception's message. +func (s FeatureNotAvailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s FeatureNotAvailableException) OrigErr() error { + return nil +} + +func (s FeatureNotAvailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s FeatureNotAvailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s FeatureNotAvailableException) RequestID() string { + return s.respMetadata.RequestID +} + type GetAutomationExecutionInput struct { _ struct{} `type:"structure"` @@ -21961,6 +23798,104 @@ func (s *GetAutomationExecutionOutput) SetAutomationExecution(v *AutomationExecu return s } +type GetCalendarStateInput struct { + _ struct{} `type:"structure"` + + // (Optional) The specific time for which you want to get calendar state information, + // in ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601) format. If you do not + // add AtTime, the current time is assumed. + AtTime *string `type:"string"` + + // The names or Amazon Resource Names (ARNs) of the Systems Manager documents + // that represent the calendar entries for which you want to get the state. + // + // CalendarNames is a required field + CalendarNames []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s GetCalendarStateInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCalendarStateInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetCalendarStateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetCalendarStateInput"} + if s.CalendarNames == nil { + invalidParams.Add(request.NewErrParamRequired("CalendarNames")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAtTime sets the AtTime field's value. +func (s *GetCalendarStateInput) SetAtTime(v string) *GetCalendarStateInput { + s.AtTime = &v + return s +} + +// SetCalendarNames sets the CalendarNames field's value. +func (s *GetCalendarStateInput) SetCalendarNames(v []*string) *GetCalendarStateInput { + s.CalendarNames = v + return s +} + +type GetCalendarStateOutput struct { + _ struct{} `type:"structure"` + + // The time, as an ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601) string, + // that you specified in your command. If you did not specify a time, GetCalendarState + // uses the current time. + AtTime *string `type:"string"` + + // The time, as an ISO 8601 (https://en.wikipedia.org/wiki/ISO_8601) string, + // that the calendar state will change. If the current calendar state is OPEN, + // NextTransitionTime indicates when the calendar state changes to CLOSED, and + // vice-versa. + NextTransitionTime *string `type:"string"` + + // The state of the calendar. An OPEN calendar indicates that actions are allowed + // to proceed, and a CLOSED calendar indicates that actions are not allowed + // to proceed. + State *string `type:"string" enum:"CalendarState"` +} + +// String returns the string representation +func (s GetCalendarStateOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetCalendarStateOutput) GoString() string { + return s.String() +} + +// SetAtTime sets the AtTime field's value. +func (s *GetCalendarStateOutput) SetAtTime(v string) *GetCalendarStateOutput { + s.AtTime = &v + return s +} + +// SetNextTransitionTime sets the NextTransitionTime field's value. +func (s *GetCalendarStateOutput) SetNextTransitionTime(v string) *GetCalendarStateOutput { + s.NextTransitionTime = &v + return s +} + +// SetState sets the State field's value. +func (s *GetCalendarStateOutput) SetState(v string) *GetCalendarStateOutput { + s.State = &v + return s +} + type GetCommandInvocationInput struct { _ struct{} `type:"structure"` @@ -22594,6 +24529,10 @@ type GetDocumentOutput struct { // The name of the Systems Manager document. Name *string `type:"string"` + // A list of SSM documents required by a document. For example, an ApplicationConfiguration + // document requires an ApplicationConfigurationSchema document. + Requires []*DocumentRequires `min:"1" type:"list"` + // The status of the Systems Manager document, such as Creating, Active, Updating, // Failed, and Deleting. Status *string `type:"string" enum:"DocumentStatus"` @@ -22656,6 +24595,12 @@ func (s *GetDocumentOutput) SetName(v string) *GetDocumentOutput { return s } +// SetRequires sets the Requires field's value. +func (s *GetDocumentOutput) SetRequires(v []*DocumentRequires) *GetDocumentOutput { + s.Requires = v + return s +} + // SetStatus sets the Status field's value. func (s *GetDocumentOutput) SetStatus(v string) *GetDocumentOutput { s.Status = &v @@ -23917,9 +25862,7 @@ type GetOpsSummaryInput struct { // Optional aggregators that return counts of OpsItems based on one or more // expressions. - // - // Aggregators is a required field - Aggregators []*OpsAggregator `min:"1" type:"list" required:"true"` + Aggregators []*OpsAggregator `min:"1" type:"list"` // Optional filters used to scope down the returned OpsItems. Filters []*OpsFilter `min:"1" type:"list"` @@ -23931,6 +25874,12 @@ type GetOpsSummaryInput struct { // A token to start the list. Use this token to get the next set of results. NextToken *string `type:"string"` + + // The OpsItem data type to return. + ResultAttributes []*OpsResultAttribute `min:"1" type:"list"` + + // Specify the name of a resource data sync to get. + SyncName *string `min:"1" type:"string"` } // String returns the string representation @@ -23946,9 +25895,6 @@ func (s GetOpsSummaryInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *GetOpsSummaryInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "GetOpsSummaryInput"} - if s.Aggregators == nil { - invalidParams.Add(request.NewErrParamRequired("Aggregators")) - } if s.Aggregators != nil && len(s.Aggregators) < 1 { invalidParams.Add(request.NewErrParamMinLen("Aggregators", 1)) } @@ -23958,6 +25904,12 @@ func (s *GetOpsSummaryInput) Validate() error { 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.SyncName != nil && len(*s.SyncName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SyncName", 1)) + } if s.Aggregators != nil { for i, v := range s.Aggregators { if v == nil { @@ -23978,6 +25930,16 @@ func (s *GetOpsSummaryInput) Validate() error { } } } + 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 @@ -24009,6 +25971,18 @@ func (s *GetOpsSummaryInput) SetNextToken(v string) *GetOpsSummaryInput { return s } +// SetResultAttributes sets the ResultAttributes field's value. +func (s *GetOpsSummaryInput) SetResultAttributes(v []*OpsResultAttribute) *GetOpsSummaryInput { + s.ResultAttributes = v + return s +} + +// SetSyncName sets the SyncName field's value. +func (s *GetOpsSummaryInput) SetSyncName(v string) *GetOpsSummaryInput { + s.SyncName = &v + return s +} + type GetOpsSummaryOutput struct { _ struct{} `type:"structure"` @@ -24236,8 +26210,6 @@ type GetParametersByPathInput struct { NextToken *string `type:"string"` // Filters to limit the request results. - // - // You can't filter using the parameter name. ParameterFilters []*ParameterStringFilter `type:"list"` // The hierarchy for the parameter. Hierarchies start with a forward slash (/) @@ -24807,6 +26779,243 @@ func (s *GetServiceSettingOutput) SetServiceSetting(v *ServiceSetting) *GetServi return s } +// A hierarchy can have a maximum of 15 levels. For more information, see Requirements +// and Constraints for Parameter Names (http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-parameter-name-constraints.html) +// in the AWS Systems Manager User Guide. +type HierarchyLevelLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A hierarchy can have a maximum of 15 levels. For more information, see Requirements + // and Constraints for Parameter Names (http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-parameter-name-constraints.html) + // in the AWS Systems Manager User Guide. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s HierarchyLevelLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HierarchyLevelLimitExceededException) GoString() string { + return s.String() +} + +func newErrorHierarchyLevelLimitExceededException(v protocol.ResponseMetadata) error { + return &HierarchyLevelLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s HierarchyLevelLimitExceededException) Code() string { + return "HierarchyLevelLimitExceededException" +} + +// Message returns the exception's message. +func (s HierarchyLevelLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s HierarchyLevelLimitExceededException) OrigErr() error { + return nil +} + +func (s HierarchyLevelLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s HierarchyLevelLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s HierarchyLevelLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// Parameter Store does not support changing a parameter type in a hierarchy. +// For example, you can't change a parameter from a String type to a SecureString +// type. You must create a new, unique parameter. +type HierarchyTypeMismatchException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // Parameter Store does not support changing a parameter type in a hierarchy. + // For example, you can't change a parameter from a String type to a SecureString + // type. You must create a new, unique parameter. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s HierarchyTypeMismatchException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HierarchyTypeMismatchException) GoString() string { + return s.String() +} + +func newErrorHierarchyTypeMismatchException(v protocol.ResponseMetadata) error { + return &HierarchyTypeMismatchException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s HierarchyTypeMismatchException) Code() string { + return "HierarchyTypeMismatchException" +} + +// Message returns the exception's message. +func (s HierarchyTypeMismatchException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s HierarchyTypeMismatchException) OrigErr() error { + return nil +} + +func (s HierarchyTypeMismatchException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s HierarchyTypeMismatchException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s HierarchyTypeMismatchException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type IdempotentParameterMismatch struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s IdempotentParameterMismatch) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IdempotentParameterMismatch) GoString() string { + return s.String() +} + +func newErrorIdempotentParameterMismatch(v protocol.ResponseMetadata) error { + return &IdempotentParameterMismatch{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IdempotentParameterMismatch) Code() string { + return "IdempotentParameterMismatch" +} + +// Message returns the exception's message. +func (s IdempotentParameterMismatch) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IdempotentParameterMismatch) OrigErr() error { + return nil +} + +func (s IdempotentParameterMismatch) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IdempotentParameterMismatch) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IdempotentParameterMismatch) RequestID() string { + return s.respMetadata.RequestID +} + +// There is a conflict in the policies specified for this parameter. You can't, +// for example, specify two Expiration policies for a parameter. Review your +// policies, and try again. +type IncompatiblePolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s IncompatiblePolicyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IncompatiblePolicyException) GoString() string { + return s.String() +} + +func newErrorIncompatiblePolicyException(v protocol.ResponseMetadata) error { + return &IncompatiblePolicyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s IncompatiblePolicyException) Code() string { + return "IncompatiblePolicyException" +} + +// Message returns the exception's message. +func (s IncompatiblePolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s IncompatiblePolicyException) OrigErr() error { + return nil +} + +func (s IncompatiblePolicyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s IncompatiblePolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s IncompatiblePolicyException) RequestID() string { + return s.respMetadata.RequestID +} + // Status information about the aggregated associations. type InstanceAggregatedAssociationOverview struct { _ struct{} `type:"structure"` @@ -25283,386 +27492,3159 @@ type InstanceInformationFilter struct { // 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" min:"1" type:"list" required:"true"` + // The filter values. + // + // ValueSet is a required field + ValueSet []*string `locationName:"valueSet" 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. +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 `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. +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"` + + // An https URL or an Amazon S3 path-style URL to a list of patches to be installed. + // This patch installation list, which you maintain in an Amazon S3 bucket in + // YAML format and specify in the SSM document AWS-RunPatchBaseline, overrides + // the patches specified by the default patch baseline. + // + // For more information about the InstallOverrideList parameter, see About the + // SSM Document AWS-RunPatchBaseline (http://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-about-aws-runpatchbaseline.html) + // in the AWS Systems Manager User Guide. + InstallOverrideList *string `min:"1" type:"string"` + + // 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 number of patches installed by Patch Manager since the last time the + // instance was rebooted. + InstalledPendingRebootCount *int64 `type:"integer"` + + // The number of instances with patches installed that are specified in a RejectedPatches + // list. Patches with a status of InstalledRejected were typically installed + // before they were added to a RejectedPatches list. + // + // If ALLOW_AS_DEPENDENCY is the specified option for RejectedPatchesAction, + // the value of InstalledRejectedCount will always be 0 (zero). + InstalledRejectedCount *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 time of the last attempt to patch the instance with NoReboot specified + // as the reboot option. + LastNoRebootInstallOperationTime *time.Time `type:"timestamp"` + + // 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 therefore aren't installed on the instance. This number + // may be truncated if the list of patch names is very large. The number of + // patches beyond this limit are reported in UnreportedNotApplicableCount. + 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" required:"true"` + + // The time the most recent patching operation was started on the instance. + // + // OperationStartTime is a required field + OperationStartTime *time.Time `type:"timestamp" required:"true"` + + // Placeholder information. This field will always be empty in the current release + // of the service. + OwnerInformation *string `min:"1" type:"string" sensitive:"true"` + + // The name of the patch group the managed instance belongs to. + // + // PatchGroup is a required field + PatchGroup *string `min:"1" type:"string" required:"true"` + + // Indicates the reboot option specified in the patch baseline. + // + // Reboot options apply to Install operations only. Reboots are not attempted + // for Patch Manager Scan operations. + // + // * RebootIfNeeded: Patch Manager tries to reboot the instance if it installed + // any patches, or if any patches are detected with a status of InstalledPendingReboot. + // + // * NoReboot: Patch Manager attempts to install missing packages without + // trying to reboot the system. Patches installed with this option are assigned + // a status of InstalledPendingReboot. These patches might not be in effect + // until a reboot is performed. + RebootOption *string `type:"string" enum:"RebootOption"` + + // The ID of the patch baseline snapshot used during the patching operation + // when this compliance data was collected. + SnapshotId *string `min:"36" type:"string"` + + // The number of patches beyond the supported limit of NotApplicableCount that + // are not reported by name to Systems Manager Inventory. + UnreportedNotApplicableCount *int64 `type:"integer"` +} + +// 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 +} + +// SetInstallOverrideList sets the InstallOverrideList field's value. +func (s *InstancePatchState) SetInstallOverrideList(v string) *InstancePatchState { + s.InstallOverrideList = &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 +} + +// SetInstalledPendingRebootCount sets the InstalledPendingRebootCount field's value. +func (s *InstancePatchState) SetInstalledPendingRebootCount(v int64) *InstancePatchState { + s.InstalledPendingRebootCount = &v + return s +} + +// SetInstalledRejectedCount sets the InstalledRejectedCount field's value. +func (s *InstancePatchState) SetInstalledRejectedCount(v int64) *InstancePatchState { + s.InstalledRejectedCount = &v + return s +} + +// SetInstanceId sets the InstanceId field's value. +func (s *InstancePatchState) SetInstanceId(v string) *InstancePatchState { + s.InstanceId = &v + return s +} + +// SetLastNoRebootInstallOperationTime sets the LastNoRebootInstallOperationTime field's value. +func (s *InstancePatchState) SetLastNoRebootInstallOperationTime(v time.Time) *InstancePatchState { + s.LastNoRebootInstallOperationTime = &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 +} + +// SetRebootOption sets the RebootOption field's value. +func (s *InstancePatchState) SetRebootOption(v string) *InstancePatchState { + s.RebootOption = &v + return s +} + +// SetSnapshotId sets the SnapshotId field's value. +func (s *InstancePatchState) SetSnapshotId(v string) *InstancePatchState { + s.SnapshotId = &v + return s +} + +// SetUnreportedNotApplicableCount sets the UnreportedNotApplicableCount field's value. +func (s *InstancePatchState) SetUnreportedNotApplicableCount(v int64) *InstancePatchState { + s.UnreportedNotApplicableCount = &v + return s +} + +// Defines a filter used in DescribeInstancePatchStatesForPatchGroup used to +// scope down the information returned by the API. +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 +} + +// An error occurred on the server side. +type InternalServerError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalServerError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerError) GoString() string { + return s.String() +} + +func newErrorInternalServerError(v protocol.ResponseMetadata) error { + return &InternalServerError{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerError) Code() string { + return "InternalServerError" +} + +// Message returns the exception's message. +func (s InternalServerError) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerError) OrigErr() error { + return nil +} + +func (s InternalServerError) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerError) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerError) RequestID() string { + return s.respMetadata.RequestID +} + +// The activation is not valid. The activation might have been deleted, or the +// ActivationId and the ActivationCode do not match. +type InvalidActivation struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidActivation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidActivation) GoString() string { + return s.String() +} + +func newErrorInvalidActivation(v protocol.ResponseMetadata) error { + return &InvalidActivation{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidActivation) Code() string { + return "InvalidActivation" +} + +// Message returns the exception's message. +func (s InvalidActivation) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidActivation) OrigErr() error { + return nil +} + +func (s InvalidActivation) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidActivation) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidActivation) RequestID() string { + return s.respMetadata.RequestID +} + +// The activation ID is not valid. Verify the you entered the correct ActivationId +// or ActivationCode and try again. +type InvalidActivationId struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidActivationId) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidActivationId) GoString() string { + return s.String() +} + +func newErrorInvalidActivationId(v protocol.ResponseMetadata) error { + return &InvalidActivationId{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidActivationId) Code() string { + return "InvalidActivationId" +} + +// Message returns the exception's message. +func (s InvalidActivationId) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidActivationId) OrigErr() error { + return nil +} + +func (s InvalidActivationId) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidActivationId) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidActivationId) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified aggregator is not valid for inventory groups. Verify that the +// aggregator uses a valid inventory type such as AWS:Application or AWS:InstanceInformation. +type InvalidAggregatorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidAggregatorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidAggregatorException) GoString() string { + return s.String() +} + +func newErrorInvalidAggregatorException(v protocol.ResponseMetadata) error { + return &InvalidAggregatorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidAggregatorException) Code() string { + return "InvalidAggregatorException" +} + +// Message returns the exception's message. +func (s InvalidAggregatorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAggregatorException) OrigErr() error { + return nil +} + +func (s InvalidAggregatorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAggregatorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAggregatorException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request does not meet the regular expression requirement. +type InvalidAllowedPatternException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The request does not meet the regular expression requirement. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidAllowedPatternException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidAllowedPatternException) GoString() string { + return s.String() +} + +func newErrorInvalidAllowedPatternException(v protocol.ResponseMetadata) error { + return &InvalidAllowedPatternException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidAllowedPatternException) Code() string { + return "InvalidAllowedPatternException" +} + +// Message returns the exception's message. +func (s InvalidAllowedPatternException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAllowedPatternException) OrigErr() error { + return nil +} + +func (s InvalidAllowedPatternException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAllowedPatternException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAllowedPatternException) RequestID() string { + return s.respMetadata.RequestID +} + +// The association is not valid or does not exist. +type InvalidAssociation struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidAssociation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidAssociation) GoString() string { + return s.String() +} + +func newErrorInvalidAssociation(v protocol.ResponseMetadata) error { + return &InvalidAssociation{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidAssociation) Code() string { + return "InvalidAssociation" +} + +// Message returns the exception's message. +func (s InvalidAssociation) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAssociation) OrigErr() error { + return nil +} + +func (s InvalidAssociation) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAssociation) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAssociation) RequestID() string { + return s.respMetadata.RequestID +} + +// The version you specified is not valid. Use ListAssociationVersions to view +// all versions of an association according to the association ID. Or, use the +// $LATEST parameter to view the latest version of the association. +type InvalidAssociationVersion struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidAssociationVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidAssociationVersion) GoString() string { + return s.String() +} + +func newErrorInvalidAssociationVersion(v protocol.ResponseMetadata) error { + return &InvalidAssociationVersion{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidAssociationVersion) Code() string { + return "InvalidAssociationVersion" +} + +// Message returns the exception's message. +func (s InvalidAssociationVersion) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAssociationVersion) OrigErr() error { + return nil +} + +func (s InvalidAssociationVersion) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAssociationVersion) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAssociationVersion) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type InvalidAutomationExecutionParametersException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidAutomationExecutionParametersException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidAutomationExecutionParametersException) GoString() string { + return s.String() +} + +func newErrorInvalidAutomationExecutionParametersException(v protocol.ResponseMetadata) error { + return &InvalidAutomationExecutionParametersException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidAutomationExecutionParametersException) Code() string { + return "InvalidAutomationExecutionParametersException" +} + +// Message returns the exception's message. +func (s InvalidAutomationExecutionParametersException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAutomationExecutionParametersException) OrigErr() error { + return nil +} + +func (s InvalidAutomationExecutionParametersException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAutomationExecutionParametersException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAutomationExecutionParametersException) RequestID() string { + return s.respMetadata.RequestID +} + +// The signal is not valid for the current Automation execution. +type InvalidAutomationSignalException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidAutomationSignalException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidAutomationSignalException) GoString() string { + return s.String() +} + +func newErrorInvalidAutomationSignalException(v protocol.ResponseMetadata) error { + return &InvalidAutomationSignalException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidAutomationSignalException) Code() string { + return "InvalidAutomationSignalException" +} + +// Message returns the exception's message. +func (s InvalidAutomationSignalException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAutomationSignalException) OrigErr() error { + return nil +} + +func (s InvalidAutomationSignalException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAutomationSignalException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAutomationSignalException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified update status operation is not valid. +type InvalidAutomationStatusUpdateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidAutomationStatusUpdateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidAutomationStatusUpdateException) GoString() string { + return s.String() +} + +func newErrorInvalidAutomationStatusUpdateException(v protocol.ResponseMetadata) error { + return &InvalidAutomationStatusUpdateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidAutomationStatusUpdateException) Code() string { + return "InvalidAutomationStatusUpdateException" +} + +// Message returns the exception's message. +func (s InvalidAutomationStatusUpdateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAutomationStatusUpdateException) OrigErr() error { + return nil +} + +func (s InvalidAutomationStatusUpdateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAutomationStatusUpdateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAutomationStatusUpdateException) RequestID() string { + return s.respMetadata.RequestID +} + +type InvalidCommandId struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidCommandId) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidCommandId) GoString() string { + return s.String() +} + +func newErrorInvalidCommandId(v protocol.ResponseMetadata) error { + return &InvalidCommandId{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidCommandId) Code() string { + return "InvalidCommandId" +} + +// Message returns the exception's message. +func (s InvalidCommandId) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidCommandId) OrigErr() error { + return nil +} + +func (s InvalidCommandId) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidCommandId) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidCommandId) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more of the parameters specified for the delete operation is not valid. +// Verify all parameters and try again. +type InvalidDeleteInventoryParametersException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidDeleteInventoryParametersException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDeleteInventoryParametersException) GoString() string { + return s.String() +} + +func newErrorInvalidDeleteInventoryParametersException(v protocol.ResponseMetadata) error { + return &InvalidDeleteInventoryParametersException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDeleteInventoryParametersException) Code() string { + return "InvalidDeleteInventoryParametersException" +} + +// Message returns the exception's message. +func (s InvalidDeleteInventoryParametersException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDeleteInventoryParametersException) OrigErr() error { + return nil +} + +func (s InvalidDeleteInventoryParametersException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDeleteInventoryParametersException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDeleteInventoryParametersException) RequestID() string { + return s.respMetadata.RequestID +} + +// The ID specified for the delete operation does not exist or is not valid. +// Verify the ID and try again. +type InvalidDeletionIdException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidDeletionIdException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDeletionIdException) GoString() string { + return s.String() +} + +func newErrorInvalidDeletionIdException(v protocol.ResponseMetadata) error { + return &InvalidDeletionIdException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDeletionIdException) Code() string { + return "InvalidDeletionIdException" +} + +// Message returns the exception's message. +func (s InvalidDeletionIdException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDeletionIdException) OrigErr() error { + return nil +} + +func (s InvalidDeletionIdException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDeletionIdException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDeletionIdException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified document does not exist. +type InvalidDocument struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The document does not exist or the document is not available to the user. + // This exception can be issued by CreateAssociation, CreateAssociationBatch, + // DeleteAssociation, DeleteDocument, DescribeAssociation, DescribeDocument, + // GetDocument, SendCommand, or UpdateAssociationStatus. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidDocument) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDocument) GoString() string { + return s.String() +} + +func newErrorInvalidDocument(v protocol.ResponseMetadata) error { + return &InvalidDocument{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDocument) Code() string { + return "InvalidDocument" +} + +// Message returns the exception's message. +func (s InvalidDocument) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDocument) OrigErr() error { + return nil +} + +func (s InvalidDocument) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDocument) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDocument) RequestID() string { + return s.respMetadata.RequestID +} + +// The content for the document is not valid. +type InvalidDocumentContent struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A description of the validation error. + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidDocumentContent) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDocumentContent) GoString() string { + return s.String() +} + +func newErrorInvalidDocumentContent(v protocol.ResponseMetadata) error { + return &InvalidDocumentContent{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDocumentContent) Code() string { + return "InvalidDocumentContent" +} + +// Message returns the exception's message. +func (s InvalidDocumentContent) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDocumentContent) OrigErr() error { + return nil +} + +func (s InvalidDocumentContent) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDocumentContent) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDocumentContent) RequestID() string { + return s.respMetadata.RequestID +} + +// You attempted to delete a document while it is still shared. You must stop +// sharing the document before you can delete it. +type InvalidDocumentOperation struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidDocumentOperation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDocumentOperation) GoString() string { + return s.String() +} + +func newErrorInvalidDocumentOperation(v protocol.ResponseMetadata) error { + return &InvalidDocumentOperation{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDocumentOperation) Code() string { + return "InvalidDocumentOperation" +} + +// Message returns the exception's message. +func (s InvalidDocumentOperation) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDocumentOperation) OrigErr() error { + return nil +} + +func (s InvalidDocumentOperation) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDocumentOperation) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDocumentOperation) RequestID() string { + return s.respMetadata.RequestID +} + +// The version of the document schema is not supported. +type InvalidDocumentSchemaVersion struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidDocumentSchemaVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDocumentSchemaVersion) GoString() string { + return s.String() +} + +func newErrorInvalidDocumentSchemaVersion(v protocol.ResponseMetadata) error { + return &InvalidDocumentSchemaVersion{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDocumentSchemaVersion) Code() string { + return "InvalidDocumentSchemaVersion" +} + +// Message returns the exception's message. +func (s InvalidDocumentSchemaVersion) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDocumentSchemaVersion) OrigErr() error { + return nil +} + +func (s InvalidDocumentSchemaVersion) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDocumentSchemaVersion) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDocumentSchemaVersion) RequestID() string { + return s.respMetadata.RequestID +} + +// The document type is not valid. Valid document types are described in the +// DocumentType property. +type InvalidDocumentType struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidDocumentType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDocumentType) GoString() string { + return s.String() +} + +func newErrorInvalidDocumentType(v protocol.ResponseMetadata) error { + return &InvalidDocumentType{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDocumentType) Code() string { + return "InvalidDocumentType" +} + +// Message returns the exception's message. +func (s InvalidDocumentType) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDocumentType) OrigErr() error { + return nil +} + +func (s InvalidDocumentType) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDocumentType) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDocumentType) RequestID() string { + return s.respMetadata.RequestID +} + +// The document version is not valid or does not exist. +type InvalidDocumentVersion struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidDocumentVersion) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidDocumentVersion) GoString() string { + return s.String() +} + +func newErrorInvalidDocumentVersion(v protocol.ResponseMetadata) error { + return &InvalidDocumentVersion{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidDocumentVersion) Code() string { + return "InvalidDocumentVersion" +} + +// Message returns the exception's message. +func (s InvalidDocumentVersion) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidDocumentVersion) OrigErr() error { + return nil +} + +func (s InvalidDocumentVersion) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidDocumentVersion) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidDocumentVersion) RequestID() string { + return s.respMetadata.RequestID +} + +// The filter name is not valid. Verify the you entered the correct name and +// try again. +type InvalidFilter struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidFilter) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidFilter) GoString() string { + return s.String() +} + +func newErrorInvalidFilter(v protocol.ResponseMetadata) error { + return &InvalidFilter{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidFilter) Code() string { + return "InvalidFilter" +} + +// Message returns the exception's message. +func (s InvalidFilter) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidFilter) OrigErr() error { + return nil +} + +func (s InvalidFilter) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidFilter) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidFilter) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified key is not valid. +type InvalidFilterKey struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidFilterKey) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidFilterKey) GoString() string { + return s.String() +} + +func newErrorInvalidFilterKey(v protocol.ResponseMetadata) error { + return &InvalidFilterKey{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidFilterKey) Code() string { + return "InvalidFilterKey" +} + +// Message returns the exception's message. +func (s InvalidFilterKey) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidFilterKey) OrigErr() error { + return nil +} + +func (s InvalidFilterKey) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidFilterKey) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidFilterKey) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified filter option is not valid. Valid options are Equals and BeginsWith. +// For Path filter, valid options are Recursive and OneLevel. +type InvalidFilterOption struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The specified filter option is not valid. Valid options are Equals and BeginsWith. + // For Path filter, valid options are Recursive and OneLevel. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidFilterOption) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidFilterOption) GoString() string { + return s.String() +} + +func newErrorInvalidFilterOption(v protocol.ResponseMetadata) error { + return &InvalidFilterOption{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidFilterOption) Code() string { + return "InvalidFilterOption" +} + +// Message returns the exception's message. +func (s InvalidFilterOption) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidFilterOption) OrigErr() error { + return nil +} + +func (s InvalidFilterOption) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidFilterOption) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidFilterOption) RequestID() string { + return s.respMetadata.RequestID +} + +// The filter value is not valid. Verify the value and try again. +type InvalidFilterValue struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidFilterValue) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidFilterValue) GoString() string { + return s.String() +} + +func newErrorInvalidFilterValue(v protocol.ResponseMetadata) error { + return &InvalidFilterValue{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidFilterValue) Code() string { + return "InvalidFilterValue" +} + +// Message returns the exception's message. +func (s InvalidFilterValue) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidFilterValue) OrigErr() error { + return nil +} + +func (s InvalidFilterValue) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidFilterValue) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidFilterValue) RequestID() string { + return s.respMetadata.RequestID +} + +// The following problems can cause this exception: +// +// You do not have permission to access the instance. +// +// SSM Agent is not running. Verify that SSM Agent is running. +// +// SSM Agent is not registered with the SSM endpoint. Try reinstalling SSM Agent. +// +// The instance is not in valid state. Valid states are: Running, Pending, Stopped, +// Stopping. Invalid states are: Shutting-down and Terminated. +type InvalidInstanceId struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidInstanceId) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInstanceId) GoString() string { + return s.String() +} + +func newErrorInvalidInstanceId(v protocol.ResponseMetadata) error { + return &InvalidInstanceId{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInstanceId) Code() string { + return "InvalidInstanceId" +} + +// Message returns the exception's message. +func (s InvalidInstanceId) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInstanceId) OrigErr() error { + return nil +} + +func (s InvalidInstanceId) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInstanceId) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInstanceId) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified filter value is not valid. +type InvalidInstanceInformationFilterValue struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidInstanceInformationFilterValue) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInstanceInformationFilterValue) GoString() string { + return s.String() +} + +func newErrorInvalidInstanceInformationFilterValue(v protocol.ResponseMetadata) error { + return &InvalidInstanceInformationFilterValue{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInstanceInformationFilterValue) Code() string { + return "InvalidInstanceInformationFilterValue" +} + +// Message returns the exception's message. +func (s InvalidInstanceInformationFilterValue) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInstanceInformationFilterValue) OrigErr() error { + return nil +} + +func (s InvalidInstanceInformationFilterValue) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInstanceInformationFilterValue) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInstanceInformationFilterValue) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified inventory group is not valid. +type InvalidInventoryGroupException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidInventoryGroupException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInventoryGroupException) GoString() string { + return s.String() +} + +func newErrorInvalidInventoryGroupException(v protocol.ResponseMetadata) error { + return &InvalidInventoryGroupException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInventoryGroupException) Code() string { + return "InvalidInventoryGroupException" +} + +// Message returns the exception's message. +func (s InvalidInventoryGroupException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInventoryGroupException) OrigErr() error { + return nil +} + +func (s InvalidInventoryGroupException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInventoryGroupException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInventoryGroupException) RequestID() string { + return s.respMetadata.RequestID +} + +// You specified invalid keys or values in the Context attribute for InventoryItem. +// Verify the keys and values, and try again. +type InvalidInventoryItemContextException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidInventoryItemContextException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInventoryItemContextException) GoString() string { + return s.String() +} + +func newErrorInvalidInventoryItemContextException(v protocol.ResponseMetadata) error { + return &InvalidInventoryItemContextException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInventoryItemContextException) Code() string { + return "InvalidInventoryItemContextException" +} + +// Message returns the exception's message. +func (s InvalidInventoryItemContextException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInventoryItemContextException) OrigErr() error { + return nil +} + +func (s InvalidInventoryItemContextException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInventoryItemContextException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInventoryItemContextException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request is not valid. +type InvalidInventoryRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidInventoryRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidInventoryRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidInventoryRequestException(v protocol.ResponseMetadata) error { + return &InvalidInventoryRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidInventoryRequestException) Code() string { + return "InvalidInventoryRequestException" +} + +// Message returns the exception's message. +func (s InvalidInventoryRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidInventoryRequestException) OrigErr() error { + return nil +} + +func (s InvalidInventoryRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidInventoryRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidInventoryRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more content items is not valid. +type InvalidItemContentException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + TypeName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s InvalidItemContentException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidItemContentException) GoString() string { + return s.String() +} + +func newErrorInvalidItemContentException(v protocol.ResponseMetadata) error { + return &InvalidItemContentException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidItemContentException) Code() string { + return "InvalidItemContentException" +} + +// Message returns the exception's message. +func (s InvalidItemContentException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidItemContentException) OrigErr() error { + return nil +} + +func (s InvalidItemContentException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidItemContentException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidItemContentException) RequestID() string { + return s.respMetadata.RequestID +} + +// The query key ID is not valid. +type InvalidKeyId struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidKeyId) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidKeyId) GoString() string { + return s.String() +} + +func newErrorInvalidKeyId(v protocol.ResponseMetadata) error { + return &InvalidKeyId{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidKeyId) Code() string { + return "InvalidKeyId" +} + +// Message returns the exception's message. +func (s InvalidKeyId) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidKeyId) OrigErr() error { + return nil +} + +func (s InvalidKeyId) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidKeyId) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidKeyId) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified token is not valid. +type InvalidNextToken struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidNextToken) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNextToken) GoString() string { + return s.String() +} + +func newErrorInvalidNextToken(v protocol.ResponseMetadata) error { + return &InvalidNextToken{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNextToken) Code() string { + return "InvalidNextToken" +} + +// Message returns the exception's message. +func (s InvalidNextToken) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextToken) OrigErr() error { + return nil +} + +func (s InvalidNextToken) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextToken) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextToken) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more configuration items is not valid. Verify that a valid Amazon +// Resource Name (ARN) was provided for an Amazon SNS topic. +type InvalidNotificationConfig struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidNotificationConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNotificationConfig) GoString() string { + return s.String() +} + +func newErrorInvalidNotificationConfig(v protocol.ResponseMetadata) error { + return &InvalidNotificationConfig{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNotificationConfig) Code() string { + return "InvalidNotificationConfig" +} + +// Message returns the exception's message. +func (s InvalidNotificationConfig) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNotificationConfig) OrigErr() error { + return nil +} + +func (s InvalidNotificationConfig) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNotificationConfig) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNotificationConfig) RequestID() string { + return s.respMetadata.RequestID +} + +// The delete inventory option specified is not valid. Verify the option and +// try again. +type InvalidOptionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidOptionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidOptionException) GoString() string { + return s.String() +} + +func newErrorInvalidOptionException(v protocol.ResponseMetadata) error { + return &InvalidOptionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidOptionException) Code() string { + return "InvalidOptionException" +} + +// Message returns the exception's message. +func (s InvalidOptionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidOptionException) OrigErr() error { + return nil +} + +func (s InvalidOptionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidOptionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidOptionException) RequestID() string { + return s.respMetadata.RequestID +} + +// The S3 bucket does not exist. +type InvalidOutputFolder struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidOutputFolder) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidOutputFolder) GoString() string { + return s.String() +} + +func newErrorInvalidOutputFolder(v protocol.ResponseMetadata) error { + return &InvalidOutputFolder{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidOutputFolder) Code() string { + return "InvalidOutputFolder" +} + +// Message returns the exception's message. +func (s InvalidOutputFolder) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidOutputFolder) OrigErr() error { + return nil +} + +func (s InvalidOutputFolder) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidOutputFolder) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidOutputFolder) RequestID() string { + return s.respMetadata.RequestID +} + +// The output location is not valid or does not exist. +type InvalidOutputLocation struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidOutputLocation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidOutputLocation) GoString() string { + return s.String() +} + +func newErrorInvalidOutputLocation(v protocol.ResponseMetadata) error { + return &InvalidOutputLocation{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidOutputLocation) Code() string { + return "InvalidOutputLocation" +} + +// Message returns the exception's message. +func (s InvalidOutputLocation) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidOutputLocation) OrigErr() error { + return nil +} + +func (s InvalidOutputLocation) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidOutputLocation) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidOutputLocation) RequestID() string { + return s.respMetadata.RequestID +} + +// You must specify values for all required parameters in the Systems Manager +// document. You can only supply values to parameters defined in the Systems +// Manager document. +type InvalidParameters struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameters) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameters) GoString() string { + return s.String() +} + +func newErrorInvalidParameters(v protocol.ResponseMetadata) error { + return &InvalidParameters{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameters) Code() string { + return "InvalidParameters" +} + +// Message returns the exception's message. +func (s InvalidParameters) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameters) OrigErr() error { + return nil +} + +func (s InvalidParameters) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameters) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameters) RequestID() string { + return s.respMetadata.RequestID +} + +// The permission type is not supported. Share is the only supported permission +// type. +type InvalidPermissionType struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidPermissionType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPermissionType) GoString() string { + return s.String() +} + +func newErrorInvalidPermissionType(v protocol.ResponseMetadata) error { + return &InvalidPermissionType{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPermissionType) Code() string { + return "InvalidPermissionType" +} + +// Message returns the exception's message. +func (s InvalidPermissionType) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPermissionType) OrigErr() error { + return nil +} + +func (s InvalidPermissionType) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPermissionType) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPermissionType) RequestID() string { + return s.respMetadata.RequestID +} + +// The plugin name is not valid. +type InvalidPluginName struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidPluginName) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPluginName) GoString() string { + return s.String() +} + +func newErrorInvalidPluginName(v protocol.ResponseMetadata) error { + return &InvalidPluginName{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPluginName) Code() string { + return "InvalidPluginName" +} + +// Message returns the exception's message. +func (s InvalidPluginName) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPluginName) OrigErr() error { + return nil +} + +func (s InvalidPluginName) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPluginName) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPluginName) RequestID() string { + return s.respMetadata.RequestID +} + +// A policy attribute or its value is invalid. +type InvalidPolicyAttributeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidPolicyAttributeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPolicyAttributeException) GoString() string { + return s.String() +} + +func newErrorInvalidPolicyAttributeException(v protocol.ResponseMetadata) error { + return &InvalidPolicyAttributeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPolicyAttributeException) Code() string { + return "InvalidPolicyAttributeException" +} + +// Message returns the exception's message. +func (s InvalidPolicyAttributeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPolicyAttributeException) OrigErr() error { + return nil +} + +func (s InvalidPolicyAttributeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPolicyAttributeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPolicyAttributeException) RequestID() string { + return s.respMetadata.RequestID +} + +// The policy type is not supported. Parameter Store supports the following +// policy types: Expiration, ExpirationNotification, and NoChangeNotification. +type InvalidPolicyTypeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidPolicyTypeException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPolicyTypeException) GoString() string { + return s.String() +} + +func newErrorInvalidPolicyTypeException(v protocol.ResponseMetadata) error { + return &InvalidPolicyTypeException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPolicyTypeException) Code() string { + return "InvalidPolicyTypeException" +} + +// Message returns the exception's message. +func (s InvalidPolicyTypeException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPolicyTypeException) OrigErr() error { + return nil +} + +func (s InvalidPolicyTypeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPolicyTypeException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPolicyTypeException) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource ID is not valid. Verify that you entered the correct ID and +// try again. +type InvalidResourceId struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidResourceId) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidResourceId) GoString() string { + return s.String() +} + +func newErrorInvalidResourceId(v protocol.ResponseMetadata) error { + return &InvalidResourceId{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidResourceId) Code() string { + return "InvalidResourceId" +} + +// Message returns the exception's message. +func (s InvalidResourceId) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidResourceId) OrigErr() error { + return nil +} + +func (s InvalidResourceId) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidResourceId) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidResourceId) RequestID() string { + return s.respMetadata.RequestID +} + +// The resource type is not valid. For example, if you are attempting to tag +// an instance, the instance must be a registered, managed instance. +type InvalidResourceType struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidResourceType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidResourceType) GoString() string { + return s.String() +} + +func newErrorInvalidResourceType(v protocol.ResponseMetadata) error { + return &InvalidResourceType{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidResourceType) Code() string { + return "InvalidResourceType" +} + +// Message returns the exception's message. +func (s InvalidResourceType) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidResourceType) OrigErr() error { + return nil +} + +func (s InvalidResourceType) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidResourceType) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidResourceType) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified inventory item result attribute is not valid. +type InvalidResultAttributeException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s InstanceInformationFilter) String() string { +func (s InvalidResultAttributeException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InstanceInformationFilter) GoString() string { +func (s InvalidResultAttributeException) 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)) +func newErrorInvalidResultAttributeException(v protocol.ResponseMetadata) error { + return &InvalidResultAttributeException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidResultAttributeException) Code() string { + return "InvalidResultAttributeException" +} + +// Message returns the exception's message. +func (s InvalidResultAttributeException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidResultAttributeException) OrigErr() error { return nil } -// SetKey sets the Key field's value. -func (s *InstanceInformationFilter) SetKey(v string) *InstanceInformationFilter { - s.Key = &v - return s +func (s InvalidResultAttributeException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetValueSet sets the ValueSet field's value. -func (s *InstanceInformationFilter) SetValueSet(v []*string) *InstanceInformationFilter { - s.ValueSet = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidResultAttributeException) StatusCode() int { + return s.respMetadata.StatusCode } -// The filters to describe or get information about your managed instances. -type InstanceInformationStringFilter struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InvalidResultAttributeException) RequestID() string { + return s.respMetadata.RequestID +} - // 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 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 Configuring Amazon SNS Notifications for Run Command (http://docs.aws.amazon.com/systems-manager/latest/userguide/rc-sns-notifications.html) +// in the AWS Systems Manager User Guide. +type InvalidRole struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The filter values. - // - // Values is a required field - Values []*string `min:"1" type:"list" required:"true"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s InstanceInformationStringFilter) String() string { +func (s InvalidRole) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InstanceInformationStringFilter) GoString() string { +func (s InvalidRole) 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 +func newErrorInvalidRole(v protocol.ResponseMetadata) error { + return &InvalidRole{ + respMetadata: v, } - return nil } -// SetKey sets the Key field's value. -func (s *InstanceInformationStringFilter) SetKey(v string) *InstanceInformationStringFilter { - s.Key = &v - return s +// Code returns the exception type name. +func (s InvalidRole) Code() string { + return "InvalidRole" } -// SetValues sets the Values field's value. -func (s *InstanceInformationStringFilter) SetValues(v []*string) *InstanceInformationStringFilter { - s.Values = v - return s +// Message returns the exception's message. +func (s InvalidRole) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// 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. -type InstancePatchState struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRole) OrigErr() error { + return nil +} - // The ID of the patch baseline used to patch the instance. - // - // BaselineId is a required field - BaselineId *string `min:"20" type:"string" required:"true"` +func (s InvalidRole) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // 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"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRole) StatusCode() int { + return s.respMetadata.StatusCode +} - // An https URL or an Amazon S3 path-style URL to a list of patches to be installed. - // This patch installation list, which you maintain in an Amazon S3 bucket in - // YAML format and specify in the SSM document AWS-RunPatchBaseline, overrides - // the patches specified by the default patch baseline. - // - // For more information about the InstallOverrideList parameter, see About the - // SSM Document AWS-RunPatchBaseline (http://docs.aws.amazon.com/systems-manager/latest/userguide/patch-manager-about-aws-runpatchbaseline.html) - // in the AWS Systems Manager User Guide. - InstallOverrideList *string `min:"1" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s InvalidRole) RequestID() string { + return s.respMetadata.RequestID +} - // The number of patches from the patch baseline that are installed on the instance. - InstalledCount *int64 `type:"integer"` +// The schedule is invalid. Verify your cron or rate expression and try again. +type InvalidSchedule struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The number of patches not specified in the patch baseline that are installed - // on the instance. - InstalledOtherCount *int64 `type:"integer"` + Message_ *string `locationName:"Message" type:"string"` +} - // The number of instances with patches installed that are specified in a RejectedPatches - // list. Patches with a status of InstalledRejected were typically installed - // before they were added to a RejectedPatches list. - // - // If ALLOW_AS_DEPENDENCY is the specified option for RejectedPatchesAction, - // the value of InstalledRejectedCount will always be 0 (zero). - InstalledRejectedCount *int64 `type:"integer"` +// String returns the string representation +func (s InvalidSchedule) String() string { + return awsutil.Prettify(s) +} - // 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"` +// GoString returns the string representation +func (s InvalidSchedule) GoString() string { + return s.String() +} - // The number of patches from the patch baseline that are applicable for the - // instance but aren't currently installed. - MissingCount *int64 `type:"integer"` +func newErrorInvalidSchedule(v protocol.ResponseMetadata) error { + return &InvalidSchedule{ + respMetadata: v, + } +} - // The number of patches from the patch baseline that aren't applicable for - // the instance and therefore aren't installed on the instance. This number - // may be truncated if the list of patch names is very large. The number of - // patches beyond this limit are reported in UnreportedNotApplicableCount. - NotApplicableCount *int64 `type:"integer"` +// Code returns the exception type name. +func (s InvalidSchedule) Code() string { + return "InvalidSchedule" +} - // 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"` +// Message returns the exception's message. +func (s InvalidSchedule) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // The time the most recent patching operation completed on the instance. - // - // OperationEndTime is a required field - OperationEndTime *time.Time `type:"timestamp" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidSchedule) OrigErr() error { + return nil +} - // The time the most recent patching operation was started on the instance. - // - // OperationStartTime is a required field - OperationStartTime *time.Time `type:"timestamp" required:"true"` +func (s InvalidSchedule) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // Placeholder information. This field will always be empty in the current release - // of the service. - OwnerInformation *string `min:"1" type:"string" sensitive:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidSchedule) StatusCode() int { + return s.respMetadata.StatusCode +} - // The name of the patch group the managed instance belongs to. - // - // PatchGroup is a required field - PatchGroup *string `min:"1" type:"string" required:"true"` +// RequestID returns the service's response RequestID for request. +func (s InvalidSchedule) RequestID() string { + return s.respMetadata.RequestID +} - // The ID of the patch baseline snapshot used during the patching operation - // when this compliance data was collected. - SnapshotId *string `min:"36" type:"string"` +// 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. +type InvalidTarget struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The number of patches beyond the supported limit of NotApplicableCount that - // are not reported by name to Systems Manager Inventory. - UnreportedNotApplicableCount *int64 `type:"integer"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s InstancePatchState) String() string { +func (s InvalidTarget) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InstancePatchState) GoString() string { +func (s InvalidTarget) GoString() string { return s.String() } -// SetBaselineId sets the BaselineId field's value. -func (s *InstancePatchState) SetBaselineId(v string) *InstancePatchState { - s.BaselineId = &v - return s +func newErrorInvalidTarget(v protocol.ResponseMetadata) error { + return &InvalidTarget{ + respMetadata: v, + } } -// SetFailedCount sets the FailedCount field's value. -func (s *InstancePatchState) SetFailedCount(v int64) *InstancePatchState { - s.FailedCount = &v - return s +// Code returns the exception type name. +func (s InvalidTarget) Code() string { + return "InvalidTarget" } -// SetInstallOverrideList sets the InstallOverrideList field's value. -func (s *InstancePatchState) SetInstallOverrideList(v string) *InstancePatchState { - s.InstallOverrideList = &v - return s +// Message returns the exception's message. +func (s InvalidTarget) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetInstalledCount sets the InstalledCount field's value. -func (s *InstancePatchState) SetInstalledCount(v int64) *InstancePatchState { - s.InstalledCount = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTarget) OrigErr() error { + return nil } -// SetInstalledOtherCount sets the InstalledOtherCount field's value. -func (s *InstancePatchState) SetInstalledOtherCount(v int64) *InstancePatchState { - s.InstalledOtherCount = &v - return s +func (s InvalidTarget) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetInstalledRejectedCount sets the InstalledRejectedCount field's value. -func (s *InstancePatchState) SetInstalledRejectedCount(v int64) *InstancePatchState { - s.InstalledRejectedCount = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTarget) StatusCode() int { + return s.respMetadata.StatusCode } -// SetInstanceId sets the InstanceId field's value. -func (s *InstancePatchState) SetInstanceId(v string) *InstancePatchState { - s.InstanceId = &v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidTarget) RequestID() string { + return s.respMetadata.RequestID } -// SetMissingCount sets the MissingCount field's value. -func (s *InstancePatchState) SetMissingCount(v int64) *InstancePatchState { - s.MissingCount = &v - return s -} +// The parameter type name is not valid. +type InvalidTypeNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata -// SetNotApplicableCount sets the NotApplicableCount field's value. -func (s *InstancePatchState) SetNotApplicableCount(v int64) *InstancePatchState { - s.NotApplicableCount = &v - return s + Message_ *string `locationName:"Message" type:"string"` } -// SetOperation sets the Operation field's value. -func (s *InstancePatchState) SetOperation(v string) *InstancePatchState { - s.Operation = &v - return s +// String returns the string representation +func (s InvalidTypeNameException) String() string { + return awsutil.Prettify(s) } -// SetOperationEndTime sets the OperationEndTime field's value. -func (s *InstancePatchState) SetOperationEndTime(v time.Time) *InstancePatchState { - s.OperationEndTime = &v - return s +// GoString returns the string representation +func (s InvalidTypeNameException) GoString() string { + return s.String() } -// SetOperationStartTime sets the OperationStartTime field's value. -func (s *InstancePatchState) SetOperationStartTime(v time.Time) *InstancePatchState { - s.OperationStartTime = &v - return s +func newErrorInvalidTypeNameException(v protocol.ResponseMetadata) error { + return &InvalidTypeNameException{ + respMetadata: v, + } } -// SetOwnerInformation sets the OwnerInformation field's value. -func (s *InstancePatchState) SetOwnerInformation(v string) *InstancePatchState { - s.OwnerInformation = &v - return s +// Code returns the exception type name. +func (s InvalidTypeNameException) Code() string { + return "InvalidTypeNameException" } -// SetPatchGroup sets the PatchGroup field's value. -func (s *InstancePatchState) SetPatchGroup(v string) *InstancePatchState { - s.PatchGroup = &v - return s +// Message returns the exception's message. +func (s InvalidTypeNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetSnapshotId sets the SnapshotId field's value. -func (s *InstancePatchState) SetSnapshotId(v string) *InstancePatchState { - s.SnapshotId = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidTypeNameException) OrigErr() error { + return nil } -// SetUnreportedNotApplicableCount sets the UnreportedNotApplicableCount field's value. -func (s *InstancePatchState) SetUnreportedNotApplicableCount(v int64) *InstancePatchState { - s.UnreportedNotApplicableCount = &v - return s +func (s InvalidTypeNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// Defines a filter used in DescribeInstancePatchStatesForPatchGroup used to -// scope down the information returned by the API. -type InstancePatchStateFilter struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidTypeNameException) StatusCode() int { + return s.respMetadata.StatusCode +} - // 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"` +// RequestID returns the service's response RequestID for request. +func (s InvalidTypeNameException) RequestID() string { + return s.respMetadata.RequestID +} - // 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 update is not valid. +type InvalidUpdate struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // 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"` + Message_ *string `locationName:"Message" type:"string"` } // String returns the string representation -func (s InstancePatchStateFilter) String() string { +func (s InvalidUpdate) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s InstancePatchStateFilter) GoString() string { +func (s InvalidUpdate) 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)) +func newErrorInvalidUpdate(v protocol.ResponseMetadata) error { + return &InvalidUpdate{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidUpdate) Code() string { + return "InvalidUpdate" +} + +// Message returns the exception's message. +func (s InvalidUpdate) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidUpdate) OrigErr() error { return nil } -// SetKey sets the Key field's value. -func (s *InstancePatchStateFilter) SetKey(v string) *InstancePatchStateFilter { - s.Key = &v - return s +func (s InvalidUpdate) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetType sets the Type field's value. -func (s *InstancePatchStateFilter) SetType(v string) *InstancePatchStateFilter { - s.Type = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InvalidUpdate) StatusCode() int { + return s.respMetadata.StatusCode } -// SetValues sets the Values field's value. -func (s *InstancePatchStateFilter) SetValues(v []*string) *InstancePatchStateFilter { - s.Values = v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidUpdate) RequestID() string { + return s.respMetadata.RequestID } // Specifies the inventory type and attribute for the aggregation execution. @@ -25923,7 +30905,7 @@ type InventoryFilter struct { // 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" + // The type of filter. Type *string `type:"string" enum:"InventoryQueryOperatorType"` // Inventory filter values. Example: inventory filter where instance IDs are @@ -26367,6 +31349,179 @@ func (s *InventoryResultItem) SetTypeName(v string) *InventoryResultItem { return s } +// The command ID and instance ID you specified did not match any invocations. +// Verify the command ID and the instance ID and try again. +type InvocationDoesNotExist struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvocationDoesNotExist) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvocationDoesNotExist) GoString() string { + return s.String() +} + +func newErrorInvocationDoesNotExist(v protocol.ResponseMetadata) error { + return &InvocationDoesNotExist{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvocationDoesNotExist) Code() string { + return "InvocationDoesNotExist" +} + +// Message returns the exception's message. +func (s InvocationDoesNotExist) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvocationDoesNotExist) OrigErr() error { + return nil +} + +func (s InvocationDoesNotExist) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvocationDoesNotExist) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvocationDoesNotExist) RequestID() string { + return s.respMetadata.RequestID +} + +// The inventory item has invalid content. +type ItemContentMismatchException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + TypeName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ItemContentMismatchException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ItemContentMismatchException) GoString() string { + return s.String() +} + +func newErrorItemContentMismatchException(v protocol.ResponseMetadata) error { + return &ItemContentMismatchException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ItemContentMismatchException) Code() string { + return "ItemContentMismatchException" +} + +// Message returns the exception's message. +func (s ItemContentMismatchException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ItemContentMismatchException) OrigErr() error { + return nil +} + +func (s ItemContentMismatchException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ItemContentMismatchException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ItemContentMismatchException) RequestID() string { + return s.respMetadata.RequestID +} + +// The inventory item size has exceeded the size limit. +type ItemSizeLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + TypeName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ItemSizeLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ItemSizeLimitExceededException) GoString() string { + return s.String() +} + +func newErrorItemSizeLimitExceededException(v protocol.ResponseMetadata) error { + return &ItemSizeLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ItemSizeLimitExceededException) Code() string { + return "ItemSizeLimitExceededException" +} + +// Message returns the exception's message. +func (s ItemSizeLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ItemSizeLimitExceededException) OrigErr() error { + return nil +} + +func (s ItemSizeLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ItemSizeLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ItemSizeLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + type LabelParameterVersionInput struct { _ struct{} `type:"structure"` @@ -26679,7 +31834,7 @@ type ListCommandInvocationsInput struct { Details *bool `type:"boolean"` // (Optional) One or more filters. Use a filter to return a more specific list - // of results. + // of results. Note that the DocumentName filter is not supported for ListCommandInvocations. Filters []*CommandFilter `min:"1" type:"list"` // (Optional) The command execution details for a specific instance ID. @@ -27164,7 +32319,7 @@ type ListDocumentVersionsInput struct { // results. MaxResults *int64 `min:"1" type:"integer"` - // The name of the document about which you want version information. + // The name of the document. You can specify an Amazon Resource Name (ARN). // // Name is a required field Name *string `type:"string" required:"true"` @@ -27654,6 +32809,12 @@ type ListResourceDataSyncInput struct { // A token to start the list. Use this token to get the next set of results. NextToken *string `type:"string"` + + // View a list of resource data syncs according to the sync type. Specify SyncToDestination + // to view resource data syncs that synchronize data to an Amazon S3 buckets. + // Specify SyncFromSource to view resource data syncs from AWS Organizations + // or from multiple AWS Regions. + SyncType *string `min:"1" type:"string"` } // String returns the string representation @@ -27672,6 +32833,9 @@ func (s *ListResourceDataSyncInput) Validate() error { if s.MaxResults != nil && *s.MaxResults < 1 { invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } + if s.SyncType != nil && len(*s.SyncType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SyncType", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -27691,6 +32855,12 @@ func (s *ListResourceDataSyncInput) SetNextToken(v string) *ListResourceDataSync return s } +// SetSyncType sets the SyncType field's value. +func (s *ListResourceDataSyncInput) SetSyncType(v string) *ListResourceDataSyncInput { + s.SyncType = &v + return s +} + type ListResourceDataSyncOutput struct { _ struct{} `type:"structure"` @@ -28520,6 +33690,9 @@ func (s *MaintenanceWindowLambdaParameters) SetQualifier(v string) *MaintenanceW type MaintenanceWindowRunCommandParameters struct { _ struct{} `type:"structure"` + // Configuration options for sending command output to CloudWatch Logs. + CloudWatchOutputConfig *CloudWatchOutputConfig `type:"structure"` + // Information about the commands to run. Comment *string `type:"string"` @@ -28530,6 +33703,19 @@ type MaintenanceWindowRunCommandParameters struct { // SHA-256 or SHA-1. SHA-1 hashes have been deprecated. DocumentHashType *string `type:"string" enum:"DocumentHashType"` + // The SSM document version to use in the request. You can specify $DEFAULT, + // $LATEST, or a specific version number. If you run commands by using the AWS + // CLI, then you must escape the first two options by using a backslash. If + // you specify a version number, then you don't need to use the backslash. For + // example: + // + // --document-version "\$DEFAULT" + // + // --document-version "\$LATEST" + // + // --document-version "3" + DocumentVersion *string `type:"string"` + // Configurations for sending notifications about command status changes on // a per-instance basis. NotificationConfig *NotificationConfig `type:"structure"` @@ -28571,6 +33757,11 @@ func (s *MaintenanceWindowRunCommandParameters) Validate() error { if s.TimeoutSeconds != nil && *s.TimeoutSeconds < 30 { invalidParams.Add(request.NewErrParamMinValue("TimeoutSeconds", 30)) } + if s.CloudWatchOutputConfig != nil { + if err := s.CloudWatchOutputConfig.Validate(); err != nil { + invalidParams.AddNested("CloudWatchOutputConfig", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -28578,6 +33769,12 @@ func (s *MaintenanceWindowRunCommandParameters) Validate() error { return nil } +// SetCloudWatchOutputConfig sets the CloudWatchOutputConfig field's value. +func (s *MaintenanceWindowRunCommandParameters) SetCloudWatchOutputConfig(v *CloudWatchOutputConfig) *MaintenanceWindowRunCommandParameters { + s.CloudWatchOutputConfig = v + return s +} + // SetComment sets the Comment field's value. func (s *MaintenanceWindowRunCommandParameters) SetComment(v string) *MaintenanceWindowRunCommandParameters { s.Comment = &v @@ -28596,6 +33793,12 @@ func (s *MaintenanceWindowRunCommandParameters) SetDocumentHashType(v string) *M return s } +// SetDocumentVersion sets the DocumentVersion field's value. +func (s *MaintenanceWindowRunCommandParameters) SetDocumentVersion(v string) *MaintenanceWindowRunCommandParameters { + s.DocumentVersion = &v + return s +} + // SetNotificationConfig sets the NotificationConfig field's value. func (s *MaintenanceWindowRunCommandParameters) SetNotificationConfig(v *NotificationConfig) *MaintenanceWindowRunCommandParameters { s.NotificationConfig = v @@ -29037,6 +34240,62 @@ func (s *MaintenanceWindowTaskParameterValueExpression) SetValues(v []*string) * return s } +// The size limit of a document is 64 KB. +type MaxDocumentSizeExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s MaxDocumentSizeExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MaxDocumentSizeExceeded) GoString() string { + return s.String() +} + +func newErrorMaxDocumentSizeExceeded(v protocol.ResponseMetadata) error { + return &MaxDocumentSizeExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MaxDocumentSizeExceeded) Code() string { + return "MaxDocumentSizeExceeded" +} + +// Message returns the exception's message. +func (s MaxDocumentSizeExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MaxDocumentSizeExceeded) OrigErr() error { + return nil +} + +func (s MaxDocumentSizeExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MaxDocumentSizeExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MaxDocumentSizeExceeded) RequestID() string { + return s.respMetadata.RequestID +} + type ModifyDocumentPermissionInput struct { _ struct{} `type:"structure"` @@ -29059,6 +34318,10 @@ type ModifyDocumentPermissionInput struct { // // PermissionType is a required field PermissionType *string `type:"string" required:"true" enum:"DocumentPermissionType"` + + // (Optional) The version of the document to share. If it's not specified, the + // system choose the Default version to share. + SharedDocumentVersion *string `type:"string"` } // String returns the string representation @@ -29111,6 +34374,12 @@ func (s *ModifyDocumentPermissionInput) SetPermissionType(v string) *ModifyDocum return s } +// SetSharedDocumentVersion sets the SharedDocumentVersion field's value. +func (s *ModifyDocumentPermissionInput) SetSharedDocumentVersion(v string) *ModifyDocumentPermissionInput { + s.SharedDocumentVersion = &v + return s +} + type ModifyDocumentPermissionOutput struct { _ struct{} `type:"structure"` } @@ -29358,6 +34627,9 @@ func (s *OpsEntity) SetId(v string) *OpsEntity { type OpsEntityItem struct { _ struct{} `type:"structure"` + // The time OpsItem data was captured. + CaptureTime *string `type:"string"` + // The detailed data content for an OpsItem summaries result item. Content []map[string]*string `type:"list"` } @@ -29372,6 +34644,12 @@ func (s OpsEntityItem) GoString() string { return s.String() } +// SetCaptureTime sets the CaptureTime field's value. +func (s *OpsEntityItem) SetCaptureTime(v string) *OpsEntityItem { + s.CaptureTime = &v + return s +} + // SetContent sets the Content field's value. func (s *OpsEntityItem) SetContent(v []map[string]*string) *OpsEntityItem { s.Content = v @@ -29454,6 +34732,10 @@ func (s *OpsFilter) SetValues(v []*string) *OpsFilter { type OpsItem struct { _ struct{} `type:"structure"` + // An OpsItem category. Category options include: Availability, Cost, Performance, + // Recovery, Security. + Category *string `min:"1" type:"string"` + // The ARN of the AWS account that created the OpsItem. CreatedBy *string `type:"string"` @@ -29507,6 +34789,9 @@ type OpsItem struct { // impacted resources, or statuses for the impacted resource. RelatedOpsItems []*RelatedOpsItem `type:"list"` + // The severity of the OpsItem. Severity options range from 1 to 4. + Severity *string `min:"1" type:"string"` + // The origin of the OpsItem, such as Amazon EC2 or AWS Systems Manager. The // impacted resource is a subset of source. Source *string `min:"1" type:"string"` @@ -29535,6 +34820,12 @@ func (s OpsItem) GoString() string { return s.String() } +// SetCategory sets the Category field's value. +func (s *OpsItem) SetCategory(v string) *OpsItem { + s.Category = &v + return s +} + // SetCreatedBy sets the CreatedBy field's value. func (s *OpsItem) SetCreatedBy(v string) *OpsItem { s.CreatedBy = &v @@ -29595,6 +34886,12 @@ func (s *OpsItem) SetRelatedOpsItems(v []*RelatedOpsItem) *OpsItem { return s } +// SetSeverity sets the Severity field's value. +func (s *OpsItem) SetSeverity(v string) *OpsItem { + s.Severity = &v + return s +} + // SetSource sets the Source field's value. func (s *OpsItem) SetSource(v string) *OpsItem { s.Source = &v @@ -29619,6 +34916,64 @@ func (s *OpsItem) SetVersion(v string) *OpsItem { return s } +// The OpsItem already exists. +type OpsItemAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + OpsItemId *string `type:"string"` +} + +// String returns the string representation +func (s OpsItemAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OpsItemAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorOpsItemAlreadyExistsException(v protocol.ResponseMetadata) error { + return &OpsItemAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OpsItemAlreadyExistsException) Code() string { + return "OpsItemAlreadyExistsException" +} + +// Message returns the exception's message. +func (s OpsItemAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OpsItemAlreadyExistsException) OrigErr() error { + return nil +} + +func (s OpsItemAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OpsItemAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OpsItemAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + // An object that defines the value of the key and its type in the OperationalData // map. type OpsItemDataValue struct { @@ -29720,6 +35075,184 @@ func (s *OpsItemFilter) SetValues(v []*string) *OpsItemFilter { return s } +// A specified parameter argument isn't valid. Verify the available arguments +// and try again. +type OpsItemInvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + ParameterNames []*string `type:"list"` +} + +// String returns the string representation +func (s OpsItemInvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OpsItemInvalidParameterException) GoString() string { + return s.String() +} + +func newErrorOpsItemInvalidParameterException(v protocol.ResponseMetadata) error { + return &OpsItemInvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OpsItemInvalidParameterException) Code() string { + return "OpsItemInvalidParameterException" +} + +// Message returns the exception's message. +func (s OpsItemInvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OpsItemInvalidParameterException) OrigErr() error { + return nil +} + +func (s OpsItemInvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OpsItemInvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OpsItemInvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request caused OpsItems to exceed one or more quotas. For information +// about OpsItem quotas, see What are the resource limits for OpsCenter? (http://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-learn-more.html#OpsCenter-learn-more-limits). +type OpsItemLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Limit *int64 `type:"integer"` + + LimitType *string `type:"string"` + + Message_ *string `locationName:"Message" type:"string"` + + ResourceTypes []*string `type:"list"` +} + +// String returns the string representation +func (s OpsItemLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OpsItemLimitExceededException) GoString() string { + return s.String() +} + +func newErrorOpsItemLimitExceededException(v protocol.ResponseMetadata) error { + return &OpsItemLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OpsItemLimitExceededException) Code() string { + return "OpsItemLimitExceededException" +} + +// Message returns the exception's message. +func (s OpsItemLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OpsItemLimitExceededException) OrigErr() error { + return nil +} + +func (s OpsItemLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OpsItemLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OpsItemLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified OpsItem ID doesn't exist. Verify the ID and try again. +type OpsItemNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s OpsItemNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OpsItemNotFoundException) GoString() string { + return s.String() +} + +func newErrorOpsItemNotFoundException(v protocol.ResponseMetadata) error { + return &OpsItemNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OpsItemNotFoundException) Code() string { + return "OpsItemNotFoundException" +} + +// Message returns the exception's message. +func (s OpsItemNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OpsItemNotFoundException) OrigErr() error { + return nil +} + +func (s OpsItemNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OpsItemNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OpsItemNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + // A notification about the OpsItem. type OpsItemNotification struct { _ struct{} `type:"structure"` @@ -29749,6 +35282,9 @@ func (s *OpsItemNotification) SetArn(v string) *OpsItemNotification { type OpsItemSummary struct { _ struct{} `type:"structure"` + // A list of OpsItems by category. + Category *string `min:"1" type:"string"` + // The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem. CreatedBy *string `type:"string"` @@ -29771,6 +35307,9 @@ type OpsItemSummary struct { // The importance of this OpsItem in relation to other OpsItems in the system. Priority *int64 `min:"1" type:"integer"` + // A list of OpsItems by severity. + Severity *string `min:"1" type:"string"` + // The impacted AWS resource. Source *string `min:"1" type:"string"` @@ -29792,6 +35331,12 @@ func (s OpsItemSummary) GoString() string { return s.String() } +// SetCategory sets the Category field's value. +func (s *OpsItemSummary) SetCategory(v string) *OpsItemSummary { + s.Category = &v + return s +} + // SetCreatedBy sets the CreatedBy field's value. func (s *OpsItemSummary) SetCreatedBy(v string) *OpsItemSummary { s.CreatedBy = &v @@ -29834,6 +35379,12 @@ func (s *OpsItemSummary) SetPriority(v int64) *OpsItemSummary { return s } +// SetSeverity sets the Severity field's value. +func (s *OpsItemSummary) SetSeverity(v string) *OpsItemSummary { + s.Severity = &v + return s +} + // SetSource sets the Source field's value. func (s *OpsItemSummary) SetSource(v string) *OpsItemSummary { s.Source = &v @@ -29852,6 +35403,49 @@ func (s *OpsItemSummary) SetTitle(v string) *OpsItemSummary { return s } +// The OpsItem data type to return. +type OpsResultAttribute struct { + _ struct{} `type:"structure"` + + // Name of the data type. Valid value: AWS:OpsItem, AWS:EC2InstanceInformation, + // AWS:OpsItemTrendline, or AWS:ComplianceSummary. + // + // TypeName is a required field + TypeName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s OpsResultAttribute) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OpsResultAttribute) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *OpsResultAttribute) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "OpsResultAttribute"} + 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 *OpsResultAttribute) SetTypeName(v string) *OpsResultAttribute { + s.TypeName = &v + return s +} + // Information about the source where the association execution details are // stored. type OutputSource struct { @@ -29982,6 +35576,62 @@ func (s *Parameter) SetVersion(v int64) *Parameter { return s } +// The parameter already exists. You can't create duplicate parameters. +type ParameterAlreadyExists struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ParameterAlreadyExists) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ParameterAlreadyExists) GoString() string { + return s.String() +} + +func newErrorParameterAlreadyExists(v protocol.ResponseMetadata) error { + return &ParameterAlreadyExists{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ParameterAlreadyExists) Code() string { + return "ParameterAlreadyExists" +} + +// Message returns the exception's message. +func (s ParameterAlreadyExists) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ParameterAlreadyExists) OrigErr() error { + return nil +} + +func (s ParameterAlreadyExists) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ParameterAlreadyExists) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ParameterAlreadyExists) RequestID() string { + return s.respMetadata.RequestID +} + // Information about parameter usage. type ParameterHistory struct { _ struct{} `type:"structure"` @@ -30156,6 +35806,119 @@ func (s *ParameterInlinePolicy) SetPolicyType(v string) *ParameterInlinePolicy { return s } +// You have exceeded the number of parameters for this AWS account. Delete one +// or more parameters and try again. +type ParameterLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ParameterLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ParameterLimitExceeded) GoString() string { + return s.String() +} + +func newErrorParameterLimitExceeded(v protocol.ResponseMetadata) error { + return &ParameterLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ParameterLimitExceeded) Code() string { + return "ParameterLimitExceeded" +} + +// Message returns the exception's message. +func (s ParameterLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ParameterLimitExceeded) OrigErr() error { + return nil +} + +func (s ParameterLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ParameterLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ParameterLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + +// The parameter exceeded the maximum number of allowed versions. +type ParameterMaxVersionLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ParameterMaxVersionLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ParameterMaxVersionLimitExceeded) GoString() string { + return s.String() +} + +func newErrorParameterMaxVersionLimitExceeded(v protocol.ResponseMetadata) error { + return &ParameterMaxVersionLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ParameterMaxVersionLimitExceeded) Code() string { + return "ParameterMaxVersionLimitExceeded" +} + +// Message returns the exception's message. +func (s ParameterMaxVersionLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ParameterMaxVersionLimitExceeded) OrigErr() error { + return nil +} + +func (s ParameterMaxVersionLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ParameterMaxVersionLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ParameterMaxVersionLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + // Metadata includes information like the ARN of the last user and the date/time // the parameter was last used. type ParameterMetadata struct { @@ -30265,11 +36028,134 @@ func (s *ParameterMetadata) SetVersion(v int64) *ParameterMetadata { return s } +// The parameter could not be found. Verify the name and try again. +type ParameterNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ParameterNotFound) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ParameterNotFound) GoString() string { + return s.String() +} + +func newErrorParameterNotFound(v protocol.ResponseMetadata) error { + return &ParameterNotFound{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ParameterNotFound) Code() string { + return "ParameterNotFound" +} + +// Message returns the exception's message. +func (s ParameterNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ParameterNotFound) OrigErr() error { + return nil +} + +func (s ParameterNotFound) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ParameterNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ParameterNotFound) RequestID() string { + return s.respMetadata.RequestID +} + +// The parameter name is not valid. +type ParameterPatternMismatchException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The parameter name is not valid. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ParameterPatternMismatchException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ParameterPatternMismatchException) GoString() string { + return s.String() +} + +func newErrorParameterPatternMismatchException(v protocol.ResponseMetadata) error { + return &ParameterPatternMismatchException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ParameterPatternMismatchException) Code() string { + return "ParameterPatternMismatchException" +} + +// Message returns the exception's message. +func (s ParameterPatternMismatchException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ParameterPatternMismatchException) OrigErr() error { + return nil +} + +func (s ParameterPatternMismatchException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ParameterPatternMismatchException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ParameterPatternMismatchException) RequestID() string { + return s.respMetadata.RequestID +} + // One or more filters. Use a filter to return a more specific list of results. // -// The Name and Tier filter keys can't be used with the GetParametersByPath -// API action. Also, the Label filter key can't be used with the DescribeParameters -// API action. +// The ParameterStringFilter object is used by the DescribeParameters and GetParametersByPath +// API actions. However, not all of the pattern values listed for Key can be +// used with both actions. +// +// For DescribeActions, all of the listed patterns are valid, with the exception +// of Label. +// +// For GetParametersByPath, the following patterns listed for Key are not valid: +// Name, Path, and Tier. +// +// For examples of CLI commands demonstrating valid parameter filter constructions, +// see Searching for Systems Manager Parameters (http://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-search.html) +// in the AWS Systems Manager User Guide. type ParameterStringFilter struct { _ struct{} `type:"structure"` @@ -30278,8 +36164,14 @@ type ParameterStringFilter struct { // Key is a required field Key *string `min:"1" type:"string" required:"true"` - // Valid options are Equals and BeginsWith. For Path filter, valid options are - // Recursive and OneLevel. + // For all filters used with DescribeParameters, valid options include Equals + // and BeginsWith. The Name filter additionally supports the Contains option. + // (Exception: For filters using the key Path, valid options include Recursive + // and OneLevel.) + // + // For filters used with GetParametersByPath, valid options include Equals and + // BeginsWith. (Exception: For filters using the key Label, the only valid option + // is Equals.) Option *string `min:"1" type:"string"` // The value you want to search for. @@ -30336,6 +36228,119 @@ func (s *ParameterStringFilter) SetValues(v []*string) *ParameterStringFilter { return s } +// A parameter version can have a maximum of ten labels. +type ParameterVersionLabelLimitExceeded struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ParameterVersionLabelLimitExceeded) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ParameterVersionLabelLimitExceeded) GoString() string { + return s.String() +} + +func newErrorParameterVersionLabelLimitExceeded(v protocol.ResponseMetadata) error { + return &ParameterVersionLabelLimitExceeded{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ParameterVersionLabelLimitExceeded) Code() string { + return "ParameterVersionLabelLimitExceeded" +} + +// Message returns the exception's message. +func (s ParameterVersionLabelLimitExceeded) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ParameterVersionLabelLimitExceeded) OrigErr() error { + return nil +} + +func (s ParameterVersionLabelLimitExceeded) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ParameterVersionLabelLimitExceeded) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ParameterVersionLabelLimitExceeded) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified parameter version was not found. Verify the parameter name +// and version, and try again. +type ParameterVersionNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ParameterVersionNotFound) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ParameterVersionNotFound) GoString() string { + return s.String() +} + +func newErrorParameterVersionNotFound(v protocol.ResponseMetadata) error { + return &ParameterVersionNotFound{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ParameterVersionNotFound) Code() string { + return "ParameterVersionNotFound" +} + +// Message returns the exception's message. +func (s ParameterVersionNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ParameterVersionNotFound) OrigErr() error { + return nil +} + +func (s ParameterVersionNotFound) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ParameterVersionNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ParameterVersionNotFound) RequestID() string { + return s.respMetadata.RequestID +} + // This data type is deprecated. Instead, use ParameterStringFilter. type ParametersFilter struct { _ struct{} `type:"structure"` @@ -30886,9 +36891,11 @@ type PatchRule struct { // The number of days after the release date of each patch matched by the rule // that the patch is marked as approved in the patch baseline. For example, // a value of 7 means that patches are approved seven days after they are released. - // - // ApproveAfterDays is a required field - ApproveAfterDays *int64 `type:"integer" required:"true"` + ApproveAfterDays *int64 `type:"integer"` + + // The cutoff date for auto approval of released patches. Any patches released + // on or before this date will be installed automatically + ApproveUntilDate *string `min:"1" type:"string"` // A compliance severity level for all approved patches in a patch baseline. // Valid compliance severity levels include the following: Unspecified, Critical, @@ -30919,8 +36926,8 @@ func (s PatchRule) GoString() 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.ApproveUntilDate != nil && len(*s.ApproveUntilDate) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ApproveUntilDate", 1)) } if s.PatchFilterGroup == nil { invalidParams.Add(request.NewErrParamRequired("PatchFilterGroup")) @@ -30943,6 +36950,12 @@ func (s *PatchRule) SetApproveAfterDays(v int64) *PatchRule { return s } +// SetApproveUntilDate sets the ApproveUntilDate field's value. +func (s *PatchRule) SetApproveUntilDate(v string) *PatchRule { + s.ApproveUntilDate = &v + return s +} + // SetComplianceLevel sets the ComplianceLevel field's value. func (s *PatchRule) SetComplianceLevel(v string) *PatchRule { s.ComplianceLevel = &v @@ -31137,6 +37150,63 @@ func (s *PatchStatus) SetDeploymentStatus(v string) *PatchStatus { return s } +// You specified more than the maximum number of allowed policies for the parameter. +// The maximum is 10. +type PoliciesLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s PoliciesLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PoliciesLimitExceededException) GoString() string { + return s.String() +} + +func newErrorPoliciesLimitExceededException(v protocol.ResponseMetadata) error { + return &PoliciesLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s PoliciesLimitExceededException) Code() string { + return "PoliciesLimitExceededException" +} + +// Message returns the exception's message. +func (s PoliciesLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s PoliciesLimitExceededException) OrigErr() error { + return nil +} + +func (s PoliciesLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s PoliciesLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s PoliciesLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // An aggregate of step execution statuses displayed in the AWS Console for // a multi-Region and multi-account Automation execution. type ProgressCounters struct { @@ -31356,7 +37426,7 @@ func (s PutComplianceItemsOutput) GoString() string { type PutInventoryInput struct { _ struct{} `type:"structure"` - // One or more instance IDs where you want to add or update inventory items. + // An instance ID where you want to add or update inventory items. // // InstanceId is a required field InstanceId *string `type:"string" required:"true"` @@ -31473,7 +37543,9 @@ type PutParameterInput struct { // The fully qualified name of the parameter that you want to add to the system. // The fully qualified name includes the complete hierarchy of the parameter - // path and name. For example: /Dev/DBServer/MySQL/db-string13 + // path and name. For parameters in a hierarchy, you must include a leading + // forward slash character (/) when you create or reference a parameter. For + // example: /Dev/DBServer/MySQL/db-string13 // // Naming Constraints: // @@ -31495,8 +37567,12 @@ type PutParameterInput struct { // in the AWS Systems Manager User Guide. // // The maximum length constraint listed below includes capacity for additional - // system attributes that are not part of the name. The maximum length for the - // fully qualified parameter name is 1011 characters. + // system attributes that are not part of the name. The maximum length for a + // parameter name, including the full length of the parameter ARN, is 1011 characters. + // For example, the length of the following parameter name is 65 characters, + // not 20 characters: + // + // arn:aws:ssm:us-east-2:111122223333:parameter/ExampleParameterName // // Name is a required field Name *string `min:"1" type:"string" required:"true"` @@ -32714,6 +38790,302 @@ func (s *ResourceComplianceSummaryItem) SetStatus(v string) *ResourceComplianceS return s } +// A sync configuration with the same name already exists. +type ResourceDataSyncAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + SyncName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ResourceDataSyncAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceDataSyncAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceDataSyncAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceDataSyncAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceDataSyncAlreadyExistsException) Code() string { + return "ResourceDataSyncAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceDataSyncAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceDataSyncAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceDataSyncAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceDataSyncAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceDataSyncAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// Information about the AwsOrganizationsSource resource data sync source. A +// sync source of this type can synchronize data from AWS Organizations or, +// if an AWS Organization is not present, from multiple AWS Regions. +type ResourceDataSyncAwsOrganizationsSource struct { + _ struct{} `type:"structure"` + + // If an AWS Organization is present, this is either OrganizationalUnits or + // EntireOrganization. For OrganizationalUnits, the data is aggregated from + // a set of organization units. For EntireOrganization, the data is aggregated + // from the entire AWS Organization. + // + // OrganizationSourceType is a required field + OrganizationSourceType *string `min:"1" type:"string" required:"true"` + + // The AWS Organizations organization units included in the sync. + OrganizationalUnits []*ResourceDataSyncOrganizationalUnit `min:"1" type:"list"` +} + +// String returns the string representation +func (s ResourceDataSyncAwsOrganizationsSource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceDataSyncAwsOrganizationsSource) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResourceDataSyncAwsOrganizationsSource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResourceDataSyncAwsOrganizationsSource"} + if s.OrganizationSourceType == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationSourceType")) + } + if s.OrganizationSourceType != nil && len(*s.OrganizationSourceType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OrganizationSourceType", 1)) + } + if s.OrganizationalUnits != nil && len(s.OrganizationalUnits) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OrganizationalUnits", 1)) + } + if s.OrganizationalUnits != nil { + for i, v := range s.OrganizationalUnits { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "OrganizationalUnits", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOrganizationSourceType sets the OrganizationSourceType field's value. +func (s *ResourceDataSyncAwsOrganizationsSource) SetOrganizationSourceType(v string) *ResourceDataSyncAwsOrganizationsSource { + s.OrganizationSourceType = &v + return s +} + +// SetOrganizationalUnits sets the OrganizationalUnits field's value. +func (s *ResourceDataSyncAwsOrganizationsSource) SetOrganizationalUnits(v []*ResourceDataSyncOrganizationalUnit) *ResourceDataSyncAwsOrganizationsSource { + s.OrganizationalUnits = v + return s +} + +// Another UpdateResourceDataSync request is being processed. Wait a few minutes +// and try again. +type ResourceDataSyncConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceDataSyncConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceDataSyncConflictException) GoString() string { + return s.String() +} + +func newErrorResourceDataSyncConflictException(v protocol.ResponseMetadata) error { + return &ResourceDataSyncConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceDataSyncConflictException) Code() string { + return "ResourceDataSyncConflictException" +} + +// Message returns the exception's message. +func (s ResourceDataSyncConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceDataSyncConflictException) OrigErr() error { + return nil +} + +func (s ResourceDataSyncConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceDataSyncConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceDataSyncConflictException) RequestID() string { + return s.respMetadata.RequestID +} + +// You have exceeded the allowed maximum sync configurations. +type ResourceDataSyncCountExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceDataSyncCountExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceDataSyncCountExceededException) GoString() string { + return s.String() +} + +func newErrorResourceDataSyncCountExceededException(v protocol.ResponseMetadata) error { + return &ResourceDataSyncCountExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceDataSyncCountExceededException) Code() string { + return "ResourceDataSyncCountExceededException" +} + +// Message returns the exception's message. +func (s ResourceDataSyncCountExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceDataSyncCountExceededException) OrigErr() error { + return nil +} + +func (s ResourceDataSyncCountExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceDataSyncCountExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceDataSyncCountExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified sync configuration is invalid. +type ResourceDataSyncInvalidConfigurationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceDataSyncInvalidConfigurationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceDataSyncInvalidConfigurationException) GoString() string { + return s.String() +} + +func newErrorResourceDataSyncInvalidConfigurationException(v protocol.ResponseMetadata) error { + return &ResourceDataSyncInvalidConfigurationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceDataSyncInvalidConfigurationException) Code() string { + return "ResourceDataSyncInvalidConfigurationException" +} + +// Message returns the exception's message. +func (s ResourceDataSyncInvalidConfigurationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceDataSyncInvalidConfigurationException) OrigErr() error { + return nil +} + +func (s ResourceDataSyncInvalidConfigurationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceDataSyncInvalidConfigurationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceDataSyncInvalidConfigurationException) RequestID() string { + return s.respMetadata.RequestID +} + // Information about a Resource Data Sync configuration, including its current // status and last successful sync. type ResourceDataSyncItem struct { @@ -32737,8 +39109,20 @@ type ResourceDataSyncItem struct { // The date and time the configuration was created (UTC). SyncCreatedTime *time.Time `type:"timestamp"` + // The date and time the resource data sync was changed. + SyncLastModifiedTime *time.Time `type:"timestamp"` + // The name of the Resource Data Sync. SyncName *string `min:"1" type:"string"` + + // Information about the source where the data was synchronized. + SyncSource *ResourceDataSyncSourceWithState `type:"structure"` + + // The type of resource data sync. If SyncType is SyncToDestination, then the + // resource data sync synchronizes data to an Amazon S3 bucket. If the SyncType + // is SyncFromSource then the resource data sync synchronizes data from AWS + // Organizations or from multiple AWS Regions. + SyncType *string `min:"1" type:"string"` } // String returns the string representation @@ -32787,12 +39171,127 @@ func (s *ResourceDataSyncItem) SetSyncCreatedTime(v time.Time) *ResourceDataSync return s } +// SetSyncLastModifiedTime sets the SyncLastModifiedTime field's value. +func (s *ResourceDataSyncItem) SetSyncLastModifiedTime(v time.Time) *ResourceDataSyncItem { + s.SyncLastModifiedTime = &v + return s +} + // SetSyncName sets the SyncName field's value. func (s *ResourceDataSyncItem) SetSyncName(v string) *ResourceDataSyncItem { s.SyncName = &v return s } +// SetSyncSource sets the SyncSource field's value. +func (s *ResourceDataSyncItem) SetSyncSource(v *ResourceDataSyncSourceWithState) *ResourceDataSyncItem { + s.SyncSource = v + return s +} + +// SetSyncType sets the SyncType field's value. +func (s *ResourceDataSyncItem) SetSyncType(v string) *ResourceDataSyncItem { + s.SyncType = &v + return s +} + +// The specified sync name was not found. +type ResourceDataSyncNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + SyncName *string `min:"1" type:"string"` + + SyncType *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ResourceDataSyncNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceDataSyncNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceDataSyncNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceDataSyncNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceDataSyncNotFoundException) Code() string { + return "ResourceDataSyncNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceDataSyncNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceDataSyncNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceDataSyncNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceDataSyncNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceDataSyncNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The AWS Organizations organizational unit data source for the sync. +type ResourceDataSyncOrganizationalUnit struct { + _ struct{} `type:"structure"` + + // The AWS Organization unit ID data source for the sync. + OrganizationalUnitId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ResourceDataSyncOrganizationalUnit) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceDataSyncOrganizationalUnit) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResourceDataSyncOrganizationalUnit) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResourceDataSyncOrganizationalUnit"} + if s.OrganizationalUnitId != nil && len(*s.OrganizationalUnitId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("OrganizationalUnitId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOrganizationalUnitId sets the OrganizationalUnitId field's value. +func (s *ResourceDataSyncOrganizationalUnit) SetOrganizationalUnitId(v string) *ResourceDataSyncOrganizationalUnit { + s.OrganizationalUnitId = &v + return s +} + // Information about the target Amazon S3 bucket for the Resource Data Sync. type ResourceDataSyncS3Destination struct { _ struct{} `type:"structure"` @@ -32891,6 +39390,295 @@ func (s *ResourceDataSyncS3Destination) SetSyncFormat(v string) *ResourceDataSyn return s } +// Information about the source of the data included in the resource data sync. +type ResourceDataSyncSource struct { + _ struct{} `type:"structure"` + + // Information about the AwsOrganizationsSource resource data sync source. A + // sync source of this type can synchronize data from AWS Organizations. + AwsOrganizationsSource *ResourceDataSyncAwsOrganizationsSource `type:"structure"` + + // Whether to automatically synchronize and aggregate data from new AWS Regions + // when those Regions come online. + IncludeFutureRegions *bool `type:"boolean"` + + // The SyncSource AWS Regions included in the resource data sync. + // + // SourceRegions is a required field + SourceRegions []*string `type:"list" required:"true"` + + // The type of data source for the resource data sync. SourceType is either + // AwsOrganizations (if an organization is present in AWS Organizations) or + // singleAccountMultiRegions. + // + // SourceType is a required field + SourceType *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ResourceDataSyncSource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceDataSyncSource) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResourceDataSyncSource) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResourceDataSyncSource"} + if s.SourceRegions == nil { + invalidParams.Add(request.NewErrParamRequired("SourceRegions")) + } + if s.SourceType == nil { + invalidParams.Add(request.NewErrParamRequired("SourceType")) + } + if s.SourceType != nil && len(*s.SourceType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SourceType", 1)) + } + if s.AwsOrganizationsSource != nil { + if err := s.AwsOrganizationsSource.Validate(); err != nil { + invalidParams.AddNested("AwsOrganizationsSource", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAwsOrganizationsSource sets the AwsOrganizationsSource field's value. +func (s *ResourceDataSyncSource) SetAwsOrganizationsSource(v *ResourceDataSyncAwsOrganizationsSource) *ResourceDataSyncSource { + s.AwsOrganizationsSource = v + return s +} + +// SetIncludeFutureRegions sets the IncludeFutureRegions field's value. +func (s *ResourceDataSyncSource) SetIncludeFutureRegions(v bool) *ResourceDataSyncSource { + s.IncludeFutureRegions = &v + return s +} + +// SetSourceRegions sets the SourceRegions field's value. +func (s *ResourceDataSyncSource) SetSourceRegions(v []*string) *ResourceDataSyncSource { + s.SourceRegions = v + return s +} + +// SetSourceType sets the SourceType field's value. +func (s *ResourceDataSyncSource) SetSourceType(v string) *ResourceDataSyncSource { + s.SourceType = &v + return s +} + +// The data type name for including resource data sync state. There are four +// sync states: +// +// OrganizationNotExists (Your organization doesn't exist) +// +// NoPermissions (The system can't locate the service-linked role. This role +// is automatically created when a user creates a resource data sync in Explorer.) +// +// InvalidOrganizationalUnit (You specified or selected an invalid unit in the +// resource data sync configuration.) +// +// TrustedAccessDisabled (You disabled Systems Manager access in the organization +// in AWS Organizations.) +type ResourceDataSyncSourceWithState struct { + _ struct{} `type:"structure"` + + // The field name in SyncSource for the ResourceDataSyncAwsOrganizationsSource + // type. + AwsOrganizationsSource *ResourceDataSyncAwsOrganizationsSource `type:"structure"` + + // Whether to automatically synchronize and aggregate data from new AWS Regions + // when those Regions come online. + IncludeFutureRegions *bool `type:"boolean"` + + // The SyncSource AWS Regions included in the resource data sync. + SourceRegions []*string `type:"list"` + + // The type of data source for the resource data sync. SourceType is either + // AwsOrganizations (if an organization is present in AWS Organizations) or + // singleAccountMultiRegions. + SourceType *string `min:"1" type:"string"` + + // The data type name for including resource data sync state. There are four + // sync states: + // + // OrganizationNotExists: Your organization doesn't exist. + // + // NoPermissions: The system can't locate the service-linked role. This role + // is automatically created when a user creates a resource data sync in Explorer. + // + // InvalidOrganizationalUnit: You specified or selected an invalid unit in the + // resource data sync configuration. + // + // TrustedAccessDisabled: You disabled Systems Manager access in the organization + // in AWS Organizations. + State *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ResourceDataSyncSourceWithState) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceDataSyncSourceWithState) GoString() string { + return s.String() +} + +// SetAwsOrganizationsSource sets the AwsOrganizationsSource field's value. +func (s *ResourceDataSyncSourceWithState) SetAwsOrganizationsSource(v *ResourceDataSyncAwsOrganizationsSource) *ResourceDataSyncSourceWithState { + s.AwsOrganizationsSource = v + return s +} + +// SetIncludeFutureRegions sets the IncludeFutureRegions field's value. +func (s *ResourceDataSyncSourceWithState) SetIncludeFutureRegions(v bool) *ResourceDataSyncSourceWithState { + s.IncludeFutureRegions = &v + return s +} + +// SetSourceRegions sets the SourceRegions field's value. +func (s *ResourceDataSyncSourceWithState) SetSourceRegions(v []*string) *ResourceDataSyncSourceWithState { + s.SourceRegions = v + return s +} + +// SetSourceType sets the SourceType field's value. +func (s *ResourceDataSyncSourceWithState) SetSourceType(v string) *ResourceDataSyncSourceWithState { + s.SourceType = &v + return s +} + +// SetState sets the State field's value. +func (s *ResourceDataSyncSourceWithState) SetState(v string) *ResourceDataSyncSourceWithState { + s.State = &v + return s +} + +// Error returned if an attempt is made to delete a patch baseline that is registered +// for a patch group. +type ResourceInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceInUseException) GoString() string { + return s.String() +} + +func newErrorResourceInUseException(v protocol.ResponseMetadata) error { + return &ResourceInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceInUseException) Code() string { + return "ResourceInUseException" +} + +// Message returns the exception's message. +func (s ResourceInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceInUseException) OrigErr() error { + return nil +} + +func (s ResourceInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// Error returned when the caller has exceeded the default resource quotas. +// For example, too many maintenance windows or patch baselines have been created. +// +// For information about resource quotas in Systems Manager, see Systems Manager +// Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) +// in the AWS General Reference. +type ResourceLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceLimitExceededException) GoString() string { + return s.String() +} + +func newErrorResourceLimitExceededException(v protocol.ResponseMetadata) error { + return &ResourceLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceLimitExceededException) Code() string { + return "ResourceLimitExceededException" +} + +// Message returns the exception's message. +func (s ResourceLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceLimitExceededException) OrigErr() error { + return nil +} + +func (s ResourceLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // The inventory item result attribute. type ResultAttribute struct { _ struct{} `type:"structure"` @@ -32986,8 +39774,8 @@ type ResumeSessionOutput struct { // // region represents the Region identifier for an AWS Region supported by AWS // Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list - // of supported region values, see the Region column in the AWS Systems Manager - // table of regions and endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#ssm_region) + // of supported region values, see the Region column in Systems Manager Service + // Endpoints (http://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region) // in the AWS General Reference. // // session-id represents the ID of a Session Manager session, such as 1a2b3c4dEXAMPLE. @@ -33622,6 +40410,63 @@ func (s *ServiceSetting) SetStatus(v string) *ServiceSetting { return s } +// The specified service setting was not found. Either the service name or the +// setting has not been provisioned by the AWS service team. +type ServiceSettingNotFound struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ServiceSettingNotFound) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceSettingNotFound) GoString() string { + return s.String() +} + +func newErrorServiceSettingNotFound(v protocol.ResponseMetadata) error { + return &ServiceSettingNotFound{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceSettingNotFound) Code() string { + return "ServiceSettingNotFound" +} + +// Message returns the exception's message. +func (s ServiceSettingNotFound) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceSettingNotFound) OrigErr() error { + return nil +} + +func (s ServiceSettingNotFound) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceSettingNotFound) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceSettingNotFound) RequestID() string { + return s.respMetadata.RequestID +} + // Information about a Session Manager connection to an instance. type Session struct { _ struct{} `type:"structure"` @@ -34006,6 +40851,19 @@ type StartAutomationExecutionInput struct { // in the Automation document. Parameters map[string][]*string `min:"1" type:"map"` + // Optional metadata that you assign to a resource. You can specify a maximum + // of five tags for an automation. Tags enable you to categorize a resource + // in different ways, such as by purpose, owner, or environment. For example, + // you might want to tag an automation to identify an environment or operating + // system. In this case, you could specify the following key name/value pairs: + // + // * Key=environment,Value=test + // + // * Key=OS,Value=Windows + // + // To add tags to an existing patch baseline, use the AddTagsToResource action. + Tags []*Tag `type:"list"` + // A location is a combination of AWS Regions and/or AWS accounts where you // want to run the Automation. Use this action to start an Automation in multiple // Regions and multiple accounts. For more information, see Executing Automations @@ -34059,6 +40917,16 @@ func (s *StartAutomationExecutionInput) Validate() error { if s.TargetParameterName != nil && len(*s.TargetParameterName) < 1 { invalidParams.Add(request.NewErrParamMinLen("TargetParameterName", 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 s.TargetLocations != nil { for i, v := range s.TargetLocations { if v == nil { @@ -34128,6 +40996,12 @@ func (s *StartAutomationExecutionInput) SetParameters(v map[string][]*string) *S return s } +// SetTags sets the Tags field's value. +func (s *StartAutomationExecutionInput) SetTags(v []*Tag) *StartAutomationExecutionInput { + s.Tags = v + return s +} + // SetTargetLocations sets the TargetLocations field's value. func (s *StartAutomationExecutionInput) SetTargetLocations(v []*TargetLocation) *StartAutomationExecutionInput { s.TargetLocations = v @@ -34247,8 +41121,8 @@ type StartSessionOutput struct { // // region represents the Region identifier for an AWS Region supported by AWS // Systems Manager, such as us-east-2 for the US East (Ohio) Region. For a list - // of supported region values, see the Region column in the AWS Systems Manager - // table of regions and endpoints (http://docs.aws.amazon.com/general/latest/gr/rande.html#ssm_region) + // of supported region values, see the Region column in Systems Manager Service + // Endpoints (http://docs.aws.amazon.com/general/latest/gr/ssm.html#ssm_region) // in the AWS General Reference. // // session-id represents the ID of a Session Manager session, such as 1a2b3c4dEXAMPLE. @@ -34287,6 +41161,62 @@ func (s *StartSessionOutput) SetTokenValue(v string) *StartSessionOutput { return s } +// The updated status is the same as the current status. +type StatusUnchanged struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s StatusUnchanged) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StatusUnchanged) GoString() string { + return s.String() +} + +func newErrorStatusUnchanged(v protocol.ResponseMetadata) error { + return &StatusUnchanged{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s StatusUnchanged) Code() string { + return "StatusUnchanged" +} + +// Message returns the exception's message. +func (s StatusUnchanged) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s StatusUnchanged) OrigErr() error { + return nil +} + +func (s StatusUnchanged) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s StatusUnchanged) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s StatusUnchanged) RequestID() string { + return s.respMetadata.RequestID +} + // Detailed information about an the execution state of an Automation step. type StepExecution struct { _ struct{} `type:"structure"` @@ -34348,8 +41278,7 @@ type StepExecution struct { // 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. + // The execution status for this step. StepStatus *string `type:"string" enum:"AutomationExecutionStatus"` // The combination of AWS Regions and accounts targeted by the current Automation @@ -34636,6 +41565,62 @@ func (s StopAutomationExecutionOutput) GoString() string { return s.String() } +// The sub-type count exceeded the limit for the inventory type. +type SubTypeCountLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s SubTypeCountLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SubTypeCountLimitExceededException) GoString() string { + return s.String() +} + +func newErrorSubTypeCountLimitExceededException(v protocol.ResponseMetadata) error { + return &SubTypeCountLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SubTypeCountLimitExceededException) Code() string { + return "SubTypeCountLimitExceededException" +} + +// Message returns the exception's message. +func (s SubTypeCountLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SubTypeCountLimitExceededException) OrigErr() error { + return nil +} + +func (s SubTypeCountLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SubTypeCountLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SubTypeCountLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // Metadata that you assign to your AWS resources. Tags enable you to categorize // your resources in different ways, for example, by purpose, owner, or environment. // In Systems Manager, you can apply tags to documents, managed instances, maintenance @@ -34722,8 +41707,16 @@ func (s *Tag) SetValue(v string) *Tag { // * Key=tag-key,Values=Name,Instance-Type,CostCenter // // * (Maintenance window targets only) Key=resource-groups:Name,Values=ProductionResourceGroup +// This example demonstrates how to target all resources in the resource +// group ProductionResourceGroup in your maintenance window. // // * (Maintenance window targets only) Key=resource-groups:ResourceTypeFilters,Values=AWS::EC2::INSTANCE,AWS::EC2::VPC +// This example demonstrates how to target only Amazon EC2 instances and +// VPCs in your maintenance window. +// +// * (State Manager association targets only) Key=InstanceIds,Values=* This +// example demonstrates how to target all managed instances in the AWS Region +// where the association was created. // // For information about how to send commands that target instances using Key,Value // parameters, see Using Targets and Rate Controls to Send Commands to a Fleet @@ -34777,6 +41770,63 @@ func (s *Target) SetValues(v []*string) *Target { return s } +// You specified the Safe option for the DeregisterTargetFromMaintenanceWindow +// operation, but the target is still referenced in a task. +type TargetInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s TargetInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TargetInUseException) GoString() string { + return s.String() +} + +func newErrorTargetInUseException(v protocol.ResponseMetadata) error { + return &TargetInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TargetInUseException) Code() string { + return "TargetInUseException" +} + +// Message returns the exception's message. +func (s TargetInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TargetInUseException) OrigErr() error { + return nil +} + +func (s TargetInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TargetInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TargetInUseException) RequestID() string { + return s.respMetadata.RequestID +} + // The combination of AWS Regions and accounts targeted by the current Automation // execution. type TargetLocation struct { @@ -34865,6 +41915,65 @@ func (s *TargetLocation) SetTargetLocationMaxErrors(v string) *TargetLocation { return s } +// The specified target instance for the session is not fully configured for +// use with Session Manager. For more information, see Getting Started with +// Session Manager (http://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-getting-started.html) +// in the AWS Systems Manager User Guide. +type TargetNotConnected struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s TargetNotConnected) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TargetNotConnected) GoString() string { + return s.String() +} + +func newErrorTargetNotConnected(v protocol.ResponseMetadata) error { + return &TargetNotConnected{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TargetNotConnected) Code() string { + return "TargetNotConnected" +} + +// Message returns the exception's message. +func (s TargetNotConnected) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TargetNotConnected) OrigErr() error { + return nil +} + +func (s TargetNotConnected) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TargetNotConnected) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TargetNotConnected) RequestID() string { + return s.respMetadata.RequestID +} + type TerminateSessionInput struct { _ struct{} `type:"structure"` @@ -34929,6 +42038,582 @@ func (s *TerminateSessionOutput) SetSessionId(v string) *TerminateSessionOutput return s } +// The Targets parameter includes too many tags. Remove one or more tags and +// try the command again. +type TooManyTagsError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyTagsError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyTagsError) GoString() string { + return s.String() +} + +func newErrorTooManyTagsError(v protocol.ResponseMetadata) error { + return &TooManyTagsError{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyTagsError) Code() string { + return "TooManyTagsError" +} + +// Message returns the exception's message. +func (s TooManyTagsError) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTagsError) OrigErr() error { + return nil +} + +func (s TooManyTagsError) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTagsError) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyTagsError) RequestID() string { + return s.respMetadata.RequestID +} + +// There are concurrent updates for a resource that supports one update at a +// time. +type TooManyUpdates struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s TooManyUpdates) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyUpdates) GoString() string { + return s.String() +} + +func newErrorTooManyUpdates(v protocol.ResponseMetadata) error { + return &TooManyUpdates{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyUpdates) Code() string { + return "TooManyUpdates" +} + +// Message returns the exception's message. +func (s TooManyUpdates) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyUpdates) OrigErr() error { + return nil +} + +func (s TooManyUpdates) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyUpdates) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyUpdates) RequestID() string { + return s.respMetadata.RequestID +} + +// The size of inventory data has exceeded the total size limit for the resource. +type TotalSizeLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s TotalSizeLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TotalSizeLimitExceededException) GoString() string { + return s.String() +} + +func newErrorTotalSizeLimitExceededException(v protocol.ResponseMetadata) error { + return &TotalSizeLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TotalSizeLimitExceededException) Code() string { + return "TotalSizeLimitExceededException" +} + +// Message returns the exception's message. +func (s TotalSizeLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TotalSizeLimitExceededException) OrigErr() error { + return nil +} + +func (s TotalSizeLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TotalSizeLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TotalSizeLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// The calendar entry contained in the specified Systems Manager document is +// not supported. +type UnsupportedCalendarException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedCalendarException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedCalendarException) GoString() string { + return s.String() +} + +func newErrorUnsupportedCalendarException(v protocol.ResponseMetadata) error { + return &UnsupportedCalendarException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedCalendarException) Code() string { + return "UnsupportedCalendarException" +} + +// Message returns the exception's message. +func (s UnsupportedCalendarException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedCalendarException) OrigErr() error { + return nil +} + +func (s UnsupportedCalendarException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedCalendarException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedCalendarException) RequestID() string { + return s.respMetadata.RequestID +} + +// Microsoft application patching is only available on EC2 instances and Advanced +// Instances. To patch Microsoft applications on on-premises servers and VMs, +// you must enable Advanced Instances. For more information, see Using the Advanced-Instances +// Tier (http://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-managedinstances-advanced.html) +// in the AWS Systems Manager User Guide. +type UnsupportedFeatureRequiredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedFeatureRequiredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedFeatureRequiredException) GoString() string { + return s.String() +} + +func newErrorUnsupportedFeatureRequiredException(v protocol.ResponseMetadata) error { + return &UnsupportedFeatureRequiredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedFeatureRequiredException) Code() string { + return "UnsupportedFeatureRequiredException" +} + +// Message returns the exception's message. +func (s UnsupportedFeatureRequiredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedFeatureRequiredException) OrigErr() error { + return nil +} + +func (s UnsupportedFeatureRequiredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedFeatureRequiredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedFeatureRequiredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The Context attribute that you specified for the InventoryItem is not allowed +// for this inventory type. You can only use the Context attribute with inventory +// types like AWS:ComplianceItem. +type UnsupportedInventoryItemContextException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + TypeName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s UnsupportedInventoryItemContextException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedInventoryItemContextException) GoString() string { + return s.String() +} + +func newErrorUnsupportedInventoryItemContextException(v protocol.ResponseMetadata) error { + return &UnsupportedInventoryItemContextException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedInventoryItemContextException) Code() string { + return "UnsupportedInventoryItemContextException" +} + +// Message returns the exception's message. +func (s UnsupportedInventoryItemContextException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedInventoryItemContextException) OrigErr() error { + return nil +} + +func (s UnsupportedInventoryItemContextException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedInventoryItemContextException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedInventoryItemContextException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type UnsupportedInventorySchemaVersionException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedInventorySchemaVersionException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedInventorySchemaVersionException) GoString() string { + return s.String() +} + +func newErrorUnsupportedInventorySchemaVersionException(v protocol.ResponseMetadata) error { + return &UnsupportedInventorySchemaVersionException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedInventorySchemaVersionException) Code() string { + return "UnsupportedInventorySchemaVersionException" +} + +// Message returns the exception's message. +func (s UnsupportedInventorySchemaVersionException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedInventorySchemaVersionException) OrigErr() error { + return nil +} + +func (s UnsupportedInventorySchemaVersionException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedInventorySchemaVersionException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedInventorySchemaVersionException) RequestID() string { + return s.respMetadata.RequestID +} + +// The operating systems you specified is not supported, or the operation is +// not supported for the operating system. Valid operating systems include: +// Windows, AmazonLinux, RedhatEnterpriseLinux, and Ubuntu. +type UnsupportedOperatingSystem struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedOperatingSystem) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedOperatingSystem) GoString() string { + return s.String() +} + +func newErrorUnsupportedOperatingSystem(v protocol.ResponseMetadata) error { + return &UnsupportedOperatingSystem{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedOperatingSystem) Code() string { + return "UnsupportedOperatingSystem" +} + +// Message returns the exception's message. +func (s UnsupportedOperatingSystem) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedOperatingSystem) OrigErr() error { + return nil +} + +func (s UnsupportedOperatingSystem) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedOperatingSystem) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedOperatingSystem) RequestID() string { + return s.respMetadata.RequestID +} + +// The parameter type is not supported. +type UnsupportedParameterType struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedParameterType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedParameterType) GoString() string { + return s.String() +} + +func newErrorUnsupportedParameterType(v protocol.ResponseMetadata) error { + return &UnsupportedParameterType{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedParameterType) Code() string { + return "UnsupportedParameterType" +} + +// Message returns the exception's message. +func (s UnsupportedParameterType) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedParameterType) OrigErr() error { + return nil +} + +func (s UnsupportedParameterType) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedParameterType) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedParameterType) RequestID() string { + return s.respMetadata.RequestID +} + +// The document does not support the platform type of the given instance ID(s). +// For example, you sent an document for a Windows instance to a Linux instance. +type UnsupportedPlatformType struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedPlatformType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedPlatformType) GoString() string { + return s.String() +} + +func newErrorUnsupportedPlatformType(v protocol.ResponseMetadata) error { + return &UnsupportedPlatformType{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedPlatformType) Code() string { + return "UnsupportedPlatformType" +} + +// Message returns the exception's message. +func (s UnsupportedPlatformType) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedPlatformType) OrigErr() error { + return nil +} + +func (s UnsupportedPlatformType) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedPlatformType) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedPlatformType) RequestID() string { + return s.respMetadata.RequestID +} + type UpdateAssociationInput struct { _ struct{} `type:"structure"` @@ -36399,6 +44084,9 @@ func (s UpdateManagedInstanceRoleOutput) GoString() string { type UpdateOpsItemInput struct { _ struct{} `type:"structure"` + // Specify a new category for an OpsItem. + Category *string `min:"1" type:"string"` + // Update the information about the OpsItem. Provide enough information so that // users reading this OpsItem for the first time understand the issue. Description *string `min:"1" type:"string"` @@ -36449,6 +44137,9 @@ type UpdateOpsItemInput struct { // impacted resources, or statuses for the impacted resource. RelatedOpsItems []*RelatedOpsItem `type:"list"` + // Specify a new severity for an OpsItem. + Severity *string `min:"1" type:"string"` + // The OpsItem status. Status can be Open, In Progress, or Resolved. For more // information, see Editing OpsItem Details (http://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-working-with-OpsItems-editing-details.html) // in the AWS Systems Manager User Guide. @@ -36472,6 +44163,9 @@ func (s UpdateOpsItemInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *UpdateOpsItemInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "UpdateOpsItemInput"} + if s.Category != nil && len(*s.Category) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Category", 1)) + } if s.Description != nil && len(*s.Description) < 1 { invalidParams.Add(request.NewErrParamMinLen("Description", 1)) } @@ -36481,6 +44175,9 @@ func (s *UpdateOpsItemInput) Validate() error { if s.Priority != nil && *s.Priority < 1 { invalidParams.Add(request.NewErrParamMinValue("Priority", 1)) } + if s.Severity != nil && len(*s.Severity) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Severity", 1)) + } if s.Title != nil && len(*s.Title) < 1 { invalidParams.Add(request.NewErrParamMinLen("Title", 1)) } @@ -36501,6 +44198,12 @@ func (s *UpdateOpsItemInput) Validate() error { return nil } +// SetCategory sets the Category field's value. +func (s *UpdateOpsItemInput) SetCategory(v string) *UpdateOpsItemInput { + s.Category = &v + return s +} + // SetDescription sets the Description field's value. func (s *UpdateOpsItemInput) SetDescription(v string) *UpdateOpsItemInput { s.Description = &v @@ -36543,6 +44246,12 @@ func (s *UpdateOpsItemInput) SetRelatedOpsItems(v []*RelatedOpsItem) *UpdateOpsI return s } +// SetSeverity sets the Severity field's value. +func (s *UpdateOpsItemInput) SetSeverity(v string) *UpdateOpsItemInput { + s.Severity = &v + return s +} + // SetStatus sets the Status field's value. func (s *UpdateOpsItemInput) SetStatus(v string) *UpdateOpsItemInput { s.Status = &v @@ -36908,6 +44617,100 @@ func (s *UpdatePatchBaselineOutput) SetSources(v []*PatchSource) *UpdatePatchBas return s } +type UpdateResourceDataSyncInput struct { + _ struct{} `type:"structure"` + + // The name of the resource data sync you want to update. + // + // SyncName is a required field + SyncName *string `min:"1" type:"string" required:"true"` + + // Specify information about the data sources to synchronize. + // + // SyncSource is a required field + SyncSource *ResourceDataSyncSource `type:"structure" required:"true"` + + // The type of resource data sync. If SyncType is SyncToDestination, then the + // resource data sync synchronizes data to an Amazon S3 bucket. If the SyncType + // is SyncFromSource then the resource data sync synchronizes data from AWS + // Organizations or from multiple AWS Regions. + // + // SyncType is a required field + SyncType *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateResourceDataSyncInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateResourceDataSyncInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateResourceDataSyncInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateResourceDataSyncInput"} + if s.SyncName == nil { + invalidParams.Add(request.NewErrParamRequired("SyncName")) + } + if s.SyncName != nil && len(*s.SyncName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SyncName", 1)) + } + if s.SyncSource == nil { + invalidParams.Add(request.NewErrParamRequired("SyncSource")) + } + if s.SyncType == nil { + invalidParams.Add(request.NewErrParamRequired("SyncType")) + } + if s.SyncType != nil && len(*s.SyncType) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SyncType", 1)) + } + if s.SyncSource != nil { + if err := s.SyncSource.Validate(); err != nil { + invalidParams.AddNested("SyncSource", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetSyncName sets the SyncName field's value. +func (s *UpdateResourceDataSyncInput) SetSyncName(v string) *UpdateResourceDataSyncInput { + s.SyncName = &v + return s +} + +// SetSyncSource sets the SyncSource field's value. +func (s *UpdateResourceDataSyncInput) SetSyncSource(v *ResourceDataSyncSource) *UpdateResourceDataSyncInput { + s.SyncSource = v + return s +} + +// SetSyncType sets the SyncType field's value. +func (s *UpdateResourceDataSyncInput) SetSyncType(v string) *UpdateResourceDataSyncInput { + s.SyncType = &v + return s +} + +type UpdateResourceDataSyncOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateResourceDataSyncOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateResourceDataSyncOutput) GoString() string { + return s.String() +} + // The request body of the UpdateServiceSetting API action. type UpdateServiceSettingInput struct { _ struct{} `type:"structure"` @@ -37074,6 +44877,12 @@ const ( const ( // AttachmentsSourceKeySourceUrl is a AttachmentsSourceKey enum value AttachmentsSourceKeySourceUrl = "SourceUrl" + + // AttachmentsSourceKeyS3fileUrl is a AttachmentsSourceKey enum value + AttachmentsSourceKeyS3fileUrl = "S3FileUrl" + + // AttachmentsSourceKeyAttachmentReference is a AttachmentsSourceKey enum value + AttachmentsSourceKeyAttachmentReference = "AttachmentReference" ) const ( @@ -37100,6 +44909,9 @@ const ( // AutomationExecutionFilterKeyAutomationType is a AutomationExecutionFilterKey enum value AutomationExecutionFilterKeyAutomationType = "AutomationType" + + // AutomationExecutionFilterKeyTagKey is a AutomationExecutionFilterKey enum value + AutomationExecutionFilterKeyTagKey = "TagKey" ) const ( @@ -37136,6 +44948,14 @@ const ( AutomationTypeLocal = "Local" ) +const ( + // CalendarStateOpen is a CalendarState enum value + CalendarStateOpen = "OPEN" + + // CalendarStateClosed is a CalendarState enum value + CalendarStateClosed = "CLOSED" +) + const ( // CommandFilterKeyInvokedAfter is a CommandFilterKey enum value CommandFilterKeyInvokedAfter = "InvokedAfter" @@ -37306,6 +45126,9 @@ const ( // DocumentFormatJson is a DocumentFormat enum value DocumentFormatJson = "JSON" + + // DocumentFormatText is a DocumentFormat enum value + DocumentFormatText = "TEXT" ) const ( @@ -37362,6 +45185,18 @@ const ( // DocumentTypePackage is a DocumentType enum value DocumentTypePackage = "Package" + + // DocumentTypeApplicationConfiguration is a DocumentType enum value + DocumentTypeApplicationConfiguration = "ApplicationConfiguration" + + // DocumentTypeApplicationConfigurationSchema is a DocumentType enum value + DocumentTypeApplicationConfigurationSchema = "ApplicationConfigurationSchema" + + // DocumentTypeDeploymentStrategy is a DocumentType enum value + DocumentTypeDeploymentStrategy = "DeploymentStrategy" + + // DocumentTypeChangeCalendar is a DocumentType enum value + DocumentTypeChangeCalendar = "ChangeCalendar" ) const ( @@ -37644,6 +45479,12 @@ const ( // OpsItemFilterKeyAutomationId is a OpsItemFilterKey enum value OpsItemFilterKeyAutomationId = "AutomationId" + + // OpsItemFilterKeyCategory is a OpsItemFilterKey enum value + OpsItemFilterKeyCategory = "Category" + + // OpsItemFilterKeySeverity is a OpsItemFilterKey enum value + OpsItemFilterKeySeverity = "Severity" ) const ( @@ -37719,6 +45560,9 @@ const ( // PatchComplianceDataStateInstalledOther is a PatchComplianceDataState enum value PatchComplianceDataStateInstalledOther = "INSTALLED_OTHER" + // PatchComplianceDataStateInstalledPendingReboot is a PatchComplianceDataState enum value + PatchComplianceDataStateInstalledPendingReboot = "INSTALLED_PENDING_REBOOT" + // PatchComplianceDataStateInstalledRejected is a PatchComplianceDataState enum value PatchComplianceDataStateInstalledRejected = "INSTALLED_REJECTED" @@ -37850,6 +45694,14 @@ const ( PlatformTypeLinux = "Linux" ) +const ( + // RebootOptionRebootIfNeeded is a RebootOption enum value + RebootOptionRebootIfNeeded = "RebootIfNeeded" + + // RebootOptionNoReboot is a RebootOption enum value + RebootOptionNoReboot = "NoReboot" +) + const ( // ResourceDataSyncS3FormatJsonSerDe is a ResourceDataSyncS3Format enum value ResourceDataSyncS3FormatJsonSerDe = "JsonSerDe" 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 index 90c4a777131..8e3eb9ba34d 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ssm/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ssm/errors.go @@ -2,6 +2,10 @@ package ssm +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAlreadyExistsException for service response error code @@ -129,8 +133,9 @@ const ( // Error returned when the ID specified for a resource, such as a maintenance // window or Patch baseline, doesn't exist. // - // For information about resource limits in Systems Manager, see AWS Systems - // Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). + // For information about resource quotas in Systems Manager, see Systems Manager + // Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) + // in the AWS General Reference. ErrCodeDoesNotExistException = "DoesNotExistException" // ErrCodeDuplicateDocumentContent for service response error code @@ -301,6 +306,13 @@ const ( // The version of the document schema is not supported. ErrCodeInvalidDocumentSchemaVersion = "InvalidDocumentSchemaVersion" + // ErrCodeInvalidDocumentType for service response error code + // "InvalidDocumentType". + // + // The document type is not valid. Valid document types are described in the + // DocumentType property. + ErrCodeInvalidDocumentType = "InvalidDocumentType" + // ErrCodeInvalidDocumentVersion for service response error code // "InvalidDocumentVersion". // @@ -547,8 +559,8 @@ const ( // ErrCodeOpsItemLimitExceededException for service response error code // "OpsItemLimitExceededException". // - // The request caused OpsItems to exceed one or more limits. For information - // about OpsItem limits, see What are the resource limits for OpsCenter? (http://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-learn-more.html#OpsCenter-learn-more-limits). + // The request caused OpsItems to exceed one or more quotas. For information + // about OpsItem quotas, see What are the resource limits for OpsCenter? (http://docs.aws.amazon.com/systems-manager/latest/userguide/OpsCenter-learn-more.html#OpsCenter-learn-more-limits). ErrCodeOpsItemLimitExceededException = "OpsItemLimitExceededException" // ErrCodeOpsItemNotFoundException for service response error code @@ -614,6 +626,13 @@ const ( // A sync configuration with the same name already exists. ErrCodeResourceDataSyncAlreadyExistsException = "ResourceDataSyncAlreadyExistsException" + // ErrCodeResourceDataSyncConflictException for service response error code + // "ResourceDataSyncConflictException". + // + // Another UpdateResourceDataSync request is being processed. Wait a few minutes + // and try again. + ErrCodeResourceDataSyncConflictException = "ResourceDataSyncConflictException" + // ErrCodeResourceDataSyncCountExceededException for service response error code // "ResourceDataSyncCountExceededException". // @@ -642,11 +661,12 @@ const ( // ErrCodeResourceLimitExceededException for service response error code // "ResourceLimitExceededException". // - // Error returned when the caller has exceeded the default resource limits. + // Error returned when the caller has exceeded the default resource quotas. // For example, too many maintenance windows or patch baselines have been created. // - // For information about resource limits in Systems Manager, see AWS Systems - // Manager Limits (http://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html#limits_ssm). + // For information about resource quotas in Systems Manager, see Systems Manager + // Service Quotas (http://docs.aws.amazon.com/general/latest/gr/ssm.html#limits_ssm) + // in the AWS General Reference. ErrCodeResourceLimitExceededException = "ResourceLimitExceededException" // ErrCodeServiceSettingNotFound for service response error code @@ -704,6 +724,13 @@ const ( // The size of inventory data has exceeded the total size limit for the resource. ErrCodeTotalSizeLimitExceededException = "TotalSizeLimitExceededException" + // ErrCodeUnsupportedCalendarException for service response error code + // "UnsupportedCalendarException". + // + // The calendar entry contained in the specified Systems Manager document is + // not supported. + ErrCodeUnsupportedCalendarException = "UnsupportedCalendarException" + // ErrCodeUnsupportedFeatureRequiredException for service response error code // "UnsupportedFeatureRequiredException". // @@ -751,3 +778,119 @@ const ( // For example, you sent an document for a Windows instance to a Linux instance. ErrCodeUnsupportedPlatformType = "UnsupportedPlatformType" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AlreadyExistsException": newErrorAlreadyExistsException, + "AssociatedInstances": newErrorAssociatedInstances, + "AssociationAlreadyExists": newErrorAssociationAlreadyExists, + "AssociationDoesNotExist": newErrorAssociationDoesNotExist, + "AssociationExecutionDoesNotExist": newErrorAssociationExecutionDoesNotExist, + "AssociationLimitExceeded": newErrorAssociationLimitExceeded, + "AssociationVersionLimitExceeded": newErrorAssociationVersionLimitExceeded, + "AutomationDefinitionNotFoundException": newErrorAutomationDefinitionNotFoundException, + "AutomationDefinitionVersionNotFoundException": newErrorAutomationDefinitionVersionNotFoundException, + "AutomationExecutionLimitExceededException": newErrorAutomationExecutionLimitExceededException, + "AutomationExecutionNotFoundException": newErrorAutomationExecutionNotFoundException, + "AutomationStepNotFoundException": newErrorAutomationStepNotFoundException, + "ComplianceTypeCountLimitExceededException": newErrorComplianceTypeCountLimitExceededException, + "CustomSchemaCountLimitExceededException": newErrorCustomSchemaCountLimitExceededException, + "DocumentAlreadyExists": newErrorDocumentAlreadyExists, + "DocumentLimitExceeded": newErrorDocumentLimitExceeded, + "DocumentPermissionLimit": newErrorDocumentPermissionLimit, + "DocumentVersionLimitExceeded": newErrorDocumentVersionLimitExceeded, + "DoesNotExistException": newErrorDoesNotExistException, + "DuplicateDocumentContent": newErrorDuplicateDocumentContent, + "DuplicateDocumentVersionName": newErrorDuplicateDocumentVersionName, + "DuplicateInstanceId": newErrorDuplicateInstanceId, + "FeatureNotAvailableException": newErrorFeatureNotAvailableException, + "HierarchyLevelLimitExceededException": newErrorHierarchyLevelLimitExceededException, + "HierarchyTypeMismatchException": newErrorHierarchyTypeMismatchException, + "IdempotentParameterMismatch": newErrorIdempotentParameterMismatch, + "IncompatiblePolicyException": newErrorIncompatiblePolicyException, + "InternalServerError": newErrorInternalServerError, + "InvalidActivation": newErrorInvalidActivation, + "InvalidActivationId": newErrorInvalidActivationId, + "InvalidAggregatorException": newErrorInvalidAggregatorException, + "InvalidAllowedPatternException": newErrorInvalidAllowedPatternException, + "InvalidAssociation": newErrorInvalidAssociation, + "InvalidAssociationVersion": newErrorInvalidAssociationVersion, + "InvalidAutomationExecutionParametersException": newErrorInvalidAutomationExecutionParametersException, + "InvalidAutomationSignalException": newErrorInvalidAutomationSignalException, + "InvalidAutomationStatusUpdateException": newErrorInvalidAutomationStatusUpdateException, + "InvalidCommandId": newErrorInvalidCommandId, + "InvalidDeleteInventoryParametersException": newErrorInvalidDeleteInventoryParametersException, + "InvalidDeletionIdException": newErrorInvalidDeletionIdException, + "InvalidDocument": newErrorInvalidDocument, + "InvalidDocumentContent": newErrorInvalidDocumentContent, + "InvalidDocumentOperation": newErrorInvalidDocumentOperation, + "InvalidDocumentSchemaVersion": newErrorInvalidDocumentSchemaVersion, + "InvalidDocumentType": newErrorInvalidDocumentType, + "InvalidDocumentVersion": newErrorInvalidDocumentVersion, + "InvalidFilter": newErrorInvalidFilter, + "InvalidFilterKey": newErrorInvalidFilterKey, + "InvalidFilterOption": newErrorInvalidFilterOption, + "InvalidFilterValue": newErrorInvalidFilterValue, + "InvalidInstanceId": newErrorInvalidInstanceId, + "InvalidInstanceInformationFilterValue": newErrorInvalidInstanceInformationFilterValue, + "InvalidInventoryGroupException": newErrorInvalidInventoryGroupException, + "InvalidInventoryItemContextException": newErrorInvalidInventoryItemContextException, + "InvalidInventoryRequestException": newErrorInvalidInventoryRequestException, + "InvalidItemContentException": newErrorInvalidItemContentException, + "InvalidKeyId": newErrorInvalidKeyId, + "InvalidNextToken": newErrorInvalidNextToken, + "InvalidNotificationConfig": newErrorInvalidNotificationConfig, + "InvalidOptionException": newErrorInvalidOptionException, + "InvalidOutputFolder": newErrorInvalidOutputFolder, + "InvalidOutputLocation": newErrorInvalidOutputLocation, + "InvalidParameters": newErrorInvalidParameters, + "InvalidPermissionType": newErrorInvalidPermissionType, + "InvalidPluginName": newErrorInvalidPluginName, + "InvalidPolicyAttributeException": newErrorInvalidPolicyAttributeException, + "InvalidPolicyTypeException": newErrorInvalidPolicyTypeException, + "InvalidResourceId": newErrorInvalidResourceId, + "InvalidResourceType": newErrorInvalidResourceType, + "InvalidResultAttributeException": newErrorInvalidResultAttributeException, + "InvalidRole": newErrorInvalidRole, + "InvalidSchedule": newErrorInvalidSchedule, + "InvalidTarget": newErrorInvalidTarget, + "InvalidTypeNameException": newErrorInvalidTypeNameException, + "InvalidUpdate": newErrorInvalidUpdate, + "InvocationDoesNotExist": newErrorInvocationDoesNotExist, + "ItemContentMismatchException": newErrorItemContentMismatchException, + "ItemSizeLimitExceededException": newErrorItemSizeLimitExceededException, + "MaxDocumentSizeExceeded": newErrorMaxDocumentSizeExceeded, + "OpsItemAlreadyExistsException": newErrorOpsItemAlreadyExistsException, + "OpsItemInvalidParameterException": newErrorOpsItemInvalidParameterException, + "OpsItemLimitExceededException": newErrorOpsItemLimitExceededException, + "OpsItemNotFoundException": newErrorOpsItemNotFoundException, + "ParameterAlreadyExists": newErrorParameterAlreadyExists, + "ParameterLimitExceeded": newErrorParameterLimitExceeded, + "ParameterMaxVersionLimitExceeded": newErrorParameterMaxVersionLimitExceeded, + "ParameterNotFound": newErrorParameterNotFound, + "ParameterPatternMismatchException": newErrorParameterPatternMismatchException, + "ParameterVersionLabelLimitExceeded": newErrorParameterVersionLabelLimitExceeded, + "ParameterVersionNotFound": newErrorParameterVersionNotFound, + "PoliciesLimitExceededException": newErrorPoliciesLimitExceededException, + "ResourceDataSyncAlreadyExistsException": newErrorResourceDataSyncAlreadyExistsException, + "ResourceDataSyncConflictException": newErrorResourceDataSyncConflictException, + "ResourceDataSyncCountExceededException": newErrorResourceDataSyncCountExceededException, + "ResourceDataSyncInvalidConfigurationException": newErrorResourceDataSyncInvalidConfigurationException, + "ResourceDataSyncNotFoundException": newErrorResourceDataSyncNotFoundException, + "ResourceInUseException": newErrorResourceInUseException, + "ResourceLimitExceededException": newErrorResourceLimitExceededException, + "ServiceSettingNotFound": newErrorServiceSettingNotFound, + "StatusUnchanged": newErrorStatusUnchanged, + "SubTypeCountLimitExceededException": newErrorSubTypeCountLimitExceededException, + "TargetInUseException": newErrorTargetInUseException, + "TargetNotConnected": newErrorTargetNotConnected, + "TooManyTagsError": newErrorTooManyTagsError, + "TooManyUpdates": newErrorTooManyUpdates, + "TotalSizeLimitExceededException": newErrorTotalSizeLimitExceededException, + "UnsupportedCalendarException": newErrorUnsupportedCalendarException, + "UnsupportedFeatureRequiredException": newErrorUnsupportedFeatureRequiredException, + "UnsupportedInventoryItemContextException": newErrorUnsupportedInventoryItemContextException, + "UnsupportedInventorySchemaVersionException": newErrorUnsupportedInventorySchemaVersionException, + "UnsupportedOperatingSystem": newErrorUnsupportedOperatingSystem, + "UnsupportedParameterType": newErrorUnsupportedParameterType, + "UnsupportedPlatformType": newErrorUnsupportedPlatformType, +} 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 index 9a6b8f71c22..9d097020936 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/ssm/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/ssm/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "ssm" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "SSM" // ServiceID is a unique identifer of a specific service. + ServiceID = "SSM" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the SSM client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a SSM client from just a session. // svc := ssm.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *SSM { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *SSM { svc := &SSM{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2014-11-06", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/storagegateway/api.go b/vendor/github.com/aws/aws-sdk-go/service/storagegateway/api.go index e140815a3d9..43fe01b36fe 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/storagegateway/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/storagegateway/api.go @@ -9,6 +9,7 @@ import ( "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" ) const opActivateGateway = "ActivateGateway" @@ -71,12 +72,12 @@ func (c *StorageGateway) ActivateGatewayRequest(input *ActivateGatewayInput) (re // See the AWS API reference guide for AWS Storage Gateway's // API operation ActivateGateway for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -161,12 +162,12 @@ func (c *StorageGateway) AddCacheRequest(input *AddCacheInput) (req *request.Req // See the AWS API reference guide for AWS Storage Gateway's // API operation AddCache for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -260,12 +261,12 @@ func (c *StorageGateway) AddTagsToResourceRequest(input *AddTagsToResourceInput) // See the AWS API reference guide for AWS Storage Gateway's // API operation AddTagsToResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -350,12 +351,12 @@ func (c *StorageGateway) AddUploadBufferRequest(input *AddUploadBufferInput) (re // See the AWS API reference guide for AWS Storage Gateway's // API operation AddUploadBuffer for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -444,12 +445,12 @@ func (c *StorageGateway) AddWorkingStorageRequest(input *AddWorkingStorageInput) // See the AWS API reference guide for AWS Storage Gateway's // API operation AddWorkingStorage for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -534,12 +535,12 @@ func (c *StorageGateway) AssignTapePoolRequest(input *AssignTapePoolInput) (req // See the AWS API reference guide for AWS Storage Gateway's // API operation AssignTapePool for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -622,12 +623,12 @@ func (c *StorageGateway) AttachVolumeRequest(input *AttachVolumeInput) (req *req // See the AWS API reference guide for AWS Storage Gateway's // API operation AttachVolume for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -708,12 +709,12 @@ func (c *StorageGateway) CancelArchivalRequest(input *CancelArchivalInput) (req // See the AWS API reference guide for AWS Storage Gateway's // API operation CancelArchival for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -794,12 +795,12 @@ func (c *StorageGateway) CancelRetrievalRequest(input *CancelRetrievalInput) (re // See the AWS API reference guide for AWS Storage Gateway's // API operation CancelRetrieval for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -894,12 +895,12 @@ func (c *StorageGateway) CreateCachediSCSIVolumeRequest(input *CreateCachediSCSI // See the AWS API reference guide for AWS Storage Gateway's // API operation CreateCachediSCSIVolume for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -990,12 +991,12 @@ func (c *StorageGateway) CreateNFSFileShareRequest(input *CreateNFSFileShareInpu // See the AWS API reference guide for AWS Storage Gateway's // API operation CreateNFSFileShare for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -1086,12 +1087,12 @@ func (c *StorageGateway) CreateSMBFileShareRequest(input *CreateSMBFileShareInpu // See the AWS API reference guide for AWS Storage Gateway's // API operation CreateSMBFileShare for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -1193,16 +1194,16 @@ func (c *StorageGateway) CreateSnapshotRequest(input *CreateSnapshotInput) (req // See the AWS API reference guide for AWS Storage Gateway's // API operation CreateSnapshot for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // -// * ErrCodeServiceUnavailableError "ServiceUnavailableError" +// * ServiceUnavailableError // An internal server error has occurred because the service is unavailable. // For more information, see the error and message fields. // @@ -1297,16 +1298,16 @@ func (c *StorageGateway) CreateSnapshotFromVolumeRecoveryPointRequest(input *Cre // See the AWS API reference guide for AWS Storage Gateway's // API operation CreateSnapshotFromVolumeRecoveryPoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // -// * ErrCodeServiceUnavailableError "ServiceUnavailableError" +// * ServiceUnavailableError // An internal server error has occurred because the service is unavailable. // For more information, see the error and message fields. // @@ -1397,12 +1398,12 @@ func (c *StorageGateway) CreateStorediSCSIVolumeRequest(input *CreateStorediSCSI // See the AWS API reference guide for AWS Storage Gateway's // API operation CreateStorediSCSIVolume for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -1487,12 +1488,12 @@ func (c *StorageGateway) CreateTapeWithBarcodeRequest(input *CreateTapeWithBarco // See the AWS API reference guide for AWS Storage Gateway's // API operation CreateTapeWithBarcode for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -1576,12 +1577,12 @@ func (c *StorageGateway) CreateTapesRequest(input *CreateTapesInput) (req *reque // See the AWS API reference guide for AWS Storage Gateway's // API operation CreateTapes for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -1655,7 +1656,8 @@ func (c *StorageGateway) DeleteBandwidthRateLimitRequest(input *DeleteBandwidthR // upload and download bandwidth rate limit, or you can delete both. If you // delete only one of the limits, the other limit remains unchanged. To specify // which gateway to work with, use the Amazon Resource Name (ARN) of the gateway -// in your request. +// in your request. This operation is supported for the stored volume, cached +// volume and tape gateway 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 @@ -1664,12 +1666,12 @@ func (c *StorageGateway) DeleteBandwidthRateLimitRequest(input *DeleteBandwidthR // See the AWS API reference guide for AWS Storage Gateway's // API operation DeleteBandwidthRateLimit for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -1740,7 +1742,8 @@ func (c *StorageGateway) DeleteChapCredentialsRequest(input *DeleteChapCredentia // DeleteChapCredentials API operation for AWS Storage Gateway. // // Deletes Challenge-Handshake Authentication Protocol (CHAP) credentials for -// a specified iSCSI target and initiator pair. +// a specified iSCSI target and initiator pair. This operation is supported +// in volume and tape gateway 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 @@ -1749,12 +1752,12 @@ func (c *StorageGateway) DeleteChapCredentialsRequest(input *DeleteChapCredentia // See the AWS API reference guide for AWS Storage Gateway's // API operation DeleteChapCredentials for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -1834,12 +1837,12 @@ func (c *StorageGateway) DeleteFileShareRequest(input *DeleteFileShareInput) (re // See the AWS API reference guide for AWS Storage Gateway's // API operation DeleteFileShare for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -1933,12 +1936,12 @@ func (c *StorageGateway) DeleteGatewayRequest(input *DeleteGatewayInput) (req *r // See the AWS API reference guide for AWS Storage Gateway's // API operation DeleteGateway for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -2027,12 +2030,12 @@ func (c *StorageGateway) DeleteSnapshotScheduleRequest(input *DeleteSnapshotSche // See the AWS API reference guide for AWS Storage Gateway's // API operation DeleteSnapshotSchedule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -2112,12 +2115,12 @@ func (c *StorageGateway) DeleteTapeRequest(input *DeleteTapeInput) (req *request // See the AWS API reference guide for AWS Storage Gateway's // API operation DeleteTape for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -2197,12 +2200,12 @@ func (c *StorageGateway) DeleteTapeArchiveRequest(input *DeleteTapeArchiveInput) // See the AWS API reference guide for AWS Storage Gateway's // API operation DeleteTapeArchive for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -2295,12 +2298,12 @@ func (c *StorageGateway) DeleteVolumeRequest(input *DeleteVolumeInput) (req *req // See the AWS API reference guide for AWS Storage Gateway's // API operation DeleteVolume for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -2326,6 +2329,92 @@ func (c *StorageGateway) DeleteVolumeWithContext(ctx aws.Context, input *DeleteV return out, req.Send() } +const opDescribeAvailabilityMonitorTest = "DescribeAvailabilityMonitorTest" + +// DescribeAvailabilityMonitorTestRequest generates a "aws/request.Request" representing the +// client's request for the DescribeAvailabilityMonitorTest operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeAvailabilityMonitorTest for more information on using the DescribeAvailabilityMonitorTest +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeAvailabilityMonitorTestRequest method. +// req, resp := client.DescribeAvailabilityMonitorTestRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/storagegateway-2013-06-30/DescribeAvailabilityMonitorTest +func (c *StorageGateway) DescribeAvailabilityMonitorTestRequest(input *DescribeAvailabilityMonitorTestInput) (req *request.Request, output *DescribeAvailabilityMonitorTestOutput) { + op := &request.Operation{ + Name: opDescribeAvailabilityMonitorTest, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeAvailabilityMonitorTestInput{} + } + + output = &DescribeAvailabilityMonitorTestOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeAvailabilityMonitorTest API operation for AWS Storage Gateway. +// +// Returns information about the most recent High Availability monitoring test +// that was performed on the host in a cluster. If a test isn't performed, the +// status and start time in the response would 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 AWS Storage Gateway's +// API operation DescribeAvailabilityMonitorTest for usage and error information. +// +// Returned Error Types: +// * InvalidGatewayRequestException +// An exception occurred because an invalid gateway request was issued to the +// service. For more information, see the error and message fields. +// +// * InternalServerError +// An internal server error has occurred during the request. For more information, +// see the error and message fields. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/storagegateway-2013-06-30/DescribeAvailabilityMonitorTest +func (c *StorageGateway) DescribeAvailabilityMonitorTest(input *DescribeAvailabilityMonitorTestInput) (*DescribeAvailabilityMonitorTestOutput, error) { + req, out := c.DescribeAvailabilityMonitorTestRequest(input) + return out, req.Send() +} + +// DescribeAvailabilityMonitorTestWithContext is the same as DescribeAvailabilityMonitorTest with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeAvailabilityMonitorTest for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *StorageGateway) DescribeAvailabilityMonitorTestWithContext(ctx aws.Context, input *DescribeAvailabilityMonitorTestInput, opts ...request.Option) (*DescribeAvailabilityMonitorTestOutput, error) { + req, out := c.DescribeAvailabilityMonitorTestRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeBandwidthRateLimit = "DescribeBandwidthRateLimit" // DescribeBandwidthRateLimitRequest generates a "aws/request.Request" representing the @@ -2371,7 +2460,8 @@ func (c *StorageGateway) DescribeBandwidthRateLimitRequest(input *DescribeBandwi // DescribeBandwidthRateLimit API operation for AWS Storage Gateway. // // Returns the bandwidth rate limits of a gateway. By default, these limits -// are not set, which means no bandwidth rate limiting is in effect. +// are not set, which means no bandwidth rate limiting is in effect. This operation +// is supported for the stored volume, cached volume and tape gateway types.' // // This operation only returns a value for a bandwidth rate limit only if the // limit is set. If no limits are set for the gateway, then this operation returns @@ -2385,12 +2475,12 @@ func (c *StorageGateway) DescribeBandwidthRateLimitRequest(input *DescribeBandwi // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeBandwidthRateLimit for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -2473,12 +2563,12 @@ func (c *StorageGateway) DescribeCacheRequest(input *DescribeCacheInput) (req *r // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeCache for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -2562,12 +2652,12 @@ func (c *StorageGateway) DescribeCachediSCSIVolumesRequest(input *DescribeCached // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeCachediSCSIVolumes for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -2639,6 +2729,7 @@ func (c *StorageGateway) DescribeChapCredentialsRequest(input *DescribeChapCrede // // Returns an array of Challenge-Handshake Authentication Protocol (CHAP) credentials // information for a specified iSCSI target, one for each target-initiator pair. +// This operation is supported in the volume and tape gateway 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 @@ -2647,12 +2738,12 @@ func (c *StorageGateway) DescribeChapCredentialsRequest(input *DescribeChapCrede // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeChapCredentials for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -2734,12 +2825,12 @@ func (c *StorageGateway) DescribeGatewayInformationRequest(input *DescribeGatewa // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeGatewayInformation for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -2819,12 +2910,12 @@ func (c *StorageGateway) DescribeMaintenanceStartTimeRequest(input *DescribeMain // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeMaintenanceStartTime for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -2904,12 +2995,12 @@ func (c *StorageGateway) DescribeNFSFileSharesRequest(input *DescribeNFSFileShar // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeNFSFileShares for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -2989,12 +3080,12 @@ func (c *StorageGateway) DescribeSMBFileSharesRequest(input *DescribeSMBFileShar // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeSMBFileShares for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -3074,12 +3165,12 @@ func (c *StorageGateway) DescribeSMBSettingsRequest(input *DescribeSMBSettingsIn // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeSMBSettings for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -3161,12 +3252,12 @@ func (c *StorageGateway) DescribeSnapshotScheduleRequest(input *DescribeSnapshot // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeSnapshotSchedule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -3248,12 +3339,12 @@ func (c *StorageGateway) DescribeStorediSCSIVolumesRequest(input *DescribeStored // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeStorediSCSIVolumes for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -3342,12 +3433,12 @@ func (c *StorageGateway) DescribeTapeArchivesRequest(input *DescribeTapeArchives // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeTapeArchives for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -3416,10 +3507,12 @@ func (c *StorageGateway) DescribeTapeArchivesPagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTapeArchivesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeTapeArchivesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3488,12 +3581,12 @@ func (c *StorageGateway) DescribeTapeRecoveryPointsRequest(input *DescribeTapeRe // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeTapeRecoveryPoints for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -3562,10 +3655,12 @@ func (c *StorageGateway) DescribeTapeRecoveryPointsPagesWithContext(ctx aws.Cont }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTapeRecoveryPointsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeTapeRecoveryPointsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3631,12 +3726,12 @@ func (c *StorageGateway) DescribeTapesRequest(input *DescribeTapesInput) (req *r // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeTapes for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -3705,10 +3800,12 @@ func (c *StorageGateway) DescribeTapesPagesWithContext(ctx aws.Context, input *D }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeTapesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeTapesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -3769,12 +3866,12 @@ func (c *StorageGateway) DescribeUploadBufferRequest(input *DescribeUploadBuffer // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeUploadBuffer for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -3862,12 +3959,12 @@ func (c *StorageGateway) DescribeVTLDevicesRequest(input *DescribeVTLDevicesInpu // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeVTLDevices for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -3936,10 +4033,12 @@ func (c *StorageGateway) DescribeVTLDevicesPagesWithContext(ctx aws.Context, inp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeVTLDevicesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeVTLDevicesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4004,12 +4103,12 @@ func (c *StorageGateway) DescribeWorkingStorageRequest(input *DescribeWorkingSto // See the AWS API reference guide for AWS Storage Gateway's // API operation DescribeWorkingStorage for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -4083,7 +4182,8 @@ func (c *StorageGateway) DetachVolumeRequest(input *DetachVolumeInput) (req *req // from the specified gateway. Detaching and attaching a volume enables you // to recover your data from one gateway to a different gateway without creating // a snapshot. It also makes it easier to move your volumes from an on-premises -// gateway to a gateway hosted on an Amazon EC2 instance. +// gateway to a gateway hosted on an Amazon EC2 instance. This operation is +// only supported in the volume gateway 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 @@ -4092,12 +4192,12 @@ func (c *StorageGateway) DetachVolumeRequest(input *DetachVolumeInput) (req *req // See the AWS API reference guide for AWS Storage Gateway's // API operation DetachVolume for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -4183,12 +4283,12 @@ func (c *StorageGateway) DisableGatewayRequest(input *DisableGatewayInput) (req // See the AWS API reference guide for AWS Storage Gateway's // API operation DisableGateway for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -4268,12 +4368,12 @@ func (c *StorageGateway) JoinDomainRequest(input *JoinDomainInput) (req *request // See the AWS API reference guide for AWS Storage Gateway's // API operation JoinDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -4360,12 +4460,12 @@ func (c *StorageGateway) ListFileSharesRequest(input *ListFileSharesInput) (req // See the AWS API reference guide for AWS Storage Gateway's // API operation ListFileShares for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -4434,10 +4534,12 @@ func (c *StorageGateway) ListFileSharesPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListFileSharesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListFileSharesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4510,12 +4612,12 @@ func (c *StorageGateway) ListGatewaysRequest(input *ListGatewaysInput) (req *req // See the AWS API reference guide for AWS Storage Gateway's // API operation ListGateways for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -4584,10 +4686,12 @@ func (c *StorageGateway) ListGatewaysPagesWithContext(ctx aws.Context, input *Li }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListGatewaysOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListGatewaysOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4653,12 +4757,12 @@ func (c *StorageGateway) ListLocalDisksRequest(input *ListLocalDisksInput) (req // See the AWS API reference guide for AWS Storage Gateway's // API operation ListLocalDisks for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -4735,7 +4839,7 @@ func (c *StorageGateway) ListTagsForResourceRequest(input *ListTagsForResourceIn // ListTagsForResource API operation for AWS Storage Gateway. // // Lists the tags that have been added to the specified resource. This operation -// is only supported in the cached volume, stored volume and tape gateway type. +// is supported in storage gateways of all 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 @@ -4744,12 +4848,12 @@ func (c *StorageGateway) ListTagsForResourceRequest(input *ListTagsForResourceIn // See the AWS API reference guide for AWS Storage Gateway's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -4818,10 +4922,12 @@ func (c *StorageGateway) ListTagsForResourcePagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -4894,12 +5000,12 @@ func (c *StorageGateway) ListTapesRequest(input *ListTapesInput) (req *request.R // See the AWS API reference guide for AWS Storage Gateway's // API operation ListTapes for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -4968,10 +5074,12 @@ func (c *StorageGateway) ListTapesPagesWithContext(ctx aws.Context, input *ListT }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTapesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTapesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5030,12 +5138,12 @@ func (c *StorageGateway) ListVolumeInitiatorsRequest(input *ListVolumeInitiators // See the AWS API reference guide for AWS Storage Gateway's // API operation ListVolumeInitiators for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -5121,12 +5229,12 @@ func (c *StorageGateway) ListVolumeRecoveryPointsRequest(input *ListVolumeRecove // See the AWS API reference guide for AWS Storage Gateway's // API operation ListVolumeRecoveryPoints for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -5222,12 +5330,12 @@ func (c *StorageGateway) ListVolumesRequest(input *ListVolumesInput) (req *reque // See the AWS API reference guide for AWS Storage Gateway's // API operation ListVolumes for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -5296,10 +5404,12 @@ func (c *StorageGateway) ListVolumesPagesWithContext(ctx aws.Context, input *Lis }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListVolumesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListVolumesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -5369,12 +5479,12 @@ func (c *StorageGateway) NotifyWhenUploadedRequest(input *NotifyWhenUploadedInpu // See the AWS API reference guide for AWS Storage Gateway's // API operation NotifyWhenUploaded for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -5458,6 +5568,17 @@ func (c *StorageGateway) RefreshCacheRequest(input *RefreshCacheInput) (req *req // for new files on the gateway file share. You can subscribe to be notified // through an CloudWatch event when your RefreshCache operation completes. // +// Throttle limit: This API is asynchronous so the gateway will accept no more +// than two refreshes at any time. We recommend using the refresh-complete CloudWatch +// event notification before issuing additional requests. For more information, +// see Getting Notified About File Operations (https://docs.aws.amazon.com/storagegateway/latest/userguide/monitoring-file-gateway.html#get-notification). +// +// If you invoke the RefreshCache API when two requests are already being processed, +// any new request will cause an InvalidGatewayRequestException error because +// too many requests were sent to the server. +// +// For more information, see "https://docs.aws.amazon.com/storagegateway/latest/userguide/monitoring-file-gateway.html#get-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. @@ -5465,12 +5586,12 @@ func (c *StorageGateway) RefreshCacheRequest(input *RefreshCacheInput) (req *req // See the AWS API reference guide for AWS Storage Gateway's // API operation RefreshCache for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -5540,8 +5661,8 @@ func (c *StorageGateway) RemoveTagsFromResourceRequest(input *RemoveTagsFromReso // RemoveTagsFromResource API operation for AWS Storage Gateway. // -// Removes one or more tags from the specified resource. This operation is only -// supported in the cached volume, stored volume and tape gateway types. +// Removes one or more tags from the specified resource. This operation is supported +// in storage gateways of all 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 @@ -5550,12 +5671,12 @@ func (c *StorageGateway) RemoveTagsFromResourceRequest(input *RemoveTagsFromReso // See the AWS API reference guide for AWS Storage Gateway's // API operation RemoveTagsFromResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -5645,12 +5766,12 @@ func (c *StorageGateway) ResetCacheRequest(input *ResetCacheInput) (req *request // See the AWS API reference guide for AWS Storage Gateway's // API operation ResetCache for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -5738,12 +5859,12 @@ func (c *StorageGateway) RetrieveTapeArchiveRequest(input *RetrieveTapeArchiveIn // See the AWS API reference guide for AWS Storage Gateway's // API operation RetrieveTapeArchive for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -5831,12 +5952,12 @@ func (c *StorageGateway) RetrieveTapeRecoveryPointRequest(input *RetrieveTapeRec // See the AWS API reference guide for AWS Storage Gateway's // API operation RetrieveTapeRecoveryPoint for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -5918,12 +6039,12 @@ func (c *StorageGateway) SetLocalConsolePasswordRequest(input *SetLocalConsolePa // See the AWS API reference guide for AWS Storage Gateway's // API operation SetLocalConsolePassword for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -6003,12 +6124,12 @@ func (c *StorageGateway) SetSMBGuestPasswordRequest(input *SetSMBGuestPasswordIn // See the AWS API reference guide for AWS Storage Gateway's // API operation SetSMBGuestPassword for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -6107,12 +6228,12 @@ func (c *StorageGateway) ShutdownGatewayRequest(input *ShutdownGatewayInput) (re // See the AWS API reference guide for AWS Storage Gateway's // API operation ShutdownGateway for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -6138,6 +6259,96 @@ func (c *StorageGateway) ShutdownGatewayWithContext(ctx aws.Context, input *Shut return out, req.Send() } +const opStartAvailabilityMonitorTest = "StartAvailabilityMonitorTest" + +// StartAvailabilityMonitorTestRequest generates a "aws/request.Request" representing the +// client's request for the StartAvailabilityMonitorTest operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartAvailabilityMonitorTest for more information on using the StartAvailabilityMonitorTest +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartAvailabilityMonitorTestRequest method. +// req, resp := client.StartAvailabilityMonitorTestRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/storagegateway-2013-06-30/StartAvailabilityMonitorTest +func (c *StorageGateway) StartAvailabilityMonitorTestRequest(input *StartAvailabilityMonitorTestInput) (req *request.Request, output *StartAvailabilityMonitorTestOutput) { + op := &request.Operation{ + Name: opStartAvailabilityMonitorTest, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &StartAvailabilityMonitorTestInput{} + } + + output = &StartAvailabilityMonitorTestOutput{} + req = c.newRequest(op, input, output) + return +} + +// StartAvailabilityMonitorTest API operation for AWS Storage Gateway. +// +// Start a test that verifies that the specified gateway is configured for High +// Availability monitoring in your host environment. This request only initiates +// the test and that a successful response only indicates that the test was +// started. It doesn't indicate that the test passed. For the status of the +// test, invoke the DescribeAvailabilityMonitorTest API. +// +// Starting this test will cause your gateway to go offline for a brief 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 Storage Gateway's +// API operation StartAvailabilityMonitorTest for usage and error information. +// +// Returned Error Types: +// * InvalidGatewayRequestException +// An exception occurred because an invalid gateway request was issued to the +// service. For more information, see the error and message fields. +// +// * InternalServerError +// An internal server error has occurred during the request. For more information, +// see the error and message fields. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/storagegateway-2013-06-30/StartAvailabilityMonitorTest +func (c *StorageGateway) StartAvailabilityMonitorTest(input *StartAvailabilityMonitorTestInput) (*StartAvailabilityMonitorTestOutput, error) { + req, out := c.StartAvailabilityMonitorTestRequest(input) + return out, req.Send() +} + +// StartAvailabilityMonitorTestWithContext is the same as StartAvailabilityMonitorTest with the addition of +// the ability to pass a context and additional request options. +// +// See StartAvailabilityMonitorTest for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *StorageGateway) StartAvailabilityMonitorTestWithContext(ctx aws.Context, input *StartAvailabilityMonitorTestInput, opts ...request.Option) (*StartAvailabilityMonitorTestOutput, error) { + req, out := c.StartAvailabilityMonitorTestRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opStartGateway = "StartGateway" // StartGatewayRequest generates a "aws/request.Request" representing the @@ -6202,12 +6413,12 @@ func (c *StorageGateway) StartGatewayRequest(input *StartGatewayInput) (req *req // See the AWS API reference guide for AWS Storage Gateway's // API operation StartGateway for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -6279,7 +6490,8 @@ func (c *StorageGateway) UpdateBandwidthRateLimitRequest(input *UpdateBandwidthR // // Updates the bandwidth rate limits of a gateway. You can update both the upload // and download bandwidth rate limit or specify only one of the two. If you -// don't set a bandwidth rate limit, the existing rate limit remains. +// don't set a bandwidth rate limit, the existing rate limit remains. This operation +// is supported for the stored volume, cached volume and tape gateway types.' // // By default, a gateway's bandwidth rate limits are not set. If you don't set // any limit, the gateway does not have any limitations on its bandwidth usage @@ -6295,12 +6507,12 @@ func (c *StorageGateway) UpdateBandwidthRateLimitRequest(input *UpdateBandwidthR // See the AWS API reference guide for AWS Storage Gateway's // API operation UpdateBandwidthRateLimit for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -6372,7 +6584,8 @@ func (c *StorageGateway) UpdateChapCredentialsRequest(input *UpdateChapCredentia // // Updates the Challenge-Handshake Authentication Protocol (CHAP) credentials // for a specified iSCSI target. By default, a gateway does not have CHAP enabled; -// however, for added security, you might use it. +// however, for added security, you might use it. This operation is supported +// in the volume and tape gateway types. // // When you update CHAP credentials, all existing connections on the target // are closed and initiators must reconnect with the new credentials. @@ -6384,12 +6597,12 @@ func (c *StorageGateway) UpdateChapCredentialsRequest(input *UpdateChapCredentia // See the AWS API reference guide for AWS Storage Gateway's // API operation UpdateChapCredentials for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -6474,12 +6687,12 @@ func (c *StorageGateway) UpdateGatewayInformationRequest(input *UpdateGatewayInf // See the AWS API reference guide for AWS Storage Gateway's // API operation UpdateGatewayInformation for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -6572,12 +6785,12 @@ func (c *StorageGateway) UpdateGatewaySoftwareNowRequest(input *UpdateGatewaySof // See the AWS API reference guide for AWS Storage Gateway's // API operation UpdateGatewaySoftwareNow for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -6658,12 +6871,12 @@ func (c *StorageGateway) UpdateMaintenanceStartTimeRequest(input *UpdateMaintena // See the AWS API reference guide for AWS Storage Gateway's // API operation UpdateMaintenanceStartTime for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -6761,12 +6974,12 @@ func (c *StorageGateway) UpdateNFSFileShareRequest(input *UpdateNFSFileShareInpu // See the AWS API reference guide for AWS Storage Gateway's // API operation UpdateNFSFileShare for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -6857,12 +7070,12 @@ func (c *StorageGateway) UpdateSMBFileShareRequest(input *UpdateSMBFileShareInpu // See the AWS API reference guide for AWS Storage Gateway's // API operation UpdateSMBFileShare for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -6946,12 +7159,12 @@ func (c *StorageGateway) UpdateSMBSecurityStrategyRequest(input *UpdateSMBSecuri // See the AWS API reference guide for AWS Storage Gateway's // API operation UpdateSMBSecurityStrategy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -7039,12 +7252,12 @@ func (c *StorageGateway) UpdateSnapshotScheduleRequest(input *UpdateSnapshotSche // See the AWS API reference guide for AWS Storage Gateway's // API operation UpdateSnapshotSchedule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -7127,12 +7340,12 @@ func (c *StorageGateway) UpdateVTLDeviceTypeRequest(input *UpdateVTLDeviceTypeIn // See the AWS API reference guide for AWS Storage Gateway's // API operation UpdateVTLDeviceType for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidGatewayRequestException "InvalidGatewayRequestException" +// Returned Error Types: +// * InvalidGatewayRequestException // An exception occurred because an invalid gateway request was issued to the // service. For more information, see the error and message fields. // -// * ErrCodeInternalServerError "InternalServerError" +// * InternalServerError // An internal server error has occurred during the request. For more information, // see the error and message fields. // @@ -10630,6 +10843,92 @@ func (s *DeleteVolumeOutput) SetVolumeARN(v string) *DeleteVolumeOutput { return s } +type DescribeAvailabilityMonitorTestInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation + // to return a list of gateways for your account and AWS Region. + // + // GatewayARN is a required field + GatewayARN *string `min:"50" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeAvailabilityMonitorTestInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAvailabilityMonitorTestInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeAvailabilityMonitorTestInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeAvailabilityMonitorTestInput"} + if s.GatewayARN == nil { + invalidParams.Add(request.NewErrParamRequired("GatewayARN")) + } + if s.GatewayARN != nil && len(*s.GatewayARN) < 50 { + invalidParams.Add(request.NewErrParamMinLen("GatewayARN", 50)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGatewayARN sets the GatewayARN field's value. +func (s *DescribeAvailabilityMonitorTestInput) SetGatewayARN(v string) *DescribeAvailabilityMonitorTestInput { + s.GatewayARN = &v + return s +} + +type DescribeAvailabilityMonitorTestOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation + // to return a list of gateways for your account and AWS Region. + GatewayARN *string `min:"50" type:"string"` + + // The time the High Availability monitoring test was started. If a test hasn't + // been performed, the value of this field is null. + StartTime *time.Time `type:"timestamp"` + + // The status of the High Availability monitoring test. If a test hasn't been + // performed, the value of this field is null. + Status *string `type:"string" enum:"AvailabilityMonitorTestStatus"` +} + +// String returns the string representation +func (s DescribeAvailabilityMonitorTestOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeAvailabilityMonitorTestOutput) GoString() string { + return s.String() +} + +// SetGatewayARN sets the GatewayARN field's value. +func (s *DescribeAvailabilityMonitorTestOutput) SetGatewayARN(v string) *DescribeAvailabilityMonitorTestOutput { + s.GatewayARN = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *DescribeAvailabilityMonitorTestOutput) SetStartTime(v time.Time) *DescribeAvailabilityMonitorTestOutput { + s.StartTime = &v + return s +} + +// SetStatus sets the Status field's value. +func (s *DescribeAvailabilityMonitorTestOutput) SetStatus(v string) *DescribeAvailabilityMonitorTestOutput { + s.Status = &v + return s +} + // A JSON object containing the of the gateway. type DescribeBandwidthRateLimitInput struct { _ struct{} `type:"structure"` @@ -11040,8 +11339,8 @@ func (s *DescribeGatewayInformationInput) SetGatewayARN(v string) *DescribeGatew type DescribeGatewayInformationOutput struct { _ struct{} `type:"structure"` - // The Amazon Resource Name (ARN) of the Amazon CloudWatch log group that was - // used to monitor and log events in the gateway. + // The Amazon Resource Name (ARN) of the Amazon CloudWatch Log Group that is + // used to monitor events in the gateway. CloudWatchLogGroupARN *string `type:"string"` // The ID of the Amazon EC2 instance that was used to launch the gateway. @@ -11075,6 +11374,9 @@ type DescribeGatewayInformationOutput struct { // The type of the gateway. GatewayType *string `min:"2" type:"string"` + // The type of hypervisor environment used by the host. + HostEnvironment *string `type:"string" enum:"HostEnvironment"` + // The date on which the last software update was applied to the gateway. If // the gateway has never been updated, this field does not return a value in // the response. @@ -11165,6 +11467,12 @@ func (s *DescribeGatewayInformationOutput) SetGatewayType(v string) *DescribeGat return s } +// SetHostEnvironment sets the HostEnvironment field's value. +func (s *DescribeGatewayInformationOutput) SetHostEnvironment(v string) *DescribeGatewayInformationOutput { + s.HostEnvironment = &v + return s +} + // SetLastSoftwareUpdate sets the LastSoftwareUpdate field's value. func (s *DescribeGatewayInformationOutput) SetLastSoftwareUpdate(v string) *DescribeGatewayInformationOutput { s.LastSoftwareUpdate = &v @@ -11502,6 +11810,28 @@ func (s *DescribeSMBSettingsInput) SetGatewayARN(v string) *DescribeSMBSettingsI type DescribeSMBSettingsOutput struct { _ struct{} `type:"structure"` + // Indicates the status of a gateway that is a member of the Active Directory + // domain. + // + // * ACCESS_DENIED: Indicates that the JoinDomain operation failed due to + // an authentication error. + // + // * DETACHED: Indicates that gateway is not joined to a domain. + // + // * JOINED: Indicates that the gateway has successfully joined a domain. + // + // * JOINING: Indicates that a JoinDomain operation is in progress. + // + // * NETWORK_ERROR: Indicates that JoinDomain operation failed due to a network + // or connectivity error. + // + // * TIMEOUT: Indicates that the JoinDomain operation failed because the + // operation didn't complete within the allotted time. + // + // * UNKNOWN_ERROR: Indicates that the JoinDomain operation failed due to + // another type of error. + ActiveDirectoryStatus *string `type:"string" enum:"ActiveDirectoryStatus"` + // The name of the domain that the gateway is joined to. DomainName *string `min:"1" type:"string"` @@ -11540,6 +11870,12 @@ func (s DescribeSMBSettingsOutput) GoString() string { return s.String() } +// SetActiveDirectoryStatus sets the ActiveDirectoryStatus field's value. +func (s *DescribeSMBSettingsOutput) SetActiveDirectoryStatus(v string) *DescribeSMBSettingsOutput { + s.ActiveDirectoryStatus = &v + return s +} + // SetDomainName sets the DomainName field's value. func (s *DescribeSMBSettingsOutput) SetDomainName(v string) *DescribeSMBSettingsOutput { s.DomainName = &v @@ -12923,6 +13259,129 @@ func (s *GatewayInfo) SetGatewayType(v string) *GatewayInfo { return s } +// An internal server error has occurred during the request. For more information, +// see the error and message fields. +type InternalServerError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A StorageGatewayError that provides more information about the cause of the + // error. + Error_ *Error `locationName:"error" type:"structure"` + + // A human-readable message describing the error that occurred. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InternalServerError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerError) GoString() string { + return s.String() +} + +func newErrorInternalServerError(v protocol.ResponseMetadata) error { + return &InternalServerError{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerError) Code() string { + return "InternalServerError" +} + +// Message returns the exception's message. +func (s InternalServerError) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerError) OrigErr() error { + return nil +} + +func (s InternalServerError) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerError) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerError) RequestID() string { + return s.respMetadata.RequestID +} + +// An exception occurred because an invalid gateway request was issued to the +// service. For more information, see the error and message fields. +type InvalidGatewayRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A StorageGatewayError that provides more detail about the cause of the error. + Error_ *Error `locationName:"error" type:"structure"` + + // A human-readable message describing the error that occurred. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidGatewayRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidGatewayRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidGatewayRequestException(v protocol.ResponseMetadata) error { + return &InvalidGatewayRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidGatewayRequestException) Code() string { + return "InvalidGatewayRequestException" +} + +// Message returns the exception's message. +func (s InvalidGatewayRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidGatewayRequestException) OrigErr() error { + return nil +} + +func (s InvalidGatewayRequestException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidGatewayRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidGatewayRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // JoinDomainInput type JoinDomainInput struct { _ struct{} `type:"structure"` @@ -12954,8 +13413,14 @@ type JoinDomainInput struct { // Password is a required field Password *string `min:"1" type:"string" required:"true" sensitive:"true"` + // Specifies the time in seconds, in which the JoinDomain operation must complete. + // The default is 20 seconds. + TimeoutInSeconds *int64 `type:"integer"` + // Sets the user name of user who has permission to add the gateway to the Active - // Directory domain. + // Directory domain. The domain user account should be enabled to join computers + // to the domain. For example, you can use the domain administrator account + // or an account with delegated permissions to join computers to the domain. // // UserName is a required field UserName *string `min:"1" type:"string" required:"true"` @@ -13038,6 +13503,12 @@ func (s *JoinDomainInput) SetPassword(v string) *JoinDomainInput { return s } +// SetTimeoutInSeconds sets the TimeoutInSeconds field's value. +func (s *JoinDomainInput) SetTimeoutInSeconds(v int64) *JoinDomainInput { + s.TimeoutInSeconds = &v + return s +} + // SetUserName sets the UserName field's value. func (s *JoinDomainInput) SetUserName(v string) *JoinDomainInput { s.UserName = &v @@ -13048,6 +13519,27 @@ func (s *JoinDomainInput) SetUserName(v string) *JoinDomainInput { type JoinDomainOutput struct { _ struct{} `type:"structure"` + // Indicates the status of the gateway as a member of the Active Directory domain. + // + // * ACCESS_DENIED: Indicates that the JoinDomain operation failed due to + // an authentication error. + // + // * DETACHED: Indicates that gateway is not joined to a domain. + // + // * JOINED: Indicates that the gateway has successfully joined a domain. + // + // * JOINING: Indicates that a JoinDomain operation is in progress. + // + // * NETWORK_ERROR: Indicates that JoinDomain operation failed due to a network + // or connectivity error. + // + // * TIMEOUT: Indicates that the JoinDomain operation failed because the + // operation didn't complete within the allotted time. + // + // * UNKNOWN_ERROR: Indicates that the JoinDomain operation failed due to + // another type of error. + ActiveDirectoryStatus *string `type:"string" enum:"ActiveDirectoryStatus"` + // The unique Amazon Resource Name (ARN) of the gateway that joined the domain. GatewayARN *string `min:"50" type:"string"` } @@ -13062,6 +13554,12 @@ func (s JoinDomainOutput) GoString() string { return s.String() } +// SetActiveDirectoryStatus sets the ActiveDirectoryStatus field's value. +func (s *JoinDomainOutput) SetActiveDirectoryStatus(v string) *JoinDomainOutput { + s.ActiveDirectoryStatus = &v + return s +} + // SetGatewayARN sets the GatewayARN field's value. func (s *JoinDomainOutput) SetGatewayARN(v string) *JoinDomainOutput { s.GatewayARN = &v @@ -14897,6 +15395,68 @@ func (s *SMBFileShareInfo) SetValidUserList(v []*string) *SMBFileShareInfo { return s } +// An internal server error has occurred because the service is unavailable. +// For more information, see the error and message fields. +type ServiceUnavailableError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A StorageGatewayError that provides more information about the cause of the + // error. + Error_ *Error `locationName:"error" type:"structure"` + + // A human-readable message describing the error that occurred. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableError) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableError(v protocol.ResponseMetadata) error { + return &ServiceUnavailableError{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableError) Code() string { + return "ServiceUnavailableError" +} + +// Message returns the exception's message. +func (s ServiceUnavailableError) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableError) OrigErr() error { + return nil +} + +func (s ServiceUnavailableError) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableError) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableError) RequestID() string { + return s.respMetadata.RequestID +} + // SetLocalConsolePasswordInput type SetLocalConsolePasswordInput struct { _ struct{} `type:"structure"` @@ -15133,6 +15693,72 @@ func (s *ShutdownGatewayOutput) SetGatewayARN(v string) *ShutdownGatewayOutput { return s } +type StartAvailabilityMonitorTestInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation + // to return a list of gateways for your account and AWS Region. + // + // GatewayARN is a required field + GatewayARN *string `min:"50" type:"string" required:"true"` +} + +// String returns the string representation +func (s StartAvailabilityMonitorTestInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartAvailabilityMonitorTestInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *StartAvailabilityMonitorTestInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "StartAvailabilityMonitorTestInput"} + if s.GatewayARN == nil { + invalidParams.Add(request.NewErrParamRequired("GatewayARN")) + } + if s.GatewayARN != nil && len(*s.GatewayARN) < 50 { + invalidParams.Add(request.NewErrParamMinLen("GatewayARN", 50)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGatewayARN sets the GatewayARN field's value. +func (s *StartAvailabilityMonitorTestInput) SetGatewayARN(v string) *StartAvailabilityMonitorTestInput { + s.GatewayARN = &v + return s +} + +type StartAvailabilityMonitorTestOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the gateway. Use the ListGateways operation + // to return a list of gateways for your account and AWS Region. + GatewayARN *string `min:"50" type:"string"` +} + +// String returns the string representation +func (s StartAvailabilityMonitorTestOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StartAvailabilityMonitorTestOutput) GoString() string { + return s.String() +} + +// SetGatewayARN sets the GatewayARN field's value. +func (s *StartAvailabilityMonitorTestOutput) SetGatewayARN(v string) *StartAvailabilityMonitorTestOutput { + s.GatewayARN = &v + return s +} + // A JSON object containing the of the gateway to start. type StartGatewayInput struct { _ struct{} `type:"structure"` @@ -17340,6 +17966,40 @@ func (s *VolumeiSCSIAttributes) SetTargetARN(v string) *VolumeiSCSIAttributes { return s } +const ( + // ActiveDirectoryStatusAccessDenied is a ActiveDirectoryStatus enum value + ActiveDirectoryStatusAccessDenied = "ACCESS_DENIED" + + // ActiveDirectoryStatusDetached is a ActiveDirectoryStatus enum value + ActiveDirectoryStatusDetached = "DETACHED" + + // ActiveDirectoryStatusJoined is a ActiveDirectoryStatus enum value + ActiveDirectoryStatusJoined = "JOINED" + + // ActiveDirectoryStatusJoining is a ActiveDirectoryStatus enum value + ActiveDirectoryStatusJoining = "JOINING" + + // ActiveDirectoryStatusNetworkError is a ActiveDirectoryStatus enum value + ActiveDirectoryStatusNetworkError = "NETWORK_ERROR" + + // ActiveDirectoryStatusTimeout is a ActiveDirectoryStatus enum value + ActiveDirectoryStatusTimeout = "TIMEOUT" + + // ActiveDirectoryStatusUnknownError is a ActiveDirectoryStatus enum value + ActiveDirectoryStatusUnknownError = "UNKNOWN_ERROR" +) + +const ( + // AvailabilityMonitorTestStatusComplete is a AvailabilityMonitorTestStatus enum value + AvailabilityMonitorTestStatusComplete = "COMPLETE" + + // AvailabilityMonitorTestStatusFailed is a AvailabilityMonitorTestStatus enum value + AvailabilityMonitorTestStatusFailed = "FAILED" + + // AvailabilityMonitorTestStatusPending is a AvailabilityMonitorTestStatus enum value + AvailabilityMonitorTestStatusPending = "PENDING" +) + const ( // ErrorCodeActivationKeyExpired is a ErrorCode enum value ErrorCodeActivationKeyExpired = "ActivationKeyExpired" @@ -17434,6 +18094,9 @@ const ( // ErrorCodeLunInvalid is a ErrorCode enum value ErrorCodeLunInvalid = "LunInvalid" + // ErrorCodeJoinDomainInProgress is a ErrorCode enum value + ErrorCodeJoinDomainInProgress = "JoinDomainInProgress" + // ErrorCodeMaximumContentLengthExceeded is a ErrorCode enum value ErrorCodeMaximumContentLengthExceeded = "MaximumContentLengthExceeded" @@ -17534,6 +18197,23 @@ const ( FileShareTypeSmb = "SMB" ) +const ( + // HostEnvironmentVmware is a HostEnvironment enum value + HostEnvironmentVmware = "VMWARE" + + // HostEnvironmentHyperV is a HostEnvironment enum value + HostEnvironmentHyperV = "HYPER-V" + + // HostEnvironmentEc2 is a HostEnvironment enum value + HostEnvironmentEc2 = "EC2" + + // HostEnvironmentKvm is a HostEnvironment enum value + HostEnvironmentKvm = "KVM" + + // HostEnvironmentOther is a HostEnvironment enum value + HostEnvironmentOther = "OTHER" +) + // A value that sets the access control list permission for objects in the S3 // bucket that a file gateway puts objects into. The default value is "private". const ( diff --git a/vendor/github.com/aws/aws-sdk-go/service/storagegateway/errors.go b/vendor/github.com/aws/aws-sdk-go/service/storagegateway/errors.go index 01b9816e3aa..ec8cb455d0a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/storagegateway/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/storagegateway/errors.go @@ -2,6 +2,10 @@ package storagegateway +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInternalServerError for service response error code @@ -25,3 +29,9 @@ const ( // For more information, see the error and message fields. ErrCodeServiceUnavailableError = "ServiceUnavailableError" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InternalServerError": newErrorInternalServerError, + "InvalidGatewayRequestException": newErrorInvalidGatewayRequestException, + "ServiceUnavailableError": newErrorServiceUnavailableError, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/storagegateway/service.go b/vendor/github.com/aws/aws-sdk-go/service/storagegateway/service.go index 9a0c08f6962..0e86cd1836a 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/storagegateway/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/storagegateway/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "storagegateway" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Storage Gateway" // ServiceID is a unique identifer of a specific service. + ServiceID = "Storage Gateway" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the StorageGateway client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a StorageGateway client from just a session. // svc := storagegateway.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := storagegateway.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *StorageGateway { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *StorageGateway { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *StorageGateway { svc := &StorageGateway{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2013-06-30", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 eb0a6a417ef..7f60d4aa185 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 @@ -78,6 +78,8 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles.html) // in the IAM User Guide. // +// Session Duration +// // By default, the temporary security credentials created by AssumeRole last // for one hour. However, you can use the optional DurationSeconds parameter // to specify the duration of your session. You can provide a value from 900 @@ -91,6 +93,8 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) // in the IAM User Guide. // +// Permissions +// // The temporary security credentials created by AssumeRole can be used to make // API calls to any AWS service with the following exception: You cannot call // the AWS STS GetFederationToken or GetSessionToken API operations. @@ -99,7 +103,7 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // to this operation. You can pass a single JSON policy document to use as an // inline session policy. You can also specify up to 10 managed policies to // use as managed session policies. The plain text that you use for both inline -// and managed session policies shouldn't exceed 2048 characters. Passing policies +// and managed session policies can't exceed 2,048 characters. Passing policies // to this operation returns new temporary credentials. The resulting session's // permissions are the intersection of the role's identity-based policy and // the session policies. You can use the role's temporary credentials in subsequent @@ -131,6 +135,24 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // see IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) // in the IAM User Guide. // +// Tags +// +// (Optional) You can pass tag key-value pairs to your session. These tags are +// called session tags. For more information about session tags, see Passing +// Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// An administrator must grant you the permissions necessary to pass session +// tags. The administrator can also create granular permissions to allow you +// to pass only specific session tags. For more information, see Tutorial: Using +// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. +// +// You can set the session tags as transitive. Transitive tags persist during +// role chaining. For more information, see Chaining Roles with Session Tags +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) +// in the IAM User Guide. +// // Using MFA with AssumeRole // // (Optional) You can include multi-factor authentication (MFA) information @@ -165,9 +187,18 @@ func (c *STS) AssumeRoleRequest(input *AssumeRoleInput) (req *request.Request, o // message describes the specific error. // // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the policy document was too large. The error -// message describes how big the policy document is, in packed form, as a percentage -// of what the API allows. +// The request was rejected because the total packed size of the session policies +// and session tags combined was too large. An AWS conversion compresses the +// session policy document, session policy ARNs, and session tags into a packed +// binary format that has a separate limit. The error message indicates by percentage +// how close the policies and tags are to the upper size limit. For more information, +// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You could receive this error even though you meet other defined session policy +// and session tag limits. For more information, see IAM and STS Entity Character +// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// in the IAM User Guide. // // * ErrCodeRegionDisabledException "RegionDisabledException" // STS is not activated in the requested region for the account that is being @@ -256,6 +287,8 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // an access key ID, a secret access key, and a security token. Applications // can use these temporary security credentials to sign calls to AWS services. // +// Session Duration +// // By default, the temporary security credentials created by AssumeRoleWithSAML // last for one hour. However, you can use the optional DurationSeconds parameter // to specify the duration of your session. Your role session lasts for the @@ -271,6 +304,8 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) // in the IAM User Guide. // +// Permissions +// // The temporary security credentials created by AssumeRoleWithSAML can be used // to make API calls to any AWS service with the following exception: you cannot // call the STS GetFederationToken or GetSessionToken API operations. @@ -279,7 +314,7 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // to this operation. You can pass a single JSON policy document to use as an // inline session policy. You can also specify up to 10 managed policies to // use as managed session policies. The plain text that you use for both inline -// and managed session policies shouldn't exceed 2048 characters. Passing policies +// and managed session policies can't exceed 2,048 characters. Passing policies // to this operation returns new temporary credentials. The resulting session's // permissions are the intersection of the role's identity-based policy and // the session policies. You can use the role's temporary credentials in subsequent @@ -289,12 +324,6 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. // -// Before your application can call AssumeRoleWithSAML, you must configure your -// SAML identity provider (IdP) to issue the claims required by AWS. Additionally, -// you must use AWS Identity and Access Management (IAM) to create a SAML provider -// entity in your AWS account that represents your identity provider. You must -// also create an IAM role that specifies this SAML provider in its trust policy. -// // Calling AssumeRoleWithSAML does not require the use of AWS security credentials. // The identity of the caller is validated by using keys in the metadata document // that is uploaded for the SAML provider entity for your identity provider. @@ -302,8 +331,50 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // Calling AssumeRoleWithSAML can result in an entry in your AWS CloudTrail // logs. The entry includes the value in the NameID element of the SAML assertion. // We recommend that you use a NameIDType that is not associated with any personally -// identifiable information (PII). For example, you could instead use the Persistent -// Identifier (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent). +// identifiable information (PII). For example, you could instead use the persistent +// identifier (urn:oasis:names:tc:SAML:2.0:nameid-format:persistent). +// +// Tags +// +// (Optional) You can configure your IdP to pass attributes into your SAML assertion +// as session tags. Each session tag consists of a key name and an associated +// value. For more information about session tags, see Passing Session Tags +// in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You can pass up to 50 session tags. The plain text session tag keys can’t +// exceed 128 characters and the values can’t exceed 256 characters. For these +// and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) +// in the IAM User Guide. +// +// An AWS conversion compresses the passed session policies and session tags +// into a packed binary format that has a separate limit. Your request can fail +// for this limit even if your plain text meets the other requirements. The +// PackedPolicySize response element indicates by percentage how close the policies +// and tags for your request are to the upper size limit. +// +// You can pass a session tag with the same key as a tag that is attached to +// the role. When you do, session tags override the role's tags with the same +// key. +// +// An administrator must grant you the permissions necessary to pass session +// tags. The administrator can also create granular permissions to allow you +// to pass only specific session tags. For more information, see Tutorial: Using +// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. +// +// You can set the session tags as transitive. Transitive tags persist during +// role chaining. For more information, see Chaining Roles with Session Tags +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) +// in the IAM User Guide. +// +// SAML Configuration +// +// Before your application can call AssumeRoleWithSAML, you must configure your +// SAML identity provider (IdP) to issue the claims required by AWS. Additionally, +// you must use AWS Identity and Access Management (IAM) to create a SAML provider +// entity in your AWS account that represents your identity provider. You must +// also create an IAM role that specifies this SAML provider in its trust policy. // // For more information, see the following resources: // @@ -332,9 +403,18 @@ func (c *STS) AssumeRoleWithSAMLRequest(input *AssumeRoleWithSAMLInput) (req *re // message describes the specific error. // // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the policy document was too large. The error -// message describes how big the policy document is, in packed form, as a percentage -// of what the API allows. +// The request was rejected because the total packed size of the session policies +// and session tags combined was too large. An AWS conversion compresses the +// session policy document, session policy ARNs, and session tags into a packed +// binary format that has a separate limit. The error message indicates by percentage +// how close the policies and tags are to the upper size limit. For more information, +// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You could receive this error even though you meet other defined session policy +// and session tag limits. For more information, see IAM and STS Entity Character +// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// in the IAM User Guide. // // * ErrCodeIDPRejectedClaimException "IDPRejectedClaim" // The identity provider (IdP) reported that authentication failed. This might @@ -456,6 +536,8 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // key ID, a secret access key, and a security token. Applications can use these // temporary security credentials to sign calls to AWS service API operations. // +// Session Duration +// // By default, the temporary security credentials created by AssumeRoleWithWebIdentity // last for one hour. However, you can use the optional DurationSeconds parameter // to specify the duration of your session. You can provide a value from 900 @@ -469,6 +551,8 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // URL. For more information, see Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use.html) // in the IAM User Guide. // +// Permissions +// // The temporary security credentials created by AssumeRoleWithWebIdentity can // be used to make API calls to any AWS service with the following exception: // you cannot call the STS GetFederationToken or GetSessionToken API operations. @@ -477,7 +561,7 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // to this operation. You can pass a single JSON policy document to use as an // inline session policy. You can also specify up to 10 managed policies to // use as managed session policies. The plain text that you use for both inline -// and managed session policies shouldn't exceed 2048 characters. Passing policies +// and managed session policies can't exceed 2,048 characters. Passing policies // to this operation returns new temporary credentials. The resulting session's // permissions are the intersection of the role's identity-based policy and // the session policies. You can use the role's temporary credentials in subsequent @@ -487,6 +571,42 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. // +// Tags +// +// (Optional) You can configure your IdP to pass attributes into your web identity +// token as session tags. Each session tag consists of a key name and an associated +// value. For more information about session tags, see Passing Session Tags +// in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You can pass up to 50 session tags. The plain text session tag keys can’t +// exceed 128 characters and the values can’t exceed 256 characters. For these +// and additional limits, see IAM and STS Character Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) +// in the IAM User Guide. +// +// An AWS conversion compresses the passed session policies and session tags +// into a packed binary format that has a separate limit. Your request can fail +// for this limit even if your plain text meets the other requirements. The +// PackedPolicySize response element indicates by percentage how close the policies +// and tags for your request are to the upper size limit. +// +// You can pass a session tag with the same key as a tag that is attached to +// the role. When you do, the session tag overrides the role tag with the same +// key. +// +// An administrator must grant you the permissions necessary to pass session +// tags. The administrator can also create granular permissions to allow you +// to pass only specific session tags. For more information, see Tutorial: Using +// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. +// +// You can set the session tags as transitive. Transitive tags persist during +// role chaining. For more information, see Chaining Roles with Session Tags +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) +// in the IAM User Guide. +// +// Identities +// // Before your application can call AssumeRoleWithWebIdentity, you must have // an identity token from a supported identity provider and create a role that // the application can assume. The role that your application assumes must trust @@ -514,8 +634,8 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // * AWS SDK for iOS Developer Guide (http://aws.amazon.com/sdkforios/) and // AWS SDK for Android Developer Guide (http://aws.amazon.com/sdkforandroid/). // These toolkits contain sample apps that show how to invoke the identity -// providers, and then how to use the information from these providers to -// get and use temporary security credentials. +// providers. The toolkits then show how to use the information from these +// providers to get and use temporary security credentials. // // * Web Identity Federation with Mobile Applications (http://aws.amazon.com/articles/web-identity-federation-with-mobile-applications). // This article discusses web identity federation and shows an example of @@ -535,9 +655,18 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // message describes the specific error. // // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the policy document was too large. The error -// message describes how big the policy document is, in packed form, as a percentage -// of what the API allows. +// The request was rejected because the total packed size of the session policies +// and session tags combined was too large. An AWS conversion compresses the +// session policy document, session policy ARNs, and session tags into a packed +// binary format that has a separate limit. The error message indicates by percentage +// how close the policies and tags are to the upper size limit. For more information, +// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You could receive this error even though you meet other defined session policy +// and session tag limits. For more information, see IAM and STS Entity Character +// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// in the IAM User Guide. // // * ErrCodeIDPRejectedClaimException "IDPRejectedClaim" // The identity provider (IdP) reported that authentication failed. This might @@ -547,11 +676,11 @@ func (c *STS) AssumeRoleWithWebIdentityRequest(input *AssumeRoleWithWebIdentityI // can also mean that the claim has expired or has been explicitly revoked. // // * ErrCodeIDPCommunicationErrorException "IDPCommunicationError" -// The request could not be fulfilled because the non-AWS identity provider -// (IDP) that was asked to verify the incoming identity token could not be reached. -// This is often a transient error caused by network conditions. Retry the request +// The request could not be fulfilled because the identity provider (IDP) that +// was asked to verify the incoming identity token could not be reached. This +// is often a transient error caused by network conditions. Retry the request // a limited number of times so that you don't exceed the request rate. If the -// error persists, the non-AWS identity provider might be down or not responding. +// error persists, the identity provider might be down or not responding. // // * ErrCodeInvalidIdentityTokenException "InvalidIdentityToken" // The web identity token that was passed could not be validated by AWS. Get @@ -763,7 +892,8 @@ func (c *STS) GetAccessKeyInfoRequest(input *GetAccessKeyInfoInput) (req *reques // pull a credentials report (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_getting-report.html) // to learn which IAM user owns the keys. To learn who requested the temporary // credentials for an ASIA access key, view the STS events in your CloudTrail -// logs (https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html). +// logs (https://docs.aws.amazon.com/IAM/latest/UserGuide/cloudtrail-integration.html) +// in the IAM User Guide. // // This operation does not indicate the state of the access key. The key might // be active, inactive, or deleted. Active keys might not have permissions to @@ -850,7 +980,8 @@ func (c *STS) GetCallerIdentityRequest(input *GetCallerIdentityInput) (req *requ // sts:GetCallerIdentity action, you can still perform this operation. Permissions // are not required because the same information is returned when an IAM user // or role is denied access. To view an example response, see I Am Not Authorized -// to Perform: iam:DeleteVirtualMFADevice (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa). +// to Perform: iam:DeleteVirtualMFADevice (https://docs.aws.amazon.com/IAM/latest/UserGuide/troubleshoot_general.html#troubleshoot_general_access-denied-delete-mfa) +// in the IAM User Guide. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -942,7 +1073,8 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re // or an OpenID Connect-compatible identity provider. In this case, we recommend // that you use Amazon Cognito (http://aws.amazon.com/cognito/) or AssumeRoleWithWebIdentity. // For more information, see Federation Through a Web-based Identity Provider -// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity). +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_assumerolewithwebidentity) +// in the IAM User Guide. // // You can also call GetFederationToken using the security credentials of an // AWS account root user, but we do not recommend it. Instead, we recommend @@ -952,41 +1084,67 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re // Practices (https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html) // in the IAM User Guide. // +// Session duration +// // The temporary credentials are valid for the specified duration, from 900 // seconds (15 minutes) up to a maximum of 129,600 seconds (36 hours). The default -// is 43,200 seconds (12 hours). Temporary credentials that are obtained by -// using AWS account root user credentials have a maximum duration of 3,600 -// seconds (1 hour). +// session duration is 43,200 seconds (12 hours). Temporary credentials that +// are obtained by using AWS account root user credentials have a maximum duration +// of 3,600 seconds (1 hour). // -// The temporary security credentials created by GetFederationToken can be used -// to make API calls to any AWS service with the following exceptions: +// Permissions // -// * You cannot use these credentials to call any IAM API operations. +// You can use the temporary credentials created by GetFederationToken in any +// AWS service except the following: // -// * You cannot call any STS API operations except GetCallerIdentity. +// * You cannot call any IAM operations using the AWS CLI or the AWS API. // -// Permissions +// * You cannot call any STS operations except GetCallerIdentity. // // You must pass an inline or managed session policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // to this operation. You can pass a single JSON policy document to use as an // inline session policy. You can also specify up to 10 managed policies to // use as managed session policies. The plain text that you use for both inline -// and managed session policies shouldn't exceed 2048 characters. +// and managed session policies can't exceed 2,048 characters. // // Though the session policy parameters are optional, if you do not pass a policy, -// then the resulting federated user session has no permissions. The only exception -// is when the credentials are used to access a resource that has a resource-based -// policy that specifically references the federated user session in the Principal -// element of the policy. When you pass session policies, the session permissions -// are the intersection of the IAM user policies and the session policies that -// you pass. This gives you a way to further restrict the permissions for a -// federated user. You cannot use session policies to grant more permissions -// than those that are defined in the permissions policy of the IAM user. For -// more information, see Session Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) +// then the resulting federated user session has no permissions. When you pass +// session policies, the session permissions are the intersection of the IAM +// user policies and the session policies that you pass. This gives you a way +// to further restrict the permissions for a federated user. You cannot use +// session policies to grant more permissions than those that are defined in +// the permissions policy of the IAM user. For more information, see Session +// Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. For information about using GetFederationToken to // create temporary security credentials, see GetFederationToken—Federation // Through a Custom Identity Broker (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#api_getfederationtoken). // +// You can use the credentials to access a resource that has a resource-based +// policy. If that policy specifically references the federated user session +// in the Principal element of the policy, the session has the permissions allowed +// by the policy. These permissions are granted in addition to the permissions +// granted by the session policies. +// +// Tags +// +// (Optional) You can pass tag key-value pairs to your session. These are called +// session tags. For more information about session tags, see Passing Session +// Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// An administrator must grant you the permissions necessary to pass session +// tags. The administrator can also create granular permissions to allow you +// to pass only specific session tags. For more information, see Tutorial: Using +// Tags for Attribute-Based Access Control (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_attribute-based-access-control.html) +// in the IAM User Guide. +// +// Tag key–value pairs are not case sensitive, but case is preserved. This +// means that you cannot have separate Department and department tag keys. Assume +// that the user that you are federating has the Department=Marketing tag and +// you pass the department=engineering session tag. Department and department +// are not saved as separate tags, and the session tag passed in the request +// takes precedence over the user tag. +// // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. @@ -1000,9 +1158,18 @@ func (c *STS) GetFederationTokenRequest(input *GetFederationTokenInput) (req *re // message describes the specific error. // // * ErrCodePackedPolicyTooLargeException "PackedPolicyTooLarge" -// The request was rejected because the policy document was too large. The error -// message describes how big the policy document is, in packed form, as a percentage -// of what the API allows. +// The request was rejected because the total packed size of the session policies +// and session tags combined was too large. An AWS conversion compresses the +// session policy document, session policy ARNs, and session tags into a packed +// binary format that has a separate limit. The error message indicates by percentage +// how close the policies and tags are to the upper size limit. For more information, +// see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +// +// You could receive this error even though you meet other defined session policy +// and session tag limits. For more information, see IAM and STS Entity Character +// Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) +// in the IAM User Guide. // // * ErrCodeRegionDisabledException "RegionDisabledException" // STS is not activated in the requested region for the account that is being @@ -1091,6 +1258,8 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request. // and Comparing the AWS STS API operations (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html#stsapi_comparison) // in the IAM User Guide. // +// Session Duration +// // The GetSessionToken operation must be called by using the long-term AWS security // credentials of the AWS account root user or an IAM user. Credentials that // are created by IAM users are valid for the duration that you specify. This @@ -1099,6 +1268,8 @@ func (c *STS) GetSessionTokenRequest(input *GetSessionTokenInput) (req *request. // based on account credentials can range from 900 seconds (15 minutes) up to // 3,600 seconds (1 hour), with a default of 1 hour. // +// Permissions +// // The temporary security credentials created by GetSessionToken can be used // to make API calls to any AWS service with the following exceptions: // @@ -1213,16 +1384,16 @@ type AssumeRoleInput struct { // in the IAM User Guide. // // The plain text that you use for both inline and managed session policies - // shouldn't exceed 2048 characters. The JSON policy characters can be any ASCII + // can't exceed 2,048 characters. The JSON policy characters can be any ASCII // character from the space character to the end of the valid character list // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), // and carriage return (\u000D) characters. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Policy *string `min:"1" type:"string"` // The Amazon Resource Names (ARNs) of the IAM managed policies that you want @@ -1231,15 +1402,15 @@ type AssumeRoleInput struct { // // This parameter is optional. You can provide up to 10 managed policy ARNs. // However, the plain text that you use for both inline and managed session - // policies shouldn't exceed 2048 characters. For more information about ARNs, + // policies can't exceed 2,048 characters. For more information about ARNs, // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. // // Passing policies to this operation returns new temporary credentials. The // resulting session's permissions are the intersection of the role's identity-based @@ -1284,6 +1455,41 @@ type AssumeRoleInput struct { // also include underscores or any of the following characters: =,.@- SerialNumber *string `min:"9" type:"string"` + // A list of session tags that you want to pass. Each session tag consists of + // a key name and an associated value. For more information about session tags, + // see Tagging AWS STS Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + // in the IAM User Guide. + // + // This parameter is optional. You can pass up to 50 session tags. The plain + // text session tag keys can’t exceed 128 characters, and the values can’t + // exceed 256 characters. For these and additional limits, see IAM and STS Character + // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. + // + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. + // + // You can pass a session tag with the same key as a tag that is already attached + // to the role. When you do, session tags override a role tag with the same + // key. + // + // Tag key–value pairs are not case sensitive, but case is preserved. This + // means that you cannot have separate Department and department tag keys. Assume + // that the role has the Department=Marketing tag and you pass the department=engineering + // session tag. Department and department are not saved as separate tags, and + // the session tag passed in the request takes precedence over the role tag. + // + // Additionally, if you used temporary credentials to perform this operation, + // the new session inherits any transitive session tags from the calling session. + // If you pass a session tag with the same key as an inherited tag, the operation + // fails. To view the inherited tags for a session, see the AWS CloudTrail logs. + // For more information, see Viewing Session Tags in CloudTrail (https://docs.aws.amazon.com/IAM/latest/UserGuide/session-tags.html#id_session-tags_ctlogs) + // in the IAM User Guide. + Tags []*Tag `type:"list"` + // The value provided by the MFA device, if the trust policy of the role being // assumed requires MFA (that is, if the policy includes a condition that tests // for MFA). If the role being assumed requires MFA and if the TokenCode value @@ -1292,6 +1498,19 @@ type AssumeRoleInput struct { // The format for this parameter, as described by its regex pattern, is a sequence // of six numeric digits. TokenCode *string `min:"6" type:"string"` + + // A list of keys for session tags that you want to set as transitive. If you + // set a tag key as transitive, the corresponding key and value passes to subsequent + // sessions in a role chain. For more information, see Chaining Roles with Session + // Tags (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html#id_session-tags_role-chaining) + // in the IAM User Guide. + // + // This parameter is optional. When you set session tags as transitive, the + // session policy and session tags packed binary limit is not affected. + // + // If you choose not to specify a transitive tag key, then no tags are passed + // from this session to any subsequent sessions. + TransitiveTagKeys []*string `type:"list"` } // String returns the string representation @@ -1344,6 +1563,16 @@ func (s *AssumeRoleInput) Validate() error { } } } + 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 @@ -1393,12 +1622,24 @@ func (s *AssumeRoleInput) SetSerialNumber(v string) *AssumeRoleInput { return s } +// SetTags sets the Tags field's value. +func (s *AssumeRoleInput) SetTags(v []*Tag) *AssumeRoleInput { + s.Tags = v + return s +} + // SetTokenCode sets the TokenCode field's value. func (s *AssumeRoleInput) SetTokenCode(v string) *AssumeRoleInput { s.TokenCode = &v return s } +// SetTransitiveTagKeys sets the TransitiveTagKeys field's value. +func (s *AssumeRoleInput) SetTransitiveTagKeys(v []*string) *AssumeRoleInput { + s.TransitiveTagKeys = v + return s +} + // Contains the response to a successful AssumeRole request, including temporary // AWS credentials that can be used to make AWS requests. type AssumeRoleOutput struct { @@ -1418,9 +1659,10 @@ type AssumeRoleOutput struct { // We strongly recommend that you make no assumptions about the maximum size. Credentials *Credentials `type:"structure"` - // A percentage value that indicates the size of the policy in packed form. - // The service rejects any policy with a packed size greater than 100 percent, - // which means the policy exceeded the allowed space. + // A percentage value that indicates the packed size of the session policies + // and session tags combined passed in the request. The request fails if the + // packed size is greater than 100 percent, which means the policies and tags + // exceeded the allowed space. PackedPolicySize *int64 `type:"integer"` } @@ -1491,16 +1733,16 @@ type AssumeRoleWithSAMLInput struct { // in the IAM User Guide. // // The plain text that you use for both inline and managed session policies - // shouldn't exceed 2048 characters. The JSON policy characters can be any ASCII + // can't exceed 2,048 characters. The JSON policy characters can be any ASCII // character from the space character to the end of the valid character list // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), // and carriage return (\u000D) characters. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Policy *string `min:"1" type:"string"` // The Amazon Resource Names (ARNs) of the IAM managed policies that you want @@ -1509,15 +1751,15 @@ type AssumeRoleWithSAMLInput struct { // // This parameter is optional. You can provide up to 10 managed policy ARNs. // However, the plain text that you use for both inline and managed session - // policies shouldn't exceed 2048 characters. For more information about ARNs, + // policies can't exceed 2,048 characters. For more information about ARNs, // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. // // Passing policies to this operation returns new temporary credentials. The // resulting session's permissions are the intersection of the role's identity-based @@ -1673,9 +1915,10 @@ type AssumeRoleWithSAMLOutput struct { // ) ) NameQualifier *string `type:"string"` - // A percentage value that indicates the size of the policy in packed form. - // The service rejects any policy with a packed size greater than 100 percent, - // which means the policy exceeded the allowed space. + // A percentage value that indicates the packed size of the session policies + // and session tags combined passed in the request. The request fails if the + // packed size is greater than 100 percent, which means the policies and tags + // exceeded the allowed space. PackedPolicySize *int64 `type:"integer"` // The value of the NameID element in the Subject element of the SAML assertion. @@ -1786,16 +2029,16 @@ type AssumeRoleWithWebIdentityInput struct { // in the IAM User Guide. // // The plain text that you use for both inline and managed session policies - // shouldn't exceed 2048 characters. The JSON policy characters can be any ASCII + // can't exceed 2,048 characters. The JSON policy characters can be any ASCII // character from the space character to the end of the valid character list // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), // and carriage return (\u000D) characters. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Policy *string `min:"1" type:"string"` // The Amazon Resource Names (ARNs) of the IAM managed policies that you want @@ -1804,15 +2047,15 @@ type AssumeRoleWithWebIdentityInput struct { // // This parameter is optional. You can provide up to 10 managed policy ARNs. // However, the plain text that you use for both inline and managed session - // policies shouldn't exceed 2048 characters. For more information about ARNs, + // policies can't exceed 2,048 characters. For more information about ARNs, // see Amazon Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. // // Passing policies to this operation returns new temporary credentials. The // resulting session's permissions are the intersection of the role's identity-based @@ -1983,9 +2226,10 @@ type AssumeRoleWithWebIdentityOutput struct { // We strongly recommend that you make no assumptions about the maximum size. Credentials *Credentials `type:"structure"` - // A percentage value that indicates the size of the policy in packed form. - // The service rejects any policy with a packed size greater than 100 percent, - // which means the policy exceeded the allowed space. + // A percentage value that indicates the packed size of the session policies + // and session tags combined passed in the request. The request fails if the + // packed size is greater than 100 percent, which means the policies and tags + // exceeded the allowed space. PackedPolicySize *int64 `type:"integer"` // The issuing authority of the web identity token presented. For OpenID Connect @@ -2057,7 +2301,7 @@ type AssumedRoleUser struct { // The ARN of the temporary security credentials that are returned from the // AssumeRole action. For more information about ARNs and how to use them in // policies, see IAM Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) - // in Using IAM. + // in the IAM User Guide. // // Arn is a required field Arn *string `min:"20" type:"string" required:"true"` @@ -2225,7 +2469,7 @@ type FederatedUser struct { // The ARN that specifies the federated user that is associated with the credentials. // For more information about ARNs and how to use them in policies, see IAM // Identifiers (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html) - // in Using IAM. + // in the IAM User Guide. // // Arn is a required field Arn *string `min:"20" type:"string" required:"true"` @@ -2265,7 +2509,7 @@ type GetAccessKeyInfoInput struct { // The identifier of an access key. // // This parameter allows (through its regex pattern) a string of characters - // that can consist of any upper- or lowercased letter or digit. + // that can consist of any upper- or lowercase letter or digit. // // AccessKeyId is a required field AccessKeyId *string `min:"16" type:"string" required:"true"` @@ -2418,10 +2662,7 @@ type GetFederationTokenInput struct { // use as managed session policies. // // This parameter is optional. However, if you do not pass any session policies, - // then the resulting federated user session has no permissions. The only exception - // is when the credentials are used to access a resource that has a resource-based - // policy that specifically references the federated user session in the Principal - // element of the policy. + // then the resulting federated user session has no permissions. // // When you pass session policies, the session permissions are the intersection // of the IAM user policies and the session policies that you pass. This gives @@ -2431,17 +2672,23 @@ type GetFederationTokenInput struct { // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. // + // The resulting credentials can be used to access a resource that has a resource-based + // policy. If that policy specifically references the federated user session + // in the Principal element of the policy, the session has the permissions allowed + // by the policy. These permissions are granted in addition to the permissions + // that are granted by the session policies. + // // The plain text that you use for both inline and managed session policies - // shouldn't exceed 2048 characters. The JSON policy characters can be any ASCII + // can't exceed 2,048 characters. The JSON policy characters can be any ASCII // character from the space character to the end of the valid character list // (\u0020 through \u00FF). It can also include the tab (\u0009), linefeed (\u000A), // and carriage return (\u000D) characters. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. Policy *string `min:"1" type:"string"` // The Amazon Resource Names (ARNs) of the IAM managed policies that you want @@ -2452,16 +2699,13 @@ type GetFederationTokenInput struct { // to this operation. You can pass a single JSON policy document to use as an // inline session policy. You can also specify up to 10 managed policies to // use as managed session policies. The plain text that you use for both inline - // and managed session policies shouldn't exceed 2048 characters. You can provide + // and managed session policies can't exceed 2,048 characters. You can provide // up to 10 managed policy ARNs. For more information about ARNs, see Amazon // Resource Names (ARNs) and AWS Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) // in the AWS General Reference. // // This parameter is optional. However, if you do not pass any session policies, - // then the resulting federated user session has no permissions. The only exception - // is when the credentials are used to access a resource that has a resource-based - // policy that specifically references the federated user session in the Principal - // element of the policy. + // then the resulting federated user session has no permissions. // // When you pass session policies, the session permissions are the intersection // of the IAM user policies and the session policies that you pass. This gives @@ -2471,12 +2715,46 @@ type GetFederationTokenInput struct { // Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html#policies_session) // in the IAM User Guide. // - // The characters in this parameter count towards the 2048 character session - // policy guideline. However, an AWS conversion compresses the session policies - // into a packed binary format that has a separate limit. This is the enforced - // limit. The PackedPolicySize response element indicates by percentage how - // close the policy is to the upper size limit. + // The resulting credentials can be used to access a resource that has a resource-based + // policy. If that policy specifically references the federated user session + // in the Principal element of the policy, the session has the permissions allowed + // by the policy. These permissions are granted in addition to the permissions + // that are granted by the session policies. + // + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. PolicyArns []*PolicyDescriptorType `type:"list"` + + // A list of session tags. Each session tag consists of a key name and an associated + // value. For more information about session tags, see Passing Session Tags + // in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + // in the IAM User Guide. + // + // This parameter is optional. You can pass up to 50 session tags. The plain + // text session tag keys can’t exceed 128 characters and the values can’t + // exceed 256 characters. For these and additional limits, see IAM and STS Character + // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. + // + // An AWS conversion compresses the passed session policies and session tags + // into a packed binary format that has a separate limit. Your request can fail + // for this limit even if your plain text meets the other requirements. The + // PackedPolicySize response element indicates by percentage how close the policies + // and tags for your request are to the upper size limit. + // + // You can pass a session tag with the same key as a tag that is already attached + // to the user you are federating. When you do, session tags override a user + // tag with the same key. + // + // Tag key–value pairs are not case sensitive, but case is preserved. This + // means that you cannot have separate Department and department tag keys. Assume + // that the role has the Department=Marketing tag and you pass the department=engineering + // session tag. Department and department are not saved as separate tags, and + // the session tag passed in the request takes precedence over the role tag. + Tags []*Tag `type:"list"` } // String returns the string representation @@ -2514,6 +2792,16 @@ func (s *GetFederationTokenInput) Validate() error { } } } + 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 @@ -2545,6 +2833,12 @@ func (s *GetFederationTokenInput) SetPolicyArns(v []*PolicyDescriptorType) *GetF return s } +// SetTags sets the Tags field's value. +func (s *GetFederationTokenInput) SetTags(v []*Tag) *GetFederationTokenInput { + s.Tags = v + return s +} + // Contains the response to a successful GetFederationToken request, including // temporary AWS credentials that can be used to make AWS requests. type GetFederationTokenOutput struct { @@ -2563,9 +2857,10 @@ type GetFederationTokenOutput struct { // an Amazon S3 bucket policy. FederatedUser *FederatedUser `type:"structure"` - // A percentage value indicating the size of the policy in packed form. The - // service rejects policies for which the packed size is greater than 100 percent - // of the allowed value. + // A percentage value that indicates the packed size of the session policies + // and session tags combined passed in the request. The request fails if the + // packed size is greater than 100 percent, which means the policies and tags + // exceeded the allowed space. PackedPolicySize *int64 `type:"integer"` } @@ -2748,3 +3043,73 @@ func (s *PolicyDescriptorType) SetArn(v string) *PolicyDescriptorType { s.Arn = &v return s } + +// You can pass custom key-value pair attributes when you assume a role or federate +// a user. These are called session tags. You can then use the session tags +// to control access to resources. For more information, see Tagging AWS STS +// Sessions (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) +// in the IAM User Guide. +type Tag struct { + _ struct{} `type:"structure"` + + // The key for a session tag. + // + // You can pass up to 50 session tags. The plain text session tag keys can’t + // exceed 128 characters. For these and additional limits, see IAM and STS Character + // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // The value for a session tag. + // + // You can pass up to 50 session tags. The plain text session tag values can’t + // exceed 256 characters. For these and additional limits, see IAM and STS Character + // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_iam-limits.html#reference_iam-limits-entity-length) + // in the IAM User Guide. + // + // Value is a required field + Value *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s Tag) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Tag) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Tag) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Tag"} + if s.Key == nil { + invalidParams.Add(request.NewErrParamRequired("Key")) + } + if s.Key != nil && len(*s.Key) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Key", 1)) + } + if s.Value == nil { + invalidParams.Add(request.NewErrParamRequired("Value")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetKey sets the Key field's value. +func (s *Tag) SetKey(v string) *Tag { + s.Key = &v + return s +} + +// SetValue sets the Value field's value. +func (s *Tag) SetValue(v string) *Tag { + s.Value = &v + return s +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go b/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go index 41ea09c356c..a233f542ef2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/errors.go @@ -14,11 +14,11 @@ const ( // ErrCodeIDPCommunicationErrorException for service response error code // "IDPCommunicationError". // - // The request could not be fulfilled because the non-AWS identity provider - // (IDP) that was asked to verify the incoming identity token could not be reached. - // This is often a transient error caused by network conditions. Retry the request + // The request could not be fulfilled because the identity provider (IDP) that + // was asked to verify the incoming identity token could not be reached. This + // is often a transient error caused by network conditions. Retry the request // a limited number of times so that you don't exceed the request rate. If the - // error persists, the non-AWS identity provider might be down or not responding. + // error persists, the identity provider might be down or not responding. ErrCodeIDPCommunicationErrorException = "IDPCommunicationError" // ErrCodeIDPRejectedClaimException for service response error code @@ -56,9 +56,18 @@ const ( // ErrCodePackedPolicyTooLargeException for service response error code // "PackedPolicyTooLarge". // - // The request was rejected because the policy document was too large. The error - // message describes how big the policy document is, in packed form, as a percentage - // of what the API allows. + // The request was rejected because the total packed size of the session policies + // and session tags combined was too large. An AWS conversion compresses the + // session policy document, session policy ARNs, and session tags into a packed + // binary format that has a separate limit. The error message indicates by percentage + // how close the policies and tags are to the upper size limit. For more information, + // see Passing Session Tags in STS (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_session-tags.html) + // in the IAM User Guide. + // + // You could receive this error even though you meet other defined session policy + // and session tag limits. For more information, see IAM and STS Entity Character + // Limits (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_enable-regions.html) + // in the IAM User Guide. ErrCodePackedPolicyTooLargeException = "PackedPolicyTooLarge" // ErrCodeRegionDisabledException for service response error code 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 185c914d1b3..d34a6855331 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/sts/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/sts/service.go @@ -31,7 +31,7 @@ var initRequest func(*request.Request) const ( ServiceName = "sts" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "STS" // ServiceID is a unique identifer of a specific service. + ServiceID = "STS" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the STS client with a session. @@ -39,6 +39,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a STS client from just a session. // svc := sts.New(mySession) // @@ -46,11 +48,11 @@ const ( // svc := sts.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *STS { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *STS { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *STS { svc := &STS{ Client: client.New( cfg, @@ -59,6 +61,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2011-06-15", }, diff --git a/vendor/github.com/aws/aws-sdk-go/service/swf/api.go b/vendor/github.com/aws/aws-sdk-go/service/swf/api.go index 74bea04bc45..b2e19132d7f 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/swf/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/swf/api.go @@ -90,13 +90,13 @@ func (c *SWF) CountClosedWorkflowExecutionsRequest(input *CountClosedWorkflowExe // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation CountClosedWorkflowExecutions for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -198,13 +198,13 @@ func (c *SWF) CountOpenWorkflowExecutionsRequest(input *CountOpenWorkflowExecuti // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation CountOpenWorkflowExecutions for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -304,13 +304,13 @@ func (c *SWF) CountPendingActivityTasksRequest(input *CountPendingActivityTasksI // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation CountPendingActivityTasks for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -410,13 +410,13 @@ func (c *SWF) CountPendingDecisionTasksRequest(input *CountPendingDecisionTasksI // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation CountPendingDecisionTasks for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -520,16 +520,16 @@ func (c *SWF) DeprecateActivityTypeRequest(input *DeprecateActivityTypeInput) (r // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation DeprecateActivityType for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeTypeDeprecatedFault "TypeDeprecatedFault" +// * TypeDeprecatedFault // Returned when the specified activity or workflow type was already deprecated. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -633,16 +633,16 @@ func (c *SWF) DeprecateDomainRequest(input *DeprecateDomainInput) (req *request. // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation DeprecateDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeDomainDeprecatedFault "DomainDeprecatedFault" +// * DomainDeprecatedFault // Returned when the specified domain has been deprecated. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -747,16 +747,16 @@ func (c *SWF) DeprecateWorkflowTypeRequest(input *DeprecateWorkflowTypeInput) (r // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation DeprecateWorkflowType for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeTypeDeprecatedFault "TypeDeprecatedFault" +// * TypeDeprecatedFault // Returned when the specified activity or workflow type was already deprecated. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -856,13 +856,13 @@ func (c *SWF) DescribeActivityTypeRequest(input *DescribeActivityTypeInput) (req // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation DescribeActivityType for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -958,13 +958,13 @@ func (c *SWF) DescribeDomainRequest(input *DescribeDomainInput) (req *request.Re // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation DescribeDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -1063,13 +1063,13 @@ func (c *SWF) DescribeWorkflowExecutionRequest(input *DescribeWorkflowExecutionI // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation DescribeWorkflowExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -1169,13 +1169,13 @@ func (c *SWF) DescribeWorkflowTypeRequest(input *DescribeWorkflowTypeInput) (req // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation DescribeWorkflowType for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -1281,13 +1281,13 @@ func (c *SWF) GetWorkflowExecutionHistoryRequest(input *GetWorkflowExecutionHist // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation GetWorkflowExecutionHistory for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -1355,10 +1355,12 @@ func (c *SWF) GetWorkflowExecutionHistoryPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetWorkflowExecutionHistoryOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetWorkflowExecutionHistoryOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1442,12 +1444,12 @@ func (c *SWF) ListActivityTypesRequest(input *ListActivityTypesInput) (req *requ // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation ListActivityTypes for usage and error information. // -// Returned Error Codes: -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// Returned Error Types: +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. @@ -1516,10 +1518,12 @@ func (c *SWF) ListActivityTypesPagesWithContext(ctx aws.Context, input *ListActi }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListActivityTypesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListActivityTypesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1608,13 +1612,13 @@ func (c *SWF) ListClosedWorkflowExecutionsRequest(input *ListClosedWorkflowExecu // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation ListClosedWorkflowExecutions for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -1682,10 +1686,12 @@ func (c *SWF) ListClosedWorkflowExecutionsPagesWithContext(ctx aws.Context, inpu }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*WorkflowExecutionInfos), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*WorkflowExecutionInfos), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1771,8 +1777,8 @@ func (c *SWF) ListDomainsRequest(input *ListDomainsInput) (req *request.Request, // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation ListDomains for usage and error information. // -// Returned Error Codes: -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// Returned Error Types: +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -1840,10 +1846,12 @@ func (c *SWF) ListDomainsPagesWithContext(ctx aws.Context, input *ListDomainsInp }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDomainsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDomainsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1932,13 +1940,13 @@ func (c *SWF) ListOpenWorkflowExecutionsRequest(input *ListOpenWorkflowExecution // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation ListOpenWorkflowExecutions for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -2006,10 +2014,12 @@ func (c *SWF) ListOpenWorkflowExecutionsPagesWithContext(ctx aws.Context, input }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*WorkflowExecutionInfos), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*WorkflowExecutionInfos), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2064,18 +2074,18 @@ func (c *SWF) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req * // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeLimitExceededFault "LimitExceededFault" +// * LimitExceededFault // Returned by any operation if a system imposed limitation has been reached. // To address this fault you should either clean up unused resources or increase // the limit by contacting AWS. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -2178,12 +2188,12 @@ func (c *SWF) ListWorkflowTypesRequest(input *ListWorkflowTypesInput) (req *requ // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation ListWorkflowTypes for usage and error information. // -// Returned Error Codes: -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// Returned Error Types: +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. @@ -2252,10 +2262,12 @@ func (c *SWF) ListWorkflowTypesPagesWithContext(ctx aws.Context, input *ListWork }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListWorkflowTypesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListWorkflowTypesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2341,17 +2353,17 @@ func (c *SWF) PollForActivityTaskRequest(input *PollForActivityTaskInput) (req * // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation PollForActivityTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // -// * ErrCodeLimitExceededFault "LimitExceededFault" +// * LimitExceededFault // Returned by any operation if a system imposed limitation has been reached. // To address this fault you should either clean up unused resources or increase // the limit by contacting AWS. @@ -2475,17 +2487,17 @@ func (c *SWF) PollForDecisionTaskRequest(input *PollForDecisionTaskInput) (req * // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation PollForDecisionTask for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // -// * ErrCodeLimitExceededFault "LimitExceededFault" +// * LimitExceededFault // Returned by any operation if a system imposed limitation has been reached. // To address this fault you should either clean up unused resources or increase // the limit by contacting AWS. @@ -2554,10 +2566,12 @@ func (c *SWF) PollForDecisionTaskPagesWithContext(ctx aws.Context, input *PollFo }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*PollForDecisionTaskOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*PollForDecisionTaskOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2656,13 +2670,13 @@ func (c *SWF) RecordActivityTaskHeartbeatRequest(input *RecordActivityTaskHeartb // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation RecordActivityTaskHeartbeat for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -2766,23 +2780,23 @@ func (c *SWF) RegisterActivityTypeRequest(input *RegisterActivityTypeInput) (req // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation RegisterActivityType for usage and error information. // -// Returned Error Codes: -// * ErrCodeTypeAlreadyExistsFault "TypeAlreadyExistsFault" +// Returned Error Types: +// * TypeAlreadyExistsFault // Returned if the type already exists in the specified domain. You may get // this fault if you are registering a type that is either already registered // or deprecated, or if you undeprecate a type that is currently registered. // -// * ErrCodeLimitExceededFault "LimitExceededFault" +// * LimitExceededFault // Returned by any operation if a system imposed limitation has been reached. // To address this fault you should either clean up unused resources or increase // the limit by contacting AWS. // -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -2879,22 +2893,22 @@ func (c *SWF) RegisterDomainRequest(input *RegisterDomainInput) (req *request.Re // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation RegisterDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeDomainAlreadyExistsFault "DomainAlreadyExistsFault" +// Returned Error Types: +// * DomainAlreadyExistsFault // Returned if the domain already exists. You may get this fault if you are // registering a domain that is either already registered or deprecated, or // if you undeprecate a domain that is currently registered. // -// * ErrCodeLimitExceededFault "LimitExceededFault" +// * LimitExceededFault // Returned by any operation if a system imposed limitation has been reached. // To address this fault you should either clean up unused resources or increase // the limit by contacting AWS. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // -// * ErrCodeTooManyTagsFault "TooManyTagsFault" +// * TooManyTagsFault // You've exceeded the number of tags allowed for a domain. // func (c *SWF) RegisterDomain(input *RegisterDomainInput) (*RegisterDomainOutput, error) { @@ -3000,23 +3014,23 @@ func (c *SWF) RegisterWorkflowTypeRequest(input *RegisterWorkflowTypeInput) (req // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation RegisterWorkflowType for usage and error information. // -// Returned Error Codes: -// * ErrCodeTypeAlreadyExistsFault "TypeAlreadyExistsFault" +// Returned Error Types: +// * TypeAlreadyExistsFault // Returned if the type already exists in the specified domain. You may get // this fault if you are registering a type that is either already registered // or deprecated, or if you undeprecate a type that is currently registered. // -// * ErrCodeLimitExceededFault "LimitExceededFault" +// * LimitExceededFault // Returned by any operation if a system imposed limitation has been reached. // To address this fault you should either clean up unused resources or increase // the limit by contacting AWS. // -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -3123,13 +3137,13 @@ func (c *SWF) RequestCancelWorkflowExecutionRequest(input *RequestCancelWorkflow // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation RequestCancelWorkflowExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -3239,13 +3253,13 @@ func (c *SWF) RespondActivityTaskCanceledRequest(input *RespondActivityTaskCance // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation RespondActivityTaskCanceled for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -3354,13 +3368,13 @@ func (c *SWF) RespondActivityTaskCompletedRequest(input *RespondActivityTaskComp // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation RespondActivityTaskCompleted for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -3464,13 +3478,13 @@ func (c *SWF) RespondActivityTaskFailedRequest(input *RespondActivityTaskFailedI // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation RespondActivityTaskFailed for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -3563,13 +3577,13 @@ func (c *SWF) RespondDecisionTaskCompletedRequest(input *RespondDecisionTaskComp // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation RespondDecisionTaskCompleted for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -3674,13 +3688,13 @@ func (c *SWF) SignalWorkflowExecutionRequest(input *SignalWorkflowExecutionInput // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation SignalWorkflowExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -3785,29 +3799,29 @@ func (c *SWF) StartWorkflowExecutionRequest(input *StartWorkflowExecutionInput) // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation StartWorkflowExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeTypeDeprecatedFault "TypeDeprecatedFault" +// * TypeDeprecatedFault // Returned when the specified activity or workflow type was already deprecated. // -// * ErrCodeWorkflowExecutionAlreadyStartedFault "WorkflowExecutionAlreadyStartedFault" +// * WorkflowExecutionAlreadyStartedFault // Returned by StartWorkflowExecution when an open execution with the same workflowId // is already running in the specified domain. // -// * ErrCodeLimitExceededFault "LimitExceededFault" +// * LimitExceededFault // Returned by any operation if a system imposed limitation has been reached. // To address this fault you should either clean up unused resources or increase // the limit by contacting AWS. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // -// * ErrCodeDefaultUndefinedFault "DefaultUndefinedFault" +// * DefaultUndefinedFault // The StartWorkflowExecution API action was called without the required parameters // set. // @@ -3895,21 +3909,21 @@ func (c *SWF) TagResourceRequest(input *TagResourceInput) (req *request.Request, // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeTooManyTagsFault "TooManyTagsFault" +// * TooManyTagsFault // You've exceeded the number of tags allowed for a domain. // -// * ErrCodeLimitExceededFault "LimitExceededFault" +// * LimitExceededFault // Returned by any operation if a system imposed limitation has been reached. // To address this fault you should either clean up unused resources or increase // the limit by contacting AWS. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -4019,13 +4033,13 @@ func (c *SWF) TerminateWorkflowExecutionRequest(input *TerminateWorkflowExecutio // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation TerminateWorkflowExecution for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -4128,18 +4142,18 @@ func (c *SWF) UndeprecateActivityTypeRequest(input *UndeprecateActivityTypeInput // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation UndeprecateActivityType for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeTypeAlreadyExistsFault "TypeAlreadyExistsFault" +// * TypeAlreadyExistsFault // Returned if the type already exists in the specified domain. You may get // this fault if you are registering a type that is either already registered // or deprecated, or if you undeprecate a type that is currently registered. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -4239,18 +4253,18 @@ func (c *SWF) UndeprecateDomainRequest(input *UndeprecateDomainInput) (req *requ // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation UndeprecateDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeDomainAlreadyExistsFault "DomainAlreadyExistsFault" +// * DomainAlreadyExistsFault // Returned if the domain already exists. You may get this fault if you are // registering a domain that is either already registered or deprecated, or // if you undeprecate a domain that is currently registered. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -4353,18 +4367,18 @@ func (c *SWF) UndeprecateWorkflowTypeRequest(input *UndeprecateWorkflowTypeInput // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation UndeprecateWorkflowType for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeTypeAlreadyExistsFault "TypeAlreadyExistsFault" +// * TypeAlreadyExistsFault // Returned if the type already exists in the specified domain. You may get // this fault if you are registering a type that is either already registered // or deprecated, or if you undeprecate a type that is currently registered. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -4441,18 +4455,18 @@ func (c *SWF) UntagResourceRequest(input *UntagResourceInput) (req *request.Requ // See the AWS API reference guide for Amazon Simple Workflow Service's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnknownResourceFault "UnknownResourceFault" +// Returned Error Types: +// * UnknownResourceFault // Returned when the named resource cannot be found with in the scope of this // operation (region or domain). This could happen if the named resource was // never created or is no longer available for this operation. // -// * ErrCodeLimitExceededFault "LimitExceededFault" +// * LimitExceededFault // Returned by any operation if a system imposed limitation has been reached. // To address this fault you should either clean up unused resources or increase // the limit by contacting AWS. // -// * ErrCodeOperationNotPermittedFault "OperationNotPermittedFault" +// * OperationNotPermittedFault // Returned when the caller doesn't have sufficient permissions to invoke the // action. // @@ -7117,6 +7131,72 @@ func (s *DecisionTaskTimedOutEventAttributes) SetTimeoutType(v string) *Decision return s } +// The StartWorkflowExecution API action was called without the required parameters +// set. +// +// Some workflow execution parameters, such as the decision taskList, must be +// set to start the execution. However, these parameters might have been set +// as defaults when the workflow type was registered. In this case, you can +// omit these parameters from the StartWorkflowExecution call and Amazon SWF +// uses the values defined in the workflow type. +// +// If these parameters aren't set and no default parameters were defined in +// the workflow type, this error is displayed. +type DefaultUndefinedFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DefaultUndefinedFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DefaultUndefinedFault) GoString() string { + return s.String() +} + +func newErrorDefaultUndefinedFault(v protocol.ResponseMetadata) error { + return &DefaultUndefinedFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DefaultUndefinedFault) Code() string { + return "DefaultUndefinedFault" +} + +// Message returns the exception's message. +func (s DefaultUndefinedFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DefaultUndefinedFault) OrigErr() error { + return nil +} + +func (s DefaultUndefinedFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DefaultUndefinedFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DefaultUndefinedFault) RequestID() string { + return s.respMetadata.RequestID +} + type DeprecateActivityTypeInput struct { _ struct{} `type:"structure"` @@ -7746,6 +7826,65 @@ func (s *DescribeWorkflowTypeOutput) SetTypeInfo(v *WorkflowTypeInfo) *DescribeW return s } +// Returned if the domain already exists. You may get this fault if you are +// registering a domain that is either already registered or deprecated, or +// if you undeprecate a domain that is currently registered. +type DomainAlreadyExistsFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A description that may help with diagnosing the cause of the fault. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DomainAlreadyExistsFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DomainAlreadyExistsFault) GoString() string { + return s.String() +} + +func newErrorDomainAlreadyExistsFault(v protocol.ResponseMetadata) error { + return &DomainAlreadyExistsFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DomainAlreadyExistsFault) Code() string { + return "DomainAlreadyExistsFault" +} + +// Message returns the exception's message. +func (s DomainAlreadyExistsFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DomainAlreadyExistsFault) OrigErr() error { + return nil +} + +func (s DomainAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DomainAlreadyExistsFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DomainAlreadyExistsFault) RequestID() string { + return s.respMetadata.RequestID +} + // Contains the configuration settings of a domain. type DomainConfiguration struct { _ struct{} `type:"structure"` @@ -7772,6 +7911,63 @@ func (s *DomainConfiguration) SetWorkflowExecutionRetentionPeriodInDays(v string return s } +// Returned when the specified domain has been deprecated. +type DomainDeprecatedFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A description that may help with diagnosing the cause of the fault. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DomainDeprecatedFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DomainDeprecatedFault) GoString() string { + return s.String() +} + +func newErrorDomainDeprecatedFault(v protocol.ResponseMetadata) error { + return &DomainDeprecatedFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DomainDeprecatedFault) Code() string { + return "DomainDeprecatedFault" +} + +// Message returns the exception's message. +func (s DomainDeprecatedFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DomainDeprecatedFault) OrigErr() error { + return nil +} + +func (s DomainDeprecatedFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DomainDeprecatedFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DomainDeprecatedFault) RequestID() string { + return s.respMetadata.RequestID +} + // Contains general information about a domain. type DomainInfo struct { _ struct{} `type:"structure"` @@ -9238,6 +9434,65 @@ func (s *LambdaFunctionTimedOutEventAttributes) SetTimeoutType(v string) *Lambda return s } +// Returned by any operation if a system imposed limitation has been reached. +// To address this fault you should either clean up unused resources or increase +// the limit by contacting AWS. +type LimitExceededFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A description that may help with diagnosing the cause of the fault. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededFault) GoString() string { + return s.String() +} + +func newErrorLimitExceededFault(v protocol.ResponseMetadata) error { + return &LimitExceededFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededFault) Code() string { + return "LimitExceededFault" +} + +// Message returns the exception's message. +func (s LimitExceededFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededFault) OrigErr() error { + return nil +} + +func (s LimitExceededFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededFault) RequestID() string { + return s.respMetadata.RequestID +} + type ListActivityTypesInput struct { _ struct{} `type:"structure"` @@ -10094,6 +10349,64 @@ func (s *MarkerRecordedEventAttributes) SetMarkerName(v string) *MarkerRecordedE return s } +// Returned when the caller doesn't have sufficient permissions to invoke the +// action. +type OperationNotPermittedFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A description that may help with diagnosing the cause of the fault. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s OperationNotPermittedFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OperationNotPermittedFault) GoString() string { + return s.String() +} + +func newErrorOperationNotPermittedFault(v protocol.ResponseMetadata) error { + return &OperationNotPermittedFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OperationNotPermittedFault) Code() string { + return "OperationNotPermittedFault" +} + +// Message returns the exception's message. +func (s OperationNotPermittedFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OperationNotPermittedFault) OrigErr() error { + return nil +} + +func (s OperationNotPermittedFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OperationNotPermittedFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OperationNotPermittedFault) RequestID() string { + return s.respMetadata.RequestID +} + // Contains the count of tasks in a task list. type PendingTaskCount struct { _ struct{} `type:"structure"` @@ -14288,6 +14601,178 @@ func (s *TimerStartedEventAttributes) SetTimerId(v string) *TimerStartedEventAtt return s } +// You've exceeded the number of tags allowed for a domain. +type TooManyTagsFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TooManyTagsFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyTagsFault) GoString() string { + return s.String() +} + +func newErrorTooManyTagsFault(v protocol.ResponseMetadata) error { + return &TooManyTagsFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyTagsFault) Code() string { + return "TooManyTagsFault" +} + +// Message returns the exception's message. +func (s TooManyTagsFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTagsFault) OrigErr() error { + return nil +} + +func (s TooManyTagsFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTagsFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyTagsFault) RequestID() string { + return s.respMetadata.RequestID +} + +// Returned if the type already exists in the specified domain. You may get +// this fault if you are registering a type that is either already registered +// or deprecated, or if you undeprecate a type that is currently registered. +type TypeAlreadyExistsFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A description that may help with diagnosing the cause of the fault. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TypeAlreadyExistsFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TypeAlreadyExistsFault) GoString() string { + return s.String() +} + +func newErrorTypeAlreadyExistsFault(v protocol.ResponseMetadata) error { + return &TypeAlreadyExistsFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TypeAlreadyExistsFault) Code() string { + return "TypeAlreadyExistsFault" +} + +// Message returns the exception's message. +func (s TypeAlreadyExistsFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TypeAlreadyExistsFault) OrigErr() error { + return nil +} + +func (s TypeAlreadyExistsFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TypeAlreadyExistsFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TypeAlreadyExistsFault) RequestID() string { + return s.respMetadata.RequestID +} + +// Returned when the specified activity or workflow type was already deprecated. +type TypeDeprecatedFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A description that may help with diagnosing the cause of the fault. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TypeDeprecatedFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TypeDeprecatedFault) GoString() string { + return s.String() +} + +func newErrorTypeDeprecatedFault(v protocol.ResponseMetadata) error { + return &TypeDeprecatedFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TypeDeprecatedFault) Code() string { + return "TypeDeprecatedFault" +} + +// Message returns the exception's message. +func (s TypeDeprecatedFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TypeDeprecatedFault) OrigErr() error { + return nil +} + +func (s TypeDeprecatedFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TypeDeprecatedFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TypeDeprecatedFault) RequestID() string { + return s.respMetadata.RequestID +} + type UndeprecateActivityTypeInput struct { _ struct{} `type:"structure"` @@ -14491,6 +14976,65 @@ func (s UndeprecateWorkflowTypeOutput) GoString() string { return s.String() } +// Returned when the named resource cannot be found with in the scope of this +// operation (region or domain). This could happen if the named resource was +// never created or is no longer available for this operation. +type UnknownResourceFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A description that may help with diagnosing the cause of the fault. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnknownResourceFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnknownResourceFault) GoString() string { + return s.String() +} + +func newErrorUnknownResourceFault(v protocol.ResponseMetadata) error { + return &UnknownResourceFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnknownResourceFault) Code() string { + return "UnknownResourceFault" +} + +// Message returns the exception's message. +func (s UnknownResourceFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnknownResourceFault) OrigErr() error { + return nil +} + +func (s UnknownResourceFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnknownResourceFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnknownResourceFault) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -14619,6 +15163,64 @@ func (s *WorkflowExecution) SetWorkflowId(v string) *WorkflowExecution { return s } +// Returned by StartWorkflowExecution when an open execution with the same workflowId +// is already running in the specified domain. +type WorkflowExecutionAlreadyStartedFault struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // A description that may help with diagnosing the cause of the fault. + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WorkflowExecutionAlreadyStartedFault) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WorkflowExecutionAlreadyStartedFault) GoString() string { + return s.String() +} + +func newErrorWorkflowExecutionAlreadyStartedFault(v protocol.ResponseMetadata) error { + return &WorkflowExecutionAlreadyStartedFault{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WorkflowExecutionAlreadyStartedFault) Code() string { + return "WorkflowExecutionAlreadyStartedFault" +} + +// Message returns the exception's message. +func (s WorkflowExecutionAlreadyStartedFault) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WorkflowExecutionAlreadyStartedFault) OrigErr() error { + return nil +} + +func (s WorkflowExecutionAlreadyStartedFault) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WorkflowExecutionAlreadyStartedFault) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WorkflowExecutionAlreadyStartedFault) RequestID() string { + return s.respMetadata.RequestID +} + // Provides the details of the WorkflowExecutionCancelRequested event. type WorkflowExecutionCancelRequestedEventAttributes struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/swf/errors.go b/vendor/github.com/aws/aws-sdk-go/service/swf/errors.go index 95e3d26ef00..5f9f3a35351 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/swf/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/swf/errors.go @@ -2,6 +2,10 @@ package swf +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeDefaultUndefinedFault for service response error code @@ -84,3 +88,16 @@ const ( // is already running in the specified domain. ErrCodeWorkflowExecutionAlreadyStartedFault = "WorkflowExecutionAlreadyStartedFault" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "DefaultUndefinedFault": newErrorDefaultUndefinedFault, + "DomainAlreadyExistsFault": newErrorDomainAlreadyExistsFault, + "DomainDeprecatedFault": newErrorDomainDeprecatedFault, + "LimitExceededFault": newErrorLimitExceededFault, + "OperationNotPermittedFault": newErrorOperationNotPermittedFault, + "TooManyTagsFault": newErrorTooManyTagsFault, + "TypeAlreadyExistsFault": newErrorTypeAlreadyExistsFault, + "TypeDeprecatedFault": newErrorTypeDeprecatedFault, + "UnknownResourceFault": newErrorUnknownResourceFault, + "WorkflowExecutionAlreadyStartedFault": newErrorWorkflowExecutionAlreadyStartedFault, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/swf/service.go b/vendor/github.com/aws/aws-sdk-go/service/swf/service.go index 014d89a5241..a6ee9188d16 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/swf/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/swf/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "swf" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "SWF" // ServiceID is a unique identifer of a specific service. + ServiceID = "SWF" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the SWF client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a SWF client from just a session. // svc := swf.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := swf.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *SWF { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *SWF { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *SWF { svc := &SWF{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2012-01-25", JSONVersion: "1.0", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/transfer/api.go b/vendor/github.com/aws/aws-sdk-go/service/transfer/api.go index 575135be927..eba6b2235f5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/transfer/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/transfer/api.go @@ -69,18 +69,18 @@ func (c *Transfer) CreateServerRequest(input *CreateServerInput) (req *request.R // See the AWS API reference guide for AWS Transfer for SFTP's // API operation CreateServer for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeResourceExistsException "ResourceExistsException" +// * ResourceExistsException // The requested resource does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/CreateServer @@ -164,21 +164,21 @@ func (c *Transfer) CreateUserRequest(input *CreateUserInput) (req *request.Reque // See the AWS API reference guide for AWS Transfer for SFTP's // API operation CreateUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeResourceExistsException "ResourceExistsException" +// * ResourceExistsException // The requested resource does not exist. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when a resource is not found by the AWS Transfer // for SFTP service. // @@ -260,18 +260,18 @@ func (c *Transfer) DeleteServerRequest(input *DeleteServerInput) (req *request.R // See the AWS API reference guide for AWS Transfer for SFTP's // API operation DeleteServer for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when a resource is not found by the AWS Transfer // for SFTP service. // @@ -353,21 +353,26 @@ func (c *Transfer) DeleteSshPublicKeyRequest(input *DeleteSshPublicKeyInput) (re // See the AWS API reference guide for AWS Transfer for SFTP's // API operation DeleteSshPublicKey for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when a resource is not found by the AWS Transfer // for SFTP service. // +// * ThrottlingException +// The request was denied due to request throttling. +// +// HTTP Status Code: 400 +// // See also, https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/DeleteSshPublicKey func (c *Transfer) DeleteSshPublicKey(input *DeleteSshPublicKeyInput) (*DeleteSshPublicKeyOutput, error) { req, out := c.DeleteSshPublicKeyRequest(input) @@ -448,18 +453,18 @@ func (c *Transfer) DeleteUserRequest(input *DeleteUserInput) (req *request.Reque // See the AWS API reference guide for AWS Transfer for SFTP's // API operation DeleteUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when a resource is not found by the AWS Transfer // for SFTP service. // @@ -531,7 +536,8 @@ func (c *Transfer) DescribeServerRequest(input *DescribeServerInput) (req *reque // // Describes the server that you specify by passing the ServerId parameter. // -// The response contains a description of the server's properties. +// The response contains a description of the server's properties. When you +// set EndpointType to VPC, the response will contain the EndpointDetails. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -540,18 +546,18 @@ func (c *Transfer) DescribeServerRequest(input *DescribeServerInput) (req *reque // See the AWS API reference guide for AWS Transfer for SFTP's // API operation DescribeServer for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when a resource is not found by the AWS Transfer // for SFTP service. // @@ -634,18 +640,18 @@ func (c *Transfer) DescribeUserRequest(input *DescribeUserInput) (req *request.R // See the AWS API reference guide for AWS Transfer for SFTP's // API operation DescribeUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when a resource is not found by the AWS Transfer // for SFTP service. // @@ -728,24 +734,29 @@ func (c *Transfer) ImportSshPublicKeyRequest(input *ImportSshPublicKeyInput) (re // See the AWS API reference guide for AWS Transfer for SFTP's // API operation ImportSshPublicKey for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeResourceExistsException "ResourceExistsException" +// * ResourceExistsException // The requested resource does not exist. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when a resource is not found by the AWS Transfer // for SFTP service. // +// * ThrottlingException +// The request was denied due to request throttling. +// +// HTTP Status Code: 400 +// // See also, https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/ImportSshPublicKey func (c *Transfer) ImportSshPublicKey(input *ImportSshPublicKeyInput) (*ImportSshPublicKeyOutput, error) { req, out := c.ImportSshPublicKeyRequest(input) @@ -828,18 +839,18 @@ func (c *Transfer) ListServersRequest(input *ListServersInput) (req *request.Req // See the AWS API reference guide for AWS Transfer for SFTP's // API operation ListServers for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The NextToken parameter that was passed is invalid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/ListServers @@ -907,10 +918,12 @@ func (c *Transfer) ListServersPagesWithContext(ctx aws.Context, input *ListServe }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListServersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListServersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -974,18 +987,18 @@ func (c *Transfer) ListTagsForResourceRequest(input *ListTagsForResourceInput) ( // See the AWS API reference guide for AWS Transfer for SFTP's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The NextToken parameter that was passed is invalid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // // See also, https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/ListTagsForResource @@ -1053,10 +1066,12 @@ func (c *Transfer) ListTagsForResourcePagesWithContext(ctx aws.Context, input *L }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1119,21 +1134,21 @@ func (c *Transfer) ListUsersRequest(input *ListUsersInput) (req *request.Request // See the AWS API reference guide for AWS Transfer for SFTP's // API operation ListUsers for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidNextTokenException "InvalidNextTokenException" +// * InvalidNextTokenException // The NextToken parameter that was passed is invalid. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when a resource is not found by the AWS Transfer // for SFTP service. // @@ -1202,10 +1217,12 @@ func (c *Transfer) ListUsersPagesWithContext(ctx aws.Context, input *ListUsersIn }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListUsersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListUsersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1271,21 +1288,26 @@ func (c *Transfer) StartServerRequest(input *StartServerInput) (req *request.Req // See the AWS API reference guide for AWS Transfer for SFTP's // API operation StartServer for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when a resource is not found by the AWS Transfer // for SFTP service. // +// * ThrottlingException +// The request was denied due to request throttling. +// +// HTTP Status Code: 400 +// // See also, https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/StartServer func (c *Transfer) StartServer(input *StartServerInput) (*StartServerOutput, error) { req, out := c.StartServerRequest(input) @@ -1372,21 +1394,26 @@ func (c *Transfer) StopServerRequest(input *StopServerInput) (req *request.Reque // See the AWS API reference guide for AWS Transfer for SFTP's // API operation StopServer for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when a resource is not found by the AWS Transfer // for SFTP service. // +// * ThrottlingException +// The request was denied due to request throttling. +// +// HTTP Status Code: 400 +// // See also, https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/StopServer func (c *Transfer) StopServer(input *StopServerInput) (*StopServerOutput, error) { req, out := c.StopServerRequest(input) @@ -1466,17 +1493,21 @@ func (c *Transfer) TagResourceRequest(input *TagResourceInput) (req *request.Req // See the AWS API reference guide for AWS Transfer for SFTP's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // +// * ResourceNotFoundException +// This exception is thrown when a resource is not found by the AWS Transfer +// for SFTP service. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/TagResource func (c *Transfer) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { req, out := c.TagResourceRequest(input) @@ -1556,18 +1587,18 @@ func (c *Transfer) TestIdentityProviderRequest(input *TestIdentityProviderInput) // See the AWS API reference guide for AWS Transfer for SFTP's // API operation TestIdentityProvider for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when a resource is not found by the AWS Transfer // for SFTP service. // @@ -1650,17 +1681,21 @@ func (c *Transfer) UntagResourceRequest(input *UntagResourceInput) (req *request // See the AWS API reference guide for AWS Transfer for SFTP's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // +// * ResourceNotFoundException +// This exception is thrown when a resource is not found by the AWS Transfer +// for SFTP service. +// // See also, https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/UntagResource func (c *Transfer) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { req, out := c.UntagResourceRequest(input) @@ -1739,21 +1774,34 @@ func (c *Transfer) UpdateServerRequest(input *UpdateServerInput) (req *request.R // See the AWS API reference guide for AWS Transfer for SFTP's // API operation UpdateServer for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * ConflictException +// This exception is thrown when the UpdatServer is called for a server that +// has VPC as the endpoint type and the server's VpcEndpointID is not in the +// available state. +// +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceExistsException +// The requested resource does not exist. +// +// * ResourceNotFoundException // This exception is thrown when a resource is not found by the AWS Transfer // for SFTP service. // +// * ThrottlingException +// The request was denied due to request throttling. +// +// HTTP Status Code: 400 +// // See also, https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/UpdateServer func (c *Transfer) UpdateServer(input *UpdateServerInput) (*UpdateServerOutput, error) { req, out := c.UpdateServerRequest(input) @@ -1833,21 +1881,26 @@ func (c *Transfer) UpdateUserRequest(input *UpdateUserInput) (req *request.Reque // See the AWS API reference guide for AWS Transfer for SFTP's // API operation UpdateUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeServiceUnavailableException "ServiceUnavailableException" +// Returned Error Types: +// * ServiceUnavailableException // The request has failed because the AWS Transfer for SFTP service is not available. // -// * ErrCodeInternalServiceError "InternalServiceError" +// * InternalServiceError // This exception is thrown when an error occurs in the AWS Transfer for SFTP // service. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // This exception is thrown when the client submits a malformed request. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // This exception is thrown when a resource is not found by the AWS Transfer // for SFTP service. // +// * ThrottlingException +// The request was denied due to request throttling. +// +// HTTP Status Code: 400 +// // See also, https://docs.aws.amazon.com/goto/WebAPI/transfer-2018-11-05/UpdateUser func (c *Transfer) UpdateUser(input *UpdateUserInput) (*UpdateUserOutput, error) { req, out := c.UpdateUserRequest(input) @@ -1870,17 +1923,78 @@ func (c *Transfer) UpdateUserWithContext(ctx aws.Context, input *UpdateUserInput return out, req.Send() } +// This exception is thrown when the UpdatServer is called for a server that +// has VPC as the endpoint type and the server's VpcEndpointID is not in the +// available state. +type ConflictException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ConflictException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ConflictException) GoString() string { + return s.String() +} + +func newErrorConflictException(v protocol.ResponseMetadata) error { + return &ConflictException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ConflictException) Code() string { + return "ConflictException" +} + +// Message returns the exception's message. +func (s ConflictException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ConflictException) OrigErr() error { + return nil +} + +func (s ConflictException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ConflictException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ConflictException) RequestID() string { + return s.respMetadata.RequestID +} + type CreateServerInput struct { _ struct{} `type:"structure"` - // The virtual private cloud (VPC) endpoint settings that you want to configure - // for your SFTP server. This parameter is required when you specify a value - // for the EndpointType parameter. + // The virtual private cloud (VPC) endpoint settings that are configured for + // your SFTP server. With a VPC endpoint, you can restrict access to your SFTP + // server to resources only within your VPC. To control incoming internet traffic, + // you will need to invoke the UpdateServer API and attach an Elastic IP to + // your server's endpoint. EndpointDetails *EndpointDetails `type:"structure"` - // The type of VPC endpoint that you want your SFTP server to connect to. If - // you connect to a VPC endpoint, your SFTP server isn't accessible over the - // public internet. + // The type of VPC endpoint that you want your SFTP server to connect to. You + // can choose to connect to the public internet or a virtual private cloud (VPC) + // endpoint. With a VPC endpoint, you can restrict access to your SFTP server + // and resources only within your VPC. EndpointType *string `type:"string" enum:"EndpointType"` // The RSA private key as generated by the ssh-keygen -N "" -f my-new-server-key @@ -1890,7 +2004,7 @@ type CreateServerInput struct { // to a new AWS SFTP server, don't update the host key. Accidentally changing // a server's host key can be disruptive. // - // For more information, see "https://docs.aws.amazon.com/transfer/latest/userguide/change-host-key" + // For more information, see "https://alpha-docs-aws.amazon.com/transfer/latest/userguide/configuring-servers.html#change-host-key" // in the AWS SFTP User Guide. HostKey *string `type:"string" sensitive:"true"` @@ -1910,7 +2024,7 @@ type CreateServerInput struct { // A value that allows the service to write your SFTP users' activity to your // Amazon CloudWatch logs for monitoring and auditing purposes. - LoggingRole *string `type:"string"` + LoggingRole *string `min:"20" type:"string"` // Key-value pairs that can be used to group and search for servers. Tags []*Tag `min:"1" type:"list"` @@ -1929,9 +2043,22 @@ func (s CreateServerInput) GoString() string { // Validate inspects the fields of the type to determine if they are valid. func (s *CreateServerInput) Validate() error { invalidParams := request.ErrInvalidParams{Context: "CreateServerInput"} + if s.LoggingRole != nil && len(*s.LoggingRole) < 20 { + invalidParams.Add(request.NewErrParamMinLen("LoggingRole", 20)) + } if s.Tags != nil && len(s.Tags) < 1 { invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) } + if s.EndpointDetails != nil { + if err := s.EndpointDetails.Validate(); err != nil { + invalidParams.AddNested("EndpointDetails", err.(request.ErrInvalidParams)) + } + } + if s.IdentityProviderDetails != nil { + if err := s.IdentityProviderDetails.Validate(); err != nil { + invalidParams.AddNested("IdentityProviderDetails", err.(request.ErrInvalidParams)) + } + } if s.Tags != nil { for i, v := range s.Tags { if v == nil { @@ -1997,7 +2124,7 @@ type CreateServerOutput struct { // The service-assigned ID of the SFTP server that is created. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` } // String returns the string representation @@ -2020,9 +2147,41 @@ type CreateUserInput struct { _ struct{} `type:"structure"` // The landing directory (folder) for a user when they log in to the server - // using their SFTP client. An example is /home/username . + // using their SFTP client. + // + // An example is /home/username. HomeDirectory *string `type:"string"` + // Logical directory mappings that specify what S3 paths and keys should be + // visible to your user and how you want to make them visible. You will need + // to specify the "Entry" and "Target" pair, where Entry shows how the path + // is made visible and Target is the actual S3 path. If you only specify a target, + // it will be displayed as is. You will need to also make sure that your AWS + // IAM Role provides access to paths in Target. The following is an example. + // + // '[ "/bucket2/documentation", { "Entry": "your-personal-report.pdf", "Target": + // "/bucket3/customized-reports/${transfer:UserName}.pdf" } ]' + // + // In most cases, you can use this value instead of the scope down policy to + // lock your user down to the designated home directory ("chroot"). To do this, + // you can set Entry to '/' and set Target to the HomeDirectory parameter value. + // + // If the target of a logical directory entry does not exist in S3, the entry + // will be ignored. As a workaround, you can use the S3 api to create 0 byte + // objects as place holders for your directory. If using the CLI, use the s3api + // call instead of s3 so you can use the put-object operation. For example, + // you use the following: aws s3api put-object --bucket bucketname --key path/to/folder/. + // Make sure that the end of the key name ends in a / for it to be considered + // a folder. + HomeDirectoryMappings []*HomeDirectoryMapEntry `min:"1" type:"list"` + + // The type of landing directory (folder) you want your users' home directory + // to be when they log into the SFTP server. If you set it to PATH, the user + // will see the absolute Amazon S3 bucket paths as is in their SFTP clients. + // If you set it LOGICAL, you will need to provide mappings in the HomeDirectoryMappings + // for how you want to make S3 paths visible to your user. + HomeDirectoryType *string `type:"string" enum:"HomeDirectoryType"` + // A scope-down policy for your user so you can use the same IAM role across // multiple users. This policy scopes down user access to portions of their // Amazon S3 bucket. Variables that you can use inside this policy include ${Transfer:UserName}, @@ -2047,13 +2206,13 @@ type CreateUserInput struct { // SFTP user's transfer requests. // // Role is a required field - Role *string `type:"string" required:"true"` + Role *string `min:"20" type:"string" required:"true"` // A system-assigned unique identifier for an SFTP server instance. This is // the specific SFTP server that you added your user to. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` // The public portion of the Secure Shell (SSH) key used to authenticate the // user to the SFTP server. @@ -2069,7 +2228,7 @@ type CreateUserInput struct { // underscore, and hyphen. The user name can't start with a hyphen. // // UserName is a required field - UserName *string `type:"string" required:"true"` + UserName *string `min:"3" type:"string" required:"true"` } // String returns the string representation @@ -2085,18 +2244,40 @@ func (s CreateUserInput) GoString() 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.HomeDirectoryMappings != nil && len(s.HomeDirectoryMappings) < 1 { + invalidParams.Add(request.NewErrParamMinLen("HomeDirectoryMappings", 1)) + } if s.Role == nil { invalidParams.Add(request.NewErrParamRequired("Role")) } + if s.Role != nil && len(*s.Role) < 20 { + invalidParams.Add(request.NewErrParamMinLen("Role", 20)) + } if s.ServerId == nil { invalidParams.Add(request.NewErrParamRequired("ServerId")) } + if s.ServerId != nil && len(*s.ServerId) < 19 { + invalidParams.Add(request.NewErrParamMinLen("ServerId", 19)) + } if s.Tags != nil && len(s.Tags) < 1 { invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) } if s.UserName == nil { invalidParams.Add(request.NewErrParamRequired("UserName")) } + if s.UserName != nil && len(*s.UserName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 3)) + } + if s.HomeDirectoryMappings != nil { + for i, v := range s.HomeDirectoryMappings { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "HomeDirectoryMappings", i), err.(request.ErrInvalidParams)) + } + } + } if s.Tags != nil { for i, v := range s.Tags { if v == nil { @@ -2120,6 +2301,18 @@ func (s *CreateUserInput) SetHomeDirectory(v string) *CreateUserInput { return s } +// SetHomeDirectoryMappings sets the HomeDirectoryMappings field's value. +func (s *CreateUserInput) SetHomeDirectoryMappings(v []*HomeDirectoryMapEntry) *CreateUserInput { + s.HomeDirectoryMappings = v + return s +} + +// SetHomeDirectoryType sets the HomeDirectoryType field's value. +func (s *CreateUserInput) SetHomeDirectoryType(v string) *CreateUserInput { + s.HomeDirectoryType = &v + return s +} + // SetPolicy sets the Policy field's value. func (s *CreateUserInput) SetPolicy(v string) *CreateUserInput { s.Policy = &v @@ -2162,12 +2355,12 @@ type CreateUserOutput struct { // The ID of the SFTP server that the user is attached to. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` // A unique string that identifies a user account associated with an SFTP server. // // UserName is a required field - UserName *string `type:"string" required:"true"` + UserName *string `min:"3" type:"string" required:"true"` } // String returns the string representation @@ -2198,7 +2391,7 @@ type DeleteServerInput struct { // A unique system-assigned identifier for an SFTP server instance. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` } // String returns the string representation @@ -2217,6 +2410,9 @@ func (s *DeleteServerInput) Validate() error { if s.ServerId == nil { invalidParams.Add(request.NewErrParamRequired("ServerId")) } + if s.ServerId != nil && len(*s.ServerId) < 19 { + invalidParams.Add(request.NewErrParamMinLen("ServerId", 19)) + } if invalidParams.Len() > 0 { return invalidParams @@ -2251,17 +2447,17 @@ type DeleteSshPublicKeyInput struct { // server instance that has the user assigned to it. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` // A unique identifier used to reference your user's specific SSH key. // // SshPublicKeyId is a required field - SshPublicKeyId *string `type:"string" required:"true"` + SshPublicKeyId *string `min:"21" type:"string" required:"true"` // A unique string that identifies a user whose public key is being deleted. // // UserName is a required field - UserName *string `type:"string" required:"true"` + UserName *string `min:"3" type:"string" required:"true"` } // String returns the string representation @@ -2280,12 +2476,21 @@ func (s *DeleteSshPublicKeyInput) Validate() error { if s.ServerId == nil { invalidParams.Add(request.NewErrParamRequired("ServerId")) } + if s.ServerId != nil && len(*s.ServerId) < 19 { + invalidParams.Add(request.NewErrParamMinLen("ServerId", 19)) + } if s.SshPublicKeyId == nil { invalidParams.Add(request.NewErrParamRequired("SshPublicKeyId")) } + if s.SshPublicKeyId != nil && len(*s.SshPublicKeyId) < 21 { + invalidParams.Add(request.NewErrParamMinLen("SshPublicKeyId", 21)) + } if s.UserName == nil { invalidParams.Add(request.NewErrParamRequired("UserName")) } + if s.UserName != nil && len(*s.UserName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 3)) + } if invalidParams.Len() > 0 { return invalidParams @@ -2332,12 +2537,12 @@ type DeleteUserInput struct { // the user assigned to it. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` // A unique string that identifies a user that is being deleted from the server. // // UserName is a required field - UserName *string `type:"string" required:"true"` + UserName *string `min:"3" type:"string" required:"true"` } // String returns the string representation @@ -2356,9 +2561,15 @@ func (s *DeleteUserInput) Validate() error { if s.ServerId == nil { invalidParams.Add(request.NewErrParamRequired("ServerId")) } + if s.ServerId != nil && len(*s.ServerId) < 19 { + invalidParams.Add(request.NewErrParamMinLen("ServerId", 19)) + } if s.UserName == nil { invalidParams.Add(request.NewErrParamRequired("UserName")) } + if s.UserName != nil && len(*s.UserName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 3)) + } if invalidParams.Len() > 0 { return invalidParams @@ -2398,7 +2609,7 @@ type DescribeServerInput struct { // A system-assigned unique identifier for an SFTP server. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` } // String returns the string representation @@ -2417,6 +2628,9 @@ func (s *DescribeServerInput) Validate() error { if s.ServerId == nil { invalidParams.Add(request.NewErrParamRequired("ServerId")) } + if s.ServerId != nil && len(*s.ServerId) < 19 { + invalidParams.Add(request.NewErrParamMinLen("ServerId", 19)) + } if invalidParams.Len() > 0 { return invalidParams @@ -2462,14 +2676,14 @@ type DescribeUserInput struct { // assigned. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` // The name of the user assigned to one or more servers. User names are part // of the sign-in credentials to use the AWS Transfer for SFTP service and perform // file transfer tasks. // // UserName is a required field - UserName *string `type:"string" required:"true"` + UserName *string `min:"3" type:"string" required:"true"` } // String returns the string representation @@ -2488,9 +2702,15 @@ func (s *DescribeUserInput) Validate() error { if s.ServerId == nil { invalidParams.Add(request.NewErrParamRequired("ServerId")) } + if s.ServerId != nil && len(*s.ServerId) < 19 { + invalidParams.Add(request.NewErrParamMinLen("ServerId", 19)) + } if s.UserName == nil { invalidParams.Add(request.NewErrParamRequired("UserName")) } + if s.UserName != nil && len(*s.UserName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 3)) + } if invalidParams.Len() > 0 { return invalidParams @@ -2517,7 +2737,7 @@ type DescribeUserOutput struct { // assigned. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` // An array containing the properties of the user account for the ServerID value // that you specified. @@ -2588,11 +2808,11 @@ type DescribedServer struct { // This property is an AWS Identity and Access Management (IAM) entity that // allows the server to turn on Amazon CloudWatch logging for Amazon S3 events. // When set, user activity can be viewed in your CloudWatch logs. - LoggingRole *string `type:"string"` + LoggingRole *string `min:"20" type:"string"` // This property is a unique system-assigned identifier for the SFTP server // that you instantiate. - ServerId *string `type:"string"` + ServerId *string `min:"19" type:"string"` // The condition of the SFTP server for the server that was described. A value // of ONLINE indicates that the server can accept jobs and transfer files. A @@ -2701,9 +2921,32 @@ type DescribedUser struct { // This property specifies the landing directory (or folder), which is the location // that files are written to or read from in an Amazon S3 bucket for the described - // user. An example is /bucket_name/home/username . + // user. An example is /your s3 bucket name/home/username . HomeDirectory *string `type:"string"` + // Logical directory mappings that you specified for what S3 paths and keys + // should be visible to your user and how you want to make them visible. You + // will need to specify the "Entry" and "Target" pair, where Entry shows how + // the path is made visible and Target is the actual S3 path. If you only specify + // a target, it will be displayed as is. You will need to also make sure that + // your AWS IAM Role provides access to paths in Target. + // + // In most cases, you can use this value instead of the scope down policy to + // lock your user down to the designated home directory ("chroot"). To do this, + // you can set Entry to '/' and set Target to the HomeDirectory parameter value. + // + // In most cases, you can use this value instead of the scope down policy to + // lock your user down to the designated home directory ("chroot"). To do this, + // you can set Entry to '/' and set Target to the HomeDirectory parameter value. + HomeDirectoryMappings []*HomeDirectoryMapEntry `min:"1" type:"list"` + + // The type of landing directory (folder) you mapped for your users' to see + // when they log into the SFTP server. If you set it to PATH, the user will + // see the absolute Amazon S3 bucket paths as is in their SFTP clients. If you + // set it LOGICAL, you will need to provide mappings in the HomeDirectoryMappings + // for how you want to make S3 paths visible to your user. + HomeDirectoryType *string `type:"string" enum:"HomeDirectoryType"` + // Specifies the name of the policy in use for the described user. Policy *string `type:"string"` @@ -2713,7 +2956,7 @@ type DescribedUser struct { // into and out of your Amazon S3 bucket or buckets. The IAM role should also // contain a trust relationship that allows the SFTP server to access your resources // when servicing your SFTP user's transfer requests. - Role *string `type:"string"` + Role *string `min:"20" type:"string"` // This property contains the public key portion of the Secure Shell (SSH) keys // stored for the described user. @@ -2726,7 +2969,7 @@ type DescribedUser struct { // This property is the name of the user that was requested to be described. // User names are used for authentication purposes. This is the string that // will be used by your user when they log in to your SFTP server. - UserName *string `type:"string"` + UserName *string `min:"3" type:"string"` } // String returns the string representation @@ -2751,6 +2994,18 @@ func (s *DescribedUser) SetHomeDirectory(v string) *DescribedUser { return s } +// SetHomeDirectoryMappings sets the HomeDirectoryMappings field's value. +func (s *DescribedUser) SetHomeDirectoryMappings(v []*HomeDirectoryMapEntry) *DescribedUser { + s.HomeDirectoryMappings = v + return s +} + +// SetHomeDirectoryType sets the HomeDirectoryType field's value. +func (s *DescribedUser) SetHomeDirectoryType(v string) *DescribedUser { + s.HomeDirectoryType = &v + return s +} + // SetPolicy sets the Policy field's value. func (s *DescribedUser) SetPolicy(v string) *DescribedUser { s.Policy = &v @@ -2781,13 +3036,30 @@ func (s *DescribedUser) SetUserName(v string) *DescribedUser { return s } -// The configuration settings for the virtual private cloud (VPC) endpoint for -// your SFTP server. +// The virtual private cloud (VPC) endpoint settings that are configured for +// your SFTP server. With a VPC endpoint, you can restrict access to your SFTP +// server and resources only within your VPC. To control incoming internet traffic, +// invoke the UpdateServer API and attach an Elastic IP to your server's endpoint. type EndpointDetails struct { _ struct{} `type:"structure"` + // A list of address allocation IDs that are required to attach an Elastic IP + // address to your SFTP server's endpoint. This is only valid in the UpdateServer + // API. + // + // This property can only be use when EndpointType is set to VPC. + AddressAllocationIds []*string `type:"list"` + + // A list of subnet IDs that are required to host your SFTP server endpoint + // in your VPC. + SubnetIds []*string `type:"list"` + // The ID of the VPC endpoint. - VpcEndpointId *string `type:"string"` + VpcEndpointId *string `min:"22" type:"string"` + + // The VPC ID of the virtual private cloud in which the SFTP server's endpoint + // will be hosted. + VpcId *string `type:"string"` } // String returns the string representation @@ -2800,12 +3072,96 @@ func (s EndpointDetails) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *EndpointDetails) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "EndpointDetails"} + if s.VpcEndpointId != nil && len(*s.VpcEndpointId) < 22 { + invalidParams.Add(request.NewErrParamMinLen("VpcEndpointId", 22)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAddressAllocationIds sets the AddressAllocationIds field's value. +func (s *EndpointDetails) SetAddressAllocationIds(v []*string) *EndpointDetails { + s.AddressAllocationIds = v + return s +} + +// SetSubnetIds sets the SubnetIds field's value. +func (s *EndpointDetails) SetSubnetIds(v []*string) *EndpointDetails { + s.SubnetIds = v + return s +} + // SetVpcEndpointId sets the VpcEndpointId field's value. func (s *EndpointDetails) SetVpcEndpointId(v string) *EndpointDetails { s.VpcEndpointId = &v return s } +// SetVpcId sets the VpcId field's value. +func (s *EndpointDetails) SetVpcId(v string) *EndpointDetails { + s.VpcId = &v + return s +} + +// Represents an object that contains entries and a targets for HomeDirectoryMappings. +type HomeDirectoryMapEntry struct { + _ struct{} `type:"structure"` + + // Represents an entry and a target for HomeDirectoryMappings. + // + // Entry is a required field + Entry *string `type:"string" required:"true"` + + // Represents the map target that is used in a HomeDirectorymapEntry. + // + // Target is a required field + Target *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s HomeDirectoryMapEntry) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s HomeDirectoryMapEntry) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *HomeDirectoryMapEntry) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "HomeDirectoryMapEntry"} + if s.Entry == nil { + invalidParams.Add(request.NewErrParamRequired("Entry")) + } + if s.Target == nil { + invalidParams.Add(request.NewErrParamRequired("Target")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEntry sets the Entry field's value. +func (s *HomeDirectoryMapEntry) SetEntry(v string) *HomeDirectoryMapEntry { + s.Entry = &v + return s +} + +// SetTarget sets the Target field's value. +func (s *HomeDirectoryMapEntry) SetTarget(v string) *HomeDirectoryMapEntry { + s.Target = &v + return s +} + // Returns information related to the type of user authentication that is in // use for a server's users. A server can have only one method of authentication. type IdentityProviderDetails struct { @@ -2813,7 +3169,7 @@ type IdentityProviderDetails struct { // The InvocationRole parameter provides the type of InvocationRole used to // authenticate the user account. - InvocationRole *string `type:"string"` + InvocationRole *string `min:"20" type:"string"` // The Url parameter provides contains the location of the service endpoint // used to authenticate users. @@ -2830,6 +3186,19 @@ func (s IdentityProviderDetails) GoString() string { return s.String() } +// Validate inspects the fields of the type to determine if they are valid. +func (s *IdentityProviderDetails) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "IdentityProviderDetails"} + if s.InvocationRole != nil && len(*s.InvocationRole) < 20 { + invalidParams.Add(request.NewErrParamMinLen("InvocationRole", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + // SetInvocationRole sets the InvocationRole field's value. func (s *IdentityProviderDetails) SetInvocationRole(v string) *IdentityProviderDetails { s.InvocationRole = &v @@ -2848,7 +3217,7 @@ type ImportSshPublicKeyInput struct { // A system-assigned unique identifier for an SFTP server. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` // The public key portion of an SSH key pair. // @@ -2858,7 +3227,7 @@ type ImportSshPublicKeyInput struct { // The name of the user account that is assigned to one or more servers. // // UserName is a required field - UserName *string `type:"string" required:"true"` + UserName *string `min:"3" type:"string" required:"true"` } // String returns the string representation @@ -2877,12 +3246,18 @@ func (s *ImportSshPublicKeyInput) Validate() error { if s.ServerId == nil { invalidParams.Add(request.NewErrParamRequired("ServerId")) } + if s.ServerId != nil && len(*s.ServerId) < 19 { + invalidParams.Add(request.NewErrParamMinLen("ServerId", 19)) + } if s.SshPublicKeyBody == nil { invalidParams.Add(request.NewErrParamRequired("SshPublicKeyBody")) } if s.UserName == nil { invalidParams.Add(request.NewErrParamRequired("UserName")) } + if s.UserName != nil && len(*s.UserName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 3)) + } if invalidParams.Len() > 0 { return invalidParams @@ -2917,18 +3292,18 @@ type ImportSshPublicKeyOutput struct { // A system-assigned unique identifier for an SFTP server. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` // This identifier is the name given to a public key by the system that was // imported. // // SshPublicKeyId is a required field - SshPublicKeyId *string `type:"string" required:"true"` + SshPublicKeyId *string `min:"21" type:"string" required:"true"` // A user name assigned to the ServerID value that you specified. // // UserName is a required field - UserName *string `type:"string" required:"true"` + UserName *string `min:"3" type:"string" required:"true"` } // String returns the string representation @@ -2959,6 +3334,175 @@ func (s *ImportSshPublicKeyOutput) SetUserName(v string) *ImportSshPublicKeyOutp return s } +// This exception is thrown when an error occurs in the AWS Transfer for SFTP +// service. +type InternalServiceError struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalServiceError) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServiceError) GoString() string { + return s.String() +} + +func newErrorInternalServiceError(v protocol.ResponseMetadata) error { + return &InternalServiceError{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServiceError) Code() string { + return "InternalServiceError" +} + +// Message returns the exception's message. +func (s InternalServiceError) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServiceError) OrigErr() error { + return nil +} + +func (s InternalServiceError) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServiceError) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServiceError) RequestID() string { + return s.respMetadata.RequestID +} + +// The NextToken parameter that was passed is invalid. +type InvalidNextTokenException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidNextTokenException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidNextTokenException) GoString() string { + return s.String() +} + +func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { + return &InvalidNextTokenException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidNextTokenException) Code() string { + return "InvalidNextTokenException" +} + +// Message returns the exception's message. +func (s InvalidNextTokenException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidNextTokenException) OrigErr() error { + return nil +} + +func (s InvalidNextTokenException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidNextTokenException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidNextTokenException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when the client submits a malformed request. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + type ListServersInput struct { _ struct{} `type:"structure"` @@ -3175,7 +3719,7 @@ type ListUsersInput struct { // server that has users assigned to it. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` } // String returns the string representation @@ -3200,6 +3744,9 @@ func (s *ListUsersInput) Validate() error { if s.ServerId == nil { invalidParams.Add(request.NewErrParamRequired("ServerId")) } + if s.ServerId != nil && len(*s.ServerId) < 19 { + invalidParams.Add(request.NewErrParamMinLen("ServerId", 19)) + } if invalidParams.Len() > 0 { return invalidParams @@ -3237,7 +3784,7 @@ type ListUsersOutput struct { // assigned to. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` // Returns the user accounts and their properties for the ServerId value that // you specify. @@ -3296,11 +3843,11 @@ type ListedServer struct { // The AWS Identity and Access Management entity that allows the server to turn // on Amazon CloudWatch logging. - LoggingRole *string `type:"string"` + LoggingRole *string `min:"20" type:"string"` // This value is the unique system assigned identifier for the SFTP servers // that were listed. - ServerId *string `type:"string"` + ServerId *string `min:"19" type:"string"` // This property describes the condition of the SFTP server for the server that // was described. A value of ONLINE> indicates that the server can accept jobs @@ -3383,18 +3930,25 @@ type ListedUser struct { // an Amazon S3 bucket for the user you specify by their ARN. HomeDirectory *string `type:"string"` + // The type of landing directory (folder) you mapped for your users' home directory. + // If you set it to PATH, the user will see the absolute Amazon S3 bucket paths + // as is in their SFTP clients. If you set it LOGICAL, you will need to provide + // mappings in the HomeDirectoryMappings for how you want to make S3 paths visible + // to your user. + HomeDirectoryType *string `type:"string" enum:"HomeDirectoryType"` + // The role in use by this user. A role is an AWS Identity and Access Management // (IAM) entity that, in this case, allows the SFTP server to act on a user's // behalf. It allows the server to inherit the trust relationship that enables // that user to perform file operations to their Amazon S3 bucket. - Role *string `type:"string"` + Role *string `min:"20" type:"string"` // This value is the number of SSH public keys stored for the user you specified. SshPublicKeyCount *int64 `type:"integer"` // The name of the user whose ARN was specified. User names are used for authentication // purposes. - UserName *string `type:"string"` + UserName *string `min:"3" type:"string"` } // String returns the string representation @@ -3419,6 +3973,12 @@ func (s *ListedUser) SetHomeDirectory(v string) *ListedUser { return s } +// SetHomeDirectoryType sets the HomeDirectoryType field's value. +func (s *ListedUser) SetHomeDirectoryType(v string) *ListedUser { + s.HomeDirectoryType = &v + return s +} + // SetRole sets the Role field's value. func (s *ListedUser) SetRole(v string) *ListedUser { s.Role = &v @@ -3437,6 +3997,187 @@ func (s *ListedUser) SetUserName(v string) *ListedUser { return s } +// The requested resource does not exist. +type ResourceExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // Resource is a required field + Resource *string `type:"string" required:"true"` + + // ResourceType is a required field + ResourceType *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ResourceExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceExistsException) GoString() string { + return s.String() +} + +func newErrorResourceExistsException(v protocol.ResponseMetadata) error { + return &ResourceExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceExistsException) Code() string { + return "ResourceExistsException" +} + +// Message returns the exception's message. +func (s ResourceExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceExistsException) OrigErr() error { + return nil +} + +func (s ResourceExistsException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// This exception is thrown when a resource is not found by the AWS Transfer +// for SFTP service. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` + + // Resource is a required field + Resource *string `type:"string" required:"true"` + + // ResourceType is a required field + ResourceType *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request has failed because the AWS Transfer for SFTP service is not available. +type ServiceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ServiceUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceUnavailableException) GoString() string { + return s.String() +} + +func newErrorServiceUnavailableException(v protocol.ResponseMetadata) error { + return &ServiceUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceUnavailableException) Code() string { + return "ServiceUnavailableException" +} + +// Message returns the exception's message. +func (s ServiceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceUnavailableException) OrigErr() error { + return nil +} + +func (s ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + // Provides information about the public Secure Shell (SSH) key that is associated // with a user account for a specific server (as identified by ServerId). The // information returned includes the date the key was imported, the public key @@ -3458,7 +4199,7 @@ type SshPublicKey struct { // The SshPublicKeyId parameter contains the identifier of the public key. // // SshPublicKeyId is a required field - SshPublicKeyId *string `type:"string" required:"true"` + SshPublicKeyId *string `min:"21" type:"string" required:"true"` } // String returns the string representation @@ -3495,7 +4236,7 @@ type StartServerInput struct { // A system-assigned unique identifier for an SFTP server that you start. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` } // String returns the string representation @@ -3514,6 +4255,9 @@ func (s *StartServerInput) Validate() error { if s.ServerId == nil { invalidParams.Add(request.NewErrParamRequired("ServerId")) } + if s.ServerId != nil && len(*s.ServerId) < 19 { + invalidParams.Add(request.NewErrParamMinLen("ServerId", 19)) + } if invalidParams.Len() > 0 { return invalidParams @@ -3547,7 +4291,7 @@ type StopServerInput struct { // A system-assigned unique identifier for an SFTP server that you stopped. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` } // String returns the string representation @@ -3566,6 +4310,9 @@ func (s *StopServerInput) Validate() error { if s.ServerId == nil { invalidParams.Add(request.NewErrParamRequired("ServerId")) } + if s.ServerId != nil && len(*s.ServerId) < 19 { + invalidParams.Add(request.NewErrParamMinLen("ServerId", 19)) + } if invalidParams.Len() > 0 { return invalidParams @@ -3744,12 +4491,12 @@ type TestIdentityProviderInput struct { // method is tested with a user name and password. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` // This request parameter is the name of the user account to be tested. // // UserName is a required field - UserName *string `type:"string" required:"true"` + UserName *string `min:"3" type:"string" required:"true"` // The password of the user account to be tested. UserPassword *string `type:"string" sensitive:"true"` @@ -3771,9 +4518,15 @@ func (s *TestIdentityProviderInput) Validate() error { if s.ServerId == nil { invalidParams.Add(request.NewErrParamRequired("ServerId")) } + if s.ServerId != nil && len(*s.ServerId) < 19 { + invalidParams.Add(request.NewErrParamMinLen("ServerId", 19)) + } if s.UserName == nil { invalidParams.Add(request.NewErrParamRequired("UserName")) } + if s.UserName != nil && len(*s.UserName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 3)) + } if invalidParams.Len() > 0 { return invalidParams @@ -3853,6 +4606,66 @@ func (s *TestIdentityProviderOutput) SetUrl(v string) *TestIdentityProviderOutpu return s } +// The request was denied due to request throttling. +// +// HTTP Status Code: 400 +type ThrottlingException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` + + RetryAfterSeconds *string `type:"string"` +} + +// String returns the string representation +func (s ThrottlingException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ThrottlingException) GoString() string { + return s.String() +} + +func newErrorThrottlingException(v protocol.ResponseMetadata) error { + return &ThrottlingException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ThrottlingException) Code() string { + return "ThrottlingException" +} + +// Message returns the exception's message. +func (s ThrottlingException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ThrottlingException) OrigErr() error { + return nil +} + +func (s ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ThrottlingException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ThrottlingException) RequestID() string { + return s.respMetadata.RequestID +} + type UntagResourceInput struct { _ struct{} `type:"structure"` @@ -3933,8 +4746,10 @@ type UpdateServerInput struct { _ struct{} `type:"structure"` // The virtual private cloud (VPC) endpoint settings that are configured for - // your SFTP server. With a VPC endpoint, your SFTP server isn't accessible - // over the public internet. + // your SFTP server. With a VPC endpoint, you can restrict access to your SFTP + // server to resources only within your VPC. To control incoming internet traffic, + // you will need to associate one or more Elastic IP addresses with your server's + // endpoint. EndpointDetails *EndpointDetails `type:"structure"` // The type of endpoint that you want your SFTP server to connect to. You can @@ -3966,7 +4781,7 @@ type UpdateServerInput struct { // user account is assigned to. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` } // String returns the string representation @@ -3985,6 +4800,19 @@ func (s *UpdateServerInput) Validate() error { if s.ServerId == nil { invalidParams.Add(request.NewErrParamRequired("ServerId")) } + if s.ServerId != nil && len(*s.ServerId) < 19 { + invalidParams.Add(request.NewErrParamMinLen("ServerId", 19)) + } + if s.EndpointDetails != nil { + if err := s.EndpointDetails.Validate(); err != nil { + invalidParams.AddNested("EndpointDetails", err.(request.ErrInvalidParams)) + } + } + if s.IdentityProviderDetails != nil { + if err := s.IdentityProviderDetails.Validate(); err != nil { + invalidParams.AddNested("IdentityProviderDetails", err.(request.ErrInvalidParams)) + } + } if invalidParams.Len() > 0 { return invalidParams @@ -4035,7 +4863,7 @@ type UpdateServerOutput struct { // is assigned to. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` } // String returns the string representation @@ -4058,9 +4886,41 @@ type UpdateUserInput struct { _ struct{} `type:"structure"` // A parameter that specifies the landing directory (folder) for a user when - // they log in to the server using their client. An example is /home/username . + // they log in to the server using their client. + // + // An example is /home/username. HomeDirectory *string `type:"string"` + // Logical directory mappings that specify what S3 paths and keys should be + // visible to your user and how you want to make them visible. You will need + // to specify the "Entry" and "Target" pair, where Entry shows how the path + // is made visible and Target is the actual S3 path. If you only specify a target, + // it will be displayed as is. You will need to also make sure that your AWS + // IAM Role provides access to paths in Target. The following is an example. + // + // '[ "/bucket2/documentation", { "Entry": "your-personal-report.pdf", "Target": + // "/bucket3/customized-reports/${transfer:UserName}.pdf" } ]' + // + // In most cases, you can use this value instead of the scope down policy to + // lock your user down to the designated home directory ("chroot"). To do this, + // you can set Entry to '/' and set Target to the HomeDirectory parameter value. + // + // If the target of a logical directory entry does not exist in S3, the entry + // will be ignored. As a workaround, you can use the S3 api to create 0 byte + // objects as place holders for your directory. If using the CLI, use the s3api + // call instead of s3 so you can use the put-object operation. For example, + // you use the following: aws s3api put-object --bucket bucketname --key path/to/folder/. + // Make sure that the end of the key name ends in a / for it to be considered + // a folder. + HomeDirectoryMappings []*HomeDirectoryMapEntry `min:"1" type:"list"` + + // The type of landing directory (folder) you want your users' home directory + // to be when they log into the SFTP serve. If you set it to PATH, the user + // will see the absolute Amazon S3 bucket paths as is in their SFTP clients. + // If you set it LOGICAL, you will need to provide mappings in the HomeDirectoryMappings + // for how you want to make S3 paths visible to your user. + HomeDirectoryType *string `type:"string" enum:"HomeDirectoryType"` + // Allows you to supply a scope-down policy for your user so you can use the // same AWS Identity and Access Management (IAM) role across multiple users. // The policy scopes down user access to portions of your Amazon S3 bucket. @@ -4084,13 +4944,13 @@ type UpdateUserInput struct { // S3 bucket or buckets. The IAM role should also contain a trust relationship // that allows the Secure File Transfer Protocol (SFTP) server to access your // resources when servicing your SFTP user's transfer requests. - Role *string `type:"string"` + Role *string `min:"20" type:"string"` // A system-assigned unique identifier for an SFTP server instance that the // user account is assigned to. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` // A unique string that identifies a user and is associated with a server as // specified by the ServerId. This is the string that will be used by your user @@ -4099,7 +4959,7 @@ type UpdateUserInput struct { // A-Z, 0-9, underscore, and hyphen. The user name can't start with a hyphen. // // UserName is a required field - UserName *string `type:"string" required:"true"` + UserName *string `min:"3" type:"string" required:"true"` } // String returns the string representation @@ -4115,12 +4975,34 @@ func (s UpdateUserInput) GoString() 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.HomeDirectoryMappings != nil && len(s.HomeDirectoryMappings) < 1 { + invalidParams.Add(request.NewErrParamMinLen("HomeDirectoryMappings", 1)) + } + if s.Role != nil && len(*s.Role) < 20 { + invalidParams.Add(request.NewErrParamMinLen("Role", 20)) + } if s.ServerId == nil { invalidParams.Add(request.NewErrParamRequired("ServerId")) } + if s.ServerId != nil && len(*s.ServerId) < 19 { + invalidParams.Add(request.NewErrParamMinLen("ServerId", 19)) + } if s.UserName == nil { invalidParams.Add(request.NewErrParamRequired("UserName")) } + if s.UserName != nil && len(*s.UserName) < 3 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 3)) + } + if s.HomeDirectoryMappings != nil { + for i, v := range s.HomeDirectoryMappings { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "HomeDirectoryMappings", i), err.(request.ErrInvalidParams)) + } + } + } if invalidParams.Len() > 0 { return invalidParams @@ -4134,6 +5016,18 @@ func (s *UpdateUserInput) SetHomeDirectory(v string) *UpdateUserInput { return s } +// SetHomeDirectoryMappings sets the HomeDirectoryMappings field's value. +func (s *UpdateUserInput) SetHomeDirectoryMappings(v []*HomeDirectoryMapEntry) *UpdateUserInput { + s.HomeDirectoryMappings = v + return s +} + +// SetHomeDirectoryType sets the HomeDirectoryType field's value. +func (s *UpdateUserInput) SetHomeDirectoryType(v string) *UpdateUserInput { + s.HomeDirectoryType = &v + return s +} + // SetPolicy sets the Policy field's value. func (s *UpdateUserInput) SetPolicy(v string) *UpdateUserInput { s.Policy = &v @@ -4167,13 +5061,13 @@ type UpdateUserOutput struct { // user account is assigned to. // // ServerId is a required field - ServerId *string `type:"string" required:"true"` + ServerId *string `min:"19" type:"string" required:"true"` // The unique identifier for a user that is assigned to the SFTP server instance // that was specified in the request. // // UserName is a required field - UserName *string `type:"string" required:"true"` + UserName *string `min:"3" type:"string" required:"true"` } // String returns the string representation @@ -4202,10 +5096,21 @@ const ( // EndpointTypePublic is a EndpointType enum value EndpointTypePublic = "PUBLIC" + // EndpointTypeVpc is a EndpointType enum value + EndpointTypeVpc = "VPC" + // EndpointTypeVpcEndpoint is a EndpointType enum value EndpointTypeVpcEndpoint = "VPC_ENDPOINT" ) +const ( + // HomeDirectoryTypePath is a HomeDirectoryType enum value + HomeDirectoryTypePath = "PATH" + + // HomeDirectoryTypeLogical is a HomeDirectoryType enum value + HomeDirectoryTypeLogical = "LOGICAL" +) + // Returns information related to the type of user authentication that is in // use for a server's users. For SERVICE_MANAGED authentication, the Secure // Shell (SSH) public keys are stored with a user on an SFTP server instance. diff --git a/vendor/github.com/aws/aws-sdk-go/service/transfer/errors.go b/vendor/github.com/aws/aws-sdk-go/service/transfer/errors.go index 0734c873b55..0aef6abd4dc 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/transfer/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/transfer/errors.go @@ -2,8 +2,20 @@ package transfer +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( + // ErrCodeConflictException for service response error code + // "ConflictException". + // + // This exception is thrown when the UpdatServer is called for a server that + // has VPC as the endpoint type and the server's VpcEndpointID is not in the + // available state. + ErrCodeConflictException = "ConflictException" + // ErrCodeInternalServiceError for service response error code // "InternalServiceError". // @@ -41,4 +53,23 @@ const ( // // The request has failed because the AWS Transfer for SFTP service is not available. ErrCodeServiceUnavailableException = "ServiceUnavailableException" + + // ErrCodeThrottlingException for service response error code + // "ThrottlingException". + // + // The request was denied due to request throttling. + // + // HTTP Status Code: 400 + ErrCodeThrottlingException = "ThrottlingException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "ConflictException": newErrorConflictException, + "InternalServiceError": newErrorInternalServiceError, + "InvalidNextTokenException": newErrorInvalidNextTokenException, + "InvalidRequestException": newErrorInvalidRequestException, + "ResourceExistsException": newErrorResourceExistsException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ServiceUnavailableException": newErrorServiceUnavailableException, + "ThrottlingException": newErrorThrottlingException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/transfer/service.go b/vendor/github.com/aws/aws-sdk-go/service/transfer/service.go index 0fcea8665a0..639b4da4dc2 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/transfer/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/transfer/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "Transfer" // Name of service. EndpointsID = "transfer" // ID to lookup a service endpoint with. - ServiceID = "Transfer" // ServiceID is a unique identifer of a specific service. + ServiceID = "Transfer" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the Transfer client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a Transfer client from just a session. // svc := transfer.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *Transfer { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "transfer" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *Transfer { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *Transfer { svc := &Transfer{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-11-05", JSONVersion: "1.1", @@ -76,7 +80,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { 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 index 7dc45ecc8fc..1267ed1a5f3 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/waf/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/waf/api.go @@ -87,19 +87,19 @@ func (c *WAF) CreateByteMatchSetRequest(input *CreateByteMatchSetInput) (req *re // See the AWS API reference guide for AWS WAF's // API operation CreateByteMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeDisallowedNameException "WAFDisallowedNameException" +// Returned Error Types: +// * DisallowedNameException // The name specified is invalid. // -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -128,11 +128,11 @@ func (c *WAF) CreateByteMatchSetRequest(input *CreateByteMatchSetInput) (req *re // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeStaleDataException "WAFStaleDataException" +// * 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 "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -233,23 +233,23 @@ func (c *WAF) CreateGeoMatchSetRequest(input *CreateGeoMatchSetInput) (req *requ // See the AWS API reference guide for AWS WAF's // API operation CreateGeoMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeDisallowedNameException "WAFDisallowedNameException" +// * DisallowedNameException // The name specified is invalid. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -278,7 +278,7 @@ func (c *WAF) CreateGeoMatchSetRequest(input *CreateGeoMatchSetInput) (req *requ // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -380,23 +380,23 @@ func (c *WAF) CreateIPSetRequest(input *CreateIPSetInput) (req *request.Request, // See the AWS API reference guide for AWS WAF's // API operation CreateIPSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeDisallowedNameException "WAFDisallowedNameException" +// * DisallowedNameException // The name specified is invalid. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -425,7 +425,7 @@ func (c *WAF) CreateIPSetRequest(input *CreateIPSetInput) (req *request.Request, // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -566,19 +566,19 @@ func (c *WAF) CreateRateBasedRuleRequest(input *CreateRateBasedRuleInput) (req * // See the AWS API reference guide for AWS WAF's // API operation CreateRateBasedRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeDisallowedNameException "WAFDisallowedNameException" +// * DisallowedNameException // The name specified is invalid. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -607,17 +607,17 @@ func (c *WAF) CreateRateBasedRuleRequest(input *CreateRateBasedRuleInput) (req * // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeTagOperationException "WAFTagOperationException" +// * TagOperationException // -// * ErrCodeTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * TagOperationInternalErrorException // -// * ErrCodeBadRequestException "WAFBadRequestException" +// * BadRequestException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRateBasedRule func (c *WAF) CreateRateBasedRule(input *CreateRateBasedRuleInput) (*CreateRateBasedRuleOutput, error) { @@ -716,19 +716,19 @@ func (c *WAF) CreateRegexMatchSetRequest(input *CreateRegexMatchSetInput) (req * // See the AWS API reference guide for AWS WAF's // API operation CreateRegexMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeDisallowedNameException "WAFDisallowedNameException" +// * DisallowedNameException // The name specified is invalid. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -827,19 +827,19 @@ func (c *WAF) CreateRegexPatternSetRequest(input *CreateRegexPatternSetInput) (r // See the AWS API reference guide for AWS WAF's // API operation CreateRegexPatternSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeDisallowedNameException "WAFDisallowedNameException" +// * DisallowedNameException // The name specified is invalid. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -955,19 +955,19 @@ func (c *WAF) CreateRuleRequest(input *CreateRuleInput) (req *request.Request, o // See the AWS API reference guide for AWS WAF's // API operation CreateRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeDisallowedNameException "WAFDisallowedNameException" +// * DisallowedNameException // The name specified is invalid. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -996,17 +996,17 @@ func (c *WAF) CreateRuleRequest(input *CreateRuleInput) (req *request.Request, o // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeTagOperationException "WAFTagOperationException" +// * TagOperationException // -// * ErrCodeTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * TagOperationInternalErrorException // -// * ErrCodeBadRequestException "WAFBadRequestException" +// * BadRequestException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRule func (c *WAF) CreateRule(input *CreateRuleInput) (*CreateRuleOutput, error) { @@ -1096,29 +1096,29 @@ func (c *WAF) CreateRuleGroupRequest(input *CreateRuleGroupInput) (req *request. // See the AWS API reference guide for AWS WAF's // API operation CreateRuleGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeDisallowedNameException "WAFDisallowedNameException" +// * DisallowedNameException // The name specified is invalid. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeTagOperationException "WAFTagOperationException" +// * TagOperationException // -// * ErrCodeTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * TagOperationInternalErrorException // -// * ErrCodeBadRequestException "WAFBadRequestException" +// * BadRequestException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateRuleGroup func (c *WAF) CreateRuleGroup(input *CreateRuleGroupInput) (*CreateRuleGroupOutput, error) { @@ -1217,23 +1217,23 @@ func (c *WAF) CreateSizeConstraintSetRequest(input *CreateSizeConstraintSetInput // See the AWS API reference guide for AWS WAF's // API operation CreateSizeConstraintSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeDisallowedNameException "WAFDisallowedNameException" +// * DisallowedNameException // The name specified is invalid. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -1262,7 +1262,7 @@ func (c *WAF) CreateSizeConstraintSetRequest(input *CreateSizeConstraintSetInput // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -1361,19 +1361,19 @@ func (c *WAF) CreateSqlInjectionMatchSetRequest(input *CreateSqlInjectionMatchSe // See the AWS API reference guide for AWS WAF's // API operation CreateSqlInjectionMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeDisallowedNameException "WAFDisallowedNameException" +// Returned Error Types: +// * DisallowedNameException // The name specified is invalid. // -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -1402,11 +1402,11 @@ func (c *WAF) CreateSqlInjectionMatchSetRequest(input *CreateSqlInjectionMatchSe // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeStaleDataException "WAFStaleDataException" +// * 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 "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -1517,23 +1517,23 @@ func (c *WAF) CreateWebACLRequest(input *CreateWebACLInput) (req *request.Reques // See the AWS API reference guide for AWS WAF's // API operation CreateWebACL for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeDisallowedNameException "WAFDisallowedNameException" +// * DisallowedNameException // The name specified is invalid. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -1562,17 +1562,17 @@ func (c *WAF) CreateWebACLRequest(input *CreateWebACLInput) (req *request.Reques // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeTagOperationException "WAFTagOperationException" +// * TagOperationException // -// * ErrCodeTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * TagOperationInternalErrorException // -// * ErrCodeBadRequestException "WAFBadRequestException" +// * BadRequestException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/CreateWebACL func (c *WAF) CreateWebACL(input *CreateWebACLInput) (*CreateWebACLOutput, error) { @@ -1668,19 +1668,19 @@ func (c *WAF) CreateXssMatchSetRequest(input *CreateXssMatchSetInput) (req *requ // See the AWS API reference guide for AWS WAF's // API operation CreateXssMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeDisallowedNameException "WAFDisallowedNameException" +// Returned Error Types: +// * DisallowedNameException // The name specified is invalid. // -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -1709,11 +1709,11 @@ func (c *WAF) CreateXssMatchSetRequest(input *CreateXssMatchSetInput) (req *requ // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeStaleDataException "WAFStaleDataException" +// * 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 "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -1808,19 +1808,19 @@ func (c *WAF) DeleteByteMatchSetRequest(input *DeleteByteMatchSetInput) (req *re // See the AWS API reference guide for AWS WAF's // API operation DeleteByteMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -1828,11 +1828,11 @@ func (c *WAF) DeleteByteMatchSetRequest(input *DeleteByteMatchSetInput) (req *re // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeStaleDataException "WAFStaleDataException" +// * 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 "WAFNonEmptyEntityException" +// * NonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -1934,23 +1934,23 @@ func (c *WAF) DeleteGeoMatchSetRequest(input *DeleteGeoMatchSetInput) (req *requ // See the AWS API reference guide for AWS WAF's // API operation DeleteGeoMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -1958,7 +1958,7 @@ func (c *WAF) DeleteGeoMatchSetRequest(input *DeleteGeoMatchSetInput) (req *requ // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeNonEmptyEntityException "WAFNonEmptyEntityException" +// * NonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -2060,23 +2060,23 @@ func (c *WAF) DeleteIPSetRequest(input *DeleteIPSetInput) (req *request.Request, // See the AWS API reference guide for AWS WAF's // API operation DeleteIPSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -2084,7 +2084,7 @@ func (c *WAF) DeleteIPSetRequest(input *DeleteIPSetInput) (req *request.Request, // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeNonEmptyEntityException "WAFNonEmptyEntityException" +// * NonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -2174,15 +2174,15 @@ func (c *WAF) DeleteLoggingConfigurationRequest(input *DeleteLoggingConfiguratio // See the AWS API reference guide for AWS WAF's // API operation DeleteLoggingConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeStaleDataException "WAFStaleDataException" +// * StaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // @@ -2264,16 +2264,16 @@ func (c *WAF) DeletePermissionPolicyRequest(input *DeletePermissionPolicyInput) // See the AWS API reference guide for AWS WAF's // API operation DeletePermissionPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeStaleDataException "WAFStaleDataException" +// * StaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeletePermissionPolicy @@ -2366,23 +2366,23 @@ func (c *WAF) DeleteRateBasedRuleRequest(input *DeleteRateBasedRuleInput) (req * // See the AWS API reference guide for AWS WAF's // API operation DeleteRateBasedRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -2390,7 +2390,7 @@ func (c *WAF) DeleteRateBasedRuleRequest(input *DeleteRateBasedRuleInput) (req * // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeNonEmptyEntityException "WAFNonEmptyEntityException" +// * NonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -2404,9 +2404,9 @@ func (c *WAF) DeleteRateBasedRuleRequest(input *DeleteRateBasedRuleInput) (req * // // * You tried to delete an IPSet that references one or more IP addresses. // -// * ErrCodeTagOperationException "WAFTagOperationException" +// * TagOperationException // -// * ErrCodeTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * TagOperationInternalErrorException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRateBasedRule func (c *WAF) DeleteRateBasedRule(input *DeleteRateBasedRuleInput) (*DeleteRateBasedRuleOutput, error) { @@ -2497,19 +2497,19 @@ func (c *WAF) DeleteRegexMatchSetRequest(input *DeleteRegexMatchSetInput) (req * // See the AWS API reference guide for AWS WAF's // API operation DeleteRegexMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -2517,11 +2517,11 @@ func (c *WAF) DeleteRegexMatchSetRequest(input *DeleteRegexMatchSetInput) (req * // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeStaleDataException "WAFStaleDataException" +// * 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 "WAFNonEmptyEntityException" +// * NonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -2612,19 +2612,19 @@ func (c *WAF) DeleteRegexPatternSetRequest(input *DeleteRegexPatternSetInput) (r // See the AWS API reference guide for AWS WAF's // API operation DeleteRegexPatternSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -2632,11 +2632,11 @@ func (c *WAF) DeleteRegexPatternSetRequest(input *DeleteRegexPatternSetInput) (r // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeStaleDataException "WAFStaleDataException" +// * 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 "WAFNonEmptyEntityException" +// * NonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -2738,23 +2738,23 @@ func (c *WAF) DeleteRuleRequest(input *DeleteRuleInput) (req *request.Request, o // See the AWS API reference guide for AWS WAF's // API operation DeleteRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -2762,7 +2762,7 @@ func (c *WAF) DeleteRuleRequest(input *DeleteRuleInput) (req *request.Request, o // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeNonEmptyEntityException "WAFNonEmptyEntityException" +// * NonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -2776,9 +2776,9 @@ func (c *WAF) DeleteRuleRequest(input *DeleteRuleInput) (req *request.Request, o // // * You tried to delete an IPSet that references one or more IP addresses. // -// * ErrCodeTagOperationException "WAFTagOperationException" +// * TagOperationException // -// * ErrCodeTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * TagOperationInternalErrorException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRule func (c *WAF) DeleteRule(input *DeleteRuleInput) (*DeleteRuleOutput, error) { @@ -2867,19 +2867,19 @@ func (c *WAF) DeleteRuleGroupRequest(input *DeleteRuleGroupInput) (req *request. // See the AWS API reference guide for AWS WAF's // API operation DeleteRuleGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -2887,7 +2887,7 @@ func (c *WAF) DeleteRuleGroupRequest(input *DeleteRuleGroupInput) (req *request. // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeNonEmptyEntityException "WAFNonEmptyEntityException" +// * NonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -2901,7 +2901,7 @@ func (c *WAF) DeleteRuleGroupRequest(input *DeleteRuleGroupInput) (req *request. // // * You tried to delete an IPSet that references one or more IP addresses. // -// * ErrCodeInvalidOperationException "WAFInvalidOperationException" +// * 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 @@ -2919,9 +2919,9 @@ func (c *WAF) DeleteRuleGroupRequest(input *DeleteRuleGroupInput) (req *request. // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeTagOperationException "WAFTagOperationException" +// * TagOperationException // -// * ErrCodeTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * TagOperationInternalErrorException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteRuleGroup func (c *WAF) DeleteRuleGroup(input *DeleteRuleGroupInput) (*DeleteRuleGroupOutput, error) { @@ -3012,23 +3012,23 @@ func (c *WAF) DeleteSizeConstraintSetRequest(input *DeleteSizeConstraintSetInput // See the AWS API reference guide for AWS WAF's // API operation DeleteSizeConstraintSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -3036,7 +3036,7 @@ func (c *WAF) DeleteSizeConstraintSetRequest(input *DeleteSizeConstraintSetInput // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeNonEmptyEntityException "WAFNonEmptyEntityException" +// * NonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -3140,19 +3140,19 @@ func (c *WAF) DeleteSqlInjectionMatchSetRequest(input *DeleteSqlInjectionMatchSe // See the AWS API reference guide for AWS WAF's // API operation DeleteSqlInjectionMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -3160,11 +3160,11 @@ func (c *WAF) DeleteSqlInjectionMatchSetRequest(input *DeleteSqlInjectionMatchSe // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeStaleDataException "WAFStaleDataException" +// * 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 "WAFNonEmptyEntityException" +// * NonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -3263,23 +3263,23 @@ func (c *WAF) DeleteWebACLRequest(input *DeleteWebACLInput) (req *request.Reques // See the AWS API reference guide for AWS WAF's // API operation DeleteWebACL for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -3287,7 +3287,7 @@ func (c *WAF) DeleteWebACLRequest(input *DeleteWebACLInput) (req *request.Reques // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeNonEmptyEntityException "WAFNonEmptyEntityException" +// * NonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -3301,9 +3301,9 @@ func (c *WAF) DeleteWebACLRequest(input *DeleteWebACLInput) (req *request.Reques // // * You tried to delete an IPSet that references one or more IP addresses. // -// * ErrCodeTagOperationException "WAFTagOperationException" +// * TagOperationException // -// * ErrCodeTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * TagOperationInternalErrorException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/DeleteWebACL func (c *WAF) DeleteWebACL(input *DeleteWebACLInput) (*DeleteWebACLOutput, error) { @@ -3394,19 +3394,19 @@ func (c *WAF) DeleteXssMatchSetRequest(input *DeleteXssMatchSetInput) (req *requ // See the AWS API reference guide for AWS WAF's // API operation DeleteXssMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -3414,11 +3414,11 @@ func (c *WAF) DeleteXssMatchSetRequest(input *DeleteXssMatchSetInput) (req *requ // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeStaleDataException "WAFStaleDataException" +// * 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 "WAFNonEmptyEntityException" +// * NonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -3507,16 +3507,16 @@ func (c *WAF) GetByteMatchSetRequest(input *GetByteMatchSetInput) (req *request. // See the AWS API reference guide for AWS WAF's // API operation GetByteMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetByteMatchSet @@ -3608,8 +3608,8 @@ func (c *WAF) GetChangeTokenRequest(input *GetChangeTokenInput) (req *request.Re // See the AWS API reference guide for AWS WAF's // API operation GetChangeToken for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -3698,11 +3698,11 @@ func (c *WAF) GetChangeTokenStatusRequest(input *GetChangeTokenStatusInput) (req // See the AWS API reference guide for AWS WAF's // API operation GetChangeTokenStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// Returned Error Types: +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -3781,16 +3781,16 @@ func (c *WAF) GetGeoMatchSetRequest(input *GetGeoMatchSetInput) (req *request.Re // See the AWS API reference guide for AWS WAF's // API operation GetGeoMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetGeoMatchSet @@ -3868,16 +3868,16 @@ func (c *WAF) GetIPSetRequest(input *GetIPSetInput) (req *request.Request, outpu // See the AWS API reference guide for AWS WAF's // API operation GetIPSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetIPSet @@ -3955,12 +3955,12 @@ func (c *WAF) GetLoggingConfigurationRequest(input *GetLoggingConfigurationInput // See the AWS API reference guide for AWS WAF's // API operation GetLoggingConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetLoggingConfiguration @@ -4038,12 +4038,12 @@ func (c *WAF) GetPermissionPolicyRequest(input *GetPermissionPolicyInput) (req * // See the AWS API reference guide for AWS WAF's // API operation GetPermissionPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetPermissionPolicy @@ -4122,16 +4122,16 @@ func (c *WAF) GetRateBasedRuleRequest(input *GetRateBasedRuleInput) (req *reques // See the AWS API reference guide for AWS WAF's // API operation GetRateBasedRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRateBasedRule @@ -4212,19 +4212,19 @@ func (c *WAF) GetRateBasedRuleManagedKeysRequest(input *GetRateBasedRuleManagedK // See the AWS API reference guide for AWS WAF's // API operation GetRateBasedRuleManagedKeys for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -4328,16 +4328,16 @@ func (c *WAF) GetRegexMatchSetRequest(input *GetRegexMatchSetInput) (req *reques // See the AWS API reference guide for AWS WAF's // API operation GetRegexMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRegexMatchSet @@ -4415,16 +4415,16 @@ func (c *WAF) GetRegexPatternSetRequest(input *GetRegexPatternSetInput) (req *re // See the AWS API reference guide for AWS WAF's // API operation GetRegexPatternSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRegexPatternSet @@ -4503,16 +4503,16 @@ func (c *WAF) GetRuleRequest(input *GetRuleInput) (req *request.Request, output // See the AWS API reference guide for AWS WAF's // API operation GetRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRule @@ -4593,12 +4593,12 @@ func (c *WAF) GetRuleGroupRequest(input *GetRuleGroupInput) (req *request.Reques // See the AWS API reference guide for AWS WAF's // API operation GetRuleGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetRuleGroup @@ -4686,11 +4686,11 @@ func (c *WAF) GetSampledRequestsRequest(input *GetSampledRequestsInput) (req *re // See the AWS API reference guide for AWS WAF's // API operation GetSampledRequests for usage and error information. // -// Returned Error Codes: -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// Returned Error Types: +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -4769,16 +4769,16 @@ func (c *WAF) GetSizeConstraintSetRequest(input *GetSizeConstraintSetInput) (req // See the AWS API reference guide for AWS WAF's // API operation GetSizeConstraintSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSizeConstraintSet @@ -4856,16 +4856,16 @@ func (c *WAF) GetSqlInjectionMatchSetRequest(input *GetSqlInjectionMatchSetInput // See the AWS API reference guide for AWS WAF's // API operation GetSqlInjectionMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetSqlInjectionMatchSet @@ -4943,16 +4943,16 @@ func (c *WAF) GetWebACLRequest(input *GetWebACLInput) (req *request.Request, out // See the AWS API reference guide for AWS WAF's // API operation GetWebACL for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetWebACL @@ -5030,16 +5030,16 @@ func (c *WAF) GetXssMatchSetRequest(input *GetXssMatchSetInput) (req *request.Re // See the AWS API reference guide for AWS WAF's // API operation GetXssMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/GetXssMatchSet @@ -5117,15 +5117,15 @@ func (c *WAF) ListActivatedRulesInRuleGroupRequest(input *ListActivatedRulesInRu // See the AWS API reference guide for AWS WAF's // API operation ListActivatedRulesInRuleGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -5229,12 +5229,12 @@ func (c *WAF) ListByteMatchSetsRequest(input *ListByteMatchSetsInput) (req *requ // See the AWS API reference guide for AWS WAF's // API operation ListByteMatchSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -5313,12 +5313,12 @@ func (c *WAF) ListGeoMatchSetsRequest(input *ListGeoMatchSetsInput) (req *reques // See the AWS API reference guide for AWS WAF's // API operation ListGeoMatchSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -5397,12 +5397,12 @@ func (c *WAF) ListIPSetsRequest(input *ListIPSetsInput) (req *request.Request, o // See the AWS API reference guide for AWS WAF's // API operation ListIPSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -5481,15 +5481,15 @@ func (c *WAF) ListLoggingConfigurationsRequest(input *ListLoggingConfigurationsI // See the AWS API reference guide for AWS WAF's // API operation ListLoggingConfigurations for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -5593,12 +5593,12 @@ func (c *WAF) ListRateBasedRulesRequest(input *ListRateBasedRulesInput) (req *re // See the AWS API reference guide for AWS WAF's // API operation ListRateBasedRules for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -5677,12 +5677,12 @@ func (c *WAF) ListRegexMatchSetsRequest(input *ListRegexMatchSetsInput) (req *re // See the AWS API reference guide for AWS WAF's // API operation ListRegexMatchSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -5761,12 +5761,12 @@ func (c *WAF) ListRegexPatternSetsRequest(input *ListRegexPatternSetsInput) (req // See the AWS API reference guide for AWS WAF's // API operation ListRegexPatternSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -5845,8 +5845,8 @@ func (c *WAF) ListRuleGroupsRequest(input *ListRuleGroupsInput) (req *request.Re // See the AWS API reference guide for AWS WAF's // API operation ListRuleGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -5925,12 +5925,12 @@ func (c *WAF) ListRulesRequest(input *ListRulesInput) (req *request.Request, out // See the AWS API reference guide for AWS WAF's // API operation ListRules for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -6009,12 +6009,12 @@ func (c *WAF) ListSizeConstraintSetsRequest(input *ListSizeConstraintSetsInput) // See the AWS API reference guide for AWS WAF's // API operation ListSizeConstraintSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -6093,12 +6093,12 @@ func (c *WAF) ListSqlInjectionMatchSetsRequest(input *ListSqlInjectionMatchSetsI // See the AWS API reference guide for AWS WAF's // API operation ListSqlInjectionMatchSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -6177,11 +6177,11 @@ func (c *WAF) ListSubscribedRuleGroupsRequest(input *ListSubscribedRuleGroupsInp // See the AWS API reference guide for AWS WAF's // API operation ListSubscribedRuleGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// Returned Error Types: +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -6258,12 +6258,12 @@ func (c *WAF) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req * // See the AWS API reference guide for AWS WAF's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -6292,14 +6292,14 @@ func (c *WAF) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req * // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeBadRequestException "WAFBadRequestException" +// * BadRequestException // -// * ErrCodeTagOperationException "WAFTagOperationException" +// * TagOperationException // -// * ErrCodeTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * TagOperationInternalErrorException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/ListTagsForResource func (c *WAF) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { @@ -6376,12 +6376,12 @@ func (c *WAF) ListWebACLsRequest(input *ListWebACLsInput) (req *request.Request, // See the AWS API reference guide for AWS WAF's // API operation ListWebACLs for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -6460,12 +6460,12 @@ func (c *WAF) ListXssMatchSetsRequest(input *ListXssMatchSetsInput) (req *reques // See the AWS API reference guide for AWS WAF's // API operation ListXssMatchSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -6563,19 +6563,19 @@ func (c *WAF) PutLoggingConfigurationRequest(input *PutLoggingConfigurationInput // See the AWS API reference guide for AWS WAF's // API operation PutLoggingConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeStaleDataException "WAFStaleDataException" +// * StaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeServiceLinkedRoleErrorException "WAFServiceLinkedRoleErrorException" +// * ServiceLinkedRoleErrorException // AWS WAF is not able to access the service linked role. This can be caused // by a previous PutLoggingConfiguration request, which can lock the service // linked role for about 20 seconds. Please try your request again. The service @@ -6687,19 +6687,19 @@ func (c *WAF) PutPermissionPolicyRequest(input *PutPermissionPolicyInput) (req * // See the AWS API reference guide for AWS WAF's // API operation PutPermissionPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeStaleDataException "WAFStaleDataException" +// * StaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeInvalidPermissionPolicyException "WAFInvalidPermissionPolicyException" +// * InvalidPermissionPolicyException // The operation failed because the specified policy is not in the proper format. // // The policy is subject to the following restrictions: @@ -6797,12 +6797,12 @@ func (c *WAF) TagResourceRequest(input *TagResourceInput) (req *request.Request, // See the AWS API reference guide for AWS WAF's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -6831,20 +6831,20 @@ func (c *WAF) TagResourceRequest(input *TagResourceInput) (req *request.Request, // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeBadRequestException "WAFBadRequestException" +// * BadRequestException // -// * ErrCodeTagOperationException "WAFTagOperationException" +// * TagOperationException // -// * ErrCodeTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * TagOperationInternalErrorException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/TagResource func (c *WAF) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { @@ -6920,12 +6920,12 @@ func (c *WAF) UntagResourceRequest(input *UntagResourceInput) (req *request.Requ // See the AWS API reference guide for AWS WAF's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -6954,14 +6954,14 @@ func (c *WAF) UntagResourceRequest(input *UntagResourceInput) (req *request.Requ // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeBadRequestException "WAFBadRequestException" +// * BadRequestException // -// * ErrCodeTagOperationException "WAFTagOperationException" +// * TagOperationException // -// * ErrCodeTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * TagOperationInternalErrorException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UntagResource func (c *WAF) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { @@ -7074,16 +7074,16 @@ func (c *WAF) UpdateByteMatchSetRequest(input *UpdateByteMatchSetInput) (req *re // See the AWS API reference guide for AWS WAF's // API operation UpdateByteMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeInvalidOperationException "WAFInvalidOperationException" +// * 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 @@ -7101,7 +7101,7 @@ func (c *WAF) UpdateByteMatchSetRequest(input *UpdateByteMatchSetInput) (req *re // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -7130,7 +7130,7 @@ func (c *WAF) UpdateByteMatchSetRequest(input *UpdateByteMatchSetInput) (req *re // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeNonexistentContainerException "WAFNonexistentContainerException" +// * 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: // @@ -7146,14 +7146,14 @@ func (c *WAF) UpdateByteMatchSetRequest(input *UpdateByteMatchSetInput) (req *re // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeStaleDataException "WAFStaleDataException" +// * 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 "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -7261,20 +7261,20 @@ func (c *WAF) UpdateGeoMatchSetRequest(input *UpdateGeoMatchSetInput) (req *requ // See the AWS API reference guide for AWS WAF's // API operation UpdateGeoMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeInvalidOperationException "WAFInvalidOperationException" +// * 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 @@ -7292,7 +7292,7 @@ func (c *WAF) UpdateGeoMatchSetRequest(input *UpdateGeoMatchSetInput) (req *requ // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -7321,7 +7321,7 @@ func (c *WAF) UpdateGeoMatchSetRequest(input *UpdateGeoMatchSetInput) (req *requ // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeNonexistentContainerException "WAFNonexistentContainerException" +// * 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: // @@ -7337,10 +7337,10 @@ func (c *WAF) UpdateGeoMatchSetRequest(input *UpdateGeoMatchSetInput) (req *requ // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -7348,7 +7348,7 @@ func (c *WAF) UpdateGeoMatchSetRequest(input *UpdateGeoMatchSetInput) (req *requ // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -7480,20 +7480,20 @@ func (c *WAF) UpdateIPSetRequest(input *UpdateIPSetInput) (req *request.Request, // See the AWS API reference guide for AWS WAF's // API operation UpdateIPSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeInvalidOperationException "WAFInvalidOperationException" +// * 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 @@ -7511,7 +7511,7 @@ func (c *WAF) UpdateIPSetRequest(input *UpdateIPSetInput) (req *request.Request, // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -7540,7 +7540,7 @@ func (c *WAF) UpdateIPSetRequest(input *UpdateIPSetInput) (req *request.Request, // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeNonexistentContainerException "WAFNonexistentContainerException" +// * 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: // @@ -7556,10 +7556,10 @@ func (c *WAF) UpdateIPSetRequest(input *UpdateIPSetInput) (req *request.Request, // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -7567,7 +7567,7 @@ func (c *WAF) UpdateIPSetRequest(input *UpdateIPSetInput) (req *request.Request, // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -7685,20 +7685,20 @@ func (c *WAF) UpdateRateBasedRuleRequest(input *UpdateRateBasedRuleInput) (req * // See the AWS API reference guide for AWS WAF's // API operation UpdateRateBasedRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeInvalidOperationException "WAFInvalidOperationException" +// * 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 @@ -7716,7 +7716,7 @@ func (c *WAF) UpdateRateBasedRuleRequest(input *UpdateRateBasedRuleInput) (req * // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -7745,7 +7745,7 @@ func (c *WAF) UpdateRateBasedRuleRequest(input *UpdateRateBasedRuleInput) (req * // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeNonexistentContainerException "WAFNonexistentContainerException" +// * 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: // @@ -7761,10 +7761,10 @@ func (c *WAF) UpdateRateBasedRuleRequest(input *UpdateRateBasedRuleInput) (req * // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -7772,7 +7772,7 @@ func (c *WAF) UpdateRateBasedRuleRequest(input *UpdateRateBasedRuleInput) (req * // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -7886,28 +7886,28 @@ func (c *WAF) UpdateRegexMatchSetRequest(input *UpdateRegexMatchSetInput) (req * // See the AWS API reference guide for AWS WAF's // API operation UpdateRegexMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeDisallowedNameException "WAFDisallowedNameException" +// * DisallowedNameException // The name specified is invalid. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeNonexistentContainerException "WAFNonexistentContainerException" +// * 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: // @@ -7923,7 +7923,7 @@ func (c *WAF) UpdateRegexMatchSetRequest(input *UpdateRegexMatchSetInput) (req * // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeInvalidOperationException "WAFInvalidOperationException" +// * 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 @@ -7941,7 +7941,7 @@ func (c *WAF) UpdateRegexMatchSetRequest(input *UpdateRegexMatchSetInput) (req * // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -8050,25 +8050,25 @@ func (c *WAF) UpdateRegexPatternSetRequest(input *UpdateRegexPatternSetInput) (r // See the AWS API reference guide for AWS WAF's // API operation UpdateRegexPatternSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeNonexistentContainerException "WAFNonexistentContainerException" +// * 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: // @@ -8084,7 +8084,7 @@ func (c *WAF) UpdateRegexPatternSetRequest(input *UpdateRegexPatternSetInput) (r // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeInvalidOperationException "WAFInvalidOperationException" +// * 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 @@ -8102,11 +8102,11 @@ func (c *WAF) UpdateRegexPatternSetRequest(input *UpdateRegexPatternSetInput) (r // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeInvalidRegexPatternException "WAFInvalidRegexPatternException" +// * InvalidRegexPatternException // The regular expression (regex) you specified in RegexPatternString is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateRegexPatternSet @@ -8217,20 +8217,20 @@ func (c *WAF) UpdateRuleRequest(input *UpdateRuleInput) (req *request.Request, o // See the AWS API reference guide for AWS WAF's // API operation UpdateRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeInvalidOperationException "WAFInvalidOperationException" +// * 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 @@ -8248,7 +8248,7 @@ func (c *WAF) UpdateRuleRequest(input *UpdateRuleInput) (req *request.Request, o // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -8277,7 +8277,7 @@ func (c *WAF) UpdateRuleRequest(input *UpdateRuleInput) (req *request.Request, o // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeNonexistentContainerException "WAFNonexistentContainerException" +// * 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: // @@ -8293,10 +8293,10 @@ func (c *WAF) UpdateRuleRequest(input *UpdateRuleInput) (req *request.Request, o // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -8304,7 +8304,7 @@ func (c *WAF) UpdateRuleRequest(input *UpdateRuleInput) (req *request.Request, o // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -8407,16 +8407,16 @@ func (c *WAF) UpdateRuleGroupRequest(input *UpdateRuleGroupInput) (req *request. // See the AWS API reference guide for AWS WAF's // API operation UpdateRuleGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeNonexistentContainerException "WAFNonexistentContainerException" +// * 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: // @@ -8432,10 +8432,10 @@ func (c *WAF) UpdateRuleGroupRequest(input *UpdateRuleGroupInput) (req *request. // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeInvalidOperationException "WAFInvalidOperationException" +// * 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 @@ -8453,13 +8453,13 @@ func (c *WAF) UpdateRuleGroupRequest(input *UpdateRuleGroupInput) (req *request. // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -8602,20 +8602,20 @@ func (c *WAF) UpdateSizeConstraintSetRequest(input *UpdateSizeConstraintSetInput // See the AWS API reference guide for AWS WAF's // API operation UpdateSizeConstraintSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeInvalidOperationException "WAFInvalidOperationException" +// * 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 @@ -8633,7 +8633,7 @@ func (c *WAF) UpdateSizeConstraintSetRequest(input *UpdateSizeConstraintSetInput // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -8662,7 +8662,7 @@ func (c *WAF) UpdateSizeConstraintSetRequest(input *UpdateSizeConstraintSetInput // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeNonexistentContainerException "WAFNonexistentContainerException" +// * 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: // @@ -8678,10 +8678,10 @@ func (c *WAF) UpdateSizeConstraintSetRequest(input *UpdateSizeConstraintSetInput // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -8689,7 +8689,7 @@ func (c *WAF) UpdateSizeConstraintSetRequest(input *UpdateSizeConstraintSetInput // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -8802,16 +8802,16 @@ func (c *WAF) UpdateSqlInjectionMatchSetRequest(input *UpdateSqlInjectionMatchSe // See the AWS API reference guide for AWS WAF's // API operation UpdateSqlInjectionMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeInvalidOperationException "WAFInvalidOperationException" +// * 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 @@ -8829,7 +8829,7 @@ func (c *WAF) UpdateSqlInjectionMatchSetRequest(input *UpdateSqlInjectionMatchSe // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -8858,7 +8858,7 @@ func (c *WAF) UpdateSqlInjectionMatchSetRequest(input *UpdateSqlInjectionMatchSe // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeNonexistentContainerException "WAFNonexistentContainerException" +// * 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: // @@ -8874,14 +8874,14 @@ func (c *WAF) UpdateSqlInjectionMatchSetRequest(input *UpdateSqlInjectionMatchSe // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeStaleDataException "WAFStaleDataException" +// * 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 "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -9017,20 +9017,20 @@ func (c *WAF) UpdateWebACLRequest(input *UpdateWebACLInput) (req *request.Reques // See the AWS API reference guide for AWS WAF's // API operation UpdateWebACL for usage and error information. // -// Returned Error Codes: -// * ErrCodeStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * 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 "WAFInternalErrorException" +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeInvalidOperationException "WAFInvalidOperationException" +// * 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 @@ -9048,7 +9048,7 @@ func (c *WAF) UpdateWebACLRequest(input *UpdateWebACLInput) (req *request.Reques // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -9077,7 +9077,7 @@ func (c *WAF) UpdateWebACLRequest(input *UpdateWebACLInput) (req *request.Reques // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeNonexistentContainerException "WAFNonexistentContainerException" +// * 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: // @@ -9093,10 +9093,10 @@ func (c *WAF) UpdateWebACLRequest(input *UpdateWebACLInput) (req *request.Reques // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeReferencedItemException "WAFReferencedItemException" +// * ReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -9104,13 +9104,13 @@ func (c *WAF) UpdateWebACLRequest(input *UpdateWebACLInput) (req *request.Reques // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeLimitsExceededException "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeSubscriptionNotFoundException "WAFSubscriptionNotFoundException" +// * SubscriptionNotFoundException // The specified subscription does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-2015-08-24/UpdateWebACL @@ -9220,16 +9220,16 @@ func (c *WAF) UpdateXssMatchSetRequest(input *UpdateXssMatchSetInput) (req *requ // See the AWS API reference guide for AWS WAF's // API operation UpdateXssMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * InternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeInvalidAccountException "WAFInvalidAccountException" +// * InvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeInvalidOperationException "WAFInvalidOperationException" +// * 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 @@ -9247,7 +9247,7 @@ func (c *WAF) UpdateXssMatchSetRequest(input *UpdateXssMatchSetInput) (req *requ // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeInvalidParameterException "WAFInvalidParameterException" +// * InvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -9276,7 +9276,7 @@ func (c *WAF) UpdateXssMatchSetRequest(input *UpdateXssMatchSetInput) (req *requ // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeNonexistentContainerException "WAFNonexistentContainerException" +// * 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: // @@ -9292,14 +9292,14 @@ func (c *WAF) UpdateXssMatchSetRequest(input *UpdateXssMatchSetInput) (req *requ // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeNonexistentItemException "WAFNonexistentItemException" +// * NonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeStaleDataException "WAFStaleDataException" +// * 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 "WAFLimitsExceededException" +// * 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -9516,6 +9516,61 @@ func (s *ActivatedRule) SetType(v string) *ActivatedRule { return s } +type BadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s BadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BadRequestException) GoString() string { + return s.String() +} + +func newErrorBadRequestException(v protocol.ResponseMetadata) error { + return &BadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s BadRequestException) Code() string { + return "WAFBadRequestException" +} + +// Message returns the exception's message. +func (s BadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s BadRequestException) OrigErr() error { + return nil +} + +func (s BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s BadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s BadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + // 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. @@ -12405,6 +12460,62 @@ func (s *DeleteXssMatchSetOutput) SetChangeToken(v string) *DeleteXssMatchSetOut return s } +// The name specified is invalid. +type DisallowedNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s DisallowedNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisallowedNameException) GoString() string { + return s.String() +} + +func newErrorDisallowedNameException(v protocol.ResponseMetadata) error { + return &DisallowedNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DisallowedNameException) Code() string { + return "WAFDisallowedNameException" +} + +// Message returns the exception's message. +func (s DisallowedNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DisallowedNameException) OrigErr() error { + return nil +} + +func (s DisallowedNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DisallowedNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DisallowedNameException) RequestID() string { + return s.respMetadata.RequestID +} + // The rule to exclude from a rule group. This is applicable only when the ActivatedRule // refers to a RuleGroup. The rule must belong to the RuleGroup that is specified // by the ActivatedRule. @@ -14418,255 +14529,720 @@ func (s *IPSetUpdate) SetIPSetDescriptor(v *IPSetDescriptor) *IPSetUpdate { return s } -type ListActivatedRulesInRuleGroupInput struct { - _ struct{} `type:"structure"` - - // Specifies the number of ActivatedRules that you want AWS WAF to return for - // this request. If you have more ActivatedRules than the number that you specify - // for Limit, the response includes a NextMarker value that you can use to get - // another batch of ActivatedRules. - Limit *int64 `type:"integer"` - - // If you specify a value for Limit and you have more ActivatedRules than the - // value of Limit, AWS WAF returns a NextMarker value in the response that allows - // you to list another group of ActivatedRules. For the second and subsequent - // ListActivatedRulesInRuleGroup requests, specify the value of NextMarker from - // the previous response to get information about another batch of ActivatedRules. - NextMarker *string `min:"1" type:"string"` +// The operation failed because of a system problem, even though the request +// was valid. Retry your request. +type InternalErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The RuleGroupId of the RuleGroup for which you want to get a list of ActivatedRule - // objects. - RuleGroupId *string `min:"1" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListActivatedRulesInRuleGroupInput) String() string { +func (s InternalErrorException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListActivatedRulesInRuleGroupInput) GoString() string { +func (s InternalErrorException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListActivatedRulesInRuleGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListActivatedRulesInRuleGroupInput"} - if s.NextMarker != nil && len(*s.NextMarker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) - } - if s.RuleGroupId != nil && len(*s.RuleGroupId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RuleGroupId", 1)) +func newErrorInternalErrorException(v protocol.ResponseMetadata) error { + return &InternalErrorException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InternalErrorException) Code() string { + return "WAFInternalErrorException" +} + +// Message returns the exception's message. +func (s InternalErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetLimit sets the Limit field's value. -func (s *ListActivatedRulesInRuleGroupInput) SetLimit(v int64) *ListActivatedRulesInRuleGroupInput { - s.Limit = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalErrorException) OrigErr() error { + return nil } -// SetNextMarker sets the NextMarker field's value. -func (s *ListActivatedRulesInRuleGroupInput) SetNextMarker(v string) *ListActivatedRulesInRuleGroupInput { - s.NextMarker = &v - return s +func (s InternalErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetRuleGroupId sets the RuleGroupId field's value. -func (s *ListActivatedRulesInRuleGroupInput) SetRuleGroupId(v string) *ListActivatedRulesInRuleGroupInput { - s.RuleGroupId = &v - return s +// Status code returns the HTTP status code for the request's response error. +func (s InternalErrorException) StatusCode() int { + return s.respMetadata.StatusCode } -type ListActivatedRulesInRuleGroupOutput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s InternalErrorException) RequestID() string { + return s.respMetadata.RequestID +} - // An array of ActivatedRules objects. - ActivatedRules []*ActivatedRule `type:"list"` +// The operation failed because you tried to create, update, or delete an object +// by using an invalid account identifier. +type InvalidAccountException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // If you have more ActivatedRules than the number that you specified for Limit - // in the request, the response includes a NextMarker value. To list more ActivatedRules, - // submit another ListActivatedRulesInRuleGroup request, and specify the NextMarker - // value from the response in the NextMarker value in the next request. - NextMarker *string `min:"1" type:"string"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListActivatedRulesInRuleGroupOutput) String() string { +func (s InvalidAccountException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListActivatedRulesInRuleGroupOutput) GoString() string { +func (s InvalidAccountException) GoString() string { return s.String() } -// SetActivatedRules sets the ActivatedRules field's value. -func (s *ListActivatedRulesInRuleGroupOutput) SetActivatedRules(v []*ActivatedRule) *ListActivatedRulesInRuleGroupOutput { - s.ActivatedRules = v - return s +func newErrorInvalidAccountException(v protocol.ResponseMetadata) error { + return &InvalidAccountException{ + respMetadata: v, + } } -// SetNextMarker sets the NextMarker field's value. -func (s *ListActivatedRulesInRuleGroupOutput) SetNextMarker(v string) *ListActivatedRulesInRuleGroupOutput { - s.NextMarker = &v - return s +// Code returns the exception type name. +func (s InvalidAccountException) Code() string { + return "WAFInvalidAccountException" } -type ListByteMatchSetsInput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s InvalidAccountException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // 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"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidAccountException) OrigErr() error { + return nil +} - // 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"` +func (s InvalidAccountException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidAccountException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidAccountException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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 a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple +// already exists in the specified WebACL. +type InvalidOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListByteMatchSetsInput) String() string { +func (s InvalidOperationException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListByteMatchSetsInput) GoString() string { +func (s InvalidOperationException) 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 +func newErrorInvalidOperationException(v protocol.ResponseMetadata) error { + return &InvalidOperationException{ + respMetadata: v, } - return nil } -// SetLimit sets the Limit field's value. -func (s *ListByteMatchSetsInput) SetLimit(v int64) *ListByteMatchSetsInput { - s.Limit = &v - return s +// Code returns the exception type name. +func (s InvalidOperationException) Code() string { + return "WAFInvalidOperationException" } -// SetNextMarker sets the NextMarker field's value. -func (s *ListByteMatchSetsInput) SetNextMarker(v string) *ListByteMatchSetsInput { - s.NextMarker = &v - return s +// Message returns the exception's message. +func (s InvalidOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -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"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidOperationException) OrigErr() error { + return nil } -// String returns the string representation -func (s ListByteMatchSetsOutput) String() string { - return awsutil.Prettify(s) +func (s InvalidOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// GoString returns the string representation -func (s ListByteMatchSetsOutput) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s InvalidOperationException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetByteMatchSets sets the ByteMatchSets field's value. -func (s *ListByteMatchSetsOutput) SetByteMatchSets(v []*ByteMatchSetSummary) *ListByteMatchSetsOutput { - s.ByteMatchSets = v - return s +// RequestID returns the service's response RequestID for request. +func (s InvalidOperationException) RequestID() string { + return s.respMetadata.RequestID } -// SetNextMarker sets the NextMarker field's value. -func (s *ListByteMatchSetsOutput) SetNextMarker(v string) *ListByteMatchSetsOutput { - s.NextMarker = &v - return s -} +// 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 DefaultAction Type other than ALLOW, +// BLOCK, or COUNT. +// +// * You tried to create a RateBasedRule with a RateKey value other than +// IP. +// +// * You tried to update a WebACL with a WafAction Type other than ALLOW, +// BLOCK, or COUNT. +// +// * You tried to update a ByteMatchSet with a FieldToMatch Type other than +// HEADER, METHOD, QUERY_STRING, URI, or BODY. +// +// * 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. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata -type ListGeoMatchSetsInput struct { - _ struct{} `type:"structure"` + Field *string `locationName:"field" type:"string" enum:"ParameterExceptionField"` - // Specifies the number of GeoMatchSet objects that you want AWS WAF to return - // for this request. If you have more GeoMatchSet objects than the number you - // specify for Limit, the response includes a NextMarker value that you can - // use to get another batch of GeoMatchSet objects. - Limit *int64 `type:"integer"` + Message_ *string `locationName:"message" type:"string"` - // If you specify a value for Limit and you have more GeoMatchSets than the - // value of Limit, AWS WAF returns a NextMarker value in the response that allows - // you to list another group of GeoMatchSet objects. For the second and subsequent - // ListGeoMatchSets requests, specify the value of NextMarker from the previous - // response to get information about another batch of GeoMatchSet objects. - NextMarker *string `min:"1" type:"string"` + Parameter *string `locationName:"parameter" min:"1" type:"string"` + + Reason *string `locationName:"reason" type:"string" enum:"ParameterExceptionReason"` } // String returns the string representation -func (s ListGeoMatchSetsInput) String() string { +func (s InvalidParameterException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListGeoMatchSetsInput) GoString() string { +func (s InvalidParameterException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListGeoMatchSetsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListGeoMatchSetsInput"} - if s.NextMarker != nil && len(*s.NextMarker) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "WAFInvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ } - return nil + return "" } -// SetLimit sets the Limit field's value. -func (s *ListGeoMatchSetsInput) SetLimit(v int64) *ListGeoMatchSetsInput { - s.Limit = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil } -// SetNextMarker sets the NextMarker field's value. -func (s *ListGeoMatchSetsInput) SetNextMarker(v string) *ListGeoMatchSetsInput { - s.NextMarker = &v - return s +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -type ListGeoMatchSetsOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} - // An array of GeoMatchSetSummary objects. - GeoMatchSets []*GeoMatchSetSummary `type:"list"` +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} - // If you have more GeoMatchSet objects than the number that you specified for - // Limit in the request, the response includes a NextMarker value. To list more - // GeoMatchSet objects, submit another ListGeoMatchSets request, and specify +// The operation failed because the specified policy is not in the proper format. +// +// The policy is subject to the following restrictions: +// +// * You can attach only one policy with each PutPermissionPolicy request. +// +// * The policy must include an Effect, Action and Principal. +// +// * Effect must specify Allow. +// +// * The Action in the policy must be waf:UpdateWebACL, waf-regional:UpdateWebACL, +// waf:GetRuleGroup and waf-regional:GetRuleGroup . Any extra or wildcard +// actions in the policy will be rejected. +// +// * The policy cannot include a Resource parameter. +// +// * The ARN in the request must be a valid WAF RuleGroup ARN and the RuleGroup +// must exist in the same region. +// +// * The user making the request must be the owner of the RuleGroup. +// +// * Your policy must be composed using IAM Policy version 2012-10-17. +type InvalidPermissionPolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidPermissionPolicyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPermissionPolicyException) GoString() string { + return s.String() +} + +func newErrorInvalidPermissionPolicyException(v protocol.ResponseMetadata) error { + return &InvalidPermissionPolicyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPermissionPolicyException) Code() string { + return "WAFInvalidPermissionPolicyException" +} + +// Message returns the exception's message. +func (s InvalidPermissionPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPermissionPolicyException) OrigErr() error { + return nil +} + +func (s InvalidPermissionPolicyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPermissionPolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPermissionPolicyException) RequestID() string { + return s.respMetadata.RequestID +} + +// The regular expression (regex) you specified in RegexPatternString is invalid. +type InvalidRegexPatternException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s InvalidRegexPatternException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRegexPatternException) GoString() string { + return s.String() +} + +func newErrorInvalidRegexPatternException(v protocol.ResponseMetadata) error { + return &InvalidRegexPatternException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRegexPatternException) Code() string { + return "WAFInvalidRegexPatternException" +} + +// Message returns the exception's message. +func (s InvalidRegexPatternException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRegexPatternException) OrigErr() error { + return nil +} + +func (s InvalidRegexPatternException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRegexPatternException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRegexPatternException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) +// in the AWS WAF Developer Guide. +type LimitsExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s LimitsExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitsExceededException) GoString() string { + return s.String() +} + +func newErrorLimitsExceededException(v protocol.ResponseMetadata) error { + return &LimitsExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitsExceededException) Code() string { + return "WAFLimitsExceededException" +} + +// Message returns the exception's message. +func (s LimitsExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitsExceededException) OrigErr() error { + return nil +} + +func (s LimitsExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitsExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitsExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +type ListActivatedRulesInRuleGroupInput struct { + _ struct{} `type:"structure"` + + // Specifies the number of ActivatedRules that you want AWS WAF to return for + // this request. If you have more ActivatedRules than the number that you specify + // for Limit, the response includes a NextMarker value that you can use to get + // another batch of ActivatedRules. + Limit *int64 `type:"integer"` + + // If you specify a value for Limit and you have more ActivatedRules than the + // value of Limit, AWS WAF returns a NextMarker value in the response that allows + // you to list another group of ActivatedRules. For the second and subsequent + // ListActivatedRulesInRuleGroup requests, specify the value of NextMarker from + // the previous response to get information about another batch of ActivatedRules. + NextMarker *string `min:"1" type:"string"` + + // The RuleGroupId of the RuleGroup for which you want to get a list of ActivatedRule + // objects. + RuleGroupId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListActivatedRulesInRuleGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListActivatedRulesInRuleGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListActivatedRulesInRuleGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListActivatedRulesInRuleGroupInput"} + if s.NextMarker != nil && len(*s.NextMarker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) + } + if s.RuleGroupId != nil && len(*s.RuleGroupId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleGroupId", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLimit sets the Limit field's value. +func (s *ListActivatedRulesInRuleGroupInput) SetLimit(v int64) *ListActivatedRulesInRuleGroupInput { + s.Limit = &v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListActivatedRulesInRuleGroupInput) SetNextMarker(v string) *ListActivatedRulesInRuleGroupInput { + s.NextMarker = &v + return s +} + +// SetRuleGroupId sets the RuleGroupId field's value. +func (s *ListActivatedRulesInRuleGroupInput) SetRuleGroupId(v string) *ListActivatedRulesInRuleGroupInput { + s.RuleGroupId = &v + return s +} + +type ListActivatedRulesInRuleGroupOutput struct { + _ struct{} `type:"structure"` + + // An array of ActivatedRules objects. + ActivatedRules []*ActivatedRule `type:"list"` + + // If you have more ActivatedRules than the number that you specified for Limit + // in the request, the response includes a NextMarker value. To list more ActivatedRules, + // submit another ListActivatedRulesInRuleGroup 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 ListActivatedRulesInRuleGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListActivatedRulesInRuleGroupOutput) GoString() string { + return s.String() +} + +// SetActivatedRules sets the ActivatedRules field's value. +func (s *ListActivatedRulesInRuleGroupOutput) SetActivatedRules(v []*ActivatedRule) *ListActivatedRulesInRuleGroupOutput { + s.ActivatedRules = v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListActivatedRulesInRuleGroupOutput) SetNextMarker(v string) *ListActivatedRulesInRuleGroupOutput { + s.NextMarker = &v + return s +} + +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 +} + +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 +} + +type ListGeoMatchSetsInput struct { + _ struct{} `type:"structure"` + + // Specifies the number of GeoMatchSet objects that you want AWS WAF to return + // for this request. If you have more GeoMatchSet objects than the number you + // specify for Limit, the response includes a NextMarker value that you can + // use to get another batch of GeoMatchSet objects. + Limit *int64 `type:"integer"` + + // If you specify a value for Limit and you have more GeoMatchSets than the + // value of Limit, AWS WAF returns a NextMarker value in the response that allows + // you to list another group of GeoMatchSet objects. For the second and subsequent + // ListGeoMatchSets requests, specify the value of NextMarker from the previous + // response to get information about another batch of GeoMatchSet objects. + NextMarker *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListGeoMatchSetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGeoMatchSetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListGeoMatchSetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListGeoMatchSetsInput"} + 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 *ListGeoMatchSetsInput) SetLimit(v int64) *ListGeoMatchSetsInput { + s.Limit = &v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListGeoMatchSetsInput) SetNextMarker(v string) *ListGeoMatchSetsInput { + s.NextMarker = &v + return s +} + +type ListGeoMatchSetsOutput struct { + _ struct{} `type:"structure"` + + // An array of GeoMatchSetSummary objects. + GeoMatchSets []*GeoMatchSetSummary `type:"list"` + + // If you have more GeoMatchSet objects than the number that you specified for + // Limit in the request, the response includes a NextMarker value. To list more + // GeoMatchSet objects, submit another ListGeoMatchSets request, and specify // the NextMarker value from the response in the NextMarker value in the next // request. NextMarker *string `min:"1" type:"string"` @@ -15810,112 +16386,304 @@ type ListXssMatchSetsOutput struct { // request. NextMarker *string `min:"1" type:"string"` - // An array of XssMatchSetSummary objects. - XssMatchSets []*XssMatchSetSummary `type:"list"` + // 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 +} + +// The Amazon Kinesis Data Firehose, RedactedFields information, and the web +// ACL Amazon Resource Name (ARN). +type LoggingConfiguration struct { + _ struct{} `type:"structure"` + + // An array of Amazon Kinesis Data Firehose ARNs. + // + // LogDestinationConfigs is a required field + LogDestinationConfigs []*string `min:"1" type:"list" required:"true"` + + // The parts of the request that you want redacted from the logs. For example, + // if you redact the cookie field, the cookie field in the firehose will be + // xxx. + RedactedFields []*FieldToMatch `type:"list"` + + // The Amazon Resource Name (ARN) of the web ACL that you want to associate + // with LogDestinationConfigs. + // + // ResourceArn is a required field + ResourceArn *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s LoggingConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LoggingConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LoggingConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LoggingConfiguration"} + if s.LogDestinationConfigs == nil { + invalidParams.Add(request.NewErrParamRequired("LogDestinationConfigs")) + } + if s.LogDestinationConfigs != nil && len(s.LogDestinationConfigs) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LogDestinationConfigs", 1)) + } + 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.RedactedFields != nil { + for i, v := range s.RedactedFields { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RedactedFields", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLogDestinationConfigs sets the LogDestinationConfigs field's value. +func (s *LoggingConfiguration) SetLogDestinationConfigs(v []*string) *LoggingConfiguration { + s.LogDestinationConfigs = v + return s +} + +// SetRedactedFields sets the RedactedFields field's value. +func (s *LoggingConfiguration) SetRedactedFields(v []*FieldToMatch) *LoggingConfiguration { + s.RedactedFields = v + return s +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *LoggingConfiguration) SetResourceArn(v string) *LoggingConfiguration { + s.ResourceArn = &v + return s +} + +// 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. +type NonEmptyEntityException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s NonEmptyEntityException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NonEmptyEntityException) GoString() string { + return s.String() +} + +func newErrorNonEmptyEntityException(v protocol.ResponseMetadata) error { + return &NonEmptyEntityException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NonEmptyEntityException) Code() string { + return "WAFNonEmptyEntityException" +} + +// Message returns the exception's message. +func (s NonEmptyEntityException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NonEmptyEntityException) OrigErr() error { + return nil +} + +func (s NonEmptyEntityException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NonEmptyEntityException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NonEmptyEntityException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type NonexistentContainerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ListXssMatchSetsOutput) String() string { +func (s NonexistentContainerException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListXssMatchSetsOutput) GoString() string { +func (s NonexistentContainerException) GoString() string { return s.String() } -// SetNextMarker sets the NextMarker field's value. -func (s *ListXssMatchSetsOutput) SetNextMarker(v string) *ListXssMatchSetsOutput { - s.NextMarker = &v - return s +func newErrorNonexistentContainerException(v protocol.ResponseMetadata) error { + return &NonexistentContainerException{ + respMetadata: v, + } } -// SetXssMatchSets sets the XssMatchSets field's value. -func (s *ListXssMatchSetsOutput) SetXssMatchSets(v []*XssMatchSetSummary) *ListXssMatchSetsOutput { - s.XssMatchSets = v - return s +// Code returns the exception type name. +func (s NonexistentContainerException) Code() string { + return "WAFNonexistentContainerException" } -// The Amazon Kinesis Data Firehose, RedactedFields information, and the web -// ACL Amazon Resource Name (ARN). -type LoggingConfiguration struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s NonexistentContainerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // An array of Amazon Kinesis Data Firehose ARNs. - // - // LogDestinationConfigs is a required field - LogDestinationConfigs []*string `min:"1" type:"list" required:"true"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NonexistentContainerException) OrigErr() error { + return nil +} - // The parts of the request that you want redacted from the logs. For example, - // if you redact the cookie field, the cookie field in the firehose will be - // xxx. - RedactedFields []*FieldToMatch `type:"list"` +func (s NonexistentContainerException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The Amazon Resource Name (ARN) of the web ACL that you want to associate - // with LogDestinationConfigs. - // - // ResourceArn is a required field - ResourceArn *string `min:"1" type:"string" required:"true"` +// Status code returns the HTTP status code for the request's response error. +func (s NonexistentContainerException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NonexistentContainerException) RequestID() string { + return s.respMetadata.RequestID +} + +// The operation failed because the referenced object doesn't exist. +type NonexistentItemException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s LoggingConfiguration) String() string { +func (s NonexistentItemException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s LoggingConfiguration) GoString() string { +func (s NonexistentItemException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *LoggingConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LoggingConfiguration"} - if s.LogDestinationConfigs == nil { - invalidParams.Add(request.NewErrParamRequired("LogDestinationConfigs")) - } - if s.LogDestinationConfigs != nil && len(s.LogDestinationConfigs) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LogDestinationConfigs", 1)) - } - 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.RedactedFields != nil { - for i, v := range s.RedactedFields { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RedactedFields", i), err.(request.ErrInvalidParams)) - } - } +func newErrorNonexistentItemException(v protocol.ResponseMetadata) error { + return &NonexistentItemException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s NonexistentItemException) Code() string { + return "WAFNonexistentItemException" +} + +// Message returns the exception's message. +func (s NonexistentItemException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NonexistentItemException) OrigErr() error { return nil } -// SetLogDestinationConfigs sets the LogDestinationConfigs field's value. -func (s *LoggingConfiguration) SetLogDestinationConfigs(v []*string) *LoggingConfiguration { - s.LogDestinationConfigs = v - return s +func (s NonexistentItemException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// SetRedactedFields sets the RedactedFields field's value. -func (s *LoggingConfiguration) SetRedactedFields(v []*FieldToMatch) *LoggingConfiguration { - s.RedactedFields = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s NonexistentItemException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetResourceArn sets the ResourceArn field's value. -func (s *LoggingConfiguration) SetResourceArn(v string) *LoggingConfiguration { - s.ResourceArn = &v - return s +// RequestID returns the service's response RequestID for request. +func (s NonexistentItemException) RequestID() string { + return s.respMetadata.RequestID } // Specifies the ByteMatchSet, IPSet, SqlInjectionMatchSet, XssMatchSet, RegexMatchSet, @@ -16254,6 +17022,67 @@ func (s *RateBasedRule) SetRuleId(v string) *RateBasedRule { return s } +// 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. +type ReferencedItemException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ReferencedItemException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReferencedItemException) GoString() string { + return s.String() +} + +func newErrorReferencedItemException(v protocol.ResponseMetadata) error { + return &ReferencedItemException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ReferencedItemException) Code() string { + return "WAFReferencedItemException" +} + +// Message returns the exception's message. +func (s ReferencedItemException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ReferencedItemException) OrigErr() error { + return nil +} + +func (s ReferencedItemException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ReferencedItemException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ReferencedItemException) RequestID() string { + return s.respMetadata.RequestID +} + // In a GetRegexMatchSet request, RegexMatchSet is a complex type that contains // the RegexMatchSetId and Name of a RegexMatchSet, and the values that you // specified when you updated the RegexMatchSet. @@ -17168,6 +17997,69 @@ func (s *SampledHTTPRequest) SetWeight(v int64) *SampledHTTPRequest { return s } +// AWS WAF is not able to access the service linked role. This can be caused +// by a previous PutLoggingConfiguration request, which can lock the service +// linked role for about 20 seconds. Please try your request again. The service +// linked role can also be locked by a previous DeleteServiceLinkedRole request, +// which can lock the role for 15 minutes or more. If you recently made a DeleteServiceLinkedRole, +// wait at least 15 minutes and try the request again. If you receive this same +// exception again, you will have to wait additional time until the role is +// unlocked. +type ServiceLinkedRoleErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s ServiceLinkedRoleErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ServiceLinkedRoleErrorException) GoString() string { + return s.String() +} + +func newErrorServiceLinkedRoleErrorException(v protocol.ResponseMetadata) error { + return &ServiceLinkedRoleErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ServiceLinkedRoleErrorException) Code() string { + return "WAFServiceLinkedRoleErrorException" +} + +// Message returns the exception's message. +func (s ServiceLinkedRoleErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ServiceLinkedRoleErrorException) OrigErr() error { + return nil +} + +func (s ServiceLinkedRoleErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ServiceLinkedRoleErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ServiceLinkedRoleErrorException) RequestID() string { + return s.respMetadata.RequestID +} + // 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 "Size ComparisonOperator size in bytes of FieldToMatch". If @@ -17814,6 +18706,63 @@ func (s *SqlInjectionMatchTuple) SetTextTransformation(v string) *SqlInjectionMa return s } +// The operation failed because you tried to create, update, or delete an object +// by using a change token that has already been used. +type StaleDataException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s StaleDataException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s StaleDataException) GoString() string { + return s.String() +} + +func newErrorStaleDataException(v protocol.ResponseMetadata) error { + return &StaleDataException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s StaleDataException) Code() string { + return "WAFStaleDataException" +} + +// Message returns the exception's message. +func (s StaleDataException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s StaleDataException) OrigErr() error { + return nil +} + +func (s StaleDataException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s StaleDataException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s StaleDataException) RequestID() string { + return s.respMetadata.RequestID +} + // A summary of the rule groups you are subscribed to. type SubscribedRuleGroupSummary struct { _ struct{} `type:"structure"` @@ -17867,6 +18816,62 @@ func (s *SubscribedRuleGroupSummary) SetRuleGroupId(v string) *SubscribedRuleGro return s } +// The specified subscription does not exist. +type SubscriptionNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s SubscriptionNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SubscriptionNotFoundException) GoString() string { + return s.String() +} + +func newErrorSubscriptionNotFoundException(v protocol.ResponseMetadata) error { + return &SubscriptionNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s SubscriptionNotFoundException) Code() string { + return "WAFSubscriptionNotFoundException" +} + +// Message returns the exception's message. +func (s SubscriptionNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s SubscriptionNotFoundException) OrigErr() error { + return nil +} + +func (s SubscriptionNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s SubscriptionNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s SubscriptionNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + type Tag struct { _ struct{} `type:"structure"` @@ -17940,6 +18945,116 @@ func (s *TagInfoForResource) SetTagList(v []*Tag) *TagInfoForResource { return s } +type TagOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TagOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagOperationException) GoString() string { + return s.String() +} + +func newErrorTagOperationException(v protocol.ResponseMetadata) error { + return &TagOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagOperationException) Code() string { + return "WAFTagOperationException" +} + +// Message returns the exception's message. +func (s TagOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagOperationException) OrigErr() error { + return nil +} + +func (s TagOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagOperationException) RequestID() string { + return s.respMetadata.RequestID +} + +type TagOperationInternalErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s TagOperationInternalErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagOperationInternalErrorException) GoString() string { + return s.String() +} + +func newErrorTagOperationInternalErrorException(v protocol.ResponseMetadata) error { + return &TagOperationInternalErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TagOperationInternalErrorException) Code() string { + return "WAFTagOperationInternalErrorException" +} + +// Message returns the exception's message. +func (s TagOperationInternalErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TagOperationInternalErrorException) OrigErr() error { + return nil +} + +func (s TagOperationInternalErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TagOperationInternalErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TagOperationInternalErrorException) RequestID() string { + return s.respMetadata.RequestID +} + type TagResourceInput struct { _ struct{} `type:"structure"` 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 index 32407c2a087..9a71b5b9bd9 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/waf/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/waf/errors.go @@ -2,6 +2,10 @@ package waf +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeBadRequestException for service response error code @@ -210,3 +214,24 @@ const ( // "WAFTagOperationInternalErrorException". ErrCodeTagOperationInternalErrorException = "WAFTagOperationInternalErrorException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "WAFBadRequestException": newErrorBadRequestException, + "WAFDisallowedNameException": newErrorDisallowedNameException, + "WAFInternalErrorException": newErrorInternalErrorException, + "WAFInvalidAccountException": newErrorInvalidAccountException, + "WAFInvalidOperationException": newErrorInvalidOperationException, + "WAFInvalidParameterException": newErrorInvalidParameterException, + "WAFInvalidPermissionPolicyException": newErrorInvalidPermissionPolicyException, + "WAFInvalidRegexPatternException": newErrorInvalidRegexPatternException, + "WAFLimitsExceededException": newErrorLimitsExceededException, + "WAFNonEmptyEntityException": newErrorNonEmptyEntityException, + "WAFNonexistentContainerException": newErrorNonexistentContainerException, + "WAFNonexistentItemException": newErrorNonexistentItemException, + "WAFReferencedItemException": newErrorReferencedItemException, + "WAFServiceLinkedRoleErrorException": newErrorServiceLinkedRoleErrorException, + "WAFStaleDataException": newErrorStaleDataException, + "WAFSubscriptionNotFoundException": newErrorSubscriptionNotFoundException, + "WAFTagOperationException": newErrorTagOperationException, + "WAFTagOperationInternalErrorException": newErrorTagOperationInternalErrorException, +} 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 index 09bf43d9eeb..0271c68fdb5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/waf/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/waf/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "waf" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "WAF" // ServiceID is a unique identifer of a specific service. + ServiceID = "WAF" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the WAF client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a WAF client from just a session. // svc := waf.New(mySession) // @@ -46,11 +49,11 @@ const ( // 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) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *WAF { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *WAF { svc := &WAF{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-08-24", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/wafregional/api.go b/vendor/github.com/aws/aws-sdk-go/service/wafregional/api.go index f3ff4114127..ec82a1dc500 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/wafregional/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/wafregional/api.go @@ -3,6 +3,8 @@ package wafregional import ( + "fmt" + "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/request" @@ -66,16 +68,16 @@ func (c *WAFRegional) AssociateWebACLRequest(input *AssociateWebACLInput) (req * // See the AWS API reference guide for AWS WAF Regional's // API operation AssociateWebACL for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -104,10 +106,10 @@ func (c *WAFRegional) AssociateWebACLRequest(input *AssociateWebACLInput) (req * // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFUnavailableEntityException "WAFUnavailableEntityException" +// * WAFUnavailableEntityException // The operation failed because the entity referenced is temporarily unavailable. // Retry your request. // @@ -207,19 +209,19 @@ func (c *WAFRegional) CreateByteMatchSetRequest(input *waf.CreateByteMatchSetInp // See the AWS API reference guide for AWS WAF Regional's // API operation CreateByteMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFDisallowedNameException "WAFDisallowedNameException" +// Returned Error Types: +// * WAFDisallowedNameException // The name specified is invalid. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -248,11 +250,11 @@ func (c *WAFRegional) CreateByteMatchSetRequest(input *waf.CreateByteMatchSetInp // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -353,23 +355,23 @@ func (c *WAFRegional) CreateGeoMatchSetRequest(input *waf.CreateGeoMatchSetInput // See the AWS API reference guide for AWS WAF Regional's // API operation CreateGeoMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFDisallowedNameException "WAFDisallowedNameException" +// * WAFDisallowedNameException // The name specified is invalid. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -398,7 +400,7 @@ func (c *WAFRegional) CreateGeoMatchSetRequest(input *waf.CreateGeoMatchSetInput // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -500,23 +502,23 @@ func (c *WAFRegional) CreateIPSetRequest(input *waf.CreateIPSetInput) (req *requ // See the AWS API reference guide for AWS WAF Regional's // API operation CreateIPSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFDisallowedNameException "WAFDisallowedNameException" +// * WAFDisallowedNameException // The name specified is invalid. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -545,7 +547,7 @@ func (c *WAFRegional) CreateIPSetRequest(input *waf.CreateIPSetInput) (req *requ // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -686,19 +688,19 @@ func (c *WAFRegional) CreateRateBasedRuleRequest(input *waf.CreateRateBasedRuleI // See the AWS API reference guide for AWS WAF Regional's // API operation CreateRateBasedRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFDisallowedNameException "WAFDisallowedNameException" +// * WAFDisallowedNameException // The name specified is invalid. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -727,17 +729,17 @@ func (c *WAFRegional) CreateRateBasedRuleRequest(input *waf.CreateRateBasedRuleI // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeWAFTagOperationException "WAFTagOperationException" +// * WAFTagOperationException // -// * ErrCodeWAFTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * WAFTagOperationInternalErrorException // -// * ErrCodeWAFBadRequestException "WAFBadRequestException" +// * WAFBadRequestException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/CreateRateBasedRule func (c *WAFRegional) CreateRateBasedRule(input *waf.CreateRateBasedRuleInput) (*waf.CreateRateBasedRuleOutput, error) { @@ -836,19 +838,19 @@ func (c *WAFRegional) CreateRegexMatchSetRequest(input *waf.CreateRegexMatchSetI // See the AWS API reference guide for AWS WAF Regional's // API operation CreateRegexMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFDisallowedNameException "WAFDisallowedNameException" +// * WAFDisallowedNameException // The name specified is invalid. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -947,19 +949,19 @@ func (c *WAFRegional) CreateRegexPatternSetRequest(input *waf.CreateRegexPattern // See the AWS API reference guide for AWS WAF Regional's // API operation CreateRegexPatternSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFDisallowedNameException "WAFDisallowedNameException" +// * WAFDisallowedNameException // The name specified is invalid. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -1075,19 +1077,19 @@ func (c *WAFRegional) CreateRuleRequest(input *waf.CreateRuleInput) (req *reques // See the AWS API reference guide for AWS WAF Regional's // API operation CreateRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFDisallowedNameException "WAFDisallowedNameException" +// * WAFDisallowedNameException // The name specified is invalid. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -1116,17 +1118,17 @@ func (c *WAFRegional) CreateRuleRequest(input *waf.CreateRuleInput) (req *reques // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeWAFTagOperationException "WAFTagOperationException" +// * WAFTagOperationException // -// * ErrCodeWAFTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * WAFTagOperationInternalErrorException // -// * ErrCodeWAFBadRequestException "WAFBadRequestException" +// * WAFBadRequestException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/CreateRule func (c *WAFRegional) CreateRule(input *waf.CreateRuleInput) (*waf.CreateRuleOutput, error) { @@ -1216,29 +1218,29 @@ func (c *WAFRegional) CreateRuleGroupRequest(input *waf.CreateRuleGroupInput) (r // See the AWS API reference guide for AWS WAF Regional's // API operation CreateRuleGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFDisallowedNameException "WAFDisallowedNameException" +// * WAFDisallowedNameException // The name specified is invalid. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeWAFTagOperationException "WAFTagOperationException" +// * WAFTagOperationException // -// * ErrCodeWAFTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * WAFTagOperationInternalErrorException // -// * ErrCodeWAFBadRequestException "WAFBadRequestException" +// * WAFBadRequestException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/CreateRuleGroup func (c *WAFRegional) CreateRuleGroup(input *waf.CreateRuleGroupInput) (*waf.CreateRuleGroupOutput, error) { @@ -1337,23 +1339,23 @@ func (c *WAFRegional) CreateSizeConstraintSetRequest(input *waf.CreateSizeConstr // See the AWS API reference guide for AWS WAF Regional's // API operation CreateSizeConstraintSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFDisallowedNameException "WAFDisallowedNameException" +// * WAFDisallowedNameException // The name specified is invalid. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -1382,7 +1384,7 @@ func (c *WAFRegional) CreateSizeConstraintSetRequest(input *waf.CreateSizeConstr // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -1481,19 +1483,19 @@ func (c *WAFRegional) CreateSqlInjectionMatchSetRequest(input *waf.CreateSqlInje // See the AWS API reference guide for AWS WAF Regional's // API operation CreateSqlInjectionMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFDisallowedNameException "WAFDisallowedNameException" +// Returned Error Types: +// * WAFDisallowedNameException // The name specified is invalid. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -1522,11 +1524,11 @@ func (c *WAFRegional) CreateSqlInjectionMatchSetRequest(input *waf.CreateSqlInje // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -1637,23 +1639,23 @@ func (c *WAFRegional) CreateWebACLRequest(input *waf.CreateWebACLInput) (req *re // See the AWS API reference guide for AWS WAF Regional's // API operation CreateWebACL for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFDisallowedNameException "WAFDisallowedNameException" +// * WAFDisallowedNameException // The name specified is invalid. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -1682,17 +1684,17 @@ func (c *WAFRegional) CreateWebACLRequest(input *waf.CreateWebACLInput) (req *re // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeWAFTagOperationException "WAFTagOperationException" +// * WAFTagOperationException // -// * ErrCodeWAFTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * WAFTagOperationInternalErrorException // -// * ErrCodeWAFBadRequestException "WAFBadRequestException" +// * WAFBadRequestException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/CreateWebACL func (c *WAFRegional) CreateWebACL(input *waf.CreateWebACLInput) (*waf.CreateWebACLOutput, error) { @@ -1788,19 +1790,19 @@ func (c *WAFRegional) CreateXssMatchSetRequest(input *waf.CreateXssMatchSetInput // See the AWS API reference guide for AWS WAF Regional's // API operation CreateXssMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFDisallowedNameException "WAFDisallowedNameException" +// Returned Error Types: +// * WAFDisallowedNameException // The name specified is invalid. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -1829,11 +1831,11 @@ func (c *WAFRegional) CreateXssMatchSetRequest(input *waf.CreateXssMatchSetInput // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -1928,19 +1930,19 @@ func (c *WAFRegional) DeleteByteMatchSetRequest(input *waf.DeleteByteMatchSetInp // See the AWS API reference guide for AWS WAF Regional's // API operation DeleteByteMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -1948,11 +1950,11 @@ func (c *WAFRegional) DeleteByteMatchSetRequest(input *waf.DeleteByteMatchSetInp // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFNonEmptyEntityException "WAFNonEmptyEntityException" +// * WAFNonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -2054,23 +2056,23 @@ func (c *WAFRegional) DeleteGeoMatchSetRequest(input *waf.DeleteGeoMatchSetInput // See the AWS API reference guide for AWS WAF Regional's // API operation DeleteGeoMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -2078,7 +2080,7 @@ func (c *WAFRegional) DeleteGeoMatchSetRequest(input *waf.DeleteGeoMatchSetInput // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFNonEmptyEntityException "WAFNonEmptyEntityException" +// * WAFNonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -2180,23 +2182,23 @@ func (c *WAFRegional) DeleteIPSetRequest(input *waf.DeleteIPSetInput) (req *requ // See the AWS API reference guide for AWS WAF Regional's // API operation DeleteIPSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -2204,7 +2206,7 @@ func (c *WAFRegional) DeleteIPSetRequest(input *waf.DeleteIPSetInput) (req *requ // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFNonEmptyEntityException "WAFNonEmptyEntityException" +// * WAFNonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -2294,15 +2296,15 @@ func (c *WAFRegional) DeleteLoggingConfigurationRequest(input *waf.DeleteLogging // See the AWS API reference guide for AWS WAF Regional's // API operation DeleteLoggingConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // @@ -2384,16 +2386,16 @@ func (c *WAFRegional) DeletePermissionPolicyRequest(input *waf.DeletePermissionP // See the AWS API reference guide for AWS WAF Regional's // API operation DeletePermissionPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/DeletePermissionPolicy @@ -2486,23 +2488,23 @@ func (c *WAFRegional) DeleteRateBasedRuleRequest(input *waf.DeleteRateBasedRuleI // See the AWS API reference guide for AWS WAF Regional's // API operation DeleteRateBasedRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -2510,7 +2512,7 @@ func (c *WAFRegional) DeleteRateBasedRuleRequest(input *waf.DeleteRateBasedRuleI // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFNonEmptyEntityException "WAFNonEmptyEntityException" +// * WAFNonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -2524,9 +2526,9 @@ func (c *WAFRegional) DeleteRateBasedRuleRequest(input *waf.DeleteRateBasedRuleI // // * You tried to delete an IPSet that references one or more IP addresses. // -// * ErrCodeWAFTagOperationException "WAFTagOperationException" +// * WAFTagOperationException // -// * ErrCodeWAFTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * WAFTagOperationInternalErrorException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/DeleteRateBasedRule func (c *WAFRegional) DeleteRateBasedRule(input *waf.DeleteRateBasedRuleInput) (*waf.DeleteRateBasedRuleOutput, error) { @@ -2617,19 +2619,19 @@ func (c *WAFRegional) DeleteRegexMatchSetRequest(input *waf.DeleteRegexMatchSetI // See the AWS API reference guide for AWS WAF Regional's // API operation DeleteRegexMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -2637,11 +2639,11 @@ func (c *WAFRegional) DeleteRegexMatchSetRequest(input *waf.DeleteRegexMatchSetI // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFNonEmptyEntityException "WAFNonEmptyEntityException" +// * WAFNonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -2732,19 +2734,19 @@ func (c *WAFRegional) DeleteRegexPatternSetRequest(input *waf.DeleteRegexPattern // See the AWS API reference guide for AWS WAF Regional's // API operation DeleteRegexPatternSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -2752,11 +2754,11 @@ func (c *WAFRegional) DeleteRegexPatternSetRequest(input *waf.DeleteRegexPattern // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFNonEmptyEntityException "WAFNonEmptyEntityException" +// * WAFNonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -2858,23 +2860,23 @@ func (c *WAFRegional) DeleteRuleRequest(input *waf.DeleteRuleInput) (req *reques // See the AWS API reference guide for AWS WAF Regional's // API operation DeleteRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -2882,7 +2884,7 @@ func (c *WAFRegional) DeleteRuleRequest(input *waf.DeleteRuleInput) (req *reques // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFNonEmptyEntityException "WAFNonEmptyEntityException" +// * WAFNonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -2896,9 +2898,9 @@ func (c *WAFRegional) DeleteRuleRequest(input *waf.DeleteRuleInput) (req *reques // // * You tried to delete an IPSet that references one or more IP addresses. // -// * ErrCodeWAFTagOperationException "WAFTagOperationException" +// * WAFTagOperationException // -// * ErrCodeWAFTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * WAFTagOperationInternalErrorException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/DeleteRule func (c *WAFRegional) DeleteRule(input *waf.DeleteRuleInput) (*waf.DeleteRuleOutput, error) { @@ -2987,19 +2989,19 @@ func (c *WAFRegional) DeleteRuleGroupRequest(input *waf.DeleteRuleGroupInput) (r // See the AWS API reference guide for AWS WAF Regional's // API operation DeleteRuleGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -3007,7 +3009,7 @@ func (c *WAFRegional) DeleteRuleGroupRequest(input *waf.DeleteRuleGroupInput) (r // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFNonEmptyEntityException "WAFNonEmptyEntityException" +// * WAFNonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -3021,7 +3023,7 @@ func (c *WAFRegional) DeleteRuleGroupRequest(input *waf.DeleteRuleGroupInput) (r // // * You tried to delete an IPSet that references one or more IP addresses. // -// * ErrCodeWAFInvalidOperationException "WAFInvalidOperationException" +// * WAFInvalidOperationException // 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 @@ -3039,9 +3041,9 @@ func (c *WAFRegional) DeleteRuleGroupRequest(input *waf.DeleteRuleGroupInput) (r // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeWAFTagOperationException "WAFTagOperationException" +// * WAFTagOperationException // -// * ErrCodeWAFTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * WAFTagOperationInternalErrorException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/DeleteRuleGroup func (c *WAFRegional) DeleteRuleGroup(input *waf.DeleteRuleGroupInput) (*waf.DeleteRuleGroupOutput, error) { @@ -3132,23 +3134,23 @@ func (c *WAFRegional) DeleteSizeConstraintSetRequest(input *waf.DeleteSizeConstr // See the AWS API reference guide for AWS WAF Regional's // API operation DeleteSizeConstraintSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -3156,7 +3158,7 @@ func (c *WAFRegional) DeleteSizeConstraintSetRequest(input *waf.DeleteSizeConstr // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFNonEmptyEntityException "WAFNonEmptyEntityException" +// * WAFNonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -3260,19 +3262,19 @@ func (c *WAFRegional) DeleteSqlInjectionMatchSetRequest(input *waf.DeleteSqlInje // See the AWS API reference guide for AWS WAF Regional's // API operation DeleteSqlInjectionMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -3280,11 +3282,11 @@ func (c *WAFRegional) DeleteSqlInjectionMatchSetRequest(input *waf.DeleteSqlInje // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFNonEmptyEntityException "WAFNonEmptyEntityException" +// * WAFNonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -3383,23 +3385,23 @@ func (c *WAFRegional) DeleteWebACLRequest(input *waf.DeleteWebACLInput) (req *re // See the AWS API reference guide for AWS WAF Regional's // API operation DeleteWebACL for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -3407,7 +3409,7 @@ func (c *WAFRegional) DeleteWebACLRequest(input *waf.DeleteWebACLInput) (req *re // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFNonEmptyEntityException "WAFNonEmptyEntityException" +// * WAFNonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -3421,9 +3423,9 @@ func (c *WAFRegional) DeleteWebACLRequest(input *waf.DeleteWebACLInput) (req *re // // * You tried to delete an IPSet that references one or more IP addresses. // -// * ErrCodeWAFTagOperationException "WAFTagOperationException" +// * WAFTagOperationException // -// * ErrCodeWAFTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * WAFTagOperationInternalErrorException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/DeleteWebACL func (c *WAFRegional) DeleteWebACL(input *waf.DeleteWebACLInput) (*waf.DeleteWebACLOutput, error) { @@ -3514,19 +3516,19 @@ func (c *WAFRegional) DeleteXssMatchSetRequest(input *waf.DeleteXssMatchSetInput // See the AWS API reference guide for AWS WAF Regional's // API operation DeleteXssMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -3534,11 +3536,11 @@ func (c *WAFRegional) DeleteXssMatchSetRequest(input *waf.DeleteXssMatchSetInput // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFNonEmptyEntityException "WAFNonEmptyEntityException" +// * WAFNonEmptyEntityException // The operation failed because you tried to delete an object that isn't empty. // For example: // @@ -3629,16 +3631,16 @@ func (c *WAFRegional) DisassociateWebACLRequest(input *DisassociateWebACLInput) // See the AWS API reference guide for AWS WAF Regional's // API operation DisassociateWebACL for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -3667,7 +3669,7 @@ func (c *WAFRegional) DisassociateWebACLRequest(input *DisassociateWebACLInput) // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/DisassociateWebACL @@ -3745,16 +3747,16 @@ func (c *WAFRegional) GetByteMatchSetRequest(input *waf.GetByteMatchSetInput) (r // See the AWS API reference guide for AWS WAF Regional's // API operation GetByteMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/GetByteMatchSet @@ -3846,8 +3848,8 @@ func (c *WAFRegional) GetChangeTokenRequest(input *waf.GetChangeTokenInput) (req // See the AWS API reference guide for AWS WAF Regional's // API operation GetChangeToken for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -3936,11 +3938,11 @@ func (c *WAFRegional) GetChangeTokenStatusRequest(input *waf.GetChangeTokenStatu // See the AWS API reference guide for AWS WAF Regional's // API operation GetChangeTokenStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// Returned Error Types: +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -4019,16 +4021,16 @@ func (c *WAFRegional) GetGeoMatchSetRequest(input *waf.GetGeoMatchSetInput) (req // See the AWS API reference guide for AWS WAF Regional's // API operation GetGeoMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/GetGeoMatchSet @@ -4106,16 +4108,16 @@ func (c *WAFRegional) GetIPSetRequest(input *waf.GetIPSetInput) (req *request.Re // See the AWS API reference guide for AWS WAF Regional's // API operation GetIPSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/GetIPSet @@ -4193,12 +4195,12 @@ func (c *WAFRegional) GetLoggingConfigurationRequest(input *waf.GetLoggingConfig // See the AWS API reference guide for AWS WAF Regional's // API operation GetLoggingConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/GetLoggingConfiguration @@ -4276,12 +4278,12 @@ func (c *WAFRegional) GetPermissionPolicyRequest(input *waf.GetPermissionPolicyI // See the AWS API reference guide for AWS WAF Regional's // API operation GetPermissionPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/GetPermissionPolicy @@ -4360,16 +4362,16 @@ func (c *WAFRegional) GetRateBasedRuleRequest(input *waf.GetRateBasedRuleInput) // See the AWS API reference guide for AWS WAF Regional's // API operation GetRateBasedRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/GetRateBasedRule @@ -4450,19 +4452,19 @@ func (c *WAFRegional) GetRateBasedRuleManagedKeysRequest(input *waf.GetRateBased // See the AWS API reference guide for AWS WAF Regional's // API operation GetRateBasedRuleManagedKeys for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -4566,16 +4568,16 @@ func (c *WAFRegional) GetRegexMatchSetRequest(input *waf.GetRegexMatchSetInput) // See the AWS API reference guide for AWS WAF Regional's // API operation GetRegexMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/GetRegexMatchSet @@ -4653,16 +4655,16 @@ func (c *WAFRegional) GetRegexPatternSetRequest(input *waf.GetRegexPatternSetInp // See the AWS API reference guide for AWS WAF Regional's // API operation GetRegexPatternSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/GetRegexPatternSet @@ -4741,16 +4743,16 @@ func (c *WAFRegional) GetRuleRequest(input *waf.GetRuleInput) (req *request.Requ // See the AWS API reference guide for AWS WAF Regional's // API operation GetRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/GetRule @@ -4831,12 +4833,12 @@ func (c *WAFRegional) GetRuleGroupRequest(input *waf.GetRuleGroupInput) (req *re // See the AWS API reference guide for AWS WAF Regional's // API operation GetRuleGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/GetRuleGroup @@ -4924,11 +4926,11 @@ func (c *WAFRegional) GetSampledRequestsRequest(input *waf.GetSampledRequestsInp // See the AWS API reference guide for AWS WAF Regional's // API operation GetSampledRequests for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// Returned Error Types: +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -5007,16 +5009,16 @@ func (c *WAFRegional) GetSizeConstraintSetRequest(input *waf.GetSizeConstraintSe // See the AWS API reference guide for AWS WAF Regional's // API operation GetSizeConstraintSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/GetSizeConstraintSet @@ -5094,16 +5096,16 @@ func (c *WAFRegional) GetSqlInjectionMatchSetRequest(input *waf.GetSqlInjectionM // See the AWS API reference guide for AWS WAF Regional's // API operation GetSqlInjectionMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/GetSqlInjectionMatchSet @@ -5181,16 +5183,16 @@ func (c *WAFRegional) GetWebACLRequest(input *waf.GetWebACLInput) (req *request. // See the AWS API reference guide for AWS WAF Regional's // API operation GetWebACL for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/GetWebACL @@ -5269,19 +5271,19 @@ func (c *WAFRegional) GetWebACLForResourceRequest(input *GetWebACLForResourceInp // See the AWS API reference guide for AWS WAF Regional's // API operation GetWebACLForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -5310,7 +5312,7 @@ func (c *WAFRegional) GetWebACLForResourceRequest(input *GetWebACLForResourceInp // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFUnavailableEntityException "WAFUnavailableEntityException" +// * WAFUnavailableEntityException // The operation failed because the entity referenced is temporarily unavailable. // Retry your request. // @@ -5389,16 +5391,16 @@ func (c *WAFRegional) GetXssMatchSetRequest(input *waf.GetXssMatchSetInput) (req // See the AWS API reference guide for AWS WAF Regional's // API operation GetXssMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/GetXssMatchSet @@ -5476,15 +5478,15 @@ func (c *WAFRegional) ListActivatedRulesInRuleGroupRequest(input *waf.ListActiva // See the AWS API reference guide for AWS WAF Regional's // API operation ListActivatedRulesInRuleGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -5588,12 +5590,12 @@ func (c *WAFRegional) ListByteMatchSetsRequest(input *waf.ListByteMatchSetsInput // See the AWS API reference guide for AWS WAF Regional's // API operation ListByteMatchSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -5672,12 +5674,12 @@ func (c *WAFRegional) ListGeoMatchSetsRequest(input *waf.ListGeoMatchSetsInput) // See the AWS API reference guide for AWS WAF Regional's // API operation ListGeoMatchSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -5756,12 +5758,12 @@ func (c *WAFRegional) ListIPSetsRequest(input *waf.ListIPSetsInput) (req *reques // See the AWS API reference guide for AWS WAF Regional's // API operation ListIPSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -5840,15 +5842,15 @@ func (c *WAFRegional) ListLoggingConfigurationsRequest(input *waf.ListLoggingCon // See the AWS API reference guide for AWS WAF Regional's // API operation ListLoggingConfigurations for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -5952,12 +5954,12 @@ func (c *WAFRegional) ListRateBasedRulesRequest(input *waf.ListRateBasedRulesInp // See the AWS API reference guide for AWS WAF Regional's // API operation ListRateBasedRules for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -6036,12 +6038,12 @@ func (c *WAFRegional) ListRegexMatchSetsRequest(input *waf.ListRegexMatchSetsInp // See the AWS API reference guide for AWS WAF Regional's // API operation ListRegexMatchSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -6120,12 +6122,12 @@ func (c *WAFRegional) ListRegexPatternSetsRequest(input *waf.ListRegexPatternSet // See the AWS API reference guide for AWS WAF Regional's // API operation ListRegexPatternSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -6204,19 +6206,19 @@ func (c *WAFRegional) ListResourcesForWebACLRequest(input *ListResourcesForWebAC // See the AWS API reference guide for AWS WAF Regional's // API operation ListResourcesForWebACL for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -6320,8 +6322,8 @@ func (c *WAFRegional) ListRuleGroupsRequest(input *waf.ListRuleGroupsInput) (req // See the AWS API reference guide for AWS WAF Regional's // API operation ListRuleGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -6400,12 +6402,12 @@ func (c *WAFRegional) ListRulesRequest(input *waf.ListRulesInput) (req *request. // See the AWS API reference guide for AWS WAF Regional's // API operation ListRules for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -6484,12 +6486,12 @@ func (c *WAFRegional) ListSizeConstraintSetsRequest(input *waf.ListSizeConstrain // See the AWS API reference guide for AWS WAF Regional's // API operation ListSizeConstraintSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -6568,12 +6570,12 @@ func (c *WAFRegional) ListSqlInjectionMatchSetsRequest(input *waf.ListSqlInjecti // See the AWS API reference guide for AWS WAF Regional's // API operation ListSqlInjectionMatchSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -6652,11 +6654,11 @@ func (c *WAFRegional) ListSubscribedRuleGroupsRequest(input *waf.ListSubscribedR // See the AWS API reference guide for AWS WAF Regional's // API operation ListSubscribedRuleGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// Returned Error Types: +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // @@ -6733,12 +6735,12 @@ func (c *WAFRegional) ListTagsForResourceRequest(input *waf.ListTagsForResourceI // See the AWS API reference guide for AWS WAF Regional's // API operation ListTagsForResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -6767,14 +6769,14 @@ func (c *WAFRegional) ListTagsForResourceRequest(input *waf.ListTagsForResourceI // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFBadRequestException "WAFBadRequestException" +// * WAFBadRequestException // -// * ErrCodeWAFTagOperationException "WAFTagOperationException" +// * WAFTagOperationException // -// * ErrCodeWAFTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * WAFTagOperationInternalErrorException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/ListTagsForResource func (c *WAFRegional) ListTagsForResource(input *waf.ListTagsForResourceInput) (*waf.ListTagsForResourceOutput, error) { @@ -6851,12 +6853,12 @@ func (c *WAFRegional) ListWebACLsRequest(input *waf.ListWebACLsInput) (req *requ // See the AWS API reference guide for AWS WAF Regional's // API operation ListWebACLs for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -6935,12 +6937,12 @@ func (c *WAFRegional) ListXssMatchSetsRequest(input *waf.ListXssMatchSetsInput) // See the AWS API reference guide for AWS WAF Regional's // API operation ListXssMatchSets for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -7038,19 +7040,19 @@ func (c *WAFRegional) PutLoggingConfigurationRequest(input *waf.PutLoggingConfig // See the AWS API reference guide for AWS WAF Regional's // API operation PutLoggingConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFServiceLinkedRoleErrorException "WAFServiceLinkedRoleErrorException" +// * WAFServiceLinkedRoleErrorException // AWS WAF is not able to access the service linked role. This can be caused // by a previous PutLoggingConfiguration request, which can lock the service // linked role for about 20 seconds. Please try your request again. The service @@ -7162,19 +7164,19 @@ func (c *WAFRegional) PutPermissionPolicyRequest(input *waf.PutPermissionPolicyI // See the AWS API reference guide for AWS WAF Regional's // API operation PutPermissionPolicy for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFInvalidPermissionPolicyException "WAFInvalidPermissionPolicyException" +// * WAFInvalidPermissionPolicyException // The operation failed because the specified policy is not in the proper format. // // The policy is subject to the following restrictions: @@ -7272,12 +7274,12 @@ func (c *WAFRegional) TagResourceRequest(input *waf.TagResourceInput) (req *requ // See the AWS API reference guide for AWS WAF Regional's // API operation TagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -7306,20 +7308,20 @@ func (c *WAFRegional) TagResourceRequest(input *waf.TagResourceInput) (req *requ // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFBadRequestException "WAFBadRequestException" +// * WAFBadRequestException // -// * ErrCodeWAFTagOperationException "WAFTagOperationException" +// * WAFTagOperationException // -// * ErrCodeWAFTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * WAFTagOperationInternalErrorException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/TagResource func (c *WAFRegional) TagResource(input *waf.TagResourceInput) (*waf.TagResourceOutput, error) { @@ -7395,12 +7397,12 @@ func (c *WAFRegional) UntagResourceRequest(input *waf.UntagResourceInput) (req * // See the AWS API reference guide for AWS WAF Regional's // API operation UntagResource for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -7429,14 +7431,14 @@ func (c *WAFRegional) UntagResourceRequest(input *waf.UntagResourceInput) (req * // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFBadRequestException "WAFBadRequestException" +// * WAFBadRequestException // -// * ErrCodeWAFTagOperationException "WAFTagOperationException" +// * WAFTagOperationException // -// * ErrCodeWAFTagOperationInternalErrorException "WAFTagOperationInternalErrorException" +// * WAFTagOperationInternalErrorException // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/UntagResource func (c *WAFRegional) UntagResource(input *waf.UntagResourceInput) (*waf.UntagResourceOutput, error) { @@ -7549,16 +7551,16 @@ func (c *WAFRegional) UpdateByteMatchSetRequest(input *waf.UpdateByteMatchSetInp // See the AWS API reference guide for AWS WAF Regional's // API operation UpdateByteMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFInvalidOperationException "WAFInvalidOperationException" +// * WAFInvalidOperationException // 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 @@ -7576,7 +7578,7 @@ func (c *WAFRegional) UpdateByteMatchSetRequest(input *waf.UpdateByteMatchSetInp // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -7605,7 +7607,7 @@ func (c *WAFRegional) UpdateByteMatchSetRequest(input *waf.UpdateByteMatchSetInp // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFNonexistentContainerException "WAFNonexistentContainerException" +// * WAFNonexistentContainerException // The operation failed because you tried to add an object to or delete an object // from another object that doesn't exist. For example: // @@ -7621,14 +7623,14 @@ func (c *WAFRegional) UpdateByteMatchSetRequest(input *waf.UpdateByteMatchSetInp // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -7736,20 +7738,20 @@ func (c *WAFRegional) UpdateGeoMatchSetRequest(input *waf.UpdateGeoMatchSetInput // See the AWS API reference guide for AWS WAF Regional's // API operation UpdateGeoMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFInvalidOperationException "WAFInvalidOperationException" +// * WAFInvalidOperationException // 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 @@ -7767,7 +7769,7 @@ func (c *WAFRegional) UpdateGeoMatchSetRequest(input *waf.UpdateGeoMatchSetInput // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -7796,7 +7798,7 @@ func (c *WAFRegional) UpdateGeoMatchSetRequest(input *waf.UpdateGeoMatchSetInput // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFNonexistentContainerException "WAFNonexistentContainerException" +// * WAFNonexistentContainerException // The operation failed because you tried to add an object to or delete an object // from another object that doesn't exist. For example: // @@ -7812,10 +7814,10 @@ func (c *WAFRegional) UpdateGeoMatchSetRequest(input *waf.UpdateGeoMatchSetInput // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -7823,7 +7825,7 @@ func (c *WAFRegional) UpdateGeoMatchSetRequest(input *waf.UpdateGeoMatchSetInput // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -7955,20 +7957,20 @@ func (c *WAFRegional) UpdateIPSetRequest(input *waf.UpdateIPSetInput) (req *requ // See the AWS API reference guide for AWS WAF Regional's // API operation UpdateIPSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFInvalidOperationException "WAFInvalidOperationException" +// * WAFInvalidOperationException // 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 @@ -7986,7 +7988,7 @@ func (c *WAFRegional) UpdateIPSetRequest(input *waf.UpdateIPSetInput) (req *requ // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -8015,7 +8017,7 @@ func (c *WAFRegional) UpdateIPSetRequest(input *waf.UpdateIPSetInput) (req *requ // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFNonexistentContainerException "WAFNonexistentContainerException" +// * WAFNonexistentContainerException // The operation failed because you tried to add an object to or delete an object // from another object that doesn't exist. For example: // @@ -8031,10 +8033,10 @@ func (c *WAFRegional) UpdateIPSetRequest(input *waf.UpdateIPSetInput) (req *requ // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -8042,7 +8044,7 @@ func (c *WAFRegional) UpdateIPSetRequest(input *waf.UpdateIPSetInput) (req *requ // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -8160,20 +8162,20 @@ func (c *WAFRegional) UpdateRateBasedRuleRequest(input *waf.UpdateRateBasedRuleI // See the AWS API reference guide for AWS WAF Regional's // API operation UpdateRateBasedRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFInvalidOperationException "WAFInvalidOperationException" +// * WAFInvalidOperationException // 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 @@ -8191,7 +8193,7 @@ func (c *WAFRegional) UpdateRateBasedRuleRequest(input *waf.UpdateRateBasedRuleI // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -8220,7 +8222,7 @@ func (c *WAFRegional) UpdateRateBasedRuleRequest(input *waf.UpdateRateBasedRuleI // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFNonexistentContainerException "WAFNonexistentContainerException" +// * WAFNonexistentContainerException // The operation failed because you tried to add an object to or delete an object // from another object that doesn't exist. For example: // @@ -8236,10 +8238,10 @@ func (c *WAFRegional) UpdateRateBasedRuleRequest(input *waf.UpdateRateBasedRuleI // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -8247,7 +8249,7 @@ func (c *WAFRegional) UpdateRateBasedRuleRequest(input *waf.UpdateRateBasedRuleI // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -8361,28 +8363,28 @@ func (c *WAFRegional) UpdateRegexMatchSetRequest(input *waf.UpdateRegexMatchSetI // See the AWS API reference guide for AWS WAF Regional's // API operation UpdateRegexMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFDisallowedNameException "WAFDisallowedNameException" +// * WAFDisallowedNameException // The name specified is invalid. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFNonexistentContainerException "WAFNonexistentContainerException" +// * WAFNonexistentContainerException // The operation failed because you tried to add an object to or delete an object // from another object that doesn't exist. For example: // @@ -8398,7 +8400,7 @@ func (c *WAFRegional) UpdateRegexMatchSetRequest(input *waf.UpdateRegexMatchSetI // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeWAFInvalidOperationException "WAFInvalidOperationException" +// * WAFInvalidOperationException // 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 @@ -8416,7 +8418,7 @@ func (c *WAFRegional) UpdateRegexMatchSetRequest(input *waf.UpdateRegexMatchSetI // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // @@ -8525,25 +8527,25 @@ func (c *WAFRegional) UpdateRegexPatternSetRequest(input *waf.UpdateRegexPattern // See the AWS API reference guide for AWS WAF Regional's // API operation UpdateRegexPatternSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFNonexistentContainerException "WAFNonexistentContainerException" +// * WAFNonexistentContainerException // The operation failed because you tried to add an object to or delete an object // from another object that doesn't exist. For example: // @@ -8559,7 +8561,7 @@ func (c *WAFRegional) UpdateRegexPatternSetRequest(input *waf.UpdateRegexPattern // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeWAFInvalidOperationException "WAFInvalidOperationException" +// * WAFInvalidOperationException // 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 @@ -8577,11 +8579,11 @@ func (c *WAFRegional) UpdateRegexPatternSetRequest(input *waf.UpdateRegexPattern // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFInvalidRegexPatternException "WAFInvalidRegexPatternException" +// * WAFInvalidRegexPatternException // The regular expression (regex) you specified in RegexPatternString is invalid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/UpdateRegexPatternSet @@ -8692,20 +8694,20 @@ func (c *WAFRegional) UpdateRuleRequest(input *waf.UpdateRuleInput) (req *reques // See the AWS API reference guide for AWS WAF Regional's // API operation UpdateRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFInvalidOperationException "WAFInvalidOperationException" +// * WAFInvalidOperationException // 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 @@ -8723,7 +8725,7 @@ func (c *WAFRegional) UpdateRuleRequest(input *waf.UpdateRuleInput) (req *reques // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -8752,7 +8754,7 @@ func (c *WAFRegional) UpdateRuleRequest(input *waf.UpdateRuleInput) (req *reques // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFNonexistentContainerException "WAFNonexistentContainerException" +// * WAFNonexistentContainerException // The operation failed because you tried to add an object to or delete an object // from another object that doesn't exist. For example: // @@ -8768,10 +8770,10 @@ func (c *WAFRegional) UpdateRuleRequest(input *waf.UpdateRuleInput) (req *reques // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -8779,7 +8781,7 @@ func (c *WAFRegional) UpdateRuleRequest(input *waf.UpdateRuleInput) (req *reques // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -8882,16 +8884,16 @@ func (c *WAFRegional) UpdateRuleGroupRequest(input *waf.UpdateRuleGroupInput) (r // See the AWS API reference guide for AWS WAF Regional's // API operation UpdateRuleGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFNonexistentContainerException "WAFNonexistentContainerException" +// * WAFNonexistentContainerException // The operation failed because you tried to add an object to or delete an object // from another object that doesn't exist. For example: // @@ -8907,10 +8909,10 @@ func (c *WAFRegional) UpdateRuleGroupRequest(input *waf.UpdateRuleGroupInput) (r // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFInvalidOperationException "WAFInvalidOperationException" +// * WAFInvalidOperationException // 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 @@ -8928,13 +8930,13 @@ func (c *WAFRegional) UpdateRuleGroupRequest(input *waf.UpdateRuleGroupInput) (r // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -9077,20 +9079,20 @@ func (c *WAFRegional) UpdateSizeConstraintSetRequest(input *waf.UpdateSizeConstr // See the AWS API reference guide for AWS WAF Regional's // API operation UpdateSizeConstraintSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFInvalidOperationException "WAFInvalidOperationException" +// * WAFInvalidOperationException // 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 @@ -9108,7 +9110,7 @@ func (c *WAFRegional) UpdateSizeConstraintSetRequest(input *waf.UpdateSizeConstr // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -9137,7 +9139,7 @@ func (c *WAFRegional) UpdateSizeConstraintSetRequest(input *waf.UpdateSizeConstr // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFNonexistentContainerException "WAFNonexistentContainerException" +// * WAFNonexistentContainerException // The operation failed because you tried to add an object to or delete an object // from another object that doesn't exist. For example: // @@ -9153,10 +9155,10 @@ func (c *WAFRegional) UpdateSizeConstraintSetRequest(input *waf.UpdateSizeConstr // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -9164,7 +9166,7 @@ func (c *WAFRegional) UpdateSizeConstraintSetRequest(input *waf.UpdateSizeConstr // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -9277,16 +9279,16 @@ func (c *WAFRegional) UpdateSqlInjectionMatchSetRequest(input *waf.UpdateSqlInje // See the AWS API reference guide for AWS WAF Regional's // API operation UpdateSqlInjectionMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFInvalidOperationException "WAFInvalidOperationException" +// * WAFInvalidOperationException // 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 @@ -9304,7 +9306,7 @@ func (c *WAFRegional) UpdateSqlInjectionMatchSetRequest(input *waf.UpdateSqlInje // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -9333,7 +9335,7 @@ func (c *WAFRegional) UpdateSqlInjectionMatchSetRequest(input *waf.UpdateSqlInje // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFNonexistentContainerException "WAFNonexistentContainerException" +// * WAFNonexistentContainerException // The operation failed because you tried to add an object to or delete an object // from another object that doesn't exist. For example: // @@ -9349,14 +9351,14 @@ func (c *WAFRegional) UpdateSqlInjectionMatchSetRequest(input *waf.UpdateSqlInje // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -9492,20 +9494,20 @@ func (c *WAFRegional) UpdateWebACLRequest(input *waf.UpdateWebACLInput) (req *re // See the AWS API reference guide for AWS WAF Regional's // API operation UpdateWebACL for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// Returned Error Types: +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFInvalidOperationException "WAFInvalidOperationException" +// * WAFInvalidOperationException // 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 @@ -9523,7 +9525,7 @@ func (c *WAFRegional) UpdateWebACLRequest(input *waf.UpdateWebACLInput) (req *re // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -9552,7 +9554,7 @@ func (c *WAFRegional) UpdateWebACLRequest(input *waf.UpdateWebACLInput) (req *re // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFNonexistentContainerException "WAFNonexistentContainerException" +// * WAFNonexistentContainerException // The operation failed because you tried to add an object to or delete an object // from another object that doesn't exist. For example: // @@ -9568,10 +9570,10 @@ func (c *WAFRegional) UpdateWebACLRequest(input *waf.UpdateWebACLInput) (req *re // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFReferencedItemException "WAFReferencedItemException" +// * WAFReferencedItemException // The operation failed because you tried to delete an object that is still // in use. For example: // @@ -9579,13 +9581,13 @@ func (c *WAFRegional) UpdateWebACLRequest(input *waf.UpdateWebACLInput) (req *re // // * You tried to delete a Rule that is still referenced by a WebACL. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) // in the AWS WAF Developer Guide. // -// * ErrCodeWAFSubscriptionNotFoundException "WAFSubscriptionNotFoundException" +// * WAFSubscriptionNotFoundException // The specified subscription does not exist. // // See also, https://docs.aws.amazon.com/goto/WebAPI/waf-regional-2016-11-28/UpdateWebACL @@ -9695,16 +9697,16 @@ func (c *WAFRegional) UpdateXssMatchSetRequest(input *waf.UpdateXssMatchSetInput // See the AWS API reference guide for AWS WAF Regional's // API operation UpdateXssMatchSet for usage and error information. // -// Returned Error Codes: -// * ErrCodeWAFInternalErrorException "WAFInternalErrorException" +// Returned Error Types: +// * WAFInternalErrorException // The operation failed because of a system problem, even though the request // was valid. Retry your request. // -// * ErrCodeWAFInvalidAccountException "WAFInvalidAccountException" +// * WAFInvalidAccountException // The operation failed because you tried to create, update, or delete an object // by using an invalid account identifier. // -// * ErrCodeWAFInvalidOperationException "WAFInvalidOperationException" +// * WAFInvalidOperationException // 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 @@ -9722,7 +9724,7 @@ func (c *WAFRegional) UpdateXssMatchSetRequest(input *waf.UpdateXssMatchSetInput // * You tried to add a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple // already exists in the specified WebACL. // -// * ErrCodeWAFInvalidParameterException "WAFInvalidParameterException" +// * WAFInvalidParameterException // The operation failed because AWS WAF didn't recognize a parameter in the // request. For example: // @@ -9751,7 +9753,7 @@ func (c *WAFRegional) UpdateXssMatchSetRequest(input *waf.UpdateXssMatchSetInput // * Your request references an ARN that is malformed, or corresponds to // a resource with which a web ACL cannot be associated. // -// * ErrCodeWAFNonexistentContainerException "WAFNonexistentContainerException" +// * WAFNonexistentContainerException // The operation failed because you tried to add an object to or delete an object // from another object that doesn't exist. For example: // @@ -9767,14 +9769,14 @@ func (c *WAFRegional) UpdateXssMatchSetRequest(input *waf.UpdateXssMatchSetInput // * You tried to add a ByteMatchTuple to or delete a ByteMatchTuple from // a ByteMatchSet that doesn't exist. // -// * ErrCodeWAFNonexistentItemException "WAFNonexistentItemException" +// * WAFNonexistentItemException // The operation failed because the referenced object doesn't exist. // -// * ErrCodeWAFStaleDataException "WAFStaleDataException" +// * WAFStaleDataException // The operation failed because you tried to create, update, or delete an object // by using a change token that has already been used. // -// * ErrCodeWAFLimitsExceededException "WAFLimitsExceededException" +// * WAFLimitsExceededException // 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) @@ -10093,6 +10095,1178 @@ func (s *ListResourcesForWebACLOutput) SetResourceArns(v []*string) *ListResourc return s } +type WAFBadRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFBadRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFBadRequestException) GoString() string { + return s.String() +} + +func newErrorWAFBadRequestException(v protocol.ResponseMetadata) error { + return &WAFBadRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFBadRequestException) Code() string { + return "WAFBadRequestException" +} + +// Message returns the exception's message. +func (s WAFBadRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFBadRequestException) OrigErr() error { + return nil +} + +func (s WAFBadRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFBadRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFBadRequestException) RequestID() string { + return s.respMetadata.RequestID +} + +// The name specified is invalid. +type WAFDisallowedNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFDisallowedNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFDisallowedNameException) GoString() string { + return s.String() +} + +func newErrorWAFDisallowedNameException(v protocol.ResponseMetadata) error { + return &WAFDisallowedNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFDisallowedNameException) Code() string { + return "WAFDisallowedNameException" +} + +// Message returns the exception's message. +func (s WAFDisallowedNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFDisallowedNameException) OrigErr() error { + return nil +} + +func (s WAFDisallowedNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFDisallowedNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFDisallowedNameException) RequestID() string { + return s.respMetadata.RequestID +} + +// The operation failed because of a system problem, even though the request +// was valid. Retry your request. +type WAFInternalErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFInternalErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFInternalErrorException) GoString() string { + return s.String() +} + +func newErrorWAFInternalErrorException(v protocol.ResponseMetadata) error { + return &WAFInternalErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFInternalErrorException) Code() string { + return "WAFInternalErrorException" +} + +// Message returns the exception's message. +func (s WAFInternalErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFInternalErrorException) OrigErr() error { + return nil +} + +func (s WAFInternalErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFInternalErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFInternalErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// The operation failed because you tried to create, update, or delete an object +// by using an invalid account identifier. +type WAFInvalidAccountException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFInvalidAccountException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFInvalidAccountException) GoString() string { + return s.String() +} + +func newErrorWAFInvalidAccountException(v protocol.ResponseMetadata) error { + return &WAFInvalidAccountException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFInvalidAccountException) Code() string { + return "WAFInvalidAccountException" +} + +// Message returns the exception's message. +func (s WAFInvalidAccountException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFInvalidAccountException) OrigErr() error { + return nil +} + +func (s WAFInvalidAccountException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFInvalidAccountException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFInvalidAccountException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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 a ByteMatchTuple to a ByteMatchSet, but the ByteMatchTuple +// already exists in the specified WebACL. +type WAFInvalidOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFInvalidOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFInvalidOperationException) GoString() string { + return s.String() +} + +func newErrorWAFInvalidOperationException(v protocol.ResponseMetadata) error { + return &WAFInvalidOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFInvalidOperationException) Code() string { + return "WAFInvalidOperationException" +} + +// Message returns the exception's message. +func (s WAFInvalidOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFInvalidOperationException) OrigErr() error { + return nil +} + +func (s WAFInvalidOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFInvalidOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFInvalidOperationException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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 DefaultAction Type other than ALLOW, +// BLOCK, or COUNT. +// +// * You tried to create a RateBasedRule with a RateKey value other than +// IP. +// +// * You tried to update a WebACL with a WafAction Type other than ALLOW, +// BLOCK, or COUNT. +// +// * You tried to update a ByteMatchSet with a FieldToMatch Type other than +// HEADER, METHOD, QUERY_STRING, URI, or BODY. +// +// * 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. +type WAFInvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Field *string `locationName:"field" type:"string" enum:"ParameterExceptionField"` + + Message_ *string `locationName:"message" type:"string"` + + Parameter *string `locationName:"parameter" min:"1" type:"string"` + + Reason *string `locationName:"reason" type:"string" enum:"ParameterExceptionReason"` +} + +// String returns the string representation +func (s WAFInvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFInvalidParameterException) GoString() string { + return s.String() +} + +func newErrorWAFInvalidParameterException(v protocol.ResponseMetadata) error { + return &WAFInvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFInvalidParameterException) Code() string { + return "WAFInvalidParameterException" +} + +// Message returns the exception's message. +func (s WAFInvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFInvalidParameterException) OrigErr() error { + return nil +} + +func (s WAFInvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFInvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFInvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// The operation failed because the specified policy is not in the proper format. +// +// The policy is subject to the following restrictions: +// +// * You can attach only one policy with each PutPermissionPolicy request. +// +// * The policy must include an Effect, Action and Principal. +// +// * Effect must specify Allow. +// +// * The Action in the policy must be waf:UpdateWebACL, waf-regional:UpdateWebACL, +// waf:GetRuleGroup and waf-regional:GetRuleGroup . Any extra or wildcard +// actions in the policy will be rejected. +// +// * The policy cannot include a Resource parameter. +// +// * The ARN in the request must be a valid WAF RuleGroup ARN and the RuleGroup +// must exist in the same region. +// +// * The user making the request must be the owner of the RuleGroup. +// +// * Your policy must be composed using IAM Policy version 2012-10-17. +type WAFInvalidPermissionPolicyException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFInvalidPermissionPolicyException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFInvalidPermissionPolicyException) GoString() string { + return s.String() +} + +func newErrorWAFInvalidPermissionPolicyException(v protocol.ResponseMetadata) error { + return &WAFInvalidPermissionPolicyException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFInvalidPermissionPolicyException) Code() string { + return "WAFInvalidPermissionPolicyException" +} + +// Message returns the exception's message. +func (s WAFInvalidPermissionPolicyException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFInvalidPermissionPolicyException) OrigErr() error { + return nil +} + +func (s WAFInvalidPermissionPolicyException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFInvalidPermissionPolicyException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFInvalidPermissionPolicyException) RequestID() string { + return s.respMetadata.RequestID +} + +// The regular expression (regex) you specified in RegexPatternString is invalid. +type WAFInvalidRegexPatternException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFInvalidRegexPatternException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFInvalidRegexPatternException) GoString() string { + return s.String() +} + +func newErrorWAFInvalidRegexPatternException(v protocol.ResponseMetadata) error { + return &WAFInvalidRegexPatternException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFInvalidRegexPatternException) Code() string { + return "WAFInvalidRegexPatternException" +} + +// Message returns the exception's message. +func (s WAFInvalidRegexPatternException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFInvalidRegexPatternException) OrigErr() error { + return nil +} + +func (s WAFInvalidRegexPatternException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFInvalidRegexPatternException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFInvalidRegexPatternException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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 (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) +// in the AWS WAF Developer Guide. +type WAFLimitsExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFLimitsExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFLimitsExceededException) GoString() string { + return s.String() +} + +func newErrorWAFLimitsExceededException(v protocol.ResponseMetadata) error { + return &WAFLimitsExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFLimitsExceededException) Code() string { + return "WAFLimitsExceededException" +} + +// Message returns the exception's message. +func (s WAFLimitsExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFLimitsExceededException) OrigErr() error { + return nil +} + +func (s WAFLimitsExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFLimitsExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFLimitsExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type WAFNonEmptyEntityException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFNonEmptyEntityException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFNonEmptyEntityException) GoString() string { + return s.String() +} + +func newErrorWAFNonEmptyEntityException(v protocol.ResponseMetadata) error { + return &WAFNonEmptyEntityException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFNonEmptyEntityException) Code() string { + return "WAFNonEmptyEntityException" +} + +// Message returns the exception's message. +func (s WAFNonEmptyEntityException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFNonEmptyEntityException) OrigErr() error { + return nil +} + +func (s WAFNonEmptyEntityException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFNonEmptyEntityException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFNonEmptyEntityException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type WAFNonexistentContainerException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFNonexistentContainerException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFNonexistentContainerException) GoString() string { + return s.String() +} + +func newErrorWAFNonexistentContainerException(v protocol.ResponseMetadata) error { + return &WAFNonexistentContainerException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFNonexistentContainerException) Code() string { + return "WAFNonexistentContainerException" +} + +// Message returns the exception's message. +func (s WAFNonexistentContainerException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFNonexistentContainerException) OrigErr() error { + return nil +} + +func (s WAFNonexistentContainerException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFNonexistentContainerException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFNonexistentContainerException) RequestID() string { + return s.respMetadata.RequestID +} + +// The operation failed because the referenced object doesn't exist. +type WAFNonexistentItemException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFNonexistentItemException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFNonexistentItemException) GoString() string { + return s.String() +} + +func newErrorWAFNonexistentItemException(v protocol.ResponseMetadata) error { + return &WAFNonexistentItemException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFNonexistentItemException) Code() string { + return "WAFNonexistentItemException" +} + +// Message returns the exception's message. +func (s WAFNonexistentItemException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFNonexistentItemException) OrigErr() error { + return nil +} + +func (s WAFNonexistentItemException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFNonexistentItemException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFNonexistentItemException) RequestID() string { + return s.respMetadata.RequestID +} + +// 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. +type WAFReferencedItemException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFReferencedItemException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFReferencedItemException) GoString() string { + return s.String() +} + +func newErrorWAFReferencedItemException(v protocol.ResponseMetadata) error { + return &WAFReferencedItemException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFReferencedItemException) Code() string { + return "WAFReferencedItemException" +} + +// Message returns the exception's message. +func (s WAFReferencedItemException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFReferencedItemException) OrigErr() error { + return nil +} + +func (s WAFReferencedItemException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFReferencedItemException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFReferencedItemException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS WAF is not able to access the service linked role. This can be caused +// by a previous PutLoggingConfiguration request, which can lock the service +// linked role for about 20 seconds. Please try your request again. The service +// linked role can also be locked by a previous DeleteServiceLinkedRole request, +// which can lock the role for 15 minutes or more. If you recently made a DeleteServiceLinkedRole, +// wait at least 15 minutes and try the request again. If you receive this same +// exception again, you will have to wait additional time until the role is +// unlocked. +type WAFServiceLinkedRoleErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFServiceLinkedRoleErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFServiceLinkedRoleErrorException) GoString() string { + return s.String() +} + +func newErrorWAFServiceLinkedRoleErrorException(v protocol.ResponseMetadata) error { + return &WAFServiceLinkedRoleErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFServiceLinkedRoleErrorException) Code() string { + return "WAFServiceLinkedRoleErrorException" +} + +// Message returns the exception's message. +func (s WAFServiceLinkedRoleErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFServiceLinkedRoleErrorException) OrigErr() error { + return nil +} + +func (s WAFServiceLinkedRoleErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFServiceLinkedRoleErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFServiceLinkedRoleErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// The operation failed because you tried to create, update, or delete an object +// by using a change token that has already been used. +type WAFStaleDataException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFStaleDataException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFStaleDataException) GoString() string { + return s.String() +} + +func newErrorWAFStaleDataException(v protocol.ResponseMetadata) error { + return &WAFStaleDataException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFStaleDataException) Code() string { + return "WAFStaleDataException" +} + +// Message returns the exception's message. +func (s WAFStaleDataException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFStaleDataException) OrigErr() error { + return nil +} + +func (s WAFStaleDataException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFStaleDataException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFStaleDataException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified subscription does not exist. +type WAFSubscriptionNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFSubscriptionNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFSubscriptionNotFoundException) GoString() string { + return s.String() +} + +func newErrorWAFSubscriptionNotFoundException(v protocol.ResponseMetadata) error { + return &WAFSubscriptionNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFSubscriptionNotFoundException) Code() string { + return "WAFSubscriptionNotFoundException" +} + +// Message returns the exception's message. +func (s WAFSubscriptionNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFSubscriptionNotFoundException) OrigErr() error { + return nil +} + +func (s WAFSubscriptionNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFSubscriptionNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFSubscriptionNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +type WAFTagOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFTagOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFTagOperationException) GoString() string { + return s.String() +} + +func newErrorWAFTagOperationException(v protocol.ResponseMetadata) error { + return &WAFTagOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFTagOperationException) Code() string { + return "WAFTagOperationException" +} + +// Message returns the exception's message. +func (s WAFTagOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFTagOperationException) OrigErr() error { + return nil +} + +func (s WAFTagOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFTagOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFTagOperationException) RequestID() string { + return s.respMetadata.RequestID +} + +type WAFTagOperationInternalErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFTagOperationInternalErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFTagOperationInternalErrorException) GoString() string { + return s.String() +} + +func newErrorWAFTagOperationInternalErrorException(v protocol.ResponseMetadata) error { + return &WAFTagOperationInternalErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFTagOperationInternalErrorException) Code() string { + return "WAFTagOperationInternalErrorException" +} + +// Message returns the exception's message. +func (s WAFTagOperationInternalErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFTagOperationInternalErrorException) OrigErr() error { + return nil +} + +func (s WAFTagOperationInternalErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFTagOperationInternalErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFTagOperationInternalErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// The operation failed because the entity referenced is temporarily unavailable. +// Retry your request. +type WAFUnavailableEntityException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFUnavailableEntityException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFUnavailableEntityException) GoString() string { + return s.String() +} + +func newErrorWAFUnavailableEntityException(v protocol.ResponseMetadata) error { + return &WAFUnavailableEntityException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFUnavailableEntityException) Code() string { + return "WAFUnavailableEntityException" +} + +// Message returns the exception's message. +func (s WAFUnavailableEntityException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFUnavailableEntityException) OrigErr() error { + return nil +} + +func (s WAFUnavailableEntityException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFUnavailableEntityException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFUnavailableEntityException) RequestID() string { + return s.respMetadata.RequestID +} + const ( // ChangeActionInsert is a ChangeAction enum value ChangeActionInsert = "INSERT" diff --git a/vendor/github.com/aws/aws-sdk-go/service/wafregional/errors.go b/vendor/github.com/aws/aws-sdk-go/service/wafregional/errors.go index 76315ecfbba..e0220535780 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/wafregional/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/wafregional/errors.go @@ -2,6 +2,10 @@ package wafregional +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeWAFBadRequestException for service response error code @@ -217,3 +221,25 @@ const ( // Retry your request. ErrCodeWAFUnavailableEntityException = "WAFUnavailableEntityException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "WAFBadRequestException": newErrorWAFBadRequestException, + "WAFDisallowedNameException": newErrorWAFDisallowedNameException, + "WAFInternalErrorException": newErrorWAFInternalErrorException, + "WAFInvalidAccountException": newErrorWAFInvalidAccountException, + "WAFInvalidOperationException": newErrorWAFInvalidOperationException, + "WAFInvalidParameterException": newErrorWAFInvalidParameterException, + "WAFInvalidPermissionPolicyException": newErrorWAFInvalidPermissionPolicyException, + "WAFInvalidRegexPatternException": newErrorWAFInvalidRegexPatternException, + "WAFLimitsExceededException": newErrorWAFLimitsExceededException, + "WAFNonEmptyEntityException": newErrorWAFNonEmptyEntityException, + "WAFNonexistentContainerException": newErrorWAFNonexistentContainerException, + "WAFNonexistentItemException": newErrorWAFNonexistentItemException, + "WAFReferencedItemException": newErrorWAFReferencedItemException, + "WAFServiceLinkedRoleErrorException": newErrorWAFServiceLinkedRoleErrorException, + "WAFStaleDataException": newErrorWAFStaleDataException, + "WAFSubscriptionNotFoundException": newErrorWAFSubscriptionNotFoundException, + "WAFTagOperationException": newErrorWAFTagOperationException, + "WAFTagOperationInternalErrorException": newErrorWAFTagOperationInternalErrorException, + "WAFUnavailableEntityException": newErrorWAFUnavailableEntityException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/wafregional/service.go b/vendor/github.com/aws/aws-sdk-go/service/wafregional/service.go index 3a267ae6360..769e4176756 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/wafregional/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/wafregional/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "waf-regional" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "WAF Regional" // ServiceID is a unique identifer of a specific service. + ServiceID = "WAF Regional" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the WAFRegional client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a WAFRegional client from just a session. // svc := wafregional.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := wafregional.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *WAFRegional { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *WAFRegional { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *WAFRegional { svc := &WAFRegional{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-11-28", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/wafv2/api.go b/vendor/github.com/aws/aws-sdk-go/service/wafv2/api.go new file mode 100644 index 00000000000..3d2b56c25f5 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/wafv2/api.go @@ -0,0 +1,13983 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package wafv2 + +import ( + "fmt" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" +) + +const opAssociateWebACL = "AssociateWebACL" + +// AssociateWebACLRequest generates a "aws/request.Request" representing the +// client's request for the AssociateWebACL operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AssociateWebACL for more information on using the AssociateWebACL +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AssociateWebACLRequest method. +// req, resp := client.AssociateWebACLRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/AssociateWebACL +func (c *WAFV2) AssociateWebACLRequest(input *AssociateWebACLInput) (req *request.Request, output *AssociateWebACLOutput) { + op := &request.Operation{ + Name: opAssociateWebACL, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AssociateWebACLInput{} + } + + output = &AssociateWebACLOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// AssociateWebACL API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Associates a Web ACL with a regional application resource, to protect the +// resource. A regional application can be an Application Load Balancer (ALB) +// or an API Gateway stage. +// +// For AWS CloudFront, you can associate the Web ACL by providing the ARN of +// the WebACL to the CloudFront API call UpdateDistribution. For information, +// see UpdateDistribution (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdateDistribution.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 WAFV2's +// API operation AssociateWebACL for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFUnavailableEntityException +// AWS WAF couldn’t retrieve the resource that you requested. Retry your request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/AssociateWebACL +func (c *WAFV2) AssociateWebACL(input *AssociateWebACLInput) (*AssociateWebACLOutput, error) { + req, out := c.AssociateWebACLRequest(input) + return out, req.Send() +} + +// AssociateWebACLWithContext is the same as AssociateWebACL with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateWebACL for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) AssociateWebACLWithContext(ctx aws.Context, input *AssociateWebACLInput, opts ...request.Option) (*AssociateWebACLOutput, error) { + req, out := c.AssociateWebACLRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCheckCapacity = "CheckCapacity" + +// CheckCapacityRequest generates a "aws/request.Request" representing the +// client's request for the CheckCapacity operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CheckCapacity for more information on using the CheckCapacity +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CheckCapacityRequest method. +// req, resp := client.CheckCapacityRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CheckCapacity +func (c *WAFV2) CheckCapacityRequest(input *CheckCapacityInput) (req *request.Request, output *CheckCapacityOutput) { + op := &request.Operation{ + Name: opCheckCapacity, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CheckCapacityInput{} + } + + output = &CheckCapacityOutput{} + req = c.newRequest(op, input, output) + return +} + +// CheckCapacity API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Returns the web ACL capacity unit (WCU) requirements for a specified scope +// and set of rules. You can use this to check the capacity requirements for +// the rules you want to use in a RuleGroup or WebACL. +// +// AWS WAF uses WCUs to calculate and control the operating resources that are +// used to run your rules, rule groups, and web ACLs. AWS WAF calculates capacity +// differently for each rule type, to reflect the relative cost of each rule. +// Simple rules that cost little to run use fewer WCUs than more complex rules +// that use more processing power. Rule group capacity is fixed at creation, +// which helps users plan their web ACL WCU usage when they use a rule group. +// The WCU limit for web ACLs is 1,500. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation CheckCapacity for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFLimitsExceededException +// AWS WAF couldn’t perform the operation because you exceeded your resource +// limit. For example, the maximum number of WebACL objects that you can create +// for an AWS account. For more information, see Limits (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) +// in the AWS WAF Developer Guide. +// +// * WAFInvalidResourceException +// AWS WAF couldn’t perform the operation because the resource that you requested +// isn’t valid. Check the resource, and try again. +// +// * WAFUnavailableEntityException +// AWS WAF couldn’t retrieve the resource that you requested. Retry your request. +// +// * WAFSubscriptionNotFoundException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CheckCapacity +func (c *WAFV2) CheckCapacity(input *CheckCapacityInput) (*CheckCapacityOutput, error) { + req, out := c.CheckCapacityRequest(input) + return out, req.Send() +} + +// CheckCapacityWithContext is the same as CheckCapacity with the addition of +// the ability to pass a context and additional request options. +// +// See CheckCapacity for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) CheckCapacityWithContext(ctx aws.Context, input *CheckCapacityInput, opts ...request.Option) (*CheckCapacityOutput, error) { + req, out := c.CheckCapacityRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateIPSet = "CreateIPSet" + +// CreateIPSetRequest generates a "aws/request.Request" representing the +// client's request for the CreateIPSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateIPSet for more information on using the CreateIPSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateIPSetRequest method. +// req, resp := client.CreateIPSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateIPSet +func (c *WAFV2) 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 WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Creates an IPSet, which you use to identify web requests that originate from +// specific IP addresses or ranges of IP addresses. For example, if you're receiving +// a lot of requests from a ranges of IP addresses, you can configure AWS WAF +// to block them using an IPSet that lists those 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 AWS WAFV2's +// API operation CreateIPSet for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFDuplicateItemException +// AWS WAF couldn’t perform the operation because the resource that you tried +// to save is a duplicate of an existing one. +// +// * WAFOptimisticLockException +// AWS WAF couldn’t save your changes because you tried to update or delete +// a resource that has changed since you last retrieved it. Get the resource +// again, make any changes you need to make to the new copy, and retry your +// operation. +// +// * WAFLimitsExceededException +// AWS WAF couldn’t perform the operation because you exceeded your resource +// limit. For example, the maximum number of WebACL objects that you can create +// for an AWS account. For more information, see Limits (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) +// in the AWS WAF Developer Guide. +// +// * WAFTagOperationException +// An error occurred during the tagging operation. Retry your request. +// +// * WAFTagOperationInternalErrorException +// AWS WAF couldn’t perform your tagging operation because of an internal +// error. Retry your request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateIPSet +func (c *WAFV2) CreateIPSet(input *CreateIPSetInput) (*CreateIPSetOutput, error) { + req, out := c.CreateIPSetRequest(input) + return out, req.Send() +} + +// CreateIPSetWithContext is the same as CreateIPSet with the addition of +// the ability to pass a context and additional request options. +// +// See CreateIPSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) CreateIPSetWithContext(ctx aws.Context, input *CreateIPSetInput, opts ...request.Option) (*CreateIPSetOutput, error) { + req, out := c.CreateIPSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateRegexPatternSet = "CreateRegexPatternSet" + +// CreateRegexPatternSetRequest generates a "aws/request.Request" representing the +// client's request for the CreateRegexPatternSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateRegexPatternSet for more information on using the CreateRegexPatternSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateRegexPatternSetRequest method. +// req, resp := client.CreateRegexPatternSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateRegexPatternSet +func (c *WAFV2) CreateRegexPatternSetRequest(input *CreateRegexPatternSetInput) (req *request.Request, output *CreateRegexPatternSetOutput) { + op := &request.Operation{ + Name: opCreateRegexPatternSet, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateRegexPatternSetInput{} + } + + output = &CreateRegexPatternSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateRegexPatternSet API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Creates a RegexPatternSet, which you reference in a RegexPatternSetReferenceStatement, +// to have AWS WAF inspect a web request component for the specified patterns. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation CreateRegexPatternSet for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFDuplicateItemException +// AWS WAF couldn’t perform the operation because the resource that you tried +// to save is a duplicate of an existing one. +// +// * WAFOptimisticLockException +// AWS WAF couldn’t save your changes because you tried to update or delete +// a resource that has changed since you last retrieved it. Get the resource +// again, make any changes you need to make to the new copy, and retry your +// operation. +// +// * WAFLimitsExceededException +// AWS WAF couldn’t perform the operation because you exceeded your resource +// limit. For example, the maximum number of WebACL objects that you can create +// for an AWS account. For more information, see Limits (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) +// in the AWS WAF Developer Guide. +// +// * WAFTagOperationException +// An error occurred during the tagging operation. Retry your request. +// +// * WAFTagOperationInternalErrorException +// AWS WAF couldn’t perform your tagging operation because of an internal +// error. Retry your request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateRegexPatternSet +func (c *WAFV2) CreateRegexPatternSet(input *CreateRegexPatternSetInput) (*CreateRegexPatternSetOutput, error) { + req, out := c.CreateRegexPatternSetRequest(input) + return out, req.Send() +} + +// CreateRegexPatternSetWithContext is the same as CreateRegexPatternSet with the addition of +// the ability to pass a context and additional request options. +// +// See CreateRegexPatternSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) CreateRegexPatternSetWithContext(ctx aws.Context, input *CreateRegexPatternSetInput, opts ...request.Option) (*CreateRegexPatternSetOutput, error) { + req, out := c.CreateRegexPatternSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateRuleGroup = "CreateRuleGroup" + +// CreateRuleGroupRequest generates a "aws/request.Request" representing the +// client's request for the CreateRuleGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateRuleGroup for more information on using the CreateRuleGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateRuleGroupRequest method. +// req, resp := client.CreateRuleGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateRuleGroup +func (c *WAFV2) CreateRuleGroupRequest(input *CreateRuleGroupInput) (req *request.Request, output *CreateRuleGroupOutput) { + op := &request.Operation{ + Name: opCreateRuleGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateRuleGroupInput{} + } + + output = &CreateRuleGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateRuleGroup API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Creates a RuleGroup per the specifications provided. +// +// A rule group defines a collection of rules to inspect and control web requests +// that you can use in a WebACL. When you create a rule group, you define an +// immutable capacity limit. If you update a rule group, you must stay within +// the capacity. This allows others to reuse the rule group with confidence +// in its capacity requirements. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation CreateRuleGroup for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFDuplicateItemException +// AWS WAF couldn’t perform the operation because the resource that you tried +// to save is a duplicate of an existing one. +// +// * WAFOptimisticLockException +// AWS WAF couldn’t save your changes because you tried to update or delete +// a resource that has changed since you last retrieved it. Get the resource +// again, make any changes you need to make to the new copy, and retry your +// operation. +// +// * WAFLimitsExceededException +// AWS WAF couldn’t perform the operation because you exceeded your resource +// limit. For example, the maximum number of WebACL objects that you can create +// for an AWS account. For more information, see Limits (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) +// in the AWS WAF Developer Guide. +// +// * WAFUnavailableEntityException +// AWS WAF couldn’t retrieve the resource that you requested. Retry your request. +// +// * WAFTagOperationException +// An error occurred during the tagging operation. Retry your request. +// +// * WAFTagOperationInternalErrorException +// AWS WAF couldn’t perform your tagging operation because of an internal +// error. Retry your request. +// +// * WAFSubscriptionNotFoundException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateRuleGroup +func (c *WAFV2) CreateRuleGroup(input *CreateRuleGroupInput) (*CreateRuleGroupOutput, error) { + req, out := c.CreateRuleGroupRequest(input) + return out, req.Send() +} + +// CreateRuleGroupWithContext is the same as CreateRuleGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateRuleGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) CreateRuleGroupWithContext(ctx aws.Context, input *CreateRuleGroupInput, opts ...request.Option) (*CreateRuleGroupOutput, error) { + req, out := c.CreateRuleGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateWebACL = "CreateWebACL" + +// CreateWebACLRequest generates a "aws/request.Request" representing the +// client's request for the CreateWebACL operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateWebACL for more information on using the CreateWebACL +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateWebACLRequest method. +// req, resp := client.CreateWebACLRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateWebACL +func (c *WAFV2) 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 WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Creates a WebACL per the specifications provided. +// +// A Web ACL defines a collection of rules to use to inspect and control web +// requests. Each rule has an action defined (allow, block, or count) for requests +// that match the statement of the rule. In the Web ACL, you assign a default +// action to take (allow, block) for any request that does not match any of +// the rules. The rules in a Web ACL can be a combination of the types Rule, +// RuleGroup, and managed rule group. You can associate a Web ACL with one or +// more AWS resources to protect. The resources can be Amazon CloudFront, an +// Amazon API Gateway API, or an 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 AWS WAFV2's +// API operation CreateWebACL for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFDuplicateItemException +// AWS WAF couldn’t perform the operation because the resource that you tried +// to save is a duplicate of an existing one. +// +// * WAFOptimisticLockException +// AWS WAF couldn’t save your changes because you tried to update or delete +// a resource that has changed since you last retrieved it. Get the resource +// again, make any changes you need to make to the new copy, and retry your +// operation. +// +// * WAFLimitsExceededException +// AWS WAF couldn’t perform the operation because you exceeded your resource +// limit. For example, the maximum number of WebACL objects that you can create +// for an AWS account. For more information, see Limits (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) +// in the AWS WAF Developer Guide. +// +// * WAFInvalidResourceException +// AWS WAF couldn’t perform the operation because the resource that you requested +// isn’t valid. Check the resource, and try again. +// +// * WAFUnavailableEntityException +// AWS WAF couldn’t retrieve the resource that you requested. Retry your request. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFTagOperationException +// An error occurred during the tagging operation. Retry your request. +// +// * WAFTagOperationInternalErrorException +// AWS WAF couldn’t perform your tagging operation because of an internal +// error. Retry your request. +// +// * WAFSubscriptionNotFoundException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateWebACL +func (c *WAFV2) CreateWebACL(input *CreateWebACLInput) (*CreateWebACLOutput, error) { + req, out := c.CreateWebACLRequest(input) + return out, req.Send() +} + +// CreateWebACLWithContext is the same as CreateWebACL with the addition of +// the ability to pass a context and additional request options. +// +// See CreateWebACL for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) CreateWebACLWithContext(ctx aws.Context, input *CreateWebACLInput, opts ...request.Option) (*CreateWebACLOutput, error) { + req, out := c.CreateWebACLRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteIPSet = "DeleteIPSet" + +// DeleteIPSetRequest generates a "aws/request.Request" representing the +// client's request for the DeleteIPSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteIPSet for more information on using the DeleteIPSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteIPSetRequest method. +// req, resp := client.DeleteIPSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteIPSet +func (c *WAFV2) 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) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteIPSet API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Deletes the specified IPSet. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation DeleteIPSet for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFOptimisticLockException +// AWS WAF couldn’t save your changes because you tried to update or delete +// a resource that has changed since you last retrieved it. Get the resource +// again, make any changes you need to make to the new copy, and retry your +// operation. +// +// * WAFAssociatedItemException +// AWS WAF couldn’t perform the operation because your resource is being used +// by another resource or it’s associated with another resource. +// +// * WAFTagOperationException +// An error occurred during the tagging operation. Retry your request. +// +// * WAFTagOperationInternalErrorException +// AWS WAF couldn’t perform your tagging operation because of an internal +// error. Retry your request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteIPSet +func (c *WAFV2) DeleteIPSet(input *DeleteIPSetInput) (*DeleteIPSetOutput, error) { + req, out := c.DeleteIPSetRequest(input) + return out, req.Send() +} + +// DeleteIPSetWithContext is the same as DeleteIPSet with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteIPSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) DeleteIPSetWithContext(ctx aws.Context, input *DeleteIPSetInput, opts ...request.Option) (*DeleteIPSetOutput, error) { + req, out := c.DeleteIPSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteLoggingConfiguration = "DeleteLoggingConfiguration" + +// DeleteLoggingConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the DeleteLoggingConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteLoggingConfiguration for more information on using the DeleteLoggingConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteLoggingConfigurationRequest method. +// req, resp := client.DeleteLoggingConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteLoggingConfiguration +func (c *WAFV2) DeleteLoggingConfigurationRequest(input *DeleteLoggingConfigurationInput) (req *request.Request, output *DeleteLoggingConfigurationOutput) { + op := &request.Operation{ + Name: opDeleteLoggingConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteLoggingConfigurationInput{} + } + + output = &DeleteLoggingConfigurationOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteLoggingConfiguration API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Deletes the LoggingConfiguration from the specified 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 AWS WAFV2's +// API operation DeleteLoggingConfiguration for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFOptimisticLockException +// AWS WAF couldn’t save your changes because you tried to update or delete +// a resource that has changed since you last retrieved it. Get the resource +// again, make any changes you need to make to the new copy, and retry your +// operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteLoggingConfiguration +func (c *WAFV2) DeleteLoggingConfiguration(input *DeleteLoggingConfigurationInput) (*DeleteLoggingConfigurationOutput, error) { + req, out := c.DeleteLoggingConfigurationRequest(input) + return out, req.Send() +} + +// DeleteLoggingConfigurationWithContext is the same as DeleteLoggingConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteLoggingConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) DeleteLoggingConfigurationWithContext(ctx aws.Context, input *DeleteLoggingConfigurationInput, opts ...request.Option) (*DeleteLoggingConfigurationOutput, error) { + req, out := c.DeleteLoggingConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteRegexPatternSet = "DeleteRegexPatternSet" + +// DeleteRegexPatternSetRequest generates a "aws/request.Request" representing the +// client's request for the DeleteRegexPatternSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteRegexPatternSet for more information on using the DeleteRegexPatternSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteRegexPatternSetRequest method. +// req, resp := client.DeleteRegexPatternSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteRegexPatternSet +func (c *WAFV2) DeleteRegexPatternSetRequest(input *DeleteRegexPatternSetInput) (req *request.Request, output *DeleteRegexPatternSetOutput) { + op := &request.Operation{ + Name: opDeleteRegexPatternSet, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteRegexPatternSetInput{} + } + + output = &DeleteRegexPatternSetOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteRegexPatternSet API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Deletes the specified RegexPatternSet. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation DeleteRegexPatternSet for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFOptimisticLockException +// AWS WAF couldn’t save your changes because you tried to update or delete +// a resource that has changed since you last retrieved it. Get the resource +// again, make any changes you need to make to the new copy, and retry your +// operation. +// +// * WAFAssociatedItemException +// AWS WAF couldn’t perform the operation because your resource is being used +// by another resource or it’s associated with another resource. +// +// * WAFTagOperationException +// An error occurred during the tagging operation. Retry your request. +// +// * WAFTagOperationInternalErrorException +// AWS WAF couldn’t perform your tagging operation because of an internal +// error. Retry your request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteRegexPatternSet +func (c *WAFV2) DeleteRegexPatternSet(input *DeleteRegexPatternSetInput) (*DeleteRegexPatternSetOutput, error) { + req, out := c.DeleteRegexPatternSetRequest(input) + return out, req.Send() +} + +// DeleteRegexPatternSetWithContext is the same as DeleteRegexPatternSet with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRegexPatternSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) DeleteRegexPatternSetWithContext(ctx aws.Context, input *DeleteRegexPatternSetInput, opts ...request.Option) (*DeleteRegexPatternSetOutput, error) { + req, out := c.DeleteRegexPatternSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteRuleGroup = "DeleteRuleGroup" + +// DeleteRuleGroupRequest generates a "aws/request.Request" representing the +// client's request for the DeleteRuleGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteRuleGroup for more information on using the DeleteRuleGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteRuleGroupRequest method. +// req, resp := client.DeleteRuleGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteRuleGroup +func (c *WAFV2) DeleteRuleGroupRequest(input *DeleteRuleGroupInput) (req *request.Request, output *DeleteRuleGroupOutput) { + op := &request.Operation{ + Name: opDeleteRuleGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteRuleGroupInput{} + } + + output = &DeleteRuleGroupOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteRuleGroup API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Deletes the specified RuleGroup. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation DeleteRuleGroup for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFOptimisticLockException +// AWS WAF couldn’t save your changes because you tried to update or delete +// a resource that has changed since you last retrieved it. Get the resource +// again, make any changes you need to make to the new copy, and retry your +// operation. +// +// * WAFAssociatedItemException +// AWS WAF couldn’t perform the operation because your resource is being used +// by another resource or it’s associated with another resource. +// +// * WAFTagOperationException +// An error occurred during the tagging operation. Retry your request. +// +// * WAFTagOperationInternalErrorException +// AWS WAF couldn’t perform your tagging operation because of an internal +// error. Retry your request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteRuleGroup +func (c *WAFV2) DeleteRuleGroup(input *DeleteRuleGroupInput) (*DeleteRuleGroupOutput, error) { + req, out := c.DeleteRuleGroupRequest(input) + return out, req.Send() +} + +// DeleteRuleGroupWithContext is the same as DeleteRuleGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteRuleGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) DeleteRuleGroupWithContext(ctx aws.Context, input *DeleteRuleGroupInput, opts ...request.Option) (*DeleteRuleGroupOutput, error) { + req, out := c.DeleteRuleGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteWebACL = "DeleteWebACL" + +// DeleteWebACLRequest generates a "aws/request.Request" representing the +// client's request for the DeleteWebACL operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteWebACL for more information on using the DeleteWebACL +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteWebACLRequest method. +// req, resp := client.DeleteWebACLRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteWebACL +func (c *WAFV2) 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) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteWebACL API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Deletes the specified WebACL. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation DeleteWebACL for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFOptimisticLockException +// AWS WAF couldn’t save your changes because you tried to update or delete +// a resource that has changed since you last retrieved it. Get the resource +// again, make any changes you need to make to the new copy, and retry your +// operation. +// +// * WAFAssociatedItemException +// AWS WAF couldn’t perform the operation because your resource is being used +// by another resource or it’s associated with another resource. +// +// * WAFTagOperationException +// An error occurred during the tagging operation. Retry your request. +// +// * WAFTagOperationInternalErrorException +// AWS WAF couldn’t perform your tagging operation because of an internal +// error. Retry your request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteWebACL +func (c *WAFV2) DeleteWebACL(input *DeleteWebACLInput) (*DeleteWebACLOutput, error) { + req, out := c.DeleteWebACLRequest(input) + return out, req.Send() +} + +// DeleteWebACLWithContext is the same as DeleteWebACL with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteWebACL for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) DeleteWebACLWithContext(ctx aws.Context, input *DeleteWebACLInput, opts ...request.Option) (*DeleteWebACLOutput, error) { + req, out := c.DeleteWebACLRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeManagedRuleGroup = "DescribeManagedRuleGroup" + +// DescribeManagedRuleGroupRequest generates a "aws/request.Request" representing the +// client's request for the DescribeManagedRuleGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeManagedRuleGroup for more information on using the DescribeManagedRuleGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeManagedRuleGroupRequest method. +// req, resp := client.DescribeManagedRuleGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DescribeManagedRuleGroup +func (c *WAFV2) DescribeManagedRuleGroupRequest(input *DescribeManagedRuleGroupInput) (req *request.Request, output *DescribeManagedRuleGroupOutput) { + op := &request.Operation{ + Name: opDescribeManagedRuleGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeManagedRuleGroupInput{} + } + + output = &DescribeManagedRuleGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeManagedRuleGroup API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Provides high-level information for a managed rule group, including descriptions +// of the 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 WAFV2's +// API operation DescribeManagedRuleGroup for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFInvalidResourceException +// AWS WAF couldn’t perform the operation because the resource that you requested +// isn’t valid. Check the resource, and try again. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DescribeManagedRuleGroup +func (c *WAFV2) DescribeManagedRuleGroup(input *DescribeManagedRuleGroupInput) (*DescribeManagedRuleGroupOutput, error) { + req, out := c.DescribeManagedRuleGroupRequest(input) + return out, req.Send() +} + +// DescribeManagedRuleGroupWithContext is the same as DescribeManagedRuleGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeManagedRuleGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) DescribeManagedRuleGroupWithContext(ctx aws.Context, input *DescribeManagedRuleGroupInput, opts ...request.Option) (*DescribeManagedRuleGroupOutput, error) { + req, out := c.DescribeManagedRuleGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDisassociateWebACL = "DisassociateWebACL" + +// DisassociateWebACLRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateWebACL operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DisassociateWebACL for more information on using the DisassociateWebACL +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DisassociateWebACLRequest method. +// req, resp := client.DisassociateWebACLRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DisassociateWebACL +func (c *WAFV2) DisassociateWebACLRequest(input *DisassociateWebACLInput) (req *request.Request, output *DisassociateWebACLOutput) { + op := &request.Operation{ + Name: opDisassociateWebACL, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DisassociateWebACLInput{} + } + + output = &DisassociateWebACLOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DisassociateWebACL API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Disassociates a Web ACL from a regional application resource. A regional +// application can be an Application Load Balancer (ALB) or an API Gateway stage. +// +// For AWS CloudFront, you can disassociate the Web ACL by providing an empty +// web ACL ARN in the CloudFront API call UpdateDistribution. For information, +// see UpdateDistribution (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdateDistribution.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 WAFV2's +// API operation DisassociateWebACL for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DisassociateWebACL +func (c *WAFV2) DisassociateWebACL(input *DisassociateWebACLInput) (*DisassociateWebACLOutput, error) { + req, out := c.DisassociateWebACLRequest(input) + return out, req.Send() +} + +// DisassociateWebACLWithContext is the same as DisassociateWebACL with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateWebACL for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) DisassociateWebACLWithContext(ctx aws.Context, input *DisassociateWebACLInput, opts ...request.Option) (*DisassociateWebACLOutput, error) { + req, out := c.DisassociateWebACLRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetIPSet = "GetIPSet" + +// GetIPSetRequest generates a "aws/request.Request" representing the +// client's request for the GetIPSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetIPSet for more information on using the GetIPSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetIPSetRequest method. +// req, resp := client.GetIPSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetIPSet +func (c *WAFV2) 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 WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Retrieves the specified IPSet. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation GetIPSet for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetIPSet +func (c *WAFV2) GetIPSet(input *GetIPSetInput) (*GetIPSetOutput, error) { + req, out := c.GetIPSetRequest(input) + return out, req.Send() +} + +// GetIPSetWithContext is the same as GetIPSet with the addition of +// the ability to pass a context and additional request options. +// +// See GetIPSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) GetIPSetWithContext(ctx aws.Context, input *GetIPSetInput, opts ...request.Option) (*GetIPSetOutput, error) { + req, out := c.GetIPSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetLoggingConfiguration = "GetLoggingConfiguration" + +// GetLoggingConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the GetLoggingConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetLoggingConfiguration for more information on using the GetLoggingConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetLoggingConfigurationRequest method. +// req, resp := client.GetLoggingConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetLoggingConfiguration +func (c *WAFV2) GetLoggingConfigurationRequest(input *GetLoggingConfigurationInput) (req *request.Request, output *GetLoggingConfigurationOutput) { + op := &request.Operation{ + Name: opGetLoggingConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetLoggingConfigurationInput{} + } + + output = &GetLoggingConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetLoggingConfiguration API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Returns the LoggingConfiguration for the specified 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 AWS WAFV2's +// API operation GetLoggingConfiguration for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetLoggingConfiguration +func (c *WAFV2) GetLoggingConfiguration(input *GetLoggingConfigurationInput) (*GetLoggingConfigurationOutput, error) { + req, out := c.GetLoggingConfigurationRequest(input) + return out, req.Send() +} + +// GetLoggingConfigurationWithContext is the same as GetLoggingConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See GetLoggingConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) GetLoggingConfigurationWithContext(ctx aws.Context, input *GetLoggingConfigurationInput, opts ...request.Option) (*GetLoggingConfigurationOutput, error) { + req, out := c.GetLoggingConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetRateBasedStatementManagedKeys = "GetRateBasedStatementManagedKeys" + +// GetRateBasedStatementManagedKeysRequest generates a "aws/request.Request" representing the +// client's request for the GetRateBasedStatementManagedKeys operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetRateBasedStatementManagedKeys for more information on using the GetRateBasedStatementManagedKeys +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetRateBasedStatementManagedKeysRequest method. +// req, resp := client.GetRateBasedStatementManagedKeysRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetRateBasedStatementManagedKeys +func (c *WAFV2) GetRateBasedStatementManagedKeysRequest(input *GetRateBasedStatementManagedKeysInput) (req *request.Request, output *GetRateBasedStatementManagedKeysOutput) { + op := &request.Operation{ + Name: opGetRateBasedStatementManagedKeys, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetRateBasedStatementManagedKeysInput{} + } + + output = &GetRateBasedStatementManagedKeysOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetRateBasedStatementManagedKeys API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Retrieves the keys that are currently blocked by a rate-based rule. The maximum +// number of managed keys that can be blocked for a single rate-based rule is +// 10,000. If more than 10,000 addresses exceed the rate limit, those with the +// highest rates are blocked. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation GetRateBasedStatementManagedKeys for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetRateBasedStatementManagedKeys +func (c *WAFV2) GetRateBasedStatementManagedKeys(input *GetRateBasedStatementManagedKeysInput) (*GetRateBasedStatementManagedKeysOutput, error) { + req, out := c.GetRateBasedStatementManagedKeysRequest(input) + return out, req.Send() +} + +// GetRateBasedStatementManagedKeysWithContext is the same as GetRateBasedStatementManagedKeys with the addition of +// the ability to pass a context and additional request options. +// +// See GetRateBasedStatementManagedKeys for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) GetRateBasedStatementManagedKeysWithContext(ctx aws.Context, input *GetRateBasedStatementManagedKeysInput, opts ...request.Option) (*GetRateBasedStatementManagedKeysOutput, error) { + req, out := c.GetRateBasedStatementManagedKeysRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetRegexPatternSet = "GetRegexPatternSet" + +// GetRegexPatternSetRequest generates a "aws/request.Request" representing the +// client's request for the GetRegexPatternSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetRegexPatternSet for more information on using the GetRegexPatternSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetRegexPatternSetRequest method. +// req, resp := client.GetRegexPatternSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetRegexPatternSet +func (c *WAFV2) GetRegexPatternSetRequest(input *GetRegexPatternSetInput) (req *request.Request, output *GetRegexPatternSetOutput) { + op := &request.Operation{ + Name: opGetRegexPatternSet, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetRegexPatternSetInput{} + } + + output = &GetRegexPatternSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetRegexPatternSet API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Retrieves the specified RegexPatternSet. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation GetRegexPatternSet for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetRegexPatternSet +func (c *WAFV2) GetRegexPatternSet(input *GetRegexPatternSetInput) (*GetRegexPatternSetOutput, error) { + req, out := c.GetRegexPatternSetRequest(input) + return out, req.Send() +} + +// GetRegexPatternSetWithContext is the same as GetRegexPatternSet with the addition of +// the ability to pass a context and additional request options. +// +// See GetRegexPatternSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) GetRegexPatternSetWithContext(ctx aws.Context, input *GetRegexPatternSetInput, opts ...request.Option) (*GetRegexPatternSetOutput, error) { + req, out := c.GetRegexPatternSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetRuleGroup = "GetRuleGroup" + +// GetRuleGroupRequest generates a "aws/request.Request" representing the +// client's request for the GetRuleGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetRuleGroup for more information on using the GetRuleGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetRuleGroupRequest method. +// req, resp := client.GetRuleGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetRuleGroup +func (c *WAFV2) GetRuleGroupRequest(input *GetRuleGroupInput) (req *request.Request, output *GetRuleGroupOutput) { + op := &request.Operation{ + Name: opGetRuleGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetRuleGroupInput{} + } + + output = &GetRuleGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetRuleGroup API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Retrieves the specified RuleGroup. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation GetRuleGroup for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetRuleGroup +func (c *WAFV2) GetRuleGroup(input *GetRuleGroupInput) (*GetRuleGroupOutput, error) { + req, out := c.GetRuleGroupRequest(input) + return out, req.Send() +} + +// GetRuleGroupWithContext is the same as GetRuleGroup with the addition of +// the ability to pass a context and additional request options. +// +// See GetRuleGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) GetRuleGroupWithContext(ctx aws.Context, input *GetRuleGroupInput, opts ...request.Option) (*GetRuleGroupOutput, error) { + req, out := c.GetRuleGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetSampledRequests = "GetSampledRequests" + +// GetSampledRequestsRequest generates a "aws/request.Request" representing the +// client's request for the GetSampledRequests operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetSampledRequests for more information on using the GetSampledRequests +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetSampledRequestsRequest method. +// req, resp := client.GetSampledRequestsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetSampledRequests +func (c *WAFV2) 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 WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// 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 WAFV2's +// API operation GetSampledRequests for usage and error information. +// +// Returned Error Types: +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetSampledRequests +func (c *WAFV2) GetSampledRequests(input *GetSampledRequestsInput) (*GetSampledRequestsOutput, error) { + req, out := c.GetSampledRequestsRequest(input) + return out, req.Send() +} + +// GetSampledRequestsWithContext is the same as GetSampledRequests with the addition of +// the ability to pass a context and additional request options. +// +// See GetSampledRequests for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) GetSampledRequestsWithContext(ctx aws.Context, input *GetSampledRequestsInput, opts ...request.Option) (*GetSampledRequestsOutput, error) { + req, out := c.GetSampledRequestsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetWebACL = "GetWebACL" + +// GetWebACLRequest generates a "aws/request.Request" representing the +// client's request for the GetWebACL operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetWebACL for more information on using the GetWebACL +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetWebACLRequest method. +// req, resp := client.GetWebACLRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetWebACL +func (c *WAFV2) 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 WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Retrieves the specified WebACL. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation GetWebACL for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetWebACL +func (c *WAFV2) GetWebACL(input *GetWebACLInput) (*GetWebACLOutput, error) { + req, out := c.GetWebACLRequest(input) + return out, req.Send() +} + +// GetWebACLWithContext is the same as GetWebACL with the addition of +// the ability to pass a context and additional request options. +// +// See GetWebACL for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) GetWebACLWithContext(ctx aws.Context, input *GetWebACLInput, opts ...request.Option) (*GetWebACLOutput, error) { + req, out := c.GetWebACLRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetWebACLForResource = "GetWebACLForResource" + +// GetWebACLForResourceRequest generates a "aws/request.Request" representing the +// client's request for the GetWebACLForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetWebACLForResource for more information on using the GetWebACLForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetWebACLForResourceRequest method. +// req, resp := client.GetWebACLForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetWebACLForResource +func (c *WAFV2) GetWebACLForResourceRequest(input *GetWebACLForResourceInput) (req *request.Request, output *GetWebACLForResourceOutput) { + op := &request.Operation{ + Name: opGetWebACLForResource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetWebACLForResourceInput{} + } + + output = &GetWebACLForResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetWebACLForResource API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Retrieves the WebACL for 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 AWS WAFV2's +// API operation GetWebACLForResource for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFUnavailableEntityException +// AWS WAF couldn’t retrieve the resource that you requested. Retry your request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetWebACLForResource +func (c *WAFV2) GetWebACLForResource(input *GetWebACLForResourceInput) (*GetWebACLForResourceOutput, error) { + req, out := c.GetWebACLForResourceRequest(input) + return out, req.Send() +} + +// GetWebACLForResourceWithContext is the same as GetWebACLForResource with the addition of +// the ability to pass a context and additional request options. +// +// See GetWebACLForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) GetWebACLForResourceWithContext(ctx aws.Context, input *GetWebACLForResourceInput, opts ...request.Option) (*GetWebACLForResourceOutput, error) { + req, out := c.GetWebACLForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListAvailableManagedRuleGroups = "ListAvailableManagedRuleGroups" + +// ListAvailableManagedRuleGroupsRequest generates a "aws/request.Request" representing the +// client's request for the ListAvailableManagedRuleGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListAvailableManagedRuleGroups for more information on using the ListAvailableManagedRuleGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListAvailableManagedRuleGroupsRequest method. +// req, resp := client.ListAvailableManagedRuleGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListAvailableManagedRuleGroups +func (c *WAFV2) ListAvailableManagedRuleGroupsRequest(input *ListAvailableManagedRuleGroupsInput) (req *request.Request, output *ListAvailableManagedRuleGroupsOutput) { + op := &request.Operation{ + Name: opListAvailableManagedRuleGroups, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListAvailableManagedRuleGroupsInput{} + } + + output = &ListAvailableManagedRuleGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListAvailableManagedRuleGroups API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Retrieves an array of managed rule groups that are available for you to use. +// This list includes all AWS Managed Rules rule groups and the AWS Marketplace +// managed rule groups that you're subscribed to. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation ListAvailableManagedRuleGroups for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListAvailableManagedRuleGroups +func (c *WAFV2) ListAvailableManagedRuleGroups(input *ListAvailableManagedRuleGroupsInput) (*ListAvailableManagedRuleGroupsOutput, error) { + req, out := c.ListAvailableManagedRuleGroupsRequest(input) + return out, req.Send() +} + +// ListAvailableManagedRuleGroupsWithContext is the same as ListAvailableManagedRuleGroups with the addition of +// the ability to pass a context and additional request options. +// +// See ListAvailableManagedRuleGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) ListAvailableManagedRuleGroupsWithContext(ctx aws.Context, input *ListAvailableManagedRuleGroupsInput, opts ...request.Option) (*ListAvailableManagedRuleGroupsOutput, error) { + req, out := c.ListAvailableManagedRuleGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListIPSets = "ListIPSets" + +// ListIPSetsRequest generates a "aws/request.Request" representing the +// client's request for the ListIPSets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListIPSets for more information on using the ListIPSets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListIPSetsRequest method. +// req, resp := client.ListIPSetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListIPSets +func (c *WAFV2) 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 WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Retrieves an array of IPSetSummary objects for the IP sets that you manage. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation ListIPSets for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListIPSets +func (c *WAFV2) ListIPSets(input *ListIPSetsInput) (*ListIPSetsOutput, error) { + req, out := c.ListIPSetsRequest(input) + return out, req.Send() +} + +// ListIPSetsWithContext is the same as ListIPSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListIPSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) ListIPSetsWithContext(ctx aws.Context, input *ListIPSetsInput, opts ...request.Option) (*ListIPSetsOutput, error) { + req, out := c.ListIPSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListLoggingConfigurations = "ListLoggingConfigurations" + +// ListLoggingConfigurationsRequest generates a "aws/request.Request" representing the +// client's request for the ListLoggingConfigurations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListLoggingConfigurations for more information on using the ListLoggingConfigurations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListLoggingConfigurationsRequest method. +// req, resp := client.ListLoggingConfigurationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListLoggingConfigurations +func (c *WAFV2) ListLoggingConfigurationsRequest(input *ListLoggingConfigurationsInput) (req *request.Request, output *ListLoggingConfigurationsOutput) { + op := &request.Operation{ + Name: opListLoggingConfigurations, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListLoggingConfigurationsInput{} + } + + output = &ListLoggingConfigurationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListLoggingConfigurations API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Retrieves an array of your LoggingConfiguration 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 WAFV2's +// API operation ListLoggingConfigurations for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListLoggingConfigurations +func (c *WAFV2) ListLoggingConfigurations(input *ListLoggingConfigurationsInput) (*ListLoggingConfigurationsOutput, error) { + req, out := c.ListLoggingConfigurationsRequest(input) + return out, req.Send() +} + +// ListLoggingConfigurationsWithContext is the same as ListLoggingConfigurations with the addition of +// the ability to pass a context and additional request options. +// +// See ListLoggingConfigurations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) ListLoggingConfigurationsWithContext(ctx aws.Context, input *ListLoggingConfigurationsInput, opts ...request.Option) (*ListLoggingConfigurationsOutput, error) { + req, out := c.ListLoggingConfigurationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListRegexPatternSets = "ListRegexPatternSets" + +// ListRegexPatternSetsRequest generates a "aws/request.Request" representing the +// client's request for the ListRegexPatternSets operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListRegexPatternSets for more information on using the ListRegexPatternSets +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListRegexPatternSetsRequest method. +// req, resp := client.ListRegexPatternSetsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListRegexPatternSets +func (c *WAFV2) ListRegexPatternSetsRequest(input *ListRegexPatternSetsInput) (req *request.Request, output *ListRegexPatternSetsOutput) { + op := &request.Operation{ + Name: opListRegexPatternSets, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListRegexPatternSetsInput{} + } + + output = &ListRegexPatternSetsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListRegexPatternSets API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Retrieves an array of RegexPatternSetSummary objects for the regex pattern +// sets that you manage. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation ListRegexPatternSets for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListRegexPatternSets +func (c *WAFV2) ListRegexPatternSets(input *ListRegexPatternSetsInput) (*ListRegexPatternSetsOutput, error) { + req, out := c.ListRegexPatternSetsRequest(input) + return out, req.Send() +} + +// ListRegexPatternSetsWithContext is the same as ListRegexPatternSets with the addition of +// the ability to pass a context and additional request options. +// +// See ListRegexPatternSets for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) ListRegexPatternSetsWithContext(ctx aws.Context, input *ListRegexPatternSetsInput, opts ...request.Option) (*ListRegexPatternSetsOutput, error) { + req, out := c.ListRegexPatternSetsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListResourcesForWebACL = "ListResourcesForWebACL" + +// ListResourcesForWebACLRequest generates a "aws/request.Request" representing the +// client's request for the ListResourcesForWebACL operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListResourcesForWebACL for more information on using the ListResourcesForWebACL +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListResourcesForWebACLRequest method. +// req, resp := client.ListResourcesForWebACLRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListResourcesForWebACL +func (c *WAFV2) ListResourcesForWebACLRequest(input *ListResourcesForWebACLInput) (req *request.Request, output *ListResourcesForWebACLOutput) { + op := &request.Operation{ + Name: opListResourcesForWebACL, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListResourcesForWebACLInput{} + } + + output = &ListResourcesForWebACLOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListResourcesForWebACL API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Retrieves an array of the Amazon Resource Names (ARNs) for the regional resources +// that are associated with the specified web ACL. If you want the list of AWS +// CloudFront resources, use the AWS CloudFront call ListDistributionsByWebACLId. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation ListResourcesForWebACL for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListResourcesForWebACL +func (c *WAFV2) ListResourcesForWebACL(input *ListResourcesForWebACLInput) (*ListResourcesForWebACLOutput, error) { + req, out := c.ListResourcesForWebACLRequest(input) + return out, req.Send() +} + +// ListResourcesForWebACLWithContext is the same as ListResourcesForWebACL with the addition of +// the ability to pass a context and additional request options. +// +// See ListResourcesForWebACL for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) ListResourcesForWebACLWithContext(ctx aws.Context, input *ListResourcesForWebACLInput, opts ...request.Option) (*ListResourcesForWebACLOutput, error) { + req, out := c.ListResourcesForWebACLRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListRuleGroups = "ListRuleGroups" + +// ListRuleGroupsRequest generates a "aws/request.Request" representing the +// client's request for the ListRuleGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListRuleGroups for more information on using the ListRuleGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListRuleGroupsRequest method. +// req, resp := client.ListRuleGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListRuleGroups +func (c *WAFV2) ListRuleGroupsRequest(input *ListRuleGroupsInput) (req *request.Request, output *ListRuleGroupsOutput) { + op := &request.Operation{ + Name: opListRuleGroups, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListRuleGroupsInput{} + } + + output = &ListRuleGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListRuleGroups API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Retrieves an array of RuleGroupSummary objects for the rule groups that you +// manage. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation ListRuleGroups for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListRuleGroups +func (c *WAFV2) ListRuleGroups(input *ListRuleGroupsInput) (*ListRuleGroupsOutput, error) { + req, out := c.ListRuleGroupsRequest(input) + return out, req.Send() +} + +// ListRuleGroupsWithContext is the same as ListRuleGroups with the addition of +// the ability to pass a context and additional request options. +// +// See ListRuleGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) ListRuleGroupsWithContext(ctx aws.Context, input *ListRuleGroupsInput, opts ...request.Option) (*ListRuleGroupsOutput, error) { + req, out := c.ListRuleGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListTagsForResource +func (c *WAFV2) 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 WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Retrieves the TagInfoForResource for 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 AWS WAFV2's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFTagOperationException +// An error occurred during the tagging operation. Retry your request. +// +// * WAFTagOperationInternalErrorException +// AWS WAF couldn’t perform your tagging operation because of an internal +// error. Retry your request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListTagsForResource +func (c *WAFV2) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListWebACLs = "ListWebACLs" + +// ListWebACLsRequest generates a "aws/request.Request" representing the +// client's request for the ListWebACLs operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListWebACLs for more information on using the ListWebACLs +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListWebACLsRequest method. +// req, resp := client.ListWebACLsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListWebACLs +func (c *WAFV2) 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 WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Retrieves an array of WebACLSummary objects for the web ACLs that you manage. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation ListWebACLs for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListWebACLs +func (c *WAFV2) ListWebACLs(input *ListWebACLsInput) (*ListWebACLsOutput, error) { + req, out := c.ListWebACLsRequest(input) + return out, req.Send() +} + +// ListWebACLsWithContext is the same as ListWebACLs with the addition of +// the ability to pass a context and additional request options. +// +// See ListWebACLs for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) ListWebACLsWithContext(ctx aws.Context, input *ListWebACLsInput, opts ...request.Option) (*ListWebACLsOutput, error) { + req, out := c.ListWebACLsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutLoggingConfiguration = "PutLoggingConfiguration" + +// PutLoggingConfigurationRequest generates a "aws/request.Request" representing the +// client's request for the PutLoggingConfiguration operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutLoggingConfiguration for more information on using the PutLoggingConfiguration +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutLoggingConfigurationRequest method. +// req, resp := client.PutLoggingConfigurationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/PutLoggingConfiguration +func (c *WAFV2) PutLoggingConfigurationRequest(input *PutLoggingConfigurationInput) (req *request.Request, output *PutLoggingConfigurationOutput) { + op := &request.Operation{ + Name: opPutLoggingConfiguration, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutLoggingConfigurationInput{} + } + + output = &PutLoggingConfigurationOutput{} + req = c.newRequest(op, input, output) + return +} + +// PutLoggingConfiguration API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Enables the specified LoggingConfiguration, to start logging from a web ACL, +// according to the configuration provided. +// +// You can access information about all traffic that AWS WAF inspects using +// the following steps: +// +// Create an Amazon Kinesis Data Firehose. +// +// Create the data firehose with a PUT source and in the region that you are +// operating. If you are capturing logs for Amazon CloudFront, always create +// the firehose in US East (N. Virginia). +// +// Do not create the data firehose using a Kinesis stream as your source. +// +// Associate that firehose to your web ACL using a PutLoggingConfiguration request. +// +// When you successfully enable logging using a PutLoggingConfiguration request, +// AWS WAF will create a service linked role with the necessary permissions +// to write logs to the Amazon Kinesis Data Firehose. For more information, +// see Logging Web ACL Traffic Information (https://docs.aws.amazon.com/waf/latest/developerguide/logging.html) +// in the AWS WAF 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 WAFV2's +// API operation PutLoggingConfiguration for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFOptimisticLockException +// AWS WAF couldn’t save your changes because you tried to update or delete +// a resource that has changed since you last retrieved it. Get the resource +// again, make any changes you need to make to the new copy, and retry your +// operation. +// +// * WAFServiceLinkedRoleErrorException +// AWS WAF is not able to access the service linked role. This can be caused +// by a previous PutLoggingConfiguration request, which can lock the service +// linked role for about 20 seconds. Please try your request again. The service +// linked role can also be locked by a previous DeleteServiceLinkedRole request, +// which can lock the role for 15 minutes or more. If you recently made a call +// to DeleteServiceLinkedRole, wait at least 15 minutes and try the request +// again. If you receive this same exception again, you will have to wait additional +// time until the role is unlocked. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/PutLoggingConfiguration +func (c *WAFV2) PutLoggingConfiguration(input *PutLoggingConfigurationInput) (*PutLoggingConfigurationOutput, error) { + req, out := c.PutLoggingConfigurationRequest(input) + return out, req.Send() +} + +// PutLoggingConfigurationWithContext is the same as PutLoggingConfiguration with the addition of +// the ability to pass a context and additional request options. +// +// See PutLoggingConfiguration for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) PutLoggingConfigurationWithContext(ctx aws.Context, input *PutLoggingConfigurationInput, opts ...request.Option) (*PutLoggingConfigurationOutput, error) { + req, out := c.PutLoggingConfigurationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/TagResource +func (c *WAFV2) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Associates tags with the specified AWS resource. Tags are key:value pairs +// that you can associate with AWS resources. For example, the tag key might +// be "customer" and the tag value might be "companyA." You can specify one +// or more tags to add to each container. You can add up to 50 tags to each +// AWS 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 WAFV2's +// API operation TagResource for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFLimitsExceededException +// AWS WAF couldn’t perform the operation because you exceeded your resource +// limit. For example, the maximum number of WebACL objects that you can create +// for an AWS account. For more information, see Limits (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) +// in the AWS WAF Developer Guide. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFTagOperationException +// An error occurred during the tagging operation. Retry your request. +// +// * WAFTagOperationInternalErrorException +// AWS WAF couldn’t perform your tagging operation because of an internal +// error. Retry your request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/TagResource +func (c *WAFV2) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UntagResource +func (c *WAFV2) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Disassociates tags from an AWS resource. Tags are key:value pairs that you +// can associate with AWS resources. For example, the tag key might be "customer" +// and the tag value might be "companyA." You can specify one or more tags to +// add to each container. You can add up to 50 tags to each AWS 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 WAFV2's +// API operation UntagResource for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFTagOperationException +// An error occurred during the tagging operation. Retry your request. +// +// * WAFTagOperationInternalErrorException +// AWS WAF couldn’t perform your tagging operation because of an internal +// error. Retry your request. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UntagResource +func (c *WAFV2) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateIPSet = "UpdateIPSet" + +// UpdateIPSetRequest generates a "aws/request.Request" representing the +// client's request for the UpdateIPSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateIPSet for more information on using the UpdateIPSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateIPSetRequest method. +// req, resp := client.UpdateIPSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateIPSet +func (c *WAFV2) 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 WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Updates the specified IPSet. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation UpdateIPSet for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFDuplicateItemException +// AWS WAF couldn’t perform the operation because the resource that you tried +// to save is a duplicate of an existing one. +// +// * WAFOptimisticLockException +// AWS WAF couldn’t save your changes because you tried to update or delete +// a resource that has changed since you last retrieved it. Get the resource +// again, make any changes you need to make to the new copy, and retry your +// operation. +// +// * WAFLimitsExceededException +// AWS WAF couldn’t perform the operation because you exceeded your resource +// limit. For example, the maximum number of WebACL objects that you can create +// for an AWS account. For more information, see Limits (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) +// in the AWS WAF Developer Guide. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateIPSet +func (c *WAFV2) UpdateIPSet(input *UpdateIPSetInput) (*UpdateIPSetOutput, error) { + req, out := c.UpdateIPSetRequest(input) + return out, req.Send() +} + +// UpdateIPSetWithContext is the same as UpdateIPSet with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateIPSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) UpdateIPSetWithContext(ctx aws.Context, input *UpdateIPSetInput, opts ...request.Option) (*UpdateIPSetOutput, error) { + req, out := c.UpdateIPSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateRegexPatternSet = "UpdateRegexPatternSet" + +// UpdateRegexPatternSetRequest generates a "aws/request.Request" representing the +// client's request for the UpdateRegexPatternSet operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateRegexPatternSet for more information on using the UpdateRegexPatternSet +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateRegexPatternSetRequest method. +// req, resp := client.UpdateRegexPatternSetRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateRegexPatternSet +func (c *WAFV2) UpdateRegexPatternSetRequest(input *UpdateRegexPatternSetInput) (req *request.Request, output *UpdateRegexPatternSetOutput) { + op := &request.Operation{ + Name: opUpdateRegexPatternSet, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateRegexPatternSetInput{} + } + + output = &UpdateRegexPatternSetOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateRegexPatternSet API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Updates the specified RegexPatternSet. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation UpdateRegexPatternSet for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFDuplicateItemException +// AWS WAF couldn’t perform the operation because the resource that you tried +// to save is a duplicate of an existing one. +// +// * WAFOptimisticLockException +// AWS WAF couldn’t save your changes because you tried to update or delete +// a resource that has changed since you last retrieved it. Get the resource +// again, make any changes you need to make to the new copy, and retry your +// operation. +// +// * WAFLimitsExceededException +// AWS WAF couldn’t perform the operation because you exceeded your resource +// limit. For example, the maximum number of WebACL objects that you can create +// for an AWS account. For more information, see Limits (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) +// in the AWS WAF Developer Guide. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateRegexPatternSet +func (c *WAFV2) UpdateRegexPatternSet(input *UpdateRegexPatternSetInput) (*UpdateRegexPatternSetOutput, error) { + req, out := c.UpdateRegexPatternSetRequest(input) + return out, req.Send() +} + +// UpdateRegexPatternSetWithContext is the same as UpdateRegexPatternSet with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateRegexPatternSet for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) UpdateRegexPatternSetWithContext(ctx aws.Context, input *UpdateRegexPatternSetInput, opts ...request.Option) (*UpdateRegexPatternSetOutput, error) { + req, out := c.UpdateRegexPatternSetRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateRuleGroup = "UpdateRuleGroup" + +// UpdateRuleGroupRequest generates a "aws/request.Request" representing the +// client's request for the UpdateRuleGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateRuleGroup for more information on using the UpdateRuleGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateRuleGroupRequest method. +// req, resp := client.UpdateRuleGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateRuleGroup +func (c *WAFV2) UpdateRuleGroupRequest(input *UpdateRuleGroupInput) (req *request.Request, output *UpdateRuleGroupOutput) { + op := &request.Operation{ + Name: opUpdateRuleGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateRuleGroupInput{} + } + + output = &UpdateRuleGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// UpdateRuleGroup API operation for AWS WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Updates the specified RuleGroup. +// +// A rule group defines a collection of rules to inspect and control web requests +// that you can use in a WebACL. When you create a rule group, you define an +// immutable capacity limit. If you update a rule group, you must stay within +// the capacity. This allows others to reuse the rule group with confidence +// in its capacity requirements. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for AWS WAFV2's +// API operation UpdateRuleGroup for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFDuplicateItemException +// AWS WAF couldn’t perform the operation because the resource that you tried +// to save is a duplicate of an existing one. +// +// * WAFOptimisticLockException +// AWS WAF couldn’t save your changes because you tried to update or delete +// a resource that has changed since you last retrieved it. Get the resource +// again, make any changes you need to make to the new copy, and retry your +// operation. +// +// * WAFLimitsExceededException +// AWS WAF couldn’t perform the operation because you exceeded your resource +// limit. For example, the maximum number of WebACL objects that you can create +// for an AWS account. For more information, see Limits (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) +// in the AWS WAF Developer Guide. +// +// * WAFUnavailableEntityException +// AWS WAF couldn’t retrieve the resource that you requested. Retry your request. +// +// * WAFSubscriptionNotFoundException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateRuleGroup +func (c *WAFV2) UpdateRuleGroup(input *UpdateRuleGroupInput) (*UpdateRuleGroupOutput, error) { + req, out := c.UpdateRuleGroupRequest(input) + return out, req.Send() +} + +// UpdateRuleGroupWithContext is the same as UpdateRuleGroup with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateRuleGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) UpdateRuleGroupWithContext(ctx aws.Context, input *UpdateRuleGroupInput, opts ...request.Option) (*UpdateRuleGroupOutput, error) { + req, out := c.UpdateRuleGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateWebACL = "UpdateWebACL" + +// UpdateWebACLRequest generates a "aws/request.Request" representing the +// client's request for the UpdateWebACL operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateWebACL for more information on using the UpdateWebACL +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateWebACLRequest method. +// req, resp := client.UpdateWebACLRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateWebACL +func (c *WAFV2) 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 WAFV2. +// +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Updates the specified WebACL. +// +// A Web ACL defines a collection of rules to use to inspect and control web +// requests. Each rule has an action defined (allow, block, or count) for requests +// that match the statement of the rule. In the Web ACL, you assign a default +// action to take (allow, block) for any request that does not match any of +// the rules. The rules in a Web ACL can be a combination of the types Rule, +// RuleGroup, and managed rule group. You can associate a Web ACL with one or +// more AWS resources to protect. The resources can be Amazon CloudFront, an +// Amazon API Gateway API, or an 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 AWS WAFV2's +// API operation UpdateWebACL for usage and error information. +// +// Returned Error Types: +// * WAFInternalErrorException +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +// +// * WAFInvalidParameterException +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +// +// * WAFNonexistentItemException +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +// +// * WAFDuplicateItemException +// AWS WAF couldn’t perform the operation because the resource that you tried +// to save is a duplicate of an existing one. +// +// * WAFOptimisticLockException +// AWS WAF couldn’t save your changes because you tried to update or delete +// a resource that has changed since you last retrieved it. Get the resource +// again, make any changes you need to make to the new copy, and retry your +// operation. +// +// * WAFLimitsExceededException +// AWS WAF couldn’t perform the operation because you exceeded your resource +// limit. For example, the maximum number of WebACL objects that you can create +// for an AWS account. For more information, see Limits (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) +// in the AWS WAF Developer Guide. +// +// * WAFInvalidResourceException +// AWS WAF couldn’t perform the operation because the resource that you requested +// isn’t valid. Check the resource, and try again. +// +// * WAFUnavailableEntityException +// AWS WAF couldn’t retrieve the resource that you requested. Retry your request. +// +// * WAFSubscriptionNotFoundException +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateWebACL +func (c *WAFV2) UpdateWebACL(input *UpdateWebACLInput) (*UpdateWebACLOutput, error) { + req, out := c.UpdateWebACLRequest(input) + return out, req.Send() +} + +// UpdateWebACLWithContext is the same as UpdateWebACL with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateWebACL for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WAFV2) UpdateWebACLWithContext(ctx aws.Context, input *UpdateWebACLInput, opts ...request.Option) (*UpdateWebACLOutput, error) { + req, out := c.UpdateWebACLRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// All query arguments of a web request. +// +// This is used only to indicate the web request component for AWS WAF to inspect, +// in the FieldToMatch specification. +type AllQueryArguments struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AllQueryArguments) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AllQueryArguments) GoString() string { + return s.String() +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Specifies that AWS WAF should allow requests. +// +// This is used only in the context of other settings, for example to specify +// values for RuleAction and web ACL DefaultAction. +type AllowAction struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AllowAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AllowAction) GoString() string { + return s.String() +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A logical rule statement used to combine other rule statements with AND logic. +// You provide more than one Statement within the AndStatement. +type AndStatement struct { + _ struct{} `type:"structure"` + + // The statements to combine with AND logic. You can use any statements that + // can be nested. + // + // Statements is a required field + Statements []*Statement `type:"list" required:"true"` +} + +// String returns the string representation +func (s AndStatement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AndStatement) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AndStatement) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AndStatement"} + if s.Statements == nil { + invalidParams.Add(request.NewErrParamRequired("Statements")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetStatements sets the Statements field's value. +func (s *AndStatement) SetStatements(v []*Statement) *AndStatement { + s.Statements = v + return s +} + +type AssociateWebACLInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource to associate with the web + // ACL. + // + // The ARN must be in one of the following formats: + // + // * For an Application Load Balancer: arn:aws:elasticloadbalancing:region:account-id:loadbalancer/app/load-balancer-name/load-balancer-id + // + // * For an Amazon API Gateway stage: arn:aws:apigateway:region::/restapis/api-id/stages/stage-name + // + // ResourceArn is a required field + ResourceArn *string `min:"20" type:"string" required:"true"` + + // The Amazon Resource Name (ARN) of the Web ACL that you want to associate + // with the resource. + // + // WebACLArn is a required field + WebACLArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s AssociateWebACLInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateWebACLInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssociateWebACLInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssociateWebACLInput"} + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) + } + if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) + } + if s.WebACLArn == nil { + invalidParams.Add(request.NewErrParamRequired("WebACLArn")) + } + if s.WebACLArn != nil && len(*s.WebACLArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("WebACLArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *AssociateWebACLInput) SetResourceArn(v string) *AssociateWebACLInput { + s.ResourceArn = &v + return s +} + +// SetWebACLArn sets the WebACLArn field's value. +func (s *AssociateWebACLInput) SetWebACLArn(v string) *AssociateWebACLInput { + s.WebACLArn = &v + return s +} + +type AssociateWebACLOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AssociateWebACLOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateWebACLOutput) GoString() string { + return s.String() +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Specifies that AWS WAF should block requests. +// +// This is used only in the context of other settings, for example to specify +// values for RuleAction and web ACL DefaultAction. +type BlockAction struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s BlockAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BlockAction) GoString() string { + return s.String() +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// The body of a web request. This immediately follows the request headers. +// +// This is used only to indicate the web request component for AWS WAF to inspect, +// in the FieldToMatch specification. +type Body struct { + _ struct{} `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() +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A rule statement that defines a string match search for AWS WAF to apply +// to web requests. The byte match statement provides the bytes to search for, +// the location in requests that you want AWS WAF to search, and other settings. +// The bytes to search for are typically a string that corresponds with ASCII +// characters. In the AWS WAF console and the developer guide, this is refered +// to as a string match statement. +type ByteMatchStatement struct { + _ struct{} `type:"structure"` + + // The part of a web request that you want AWS WAF to inspect. For more information, + // see FieldToMatch. + // + // FieldToMatch is a required field + FieldToMatch *FieldToMatch `type:"structure" required:"true"` + + // The area within the portion of a web request that you want AWS WAF to search + // for SearchString. Valid values include the following: + // + // CONTAINS + // + // The specified part of the web request must include the value of SearchString, + // but the location doesn't matter. + // + // CONTAINS_WORD + // + // The specified part of the web request must include the value of SearchString, + // and SearchString must contain only alphanumeric characters or underscore + // (A-Z, a-z, 0-9, or _). In addition, SearchString must be a word, which means + // that both of the following are true: + // + // * SearchString is at the beginning of the specified part of the web request + // or is preceded by a character other than an alphanumeric character or + // underscore (_). Examples include the value of a header and ;BadBot. + // + // * SearchString is at the end of the specified part of the web request + // or is followed by a character other than an alphanumeric character or + // underscore (_), for example, BadBot; and -BadBot;. + // + // EXACTLY + // + // The value of the specified part of the web request must exactly match the + // value of SearchString. + // + // STARTS_WITH + // + // The value of SearchString must appear at the beginning of the specified part + // of the web request. + // + // ENDS_WITH + // + // The value of SearchString 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"` + + // A string value that you want AWS WAF to search for. AWS WAF searches only + // in the part of web requests that you designate for inspection in FieldToMatch. + // The maximum length of the value is 50 bytes. + // + // Valid values depend on the areas that you specify for inspection in FieldToMatch: + // + // * Method: The HTTP method that you want AWS WAF to search for. This indicates + // the type of operation specified in the request. + // + // * UriPath: The value that you want AWS WAF to search for in the URI path, + // for example, /images/daily-ad.jpg. + // + // If SearchString 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 SearchString. + // + // 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. + // + // SearchString is automatically base64 encoded/decoded by the SDK. + // + // SearchString is a required field + SearchString []byte `type:"blob" required:"true"` + + // Text transformations eliminate some of the unusual formatting that attackers + // use in web requests in an effort to bypass detection. If you specify one + // or more transformations in a rule statement, AWS WAF performs all transformations + // on the content identified by FieldToMatch, starting from the lowest priority + // setting, before inspecting the content for a match. + // + // TextTransformations is a required field + TextTransformations []*TextTransformation `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s ByteMatchStatement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ByteMatchStatement) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ByteMatchStatement) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ByteMatchStatement"} + if s.FieldToMatch == nil { + invalidParams.Add(request.NewErrParamRequired("FieldToMatch")) + } + if s.PositionalConstraint == nil { + invalidParams.Add(request.NewErrParamRequired("PositionalConstraint")) + } + if s.SearchString == nil { + invalidParams.Add(request.NewErrParamRequired("SearchString")) + } + if s.TextTransformations == nil { + invalidParams.Add(request.NewErrParamRequired("TextTransformations")) + } + if s.TextTransformations != nil && len(s.TextTransformations) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TextTransformations", 1)) + } + if s.FieldToMatch != nil { + if err := s.FieldToMatch.Validate(); err != nil { + invalidParams.AddNested("FieldToMatch", err.(request.ErrInvalidParams)) + } + } + if s.TextTransformations != nil { + for i, v := range s.TextTransformations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TextTransformations", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFieldToMatch sets the FieldToMatch field's value. +func (s *ByteMatchStatement) SetFieldToMatch(v *FieldToMatch) *ByteMatchStatement { + s.FieldToMatch = v + return s +} + +// SetPositionalConstraint sets the PositionalConstraint field's value. +func (s *ByteMatchStatement) SetPositionalConstraint(v string) *ByteMatchStatement { + s.PositionalConstraint = &v + return s +} + +// SetSearchString sets the SearchString field's value. +func (s *ByteMatchStatement) SetSearchString(v []byte) *ByteMatchStatement { + s.SearchString = v + return s +} + +// SetTextTransformations sets the TextTransformations field's value. +func (s *ByteMatchStatement) SetTextTransformations(v []*TextTransformation) *ByteMatchStatement { + s.TextTransformations = v + return s +} + +type CheckCapacityInput struct { + _ struct{} `type:"structure"` + + // An array of Rule that you're configuring to use in a rule group or web ACL. + // + // Rules is a required field + Rules []*Rule `type:"list" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// String returns the string representation +func (s CheckCapacityInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CheckCapacityInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CheckCapacityInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CheckCapacityInput"} + if s.Rules == nil { + invalidParams.Add(request.NewErrParamRequired("Rules")) + } + if s.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + if s.Rules != nil { + for i, v := range s.Rules { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRules sets the Rules field's value. +func (s *CheckCapacityInput) SetRules(v []*Rule) *CheckCapacityInput { + s.Rules = v + return s +} + +// SetScope sets the Scope field's value. +func (s *CheckCapacityInput) SetScope(v string) *CheckCapacityInput { + s.Scope = &v + return s +} + +type CheckCapacityOutput struct { + _ struct{} `type:"structure"` + + // The capacity required by the rules and scope. + Capacity *int64 `type:"long"` +} + +// String returns the string representation +func (s CheckCapacityOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CheckCapacityOutput) GoString() string { + return s.String() +} + +// SetCapacity sets the Capacity field's value. +func (s *CheckCapacityOutput) SetCapacity(v int64) *CheckCapacityOutput { + s.Capacity = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Specifies that AWS WAF should count requests. +// +// This is used only in the context of other settings, for example to specify +// values for RuleAction and web ACL DefaultAction. +type CountAction struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s CountAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CountAction) GoString() string { + return s.String() +} + +type CreateIPSetInput struct { + _ struct{} `type:"structure"` + + // Contains an array of strings that specify one or more IP addresses or blocks + // of IP addresses in Classless Inter-Domain Routing (CIDR) notation. AWS WAF + // supports all address ranges for IP versions IPv4 and IPv6. + // + // Examples: + // + // * 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. + // + // * 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. + // + // For more information about CIDR notation, see the Wikipedia entry Classless + // Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing). + // + // Addresses is a required field + Addresses []*string `type:"list" required:"true"` + + // A friendly description of the IP set. You cannot change the description of + // an IP set after you create it. + Description *string `min:"1" type:"string"` + + // Specify IPV4 or IPV6. + // + // IPAddressVersion is a required field + IPAddressVersion *string `type:"string" required:"true" enum:"IPAddressVersion"` + + // A friendly name of the IP set. You cannot change the name of an IPSet after + // you create it. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` + + // An array of key:value pairs to associate with the resource. + Tags []*Tag `min:"1" type:"list"` +} + +// 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.Addresses == nil { + invalidParams.Add(request.NewErrParamRequired("Addresses")) + } + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 1)) + } + if s.IPAddressVersion == nil { + invalidParams.Add(request.NewErrParamRequired("IPAddressVersion")) + } + 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.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + 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 +} + +// SetAddresses sets the Addresses field's value. +func (s *CreateIPSetInput) SetAddresses(v []*string) *CreateIPSetInput { + s.Addresses = v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateIPSetInput) SetDescription(v string) *CreateIPSetInput { + s.Description = &v + return s +} + +// SetIPAddressVersion sets the IPAddressVersion field's value. +func (s *CreateIPSetInput) SetIPAddressVersion(v string) *CreateIPSetInput { + s.IPAddressVersion = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateIPSetInput) SetName(v string) *CreateIPSetInput { + s.Name = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *CreateIPSetInput) SetScope(v string) *CreateIPSetInput { + s.Scope = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateIPSetInput) SetTags(v []*Tag) *CreateIPSetInput { + s.Tags = v + return s +} + +type CreateIPSetOutput struct { + _ struct{} `type:"structure"` + + // High-level information about an IPSet, returned by operations like create + // and list. This provides information like the ID, that you can use to retrieve + // and manage an IPSet, and the ARN, that you provide to the IPSetReferenceStatement + // to use the address set in a Rule. + Summary *IPSetSummary `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() +} + +// SetSummary sets the Summary field's value. +func (s *CreateIPSetOutput) SetSummary(v *IPSetSummary) *CreateIPSetOutput { + s.Summary = v + return s +} + +type CreateRegexPatternSetInput struct { + _ struct{} `type:"structure"` + + // A friendly description of the set. You cannot change the description of a + // set after you create it. + Description *string `min:"1" type:"string"` + + // A friendly name of the set. You cannot change the name after you create the + // set. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Array of regular expression strings. + // + // RegularExpressionList is a required field + RegularExpressionList []*Regex `min:"1" type:"list" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` + + // An array of key:value pairs to associate with the resource. + Tags []*Tag `min:"1" type:"list"` +} + +// String returns the string representation +func (s CreateRegexPatternSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateRegexPatternSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateRegexPatternSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateRegexPatternSetInput"} + 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) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.RegularExpressionList == nil { + invalidParams.Add(request.NewErrParamRequired("RegularExpressionList")) + } + if s.RegularExpressionList != nil && len(s.RegularExpressionList) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RegularExpressionList", 1)) + } + if s.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + if s.RegularExpressionList != nil { + for i, v := range s.RegularExpressionList { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RegularExpressionList", 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 +} + +// SetDescription sets the Description field's value. +func (s *CreateRegexPatternSetInput) SetDescription(v string) *CreateRegexPatternSetInput { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateRegexPatternSetInput) SetName(v string) *CreateRegexPatternSetInput { + s.Name = &v + return s +} + +// SetRegularExpressionList sets the RegularExpressionList field's value. +func (s *CreateRegexPatternSetInput) SetRegularExpressionList(v []*Regex) *CreateRegexPatternSetInput { + s.RegularExpressionList = v + return s +} + +// SetScope sets the Scope field's value. +func (s *CreateRegexPatternSetInput) SetScope(v string) *CreateRegexPatternSetInput { + s.Scope = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateRegexPatternSetInput) SetTags(v []*Tag) *CreateRegexPatternSetInput { + s.Tags = v + return s +} + +type CreateRegexPatternSetOutput struct { + _ struct{} `type:"structure"` + + // High-level information about a RegexPatternSet, returned by operations like + // create and list. This provides information like the ID, that you can use + // to retrieve and manage a RegexPatternSet, and the ARN, that you provide to + // the RegexPatternSetReferenceStatement to use the pattern set in a Rule. + Summary *RegexPatternSetSummary `type:"structure"` +} + +// String returns the string representation +func (s CreateRegexPatternSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateRegexPatternSetOutput) GoString() string { + return s.String() +} + +// SetSummary sets the Summary field's value. +func (s *CreateRegexPatternSetOutput) SetSummary(v *RegexPatternSetSummary) *CreateRegexPatternSetOutput { + s.Summary = v + return s +} + +type CreateRuleGroupInput struct { + _ struct{} `type:"structure"` + + // The web ACL capacity units (WCUs) required for this rule group. + // + // When you create your own rule group, you define this, and you cannot change + // it after creation. When you add or modify the rules in a rule group, AWS + // WAF enforces this limit. You can check the capacity for a set of rules using + // CheckCapacity. + // + // AWS WAF uses WCUs to calculate and control the operating resources that are + // used to run your rules, rule groups, and web ACLs. AWS WAF calculates capacity + // differently for each rule type, to reflect the relative cost of each rule. + // Simple rules that cost little to run use fewer WCUs than more complex rules + // that use more processing power. Rule group capacity is fixed at creation, + // which helps users plan their web ACL WCU usage when they use a rule group. + // The WCU limit for web ACLs is 1,500. + // + // Capacity is a required field + Capacity *int64 `min:"1" type:"long" required:"true"` + + // A friendly description of the rule group. You cannot change the description + // of a rule group after you create it. + Description *string `min:"1" type:"string"` + + // A friendly name of the rule group. You cannot change the name of a rule group + // after you create it. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The Rule statements used to identify the web requests that you want to allow, + // block, or count. Each rule includes one top-level statement that AWS WAF + // uses to identify matching web requests, and parameters that govern how AWS + // WAF handles them. + Rules []*Rule `type:"list"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` + + // An array of key:value pairs to associate with the resource. + Tags []*Tag `min:"1" type:"list"` + + // Defines and enables Amazon CloudWatch metrics and web request sample collection. + // + // VisibilityConfig is a required field + VisibilityConfig *VisibilityConfig `type:"structure" required:"true"` +} + +// String returns the string representation +func (s CreateRuleGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateRuleGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateRuleGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateRuleGroupInput"} + if s.Capacity == nil { + invalidParams.Add(request.NewErrParamRequired("Capacity")) + } + if s.Capacity != nil && *s.Capacity < 1 { + invalidParams.Add(request.NewErrParamMinValue("Capacity", 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) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + if s.VisibilityConfig == nil { + invalidParams.Add(request.NewErrParamRequired("VisibilityConfig")) + } + 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 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 s.VisibilityConfig != nil { + if err := s.VisibilityConfig.Validate(); err != nil { + invalidParams.AddNested("VisibilityConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCapacity sets the Capacity field's value. +func (s *CreateRuleGroupInput) SetCapacity(v int64) *CreateRuleGroupInput { + s.Capacity = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateRuleGroupInput) SetDescription(v string) *CreateRuleGroupInput { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateRuleGroupInput) SetName(v string) *CreateRuleGroupInput { + s.Name = &v + return s +} + +// SetRules sets the Rules field's value. +func (s *CreateRuleGroupInput) SetRules(v []*Rule) *CreateRuleGroupInput { + s.Rules = v + return s +} + +// SetScope sets the Scope field's value. +func (s *CreateRuleGroupInput) SetScope(v string) *CreateRuleGroupInput { + s.Scope = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateRuleGroupInput) SetTags(v []*Tag) *CreateRuleGroupInput { + s.Tags = v + return s +} + +// SetVisibilityConfig sets the VisibilityConfig field's value. +func (s *CreateRuleGroupInput) SetVisibilityConfig(v *VisibilityConfig) *CreateRuleGroupInput { + s.VisibilityConfig = v + return s +} + +type CreateRuleGroupOutput struct { + _ struct{} `type:"structure"` + + // High-level information about a RuleGroup, returned by operations like create + // and list. This provides information like the ID, that you can use to retrieve + // and manage a RuleGroup, and the ARN, that you provide to the RuleGroupReferenceStatement + // to use the rule group in a Rule. + Summary *RuleGroupSummary `type:"structure"` +} + +// String returns the string representation +func (s CreateRuleGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateRuleGroupOutput) GoString() string { + return s.String() +} + +// SetSummary sets the Summary field's value. +func (s *CreateRuleGroupOutput) SetSummary(v *RuleGroupSummary) *CreateRuleGroupOutput { + s.Summary = v + return s +} + +type CreateWebACLInput struct { + _ struct{} `type:"structure"` + + // The action to perform if none of the Rules contained in the WebACL match. + // + // DefaultAction is a required field + DefaultAction *DefaultAction `type:"structure" required:"true"` + + // A friendly description of the Web ACL. You cannot change the description + // of a Web ACL after you create it. + Description *string `min:"1" type:"string"` + + // A friendly name of the Web ACL. You cannot change the name of a Web ACL after + // you create it. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The Rule statements used to identify the web requests that you want to allow, + // block, or count. Each rule includes one top-level statement that AWS WAF + // uses to identify matching web requests, and parameters that govern how AWS + // WAF handles them. + Rules []*Rule `type:"list"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` + + // An array of key:value pairs to associate with the resource. + Tags []*Tag `min:"1" type:"list"` + + // Defines and enables Amazon CloudWatch metrics and web request sample collection. + // + // VisibilityConfig is a required field + VisibilityConfig *VisibilityConfig `type:"structure" 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.DefaultAction == nil { + invalidParams.Add(request.NewErrParamRequired("DefaultAction")) + } + 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) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + if s.Tags != nil && len(s.Tags) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) + } + if s.VisibilityConfig == nil { + invalidParams.Add(request.NewErrParamRequired("VisibilityConfig")) + } + 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 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 s.VisibilityConfig != nil { + if err := s.VisibilityConfig.Validate(); err != nil { + invalidParams.AddNested("VisibilityConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDefaultAction sets the DefaultAction field's value. +func (s *CreateWebACLInput) SetDefaultAction(v *DefaultAction) *CreateWebACLInput { + s.DefaultAction = v + return s +} + +// SetDescription sets the Description field's value. +func (s *CreateWebACLInput) SetDescription(v string) *CreateWebACLInput { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateWebACLInput) SetName(v string) *CreateWebACLInput { + s.Name = &v + return s +} + +// SetRules sets the Rules field's value. +func (s *CreateWebACLInput) SetRules(v []*Rule) *CreateWebACLInput { + s.Rules = v + return s +} + +// SetScope sets the Scope field's value. +func (s *CreateWebACLInput) SetScope(v string) *CreateWebACLInput { + s.Scope = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateWebACLInput) SetTags(v []*Tag) *CreateWebACLInput { + s.Tags = v + return s +} + +// SetVisibilityConfig sets the VisibilityConfig field's value. +func (s *CreateWebACLInput) SetVisibilityConfig(v *VisibilityConfig) *CreateWebACLInput { + s.VisibilityConfig = v + return s +} + +type CreateWebACLOutput struct { + _ struct{} `type:"structure"` + + // High-level information about a WebACL, returned by operations like create + // and list. This provides information like the ID, that you can use to retrieve + // and manage a WebACL, and the ARN, that you provide to operations like AssociateWebACL. + Summary *WebACLSummary `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() +} + +// SetSummary sets the Summary field's value. +func (s *CreateWebACLOutput) SetSummary(v *WebACLSummary) *CreateWebACLOutput { + s.Summary = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// In a WebACL, this is the action that you want AWS WAF to perform when a web +// request doesn't match any of the rules in the WebACL. The default action +// must be a terminating action, so count is not allowed. +type DefaultAction struct { + _ struct{} `type:"structure"` + + // Specifies that AWS WAF should allow requests by default. + Allow *AllowAction `type:"structure"` + + // Specifies that AWS WAF should block requests by default. + Block *BlockAction `type:"structure"` +} + +// String returns the string representation +func (s DefaultAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DefaultAction) GoString() string { + return s.String() +} + +// SetAllow sets the Allow field's value. +func (s *DefaultAction) SetAllow(v *AllowAction) *DefaultAction { + s.Allow = v + return s +} + +// SetBlock sets the Block field's value. +func (s *DefaultAction) SetBlock(v *BlockAction) *DefaultAction { + s.Block = v + return s +} + +type DeleteIPSetInput struct { + _ struct{} `type:"structure"` + + // A unique identifier for the set. This ID is returned in the responses to + // create and list commands. You provide it to operations like update and delete. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + // + // LockToken is a required field + LockToken *string `min:"1" type:"string" required:"true"` + + // A friendly name of the IP set. You cannot change the name of an IPSet after + // you create it. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// 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.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Id != nil && len(*s.Id) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Id", 1)) + } + if s.LockToken == nil { + invalidParams.Add(request.NewErrParamRequired("LockToken")) + } + if s.LockToken != nil && len(*s.LockToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LockToken", 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.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *DeleteIPSetInput) SetId(v string) *DeleteIPSetInput { + s.Id = &v + return s +} + +// SetLockToken sets the LockToken field's value. +func (s *DeleteIPSetInput) SetLockToken(v string) *DeleteIPSetInput { + s.LockToken = &v + return s +} + +// SetName sets the Name field's value. +func (s *DeleteIPSetInput) SetName(v string) *DeleteIPSetInput { + s.Name = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *DeleteIPSetInput) SetScope(v string) *DeleteIPSetInput { + s.Scope = &v + return s +} + +type DeleteIPSetOutput struct { + _ struct{} `type:"structure"` +} + +// 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() +} + +type DeleteLoggingConfigurationInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the web ACL from which you want to delete + // the LoggingConfiguration. + // + // ResourceArn is a required field + ResourceArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteLoggingConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoggingConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteLoggingConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteLoggingConfigurationInput"} + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) + } + if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *DeleteLoggingConfigurationInput) SetResourceArn(v string) *DeleteLoggingConfigurationInput { + s.ResourceArn = &v + return s +} + +type DeleteLoggingConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteLoggingConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteLoggingConfigurationOutput) GoString() string { + return s.String() +} + +type DeleteRegexPatternSetInput struct { + _ struct{} `type:"structure"` + + // A unique identifier for the set. This ID is returned in the responses to + // create and list commands. You provide it to operations like update and delete. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + // + // LockToken is a required field + LockToken *string `min:"1" type:"string" required:"true"` + + // A friendly name of the set. You cannot change the name after you create the + // set. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// String returns the string representation +func (s DeleteRegexPatternSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRegexPatternSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteRegexPatternSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteRegexPatternSetInput"} + 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.LockToken == nil { + invalidParams.Add(request.NewErrParamRequired("LockToken")) + } + if s.LockToken != nil && len(*s.LockToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LockToken", 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.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *DeleteRegexPatternSetInput) SetId(v string) *DeleteRegexPatternSetInput { + s.Id = &v + return s +} + +// SetLockToken sets the LockToken field's value. +func (s *DeleteRegexPatternSetInput) SetLockToken(v string) *DeleteRegexPatternSetInput { + s.LockToken = &v + return s +} + +// SetName sets the Name field's value. +func (s *DeleteRegexPatternSetInput) SetName(v string) *DeleteRegexPatternSetInput { + s.Name = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *DeleteRegexPatternSetInput) SetScope(v string) *DeleteRegexPatternSetInput { + s.Scope = &v + return s +} + +type DeleteRegexPatternSetOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteRegexPatternSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRegexPatternSetOutput) GoString() string { + return s.String() +} + +type DeleteRuleGroupInput struct { + _ struct{} `type:"structure"` + + // A unique identifier for the rule group. This ID is returned in the responses + // to create and list commands. You provide it to operations like update and + // delete. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + // + // LockToken is a required field + LockToken *string `min:"1" type:"string" required:"true"` + + // A friendly name of the rule group. You cannot change the name of a rule group + // after you create it. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// String returns the string representation +func (s DeleteRuleGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRuleGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteRuleGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteRuleGroupInput"} + 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.LockToken == nil { + invalidParams.Add(request.NewErrParamRequired("LockToken")) + } + if s.LockToken != nil && len(*s.LockToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LockToken", 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.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *DeleteRuleGroupInput) SetId(v string) *DeleteRuleGroupInput { + s.Id = &v + return s +} + +// SetLockToken sets the LockToken field's value. +func (s *DeleteRuleGroupInput) SetLockToken(v string) *DeleteRuleGroupInput { + s.LockToken = &v + return s +} + +// SetName sets the Name field's value. +func (s *DeleteRuleGroupInput) SetName(v string) *DeleteRuleGroupInput { + s.Name = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *DeleteRuleGroupInput) SetScope(v string) *DeleteRuleGroupInput { + s.Scope = &v + return s +} + +type DeleteRuleGroupOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteRuleGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteRuleGroupOutput) GoString() string { + return s.String() +} + +type DeleteWebACLInput struct { + _ struct{} `type:"structure"` + + // The unique identifier for the Web ACL. This ID is returned in the responses + // to create and list commands. You provide it to operations like update and + // delete. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + // + // LockToken is a required field + LockToken *string `min:"1" type:"string" required:"true"` + + // A friendly name of the Web ACL. You cannot change the name of a Web ACL after + // you create it. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// 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.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Id != nil && len(*s.Id) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Id", 1)) + } + if s.LockToken == nil { + invalidParams.Add(request.NewErrParamRequired("LockToken")) + } + if s.LockToken != nil && len(*s.LockToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LockToken", 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.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *DeleteWebACLInput) SetId(v string) *DeleteWebACLInput { + s.Id = &v + return s +} + +// SetLockToken sets the LockToken field's value. +func (s *DeleteWebACLInput) SetLockToken(v string) *DeleteWebACLInput { + s.LockToken = &v + return s +} + +// SetName sets the Name field's value. +func (s *DeleteWebACLInput) SetName(v string) *DeleteWebACLInput { + s.Name = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *DeleteWebACLInput) SetScope(v string) *DeleteWebACLInput { + s.Scope = &v + return s +} + +type DeleteWebACLOutput struct { + _ struct{} `type:"structure"` +} + +// 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() +} + +type DescribeManagedRuleGroupInput struct { + _ struct{} `type:"structure"` + + // The name of the managed rule group. You use this, along with the vendor name, + // to identify the rule group. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` + + // The name of the managed rule group vendor. You use this, along with the rule + // group name, to identify the rule group. + // + // VendorName is a required field + VendorName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeManagedRuleGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeManagedRuleGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeManagedRuleGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeManagedRuleGroupInput"} + 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.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + if s.VendorName == nil { + invalidParams.Add(request.NewErrParamRequired("VendorName")) + } + if s.VendorName != nil && len(*s.VendorName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VendorName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *DescribeManagedRuleGroupInput) SetName(v string) *DescribeManagedRuleGroupInput { + s.Name = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *DescribeManagedRuleGroupInput) SetScope(v string) *DescribeManagedRuleGroupInput { + s.Scope = &v + return s +} + +// SetVendorName sets the VendorName field's value. +func (s *DescribeManagedRuleGroupInput) SetVendorName(v string) *DescribeManagedRuleGroupInput { + s.VendorName = &v + return s +} + +type DescribeManagedRuleGroupOutput struct { + _ struct{} `type:"structure"` + + // The web ACL capacity units (WCUs) required for this rule group. AWS WAF uses + // web ACL capacity units (WCU) to calculate and control the operating resources + // that are used to run your rules, rule groups, and web ACLs. AWS WAF calculates + // capacity differently for each rule type, to reflect each rule's relative + // cost. Rule group capacity is fixed at creation, so users can plan their web + // ACL WCU usage when they use a rule group. The WCU limit for web ACLs is 1,500. + Capacity *int64 `min:"1" type:"long"` + + Rules []*RuleSummary `type:"list"` +} + +// String returns the string representation +func (s DescribeManagedRuleGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeManagedRuleGroupOutput) GoString() string { + return s.String() +} + +// SetCapacity sets the Capacity field's value. +func (s *DescribeManagedRuleGroupOutput) SetCapacity(v int64) *DescribeManagedRuleGroupOutput { + s.Capacity = &v + return s +} + +// SetRules sets the Rules field's value. +func (s *DescribeManagedRuleGroupOutput) SetRules(v []*RuleSummary) *DescribeManagedRuleGroupOutput { + s.Rules = v + return s +} + +type DisassociateWebACLInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource to disassociate from the web + // ACL. + // + // The ARN must be in one of the following formats: + // + // * For an Application Load Balancer: arn:aws:elasticloadbalancing:region:account-id:loadbalancer/app/load-balancer-name/load-balancer-id + // + // * For an Amazon API Gateway stage: arn:aws:apigateway:region::/restapis/api-id/stages/stage-name + // + // ResourceArn is a required field + ResourceArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s DisassociateWebACLInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateWebACLInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisassociateWebACLInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisassociateWebACLInput"} + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) + } + if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *DisassociateWebACLInput) SetResourceArn(v string) *DisassociateWebACLInput { + s.ResourceArn = &v + return s +} + +type DisassociateWebACLOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DisassociateWebACLOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateWebACLOutput) GoString() string { + return s.String() +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Specifies a single rule to exclude from the rule group. Excluding a rule +// overrides its action setting for the rule group in the web ACL, setting it +// to COUNT. This effectively excludes the rule from acting on web requests. +type ExcludedRule struct { + _ struct{} `type:"structure"` + + // The name of the rule to exclude. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ExcludedRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ExcludedRule) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ExcludedRule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ExcludedRule"} + 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 *ExcludedRule) SetName(v string) *ExcludedRule { + s.Name = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// The part of a web request that you want AWS WAF to inspect. Include the FieldToMatch +// types that you want to inspect, with additional specifications as needed, +// according to the type. +type FieldToMatch struct { + _ struct{} `type:"structure"` + + // Inspect all query arguments. + AllQueryArguments *AllQueryArguments `type:"structure"` + + // Inspect the request body, which immediately follows the request headers. + // This is 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. + // + // Note that only the first 8 KB (8192 bytes) of the request body are forwarded + // to AWS WAF for inspection by the underlying host service. If you don't need + // to inspect more than 8 KB, you can guarantee that you don't allow additional + // bytes in by combining a statement that inspects the body of the web request, + // such as ByteMatchStatement or RegexPatternSetReferenceStatement, with a SizeConstraintStatement + // that enforces an 8 KB size limit on the body of the request. AWS WAF doesn't + // support inspecting the entire contents of web requests whose bodies exceed + // the 8 KB limit. + Body *Body `type:"structure"` + + // Inspect the HTTP method. The method indicates the type of operation that + // the request is asking the origin to perform. + Method *Method `type:"structure"` + + // Inspect the query string. This is the part of a URL that appears after a + // ? character, if any. + QueryString *QueryString `type:"structure"` + + // Inspect a single header. Provide the name of the header to inspect, for example, + // User-Agent or Referer. This setting isn't case sensitive. + SingleHeader *SingleHeader `type:"structure"` + + // Inspect a single query argument. Provide the name of the query argument to + // inspect, such as UserName or SalesRegion. The name can be up to 30 characters + // long and isn't case sensitive. + // + // This is used only to indicate the web request component for AWS WAF to inspect, + // in the FieldToMatch specification. + SingleQueryArgument *SingleQueryArgument `type:"structure"` + + // Inspect the request URI path. This is the part of a web request that identifies + // a resource, for example, /images/daily-ad.jpg. + UriPath *UriPath `type:"structure"` +} + +// 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.SingleHeader != nil { + if err := s.SingleHeader.Validate(); err != nil { + invalidParams.AddNested("SingleHeader", err.(request.ErrInvalidParams)) + } + } + if s.SingleQueryArgument != nil { + if err := s.SingleQueryArgument.Validate(); err != nil { + invalidParams.AddNested("SingleQueryArgument", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAllQueryArguments sets the AllQueryArguments field's value. +func (s *FieldToMatch) SetAllQueryArguments(v *AllQueryArguments) *FieldToMatch { + s.AllQueryArguments = v + return s +} + +// SetBody sets the Body field's value. +func (s *FieldToMatch) SetBody(v *Body) *FieldToMatch { + s.Body = v + return s +} + +// SetMethod sets the Method field's value. +func (s *FieldToMatch) SetMethod(v *Method) *FieldToMatch { + s.Method = v + return s +} + +// SetQueryString sets the QueryString field's value. +func (s *FieldToMatch) SetQueryString(v *QueryString) *FieldToMatch { + s.QueryString = v + return s +} + +// SetSingleHeader sets the SingleHeader field's value. +func (s *FieldToMatch) SetSingleHeader(v *SingleHeader) *FieldToMatch { + s.SingleHeader = v + return s +} + +// SetSingleQueryArgument sets the SingleQueryArgument field's value. +func (s *FieldToMatch) SetSingleQueryArgument(v *SingleQueryArgument) *FieldToMatch { + s.SingleQueryArgument = v + return s +} + +// SetUriPath sets the UriPath field's value. +func (s *FieldToMatch) SetUriPath(v *UriPath) *FieldToMatch { + s.UriPath = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A rule statement used to identify web requests based on country of origin. +type GeoMatchStatement struct { + _ struct{} `type:"structure"` + + // An array of two-character country codes, for example, [ "US", "CN" ], from + // the alpha-2 country ISO codes of the ISO 3166 international standard. + CountryCodes []*string `min:"1" type:"list"` +} + +// String returns the string representation +func (s GeoMatchStatement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GeoMatchStatement) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GeoMatchStatement) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GeoMatchStatement"} + if s.CountryCodes != nil && len(s.CountryCodes) < 1 { + invalidParams.Add(request.NewErrParamMinLen("CountryCodes", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCountryCodes sets the CountryCodes field's value. +func (s *GeoMatchStatement) SetCountryCodes(v []*string) *GeoMatchStatement { + s.CountryCodes = v + return s +} + +type GetIPSetInput struct { + _ struct{} `type:"structure"` + + // A unique identifier for the set. This ID is returned in the responses to + // create and list commands. You provide it to operations like update and delete. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // A friendly name of the IP set. You cannot change the name of an IPSet after + // you create it. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// 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.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Id != nil && len(*s.Id) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Id", 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.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *GetIPSetInput) SetId(v string) *GetIPSetInput { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *GetIPSetInput) SetName(v string) *GetIPSetInput { + s.Name = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *GetIPSetInput) SetScope(v string) *GetIPSetInput { + s.Scope = &v + return s +} + +type GetIPSetOutput struct { + _ struct{} `type:"structure"` + + // + // This is the latest version of AWS WAF, named AWS WAFV2, released in November, + // 2019. For information, including how to migrate your AWS WAF resources from + // the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). + // + // Contains one or more IP addresses or blocks of IP addresses specified in + // Classless Inter-Domain Routing (CIDR) notation. AWS WAF supports any CIDR + // range. For information about CIDR notation, see the Wikipedia entry Classless + // Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing). + // + // AWS WAF assigns an ARN to each IPSet that you create. To use an IP set in + // a rule, you provide the ARN to the Rule statement IPSetReferenceStatement. + IPSet *IPSet `type:"structure"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + LockToken *string `min:"1" type:"string"` +} + +// 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 +} + +// SetLockToken sets the LockToken field's value. +func (s *GetIPSetOutput) SetLockToken(v string) *GetIPSetOutput { + s.LockToken = &v + return s +} + +type GetLoggingConfigurationInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the web ACL for which you want to get the + // LoggingConfiguration. + // + // ResourceArn is a required field + ResourceArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetLoggingConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetLoggingConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetLoggingConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetLoggingConfigurationInput"} + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) + } + if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *GetLoggingConfigurationInput) SetResourceArn(v string) *GetLoggingConfigurationInput { + s.ResourceArn = &v + return s +} + +type GetLoggingConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The LoggingConfiguration for the specified web ACL. + LoggingConfiguration *LoggingConfiguration `type:"structure"` +} + +// String returns the string representation +func (s GetLoggingConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetLoggingConfigurationOutput) GoString() string { + return s.String() +} + +// SetLoggingConfiguration sets the LoggingConfiguration field's value. +func (s *GetLoggingConfigurationOutput) SetLoggingConfiguration(v *LoggingConfiguration) *GetLoggingConfigurationOutput { + s.LoggingConfiguration = v + return s +} + +type GetRateBasedStatementManagedKeysInput struct { + _ struct{} `type:"structure"` + + // The name of the rate-based rule to get the keys for. + // + // RuleName is a required field + RuleName *string `min:"1" type:"string" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` + + // The unique identifier for the Web ACL. This ID is returned in the responses + // to create and list commands. You provide it to operations like update and + // delete. + // + // WebACLId is a required field + WebACLId *string `min:"1" type:"string" required:"true"` + + // A friendly name of the Web ACL. You cannot change the name of a Web ACL after + // you create it. + // + // WebACLName is a required field + WebACLName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetRateBasedStatementManagedKeysInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRateBasedStatementManagedKeysInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetRateBasedStatementManagedKeysInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetRateBasedStatementManagedKeysInput"} + if s.RuleName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleName")) + } + if s.RuleName != nil && len(*s.RuleName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleName", 1)) + } + if s.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + 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.WebACLName == nil { + invalidParams.Add(request.NewErrParamRequired("WebACLName")) + } + if s.WebACLName != nil && len(*s.WebACLName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("WebACLName", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRuleName sets the RuleName field's value. +func (s *GetRateBasedStatementManagedKeysInput) SetRuleName(v string) *GetRateBasedStatementManagedKeysInput { + s.RuleName = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *GetRateBasedStatementManagedKeysInput) SetScope(v string) *GetRateBasedStatementManagedKeysInput { + s.Scope = &v + return s +} + +// SetWebACLId sets the WebACLId field's value. +func (s *GetRateBasedStatementManagedKeysInput) SetWebACLId(v string) *GetRateBasedStatementManagedKeysInput { + s.WebACLId = &v + return s +} + +// SetWebACLName sets the WebACLName field's value. +func (s *GetRateBasedStatementManagedKeysInput) SetWebACLName(v string) *GetRateBasedStatementManagedKeysInput { + s.WebACLName = &v + return s +} + +type GetRateBasedStatementManagedKeysOutput struct { + _ struct{} `type:"structure"` + + // The keys that are of Internet Protocol version 4 (IPv4). + ManagedKeysIPV4 *RateBasedStatementManagedKeysIPSet `type:"structure"` + + // The keys that are of Internet Protocol version 6 (IPv6). + ManagedKeysIPV6 *RateBasedStatementManagedKeysIPSet `type:"structure"` +} + +// String returns the string representation +func (s GetRateBasedStatementManagedKeysOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRateBasedStatementManagedKeysOutput) GoString() string { + return s.String() +} + +// SetManagedKeysIPV4 sets the ManagedKeysIPV4 field's value. +func (s *GetRateBasedStatementManagedKeysOutput) SetManagedKeysIPV4(v *RateBasedStatementManagedKeysIPSet) *GetRateBasedStatementManagedKeysOutput { + s.ManagedKeysIPV4 = v + return s +} + +// SetManagedKeysIPV6 sets the ManagedKeysIPV6 field's value. +func (s *GetRateBasedStatementManagedKeysOutput) SetManagedKeysIPV6(v *RateBasedStatementManagedKeysIPSet) *GetRateBasedStatementManagedKeysOutput { + s.ManagedKeysIPV6 = v + return s +} + +type GetRegexPatternSetInput struct { + _ struct{} `type:"structure"` + + // A unique identifier for the set. This ID is returned in the responses to + // create and list commands. You provide it to operations like update and delete. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // A friendly name of the set. You cannot change the name after you create the + // set. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// String returns the string representation +func (s GetRegexPatternSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRegexPatternSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetRegexPatternSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetRegexPatternSetInput"} + 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.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *GetRegexPatternSetInput) SetId(v string) *GetRegexPatternSetInput { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *GetRegexPatternSetInput) SetName(v string) *GetRegexPatternSetInput { + s.Name = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *GetRegexPatternSetInput) SetScope(v string) *GetRegexPatternSetInput { + s.Scope = &v + return s +} + +type GetRegexPatternSetOutput struct { + _ struct{} `type:"structure"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + LockToken *string `min:"1" type:"string"` + + // + // This is the latest version of AWS WAF, named AWS WAFV2, released in November, + // 2019. For information, including how to migrate your AWS WAF resources from + // the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). + // + // Contains one or more regular expressions. + // + // AWS WAF assigns an ARN to each RegexPatternSet that you create. To use a + // set in a rule, you provide the ARN to the Rule statement RegexPatternSetReferenceStatement. + RegexPatternSet *RegexPatternSet `type:"structure"` +} + +// String returns the string representation +func (s GetRegexPatternSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRegexPatternSetOutput) GoString() string { + return s.String() +} + +// SetLockToken sets the LockToken field's value. +func (s *GetRegexPatternSetOutput) SetLockToken(v string) *GetRegexPatternSetOutput { + s.LockToken = &v + return s +} + +// SetRegexPatternSet sets the RegexPatternSet field's value. +func (s *GetRegexPatternSetOutput) SetRegexPatternSet(v *RegexPatternSet) *GetRegexPatternSetOutput { + s.RegexPatternSet = v + return s +} + +type GetRuleGroupInput struct { + _ struct{} `type:"structure"` + + // A unique identifier for the rule group. This ID is returned in the responses + // to create and list commands. You provide it to operations like update and + // delete. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // A friendly name of the rule group. You cannot change the name of a rule group + // after you create it. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// String returns the string representation +func (s GetRuleGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRuleGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetRuleGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetRuleGroupInput"} + 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.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *GetRuleGroupInput) SetId(v string) *GetRuleGroupInput { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *GetRuleGroupInput) SetName(v string) *GetRuleGroupInput { + s.Name = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *GetRuleGroupInput) SetScope(v string) *GetRuleGroupInput { + s.Scope = &v + return s +} + +type GetRuleGroupOutput struct { + _ struct{} `type:"structure"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + LockToken *string `min:"1" type:"string"` + + // + // This is the latest version of AWS WAF, named AWS WAFV2, released in November, + // 2019. For information, including how to migrate your AWS WAF resources from + // the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). + // + // A rule group defines a collection of rules to inspect and control web requests + // that you can use in a WebACL. When you create a rule group, you define an + // immutable capacity limit. If you update a rule group, you must stay within + // the capacity. This allows others to reuse the rule group with confidence + // in its capacity requirements. + RuleGroup *RuleGroup `type:"structure"` +} + +// String returns the string representation +func (s GetRuleGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetRuleGroupOutput) GoString() string { + return s.String() +} + +// SetLockToken sets the LockToken field's value. +func (s *GetRuleGroupOutput) SetLockToken(v string) *GetRuleGroupOutput { + s.LockToken = &v + return s +} + +// SetRuleGroup sets the RuleGroup field's value. +func (s *GetRuleGroupOutput) SetRuleGroup(v *RuleGroup) *GetRuleGroupOutput { + s.RuleGroup = v + return s +} + +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"` + + // The metric name assigned to the Rule or RuleGroup for which you want a sample + // of requests. + // + // RuleMetricName is a required field + RuleMetricName *string `min:"1" type:"string" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` + + // 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 Amazon resource name (ARN) of the WebACL for which you want a sample + // of requests. + // + // WebAclArn is a required field + WebAclArn *string `min:"20" 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.RuleMetricName == nil { + invalidParams.Add(request.NewErrParamRequired("RuleMetricName")) + } + if s.RuleMetricName != nil && len(*s.RuleMetricName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RuleMetricName", 1)) + } + if s.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + if s.TimeWindow == nil { + invalidParams.Add(request.NewErrParamRequired("TimeWindow")) + } + if s.WebAclArn == nil { + invalidParams.Add(request.NewErrParamRequired("WebAclArn")) + } + if s.WebAclArn != nil && len(*s.WebAclArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("WebAclArn", 20)) + } + 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 +} + +// SetRuleMetricName sets the RuleMetricName field's value. +func (s *GetSampledRequestsInput) SetRuleMetricName(v string) *GetSampledRequestsInput { + s.RuleMetricName = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *GetSampledRequestsInput) SetScope(v string) *GetSampledRequestsInput { + s.Scope = &v + return s +} + +// SetTimeWindow sets the TimeWindow field's value. +func (s *GetSampledRequestsInput) SetTimeWindow(v *TimeWindow) *GetSampledRequestsInput { + s.TimeWindow = v + return s +} + +// SetWebAclArn sets the WebAclArn field's value. +func (s *GetSampledRequestsInput) SetWebAclArn(v string) *GetSampledRequestsInput { + s.WebAclArn = &v + return s +} + +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 +} + +type GetWebACLForResourceInput struct { + _ struct{} `type:"structure"` + + // The ARN (Amazon Resource Name) of the resource. + // + // ResourceArn is a required field + ResourceArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetWebACLForResourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetWebACLForResourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetWebACLForResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetWebACLForResourceInput"} + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) + } + if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *GetWebACLForResourceInput) SetResourceArn(v string) *GetWebACLForResourceInput { + s.ResourceArn = &v + return s +} + +type GetWebACLForResourceOutput struct { + _ struct{} `type:"structure"` + + // The Web ACL that is associated with the resource. If there is no associated + // resource, AWS WAF returns a null Web ACL. + WebACL *WebACL `type:"structure"` +} + +// String returns the string representation +func (s GetWebACLForResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetWebACLForResourceOutput) GoString() string { + return s.String() +} + +// SetWebACL sets the WebACL field's value. +func (s *GetWebACLForResourceOutput) SetWebACL(v *WebACL) *GetWebACLForResourceOutput { + s.WebACL = v + return s +} + +type GetWebACLInput struct { + _ struct{} `type:"structure"` + + // The unique identifier for the Web ACL. This ID is returned in the responses + // to create and list commands. You provide it to operations like update and + // delete. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // A friendly name of the Web ACL. You cannot change the name of a Web ACL after + // you create it. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// 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.Id == nil { + invalidParams.Add(request.NewErrParamRequired("Id")) + } + if s.Id != nil && len(*s.Id) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Id", 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.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetId sets the Id field's value. +func (s *GetWebACLInput) SetId(v string) *GetWebACLInput { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *GetWebACLInput) SetName(v string) *GetWebACLInput { + s.Name = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *GetWebACLInput) SetScope(v string) *GetWebACLInput { + s.Scope = &v + return s +} + +type GetWebACLOutput struct { + _ struct{} `type:"structure"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + LockToken *string `min:"1" type:"string"` + + // The Web ACL specification. You can modify the settings in this Web ACL and + // use it to update this Web ACL or create a new one. + 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() +} + +// SetLockToken sets the LockToken field's value. +func (s *GetWebACLOutput) SetLockToken(v string) *GetWebACLOutput { + s.LockToken = &v + return s +} + +// SetWebACL sets the WebACL field's value. +func (s *GetWebACLOutput) SetWebACL(v *WebACL) *GetWebACLOutput { + s.WebACL = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Part of the response from GetSampledRequests. This is a 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. +type HTTPHeader struct { + _ struct{} `type:"structure"` + + // The name of the HTTP header. + Name *string `type:"string"` + + // The value of the HTTP header. + 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 +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Part of the response from GetSampledRequests. This is a complex type that +// appears as Request in the response syntax. HTTPRequest contains information +// about one of the web requests. +type HTTPRequest struct { + _ struct{} `type:"structure"` + + // The IP address that the request originated from. If the web ACL 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 the name and value for each header in the sampled + // web request. + Headers []*HTTPHeader `type:"list"` + + // The HTTP method specified in the sampled web request. + Method *string `type:"string"` + + // The URI path of the request, which 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 +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Contains one or more IP addresses or blocks of IP addresses specified in +// Classless Inter-Domain Routing (CIDR) notation. AWS WAF supports any CIDR +// range. For information about CIDR notation, see the Wikipedia entry Classless +// Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing). +// +// AWS WAF assigns an ARN to each IPSet that you create. To use an IP set in +// a rule, you provide the ARN to the Rule statement IPSetReferenceStatement. +type IPSet struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the entity. + // + // ARN is a required field + ARN *string `min:"20" type:"string" required:"true"` + + // Contains an array of strings that specify one or more IP addresses or blocks + // of IP addresses in Classless Inter-Domain Routing (CIDR) notation. AWS WAF + // supports all address ranges for IP versions IPv4 and IPv6. + // + // Examples: + // + // * 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. + // + // * 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. + // + // For more information about CIDR notation, see the Wikipedia entry Classless + // Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing). + // + // Addresses is a required field + Addresses []*string `type:"list" required:"true"` + + // A friendly description of the IP set. You cannot change the description of + // an IP set after you create it. + Description *string `min:"1" type:"string"` + + // Specify IPV4 or IPV6. + // + // IPAddressVersion is a required field + IPAddressVersion *string `type:"string" required:"true" enum:"IPAddressVersion"` + + // A unique identifier for the set. This ID is returned in the responses to + // create and list commands. You provide it to operations like update and delete. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // A friendly name of the IP set. You cannot 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 IPSet) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IPSet) GoString() string { + return s.String() +} + +// SetARN sets the ARN field's value. +func (s *IPSet) SetARN(v string) *IPSet { + s.ARN = &v + return s +} + +// SetAddresses sets the Addresses field's value. +func (s *IPSet) SetAddresses(v []*string) *IPSet { + s.Addresses = v + return s +} + +// SetDescription sets the Description field's value. +func (s *IPSet) SetDescription(v string) *IPSet { + s.Description = &v + return s +} + +// SetIPAddressVersion sets the IPAddressVersion field's value. +func (s *IPSet) SetIPAddressVersion(v string) *IPSet { + s.IPAddressVersion = &v + return s +} + +// SetId sets the Id field's value. +func (s *IPSet) SetId(v string) *IPSet { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *IPSet) SetName(v string) *IPSet { + s.Name = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A rule statement used to detect web requests coming from particular IP addresses +// or address ranges. To use this, create an IPSet that specifies the addresses +// you want to detect, then use the ARN of that set in this statement. To create +// an IP set, see CreateIPSet. +// +// Each IP set rule statement references an IP set. You create and maintain +// the set independent of your rules. This allows you to use the single set +// in multiple rules. When you update the referenced set, AWS WAF automatically +// updates all rules that reference it. +type IPSetReferenceStatement struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the IPSet that this statement references. + // + // ARN is a required field + ARN *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s IPSetReferenceStatement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s IPSetReferenceStatement) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *IPSetReferenceStatement) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "IPSetReferenceStatement"} + if s.ARN == nil { + invalidParams.Add(request.NewErrParamRequired("ARN")) + } + if s.ARN != nil && len(*s.ARN) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ARN", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetARN sets the ARN field's value. +func (s *IPSetReferenceStatement) SetARN(v string) *IPSetReferenceStatement { + s.ARN = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// High-level information about an IPSet, returned by operations like create +// and list. This provides information like the ID, that you can use to retrieve +// and manage an IPSet, and the ARN, that you provide to the IPSetReferenceStatement +// to use the address set in a Rule. +type IPSetSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the entity. + ARN *string `min:"20" type:"string"` + + // A friendly description of the IP set. You cannot change the description of + // an IP set after you create it. + Description *string `min:"1" type:"string"` + + // A unique identifier for the set. This ID is returned in the responses to + // create and list commands. You provide it to operations like update and delete. + Id *string `min:"1" type:"string"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + LockToken *string `min:"1" type:"string"` + + // A friendly name of the IP set. You cannot change the name of an IPSet after + // you create it. + Name *string `min:"1" type:"string"` +} + +// 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() +} + +// SetARN sets the ARN field's value. +func (s *IPSetSummary) SetARN(v string) *IPSetSummary { + s.ARN = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *IPSetSummary) SetDescription(v string) *IPSetSummary { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *IPSetSummary) SetId(v string) *IPSetSummary { + s.Id = &v + return s +} + +// SetLockToken sets the LockToken field's value. +func (s *IPSetSummary) SetLockToken(v string) *IPSetSummary { + s.LockToken = &v + return s +} + +// SetName sets the Name field's value. +func (s *IPSetSummary) SetName(v string) *IPSetSummary { + s.Name = &v + return s +} + +type ListAvailableManagedRuleGroupsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of objects that you want AWS WAF to return for this request. + // If more objects are available, in the response, AWS WAF provides a NextMarker + // value that you can use in a subsequent call to get the next batch of objects. + Limit *int64 `min:"1" type:"integer"` + + // When you request a list of objects with a Limit setting, if the number of + // objects that are still available for retrieval exceeds the limit, AWS WAF + // returns a NextMarker value in the response. To retrieve the next batch of + // objects, provide the marker from the prior call in your next request. + NextMarker *string `min:"1" type:"string"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// String returns the string representation +func (s ListAvailableManagedRuleGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAvailableManagedRuleGroupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListAvailableManagedRuleGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAvailableManagedRuleGroupsInput"} + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NextMarker != nil && len(*s.NextMarker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) + } + if s.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLimit sets the Limit field's value. +func (s *ListAvailableManagedRuleGroupsInput) SetLimit(v int64) *ListAvailableManagedRuleGroupsInput { + s.Limit = &v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListAvailableManagedRuleGroupsInput) SetNextMarker(v string) *ListAvailableManagedRuleGroupsInput { + s.NextMarker = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *ListAvailableManagedRuleGroupsInput) SetScope(v string) *ListAvailableManagedRuleGroupsInput { + s.Scope = &v + return s +} + +type ListAvailableManagedRuleGroupsOutput struct { + _ struct{} `type:"structure"` + + ManagedRuleGroups []*ManagedRuleGroupSummary `type:"list"` + + // When you request a list of objects with a Limit setting, if the number of + // objects that are still available for retrieval exceeds the limit, AWS WAF + // returns a NextMarker value in the response. To retrieve the next batch of + // objects, provide the marker from the prior call in your next request. + NextMarker *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListAvailableManagedRuleGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAvailableManagedRuleGroupsOutput) GoString() string { + return s.String() +} + +// SetManagedRuleGroups sets the ManagedRuleGroups field's value. +func (s *ListAvailableManagedRuleGroupsOutput) SetManagedRuleGroups(v []*ManagedRuleGroupSummary) *ListAvailableManagedRuleGroupsOutput { + s.ManagedRuleGroups = v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListAvailableManagedRuleGroupsOutput) SetNextMarker(v string) *ListAvailableManagedRuleGroupsOutput { + s.NextMarker = &v + return s +} + +type ListIPSetsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of objects that you want AWS WAF to return for this request. + // If more objects are available, in the response, AWS WAF provides a NextMarker + // value that you can use in a subsequent call to get the next batch of objects. + Limit *int64 `min:"1" type:"integer"` + + // When you request a list of objects with a Limit setting, if the number of + // objects that are still available for retrieval exceeds the limit, AWS WAF + // returns a NextMarker value in the response. To retrieve the next batch of + // objects, provide the marker from the prior call in your next request. + NextMarker *string `min:"1" type:"string"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// 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.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NextMarker != nil && len(*s.NextMarker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) + } + if s.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + + 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 +} + +// SetScope sets the Scope field's value. +func (s *ListIPSetsInput) SetScope(v string) *ListIPSetsInput { + s.Scope = &v + return s +} + +type ListIPSetsOutput struct { + _ struct{} `type:"structure"` + + // Array of IPSets. This may not be the full list of IPSets that you have defined. + // See the Limit specification for this request. + IPSets []*IPSetSummary `type:"list"` + + // When you request a list of objects with a Limit setting, if the number of + // objects that are still available for retrieval exceeds the limit, AWS WAF + // returns a NextMarker value in the response. To retrieve the next batch of + // objects, provide the marker from the prior call in your 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 +} + +type ListLoggingConfigurationsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of objects that you want AWS WAF to return for this request. + // If more objects are available, in the response, AWS WAF provides a NextMarker + // value that you can use in a subsequent call to get the next batch of objects. + Limit *int64 `min:"1" type:"integer"` + + // When you request a list of objects with a Limit setting, if the number of + // objects that are still available for retrieval exceeds the limit, AWS WAF + // returns a NextMarker value in the response. To retrieve the next batch of + // objects, provide the marker from the prior call in your next request. + NextMarker *string `min:"1" type:"string"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + Scope *string `type:"string" enum:"Scope"` +} + +// String returns the string representation +func (s ListLoggingConfigurationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListLoggingConfigurationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListLoggingConfigurationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListLoggingConfigurationsInput"} + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + 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 *ListLoggingConfigurationsInput) SetLimit(v int64) *ListLoggingConfigurationsInput { + s.Limit = &v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListLoggingConfigurationsInput) SetNextMarker(v string) *ListLoggingConfigurationsInput { + s.NextMarker = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *ListLoggingConfigurationsInput) SetScope(v string) *ListLoggingConfigurationsInput { + s.Scope = &v + return s +} + +type ListLoggingConfigurationsOutput struct { + _ struct{} `type:"structure"` + + LoggingConfigurations []*LoggingConfiguration `type:"list"` + + // When you request a list of objects with a Limit setting, if the number of + // objects that are still available for retrieval exceeds the limit, AWS WAF + // returns a NextMarker value in the response. To retrieve the next batch of + // objects, provide the marker from the prior call in your next request. + NextMarker *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListLoggingConfigurationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListLoggingConfigurationsOutput) GoString() string { + return s.String() +} + +// SetLoggingConfigurations sets the LoggingConfigurations field's value. +func (s *ListLoggingConfigurationsOutput) SetLoggingConfigurations(v []*LoggingConfiguration) *ListLoggingConfigurationsOutput { + s.LoggingConfigurations = v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListLoggingConfigurationsOutput) SetNextMarker(v string) *ListLoggingConfigurationsOutput { + s.NextMarker = &v + return s +} + +type ListRegexPatternSetsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of objects that you want AWS WAF to return for this request. + // If more objects are available, in the response, AWS WAF provides a NextMarker + // value that you can use in a subsequent call to get the next batch of objects. + Limit *int64 `min:"1" type:"integer"` + + // When you request a list of objects with a Limit setting, if the number of + // objects that are still available for retrieval exceeds the limit, AWS WAF + // returns a NextMarker value in the response. To retrieve the next batch of + // objects, provide the marker from the prior call in your next request. + NextMarker *string `min:"1" type:"string"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// String returns the string representation +func (s ListRegexPatternSetsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListRegexPatternSetsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListRegexPatternSetsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListRegexPatternSetsInput"} + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NextMarker != nil && len(*s.NextMarker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) + } + if s.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLimit sets the Limit field's value. +func (s *ListRegexPatternSetsInput) SetLimit(v int64) *ListRegexPatternSetsInput { + s.Limit = &v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListRegexPatternSetsInput) SetNextMarker(v string) *ListRegexPatternSetsInput { + s.NextMarker = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *ListRegexPatternSetsInput) SetScope(v string) *ListRegexPatternSetsInput { + s.Scope = &v + return s +} + +type ListRegexPatternSetsOutput struct { + _ struct{} `type:"structure"` + + // When you request a list of objects with a Limit setting, if the number of + // objects that are still available for retrieval exceeds the limit, AWS WAF + // returns a NextMarker value in the response. To retrieve the next batch of + // objects, provide the marker from the prior call in your next request. + NextMarker *string `min:"1" type:"string"` + + RegexPatternSets []*RegexPatternSetSummary `type:"list"` +} + +// String returns the string representation +func (s ListRegexPatternSetsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListRegexPatternSetsOutput) GoString() string { + return s.String() +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListRegexPatternSetsOutput) SetNextMarker(v string) *ListRegexPatternSetsOutput { + s.NextMarker = &v + return s +} + +// SetRegexPatternSets sets the RegexPatternSets field's value. +func (s *ListRegexPatternSetsOutput) SetRegexPatternSets(v []*RegexPatternSetSummary) *ListRegexPatternSetsOutput { + s.RegexPatternSets = v + return s +} + +type ListResourcesForWebACLInput struct { + _ struct{} `type:"structure"` + + // Used for web ACLs that are scoped for regional applications. A regional application + // can be an Application Load Balancer (ALB) or an API Gateway stage. + ResourceType *string `type:"string" enum:"ResourceType"` + + // The Amazon Resource Name (ARN) of the Web ACL. + // + // WebACLArn is a required field + WebACLArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListResourcesForWebACLInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourcesForWebACLInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListResourcesForWebACLInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListResourcesForWebACLInput"} + if s.WebACLArn == nil { + invalidParams.Add(request.NewErrParamRequired("WebACLArn")) + } + if s.WebACLArn != nil && len(*s.WebACLArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("WebACLArn", 20)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceType sets the ResourceType field's value. +func (s *ListResourcesForWebACLInput) SetResourceType(v string) *ListResourcesForWebACLInput { + s.ResourceType = &v + return s +} + +// SetWebACLArn sets the WebACLArn field's value. +func (s *ListResourcesForWebACLInput) SetWebACLArn(v string) *ListResourcesForWebACLInput { + s.WebACLArn = &v + return s +} + +type ListResourcesForWebACLOutput struct { + _ struct{} `type:"structure"` + + // The array of Amazon Resource Names (ARNs) of the associated resources. + ResourceArns []*string `type:"list"` +} + +// String returns the string representation +func (s ListResourcesForWebACLOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourcesForWebACLOutput) GoString() string { + return s.String() +} + +// SetResourceArns sets the ResourceArns field's value. +func (s *ListResourcesForWebACLOutput) SetResourceArns(v []*string) *ListResourcesForWebACLOutput { + s.ResourceArns = v + return s +} + +type ListRuleGroupsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of objects that you want AWS WAF to return for this request. + // If more objects are available, in the response, AWS WAF provides a NextMarker + // value that you can use in a subsequent call to get the next batch of objects. + Limit *int64 `min:"1" type:"integer"` + + // When you request a list of objects with a Limit setting, if the number of + // objects that are still available for retrieval exceeds the limit, AWS WAF + // returns a NextMarker value in the response. To retrieve the next batch of + // objects, provide the marker from the prior call in your next request. + NextMarker *string `min:"1" type:"string"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// String returns the string representation +func (s ListRuleGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListRuleGroupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListRuleGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListRuleGroupsInput"} + if s.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NextMarker != nil && len(*s.NextMarker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) + } + if s.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLimit sets the Limit field's value. +func (s *ListRuleGroupsInput) SetLimit(v int64) *ListRuleGroupsInput { + s.Limit = &v + return s +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListRuleGroupsInput) SetNextMarker(v string) *ListRuleGroupsInput { + s.NextMarker = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *ListRuleGroupsInput) SetScope(v string) *ListRuleGroupsInput { + s.Scope = &v + return s +} + +type ListRuleGroupsOutput struct { + _ struct{} `type:"structure"` + + // When you request a list of objects with a Limit setting, if the number of + // objects that are still available for retrieval exceeds the limit, AWS WAF + // returns a NextMarker value in the response. To retrieve the next batch of + // objects, provide the marker from the prior call in your next request. + NextMarker *string `min:"1" type:"string"` + + RuleGroups []*RuleGroupSummary `type:"list"` +} + +// String returns the string representation +func (s ListRuleGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListRuleGroupsOutput) GoString() string { + return s.String() +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListRuleGroupsOutput) SetNextMarker(v string) *ListRuleGroupsOutput { + s.NextMarker = &v + return s +} + +// SetRuleGroups sets the RuleGroups field's value. +func (s *ListRuleGroupsOutput) SetRuleGroups(v []*RuleGroupSummary) *ListRuleGroupsOutput { + s.RuleGroups = v + return s +} + +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // The maximum number of objects that you want AWS WAF to return for this request. + // If more objects are available, in the response, AWS WAF provides a NextMarker + // value that you can use in a subsequent call to get the next batch of objects. + Limit *int64 `min:"1" type:"integer"` + + // When you request a list of objects with a Limit setting, if the number of + // objects that are still available for retrieval exceeds the limit, AWS WAF + // returns a NextMarker value in the response. To retrieve the next batch of + // objects, provide the marker from the prior call in your next request. + NextMarker *string `min:"1" type:"string"` + + // The Amazon Resource Name (ARN) of the resource. + // + // ResourceARN is a required field + ResourceARN *string `min:"20" 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.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NextMarker != nil && len(*s.NextMarker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) + } + if s.ResourceARN == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceARN")) + } + if s.ResourceARN != nil && len(*s.ResourceARN) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 20)) + } + + 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 +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListTagsForResourceInput) SetNextMarker(v string) *ListTagsForResourceInput { + s.NextMarker = &v + return s +} + +// SetResourceARN sets the ResourceARN field's value. +func (s *ListTagsForResourceInput) SetResourceARN(v string) *ListTagsForResourceInput { + s.ResourceARN = &v + return s +} + +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // When you request a list of objects with a Limit setting, if the number of + // objects that are still available for retrieval exceeds the limit, AWS WAF + // returns a NextMarker value in the response. To retrieve the next batch of + // objects, provide the marker from the prior call in your next request. + NextMarker *string `min:"1" type:"string"` + + // The collection of tagging definitions for the resource. + TagInfoForResource *TagInfoForResource `type:"structure"` +} + +// 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() +} + +// SetNextMarker sets the NextMarker field's value. +func (s *ListTagsForResourceOutput) SetNextMarker(v string) *ListTagsForResourceOutput { + s.NextMarker = &v + return s +} + +// SetTagInfoForResource sets the TagInfoForResource field's value. +func (s *ListTagsForResourceOutput) SetTagInfoForResource(v *TagInfoForResource) *ListTagsForResourceOutput { + s.TagInfoForResource = v + return s +} + +type ListWebACLsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of objects that you want AWS WAF to return for this request. + // If more objects are available, in the response, AWS WAF provides a NextMarker + // value that you can use in a subsequent call to get the next batch of objects. + Limit *int64 `min:"1" type:"integer"` + + // When you request a list of objects with a Limit setting, if the number of + // objects that are still available for retrieval exceeds the limit, AWS WAF + // returns a NextMarker value in the response. To retrieve the next batch of + // objects, provide the marker from the prior call in your next request. + NextMarker *string `min:"1" type:"string"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// 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.Limit != nil && *s.Limit < 1 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 1)) + } + if s.NextMarker != nil && len(*s.NextMarker) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextMarker", 1)) + } + if s.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + + 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 +} + +// SetScope sets the Scope field's value. +func (s *ListWebACLsInput) SetScope(v string) *ListWebACLsInput { + s.Scope = &v + return s +} + +type ListWebACLsOutput struct { + _ struct{} `type:"structure"` + + // When you request a list of objects with a Limit setting, if the number of + // objects that are still available for retrieval exceeds the limit, AWS WAF + // returns a NextMarker value in the response. To retrieve the next batch of + // objects, provide the marker from the prior call in your next request. + NextMarker *string `min:"1" type:"string"` + + 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 +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Defines an association between Amazon Kinesis Data Firehose destinations +// and a web ACL resource, for logging from AWS WAF. As part of the association, +// you can specify parts of the standard logging fields to keep out of the logs. +type LoggingConfiguration struct { + _ struct{} `type:"structure"` + + // The Amazon Kinesis Data Firehose Amazon Resource Name (ARNs) that you want + // to associate with the web ACL. + // + // LogDestinationConfigs is a required field + LogDestinationConfigs []*string `min:"1" type:"list" required:"true"` + + // The parts of the request that you want to keep out of the logs. For example, + // if you redact the cookie field, the cookie field in the firehose will be + // xxx. + RedactedFields []*FieldToMatch `type:"list"` + + // The Amazon Resource Name (ARN) of the web ACL that you want to associate + // with LogDestinationConfigs. + // + // ResourceArn is a required field + ResourceArn *string `min:"20" type:"string" required:"true"` +} + +// String returns the string representation +func (s LoggingConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LoggingConfiguration) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *LoggingConfiguration) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "LoggingConfiguration"} + if s.LogDestinationConfigs == nil { + invalidParams.Add(request.NewErrParamRequired("LogDestinationConfigs")) + } + if s.LogDestinationConfigs != nil && len(s.LogDestinationConfigs) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LogDestinationConfigs", 1)) + } + if s.ResourceArn == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceArn")) + } + if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) + } + if s.RedactedFields != nil { + for i, v := range s.RedactedFields { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RedactedFields", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLogDestinationConfigs sets the LogDestinationConfigs field's value. +func (s *LoggingConfiguration) SetLogDestinationConfigs(v []*string) *LoggingConfiguration { + s.LogDestinationConfigs = v + return s +} + +// SetRedactedFields sets the RedactedFields field's value. +func (s *LoggingConfiguration) SetRedactedFields(v []*FieldToMatch) *LoggingConfiguration { + s.RedactedFields = v + return s +} + +// SetResourceArn sets the ResourceArn field's value. +func (s *LoggingConfiguration) SetResourceArn(v string) *LoggingConfiguration { + s.ResourceArn = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A rule statement used to run the rules that are defined in a managed rule +// group. To use this, provide the vendor name and the name of the rule group +// in this statement. You can retrieve the required names by calling ListAvailableManagedRuleGroups. +// +// You can't nest a ManagedRuleGroupStatement, for example for use inside a +// NotStatement or OrStatement. It can only be referenced as a top-level statement +// within a rule. +type ManagedRuleGroupStatement struct { + _ struct{} `type:"structure"` + + // The rules whose actions are set to COUNT by the web ACL, regardless of the + // action that is set on the rule. This effectively excludes the rule from acting + // on web requests. + ExcludedRules []*ExcludedRule `type:"list"` + + // The name of the managed rule group. You use this, along with the vendor name, + // to identify the rule group. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The name of the managed rule group vendor. You use this, along with the rule + // group name, to identify the rule group. + // + // VendorName is a required field + VendorName *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s ManagedRuleGroupStatement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ManagedRuleGroupStatement) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ManagedRuleGroupStatement) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ManagedRuleGroupStatement"} + 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.VendorName == nil { + invalidParams.Add(request.NewErrParamRequired("VendorName")) + } + if s.VendorName != nil && len(*s.VendorName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("VendorName", 1)) + } + if s.ExcludedRules != nil { + for i, v := range s.ExcludedRules { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ExcludedRules", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetExcludedRules sets the ExcludedRules field's value. +func (s *ManagedRuleGroupStatement) SetExcludedRules(v []*ExcludedRule) *ManagedRuleGroupStatement { + s.ExcludedRules = v + return s +} + +// SetName sets the Name field's value. +func (s *ManagedRuleGroupStatement) SetName(v string) *ManagedRuleGroupStatement { + s.Name = &v + return s +} + +// SetVendorName sets the VendorName field's value. +func (s *ManagedRuleGroupStatement) SetVendorName(v string) *ManagedRuleGroupStatement { + s.VendorName = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// High-level information about a managed rule group, returned by ListAvailableManagedRuleGroups. +// This provides information like the name and vendor name, that you provide +// when you add a ManagedRuleGroupStatement to a web ACL. Managed rule groups +// include AWS Managed Rules rule groups, which are free of charge to AWS WAF +// customers, and AWS Marketplace managed rule groups, which you can subscribe +// to through AWS Marketplace. +type ManagedRuleGroupSummary struct { + _ struct{} `type:"structure"` + + // The description of the managed rule group, provided by AWS Managed Rules + // or the AWS Marketplace seller who manages it. + Description *string `min:"1" type:"string"` + + // The name of the managed rule group. You use this, along with the vendor name, + // to identify the rule group. + Name *string `min:"1" type:"string"` + + // The name of the managed rule group vendor. You use this, along with the rule + // group name, to identify the rule group. + VendorName *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ManagedRuleGroupSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ManagedRuleGroupSummary) GoString() string { + return s.String() +} + +// SetDescription sets the Description field's value. +func (s *ManagedRuleGroupSummary) SetDescription(v string) *ManagedRuleGroupSummary { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *ManagedRuleGroupSummary) SetName(v string) *ManagedRuleGroupSummary { + s.Name = &v + return s +} + +// SetVendorName sets the VendorName field's value. +func (s *ManagedRuleGroupSummary) SetVendorName(v string) *ManagedRuleGroupSummary { + s.VendorName = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// The HTTP method of a web request. The method indicates the type of operation +// that the request is asking the origin to perform. +// +// This is used only to indicate the web request component for AWS WAF to inspect, +// in the FieldToMatch specification. +type Method struct { + _ struct{} `type:"structure"` +} + +// 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() +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Specifies that AWS WAF should do nothing. This is generally used to try out +// a rule without performing any actions. You set the OverrideAction on the +// Rule. +// +// This is used only in the context of other settings, for example to specify +// values for RuleAction and web ACL DefaultAction. +type NoneAction struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s NoneAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NoneAction) GoString() string { + return s.String() +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A logical rule statement used to negate the results of another rule statement. +// You provide one Statement within the NotStatement. +type NotStatement struct { + _ struct{} `type:"structure"` + + // The statement to negate. You can use any statement that can be nested. + // + // Statement is a required field + Statement *Statement `type:"structure" required:"true"` +} + +// String returns the string representation +func (s NotStatement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NotStatement) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *NotStatement) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "NotStatement"} + if s.Statement == nil { + invalidParams.Add(request.NewErrParamRequired("Statement")) + } + if s.Statement != nil { + if err := s.Statement.Validate(); err != nil { + invalidParams.AddNested("Statement", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetStatement sets the Statement field's value. +func (s *NotStatement) SetStatement(v *Statement) *NotStatement { + s.Statement = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A logical rule statement used to combine other rule statements with OR logic. +// You provide more than one Statement within the OrStatement. +type OrStatement struct { + _ struct{} `type:"structure"` + + // The statements to combine with OR logic. You can use any statements that + // can be nested. + // + // Statements is a required field + Statements []*Statement `type:"list" required:"true"` +} + +// String returns the string representation +func (s OrStatement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrStatement) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *OrStatement) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "OrStatement"} + if s.Statements == nil { + invalidParams.Add(request.NewErrParamRequired("Statements")) + } + if s.Statements != nil { + for i, v := range s.Statements { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Statements", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetStatements sets the Statements field's value. +func (s *OrStatement) SetStatements(v []*Statement) *OrStatement { + s.Statements = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// The action to use to override the rule's Action setting. You can use no override +// action, in which case the rule action is in effect, or count, in which case, +// if the rule matches a web request, it only counts the match. +type OverrideAction struct { + _ struct{} `type:"structure"` + + // Override the rule action setting to count. + Count *CountAction `type:"structure"` + + // Don't override the rule action setting. + None *NoneAction `type:"structure"` +} + +// String returns the string representation +func (s OverrideAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OverrideAction) GoString() string { + return s.String() +} + +// SetCount sets the Count field's value. +func (s *OverrideAction) SetCount(v *CountAction) *OverrideAction { + s.Count = v + return s +} + +// SetNone sets the None field's value. +func (s *OverrideAction) SetNone(v *NoneAction) *OverrideAction { + s.None = v + return s +} + +type PutLoggingConfigurationInput struct { + _ struct{} `type:"structure"` + + // + // This is the latest version of AWS WAF, named AWS WAFV2, released in November, + // 2019. For information, including how to migrate your AWS WAF resources from + // the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). + // + // Defines an association between Amazon Kinesis Data Firehose destinations + // and a web ACL resource, for logging from AWS WAF. As part of the association, + // you can specify parts of the standard logging fields to keep out of the logs. + // + // LoggingConfiguration is a required field + LoggingConfiguration *LoggingConfiguration `type:"structure" required:"true"` +} + +// String returns the string representation +func (s PutLoggingConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutLoggingConfigurationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutLoggingConfigurationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutLoggingConfigurationInput"} + if s.LoggingConfiguration == nil { + invalidParams.Add(request.NewErrParamRequired("LoggingConfiguration")) + } + if s.LoggingConfiguration != nil { + if err := s.LoggingConfiguration.Validate(); err != nil { + invalidParams.AddNested("LoggingConfiguration", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetLoggingConfiguration sets the LoggingConfiguration field's value. +func (s *PutLoggingConfigurationInput) SetLoggingConfiguration(v *LoggingConfiguration) *PutLoggingConfigurationInput { + s.LoggingConfiguration = v + return s +} + +type PutLoggingConfigurationOutput struct { + _ struct{} `type:"structure"` + + // + // This is the latest version of AWS WAF, named AWS WAFV2, released in November, + // 2019. For information, including how to migrate your AWS WAF resources from + // the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). + // + // Defines an association between Amazon Kinesis Data Firehose destinations + // and a web ACL resource, for logging from AWS WAF. As part of the association, + // you can specify parts of the standard logging fields to keep out of the logs. + LoggingConfiguration *LoggingConfiguration `type:"structure"` +} + +// String returns the string representation +func (s PutLoggingConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutLoggingConfigurationOutput) GoString() string { + return s.String() +} + +// SetLoggingConfiguration sets the LoggingConfiguration field's value. +func (s *PutLoggingConfigurationOutput) SetLoggingConfiguration(v *LoggingConfiguration) *PutLoggingConfigurationOutput { + s.LoggingConfiguration = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// The query string of a web request. This is the part of a URL that appears +// after a ? character, if any. +// +// This is used only to indicate the web request component for AWS WAF to inspect, +// in the FieldToMatch specification. +type QueryString struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s QueryString) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s QueryString) GoString() string { + return s.String() +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A rate-based rule tracks the rate of requests for each originating IP address, +// and triggers the rule action when the rate exceeds a limit that you specify +// on the number of requests in any 5-minute time span. You can use this to +// put a temporary block on requests from an IP address that is sending excessive +// requests. +// +// When the rule action triggers, AWS WAF blocks additional requests from the +// IP address until the request rate falls below the limit. +// +// You can optionally nest another statement inside the rate-based statement, +// to narrow the scope of the rule so that it only counts requests that match +// the nested statement. For example, based on recent requests that you have +// seen from an attacker, you might create a rate-based rule with a nested AND +// rule statement that contains the following nested statements: +// +// * An IP match statement with an IP set that specified the address 192.0.2.44. +// +// * A string match statement that searches in the User-Agent header for +// the string BadBot. +// +// In this rate-based rule, you also define a rate limit. For this example, +// the rate limit is 1,000. Requests that meet both of the conditions in the +// statements are counted. If the count exceeds 1,000 requests per five minutes, +// the rule action triggers. Requests that do not meet both conditions are not +// counted towards the rate limit and are not affected by this rule. +// +// You cannot nest a RateBasedStatement, for example for use inside a NotStatement +// or OrStatement. It can only be referenced as a top-level statement within +// a rule. +type RateBasedStatement struct { + _ struct{} `type:"structure"` + + // Setting that indicates how to aggregate the request counts. Currently, you + // must set this to IP. The request counts are aggregated on IP addresses. + // + // AggregateKeyType is a required field + AggregateKeyType *string `type:"string" required:"true" enum:"RateBasedStatementAggregateKeyType"` + + // The limit on requests per 5-minute period for a single originating IP address. + // If the statement includes a ScopDownStatement, this limit is applied only + // to the requests that match the statement. + // + // Limit is a required field + Limit *int64 `min:"100" type:"long" required:"true"` + + // An optional nested statement that narrows the scope of the rate-based statement + // to matching web requests. This can be any nestable statement, and you can + // nest statements at any level below this scope-down statement. + ScopeDownStatement *Statement `type:"structure"` +} + +// String returns the string representation +func (s RateBasedStatement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RateBasedStatement) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RateBasedStatement) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RateBasedStatement"} + if s.AggregateKeyType == nil { + invalidParams.Add(request.NewErrParamRequired("AggregateKeyType")) + } + if s.Limit == nil { + invalidParams.Add(request.NewErrParamRequired("Limit")) + } + if s.Limit != nil && *s.Limit < 100 { + invalidParams.Add(request.NewErrParamMinValue("Limit", 100)) + } + if s.ScopeDownStatement != nil { + if err := s.ScopeDownStatement.Validate(); err != nil { + invalidParams.AddNested("ScopeDownStatement", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAggregateKeyType sets the AggregateKeyType field's value. +func (s *RateBasedStatement) SetAggregateKeyType(v string) *RateBasedStatement { + s.AggregateKeyType = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *RateBasedStatement) SetLimit(v int64) *RateBasedStatement { + s.Limit = &v + return s +} + +// SetScopeDownStatement sets the ScopeDownStatement field's value. +func (s *RateBasedStatement) SetScopeDownStatement(v *Statement) *RateBasedStatement { + s.ScopeDownStatement = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// The set of IP addresses that are currently blocked for a rate-based statement. +type RateBasedStatementManagedKeysIPSet struct { + _ struct{} `type:"structure"` + + // The IP addresses that are currently blocked. + Addresses []*string `type:"list"` + + IPAddressVersion *string `type:"string" enum:"IPAddressVersion"` +} + +// String returns the string representation +func (s RateBasedStatementManagedKeysIPSet) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RateBasedStatementManagedKeysIPSet) GoString() string { + return s.String() +} + +// SetAddresses sets the Addresses field's value. +func (s *RateBasedStatementManagedKeysIPSet) SetAddresses(v []*string) *RateBasedStatementManagedKeysIPSet { + s.Addresses = v + return s +} + +// SetIPAddressVersion sets the IPAddressVersion field's value. +func (s *RateBasedStatementManagedKeysIPSet) SetIPAddressVersion(v string) *RateBasedStatementManagedKeysIPSet { + s.IPAddressVersion = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A single regular expression. This is used in a RegexPatternSet. +type Regex struct { + _ struct{} `type:"structure"` + + // The string representing the regular expression. + RegexString *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s Regex) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Regex) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Regex) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Regex"} + if s.RegexString != nil && len(*s.RegexString) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RegexString", 1)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetRegexString sets the RegexString field's value. +func (s *Regex) SetRegexString(v string) *Regex { + s.RegexString = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Contains one or more regular expressions. +// +// AWS WAF assigns an ARN to each RegexPatternSet that you create. To use a +// set in a rule, you provide the ARN to the Rule statement RegexPatternSetReferenceStatement. +type RegexPatternSet struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the entity. + ARN *string `min:"20" type:"string"` + + // A friendly description of the set. You cannot change the description of a + // set after you create it. + Description *string `min:"1" type:"string"` + + // A unique identifier for the set. This ID is returned in the responses to + // create and list commands. You provide it to operations like update and delete. + Id *string `min:"1" type:"string"` + + // A friendly name of the set. You cannot change the name after you create the + // set. + Name *string `min:"1" type:"string"` + + // The regular expression patterns in the set. + RegularExpressionList []*Regex `min:"1" type:"list"` +} + +// String returns the string representation +func (s RegexPatternSet) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegexPatternSet) GoString() string { + return s.String() +} + +// SetARN sets the ARN field's value. +func (s *RegexPatternSet) SetARN(v string) *RegexPatternSet { + s.ARN = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *RegexPatternSet) SetDescription(v string) *RegexPatternSet { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *RegexPatternSet) SetId(v string) *RegexPatternSet { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *RegexPatternSet) SetName(v string) *RegexPatternSet { + s.Name = &v + return s +} + +// SetRegularExpressionList sets the RegularExpressionList field's value. +func (s *RegexPatternSet) SetRegularExpressionList(v []*Regex) *RegexPatternSet { + s.RegularExpressionList = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A rule statement used to search web request components for matches with regular +// expressions. To use this, create a RegexPatternSet that specifies the expressions +// that you want to detect, then use the ARN of that set in this statement. +// A web request matches the pattern set rule statement if the request component +// matches any of the patterns in the set. To create a regex pattern set, see +// CreateRegexPatternSet. +// +// Each regex pattern set rule statement references a regex pattern set. You +// create and maintain the set independent of your rules. This allows you to +// use the single set in multiple rules. When you update the referenced set, +// AWS WAF automatically updates all rules that reference it. +type RegexPatternSetReferenceStatement struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the RegexPatternSet that this statement + // references. + // + // ARN is a required field + ARN *string `min:"20" type:"string" required:"true"` + + // The part of a web request that you want AWS WAF to inspect. For more information, + // see FieldToMatch. + // + // 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 detection. If you specify one + // or more transformations in a rule statement, AWS WAF performs all transformations + // on the content identified by FieldToMatch, starting from the lowest priority + // setting, before inspecting the content for a match. + // + // TextTransformations is a required field + TextTransformations []*TextTransformation `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s RegexPatternSetReferenceStatement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegexPatternSetReferenceStatement) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RegexPatternSetReferenceStatement) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RegexPatternSetReferenceStatement"} + if s.ARN == nil { + invalidParams.Add(request.NewErrParamRequired("ARN")) + } + if s.ARN != nil && len(*s.ARN) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ARN", 20)) + } + if s.FieldToMatch == nil { + invalidParams.Add(request.NewErrParamRequired("FieldToMatch")) + } + if s.TextTransformations == nil { + invalidParams.Add(request.NewErrParamRequired("TextTransformations")) + } + if s.TextTransformations != nil && len(s.TextTransformations) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TextTransformations", 1)) + } + if s.FieldToMatch != nil { + if err := s.FieldToMatch.Validate(); err != nil { + invalidParams.AddNested("FieldToMatch", err.(request.ErrInvalidParams)) + } + } + if s.TextTransformations != nil { + for i, v := range s.TextTransformations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TextTransformations", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetARN sets the ARN field's value. +func (s *RegexPatternSetReferenceStatement) SetARN(v string) *RegexPatternSetReferenceStatement { + s.ARN = &v + return s +} + +// SetFieldToMatch sets the FieldToMatch field's value. +func (s *RegexPatternSetReferenceStatement) SetFieldToMatch(v *FieldToMatch) *RegexPatternSetReferenceStatement { + s.FieldToMatch = v + return s +} + +// SetTextTransformations sets the TextTransformations field's value. +func (s *RegexPatternSetReferenceStatement) SetTextTransformations(v []*TextTransformation) *RegexPatternSetReferenceStatement { + s.TextTransformations = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// High-level information about a RegexPatternSet, returned by operations like +// create and list. This provides information like the ID, that you can use +// to retrieve and manage a RegexPatternSet, and the ARN, that you provide to +// the RegexPatternSetReferenceStatement to use the pattern set in a Rule. +type RegexPatternSetSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the entity. + ARN *string `min:"20" type:"string"` + + // A friendly description of the set. You cannot change the description of a + // set after you create it. + Description *string `min:"1" type:"string"` + + // A unique identifier for the set. This ID is returned in the responses to + // create and list commands. You provide it to operations like update and delete. + Id *string `min:"1" type:"string"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + LockToken *string `min:"1" type:"string"` + + // A friendly name of the data type instance. You cannot change the name after + // you create the instance. + Name *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s RegexPatternSetSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegexPatternSetSummary) GoString() string { + return s.String() +} + +// SetARN sets the ARN field's value. +func (s *RegexPatternSetSummary) SetARN(v string) *RegexPatternSetSummary { + s.ARN = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *RegexPatternSetSummary) SetDescription(v string) *RegexPatternSetSummary { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *RegexPatternSetSummary) SetId(v string) *RegexPatternSetSummary { + s.Id = &v + return s +} + +// SetLockToken sets the LockToken field's value. +func (s *RegexPatternSetSummary) SetLockToken(v string) *RegexPatternSetSummary { + s.LockToken = &v + return s +} + +// SetName sets the Name field's value. +func (s *RegexPatternSetSummary) SetName(v string) *RegexPatternSetSummary { + s.Name = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A single rule, which you can use in a WebACL or RuleGroup to identify web +// requests that you want to allow, block, or count. Each rule includes one +// top-level Statement that AWS WAF uses to identify matching web requests, +// and parameters that govern how AWS WAF handles them. +type Rule struct { + _ struct{} `type:"structure"` + + // The action that AWS WAF should take on a web request when it matches the + // rule's statement. Settings at the web ACL level can override the rule action + // setting. + Action *RuleAction `type:"structure"` + + // A friendly name 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"` + + // The action to use to override the rule's Action setting. You can use no override + // action, in which case the rule action is in effect, or count action, in which + // case, if the rule matches a web request, it only counts the match. + OverrideAction *OverrideAction `type:"structure"` + + // If you define more than one Rule in a WebACL, AWS WAF evaluates each request + // against the Rules in order based on the value of Priority. AWS WAF processes + // rules with lower priority first. The priorities don't need to be consecutive, + // but they must all be different. + // + // Priority is a required field + Priority *int64 `type:"integer" required:"true"` + + // The AWS WAF processing statement for the rule, for example ByteMatchStatement + // or SizeConstraintStatement. + // + // Statement is a required field + Statement *Statement `type:"structure" required:"true"` + + // Defines and enables Amazon CloudWatch metrics and web request sample collection. + // + // VisibilityConfig is a required field + VisibilityConfig *VisibilityConfig `type:"structure" 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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Rule) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Rule"} + if s.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.Priority == nil { + invalidParams.Add(request.NewErrParamRequired("Priority")) + } + if s.Statement == nil { + invalidParams.Add(request.NewErrParamRequired("Statement")) + } + if s.VisibilityConfig == nil { + invalidParams.Add(request.NewErrParamRequired("VisibilityConfig")) + } + if s.Statement != nil { + if err := s.Statement.Validate(); err != nil { + invalidParams.AddNested("Statement", err.(request.ErrInvalidParams)) + } + } + if s.VisibilityConfig != nil { + if err := s.VisibilityConfig.Validate(); err != nil { + invalidParams.AddNested("VisibilityConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAction sets the Action field's value. +func (s *Rule) SetAction(v *RuleAction) *Rule { + s.Action = v + return s +} + +// SetName sets the Name field's value. +func (s *Rule) SetName(v string) *Rule { + s.Name = &v + return s +} + +// SetOverrideAction sets the OverrideAction field's value. +func (s *Rule) SetOverrideAction(v *OverrideAction) *Rule { + s.OverrideAction = v + return s +} + +// SetPriority sets the Priority field's value. +func (s *Rule) SetPriority(v int64) *Rule { + s.Priority = &v + return s +} + +// SetStatement sets the Statement field's value. +func (s *Rule) SetStatement(v *Statement) *Rule { + s.Statement = v + return s +} + +// SetVisibilityConfig sets the VisibilityConfig field's value. +func (s *Rule) SetVisibilityConfig(v *VisibilityConfig) *Rule { + s.VisibilityConfig = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// The action that AWS WAF should take on a web request when it matches a rule's +// statement. Settings at the web ACL level can override the rule action setting. +type RuleAction struct { + _ struct{} `type:"structure"` + + // Instructs AWS WAF to allow the web request. + Allow *AllowAction `type:"structure"` + + // Instructs AWS WAF to block the web request. + Block *BlockAction `type:"structure"` + + // Instructs AWS WAF to count the web request and allow it. + Count *CountAction `type:"structure"` +} + +// String returns the string representation +func (s RuleAction) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RuleAction) GoString() string { + return s.String() +} + +// SetAllow sets the Allow field's value. +func (s *RuleAction) SetAllow(v *AllowAction) *RuleAction { + s.Allow = v + return s +} + +// SetBlock sets the Block field's value. +func (s *RuleAction) SetBlock(v *BlockAction) *RuleAction { + s.Block = v + return s +} + +// SetCount sets the Count field's value. +func (s *RuleAction) SetCount(v *CountAction) *RuleAction { + s.Count = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A rule group defines a collection of rules to inspect and control web requests +// that you can use in a WebACL. When you create a rule group, you define an +// immutable capacity limit. If you update a rule group, you must stay within +// the capacity. This allows others to reuse the rule group with confidence +// in its capacity requirements. +type RuleGroup struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the entity. + // + // ARN is a required field + ARN *string `min:"20" type:"string" required:"true"` + + // The web ACL capacity units (WCUs) required for this rule group. + // + // When you create your own rule group, you define this, and you cannot change + // it after creation. When you add or modify the rules in a rule group, AWS + // WAF enforces this limit. You can check the capacity for a set of rules using + // CheckCapacity. + // + // AWS WAF uses WCUs to calculate and control the operating resources that are + // used to run your rules, rule groups, and web ACLs. AWS WAF calculates capacity + // differently for each rule type, to reflect the relative cost of each rule. + // Simple rules that cost little to run use fewer WCUs than more complex rules + // that use more processing power. Rule group capacity is fixed at creation, + // which helps users plan their web ACL WCU usage when they use a rule group. + // The WCU limit for web ACLs is 1,500. + // + // Capacity is a required field + Capacity *int64 `min:"1" type:"long" required:"true"` + + // A friendly description of the rule group. You cannot change the description + // of a rule group after you create it. + Description *string `min:"1" type:"string"` + + // A unique identifier for the rule group. This ID is returned in the responses + // to create and list commands. You provide it to operations like update and + // delete. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // A friendly name of the rule group. You cannot change the name of a rule group + // after you create it. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The Rule statements used to identify the web requests that you want to allow, + // block, or count. Each rule includes one top-level statement that AWS WAF + // uses to identify matching web requests, and parameters that govern how AWS + // WAF handles them. + Rules []*Rule `type:"list"` + + // Defines and enables Amazon CloudWatch metrics and web request sample collection. + // + // VisibilityConfig is a required field + VisibilityConfig *VisibilityConfig `type:"structure" required:"true"` +} + +// String returns the string representation +func (s RuleGroup) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RuleGroup) GoString() string { + return s.String() +} + +// SetARN sets the ARN field's value. +func (s *RuleGroup) SetARN(v string) *RuleGroup { + s.ARN = &v + return s +} + +// SetCapacity sets the Capacity field's value. +func (s *RuleGroup) SetCapacity(v int64) *RuleGroup { + s.Capacity = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *RuleGroup) SetDescription(v string) *RuleGroup { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *RuleGroup) SetId(v string) *RuleGroup { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *RuleGroup) SetName(v string) *RuleGroup { + s.Name = &v + return s +} + +// SetRules sets the Rules field's value. +func (s *RuleGroup) SetRules(v []*Rule) *RuleGroup { + s.Rules = v + return s +} + +// SetVisibilityConfig sets the VisibilityConfig field's value. +func (s *RuleGroup) SetVisibilityConfig(v *VisibilityConfig) *RuleGroup { + s.VisibilityConfig = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A rule statement used to run the rules that are defined in a RuleGroup. To +// use this, create a rule group with your rules, then provide the ARN of the +// rule group in this statement. +// +// You cannot nest a RuleGroupReferenceStatement, for example for use inside +// a NotStatement or OrStatement. It can only be referenced as a top-level statement +// within a rule. +type RuleGroupReferenceStatement struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the entity. + // + // ARN is a required field + ARN *string `min:"20" type:"string" required:"true"` + + // The names of rules that are in the referenced rule group, but that you want + // AWS WAF to exclude from processing for this rule statement. + ExcludedRules []*ExcludedRule `type:"list"` +} + +// String returns the string representation +func (s RuleGroupReferenceStatement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RuleGroupReferenceStatement) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RuleGroupReferenceStatement) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RuleGroupReferenceStatement"} + if s.ARN == nil { + invalidParams.Add(request.NewErrParamRequired("ARN")) + } + if s.ARN != nil && len(*s.ARN) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ARN", 20)) + } + if s.ExcludedRules != nil { + for i, v := range s.ExcludedRules { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ExcludedRules", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetARN sets the ARN field's value. +func (s *RuleGroupReferenceStatement) SetARN(v string) *RuleGroupReferenceStatement { + s.ARN = &v + return s +} + +// SetExcludedRules sets the ExcludedRules field's value. +func (s *RuleGroupReferenceStatement) SetExcludedRules(v []*ExcludedRule) *RuleGroupReferenceStatement { + s.ExcludedRules = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// High-level information about a RuleGroup, returned by operations like create +// and list. This provides information like the ID, that you can use to retrieve +// and manage a RuleGroup, and the ARN, that you provide to the RuleGroupReferenceStatement +// to use the rule group in a Rule. +type RuleGroupSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the entity. + ARN *string `min:"20" type:"string"` + + // A friendly description of the rule group. You cannot change the description + // of a rule group after you create it. + Description *string `min:"1" type:"string"` + + // A unique identifier for the rule group. This ID is returned in the responses + // to create and list commands. You provide it to operations like update and + // delete. + Id *string `min:"1" type:"string"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + LockToken *string `min:"1" type:"string"` + + // A friendly name of the data type instance. You cannot change the name after + // you create the instance. + Name *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s RuleGroupSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RuleGroupSummary) GoString() string { + return s.String() +} + +// SetARN sets the ARN field's value. +func (s *RuleGroupSummary) SetARN(v string) *RuleGroupSummary { + s.ARN = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *RuleGroupSummary) SetDescription(v string) *RuleGroupSummary { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *RuleGroupSummary) SetId(v string) *RuleGroupSummary { + s.Id = &v + return s +} + +// SetLockToken sets the LockToken field's value. +func (s *RuleGroupSummary) SetLockToken(v string) *RuleGroupSummary { + s.LockToken = &v + return s +} + +// SetName sets the Name field's value. +func (s *RuleGroupSummary) SetName(v string) *RuleGroupSummary { + s.Name = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// High-level information about a Rule, returned by operations like DescribeManagedRuleGroup. +// This provides information like the ID, that you can use to retrieve and manage +// a RuleGroup, and the ARN, that you provide to the RuleGroupReferenceStatement +// to use the rule group in a Rule. +type RuleSummary struct { + _ struct{} `type:"structure"` + + // + // This is the latest version of AWS WAF, named AWS WAFV2, released in November, + // 2019. For information, including how to migrate your AWS WAF resources from + // the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). + // + // The action that AWS WAF should take on a web request when it matches a rule's + // statement. Settings at the web ACL level can override the rule action setting. + Action *RuleAction `type:"structure"` + + // The name of the rule. + Name *string `min:"1" type:"string"` +} + +// 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() +} + +// SetAction sets the Action field's value. +func (s *RuleSummary) SetAction(v *RuleAction) *RuleSummary { + s.Action = v + return s +} + +// SetName sets the Name field's value. +func (s *RuleSummary) SetName(v string) *RuleSummary { + s.Name = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Represents a single sampled web request. The response from GetSampledRequests +// includes a SampledHTTPRequests complex type that appears as SampledRequests +// in the response syntax. SampledHTTPRequests contains an array of SampledHTTPRequest +// objects. +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 name of the Rule that the request matched. For managed rule groups, the + // format for this name is ##. + // For your own rule groups, the format for this name is #. If the rule is not in a rule group, the format is . + RuleNameWithinRuleGroup *string `min:"1" type:"string"` + + // The time at which AWS WAF received the request from your AWS resource, in + // Unix time format (in seconds). + Timestamp *time.Time `type:"timestamp"` + + // A value that indicates how one result in the response relates proportionally + // to other results in the response. For example, a result that has a weight + // of 2 represents roughly twice as many 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 +} + +// SetRuleNameWithinRuleGroup sets the RuleNameWithinRuleGroup field's value. +func (s *SampledHTTPRequest) SetRuleNameWithinRuleGroup(v string) *SampledHTTPRequest { + s.RuleNameWithinRuleGroup = &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 +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// One of the headers in a web request, identified by name, for example, User-Agent +// or Referer. This setting isn't case sensitive. +// +// This is used only to indicate the web request component for AWS WAF to inspect, +// in the FieldToMatch specification. +type SingleHeader struct { + _ struct{} `type:"structure"` + + // The name of the query header to inspect. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s SingleHeader) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SingleHeader) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SingleHeader) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SingleHeader"} + 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 *SingleHeader) SetName(v string) *SingleHeader { + s.Name = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// One query argument in a web request, identified by name, for example UserName +// or SalesRegion. The name can be up to 30 characters long and isn't case sensitive. +type SingleQueryArgument struct { + _ struct{} `type:"structure"` + + // The name of the query argument to inspect. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` +} + +// String returns the string representation +func (s SingleQueryArgument) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SingleQueryArgument) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SingleQueryArgument) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SingleQueryArgument"} + 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 *SingleQueryArgument) SetName(v string) *SingleQueryArgument { + s.Name = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A rule statement that compares a number of bytes against the size of a request +// component, using a comparison operator, such as greater than (>) or less +// than (<). For example, you can use a size constraint statement to look for +// query strings that are longer than 100 bytes. +// +// If you configure AWS WAF to inspect the request body, AWS WAF inspects only +// the first 8192 bytes (8 KB). If the request body for your web requests never +// exceeds 8192 bytes, you can create a size constraint condition and block +// requests that have a request body greater than 8192 bytes. +// +// If you choose URI for the value of Part of the request to filter on, the +// slash (/) in the URI counts as one character. For example, the URI /logo.jpg +// is nine characters long. +type SizeConstraintStatement struct { + _ struct{} `type:"structure"` + + // The operator to use to compare the request part to the size setting. + // + // ComparisonOperator is a required field + ComparisonOperator *string `type:"string" required:"true" enum:"ComparisonOperator"` + + // The part of a web request that you want AWS WAF to inspect. For more information, + // see FieldToMatch. + // + // FieldToMatch is a required field + FieldToMatch *FieldToMatch `type:"structure" required:"true"` + + // The size, in byte, to compare to the request part, after any transformations. + // + // 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 detection. If you specify one + // or more transformations in a rule statement, AWS WAF performs all transformations + // on the content identified by FieldToMatch, starting from the lowest priority + // setting, before inspecting the content for a match. + // + // TextTransformations is a required field + TextTransformations []*TextTransformation `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s SizeConstraintStatement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SizeConstraintStatement) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SizeConstraintStatement) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SizeConstraintStatement"} + 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.TextTransformations == nil { + invalidParams.Add(request.NewErrParamRequired("TextTransformations")) + } + if s.TextTransformations != nil && len(s.TextTransformations) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TextTransformations", 1)) + } + if s.FieldToMatch != nil { + if err := s.FieldToMatch.Validate(); err != nil { + invalidParams.AddNested("FieldToMatch", err.(request.ErrInvalidParams)) + } + } + if s.TextTransformations != nil { + for i, v := range s.TextTransformations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TextTransformations", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetComparisonOperator sets the ComparisonOperator field's value. +func (s *SizeConstraintStatement) SetComparisonOperator(v string) *SizeConstraintStatement { + s.ComparisonOperator = &v + return s +} + +// SetFieldToMatch sets the FieldToMatch field's value. +func (s *SizeConstraintStatement) SetFieldToMatch(v *FieldToMatch) *SizeConstraintStatement { + s.FieldToMatch = v + return s +} + +// SetSize sets the Size field's value. +func (s *SizeConstraintStatement) SetSize(v int64) *SizeConstraintStatement { + s.Size = &v + return s +} + +// SetTextTransformations sets the TextTransformations field's value. +func (s *SizeConstraintStatement) SetTextTransformations(v []*TextTransformation) *SizeConstraintStatement { + s.TextTransformations = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Attackers sometimes insert malicious SQL code into web requests in an effort +// to extract data from your database. To allow or block web requests that appear +// to contain malicious SQL code, create one or more SQL injection match conditions. +// An SQL injection match condition identifies the part of web requests, such +// as the URI or the query string, that you want AWS WAF to inspect. Later in +// the process, when you create a web ACL, you specify whether to allow or block +// requests that appear to contain malicious SQL code. +type SqliMatchStatement struct { + _ struct{} `type:"structure"` + + // The part of a web request that you want AWS WAF to inspect. For more information, + // see FieldToMatch. + // + // 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 detection. If you specify one + // or more transformations in a rule statement, AWS WAF performs all transformations + // on the content identified by FieldToMatch, starting from the lowest priority + // setting, before inspecting the content for a match. + // + // TextTransformations is a required field + TextTransformations []*TextTransformation `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s SqliMatchStatement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SqliMatchStatement) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *SqliMatchStatement) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "SqliMatchStatement"} + if s.FieldToMatch == nil { + invalidParams.Add(request.NewErrParamRequired("FieldToMatch")) + } + if s.TextTransformations == nil { + invalidParams.Add(request.NewErrParamRequired("TextTransformations")) + } + if s.TextTransformations != nil && len(s.TextTransformations) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TextTransformations", 1)) + } + if s.FieldToMatch != nil { + if err := s.FieldToMatch.Validate(); err != nil { + invalidParams.AddNested("FieldToMatch", err.(request.ErrInvalidParams)) + } + } + if s.TextTransformations != nil { + for i, v := range s.TextTransformations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TextTransformations", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFieldToMatch sets the FieldToMatch field's value. +func (s *SqliMatchStatement) SetFieldToMatch(v *FieldToMatch) *SqliMatchStatement { + s.FieldToMatch = v + return s +} + +// SetTextTransformations sets the TextTransformations field's value. +func (s *SqliMatchStatement) SetTextTransformations(v []*TextTransformation) *SqliMatchStatement { + s.TextTransformations = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// The processing guidance for a Rule, used by AWS WAF to determine whether +// a web request matches the rule. +type Statement struct { + _ struct{} `type:"structure"` + + // A logical rule statement used to combine other rule statements with AND logic. + // You provide more than one Statement within the AndStatement. + AndStatement *AndStatement `type:"structure"` + + // A rule statement that defines a string match search for AWS WAF to apply + // to web requests. The byte match statement provides the bytes to search for, + // the location in requests that you want AWS WAF to search, and other settings. + // The bytes to search for are typically a string that corresponds with ASCII + // characters. In the AWS WAF console and the developer guide, this is refered + // to as a string match statement. + ByteMatchStatement *ByteMatchStatement `type:"structure"` + + // A rule statement used to identify web requests based on country of origin. + GeoMatchStatement *GeoMatchStatement `type:"structure"` + + // A rule statement used to detect web requests coming from particular IP addresses + // or address ranges. To use this, create an IPSet that specifies the addresses + // you want to detect, then use the ARN of that set in this statement. To create + // an IP set, see CreateIPSet. + // + // Each IP set rule statement references an IP set. You create and maintain + // the set independent of your rules. This allows you to use the single set + // in multiple rules. When you update the referenced set, AWS WAF automatically + // updates all rules that reference it. + IPSetReferenceStatement *IPSetReferenceStatement `type:"structure"` + + // A rule statement used to run the rules that are defined in a managed rule + // group. To use this, provide the vendor name and the name of the rule group + // in this statement. You can retrieve the required names by calling ListAvailableManagedRuleGroups. + // + // You can't nest a ManagedRuleGroupStatement, for example for use inside a + // NotStatement or OrStatement. It can only be referenced as a top-level statement + // within a rule. + ManagedRuleGroupStatement *ManagedRuleGroupStatement `type:"structure"` + + // A logical rule statement used to negate the results of another rule statement. + // You provide one Statement within the NotStatement. + NotStatement *NotStatement `type:"structure"` + + // A logical rule statement used to combine other rule statements with OR logic. + // You provide more than one Statement within the OrStatement. + OrStatement *OrStatement `type:"structure"` + + // A rate-based rule tracks the rate of requests for each originating IP address, + // and triggers the rule action when the rate exceeds a limit that you specify + // on the number of requests in any 5-minute time span. You can use this to + // put a temporary block on requests from an IP address that is sending excessive + // requests. + // + // When the rule action triggers, AWS WAF blocks additional requests from the + // IP address until the request rate falls below the limit. + // + // You can optionally nest another statement inside the rate-based statement, + // to narrow the scope of the rule so that it only counts requests that match + // the nested statement. For example, based on recent requests that you have + // seen from an attacker, you might create a rate-based rule with a nested AND + // rule statement that contains the following nested statements: + // + // * An IP match statement with an IP set that specified the address 192.0.2.44. + // + // * A string match statement that searches in the User-Agent header for + // the string BadBot. + // + // In this rate-based rule, you also define a rate limit. For this example, + // the rate limit is 1,000. Requests that meet both of the conditions in the + // statements are counted. If the count exceeds 1,000 requests per five minutes, + // the rule action triggers. Requests that do not meet both conditions are not + // counted towards the rate limit and are not affected by this rule. + // + // You cannot nest a RateBasedStatement, for example for use inside a NotStatement + // or OrStatement. It can only be referenced as a top-level statement within + // a rule. + RateBasedStatement *RateBasedStatement `type:"structure"` + + // A rule statement used to search web request components for matches with regular + // expressions. To use this, create a RegexPatternSet that specifies the expressions + // that you want to detect, then use the ARN of that set in this statement. + // A web request matches the pattern set rule statement if the request component + // matches any of the patterns in the set. To create a regex pattern set, see + // CreateRegexPatternSet. + // + // Each regex pattern set rule statement references a regex pattern set. You + // create and maintain the set independent of your rules. This allows you to + // use the single set in multiple rules. When you update the referenced set, + // AWS WAF automatically updates all rules that reference it. + RegexPatternSetReferenceStatement *RegexPatternSetReferenceStatement `type:"structure"` + + // A rule statement used to run the rules that are defined in a RuleGroup. To + // use this, create a rule group with your rules, then provide the ARN of the + // rule group in this statement. + // + // You cannot nest a RuleGroupReferenceStatement, for example for use inside + // a NotStatement or OrStatement. It can only be referenced as a top-level statement + // within a rule. + RuleGroupReferenceStatement *RuleGroupReferenceStatement `type:"structure"` + + // A rule statement that compares a number of bytes against the size of a request + // component, using a comparison operator, such as greater than (>) or less + // than (<). For example, you can use a size constraint statement to look for + // query strings that are longer than 100 bytes. + // + // If you configure AWS WAF to inspect the request body, AWS WAF inspects only + // the first 8192 bytes (8 KB). If the request body for your web requests never + // exceeds 8192 bytes, you can create a size constraint condition and block + // requests that have a request body greater than 8192 bytes. + // + // If you choose URI for the value of Part of the request to filter on, the + // slash (/) in the URI counts as one character. For example, the URI /logo.jpg + // is nine characters long. + SizeConstraintStatement *SizeConstraintStatement `type:"structure"` + + // Attackers sometimes insert malicious SQL code into web requests in an effort + // to extract data from your database. To allow or block web requests that appear + // to contain malicious SQL code, create one or more SQL injection match conditions. + // An SQL injection match condition identifies the part of web requests, such + // as the URI or the query string, that you want AWS WAF to inspect. Later in + // the process, when you create a web ACL, you specify whether to allow or block + // requests that appear to contain malicious SQL code. + SqliMatchStatement *SqliMatchStatement `type:"structure"` + + // A rule statement that defines a cross-site scripting (XSS) match search for + // AWS WAF to apply to web requests. XSS attacks are those where the attacker + // uses vulnerabilities in a benign website as a vehicle to inject malicious + // client-site scripts into other legitimate web browsers. The XSS match statement + // provides the location in requests that you want AWS WAF to search and text + // transformations to use on the search area before AWS WAF searches for character + // sequences that are likely to be malicious strings. + XssMatchStatement *XssMatchStatement `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() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *Statement) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "Statement"} + if s.AndStatement != nil { + if err := s.AndStatement.Validate(); err != nil { + invalidParams.AddNested("AndStatement", err.(request.ErrInvalidParams)) + } + } + if s.ByteMatchStatement != nil { + if err := s.ByteMatchStatement.Validate(); err != nil { + invalidParams.AddNested("ByteMatchStatement", err.(request.ErrInvalidParams)) + } + } + if s.GeoMatchStatement != nil { + if err := s.GeoMatchStatement.Validate(); err != nil { + invalidParams.AddNested("GeoMatchStatement", err.(request.ErrInvalidParams)) + } + } + if s.IPSetReferenceStatement != nil { + if err := s.IPSetReferenceStatement.Validate(); err != nil { + invalidParams.AddNested("IPSetReferenceStatement", err.(request.ErrInvalidParams)) + } + } + if s.ManagedRuleGroupStatement != nil { + if err := s.ManagedRuleGroupStatement.Validate(); err != nil { + invalidParams.AddNested("ManagedRuleGroupStatement", err.(request.ErrInvalidParams)) + } + } + if s.NotStatement != nil { + if err := s.NotStatement.Validate(); err != nil { + invalidParams.AddNested("NotStatement", err.(request.ErrInvalidParams)) + } + } + if s.OrStatement != nil { + if err := s.OrStatement.Validate(); err != nil { + invalidParams.AddNested("OrStatement", err.(request.ErrInvalidParams)) + } + } + if s.RateBasedStatement != nil { + if err := s.RateBasedStatement.Validate(); err != nil { + invalidParams.AddNested("RateBasedStatement", err.(request.ErrInvalidParams)) + } + } + if s.RegexPatternSetReferenceStatement != nil { + if err := s.RegexPatternSetReferenceStatement.Validate(); err != nil { + invalidParams.AddNested("RegexPatternSetReferenceStatement", err.(request.ErrInvalidParams)) + } + } + if s.RuleGroupReferenceStatement != nil { + if err := s.RuleGroupReferenceStatement.Validate(); err != nil { + invalidParams.AddNested("RuleGroupReferenceStatement", err.(request.ErrInvalidParams)) + } + } + if s.SizeConstraintStatement != nil { + if err := s.SizeConstraintStatement.Validate(); err != nil { + invalidParams.AddNested("SizeConstraintStatement", err.(request.ErrInvalidParams)) + } + } + if s.SqliMatchStatement != nil { + if err := s.SqliMatchStatement.Validate(); err != nil { + invalidParams.AddNested("SqliMatchStatement", err.(request.ErrInvalidParams)) + } + } + if s.XssMatchStatement != nil { + if err := s.XssMatchStatement.Validate(); err != nil { + invalidParams.AddNested("XssMatchStatement", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAndStatement sets the AndStatement field's value. +func (s *Statement) SetAndStatement(v *AndStatement) *Statement { + s.AndStatement = v + return s +} + +// SetByteMatchStatement sets the ByteMatchStatement field's value. +func (s *Statement) SetByteMatchStatement(v *ByteMatchStatement) *Statement { + s.ByteMatchStatement = v + return s +} + +// SetGeoMatchStatement sets the GeoMatchStatement field's value. +func (s *Statement) SetGeoMatchStatement(v *GeoMatchStatement) *Statement { + s.GeoMatchStatement = v + return s +} + +// SetIPSetReferenceStatement sets the IPSetReferenceStatement field's value. +func (s *Statement) SetIPSetReferenceStatement(v *IPSetReferenceStatement) *Statement { + s.IPSetReferenceStatement = v + return s +} + +// SetManagedRuleGroupStatement sets the ManagedRuleGroupStatement field's value. +func (s *Statement) SetManagedRuleGroupStatement(v *ManagedRuleGroupStatement) *Statement { + s.ManagedRuleGroupStatement = v + return s +} + +// SetNotStatement sets the NotStatement field's value. +func (s *Statement) SetNotStatement(v *NotStatement) *Statement { + s.NotStatement = v + return s +} + +// SetOrStatement sets the OrStatement field's value. +func (s *Statement) SetOrStatement(v *OrStatement) *Statement { + s.OrStatement = v + return s +} + +// SetRateBasedStatement sets the RateBasedStatement field's value. +func (s *Statement) SetRateBasedStatement(v *RateBasedStatement) *Statement { + s.RateBasedStatement = v + return s +} + +// SetRegexPatternSetReferenceStatement sets the RegexPatternSetReferenceStatement field's value. +func (s *Statement) SetRegexPatternSetReferenceStatement(v *RegexPatternSetReferenceStatement) *Statement { + s.RegexPatternSetReferenceStatement = v + return s +} + +// SetRuleGroupReferenceStatement sets the RuleGroupReferenceStatement field's value. +func (s *Statement) SetRuleGroupReferenceStatement(v *RuleGroupReferenceStatement) *Statement { + s.RuleGroupReferenceStatement = v + return s +} + +// SetSizeConstraintStatement sets the SizeConstraintStatement field's value. +func (s *Statement) SetSizeConstraintStatement(v *SizeConstraintStatement) *Statement { + s.SizeConstraintStatement = v + return s +} + +// SetSqliMatchStatement sets the SqliMatchStatement field's value. +func (s *Statement) SetSqliMatchStatement(v *SqliMatchStatement) *Statement { + s.SqliMatchStatement = v + return s +} + +// SetXssMatchStatement sets the XssMatchStatement field's value. +func (s *Statement) SetXssMatchStatement(v *XssMatchStatement) *Statement { + s.XssMatchStatement = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A collection of key:value pairs associated with an AWS resource. The key:value +// pair can be anything you define. Typically, the tag key represents a category +// (such as "environment") and the tag value represents a specific value within +// that category (such as "test," "development," or "production"). You can add +// up to 50 tags to each AWS resource. +type Tag struct { + _ struct{} `type:"structure"` + + // Part of the key:value pair that defines a tag. You can use a tag key to describe + // a category of information, such as "customer." Tag keys are case-sensitive. + // + // Key is a required field + Key *string `min:"1" type:"string" required:"true"` + + // Part of the key:value pair that defines a tag. You can use a tag value to + // describe a specific value within a category, such as "companyA" or "companyB." + // Tag values are case-sensitive. + // + // 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 +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// The collection of tagging definitions for an AWS resource. +type TagInfoForResource struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + ResourceARN *string `min:"20" type:"string"` + + // The array of Tag objects defined for the resource. + TagList []*Tag `min:"1" type:"list"` +} + +// String returns the string representation +func (s TagInfoForResource) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TagInfoForResource) GoString() string { + return s.String() +} + +// SetResourceARN sets the ResourceARN field's value. +func (s *TagInfoForResource) SetResourceARN(v string) *TagInfoForResource { + s.ResourceARN = &v + return s +} + +// SetTagList sets the TagList field's value. +func (s *TagInfoForResource) SetTagList(v []*Tag) *TagInfoForResource { + s.TagList = v + return s +} + +type TagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + // + // ResourceARN is a required field + ResourceARN *string `min:"20" type:"string" required:"true"` + + // An array of key:value pairs to associate with the resource. + // + // Tags is a required field + Tags []*Tag `min:"1" 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) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 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 +} + +// 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 +} + +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() +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Text transformations eliminate some of the unusual formatting that attackers +// use in web requests in an effort to bypass detection. +type TextTransformation struct { + _ struct{} `type:"structure"` + + // Sets the relative processing order for multiple transformations that are + // defined for a rule statement. AWS WAF processes all transformations, from + // lowest priority to highest, before inspecting the transformed content. The + // priorities don't need to be consecutive, but they must all be different. + // + // Priority is a required field + Priority *int64 `type:"integer" required:"true"` + + // You can specify the following transformation types: + // + // 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. + // + // NONE + // + // Specify NONE if you don't want any text transformations. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"TextTransformationType"` +} + +// String returns the string representation +func (s TextTransformation) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TextTransformation) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *TextTransformation) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "TextTransformation"} + if s.Priority == nil { + invalidParams.Add(request.NewErrParamRequired("Priority")) + } + if s.Type == nil { + invalidParams.Add(request.NewErrParamRequired("Type")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetPriority sets the Priority field's value. +func (s *TextTransformation) SetPriority(v int64) *TextTransformation { + s.Priority = &v + return s +} + +// SetType sets the Type field's value. +func (s *TextTransformation) SetType(v string) *TextTransformation { + s.Type = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// 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. +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" 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" 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 +} + +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the resource. + // + // ResourceARN is a required field + ResourceARN *string `min:"20" type:"string" required:"true"` + + // An array of keys identifying the tags to disassociate from the resource. + // + // TagKeys is a required field + TagKeys []*string `min:"1" 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) < 20 { + invalidParams.Add(request.NewErrParamMinLen("ResourceARN", 20)) + } + 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 +} + +// 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 +} + +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() +} + +type UpdateIPSetInput struct { + _ struct{} `type:"structure"` + + // Contains an array of strings that specify one or more IP addresses or blocks + // of IP addresses in Classless Inter-Domain Routing (CIDR) notation. AWS WAF + // supports all address ranges for IP versions IPv4 and IPv6. + // + // Examples: + // + // * 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. + // + // * 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. + // + // For more information about CIDR notation, see the Wikipedia entry Classless + // Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing). + // + // Addresses is a required field + Addresses []*string `type:"list" required:"true"` + + // A friendly description of the IP set. You cannot change the description of + // an IP set after you create it. + Description *string `min:"1" type:"string"` + + // A unique identifier for the set. This ID is returned in the responses to + // create and list commands. You provide it to operations like update and delete. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + // + // LockToken is a required field + LockToken *string `min:"1" type:"string" required:"true"` + + // A friendly name of the IP set. You cannot change the name of an IPSet after + // you create it. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// 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.Addresses == nil { + invalidParams.Add(request.NewErrParamRequired("Addresses")) + } + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 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.LockToken == nil { + invalidParams.Add(request.NewErrParamRequired("LockToken")) + } + if s.LockToken != nil && len(*s.LockToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LockToken", 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.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAddresses sets the Addresses field's value. +func (s *UpdateIPSetInput) SetAddresses(v []*string) *UpdateIPSetInput { + s.Addresses = v + return s +} + +// SetDescription sets the Description field's value. +func (s *UpdateIPSetInput) SetDescription(v string) *UpdateIPSetInput { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *UpdateIPSetInput) SetId(v string) *UpdateIPSetInput { + s.Id = &v + return s +} + +// SetLockToken sets the LockToken field's value. +func (s *UpdateIPSetInput) SetLockToken(v string) *UpdateIPSetInput { + s.LockToken = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateIPSetInput) SetName(v string) *UpdateIPSetInput { + s.Name = &v + return s +} + +// SetScope sets the Scope field's value. +func (s *UpdateIPSetInput) SetScope(v string) *UpdateIPSetInput { + s.Scope = &v + return s +} + +type UpdateIPSetOutput struct { + _ struct{} `type:"structure"` + + // A token used for optimistic locking. AWS WAF returns this token to your update + // requests. You use NextLockToken in the same manner as you use LockToken. + NextLockToken *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() +} + +// SetNextLockToken sets the NextLockToken field's value. +func (s *UpdateIPSetOutput) SetNextLockToken(v string) *UpdateIPSetOutput { + s.NextLockToken = &v + return s +} + +type UpdateRegexPatternSetInput struct { + _ struct{} `type:"structure"` + + // A friendly description of the set. You cannot change the description of a + // set after you create it. + Description *string `min:"1" type:"string"` + + // A unique identifier for the set. This ID is returned in the responses to + // create and list commands. You provide it to operations like update and delete. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + // + // LockToken is a required field + LockToken *string `min:"1" type:"string" required:"true"` + + // A friendly name of the set. You cannot change the name after you create the + // set. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // RegularExpressionList is a required field + RegularExpressionList []*Regex `min:"1" type:"list" required:"true"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` +} + +// String returns the string representation +func (s UpdateRegexPatternSetInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateRegexPatternSetInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateRegexPatternSetInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateRegexPatternSetInput"} + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 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.LockToken == nil { + invalidParams.Add(request.NewErrParamRequired("LockToken")) + } + if s.LockToken != nil && len(*s.LockToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LockToken", 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.RegularExpressionList == nil { + invalidParams.Add(request.NewErrParamRequired("RegularExpressionList")) + } + if s.RegularExpressionList != nil && len(s.RegularExpressionList) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RegularExpressionList", 1)) + } + if s.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + if s.RegularExpressionList != nil { + for i, v := range s.RegularExpressionList { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RegularExpressionList", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDescription sets the Description field's value. +func (s *UpdateRegexPatternSetInput) SetDescription(v string) *UpdateRegexPatternSetInput { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *UpdateRegexPatternSetInput) SetId(v string) *UpdateRegexPatternSetInput { + s.Id = &v + return s +} + +// SetLockToken sets the LockToken field's value. +func (s *UpdateRegexPatternSetInput) SetLockToken(v string) *UpdateRegexPatternSetInput { + s.LockToken = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateRegexPatternSetInput) SetName(v string) *UpdateRegexPatternSetInput { + s.Name = &v + return s +} + +// SetRegularExpressionList sets the RegularExpressionList field's value. +func (s *UpdateRegexPatternSetInput) SetRegularExpressionList(v []*Regex) *UpdateRegexPatternSetInput { + s.RegularExpressionList = v + return s +} + +// SetScope sets the Scope field's value. +func (s *UpdateRegexPatternSetInput) SetScope(v string) *UpdateRegexPatternSetInput { + s.Scope = &v + return s +} + +type UpdateRegexPatternSetOutput struct { + _ struct{} `type:"structure"` + + // A token used for optimistic locking. AWS WAF returns this token to your update + // requests. You use NextLockToken in the same manner as you use LockToken. + NextLockToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateRegexPatternSetOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateRegexPatternSetOutput) GoString() string { + return s.String() +} + +// SetNextLockToken sets the NextLockToken field's value. +func (s *UpdateRegexPatternSetOutput) SetNextLockToken(v string) *UpdateRegexPatternSetOutput { + s.NextLockToken = &v + return s +} + +type UpdateRuleGroupInput struct { + _ struct{} `type:"structure"` + + // A friendly description of the rule group. You cannot change the description + // of a rule group after you create it. + Description *string `min:"1" type:"string"` + + // A unique identifier for the rule group. This ID is returned in the responses + // to create and list commands. You provide it to operations like update and + // delete. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + // + // LockToken is a required field + LockToken *string `min:"1" type:"string" required:"true"` + + // A friendly name of the rule group. You cannot change the name of a rule group + // after you create it. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The Rule statements used to identify the web requests that you want to allow, + // block, or count. Each rule includes one top-level statement that AWS WAF + // uses to identify matching web requests, and parameters that govern how AWS + // WAF handles them. + Rules []*Rule `type:"list"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` + + // Defines and enables Amazon CloudWatch metrics and web request sample collection. + // + // VisibilityConfig is a required field + VisibilityConfig *VisibilityConfig `type:"structure" required:"true"` +} + +// String returns the string representation +func (s UpdateRuleGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateRuleGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateRuleGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateRuleGroupInput"} + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 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.LockToken == nil { + invalidParams.Add(request.NewErrParamRequired("LockToken")) + } + if s.LockToken != nil && len(*s.LockToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LockToken", 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.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + if s.VisibilityConfig == nil { + invalidParams.Add(request.NewErrParamRequired("VisibilityConfig")) + } + 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 s.VisibilityConfig != nil { + if err := s.VisibilityConfig.Validate(); err != nil { + invalidParams.AddNested("VisibilityConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDescription sets the Description field's value. +func (s *UpdateRuleGroupInput) SetDescription(v string) *UpdateRuleGroupInput { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *UpdateRuleGroupInput) SetId(v string) *UpdateRuleGroupInput { + s.Id = &v + return s +} + +// SetLockToken sets the LockToken field's value. +func (s *UpdateRuleGroupInput) SetLockToken(v string) *UpdateRuleGroupInput { + s.LockToken = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateRuleGroupInput) SetName(v string) *UpdateRuleGroupInput { + s.Name = &v + return s +} + +// SetRules sets the Rules field's value. +func (s *UpdateRuleGroupInput) SetRules(v []*Rule) *UpdateRuleGroupInput { + s.Rules = v + return s +} + +// SetScope sets the Scope field's value. +func (s *UpdateRuleGroupInput) SetScope(v string) *UpdateRuleGroupInput { + s.Scope = &v + return s +} + +// SetVisibilityConfig sets the VisibilityConfig field's value. +func (s *UpdateRuleGroupInput) SetVisibilityConfig(v *VisibilityConfig) *UpdateRuleGroupInput { + s.VisibilityConfig = v + return s +} + +type UpdateRuleGroupOutput struct { + _ struct{} `type:"structure"` + + // A token used for optimistic locking. AWS WAF returns this token to your update + // requests. You use NextLockToken in the same manner as you use LockToken. + NextLockToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s UpdateRuleGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateRuleGroupOutput) GoString() string { + return s.String() +} + +// SetNextLockToken sets the NextLockToken field's value. +func (s *UpdateRuleGroupOutput) SetNextLockToken(v string) *UpdateRuleGroupOutput { + s.NextLockToken = &v + return s +} + +type UpdateWebACLInput struct { + _ struct{} `type:"structure"` + + // The action to perform if none of the Rules contained in the WebACL match. + // + // DefaultAction is a required field + DefaultAction *DefaultAction `type:"structure" required:"true"` + + // A friendly description of the Web ACL. You cannot change the description + // of a Web ACL after you create it. + Description *string `min:"1" type:"string"` + + // The unique identifier for the Web ACL. This ID is returned in the responses + // to create and list commands. You provide it to operations like update and + // delete. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + // + // LockToken is a required field + LockToken *string `min:"1" type:"string" required:"true"` + + // A friendly name of the Web ACL. You cannot change the name of a Web ACL after + // you create it. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The Rule statements used to identify the web requests that you want to allow, + // block, or count. Each rule includes one top-level statement that AWS WAF + // uses to identify matching web requests, and parameters that govern how AWS + // WAF handles them. + Rules []*Rule `type:"list"` + + // Specifies whether this is for an AWS CloudFront distribution or for a regional + // application. A regional application can be an Application Load Balancer (ALB) + // or an API Gateway stage. + // + // To work with CloudFront, you must also specify the Region US East (N. Virginia) + // as follows: + // + // * CLI - Specify the region when you use the CloudFront scope: --scope=CLOUDFRONT + // --region=us-east-1. + // + // * API and SDKs - For all calls, use the Region endpoint us-east-1. + // + // Scope is a required field + Scope *string `type:"string" required:"true" enum:"Scope"` + + // Defines and enables Amazon CloudWatch metrics and web request sample collection. + // + // VisibilityConfig is a required field + VisibilityConfig *VisibilityConfig `type:"structure" 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.DefaultAction == nil { + invalidParams.Add(request.NewErrParamRequired("DefaultAction")) + } + if s.Description != nil && len(*s.Description) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Description", 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.LockToken == nil { + invalidParams.Add(request.NewErrParamRequired("LockToken")) + } + if s.LockToken != nil && len(*s.LockToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("LockToken", 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.Scope == nil { + invalidParams.Add(request.NewErrParamRequired("Scope")) + } + if s.VisibilityConfig == nil { + invalidParams.Add(request.NewErrParamRequired("VisibilityConfig")) + } + 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 s.VisibilityConfig != nil { + if err := s.VisibilityConfig.Validate(); err != nil { + invalidParams.AddNested("VisibilityConfig", err.(request.ErrInvalidParams)) + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDefaultAction sets the DefaultAction field's value. +func (s *UpdateWebACLInput) SetDefaultAction(v *DefaultAction) *UpdateWebACLInput { + s.DefaultAction = v + return s +} + +// SetDescription sets the Description field's value. +func (s *UpdateWebACLInput) SetDescription(v string) *UpdateWebACLInput { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *UpdateWebACLInput) SetId(v string) *UpdateWebACLInput { + s.Id = &v + return s +} + +// SetLockToken sets the LockToken field's value. +func (s *UpdateWebACLInput) SetLockToken(v string) *UpdateWebACLInput { + s.LockToken = &v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateWebACLInput) SetName(v string) *UpdateWebACLInput { + s.Name = &v + return s +} + +// SetRules sets the Rules field's value. +func (s *UpdateWebACLInput) SetRules(v []*Rule) *UpdateWebACLInput { + s.Rules = v + return s +} + +// SetScope sets the Scope field's value. +func (s *UpdateWebACLInput) SetScope(v string) *UpdateWebACLInput { + s.Scope = &v + return s +} + +// SetVisibilityConfig sets the VisibilityConfig field's value. +func (s *UpdateWebACLInput) SetVisibilityConfig(v *VisibilityConfig) *UpdateWebACLInput { + s.VisibilityConfig = v + return s +} + +type UpdateWebACLOutput struct { + _ struct{} `type:"structure"` + + // A token used for optimistic locking. AWS WAF returns this token to your update + // requests. You use NextLockToken in the same manner as you use LockToken. + NextLockToken *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() +} + +// SetNextLockToken sets the NextLockToken field's value. +func (s *UpdateWebACLOutput) SetNextLockToken(v string) *UpdateWebACLOutput { + s.NextLockToken = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// The path component of the URI of a web request. This is the part of a web +// request that identifies a resource, for example, /images/daily-ad.jpg. +// +// This is used only to indicate the web request component for AWS WAF to inspect, +// in the FieldToMatch specification. +type UriPath struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UriPath) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UriPath) GoString() string { + return s.String() +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// Defines and enables Amazon CloudWatch metrics and web request sample collection. +type VisibilityConfig struct { + _ struct{} `type:"structure"` + + // A boolean indicating whether the associated resource sends metrics to CloudWatch. + // For the list of available metrics, see AWS WAF Metrics (https://docs.aws.amazon.com/waf/latest/developerguide/monitoring-cloudwatch.html#waf-metrics). + // + // CloudWatchMetricsEnabled is a required field + CloudWatchMetricsEnabled *bool `type:"boolean" required:"true"` + + // A friendly name of the CloudWatch metric. The name can contain only alphanumeric + // characters (A-Z, a-z, 0-9), with length from one to 128 characters. It can't + // contain whitespace or metric names reserved for AWS WAF, for example "All" + // and "Default_Action." You can't change a MetricName after you create a VisibilityConfig. + // + // MetricName is a required field + MetricName *string `min:"1" type:"string" required:"true"` + + // A boolean indicating whether AWS WAF should store a sampling of the web requests + // that match the rules. You can view the sampled requests through the AWS WAF + // console. + // + // SampledRequestsEnabled is a required field + SampledRequestsEnabled *bool `type:"boolean" required:"true"` +} + +// String returns the string representation +func (s VisibilityConfig) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s VisibilityConfig) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *VisibilityConfig) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "VisibilityConfig"} + if s.CloudWatchMetricsEnabled == nil { + invalidParams.Add(request.NewErrParamRequired("CloudWatchMetricsEnabled")) + } + 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.SampledRequestsEnabled == nil { + invalidParams.Add(request.NewErrParamRequired("SampledRequestsEnabled")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCloudWatchMetricsEnabled sets the CloudWatchMetricsEnabled field's value. +func (s *VisibilityConfig) SetCloudWatchMetricsEnabled(v bool) *VisibilityConfig { + s.CloudWatchMetricsEnabled = &v + return s +} + +// SetMetricName sets the MetricName field's value. +func (s *VisibilityConfig) SetMetricName(v string) *VisibilityConfig { + s.MetricName = &v + return s +} + +// SetSampledRequestsEnabled sets the SampledRequestsEnabled field's value. +func (s *VisibilityConfig) SetSampledRequestsEnabled(v bool) *VisibilityConfig { + s.SampledRequestsEnabled = &v + return s +} + +// AWS WAF couldn’t perform the operation because your resource is being used +// by another resource or it’s associated with another resource. +type WAFAssociatedItemException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s WAFAssociatedItemException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFAssociatedItemException) GoString() string { + return s.String() +} + +func newErrorWAFAssociatedItemException(v protocol.ResponseMetadata) error { + return &WAFAssociatedItemException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFAssociatedItemException) Code() string { + return "WAFAssociatedItemException" +} + +// Message returns the exception's message. +func (s WAFAssociatedItemException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFAssociatedItemException) OrigErr() error { + return nil +} + +func (s WAFAssociatedItemException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFAssociatedItemException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFAssociatedItemException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS WAF couldn’t perform the operation because the resource that you tried +// to save is a duplicate of an existing one. +type WAFDuplicateItemException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s WAFDuplicateItemException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFDuplicateItemException) GoString() string { + return s.String() +} + +func newErrorWAFDuplicateItemException(v protocol.ResponseMetadata) error { + return &WAFDuplicateItemException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFDuplicateItemException) Code() string { + return "WAFDuplicateItemException" +} + +// Message returns the exception's message. +func (s WAFDuplicateItemException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFDuplicateItemException) OrigErr() error { + return nil +} + +func (s WAFDuplicateItemException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFDuplicateItemException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFDuplicateItemException) RequestID() string { + return s.respMetadata.RequestID +} + +// Your request is valid, but AWS WAF couldn’t perform the operation because +// of a system problem. Retry your request. +type WAFInternalErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s WAFInternalErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFInternalErrorException) GoString() string { + return s.String() +} + +func newErrorWAFInternalErrorException(v protocol.ResponseMetadata) error { + return &WAFInternalErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFInternalErrorException) Code() string { + return "WAFInternalErrorException" +} + +// Message returns the exception's message. +func (s WAFInternalErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFInternalErrorException) OrigErr() error { + return nil +} + +func (s WAFInternalErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFInternalErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFInternalErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// The operation failed because AWS WAF didn't recognize a parameter in the +// request. For example: +// +// * You specified an invalid parameter name or value. +// +// * Your nested statement isn't valid. You might have tried to nest a statement +// that can’t be nested. +// +// * You tried to update a WebACL with a DefaultAction that isn't among the +// types available at DefaultAction. +// +// * Your request references an ARN that is malformed, or corresponds to +// a resource with which a Web ACL cannot be associated. +type WAFInvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Field *string `type:"string" enum:"ParameterExceptionField"` + + Message_ *string `locationName:"message" type:"string"` + + Parameter *string `min:"1" type:"string"` + + Reason *string `type:"string"` +} + +// String returns the string representation +func (s WAFInvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFInvalidParameterException) GoString() string { + return s.String() +} + +func newErrorWAFInvalidParameterException(v protocol.ResponseMetadata) error { + return &WAFInvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFInvalidParameterException) Code() string { + return "WAFInvalidParameterException" +} + +// Message returns the exception's message. +func (s WAFInvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFInvalidParameterException) OrigErr() error { + return nil +} + +func (s WAFInvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFInvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFInvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS WAF couldn’t perform the operation because the resource that you requested +// isn’t valid. Check the resource, and try again. +type WAFInvalidResourceException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s WAFInvalidResourceException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFInvalidResourceException) GoString() string { + return s.String() +} + +func newErrorWAFInvalidResourceException(v protocol.ResponseMetadata) error { + return &WAFInvalidResourceException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFInvalidResourceException) Code() string { + return "WAFInvalidResourceException" +} + +// Message returns the exception's message. +func (s WAFInvalidResourceException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFInvalidResourceException) OrigErr() error { + return nil +} + +func (s WAFInvalidResourceException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFInvalidResourceException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFInvalidResourceException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS WAF couldn’t perform the operation because you exceeded your resource +// limit. For example, the maximum number of WebACL objects that you can create +// for an AWS account. For more information, see Limits (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) +// in the AWS WAF Developer Guide. +type WAFLimitsExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s WAFLimitsExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFLimitsExceededException) GoString() string { + return s.String() +} + +func newErrorWAFLimitsExceededException(v protocol.ResponseMetadata) error { + return &WAFLimitsExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFLimitsExceededException) Code() string { + return "WAFLimitsExceededException" +} + +// Message returns the exception's message. +func (s WAFLimitsExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFLimitsExceededException) OrigErr() error { + return nil +} + +func (s WAFLimitsExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFLimitsExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFLimitsExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS WAF couldn’t perform the operation because your resource doesn’t +// exist. +type WAFNonexistentItemException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s WAFNonexistentItemException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFNonexistentItemException) GoString() string { + return s.String() +} + +func newErrorWAFNonexistentItemException(v protocol.ResponseMetadata) error { + return &WAFNonexistentItemException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFNonexistentItemException) Code() string { + return "WAFNonexistentItemException" +} + +// Message returns the exception's message. +func (s WAFNonexistentItemException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFNonexistentItemException) OrigErr() error { + return nil +} + +func (s WAFNonexistentItemException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFNonexistentItemException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFNonexistentItemException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS WAF couldn’t save your changes because you tried to update or delete +// a resource that has changed since you last retrieved it. Get the resource +// again, make any changes you need to make to the new copy, and retry your +// operation. +type WAFOptimisticLockException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s WAFOptimisticLockException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFOptimisticLockException) GoString() string { + return s.String() +} + +func newErrorWAFOptimisticLockException(v protocol.ResponseMetadata) error { + return &WAFOptimisticLockException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFOptimisticLockException) Code() string { + return "WAFOptimisticLockException" +} + +// Message returns the exception's message. +func (s WAFOptimisticLockException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFOptimisticLockException) OrigErr() error { + return nil +} + +func (s WAFOptimisticLockException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFOptimisticLockException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFOptimisticLockException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS WAF is not able to access the service linked role. This can be caused +// by a previous PutLoggingConfiguration request, which can lock the service +// linked role for about 20 seconds. Please try your request again. The service +// linked role can also be locked by a previous DeleteServiceLinkedRole request, +// which can lock the role for 15 minutes or more. If you recently made a call +// to DeleteServiceLinkedRole, wait at least 15 minutes and try the request +// again. If you receive this same exception again, you will have to wait additional +// time until the role is unlocked. +type WAFServiceLinkedRoleErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WAFServiceLinkedRoleErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFServiceLinkedRoleErrorException) GoString() string { + return s.String() +} + +func newErrorWAFServiceLinkedRoleErrorException(v protocol.ResponseMetadata) error { + return &WAFServiceLinkedRoleErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFServiceLinkedRoleErrorException) Code() string { + return "WAFServiceLinkedRoleErrorException" +} + +// Message returns the exception's message. +func (s WAFServiceLinkedRoleErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFServiceLinkedRoleErrorException) OrigErr() error { + return nil +} + +func (s WAFServiceLinkedRoleErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFServiceLinkedRoleErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFServiceLinkedRoleErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +type WAFSubscriptionNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s WAFSubscriptionNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFSubscriptionNotFoundException) GoString() string { + return s.String() +} + +func newErrorWAFSubscriptionNotFoundException(v protocol.ResponseMetadata) error { + return &WAFSubscriptionNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFSubscriptionNotFoundException) Code() string { + return "WAFSubscriptionNotFoundException" +} + +// Message returns the exception's message. +func (s WAFSubscriptionNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFSubscriptionNotFoundException) OrigErr() error { + return nil +} + +func (s WAFSubscriptionNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFSubscriptionNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFSubscriptionNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// An error occurred during the tagging operation. Retry your request. +type WAFTagOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s WAFTagOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFTagOperationException) GoString() string { + return s.String() +} + +func newErrorWAFTagOperationException(v protocol.ResponseMetadata) error { + return &WAFTagOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFTagOperationException) Code() string { + return "WAFTagOperationException" +} + +// Message returns the exception's message. +func (s WAFTagOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFTagOperationException) OrigErr() error { + return nil +} + +func (s WAFTagOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFTagOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFTagOperationException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS WAF couldn’t perform your tagging operation because of an internal +// error. Retry your request. +type WAFTagOperationInternalErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s WAFTagOperationInternalErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFTagOperationInternalErrorException) GoString() string { + return s.String() +} + +func newErrorWAFTagOperationInternalErrorException(v protocol.ResponseMetadata) error { + return &WAFTagOperationInternalErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFTagOperationInternalErrorException) Code() string { + return "WAFTagOperationInternalErrorException" +} + +// Message returns the exception's message. +func (s WAFTagOperationInternalErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFTagOperationInternalErrorException) OrigErr() error { + return nil +} + +func (s WAFTagOperationInternalErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFTagOperationInternalErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFTagOperationInternalErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// AWS WAF couldn’t retrieve the resource that you requested. Retry your request. +type WAFUnavailableEntityException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s WAFUnavailableEntityException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WAFUnavailableEntityException) GoString() string { + return s.String() +} + +func newErrorWAFUnavailableEntityException(v protocol.ResponseMetadata) error { + return &WAFUnavailableEntityException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WAFUnavailableEntityException) Code() string { + return "WAFUnavailableEntityException" +} + +// Message returns the exception's message. +func (s WAFUnavailableEntityException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WAFUnavailableEntityException) OrigErr() error { + return nil +} + +func (s WAFUnavailableEntityException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WAFUnavailableEntityException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WAFUnavailableEntityException) RequestID() string { + return s.respMetadata.RequestID +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A Web ACL defines a collection of rules to use to inspect and control web +// requests. Each rule has an action defined (allow, block, or count) for requests +// that match the statement of the rule. In the Web ACL, you assign a default +// action to take (allow, block) for any request that does not match any of +// the rules. The rules in a Web ACL can be a combination of the types Rule, +// RuleGroup, and managed rule group. You can associate a Web ACL with one or +// more AWS resources to protect. The resources can be Amazon CloudFront, an +// Amazon API Gateway API, or an Application Load Balancer. +type WebACL struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the Web ACL that you want to associate + // with the resource. + // + // ARN is a required field + ARN *string `min:"20" type:"string" required:"true"` + + // The web ACL capacity units (WCUs) currently being used by this web ACL. + // + // AWS WAF uses WCUs to calculate and control the operating resources that are + // used to run your rules, rule groups, and web ACLs. AWS WAF calculates capacity + // differently for each rule type, to reflect the relative cost of each rule. + // Simple rules that cost little to run use fewer WCUs than more complex rules + // that use more processing power. Rule group capacity is fixed at creation, + // which helps users plan their web ACL WCU usage when they use a rule group. + // The WCU limit for web ACLs is 1,500. + Capacity *int64 `type:"long"` + + // The action to perform if none of the Rules contained in the WebACL match. + // + // DefaultAction is a required field + DefaultAction *DefaultAction `type:"structure" required:"true"` + + // A friendly description of the Web ACL. You cannot change the description + // of a Web ACL after you create it. + Description *string `min:"1" type:"string"` + + // A unique identifier for the WebACL. This ID is returned in the responses + // to create and list commands. You use this ID to do things like get, update, + // and delete a WebACL. + // + // Id is a required field + Id *string `min:"1" type:"string" required:"true"` + + // A friendly name of the Web ACL. You cannot change the name of a Web ACL after + // you create it. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The Rule statements used to identify the web requests that you want to allow, + // block, or count. Each rule includes one top-level statement that AWS WAF + // uses to identify matching web requests, and parameters that govern how AWS + // WAF handles them. + Rules []*Rule `type:"list"` + + // Defines and enables Amazon CloudWatch metrics and web request sample collection. + // + // VisibilityConfig is a required field + VisibilityConfig *VisibilityConfig `type:"structure" 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() +} + +// SetARN sets the ARN field's value. +func (s *WebACL) SetARN(v string) *WebACL { + s.ARN = &v + return s +} + +// SetCapacity sets the Capacity field's value. +func (s *WebACL) SetCapacity(v int64) *WebACL { + s.Capacity = &v + return s +} + +// SetDefaultAction sets the DefaultAction field's value. +func (s *WebACL) SetDefaultAction(v *DefaultAction) *WebACL { + s.DefaultAction = v + return s +} + +// SetDescription sets the Description field's value. +func (s *WebACL) SetDescription(v string) *WebACL { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *WebACL) SetId(v string) *WebACL { + s.Id = &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 []*Rule) *WebACL { + s.Rules = v + return s +} + +// SetVisibilityConfig sets the VisibilityConfig field's value. +func (s *WebACL) SetVisibilityConfig(v *VisibilityConfig) *WebACL { + s.VisibilityConfig = v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// High-level information about a WebACL, returned by operations like create +// and list. This provides information like the ID, that you can use to retrieve +// and manage a WebACL, and the ARN, that you provide to operations like AssociateWebACL. +type WebACLSummary struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the entity. + ARN *string `min:"20" type:"string"` + + // A friendly description of the Web ACL. You cannot change the description + // of a Web ACL after you create it. + Description *string `min:"1" type:"string"` + + // The unique identifier for the Web ACL. This ID is returned in the responses + // to create and list commands. You provide it to operations like update and + // delete. + Id *string `min:"1" type:"string"` + + // A token used for optimistic locking. AWS WAF returns a token to your get + // and list requests, to mark the state of the entity at the time of the request. + // To make changes to the entity associated with the token, you provide the + // token to operations like update and delete. AWS WAF uses the token to ensure + // that no changes have been made to the entity since you last retrieved it. + // If a change has been made, the update fails with a WAFOptimisticLockException. + // If this happens, perform another get, and use the new token returned by that + // operation. + LockToken *string `min:"1" type:"string"` + + // A friendly name of the Web ACL. You cannot change the name of a Web ACL after + // you create it. + Name *string `min:"1" type:"string"` +} + +// 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() +} + +// SetARN sets the ARN field's value. +func (s *WebACLSummary) SetARN(v string) *WebACLSummary { + s.ARN = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *WebACLSummary) SetDescription(v string) *WebACLSummary { + s.Description = &v + return s +} + +// SetId sets the Id field's value. +func (s *WebACLSummary) SetId(v string) *WebACLSummary { + s.Id = &v + return s +} + +// SetLockToken sets the LockToken field's value. +func (s *WebACLSummary) SetLockToken(v string) *WebACLSummary { + s.LockToken = &v + return s +} + +// SetName sets the Name field's value. +func (s *WebACLSummary) SetName(v string) *WebACLSummary { + s.Name = &v + return s +} + +// +// This is the latest version of AWS WAF, named AWS WAFV2, released in November, +// 2019. For information, including how to migrate your AWS WAF resources from +// the prior release, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// A rule statement that defines a cross-site scripting (XSS) match search for +// AWS WAF to apply to web requests. XSS attacks are those where the attacker +// uses vulnerabilities in a benign website as a vehicle to inject malicious +// client-site scripts into other legitimate web browsers. The XSS match statement +// provides the location in requests that you want AWS WAF to search and text +// transformations to use on the search area before AWS WAF searches for character +// sequences that are likely to be malicious strings. +type XssMatchStatement struct { + _ struct{} `type:"structure"` + + // The part of a web request that you want AWS WAF to inspect. For more information, + // see FieldToMatch. + // + // 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 detection. If you specify one + // or more transformations in a rule statement, AWS WAF performs all transformations + // on the content identified by FieldToMatch, starting from the lowest priority + // setting, before inspecting the content for a match. + // + // TextTransformations is a required field + TextTransformations []*TextTransformation `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s XssMatchStatement) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s XssMatchStatement) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *XssMatchStatement) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "XssMatchStatement"} + if s.FieldToMatch == nil { + invalidParams.Add(request.NewErrParamRequired("FieldToMatch")) + } + if s.TextTransformations == nil { + invalidParams.Add(request.NewErrParamRequired("TextTransformations")) + } + if s.TextTransformations != nil && len(s.TextTransformations) < 1 { + invalidParams.Add(request.NewErrParamMinLen("TextTransformations", 1)) + } + if s.FieldToMatch != nil { + if err := s.FieldToMatch.Validate(); err != nil { + invalidParams.AddNested("FieldToMatch", err.(request.ErrInvalidParams)) + } + } + if s.TextTransformations != nil { + for i, v := range s.TextTransformations { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TextTransformations", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetFieldToMatch sets the FieldToMatch field's value. +func (s *XssMatchStatement) SetFieldToMatch(v *FieldToMatch) *XssMatchStatement { + s.FieldToMatch = v + return s +} + +// SetTextTransformations sets the TextTransformations field's value. +func (s *XssMatchStatement) SetTextTransformations(v []*TextTransformation) *XssMatchStatement { + s.TextTransformations = v + return s +} + +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 ( + // CountryCodeAf is a CountryCode enum value + CountryCodeAf = "AF" + + // CountryCodeAx is a CountryCode enum value + CountryCodeAx = "AX" + + // CountryCodeAl is a CountryCode enum value + CountryCodeAl = "AL" + + // CountryCodeDz is a CountryCode enum value + CountryCodeDz = "DZ" + + // CountryCodeAs is a CountryCode enum value + CountryCodeAs = "AS" + + // CountryCodeAd is a CountryCode enum value + CountryCodeAd = "AD" + + // CountryCodeAo is a CountryCode enum value + CountryCodeAo = "AO" + + // CountryCodeAi is a CountryCode enum value + CountryCodeAi = "AI" + + // CountryCodeAq is a CountryCode enum value + CountryCodeAq = "AQ" + + // CountryCodeAg is a CountryCode enum value + CountryCodeAg = "AG" + + // CountryCodeAr is a CountryCode enum value + CountryCodeAr = "AR" + + // CountryCodeAm is a CountryCode enum value + CountryCodeAm = "AM" + + // CountryCodeAw is a CountryCode enum value + CountryCodeAw = "AW" + + // CountryCodeAu is a CountryCode enum value + CountryCodeAu = "AU" + + // CountryCodeAt is a CountryCode enum value + CountryCodeAt = "AT" + + // CountryCodeAz is a CountryCode enum value + CountryCodeAz = "AZ" + + // CountryCodeBs is a CountryCode enum value + CountryCodeBs = "BS" + + // CountryCodeBh is a CountryCode enum value + CountryCodeBh = "BH" + + // CountryCodeBd is a CountryCode enum value + CountryCodeBd = "BD" + + // CountryCodeBb is a CountryCode enum value + CountryCodeBb = "BB" + + // CountryCodeBy is a CountryCode enum value + CountryCodeBy = "BY" + + // CountryCodeBe is a CountryCode enum value + CountryCodeBe = "BE" + + // CountryCodeBz is a CountryCode enum value + CountryCodeBz = "BZ" + + // CountryCodeBj is a CountryCode enum value + CountryCodeBj = "BJ" + + // CountryCodeBm is a CountryCode enum value + CountryCodeBm = "BM" + + // CountryCodeBt is a CountryCode enum value + CountryCodeBt = "BT" + + // CountryCodeBo is a CountryCode enum value + CountryCodeBo = "BO" + + // CountryCodeBq is a CountryCode enum value + CountryCodeBq = "BQ" + + // CountryCodeBa is a CountryCode enum value + CountryCodeBa = "BA" + + // CountryCodeBw is a CountryCode enum value + CountryCodeBw = "BW" + + // CountryCodeBv is a CountryCode enum value + CountryCodeBv = "BV" + + // CountryCodeBr is a CountryCode enum value + CountryCodeBr = "BR" + + // CountryCodeIo is a CountryCode enum value + CountryCodeIo = "IO" + + // CountryCodeBn is a CountryCode enum value + CountryCodeBn = "BN" + + // CountryCodeBg is a CountryCode enum value + CountryCodeBg = "BG" + + // CountryCodeBf is a CountryCode enum value + CountryCodeBf = "BF" + + // CountryCodeBi is a CountryCode enum value + CountryCodeBi = "BI" + + // CountryCodeKh is a CountryCode enum value + CountryCodeKh = "KH" + + // CountryCodeCm is a CountryCode enum value + CountryCodeCm = "CM" + + // CountryCodeCa is a CountryCode enum value + CountryCodeCa = "CA" + + // CountryCodeCv is a CountryCode enum value + CountryCodeCv = "CV" + + // CountryCodeKy is a CountryCode enum value + CountryCodeKy = "KY" + + // CountryCodeCf is a CountryCode enum value + CountryCodeCf = "CF" + + // CountryCodeTd is a CountryCode enum value + CountryCodeTd = "TD" + + // CountryCodeCl is a CountryCode enum value + CountryCodeCl = "CL" + + // CountryCodeCn is a CountryCode enum value + CountryCodeCn = "CN" + + // CountryCodeCx is a CountryCode enum value + CountryCodeCx = "CX" + + // CountryCodeCc is a CountryCode enum value + CountryCodeCc = "CC" + + // CountryCodeCo is a CountryCode enum value + CountryCodeCo = "CO" + + // CountryCodeKm is a CountryCode enum value + CountryCodeKm = "KM" + + // CountryCodeCg is a CountryCode enum value + CountryCodeCg = "CG" + + // CountryCodeCd is a CountryCode enum value + CountryCodeCd = "CD" + + // CountryCodeCk is a CountryCode enum value + CountryCodeCk = "CK" + + // CountryCodeCr is a CountryCode enum value + CountryCodeCr = "CR" + + // CountryCodeCi is a CountryCode enum value + CountryCodeCi = "CI" + + // CountryCodeHr is a CountryCode enum value + CountryCodeHr = "HR" + + // CountryCodeCu is a CountryCode enum value + CountryCodeCu = "CU" + + // CountryCodeCw is a CountryCode enum value + CountryCodeCw = "CW" + + // CountryCodeCy is a CountryCode enum value + CountryCodeCy = "CY" + + // CountryCodeCz is a CountryCode enum value + CountryCodeCz = "CZ" + + // CountryCodeDk is a CountryCode enum value + CountryCodeDk = "DK" + + // CountryCodeDj is a CountryCode enum value + CountryCodeDj = "DJ" + + // CountryCodeDm is a CountryCode enum value + CountryCodeDm = "DM" + + // CountryCodeDo is a CountryCode enum value + CountryCodeDo = "DO" + + // CountryCodeEc is a CountryCode enum value + CountryCodeEc = "EC" + + // CountryCodeEg is a CountryCode enum value + CountryCodeEg = "EG" + + // CountryCodeSv is a CountryCode enum value + CountryCodeSv = "SV" + + // CountryCodeGq is a CountryCode enum value + CountryCodeGq = "GQ" + + // CountryCodeEr is a CountryCode enum value + CountryCodeEr = "ER" + + // CountryCodeEe is a CountryCode enum value + CountryCodeEe = "EE" + + // CountryCodeEt is a CountryCode enum value + CountryCodeEt = "ET" + + // CountryCodeFk is a CountryCode enum value + CountryCodeFk = "FK" + + // CountryCodeFo is a CountryCode enum value + CountryCodeFo = "FO" + + // CountryCodeFj is a CountryCode enum value + CountryCodeFj = "FJ" + + // CountryCodeFi is a CountryCode enum value + CountryCodeFi = "FI" + + // CountryCodeFr is a CountryCode enum value + CountryCodeFr = "FR" + + // CountryCodeGf is a CountryCode enum value + CountryCodeGf = "GF" + + // CountryCodePf is a CountryCode enum value + CountryCodePf = "PF" + + // CountryCodeTf is a CountryCode enum value + CountryCodeTf = "TF" + + // CountryCodeGa is a CountryCode enum value + CountryCodeGa = "GA" + + // CountryCodeGm is a CountryCode enum value + CountryCodeGm = "GM" + + // CountryCodeGe is a CountryCode enum value + CountryCodeGe = "GE" + + // CountryCodeDe is a CountryCode enum value + CountryCodeDe = "DE" + + // CountryCodeGh is a CountryCode enum value + CountryCodeGh = "GH" + + // CountryCodeGi is a CountryCode enum value + CountryCodeGi = "GI" + + // CountryCodeGr is a CountryCode enum value + CountryCodeGr = "GR" + + // CountryCodeGl is a CountryCode enum value + CountryCodeGl = "GL" + + // CountryCodeGd is a CountryCode enum value + CountryCodeGd = "GD" + + // CountryCodeGp is a CountryCode enum value + CountryCodeGp = "GP" + + // CountryCodeGu is a CountryCode enum value + CountryCodeGu = "GU" + + // CountryCodeGt is a CountryCode enum value + CountryCodeGt = "GT" + + // CountryCodeGg is a CountryCode enum value + CountryCodeGg = "GG" + + // CountryCodeGn is a CountryCode enum value + CountryCodeGn = "GN" + + // CountryCodeGw is a CountryCode enum value + CountryCodeGw = "GW" + + // CountryCodeGy is a CountryCode enum value + CountryCodeGy = "GY" + + // CountryCodeHt is a CountryCode enum value + CountryCodeHt = "HT" + + // CountryCodeHm is a CountryCode enum value + CountryCodeHm = "HM" + + // CountryCodeVa is a CountryCode enum value + CountryCodeVa = "VA" + + // CountryCodeHn is a CountryCode enum value + CountryCodeHn = "HN" + + // CountryCodeHk is a CountryCode enum value + CountryCodeHk = "HK" + + // CountryCodeHu is a CountryCode enum value + CountryCodeHu = "HU" + + // CountryCodeIs is a CountryCode enum value + CountryCodeIs = "IS" + + // CountryCodeIn is a CountryCode enum value + CountryCodeIn = "IN" + + // CountryCodeId is a CountryCode enum value + CountryCodeId = "ID" + + // CountryCodeIr is a CountryCode enum value + CountryCodeIr = "IR" + + // CountryCodeIq is a CountryCode enum value + CountryCodeIq = "IQ" + + // CountryCodeIe is a CountryCode enum value + CountryCodeIe = "IE" + + // CountryCodeIm is a CountryCode enum value + CountryCodeIm = "IM" + + // CountryCodeIl is a CountryCode enum value + CountryCodeIl = "IL" + + // CountryCodeIt is a CountryCode enum value + CountryCodeIt = "IT" + + // CountryCodeJm is a CountryCode enum value + CountryCodeJm = "JM" + + // CountryCodeJp is a CountryCode enum value + CountryCodeJp = "JP" + + // CountryCodeJe is a CountryCode enum value + CountryCodeJe = "JE" + + // CountryCodeJo is a CountryCode enum value + CountryCodeJo = "JO" + + // CountryCodeKz is a CountryCode enum value + CountryCodeKz = "KZ" + + // CountryCodeKe is a CountryCode enum value + CountryCodeKe = "KE" + + // CountryCodeKi is a CountryCode enum value + CountryCodeKi = "KI" + + // CountryCodeKp is a CountryCode enum value + CountryCodeKp = "KP" + + // CountryCodeKr is a CountryCode enum value + CountryCodeKr = "KR" + + // CountryCodeKw is a CountryCode enum value + CountryCodeKw = "KW" + + // CountryCodeKg is a CountryCode enum value + CountryCodeKg = "KG" + + // CountryCodeLa is a CountryCode enum value + CountryCodeLa = "LA" + + // CountryCodeLv is a CountryCode enum value + CountryCodeLv = "LV" + + // CountryCodeLb is a CountryCode enum value + CountryCodeLb = "LB" + + // CountryCodeLs is a CountryCode enum value + CountryCodeLs = "LS" + + // CountryCodeLr is a CountryCode enum value + CountryCodeLr = "LR" + + // CountryCodeLy is a CountryCode enum value + CountryCodeLy = "LY" + + // CountryCodeLi is a CountryCode enum value + CountryCodeLi = "LI" + + // CountryCodeLt is a CountryCode enum value + CountryCodeLt = "LT" + + // CountryCodeLu is a CountryCode enum value + CountryCodeLu = "LU" + + // CountryCodeMo is a CountryCode enum value + CountryCodeMo = "MO" + + // CountryCodeMk is a CountryCode enum value + CountryCodeMk = "MK" + + // CountryCodeMg is a CountryCode enum value + CountryCodeMg = "MG" + + // CountryCodeMw is a CountryCode enum value + CountryCodeMw = "MW" + + // CountryCodeMy is a CountryCode enum value + CountryCodeMy = "MY" + + // CountryCodeMv is a CountryCode enum value + CountryCodeMv = "MV" + + // CountryCodeMl is a CountryCode enum value + CountryCodeMl = "ML" + + // CountryCodeMt is a CountryCode enum value + CountryCodeMt = "MT" + + // CountryCodeMh is a CountryCode enum value + CountryCodeMh = "MH" + + // CountryCodeMq is a CountryCode enum value + CountryCodeMq = "MQ" + + // CountryCodeMr is a CountryCode enum value + CountryCodeMr = "MR" + + // CountryCodeMu is a CountryCode enum value + CountryCodeMu = "MU" + + // CountryCodeYt is a CountryCode enum value + CountryCodeYt = "YT" + + // CountryCodeMx is a CountryCode enum value + CountryCodeMx = "MX" + + // CountryCodeFm is a CountryCode enum value + CountryCodeFm = "FM" + + // CountryCodeMd is a CountryCode enum value + CountryCodeMd = "MD" + + // CountryCodeMc is a CountryCode enum value + CountryCodeMc = "MC" + + // CountryCodeMn is a CountryCode enum value + CountryCodeMn = "MN" + + // CountryCodeMe is a CountryCode enum value + CountryCodeMe = "ME" + + // CountryCodeMs is a CountryCode enum value + CountryCodeMs = "MS" + + // CountryCodeMa is a CountryCode enum value + CountryCodeMa = "MA" + + // CountryCodeMz is a CountryCode enum value + CountryCodeMz = "MZ" + + // CountryCodeMm is a CountryCode enum value + CountryCodeMm = "MM" + + // CountryCodeNa is a CountryCode enum value + CountryCodeNa = "NA" + + // CountryCodeNr is a CountryCode enum value + CountryCodeNr = "NR" + + // CountryCodeNp is a CountryCode enum value + CountryCodeNp = "NP" + + // CountryCodeNl is a CountryCode enum value + CountryCodeNl = "NL" + + // CountryCodeNc is a CountryCode enum value + CountryCodeNc = "NC" + + // CountryCodeNz is a CountryCode enum value + CountryCodeNz = "NZ" + + // CountryCodeNi is a CountryCode enum value + CountryCodeNi = "NI" + + // CountryCodeNe is a CountryCode enum value + CountryCodeNe = "NE" + + // CountryCodeNg is a CountryCode enum value + CountryCodeNg = "NG" + + // CountryCodeNu is a CountryCode enum value + CountryCodeNu = "NU" + + // CountryCodeNf is a CountryCode enum value + CountryCodeNf = "NF" + + // CountryCodeMp is a CountryCode enum value + CountryCodeMp = "MP" + + // CountryCodeNo is a CountryCode enum value + CountryCodeNo = "NO" + + // CountryCodeOm is a CountryCode enum value + CountryCodeOm = "OM" + + // CountryCodePk is a CountryCode enum value + CountryCodePk = "PK" + + // CountryCodePw is a CountryCode enum value + CountryCodePw = "PW" + + // CountryCodePs is a CountryCode enum value + CountryCodePs = "PS" + + // CountryCodePa is a CountryCode enum value + CountryCodePa = "PA" + + // CountryCodePg is a CountryCode enum value + CountryCodePg = "PG" + + // CountryCodePy is a CountryCode enum value + CountryCodePy = "PY" + + // CountryCodePe is a CountryCode enum value + CountryCodePe = "PE" + + // CountryCodePh is a CountryCode enum value + CountryCodePh = "PH" + + // CountryCodePn is a CountryCode enum value + CountryCodePn = "PN" + + // CountryCodePl is a CountryCode enum value + CountryCodePl = "PL" + + // CountryCodePt is a CountryCode enum value + CountryCodePt = "PT" + + // CountryCodePr is a CountryCode enum value + CountryCodePr = "PR" + + // CountryCodeQa is a CountryCode enum value + CountryCodeQa = "QA" + + // CountryCodeRe is a CountryCode enum value + CountryCodeRe = "RE" + + // CountryCodeRo is a CountryCode enum value + CountryCodeRo = "RO" + + // CountryCodeRu is a CountryCode enum value + CountryCodeRu = "RU" + + // CountryCodeRw is a CountryCode enum value + CountryCodeRw = "RW" + + // CountryCodeBl is a CountryCode enum value + CountryCodeBl = "BL" + + // CountryCodeSh is a CountryCode enum value + CountryCodeSh = "SH" + + // CountryCodeKn is a CountryCode enum value + CountryCodeKn = "KN" + + // CountryCodeLc is a CountryCode enum value + CountryCodeLc = "LC" + + // CountryCodeMf is a CountryCode enum value + CountryCodeMf = "MF" + + // CountryCodePm is a CountryCode enum value + CountryCodePm = "PM" + + // CountryCodeVc is a CountryCode enum value + CountryCodeVc = "VC" + + // CountryCodeWs is a CountryCode enum value + CountryCodeWs = "WS" + + // CountryCodeSm is a CountryCode enum value + CountryCodeSm = "SM" + + // CountryCodeSt is a CountryCode enum value + CountryCodeSt = "ST" + + // CountryCodeSa is a CountryCode enum value + CountryCodeSa = "SA" + + // CountryCodeSn is a CountryCode enum value + CountryCodeSn = "SN" + + // CountryCodeRs is a CountryCode enum value + CountryCodeRs = "RS" + + // CountryCodeSc is a CountryCode enum value + CountryCodeSc = "SC" + + // CountryCodeSl is a CountryCode enum value + CountryCodeSl = "SL" + + // CountryCodeSg is a CountryCode enum value + CountryCodeSg = "SG" + + // CountryCodeSx is a CountryCode enum value + CountryCodeSx = "SX" + + // CountryCodeSk is a CountryCode enum value + CountryCodeSk = "SK" + + // CountryCodeSi is a CountryCode enum value + CountryCodeSi = "SI" + + // CountryCodeSb is a CountryCode enum value + CountryCodeSb = "SB" + + // CountryCodeSo is a CountryCode enum value + CountryCodeSo = "SO" + + // CountryCodeZa is a CountryCode enum value + CountryCodeZa = "ZA" + + // CountryCodeGs is a CountryCode enum value + CountryCodeGs = "GS" + + // CountryCodeSs is a CountryCode enum value + CountryCodeSs = "SS" + + // CountryCodeEs is a CountryCode enum value + CountryCodeEs = "ES" + + // CountryCodeLk is a CountryCode enum value + CountryCodeLk = "LK" + + // CountryCodeSd is a CountryCode enum value + CountryCodeSd = "SD" + + // CountryCodeSr is a CountryCode enum value + CountryCodeSr = "SR" + + // CountryCodeSj is a CountryCode enum value + CountryCodeSj = "SJ" + + // CountryCodeSz is a CountryCode enum value + CountryCodeSz = "SZ" + + // CountryCodeSe is a CountryCode enum value + CountryCodeSe = "SE" + + // CountryCodeCh is a CountryCode enum value + CountryCodeCh = "CH" + + // CountryCodeSy is a CountryCode enum value + CountryCodeSy = "SY" + + // CountryCodeTw is a CountryCode enum value + CountryCodeTw = "TW" + + // CountryCodeTj is a CountryCode enum value + CountryCodeTj = "TJ" + + // CountryCodeTz is a CountryCode enum value + CountryCodeTz = "TZ" + + // CountryCodeTh is a CountryCode enum value + CountryCodeTh = "TH" + + // CountryCodeTl is a CountryCode enum value + CountryCodeTl = "TL" + + // CountryCodeTg is a CountryCode enum value + CountryCodeTg = "TG" + + // CountryCodeTk is a CountryCode enum value + CountryCodeTk = "TK" + + // CountryCodeTo is a CountryCode enum value + CountryCodeTo = "TO" + + // CountryCodeTt is a CountryCode enum value + CountryCodeTt = "TT" + + // CountryCodeTn is a CountryCode enum value + CountryCodeTn = "TN" + + // CountryCodeTr is a CountryCode enum value + CountryCodeTr = "TR" + + // CountryCodeTm is a CountryCode enum value + CountryCodeTm = "TM" + + // CountryCodeTc is a CountryCode enum value + CountryCodeTc = "TC" + + // CountryCodeTv is a CountryCode enum value + CountryCodeTv = "TV" + + // CountryCodeUg is a CountryCode enum value + CountryCodeUg = "UG" + + // CountryCodeUa is a CountryCode enum value + CountryCodeUa = "UA" + + // CountryCodeAe is a CountryCode enum value + CountryCodeAe = "AE" + + // CountryCodeGb is a CountryCode enum value + CountryCodeGb = "GB" + + // CountryCodeUs is a CountryCode enum value + CountryCodeUs = "US" + + // CountryCodeUm is a CountryCode enum value + CountryCodeUm = "UM" + + // CountryCodeUy is a CountryCode enum value + CountryCodeUy = "UY" + + // CountryCodeUz is a CountryCode enum value + CountryCodeUz = "UZ" + + // CountryCodeVu is a CountryCode enum value + CountryCodeVu = "VU" + + // CountryCodeVe is a CountryCode enum value + CountryCodeVe = "VE" + + // CountryCodeVn is a CountryCode enum value + CountryCodeVn = "VN" + + // CountryCodeVg is a CountryCode enum value + CountryCodeVg = "VG" + + // CountryCodeVi is a CountryCode enum value + CountryCodeVi = "VI" + + // CountryCodeWf is a CountryCode enum value + CountryCodeWf = "WF" + + // CountryCodeEh is a CountryCode enum value + CountryCodeEh = "EH" + + // CountryCodeYe is a CountryCode enum value + CountryCodeYe = "YE" + + // CountryCodeZm is a CountryCode enum value + CountryCodeZm = "ZM" + + // CountryCodeZw is a CountryCode enum value + CountryCodeZw = "ZW" +) + +const ( + // IPAddressVersionIpv4 is a IPAddressVersion enum value + IPAddressVersionIpv4 = "IPV4" + + // IPAddressVersionIpv6 is a IPAddressVersion enum value + IPAddressVersionIpv6 = "IPV6" +) + +const ( + // ParameterExceptionFieldWebAcl is a ParameterExceptionField enum value + ParameterExceptionFieldWebAcl = "WEB_ACL" + + // ParameterExceptionFieldRuleGroup is a ParameterExceptionField enum value + ParameterExceptionFieldRuleGroup = "RULE_GROUP" + + // ParameterExceptionFieldRegexPatternSet is a ParameterExceptionField enum value + ParameterExceptionFieldRegexPatternSet = "REGEX_PATTERN_SET" + + // ParameterExceptionFieldIpSet is a ParameterExceptionField enum value + ParameterExceptionFieldIpSet = "IP_SET" + + // ParameterExceptionFieldManagedRuleSet is a ParameterExceptionField enum value + ParameterExceptionFieldManagedRuleSet = "MANAGED_RULE_SET" + + // ParameterExceptionFieldRule is a ParameterExceptionField enum value + ParameterExceptionFieldRule = "RULE" + + // ParameterExceptionFieldExcludedRule is a ParameterExceptionField enum value + ParameterExceptionFieldExcludedRule = "EXCLUDED_RULE" + + // ParameterExceptionFieldStatement is a ParameterExceptionField enum value + ParameterExceptionFieldStatement = "STATEMENT" + + // ParameterExceptionFieldByteMatchStatement is a ParameterExceptionField enum value + ParameterExceptionFieldByteMatchStatement = "BYTE_MATCH_STATEMENT" + + // ParameterExceptionFieldSqliMatchStatement is a ParameterExceptionField enum value + ParameterExceptionFieldSqliMatchStatement = "SQLI_MATCH_STATEMENT" + + // ParameterExceptionFieldXssMatchStatement is a ParameterExceptionField enum value + ParameterExceptionFieldXssMatchStatement = "XSS_MATCH_STATEMENT" + + // ParameterExceptionFieldSizeConstraintStatement is a ParameterExceptionField enum value + ParameterExceptionFieldSizeConstraintStatement = "SIZE_CONSTRAINT_STATEMENT" + + // ParameterExceptionFieldGeoMatchStatement is a ParameterExceptionField enum value + ParameterExceptionFieldGeoMatchStatement = "GEO_MATCH_STATEMENT" + + // ParameterExceptionFieldRateBasedStatement is a ParameterExceptionField enum value + ParameterExceptionFieldRateBasedStatement = "RATE_BASED_STATEMENT" + + // ParameterExceptionFieldRuleGroupReferenceStatement is a ParameterExceptionField enum value + ParameterExceptionFieldRuleGroupReferenceStatement = "RULE_GROUP_REFERENCE_STATEMENT" + + // ParameterExceptionFieldRegexPatternReferenceStatement is a ParameterExceptionField enum value + ParameterExceptionFieldRegexPatternReferenceStatement = "REGEX_PATTERN_REFERENCE_STATEMENT" + + // ParameterExceptionFieldIpSetReferenceStatement is a ParameterExceptionField enum value + ParameterExceptionFieldIpSetReferenceStatement = "IP_SET_REFERENCE_STATEMENT" + + // ParameterExceptionFieldManagedRuleSetStatement is a ParameterExceptionField enum value + ParameterExceptionFieldManagedRuleSetStatement = "MANAGED_RULE_SET_STATEMENT" + + // ParameterExceptionFieldAndStatement is a ParameterExceptionField enum value + ParameterExceptionFieldAndStatement = "AND_STATEMENT" + + // ParameterExceptionFieldOrStatement is a ParameterExceptionField enum value + ParameterExceptionFieldOrStatement = "OR_STATEMENT" + + // ParameterExceptionFieldNotStatement is a ParameterExceptionField enum value + ParameterExceptionFieldNotStatement = "NOT_STATEMENT" + + // ParameterExceptionFieldIpAddress is a ParameterExceptionField enum value + ParameterExceptionFieldIpAddress = "IP_ADDRESS" + + // ParameterExceptionFieldIpAddressVersion is a ParameterExceptionField enum value + ParameterExceptionFieldIpAddressVersion = "IP_ADDRESS_VERSION" + + // ParameterExceptionFieldFieldToMatch is a ParameterExceptionField enum value + ParameterExceptionFieldFieldToMatch = "FIELD_TO_MATCH" + + // ParameterExceptionFieldTextTransformation is a ParameterExceptionField enum value + ParameterExceptionFieldTextTransformation = "TEXT_TRANSFORMATION" + + // ParameterExceptionFieldSingleQueryArgument is a ParameterExceptionField enum value + ParameterExceptionFieldSingleQueryArgument = "SINGLE_QUERY_ARGUMENT" + + // ParameterExceptionFieldSingleHeader is a ParameterExceptionField enum value + ParameterExceptionFieldSingleHeader = "SINGLE_HEADER" + + // ParameterExceptionFieldDefaultAction is a ParameterExceptionField enum value + ParameterExceptionFieldDefaultAction = "DEFAULT_ACTION" + + // ParameterExceptionFieldRuleAction is a ParameterExceptionField enum value + ParameterExceptionFieldRuleAction = "RULE_ACTION" + + // ParameterExceptionFieldEntityLimit is a ParameterExceptionField enum value + ParameterExceptionFieldEntityLimit = "ENTITY_LIMIT" + + // ParameterExceptionFieldOverrideAction is a ParameterExceptionField enum value + ParameterExceptionFieldOverrideAction = "OVERRIDE_ACTION" + + // ParameterExceptionFieldScopeValue is a ParameterExceptionField enum value + ParameterExceptionFieldScopeValue = "SCOPE_VALUE" + + // ParameterExceptionFieldResourceArn is a ParameterExceptionField enum value + ParameterExceptionFieldResourceArn = "RESOURCE_ARN" + + // ParameterExceptionFieldResourceType is a ParameterExceptionField enum value + ParameterExceptionFieldResourceType = "RESOURCE_TYPE" + + // ParameterExceptionFieldTags is a ParameterExceptionField enum value + ParameterExceptionFieldTags = "TAGS" + + // ParameterExceptionFieldTagKeys is a ParameterExceptionField enum value + ParameterExceptionFieldTagKeys = "TAG_KEYS" + + // ParameterExceptionFieldMetricName is a ParameterExceptionField enum value + ParameterExceptionFieldMetricName = "METRIC_NAME" +) + +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 ( + // RateBasedStatementAggregateKeyTypeIp is a RateBasedStatementAggregateKeyType enum value + RateBasedStatementAggregateKeyTypeIp = "IP" +) + +const ( + // ResourceTypeApplicationLoadBalancer is a ResourceType enum value + ResourceTypeApplicationLoadBalancer = "APPLICATION_LOAD_BALANCER" + + // ResourceTypeApiGateway is a ResourceType enum value + ResourceTypeApiGateway = "API_GATEWAY" +) + +const ( + // ScopeCloudfront is a Scope enum value + ScopeCloudfront = "CLOUDFRONT" + + // ScopeRegional is a Scope enum value + ScopeRegional = "REGIONAL" +) + +const ( + // TextTransformationTypeNone is a TextTransformationType enum value + TextTransformationTypeNone = "NONE" + + // TextTransformationTypeCompressWhiteSpace is a TextTransformationType enum value + TextTransformationTypeCompressWhiteSpace = "COMPRESS_WHITE_SPACE" + + // TextTransformationTypeHtmlEntityDecode is a TextTransformationType enum value + TextTransformationTypeHtmlEntityDecode = "HTML_ENTITY_DECODE" + + // TextTransformationTypeLowercase is a TextTransformationType enum value + TextTransformationTypeLowercase = "LOWERCASE" + + // TextTransformationTypeCmdLine is a TextTransformationType enum value + TextTransformationTypeCmdLine = "CMD_LINE" + + // TextTransformationTypeUrlDecode is a TextTransformationType enum value + TextTransformationTypeUrlDecode = "URL_DECODE" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/wafv2/doc.go b/vendor/github.com/aws/aws-sdk-go/service/wafv2/doc.go new file mode 100644 index 00000000000..7ba3ae4f638 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/wafv2/doc.go @@ -0,0 +1,87 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package wafv2 provides the client and types for making API +// requests to AWS WAFV2. +// +// +// This is the latest version of the AWS WAF API, released in November, 2019. +// The names of the entities that you use to access this API, like endpoints +// and namespaces, all have the versioning information added, like "V2" or "v2", +// to distinguish from the prior version. We recommend migrating your resources +// to this version, because it has a number of significant improvements. +// +// If you used AWS WAF prior to this release, you can't use this AWS WAFV2 API +// to access any AWS WAF resources that you created before. You can access your +// old rules, web ACLs, and other AWS WAF resources only through the AWS WAF +// Classic APIs. The AWS WAF Classic APIs have retained the prior names, endpoints, +// and namespaces. +// +// For information, including how to migrate your AWS WAF resources to this +// version, see the AWS WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). +// +// AWS WAF is a web application firewall that lets you monitor the HTTP and +// HTTPS requests that are forwarded to Amazon CloudFront, an Amazon API Gateway +// API, or an Application Load Balancer. AWS WAF also 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, API Gateway, +// CloudFront, or the Application Load Balancer responds to requests either +// with the requested content or with an HTTP 403 status code (Forbidden). You +// also can configure CloudFront to return a custom error page when a request +// is blocked. +// +// This API guide is for developers who need detailed information about AWS +// WAF API actions, data types, and errors. For detailed information about AWS +// WAF features and an overview of how to use AWS WAF, see the AWS WAF Developer +// Guide (https://docs.aws.amazon.com/waf/latest/developerguide/). +// +// You can make API calls using the endpoints listed in AWS Service Endpoints +// for AWS WAF (https://docs.aws.amazon.com/general/latest/gr/rande.html#waf_region). +// +// * For regional applications, you can use any of the endpoints in the list. +// A regional application can be an Application Load Balancer (ALB) or an +// API Gateway stage. +// +// * For AWS CloudFront applications, you must use the API endpoint listed +// for US East (N. Virginia): us-east-1. +// +// Alternatively, you can use one of the AWS SDKs to access an API that's tailored +// to the programming language or platform that you're using. For more information, +// see AWS SDKs (http://aws.amazon.com/tools/#SDKs). +// +// We currently provide two versions of the AWS WAF API: this API and the prior +// versions, the classic AWS WAF APIs. This new API provides the same functionality +// as the older versions, with the following major improvements: +// +// * You use one API for both global and regional applications. Where you +// need to distinguish the scope, you specify a Scope parameter and set it +// to CLOUDFRONT or REGIONAL. +// +// * You can define a Web ACL or rule group with a single API call, and update +// it with a single call. You define all rule specifications in JSON format, +// and pass them to your rule group or Web ACL API calls. +// +// * The limits AWS WAF places on the use of rules more closely reflects +// the cost of running each type of rule. Rule groups include capacity settings, +// so you know the maximum cost of a rule group when you use it. +// +// See https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29 for more information on this service. +// +// See wafv2 package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/wafv2/ +// +// Using the Client +// +// To contact AWS WAFV2 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 WAFV2 client WAFV2 for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/wafv2/#New +package wafv2 diff --git a/vendor/github.com/aws/aws-sdk-go/service/wafv2/errors.go b/vendor/github.com/aws/aws-sdk-go/service/wafv2/errors.go new file mode 100644 index 00000000000..e4985c1dfe8 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/wafv2/errors.go @@ -0,0 +1,133 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package wafv2 + +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + +const ( + + // ErrCodeWAFAssociatedItemException for service response error code + // "WAFAssociatedItemException". + // + // AWS WAF couldn’t perform the operation because your resource is being used + // by another resource or it’s associated with another resource. + ErrCodeWAFAssociatedItemException = "WAFAssociatedItemException" + + // ErrCodeWAFDuplicateItemException for service response error code + // "WAFDuplicateItemException". + // + // AWS WAF couldn’t perform the operation because the resource that you tried + // to save is a duplicate of an existing one. + ErrCodeWAFDuplicateItemException = "WAFDuplicateItemException" + + // ErrCodeWAFInternalErrorException for service response error code + // "WAFInternalErrorException". + // + // Your request is valid, but AWS WAF couldn’t perform the operation because + // of a system problem. Retry your request. + ErrCodeWAFInternalErrorException = "WAFInternalErrorException" + + // ErrCodeWAFInvalidParameterException for service response error code + // "WAFInvalidParameterException". + // + // The operation failed because AWS WAF didn't recognize a parameter in the + // request. For example: + // + // * You specified an invalid parameter name or value. + // + // * Your nested statement isn't valid. You might have tried to nest a statement + // that can’t be nested. + // + // * You tried to update a WebACL with a DefaultAction that isn't among the + // types available at DefaultAction. + // + // * Your request references an ARN that is malformed, or corresponds to + // a resource with which a Web ACL cannot be associated. + ErrCodeWAFInvalidParameterException = "WAFInvalidParameterException" + + // ErrCodeWAFInvalidResourceException for service response error code + // "WAFInvalidResourceException". + // + // AWS WAF couldn’t perform the operation because the resource that you requested + // isn’t valid. Check the resource, and try again. + ErrCodeWAFInvalidResourceException = "WAFInvalidResourceException" + + // ErrCodeWAFLimitsExceededException for service response error code + // "WAFLimitsExceededException". + // + // AWS WAF couldn’t perform the operation because you exceeded your resource + // limit. For example, the maximum number of WebACL objects that you can create + // for an AWS account. For more information, see Limits (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) + // in the AWS WAF Developer Guide. + ErrCodeWAFLimitsExceededException = "WAFLimitsExceededException" + + // ErrCodeWAFNonexistentItemException for service response error code + // "WAFNonexistentItemException". + // + // AWS WAF couldn’t perform the operation because your resource doesn’t + // exist. + ErrCodeWAFNonexistentItemException = "WAFNonexistentItemException" + + // ErrCodeWAFOptimisticLockException for service response error code + // "WAFOptimisticLockException". + // + // AWS WAF couldn’t save your changes because you tried to update or delete + // a resource that has changed since you last retrieved it. Get the resource + // again, make any changes you need to make to the new copy, and retry your + // operation. + ErrCodeWAFOptimisticLockException = "WAFOptimisticLockException" + + // ErrCodeWAFServiceLinkedRoleErrorException for service response error code + // "WAFServiceLinkedRoleErrorException". + // + // AWS WAF is not able to access the service linked role. This can be caused + // by a previous PutLoggingConfiguration request, which can lock the service + // linked role for about 20 seconds. Please try your request again. The service + // linked role can also be locked by a previous DeleteServiceLinkedRole request, + // which can lock the role for 15 minutes or more. If you recently made a call + // to DeleteServiceLinkedRole, wait at least 15 minutes and try the request + // again. If you receive this same exception again, you will have to wait additional + // time until the role is unlocked. + ErrCodeWAFServiceLinkedRoleErrorException = "WAFServiceLinkedRoleErrorException" + + // ErrCodeWAFSubscriptionNotFoundException for service response error code + // "WAFSubscriptionNotFoundException". + ErrCodeWAFSubscriptionNotFoundException = "WAFSubscriptionNotFoundException" + + // ErrCodeWAFTagOperationException for service response error code + // "WAFTagOperationException". + // + // An error occurred during the tagging operation. Retry your request. + ErrCodeWAFTagOperationException = "WAFTagOperationException" + + // ErrCodeWAFTagOperationInternalErrorException for service response error code + // "WAFTagOperationInternalErrorException". + // + // AWS WAF couldn’t perform your tagging operation because of an internal + // error. Retry your request. + ErrCodeWAFTagOperationInternalErrorException = "WAFTagOperationInternalErrorException" + + // ErrCodeWAFUnavailableEntityException for service response error code + // "WAFUnavailableEntityException". + // + // AWS WAF couldn’t retrieve the resource that you requested. Retry your request. + ErrCodeWAFUnavailableEntityException = "WAFUnavailableEntityException" +) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "WAFAssociatedItemException": newErrorWAFAssociatedItemException, + "WAFDuplicateItemException": newErrorWAFDuplicateItemException, + "WAFInternalErrorException": newErrorWAFInternalErrorException, + "WAFInvalidParameterException": newErrorWAFInvalidParameterException, + "WAFInvalidResourceException": newErrorWAFInvalidResourceException, + "WAFLimitsExceededException": newErrorWAFLimitsExceededException, + "WAFNonexistentItemException": newErrorWAFNonexistentItemException, + "WAFOptimisticLockException": newErrorWAFOptimisticLockException, + "WAFServiceLinkedRoleErrorException": newErrorWAFServiceLinkedRoleErrorException, + "WAFSubscriptionNotFoundException": newErrorWAFSubscriptionNotFoundException, + "WAFTagOperationException": newErrorWAFTagOperationException, + "WAFTagOperationInternalErrorException": newErrorWAFTagOperationInternalErrorException, + "WAFUnavailableEntityException": newErrorWAFUnavailableEntityException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/wafv2/service.go b/vendor/github.com/aws/aws-sdk-go/service/wafv2/service.go new file mode 100644 index 00000000000..26dda56194c --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/wafv2/service.go @@ -0,0 +1,103 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package wafv2 + +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" + "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" +) + +// WAFV2 provides the API operation methods for making requests to +// AWS WAFV2. See this package's package overview docs +// for details on the service. +// +// WAFV2 methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type WAFV2 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 = "WAFV2" // Name of service. + EndpointsID = "wafv2" // ID to lookup a service endpoint with. + ServiceID = "WAFV2" // ServiceID is a unique identifier of a specific service. +) + +// New creates a new instance of the WAFV2 client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// mySession := session.Must(session.NewSession()) +// +// // Create a WAFV2 client from just a session. +// svc := wafv2.New(mySession) +// +// // Create a WAFV2 client with additional configuration +// svc := wafv2.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *WAFV2 { + c := p.ClientConfig(EndpointsID, cfgs...) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *WAFV2 { + svc := &WAFV2{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + PartitionID: partitionID, + Endpoint: endpoint, + APIVersion: "2019-07-29", + JSONVersion: "1.1", + TargetPrefix: "AWSWAF_20190729", + }, + 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( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a WAFV2 operation and runs any +// custom request initialization. +func (c *WAFV2) 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/worklink/api.go b/vendor/github.com/aws/aws-sdk-go/service/worklink/api.go index 3a4f223f37a..201091da1f5 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/worklink/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/worklink/api.go @@ -3,6 +3,7 @@ package worklink import ( + "fmt" "time" "github.com/aws/aws-sdk-go/aws" @@ -66,23 +67,23 @@ func (c *WorkLink) AssociateDomainRequest(input *AssociateDomainInput) (req *req // See the AWS API reference guide for Amazon WorkLink's // API operation AssociateDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/AssociateDomain @@ -161,23 +162,23 @@ func (c *WorkLink) AssociateWebsiteAuthorizationProviderRequest(input *Associate // See the AWS API reference guide for Amazon WorkLink's // API operation AssociateWebsiteAuthorizationProvider for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/AssociateWebsiteAuthorizationProvider @@ -256,23 +257,23 @@ func (c *WorkLink) AssociateWebsiteCertificateAuthorityRequest(input *AssociateW // See the AWS API reference guide for Amazon WorkLink's // API operation AssociateWebsiteCertificateAuthority for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/AssociateWebsiteCertificateAuthority @@ -352,23 +353,23 @@ func (c *WorkLink) CreateFleetRequest(input *CreateFleetInput) (req *request.Req // See the AWS API reference guide for Amazon WorkLink's // API operation CreateFleet for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/CreateFleet @@ -447,20 +448,20 @@ func (c *WorkLink) DeleteFleetRequest(input *DeleteFleetInput) (req *request.Req // See the AWS API reference guide for Amazon WorkLink's // API operation DeleteFleet for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/DeleteFleet @@ -539,20 +540,20 @@ func (c *WorkLink) DescribeAuditStreamConfigurationRequest(input *DescribeAuditS // See the AWS API reference guide for Amazon WorkLink's // API operation DescribeAuditStreamConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/DescribeAuditStreamConfiguration @@ -631,20 +632,20 @@ func (c *WorkLink) DescribeCompanyNetworkConfigurationRequest(input *DescribeCom // See the AWS API reference guide for Amazon WorkLink's // API operation DescribeCompanyNetworkConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/DescribeCompanyNetworkConfiguration @@ -722,20 +723,20 @@ func (c *WorkLink) DescribeDeviceRequest(input *DescribeDeviceInput) (req *reque // See the AWS API reference guide for Amazon WorkLink's // API operation DescribeDevice for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/DescribeDevice @@ -813,20 +814,20 @@ func (c *WorkLink) DescribeDevicePolicyConfigurationRequest(input *DescribeDevic // See the AWS API reference guide for Amazon WorkLink's // API operation DescribeDevicePolicyConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/DescribeDevicePolicyConfiguration @@ -904,20 +905,20 @@ func (c *WorkLink) DescribeDomainRequest(input *DescribeDomainInput) (req *reque // See the AWS API reference guide for Amazon WorkLink's // API operation DescribeDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/DescribeDomain @@ -996,20 +997,20 @@ func (c *WorkLink) DescribeFleetMetadataRequest(input *DescribeFleetMetadataInpu // See the AWS API reference guide for Amazon WorkLink's // API operation DescribeFleetMetadata for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/DescribeFleetMetadata @@ -1087,20 +1088,20 @@ func (c *WorkLink) DescribeIdentityProviderConfigurationRequest(input *DescribeI // See the AWS API reference guide for Amazon WorkLink's // API operation DescribeIdentityProviderConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/DescribeIdentityProviderConfiguration @@ -1178,20 +1179,20 @@ func (c *WorkLink) DescribeWebsiteCertificateAuthorityRequest(input *DescribeWeb // See the AWS API reference guide for Amazon WorkLink's // API operation DescribeWebsiteCertificateAuthority for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/DescribeWebsiteCertificateAuthority @@ -1271,20 +1272,20 @@ func (c *WorkLink) DisassociateDomainRequest(input *DisassociateDomainInput) (re // See the AWS API reference guide for Amazon WorkLink's // API operation DisassociateDomain for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/DisassociateDomain @@ -1365,23 +1366,23 @@ func (c *WorkLink) DisassociateWebsiteAuthorizationProviderRequest(input *Disass // See the AWS API reference guide for Amazon WorkLink's // API operation DisassociateWebsiteAuthorizationProvider for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The resource already exists. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/DisassociateWebsiteAuthorizationProvider @@ -1460,20 +1461,20 @@ func (c *WorkLink) DisassociateWebsiteCertificateAuthorityRequest(input *Disasso // See the AWS API reference guide for Amazon WorkLink's // API operation DisassociateWebsiteCertificateAuthority for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/DisassociateWebsiteCertificateAuthority @@ -1557,20 +1558,20 @@ func (c *WorkLink) ListDevicesRequest(input *ListDevicesInput) (req *request.Req // See the AWS API reference guide for Amazon WorkLink's // API operation ListDevices for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/ListDevices @@ -1638,10 +1639,12 @@ func (c *WorkLink) ListDevicesPagesWithContext(ctx aws.Context, input *ListDevic }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDevicesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDevicesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1704,17 +1707,17 @@ func (c *WorkLink) ListDomainsRequest(input *ListDomainsInput) (req *request.Req // See the AWS API reference guide for Amazon WorkLink's // API operation ListDomains for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/ListDomains @@ -1782,10 +1785,12 @@ func (c *WorkLink) ListDomainsPagesWithContext(ctx aws.Context, input *ListDomai }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListDomainsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListDomainsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1848,17 +1853,17 @@ func (c *WorkLink) ListFleetsRequest(input *ListFleetsInput) (req *request.Reque // See the AWS API reference guide for Amazon WorkLink's // API operation ListFleets for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/ListFleets @@ -1926,10 +1931,12 @@ func (c *WorkLink) ListFleetsPagesWithContext(ctx aws.Context, input *ListFleets }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListFleetsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListFleetsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1993,20 +2000,20 @@ func (c *WorkLink) ListWebsiteAuthorizationProvidersRequest(input *ListWebsiteAu // See the AWS API reference guide for Amazon WorkLink's // API operation ListWebsiteAuthorizationProviders for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/ListWebsiteAuthorizationProviders @@ -2074,10 +2081,12 @@ func (c *WorkLink) ListWebsiteAuthorizationProvidersPagesWithContext(ctx aws.Con }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListWebsiteAuthorizationProvidersOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListWebsiteAuthorizationProvidersOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2141,17 +2150,17 @@ func (c *WorkLink) ListWebsiteCertificateAuthoritiesRequest(input *ListWebsiteCe // See the AWS API reference guide for Amazon WorkLink's // API operation ListWebsiteCertificateAuthorities for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/ListWebsiteCertificateAuthorities @@ -2219,10 +2228,12 @@ func (c *WorkLink) ListWebsiteCertificateAuthoritiesPagesWithContext(ctx aws.Con }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*ListWebsiteCertificateAuthoritiesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*ListWebsiteCertificateAuthoritiesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -2280,20 +2291,20 @@ func (c *WorkLink) RestoreDomainAccessRequest(input *RestoreDomainAccessInput) ( // See the AWS API reference guide for Amazon WorkLink's // API operation RestoreDomainAccess for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/RestoreDomainAccess @@ -2372,20 +2383,20 @@ func (c *WorkLink) RevokeDomainAccessRequest(input *RevokeDomainAccessInput) (re // See the AWS API reference guide for Amazon WorkLink's // API operation RevokeDomainAccess for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/RevokeDomainAccess @@ -2465,20 +2476,20 @@ func (c *WorkLink) SignOutUserRequest(input *SignOutUserInput) (req *request.Req // See the AWS API reference guide for Amazon WorkLink's // API operation SignOutUser for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/SignOutUser @@ -2557,20 +2568,20 @@ func (c *WorkLink) UpdateAuditStreamConfigurationRequest(input *UpdateAuditStrea // See the AWS API reference guide for Amazon WorkLink's // API operation UpdateAuditStreamConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/UpdateAuditStreamConfiguration @@ -2649,20 +2660,20 @@ func (c *WorkLink) UpdateCompanyNetworkConfigurationRequest(input *UpdateCompany // See the AWS API reference guide for Amazon WorkLink's // API operation UpdateCompanyNetworkConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/UpdateCompanyNetworkConfiguration @@ -2741,20 +2752,20 @@ func (c *WorkLink) UpdateDevicePolicyConfigurationRequest(input *UpdateDevicePol // See the AWS API reference guide for Amazon WorkLink's // API operation UpdateDevicePolicyConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/UpdateDevicePolicyConfiguration @@ -2833,20 +2844,20 @@ func (c *WorkLink) UpdateDomainMetadataRequest(input *UpdateDomainMetadataInput) // See the AWS API reference guide for Amazon WorkLink's // API operation UpdateDomainMetadata for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/UpdateDomainMetadata @@ -2925,20 +2936,20 @@ func (c *WorkLink) UpdateFleetMetadataRequest(input *UpdateFleetMetadataInput) ( // See the AWS API reference guide for Amazon WorkLink's // API operation UpdateFleetMetadata for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/UpdateFleetMetadata @@ -3017,20 +3028,20 @@ func (c *WorkLink) UpdateIdentityProviderConfigurationRequest(input *UpdateIdent // See the AWS API reference guide for Amazon WorkLink's // API operation UpdateIdentityProviderConfiguration for usage and error information. // -// Returned Error Codes: -// * ErrCodeUnauthorizedException "UnauthorizedException" +// Returned Error Types: +// * UnauthorizedException // You are not authorized to perform this action. // -// * ErrCodeInternalServerErrorException "InternalServerErrorException" +// * InternalServerErrorException // The service is temporarily unavailable. // -// * ErrCodeInvalidRequestException "InvalidRequestException" +// * InvalidRequestException // The request is not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The requested resource was not found. // -// * ErrCodeTooManyRequestsException "TooManyRequestsException" +// * TooManyRequestsException // The number of requests exceeds the limit. // // See also, https://docs.aws.amazon.com/goto/WebAPI/worklink-2018-09-25/UpdateIdentityProviderConfiguration @@ -4634,6 +4645,118 @@ func (s *FleetSummary) SetLastUpdatedTime(v time.Time) *FleetSummary { return s } +// The service is temporarily unavailable. +type InternalServerErrorException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InternalServerErrorException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InternalServerErrorException) GoString() string { + return s.String() +} + +func newErrorInternalServerErrorException(v protocol.ResponseMetadata) error { + return &InternalServerErrorException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InternalServerErrorException) Code() string { + return "InternalServerErrorException" +} + +// Message returns the exception's message. +func (s InternalServerErrorException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InternalServerErrorException) OrigErr() error { + return nil +} + +func (s InternalServerErrorException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InternalServerErrorException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InternalServerErrorException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request is not valid. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + type ListDevicesInput struct { _ struct{} `type:"structure"` @@ -5112,6 +5235,118 @@ func (s *ListWebsiteCertificateAuthoritiesOutput) SetWebsiteCertificateAuthoriti return s } +// The resource already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceAlreadyExistsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceAlreadyExistsException) GoString() string { + return s.String() +} + +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" +} + +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil +} + +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} + +// The requested resource was not found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + type RestoreDomainAccessInput struct { _ struct{} `type:"structure"` @@ -5328,6 +5563,118 @@ func (s SignOutUserOutput) GoString() string { return s.String() } +// The number of requests exceeds the limit. +type TooManyRequestsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s TooManyRequestsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyRequestsException) GoString() string { + return s.String() +} + +func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { + return &TooManyRequestsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyRequestsException) Code() string { + return "TooManyRequestsException" +} + +// Message returns the exception's message. +func (s TooManyRequestsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyRequestsException) OrigErr() error { + return nil +} + +func (s TooManyRequestsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyRequestsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyRequestsException) RequestID() string { + return s.respMetadata.RequestID +} + +// You are not authorized to perform this action. +type UnauthorizedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s UnauthorizedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnauthorizedException) GoString() string { + return s.String() +} + +func newErrorUnauthorizedException(v protocol.ResponseMetadata) error { + return &UnauthorizedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnauthorizedException) Code() string { + return "UnauthorizedException" +} + +// Message returns the exception's message. +func (s UnauthorizedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnauthorizedException) OrigErr() error { + return nil +} + +func (s UnauthorizedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnauthorizedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnauthorizedException) RequestID() string { + return s.respMetadata.RequestID +} + type UpdateAuditStreamConfigurationInput struct { _ struct{} `type:"structure"` diff --git a/vendor/github.com/aws/aws-sdk-go/service/worklink/errors.go b/vendor/github.com/aws/aws-sdk-go/service/worklink/errors.go index 2d13a2eba27..862e3e2b462 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/worklink/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/worklink/errors.go @@ -2,6 +2,10 @@ package worklink +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInternalServerErrorException for service response error code @@ -40,3 +44,12 @@ const ( // You are not authorized to perform this action. ErrCodeUnauthorizedException = "UnauthorizedException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InternalServerErrorException": newErrorInternalServerErrorException, + "InvalidRequestException": newErrorInvalidRequestException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "TooManyRequestsException": newErrorTooManyRequestsException, + "UnauthorizedException": newErrorUnauthorizedException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/worklink/service.go b/vendor/github.com/aws/aws-sdk-go/service/worklink/service.go index c8a7fc0067e..cafef37dd32 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/worklink/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/worklink/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "WorkLink" // Name of service. EndpointsID = "worklink" // ID to lookup a service endpoint with. - ServiceID = "WorkLink" // ServiceID is a unique identifer of a specific service. + ServiceID = "WorkLink" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the WorkLink client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a WorkLink client from just a session. // svc := worklink.New(mySession) // @@ -49,11 +52,11 @@ func New(p client.ConfigProvider, cfgs ...*aws.Config) *WorkLink { if c.SigningNameDerived || len(c.SigningName) == 0 { c.SigningName = "worklink" } - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *WorkLink { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *WorkLink { svc := &WorkLink{ Client: client.New( cfg, @@ -62,6 +65,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2018-09-25", }, @@ -74,7 +78,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/workmail/api.go b/vendor/github.com/aws/aws-sdk-go/service/workmail/api.go new file mode 100644 index 00000000000..8d0f2473292 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/workmail/api.go @@ -0,0 +1,9900 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package workmail + +import ( + "fmt" + "time" + + "github.com/aws/aws-sdk-go/aws" + "github.com/aws/aws-sdk-go/aws/awsutil" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/private/protocol" + "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" +) + +const opAssociateDelegateToResource = "AssociateDelegateToResource" + +// AssociateDelegateToResourceRequest generates a "aws/request.Request" representing the +// client's request for the AssociateDelegateToResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AssociateDelegateToResource for more information on using the AssociateDelegateToResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AssociateDelegateToResourceRequest method. +// req, resp := client.AssociateDelegateToResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/AssociateDelegateToResource +func (c *WorkMail) AssociateDelegateToResourceRequest(input *AssociateDelegateToResourceInput) (req *request.Request, output *AssociateDelegateToResourceOutput) { + op := &request.Operation{ + Name: opAssociateDelegateToResource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AssociateDelegateToResourceInput{} + } + + output = &AssociateDelegateToResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// AssociateDelegateToResource API operation for Amazon WorkMail. +// +// Adds a member (user or group) to the resource's set of delegates. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon WorkMail's +// API operation AssociateDelegateToResource for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/AssociateDelegateToResource +func (c *WorkMail) AssociateDelegateToResource(input *AssociateDelegateToResourceInput) (*AssociateDelegateToResourceOutput, error) { + req, out := c.AssociateDelegateToResourceRequest(input) + return out, req.Send() +} + +// AssociateDelegateToResourceWithContext is the same as AssociateDelegateToResource with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateDelegateToResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) AssociateDelegateToResourceWithContext(ctx aws.Context, input *AssociateDelegateToResourceInput, opts ...request.Option) (*AssociateDelegateToResourceOutput, error) { + req, out := c.AssociateDelegateToResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opAssociateMemberToGroup = "AssociateMemberToGroup" + +// AssociateMemberToGroupRequest generates a "aws/request.Request" representing the +// client's request for the AssociateMemberToGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See AssociateMemberToGroup for more information on using the AssociateMemberToGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the AssociateMemberToGroupRequest method. +// req, resp := client.AssociateMemberToGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/AssociateMemberToGroup +func (c *WorkMail) AssociateMemberToGroupRequest(input *AssociateMemberToGroupInput) (req *request.Request, output *AssociateMemberToGroupOutput) { + op := &request.Operation{ + Name: opAssociateMemberToGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &AssociateMemberToGroupInput{} + } + + output = &AssociateMemberToGroupOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// AssociateMemberToGroup API operation for Amazon WorkMail. +// +// Adds a member (user or group) to the group's 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 Amazon WorkMail's +// API operation AssociateMemberToGroup for usage and error information. +// +// Returned Error Types: +// * DirectoryServiceAuthenticationFailedException +// The directory service doesn't recognize the credentials supplied by WorkMail. +// +// * DirectoryUnavailableException +// The directory on which you are trying to perform operations isn't available. +// +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// * UnsupportedOperationException +// You can't perform a write operation against a read-only directory. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/AssociateMemberToGroup +func (c *WorkMail) AssociateMemberToGroup(input *AssociateMemberToGroupInput) (*AssociateMemberToGroupOutput, error) { + req, out := c.AssociateMemberToGroupRequest(input) + return out, req.Send() +} + +// AssociateMemberToGroupWithContext is the same as AssociateMemberToGroup with the addition of +// the ability to pass a context and additional request options. +// +// See AssociateMemberToGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) AssociateMemberToGroupWithContext(ctx aws.Context, input *AssociateMemberToGroupInput, opts ...request.Option) (*AssociateMemberToGroupOutput, error) { + req, out := c.AssociateMemberToGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateAlias = "CreateAlias" + +// CreateAliasRequest generates a "aws/request.Request" representing the +// client's request for the CreateAlias operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateAlias for more information on using the CreateAlias +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateAliasRequest method. +// req, resp := client.CreateAliasRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/CreateAlias +func (c *WorkMail) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// CreateAlias API operation for Amazon WorkMail. +// +// Adds an alias to the set of a given member (user or group) of Amazon WorkMail. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon WorkMail's +// API operation CreateAlias for usage and error information. +// +// Returned Error Types: +// * EmailAddressInUseException +// The email address that you're trying to assign is already created for a different +// user, group, or resource. +// +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * MailDomainNotFoundException +// For an email or alias to be created in Amazon WorkMail, the included domain +// must be defined in the organization. +// +// * MailDomainStateException +// After a domain has been added to the organization, it must be verified. The +// domain is not yet verified. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// * LimitExceededException +// The request exceeds the limit of the resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/CreateAlias +func (c *WorkMail) CreateAlias(input *CreateAliasInput) (*CreateAliasOutput, error) { + req, out := c.CreateAliasRequest(input) + return out, req.Send() +} + +// CreateAliasWithContext is the same as CreateAlias with the addition of +// the ability to pass a context and additional request options. +// +// See CreateAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) CreateAliasWithContext(ctx aws.Context, input *CreateAliasInput, opts ...request.Option) (*CreateAliasOutput, error) { + req, out := c.CreateAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateGroup = "CreateGroup" + +// CreateGroupRequest generates a "aws/request.Request" representing the +// client's request for the CreateGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateGroup for more information on using the CreateGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateGroupRequest method. +// req, resp := client.CreateGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/CreateGroup +func (c *WorkMail) 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 Amazon WorkMail. +// +// Creates a group that can be used in Amazon WorkMail by calling the RegisterToWorkMail +// 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 WorkMail's +// API operation CreateGroup for usage and error information. +// +// Returned Error Types: +// * DirectoryServiceAuthenticationFailedException +// The directory service doesn't recognize the credentials supplied by WorkMail. +// +// * DirectoryUnavailableException +// The directory on which you are trying to perform operations isn't available. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * NameAvailabilityException +// The user, group, or resource name isn't unique in Amazon WorkMail. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// * ReservedNameException +// This user, group, or resource name is not allowed in Amazon WorkMail. +// +// * UnsupportedOperationException +// You can't perform a write operation against a read-only directory. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/CreateGroup +func (c *WorkMail) CreateGroup(input *CreateGroupInput) (*CreateGroupOutput, error) { + req, out := c.CreateGroupRequest(input) + return out, req.Send() +} + +// CreateGroupWithContext is the same as CreateGroup with the addition of +// the ability to pass a context and additional request options. +// +// See CreateGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) CreateGroupWithContext(ctx aws.Context, input *CreateGroupInput, opts ...request.Option) (*CreateGroupOutput, error) { + req, out := c.CreateGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateResource = "CreateResource" + +// CreateResourceRequest generates a "aws/request.Request" representing the +// client's request for the CreateResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateResource for more information on using the CreateResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateResourceRequest method. +// req, resp := client.CreateResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/CreateResource +func (c *WorkMail) CreateResourceRequest(input *CreateResourceInput) (req *request.Request, output *CreateResourceOutput) { + op := &request.Operation{ + Name: opCreateResource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &CreateResourceInput{} + } + + output = &CreateResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// CreateResource API operation for Amazon WorkMail. +// +// Creates a new Amazon WorkMail 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 WorkMail's +// API operation CreateResource for usage and error information. +// +// Returned Error Types: +// * DirectoryServiceAuthenticationFailedException +// The directory service doesn't recognize the credentials supplied by WorkMail. +// +// * DirectoryUnavailableException +// The directory on which you are trying to perform operations isn't available. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * NameAvailabilityException +// The user, group, or resource name isn't unique in Amazon WorkMail. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// * ReservedNameException +// This user, group, or resource name is not allowed in Amazon WorkMail. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/CreateResource +func (c *WorkMail) CreateResource(input *CreateResourceInput) (*CreateResourceOutput, error) { + req, out := c.CreateResourceRequest(input) + return out, req.Send() +} + +// CreateResourceWithContext is the same as CreateResource with the addition of +// the ability to pass a context and additional request options. +// +// See CreateResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) CreateResourceWithContext(ctx aws.Context, input *CreateResourceInput, opts ...request.Option) (*CreateResourceOutput, error) { + req, out := c.CreateResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opCreateUser = "CreateUser" + +// CreateUserRequest generates a "aws/request.Request" representing the +// client's request for the CreateUser operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See CreateUser for more information on using the CreateUser +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the CreateUserRequest method. +// req, resp := client.CreateUserRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/CreateUser +func (c *WorkMail) 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 Amazon WorkMail. +// +// Creates a user who can be used in Amazon WorkMail by calling the RegisterToWorkMail +// 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 WorkMail's +// API operation CreateUser for usage and error information. +// +// Returned Error Types: +// * DirectoryServiceAuthenticationFailedException +// The directory service doesn't recognize the credentials supplied by WorkMail. +// +// * DirectoryUnavailableException +// The directory on which you are trying to perform operations isn't available. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * InvalidPasswordException +// The supplied password doesn't match the minimum security constraints, such +// as length or use of special characters. +// +// * NameAvailabilityException +// The user, group, or resource name isn't unique in Amazon WorkMail. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// * ReservedNameException +// This user, group, or resource name is not allowed in Amazon WorkMail. +// +// * UnsupportedOperationException +// You can't perform a write operation against a read-only directory. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/CreateUser +func (c *WorkMail) CreateUser(input *CreateUserInput) (*CreateUserOutput, error) { + req, out := c.CreateUserRequest(input) + return out, req.Send() +} + +// CreateUserWithContext is the same as CreateUser with the addition of +// the ability to pass a context and additional request options. +// +// See CreateUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) CreateUserWithContext(ctx aws.Context, input *CreateUserInput, opts ...request.Option) (*CreateUserOutput, error) { + req, out := c.CreateUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteAccessControlRule = "DeleteAccessControlRule" + +// DeleteAccessControlRuleRequest generates a "aws/request.Request" representing the +// client's request for the DeleteAccessControlRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteAccessControlRule for more information on using the DeleteAccessControlRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteAccessControlRuleRequest method. +// req, resp := client.DeleteAccessControlRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DeleteAccessControlRule +func (c *WorkMail) DeleteAccessControlRuleRequest(input *DeleteAccessControlRuleInput) (req *request.Request, output *DeleteAccessControlRuleOutput) { + op := &request.Operation{ + Name: opDeleteAccessControlRule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteAccessControlRuleInput{} + } + + output = &DeleteAccessControlRuleOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteAccessControlRule API operation for Amazon WorkMail. +// +// Deletes an access control rule for the specified WorkMail organization. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon WorkMail's +// API operation DeleteAccessControlRule for usage and error information. +// +// Returned Error Types: +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DeleteAccessControlRule +func (c *WorkMail) DeleteAccessControlRule(input *DeleteAccessControlRuleInput) (*DeleteAccessControlRuleOutput, error) { + req, out := c.DeleteAccessControlRuleRequest(input) + return out, req.Send() +} + +// DeleteAccessControlRuleWithContext is the same as DeleteAccessControlRule with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAccessControlRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) DeleteAccessControlRuleWithContext(ctx aws.Context, input *DeleteAccessControlRuleInput, opts ...request.Option) (*DeleteAccessControlRuleOutput, error) { + req, out := c.DeleteAccessControlRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteAlias = "DeleteAlias" + +// DeleteAliasRequest generates a "aws/request.Request" representing the +// client's request for the DeleteAlias operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteAlias for more information on using the DeleteAlias +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteAliasRequest method. +// req, resp := client.DeleteAliasRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DeleteAlias +func (c *WorkMail) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteAlias API operation for Amazon WorkMail. +// +// Remove one or more specified aliases from a set of aliases for a given 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 WorkMail's +// API operation DeleteAlias for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DeleteAlias +func (c *WorkMail) DeleteAlias(input *DeleteAliasInput) (*DeleteAliasOutput, error) { + req, out := c.DeleteAliasRequest(input) + return out, req.Send() +} + +// DeleteAliasWithContext is the same as DeleteAlias with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteAlias for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) DeleteAliasWithContext(ctx aws.Context, input *DeleteAliasInput, opts ...request.Option) (*DeleteAliasOutput, error) { + req, out := c.DeleteAliasRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteGroup = "DeleteGroup" + +// DeleteGroupRequest generates a "aws/request.Request" representing the +// client's request for the DeleteGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteGroup for more information on using the DeleteGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteGroupRequest method. +// req, resp := client.DeleteGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DeleteGroup +func (c *WorkMail) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteGroup API operation for Amazon WorkMail. +// +// Deletes a group from Amazon WorkMail. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon WorkMail's +// API operation DeleteGroup for usage and error information. +// +// Returned Error Types: +// * DirectoryServiceAuthenticationFailedException +// The directory service doesn't recognize the credentials supplied by WorkMail. +// +// * DirectoryUnavailableException +// The directory on which you are trying to perform operations isn't available. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// * UnsupportedOperationException +// You can't perform a write operation against a read-only directory. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DeleteGroup +func (c *WorkMail) DeleteGroup(input *DeleteGroupInput) (*DeleteGroupOutput, error) { + req, out := c.DeleteGroupRequest(input) + return out, req.Send() +} + +// DeleteGroupWithContext is the same as DeleteGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) DeleteGroupWithContext(ctx aws.Context, input *DeleteGroupInput, opts ...request.Option) (*DeleteGroupOutput, error) { + req, out := c.DeleteGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteMailboxPermissions = "DeleteMailboxPermissions" + +// DeleteMailboxPermissionsRequest generates a "aws/request.Request" representing the +// client's request for the DeleteMailboxPermissions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteMailboxPermissions for more information on using the DeleteMailboxPermissions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteMailboxPermissionsRequest method. +// req, resp := client.DeleteMailboxPermissionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DeleteMailboxPermissions +func (c *WorkMail) DeleteMailboxPermissionsRequest(input *DeleteMailboxPermissionsInput) (req *request.Request, output *DeleteMailboxPermissionsOutput) { + op := &request.Operation{ + Name: opDeleteMailboxPermissions, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteMailboxPermissionsInput{} + } + + output = &DeleteMailboxPermissionsOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteMailboxPermissions API operation for Amazon WorkMail. +// +// Deletes permissions granted to a member (user or 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 WorkMail's +// API operation DeleteMailboxPermissions for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DeleteMailboxPermissions +func (c *WorkMail) DeleteMailboxPermissions(input *DeleteMailboxPermissionsInput) (*DeleteMailboxPermissionsOutput, error) { + req, out := c.DeleteMailboxPermissionsRequest(input) + return out, req.Send() +} + +// DeleteMailboxPermissionsWithContext is the same as DeleteMailboxPermissions with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteMailboxPermissions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) DeleteMailboxPermissionsWithContext(ctx aws.Context, input *DeleteMailboxPermissionsInput, opts ...request.Option) (*DeleteMailboxPermissionsOutput, error) { + req, out := c.DeleteMailboxPermissionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteResource = "DeleteResource" + +// DeleteResourceRequest generates a "aws/request.Request" representing the +// client's request for the DeleteResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteResource for more information on using the DeleteResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteResourceRequest method. +// req, resp := client.DeleteResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DeleteResource +func (c *WorkMail) DeleteResourceRequest(input *DeleteResourceInput) (req *request.Request, output *DeleteResourceOutput) { + op := &request.Operation{ + Name: opDeleteResource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeleteResourceInput{} + } + + output = &DeleteResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteResource API operation for Amazon WorkMail. +// +// Deletes 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 WorkMail's +// API operation DeleteResource for usage and error information. +// +// Returned Error Types: +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DeleteResource +func (c *WorkMail) DeleteResource(input *DeleteResourceInput) (*DeleteResourceOutput, error) { + req, out := c.DeleteResourceRequest(input) + return out, req.Send() +} + +// DeleteResourceWithContext is the same as DeleteResource with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) DeleteResourceWithContext(ctx aws.Context, input *DeleteResourceInput, opts ...request.Option) (*DeleteResourceOutput, error) { + req, out := c.DeleteResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeleteUser = "DeleteUser" + +// DeleteUserRequest generates a "aws/request.Request" representing the +// client's request for the DeleteUser operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeleteUser for more information on using the DeleteUser +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeleteUserRequest method. +// req, resp := client.DeleteUserRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DeleteUser +func (c *WorkMail) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeleteUser API operation for Amazon WorkMail. +// +// Deletes a user from Amazon WorkMail and all subsequent systems. Before you +// can delete a user, the user state must be DISABLED. Use the DescribeUser +// action to confirm the user state. +// +// Deleting a user is permanent and cannot be undone. WorkMail archives user +// mailboxes for 30 days before they are permanently 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 Amazon WorkMail's +// API operation DeleteUser for usage and error information. +// +// Returned Error Types: +// * DirectoryServiceAuthenticationFailedException +// The directory service doesn't recognize the credentials supplied by WorkMail. +// +// * DirectoryUnavailableException +// The directory on which you are trying to perform operations isn't available. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// * UnsupportedOperationException +// You can't perform a write operation against a read-only directory. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DeleteUser +func (c *WorkMail) DeleteUser(input *DeleteUserInput) (*DeleteUserOutput, error) { + req, out := c.DeleteUserRequest(input) + return out, req.Send() +} + +// DeleteUserWithContext is the same as DeleteUser with the addition of +// the ability to pass a context and additional request options. +// +// See DeleteUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) DeleteUserWithContext(ctx aws.Context, input *DeleteUserInput, opts ...request.Option) (*DeleteUserOutput, error) { + req, out := c.DeleteUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDeregisterFromWorkMail = "DeregisterFromWorkMail" + +// DeregisterFromWorkMailRequest generates a "aws/request.Request" representing the +// client's request for the DeregisterFromWorkMail operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeregisterFromWorkMail for more information on using the DeregisterFromWorkMail +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeregisterFromWorkMailRequest method. +// req, resp := client.DeregisterFromWorkMailRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DeregisterFromWorkMail +func (c *WorkMail) DeregisterFromWorkMailRequest(input *DeregisterFromWorkMailInput) (req *request.Request, output *DeregisterFromWorkMailOutput) { + op := &request.Operation{ + Name: opDeregisterFromWorkMail, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeregisterFromWorkMailInput{} + } + + output = &DeregisterFromWorkMailOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeregisterFromWorkMail API operation for Amazon WorkMail. +// +// Mark a user, group, or resource as no longer used in Amazon WorkMail. This +// action disassociates the mailbox and schedules it for clean-up. WorkMail +// keeps mailboxes for 30 days before they are permanently removed. The functionality +// in the console is Disable. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon WorkMail's +// API operation DeregisterFromWorkMail for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DeregisterFromWorkMail +func (c *WorkMail) DeregisterFromWorkMail(input *DeregisterFromWorkMailInput) (*DeregisterFromWorkMailOutput, error) { + req, out := c.DeregisterFromWorkMailRequest(input) + return out, req.Send() +} + +// DeregisterFromWorkMailWithContext is the same as DeregisterFromWorkMail with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterFromWorkMail for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) DeregisterFromWorkMailWithContext(ctx aws.Context, input *DeregisterFromWorkMailInput, opts ...request.Option) (*DeregisterFromWorkMailOutput, error) { + req, out := c.DeregisterFromWorkMailRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeGroup = "DescribeGroup" + +// DescribeGroupRequest generates a "aws/request.Request" representing the +// client's request for the DescribeGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeGroup for more information on using the DescribeGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeGroupRequest method. +// req, resp := client.DescribeGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DescribeGroup +func (c *WorkMail) DescribeGroupRequest(input *DescribeGroupInput) (req *request.Request, output *DescribeGroupOutput) { + op := &request.Operation{ + Name: opDescribeGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeGroupInput{} + } + + output = &DescribeGroupOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeGroup API operation for Amazon WorkMail. +// +// Returns the data available for the 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 WorkMail's +// API operation DescribeGroup for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DescribeGroup +func (c *WorkMail) DescribeGroup(input *DescribeGroupInput) (*DescribeGroupOutput, error) { + req, out := c.DescribeGroupRequest(input) + return out, req.Send() +} + +// DescribeGroupWithContext is the same as DescribeGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) DescribeGroupWithContext(ctx aws.Context, input *DescribeGroupInput, opts ...request.Option) (*DescribeGroupOutput, error) { + req, out := c.DescribeGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeOrganization = "DescribeOrganization" + +// DescribeOrganizationRequest generates a "aws/request.Request" representing the +// client's request for the DescribeOrganization operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeOrganization for more information on using the DescribeOrganization +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeOrganizationRequest method. +// req, resp := client.DescribeOrganizationRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DescribeOrganization +func (c *WorkMail) DescribeOrganizationRequest(input *DescribeOrganizationInput) (req *request.Request, output *DescribeOrganizationOutput) { + op := &request.Operation{ + Name: opDescribeOrganization, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeOrganizationInput{} + } + + output = &DescribeOrganizationOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeOrganization API operation for Amazon WorkMail. +// +// Provides more information regarding a given organization based on its 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 WorkMail's +// API operation DescribeOrganization for usage and error information. +// +// Returned Error Types: +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DescribeOrganization +func (c *WorkMail) DescribeOrganization(input *DescribeOrganizationInput) (*DescribeOrganizationOutput, error) { + req, out := c.DescribeOrganizationRequest(input) + return out, req.Send() +} + +// DescribeOrganizationWithContext is the same as DescribeOrganization with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeOrganization for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) DescribeOrganizationWithContext(ctx aws.Context, input *DescribeOrganizationInput, opts ...request.Option) (*DescribeOrganizationOutput, error) { + req, out := c.DescribeOrganizationRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeResource = "DescribeResource" + +// DescribeResourceRequest generates a "aws/request.Request" representing the +// client's request for the DescribeResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeResource for more information on using the DescribeResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeResourceRequest method. +// req, resp := client.DescribeResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DescribeResource +func (c *WorkMail) DescribeResourceRequest(input *DescribeResourceInput) (req *request.Request, output *DescribeResourceOutput) { + op := &request.Operation{ + Name: opDescribeResource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeResourceInput{} + } + + output = &DescribeResourceOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeResource API operation for Amazon WorkMail. +// +// Returns the data available for the 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 WorkMail's +// API operation DescribeResource for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DescribeResource +func (c *WorkMail) DescribeResource(input *DescribeResourceInput) (*DescribeResourceOutput, error) { + req, out := c.DescribeResourceRequest(input) + return out, req.Send() +} + +// DescribeResourceWithContext is the same as DescribeResource with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) DescribeResourceWithContext(ctx aws.Context, input *DescribeResourceInput, opts ...request.Option) (*DescribeResourceOutput, error) { + req, out := c.DescribeResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDescribeUser = "DescribeUser" + +// DescribeUserRequest generates a "aws/request.Request" representing the +// client's request for the DescribeUser operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DescribeUser for more information on using the DescribeUser +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DescribeUserRequest method. +// req, resp := client.DescribeUserRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DescribeUser +func (c *WorkMail) DescribeUserRequest(input *DescribeUserInput) (req *request.Request, output *DescribeUserOutput) { + op := &request.Operation{ + Name: opDescribeUser, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DescribeUserInput{} + } + + output = &DescribeUserOutput{} + req = c.newRequest(op, input, output) + return +} + +// DescribeUser API operation for Amazon WorkMail. +// +// Provides information regarding 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 WorkMail's +// API operation DescribeUser for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DescribeUser +func (c *WorkMail) DescribeUser(input *DescribeUserInput) (*DescribeUserOutput, error) { + req, out := c.DescribeUserRequest(input) + return out, req.Send() +} + +// DescribeUserWithContext is the same as DescribeUser with the addition of +// the ability to pass a context and additional request options. +// +// See DescribeUser for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) DescribeUserWithContext(ctx aws.Context, input *DescribeUserInput, opts ...request.Option) (*DescribeUserOutput, error) { + req, out := c.DescribeUserRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDisassociateDelegateFromResource = "DisassociateDelegateFromResource" + +// DisassociateDelegateFromResourceRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateDelegateFromResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DisassociateDelegateFromResource for more information on using the DisassociateDelegateFromResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DisassociateDelegateFromResourceRequest method. +// req, resp := client.DisassociateDelegateFromResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DisassociateDelegateFromResource +func (c *WorkMail) DisassociateDelegateFromResourceRequest(input *DisassociateDelegateFromResourceInput) (req *request.Request, output *DisassociateDelegateFromResourceOutput) { + op := &request.Operation{ + Name: opDisassociateDelegateFromResource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DisassociateDelegateFromResourceInput{} + } + + output = &DisassociateDelegateFromResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DisassociateDelegateFromResource API operation for Amazon WorkMail. +// +// Removes a member from the resource's set of delegates. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon WorkMail's +// API operation DisassociateDelegateFromResource for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DisassociateDelegateFromResource +func (c *WorkMail) DisassociateDelegateFromResource(input *DisassociateDelegateFromResourceInput) (*DisassociateDelegateFromResourceOutput, error) { + req, out := c.DisassociateDelegateFromResourceRequest(input) + return out, req.Send() +} + +// DisassociateDelegateFromResourceWithContext is the same as DisassociateDelegateFromResource with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateDelegateFromResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) DisassociateDelegateFromResourceWithContext(ctx aws.Context, input *DisassociateDelegateFromResourceInput, opts ...request.Option) (*DisassociateDelegateFromResourceOutput, error) { + req, out := c.DisassociateDelegateFromResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opDisassociateMemberFromGroup = "DisassociateMemberFromGroup" + +// DisassociateMemberFromGroupRequest generates a "aws/request.Request" representing the +// client's request for the DisassociateMemberFromGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DisassociateMemberFromGroup for more information on using the DisassociateMemberFromGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DisassociateMemberFromGroupRequest method. +// req, resp := client.DisassociateMemberFromGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DisassociateMemberFromGroup +func (c *WorkMail) DisassociateMemberFromGroupRequest(input *DisassociateMemberFromGroupInput) (req *request.Request, output *DisassociateMemberFromGroupOutput) { + op := &request.Operation{ + Name: opDisassociateMemberFromGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DisassociateMemberFromGroupInput{} + } + + output = &DisassociateMemberFromGroupOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DisassociateMemberFromGroup API operation for Amazon WorkMail. +// +// Removes a member from a 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 WorkMail's +// API operation DisassociateMemberFromGroup for usage and error information. +// +// Returned Error Types: +// * DirectoryServiceAuthenticationFailedException +// The directory service doesn't recognize the credentials supplied by WorkMail. +// +// * DirectoryUnavailableException +// The directory on which you are trying to perform operations isn't available. +// +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// * UnsupportedOperationException +// You can't perform a write operation against a read-only directory. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/DisassociateMemberFromGroup +func (c *WorkMail) DisassociateMemberFromGroup(input *DisassociateMemberFromGroupInput) (*DisassociateMemberFromGroupOutput, error) { + req, out := c.DisassociateMemberFromGroupRequest(input) + return out, req.Send() +} + +// DisassociateMemberFromGroupWithContext is the same as DisassociateMemberFromGroup with the addition of +// the ability to pass a context and additional request options. +// +// See DisassociateMemberFromGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) DisassociateMemberFromGroupWithContext(ctx aws.Context, input *DisassociateMemberFromGroupInput, opts ...request.Option) (*DisassociateMemberFromGroupOutput, error) { + req, out := c.DisassociateMemberFromGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetAccessControlEffect = "GetAccessControlEffect" + +// GetAccessControlEffectRequest generates a "aws/request.Request" representing the +// client's request for the GetAccessControlEffect operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetAccessControlEffect for more information on using the GetAccessControlEffect +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetAccessControlEffectRequest method. +// req, resp := client.GetAccessControlEffectRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/GetAccessControlEffect +func (c *WorkMail) GetAccessControlEffectRequest(input *GetAccessControlEffectInput) (req *request.Request, output *GetAccessControlEffectOutput) { + op := &request.Operation{ + Name: opGetAccessControlEffect, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetAccessControlEffectInput{} + } + + output = &GetAccessControlEffectOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetAccessControlEffect API operation for Amazon WorkMail. +// +// Gets the effects of an organization's access control rules as they apply +// to a specified IPv4 address, access protocol action, or user 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 WorkMail's +// API operation GetAccessControlEffect for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/GetAccessControlEffect +func (c *WorkMail) GetAccessControlEffect(input *GetAccessControlEffectInput) (*GetAccessControlEffectOutput, error) { + req, out := c.GetAccessControlEffectRequest(input) + return out, req.Send() +} + +// GetAccessControlEffectWithContext is the same as GetAccessControlEffect with the addition of +// the ability to pass a context and additional request options. +// +// See GetAccessControlEffect for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) GetAccessControlEffectWithContext(ctx aws.Context, input *GetAccessControlEffectInput, opts ...request.Option) (*GetAccessControlEffectOutput, error) { + req, out := c.GetAccessControlEffectRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opGetMailboxDetails = "GetMailboxDetails" + +// GetMailboxDetailsRequest generates a "aws/request.Request" representing the +// client's request for the GetMailboxDetails operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See GetMailboxDetails for more information on using the GetMailboxDetails +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the GetMailboxDetailsRequest method. +// req, resp := client.GetMailboxDetailsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/GetMailboxDetails +func (c *WorkMail) GetMailboxDetailsRequest(input *GetMailboxDetailsInput) (req *request.Request, output *GetMailboxDetailsOutput) { + op := &request.Operation{ + Name: opGetMailboxDetails, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &GetMailboxDetailsInput{} + } + + output = &GetMailboxDetailsOutput{} + req = c.newRequest(op, input, output) + return +} + +// GetMailboxDetails API operation for Amazon WorkMail. +// +// Requests a user's mailbox details for a specified organization and 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 WorkMail's +// API operation GetMailboxDetails for usage and error information. +// +// Returned Error Types: +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/GetMailboxDetails +func (c *WorkMail) GetMailboxDetails(input *GetMailboxDetailsInput) (*GetMailboxDetailsOutput, error) { + req, out := c.GetMailboxDetailsRequest(input) + return out, req.Send() +} + +// GetMailboxDetailsWithContext is the same as GetMailboxDetails with the addition of +// the ability to pass a context and additional request options. +// +// See GetMailboxDetails for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) GetMailboxDetailsWithContext(ctx aws.Context, input *GetMailboxDetailsInput, opts ...request.Option) (*GetMailboxDetailsOutput, error) { + req, out := c.GetMailboxDetailsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListAccessControlRules = "ListAccessControlRules" + +// ListAccessControlRulesRequest generates a "aws/request.Request" representing the +// client's request for the ListAccessControlRules operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListAccessControlRules for more information on using the ListAccessControlRules +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListAccessControlRulesRequest method. +// req, resp := client.ListAccessControlRulesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListAccessControlRules +func (c *WorkMail) ListAccessControlRulesRequest(input *ListAccessControlRulesInput) (req *request.Request, output *ListAccessControlRulesOutput) { + op := &request.Operation{ + Name: opListAccessControlRules, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ListAccessControlRulesInput{} + } + + output = &ListAccessControlRulesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListAccessControlRules API operation for Amazon WorkMail. +// +// Lists the access control rules for the specified organization. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon WorkMail's +// API operation ListAccessControlRules for usage and error information. +// +// Returned Error Types: +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListAccessControlRules +func (c *WorkMail) ListAccessControlRules(input *ListAccessControlRulesInput) (*ListAccessControlRulesOutput, error) { + req, out := c.ListAccessControlRulesRequest(input) + return out, req.Send() +} + +// ListAccessControlRulesWithContext is the same as ListAccessControlRules with the addition of +// the ability to pass a context and additional request options. +// +// See ListAccessControlRules for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) ListAccessControlRulesWithContext(ctx aws.Context, input *ListAccessControlRulesInput, opts ...request.Option) (*ListAccessControlRulesOutput, error) { + req, out := c.ListAccessControlRulesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListAliases = "ListAliases" + +// ListAliasesRequest generates a "aws/request.Request" representing the +// client's request for the ListAliases operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListAliases for more information on using the ListAliases +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListAliasesRequest method. +// req, resp := client.ListAliasesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListAliases +func (c *WorkMail) ListAliasesRequest(input *ListAliasesInput) (req *request.Request, output *ListAliasesOutput) { + op := &request.Operation{ + Name: opListAliases, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListAliasesInput{} + } + + output = &ListAliasesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListAliases API operation for Amazon WorkMail. +// +// Creates a paginated call to list the aliases associated with a given entity. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon WorkMail's +// API operation ListAliases for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListAliases +func (c *WorkMail) ListAliases(input *ListAliasesInput) (*ListAliasesOutput, error) { + req, out := c.ListAliasesRequest(input) + return out, req.Send() +} + +// ListAliasesWithContext is the same as ListAliases with the addition of +// the ability to pass a context and additional request options. +// +// See ListAliases for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) ListAliasesWithContext(ctx aws.Context, input *ListAliasesInput, opts ...request.Option) (*ListAliasesOutput, error) { + req, out := c.ListAliasesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// 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 *workmail.ListAliasesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *WorkMail) ListAliasesPages(input *ListAliasesInput, fn func(*ListAliasesOutput, bool) bool) error { + return c.ListAliasesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListAliasesPagesWithContext same as ListAliasesPages 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 *WorkMail) ListAliasesPagesWithContext(ctx aws.Context, input *ListAliasesInput, fn func(*ListAliasesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListAliasesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListAliasesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListAliasesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListGroupMembers = "ListGroupMembers" + +// ListGroupMembersRequest generates a "aws/request.Request" representing the +// client's request for the ListGroupMembers operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListGroupMembers for more information on using the ListGroupMembers +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListGroupMembersRequest method. +// req, resp := client.ListGroupMembersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListGroupMembers +func (c *WorkMail) ListGroupMembersRequest(input *ListGroupMembersInput) (req *request.Request, output *ListGroupMembersOutput) { + op := &request.Operation{ + Name: opListGroupMembers, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListGroupMembersInput{} + } + + output = &ListGroupMembersOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListGroupMembers API operation for Amazon WorkMail. +// +// Returns an overview of the members of a group. Users and groups can be members +// of a 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 WorkMail's +// API operation ListGroupMembers for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListGroupMembers +func (c *WorkMail) ListGroupMembers(input *ListGroupMembersInput) (*ListGroupMembersOutput, error) { + req, out := c.ListGroupMembersRequest(input) + return out, req.Send() +} + +// ListGroupMembersWithContext is the same as ListGroupMembers with the addition of +// the ability to pass a context and additional request options. +// +// See ListGroupMembers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) ListGroupMembersWithContext(ctx aws.Context, input *ListGroupMembersInput, opts ...request.Option) (*ListGroupMembersOutput, error) { + req, out := c.ListGroupMembersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListGroupMembersPages iterates over the pages of a ListGroupMembers operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListGroupMembers 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 ListGroupMembers operation. +// pageNum := 0 +// err := client.ListGroupMembersPages(params, +// func(page *workmail.ListGroupMembersOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *WorkMail) ListGroupMembersPages(input *ListGroupMembersInput, fn func(*ListGroupMembersOutput, bool) bool) error { + return c.ListGroupMembersPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListGroupMembersPagesWithContext same as ListGroupMembersPages 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 *WorkMail) ListGroupMembersPagesWithContext(ctx aws.Context, input *ListGroupMembersInput, fn func(*ListGroupMembersOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListGroupMembersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListGroupMembersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListGroupMembersOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListGroups = "ListGroups" + +// ListGroupsRequest generates a "aws/request.Request" representing the +// client's request for the ListGroups operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListGroups for more information on using the ListGroups +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListGroupsRequest method. +// req, resp := client.ListGroupsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListGroups +func (c *WorkMail) ListGroupsRequest(input *ListGroupsInput) (req *request.Request, output *ListGroupsOutput) { + op := &request.Operation{ + Name: opListGroups, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListGroupsInput{} + } + + output = &ListGroupsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListGroups API operation for Amazon WorkMail. +// +// Returns summaries of the organization's 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 WorkMail's +// API operation ListGroups for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListGroups +func (c *WorkMail) ListGroups(input *ListGroupsInput) (*ListGroupsOutput, error) { + req, out := c.ListGroupsRequest(input) + return out, req.Send() +} + +// ListGroupsWithContext is the same as ListGroups with the addition of +// the ability to pass a context and additional request options. +// +// See ListGroups for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) ListGroupsWithContext(ctx aws.Context, input *ListGroupsInput, opts ...request.Option) (*ListGroupsOutput, error) { + req, out := c.ListGroupsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// 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 *workmail.ListGroupsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *WorkMail) ListGroupsPages(input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool) error { + return c.ListGroupsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListGroupsPagesWithContext same as ListGroupsPages 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 *WorkMail) ListGroupsPagesWithContext(ctx aws.Context, input *ListGroupsInput, fn func(*ListGroupsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListGroupsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListGroupsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListGroupsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListMailboxPermissions = "ListMailboxPermissions" + +// ListMailboxPermissionsRequest generates a "aws/request.Request" representing the +// client's request for the ListMailboxPermissions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListMailboxPermissions for more information on using the ListMailboxPermissions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListMailboxPermissionsRequest method. +// req, resp := client.ListMailboxPermissionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListMailboxPermissions +func (c *WorkMail) ListMailboxPermissionsRequest(input *ListMailboxPermissionsInput) (req *request.Request, output *ListMailboxPermissionsOutput) { + op := &request.Operation{ + Name: opListMailboxPermissions, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListMailboxPermissionsInput{} + } + + output = &ListMailboxPermissionsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListMailboxPermissions API operation for Amazon WorkMail. +// +// Lists the mailbox permissions associated with a user, group, or resource +// mailbox. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon WorkMail's +// API operation ListMailboxPermissions for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListMailboxPermissions +func (c *WorkMail) ListMailboxPermissions(input *ListMailboxPermissionsInput) (*ListMailboxPermissionsOutput, error) { + req, out := c.ListMailboxPermissionsRequest(input) + return out, req.Send() +} + +// ListMailboxPermissionsWithContext is the same as ListMailboxPermissions with the addition of +// the ability to pass a context and additional request options. +// +// See ListMailboxPermissions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) ListMailboxPermissionsWithContext(ctx aws.Context, input *ListMailboxPermissionsInput, opts ...request.Option) (*ListMailboxPermissionsOutput, error) { + req, out := c.ListMailboxPermissionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListMailboxPermissionsPages iterates over the pages of a ListMailboxPermissions operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListMailboxPermissions 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 ListMailboxPermissions operation. +// pageNum := 0 +// err := client.ListMailboxPermissionsPages(params, +// func(page *workmail.ListMailboxPermissionsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *WorkMail) ListMailboxPermissionsPages(input *ListMailboxPermissionsInput, fn func(*ListMailboxPermissionsOutput, bool) bool) error { + return c.ListMailboxPermissionsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListMailboxPermissionsPagesWithContext same as ListMailboxPermissionsPages 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 *WorkMail) ListMailboxPermissionsPagesWithContext(ctx aws.Context, input *ListMailboxPermissionsInput, fn func(*ListMailboxPermissionsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListMailboxPermissionsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListMailboxPermissionsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListMailboxPermissionsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListOrganizations = "ListOrganizations" + +// ListOrganizationsRequest generates a "aws/request.Request" representing the +// client's request for the ListOrganizations operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListOrganizations for more information on using the ListOrganizations +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListOrganizationsRequest method. +// req, resp := client.ListOrganizationsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListOrganizations +func (c *WorkMail) ListOrganizationsRequest(input *ListOrganizationsInput) (req *request.Request, output *ListOrganizationsOutput) { + op := &request.Operation{ + Name: opListOrganizations, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListOrganizationsInput{} + } + + output = &ListOrganizationsOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListOrganizations API operation for Amazon WorkMail. +// +// Returns summaries of the customer's non-deleted organizations. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon WorkMail's +// API operation ListOrganizations for usage and error information. +// +// Returned Error Types: +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListOrganizations +func (c *WorkMail) ListOrganizations(input *ListOrganizationsInput) (*ListOrganizationsOutput, error) { + req, out := c.ListOrganizationsRequest(input) + return out, req.Send() +} + +// ListOrganizationsWithContext is the same as ListOrganizations with the addition of +// the ability to pass a context and additional request options. +// +// See ListOrganizations for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) ListOrganizationsWithContext(ctx aws.Context, input *ListOrganizationsInput, opts ...request.Option) (*ListOrganizationsOutput, error) { + req, out := c.ListOrganizationsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListOrganizationsPages iterates over the pages of a ListOrganizations operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListOrganizations 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 ListOrganizations operation. +// pageNum := 0 +// err := client.ListOrganizationsPages(params, +// func(page *workmail.ListOrganizationsOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *WorkMail) ListOrganizationsPages(input *ListOrganizationsInput, fn func(*ListOrganizationsOutput, bool) bool) error { + return c.ListOrganizationsPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListOrganizationsPagesWithContext same as ListOrganizationsPages 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 *WorkMail) ListOrganizationsPagesWithContext(ctx aws.Context, input *ListOrganizationsInput, fn func(*ListOrganizationsOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListOrganizationsInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListOrganizationsRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListOrganizationsOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListResourceDelegates = "ListResourceDelegates" + +// ListResourceDelegatesRequest generates a "aws/request.Request" representing the +// client's request for the ListResourceDelegates operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListResourceDelegates for more information on using the ListResourceDelegates +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListResourceDelegatesRequest method. +// req, resp := client.ListResourceDelegatesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListResourceDelegates +func (c *WorkMail) ListResourceDelegatesRequest(input *ListResourceDelegatesInput) (req *request.Request, output *ListResourceDelegatesOutput) { + op := &request.Operation{ + Name: opListResourceDelegates, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListResourceDelegatesInput{} + } + + output = &ListResourceDelegatesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListResourceDelegates API operation for Amazon WorkMail. +// +// Lists the delegates associated with a resource. Users and groups can be resource +// delegates and answer requests on behalf of the 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 WorkMail's +// API operation ListResourceDelegates for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListResourceDelegates +func (c *WorkMail) ListResourceDelegates(input *ListResourceDelegatesInput) (*ListResourceDelegatesOutput, error) { + req, out := c.ListResourceDelegatesRequest(input) + return out, req.Send() +} + +// ListResourceDelegatesWithContext is the same as ListResourceDelegates with the addition of +// the ability to pass a context and additional request options. +// +// See ListResourceDelegates for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) ListResourceDelegatesWithContext(ctx aws.Context, input *ListResourceDelegatesInput, opts ...request.Option) (*ListResourceDelegatesOutput, error) { + req, out := c.ListResourceDelegatesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListResourceDelegatesPages iterates over the pages of a ListResourceDelegates operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListResourceDelegates 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 ListResourceDelegates operation. +// pageNum := 0 +// err := client.ListResourceDelegatesPages(params, +// func(page *workmail.ListResourceDelegatesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *WorkMail) ListResourceDelegatesPages(input *ListResourceDelegatesInput, fn func(*ListResourceDelegatesOutput, bool) bool) error { + return c.ListResourceDelegatesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListResourceDelegatesPagesWithContext same as ListResourceDelegatesPages 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 *WorkMail) ListResourceDelegatesPagesWithContext(ctx aws.Context, input *ListResourceDelegatesInput, fn func(*ListResourceDelegatesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListResourceDelegatesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListResourceDelegatesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListResourceDelegatesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListResources = "ListResources" + +// ListResourcesRequest generates a "aws/request.Request" representing the +// client's request for the ListResources operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListResources for more information on using the ListResources +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListResourcesRequest method. +// req, resp := client.ListResourcesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListResources +func (c *WorkMail) ListResourcesRequest(input *ListResourcesInput) (req *request.Request, output *ListResourcesOutput) { + op := &request.Operation{ + Name: opListResources, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListResourcesInput{} + } + + output = &ListResourcesOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListResources API operation for Amazon WorkMail. +// +// Returns summaries of the organization's 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 WorkMail's +// API operation ListResources for usage and error information. +// +// Returned Error Types: +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListResources +func (c *WorkMail) ListResources(input *ListResourcesInput) (*ListResourcesOutput, error) { + req, out := c.ListResourcesRequest(input) + return out, req.Send() +} + +// ListResourcesWithContext is the same as ListResources with the addition of +// the ability to pass a context and additional request options. +// +// See ListResources for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) ListResourcesWithContext(ctx aws.Context, input *ListResourcesInput, opts ...request.Option) (*ListResourcesOutput, error) { + req, out := c.ListResourcesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// ListResourcesPages iterates over the pages of a ListResources operation, +// calling the "fn" function with the response data for each page. To stop +// iterating, return false from the fn function. +// +// See ListResources 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 ListResources operation. +// pageNum := 0 +// err := client.ListResourcesPages(params, +// func(page *workmail.ListResourcesOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *WorkMail) ListResourcesPages(input *ListResourcesInput, fn func(*ListResourcesOutput, bool) bool) error { + return c.ListResourcesPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListResourcesPagesWithContext same as ListResourcesPages 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 *WorkMail) ListResourcesPagesWithContext(ctx aws.Context, input *ListResourcesInput, fn func(*ListResourcesOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListResourcesInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListResourcesRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListResourcesOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opListTagsForResource = "ListTagsForResource" + +// ListTagsForResourceRequest generates a "aws/request.Request" representing the +// client's request for the ListTagsForResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListTagsForResource for more information on using the ListTagsForResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListTagsForResourceRequest method. +// req, resp := client.ListTagsForResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListTagsForResource +func (c *WorkMail) 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 WorkMail. +// +// Lists the tags applied to an Amazon WorkMail organization 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 WorkMail's +// API operation ListTagsForResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource cannot be found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListTagsForResource +func (c *WorkMail) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + return out, req.Send() +} + +// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of +// the ability to pass a context and additional request options. +// +// See ListTagsForResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { + req, out := c.ListTagsForResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opListUsers = "ListUsers" + +// ListUsersRequest generates a "aws/request.Request" representing the +// client's request for the ListUsers operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ListUsers for more information on using the ListUsers +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ListUsersRequest method. +// req, resp := client.ListUsersRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListUsers +func (c *WorkMail) ListUsersRequest(input *ListUsersInput) (req *request.Request, output *ListUsersOutput) { + op := &request.Operation{ + Name: opListUsers, + HTTPMethod: "POST", + HTTPPath: "/", + Paginator: &request.Paginator{ + InputTokens: []string{"NextToken"}, + OutputTokens: []string{"NextToken"}, + LimitToken: "MaxResults", + TruncationToken: "", + }, + } + + if input == nil { + input = &ListUsersInput{} + } + + output = &ListUsersOutput{} + req = c.newRequest(op, input, output) + return +} + +// ListUsers API operation for Amazon WorkMail. +// +// Returns summaries of the organization's 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 Amazon WorkMail's +// API operation ListUsers for usage and error information. +// +// Returned Error Types: +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ListUsers +func (c *WorkMail) ListUsers(input *ListUsersInput) (*ListUsersOutput, error) { + req, out := c.ListUsersRequest(input) + return out, req.Send() +} + +// ListUsersWithContext is the same as ListUsers with the addition of +// the ability to pass a context and additional request options. +// +// See ListUsers for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) ListUsersWithContext(ctx aws.Context, input *ListUsersInput, opts ...request.Option) (*ListUsersOutput, error) { + req, out := c.ListUsersRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// 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 *workmail.ListUsersOutput, lastPage bool) bool { +// pageNum++ +// fmt.Println(page) +// return pageNum <= 3 +// }) +// +func (c *WorkMail) ListUsersPages(input *ListUsersInput, fn func(*ListUsersOutput, bool) bool) error { + return c.ListUsersPagesWithContext(aws.BackgroundContext(), input, fn) +} + +// ListUsersPagesWithContext same as ListUsersPages 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 *WorkMail) ListUsersPagesWithContext(ctx aws.Context, input *ListUsersInput, fn func(*ListUsersOutput, bool) bool, opts ...request.Option) error { + p := request.Pagination{ + NewRequest: func() (*request.Request, error) { + var inCpy *ListUsersInput + if input != nil { + tmp := *input + inCpy = &tmp + } + req, _ := c.ListUsersRequest(inCpy) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return req, nil + }, + } + + for p.Next() { + if !fn(p.Page().(*ListUsersOutput), !p.HasNextPage()) { + break + } + } + + return p.Err() +} + +const opPutAccessControlRule = "PutAccessControlRule" + +// PutAccessControlRuleRequest generates a "aws/request.Request" representing the +// client's request for the PutAccessControlRule operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutAccessControlRule for more information on using the PutAccessControlRule +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutAccessControlRuleRequest method. +// req, resp := client.PutAccessControlRuleRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/PutAccessControlRule +func (c *WorkMail) PutAccessControlRuleRequest(input *PutAccessControlRuleInput) (req *request.Request, output *PutAccessControlRuleOutput) { + op := &request.Operation{ + Name: opPutAccessControlRule, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutAccessControlRuleInput{} + } + + output = &PutAccessControlRuleOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutAccessControlRule API operation for Amazon WorkMail. +// +// Adds a new access control rule for the specified organization. The rule allows +// or denies access to the organization for the specified IPv4 addresses, access +// protocol actions, and user IDs. Adding a new rule with the same name as an +// existing rule replaces the older 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 WorkMail's +// API operation PutAccessControlRule for usage and error information. +// +// Returned Error Types: +// * LimitExceededException +// The request exceeds the limit of the resource. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/PutAccessControlRule +func (c *WorkMail) PutAccessControlRule(input *PutAccessControlRuleInput) (*PutAccessControlRuleOutput, error) { + req, out := c.PutAccessControlRuleRequest(input) + return out, req.Send() +} + +// PutAccessControlRuleWithContext is the same as PutAccessControlRule with the addition of +// the ability to pass a context and additional request options. +// +// See PutAccessControlRule for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) PutAccessControlRuleWithContext(ctx aws.Context, input *PutAccessControlRuleInput, opts ...request.Option) (*PutAccessControlRuleOutput, error) { + req, out := c.PutAccessControlRuleRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opPutMailboxPermissions = "PutMailboxPermissions" + +// PutMailboxPermissionsRequest generates a "aws/request.Request" representing the +// client's request for the PutMailboxPermissions operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See PutMailboxPermissions for more information on using the PutMailboxPermissions +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the PutMailboxPermissionsRequest method. +// req, resp := client.PutMailboxPermissionsRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/PutMailboxPermissions +func (c *WorkMail) PutMailboxPermissionsRequest(input *PutMailboxPermissionsInput) (req *request.Request, output *PutMailboxPermissionsOutput) { + op := &request.Operation{ + Name: opPutMailboxPermissions, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &PutMailboxPermissionsInput{} + } + + output = &PutMailboxPermissionsOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// PutMailboxPermissions API operation for Amazon WorkMail. +// +// Sets permissions for a user, group, or resource. This replaces any pre-existing +// 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 WorkMail's +// API operation PutMailboxPermissions for usage and error information. +// +// Returned Error Types: +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/PutMailboxPermissions +func (c *WorkMail) PutMailboxPermissions(input *PutMailboxPermissionsInput) (*PutMailboxPermissionsOutput, error) { + req, out := c.PutMailboxPermissionsRequest(input) + return out, req.Send() +} + +// PutMailboxPermissionsWithContext is the same as PutMailboxPermissions with the addition of +// the ability to pass a context and additional request options. +// +// See PutMailboxPermissions for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) PutMailboxPermissionsWithContext(ctx aws.Context, input *PutMailboxPermissionsInput, opts ...request.Option) (*PutMailboxPermissionsOutput, error) { + req, out := c.PutMailboxPermissionsRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opRegisterToWorkMail = "RegisterToWorkMail" + +// RegisterToWorkMailRequest generates a "aws/request.Request" representing the +// client's request for the RegisterToWorkMail operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See RegisterToWorkMail for more information on using the RegisterToWorkMail +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the RegisterToWorkMailRequest method. +// req, resp := client.RegisterToWorkMailRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/RegisterToWorkMail +func (c *WorkMail) RegisterToWorkMailRequest(input *RegisterToWorkMailInput) (req *request.Request, output *RegisterToWorkMailOutput) { + op := &request.Operation{ + Name: opRegisterToWorkMail, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &RegisterToWorkMailInput{} + } + + output = &RegisterToWorkMailOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// RegisterToWorkMail API operation for Amazon WorkMail. +// +// Registers an existing and disabled user, group, or resource for Amazon WorkMail +// use by associating a mailbox and calendaring capabilities. It performs no +// change if the user, group, or resource is enabled and fails if the user, +// group, or resource is deleted. This operation results in the accumulation +// of costs. For more information, see Pricing (https://aws.amazon.com/workmail/pricing). +// The equivalent console functionality for this operation is Enable. +// +// Users can either be created by calling the CreateUser API operation or they +// can be synchronized from your directory. For more information, see DeregisterFromWorkMail. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon WorkMail's +// API operation RegisterToWorkMail for usage and error information. +// +// Returned Error Types: +// * DirectoryServiceAuthenticationFailedException +// The directory service doesn't recognize the credentials supplied by WorkMail. +// +// * DirectoryUnavailableException +// The directory on which you are trying to perform operations isn't available. +// +// * EmailAddressInUseException +// The email address that you're trying to assign is already created for a different +// user, group, or resource. +// +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * EntityAlreadyRegisteredException +// The user, group, or resource that you're trying to register is already registered. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * MailDomainNotFoundException +// For an email or alias to be created in Amazon WorkMail, the included domain +// must be defined in the organization. +// +// * MailDomainStateException +// After a domain has been added to the organization, it must be verified. The +// domain is not yet verified. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/RegisterToWorkMail +func (c *WorkMail) RegisterToWorkMail(input *RegisterToWorkMailInput) (*RegisterToWorkMailOutput, error) { + req, out := c.RegisterToWorkMailRequest(input) + return out, req.Send() +} + +// RegisterToWorkMailWithContext is the same as RegisterToWorkMail with the addition of +// the ability to pass a context and additional request options. +// +// See RegisterToWorkMail for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) RegisterToWorkMailWithContext(ctx aws.Context, input *RegisterToWorkMailInput, opts ...request.Option) (*RegisterToWorkMailOutput, error) { + req, out := c.RegisterToWorkMailRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opResetPassword = "ResetPassword" + +// ResetPasswordRequest generates a "aws/request.Request" representing the +// client's request for the ResetPassword operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See ResetPassword for more information on using the ResetPassword +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the ResetPasswordRequest method. +// req, resp := client.ResetPasswordRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ResetPassword +func (c *WorkMail) ResetPasswordRequest(input *ResetPasswordInput) (req *request.Request, output *ResetPasswordOutput) { + op := &request.Operation{ + Name: opResetPassword, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &ResetPasswordInput{} + } + + output = &ResetPasswordOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// ResetPassword API operation for Amazon WorkMail. +// +// Allows the administrator to reset the password for a 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 WorkMail's +// API operation ResetPassword for usage and error information. +// +// Returned Error Types: +// * DirectoryServiceAuthenticationFailedException +// The directory service doesn't recognize the credentials supplied by WorkMail. +// +// * DirectoryUnavailableException +// The directory on which you are trying to perform operations isn't available. +// +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * InvalidPasswordException +// The supplied password doesn't match the minimum security constraints, such +// as length or use of special characters. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// * UnsupportedOperationException +// You can't perform a write operation against a read-only directory. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/ResetPassword +func (c *WorkMail) ResetPassword(input *ResetPasswordInput) (*ResetPasswordOutput, error) { + req, out := c.ResetPasswordRequest(input) + return out, req.Send() +} + +// ResetPasswordWithContext is the same as ResetPassword with the addition of +// the ability to pass a context and additional request options. +// +// See ResetPassword for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) ResetPasswordWithContext(ctx aws.Context, input *ResetPasswordInput, opts ...request.Option) (*ResetPasswordOutput, error) { + req, out := c.ResetPasswordRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTagResource = "TagResource" + +// TagResourceRequest generates a "aws/request.Request" representing the +// client's request for the TagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TagResource for more information on using the TagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TagResourceRequest method. +// req, resp := client.TagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/TagResource +func (c *WorkMail) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// TagResource API operation for Amazon WorkMail. +// +// Applies the specified tags to the specified Amazon WorkMail organization +// 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 WorkMail's +// API operation TagResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource cannot be found. +// +// * TooManyTagsException +// The resource can have up to 50 user-applied tags. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/TagResource +func (c *WorkMail) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + return out, req.Send() +} + +// TagResourceWithContext is the same as TagResource with the addition of +// the ability to pass a context and additional request options. +// +// See TagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { + req, out := c.TagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUntagResource = "UntagResource" + +// UntagResourceRequest generates a "aws/request.Request" representing the +// client's request for the UntagResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UntagResource for more information on using the UntagResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UntagResourceRequest method. +// req, resp := client.UntagResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/UntagResource +func (c *WorkMail) 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.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UntagResource API operation for Amazon WorkMail. +// +// Untags the specified tags from the specified Amazon WorkMail organization +// 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 WorkMail's +// API operation UntagResource for usage and error information. +// +// Returned Error Types: +// * ResourceNotFoundException +// The resource cannot be found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/UntagResource +func (c *WorkMail) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + return out, req.Send() +} + +// UntagResourceWithContext is the same as UntagResource with the addition of +// the ability to pass a context and additional request options. +// +// See UntagResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { + req, out := c.UntagResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateMailboxQuota = "UpdateMailboxQuota" + +// UpdateMailboxQuotaRequest generates a "aws/request.Request" representing the +// client's request for the UpdateMailboxQuota operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateMailboxQuota for more information on using the UpdateMailboxQuota +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateMailboxQuotaRequest method. +// req, resp := client.UpdateMailboxQuotaRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/UpdateMailboxQuota +func (c *WorkMail) UpdateMailboxQuotaRequest(input *UpdateMailboxQuotaInput) (req *request.Request, output *UpdateMailboxQuotaOutput) { + op := &request.Operation{ + Name: opUpdateMailboxQuota, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateMailboxQuotaInput{} + } + + output = &UpdateMailboxQuotaOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateMailboxQuota API operation for Amazon WorkMail. +// +// Updates a user's current mailbox quota for a specified organization and 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 WorkMail's +// API operation UpdateMailboxQuota for usage and error information. +// +// Returned Error Types: +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/UpdateMailboxQuota +func (c *WorkMail) UpdateMailboxQuota(input *UpdateMailboxQuotaInput) (*UpdateMailboxQuotaOutput, error) { + req, out := c.UpdateMailboxQuotaRequest(input) + return out, req.Send() +} + +// UpdateMailboxQuotaWithContext is the same as UpdateMailboxQuota with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateMailboxQuota for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) UpdateMailboxQuotaWithContext(ctx aws.Context, input *UpdateMailboxQuotaInput, opts ...request.Option) (*UpdateMailboxQuotaOutput, error) { + req, out := c.UpdateMailboxQuotaRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdatePrimaryEmailAddress = "UpdatePrimaryEmailAddress" + +// UpdatePrimaryEmailAddressRequest generates a "aws/request.Request" representing the +// client's request for the UpdatePrimaryEmailAddress operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdatePrimaryEmailAddress for more information on using the UpdatePrimaryEmailAddress +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdatePrimaryEmailAddressRequest method. +// req, resp := client.UpdatePrimaryEmailAddressRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/UpdatePrimaryEmailAddress +func (c *WorkMail) UpdatePrimaryEmailAddressRequest(input *UpdatePrimaryEmailAddressInput) (req *request.Request, output *UpdatePrimaryEmailAddressOutput) { + op := &request.Operation{ + Name: opUpdatePrimaryEmailAddress, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdatePrimaryEmailAddressInput{} + } + + output = &UpdatePrimaryEmailAddressOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdatePrimaryEmailAddress API operation for Amazon WorkMail. +// +// Updates the primary email for a user, group, or resource. The current email +// is moved into the list of aliases (or swapped between an existing alias and +// the current primary email), and the email provided in the input is promoted +// as the primary. +// +// Returns awserr.Error for service API and SDK errors. Use runtime type assertions +// with awserr.Error's Code and Message methods to get detailed information about +// the error. +// +// See the AWS API reference guide for Amazon WorkMail's +// API operation UpdatePrimaryEmailAddress for usage and error information. +// +// Returned Error Types: +// * DirectoryServiceAuthenticationFailedException +// The directory service doesn't recognize the credentials supplied by WorkMail. +// +// * DirectoryUnavailableException +// The directory on which you are trying to perform operations isn't available. +// +// * EmailAddressInUseException +// The email address that you're trying to assign is already created for a different +// user, group, or resource. +// +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * MailDomainNotFoundException +// For an email or alias to be created in Amazon WorkMail, the included domain +// must be defined in the organization. +// +// * MailDomainStateException +// After a domain has been added to the organization, it must be verified. The +// domain is not yet verified. +// +// * InvalidParameterException +// One or more of the input parameters don't match the service's restrictions. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// * UnsupportedOperationException +// You can't perform a write operation against a read-only directory. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/UpdatePrimaryEmailAddress +func (c *WorkMail) UpdatePrimaryEmailAddress(input *UpdatePrimaryEmailAddressInput) (*UpdatePrimaryEmailAddressOutput, error) { + req, out := c.UpdatePrimaryEmailAddressRequest(input) + return out, req.Send() +} + +// UpdatePrimaryEmailAddressWithContext is the same as UpdatePrimaryEmailAddress with the addition of +// the ability to pass a context and additional request options. +// +// See UpdatePrimaryEmailAddress for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) UpdatePrimaryEmailAddressWithContext(ctx aws.Context, input *UpdatePrimaryEmailAddressInput, opts ...request.Option) (*UpdatePrimaryEmailAddressOutput, error) { + req, out := c.UpdatePrimaryEmailAddressRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateResource = "UpdateResource" + +// UpdateResourceRequest generates a "aws/request.Request" representing the +// client's request for the UpdateResource operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateResource for more information on using the UpdateResource +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateResourceRequest method. +// req, resp := client.UpdateResourceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/UpdateResource +func (c *WorkMail) UpdateResourceRequest(input *UpdateResourceInput) (req *request.Request, output *UpdateResourceOutput) { + op := &request.Operation{ + Name: opUpdateResource, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateResourceInput{} + } + + output = &UpdateResourceOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateResource API operation for Amazon WorkMail. +// +// Updates data for the resource. To have the latest information, it must be +// preceded by a DescribeResource call. The dataset in the request should be +// the one expected when performing another DescribeResource 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 WorkMail's +// API operation UpdateResource for usage and error information. +// +// Returned Error Types: +// * DirectoryUnavailableException +// The directory on which you are trying to perform operations isn't available. +// +// * EntityNotFoundException +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +// +// * EntityStateException +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +// +// * InvalidConfigurationException +// The configuration for a resource isn't valid. A resource must either be able +// to auto-respond to requests or have at least one delegate associated that +// can do so on its behalf. +// +// * EmailAddressInUseException +// The email address that you're trying to assign is already created for a different +// user, group, or resource. +// +// * MailDomainNotFoundException +// For an email or alias to be created in Amazon WorkMail, the included domain +// must be defined in the organization. +// +// * MailDomainStateException +// After a domain has been added to the organization, it must be verified. The +// domain is not yet verified. +// +// * NameAvailabilityException +// The user, group, or resource name isn't unique in Amazon WorkMail. +// +// * OrganizationNotFoundException +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +// +// * OrganizationStateException +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01/UpdateResource +func (c *WorkMail) UpdateResource(input *UpdateResourceInput) (*UpdateResourceOutput, error) { + req, out := c.UpdateResourceRequest(input) + return out, req.Send() +} + +// UpdateResourceWithContext is the same as UpdateResource with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateResource for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkMail) UpdateResourceWithContext(ctx aws.Context, input *UpdateResourceInput, opts ...request.Option) (*UpdateResourceOutput, error) { + req, out := c.UpdateResourceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// A rule that controls access to an Amazon WorkMail organization. +type AccessControlRule struct { + _ struct{} `type:"structure"` + + // Access protocol actions to include in the rule. Valid values include ActiveSync, + // AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail. + Actions []*string `type:"list"` + + // The date that the rule was created. + DateCreated *time.Time `type:"timestamp"` + + // The date that the rule was modified. + DateModified *time.Time `type:"timestamp"` + + // The rule description. + Description *string `type:"string"` + + // The rule effect. + Effect *string `type:"string" enum:"AccessControlRuleEffect"` + + // IPv4 CIDR ranges to include in the rule. + IpRanges []*string `type:"list"` + + // The rule name. + Name *string `min:"1" type:"string"` + + // Access protocol actions to exclude from the rule. Valid values include ActiveSync, + // AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail. + NotActions []*string `type:"list"` + + // IPv4 CIDR ranges to exclude from the rule. + NotIpRanges []*string `type:"list"` + + // User IDs to exclude from the rule. + NotUserIds []*string `type:"list"` + + // User IDs to include in the rule. + UserIds []*string `type:"list"` +} + +// String returns the string representation +func (s AccessControlRule) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessControlRule) GoString() string { + return s.String() +} + +// SetActions sets the Actions field's value. +func (s *AccessControlRule) SetActions(v []*string) *AccessControlRule { + s.Actions = v + return s +} + +// SetDateCreated sets the DateCreated field's value. +func (s *AccessControlRule) SetDateCreated(v time.Time) *AccessControlRule { + s.DateCreated = &v + return s +} + +// SetDateModified sets the DateModified field's value. +func (s *AccessControlRule) SetDateModified(v time.Time) *AccessControlRule { + s.DateModified = &v + return s +} + +// SetDescription sets the Description field's value. +func (s *AccessControlRule) SetDescription(v string) *AccessControlRule { + s.Description = &v + return s +} + +// SetEffect sets the Effect field's value. +func (s *AccessControlRule) SetEffect(v string) *AccessControlRule { + s.Effect = &v + return s +} + +// SetIpRanges sets the IpRanges field's value. +func (s *AccessControlRule) SetIpRanges(v []*string) *AccessControlRule { + s.IpRanges = v + return s +} + +// SetName sets the Name field's value. +func (s *AccessControlRule) SetName(v string) *AccessControlRule { + s.Name = &v + return s +} + +// SetNotActions sets the NotActions field's value. +func (s *AccessControlRule) SetNotActions(v []*string) *AccessControlRule { + s.NotActions = v + return s +} + +// SetNotIpRanges sets the NotIpRanges field's value. +func (s *AccessControlRule) SetNotIpRanges(v []*string) *AccessControlRule { + s.NotIpRanges = v + return s +} + +// SetNotUserIds sets the NotUserIds field's value. +func (s *AccessControlRule) SetNotUserIds(v []*string) *AccessControlRule { + s.NotUserIds = v + return s +} + +// SetUserIds sets the UserIds field's value. +func (s *AccessControlRule) SetUserIds(v []*string) *AccessControlRule { + s.UserIds = v + return s +} + +type AssociateDelegateToResourceInput struct { + _ struct{} `type:"structure"` + + // The member (user or group) to associate to the resource. + // + // EntityId is a required field + EntityId *string `min:"12" type:"string" required:"true"` + + // The organization under which the resource exists. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // The resource for which members (users or groups) are associated. + // + // ResourceId is a required field + ResourceId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AssociateDelegateToResourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateDelegateToResourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssociateDelegateToResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssociateDelegateToResourceInput"} + if s.EntityId == nil { + invalidParams.Add(request.NewErrParamRequired("EntityId")) + } + if s.EntityId != nil && len(*s.EntityId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("EntityId", 12)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEntityId sets the EntityId field's value. +func (s *AssociateDelegateToResourceInput) SetEntityId(v string) *AssociateDelegateToResourceInput { + s.EntityId = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *AssociateDelegateToResourceInput) SetOrganizationId(v string) *AssociateDelegateToResourceInput { + s.OrganizationId = &v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *AssociateDelegateToResourceInput) SetResourceId(v string) *AssociateDelegateToResourceInput { + s.ResourceId = &v + return s +} + +type AssociateDelegateToResourceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AssociateDelegateToResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateDelegateToResourceOutput) GoString() string { + return s.String() +} + +type AssociateMemberToGroupInput struct { + _ struct{} `type:"structure"` + + // The group to which the member (user or group) is associated. + // + // GroupId is a required field + GroupId *string `min:"12" type:"string" required:"true"` + + // The member (user or group) to associate to the group. + // + // MemberId is a required field + MemberId *string `min:"12" type:"string" required:"true"` + + // The organization under which the group exists. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s AssociateMemberToGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateMemberToGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssociateMemberToGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssociateMemberToGroupInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 12)) + } + if s.MemberId == nil { + invalidParams.Add(request.NewErrParamRequired("MemberId")) + } + if s.MemberId != nil && len(*s.MemberId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("MemberId", 12)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *AssociateMemberToGroupInput) SetGroupId(v string) *AssociateMemberToGroupInput { + s.GroupId = &v + return s +} + +// SetMemberId sets the MemberId field's value. +func (s *AssociateMemberToGroupInput) SetMemberId(v string) *AssociateMemberToGroupInput { + s.MemberId = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *AssociateMemberToGroupInput) SetOrganizationId(v string) *AssociateMemberToGroupInput { + s.OrganizationId = &v + return s +} + +type AssociateMemberToGroupOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AssociateMemberToGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateMemberToGroupOutput) GoString() string { + return s.String() +} + +// At least one delegate must be associated to the resource to disable automatic +// replies from the resource. +type BookingOptions struct { + _ struct{} `type:"structure"` + + // The resource's ability to automatically reply to requests. If disabled, delegates + // must be associated to the resource. + AutoAcceptRequests *bool `type:"boolean"` + + // The resource's ability to automatically decline any conflicting requests. + AutoDeclineConflictingRequests *bool `type:"boolean"` + + // The resource's ability to automatically decline any recurring requests. + AutoDeclineRecurringRequests *bool `type:"boolean"` +} + +// String returns the string representation +func (s BookingOptions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s BookingOptions) GoString() string { + return s.String() +} + +// SetAutoAcceptRequests sets the AutoAcceptRequests field's value. +func (s *BookingOptions) SetAutoAcceptRequests(v bool) *BookingOptions { + s.AutoAcceptRequests = &v + return s +} + +// SetAutoDeclineConflictingRequests sets the AutoDeclineConflictingRequests field's value. +func (s *BookingOptions) SetAutoDeclineConflictingRequests(v bool) *BookingOptions { + s.AutoDeclineConflictingRequests = &v + return s +} + +// SetAutoDeclineRecurringRequests sets the AutoDeclineRecurringRequests field's value. +func (s *BookingOptions) SetAutoDeclineRecurringRequests(v bool) *BookingOptions { + s.AutoDeclineRecurringRequests = &v + return s +} + +type CreateAliasInput struct { + _ struct{} `type:"structure"` + + // The alias to add to the member set. + // + // Alias is a required field + Alias *string `min:"1" type:"string" required:"true"` + + // The member (user or group) to which this alias is added. + // + // EntityId is a required field + EntityId *string `min:"12" type:"string" required:"true"` + + // The organization under which the member (user or group) exists. + // + // OrganizationId is a required field + OrganizationId *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.EntityId == nil { + invalidParams.Add(request.NewErrParamRequired("EntityId")) + } + if s.EntityId != nil && len(*s.EntityId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("EntityId", 12)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + 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 +} + +// SetEntityId sets the EntityId field's value. +func (s *CreateAliasInput) SetEntityId(v string) *CreateAliasInput { + s.EntityId = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *CreateAliasInput) SetOrganizationId(v string) *CreateAliasInput { + s.OrganizationId = &v + return s +} + +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() +} + +type CreateGroupInput struct { + _ struct{} `type:"structure"` + + // The name of the group. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The organization under which the group is to be created. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// 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.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetName sets the Name field's value. +func (s *CreateGroupInput) SetName(v string) *CreateGroupInput { + s.Name = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *CreateGroupInput) SetOrganizationId(v string) *CreateGroupInput { + s.OrganizationId = &v + return s +} + +type CreateGroupOutput struct { + _ struct{} `type:"structure"` + + // The identifier of the group. + GroupId *string `min:"12" type:"string"` +} + +// 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() +} + +// SetGroupId sets the GroupId field's value. +func (s *CreateGroupOutput) SetGroupId(v string) *CreateGroupOutput { + s.GroupId = &v + return s +} + +type CreateResourceInput struct { + _ struct{} `type:"structure"` + + // The name of the new resource. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The identifier associated with the organization for which the resource is + // created. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // The type of the new resource. The available types are equipment and room. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"ResourceType"` +} + +// 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.Name == nil { + invalidParams.Add(request.NewErrParamRequired("Name")) + } + if s.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + 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 *CreateResourceInput) SetName(v string) *CreateResourceInput { + s.Name = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *CreateResourceInput) SetOrganizationId(v string) *CreateResourceInput { + s.OrganizationId = &v + return s +} + +// SetType sets the Type field's value. +func (s *CreateResourceInput) SetType(v string) *CreateResourceInput { + s.Type = &v + return s +} + +type CreateResourceOutput struct { + _ struct{} `type:"structure"` + + // The identifier of the new resource. + ResourceId *string `type:"string"` +} + +// String returns the string representation +func (s CreateResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateResourceOutput) GoString() string { + return s.String() +} + +// SetResourceId sets the ResourceId field's value. +func (s *CreateResourceOutput) SetResourceId(v string) *CreateResourceOutput { + s.ResourceId = &v + return s +} + +type CreateUserInput struct { + _ struct{} `type:"structure"` + + // The display name for the new user. + // + // DisplayName is a required field + DisplayName *string `type:"string" required:"true"` + + // The name for the new user. Simple AD or AD Connector user names have a maximum + // length of 20. All others have a maximum length of 64. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The identifier of the organization for which the user is created. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // The password for the new user. + // + // Password is a required field + Password *string `type:"string" required:"true" sensitive:"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.DisplayName == nil { + invalidParams.Add(request.NewErrParamRequired("DisplayName")) + } + 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.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + if s.Password == nil { + invalidParams.Add(request.NewErrParamRequired("Password")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDisplayName sets the DisplayName field's value. +func (s *CreateUserInput) SetDisplayName(v string) *CreateUserInput { + s.DisplayName = &v + return s +} + +// SetName sets the Name field's value. +func (s *CreateUserInput) SetName(v string) *CreateUserInput { + s.Name = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *CreateUserInput) SetOrganizationId(v string) *CreateUserInput { + s.OrganizationId = &v + return s +} + +// SetPassword sets the Password field's value. +func (s *CreateUserInput) SetPassword(v string) *CreateUserInput { + s.Password = &v + return s +} + +type CreateUserOutput struct { + _ struct{} `type:"structure"` + + // The identifier for the new user. + UserId *string `min:"12" type:"string"` +} + +// 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() +} + +// SetUserId sets the UserId field's value. +func (s *CreateUserOutput) SetUserId(v string) *CreateUserOutput { + s.UserId = &v + return s +} + +// The name of the attribute, which is one of the values defined in the UserAttribute +// enumeration. +type Delegate struct { + _ struct{} `type:"structure"` + + // The identifier for the user or group associated as the resource's delegate. + // + // Id is a required field + Id *string `type:"string" required:"true"` + + // The type of the delegate: user or group. + // + // Type is a required field + Type *string `type:"string" required:"true" enum:"MemberType"` +} + +// String returns the string representation +func (s Delegate) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Delegate) GoString() string { + return s.String() +} + +// SetId sets the Id field's value. +func (s *Delegate) SetId(v string) *Delegate { + s.Id = &v + return s +} + +// SetType sets the Type field's value. +func (s *Delegate) SetType(v string) *Delegate { + s.Type = &v + return s +} + +type DeleteAccessControlRuleInput struct { + _ struct{} `type:"structure"` + + // The name of the access control rule. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The identifier for the organization. + OrganizationId *string `type:"string"` +} + +// String returns the string representation +func (s DeleteAccessControlRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAccessControlRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteAccessControlRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteAccessControlRuleInput"} + 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 *DeleteAccessControlRuleInput) SetName(v string) *DeleteAccessControlRuleInput { + s.Name = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *DeleteAccessControlRuleInput) SetOrganizationId(v string) *DeleteAccessControlRuleInput { + s.OrganizationId = &v + return s +} + +type DeleteAccessControlRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteAccessControlRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteAccessControlRuleOutput) GoString() string { + return s.String() +} + +type DeleteAliasInput struct { + _ struct{} `type:"structure"` + + // The aliases to be removed from the user's set of aliases. Duplicate entries + // in the list are collapsed into single entries (the list is transformed into + // a set). + // + // Alias is a required field + Alias *string `min:"1" type:"string" required:"true"` + + // The identifier for the member (user or group) from which to have the aliases + // removed. + // + // EntityId is a required field + EntityId *string `min:"12" type:"string" required:"true"` + + // The identifier for the organization under which the user exists. + // + // OrganizationId is a required field + OrganizationId *string `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.Alias == nil { + invalidParams.Add(request.NewErrParamRequired("Alias")) + } + if s.Alias != nil && len(*s.Alias) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Alias", 1)) + } + if s.EntityId == nil { + invalidParams.Add(request.NewErrParamRequired("EntityId")) + } + if s.EntityId != nil && len(*s.EntityId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("EntityId", 12)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAlias sets the Alias field's value. +func (s *DeleteAliasInput) SetAlias(v string) *DeleteAliasInput { + s.Alias = &v + return s +} + +// SetEntityId sets the EntityId field's value. +func (s *DeleteAliasInput) SetEntityId(v string) *DeleteAliasInput { + s.EntityId = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *DeleteAliasInput) SetOrganizationId(v string) *DeleteAliasInput { + s.OrganizationId = &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 DeleteGroupInput struct { + _ struct{} `type:"structure"` + + // The identifier of the group to be deleted. + // + // GroupId is a required field + GroupId *string `min:"12" type:"string" required:"true"` + + // The organization that contains the group. + // + // OrganizationId is a required field + OrganizationId *string `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.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 12)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *DeleteGroupInput) SetGroupId(v string) *DeleteGroupInput { + s.GroupId = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *DeleteGroupInput) SetOrganizationId(v string) *DeleteGroupInput { + s.OrganizationId = &v + return s +} + +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() +} + +type DeleteMailboxPermissionsInput struct { + _ struct{} `type:"structure"` + + // The identifier of the member (user or group)that owns the mailbox. + // + // EntityId is a required field + EntityId *string `min:"12" type:"string" required:"true"` + + // The identifier of the member (user or group) for which to delete granted + // permissions. + // + // GranteeId is a required field + GranteeId *string `min:"12" type:"string" required:"true"` + + // The identifier of the organization under which the member (user or group) + // exists. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeleteMailboxPermissionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMailboxPermissionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteMailboxPermissionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteMailboxPermissionsInput"} + if s.EntityId == nil { + invalidParams.Add(request.NewErrParamRequired("EntityId")) + } + if s.EntityId != nil && len(*s.EntityId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("EntityId", 12)) + } + if s.GranteeId == nil { + invalidParams.Add(request.NewErrParamRequired("GranteeId")) + } + if s.GranteeId != nil && len(*s.GranteeId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("GranteeId", 12)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEntityId sets the EntityId field's value. +func (s *DeleteMailboxPermissionsInput) SetEntityId(v string) *DeleteMailboxPermissionsInput { + s.EntityId = &v + return s +} + +// SetGranteeId sets the GranteeId field's value. +func (s *DeleteMailboxPermissionsInput) SetGranteeId(v string) *DeleteMailboxPermissionsInput { + s.GranteeId = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *DeleteMailboxPermissionsInput) SetOrganizationId(v string) *DeleteMailboxPermissionsInput { + s.OrganizationId = &v + return s +} + +type DeleteMailboxPermissionsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteMailboxPermissionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteMailboxPermissionsOutput) GoString() string { + return s.String() +} + +type DeleteResourceInput struct { + _ struct{} `type:"structure"` + + // The identifier associated with the organization from which the resource is + // deleted. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // The identifier of the resource to be deleted. + // + // ResourceId is a required field + ResourceId *string `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.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *DeleteResourceInput) SetOrganizationId(v string) *DeleteResourceInput { + s.OrganizationId = &v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *DeleteResourceInput) SetResourceId(v string) *DeleteResourceInput { + s.ResourceId = &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() +} + +type DeleteUserInput struct { + _ struct{} `type:"structure"` + + // The organization that contains the user to be deleted. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // The identifier of the user to be deleted. + // + // UserId is a required field + UserId *string `min:"12" 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.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + if s.UserId == nil { + invalidParams.Add(request.NewErrParamRequired("UserId")) + } + if s.UserId != nil && len(*s.UserId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("UserId", 12)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *DeleteUserInput) SetOrganizationId(v string) *DeleteUserInput { + s.OrganizationId = &v + return s +} + +// SetUserId sets the UserId field's value. +func (s *DeleteUserInput) SetUserId(v string) *DeleteUserInput { + s.UserId = &v + return s +} + +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() +} + +type DeregisterFromWorkMailInput struct { + _ struct{} `type:"structure"` + + // The identifier for the member (user or group) to be updated. + // + // EntityId is a required field + EntityId *string `min:"12" type:"string" required:"true"` + + // The identifier for the organization under which the Amazon WorkMail entity + // exists. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DeregisterFromWorkMailInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeregisterFromWorkMailInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeregisterFromWorkMailInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeregisterFromWorkMailInput"} + if s.EntityId == nil { + invalidParams.Add(request.NewErrParamRequired("EntityId")) + } + if s.EntityId != nil && len(*s.EntityId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("EntityId", 12)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEntityId sets the EntityId field's value. +func (s *DeregisterFromWorkMailInput) SetEntityId(v string) *DeregisterFromWorkMailInput { + s.EntityId = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *DeregisterFromWorkMailInput) SetOrganizationId(v string) *DeregisterFromWorkMailInput { + s.OrganizationId = &v + return s +} + +type DeregisterFromWorkMailOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeregisterFromWorkMailOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeregisterFromWorkMailOutput) GoString() string { + return s.String() +} + +type DescribeGroupInput struct { + _ struct{} `type:"structure"` + + // The identifier for the group to be described. + // + // GroupId is a required field + GroupId *string `min:"12" type:"string" required:"true"` + + // The identifier for the organization under which the group exists. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeGroupInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 12)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *DescribeGroupInput) SetGroupId(v string) *DescribeGroupInput { + s.GroupId = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *DescribeGroupInput) SetOrganizationId(v string) *DescribeGroupInput { + s.OrganizationId = &v + return s +} + +type DescribeGroupOutput struct { + _ struct{} `type:"structure"` + + // The date and time when a user was deregistered from WorkMail, in UNIX epoch + // time format. + DisabledDate *time.Time `type:"timestamp"` + + // The email of the described group. + Email *string `min:"1" type:"string"` + + // The date and time when a user was registered to WorkMail, in UNIX epoch time + // format. + EnabledDate *time.Time `type:"timestamp"` + + // The identifier of the described group. + GroupId *string `min:"12" type:"string"` + + // The name of the described group. + Name *string `min:"1" type:"string"` + + // The state of the user: enabled (registered to Amazon WorkMail) or disabled + // (deregistered or never registered to WorkMail). + State *string `type:"string" enum:"EntityState"` +} + +// String returns the string representation +func (s DescribeGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeGroupOutput) GoString() string { + return s.String() +} + +// SetDisabledDate sets the DisabledDate field's value. +func (s *DescribeGroupOutput) SetDisabledDate(v time.Time) *DescribeGroupOutput { + s.DisabledDate = &v + return s +} + +// SetEmail sets the Email field's value. +func (s *DescribeGroupOutput) SetEmail(v string) *DescribeGroupOutput { + s.Email = &v + return s +} + +// SetEnabledDate sets the EnabledDate field's value. +func (s *DescribeGroupOutput) SetEnabledDate(v time.Time) *DescribeGroupOutput { + s.EnabledDate = &v + return s +} + +// SetGroupId sets the GroupId field's value. +func (s *DescribeGroupOutput) SetGroupId(v string) *DescribeGroupOutput { + s.GroupId = &v + return s +} + +// SetName sets the Name field's value. +func (s *DescribeGroupOutput) SetName(v string) *DescribeGroupOutput { + s.Name = &v + return s +} + +// SetState sets the State field's value. +func (s *DescribeGroupOutput) SetState(v string) *DescribeGroupOutput { + s.State = &v + return s +} + +type DescribeOrganizationInput struct { + _ struct{} `type:"structure"` + + // The identifier for the organization to be described. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeOrganizationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeOrganizationInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeOrganizationInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeOrganizationInput"} + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *DescribeOrganizationInput) SetOrganizationId(v string) *DescribeOrganizationInput { + s.OrganizationId = &v + return s +} + +type DescribeOrganizationOutput struct { + _ struct{} `type:"structure"` + + // The Amazon Resource Name (ARN) of the organization. + ARN *string `min:"1" type:"string"` + + // The alias for an organization. + Alias *string `min:"1" type:"string"` + + // The date at which the organization became usable in the WorkMail context, + // in UNIX epoch time format. + CompletedDate *time.Time `type:"timestamp"` + + // The default mail domain associated with the organization. + DefaultMailDomain *string `type:"string"` + + // The identifier for the directory associated with an Amazon WorkMail organization. + DirectoryId *string `type:"string"` + + // The type of directory associated with the WorkMail organization. + DirectoryType *string `type:"string"` + + // (Optional) The error message indicating if unexpected behavior was encountered + // with regards to the organization. + ErrorMessage *string `type:"string"` + + // The identifier of an organization. + OrganizationId *string `type:"string"` + + // The state of an organization. + State *string `type:"string"` +} + +// String returns the string representation +func (s DescribeOrganizationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeOrganizationOutput) GoString() string { + return s.String() +} + +// SetARN sets the ARN field's value. +func (s *DescribeOrganizationOutput) SetARN(v string) *DescribeOrganizationOutput { + s.ARN = &v + return s +} + +// SetAlias sets the Alias field's value. +func (s *DescribeOrganizationOutput) SetAlias(v string) *DescribeOrganizationOutput { + s.Alias = &v + return s +} + +// SetCompletedDate sets the CompletedDate field's value. +func (s *DescribeOrganizationOutput) SetCompletedDate(v time.Time) *DescribeOrganizationOutput { + s.CompletedDate = &v + return s +} + +// SetDefaultMailDomain sets the DefaultMailDomain field's value. +func (s *DescribeOrganizationOutput) SetDefaultMailDomain(v string) *DescribeOrganizationOutput { + s.DefaultMailDomain = &v + return s +} + +// SetDirectoryId sets the DirectoryId field's value. +func (s *DescribeOrganizationOutput) SetDirectoryId(v string) *DescribeOrganizationOutput { + s.DirectoryId = &v + return s +} + +// SetDirectoryType sets the DirectoryType field's value. +func (s *DescribeOrganizationOutput) SetDirectoryType(v string) *DescribeOrganizationOutput { + s.DirectoryType = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *DescribeOrganizationOutput) SetErrorMessage(v string) *DescribeOrganizationOutput { + s.ErrorMessage = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *DescribeOrganizationOutput) SetOrganizationId(v string) *DescribeOrganizationOutput { + s.OrganizationId = &v + return s +} + +// SetState sets the State field's value. +func (s *DescribeOrganizationOutput) SetState(v string) *DescribeOrganizationOutput { + s.State = &v + return s +} + +type DescribeResourceInput struct { + _ struct{} `type:"structure"` + + // The identifier associated with the organization for which the resource is + // described. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // The identifier of the resource to be described. + // + // ResourceId is a required field + ResourceId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeResourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeResourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeResourceInput"} + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *DescribeResourceInput) SetOrganizationId(v string) *DescribeResourceInput { + s.OrganizationId = &v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *DescribeResourceInput) SetResourceId(v string) *DescribeResourceInput { + s.ResourceId = &v + return s +} + +type DescribeResourceOutput struct { + _ struct{} `type:"structure"` + + // The booking options for the described resource. + BookingOptions *BookingOptions `type:"structure"` + + // The date and time when a resource was disabled from WorkMail, in UNIX epoch + // time format. + DisabledDate *time.Time `type:"timestamp"` + + // The email of the described resource. + Email *string `min:"1" type:"string"` + + // The date and time when a resource was enabled for WorkMail, in UNIX epoch + // time format. + EnabledDate *time.Time `type:"timestamp"` + + // The name of the described resource. + Name *string `min:"1" type:"string"` + + // The identifier of the described resource. + ResourceId *string `type:"string"` + + // The state of the resource: enabled (registered to Amazon WorkMail), disabled + // (deregistered or never registered to WorkMail), or deleted. + State *string `type:"string" enum:"EntityState"` + + // The type of the described resource. + Type *string `type:"string" enum:"ResourceType"` +} + +// String returns the string representation +func (s DescribeResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeResourceOutput) GoString() string { + return s.String() +} + +// SetBookingOptions sets the BookingOptions field's value. +func (s *DescribeResourceOutput) SetBookingOptions(v *BookingOptions) *DescribeResourceOutput { + s.BookingOptions = v + return s +} + +// SetDisabledDate sets the DisabledDate field's value. +func (s *DescribeResourceOutput) SetDisabledDate(v time.Time) *DescribeResourceOutput { + s.DisabledDate = &v + return s +} + +// SetEmail sets the Email field's value. +func (s *DescribeResourceOutput) SetEmail(v string) *DescribeResourceOutput { + s.Email = &v + return s +} + +// SetEnabledDate sets the EnabledDate field's value. +func (s *DescribeResourceOutput) SetEnabledDate(v time.Time) *DescribeResourceOutput { + s.EnabledDate = &v + return s +} + +// SetName sets the Name field's value. +func (s *DescribeResourceOutput) SetName(v string) *DescribeResourceOutput { + s.Name = &v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *DescribeResourceOutput) SetResourceId(v string) *DescribeResourceOutput { + s.ResourceId = &v + return s +} + +// SetState sets the State field's value. +func (s *DescribeResourceOutput) SetState(v string) *DescribeResourceOutput { + s.State = &v + return s +} + +// SetType sets the Type field's value. +func (s *DescribeResourceOutput) SetType(v string) *DescribeResourceOutput { + s.Type = &v + return s +} + +type DescribeUserInput struct { + _ struct{} `type:"structure"` + + // The identifier for the organization under which the user exists. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // The identifier for the user to be described. + // + // UserId is a required field + UserId *string `min:"12" type:"string" required:"true"` +} + +// String returns the string representation +func (s DescribeUserInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeUserInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeUserInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeUserInput"} + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + if s.UserId == nil { + invalidParams.Add(request.NewErrParamRequired("UserId")) + } + if s.UserId != nil && len(*s.UserId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("UserId", 12)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *DescribeUserInput) SetOrganizationId(v string) *DescribeUserInput { + s.OrganizationId = &v + return s +} + +// SetUserId sets the UserId field's value. +func (s *DescribeUserInput) SetUserId(v string) *DescribeUserInput { + s.UserId = &v + return s +} + +type DescribeUserOutput struct { + _ struct{} `type:"structure"` + + // The date and time at which the user was disabled for Amazon WorkMail usage, + // in UNIX epoch time format. + DisabledDate *time.Time `type:"timestamp"` + + // The display name of the user. + DisplayName *string `type:"string"` + + // The email of the user. + Email *string `min:"1" type:"string"` + + // The date and time at which the user was enabled for Amazon WorkMail usage, + // in UNIX epoch time format. + EnabledDate *time.Time `type:"timestamp"` + + // The name for the user. + Name *string `min:"1" type:"string"` + + // The state of a user: enabled (registered to Amazon WorkMail) or disabled + // (deregistered or never registered to WorkMail). + State *string `type:"string" enum:"EntityState"` + + // The identifier for the described user. + UserId *string `min:"12" type:"string"` + + // In certain cases, other entities are modeled as users. If interoperability + // is enabled, resources are imported into Amazon WorkMail as users. Because + // different WorkMail organizations rely on different directory types, administrators + // can distinguish between an unregistered user (account is disabled and has + // a user role) and the directory administrators. The values are USER, RESOURCE, + // and SYSTEM_USER. + UserRole *string `type:"string" enum:"UserRole"` +} + +// String returns the string representation +func (s DescribeUserOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeUserOutput) GoString() string { + return s.String() +} + +// SetDisabledDate sets the DisabledDate field's value. +func (s *DescribeUserOutput) SetDisabledDate(v time.Time) *DescribeUserOutput { + s.DisabledDate = &v + return s +} + +// SetDisplayName sets the DisplayName field's value. +func (s *DescribeUserOutput) SetDisplayName(v string) *DescribeUserOutput { + s.DisplayName = &v + return s +} + +// SetEmail sets the Email field's value. +func (s *DescribeUserOutput) SetEmail(v string) *DescribeUserOutput { + s.Email = &v + return s +} + +// SetEnabledDate sets the EnabledDate field's value. +func (s *DescribeUserOutput) SetEnabledDate(v time.Time) *DescribeUserOutput { + s.EnabledDate = &v + return s +} + +// SetName sets the Name field's value. +func (s *DescribeUserOutput) SetName(v string) *DescribeUserOutput { + s.Name = &v + return s +} + +// SetState sets the State field's value. +func (s *DescribeUserOutput) SetState(v string) *DescribeUserOutput { + s.State = &v + return s +} + +// SetUserId sets the UserId field's value. +func (s *DescribeUserOutput) SetUserId(v string) *DescribeUserOutput { + s.UserId = &v + return s +} + +// SetUserRole sets the UserRole field's value. +func (s *DescribeUserOutput) SetUserRole(v string) *DescribeUserOutput { + s.UserRole = &v + return s +} + +// The directory service doesn't recognize the credentials supplied by WorkMail. +type DirectoryServiceAuthenticationFailedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DirectoryServiceAuthenticationFailedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DirectoryServiceAuthenticationFailedException) GoString() string { + return s.String() +} + +func newErrorDirectoryServiceAuthenticationFailedException(v protocol.ResponseMetadata) error { + return &DirectoryServiceAuthenticationFailedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DirectoryServiceAuthenticationFailedException) Code() string { + return "DirectoryServiceAuthenticationFailedException" +} + +// Message returns the exception's message. +func (s DirectoryServiceAuthenticationFailedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DirectoryServiceAuthenticationFailedException) OrigErr() error { + return nil +} + +func (s DirectoryServiceAuthenticationFailedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DirectoryServiceAuthenticationFailedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DirectoryServiceAuthenticationFailedException) RequestID() string { + return s.respMetadata.RequestID +} + +// The directory on which you are trying to perform operations isn't available. +type DirectoryUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s DirectoryUnavailableException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DirectoryUnavailableException) GoString() string { + return s.String() +} + +func newErrorDirectoryUnavailableException(v protocol.ResponseMetadata) error { + return &DirectoryUnavailableException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s DirectoryUnavailableException) Code() string { + return "DirectoryUnavailableException" +} + +// Message returns the exception's message. +func (s DirectoryUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s DirectoryUnavailableException) OrigErr() error { + return nil +} + +func (s DirectoryUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s DirectoryUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s DirectoryUnavailableException) RequestID() string { + return s.respMetadata.RequestID +} + +type DisassociateDelegateFromResourceInput struct { + _ struct{} `type:"structure"` + + // The identifier for the member (user, group) to be removed from the resource's + // delegates. + // + // EntityId is a required field + EntityId *string `min:"12" type:"string" required:"true"` + + // The identifier for the organization under which the resource exists. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // The identifier of the resource from which delegates' set members are removed. + // + // ResourceId is a required field + ResourceId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DisassociateDelegateFromResourceInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateDelegateFromResourceInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisassociateDelegateFromResourceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisassociateDelegateFromResourceInput"} + if s.EntityId == nil { + invalidParams.Add(request.NewErrParamRequired("EntityId")) + } + if s.EntityId != nil && len(*s.EntityId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("EntityId", 12)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEntityId sets the EntityId field's value. +func (s *DisassociateDelegateFromResourceInput) SetEntityId(v string) *DisassociateDelegateFromResourceInput { + s.EntityId = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *DisassociateDelegateFromResourceInput) SetOrganizationId(v string) *DisassociateDelegateFromResourceInput { + s.OrganizationId = &v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *DisassociateDelegateFromResourceInput) SetResourceId(v string) *DisassociateDelegateFromResourceInput { + s.ResourceId = &v + return s +} + +type DisassociateDelegateFromResourceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DisassociateDelegateFromResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateDelegateFromResourceOutput) GoString() string { + return s.String() +} + +type DisassociateMemberFromGroupInput struct { + _ struct{} `type:"structure"` + + // The identifier for the group from which members are removed. + // + // GroupId is a required field + GroupId *string `min:"12" type:"string" required:"true"` + + // The identifier for the member to be removed to the group. + // + // MemberId is a required field + MemberId *string `min:"12" type:"string" required:"true"` + + // The identifier for the organization under which the group exists. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s DisassociateMemberFromGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateMemberFromGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisassociateMemberFromGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisassociateMemberFromGroupInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 12)) + } + if s.MemberId == nil { + invalidParams.Add(request.NewErrParamRequired("MemberId")) + } + if s.MemberId != nil && len(*s.MemberId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("MemberId", 12)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *DisassociateMemberFromGroupInput) SetGroupId(v string) *DisassociateMemberFromGroupInput { + s.GroupId = &v + return s +} + +// SetMemberId sets the MemberId field's value. +func (s *DisassociateMemberFromGroupInput) SetMemberId(v string) *DisassociateMemberFromGroupInput { + s.MemberId = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *DisassociateMemberFromGroupInput) SetOrganizationId(v string) *DisassociateMemberFromGroupInput { + s.OrganizationId = &v + return s +} + +type DisassociateMemberFromGroupOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DisassociateMemberFromGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateMemberFromGroupOutput) GoString() string { + return s.String() +} + +// The email address that you're trying to assign is already created for a different +// user, group, or resource. +type EmailAddressInUseException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s EmailAddressInUseException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EmailAddressInUseException) GoString() string { + return s.String() +} + +func newErrorEmailAddressInUseException(v protocol.ResponseMetadata) error { + return &EmailAddressInUseException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EmailAddressInUseException) Code() string { + return "EmailAddressInUseException" +} + +// Message returns the exception's message. +func (s EmailAddressInUseException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EmailAddressInUseException) OrigErr() error { + return nil +} + +func (s EmailAddressInUseException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EmailAddressInUseException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EmailAddressInUseException) RequestID() string { + return s.respMetadata.RequestID +} + +// The user, group, or resource that you're trying to register is already registered. +type EntityAlreadyRegisteredException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s EntityAlreadyRegisteredException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EntityAlreadyRegisteredException) GoString() string { + return s.String() +} + +func newErrorEntityAlreadyRegisteredException(v protocol.ResponseMetadata) error { + return &EntityAlreadyRegisteredException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EntityAlreadyRegisteredException) Code() string { + return "EntityAlreadyRegisteredException" +} + +// Message returns the exception's message. +func (s EntityAlreadyRegisteredException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EntityAlreadyRegisteredException) OrigErr() error { + return nil +} + +func (s EntityAlreadyRegisteredException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EntityAlreadyRegisteredException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EntityAlreadyRegisteredException) RequestID() string { + return s.respMetadata.RequestID +} + +// The identifier supplied for the user, group, or resource does not exist in +// your organization. +type EntityNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s EntityNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EntityNotFoundException) GoString() string { + return s.String() +} + +func newErrorEntityNotFoundException(v protocol.ResponseMetadata) error { + return &EntityNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EntityNotFoundException) Code() string { + return "EntityNotFoundException" +} + +// Message returns the exception's message. +func (s EntityNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EntityNotFoundException) OrigErr() error { + return nil +} + +func (s EntityNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EntityNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EntityNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// You are performing an operation on a user, group, or resource that isn't +// in the expected state, such as trying to delete an active user. +type EntityStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s EntityStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s EntityStateException) GoString() string { + return s.String() +} + +func newErrorEntityStateException(v protocol.ResponseMetadata) error { + return &EntityStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s EntityStateException) Code() string { + return "EntityStateException" +} + +// Message returns the exception's message. +func (s EntityStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s EntityStateException) OrigErr() error { + return nil +} + +func (s EntityStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s EntityStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s EntityStateException) RequestID() string { + return s.respMetadata.RequestID +} + +type GetAccessControlEffectInput struct { + _ struct{} `type:"structure"` + + // The access protocol action. Valid values include ActiveSync, AutoDiscover, + // EWS, IMAP, SMTP, WindowsOutlook, and WebMail. + // + // Action is a required field + Action *string `min:"1" type:"string" required:"true"` + + // The IPv4 address. + // + // IpAddress is a required field + IpAddress *string `min:"1" type:"string" required:"true"` + + // The identifier for the organization. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // The user ID. + // + // UserId is a required field + UserId *string `min:"12" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetAccessControlEffectInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccessControlEffectInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetAccessControlEffectInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetAccessControlEffectInput"} + if s.Action == nil { + invalidParams.Add(request.NewErrParamRequired("Action")) + } + if s.Action != nil && len(*s.Action) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Action", 1)) + } + if s.IpAddress == nil { + invalidParams.Add(request.NewErrParamRequired("IpAddress")) + } + if s.IpAddress != nil && len(*s.IpAddress) < 1 { + invalidParams.Add(request.NewErrParamMinLen("IpAddress", 1)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + if s.UserId == nil { + invalidParams.Add(request.NewErrParamRequired("UserId")) + } + if s.UserId != nil && len(*s.UserId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("UserId", 12)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetAction sets the Action field's value. +func (s *GetAccessControlEffectInput) SetAction(v string) *GetAccessControlEffectInput { + s.Action = &v + return s +} + +// SetIpAddress sets the IpAddress field's value. +func (s *GetAccessControlEffectInput) SetIpAddress(v string) *GetAccessControlEffectInput { + s.IpAddress = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *GetAccessControlEffectInput) SetOrganizationId(v string) *GetAccessControlEffectInput { + s.OrganizationId = &v + return s +} + +// SetUserId sets the UserId field's value. +func (s *GetAccessControlEffectInput) SetUserId(v string) *GetAccessControlEffectInput { + s.UserId = &v + return s +} + +type GetAccessControlEffectOutput struct { + _ struct{} `type:"structure"` + + // The rule effect. + Effect *string `type:"string" enum:"AccessControlRuleEffect"` + + // The rules that match the given parameters, resulting in an effect. + MatchedRules []*string `type:"list"` +} + +// String returns the string representation +func (s GetAccessControlEffectOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetAccessControlEffectOutput) GoString() string { + return s.String() +} + +// SetEffect sets the Effect field's value. +func (s *GetAccessControlEffectOutput) SetEffect(v string) *GetAccessControlEffectOutput { + s.Effect = &v + return s +} + +// SetMatchedRules sets the MatchedRules field's value. +func (s *GetAccessControlEffectOutput) SetMatchedRules(v []*string) *GetAccessControlEffectOutput { + s.MatchedRules = v + return s +} + +type GetMailboxDetailsInput struct { + _ struct{} `type:"structure"` + + // The identifier for the organization that contains the user whose mailbox + // details are being requested. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // The identifier for the user whose mailbox details are being requested. + // + // UserId is a required field + UserId *string `min:"12" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetMailboxDetailsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetMailboxDetailsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *GetMailboxDetailsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "GetMailboxDetailsInput"} + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + if s.UserId == nil { + invalidParams.Add(request.NewErrParamRequired("UserId")) + } + if s.UserId != nil && len(*s.UserId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("UserId", 12)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *GetMailboxDetailsInput) SetOrganizationId(v string) *GetMailboxDetailsInput { + s.OrganizationId = &v + return s +} + +// SetUserId sets the UserId field's value. +func (s *GetMailboxDetailsInput) SetUserId(v string) *GetMailboxDetailsInput { + s.UserId = &v + return s +} + +type GetMailboxDetailsOutput struct { + _ struct{} `type:"structure"` + + // The maximum allowed mailbox size, in MB, for the specified user. + MailboxQuota *int64 `min:"1" type:"integer"` + + // The current mailbox size, in MB, for the specified user. + MailboxSize *float64 `type:"double"` +} + +// String returns the string representation +func (s GetMailboxDetailsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetMailboxDetailsOutput) GoString() string { + return s.String() +} + +// SetMailboxQuota sets the MailboxQuota field's value. +func (s *GetMailboxDetailsOutput) SetMailboxQuota(v int64) *GetMailboxDetailsOutput { + s.MailboxQuota = &v + return s +} + +// SetMailboxSize sets the MailboxSize field's value. +func (s *GetMailboxDetailsOutput) SetMailboxSize(v float64) *GetMailboxDetailsOutput { + s.MailboxSize = &v + return s +} + +// The representation of an Amazon WorkMail group. +type Group struct { + _ struct{} `type:"structure"` + + // The date indicating when the group was disabled from Amazon WorkMail use. + DisabledDate *time.Time `type:"timestamp"` + + // The email of the group. + Email *string `min:"1" type:"string"` + + // The date indicating when the group was enabled for Amazon WorkMail use. + EnabledDate *time.Time `type:"timestamp"` + + // The identifier of the group. + Id *string `min:"12" type:"string"` + + // The name of the group. + Name *string `min:"1" type:"string"` + + // The state of the group, which can be ENABLED, DISABLED, or DELETED. + State *string `type:"string" enum:"EntityState"` +} + +// 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() +} + +// SetDisabledDate sets the DisabledDate field's value. +func (s *Group) SetDisabledDate(v time.Time) *Group { + s.DisabledDate = &v + return s +} + +// SetEmail sets the Email field's value. +func (s *Group) SetEmail(v string) *Group { + s.Email = &v + return s +} + +// SetEnabledDate sets the EnabledDate field's value. +func (s *Group) SetEnabledDate(v time.Time) *Group { + s.EnabledDate = &v + return s +} + +// SetId sets the Id field's value. +func (s *Group) SetId(v string) *Group { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *Group) SetName(v string) *Group { + s.Name = &v + return s +} + +// SetState sets the State field's value. +func (s *Group) SetState(v string) *Group { + s.State = &v + return s +} + +// The configuration for a resource isn't valid. A resource must either be able +// to auto-respond to requests or have at least one delegate associated that +// can do so on its behalf. +type InvalidConfigurationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidConfigurationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidConfigurationException) GoString() string { + return s.String() +} + +func newErrorInvalidConfigurationException(v protocol.ResponseMetadata) error { + return &InvalidConfigurationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidConfigurationException) Code() string { + return "InvalidConfigurationException" +} + +// Message returns the exception's message. +func (s InvalidConfigurationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidConfigurationException) OrigErr() error { + return nil +} + +func (s InvalidConfigurationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidConfigurationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidConfigurationException) RequestID() string { + return s.respMetadata.RequestID +} + +// One or more of the input parameters don't match the service's restrictions. +type InvalidParameterException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidParameterException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidParameterException) GoString() string { + return s.String() +} + +func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { + return &InvalidParameterException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidParameterException) Code() string { + return "InvalidParameterException" +} + +// Message returns the exception's message. +func (s InvalidParameterException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterException) OrigErr() error { + return nil +} + +func (s InvalidParameterException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterException) RequestID() string { + return s.respMetadata.RequestID +} + +// The supplied password doesn't match the minimum security constraints, such +// as length or use of special characters. +type InvalidPasswordException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidPasswordException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidPasswordException) GoString() string { + return s.String() +} + +func newErrorInvalidPasswordException(v protocol.ResponseMetadata) error { + return &InvalidPasswordException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidPasswordException) Code() string { + return "InvalidPasswordException" +} + +// Message returns the exception's message. +func (s InvalidPasswordException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidPasswordException) OrigErr() error { + return nil +} + +func (s InvalidPasswordException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidPasswordException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidPasswordException) RequestID() string { + return s.respMetadata.RequestID +} + +// The request exceeds the limit of the resource. +type LimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s LimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s LimitExceededException) GoString() string { + return s.String() +} + +func newErrorLimitExceededException(v protocol.ResponseMetadata) error { + return &LimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s LimitExceededException) Code() string { + return "LimitExceededException" +} + +// Message returns the exception's message. +func (s LimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s LimitExceededException) OrigErr() error { + return nil +} + +func (s LimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s LimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s LimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + +type ListAccessControlRulesInput struct { + _ struct{} `type:"structure"` + + // The identifier for the organization. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ListAccessControlRulesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAccessControlRulesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListAccessControlRulesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAccessControlRulesInput"} + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *ListAccessControlRulesInput) SetOrganizationId(v string) *ListAccessControlRulesInput { + s.OrganizationId = &v + return s +} + +type ListAccessControlRulesOutput struct { + _ struct{} `type:"structure"` + + // The access control rules. + Rules []*AccessControlRule `type:"list"` +} + +// String returns the string representation +func (s ListAccessControlRulesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListAccessControlRulesOutput) GoString() string { + return s.String() +} + +// SetRules sets the Rules field's value. +func (s *ListAccessControlRulesOutput) SetRules(v []*AccessControlRule) *ListAccessControlRulesOutput { + s.Rules = v + return s +} + +type ListAliasesInput struct { + _ struct{} `type:"structure"` + + // The identifier for the entity for which to list the aliases. + // + // EntityId is a required field + EntityId *string `min:"12" type:"string" required:"true"` + + // The maximum number of results to return in a single call. + MaxResults *int64 `min:"1" type:"integer"` + + // The token to use to retrieve the next page of results. The first call does + // not contain any tokens. + NextToken *string `min:"1" type:"string"` + + // The identifier for the organization under which the entity exists. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// 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.EntityId == nil { + invalidParams.Add(request.NewErrParamRequired("EntityId")) + } + if s.EntityId != nil && len(*s.EntityId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("EntityId", 12)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEntityId sets the EntityId field's value. +func (s *ListAliasesInput) SetEntityId(v string) *ListAliasesInput { + s.EntityId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListAliasesInput) SetMaxResults(v int64) *ListAliasesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListAliasesInput) SetNextToken(v string) *ListAliasesInput { + s.NextToken = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *ListAliasesInput) SetOrganizationId(v string) *ListAliasesInput { + s.OrganizationId = &v + return s +} + +type ListAliasesOutput struct { + _ struct{} `type:"structure"` + + // The entity's paginated aliases. + Aliases []*string `type:"list"` + + // The token to use to retrieve the next page of results. The value is "null" + // when there are no more results to return. + NextToken *string `min:"1" 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 []*string) *ListAliasesOutput { + s.Aliases = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListAliasesOutput) SetNextToken(v string) *ListAliasesOutput { + s.NextToken = &v + return s +} + +type ListGroupMembersInput struct { + _ struct{} `type:"structure"` + + // The identifier for the group to which the members (users or groups) are associated. + // + // GroupId is a required field + GroupId *string `min:"12" type:"string" required:"true"` + + // The maximum number of results to return in a single call. + MaxResults *int64 `min:"1" type:"integer"` + + // The token to use to retrieve the next page of results. The first call does + // not contain any tokens. + NextToken *string `min:"1" type:"string"` + + // The identifier for the organization under which the group exists. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ListGroupMembersInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGroupMembersInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListGroupMembersInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListGroupMembersInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.GroupId != nil && len(*s.GroupId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("GroupId", 12)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *ListGroupMembersInput) SetGroupId(v string) *ListGroupMembersInput { + s.GroupId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListGroupMembersInput) SetMaxResults(v int64) *ListGroupMembersInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListGroupMembersInput) SetNextToken(v string) *ListGroupMembersInput { + s.NextToken = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *ListGroupMembersInput) SetOrganizationId(v string) *ListGroupMembersInput { + s.OrganizationId = &v + return s +} + +type ListGroupMembersOutput struct { + _ struct{} `type:"structure"` + + // The members associated to the group. + Members []*Member `type:"list"` + + // The token to use to retrieve the next page of results. The first call does + // not contain any tokens. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListGroupMembersOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListGroupMembersOutput) GoString() string { + return s.String() +} + +// SetMembers sets the Members field's value. +func (s *ListGroupMembersOutput) SetMembers(v []*Member) *ListGroupMembersOutput { + s.Members = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListGroupMembersOutput) SetNextToken(v string) *ListGroupMembersOutput { + s.NextToken = &v + return s +} + +type ListGroupsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of results to return in a single call. + MaxResults *int64 `min:"1" type:"integer"` + + // The token to use to retrieve the next page of results. The first call does + // not contain any tokens. + NextToken *string `min:"1" type:"string"` + + // The identifier for the organization under which the groups exist. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// 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.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListGroupsInput) SetMaxResults(v int64) *ListGroupsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListGroupsInput) SetNextToken(v string) *ListGroupsInput { + s.NextToken = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *ListGroupsInput) SetOrganizationId(v string) *ListGroupsInput { + s.OrganizationId = &v + return s +} + +type ListGroupsOutput struct { + _ struct{} `type:"structure"` + + // The overview of groups for an organization. + Groups []*Group `type:"list"` + + // The token to use to retrieve the next page of results. The value is "null" + // when there are no more results to return. + NextToken *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 +} + +// SetNextToken sets the NextToken field's value. +func (s *ListGroupsOutput) SetNextToken(v string) *ListGroupsOutput { + s.NextToken = &v + return s +} + +type ListMailboxPermissionsInput struct { + _ struct{} `type:"structure"` + + // The identifier of the user, group, or resource for which to list mailbox + // permissions. + // + // EntityId is a required field + EntityId *string `min:"12" type:"string" required:"true"` + + // The maximum number of results to return in a single call. + MaxResults *int64 `min:"1" type:"integer"` + + // The token to use to retrieve the next page of results. The first call does + // not contain any tokens. + NextToken *string `min:"1" type:"string"` + + // The identifier of the organization under which the user, group, or resource + // exists. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ListMailboxPermissionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListMailboxPermissionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListMailboxPermissionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListMailboxPermissionsInput"} + if s.EntityId == nil { + invalidParams.Add(request.NewErrParamRequired("EntityId")) + } + if s.EntityId != nil && len(*s.EntityId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("EntityId", 12)) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEntityId sets the EntityId field's value. +func (s *ListMailboxPermissionsInput) SetEntityId(v string) *ListMailboxPermissionsInput { + s.EntityId = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListMailboxPermissionsInput) SetMaxResults(v int64) *ListMailboxPermissionsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListMailboxPermissionsInput) SetNextToken(v string) *ListMailboxPermissionsInput { + s.NextToken = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *ListMailboxPermissionsInput) SetOrganizationId(v string) *ListMailboxPermissionsInput { + s.OrganizationId = &v + return s +} + +type ListMailboxPermissionsOutput struct { + _ struct{} `type:"structure"` + + // The token to use to retrieve the next page of results. The value is "null" + // when there are no more results to return. + NextToken *string `min:"1" type:"string"` + + // One page of the user, group, or resource mailbox permissions. + Permissions []*Permission `type:"list"` +} + +// String returns the string representation +func (s ListMailboxPermissionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListMailboxPermissionsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListMailboxPermissionsOutput) SetNextToken(v string) *ListMailboxPermissionsOutput { + s.NextToken = &v + return s +} + +// SetPermissions sets the Permissions field's value. +func (s *ListMailboxPermissionsOutput) SetPermissions(v []*Permission) *ListMailboxPermissionsOutput { + s.Permissions = v + return s +} + +type ListOrganizationsInput struct { + _ struct{} `type:"structure"` + + // The maximum number of results to return in a single call. + MaxResults *int64 `min:"1" type:"integer"` + + // The token to use to retrieve the next page of results. The first call does + // not contain any tokens. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListOrganizationsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListOrganizationsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListOrganizationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListOrganizationsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + 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 *ListOrganizationsInput) SetMaxResults(v int64) *ListOrganizationsInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListOrganizationsInput) SetNextToken(v string) *ListOrganizationsInput { + s.NextToken = &v + return s +} + +type ListOrganizationsOutput struct { + _ struct{} `type:"structure"` + + // The token to use to retrieve the next page of results. The value is "null" + // when there are no more results to return. + NextToken *string `min:"1" type:"string"` + + // The overview of owned organizations presented as a list of organization summaries. + OrganizationSummaries []*OrganizationSummary `type:"list"` +} + +// String returns the string representation +func (s ListOrganizationsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListOrganizationsOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListOrganizationsOutput) SetNextToken(v string) *ListOrganizationsOutput { + s.NextToken = &v + return s +} + +// SetOrganizationSummaries sets the OrganizationSummaries field's value. +func (s *ListOrganizationsOutput) SetOrganizationSummaries(v []*OrganizationSummary) *ListOrganizationsOutput { + s.OrganizationSummaries = v + return s +} + +type ListResourceDelegatesInput struct { + _ struct{} `type:"structure"` + + // The number of maximum results in a page. + MaxResults *int64 `min:"1" type:"integer"` + + // The token used to paginate through the delegates associated with a resource. + NextToken *string `min:"1" type:"string"` + + // The identifier for the organization that contains the resource for which + // delegates are listed. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // The identifier for the resource whose delegates are listed. + // + // ResourceId is a required field + ResourceId *string `min:"12" type:"string" required:"true"` +} + +// String returns the string representation +func (s ListResourceDelegatesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourceDelegatesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListResourceDelegatesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListResourceDelegatesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) + } + if s.ResourceId != nil && len(*s.ResourceId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("ResourceId", 12)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListResourceDelegatesInput) SetMaxResults(v int64) *ListResourceDelegatesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListResourceDelegatesInput) SetNextToken(v string) *ListResourceDelegatesInput { + s.NextToken = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *ListResourceDelegatesInput) SetOrganizationId(v string) *ListResourceDelegatesInput { + s.OrganizationId = &v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *ListResourceDelegatesInput) SetResourceId(v string) *ListResourceDelegatesInput { + s.ResourceId = &v + return s +} + +type ListResourceDelegatesOutput struct { + _ struct{} `type:"structure"` + + // One page of the resource's delegates. + Delegates []*Delegate `type:"list"` + + // The token used to paginate through the delegates associated with a resource. + // While results are still available, it has an associated value. When the last + // page is reached, the token is empty. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ListResourceDelegatesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourceDelegatesOutput) GoString() string { + return s.String() +} + +// SetDelegates sets the Delegates field's value. +func (s *ListResourceDelegatesOutput) SetDelegates(v []*Delegate) *ListResourceDelegatesOutput { + s.Delegates = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListResourceDelegatesOutput) SetNextToken(v string) *ListResourceDelegatesOutput { + s.NextToken = &v + return s +} + +type ListResourcesInput struct { + _ struct{} `type:"structure"` + + // The maximum number of results to return in a single call. + MaxResults *int64 `min:"1" type:"integer"` + + // The token to use to retrieve the next page of results. The first call does + // not contain any tokens. + NextToken *string `min:"1" type:"string"` + + // The identifier for the organization under which the resources exist. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s ListResourcesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourcesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ListResourcesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListResourcesInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListResourcesInput) SetMaxResults(v int64) *ListResourcesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListResourcesInput) SetNextToken(v string) *ListResourcesInput { + s.NextToken = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *ListResourcesInput) SetOrganizationId(v string) *ListResourcesInput { + s.OrganizationId = &v + return s +} + +type ListResourcesOutput struct { + _ struct{} `type:"structure"` + + // The token used to paginate through all the organization's resources. While + // results are still available, it has an associated value. When the last page + // is reached, the token is empty. + NextToken *string `min:"1" type:"string"` + + // One page of the organization's resource representation. + Resources []*Resource `type:"list"` +} + +// String returns the string representation +func (s ListResourcesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ListResourcesOutput) GoString() string { + return s.String() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListResourcesOutput) SetNextToken(v string) *ListResourcesOutput { + s.NextToken = &v + return s +} + +// SetResources sets the Resources field's value. +func (s *ListResourcesOutput) SetResources(v []*Resource) *ListResourcesOutput { + s.Resources = v + return s +} + +type ListTagsForResourceInput struct { + _ struct{} `type:"structure"` + + // The resource ARN. + // + // ResourceARN is a required field + ResourceARN *string `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 +} + +type ListTagsForResourceOutput struct { + _ struct{} `type:"structure"` + + // A list of tag key-value pairs. + 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() +} + +// SetTags sets the Tags field's value. +func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { + s.Tags = v + return s +} + +type ListUsersInput struct { + _ struct{} `type:"structure"` + + // The maximum number of results to return in a single call. + MaxResults *int64 `min:"1" type:"integer"` + + // The token to use to retrieve the next page of results. The first call does + // not contain any tokens. + NextToken *string `min:"1" type:"string"` + + // The identifier for the organization under which the users exist. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// 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.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListUsersInput) SetMaxResults(v int64) *ListUsersInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *ListUsersInput) SetNextToken(v string) *ListUsersInput { + s.NextToken = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *ListUsersInput) SetOrganizationId(v string) *ListUsersInput { + s.OrganizationId = &v + return s +} + +type ListUsersOutput 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 `min:"1" type:"string"` + + // The overview of users for an organization. + Users []*User `type:"list"` +} + +// 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() +} + +// SetNextToken sets the NextToken field's value. +func (s *ListUsersOutput) SetNextToken(v string) *ListUsersOutput { + s.NextToken = &v + return s +} + +// SetUsers sets the Users field's value. +func (s *ListUsersOutput) SetUsers(v []*User) *ListUsersOutput { + s.Users = v + return s +} + +// For an email or alias to be created in Amazon WorkMail, the included domain +// must be defined in the organization. +type MailDomainNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s MailDomainNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MailDomainNotFoundException) GoString() string { + return s.String() +} + +func newErrorMailDomainNotFoundException(v protocol.ResponseMetadata) error { + return &MailDomainNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MailDomainNotFoundException) Code() string { + return "MailDomainNotFoundException" +} + +// Message returns the exception's message. +func (s MailDomainNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MailDomainNotFoundException) OrigErr() error { + return nil +} + +func (s MailDomainNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MailDomainNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MailDomainNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// After a domain has been added to the organization, it must be verified. The +// domain is not yet verified. +type MailDomainStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s MailDomainStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s MailDomainStateException) GoString() string { + return s.String() +} + +func newErrorMailDomainStateException(v protocol.ResponseMetadata) error { + return &MailDomainStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s MailDomainStateException) Code() string { + return "MailDomainStateException" +} + +// Message returns the exception's message. +func (s MailDomainStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s MailDomainStateException) OrigErr() error { + return nil +} + +func (s MailDomainStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s MailDomainStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s MailDomainStateException) RequestID() string { + return s.respMetadata.RequestID +} + +// The representation of a user or group. +type Member struct { + _ struct{} `type:"structure"` + + // The date indicating when the member was disabled from Amazon WorkMail use. + DisabledDate *time.Time `type:"timestamp"` + + // The date indicating when the member was enabled for Amazon WorkMail use. + EnabledDate *time.Time `type:"timestamp"` + + // The identifier of the member. + Id *string `type:"string"` + + // The name of the member. + Name *string `type:"string"` + + // The state of the member, which can be ENABLED, DISABLED, or DELETED. + State *string `type:"string" enum:"EntityState"` + + // A member can be a user or group. + Type *string `type:"string" enum:"MemberType"` +} + +// String returns the string representation +func (s Member) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s Member) GoString() string { + return s.String() +} + +// SetDisabledDate sets the DisabledDate field's value. +func (s *Member) SetDisabledDate(v time.Time) *Member { + s.DisabledDate = &v + return s +} + +// SetEnabledDate sets the EnabledDate field's value. +func (s *Member) SetEnabledDate(v time.Time) *Member { + s.EnabledDate = &v + return s +} + +// SetId sets the Id field's value. +func (s *Member) SetId(v string) *Member { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *Member) SetName(v string) *Member { + s.Name = &v + return s +} + +// SetState sets the State field's value. +func (s *Member) SetState(v string) *Member { + s.State = &v + return s +} + +// SetType sets the Type field's value. +func (s *Member) SetType(v string) *Member { + s.Type = &v + return s +} + +// The user, group, or resource name isn't unique in Amazon WorkMail. +type NameAvailabilityException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s NameAvailabilityException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s NameAvailabilityException) GoString() string { + return s.String() +} + +func newErrorNameAvailabilityException(v protocol.ResponseMetadata) error { + return &NameAvailabilityException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s NameAvailabilityException) Code() string { + return "NameAvailabilityException" +} + +// Message returns the exception's message. +func (s NameAvailabilityException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s NameAvailabilityException) OrigErr() error { + return nil +} + +func (s NameAvailabilityException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s NameAvailabilityException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s NameAvailabilityException) RequestID() string { + return s.respMetadata.RequestID +} + +// An operation received a valid organization identifier that either doesn't +// belong or exist in the system. +type OrganizationNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s OrganizationNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationNotFoundException) GoString() string { + return s.String() +} + +func newErrorOrganizationNotFoundException(v protocol.ResponseMetadata) error { + return &OrganizationNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OrganizationNotFoundException) Code() string { + return "OrganizationNotFoundException" +} + +// Message returns the exception's message. +func (s OrganizationNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OrganizationNotFoundException) OrigErr() error { + return nil +} + +func (s OrganizationNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OrganizationNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OrganizationNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The organization must have a valid state (Active or Synchronizing) to perform +// certain operations on the organization or its members. +type OrganizationStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s OrganizationStateException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationStateException) GoString() string { + return s.String() +} + +func newErrorOrganizationStateException(v protocol.ResponseMetadata) error { + return &OrganizationStateException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OrganizationStateException) Code() string { + return "OrganizationStateException" +} + +// Message returns the exception's message. +func (s OrganizationStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OrganizationStateException) OrigErr() error { + return nil +} + +func (s OrganizationStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OrganizationStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OrganizationStateException) RequestID() string { + return s.respMetadata.RequestID +} + +// The representation of an organization. +type OrganizationSummary struct { + _ struct{} `type:"structure"` + + // The alias associated with the organization. + Alias *string `min:"1" type:"string"` + + // The error message associated with the organization. It is only present if + // unexpected behavior has occurred with regards to the organization. It provides + // insight or solutions regarding unexpected behavior. + ErrorMessage *string `type:"string"` + + // The identifier associated with the organization. + OrganizationId *string `type:"string"` + + // The state associated with the organization. + State *string `type:"string"` +} + +// String returns the string representation +func (s OrganizationSummary) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s OrganizationSummary) GoString() string { + return s.String() +} + +// SetAlias sets the Alias field's value. +func (s *OrganizationSummary) SetAlias(v string) *OrganizationSummary { + s.Alias = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *OrganizationSummary) SetErrorMessage(v string) *OrganizationSummary { + s.ErrorMessage = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *OrganizationSummary) SetOrganizationId(v string) *OrganizationSummary { + s.OrganizationId = &v + return s +} + +// SetState sets the State field's value. +func (s *OrganizationSummary) SetState(v string) *OrganizationSummary { + s.State = &v + return s +} + +// Permission granted to a user, group, or resource to access a certain aspect +// of another user, group, or resource mailbox. +type Permission struct { + _ struct{} `type:"structure"` + + // The identifier of the user, group, or resource to which the permissions are + // granted. + // + // GranteeId is a required field + GranteeId *string `min:"12" type:"string" required:"true"` + + // The type of user, group, or resource referred to in GranteeId. + // + // GranteeType is a required field + GranteeType *string `type:"string" required:"true" enum:"MemberType"` + + // The permissions granted to the grantee. SEND_AS allows the grantee to send + // email as the owner of the mailbox (the grantee is not mentioned on these + // emails). SEND_ON_BEHALF allows the grantee to send email on behalf of the + // owner of the mailbox (the grantee is not mentioned as the physical sender + // of these emails). FULL_ACCESS allows the grantee full access to the mailbox, + // irrespective of other folder-level permissions set on the mailbox. + // + // PermissionValues is a required field + PermissionValues []*string `type:"list" required:"true"` +} + +// 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() +} + +// SetGranteeId sets the GranteeId field's value. +func (s *Permission) SetGranteeId(v string) *Permission { + s.GranteeId = &v + return s +} + +// SetGranteeType sets the GranteeType field's value. +func (s *Permission) SetGranteeType(v string) *Permission { + s.GranteeType = &v + return s +} + +// SetPermissionValues sets the PermissionValues field's value. +func (s *Permission) SetPermissionValues(v []*string) *Permission { + s.PermissionValues = v + return s +} + +type PutAccessControlRuleInput struct { + _ struct{} `type:"structure"` + + // Access protocol actions to include in the rule. Valid values include ActiveSync, + // AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail. + Actions []*string `type:"list"` + + // The rule description. + // + // Description is a required field + Description *string `type:"string" required:"true"` + + // The rule effect. + // + // Effect is a required field + Effect *string `type:"string" required:"true" enum:"AccessControlRuleEffect"` + + // IPv4 CIDR ranges to include in the rule. + IpRanges []*string `type:"list"` + + // The rule name. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // Access protocol actions to exclude from the rule. Valid values include ActiveSync, + // AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail. + NotActions []*string `type:"list"` + + // IPv4 CIDR ranges to exclude from the rule. + NotIpRanges []*string `type:"list"` + + // User IDs to exclude from the rule. + NotUserIds []*string `type:"list"` + + // The identifier of the organization. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // User IDs to include in the rule. + UserIds []*string `type:"list"` +} + +// String returns the string representation +func (s PutAccessControlRuleInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutAccessControlRuleInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutAccessControlRuleInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutAccessControlRuleInput"} + if s.Description == nil { + invalidParams.Add(request.NewErrParamRequired("Description")) + } + if s.Effect == nil { + invalidParams.Add(request.NewErrParamRequired("Effect")) + } + 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.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetActions sets the Actions field's value. +func (s *PutAccessControlRuleInput) SetActions(v []*string) *PutAccessControlRuleInput { + s.Actions = v + return s +} + +// SetDescription sets the Description field's value. +func (s *PutAccessControlRuleInput) SetDescription(v string) *PutAccessControlRuleInput { + s.Description = &v + return s +} + +// SetEffect sets the Effect field's value. +func (s *PutAccessControlRuleInput) SetEffect(v string) *PutAccessControlRuleInput { + s.Effect = &v + return s +} + +// SetIpRanges sets the IpRanges field's value. +func (s *PutAccessControlRuleInput) SetIpRanges(v []*string) *PutAccessControlRuleInput { + s.IpRanges = v + return s +} + +// SetName sets the Name field's value. +func (s *PutAccessControlRuleInput) SetName(v string) *PutAccessControlRuleInput { + s.Name = &v + return s +} + +// SetNotActions sets the NotActions field's value. +func (s *PutAccessControlRuleInput) SetNotActions(v []*string) *PutAccessControlRuleInput { + s.NotActions = v + return s +} + +// SetNotIpRanges sets the NotIpRanges field's value. +func (s *PutAccessControlRuleInput) SetNotIpRanges(v []*string) *PutAccessControlRuleInput { + s.NotIpRanges = v + return s +} + +// SetNotUserIds sets the NotUserIds field's value. +func (s *PutAccessControlRuleInput) SetNotUserIds(v []*string) *PutAccessControlRuleInput { + s.NotUserIds = v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *PutAccessControlRuleInput) SetOrganizationId(v string) *PutAccessControlRuleInput { + s.OrganizationId = &v + return s +} + +// SetUserIds sets the UserIds field's value. +func (s *PutAccessControlRuleInput) SetUserIds(v []*string) *PutAccessControlRuleInput { + s.UserIds = v + return s +} + +type PutAccessControlRuleOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutAccessControlRuleOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutAccessControlRuleOutput) GoString() string { + return s.String() +} + +type PutMailboxPermissionsInput struct { + _ struct{} `type:"structure"` + + // The identifier of the user, group, or resource for which to update mailbox + // permissions. + // + // EntityId is a required field + EntityId *string `min:"12" type:"string" required:"true"` + + // The identifier of the user, group, or resource to which to grant the permissions. + // + // GranteeId is a required field + GranteeId *string `min:"12" type:"string" required:"true"` + + // The identifier of the organization under which the user, group, or resource + // exists. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // The permissions granted to the grantee. SEND_AS allows the grantee to send + // email as the owner of the mailbox (the grantee is not mentioned on these + // emails). SEND_ON_BEHALF allows the grantee to send email on behalf of the + // owner of the mailbox (the grantee is not mentioned as the physical sender + // of these emails). FULL_ACCESS allows the grantee full access to the mailbox, + // irrespective of other folder-level permissions set on the mailbox. + // + // PermissionValues is a required field + PermissionValues []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s PutMailboxPermissionsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutMailboxPermissionsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *PutMailboxPermissionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "PutMailboxPermissionsInput"} + if s.EntityId == nil { + invalidParams.Add(request.NewErrParamRequired("EntityId")) + } + if s.EntityId != nil && len(*s.EntityId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("EntityId", 12)) + } + if s.GranteeId == nil { + invalidParams.Add(request.NewErrParamRequired("GranteeId")) + } + if s.GranteeId != nil && len(*s.GranteeId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("GranteeId", 12)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + if s.PermissionValues == nil { + invalidParams.Add(request.NewErrParamRequired("PermissionValues")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEntityId sets the EntityId field's value. +func (s *PutMailboxPermissionsInput) SetEntityId(v string) *PutMailboxPermissionsInput { + s.EntityId = &v + return s +} + +// SetGranteeId sets the GranteeId field's value. +func (s *PutMailboxPermissionsInput) SetGranteeId(v string) *PutMailboxPermissionsInput { + s.GranteeId = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *PutMailboxPermissionsInput) SetOrganizationId(v string) *PutMailboxPermissionsInput { + s.OrganizationId = &v + return s +} + +// SetPermissionValues sets the PermissionValues field's value. +func (s *PutMailboxPermissionsInput) SetPermissionValues(v []*string) *PutMailboxPermissionsInput { + s.PermissionValues = v + return s +} + +type PutMailboxPermissionsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutMailboxPermissionsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutMailboxPermissionsOutput) GoString() string { + return s.String() +} + +type RegisterToWorkMailInput struct { + _ struct{} `type:"structure"` + + // The email for the user, group, or resource to be updated. + // + // Email is a required field + Email *string `min:"1" type:"string" required:"true"` + + // The identifier for the user, group, or resource to be updated. + // + // EntityId is a required field + EntityId *string `min:"12" type:"string" required:"true"` + + // The identifier for the organization under which the user, group, or resource + // exists. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s RegisterToWorkMailInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterToWorkMailInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *RegisterToWorkMailInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RegisterToWorkMailInput"} + if s.Email == nil { + invalidParams.Add(request.NewErrParamRequired("Email")) + } + if s.Email != nil && len(*s.Email) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Email", 1)) + } + if s.EntityId == nil { + invalidParams.Add(request.NewErrParamRequired("EntityId")) + } + if s.EntityId != nil && len(*s.EntityId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("EntityId", 12)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEmail sets the Email field's value. +func (s *RegisterToWorkMailInput) SetEmail(v string) *RegisterToWorkMailInput { + s.Email = &v + return s +} + +// SetEntityId sets the EntityId field's value. +func (s *RegisterToWorkMailInput) SetEntityId(v string) *RegisterToWorkMailInput { + s.EntityId = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *RegisterToWorkMailInput) SetOrganizationId(v string) *RegisterToWorkMailInput { + s.OrganizationId = &v + return s +} + +type RegisterToWorkMailOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s RegisterToWorkMailOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RegisterToWorkMailOutput) GoString() string { + return s.String() +} + +// This user, group, or resource name is not allowed in Amazon WorkMail. +type ReservedNameException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ReservedNameException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ReservedNameException) GoString() string { + return s.String() +} + +func newErrorReservedNameException(v protocol.ResponseMetadata) error { + return &ReservedNameException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ReservedNameException) Code() string { + return "ReservedNameException" +} + +// Message returns the exception's message. +func (s ReservedNameException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ReservedNameException) OrigErr() error { + return nil +} + +func (s ReservedNameException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ReservedNameException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ReservedNameException) RequestID() string { + return s.respMetadata.RequestID +} + +type ResetPasswordInput struct { + _ struct{} `type:"structure"` + + // The identifier of the organization that contains the user for which the password + // is reset. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // The new password for the user. + // + // Password is a required field + Password *string `type:"string" required:"true" sensitive:"true"` + + // The identifier of the user for whom the password is reset. + // + // UserId is a required field + UserId *string `min:"12" type:"string" required:"true"` +} + +// String returns the string representation +func (s ResetPasswordInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetPasswordInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *ResetPasswordInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ResetPasswordInput"} + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + if s.Password == nil { + invalidParams.Add(request.NewErrParamRequired("Password")) + } + if s.UserId == nil { + invalidParams.Add(request.NewErrParamRequired("UserId")) + } + if s.UserId != nil && len(*s.UserId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("UserId", 12)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *ResetPasswordInput) SetOrganizationId(v string) *ResetPasswordInput { + s.OrganizationId = &v + return s +} + +// SetPassword sets the Password field's value. +func (s *ResetPasswordInput) SetPassword(v string) *ResetPasswordInput { + s.Password = &v + return s +} + +// SetUserId sets the UserId field's value. +func (s *ResetPasswordInput) SetUserId(v string) *ResetPasswordInput { + s.UserId = &v + return s +} + +type ResetPasswordOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ResetPasswordOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResetPasswordOutput) GoString() string { + return s.String() +} + +// The representation of a resource. +type Resource struct { + _ struct{} `type:"structure"` + + // The date indicating when the resource was disabled from Amazon WorkMail use. + DisabledDate *time.Time `type:"timestamp"` + + // The email of the resource. + Email *string `min:"1" type:"string"` + + // The date indicating when the resource was enabled for Amazon WorkMail use. + EnabledDate *time.Time `type:"timestamp"` + + // The identifier of the resource. + Id *string `min:"12" type:"string"` + + // The name of the resource. + Name *string `min:"1" type:"string"` + + // The state of the resource, which can be ENABLED, DISABLED, or DELETED. + State *string `type:"string" enum:"EntityState"` + + // The type of the resource: equipment or room. + Type *string `type:"string" enum:"ResourceType"` +} + +// 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() +} + +// SetDisabledDate sets the DisabledDate field's value. +func (s *Resource) SetDisabledDate(v time.Time) *Resource { + s.DisabledDate = &v + return s +} + +// SetEmail sets the Email field's value. +func (s *Resource) SetEmail(v string) *Resource { + s.Email = &v + return s +} + +// SetEnabledDate sets the EnabledDate field's value. +func (s *Resource) SetEnabledDate(v time.Time) *Resource { + s.EnabledDate = &v + return s +} + +// SetId sets the Id field's value. +func (s *Resource) SetId(v string) *Resource { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *Resource) SetName(v string) *Resource { + s.Name = &v + return s +} + +// SetState sets the State field's value. +func (s *Resource) SetState(v string) *Resource { + s.State = &v + return s +} + +// SetType sets the Type field's value. +func (s *Resource) SetType(v string) *Resource { + s.Type = &v + return s +} + +// The resource cannot be found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ResourceNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ResourceNotFoundException) GoString() string { + return s.String() +} + +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { + return nil +} + +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// Describes a tag applied to a resource. +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 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 +} + +type TagResourceInput struct { + _ struct{} `type:"structure"` + + // The resource ARN. + // + // ResourceARN is a required field + ResourceARN *string `min:"1" type:"string" required:"true"` + + // The tag key-value pairs. + // + // 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 +} + +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 resource can have up to 50 user-applied tags. +type TooManyTagsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s TooManyTagsException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s TooManyTagsException) GoString() string { + return s.String() +} + +func newErrorTooManyTagsException(v protocol.ResponseMetadata) error { + return &TooManyTagsException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s TooManyTagsException) Code() string { + return "TooManyTagsException" +} + +// Message returns the exception's message. +func (s TooManyTagsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s TooManyTagsException) OrigErr() error { + return nil +} + +func (s TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s TooManyTagsException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s TooManyTagsException) RequestID() string { + return s.respMetadata.RequestID +} + +// You can't perform a write operation against a read-only directory. +type UnsupportedOperationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedOperationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedOperationException) GoString() string { + return s.String() +} + +func newErrorUnsupportedOperationException(v protocol.ResponseMetadata) error { + return &UnsupportedOperationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedOperationException) Code() string { + return "UnsupportedOperationException" +} + +// Message returns the exception's message. +func (s UnsupportedOperationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedOperationException) OrigErr() error { + return nil +} + +func (s UnsupportedOperationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedOperationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedOperationException) RequestID() string { + return s.respMetadata.RequestID +} + +type UntagResourceInput struct { + _ struct{} `type:"structure"` + + // The resource ARN. + // + // ResourceARN is a required field + ResourceARN *string `min:"1" type:"string" required:"true"` + + // The tag keys. + // + // 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 +} + +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() +} + +type UpdateMailboxQuotaInput struct { + _ struct{} `type:"structure"` + + // The updated mailbox quota, in MB, for the specified user. + // + // MailboxQuota is a required field + MailboxQuota *int64 `min:"1" type:"integer" required:"true"` + + // The identifier for the organization that contains the user for whom to update + // the mailbox quota. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // The identifer for the user for whom to update the mailbox quota. + // + // UserId is a required field + UserId *string `min:"12" type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdateMailboxQuotaInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateMailboxQuotaInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdateMailboxQuotaInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdateMailboxQuotaInput"} + if s.MailboxQuota == nil { + invalidParams.Add(request.NewErrParamRequired("MailboxQuota")) + } + if s.MailboxQuota != nil && *s.MailboxQuota < 1 { + invalidParams.Add(request.NewErrParamMinValue("MailboxQuota", 1)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + if s.UserId == nil { + invalidParams.Add(request.NewErrParamRequired("UserId")) + } + if s.UserId != nil && len(*s.UserId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("UserId", 12)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetMailboxQuota sets the MailboxQuota field's value. +func (s *UpdateMailboxQuotaInput) SetMailboxQuota(v int64) *UpdateMailboxQuotaInput { + s.MailboxQuota = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *UpdateMailboxQuotaInput) SetOrganizationId(v string) *UpdateMailboxQuotaInput { + s.OrganizationId = &v + return s +} + +// SetUserId sets the UserId field's value. +func (s *UpdateMailboxQuotaInput) SetUserId(v string) *UpdateMailboxQuotaInput { + s.UserId = &v + return s +} + +type UpdateMailboxQuotaOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateMailboxQuotaOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateMailboxQuotaOutput) GoString() string { + return s.String() +} + +type UpdatePrimaryEmailAddressInput struct { + _ struct{} `type:"structure"` + + // The value of the email to be updated as primary. + // + // Email is a required field + Email *string `min:"1" type:"string" required:"true"` + + // The user, group, or resource to update. + // + // EntityId is a required field + EntityId *string `min:"12" type:"string" required:"true"` + + // The organization that contains the user, group, or resource to update. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` +} + +// String returns the string representation +func (s UpdatePrimaryEmailAddressInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdatePrimaryEmailAddressInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *UpdatePrimaryEmailAddressInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "UpdatePrimaryEmailAddressInput"} + if s.Email == nil { + invalidParams.Add(request.NewErrParamRequired("Email")) + } + if s.Email != nil && len(*s.Email) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Email", 1)) + } + if s.EntityId == nil { + invalidParams.Add(request.NewErrParamRequired("EntityId")) + } + if s.EntityId != nil && len(*s.EntityId) < 12 { + invalidParams.Add(request.NewErrParamMinLen("EntityId", 12)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetEmail sets the Email field's value. +func (s *UpdatePrimaryEmailAddressInput) SetEmail(v string) *UpdatePrimaryEmailAddressInput { + s.Email = &v + return s +} + +// SetEntityId sets the EntityId field's value. +func (s *UpdatePrimaryEmailAddressInput) SetEntityId(v string) *UpdatePrimaryEmailAddressInput { + s.EntityId = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *UpdatePrimaryEmailAddressInput) SetOrganizationId(v string) *UpdatePrimaryEmailAddressInput { + s.OrganizationId = &v + return s +} + +type UpdatePrimaryEmailAddressOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdatePrimaryEmailAddressOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdatePrimaryEmailAddressOutput) GoString() string { + return s.String() +} + +type UpdateResourceInput struct { + _ struct{} `type:"structure"` + + // The resource's booking options to be updated. + BookingOptions *BookingOptions `type:"structure"` + + // The name of the resource to be updated. + Name *string `min:"1" type:"string"` + + // The identifier associated with the organization for which the resource is + // updated. + // + // OrganizationId is a required field + OrganizationId *string `type:"string" required:"true"` + + // The identifier of the resource to be updated. + // + // ResourceId is a required field + ResourceId *string `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.Name != nil && len(*s.Name) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.OrganizationId == nil { + invalidParams.Add(request.NewErrParamRequired("OrganizationId")) + } + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetBookingOptions sets the BookingOptions field's value. +func (s *UpdateResourceInput) SetBookingOptions(v *BookingOptions) *UpdateResourceInput { + s.BookingOptions = v + return s +} + +// SetName sets the Name field's value. +func (s *UpdateResourceInput) SetName(v string) *UpdateResourceInput { + s.Name = &v + return s +} + +// SetOrganizationId sets the OrganizationId field's value. +func (s *UpdateResourceInput) SetOrganizationId(v string) *UpdateResourceInput { + s.OrganizationId = &v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *UpdateResourceInput) SetResourceId(v string) *UpdateResourceInput { + s.ResourceId = &v + return s +} + +type UpdateResourceOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s UpdateResourceOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UpdateResourceOutput) GoString() string { + return s.String() +} + +// The representation of an Amazon WorkMail user. +type User struct { + _ struct{} `type:"structure"` + + // The date indicating when the user was disabled from Amazon WorkMail use. + DisabledDate *time.Time `type:"timestamp"` + + // The display name of the user. + DisplayName *string `type:"string"` + + // The email of the user. + Email *string `min:"1" type:"string"` + + // The date indicating when the user was enabled for Amazon WorkMail use. + EnabledDate *time.Time `type:"timestamp"` + + // The identifier of the user. + Id *string `min:"12" type:"string"` + + // The name of the user. + Name *string `min:"1" type:"string"` + + // The state of the user, which can be ENABLED, DISABLED, or DELETED. + State *string `type:"string" enum:"EntityState"` + + // The role of the user. + UserRole *string `type:"string" enum:"UserRole"` +} + +// 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() +} + +// SetDisabledDate sets the DisabledDate field's value. +func (s *User) SetDisabledDate(v time.Time) *User { + s.DisabledDate = &v + return s +} + +// SetDisplayName sets the DisplayName field's value. +func (s *User) SetDisplayName(v string) *User { + s.DisplayName = &v + return s +} + +// SetEmail sets the Email field's value. +func (s *User) SetEmail(v string) *User { + s.Email = &v + return s +} + +// SetEnabledDate sets the EnabledDate field's value. +func (s *User) SetEnabledDate(v time.Time) *User { + s.EnabledDate = &v + return s +} + +// SetId sets the Id field's value. +func (s *User) SetId(v string) *User { + s.Id = &v + return s +} + +// SetName sets the Name field's value. +func (s *User) SetName(v string) *User { + s.Name = &v + return s +} + +// SetState sets the State field's value. +func (s *User) SetState(v string) *User { + s.State = &v + return s +} + +// SetUserRole sets the UserRole field's value. +func (s *User) SetUserRole(v string) *User { + s.UserRole = &v + return s +} + +const ( + // AccessControlRuleEffectAllow is a AccessControlRuleEffect enum value + AccessControlRuleEffectAllow = "ALLOW" + + // AccessControlRuleEffectDeny is a AccessControlRuleEffect enum value + AccessControlRuleEffectDeny = "DENY" +) + +const ( + // EntityStateEnabled is a EntityState enum value + EntityStateEnabled = "ENABLED" + + // EntityStateDisabled is a EntityState enum value + EntityStateDisabled = "DISABLED" + + // EntityStateDeleted is a EntityState enum value + EntityStateDeleted = "DELETED" +) + +const ( + // MemberTypeGroup is a MemberType enum value + MemberTypeGroup = "GROUP" + + // MemberTypeUser is a MemberType enum value + MemberTypeUser = "USER" +) + +const ( + // PermissionTypeFullAccess is a PermissionType enum value + PermissionTypeFullAccess = "FULL_ACCESS" + + // PermissionTypeSendAs is a PermissionType enum value + PermissionTypeSendAs = "SEND_AS" + + // PermissionTypeSendOnBehalf is a PermissionType enum value + PermissionTypeSendOnBehalf = "SEND_ON_BEHALF" +) + +const ( + // ResourceTypeRoom is a ResourceType enum value + ResourceTypeRoom = "ROOM" + + // ResourceTypeEquipment is a ResourceType enum value + ResourceTypeEquipment = "EQUIPMENT" +) + +const ( + // UserRoleUser is a UserRole enum value + UserRoleUser = "USER" + + // UserRoleResource is a UserRole enum value + UserRoleResource = "RESOURCE" + + // UserRoleSystemUser is a UserRole enum value + UserRoleSystemUser = "SYSTEM_USER" +) diff --git a/vendor/github.com/aws/aws-sdk-go/service/workmail/doc.go b/vendor/github.com/aws/aws-sdk-go/service/workmail/doc.go new file mode 100644 index 00000000000..19651a78dc6 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/workmail/doc.go @@ -0,0 +1,54 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +// Package workmail provides the client and types for making API +// requests to Amazon WorkMail. +// +// Amazon WorkMail is a secure, managed business email and calendaring service +// with support for existing desktop and mobile email clients. You can access +// your email, contacts, and calendars using Microsoft Outlook, your browser, +// or other native iOS and Android email applications. You can integrate WorkMail +// with your existing corporate directory and control both the keys that encrypt +// your data and the location in which your data is stored. +// +// The WorkMail API is designed for the following scenarios: +// +// * Listing and describing organizations +// +// * Managing users +// +// * Managing groups +// +// * Managing resources +// +// All WorkMail API operations are Amazon-authenticated and certificate-signed. +// They not only require the use of the AWS SDK, but also allow for the exclusive +// use of AWS Identity and Access Management users and roles to help facilitate +// access, trust, and permission policies. By creating a role and allowing an +// IAM user to access the WorkMail site, the IAM user gains full administrative +// visibility into the entire WorkMail organization (or as set in the IAM policy). +// This includes, but is not limited to, the ability to create, update, and +// delete users, groups, and resources. This allows developers to perform the +// scenarios listed above, as well as give users the ability to grant access +// on a selective basis using the IAM model. +// +// See https://docs.aws.amazon.com/goto/WebAPI/workmail-2017-10-01 for more information on this service. +// +// See workmail package documentation for more information. +// https://docs.aws.amazon.com/sdk-for-go/api/service/workmail/ +// +// Using the Client +// +// To contact Amazon WorkMail 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 WorkMail client WorkMail for more +// information on creating client for this service. +// https://docs.aws.amazon.com/sdk-for-go/api/service/workmail/#New +package workmail diff --git a/vendor/github.com/aws/aws-sdk-go/service/workmail/errors.go b/vendor/github.com/aws/aws-sdk-go/service/workmail/errors.go new file mode 100644 index 00000000000..1008704cc58 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/workmail/errors.go @@ -0,0 +1,156 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package workmail + +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + +const ( + + // ErrCodeDirectoryServiceAuthenticationFailedException for service response error code + // "DirectoryServiceAuthenticationFailedException". + // + // The directory service doesn't recognize the credentials supplied by WorkMail. + ErrCodeDirectoryServiceAuthenticationFailedException = "DirectoryServiceAuthenticationFailedException" + + // ErrCodeDirectoryUnavailableException for service response error code + // "DirectoryUnavailableException". + // + // The directory on which you are trying to perform operations isn't available. + ErrCodeDirectoryUnavailableException = "DirectoryUnavailableException" + + // ErrCodeEmailAddressInUseException for service response error code + // "EmailAddressInUseException". + // + // The email address that you're trying to assign is already created for a different + // user, group, or resource. + ErrCodeEmailAddressInUseException = "EmailAddressInUseException" + + // ErrCodeEntityAlreadyRegisteredException for service response error code + // "EntityAlreadyRegisteredException". + // + // The user, group, or resource that you're trying to register is already registered. + ErrCodeEntityAlreadyRegisteredException = "EntityAlreadyRegisteredException" + + // ErrCodeEntityNotFoundException for service response error code + // "EntityNotFoundException". + // + // The identifier supplied for the user, group, or resource does not exist in + // your organization. + ErrCodeEntityNotFoundException = "EntityNotFoundException" + + // ErrCodeEntityStateException for service response error code + // "EntityStateException". + // + // You are performing an operation on a user, group, or resource that isn't + // in the expected state, such as trying to delete an active user. + ErrCodeEntityStateException = "EntityStateException" + + // ErrCodeInvalidConfigurationException for service response error code + // "InvalidConfigurationException". + // + // The configuration for a resource isn't valid. A resource must either be able + // to auto-respond to requests or have at least one delegate associated that + // can do so on its behalf. + ErrCodeInvalidConfigurationException = "InvalidConfigurationException" + + // ErrCodeInvalidParameterException for service response error code + // "InvalidParameterException". + // + // One or more of the input parameters don't match the service's restrictions. + ErrCodeInvalidParameterException = "InvalidParameterException" + + // ErrCodeInvalidPasswordException for service response error code + // "InvalidPasswordException". + // + // The supplied password doesn't match the minimum security constraints, such + // as length or use of special characters. + ErrCodeInvalidPasswordException = "InvalidPasswordException" + + // ErrCodeLimitExceededException for service response error code + // "LimitExceededException". + // + // The request exceeds the limit of the resource. + ErrCodeLimitExceededException = "LimitExceededException" + + // ErrCodeMailDomainNotFoundException for service response error code + // "MailDomainNotFoundException". + // + // For an email or alias to be created in Amazon WorkMail, the included domain + // must be defined in the organization. + ErrCodeMailDomainNotFoundException = "MailDomainNotFoundException" + + // ErrCodeMailDomainStateException for service response error code + // "MailDomainStateException". + // + // After a domain has been added to the organization, it must be verified. The + // domain is not yet verified. + ErrCodeMailDomainStateException = "MailDomainStateException" + + // ErrCodeNameAvailabilityException for service response error code + // "NameAvailabilityException". + // + // The user, group, or resource name isn't unique in Amazon WorkMail. + ErrCodeNameAvailabilityException = "NameAvailabilityException" + + // ErrCodeOrganizationNotFoundException for service response error code + // "OrganizationNotFoundException". + // + // An operation received a valid organization identifier that either doesn't + // belong or exist in the system. + ErrCodeOrganizationNotFoundException = "OrganizationNotFoundException" + + // ErrCodeOrganizationStateException for service response error code + // "OrganizationStateException". + // + // The organization must have a valid state (Active or Synchronizing) to perform + // certain operations on the organization or its members. + ErrCodeOrganizationStateException = "OrganizationStateException" + + // ErrCodeReservedNameException for service response error code + // "ReservedNameException". + // + // This user, group, or resource name is not allowed in Amazon WorkMail. + ErrCodeReservedNameException = "ReservedNameException" + + // ErrCodeResourceNotFoundException for service response error code + // "ResourceNotFoundException". + // + // The resource cannot be found. + ErrCodeResourceNotFoundException = "ResourceNotFoundException" + + // ErrCodeTooManyTagsException for service response error code + // "TooManyTagsException". + // + // The resource can have up to 50 user-applied tags. + ErrCodeTooManyTagsException = "TooManyTagsException" + + // ErrCodeUnsupportedOperationException for service response error code + // "UnsupportedOperationException". + // + // You can't perform a write operation against a read-only directory. + ErrCodeUnsupportedOperationException = "UnsupportedOperationException" +) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "DirectoryServiceAuthenticationFailedException": newErrorDirectoryServiceAuthenticationFailedException, + "DirectoryUnavailableException": newErrorDirectoryUnavailableException, + "EmailAddressInUseException": newErrorEmailAddressInUseException, + "EntityAlreadyRegisteredException": newErrorEntityAlreadyRegisteredException, + "EntityNotFoundException": newErrorEntityNotFoundException, + "EntityStateException": newErrorEntityStateException, + "InvalidConfigurationException": newErrorInvalidConfigurationException, + "InvalidParameterException": newErrorInvalidParameterException, + "InvalidPasswordException": newErrorInvalidPasswordException, + "LimitExceededException": newErrorLimitExceededException, + "MailDomainNotFoundException": newErrorMailDomainNotFoundException, + "MailDomainStateException": newErrorMailDomainStateException, + "NameAvailabilityException": newErrorNameAvailabilityException, + "OrganizationNotFoundException": newErrorOrganizationNotFoundException, + "OrganizationStateException": newErrorOrganizationStateException, + "ReservedNameException": newErrorReservedNameException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "TooManyTagsException": newErrorTooManyTagsException, + "UnsupportedOperationException": newErrorUnsupportedOperationException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/workmail/service.go b/vendor/github.com/aws/aws-sdk-go/service/workmail/service.go new file mode 100644 index 00000000000..f814d622253 --- /dev/null +++ b/vendor/github.com/aws/aws-sdk-go/service/workmail/service.go @@ -0,0 +1,103 @@ +// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. + +package workmail + +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" + "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" +) + +// WorkMail provides the API operation methods for making requests to +// Amazon WorkMail. See this package's package overview docs +// for details on the service. +// +// WorkMail methods are safe to use concurrently. It is not safe to +// modify mutate any of the struct's properties though. +type WorkMail 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 = "workmail" // Name of service. + EndpointsID = ServiceName // ID to lookup a service endpoint with. + ServiceID = "WorkMail" // ServiceID is a unique identifier of a specific service. +) + +// New creates a new instance of the WorkMail client with a session. +// If additional configuration is needed for the client instance use the optional +// aws.Config parameter to add your extra config. +// +// Example: +// mySession := session.Must(session.NewSession()) +// +// // Create a WorkMail client from just a session. +// svc := workmail.New(mySession) +// +// // Create a WorkMail client with additional configuration +// svc := workmail.New(mySession, aws.NewConfig().WithRegion("us-west-2")) +func New(p client.ConfigProvider, cfgs ...*aws.Config) *WorkMail { + c := p.ClientConfig(EndpointsID, cfgs...) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) +} + +// newClient creates, initializes and returns a new service client instance. +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *WorkMail { + svc := &WorkMail{ + Client: client.New( + cfg, + metadata.ClientInfo{ + ServiceName: ServiceName, + ServiceID: ServiceID, + SigningName: signingName, + SigningRegion: signingRegion, + PartitionID: partitionID, + Endpoint: endpoint, + APIVersion: "2017-10-01", + JSONVersion: "1.1", + TargetPrefix: "WorkMailService", + }, + 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( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) + + // Run custom client initialization if present + if initClient != nil { + initClient(svc.Client) + } + + return svc +} + +// newRequest creates a new request for a WorkMail operation and runs any +// custom request initialization. +func (c *WorkMail) 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/workspaces/api.go b/vendor/github.com/aws/aws-sdk-go/service/workspaces/api.go index d48d30c8b8d..5ec35c9e415 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/workspaces/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/workspaces/api.go @@ -67,23 +67,23 @@ func (c *WorkSpaces) AssociateIpGroupsRequest(input *AssociateIpGroupsInput) (re // See the AWS API reference guide for Amazon WorkSpaces's // API operation AssociateIpGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource could not be found. // -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" +// * ResourceLimitExceededException // Your resource limits have been exceeded. // -// * ErrCodeInvalidResourceStateException "InvalidResourceStateException" +// * InvalidResourceStateException // The state of the resource is not valid for this operation. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // The user is not authorized to access a resource. // -// * ErrCodeOperationNotSupportedException "OperationNotSupportedException" +// * OperationNotSupportedException // This operation is not supported. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/AssociateIpGroups @@ -165,20 +165,20 @@ func (c *WorkSpaces) AuthorizeIpRulesRequest(input *AuthorizeIpRulesInput) (req // See the AWS API reference guide for Amazon WorkSpaces's // API operation AuthorizeIpRules for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource could not be found. // -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" +// * ResourceLimitExceededException // Your resource limits have been exceeded. // -// * ErrCodeInvalidResourceStateException "InvalidResourceStateException" +// * InvalidResourceStateException // The state of the resource is not valid for this operation. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // The user is not authorized to access a resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/AuthorizeIpRules @@ -256,26 +256,26 @@ func (c *WorkSpaces) CopyWorkspaceImageRequest(input *CopyWorkspaceImageInput) ( // See the AWS API reference guide for Amazon WorkSpaces's // API operation CopyWorkspaceImage for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" +// Returned Error Types: +// * ResourceLimitExceededException // Your resource limits have been exceeded. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource could not be found. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" +// * ResourceUnavailableException // The specified resource is not available. // -// * ErrCodeOperationNotSupportedException "OperationNotSupportedException" +// * OperationNotSupportedException // This operation is not supported. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // The user is not authorized to access a resource. // -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// * InvalidParameterValuesException // One or more parameter values are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CopyWorkspaceImage @@ -365,20 +365,20 @@ func (c *WorkSpaces) CreateIpGroupRequest(input *CreateIpGroupInput) (req *reque // See the AWS API reference guide for Amazon WorkSpaces's // API operation CreateIpGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" +// * ResourceLimitExceededException // Your resource limits have been exceeded. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeResourceCreationFailedException "ResourceCreationFailedException" +// * ResourceCreationFailedException // The resource could not be created. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // The user is not authorized to access a resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CreateIpGroup @@ -457,14 +457,14 @@ func (c *WorkSpaces) CreateTagsRequest(input *CreateTagsInput) (req *request.Req // See the AWS API reference guide for Amazon WorkSpaces's // API operation CreateTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The resource could not be found. // -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// * InvalidParameterValuesException // One or more parameter values are not valid. // -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" +// * ResourceLimitExceededException // Your resource limits have been exceeded. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CreateTags @@ -544,11 +544,11 @@ func (c *WorkSpaces) CreateWorkspacesRequest(input *CreateWorkspacesInput) (req // See the AWS API reference guide for Amazon WorkSpaces's // API operation CreateWorkspaces for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" +// Returned Error Types: +// * ResourceLimitExceededException // Your resource limits have been exceeded. // -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// * InvalidParameterValuesException // One or more parameter values are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/CreateWorkspaces @@ -629,17 +629,17 @@ func (c *WorkSpaces) DeleteIpGroupRequest(input *DeleteIpGroupInput) (req *reque // See the AWS API reference guide for Amazon WorkSpaces's // API operation DeleteIpGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource could not be found. // -// * ErrCodeResourceAssociatedException "ResourceAssociatedException" +// * ResourceAssociatedException // The resource is associated with a directory. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // The user is not authorized to access a resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeleteIpGroup @@ -718,11 +718,11 @@ func (c *WorkSpaces) DeleteTagsRequest(input *DeleteTagsInput) (req *request.Req // See the AWS API reference guide for Amazon WorkSpaces's // API operation DeleteTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The resource could not be found. // -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// * InvalidParameterValuesException // One or more parameter values are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeleteTags @@ -803,14 +803,14 @@ func (c *WorkSpaces) DeleteWorkspaceImageRequest(input *DeleteWorkspaceImageInpu // See the AWS API reference guide for Amazon WorkSpaces's // API operation DeleteWorkspaceImage for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceAssociatedException "ResourceAssociatedException" +// Returned Error Types: +// * ResourceAssociatedException // The resource is associated with a directory. // -// * ErrCodeInvalidResourceStateException "InvalidResourceStateException" +// * InvalidResourceStateException // The state of the resource is not valid for this operation. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // The user is not authorized to access a resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeleteWorkspaceImage @@ -835,6 +835,100 @@ func (c *WorkSpaces) DeleteWorkspaceImageWithContext(ctx aws.Context, input *Del return out, req.Send() } +const opDeregisterWorkspaceDirectory = "DeregisterWorkspaceDirectory" + +// DeregisterWorkspaceDirectoryRequest generates a "aws/request.Request" representing the +// client's request for the DeregisterWorkspaceDirectory operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See DeregisterWorkspaceDirectory for more information on using the DeregisterWorkspaceDirectory +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the DeregisterWorkspaceDirectoryRequest method. +// req, resp := client.DeregisterWorkspaceDirectoryRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeregisterWorkspaceDirectory +func (c *WorkSpaces) DeregisterWorkspaceDirectoryRequest(input *DeregisterWorkspaceDirectoryInput) (req *request.Request, output *DeregisterWorkspaceDirectoryOutput) { + op := &request.Operation{ + Name: opDeregisterWorkspaceDirectory, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &DeregisterWorkspaceDirectoryInput{} + } + + output = &DeregisterWorkspaceDirectoryOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// DeregisterWorkspaceDirectory API operation for Amazon WorkSpaces. +// +// Deregisters the specified directory. This operation is asynchronous and returns +// before the WorkSpace directory is deregistered. If any WorkSpaces are registered +// to this directory, you must remove them before you can deregister 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 Amazon WorkSpaces's +// API operation DeregisterWorkspaceDirectory for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// The user is not authorized to access a resource. +// +// * InvalidParameterValuesException +// One or more parameter values are not valid. +// +// * OperationNotSupportedException +// This operation is not supported. +// +// * ResourceNotFoundException +// The resource could not be found. +// +// * InvalidResourceStateException +// The state of the resource is not valid for this operation. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DeregisterWorkspaceDirectory +func (c *WorkSpaces) DeregisterWorkspaceDirectory(input *DeregisterWorkspaceDirectoryInput) (*DeregisterWorkspaceDirectoryOutput, error) { + req, out := c.DeregisterWorkspaceDirectoryRequest(input) + return out, req.Send() +} + +// DeregisterWorkspaceDirectoryWithContext is the same as DeregisterWorkspaceDirectory with the addition of +// the ability to pass a context and additional request options. +// +// See DeregisterWorkspaceDirectory for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkSpaces) DeregisterWorkspaceDirectoryWithContext(ctx aws.Context, input *DeregisterWorkspaceDirectoryInput, opts ...request.Option) (*DeregisterWorkspaceDirectoryOutput, error) { + req, out := c.DeregisterWorkspaceDirectoryRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opDescribeAccount = "DescribeAccount" // DescribeAccountRequest generates a "aws/request.Request" representing the @@ -879,7 +973,7 @@ func (c *WorkSpaces) DescribeAccountRequest(input *DescribeAccountInput) (req *r // DescribeAccount API operation for Amazon WorkSpaces. // -// Retrieves a list that describes the configuration of bring your own license +// Retrieves a list that describes the configuration of Bring Your Own License // (BYOL) for the specified account. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -889,8 +983,8 @@ func (c *WorkSpaces) DescribeAccountRequest(input *DescribeAccountInput) (req *r // See the AWS API reference guide for Amazon WorkSpaces's // API operation DescribeAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // The user is not authorized to access a resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeAccount @@ -959,8 +1053,8 @@ func (c *WorkSpaces) DescribeAccountModificationsRequest(input *DescribeAccountM // DescribeAccountModifications API operation for Amazon WorkSpaces. // -// Retrieves a list that describes modifications to the configuration of bring -// your own license (BYOL) for the specified account. +// Retrieves a list that describes modifications to the configuration of Bring +// Your Own License (BYOL) for the specified 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 @@ -969,8 +1063,8 @@ func (c *WorkSpaces) DescribeAccountModificationsRequest(input *DescribeAccountM // See the AWS API reference guide for Amazon WorkSpaces's // API operation DescribeAccountModifications for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // The user is not authorized to access a resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeAccountModifications @@ -1048,14 +1142,14 @@ func (c *WorkSpaces) DescribeClientPropertiesRequest(input *DescribeClientProper // See the AWS API reference guide for Amazon WorkSpaces's // API operation DescribeClientProperties for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource could not be found. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // The user is not authorized to access a resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeClientProperties @@ -1133,11 +1227,11 @@ func (c *WorkSpaces) DescribeIpGroupsRequest(input *DescribeIpGroupsInput) (req // See the AWS API reference guide for Amazon WorkSpaces's // API operation DescribeIpGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // The user is not authorized to access a resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeIpGroups @@ -1215,8 +1309,8 @@ func (c *WorkSpaces) DescribeTagsRequest(input *DescribeTagsInput) (req *request // See the AWS API reference guide for Amazon WorkSpaces's // API operation DescribeTags for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeTags @@ -1302,8 +1396,8 @@ func (c *WorkSpaces) DescribeWorkspaceBundlesRequest(input *DescribeWorkspaceBun // See the AWS API reference guide for Amazon WorkSpaces's // API operation DescribeWorkspaceBundles for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceBundles @@ -1371,10 +1465,12 @@ func (c *WorkSpaces) DescribeWorkspaceBundlesPagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeWorkspaceBundlesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeWorkspaceBundlesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1428,8 +1524,7 @@ func (c *WorkSpaces) DescribeWorkspaceDirectoriesRequest(input *DescribeWorkspac // DescribeWorkspaceDirectories API operation for Amazon WorkSpaces. // -// Describes the available AWS Directory Service directories that are registered -// with Amazon WorkSpaces. +// Describes the available directories that are registered with Amazon WorkSpaces. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1438,8 +1533,8 @@ func (c *WorkSpaces) DescribeWorkspaceDirectoriesRequest(input *DescribeWorkspac // See the AWS API reference guide for Amazon WorkSpaces's // API operation DescribeWorkspaceDirectories for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceDirectories @@ -1507,10 +1602,12 @@ func (c *WorkSpaces) DescribeWorkspaceDirectoriesPagesWithContext(ctx aws.Contex }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeWorkspaceDirectoriesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeWorkspaceDirectoriesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1568,8 +1665,8 @@ func (c *WorkSpaces) DescribeWorkspaceImagesRequest(input *DescribeWorkspaceImag // See the AWS API reference guide for Amazon WorkSpaces's // API operation DescribeWorkspaceImages for usage and error information. // -// Returned Error Codes: -// * ErrCodeAccessDeniedException "AccessDeniedException" +// Returned Error Types: +// * AccessDeniedException // The user is not authorized to access a resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceImages @@ -1647,14 +1744,14 @@ func (c *WorkSpaces) DescribeWorkspaceSnapshotsRequest(input *DescribeWorkspaceS // See the AWS API reference guide for Amazon WorkSpaces's // API operation DescribeWorkspaceSnapshots for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource could not be found. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // The user is not authorized to access a resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaceSnapshots @@ -1741,11 +1838,11 @@ func (c *WorkSpaces) DescribeWorkspacesRequest(input *DescribeWorkspacesInput) ( // See the AWS API reference guide for Amazon WorkSpaces's // API operation DescribeWorkspaces for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" +// * ResourceUnavailableException // The specified resource is not available. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspaces @@ -1813,10 +1910,12 @@ func (c *WorkSpaces) DescribeWorkspacesPagesWithContext(ctx aws.Context, input * }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*DescribeWorkspacesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*DescribeWorkspacesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1873,8 +1972,8 @@ func (c *WorkSpaces) DescribeWorkspacesConnectionStatusRequest(input *DescribeWo // See the AWS API reference guide for Amazon WorkSpaces's // API operation DescribeWorkspacesConnectionStatus for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DescribeWorkspacesConnectionStatus @@ -1953,17 +2052,17 @@ func (c *WorkSpaces) DisassociateIpGroupsRequest(input *DisassociateIpGroupsInpu // See the AWS API reference guide for Amazon WorkSpaces's // API operation DisassociateIpGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource could not be found. // -// * ErrCodeInvalidResourceStateException "InvalidResourceStateException" +// * InvalidResourceStateException // The state of the resource is not valid for this operation. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // The user is not authorized to access a resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/DisassociateIpGroups @@ -2032,7 +2131,7 @@ func (c *WorkSpaces) ImportWorkspaceImageRequest(input *ImportWorkspaceImageInpu // ImportWorkspaceImage API operation for Amazon WorkSpaces. // -// Imports the specified Windows 7 or Windows 10 bring your own license (BYOL) +// Imports the specified Windows 7 or Windows 10 Bring Your Own License (BYOL) // image into Amazon WorkSpaces. The image must be an already licensed EC2 image // that is in your AWS account, and you must own the image. // @@ -2043,23 +2142,23 @@ func (c *WorkSpaces) ImportWorkspaceImageRequest(input *ImportWorkspaceImageInpu // See the AWS API reference guide for Amazon WorkSpaces's // API operation ImportWorkspaceImage for usage and error information. // -// Returned Error Codes: -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" +// Returned Error Types: +// * ResourceLimitExceededException // Your resource limits have been exceeded. // -// * ErrCodeResourceAlreadyExistsException "ResourceAlreadyExistsException" +// * ResourceAlreadyExistsException // The specified resource already exists. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource could not be found. // -// * ErrCodeOperationNotSupportedException "OperationNotSupportedException" +// * OperationNotSupportedException // This operation is not supported. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // The user is not authorized to access a resource. // -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// * InvalidParameterValuesException // One or more parameter values are not valid. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ImportWorkspaceImage @@ -2129,8 +2228,8 @@ func (c *WorkSpaces) ListAvailableManagementCidrRangesRequest(input *ListAvailab // ListAvailableManagementCidrRanges API operation for Amazon WorkSpaces. // // Retrieves a list of IP address ranges, specified as IPv4 CIDR blocks, that -// you can use for the network management interface when you enable bring your -// own license (BYOL). +// you can use for the network management interface when you enable Bring Your +// Own License (BYOL). // // The management network interface is connected to a secure Amazon WorkSpaces // management network. It is used for interactive streaming of the WorkSpace @@ -2144,11 +2243,11 @@ func (c *WorkSpaces) ListAvailableManagementCidrRangesRequest(input *ListAvailab // See the AWS API reference guide for Amazon WorkSpaces's // API operation ListAvailableManagementCidrRanges for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // The user is not authorized to access a resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ListAvailableManagementCidrRanges @@ -2173,6 +2272,112 @@ func (c *WorkSpaces) ListAvailableManagementCidrRangesWithContext(ctx aws.Contex return out, req.Send() } +const opMigrateWorkspace = "MigrateWorkspace" + +// MigrateWorkspaceRequest generates a "aws/request.Request" representing the +// client's request for the MigrateWorkspace operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See MigrateWorkspace for more information on using the MigrateWorkspace +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the MigrateWorkspaceRequest method. +// req, resp := client.MigrateWorkspaceRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/MigrateWorkspace +func (c *WorkSpaces) MigrateWorkspaceRequest(input *MigrateWorkspaceInput) (req *request.Request, output *MigrateWorkspaceOutput) { + op := &request.Operation{ + Name: opMigrateWorkspace, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &MigrateWorkspaceInput{} + } + + output = &MigrateWorkspaceOutput{} + req = c.newRequest(op, input, output) + return +} + +// MigrateWorkspace API operation for Amazon WorkSpaces. +// +// Migrates a WorkSpace from one operating system or bundle type to another, +// while retaining the data on the user volume. +// +// The migration process recreates the WorkSpace by using a new root volume +// from the target bundle image and the user volume from the last available +// snapshot of the original WorkSpace. During migration, the original D:\Users\%USERNAME% +// user profile folder is renamed to D:\Users\%USERNAME%MMddyyTHHmmss%.NotMigrated. +// A new D:\Users\%USERNAME%\ folder is generated by the new OS. Certain files +// in the old user profile are moved to the new user profile. +// +// For available migration scenarios, details about what happens during migration, +// and best practices, see Migrate a WorkSpace (https://docs.aws.amazon.com/workspaces/latest/adminguide/migrate-workspaces.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 WorkSpaces's +// API operation MigrateWorkspace for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValuesException +// One or more parameter values are not valid. +// +// * ResourceNotFoundException +// The resource could not be found. +// +// * AccessDeniedException +// The user is not authorized to access a resource. +// +// * OperationNotSupportedException +// This operation is not supported. +// +// * OperationInProgressException +// The properties of this WorkSpace are currently being modified. Try again +// in a moment. +// +// * ResourceUnavailableException +// The specified resource is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/MigrateWorkspace +func (c *WorkSpaces) MigrateWorkspace(input *MigrateWorkspaceInput) (*MigrateWorkspaceOutput, error) { + req, out := c.MigrateWorkspaceRequest(input) + return out, req.Send() +} + +// MigrateWorkspaceWithContext is the same as MigrateWorkspace with the addition of +// the ability to pass a context and additional request options. +// +// See MigrateWorkspace for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkSpaces) MigrateWorkspaceWithContext(ctx aws.Context, input *MigrateWorkspaceInput, opts ...request.Option) (*MigrateWorkspaceOutput, error) { + req, out := c.MigrateWorkspaceRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + const opModifyAccount = "ModifyAccount" // ModifyAccountRequest generates a "aws/request.Request" representing the @@ -2218,7 +2423,7 @@ func (c *WorkSpaces) ModifyAccountRequest(input *ModifyAccountInput) (req *reque // ModifyAccount API operation for Amazon WorkSpaces. // -// Modifies the configuration of bring your own license (BYOL) for the specified +// Modifies the configuration of Bring Your Own License (BYOL) for the specified // account. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions @@ -2228,20 +2433,20 @@ func (c *WorkSpaces) ModifyAccountRequest(input *ModifyAccountInput) (req *reque // See the AWS API reference guide for Amazon WorkSpaces's // API operation ModifyAccount for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // The user is not authorized to access a resource. // -// * ErrCodeInvalidResourceStateException "InvalidResourceStateException" +// * InvalidResourceStateException // The state of the resource is not valid for this operation. // -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" +// * ResourceUnavailableException // The specified resource is not available. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource could not be found. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyAccount @@ -2320,14 +2525,14 @@ func (c *WorkSpaces) ModifyClientPropertiesRequest(input *ModifyClientProperties // See the AWS API reference guide for Amazon WorkSpaces's // API operation ModifyClientProperties for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource could not be found. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // The user is not authorized to access a resource. // // See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyClientProperties @@ -2352,975 +2557,2153 @@ func (c *WorkSpaces) ModifyClientPropertiesWithContext(ctx aws.Context, input *M return out, req.Send() } -const opModifyWorkspaceProperties = "ModifyWorkspaceProperties" +const opModifySelfservicePermissions = "ModifySelfservicePermissions" -// ModifyWorkspacePropertiesRequest generates a "aws/request.Request" representing the -// client's request for the ModifyWorkspaceProperties operation. The "output" return +// ModifySelfservicePermissionsRequest generates a "aws/request.Request" representing the +// client's request for the ModifySelfservicePermissions operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyWorkspaceProperties for more information on using the ModifyWorkspaceProperties +// See ModifySelfservicePermissions for more information on using the ModifySelfservicePermissions // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyWorkspacePropertiesRequest method. -// req, resp := client.ModifyWorkspacePropertiesRequest(params) +// // Example sending a request using the ModifySelfservicePermissionsRequest method. +// req, resp := client.ModifySelfservicePermissionsRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceProperties -func (c *WorkSpaces) ModifyWorkspacePropertiesRequest(input *ModifyWorkspacePropertiesInput) (req *request.Request, output *ModifyWorkspacePropertiesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifySelfservicePermissions +func (c *WorkSpaces) ModifySelfservicePermissionsRequest(input *ModifySelfservicePermissionsInput) (req *request.Request, output *ModifySelfservicePermissionsOutput) { op := &request.Operation{ - Name: opModifyWorkspaceProperties, + Name: opModifySelfservicePermissions, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyWorkspacePropertiesInput{} + input = &ModifySelfservicePermissionsInput{} } - output = &ModifyWorkspacePropertiesOutput{} + output = &ModifySelfservicePermissionsOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ModifyWorkspaceProperties API operation for Amazon WorkSpaces. +// ModifySelfservicePermissions API operation for Amazon WorkSpaces. // -// Modifies the specified WorkSpace properties. +// Modifies the self-service WorkSpace management capabilities for your users. +// For more information, see Enable Self-Service WorkSpace Management Capabilities +// for Your Users (https://docs.aws.amazon.com/workspaces/latest/adminguide/enable-user-self-service-workspace-management.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 WorkSpaces's -// API operation ModifyWorkspaceProperties for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" -// One or more parameter values are not valid. +// API operation ModifySelfservicePermissions for usage and error information. // -// * ErrCodeInvalidResourceStateException "InvalidResourceStateException" -// The state of the resource is not valid for this operation. -// -// * ErrCodeOperationInProgressException "OperationInProgressException" -// The properties of this WorkSpace are currently being modified. Try again -// in a moment. +// Returned Error Types: +// * AccessDeniedException +// The user is not authorized to access a resource. // -// * ErrCodeUnsupportedWorkspaceConfigurationException "UnsupportedWorkspaceConfigurationException" -// The configuration of this WorkSpace is not supported for this operation. -// For more information, see the Amazon WorkSpaces Administration Guide (https://docs.aws.amazon.com/workspaces/latest/adminguide/). +// * InvalidParameterValuesException +// One or more parameter values are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource could not be found. // -// * ErrCodeAccessDeniedException "AccessDeniedException" -// The user is not authorized to access a resource. -// -// * ErrCodeResourceUnavailableException "ResourceUnavailableException" -// The specified resource is not available. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceProperties -func (c *WorkSpaces) ModifyWorkspaceProperties(input *ModifyWorkspacePropertiesInput) (*ModifyWorkspacePropertiesOutput, error) { - req, out := c.ModifyWorkspacePropertiesRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifySelfservicePermissions +func (c *WorkSpaces) ModifySelfservicePermissions(input *ModifySelfservicePermissionsInput) (*ModifySelfservicePermissionsOutput, error) { + req, out := c.ModifySelfservicePermissionsRequest(input) return out, req.Send() } -// ModifyWorkspacePropertiesWithContext is the same as ModifyWorkspaceProperties with the addition of +// ModifySelfservicePermissionsWithContext is the same as ModifySelfservicePermissions with the addition of // the ability to pass a context and additional request options. // -// See ModifyWorkspaceProperties for details on how to use this API operation. +// See ModifySelfservicePermissions for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *WorkSpaces) ModifyWorkspacePropertiesWithContext(ctx aws.Context, input *ModifyWorkspacePropertiesInput, opts ...request.Option) (*ModifyWorkspacePropertiesOutput, error) { - req, out := c.ModifyWorkspacePropertiesRequest(input) +func (c *WorkSpaces) ModifySelfservicePermissionsWithContext(ctx aws.Context, input *ModifySelfservicePermissionsInput, opts ...request.Option) (*ModifySelfservicePermissionsOutput, error) { + req, out := c.ModifySelfservicePermissionsRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opModifyWorkspaceState = "ModifyWorkspaceState" +const opModifyWorkspaceAccessProperties = "ModifyWorkspaceAccessProperties" -// ModifyWorkspaceStateRequest generates a "aws/request.Request" representing the -// client's request for the ModifyWorkspaceState operation. The "output" return +// ModifyWorkspaceAccessPropertiesRequest generates a "aws/request.Request" representing the +// client's request for the ModifyWorkspaceAccessProperties operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See ModifyWorkspaceState for more information on using the ModifyWorkspaceState +// See ModifyWorkspaceAccessProperties for more information on using the ModifyWorkspaceAccessProperties // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the ModifyWorkspaceStateRequest method. -// req, resp := client.ModifyWorkspaceStateRequest(params) +// // Example sending a request using the ModifyWorkspaceAccessPropertiesRequest method. +// req, resp := client.ModifyWorkspaceAccessPropertiesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceState -func (c *WorkSpaces) ModifyWorkspaceStateRequest(input *ModifyWorkspaceStateInput) (req *request.Request, output *ModifyWorkspaceStateOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceAccessProperties +func (c *WorkSpaces) ModifyWorkspaceAccessPropertiesRequest(input *ModifyWorkspaceAccessPropertiesInput) (req *request.Request, output *ModifyWorkspaceAccessPropertiesOutput) { op := &request.Operation{ - Name: opModifyWorkspaceState, + Name: opModifyWorkspaceAccessProperties, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &ModifyWorkspaceStateInput{} + input = &ModifyWorkspaceAccessPropertiesInput{} } - output = &ModifyWorkspaceStateOutput{} + output = &ModifyWorkspaceAccessPropertiesOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// ModifyWorkspaceState API operation for Amazon WorkSpaces. -// -// Sets the state of the specified WorkSpace. +// ModifyWorkspaceAccessProperties API operation for Amazon WorkSpaces. // -// To maintain a WorkSpace without being interrupted, set the WorkSpace state -// to ADMIN_MAINTENANCE. WorkSpaces in this state do not respond to requests -// to reboot, stop, start, rebuild, or restore. An AutoStop WorkSpace in this -// state is not stopped. Users cannot log into a WorkSpace in the ADMIN_MAINTENANCE -// state. +// Specifies which devices and operating systems users can use to access their +// WorkSpaces. For more information, see Control Device Access (https://docs.aws.amazon.com/workspaces/latest/adminguide/update-directory-details.html#control-device-access). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon WorkSpaces's -// API operation ModifyWorkspaceState for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" -// One or more parameter values are not valid. +// API operation ModifyWorkspaceAccessProperties for usage and error information. // -// * ErrCodeInvalidResourceStateException "InvalidResourceStateException" -// The state of the resource is not valid for this operation. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// Returned Error Types: +// * ResourceNotFoundException // The resource could not be found. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceState -func (c *WorkSpaces) ModifyWorkspaceState(input *ModifyWorkspaceStateInput) (*ModifyWorkspaceStateOutput, error) { - req, out := c.ModifyWorkspaceStateRequest(input) +// * AccessDeniedException +// The user is not authorized to access a resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceAccessProperties +func (c *WorkSpaces) ModifyWorkspaceAccessProperties(input *ModifyWorkspaceAccessPropertiesInput) (*ModifyWorkspaceAccessPropertiesOutput, error) { + req, out := c.ModifyWorkspaceAccessPropertiesRequest(input) return out, req.Send() } -// ModifyWorkspaceStateWithContext is the same as ModifyWorkspaceState with the addition of +// ModifyWorkspaceAccessPropertiesWithContext is the same as ModifyWorkspaceAccessProperties with the addition of // the ability to pass a context and additional request options. // -// See ModifyWorkspaceState for details on how to use this API operation. +// See ModifyWorkspaceAccessProperties for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *WorkSpaces) ModifyWorkspaceStateWithContext(ctx aws.Context, input *ModifyWorkspaceStateInput, opts ...request.Option) (*ModifyWorkspaceStateOutput, error) { - req, out := c.ModifyWorkspaceStateRequest(input) +func (c *WorkSpaces) ModifyWorkspaceAccessPropertiesWithContext(ctx aws.Context, input *ModifyWorkspaceAccessPropertiesInput, opts ...request.Option) (*ModifyWorkspaceAccessPropertiesOutput, error) { + req, out := c.ModifyWorkspaceAccessPropertiesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRebootWorkspaces = "RebootWorkspaces" +const opModifyWorkspaceCreationProperties = "ModifyWorkspaceCreationProperties" -// RebootWorkspacesRequest generates a "aws/request.Request" representing the -// client's request for the RebootWorkspaces operation. The "output" return +// ModifyWorkspaceCreationPropertiesRequest generates a "aws/request.Request" representing the +// client's request for the ModifyWorkspaceCreationProperties operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RebootWorkspaces for more information on using the RebootWorkspaces +// See ModifyWorkspaceCreationProperties for more information on using the ModifyWorkspaceCreationProperties // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RebootWorkspacesRequest method. -// req, resp := client.RebootWorkspacesRequest(params) +// // Example sending a request using the ModifyWorkspaceCreationPropertiesRequest method. +// req, resp := client.ModifyWorkspaceCreationPropertiesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RebootWorkspaces -func (c *WorkSpaces) RebootWorkspacesRequest(input *RebootWorkspacesInput) (req *request.Request, output *RebootWorkspacesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceCreationProperties +func (c *WorkSpaces) ModifyWorkspaceCreationPropertiesRequest(input *ModifyWorkspaceCreationPropertiesInput) (req *request.Request, output *ModifyWorkspaceCreationPropertiesOutput) { op := &request.Operation{ - Name: opRebootWorkspaces, + Name: opModifyWorkspaceCreationProperties, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RebootWorkspacesInput{} + input = &ModifyWorkspaceCreationPropertiesInput{} } - output = &RebootWorkspacesOutput{} + output = &ModifyWorkspaceCreationPropertiesOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// RebootWorkspaces API operation for Amazon WorkSpaces. -// -// Reboots the specified WorkSpaces. -// -// You cannot reboot a WorkSpace unless its state is AVAILABLE or UNHEALTHY. +// ModifyWorkspaceCreationProperties API operation for Amazon WorkSpaces. // -// This operation is asynchronous and returns before the WorkSpaces have rebooted. +// Modify the default properties used to create WorkSpaces. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon WorkSpaces's -// API operation RebootWorkspaces for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RebootWorkspaces -func (c *WorkSpaces) RebootWorkspaces(input *RebootWorkspacesInput) (*RebootWorkspacesOutput, error) { - req, out := c.RebootWorkspacesRequest(input) +// API operation ModifyWorkspaceCreationProperties for usage and error information. +// +// Returned Error Types: +// * AccessDeniedException +// The user is not authorized to access a resource. +// +// * InvalidParameterValuesException +// One or more parameter values are not valid. +// +// * ResourceNotFoundException +// The resource could not be found. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceCreationProperties +func (c *WorkSpaces) ModifyWorkspaceCreationProperties(input *ModifyWorkspaceCreationPropertiesInput) (*ModifyWorkspaceCreationPropertiesOutput, error) { + req, out := c.ModifyWorkspaceCreationPropertiesRequest(input) return out, req.Send() } -// RebootWorkspacesWithContext is the same as RebootWorkspaces with the addition of +// ModifyWorkspaceCreationPropertiesWithContext is the same as ModifyWorkspaceCreationProperties with the addition of // the ability to pass a context and additional request options. // -// See RebootWorkspaces for details on how to use this API operation. +// See ModifyWorkspaceCreationProperties for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *WorkSpaces) RebootWorkspacesWithContext(ctx aws.Context, input *RebootWorkspacesInput, opts ...request.Option) (*RebootWorkspacesOutput, error) { - req, out := c.RebootWorkspacesRequest(input) +func (c *WorkSpaces) ModifyWorkspaceCreationPropertiesWithContext(ctx aws.Context, input *ModifyWorkspaceCreationPropertiesInput, opts ...request.Option) (*ModifyWorkspaceCreationPropertiesOutput, error) { + req, out := c.ModifyWorkspaceCreationPropertiesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRebuildWorkspaces = "RebuildWorkspaces" +const opModifyWorkspaceProperties = "ModifyWorkspaceProperties" -// RebuildWorkspacesRequest generates a "aws/request.Request" representing the -// client's request for the RebuildWorkspaces operation. The "output" return +// ModifyWorkspacePropertiesRequest generates a "aws/request.Request" representing the +// client's request for the ModifyWorkspaceProperties operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RebuildWorkspaces for more information on using the RebuildWorkspaces +// See ModifyWorkspaceProperties for more information on using the ModifyWorkspaceProperties // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RebuildWorkspacesRequest method. -// req, resp := client.RebuildWorkspacesRequest(params) +// // Example sending a request using the ModifyWorkspacePropertiesRequest method. +// req, resp := client.ModifyWorkspacePropertiesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RebuildWorkspaces -func (c *WorkSpaces) RebuildWorkspacesRequest(input *RebuildWorkspacesInput) (req *request.Request, output *RebuildWorkspacesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceProperties +func (c *WorkSpaces) ModifyWorkspacePropertiesRequest(input *ModifyWorkspacePropertiesInput) (req *request.Request, output *ModifyWorkspacePropertiesOutput) { op := &request.Operation{ - Name: opRebuildWorkspaces, + Name: opModifyWorkspaceProperties, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RebuildWorkspacesInput{} + input = &ModifyWorkspacePropertiesInput{} } - output = &RebuildWorkspacesOutput{} + output = &ModifyWorkspacePropertiesOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// RebuildWorkspaces API operation for Amazon WorkSpaces. -// -// Rebuilds the specified WorkSpace. -// -// You cannot rebuild a WorkSpace unless its state is AVAILABLE, ERROR, or UNHEALTHY. -// -// Rebuilding a WorkSpace is a potentially destructive action that can result -// in the loss of data. For more information, see Rebuild a WorkSpace (https://docs.aws.amazon.com/workspaces/latest/adminguide/reset-workspace.html). +// ModifyWorkspaceProperties API operation for Amazon WorkSpaces. // -// This operation is asynchronous and returns before the WorkSpaces have been -// completely rebuilt. +// Modifies the specified WorkSpace properties. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon WorkSpaces's -// API operation RebuildWorkspaces for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RebuildWorkspaces -func (c *WorkSpaces) RebuildWorkspaces(input *RebuildWorkspacesInput) (*RebuildWorkspacesOutput, error) { - req, out := c.RebuildWorkspacesRequest(input) +// API operation ModifyWorkspaceProperties for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValuesException +// One or more parameter values are not valid. +// +// * InvalidResourceStateException +// The state of the resource is not valid for this operation. +// +// * OperationInProgressException +// The properties of this WorkSpace are currently being modified. Try again +// in a moment. +// +// * UnsupportedWorkspaceConfigurationException +// The configuration of this WorkSpace is not supported for this operation. +// For more information, see Required Configuration and Service Components for +// WorkSpaces (https://docs.aws.amazon.com/workspaces/latest/adminguide/required-service-components.html). +// +// * ResourceNotFoundException +// The resource could not be found. +// +// * AccessDeniedException +// The user is not authorized to access a resource. +// +// * ResourceUnavailableException +// The specified resource is not available. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceProperties +func (c *WorkSpaces) ModifyWorkspaceProperties(input *ModifyWorkspacePropertiesInput) (*ModifyWorkspacePropertiesOutput, error) { + req, out := c.ModifyWorkspacePropertiesRequest(input) return out, req.Send() } -// RebuildWorkspacesWithContext is the same as RebuildWorkspaces with the addition of +// ModifyWorkspacePropertiesWithContext is the same as ModifyWorkspaceProperties with the addition of // the ability to pass a context and additional request options. // -// See RebuildWorkspaces for details on how to use this API operation. +// See ModifyWorkspaceProperties for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *WorkSpaces) RebuildWorkspacesWithContext(ctx aws.Context, input *RebuildWorkspacesInput, opts ...request.Option) (*RebuildWorkspacesOutput, error) { - req, out := c.RebuildWorkspacesRequest(input) +func (c *WorkSpaces) ModifyWorkspacePropertiesWithContext(ctx aws.Context, input *ModifyWorkspacePropertiesInput, opts ...request.Option) (*ModifyWorkspacePropertiesOutput, error) { + req, out := c.ModifyWorkspacePropertiesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRestoreWorkspace = "RestoreWorkspace" +const opModifyWorkspaceState = "ModifyWorkspaceState" -// RestoreWorkspaceRequest generates a "aws/request.Request" representing the -// client's request for the RestoreWorkspace operation. The "output" return +// ModifyWorkspaceStateRequest generates a "aws/request.Request" representing the +// client's request for the ModifyWorkspaceState operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RestoreWorkspace for more information on using the RestoreWorkspace +// See ModifyWorkspaceState for more information on using the ModifyWorkspaceState // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RestoreWorkspaceRequest method. -// req, resp := client.RestoreWorkspaceRequest(params) +// // Example sending a request using the ModifyWorkspaceStateRequest method. +// req, resp := client.ModifyWorkspaceStateRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RestoreWorkspace -func (c *WorkSpaces) RestoreWorkspaceRequest(input *RestoreWorkspaceInput) (req *request.Request, output *RestoreWorkspaceOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceState +func (c *WorkSpaces) ModifyWorkspaceStateRequest(input *ModifyWorkspaceStateInput) (req *request.Request, output *ModifyWorkspaceStateOutput) { op := &request.Operation{ - Name: opRestoreWorkspace, + Name: opModifyWorkspaceState, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RestoreWorkspaceInput{} + input = &ModifyWorkspaceStateInput{} } - output = &RestoreWorkspaceOutput{} + output = &ModifyWorkspaceStateOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// RestoreWorkspace API operation for Amazon WorkSpaces. -// -// Restores the specified WorkSpace to its last known healthy state. -// -// You cannot restore a WorkSpace unless its state is AVAILABLE, ERROR, or UNHEALTHY. +// ModifyWorkspaceState API operation for Amazon WorkSpaces. // -// Restoring a WorkSpace is a potentially destructive action that can result -// in the loss of data. For more information, see Restore a WorkSpace (https://docs.aws.amazon.com/workspaces/latest/adminguide/restore-workspace.html). +// Sets the state of the specified WorkSpace. // -// This operation is asynchronous and returns before the WorkSpace is completely -// restored. +// To maintain a WorkSpace without being interrupted, set the WorkSpace state +// to ADMIN_MAINTENANCE. WorkSpaces in this state do not respond to requests +// to reboot, stop, start, rebuild, or restore. An AutoStop WorkSpace in this +// state is not stopped. Users cannot log into a WorkSpace in the ADMIN_MAINTENANCE +// 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 WorkSpaces's -// API operation RestoreWorkspace for usage and error information. +// API operation ModifyWorkspaceState for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource could not be found. +// * InvalidResourceStateException +// The state of the resource is not valid for this operation. // -// * ErrCodeAccessDeniedException "AccessDeniedException" -// The user is not authorized to access a resource. +// * ResourceNotFoundException +// The resource could not be found. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RestoreWorkspace -func (c *WorkSpaces) RestoreWorkspace(input *RestoreWorkspaceInput) (*RestoreWorkspaceOutput, error) { - req, out := c.RestoreWorkspaceRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/ModifyWorkspaceState +func (c *WorkSpaces) ModifyWorkspaceState(input *ModifyWorkspaceStateInput) (*ModifyWorkspaceStateOutput, error) { + req, out := c.ModifyWorkspaceStateRequest(input) return out, req.Send() } -// RestoreWorkspaceWithContext is the same as RestoreWorkspace with the addition of +// ModifyWorkspaceStateWithContext is the same as ModifyWorkspaceState with the addition of // the ability to pass a context and additional request options. // -// See RestoreWorkspace for details on how to use this API operation. +// See ModifyWorkspaceState for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *WorkSpaces) RestoreWorkspaceWithContext(ctx aws.Context, input *RestoreWorkspaceInput, opts ...request.Option) (*RestoreWorkspaceOutput, error) { - req, out := c.RestoreWorkspaceRequest(input) +func (c *WorkSpaces) ModifyWorkspaceStateWithContext(ctx aws.Context, input *ModifyWorkspaceStateInput, opts ...request.Option) (*ModifyWorkspaceStateOutput, error) { + req, out := c.ModifyWorkspaceStateRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opRevokeIpRules = "RevokeIpRules" +const opRebootWorkspaces = "RebootWorkspaces" -// RevokeIpRulesRequest generates a "aws/request.Request" representing the -// client's request for the RevokeIpRules operation. The "output" return +// RebootWorkspacesRequest generates a "aws/request.Request" representing the +// client's request for the RebootWorkspaces operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See RevokeIpRules for more information on using the RevokeIpRules +// See RebootWorkspaces for more information on using the RebootWorkspaces // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the RevokeIpRulesRequest method. -// req, resp := client.RevokeIpRulesRequest(params) +// // Example sending a request using the RebootWorkspacesRequest method. +// req, resp := client.RebootWorkspacesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RevokeIpRules -func (c *WorkSpaces) RevokeIpRulesRequest(input *RevokeIpRulesInput) (req *request.Request, output *RevokeIpRulesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RebootWorkspaces +func (c *WorkSpaces) RebootWorkspacesRequest(input *RebootWorkspacesInput) (req *request.Request, output *RebootWorkspacesOutput) { op := &request.Operation{ - Name: opRevokeIpRules, + Name: opRebootWorkspaces, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &RevokeIpRulesInput{} + input = &RebootWorkspacesInput{} } - output = &RevokeIpRulesOutput{} + output = &RebootWorkspacesOutput{} req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// RevokeIpRules API operation for Amazon WorkSpaces. +// RebootWorkspaces API operation for Amazon WorkSpaces. // -// Removes one or more rules from the specified IP access control group. +// Reboots the specified WorkSpaces. +// +// You cannot reboot a WorkSpace unless its state is AVAILABLE or UNHEALTHY. +// +// This operation is asynchronous and returns before the WorkSpaces have rebooted. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon WorkSpaces's -// API operation RevokeIpRules for usage and error information. -// -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" -// One or more parameter values are not valid. -// -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" -// The resource could not be found. -// -// * ErrCodeInvalidResourceStateException "InvalidResourceStateException" -// The state of the resource is not valid for this operation. -// -// * ErrCodeAccessDeniedException "AccessDeniedException" -// The user is not authorized to access a resource. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RevokeIpRules -func (c *WorkSpaces) RevokeIpRules(input *RevokeIpRulesInput) (*RevokeIpRulesOutput, error) { - req, out := c.RevokeIpRulesRequest(input) +// API operation RebootWorkspaces for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RebootWorkspaces +func (c *WorkSpaces) RebootWorkspaces(input *RebootWorkspacesInput) (*RebootWorkspacesOutput, error) { + req, out := c.RebootWorkspacesRequest(input) return out, req.Send() } -// RevokeIpRulesWithContext is the same as RevokeIpRules with the addition of +// RebootWorkspacesWithContext is the same as RebootWorkspaces with the addition of // the ability to pass a context and additional request options. // -// See RevokeIpRules for details on how to use this API operation. +// See RebootWorkspaces for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *WorkSpaces) RevokeIpRulesWithContext(ctx aws.Context, input *RevokeIpRulesInput, opts ...request.Option) (*RevokeIpRulesOutput, error) { - req, out := c.RevokeIpRulesRequest(input) +func (c *WorkSpaces) RebootWorkspacesWithContext(ctx aws.Context, input *RebootWorkspacesInput, opts ...request.Option) (*RebootWorkspacesOutput, error) { + req, out := c.RebootWorkspacesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStartWorkspaces = "StartWorkspaces" +const opRebuildWorkspaces = "RebuildWorkspaces" -// StartWorkspacesRequest generates a "aws/request.Request" representing the -// client's request for the StartWorkspaces operation. The "output" return +// RebuildWorkspacesRequest generates a "aws/request.Request" representing the +// client's request for the RebuildWorkspaces operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StartWorkspaces for more information on using the StartWorkspaces +// See RebuildWorkspaces for more information on using the RebuildWorkspaces // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StartWorkspacesRequest method. -// req, resp := client.StartWorkspacesRequest(params) +// // Example sending a request using the RebuildWorkspacesRequest method. +// req, resp := client.RebuildWorkspacesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/StartWorkspaces -func (c *WorkSpaces) StartWorkspacesRequest(input *StartWorkspacesInput) (req *request.Request, output *StartWorkspacesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RebuildWorkspaces +func (c *WorkSpaces) RebuildWorkspacesRequest(input *RebuildWorkspacesInput) (req *request.Request, output *RebuildWorkspacesOutput) { op := &request.Operation{ - Name: opStartWorkspaces, + Name: opRebuildWorkspaces, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StartWorkspacesInput{} + input = &RebuildWorkspacesInput{} } - output = &StartWorkspacesOutput{} + output = &RebuildWorkspacesOutput{} req = c.newRequest(op, input, output) return } -// StartWorkspaces API operation for Amazon WorkSpaces. +// RebuildWorkspaces API operation for Amazon WorkSpaces. // -// Starts the specified WorkSpaces. +// Rebuilds the specified WorkSpace. // -// You cannot start a WorkSpace unless it has a running mode of AutoStop and -// a state of STOPPED. +// You cannot rebuild a WorkSpace unless its state is AVAILABLE, ERROR, UNHEALTHY, +// or STOPPED. +// +// Rebuilding a WorkSpace is a potentially destructive action that can result +// in the loss of data. For more information, see Rebuild a WorkSpace (https://docs.aws.amazon.com/workspaces/latest/adminguide/reset-workspace.html). +// +// This operation is asynchronous and returns before the WorkSpaces have been +// completely rebuilt. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon WorkSpaces's -// API operation StartWorkspaces for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/StartWorkspaces -func (c *WorkSpaces) StartWorkspaces(input *StartWorkspacesInput) (*StartWorkspacesOutput, error) { - req, out := c.StartWorkspacesRequest(input) +// API operation RebuildWorkspaces for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RebuildWorkspaces +func (c *WorkSpaces) RebuildWorkspaces(input *RebuildWorkspacesInput) (*RebuildWorkspacesOutput, error) { + req, out := c.RebuildWorkspacesRequest(input) return out, req.Send() } -// StartWorkspacesWithContext is the same as StartWorkspaces with the addition of +// RebuildWorkspacesWithContext is the same as RebuildWorkspaces with the addition of // the ability to pass a context and additional request options. // -// See StartWorkspaces for details on how to use this API operation. +// See RebuildWorkspaces for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *WorkSpaces) StartWorkspacesWithContext(ctx aws.Context, input *StartWorkspacesInput, opts ...request.Option) (*StartWorkspacesOutput, error) { - req, out := c.StartWorkspacesRequest(input) +func (c *WorkSpaces) RebuildWorkspacesWithContext(ctx aws.Context, input *RebuildWorkspacesInput, opts ...request.Option) (*RebuildWorkspacesOutput, error) { + req, out := c.RebuildWorkspacesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opStopWorkspaces = "StopWorkspaces" +const opRegisterWorkspaceDirectory = "RegisterWorkspaceDirectory" -// StopWorkspacesRequest generates a "aws/request.Request" representing the -// client's request for the StopWorkspaces operation. The "output" return +// RegisterWorkspaceDirectoryRequest generates a "aws/request.Request" representing the +// client's request for the RegisterWorkspaceDirectory operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See StopWorkspaces for more information on using the StopWorkspaces +// See RegisterWorkspaceDirectory for more information on using the RegisterWorkspaceDirectory // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the StopWorkspacesRequest method. -// req, resp := client.StopWorkspacesRequest(params) +// // Example sending a request using the RegisterWorkspaceDirectoryRequest method. +// req, resp := client.RegisterWorkspaceDirectoryRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/StopWorkspaces -func (c *WorkSpaces) StopWorkspacesRequest(input *StopWorkspacesInput) (req *request.Request, output *StopWorkspacesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RegisterWorkspaceDirectory +func (c *WorkSpaces) RegisterWorkspaceDirectoryRequest(input *RegisterWorkspaceDirectoryInput) (req *request.Request, output *RegisterWorkspaceDirectoryOutput) { op := &request.Operation{ - Name: opStopWorkspaces, + Name: opRegisterWorkspaceDirectory, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &StopWorkspacesInput{} + input = &RegisterWorkspaceDirectoryInput{} } - output = &StopWorkspacesOutput{} + output = &RegisterWorkspaceDirectoryOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// StopWorkspaces API operation for Amazon WorkSpaces. -// -// Stops the specified WorkSpaces. +// RegisterWorkspaceDirectory API operation for Amazon WorkSpaces. // -// You cannot stop a WorkSpace unless it has a running mode of AutoStop and -// a state of AVAILABLE, IMPAIRED, UNHEALTHY, or ERROR. +// Registers the specified directory. This operation is asynchronous and returns +// before the WorkSpace directory is registered. If this is the first time you +// are registering a directory, you will need to create the workspaces_DefaultRole +// role before you can register a directory. For more information, see Creating +// the workspaces_DefaultRole Role (https://docs.aws.amazon.com/workspaces/latest/adminguide/workspaces-access-control.html#create-default-role). // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon WorkSpaces's -// API operation StopWorkspaces for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/StopWorkspaces -func (c *WorkSpaces) StopWorkspaces(input *StopWorkspacesInput) (*StopWorkspacesOutput, error) { - req, out := c.StopWorkspacesRequest(input) +// API operation RegisterWorkspaceDirectory for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValuesException +// One or more parameter values are not valid. +// +// * ResourceNotFoundException +// The resource could not be found. +// +// * ResourceLimitExceededException +// Your resource limits have been exceeded. +// +// * AccessDeniedException +// The user is not authorized to access a resource. +// +// * WorkspacesDefaultRoleNotFoundException +// The workspaces_DefaultRole role could not be found. If this is the first +// time you are registering a directory, you will need to create the workspaces_DefaultRole +// role before you can register a directory. For more information, see Creating +// the workspaces_DefaultRole Role (https://docs.aws.amazon.com/workspaces/latest/adminguide/workspaces-access-control.html#create-default-role). +// +// * InvalidResourceStateException +// The state of the resource is not valid for this operation. +// +// * UnsupportedNetworkConfigurationException +// The configuration of this network is not supported for this operation, or +// your network configuration conflicts with the Amazon WorkSpaces management +// network IP range. For more information, see Configure a VPC for Amazon WorkSpaces +// (https://docs.aws.amazon.com/workspaces/latest/adminguide/amazon-workspaces-vpc.html). +// +// * OperationNotSupportedException +// This operation is not supported. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RegisterWorkspaceDirectory +func (c *WorkSpaces) RegisterWorkspaceDirectory(input *RegisterWorkspaceDirectoryInput) (*RegisterWorkspaceDirectoryOutput, error) { + req, out := c.RegisterWorkspaceDirectoryRequest(input) return out, req.Send() } -// StopWorkspacesWithContext is the same as StopWorkspaces with the addition of +// RegisterWorkspaceDirectoryWithContext is the same as RegisterWorkspaceDirectory with the addition of // the ability to pass a context and additional request options. // -// See StopWorkspaces for details on how to use this API operation. +// See RegisterWorkspaceDirectory for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *WorkSpaces) StopWorkspacesWithContext(ctx aws.Context, input *StopWorkspacesInput, opts ...request.Option) (*StopWorkspacesOutput, error) { - req, out := c.StopWorkspacesRequest(input) +func (c *WorkSpaces) RegisterWorkspaceDirectoryWithContext(ctx aws.Context, input *RegisterWorkspaceDirectoryInput, opts ...request.Option) (*RegisterWorkspaceDirectoryOutput, error) { + req, out := c.RegisterWorkspaceDirectoryRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opTerminateWorkspaces = "TerminateWorkspaces" +const opRestoreWorkspace = "RestoreWorkspace" -// TerminateWorkspacesRequest generates a "aws/request.Request" representing the -// client's request for the TerminateWorkspaces operation. The "output" return +// RestoreWorkspaceRequest generates a "aws/request.Request" representing the +// client's request for the RestoreWorkspace operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See TerminateWorkspaces for more information on using the TerminateWorkspaces +// See RestoreWorkspace for more information on using the RestoreWorkspace // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the TerminateWorkspacesRequest method. -// req, resp := client.TerminateWorkspacesRequest(params) +// // Example sending a request using the RestoreWorkspaceRequest method. +// req, resp := client.RestoreWorkspaceRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/TerminateWorkspaces -func (c *WorkSpaces) TerminateWorkspacesRequest(input *TerminateWorkspacesInput) (req *request.Request, output *TerminateWorkspacesOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RestoreWorkspace +func (c *WorkSpaces) RestoreWorkspaceRequest(input *RestoreWorkspaceInput) (req *request.Request, output *RestoreWorkspaceOutput) { op := &request.Operation{ - Name: opTerminateWorkspaces, + Name: opRestoreWorkspace, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &TerminateWorkspacesInput{} + input = &RestoreWorkspaceInput{} } - output = &TerminateWorkspacesOutput{} + output = &RestoreWorkspaceOutput{} req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// TerminateWorkspaces API operation for Amazon WorkSpaces. +// RestoreWorkspace API operation for Amazon WorkSpaces. // -// Terminates the specified WorkSpaces. +// Restores the specified WorkSpace to its last known healthy state. // -// Terminating a WorkSpace is a permanent action and cannot be undone. The user's -// data is destroyed. If you need to archive any user data, contact Amazon Web -// Services before terminating the WorkSpace. +// You cannot restore a WorkSpace unless its state is AVAILABLE, ERROR, UNHEALTHY, +// or STOPPED. // -// You can terminate a WorkSpace that is in any state except SUSPENDED. +// Restoring a WorkSpace is a potentially destructive action that can result +// in the loss of data. For more information, see Restore a WorkSpace (https://docs.aws.amazon.com/workspaces/latest/adminguide/restore-workspace.html). // -// This operation is asynchronous and returns before the WorkSpaces have been -// completely terminated. +// This operation is asynchronous and returns before the WorkSpace is completely +// restored. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about // the error. // // See the AWS API reference guide for Amazon WorkSpaces's -// API operation TerminateWorkspaces for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/TerminateWorkspaces -func (c *WorkSpaces) TerminateWorkspaces(input *TerminateWorkspacesInput) (*TerminateWorkspacesOutput, error) { - req, out := c.TerminateWorkspacesRequest(input) +// API operation RestoreWorkspace for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValuesException +// One or more parameter values are not valid. +// +// * ResourceNotFoundException +// The resource could not be found. +// +// * AccessDeniedException +// The user is not authorized to access a resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RestoreWorkspace +func (c *WorkSpaces) RestoreWorkspace(input *RestoreWorkspaceInput) (*RestoreWorkspaceOutput, error) { + req, out := c.RestoreWorkspaceRequest(input) return out, req.Send() } -// TerminateWorkspacesWithContext is the same as TerminateWorkspaces with the addition of +// RestoreWorkspaceWithContext is the same as RestoreWorkspace with the addition of // the ability to pass a context and additional request options. // -// See TerminateWorkspaces for details on how to use this API operation. +// See RestoreWorkspace for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *WorkSpaces) TerminateWorkspacesWithContext(ctx aws.Context, input *TerminateWorkspacesInput, opts ...request.Option) (*TerminateWorkspacesOutput, error) { - req, out := c.TerminateWorkspacesRequest(input) +func (c *WorkSpaces) RestoreWorkspaceWithContext(ctx aws.Context, input *RestoreWorkspaceInput, opts ...request.Option) (*RestoreWorkspaceOutput, error) { + req, out := c.RestoreWorkspaceRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -const opUpdateRulesOfIpGroup = "UpdateRulesOfIpGroup" +const opRevokeIpRules = "RevokeIpRules" -// UpdateRulesOfIpGroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRulesOfIpGroup operation. The "output" return +// RevokeIpRulesRequest generates a "aws/request.Request" representing the +// client's request for the RevokeIpRules operation. The "output" return // value will be populated with the request's response once the request completes // successfully. // // Use "Send" method on the returned Request to send the API call to the service. // the "output" return value is not valid until after Send returns without error. // -// See UpdateRulesOfIpGroup for more information on using the UpdateRulesOfIpGroup +// See RevokeIpRules for more information on using the RevokeIpRules // API call, and error handling. // // This method is useful when you want to inject custom logic or configuration // into the SDK's request lifecycle. Such as custom headers, or retry logic. // // -// // Example sending a request using the UpdateRulesOfIpGroupRequest method. -// req, resp := client.UpdateRulesOfIpGroupRequest(params) +// // Example sending a request using the RevokeIpRulesRequest method. +// req, resp := client.RevokeIpRulesRequest(params) // // err := req.Send() // if err == nil { // resp is now filled // fmt.Println(resp) // } // -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/UpdateRulesOfIpGroup -func (c *WorkSpaces) UpdateRulesOfIpGroupRequest(input *UpdateRulesOfIpGroupInput) (req *request.Request, output *UpdateRulesOfIpGroupOutput) { +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RevokeIpRules +func (c *WorkSpaces) RevokeIpRulesRequest(input *RevokeIpRulesInput) (req *request.Request, output *RevokeIpRulesOutput) { op := &request.Operation{ - Name: opUpdateRulesOfIpGroup, + Name: opRevokeIpRules, HTTPMethod: "POST", HTTPPath: "/", } if input == nil { - input = &UpdateRulesOfIpGroupInput{} + input = &RevokeIpRulesInput{} } - output = &UpdateRulesOfIpGroupOutput{} + output = &RevokeIpRulesOutput{} req = c.newRequest(op, input, output) req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) return } -// UpdateRulesOfIpGroup API operation for Amazon WorkSpaces. +// RevokeIpRules API operation for Amazon WorkSpaces. // -// Replaces the current rules of the specified IP access control group with -// the specified rules. +// Removes one or more rules from the specified IP access control 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 WorkSpaces's -// API operation UpdateRulesOfIpGroup for usage and error information. +// API operation RevokeIpRules for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidParameterValuesException "InvalidParameterValuesException" +// Returned Error Types: +// * InvalidParameterValuesException // One or more parameter values are not valid. // -// * ErrCodeResourceNotFoundException "ResourceNotFoundException" +// * ResourceNotFoundException // The resource could not be found. // -// * ErrCodeResourceLimitExceededException "ResourceLimitExceededException" -// Your resource limits have been exceeded. -// -// * ErrCodeInvalidResourceStateException "InvalidResourceStateException" +// * InvalidResourceStateException // The state of the resource is not valid for this operation. // -// * ErrCodeAccessDeniedException "AccessDeniedException" +// * AccessDeniedException // The user is not authorized to access a resource. // -// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/UpdateRulesOfIpGroup -func (c *WorkSpaces) UpdateRulesOfIpGroup(input *UpdateRulesOfIpGroupInput) (*UpdateRulesOfIpGroupOutput, error) { - req, out := c.UpdateRulesOfIpGroupRequest(input) +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/RevokeIpRules +func (c *WorkSpaces) RevokeIpRules(input *RevokeIpRulesInput) (*RevokeIpRulesOutput, error) { + req, out := c.RevokeIpRulesRequest(input) return out, req.Send() } -// UpdateRulesOfIpGroupWithContext is the same as UpdateRulesOfIpGroup with the addition of +// RevokeIpRulesWithContext is the same as RevokeIpRules with the addition of // the ability to pass a context and additional request options. // -// See UpdateRulesOfIpGroup for details on how to use this API operation. +// See RevokeIpRules for details on how to use this API operation. // // The context must be non-nil and will be used for request cancellation. If // the context is nil a panic will occur. In the future the SDK may create // sub-contexts for http.Requests. See https://golang.org/pkg/context/ // for more information on using Contexts. -func (c *WorkSpaces) UpdateRulesOfIpGroupWithContext(ctx aws.Context, input *UpdateRulesOfIpGroupInput, opts ...request.Option) (*UpdateRulesOfIpGroupOutput, error) { - req, out := c.UpdateRulesOfIpGroupRequest(input) +func (c *WorkSpaces) RevokeIpRulesWithContext(ctx aws.Context, input *RevokeIpRulesInput, opts ...request.Option) (*RevokeIpRulesOutput, error) { + req, out := c.RevokeIpRulesRequest(input) req.SetContext(ctx) req.ApplyOptions(opts...) return out, req.Send() } -// Describes a modification to the configuration of bring your own license (BYOL) -// for the specified account. -type AccountModification struct { - _ struct{} `type:"structure"` - - // The IP address range, specified as an IPv4 CIDR block, for the management - // network interface used for the account. - DedicatedTenancyManagementCidrRange *string `type:"string"` - - // The status of BYOL (whether BYOL is being enabled or disabled). - DedicatedTenancySupport *string `type:"string" enum:"DedicatedTenancySupportResultEnum"` - - // The error code that is returned if the configuration of BYOL cannot be modified. - ErrorCode *string `type:"string"` +const opStartWorkspaces = "StartWorkspaces" - // The text of the error message that is returned if the configuration of BYOL - // cannot be modified. - ErrorMessage *string `type:"string"` +// StartWorkspacesRequest generates a "aws/request.Request" representing the +// client's request for the StartWorkspaces operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StartWorkspaces for more information on using the StartWorkspaces +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StartWorkspacesRequest method. +// req, resp := client.StartWorkspacesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/StartWorkspaces +func (c *WorkSpaces) StartWorkspacesRequest(input *StartWorkspacesInput) (req *request.Request, output *StartWorkspacesOutput) { + op := &request.Operation{ + Name: opStartWorkspaces, + HTTPMethod: "POST", + HTTPPath: "/", + } - // The state of the modification to the configuration of BYOL. - ModificationState *string `type:"string" enum:"DedicatedTenancyModificationStateEnum"` + if input == nil { + input = &StartWorkspacesInput{} + } - // The timestamp when the modification of the BYOL configuration was started. - StartTime *time.Time `type:"timestamp"` + output = &StartWorkspacesOutput{} + req = c.newRequest(op, input, output) + return } -// String returns the string representation -func (s AccountModification) String() string { - return awsutil.Prettify(s) +// StartWorkspaces API operation for Amazon WorkSpaces. +// +// Starts the specified WorkSpaces. +// +// You cannot start a WorkSpace unless it has a running mode of AutoStop and +// a state of 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 WorkSpaces's +// API operation StartWorkspaces for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/StartWorkspaces +func (c *WorkSpaces) StartWorkspaces(input *StartWorkspacesInput) (*StartWorkspacesOutput, error) { + req, out := c.StartWorkspacesRequest(input) + return out, req.Send() } -// GoString returns the string representation -func (s AccountModification) GoString() string { - return s.String() +// StartWorkspacesWithContext is the same as StartWorkspaces with the addition of +// the ability to pass a context and additional request options. +// +// See StartWorkspaces for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkSpaces) StartWorkspacesWithContext(ctx aws.Context, input *StartWorkspacesInput, opts ...request.Option) (*StartWorkspacesOutput, error) { + req, out := c.StartWorkspacesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() } -// SetDedicatedTenancyManagementCidrRange sets the DedicatedTenancyManagementCidrRange field's value. -func (s *AccountModification) SetDedicatedTenancyManagementCidrRange(v string) *AccountModification { - s.DedicatedTenancyManagementCidrRange = &v - return s -} +const opStopWorkspaces = "StopWorkspaces" -// SetDedicatedTenancySupport sets the DedicatedTenancySupport field's value. -func (s *AccountModification) SetDedicatedTenancySupport(v string) *AccountModification { - s.DedicatedTenancySupport = &v - return s -} +// StopWorkspacesRequest generates a "aws/request.Request" representing the +// client's request for the StopWorkspaces operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See StopWorkspaces for more information on using the StopWorkspaces +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the StopWorkspacesRequest method. +// req, resp := client.StopWorkspacesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/StopWorkspaces +func (c *WorkSpaces) StopWorkspacesRequest(input *StopWorkspacesInput) (req *request.Request, output *StopWorkspacesOutput) { + op := &request.Operation{ + Name: opStopWorkspaces, + HTTPMethod: "POST", + HTTPPath: "/", + } -// SetErrorCode sets the ErrorCode field's value. -func (s *AccountModification) SetErrorCode(v string) *AccountModification { - s.ErrorCode = &v - return s -} + if input == nil { + input = &StopWorkspacesInput{} + } -// SetErrorMessage sets the ErrorMessage field's value. -func (s *AccountModification) SetErrorMessage(v string) *AccountModification { - s.ErrorMessage = &v - return s + output = &StopWorkspacesOutput{} + req = c.newRequest(op, input, output) + return } -// SetModificationState sets the ModificationState field's value. -func (s *AccountModification) SetModificationState(v string) *AccountModification { - s.ModificationState = &v - return s +// StopWorkspaces API operation for Amazon WorkSpaces. +// +// Stops the specified WorkSpaces. +// +// You cannot stop a WorkSpace unless it has a running mode of AutoStop and +// a state of AVAILABLE, IMPAIRED, UNHEALTHY, or 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 WorkSpaces's +// API operation StopWorkspaces for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/StopWorkspaces +func (c *WorkSpaces) StopWorkspaces(input *StopWorkspacesInput) (*StopWorkspacesOutput, error) { + req, out := c.StopWorkspacesRequest(input) + return out, req.Send() +} + +// StopWorkspacesWithContext is the same as StopWorkspaces with the addition of +// the ability to pass a context and additional request options. +// +// See StopWorkspaces for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkSpaces) StopWorkspacesWithContext(ctx aws.Context, input *StopWorkspacesInput, opts ...request.Option) (*StopWorkspacesOutput, error) { + req, out := c.StopWorkspacesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opTerminateWorkspaces = "TerminateWorkspaces" + +// TerminateWorkspacesRequest generates a "aws/request.Request" representing the +// client's request for the TerminateWorkspaces operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See TerminateWorkspaces for more information on using the TerminateWorkspaces +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the TerminateWorkspacesRequest method. +// req, resp := client.TerminateWorkspacesRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/TerminateWorkspaces +func (c *WorkSpaces) TerminateWorkspacesRequest(input *TerminateWorkspacesInput) (req *request.Request, output *TerminateWorkspacesOutput) { + op := &request.Operation{ + Name: opTerminateWorkspaces, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &TerminateWorkspacesInput{} + } + + output = &TerminateWorkspacesOutput{} + req = c.newRequest(op, input, output) + return +} + +// TerminateWorkspaces API operation for Amazon WorkSpaces. +// +// Terminates the specified WorkSpaces. +// +// Terminating a WorkSpace is a permanent action and cannot be undone. The user's +// data is destroyed. If you need to archive any user data, contact Amazon Web +// Services before terminating the WorkSpace. +// +// You can terminate a WorkSpace that is in any state except SUSPENDED. +// +// This operation is asynchronous and returns before the WorkSpaces have been +// completely 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 WorkSpaces's +// API operation TerminateWorkspaces for usage and error information. +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/TerminateWorkspaces +func (c *WorkSpaces) TerminateWorkspaces(input *TerminateWorkspacesInput) (*TerminateWorkspacesOutput, error) { + req, out := c.TerminateWorkspacesRequest(input) + return out, req.Send() +} + +// TerminateWorkspacesWithContext is the same as TerminateWorkspaces with the addition of +// the ability to pass a context and additional request options. +// +// See TerminateWorkspaces for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkSpaces) TerminateWorkspacesWithContext(ctx aws.Context, input *TerminateWorkspacesInput, opts ...request.Option) (*TerminateWorkspacesOutput, error) { + req, out := c.TerminateWorkspacesRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +const opUpdateRulesOfIpGroup = "UpdateRulesOfIpGroup" + +// UpdateRulesOfIpGroupRequest generates a "aws/request.Request" representing the +// client's request for the UpdateRulesOfIpGroup operation. The "output" return +// value will be populated with the request's response once the request completes +// successfully. +// +// Use "Send" method on the returned Request to send the API call to the service. +// the "output" return value is not valid until after Send returns without error. +// +// See UpdateRulesOfIpGroup for more information on using the UpdateRulesOfIpGroup +// API call, and error handling. +// +// This method is useful when you want to inject custom logic or configuration +// into the SDK's request lifecycle. Such as custom headers, or retry logic. +// +// +// // Example sending a request using the UpdateRulesOfIpGroupRequest method. +// req, resp := client.UpdateRulesOfIpGroupRequest(params) +// +// err := req.Send() +// if err == nil { // resp is now filled +// fmt.Println(resp) +// } +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/UpdateRulesOfIpGroup +func (c *WorkSpaces) UpdateRulesOfIpGroupRequest(input *UpdateRulesOfIpGroupInput) (req *request.Request, output *UpdateRulesOfIpGroupOutput) { + op := &request.Operation{ + Name: opUpdateRulesOfIpGroup, + HTTPMethod: "POST", + HTTPPath: "/", + } + + if input == nil { + input = &UpdateRulesOfIpGroupInput{} + } + + output = &UpdateRulesOfIpGroupOutput{} + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) + return +} + +// UpdateRulesOfIpGroup API operation for Amazon WorkSpaces. +// +// Replaces the current rules of the specified IP access control group with +// the specified 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 WorkSpaces's +// API operation UpdateRulesOfIpGroup for usage and error information. +// +// Returned Error Types: +// * InvalidParameterValuesException +// One or more parameter values are not valid. +// +// * ResourceNotFoundException +// The resource could not be found. +// +// * ResourceLimitExceededException +// Your resource limits have been exceeded. +// +// * InvalidResourceStateException +// The state of the resource is not valid for this operation. +// +// * AccessDeniedException +// The user is not authorized to access a resource. +// +// See also, https://docs.aws.amazon.com/goto/WebAPI/workspaces-2015-04-08/UpdateRulesOfIpGroup +func (c *WorkSpaces) UpdateRulesOfIpGroup(input *UpdateRulesOfIpGroupInput) (*UpdateRulesOfIpGroupOutput, error) { + req, out := c.UpdateRulesOfIpGroupRequest(input) + return out, req.Send() +} + +// UpdateRulesOfIpGroupWithContext is the same as UpdateRulesOfIpGroup with the addition of +// the ability to pass a context and additional request options. +// +// See UpdateRulesOfIpGroup for details on how to use this API operation. +// +// The context must be non-nil and will be used for request cancellation. If +// the context is nil a panic will occur. In the future the SDK may create +// sub-contexts for http.Requests. See https://golang.org/pkg/context/ +// for more information on using Contexts. +func (c *WorkSpaces) UpdateRulesOfIpGroupWithContext(ctx aws.Context, input *UpdateRulesOfIpGroupInput, opts ...request.Option) (*UpdateRulesOfIpGroupOutput, error) { + req, out := c.UpdateRulesOfIpGroupRequest(input) + req.SetContext(ctx) + req.ApplyOptions(opts...) + return out, req.Send() +} + +// The user is not authorized to access a resource. +type AccessDeniedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s AccessDeniedException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccessDeniedException) GoString() string { + return s.String() +} + +func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { + return &AccessDeniedException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s AccessDeniedException) Code() string { + return "AccessDeniedException" +} + +// Message returns the exception's message. +func (s AccessDeniedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s AccessDeniedException) OrigErr() error { + return nil +} + +func (s AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s AccessDeniedException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s AccessDeniedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Describes a modification to the configuration of Bring Your Own License (BYOL) +// for the specified account. +type AccountModification struct { + _ struct{} `type:"structure"` + + // The IP address range, specified as an IPv4 CIDR block, for the management + // network interface used for the account. + DedicatedTenancyManagementCidrRange *string `type:"string"` + + // The status of BYOL (whether BYOL is being enabled or disabled). + DedicatedTenancySupport *string `type:"string" enum:"DedicatedTenancySupportResultEnum"` + + // The error code that is returned if the configuration of BYOL cannot be modified. + ErrorCode *string `type:"string"` + + // The text of the error message that is returned if the configuration of BYOL + // cannot be modified. + ErrorMessage *string `type:"string"` + + // The state of the modification to the configuration of BYOL. + ModificationState *string `type:"string" enum:"DedicatedTenancyModificationStateEnum"` + + // The timestamp when the modification of the BYOL configuration was started. + StartTime *time.Time `type:"timestamp"` +} + +// String returns the string representation +func (s AccountModification) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccountModification) GoString() string { + return s.String() +} + +// SetDedicatedTenancyManagementCidrRange sets the DedicatedTenancyManagementCidrRange field's value. +func (s *AccountModification) SetDedicatedTenancyManagementCidrRange(v string) *AccountModification { + s.DedicatedTenancyManagementCidrRange = &v + return s +} + +// SetDedicatedTenancySupport sets the DedicatedTenancySupport field's value. +func (s *AccountModification) SetDedicatedTenancySupport(v string) *AccountModification { + s.DedicatedTenancySupport = &v + return s +} + +// SetErrorCode sets the ErrorCode field's value. +func (s *AccountModification) SetErrorCode(v string) *AccountModification { + s.ErrorCode = &v + return s +} + +// SetErrorMessage sets the ErrorMessage field's value. +func (s *AccountModification) SetErrorMessage(v string) *AccountModification { + s.ErrorMessage = &v + return s +} + +// SetModificationState sets the ModificationState field's value. +func (s *AccountModification) SetModificationState(v string) *AccountModification { + s.ModificationState = &v + return s +} + +// SetStartTime sets the StartTime field's value. +func (s *AccountModification) SetStartTime(v time.Time) *AccountModification { + s.StartTime = &v + return s +} + +type AssociateIpGroupsInput struct { + _ struct{} `type:"structure"` + + // The identifier of the directory. + // + // DirectoryId is a required field + DirectoryId *string `min:"10" type:"string" required:"true"` + + // The identifiers of one or more IP access control groups. + // + // GroupIds is a required field + GroupIds []*string `type:"list" required:"true"` +} + +// String returns the string representation +func (s AssociateIpGroupsInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateIpGroupsInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AssociateIpGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AssociateIpGroupsInput"} + if s.DirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryId")) + } + if s.DirectoryId != nil && len(*s.DirectoryId) < 10 { + invalidParams.Add(request.NewErrParamMinLen("DirectoryId", 10)) + } + if s.GroupIds == nil { + invalidParams.Add(request.NewErrParamRequired("GroupIds")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDirectoryId sets the DirectoryId field's value. +func (s *AssociateIpGroupsInput) SetDirectoryId(v string) *AssociateIpGroupsInput { + s.DirectoryId = &v + return s +} + +// SetGroupIds sets the GroupIds field's value. +func (s *AssociateIpGroupsInput) SetGroupIds(v []*string) *AssociateIpGroupsInput { + s.GroupIds = v + return s +} + +type AssociateIpGroupsOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AssociateIpGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AssociateIpGroupsOutput) GoString() string { + return s.String() +} + +type AuthorizeIpRulesInput struct { + _ struct{} `type:"structure"` + + // The identifier of the group. + // + // GroupId is a required field + GroupId *string `type:"string" required:"true"` + + // The rules to add to the group. + // + // UserRules is a required field + UserRules []*IpRuleItem `type:"list" required:"true"` +} + +// String returns the string representation +func (s AuthorizeIpRulesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AuthorizeIpRulesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *AuthorizeIpRulesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "AuthorizeIpRulesInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + if s.UserRules == nil { + invalidParams.Add(request.NewErrParamRequired("UserRules")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *AuthorizeIpRulesInput) SetGroupId(v string) *AuthorizeIpRulesInput { + s.GroupId = &v + return s +} + +// SetUserRules sets the UserRules field's value. +func (s *AuthorizeIpRulesInput) SetUserRules(v []*IpRuleItem) *AuthorizeIpRulesInput { + s.UserRules = v + return s +} + +type AuthorizeIpRulesOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s AuthorizeIpRulesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AuthorizeIpRulesOutput) GoString() string { + return s.String() +} + +// Describes an Amazon WorkSpaces client. +type ClientProperties struct { + _ struct{} `type:"structure"` + + // Specifies whether users can cache their credentials on the Amazon WorkSpaces + // client. When enabled, users can choose to reconnect to their WorkSpaces without + // re-entering their credentials. + ReconnectEnabled *string `type:"string" enum:"ReconnectEnum"` +} + +// String returns the string representation +func (s ClientProperties) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClientProperties) GoString() string { + return s.String() +} + +// SetReconnectEnabled sets the ReconnectEnabled field's value. +func (s *ClientProperties) SetReconnectEnabled(v string) *ClientProperties { + s.ReconnectEnabled = &v + return s +} + +// Information about the Amazon WorkSpaces client. +type ClientPropertiesResult struct { + _ struct{} `type:"structure"` + + // Information about the Amazon WorkSpaces client. + ClientProperties *ClientProperties `type:"structure"` + + // The resource identifier, in the form of a directory ID. + ResourceId *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s ClientPropertiesResult) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ClientPropertiesResult) GoString() string { + return s.String() +} + +// SetClientProperties sets the ClientProperties field's value. +func (s *ClientPropertiesResult) SetClientProperties(v *ClientProperties) *ClientPropertiesResult { + s.ClientProperties = v + return s +} + +// SetResourceId sets the ResourceId field's value. +func (s *ClientPropertiesResult) SetResourceId(v string) *ClientPropertiesResult { + s.ResourceId = &v + return s +} + +// Describes the compute type. +type ComputeType struct { + _ struct{} `type:"structure"` + + // The compute type. + Name *string `type:"string" enum:"Compute"` +} + +// String returns the string representation +func (s ComputeType) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ComputeType) GoString() string { + return s.String() +} + +// SetName sets the Name field's value. +func (s *ComputeType) SetName(v string) *ComputeType { + s.Name = &v + return s +} + +type CopyWorkspaceImageInput struct { + _ struct{} `type:"structure"` + + // A description of the image. + Description *string `min:"1" type:"string"` + + // The name of the image. + // + // Name is a required field + Name *string `min:"1" type:"string" required:"true"` + + // The identifier of the source image. + // + // SourceImageId is a required field + SourceImageId *string `type:"string" required:"true"` + + // The identifier of the source Region. + // + // SourceRegion is a required field + SourceRegion *string `min:"1" type:"string" required:"true"` + + // The tags for the image. + Tags []*Tag `type:"list"` +} + +// String returns the string representation +func (s CopyWorkspaceImageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CopyWorkspaceImageInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CopyWorkspaceImageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CopyWorkspaceImageInput"} + 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) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Name", 1)) + } + if s.SourceImageId == nil { + invalidParams.Add(request.NewErrParamRequired("SourceImageId")) + } + if s.SourceRegion == nil { + invalidParams.Add(request.NewErrParamRequired("SourceRegion")) + } + if s.SourceRegion != nil && len(*s.SourceRegion) < 1 { + invalidParams.Add(request.NewErrParamMinLen("SourceRegion", 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 +} + +// SetDescription sets the Description field's value. +func (s *CopyWorkspaceImageInput) SetDescription(v string) *CopyWorkspaceImageInput { + s.Description = &v + return s +} + +// SetName sets the Name field's value. +func (s *CopyWorkspaceImageInput) SetName(v string) *CopyWorkspaceImageInput { + s.Name = &v + return s +} + +// SetSourceImageId sets the SourceImageId field's value. +func (s *CopyWorkspaceImageInput) SetSourceImageId(v string) *CopyWorkspaceImageInput { + s.SourceImageId = &v + return s +} + +// SetSourceRegion sets the SourceRegion field's value. +func (s *CopyWorkspaceImageInput) SetSourceRegion(v string) *CopyWorkspaceImageInput { + s.SourceRegion = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CopyWorkspaceImageInput) SetTags(v []*Tag) *CopyWorkspaceImageInput { + s.Tags = v + return s +} + +type CopyWorkspaceImageOutput struct { + _ struct{} `type:"structure"` + + // The identifier of the image. + ImageId *string `type:"string"` +} + +// String returns the string representation +func (s CopyWorkspaceImageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CopyWorkspaceImageOutput) GoString() string { + return s.String() +} + +// SetImageId sets the ImageId field's value. +func (s *CopyWorkspaceImageOutput) SetImageId(v string) *CopyWorkspaceImageOutput { + s.ImageId = &v + return s +} + +type CreateIpGroupInput struct { + _ struct{} `type:"structure"` + + // The description of the group. + GroupDesc *string `type:"string"` + + // The name of the group. + // + // GroupName is a required field + GroupName *string `type:"string" required:"true"` + + // The tags. Each WorkSpaces resource can have a maximum of 50 tags. + Tags []*Tag `type:"list"` + + // The rules to add to the group. + UserRules []*IpRuleItem `type:"list"` +} + +// String returns the string representation +func (s CreateIpGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateIpGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateIpGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateIpGroupInput"} + if s.GroupName == nil { + invalidParams.Add(request.NewErrParamRequired("GroupName")) + } + 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 +} + +// SetGroupDesc sets the GroupDesc field's value. +func (s *CreateIpGroupInput) SetGroupDesc(v string) *CreateIpGroupInput { + s.GroupDesc = &v + return s +} + +// SetGroupName sets the GroupName field's value. +func (s *CreateIpGroupInput) SetGroupName(v string) *CreateIpGroupInput { + s.GroupName = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateIpGroupInput) SetTags(v []*Tag) *CreateIpGroupInput { + s.Tags = v + return s +} + +// SetUserRules sets the UserRules field's value. +func (s *CreateIpGroupInput) SetUserRules(v []*IpRuleItem) *CreateIpGroupInput { + s.UserRules = v + return s +} + +type CreateIpGroupOutput struct { + _ struct{} `type:"structure"` + + // The identifier of the group. + GroupId *string `type:"string"` +} + +// String returns the string representation +func (s CreateIpGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateIpGroupOutput) GoString() string { + return s.String() +} + +// SetGroupId sets the GroupId field's value. +func (s *CreateIpGroupOutput) SetGroupId(v string) *CreateIpGroupOutput { + s.GroupId = &v + return s +} + +type CreateTagsInput struct { + _ struct{} `type:"structure"` + + // The identifier of the WorkSpaces resource. The supported resource types are + // WorkSpaces, registered directories, images, custom bundles, and IP access + // control groups. + // + // ResourceId is a required field + ResourceId *string `min:"1" type:"string" required:"true"` + + // The tags. Each WorkSpaces resource can have a maximum of 50 tags. If you + // want to add new tags to a set of existing tags, you must submit all of the + // existing tags along with the new ones. + // + // 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.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) + } + if s.ResourceId != nil && len(*s.ResourceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceId", 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 +} + +// SetResourceId sets the ResourceId field's value. +func (s *CreateTagsInput) SetResourceId(v string) *CreateTagsInput { + s.ResourceId = &v + return s +} + +// SetTags sets the Tags field's value. +func (s *CreateTagsInput) SetTags(v []*Tag) *CreateTagsInput { + s.Tags = v + return s +} + +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() +} + +type CreateWorkspacesInput struct { + _ struct{} `type:"structure"` + + // The WorkSpaces to create. You can specify up to 25 WorkSpaces. + // + // Workspaces is a required field + Workspaces []*WorkspaceRequest `min:"1" type:"list" required:"true"` +} + +// String returns the string representation +func (s CreateWorkspacesInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateWorkspacesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *CreateWorkspacesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "CreateWorkspacesInput"} + if s.Workspaces == nil { + invalidParams.Add(request.NewErrParamRequired("Workspaces")) + } + if s.Workspaces != nil && len(s.Workspaces) < 1 { + invalidParams.Add(request.NewErrParamMinLen("Workspaces", 1)) + } + if s.Workspaces != nil { + for i, v := range s.Workspaces { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Workspaces", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetWorkspaces sets the Workspaces field's value. +func (s *CreateWorkspacesInput) SetWorkspaces(v []*WorkspaceRequest) *CreateWorkspacesInput { + s.Workspaces = v + return s +} + +type CreateWorkspacesOutput struct { + _ struct{} `type:"structure"` + + // Information about the WorkSpaces that could not be created. + FailedRequests []*FailedCreateWorkspaceRequest `type:"list"` + + // Information about the WorkSpaces that were created. + // + // Because this operation is asynchronous, the identifier returned is not immediately + // available for use with other operations. For example, if you call DescribeWorkspaces + // before the WorkSpace is created, the information returned can be incomplete. + PendingRequests []*Workspace `type:"list"` } -// SetStartTime sets the StartTime field's value. -func (s *AccountModification) SetStartTime(v time.Time) *AccountModification { - s.StartTime = &v +// String returns the string representation +func (s CreateWorkspacesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s CreateWorkspacesOutput) GoString() string { + return s.String() +} + +// SetFailedRequests sets the FailedRequests field's value. +func (s *CreateWorkspacesOutput) SetFailedRequests(v []*FailedCreateWorkspaceRequest) *CreateWorkspacesOutput { + s.FailedRequests = v return s } -type AssociateIpGroupsInput struct { +// SetPendingRequests sets the PendingRequests field's value. +func (s *CreateWorkspacesOutput) SetPendingRequests(v []*Workspace) *CreateWorkspacesOutput { + s.PendingRequests = v + return s +} + +// Describes the default values that are used to create WorkSpaces. For more +// information, see Update Directory Details for Your WorkSpaces (https://docs.aws.amazon.com/workspaces/latest/adminguide/update-directory-details.html). +type DefaultWorkspaceCreationProperties struct { _ struct{} `type:"structure"` - // The identifier of the directory. + // The identifier of any security groups to apply to WorkSpaces when they are + // created. + CustomSecurityGroupId *string `min:"11" type:"string"` + + // The organizational unit (OU) in the directory for the WorkSpace machine accounts. + DefaultOu *string `type:"string"` + + // Specifies whether to automatically assign an Elastic public IP address to + // WorkSpaces in this directory by default. If enabled, the Elastic public IP + // address allows outbound internet access from your WorkSpaces when you’re + // using an internet gateway in the Amazon VPC in which your WorkSpaces are + // located. If you're using a Network Address Translation (NAT) gateway for + // outbound internet access from your VPC, or if your WorkSpaces are in public + // subnets and you manually assign them Elastic IP addresses, you should disable + // this setting. This setting applies to new WorkSpaces that you launch or to + // existing WorkSpaces that you rebuild. For more information, see Configure + // a VPC for Amazon WorkSpaces (https://docs.aws.amazon.com/workspaces/latest/adminguide/amazon-workspaces-vpc.html). + EnableInternetAccess *bool `type:"boolean"` + + // Specifies whether maintenance mode is enabled for WorkSpaces. For more information, + // see WorkSpace Maintenance (https://docs.aws.amazon.com/workspaces/latest/adminguide/workspace-maintenance.html). + EnableMaintenanceMode *bool `type:"boolean"` + + // Specifies whether the directory is enabled for Amazon WorkDocs. + EnableWorkDocs *bool `type:"boolean"` + + // Specifies whether WorkSpace users are local administrators on their WorkSpaces. + UserEnabledAsLocalAdministrator *bool `type:"boolean"` +} + +// String returns the string representation +func (s DefaultWorkspaceCreationProperties) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DefaultWorkspaceCreationProperties) GoString() string { + return s.String() +} + +// SetCustomSecurityGroupId sets the CustomSecurityGroupId field's value. +func (s *DefaultWorkspaceCreationProperties) SetCustomSecurityGroupId(v string) *DefaultWorkspaceCreationProperties { + s.CustomSecurityGroupId = &v + return s +} + +// SetDefaultOu sets the DefaultOu field's value. +func (s *DefaultWorkspaceCreationProperties) SetDefaultOu(v string) *DefaultWorkspaceCreationProperties { + s.DefaultOu = &v + return s +} + +// SetEnableInternetAccess sets the EnableInternetAccess field's value. +func (s *DefaultWorkspaceCreationProperties) SetEnableInternetAccess(v bool) *DefaultWorkspaceCreationProperties { + s.EnableInternetAccess = &v + return s +} + +// SetEnableMaintenanceMode sets the EnableMaintenanceMode field's value. +func (s *DefaultWorkspaceCreationProperties) SetEnableMaintenanceMode(v bool) *DefaultWorkspaceCreationProperties { + s.EnableMaintenanceMode = &v + return s +} + +// SetEnableWorkDocs sets the EnableWorkDocs field's value. +func (s *DefaultWorkspaceCreationProperties) SetEnableWorkDocs(v bool) *DefaultWorkspaceCreationProperties { + s.EnableWorkDocs = &v + return s +} + +// SetUserEnabledAsLocalAdministrator sets the UserEnabledAsLocalAdministrator field's value. +func (s *DefaultWorkspaceCreationProperties) SetUserEnabledAsLocalAdministrator(v bool) *DefaultWorkspaceCreationProperties { + s.UserEnabledAsLocalAdministrator = &v + return s +} + +type DeleteIpGroupInput struct { + _ struct{} `type:"structure"` + + // The identifier of the IP access control group. // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` + // GroupId is a required field + GroupId *string `type:"string" required:"true"` +} - // The identifiers of one or more IP access control groups. +// String returns the string representation +func (s DeleteIpGroupInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteIpGroupInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteIpGroupInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteIpGroupInput"} + if s.GroupId == nil { + invalidParams.Add(request.NewErrParamRequired("GroupId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetGroupId sets the GroupId field's value. +func (s *DeleteIpGroupInput) SetGroupId(v string) *DeleteIpGroupInput { + s.GroupId = &v + return s +} + +type DeleteIpGroupOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteIpGroupOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteIpGroupOutput) GoString() string { + return s.String() +} + +type DeleteTagsInput struct { + _ struct{} `type:"structure"` + + // The identifier of the WorkSpaces resource. The supported resource types are + // WorkSpaces, registered directories, images, custom bundles, and IP access + // control groups. // - // GroupIds is a required field - GroupIds []*string `type:"list" required:"true"` + // ResourceId is a required field + ResourceId *string `min:"1" type:"string" required:"true"` + + // The tag keys. + // + // TagKeys is a required field + TagKeys []*string `type:"list" required:"true"` } // String returns the string representation -func (s AssociateIpGroupsInput) String() string { +func (s DeleteTagsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateIpGroupsInput) GoString() string { +func (s DeleteTagsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateIpGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateIpGroupsInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) +func (s *DeleteTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteTagsInput"} + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) } - if s.GroupIds == nil { - invalidParams.Add(request.NewErrParamRequired("GroupIds")) + if s.ResourceId != nil && len(*s.ResourceId) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) + } + if s.TagKeys == nil { + invalidParams.Add(request.NewErrParamRequired("TagKeys")) } if invalidParams.Len() > 0 { @@ -3329,64 +4712,113 @@ func (s *AssociateIpGroupsInput) Validate() error { return nil } -// SetDirectoryId sets the DirectoryId field's value. -func (s *AssociateIpGroupsInput) SetDirectoryId(v string) *AssociateIpGroupsInput { - s.DirectoryId = &v +// SetResourceId sets the ResourceId field's value. +func (s *DeleteTagsInput) SetResourceId(v string) *DeleteTagsInput { + s.ResourceId = &v return s } -// SetGroupIds sets the GroupIds field's value. -func (s *AssociateIpGroupsInput) SetGroupIds(v []*string) *AssociateIpGroupsInput { - s.GroupIds = v +// SetTagKeys sets the TagKeys field's value. +func (s *DeleteTagsInput) SetTagKeys(v []*string) *DeleteTagsInput { + s.TagKeys = v return s } -type AssociateIpGroupsOutput struct { +type DeleteTagsOutput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s AssociateIpGroupsOutput) String() string { +func (s DeleteTagsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AssociateIpGroupsOutput) GoString() string { +func (s DeleteTagsOutput) GoString() string { return s.String() } -type AuthorizeIpRulesInput struct { +type DeleteWorkspaceImageInput struct { _ struct{} `type:"structure"` - // The identifier of the group. + // The identifier of the image. // - // GroupId is a required field - GroupId *string `type:"string" required:"true"` + // ImageId is a required field + ImageId *string `type:"string" required:"true"` +} - // The rules to add to the group. +// String returns the string representation +func (s DeleteWorkspaceImageInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteWorkspaceImageInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DeleteWorkspaceImageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeleteWorkspaceImageInput"} + if s.ImageId == nil { + invalidParams.Add(request.NewErrParamRequired("ImageId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetImageId sets the ImageId field's value. +func (s *DeleteWorkspaceImageInput) SetImageId(v string) *DeleteWorkspaceImageInput { + s.ImageId = &v + return s +} + +type DeleteWorkspaceImageOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s DeleteWorkspaceImageOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeleteWorkspaceImageOutput) GoString() string { + return s.String() +} + +type DeregisterWorkspaceDirectoryInput struct { + _ struct{} `type:"structure"` + + // The identifier of the directory. If any WorkSpaces are registered to this + // directory, you must remove them before you deregister the directory, or you + // will receive an OperationNotSupportedException error. // - // UserRules is a required field - UserRules []*IpRuleItem `type:"list" required:"true"` + // DirectoryId is a required field + DirectoryId *string `min:"10" type:"string" required:"true"` } // String returns the string representation -func (s AuthorizeIpRulesInput) String() string { +func (s DeregisterWorkspaceDirectoryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AuthorizeIpRulesInput) GoString() string { +func (s DeregisterWorkspaceDirectoryInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *AuthorizeIpRulesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AuthorizeIpRulesInput"} - if s.GroupId == nil { - invalidParams.Add(request.NewErrParamRequired("GroupId")) - } - if s.UserRules == nil { - invalidParams.Add(request.NewErrParamRequired("UserRules")) +func (s *DeregisterWorkspaceDirectoryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DeregisterWorkspaceDirectoryInput"} + if s.DirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryId")) + } + if s.DirectoryId != nil && len(*s.DirectoryId) < 10 { + invalidParams.Add(request.NewErrParamMinLen("DirectoryId", 10)) } if invalidParams.Len() > 0 { @@ -3395,180 +4827,175 @@ func (s *AuthorizeIpRulesInput) Validate() error { return nil } -// SetGroupId sets the GroupId field's value. -func (s *AuthorizeIpRulesInput) SetGroupId(v string) *AuthorizeIpRulesInput { - s.GroupId = &v +// SetDirectoryId sets the DirectoryId field's value. +func (s *DeregisterWorkspaceDirectoryInput) SetDirectoryId(v string) *DeregisterWorkspaceDirectoryInput { + s.DirectoryId = &v return s } -// SetUserRules sets the UserRules field's value. -func (s *AuthorizeIpRulesInput) SetUserRules(v []*IpRuleItem) *AuthorizeIpRulesInput { - s.UserRules = v - return s +type DeregisterWorkspaceDirectoryOutput struct { + _ struct{} `type:"structure"` } -type AuthorizeIpRulesOutput struct { +// String returns the string representation +func (s DeregisterWorkspaceDirectoryOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DeregisterWorkspaceDirectoryOutput) GoString() string { + return s.String() +} + +type DescribeAccountInput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s AuthorizeIpRulesOutput) String() string { +func (s DescribeAccountInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s AuthorizeIpRulesOutput) GoString() string { +func (s DescribeAccountInput) GoString() string { return s.String() } -// Describes an Amazon WorkSpaces client. -type ClientProperties struct { +type DescribeAccountModificationsInput struct { _ struct{} `type:"structure"` - // Specifies whether users can cache their credentials on the Amazon WorkSpaces - // client. When enabled, users can choose to reconnect to their WorkSpaces without - // re-entering their credentials. - ReconnectEnabled *string `type:"string" enum:"ReconnectEnum"` + // If you received a NextToken from a previous call that was paginated, provide + // this token to receive the next set of results. + NextToken *string `min:"1" type:"string"` } // String returns the string representation -func (s ClientProperties) String() string { +func (s DescribeAccountModificationsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClientProperties) GoString() string { +func (s DescribeAccountModificationsInput) GoString() string { return s.String() } -// SetReconnectEnabled sets the ReconnectEnabled field's value. -func (s *ClientProperties) SetReconnectEnabled(v string) *ClientProperties { - s.ReconnectEnabled = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeAccountModificationsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeAccountModificationsInput"} + 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 *DescribeAccountModificationsInput) SetNextToken(v string) *DescribeAccountModificationsInput { + s.NextToken = &v return s } -// Information about the Amazon WorkSpaces client. -type ClientPropertiesResult struct { +type DescribeAccountModificationsOutput struct { _ struct{} `type:"structure"` - // Information about the Amazon WorkSpaces client. - ClientProperties *ClientProperties `type:"structure"` + // The list of modifications to the configuration of BYOL. + AccountModifications []*AccountModification `type:"list"` - // The resource identifier, in the form of a directory ID. - ResourceId *string `min:"1" type:"string"` + // The token to use to retrieve the next set of results, or null if no more + // results are available. + NextToken *string `min:"1" type:"string"` } // String returns the string representation -func (s ClientPropertiesResult) String() string { +func (s DescribeAccountModificationsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ClientPropertiesResult) GoString() string { +func (s DescribeAccountModificationsOutput) GoString() string { return s.String() } -// SetClientProperties sets the ClientProperties field's value. -func (s *ClientPropertiesResult) SetClientProperties(v *ClientProperties) *ClientPropertiesResult { - s.ClientProperties = v +// SetAccountModifications sets the AccountModifications field's value. +func (s *DescribeAccountModificationsOutput) SetAccountModifications(v []*AccountModification) *DescribeAccountModificationsOutput { + s.AccountModifications = v return s } -// SetResourceId sets the ResourceId field's value. -func (s *ClientPropertiesResult) SetResourceId(v string) *ClientPropertiesResult { - s.ResourceId = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeAccountModificationsOutput) SetNextToken(v string) *DescribeAccountModificationsOutput { + s.NextToken = &v return s } -// Describes the compute type. -type ComputeType struct { +type DescribeAccountOutput struct { _ struct{} `type:"structure"` - // The compute type. - Name *string `type:"string" enum:"Compute"` + // The IP address range, specified as an IPv4 CIDR block, used for the management + // network interface. + // + // The management network interface is connected to a secure Amazon WorkSpaces + // management network. It is used for interactive streaming of the WorkSpace + // desktop to Amazon WorkSpaces clients, and to allow Amazon WorkSpaces to manage + // the WorkSpace. + DedicatedTenancyManagementCidrRange *string `type:"string"` + + // The status of BYOL (whether BYOL is enabled or disabled). + DedicatedTenancySupport *string `type:"string" enum:"DedicatedTenancySupportResultEnum"` } // String returns the string representation -func (s ComputeType) String() string { +func (s DescribeAccountOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ComputeType) GoString() string { +func (s DescribeAccountOutput) GoString() string { return s.String() } -// SetName sets the Name field's value. -func (s *ComputeType) SetName(v string) *ComputeType { - s.Name = &v +// SetDedicatedTenancyManagementCidrRange sets the DedicatedTenancyManagementCidrRange field's value. +func (s *DescribeAccountOutput) SetDedicatedTenancyManagementCidrRange(v string) *DescribeAccountOutput { + s.DedicatedTenancyManagementCidrRange = &v return s } -type CopyWorkspaceImageInput struct { - _ struct{} `type:"structure"` - - // A description of the image. - Description *string `min:"1" type:"string"` - - // The name of the image. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` +// SetDedicatedTenancySupport sets the DedicatedTenancySupport field's value. +func (s *DescribeAccountOutput) SetDedicatedTenancySupport(v string) *DescribeAccountOutput { + s.DedicatedTenancySupport = &v + return s +} - // The identifier of the source image. - // - // SourceImageId is a required field - SourceImageId *string `type:"string" required:"true"` +type DescribeClientPropertiesInput struct { + _ struct{} `type:"structure"` - // The identifier of the source Region. + // The resource identifier, in the form of directory IDs. // - // SourceRegion is a required field - SourceRegion *string `min:"1" type:"string" required:"true"` - - // The tags for the image. - Tags []*Tag `type:"list"` + // ResourceIds is a required field + ResourceIds []*string `min:"1" type:"list" required:"true"` } // String returns the string representation -func (s CopyWorkspaceImageInput) String() string { +func (s DescribeClientPropertiesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CopyWorkspaceImageInput) GoString() string { +func (s DescribeClientPropertiesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CopyWorkspaceImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyWorkspaceImageInput"} - 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) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.SourceImageId == nil { - invalidParams.Add(request.NewErrParamRequired("SourceImageId")) - } - if s.SourceRegion == nil { - invalidParams.Add(request.NewErrParamRequired("SourceRegion")) - } - if s.SourceRegion != nil && len(*s.SourceRegion) < 1 { - invalidParams.Add(request.NewErrParamMinLen("SourceRegion", 1)) +func (s *DescribeClientPropertiesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeClientPropertiesInput"} + if s.ResourceIds == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceIds")) } - 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 s.ResourceIds != nil && len(s.ResourceIds) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ResourceIds", 1)) } if invalidParams.Len() > 0 { @@ -3577,102 +5004,67 @@ func (s *CopyWorkspaceImageInput) Validate() error { return nil } -// SetDescription sets the Description field's value. -func (s *CopyWorkspaceImageInput) SetDescription(v string) *CopyWorkspaceImageInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CopyWorkspaceImageInput) SetName(v string) *CopyWorkspaceImageInput { - s.Name = &v - return s -} - -// SetSourceImageId sets the SourceImageId field's value. -func (s *CopyWorkspaceImageInput) SetSourceImageId(v string) *CopyWorkspaceImageInput { - s.SourceImageId = &v - return s -} - -// SetSourceRegion sets the SourceRegion field's value. -func (s *CopyWorkspaceImageInput) SetSourceRegion(v string) *CopyWorkspaceImageInput { - s.SourceRegion = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CopyWorkspaceImageInput) SetTags(v []*Tag) *CopyWorkspaceImageInput { - s.Tags = v +// SetResourceIds sets the ResourceIds field's value. +func (s *DescribeClientPropertiesInput) SetResourceIds(v []*string) *DescribeClientPropertiesInput { + s.ResourceIds = v return s } -type CopyWorkspaceImageOutput struct { +type DescribeClientPropertiesOutput struct { _ struct{} `type:"structure"` - // The identifier of the image. - ImageId *string `type:"string"` + // Information about the specified Amazon WorkSpaces clients. + ClientPropertiesList []*ClientPropertiesResult `type:"list"` } // String returns the string representation -func (s CopyWorkspaceImageOutput) String() string { +func (s DescribeClientPropertiesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CopyWorkspaceImageOutput) GoString() string { +func (s DescribeClientPropertiesOutput) GoString() string { return s.String() } -// SetImageId sets the ImageId field's value. -func (s *CopyWorkspaceImageOutput) SetImageId(v string) *CopyWorkspaceImageOutput { - s.ImageId = &v +// SetClientPropertiesList sets the ClientPropertiesList field's value. +func (s *DescribeClientPropertiesOutput) SetClientPropertiesList(v []*ClientPropertiesResult) *DescribeClientPropertiesOutput { + s.ClientPropertiesList = v return s } -type CreateIpGroupInput struct { +type DescribeIpGroupsInput struct { _ struct{} `type:"structure"` - // The description of the group. - GroupDesc *string `type:"string"` - - // The name of the group. - // - // GroupName is a required field - GroupName *string `type:"string" required:"true"` + // The identifiers of one or more IP access control groups. + GroupIds []*string `type:"list"` - // The tags. Each WorkSpaces resource can have a maximum of 50 tags. - Tags []*Tag `type:"list"` + // The maximum number of items to return. + MaxResults *int64 `min:"1" type:"integer"` - // The rules to add to the group. - UserRules []*IpRuleItem `type:"list"` + // If you received a NextToken from a previous call that was paginated, provide + // this token to receive the next set of results. + NextToken *string `min:"1" type:"string"` } // String returns the string representation -func (s CreateIpGroupInput) String() string { +func (s DescribeIpGroupsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateIpGroupInput) GoString() string { +func (s DescribeIpGroupsInput) GoString() string { return s.String() } - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateIpGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateIpGroupInput"} - if s.GroupName == nil { - invalidParams.Add(request.NewErrParamRequired("GroupName")) + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeIpGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeIpGroupsInput"} + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 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 s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } if invalidParams.Len() > 0 { @@ -3681,54 +5073,58 @@ func (s *CreateIpGroupInput) Validate() error { return nil } -// SetGroupDesc sets the GroupDesc field's value. -func (s *CreateIpGroupInput) SetGroupDesc(v string) *CreateIpGroupInput { - s.GroupDesc = &v - return s -} - -// SetGroupName sets the GroupName field's value. -func (s *CreateIpGroupInput) SetGroupName(v string) *CreateIpGroupInput { - s.GroupName = &v +// SetGroupIds sets the GroupIds field's value. +func (s *DescribeIpGroupsInput) SetGroupIds(v []*string) *DescribeIpGroupsInput { + s.GroupIds = v return s } -// SetTags sets the Tags field's value. -func (s *CreateIpGroupInput) SetTags(v []*Tag) *CreateIpGroupInput { - s.Tags = v +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeIpGroupsInput) SetMaxResults(v int64) *DescribeIpGroupsInput { + s.MaxResults = &v return s } -// SetUserRules sets the UserRules field's value. -func (s *CreateIpGroupInput) SetUserRules(v []*IpRuleItem) *CreateIpGroupInput { - s.UserRules = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeIpGroupsInput) SetNextToken(v string) *DescribeIpGroupsInput { + s.NextToken = &v return s } -type CreateIpGroupOutput struct { +type DescribeIpGroupsOutput struct { _ struct{} `type:"structure"` - // The identifier of the group. - GroupId *string `type:"string"` + // The token to use to retrieve the next set of results, or null if no more + // results are available. + NextToken *string `min:"1" type:"string"` + + // Information about the IP access control groups. + Result []*IpGroup `type:"list"` } // String returns the string representation -func (s CreateIpGroupOutput) String() string { +func (s DescribeIpGroupsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateIpGroupOutput) GoString() string { +func (s DescribeIpGroupsOutput) GoString() string { return s.String() } -// SetGroupId sets the GroupId field's value. -func (s *CreateIpGroupOutput) SetGroupId(v string) *CreateIpGroupOutput { - s.GroupId = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeIpGroupsOutput) SetNextToken(v string) *DescribeIpGroupsOutput { + s.NextToken = &v return s } -type CreateTagsInput struct { +// SetResult sets the Result field's value. +func (s *DescribeIpGroupsOutput) SetResult(v []*IpGroup) *DescribeIpGroupsOutput { + s.Result = v + return s +} + +type DescribeTagsInput struct { _ struct{} `type:"structure"` // The identifier of the WorkSpaces resource. The supported resource types are @@ -3737,45 +5133,27 @@ type CreateTagsInput struct { // // ResourceId is a required field ResourceId *string `min:"1" type:"string" required:"true"` - - // The tags. Each WorkSpaces resource can have a maximum of 50 tags. - // - // Tags is a required field - Tags []*Tag `type:"list" required:"true"` } // String returns the string representation -func (s CreateTagsInput) String() string { +func (s DescribeTagsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTagsInput) GoString() string { +func (s DescribeTagsInput) 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"} +func (s *DescribeTagsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeTagsInput"} 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.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 @@ -3784,68 +5162,71 @@ func (s *CreateTagsInput) Validate() error { } // SetResourceId sets the ResourceId field's value. -func (s *CreateTagsInput) SetResourceId(v string) *CreateTagsInput { +func (s *DescribeTagsInput) SetResourceId(v string) *DescribeTagsInput { s.ResourceId = &v return s } -// SetTags sets the Tags field's value. -func (s *CreateTagsInput) SetTags(v []*Tag) *CreateTagsInput { - s.Tags = v - return s -} - -type CreateTagsOutput struct { +type DescribeTagsOutput struct { _ struct{} `type:"structure"` + + // The tags. + TagList []*Tag `type:"list"` } // String returns the string representation -func (s CreateTagsOutput) String() string { +func (s DescribeTagsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateTagsOutput) GoString() string { +func (s DescribeTagsOutput) GoString() string { return s.String() } -type CreateWorkspacesInput struct { +// SetTagList sets the TagList field's value. +func (s *DescribeTagsOutput) SetTagList(v []*Tag) *DescribeTagsOutput { + s.TagList = v + return s +} + +type DescribeWorkspaceBundlesInput struct { _ struct{} `type:"structure"` - // The WorkSpaces to create. You can specify up to 25 WorkSpaces. + // The identifiers of the bundles. You cannot combine this parameter with any + // other filter. + BundleIds []*string `min:"1" type:"list"` + + // The token for the next set of results. (You received this token from a previous + // call.) + NextToken *string `min:"1" type:"string"` + + // The owner of the bundles. You cannot combine this parameter with any other + // filter. // - // Workspaces is a required field - Workspaces []*WorkspaceRequest `min:"1" type:"list" required:"true"` + // Specify AMAZON to describe the bundles provided by AWS or null to describe + // the bundles that belong to your account. + Owner *string `type:"string"` } // String returns the string representation -func (s CreateWorkspacesInput) String() string { +func (s DescribeWorkspaceBundlesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s CreateWorkspacesInput) GoString() string { +func (s DescribeWorkspaceBundlesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *CreateWorkspacesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateWorkspacesInput"} - if s.Workspaces == nil { - invalidParams.Add(request.NewErrParamRequired("Workspaces")) - } - if s.Workspaces != nil && len(s.Workspaces) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Workspaces", 1)) +func (s *DescribeWorkspaceBundlesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeWorkspaceBundlesInput"} + if s.BundleIds != nil && len(s.BundleIds) < 1 { + invalidParams.Add(request.NewErrParamMinLen("BundleIds", 1)) } - if s.Workspaces != nil { - for i, v := range s.Workspaces { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Workspaces", i), err.(request.ErrInvalidParams)) - } - } + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } if invalidParams.Len() > 0 { @@ -3854,133 +5235,188 @@ func (s *CreateWorkspacesInput) Validate() error { return nil } -// SetWorkspaces sets the Workspaces field's value. -func (s *CreateWorkspacesInput) SetWorkspaces(v []*WorkspaceRequest) *CreateWorkspacesInput { - s.Workspaces = v +// SetBundleIds sets the BundleIds field's value. +func (s *DescribeWorkspaceBundlesInput) SetBundleIds(v []*string) *DescribeWorkspaceBundlesInput { + s.BundleIds = v return s } -type CreateWorkspacesOutput struct { +// SetNextToken sets the NextToken field's value. +func (s *DescribeWorkspaceBundlesInput) SetNextToken(v string) *DescribeWorkspaceBundlesInput { + s.NextToken = &v + return s +} + +// SetOwner sets the Owner field's value. +func (s *DescribeWorkspaceBundlesInput) SetOwner(v string) *DescribeWorkspaceBundlesInput { + s.Owner = &v + return s +} + +type DescribeWorkspaceBundlesOutput struct { _ struct{} `type:"structure"` - // Information about the WorkSpaces that could not be created. - FailedRequests []*FailedCreateWorkspaceRequest `type:"list"` + // Information about the bundles. + Bundles []*WorkspaceBundle `type:"list"` - // Information about the WorkSpaces that were created. - // - // Because this operation is asynchronous, the identifier returned is not immediately - // available for use with other operations. For example, if you call DescribeWorkspaces - // before the WorkSpace is created, the information returned can be incomplete. - PendingRequests []*Workspace `type:"list"` + // The token to use to retrieve the next set of results, or null if there are + // no more results available. This token is valid for one day and must be used + // within that time frame. + NextToken *string `min:"1" type:"string"` } // String returns the string representation -func (s CreateWorkspacesOutput) String() string { +func (s DescribeWorkspaceBundlesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DescribeWorkspaceBundlesOutput) GoString() string { + return s.String() +} + +// SetBundles sets the Bundles field's value. +func (s *DescribeWorkspaceBundlesOutput) SetBundles(v []*WorkspaceBundle) *DescribeWorkspaceBundlesOutput { + s.Bundles = v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeWorkspaceBundlesOutput) SetNextToken(v string) *DescribeWorkspaceBundlesOutput { + s.NextToken = &v + return s +} + +type DescribeWorkspaceDirectoriesInput struct { + _ struct{} `type:"structure"` + + // The identifiers of the directories. If the value is null, all directories + // are retrieved. + DirectoryIds []*string `min:"1" type:"list"` + + // The maximum number of directories to return. + Limit *int64 `min:"1" type:"integer"` + + // If you received a NextToken from a previous call that was paginated, provide + // this token to receive the next set of results. + NextToken *string `min:"1" type:"string"` +} + +// String returns the string representation +func (s DescribeWorkspaceDirectoriesInput) String() string { return awsutil.Prettify(s) } -// GoString returns the string representation -func (s CreateWorkspacesOutput) GoString() string { - return s.String() +// GoString returns the string representation +func (s DescribeWorkspaceDirectoriesInput) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *DescribeWorkspaceDirectoriesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeWorkspaceDirectoriesInput"} + if s.DirectoryIds != nil && len(s.DirectoryIds) < 1 { + invalidParams.Add(request.NewErrParamMinLen("DirectoryIds", 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 +} + +// SetDirectoryIds sets the DirectoryIds field's value. +func (s *DescribeWorkspaceDirectoriesInput) SetDirectoryIds(v []*string) *DescribeWorkspaceDirectoriesInput { + s.DirectoryIds = v + return s } -// SetFailedRequests sets the FailedRequests field's value. -func (s *CreateWorkspacesOutput) SetFailedRequests(v []*FailedCreateWorkspaceRequest) *CreateWorkspacesOutput { - s.FailedRequests = v +// SetLimit sets the Limit field's value. +func (s *DescribeWorkspaceDirectoriesInput) SetLimit(v int64) *DescribeWorkspaceDirectoriesInput { + s.Limit = &v return s } -// SetPendingRequests sets the PendingRequests field's value. -func (s *CreateWorkspacesOutput) SetPendingRequests(v []*Workspace) *CreateWorkspacesOutput { - s.PendingRequests = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeWorkspaceDirectoriesInput) SetNextToken(v string) *DescribeWorkspaceDirectoriesInput { + s.NextToken = &v return s } -// Describes the default values used to create a WorkSpace. -type DefaultWorkspaceCreationProperties struct { +type DescribeWorkspaceDirectoriesOutput struct { _ struct{} `type:"structure"` - // The identifier of any security groups to apply to WorkSpaces when they are - // created. - CustomSecurityGroupId *string `type:"string"` - - // The organizational unit (OU) in the directory for the WorkSpace machine accounts. - DefaultOu *string `type:"string"` - - // The public IP address to attach to all WorkSpaces that are created or rebuilt. - EnableInternetAccess *bool `type:"boolean"` - - // Specifies whether the directory is enabled for Amazon WorkDocs. - EnableWorkDocs *bool `type:"boolean"` + // Information about the directories. + Directories []*WorkspaceDirectory `type:"list"` - // Specifies whether the WorkSpace user is an administrator on the WorkSpace. - UserEnabledAsLocalAdministrator *bool `type:"boolean"` + // The token to use to retrieve the next set of results, or null if no more + // results are available. + NextToken *string `min:"1" type:"string"` } // String returns the string representation -func (s DefaultWorkspaceCreationProperties) String() string { +func (s DescribeWorkspaceDirectoriesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DefaultWorkspaceCreationProperties) GoString() string { +func (s DescribeWorkspaceDirectoriesOutput) GoString() string { return s.String() } -// SetCustomSecurityGroupId sets the CustomSecurityGroupId field's value. -func (s *DefaultWorkspaceCreationProperties) SetCustomSecurityGroupId(v string) *DefaultWorkspaceCreationProperties { - s.CustomSecurityGroupId = &v - return s -} - -// SetDefaultOu sets the DefaultOu field's value. -func (s *DefaultWorkspaceCreationProperties) SetDefaultOu(v string) *DefaultWorkspaceCreationProperties { - s.DefaultOu = &v +// SetDirectories sets the Directories field's value. +func (s *DescribeWorkspaceDirectoriesOutput) SetDirectories(v []*WorkspaceDirectory) *DescribeWorkspaceDirectoriesOutput { + s.Directories = v return s } -// SetEnableInternetAccess sets the EnableInternetAccess field's value. -func (s *DefaultWorkspaceCreationProperties) SetEnableInternetAccess(v bool) *DefaultWorkspaceCreationProperties { - s.EnableInternetAccess = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeWorkspaceDirectoriesOutput) SetNextToken(v string) *DescribeWorkspaceDirectoriesOutput { + s.NextToken = &v return s } -// SetEnableWorkDocs sets the EnableWorkDocs field's value. -func (s *DefaultWorkspaceCreationProperties) SetEnableWorkDocs(v bool) *DefaultWorkspaceCreationProperties { - s.EnableWorkDocs = &v - return s -} +type DescribeWorkspaceImagesInput struct { + _ struct{} `type:"structure"` -// SetUserEnabledAsLocalAdministrator sets the UserEnabledAsLocalAdministrator field's value. -func (s *DefaultWorkspaceCreationProperties) SetUserEnabledAsLocalAdministrator(v bool) *DefaultWorkspaceCreationProperties { - s.UserEnabledAsLocalAdministrator = &v - return s -} + // The identifier of the image. + ImageIds []*string `min:"1" type:"list"` -type DeleteIpGroupInput struct { - _ struct{} `type:"structure"` + // The maximum number of items to return. + MaxResults *int64 `min:"1" type:"integer"` - // The identifier of the IP access control group. - // - // GroupId is a required field - GroupId *string `type:"string" required:"true"` + // If you received a NextToken from a previous call that was paginated, provide + // this token to receive the next set of results. + NextToken *string `min:"1" type:"string"` } // String returns the string representation -func (s DeleteIpGroupInput) String() string { +func (s DescribeWorkspaceImagesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteIpGroupInput) GoString() string { +func (s DescribeWorkspaceImagesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteIpGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteIpGroupInput"} - if s.GroupId == nil { - invalidParams.Add(request.NewErrParamRequired("GroupId")) +func (s *DescribeWorkspaceImagesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeWorkspaceImagesInput"} + 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.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) } if invalidParams.Len() > 0 { @@ -3989,63 +5425,81 @@ func (s *DeleteIpGroupInput) Validate() error { return nil } -// SetGroupId sets the GroupId field's value. -func (s *DeleteIpGroupInput) SetGroupId(v string) *DeleteIpGroupInput { - s.GroupId = &v +// SetImageIds sets the ImageIds field's value. +func (s *DescribeWorkspaceImagesInput) SetImageIds(v []*string) *DescribeWorkspaceImagesInput { + s.ImageIds = v return s } -type DeleteIpGroupOutput struct { +// SetMaxResults sets the MaxResults field's value. +func (s *DescribeWorkspaceImagesInput) SetMaxResults(v int64) *DescribeWorkspaceImagesInput { + s.MaxResults = &v + return s +} + +// SetNextToken sets the NextToken field's value. +func (s *DescribeWorkspaceImagesInput) SetNextToken(v string) *DescribeWorkspaceImagesInput { + s.NextToken = &v + return s +} + +type DescribeWorkspaceImagesOutput struct { _ struct{} `type:"structure"` + + // Information about the images. + Images []*WorkspaceImage `type:"list"` + + // The token to use to retrieve the next set of results, or null if no more + // results are available. + NextToken *string `min:"1" type:"string"` } // String returns the string representation -func (s DeleteIpGroupOutput) String() string { +func (s DescribeWorkspaceImagesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteIpGroupOutput) GoString() string { +func (s DescribeWorkspaceImagesOutput) GoString() string { return s.String() } -type DeleteTagsInput struct { - _ struct{} `type:"structure"` +// SetImages sets the Images field's value. +func (s *DescribeWorkspaceImagesOutput) SetImages(v []*WorkspaceImage) *DescribeWorkspaceImagesOutput { + s.Images = v + return s +} - // The identifier of the WorkSpaces resource. The supported resource types are - // WorkSpaces, registered directories, images, custom bundles, and IP access - // control groups. - // - // ResourceId is a required field - ResourceId *string `min:"1" type:"string" required:"true"` +// SetNextToken sets the NextToken field's value. +func (s *DescribeWorkspaceImagesOutput) SetNextToken(v string) *DescribeWorkspaceImagesOutput { + s.NextToken = &v + return s +} - // The tag keys. +type DescribeWorkspaceSnapshotsInput struct { + _ struct{} `type:"structure"` + + // The identifier of the WorkSpace. // - // TagKeys is a required field - TagKeys []*string `type:"list" required:"true"` + // WorkspaceId is a required field + WorkspaceId *string `type:"string" required:"true"` } // String returns the string representation -func (s DeleteTagsInput) String() string { +func (s DescribeWorkspaceSnapshotsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTagsInput) GoString() string { +func (s DescribeWorkspaceSnapshotsInput) 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.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.ResourceId != nil && len(*s.ResourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) +func (s *DescribeWorkspaceSnapshotsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeWorkspaceSnapshotsInput"} + if s.WorkspaceId == nil { + invalidParams.Add(request.NewErrParamRequired("WorkspaceId")) } if invalidParams.Len() > 0 { @@ -4054,56 +5508,75 @@ func (s *DeleteTagsInput) Validate() error { return nil } -// SetResourceId sets the ResourceId field's value. -func (s *DeleteTagsInput) SetResourceId(v string) *DeleteTagsInput { - s.ResourceId = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *DeleteTagsInput) SetTagKeys(v []*string) *DeleteTagsInput { - s.TagKeys = v +// SetWorkspaceId sets the WorkspaceId field's value. +func (s *DescribeWorkspaceSnapshotsInput) SetWorkspaceId(v string) *DescribeWorkspaceSnapshotsInput { + s.WorkspaceId = &v return s } -type DeleteTagsOutput struct { +type DescribeWorkspaceSnapshotsOutput struct { _ struct{} `type:"structure"` + + // Information about the snapshots that can be used to rebuild a WorkSpace. + // These snapshots include the user volume. + RebuildSnapshots []*Snapshot `type:"list"` + + // Information about the snapshots that can be used to restore a WorkSpace. + // These snapshots include both the root volume and the user volume. + RestoreSnapshots []*Snapshot `type:"list"` } // String returns the string representation -func (s DeleteTagsOutput) String() string { +func (s DescribeWorkspaceSnapshotsOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteTagsOutput) GoString() string { +func (s DescribeWorkspaceSnapshotsOutput) GoString() string { return s.String() } -type DeleteWorkspaceImageInput struct { +// SetRebuildSnapshots sets the RebuildSnapshots field's value. +func (s *DescribeWorkspaceSnapshotsOutput) SetRebuildSnapshots(v []*Snapshot) *DescribeWorkspaceSnapshotsOutput { + s.RebuildSnapshots = v + return s +} + +// SetRestoreSnapshots sets the RestoreSnapshots field's value. +func (s *DescribeWorkspaceSnapshotsOutput) SetRestoreSnapshots(v []*Snapshot) *DescribeWorkspaceSnapshotsOutput { + s.RestoreSnapshots = v + return s +} + +type DescribeWorkspacesConnectionStatusInput struct { _ struct{} `type:"structure"` - // The identifier of the image. - // - // ImageId is a required field - ImageId *string `type:"string" required:"true"` + // If you received a NextToken from a previous call that was paginated, provide + // this token to receive the next set of results. + NextToken *string `min:"1" type:"string"` + + // The identifiers of the WorkSpaces. You can specify up to 25 WorkSpaces. + WorkspaceIds []*string `min:"1" type:"list"` } // String returns the string representation -func (s DeleteWorkspaceImageInput) String() string { +func (s DescribeWorkspacesConnectionStatusInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteWorkspaceImageInput) GoString() string { +func (s DescribeWorkspacesConnectionStatusInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteWorkspaceImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteWorkspaceImageInput"} - if s.ImageId == nil { - invalidParams.Add(request.NewErrParamRequired("ImageId")) +func (s *DescribeWorkspacesConnectionStatusInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeWorkspacesConnectionStatusInput"} + if s.NextToken != nil && len(*s.NextToken) < 1 { + invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + } + if s.WorkspaceIds != nil && len(s.WorkspaceIds) < 1 { + invalidParams.Add(request.NewErrParamMinLen("WorkspaceIds", 1)) } if invalidParams.Len() > 0 { @@ -4112,64 +5585,110 @@ func (s *DeleteWorkspaceImageInput) Validate() error { return nil } -// SetImageId sets the ImageId field's value. -func (s *DeleteWorkspaceImageInput) SetImageId(v string) *DeleteWorkspaceImageInput { - s.ImageId = &v +// SetNextToken sets the NextToken field's value. +func (s *DescribeWorkspacesConnectionStatusInput) SetNextToken(v string) *DescribeWorkspacesConnectionStatusInput { + s.NextToken = &v return s } -type DeleteWorkspaceImageOutput struct { +// SetWorkspaceIds sets the WorkspaceIds field's value. +func (s *DescribeWorkspacesConnectionStatusInput) SetWorkspaceIds(v []*string) *DescribeWorkspacesConnectionStatusInput { + s.WorkspaceIds = v + return s +} + +type DescribeWorkspacesConnectionStatusOutput struct { _ struct{} `type:"structure"` + + // The token to use to retrieve the next set of results, or null if no more + // results are available. + NextToken *string `min:"1" type:"string"` + + // Information about the connection status of the WorkSpace. + WorkspacesConnectionStatus []*WorkspaceConnectionStatus `type:"list"` } // String returns the string representation -func (s DeleteWorkspaceImageOutput) String() string { +func (s DescribeWorkspacesConnectionStatusOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DeleteWorkspaceImageOutput) GoString() string { +func (s DescribeWorkspacesConnectionStatusOutput) GoString() string { return s.String() } -type DescribeAccountInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation -func (s DescribeAccountInput) String() string { - return awsutil.Prettify(s) +// SetNextToken sets the NextToken field's value. +func (s *DescribeWorkspacesConnectionStatusOutput) SetNextToken(v string) *DescribeWorkspacesConnectionStatusOutput { + s.NextToken = &v + return s } -// GoString returns the string representation -func (s DescribeAccountInput) GoString() string { - return s.String() +// SetWorkspacesConnectionStatus sets the WorkspacesConnectionStatus field's value. +func (s *DescribeWorkspacesConnectionStatusOutput) SetWorkspacesConnectionStatus(v []*WorkspaceConnectionStatus) *DescribeWorkspacesConnectionStatusOutput { + s.WorkspacesConnectionStatus = v + return s } -type DescribeAccountModificationsInput struct { +type DescribeWorkspacesInput struct { _ struct{} `type:"structure"` + // The identifier of the bundle. All WorkSpaces that are created from this bundle + // are retrieved. You cannot combine this parameter with any other filter. + BundleId *string `type:"string"` + + // The identifier of the directory. In addition, you can optionally specify + // a specific directory user (see UserName). You cannot combine this parameter + // with any other filter. + DirectoryId *string `min:"10" type:"string"` + + // The maximum number of items to return. + Limit *int64 `min:"1" type:"integer"` + // If you received a NextToken from a previous call that was paginated, provide // this token to receive the next set of results. NextToken *string `min:"1" type:"string"` + + // The name of the directory user. You must specify this parameter with DirectoryId. + UserName *string `min:"1" type:"string"` + + // The identifiers of the WorkSpaces. You cannot combine this parameter with + // any other filter. + // + // Because the CreateWorkspaces operation is asynchronous, the identifier it + // returns is not immediately available. If you immediately call DescribeWorkspaces + // with this identifier, no information is returned. + WorkspaceIds []*string `min:"1" type:"list"` } // String returns the string representation -func (s DescribeAccountModificationsInput) String() string { +func (s DescribeWorkspacesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAccountModificationsInput) GoString() string { +func (s DescribeWorkspacesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAccountModificationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAccountModificationsInput"} +func (s *DescribeWorkspacesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DescribeWorkspacesInput"} + if s.DirectoryId != nil && len(*s.DirectoryId) < 10 { + invalidParams.Add(request.NewErrParamMinLen("DirectoryId", 10)) + } + 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.UserName != nil && len(*s.UserName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + } + if s.WorkspaceIds != nil && len(s.WorkspaceIds) < 1 { + invalidParams.Add(request.NewErrParamMinLen("WorkspaceIds", 1)) + } if invalidParams.Len() > 0 { return invalidParams @@ -4177,179 +5696,302 @@ func (s *DescribeAccountModificationsInput) Validate() error { return nil } +// SetBundleId sets the BundleId field's value. +func (s *DescribeWorkspacesInput) SetBundleId(v string) *DescribeWorkspacesInput { + s.BundleId = &v + return s +} + +// SetDirectoryId sets the DirectoryId field's value. +func (s *DescribeWorkspacesInput) SetDirectoryId(v string) *DescribeWorkspacesInput { + s.DirectoryId = &v + return s +} + +// SetLimit sets the Limit field's value. +func (s *DescribeWorkspacesInput) SetLimit(v int64) *DescribeWorkspacesInput { + s.Limit = &v + return s +} + // SetNextToken sets the NextToken field's value. -func (s *DescribeAccountModificationsInput) SetNextToken(v string) *DescribeAccountModificationsInput { +func (s *DescribeWorkspacesInput) SetNextToken(v string) *DescribeWorkspacesInput { s.NextToken = &v return s } -type DescribeAccountModificationsOutput struct { - _ struct{} `type:"structure"` +// SetUserName sets the UserName field's value. +func (s *DescribeWorkspacesInput) SetUserName(v string) *DescribeWorkspacesInput { + s.UserName = &v + return s +} - // The list of modifications to the configuration of BYOL. - AccountModifications []*AccountModification `type:"list"` +// SetWorkspaceIds sets the WorkspaceIds field's value. +func (s *DescribeWorkspacesInput) SetWorkspaceIds(v []*string) *DescribeWorkspacesInput { + s.WorkspaceIds = v + return s +} + +type DescribeWorkspacesOutput struct { + _ struct{} `type:"structure"` // The token to use to retrieve the next set of results, or null if no more // results are available. NextToken *string `min:"1" type:"string"` + + // Information about the WorkSpaces. + // + // Because CreateWorkspaces is an asynchronous operation, some of the returned + // information could be incomplete. + Workspaces []*Workspace `type:"list"` } // String returns the string representation -func (s DescribeAccountModificationsOutput) String() string { +func (s DescribeWorkspacesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAccountModificationsOutput) GoString() string { +func (s DescribeWorkspacesOutput) GoString() string { return s.String() } -// SetAccountModifications sets the AccountModifications field's value. -func (s *DescribeAccountModificationsOutput) SetAccountModifications(v []*AccountModification) *DescribeAccountModificationsOutput { - s.AccountModifications = v +// SetNextToken sets the NextToken field's value. +func (s *DescribeWorkspacesOutput) SetNextToken(v string) *DescribeWorkspacesOutput { + s.NextToken = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeAccountModificationsOutput) SetNextToken(v string) *DescribeAccountModificationsOutput { - s.NextToken = &v +// SetWorkspaces sets the Workspaces field's value. +func (s *DescribeWorkspacesOutput) SetWorkspaces(v []*Workspace) *DescribeWorkspacesOutput { + s.Workspaces = v return s } -type DescribeAccountOutput struct { +type DisassociateIpGroupsInput struct { _ struct{} `type:"structure"` - // The IP address range, specified as an IPv4 CIDR block, used for the management - // network interface. + // The identifier of the directory. // - // The management network interface is connected to a secure Amazon WorkSpaces - // management network. It is used for interactive streaming of the WorkSpace - // desktop to Amazon WorkSpaces clients, and to allow Amazon WorkSpaces to manage - // the WorkSpace. - DedicatedTenancyManagementCidrRange *string `type:"string"` + // DirectoryId is a required field + DirectoryId *string `min:"10" type:"string" required:"true"` - // The status of BYOL (whether BYOL is enabled or disabled). - DedicatedTenancySupport *string `type:"string" enum:"DedicatedTenancySupportResultEnum"` + // The identifiers of one or more IP access control groups. + // + // GroupIds is a required field + GroupIds []*string `type:"list" required:"true"` } // String returns the string representation -func (s DescribeAccountOutput) String() string { +func (s DisassociateIpGroupsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeAccountOutput) GoString() string { +func (s DisassociateIpGroupsInput) GoString() string { return s.String() } -// SetDedicatedTenancyManagementCidrRange sets the DedicatedTenancyManagementCidrRange field's value. -func (s *DescribeAccountOutput) SetDedicatedTenancyManagementCidrRange(v string) *DescribeAccountOutput { - s.DedicatedTenancyManagementCidrRange = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *DisassociateIpGroupsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "DisassociateIpGroupsInput"} + if s.DirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryId")) + } + if s.DirectoryId != nil && len(*s.DirectoryId) < 10 { + invalidParams.Add(request.NewErrParamMinLen("DirectoryId", 10)) + } + if s.GroupIds == nil { + invalidParams.Add(request.NewErrParamRequired("GroupIds")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetDirectoryId sets the DirectoryId field's value. +func (s *DisassociateIpGroupsInput) SetDirectoryId(v string) *DisassociateIpGroupsInput { + s.DirectoryId = &v return s } -// SetDedicatedTenancySupport sets the DedicatedTenancySupport field's value. -func (s *DescribeAccountOutput) SetDedicatedTenancySupport(v string) *DescribeAccountOutput { - s.DedicatedTenancySupport = &v +// SetGroupIds sets the GroupIds field's value. +func (s *DisassociateIpGroupsInput) SetGroupIds(v []*string) *DisassociateIpGroupsInput { + s.GroupIds = v return s } -type DescribeClientPropertiesInput struct { +type DisassociateIpGroupsOutput struct { _ struct{} `type:"structure"` +} - // The resource identifier, in the form of directory IDs. - // - // ResourceIds is a required field - ResourceIds []*string `min:"1" type:"list" required:"true"` +// String returns the string representation +func (s DisassociateIpGroupsOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s DisassociateIpGroupsOutput) GoString() string { + return s.String() +} + +// Describes a WorkSpace that cannot be created. +type FailedCreateWorkspaceRequest struct { + _ struct{} `type:"structure"` + + // The error code that is returned if the WorkSpace cannot be created. + ErrorCode *string `type:"string"` + + // The text of the error message that is returned if the WorkSpace cannot be + // created. + ErrorMessage *string `type:"string"` + + // Information about the WorkSpace. + WorkspaceRequest *WorkspaceRequest `type:"structure"` } // String returns the string representation -func (s DescribeClientPropertiesInput) String() string { +func (s FailedCreateWorkspaceRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClientPropertiesInput) GoString() string { +func (s FailedCreateWorkspaceRequest) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeClientPropertiesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeClientPropertiesInput"} - if s.ResourceIds == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIds")) - } - if s.ResourceIds != nil && len(s.ResourceIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceIds", 1)) - } +// SetErrorCode sets the ErrorCode field's value. +func (s *FailedCreateWorkspaceRequest) SetErrorCode(v string) *FailedCreateWorkspaceRequest { + s.ErrorCode = &v + return s +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetErrorMessage sets the ErrorMessage field's value. +func (s *FailedCreateWorkspaceRequest) SetErrorMessage(v string) *FailedCreateWorkspaceRequest { + s.ErrorMessage = &v + return s } -// SetResourceIds sets the ResourceIds field's value. -func (s *DescribeClientPropertiesInput) SetResourceIds(v []*string) *DescribeClientPropertiesInput { - s.ResourceIds = v +// SetWorkspaceRequest sets the WorkspaceRequest field's value. +func (s *FailedCreateWorkspaceRequest) SetWorkspaceRequest(v *WorkspaceRequest) *FailedCreateWorkspaceRequest { + s.WorkspaceRequest = v return s } -type DescribeClientPropertiesOutput struct { +// Describes a WorkSpace that could not be rebooted. (RebootWorkspaces), rebuilt +// (RebuildWorkspaces), restored (RestoreWorkspace), terminated (TerminateWorkspaces), +// started (StartWorkspaces), or stopped (StopWorkspaces). +type FailedWorkspaceChangeRequest struct { _ struct{} `type:"structure"` - // Information about the specified Amazon WorkSpaces clients. - ClientPropertiesList []*ClientPropertiesResult `type:"list"` + // The error code that is returned if the WorkSpace cannot be rebooted. + ErrorCode *string `type:"string"` + + // The text of the error message that is returned if the WorkSpace cannot be + // rebooted. + ErrorMessage *string `type:"string"` + + // The identifier of the WorkSpace. + WorkspaceId *string `type:"string"` } // String returns the string representation -func (s DescribeClientPropertiesOutput) String() string { +func (s FailedWorkspaceChangeRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeClientPropertiesOutput) GoString() string { +func (s FailedWorkspaceChangeRequest) GoString() string { return s.String() } -// SetClientPropertiesList sets the ClientPropertiesList field's value. -func (s *DescribeClientPropertiesOutput) SetClientPropertiesList(v []*ClientPropertiesResult) *DescribeClientPropertiesOutput { - s.ClientPropertiesList = v +// SetErrorCode sets the ErrorCode field's value. +func (s *FailedWorkspaceChangeRequest) SetErrorCode(v string) *FailedWorkspaceChangeRequest { + s.ErrorCode = &v return s } -type DescribeIpGroupsInput struct { +// SetErrorMessage sets the ErrorMessage field's value. +func (s *FailedWorkspaceChangeRequest) SetErrorMessage(v string) *FailedWorkspaceChangeRequest { + s.ErrorMessage = &v + return s +} + +// SetWorkspaceId sets the WorkspaceId field's value. +func (s *FailedWorkspaceChangeRequest) SetWorkspaceId(v string) *FailedWorkspaceChangeRequest { + s.WorkspaceId = &v + return s +} + +type ImportWorkspaceImageInput struct { _ struct{} `type:"structure"` - // The identifiers of one or more IP access control groups. - GroupIds []*string `type:"list"` + // The identifier of the EC2 image. + // + // Ec2ImageId is a required field + Ec2ImageId *string `type:"string" required:"true"` - // The maximum number of items to return. - MaxResults *int64 `min:"1" type:"integer"` + // The description of the WorkSpace image. + // + // ImageDescription is a required field + ImageDescription *string `min:"1" type:"string" required:"true"` - // If you received a NextToken from a previous call that was paginated, provide - // this token to receive the next set of results. - NextToken *string `min:"1" type:"string"` + // The name of the WorkSpace image. + // + // ImageName is a required field + ImageName *string `min:"1" type:"string" required:"true"` + + // The ingestion process to be used when importing the image. + // + // IngestionProcess is a required field + IngestionProcess *string `type:"string" required:"true" enum:"WorkspaceImageIngestionProcess"` + + // The tags. Each WorkSpaces resource can have a maximum of 50 tags. + Tags []*Tag `type:"list"` } // String returns the string representation -func (s DescribeIpGroupsInput) String() string { +func (s ImportWorkspaceImageInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeIpGroupsInput) GoString() string { +func (s ImportWorkspaceImageInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeIpGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeIpGroupsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) +func (s *ImportWorkspaceImageInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ImportWorkspaceImageInput"} + if s.Ec2ImageId == nil { + invalidParams.Add(request.NewErrParamRequired("Ec2ImageId")) } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + if s.ImageDescription == nil { + invalidParams.Add(request.NewErrParamRequired("ImageDescription")) + } + if s.ImageDescription != nil && len(*s.ImageDescription) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ImageDescription", 1)) + } + if s.ImageName == nil { + invalidParams.Add(request.NewErrParamRequired("ImageName")) + } + if s.ImageName != nil && len(*s.ImageName) < 1 { + invalidParams.Add(request.NewErrParamMinLen("ImageName", 1)) + } + if s.IngestionProcess == nil { + invalidParams.Add(request.NewErrParamRequired("IngestionProcess")) + } + 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 { @@ -4358,226 +6000,268 @@ func (s *DescribeIpGroupsInput) Validate() error { return nil } -// SetGroupIds sets the GroupIds field's value. -func (s *DescribeIpGroupsInput) SetGroupIds(v []*string) *DescribeIpGroupsInput { - s.GroupIds = v +// SetEc2ImageId sets the Ec2ImageId field's value. +func (s *ImportWorkspaceImageInput) SetEc2ImageId(v string) *ImportWorkspaceImageInput { + s.Ec2ImageId = &v return s } -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeIpGroupsInput) SetMaxResults(v int64) *DescribeIpGroupsInput { - s.MaxResults = &v +// SetImageDescription sets the ImageDescription field's value. +func (s *ImportWorkspaceImageInput) SetImageDescription(v string) *ImportWorkspaceImageInput { + s.ImageDescription = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeIpGroupsInput) SetNextToken(v string) *DescribeIpGroupsInput { - s.NextToken = &v +// SetImageName sets the ImageName field's value. +func (s *ImportWorkspaceImageInput) SetImageName(v string) *ImportWorkspaceImageInput { + s.ImageName = &v return s } -type DescribeIpGroupsOutput struct { - _ struct{} `type:"structure"` +// SetIngestionProcess sets the IngestionProcess field's value. +func (s *ImportWorkspaceImageInput) SetIngestionProcess(v string) *ImportWorkspaceImageInput { + s.IngestionProcess = &v + return s +} - // The token to use to retrieve the next set of results, or null if no more - // results are available. - NextToken *string `min:"1" type:"string"` +// SetTags sets the Tags field's value. +func (s *ImportWorkspaceImageInput) SetTags(v []*Tag) *ImportWorkspaceImageInput { + s.Tags = v + return s +} - // Information about the IP access control groups. - Result []*IpGroup `type:"list"` +type ImportWorkspaceImageOutput struct { + _ struct{} `type:"structure"` + + // The identifier of the WorkSpace image. + ImageId *string `type:"string"` } // String returns the string representation -func (s DescribeIpGroupsOutput) String() string { +func (s ImportWorkspaceImageOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeIpGroupsOutput) GoString() string { +func (s ImportWorkspaceImageOutput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribeIpGroupsOutput) SetNextToken(v string) *DescribeIpGroupsOutput { - s.NextToken = &v - return s -} - -// SetResult sets the Result field's value. -func (s *DescribeIpGroupsOutput) SetResult(v []*IpGroup) *DescribeIpGroupsOutput { - s.Result = v +// SetImageId sets the ImageId field's value. +func (s *ImportWorkspaceImageOutput) SetImageId(v string) *ImportWorkspaceImageOutput { + s.ImageId = &v return s } -type DescribeTagsInput struct { - _ struct{} `type:"structure"` +// One or more parameter values are not valid. +type InvalidParameterValuesException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The identifier of the WorkSpaces resource. The supported resource types are - // WorkSpaces, registered directories, images, custom bundles, and IP access - // control groups. - // - // ResourceId is a required field - ResourceId *string `min:"1" type:"string" required:"true"` + // The exception error message. + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DescribeTagsInput) String() string { +func (s InvalidParameterValuesException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeTagsInput) GoString() string { +func (s InvalidParameterValuesException) 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.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.ResourceId != nil && len(*s.ResourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) +func newErrorInvalidParameterValuesException(v protocol.ResponseMetadata) error { + return &InvalidParameterValuesException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s InvalidParameterValuesException) Code() string { + return "InvalidParameterValuesException" +} + +// Message returns the exception's message. +func (s InvalidParameterValuesException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidParameterValuesException) OrigErr() error { return nil } -// SetResourceId sets the ResourceId field's value. -func (s *DescribeTagsInput) SetResourceId(v string) *DescribeTagsInput { - s.ResourceId = &v - return s +func (s InvalidParameterValuesException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -type DescribeTagsOutput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s InvalidParameterValuesException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The tags. - TagList []*Tag `type:"list"` +// RequestID returns the service's response RequestID for request. +func (s InvalidParameterValuesException) RequestID() string { + return s.respMetadata.RequestID +} + +// The state of the resource is not valid for this operation. +type InvalidResourceStateException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s DescribeTagsOutput) String() string { +func (s InvalidResourceStateException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeTagsOutput) GoString() string { +func (s InvalidResourceStateException) GoString() string { return s.String() } -// SetTagList sets the TagList field's value. -func (s *DescribeTagsOutput) SetTagList(v []*Tag) *DescribeTagsOutput { - s.TagList = v - return s +func newErrorInvalidResourceStateException(v protocol.ResponseMetadata) error { + return &InvalidResourceStateException{ + respMetadata: v, + } } -type DescribeWorkspaceBundlesInput struct { +// Code returns the exception type name. +func (s InvalidResourceStateException) Code() string { + return "InvalidResourceStateException" +} + +// Message returns the exception's message. +func (s InvalidResourceStateException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidResourceStateException) OrigErr() error { + return nil +} + +func (s InvalidResourceStateException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidResourceStateException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidResourceStateException) RequestID() string { + return s.respMetadata.RequestID +} + +// Describes an IP access control group. +type IpGroup struct { _ struct{} `type:"structure"` - // The identifiers of the bundles. You cannot combine this parameter with any - // other filter. - BundleIds []*string `min:"1" type:"list"` + // The description of the group. + GroupDesc *string `locationName:"groupDesc" type:"string"` - // The token for the next set of results. (You received this token from a previous - // call.) - NextToken *string `min:"1" type:"string"` + // The identifier of the group. + GroupId *string `locationName:"groupId" type:"string"` - // The owner of the bundles. You cannot combine this parameter with any other - // filter. - // - // Specify AMAZON to describe the bundles provided by AWS or null to describe - // the bundles that belong to your account. - Owner *string `type:"string"` + // The name of the group. + GroupName *string `locationName:"groupName" type:"string"` + + // The rules. + UserRules []*IpRuleItem `locationName:"userRules" type:"list"` } // String returns the string representation -func (s DescribeWorkspaceBundlesInput) String() string { +func (s IpGroup) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeWorkspaceBundlesInput) GoString() string { +func (s IpGroup) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeWorkspaceBundlesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeWorkspaceBundlesInput"} - if s.BundleIds != nil && len(s.BundleIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("BundleIds", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetGroupDesc sets the GroupDesc field's value. +func (s *IpGroup) SetGroupDesc(v string) *IpGroup { + s.GroupDesc = &v + return s } -// SetBundleIds sets the BundleIds field's value. -func (s *DescribeWorkspaceBundlesInput) SetBundleIds(v []*string) *DescribeWorkspaceBundlesInput { - s.BundleIds = v +// SetGroupId sets the GroupId field's value. +func (s *IpGroup) SetGroupId(v string) *IpGroup { + s.GroupId = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeWorkspaceBundlesInput) SetNextToken(v string) *DescribeWorkspaceBundlesInput { - s.NextToken = &v +// SetGroupName sets the GroupName field's value. +func (s *IpGroup) SetGroupName(v string) *IpGroup { + s.GroupName = &v return s } -// SetOwner sets the Owner field's value. -func (s *DescribeWorkspaceBundlesInput) SetOwner(v string) *DescribeWorkspaceBundlesInput { - s.Owner = &v +// SetUserRules sets the UserRules field's value. +func (s *IpGroup) SetUserRules(v []*IpRuleItem) *IpGroup { + s.UserRules = v return s } -type DescribeWorkspaceBundlesOutput struct { +// Describes a rule for an IP access control group. +type IpRuleItem struct { _ struct{} `type:"structure"` - // Information about the bundles. - Bundles []*WorkspaceBundle `type:"list"` + // The IP address range, in CIDR notation. + IpRule *string `locationName:"ipRule" type:"string"` - // The token to use to retrieve the next set of results, or null if there are - // no more results available. This token is valid for one day and must be used - // within that time frame. - NextToken *string `min:"1" type:"string"` + // The description. + RuleDesc *string `locationName:"ruleDesc" type:"string"` } // String returns the string representation -func (s DescribeWorkspaceBundlesOutput) String() string { +func (s IpRuleItem) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeWorkspaceBundlesOutput) GoString() string { +func (s IpRuleItem) GoString() string { return s.String() } -// SetBundles sets the Bundles field's value. -func (s *DescribeWorkspaceBundlesOutput) SetBundles(v []*WorkspaceBundle) *DescribeWorkspaceBundlesOutput { - s.Bundles = v +// SetIpRule sets the IpRule field's value. +func (s *IpRuleItem) SetIpRule(v string) *IpRuleItem { + s.IpRule = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeWorkspaceBundlesOutput) SetNextToken(v string) *DescribeWorkspaceBundlesOutput { - s.NextToken = &v +// SetRuleDesc sets the RuleDesc field's value. +func (s *IpRuleItem) SetRuleDesc(v string) *IpRuleItem { + s.RuleDesc = &v return s } -type DescribeWorkspaceDirectoriesInput struct { +type ListAvailableManagementCidrRangesInput struct { _ struct{} `type:"structure"` - // The identifiers of the directories. If the value is null, all directories - // are retrieved. - DirectoryIds []*string `min:"1" type:"list"` + // The IP address range to search. Specify an IP address range that is compatible + // with your network and in CIDR notation (that is, specify the range as an + // IPv4 CIDR block). + // + // ManagementCidrRangeConstraint is a required field + ManagementCidrRangeConstraint *string `type:"string" required:"true"` + + // The maximum number of items to return. + MaxResults *int64 `min:"1" type:"integer"` // If you received a NextToken from a previous call that was paginated, provide // this token to receive the next set of results. @@ -4585,20 +6269,23 @@ type DescribeWorkspaceDirectoriesInput struct { } // String returns the string representation -func (s DescribeWorkspaceDirectoriesInput) String() string { +func (s ListAvailableManagementCidrRangesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeWorkspaceDirectoriesInput) GoString() string { +func (s ListAvailableManagementCidrRangesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeWorkspaceDirectoriesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeWorkspaceDirectoriesInput"} - if s.DirectoryIds != nil && len(s.DirectoryIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("DirectoryIds", 1)) +func (s *ListAvailableManagementCidrRangesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ListAvailableManagementCidrRangesInput"} + if s.ManagementCidrRangeConstraint == nil { + invalidParams.Add(request.NewErrParamRequired("ManagementCidrRangeConstraint")) + } + if s.MaxResults != nil && *s.MaxResults < 1 { + invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) } if s.NextToken != nil && len(*s.NextToken) < 1 { invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) @@ -4610,23 +6297,29 @@ func (s *DescribeWorkspaceDirectoriesInput) Validate() error { return nil } -// SetDirectoryIds sets the DirectoryIds field's value. -func (s *DescribeWorkspaceDirectoriesInput) SetDirectoryIds(v []*string) *DescribeWorkspaceDirectoriesInput { - s.DirectoryIds = v +// SetManagementCidrRangeConstraint sets the ManagementCidrRangeConstraint field's value. +func (s *ListAvailableManagementCidrRangesInput) SetManagementCidrRangeConstraint(v string) *ListAvailableManagementCidrRangesInput { + s.ManagementCidrRangeConstraint = &v + return s +} + +// SetMaxResults sets the MaxResults field's value. +func (s *ListAvailableManagementCidrRangesInput) SetMaxResults(v int64) *ListAvailableManagementCidrRangesInput { + s.MaxResults = &v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeWorkspaceDirectoriesInput) SetNextToken(v string) *DescribeWorkspaceDirectoriesInput { +func (s *ListAvailableManagementCidrRangesInput) SetNextToken(v string) *ListAvailableManagementCidrRangesInput { s.NextToken = &v return s } -type DescribeWorkspaceDirectoriesOutput struct { +type ListAvailableManagementCidrRangesOutput struct { _ struct{} `type:"structure"` - // Information about the directories. - Directories []*WorkspaceDirectory `type:"list"` + // The list of available IP address ranges, specified as IPv4 CIDR blocks. + ManagementCidrRanges []*string `type:"list"` // The token to use to retrieve the next set of results, or null if no more // results are available. @@ -4634,62 +6327,59 @@ type DescribeWorkspaceDirectoriesOutput struct { } // String returns the string representation -func (s DescribeWorkspaceDirectoriesOutput) String() string { +func (s ListAvailableManagementCidrRangesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeWorkspaceDirectoriesOutput) GoString() string { +func (s ListAvailableManagementCidrRangesOutput) GoString() string { return s.String() } -// SetDirectories sets the Directories field's value. -func (s *DescribeWorkspaceDirectoriesOutput) SetDirectories(v []*WorkspaceDirectory) *DescribeWorkspaceDirectoriesOutput { - s.Directories = v +// SetManagementCidrRanges sets the ManagementCidrRanges field's value. +func (s *ListAvailableManagementCidrRangesOutput) SetManagementCidrRanges(v []*string) *ListAvailableManagementCidrRangesOutput { + s.ManagementCidrRanges = v return s } // SetNextToken sets the NextToken field's value. -func (s *DescribeWorkspaceDirectoriesOutput) SetNextToken(v string) *DescribeWorkspaceDirectoriesOutput { +func (s *ListAvailableManagementCidrRangesOutput) SetNextToken(v string) *ListAvailableManagementCidrRangesOutput { s.NextToken = &v return s } -type DescribeWorkspaceImagesInput struct { +type MigrateWorkspaceInput struct { _ struct{} `type:"structure"` - // The identifier of the image. - ImageIds []*string `min:"1" type:"list"` - - // The maximum number of items to return. - MaxResults *int64 `min:"1" type:"integer"` + // The identifier of the target bundle type to migrate the WorkSpace to. + // + // BundleId is a required field + BundleId *string `type:"string" required:"true"` - // If you received a NextToken from a previous call that was paginated, provide - // this token to receive the next set of results. - NextToken *string `min:"1" type:"string"` + // The identifier of the WorkSpace to migrate from. + // + // SourceWorkspaceId is a required field + SourceWorkspaceId *string `type:"string" required:"true"` } // String returns the string representation -func (s DescribeWorkspaceImagesInput) String() string { +func (s MigrateWorkspaceInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeWorkspaceImagesInput) GoString() string { +func (s MigrateWorkspaceInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeWorkspaceImagesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeWorkspaceImagesInput"} - 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)) +func (s *MigrateWorkspaceInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "MigrateWorkspaceInput"} + if s.BundleId == nil { + invalidParams.Add(request.NewErrParamRequired("BundleId")) } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + if s.SourceWorkspaceId == nil { + invalidParams.Add(request.NewErrParamRequired("SourceWorkspaceId")) } if invalidParams.Len() > 0 { @@ -4698,158 +6388,171 @@ func (s *DescribeWorkspaceImagesInput) Validate() error { return nil } -// SetImageIds sets the ImageIds field's value. -func (s *DescribeWorkspaceImagesInput) SetImageIds(v []*string) *DescribeWorkspaceImagesInput { - s.ImageIds = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *DescribeWorkspaceImagesInput) SetMaxResults(v int64) *DescribeWorkspaceImagesInput { - s.MaxResults = &v +// SetBundleId sets the BundleId field's value. +func (s *MigrateWorkspaceInput) SetBundleId(v string) *MigrateWorkspaceInput { + s.BundleId = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeWorkspaceImagesInput) SetNextToken(v string) *DescribeWorkspaceImagesInput { - s.NextToken = &v +// SetSourceWorkspaceId sets the SourceWorkspaceId field's value. +func (s *MigrateWorkspaceInput) SetSourceWorkspaceId(v string) *MigrateWorkspaceInput { + s.SourceWorkspaceId = &v return s } -type DescribeWorkspaceImagesOutput struct { +type MigrateWorkspaceOutput struct { _ struct{} `type:"structure"` - // Information about the images. - Images []*WorkspaceImage `type:"list"` + // The original identifier of the WorkSpace that is being migrated. + SourceWorkspaceId *string `type:"string"` - // The token to use to retrieve the next set of results, or null if no more - // results are available. - NextToken *string `min:"1" type:"string"` + // The new identifier of the WorkSpace that is being migrated. If the migration + // does not succeed, the target WorkSpace ID will not be used, and the WorkSpace + // will still have the original WorkSpace ID. + TargetWorkspaceId *string `type:"string"` } // String returns the string representation -func (s DescribeWorkspaceImagesOutput) String() string { +func (s MigrateWorkspaceOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeWorkspaceImagesOutput) GoString() string { +func (s MigrateWorkspaceOutput) GoString() string { return s.String() } -// SetImages sets the Images field's value. -func (s *DescribeWorkspaceImagesOutput) SetImages(v []*WorkspaceImage) *DescribeWorkspaceImagesOutput { - s.Images = v +// SetSourceWorkspaceId sets the SourceWorkspaceId field's value. +func (s *MigrateWorkspaceOutput) SetSourceWorkspaceId(v string) *MigrateWorkspaceOutput { + s.SourceWorkspaceId = &v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeWorkspaceImagesOutput) SetNextToken(v string) *DescribeWorkspaceImagesOutput { - s.NextToken = &v +// SetTargetWorkspaceId sets the TargetWorkspaceId field's value. +func (s *MigrateWorkspaceOutput) SetTargetWorkspaceId(v string) *MigrateWorkspaceOutput { + s.TargetWorkspaceId = &v return s } -type DescribeWorkspaceSnapshotsInput struct { +// Describes a WorkSpace modification. +type ModificationState struct { _ struct{} `type:"structure"` - // The identifier of the WorkSpace. - // - // WorkspaceId is a required field - WorkspaceId *string `type:"string" required:"true"` + // The resource. + Resource *string `type:"string" enum:"ModificationResourceEnum"` + + // The modification state. + State *string `type:"string" enum:"ModificationStateEnum"` } // String returns the string representation -func (s DescribeWorkspaceSnapshotsInput) String() string { +func (s ModificationState) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeWorkspaceSnapshotsInput) GoString() string { +func (s ModificationState) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeWorkspaceSnapshotsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeWorkspaceSnapshotsInput"} - if s.WorkspaceId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkspaceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// SetResource sets the Resource field's value. +func (s *ModificationState) SetResource(v string) *ModificationState { + s.Resource = &v + return s } -// SetWorkspaceId sets the WorkspaceId field's value. -func (s *DescribeWorkspaceSnapshotsInput) SetWorkspaceId(v string) *DescribeWorkspaceSnapshotsInput { - s.WorkspaceId = &v +// SetState sets the State field's value. +func (s *ModificationState) SetState(v string) *ModificationState { + s.State = &v return s } -type DescribeWorkspaceSnapshotsOutput struct { +type ModifyAccountInput struct { _ struct{} `type:"structure"` - // Information about the snapshots that can be used to rebuild a WorkSpace. - // These snapshots include the root volume. - RebuildSnapshots []*Snapshot `type:"list"` + // The IP address range, specified as an IPv4 CIDR block, for the management + // network interface. Specify an IP address range that is compatible with your + // network and in CIDR notation (that is, specify the range as an IPv4 CIDR + // block). The CIDR block size must be /16 (for example, 203.0.113.25/16). It + // must also be specified as available by the ListAvailableManagementCidrRanges + // operation. + DedicatedTenancyManagementCidrRange *string `type:"string"` - // Information about the snapshots that can be used to restore a WorkSpace. - // These snapshots include both the root volume and the user volume. - RestoreSnapshots []*Snapshot `type:"list"` + // The status of BYOL. + DedicatedTenancySupport *string `type:"string" enum:"DedicatedTenancySupportEnum"` } // String returns the string representation -func (s DescribeWorkspaceSnapshotsOutput) String() string { +func (s ModifyAccountInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeWorkspaceSnapshotsOutput) GoString() string { +func (s ModifyAccountInput) GoString() string { return s.String() } -// SetRebuildSnapshots sets the RebuildSnapshots field's value. -func (s *DescribeWorkspaceSnapshotsOutput) SetRebuildSnapshots(v []*Snapshot) *DescribeWorkspaceSnapshotsOutput { - s.RebuildSnapshots = v +// SetDedicatedTenancyManagementCidrRange sets the DedicatedTenancyManagementCidrRange field's value. +func (s *ModifyAccountInput) SetDedicatedTenancyManagementCidrRange(v string) *ModifyAccountInput { + s.DedicatedTenancyManagementCidrRange = &v return s } -// SetRestoreSnapshots sets the RestoreSnapshots field's value. -func (s *DescribeWorkspaceSnapshotsOutput) SetRestoreSnapshots(v []*Snapshot) *DescribeWorkspaceSnapshotsOutput { - s.RestoreSnapshots = v +// SetDedicatedTenancySupport sets the DedicatedTenancySupport field's value. +func (s *ModifyAccountInput) SetDedicatedTenancySupport(v string) *ModifyAccountInput { + s.DedicatedTenancySupport = &v return s } -type DescribeWorkspacesConnectionStatusInput struct { +type ModifyAccountOutput struct { _ struct{} `type:"structure"` +} - // If you received a NextToken from a previous call that was paginated, provide - // this token to receive the next set of results. - NextToken *string `min:"1" type:"string"` +// String returns the string representation +func (s ModifyAccountOutput) String() string { + return awsutil.Prettify(s) +} - // The identifiers of the WorkSpaces. You can specify up to 25 WorkSpaces. - WorkspaceIds []*string `min:"1" type:"list"` +// GoString returns the string representation +func (s ModifyAccountOutput) GoString() string { + return s.String() +} + +type ModifyClientPropertiesInput struct { + _ struct{} `type:"structure"` + + // Information about the Amazon WorkSpaces client. + // + // ClientProperties is a required field + ClientProperties *ClientProperties `type:"structure" required:"true"` + + // The resource identifiers, in the form of directory IDs. + // + // ResourceId is a required field + ResourceId *string `min:"1" type:"string" required:"true"` } // String returns the string representation -func (s DescribeWorkspacesConnectionStatusInput) String() string { +func (s ModifyClientPropertiesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeWorkspacesConnectionStatusInput) GoString() string { +func (s ModifyClientPropertiesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeWorkspacesConnectionStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeWorkspacesConnectionStatusInput"} - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) +func (s *ModifyClientPropertiesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyClientPropertiesInput"} + if s.ClientProperties == nil { + invalidParams.Add(request.NewErrParamRequired("ClientProperties")) } - if s.WorkspaceIds != nil && len(s.WorkspaceIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkspaceIds", 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 invalidParams.Len() > 0 { @@ -4858,106 +6561,67 @@ func (s *DescribeWorkspacesConnectionStatusInput) Validate() error { return nil } -// SetNextToken sets the NextToken field's value. -func (s *DescribeWorkspacesConnectionStatusInput) SetNextToken(v string) *DescribeWorkspacesConnectionStatusInput { - s.NextToken = &v +// SetClientProperties sets the ClientProperties field's value. +func (s *ModifyClientPropertiesInput) SetClientProperties(v *ClientProperties) *ModifyClientPropertiesInput { + s.ClientProperties = v return s } -// SetWorkspaceIds sets the WorkspaceIds field's value. -func (s *DescribeWorkspacesConnectionStatusInput) SetWorkspaceIds(v []*string) *DescribeWorkspacesConnectionStatusInput { - s.WorkspaceIds = v +// SetResourceId sets the ResourceId field's value. +func (s *ModifyClientPropertiesInput) SetResourceId(v string) *ModifyClientPropertiesInput { + s.ResourceId = &v return s } -type DescribeWorkspacesConnectionStatusOutput struct { +type ModifyClientPropertiesOutput struct { _ struct{} `type:"structure"` - - // The token to use to retrieve the next set of results, or null if no more - // results are available. - NextToken *string `min:"1" type:"string"` - - // Information about the connection status of the WorkSpace. - WorkspacesConnectionStatus []*WorkspaceConnectionStatus `type:"list"` } // String returns the string representation -func (s DescribeWorkspacesConnectionStatusOutput) String() string { +func (s ModifyClientPropertiesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeWorkspacesConnectionStatusOutput) GoString() string { +func (s ModifyClientPropertiesOutput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribeWorkspacesConnectionStatusOutput) SetNextToken(v string) *DescribeWorkspacesConnectionStatusOutput { - s.NextToken = &v - return s -} - -// SetWorkspacesConnectionStatus sets the WorkspacesConnectionStatus field's value. -func (s *DescribeWorkspacesConnectionStatusOutput) SetWorkspacesConnectionStatus(v []*WorkspaceConnectionStatus) *DescribeWorkspacesConnectionStatusOutput { - s.WorkspacesConnectionStatus = v - return s -} - -type DescribeWorkspacesInput struct { +type ModifySelfservicePermissionsInput struct { _ struct{} `type:"structure"` - // The identifier of the bundle. All WorkSpaces that are created from this bundle - // are retrieved. You cannot combine this parameter with any other filter. - BundleId *string `type:"string"` - - // The identifier of the directory. In addition, you can optionally specify - // a specific directory user (see UserName). You cannot combine this parameter - // with any other filter. - DirectoryId *string `type:"string"` - - // The maximum number of items to return. - Limit *int64 `min:"1" type:"integer"` - - // If you received a NextToken from a previous call that was paginated, provide - // this token to receive the next set of results. - NextToken *string `min:"1" type:"string"` - - // The name of the directory user. You must specify this parameter with DirectoryId. - UserName *string `min:"1" type:"string"` + // The identifier of the directory. + // + // ResourceId is a required field + ResourceId *string `min:"10" type:"string" required:"true"` - // The identifiers of the WorkSpaces. You cannot combine this parameter with - // any other filter. + // The permissions to enable or disable self-service capabilities. // - // Because the CreateWorkspaces operation is asynchronous, the identifier it - // returns is not immediately available. If you immediately call DescribeWorkspaces - // with this identifier, no information is returned. - WorkspaceIds []*string `min:"1" type:"list"` + // SelfservicePermissions is a required field + SelfservicePermissions *SelfservicePermissions `type:"structure" required:"true"` } // String returns the string representation -func (s DescribeWorkspacesInput) String() string { +func (s ModifySelfservicePermissionsInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeWorkspacesInput) GoString() string { +func (s ModifySelfservicePermissionsInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeWorkspacesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeWorkspacesInput"} - 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)) +func (s *ModifySelfservicePermissionsInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifySelfservicePermissionsInput"} + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) } - if s.UserName != nil && len(*s.UserName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("UserName", 1)) + if s.ResourceId != nil && len(*s.ResourceId) < 10 { + invalidParams.Add(request.NewErrParamMinLen("ResourceId", 10)) } - if s.WorkspaceIds != nil && len(s.WorkspaceIds) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WorkspaceIds", 1)) + if s.SelfservicePermissions == nil { + invalidParams.Add(request.NewErrParamRequired("SelfservicePermissions")) } if invalidParams.Len() > 0 { @@ -4966,110 +6630,141 @@ func (s *DescribeWorkspacesInput) Validate() error { return nil } -// SetBundleId sets the BundleId field's value. -func (s *DescribeWorkspacesInput) SetBundleId(v string) *DescribeWorkspacesInput { - s.BundleId = &v - return s -} - -// SetDirectoryId sets the DirectoryId field's value. -func (s *DescribeWorkspacesInput) SetDirectoryId(v string) *DescribeWorkspacesInput { - s.DirectoryId = &v +// SetResourceId sets the ResourceId field's value. +func (s *ModifySelfservicePermissionsInput) SetResourceId(v string) *ModifySelfservicePermissionsInput { + s.ResourceId = &v return s } -// SetLimit sets the Limit field's value. -func (s *DescribeWorkspacesInput) SetLimit(v int64) *DescribeWorkspacesInput { - s.Limit = &v +// SetSelfservicePermissions sets the SelfservicePermissions field's value. +func (s *ModifySelfservicePermissionsInput) SetSelfservicePermissions(v *SelfservicePermissions) *ModifySelfservicePermissionsInput { + s.SelfservicePermissions = v return s } -// SetNextToken sets the NextToken field's value. -func (s *DescribeWorkspacesInput) SetNextToken(v string) *DescribeWorkspacesInput { - s.NextToken = &v - return s +type ModifySelfservicePermissionsOutput struct { + _ struct{} `type:"structure"` } -// SetUserName sets the UserName field's value. -func (s *DescribeWorkspacesInput) SetUserName(v string) *DescribeWorkspacesInput { - s.UserName = &v - return s +// String returns the string representation +func (s ModifySelfservicePermissionsOutput) String() string { + return awsutil.Prettify(s) } -// SetWorkspaceIds sets the WorkspaceIds field's value. -func (s *DescribeWorkspacesInput) SetWorkspaceIds(v []*string) *DescribeWorkspacesInput { - s.WorkspaceIds = v - return s +// GoString returns the string representation +func (s ModifySelfservicePermissionsOutput) GoString() string { + return s.String() } -type DescribeWorkspacesOutput struct { +type ModifyWorkspaceAccessPropertiesInput struct { _ struct{} `type:"structure"` - // The token to use to retrieve the next set of results, or null if no more - // results are available. - NextToken *string `min:"1" type:"string"` + // The identifier of the directory. + // + // ResourceId is a required field + ResourceId *string `min:"10" type:"string" required:"true"` - // Information about the WorkSpaces. + // The device types and operating systems to enable or disable for access. // - // Because CreateWorkspaces is an asynchronous operation, some of the returned - // information could be incomplete. - Workspaces []*Workspace `type:"list"` + // WorkspaceAccessProperties is a required field + WorkspaceAccessProperties *WorkspaceAccessProperties `type:"structure" required:"true"` } // String returns the string representation -func (s DescribeWorkspacesOutput) String() string { +func (s ModifyWorkspaceAccessPropertiesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DescribeWorkspacesOutput) GoString() string { +func (s ModifyWorkspaceAccessPropertiesInput) GoString() string { return s.String() } -// SetNextToken sets the NextToken field's value. -func (s *DescribeWorkspacesOutput) SetNextToken(v string) *DescribeWorkspacesOutput { - s.NextToken = &v +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyWorkspaceAccessPropertiesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyWorkspaceAccessPropertiesInput"} + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) + } + if s.ResourceId != nil && len(*s.ResourceId) < 10 { + invalidParams.Add(request.NewErrParamMinLen("ResourceId", 10)) + } + if s.WorkspaceAccessProperties == nil { + invalidParams.Add(request.NewErrParamRequired("WorkspaceAccessProperties")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetResourceId sets the ResourceId field's value. +func (s *ModifyWorkspaceAccessPropertiesInput) SetResourceId(v string) *ModifyWorkspaceAccessPropertiesInput { + s.ResourceId = &v return s } -// SetWorkspaces sets the Workspaces field's value. -func (s *DescribeWorkspacesOutput) SetWorkspaces(v []*Workspace) *DescribeWorkspacesOutput { - s.Workspaces = v +// SetWorkspaceAccessProperties sets the WorkspaceAccessProperties field's value. +func (s *ModifyWorkspaceAccessPropertiesInput) SetWorkspaceAccessProperties(v *WorkspaceAccessProperties) *ModifyWorkspaceAccessPropertiesInput { + s.WorkspaceAccessProperties = v return s } -type DisassociateIpGroupsInput struct { +type ModifyWorkspaceAccessPropertiesOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s ModifyWorkspaceAccessPropertiesOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ModifyWorkspaceAccessPropertiesOutput) GoString() string { + return s.String() +} + +type ModifyWorkspaceCreationPropertiesInput struct { _ struct{} `type:"structure"` // The identifier of the directory. // - // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` + // ResourceId is a required field + ResourceId *string `min:"10" type:"string" required:"true"` - // The identifiers of one or more IP access control groups. + // The default properties for creating WorkSpaces. // - // GroupIds is a required field - GroupIds []*string `type:"list" required:"true"` + // WorkspaceCreationProperties is a required field + WorkspaceCreationProperties *WorkspaceCreationProperties `type:"structure" required:"true"` } // String returns the string representation -func (s DisassociateIpGroupsInput) String() string { +func (s ModifyWorkspaceCreationPropertiesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DisassociateIpGroupsInput) GoString() string { +func (s ModifyWorkspaceCreationPropertiesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *DisassociateIpGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisassociateIpGroupsInput"} - if s.DirectoryId == nil { - invalidParams.Add(request.NewErrParamRequired("DirectoryId")) +func (s *ModifyWorkspaceCreationPropertiesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyWorkspaceCreationPropertiesInput"} + if s.ResourceId == nil { + invalidParams.Add(request.NewErrParamRequired("ResourceId")) } - if s.GroupIds == nil { - invalidParams.Add(request.NewErrParamRequired("GroupIds")) + if s.ResourceId != nil && len(*s.ResourceId) < 10 { + invalidParams.Add(request.NewErrParamMinLen("ResourceId", 10)) + } + if s.WorkspaceCreationProperties == nil { + invalidParams.Add(request.NewErrParamRequired("WorkspaceCreationProperties")) + } + if s.WorkspaceCreationProperties != nil { + if err := s.WorkspaceCreationProperties.Validate(); err != nil { + invalidParams.AddNested("WorkspaceCreationProperties", err.(request.ErrInvalidParams)) + } } if invalidParams.Len() > 0 { @@ -5078,187 +6773,130 @@ func (s *DisassociateIpGroupsInput) Validate() error { return nil } -// SetDirectoryId sets the DirectoryId field's value. -func (s *DisassociateIpGroupsInput) SetDirectoryId(v string) *DisassociateIpGroupsInput { - s.DirectoryId = &v +// SetResourceId sets the ResourceId field's value. +func (s *ModifyWorkspaceCreationPropertiesInput) SetResourceId(v string) *ModifyWorkspaceCreationPropertiesInput { + s.ResourceId = &v return s } -// SetGroupIds sets the GroupIds field's value. -func (s *DisassociateIpGroupsInput) SetGroupIds(v []*string) *DisassociateIpGroupsInput { - s.GroupIds = v +// SetWorkspaceCreationProperties sets the WorkspaceCreationProperties field's value. +func (s *ModifyWorkspaceCreationPropertiesInput) SetWorkspaceCreationProperties(v *WorkspaceCreationProperties) *ModifyWorkspaceCreationPropertiesInput { + s.WorkspaceCreationProperties = v return s } -type DisassociateIpGroupsOutput struct { +type ModifyWorkspaceCreationPropertiesOutput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s DisassociateIpGroupsOutput) String() string { +func (s ModifyWorkspaceCreationPropertiesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s DisassociateIpGroupsOutput) GoString() string { +func (s ModifyWorkspaceCreationPropertiesOutput) GoString() string { return s.String() } -// Describes a WorkSpace that cannot be created. -type FailedCreateWorkspaceRequest struct { +type ModifyWorkspacePropertiesInput struct { _ struct{} `type:"structure"` - // The error code that is returned if the WorkSpace cannot be created. - ErrorCode *string `type:"string"` - - // The text of the error message that is returned if the WorkSpace cannot be - // created. - ErrorMessage *string `type:"string"` + // The identifier of the WorkSpace. + // + // WorkspaceId is a required field + WorkspaceId *string `type:"string" required:"true"` - // Information about the WorkSpace. - WorkspaceRequest *WorkspaceRequest `type:"structure"` + // The properties of the WorkSpace. + // + // WorkspaceProperties is a required field + WorkspaceProperties *WorkspaceProperties `type:"structure" required:"true"` } // String returns the string representation -func (s FailedCreateWorkspaceRequest) String() string { +func (s ModifyWorkspacePropertiesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s FailedCreateWorkspaceRequest) GoString() string { +func (s ModifyWorkspacePropertiesInput) GoString() string { return s.String() } -// SetErrorCode sets the ErrorCode field's value. -func (s *FailedCreateWorkspaceRequest) SetErrorCode(v string) *FailedCreateWorkspaceRequest { - s.ErrorCode = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *ModifyWorkspacePropertiesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyWorkspacePropertiesInput"} + if s.WorkspaceId == nil { + invalidParams.Add(request.NewErrParamRequired("WorkspaceId")) + } + if s.WorkspaceProperties == nil { + invalidParams.Add(request.NewErrParamRequired("WorkspaceProperties")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetErrorMessage sets the ErrorMessage field's value. -func (s *FailedCreateWorkspaceRequest) SetErrorMessage(v string) *FailedCreateWorkspaceRequest { - s.ErrorMessage = &v +// SetWorkspaceId sets the WorkspaceId field's value. +func (s *ModifyWorkspacePropertiesInput) SetWorkspaceId(v string) *ModifyWorkspacePropertiesInput { + s.WorkspaceId = &v return s } -// SetWorkspaceRequest sets the WorkspaceRequest field's value. -func (s *FailedCreateWorkspaceRequest) SetWorkspaceRequest(v *WorkspaceRequest) *FailedCreateWorkspaceRequest { - s.WorkspaceRequest = v +// SetWorkspaceProperties sets the WorkspaceProperties field's value. +func (s *ModifyWorkspacePropertiesInput) SetWorkspaceProperties(v *WorkspaceProperties) *ModifyWorkspacePropertiesInput { + s.WorkspaceProperties = v return s } -// Describes a WorkSpace that could not be rebooted. (RebootWorkspaces), rebuilt -// (RebuildWorkspaces), restored (RestoreWorkspace), terminated (TerminateWorkspaces), -// started (StartWorkspaces), or stopped (StopWorkspaces). -type FailedWorkspaceChangeRequest struct { +type ModifyWorkspacePropertiesOutput struct { _ struct{} `type:"structure"` - - // The error code that is returned if the WorkSpace cannot be rebooted. - ErrorCode *string `type:"string"` - - // The text of the error message that is returned if the WorkSpace cannot be - // rebooted. - ErrorMessage *string `type:"string"` - - // The identifier of the WorkSpace. - WorkspaceId *string `type:"string"` } // String returns the string representation -func (s FailedWorkspaceChangeRequest) String() string { +func (s ModifyWorkspacePropertiesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s FailedWorkspaceChangeRequest) GoString() string { +func (s ModifyWorkspacePropertiesOutput) GoString() string { return s.String() } -// SetErrorCode sets the ErrorCode field's value. -func (s *FailedWorkspaceChangeRequest) SetErrorCode(v string) *FailedWorkspaceChangeRequest { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *FailedWorkspaceChangeRequest) SetErrorMessage(v string) *FailedWorkspaceChangeRequest { - s.ErrorMessage = &v - return s -} - -// SetWorkspaceId sets the WorkspaceId field's value. -func (s *FailedWorkspaceChangeRequest) SetWorkspaceId(v string) *FailedWorkspaceChangeRequest { - s.WorkspaceId = &v - return s -} - -type ImportWorkspaceImageInput struct { +type ModifyWorkspaceStateInput struct { _ struct{} `type:"structure"` - // The identifier of the EC2 image. - // - // Ec2ImageId is a required field - Ec2ImageId *string `type:"string" required:"true"` - - // The description of the WorkSpace image. - // - // ImageDescription is a required field - ImageDescription *string `min:"1" type:"string" required:"true"` - - // The name of the WorkSpace image. + // The identifier of the WorkSpace. // - // ImageName is a required field - ImageName *string `min:"1" type:"string" required:"true"` + // WorkspaceId is a required field + WorkspaceId *string `type:"string" required:"true"` - // The ingestion process to be used when importing the image. + // The WorkSpace state. // - // IngestionProcess is a required field - IngestionProcess *string `type:"string" required:"true" enum:"WorkspaceImageIngestionProcess"` - - // The tags. Each WorkSpaces resource can have a maximum of 50 tags. - Tags []*Tag `type:"list"` + // WorkspaceState is a required field + WorkspaceState *string `type:"string" required:"true" enum:"TargetWorkspaceState"` } // String returns the string representation -func (s ImportWorkspaceImageInput) String() string { +func (s ModifyWorkspaceStateInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ImportWorkspaceImageInput) GoString() string { +func (s ModifyWorkspaceStateInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ImportWorkspaceImageInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportWorkspaceImageInput"} - if s.Ec2ImageId == nil { - invalidParams.Add(request.NewErrParamRequired("Ec2ImageId")) - } - if s.ImageDescription == nil { - invalidParams.Add(request.NewErrParamRequired("ImageDescription")) - } - if s.ImageDescription != nil && len(*s.ImageDescription) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImageDescription", 1)) - } - if s.ImageName == nil { - invalidParams.Add(request.NewErrParamRequired("ImageName")) - } - if s.ImageName != nil && len(*s.ImageName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ImageName", 1)) - } - if s.IngestionProcess == nil { - invalidParams.Add(request.NewErrParamRequired("IngestionProcess")) +func (s *ModifyWorkspaceStateInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "ModifyWorkspaceStateInput"} + if s.WorkspaceId == nil { + invalidParams.Add(request.NewErrParamRequired("WorkspaceId")) } - 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 s.WorkspaceState == nil { + invalidParams.Add(request.NewErrParamRequired("WorkspaceState")) } if invalidParams.Len() > 0 { @@ -5267,182 +6905,245 @@ func (s *ImportWorkspaceImageInput) Validate() error { return nil } -// SetEc2ImageId sets the Ec2ImageId field's value. -func (s *ImportWorkspaceImageInput) SetEc2ImageId(v string) *ImportWorkspaceImageInput { - s.Ec2ImageId = &v +// SetWorkspaceId sets the WorkspaceId field's value. +func (s *ModifyWorkspaceStateInput) SetWorkspaceId(v string) *ModifyWorkspaceStateInput { + s.WorkspaceId = &v return s } -// SetImageDescription sets the ImageDescription field's value. -func (s *ImportWorkspaceImageInput) SetImageDescription(v string) *ImportWorkspaceImageInput { - s.ImageDescription = &v +// SetWorkspaceState sets the WorkspaceState field's value. +func (s *ModifyWorkspaceStateInput) SetWorkspaceState(v string) *ModifyWorkspaceStateInput { + s.WorkspaceState = &v return s } -// SetImageName sets the ImageName field's value. -func (s *ImportWorkspaceImageInput) SetImageName(v string) *ImportWorkspaceImageInput { - s.ImageName = &v - return s +type ModifyWorkspaceStateOutput struct { + _ struct{} `type:"structure"` } -// SetIngestionProcess sets the IngestionProcess field's value. -func (s *ImportWorkspaceImageInput) SetIngestionProcess(v string) *ImportWorkspaceImageInput { - s.IngestionProcess = &v - return s +// String returns the string representation +func (s ModifyWorkspaceStateOutput) String() string { + return awsutil.Prettify(s) } -// SetTags sets the Tags field's value. -func (s *ImportWorkspaceImageInput) SetTags(v []*Tag) *ImportWorkspaceImageInput { - s.Tags = v - return s +// GoString returns the string representation +func (s ModifyWorkspaceStateOutput) GoString() string { + return s.String() } -type ImportWorkspaceImageOutput struct { +// The operating system that the image is running. +type OperatingSystem struct { _ struct{} `type:"structure"` - // The identifier of the WorkSpace image. - ImageId *string `type:"string"` + // The operating system. + Type *string `type:"string" enum:"OperatingSystemType"` } // String returns the string representation -func (s ImportWorkspaceImageOutput) String() string { +func (s OperatingSystem) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ImportWorkspaceImageOutput) GoString() string { +func (s OperatingSystem) GoString() string { return s.String() } -// SetImageId sets the ImageId field's value. -func (s *ImportWorkspaceImageOutput) SetImageId(v string) *ImportWorkspaceImageOutput { - s.ImageId = &v +// SetType sets the Type field's value. +func (s *OperatingSystem) SetType(v string) *OperatingSystem { + s.Type = &v return s } -// Describes an IP access control group. -type IpGroup struct { - _ struct{} `type:"structure"` +// The properties of this WorkSpace are currently being modified. Try again +// in a moment. +type OperationInProgressException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The description of the group. - GroupDesc *string `locationName:"groupDesc" type:"string"` + Message_ *string `locationName:"message" type:"string"` +} - // The identifier of the group. - GroupId *string `locationName:"groupId" type:"string"` +// String returns the string representation +func (s OperationInProgressException) String() string { + return awsutil.Prettify(s) +} - // The name of the group. - GroupName *string `locationName:"groupName" type:"string"` +// GoString returns the string representation +func (s OperationInProgressException) GoString() string { + return s.String() +} - // The rules. - UserRules []*IpRuleItem `locationName:"userRules" type:"list"` +func newErrorOperationInProgressException(v protocol.ResponseMetadata) error { + return &OperationInProgressException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s OperationInProgressException) Code() string { + return "OperationInProgressException" +} + +// Message returns the exception's message. +func (s OperationInProgressException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OperationInProgressException) OrigErr() error { + return nil +} + +func (s OperationInProgressException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s OperationInProgressException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s OperationInProgressException) RequestID() string { + return s.respMetadata.RequestID +} + +// This operation is not supported. +type OperationNotSupportedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s IpGroup) String() string { +func (s OperationNotSupportedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s IpGroup) GoString() string { +func (s OperationNotSupportedException) GoString() string { return s.String() } -// SetGroupDesc sets the GroupDesc field's value. -func (s *IpGroup) SetGroupDesc(v string) *IpGroup { - s.GroupDesc = &v - return s +func newErrorOperationNotSupportedException(v protocol.ResponseMetadata) error { + return &OperationNotSupportedException{ + respMetadata: v, + } } -// SetGroupId sets the GroupId field's value. -func (s *IpGroup) SetGroupId(v string) *IpGroup { - s.GroupId = &v - return s +// Code returns the exception type name. +func (s OperationNotSupportedException) Code() string { + return "OperationNotSupportedException" } -// SetGroupName sets the GroupName field's value. -func (s *IpGroup) SetGroupName(v string) *IpGroup { - s.GroupName = &v - return s +// Message returns the exception's message. +func (s OperationNotSupportedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetUserRules sets the UserRules field's value. -func (s *IpGroup) SetUserRules(v []*IpRuleItem) *IpGroup { - s.UserRules = v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s OperationNotSupportedException) OrigErr() error { + return nil } -// Describes a rule for an IP access control group. -type IpRuleItem struct { - _ struct{} `type:"structure"` +func (s OperationNotSupportedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - // The IP address range, in CIDR notation. - IpRule *string `locationName:"ipRule" type:"string"` +// Status code returns the HTTP status code for the request's response error. +func (s OperationNotSupportedException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The description. - RuleDesc *string `locationName:"ruleDesc" type:"string"` +// RequestID returns the service's response RequestID for request. +func (s OperationNotSupportedException) RequestID() string { + return s.respMetadata.RequestID +} + +// Describes the information used to reboot a WorkSpace. +type RebootRequest struct { + _ struct{} `type:"structure"` + + // The identifier of the WorkSpace. + // + // WorkspaceId is a required field + WorkspaceId *string `type:"string" required:"true"` } // String returns the string representation -func (s IpRuleItem) String() string { +func (s RebootRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s IpRuleItem) GoString() string { +func (s RebootRequest) GoString() string { return s.String() } -// SetIpRule sets the IpRule field's value. -func (s *IpRuleItem) SetIpRule(v string) *IpRuleItem { - s.IpRule = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *RebootRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RebootRequest"} + if s.WorkspaceId == nil { + invalidParams.Add(request.NewErrParamRequired("WorkspaceId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetRuleDesc sets the RuleDesc field's value. -func (s *IpRuleItem) SetRuleDesc(v string) *IpRuleItem { - s.RuleDesc = &v +// SetWorkspaceId sets the WorkspaceId field's value. +func (s *RebootRequest) SetWorkspaceId(v string) *RebootRequest { + s.WorkspaceId = &v return s } -type ListAvailableManagementCidrRangesInput struct { +type RebootWorkspacesInput struct { _ struct{} `type:"structure"` - // The IP address range to search. Specify an IP address range that is compatible - // with your network and in CIDR notation (that is, specify the range as an - // IPv4 CIDR block). + // The WorkSpaces to reboot. You can specify up to 25 WorkSpaces. // - // ManagementCidrRangeConstraint is a required field - ManagementCidrRangeConstraint *string `type:"string" required:"true"` - - // The maximum number of items to return. - MaxResults *int64 `min:"1" type:"integer"` - - // If you received a NextToken from a previous call that was paginated, provide - // this token to receive the next set of results. - NextToken *string `min:"1" type:"string"` + // RebootWorkspaceRequests is a required field + RebootWorkspaceRequests []*RebootRequest `min:"1" type:"list" required:"true"` } // String returns the string representation -func (s ListAvailableManagementCidrRangesInput) String() string { +func (s RebootWorkspacesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListAvailableManagementCidrRangesInput) GoString() string { +func (s RebootWorkspacesInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ListAvailableManagementCidrRangesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAvailableManagementCidrRangesInput"} - if s.ManagementCidrRangeConstraint == nil { - invalidParams.Add(request.NewErrParamRequired("ManagementCidrRangeConstraint")) +func (s *RebootWorkspacesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RebootWorkspacesInput"} + if s.RebootWorkspaceRequests == nil { + invalidParams.Add(request.NewErrParamRequired("RebootWorkspaceRequests")) } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) + if s.RebootWorkspaceRequests != nil && len(s.RebootWorkspaceRequests) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RebootWorkspaceRequests", 1)) } - if s.NextToken != nil && len(*s.NextToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 1)) + if s.RebootWorkspaceRequests != nil { + for i, v := range s.RebootWorkspaceRequests { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RebootWorkspaceRequests", i), err.(request.ErrInvalidParams)) + } + } } if invalidParams.Len() > 0 { @@ -5451,176 +7152,221 @@ func (s *ListAvailableManagementCidrRangesInput) Validate() error { return nil } -// SetManagementCidrRangeConstraint sets the ManagementCidrRangeConstraint field's value. -func (s *ListAvailableManagementCidrRangesInput) SetManagementCidrRangeConstraint(v string) *ListAvailableManagementCidrRangesInput { - s.ManagementCidrRangeConstraint = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAvailableManagementCidrRangesInput) SetMaxResults(v int64) *ListAvailableManagementCidrRangesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAvailableManagementCidrRangesInput) SetNextToken(v string) *ListAvailableManagementCidrRangesInput { - s.NextToken = &v +// SetRebootWorkspaceRequests sets the RebootWorkspaceRequests field's value. +func (s *RebootWorkspacesInput) SetRebootWorkspaceRequests(v []*RebootRequest) *RebootWorkspacesInput { + s.RebootWorkspaceRequests = v return s } -type ListAvailableManagementCidrRangesOutput struct { +type RebootWorkspacesOutput struct { _ struct{} `type:"structure"` - // The list of available IP address ranges, specified as IPv4 CIDR blocks. - ManagementCidrRanges []*string `type:"list"` - - // The token to use to retrieve the next set of results, or null if no more - // results are available. - NextToken *string `min:"1" type:"string"` + // Information about the WorkSpaces that could not be rebooted. + FailedRequests []*FailedWorkspaceChangeRequest `type:"list"` } // String returns the string representation -func (s ListAvailableManagementCidrRangesOutput) String() string { +func (s RebootWorkspacesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ListAvailableManagementCidrRangesOutput) GoString() string { +func (s RebootWorkspacesOutput) GoString() string { return s.String() } -// SetManagementCidrRanges sets the ManagementCidrRanges field's value. -func (s *ListAvailableManagementCidrRangesOutput) SetManagementCidrRanges(v []*string) *ListAvailableManagementCidrRangesOutput { - s.ManagementCidrRanges = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAvailableManagementCidrRangesOutput) SetNextToken(v string) *ListAvailableManagementCidrRangesOutput { - s.NextToken = &v +// SetFailedRequests sets the FailedRequests field's value. +func (s *RebootWorkspacesOutput) SetFailedRequests(v []*FailedWorkspaceChangeRequest) *RebootWorkspacesOutput { + s.FailedRequests = v return s } -// Describes a WorkSpace modification. -type ModificationState struct { +// Describes the information used to rebuild a WorkSpace. +type RebuildRequest struct { _ struct{} `type:"structure"` - // The resource. - Resource *string `type:"string" enum:"ModificationResourceEnum"` - - // The modification state. - State *string `type:"string" enum:"ModificationStateEnum"` + // The identifier of the WorkSpace. + // + // WorkspaceId is a required field + WorkspaceId *string `type:"string" required:"true"` } // String returns the string representation -func (s ModificationState) String() string { +func (s RebuildRequest) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModificationState) GoString() string { +func (s RebuildRequest) GoString() string { return s.String() } -// SetResource sets the Resource field's value. -func (s *ModificationState) SetResource(v string) *ModificationState { - s.Resource = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *RebuildRequest) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RebuildRequest"} + if s.WorkspaceId == nil { + invalidParams.Add(request.NewErrParamRequired("WorkspaceId")) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetState sets the State field's value. -func (s *ModificationState) SetState(v string) *ModificationState { - s.State = &v +// SetWorkspaceId sets the WorkspaceId field's value. +func (s *RebuildRequest) SetWorkspaceId(v string) *RebuildRequest { + s.WorkspaceId = &v return s } -type ModifyAccountInput struct { +type RebuildWorkspacesInput struct { _ struct{} `type:"structure"` - // The IP address range, specified as an IPv4 CIDR block, for the management - // network interface. Specify an IP address range that is compatible with your - // network and in CIDR notation (that is, specify the range as an IPv4 CIDR - // block). The CIDR block size must be /16 (for example, 203.0.113.25/16). It - // must also be specified as available by the ListAvailableManagementCidrRanges - // operation. - DedicatedTenancyManagementCidrRange *string `type:"string"` - - // The status of BYOL. - DedicatedTenancySupport *string `type:"string" enum:"DedicatedTenancySupportEnum"` + // The WorkSpace to rebuild. You can specify a single WorkSpace. + // + // RebuildWorkspaceRequests is a required field + RebuildWorkspaceRequests []*RebuildRequest `min:"1" type:"list" required:"true"` } // String returns the string representation -func (s ModifyAccountInput) String() string { +func (s RebuildWorkspacesInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModifyAccountInput) GoString() string { +func (s RebuildWorkspacesInput) GoString() string { return s.String() } -// SetDedicatedTenancyManagementCidrRange sets the DedicatedTenancyManagementCidrRange field's value. -func (s *ModifyAccountInput) SetDedicatedTenancyManagementCidrRange(v string) *ModifyAccountInput { - s.DedicatedTenancyManagementCidrRange = &v - return s +// Validate inspects the fields of the type to determine if they are valid. +func (s *RebuildWorkspacesInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RebuildWorkspacesInput"} + if s.RebuildWorkspaceRequests == nil { + invalidParams.Add(request.NewErrParamRequired("RebuildWorkspaceRequests")) + } + if s.RebuildWorkspaceRequests != nil && len(s.RebuildWorkspaceRequests) < 1 { + invalidParams.Add(request.NewErrParamMinLen("RebuildWorkspaceRequests", 1)) + } + if s.RebuildWorkspaceRequests != nil { + for i, v := range s.RebuildWorkspaceRequests { + if v == nil { + continue + } + if err := v.Validate(); err != nil { + invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RebuildWorkspaceRequests", i), err.(request.ErrInvalidParams)) + } + } + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil } -// SetDedicatedTenancySupport sets the DedicatedTenancySupport field's value. -func (s *ModifyAccountInput) SetDedicatedTenancySupport(v string) *ModifyAccountInput { - s.DedicatedTenancySupport = &v +// SetRebuildWorkspaceRequests sets the RebuildWorkspaceRequests field's value. +func (s *RebuildWorkspacesInput) SetRebuildWorkspaceRequests(v []*RebuildRequest) *RebuildWorkspacesInput { + s.RebuildWorkspaceRequests = v return s } -type ModifyAccountOutput struct { +type RebuildWorkspacesOutput struct { _ struct{} `type:"structure"` + + // Information about the WorkSpace that could not be rebuilt. + FailedRequests []*FailedWorkspaceChangeRequest `type:"list"` } // String returns the string representation -func (s ModifyAccountOutput) String() string { +func (s RebuildWorkspacesOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModifyAccountOutput) GoString() string { +func (s RebuildWorkspacesOutput) GoString() string { return s.String() } -type ModifyClientPropertiesInput struct { +// SetFailedRequests sets the FailedRequests field's value. +func (s *RebuildWorkspacesOutput) SetFailedRequests(v []*FailedWorkspaceChangeRequest) *RebuildWorkspacesOutput { + s.FailedRequests = v + return s +} + +type RegisterWorkspaceDirectoryInput struct { _ struct{} `type:"structure"` - // Information about the Amazon WorkSpaces client. + // The identifier of the directory. You cannot register a directory if it does + // not have a status of Active. If the directory does not have a status of Active, + // you will receive an InvalidResourceStateException error. If you have already + // registered the maximum number of directories that you can register with Amazon + // WorkSpaces, you will receive a ResourceLimitExceededException error. Deregister + // directories that you are not using for WorkSpaces, and try again. // - // ClientProperties is a required field - ClientProperties *ClientProperties `type:"structure" required:"true"` + // DirectoryId is a required field + DirectoryId *string `min:"10" type:"string" required:"true"` - // The resource identifiers, in the form of directory IDs. + // Indicates whether self-service capabilities are enabled or disabled. + EnableSelfService *bool `type:"boolean"` + + // Indicates whether Amazon WorkDocs is enabled or disabled. If you have enabled + // this parameter and WorkDocs is not available in the Region, you will receive + // an OperationNotSupportedException error. Set EnableWorkDocs to disabled, + // and try again. // - // ResourceId is a required field - ResourceId *string `min:"1" type:"string" required:"true"` + // EnableWorkDocs is a required field + EnableWorkDocs *bool `type:"boolean" required:"true"` + + // The identifiers of the subnets for your virtual private cloud (VPC). Make + // sure that the subnets are in supported Availability Zones. The subnets must + // also be in separate Availability Zones. If these conditions are not met, + // you will receive an OperationNotSupportedException error. + SubnetIds []*string `type:"list"` + + // The tags associated with the directory. + Tags []*Tag `type:"list"` + + // Indicates whether your WorkSpace directory is dedicated or shared. To use + // Bring Your Own License (BYOL) images, this value must be set to DEDICATED + // and your AWS account must be enabled for BYOL. If your account has not been + // enabled for BYOL, you will receive an InvalidParameterValuesException error. + // For more information about BYOL images, see Bring Your Own Windows Desktop + // Images (https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html). + Tenancy *string `type:"string" enum:"Tenancy"` } // String returns the string representation -func (s ModifyClientPropertiesInput) String() string { +func (s RegisterWorkspaceDirectoryInput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModifyClientPropertiesInput) GoString() string { +func (s RegisterWorkspaceDirectoryInput) GoString() string { return s.String() } // Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyClientPropertiesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyClientPropertiesInput"} - if s.ClientProperties == nil { - invalidParams.Add(request.NewErrParamRequired("ClientProperties")) +func (s *RegisterWorkspaceDirectoryInput) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "RegisterWorkspaceDirectoryInput"} + if s.DirectoryId == nil { + invalidParams.Add(request.NewErrParamRequired("DirectoryId")) } - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) + if s.DirectoryId != nil && len(*s.DirectoryId) < 10 { + invalidParams.Add(request.NewErrParamMinLen("DirectoryId", 10)) } - if s.ResourceId != nil && len(*s.ResourceId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceId", 1)) + if s.EnableWorkDocs == nil { + invalidParams.Add(request.NewErrParamRequired("EnableWorkDocs")) + } + 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 { @@ -5629,412 +7375,399 @@ func (s *ModifyClientPropertiesInput) Validate() error { return nil } -// SetClientProperties sets the ClientProperties field's value. -func (s *ModifyClientPropertiesInput) SetClientProperties(v *ClientProperties) *ModifyClientPropertiesInput { - s.ClientProperties = v +// SetDirectoryId sets the DirectoryId field's value. +func (s *RegisterWorkspaceDirectoryInput) SetDirectoryId(v string) *RegisterWorkspaceDirectoryInput { + s.DirectoryId = &v return s } -// SetResourceId sets the ResourceId field's value. -func (s *ModifyClientPropertiesInput) SetResourceId(v string) *ModifyClientPropertiesInput { - s.ResourceId = &v +// SetEnableSelfService sets the EnableSelfService field's value. +func (s *RegisterWorkspaceDirectoryInput) SetEnableSelfService(v bool) *RegisterWorkspaceDirectoryInput { + s.EnableSelfService = &v + return s +} + +// SetEnableWorkDocs sets the EnableWorkDocs field's value. +func (s *RegisterWorkspaceDirectoryInput) SetEnableWorkDocs(v bool) *RegisterWorkspaceDirectoryInput { + s.EnableWorkDocs = &v + return s +} + +// SetSubnetIds sets the SubnetIds field's value. +func (s *RegisterWorkspaceDirectoryInput) SetSubnetIds(v []*string) *RegisterWorkspaceDirectoryInput { + s.SubnetIds = v + return s +} + +// SetTags sets the Tags field's value. +func (s *RegisterWorkspaceDirectoryInput) SetTags(v []*Tag) *RegisterWorkspaceDirectoryInput { + s.Tags = v + return s +} + +// SetTenancy sets the Tenancy field's value. +func (s *RegisterWorkspaceDirectoryInput) SetTenancy(v string) *RegisterWorkspaceDirectoryInput { + s.Tenancy = &v return s } -type ModifyClientPropertiesOutput struct { +type RegisterWorkspaceDirectoryOutput struct { _ struct{} `type:"structure"` } // String returns the string representation -func (s ModifyClientPropertiesOutput) String() string { +func (s RegisterWorkspaceDirectoryOutput) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModifyClientPropertiesOutput) GoString() string { +func (s RegisterWorkspaceDirectoryOutput) GoString() string { return s.String() } -type ModifyWorkspacePropertiesInput struct { - _ struct{} `type:"structure"` - - // The identifier of the WorkSpace. - // - // WorkspaceId is a required field - WorkspaceId *string `type:"string" required:"true"` +// The specified resource already exists. +type ResourceAlreadyExistsException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The properties of the WorkSpace. - // - // WorkspaceProperties is a required field - WorkspaceProperties *WorkspaceProperties `type:"structure" required:"true"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ModifyWorkspacePropertiesInput) String() string { +func (s ResourceAlreadyExistsException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModifyWorkspacePropertiesInput) GoString() string { +func (s ResourceAlreadyExistsException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyWorkspacePropertiesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyWorkspacePropertiesInput"} - if s.WorkspaceId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkspaceId")) - } - if s.WorkspaceProperties == nil { - invalidParams.Add(request.NewErrParamRequired("WorkspaceProperties")) +func newErrorResourceAlreadyExistsException(v protocol.ResponseMetadata) error { + return &ResourceAlreadyExistsException{ + respMetadata: v, } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil } -// SetWorkspaceId sets the WorkspaceId field's value. -func (s *ModifyWorkspacePropertiesInput) SetWorkspaceId(v string) *ModifyWorkspacePropertiesInput { - s.WorkspaceId = &v - return s +// Code returns the exception type name. +func (s ResourceAlreadyExistsException) Code() string { + return "ResourceAlreadyExistsException" } -// SetWorkspaceProperties sets the WorkspaceProperties field's value. -func (s *ModifyWorkspacePropertiesInput) SetWorkspaceProperties(v *WorkspaceProperties) *ModifyWorkspacePropertiesInput { - s.WorkspaceProperties = v - return s +// Message returns the exception's message. +func (s ResourceAlreadyExistsException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -type ModifyWorkspacePropertiesOutput struct { - _ struct{} `type:"structure"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAlreadyExistsException) OrigErr() error { + return nil } -// String returns the string representation -func (s ModifyWorkspacePropertiesOutput) String() string { - return awsutil.Prettify(s) +func (s ResourceAlreadyExistsException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// GoString returns the string representation -func (s ModifyWorkspacePropertiesOutput) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAlreadyExistsException) StatusCode() int { + return s.respMetadata.StatusCode } -type ModifyWorkspaceStateInput struct { - _ struct{} `type:"structure"` +// RequestID returns the service's response RequestID for request. +func (s ResourceAlreadyExistsException) RequestID() string { + return s.respMetadata.RequestID +} - // The identifier of the WorkSpace. - // - // WorkspaceId is a required field - WorkspaceId *string `type:"string" required:"true"` +// The resource is associated with a directory. +type ResourceAssociatedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The WorkSpace state. - // - // WorkspaceState is a required field - WorkspaceState *string `type:"string" required:"true" enum:"TargetWorkspaceState"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s ModifyWorkspaceStateInput) String() string { +func (s ResourceAssociatedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s ModifyWorkspaceStateInput) GoString() string { +func (s ResourceAssociatedException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *ModifyWorkspaceStateInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ModifyWorkspaceStateInput"} - if s.WorkspaceId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkspaceId")) - } - if s.WorkspaceState == nil { - invalidParams.Add(request.NewErrParamRequired("WorkspaceState")) +func newErrorResourceAssociatedException(v protocol.ResponseMetadata) error { + return &ResourceAssociatedException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// Code returns the exception type name. +func (s ResourceAssociatedException) Code() string { + return "ResourceAssociatedException" } -// SetWorkspaceId sets the WorkspaceId field's value. -func (s *ModifyWorkspaceStateInput) SetWorkspaceId(v string) *ModifyWorkspaceStateInput { - s.WorkspaceId = &v - return s +// Message returns the exception's message. +func (s ResourceAssociatedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// SetWorkspaceState sets the WorkspaceState field's value. -func (s *ModifyWorkspaceStateInput) SetWorkspaceState(v string) *ModifyWorkspaceStateInput { - s.WorkspaceState = &v - return s +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceAssociatedException) OrigErr() error { + return nil } -type ModifyWorkspaceStateOutput struct { - _ struct{} `type:"structure"` +func (s ResourceAssociatedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// String returns the string representation -func (s ModifyWorkspaceStateOutput) String() string { - return awsutil.Prettify(s) +// Status code returns the HTTP status code for the request's response error. +func (s ResourceAssociatedException) StatusCode() int { + return s.respMetadata.StatusCode } -// GoString returns the string representation -func (s ModifyWorkspaceStateOutput) GoString() string { - return s.String() +// RequestID returns the service's response RequestID for request. +func (s ResourceAssociatedException) RequestID() string { + return s.respMetadata.RequestID } -// The operating system that the image is running. -type OperatingSystem struct { - _ struct{} `type:"structure"` +// The resource could not be created. +type ResourceCreationFailedException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The operating system. - Type *string `type:"string" enum:"OperatingSystemType"` + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s OperatingSystem) String() string { +func (s ResourceCreationFailedException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s OperatingSystem) GoString() string { +func (s ResourceCreationFailedException) GoString() string { return s.String() } -// SetType sets the Type field's value. -func (s *OperatingSystem) SetType(v string) *OperatingSystem { - s.Type = &v - return s +func newErrorResourceCreationFailedException(v protocol.ResponseMetadata) error { + return &ResourceCreationFailedException{ + respMetadata: v, + } } -// Describes the information used to reboot a WorkSpace. -type RebootRequest struct { - _ struct{} `type:"structure"` - - // The identifier of the WorkSpace. - // - // WorkspaceId is a required field - WorkspaceId *string `type:"string" required:"true"` +// Code returns the exception type name. +func (s ResourceCreationFailedException) Code() string { + return "ResourceCreationFailedException" } -// String returns the string representation -func (s RebootRequest) String() string { - return awsutil.Prettify(s) +// Message returns the exception's message. +func (s ResourceCreationFailedException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// GoString returns the string representation -func (s RebootRequest) GoString() string { - return s.String() +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceCreationFailedException) OrigErr() error { + return nil } -// Validate inspects the fields of the type to determine if they are valid. -func (s *RebootRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RebootRequest"} - if s.WorkspaceId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkspaceId")) - } +func (s ResourceCreationFailedException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} - if invalidParams.Len() > 0 { - return invalidParams - } - return nil +// Status code returns the HTTP status code for the request's response error. +func (s ResourceCreationFailedException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetWorkspaceId sets the WorkspaceId field's value. -func (s *RebootRequest) SetWorkspaceId(v string) *RebootRequest { - s.WorkspaceId = &v - return s +// RequestID returns the service's response RequestID for request. +func (s ResourceCreationFailedException) RequestID() string { + return s.respMetadata.RequestID } -type RebootWorkspacesInput struct { - _ struct{} `type:"structure"` +// Your resource limits have been exceeded. +type ResourceLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The WorkSpaces to reboot. You can specify up to 25 WorkSpaces. - // - // RebootWorkspaceRequests is a required field - RebootWorkspaceRequests []*RebootRequest `min:"1" type:"list" required:"true"` + // The exception error message. + Message_ *string `locationName:"message" type:"string"` } // String returns the string representation -func (s RebootWorkspacesInput) String() string { +func (s ResourceLimitExceededException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RebootWorkspacesInput) GoString() string { +func (s ResourceLimitExceededException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *RebootWorkspacesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RebootWorkspacesInput"} - if s.RebootWorkspaceRequests == nil { - invalidParams.Add(request.NewErrParamRequired("RebootWorkspaceRequests")) - } - if s.RebootWorkspaceRequests != nil && len(s.RebootWorkspaceRequests) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RebootWorkspaceRequests", 1)) - } - if s.RebootWorkspaceRequests != nil { - for i, v := range s.RebootWorkspaceRequests { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RebootWorkspaceRequests", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams +func newErrorResourceLimitExceededException(v protocol.ResponseMetadata) error { + return &ResourceLimitExceededException{ + respMetadata: v, } - return nil } -// SetRebootWorkspaceRequests sets the RebootWorkspaceRequests field's value. -func (s *RebootWorkspacesInput) SetRebootWorkspaceRequests(v []*RebootRequest) *RebootWorkspacesInput { - s.RebootWorkspaceRequests = v - return s +// Code returns the exception type name. +func (s ResourceLimitExceededException) Code() string { + return "ResourceLimitExceededException" } -type RebootWorkspacesOutput struct { - _ struct{} `type:"structure"` +// Message returns the exception's message. +func (s ResourceLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} - // Information about the WorkSpaces that could not be rebooted. - FailedRequests []*FailedWorkspaceChangeRequest `type:"list"` +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceLimitExceededException) OrigErr() error { + return nil } -// String returns the string representation -func (s RebootWorkspacesOutput) String() string { - return awsutil.Prettify(s) +func (s ResourceLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) } -// GoString returns the string representation -func (s RebootWorkspacesOutput) GoString() string { - return s.String() +// Status code returns the HTTP status code for the request's response error. +func (s ResourceLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode } -// SetFailedRequests sets the FailedRequests field's value. -func (s *RebootWorkspacesOutput) SetFailedRequests(v []*FailedWorkspaceChangeRequest) *RebootWorkspacesOutput { - s.FailedRequests = v - return s +// RequestID returns the service's response RequestID for request. +func (s ResourceLimitExceededException) RequestID() string { + return s.respMetadata.RequestID } -// Describes the information used to rebuild a WorkSpace. -type RebuildRequest struct { - _ struct{} `type:"structure"` +// The resource could not be found. +type ResourceNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata - // The identifier of the WorkSpace. - // - // WorkspaceId is a required field - WorkspaceId *string `type:"string" required:"true"` + // The resource could not be found. + Message_ *string `locationName:"message" type:"string"` + + // The ID of the resource that could not be found. + ResourceId *string `min:"1" type:"string"` } // String returns the string representation -func (s RebuildRequest) String() string { +func (s ResourceNotFoundException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RebuildRequest) GoString() string { +func (s ResourceNotFoundException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *RebuildRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RebuildRequest"} - if s.WorkspaceId == nil { - invalidParams.Add(request.NewErrParamRequired("WorkspaceId")) +func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { + return &ResourceNotFoundException{ + respMetadata: v, } +} - if invalidParams.Len() > 0 { - return invalidParams +// Code returns the exception type name. +func (s ResourceNotFoundException) Code() string { + return "ResourceNotFoundException" +} + +// Message returns the exception's message. +func (s ResourceNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceNotFoundException) OrigErr() error { return nil } -// SetWorkspaceId sets the WorkspaceId field's value. -func (s *RebuildRequest) SetWorkspaceId(v string) *RebuildRequest { - s.WorkspaceId = &v - return s +func (s ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -type RebuildWorkspacesInput struct { - _ struct{} `type:"structure"` +// Status code returns the HTTP status code for the request's response error. +func (s ResourceNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} - // The WorkSpace to rebuild. You can specify a single WorkSpace. - // - // RebuildWorkspaceRequests is a required field - RebuildWorkspaceRequests []*RebuildRequest `min:"1" type:"list" required:"true"` +// RequestID returns the service's response RequestID for request. +func (s ResourceNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +// The specified resource is not available. +type ResourceUnavailableException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + // The exception error message. + Message_ *string `locationName:"message" type:"string"` + + // The identifier of the resource that is not available. + ResourceId *string `min:"1" type:"string"` } // String returns the string representation -func (s RebuildWorkspacesInput) String() string { +func (s ResourceUnavailableException) String() string { return awsutil.Prettify(s) } // GoString returns the string representation -func (s RebuildWorkspacesInput) GoString() string { +func (s ResourceUnavailableException) GoString() string { return s.String() } -// Validate inspects the fields of the type to determine if they are valid. -func (s *RebuildWorkspacesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RebuildWorkspacesInput"} - if s.RebuildWorkspaceRequests == nil { - invalidParams.Add(request.NewErrParamRequired("RebuildWorkspaceRequests")) - } - if s.RebuildWorkspaceRequests != nil && len(s.RebuildWorkspaceRequests) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RebuildWorkspaceRequests", 1)) - } - if s.RebuildWorkspaceRequests != nil { - for i, v := range s.RebuildWorkspaceRequests { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RebuildWorkspaceRequests", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams +func newErrorResourceUnavailableException(v protocol.ResponseMetadata) error { + return &ResourceUnavailableException{ + respMetadata: v, } - return nil -} - -// SetRebuildWorkspaceRequests sets the RebuildWorkspaceRequests field's value. -func (s *RebuildWorkspacesInput) SetRebuildWorkspaceRequests(v []*RebuildRequest) *RebuildWorkspacesInput { - s.RebuildWorkspaceRequests = v - return s } -type RebuildWorkspacesOutput struct { - _ struct{} `type:"structure"` +// Code returns the exception type name. +func (s ResourceUnavailableException) Code() string { + return "ResourceUnavailableException" +} - // Information about the WorkSpace that could not be rebuilt. - FailedRequests []*FailedWorkspaceChangeRequest `type:"list"` +// Message returns the exception's message. +func (s ResourceUnavailableException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" } -// String returns the string representation -func (s RebuildWorkspacesOutput) String() string { - return awsutil.Prettify(s) +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ResourceUnavailableException) OrigErr() error { + return nil } -// GoString returns the string representation -func (s RebuildWorkspacesOutput) GoString() string { - return s.String() +func (s ResourceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) } -// SetFailedRequests sets the FailedRequests field's value. -func (s *RebuildWorkspacesOutput) SetFailedRequests(v []*FailedWorkspaceChangeRequest) *RebuildWorkspacesOutput { - s.FailedRequests = v - return s +// Status code returns the HTTP status code for the request's response error. +func (s ResourceUnavailableException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ResourceUnavailableException) RequestID() string { + return s.respMetadata.RequestID } type RestoreWorkspaceInput struct { @@ -6179,6 +7912,70 @@ func (s *RootStorage) SetCapacity(v string) *RootStorage { return s } +// Describes the self-service permissions for a directory. For more information, +// see Enable Self-Service WorkSpace Management Capabilities for Your Users +// (https://docs.aws.amazon.com/workspaces/latest/adminguide/enable-user-self-service-workspace-management.html). +type SelfservicePermissions struct { + _ struct{} `type:"structure"` + + // Specifies whether users can change the compute type (bundle) for their WorkSpace. + ChangeComputeType *string `type:"string" enum:"ReconnectEnum"` + + // Specifies whether users can increase the volume size of the drives on their + // WorkSpace. + IncreaseVolumeSize *string `type:"string" enum:"ReconnectEnum"` + + // Specifies whether users can rebuild the operating system of a WorkSpace to + // its original state. + RebuildWorkspace *string `type:"string" enum:"ReconnectEnum"` + + // Specifies whether users can restart their WorkSpace. + RestartWorkspace *string `type:"string" enum:"ReconnectEnum"` + + // Specifies whether users can switch the running mode of their WorkSpace. + SwitchRunningMode *string `type:"string" enum:"ReconnectEnum"` +} + +// String returns the string representation +func (s SelfservicePermissions) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s SelfservicePermissions) GoString() string { + return s.String() +} + +// SetChangeComputeType sets the ChangeComputeType field's value. +func (s *SelfservicePermissions) SetChangeComputeType(v string) *SelfservicePermissions { + s.ChangeComputeType = &v + return s +} + +// SetIncreaseVolumeSize sets the IncreaseVolumeSize field's value. +func (s *SelfservicePermissions) SetIncreaseVolumeSize(v string) *SelfservicePermissions { + s.IncreaseVolumeSize = &v + return s +} + +// SetRebuildWorkspace sets the RebuildWorkspace field's value. +func (s *SelfservicePermissions) SetRebuildWorkspace(v string) *SelfservicePermissions { + s.RebuildWorkspace = &v + return s +} + +// SetRestartWorkspace sets the RestartWorkspace field's value. +func (s *SelfservicePermissions) SetRestartWorkspace(v string) *SelfservicePermissions { + s.RestartWorkspace = &v + return s +} + +// SetSwitchRunningMode sets the SwitchRunningMode field's value. +func (s *SelfservicePermissions) SetSwitchRunningMode(v string) *SelfservicePermissions { + s.SwitchRunningMode = &v + return s +} + // Describes a snapshot. type Snapshot struct { _ struct{} `type:"structure"` @@ -6543,6 +8340,123 @@ func (s *TerminateWorkspacesOutput) SetFailedRequests(v []*FailedWorkspaceChange return s } +// The configuration of this network is not supported for this operation, or +// your network configuration conflicts with the Amazon WorkSpaces management +// network IP range. For more information, see Configure a VPC for Amazon WorkSpaces +// (https://docs.aws.amazon.com/workspaces/latest/adminguide/amazon-workspaces-vpc.html). +type UnsupportedNetworkConfigurationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedNetworkConfigurationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedNetworkConfigurationException) GoString() string { + return s.String() +} + +func newErrorUnsupportedNetworkConfigurationException(v protocol.ResponseMetadata) error { + return &UnsupportedNetworkConfigurationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedNetworkConfigurationException) Code() string { + return "UnsupportedNetworkConfigurationException" +} + +// Message returns the exception's message. +func (s UnsupportedNetworkConfigurationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedNetworkConfigurationException) OrigErr() error { + return nil +} + +func (s UnsupportedNetworkConfigurationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedNetworkConfigurationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedNetworkConfigurationException) RequestID() string { + return s.respMetadata.RequestID +} + +// The configuration of this WorkSpace is not supported for this operation. +// For more information, see Required Configuration and Service Components for +// WorkSpaces (https://docs.aws.amazon.com/workspaces/latest/adminguide/required-service-components.html). +type UnsupportedWorkspaceConfigurationException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s UnsupportedWorkspaceConfigurationException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s UnsupportedWorkspaceConfigurationException) GoString() string { + return s.String() +} + +func newErrorUnsupportedWorkspaceConfigurationException(v protocol.ResponseMetadata) error { + return &UnsupportedWorkspaceConfigurationException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s UnsupportedWorkspaceConfigurationException) Code() string { + return "UnsupportedWorkspaceConfigurationException" +} + +// Message returns the exception's message. +func (s UnsupportedWorkspaceConfigurationException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s UnsupportedWorkspaceConfigurationException) OrigErr() error { + return nil +} + +func (s UnsupportedWorkspaceConfigurationException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s UnsupportedWorkspaceConfigurationException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s UnsupportedWorkspaceConfigurationException) RequestID() string { + return s.respMetadata.RequestID +} + type UpdateRulesOfIpGroupInput struct { _ struct{} `type:"structure"` @@ -6644,7 +8558,7 @@ type Workspace struct { ComputerName *string `type:"string"` // The identifier of the AWS Directory Service directory for the WorkSpace. - DirectoryId *string `type:"string"` + DirectoryId *string `min:"10" type:"string"` // The error code that is returned if the WorkSpace cannot be created. ErrorCode *string `type:"string"` @@ -6666,7 +8580,7 @@ type Workspace struct { State *string `type:"string" enum:"WorkspaceState"` // The identifier of the subnet for the WorkSpace. - SubnetId *string `type:"string"` + SubnetId *string `min:"15" type:"string"` // The user for the WorkSpace. UserName *string `min:"1" type:"string"` @@ -6674,7 +8588,8 @@ type Workspace struct { // Indicates whether the data stored on the user volume is encrypted. UserVolumeEncryptionEnabled *bool `type:"boolean"` - // The KMS key used to encrypt data stored on your WorkSpace. + // The symmetric AWS KMS customer master key (CMK) used to encrypt data stored + // on your WorkSpace. Amazon WorkSpaces does not support asymmetric CMKs. VolumeEncryptionKey *string `type:"string"` // The identifier of the WorkSpace. @@ -6784,6 +8699,91 @@ func (s *Workspace) SetWorkspaceProperties(v *WorkspaceProperties) *Workspace { return s } +// The device types and operating systems that can be used to access a WorkSpace. +// For more information, see Amazon WorkSpaces Client Network Requirements (https://docs.aws.amazon.com/workspaces/latest/adminguide/workspaces-network-requirements.html). +type WorkspaceAccessProperties struct { + _ struct{} `type:"structure"` + + // Indicates whether users can use Android devices to access their WorkSpaces. + DeviceTypeAndroid *string `type:"string" enum:"AccessPropertyValue"` + + // Indicates whether users can use Chromebooks to access their WorkSpaces. + DeviceTypeChromeOs *string `type:"string" enum:"AccessPropertyValue"` + + // Indicates whether users can use iOS devices to access their WorkSpaces. + DeviceTypeIos *string `type:"string" enum:"AccessPropertyValue"` + + // Indicates whether users can use macOS clients to access their WorkSpaces. + // To restrict WorkSpaces access to trusted devices (also known as managed devices) + // with valid certificates, specify a value of TRUST. For more information, + // see Restrict WorkSpaces Access to Trusted Devices (https://docs.aws.amazon.com/workspaces/latest/adminguide/trusted-devices.html). + DeviceTypeOsx *string `type:"string" enum:"AccessPropertyValue"` + + // Indicates whether users can access their WorkSpaces through a web browser. + DeviceTypeWeb *string `type:"string" enum:"AccessPropertyValue"` + + // Indicates whether users can use Windows clients to access their WorkSpaces. + // To restrict WorkSpaces access to trusted devices (also known as managed devices) + // with valid certificates, specify a value of TRUST. For more information, + // see Restrict WorkSpaces Access to Trusted Devices (https://docs.aws.amazon.com/workspaces/latest/adminguide/trusted-devices.html). + DeviceTypeWindows *string `type:"string" enum:"AccessPropertyValue"` + + // Indicates whether users can use zero client devices to access their WorkSpaces. + DeviceTypeZeroClient *string `type:"string" enum:"AccessPropertyValue"` +} + +// String returns the string representation +func (s WorkspaceAccessProperties) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WorkspaceAccessProperties) GoString() string { + return s.String() +} + +// SetDeviceTypeAndroid sets the DeviceTypeAndroid field's value. +func (s *WorkspaceAccessProperties) SetDeviceTypeAndroid(v string) *WorkspaceAccessProperties { + s.DeviceTypeAndroid = &v + return s +} + +// SetDeviceTypeChromeOs sets the DeviceTypeChromeOs field's value. +func (s *WorkspaceAccessProperties) SetDeviceTypeChromeOs(v string) *WorkspaceAccessProperties { + s.DeviceTypeChromeOs = &v + return s +} + +// SetDeviceTypeIos sets the DeviceTypeIos field's value. +func (s *WorkspaceAccessProperties) SetDeviceTypeIos(v string) *WorkspaceAccessProperties { + s.DeviceTypeIos = &v + return s +} + +// SetDeviceTypeOsx sets the DeviceTypeOsx field's value. +func (s *WorkspaceAccessProperties) SetDeviceTypeOsx(v string) *WorkspaceAccessProperties { + s.DeviceTypeOsx = &v + return s +} + +// SetDeviceTypeWeb sets the DeviceTypeWeb field's value. +func (s *WorkspaceAccessProperties) SetDeviceTypeWeb(v string) *WorkspaceAccessProperties { + s.DeviceTypeWeb = &v + return s +} + +// SetDeviceTypeWindows sets the DeviceTypeWindows field's value. +func (s *WorkspaceAccessProperties) SetDeviceTypeWindows(v string) *WorkspaceAccessProperties { + s.DeviceTypeWindows = &v + return s +} + +// SetDeviceTypeZeroClient sets the DeviceTypeZeroClient field's value. +func (s *WorkspaceAccessProperties) SetDeviceTypeZeroClient(v string) *WorkspaceAccessProperties { + s.DeviceTypeZeroClient = &v + return s +} + // Describes a WorkSpace bundle. type WorkspaceBundle struct { _ struct{} `type:"structure"` @@ -6797,6 +8797,12 @@ type WorkspaceBundle struct { // A description. Description *string `type:"string"` + // The image identifier of the bundle. + ImageId *string `type:"string"` + + // The last time that the bundle was updated. + LastUpdatedTime *time.Time `type:"timestamp"` + // The name of the bundle. Name *string `min:"1" type:"string"` @@ -6839,6 +8845,18 @@ func (s *WorkspaceBundle) SetDescription(v string) *WorkspaceBundle { return s } +// SetImageId sets the ImageId field's value. +func (s *WorkspaceBundle) SetImageId(v string) *WorkspaceBundle { + s.ImageId = &v + return s +} + +// SetLastUpdatedTime sets the LastUpdatedTime field's value. +func (s *WorkspaceBundle) SetLastUpdatedTime(v time.Time) *WorkspaceBundle { + s.LastUpdatedTime = &v + return s +} + // SetName sets the Name field's value. func (s *WorkspaceBundle) SetName(v string) *WorkspaceBundle { s.Name = &v @@ -6915,7 +8933,82 @@ func (s *WorkspaceConnectionStatus) SetWorkspaceId(v string) *WorkspaceConnectio return s } -// Describes an AWS Directory Service directory that is used with Amazon WorkSpaces. +// Describes the default properties that are used for creating WorkSpaces. For +// more information, see Update Directory Details for Your WorkSpaces (https://docs.aws.amazon.com/workspaces/latest/adminguide/update-directory-details.html). +type WorkspaceCreationProperties struct { + _ struct{} `type:"structure"` + + // The identifier of your custom security group. + CustomSecurityGroupId *string `min:"11" type:"string"` + + // The default organizational unit (OU) for your WorkSpace directories. + DefaultOu *string `type:"string"` + + // Indicates whether internet access is enabled for your WorkSpaces. + EnableInternetAccess *bool `type:"boolean"` + + // Indicates whether maintenance mode is enabled for your WorkSpaces. For more + // information, see WorkSpace Maintenance (https://docs.aws.amazon.com/workspaces/latest/adminguide/workspace-maintenance.html). + EnableMaintenanceMode *bool `type:"boolean"` + + // Indicates whether users are local administrators of their WorkSpaces. + UserEnabledAsLocalAdministrator *bool `type:"boolean"` +} + +// String returns the string representation +func (s WorkspaceCreationProperties) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WorkspaceCreationProperties) GoString() string { + return s.String() +} + +// Validate inspects the fields of the type to determine if they are valid. +func (s *WorkspaceCreationProperties) Validate() error { + invalidParams := request.ErrInvalidParams{Context: "WorkspaceCreationProperties"} + if s.CustomSecurityGroupId != nil && len(*s.CustomSecurityGroupId) < 11 { + invalidParams.Add(request.NewErrParamMinLen("CustomSecurityGroupId", 11)) + } + + if invalidParams.Len() > 0 { + return invalidParams + } + return nil +} + +// SetCustomSecurityGroupId sets the CustomSecurityGroupId field's value. +func (s *WorkspaceCreationProperties) SetCustomSecurityGroupId(v string) *WorkspaceCreationProperties { + s.CustomSecurityGroupId = &v + return s +} + +// SetDefaultOu sets the DefaultOu field's value. +func (s *WorkspaceCreationProperties) SetDefaultOu(v string) *WorkspaceCreationProperties { + s.DefaultOu = &v + return s +} + +// SetEnableInternetAccess sets the EnableInternetAccess field's value. +func (s *WorkspaceCreationProperties) SetEnableInternetAccess(v bool) *WorkspaceCreationProperties { + s.EnableInternetAccess = &v + return s +} + +// SetEnableMaintenanceMode sets the EnableMaintenanceMode field's value. +func (s *WorkspaceCreationProperties) SetEnableMaintenanceMode(v bool) *WorkspaceCreationProperties { + s.EnableMaintenanceMode = &v + return s +} + +// SetUserEnabledAsLocalAdministrator sets the UserEnabledAsLocalAdministrator field's value. +func (s *WorkspaceCreationProperties) SetUserEnabledAsLocalAdministrator(v bool) *WorkspaceCreationProperties { + s.UserEnabledAsLocalAdministrator = &v + return s +} + +// Describes a directory that is used with Amazon WorkSpaces. type WorkspaceDirectory struct { _ struct{} `type:"structure"` @@ -6926,7 +9019,7 @@ type WorkspaceDirectory struct { CustomerUserName *string `min:"1" type:"string"` // The directory identifier. - DirectoryId *string `type:"string"` + DirectoryId *string `min:"10" type:"string"` // The name of the directory. DirectoryName *string `type:"string"` @@ -6948,17 +9041,28 @@ type WorkspaceDirectory struct { // in their Amazon WorkSpaces client application to connect to the directory. RegistrationCode *string `min:"1" type:"string"` - // The state of the directory's registration with Amazon WorkSpaces + // The default self-service permissions for WorkSpaces in the directory. + SelfservicePermissions *SelfservicePermissions `type:"structure"` + + // The state of the directory's registration with Amazon WorkSpaces. State *string `type:"string" enum:"WorkspaceDirectoryState"` // The identifiers of the subnets used with the directory. SubnetIds []*string `type:"list"` + // Specifies whether the directory is dedicated or shared. To use Bring Your + // Own License (BYOL), this value must be set to DEDICATED. For more information, + // see Bring Your Own Windows Desktop Images (https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html). + Tenancy *string `type:"string" enum:"Tenancy"` + + // The devices and operating systems that users can use to access WorkSpaces. + WorkspaceAccessProperties *WorkspaceAccessProperties `type:"structure"` + // The default creation properties for all WorkSpaces in the directory. WorkspaceCreationProperties *DefaultWorkspaceCreationProperties `type:"structure"` // The identifier of the security group that is assigned to new WorkSpaces. - WorkspaceSecurityGroupId *string `type:"string"` + WorkspaceSecurityGroupId *string `min:"11" type:"string"` } // String returns the string representation @@ -7025,6 +9129,12 @@ func (s *WorkspaceDirectory) SetRegistrationCode(v string) *WorkspaceDirectory { return s } +// SetSelfservicePermissions sets the SelfservicePermissions field's value. +func (s *WorkspaceDirectory) SetSelfservicePermissions(v *SelfservicePermissions) *WorkspaceDirectory { + s.SelfservicePermissions = v + return s +} + // SetState sets the State field's value. func (s *WorkspaceDirectory) SetState(v string) *WorkspaceDirectory { s.State = &v @@ -7037,6 +9147,18 @@ func (s *WorkspaceDirectory) SetSubnetIds(v []*string) *WorkspaceDirectory { return s } +// SetTenancy sets the Tenancy field's value. +func (s *WorkspaceDirectory) SetTenancy(v string) *WorkspaceDirectory { + s.Tenancy = &v + return s +} + +// SetWorkspaceAccessProperties sets the WorkspaceAccessProperties field's value. +func (s *WorkspaceDirectory) SetWorkspaceAccessProperties(v *WorkspaceAccessProperties) *WorkspaceDirectory { + s.WorkspaceAccessProperties = v + return s +} + // SetWorkspaceCreationProperties sets the WorkspaceCreationProperties field's value. func (s *WorkspaceDirectory) SetWorkspaceCreationProperties(v *DefaultWorkspaceCreationProperties) *WorkspaceDirectory { s.WorkspaceCreationProperties = v @@ -7071,8 +9193,9 @@ type WorkspaceImage struct { // The operating system that the image is running. OperatingSystem *OperatingSystem `type:"structure"` - // Specifies whether the image is running on dedicated hardware. When bring - // your own license (BYOL) is enabled, this value is set to DEDICATED. + // Specifies whether the image is running on dedicated hardware. When Bring + // Your Own License (BYOL) is enabled, this value is set to DEDICATED. For more + // information, see Bring Your Own Windows Desktop Images (https://docs.aws.amazon.com/workspaces/latest/adminguide/byol-windows-images.html). RequiredTenancy *string `type:"string" enum:"WorkspaceImageRequiredTenancy"` // The status of the image. @@ -7152,7 +9275,7 @@ type WorkspaceProperties struct { RunningMode *string `type:"string" enum:"RunningMode"` // The time after a user logs off when WorkSpaces are automatically stopped. - // Configured in 60 minute intervals. + // Configured in 60-minute intervals. RunningModeAutoStopTimeoutInMinutes *int64 `type:"integer"` // The size of the user storage. @@ -7213,7 +9336,7 @@ type WorkspaceRequest struct { // You can use DescribeWorkspaceDirectories to list the available directories. // // DirectoryId is a required field - DirectoryId *string `type:"string" required:"true"` + DirectoryId *string `min:"10" type:"string" required:"true"` // Indicates whether the data stored on the root volume is encrypted. RootVolumeEncryptionEnabled *bool `type:"boolean"` @@ -7221,8 +9344,8 @@ type WorkspaceRequest struct { // The tags for the WorkSpace. Tags []*Tag `type:"list"` - // The username of the user for the WorkSpace. This username must exist in the - // AWS Directory Service directory for the WorkSpace. + // The user name of the user for the WorkSpace. This user name must exist in + // the AWS Directory Service directory for the WorkSpace. // // UserName is a required field UserName *string `min:"1" type:"string" required:"true"` @@ -7230,7 +9353,8 @@ type WorkspaceRequest struct { // Indicates whether the data stored on the user volume is encrypted. UserVolumeEncryptionEnabled *bool `type:"boolean"` - // The KMS key used to encrypt data stored on your WorkSpace. + // The symmetric AWS KMS customer master key (CMK) used to encrypt data stored + // on your WorkSpace. Amazon WorkSpaces does not support asymmetric CMKs. VolumeEncryptionKey *string `type:"string"` // The WorkSpace properties. @@ -7256,6 +9380,9 @@ func (s *WorkspaceRequest) Validate() error { if s.DirectoryId == nil { invalidParams.Add(request.NewErrParamRequired("DirectoryId")) } + if s.DirectoryId != nil && len(*s.DirectoryId) < 10 { + invalidParams.Add(request.NewErrParamMinLen("DirectoryId", 10)) + } if s.UserName == nil { invalidParams.Add(request.NewErrParamRequired("UserName")) } @@ -7327,6 +9454,73 @@ func (s *WorkspaceRequest) SetWorkspaceProperties(v *WorkspaceProperties) *Works return s } +// The workspaces_DefaultRole role could not be found. If this is the first +// time you are registering a directory, you will need to create the workspaces_DefaultRole +// role before you can register a directory. For more information, see Creating +// the workspaces_DefaultRole Role (https://docs.aws.amazon.com/workspaces/latest/adminguide/workspaces-access-control.html#create-default-role). +type WorkspacesDefaultRoleNotFoundException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"message" type:"string"` +} + +// String returns the string representation +func (s WorkspacesDefaultRoleNotFoundException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s WorkspacesDefaultRoleNotFoundException) GoString() string { + return s.String() +} + +func newErrorWorkspacesDefaultRoleNotFoundException(v protocol.ResponseMetadata) error { + return &WorkspacesDefaultRoleNotFoundException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s WorkspacesDefaultRoleNotFoundException) Code() string { + return "WorkspacesDefaultRoleNotFoundException" +} + +// Message returns the exception's message. +func (s WorkspacesDefaultRoleNotFoundException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s WorkspacesDefaultRoleNotFoundException) OrigErr() error { + return nil +} + +func (s WorkspacesDefaultRoleNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s WorkspacesDefaultRoleNotFoundException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s WorkspacesDefaultRoleNotFoundException) RequestID() string { + return s.respMetadata.RequestID +} + +const ( + // AccessPropertyValueAllow is a AccessPropertyValue enum value + AccessPropertyValueAllow = "ALLOW" + + // AccessPropertyValueDeny is a AccessPropertyValue enum value + AccessPropertyValueDeny = "DENY" +) + const ( // ComputeValue is a Compute enum value ComputeValue = "VALUE" @@ -7436,6 +9630,14 @@ const ( TargetWorkspaceStateAdminMaintenance = "ADMIN_MAINTENANCE" ) +const ( + // TenancyDedicated is a Tenancy enum value + TenancyDedicated = "DEDICATED" + + // TenancyShared is a Tenancy enum value + TenancyShared = "SHARED" +) + const ( // WorkspaceDirectoryStateRegistering is a WorkspaceDirectoryState enum value WorkspaceDirectoryStateRegistering = "REGISTERING" diff --git a/vendor/github.com/aws/aws-sdk-go/service/workspaces/errors.go b/vendor/github.com/aws/aws-sdk-go/service/workspaces/errors.go index ca1e70285ad..536f297ed8c 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/workspaces/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/workspaces/errors.go @@ -2,6 +2,10 @@ package workspaces +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeAccessDeniedException for service response error code @@ -71,10 +75,46 @@ const ( // The specified resource is not available. ErrCodeResourceUnavailableException = "ResourceUnavailableException" + // ErrCodeUnsupportedNetworkConfigurationException for service response error code + // "UnsupportedNetworkConfigurationException". + // + // The configuration of this network is not supported for this operation, or + // your network configuration conflicts with the Amazon WorkSpaces management + // network IP range. For more information, see Configure a VPC for Amazon WorkSpaces + // (https://docs.aws.amazon.com/workspaces/latest/adminguide/amazon-workspaces-vpc.html). + ErrCodeUnsupportedNetworkConfigurationException = "UnsupportedNetworkConfigurationException" + // ErrCodeUnsupportedWorkspaceConfigurationException for service response error code // "UnsupportedWorkspaceConfigurationException". // // The configuration of this WorkSpace is not supported for this operation. - // For more information, see the Amazon WorkSpaces Administration Guide (https://docs.aws.amazon.com/workspaces/latest/adminguide/). + // For more information, see Required Configuration and Service Components for + // WorkSpaces (https://docs.aws.amazon.com/workspaces/latest/adminguide/required-service-components.html). ErrCodeUnsupportedWorkspaceConfigurationException = "UnsupportedWorkspaceConfigurationException" + + // ErrCodeWorkspacesDefaultRoleNotFoundException for service response error code + // "WorkspacesDefaultRoleNotFoundException". + // + // The workspaces_DefaultRole role could not be found. If this is the first + // time you are registering a directory, you will need to create the workspaces_DefaultRole + // role before you can register a directory. For more information, see Creating + // the workspaces_DefaultRole Role (https://docs.aws.amazon.com/workspaces/latest/adminguide/workspaces-access-control.html#create-default-role). + ErrCodeWorkspacesDefaultRoleNotFoundException = "WorkspacesDefaultRoleNotFoundException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "AccessDeniedException": newErrorAccessDeniedException, + "InvalidParameterValuesException": newErrorInvalidParameterValuesException, + "InvalidResourceStateException": newErrorInvalidResourceStateException, + "OperationInProgressException": newErrorOperationInProgressException, + "OperationNotSupportedException": newErrorOperationNotSupportedException, + "ResourceAlreadyExistsException": newErrorResourceAlreadyExistsException, + "ResourceAssociatedException": newErrorResourceAssociatedException, + "ResourceCreationFailedException": newErrorResourceCreationFailedException, + "ResourceLimitExceededException": newErrorResourceLimitExceededException, + "ResourceNotFoundException": newErrorResourceNotFoundException, + "ResourceUnavailableException": newErrorResourceUnavailableException, + "UnsupportedNetworkConfigurationException": newErrorUnsupportedNetworkConfigurationException, + "UnsupportedWorkspaceConfigurationException": newErrorUnsupportedWorkspaceConfigurationException, + "WorkspacesDefaultRoleNotFoundException": newErrorWorkspacesDefaultRoleNotFoundException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/workspaces/service.go b/vendor/github.com/aws/aws-sdk-go/service/workspaces/service.go index 38e1cc2ee1f..e9700bd8865 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/workspaces/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/workspaces/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "workspaces" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "WorkSpaces" // ServiceID is a unique identifer of a specific service. + ServiceID = "WorkSpaces" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the WorkSpaces client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a WorkSpaces client from just a session. // svc := workspaces.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := workspaces.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *WorkSpaces { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *WorkSpaces { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *WorkSpaces { svc := &WorkSpaces{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2015-04-08", JSONVersion: "1.1", @@ -73,7 +77,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(jsonrpc.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/aws/aws-sdk-go/service/xray/api.go b/vendor/github.com/aws/aws-sdk-go/service/xray/api.go index 7bfd327681a..cdd6fd1f926 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/xray/api.go +++ b/vendor/github.com/aws/aws-sdk-go/service/xray/api.go @@ -74,11 +74,11 @@ func (c *XRay) BatchGetTracesRequest(input *BatchGetTracesInput) (req *request.R // See the AWS API reference guide for AWS X-Ray's // API operation BatchGetTraces for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/BatchGetTraces @@ -146,10 +146,12 @@ func (c *XRay) BatchGetTracesPagesWithContext(ctx aws.Context, input *BatchGetTr }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*BatchGetTracesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*BatchGetTracesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -206,11 +208,11 @@ func (c *XRay) CreateGroupRequest(input *CreateGroupInput) (req *request.Request // See the AWS API reference guide for AWS X-Ray's // API operation CreateGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/CreateGroup @@ -294,14 +296,14 @@ func (c *XRay) CreateSamplingRuleRequest(input *CreateSamplingRuleInput) (req *r // See the AWS API reference guide for AWS X-Ray's // API operation CreateSamplingRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // -// * ErrCodeRuleLimitExceededException "RuleLimitExceededException" +// * RuleLimitExceededException // You have reached the maximum number of sampling rules. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/CreateSamplingRule @@ -380,11 +382,11 @@ func (c *XRay) DeleteGroupRequest(input *DeleteGroupInput) (req *request.Request // See the AWS API reference guide for AWS X-Ray's // API operation DeleteGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/DeleteGroup @@ -462,11 +464,11 @@ func (c *XRay) DeleteSamplingRuleRequest(input *DeleteSamplingRuleInput) (req *r // See the AWS API reference guide for AWS X-Ray's // API operation DeleteSamplingRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/DeleteSamplingRule @@ -544,11 +546,11 @@ func (c *XRay) GetEncryptionConfigRequest(input *GetEncryptionConfigInput) (req // See the AWS API reference guide for AWS X-Ray's // API operation GetEncryptionConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetEncryptionConfig @@ -626,11 +628,11 @@ func (c *XRay) GetGroupRequest(input *GetGroupInput) (req *request.Request, outp // See the AWS API reference guide for AWS X-Ray's // API operation GetGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetGroup @@ -714,11 +716,11 @@ func (c *XRay) GetGroupsRequest(input *GetGroupsInput) (req *request.Request, ou // See the AWS API reference guide for AWS X-Ray's // API operation GetGroups for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetGroups @@ -786,10 +788,12 @@ func (c *XRay) GetGroupsPagesWithContext(ctx aws.Context, input *GetGroupsInput, }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetGroupsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetGroupsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -852,11 +856,11 @@ func (c *XRay) GetSamplingRulesRequest(input *GetSamplingRulesInput) (req *reque // See the AWS API reference guide for AWS X-Ray's // API operation GetSamplingRules for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetSamplingRules @@ -924,10 +928,12 @@ func (c *XRay) GetSamplingRulesPagesWithContext(ctx aws.Context, input *GetSampl }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetSamplingRulesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetSamplingRulesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -990,11 +996,11 @@ func (c *XRay) GetSamplingStatisticSummariesRequest(input *GetSamplingStatisticS // See the AWS API reference guide for AWS X-Ray's // API operation GetSamplingStatisticSummaries for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetSamplingStatisticSummaries @@ -1062,10 +1068,12 @@ func (c *XRay) GetSamplingStatisticSummariesPagesWithContext(ctx aws.Context, in }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetSamplingStatisticSummariesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetSamplingStatisticSummariesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1122,11 +1130,11 @@ func (c *XRay) GetSamplingTargetsRequest(input *GetSamplingTargetsInput) (req *r // See the AWS API reference guide for AWS X-Ray's // API operation GetSamplingTargets for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetSamplingTargets @@ -1204,8 +1212,9 @@ func (c *XRay) GetServiceGraphRequest(input *GetServiceGraphInput) (req *request // Retrieves a document that describes services that process incoming requests, // and downstream services that they call as a result. Root services process // incoming requests and make calls to downstream services. Root services are -// applications that use the AWS X-Ray SDK. Downstream services can be other -// applications, AWS resources, HTTP web APIs, or SQL databases. +// applications that use the AWS X-Ray SDK (https://docs.aws.amazon.com/xray/index.html). +// Downstream services can be other applications, AWS resources, HTTP web APIs, +// or SQL databases. // // Returns awserr.Error for service API and SDK errors. Use runtime type assertions // with awserr.Error's Code and Message methods to get detailed information about @@ -1214,11 +1223,11 @@ func (c *XRay) GetServiceGraphRequest(input *GetServiceGraphInput) (req *request // See the AWS API reference guide for AWS X-Ray's // API operation GetServiceGraph for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetServiceGraph @@ -1286,10 +1295,12 @@ func (c *XRay) GetServiceGraphPagesWithContext(ctx aws.Context, input *GetServic }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetServiceGraphOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetServiceGraphOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1352,11 +1363,11 @@ func (c *XRay) GetTimeSeriesServiceStatisticsRequest(input *GetTimeSeriesService // See the AWS API reference guide for AWS X-Ray's // API operation GetTimeSeriesServiceStatistics for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTimeSeriesServiceStatistics @@ -1424,10 +1435,12 @@ func (c *XRay) GetTimeSeriesServiceStatisticsPagesWithContext(ctx aws.Context, i }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTimeSeriesServiceStatisticsOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetTimeSeriesServiceStatisticsOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1490,11 +1503,11 @@ func (c *XRay) GetTraceGraphRequest(input *GetTraceGraphInput) (req *request.Req // See the AWS API reference guide for AWS X-Ray's // API operation GetTraceGraph for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceGraph @@ -1562,10 +1575,12 @@ func (c *XRay) GetTraceGraphPagesWithContext(ctx aws.Context, input *GetTraceGra }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTraceGraphOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetTraceGraphOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1619,7 +1634,7 @@ func (c *XRay) GetTraceSummariesRequest(input *GetTraceSummariesInput) (req *req // GetTraceSummaries API operation for AWS X-Ray. // -// Retrieves IDs and metadata for traces available for a specified time frame +// Retrieves IDs and annotations for traces available for a specified time frame // using an optional filter. To get the full traces, pass the trace IDs to BatchGetTraces. // // A filter expression can target traced requests that hit specific service @@ -1644,11 +1659,11 @@ func (c *XRay) GetTraceSummariesRequest(input *GetTraceSummariesInput) (req *req // See the AWS API reference guide for AWS X-Ray's // API operation GetTraceSummaries for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/GetTraceSummaries @@ -1716,10 +1731,12 @@ func (c *XRay) GetTraceSummariesPagesWithContext(ctx aws.Context, input *GetTrac }, } - cont := true - for p.Next() && cont { - cont = fn(p.Page().(*GetTraceSummariesOutput), !p.HasNextPage()) + for p.Next() { + if !fn(p.Page().(*GetTraceSummariesOutput), !p.HasNextPage()) { + break + } } + return p.Err() } @@ -1776,11 +1793,11 @@ func (c *XRay) PutEncryptionConfigRequest(input *PutEncryptionConfigInput) (req // See the AWS API reference guide for AWS X-Ray's // API operation PutEncryptionConfig for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutEncryptionConfig @@ -1859,11 +1876,11 @@ func (c *XRay) PutTelemetryRecordsRequest(input *PutTelemetryRecordsInput) (req // See the AWS API reference guide for AWS X-Ray's // API operation PutTelemetryRecords for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTelemetryRecords @@ -1932,10 +1949,10 @@ func (c *XRay) PutTraceSegmentsRequest(input *PutTraceSegmentsInput) (req *reque // PutTraceSegments API operation for AWS X-Ray. // -// Uploads segment documents to AWS X-Ray. The X-Ray SDK generates segment documents -// and sends them to the X-Ray daemon, which uploads them in batches. A segment -// document can be a completed segment, an in-progress segment, or an array -// of subsegments. +// Uploads segment documents to AWS X-Ray. The X-Ray SDK (https://docs.aws.amazon.com/xray/index.html) +// generates segment documents and sends them to the X-Ray daemon, which uploads +// them in batches. A segment document can be a completed segment, an in-progress +// segment, or an array of subsegments. // // Segments must include the following fields. For the full segment document // schema, see AWS X-Ray Segment Documents (https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html) @@ -1986,11 +2003,11 @@ func (c *XRay) PutTraceSegmentsRequest(input *PutTraceSegmentsInput) (req *reque // See the AWS API reference guide for AWS X-Ray's // API operation PutTraceSegments for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/PutTraceSegments @@ -2068,11 +2085,11 @@ func (c *XRay) UpdateGroupRequest(input *UpdateGroupInput) (req *request.Request // See the AWS API reference guide for AWS X-Ray's // API operation UpdateGroup for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/UpdateGroup @@ -2150,11 +2167,11 @@ func (c *XRay) UpdateSamplingRuleRequest(input *UpdateSamplingRuleInput) (req *r // See the AWS API reference guide for AWS X-Ray's // API operation UpdateSamplingRule for usage and error information. // -// Returned Error Codes: -// * ErrCodeInvalidRequestException "InvalidRequestException" +// Returned Error Types: +// * InvalidRequestException // The request is missing required parameters or has invalid parameters. // -// * ErrCodeThrottledException "ThrottledException" +// * ThrottledException // The request exceeds the maximum number of requests per second. // // See also, https://docs.aws.amazon.com/goto/WebAPI/xray-2016-04-12/UpdateSamplingRule @@ -2353,7 +2370,7 @@ func (s *BackendConnectionErrors) SetUnknownHostCount(v int64) *BackendConnectio type BatchGetTracesInput struct { _ struct{} `type:"structure"` - // Pagination token. Not used. + // Pagination token. NextToken *string `type:"string"` // Specify the trace IDs of requests for which to retrieve segments. @@ -2400,7 +2417,7 @@ func (s *BatchGetTracesInput) SetTraceIds(v []*string) *BatchGetTracesInput { type BatchGetTracesOutput struct { _ struct{} `type:"structure"` - // Pagination token. Not used. + // Pagination token. NextToken *string `type:"string"` // Full traces for the specified requests. @@ -3335,7 +3352,7 @@ func (s *GetGroupOutput) SetGroup(v *Group) *GetGroupOutput { type GetGroupsInput struct { _ struct{} `type:"structure"` - // Pagination token. Not used. + // Pagination token. NextToken *string `min:"1" type:"string"` } @@ -3374,7 +3391,7 @@ type GetGroupsOutput struct { // The collection of all active groups. Groups []*GroupSummary `type:"list"` - // Pagination token. Not used. + // Pagination token. NextToken *string `type:"string"` } @@ -3403,7 +3420,7 @@ func (s *GetGroupsOutput) SetNextToken(v string) *GetGroupsOutput { type GetSamplingRulesInput struct { _ struct{} `type:"structure"` - // Pagination token. Not used. + // Pagination token. NextToken *string `type:"string"` } @@ -3426,7 +3443,7 @@ func (s *GetSamplingRulesInput) SetNextToken(v string) *GetSamplingRulesInput { type GetSamplingRulesOutput struct { _ struct{} `type:"structure"` - // Pagination token. Not used. + // Pagination token. NextToken *string `type:"string"` // Rule definitions and metadata. @@ -3458,7 +3475,7 @@ func (s *GetSamplingRulesOutput) SetSamplingRuleRecords(v []*SamplingRuleRecord) type GetSamplingStatisticSummariesInput struct { _ struct{} `type:"structure"` - // Pagination token. Not used. + // Pagination token. NextToken *string `type:"string"` } @@ -3481,7 +3498,7 @@ func (s *GetSamplingStatisticSummariesInput) SetNextToken(v string) *GetSampling type GetSamplingStatisticSummariesOutput struct { _ struct{} `type:"structure"` - // Pagination token. Not used. + // Pagination token. NextToken *string `type:"string"` // Information about the number of requests instrumented for each sampling rule. @@ -3615,7 +3632,7 @@ type GetServiceGraphInput struct { // The name of a group to generate a graph based on. GroupName *string `min:"1" type:"string"` - // Pagination token. Not used. + // Pagination token. NextToken *string `type:"string"` // The start of the time frame for which to generate a graph. @@ -3697,7 +3714,7 @@ type GetServiceGraphOutput struct { // The end of the time frame for which the graph was generated. EndTime *time.Time `type:"timestamp"` - // Pagination token. Not used. + // Pagination token. NextToken *string `type:"string"` // The services that have processed a traced request during the specified time @@ -3767,7 +3784,7 @@ type GetTimeSeriesServiceStatisticsInput struct { // The case-sensitive name of the group for which to pull statistics from. GroupName *string `min:"1" type:"string"` - // Pagination token. Not used. + // Pagination token. NextToken *string `type:"string"` // Aggregation period in seconds. @@ -3864,7 +3881,7 @@ type GetTimeSeriesServiceStatisticsOutput struct { // the group's filter expression. ContainsOldGroupVersions *bool `type:"boolean"` - // Pagination token. Not used. + // Pagination token. NextToken *string `type:"string"` // The collection of statistics. @@ -3902,7 +3919,7 @@ func (s *GetTimeSeriesServiceStatisticsOutput) SetTimeSeriesServiceStatistics(v type GetTraceGraphInput struct { _ struct{} `type:"structure"` - // Pagination token. Not used. + // Pagination token. NextToken *string `type:"string"` // Trace IDs of requests for which to generate a service graph. @@ -3949,7 +3966,7 @@ func (s *GetTraceGraphInput) SetTraceIds(v []*string) *GetTraceGraphInput { type GetTraceGraphOutput struct { _ struct{} `type:"structure"` - // Pagination token. Not used. + // Pagination token. NextToken *string `type:"string"` // The services that have processed one of the specified requests. @@ -4090,7 +4107,8 @@ type GetTraceSummariesOutput struct { // most most recent results, closest to the end of the time frame. NextToken *string `type:"string"` - // Trace IDs and metadata for traces that were found in the specified time frame. + // Trace IDs and annotations for traces that were found in the specified time + // frame. TraceSummaries []*TraceSummary `type:"list"` // The total number of traces processed, including traces that did not match @@ -4334,6 +4352,62 @@ func (s *InstanceIdDetail) SetId(v string) *InstanceIdDetail { return s } +// The request is missing required parameters or has invalid parameters. +type InvalidRequestException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s InvalidRequestException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s InvalidRequestException) GoString() string { + return s.String() +} + +func newErrorInvalidRequestException(v protocol.ResponseMetadata) error { + return &InvalidRequestException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s InvalidRequestException) Code() string { + return "InvalidRequestException" +} + +// Message returns the exception's message. +func (s InvalidRequestException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s InvalidRequestException) OrigErr() error { + return nil +} + +func (s InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s InvalidRequestException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s InvalidRequestException) RequestID() string { + return s.respMetadata.RequestID +} + type PutEncryptionConfigInput struct { _ struct{} `type:"structure"` @@ -4342,6 +4416,7 @@ type PutEncryptionConfigInput struct { // * Alias - The name of the key. For example, alias/MyKey. // // * Key ID - The KMS key ID of the key. For example, ae4aa6d49-a4d8-9df9-a475-4ff6d7898456. + // AWS X-Ray does not support asymmetric CMKs. // // * ARN - The full Amazon Resource Name of the key ID or alias. For example, // arn:aws:kms:us-east-2:123456789012:key/ae4aa6d49-a4d8-9df9-a475-4ff6d7898456. @@ -4757,6 +4832,62 @@ func (s *RootCauseException) SetName(v string) *RootCauseException { return s } +// You have reached the maximum number of sampling rules. +type RuleLimitExceededException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s RuleLimitExceededException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s RuleLimitExceededException) GoString() string { + return s.String() +} + +func newErrorRuleLimitExceededException(v protocol.ResponseMetadata) error { + return &RuleLimitExceededException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s RuleLimitExceededException) Code() string { + return "RuleLimitExceededException" +} + +// Message returns the exception's message. +func (s RuleLimitExceededException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s RuleLimitExceededException) OrigErr() error { + return nil +} + +func (s RuleLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s RuleLimitExceededException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s RuleLimitExceededException) RequestID() string { + return s.respMetadata.RequestID +} + // A sampling rule that services use to decide whether to instrument a request. // Rule fields can match properties of the service, or properties of a request. // The service can ignore rules that don't match its properties. @@ -5785,6 +5916,62 @@ func (s *TelemetryRecord) SetTimestamp(v time.Time) *TelemetryRecord { return s } +// The request exceeds the maximum number of requests per second. +type ThrottledException struct { + _ struct{} `type:"structure"` + respMetadata protocol.ResponseMetadata + + Message_ *string `locationName:"Message" type:"string"` +} + +// String returns the string representation +func (s ThrottledException) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s ThrottledException) GoString() string { + return s.String() +} + +func newErrorThrottledException(v protocol.ResponseMetadata) error { + return &ThrottledException{ + respMetadata: v, + } +} + +// Code returns the exception type name. +func (s ThrottledException) Code() string { + return "ThrottledException" +} + +// Message returns the exception's message. +func (s ThrottledException) Message() string { + if s.Message_ != nil { + return *s.Message_ + } + return "" +} + +// OrigErr always returns nil, satisfies awserr.Error interface. +func (s ThrottledException) OrigErr() error { + return nil +} + +func (s ThrottledException) Error() string { + return fmt.Sprintf("%s: %s", s.Code(), s.Message()) +} + +// Status code returns the HTTP status code for the request's response error. +func (s ThrottledException) StatusCode() int { + return s.respMetadata.StatusCode +} + +// RequestID returns the service's response RequestID for request. +func (s ThrottledException) RequestID() string { + return s.respMetadata.RequestID +} + // A list of TimeSeriesStatistic structures. type TimeSeriesServiceStatistics struct { _ struct{} `type:"structure"` @@ -5904,10 +6091,10 @@ type TraceSummary struct { // segments. FaultRootCauses []*FaultRootCause `type:"list"` - // One or more of the segment documents has a 400 series error. + // The root segment document has a 400 series error. HasError *bool `type:"boolean"` - // One or more of the segment documents has a 500 series error. + // The root segment document has a 500 series error. HasFault *bool `type:"boolean"` // One or more of the segment documents has a 429 throttling error. diff --git a/vendor/github.com/aws/aws-sdk-go/service/xray/errors.go b/vendor/github.com/aws/aws-sdk-go/service/xray/errors.go index 7888dd20464..459870ffc23 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/xray/errors.go +++ b/vendor/github.com/aws/aws-sdk-go/service/xray/errors.go @@ -2,6 +2,10 @@ package xray +import ( + "github.com/aws/aws-sdk-go/private/protocol" +) + const ( // ErrCodeInvalidRequestException for service response error code @@ -22,3 +26,9 @@ const ( // The request exceeds the maximum number of requests per second. ErrCodeThrottledException = "ThrottledException" ) + +var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ + "InvalidRequestException": newErrorInvalidRequestException, + "RuleLimitExceededException": newErrorRuleLimitExceededException, + "ThrottledException": newErrorThrottledException, +} diff --git a/vendor/github.com/aws/aws-sdk-go/service/xray/service.go b/vendor/github.com/aws/aws-sdk-go/service/xray/service.go index fdc5ea32958..134114cdfb7 100644 --- a/vendor/github.com/aws/aws-sdk-go/service/xray/service.go +++ b/vendor/github.com/aws/aws-sdk-go/service/xray/service.go @@ -8,6 +8,7 @@ import ( "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" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) @@ -31,7 +32,7 @@ var initRequest func(*request.Request) const ( ServiceName = "xray" // Name of service. EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "XRay" // ServiceID is a unique identifer of a specific service. + ServiceID = "XRay" // ServiceID is a unique identifier of a specific service. ) // New creates a new instance of the XRay client with a session. @@ -39,6 +40,8 @@ const ( // aws.Config parameter to add your extra config. // // Example: +// mySession := session.Must(session.NewSession()) +// // // Create a XRay client from just a session. // svc := xray.New(mySession) // @@ -46,11 +49,11 @@ const ( // svc := xray.New(mySession, aws.NewConfig().WithRegion("us-west-2")) func New(p client.ConfigProvider, cfgs ...*aws.Config) *XRay { c := p.ClientConfig(EndpointsID, cfgs...) - return newClient(*c.Config, c.Handlers, c.Endpoint, c.SigningRegion, c.SigningName) + return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName) } // newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegion, signingName string) *XRay { +func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName string) *XRay { svc := &XRay{ Client: client.New( cfg, @@ -59,6 +62,7 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio ServiceID: ServiceID, SigningName: signingName, SigningRegion: signingRegion, + PartitionID: partitionID, Endpoint: endpoint, APIVersion: "2016-04-12", }, @@ -71,7 +75,9 @@ func newClient(cfg aws.Config, handlers request.Handlers, endpoint, signingRegio svc.Handlers.Build.PushBackNamed(restjson.BuildHandler) svc.Handlers.Unmarshal.PushBackNamed(restjson.UnmarshalHandler) svc.Handlers.UnmarshalMeta.PushBackNamed(restjson.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restjson.UnmarshalErrorHandler) + svc.Handlers.UnmarshalError.PushBackNamed( + protocol.NewUnmarshalErrorHandler(restjson.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), + ) // Run custom client initialization if present if initClient != nil { diff --git a/vendor/github.com/terraform-providers/terraform-provider-tls/LICENSE b/vendor/github.com/bflad/gopaniccheck/LICENSE similarity index 100% rename from vendor/github.com/terraform-providers/terraform-provider-tls/LICENSE rename to vendor/github.com/bflad/gopaniccheck/LICENSE diff --git a/vendor/github.com/bflad/gopaniccheck/passes/logpaniccallexpr/analyzer.go b/vendor/github.com/bflad/gopaniccheck/passes/logpaniccallexpr/analyzer.go new file mode 100644 index 00000000000..3758396c929 --- /dev/null +++ b/vendor/github.com/bflad/gopaniccheck/passes/logpaniccallexpr/analyzer.go @@ -0,0 +1,55 @@ +package logpaniccallexpr + +import ( + "go/ast" + "go/types" + "reflect" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +var Analyzer = &analysis.Analyzer{ + Name: "logpaniccallexpr", + Doc: "find log.Panic() *ast.CallExpr for later passes", + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*ast.CallExpr{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.CallExpr)(nil), + } + var result []*ast.CallExpr + + inspect.Preorder(nodeFilter, func(n ast.Node) { + callExpr := n.(*ast.CallExpr) + + switch fun := callExpr.Fun.(type) { + case *ast.SelectorExpr: + if fun.Sel.Name != "Panic" { + return + } + + switch x := fun.X.(type) { + case *ast.Ident: + if pass.TypesInfo.ObjectOf(x).(*types.PkgName).Imported().Path() != "log" { + return + } + default: + return + } + default: + return + } + + result = append(result, callExpr) + }) + + return result, nil +} diff --git a/vendor/github.com/bflad/gopaniccheck/passes/logpanicfcallexpr/analyzer.go b/vendor/github.com/bflad/gopaniccheck/passes/logpanicfcallexpr/analyzer.go new file mode 100644 index 00000000000..8ef89417cd5 --- /dev/null +++ b/vendor/github.com/bflad/gopaniccheck/passes/logpanicfcallexpr/analyzer.go @@ -0,0 +1,55 @@ +package logpanicfcallexpr + +import ( + "go/ast" + "go/types" + "reflect" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +var Analyzer = &analysis.Analyzer{ + Name: "logpanicfcallexpr", + Doc: "find log.Panicf() *ast.CallExpr for later passes", + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*ast.CallExpr{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.CallExpr)(nil), + } + var result []*ast.CallExpr + + inspect.Preorder(nodeFilter, func(n ast.Node) { + callExpr := n.(*ast.CallExpr) + + switch fun := callExpr.Fun.(type) { + case *ast.SelectorExpr: + if fun.Sel.Name != "Panicf" { + return + } + + switch x := fun.X.(type) { + case *ast.Ident: + if pass.TypesInfo.ObjectOf(x).(*types.PkgName).Imported().Path() != "log" { + return + } + default: + return + } + default: + return + } + + result = append(result, callExpr) + }) + + return result, nil +} diff --git a/vendor/github.com/bflad/gopaniccheck/passes/logpaniclncallexpr/analyzer.go b/vendor/github.com/bflad/gopaniccheck/passes/logpaniclncallexpr/analyzer.go new file mode 100644 index 00000000000..9f1f12cd798 --- /dev/null +++ b/vendor/github.com/bflad/gopaniccheck/passes/logpaniclncallexpr/analyzer.go @@ -0,0 +1,55 @@ +package logpaniclncallexpr + +import ( + "go/ast" + "go/types" + "reflect" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +var Analyzer = &analysis.Analyzer{ + Name: "logpaniclncallexpr", + Doc: "find log.Panicln() *ast.CallExpr for later passes", + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*ast.CallExpr{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.CallExpr)(nil), + } + var result []*ast.CallExpr + + inspect.Preorder(nodeFilter, func(n ast.Node) { + callExpr := n.(*ast.CallExpr) + + switch fun := callExpr.Fun.(type) { + case *ast.SelectorExpr: + if fun.Sel.Name != "Panicln" { + return + } + + switch x := fun.X.(type) { + case *ast.Ident: + if pass.TypesInfo.ObjectOf(x).(*types.PkgName).Imported().Path() != "log" { + return + } + default: + return + } + default: + return + } + + result = append(result, callExpr) + }) + + return result, nil +} diff --git a/vendor/github.com/bflad/gopaniccheck/passes/paniccallexpr/analyzer.go b/vendor/github.com/bflad/gopaniccheck/passes/paniccallexpr/analyzer.go new file mode 100644 index 00000000000..32870dd99aa --- /dev/null +++ b/vendor/github.com/bflad/gopaniccheck/passes/paniccallexpr/analyzer.go @@ -0,0 +1,45 @@ +package paniccallexpr + +import ( + "go/ast" + "reflect" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +var Analyzer = &analysis.Analyzer{ + Name: "paniccallexpr", + Doc: "find panic() *ast.CallExpr for later passes", + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*ast.CallExpr{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.CallExpr)(nil), + } + var result []*ast.CallExpr + + inspect.Preorder(nodeFilter, func(n ast.Node) { + callExpr := n.(*ast.CallExpr) + + switch fun := callExpr.Fun.(type) { + case *ast.Ident: + if fun.Name != "panic" { + return + } + default: + return + } + + result = append(result, callExpr) + }) + + return result, nil +} diff --git a/vendor/github.com/bflad/tfproviderdocs/.gitignore b/vendor/github.com/bflad/tfproviderdocs/.gitignore new file mode 100644 index 00000000000..560afc14739 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/.gitignore @@ -0,0 +1,5 @@ +*~ +.*.swp +.idea/ +.vscode/ +dist/ diff --git a/vendor/github.com/bflad/tfproviderdocs/.goreleaser.yml b/vendor/github.com/bflad/tfproviderdocs/.goreleaser.yml new file mode 100644 index 00000000000..dccedaf10c3 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/.goreleaser.yml @@ -0,0 +1,51 @@ +archives: +- + format_overrides: + - goos: windows + format: zip +before: + hooks: + - go mod download +brews: +- + dependencies: + - go + description: Terraform Provider Documentation Tool + folder: Formula + github: + owner: bflad + name: homebrew-tap + homepage: https://github.com/bflad/tfproviderdocs + install: | + bin.install "tfproviderdocs" + test: | + system "#{bin}/tfproviderdocs -v" +builds: +- + env: + - CGO_ENABLED=0 + goos: + - darwin + - windows + - linux + goarch: + - amd64 + - 386 + ldflags: + - -s -w -X github.com/bflad/tfproviderdocs/version.Version={{.Version}} -X github.com/bflad/tfproviderdocs/version.VersionPrerelease= + main: . +changelog: + skip: true +dockers: +- + build_flag_templates: + - "--label=org.label-schema.schema-version=1.0" + - "--label=org.label-schema.version={{.Version}}" + - "--label=org.label-schema.name={{.ProjectName}}" + image_templates: + - 'bflad/tfproviderdocs:{{ .Version }}' + - 'bflad/tfproviderdocs:{{ .Major }}.{{ .Minor }}' + - 'bflad/tfproviderdocs:latest' +signs: +- + artifacts: checksum diff --git a/vendor/github.com/bflad/tfproviderdocs/CHANGELOG.md b/vendor/github.com/bflad/tfproviderdocs/CHANGELOG.md new file mode 100644 index 00000000000..9837e0408d9 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/CHANGELOG.md @@ -0,0 +1,51 @@ +# v0.5.0 + +ENHANCEMENTS + +* check: Verify sidebar navigation for missing links and mismatched link text (if legacy directory structure) + +# v0.4.1 + +BUG FIXES + +* check: Only verify valid file extensions at end of path (e.g. support additional periods in guide paths) (#25) + +# v0.4.0 + +ENHANCEMENTS + +* check: Accept newline-separated files of allowed subcategories with `-allowed-guide-subcategories-file` and `-allowed-resource-subcategories-file` flags +* check: Improve readability with allowed subcategories values in allowed subcategories frontmatter error + +# v0.3.0 + +ENHANCEMENTS + +* check: Verify deprecated `sidebar_current` frontmatter is not present + +# v0.2.0 + +ENHANCEMENTS + +* check: Verify number of documentation files for Terraform Registry storage limits +* check: Verify size of documentation files for Terraform Registry storage limits +* check: Verify all known data sources and resources have an associated documentation file (if `-providers-schema-json` is provided) +* check: Verify no extraneous or incorrectly named documentation files exist (if `-providers-schema-json` is provided) + +# v0.1.2 + +BUG FIXES + +* Remove extraneous `-''` from version information + +# v0.1.1 + +BUG FIXES + +* Fix help formatting of `check` command options + +# v0.1.0 + +FEATURES + +* Initial release with `check` command diff --git a/vendor/github.com/bflad/tfproviderdocs/Dockerfile b/vendor/github.com/bflad/tfproviderdocs/Dockerfile new file mode 100644 index 00000000000..81abcf28535 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/Dockerfile @@ -0,0 +1,4 @@ +FROM golang:1.13-stretch +WORKDIR /src +COPY tfproviderdocs /usr/bin/tfproviderdocs +ENTRYPOINT ["/usr/bin/tfproviderdocs"] diff --git a/vendor/github.com/bflad/tfproviderdocs/LICENSE b/vendor/github.com/bflad/tfproviderdocs/LICENSE new file mode 100644 index 00000000000..a612ad9813b --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/LICENSE @@ -0,0 +1,373 @@ +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/bflad/tfproviderdocs/README.md b/vendor/github.com/bflad/tfproviderdocs/README.md new file mode 100644 index 00000000000..f2c38394d5c --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/README.md @@ -0,0 +1,98 @@ +# tfproviderdocs + +A documentation tool for [Terraform Provider](https://www.terraform.io/docs/providers/index.html) code. + +## Install + +### Local Install + +Release binaries are available in the [Releases](https://github.com/bflad/tfproviderdocs/releases) section. + +To instead use Go to install into your `$GOBIN` directory (e.g. `$GOPATH/bin`): + +```console +$ go get github.com/bflad/tfproviderdocs +``` + +### Docker Install + +```console +$ docker pull bflad/tfproviderdocs +``` + +### Homebrew Install + +```console +$ brew install bflad/tap/tfproviderdocs +``` + +## Usage + +Additional information about usage and configuration options can be found by passing the `help` argument: + +```console +$ tfproviderdocs help +``` + +### Local Usage + +Change into the directory of the Terraform Provider code and run: + +```console +$ tfproviderdocs +``` + +### Docker Usage + +Change into the directory of the Terraform Provider code and run: + +```console +$ docker run -v $(pwd):/src bflad/tfproviderdocs +``` + +## Available Commands + +### check Command + +The `tfproviderdocs check` command verifies the Terraform Provider documentation against the [specifications from Terraform Registry documentation](https://www.terraform.io/docs/registry/providers/docs.html) and common practices across official Terraform Providers. This includes the following checks: + +- Verifies that no invalid directories are found in the documentation directory structure. +- Ensures that there is not a mix (legacy and Terraform Registry) of directory structures, which is not supported during Terraform Registry documentation ingress. +- Verifies number of documentation files is below Terraform Registry storage limits. +- Verifies all known data sources and resources have an associated documentation file (if `-providers-schema-json` is provided) +- Verifies no extraneous or incorrectly named documentation files exist (if `-providers-schema-json` is provided) +- Verifies each file in the documentation directories is valid. + +The validity of files is checked with the following rules: + +- Proper file extensions are used (e.g. `.md` for Terraform Registry). +- Verifies size of file is below Terraform Registry storage limits. +- YAML frontmatter can be parsed and matches expectations. + +The YAML frontmatter checks include some defaults (e.g. no `layout` field for Terraform Registry), but there are some useful flags that can be passed to the command to tune the behavior, especially for larger Terraform Providers. + +For additional information about check flags, you can run `tfproviderdocs check -help`. + +## Development and Testing + +This project uses [Go Modules](https://github.com/golang/go/wiki/Modules) for dependency management. + +### Updating Dependencies + +```console +$ go get URL +$ go mod tidy +$ go mod vendor +``` + +### Unit Testing + +```console +$ go test ./... +``` + +### Local Install Testing + +```console +$ go install . +``` diff --git a/vendor/github.com/bflad/tfproviderdocs/check/check.go b/vendor/github.com/bflad/tfproviderdocs/check/check.go new file mode 100644 index 00000000000..fabca3661d3 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/check.go @@ -0,0 +1,164 @@ +package check + +import ( + "sort" + + "github.com/hashicorp/go-multierror" + tfjson "github.com/hashicorp/terraform-json" +) + +const ( + ResourceTypeDataSource = "data source" + ResourceTypeResource = "resource" + + // Terraform Registry Storage Limits + // https://www.terraform.io/docs/registry/providers/docs.html#storage-limits + RegistryMaximumNumberOfFiles = 1000 + RegistryMaximumSizeOfFile = 500000 // 500KB +) + +type Check struct { + Options *CheckOptions +} + +type CheckOptions struct { + LegacyDataSourceFile *LegacyDataSourceFileOptions + LegacyGuideFile *LegacyGuideFileOptions + LegacyIndexFile *LegacyIndexFileOptions + LegacyResourceFile *LegacyResourceFileOptions + + ProviderName string + + RegistryDataSourceFile *RegistryDataSourceFileOptions + RegistryGuideFile *RegistryGuideFileOptions + RegistryIndexFile *RegistryIndexFileOptions + RegistryResourceFile *RegistryResourceFileOptions + + SchemaDataSources map[string]*tfjson.Schema + SchemaResources map[string]*tfjson.Schema + + SideNavigation *SideNavigationOptions +} + +func NewCheck(opts *CheckOptions) *Check { + check := &Check{ + Options: opts, + } + + if check.Options == nil { + check.Options = &CheckOptions{} + } + + return check +} + +func (check *Check) Run(directories map[string][]string) error { + if err := InvalidDirectoriesCheck(directories); err != nil { + return err + } + + if err := MixedDirectoriesCheck(directories); err != nil { + return err + } + + if err := NumberOfFilesCheck(directories); err != nil { + return err + } + + if len(check.Options.SchemaDataSources) > 0 && false { + var dataSourceFiles []string + + if files, ok := directories[RegistryDataSourcesDirectory]; ok { + dataSourceFiles = files + } else if files, ok := directories[LegacyDataSourcesDirectory]; ok { + dataSourceFiles = files + } + + if err := ResourceFileMismatchCheck(check.Options.ProviderName, ResourceTypeDataSource, check.Options.SchemaDataSources, dataSourceFiles); err != nil { + return err + } + } + + if len(check.Options.SchemaResources) > 0 { + var resourceFiles []string + + if files, ok := directories[RegistryResourcesDirectory]; ok { + resourceFiles = files + } else if files, ok := directories[LegacyResourcesDirectory]; ok { + resourceFiles = files + } + + if err := ResourceFileMismatchCheck(check.Options.ProviderName, ResourceTypeResource, check.Options.SchemaResources, resourceFiles); err != nil { + return err + } + } + + var result *multierror.Error + + if files, ok := directories[RegistryDataSourcesDirectory]; ok { + if err := NewRegistryDataSourceFileCheck(check.Options.RegistryDataSourceFile).RunAll(files); err != nil { + result = multierror.Append(result, err) + } + } + + if files, ok := directories[RegistryGuidesDirectory]; ok { + if err := NewRegistryGuideFileCheck(check.Options.RegistryGuideFile).RunAll(files); err != nil { + result = multierror.Append(result, err) + } + } + + if files, ok := directories[RegistryIndexDirectory]; ok { + if err := NewRegistryIndexFileCheck(check.Options.RegistryIndexFile).RunAll(files); err != nil { + result = multierror.Append(result, err) + } + } + + if files, ok := directories[RegistryResourcesDirectory]; ok { + if err := NewRegistryResourceFileCheck(check.Options.RegistryResourceFile).RunAll(files); err != nil { + result = multierror.Append(result, err) + } + } + + legacyDataSourcesFiles, legacyDataSourcesOk := directories[LegacyDataSourcesDirectory] + legacyResourcesFiles, legacyResourcesOk := directories[LegacyResourcesDirectory] + + if legacyDataSourcesOk { + if err := NewLegacyDataSourceFileCheck(check.Options.LegacyDataSourceFile).RunAll(legacyDataSourcesFiles); err != nil { + result = multierror.Append(result, err) + } + } + + if files, ok := directories[LegacyGuidesDirectory]; ok { + if err := NewLegacyGuideFileCheck(check.Options.LegacyGuideFile).RunAll(files); err != nil { + result = multierror.Append(result, err) + } + } + + if files, ok := directories[LegacyIndexDirectory]; ok { + if err := NewLegacyIndexFileCheck(check.Options.LegacyIndexFile).RunAll(files); err != nil { + result = multierror.Append(result, err) + } + } + + if legacyResourcesOk { + if err := NewLegacyResourceFileCheck(check.Options.LegacyResourceFile).RunAll(legacyResourcesFiles); err != nil { + result = multierror.Append(result, err) + } + } + + if legacyDataSourcesOk || legacyResourcesOk { + if err := SideNavigationLinkCheck(check.Options.SideNavigation); err != nil { + result = multierror.Append(result, err) + } + + if err := SideNavigationMismatchCheck(check.Options.SideNavigation, legacyDataSourcesFiles, legacyResourcesFiles); err != nil { + result = multierror.Append(result, err) + } + } + + if result != nil { + sort.Sort(result) + } + + return result.ErrorOrNil() +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/directory.go b/vendor/github.com/bflad/tfproviderdocs/check/directory.go new file mode 100644 index 00000000000..dcd646f3f2e --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/directory.go @@ -0,0 +1,153 @@ +package check + +import ( + "fmt" + "log" + "path/filepath" + + "github.com/bmatcuk/doublestar" +) + +const ( + DocumentationGlobPattern = `{docs,website/docs}/**/*` + + LegacyIndexDirectory = `website/docs` + LegacyDataSourcesDirectory = `website/docs/d` + LegacyGuidesDirectory = `website/docs/guides` + LegacyResourcesDirectory = `website/docs/r` + + RegistryIndexDirectory = `docs` + RegistryDataSourcesDirectory = `docs/data-sources` + RegistryGuidesDirectory = `docs/guides` + RegistryResourcesDirectory = `docs/resources` +) + +var ValidLegacyDirectories = []string{ + LegacyIndexDirectory, + LegacyDataSourcesDirectory, + LegacyGuidesDirectory, + LegacyResourcesDirectory, +} + +var ValidRegistryDirectories = []string{ + RegistryIndexDirectory, + RegistryDataSourcesDirectory, + RegistryGuidesDirectory, + RegistryResourcesDirectory, +} + +func InvalidDirectoriesCheck(directories map[string][]string) error { + for directory := range directories { + if IsValidRegistryDirectory(directory) { + continue + } + + if IsValidLegacyDirectory(directory) { + continue + } + + return fmt.Errorf("invalid Terraform Provider documentation directory found: %s", directory) + } + + return nil +} + +func MixedDirectoriesCheck(directories map[string][]string) error { + var legacyDirectoryFound bool + var registryDirectoryFound bool + err := fmt.Errorf("mixed Terraform Provider documentation directory layouts found, must use only legacy or registry layout") + + for directory := range directories { + if IsValidRegistryDirectory(directory) { + registryDirectoryFound = true + + if legacyDirectoryFound { + return err + } + } + + if IsValidLegacyDirectory(directory) { + legacyDirectoryFound = true + + if registryDirectoryFound { + return err + } + } + } + + return nil +} + +// NumberOfFilesCheck verifies that documentation is below the Terraform Registry storage limit. +// This check presumes that all provided directories are valid, e.g. that directory checking +// for invalid or mixed directory structures was previously completed. +func NumberOfFilesCheck(directories map[string][]string) error { + var numberOfFiles int + + for directory, files := range directories { + directoryNumberOfFiles := len(files) + log.Printf("[TRACE] Found %d documentation files in directory: %s", directoryNumberOfFiles, directory) + numberOfFiles = numberOfFiles + directoryNumberOfFiles + } + + log.Printf("[DEBUG] Found %d documentation files with limit of %d", numberOfFiles, RegistryMaximumNumberOfFiles) + if numberOfFiles >= RegistryMaximumNumberOfFiles { + return fmt.Errorf("exceeded maximum (%d) number of documentation files for Terraform Registry: %d", RegistryMaximumNumberOfFiles, numberOfFiles) + } + + return nil +} + +func GetDirectories(basepath string) (map[string][]string, error) { + globPattern := DocumentationGlobPattern + + if basepath != "" { + globPattern = fmt.Sprintf("%s/%s", basepath, globPattern) + } + + files, err := doublestar.Glob(globPattern) + + if err != nil { + return nil, fmt.Errorf("error globbing Terraform Provider documentation directories: %w", err) + } + + if basepath != "" { + for index, file := range files { + files[index], _ = filepath.Rel(basepath, file) + } + } + + directories := make(map[string][]string) + + for _, file := range files { + // Simple skip of glob matches that are known directories + if IsValidRegistryDirectory(file) || IsValidLegacyDirectory(file) { + continue + } + + directory := filepath.Dir(file) + directories[directory] = append(directories[directory], file) + } + + return directories, nil +} + +func IsValidLegacyDirectory(directory string) bool { + for _, validLegacyDirectory := range ValidLegacyDirectories { + if directory == validLegacyDirectory { + return true + } + } + + return false +} + +func IsValidRegistryDirectory(directory string) bool { + for _, validRegistryDirectory := range ValidRegistryDirectories { + if directory == validRegistryDirectory { + return true + } + } + + return false +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/file.go b/vendor/github.com/bflad/tfproviderdocs/check/file.go new file mode 100644 index 00000000000..bfc06111d24 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/file.go @@ -0,0 +1,41 @@ +package check + +import ( + "fmt" + "log" + "os" + "path/filepath" +) + +type FileCheck interface { + Run(string) error + RunAll([]string) error +} + +type FileOptions struct { + BasePath string +} + +func (opts *FileOptions) FullPath(path string) string { + if opts.BasePath != "" { + return filepath.Join(opts.BasePath, path) + } + + return path +} + +// FileSizeCheck verifies that documentation file is below the Terraform Registry storage limit. +func FileSizeCheck(fullpath string) error { + fi, err := os.Stat(fullpath) + + if err != nil { + return err + } + + log.Printf("[DEBUG] File %s size: %d (limit: %d)", fullpath, fi.Size(), RegistryMaximumSizeOfFile) + if fi.Size() >= int64(RegistryMaximumSizeOfFile) { + return fmt.Errorf("exceeded maximum (%d) size of documentation file for Terraform Registry: %d", RegistryMaximumSizeOfFile, fi.Size()) + } + + return nil +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/file_extension.go b/vendor/github.com/bflad/tfproviderdocs/check/file_extension.go new file mode 100644 index 00000000000..01ee1454a6f --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/file_extension.go @@ -0,0 +1,69 @@ +package check + +import ( + "fmt" + "path/filepath" + "strings" +) + +const ( + FileExtensionErb = `.erb` + FileExtensionHtmlMarkdown = `.html.markdown` + FileExtensionHtmlMd = `.html.md` + FileExtensionMarkdown = `.markdown` + FileExtensionMd = `.md` +) + +var ValidLegacyFileExtensions = []string{ + FileExtensionHtmlMarkdown, + FileExtensionHtmlMd, + FileExtensionMarkdown, + FileExtensionMd, +} + +var ValidRegistryFileExtensions = []string{ + FileExtensionMd, +} + +func LegacyFileExtensionCheck(path string) error { + if !FilePathEndsWithExtensionFrom(path, ValidLegacyFileExtensions) { + return fmt.Errorf("file does not end with a valid extension, valid extensions: %v", ValidLegacyFileExtensions) + } + + return nil +} + +func RegistryFileExtensionCheck(path string) error { + if !FilePathEndsWithExtensionFrom(path, ValidRegistryFileExtensions) { + return fmt.Errorf("file does not end with a valid extension, valid extensions: %v", ValidLegacyFileExtensions) + } + + return nil +} + +func FilePathEndsWithExtensionFrom(path string, validExtensions []string) bool { + for _, validExtension := range validExtensions { + if strings.HasSuffix(path, validExtension) { + return true + } + } + + return false +} + +// TrimFileExtension removes file extensions including those with multiple periods. +func TrimFileExtension(path string) string { + filename := filepath.Base(path) + + if filename == "." { + return "" + } + + dotIndex := strings.IndexByte(filename, '.') + + if dotIndex > 0 { + return filename[:dotIndex] + } + + return filename +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/file_mismatch.go b/vendor/github.com/bflad/tfproviderdocs/check/file_mismatch.go new file mode 100644 index 00000000000..b5c4868dd36 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/file_mismatch.go @@ -0,0 +1,83 @@ +package check + +import ( + "fmt" + "sort" + + "github.com/hashicorp/go-multierror" + tfjson "github.com/hashicorp/terraform-json" +) + +func ResourceFileMismatchCheck(providerName string, resourceType string, schemaResources map[string]*tfjson.Schema, files []string) error { + var extraFiles []string + var missingFiles []string + + for _, file := range files { + if fileHasResource(schemaResources, providerName, file) { + continue + } + + extraFiles = append(extraFiles, file) + } + + for _, resourceName := range resourceNames(schemaResources) { + if resourceHasFile(files, providerName, resourceName) { + continue + } + + missingFiles = append(missingFiles, resourceName) + } + + var result *multierror.Error + + for _, extraFile := range extraFiles { + err := fmt.Errorf("matching %s for documentation file (%s) not found, file is extraneous or incorrectly named", resourceType, extraFile) + result = multierror.Append(result, err) + } + + for _, missingFile := range missingFiles { + err := fmt.Errorf("missing documentation file for %s: %s", resourceType, missingFile) + result = multierror.Append(result, err) + } + + return result.ErrorOrNil() +} + +func fileHasResource(schemaResources map[string]*tfjson.Schema, providerName, file string) bool { + if _, ok := schemaResources[fileResourceName(providerName, file)]; ok { + return true + } + + return false +} + +func fileResourceName(providerName, fileName string) string { + resourceSuffix := TrimFileExtension(fileName) + + return fmt.Sprintf("%s_%s", providerName, resourceSuffix) +} + +func resourceHasFile(files []string, providerName, resourceName string) bool { + var found bool + + for _, file := range files { + if fileResourceName(providerName, file) == resourceName { + found = true + break + } + } + + return found +} + +func resourceNames(resources map[string]*tfjson.Schema) []string { + names := make([]string, 0, len(resources)) + + for name := range resources { + names = append(names, name) + } + + sort.Strings(names) + + return names +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/frontmatter.go b/vendor/github.com/bflad/tfproviderdocs/check/frontmatter.go new file mode 100644 index 00000000000..2f1a5818023 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/frontmatter.go @@ -0,0 +1,107 @@ +package check + +import ( + "fmt" + + "gopkg.in/yaml.v2" +) + +type FrontMatterCheck struct { + Options *FrontMatterOptions +} + +// FrontMatterData represents the YAML frontmatter of Terraform Provider documentation. +type FrontMatterData struct { + Description *string `yaml:"description,omitempty"` + Layout *string `yaml:"layout,omitempty"` + PageTitle *string `yaml:"page_title,omitempty"` + SidebarCurrent *string `yaml:"sidebar_current,omitempty"` + Subcategory *string `yaml:"subcategory,omitempty"` +} + +// FrontMatterOptions represents configuration options for FrontMatter. +type FrontMatterOptions struct { + AllowedSubcategories []string + NoDescription bool + NoLayout bool + NoPageTitle bool + NoSidebarCurrent bool + NoSubcategory bool + RequireDescription bool + RequireLayout bool + RequirePageTitle bool + RequireSubcategory bool +} + +func NewFrontMatterCheck(opts *FrontMatterOptions) *FrontMatterCheck { + check := &FrontMatterCheck{ + Options: opts, + } + + if check.Options == nil { + check.Options = &FrontMatterOptions{} + } + + return check +} + +func (check *FrontMatterCheck) Run(src []byte) error { + frontMatter := FrontMatterData{} + + err := yaml.Unmarshal([]byte(src), &frontMatter) + if err != nil { + return fmt.Errorf("error parsing YAML frontmatter: %w", err) + } + + if check.Options.NoDescription && frontMatter.Description != nil { + return fmt.Errorf("YAML frontmatter should not contain description") + } + + if check.Options.NoLayout && frontMatter.Layout != nil { + return fmt.Errorf("YAML frontmatter should not contain layout") + } + + if check.Options.NoPageTitle && frontMatter.PageTitle != nil { + return fmt.Errorf("YAML frontmatter should not contain page_title") + } + + if check.Options.NoSidebarCurrent && frontMatter.SidebarCurrent != nil { + return fmt.Errorf("YAML frontmatter should not contain sidebar_current") + } + + if check.Options.NoSubcategory && frontMatter.Subcategory != nil { + return fmt.Errorf("YAML frontmatter should not contain subcategory") + } + + if check.Options.RequireDescription && frontMatter.Description == nil { + return fmt.Errorf("YAML frontmatter missing required description") + } + + if check.Options.RequireLayout && frontMatter.Layout == nil { + return fmt.Errorf("YAML frontmatter missing required layout") + } + + if check.Options.RequirePageTitle && frontMatter.PageTitle == nil { + return fmt.Errorf("YAML frontmatter missing required page_title") + } + + if check.Options.RequireSubcategory && frontMatter.Subcategory == nil { + return fmt.Errorf("YAML frontmatter missing required subcategory") + } + + if len(check.Options.AllowedSubcategories) > 0 && frontMatter.Subcategory != nil && !isAllowedSubcategory(*frontMatter.Subcategory, check.Options.AllowedSubcategories) { + return fmt.Errorf("YAML frontmatter subcategory (%s) does not match allowed subcategories (%#v)", *frontMatter.Subcategory, check.Options.AllowedSubcategories) + } + + return nil +} + +func isAllowedSubcategory(subcategory string, allowedSubcategories []string) bool { + for _, allowedSubcategory := range allowedSubcategories { + if subcategory == allowedSubcategory { + return true + } + } + + return false +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/legacy_data_source_file.go b/vendor/github.com/bflad/tfproviderdocs/check/legacy_data_source_file.go new file mode 100644 index 00000000000..4eab96252b0 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/legacy_data_source_file.go @@ -0,0 +1,84 @@ +package check + +import ( + "fmt" + "io/ioutil" + "log" + + "github.com/hashicorp/go-multierror" +) + +type LegacyDataSourceFileOptions struct { + *FileOptions + + FrontMatter *FrontMatterOptions +} + +type LegacyDataSourceFileCheck struct { + FileCheck + + Options *LegacyDataSourceFileOptions +} + +func NewLegacyDataSourceFileCheck(opts *LegacyDataSourceFileOptions) *LegacyDataSourceFileCheck { + check := &LegacyDataSourceFileCheck{ + Options: opts, + } + + if check.Options == nil { + check.Options = &LegacyDataSourceFileOptions{} + } + + if check.Options.FileOptions == nil { + check.Options.FileOptions = &FileOptions{} + } + + if check.Options.FrontMatter == nil { + check.Options.FrontMatter = &FrontMatterOptions{} + } + + check.Options.FrontMatter.NoSidebarCurrent = true + check.Options.FrontMatter.RequireDescription = true + check.Options.FrontMatter.RequireLayout = true + check.Options.FrontMatter.RequirePageTitle = true + + return check +} + +func (check *LegacyDataSourceFileCheck) Run(path string) error { + fullpath := check.Options.FullPath(path) + + log.Printf("[DEBUG] Checking file: %s", fullpath) + + if err := LegacyFileExtensionCheck(path); err != nil { + return fmt.Errorf("%s: error checking file extension: %w", path, err) + } + + if err := FileSizeCheck(fullpath); err != nil { + return fmt.Errorf("%s: error checking file size: %w", path, err) + } + + content, err := ioutil.ReadFile(fullpath) + + if err != nil { + return fmt.Errorf("%s: error reading file: %w", path, err) + } + + if err := NewFrontMatterCheck(check.Options.FrontMatter).Run(content); err != nil { + return fmt.Errorf("%s: error checking file frontmatter: %w", path, err) + } + + return nil +} + +func (check *LegacyDataSourceFileCheck) RunAll(files []string) error { + var result *multierror.Error + + for _, file := range files { + if err := check.Run(file); err != nil { + result = multierror.Append(result, err) + } + } + + return result.ErrorOrNil() +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/legacy_guide_file.go b/vendor/github.com/bflad/tfproviderdocs/check/legacy_guide_file.go new file mode 100644 index 00000000000..b4462fab68f --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/legacy_guide_file.go @@ -0,0 +1,84 @@ +package check + +import ( + "fmt" + "io/ioutil" + "log" + + "github.com/hashicorp/go-multierror" +) + +type LegacyGuideFileOptions struct { + *FileOptions + + FrontMatter *FrontMatterOptions +} + +type LegacyGuideFileCheck struct { + FileCheck + + Options *LegacyGuideFileOptions +} + +func NewLegacyGuideFileCheck(opts *LegacyGuideFileOptions) *LegacyGuideFileCheck { + check := &LegacyGuideFileCheck{ + Options: opts, + } + + if check.Options == nil { + check.Options = &LegacyGuideFileOptions{} + } + + if check.Options.FileOptions == nil { + check.Options.FileOptions = &FileOptions{} + } + + if check.Options.FrontMatter == nil { + check.Options.FrontMatter = &FrontMatterOptions{} + } + + check.Options.FrontMatter.NoSidebarCurrent = true + check.Options.FrontMatter.RequireDescription = true + check.Options.FrontMatter.RequireLayout = true + check.Options.FrontMatter.RequirePageTitle = true + + return check +} + +func (check *LegacyGuideFileCheck) Run(path string) error { + fullpath := check.Options.FullPath(path) + + log.Printf("[DEBUG] Checking file: %s", fullpath) + + if err := LegacyFileExtensionCheck(path); err != nil { + return fmt.Errorf("%s: error checking file extension: %w", path, err) + } + + if err := FileSizeCheck(fullpath); err != nil { + return fmt.Errorf("%s: error checking file size: %w", path, err) + } + + content, err := ioutil.ReadFile(fullpath) + + if err != nil { + return fmt.Errorf("%s: error reading file: %w", path, err) + } + + if err := NewFrontMatterCheck(check.Options.FrontMatter).Run(content); err != nil { + return fmt.Errorf("%s: error checking file frontmatter: %w", path, err) + } + + return nil +} + +func (check *LegacyGuideFileCheck) RunAll(files []string) error { + var result *multierror.Error + + for _, file := range files { + if err := check.Run(file); err != nil { + result = multierror.Append(result, err) + } + } + + return result.ErrorOrNil() +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/legacy_index_file.go b/vendor/github.com/bflad/tfproviderdocs/check/legacy_index_file.go new file mode 100644 index 00000000000..92b1f867955 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/legacy_index_file.go @@ -0,0 +1,85 @@ +package check + +import ( + "fmt" + "io/ioutil" + "log" + + "github.com/hashicorp/go-multierror" +) + +type LegacyIndexFileOptions struct { + *FileOptions + + FrontMatter *FrontMatterOptions +} + +type LegacyIndexFileCheck struct { + FileCheck + + Options *LegacyIndexFileOptions +} + +func NewLegacyIndexFileCheck(opts *LegacyIndexFileOptions) *LegacyIndexFileCheck { + check := &LegacyIndexFileCheck{ + Options: opts, + } + + if check.Options == nil { + check.Options = &LegacyIndexFileOptions{} + } + + if check.Options.FileOptions == nil { + check.Options.FileOptions = &FileOptions{} + } + + if check.Options.FrontMatter == nil { + check.Options.FrontMatter = &FrontMatterOptions{} + } + + check.Options.FrontMatter.NoSidebarCurrent = true + check.Options.FrontMatter.NoSubcategory = true + check.Options.FrontMatter.RequireDescription = true + check.Options.FrontMatter.RequireLayout = true + check.Options.FrontMatter.RequirePageTitle = true + + return check +} + +func (check *LegacyIndexFileCheck) Run(path string) error { + fullpath := check.Options.FullPath(path) + + log.Printf("[DEBUG] Checking file: %s", fullpath) + + if err := LegacyFileExtensionCheck(path); err != nil { + return fmt.Errorf("%s: error checking file extension: %w", path, err) + } + + if err := FileSizeCheck(fullpath); err != nil { + return fmt.Errorf("%s: error checking file size: %w", path, err) + } + + content, err := ioutil.ReadFile(fullpath) + + if err != nil { + return fmt.Errorf("%s: error reading file: %w", path, err) + } + + if err := NewFrontMatterCheck(check.Options.FrontMatter).Run(content); err != nil { + return fmt.Errorf("%s: error checking file frontmatter: %w", path, err) + } + + return nil +} + +func (check *LegacyIndexFileCheck) RunAll(files []string) error { + var result *multierror.Error + + for _, file := range files { + if err := check.Run(file); err != nil { + result = multierror.Append(result, err) + } + } + + return result.ErrorOrNil() +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/legacy_resource_file.go b/vendor/github.com/bflad/tfproviderdocs/check/legacy_resource_file.go new file mode 100644 index 00000000000..e6dfaf6c558 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/legacy_resource_file.go @@ -0,0 +1,84 @@ +package check + +import ( + "fmt" + "io/ioutil" + "log" + + "github.com/hashicorp/go-multierror" +) + +type LegacyResourceFileOptions struct { + *FileOptions + + FrontMatter *FrontMatterOptions +} + +type LegacyResourceFileCheck struct { + FileCheck + + Options *LegacyResourceFileOptions +} + +func NewLegacyResourceFileCheck(opts *LegacyResourceFileOptions) *LegacyResourceFileCheck { + check := &LegacyResourceFileCheck{ + Options: opts, + } + + if check.Options == nil { + check.Options = &LegacyResourceFileOptions{} + } + + if check.Options.FileOptions == nil { + check.Options.FileOptions = &FileOptions{} + } + + if check.Options.FrontMatter == nil { + check.Options.FrontMatter = &FrontMatterOptions{} + } + + check.Options.FrontMatter.NoSidebarCurrent = true + check.Options.FrontMatter.RequireDescription = true + check.Options.FrontMatter.RequireLayout = true + check.Options.FrontMatter.RequirePageTitle = true + + return check +} + +func (check *LegacyResourceFileCheck) Run(path string) error { + fullpath := check.Options.FullPath(path) + + log.Printf("[DEBUG] Checking file: %s", fullpath) + + if err := LegacyFileExtensionCheck(path); err != nil { + return fmt.Errorf("%s: error checking file extension: %w", path, err) + } + + if err := FileSizeCheck(fullpath); err != nil { + return fmt.Errorf("%s: error checking file size: %w", path, err) + } + + content, err := ioutil.ReadFile(fullpath) + + if err != nil { + return fmt.Errorf("%s: error reading file: %w", path, err) + } + + if err := NewFrontMatterCheck(check.Options.FrontMatter).Run(content); err != nil { + return fmt.Errorf("%s: error checking file frontmatter: %w", path, err) + } + + return nil +} + +func (check *LegacyResourceFileCheck) RunAll(files []string) error { + var result *multierror.Error + + for _, file := range files { + if err := check.Run(file); err != nil { + result = multierror.Append(result, err) + } + } + + return result.ErrorOrNil() +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/registry_data_source_file.go b/vendor/github.com/bflad/tfproviderdocs/check/registry_data_source_file.go new file mode 100644 index 00000000000..c3e7e9101df --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/registry_data_source_file.go @@ -0,0 +1,82 @@ +package check + +import ( + "fmt" + "io/ioutil" + "log" + + "github.com/hashicorp/go-multierror" +) + +type RegistryDataSourceFileOptions struct { + *FileOptions + + FrontMatter *FrontMatterOptions +} + +type RegistryDataSourceFileCheck struct { + FileCheck + + Options *RegistryDataSourceFileOptions +} + +func NewRegistryDataSourceFileCheck(opts *RegistryDataSourceFileOptions) *RegistryDataSourceFileCheck { + check := &RegistryDataSourceFileCheck{ + Options: opts, + } + + if check.Options == nil { + check.Options = &RegistryDataSourceFileOptions{} + } + + if check.Options.FileOptions == nil { + check.Options.FileOptions = &FileOptions{} + } + + if check.Options.FrontMatter == nil { + check.Options.FrontMatter = &FrontMatterOptions{} + } + + check.Options.FrontMatter.NoLayout = true + check.Options.FrontMatter.NoSidebarCurrent = true + + return check +} + +func (check *RegistryDataSourceFileCheck) Run(path string) error { + fullpath := check.Options.FullPath(path) + + log.Printf("[DEBUG] Checking file: %s", fullpath) + + if err := RegistryFileExtensionCheck(path); err != nil { + return fmt.Errorf("%s: error checking file extension: %w", path, err) + } + + if err := FileSizeCheck(fullpath); err != nil { + return fmt.Errorf("%s: error checking file size: %w", path, err) + } + + content, err := ioutil.ReadFile(fullpath) + + if err != nil { + return fmt.Errorf("%s: error reading file: %w", path, err) + } + + if err := NewFrontMatterCheck(check.Options.FrontMatter).Run(content); err != nil { + return fmt.Errorf("%s: error checking file frontmatter: %w", path, err) + } + + return nil +} + +func (check *RegistryDataSourceFileCheck) RunAll(files []string) error { + var result *multierror.Error + + for _, file := range files { + if err := check.Run(file); err != nil { + result = multierror.Append(result, err) + } + } + + return result.ErrorOrNil() +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/registry_guide_file.go b/vendor/github.com/bflad/tfproviderdocs/check/registry_guide_file.go new file mode 100644 index 00000000000..6943c4354da --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/registry_guide_file.go @@ -0,0 +1,83 @@ +package check + +import ( + "fmt" + "io/ioutil" + "log" + + "github.com/hashicorp/go-multierror" +) + +type RegistryGuideFileOptions struct { + *FileOptions + + FrontMatter *FrontMatterOptions +} + +type RegistryGuideFileCheck struct { + FileCheck + + Options *RegistryGuideFileOptions +} + +func NewRegistryGuideFileCheck(opts *RegistryGuideFileOptions) *RegistryGuideFileCheck { + check := &RegistryGuideFileCheck{ + Options: opts, + } + + if check.Options == nil { + check.Options = &RegistryGuideFileOptions{} + } + + if check.Options.FileOptions == nil { + check.Options.FileOptions = &FileOptions{} + } + + if check.Options.FrontMatter == nil { + check.Options.FrontMatter = &FrontMatterOptions{} + } + + check.Options.FrontMatter.NoLayout = true + check.Options.FrontMatter.NoSidebarCurrent = true + check.Options.FrontMatter.RequirePageTitle = true + + return check +} + +func (check *RegistryGuideFileCheck) Run(path string) error { + fullpath := check.Options.FullPath(path) + + log.Printf("[DEBUG] Checking file: %s", fullpath) + + if err := RegistryFileExtensionCheck(path); err != nil { + return fmt.Errorf("%s: error checking file extension: %w", path, err) + } + + if err := FileSizeCheck(fullpath); err != nil { + return fmt.Errorf("%s: error checking file size: %w", path, err) + } + + content, err := ioutil.ReadFile(fullpath) + + if err != nil { + return fmt.Errorf("%s: error reading file: %w", path, err) + } + + if err := NewFrontMatterCheck(check.Options.FrontMatter).Run(content); err != nil { + return fmt.Errorf("%s: error checking file frontmatter: %w", path, err) + } + + return nil +} + +func (check *RegistryGuideFileCheck) RunAll(files []string) error { + var result *multierror.Error + + for _, file := range files { + if err := check.Run(file); err != nil { + result = multierror.Append(result, err) + } + } + + return result.ErrorOrNil() +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/registry_index_file.go b/vendor/github.com/bflad/tfproviderdocs/check/registry_index_file.go new file mode 100644 index 00000000000..4562a9b29ae --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/registry_index_file.go @@ -0,0 +1,83 @@ +package check + +import ( + "fmt" + "io/ioutil" + "log" + + "github.com/hashicorp/go-multierror" +) + +type RegistryIndexFileOptions struct { + *FileOptions + + FrontMatter *FrontMatterOptions +} + +type RegistryIndexFileCheck struct { + FileCheck + + Options *RegistryIndexFileOptions +} + +func NewRegistryIndexFileCheck(opts *RegistryIndexFileOptions) *RegistryIndexFileCheck { + check := &RegistryIndexFileCheck{ + Options: opts, + } + + if check.Options == nil { + check.Options = &RegistryIndexFileOptions{} + } + + if check.Options.FileOptions == nil { + check.Options.FileOptions = &FileOptions{} + } + + if check.Options.FrontMatter == nil { + check.Options.FrontMatter = &FrontMatterOptions{} + } + + check.Options.FrontMatter.NoLayout = true + check.Options.FrontMatter.NoSidebarCurrent = true + check.Options.FrontMatter.NoSubcategory = true + + return check +} + +func (check *RegistryIndexFileCheck) Run(path string) error { + fullpath := check.Options.FullPath(path) + + log.Printf("[DEBUG] Checking file: %s", fullpath) + + if err := RegistryFileExtensionCheck(path); err != nil { + return fmt.Errorf("%s: error checking file extension: %w", path, err) + } + + if err := FileSizeCheck(fullpath); err != nil { + return fmt.Errorf("%s: error checking file size: %w", path, err) + } + + content, err := ioutil.ReadFile(fullpath) + + if err != nil { + return fmt.Errorf("%s: error reading file: %w", path, err) + } + + if err := NewFrontMatterCheck(check.Options.FrontMatter).Run(content); err != nil { + return fmt.Errorf("%s: error checking file frontmatter: %w", path, err) + } + + return nil +} + +func (check *RegistryIndexFileCheck) RunAll(files []string) error { + var result *multierror.Error + + for _, file := range files { + if err := check.Run(file); err != nil { + result = multierror.Append(result, err) + } + } + + return result.ErrorOrNil() +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/registry_resource_file.go b/vendor/github.com/bflad/tfproviderdocs/check/registry_resource_file.go new file mode 100644 index 00000000000..170ccdb0029 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/registry_resource_file.go @@ -0,0 +1,82 @@ +package check + +import ( + "fmt" + "io/ioutil" + "log" + + "github.com/hashicorp/go-multierror" +) + +type RegistryResourceFileOptions struct { + *FileOptions + + FrontMatter *FrontMatterOptions +} + +type RegistryResourceFileCheck struct { + FileCheck + + Options *RegistryResourceFileOptions +} + +func NewRegistryResourceFileCheck(opts *RegistryResourceFileOptions) *RegistryResourceFileCheck { + check := &RegistryResourceFileCheck{ + Options: opts, + } + + if check.Options == nil { + check.Options = &RegistryResourceFileOptions{} + } + + if check.Options.FileOptions == nil { + check.Options.FileOptions = &FileOptions{} + } + + if check.Options.FrontMatter == nil { + check.Options.FrontMatter = &FrontMatterOptions{} + } + + check.Options.FrontMatter.NoLayout = true + check.Options.FrontMatter.NoSidebarCurrent = true + + return check +} + +func (check *RegistryResourceFileCheck) Run(path string) error { + fullpath := check.Options.FullPath(path) + + log.Printf("[DEBUG] Checking file: %s", fullpath) + + if err := RegistryFileExtensionCheck(path); err != nil { + return fmt.Errorf("%s: error checking file extension: %w", path, err) + } + + if err := FileSizeCheck(fullpath); err != nil { + return fmt.Errorf("%s: error checking file size: %w", path, err) + } + + content, err := ioutil.ReadFile(fullpath) + + if err != nil { + return fmt.Errorf("%s: error reading file: %w", path, err) + } + + if err := NewFrontMatterCheck(check.Options.FrontMatter).Run(content); err != nil { + return fmt.Errorf("%s: error checking file frontmatter: %w", path, err) + } + + return nil +} + +func (check *RegistryResourceFileCheck) RunAll(files []string) error { + var result *multierror.Error + + for _, file := range files { + if err := check.Run(file); err != nil { + result = multierror.Append(result, err) + } + } + + return result.ErrorOrNil() +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation/category.go b/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation/category.go new file mode 100644 index 00000000000..be7c67bcd1c --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation/category.go @@ -0,0 +1,72 @@ +package sidenavigation + +import ( + "golang.org/x/net/html" +) + +type Category struct { + Name string + Node *html.Node + + DataSourceLinks []*Link + ExternalLinks []*Link + GuideLinks []*Link + ResourceLinks []*Link +} + +func NewCategory(name string, listNode *html.Node) *Category { + category := &Category{ + DataSourceLinks: make([]*Link, 0), + ExternalLinks: make([]*Link, 0), + GuideLinks: make([]*Link, 0), + Name: name, + Node: listNode, + ResourceLinks: make([]*Link, 0), + } + + category.processList() + + return category +} + +func (category *Category) processList() { + for child := category.Node.FirstChild; child != nil; child = child.NextSibling { + if isListItem(child) { + category.processListItem(child) + } + } +} + +func (category *Category) processListItem(node *html.Node) { + linkNode := childLinkNode(node) + + if linkNode == nil { + return + } + + link := NewLink(linkNode) + listNode := childUnorderedListNode(node) + + if listNode == nil { + switch link.Type { + case LinkTypeDataSource: + category.DataSourceLinks = append(category.DataSourceLinks, link) + case LinkTypeExternal: + category.ExternalLinks = append(category.ExternalLinks, link) + case LinkTypeGuide: + category.GuideLinks = append(category.GuideLinks, link) + case LinkTypeResource: + category.ResourceLinks = append(category.ResourceLinks, link) + } + + return + } + + // Categories can contain one single subcategory (e.g. Service Name > Resources) + subCategory := NewCategory(link.Text, listNode) + + category.DataSourceLinks = append(category.DataSourceLinks, subCategory.DataSourceLinks...) + category.ExternalLinks = append(category.ExternalLinks, subCategory.ExternalLinks...) + category.GuideLinks = append(category.GuideLinks, subCategory.GuideLinks...) + category.ResourceLinks = append(category.ResourceLinks, subCategory.ResourceLinks...) +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation/html.go b/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation/html.go new file mode 100644 index 00000000000..3b5ea89a273 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation/html.go @@ -0,0 +1,61 @@ +package sidenavigation + +import ( + "golang.org/x/net/html" +) + +func childLinkNode(node *html.Node) *html.Node { + for child := node.FirstChild; child != nil; child = child.NextSibling { + if isLink(child) { + return child + } + } + + return nil +} + +func childText(node *html.Node) string { + if node.Type == html.TextNode { + return node.Data + } + + for child := node.FirstChild; child != nil; child = child.NextSibling { + return childText(child) + } + + return "" +} + +func childUnorderedListNode(node *html.Node) *html.Node { + for child := node.FirstChild; child != nil; child = child.NextSibling { + if isUnorderedList(child) { + return child + } + } + + return nil +} + +func isLink(node *html.Node) bool { + if node.Type != html.ElementNode { + return false + } + + return node.Data == "a" +} + +func isListItem(node *html.Node) bool { + if node.Type != html.ElementNode { + return false + } + + return node.Data == "li" +} + +func isUnorderedList(node *html.Node) bool { + if node.Type != html.ElementNode { + return false + } + + return node.Data == "ul" +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation/link.go b/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation/link.go new file mode 100644 index 00000000000..a373f008446 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation/link.go @@ -0,0 +1,106 @@ +package sidenavigation + +import ( + "fmt" + "strings" + + "golang.org/x/net/html" +) + +type Link struct { + Text string + Type LinkType + Url string +} + +type LinkType int + +const ( + LinkTypeAnchor LinkType = iota + LinkTypeExternal + LinkTypeDataSource + LinkTypeGuide + LinkTypeResource +) + +func (typ LinkType) String() string { + return [...]string{"Anchor", "External", "Data Source", "Guide", "Resource"}[typ] +} + +func NewLink(node *html.Node) *Link { + link := &Link{ + Text: childText(node), + } + + for _, attr := range node.Attr { + if attr.Key == "href" { + link.Url = attr.Val + + if strings.HasPrefix(link.Url, "#") { + link.Type = LinkTypeAnchor + } else if strings.Contains(link.Url, "/d/") { + link.Type = LinkTypeDataSource + } else if strings.Contains(link.Url, "/guides/") { + link.Type = LinkTypeGuide + } else if strings.Contains(link.Url, "/r/") { + link.Type = LinkTypeResource + } else { + link.Type = LinkTypeExternal + } + + break + } + } + + return link +} + +func (link *Link) Validate(expectedProviderName string) error { + if link.Type != LinkTypeDataSource && link.Type != LinkTypeResource { + return nil + } + + var linkTypeUrlPart string + + switch link.Type { + case LinkTypeDataSource: + linkTypeUrlPart = "d" + case LinkTypeResource: + linkTypeUrlPart = "r" + } + + if !strings.Contains(link.Url, "/") { + return fmt.Errorf("link URL (%s) is missing / separators, should be in form: /docs/providers/PROVIDER/%s/NAME.html", link.Url, linkTypeUrlPart) + } + + urlParts := strings.Split(link.Url, "/") + + if len(urlParts) < 6 { + return fmt.Errorf("link URL (%s) is missing path parts, e.g. /docs/providers/PROVIDER/%s/NAME.html", link.Url, linkTypeUrlPart) + } else if len(urlParts) > 6 { + return fmt.Errorf("link URL (%s) has too many path parts, should be in form: /docs/providers/PROVIDER/%s/NAME.html", link.Url, linkTypeUrlPart) + } + + urlProviderName := urlParts[3] + + if expectedProviderName != "" && urlProviderName != expectedProviderName { + return fmt.Errorf("link URL (%s) has incorrect provider name (%s), expected: %s", link.Url, urlProviderName, expectedProviderName) + } + + urlResourceName := urlParts[len(urlParts)-1] + urlResourceName = strings.TrimSuffix(urlResourceName, ".html") + + if expectedProviderName != "" { + expectedText := fmt.Sprintf("%s_%s", expectedProviderName, urlResourceName) + if link.Text != expectedText { + return fmt.Errorf("link URL (%s) has incorrect text (%s), expected: %s", link.Url, link.Text, expectedText) + } + } else { + expectedSuffix := fmt.Sprintf("_%s", urlResourceName) + if !strings.HasSuffix(link.Text, expectedSuffix) { + return fmt.Errorf("link URL (%s) has incorrect text (%s), expected: PROVIDER%s", link.Url, link.Text, expectedSuffix) + } + } + + return nil +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation/sidenavigation.go b/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation/sidenavigation.go new file mode 100644 index 00000000000..7cf27416694 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation/sidenavigation.go @@ -0,0 +1,161 @@ +package sidenavigation + +import ( + "fmt" + "io/ioutil" + "log" + "regexp" + "strings" + + "golang.org/x/net/html" +) + +const erbRegexpPattern = `<%.*%>` + +type SideNavigation struct { + Categories []*Category + Node *html.Node + + ExternalLinks []*Link + + // These include all sub-categories + DataSourceLinks []*Link + GuideLinks []*Link + ResourceLinks []*Link +} + +func Find(node *html.Node) *SideNavigation { + if node == nil { + return nil + } + + if isSideNavigationList(node) { + return New(node) + } + + for child := node.FirstChild; child != nil; child = child.NextSibling { + sideNavigation := Find(child) + + if sideNavigation != nil { + return sideNavigation + } + } + + return nil +} + +func FindFile(path string) (*SideNavigation, error) { + fileContents, err := ioutil.ReadFile(path) + + if err != nil { + log.Fatalf("error opening file (%s): %w", path, err) + } + + return FindString(string(fileContents)) +} + +func FindString(fileContents string) (*SideNavigation, error) { + strippedFileContents := regexp.MustCompile(erbRegexpPattern).ReplaceAllString(string(fileContents), "") + + doc, err := html.Parse(strings.NewReader(strippedFileContents)) + + if err != nil { + return nil, fmt.Errorf("error HTML parsing file: %w", err) + } + + return Find(doc), nil +} + +func New(node *html.Node) *SideNavigation { + sn := &SideNavigation{ + Categories: make([]*Category, 0), + DataSourceLinks: make([]*Link, 0), + ExternalLinks: make([]*Link, 0), + GuideLinks: make([]*Link, 0), + Node: node, + ResourceLinks: make([]*Link, 0), + } + + sn.processList() + + return sn +} + +func (sn *SideNavigation) HasDataSourceLink(name string) bool { + for _, link := range sn.DataSourceLinks { + if link.Text == name { + return true + } + } + + return false +} + +func (sn *SideNavigation) HasResourceLink(name string) bool { + for _, link := range sn.ResourceLinks { + if link.Text == name { + return true + } + } + + return false +} + +func (sn *SideNavigation) processList() { + for child := sn.Node.FirstChild; child != nil; child = child.NextSibling { + if isListItem(child) { + sn.processListItem(child) + } + } +} + +func (sn *SideNavigation) processListItem(node *html.Node) { + linkNode := childLinkNode(node) + + if linkNode == nil { + return + } + + link := NewLink(linkNode) + listNode := childUnorderedListNode(node) + + if listNode == nil { + switch link.Type { + case LinkTypeDataSource: + sn.DataSourceLinks = append(sn.DataSourceLinks, link) + case LinkTypeExternal: + sn.ExternalLinks = append(sn.ExternalLinks, link) + case LinkTypeGuide: + sn.GuideLinks = append(sn.GuideLinks, link) + case LinkTypeResource: + sn.ResourceLinks = append(sn.ResourceLinks, link) + } + + return + } + + category := NewCategory(link.Text, listNode) + + sn.DataSourceLinks = append(sn.DataSourceLinks, category.DataSourceLinks...) + sn.ExternalLinks = append(sn.ExternalLinks, category.ExternalLinks...) + sn.GuideLinks = append(sn.GuideLinks, category.GuideLinks...) + sn.ResourceLinks = append(sn.ResourceLinks, category.ResourceLinks...) +} + +func isSideNavigationList(node *html.Node) bool { + if node.Type != html.ElementNode { + return false + } + + if node.Data != "ul" { + return false + } + + for _, attr := range node.Attr { + if attr.Key == "class" && strings.Contains(attr.Val, "docs-sidenav") { + return true + } + } + + return false +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation_link.go b/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation_link.go new file mode 100644 index 00000000000..99e61a7a849 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation_link.go @@ -0,0 +1,50 @@ +package check + +import ( + "fmt" + + "github.com/bflad/tfproviderdocs/check/sidenavigation" + "github.com/hashicorp/go-multierror" +) + +func SideNavigationLinkCheck(opts *SideNavigationOptions) error { + if opts == nil || opts.ProviderName == "" { + return nil + } + + path := fmt.Sprintf("website/%s%s", opts.ProviderName, FileExtensionErb) + + sideNavigation, err := sidenavigation.FindFile(opts.FullPath(path)) + + if err != nil { + return fmt.Errorf("%s: error finding side navigation: %s", path, err) + } + + if sideNavigation == nil { + return fmt.Errorf("%s: error finding side navigation: not found in file", path) + } + + var errors *multierror.Error + + for _, link := range sideNavigation.DataSourceLinks { + if opts.ShouldIgnoreDataSource(link.Text) { + continue + } + + if err := link.Validate(opts.ProviderName); err != nil { + errors = multierror.Append(errors, fmt.Errorf("%s: error validating link: %s", path, err)) + } + } + + for _, link := range sideNavigation.ResourceLinks { + if opts.ShouldIgnoreResource(link.Text) { + continue + } + + if err := link.Validate(opts.ProviderName); err != nil { + errors = multierror.Append(errors, fmt.Errorf("%s: error validating link: %s", path, err)) + } + } + + return errors.ErrorOrNil() +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation_mismatch.go b/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation_mismatch.go new file mode 100644 index 00000000000..be030ed164f --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation_mismatch.go @@ -0,0 +1,69 @@ +package check + +import ( + "fmt" + + "github.com/bflad/tfproviderdocs/check/sidenavigation" + "github.com/hashicorp/go-multierror" +) + +func SideNavigationMismatchCheck(opts *SideNavigationOptions, dataSourceFiles []string, resourceFiles []string) error { + if opts == nil || opts.ProviderName == "" { + return nil + } + + path := fmt.Sprintf("website/%s%s", opts.ProviderName, FileExtensionErb) + + sideNavigation, err := sidenavigation.FindFile(opts.FullPath(path)) + + if err != nil { + return fmt.Errorf("%s: error finding side navigation: %s", path, err) + } + + if sideNavigation == nil { + return fmt.Errorf("%s: error finding side navigation: not found in file", path) + } + + var missingDataSources, missingResources []string + var result *multierror.Error + + for _, dataSourceFile := range dataSourceFiles { + dataSourceName := fileResourceName(opts.ProviderName, dataSourceFile) + + if sideNavigation.HasDataSourceLink(dataSourceName) { + continue + } + + missingDataSources = append(missingDataSources, dataSourceName) + } + + for _, resourceFile := range resourceFiles { + resourceName := fileResourceName(opts.ProviderName, resourceFile) + + if sideNavigation.HasResourceLink(resourceName) { + continue + } + + missingResources = append(missingResources, resourceName) + } + + for _, missingDataSource := range missingDataSources { + if opts.ShouldIgnoreDataSource(missingDataSource) { + continue + } + + err := fmt.Errorf("%s: missing side navigation link for data source: %s", path, missingDataSource) + result = multierror.Append(result, err) + } + + for _, missingResource := range missingResources { + if opts.ShouldIgnoreResource(missingResource) { + continue + } + + err := fmt.Errorf("%s: missing side navigation link for resource: %s", path, missingResource) + result = multierror.Append(result, err) + } + + return result.ErrorOrNil() +} diff --git a/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation_options.go b/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation_options.go new file mode 100644 index 00000000000..df9140cf5eb --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/check/sidenavigation_options.go @@ -0,0 +1,30 @@ +package check + +type SideNavigationOptions struct { + *FileOptions + + IgnoreDataSources []string + IgnoreResources []string + + ProviderName string +} + +func (opts *SideNavigationOptions) ShouldIgnoreDataSource(name string) bool { + for _, ignoreDataSource := range opts.IgnoreDataSources { + if ignoreDataSource == name { + return true + } + } + + return false +} + +func (opts *SideNavigationOptions) ShouldIgnoreResource(name string) bool { + for _, ignoreResource := range opts.IgnoreResources { + if ignoreResource == name { + return true + } + } + + return false +} diff --git a/vendor/github.com/bflad/tfproviderdocs/command/check.go b/vendor/github.com/bflad/tfproviderdocs/command/check.go new file mode 100644 index 00000000000..d83d8aca8f0 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/command/check.go @@ -0,0 +1,382 @@ +package command + +import ( + "bufio" + "bytes" + "encoding/json" + "flag" + "fmt" + "io/ioutil" + "log" + "os" + "path/filepath" + "sort" + "strings" + "text/tabwriter" + + "github.com/bflad/tfproviderdocs/check" + tfjson "github.com/hashicorp/terraform-json" + "github.com/mitchellh/cli" +) + +type CheckCommandConfig struct { + AllowedGuideSubcategories string + AllowedGuideSubcategoriesFile string + AllowedResourceSubcategories string + AllowedResourceSubcategoriesFile string + IgnoreSideNavigationDataSources string + IgnoreSideNavigationResources string + LogLevel string + Path string + ProviderName string + ProvidersSchemaJson string + RequireGuideSubcategory bool + RequireResourceSubcategory bool +} + +// CheckCommand is a Command implementation +type CheckCommand struct { + Ui cli.Ui +} + +func (*CheckCommand) Help() string { + optsBuffer := bytes.NewBuffer([]byte{}) + opts := tabwriter.NewWriter(optsBuffer, 0, 0, 1, ' ', 0) + LogLevelFlagHelp(opts) + fmt.Fprintf(opts, CommandHelpOptionFormat, "-allowed-guide-subcategories", "Comma separated list of allowed guide frontmatter subcategories.") + fmt.Fprintf(opts, CommandHelpOptionFormat, "-allowed-guide-subcategories-file", "Path to newline separated file of allowed guide frontmatter subcategories.") + fmt.Fprintf(opts, CommandHelpOptionFormat, "-allowed-resource-subcategories", "Comma separated list of allowed data source and resource frontmatter subcategories.") + fmt.Fprintf(opts, CommandHelpOptionFormat, "-allowed-resource-subcategories-file", "Path to newline separated file of allowed data source and resource frontmatter subcategories.") + fmt.Fprintf(opts, CommandHelpOptionFormat, "-ignore-side-navigation-data-sources", "Comma separated list of data sources to ignore side navigation validation.") + fmt.Fprintf(opts, CommandHelpOptionFormat, "-ignore-side-navigation-resources", "Comma separated list of resources to ignore side navigation validation.") + fmt.Fprintf(opts, CommandHelpOptionFormat, "-provider-name", "Terraform Provider name. Automatically determined if current working directory or provided path is prefixed with terraform-provider-*.") + fmt.Fprintf(opts, CommandHelpOptionFormat, "-providers-schema-json", "Path to terraform providers schema -json file. Enables enhanced validations.") + fmt.Fprintf(opts, CommandHelpOptionFormat, "-require-guide-subcategory", "Require guide frontmatter subcategory.") + fmt.Fprintf(opts, CommandHelpOptionFormat, "-require-resource-subcategory", "Require data source and resource frontmatter subcategory.") + opts.Flush() + + helpText := fmt.Sprintf(` +Usage: tfproviderdocs check [options] [PATH] + + Performs documentation directory and file checks against the given Terraform Provider codebase. + +Options: + +%s +`, optsBuffer.String()) + + return strings.TrimSpace(helpText) +} + +func (c *CheckCommand) Name() string { return "check" } + +func (c *CheckCommand) Run(args []string) int { + var config CheckCommandConfig + + flags := flag.NewFlagSet(c.Name(), flag.ContinueOnError) + flags.Usage = func() { c.Ui.Info(c.Help()) } + LogLevelFlag(flags, &config.LogLevel) + flags.StringVar(&config.AllowedGuideSubcategories, "allowed-guide-subcategories", "", "") + flags.StringVar(&config.AllowedGuideSubcategoriesFile, "allowed-guide-subcategories-file", "", "") + flags.StringVar(&config.AllowedResourceSubcategories, "allowed-resource-subcategories", "", "") + flags.StringVar(&config.AllowedResourceSubcategoriesFile, "allowed-resource-subcategories-file", "", "") + flags.StringVar(&config.IgnoreSideNavigationDataSources, "ignore-side-navigation-data-sources", "", "") + flags.StringVar(&config.IgnoreSideNavigationResources, "ignore-side-navigation-resources", "", "") + flags.StringVar(&config.ProviderName, "provider-name", "", "") + flags.StringVar(&config.ProvidersSchemaJson, "providers-schema-json", "", "") + flags.BoolVar(&config.RequireGuideSubcategory, "require-guide-subcategory", false, "") + flags.BoolVar(&config.RequireResourceSubcategory, "require-resource-subcategory", false, "") + + if err := flags.Parse(args); err != nil { + flags.Usage() + return 1 + } + + args = flags.Args() + + if len(args) == 1 { + config.Path = args[0] + } + + ConfigureLogging(c.Name(), config.LogLevel) + + if config.ProviderName == "" { + if config.Path == "" { + config.ProviderName = providerNameFromCurrentDirectory() + } else { + config.ProviderName = providerNameFromPath(config.Path) + } + + if config.ProviderName == "" { + log.Printf("[WARN] Unable to determine provider name. Enhanced validations may fail.") + } else { + log.Printf("[DEBUG] Found provider name: %s", config.ProviderName) + } + } + + directories, err := check.GetDirectories(config.Path) + + if err != nil { + c.Ui.Error(fmt.Sprintf("Error getting Terraform Provider documentation directories: %s", err)) + return 1 + } + + if len(directories) == 0 { + if config.Path == "" { + c.Ui.Error("No Terraform Provider documentation directories found in current path") + } else { + c.Ui.Error(fmt.Sprintf("No Terraform Provider documentation directories found in path: %s", config.Path)) + } + + return 1 + } + + var allowedGuideSubcategories, allowedResourceSubcategories, ignoreSideNavigationDataSources, ignoreSideNavigationResources []string + + if v := config.AllowedGuideSubcategories; v != "" { + allowedGuideSubcategories = strings.Split(v, ",") + } + + if v := config.AllowedGuideSubcategoriesFile; v != "" { + var err error + allowedGuideSubcategories, err = allowedSubcategoriesFile(v) + + if err != nil { + c.Ui.Error(fmt.Sprintf("Error getting allowed guide subcategories: %s", err)) + return 1 + } + } + + if v := config.AllowedResourceSubcategories; v != "" { + allowedResourceSubcategories = strings.Split(v, ",") + } + + if v := config.AllowedResourceSubcategoriesFile; v != "" { + var err error + allowedResourceSubcategories, err = allowedSubcategoriesFile(v) + + if err != nil { + c.Ui.Error(fmt.Sprintf("Error getting allowed resource subcategories: %s", err)) + return 1 + } + } + + if v := config.IgnoreSideNavigationDataSources; v != "" { + ignoreSideNavigationDataSources = strings.Split(v, ",") + } + + if v := config.IgnoreSideNavigationResources; v != "" { + ignoreSideNavigationResources = strings.Split(v, ",") + } + + fileOpts := &check.FileOptions{ + BasePath: config.Path, + } + checkOpts := &check.CheckOptions{ + LegacyDataSourceFile: &check.LegacyDataSourceFileOptions{ + FileOptions: fileOpts, + FrontMatter: &check.FrontMatterOptions{ + AllowedSubcategories: allowedResourceSubcategories, + RequireSubcategory: config.RequireResourceSubcategory, + }, + }, + LegacyGuideFile: &check.LegacyGuideFileOptions{ + FileOptions: fileOpts, + FrontMatter: &check.FrontMatterOptions{ + AllowedSubcategories: allowedGuideSubcategories, + RequireSubcategory: config.RequireGuideSubcategory, + }, + }, + LegacyIndexFile: &check.LegacyIndexFileOptions{ + FileOptions: fileOpts, + }, + LegacyResourceFile: &check.LegacyResourceFileOptions{ + FileOptions: fileOpts, + FrontMatter: &check.FrontMatterOptions{ + AllowedSubcategories: allowedResourceSubcategories, + RequireSubcategory: config.RequireResourceSubcategory, + }, + }, + ProviderName: config.ProviderName, + RegistryDataSourceFile: &check.RegistryDataSourceFileOptions{ + FileOptions: fileOpts, + FrontMatter: &check.FrontMatterOptions{ + AllowedSubcategories: allowedResourceSubcategories, + RequireSubcategory: config.RequireResourceSubcategory, + }, + }, + RegistryGuideFile: &check.RegistryGuideFileOptions{ + FileOptions: fileOpts, + FrontMatter: &check.FrontMatterOptions{ + AllowedSubcategories: allowedGuideSubcategories, + RequireSubcategory: config.RequireGuideSubcategory, + }, + }, + RegistryIndexFile: &check.RegistryIndexFileOptions{ + FileOptions: fileOpts, + }, + RegistryResourceFile: &check.RegistryResourceFileOptions{ + FileOptions: fileOpts, + FrontMatter: &check.FrontMatterOptions{ + AllowedSubcategories: allowedResourceSubcategories, + RequireSubcategory: config.RequireResourceSubcategory, + }, + }, + SideNavigation: &check.SideNavigationOptions{ + FileOptions: fileOpts, + IgnoreDataSources: ignoreSideNavigationDataSources, + IgnoreResources: ignoreSideNavigationResources, + ProviderName: config.ProviderName, + }, + } + + if config.ProvidersSchemaJson != "" { + ps, err := providerSchemas(config.ProvidersSchemaJson) + + if err != nil { + c.Ui.Error(fmt.Sprintf("Error enabling Terraform Provider schema checks: %s", err)) + return 1 + } + + if config.ProviderName == "" { + msg := `Unknown provider name for enabling Terraform Provider schema checks. + +Check that the current working directory or provided path is prefixed with terraform-provider-*.` + c.Ui.Error(msg) + return 1 + } + + checkOpts.SchemaDataSources = providerSchemasDataSources(ps, config.ProviderName) + checkOpts.SchemaResources = providerSchemasResources(ps, config.ProviderName) + } + + if err := check.NewCheck(checkOpts).Run(directories); err != nil { + c.Ui.Error(fmt.Sprintf("Error checking Terraform Provider documentation: %s", err)) + return 1 + } + + return 0 +} + +func (c *CheckCommand) Synopsis() string { + return "Checks Terraform Provider documentation" +} + +func allowedSubcategoriesFile(path string) ([]string, error) { + log.Printf("[DEBUG] Loading allowed subcategories file: %s", path) + + file, err := os.Open(path) + + if err != nil { + return nil, fmt.Errorf("error opening allowed subcategories file (%s): %w", path, err) + } + + defer file.Close() + scanner := bufio.NewScanner(file) + var allowedSubcategories []string + + for scanner.Scan() { + allowedSubcategories = append(allowedSubcategories, scanner.Text()) + } + + if err != nil { + return nil, fmt.Errorf("error reading allowed subcategories file (%s): %w", path, err) + } + + return allowedSubcategories, nil +} + +func providerNameFromCurrentDirectory() string { + path, _ := os.Getwd() + + return providerNameFromPath(path) +} + +func providerNameFromPath(path string) string { + base := filepath.Base(path) + + if strings.ContainsAny(base, "./") { + return "" + } + + if !strings.HasPrefix(base, "terraform-provider-") { + return "" + } + + return strings.TrimPrefix(base, "terraform-provider-") +} + +// providerSchemas reads, parses, and validates a provided terraform provider schema -json path. +func providerSchemas(path string) (*tfjson.ProviderSchemas, error) { + log.Printf("[DEBUG] Loading providers schema JSON file: %s", path) + + content, err := ioutil.ReadFile(path) + + if err != nil { + return nil, fmt.Errorf("error reading providers schema JSON file (%s): %w", path, err) + } + + var ps tfjson.ProviderSchemas + + if err := json.Unmarshal(content, &ps); err != nil { + return nil, fmt.Errorf("error parsing providers schema JSON file (%s): %w", path, err) + } + + if err := ps.Validate(); err != nil { + return nil, fmt.Errorf("error validating providers schema JSON file (%s): %w", path, err) + } + + return &ps, nil +} + +// providerSchemasDataSources returns all data sources from a terraform providers schema -json provider. +func providerSchemasDataSources(ps *tfjson.ProviderSchemas, providerName string) map[string]*tfjson.Schema { + if ps == nil || providerName == "" { + return nil + } + + provider, ok := ps.Schemas[providerName] + + if !ok { + log.Printf("[WARN] Provider name (%s) not found in provider schema", providerName) + return nil + } + + dataSources := make([]string, 0, len(provider.DataSourceSchemas)) + + for name := range provider.DataSourceSchemas { + dataSources = append(dataSources, name) + } + + sort.Strings(dataSources) + + log.Printf("[DEBUG] Found provider schema data sources: %v", dataSources) + + return provider.DataSourceSchemas +} + +// providerSchemasResources returns all resources from a terraform providers schema -json provider. +func providerSchemasResources(ps *tfjson.ProviderSchemas, providerName string) map[string]*tfjson.Schema { + if ps == nil || providerName == "" { + return nil + } + + provider, ok := ps.Schemas[providerName] + + if !ok { + log.Printf("[WARN] Provider name (%s) not found in provider schema", providerName) + return nil + } + + resources := make([]string, 0, len(provider.ResourceSchemas)) + + for name := range provider.ResourceSchemas { + resources = append(resources, name) + } + + sort.Strings(resources) + + log.Printf("[DEBUG] Found provider schema data sources: %v", resources) + + return provider.ResourceSchemas +} diff --git a/vendor/github.com/bflad/tfproviderdocs/command/commands.go b/vendor/github.com/bflad/tfproviderdocs/command/commands.go new file mode 100644 index 00000000000..8b88a7b3cbe --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/command/commands.go @@ -0,0 +1,24 @@ +package command + +import ( + "github.com/bflad/tfproviderdocs/version" + "github.com/mitchellh/cli" +) + +const CommandHelpOptionFormat = " %s\t%s\t\n" + +func Commands(ui cli.Ui) map[string]cli.CommandFactory { + return map[string]cli.CommandFactory{ + "check": func() (cli.Command, error) { + return &CheckCommand{ + Ui: ui, + }, nil + }, + "version": func() (cli.Command, error) { + return &VersionCommand{ + Version: version.GetVersion(), + Ui: ui, + }, nil + }, + } +} diff --git a/vendor/github.com/bflad/tfproviderdocs/command/logging_helpers.go b/vendor/github.com/bflad/tfproviderdocs/command/logging_helpers.go new file mode 100644 index 00000000000..81843cf3796 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/command/logging_helpers.go @@ -0,0 +1,35 @@ +package command + +import ( + "flag" + "fmt" + "log" + "text/tabwriter" + + "github.com/hashicorp/go-hclog" +) + +const ( + LogLevelFlagHelpDefinition = `-log-level=[TRACE|DEBUG|INFO|WARN|ERROR]` + LogLevelFlagHelpDescription = `Log output level.` +) + +func LogLevelFlag(flagSet *flag.FlagSet, varToSave *string) { + flagSet.StringVar(varToSave, "log-level", "INFO", "") +} + +func LogLevelFlagHelp(w *tabwriter.Writer) { + fmt.Fprintf(w, CommandHelpOptionFormat, LogLevelFlagHelpDefinition, LogLevelFlagHelpDescription) +} + +func ConfigureLogging(loggerName string, logLevel string) { + loggerOptions := &hclog.LoggerOptions{ + Name: loggerName, + Level: hclog.LevelFromString(logLevel), + } + logger := hclog.New(loggerOptions) + + log.SetOutput(logger.StandardWriter(&hclog.StandardLoggerOptions{InferLevels: true})) + log.SetPrefix("") + log.SetFlags(0) +} diff --git a/vendor/github.com/bflad/tfproviderdocs/command/version.go b/vendor/github.com/bflad/tfproviderdocs/command/version.go new file mode 100644 index 00000000000..b69117eca69 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/command/version.go @@ -0,0 +1,27 @@ +package command + +import ( + "github.com/bflad/tfproviderdocs/version" + "github.com/mitchellh/cli" +) + +// VersionCommand is a Command implementation prints the version. +type VersionCommand struct { + Version *version.VersionInfo + Ui cli.Ui +} + +func (c *VersionCommand) Help() string { + return "" +} + +func (c *VersionCommand) Name() string { return "version" } + +func (c *VersionCommand) Run(_ []string) int { + c.Ui.Output(c.Version.FullVersionNumber(true)) + return 0 +} + +func (c *VersionCommand) Synopsis() string { + return "Prints the version" +} diff --git a/vendor/github.com/bflad/tfproviderdocs/go.mod b/vendor/github.com/bflad/tfproviderdocs/go.mod new file mode 100644 index 00000000000..11196dd4f7a --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/go.mod @@ -0,0 +1,14 @@ +module github.com/bflad/tfproviderdocs + +go 1.13 + +require ( + github.com/bmatcuk/doublestar v1.2.1 + github.com/hashicorp/go-hclog v0.10.0 + github.com/hashicorp/go-multierror v1.0.0 + github.com/hashicorp/terraform-json v0.3.1 + github.com/mattn/go-colorable v0.1.4 + github.com/mitchellh/cli v1.0.0 + golang.org/x/net v0.0.0-20180811021610-c39426892332 + gopkg.in/yaml.v2 v2.2.7 +) diff --git a/vendor/github.com/bflad/tfproviderdocs/go.sum b/vendor/github.com/bflad/tfproviderdocs/go.sum new file mode 100644 index 00000000000..915d3453fb2 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/go.sum @@ -0,0 +1,60 @@ +github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 h1:BUAU3CGlLvorLI26FmByPp2eC2qla6E1Tw+scpcg/to= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bmatcuk/doublestar v1.2.1 h1:eetYiv8DDYOZcBADY+pRvRytf3Dlz1FhnpvL2FsClBc= +github.com/bmatcuk/doublestar v1.2.1/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-hclog v0.10.0 h1:b86HUuA126IcSHyC55WjPo7KtCOVeTCKIjr+3lBhPxI= +github.com/hashicorp/go-hclog v0.10.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/terraform-json v0.3.1 h1:vRiOLck4YX4UqzljVhdQKsVLixX4L+Pgnm/q+xu6QvE= +github.com/hashicorp/terraform-json v0.3.1/go.mod h1:MdwQStcJb00ht55L/2YH0ypAO9RNtczJ1MaUlf+gJcg= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1 h1:ccV59UEOTzVDnDUEFdT95ZzHVZ+5+158q8+SJb2QV5w= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/zclconf/go-cty v0.0.0-20190430221426-d36a6f0dbffd h1:NZOOU7h+pDtcKo6xlqm8PwnarS8nJ+6+I83jT8ZfLPI= +github.com/zclconf/go-cty v0.0.0-20190430221426-d36a6f0dbffd/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= +golang.org/x/net v0.0.0-20180811021610-c39426892332 h1:efGso+ep0DjyCBJPjvoz0HI6UldX4Md2F1rZFe1ir0E= +golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo= +gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/bflad/tfproviderdocs/main.go b/vendor/github.com/bflad/tfproviderdocs/main.go new file mode 100644 index 00000000000..324460920aa --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/main.go @@ -0,0 +1,44 @@ +package main + +import ( + "fmt" + "os" + + "github.com/bflad/tfproviderdocs/command" + "github.com/bflad/tfproviderdocs/version" + "github.com/mattn/go-colorable" + "github.com/mitchellh/cli" +) + +const ( + Name = `tfproviderdocs` +) + +func main() { + ui := &cli.ColoredUi{ + ErrorColor: cli.UiColorRed, + WarnColor: cli.UiColorYellow, + InfoColor: cli.UiColorGreen, + Ui: &cli.BasicUi{ + Reader: os.Stdin, + Writer: colorable.NewColorableStdout(), + ErrorWriter: colorable.NewColorableStderr(), + }, + } + + c := &cli.CLI{ + Name: Name, + Version: version.GetVersion().FullVersionNumber(true), + Args: os.Args[1:], + Commands: command.Commands(ui), + } + + exitStatus, err := c.Run() + + if err != nil { + fmt.Fprintf(os.Stderr, "Error executing CLI: %s\n", err.Error()) + os.Exit(1) + } + + os.Exit(exitStatus) +} diff --git a/vendor/github.com/bflad/tfproviderdocs/version/version.go b/vendor/github.com/bflad/tfproviderdocs/version/version.go new file mode 100644 index 00000000000..b435d323504 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderdocs/version/version.go @@ -0,0 +1,84 @@ +package version + +import ( + "bytes" + "fmt" +) + +var ( + // The git commit that was compiled. This will be filled in by the compiler. + GitCommit string + GitDescribe string + + // The main version number that is being run at the moment. + Version = "0.5.0" + + // 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. + VersionPrerelease = "dev" + + // VersionMetadata is metadata further describing the build type. + VersionMetadata = "" +) + +// VersionInfo +type VersionInfo struct { + Revision string + Version string + VersionPrerelease string + VersionMetadata string +} + +func GetVersion() *VersionInfo { + ver := Version + rel := VersionPrerelease + md := VersionMetadata + if GitDescribe != "" { + ver = GitDescribe + } + if GitDescribe == "" && rel == "" && VersionPrerelease != "" { + rel = "dev" + } + + return &VersionInfo{ + Revision: GitCommit, + Version: ver, + VersionPrerelease: rel, + VersionMetadata: md, + } +} + +func (c *VersionInfo) VersionNumber() string { + version := c.Version + + if c.VersionPrerelease != "" { + version = fmt.Sprintf("%s-%s", version, c.VersionPrerelease) + } + + if c.VersionMetadata != "" { + version = fmt.Sprintf("%s+%s", version, c.VersionMetadata) + } + + return version +} + +func (c *VersionInfo) FullVersionNumber(rev bool) string { + var versionString bytes.Buffer + + fmt.Fprintf(&versionString, "v%s", c.Version) + + if c.VersionPrerelease != "" { + fmt.Fprintf(&versionString, "-%s", c.VersionPrerelease) + } + + if c.VersionMetadata != "" { + fmt.Fprintf(&versionString, "+%s", c.VersionMetadata) + } + + if rev && c.Revision != "" { + fmt.Fprintf(&versionString, " (%s)", c.Revision) + } + + return versionString.String() +} diff --git a/vendor/github.com/bflad/tfproviderlint/LICENSE b/vendor/github.com/bflad/tfproviderlint/LICENSE new file mode 100644 index 00000000000..a612ad9813b --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/LICENSE @@ -0,0 +1,373 @@ +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/bflad/tfproviderlint/cmd/tfproviderlint/tfproviderlint.go b/vendor/github.com/bflad/tfproviderlint/cmd/tfproviderlint/tfproviderlint.go index 24e6eecdc01..d266895b208 100644 --- a/vendor/github.com/bflad/tfproviderlint/cmd/tfproviderlint/tfproviderlint.go +++ b/vendor/github.com/bflad/tfproviderlint/cmd/tfproviderlint/tfproviderlint.go @@ -7,65 +7,13 @@ package main import ( + "github.com/bflad/tfproviderlint/helper/cmdflags" + "github.com/bflad/tfproviderlint/passes" "golang.org/x/tools/go/analysis/multichecker" - - "github.com/bflad/tfproviderlint/passes/AT001" - "github.com/bflad/tfproviderlint/passes/AT002" - "github.com/bflad/tfproviderlint/passes/AT003" - "github.com/bflad/tfproviderlint/passes/AT004" - "github.com/bflad/tfproviderlint/passes/R001" - "github.com/bflad/tfproviderlint/passes/R002" - "github.com/bflad/tfproviderlint/passes/R003" - "github.com/bflad/tfproviderlint/passes/R004" - "github.com/bflad/tfproviderlint/passes/S001" - "github.com/bflad/tfproviderlint/passes/S002" - "github.com/bflad/tfproviderlint/passes/S003" - "github.com/bflad/tfproviderlint/passes/S004" - "github.com/bflad/tfproviderlint/passes/S005" - "github.com/bflad/tfproviderlint/passes/S006" - "github.com/bflad/tfproviderlint/passes/S007" - "github.com/bflad/tfproviderlint/passes/S008" - "github.com/bflad/tfproviderlint/passes/S009" - "github.com/bflad/tfproviderlint/passes/S010" - "github.com/bflad/tfproviderlint/passes/S011" - "github.com/bflad/tfproviderlint/passes/S012" - "github.com/bflad/tfproviderlint/passes/S013" - "github.com/bflad/tfproviderlint/passes/S014" - "github.com/bflad/tfproviderlint/passes/S015" - "github.com/bflad/tfproviderlint/passes/S016" - "github.com/bflad/tfproviderlint/passes/S017" - "github.com/bflad/tfproviderlint/passes/S018" - "github.com/bflad/tfproviderlint/passes/S019" ) func main() { - multichecker.Main( - AT001.Analyzer, - AT002.Analyzer, - AT003.Analyzer, - AT004.Analyzer, - R001.Analyzer, - R002.Analyzer, - R003.Analyzer, - R004.Analyzer, - S001.Analyzer, - S002.Analyzer, - S003.Analyzer, - S004.Analyzer, - S005.Analyzer, - S006.Analyzer, - S007.Analyzer, - S008.Analyzer, - S009.Analyzer, - S010.Analyzer, - S011.Analyzer, - S012.Analyzer, - S013.Analyzer, - S014.Analyzer, - S015.Analyzer, - S016.Analyzer, - S017.Analyzer, - S018.Analyzer, - S019.Analyzer, - ) + cmdflags.AddVersionFlag() + + multichecker.Main(passes.AllChecks...) } diff --git a/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/analyzers.go b/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/analyzers.go new file mode 100644 index 00000000000..0041b098bdf --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/analyzers.go @@ -0,0 +1,121 @@ +package analysisutils + +import ( + "fmt" + "go/ast" + "go/types" + "reflect" + + "github.com/bflad/tfproviderlint/passes/commentignore" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" +) + +// DeprecatedReceiverMethodSelectorExprAnalyzer returns an Analyzer for deprecated *ast.SelectorExpr +func DeprecatedReceiverMethodSelectorExprAnalyzer(analyzerName string, selectorExprAnalyzer *analysis.Analyzer, packageName, typeName, methodName string) *analysis.Analyzer { + doc := fmt.Sprintf(`check for deprecated %[2]s.%[3]s usage + +The %[1]s analyzer reports usage of the deprecated: + +%[2]s.%[3]s +`, analyzerName, packageName, typeName, methodName) + + return &analysis.Analyzer{ + Name: analyzerName, + Doc: doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + selectorExprAnalyzer, + }, + Run: DeprecatedReceiverMethodSelectorExprRunner(analyzerName, selectorExprAnalyzer, packageName, typeName, methodName), + } +} + +// DeprecatedWithReplacementSelectorExprAnalyzer returns an Analyzer for deprecated *ast.SelectorExpr with replacement +func DeprecatedWithReplacementSelectorExprAnalyzer(analyzerName string, selectorExprAnalyzer *analysis.Analyzer, oldPackageName, oldSelectorName, newPackageName, newSelectorName string) *analysis.Analyzer { + doc := fmt.Sprintf(`check for deprecated %[2]s.%[3]s usage + +The %[1]s analyzer reports usage of the deprecated: + +%[2]s.%[3]s + +That should be replaced with: + +%[4]s.%[5]s +`, analyzerName, oldPackageName, oldSelectorName, newPackageName, newSelectorName) + + return &analysis.Analyzer{ + Name: analyzerName, + Doc: doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + selectorExprAnalyzer, + }, + Run: DeprecatedWithReplacementSelectorExprRunner(analyzerName, selectorExprAnalyzer, oldPackageName, oldSelectorName, newPackageName, newSelectorName), + } +} + +// FunctionCallExprAnalyzer returns an Analyzer for function *ast.CallExpr +func FunctionCallExprAnalyzer(analyzerName string, packageFunc func(ast.Expr, *types.Info, string) bool, packagePath string, functionName string) *analysis.Analyzer { + return &analysis.Analyzer{ + Name: analyzerName, + Doc: fmt.Sprintf("find %s.%s calls for later passes", packagePath, functionName), + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: FunctionCallExprRunner(packageFunc, functionName), + ResultType: reflect.TypeOf([]*ast.CallExpr{}), + } +} + +// ReceiverMethodAssignStmtAnalyzer returns an Analyzer for receiver method *ast.AssignStmt +func ReceiverMethodAssignStmtAnalyzer(analyzerName string, packageReceiverMethodFunc func(ast.Expr, *types.Info, string, string) bool, packagePath string, receiverName string, methodName string) *analysis.Analyzer { + return &analysis.Analyzer{ + Name: analyzerName, + Doc: fmt.Sprintf("find (%s.%s).%s assignments for later passes", packagePath, receiverName, methodName), + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: ReceiverMethodAssignStmtRunner(packageReceiverMethodFunc, receiverName, methodName), + ResultType: reflect.TypeOf([]*ast.AssignStmt{}), + } +} + +// ReceiverMethodCallExprAnalyzer returns an Analyzer for receiver method *ast.CallExpr +func ReceiverMethodCallExprAnalyzer(analyzerName string, packageReceiverMethodFunc func(ast.Expr, *types.Info, string, string) bool, packagePath string, receiverName string, methodName string) *analysis.Analyzer { + return &analysis.Analyzer{ + Name: analyzerName, + Doc: fmt.Sprintf("find (%s.%s).%s calls for later passes", packagePath, receiverName, methodName), + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: ReceiverMethodCallExprRunner(packageReceiverMethodFunc, receiverName, methodName), + ResultType: reflect.TypeOf([]*ast.CallExpr{}), + } +} + +// ReceiverMethodSelectorExprAnalyzer returns an Analyzer for receiver method *ast.SelectorExpr +func ReceiverMethodSelectorExprAnalyzer(analyzerName string, packageReceiverMethodFunc func(ast.Expr, *types.Info, string, string) bool, packagePath string, receiverName string, methodName string) *analysis.Analyzer { + return &analysis.Analyzer{ + Name: analyzerName, + Doc: fmt.Sprintf("find (%s.%s).%s calls for later passes", packagePath, receiverName, methodName), + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: ReceiverMethodSelectorExprRunner(packageReceiverMethodFunc, receiverName, methodName), + ResultType: reflect.TypeOf([]*ast.SelectorExpr{}), + } +} + +// SelectorExprAnalyzer returns an Analyzer for *ast.SelectorExpr +func SelectorExprAnalyzer(analyzerName string, packageFunc func(ast.Expr, *types.Info, string) bool, packagePath string, selectorName string) *analysis.Analyzer { + return &analysis.Analyzer{ + Name: analyzerName, + Doc: fmt.Sprintf("find %s.%s usage for later passes", packagePath, selectorName), + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: SelectorExprRunner(packageFunc, selectorName), + ResultType: reflect.TypeOf([]*ast.SelectorExpr{}), + } +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/runners.go b/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/runners.go new file mode 100644 index 00000000000..dc95ca5c91e --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/analysisutils/runners.go @@ -0,0 +1,172 @@ +package analysisutils + +import ( + "go/ast" + "go/types" + + "github.com/bflad/tfproviderlint/passes/commentignore" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +// DeprecatedReceiverMethodSelectorExprRunner returns an Analyzer runner for deprecated *ast.SelectorExpr +func DeprecatedReceiverMethodSelectorExprRunner(analyzerName string, selectorExprAnalyzer *analysis.Analyzer, packageName, typeName, methodName string) func(*analysis.Pass) (interface{}, error) { + return func(pass *analysis.Pass) (interface{}, error) { + selectorExprs := pass.ResultOf[selectorExprAnalyzer].([]*ast.SelectorExpr) + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + + for _, selectorExpr := range selectorExprs { + if ignorer.ShouldIgnore(analyzerName, selectorExpr) { + continue + } + + pass.Reportf(selectorExpr.Pos(), "%s: deprecated (%s.%s).%s", analyzerName, packageName, typeName, methodName) + } + + return nil, nil + } +} + +// DeprecatedWithReplacementSelectorExprRunner returns an Analyzer runner for deprecated *ast.SelectorExpr with replacement +func DeprecatedWithReplacementSelectorExprRunner(analyzerName string, selectorExprAnalyzer *analysis.Analyzer, oldPackageName, oldSelectorName, newPackageName, newSelectorName string) func(*analysis.Pass) (interface{}, error) { + return func(pass *analysis.Pass) (interface{}, error) { + selectorExprs := pass.ResultOf[selectorExprAnalyzer].([]*ast.SelectorExpr) + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + + for _, selectorExpr := range selectorExprs { + if ignorer.ShouldIgnore(analyzerName, selectorExpr) { + continue + } + + pass.Reportf(selectorExpr.Pos(), "%s: deprecated %s.%s should be replaced with %s.%s", analyzerName, oldPackageName, oldSelectorName, newPackageName, newSelectorName) + } + + return nil, nil + } +} + +// FunctionCallExprRunner returns an Analyzer runner for function *ast.CallExpr +func FunctionCallExprRunner(packageFunc func(ast.Expr, *types.Info, string) bool, functionName string) func(*analysis.Pass) (interface{}, error) { + return func(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.CallExpr)(nil), + } + var result []*ast.CallExpr + + inspect.Preorder(nodeFilter, func(n ast.Node) { + callExpr := n.(*ast.CallExpr) + + if !packageFunc(callExpr.Fun, pass.TypesInfo, functionName) { + return + } + + result = append(result, callExpr) + }) + + return result, nil + } +} + +// ReceiverMethodAssignStmtRunner returns an Analyzer runner for receiver method *ast.AssignStmt +func ReceiverMethodAssignStmtRunner(packageReceiverMethodFunc func(ast.Expr, *types.Info, string, string) bool, receiverName string, methodName string) func(*analysis.Pass) (interface{}, error) { + return func(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.AssignStmt)(nil), + } + var result []*ast.AssignStmt + + inspect.Preorder(nodeFilter, func(n ast.Node) { + assignStmt := n.(*ast.AssignStmt) + + if len(assignStmt.Rhs) != 1 { + return + } + + callExpr, ok := assignStmt.Rhs[0].(*ast.CallExpr) + + if !ok { + return + } + + if !packageReceiverMethodFunc(callExpr.Fun, pass.TypesInfo, receiverName, methodName) { + return + } + + result = append(result, assignStmt) + }) + + return result, nil + } +} + +// ReceiverMethodCallExprRunner returns an Analyzer runner for receiver method *ast.CallExpr +func ReceiverMethodCallExprRunner(packageReceiverMethodFunc func(ast.Expr, *types.Info, string, string) bool, receiverName string, methodName string) func(*analysis.Pass) (interface{}, error) { + return func(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.CallExpr)(nil), + } + var result []*ast.CallExpr + + inspect.Preorder(nodeFilter, func(n ast.Node) { + callExpr := n.(*ast.CallExpr) + + if !packageReceiverMethodFunc(callExpr.Fun, pass.TypesInfo, receiverName, methodName) { + return + } + + result = append(result, callExpr) + }) + + return result, nil + } +} + +// ReceiverMethodSelectorExprRunner returns an Analyzer runner for receiver method *ast.SelectorExpr +func ReceiverMethodSelectorExprRunner(packageReceiverMethodFunc func(ast.Expr, *types.Info, string, string) bool, receiverName string, methodName string) func(*analysis.Pass) (interface{}, error) { + return func(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.SelectorExpr)(nil), + } + var result []*ast.SelectorExpr + + inspect.Preorder(nodeFilter, func(n ast.Node) { + selectorExpr := n.(*ast.SelectorExpr) + + if !packageReceiverMethodFunc(selectorExpr, pass.TypesInfo, receiverName, methodName) { + return + } + + result = append(result, selectorExpr) + }) + + return result, nil + } +} + +// SelectorExprRunner returns an Analyzer runner for *ast.SelectorExpr +func SelectorExprRunner(packageFunc func(ast.Expr, *types.Info, string) bool, selectorName string) func(*analysis.Pass) (interface{}, error) { + return func(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.SelectorExpr)(nil), + } + var result []*ast.SelectorExpr + + inspect.Preorder(nodeFilter, func(n ast.Node) { + selectorExpr := n.(*ast.SelectorExpr) + + if !packageFunc(selectorExpr, pass.TypesInfo, selectorName) { + return + } + + result = append(result, selectorExpr) + }) + + return result, nil + } +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/astutils/basiclit.go b/vendor/github.com/bflad/tfproviderlint/helper/astutils/basiclit.go new file mode 100644 index 00000000000..94cee53a9a7 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/astutils/basiclit.go @@ -0,0 +1,71 @@ +package astutils + +import ( + "go/ast" + "strconv" + "strings" +) + +// ExprBoolValue fetches a bool value from the Expr +// If the Expr cannot parse as a bool, returns nil. +func ExprBoolValue(e ast.Expr) *bool { + switch v := e.(type) { + case *ast.Ident: + stringValue := v.Name + boolValue, err := strconv.ParseBool(stringValue) + + if err != nil { + return nil + } + + return &boolValue + } + + return nil +} + +// ExprIntValue fetches an int value from the Expr +// If the Expr cannot parse as an int, returns nil. +func ExprIntValue(e ast.Expr) *int { + switch v := e.(type) { + case *ast.BasicLit: + stringValue := strings.Trim(v.Value, `"`) + intValue, err := strconv.Atoi(stringValue) + + if err != nil { + return nil + } + + return &intValue + } + + return nil +} + +// ExprStringValue fetches a string value from the Expr +// If the Expr is not BasicLit, returns an empty string. +func ExprStringValue(e ast.Expr) *string { + switch v := e.(type) { + case *ast.BasicLit: + stringValue := strings.Trim(v.Value, `"`) + + return &stringValue + } + + return nil +} + +// ExprValue fetches a pointer to the Expr +// If the Expr is nil, returns nil +func ExprValue(e ast.Expr) *ast.Expr { + switch v := e.(type) { + case *ast.Ident: + if v.Name == "nil" { + return nil + } + + return &e + default: + return &e + } +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/astutils/compositelit.go b/vendor/github.com/bflad/tfproviderlint/helper/astutils/compositelit.go new file mode 100644 index 00000000000..8495dba21f4 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/astutils/compositelit.go @@ -0,0 +1,80 @@ +package astutils + +import ( + "go/ast" +) + +func CompositeLitField(cl *ast.CompositeLit, fieldName string) *ast.KeyValueExpr { + for _, elt := range cl.Elts { + switch e := elt.(type) { + case *ast.KeyValueExpr: + if e.Key.(*ast.Ident).Name != fieldName { + continue + } + + return e + } + } + + return nil +} + +func CompositeLitFields(cl *ast.CompositeLit) map[string]*ast.KeyValueExpr { + result := make(map[string]*ast.KeyValueExpr, len(cl.Elts)) + + for _, elt := range cl.Elts { + switch e := elt.(type) { + case *ast.KeyValueExpr: + result[e.Key.(*ast.Ident).Name] = e + } + } + + return result +} + +func CompositeLitFieldBoolValue(cl *ast.CompositeLit, fieldName string) *bool { + kvExpr := CompositeLitField(cl, fieldName) + + if kvExpr == nil { + return nil + } + + return ExprBoolValue(kvExpr.Value) +} + +func CompositeLitFieldExprValue(cl *ast.CompositeLit, fieldName string) *ast.Expr { + kvExpr := CompositeLitField(cl, fieldName) + + if kvExpr == nil { + return nil + } + + return ExprValue(kvExpr.Value) +} + +func CompositeLitFieldIntValue(cl *ast.CompositeLit, fieldName string) *int { + kvExpr := CompositeLitField(cl, fieldName) + + if kvExpr == nil { + return nil + } + + return ExprIntValue(kvExpr.Value) +} + +func CompositeLitContainsAnyField(cl *ast.CompositeLit, fieldNames ...string) bool { + for _, elt := range cl.Elts { + switch e := elt.(type) { + case *ast.KeyValueExpr: + name := e.Key.(*ast.Ident).Name + + for _, field := range fieldNames { + if name == field { + return true + } + } + } + } + + return false +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/astutils/fieldlist.go b/vendor/github.com/bflad/tfproviderlint/helper/astutils/fieldlist.go new file mode 100644 index 00000000000..81e19bab279 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/astutils/fieldlist.go @@ -0,0 +1,75 @@ +package astutils + +import ( + "go/ast" + "go/types" +) + +// FieldListName returns field name at field position and name position if found +func FieldListName(fieldList *ast.FieldList, fieldPosition int, namePosition int) *string { + names := FieldListNames(fieldList, fieldPosition) + + if names == nil || len(names) <= namePosition { + return nil + } + + name := names[namePosition] + + if name == nil { + return nil + } + + return &name.Name +} + +// FieldListNames returns field names at field position if found +func FieldListNames(fieldList *ast.FieldList, position int) []*ast.Ident { + if fieldList == nil { + return nil + } + + if len(fieldList.List) <= position { + return nil + } + + field := fieldList.List[position] + + if field == nil { + return nil + } + + return field.Names +} + +// FieldListType returns type at field position if found +func FieldListType(fieldList *ast.FieldList, position int) *ast.Expr { + if fieldList == nil { + return nil + } + + if len(fieldList.List) <= position { + return nil + } + + field := fieldList.List[position] + + if field == nil { + return nil + } + + return &field.Type +} + +// IsFieldListType returns true if the field at position is present and matches expected ast.Expr +func IsFieldListType(fieldList *ast.FieldList, position int, exprFunc func(ast.Expr) bool) bool { + t := FieldListType(fieldList, position) + + return t != nil && exprFunc(*t) +} + +// IsFieldListTypePackageType returns true if the field at position is present and matches expected package type +func IsFieldListTypePackageType(fieldList *ast.FieldList, position int, info *types.Info, packageSuffix string, typeName string) bool { + t := FieldListType(fieldList, position) + + return t != nil && IsPackageFunctionFieldListType(*t, info, packageSuffix, typeName) +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/astutils/function_parameters.go b/vendor/github.com/bflad/tfproviderlint/helper/astutils/function_parameters.go new file mode 100644 index 00000000000..941b88dcc50 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/astutils/function_parameters.go @@ -0,0 +1,40 @@ +package astutils + +import ( + "go/ast" +) + +// IsFunctionParameterTypeArrayString returns true if the expression matches []string +func IsFunctionParameterTypeArrayString(e ast.Expr) bool { + arrayType, ok := e.(*ast.ArrayType) + + return ok && IsFunctionParameterTypeString(arrayType.Elt) +} + +// IsFunctionParameterTypeArrayError returns true if the expression matches []error +func IsFunctionParameterTypeArrayError(e ast.Expr) bool { + arrayType, ok := e.(*ast.ArrayType) + + return ok && IsFunctionParameterTypeError(arrayType.Elt) +} + +// IsFunctionParameterTypeError returns true if the expression matches string +func IsFunctionParameterTypeError(e ast.Expr) bool { + ident, ok := e.(*ast.Ident) + + return ok && ident.Name == "error" +} + +// IsFunctionParameterTypeInterface returns true if the expression matches interface{} +func IsFunctionParameterTypeInterface(e ast.Expr) bool { + _, ok := e.(*ast.InterfaceType) + + return ok +} + +// IsFunctionParameterTypeString returns true if the expression matches string +func IsFunctionParameterTypeString(e ast.Expr) bool { + ident, ok := e.(*ast.Ident) + + return ok && ident.Name == "string" +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/astutils/functype.go b/vendor/github.com/bflad/tfproviderlint/helper/astutils/functype.go new file mode 100644 index 00000000000..4272dba9016 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/astutils/functype.go @@ -0,0 +1,16 @@ +package astutils + +import ( + "go/ast" +) + +func FuncTypeFromNode(node ast.Node) *ast.FuncType { + switch node := node.(type) { + case *ast.FuncDecl: + return node.Type + case *ast.FuncLit: + return node.Type + } + + return nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/astutils/package.go b/vendor/github.com/bflad/tfproviderlint/helper/astutils/package.go new file mode 100644 index 00000000000..e983b9d6bdf --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/astutils/package.go @@ -0,0 +1,79 @@ +package astutils + +import ( + "go/ast" + "go/types" + "strings" +) + +// IsPackageReceiverMethod returns true if the package suffix (for vendoring), receiver name, and method name match +func IsPackageReceiverMethod(e ast.Expr, info *types.Info, packageSuffix string, receiverName, methodName string) bool { + switch e := e.(type) { + case *ast.SelectorExpr: + if e.Sel.Name != methodName { + return false + } + + return IsPackageType(info.TypeOf(e.X), packageSuffix, receiverName) + } + + return false +} + +// IsPackageFunc returns true if the function package suffix (for vendoring) and name matches +func IsPackageFunc(e ast.Expr, info *types.Info, packageSuffix string, funcName string) bool { + switch e := e.(type) { + case *ast.SelectorExpr: + if e.Sel.Name != funcName { + return false + } + + switch x := e.X.(type) { + case *ast.Ident: + return strings.HasSuffix(info.ObjectOf(x).(*types.PkgName).Imported().Path(), packageSuffix) + } + } + + return false +} + +// IsPackageFunctionFieldListType returns true if the function parameter package suffix (for vendoring) and name matches +func IsPackageFunctionFieldListType(e ast.Expr, info *types.Info, packageSuffix string, typeName string) bool { + switch e := e.(type) { + case *ast.SelectorExpr: + if e.Sel.Name != typeName { + return false + } + + switch x := e.X.(type) { + case *ast.Ident: + return strings.HasSuffix(info.ObjectOf(x).(*types.PkgName).Imported().Path(), packageSuffix) + } + case *ast.StarExpr: + return IsPackageFunctionFieldListType(e.X, info, packageSuffix, typeName) + } + + return false +} + +// IsPackageNamedType returns if the type name matches and is from the package suffix +func IsPackageNamedType(t *types.Named, packageSuffix string, typeName string) bool { + if t.Obj().Name() != typeName { + return false + } + + // HasSuffix here due to vendoring + return strings.HasSuffix(t.Obj().Pkg().Path(), packageSuffix) +} + +// IsPackageType returns true if the type name can be matched and is from the package suffix +func IsPackageType(t types.Type, packageSuffix string, typeName string) bool { + switch t := t.(type) { + case *types.Named: + return IsPackageNamedType(t, packageSuffix, typeName) + case *types.Pointer: + return IsPackageType(t.Elem(), packageSuffix, typeName) + } + + return false +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/cmdflags/version.go b/vendor/github.com/bflad/tfproviderlint/helper/cmdflags/version.go new file mode 100644 index 00000000000..0be3578e031 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/cmdflags/version.go @@ -0,0 +1,35 @@ +package cmdflags + +import ( + "flag" + "fmt" + "os" + "strings" + + "github.com/bflad/tfproviderlint/version" +) + +// AddVersionFlag adds -V and -version flags to commands +func AddVersionFlag() { + flag.Var(versionFlag{}, "V", "print version and exit") + flag.Var(versionFlag{}, "version", "print version and exit") +} + +type versionFlag struct{} + +func (versionFlag) IsBoolFlag() bool { return true } +func (versionFlag) Get() interface{} { return nil } +func (versionFlag) String() string { return "" } +func (versionFlag) Set(s string) error { + name := os.Args[0] + name = name[strings.LastIndex(name, `/`)+1:] + name = name[strings.LastIndex(name, `\`)+1:] + name = strings.TrimSuffix(name, ".exe") + + // The go command uses -V=full to get a unique identifier for this tool. + // Use a fully specified version in that case. + fmt.Printf("%s %s\n", name, version.GetVersion().VersionNumber(s == "full")) + os.Exit(0) + + return nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/funcs.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/funcs.go new file mode 100644 index 00000000000..81f78185dd4 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/funcs.go @@ -0,0 +1,17 @@ +package resource + +const ( + FuncNameComposeAggregateTestCheckFunc = `ComposeAggregateTestCheckFunc` + FuncNameComposeTestCheckFunc = `ComposeTestCheckFunc` + FuncNameNonRetryableError = `NonRetryableError` + FuncNameParallelTest = `ParallelTest` + FuncNameRetryableError = `RetryableError` + FuncNameTest = `Test` + FuncNameTestCheckNoResourceAttr = `TestCheckNoResourceAttr` + FuncNameTestCheckOutput = `TestCheckOutput` + FuncNameTestCheckResourceAttr = `TestCheckResourceAttr` + FuncNameTestCheckResourceAttrPair = `TestCheckResourceAttrPair` + FuncNameTestCheckResourceAttrPtr = `TestCheckResourceAttrPtr` + FuncNameTestCheckResourceAttrSet = `TestCheckResourceAttrSet` + FuncNameTestMatchResourceAttr = `TestMatchResourceAttr` +) diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/package.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/package.go new file mode 100644 index 00000000000..522db1ec728 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/package.go @@ -0,0 +1,23 @@ +package resource + +import ( + "go/ast" + "go/types" + + "github.com/bflad/tfproviderlint/helper/astutils" +) + +const ( + PackageName = `resource` + PackagePath = `github.com/hashicorp/terraform-plugin-sdk/helper/resource` +) + +// IsFunc returns if the function call is in the resource package +func IsFunc(e ast.Expr, info *types.Info, funcName string) bool { + return astutils.IsPackageFunc(e, info, PackagePath, funcName) +} + +// IsNamedType returns if the type name matches and is from the helper/resource package +func IsNamedType(t *types.Named, typeName string) bool { + return astutils.IsPackageNamedType(t, PackagePath, typeName) +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_retryerror.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_retryerror.go new file mode 100644 index 00000000000..71c5b10af3a --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_retryerror.go @@ -0,0 +1,53 @@ +package resource + +import ( + "go/ast" + "go/types" + + "github.com/bflad/tfproviderlint/helper/astutils" + tfresource "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +const ( + RetryErrorFieldErr = `Err` + RetryErrorFieldRetryable = `Retryable` + + TypeNameRetryError = `RetryError` +) + +// RetryErrorInfo represents all gathered RetryError data for easier access +type RetryErrorInfo struct { + AstCompositeLit *ast.CompositeLit + Fields map[string]*ast.KeyValueExpr + RetryError *tfresource.RetryError + TypesInfo *types.Info +} + +// NewRetryErrorInfo instantiates a RetryErrorInfo +func NewRetryErrorInfo(cl *ast.CompositeLit, info *types.Info) *RetryErrorInfo { + result := &RetryErrorInfo{ + AstCompositeLit: cl, + Fields: astutils.CompositeLitFields(cl), + RetryError: &tfresource.RetryError{}, + TypesInfo: info, + } + + return result +} + +// DeclaresField returns true if the field name is present in the AST +func (info *RetryErrorInfo) DeclaresField(fieldName string) bool { + return info.Fields[fieldName] != nil +} + +// IsTypeRetryError returns if the type is RetryError from the helper/resource package +func IsTypeRetryError(t types.Type) bool { + switch t := t.(type) { + case *types.Named: + return IsNamedType(t, TypeNameRetryError) + case *types.Pointer: + return IsTypeRetryError(t.Elem()) + default: + return false + } +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_retryfunc.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_retryfunc.go new file mode 100644 index 00000000000..644ddad1b2a --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_retryfunc.go @@ -0,0 +1,41 @@ +package resource + +import ( + "go/ast" + "go/token" + "go/types" +) + +// RetryFuncInfo represents all gathered RetryFunc data for easier access +type RetryFuncInfo struct { + AstFuncDecl *ast.FuncDecl + AstFuncLit *ast.FuncLit + Body *ast.BlockStmt + Node ast.Node + Pos token.Pos + Type *ast.FuncType + TypesInfo *types.Info +} + +// NewRetryFuncInfo instantiates a RetryFuncInfo +func NewRetryFuncInfo(funcDecl *ast.FuncDecl, funcLit *ast.FuncLit, info *types.Info) *RetryFuncInfo { + result := &RetryFuncInfo{ + AstFuncDecl: funcDecl, + AstFuncLit: funcLit, + TypesInfo: info, + } + + if funcDecl != nil { + result.Body = funcDecl.Body + result.Node = funcDecl + result.Pos = funcDecl.Pos() + result.Type = funcDecl.Type + } else if funcLit != nil { + result.Body = funcLit.Body + result.Node = funcLit + result.Pos = funcLit.Pos() + result.Type = funcLit.Type + } + + return result +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_testcase.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_testcase.go new file mode 100644 index 00000000000..aeace7e1c62 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_testcase.go @@ -0,0 +1,60 @@ +package resource + +import ( + "go/ast" + "go/types" + + "github.com/bflad/tfproviderlint/helper/astutils" + tfresource "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +const ( + TestCaseFieldCheckDestroy = `CheckDestroy` + TestCaseFieldIDRefreshName = `IDRefreshName` + TestCaseFieldIDRefreshIgnore = `IDRefreshIgnore` + TestCaseFieldIsUnitTest = `IsUnitTest` + TestCaseFieldPreCheck = `PreCheck` + TestCaseFieldPreventPostDestroyRefresh = `PreventPostDestroyRefresh` + TestCaseFieldProviders = `Providers` + TestCaseFieldProviderFactories = `ProviderFactories` + TestCaseFieldSteps = `Steps` + + TypeNameTestCase = `TestCase` +) + +// TestCaseInfo represents all gathered TestCase data for easier access +type TestCaseInfo struct { + AstCompositeLit *ast.CompositeLit + Fields map[string]*ast.KeyValueExpr + TestCase *tfresource.TestCase + TypesInfo *types.Info +} + +// NewTestCaseInfo instantiates a TestCaseInfo +func NewTestCaseInfo(cl *ast.CompositeLit, info *types.Info) *TestCaseInfo { + result := &TestCaseInfo{ + AstCompositeLit: cl, + Fields: astutils.CompositeLitFields(cl), + TestCase: &tfresource.TestCase{}, + TypesInfo: info, + } + + return result +} + +// DeclaresField returns true if the field name is present in the AST +func (info *TestCaseInfo) DeclaresField(fieldName string) bool { + return info.Fields[fieldName] != nil +} + +// IsTypeTestCase returns if the type is TestCase from the helper/schema package +func IsTypeTestCase(t types.Type) bool { + switch t := t.(type) { + case *types.Named: + return IsNamedType(t, TypeNameTestCase) + case *types.Pointer: + return IsTypeTestCase(t.Elem()) + default: + return false + } +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_teststep.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_teststep.go new file mode 100644 index 00000000000..7381cee76c3 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource/type_teststep.go @@ -0,0 +1,70 @@ +package resource + +import ( + "go/ast" + "go/types" + + "github.com/bflad/tfproviderlint/helper/astutils" + tfresource "github.com/hashicorp/terraform-plugin-sdk/helper/resource" +) + +const ( + TestStepFieldCheck = `Check` + TestStepFieldConfig = `Config` + TestStepFieldDestroy = `Destroy` + TestStepFieldExpectError = `ExpectError` + TestStepFieldExpectNonEmptyPlan = `ExpectNonEmptyPlan` + TestStepFieldImportState = `ImportState` + TestStepFieldImportStateId = `ImportStateId` + TestStepFieldImportStateIdFunc = `ImportStateIdFunc` + TestStepFieldImportStateIdPrefix = `ImportStateIdPrefix` + TestStepFieldImportStateCheck = `ImportStateCheck` + TestStepFieldImportStateVerify = `ImportStateVerify` + TestStepFieldImportStateVerifyIgnore = `ImportStateVerifyIgnore` + TestStepFieldPlanOnly = `PlanOnly` + TestStepFieldPreConfig = `PreConfig` + TestStepFieldPreventDiskCleanup = `PreventDiskCleanup` + TestStepFieldPreventPostDestroyRefresh = `PreventPostDestroyRefresh` + TestStepFieldResourceName = `ResourceName` + TestStepFieldSkipFunc = `SkipFunc` + TestStepFieldTaint = `Taint` + + TypeNameTestStep = `TestStep` +) + +// TestStepInfo represents all gathered TestStep data for easier access +type TestStepInfo struct { + AstCompositeLit *ast.CompositeLit + Fields map[string]*ast.KeyValueExpr + TestStep *tfresource.TestStep + TypesInfo *types.Info +} + +// NewTestStepInfo instantiates a TestStepInfo +func NewTestStepInfo(cl *ast.CompositeLit, info *types.Info) *TestStepInfo { + result := &TestStepInfo{ + AstCompositeLit: cl, + Fields: astutils.CompositeLitFields(cl), + TestStep: &tfresource.TestStep{}, + TypesInfo: info, + } + + return result +} + +// DeclaresField returns true if the field name is present in the AST +func (info *TestStepInfo) DeclaresField(fieldName string) bool { + return info.Fields[fieldName] != nil +} + +// IsTypeTestStep returns if the type is TestStep from the helper/schema package +func IsTypeTestStep(t types.Type) bool { + switch t := t.(type) { + case *types.Named: + return IsNamedType(t, TypeNameTestStep) + case *types.Pointer: + return IsTypeTestStep(t.Elem()) + default: + return false + } +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/funcs.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/funcs.go new file mode 100644 index 00000000000..278eda702c9 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/funcs.go @@ -0,0 +1,6 @@ +package schema + +const ( + FuncNameImportStatePassthrough = `ImportStatePassthrough` + FuncNameNoop = `Noop` +) diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/package.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/package.go new file mode 100644 index 00000000000..c731a9cc7a6 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/package.go @@ -0,0 +1,28 @@ +package schema + +import ( + "go/ast" + "go/types" + + "github.com/bflad/tfproviderlint/helper/astutils" +) + +const ( + PackageName = `schema` + PackagePath = `github.com/hashicorp/terraform-plugin-sdk/helper/schema` +) + +// IsFunc returns if the function call is in the package +func IsFunc(e ast.Expr, info *types.Info, funcName string) bool { + return astutils.IsPackageFunc(e, info, PackagePath, funcName) +} + +// IsNamedType returns if the type name matches and is from the package +func IsNamedType(t *types.Named, typeName string) bool { + return astutils.IsPackageNamedType(t, PackagePath, typeName) +} + +// IsReceiverMethod returns if the receiver method call is in the package +func IsReceiverMethod(e ast.Expr, info *types.Info, receiverName string, methodName string) bool { + return astutils.IsPackageReceiverMethod(e, info, PackagePath, receiverName, methodName) +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_crudfunc.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_crudfunc.go new file mode 100644 index 00000000000..3488697c3ef --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_crudfunc.go @@ -0,0 +1,45 @@ +package schema + +import ( + "go/ast" + "go/token" + "go/types" +) + +// CRUDFuncInfo represents all gathered CreateFunc, ReadFunc, UpdateFunc, and DeleteFunc data for easier access +// Since Create, Delete, Read, and Update functions all have the same function +// signature, we cannot differentiate them in AST (except by potentially by +// function declaration naming heuristics later on). +type CRUDFuncInfo struct { + AstFuncDecl *ast.FuncDecl + AstFuncLit *ast.FuncLit + Body *ast.BlockStmt + Node ast.Node + Pos token.Pos + Type *ast.FuncType + TypesInfo *types.Info +} + +// NewCRUDFuncInfo instantiates a CRUDFuncInfo +func NewCRUDFuncInfo(node ast.Node, info *types.Info) *CRUDFuncInfo { + result := &CRUDFuncInfo{ + TypesInfo: info, + } + + switch node := node.(type) { + case *ast.FuncDecl: + result.AstFuncDecl = node + result.Body = node.Body + result.Node = node + result.Pos = node.Pos() + result.Type = node.Type + case *ast.FuncLit: + result.AstFuncLit = node + result.Body = node.Body + result.Node = node + result.Pos = node.Pos() + result.Type = node.Type + } + + return result +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_resource.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_resource.go new file mode 100644 index 00000000000..a7307477f6f --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_resource.go @@ -0,0 +1,114 @@ +package schema + +import ( + "go/ast" + "go/types" + + "github.com/bflad/tfproviderlint/helper/astutils" + tfschema "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/terraform" +) + +const ( + ResourceFieldCreate = `Create` + ResourceFieldCustomizeDiff = `CustomizeDiff` + ResourceFieldDelete = `Delete` + ResourceFieldDeprecationMessage = `DeprecationMessage` + ResourceFieldExists = `Exists` + ResourceFieldImporter = `Importer` + ResourceFieldMigrateState = `MigrateState` + ResourceFieldRead = `Read` + ResourceFieldSchema = `Schema` + ResourceFieldSchemaVersion = `SchemaVersion` + ResourceFieldStateUpgraders = `StateUpgraders` + ResourceFieldTimeouts = `Timeouts` + ResourceFieldUpdate = `Update` + + TypeNameResource = `Resource` +) + +// ResourceInfo represents all gathered Resource data for easier access +type ResourceInfo struct { + AstCompositeLit *ast.CompositeLit + Fields map[string]*ast.KeyValueExpr + Resource *tfschema.Resource + TypesInfo *types.Info +} + +// NewResourceInfo instantiates a ResourceInfo +func NewResourceInfo(cl *ast.CompositeLit, info *types.Info) *ResourceInfo { + result := &ResourceInfo{ + AstCompositeLit: cl, + Fields: astutils.CompositeLitFields(cl), + Resource: &tfschema.Resource{}, + TypesInfo: info, + } + + if kvExpr := result.Fields[ResourceFieldMigrateState]; kvExpr != nil && astutils.ExprValue(kvExpr.Value) != nil { + result.Resource.MigrateState = func(int, *terraform.InstanceState, interface{}) (*terraform.InstanceState, error) { return nil, nil } + } + + return result +} + +// DeclaresField returns true if the field name is present in the AST +func (info *ResourceInfo) DeclaresField(fieldName string) bool { + return info.Fields[fieldName] != nil +} + +// IsDataSource returns true if the Resource type matches a Terraform Data Source declaration +func (info *ResourceInfo) IsDataSource() bool { + if info.DeclaresField(ResourceFieldCreate) { + return false + } + + return info.DeclaresField(ResourceFieldRead) +} + +// IsResource returns true if the Resource type matches a Terraform Resource declaration +func (info *ResourceInfo) IsResource() bool { + return info.DeclaresField(ResourceFieldCreate) +} + +// GetResourceMapResourceNames returns all resource names held in a map[string]*schema.Resource +func GetResourceMapResourceNames(cl *ast.CompositeLit) []ast.Expr { + var result []ast.Expr + + for _, elt := range cl.Elts { + switch v := elt.(type) { + case *ast.KeyValueExpr: + result = append(result, v.Key) + } + } + + return result +} + +// IsMapStringResource returns if the type is map[string]*Resource from the helper/schema package +func IsMapStringResource(cl *ast.CompositeLit, info *types.Info) bool { + switch v := cl.Type.(type) { + case *ast.MapType: + switch k := v.Key.(type) { + case *ast.Ident: + if k.Name != "string" { + return false + } + } + + return IsTypeResource(info.TypeOf(v.Value)) + } + + return false +} + +// IsTypeResource returns if the type is Resource from the helper/schema package +func IsTypeResource(t types.Type) bool { + switch t := t.(type) { + case *types.Named: + return IsNamedType(t, TypeNameResource) + case *types.Pointer: + return IsTypeResource(t.Elem()) + default: + return false + } +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_resourcedata.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_resourcedata.go new file mode 100644 index 00000000000..5de666e203b --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_resourcedata.go @@ -0,0 +1,21 @@ +package schema + +import ( + "go/types" +) + +const ( + TypeNameResourceData = `ResourceData` +) + +// IsTypeResourceData returns if the type is ResourceData from the helper/schema package +func IsTypeResourceData(t types.Type) bool { + switch t := t.(type) { + case *types.Named: + return IsNamedType(t, TypeNameResourceData) + case *types.Pointer: + return IsTypeResourceData(t.Elem()) + default: + return false + } +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_schema.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_schema.go new file mode 100644 index 00000000000..1ebc0388daa --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_schema.go @@ -0,0 +1,296 @@ +package schema + +import ( + "go/ast" + "go/types" + + "github.com/bflad/tfproviderlint/helper/astutils" + tfschema "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +const ( + SchemaFieldAtLeastOneOf = `AtLeastOneOf` + SchemaFieldComputed = `Computed` + SchemaFieldComputedWhen = `ComputedWhen` + SchemaFieldConfigMode = `ConfigMode` + SchemaFieldConflictsWith = `ConflictsWith` + SchemaFieldDefault = `Default` + SchemaFieldDefaultFunc = `DefaultFunc` + SchemaFieldDeprecated = `Deprecated` + SchemaFieldDescription = `Description` + SchemaFieldDiffSuppressFunc = `DiffSuppressFunc` + SchemaFieldElem = `Elem` + SchemaFieldExactlyOneOf = `ExactlyOneOf` + SchemaFieldForceNew = `ForceNew` + SchemaFieldInputDefault = `InputDefault` + SchemaFieldMaxItems = `MaxItems` + SchemaFieldMinItems = `MinItems` + SchemaFieldOptional = `Optional` + SchemaFieldPromoteSingle = `PromoteSingle` + SchemaFieldRemoved = `Removed` + SchemaFieldRequired = `Required` + SchemaFieldSensitive = `Sensitive` + SchemaFieldSet = `Set` + SchemaFieldStateFunc = `StateFunc` + SchemaFieldType = `Type` + SchemaFieldValidateFunc = `ValidateFunc` + + SchemaValueTypeBool = `TypeBool` + SchemaValueTypeFloat = `TypeFloat` + SchemaValueTypeInt = `TypeInt` + SchemaValueTypeList = `TypeList` + SchemaValueTypeMap = `TypeMap` + SchemaValueTypeSet = `TypeSet` + SchemaValueTypeString = `TypeString` + + TypeNameSchema = `Schema` + TypeNameSet = `Set` + TypeNameValueType = `ValueType` +) + +// SchemaInfo represents all gathered Schema data for easier access +type SchemaInfo struct { + AstCompositeLit *ast.CompositeLit + Fields map[string]*ast.KeyValueExpr + Schema *tfschema.Schema + SchemaValueType string + TypesInfo *types.Info +} + +// NewSchemaInfo instantiates a SchemaInfo +func NewSchemaInfo(cl *ast.CompositeLit, info *types.Info) *SchemaInfo { + result := &SchemaInfo{ + AstCompositeLit: cl, + Fields: astutils.CompositeLitFields(cl), + Schema: &tfschema.Schema{}, + SchemaValueType: typeSchemaType(cl, info), + TypesInfo: info, + } + + if kvExpr := result.Fields[SchemaFieldAtLeastOneOf]; kvExpr != nil && astutils.ExprValue(kvExpr.Value) != nil { + result.Schema.AtLeastOneOf = []string{} + } + + if kvExpr := result.Fields[SchemaFieldComputed]; kvExpr != nil && astutils.ExprBoolValue(kvExpr.Value) != nil { + result.Schema.Computed = *astutils.ExprBoolValue(kvExpr.Value) + } + + if kvExpr := result.Fields[SchemaFieldConflictsWith]; kvExpr != nil && astutils.ExprValue(kvExpr.Value) != nil { + result.Schema.ConflictsWith = []string{} + } + + if kvExpr := result.Fields[SchemaFieldDefault]; kvExpr != nil && astutils.ExprValue(kvExpr.Value) != nil { + result.Schema.Default = func() (interface{}, error) { return nil, nil } + } + + if kvExpr := result.Fields[SchemaFieldDefaultFunc]; kvExpr != nil && astutils.ExprValue(kvExpr.Value) != nil { + result.Schema.DefaultFunc = func() (interface{}, error) { return nil, nil } + } + + if kvExpr := result.Fields[SchemaFieldDescription]; kvExpr != nil && astutils.ExprStringValue(kvExpr.Value) != nil { + result.Schema.Description = *astutils.ExprStringValue(kvExpr.Value) + } + + if kvExpr := result.Fields[SchemaFieldExactlyOneOf]; kvExpr != nil && astutils.ExprValue(kvExpr.Value) != nil { + result.Schema.ExactlyOneOf = []string{} + } + + if kvExpr := result.Fields[SchemaFieldDiffSuppressFunc]; kvExpr != nil && astutils.ExprValue(kvExpr.Value) != nil { + result.Schema.DiffSuppressFunc = func(k, old, new string, d *tfschema.ResourceData) bool { return false } + } + + if kvExpr := result.Fields[SchemaFieldForceNew]; kvExpr != nil && astutils.ExprBoolValue(kvExpr.Value) != nil { + result.Schema.ForceNew = *astutils.ExprBoolValue(kvExpr.Value) + } + + if kvExpr := result.Fields[SchemaFieldInputDefault]; kvExpr != nil && astutils.ExprStringValue(kvExpr.Value) != nil { + result.Schema.InputDefault = *astutils.ExprStringValue(kvExpr.Value) + } + + if kvExpr := result.Fields[SchemaFieldMaxItems]; kvExpr != nil && astutils.ExprIntValue(kvExpr.Value) != nil { + result.Schema.MaxItems = *astutils.ExprIntValue(kvExpr.Value) + } + + if kvExpr := result.Fields[SchemaFieldMinItems]; kvExpr != nil && astutils.ExprIntValue(kvExpr.Value) != nil { + result.Schema.MinItems = *astutils.ExprIntValue(kvExpr.Value) + } + + if kvExpr := result.Fields[SchemaFieldOptional]; kvExpr != nil && astutils.ExprBoolValue(kvExpr.Value) != nil { + result.Schema.Optional = *astutils.ExprBoolValue(kvExpr.Value) + } + + if kvExpr := result.Fields[SchemaFieldPromoteSingle]; kvExpr != nil && astutils.ExprBoolValue(kvExpr.Value) != nil { + result.Schema.PromoteSingle = *astutils.ExprBoolValue(kvExpr.Value) + } + + if kvExpr := result.Fields[SchemaFieldRequired]; kvExpr != nil && astutils.ExprBoolValue(kvExpr.Value) != nil { + result.Schema.Required = *astutils.ExprBoolValue(kvExpr.Value) + } + + if kvExpr := result.Fields[SchemaFieldSensitive]; kvExpr != nil && astutils.ExprBoolValue(kvExpr.Value) != nil { + result.Schema.Sensitive = *astutils.ExprBoolValue(kvExpr.Value) + } + + if kvExpr := result.Fields[SchemaFieldStateFunc]; kvExpr != nil && astutils.ExprValue(kvExpr.Value) != nil { + result.Schema.StateFunc = func(interface{}) string { return "" } + } + + if kvExpr := result.Fields[SchemaFieldValidateFunc]; kvExpr != nil && astutils.ExprValue(kvExpr.Value) != nil { + result.Schema.ValidateFunc = func(interface{}, string) ([]string, []error) { return nil, nil } + } + + return result +} + +// DeclaresField returns true if the field name is present in the AST +func (info *SchemaInfo) DeclaresField(fieldName string) bool { + return info.Fields[fieldName] != nil +} + +// DeclaresBoolFieldWithZeroValue returns true if the field name is present and is false +func (info *SchemaInfo) DeclaresBoolFieldWithZeroValue(fieldName string) bool { + kvExpr := info.Fields[fieldName] + + // Field not declared + if kvExpr == nil { + return false + } + + valuePtr := astutils.ExprBoolValue(kvExpr.Value) + + // Value not readable + if valuePtr == nil { + return false + } + + return !*valuePtr +} + +// IsType returns true if the given input is equal to the Type +func (info *SchemaInfo) IsType(valueType string) bool { + return info.SchemaValueType == valueType +} + +// IsOneOfTypes returns true if one of the given input is equal to the Type +func (info *SchemaInfo) IsOneOfTypes(valueTypes ...string) bool { + for _, valueType := range valueTypes { + if info.SchemaValueType == valueType { + return true + } + } + + return false +} + +// GetSchemaMapAttributeNames returns all attribute names held in a map[string]*schema.Schema +func GetSchemaMapAttributeNames(cl *ast.CompositeLit) []ast.Expr { + var result []ast.Expr + + for _, elt := range cl.Elts { + switch v := elt.(type) { + case *ast.KeyValueExpr: + result = append(result, v.Key) + } + } + + return result +} + +// GetSchemaMapSchemas returns all Schema held in a map[string]*schema.Schema +func GetSchemaMapSchemas(cl *ast.CompositeLit) []*ast.CompositeLit { + var result []*ast.CompositeLit + + for _, elt := range cl.Elts { + switch v := elt.(type) { + case *ast.KeyValueExpr: + switch v := v.Value.(type) { + case *ast.CompositeLit: + result = append(result, v) + } + } + } + + return result +} + +// IsTypeSchema returns if the type is Schema from the helper/schema package +func IsTypeSchema(t types.Type) bool { + switch t := t.(type) { + case *types.Named: + return IsNamedType(t, TypeNameSchema) + case *types.Pointer: + return IsTypeSchema(t.Elem()) + default: + return false + } +} + +// IsValueType returns if the Schema field Type matches +func IsValueType(e ast.Expr, info *types.Info) bool { + switch e := e.(type) { + case *ast.SelectorExpr: + switch t := info.TypeOf(e).(type) { + case *types.Named: + return IsNamedType(t, TypeNameValueType) + default: + return false + } + default: + return false + } +} + +// IsTypeSet returns if the type is Set from the helper/schema package +// Use IsTypeSchemaFieldType for verifying Type: schema.TypeSet ValueType +func IsTypeSet(t types.Type) bool { + switch t := t.(type) { + case *types.Named: + return IsNamedType(t, TypeNameSet) + case *types.Pointer: + return IsTypeSet(t.Elem()) + default: + return false + } +} + +// IsMapStringSchema returns if the type is map[string]*Schema from the helper/schema package +func IsMapStringSchema(cl *ast.CompositeLit, info *types.Info) bool { + switch v := cl.Type.(type) { + case *ast.MapType: + switch k := v.Key.(type) { + case *ast.Ident: + if k.Name != "string" { + return false + } + } + + return IsTypeSchema(info.TypeOf(v.Value)) + } + + return false +} + +// typeSchemaType extracts the string representation of a Schema Type value +func typeSchemaType(schema *ast.CompositeLit, info *types.Info) string { + kvExpr := astutils.CompositeLitField(schema, SchemaFieldType) + + if kvExpr == nil { + return "" + } + + if !IsValueType(kvExpr.Value, info) { + return "" + } + + return valueTypeString(kvExpr.Value) +} + +// valueTypeString extracts the string representation of a Schema ValueType +func valueTypeString(e ast.Expr) string { + switch e := e.(type) { + case *ast.SelectorExpr: + return e.Sel.Name + default: + return "" + } +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_schemavalidatefunc.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_schemavalidatefunc.go new file mode 100644 index 00000000000..119fbf817ae --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema/type_schemavalidatefunc.go @@ -0,0 +1,42 @@ +package schema + +import ( + "go/ast" + "go/token" + "go/types" +) + +// SchemaValidateFuncInfo represents all gathered SchemaValidateFunc data for easier access +type SchemaValidateFuncInfo struct { + AstFuncDecl *ast.FuncDecl + AstFuncLit *ast.FuncLit + Body *ast.BlockStmt + Node ast.Node + Pos token.Pos + Type *ast.FuncType + TypesInfo *types.Info +} + +// NewSchemaValidateFuncInfo instantiates a SchemaValidateFuncInfo +func NewSchemaValidateFuncInfo(node ast.Node, info *types.Info) *SchemaValidateFuncInfo { + result := &SchemaValidateFuncInfo{ + TypesInfo: info, + } + + switch node := node.(type) { + case *ast.FuncDecl: + result.AstFuncDecl = node + result.Body = node.Body + result.Node = node + result.Pos = node.Pos() + result.Type = node.Type + case *ast.FuncLit: + result.AstFuncLit = node + result.Body = node.Body + result.Node = node + result.Pos = node.Pos() + result.Type = node.Type + } + + return result +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation/funcs.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation/funcs.go new file mode 100644 index 00000000000..41be4dc43c7 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation/funcs.go @@ -0,0 +1,52 @@ +package validation + +const ( + FuncNameAll = `All` + FuncNameAny = `Any` + FuncNameCIDRNetwork = `CIDRNetwork` + FuncNameFloatAtLeast = `FloatAtLeast` + FuncNameFloatAtMost = `FloatAtMost` + FuncNameFloatBetween = `FloatBetween` + FuncNameIPRange = `IPRange` + FuncNameIntAtLeast = `IntAtLeast` + FuncNameIntAtMost = `IntAtMost` + FuncNameIntBetween = `IntBetween` + FuncNameIntDivisibleBy = `IntDivisibleBy` + FuncNameIntInSlice = `IntInSlice` + FuncNameIntNotInSlice = `IntNotInSlice` + FuncNameIsCIDR = `IsCIDR` + FuncNameIsCIDRNetwork = `IsCIDRNetwork` + FuncNameIsDayOfTheWeek = `IsDayOfTheWeek` + FuncNameIsIPAddress = `IsIPAddress` + FuncNameIsIPv4Address = `IsIPv4Address` + FuncNameIsIPv4Range = `IsIPv4Range` + FuncNameIsIPv6Address = `IsIPv6Address` + FuncNameIsMACAddress = `IsMACAddress` + FuncNameIsMonth = `IsMonth` + FuncNameIsPortNumber = `IsPortNumber` + FuncNameIsPortNumberOrZero = `IsPortNumberOrZero` + FuncNameIsRFC3339Time = `IsRFC3339Time` + FuncNameIsURLWithHTTPS = `IsURLWithHTTPS` + FuncNameIsURLWithHTTPorHTTPS = `IsURLWithHTTPorHTTPS` + FuncNameIsURLWithScheme = `IsURLWithScheme` + FuncNameIsUUID = `IsUUID` + FuncNameListOfUniqueStrings = `ListOfUniqueStrings` + FuncNameNoZeroValues = `NoZeroValues` + FuncNameSingleIP = `SingleIP` + FuncNameStringDoesNotContainAny = `StringDoesNotContainAny` + FuncNameStringDoesNotMatch = `StringDoesNotMatch` + FuncNameStringInSlice = `StringInSlice` + FuncNameStringIsBase64 = `StringIsBase64` + FuncNameStringIsEmpty = `StringIsEmpty` + FuncNameStringIsJSON = `StringIsJSON` + FuncNameStringIsNotEmpty = `StringIsNotEmpty` + FuncNameStringIsNotWhiteSpace = `StringIsNotWhiteSpace` + FuncNameStringIsValidRegExp = `StringIsValidRegExp` + FuncNameStringIsWhiteSpace = `StringIsWhiteSpace` + FuncNameStringLenBetween = `StringLenBetween` + FuncNameStringMatch = `StringMatch` + FuncNameValidateJsonString = `ValidateJsonString` + FuncNameValidateListUniqueStrings = `ValidateListUniqueStrings` + FuncNameValidateRFC3339TimeString = `ValidateRFC3339TimeString` + FuncNameValidateRegexp = `ValidateRegexp` +) diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation/package.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation/package.go new file mode 100644 index 00000000000..ad5ce2ed792 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation/package.go @@ -0,0 +1,18 @@ +package validation + +import ( + "go/ast" + "go/types" + + "github.com/bflad/tfproviderlint/helper/astutils" +) + +const ( + PackageName = `validation` + PackagePath = `github.com/hashicorp/terraform-plugin-sdk/helper/validation` +) + +// IsFunc returns if the function call is in the package +func IsFunc(e ast.Expr, info *types.Info, funcName string) bool { + return astutils.IsPackageFunc(e, info, PackagePath, funcName) +} diff --git a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/terraformtype.go b/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/terraformtype.go deleted file mode 100644 index 4c91a221b59..00000000000 --- a/vendor/github.com/bflad/tfproviderlint/helper/terraformtype/terraformtype.go +++ /dev/null @@ -1,23 +0,0 @@ -package terraformtype - -import ( - "go/types" - "strings" -) - -// IsTypeHelperSchema returns if the type is a schema from the terraform helper package -func IsTypeHelperSchema(t types.Type) bool { - switch t := t.(type) { - default: - return false - case *types.Named: - if t.Obj().Name() != "Schema" { - return false - } - // HasSuffix here due to vendoring - if !strings.HasSuffix(t.Obj().Pkg().Path(), "github.com/hashicorp/terraform-plugin-sdk/helper/schema") { - return false - } - } - return true -} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/AT001/AT001.go b/vendor/github.com/bflad/tfproviderlint/passes/AT001/AT001.go index 74de70c49d9..277e4826d36 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/AT001/AT001.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/AT001/AT001.go @@ -7,10 +7,10 @@ import ( "path/filepath" "strings" - "golang.org/x/tools/go/analysis" - - "github.com/bflad/tfproviderlint/passes/acctestcase" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource" "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/resource/testcaseinfo" + "golang.org/x/tools/go/analysis" ) const Doc = `check for TestCase missing CheckDestroy @@ -29,43 +29,31 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - acctestcase.Analyzer, commentignore.Analyzer, + testcaseinfo.Analyzer, }, Run: run, } func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - testCases := pass.ResultOf[acctestcase.Analyzer].([]*ast.CompositeLit) + testCases := pass.ResultOf[testcaseinfo.Analyzer].([]*resource.TestCaseInfo) for _, testCase := range testCases { - fileName := filepath.Base(pass.Fset.File(testCase.Pos()).Name()) + fileName := filepath.Base(pass.Fset.File(testCase.AstCompositeLit.Pos()).Name()) if strings.HasPrefix(fileName, "data_source_") { continue } - if ignorer.ShouldIgnore(analyzerName, testCase) { + if ignorer.ShouldIgnore(analyzerName, testCase.AstCompositeLit) { continue } - var found bool - - for _, elt := range testCase.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - if v.Key.(*ast.Ident).Name == "CheckDestroy" { - found = true - break - } - } + if testCase.DeclaresField(resource.TestCaseFieldCheckDestroy) { + continue } - if !found { - pass.Reportf(testCase.Type.(*ast.SelectorExpr).Sel.Pos(), "%s: missing CheckDestroy", analyzerName) - } + pass.Reportf(testCase.AstCompositeLit.Type.(*ast.SelectorExpr).Sel.Pos(), "%s: missing CheckDestroy", analyzerName) } return nil, nil diff --git a/vendor/github.com/bflad/tfproviderlint/passes/AT001/README.md b/vendor/github.com/bflad/tfproviderlint/passes/AT001/README.md index 76732b18ca8..64a50bdf66e 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/AT001/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/AT001/README.md @@ -60,3 +60,25 @@ func TestAccExampleThing_Attr1(t *testing.T) { }) } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:AT001` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +func TestAccExampleThing_Attr1(t *testing.T) { + //lintignore:AT001 + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + Steps: []resource.TestStep{ + { + Config: testAccExampleThingConfig(), + Check: resource.ComposeTestCheckFunc( + resource.TestCheckResourceAttrSet("example_thing.test", "attr1"), + ), + }, + }, + }) +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/AT002/AT002.go b/vendor/github.com/bflad/tfproviderlint/passes/AT002/AT002.go index 9f588f5e8f5..220d8747e38 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/AT002/AT002.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/AT002/AT002.go @@ -8,8 +8,8 @@ import ( "golang.org/x/tools/go/analysis" - "github.com/bflad/tfproviderlint/passes/acctestfunc" "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/testaccfuncdecl" ) const Doc = `check for acceptance test function names including the word import @@ -26,7 +26,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - acctestfunc.Analyzer, + testaccfuncdecl.Analyzer, commentignore.Analyzer, }, Run: run, @@ -34,7 +34,7 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - testAccFuncs := pass.ResultOf[acctestfunc.Analyzer].([]*ast.FuncDecl) + testAccFuncs := pass.ResultOf[testaccfuncdecl.Analyzer].([]*ast.FuncDecl) for _, testAccFunc := range testAccFuncs { if ignorer.ShouldIgnore(analyzerName, testAccFunc) { continue diff --git a/vendor/github.com/bflad/tfproviderlint/passes/AT002/README.md b/vendor/github.com/bflad/tfproviderlint/passes/AT002/README.md index 9d5d8723ca5..d64602f87b1 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/AT002/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/AT002/README.md @@ -71,3 +71,14 @@ func TestAccExampleThing_basic(t *testing.T) { }) } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:AT002` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:AT002 +func TestAccExampleThing_importBasic(t *testing.T) { + // ... +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/AT003/AT003.go b/vendor/github.com/bflad/tfproviderlint/passes/AT003/AT003.go index 680d49e76f1..d1b851fae35 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/AT003/AT003.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/AT003/AT003.go @@ -8,8 +8,8 @@ import ( "golang.org/x/tools/go/analysis" - "github.com/bflad/tfproviderlint/passes/acctestfunc" "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/testaccfuncdecl" ) const Doc = `check for acceptance test function names missing an underscore @@ -24,7 +24,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - acctestfunc.Analyzer, + testaccfuncdecl.Analyzer, commentignore.Analyzer, }, Run: run, @@ -32,7 +32,7 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - testAccFuncs := pass.ResultOf[acctestfunc.Analyzer].([]*ast.FuncDecl) + testAccFuncs := pass.ResultOf[testaccfuncdecl.Analyzer].([]*ast.FuncDecl) for _, testAccFunc := range testAccFuncs { if ignorer.ShouldIgnore(analyzerName, testAccFunc) { continue diff --git a/vendor/github.com/bflad/tfproviderlint/passes/AT003/README.md b/vendor/github.com/bflad/tfproviderlint/passes/AT003/README.md index 4de70e1bb31..aa70eb4edcc 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/AT003/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/AT003/README.md @@ -32,3 +32,12 @@ func TestAccExampleThingAssociation_basic(t *testing.T) { /* ... */ } func TestAccExampleThingAssociation_SomeAttribute(t *testing.T) { /* ... */ } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:AT003` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:AT003 +func TestAccExampleThing(t *testing.T) { /* ... */ } +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/AT004/README.md b/vendor/github.com/bflad/tfproviderlint/passes/AT004/README.md index 1aa2de7b504..6fa3fd356b7 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/AT004/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/AT004/README.md @@ -37,3 +37,16 @@ resource.TestCase{ }, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:AT004` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:AT004 +const ExampleThingConfig = ` +provider "example" {} + +resource "example_thing" {} +` +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/AT005/AT005.go b/vendor/github.com/bflad/tfproviderlint/passes/AT005/AT005.go new file mode 100644 index 00000000000..f104013b0c2 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/AT005/AT005.go @@ -0,0 +1,60 @@ +// Package AT005 defines an Analyzer that checks for +// acceptance tests prefixed with Test but not TestAcc +package AT005 + +import ( + "go/ast" + "strings" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource" + "github.com/bflad/tfproviderlint/passes/testfuncdecl" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for acceptance test function names missing TestAcc prefix + +The AT005 analyzer reports test function names (Test prefix) that contain +resource.Test() or resource.ParallelTest(), which should be named with +the TestAcc prefix.` + +const analyzerName = "AT005" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + testfuncdecl.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + testFuncs := pass.ResultOf[testfuncdecl.Analyzer].([]*ast.FuncDecl) + + for _, testFunc := range testFuncs { + if strings.HasPrefix(testFunc.Name.Name, "TestAcc") { + continue + } + + ast.Inspect(testFunc.Body, func(n ast.Node) bool { + callExpr, ok := n.(*ast.CallExpr) + + if !ok { + return true + } + + isResourceTest := resource.IsFunc(callExpr.Fun, pass.TypesInfo, resource.FuncNameTest) + isResourceParallelTest := resource.IsFunc(callExpr.Fun, pass.TypesInfo, resource.FuncNameParallelTest) + + if !isResourceTest && !isResourceParallelTest { + return true + } + + pass.Reportf(testFunc.Pos(), "%s: acceptance test function name should begin with TestAcc", analyzerName) + return true + }) + + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/AT005/README.md b/vendor/github.com/bflad/tfproviderlint/passes/AT005/README.md new file mode 100644 index 00000000000..f59fdf86fe8 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/AT005/README.md @@ -0,0 +1,40 @@ +# AT005 + +The AT005 analyzer reports test function names (`Test` prefix) that contain +`resource.Test()` or `resource.ParallelTest()`, which should be named with +the TestAcc prefix. + +## Flagged Code + +```go +func TestExampleThing_basic(t *testing.T) { + resource.Test(/* ... */) +} + +func TestExampleWidget_basic(t *testing.T) { + resource.ParallelTest(/* ... */) +} +``` + +## Passing Code + +```go +func TestAccExampleThing_basic(t *testing.T) { + resource.Test(/* ... */) +} + +func TestAccExampleWidget_basic(t *testing.T) { + resource.ParallelTest(/* ... */) +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:AT005` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:AT005 +func TestExampleThing_basic(t *testing.T) { + resource.Test(/* ... */) +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/AT006/AT006.go b/vendor/github.com/bflad/tfproviderlint/passes/AT006/AT006.go new file mode 100644 index 00000000000..12c1701b0bc --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/AT006/AT006.go @@ -0,0 +1,57 @@ +// Package AT006 defines an Analyzer that checks for +// acceptance tests containing multiple resource.Test() invocations +package AT006 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource" + "github.com/bflad/tfproviderlint/passes/testaccfuncdecl" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for acceptance tests containing multiple resource.Test() invocations + +The AT006 analyzer reports acceptance test functions that contain multiple +resource.Test() invocations. Acceptance tests should be split by invocation.` + +const analyzerName = "AT006" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + testaccfuncdecl.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + testFuncs := pass.ResultOf[testaccfuncdecl.Analyzer].([]*ast.FuncDecl) + + for _, testFunc := range testFuncs { + var resourceTestInvocations int + + ast.Inspect(testFunc.Body, func(n ast.Node) bool { + callExpr, ok := n.(*ast.CallExpr) + + if !ok { + return true + } + + if resource.IsFunc(callExpr.Fun, pass.TypesInfo, resource.FuncNameTest) { + resourceTestInvocations += 1 + } + + if resourceTestInvocations > 1 { + pass.Reportf(testFunc.Pos(), "%s: acceptance test function should contain only one Test invocation", analyzerName) + return false + } + + return true + }) + + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/AT006/README.md b/vendor/github.com/bflad/tfproviderlint/passes/AT006/README.md new file mode 100644 index 00000000000..50a7ac7ed2b --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/AT006/README.md @@ -0,0 +1,37 @@ +# AT006 + +The AT006 analyzer reports acceptance test functions that contain multiple +`resource.Test()` invocations. Acceptance tests should be split by invocation. + +## Flagged Code + +```go +func TestAccExampleThing_basic(t *testing.T) { + resource.Test(/* ... */) + resource.Test(/* ... */) +} +``` + +## Passing Code + +```go +func TestAccExampleThing_first(t *testing.T) { + resource.Test(/* ... */) +} + +func TestAccExampleThing_second(t *testing.T) { + resource.Test(/* ... */) +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:AT006` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:AT006 +func TestAccExampleThing_basic(t *testing.T) { + resource.Test(/* ... */) + resource.Test(/* ... */) +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/AT007/AT007.go b/vendor/github.com/bflad/tfproviderlint/passes/AT007/AT007.go new file mode 100644 index 00000000000..1c7fdcfd52c --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/AT007/AT007.go @@ -0,0 +1,58 @@ +// Package AT007 defines an Analyzer that checks for +// acceptance tests containing multiple resource.ParallelTest() invocations +package AT007 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource" + "github.com/bflad/tfproviderlint/passes/testaccfuncdecl" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for acceptance tests containing multiple resource.ParallelTest() invocations + +The AT007 analyzer reports acceptance test functions that contain multiple +resource.ParallelTest() invocations. Acceptance tests should be split by +invocation and multiple resource.ParallelTest() will cause a panic.` + +const analyzerName = "AT007" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + testaccfuncdecl.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + testFuncs := pass.ResultOf[testaccfuncdecl.Analyzer].([]*ast.FuncDecl) + + for _, testFunc := range testFuncs { + var resourceParallelTestInvocations int + + ast.Inspect(testFunc.Body, func(n ast.Node) bool { + callExpr, ok := n.(*ast.CallExpr) + + if !ok { + return true + } + + if resource.IsFunc(callExpr.Fun, pass.TypesInfo, resource.FuncNameParallelTest) { + resourceParallelTestInvocations += 1 + } + + if resourceParallelTestInvocations > 1 { + pass.Reportf(testFunc.Pos(), "%s: acceptance test function should contain only one ParallelTest invocation", analyzerName) + return false + } + + return true + }) + + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/AT007/README.md b/vendor/github.com/bflad/tfproviderlint/passes/AT007/README.md new file mode 100644 index 00000000000..77275525757 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/AT007/README.md @@ -0,0 +1,38 @@ +# AT007 + +The AT007 analyzer reports acceptance test functions that contain multiple +`resource.ParallelTest()` invocations. Acceptance tests should be split by +invocation and multiple `resource.ParallelTest()` will cause a panic. + +## Flagged Code + +```go +func TestAccExampleThing_basic(t *testing.T) { + resource.ParallelTest(/* ... */) + resource.ParallelTest(/* ... */) +} +``` + +## Passing Code + +```go +func TestAccExampleThing_first(t *testing.T) { + resource.ParallelTest(/* ... */) +} + +func TestAccExampleThing_second(t *testing.T) { + resource.ParallelTest(/* ... */) +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:AT007` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:AT007 +func TestAccExampleThing_basic(t *testing.T) { + resource.ParallelTest(/* ... */) + resource.ParallelTest(/* ... */) +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/AT008/AT008.go b/vendor/github.com/bflad/tfproviderlint/passes/AT008/AT008.go new file mode 100644 index 00000000000..9de74edc60c --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/AT008/AT008.go @@ -0,0 +1,58 @@ +package AT008 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/testaccfuncdecl" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for acceptance test function declaration *testing.T parameter naming + +The AT008 analyzer reports where the *testing.T parameter of an acceptance test +declaration is not named t, which is a standard convention.` + +const analyzerName = "AT008" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + testaccfuncdecl.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + funcDecls := pass.ResultOf[testaccfuncdecl.Analyzer].([]*ast.FuncDecl) + for _, funcDecl := range funcDecls { + if ignorer.ShouldIgnore(analyzerName, funcDecl) { + continue + } + + params := funcDecl.Type.Params + + if params == nil || len(params.List) != 1 { + continue + } + + firstParam := params.List[0] + + if firstParam == nil || len(firstParam.Names) != 1 { + continue + } + + name := firstParam.Names[0] + + if name == nil || name.Name == "t" { + continue + } + + pass.Reportf(name.Pos(), "%s: acceptance test function declaration *testing.T parameter should be named t", analyzerName) + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/AT008/README.md b/vendor/github.com/bflad/tfproviderlint/passes/AT008/README.md new file mode 100644 index 00000000000..3c862b5d403 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/AT008/README.md @@ -0,0 +1,24 @@ +# AT008 + +The AT008 analyzer reports where the `*testing.T` parameter of an acceptance test declaration is not named `t`, which is a standard convention. + +## Flagged Code + +```go +func TestAccExampleThing_basic(invalid *testing.T) { /* ... */} +``` + +## Passing Code + +```go +func TestAccExampleThing_basic(t *testing.T) { /* ... */} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:AT008` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:AT008 +func TestAccExampleThing_basic(invalid *testing.T) { /* ... */} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R001/R001.go b/vendor/github.com/bflad/tfproviderlint/passes/R001/R001.go index bfb6f010866..d711a3f5334 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/R001/R001.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/R001/R001.go @@ -8,7 +8,7 @@ import ( "golang.org/x/tools/go/analysis" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/resourcedataset" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatasetcallexpr" ) const Doc = `check for ResourceData.Set() calls using complex key argument @@ -22,7 +22,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - resourcedataset.Analyzer, + resourcedatasetcallexpr.Analyzer, commentignore.Analyzer, }, Run: run, @@ -30,7 +30,7 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - sets := pass.ResultOf[resourcedataset.Analyzer].([]*ast.CallExpr) + sets := pass.ResultOf[resourcedatasetcallexpr.Analyzer].([]*ast.CallExpr) for _, set := range sets { if ignorer.ShouldIgnore(analyzerName, set) { continue diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R001/README.md b/vendor/github.com/bflad/tfproviderlint/passes/R001/README.md index 261b38f266d..e9a0fdd12fc 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/R001/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/R001/README.md @@ -20,3 +20,17 @@ for idx, key := range keys { d.Set("example1", "value1") d.Set("example2", "value2") ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:R001` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +keys := []string{"example1", "example2"} +values := []string{"value1", "value2"} + +for idx, key := range keys { + //lintignore:R001 + d.Set(key, values[idx]) +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R002/R002.go b/vendor/github.com/bflad/tfproviderlint/passes/R002/R002.go index 2e30626ea22..43a2a4f9741 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/R002/R002.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/R002/R002.go @@ -8,7 +8,7 @@ import ( "golang.org/x/tools/go/analysis" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/resourcedataset" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatasetcallexpr" ) const Doc = `check for ResourceData.Set() calls using * dereferences @@ -23,7 +23,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - resourcedataset.Analyzer, + resourcedatasetcallexpr.Analyzer, commentignore.Analyzer, }, Run: run, @@ -31,7 +31,7 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - sets := pass.ResultOf[resourcedataset.Analyzer].([]*ast.CallExpr) + sets := pass.ResultOf[resourcedatasetcallexpr.Analyzer].([]*ast.CallExpr) for _, set := range sets { if ignorer.ShouldIgnore(analyzerName, set) { continue diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R002/README.md b/vendor/github.com/bflad/tfproviderlint/passes/R002/README.md index 24d5c73a2f8..7913638fab0 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/R002/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/R002/README.md @@ -19,3 +19,14 @@ var stringPtr *string d.Set("example", stringPtr) ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:R002` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +var stringPtr *string + +//lintignore:R002 +d.Set("example", *stringPtr) +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R003/R003.go b/vendor/github.com/bflad/tfproviderlint/passes/R003/R003.go index b8a0d8f8ff1..19ccaa005cb 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/R003/R003.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/R003/R003.go @@ -3,12 +3,11 @@ package R003 import ( - "go/ast" - "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaresource" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourceinfo" ) const Doc = `check for Resource having Exists functions @@ -23,7 +22,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaresource.Analyzer, + resourceinfo.Analyzer, commentignore.Analyzer, }, Run: run, @@ -31,23 +30,19 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - resources := pass.ResultOf[schemaresource.Analyzer].([]*ast.CompositeLit) + resources := pass.ResultOf[resourceinfo.Analyzer].([]*schema.ResourceInfo) for _, resource := range resources { - if ignorer.ShouldIgnore(analyzerName, resource) { + if ignorer.ShouldIgnore(analyzerName, resource.AstCompositeLit) { continue } - for _, elt := range resource.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - if v.Key.(*ast.Ident).Name == "Exists" { - pass.Reportf(v.Key.Pos(), "%s: resource should not include Exists function", analyzerName) - break - } - } + kvExpr := resource.Fields[schema.ResourceFieldExists] + + if kvExpr == nil { + continue } + + pass.Reportf(kvExpr.Key.Pos(), "%s: resource should not include Exists function", analyzerName) } return nil, nil diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R003/README.md b/vendor/github.com/bflad/tfproviderlint/passes/R003/README.md index 518017bc489..cfda4b1ff68 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/R003/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/R003/README.md @@ -28,3 +28,16 @@ func resourceExampleThingRead(d *schema.ResourceData, meta interface{}) error { /* ... */ } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:R003` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +&schema.Resource{ + //lintignore:R003 + Exists: resourceExampleThingExists, + Read: resourceExampleThingRead, + /* ... */ +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R004/R004.go b/vendor/github.com/bflad/tfproviderlint/passes/R004/R004.go index e0aacf83d25..6e89e955bc7 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/R004/R004.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/R004/R004.go @@ -5,12 +5,12 @@ package R004 import ( "go/ast" "go/types" - "strings" "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/resourcedataset" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatasetcallexpr" ) const Doc = `check for ResourceData.Set() calls using incompatible value types @@ -25,7 +25,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - resourcedataset.Analyzer, + resourcedatasetcallexpr.Analyzer, commentignore.Analyzer, }, Run: run, @@ -33,7 +33,7 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - sets := pass.ResultOf[resourcedataset.Analyzer].([]*ast.CallExpr) + sets := pass.ResultOf[resourcedatasetcallexpr.Analyzer].([]*ast.CallExpr) for _, set := range sets { if ignorer.ShouldIgnore(analyzerName, set) { continue @@ -59,9 +59,7 @@ func isAllowedType(t types.Type) bool { default: return false case *types.Basic: - if !isAllowedBasicType(t) { - return false - } + return isAllowedBasicType(t) case *types.Interface: return true case *types.Map: @@ -76,20 +74,12 @@ func isAllowedType(t types.Type) bool { return isAllowedType(t.Elem().Underlying()) } case *types.Named: - if t.Obj().Name() != "Set" { - return false - } - // HasSuffix here due to vendoring - if !strings.HasSuffix(t.Obj().Pkg().Path(), "github.com/hashicorp/terraform-plugin-sdk/helper/schema") { - return false - } + return schema.IsNamedType(t, schema.TypeNameSet) case *types.Pointer: return isAllowedType(t.Elem()) case *types.Slice: return isAllowedType(t.Elem().Underlying()) } - - return true } var allowedBasicKindTypes = []types.BasicKind{ diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R004/README.md b/vendor/github.com/bflad/tfproviderlint/passes/R004/README.md index 710455173c9..dc2e0182ea6 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/R004/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/R004/README.md @@ -19,3 +19,14 @@ var t time.Time d.Set("example", t.Format(time.RFC3339)) ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:R004` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +var t time.Time + +//lintignore:R004 +d.Set("example", t) +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R005/R005.go b/vendor/github.com/bflad/tfproviderlint/passes/R005/R005.go new file mode 100644 index 00000000000..a53495d469c --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R005/R005.go @@ -0,0 +1,74 @@ +// Package R005 defines an Analyzer that checks for +// ResourceData.HasChange() calls that can be combined into +// a single HasChanges() call. +package R005 + +import ( + "go/ast" + "go/token" + "go/types" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +const Doc = `check for ResourceData.HasChange() calls that can be combined into a single HasChanges() call + +The R005 analyzer reports when multiple HasChange() calls in a conditional +can be combined into a single HasChanges() call.` + +const analyzerName = "R005" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + inspect.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.BinaryExpr)(nil), + } + + inspect.Preorder(nodeFilter, func(n ast.Node) { + binaryExpr := n.(*ast.BinaryExpr) + + if ignorer.ShouldIgnore(analyzerName, n) { + return + } + + if binaryExpr.Op != token.LOR { + return + } + + if !isHasChangeCall(binaryExpr.X, pass.TypesInfo) { + return + } + + if !isHasChangeCall(binaryExpr.Y, pass.TypesInfo) { + return + } + + pass.Reportf(binaryExpr.Pos(), "%s: multiple ResourceData.HasChange() calls can be combined with single HasChanges() call", analyzerName) + }) + + return nil, nil +} + +func isHasChangeCall(e ast.Expr, info *types.Info) bool { + switch e := e.(type) { + case *ast.CallExpr: + return schema.IsReceiverMethod(e.Fun, info, schema.TypeNameResourceData, "HasChange") + } + + return false +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R005/README.md b/vendor/github.com/bflad/tfproviderlint/passes/R005/README.md new file mode 100644 index 00000000000..21a6454db90 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R005/README.md @@ -0,0 +1,30 @@ +# R005 + +The R005 analyzer reports when multiple [`HasChange()`](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/schema#ResourceData.HasChange) calls in a conditional can be combined into a single [`HasChanges()`](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/schema#ResourceData.HasChanges) call. + +## Flagged Code + +```go +if d.HasChange("attr1") || d.HasChange("attr2") { + // handle attr1 and attr2 changes +} +``` + +## Passing Code + +```go +if d.HasChanges("attr1", "attr2") { + // handle attr1 and attr2 changes +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:R005` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:R005 +if d.HasChange("attr1") || d.HasChange("attr2") { + // handle attr1 and attr2 changes +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R006/R006.go b/vendor/github.com/bflad/tfproviderlint/passes/R006/R006.go new file mode 100644 index 00000000000..da27a3e6a25 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R006/R006.go @@ -0,0 +1,63 @@ +// Package R006 defines an Analyzer that checks for +// RetryFunc that omit retryable errors +package R006 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/resource/retryfuncinfo" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for RetryFunc that omit retryable errors + +The R006 analyzer reports when RetryFunc declarations are missing +retryable errors and should not be used as RetryFunc.` + +const analyzerName = "R006" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + retryfuncinfo.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + retryFuncs := pass.ResultOf[retryfuncinfo.Analyzer].([]*resource.RetryFuncInfo) + + for _, retryFunc := range retryFuncs { + if ignorer.ShouldIgnore(analyzerName, retryFunc.Node) { + continue + } + + var retryableErrorFound bool + + ast.Inspect(retryFunc.Body, func(n ast.Node) bool { + callExpr, ok := n.(*ast.CallExpr) + + if !ok { + return true + } + + if resource.IsFunc(callExpr.Fun, pass.TypesInfo, resource.FuncNameRetryableError) { + retryableErrorFound = true + return false + } + + return true + }) + + if !retryableErrorFound { + pass.Reportf(retryFunc.Pos, "%s: RetryFunc should include RetryableError() handling or be removed", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R006/README.md b/vendor/github.com/bflad/tfproviderlint/passes/R006/README.md new file mode 100644 index 00000000000..4afb2997335 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R006/README.md @@ -0,0 +1,63 @@ +# R006 + +The R006 analyzer reports when `RetryFunc` declarations are missing retryable errors (e.g. `RetryableError()` calls) and should not be used as `RetryFunc`. + +## Flagged Code + +```go +err := resource.Retry(1 * time.Minute, func() *RetryError { + // Calling API logic, e.g. + _, err := conn.DoSomething(input) + + if err != nil { + return resource.NonRetryableError(err) + } + + return nil +}) +``` + +## Passing Code + +```go +_, err := conn.DoSomething(input) + +if err != nil { + return err +} + +// or + +err := resource.Retry(1 * time.Minute, func() *RetryError { + // Calling API logic, e.g. + _, err := conn.DoSomething(input) + + if /* check err for retryable condition */ { + return resource.RetryableError(err) + } + + if err != nil { + return resource.NonRetryableError(err) + } + + return nil +}) +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:R006` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:R006 +err := resource.Retry(1 * time.Minute, func() *RetryError { + // Calling API logic, e.g. + _, err := conn.DoSomething(input) + + if err != nil { + return resource.NonRetryableError(err) + } + + return nil +}) +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R007/R007.go b/vendor/github.com/bflad/tfproviderlint/passes/R007/R007.go new file mode 100644 index 00000000000..1060470e9ed --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R007/R007.go @@ -0,0 +1,15 @@ +package R007 + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatapartialselectorexpr" +) + +var Analyzer = analysisutils.DeprecatedReceiverMethodSelectorExprAnalyzer( + "R007", + resourcedatapartialselectorexpr.Analyzer, + schema.PackageName, + schema.TypeNameResourceData, + "Partial", +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R007/README.md b/vendor/github.com/bflad/tfproviderlint/passes/R007/README.md new file mode 100644 index 00000000000..8953d2d028a --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R007/README.md @@ -0,0 +1,24 @@ +# R007 + +The R007 analyzer reports usage of the deprecated [(helper/schema.ResourceData).Partial()](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/helper/schema?tab=doc#ResourceData.Partial) function that does not need replacement. + +## Flagged Code + +```go +d.Partial(true), +``` + +## Passing Code + +```go +// Not present :) +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:R007` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:R007 +d.Partial(true), +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R008/R008.go b/vendor/github.com/bflad/tfproviderlint/passes/R008/R008.go new file mode 100644 index 00000000000..46cd3b1feb3 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R008/R008.go @@ -0,0 +1,15 @@ +package R008 + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatasetpartialselectorexpr" +) + +var Analyzer = analysisutils.DeprecatedReceiverMethodSelectorExprAnalyzer( + "R008", + resourcedatasetpartialselectorexpr.Analyzer, + schema.PackageName, + schema.TypeNameResourceData, + "SetPartial", +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R008/README.md b/vendor/github.com/bflad/tfproviderlint/passes/R008/README.md new file mode 100644 index 00000000000..40119fab671 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R008/README.md @@ -0,0 +1,24 @@ +# R008 + +The R008 analyzer reports usage of the deprecated [(helper/schema.ResourceData).SetPartial()](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/helper/schema?tab=doc#ResourceData.SetPartial) function that does not need replacement. + +## Flagged Code + +```go +d.SetPartial("example"), +``` + +## Passing Code + +```go +// Not present :) +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:R008` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:R008 +d.SetPartial("example"), +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R009/R009.go b/vendor/github.com/bflad/tfproviderlint/passes/R009/R009.go new file mode 100644 index 00000000000..ac92cfff624 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R009/R009.go @@ -0,0 +1,76 @@ +package R009 + +import ( + "go/ast" + + "github.com/bflad/gopaniccheck/passes/logpaniccallexpr" + "github.com/bflad/gopaniccheck/passes/logpanicfcallexpr" + "github.com/bflad/gopaniccheck/passes/logpaniclncallexpr" + "github.com/bflad/gopaniccheck/passes/paniccallexpr" + "github.com/bflad/tfproviderlint/passes/commentignore" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Go panic usage + +The R009 analyzer reports usage of Go panics, which should be avoided. +Any errors should be surfaced to Terraform, which will display them in the +user interface and ensures any necessary state actions (e.g. cleanup) are +performed as expected.` + +const analyzerName = "R009" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + logpaniccallexpr.Analyzer, + logpanicfcallexpr.Analyzer, + logpaniclncallexpr.Analyzer, + paniccallexpr.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + logPanicCallExprs := pass.ResultOf[logpaniccallexpr.Analyzer].([]*ast.CallExpr) + logPanicfCallExprs := pass.ResultOf[logpanicfcallexpr.Analyzer].([]*ast.CallExpr) + logPaniclnCallExprs := pass.ResultOf[logpaniclncallexpr.Analyzer].([]*ast.CallExpr) + panicCallExprs := pass.ResultOf[paniccallexpr.Analyzer].([]*ast.CallExpr) + + for _, logPanicCallExpr := range logPanicCallExprs { + if ignorer.ShouldIgnore(analyzerName, logPanicCallExpr) { + continue + } + + pass.Reportf(logPanicCallExpr.Pos(), "%s: avoid log.Panic() usage", analyzerName) + } + + for _, logPanicfCallExpr := range logPanicfCallExprs { + if ignorer.ShouldIgnore(analyzerName, logPanicfCallExpr) { + continue + } + + pass.Reportf(logPanicfCallExpr.Pos(), "%s: avoid log.Panicf() usage", analyzerName) + } + + for _, logPaniclnCallExpr := range logPaniclnCallExprs { + if ignorer.ShouldIgnore(analyzerName, logPaniclnCallExpr) { + continue + } + + pass.Reportf(logPaniclnCallExpr.Pos(), "%s: avoid log.Panicln() usage", analyzerName) + } + + for _, panicCallExpr := range panicCallExprs { + if ignorer.ShouldIgnore(analyzerName, panicCallExpr) { + continue + } + + pass.Reportf(panicCallExpr.Pos(), "%s: avoid panic() usage", analyzerName) + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R009/README.md b/vendor/github.com/bflad/tfproviderlint/passes/R009/README.md new file mode 100644 index 00000000000..e9a80291d36 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R009/README.md @@ -0,0 +1,30 @@ +# R009 + +The R009 analyzer reports usage of Go panics, which should be avoided. Any errors should be surfaced to Terraform, which will display them in the user interface and ensure any necessary state actions (e.g. cleanup) are performed as expected. + +## Flagged Code + +```go +panic("oops") + +log.Panic("eek") + +log.Panicf("yikes") + +log.Panicln("run away") +``` + +## Passing Code + +```go +// Not present :) +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:R009` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:R009 +panic("oops") +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R010/R010.go b/vendor/github.com/bflad/tfproviderlint/passes/R010/R010.go new file mode 100644 index 00000000000..a99746cced9 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R010/R010.go @@ -0,0 +1,48 @@ +package R010 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatagetchangeassignstmt" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for (schema.ResourceData).GetChange() usage that should prefer (schema.ResourceData).Get() + +The R010 analyzer reports when (schema.ResourceData).GetChange() assignments +are not using the first return value (assigned to _), which should be +replaced with (schema.ResourceData).Get() instead.` + +const analyzerName = "R010" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + resourcedatagetchangeassignstmt.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + assignStmts := pass.ResultOf[resourcedatagetchangeassignstmt.Analyzer].([]*ast.AssignStmt) + + for _, assignStmt := range assignStmts { + if ignorer.ShouldIgnore(analyzerName, assignStmt) { + continue + } + + ident, ok := assignStmt.Lhs[0].(*ast.Ident) + + if !ok || ident.Name != "_" { + continue + } + + pass.Reportf(assignStmt.Pos(), "%s: prefer d.Get() over d.GetChange() when only using second return value", analyzerName) + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R010/README.md b/vendor/github.com/bflad/tfproviderlint/passes/R010/README.md new file mode 100644 index 00000000000..330898030f2 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R010/README.md @@ -0,0 +1,24 @@ +# R010 + +The R010 analyzer reports when [(helper/schema.ResourceData).GetChange()](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/helper/schema?tab=doc#ResourceData.GetChange) assignments are not using the first return value (assigned to `_`), which should be replaced with [(helper/schema.ResourceData).Get()](https://pkg.go.dev/github.com/hashicorp/terraform-plugin-sdk/helper/schema?tab=doc#ResourceData.Get) instead. + +## Flagged Code + +```go +_, n := d.GetChange("example") +``` + +## Passing Code + +```go +n := d.Get("example") +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:R010` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:R010 +_, n := d.GetChange("example") +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R011/R011.go b/vendor/github.com/bflad/tfproviderlint/passes/R011/R011.go new file mode 100644 index 00000000000..36a039b0751 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R011/R011.go @@ -0,0 +1,52 @@ +package R011 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourceinfo" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Resource with MigrateState configured + +The R011 analyzer reports cases of resources which configure MigrateState. +After Terraform 0.12, resources must configure new state migrations via +StateUpgraders. Existing implementations of MigrateState prior to Terraform +0.12 can be ignored currently.` + +const analyzerName = "R011" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + resourceinfo.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + resourceInfos := pass.ResultOf[resourceinfo.Analyzer].([]*schema.ResourceInfo) + for _, resourceInfo := range resourceInfos { + if ignorer.ShouldIgnore(analyzerName, resourceInfo.AstCompositeLit) { + continue + } + + if resourceInfo.Resource.MigrateState == nil { + continue + } + + switch t := resourceInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(resourceInfo.AstCompositeLit.Lbrace, "%s: resource should configure StateUpgraders instead of MigrateState (implementations prior to Terraform 0.12 can be ignored)", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: resource should configure StateUpgraders instead of MigrateState (implementations prior to Terraform 0.12 can be ignored)", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R011/README.md b/vendor/github.com/bflad/tfproviderlint/passes/R011/README.md new file mode 100644 index 00000000000..9d990602ace --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R011/README.md @@ -0,0 +1,35 @@ +# R011 + +The R011 analyzer reports cases of `Resource` which configure `MigrateState`. After Terraform 0.12, resources must configure new state migrations via `StateUpgraders`. Existing implementations of `MigrateState` prior to Terraform 0.12 can be ignored currently. + +For additional information, see the [Extending Terraform documentation on state migrations](https://www.terraform.io/docs/extend/resources/state-migration.html). + +## Flagged Code + +```go +&schema.Resource{ + MigrateState: /* ... */, + SchemaVersion: 1, +} +``` + +## Passing Code + +```go +&schema.Resource{ + SchemaVersion: 1, + StateUpgraders: /* ... */, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:R011` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:R011 +&schema.Resource{ + MigrateState: /* ... */, + SchemaVersion: 1, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R012/R012.go b/vendor/github.com/bflad/tfproviderlint/passes/R012/R012.go new file mode 100644 index 00000000000..b89d25ec4e0 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R012/R012.go @@ -0,0 +1,50 @@ +package R012 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourceinfodatasourceonly" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for data source Resource with CustomizeDiff configured + +The R012 analyzer reports cases of data sources which configure CustomizeDiff, +which is not valid.` + +const analyzerName = "R012" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + resourceinfodatasourceonly.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + resourceInfos := pass.ResultOf[resourceinfodatasourceonly.Analyzer].([]*schema.ResourceInfo) + for _, resourceInfo := range resourceInfos { + if ignorer.ShouldIgnore(analyzerName, resourceInfo.AstCompositeLit) { + continue + } + + if !resourceInfo.DeclaresField(schema.ResourceFieldCustomizeDiff) { + continue + } + + switch t := resourceInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(resourceInfo.AstCompositeLit.Lbrace, "%s: data source should not configure CustomizeDiff", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: data source should not configure CustomizeDiff", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R012/README.md b/vendor/github.com/bflad/tfproviderlint/passes/R012/README.md new file mode 100644 index 00000000000..9736022d611 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R012/README.md @@ -0,0 +1,30 @@ +# R012 + +The R012 analyzer reports cases of data source `Resource` which configure `CustomizeDiff`, which is not valid. + +## Flagged Code + +```go +&schema.Resource{ + CustomizeDiff: /* ... */, +} +``` + +## Passing Code + +```go +&schema.Resource{ + // No CustomizeDiff: /* ... */, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:R012` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:R012 +&schema.Resource{ + CustomizeDiff: /* ... */, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R013/R013.go b/vendor/github.com/bflad/tfproviderlint/passes/R013/R013.go new file mode 100644 index 00000000000..e766ed497c6 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R013/R013.go @@ -0,0 +1,58 @@ +package R013 + +import ( + "go/ast" + "strings" + + "github.com/bflad/tfproviderlint/helper/astutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourcemapcompositelit" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for resource names that do not contain at least one underscore + +The R013 analyzer reports cases of resource names which do not include at least +one underscore character (_). Resources should be named with the provider name +and API resource name separated by an underscore to clarify where a resource is +declared and configured.` + +const analyzerName = "R013" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + resourcemapcompositelit.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + compositeLits := pass.ResultOf[resourcemapcompositelit.Analyzer].([]*ast.CompositeLit) + + for _, compositeLit := range compositeLits { + if ignorer.ShouldIgnore(analyzerName, compositeLit) { + continue + } + + for _, expr := range schema.GetResourceMapResourceNames(compositeLit) { + resourceName := astutils.ExprStringValue(expr) + + if resourceName == nil { + continue + } + + if strings.ContainsAny(*resourceName, "_") { + continue + } + + pass.Reportf(expr.Pos(), "%s: resource names should include the provider name and at least one underscore (_)", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R013/README.md b/vendor/github.com/bflad/tfproviderlint/passes/R013/README.md new file mode 100644 index 00000000000..7859247d8db --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R013/README.md @@ -0,0 +1,30 @@ +# R013 + +The R013 analyzer reports cases of resource names which do not include at least one underscore character (`_`). Resources should be named with the provider name and API resource name separated by an underscore to clarify where a resource is declared and configured. + +## Flagged Code + +```go +map[string]*schema.Resource{ + "thing": /* ... */, +} +``` + +## Passing Code + +```go +map[string]*schema.Resource{ + "example_thing": /* ... */, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:R013` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:R013 +map[string]*schema.Resource{ + "thing": /* ... */, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R014/R014.go b/vendor/github.com/bflad/tfproviderlint/passes/R014/R014.go new file mode 100644 index 00000000000..20a5ce5196a --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R014/R014.go @@ -0,0 +1,51 @@ +package R014 + +import ( + "github.com/bflad/tfproviderlint/helper/astutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/crudfuncinfo" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for CreateFunc, DeleteFunc, ReadFunc, and UpdateFunc parameter naming + +The R014 analyzer reports when CreateFunc, DeleteFunc, ReadFunc, and UpdateFunc +declarations do not use d as the name for the *schema.ResourceData parameter +or meta as the name for the interface{} parameter. This parameter naming is the +standard convention for resources.` + +const analyzerName = "R014" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + crudfuncinfo.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + crudFuncs := pass.ResultOf[crudfuncinfo.Analyzer].([]*schema.CRUDFuncInfo) + + for _, crudFunc := range crudFuncs { + if ignorer.ShouldIgnore(analyzerName, crudFunc.Node) { + continue + } + + params := crudFunc.Type.Params + + if name := astutils.FieldListName(params, 0, 0); name != nil && *name != "_" && *name != "d" { + pass.Reportf(params.List[0].Pos(), "%s: *schema.ResourceData parameter of CreateFunc, ReadFunc, UpdateFunc, or DeleteFunc should be named d", analyzerName) + } + + if name := astutils.FieldListName(params, 1, 0); name != nil && *name != "_" && *name != "meta" { + pass.Reportf(params.List[1].Pos(), "%s: interface{} parameter of CreateFunc, ReadFunc, UpdateFunc, or DeleteFunc should be named meta", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/R014/README.md b/vendor/github.com/bflad/tfproviderlint/passes/R014/README.md new file mode 100644 index 00000000000..3d38e7b2b83 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/R014/README.md @@ -0,0 +1,32 @@ +# R014 + +The R014 analyzer reports when `CreateFunc`, `DeleteFunc`, `ReadFunc`, and `UpdateFunc` declarations do not use `d` as the name for the `*schema.ResourceData` parameter or `meta` as the name for the `interface{}` parameter. This parameter naming is the standard convention for resources. + +## Flagged Code + +```go +func resourceExampleThingCreate(invalid *schema.ResourceData, meta interface{}) error { /* ... */ } + +func resourceExampleThingRead(d *schema.ResourceData, invalid interface{}) error { /* ... */ } + +func resourceExampleThingDelete(invalid *schema.ResourceData, invalid interface{}) error { /* ... */ } +``` + +## Passing Code + +```go +func resourceExampleThingCreate(d *schema.ResourceData, meta interface{}) error { /* ... */ } + +func resourceExampleThingRead(d *schema.ResourceData, meta interface{}) error { /* ... */ } + +func resourceExampleThingDelete(d *schema.ResourceData, meta interface{}) error { /* ... */ } +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:R014` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:R014 +func resourceExampleThingCreate(invalid *schema.ResourceData, meta interface{}) error { /* ... */ } +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S001/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S001/README.md index 985d08cacf5..c66b6010516 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S001/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S001/README.md @@ -28,3 +28,14 @@ which will fail schema validation. Elem: &schema.Schema{Type: schema.TypeString}, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S001` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S001 +&schema.Schema{ + Type: schema.TypeList, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S001/S001.go b/vendor/github.com/bflad/tfproviderlint/passes/S001/S001.go index a96be519645..879ad66852c 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S001/S001.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S001/S001.go @@ -4,13 +4,12 @@ package S001 import ( "go/ast" - "go/types" - "strings" "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" ) const Doc = `check for Schema of TypeList or TypeSet missing Elem @@ -24,7 +23,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, + schemainfo.Analyzer, commentignore.Analyzer, }, Run: run, @@ -32,61 +31,25 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var elemFound, typeListOrSet bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - if name == "Elem" { - elemFound = true - continue - } - - if name != "Type" { - continue - } - - switch v := v.Value.(type) { - default: - continue - case *ast.SelectorExpr: - // Use AST over TypesInfo here as schema uses ValueType - if v.Sel.Name != "TypeList" && v.Sel.Name != "TypeSet" { - continue - } - - switch t := pass.TypesInfo.TypeOf(v).(type) { - default: - continue - case *types.Named: - // HasSuffix here due to vendoring - if !strings.HasSuffix(t.Obj().Pkg().Path(), "github.com/hashicorp/terraform-plugin-sdk/helper/schema") { - continue - } + if schemaInfo.DeclaresField(schema.SchemaFieldElem) { + continue + } - typeListOrSet = true - } - } - } + if !schemaInfo.IsOneOfTypes(schema.SchemaValueTypeList, schema.SchemaValueTypeSet) { + continue } - if typeListOrSet && !elemFound { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema of TypeList or TypeSet should include Elem", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema of TypeList or TypeSet should include Elem", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema of TypeList or TypeSet should include Elem", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema of TypeList or TypeSet should include Elem", analyzerName) } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S002/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S002/README.md index 2175f075b4a..70330912aa0 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S002/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S002/README.md @@ -25,3 +25,15 @@ _ = schema.Schema{ Optional: true, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S002` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S002 +_ = schema.Schema{ + Required: true, + Optional: true, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S002/S002.go b/vendor/github.com/bflad/tfproviderlint/passes/S002/S002.go index 18ec5dbaaf8..ed1af20bdc7 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S002/S002.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S002/S002.go @@ -7,8 +7,9 @@ import ( "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" ) const Doc = `check for Schema with both Required and Optional enabled @@ -22,7 +23,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, + schemainfo.Analyzer, commentignore.Analyzer, }, Run: run, @@ -30,52 +31,21 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var optionalEnabled, requiredEnabled bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - if name != "Optional" && name != "Required" { - continue - } - - switch v := v.Value.(type) { - default: - continue - case *ast.Ident: - value := v.Name - - if value != "true" { - continue - } - - if name == "Optional" { - optionalEnabled = true - continue - } - - requiredEnabled = true - } - } + if !schemaInfo.Schema.Optional || !schemaInfo.Schema.Required { + continue } - if optionalEnabled && requiredEnabled { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema should not enable Required and Optional", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema should not enable Required and Optional", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not enable Required and Optional", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not enable Required and Optional", analyzerName) } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S003/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S003/README.md index 4518b267d1b..8b7e3f6e19b 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S003/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S003/README.md @@ -26,3 +26,15 @@ and `Computed`, which will fail provider schema validation. Computed: true, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S003` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S003 +&schema.Schema{ + Required: true, + Computed: true, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S003/S003.go b/vendor/github.com/bflad/tfproviderlint/passes/S003/S003.go index 8f6750c8a1c..71a2b0e600d 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S003/S003.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S003/S003.go @@ -7,8 +7,9 @@ import ( "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" ) const Doc = `check for Schema with both Required and Computed enabled @@ -22,7 +23,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, + schemainfo.Analyzer, commentignore.Analyzer, }, Run: run, @@ -30,52 +31,21 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var computedEnabled, requiredEnabled bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - if name != "Computed" && name != "Required" { - continue - } - - switch v := v.Value.(type) { - default: - continue - case *ast.Ident: - value := v.Name - - if value != "true" { - continue - } - - if name == "Computed" { - computedEnabled = true - continue - } - - requiredEnabled = true - } - } + if !schemaInfo.Schema.Computed || !schemaInfo.Schema.Required { + continue } - if computedEnabled && requiredEnabled { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema should not enable Required and Computed", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema should not enable Required and Computed", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not enable Required and Computed", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not enable Required and Computed", analyzerName) } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S004/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S004/README.md index c77bac6f701..efb8fb88ab7 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S004/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S004/README.md @@ -26,3 +26,15 @@ and configures `Default`, which will fail provider schema validation. Default: /* ... */, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S004` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S004 +&schema.Schema{ + Required: true, + Default: /* ... */, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S004/S004.go b/vendor/github.com/bflad/tfproviderlint/passes/S004/S004.go index 42dba273487..5e1bc5173cc 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S004/S004.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S004/S004.go @@ -7,8 +7,9 @@ import ( "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" ) const Doc = `check for Schema with Required enabled and Default configured @@ -22,7 +23,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, + schemainfo.Analyzer, commentignore.Analyzer, }, Run: run, @@ -30,56 +31,21 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var defaultConfigured, requiredEnabled bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - if name != "Default" && name != "Required" { - continue - } - - switch v := v.Value.(type) { - default: - if name == "Default" { - defaultConfigured = true - } - - continue - case *ast.Ident: - value := v.Name - - if name == "Default" && value != "nil" { - defaultConfigured = true - continue - } - - if value != "true" { - continue - } - - requiredEnabled = true - } - } + if !schemaInfo.Schema.Required || schemaInfo.Schema.Default == nil { + continue } - if defaultConfigured && requiredEnabled { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema should not enable Required and configure Default", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema should not enable Required and configure Default", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not enable Required and configure Default", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not enable Required and configure Default", analyzerName) } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S005/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S005/README.md index e8ba32f6f02..665069ad9bf 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S005/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S005/README.md @@ -25,3 +25,15 @@ and configures `Default`, which will fail provider schema validation. Default: true, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S005` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S005 +&schema.Schema{ + Computed: true, + Default: /* ... */, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S005/S005.go b/vendor/github.com/bflad/tfproviderlint/passes/S005/S005.go index 6a9cbdb711f..3dfaa0d7410 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S005/S005.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S005/S005.go @@ -7,8 +7,9 @@ import ( "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" ) const Doc = `check for Schema with Computed enabled and Default configured @@ -22,7 +23,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, + schemainfo.Analyzer, commentignore.Analyzer, }, Run: run, @@ -30,56 +31,21 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var computedEnabled, defaultConfigured bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - if name != "Default" && name != "Computed" { - continue - } - - switch v := v.Value.(type) { - default: - if name == "Default" { - defaultConfigured = true - } - - continue - case *ast.Ident: - value := v.Name - - if name == "Default" && value != "nil" { - defaultConfigured = true - continue - } - - if value != "true" { - continue - } - - computedEnabled = true - } - } + if !schemaInfo.Schema.Computed || schemaInfo.Schema.Default == nil { + continue } - if computedEnabled && defaultConfigured { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema should not enable Computed and configure Default", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema should not enable Computed and configure Default", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not enable Computed and configure Default", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not enable Computed and configure Default", analyzerName) } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S006/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S006/README.md index 27283c02a9b..98fe7793dc5 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S006/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S006/README.md @@ -20,3 +20,14 @@ and may be required in the future. Elem: &schema.Schema{Type: schema.TypeString}, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S006` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S006 +&schema.Schema{ + Type: schema.TypeMap, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S006/S006.go b/vendor/github.com/bflad/tfproviderlint/passes/S006/S006.go index fc9106cc903..4bd68a29beb 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S006/S006.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S006/S006.go @@ -4,13 +4,12 @@ package S006 import ( "go/ast" - "go/types" - "strings" "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" ) const Doc = `check for Schema of TypeMap missing Elem @@ -25,7 +24,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, + schemainfo.Analyzer, commentignore.Analyzer, }, Run: run, @@ -33,62 +32,25 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var elemFound bool - var typeMap bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - if name == "Elem" { - elemFound = true - continue - } - - if name != "Type" { - continue - } - - switch v := v.Value.(type) { - default: - continue - case *ast.SelectorExpr: - // Use AST over TypesInfo here as schema uses ValueType - if v.Sel.Name != "TypeMap" { - continue - } - - switch t := pass.TypesInfo.TypeOf(v).(type) { - default: - continue - case *types.Named: - // HasSuffix here due to vendoring - if !strings.HasSuffix(t.Obj().Pkg().Path(), "github.com/hashicorp/terraform-plugin-sdk/helper/schema") { - continue - } + if schemaInfo.DeclaresField(schema.SchemaFieldElem) { + continue + } - typeMap = true - } - } - } + if !schemaInfo.IsType(schema.SchemaValueTypeMap) { + continue } - if typeMap && !elemFound { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema of TypeMap should include Elem", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema of TypeMap should include Elem", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema of TypeMap should include Elem", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema of TypeMap should include Elem", analyzerName) } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S007/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S007/README.md index ac45e3bc413..9d27909a038 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S007/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S007/README.md @@ -26,3 +26,15 @@ and configures `ConflictsWith`, which will fail provider schema validation. ConflictsWith: /* ... */, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S007` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S007 +&schema.Schema{ + Required: true, + ConflictsWith: /* ... */, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S007/S007.go b/vendor/github.com/bflad/tfproviderlint/passes/S007/S007.go index e3cd9c85ff8..d1d57fc6733 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S007/S007.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S007/S007.go @@ -7,8 +7,9 @@ import ( "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" ) const Doc = `check for Schema with Required enabled and ConflictsWith configured @@ -22,7 +23,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, + schemainfo.Analyzer, commentignore.Analyzer, }, Run: run, @@ -30,56 +31,21 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var conflictsWithConfigured, requiredEnabled bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - if name != "ConflictsWith" && name != "Required" { - continue - } - - switch v := v.Value.(type) { - default: - if name == "ConflictsWith" { - conflictsWithConfigured = true - } - - continue - case *ast.Ident: - value := v.Name - - if name == "ConflictsWith" && value != "nil" { - conflictsWithConfigured = true - continue - } - - if value != "true" { - continue - } - - requiredEnabled = true - } - } + if !schemaInfo.Schema.Required || schemaInfo.Schema.ConflictsWith == nil { + continue } - if conflictsWithConfigured && requiredEnabled { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema should not enable Required and configure ConflictsWith", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema should not enable Required and configure ConflictsWith", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not enable Required and configure ConflictsWith", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not enable Required and configure ConflictsWith", analyzerName) } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S008/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S008/README.md index 409fe232cf3..37f74f1a59d 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S008/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S008/README.md @@ -28,3 +28,15 @@ which will fail schema validation. Type: schema.TypeSet, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S008` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S008 +&schema.Schema{ + Type: schema.TypeList, + Default: /* ... */, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S008/S008.go b/vendor/github.com/bflad/tfproviderlint/passes/S008/S008.go index 1ccbf389b86..a15a370df32 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S008/S008.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S008/S008.go @@ -4,13 +4,12 @@ package S008 import ( "go/ast" - "go/types" - "strings" "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" ) const Doc = `check for Schema of TypeList or TypeSet with Default configured @@ -24,7 +23,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, + schemainfo.Analyzer, commentignore.Analyzer, }, Run: run, @@ -32,61 +31,25 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var defaultFound, typeListOrSet bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - if name == "Default" { - defaultFound = true - continue - } - - if name != "Type" { - continue - } - - switch v := v.Value.(type) { - default: - continue - case *ast.SelectorExpr: - // Use AST over TypesInfo here as schema uses ValueType - if v.Sel.Name != "TypeList" && v.Sel.Name != "TypeSet" { - continue - } - - switch t := pass.TypesInfo.TypeOf(v).(type) { - default: - continue - case *types.Named: - // HasSuffix here due to vendoring - if !strings.HasSuffix(t.Obj().Pkg().Path(), "github.com/hashicorp/terraform-plugin-sdk/helper/schema") { - continue - } + if !schemaInfo.DeclaresField(schema.SchemaFieldDefault) { + continue + } - typeListOrSet = true - } - } - } + if !schemaInfo.IsOneOfTypes(schema.SchemaValueTypeList, schema.SchemaValueTypeSet) { + continue } - if typeListOrSet && defaultFound { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema of TypeList or TypeSet should not include Default", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema of TypeList or TypeSet should not include Default", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema of TypeList or TypeSet should not include Default", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema of TypeList or TypeSet should not include Default", analyzerName) } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S009/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S009/README.md index 38a21b52d7c..38cf19c5b3a 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S009/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S009/README.md @@ -48,3 +48,16 @@ which will fail schema validation. }, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S009` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S009 +&schema.Schema{ + Type: schema.TypeList, + Elem: &schema.Schema{Type: schema.TypeString}, + ValidateFunc: /* ... */, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S009/S009.go b/vendor/github.com/bflad/tfproviderlint/passes/S009/S009.go index 3023ba083bf..e59fb477826 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S009/S009.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S009/S009.go @@ -4,13 +4,12 @@ package S009 import ( "go/ast" - "go/types" - "strings" "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" ) const Doc = `check for Schema of TypeList or TypeSet with ValidateFunc configured @@ -24,7 +23,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, + schemainfo.Analyzer, commentignore.Analyzer, }, Run: run, @@ -32,61 +31,25 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var validateFuncFound, typeListOrSet bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - if name == "ValidateFunc" { - validateFuncFound = true - continue - } - - if name != "Type" { - continue - } - - switch v := v.Value.(type) { - default: - continue - case *ast.SelectorExpr: - // Use AST over TypesInfo here as schema uses ValueType - if v.Sel.Name != "TypeList" && v.Sel.Name != "TypeSet" { - continue - } - - switch t := pass.TypesInfo.TypeOf(v).(type) { - default: - continue - case *types.Named: - // HasSuffix here due to vendoring - if !strings.HasSuffix(t.Obj().Pkg().Path(), "github.com/hashicorp/terraform-plugin-sdk/helper/schema") { - continue - } + if !schemaInfo.DeclaresField(schema.SchemaFieldValidateFunc) { + continue + } - typeListOrSet = true - } - } - } + if !schemaInfo.IsOneOfTypes(schema.SchemaValueTypeList, schema.SchemaValueTypeSet) { + continue } - if typeListOrSet && validateFuncFound { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema of TypeList or TypeSet should not include top level ValidateFunc", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema of TypeList or TypeSet should not include top level ValidateFunc", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema of TypeList or TypeSet should not include top level ValidateFunc", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema of TypeList or TypeSet should not include top level ValidateFunc", analyzerName) } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S010/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S010/README.md index 1acac31c267..6b2f7f307d0 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S010/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S010/README.md @@ -19,3 +19,15 @@ and configures `ValidateFunc`, which will fail provider schema validation. Computed: true, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S010` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S010 +&schema.Schema{ + Computed: true, + ValidateFunc: /* ... */, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S010/S010.go b/vendor/github.com/bflad/tfproviderlint/passes/S010/S010.go index 34d87e7859e..a73a30a7160 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S010/S010.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S010/S010.go @@ -5,10 +5,10 @@ package S010 import ( "go/ast" - "golang.org/x/tools/go/analysis" - + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfocomputedonly" + "golang.org/x/tools/go/analysis" ) const Doc = `check for Schema with only Computed enabled and ValidateFunc configured @@ -22,67 +22,29 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, commentignore.Analyzer, + schemainfocomputedonly.Analyzer, }, Run: run, } func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfocomputedonly.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var computedEnabled, optionalOrRequiredEnabled, validateFuncConfigured bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - switch v := v.Value.(type) { - default: - if name == "ValidateFunc" { - validateFuncConfigured = true - } - - continue - case *ast.Ident: - value := v.Name - - switch name { - case "Computed": - if value == "true" { - computedEnabled = true - continue - } - case "Optional", "Required": - if value == "true" { - optionalOrRequiredEnabled = true - break - } - case "ValidateFunc": - if value != "nil" { - validateFuncConfigured = true - continue - } - } - } - } + if schemaInfo.Schema.ValidateFunc == nil { + continue } - if computedEnabled && !optionalOrRequiredEnabled && validateFuncConfigured { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema should not only enable Computed and configure ValidateFunc", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema should not only enable Computed and configure ValidateFunc", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not only enable Computed and configure ValidateFunc", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not only enable Computed and configure ValidateFunc", analyzerName) } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S011/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S011/README.md index ab225e8adc3..cda4d885e02 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S011/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S011/README.md @@ -19,3 +19,15 @@ and configures `DiffSuppressFunc`, which will fail provider schema validation. Computed: true, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S011` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S011 +&schema.Schema{ + Computed: true, + DiffSuppressFunc: /* ... */, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S011/S011.go b/vendor/github.com/bflad/tfproviderlint/passes/S011/S011.go index 9c104fb62e0..bcaa234e4b2 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S011/S011.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S011/S011.go @@ -5,10 +5,10 @@ package S011 import ( "go/ast" - "golang.org/x/tools/go/analysis" - + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfocomputedonly" + "golang.org/x/tools/go/analysis" ) const Doc = `check for Schema with only Computed enabled and DiffSuppressFunc configured @@ -22,67 +22,29 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, commentignore.Analyzer, + schemainfocomputedonly.Analyzer, }, Run: run, } func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfocomputedonly.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var computedEnabled, optionalOrRequiredEnabled, diffSuppressFuncConfigured bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - switch v := v.Value.(type) { - default: - if name == "DiffSuppressFunc" { - diffSuppressFuncConfigured = true - } - - continue - case *ast.Ident: - value := v.Name - - switch name { - case "Computed": - if value == "true" { - computedEnabled = true - continue - } - case "Optional", "Required": - if value == "true" { - optionalOrRequiredEnabled = true - break - } - case "DiffSuppressFunc": - if value != "nil" { - diffSuppressFuncConfigured = true - continue - } - } - } - } + if schemaInfo.Schema.DiffSuppressFunc == nil { + continue } - if computedEnabled && !optionalOrRequiredEnabled && diffSuppressFuncConfigured { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema should not only enable Computed and configure DiffSuppressFunc", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema should not only enable Computed and configure DiffSuppressFunc", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not only enable Computed and configure DiffSuppressFunc", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not only enable Computed and configure DiffSuppressFunc", analyzerName) } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S012/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S012/README.md index aa13e3ab283..65ce2076f01 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S012/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S012/README.md @@ -37,3 +37,14 @@ _ = schema.Schema{ Type: schema.TypeString, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S012` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S012 +_ = schema.Schema{ + Computed: true, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S012/S012.go b/vendor/github.com/bflad/tfproviderlint/passes/S012/S012.go index e65e603cf48..7025b782a38 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S012/S012.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S012/S012.go @@ -7,8 +7,9 @@ import ( "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" ) const Doc = `check for Schema that Type is configured @@ -22,7 +23,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, + schemainfo.Analyzer, commentignore.Analyzer, }, Run: run, @@ -30,35 +31,21 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var typeConfigured bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - if name == "Type" { - typeConfigured = true - break - } - } + if schemaInfo.DeclaresField(schema.SchemaFieldType) { + continue } - if !typeConfigured { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema should configure Type", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema should configure Type", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should configure Type", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should configure Type", analyzerName) } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S013/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S013/README.md index 57e917a3246..bbbf18a26d2 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S013/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S013/README.md @@ -42,3 +42,16 @@ map[string]*schema.Schema{ }, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S013` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S013 +map[string]*schema.Schema{ + "attribute_name": { + Type: schema.TypeString, + }, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S013/S013.go b/vendor/github.com/bflad/tfproviderlint/passes/S013/S013.go index e846138a51f..92457a3e4cb 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S013/S013.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S013/S013.go @@ -8,8 +8,9 @@ import ( "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemamap" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemamapcompositelit" ) const Doc = `check for Schema that are missing required fields @@ -24,7 +25,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemamap.Analyzer, + schemamapcompositelit.Analyzer, commentignore.Analyzer, }, Run: run, @@ -32,45 +33,25 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemamaps := pass.ResultOf[schemamap.Analyzer].([]*ast.CompositeLit) + schemamapcompositelits := pass.ResultOf[schemamapcompositelit.Analyzer].([]*ast.CompositeLit) - for _, smap := range schemamaps { - for _, schema := range schemamap.GetSchemaAttributes(smap) { - if ignorer.ShouldIgnore(analyzerName, schema) { + for _, smap := range schemamapcompositelits { + for _, schemaCompositeLit := range schema.GetSchemaMapSchemas(smap) { + schemaInfo := schema.NewSchemaInfo(schemaCompositeLit, pass.TypesInfo) + + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var computedOrOptionalOrRequiredEnabled bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - switch v := v.Value.(type) { - case *ast.Ident: - value := v.Name - - switch name { - case "Computed", "Optional", "Required": - if value == "true" { - computedOrOptionalOrRequiredEnabled = true - break - } - } - } - } + if schemaInfo.Schema.Computed || schemaInfo.Schema.Optional || schemaInfo.Schema.Required { + continue } - if !computedOrOptionalOrRequiredEnabled { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema should configure one of Computed, Optional, or Required", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema should configure one of Computed, Optional, or Required", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should configure one of Computed, Optional, or Required", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should configure one of Computed, Optional, or Required", analyzerName) } } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S014/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S014/README.md index a66fbcd991b..69f7e097263 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S014/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S014/README.md @@ -31,3 +31,21 @@ map[string]*schema.Schema{ }, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S014` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S014 +map[string]*schema.Schema{ + "attribute_name": { + Elem: &schema.Schema{ + Required: true, + Type: schema.TypeString, + }, + Required: true, + Type: schema.TypeList, + }, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S014/S014.go b/vendor/github.com/bflad/tfproviderlint/passes/S014/S014.go index a6852fc6d71..aacd630a667 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S014/S014.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S014/S014.go @@ -9,9 +9,9 @@ import ( "golang.org/x/tools/go/analysis" - "github.com/bflad/tfproviderlint/helper/terraformtype" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemamap" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemamapcompositelit" ) const Doc = `check for Schema that Elem does not contain extraneous fields @@ -26,7 +26,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemamap.Analyzer, + schemamapcompositelit.Analyzer, commentignore.Analyzer, }, Run: run, @@ -34,53 +34,41 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemamaps := pass.ResultOf[schemamap.Analyzer].([]*ast.CompositeLit) + schemamapcompositelits := pass.ResultOf[schemamapcompositelit.Analyzer].([]*ast.CompositeLit) - for _, smap := range schemamaps { - for _, schema := range schemamap.GetSchemaAttributes(smap) { - if ignorer.ShouldIgnore(analyzerName, schema) { + for _, smap := range schemamapcompositelits { + for _, schemaCompositeLit := range schema.GetSchemaMapSchemas(smap) { + schemaInfo := schema.NewSchemaInfo(schemaCompositeLit, pass.TypesInfo) + + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - for _, elt := range schema.Elts { - // filter to Elem - switch tElt := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := tElt.Key.(*ast.Ident).Name + elemKvExpr := schemaInfo.Fields[schema.SchemaFieldElem] - if name != "Elem" { - continue - } + if elemKvExpr == nil { + continue + } - // search within Elem - switch elemValue := tElt.Value.(type) { - default: - continue - case *ast.UnaryExpr: - if elemValue.Op != token.AND || !terraformtype.IsTypeHelperSchema(pass.TypesInfo.TypeOf(elemValue.X)) { - continue - } + // search within Elem + switch elemValue := elemKvExpr.Value.(type) { + default: + continue + case *ast.UnaryExpr: + if elemValue.Op != token.AND || !schema.IsTypeSchema(pass.TypesInfo.TypeOf(elemValue.X)) { + continue + } + + switch tElemSchema := elemValue.X.(type) { + default: + continue + case *ast.CompositeLit: + elemSchema := schema.NewSchemaInfo(tElemSchema, pass.TypesInfo) - switch tElemSchema := elemValue.X.(type) { - default: - continue - case *ast.CompositeLit: - for _, elemSchemaElt := range tElemSchema.Elts { - switch v := elemSchemaElt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - switch name { - case "Computed", "Optional", "Required": - pass.Reportf(elemSchemaElt.Pos(), "%s: schema within Elem should not configure Computed, Optional, or Required", analyzerName) - break - } - } - } + for _, field := range []string{schema.SchemaFieldComputed, schema.SchemaFieldOptional, schema.SchemaFieldRequired} { + if kvExpr := elemSchema.Fields[field]; kvExpr != nil { + pass.Reportf(kvExpr.Pos(), "%s: schema within Elem should not configure Computed, Optional, or Required", analyzerName) + break } } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S015/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S015/README.md index c859deb24d9..f3fe10a6fd3 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S015/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S015/README.md @@ -46,3 +46,17 @@ map[string]*schema.Schema{ }, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S015` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S015 +map[string]*schema.Schema{ + "INVALID": { + Required: true, + Type: schema.TypeString, + }, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S015/S015.go b/vendor/github.com/bflad/tfproviderlint/passes/S015/S015.go index 1f2459cb30b..1e62bd2dda8 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S015/S015.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S015/S015.go @@ -10,8 +10,9 @@ import ( "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemamap" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemamapcompositelit" ) const Doc = `check for Schema that attribute names are valid @@ -26,7 +27,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemamap.Analyzer, + schemamapcompositelit.Analyzer, commentignore.Analyzer, }, Run: run, @@ -34,16 +35,16 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemamaps := pass.ResultOf[schemamap.Analyzer].([]*ast.CompositeLit) + schemamapcompositelits := pass.ResultOf[schemamapcompositelit.Analyzer].([]*ast.CompositeLit) attributeNameRegex := regexp.MustCompile(`^[a-z0-9_]+$`) - for _, smap := range schemamaps { + for _, smap := range schemamapcompositelits { if ignorer.ShouldIgnore(analyzerName, smap) { continue } - for _, attributeName := range schemamap.GetSchemaAttributeNames(smap) { + for _, attributeName := range schema.GetSchemaMapAttributeNames(smap) { switch t := attributeName.(type) { default: continue diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S016/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S016/README.md index b3730e49d4b..72275658623 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S016/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S016/README.md @@ -20,3 +20,15 @@ which will fail schema validation. Type: schema.TypeSet, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S016` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S016 +&schema.Schema{ + Set: /* ... */, + Type: schema.TypeList, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S016/S016.go b/vendor/github.com/bflad/tfproviderlint/passes/S016/S016.go index ebcd46212cc..971386a7376 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S016/S016.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S016/S016.go @@ -4,13 +4,12 @@ package S016 import ( "go/ast" - "go/types" - "strings" "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" ) const Doc = `check for Schema including Set without TypeSet @@ -24,7 +23,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, + schemainfo.Analyzer, commentignore.Analyzer, }, Run: run, @@ -32,61 +31,25 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var setFound, typeSetFound bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - if name == "Set" { - setFound = true - continue - } - - if name != "Type" { - continue - } - - switch v := v.Value.(type) { - default: - continue - case *ast.SelectorExpr: - // Use AST over TypesInfo here as schema uses ValueType - if v.Sel.Name != "TypeSet" { - continue - } - - switch t := pass.TypesInfo.TypeOf(v).(type) { - default: - continue - case *types.Named: - // HasSuffix here due to vendoring - if !strings.HasSuffix(t.Obj().Pkg().Path(), "github.com/hashicorp/terraform-plugin-sdk/helper/schema") { - continue - } + if !schemaInfo.DeclaresField(schema.SchemaFieldSet) { + continue + } - typeSetFound = true - } - } - } + if schemaInfo.IsType(schema.SchemaValueTypeSet) { + continue } - if setFound && !typeSetFound { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema Set should only be included for TypeSet", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema Set should only be included for TypeSet", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema Set should only be included for TypeSet", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema Set should only be included for TypeSet", analyzerName) } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S017/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S017/README.md index 53ebf8f4a93..88c4d8e970d 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S017/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S017/README.md @@ -25,3 +25,15 @@ fail schema validation. Type: schema.TypeString, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S017` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S017 +&schema.Schema{ + MaxItems: 1, + Type: schema.TypeString, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S017/S017.go b/vendor/github.com/bflad/tfproviderlint/passes/S017/S017.go index 813cbefe607..696c28f241f 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S017/S017.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S017/S017.go @@ -5,13 +5,12 @@ package S017 import ( "go/ast" - "go/types" - "strings" "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" ) const Doc = `check for Schema including MaxItems or MinItems without proper Type @@ -25,7 +24,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, + schemainfo.Analyzer, commentignore.Analyzer, }, Run: run, @@ -33,61 +32,25 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var maxOrMinItemsFound, typeListOrMapOrSetFound bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - if name == "MaxItems" || name == "MinItems" { - maxOrMinItemsFound = true - continue - } - - if name != "Type" { - continue - } - - switch v := v.Value.(type) { - default: - continue - case *ast.SelectorExpr: - // Use AST over TypesInfo here as schema uses ValueType - if v.Sel.Name != "TypeList" && v.Sel.Name != "TypeMap" && v.Sel.Name != "TypeSet" { - continue - } - - switch t := pass.TypesInfo.TypeOf(v).(type) { - default: - continue - case *types.Named: - // HasSuffix here due to vendoring - if !strings.HasSuffix(t.Obj().Pkg().Path(), "github.com/hashicorp/terraform-plugin-sdk/helper/schema") { - continue - } + if !schemaInfo.DeclaresField(schema.SchemaFieldMaxItems) && !schemaInfo.DeclaresField(schema.SchemaFieldMinItems) { + continue + } - typeListOrMapOrSetFound = true - } - } - } + if schemaInfo.IsOneOfTypes(schema.SchemaValueTypeList, schema.SchemaValueTypeMap, schema.SchemaValueTypeSet) { + continue } - if maxOrMinItemsFound && !typeListOrMapOrSetFound { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema MaxItems or MinItems should only be included for TypeList, TypeMap, or TypeSet", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema MaxItems or MinItems should only be included for TypeList, TypeMap, or TypeSet", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema MaxItems or MinItems should only be included for TypeList, TypeMap, or TypeSet", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema MaxItems or MinItems should only be included for TypeList, TypeMap, or TypeSet", analyzerName) } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S018/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S018/README.md index 36f11748fd9..69db228ac70 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S018/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S018/README.md @@ -1,27 +1,33 @@ # S018 -The S018 analyzer reports cases of schemas including `MaxItems` or -`MinItems` without `TypeList`, `TypeMap`, or `TypeSet`, which will -fail schema validation. +The S018 analyzer reports cases of `Schema` including `MaxItems: 1` and `Type: schema.TypeSet` that should be simplified to `Type: schema.TypeList`. ## Flagged Code ```go &schema.Schema{ MaxItems: 1, - Type: schema.TypeString, + Type: schema.TypeSet, } +``` + +## Passing Code +```go &schema.Schema{ - MinItems: 1, - Type: schema.TypeString, + MaxItems: 1, + Type: schema.TypeList, } ``` -## Passing Code +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S018` Go code comment at the end of the offending line or on the line immediately proceding, e.g. ```go +//lintignore:S018 &schema.Schema{ - Type: schema.TypeString, + MaxItems: 1, + Type: schema.TypeSet, } ``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S018/S018.go b/vendor/github.com/bflad/tfproviderlint/passes/S018/S018.go index 88f5f88bc00..74c2f407713 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S018/S018.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S018/S018.go @@ -4,13 +4,12 @@ package S018 import ( "go/ast" - "go/types" - "strings" "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" ) const Doc = `check for Schema that should prefer TypeList with MaxItems 1 @@ -24,7 +23,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, + schemainfo.Analyzer, commentignore.Analyzer, }, Run: run, @@ -32,72 +31,25 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - var maxItemsOne, typeSetFound bool - - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - if name != "MaxItems" && name != "Type" { - continue - } - - switch v := v.Value.(type) { - default: - continue - case *ast.BasicLit: - if name != "MaxItems" { - continue - } - - value := strings.Trim(v.Value, `"`) - - if value != "1" { - continue - } - - maxItemsOne = true - case *ast.SelectorExpr: - if name != "Type" { - continue - } - - // Use AST over TypesInfo here as schema uses ValueType - if v.Sel.Name != "TypeSet" { - continue - } - - switch t := pass.TypesInfo.TypeOf(v).(type) { - default: - continue - case *types.Named: - // HasSuffix here due to vendoring - if !strings.HasSuffix(t.Obj().Pkg().Path(), "github.com/hashicorp/terraform-plugin-sdk/helper/schema") { - continue - } + if !schemaInfo.IsType(schema.SchemaValueTypeSet) { + continue + } - typeSetFound = true - } - } - } + if schemaInfo.Schema.MaxItems != 1 { + continue } - if maxItemsOne && typeSetFound { - switch t := schema.Type.(type) { - default: - pass.Reportf(schema.Lbrace, "%s: schema should use TypeList with MaxItems 1", analyzerName) - case *ast.SelectorExpr: - pass.Reportf(t.Sel.Pos(), "%s: schema should use TypeList with MaxItems 1", analyzerName) - } + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should use TypeList with MaxItems 1", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should use TypeList with MaxItems 1", analyzerName) } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S019/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S019/README.md index 8344405ee84..a18c0dc4109 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S019/README.md +++ b/vendor/github.com/bflad/tfproviderlint/passes/S019/README.md @@ -37,3 +37,15 @@ The S019 analyzer reports cases of schemas including `Computed: false`, Computed: true, } ``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S019` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S019 +&schema.Schema{ + Computed: false, + Optional: true, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S019/S019.go b/vendor/github.com/bflad/tfproviderlint/passes/S019/S019.go index 9e613acbed0..58478c6c851 100644 --- a/vendor/github.com/bflad/tfproviderlint/passes/S019/S019.go +++ b/vendor/github.com/bflad/tfproviderlint/passes/S019/S019.go @@ -4,12 +4,11 @@ package S019 import ( - "go/ast" - "golang.org/x/tools/go/analysis" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" "github.com/bflad/tfproviderlint/passes/commentignore" - "github.com/bflad/tfproviderlint/passes/schemaschema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" ) const Doc = `check for Schema that should omit Computed, Optional, or Required set to false @@ -23,7 +22,7 @@ var Analyzer = &analysis.Analyzer{ Name: analyzerName, Doc: Doc, Requires: []*analysis.Analyzer{ - schemaschema.Analyzer, + schemainfo.Analyzer, commentignore.Analyzer, }, Run: run, @@ -31,31 +30,15 @@ var Analyzer = &analysis.Analyzer{ func run(pass *analysis.Pass) (interface{}, error) { ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) - schemas := pass.ResultOf[schemaschema.Analyzer].([]*ast.CompositeLit) - for _, schema := range schemas { - if ignorer.ShouldIgnore(analyzerName, schema) { + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { continue } - for _, elt := range schema.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - name := v.Key.(*ast.Ident).Name - - if name != "Computed" && name != "Optional" && name != "Required" { - continue - } - - switch v := v.Value.(type) { - default: - continue - case *ast.Ident: - if v.Name == "false" { - pass.Reportf(v.Pos(), "%s: schema should omit Computed, Optional, or Required set to false", analyzerName) - } - } + for _, field := range []string{schema.SchemaFieldComputed, schema.SchemaFieldOptional, schema.SchemaFieldRequired} { + if schemaInfo.DeclaresBoolFieldWithZeroValue(field) { + pass.Reportf(schemaInfo.Fields[field].Value.Pos(), "%s: schema should omit Computed, Optional, or Required set to false", analyzerName) } } } diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S020/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S020/README.md new file mode 100644 index 00000000000..50db94f4e8f --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S020/README.md @@ -0,0 +1,33 @@ +# S020 + +The S020 analyzer reports cases of schemas which enables only `Computed` +and enables `ForceNew`, which is invalid. + +## Flagged Code + +```go +&schema.Schema{ + Computed: true, + ForceNew: true, +} +``` + +## Passing Code + +```go +&schema.Schema{ + Computed: true, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S020` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S020 +&schema.Schema{ + Computed: true, + ForceNew: true, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S020/S020.go b/vendor/github.com/bflad/tfproviderlint/passes/S020/S020.go new file mode 100644 index 00000000000..5c847fd9f60 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S020/S020.go @@ -0,0 +1,56 @@ +// Package S020 defines an Analyzer that checks for +// Schema with only Computed enabled and ValidateFunc configured +package S020 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfocomputedonly" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Schema with only Computed enabled and ForceNew enabled + +The S020 analyzer reports cases of schemas which only enables Computed +and enables ForceNew, which is not valid.` + +const analyzerName = "S020" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemainfocomputedonly.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaInfos := pass.ResultOf[schemainfocomputedonly.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { + continue + } + + if !schemaInfo.Schema.Computed || schemaInfo.Schema.Optional || schemaInfo.Schema.Required { + continue + } + + if !schemaInfo.Schema.ForceNew { + continue + } + + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not only enable Computed and enable ForceNew", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not only enable Computed and enable ForceNew", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S021/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S021/README.md new file mode 100644 index 00000000000..6eac0d6ca86 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S021/README.md @@ -0,0 +1,32 @@ +# S021 + +The S021 analyzer reports cases of schemas including `ComputedWhen`, which should be removed. + +## Flagged Code + +```go +&schema.Schema{ + Computed: true, + ComputedWhen: []string{"another_attr"}, +} +``` + +## Passing Code + +```go +&schema.Schema{ + Computed: true, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S021` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S021 +&schema.Schema{ + Computed: true, + ComputedWhen: []string{"another_attr"}, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S021/S021.go b/vendor/github.com/bflad/tfproviderlint/passes/S021/S021.go new file mode 100644 index 00000000000..f9b8b0c66ee --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S021/S021.go @@ -0,0 +1,46 @@ +// Package S021 defines an Analyzer that checks for +// Schema that should omit ComputedWhen +package S021 + +import ( + "golang.org/x/tools/go/analysis" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" +) + +const Doc = `check for Schema that should omit ComputedWhen + +The S021 analyzer reports cases of schema that declare ComputedWhen that should +be removed.` + +const analyzerName = "S021" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + schemainfo.Analyzer, + commentignore.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { + continue + } + + field := schema.SchemaFieldComputedWhen + + if schemaInfo.DeclaresField(field) { + pass.Reportf(schemaInfo.Fields[field].Value.Pos(), "%s: schema should omit ComputedWhen", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S022/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S022/README.md new file mode 100644 index 00000000000..e239d93946a --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S022/README.md @@ -0,0 +1,49 @@ +# S022 + +The S022 analyzer reports cases of schema that declare `Elem` of `*schema.Resource` +with `TypeMap`, which has undefined behavior. Only `TypeList` and `TypeSet` can be +used for configuration block attributes. + +## Flagged Code + +```go +&schema.Schema{ + Type: schema.TypeMap, + Elem: &schema.Resource{}, +} +``` + +## Passing Code + +```go +&schema.Schema{ + Type: schema.TypeList, + Elem: &schema.Resource{}, +} + +// or + +&schema.Schema{ + Type: schema.TypeSet, + Elem: &schema.Resource{}, +} + +// or + +&schema.Schema{ + Type: schema.TypeMap, + Elem: &schema.Schema{}, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S022` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S022 +&schema.Schema{ + Type: schema.TypeMap, + Elem: &schema.Resource{}, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S022/S022.go b/vendor/github.com/bflad/tfproviderlint/passes/S022/S022.go new file mode 100644 index 00000000000..ff5c130b4f7 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S022/S022.go @@ -0,0 +1,56 @@ +// Package S022 defines an Analyzer that checks for +// Schema of TypeMap with invalid Elem of *schema.Resource +package S022 + +import ( + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Schema of TypeMap with invalid Elem of *schema.Resource + +The S022 analyzer reports cases of schema that declare Elem of *schema.Resource +with TypeMap, which has undefined behavior. Only TypeList and TypeSet can be +used for configuration block attributes.` + +const analyzerName = "S022" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + schemainfo.Analyzer, + commentignore.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { + continue + } + + if !schemaInfo.IsType(schema.SchemaValueTypeMap) { + continue + } + + if !schemaInfo.DeclaresField(schema.SchemaFieldElem) { + continue + } + + elem := schemaInfo.Fields[schema.SchemaFieldElem].Value + + if !schema.IsTypeResource(pass.TypesInfo.TypeOf(elem)) { + continue + } + + pass.Reportf(elem.Pos(), "%s: schema of TypeMap should not use Elem of *schema.Resource", analyzerName) + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S023/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S023/README.md new file mode 100644 index 00000000000..0c00c2d10b2 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S023/README.md @@ -0,0 +1,60 @@ +# S023 + +The S023 analyzer reports cases of schema including `Elem` that should +be removed with incompatible `Type`. + +## Flagged Code + +```go +&schema.Schema{ + Elem: &schema.Schema{}, + Type: TypeBool, +} + +&schema.Schema{ + Elem: &schema.Schema{}, + Type: TypeFloat, +} + +&schema.Schema{ + Elem: &schema.Schema{}, + Type: TypeInt, +} + +&schema.Schema{ + Elem: &schema.Schema{}, + Type: TypeString, +} +``` + +## Passing Code + +```go +&schema.Schema{ + Type: TypeBool, +} + +&schema.Schema{ + Type: TypeFloat, +} + +&schema.Schema{ + Type: TypeInt, +} + +&schema.Schema{ + Type: TypeString, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S023` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S023 +&schema.Schema{ + Elem: &schema.Schema{}, + Type: TypeBool, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S023/S023.go b/vendor/github.com/bflad/tfproviderlint/passes/S023/S023.go new file mode 100644 index 00000000000..8d6df55e9e7 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S023/S023.go @@ -0,0 +1,50 @@ +// Package S023 defines an Analyzer that checks for +// Schema that should omit Elem with incompatible Type +package S023 + +import ( + "golang.org/x/tools/go/analysis" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" +) + +const Doc = `check for Schema that should omit Elem with incompatible Type + +The S023 analyzer reports cases of schema that declare Elem that should +be removed with incompatible Type.` + +const analyzerName = "S023" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + schemainfo.Analyzer, + commentignore.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { + continue + } + + if schemaInfo.IsOneOfTypes(schema.SchemaValueTypeList, schema.SchemaValueTypeMap, schema.SchemaValueTypeSet) { + continue + } + + if !schemaInfo.DeclaresField(schema.SchemaFieldElem) { + continue + } + + pass.Reportf(schemaInfo.Fields[schema.SchemaFieldElem].Value.Pos(), "%s: schema should not include Elem with incompatible Type", analyzerName) + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S024/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S024/README.md new file mode 100644 index 00000000000..a8e7e1ef6bd --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S024/README.md @@ -0,0 +1,50 @@ +# S024 + +The S024 analyzer reports extraneous usage of `ForceNew` in data source schema attributes. + +## Flagged Code + +```go +&schema.Resource{ + Read: /* ... */, + Schema: map[string]*schema.Schema{ + "example": { + ForceNew: true, + Required: true, + Type: schema.TypeString, + }, + }, +} +``` + +## Passing Code + +```go +&schema.Resource{ + Read: /* ... */, + Schema: map[string]*schema.Schema{ + "example": { + Required: true, + Type: schema.TypeString, + }, + }, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S024` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S024 +&schema.Resource{ + Read: /* ... */, + Schema: map[string]*schema.Schema{ + "example": { + ForceNew: true, + Required: true, + Type: schema.TypeString, + }, + }, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S024/S024.go b/vendor/github.com/bflad/tfproviderlint/passes/S024/S024.go new file mode 100644 index 00000000000..f5b7318fdfa --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S024/S024.go @@ -0,0 +1,67 @@ +package S024 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourceinfodatasourceonly" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Schema that should omit ForceNew in data source schema attributes + +The S024 analyzer reports usage of ForceNew in data source schema attributes, +which is unnecessary.` + +const analyzerName = "S024" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + resourceinfodatasourceonly.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + resourceInfos := pass.ResultOf[resourceinfodatasourceonly.Analyzer].([]*schema.ResourceInfo) + for _, resourceInfo := range resourceInfos { + if ignorer.ShouldIgnore(analyzerName, resourceInfo.AstCompositeLit) { + continue + } + + var schemaInfos []*schema.SchemaInfo + + ast.Inspect(resourceInfo.AstCompositeLit, func(n ast.Node) bool { + compositeLit, ok := n.(*ast.CompositeLit) + + if !ok { + return true + } + + if schema.IsMapStringSchema(compositeLit, pass.TypesInfo) { + for _, mapSchema := range schema.GetSchemaMapSchemas(compositeLit) { + schemaInfos = append(schemaInfos, schema.NewSchemaInfo(mapSchema, pass.TypesInfo)) + } + } else if schema.IsTypeSchema(pass.TypesInfo.TypeOf(compositeLit.Type)) { + schemaInfos = append(schemaInfos, schema.NewSchemaInfo(compositeLit, pass.TypesInfo)) + } + + return true + }) + + for _, schemaInfo := range schemaInfos { + if !schemaInfo.DeclaresField(schema.SchemaFieldForceNew) { + continue + } + + pass.Reportf(schemaInfo.Fields[schema.SchemaFieldForceNew].Pos(), "%s: ForceNew is extraneous in data source schema attributes", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S025/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S025/README.md new file mode 100644 index 00000000000..455afb57906 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S025/README.md @@ -0,0 +1,33 @@ +# S025 + +The S025 analyzer reports cases of schemas which enables only `Computed` +and configures `AtLeastOneOf`, which is not valid. + +## Flagged Code + +```go +&schema.Schema{ + AtLeastOneOf: []string{"example"}, + Computed: true, +} +``` + +## Passing Code + +```go +&schema.Schema{ + Computed: true, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S025` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S025 +&schema.Schema{ + AtLeastOneOf: []string{"example"}, + Computed: true, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S025/S025.go b/vendor/github.com/bflad/tfproviderlint/passes/S025/S025.go new file mode 100644 index 00000000000..666ea33163f --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S025/S025.go @@ -0,0 +1,50 @@ +package S025 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfocomputedonly" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Schema with only Computed enabled and AtLeastOneOf configured + +The S025 analyzer reports cases of schemas which only enables Computed +and configures AtLeastOneOf, which is not valid.` + +const analyzerName = "S025" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemainfocomputedonly.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaInfos := pass.ResultOf[schemainfocomputedonly.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { + continue + } + + if schemaInfo.Schema.AtLeastOneOf == nil { + continue + } + + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not only enable Computed and configure AtLeastOneOf", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not only enable Computed and configure AtLeastOneOf", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S026/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S026/README.md new file mode 100644 index 00000000000..f5c547c4620 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S026/README.md @@ -0,0 +1,33 @@ +# S026 + +The S026 analyzer reports cases of schemas which enables only `Computed` +and configures `ConflictsWith`, which is not valid. + +## Flagged Code + +```go +&schema.Schema{ + Computed: true, + ConflictsWith: []string{"example"}, +} +``` + +## Passing Code + +```go +&schema.Schema{ + Computed: true, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S026` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S026 +&schema.Schema{ + Computed: true, + ConflictsWith: []string{"example"}, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S026/S026.go b/vendor/github.com/bflad/tfproviderlint/passes/S026/S026.go new file mode 100644 index 00000000000..0661386c604 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S026/S026.go @@ -0,0 +1,50 @@ +package S026 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfocomputedonly" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Schema with only Computed enabled and ConflictsWith configured + +The S026 analyzer reports cases of schemas which only enables Computed +and configures ConflictsWith, which is not valid.` + +const analyzerName = "S026" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemainfocomputedonly.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaInfos := pass.ResultOf[schemainfocomputedonly.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { + continue + } + + if schemaInfo.Schema.ConflictsWith == nil { + continue + } + + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not only enable Computed and configure ConflictsWith", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not only enable Computed and configure ConflictsWith", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S027/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S027/README.md new file mode 100644 index 00000000000..783ff24bad3 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S027/README.md @@ -0,0 +1,33 @@ +# S027 + +The S027 analyzer reports cases of schemas which enables only `Computed` +and configures `Default`, which is not valid. + +## Flagged Code + +```go +&schema.Schema{ + Computed: true, + Default: "example", +} +``` + +## Passing Code + +```go +&schema.Schema{ + Computed: true, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S027` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S027 +&schema.Schema{ + Computed: true, + Default: "example", +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S027/S027.go b/vendor/github.com/bflad/tfproviderlint/passes/S027/S027.go new file mode 100644 index 00000000000..20996de91cc --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S027/S027.go @@ -0,0 +1,50 @@ +package S027 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfocomputedonly" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Schema with only Computed enabled and Default configured + +The S027 analyzer reports cases of schemas which only enables Computed +and configures Default, which is not valid.` + +const analyzerName = "S027" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemainfocomputedonly.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaInfos := pass.ResultOf[schemainfocomputedonly.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { + continue + } + + if schemaInfo.Schema.Default == nil { + continue + } + + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not only enable Computed and configure Default", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not only enable Computed and configure Default", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S028/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S028/README.md new file mode 100644 index 00000000000..6bbff1a11db --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S028/README.md @@ -0,0 +1,33 @@ +# S028 + +The S028 analyzer reports cases of schemas which enables only `Computed` +and configures `DefaultFunc`, which is not valid. + +## Flagged Code + +```go +&schema.Schema{ + Computed: true, + DefaultFunc: /* ... */, +} +``` + +## Passing Code + +```go +&schema.Schema{ + Computed: true, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S028` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S028 +&schema.Schema{ + Computed: true, + DefaultFunc: /* ... */, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S028/S028.go b/vendor/github.com/bflad/tfproviderlint/passes/S028/S028.go new file mode 100644 index 00000000000..cbb86eed31b --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S028/S028.go @@ -0,0 +1,50 @@ +package S028 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfocomputedonly" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Schema with only Computed enabled and DefaultFunc configured + +The S028 analyzer reports cases of schemas which only enables Computed +and configures DefaultFunc, which is not valid.` + +const analyzerName = "S028" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemainfocomputedonly.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaInfos := pass.ResultOf[schemainfocomputedonly.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { + continue + } + + if schemaInfo.Schema.DefaultFunc == nil { + continue + } + + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not only enable Computed and configure DefaultFunc", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not only enable Computed and configure DefaultFunc", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S029/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S029/README.md new file mode 100644 index 00000000000..7f9a9b4c6ac --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S029/README.md @@ -0,0 +1,33 @@ +# S029 + +The S029 analyzer reports cases of schemas which enables only `Computed` +and configures `ExactlyOneOf`, which is not valid. + +## Flagged Code + +```go +&schema.Schema{ + Computed: true, + ExactlyOneOf: []string{"example"}, +} +``` + +## Passing Code + +```go +&schema.Schema{ + Computed: true, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S029` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S029 +&schema.Schema{ + Computed: true, + ExactlyOneOf: []string{"example"}, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S029/S029.go b/vendor/github.com/bflad/tfproviderlint/passes/S029/S029.go new file mode 100644 index 00000000000..590f21b7fa6 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S029/S029.go @@ -0,0 +1,50 @@ +package S029 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfocomputedonly" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Schema with only Computed enabled and ExactlyOneOf configured + +The S029 analyzer reports cases of schemas which only enables Computed +and configures ExactlyOneOf, which is not valid.` + +const analyzerName = "S029" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemainfocomputedonly.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaInfos := pass.ResultOf[schemainfocomputedonly.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { + continue + } + + if schemaInfo.Schema.ExactlyOneOf == nil { + continue + } + + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not only enable Computed and configure ExactlyOneOf", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not only enable Computed and configure ExactlyOneOf", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S030/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S030/README.md new file mode 100644 index 00000000000..a835daf1fe8 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S030/README.md @@ -0,0 +1,33 @@ +# S030 + +The S030 analyzer reports cases of schemas which enables only `Computed` +and configures `InputDefault`, which is not valid. + +## Flagged Code + +```go +&schema.Schema{ + Computed: true, + InputDefault: "example", +} +``` + +## Passing Code + +```go +&schema.Schema{ + Computed: true, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S030` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S030 +&schema.Schema{ + Computed: true, + InputDefault: "example", +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S030/S030.go b/vendor/github.com/bflad/tfproviderlint/passes/S030/S030.go new file mode 100644 index 00000000000..43a7c826ea4 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S030/S030.go @@ -0,0 +1,50 @@ +package S030 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfocomputedonly" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Schema with only Computed enabled and InputDefault configured + +The S030 analyzer reports cases of schemas which only enables Computed +and configures InputDefault, which is not valid.` + +const analyzerName = "S030" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemainfocomputedonly.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaInfos := pass.ResultOf[schemainfocomputedonly.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { + continue + } + + if !schemaInfo.DeclaresField(schema.SchemaFieldInputDefault) { + continue + } + + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not only enable Computed and configure InputDefault", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not only enable Computed and configure InputDefault", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S031/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S031/README.md new file mode 100644 index 00000000000..b7c063b8acb --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S031/README.md @@ -0,0 +1,33 @@ +# S031 + +The S031 analyzer reports cases of schemas which enables only `Computed` +and configures `MaxItems`, which is not valid. + +## Flagged Code + +```go +&schema.Schema{ + Computed: true, + MaxItems: 1, +} +``` + +## Passing Code + +```go +&schema.Schema{ + Computed: true, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S031` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S031 +&schema.Schema{ + Computed: true, + MaxItems: 1, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S031/S031.go b/vendor/github.com/bflad/tfproviderlint/passes/S031/S031.go new file mode 100644 index 00000000000..2ccb192fad4 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S031/S031.go @@ -0,0 +1,50 @@ +package S031 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfocomputedonly" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Schema with only Computed enabled and MaxItems configured + +The S031 analyzer reports cases of schemas which only enables Computed +and configures MaxItems, which is not valid.` + +const analyzerName = "S031" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemainfocomputedonly.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaInfos := pass.ResultOf[schemainfocomputedonly.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { + continue + } + + if !schemaInfo.DeclaresField(schema.SchemaFieldMaxItems) { + continue + } + + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not only enable Computed and configure MaxItems", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not only enable Computed and configure MaxItems", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S032/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S032/README.md new file mode 100644 index 00000000000..40a63130065 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S032/README.md @@ -0,0 +1,33 @@ +# S032 + +The S032 analyzer reports cases of schemas which enables only `Computed` +and configures `MinItems`, which is not valid. + +## Flagged Code + +```go +&schema.Schema{ + Computed: true, + MinItems: 1, +} +``` + +## Passing Code + +```go +&schema.Schema{ + Computed: true, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S032` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S032 +&schema.Schema{ + Computed: true, + MinItems: 1, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S032/S032.go b/vendor/github.com/bflad/tfproviderlint/passes/S032/S032.go new file mode 100644 index 00000000000..55a3f3af73c --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S032/S032.go @@ -0,0 +1,50 @@ +package S032 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfocomputedonly" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Schema with only Computed enabled and MinItems configured + +The S032 analyzer reports cases of schemas which only enables Computed +and configures MinItems, which is not valid.` + +const analyzerName = "S032" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemainfocomputedonly.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaInfos := pass.ResultOf[schemainfocomputedonly.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { + continue + } + + if !schemaInfo.DeclaresField(schema.SchemaFieldMinItems) { + continue + } + + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not only enable Computed and configure MinItems", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not only enable Computed and configure MinItems", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S033/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S033/README.md new file mode 100644 index 00000000000..b6cb6a090f1 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S033/README.md @@ -0,0 +1,33 @@ +# S033 + +The S033 analyzer reports cases of schemas which enables only `Computed` +and configures `DefaultFunc`, which is not valid. + +## Flagged Code + +```go +&schema.Schema{ + Computed: true, + DefaultFunc: /* ... */, +} +``` + +## Passing Code + +```go +&schema.Schema{ + Computed: true, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S033` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S033 +&schema.Schema{ + Computed: true, + DefaultFunc: /* ... */, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S033/S033.go b/vendor/github.com/bflad/tfproviderlint/passes/S033/S033.go new file mode 100644 index 00000000000..c74b814d1cf --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S033/S033.go @@ -0,0 +1,50 @@ +package S033 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfocomputedonly" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Schema with only Computed enabled and StateFunc configured + +The S033 analyzer reports cases of schemas which only enables Computed +and configures StateFunc, which is not valid.` + +const analyzerName = "S033" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemainfocomputedonly.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaInfos := pass.ResultOf[schemainfocomputedonly.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { + continue + } + + if schemaInfo.Schema.StateFunc == nil { + continue + } + + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not only enable Computed and configure StateFunc", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not only enable Computed and configure StateFunc", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S034/README.md b/vendor/github.com/bflad/tfproviderlint/passes/S034/README.md new file mode 100644 index 00000000000..4eb76b75151 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S034/README.md @@ -0,0 +1,30 @@ +# S034 + +The S034 analyzer reports cases of schemas which enable `PromoteSingle`, which is not valid after Terraform 0.12. Existing implementations of `PromoteSingle` prior to Terraform 0.12 can be ignored currently. + +## Flagged Code + +```go +&schema.Schema{ + PromoteSingle: true, +} +``` + +## Passing Code + +```go +&schema.Schema{ + // No PromoteSingle: true, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:S034` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:S034 +&schema.Schema{ + PromoteSingle: true, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/S034/S034.go b/vendor/github.com/bflad/tfproviderlint/passes/S034/S034.go new file mode 100644 index 00000000000..8329306b83c --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/S034/S034.go @@ -0,0 +1,51 @@ +package S034 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Schema with PromoteSingle configured + +The S034 analyzer reports cases of schemas which enable PromoteSingle, which +is not valid after Terraform 0.12. Existing implementations of PromoteSingle +prior to Terraform 0.12 can be ignored currently.` + +const analyzerName = "S034" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemainfo.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + for _, schemaInfo := range schemaInfos { + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { + continue + } + + if !schemaInfo.DeclaresField(schema.SchemaFieldPromoteSingle) { + continue + } + + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should not enable PromoteSingle (implementations prior to Terraform 0.12 can be ignored)", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should not enable PromoteSingle (implementations prior to Terraform 0.12 can be ignored)", analyzerName) + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V001/README.md b/vendor/github.com/bflad/tfproviderlint/passes/V001/README.md new file mode 100644 index 00000000000..50278d14e71 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V001/README.md @@ -0,0 +1,50 @@ +# V001 + +The V001 analyzer reports when custom SchemaValidateFunc declarations can be +replaced with [validation.StringMatch()](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#StringMatch) or [validation.StringDoesNotMatch()](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#StringDoesNotMatch). + +## Flagged Code + +```go +func validateExampleThing(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + + if !regexp.MustCompile(`^s-([0-9a-f]{17})$`).MatchString(value) { + errors = append(errors, fmt.Errorf("%q must begin with s- and contain 17 lowercase alphanumeric characters: %q", k, value)) + } + + return +} +``` + +## Passing Code + +```go +// directly in Schema +ValidateFunc: validation.StringMatch(regexp.MustCompile(`^s-([0-9a-f]{17})$`), "must begin with s- and contain 17 lowercase alphanumeric characters"), + +// or saving as a variable +var validateExampleThing = validation.StringMatch(regexp.MustCompile(`^s-([0-9a-f]{17})$`), "must begin with s- and contain 17 lowercase alphanumeric characters") + +// or replacing the function +func validateExampleThing() schema.SchemaValidateFunc { + return validation.StringMatch(regexp.MustCompile(`^s-([0-9a-f]{17})$`), "must begin with s- and contain 17 lowercase alphanumeric characters") +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:V001` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:V001 +func validateExampleThing(v interface{}, k string) (ws []string, errors []error) { + value := v.(string) + + if !regexp.MustCompile(`^s-([0-9a-f]{17})$`).MatchString(value) { + errors = append(errors, fmt.Errorf("%q must begin with s- and contain 17 lowercase alphanumeric characters: %q", k, value)) + } + + return +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V001/V001.go b/vendor/github.com/bflad/tfproviderlint/passes/V001/V001.go new file mode 100644 index 00000000000..559c983211c --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V001/V001.go @@ -0,0 +1,58 @@ +// Package V001 defines an Analyzer that checks for +// custom SchemaValidateFunc that implement validation.StringMatch() +package V001 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/astutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemavalidatefuncinfo" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for custom SchemaValidateFunc that implement validation.StringMatch() + +The V001 analyzer reports when custom SchemaValidateFunc declarations can be +replaced with validation.StringMatch() or validation.StringDoesNotMatch().` + +const analyzerName = "V001" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + schemavalidatefuncinfo.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemaValidateFuncs := pass.ResultOf[schemavalidatefuncinfo.Analyzer].([]*schema.SchemaValidateFuncInfo) + + for _, schemaValidateFunc := range schemaValidateFuncs { + if ignorer.ShouldIgnore(analyzerName, schemaValidateFunc.Node) { + continue + } + + ast.Inspect(schemaValidateFunc.Body, func(n ast.Node) bool { + callExpr, ok := n.(*ast.CallExpr) + + if !ok { + return true + } + + if !astutils.IsPackageReceiverMethod(callExpr.Fun, pass.TypesInfo, "regexp", "Regexp", "MatchString") { + return true + } + + pass.Reportf(schemaValidateFunc.Pos, "%s: custom SchemaValidateFunc should be replaced with validation.StringMatch() or validation.StringDoesNotMatch()", analyzerName) + return false + }) + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V002/README.md b/vendor/github.com/bflad/tfproviderlint/passes/V002/README.md new file mode 100644 index 00000000000..62275db4d2d --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V002/README.md @@ -0,0 +1,24 @@ +# V002 + +The V002 analyzer reports usage of the deprecated [CIDRNetwork](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#CIDRNetwork) validation function that should be replaced with [IsCIDRNetwork](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#IsCIDRNetwork). + +## Flagged Code + +```go +ValidateFunc: validation.CIDRNetwork(0, 32), +``` + +## Passing Code + +```go +ValidateFunc: validation.IsCIDRNetwork(0, 32), +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:V002` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:V002 +ValidateFunc: validation.CIDRNetwork(0, 32), +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V002/V002.go b/vendor/github.com/bflad/tfproviderlint/passes/V002/V002.go new file mode 100644 index 00000000000..31ba026efb2 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V002/V002.go @@ -0,0 +1,16 @@ +package V002 + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation" + "github.com/bflad/tfproviderlint/passes/helper/validation/cidrnetworkselectorexpr" +) + +var Analyzer = analysisutils.DeprecatedWithReplacementSelectorExprAnalyzer( + "V002", + cidrnetworkselectorexpr.Analyzer, + validation.PackageName, + validation.FuncNameCIDRNetwork, + validation.PackageName, + validation.FuncNameIsCIDRNetwork, +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V003/README.md b/vendor/github.com/bflad/tfproviderlint/passes/V003/README.md new file mode 100644 index 00000000000..e489718814c --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V003/README.md @@ -0,0 +1,24 @@ +# V003 + +The V003 analyzer reports usage of the deprecated [IPRange](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#IPRange) validation function that should be replaced with [IsIPv4Range](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#IsIPv4Range). + +## Flagged Code + +```go +ValidateFunc: validation.IPRange(), +``` + +## Passing Code + +```go +ValidateFunc: validation.IsIPv4Range, +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:V003` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:V003 +ValidateFunc: validation.IPRange(), +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V003/V003.go b/vendor/github.com/bflad/tfproviderlint/passes/V003/V003.go new file mode 100644 index 00000000000..30e13cc4e2c --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V003/V003.go @@ -0,0 +1,16 @@ +package V003 + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation" + "github.com/bflad/tfproviderlint/passes/helper/validation/iprangeselectorexpr" +) + +var Analyzer = analysisutils.DeprecatedWithReplacementSelectorExprAnalyzer( + "V003", + iprangeselectorexpr.Analyzer, + validation.PackageName, + validation.FuncNameIPRange, + validation.PackageName, + validation.FuncNameIsIPv4Range, +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V004/README.md b/vendor/github.com/bflad/tfproviderlint/passes/V004/README.md new file mode 100644 index 00000000000..c09af070923 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V004/README.md @@ -0,0 +1,24 @@ +# V004 + +The V004 analyzer reports usage of the deprecated [SingleIP](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#SingleIP) validation function that should be replaced with [IsIPAddress](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#IsIPAddress). + +## Flagged Code + +```go +ValidateFunc: validation.SingleIP(), +``` + +## Passing Code + +```go +ValidateFunc: validation.IsIPAddress, +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:V004` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:V004 +ValidateFunc: validation.SingleIP(), +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V004/V004.go b/vendor/github.com/bflad/tfproviderlint/passes/V004/V004.go new file mode 100644 index 00000000000..b06d59e9194 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V004/V004.go @@ -0,0 +1,16 @@ +package V004 + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation" + "github.com/bflad/tfproviderlint/passes/helper/validation/singleipselectorexpr" +) + +var Analyzer = analysisutils.DeprecatedWithReplacementSelectorExprAnalyzer( + "V004", + singleipselectorexpr.Analyzer, + validation.PackageName, + validation.FuncNameSingleIP, + validation.PackageName, + validation.FuncNameIsIPAddress, +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V005/README.md b/vendor/github.com/bflad/tfproviderlint/passes/V005/README.md new file mode 100644 index 00000000000..5e176dab60b --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V005/README.md @@ -0,0 +1,24 @@ +# V005 + +The V005 analyzer reports usage of the deprecated [ValidateJsonString](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#ValidateJsonString) validation function that should be replaced with [StringIsJSON](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#StringIsJSON). + +## Flagged Code + +```go +ValidateFunc: validation.ValidateJsonString, +``` + +## Passing Code + +```go +ValidateFunc: validation.StringIsJSON, +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:V005` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:V005 +ValidateFunc: validation.ValidateJsonString, +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V005/V005.go b/vendor/github.com/bflad/tfproviderlint/passes/V005/V005.go new file mode 100644 index 00000000000..8483ed115ef --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V005/V005.go @@ -0,0 +1,16 @@ +package V005 + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation" + "github.com/bflad/tfproviderlint/passes/helper/validation/validatejsonstringselectorexpr" +) + +var Analyzer = analysisutils.DeprecatedWithReplacementSelectorExprAnalyzer( + "V005", + validatejsonstringselectorexpr.Analyzer, + validation.PackageName, + validation.FuncNameValidateJsonString, + validation.PackageName, + validation.FuncNameStringIsJSON, +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V006/README.md b/vendor/github.com/bflad/tfproviderlint/passes/V006/README.md new file mode 100644 index 00000000000..428a60ab1ca --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V006/README.md @@ -0,0 +1,24 @@ +# V006 + +The V006 analyzer reports usage of the deprecated [ValidateListUniqueStrings](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#ValidateListUniqueStrings) validation function that should be replaced with [ListOfUniqueStrings](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#ListOfUniqueStrings). + +## Flagged Code + +```go +ValidateFunc: validation.ValidateListUniqueStrings, +``` + +## Passing Code + +```go +ValidateFunc: validation.ListOfUniqueStrings, +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:V006` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:V006 +ValidateFunc: validation.ValidateListUniqueStrings, +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V006/V006.go b/vendor/github.com/bflad/tfproviderlint/passes/V006/V006.go new file mode 100644 index 00000000000..1e1ae4e2940 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V006/V006.go @@ -0,0 +1,16 @@ +package V006 + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation" + "github.com/bflad/tfproviderlint/passes/helper/validation/validatelistuniquestringsselectorexpr" +) + +var Analyzer = analysisutils.DeprecatedWithReplacementSelectorExprAnalyzer( + "V006", + validatelistuniquestringsselectorexpr.Analyzer, + validation.PackageName, + validation.FuncNameValidateListUniqueStrings, + validation.PackageName, + validation.FuncNameListOfUniqueStrings, +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V007/README.md b/vendor/github.com/bflad/tfproviderlint/passes/V007/README.md new file mode 100644 index 00000000000..1270bacb0a8 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V007/README.md @@ -0,0 +1,24 @@ +# V007 + +The V007 analyzer reports usage of the deprecated [ValidateRegexp](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#ValidateRegexp) validation function that should be replaced with [StringIsValidRegExp](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#StringIsValidRegExp). + +## Flagged Code + +```go +ValidateFunc: validation.ValidateRegexp, +``` + +## Passing Code + +```go +ValidateFunc: validation.StringIsValidRegExp, +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:V007` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:V007 +ValidateFunc: validation.ValidateRegexp, +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V007/V007.go b/vendor/github.com/bflad/tfproviderlint/passes/V007/V007.go new file mode 100644 index 00000000000..1fc49fc4801 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V007/V007.go @@ -0,0 +1,16 @@ +package V007 + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation" + "github.com/bflad/tfproviderlint/passes/helper/validation/validateregexpselectorexpr" +) + +var Analyzer = analysisutils.DeprecatedWithReplacementSelectorExprAnalyzer( + "V007", + validateregexpselectorexpr.Analyzer, + validation.PackageName, + validation.FuncNameValidateRegexp, + validation.PackageName, + validation.FuncNameStringIsValidRegExp, +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V008/README.md b/vendor/github.com/bflad/tfproviderlint/passes/V008/README.md new file mode 100644 index 00000000000..c02476127d7 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V008/README.md @@ -0,0 +1,24 @@ +# V008 + +The V008 analyzer reports usage of the deprecated [ValidateRFC3339TimeString](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#ValidateRFC3339TimeString) validation function that should be replaced with [IsRFC3339Time](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/validation#IsRFC3339Time). + +## Flagged Code + +```go +ValidateFunc: validation.ValidateRFC3339TimeString, +``` + +## Passing Code + +```go +ValidateFunc: validation.IsRFC3339Time, +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:V008` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:V008 +ValidateFunc: validation.ValidateRFC3339TimeString, +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/V008/V008.go b/vendor/github.com/bflad/tfproviderlint/passes/V008/V008.go new file mode 100644 index 00000000000..0644b8a5f1a --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/V008/V008.go @@ -0,0 +1,16 @@ +package V008 + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation" + "github.com/bflad/tfproviderlint/passes/helper/validation/validaterfc3339timestringselectorexpr" +) + +var Analyzer = analysisutils.DeprecatedWithReplacementSelectorExprAnalyzer( + "V008", + validaterfc3339timestringselectorexpr.Analyzer, + validation.PackageName, + validation.FuncNameValidateRFC3339TimeString, + validation.PackageName, + validation.FuncNameIsRFC3339Time, +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/acctestcase/acctestcase.go b/vendor/github.com/bflad/tfproviderlint/passes/acctestcase/acctestcase.go deleted file mode 100644 index b11618534be..00000000000 --- a/vendor/github.com/bflad/tfproviderlint/passes/acctestcase/acctestcase.go +++ /dev/null @@ -1,63 +0,0 @@ -package acctestcase - -import ( - "go/ast" - "go/types" - "reflect" - "strings" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -var Analyzer = &analysis.Analyzer{ - Name: "acctestcase", - Doc: "find github.com/hashicorp/terraform-plugin-sdk/helper/resource.TestCase literals for later passes", - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - }, - Run: run, - ResultType: reflect.TypeOf([]*ast.CompositeLit{}), -} - -func run(pass *analysis.Pass) (interface{}, error) { - inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - nodeFilter := []ast.Node{ - (*ast.CompositeLit)(nil), - } - var result []*ast.CompositeLit - - inspect.Preorder(nodeFilter, func(n ast.Node) { - x := n.(*ast.CompositeLit) - - if !isResourceTestCase(pass, x) { - return - } - - result = append(result, x) - }) - - return result, nil -} - -func isResourceTestCase(pass *analysis.Pass, cl *ast.CompositeLit) bool { - switch v := cl.Type.(type) { - default: - return false - case *ast.SelectorExpr: - switch t := pass.TypesInfo.TypeOf(v).(type) { - default: - return false - case *types.Named: - if t.Obj().Name() != "TestCase" { - return false - } - // HasSuffix here due to vendoring - if !strings.HasSuffix(t.Obj().Pkg().Path(), "github.com/hashicorp/terraform-plugin-sdk/helper/resource") { - return false - } - } - } - return true -} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/acctestfunc/acctestfunc.go b/vendor/github.com/bflad/tfproviderlint/passes/acctestfunc/acctestfunc.go deleted file mode 100644 index 3ccc3f2ca26..00000000000 --- a/vendor/github.com/bflad/tfproviderlint/passes/acctestfunc/acctestfunc.go +++ /dev/null @@ -1,41 +0,0 @@ -package acctestfunc - -import ( - "go/ast" - "reflect" - "strings" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -var Analyzer = &analysis.Analyzer{ - Name: "acctestfunc", - Doc: "find function names starting with TestAcc for later passes", - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - }, - Run: run, - ResultType: reflect.TypeOf([]*ast.FuncDecl{}), -} - -func run(pass *analysis.Pass) (interface{}, error) { - inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - nodeFilter := []ast.Node{ - (*ast.FuncDecl)(nil), - } - var result []*ast.FuncDecl - - inspect.Preorder(nodeFilter, func(n ast.Node) { - x := n.(*ast.FuncDecl) - - if !strings.HasPrefix(x.Name.Name, "TestAcc") { - return - } - - result = append(result, x) - }) - - return result, nil -} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/checks.go b/vendor/github.com/bflad/tfproviderlint/passes/checks.go new file mode 100644 index 00000000000..76e26ee4594 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/checks.go @@ -0,0 +1,139 @@ +package passes + +import ( + "github.com/bflad/tfproviderlint/passes/AT001" + "github.com/bflad/tfproviderlint/passes/AT002" + "github.com/bflad/tfproviderlint/passes/AT003" + "github.com/bflad/tfproviderlint/passes/AT004" + "github.com/bflad/tfproviderlint/passes/AT005" + "github.com/bflad/tfproviderlint/passes/AT006" + "github.com/bflad/tfproviderlint/passes/AT007" + "github.com/bflad/tfproviderlint/passes/AT008" + "github.com/bflad/tfproviderlint/passes/R001" + "github.com/bflad/tfproviderlint/passes/R002" + "github.com/bflad/tfproviderlint/passes/R003" + "github.com/bflad/tfproviderlint/passes/R004" + "github.com/bflad/tfproviderlint/passes/R005" + "github.com/bflad/tfproviderlint/passes/R006" + "github.com/bflad/tfproviderlint/passes/R007" + "github.com/bflad/tfproviderlint/passes/R008" + "github.com/bflad/tfproviderlint/passes/R009" + "github.com/bflad/tfproviderlint/passes/R010" + "github.com/bflad/tfproviderlint/passes/R011" + "github.com/bflad/tfproviderlint/passes/R012" + "github.com/bflad/tfproviderlint/passes/R013" + "github.com/bflad/tfproviderlint/passes/R014" + "github.com/bflad/tfproviderlint/passes/S001" + "github.com/bflad/tfproviderlint/passes/S002" + "github.com/bflad/tfproviderlint/passes/S003" + "github.com/bflad/tfproviderlint/passes/S004" + "github.com/bflad/tfproviderlint/passes/S005" + "github.com/bflad/tfproviderlint/passes/S006" + "github.com/bflad/tfproviderlint/passes/S007" + "github.com/bflad/tfproviderlint/passes/S008" + "github.com/bflad/tfproviderlint/passes/S009" + "github.com/bflad/tfproviderlint/passes/S010" + "github.com/bflad/tfproviderlint/passes/S011" + "github.com/bflad/tfproviderlint/passes/S012" + "github.com/bflad/tfproviderlint/passes/S013" + "github.com/bflad/tfproviderlint/passes/S014" + "github.com/bflad/tfproviderlint/passes/S015" + "github.com/bflad/tfproviderlint/passes/S016" + "github.com/bflad/tfproviderlint/passes/S017" + "github.com/bflad/tfproviderlint/passes/S018" + "github.com/bflad/tfproviderlint/passes/S019" + "github.com/bflad/tfproviderlint/passes/S020" + "github.com/bflad/tfproviderlint/passes/S021" + "github.com/bflad/tfproviderlint/passes/S022" + "github.com/bflad/tfproviderlint/passes/S023" + "github.com/bflad/tfproviderlint/passes/S024" + "github.com/bflad/tfproviderlint/passes/S025" + "github.com/bflad/tfproviderlint/passes/S026" + "github.com/bflad/tfproviderlint/passes/S027" + "github.com/bflad/tfproviderlint/passes/S028" + "github.com/bflad/tfproviderlint/passes/S029" + "github.com/bflad/tfproviderlint/passes/S030" + "github.com/bflad/tfproviderlint/passes/S031" + "github.com/bflad/tfproviderlint/passes/S032" + "github.com/bflad/tfproviderlint/passes/S033" + "github.com/bflad/tfproviderlint/passes/S034" + "github.com/bflad/tfproviderlint/passes/V001" + "github.com/bflad/tfproviderlint/passes/V002" + "github.com/bflad/tfproviderlint/passes/V003" + "github.com/bflad/tfproviderlint/passes/V004" + "github.com/bflad/tfproviderlint/passes/V005" + "github.com/bflad/tfproviderlint/passes/V006" + "github.com/bflad/tfproviderlint/passes/V007" + "github.com/bflad/tfproviderlint/passes/V008" + "golang.org/x/tools/go/analysis" +) + +// AllChecks contains all Analyzers that report issues +// This can be consumed via multichecker.Main(passes.AllChecks...) or by +// combining these Analyzers with additional custom Analyzers +var AllChecks = []*analysis.Analyzer{ + AT001.Analyzer, + AT002.Analyzer, + AT003.Analyzer, + AT004.Analyzer, + AT005.Analyzer, + AT006.Analyzer, + AT007.Analyzer, + AT008.Analyzer, + R001.Analyzer, + R002.Analyzer, + R003.Analyzer, + R004.Analyzer, + R005.Analyzer, + R006.Analyzer, + R007.Analyzer, + R008.Analyzer, + R009.Analyzer, + R010.Analyzer, + R011.Analyzer, + R012.Analyzer, + R013.Analyzer, + R014.Analyzer, + S001.Analyzer, + S002.Analyzer, + S003.Analyzer, + S004.Analyzer, + S005.Analyzer, + S006.Analyzer, + S007.Analyzer, + S008.Analyzer, + S009.Analyzer, + S010.Analyzer, + S011.Analyzer, + S012.Analyzer, + S013.Analyzer, + S014.Analyzer, + S015.Analyzer, + S016.Analyzer, + S017.Analyzer, + S018.Analyzer, + S019.Analyzer, + S020.Analyzer, + S021.Analyzer, + S022.Analyzer, + S023.Analyzer, + S024.Analyzer, + S025.Analyzer, + S026.Analyzer, + S027.Analyzer, + S028.Analyzer, + S029.Analyzer, + S030.Analyzer, + S031.Analyzer, + S032.Analyzer, + S033.Analyzer, + S034.Analyzer, + V001.Analyzer, + V002.Analyzer, + V003.Analyzer, + V004.Analyzer, + V005.Analyzer, + V006.Analyzer, + V007.Analyzer, + V008.Analyzer, +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/resource/retryfuncinfo/retryfuncinfo.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/resource/retryfuncinfo/retryfuncinfo.go new file mode 100644 index 00000000000..efc5e2ad472 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/resource/retryfuncinfo/retryfuncinfo.go @@ -0,0 +1,65 @@ +package retryfuncinfo + +import ( + "go/ast" + "reflect" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +var Analyzer = &analysis.Analyzer{ + Name: "retryfuncinfo", + Doc: "find github.com/hashicorp/terraform-plugin-sdk/helper/resource RetryFunc declarations for later passes", + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*resource.RetryFuncInfo{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.FuncDecl)(nil), + (*ast.FuncLit)(nil), + } + var result []*resource.RetryFuncInfo + + inspect.Preorder(nodeFilter, func(n ast.Node) { + funcDecl, funcDeclOk := n.(*ast.FuncDecl) + funcLit, funcLitOk := n.(*ast.FuncLit) + + var funcType *ast.FuncType + + if funcDeclOk && funcDecl != nil { + funcType = funcDecl.Type + } else if funcLitOk && funcLit != nil { + funcType = funcLit.Type + } else { + return + } + + params := funcType.Params + + if params != nil && len(params.List) != 0 { + return + } + + results := funcType.Results + + if results == nil || len(results.List) != 1 { + return + } + + if !resource.IsTypeRetryError(pass.TypesInfo.TypeOf(results.List[0].Type)) { + return + } + + result = append(result, resource.NewRetryFuncInfo(funcDecl, funcLit, pass.TypesInfo)) + }) + + return result, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/resource/testcaseinfo/testcaseinfo.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/resource/testcaseinfo/testcaseinfo.go new file mode 100644 index 00000000000..fc29f144043 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/resource/testcaseinfo/testcaseinfo.go @@ -0,0 +1,50 @@ +package testcaseinfo + +import ( + "go/ast" + "reflect" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +var Analyzer = &analysis.Analyzer{ + Name: "testcaseinfo", + Doc: "find github.com/hashicorp/terraform-plugin-sdk/helper/resource.TestCase literals for later passes", + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*resource.TestCaseInfo{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.CompositeLit)(nil), + } + var result []*resource.TestCaseInfo + + inspect.Preorder(nodeFilter, func(n ast.Node) { + x := n.(*ast.CompositeLit) + + if !isResourceTestCase(pass, x) { + return + } + + result = append(result, resource.NewTestCaseInfo(x, pass.TypesInfo)) + }) + + return result, nil +} + +func isResourceTestCase(pass *analysis.Pass, cl *ast.CompositeLit) bool { + switch v := cl.Type.(type) { + default: + return false + case *ast.SelectorExpr: + return resource.IsTypeTestCase(pass.TypesInfo.TypeOf(v)) + } +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/resource/testmatchresourceattrcallexpr/testmatchresourceattrcallexpr.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/resource/testmatchresourceattrcallexpr/testmatchresourceattrcallexpr.go new file mode 100644 index 00000000000..2c1bf97f238 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/resource/testmatchresourceattrcallexpr/testmatchresourceattrcallexpr.go @@ -0,0 +1,13 @@ +package testmatchresourceattrcallexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/resource" +) + +var Analyzer = analysisutils.FunctionCallExprAnalyzer( + "testmatchresourceattrcallexpr", + resource.IsFunc, + resource.PackagePath, + resource.FuncNameTestMatchResourceAttr, +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/crudfuncinfo/crudfuncinfo.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/crudfuncinfo/crudfuncinfo.go new file mode 100644 index 00000000000..d176266b1ad --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/crudfuncinfo/crudfuncinfo.go @@ -0,0 +1,55 @@ +package crudfuncinfo + +import ( + "go/ast" + "reflect" + + "github.com/bflad/tfproviderlint/helper/astutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +var Analyzer = &analysis.Analyzer{ + Name: "crudfuncinfo", + Doc: "find github.com/hashicorp/terraform-plugin-sdk/helper/schema CreateFunc, ReadFunc, UpdateFunc, and DeleteFunc declarations for later passes", + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*schema.CRUDFuncInfo{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.FuncDecl)(nil), + (*ast.FuncLit)(nil), + } + var result []*schema.CRUDFuncInfo + + inspect.Preorder(nodeFilter, func(n ast.Node) { + funcType := astutils.FuncTypeFromNode(n) + + if funcType == nil { + return + } + + if !astutils.IsFieldListTypePackageType(funcType.Params, 0, pass.TypesInfo, schema.PackagePath, schema.TypeNameResourceData) { + return + } + + if !astutils.IsFieldListType(funcType.Params, 1, astutils.IsFunctionParameterTypeInterface) { + return + } + + if !astutils.IsFieldListType(funcType.Results, 0, astutils.IsFunctionParameterTypeError) { + return + } + + result = append(result, schema.NewCRUDFuncInfo(n, pass.TypesInfo)) + }) + + return result, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatagetchangeassignstmt/resourcedatagetchangeassignstmt.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatagetchangeassignstmt/resourcedatagetchangeassignstmt.go new file mode 100644 index 00000000000..5bfa252095a --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatagetchangeassignstmt/resourcedatagetchangeassignstmt.go @@ -0,0 +1,14 @@ +package resourcedatagetchangeassignstmt + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" +) + +var Analyzer = analysisutils.ReceiverMethodAssignStmtAnalyzer( + "resourcedatagetchangeassignstmt", + schema.IsReceiverMethod, + schema.PackagePath, + schema.TypeNameResourceData, + "GetChange", +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatagetokexistscallexpr/resourcedatagetokexistscallexpr.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatagetokexistscallexpr/resourcedatagetokexistscallexpr.go new file mode 100644 index 00000000000..5af5001a623 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatagetokexistscallexpr/resourcedatagetokexistscallexpr.go @@ -0,0 +1,14 @@ +package resourcedatagetokexistscallexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" +) + +var Analyzer = analysisutils.ReceiverMethodCallExprAnalyzer( + "resourcedatagetokexistscallexpr", + schema.IsReceiverMethod, + schema.PackagePath, + schema.TypeNameResourceData, + "GetOkExists", +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatapartialselectorexpr/resourcedatapartialselectorexpr.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatapartialselectorexpr/resourcedatapartialselectorexpr.go new file mode 100644 index 00000000000..cf5f037c393 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatapartialselectorexpr/resourcedatapartialselectorexpr.go @@ -0,0 +1,14 @@ +package resourcedatapartialselectorexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" +) + +var Analyzer = analysisutils.ReceiverMethodSelectorExprAnalyzer( + "resourcedatapartialselectorexpr", + schema.IsReceiverMethod, + schema.PackagePath, + schema.TypeNameResourceData, + "Partial", +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatasetcallexpr/resourcedatasetcallexpr.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatasetcallexpr/resourcedatasetcallexpr.go new file mode 100644 index 00000000000..8a374ba440c --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatasetcallexpr/resourcedatasetcallexpr.go @@ -0,0 +1,14 @@ +package resourcedatasetcallexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" +) + +var Analyzer = analysisutils.ReceiverMethodCallExprAnalyzer( + "resourcedatasetcallexpr", + schema.IsReceiverMethod, + schema.PackagePath, + schema.TypeNameResourceData, + "Set", +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatasetpartialselectorexpr/resourcedatasetpartialselectorexpr.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatasetpartialselectorexpr/resourcedatasetpartialselectorexpr.go new file mode 100644 index 00000000000..4d89e7a503b --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatasetpartialselectorexpr/resourcedatasetpartialselectorexpr.go @@ -0,0 +1,14 @@ +package resourcedatasetpartialselectorexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" +) + +var Analyzer = analysisutils.ReceiverMethodSelectorExprAnalyzer( + "resourcedatasetpartialselectorexpr", + schema.IsReceiverMethod, + schema.PackagePath, + schema.TypeNameResourceData, + "SetPartial", +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourceinfo/README.md b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourceinfo/README.md new file mode 100644 index 00000000000..75cd21e45b7 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourceinfo/README.md @@ -0,0 +1,9 @@ +# passes/helper/schema/resourceinfo + +This pass only works with Terraform resources that are fully defined in a single function: + +```go +func someResourceFunc() *schema.Resource { + return &schema.Resource{ /* ... entire resource ... */ } +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourceinfo/resourceinfo.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourceinfo/resourceinfo.go new file mode 100644 index 00000000000..5bf85fc1785 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourceinfo/resourceinfo.go @@ -0,0 +1,50 @@ +package resourceinfo + +import ( + "go/ast" + "reflect" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +var Analyzer = &analysis.Analyzer{ + Name: "resourceinfo", + Doc: "find github.com/hashicorp/terraform-plugin-sdk/helper/schema.Resource literals for later passes", + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*schema.ResourceInfo{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.CompositeLit)(nil), + } + var result []*schema.ResourceInfo + + inspect.Preorder(nodeFilter, func(n ast.Node) { + x := n.(*ast.CompositeLit) + + if !isSchemaResource(pass, x) { + return + } + + result = append(result, schema.NewResourceInfo(x, pass.TypesInfo)) + }) + + return result, nil +} + +func isSchemaResource(pass *analysis.Pass, cl *ast.CompositeLit) bool { + switch v := cl.Type.(type) { + default: + return false + case *ast.SelectorExpr: + return schema.IsTypeResource(pass.TypesInfo.TypeOf(v)) + } +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourceinfodatasourceonly/resourceinfodatasourceonly.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourceinfodatasourceonly/resourceinfodatasourceonly.go new file mode 100644 index 00000000000..444c4606434 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourceinfodatasourceonly/resourceinfodatasourceonly.go @@ -0,0 +1,35 @@ +package resourceinfodatasourceonly + +import ( + "reflect" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourceinfo" + "golang.org/x/tools/go/analysis" +) + +var Analyzer = &analysis.Analyzer{ + Name: "resourceinfodatasourceonly", + Doc: "find github.com/hashicorp/terraform-plugin-sdk/helper/schema.Resource literals of Data Sources for later passes", + Requires: []*analysis.Analyzer{ + resourceinfo.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*schema.ResourceInfo{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + resourceInfos := pass.ResultOf[resourceinfo.Analyzer].([]*schema.ResourceInfo) + + var result []*schema.ResourceInfo + + for _, resourceInfo := range resourceInfos { + if !resourceInfo.IsDataSource() { + continue + } + + result = append(result, resourceInfo) + } + + return result, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourceinforesourceonly/resourceinforesourceonly.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourceinforesourceonly/resourceinforesourceonly.go new file mode 100644 index 00000000000..d91aaac3f51 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourceinforesourceonly/resourceinforesourceonly.go @@ -0,0 +1,35 @@ +package resourceinforesourceonly + +import ( + "reflect" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourceinfo" + "golang.org/x/tools/go/analysis" +) + +var Analyzer = &analysis.Analyzer{ + Name: "resourceinforesourceonly", + Doc: "find github.com/hashicorp/terraform-plugin-sdk/helper/schema.Resource literals of Resources (not Data Sources) for later passes", + Requires: []*analysis.Analyzer{ + resourceinfo.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*schema.ResourceInfo{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + resourceInfos := pass.ResultOf[resourceinfo.Analyzer].([]*schema.ResourceInfo) + + var result []*schema.ResourceInfo + + for _, resourceInfo := range resourceInfos { + if !resourceInfo.IsResource() { + continue + } + + result = append(result, resourceInfo) + } + + return result, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcemapcompositelit/resourcemapcompositelit.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcemapcompositelit/resourcemapcompositelit.go new file mode 100644 index 00000000000..d61ef996e24 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/resourcemapcompositelit/resourcemapcompositelit.go @@ -0,0 +1,41 @@ +package resourcemapcompositelit + +import ( + "go/ast" + "reflect" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +var Analyzer = &analysis.Analyzer{ + Name: "resourcemapcompositelit", + Doc: "find map[string]*schema.Resource literals for later passes", + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*ast.CompositeLit{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.CompositeLit)(nil), + } + var result []*ast.CompositeLit + + inspect.Preorder(nodeFilter, func(n ast.Node) { + x := n.(*ast.CompositeLit) + + if !schema.IsMapStringResource(x, pass.TypesInfo) { + return + } + + result = append(result, x) + }) + + return result, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo/README.md b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo/README.md new file mode 100644 index 00000000000..67863a4dd5d --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo/README.md @@ -0,0 +1,12 @@ +# passes/helper/schema/schemainfo + +This pass only works with Terraform schema that are fully defined: + +```go +&schema.Schema{ + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: /* ... */, +}, +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo/schemainfo.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo/schemainfo.go new file mode 100644 index 00000000000..e27df17c1f8 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo/schemainfo.go @@ -0,0 +1,60 @@ +package schemainfo + +import ( + "go/ast" + "reflect" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemamapcompositelit" +) + +var Analyzer = &analysis.Analyzer{ + Name: "schemainfo", + Doc: "find github.com/hashicorp/terraform-plugin-sdk/helper/schema.Schema literals for later passes", + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + schemamapcompositelit.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*schema.SchemaInfo{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + schemamapcompositelits := pass.ResultOf[schemamapcompositelit.Analyzer].([]*ast.CompositeLit) + nodeFilter := []ast.Node{ + (*ast.CompositeLit)(nil), + } + var result []*schema.SchemaInfo + + for _, smap := range schemamapcompositelits { + for _, mapSchema := range schema.GetSchemaMapSchemas(smap) { + result = append(result, schema.NewSchemaInfo(mapSchema, pass.TypesInfo)) + } + } + + inspect.Preorder(nodeFilter, func(n ast.Node) { + x := n.(*ast.CompositeLit) + + if !isSchemaSchema(pass, x) { + return + } + + result = append(result, schema.NewSchemaInfo(x, pass.TypesInfo)) + }) + + return result, nil +} + +func isSchemaSchema(pass *analysis.Pass, cl *ast.CompositeLit) bool { + switch v := cl.Type.(type) { + default: + return false + case *ast.SelectorExpr: + return schema.IsTypeSchema(pass.TypesInfo.TypeOf(v)) + } +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemainfocomputedonly/schemainfocomputedonly.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemainfocomputedonly/schemainfocomputedonly.go new file mode 100644 index 00000000000..57009fbbe21 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemainfocomputedonly/schemainfocomputedonly.go @@ -0,0 +1,35 @@ +package schemainfocomputedonly + +import ( + "reflect" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemainfo" + "golang.org/x/tools/go/analysis" +) + +var Analyzer = &analysis.Analyzer{ + Name: "schemainfocomputedonly", + Doc: "find github.com/hashicorp/terraform-plugin-sdk/helper/schema.Schema literals with Computed: true only for later passes", + Requires: []*analysis.Analyzer{ + schemainfo.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*schema.SchemaInfo{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + schemaInfos := pass.ResultOf[schemainfo.Analyzer].([]*schema.SchemaInfo) + + var result []*schema.SchemaInfo + + for _, schemaInfo := range schemaInfos { + if !schemaInfo.Schema.Computed || schemaInfo.Schema.Optional || schemaInfo.Schema.Required { + continue + } + + result = append(result, schemaInfo) + } + + return result, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemamapcompositelit/README.md b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemamapcompositelit/README.md new file mode 100644 index 00000000000..19a0b48141e --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemamapcompositelit/README.md @@ -0,0 +1,14 @@ +# passes/helper/schema/schemamapcompositelit + +This pass only works with Terraform schema maps that are fully defined: + +```go +Schema: map[string]*schema.Schema{ + "attr": { + Type: schema.TypeString, + Optional: true, + Computed: true, + ValidateFunc: /* ... */, + }, +}, +``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemamapcompositelit/schemamapcompositelit.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemamapcompositelit/schemamapcompositelit.go new file mode 100644 index 00000000000..0be1be5021c --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemamapcompositelit/schemamapcompositelit.go @@ -0,0 +1,41 @@ +package schemamapcompositelit + +import ( + "go/ast" + "reflect" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +var Analyzer = &analysis.Analyzer{ + Name: "schemamapcompositelit", + Doc: "find map[string]*schema.Schema literals for later passes", + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*ast.CompositeLit{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.CompositeLit)(nil), + } + var result []*ast.CompositeLit + + inspect.Preorder(nodeFilter, func(n ast.Node) { + x := n.(*ast.CompositeLit) + + if !schema.IsMapStringSchema(x, pass.TypesInfo) { + return + } + + result = append(result, x) + }) + + return result, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemavalidatefuncinfo/schemavalidatefuncinfo.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemavalidatefuncinfo/schemavalidatefuncinfo.go new file mode 100644 index 00000000000..92c577e16dc --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/schema/schemavalidatefuncinfo/schemavalidatefuncinfo.go @@ -0,0 +1,59 @@ +package schemavalidatefuncinfo + +import ( + "go/ast" + "reflect" + + "github.com/bflad/tfproviderlint/helper/astutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +var Analyzer = &analysis.Analyzer{ + Name: "schemavalidatefuncinfo", + Doc: "find github.com/hashicorp/terraform-plugin-sdk/helper/schema SchemaValidateFunc declarations for later passes", + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*schema.SchemaValidateFuncInfo{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.FuncDecl)(nil), + (*ast.FuncLit)(nil), + } + var result []*schema.SchemaValidateFuncInfo + + inspect.Preorder(nodeFilter, func(n ast.Node) { + funcType := astutils.FuncTypeFromNode(n) + + if funcType == nil { + return + } + + if !astutils.IsFieldListType(funcType.Params, 0, astutils.IsFunctionParameterTypeInterface) { + return + } + + if !astutils.IsFieldListType(funcType.Params, 1, astutils.IsFunctionParameterTypeString) { + return + } + + if !astutils.IsFieldListType(funcType.Results, 0, astutils.IsFunctionParameterTypeArrayString) { + return + } + + if !astutils.IsFieldListType(funcType.Results, 1, astutils.IsFunctionParameterTypeArrayError) { + return + } + + result = append(result, schema.NewSchemaValidateFuncInfo(n, pass.TypesInfo)) + }) + + return result, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/cidrnetworkselectorexpr/cidrnetworkselectorexpr.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/cidrnetworkselectorexpr/cidrnetworkselectorexpr.go new file mode 100644 index 00000000000..833090b2304 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/cidrnetworkselectorexpr/cidrnetworkselectorexpr.go @@ -0,0 +1,13 @@ +package cidrnetworkselectorexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation" +) + +var Analyzer = analysisutils.SelectorExprAnalyzer( + "cidrnetworkselectorexpr", + validation.IsFunc, + validation.PackagePath, + validation.FuncNameCIDRNetwork, +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/iprangeselectorexpr/iprangeselectorexpr.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/iprangeselectorexpr/iprangeselectorexpr.go new file mode 100644 index 00000000000..ab587a12d57 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/iprangeselectorexpr/iprangeselectorexpr.go @@ -0,0 +1,13 @@ +package iprangeselectorexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation" +) + +var Analyzer = analysisutils.SelectorExprAnalyzer( + "iprangeselectorexpr", + validation.IsFunc, + validation.PackagePath, + validation.FuncNameIPRange, +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/singleipselectorexpr/singleipselectorexpr.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/singleipselectorexpr/singleipselectorexpr.go new file mode 100644 index 00000000000..ebb29d424f5 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/singleipselectorexpr/singleipselectorexpr.go @@ -0,0 +1,13 @@ +package singleipselectorexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation" +) + +var Analyzer = analysisutils.SelectorExprAnalyzer( + "singleipselectorexpr", + validation.IsFunc, + validation.PackagePath, + validation.FuncNameSingleIP, +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/validatejsonstringselectorexpr/validatejsonstringselectorexpr.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/validatejsonstringselectorexpr/validatejsonstringselectorexpr.go new file mode 100644 index 00000000000..e9194f8b428 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/validatejsonstringselectorexpr/validatejsonstringselectorexpr.go @@ -0,0 +1,13 @@ +package validatejsonstringselectorexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation" +) + +var Analyzer = analysisutils.SelectorExprAnalyzer( + "validatejsonstringselectorexpr", + validation.IsFunc, + validation.PackagePath, + validation.FuncNameValidateJsonString, +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/validatelistuniquestringsselectorexpr/validatelistuniquestringsselectorexpr.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/validatelistuniquestringsselectorexpr/validatelistuniquestringsselectorexpr.go new file mode 100644 index 00000000000..0f0ad4c66d1 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/validatelistuniquestringsselectorexpr/validatelistuniquestringsselectorexpr.go @@ -0,0 +1,13 @@ +package validatelistuniquestringsselectorexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation" +) + +var Analyzer = analysisutils.SelectorExprAnalyzer( + "validatelistuniquestringsselectorexpr", + validation.IsFunc, + validation.PackagePath, + validation.FuncNameValidateListUniqueStrings, +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/validateregexpselectorexpr/validateregexpselectorexpr.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/validateregexpselectorexpr/validateregexpselectorexpr.go new file mode 100644 index 00000000000..a336bdd951b --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/validateregexpselectorexpr/validateregexpselectorexpr.go @@ -0,0 +1,13 @@ +package validateregexpselectorexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation" +) + +var Analyzer = analysisutils.SelectorExprAnalyzer( + "validateregexpselectorexpr", + validation.IsFunc, + validation.PackagePath, + validation.FuncNameValidateRegexp, +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/validaterfc3339timestringselectorexpr/validaterfc3339timestringselectorexpr.go b/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/validaterfc3339timestringselectorexpr/validaterfc3339timestringselectorexpr.go new file mode 100644 index 00000000000..9351615593b --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/helper/validation/validaterfc3339timestringselectorexpr/validaterfc3339timestringselectorexpr.go @@ -0,0 +1,13 @@ +package validaterfc3339timestringselectorexpr + +import ( + "github.com/bflad/tfproviderlint/helper/analysisutils" + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/validation" +) + +var Analyzer = analysisutils.SelectorExprAnalyzer( + "validaterfc3339timestringselectorexpr", + validation.IsFunc, + validation.PackagePath, + validation.FuncNameValidateRFC3339TimeString, +) diff --git a/vendor/github.com/bflad/tfproviderlint/passes/resourcedataset/resourcedataset.go b/vendor/github.com/bflad/tfproviderlint/passes/resourcedataset/resourcedataset.go deleted file mode 100644 index 6e064e7dc6f..00000000000 --- a/vendor/github.com/bflad/tfproviderlint/passes/resourcedataset/resourcedataset.go +++ /dev/null @@ -1,113 +0,0 @@ -package resourcedataset - -import ( - "go/ast" - "go/types" - "reflect" - "strings" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -var Analyzer = &analysis.Analyzer{ - Name: "resourcedataset", - Doc: "find github.com/hashicorp/terraform-plugin-sdk/helper/schema.ResourceData.Set() calls for later passes", - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - }, - Run: run, - ResultType: reflect.TypeOf([]*ast.CallExpr{}), -} - -func run(pass *analysis.Pass) (interface{}, error) { - inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - nodeFilter := []ast.Node{ - (*ast.CallExpr)(nil), - } - var result []*ast.CallExpr - - inspect.Preorder(nodeFilter, func(n ast.Node) { - x := n.(*ast.CallExpr) - - if !isResourceDataSet(pass, x) { - return - } - - result = append(result, x) - }) - - return result, nil -} - -func isResourceDataSet(pass *analysis.Pass, ce *ast.CallExpr) bool { - switch f := ce.Fun.(type) { - default: - return false - case *ast.SelectorExpr: - if f.Sel.Name != "Set" { - return false - } - - switch x := f.X.(type) { - default: - return false - case *ast.Ident: - if x.Obj == nil { - return false - } - - switch decl := x.Obj.Decl.(type) { - default: - return false - case *ast.Field: - switch t := decl.Type.(type) { - default: - return false - case *ast.StarExpr: - switch t := pass.TypesInfo.TypeOf(t.X).(type) { - default: - return false - case *types.Named: - if !isSchemaResourceData(t) { - return false - } - } - case *ast.SelectorExpr: - switch t := pass.TypesInfo.TypeOf(t).(type) { - default: - return false - case *types.Named: - if !isSchemaResourceData(t) { - return false - } - } - } - case *ast.ValueSpec: - switch t := pass.TypesInfo.TypeOf(decl.Type).(type) { - default: - return false - case *types.Named: - if !isSchemaResourceData(t) { - return false - } - } - } - } - } - return true -} - -func isSchemaResourceData(t *types.Named) bool { - if t.Obj().Name() != "ResourceData" { - return false - } - - // HasSuffix here due to vendoring - if !strings.HasSuffix(t.Obj().Pkg().Path(), "github.com/hashicorp/terraform-plugin-sdk/helper/schema") { - return false - } - - return true -} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/schemamap/README.md b/vendor/github.com/bflad/tfproviderlint/passes/schemamap/README.md deleted file mode 100644 index 45874a84905..00000000000 --- a/vendor/github.com/bflad/tfproviderlint/passes/schemamap/README.md +++ /dev/null @@ -1,14 +0,0 @@ -# passes/schemamap - -This pass only works with Terraform schema maps that are fully defined: - -```go -Schema: map[string]*schema.Schema{ - "attr": { - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: /* ... */, - }, -}, -``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/schemamap/schemamap.go b/vendor/github.com/bflad/tfproviderlint/passes/schemamap/schemamap.go deleted file mode 100644 index 9341279c45c..00000000000 --- a/vendor/github.com/bflad/tfproviderlint/passes/schemamap/schemamap.go +++ /dev/null @@ -1,101 +0,0 @@ -package schemamap - -import ( - "go/ast" - "reflect" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" - - "github.com/bflad/tfproviderlint/helper/terraformtype" -) - -var Analyzer = &analysis.Analyzer{ - Name: "schema", - Doc: "find map[string]*schema.Schema literals for later passes", - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - }, - Run: run, - ResultType: reflect.TypeOf([]*ast.CompositeLit{}), -} - -func run(pass *analysis.Pass) (interface{}, error) { - inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - nodeFilter := []ast.Node{ - (*ast.CompositeLit)(nil), - } - var result []*ast.CompositeLit - - inspect.Preorder(nodeFilter, func(n ast.Node) { - x := n.(*ast.CompositeLit) - - if !isSchemaMap(pass, x) { - return - } - - result = append(result, x) - }) - - return result, nil -} - -func isSchemaMap(pass *analysis.Pass, cl *ast.CompositeLit) bool { - switch v := cl.Type.(type) { - default: - return false - case *ast.MapType: - switch k := v.Key.(type) { - default: - return false - case *ast.Ident: - if k.Name != "string" { - return false - } - } - - switch mv := v.Value.(type) { - default: - return false - case *ast.StarExpr: - return terraformtype.IsTypeHelperSchema(pass.TypesInfo.TypeOf(mv.X)) - } - } - return true -} - -// GetSchemaAttributes returns all attributes held in a map[string]*schema.Schema -func GetSchemaAttributes(schemamap *ast.CompositeLit) []*ast.CompositeLit { - var result []*ast.CompositeLit - - for _, elt := range schemamap.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - switch v := v.Value.(type) { - default: - continue - case *ast.CompositeLit: - result = append(result, v) - } - } - } - return result -} - -// GetSchemaAttributeNames returns all attribute names held in a map[string]*schema.Schema -func GetSchemaAttributeNames(schemamap *ast.CompositeLit) []ast.Expr { - var result []ast.Expr - - for _, elt := range schemamap.Elts { - switch v := elt.(type) { - default: - continue - case *ast.KeyValueExpr: - result = append(result, v.Key) - } - } - return result -} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/schemaresource/README.md b/vendor/github.com/bflad/tfproviderlint/passes/schemaresource/README.md deleted file mode 100644 index 63b33438ff5..00000000000 --- a/vendor/github.com/bflad/tfproviderlint/passes/schemaresource/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# passes/schemaresource - -This pass only works with Terraform resources that are fully defined in a single function: - -```go -func someResourceFunc() *schema.Resource { - return &schema.Resource{ /* ... entire resource ... */ } -} -``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/schemaresource/schemaresource.go b/vendor/github.com/bflad/tfproviderlint/passes/schemaresource/schemaresource.go deleted file mode 100644 index 42dfd5e5850..00000000000 --- a/vendor/github.com/bflad/tfproviderlint/passes/schemaresource/schemaresource.go +++ /dev/null @@ -1,63 +0,0 @@ -package schemaresource - -import ( - "go/ast" - "go/types" - "reflect" - "strings" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" -) - -var Analyzer = &analysis.Analyzer{ - Name: "schemaresource", - Doc: "find github.com/hashicorp/terraform-plugin-sdk/helper/schema.Resource literals for later passes", - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - }, - Run: run, - ResultType: reflect.TypeOf([]*ast.CompositeLit{}), -} - -func run(pass *analysis.Pass) (interface{}, error) { - inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - nodeFilter := []ast.Node{ - (*ast.CompositeLit)(nil), - } - var result []*ast.CompositeLit - - inspect.Preorder(nodeFilter, func(n ast.Node) { - x := n.(*ast.CompositeLit) - - if !isSchemaResource(pass, x) { - return - } - - result = append(result, x) - }) - - return result, nil -} - -func isSchemaResource(pass *analysis.Pass, cl *ast.CompositeLit) bool { - switch v := cl.Type.(type) { - default: - return false - case *ast.SelectorExpr: - switch t := pass.TypesInfo.TypeOf(v).(type) { - default: - return false - case *types.Named: - if t.Obj().Name() != "Resource" { - return false - } - // HasSuffix here due to vendoring - if !strings.HasSuffix(t.Obj().Pkg().Path(), "github.com/hashicorp/terraform-plugin-sdk/helper/schema") { - return false - } - } - } - return true -} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/schemaschema/README.md b/vendor/github.com/bflad/tfproviderlint/passes/schemaschema/README.md deleted file mode 100644 index 18fdcb8a96d..00000000000 --- a/vendor/github.com/bflad/tfproviderlint/passes/schemaschema/README.md +++ /dev/null @@ -1,12 +0,0 @@ -# passes/schemaschema - -This pass only works with Terraform schema that are fully defined: - -```go -&schema.Schema{ - Type: schema.TypeString, - Optional: true, - Computed: true, - ValidateFunc: /* ... */, -}, -``` diff --git a/vendor/github.com/bflad/tfproviderlint/passes/schemaschema/schemaschema.go b/vendor/github.com/bflad/tfproviderlint/passes/schemaschema/schemaschema.go deleted file mode 100644 index 36888cd65c3..00000000000 --- a/vendor/github.com/bflad/tfproviderlint/passes/schemaschema/schemaschema.go +++ /dev/null @@ -1,60 +0,0 @@ -package schemaschema - -import ( - "go/ast" - "reflect" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/analysis/passes/inspect" - "golang.org/x/tools/go/ast/inspector" - - "github.com/bflad/tfproviderlint/helper/terraformtype" - "github.com/bflad/tfproviderlint/passes/schemamap" -) - -var Analyzer = &analysis.Analyzer{ - Name: "schemaschema", - Doc: "find github.com/hashicorp/terraform-plugin-sdk/helper/schema.Schema literals for later passes", - Requires: []*analysis.Analyzer{ - inspect.Analyzer, - schemamap.Analyzer, - }, - Run: run, - ResultType: reflect.TypeOf([]*ast.CompositeLit{}), -} - -func run(pass *analysis.Pass) (interface{}, error) { - inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) - schemamaps := pass.ResultOf[schemamap.Analyzer].([]*ast.CompositeLit) - nodeFilter := []ast.Node{ - (*ast.CompositeLit)(nil), - } - var result []*ast.CompositeLit - - for _, smap := range schemamaps { - result = append(result, schemamap.GetSchemaAttributes(smap)...) - } - - inspect.Preorder(nodeFilter, func(n ast.Node) { - x := n.(*ast.CompositeLit) - - if !isSchemaSchema(pass, x) { - return - } - - result = append(result, x) - }) - - return result, nil -} - -func isSchemaSchema(pass *analysis.Pass, cl *ast.CompositeLit) bool { - switch v := cl.Type.(type) { - default: - return false - case *ast.SelectorExpr: - return terraformtype.IsTypeHelperSchema(pass.TypesInfo.TypeOf(v)) - } - - return true -} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/testaccfuncdecl/testaccfuncdecl.go b/vendor/github.com/bflad/tfproviderlint/passes/testaccfuncdecl/testaccfuncdecl.go new file mode 100644 index 00000000000..df538d8250c --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/testaccfuncdecl/testaccfuncdecl.go @@ -0,0 +1,34 @@ +package testaccfuncdecl + +import ( + "go/ast" + "reflect" + "strings" + + "github.com/bflad/tfproviderlint/passes/testfuncdecl" + "golang.org/x/tools/go/analysis" +) + +var Analyzer = &analysis.Analyzer{ + Name: "testaccfuncdecl", + Doc: "find *ast.FuncDecl with TestAcc prefixed names for later passes", + Requires: []*analysis.Analyzer{ + testfuncdecl.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*ast.FuncDecl{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + testFuncs := pass.ResultOf[testfuncdecl.Analyzer].([]*ast.FuncDecl) + + var result []*ast.FuncDecl + + for _, testFunc := range testFuncs { + if strings.HasPrefix(testFunc.Name.Name, "TestAcc") { + result = append(result, testFunc) + } + } + + return result, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/passes/testfuncdecl/testfuncdecl.go b/vendor/github.com/bflad/tfproviderlint/passes/testfuncdecl/testfuncdecl.go new file mode 100644 index 00000000000..174c9f3625d --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/passes/testfuncdecl/testfuncdecl.go @@ -0,0 +1,41 @@ +package testfuncdecl + +import ( + "go/ast" + "reflect" + "strings" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +var Analyzer = &analysis.Analyzer{ + Name: "testfuncdecl", + Doc: "find *ast.FuncDecl with Test prefixed names for later passes", + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + }, + Run: run, + ResultType: reflect.TypeOf([]*ast.FuncDecl{}), +} + +func run(pass *analysis.Pass) (interface{}, error) { + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + nodeFilter := []ast.Node{ + (*ast.FuncDecl)(nil), + } + var result []*ast.FuncDecl + + inspect.Preorder(nodeFilter, func(n ast.Node) { + x := n.(*ast.FuncDecl) + + if !strings.HasPrefix(x.Name.Name, "Test") { + return + } + + result = append(result, x) + }) + + return result, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/version/version.go b/vendor/github.com/bflad/tfproviderlint/version/version.go new file mode 100644 index 00000000000..f12289bc2bd --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/version/version.go @@ -0,0 +1,65 @@ +package version + +import ( + "bytes" + "fmt" +) + +var ( + // The git commit that was compiled. This will be filled in by the compiler. + GitCommit string + + // The main version number that is being run at the moment. + Version = "0.10.0" + + // 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. + VersionPrerelease = "dev" + + // VersionMetadata is metadata further describing the build type. + VersionMetadata = "" +) + +// VersionInfo +type VersionInfo struct { + Revision string + Version string + VersionPrerelease string + VersionMetadata string +} + +func GetVersion() *VersionInfo { + ver := Version + rel := VersionPrerelease + md := VersionMetadata + + return &VersionInfo{ + Revision: GitCommit, + Version: ver, + VersionPrerelease: rel, + VersionMetadata: md, + } +} + +// VersionNumber returns a version string for the application. +// Includes the revision information when rev is true. +func (c *VersionInfo) VersionNumber(rev bool) string { + var versionString bytes.Buffer + + fmt.Fprintf(&versionString, "v%s", c.Version) + + if c.VersionPrerelease != "" { + fmt.Fprintf(&versionString, "-%s", c.VersionPrerelease) + } + + if c.VersionMetadata != "" { + fmt.Fprintf(&versionString, "+%s", c.VersionMetadata) + } + + if rev && c.Revision != "" { + fmt.Fprintf(&versionString, " (%s)", c.Revision) + } + + return versionString.String() +} diff --git a/vendor/github.com/bflad/tfproviderlint/xpasses/XR001/README.md b/vendor/github.com/bflad/tfproviderlint/xpasses/XR001/README.md new file mode 100644 index 00000000000..87fc41538a0 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/xpasses/XR001/README.md @@ -0,0 +1,28 @@ +# XR001 + +The XR001 analyzer reports usage of [`GetOkExists()`](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/schema#ResourceData.GetOkExists) calls, which generally do not work as expected. Usage should be moved to standard `Get()` and `GetOk()` calls. + +## Flagged Code + +```go +d.GetOkExists("example") +``` + +## Passing Code + +```go +d.Get("example") + +// or + +d.GetOk("example") +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:XR001` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:XR001 +d.GetOkExists("example") +``` diff --git a/vendor/github.com/bflad/tfproviderlint/xpasses/XR001/XR001.go b/vendor/github.com/bflad/tfproviderlint/xpasses/XR001/XR001.go new file mode 100644 index 00000000000..2782f0bffe1 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/xpasses/XR001/XR001.go @@ -0,0 +1,43 @@ +// Package XR001 defines an Analyzer that checks for +// ResourceData.Set() calls using * dereferences +package XR001 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourcedatagetokexistscallexpr" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for ResourceData.GetOkExists() calls + +The XR001 analyzer reports usage of GetOkExists() calls, which generally do +not work as expected. Usage should be moved to standard Get() and GetOk() +calls.` + +const analyzerName = "XR001" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + resourcedatagetokexistscallexpr.Analyzer, + commentignore.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + callExprs := pass.ResultOf[resourcedatagetokexistscallexpr.Analyzer].([]*ast.CallExpr) + for _, callExpr := range callExprs { + if ignorer.ShouldIgnore(analyzerName, callExpr) { + continue + } + + pass.Reportf(callExpr.Pos(), "%s: ResourceData.GetOkExists() call should be avoided", analyzerName) + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/xpasses/XR002/README.md b/vendor/github.com/bflad/tfproviderlint/xpasses/XR002/README.md new file mode 100644 index 00000000000..5b15db4b698 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/xpasses/XR002/README.md @@ -0,0 +1,39 @@ +# XR002 + +The XR002 analyzer reports missing usage of `Importer` in resources. + +## Flagged Code + +```go +&schema.Resource{ + Create: /* ... */, + Delete: /* ... */, + Read: /* ... */, + Schema: /* ... */, +} +``` + +## Passing Code + +```go +&schema.Resource{ + Create: /* ... */, + Delete: /* ... */, + Importer: &schema.ResourceImporter{/* ... */}, + Read: /* ... */, + Schema: /* ... */, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:XR002` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:XR002 +&schema.Resource{ + Create: /* ... */, + Delete: /* ... */, + Read: /* ... */, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/xpasses/XR002/XR002.go b/vendor/github.com/bflad/tfproviderlint/xpasses/XR002/XR002.go new file mode 100644 index 00000000000..ad6d939f669 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/xpasses/XR002/XR002.go @@ -0,0 +1,43 @@ +package XR002 + +import ( + "golang.org/x/tools/go/analysis" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourceinforesourceonly" +) + +const Doc = `check for Resource that should implement Importer + +The XR002 analyzer reports missing usage of Importer in resources.` + +const analyzerName = "XR002" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + resourceinforesourceonly.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + resources := pass.ResultOf[resourceinforesourceonly.Analyzer].([]*schema.ResourceInfo) + for _, resource := range resources { + if ignorer.ShouldIgnore(analyzerName, resource.AstCompositeLit) { + continue + } + + if resource.DeclaresField(schema.ResourceFieldImporter) { + continue + } + + pass.Reportf(resource.AstCompositeLit.Pos(), "%s: resource should include Importer implementation", analyzerName) + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/xpasses/XR003/README.md b/vendor/github.com/bflad/tfproviderlint/xpasses/XR003/README.md new file mode 100644 index 00000000000..1faff862286 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/xpasses/XR003/README.md @@ -0,0 +1,39 @@ +# XR003 + +The XR003 analyzer reports missing usage of `Timeouts` in resources. + +## Flagged Code + +```go +&schema.Resource{ + Create: /* ... */, + Delete: /* ... */, + Read: /* ... */, + Schema: /* ... */, +} +``` + +## Passing Code + +```go +&schema.Resource{ + Create: /* ... */, + Delete: /* ... */, + Read: /* ... */, + Schema: /* ... */, + Timeouts: &schema.ResourceTimeout{/* ... */}, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:XR003` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:XR003 +&schema.Resource{ + Create: /* ... */, + Delete: /* ... */, + Read: /* ... */, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/xpasses/XR003/XR003.go b/vendor/github.com/bflad/tfproviderlint/xpasses/XR003/XR003.go new file mode 100644 index 00000000000..9c449cb4fa5 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/xpasses/XR003/XR003.go @@ -0,0 +1,43 @@ +package XR003 + +import ( + "golang.org/x/tools/go/analysis" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/resourceinforesourceonly" +) + +const Doc = `check for Resource that should implement Timeouts + +The XR003 analyzer reports missing usage of Timeouts in resources.` + +const analyzerName = "XR003" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + commentignore.Analyzer, + resourceinforesourceonly.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + resources := pass.ResultOf[resourceinforesourceonly.Analyzer].([]*schema.ResourceInfo) + for _, resource := range resources { + if ignorer.ShouldIgnore(analyzerName, resource.AstCompositeLit) { + continue + } + + if resource.DeclaresField(schema.ResourceFieldTimeouts) { + continue + } + + pass.Reportf(resource.AstCompositeLit.Pos(), "%s: resource should include Timeouts implementation", analyzerName) + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/xpasses/XR004/README.md b/vendor/github.com/bflad/tfproviderlint/xpasses/XR004/README.md new file mode 100644 index 00000000000..55b14bbe5e6 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/xpasses/XR004/README.md @@ -0,0 +1,38 @@ +# XR004 + +The XR004 analyzer reports [`Set()`](https://godoc.org/github.com/hashicorp/terraform-plugin-sdk/helper/schema#ResourceData.Set) calls that receive a complex value type, but do not perform error checking. This error checking is to prevent issues where the code is not able to properly set the Terraform state for drift detection. Addition details are available in the [Extending Terraform documentation](https://www.terraform.io/docs/extend/best-practices/detecting-drift.html#error-checking-aggregate-types). + +## Flagged Code + +```go +d.Set("example", []interface{}{}) + +d.Set("example", map[string]interface{}{}) + +d.Set("example", schema.NewSet(/* ... */)) +``` + +## Passing Code + +```go +if err := d.Set("example", []interface{}{}); err != nil { + return fmt.Errorf("error setting example: %s", err) +} + +if err := d.Set("example", map[string]interface{}{}); err != nil { + return fmt.Errorf("error setting example: %s", err) +} + +if err := d.Set("example", schema.NewSet(/* ... */)); err != nil { + return fmt.Errorf("error setting example: %s", err) +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:XR004` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:XR004 +d.Set("example", []interface{}{}) +``` diff --git a/vendor/github.com/bflad/tfproviderlint/xpasses/XR004/XR004.go b/vendor/github.com/bflad/tfproviderlint/xpasses/XR004/XR004.go new file mode 100644 index 00000000000..f86861212ec --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/xpasses/XR004/XR004.go @@ -0,0 +1,108 @@ +// Package XR004 defines an Analyzer that checks for +// ResourceData.Set() calls missing error checking with +// complex types +package XR004 + +import ( + "go/ast" + "go/types" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/inspect" + "golang.org/x/tools/go/ast/inspector" +) + +const Doc = `check for ResourceData.Set() calls missing error checking with complex values + +The XR004 analyzer reports Set() calls that receive a complex value type, but +does not perform error checking. This error checking is to prevent issues where +the code is not able to properly set the Terraform state for drift detection. + +Reference: https://www.terraform.io/docs/extend/best-practices/detecting-drift.html#error-checking-aggregate-types` + +const analyzerName = "XR004" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + inspect.Analyzer, + commentignore.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + inspect := pass.ResultOf[inspect.Analyzer].(*inspector.Inspector) + + nodeFilter := []ast.Node{ + (*ast.ExprStmt)(nil), + } + + inspect.Preorder(nodeFilter, func(n ast.Node) { + exprStmt := n.(*ast.ExprStmt) + + callExpr, ok := exprStmt.X.(*ast.CallExpr) + + if !ok { + return + } + + if !schema.IsReceiverMethod(callExpr.Fun, pass.TypesInfo, schema.TypeNameResourceData, "Set") { + return + } + + if ignorer.ShouldIgnore(analyzerName, callExpr) { + return + } + + if len(callExpr.Args) < 2 { + return + } + + if isBasicType(pass.TypesInfo.TypeOf(callExpr.Args[1]).Underlying()) { + return + } + + pass.Reportf(callExpr.Pos(), "%s: ResourceData.Set() should perform error checking with complex values", analyzerName) + }) + + return nil, nil +} + +func isBasicType(t types.Type) bool { + switch t := t.(type) { + case *types.Basic: + return isAllowedBasicType(t) + case *types.Pointer: + return isBasicType(t.Elem()) + } + + return false +} + +var allowedBasicKindTypes = []types.BasicKind{ + types.Bool, + types.Float32, + types.Float64, + types.Int, + types.Int8, + types.Int16, + types.Int32, + types.Int64, + types.String, + types.UntypedNil, +} + +func isAllowedBasicType(b *types.Basic) bool { + for _, allowedBasicKindType := range allowedBasicKindTypes { + if b.Kind() == allowedBasicKindType { + return true + } + } + + return false +} diff --git a/vendor/github.com/bflad/tfproviderlint/xpasses/XS001/README.md b/vendor/github.com/bflad/tfproviderlint/xpasses/XS001/README.md new file mode 100644 index 00000000000..923a1996ca0 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/xpasses/XS001/README.md @@ -0,0 +1,40 @@ +# XS001 + +The XS001 analyzer reports cases of schemas where `Description` is not configured, which is generally useful for providers that wish to automatically generate documentation based on the schema information. + +## Flagged Code + +```go +map[string]*schema.Schema{ + "attribute_name": { + Optional: true, + Type: schema.TypeString, + }, +} +``` + +## Passing Code + +```go +map[string]*schema.Schema{ + "attribute_name": { + Description: "does something useful", + Optional: true, + Type: schema.TypeString, + }, +} +``` + +## Ignoring Reports + +Singular reports can be ignored by adding the a `//lintignore:XS001` Go code comment at the end of the offending line or on the line immediately proceding, e.g. + +```go +//lintignore:XS001 +map[string]*schema.Schema{ + "attribute_name": { + Optional: true, + Type: schema.TypeString, + }, +} +``` diff --git a/vendor/github.com/bflad/tfproviderlint/xpasses/XS001/XS001.go b/vendor/github.com/bflad/tfproviderlint/xpasses/XS001/XS001.go new file mode 100644 index 00000000000..0ae6a9f8bd7 --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/xpasses/XS001/XS001.go @@ -0,0 +1,58 @@ +// Package XS001 defines an Analyzer that checks for +// Schema that Description is configured +package XS001 + +import ( + "go/ast" + + "github.com/bflad/tfproviderlint/helper/terraformtype/helper/schema" + "github.com/bflad/tfproviderlint/passes/commentignore" + "github.com/bflad/tfproviderlint/passes/helper/schema/schemamapcompositelit" + "golang.org/x/tools/go/analysis" +) + +const Doc = `check for Schema that Description is configured + +The XS001 analyzer reports cases of schemas where Description is not +configured, which is generally useful for providers that wish to +automatically generate documentation based on the schema information.` + +const analyzerName = "XS001" + +var Analyzer = &analysis.Analyzer{ + Name: analyzerName, + Doc: Doc, + Requires: []*analysis.Analyzer{ + schemamapcompositelit.Analyzer, + commentignore.Analyzer, + }, + Run: run, +} + +func run(pass *analysis.Pass) (interface{}, error) { + ignorer := pass.ResultOf[commentignore.Analyzer].(*commentignore.Ignorer) + schemamapcompositelits := pass.ResultOf[schemamapcompositelit.Analyzer].([]*ast.CompositeLit) + + for _, smap := range schemamapcompositelits { + for _, schemaCompositeLit := range schema.GetSchemaMapSchemas(smap) { + schemaInfo := schema.NewSchemaInfo(schemaCompositeLit, pass.TypesInfo) + + if ignorer.ShouldIgnore(analyzerName, schemaInfo.AstCompositeLit) { + continue + } + + if schemaInfo.Schema.Description != "" { + continue + } + + switch t := schemaInfo.AstCompositeLit.Type.(type) { + default: + pass.Reportf(schemaInfo.AstCompositeLit.Lbrace, "%s: schema should configure Description", analyzerName) + case *ast.SelectorExpr: + pass.Reportf(t.Sel.Pos(), "%s: schema should configure Description", analyzerName) + } + } + } + + return nil, nil +} diff --git a/vendor/github.com/bflad/tfproviderlint/xpasses/checks.go b/vendor/github.com/bflad/tfproviderlint/xpasses/checks.go new file mode 100644 index 00000000000..0b1023e7edb --- /dev/null +++ b/vendor/github.com/bflad/tfproviderlint/xpasses/checks.go @@ -0,0 +1,21 @@ +package xpasses + +import ( + "github.com/bflad/tfproviderlint/xpasses/XR001" + "github.com/bflad/tfproviderlint/xpasses/XR002" + "github.com/bflad/tfproviderlint/xpasses/XR003" + "github.com/bflad/tfproviderlint/xpasses/XR004" + "github.com/bflad/tfproviderlint/xpasses/XS001" + "golang.org/x/tools/go/analysis" +) + +// AllChecks contains all Analyzers that report issues +// This can be consumed via multichecker.Main(xpasses.AllChecks...) or by +// combining these Analyzers with additional custom Analyzers +var AllChecks = []*analysis.Analyzer{ + XR001.Analyzer, + XR002.Analyzer, + XR003.Analyzer, + XR004.Analyzer, + XS001.Analyzer, +} diff --git a/vendor/github.com/bmatcuk/doublestar/.gitignore b/vendor/github.com/bmatcuk/doublestar/.gitignore new file mode 100644 index 00000000000..af212ecc281 --- /dev/null +++ b/vendor/github.com/bmatcuk/doublestar/.gitignore @@ -0,0 +1,32 @@ +# vi +*~ +*.swp +*.swo + +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof + +# test directory +test/ diff --git a/vendor/github.com/bmatcuk/doublestar/.travis.yml b/vendor/github.com/bmatcuk/doublestar/.travis.yml new file mode 100644 index 00000000000..ec4fee88964 --- /dev/null +++ b/vendor/github.com/bmatcuk/doublestar/.travis.yml @@ -0,0 +1,15 @@ +language: go + +go: + - 1.11 + - 1.12 + +before_install: + - go get -t -v ./... + +script: + - go test -race -coverprofile=coverage.txt -covermode=atomic + +after_success: + - bash <(curl -s https://codecov.io/bash) + diff --git a/vendor/github.com/bmatcuk/doublestar/LICENSE b/vendor/github.com/bmatcuk/doublestar/LICENSE new file mode 100644 index 00000000000..309c9d1d113 --- /dev/null +++ b/vendor/github.com/bmatcuk/doublestar/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2014 Bob Matcuk + +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/bmatcuk/doublestar/README.md b/vendor/github.com/bmatcuk/doublestar/README.md new file mode 100644 index 00000000000..8e365c5e3f9 --- /dev/null +++ b/vendor/github.com/bmatcuk/doublestar/README.md @@ -0,0 +1,109 @@ +![Release](https://img.shields.io/github/release/bmatcuk/doublestar.svg?branch=master) +[![Build Status](https://travis-ci.org/bmatcuk/doublestar.svg?branch=master)](https://travis-ci.org/bmatcuk/doublestar) +[![codecov.io](https://img.shields.io/codecov/c/github/bmatcuk/doublestar.svg?branch=master)](https://codecov.io/github/bmatcuk/doublestar?branch=master) + +# doublestar + +**doublestar** is a [golang](http://golang.org/) implementation of path pattern +matching and globbing with support for "doublestar" (aka globstar: `**`) +patterns. + +doublestar patterns match files and directories recursively. For example, if +you had the following directory structure: + +``` +grandparent +`-- parent + |-- child1 + `-- child2 +``` + +You could find the children with patterns such as: `**/child*`, +`grandparent/**/child?`, `**/parent/*`, or even just `**` by itself (which will +return all files and directories recursively). + +Bash's globstar is doublestar's inspiration and, as such, works similarly. +Note that the doublestar must appear as a path component by itself. A pattern +such as `/path**` is invalid and will be treated the same as `/path*`, but +`/path*/**` should achieve the desired result. Additionally, `/path/**` will +match all directories and files under the path directory, but `/path/**/` will +only match directories. + +## Installation + +**doublestar** can be installed via `go get`: + +```bash +go get github.com/bmatcuk/doublestar +``` + +To use it in your code, you must import it: + +```go +import "github.com/bmatcuk/doublestar" +``` + +## Functions + +### Match +```go +func Match(pattern, name string) (bool, error) +``` + +Match returns true if `name` matches the file name `pattern` +([see below](#patterns)). `name` and `pattern` are split on forward slash (`/`) +characters and may be relative or absolute. + +Note: `Match()` is meant to be a drop-in replacement for `path.Match()`. As +such, it always uses `/` as the path separator. If you are writing code that +will run on systems where `/` is not the path separator (such as Windows), you +want to use `PathMatch()` (below) instead. + + +### PathMatch +```go +func PathMatch(pattern, name string) (bool, error) +``` + +PathMatch returns true if `name` matches the file name `pattern` +([see below](#patterns)). The difference between Match and PathMatch is that +PathMatch will automatically use your system's path separator to split `name` +and `pattern`. + +`PathMatch()` is meant to be a drop-in replacement for `filepath.Match()`. + +### Glob +```go +func Glob(pattern string) ([]string, error) +``` + +Glob finds all files and directories in the filesystem that match `pattern` +([see below](#patterns)). `pattern` may be relative (to the current working +directory), or absolute. + +`Glob()` is meant to be a drop-in replacement for `filepath.Glob()`. + +## Patterns + +**doublestar** supports the following special terms in the patterns: + +Special Terms | Meaning +------------- | ------- +`*` | matches any sequence of non-path-separators +`**` | matches any sequence of characters, including path separators +`?` | matches any single non-path-separator character +`[class]` | matches any single non-path-separator character against a class of characters ([see below](#character-classes)) +`{alt1,...}` | matches a sequence of characters if one of the comma-separated alternatives matches + +Any character with a special meaning can be escaped with a backslash (`\`). + +### Character Classes + +Character classes support the following: + +Class | Meaning +---------- | ------- +`[abc]` | matches any single character within the set +`[a-z]` | matches any single character in the range +`[^class]` | matches any single character which does *not* match the class + diff --git a/vendor/github.com/bmatcuk/doublestar/doublestar.go b/vendor/github.com/bmatcuk/doublestar/doublestar.go new file mode 100644 index 00000000000..901910eb62e --- /dev/null +++ b/vendor/github.com/bmatcuk/doublestar/doublestar.go @@ -0,0 +1,628 @@ +package doublestar + +import ( + "fmt" + "os" + "path" + "path/filepath" + "strings" + "unicode/utf8" +) + +// ErrBadPattern indicates a pattern was malformed. +var ErrBadPattern = path.ErrBadPattern + +// Split a path on the given separator, respecting escaping. +func splitPathOnSeparator(path string, separator rune) (ret []string) { + idx := 0 + if separator == '\\' { + // if the separator is '\\', then we can just split... + ret = strings.Split(path, string(separator)) + idx = len(ret) + } else { + // otherwise, we need to be careful of situations where the separator was escaped + cnt := strings.Count(path, string(separator)) + if cnt == 0 { + return []string{path} + } + + ret = make([]string, cnt+1) + pathlen := len(path) + separatorLen := utf8.RuneLen(separator) + emptyEnd := false + for start := 0; start < pathlen; { + end := indexRuneWithEscaping(path[start:], separator) + if end == -1 { + emptyEnd = false + end = pathlen + } else { + emptyEnd = true + end += start + } + ret[idx] = path[start:end] + start = end + separatorLen + idx++ + } + + // If the last rune is a path separator, we need to append an empty string to + // represent the last, empty path component. By default, the strings from + // make([]string, ...) will be empty, so we just need to icrement the count + if emptyEnd { + idx++ + } + } + + return ret[:idx] +} + +// Find the first index of a rune in a string, +// ignoring any times the rune is escaped using "\". +func indexRuneWithEscaping(s string, r rune) int { + end := strings.IndexRune(s, r) + if end == -1 { + return -1 + } + if end > 0 && s[end-1] == '\\' { + start := end + utf8.RuneLen(r) + end = indexRuneWithEscaping(s[start:], r) + if end != -1 { + end += start + } + } + return end +} + +// Find the last index of a rune in a string, +// ignoring any times the rune is escaped using "\". +func lastIndexRuneWithEscaping(s string, r rune) int { + end := strings.LastIndex(s, string(r)) + if end == -1 { + return -1 + } + if end > 0 && s[end-1] == '\\' { + end = lastIndexRuneWithEscaping(s[:end-1], r) + } + return end +} + +// Find the index of the first instance of one of the unicode characters in +// chars, ignoring any times those characters are escaped using "\". +func indexAnyWithEscaping(s, chars string) int { + end := strings.IndexAny(s, chars) + if end == -1 { + return -1 + } + if end > 0 && s[end-1] == '\\' { + _, adj := utf8.DecodeRuneInString(s[end:]) + start := end + adj + end = indexAnyWithEscaping(s[start:], chars) + if end != -1 { + end += start + } + } + return end +} + +// Split a set of alternatives such as {alt1,alt2,...} and returns the index of +// the rune after the closing curly brace. Respects nested alternatives and +// escaped runes. +func splitAlternatives(s string) (ret []string, idx int) { + ret = make([]string, 0, 2) + idx = 0 + slen := len(s) + braceCnt := 1 + esc := false + start := 0 + for braceCnt > 0 { + if idx >= slen { + return nil, -1 + } + + sRune, adj := utf8.DecodeRuneInString(s[idx:]) + if esc { + esc = false + } else if sRune == '\\' { + esc = true + } else if sRune == '{' { + braceCnt++ + } else if sRune == '}' { + braceCnt-- + } else if sRune == ',' && braceCnt == 1 { + ret = append(ret, s[start:idx]) + start = idx + adj + } + + idx += adj + } + ret = append(ret, s[start:idx-1]) + return +} + +// Returns true if the pattern is "zero length", meaning +// it could match zero or more characters. +func isZeroLengthPattern(pattern string) (ret bool, err error) { + // * can match zero + if pattern == "" || pattern == "*" || pattern == "**" { + return true, nil + } + + // an alternative with zero length can match zero, for example {,x} - the + // first alternative has zero length + r, adj := utf8.DecodeRuneInString(pattern) + if r == '{' { + options, endOptions := splitAlternatives(pattern[adj:]) + if endOptions == -1 { + return false, ErrBadPattern + } + if ret, err = isZeroLengthPattern(pattern[adj+endOptions:]); !ret || err != nil { + return + } + for _, o := range options { + if ret, err = isZeroLengthPattern(o); ret || err != nil { + return + } + } + } + + return false, nil +} + +// Match returns true if name matches the shell file name pattern. +// The pattern syntax is: +// +// pattern: +// { term } +// term: +// '*' matches any sequence of non-path-separators +// '**' matches any sequence of characters, including +// path separators. +// '?' matches any single non-path-separator character +// '[' [ '^' ] { character-range } ']' +// character class (must be non-empty) +// '{' { term } [ ',' { term } ... ] '}' +// c matches character c (c != '*', '?', '\\', '[') +// '\\' c matches character c +// +// character-range: +// c matches character c (c != '\\', '-', ']') +// '\\' c matches character c +// lo '-' hi matches character c for lo <= c <= hi +// +// Match requires pattern to match all of name, not just a substring. +// The path-separator defaults to the '/' character. The only possible +// returned error is ErrBadPattern, when pattern is malformed. +// +// Note: this is meant as a drop-in replacement for path.Match() which +// always uses '/' as the path separator. If you want to support systems +// which use a different path separator (such as Windows), what you want +// is the PathMatch() function below. +// +func Match(pattern, name string) (bool, error) { + return matchWithSeparator(pattern, name, '/') +} + +// PathMatch is like Match except that it uses your system's path separator. +// For most systems, this will be '/'. However, for Windows, it would be '\\'. +// Note that for systems where the path separator is '\\', escaping is +// disabled. +// +// Note: this is meant as a drop-in replacement for filepath.Match(). +// +func PathMatch(pattern, name string) (bool, error) { + pattern = filepath.ToSlash(pattern) + return matchWithSeparator(pattern, name, os.PathSeparator) +} + +// Match returns true if name matches the shell file name pattern. +// The pattern syntax is: +// +// pattern: +// { term } +// term: +// '*' matches any sequence of non-path-separators +// '**' matches any sequence of characters, including +// path separators. +// '?' matches any single non-path-separator character +// '[' [ '^' ] { character-range } ']' +// character class (must be non-empty) +// '{' { term } [ ',' { term } ... ] '}' +// c matches character c (c != '*', '?', '\\', '[') +// '\\' c matches character c +// +// character-range: +// c matches character c (c != '\\', '-', ']') +// '\\' c matches character c, unless separator is '\\' +// lo '-' hi matches character c for lo <= c <= hi +// +// Match requires pattern to match all of name, not just a substring. +// The only possible returned error is ErrBadPattern, when pattern +// is malformed. +// +func matchWithSeparator(pattern, name string, separator rune) (bool, error) { + nameComponents := splitPathOnSeparator(name, separator) + return doMatching(pattern, nameComponents) +} + +func doMatching(pattern string, nameComponents []string) (matched bool, err error) { + // check for some base-cases + patternLen, nameLen := len(pattern), len(nameComponents) + if patternLen == 0 && nameLen == 0 { + return true, nil + } + if patternLen == 0 || nameLen == 0 { + return false, nil + } + + slashIdx := indexRuneWithEscaping(pattern, '/') + lastComponent := slashIdx == -1 + if lastComponent { + slashIdx = len(pattern) + } + if pattern[:slashIdx] == "**" { + // if our last pattern component is a doublestar, we're done - + // doublestar will match any remaining name components, if any. + if lastComponent { + return true, nil + } + + // otherwise, try matching remaining components + for nameIdx := 0; nameIdx < nameLen; nameIdx++ { + if m, _ := doMatching(pattern[slashIdx+1:], nameComponents[nameIdx:]); m { + return true, nil + } + } + return false, nil + } + + var matches []string + matches, err = matchComponent(pattern, nameComponents[0]) + if matches == nil || err != nil { + return + } + if len(matches) == 0 && nameLen == 1 { + return true, nil + } + + if nameLen > 1 { + for _, alt := range matches { + matched, err = doMatching(alt, nameComponents[1:]) + if matched || err != nil { + return + } + } + } + + return false, nil +} + +// Glob returns the names of all files matching pattern or nil +// if there is no matching file. The syntax of pattern is the same +// as in Match. The pattern may describe hierarchical names such as +// /usr/*/bin/ed (assuming the Separator is '/'). +// +// Glob ignores file system errors such as I/O errors reading directories. +// The only possible returned error is ErrBadPattern, when pattern +// is malformed. +// +// Your system path separator is automatically used. This means on +// systems where the separator is '\\' (Windows), escaping will be +// disabled. +// +// Note: this is meant as a drop-in replacement for filepath.Glob(). +// +func Glob(pattern string) (matches []string, err error) { + if len(pattern) == 0 { + return nil, nil + } + + // if the pattern starts with alternatives, we need to handle that here - the + // alternatives may be a mix of relative and absolute + if pattern[0] == '{' { + options, endOptions := splitAlternatives(pattern[1:]) + if endOptions == -1 { + return nil, ErrBadPattern + } + for _, o := range options { + m, e := Glob(o + pattern[endOptions+1:]) + if e != nil { + return nil, e + } + matches = append(matches, m...) + } + return matches, nil + } + + // If the pattern is relative or absolute and we're on a non-Windows machine, + // volumeName will be an empty string. If it is absolute and we're on a + // Windows machine, volumeName will be a drive letter ("C:") for filesystem + // paths or \\\ for UNC paths. + isAbs := filepath.IsAbs(pattern) + volumeName := filepath.VolumeName(pattern) + isWindowsUNC := strings.HasPrefix(volumeName, `\\`) + if isWindowsUNC || isAbs { + startIdx := len(volumeName) + 1 + return doGlob(fmt.Sprintf("%s%s", volumeName, string(os.PathSeparator)), filepath.ToSlash(pattern[startIdx:]), matches) + } + + // otherwise, it's a relative pattern + return doGlob(".", filepath.ToSlash(pattern), matches) +} + +// Perform a glob +func doGlob(basedir, pattern string, matches []string) (m []string, e error) { + m = matches + e = nil + + // if the pattern starts with any path components that aren't globbed (ie, + // `path/to/glob*`), we can skip over the un-globbed components (`path/to` in + // our example). + globIdx := indexAnyWithEscaping(pattern, "*?[{\\") + if globIdx > 0 { + globIdx = lastIndexRuneWithEscaping(pattern[:globIdx], '/') + } else if globIdx == -1 { + globIdx = lastIndexRuneWithEscaping(pattern, '/') + } + if globIdx > 0 { + basedir = filepath.Join(basedir, pattern[:globIdx]) + pattern = pattern[globIdx+1:] + } + + // Lstat will return an error if the file/directory doesn't exist + fi, err := os.Lstat(basedir) + if err != nil { + return + } + + // if the pattern is empty, we've found a match + if len(pattern) == 0 { + m = append(m, basedir) + return + } + + // otherwise, we need to check each item in the directory... + // first, if basedir is a symlink, follow it... + if (fi.Mode() & os.ModeSymlink) != 0 { + fi, err = os.Stat(basedir) + if err != nil { + return + } + } + + // confirm it's a directory... + if !fi.IsDir() { + return + } + + // read directory + dir, err := os.Open(basedir) + if err != nil { + return + } + defer dir.Close() + + files, _ := dir.Readdir(-1) + slashIdx := indexRuneWithEscaping(pattern, '/') + lastComponent := slashIdx == -1 + if lastComponent { + slashIdx = len(pattern) + } + if pattern[:slashIdx] == "**" { + // if the current component is a doublestar, we'll try depth-first + for _, file := range files { + // if symlink, we may want to follow + if (file.Mode() & os.ModeSymlink) != 0 { + file, err = os.Stat(filepath.Join(basedir, file.Name())) + if err != nil { + continue + } + } + + if file.IsDir() { + // recurse into directories + if lastComponent { + m = append(m, filepath.Join(basedir, file.Name())) + } + m, e = doGlob(filepath.Join(basedir, file.Name()), pattern, m) + } else if lastComponent { + // if the pattern's last component is a doublestar, we match filenames, too + m = append(m, filepath.Join(basedir, file.Name())) + } + } + if lastComponent { + return // we're done + } + + pattern = pattern[slashIdx+1:] + } + + // check items in current directory and recurse + var match []string + for _, file := range files { + match, e = matchComponent(pattern, file.Name()) + if e != nil { + return + } + if match != nil { + if len(match) == 0 { + m = append(m, filepath.Join(basedir, file.Name())) + } else { + for _, alt := range match { + m, e = doGlob(filepath.Join(basedir, file.Name()), alt, m) + } + } + } + } + return +} + +// Attempt to match a single path component with a pattern. Note that the +// pattern may include multiple components but that the "name" is just a single +// path component. The return value is a slice of patterns that should be +// checked against subsequent path components or nil, indicating that the +// pattern does not match this path. It is assumed that pattern components are +// separated by '/' +func matchComponent(pattern, name string) ([]string, error) { + // check for matches one rune at a time + patternLen, nameLen := len(pattern), len(name) + patIdx, nameIdx := 0, 0 + for patIdx < patternLen && nameIdx < nameLen { + patRune, patAdj := utf8.DecodeRuneInString(pattern[patIdx:]) + nameRune, nameAdj := utf8.DecodeRuneInString(name[nameIdx:]) + if patRune == '/' { + patIdx++ + break + } else if patRune == '\\' { + // handle escaped runes, only if separator isn't '\\' + patIdx += patAdj + patRune, patAdj = utf8.DecodeRuneInString(pattern[patIdx:]) + if patRune == utf8.RuneError { + return nil, ErrBadPattern + } else if patRune == nameRune { + patIdx += patAdj + nameIdx += nameAdj + } else { + return nil, nil + } + } else if patRune == '*' { + // handle stars - a star at the end of the pattern or before a separator + // will always match the rest of the path component + if patIdx += patAdj; patIdx >= patternLen { + return []string{}, nil + } + if patRune, patAdj = utf8.DecodeRuneInString(pattern[patIdx:]); patRune == '/' { + return []string{pattern[patIdx+patAdj:]}, nil + } + + // check if we can make any matches + for ; nameIdx < nameLen; nameIdx += nameAdj { + if m, e := matchComponent(pattern[patIdx:], name[nameIdx:]); m != nil || e != nil { + return m, e + } + } + return nil, nil + } else if patRune == '[' { + // handle character sets + patIdx += patAdj + endClass := indexRuneWithEscaping(pattern[patIdx:], ']') + if endClass == -1 { + return nil, ErrBadPattern + } + endClass += patIdx + classRunes := []rune(pattern[patIdx:endClass]) + classRunesLen := len(classRunes) + if classRunesLen > 0 { + classIdx := 0 + matchClass := false + if classRunes[0] == '^' { + classIdx++ + } + for classIdx < classRunesLen { + low := classRunes[classIdx] + if low == '-' { + return nil, ErrBadPattern + } + classIdx++ + if low == '\\' { + if classIdx < classRunesLen { + low = classRunes[classIdx] + classIdx++ + } else { + return nil, ErrBadPattern + } + } + high := low + if classIdx < classRunesLen && classRunes[classIdx] == '-' { + // we have a range of runes + if classIdx++; classIdx >= classRunesLen { + return nil, ErrBadPattern + } + high = classRunes[classIdx] + if high == '-' { + return nil, ErrBadPattern + } + classIdx++ + if high == '\\' { + if classIdx < classRunesLen { + high = classRunes[classIdx] + classIdx++ + } else { + return nil, ErrBadPattern + } + } + } + if low <= nameRune && nameRune <= high { + matchClass = true + } + } + if matchClass == (classRunes[0] == '^') { + return nil, nil + } + } else { + return nil, ErrBadPattern + } + patIdx = endClass + 1 + nameIdx += nameAdj + } else if patRune == '{' { + // handle alternatives such as {alt1,alt2,...} + patIdx += patAdj + options, endOptions := splitAlternatives(pattern[patIdx:]) + if endOptions == -1 { + return nil, ErrBadPattern + } + patIdx += endOptions + + results := make([][]string, 0, len(options)) + totalResults := 0 + for _, o := range options { + m, e := matchComponent(o+pattern[patIdx:], name[nameIdx:]) + if e != nil { + return nil, e + } + if m != nil { + results = append(results, m) + totalResults += len(m) + } + } + if len(results) > 0 { + lst := make([]string, 0, totalResults) + for _, m := range results { + lst = append(lst, m...) + } + return lst, nil + } + + return nil, nil + } else if patRune == '?' || patRune == nameRune { + // handle single-rune wildcard + patIdx += patAdj + nameIdx += nameAdj + } else { + return nil, nil + } + } + if nameIdx >= nameLen { + if patIdx >= patternLen { + return []string{}, nil + } + + pattern = pattern[patIdx:] + slashIdx := indexRuneWithEscaping(pattern, '/') + testPattern := pattern + if slashIdx >= 0 { + testPattern = pattern[:slashIdx] + } + + zeroLength, err := isZeroLengthPattern(testPattern) + if err != nil { + return nil, err + } + if zeroLength { + if slashIdx == -1 { + return []string{}, nil + } else { + return []string{pattern[slashIdx+1:]}, nil + } + } + } + return nil, nil +} diff --git a/vendor/github.com/bmatcuk/doublestar/go.mod b/vendor/github.com/bmatcuk/doublestar/go.mod new file mode 100644 index 00000000000..ce1688f7301 --- /dev/null +++ b/vendor/github.com/bmatcuk/doublestar/go.mod @@ -0,0 +1,3 @@ +module github.com/bmatcuk/doublestar + +go 1.12 diff --git a/vendor/github.com/bombsimon/wsl/v2/.gitignore b/vendor/github.com/bombsimon/wsl/v2/.gitignore new file mode 100644 index 00000000000..1c8eba613e4 --- /dev/null +++ b/vendor/github.com/bombsimon/wsl/v2/.gitignore @@ -0,0 +1,70 @@ + +# Created by https://www.gitignore.io/api/go,vim,macos + +### Go ### +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, build with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +### Go Patch ### +/vendor/ +/Godeps/ + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### Vim ### +# Swap +[._]*.s[a-v][a-z] +[._]*.sw[a-p] +[._]s[a-rt-v][a-z] +[._]ss[a-gi-z] +[._]sw[a-p] + +# Session +Session.vim + +# Temporary +.netrwhist +*~ +# Auto-generated tag files +tags +# Persistent undo +[._]*.un~ + + +# End of https://www.gitignore.io/api/go,vim,macos diff --git a/vendor/github.com/bombsimon/wsl/v2/.travis.yml b/vendor/github.com/bombsimon/wsl/v2/.travis.yml new file mode 100644 index 00000000000..5e2e26ed1c9 --- /dev/null +++ b/vendor/github.com/bombsimon/wsl/v2/.travis.yml @@ -0,0 +1,25 @@ +--- +language: go + +go: + - 1.13.x + - 1.12.x + - 1.11.x + +env: + global: + - GO111MODULE=on + +install: + - go get -v golang.org/x/tools/cmd/cover github.com/mattn/goveralls + +script: + - go test -v -covermode=count -coverprofile=coverage.out + +after_script: + - $HOME/gopath/bin/goveralls -coverprofile=coverage.out -service=travis-ci + +notifications: + email: false + +# vim: set ts=2 sw=2 et: diff --git a/vendor/github.com/bombsimon/wsl/v2/LICENSE b/vendor/github.com/bombsimon/wsl/v2/LICENSE new file mode 100644 index 00000000000..4dade6d1c96 --- /dev/null +++ b/vendor/github.com/bombsimon/wsl/v2/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Simon Sawert + +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/bombsimon/wsl/v2/README.md b/vendor/github.com/bombsimon/wsl/v2/README.md new file mode 100644 index 00000000000..a8dfb5a85ed --- /dev/null +++ b/vendor/github.com/bombsimon/wsl/v2/README.md @@ -0,0 +1,124 @@ +# WSL - Whitespace Linter + +[![forthebadge](https://forthebadge.com/images/badges/made-with-go.svg)](https://forthebadge.com) +[![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://forthebadge.com) + +[![Build Status](https://travis-ci.org/bombsimon/wsl.svg?branch=master)](https://travis-ci.org/bombsimon/wsl) +[![Coverage Status](https://coveralls.io/repos/github/bombsimon/wsl/badge.svg?branch=master)](https://coveralls.io/github/bombsimon/wsl?branch=master) + +WSL is a linter that enforces a very **non scientific** vision of how to make +code more readable by enforcing empty lines at the right places. + +I think too much code out there is to cuddly and a bit too warm for it's own +good, making it harder for other people to read and understand. The linter will +warn about newlines in and around blocks, in the beginning of files and other +places in the code. + +**I know this linter is aggressive** and a lot of projects I've tested it on +have failed miserably. For this linter to be useful at all I want to be open to +new ideas, configurations and discussions! Also note that some of the warnings +might be bugs or unintentional false positives so I would love an +[issue](https://github.com/bombsimon/wsl/issues/new) to fix, discuss, change or +make something configurable! + +## Installation + +### By `go get` (local installation) + +You can do that by using: + +```sh +go get -u github.com/bombsimon/wsl/cmd/... +``` + +### By golangci-lint (CI automation) + +`wsl` is already integrated with +[golangci-lint](https://github.com/golangci/golangci-lint). Please refer to the +instructions there. + +## Usage + +How to use depends on how you install `wsl`. + +### With local binary + +The general command format for `wsl` is: + +```sh +$ wsl [flags] [files...] +$ wsl [flags] + +# Examples + +$ wsl ./main.go +$ wsl --no-test ./main.go +$ wsl --allow-cuddle-declarations ./main.go +$ wsl --no-test --allow-cuddle-declaration ./main.go +$ wsl --no-test --allow-trailing-comment ./myProject/... +``` + +The "..." wildcard is not used like other `go` commands but instead can only +be to a relative or absolute path. + +By default, the linter will run on `./...` which means all go files in the +current path and all subsequent paths, including test files. To disable linting +test files, use `-n` or `--no-test`. + +### By `golangci-lint` (CI automation) + +The recommended command is: + +```sh +golangci-lint --disable-all --enable wsl +``` + +For more information, please refer to +[golangci-lint](https://github.com/golangci/golangci-lint)'s documentation. + +## Issues and configuration + +The linter suppers a few ways to configure it to satisfy more than one kind of +code style. These settings could be set either with flags or with YAML +configuration if used via `golangci-lint`. + +The supported configuration can be found [in the documentation](doc/configuration.md). + +Below are the available checklist for any hit from `wsl`. If you do not see any, +feel free to raise an [issue](https://github.com/bombsimon/wsl/issues/new). + +> **Note**: this linter doesn't take in consideration the issues that will be +> fixed with `go fmt -s` so ensure that the code is properly formatted before +> use. + +* [Anonymous switch statements should never be cuddled](doc/rules.md#anonymous-switch-statements-should-never-be-cuddled) +* [Append only allowed to cuddle with appended value](doc/rules.md#append-only-allowed-to-cuddle-with-appended-value) +* [Assignments should only be cuddled with other assignments](doc/rules.md#assignments-should-only-be-cuddled-with-other-assignments) +* [Block should not end with a whitespace (or comment)](doc/rules.md#block-should-not-end-with-a-whitespace-or-comment) +* [Block should not start with a whitespace](doc/rules.md#block-should-not-start-with-a-whitespace) +* [Case block should end with newline at this size](doc/rules.md#case-block-should-end-with-newline-at-this-size) +* [Branch statements should not be cuddled if block has more than two lines](doc/rules.md#branch-statements-should-not-be-cuddled-if-block-has-more-than-two-lines) +* [Declarations should never be cuddled](doc/rules.md#declarations-should-never-be-cuddled) +* [Defer statements should only be cuddled with expressions on same variable](doc/rules.md#defer-statements-should-only-be-cuddled-with-expressions-on-same-variable) +* [Expressions should not be cuddled with blocks](doc/rules.md#expressions-should-not-be-cuddled-with-blocks) +* [Expressions should not be cuddled with declarations or returns](doc/rules.md#expressions-should-not-be-cuddled-with-declarations-or-returns) +* [For statement without condition should never be cuddled](doc/rules.md#for-statement-without-condition-should-never-be-cuddled) +* [For statements should only be cuddled with assignments used in the iteration](doc/rules.md#for-statements-should-only-be-cuddled-with-assignments-used-in-the-iteration) +* [Go statements can only invoke functions assigned on line above](doc/rules.md#go-statements-can-only-invoke-functions-assigned-on-line-above) +* [If statements should only be cuddled with assignments](doc/rules.md#if-statements-should-only-be-cuddled-with-assignments) +* [If statements should only be cuddled with assignments used in the if + statement + itself](doc/rules.md#if-statements-should-only-be-cuddled-with-assignments-used-in-the-if-statement-itself) +* [Only cuddled expressions if assigning variable or using from line + above](doc/rules.md#only-cuddled-expressions-if-assigning-variable-or-using-from-line-above) +* [Only one cuddle assignment allowed before defer statement](doc/rules.md#only-one-cuddle-assignment-allowed-before-defer-statement) +* [Only one cuddle assginment allowed before for statement](doc/rules.md#only-one-cuddle-assignment-allowed-before-for-statement) +* [Only one cuddle assignment allowed before go statement](doc/rules.md#only-one-cuddle-assignment-allowed-before-go-statement) +* [Only one cuddle assignment allowed before if statement](doc/rules.md#only-one-cuddle-assignment-allowed-before-if-statement) +* [Only one cuddle assignment allowed before range statement](doc/rules.md#only-one-cuddle-assignment-allowed-before-range-statement) +* [Only one cuddle assignment allowed before switch statement](doc/rules.md#only-one-cuddle-assignment-allowed-before-switch-statement) +* [Only one cuddle assignment allowed before type switch statement](doc/rules.md#only-one-cuddle-assignment-allowed-before-type-switch-statement) +* [Ranges should only be cuddled with assignments used in the iteration](doc/rules.md#ranges-should-only-be-cuddled-with-assignments-used-in-the-iteration) +* [Return statements should not be cuddled if block has more than two lines](doc/rules.md#return-statements-should-not-be-cuddled-if-block-has-more-than-two-lines) +* [Switch statements should only be cuddled with variables switched](doc/rules.md#switch-statements-should-only-be-cuddled-with-variables-switched) +* [Type switch statements should only be cuddled with variables switched](doc/rules.md#type-switch-statements-should-only-be-cuddled-with-variables-switched) diff --git a/vendor/github.com/bombsimon/wsl/v2/go.mod b/vendor/github.com/bombsimon/wsl/v2/go.mod new file mode 100644 index 00000000000..65385792959 --- /dev/null +++ b/vendor/github.com/bombsimon/wsl/v2/go.mod @@ -0,0 +1,12 @@ +module github.com/bombsimon/wsl/v2 + +go 1.12 + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/kr/pretty v0.1.0 // indirect + github.com/stretchr/testify v1.4.0 + golang.org/x/tools v0.0.0-20191113232020-e2727e816f5a + gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect + gopkg.in/yaml.v2 v2.2.5 // indirect +) diff --git a/vendor/github.com/bombsimon/wsl/v2/go.sum b/vendor/github.com/bombsimon/wsl/v2/go.sum new file mode 100644 index 00000000000..0f5bdd5d162 --- /dev/null +++ b/vendor/github.com/bombsimon/wsl/v2/go.sum @@ -0,0 +1,30 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20191113232020-e2727e816f5a h1:3IG7HNvPBDvrxpnTWA6zpeNCS5ydX6cdt6oOiGlC8qg= +golang.org/x/tools v0.0.0-20191113232020-e2727e816f5a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/bombsimon/wsl/v2/wsl.go b/vendor/github.com/bombsimon/wsl/v2/wsl.go new file mode 100644 index 00000000000..ea8d4eb5c76 --- /dev/null +++ b/vendor/github.com/bombsimon/wsl/v2/wsl.go @@ -0,0 +1,1002 @@ +package wsl + +import ( + "fmt" + "go/ast" + "go/parser" + "go/token" + "io/ioutil" + "reflect" + "strings" +) + +type Configuration struct { + // StrictAppend will do strict checking when assigning from append (x = + // append(x, y)). If this is set to true the append call must append either + // a variable assigned, called or used on the line above. Example on not + // allowed when this is true: + // + // x := []string{} + // y := "not going in X" + // x = append(x, "not y") // This is not allowed with StrictAppend + // z := "going in X" + // + // x = append(x, z) // This is allowed with StrictAppend + // + // m := transform(z) + // x = append(x, z) // So is this because Z is used above. + StrictAppend bool + + // AllowAssignAndCallCuddle allows assignments to be cuddled with variables + // used in calls on line above and calls to be cuddled with assignments of + // variables used in call on line above. + // Example supported with this set to true: + // + // x.Call() + // x = Assign() + // x.AnotherCall() + // x = AnotherAssign() + AllowAssignAndCallCuddle bool + + // AllowMultiLineAssignCuddle allows cuddling to assignments even if they + // span over multiple lines. This defaults to true which allows the + // following example: + // + // err := function( + // "multiple", "lines", + // ) + // if err != nil { + // // ... + // } + AllowMultiLineAssignCuddle bool + + // If the number of lines in a case block is equal to or lager than this + // number, the case *must* end white a newline. + CaseForceTrailingWhitespaceLimit int + + // AllowTrailingComment will allow blocks to end with comments. + AllowTrailingComment bool + + // AllowCuddleDeclaration will allow multiple var/declaration statements to + // be cuddled. This defaults to false but setting it to true will enable the + // following example: + // var foo bool + // var err error + AllowCuddleDeclaration bool + + // AllowCuddleWithCalls is a list of call idents that everything can be + // cuddled with. Defaults to calls looking like locks to support a flow like + // this: + // + // mu.Lock() + // allow := thisAssignment + AllowCuddleWithCalls []string + + // AllowCuddleWithRHS is a list of right hand side variables that is allowed + // to be cuddled with anything. Defaults to assignments or calls looking + // like unlocks to support a flow like this: + // + // allow := thisAssignment() + // mu.Unlock() + AllowCuddleWithRHS []string +} + +// DefaultConfig returns default configuration +func DefaultConfig() Configuration { + return Configuration{ + StrictAppend: true, + AllowAssignAndCallCuddle: true, + AllowMultiLineAssignCuddle: true, + AllowTrailingComment: false, + CaseForceTrailingWhitespaceLimit: 0, + AllowCuddleWithCalls: []string{"Lock", "RLock"}, + AllowCuddleWithRHS: []string{"Unlock", "RUnlock"}, + } +} + +// Result represents the result of one error. +type Result struct { + FileName string + LineNumber int + Position token.Position + Reason string +} + +// String returns the filename, line number and reason of a Result. +func (r *Result) String() string { + return fmt.Sprintf("%s:%d: %s", r.FileName, r.LineNumber, r.Reason) +} + +type Processor struct { + config Configuration + result []Result + warnings []string + fileSet *token.FileSet + file *ast.File +} + +// NewProcessor will create a Processor. +func NewProcessorWithConfig(cfg Configuration) *Processor { + return &Processor{ + result: []Result{}, + config: cfg, + } +} + +// NewProcessor will create a Processor. +func NewProcessor() *Processor { + return NewProcessorWithConfig(DefaultConfig()) +} + +// ProcessFiles takes a string slice with file names (full paths) and lints +// them. +// nolint: gocritic +func (p *Processor) ProcessFiles(filenames []string) ([]Result, []string) { + for _, filename := range filenames { + data, err := ioutil.ReadFile(filename) + if err != nil { + panic(err) + } + + p.process(filename, data) + } + + return p.result, p.warnings +} + +func (p *Processor) process(filename string, data []byte) { + fileSet := token.NewFileSet() + file, err := parser.ParseFile(fileSet, filename, data, parser.ParseComments) + + // If the file is not parsable let's add a syntax error and move on. + if err != nil { + p.result = append(p.result, Result{ + FileName: filename, + LineNumber: 0, + Reason: fmt.Sprintf("invalid syntax, file cannot be linted (%s)", err.Error()), + }) + + return + } + + p.fileSet = fileSet + p.file = file + + for _, d := range p.file.Decls { + switch v := d.(type) { + case *ast.FuncDecl: + p.parseBlockBody(v.Name, v.Body) + case *ast.GenDecl: + // `go fmt` will handle proper spacing for GenDecl such as imports, + // constants etc. + default: + p.addWarning("type not implemented", d.Pos(), v) + } + } +} + +// parseBlockBody will parse any kind of block statements such as switch cases +// and if statements. A list of Result is returned. +func (p *Processor) parseBlockBody(ident *ast.Ident, block *ast.BlockStmt) { + // Nothing to do if there's no value. + if reflect.ValueOf(block).IsNil() { + return + } + + // Start by finding leading and trailing whitespaces. + p.findLeadingAndTrailingWhitespaces(ident, block, nil) + + // Parse the block body contents. + p.parseBlockStatements(block.List) +} + +// parseBlockStatements will parse all the statements found in the body of a +// node. A list of Result is returned. +// nolint: gocognit +func (p *Processor) parseBlockStatements(statements []ast.Stmt) { + for i, stmt := range statements { + // Start by checking if this statement is another block (other than if, + // for and range). This could be assignment to a function, defer or go + // call with an inline function or similar. If this is found we start by + // parsing this body block before moving on. + for _, stmtBlocks := range p.findBlockStmt(stmt) { + p.parseBlockBody(nil, stmtBlocks) + } + + firstBodyStatement := p.firstBodyStatement(i, statements) + + // First statement, nothing to do. + if i == 0 { + continue + } + + previousStatement := statements[i-1] + + // If the last statement didn't end one line above the current statement + // we know we're not cuddled so just move on. + if p.nodeEnd(previousStatement) != p.nodeStart(stmt)-1 { + continue + } + + // We know we're cuddled, extract assigned variables on the line above + // which is the only thing we allow cuddling with. If the assignment is + // made over multiple lines we should not allow cuddling. + var assignedOnLineAbove []string + + // We want to keep track of what was called on the line above to support + // special handling of things such as mutexes. + var calledOnLineAbove []string + + // Check if the previous statement spans over multiple lines. + var isMultiLineAssignment = p.nodeStart(previousStatement) != p.nodeStart(stmt)-1 + + // Ensure previous line is not a multi line assignment and if not get + // rightAndLeftHandSide assigned variables. + if !isMultiLineAssignment { + assignedOnLineAbove = p.findLHS(previousStatement) + calledOnLineAbove = p.findRHS(previousStatement) + } + + // If previous assignment is multi line and we allow it, fetch + // assignments (but only assignments). + if isMultiLineAssignment && p.config.AllowMultiLineAssignCuddle { + if _, ok := previousStatement.(*ast.AssignStmt); ok { + assignedOnLineAbove = p.findLHS(previousStatement) + } + } + + // We could potentially have a block which require us to check the first + // argument before ruling out an allowed cuddle. + var assignedFirstInBlock []string + + if firstBodyStatement != nil { + assignedFirstInBlock = p.findLHS(firstBodyStatement) + } + + var ( + leftHandSide = p.findLHS(stmt) + rightHandSide = p.findRHS(stmt) + rightAndLeftHandSide = append(leftHandSide, rightHandSide...) + calledOrAssignedOnLineAbove = append(calledOnLineAbove, assignedOnLineAbove...) + ) + + // If we called some kind of lock on the line above we allow cuddling + // anything. + if atLeastOneInListsMatch(calledOnLineAbove, p.config.AllowCuddleWithCalls) { + continue + } + + // If we call some kind of unlock on this line we allow cuddling with + // anything. + if atLeastOneInListsMatch(rightHandSide, p.config.AllowCuddleWithRHS) { + continue + } + + moreThanOneStatementAbove := func() bool { + if i < 2 { + return false + } + + statementBeforePreviousStatement := statements[i-2] + + return p.nodeStart(previousStatement)-1 == p.nodeEnd(statementBeforePreviousStatement) + } + + isLastStatementInBlockOfOnlyTwoLines := func() bool { + // If we're the last statement, check if there's no more than two + // lines from the starting statement and the end of this statement. + // This is to support short return functions such as: + // func (t *Typ) X() { + // t.X = true + // return t + // } + // nolint: gocritic + if i == len(statements)-1 && i == 1 { + if p.nodeEnd(stmt)-p.nodeStart(previousStatement) <= 2 { + return true + } + } + + return false + } + + switch t := stmt.(type) { + case *ast.IfStmt: + if len(assignedOnLineAbove) == 0 { + p.addError(t.Pos(), "if statements should only be cuddled with assignments") + continue + } + + if moreThanOneStatementAbove() { + p.addError(t.Pos(), "only one cuddle assignment allowed before if statement") + continue + } + + if atLeastOneInListsMatch(rightAndLeftHandSide, assignedOnLineAbove) { + continue + } + + if atLeastOneInListsMatch(assignedOnLineAbove, assignedFirstInBlock) { + continue + } + + p.addError(t.Pos(), "if statements should only be cuddled with assignments used in the if statement itself") + case *ast.ReturnStmt: + if isLastStatementInBlockOfOnlyTwoLines() { + continue + } + + p.addError(t.Pos(), "return statements should not be cuddled if block has more than two lines") + case *ast.BranchStmt: + if isLastStatementInBlockOfOnlyTwoLines() { + continue + } + + p.addError(t.Pos(), "branch statements should not be cuddled if block has more than two lines") + case *ast.AssignStmt: + // append is usually an assignment but should not be allowed to be + // cuddled with anything not appended. + if len(rightHandSide) > 0 && rightHandSide[len(rightHandSide)-1] == "append" { + if p.config.StrictAppend { + if !atLeastOneInListsMatch(calledOrAssignedOnLineAbove, rightHandSide) { + p.addError(t.Pos(), "append only allowed to cuddle with appended value") + } + } + + continue + } + + if _, ok := previousStatement.(*ast.AssignStmt); ok { + continue + } + + // If the assignment is from a type or variable called on the line + // above we can allow it by setting AllowAssignAndCallCuddle to + // true. + // Example (x is used): + // x.function() + // a.Field = x.anotherFunction() + if p.config.AllowAssignAndCallCuddle { + if atLeastOneInListsMatch(calledOrAssignedOnLineAbove, rightAndLeftHandSide) { + continue + } + } + + p.addError(t.Pos(), "assignments should only be cuddled with other assignments") + case *ast.DeclStmt: + if !p.config.AllowCuddleDeclaration { + p.addError(t.Pos(), "declarations should never be cuddled") + } + case *ast.ExprStmt: + switch previousStatement.(type) { + case *ast.DeclStmt, *ast.ReturnStmt: + p.addError(t.Pos(), "expressions should not be cuddled with declarations or returns") + case *ast.IfStmt, *ast.RangeStmt, *ast.SwitchStmt: + p.addError(t.Pos(), "expressions should not be cuddled with blocks") + } + + // If the expression is called on a type or variable used or + // assigned on the line we can allow it by setting + // AllowAssignAndCallCuddle to true. + // Example of allowed cuddled (x is used): + // a.Field = x.func() + // x.function() + if p.config.AllowAssignAndCallCuddle { + if atLeastOneInListsMatch(calledOrAssignedOnLineAbove, rightAndLeftHandSide) { + continue + } + } + + // If we assigned variables on the line above but didn't use them in + // this expression there should probably be a newline between them. + if len(assignedOnLineAbove) > 0 && !atLeastOneInListsMatch(rightAndLeftHandSide, assignedOnLineAbove) { + p.addError(t.Pos(), "only cuddled expressions if assigning variable or using from line above") + } + case *ast.RangeStmt: + if moreThanOneStatementAbove() { + p.addError(t.Pos(), "only one cuddle assignment allowed before range statement") + continue + } + + if !atLeastOneInListsMatch(rightAndLeftHandSide, assignedOnLineAbove) { + if !atLeastOneInListsMatch(assignedOnLineAbove, assignedFirstInBlock) { + p.addError(t.Pos(), "ranges should only be cuddled with assignments used in the iteration") + } + } + case *ast.DeferStmt: + if _, ok := previousStatement.(*ast.DeferStmt); ok { + // We may cuddle multiple defers to group logic. + continue + } + + // Special treatment of deferring body closes after error checking + // according to best practices. See + // https://github.com/bombsimon/wsl/issues/31 which links to + // discussion about error handling after HTTP requests. This is hard + // coded and very specific but for now this is to be seen as a + // special case. What this does is that it *only* allows a defer + // statement with `Close` on the right hand side to be cuddled with + // an if-statement to support this: + // resp, err := client.Do(req) + // if err != nil { + // return err + // } + // defer resp.Body.Close() + if _, ok := previousStatement.(*ast.IfStmt); ok { + if atLeastOneInListsMatch(rightHandSide, []string{"Close"}) { + continue + } + } + + if moreThanOneStatementAbove() { + p.addError(t.Pos(), "only one cuddle assignment allowed before defer statement") + + continue + } + + // Be extra nice with RHS, it's common to use this for locks: + // m.Lock() + // defer m.Unlock() + previousRHS := p.findRHS(previousStatement) + if atLeastOneInListsMatch(rightHandSide, previousRHS) { + continue + } + + if !atLeastOneInListsMatch(rightAndLeftHandSide, assignedOnLineAbove) { + p.addError(t.Pos(), "defer statements should only be cuddled with expressions on same variable") + } + case *ast.ForStmt: + if len(rightAndLeftHandSide) == 0 { + p.addError(t.Pos(), "for statement without condition should never be cuddled") + + continue + } + + if moreThanOneStatementAbove() { + p.addError(t.Pos(), "only one cuddle assignment allowed before for statement") + + continue + } + + // The same rule applies for ranges as for if statements, see + // comments regarding variable usages on the line before or as the + // first line in the block for details. + if !atLeastOneInListsMatch(rightAndLeftHandSide, assignedOnLineAbove) { + if !atLeastOneInListsMatch(assignedOnLineAbove, assignedFirstInBlock) { + p.addError(t.Pos(), "for statements should only be cuddled with assignments used in the iteration") + } + } + case *ast.GoStmt: + if _, ok := previousStatement.(*ast.GoStmt); ok { + continue + } + + if moreThanOneStatementAbove() { + p.addError(t.Pos(), "only one cuddle assignment allowed before go statement") + + continue + } + + if !atLeastOneInListsMatch(rightAndLeftHandSide, assignedOnLineAbove) { + p.addError(t.Pos(), "go statements can only invoke functions assigned on line above") + } + case *ast.SwitchStmt: + if moreThanOneStatementAbove() { + p.addError(t.Pos(), "only one cuddle assignment allowed before switch statement") + + continue + } + + if !atLeastOneInListsMatch(rightAndLeftHandSide, assignedOnLineAbove) { + if len(rightAndLeftHandSide) == 0 { + p.addError(t.Pos(), "anonymous switch statements should never be cuddled") + } else { + p.addError(t.Pos(), "switch statements should only be cuddled with variables switched") + } + } + case *ast.TypeSwitchStmt: + if moreThanOneStatementAbove() { + p.addError(t.Pos(), "only one cuddle assignment allowed before type switch statement") + + continue + } + + // Allowed to type assert on variable assigned on line above. + if !atLeastOneInListsMatch(rightHandSide, assignedOnLineAbove) { + // Allow type assertion on variables used in the first case + // immediately. + if !atLeastOneInListsMatch(assignedOnLineAbove, assignedFirstInBlock) { + p.addError(t.Pos(), "type switch statements should only be cuddled with variables switched") + } + } + case *ast.CaseClause, *ast.CommClause: + // Case clauses will be checked by not allowing leading ot trailing + // whitespaces within the block. There's nothing in the case itself + // that may be cuddled. + default: + p.addWarning("stmt type not implemented", t.Pos(), t) + } + } +} + +// firstBodyStatement returns the first statement inside a body block. This is +// because variables may be cuddled with conditions or statements if it's used +// directly as the first argument inside a body. +// The body will then be parsed as a *ast.BlockStmt (regular block) or as a list +// of []ast.Stmt (case block). +func (p *Processor) firstBodyStatement(i int, allStmt []ast.Stmt) ast.Node { + stmt := allStmt[i] + + // Start by checking if the statement has a body (probably if-statement, + // a range, switch case or similar. Whenever a body is found we start by + // parsing it before moving on in the AST. + statementBody := reflect.Indirect(reflect.ValueOf(stmt)).FieldByName("Body") + + // Some cases allow cuddling depending on the first statement in a body + // of a block or case. If possible extract the first statement. + var firstBodyStatement ast.Node + + if !statementBody.IsValid() { + return firstBodyStatement + } + + switch statementBodyContent := statementBody.Interface().(type) { + case *ast.BlockStmt: + if len(statementBodyContent.List) > 0 { + firstBodyStatement = statementBodyContent.List[0] + + // If the first body statement is a *ast.CaseClause we're + // actually interested in the **next** body to know what's + // inside the first case. + if x, ok := firstBodyStatement.(*ast.CaseClause); ok { + if len(x.Body) > 0 { + firstBodyStatement = x.Body[0] + } + } + } + + p.parseBlockBody(nil, statementBodyContent) + case []ast.Stmt: + // The Body field for an *ast.CaseClause or *ast.CommClause is of type + // []ast.Stmt. We must check leading and trailing whitespaces and then + // pass the statements to parseBlockStatements to parse it's content. + var nextStatement ast.Node + + // Check if there's more statements (potential cases) after the + // current one. + if len(allStmt)-1 > i { + nextStatement = allStmt[i+1] + } + + p.findLeadingAndTrailingWhitespaces(nil, stmt, nextStatement) + p.parseBlockStatements(statementBodyContent) + default: + p.addWarning( + "body statement type not implemented ", + stmt.Pos(), statementBodyContent, + ) + } + + return firstBodyStatement +} + +func (p *Processor) findLHS(node ast.Node) []string { + var lhs []string + + if node == nil { + return lhs + } + + switch t := node.(type) { + case *ast.BasicLit, *ast.FuncLit, *ast.SelectStmt, + *ast.LabeledStmt, *ast.ForStmt, *ast.SwitchStmt, + *ast.ReturnStmt, *ast.GoStmt, *ast.CaseClause, + *ast.CommClause, *ast.CallExpr, *ast.UnaryExpr, + *ast.BranchStmt, *ast.TypeSpec, *ast.ChanType, + *ast.DeferStmt, *ast.TypeAssertExpr, *ast.RangeStmt: + // Nothing to add to LHS + case *ast.IncDecStmt: + return p.findLHS(t.X) + case *ast.Ident: + return []string{t.Name} + case *ast.AssignStmt: + for _, v := range t.Lhs { + lhs = append(lhs, p.findLHS(v)...) + } + case *ast.GenDecl: + for _, v := range t.Specs { + lhs = append(lhs, p.findLHS(v)...) + } + case *ast.ValueSpec: + for _, v := range t.Names { + lhs = append(lhs, p.findLHS(v)...) + } + case *ast.BlockStmt: + for _, v := range t.List { + lhs = append(lhs, p.findLHS(v)...) + } + case *ast.BinaryExpr: + return append( + p.findLHS(t.X), + p.findLHS(t.Y)..., + ) + case *ast.DeclStmt: + return p.findLHS(t.Decl) + case *ast.IfStmt: + return p.findLHS(t.Cond) + case *ast.TypeSwitchStmt: + return p.findLHS(t.Assign) + case *ast.SendStmt: + return p.findLHS(t.Chan) + default: + if x, ok := maybeX(t); ok { + return p.findLHS(x) + } + + p.addWarning("UNKNOWN LHS", t.Pos(), t) + } + + return lhs +} + +func (p *Processor) findRHS(node ast.Node) []string { + var rhs []string + + if node == nil { + return rhs + } + + switch t := node.(type) { + case *ast.BasicLit, *ast.SelectStmt, *ast.ChanType, + *ast.LabeledStmt, *ast.DeclStmt, *ast.BranchStmt, + *ast.TypeSpec, *ast.ArrayType, *ast.CaseClause, + *ast.CommClause, *ast.KeyValueExpr, *ast.MapType, + *ast.FuncLit: + // Nothing to add to RHS + case *ast.Ident: + return []string{t.Name} + case *ast.SelectorExpr: + // TODO: Should this be RHS? + // t.X is needed for defer as of now and t.Sel needed for special + // functions such as Lock() + rhs = p.findRHS(t.X) + rhs = append(rhs, p.findRHS(t.Sel)...) + case *ast.AssignStmt: + for _, v := range t.Rhs { + rhs = append(rhs, p.findRHS(v)...) + } + case *ast.CallExpr: + for _, v := range t.Args { + rhs = append(rhs, p.findRHS(v)...) + } + + rhs = append(rhs, p.findRHS(t.Fun)...) + case *ast.CompositeLit: + for _, v := range t.Elts { + rhs = append(rhs, p.findRHS(v)...) + } + case *ast.IfStmt: + rhs = append(rhs, p.findRHS(t.Cond)...) + rhs = append(rhs, p.findRHS(t.Init)...) + case *ast.BinaryExpr: + return append( + p.findRHS(t.X), + p.findRHS(t.Y)..., + ) + case *ast.TypeSwitchStmt: + return p.findRHS(t.Assign) + case *ast.ReturnStmt: + for _, v := range t.Results { + rhs = append(rhs, p.findRHS(v)...) + } + case *ast.BlockStmt: + for _, v := range t.List { + rhs = append(rhs, p.findRHS(v)...) + } + case *ast.SwitchStmt: + return p.findRHS(t.Tag) + case *ast.GoStmt: + return p.findRHS(t.Call) + case *ast.ForStmt: + return p.findRHS(t.Cond) + case *ast.DeferStmt: + return p.findRHS(t.Call) + case *ast.SendStmt: + return p.findLHS(t.Value) + case *ast.IndexExpr: + rhs = append(rhs, p.findRHS(t.Index)...) + rhs = append(rhs, p.findRHS(t.X)...) + case *ast.SliceExpr: + rhs = append(rhs, p.findRHS(t.X)...) + rhs = append(rhs, p.findRHS(t.Low)...) + rhs = append(rhs, p.findRHS(t.High)...) + default: + if x, ok := maybeX(t); ok { + return p.findRHS(x) + } + + p.addWarning("UNKNOWN RHS", t.Pos(), t) + } + + return rhs +} + +func (p *Processor) findBlockStmt(node ast.Node) []*ast.BlockStmt { + var blocks []*ast.BlockStmt + + switch t := node.(type) { + case *ast.AssignStmt: + for _, x := range t.Rhs { + blocks = append(blocks, p.findBlockStmt(x)...) + } + case *ast.CallExpr: + blocks = append(blocks, p.findBlockStmt(t.Fun)...) + case *ast.FuncLit: + blocks = append(blocks, t.Body) + case *ast.ExprStmt: + blocks = append(blocks, p.findBlockStmt(t.X)...) + case *ast.ReturnStmt: + for _, x := range t.Results { + blocks = append(blocks, p.findBlockStmt(x)...) + } + case *ast.DeferStmt: + blocks = append(blocks, p.findBlockStmt(t.Call)...) + case *ast.GoStmt: + blocks = append(blocks, p.findBlockStmt(t.Call)...) + } + + return blocks +} + +// maybeX extracts the X field from an AST node and returns it with a true value +// if it exists. If the node doesn't have an X field nil and false is returned. +// Known fields with X that are handled: +// IndexExpr, ExprStmt, SelectorExpr, StarExpr, ParentExpr, TypeAssertExpr, +// RangeStmt, UnaryExpr, ParenExpr, SliceExpr, IncDecStmt. +func maybeX(node interface{}) (ast.Node, bool) { + maybeHasX := reflect.Indirect(reflect.ValueOf(node)).FieldByName("X") + if !maybeHasX.IsValid() { + return nil, false + } + + n, ok := maybeHasX.Interface().(ast.Node) + if !ok { + return nil, false + } + + return n, true +} + +func atLeastOneInListsMatch(listOne, listTwo []string) bool { + sliceToMap := func(s []string) map[string]struct{} { + m := map[string]struct{}{} + + for _, v := range s { + m[v] = struct{}{} + } + + return m + } + + m1 := sliceToMap(listOne) + m2 := sliceToMap(listTwo) + + for k1 := range m1 { + if _, ok := m2[k1]; ok { + return true + } + } + + for k2 := range m2 { + if _, ok := m1[k2]; ok { + return true + } + } + + return false +} + +// findLeadingAndTrailingWhitespaces will find leading and trailing whitespaces +// in a node. The method takes comments in consideration which will make the +// parser more gentle. +// nolint: gocognit +func (p *Processor) findLeadingAndTrailingWhitespaces(ident *ast.Ident, stmt, nextStatement ast.Node) { + var ( + allowedLinesBeforeFirstStatement = 1 + commentMap = ast.NewCommentMap(p.fileSet, stmt, p.file.Comments) + blockStatements []ast.Stmt + blockStartLine int + blockEndLine int + blockStartPos token.Pos + blockEndPos token.Pos + ) + + // Depending on the block type, get the statements in the block and where + // the block starts (and ends). + switch t := stmt.(type) { + case *ast.BlockStmt: + blockStatements = t.List + blockStartPos = t.Lbrace + blockEndPos = t.Rbrace + case *ast.CaseClause: + blockStatements = t.Body + blockStartPos = t.Colon + case *ast.CommClause: + blockStatements = t.Body + blockStartPos = t.Colon + default: + p.addWarning("whitespace node type not implemented ", stmt.Pos(), stmt) + + return + } + + // Ignore empty blocks even if they have newlines or just comments. + if len(blockStatements) < 1 { + return + } + + blockStartLine = p.fileSet.Position(blockStartPos).Line + blockEndLine = p.fileSet.Position(blockEndPos).Line + + // No whitespace possible if LBrace and RBrace is on the same line. + if blockStartLine == blockEndLine { + return + } + + var ( + firstStatement = blockStatements[0] + lastStatement = blockStatements[len(blockStatements)-1] + ) + + // Get the comment related to the first statement, we do allow commends in + // the beginning of a block before the first statement. + if c, ok := commentMap[firstStatement]; ok { + for _, commentGroup := range c { + // If the comment group is on the same line as the block start + // (LBrace) we should not consider it. + if p.nodeStart(commentGroup) == blockStartLine { + continue + } + + // We only care about comments before our statement from the comment + // map. As soon as we hit comments after our statement let's break + // out! + if commentGroup.Pos() > firstStatement.Pos() { + break + } + + // Support both /* multiline */ and //single line comments + for _, c := range commentGroup.List { + allowedLinesBeforeFirstStatement += len(strings.Split(c.Text, "\n")) + } + } + } + + if p.nodeStart(firstStatement) != blockStartLine+allowedLinesBeforeFirstStatement { + p.addError( + blockStartPos, + "block should not start with a whitespace", + ) + } + + // If the blockEndLine is not 0 we're a regular block (not case). + if blockEndLine != 0 { + if p.config.AllowTrailingComment { + if lastComment, ok := commentMap[lastStatement]; ok { + var ( + lastCommentGroup = lastComment[len(lastComment)-1] + lastCommentLine = lastCommentGroup.List[len(lastCommentGroup.List)-1] + countNewlines = 0 + ) + + countNewlines += len(strings.Split(lastCommentLine.Text, "\n")) + + // No newlines between trailing comments and end of block. + if p.nodeStart(lastCommentLine)+countNewlines != blockEndLine-1 { + return + } + } + } + + if p.nodeEnd(lastStatement) != blockEndLine-1 && !isExampleFunc(ident) { + p.addError(blockEndPos, "block should not end with a whitespace (or comment)") + } + + return + } + + // If we don't have any nextStatement the trailing whitespace will be + // handled when parsing the switch. If we do have a next statement we can + // see where it starts by getting it's colon position. We set the end of the + // current case to the position of the next case. + switch n := nextStatement.(type) { + case *ast.CaseClause: + blockEndPos = n.Case + case *ast.CommClause: + blockEndPos = n.Case + default: + // No more cases + return + } + + blockEndLine = p.fileSet.Position(blockEndPos).Line - 1 + + var ( + blockSize = blockEndLine - blockStartLine + caseTrailingCommentLines int + ) + + // TODO: I don't know what comments are bound to in cases. For regular + // blocks the last comment is bound to the last statement but for cases + // they are bound to the case clause expression. This will however get us all + // comments and depending on the case expression this gets tricky. + // + // To handle this I get the comment map from the current statement (the case + // itself) and iterate through all groups and all comment within all groups. + // I then get the comments after the last statement but before the next case + // clause and just map each line of comment that way. + for _, commentGroups := range commentMap { + for _, commentGroup := range commentGroups { + for _, comment := range commentGroup.List { + commentLine := p.fileSet.Position(comment.Pos()).Line + + // Ignore comments before the last statement. + if commentLine <= p.nodeStart(lastStatement) { + continue + } + + // Ignore comments after the end of this case. + if commentLine > blockEndLine { + continue + } + + // This allows /* multiline */ comments with newlines as well + // as regular (//) ones + caseTrailingCommentLines += len(strings.Split(comment.Text, "\n")) + } + } + } + + hasTrailingWhitespace := p.nodeEnd(lastStatement)+caseTrailingCommentLines != blockEndLine + + // If the force trailing limit is configured and we don't end with a newline. + if p.config.CaseForceTrailingWhitespaceLimit > 0 && !hasTrailingWhitespace { + // Check if the block size is too big to miss the newline. + if blockSize >= p.config.CaseForceTrailingWhitespaceLimit { + p.addError(lastStatement.Pos(), "case block should end with newline at this size") + } + } +} + +func isExampleFunc(ident *ast.Ident) bool { + return ident != nil && strings.HasPrefix(ident.Name, "Example") +} + +func (p *Processor) nodeStart(node ast.Node) int { + return p.fileSet.Position(node.Pos()).Line +} + +func (p *Processor) nodeEnd(node ast.Node) int { + return p.fileSet.Position(node.End()).Line +} + +// Add an error for the file and line number for the current token.Pos with the +// given reason. +func (p *Processor) addError(pos token.Pos, reason string) { + position := p.fileSet.Position(pos) + + p.result = append(p.result, Result{ + FileName: position.Filename, + LineNumber: position.Line, + Position: position, + Reason: reason, + }) +} + +func (p *Processor) addWarning(w string, pos token.Pos, t interface{}) { + position := p.fileSet.Position(pos) + + p.warnings = append(p.warnings, + fmt.Sprintf("%s:%d: %s (%T)", position.Filename, position.Line, w, t), + ) +} diff --git a/vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/lintutil.go b/vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/lintutil.go deleted file mode 100644 index 333543b1bd3..00000000000 --- a/vendor/github.com/go-critic/go-critic/checkers/internal/lintutil/lintutil.go +++ /dev/null @@ -1,37 +0,0 @@ -package lintutil - -import ( - "go/ast" - "go/types" -) - -// TODO: this package is a way to reuse code between lint and astwalk. -// Would be good to find it a better name. - -// IsTypeExpr reports whether x represents type expression. -// -// Type expression does not evaluate to any run time value, -// but rather describes type that is used inside Go expression. -// For example, (*T)(v) is a CallExpr that "calls" (*T). -// (*T) is a type expression that tells Go compiler type v should be converted to. -func IsTypeExpr(info *types.Info, x ast.Expr) bool { - switch x := x.(type) { - case *ast.StarExpr: - return IsTypeExpr(info, x.X) - case *ast.ParenExpr: - return IsTypeExpr(info, x.X) - case *ast.SelectorExpr: - return IsTypeExpr(info, x.Sel) - case *ast.Ident: - // Identifier may be a type expression if object - // it reffers to is a type name. - _, ok := info.ObjectOf(x).(*types.TypeName) - return ok - - case *ast.FuncType, *ast.StructType, *ast.InterfaceType, *ast.ArrayType, *ast.MapType: - return true - - default: - return false - } -} diff --git a/vendor/github.com/go-critic/go-critic/checkers/mapKey_checker.go b/vendor/github.com/go-critic/go-critic/checkers/mapKey_checker.go new file mode 100644 index 00000000000..de3e781e52a --- /dev/null +++ b/vendor/github.com/go-critic/go-critic/checkers/mapKey_checker.go @@ -0,0 +1,124 @@ +package checkers + +import ( + "go/ast" + "go/types" + "strings" + + "github.com/go-critic/go-critic/checkers/internal/lintutil" + "github.com/go-lintpack/lintpack" + "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-toolsmith/astcast" + "github.com/go-toolsmith/astp" + "github.com/go-toolsmith/typep" +) + +func init() { + var info lintpack.CheckerInfo + info.Name = "mapKey" + info.Tags = []string{"diagnostic", "experimental"} + info.Summary = "Detects suspicious map literal keys" + info.Before = ` +_ = map[string]int{ + "foo": 1, + "bar ": 2, +}` + info.After = ` +_ = map[string]int{ + "foo": 1, + "bar": 2, +}` + + collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + return astwalk.WalkerForExpr(&mapKeyChecker{ctx: ctx}) + }) +} + +type mapKeyChecker struct { + astwalk.WalkHandler + ctx *lintpack.CheckerContext + + astSet lintutil.AstSet +} + +func (c *mapKeyChecker) VisitExpr(expr ast.Expr) { + lit := astcast.ToCompositeLit(expr) + if len(lit.Elts) < 2 { + return + } + + typ, ok := c.ctx.TypesInfo.TypeOf(lit).Underlying().(*types.Map) + if !ok { + return + } + if !typep.HasStringKind(typ.Key().Underlying()) { + return + } + + c.checkWhitespace(lit) + c.checkDuplicates(lit) +} + +func (c *mapKeyChecker) checkDuplicates(lit *ast.CompositeLit) { + c.astSet.Clear() + + for _, elt := range lit.Elts { + kv := astcast.ToKeyValueExpr(elt) + if astp.IsBasicLit(kv.Key) { + // Basic lits are handled by the compiler. + continue + } + if !typep.SideEffectFree(c.ctx.TypesInfo, kv.Key) { + continue + } + if !c.astSet.Insert(kv.Key) { + c.warnDupKey(kv.Key) + } + } +} + +func (c *mapKeyChecker) checkWhitespace(lit *ast.CompositeLit) { + var whitespaceKey ast.Node + for _, elt := range lit.Elts { + key := astcast.ToBasicLit(astcast.ToKeyValueExpr(elt).Key) + if len(key.Value) < len(`" "`) { + continue + } + // s is unquoted string literal value. + s := key.Value[len(`"`) : len(key.Value)-len(`"`)] + if !strings.Contains(s, " ") { + continue + } + if whitespaceKey != nil { + // Already seen something with a whitespace. + // More than one entry => not suspicious. + return + } + if s == " " { + // If space is used as a key, maybe this map + // has something to do with spaces. Give up. + return + } + // Check if it has exactly 1 space prefix or suffix. + bad := strings.HasPrefix(s, " ") && !strings.HasPrefix(s, " ") || + strings.HasSuffix(s, " ") && !strings.HasSuffix(s, " ") + if !bad { + // These spaces can be a padding, + // or a legitimate part of a key. Give up. + return + } + whitespaceKey = key + } + + if whitespaceKey != nil { + c.warnWhitespace(whitespaceKey) + } +} + +func (c *mapKeyChecker) warnWhitespace(key ast.Node) { + c.ctx.Warn(key, "suspucious whitespace in %s key", key) +} + +func (c *mapKeyChecker) warnDupKey(key ast.Node) { + c.ctx.Warn(key, "suspicious duplicate %s key", key) +} diff --git a/vendor/github.com/go-critic/go-critic/checkers/truncateCmp_checker.go b/vendor/github.com/go-critic/go-critic/checkers/truncateCmp_checker.go new file mode 100644 index 00000000000..f4cb9e8662d --- /dev/null +++ b/vendor/github.com/go-critic/go-critic/checkers/truncateCmp_checker.go @@ -0,0 +1,117 @@ +package checkers + +import ( + "go/ast" + "go/token" + "go/types" + + "github.com/go-lintpack/lintpack" + "github.com/go-lintpack/lintpack/astwalk" + "github.com/go-toolsmith/astcast" + "github.com/go-toolsmith/astp" +) + +func init() { + var info lintpack.CheckerInfo + info.Name = "truncateCmp" + info.Tags = []string{"diagnostic", "experimental"} + info.Params = lintpack.CheckerParams{ + "skipArchDependent": { + Value: true, + Usage: "whether to skip int/uint/uintptr types", + }, + } + info.Summary = "Detects potential truncation issues when comparing ints of different sizes" + info.Before = ` +func f(x int32, y int16) bool { + return int16(x) < y +}` + info.After = ` +func f(x int32, int16) bool { + return x < int32(y) +}` + + collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + c := &truncateCmpChecker{ctx: ctx} + c.skipArchDependent = info.Params.Bool("skipArchDependent") + return astwalk.WalkerForExpr(c) + }) +} + +type truncateCmpChecker struct { + astwalk.WalkHandler + ctx *lintpack.CheckerContext + + skipArchDependent bool +} + +func (c *truncateCmpChecker) VisitExpr(expr ast.Expr) { + cmp := astcast.ToBinaryExpr(expr) + switch cmp.Op { + case token.LSS, token.GTR, token.LEQ, token.GEQ, token.EQL, token.NEQ: + if astp.IsBasicLit(cmp.X) || astp.IsBasicLit(cmp.Y) { + return // Don't bother about untyped consts + } + leftCast := c.isTruncCast(cmp.X) + rightCast := c.isTruncCast(cmp.Y) + switch { + case leftCast && rightCast: + return + case leftCast: + c.checkCmp(cmp.X, cmp.Y) + case rightCast: + c.checkCmp(cmp.Y, cmp.X) + } + default: + return + } +} + +func (c *truncateCmpChecker) isTruncCast(x ast.Expr) bool { + switch astcast.ToIdent(astcast.ToCallExpr(x).Fun).Name { + case "int8", "int16", "int32", "uint8", "uint16", "uint32": + return true + default: + return false + } +} + +func (c *truncateCmpChecker) checkCmp(cmpX, cmpY ast.Expr) { + // Check if we have a cast to a type that can truncate. + xcast := astcast.ToCallExpr(cmpX) + if len(xcast.Args) != 1 { + return // Just in case of the shadowed builtin + } + + x := xcast.Args[0] + y := cmpY + + // Check that both x and y are signed or unsigned int-typed. + xtyp, ok := c.ctx.TypesInfo.TypeOf(x).Underlying().(*types.Basic) + if !ok || xtyp.Info()&types.IsInteger == 0 { + return + } + ytyp, ok := c.ctx.TypesInfo.TypeOf(y).Underlying().(*types.Basic) + if !ok || xtyp.Info() != ytyp.Info() { + return + } + + xsize := c.ctx.SizesInfo.Sizeof(xtyp) + ysize := c.ctx.SizesInfo.Sizeof(ytyp) + if xsize <= ysize { + return + } + + if c.skipArchDependent { + switch xtyp.Kind() { + case types.Int, types.Uint, types.Uintptr: + return + } + } + + c.warn(xcast, xsize*8, ysize*8, xtyp.String()) +} + +func (c *truncateCmpChecker) warn(cause ast.Expr, xsize, ysize int64, suggest string) { + c.ctx.Warn(cause, "truncation in comparison %d->%d bit; cast the other operand to %s instead", xsize, ysize, suggest) +} diff --git a/vendor/github.com/go-critic/go-critic/checkers/unlambda_checker.go b/vendor/github.com/go-critic/go-critic/checkers/unlambda_checker.go index 846bb14d254..9e01299bff9 100644 --- a/vendor/github.com/go-critic/go-critic/checkers/unlambda_checker.go +++ b/vendor/github.com/go-critic/go-critic/checkers/unlambda_checker.go @@ -47,6 +47,12 @@ func (c *unlambdaChecker) VisitExpr(x ast.Expr) { if isBuiltin(callable) { return // See #762 } + if id, ok := result.Fun.(*ast.Ident); ok { + obj := c.ctx.TypesInfo.ObjectOf(id) + if _, ok := obj.(*types.Var); ok { + return // See #888 + } + } fnType := c.ctx.TypesInfo.TypeOf(fn) resultType := c.ctx.TypesInfo.TypeOf(result.Fun) if !types.Identical(fnType, resultType) { diff --git a/vendor/github.com/go-critic/go-critic/checkers/whyNoLint_checker.go b/vendor/github.com/go-critic/go-critic/checkers/whyNoLint_checker.go new file mode 100644 index 00000000000..52fefb82c45 --- /dev/null +++ b/vendor/github.com/go-critic/go-critic/checkers/whyNoLint_checker.go @@ -0,0 +1,52 @@ +package checkers + +import ( + "go/ast" + "regexp" + "strings" + + "github.com/go-lintpack/lintpack" + "github.com/go-lintpack/lintpack/astwalk" +) + +func init() { + info := lintpack.CheckerInfo{ + Name: "whyNoLint", + Tags: []string{"style", "experimental"}, + Summary: "Ensures that `//nolint` comments include an explanation", + Before: `//nolint`, + After: `//nolint // reason`, + } + re := regexp.MustCompile(`^// *nolint(?::[^ ]+)? *(.*)$`) + + collection.AddChecker(&info, func(ctx *lintpack.CheckerContext) lintpack.FileWalker { + return astwalk.WalkerForComment(&whyNoLintChecker{ + ctx: ctx, + re: re, + }) + }) +} + +type whyNoLintChecker struct { + astwalk.WalkHandler + + ctx *lintpack.CheckerContext + re *regexp.Regexp +} + +func (c whyNoLintChecker) VisitComment(cg *ast.CommentGroup) { + if strings.HasPrefix(cg.List[0].Text, "/*") { + return + } + for _, comment := range cg.List { + sl := c.re.FindStringSubmatch(comment.Text) + if len(sl) < 2 { + continue + } + + if s := sl[1]; !strings.HasPrefix(s, "//") || len(strings.TrimPrefix(s, "//")) == 0 { + c.ctx.Warn(cg, "include an explanation for nolint directive") + return + } + } +} diff --git a/vendor/github.com/gofrs/flock/.gitignore b/vendor/github.com/gofrs/flock/.gitignore new file mode 100644 index 00000000000..daf913b1b34 --- /dev/null +++ b/vendor/github.com/gofrs/flock/.gitignore @@ -0,0 +1,24 @@ +# Compiled Object files, Static and Dynamic libs (Shared Objects) +*.o +*.a +*.so + +# Folders +_obj +_test + +# Architecture specific extensions/prefixes +*.[568vq] +[568vq].out + +*.cgo1.go +*.cgo2.c +_cgo_defun.c +_cgo_gotypes.go +_cgo_export.* + +_testmain.go + +*.exe +*.test +*.prof diff --git a/vendor/github.com/gofrs/flock/.travis.yml b/vendor/github.com/gofrs/flock/.travis.yml new file mode 100644 index 00000000000..b791a74213c --- /dev/null +++ b/vendor/github.com/gofrs/flock/.travis.yml @@ -0,0 +1,10 @@ +language: go +go: + - 1.10.x + - 1.11.x +script: go test -v -check.vv -race ./... +sudo: false +notifications: + email: + on_success: never + on_failure: always diff --git a/vendor/github.com/gofrs/flock/LICENSE b/vendor/github.com/gofrs/flock/LICENSE new file mode 100644 index 00000000000..aff7d358e24 --- /dev/null +++ b/vendor/github.com/gofrs/flock/LICENSE @@ -0,0 +1,27 @@ +Copyright (c) 2015, Tim Heckman +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 linode-netint 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 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/gofrs/flock/README.md b/vendor/github.com/gofrs/flock/README.md new file mode 100644 index 00000000000..71ce63692e8 --- /dev/null +++ b/vendor/github.com/gofrs/flock/README.md @@ -0,0 +1,41 @@ +# flock +[![TravisCI Build Status](https://img.shields.io/travis/gofrs/flock/master.svg?style=flat)](https://travis-ci.org/gofrs/flock) +[![GoDoc](https://img.shields.io/badge/godoc-flock-blue.svg?style=flat)](https://godoc.org/github.com/gofrs/flock) +[![License](https://img.shields.io/badge/license-BSD_3--Clause-brightgreen.svg?style=flat)](https://github.com/gofrs/flock/blob/master/LICENSE) +[![Go Report Card](https://goreportcard.com/badge/github.com/gofrs/flock)](https://goreportcard.com/report/github.com/gofrs/flock) + +`flock` implements a thread-safe sync.Locker interface for file locking. It also +includes a non-blocking TryLock() function to allow locking without blocking execution. + +## License +`flock` is released under the BSD 3-Clause License. See the `LICENSE` file for more details. + +## Go Compatibility +This package makes use of the `context` package that was introduced in Go 1.7. As such, this +package has an implicit dependency on Go 1.7+. + +## Installation +``` +go get -u github.com/gofrs/flock +``` + +## Usage +```Go +import "github.com/gofrs/flock" + +fileLock := flock.New("/var/lock/go-lock.lock") + +locked, err := fileLock.TryLock() + +if err != nil { + // handle locking error +} + +if locked { + // do work + fileLock.Unlock() +} +``` + +For more detailed usage information take a look at the package API docs on +[GoDoc](https://godoc.org/github.com/gofrs/flock). diff --git a/vendor/github.com/gofrs/flock/appveyor.yml b/vendor/github.com/gofrs/flock/appveyor.yml new file mode 100644 index 00000000000..6848e94bf88 --- /dev/null +++ b/vendor/github.com/gofrs/flock/appveyor.yml @@ -0,0 +1,25 @@ +version: '{build}' + +build: false +deploy: false + +clone_folder: 'c:\gopath\src\github.com\gofrs\flock' + +environment: + GOPATH: 'c:\gopath' + GOVERSION: '1.11' + +init: + - git config --global core.autocrlf input + +install: + - rmdir c:\go /s /q + - appveyor DownloadFile https://storage.googleapis.com/golang/go%GOVERSION%.windows-amd64.msi + - msiexec /i go%GOVERSION%.windows-amd64.msi /q + - set Path=c:\go\bin;c:\gopath\bin;%Path% + - go version + - go env + +test_script: + - go get -t ./... + - go test -race -v ./... diff --git a/vendor/github.com/gofrs/flock/flock.go b/vendor/github.com/gofrs/flock/flock.go new file mode 100644 index 00000000000..8f109b8a967 --- /dev/null +++ b/vendor/github.com/gofrs/flock/flock.go @@ -0,0 +1,127 @@ +// Copyright 2015 Tim Heckman. All rights reserved. +// Use of this source code is governed by the BSD 3-Clause +// license that can be found in the LICENSE file. + +// Package flock implements a thread-safe interface for file locking. +// It also includes a non-blocking TryLock() function to allow locking +// without blocking execution. +// +// Package flock is released under the BSD 3-Clause License. See the LICENSE file +// for more details. +// +// While using this library, remember that the locking behaviors are not +// guaranteed to be the same on each platform. For example, some UNIX-like +// operating systems will transparently convert a shared lock to an exclusive +// lock. If you Unlock() the flock from a location where you believe that you +// have the shared lock, you may accidentally drop the exclusive lock. +package flock + +import ( + "context" + "os" + "sync" + "time" +) + +// Flock is the struct type to handle file locking. All fields are unexported, +// with access to some of the fields provided by getter methods (Path() and Locked()). +type Flock struct { + path string + m sync.RWMutex + fh *os.File + l bool + r bool +} + +// New returns a new instance of *Flock. The only parameter +// it takes is the path to the desired lockfile. +func New(path string) *Flock { + return &Flock{path: path} +} + +// NewFlock returns a new instance of *Flock. The only parameter +// it takes is the path to the desired lockfile. +// +// Deprecated: Use New instead. +func NewFlock(path string) *Flock { + return New(path) +} + +// Close is equivalent to calling Unlock. +// +// This will release the lock and close the underlying file descriptor. +// It will not remove the file from disk, that's up to your application. +func (f *Flock) Close() error { + return f.Unlock() +} + +// Path returns the path as provided in NewFlock(). +func (f *Flock) Path() string { + return f.path +} + +// Locked returns the lock state (locked: true, unlocked: false). +// +// Warning: by the time you use the returned value, the state may have changed. +func (f *Flock) Locked() bool { + f.m.RLock() + defer f.m.RUnlock() + return f.l +} + +// RLocked returns the read lock state (locked: true, unlocked: false). +// +// Warning: by the time you use the returned value, the state may have changed. +func (f *Flock) RLocked() bool { + f.m.RLock() + defer f.m.RUnlock() + return f.r +} + +func (f *Flock) String() string { + return f.path +} + +// TryLockContext repeatedly tries to take an exclusive lock until one of the +// conditions is met: TryLock succeeds, TryLock fails with error, or Context +// Done channel is closed. +func (f *Flock) TryLockContext(ctx context.Context, retryDelay time.Duration) (bool, error) { + return tryCtx(ctx, f.TryLock, retryDelay) +} + +// TryRLockContext repeatedly tries to take a shared lock until one of the +// conditions is met: TryRLock succeeds, TryRLock fails with error, or Context +// Done channel is closed. +func (f *Flock) TryRLockContext(ctx context.Context, retryDelay time.Duration) (bool, error) { + return tryCtx(ctx, f.TryRLock, retryDelay) +} + +func tryCtx(ctx context.Context, fn func() (bool, error), retryDelay time.Duration) (bool, error) { + if ctx.Err() != nil { + return false, ctx.Err() + } + for { + if ok, err := fn(); ok || err != nil { + return ok, err + } + select { + case <-ctx.Done(): + return false, ctx.Err() + case <-time.After(retryDelay): + // try again + } + } +} + +func (f *Flock) setFh() error { + // open a new os.File instance + // create it if it doesn't exist, and open the file read-only. + fh, err := os.OpenFile(f.path, os.O_CREATE|os.O_RDONLY, os.FileMode(0600)) + if err != nil { + return err + } + + // set the filehandle on the struct + f.fh = fh + return nil +} diff --git a/vendor/github.com/gofrs/flock/flock_unix.go b/vendor/github.com/gofrs/flock/flock_unix.go new file mode 100644 index 00000000000..45f71a707c3 --- /dev/null +++ b/vendor/github.com/gofrs/flock/flock_unix.go @@ -0,0 +1,195 @@ +// Copyright 2015 Tim Heckman. All rights reserved. +// Use of this source code is governed by the BSD 3-Clause +// license that can be found in the LICENSE file. + +// +build !windows + +package flock + +import ( + "os" + "syscall" +) + +// Lock is a blocking call to try and take an exclusive file lock. It will wait +// until it is able to obtain the exclusive file lock. It's recommended that +// TryLock() be used over this function. This function may block the ability to +// query the current Locked() or RLocked() status due to a RW-mutex lock. +// +// If we are already exclusive-locked, this function short-circuits and returns +// immediately assuming it can take the mutex lock. +// +// If the *Flock has a shared lock (RLock), this may transparently replace the +// shared lock with an exclusive lock on some UNIX-like operating systems. Be +// careful when using exclusive locks in conjunction with shared locks +// (RLock()), because calling Unlock() may accidentally release the exclusive +// lock that was once a shared lock. +func (f *Flock) Lock() error { + return f.lock(&f.l, syscall.LOCK_EX) +} + +// RLock is a blocking call to try and take a shared file lock. It will wait +// until it is able to obtain the shared file lock. It's recommended that +// TryRLock() be used over this function. This function may block the ability to +// query the current Locked() or RLocked() status due to a RW-mutex lock. +// +// If we are already shared-locked, this function short-circuits and returns +// immediately assuming it can take the mutex lock. +func (f *Flock) RLock() error { + return f.lock(&f.r, syscall.LOCK_SH) +} + +func (f *Flock) lock(locked *bool, flag int) error { + f.m.Lock() + defer f.m.Unlock() + + if *locked { + return nil + } + + if f.fh == nil { + if err := f.setFh(); err != nil { + return err + } + } + + if err := syscall.Flock(int(f.fh.Fd()), flag); err != nil { + shouldRetry, reopenErr := f.reopenFDOnError(err) + if reopenErr != nil { + return reopenErr + } + + if !shouldRetry { + return err + } + + if err = syscall.Flock(int(f.fh.Fd()), flag); err != nil { + return err + } + } + + *locked = true + return nil +} + +// Unlock is a function to unlock the file. This file takes a RW-mutex lock, so +// while it is running the Locked() and RLocked() functions will be blocked. +// +// This function short-circuits if we are unlocked already. If not, it calls +// syscall.LOCK_UN on the file and closes the file descriptor. It does not +// remove the file from disk. It's up to your application to do. +// +// Please note, if your shared lock became an exclusive lock this may +// unintentionally drop the exclusive lock if called by the consumer that +// believes they have a shared lock. Please see Lock() for more details. +func (f *Flock) Unlock() error { + f.m.Lock() + defer f.m.Unlock() + + // if we aren't locked or if the lockfile instance is nil + // just return a nil error because we are unlocked + if (!f.l && !f.r) || f.fh == nil { + return nil + } + + // mark the file as unlocked + if err := syscall.Flock(int(f.fh.Fd()), syscall.LOCK_UN); err != nil { + return err + } + + f.fh.Close() + + f.l = false + f.r = false + f.fh = nil + + return nil +} + +// TryLock is the preferred function for taking an exclusive file lock. This +// function takes an RW-mutex lock before it tries to lock the file, so there is +// the possibility that this function may block for a short time if another +// goroutine is trying to take any action. +// +// The actual file lock is non-blocking. If we are unable to get the exclusive +// file lock, the function will return false instead of waiting for the lock. If +// we get the lock, we also set the *Flock instance as being exclusive-locked. +func (f *Flock) TryLock() (bool, error) { + return f.try(&f.l, syscall.LOCK_EX) +} + +// TryRLock is the preferred function for taking a shared file lock. This +// function takes an RW-mutex lock before it tries to lock the file, so there is +// the possibility that this function may block for a short time if another +// goroutine is trying to take any action. +// +// The actual file lock is non-blocking. If we are unable to get the shared file +// lock, the function will return false instead of waiting for the lock. If we +// get the lock, we also set the *Flock instance as being share-locked. +func (f *Flock) TryRLock() (bool, error) { + return f.try(&f.r, syscall.LOCK_SH) +} + +func (f *Flock) try(locked *bool, flag int) (bool, error) { + f.m.Lock() + defer f.m.Unlock() + + if *locked { + return true, nil + } + + if f.fh == nil { + if err := f.setFh(); err != nil { + return false, err + } + } + + var retried bool +retry: + err := syscall.Flock(int(f.fh.Fd()), flag|syscall.LOCK_NB) + + switch err { + case syscall.EWOULDBLOCK: + return false, nil + case nil: + *locked = true + return true, nil + } + if !retried { + if shouldRetry, reopenErr := f.reopenFDOnError(err); reopenErr != nil { + return false, reopenErr + } else if shouldRetry { + retried = true + goto retry + } + } + + return false, err +} + +// reopenFDOnError determines whether we should reopen the file handle +// in readwrite mode and try again. This comes from util-linux/sys-utils/flock.c: +// Since Linux 3.4 (commit 55725513) +// Probably NFSv4 where flock() is emulated by fcntl(). +func (f *Flock) reopenFDOnError(err error) (bool, error) { + if err != syscall.EIO && err != syscall.EBADF { + return false, nil + } + if st, err := f.fh.Stat(); err == nil { + // if the file is able to be read and written + if st.Mode()&0600 == 0600 { + f.fh.Close() + f.fh = nil + + // reopen in read-write mode and set the filehandle + fh, err := os.OpenFile(f.path, os.O_CREATE|os.O_RDWR, os.FileMode(0600)) + if err != nil { + return false, err + } + f.fh = fh + return true, nil + } + } + + return false, nil +} diff --git a/vendor/github.com/gofrs/flock/flock_winapi.go b/vendor/github.com/gofrs/flock/flock_winapi.go new file mode 100644 index 00000000000..fe405a255ae --- /dev/null +++ b/vendor/github.com/gofrs/flock/flock_winapi.go @@ -0,0 +1,76 @@ +// Copyright 2015 Tim Heckman. All rights reserved. +// Use of this source code is governed by the BSD 3-Clause +// license that can be found in the LICENSE file. + +// +build windows + +package flock + +import ( + "syscall" + "unsafe" +) + +var ( + kernel32, _ = syscall.LoadLibrary("kernel32.dll") + procLockFileEx, _ = syscall.GetProcAddress(kernel32, "LockFileEx") + procUnlockFileEx, _ = syscall.GetProcAddress(kernel32, "UnlockFileEx") +) + +const ( + winLockfileFailImmediately = 0x00000001 + winLockfileExclusiveLock = 0x00000002 + winLockfileSharedLock = 0x00000000 +) + +// Use of 0x00000000 for the shared lock is a guess based on some the MS Windows +// `LockFileEX` docs, which document the `LOCKFILE_EXCLUSIVE_LOCK` flag as: +// +// > The function requests an exclusive lock. Otherwise, it requests a shared +// > lock. +// +// https://msdn.microsoft.com/en-us/library/windows/desktop/aa365203(v=vs.85).aspx + +func lockFileEx(handle syscall.Handle, flags uint32, reserved uint32, numberOfBytesToLockLow uint32, numberOfBytesToLockHigh uint32, offset *syscall.Overlapped) (bool, syscall.Errno) { + r1, _, errNo := syscall.Syscall6( + uintptr(procLockFileEx), + 6, + uintptr(handle), + uintptr(flags), + uintptr(reserved), + uintptr(numberOfBytesToLockLow), + uintptr(numberOfBytesToLockHigh), + uintptr(unsafe.Pointer(offset))) + + if r1 != 1 { + if errNo == 0 { + return false, syscall.EINVAL + } + + return false, errNo + } + + return true, 0 +} + +func unlockFileEx(handle syscall.Handle, reserved uint32, numberOfBytesToLockLow uint32, numberOfBytesToLockHigh uint32, offset *syscall.Overlapped) (bool, syscall.Errno) { + r1, _, errNo := syscall.Syscall6( + uintptr(procUnlockFileEx), + 5, + uintptr(handle), + uintptr(reserved), + uintptr(numberOfBytesToLockLow), + uintptr(numberOfBytesToLockHigh), + uintptr(unsafe.Pointer(offset)), + 0) + + if r1 != 1 { + if errNo == 0 { + return false, syscall.EINVAL + } + + return false, errNo + } + + return true, 0 +} diff --git a/vendor/github.com/gofrs/flock/flock_windows.go b/vendor/github.com/gofrs/flock/flock_windows.go new file mode 100644 index 00000000000..9f4a5f10d24 --- /dev/null +++ b/vendor/github.com/gofrs/flock/flock_windows.go @@ -0,0 +1,140 @@ +// Copyright 2015 Tim Heckman. All rights reserved. +// Use of this source code is governed by the BSD 3-Clause +// license that can be found in the LICENSE file. + +package flock + +import ( + "syscall" +) + +// ErrorLockViolation is the error code returned from the Windows syscall when a +// lock would block and you ask to fail immediately. +const ErrorLockViolation syscall.Errno = 0x21 // 33 + +// Lock is a blocking call to try and take an exclusive file lock. It will wait +// until it is able to obtain the exclusive file lock. It's recommended that +// TryLock() be used over this function. This function may block the ability to +// query the current Locked() or RLocked() status due to a RW-mutex lock. +// +// If we are already locked, this function short-circuits and returns +// immediately assuming it can take the mutex lock. +func (f *Flock) Lock() error { + return f.lock(&f.l, winLockfileExclusiveLock) +} + +// RLock is a blocking call to try and take a shared file lock. It will wait +// until it is able to obtain the shared file lock. It's recommended that +// TryRLock() be used over this function. This function may block the ability to +// query the current Locked() or RLocked() status due to a RW-mutex lock. +// +// If we are already locked, this function short-circuits and returns +// immediately assuming it can take the mutex lock. +func (f *Flock) RLock() error { + return f.lock(&f.r, winLockfileSharedLock) +} + +func (f *Flock) lock(locked *bool, flag uint32) error { + f.m.Lock() + defer f.m.Unlock() + + if *locked { + return nil + } + + if f.fh == nil { + if err := f.setFh(); err != nil { + return err + } + } + + if _, errNo := lockFileEx(syscall.Handle(f.fh.Fd()), flag, 0, 1, 0, &syscall.Overlapped{}); errNo > 0 { + return errNo + } + + *locked = true + return nil +} + +// Unlock is a function to unlock the file. This file takes a RW-mutex lock, so +// while it is running the Locked() and RLocked() functions will be blocked. +// +// This function short-circuits if we are unlocked already. If not, it calls +// UnlockFileEx() on the file and closes the file descriptor. It does not remove +// the file from disk. It's up to your application to do. +func (f *Flock) Unlock() error { + f.m.Lock() + defer f.m.Unlock() + + // if we aren't locked or if the lockfile instance is nil + // just return a nil error because we are unlocked + if (!f.l && !f.r) || f.fh == nil { + return nil + } + + // mark the file as unlocked + if _, errNo := unlockFileEx(syscall.Handle(f.fh.Fd()), 0, 1, 0, &syscall.Overlapped{}); errNo > 0 { + return errNo + } + + f.fh.Close() + + f.l = false + f.r = false + f.fh = nil + + return nil +} + +// TryLock is the preferred function for taking an exclusive file lock. This +// function does take a RW-mutex lock before it tries to lock the file, so there +// is the possibility that this function may block for a short time if another +// goroutine is trying to take any action. +// +// The actual file lock is non-blocking. If we are unable to get the exclusive +// file lock, the function will return false instead of waiting for the lock. If +// we get the lock, we also set the *Flock instance as being exclusive-locked. +func (f *Flock) TryLock() (bool, error) { + return f.try(&f.l, winLockfileExclusiveLock) +} + +// TryRLock is the preferred function for taking a shared file lock. This +// function does take a RW-mutex lock before it tries to lock the file, so there +// is the possibility that this function may block for a short time if another +// goroutine is trying to take any action. +// +// The actual file lock is non-blocking. If we are unable to get the shared file +// lock, the function will return false instead of waiting for the lock. If we +// get the lock, we also set the *Flock instance as being shared-locked. +func (f *Flock) TryRLock() (bool, error) { + return f.try(&f.r, winLockfileSharedLock) +} + +func (f *Flock) try(locked *bool, flag uint32) (bool, error) { + f.m.Lock() + defer f.m.Unlock() + + if *locked { + return true, nil + } + + if f.fh == nil { + if err := f.setFh(); err != nil { + return false, err + } + } + + _, errNo := lockFileEx(syscall.Handle(f.fh.Fd()), flag|winLockfileFailImmediately, 0, 1, 0, &syscall.Overlapped{}) + + if errNo > 0 { + if errNo == ErrorLockViolation || errNo == syscall.ERROR_IO_PENDING { + return false, nil + } + + return false, errNo + } + + *locked = true + + return true, nil +} diff --git a/vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go b/vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go deleted file mode 100644 index ceadde6a5e1..00000000000 --- a/vendor/github.com/gogo/protobuf/sortkeys/sortkeys.go +++ /dev/null @@ -1,101 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/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. -// -// 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 sortkeys - -import ( - "sort" -) - -func Strings(l []string) { - sort.Strings(l) -} - -func Float64s(l []float64) { - sort.Float64s(l) -} - -func Float32s(l []float32) { - sort.Sort(Float32Slice(l)) -} - -func Int64s(l []int64) { - sort.Sort(Int64Slice(l)) -} - -func Int32s(l []int32) { - sort.Sort(Int32Slice(l)) -} - -func Uint64s(l []uint64) { - sort.Sort(Uint64Slice(l)) -} - -func Uint32s(l []uint32) { - sort.Sort(Uint32Slice(l)) -} - -func Bools(l []bool) { - sort.Sort(BoolSlice(l)) -} - -type BoolSlice []bool - -func (p BoolSlice) Len() int { return len(p) } -func (p BoolSlice) Less(i, j int) bool { return p[j] } -func (p BoolSlice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -type Int64Slice []int64 - -func (p Int64Slice) Len() int { return len(p) } -func (p Int64Slice) Less(i, j int) bool { return p[i] < p[j] } -func (p Int64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -type Int32Slice []int32 - -func (p Int32Slice) Len() int { return len(p) } -func (p Int32Slice) Less(i, j int) bool { return p[i] < p[j] } -func (p Int32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -type Uint64Slice []uint64 - -func (p Uint64Slice) Len() int { return len(p) } -func (p Uint64Slice) Less(i, j int) bool { return p[i] < p[j] } -func (p Uint64Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -type Uint32Slice []uint32 - -func (p Uint32Slice) Len() int { return len(p) } -func (p Uint32Slice) Less(i, j int) bool { return p[i] < p[j] } -func (p Uint32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } - -type Float32Slice []float32 - -func (p Float32Slice) Len() int { return len(p) } -func (p Float32Slice) Less(i, j int) bool { return p[i] < p[j] } -func (p Float32Slice) Swap(i, j int) { p[i], p[j] = p[j], p[i] } diff --git a/vendor/github.com/golangci/gofmt/gofmt/gofmt.go b/vendor/github.com/golangci/gofmt/gofmt/gofmt.go index a6b09fcd7e3..fb9c8cb37f6 100644 --- a/vendor/github.com/golangci/gofmt/gofmt/gofmt.go +++ b/vendor/github.com/golangci/gofmt/gofmt/gofmt.go @@ -21,6 +21,7 @@ import ( "runtime" "runtime/pprof" "strings" + "sync" ) var ( @@ -42,10 +43,11 @@ const ( ) var ( - fileSet = token.NewFileSet() // per process FileSet - exitCode = 0 - rewrite func(*ast.File) *ast.File - parserMode parser.Mode + fileSet = token.NewFileSet() // per process FileSet + exitCode = 0 + rewrite func(*ast.File) *ast.File + parserMode parser.Mode + parserModeInitOnce sync.Once ) func report(err error) { @@ -59,10 +61,12 @@ func usage() { } func initParserMode() { - parserMode = parser.ParseComments - if *allErrors { - parserMode |= parser.AllErrors - } + parserModeInitOnce.Do(func() { + parserMode = parser.ParseComments + if *allErrors { + parserMode |= parser.AllErrors + } + }) } func isGoFile(f os.FileInfo) bool { diff --git a/vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/main.go b/vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/main.go index 079fc85d556..282d794b820 100644 --- a/vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/main.go +++ b/vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/main.go @@ -5,6 +5,7 @@ import ( "os" "github.com/golangci/golangci-lint/pkg/commands" + "github.com/golangci/golangci-lint/pkg/exitcodes" ) var ( @@ -19,6 +20,6 @@ func main() { if err := e.Execute(); err != nil { fmt.Fprintf(os.Stderr, "failed executing command with error %v\n", err) - os.Exit(1) + os.Exit(exitcodes.Failure) } } diff --git a/vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/mod_version.go b/vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/mod_version.go index 0311853d27a..7b596728e16 100644 --- a/vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/mod_version.go +++ b/vendor/github.com/golangci/golangci-lint/cmd/golangci-lint/mod_version.go @@ -10,7 +10,7 @@ import ( //nolint:gochecknoinits func init() { if info, available := debug.ReadBuildInfo(); available { - if date == "" && info.Main.Version != "(devel)" { + if date == "" { version = info.Main.Version commit = fmt.Sprintf("(unknown, mod sum: %q)", info.Main.Sum) date = "(unknown)" diff --git a/vendor/github.com/golangci/golangci-lint/internal/cache/cache.go b/vendor/github.com/golangci/golangci-lint/internal/cache/cache.go index 2157c9f27c1..9ac140c50ea 100644 --- a/vendor/github.com/golangci/golangci-lint/internal/cache/cache.go +++ b/vendor/github.com/golangci/golangci-lint/internal/cache/cache.go @@ -12,7 +12,6 @@ import ( "bytes" "crypto/sha256" "encoding/hex" - "errors" "fmt" "io" "io/ioutil" @@ -22,6 +21,8 @@ import ( "strings" "time" + "github.com/pkg/errors" + "github.com/golangci/golangci-lint/internal/renameio" ) @@ -61,7 +62,7 @@ func Open(dir string) (*Cache, error) { } for i := 0; i < 256; i++ { name := filepath.Join(dir, fmt.Sprintf("%02x", i)) - if err := os.MkdirAll(name, 0777); err != nil { + if err := os.MkdirAll(name, 0744); err != nil { return nil, err } } @@ -144,29 +145,35 @@ func (c *Cache) get(id ActionID) (Entry, error) { missing := func() (Entry, error) { return Entry{}, errMissing } - f, err := os.Open(c.fileName(id, "a")) + failed := func(err error) (Entry, error) { + return Entry{}, err + } + fileName := c.fileName(id, "a") + f, err := os.Open(fileName) if err != nil { - return missing() + if os.IsNotExist(err) { + return missing() + } + return failed(err) } defer f.Close() entry := make([]byte, entrySize+1) // +1 to detect whether f is too long - if n, err := io.ReadFull(f, entry); n != entrySize || err != io.ErrUnexpectedEOF { - return missing() + if n, readErr := io.ReadFull(f, entry); n != entrySize || readErr != io.ErrUnexpectedEOF { + return failed(fmt.Errorf("read %d/%d bytes from %s with error %s", n, entrySize, fileName, readErr)) } if entry[0] != 'v' || entry[1] != '1' || entry[2] != ' ' || entry[3+hexSize] != ' ' || entry[3+hexSize+1+hexSize] != ' ' || entry[3+hexSize+1+hexSize+1+20] != ' ' || entry[entrySize-1] != '\n' { - return missing() + return failed(fmt.Errorf("bad data in %s", fileName)) } eid, entry := entry[3:3+hexSize], entry[3+hexSize:] eout, entry := entry[1:1+hexSize], entry[1+hexSize:] esize, entry := entry[1:1+20], entry[1+20:] - //lint:ignore SA4006 See https://github.com/dominikh/go-tools/issues/465 - etime, entry := entry[1:1+20], entry[1+20:] //nolint:staticcheck + etime := entry[1 : 1+20] var buf [HashSize]byte - if _, err := hex.Decode(buf[:], eid); err != nil || buf != id { - return missing() + if _, err = hex.Decode(buf[:], eid); err != nil || buf != id { + return failed(errors.Wrapf(err, "failed to hex decode eid data in %s", fileName)) } - if _, err := hex.Decode(buf[:], eout); err != nil { - return missing() + if _, err = hex.Decode(buf[:], eout); err != nil { + return failed(errors.Wrapf(err, "failed to hex decode eout data in %s", fileName)) } i := 0 for i < len(esize) && esize[i] == ' ' { @@ -174,7 +181,7 @@ func (c *Cache) get(id ActionID) (Entry, error) { } size, err := strconv.ParseInt(string(esize[i:]), 10, 64) if err != nil || size < 0 { - return missing() + return failed(fmt.Errorf("failed to parse esize int from %s with error %s", fileName, err)) } i = 0 for i < len(etime) && etime[i] == ' ' { @@ -182,10 +189,12 @@ func (c *Cache) get(id ActionID) (Entry, error) { } tm, err := strconv.ParseInt(string(etime[i:]), 10, 64) if err != nil || tm < 0 { - return missing() + return failed(fmt.Errorf("failed to parse etime int from %s with error %s", fileName, err)) } - c.used(c.fileName(id, "a")) + if err = c.used(fileName); err != nil { + return failed(errors.Wrapf(err, "failed to mark %s as used", fileName)) + } return Entry{buf, size, time.Unix(0, tm)}, nil } @@ -197,7 +206,12 @@ func (c *Cache) GetFile(id ActionID) (file string, entry Entry, err error) { if err != nil { return "", Entry{}, err } - file = c.OutputFile(entry.OutputID) + + file, err = c.OutputFile(entry.OutputID) + if err != nil { + return "", Entry{}, err + } + info, err := os.Stat(file) if err != nil || info.Size() != entry.Size { return "", Entry{}, errMissing @@ -213,7 +227,16 @@ func (c *Cache) GetBytes(id ActionID) ([]byte, Entry, error) { if err != nil { return nil, entry, err } - data, _ := ioutil.ReadFile(c.OutputFile(entry.OutputID)) + outputFile, err := c.OutputFile(entry.OutputID) + if err != nil { + return nil, entry, err + } + + data, err := ioutil.ReadFile(outputFile) + if err != nil { + return nil, entry, err + } + if sha256.Sum256(data) != entry.OutputID { return nil, entry, errMissing } @@ -221,10 +244,12 @@ func (c *Cache) GetBytes(id ActionID) ([]byte, Entry, error) { } // OutputFile returns the name of the cache file storing output with the given OutputID. -func (c *Cache) OutputFile(out OutputID) string { +func (c *Cache) OutputFile(out OutputID) (string, error) { file := c.fileName(out, "d") - c.used(file) - return file + if err := c.used(file); err != nil { + return "", err + } + return file, nil } // Time constants for cache expiration. @@ -254,12 +279,21 @@ const ( // mtime is more than an hour old. This heuristic eliminates // nearly all of the mtime updates that would otherwise happen, // while still keeping the mtimes useful for cache trimming. -func (c *Cache) used(file string) { +func (c *Cache) used(file string) error { info, err := os.Stat(file) - if err == nil && c.now().Sub(info.ModTime()) < mtimeInterval { - return + if err != nil { + return errors.Wrapf(err, "failed to stat file %s", file) } - os.Chtimes(file, c.now(), c.now()) + + if c.now().Sub(info.ModTime()) < mtimeInterval { + return nil + } + + if err := os.Chtimes(file, c.now(), c.now()); err != nil { + return errors.Wrapf(err, "failed to change time of file %s", file) + } + + return nil } // Trim removes old cache entries that are likely not to be reused. @@ -286,7 +320,7 @@ func (c *Cache) Trim() { // Ignore errors from here: if we don't write the complete timestamp, the // cache will appear older than it is, and we'll trim it again next time. - renameio.WriteFile(filepath.Join(c.dir, "trim.txt"), []byte(fmt.Sprintf("%d", now.Unix())), 0666) + _ = renameio.WriteFile(filepath.Join(c.dir, "trim.txt"), []byte(fmt.Sprintf("%d", now.Unix())), 0666) } // trimSubdir trims a single cache subdirectory. @@ -368,7 +402,9 @@ func (c *Cache) putIndexEntry(id ActionID, out OutputID, size int64, allowVerify os.Remove(file) return err } - os.Chtimes(file, c.now(), c.now()) // mainly for tests + if err = os.Chtimes(file, c.now(), c.now()); err != nil { // mainly for tests + return errors.Wrapf(err, "failed to change time of file %s", file) + } return nil } @@ -422,9 +458,12 @@ func (c *Cache) copyFile(file io.ReadSeeker, out OutputID, size int64) error { info, err := os.Stat(name) if err == nil && info.Size() == size { // Check hash. - if f, err := os.Open(name); err == nil { + if f, openErr := os.Open(name); openErr == nil { h := sha256.New() - io.Copy(h, f) + if _, copyErr := io.Copy(h, f); copyErr != nil { + return errors.Wrap(copyErr, "failed to copy to sha256") + } + f.Close() var out2 OutputID h.Sum(out2[:0]) @@ -457,44 +496,49 @@ func (c *Cache) copyFile(file io.ReadSeeker, out OutputID, size int64) error { // before returning, to avoid leaving bad bytes in the file. // Copy file to f, but also into h to double-check hash. - if _, err := file.Seek(0, 0); err != nil { - f.Truncate(0) + if _, err = file.Seek(0, 0); err != nil { + _ = f.Truncate(0) return err } h := sha256.New() w := io.MultiWriter(f, h) - if _, err := io.CopyN(w, file, size-1); err != nil { - f.Truncate(0) + if _, err = io.CopyN(w, file, size-1); err != nil { + _ = f.Truncate(0) return err } // Check last byte before writing it; writing it will make the size match // what other processes expect to find and might cause them to start // using the file. buf := make([]byte, 1) - if _, err := file.Read(buf); err != nil { - f.Truncate(0) + if _, err = file.Read(buf); err != nil { + _ = f.Truncate(0) return err } - h.Write(buf) + if n, wErr := h.Write(buf); n != len(buf) { + return fmt.Errorf("wrote to hash %d/%d bytes with error %s", n, len(buf), wErr) + } + sum := h.Sum(nil) if !bytes.Equal(sum, out[:]) { - f.Truncate(0) + _ = f.Truncate(0) return fmt.Errorf("file content changed underfoot") } // Commit cache file entry. - if _, err := f.Write(buf); err != nil { - f.Truncate(0) + if _, err = f.Write(buf); err != nil { + _ = f.Truncate(0) return err } - if err := f.Close(); err != nil { + if err = f.Close(); err != nil { // Data might not have been written, // but file may look like it is the right size. // To be extra careful, remove cached file. os.Remove(name) return err } - os.Chtimes(name, c.now(), c.now()) // mainly for tests + if err = os.Chtimes(name, c.now(), c.now()); err != nil { // mainly for tests + return errors.Wrapf(err, "failed to change time of file %s", name) + } return nil } diff --git a/vendor/github.com/golangci/golangci-lint/internal/cache/default.go b/vendor/github.com/golangci/golangci-lint/internal/cache/default.go index 6b7d8b4f74b..e8866cb30cc 100644 --- a/vendor/github.com/golangci/golangci-lint/internal/cache/default.go +++ b/vendor/github.com/golangci/golangci-lint/internal/cache/default.go @@ -34,12 +34,14 @@ const cacheREADME = `This directory holds cached build artifacts from golangci-l // the first time Default is called. func initDefaultCache() { dir := DefaultDir() - if err := os.MkdirAll(dir, 0777); err != nil { + if err := os.MkdirAll(dir, 0744); err != nil { log.Fatalf("failed to initialize build cache at %s: %s\n", dir, err) } if _, err := os.Stat(filepath.Join(dir, "README")); err != nil { // Best effort. - ioutil.WriteFile(filepath.Join(dir, "README"), []byte(cacheREADME), 0666) + if wErr := ioutil.WriteFile(filepath.Join(dir, "README"), []byte(cacheREADME), 0666); wErr != nil { + log.Fatalf("Failed to write README file to cache dir %s: %s", dir, err) + } } c, err := Open(dir) diff --git a/vendor/github.com/golangci/golangci-lint/internal/cache/hash.go b/vendor/github.com/golangci/golangci-lint/internal/cache/hash.go index a42f149c712..4ce79e325b2 100644 --- a/vendor/github.com/golangci/golangci-lint/internal/cache/hash.go +++ b/vendor/github.com/golangci/golangci-lint/internal/cache/hash.go @@ -42,11 +42,19 @@ func SetSalt(b []byte) { // Subkey returns an action ID corresponding to mixing a parent // action ID with a string description of the subkey. -func Subkey(parent ActionID, desc string) ActionID { +func Subkey(parent ActionID, desc string) (ActionID, error) { h := sha256.New() - h.Write([]byte("subkey:")) - h.Write(parent[:]) - h.Write([]byte(desc)) + const subkeyPrefix = "subkey:" + if n, err := h.Write([]byte(subkeyPrefix)); n != len(subkeyPrefix) { + return ActionID{}, fmt.Errorf("wrote %d/%d bytes of subkey prefix with error %s", n, len(subkeyPrefix), err) + } + if n, err := h.Write(parent[:]); n != len(parent) { + return ActionID{}, fmt.Errorf("wrote %d/%d bytes of parent with error %s", n, len(parent), err) + } + if n, err := h.Write([]byte(desc)); n != len(desc) { + return ActionID{}, fmt.Errorf("wrote %d/%d bytes of desc with error %s", n, len(desc), err) + } + var out ActionID h.Sum(out[:0]) if debugHash { @@ -57,21 +65,23 @@ func Subkey(parent ActionID, desc string) ActionID { hashDebug.m[out] = fmt.Sprintf("subkey %x %q", parent, desc) hashDebug.Unlock() } - return out + return out, nil } // NewHash returns a new Hash. // The caller is expected to Write data to it and then call Sum. -func NewHash(name string) *Hash { +func NewHash(name string) (*Hash, error) { h := &Hash{h: sha256.New(), name: name} if debugHash { fmt.Fprintf(os.Stderr, "HASH[%s]\n", h.name) } - h.Write(hashSalt) + if n, err := h.Write(hashSalt); n != len(hashSalt) { + return nil, fmt.Errorf("wrote %d/%d bytes of hash salt with error %s", n, len(hashSalt), err) + } if verify { h.buf = new(bytes.Buffer) } - return h + return h, nil } // Write writes data to the running hash. diff --git a/vendor/github.com/golangci/golangci-lint/internal/errorutil/errors.go b/vendor/github.com/golangci/golangci-lint/internal/errorutil/errors.go index 693620e93dd..5cb86d66988 100644 --- a/vendor/github.com/golangci/golangci-lint/internal/errorutil/errors.go +++ b/vendor/github.com/golangci/golangci-lint/internal/errorutil/errors.go @@ -1,6 +1,8 @@ package errorutil -import "fmt" +import ( + "fmt" +) // PanicError can be used to not print stacktrace twice type PanicError struct { diff --git a/vendor/github.com/golangci/golangci-lint/internal/pkgcache/pkgcache.go b/vendor/github.com/golangci/golangci-lint/internal/pkgcache/pkgcache.go index b2c481b58d2..86007d0427d 100644 --- a/vendor/github.com/golangci/golangci-lint/internal/pkgcache/pkgcache.go +++ b/vendor/github.com/golangci/golangci-lint/internal/pkgcache/pkgcache.go @@ -9,14 +9,20 @@ import ( "sort" "sync" - "github.com/golangci/golangci-lint/pkg/logutils" - - "github.com/golangci/golangci-lint/pkg/timeutils" - "github.com/pkg/errors" "golang.org/x/tools/go/packages" "github.com/golangci/golangci-lint/internal/cache" + "github.com/golangci/golangci-lint/pkg/logutils" + "github.com/golangci/golangci-lint/pkg/timeutils" +) + +type HashMode int + +const ( + HashModeNeedOnlySelf HashMode = iota + HashModeNeedDirectDeps + HashModeNeedAllDeps ) // Cache is a per-package data cache. A cached data is invalidated when @@ -48,7 +54,7 @@ func (c *Cache) Trim() { }) } -func (c *Cache) Put(pkg *packages.Package, key string, data interface{}) error { +func (c *Cache) Put(pkg *packages.Package, mode HashMode, key string, data interface{}) error { var err error buf := &bytes.Buffer{} c.sw.TrackStage("gob", func() { @@ -61,9 +67,13 @@ func (c *Cache) Put(pkg *packages.Package, key string, data interface{}) error { var aID cache.ActionID c.sw.TrackStage("key build", func() { - aID, err = c.pkgActionID(pkg) + aID, err = c.pkgActionID(pkg, mode) if err == nil { - aID = cache.Subkey(aID, key) + subkey, subkeyErr := cache.Subkey(aID, key) + if subkeyErr != nil { + err = errors.Wrap(subkeyErr, "failed to build subkey") + } + aID = subkey } }) if err != nil { @@ -83,13 +93,17 @@ func (c *Cache) Put(pkg *packages.Package, key string, data interface{}) error { var ErrMissing = errors.New("missing data") -func (c *Cache) Get(pkg *packages.Package, key string, data interface{}) error { +func (c *Cache) Get(pkg *packages.Package, mode HashMode, key string, data interface{}) error { var aID cache.ActionID var err error c.sw.TrackStage("key build", func() { - aID, err = c.pkgActionID(pkg) + aID, err = c.pkgActionID(pkg, mode) if err == nil { - aID = cache.Subkey(aID, key) + subkey, subkeyErr := cache.Subkey(aID, key) + if subkeyErr != nil { + err = errors.Wrap(subkeyErr, "failed to build subkey") + } + aID = subkey } }) if err != nil { @@ -119,13 +133,16 @@ func (c *Cache) Get(pkg *packages.Package, key string, data interface{}) error { return nil } -func (c *Cache) pkgActionID(pkg *packages.Package) (cache.ActionID, error) { - hash, err := c.packageHash(pkg) +func (c *Cache) pkgActionID(pkg *packages.Package, mode HashMode) (cache.ActionID, error) { + hash, err := c.packageHash(pkg, mode) if err != nil { return cache.ActionID{}, errors.Wrap(err, "failed to get package hash") } - key := cache.NewHash("action ID") + key, err := cache.NewHash("action ID") + if err != nil { + return cache.ActionID{}, errors.Wrap(err, "failed to make a hash") + } fmt.Fprintf(key, "pkgpath %s\n", pkg.PkgPath) fmt.Fprintf(key, "pkghash %s\n", hash) @@ -135,23 +152,36 @@ func (c *Cache) pkgActionID(pkg *packages.Package) (cache.ActionID, error) { // packageHash computes a package's hash. The hash is based on all Go // files that make up the package, as well as the hashes of imported // packages. -func (c *Cache) packageHash(pkg *packages.Package) (string, error) { - cachedHash, ok := c.pkgHashes.Load(pkg) +func (c *Cache) packageHash(pkg *packages.Package, mode HashMode) (string, error) { + type hashResults map[HashMode]string + hashResI, ok := c.pkgHashes.Load(pkg) if ok { - return cachedHash.(string), nil + hashRes := hashResI.(hashResults) + if _, ok := hashRes[mode]; !ok { + return "", fmt.Errorf("no mode %d in hash result", mode) + } + return hashRes[mode], nil + } + + hashRes := hashResults{} + + key, err := cache.NewHash("package hash") + if err != nil { + return "", errors.Wrap(err, "failed to make a hash") } - key := cache.NewHash("package hash") fmt.Fprintf(key, "pkgpath %s\n", pkg.PkgPath) for _, f := range pkg.CompiledGoFiles { c.ioSem <- struct{}{} - h, err := cache.FileHash(f) + h, fErr := cache.FileHash(f) <-c.ioSem - if err != nil { - return "", errors.Wrapf(err, "failed to calculate file %s hash", f) + if fErr != nil { + return "", errors.Wrapf(fErr, "failed to calculate file %s hash", f) } fmt.Fprintf(key, "file %s %x\n", f, h) } + curSum := key.Sum() + hashRes[HashModeNeedOnlySelf] = hex.EncodeToString(curSum[:]) imps := make([]*packages.Package, 0, len(pkg.Imports)) for _, imp := range pkg.Imports { @@ -160,20 +190,40 @@ func (c *Cache) packageHash(pkg *packages.Package) (string, error) { sort.Slice(imps, func(i, j int) bool { return imps[i].PkgPath < imps[j].PkgPath }) - for _, dep := range imps { - if dep.PkgPath == "unsafe" { - continue - } - depHash, err := c.packageHash(dep) - if err != nil { - return "", errors.Wrapf(err, "failed to calculate hash for dependency %s", dep.Name) + calcDepsHash := func(depMode HashMode) error { + for _, dep := range imps { + if dep.PkgPath == "unsafe" { + continue + } + + depHash, depErr := c.packageHash(dep, depMode) + if depErr != nil { + return errors.Wrapf(depErr, "failed to calculate hash for dependency %s with mode %d", dep.Name, depMode) + } + + fmt.Fprintf(key, "import %s %s\n", dep.PkgPath, depHash) } + return nil + } - fmt.Fprintf(key, "import %s %s\n", dep.PkgPath, depHash) + if err := calcDepsHash(HashModeNeedOnlySelf); err != nil { + return "", err } - h := key.Sum() - ret := hex.EncodeToString(h[:]) - c.pkgHashes.Store(pkg, ret) - return ret, nil + + curSum = key.Sum() + hashRes[HashModeNeedDirectDeps] = hex.EncodeToString(curSum[:]) + + if err := calcDepsHash(HashModeNeedAllDeps); err != nil { + return "", err + } + curSum = key.Sum() + hashRes[HashModeNeedAllDeps] = hex.EncodeToString(curSum[:]) + + if _, ok := hashRes[mode]; !ok { + return "", fmt.Errorf("invalid mode %d", mode) + } + + c.pkgHashes.Store(pkg, hashRes) + return hashRes[mode], nil } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/commands/cache.go b/vendor/github.com/golangci/golangci-lint/pkg/commands/cache.go new file mode 100644 index 00000000000..359e2d63c7f --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/commands/cache.go @@ -0,0 +1,84 @@ +package commands + +import ( + "fmt" + "os" + "path/filepath" + + "github.com/spf13/cobra" + + "github.com/golangci/golangci-lint/internal/cache" + "github.com/golangci/golangci-lint/pkg/fsutils" + "github.com/golangci/golangci-lint/pkg/logutils" +) + +func (e *Executor) initCache() { + cacheCmd := &cobra.Command{ + Use: "cache", + Short: "Cache control and information", + Run: func(cmd *cobra.Command, args []string) { + if len(args) != 0 { + e.log.Fatalf("Usage: golangci-lint cache") + } + if err := cmd.Help(); err != nil { + e.log.Fatalf("Can't run cache: %s", err) + } + }, + } + e.rootCmd.AddCommand(cacheCmd) + + cacheCmd.AddCommand(&cobra.Command{ + Use: "clean", + Short: "Clean cache", + Run: e.executeCleanCache, + }) + cacheCmd.AddCommand(&cobra.Command{ + Use: "status", + Short: "Show cache status", + Run: e.executeCacheStatus, + }) + + // TODO: add trim command? +} + +func (e *Executor) executeCleanCache(_ *cobra.Command, args []string) { + if len(args) != 0 { + e.log.Fatalf("Usage: golangci-lint cache clean") + } + + cacheDir := cache.DefaultDir() + if err := os.RemoveAll(cacheDir); err != nil { + e.log.Fatalf("Failed to remove dir %s: %s", cacheDir, err) + } + + os.Exit(0) +} + +func (e *Executor) executeCacheStatus(_ *cobra.Command, args []string) { + if len(args) != 0 { + e.log.Fatalf("Usage: golangci-lint cache status") + } + + cacheDir := cache.DefaultDir() + fmt.Fprintf(logutils.StdOut, "Dir: %s\n", cacheDir) + cacheSizeBytes, err := dirSizeBytes(cacheDir) + if err == nil { + fmt.Fprintf(logutils.StdOut, "Size: %s\n", fsutils.PrettifyBytesCount(cacheSizeBytes)) + } + + os.Exit(0) +} + +func dirSizeBytes(path string) (int64, error) { + var size int64 + err := filepath.Walk(path, func(_ string, info os.FileInfo, err error) error { + if err != nil { + return err + } + if !info.IsDir() { + size += info.Size() + } + return err + }) + return size, err +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/commands/completion.go b/vendor/github.com/golangci/golangci-lint/pkg/commands/completion.go index 1ff4b44f746..7d919d19766 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/commands/completion.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/commands/completion.go @@ -1,6 +1,7 @@ package commands import ( + "fmt" "os" "github.com/pkg/errors" @@ -17,12 +18,19 @@ func (e *Executor) initCompletion() { bashCmd := &cobra.Command{ Use: "bash", Short: "Output bash completion script", - RunE: e.executeCompletion, + RunE: e.executeBashCompletion, } completionCmd.AddCommand(bashCmd) + + zshCmd := &cobra.Command{ + Use: "zsh", + Short: "Output zsh completion script", + RunE: e.executeZshCompletion, + } + completionCmd.AddCommand(zshCmd) } -func (e *Executor) executeCompletion(cmd *cobra.Command, args []string) error { +func (e *Executor) executeBashCompletion(cmd *cobra.Command, args []string) error { err := cmd.Root().GenBashCompletion(os.Stdout) if err != nil { return errors.Wrap(err, "unable to generate bash completions: %v") @@ -30,3 +38,16 @@ func (e *Executor) executeCompletion(cmd *cobra.Command, args []string) error { return nil } + +func (e *Executor) executeZshCompletion(cmd *cobra.Command, args []string) error { + err := cmd.Root().GenZshCompletion(os.Stdout) + if err != nil { + return errors.Wrap(err, "unable to generate zsh completions: %v") + } + // Add extra compdef directive to support sourcing command directly. + // https://github.com/spf13/cobra/issues/881 + // https://github.com/spf13/cobra/pull/887 + fmt.Println("compdef _golangci-lint golangci-lint") + + return nil +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/commands/config.go b/vendor/github.com/golangci/golangci-lint/pkg/commands/config.go index a1d1bd9b4ce..807f1ca492a 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/commands/config.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/commands/config.go @@ -4,12 +4,11 @@ import ( "fmt" "os" + "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/golangci/golangci-lint/pkg/exitcodes" "github.com/golangci/golangci-lint/pkg/fsutils" - - "github.com/spf13/cobra" ) func (e *Executor) initConfig() { diff --git a/vendor/github.com/golangci/golangci-lint/pkg/commands/executor.go b/vendor/github.com/golangci/golangci-lint/pkg/commands/executor.go index 0fad8f76612..ffef5b0a5bd 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/commands/executor.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/commands/executor.go @@ -1,23 +1,33 @@ package commands import ( + "bytes" + "context" + "crypto/sha256" + "encoding/json" + "fmt" + "io" + "os" + "path/filepath" + "time" + "github.com/fatih/color" + "github.com/gofrs/flock" + "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/pflag" - "github.com/golangci/golangci-lint/pkg/golinters/goanalysis/load" - + "github.com/golangci/golangci-lint/internal/cache" "github.com/golangci/golangci-lint/internal/pkgcache" - "github.com/golangci/golangci-lint/pkg/timeutils" - - "github.com/golangci/golangci-lint/pkg/fsutils" - "github.com/golangci/golangci-lint/pkg/config" + "github.com/golangci/golangci-lint/pkg/fsutils" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis/load" "github.com/golangci/golangci-lint/pkg/goutil" "github.com/golangci/golangci-lint/pkg/lint" "github.com/golangci/golangci-lint/pkg/lint/lintersdb" "github.com/golangci/golangci-lint/pkg/logutils" "github.com/golangci/golangci-lint/pkg/report" + "github.com/golangci/golangci-lint/pkg/timeutils" ) type Executor struct { @@ -41,6 +51,7 @@ type Executor struct { sw *timeutils.Stopwatch loadGuard *load.Guard + flock *flock.Flock } func NewExecutor(version, commit, date string) *Executor { @@ -49,12 +60,15 @@ func NewExecutor(version, commit, date string) *Executor { version: version, commit: commit, date: date, - DBManager: lintersdb.NewManager(nil), + DBManager: lintersdb.NewManager(nil, nil), debugf: logutils.Debug("exec"), } e.debugf("Starting execution...") e.log = report.NewLogWrapper(logutils.NewStderrLog(""), &e.reportData) + if ok := e.acquireFileLock(); !ok { + e.log.Fatalf("Parallel golangci-lint is running") + } // to setup log level early we need to parse config from command line extra time to // find `-v` option @@ -85,6 +99,8 @@ func NewExecutor(version, commit, date string) *Executor { e.initLinters() e.initConfig() e.initCompletion() + e.initVersion() + e.initCache() // init e.cfg by values from config: flags parse will see these values // like the default ones. It will overwrite them only if the same option @@ -96,7 +112,7 @@ func NewExecutor(version, commit, date string) *Executor { } // recreate after getting config - e.DBManager = lintersdb.NewManager(e.cfg) + e.DBManager = lintersdb.NewManager(e.cfg, e.log).WithCustomLinters() e.cfg.LintersSettings.Gocritic.InferEnabledChecks(e.log) if err = e.cfg.LintersSettings.Gocritic.Validate(e.log); err != nil { @@ -120,6 +136,9 @@ func NewExecutor(version, commit, date string) *Executor { e.loadGuard = load.NewGuard() e.contextLoader = lint.NewContextLoader(e.cfg, e.log.Child("loader"), e.goenv, e.lineCache, e.fileCache, e.pkgCache, e.loadGuard) + if err = e.initHashSalt(version); err != nil { + e.log.Fatalf("Failed to init hash salt: %s", err) + } e.debugf("Initialized executor") return e } @@ -127,3 +146,84 @@ func NewExecutor(version, commit, date string) *Executor { func (e *Executor) Execute() error { return e.rootCmd.Execute() } + +func (e *Executor) initHashSalt(version string) error { + binSalt, err := computeBinarySalt(version) + if err != nil { + return errors.Wrap(err, "failed to calculate binary salt") + } + + configSalt, err := computeConfigSalt(e.cfg) + if err != nil { + return errors.Wrap(err, "failed to calculate config salt") + } + + var b bytes.Buffer + b.Write(binSalt) + b.Write(configSalt) + cache.SetSalt(b.Bytes()) + return nil +} + +func computeBinarySalt(version string) ([]byte, error) { + if version != "" && version != "(devel)" { + return []byte(version), nil + } + + if logutils.HaveDebugTag("bin_salt") { + return []byte("debug"), nil + } + + p, err := os.Executable() + if err != nil { + return nil, err + } + f, err := os.Open(p) + if err != nil { + return nil, err + } + defer f.Close() + h := sha256.New() + if _, err := io.Copy(h, f); err != nil { + return nil, err + } + return h.Sum(nil), nil +} + +func computeConfigSalt(cfg *config.Config) ([]byte, error) { + configBytes, err := json.Marshal(cfg) + if err != nil { + return nil, errors.Wrap(err, "failed to json marshal config") + } + + h := sha256.New() + if n, err := h.Write(configBytes); n != len(configBytes) { + return nil, fmt.Errorf("failed to hash config bytes: wrote %d/%d bytes, error: %s", n, len(configBytes), err) + } + return h.Sum(nil), nil +} + +func (e *Executor) acquireFileLock() bool { + lockFile := filepath.Join(os.TempDir(), "golangci-lint.lock") + e.debugf("Locking on file %s...", lockFile) + f := flock.New(lockFile) + ctx, finish := context.WithTimeout(context.Background(), time.Minute) + defer finish() + + timeout := time.Second * 3 + if ok, _ := f.TryLockContext(ctx, timeout); !ok { + return false + } + + e.flock = f + return true +} + +func (e *Executor) releaseFileLock() { + if err := e.flock.Unlock(); err != nil { + e.debugf("Failed to unlock on file: %s", err) + } + if err := os.Remove(e.flock.Path()); err != nil { + e.debugf("Failed to remove lock file: %s", err) + } +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/commands/root.go b/vendor/github.com/golangci/golangci-lint/pkg/commands/root.go index 21e7fa2e973..c8548cd7340 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/commands/root.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/commands/root.go @@ -73,6 +73,7 @@ func (e *Executor) persistentPostRun(_ *cobra.Command, _ []string) { trace.Stop() } + e.releaseFileLock() os.Exit(e.exitCode) } @@ -92,18 +93,23 @@ func printMemStats(ms *runtime.MemStats, logger logutils.Log) { } func formatMemory(memBytes uint64) string { - if memBytes < 1024 { + const Kb = 1024 + const Mb = Kb * 1024 + + if memBytes < Kb { return fmt.Sprintf("%db", memBytes) } - if memBytes < 1024*1024 { - return fmt.Sprintf("%dkb", memBytes/1024) + if memBytes < Mb { + return fmt.Sprintf("%dkb", memBytes/Kb) } - return fmt.Sprintf("%dmb", memBytes/1024/1024) + return fmt.Sprintf("%dmb", memBytes/Mb) } func getDefaultConcurrency() int { if os.Getenv("HELP_RUN") == "1" { - return 8 // to make stable concurrency for README help generating builds + // Make stable concurrency for README help generating builds. + const prettyConcurrency = 8 + return prettyConcurrency } return runtime.NumCPU() diff --git a/vendor/github.com/golangci/golangci-lint/pkg/commands/run.go b/vendor/github.com/golangci/golangci-lint/pkg/commands/run.go index 3b3a6422608..b306802a458 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/commands/run.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/commands/run.go @@ -10,9 +10,6 @@ import ( "strings" "time" - "github.com/golangci/golangci-lint/pkg/packages" - "github.com/golangci/golangci-lint/pkg/result/processors" - "github.com/fatih/color" "github.com/pkg/errors" "github.com/spf13/cobra" @@ -23,8 +20,10 @@ import ( "github.com/golangci/golangci-lint/pkg/lint" "github.com/golangci/golangci-lint/pkg/lint/lintersdb" "github.com/golangci/golangci-lint/pkg/logutils" + "github.com/golangci/golangci-lint/pkg/packages" "github.com/golangci/golangci-lint/pkg/printers" "github.com/golangci/golangci-lint/pkg/result" + "github.com/golangci/golangci-lint/pkg/result/processors" ) func getDefaultIssueExcludeHelp() string { @@ -55,6 +54,8 @@ func wh(text string) string { return color.GreenString(text) } +const defaultTimeout = time.Minute + //nolint:funlen func initFlagSet(fs *pflag.FlagSet, cfg *config.Config, m *lintersdb.Manager, isFinalInit bool) { hideFlag := func(name string) { @@ -78,15 +79,24 @@ func initFlagSet(fs *pflag.FlagSet, cfg *config.Config, m *lintersdb.Manager, is wh(fmt.Sprintf("Format of output: %s", strings.Join(config.OutFormats, "|")))) fs.BoolVar(&oc.PrintIssuedLine, "print-issued-lines", true, wh("Print lines of code with issue")) fs.BoolVar(&oc.PrintLinterName, "print-linter-name", true, wh("Print linter name in issue line")) + fs.BoolVar(&oc.UniqByLine, "uniq-by-line", true, wh("Make issues output unique by line")) fs.BoolVar(&oc.PrintWelcomeMessage, "print-welcome", false, wh("Print welcome message")) hideFlag("print-welcome") // no longer used // Run config rc := &cfg.Run + fs.StringVar(&rc.ModulesDownloadMode, "modules-download-mode", "", + "Modules download mode. If not empty, passed as -mod= to go tools") fs.IntVar(&rc.ExitCodeIfIssuesFound, "issues-exit-code", exitcodes.IssuesFound, wh("Exit code when issues were found")) fs.StringSliceVar(&rc.BuildTags, "build-tags", nil, wh("Build tags")) - fs.DurationVar(&rc.Deadline, "deadline", time.Minute, wh("Deadline for total work")) + + fs.DurationVar(&rc.Timeout, "deadline", defaultTimeout, wh("Deadline for total work")) + if err := fs.MarkHidden("deadline"); err != nil { + panic(err) + } + fs.DurationVar(&rc.Timeout, "timeout", defaultTimeout, wh("Timeout for total work")) + fs.BoolVar(&rc.AnalyzeTests, "tests", true, wh("Analyze tests (*_test.go)")) fs.BoolVar(&rc.PrintResourcesUsage, "print-resources-usage", false, wh("Print avg and max memory usage of golangci-lint and total time")) @@ -164,6 +174,11 @@ func initFlagSet(fs *pflag.FlagSet, cfg *config.Config, m *lintersdb.Manager, is fs.StringSliceVarP(&lc.Enable, "enable", "E", nil, wh("Enable specific linter")) fs.StringSliceVarP(&lc.Disable, "disable", "D", nil, wh("Disable specific linter")) fs.BoolVar(&lc.EnableAll, "enable-all", false, wh("Enable all linters")) + if err := fs.MarkHidden("enable-all"); err != nil { + panic(err) + } + // TODO: run hideFlag("enable-all") to print deprecation message. + fs.BoolVar(&lc.DisableAll, "disable-all", false, wh("Disable all linters")) fs.StringSliceVarP(&lc.Presets, "presets", "p", nil, wh(fmt.Sprintf("Enable presets (%s) of linters. Run 'golangci-lint linters' to see "+ @@ -265,7 +280,7 @@ func fixSlicesFlags(fs *pflag.FlagSet) { }) } -func (e *Executor) runAnalysis(ctx context.Context, args []string) (<-chan result.Issue, error) { +func (e *Executor) runAnalysis(ctx context.Context, args []string) ([]result.Issue, error) { e.cfg.Run.Args = args enabledLinters, err := e.EnabledLintersSet.Get(true) @@ -273,9 +288,14 @@ func (e *Executor) runAnalysis(ctx context.Context, args []string) (<-chan resul return nil, err } + enabledOriginalLinters, err := e.EnabledLintersSet.Get(false) + if err != nil { + return nil, err + } + for _, lc := range e.DBManager.GetAllSupportedLinterConfigs() { isEnabled := false - for _, enabledLC := range enabledLinters { + for _, enabledLC := range enabledOriginalLinters { if enabledLC.Name() == lc.Name() { isEnabled = true break @@ -290,15 +310,19 @@ func (e *Executor) runAnalysis(ctx context.Context, args []string) (<-chan resul } lintCtx.Log = e.log.Child("linters context") - runner, err := lint.NewRunner(lintCtx.ASTCache, e.cfg, e.log.Child("runner"), - e.goenv, e.lineCache, e.DBManager) + runner, err := lint.NewRunner(e.cfg, e.log.Child("runner"), + e.goenv, e.lineCache, e.DBManager, lintCtx.Packages) + if err != nil { + return nil, err + } + + issues, err := runner.Run(ctx, enabledLinters, lintCtx) if err != nil { return nil, err } - issuesCh := runner.Run(ctx, enabledLinters, lintCtx) fixer := processors.NewFixer(e.cfg, e.log, e.fileCache) - return fixer.Process(issuesCh), nil + return fixer.Process(issues), nil } func (e *Executor) setOutputToDevNull() (savedStdout, savedStderr *os.File) { @@ -313,24 +337,10 @@ func (e *Executor) setOutputToDevNull() (savedStdout, savedStderr *os.File) { return } -func (e *Executor) setExitCodeIfIssuesFound(issues <-chan result.Issue) <-chan result.Issue { - resCh := make(chan result.Issue, 1024) - - go func() { - issuesFound := false - for i := range issues { - issuesFound = true - resCh <- i - } - - if issuesFound { - e.exitCode = e.cfg.Run.ExitCodeIfIssuesFound - } - - close(resCh) - }() - - return resCh +func (e *Executor) setExitCodeIfIssuesFound(issues []result.Issue) { + if len(issues) != 0 { + e.exitCode = e.cfg.Run.ExitCodeIfIssuesFound + } } func (e *Executor) runAndPrint(ctx context.Context, args []string) error { @@ -357,7 +367,7 @@ func (e *Executor) runAndPrint(ctx context.Context, args []string) error { return err } - issues = e.setExitCodeIfIssuesFound(issues) + e.setExitCodeIfIssuesFound(issues) if err = p.Print(ctx, issues); err != nil { return fmt.Errorf("can't print %d issues: %s", len(issues), err) @@ -402,7 +412,8 @@ func (e *Executor) executeRun(_ *cobra.Command, args []string) { } }() - ctx, cancel := context.WithTimeout(context.Background(), e.cfg.Run.Deadline) + e.setTimeoutToDeadlineIfOnlyDeadlineIsSet() + ctx, cancel := context.WithTimeout(context.Background(), e.cfg.Run.Timeout) defer cancel() if needTrackResources { @@ -423,10 +434,19 @@ func (e *Executor) executeRun(_ *cobra.Command, args []string) { e.setupExitCode(ctx) } +// to be removed when deadline is finally decommissioned +func (e *Executor) setTimeoutToDeadlineIfOnlyDeadlineIsSet() { + //lint:ignore SA1019 We want to promoted the deprecated config value when needed + deadlineValue := e.cfg.Run.Deadline // nolint: staticcheck + if deadlineValue != 0 && e.cfg.Run.Timeout == defaultTimeout { + e.cfg.Run.Timeout = deadlineValue + } +} + func (e *Executor) setupExitCode(ctx context.Context) { if ctx.Err() != nil { e.exitCode = exitcodes.Timeout - e.log.Errorf("Deadline exceeded: try increase it by passing --deadline option") + e.log.Errorf("Timeout exceeded: try increasing it by passing --timeout option") return } @@ -453,14 +473,15 @@ func watchResources(ctx context.Context, done chan struct{}, logger logutils.Log var maxRSSMB, totalRSSMB float64 var iterationsCount int - ticker := time.NewTicker(100 * time.Millisecond) + + const intervalMS = 100 + ticker := time.NewTicker(intervalMS * time.Millisecond) defer ticker.Stop() logEveryRecord := os.Getenv("GL_MEM_LOG_EVERY") == "1" const MB = 1024 * 1024 track := func() { - debugf("Starting memory tracing iteration ...") var m runtime.MemStats runtime.ReadMemStats(&m) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/commands/version.go b/vendor/github.com/golangci/golangci-lint/pkg/commands/version.go new file mode 100644 index 00000000000..fdb5aa884a1 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/commands/version.go @@ -0,0 +1,17 @@ +package commands + +import ( + "github.com/spf13/cobra" +) + +func (e *Executor) initVersion() { + versionCmd := &cobra.Command{ + Use: "version", + Short: "Version", + Run: func(cmd *cobra.Command, _ []string) { + cmd.Printf("golangci-lint has version %s built from %s on %s\n", e.version, e.commit, e.date) + }, + } + + e.rootCmd.AddCommand(versionCmd) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/config/config.go b/vendor/github.com/golangci/golangci-lint/pkg/config/config.go index f07037d947b..ba92cc00e36 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/config/config.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/config/config.go @@ -116,9 +116,13 @@ type Run struct { ExitCodeIfIssuesFound int `mapstructure:"issues-exit-code"` AnalyzeTests bool `mapstructure:"tests"` - Deadline time.Duration - PrintVersion bool + // Deprecated: Deadline exists for historical compatibility + // and should not be used. To set run timeout use Timeout instead. + Deadline time.Duration + Timeout time.Duration + + PrintVersion bool SkipFiles []string `mapstructure:"skip-files"` SkipDirs []string `mapstructure:"skip-dirs"` UseDefaultSkipDirs bool `mapstructure:"skip-dirs-use-default"` @@ -154,6 +158,9 @@ type LintersSettings struct { MinStringLen int `mapstructure:"min-len"` MinOccurrencesCount int `mapstructure:"min-occurrences"` } + Gomnd struct { + Settings map[string]map[string]interface{} + } Depguard struct { ListType string `mapstructure:"list-type"` Packages []string @@ -172,9 +179,14 @@ type LintersSettings struct { Statements int } Whitespace struct { - MultiIf bool `mapstructure:"multi-if"` + MultiIf bool `mapstructure:"multi-if"` + MultiFunc bool `mapstructure:"multi-func"` + } + RowsErrCheck struct { + Packages []string } + WSL WSLSettings Lll LllSettings Unparam UnparamSettings Nakedret NakedretSettings @@ -183,6 +195,9 @@ type LintersSettings struct { Gocritic GocriticSettings Godox GodoxSettings Dogsled DogsledSettings + Gocognit GocognitSettings + + Custom map[string]CustomLinterSettings } type GovetSettings struct { @@ -243,6 +258,20 @@ type DogsledSettings struct { MaxBlankIdentifiers int `mapstructure:"max-blank-identifiers"` } +type GocognitSettings struct { + MinComplexity int `mapstructure:"min-complexity"` +} + +type WSLSettings struct { + StrictAppend bool `mapstructure:"strict-append"` + AllowAssignAndCallCuddle bool `mapstructure:"allow-assign-and-call"` + AllowMultiLineAssignCuddle bool `mapstructure:"allow-multiline-assign"` + AllowCuddleDeclaration bool `mapstructure:"allow-cuddle-declarations"` + AllowTrailingComment bool `mapstructure:"allow-trailing-comment"` + CaseForceTrailingWhitespaceLimit int `mapstructure:"force-case-trailing-whitespace:"` +} + +//nolint:gomnd var defaultLintersSettings = LintersSettings{ Lll: LllSettings{ LineLength: 120, @@ -268,6 +297,23 @@ var defaultLintersSettings = LintersSettings{ Dogsled: DogsledSettings{ MaxBlankIdentifiers: 2, }, + Gocognit: GocognitSettings{ + MinComplexity: 30, + }, + WSL: WSLSettings{ + StrictAppend: true, + AllowAssignAndCallCuddle: true, + AllowMultiLineAssignCuddle: true, + AllowCuddleDeclaration: false, + AllowTrailingComment: false, + CaseForceTrailingWhitespaceLimit: 0, + }, +} + +type CustomLinterSettings struct { + Path string + Description string + OriginalURL string `mapstructure:"original-url"` } type Linters struct { @@ -318,7 +364,8 @@ func (e ExcludeRule) Validate() error { if e.Source != "" { nonBlank++ } - if nonBlank < 2 { + const minConditionsCount = 2 + if nonBlank < minConditionsCount { return errors.New("at least 2 of (text, source, path, linters) should be set") } return nil @@ -339,7 +386,7 @@ type Issues struct { NeedFix bool `mapstructure:"fix"` } -type Config struct { //nolint:maligned +type Config struct { Run Run Output struct { @@ -347,6 +394,7 @@ type Config struct { //nolint:maligned Color string PrintIssuedLine bool `mapstructure:"print-issued-lines"` PrintLinterName bool `mapstructure:"print-linter-name"` + UniqByLine bool `mapstructure:"uniq-by-line"` PrintWelcomeMessage bool `mapstructure:"print-welcome"` } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/config/config_gocritic.go b/vendor/github.com/golangci/golangci-lint/pkg/config/config_gocritic.go index faf2a8bf4bb..b8397262bb0 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/config/config_gocritic.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/config/config_gocritic.go @@ -97,7 +97,6 @@ func (s *GocriticSettings) gocriticDisabledCheckersDebugf() { } } -//nolint:gocyclo func (s *GocriticSettings) InferEnabledChecks(log logutils.Log) { gocriticCheckerTagsDebugf() @@ -140,8 +139,8 @@ func (s *GocriticSettings) InferEnabledChecks(log logutils.Log) { enabledChecksSet := stringsSliceToSet(enabledChecks) for _, disabledCheck := range s.DisabledChecks { if !enabledChecksSet[disabledCheck] { - log.Warnf("Gocritic check %q was disabled by config, was it's not enabled, no need to disable it", - disabledCheck) + log.Warnf("Gocritic check %q was explicitly disabled via config. However, as this check"+ + "is disabled by default, there is no need to explicitly disable it via config.", disabledCheck) continue } delete(enabledChecksSet, disabledCheck) @@ -175,7 +174,6 @@ func validateStringsUniq(ss []string) error { return nil } -//nolint:gocyclo func (s *GocriticSettings) Validate(log logutils.Log) error { if len(s.EnabledTags) == 0 { if len(s.EnabledChecks) != 0 && len(s.DisabledChecks) != 0 { diff --git a/vendor/github.com/golangci/golangci-lint/pkg/config/reader.go b/vendor/github.com/golangci/golangci-lint/pkg/config/reader.go index 9a19b524137..1e355e72213 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/config/reader.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/config/reader.go @@ -7,12 +7,11 @@ import ( "path/filepath" "strings" + homedir "github.com/mitchellh/go-homedir" "github.com/spf13/viper" "github.com/golangci/golangci-lint/pkg/fsutils" "github.com/golangci/golangci-lint/pkg/logutils" - - homedir "github.com/mitchellh/go-homedir" ) type FileReader struct { diff --git a/vendor/github.com/golangci/golangci-lint/pkg/exitcodes/exitcodes.go b/vendor/github.com/golangci/golangci-lint/pkg/exitcodes/exitcodes.go index 7c74a29973a..536f9036142 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/exitcodes/exitcodes.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/exitcodes/exitcodes.go @@ -30,3 +30,5 @@ var ( Code: Failure, } ) + +// 1 diff --git a/vendor/github.com/golangci/golangci-lint/pkg/fsutils/filecache.go b/vendor/github.com/golangci/golangci-lint/pkg/fsutils/filecache.go index 8e4d8c32618..2b17a039861 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/fsutils/filecache.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/fsutils/filecache.go @@ -5,9 +5,9 @@ import ( "io/ioutil" "sync" - "github.com/golangci/golangci-lint/pkg/logutils" - "github.com/pkg/errors" + + "github.com/golangci/golangci-lint/pkg/logutils" ) type FileCache struct { @@ -33,7 +33,7 @@ func (fc *FileCache) GetFileBytes(filePath string) ([]byte, error) { return fileBytes, nil } -func prettifyBytesCount(n int) string { +func PrettifyBytesCount(n int64) string { const ( Multiplexer = 1024 KiB = 1 * Multiplexer @@ -54,14 +54,14 @@ func prettifyBytesCount(n int) string { } func (fc *FileCache) PrintStats(log logutils.Log) { - var size int + var size int64 var mapLen int fc.files.Range(func(_, fileBytes interface{}) bool { mapLen++ - size += len(fileBytes.([]byte)) + size += int64(len(fileBytes.([]byte))) return true }) - log.Infof("File cache stats: %d entries of total size %s", mapLen, prettifyBytesCount(size)) + log.Infof("File cache stats: %d entries of total size %s", mapLen, PrettifyBytesCount(size)) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/fsutils/fsutils.go b/vendor/github.com/golangci/golangci-lint/pkg/fsutils/fsutils.go index fa5fda6a8c3..a39c105e432 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/fsutils/fsutils.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/fsutils/fsutils.go @@ -81,7 +81,7 @@ func ShortestRelPath(path, wd string) (string, error) { path = evaledPath // make path absolute and then relative to be able to fix this case: - // we'are in /test dir, we want to normalize ../test, and have file file.go in this dir; + // we are in /test dir, we want to normalize ../test, and have file file.go in this dir; // it must have normalized path file.go, not ../test/file.go, var absPath string if filepath.IsAbs(path) { diff --git a/vendor/github.com/golangci/golangci-lint/pkg/fsutils/linecache.go b/vendor/github.com/golangci/golangci-lint/pkg/fsutils/linecache.go index 10f31422a91..ab408e7d544 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/fsutils/linecache.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/fsutils/linecache.go @@ -27,7 +27,8 @@ func (lc *LineCache) GetLine(filePath string, index1 int) (string, error) { index1 = 1 } - rawLine, err := lc.getRawLine(filePath, index1-1) + const index1To0Offset = -1 + rawLine, err := lc.getRawLine(filePath, index1+index1To0Offset) if err != nil { return "", err } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/bodyclose.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/bodyclose.go index 626550811ff..0e03813d1a7 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/bodyclose.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/bodyclose.go @@ -17,5 +17,5 @@ func NewBodyclose() *goanalysis.Linter { "checks whether HTTP response body is closed successfully", analyzers, nil, - ) + ).WithLoadMode(goanalysis.LoadModeTypesInfo) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/deadcode.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/deadcode.go index d6ab4f26e5d..9889dad4ed6 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/deadcode.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/deadcode.go @@ -1,42 +1,52 @@ package golinters import ( - "context" "fmt" + "sync" deadcodeAPI "github.com/golangci/go-misc/deadcode" + "golang.org/x/tools/go/analysis" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Deadcode struct{} - -func (Deadcode) Name() string { - return "deadcode" -} - -func (Deadcode) Desc() string { - return "Finds unused code" -} - -func (d Deadcode) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - issues, err := deadcodeAPI.Run(lintCtx.Program) - if err != nil { - return nil, err - } - - if len(issues) == 0 { - return nil, nil - } - - res := make([]result.Issue, 0, len(issues)) - for _, i := range issues { - res = append(res, result.Issue{ - Pos: i.Pos, - Text: fmt.Sprintf("%s is unused", formatCode(i.UnusedIdentName, lintCtx.Cfg)), - FromLinter: d.Name(), - }) +func NewDeadcode() *goanalysis.Linter { + const linterName = "deadcode" + var mu sync.Mutex + var resIssues []goanalysis.Issue + + analyzer := &analysis.Analyzer{ + Name: linterName, + Doc: goanalysis.TheOnlyanalyzerDoc, + Run: func(pass *analysis.Pass) (interface{}, error) { + prog := goanalysis.MakeFakeLoaderProgram(pass) + issues, err := deadcodeAPI.Run(prog) + if err != nil { + return nil, err + } + res := make([]goanalysis.Issue, 0, len(issues)) + for _, i := range issues { + res = append(res, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: i.Pos, + Text: fmt.Sprintf("%s is unused", formatCode(i.UnusedIdentName, nil)), + FromLinter: linterName, + }, pass)) + } + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() + + return nil, nil + }, } - return res, nil + return goanalysis.NewLinter( + linterName, + "Finds unused code", + []*analysis.Analyzer{analyzer}, + nil, + ).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeTypesInfo) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/depguard.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/depguard.go index 9fb59dfa31d..611f6d4950b 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/depguard.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/depguard.go @@ -1,38 +1,35 @@ package golinters import ( - "context" "fmt" "strings" + "sync" - depguardAPI "github.com/OpenPeeDeeP/depguard" + "github.com/OpenPeeDeeP/depguard" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/loader" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Depguard struct{} - -func (Depguard) Name() string { - return "depguard" -} - -func setDepguardListType(dg *depguardAPI.Depguard, lintCtx *linter.Context) error { +func setDepguardListType(dg *depguard.Depguard, lintCtx *linter.Context) error { listType := lintCtx.Settings().Depguard.ListType var found bool - dg.ListType, found = depguardAPI.StringToListType[strings.ToLower(listType)] + dg.ListType, found = depguard.StringToListType[strings.ToLower(listType)] if !found { if listType != "" { return fmt.Errorf("unsure what list type %s is", listType) } - dg.ListType = depguardAPI.LTBlacklist + dg.ListType = depguard.LTBlacklist } return nil } -func setupDepguardPackages(dg *depguardAPI.Depguard, lintCtx *linter.Context) { - if dg.ListType == depguardAPI.LTBlacklist { +func setupDepguardPackages(dg *depguard.Depguard, lintCtx *linter.Context) { + if dg.ListType == depguard.LTBlacklist { // if the list type was a blacklist the packages with error messages should // be included in the blacklist package list @@ -49,42 +46,67 @@ func setupDepguardPackages(dg *depguardAPI.Depguard, lintCtx *linter.Context) { } } -func (Depguard) Desc() string { - return "Go linter that checks if package imports are in a list of acceptable packages" -} +func NewDepguard() *goanalysis.Linter { + const linterName = "depguard" + var mu sync.Mutex + var resIssues []goanalysis.Issue -func (d Depguard) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - dg := &depguardAPI.Depguard{ - Packages: lintCtx.Settings().Depguard.Packages, - IncludeGoRoot: lintCtx.Settings().Depguard.IncludeGoRoot, - } - if err := setDepguardListType(dg, lintCtx); err != nil { - return nil, err + analyzer := &analysis.Analyzer{ + Name: linterName, + Doc: goanalysis.TheOnlyanalyzerDoc, } - setupDepguardPackages(dg, lintCtx) + return goanalysis.NewLinter( + linterName, + "Go linter that checks if package imports are in a list of acceptable packages", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + dgSettings := &lintCtx.Settings().Depguard + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + prog := goanalysis.MakeFakeLoaderProgram(pass) + dg := &depguard.Depguard{ + Packages: dgSettings.Packages, + IncludeGoRoot: dgSettings.IncludeGoRoot, + } + if err := setDepguardListType(dg, lintCtx); err != nil { + return nil, err + } + setupDepguardPackages(dg, lintCtx) - issues, err := dg.Run(lintCtx.LoaderConfig, lintCtx.Program) - if err != nil { - return nil, err - } - if len(issues) == 0 { - return nil, nil - } - msgSuffix := "is in the blacklist" - if dg.ListType == depguardAPI.LTWhitelist { - msgSuffix = "is not in the whitelist" - } - res := make([]result.Issue, 0, len(issues)) - for _, i := range issues { - userSuppliedMsgSuffix := lintCtx.Settings().Depguard.PackagesWithErrorMessage[i.PackageName] - if userSuppliedMsgSuffix != "" { - userSuppliedMsgSuffix = ": " + userSuppliedMsgSuffix + loadConfig := &loader.Config{ + Cwd: "", // fallbacked to os.Getcwd + Build: nil, // fallbacked to build.Default + } + issues, err := dg.Run(loadConfig, prog) + if err != nil { + return nil, err + } + if len(issues) == 0 { + return nil, nil + } + msgSuffix := "is in the blacklist" + if dg.ListType == depguard.LTWhitelist { + msgSuffix = "is not in the whitelist" + } + res := make([]goanalysis.Issue, 0, len(issues)) + for _, i := range issues { + userSuppliedMsgSuffix := dgSettings.PackagesWithErrorMessage[i.PackageName] + if userSuppliedMsgSuffix != "" { + userSuppliedMsgSuffix = ": " + userSuppliedMsgSuffix + } + res = append(res, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: i.Position, + Text: fmt.Sprintf("%s %s%s", formatCode(i.PackageName, lintCtx.Cfg), msgSuffix, userSuppliedMsgSuffix), + FromLinter: linterName, + }, pass)) + } + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() + + return nil, nil } - res = append(res, result.Issue{ - Pos: i.Position, - Text: fmt.Sprintf("%s %s%s", formatCode(i.PackageName, lintCtx.Cfg), msgSuffix, userSuppliedMsgSuffix), - FromLinter: d.Name(), - }) - } - return res, nil + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeTypesInfo) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/dogsled.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/dogsled.go index 68237cc0f02..8978ff913dc 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/dogsled.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/dogsled.go @@ -1,38 +1,56 @@ package golinters import ( - "context" "fmt" "go/ast" "go/token" + "sync" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Dogsled struct{} +const dogsledLinterName = "dogsled" -func (Dogsled) Name() string { - return "dogsled" -} +func NewDogsled() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue -func (Dogsled) Desc() string { - return "Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())" -} + analyzer := &analysis.Analyzer{ + Name: dogsledLinterName, + Doc: goanalysis.TheOnlyanalyzerDoc, + } + return goanalysis.NewLinter( + dogsledLinterName, + "Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var pkgIssues []goanalysis.Issue + for _, f := range pass.Files { + v := returnsVisitor{ + maxBlanks: lintCtx.Settings().Dogsled.MaxBlankIdentifiers, + f: pass.Fset, + } + ast.Walk(&v, f) + for i := range v.issues { + pkgIssues = append(pkgIssues, goanalysis.NewIssue(&v.issues[i], pass)) + } + } -func (d Dogsled) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { + mu.Lock() + resIssues = append(resIssues, pkgIssues...) + mu.Unlock() - var res []result.Issue - for _, f := range lintCtx.ASTCache.GetAllValidFiles() { - v := returnsVisitor{ - maxBlanks: lintCtx.Settings().Dogsled.MaxBlankIdentifiers, - f: f.Fset, + return nil, nil } - ast.Walk(&v, f.F) - res = append(res, v.issues...) - } - - return res, nil + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) } type returnsVisitor struct { @@ -69,7 +87,7 @@ func (v *returnsVisitor) Visit(node ast.Node) ast.Visitor { if numBlank > v.maxBlanks { v.issues = append(v.issues, result.Issue{ - FromLinter: Dogsled{}.Name(), + FromLinter: dogsledLinterName, Text: fmt.Sprintf("declaration has %v blank identifiers", numBlank), Pos: v.f.Position(assgnStmt.Pos()), }) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/dupl.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/dupl.go index c31c87795ce..d6dc67fbb0e 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/dupl.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/dupl.go @@ -1,60 +1,83 @@ package golinters import ( - "context" "fmt" "go/token" + "sync" duplAPI "github.com/golangci/dupl" "github.com/pkg/errors" + "golang.org/x/tools/go/analysis" "github.com/golangci/golangci-lint/pkg/fsutils" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Dupl struct{} +const duplLinterName = "dupl" -func (Dupl) Name() string { - return "dupl" -} - -func (Dupl) Desc() string { - return "Tool for code clone detection" -} +func NewDupl() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue -func (d Dupl) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - issues, err := duplAPI.Run(getAllFileNames(lintCtx), lintCtx.Settings().Dupl.Threshold) - if err != nil { - return nil, err + analyzer := &analysis.Analyzer{ + Name: duplLinterName, + Doc: goanalysis.TheOnlyanalyzerDoc, } + return goanalysis.NewLinter( + duplLinterName, + "Tool for code clone detection", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var fileNames []string + for _, f := range pass.Files { + pos := pass.Fset.Position(f.Pos()) + fileNames = append(fileNames, pos.Filename) + } - if len(issues) == 0 { - return nil, nil - } + issues, err := duplAPI.Run(fileNames, lintCtx.Settings().Dupl.Threshold) + if err != nil { + return nil, err + } - res := make([]result.Issue, 0, len(issues)) - for _, i := range issues { - toFilename, err := fsutils.ShortestRelPath(i.To.Filename(), "") - if err != nil { - return nil, errors.Wrapf(err, "failed to get shortest rel path for %q", i.To.Filename()) + if len(issues) == 0 { + return nil, nil + } + + res := make([]goanalysis.Issue, 0, len(issues)) + for _, i := range issues { + toFilename, err := fsutils.ShortestRelPath(i.To.Filename(), "") + if err != nil { + return nil, errors.Wrapf(err, "failed to get shortest rel path for %q", i.To.Filename()) + } + dupl := fmt.Sprintf("%s:%d-%d", toFilename, i.To.LineStart(), i.To.LineEnd()) + text := fmt.Sprintf("%d-%d lines are duplicate of %s", + i.From.LineStart(), i.From.LineEnd(), + formatCode(dupl, lintCtx.Cfg)) + res = append(res, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: token.Position{ + Filename: i.From.Filename(), + Line: i.From.LineStart(), + }, + LineRange: &result.Range{ + From: i.From.LineStart(), + To: i.From.LineEnd(), + }, + Text: text, + FromLinter: duplLinterName, + }, pass)) + } + + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() + + return nil, nil } - dupl := fmt.Sprintf("%s:%d-%d", toFilename, i.To.LineStart(), i.To.LineEnd()) - text := fmt.Sprintf("%d-%d lines are duplicate of %s", - i.From.LineStart(), i.From.LineEnd(), - formatCode(dupl, lintCtx.Cfg)) - res = append(res, result.Issue{ - Pos: token.Position{ - Filename: i.From.Filename(), - Line: i.From.LineStart(), - }, - LineRange: &result.Range{ - From: i.From.LineStart(), - To: i.From.LineEnd(), - }, - Text: text, - FromLinter: d.Name(), - }) - } - return res, nil + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/errcheck.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/errcheck.go index bd1d7c3ef73..bf6b9a45348 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/errcheck.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/errcheck.go @@ -2,64 +2,77 @@ package golinters import ( "bufio" - "context" "fmt" "os" "os/user" "path/filepath" "regexp" "strings" + "sync" - errcheckAPI "github.com/golangci/errcheck/golangci" + errcheck "github.com/golangci/errcheck/golangci" "github.com/pkg/errors" + "golang.org/x/tools/go/analysis" "github.com/golangci/golangci-lint/pkg/config" "github.com/golangci/golangci-lint/pkg/fsutils" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Errcheck struct{} - -func (Errcheck) Name() string { - return "errcheck" -} - -func (Errcheck) Desc() string { - return "Errcheck is a program for checking for unchecked errors " + - "in go programs. These unchecked errors can be critical bugs in some cases" -} - -func (e Errcheck) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - errCfg, err := genConfig(&lintCtx.Settings().Errcheck) - if err != nil { - return nil, err - } - issues, err := errcheckAPI.RunWithConfig(lintCtx.Program, errCfg) - if err != nil { - return nil, err - } - - if len(issues) == 0 { - return nil, nil - } - - res := make([]result.Issue, 0, len(issues)) - for _, i := range issues { - var text string - if i.FuncName != "" { - text = fmt.Sprintf("Error return value of %s is not checked", formatCode(i.FuncName, lintCtx.Cfg)) - } else { - text = "Error return value is not checked" +func NewErrcheck() *goanalysis.Linter { + const linterName = "errcheck" + var mu sync.Mutex + var res []goanalysis.Issue + analyzer := &analysis.Analyzer{ + Name: linterName, + Doc: goanalysis.TheOnlyanalyzerDoc, + } + return goanalysis.NewLinter( + linterName, + "Errcheck is a program for checking for unchecked errors "+ + "in go programs. These unchecked errors can be critical bugs in some cases", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + prog := goanalysis.MakeFakeLoaderProgram(pass) + errCfg, err := genConfig(&lintCtx.Settings().Errcheck) + if err != nil { + return nil, err + } + errcheckIssues, err := errcheck.RunWithConfig(prog, errCfg) + if err != nil { + return nil, err + } + + if len(errcheckIssues) == 0 { + return nil, nil + } + + issues := make([]goanalysis.Issue, 0, len(errcheckIssues)) + for _, i := range errcheckIssues { + var text string + if i.FuncName != "" { + text = fmt.Sprintf("Error return value of %s is not checked", formatCode(i.FuncName, lintCtx.Cfg)) + } else { + text = "Error return value is not checked" + } + issues = append(issues, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + FromLinter: linterName, + Text: text, + Pos: i.Pos, + }, pass)) + } + mu.Lock() + res = append(res, issues...) + mu.Unlock() + return nil, nil } - res = append(res, result.Issue{ - FromLinter: e.Name(), - Text: text, - Pos: i.Pos, - }) - } - - return res, nil + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return res + }).WithLoadMode(goanalysis.LoadModeTypesInfo) } // parseIgnoreConfig was taken from errcheck in order to keep the API identical. @@ -91,13 +104,13 @@ func parseIgnoreConfig(s string) (map[string]*regexp.Regexp, error) { return cfg, nil } -func genConfig(errCfg *config.ErrcheckSettings) (*errcheckAPI.Config, error) { +func genConfig(errCfg *config.ErrcheckSettings) (*errcheck.Config, error) { ignoreConfig, err := parseIgnoreConfig(errCfg.Ignore) if err != nil { return nil, errors.Wrap(err, "failed to parse 'ignore' directive") } - c := &errcheckAPI.Config{ + c := &errcheck.Config{ Ignore: ignoreConfig, Blank: errCfg.CheckAssignToBlank, Asserts: errCfg.CheckTypeAssertions, diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/funlen.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/funlen.go index c5768ec36b7..3031da48350 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/funlen.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/funlen.go @@ -1,47 +1,64 @@ package golinters import ( - "context" "go/token" "strings" + "sync" + "github.com/ultraware/funlen" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" - - "github.com/ultraware/funlen" ) -type Funlen struct{} - -func (Funlen) Name() string { - return "funlen" -} +const funlenLinterName = "funlen" -func (Funlen) Desc() string { - return "Tool for detection of long functions" -} +func NewFunlen() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue -func (f Funlen) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - var issues []funlen.Message - for _, file := range lintCtx.ASTCache.GetAllValidFiles() { - issues = append(issues, funlen.Run(file.F, file.Fset, lintCtx.Settings().Funlen.Lines, lintCtx.Settings().Funlen.Statements)...) + analyzer := &analysis.Analyzer{ + Name: funlenLinterName, + Doc: goanalysis.TheOnlyanalyzerDoc, } + return goanalysis.NewLinter( + funlenLinterName, + "Tool for detection of long functions", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var issues []funlen.Message + for _, file := range pass.Files { + fileIssues := funlen.Run(file, pass.Fset, lintCtx.Settings().Funlen.Lines, lintCtx.Settings().Funlen.Statements) + issues = append(issues, fileIssues...) + } - if len(issues) == 0 { - return nil, nil - } + if len(issues) == 0 { + return nil, nil + } - res := make([]result.Issue, len(issues)) - for k, i := range issues { - res[k] = result.Issue{ - Pos: token.Position{ - Filename: i.Pos.Filename, - Line: i.Pos.Line, - }, - Text: strings.TrimRight(i.Message, "\n"), - FromLinter: f.Name(), - } - } + res := make([]goanalysis.Issue, len(issues)) + for k, i := range issues { + res[k] = goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: token.Position{ + Filename: i.Pos.Filename, + Line: i.Pos.Line, + }, + Text: strings.TrimRight(i.Message, "\n"), + FromLinter: funlenLinterName, + }, pass) + } + + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() - return res, nil + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/adapters.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/adapters.go new file mode 100644 index 00000000000..830c4d8822d --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/adapters.go @@ -0,0 +1,36 @@ +package goanalysis + +import ( + "go/types" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/loader" +) + +func MakeFakeLoaderProgram(pass *analysis.Pass) *loader.Program { + prog := &loader.Program{ + Fset: pass.Fset, + Created: []*loader.PackageInfo{ + { + Pkg: pass.Pkg, + Importable: true, // not used + TransitivelyErrorFree: true, // TODO + + Files: pass.Files, + Errors: nil, + Info: *pass.TypesInfo, + }, + }, + AllPackages: map[*types.Package]*loader.PackageInfo{ + pass.Pkg: { + Pkg: pass.Pkg, + Importable: true, + TransitivelyErrorFree: true, + Files: pass.Files, + Errors: nil, + Info: *pass.TypesInfo, + }, + }, + } + return prog +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/interface.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/interface.go deleted file mode 100644 index afe6219d72d..00000000000 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/interface.go +++ /dev/null @@ -1,11 +0,0 @@ -package goanalysis - -import ( - "golang.org/x/tools/go/analysis" -) - -type SupportedLinter interface { - Analyzers() []*analysis.Analyzer - Cfg() map[string]map[string]interface{} - AnalyzerToLinterNameMapping() map[*analysis.Analyzer]string -} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/issue.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/issue.go new file mode 100644 index 00000000000..b90a2912b9a --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/issue.go @@ -0,0 +1,29 @@ +package goanalysis + +import ( + "go/token" + + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/result" +) + +type Issue struct { + result.Issue + Pass *analysis.Pass +} + +func NewIssue(i *result.Issue, pass *analysis.Pass) Issue { + return Issue{ + Issue: *i, + Pass: pass, + } +} + +type EncodingIssue struct { + FromLinter string + Text string + Pos token.Position + LineRange *result.Range + Replacement *result.Replacement +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/linter.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/linter.go index 185fc51cfe3..778a1ef60be 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/linter.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/linter.go @@ -4,34 +4,106 @@ import ( "context" "flag" "fmt" + "runtime" + "sort" "strings" + "sync" + "sync/atomic" + "time" "github.com/pkg/errors" "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/packages" + "github.com/golangci/golangci-lint/internal/pkgcache" "github.com/golangci/golangci-lint/pkg/lint/linter" + "github.com/golangci/golangci-lint/pkg/logutils" + libpackages "github.com/golangci/golangci-lint/pkg/packages" "github.com/golangci/golangci-lint/pkg/result" + "github.com/golangci/golangci-lint/pkg/timeutils" ) +const ( + TheOnlyAnalyzerName = "the_only_name" + TheOnlyanalyzerDoc = "the_only_doc" +) + +type LoadMode int + +const ( + LoadModeNone LoadMode = iota + LoadModeSyntax + LoadModeTypesInfo + LoadModeWholeProgram +) + +var issuesCacheDebugf = logutils.Debug("goanalysis/issues/cache") + +func (loadMode LoadMode) String() string { + switch loadMode { + case LoadModeNone: + return "none" + case LoadModeSyntax: + return "syntax" + case LoadModeTypesInfo: + return "types info" + case LoadModeWholeProgram: + return "whole program" + } + panic(fmt.Sprintf("unknown load mode %d", loadMode)) +} + type Linter struct { - name, desc string - analyzers []*analysis.Analyzer - cfg map[string]map[string]interface{} + name, desc string + analyzers []*analysis.Analyzer + cfg map[string]map[string]interface{} + issuesReporter func(*linter.Context) []Issue + contextSetter func(*linter.Context) + loadMode LoadMode + needUseOriginalPackages bool + isTypecheckModeOn bool } func NewLinter(name, desc string, analyzers []*analysis.Analyzer, cfg map[string]map[string]interface{}) *Linter { return &Linter{name: name, desc: desc, analyzers: analyzers, cfg: cfg} } -func (lnt Linter) Name() string { +func (lnt *Linter) UseOriginalPackages() { + lnt.needUseOriginalPackages = true +} + +func (lnt *Linter) SetTypecheckMode() { + lnt.isTypecheckModeOn = true +} + +func (lnt *Linter) LoadMode() LoadMode { + return lnt.loadMode +} + +func (lnt *Linter) WithLoadMode(loadMode LoadMode) *Linter { + lnt.loadMode = loadMode + return lnt +} + +func (lnt *Linter) WithIssuesReporter(r func(*linter.Context) []Issue) *Linter { + lnt.issuesReporter = r + return lnt +} + +func (lnt *Linter) WithContextSetter(cs func(*linter.Context)) *Linter { + lnt.contextSetter = cs + return lnt +} + +func (lnt *Linter) Name() string { return lnt.name } -func (lnt Linter) Desc() string { +func (lnt *Linter) Desc() string { return lnt.desc } -func (lnt Linter) allAnalyzerNames() []string { +func (lnt *Linter) allAnalyzerNames() []string { var ret []string for _, a := range lnt.analyzers { ret = append(ret, a.Name) @@ -63,7 +135,7 @@ func valueToString(v interface{}) string { return fmt.Sprint(v) } -func (lnt Linter) configureAnalyzer(a *analysis.Analyzer, cfg map[string]interface{}) error { +func (lnt *Linter) configureAnalyzer(a *analysis.Analyzer, cfg map[string]interface{}) error { for k, v := range cfg { f := a.Flags.Lookup(k) if f == nil { @@ -84,7 +156,7 @@ func (lnt Linter) configureAnalyzer(a *analysis.Analyzer, cfg map[string]interfa return nil } -func (lnt Linter) configure() error { +func (lnt *Linter) configure() error { analyzersMap := map[string]*analysis.Analyzer{} for _, a := range lnt.analyzers { analyzersMap[a.Name] = a @@ -105,48 +177,339 @@ func (lnt Linter) configure() error { return nil } -func (lnt Linter) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - if err := analysis.Validate(lnt.analyzers); err != nil { - return nil, errors.Wrap(err, "failed to validate analyzers") - } - - if err := lnt.configure(); err != nil { - return nil, errors.Wrap(err, "failed to configure analyzers") +func parseError(srcErr packages.Error) (*result.Issue, error) { + pos, err := libpackages.ParseErrorPosition(srcErr.Pos) + if err != nil { + return nil, err } - runner := newRunner(lnt.name, lintCtx.Log.Child("goanalysis"), lintCtx.PkgCache, lintCtx.LoadGuard, lintCtx.NeedWholeProgram) + return &result.Issue{ + Pos: *pos, + Text: srcErr.Msg, + FromLinter: "typecheck", + }, nil +} - diags, errs := runner.run(lnt.analyzers, lintCtx.Packages) - // Don't print all errs: they can duplicate. - if len(errs) != 0 { - return nil, errs[0] +func buildIssuesFromErrorsForTypecheckMode(errs []error, lintCtx *linter.Context) ([]result.Issue, error) { + var issues []result.Issue + uniqReportedIssues := map[string]bool{} + for _, err := range errs { + itErr, ok := errors.Cause(err).(*IllTypedError) + if !ok { + return nil, err + } + for _, err := range libpackages.ExtractErrors(itErr.Pkg) { + i, perr := parseError(err) + if perr != nil { // failed to parse + if uniqReportedIssues[err.Msg] { + continue + } + uniqReportedIssues[err.Msg] = true + lintCtx.Log.Errorf("typechecking error: %s", err.Msg) + } else { + i.Pkg = itErr.Pkg // to save to cache later + issues = append(issues, *i) + } + } } + return issues, nil +} +func buildIssues(diags []Diagnostic, linterNameBuilder func(diag *Diagnostic) string) []result.Issue { var issues []result.Issue for i := range diags { diag := &diags[i] + linterName := linterNameBuilder(diag) + var text string + if diag.Analyzer.Name == linterName { + text = diag.Message + } else { + text = fmt.Sprintf("%s: %s", diag.Analyzer.Name, diag.Message) + } issues = append(issues, result.Issue{ - FromLinter: lnt.Name(), - Text: fmt.Sprintf("%s: %s", diag.Analyzer.Name, diag.Message), + FromLinter: linterName, + Text: text, Pos: diag.Position, + Pkg: diag.Pkg, }) } + return issues +} + +func (lnt *Linter) preRun(lintCtx *linter.Context) error { + if err := analysis.Validate(lnt.analyzers); err != nil { + return errors.Wrap(err, "failed to validate analyzers") + } - return issues, nil + if err := lnt.configure(); err != nil { + return errors.Wrap(err, "failed to configure analyzers") + } + + if lnt.contextSetter != nil { + lnt.contextSetter(lintCtx) + } + + return nil +} + +func (lnt *Linter) getName() string { + return lnt.name +} + +func (lnt *Linter) getLinterNameForDiagnostic(*Diagnostic) string { + return lnt.name } -func (lnt Linter) Analyzers() []*analysis.Analyzer { +func (lnt *Linter) getAnalyzers() []*analysis.Analyzer { return lnt.analyzers } -func (lnt Linter) Cfg() map[string]map[string]interface{} { - return lnt.cfg +func (lnt *Linter) useOriginalPackages() bool { + return lnt.needUseOriginalPackages } -func (lnt Linter) AnalyzerToLinterNameMapping() map[*analysis.Analyzer]string { - ret := map[*analysis.Analyzer]string{} - for _, a := range lnt.analyzers { - ret[a] = lnt.Name() +func (lnt *Linter) isTypecheckMode() bool { + return lnt.isTypecheckModeOn +} + +func (lnt *Linter) reportIssues(lintCtx *linter.Context) []Issue { + if lnt.issuesReporter != nil { + return lnt.issuesReporter(lintCtx) } - return ret + return nil +} + +func (lnt *Linter) getLoadMode() LoadMode { + return lnt.loadMode +} + +type runAnalyzersConfig interface { + getName() string + getLinterNameForDiagnostic(*Diagnostic) string + getAnalyzers() []*analysis.Analyzer + useOriginalPackages() bool + isTypecheckMode() bool + reportIssues(*linter.Context) []Issue + getLoadMode() LoadMode +} + +func getIssuesCacheKey(analyzers []*analysis.Analyzer) string { + return "lint/result:" + analyzersHashID(analyzers) +} + +func saveIssuesToCache(allPkgs []*packages.Package, pkgsFromCache map[*packages.Package]bool, + issues []result.Issue, lintCtx *linter.Context, analyzers []*analysis.Analyzer) { + startedAt := time.Now() + perPkgIssues := map[*packages.Package][]result.Issue{} + for ind := range issues { + i := &issues[ind] + perPkgIssues[i.Pkg] = append(perPkgIssues[i.Pkg], *i) + } + + savedIssuesCount := int32(0) + lintResKey := getIssuesCacheKey(analyzers) + + workerCount := runtime.GOMAXPROCS(-1) + var wg sync.WaitGroup + wg.Add(workerCount) + + pkgCh := make(chan *packages.Package, len(allPkgs)) + for i := 0; i < workerCount; i++ { + go func() { + defer wg.Done() + for pkg := range pkgCh { + pkgIssues := perPkgIssues[pkg] + encodedIssues := make([]EncodingIssue, 0, len(pkgIssues)) + for ind := range pkgIssues { + i := &pkgIssues[ind] + encodedIssues = append(encodedIssues, EncodingIssue{ + FromLinter: i.FromLinter, + Text: i.Text, + Pos: i.Pos, + LineRange: i.LineRange, + Replacement: i.Replacement, + }) + } + + atomic.AddInt32(&savedIssuesCount, int32(len(encodedIssues))) + if err := lintCtx.PkgCache.Put(pkg, pkgcache.HashModeNeedAllDeps, lintResKey, encodedIssues); err != nil { + lintCtx.Log.Infof("Failed to save package %s issues (%d) to cache: %s", pkg, len(pkgIssues), err) + } else { + issuesCacheDebugf("Saved package %s issues (%d) to cache", pkg, len(pkgIssues)) + } + } + }() + } + + for _, pkg := range allPkgs { + if pkgsFromCache[pkg] { + continue + } + + pkgCh <- pkg + } + close(pkgCh) + wg.Wait() + + issuesCacheDebugf("Saved %d issues from %d packages to cache in %s", savedIssuesCount, len(allPkgs), time.Since(startedAt)) +} + +//nolint:gocritic +func loadIssuesFromCache(pkgs []*packages.Package, lintCtx *linter.Context, + analyzers []*analysis.Analyzer) ([]result.Issue, map[*packages.Package]bool) { + startedAt := time.Now() + + lintResKey := getIssuesCacheKey(analyzers) + type cacheRes struct { + issues []result.Issue + loadErr error + } + pkgToCacheRes := make(map[*packages.Package]*cacheRes, len(pkgs)) + for _, pkg := range pkgs { + pkgToCacheRes[pkg] = &cacheRes{} + } + + workerCount := runtime.GOMAXPROCS(-1) + var wg sync.WaitGroup + wg.Add(workerCount) + + pkgCh := make(chan *packages.Package, len(pkgs)) + for i := 0; i < workerCount; i++ { + go func() { + defer wg.Done() + for pkg := range pkgCh { + var pkgIssues []EncodingIssue + err := lintCtx.PkgCache.Get(pkg, pkgcache.HashModeNeedAllDeps, lintResKey, &pkgIssues) + cacheRes := pkgToCacheRes[pkg] + cacheRes.loadErr = err + if err != nil { + continue + } + if len(pkgIssues) == 0 { + continue + } + + issues := make([]result.Issue, 0, len(pkgIssues)) + for _, i := range pkgIssues { + issues = append(issues, result.Issue{ + FromLinter: i.FromLinter, + Text: i.Text, + Pos: i.Pos, + LineRange: i.LineRange, + Replacement: i.Replacement, + Pkg: pkg, + }) + } + cacheRes.issues = issues + } + }() + } + + for _, pkg := range pkgs { + pkgCh <- pkg + } + close(pkgCh) + wg.Wait() + + loadedIssuesCount := 0 + var issues []result.Issue + pkgsFromCache := map[*packages.Package]bool{} + for pkg, cacheRes := range pkgToCacheRes { + if cacheRes.loadErr == nil { + loadedIssuesCount += len(cacheRes.issues) + pkgsFromCache[pkg] = true + issues = append(issues, cacheRes.issues...) + issuesCacheDebugf("Loaded package %s issues (%d) from cache", pkg, len(cacheRes.issues)) + } else { + issuesCacheDebugf("Didn't load package %s issues from cache: %s", pkg, cacheRes.loadErr) + } + } + issuesCacheDebugf("Loaded %d issues from cache in %s, analyzing %d/%d packages", + loadedIssuesCount, time.Since(startedAt), len(pkgs)-len(pkgsFromCache), len(pkgs)) + return issues, pkgsFromCache +} + +func runAnalyzers(cfg runAnalyzersConfig, lintCtx *linter.Context) ([]result.Issue, error) { + log := lintCtx.Log.Child("goanalysis") + sw := timeutils.NewStopwatch("analyzers", log) + + const stagesToPrint = 10 + defer sw.PrintTopStages(stagesToPrint) + + runner := newRunner(cfg.getName(), log, lintCtx.PkgCache, lintCtx.LoadGuard, cfg.getLoadMode(), sw) + + pkgs := lintCtx.Packages + if cfg.useOriginalPackages() { + pkgs = lintCtx.OriginalPackages + } + + issues, pkgsFromCache := loadIssuesFromCache(pkgs, lintCtx, cfg.getAnalyzers()) + var pkgsToAnalyze []*packages.Package + for _, pkg := range pkgs { + if !pkgsFromCache[pkg] { + pkgsToAnalyze = append(pkgsToAnalyze, pkg) + } + } + + diags, errs, passToPkg := runner.run(cfg.getAnalyzers(), pkgsToAnalyze) + + defer func() { + if len(errs) == 0 { + // If we try to save to cache even if we have compilation errors + // we won't see them on repeated runs. + saveIssuesToCache(pkgs, pkgsFromCache, issues, lintCtx, cfg.getAnalyzers()) + } + }() + + buildAllIssues := func() []result.Issue { + var retIssues []result.Issue + reportedIssues := cfg.reportIssues(lintCtx) + for i := range reportedIssues { + issue := &reportedIssues[i].Issue + if issue.Pkg == nil { + issue.Pkg = passToPkg[reportedIssues[i].Pass] + } + retIssues = append(retIssues, *issue) + } + retIssues = append(retIssues, buildIssues(diags, cfg.getLinterNameForDiagnostic)...) + return retIssues + } + + if cfg.isTypecheckMode() { + errIssues, err := buildIssuesFromErrorsForTypecheckMode(errs, lintCtx) + if err != nil { + return nil, err + } + + issues = append(issues, errIssues...) + issues = append(issues, buildAllIssues()...) + + return issues, nil + } + + // Don't print all errs: they can duplicate. + if len(errs) != 0 { + return nil, errs[0] + } + + issues = append(issues, buildAllIssues()...) + return issues, nil +} + +func (lnt *Linter) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { + if err := lnt.preRun(lintCtx); err != nil { + return nil, err + } + + return runAnalyzers(lnt, lintCtx) +} + +func analyzersHashID(analyzers []*analysis.Analyzer) string { + names := make([]string, 0, len(analyzers)) + for _, a := range analyzers { + names = append(names, a.Name) + } + + sort.Strings(names) + return strings.Join(names, ",") } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/metalinter.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/metalinter.go index 851303fdedc..5975e2057a1 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/metalinter.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/metalinter.go @@ -2,7 +2,6 @@ package goanalysis import ( "context" - "fmt" "github.com/pkg/errors" "golang.org/x/tools/go/analysis" @@ -16,8 +15,10 @@ type MetaLinter struct { analyzerToLinterName map[*analysis.Analyzer]string } -func NewMetaLinter(linters []*Linter, analyzerToLinterName map[*analysis.Analyzer]string) *MetaLinter { - return &MetaLinter{linters: linters, analyzerToLinterName: analyzerToLinterName} +func NewMetaLinter(linters []*Linter) *MetaLinter { + ml := &MetaLinter{linters: linters} + ml.analyzerToLinterName = ml.getAnalyzerToLinterNameMapping() + return ml } func (ml MetaLinter) Name() string { @@ -28,41 +29,71 @@ func (ml MetaLinter) Desc() string { return "" } -func (ml MetaLinter) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { +func (ml MetaLinter) isTypecheckMode() bool { for _, linter := range ml.linters { - if err := analysis.Validate(linter.analyzers); err != nil { - return nil, errors.Wrapf(err, "failed to validate analyzers of %s", linter.Name()) + if linter.isTypecheckMode() { + return true } } + return false +} +func (ml MetaLinter) getLoadMode() LoadMode { + loadMode := LoadModeNone for _, linter := range ml.linters { - if err := linter.configure(); err != nil { - return nil, errors.Wrapf(err, "failed to configure analyzers of %s", linter.Name()) + if linter.loadMode > loadMode { + loadMode = linter.loadMode } } + return loadMode +} +func (ml MetaLinter) getAnalyzers() []*analysis.Analyzer { var allAnalyzers []*analysis.Analyzer for _, linter := range ml.linters { allAnalyzers = append(allAnalyzers, linter.analyzers...) } + return allAnalyzers +} + +func (ml MetaLinter) getName() string { + return "metalinter" +} - runner := newRunner("metalinter", lintCtx.Log.Child("goanalysis"), lintCtx.PkgCache, lintCtx.LoadGuard, lintCtx.NeedWholeProgram) +func (ml MetaLinter) useOriginalPackages() bool { + return false // `unused` can't be run by this metalinter +} - diags, errs := runner.run(allAnalyzers, lintCtx.Packages) - // Don't print all errs: they can duplicate. - if len(errs) != 0 { - return nil, errs[0] +func (ml MetaLinter) reportIssues(lintCtx *linter.Context) []Issue { + var ret []Issue + for _, lnt := range ml.linters { + if lnt.issuesReporter != nil { + ret = append(ret, lnt.issuesReporter(lintCtx)...) + } } + return ret +} - var issues []result.Issue - for i := range diags { - diag := &diags[i] - issues = append(issues, result.Issue{ - FromLinter: ml.analyzerToLinterName[diag.Analyzer], - Text: fmt.Sprintf("%s: %s", diag.Analyzer, diag.Message), - Pos: diag.Position, - }) +func (ml MetaLinter) getLinterNameForDiagnostic(diag *Diagnostic) string { + return ml.analyzerToLinterName[diag.Analyzer] +} + +func (ml MetaLinter) getAnalyzerToLinterNameMapping() map[*analysis.Analyzer]string { + analyzerToLinterName := map[*analysis.Analyzer]string{} + for _, linter := range ml.linters { + for _, a := range linter.analyzers { + analyzerToLinterName[a] = linter.Name() + } + } + return analyzerToLinterName +} + +func (ml MetaLinter) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { + for _, linter := range ml.linters { + if err := linter.preRun(lintCtx); err != nil { + return nil, errors.Wrapf(err, "failed to pre-run %s", linter.Name()) + } } - return issues, nil + return runAnalyzers(ml, lintCtx) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner.go index 4dee44c86c9..940e005331b 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goanalysis/runner.go @@ -28,20 +28,17 @@ import ( "sync/atomic" "time" - "golang.org/x/tools/go/types/objectpath" - + "github.com/pkg/errors" + "golang.org/x/tools/go/analysis" "golang.org/x/tools/go/gcexportdata" + "golang.org/x/tools/go/packages" + "golang.org/x/tools/go/types/objectpath" "github.com/golangci/golangci-lint/internal/errorutil" "github.com/golangci/golangci-lint/internal/pkgcache" - "github.com/golangci/golangci-lint/pkg/golinters/goanalysis/load" "github.com/golangci/golangci-lint/pkg/logutils" - - "github.com/pkg/errors" - - "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/packages" + "github.com/golangci/golangci-lint/pkg/timeutils" ) var ( @@ -54,9 +51,7 @@ var ( // v show [v]erbose logging // - debugf = logutils.Debug("goanalysis") - isDebug = logutils.HaveDebugTag("goanalysis") - + debugf = logutils.Debug("goanalysis") factsDebugf = logutils.Debug("goanalysis/facts") factsInheritDebugf = logutils.Debug("goanalysis/facts/inherit") factsExportDebugf = logutils.Debug("goanalysis/facts") @@ -75,23 +70,30 @@ type Diagnostic struct { analysis.Diagnostic Analyzer *analysis.Analyzer Position token.Position + Pkg *packages.Package } type runner struct { - log logutils.Log - prefix string // ensure unique analyzer names - pkgCache *pkgcache.Cache - loadGuard *load.Guard - needWholeProgram bool + log logutils.Log + prefix string // ensure unique analyzer names + pkgCache *pkgcache.Cache + loadGuard *load.Guard + loadMode LoadMode + passToPkg map[*analysis.Pass]*packages.Package + passToPkgGuard sync.Mutex + sw *timeutils.Stopwatch } -func newRunner(prefix string, logger logutils.Log, pkgCache *pkgcache.Cache, loadGuard *load.Guard, needWholeProgram bool) *runner { +func newRunner(prefix string, logger logutils.Log, pkgCache *pkgcache.Cache, loadGuard *load.Guard, + loadMode LoadMode, sw *timeutils.Stopwatch) *runner { return &runner{ - prefix: prefix, - log: logger, - pkgCache: pkgCache, - loadGuard: loadGuard, - needWholeProgram: needWholeProgram, + prefix: prefix, + log: logger, + pkgCache: pkgCache, + loadGuard: loadGuard, + loadMode: loadMode, + passToPkg: map[*analysis.Pass]*packages.Package{}, + sw: sw, } } @@ -101,12 +103,119 @@ func newRunner(prefix string, logger logutils.Log, pkgCache *pkgcache.Cache, loa // It provides most of the logic for the main functions of both the // singlechecker and the multi-analysis commands. // It returns the appropriate exit code. -//nolint:gocyclo -func (r *runner) run(analyzers []*analysis.Analyzer, initialPackages []*packages.Package) ([]Diagnostic, []error) { +func (r *runner) run(analyzers []*analysis.Analyzer, initialPackages []*packages.Package) ([]Diagnostic, + []error, map[*analysis.Pass]*packages.Package) { + debugf("Analyzing %d packages on load mode %s", len(initialPackages), r.loadMode) defer r.pkgCache.Trim() roots := r.analyze(initialPackages, analyzers) - return extractDiagnostics(roots) + diags, errs := extractDiagnostics(roots) + return diags, errs, r.passToPkg +} + +type actKey struct { + *analysis.Analyzer + *packages.Package +} + +func (r *runner) markAllActions(a *analysis.Analyzer, pkg *packages.Package, markedActions map[actKey]struct{}) { + k := actKey{a, pkg} + if _, ok := markedActions[k]; ok { + return + } + + for _, req := range a.Requires { + r.markAllActions(req, pkg, markedActions) + } + + if len(a.FactTypes) != 0 { + for path := range pkg.Imports { + r.markAllActions(a, pkg.Imports[path], markedActions) + } + } + + markedActions[k] = struct{}{} +} + +func (r *runner) makeAction(a *analysis.Analyzer, pkg *packages.Package, + initialPkgs map[*packages.Package]bool, actions map[actKey]*action, actAlloc *actionAllocator) *action { + k := actKey{a, pkg} + act, ok := actions[k] + if ok { + return act + } + + act = actAlloc.alloc() + act.a = a + act.pkg = pkg + act.r = r + act.isInitialPkg = initialPkgs[pkg] + act.needAnalyzeSource = initialPkgs[pkg] + act.analysisDoneCh = make(chan struct{}) + + depsCount := len(a.Requires) + if len(a.FactTypes) > 0 { + depsCount += len(pkg.Imports) + } + act.deps = make([]*action, 0, depsCount) + + // Add a dependency on each required analyzers. + for _, req := range a.Requires { + act.deps = append(act.deps, r.makeAction(req, pkg, initialPkgs, actions, actAlloc)) + } + + r.buildActionFactDeps(act, a, pkg, initialPkgs, actions, actAlloc) + + actions[k] = act + return act +} + +func (r *runner) buildActionFactDeps(act *action, a *analysis.Analyzer, pkg *packages.Package, + initialPkgs map[*packages.Package]bool, actions map[actKey]*action, actAlloc *actionAllocator) { + // An analysis that consumes/produces facts + // must run on the package's dependencies too. + if len(a.FactTypes) == 0 { + return + } + + act.objectFacts = make(map[objectFactKey]analysis.Fact) + act.packageFacts = make(map[packageFactKey]analysis.Fact) + + paths := make([]string, 0, len(pkg.Imports)) + for path := range pkg.Imports { + paths = append(paths, path) + } + sort.Strings(paths) // for determinism + for _, path := range paths { + dep := r.makeAction(a, pkg.Imports[path], initialPkgs, actions, actAlloc) + act.deps = append(act.deps, dep) + } + + // Need to register fact types for pkgcache proper gob encoding. + for _, f := range a.FactTypes { + gob.Register(f) + } +} + +type actionAllocator struct { + allocatedActions []action + nextFreeIndex int +} + +func newActionAllocator(maxCount int) *actionAllocator { + return &actionAllocator{ + allocatedActions: make([]action, maxCount), + nextFreeIndex: 0, + } +} + +func (actAlloc *actionAllocator) alloc() *action { + if actAlloc.nextFreeIndex == len(actAlloc.allocatedActions) { + panic(fmt.Sprintf("Made too many allocations of actions: %d allowed", len(actAlloc.allocatedActions))) + } + act := &actAlloc.allocatedActions[actAlloc.nextFreeIndex] + actAlloc.nextFreeIndex++ + return act } //nolint:gocritic @@ -117,70 +226,30 @@ func (r *runner) prepareAnalysis(pkgs []*packages.Package, // Each graph node (action) is one unit of analysis. // Edges express package-to-package (vertical) dependencies, // and analysis-to-analysis (horizontal) dependencies. - type key struct { - *analysis.Analyzer - *packages.Package - } - actions := make(map[key]*action) - initialPkgs := map[*packages.Package]bool{} - for _, pkg := range pkgs { - initialPkgs[pkg] = true + // This place is memory-intensive: e.g. Istio project has 120k total actions. + // Therefore optimize it carefully. + markedActions := make(map[actKey]struct{}, len(analyzers)*len(pkgs)) + for _, a := range analyzers { + for _, pkg := range pkgs { + r.markAllActions(a, pkg, markedActions) + } } + totalActionsCount := len(markedActions) - var mkAction func(a *analysis.Analyzer, pkg *packages.Package) *action - mkAction = func(a *analysis.Analyzer, pkg *packages.Package) *action { - k := key{a, pkg} - act, ok := actions[k] - if !ok { - act = &action{ - a: a, - pkg: pkg, - log: r.log, - prefix: r.prefix, - pkgCache: r.pkgCache, - isInitialPkg: initialPkgs[pkg], - needAnalyzeSource: initialPkgs[pkg], - analysisDoneCh: make(chan struct{}), - objectFacts: make(map[objectFactKey]analysis.Fact), - packageFacts: make(map[packageFactKey]analysis.Fact), - needWholeProgram: r.needWholeProgram, - } - - // Add a dependency on each required analyzers. - for _, req := range a.Requires { - act.deps = append(act.deps, mkAction(req, pkg)) - } - - // An analysis that consumes/produces facts - // must run on the package's dependencies too. - if len(a.FactTypes) > 0 { - paths := make([]string, 0, len(pkg.Imports)) - for path := range pkg.Imports { - paths = append(paths, path) - } - sort.Strings(paths) // for determinism - for _, path := range paths { - dep := mkAction(a, pkg.Imports[path]) - act.deps = append(act.deps, dep) - } + actions := make(map[actKey]*action, totalActionsCount) + actAlloc := newActionAllocator(totalActionsCount) - // Need to register fact types for pkgcache proper gob encoding. - for _, f := range a.FactTypes { - gob.Register(f) - } - } - - actions[k] = act - } - return act + initialPkgs := make(map[*packages.Package]bool, len(pkgs)) + for _, pkg := range pkgs { + initialPkgs[pkg] = true } // Build nodes for initial packages. - var roots []*action + roots := make([]*action, 0, len(pkgs)*len(analyzers)) for _, a := range analyzers { for _, pkg := range pkgs { - root := mkAction(a, pkg) + root := r.makeAction(a, pkg, initialPkgs, actions, actAlloc) root.isroot = true roots = append(roots, root) } @@ -191,6 +260,8 @@ func (r *runner) prepareAnalysis(pkgs []*packages.Package, allActions = append(allActions, act) } + debugf("Built %d actions", len(actions)) + return initialPkgs, allActions, roots } @@ -241,9 +312,9 @@ func (r *runner) analyze(pkgs []*packages.Package, analyzers []*analysis.Analyze debugf("There are %d initial and %d total packages", len(initialPkgs), len(loadingPackages)) for _, lp := range loadingPackages { if lp.isInitial { - wg.Add(1) + wg.Add(1) //nolint:gomnd go func(lp *loadingPackage) { - lp.analyzeRecursive(r.needWholeProgram, loadSem) + lp.analyzeRecursive(r.loadMode, loadSem) wg.Done() }(lp) } @@ -299,7 +370,13 @@ func extractDiagnostics(roots []*action) (retDiags []Diagnostic, retErrors []err } seen[k] = true - retDiags = append(retDiags, Diagnostic{Diagnostic: diag, Analyzer: act.a, Position: posn}) + retDiag := Diagnostic{ + Diagnostic: diag, + Analyzer: act.a, + Position: posn, + Pkg: act.pkg, + } + retDiags = append(retDiags, retDiag) } } } @@ -335,23 +412,19 @@ type action struct { a *analysis.Analyzer pkg *packages.Package pass *analysis.Pass - isroot bool - isInitialPkg bool - needAnalyzeSource bool deps []*action objectFacts map[objectFactKey]analysis.Fact packageFacts map[packageFactKey]analysis.Fact result interface{} diagnostics []analysis.Diagnostic err error - duration time.Duration - log logutils.Log - prefix string - pkgCache *pkgcache.Cache + r *runner analysisDoneCh chan struct{} loadCachedFactsDone bool loadCachedFactsOk bool - needWholeProgram bool + isroot bool + isInitialPkg bool + needAnalyzeSource bool } type objectFactKey struct { @@ -397,6 +470,14 @@ func (act *action) waitUntilDependingAnalyzersWorked() { } } +type IllTypedError struct { + Pkg *packages.Package +} + +func (e *IllTypedError) Error() string { + return fmt.Sprintf("errors in package: %v", e.Pkg.Errors) +} + func (act *action) analyzeSafe() { defer func() { if p := recover(); p != nil { @@ -404,7 +485,9 @@ func (act *action) analyzeSafe() { act.a.Name, act.pkg.Name, act.isInitialPkg, act.needAnalyzeSource, p), debug.Stack()) } }() - act.analyze() + act.r.sw.TrackStage(act.a.Name, func() { + act.analyze() + }) } func (act *action) analyze() { @@ -414,25 +497,8 @@ func (act *action) analyze() { return } - // TODO(adonovan): uncomment this during profiling. - // It won't build pre-go1.11 but conditional compilation - // using build tags isn't warranted. - // - // ctx, task := trace.NewTask(context.Background(), "exec") - // trace.Log(ctx, "pass", act.String()) - // defer task.End() - - // Record time spent in this node but not its dependencies. - // In parallel mode, due to GC/scheduler contention, the - // time is 5x higher than in sequential mode, even with a - // semaphore limiting the number of threads here. - // So use -debug=tp. - if isDebug { - t0 := time.Now() - defer func() { act.duration = time.Since(t0) }() - } defer func(now time.Time) { - analyzeDebugf("go/analysis: %s: %s: analyzed package %q in %s", act.prefix, act.a.Name, act.pkg.Name, time.Since(now)) + analyzeDebugf("go/analysis: %s: %s: analyzed package %q in %s", act.r.prefix, act.a.Name, act.pkg.Name, time.Since(now)) }(time.Now()) // Report an error if any dependency failed. @@ -486,10 +552,16 @@ func (act *action) analyze() { AllPackageFacts: act.allPackageFacts, } act.pass = pass + act.r.passToPkgGuard.Lock() + act.r.passToPkg[pass] = act.pkg + act.r.passToPkgGuard.Unlock() var err error - if act.pkg.IllTyped && !pass.Analyzer.RunDespiteErrors { - err = fmt.Errorf("analysis skipped due to errors in package") + if act.pkg.IllTyped { + // It looks like there should be !pass.Analyzer.RunDespiteErrors + // but govet's cgocall crashes on it. Govet itself contains !pass.Analyzer.RunDespiteErrors condition here + // but it exit before it if packages.Load have failed. + err = errors.Wrap(&IllTypedError{Pkg: act.pkg}, "analysis skipped") } else { startedAt = time.Now() act.result, err = pass.Analyzer.Run(pass) @@ -505,7 +577,7 @@ func (act *action) analyze() { pass.ExportPackageFact = nil if err := act.persistFactsToCache(); err != nil { - act.log.Warnf("Failed to persist facts to cache: %s", err) + act.r.log.Warnf("Failed to persist facts to cache: %s", err) } } @@ -529,7 +601,7 @@ func inheritFacts(act, dep *action) { var err error fact, err = codeFact(fact) if err != nil { - act.log.Panicf("internal error: encoding of %T fact failed in %v", fact, act) + act.r.log.Panicf("internal error: encoding of %T fact failed in %v", fact, act) } } @@ -549,7 +621,7 @@ func inheritFacts(act, dep *action) { var err error fact, err = codeFact(fact) if err != nil { - act.log.Panicf("internal error: encoding of %T fact failed in %v", fact, act) + act.r.log.Panicf("internal error: encoding of %T fact failed in %v", fact, act) } } @@ -626,7 +698,7 @@ func (act *action) importObjectFact(obj types.Object, ptr analysis.Fact) bool { // exportObjectFact implements Pass.ExportObjectFact. func (act *action) exportObjectFact(obj types.Object, fact analysis.Fact) { if obj.Pkg() != act.pkg.Types { - act.log.Panicf("internal error: in analysis %s of package %s: Fact.Set(%s, %T): can't set facts on objects belonging another package", + act.r.log.Panicf("internal error: in analysis %s of package %s: Fact.Set(%s, %T): can't set facts on objects belonging another package", act.a, act.pkg, obj, fact) } @@ -687,7 +759,7 @@ func (act *action) allPackageFacts() []analysis.PackageFact { func (act *action) factType(fact analysis.Fact) reflect.Type { t := reflect.TypeOf(fact) if t.Kind() != reflect.Ptr { - act.log.Fatalf("invalid Fact type: got %T, want pointer", t) + act.r.log.Fatalf("invalid Fact type: got %T, want pointer", t) } return t } @@ -737,15 +809,15 @@ func (act *action) persistFactsToCache() error { factsCacheDebugf("Caching %d facts for package %q and analyzer %s", len(facts), act.pkg.Name, act.a.Name) key := fmt.Sprintf("%s/facts", analyzer.Name) - return act.pkgCache.Put(act.pkg, key, facts) + return act.r.pkgCache.Put(act.pkg, pkgcache.HashModeNeedAllDeps, key, facts) } func (act *action) loadPersistedFacts() bool { var facts []Fact key := fmt.Sprintf("%s/facts", act.a.Name) - if err := act.pkgCache.Get(act.pkg, key, &facts); err != nil { + if err := act.r.pkgCache.Get(act.pkg, pkgcache.HashModeNeedAllDeps, key, &facts); err != nil { if err != pkgcache.ErrMissing { - act.log.Warnf("Failed to get persisted facts: %s", err) + act.r.log.Warnf("Failed to get persisted facts: %s", err) } factsCacheDebugf("No cached facts for package %q and analyzer %s", act.pkg.Name, act.a.Name) @@ -910,36 +982,36 @@ func (lp *loadingPackage) decUse() { lp.actions = nil } -func (lp *loadingPackage) analyzeRecursive(needWholeProgram bool, loadSem chan struct{}) { +func (lp *loadingPackage) analyzeRecursive(loadMode LoadMode, loadSem chan struct{}) { lp.analyzeOnce.Do(func() { // Load the direct dependencies, in parallel. var wg sync.WaitGroup wg.Add(len(lp.imports)) for _, imp := range lp.imports { go func(imp *loadingPackage) { - imp.analyzeRecursive(needWholeProgram, loadSem) + imp.analyzeRecursive(loadMode, loadSem) wg.Done() }(imp) } wg.Wait() - lp.analyze(needWholeProgram, loadSem) + lp.analyze(loadMode, loadSem) }) } -func (lp *loadingPackage) analyze(needWholeProgram bool, loadSem chan struct{}) { +func (lp *loadingPackage) analyze(loadMode LoadMode, loadSem chan struct{}) { loadSem <- struct{}{} defer func() { <-loadSem }() defer func() { - if !needWholeProgram { + if loadMode < LoadModeWholeProgram { // Save memory on unused more fields. lp.decUse() } }() - if err := lp.loadWithFacts(needWholeProgram); err != nil { + if err := lp.loadWithFacts(loadMode); err != nil { werr := errors.Wrapf(err, "failed to load package %s", lp.pkg.Name) // Don't need to write error to errCh, it will be extracted and reported on another layer. // Unblock depending actions and propagate error. @@ -964,9 +1036,32 @@ func (lp *loadingPackage) analyze(needWholeProgram bool, loadSem chan struct{}) actsWg.Wait() } -func (lp *loadingPackage) loadFromSource() error { +func (lp *loadingPackage) loadFromSource(loadMode LoadMode) error { pkg := lp.pkg + // Many packages have few files, much fewer than there + // are CPU cores. Additionally, parsing each individual file is + // very fast. A naive parallel implementation of this loop won't + // be faster, and tends to be slower due to extra scheduling, + // bookkeeping and potentially false sharing of cache lines. + pkg.Syntax = make([]*ast.File, 0, len(pkg.CompiledGoFiles)) + for _, file := range pkg.CompiledGoFiles { + f, err := parser.ParseFile(pkg.Fset, file, nil, parser.ParseComments) + if err != nil { + pkg.Errors = append(pkg.Errors, lp.convertError(err)...) + continue + } + pkg.Syntax = append(pkg.Syntax, f) + } + if len(pkg.Errors) != 0 { + pkg.IllTyped = true + return nil + } + + if loadMode == LoadModeSyntax { + return nil + } + // Call NewPackage directly with explicit name. // This avoids skew between golist and go/types when the files' // package declarations are inconsistent. @@ -979,20 +1074,6 @@ func (lp *loadingPackage) loadFromSource() error { pkg.IllTyped = true - // Many packages have few files, much fewer than there - // are CPU cores. Additionally, parsing each individual file is - // very fast. A naive parallel implementation of this loop won't - // be faster, and tends to be slower due to extra scheduling, - // bookkeeping and potentially false sharing of cache lines. - pkg.Syntax = make([]*ast.File, len(pkg.CompiledGoFiles)) - for i, file := range pkg.CompiledGoFiles { - f, err := parser.ParseFile(pkg.Fset, file, nil, parser.ParseComments) - if err != nil { - pkg.Errors = append(pkg.Errors, lp.convertError(err)...) - return err - } - pkg.Syntax[i] = f - } pkg.TypesInfo = &types.Info{ Types: make(map[ast.Expr]types.TypeAndValue), Defs: make(map[*ast.Ident]types.Object), @@ -1027,11 +1108,19 @@ func (lp *loadingPackage) loadFromSource() error { pkg.Errors = append(pkg.Errors, lp.convertError(err)...) }, } - err := types.NewChecker(tc, pkg.Fset, pkg.Types, pkg.TypesInfo).Files(pkg.Syntax) - if err != nil { - return err + _ = types.NewChecker(tc, pkg.Fset, pkg.Types, pkg.TypesInfo).Files(pkg.Syntax) + // Don't handle error here: errors are adding by tc.Error function. + + illTyped := len(pkg.Errors) != 0 + if !illTyped { + for _, imp := range lp.imports { + if imp.pkg.IllTyped { + illTyped = true + break + } + } } - pkg.IllTyped = false + pkg.IllTyped = illTyped return nil } @@ -1106,30 +1195,30 @@ func (lp *loadingPackage) loadFromExportData() error { return nil } -func (lp *loadingPackage) loadWithFacts(needWholeProgram bool) error { +func (act *action) markDepsForAnalyzingSource() { + // Horizontal deps (analyzer.Requires) must be loaded from source and analyzed before analyzing + // this action. + for _, dep := range act.deps { + if dep.pkg == act.pkg { + // Analyze source only for horizontal dependencies, e.g. from "buildssa". + dep.needAnalyzeSource = true // can't be set in parallel + } + } +} + +func (lp *loadingPackage) loadWithFacts(loadMode LoadMode) error { pkg := lp.pkg if pkg.PkgPath == unsafePkgName { - if !needWholeProgram { // the package wasn't loaded yet - // Fill in the blanks to avoid surprises. + // Fill in the blanks to avoid surprises. + pkg.Syntax = []*ast.File{} + if loadMode >= LoadModeTypesInfo { pkg.Types = types.Unsafe - pkg.Syntax = []*ast.File{} pkg.TypesInfo = new(types.Info) } return nil } - markDepsForAnalyzingSource := func(act *action) { - // Horizontal deps (analyzer.Requires) must be loaded from source and analyzed before analyzing - // this action. - for _, dep := range act.deps { - if dep.pkg == act.pkg { - // Analyze source only for horizontal dependencies, e.g. from "buildssa". - dep.needAnalyzeSource = true // can't be set in parallel - } - } - } - if pkg.TypesInfo != nil { // Already loaded package, e.g. because another not go/analysis linter required types for deps. // Try load cached facts for it. @@ -1139,7 +1228,7 @@ func (lp *loadingPackage) loadWithFacts(needWholeProgram bool) error { // Cached facts loading failed: analyze later the action from source. act.needAnalyzeSource = true factsCacheDebugf("Loading of facts for already loaded %s failed, analyze it from source later", act) - markDepsForAnalyzingSource(act) + act.markDepsForAnalyzingSource() } } return nil @@ -1148,32 +1237,40 @@ func (lp *loadingPackage) loadWithFacts(needWholeProgram bool) error { if lp.isInitial { // No need to load cached facts: the package will be analyzed from source // because it's the initial. - return lp.loadFromSource() + return lp.loadFromSource(loadMode) } - // Load package from export data - if err := lp.loadFromExportData(); err != nil { - // We asked Go to give us up to date export data, yet - // we can't load it. There must be something wrong. - // - // Attempt loading from source. This should fail (because - // otherwise there would be export data); we just want to - // get the compile errors. If loading from source succeeds - // we discard the result, anyway. Otherwise we'll fail - // when trying to reload from export data later. + return lp.loadImportedPackageWithFacts(loadMode) +} - // Otherwise it panics because uses already existing (from exported data) types. - pkg.Types = types.NewPackage(pkg.PkgPath, pkg.Name) - if srcErr := lp.loadFromSource(); srcErr != nil { - return srcErr +func (lp *loadingPackage) loadImportedPackageWithFacts(loadMode LoadMode) error { + pkg := lp.pkg + + // Load package from export data + if loadMode >= LoadModeTypesInfo { + if err := lp.loadFromExportData(); err != nil { + // We asked Go to give us up to date export data, yet + // we can't load it. There must be something wrong. + // + // Attempt loading from source. This should fail (because + // otherwise there would be export data); we just want to + // get the compile errors. If loading from source succeeds + // we discard the result, anyway. Otherwise we'll fail + // when trying to reload from export data later. + + // Otherwise it panics because uses already existing (from exported data) types. + pkg.Types = types.NewPackage(pkg.PkgPath, pkg.Name) + if srcErr := lp.loadFromSource(loadMode); srcErr != nil { + return srcErr + } + // Make sure this package can't be imported successfully + pkg.Errors = append(pkg.Errors, packages.Error{ + Pos: "-", + Msg: fmt.Sprintf("could not load export data: %s", err), + Kind: packages.ParseError, + }) + return errors.Wrap(err, "could not load export data") } - // Make sure this package can't be imported successfully - pkg.Errors = append(pkg.Errors, packages.Error{ - Pos: "-", - Msg: fmt.Sprintf("could not load export data: %s", err), - Kind: packages.ParseError, - }) - return errors.Wrap(err, "could not load export data") } needLoadFromSource := false @@ -1187,7 +1284,7 @@ func (lp *loadingPackage) loadWithFacts(needWholeProgram bool) error { act.needAnalyzeSource = true // can't be set in parallel needLoadFromSource = true - markDepsForAnalyzingSource(act) + act.markDepsForAnalyzingSource() } if needLoadFromSource { @@ -1195,8 +1292,10 @@ func (lp *loadingPackage) loadWithFacts(needWholeProgram bool) error { // the analysis we need to load the package from source code. // Otherwise it panics because uses already existing (from exported data) types. - pkg.Types = types.NewPackage(pkg.PkgPath, pkg.Name) - return lp.loadFromSource() + if loadMode >= LoadModeTypesInfo { + pkg.Types = types.NewPackage(pkg.PkgPath, pkg.Name) + } + return lp.loadFromSource(loadMode) } return nil diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gochecknoglobals.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gochecknoglobals.go index c1a67ad7c64..f2166416be3 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gochecknoglobals.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gochecknoglobals.go @@ -1,36 +1,59 @@ package golinters import ( - "context" "fmt" "go/ast" "go/token" "strings" + "sync" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Gochecknoglobals struct{} +const gochecknoglobalsName = "gochecknoglobals" -func (Gochecknoglobals) Name() string { - return "gochecknoglobals" -} +//nolint:dupl +func NewGochecknoglobals() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue -func (Gochecknoglobals) Desc() string { - return "Checks that no globals are present in Go code" -} + analyzer := &analysis.Analyzer{ + Name: gochecknoglobalsName, + Doc: goanalysis.TheOnlyanalyzerDoc, + Run: func(pass *analysis.Pass) (interface{}, error) { + var res []goanalysis.Issue + for _, file := range pass.Files { + fileIssues := checkFileForGlobals(file, pass.Fset) + for i := range fileIssues { + res = append(res, goanalysis.NewIssue(&fileIssues[i], pass)) + } + } + if len(res) == 0 { + return nil, nil + } -func (lint Gochecknoglobals) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - var res []result.Issue - for _, f := range lintCtx.ASTCache.GetAllValidFiles() { - res = append(res, lint.checkFile(f.F, f.Fset)...) - } + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() - return res, nil + return nil, nil + }, + } + return goanalysis.NewLinter( + gochecknoglobalsName, + "Checks that no globals are present in Go code", + []*analysis.Analyzer{analyzer}, + nil, + ).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) } -func (lint Gochecknoglobals) checkFile(f *ast.File, fset *token.FileSet) []result.Issue { +func checkFileForGlobals(f *ast.File, fset *token.FileSet) []result.Issue { var res []result.Issue for _, decl := range f.Decls { genDecl, ok := decl.(*ast.GenDecl) @@ -51,7 +74,7 @@ func (lint Gochecknoglobals) checkFile(f *ast.File, fset *token.FileSet) []resul res = append(res, result.Issue{ Pos: fset.Position(vn.Pos()), Text: fmt.Sprintf("%s is a global variable", formatCode(vn.Name, nil)), - FromLinter: lint.Name(), + FromLinter: gochecknoglobalsName, }) } } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gochecknoinits.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gochecknoinits.go index 6cd74decfd9..18465b13068 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gochecknoinits.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gochecknoinits.go @@ -1,35 +1,58 @@ package golinters import ( - "context" "fmt" "go/ast" "go/token" + "sync" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Gochecknoinits struct{} +const gochecknoinitsName = "gochecknoinits" -func (Gochecknoinits) Name() string { - return "gochecknoinits" -} +//nolint:dupl +func NewGochecknoinits() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue -func (Gochecknoinits) Desc() string { - return "Checks that no init functions are present in Go code" -} + analyzer := &analysis.Analyzer{ + Name: gochecknoinitsName, + Doc: goanalysis.TheOnlyanalyzerDoc, + Run: func(pass *analysis.Pass) (interface{}, error) { + var res []goanalysis.Issue + for _, file := range pass.Files { + fileIssues := checkFileForInits(file, pass.Fset) + for i := range fileIssues { + res = append(res, goanalysis.NewIssue(&fileIssues[i], pass)) + } + } + if len(res) == 0 { + return nil, nil + } -func (lint Gochecknoinits) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - var res []result.Issue - for _, f := range lintCtx.ASTCache.GetAllValidFiles() { - res = append(res, lint.checkFile(f.F, f.Fset)...) - } + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() - return res, nil + return nil, nil + }, + } + return goanalysis.NewLinter( + gochecknoinitsName, + "Checks that no init functions are present in Go code", + []*analysis.Analyzer{analyzer}, + nil, + ).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) } -func (lint Gochecknoinits) checkFile(f *ast.File, fset *token.FileSet) []result.Issue { +func checkFileForInits(f *ast.File, fset *token.FileSet) []result.Issue { var res []result.Issue for _, decl := range f.Decls { funcDecl, ok := decl.(*ast.FuncDecl) @@ -42,7 +65,7 @@ func (lint Gochecknoinits) checkFile(f *ast.File, fset *token.FileSet) []result. res = append(res, result.Issue{ Pos: fset.Position(funcDecl.Pos()), Text: fmt.Sprintf("don't use %s function", formatCode(name, nil)), - FromLinter: lint.Name(), + FromLinter: gochecknoinitsName, }) } } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocognit.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocognit.go new file mode 100644 index 00000000000..71301180874 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocognit.go @@ -0,0 +1,69 @@ +// nolint:dupl +package golinters + +import ( + "fmt" + "sort" + "sync" + + "github.com/uudashr/gocognit" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" + "github.com/golangci/golangci-lint/pkg/lint/linter" + "github.com/golangci/golangci-lint/pkg/result" +) + +const gocognitName = "gocognit" + +func NewGocognit() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue + + analyzer := &analysis.Analyzer{ + Name: goanalysis.TheOnlyAnalyzerName, + Doc: goanalysis.TheOnlyanalyzerDoc, + } + return goanalysis.NewLinter( + gocognitName, + "Computes and checks the cognitive complexity of functions", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var stats []gocognit.Stat + for _, f := range pass.Files { + stats = gocognit.ComplexityStats(f, pass.Fset, stats) + } + if len(stats) == 0 { + return nil, nil + } + + sort.Slice(stats, func(i, j int) bool { + return stats[i].Complexity > stats[j].Complexity + }) + + res := make([]goanalysis.Issue, 0, len(stats)) + for _, s := range stats { + if s.Complexity <= lintCtx.Settings().Gocognit.MinComplexity { + break // Break as the stats is already sorted from greatest to least + } + + res = append(res, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: s.Pos, + Text: fmt.Sprintf("cognitive complexity %d of func %s is high (> %d)", + s.Complexity, formatCode(s.FuncName, lintCtx.Cfg), lintCtx.Settings().Gocognit.MinComplexity), + FromLinter: gocognitName, + }, pass)) + } + + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() + + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goconst.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goconst.go index 87011df9d27..c77dc64e839 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goconst.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goconst.go @@ -1,50 +1,67 @@ package golinters import ( - "context" "fmt" + "sync" goconstAPI "github.com/golangci/goconst" + "golang.org/x/tools/go/analysis" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Goconst struct{} +const goconstName = "goconst" -func (Goconst) Name() string { - return "goconst" -} +func NewGoconst() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue + + analyzer := &analysis.Analyzer{ + Name: goconstName, + Doc: goanalysis.TheOnlyanalyzerDoc, + } + return goanalysis.NewLinter( + goconstName, + "Finds repeated strings that could be replaced by a constant", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + issues, err := checkConstants(pass, lintCtx) + if err != nil || len(issues) == 0 { + return nil, err + } -func (Goconst) Desc() string { - return "Finds repeated strings that could be replaced by a constant" + mu.Lock() + resIssues = append(resIssues, issues...) + mu.Unlock() + + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) } -func (lint Goconst) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - var goconstIssues []goconstAPI.Issue +func checkConstants(pass *analysis.Pass, lintCtx *linter.Context) ([]goanalysis.Issue, error) { cfg := goconstAPI.Config{ MatchWithConstants: true, MinStringLength: lintCtx.Settings().Goconst.MinStringLen, MinOccurrences: lintCtx.Settings().Goconst.MinOccurrencesCount, } - for _, pkg := range lintCtx.Packages { - files, fset, err := getASTFilesForGoPkg(lintCtx, pkg) - if err != nil { - return nil, err - } - - issues, err := goconstAPI.Run(files, fset, &cfg) - if err != nil { - return nil, err - } - goconstIssues = append(goconstIssues, issues...) + goconstIssues, err := goconstAPI.Run(pass.Files, pass.Fset, &cfg) + if err != nil { + return nil, err } + if len(goconstIssues) == 0 { return nil, nil } - res := make([]result.Issue, 0, len(goconstIssues)) + res := make([]goanalysis.Issue, 0, len(goconstIssues)) for _, i := range goconstIssues { textBegin := fmt.Sprintf("string %s has %d occurrences", formatCode(i.Str, lintCtx.Cfg), i.OccurencesCount) var textEnd string @@ -53,11 +70,11 @@ func (lint Goconst) Run(ctx context.Context, lintCtx *linter.Context) ([]result. } else { textEnd = fmt.Sprintf(", but such constant %s already exists", formatCode(i.MatchingConst, lintCtx.Cfg)) } - res = append(res, result.Issue{ + res = append(res, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint Pos: i.Pos, Text: textBegin + textEnd, - FromLinter: lint.Name(), - }) + FromLinter: goconstName, + }, pass)) } return res, nil diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocritic.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocritic.go index ccb5721f170..fb29252096b 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocritic.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocritic.go @@ -1,37 +1,71 @@ package golinters import ( - "context" "fmt" "go/ast" "go/types" "path/filepath" "runtime" - "runtime/debug" "sort" "strings" "sync" - "github.com/golangci/golangci-lint/pkg/config" - "github.com/go-lintpack/lintpack" - "golang.org/x/tools/go/loader" + "golang.org/x/tools/go/analysis" + "github.com/golangci/golangci-lint/pkg/config" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Gocritic struct{} +const gocriticName = "gocritic" -func (Gocritic) Name() string { - return "gocritic" -} +func NewGocritic() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue + + sizes := types.SizesFor("gc", runtime.GOARCH) + + analyzer := &analysis.Analyzer{ + Name: gocriticName, + Doc: goanalysis.TheOnlyanalyzerDoc, + } + return goanalysis.NewLinter( + gocriticName, + "The most opinionated Go source code linter", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + lintpackCtx := lintpack.NewContext(pass.Fset, sizes) + enabledCheckers, err := buildEnabledCheckers(lintCtx, lintpackCtx) + if err != nil { + return nil, err + } + + lintpackCtx.SetPackageInfo(pass.TypesInfo, pass.Pkg) + var res []goanalysis.Issue + pkgIssues := runGocriticOnPackage(lintpackCtx, enabledCheckers, pass.Files) + for i := range pkgIssues { + res = append(res, goanalysis.NewIssue(&pkgIssues[i], pass)) + } + if len(res) == 0 { + return nil, nil + } -func (Gocritic) Desc() string { - return "The most opinionated Go source code linter" + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() + + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeTypesInfo) } -func (Gocritic) normalizeCheckerInfoParams(info *lintpack.CheckerInfo) lintpack.CheckerParams { +func normalizeCheckerInfoParams(info *lintpack.CheckerInfo) lintpack.CheckerParams { // lowercase info param keys here because golangci-lint's config parser lowercases all strings ret := lintpack.CheckerParams{} for k, v := range info.Params { @@ -41,13 +75,13 @@ func (Gocritic) normalizeCheckerInfoParams(info *lintpack.CheckerInfo) lintpack. return ret } -func (lint Gocritic) configureCheckerInfo(info *lintpack.CheckerInfo, allParams map[string]config.GocriticCheckSettings) error { +func configureCheckerInfo(info *lintpack.CheckerInfo, allParams map[string]config.GocriticCheckSettings) error { params := allParams[strings.ToLower(info.Name)] if params == nil { // no config for this checker return nil } - infoParams := lint.normalizeCheckerInfoParams(info) + infoParams := normalizeCheckerInfoParams(info) for k, p := range params { v, ok := infoParams[k] if ok { @@ -74,7 +108,7 @@ func (lint Gocritic) configureCheckerInfo(info *lintpack.CheckerInfo, allParams return nil } -func (lint Gocritic) buildEnabledCheckers(lintCtx *linter.Context, lintpackCtx *lintpack.Context) ([]*lintpack.Checker, error) { +func buildEnabledCheckers(lintCtx *linter.Context, lintpackCtx *lintpack.Context) ([]*lintpack.Checker, error) { s := lintCtx.Settings().Gocritic allParams := s.GetLowercasedParams() @@ -84,7 +118,7 @@ func (lint Gocritic) buildEnabledCheckers(lintCtx *linter.Context, lintpackCtx * continue } - if err := lint.configureCheckerInfo(info, allParams); err != nil { + if err := configureCheckerInfo(info, allParams); err != nil { return nil, err } @@ -95,73 +129,34 @@ func (lint Gocritic) buildEnabledCheckers(lintCtx *linter.Context, lintpackCtx * return enabledCheckers, nil } -func (lint Gocritic) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - sizes := types.SizesFor("gc", runtime.GOARCH) - lintpackCtx := lintpack.NewContext(lintCtx.Program.Fset, sizes) - - enabledCheckers, err := lint.buildEnabledCheckers(lintCtx, lintpackCtx) - if err != nil { - return nil, err - } - - issuesCh := make(chan result.Issue, 1024) - var panicErr error - go func() { - defer func() { - if err := recover(); err != nil { - panicErr = fmt.Errorf("panic occurred: %s", err) - lintCtx.Log.Warnf("Panic: %s", debug.Stack()) - } - }() - - for _, pkgInfo := range lintCtx.Program.InitialPackages() { - lintpackCtx.SetPackageInfo(&pkgInfo.Info, pkgInfo.Pkg) - lint.runOnPackage(lintpackCtx, enabledCheckers, pkgInfo, issuesCh) - } - close(issuesCh) - }() - +func runGocriticOnPackage(lintpackCtx *lintpack.Context, checkers []*lintpack.Checker, + files []*ast.File) []result.Issue { var res []result.Issue - for i := range issuesCh { - res = append(res, i) - } - if panicErr != nil { - return nil, panicErr - } - - return res, nil -} - -func (lint Gocritic) runOnPackage(lintpackCtx *lintpack.Context, checkers []*lintpack.Checker, - pkgInfo *loader.PackageInfo, ret chan<- result.Issue) { - for _, f := range pkgInfo.Files { + for _, f := range files { filename := filepath.Base(lintpackCtx.FileSet.Position(f.Pos()).Filename) lintpackCtx.SetFileInfo(filename, f) - lint.runOnFile(lintpackCtx, f, checkers, ret) + issues := runGocriticOnFile(lintpackCtx, f, checkers) + res = append(res, issues...) } + return res } -func (lint Gocritic) runOnFile(ctx *lintpack.Context, f *ast.File, checkers []*lintpack.Checker, - ret chan<- result.Issue) { - var wg sync.WaitGroup - wg.Add(len(checkers)) +func runGocriticOnFile(ctx *lintpack.Context, f *ast.File, checkers []*lintpack.Checker) []result.Issue { + var res []result.Issue + for _, c := range checkers { // All checkers are expected to use *lint.Context // as read-only structure, so no copying is required. - go func(c *lintpack.Checker) { - defer wg.Done() - - for _, warn := range c.Check(f) { - pos := ctx.FileSet.Position(warn.Node.Pos()) - ret <- result.Issue{ - Pos: pos, - Text: fmt.Sprintf("%s: %s", c.Info.Name, warn.Text), - FromLinter: lint.Name(), - } - } - }(c) + for _, warn := range c.Check(f) { + pos := ctx.FileSet.Position(warn.Node.Pos()) + res = append(res, result.Issue{ + Pos: pos, + Text: fmt.Sprintf("%s: %s", c.Info.Name, warn.Text), + FromLinter: gocriticName, + }) + } } - wg.Wait() + return res } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocyclo.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocyclo.go index 68811caf1ac..4fb288989be 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocyclo.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gocyclo.go @@ -1,52 +1,69 @@ +// nolint:dupl package golinters import ( - "context" "fmt" "sort" + "sync" gocycloAPI "github.com/golangci/gocyclo/pkg/gocyclo" + "golang.org/x/tools/go/analysis" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Gocyclo struct{} +const gocycloName = "gocyclo" -func (Gocyclo) Name() string { - return "gocyclo" -} - -func (Gocyclo) Desc() string { - return "Computes and checks the cyclomatic complexity of functions" -} +func NewGocyclo() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue -func (g Gocyclo) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - var stats []gocycloAPI.Stat - for _, f := range lintCtx.ASTCache.GetAllValidFiles() { - stats = gocycloAPI.BuildStats(f.F, f.Fset, stats) - } - if len(stats) == 0 { - return nil, nil + analyzer := &analysis.Analyzer{ + Name: gocycloName, + Doc: goanalysis.TheOnlyanalyzerDoc, } + return goanalysis.NewLinter( + gocycloName, + "Computes and checks the cyclomatic complexity of functions", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var stats []gocycloAPI.Stat + for _, f := range pass.Files { + stats = gocycloAPI.BuildStats(f, pass.Fset, stats) + } + if len(stats) == 0 { + return nil, nil + } - sort.Slice(stats, func(i, j int) bool { - return stats[i].Complexity > stats[j].Complexity - }) + sort.Slice(stats, func(i, j int) bool { + return stats[i].Complexity > stats[j].Complexity + }) - res := make([]result.Issue, 0, len(stats)) - for _, s := range stats { - if s.Complexity <= lintCtx.Settings().Gocyclo.MinComplexity { - break // Break as the stats is already sorted from greatest to least - } + res := make([]goanalysis.Issue, 0, len(stats)) + for _, s := range stats { + if s.Complexity <= lintCtx.Settings().Gocyclo.MinComplexity { + break // Break as the stats is already sorted from greatest to least + } - res = append(res, result.Issue{ - Pos: s.Pos, - Text: fmt.Sprintf("cyclomatic complexity %d of func %s is high (> %d)", - s.Complexity, formatCode(s.FuncName, lintCtx.Cfg), lintCtx.Settings().Gocyclo.MinComplexity), - FromLinter: g.Name(), - }) - } + res = append(res, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: s.Pos, + Text: fmt.Sprintf("cyclomatic complexity %d of func %s is high (> %d)", + s.Complexity, formatCode(s.FuncName, lintCtx.Cfg), lintCtx.Settings().Gocyclo.MinComplexity), + FromLinter: gocycloName, + }, pass)) + } - return res, nil + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() + + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/godox.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/godox.go index 3a8e3518e26..78d13f3bd4c 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/godox.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/godox.go @@ -1,46 +1,63 @@ package golinters import ( - "context" "go/token" "strings" + "sync" + "github.com/matoous/godox" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" - - "github.com/matoous/godox" ) -type Godox struct{} +const godoxName = "godox" -func (Godox) Name() string { - return "godox" -} +func NewGodox() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue -func (Godox) Desc() string { - return "Tool for detection of FIXME, TODO and other comment keywords" -} - -func (f Godox) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - var issues []godox.Message - for _, file := range lintCtx.ASTCache.GetAllValidFiles() { - issues = append(issues, godox.Run(file.F, file.Fset, lintCtx.Settings().Godox.Keywords...)...) - } - - if len(issues) == 0 { - return nil, nil + analyzer := &analysis.Analyzer{ + Name: godoxName, + Doc: goanalysis.TheOnlyanalyzerDoc, } - - res := make([]result.Issue, len(issues)) - for k, i := range issues { - res[k] = result.Issue{ - Pos: token.Position{ - Filename: i.Pos.Filename, - Line: i.Pos.Line, - }, - Text: strings.TrimRight(i.Message, "\n"), - FromLinter: f.Name(), + return goanalysis.NewLinter( + godoxName, + "Tool for detection of FIXME, TODO and other comment keywords", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var issues []godox.Message + for _, file := range pass.Files { + issues = append(issues, godox.Run(file, pass.Fset, lintCtx.Settings().Godox.Keywords...)...) + } + + if len(issues) == 0 { + return nil, nil + } + + res := make([]goanalysis.Issue, len(issues)) + for k, i := range issues { + res[k] = goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: token.Position{ + Filename: i.Pos.Filename, + Line: i.Pos.Line, + }, + Text: strings.TrimRight(i.Message, "\n"), + FromLinter: godoxName, + }, pass) + } + + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() + + return nil, nil } - } - return res, nil + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt.go index ab46e92538a..e71f27bb171 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt.go @@ -1,318 +1,72 @@ package golinters import ( - "bytes" - "context" - "fmt" - "go/token" - "strings" + "sync" gofmtAPI "github.com/golangci/gofmt/gofmt" - goimportsAPI "github.com/golangci/gofmt/goimports" "github.com/pkg/errors" - diffpkg "github.com/sourcegraph/go-diff/diff" - "golang.org/x/tools/imports" + "golang.org/x/tools/go/analysis" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" - "github.com/golangci/golangci-lint/pkg/logutils" - "github.com/golangci/golangci-lint/pkg/result" ) -type Gofmt struct { - UseGoimports bool -} - -func (g Gofmt) Name() string { - if g.UseGoimports { - return "goimports" - } +const gofmtName = "gofmt" - return "gofmt" -} +func NewGofmt() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue -func (g Gofmt) Desc() string { - if g.UseGoimports { - return "Goimports does everything that gofmt does. Additionally it checks unused imports" + analyzer := &analysis.Analyzer{ + Name: gofmtName, + Doc: goanalysis.TheOnlyanalyzerDoc, } - - return "Gofmt checks whether code was gofmt-ed. By default " + - "this tool runs with -s option to check for code simplification" -} - -type Change struct { - LineRange result.Range - Replacement result.Replacement -} - -type diffLineType string - -const ( - diffLineAdded diffLineType = "added" - diffLineOriginal diffLineType = "original" - diffLineDeleted diffLineType = "deleted" -) - -type diffLine struct { - originalNumber int // 1-based original line number - typ diffLineType - data string // "+" or "-" stripped line -} - -type hunkChangesParser struct { - // needed because we merge currently added lines with the last original line - lastOriginalLine *diffLine - - // if the first line of diff is an adding we save all additions to replacementLinesToPrepend - replacementLinesToPrepend []string - - log logutils.Log - - lines []diffLine - - ret []Change -} - -func (p *hunkChangesParser) parseDiffLines(h *diffpkg.Hunk) { - lines := bytes.Split(h.Body, []byte{'\n'}) - currentOriginalLineNumer := int(h.OrigStartLine) - var ret []diffLine - - for i, line := range lines { - dl := diffLine{ - originalNumber: currentOriginalLineNumer, - } - - lineStr := string(line) - - //nolint:gocritic - if strings.HasPrefix(lineStr, "-") { - dl.typ = diffLineDeleted - dl.data = strings.TrimPrefix(lineStr, "-") - currentOriginalLineNumer++ - } else if strings.HasPrefix(lineStr, "+") { - dl.typ = diffLineAdded - dl.data = strings.TrimPrefix(lineStr, "+") - } else { - if i == len(lines)-1 && lineStr == "" { - // handle last \n: don't add an empty original line - break + return goanalysis.NewLinter( + gofmtName, + "Gofmt checks whether code was gofmt-ed. By default "+ + "this tool runs with -s option to check for code simplification", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var fileNames []string + for _, f := range pass.Files { + pos := pass.Fset.Position(f.Pos()) + fileNames = append(fileNames, pos.Filename) } - dl.typ = diffLineOriginal - dl.data = strings.TrimPrefix(lineStr, " ") - currentOriginalLineNumer++ - } - - ret = append(ret, dl) - } - - p.lines = ret -} - -func (p *hunkChangesParser) handleOriginalLine(line diffLine, i *int) { - if len(p.replacementLinesToPrepend) == 0 { - p.lastOriginalLine = &line - *i++ - return - } - - // check following added lines for the case: - // + added line 1 - // original line - // + added line 2 - - *i++ - var followingAddedLines []string - for ; *i < len(p.lines) && p.lines[*i].typ == diffLineAdded; *i++ { - followingAddedLines = append(followingAddedLines, p.lines[*i].data) - } - - p.ret = append(p.ret, Change{ - LineRange: result.Range{ - From: line.originalNumber, - To: line.originalNumber, - }, - Replacement: result.Replacement{ - NewLines: append(p.replacementLinesToPrepend, append([]string{line.data}, followingAddedLines...)...), - }, - }) - p.replacementLinesToPrepend = nil - p.lastOriginalLine = &line -} - -func (p *hunkChangesParser) handleDeletedLines(deletedLines []diffLine, addedLines []string) { - change := Change{ - LineRange: result.Range{ - From: deletedLines[0].originalNumber, - To: deletedLines[len(deletedLines)-1].originalNumber, - }, - } - - if len(addedLines) != 0 { - //nolint:gocritic - change.Replacement.NewLines = append(p.replacementLinesToPrepend, addedLines...) - if len(p.replacementLinesToPrepend) != 0 { - p.replacementLinesToPrepend = nil - } - - p.ret = append(p.ret, change) - return - } - - // delete-only change with possible prepending - if len(p.replacementLinesToPrepend) != 0 { - change.Replacement.NewLines = p.replacementLinesToPrepend - p.replacementLinesToPrepend = nil - } else { - change.Replacement.NeedOnlyDelete = true - } + var issues []goanalysis.Issue - p.ret = append(p.ret, change) -} - -func (p *hunkChangesParser) handleAddedOnlyLines(addedLines []string) { - if p.lastOriginalLine == nil { - // the first line is added; the diff looks like: - // 1. + ... - // 2. - ... - // or - // 1. + ... - // 2. ... - - p.replacementLinesToPrepend = addedLines - return - } - - // add-only change merged into the last original line with possible prepending - p.ret = append(p.ret, Change{ - LineRange: result.Range{ - From: p.lastOriginalLine.originalNumber, - To: p.lastOriginalLine.originalNumber, - }, - Replacement: result.Replacement{ - NewLines: append(p.replacementLinesToPrepend, append([]string{p.lastOriginalLine.data}, addedLines...)...), - }, - }) - p.replacementLinesToPrepend = nil -} - -func (p *hunkChangesParser) parse(h *diffpkg.Hunk) []Change { - p.parseDiffLines(h) - - for i := 0; i < len(p.lines); { - line := p.lines[i] - if line.typ == diffLineOriginal { - p.handleOriginalLine(line, &i) //nolint:scopelint - continue - } - - var deletedLines []diffLine - for ; i < len(p.lines) && p.lines[i].typ == diffLineDeleted; i++ { - deletedLines = append(deletedLines, p.lines[i]) - } - - var addedLines []string - for ; i < len(p.lines) && p.lines[i].typ == diffLineAdded; i++ { - addedLines = append(addedLines, p.lines[i].data) - } - - if len(deletedLines) != 0 { - p.handleDeletedLines(deletedLines, addedLines) - continue - } - - // no deletions, only addings - p.handleAddedOnlyLines(addedLines) - } - - if len(p.replacementLinesToPrepend) != 0 { - p.log.Infof("The diff contains only additions: no original or deleted lines: %#v", p.lines) - return nil - } - - return p.ret -} - -func (g Gofmt) extractIssuesFromPatch(patch string, log logutils.Log, lintCtx *linter.Context) ([]result.Issue, error) { - diffs, err := diffpkg.ParseMultiFileDiff([]byte(patch)) - if err != nil { - return nil, errors.Wrap(err, "can't parse patch") - } - - if len(diffs) == 0 { - return nil, fmt.Errorf("got no diffs from patch parser: %v", diffs) - } - - issues := []result.Issue{} - for _, d := range diffs { - if len(d.Hunks) == 0 { - log.Warnf("Got no hunks in diff %+v", d) - continue - } - - for _, hunk := range d.Hunks { - var text string - if g.UseGoimports { - text = "File is not `goimports`-ed" - } else { - text = "File is not `gofmt`-ed" - if lintCtx.Settings().Gofmt.Simplify { - text += " with `-s`" + for _, f := range fileNames { + diff, err := gofmtAPI.Run(f, lintCtx.Settings().Gofmt.Simplify) + if err != nil { // TODO: skip + return nil, err } - } - p := hunkChangesParser{ - log: log, - } - changes := p.parse(hunk) - for _, change := range changes { - change := change // fix scope - i := result.Issue{ - FromLinter: g.Name(), - Pos: token.Position{ - Filename: d.NewName, - Line: change.LineRange.From, - }, - Text: text, - Replacement: &change.Replacement, + if diff == nil { + continue } - if change.LineRange.From != change.LineRange.To { - i.LineRange = &change.LineRange + + is, err := extractIssuesFromPatch(string(diff), lintCtx.Log, lintCtx, false) + if err != nil { + return nil, errors.Wrapf(err, "can't extract issues from gofmt diff output %q", string(diff)) } - issues = append(issues, i) + for i := range is { + issues = append(issues, goanalysis.NewIssue(&is[i], pass)) + } } - } - } - - return issues, nil -} -func (g Gofmt) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - var issues []result.Issue + if len(issues) == 0 { + return nil, nil + } - for _, f := range getAllFileNames(lintCtx) { - var diff []byte - var err error - if g.UseGoimports { - imports.LocalPrefix = lintCtx.Settings().Goimports.LocalPrefixes - diff, err = goimportsAPI.Run(f) - } else { - diff, err = gofmtAPI.Run(f, lintCtx.Settings().Gofmt.Simplify) - } - if err != nil { // TODO: skip - return nil, err - } - if diff == nil { - continue - } + mu.Lock() + resIssues = append(resIssues, issues...) + mu.Unlock() - is, err := g.extractIssuesFromPatch(string(diff), lintCtx.Log, lintCtx) - if err != nil { - return nil, fmt.Errorf("can't extract issues from gofmt diff output %q: %s", string(diff), err) + return nil, nil } - - issues = append(issues, is...) - } - - return issues, nil + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt_common.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt_common.go new file mode 100644 index 00000000000..ae152ad7c4b --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gofmt_common.go @@ -0,0 +1,270 @@ +package golinters + +import ( + "bytes" + "fmt" + "go/token" + "strings" + + "github.com/pkg/errors" + diffpkg "github.com/sourcegraph/go-diff/diff" + + "github.com/golangci/golangci-lint/pkg/lint/linter" + "github.com/golangci/golangci-lint/pkg/logutils" + "github.com/golangci/golangci-lint/pkg/result" +) + +type Change struct { + LineRange result.Range + Replacement result.Replacement +} + +type diffLineType string + +const ( + diffLineAdded diffLineType = "added" + diffLineOriginal diffLineType = "original" + diffLineDeleted diffLineType = "deleted" +) + +type diffLine struct { + originalNumber int // 1-based original line number + typ diffLineType + data string // "+" or "-" stripped line +} + +type hunkChangesParser struct { + // needed because we merge currently added lines with the last original line + lastOriginalLine *diffLine + + // if the first line of diff is an adding we save all additions to replacementLinesToPrepend + replacementLinesToPrepend []string + + log logutils.Log + + lines []diffLine + + ret []Change +} + +func (p *hunkChangesParser) parseDiffLines(h *diffpkg.Hunk) { + lines := bytes.Split(h.Body, []byte{'\n'}) + currentOriginalLineNumer := int(h.OrigStartLine) + var ret []diffLine + + for i, line := range lines { + dl := diffLine{ + originalNumber: currentOriginalLineNumer, + } + + lineStr := string(line) + + //nolint:gocritic + if strings.HasPrefix(lineStr, "-") { + dl.typ = diffLineDeleted + dl.data = strings.TrimPrefix(lineStr, "-") + currentOriginalLineNumer++ + } else if strings.HasPrefix(lineStr, "+") { + dl.typ = diffLineAdded + dl.data = strings.TrimPrefix(lineStr, "+") + } else { + if i == len(lines)-1 && lineStr == "" { + // handle last \n: don't add an empty original line + break + } + + dl.typ = diffLineOriginal + dl.data = strings.TrimPrefix(lineStr, " ") + currentOriginalLineNumer++ + } + + ret = append(ret, dl) + } + + p.lines = ret +} + +func (p *hunkChangesParser) handleOriginalLine(line diffLine, i *int) { + if len(p.replacementLinesToPrepend) == 0 { + p.lastOriginalLine = &line + *i++ + return + } + + // check following added lines for the case: + // + added line 1 + // original line + // + added line 2 + + *i++ + var followingAddedLines []string + for ; *i < len(p.lines) && p.lines[*i].typ == diffLineAdded; *i++ { + followingAddedLines = append(followingAddedLines, p.lines[*i].data) + } + + p.ret = append(p.ret, Change{ + LineRange: result.Range{ + From: line.originalNumber, + To: line.originalNumber, + }, + Replacement: result.Replacement{ + NewLines: append(p.replacementLinesToPrepend, append([]string{line.data}, followingAddedLines...)...), + }, + }) + p.replacementLinesToPrepend = nil + p.lastOriginalLine = &line +} + +func (p *hunkChangesParser) handleDeletedLines(deletedLines []diffLine, addedLines []string) { + change := Change{ + LineRange: result.Range{ + From: deletedLines[0].originalNumber, + To: deletedLines[len(deletedLines)-1].originalNumber, + }, + } + + if len(addedLines) != 0 { + //nolint:gocritic + change.Replacement.NewLines = append(p.replacementLinesToPrepend, addedLines...) + if len(p.replacementLinesToPrepend) != 0 { + p.replacementLinesToPrepend = nil + } + + p.ret = append(p.ret, change) + return + } + + // delete-only change with possible prepending + if len(p.replacementLinesToPrepend) != 0 { + change.Replacement.NewLines = p.replacementLinesToPrepend + p.replacementLinesToPrepend = nil + } else { + change.Replacement.NeedOnlyDelete = true + } + + p.ret = append(p.ret, change) +} + +func (p *hunkChangesParser) handleAddedOnlyLines(addedLines []string) { + if p.lastOriginalLine == nil { + // the first line is added; the diff looks like: + // 1. + ... + // 2. - ... + // or + // 1. + ... + // 2. ... + + p.replacementLinesToPrepend = addedLines + return + } + + // add-only change merged into the last original line with possible prepending + p.ret = append(p.ret, Change{ + LineRange: result.Range{ + From: p.lastOriginalLine.originalNumber, + To: p.lastOriginalLine.originalNumber, + }, + Replacement: result.Replacement{ + NewLines: append(p.replacementLinesToPrepend, append([]string{p.lastOriginalLine.data}, addedLines...)...), + }, + }) + p.replacementLinesToPrepend = nil +} + +func (p *hunkChangesParser) parse(h *diffpkg.Hunk) []Change { + p.parseDiffLines(h) + + for i := 0; i < len(p.lines); { + line := p.lines[i] + if line.typ == diffLineOriginal { + p.handleOriginalLine(line, &i) //nolint:scopelint + continue + } + + var deletedLines []diffLine + for ; i < len(p.lines) && p.lines[i].typ == diffLineDeleted; i++ { + deletedLines = append(deletedLines, p.lines[i]) + } + + var addedLines []string + for ; i < len(p.lines) && p.lines[i].typ == diffLineAdded; i++ { + addedLines = append(addedLines, p.lines[i].data) + } + + if len(deletedLines) != 0 { + p.handleDeletedLines(deletedLines, addedLines) + continue + } + + // no deletions, only additions + p.handleAddedOnlyLines(addedLines) + } + + if len(p.replacementLinesToPrepend) != 0 { + p.log.Infof("The diff contains only additions: no original or deleted lines: %#v", p.lines) + return nil + } + + return p.ret +} + +func extractIssuesFromPatch(patch string, log logutils.Log, lintCtx *linter.Context, isGoimports bool) ([]result.Issue, error) { + diffs, err := diffpkg.ParseMultiFileDiff([]byte(patch)) + if err != nil { + return nil, errors.Wrap(err, "can't parse patch") + } + + if len(diffs) == 0 { + return nil, fmt.Errorf("got no diffs from patch parser: %v", diffs) + } + + issues := []result.Issue{} + for _, d := range diffs { + if len(d.Hunks) == 0 { + log.Warnf("Got no hunks in diff %+v", d) + continue + } + + for _, hunk := range d.Hunks { + var text string + if isGoimports { + text = "File is not `goimports`-ed" + if lintCtx.Settings().Goimports.LocalPrefixes != "" { + text += " with -local " + lintCtx.Settings().Goimports.LocalPrefixes + } + } else { + text = "File is not `gofmt`-ed" + if lintCtx.Settings().Gofmt.Simplify { + text += " with `-s`" + } + } + p := hunkChangesParser{ + log: log, + } + changes := p.parse(hunk) + for _, change := range changes { + change := change // fix scope + linterName := gofmtName + if isGoimports { + linterName = goimportsName + } + i := result.Issue{ + FromLinter: linterName, + Pos: token.Position{ + Filename: d.NewName, + Line: change.LineRange.From, + }, + Text: text, + Replacement: &change.Replacement, + } + if change.LineRange.From != change.LineRange.To { + i.LineRange = &change.LineRange + } + + issues = append(issues, i) + } + } + } + + return issues, nil +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goimports.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goimports.go new file mode 100644 index 00000000000..90e19b0e85d --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goimports.go @@ -0,0 +1,73 @@ +package golinters + +import ( + "sync" + + goimportsAPI "github.com/golangci/gofmt/goimports" + "github.com/pkg/errors" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/imports" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" + "github.com/golangci/golangci-lint/pkg/lint/linter" +) + +const goimportsName = "goimports" + +func NewGoimports() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue + + analyzer := &analysis.Analyzer{ + Name: goimportsName, + Doc: goanalysis.TheOnlyanalyzerDoc, + } + return goanalysis.NewLinter( + goimportsName, + "Goimports does everything that gofmt does. Additionally it checks unused imports", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + imports.LocalPrefix = lintCtx.Settings().Goimports.LocalPrefixes + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var fileNames []string + for _, f := range pass.Files { + pos := pass.Fset.Position(f.Pos()) + fileNames = append(fileNames, pos.Filename) + } + + var issues []goanalysis.Issue + + for _, f := range fileNames { + diff, err := goimportsAPI.Run(f) + if err != nil { // TODO: skip + return nil, err + } + if diff == nil { + continue + } + + is, err := extractIssuesFromPatch(string(diff), lintCtx.Log, lintCtx, true) + if err != nil { + return nil, errors.Wrapf(err, "can't extract issues from gofmt diff output %q", string(diff)) + } + + for i := range is { + issues = append(issues, goanalysis.NewIssue(&is[i], pass)) + } + } + + if len(issues) == 0 { + return nil, nil + } + + mu.Lock() + resIssues = append(resIssues, issues...) + mu.Unlock() + + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/golint.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/golint.go index de58d0a7a33..3b1b1b66f1f 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/golint.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/golint.go @@ -1,53 +1,24 @@ package golinters import ( - "context" "fmt" "go/ast" "go/token" + "go/types" + "sync" lintAPI "github.com/golangci/lint-1" + "golang.org/x/tools/go/analysis" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Golint struct{} - -func (Golint) Name() string { - return "golint" -} - -func (Golint) Desc() string { - return "Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes" -} - -func (g Golint) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - var issues []result.Issue - var lintErr error - for _, pkg := range lintCtx.Packages { - files, fset, err := getASTFilesForGoPkg(lintCtx, pkg) - if err != nil { - return nil, err - } - - i, err := g.lintPkg(lintCtx.Settings().Golint.MinConfidence, files, fset) - if err != nil { - lintErr = err - continue - } - issues = append(issues, i...) - } - if lintErr != nil { - lintCtx.Log.Warnf("Golint: %s", lintErr) - } - - return issues, nil -} - -func (g Golint) lintPkg(minConfidence float64, files []*ast.File, fset *token.FileSet) ([]result.Issue, error) { +func golintProcessPkg(minConfidence float64, files []*ast.File, fset *token.FileSet, + typesPkg *types.Package, typesInfo *types.Info) ([]result.Issue, error) { l := new(lintAPI.Linter) - ps, err := l.LintASTFiles(files, fset) + ps, err := l.LintPkg(files, fset, typesPkg, typesInfo) if err != nil { return nil, fmt.Errorf("can't lint %d files: %s", len(files), err) } @@ -62,7 +33,7 @@ func (g Golint) lintPkg(minConfidence float64, files []*ast.File, fset *token.Fi issues = append(issues, result.Issue{ Pos: ps[idx].Position, Text: ps[idx].Text, - FromLinter: g.Name(), + FromLinter: golintName, }) // TODO: use p.Link and p.Category } @@ -70,3 +41,38 @@ func (g Golint) lintPkg(minConfidence float64, files []*ast.File, fset *token.Fi return issues, nil } + +const golintName = "golint" + +func NewGolint() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue + + analyzer := &analysis.Analyzer{ + Name: golintName, + Doc: goanalysis.TheOnlyanalyzerDoc, + } + return goanalysis.NewLinter( + golintName, + "Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + res, err := golintProcessPkg(lintCtx.Settings().Golint.MinConfidence, pass.Files, pass.Fset, pass.Pkg, pass.TypesInfo) + if err != nil || len(res) == 0 { + return nil, err + } + + mu.Lock() + for i := range res { + resIssues = append(resIssues, goanalysis.NewIssue(&res[i], pass)) + } + mu.Unlock() + + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeTypesInfo) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gomnd.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gomnd.go new file mode 100644 index 00000000000..0a64f88f8a6 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gomnd.go @@ -0,0 +1,27 @@ +package golinters + +import ( + mnd "github.com/tommy-muehle/go-mnd" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/config" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" +) + +func NewGoMND(cfg *config.Config) *goanalysis.Linter { + analyzers := []*analysis.Analyzer{ + mnd.Analyzer, + } + + var linterCfg map[string]map[string]interface{} + if cfg != nil { + linterCfg = cfg.LintersSettings.Gomnd.Settings + } + + return goanalysis.NewLinter( + "gomnd", + "An analyzer to detect magic numbers.", + analyzers, + linterCfg, + ).WithLoadMode(goanalysis.LoadModeSyntax) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/goprintffuncname.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goprintffuncname.go new file mode 100644 index 00000000000..c5516dc7f9b --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/goprintffuncname.go @@ -0,0 +1,17 @@ +package golinters + +import ( + "github.com/jirfag/go-printf-func-name/pkg/analyzer" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" +) + +func NewGoPrintfFuncName() *goanalysis.Linter { + return goanalysis.NewLinter( + "goprintffuncname", + "Checks that printf-like functions are named with `f` at the end", + []*analysis.Analyzer{analyzer.Analyzer}, + nil, + ).WithLoadMode(goanalysis.LoadModeSyntax) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gosec.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gosec.go index 3187e6e2a11..0b84824c319 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gosec.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gosec.go @@ -1,69 +1,97 @@ package golinters import ( - "context" "fmt" "go/token" "io/ioutil" "log" "strconv" + "sync" "github.com/securego/gosec" "github.com/securego/gosec/rules" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/packages" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Gosec struct{} +const gosecName = "gosec" -func (Gosec) Name() string { - return "gosec" -} - -func (Gosec) Desc() string { - return "Inspects source code for security problems" -} +func NewGosec() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue -func (lint Gosec) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { gasConfig := gosec.NewConfig() enabledRules := rules.Generate() logger := log.New(ioutil.Discard, "", 0) - analyzer := gosec.NewAnalyzer(gasConfig, true, logger) - analyzer.LoadRules(enabledRules.Builders()) - for _, pkg := range lintCtx.Packages { - analyzer.Check(pkg) - } - issues, _, _ := analyzer.Report() - if len(issues) == 0 { - return nil, nil + analyzer := &analysis.Analyzer{ + Name: gosecName, + Doc: goanalysis.TheOnlyanalyzerDoc, } + return goanalysis.NewLinter( + gosecName, + "Inspects source code for security problems", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + gosecAnalyzer := gosec.NewAnalyzer(gasConfig, true, logger) + gosecAnalyzer.LoadRules(enabledRules.Builders()) + pkg := &packages.Package{ + Fset: pass.Fset, + Syntax: pass.Files, + Types: pass.Pkg, + TypesInfo: pass.TypesInfo, + } + gosecAnalyzer.Check(pkg) + issues, _, _ := gosecAnalyzer.Report() + if len(issues) == 0 { + return nil, nil + } - res := make([]result.Issue, 0, len(issues)) - for _, i := range issues { - text := fmt.Sprintf("%s: %s", i.RuleID, i.What) // TODO: use severity and confidence - var r *result.Range - line, err := strconv.Atoi(i.Line) - if err != nil { - r = &result.Range{} - if n, rerr := fmt.Sscanf(i.Line, "%d-%d", &r.From, &r.To); rerr != nil || n != 2 { - lintCtx.Log.Warnf("Can't convert gosec line number %q of %v to int: %s", i.Line, i, err) - continue + res := make([]goanalysis.Issue, 0, len(issues)) + for _, i := range issues { + text := fmt.Sprintf("%s: %s", i.RuleID, i.What) // TODO: use severity and confidence + var r *result.Range + line, err := strconv.Atoi(i.Line) + if err != nil { + r = &result.Range{} + if n, rerr := fmt.Sscanf(i.Line, "%d-%d", &r.From, &r.To); rerr != nil || n != 2 { + lintCtx.Log.Warnf("Can't convert gosec line number %q of %v to int: %s", i.Line, i, err) + continue + } + line = r.From + } + + column, err := strconv.Atoi(i.Col) + if err != nil { + lintCtx.Log.Warnf("Can't convert gosec column number %q of %v to int: %s", i.Col, i, err) + continue + } + + res = append(res, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: token.Position{ + Filename: i.File, + Line: line, + Column: column, + }, + Text: text, + LineRange: r, + FromLinter: gosecName, + }, pass)) } - line = r.From - } - res = append(res, result.Issue{ - Pos: token.Position{ - Filename: i.File, - Line: line, - }, - Text: text, - LineRange: r, - FromLinter: lint.Name(), - }) - } + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() - return res, nil + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeTypesInfo) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/gosimple.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gosimple.go new file mode 100644 index 00000000000..788fc8c6389 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/gosimple.go @@ -0,0 +1,19 @@ +package golinters + +import ( + "honnef.co/go/tools/simple" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" +) + +func NewGosimple() *goanalysis.Linter { + analyzers := analyzersMapToSlice(simple.Analyzers) + setAnalyzersGoVersion(analyzers) + + return goanalysis.NewLinter( + "gosimple", + "Linter for Go source code that specializes in simplifying a code", + analyzers, + nil, + ).WithLoadMode(goanalysis.LoadModeTypesInfo) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/govet.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/govet.go index b3b7b61a2a0..0cbc3d318bc 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/govet.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/govet.go @@ -2,40 +2,46 @@ package golinters import ( "golang.org/x/tools/go/analysis" - - "github.com/golangci/golangci-lint/pkg/config" - - "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" - - // analysis plug-ins "golang.org/x/tools/go/analysis/passes/asmdecl" "golang.org/x/tools/go/analysis/passes/assign" "golang.org/x/tools/go/analysis/passes/atomic" "golang.org/x/tools/go/analysis/passes/atomicalign" "golang.org/x/tools/go/analysis/passes/bools" + _ "golang.org/x/tools/go/analysis/passes/buildssa" // unused, internal analyzer "golang.org/x/tools/go/analysis/passes/buildtag" "golang.org/x/tools/go/analysis/passes/cgocall" "golang.org/x/tools/go/analysis/passes/composite" "golang.org/x/tools/go/analysis/passes/copylock" + _ "golang.org/x/tools/go/analysis/passes/ctrlflow" // unused, internal analyzer + "golang.org/x/tools/go/analysis/passes/deepequalerrors" "golang.org/x/tools/go/analysis/passes/errorsas" + "golang.org/x/tools/go/analysis/passes/findcall" "golang.org/x/tools/go/analysis/passes/httpresponse" + _ "golang.org/x/tools/go/analysis/passes/inspect" // unused internal analyzer "golang.org/x/tools/go/analysis/passes/loopclosure" "golang.org/x/tools/go/analysis/passes/lostcancel" "golang.org/x/tools/go/analysis/passes/nilfunc" + "golang.org/x/tools/go/analysis/passes/nilness" + _ "golang.org/x/tools/go/analysis/passes/pkgfact" // unused, internal analyzer "golang.org/x/tools/go/analysis/passes/printf" "golang.org/x/tools/go/analysis/passes/shadow" "golang.org/x/tools/go/analysis/passes/shift" + "golang.org/x/tools/go/analysis/passes/sortslice" "golang.org/x/tools/go/analysis/passes/stdmethods" "golang.org/x/tools/go/analysis/passes/structtag" + "golang.org/x/tools/go/analysis/passes/testinggoroutine" "golang.org/x/tools/go/analysis/passes/tests" "golang.org/x/tools/go/analysis/passes/unmarshal" "golang.org/x/tools/go/analysis/passes/unreachable" "golang.org/x/tools/go/analysis/passes/unsafeptr" "golang.org/x/tools/go/analysis/passes/unusedresult" + + "github.com/golangci/golangci-lint/pkg/config" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" ) -func getAllAnalyzers() []*analysis.Analyzer { - return []*analysis.Analyzer{ +var ( + allAnalyzers = []*analysis.Analyzer{ asmdecl.Analyzer, assign.Analyzer, atomic.Analyzer, @@ -45,26 +51,29 @@ func getAllAnalyzers() []*analysis.Analyzer { cgocall.Analyzer, composite.Analyzer, copylock.Analyzer, + deepequalerrors.Analyzer, errorsas.Analyzer, + findcall.Analyzer, httpresponse.Analyzer, loopclosure.Analyzer, lostcancel.Analyzer, nilfunc.Analyzer, + nilness.Analyzer, printf.Analyzer, shadow.Analyzer, shift.Analyzer, + sortslice.Analyzer, stdmethods.Analyzer, structtag.Analyzer, + testinggoroutine.Analyzer, tests.Analyzer, unmarshal.Analyzer, unreachable.Analyzer, unsafeptr.Analyzer, unusedresult.Analyzer, } -} -func getDefaultAnalyzers() []*analysis.Analyzer { - return []*analysis.Analyzer{ + defaultAnalyzers = []*analysis.Analyzer{ asmdecl.Analyzer, assign.Analyzer, atomic.Analyzer, @@ -88,7 +97,7 @@ func getDefaultAnalyzers() []*analysis.Analyzer { unsafeptr.Analyzer, unusedresult.Analyzer, } -} +) func isAnalyzerEnabled(name string, cfg *config.GovetSettings, defaultAnalyzers []*analysis.Analyzer) bool { if cfg.EnableAll { @@ -118,16 +127,16 @@ func isAnalyzerEnabled(name string, cfg *config.GovetSettings, defaultAnalyzers func analyzersFromConfig(cfg *config.GovetSettings) []*analysis.Analyzer { if cfg == nil { - return getDefaultAnalyzers() + return defaultAnalyzers } + if cfg.CheckShadowing { // Keeping for backward compatibility. cfg.Enable = append(cfg.Enable, shadow.Analyzer.Name) } var enabledAnalyzers []*analysis.Analyzer - defaultAnalyzers := getDefaultAnalyzers() - for _, a := range getAllAnalyzers() { + for _, a := range allAnalyzers { if isAnalyzerEnabled(a.Name, cfg, defaultAnalyzers) { enabledAnalyzers = append(enabledAnalyzers, a) } @@ -147,5 +156,5 @@ func NewGovet(cfg *config.GovetSettings) *goanalysis.Linter { "such as Printf calls whose arguments do not align with the format string", analyzersFromConfig(cfg), settings, - ) + ).WithLoadMode(goanalysis.LoadModeTypesInfo) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/ineffassign.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/ineffassign.go index b5d047b68a9..7d755809d79 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/ineffassign.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/ineffassign.go @@ -1,38 +1,61 @@ package golinters import ( - "context" "fmt" + "sync" - ineffassignAPI "github.com/golangci/ineffassign" + "github.com/golangci/ineffassign" + "golang.org/x/tools/go/analysis" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Ineffassign struct{} +const ineffassignName = "ineffassign" -func (Ineffassign) Name() string { - return "ineffassign" -} - -func (Ineffassign) Desc() string { - return "Detects when assignments to existing variables are not used" -} - -func (lint Ineffassign) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - issues := ineffassignAPI.Run(getAllFileNames(lintCtx)) - if len(issues) == 0 { - return nil, nil - } +func NewIneffassign() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue - res := make([]result.Issue, 0, len(issues)) - for _, i := range issues { - res = append(res, result.Issue{ - Pos: i.Pos, - Text: fmt.Sprintf("ineffectual assignment to %s", formatCode(i.IdentName, lintCtx.Cfg)), - FromLinter: lint.Name(), - }) + analyzer := &analysis.Analyzer{ + Name: ineffassignName, + Doc: goanalysis.TheOnlyanalyzerDoc, } - return res, nil + return goanalysis.NewLinter( + ineffassignName, + "Detects when assignments to existing variables are not used", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var fileNames []string + for _, f := range pass.Files { + pos := pass.Fset.Position(f.Pos()) + fileNames = append(fileNames, pos.Filename) + } + + issues := ineffassign.Run(fileNames) + if len(issues) == 0 { + return nil, nil + } + + res := make([]goanalysis.Issue, 0, len(issues)) + for _, i := range issues { + res = append(res, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: i.Pos, + Text: fmt.Sprintf("ineffectual assignment to %s", formatCode(i.IdentName, lintCtx.Cfg)), + FromLinter: ineffassignName, + }, pass)) + } + + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() + + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/interfacer.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/interfacer.go index f3652e4901d..96f6b5b9d46 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/interfacer.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/interfacer.go @@ -1,46 +1,67 @@ package golinters import ( - "context" + "sync" + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/buildssa" "mvdan.cc/interfacer/check" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Interfacer struct{} +const interfacerName = "interfacer" -func (Interfacer) Name() string { - return "interfacer" -} +func NewInterfacer() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue -func (Interfacer) Desc() string { - return "Linter that suggests narrower interface types" -} + analyzer := &analysis.Analyzer{ + Name: interfacerName, + Doc: goanalysis.TheOnlyanalyzerDoc, + Requires: []*analysis.Analyzer{buildssa.Analyzer}, + } + return goanalysis.NewLinter( + interfacerName, + "Linter that suggests narrower interface types", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + ssa := pass.ResultOf[buildssa.Analyzer].(*buildssa.SSA) + ssaPkg := ssa.Pkg + c := &check.Checker{} + prog := goanalysis.MakeFakeLoaderProgram(pass) + c.Program(prog) + c.ProgramSSA(ssaPkg.Prog) -func (lint Interfacer) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - c := new(check.Checker) - c.Program(lintCtx.Program) - c.ProgramSSA(lintCtx.SSAProgram) + issues, err := c.Check() + if err != nil { + return nil, err + } + if len(issues) == 0 { + return nil, nil + } - issues, err := c.Check() - if err != nil { - return nil, err - } - if len(issues) == 0 { - return nil, nil - } + res := make([]goanalysis.Issue, 0, len(issues)) + for _, i := range issues { + pos := pass.Fset.Position(i.Pos()) + res = append(res, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: pos, + Text: i.Message(), + FromLinter: interfacerName, + }, pass)) + } - res := make([]result.Issue, 0, len(issues)) - for _, i := range issues { - pos := lintCtx.SSAProgram.Fset.Position(i.Pos()) - res = append(res, result.Issue{ - Pos: pos, - Text: i.Message(), - FromLinter: lint.Name(), - }) - } + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() - return res, nil + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeTypesInfo) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/lll.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/lll.go index ad90830df4a..c24b4d14814 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/lll.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/lll.go @@ -2,28 +2,21 @@ package golinters import ( "bufio" - "context" "fmt" "go/token" "os" "strings" + "sync" "unicode/utf8" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Lll struct{} - -func (Lll) Name() string { - return "lll" -} - -func (Lll) Desc() string { - return "Reports long lines" -} - -func (lint Lll) getIssuesForFile(filename string, maxLineLen int, tabSpaces string) ([]result.Issue, error) { +func getLLLIssuesForFile(filename string, maxLineLen int, tabSpaces string) ([]result.Issue, error) { var res []result.Issue f, err := os.Open(filename) @@ -45,7 +38,7 @@ func (lint Lll) getIssuesForFile(filename string, maxLineLen int, tabSpaces stri Line: lineNumber, }, Text: fmt.Sprintf("line is %d characters", lineLen), - FromLinter: lint.Name(), + FromLinter: lllName, }) } lineNumber++ @@ -70,7 +63,7 @@ func (lint Lll) getIssuesForFile(filename string, maxLineLen int, tabSpaces stri Column: 1, }, Text: fmt.Sprintf("line is more than %d characters", bufio.MaxScanTokenSize), - FromLinter: lint.Name(), + FromLinter: lllName, }) } else { return nil, fmt.Errorf("can't scan file %s: %s", filename, err) @@ -80,16 +73,52 @@ func (lint Lll) getIssuesForFile(filename string, maxLineLen int, tabSpaces stri return res, nil } -func (lint Lll) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - var res []result.Issue - spaces := strings.Repeat(" ", lintCtx.Settings().Lll.TabWidth) - for _, f := range getAllFileNames(lintCtx) { - issues, err := lint.getIssuesForFile(f, lintCtx.Settings().Lll.LineLength, spaces) - if err != nil { - return nil, err - } - res = append(res, issues...) +const lllName = "lll" + +func NewLLL() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue + + analyzer := &analysis.Analyzer{ + Name: lllName, + Doc: goanalysis.TheOnlyanalyzerDoc, } + return goanalysis.NewLinter( + lllName, + "Reports long lines", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var fileNames []string + for _, f := range pass.Files { + pos := pass.Fset.Position(f.Pos()) + fileNames = append(fileNames, pos.Filename) + } - return res, nil + var res []goanalysis.Issue + spaces := strings.Repeat(" ", lintCtx.Settings().Lll.TabWidth) + for _, f := range fileNames { + issues, err := getLLLIssuesForFile(f, lintCtx.Settings().Lll.LineLength, spaces) + if err != nil { + return nil, err + } + for i := range issues { + res = append(res, goanalysis.NewIssue(&issues[i], pass)) + } + } + + if len(res) == 0 { + return nil, nil + } + + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() + + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/maligned.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/maligned.go index 624a7774b1c..4f34f0ea18b 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/maligned.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/maligned.go @@ -1,42 +1,58 @@ package golinters import ( - "context" "fmt" + "sync" malignedAPI "github.com/golangci/maligned" + "golang.org/x/tools/go/analysis" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Maligned struct{} - -func (Maligned) Name() string { - return "maligned" -} - -func (Maligned) Desc() string { - return "Tool to detect Go structs that would take less memory if their fields were sorted" -} - -func (m Maligned) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - issues := malignedAPI.Run(lintCtx.Program) - if len(issues) == 0 { - return nil, nil +func NewMaligned() *goanalysis.Linter { + const linterName = "maligned" + var mu sync.Mutex + var res []goanalysis.Issue + analyzer := &analysis.Analyzer{ + Name: linterName, + Doc: goanalysis.TheOnlyanalyzerDoc, } - - res := make([]result.Issue, 0, len(issues)) - for _, i := range issues { - text := fmt.Sprintf("struct of size %d bytes could be of size %d bytes", i.OldSize, i.NewSize) - if lintCtx.Settings().Maligned.SuggestNewOrder { - text += fmt.Sprintf(":\n%s", formatCodeBlock(i.NewStructDef, lintCtx.Cfg)) + return goanalysis.NewLinter( + linterName, + "Tool to detect Go structs that would take less memory if their fields were sorted", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + prog := goanalysis.MakeFakeLoaderProgram(pass) + + malignedIssues := malignedAPI.Run(prog) + if len(malignedIssues) == 0 { + return nil, nil + } + + issues := make([]goanalysis.Issue, 0, len(malignedIssues)) + for _, i := range malignedIssues { + text := fmt.Sprintf("struct of size %d bytes could be of size %d bytes", i.OldSize, i.NewSize) + if lintCtx.Settings().Maligned.SuggestNewOrder { + text += fmt.Sprintf(":\n%s", formatCodeBlock(i.NewStructDef, lintCtx.Cfg)) + } + issues = append(issues, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: i.Pos, + Text: text, + FromLinter: linterName, + }, pass)) + } + + mu.Lock() + res = append(res, issues...) + mu.Unlock() + return nil, nil } - res = append(res, result.Issue{ - Pos: i.Pos, - Text: text, - FromLinter: m.Name(), - }) - } - return res, nil + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return res + }).WithLoadMode(goanalysis.LoadModeTypesInfo) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/megacheck.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/megacheck.go index 9b1b74ba31e..85621f6fb77 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/megacheck.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/megacheck.go @@ -1,183 +1,16 @@ package golinters import ( - "context" "fmt" - "github.com/golangci/golangci-lint/pkg/logutils" - - "honnef.co/go/tools/unused" - - "honnef.co/go/tools/lint" - "golang.org/x/tools/go/analysis" - "honnef.co/go/tools/simple" - "honnef.co/go/tools/staticcheck" - "honnef.co/go/tools/stylecheck" - - "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" - "github.com/golangci/golangci-lint/pkg/lint/linter" - "github.com/golangci/golangci-lint/pkg/result" -) -const ( - MegacheckParentName = "megacheck" - MegacheckStaticcheckName = "staticcheck" - MegacheckUnusedName = "unused" - MegacheckGosimpleName = "gosimple" - MegacheckStylecheckName = "stylecheck" + "github.com/golangci/golangci-lint/pkg/logutils" ) var debugf = logutils.Debug("megacheck") -type Staticcheck struct { - megacheck -} - -func NewStaticcheck() *Staticcheck { - return &Staticcheck{ - megacheck: megacheck{ - staticcheckEnabled: true, - }, - } -} - -func (Staticcheck) Name() string { return MegacheckStaticcheckName } -func (Staticcheck) Desc() string { - return "Staticcheck is a go vet on steroids, applying a ton of static analysis checks" -} - -type Gosimple struct { - megacheck -} - -func NewGosimple() *Gosimple { - return &Gosimple{ - megacheck: megacheck{ - gosimpleEnabled: true, - }, - } -} - -func (Gosimple) Name() string { return MegacheckGosimpleName } -func (Gosimple) Desc() string { - return "Linter for Go source code that specializes in simplifying a code" -} - -type Unused struct { - megacheck -} - -func NewUnused() *Unused { - return &Unused{ - megacheck: megacheck{ - unusedEnabled: true, - }, - } -} - -func (Unused) Name() string { return MegacheckUnusedName } -func (Unused) Desc() string { - return "Checks Go code for unused constants, variables, functions and types" -} - -type Stylecheck struct { - megacheck -} - -func NewStylecheck() *Stylecheck { - return &Stylecheck{ - megacheck: megacheck{ - stylecheckEnabled: true, - }, - } -} - -func (Stylecheck) Name() string { return MegacheckStylecheckName } -func (Stylecheck) Desc() string { return "Stylecheck is a replacement for golint" } - -type megacheck struct { - unusedEnabled bool - gosimpleEnabled bool - staticcheckEnabled bool - stylecheckEnabled bool -} - -func (megacheck) Name() string { - return MegacheckParentName -} - -func (megacheck) Desc() string { - return "" // shouldn't be called -} - -func (m *megacheck) enableChildLinter(name string) error { - switch name { - case MegacheckStaticcheckName: - m.staticcheckEnabled = true - case MegacheckGosimpleName: - m.gosimpleEnabled = true - case MegacheckUnusedName: - m.unusedEnabled = true - case MegacheckStylecheckName: - m.stylecheckEnabled = true - default: - return fmt.Errorf("invalid child linter name %s for metalinter %s", name, m.Name()) - } - - return nil -} - -type MegacheckMetalinter struct{} - -func (MegacheckMetalinter) Name() string { - return MegacheckParentName -} - -func (MegacheckMetalinter) BuildLinterConfig(enabledChildren []string) (*linter.Config, error) { - var m megacheck - for _, name := range enabledChildren { - if err := m.enableChildLinter(name); err != nil { - return nil, err - } - } - - // TODO: merge linter.Config and linter.Linter or refactor it in another way - lc := &linter.Config{ - Linter: m, - EnabledByDefault: false, - NeedsSSARepr: false, - InPresets: []string{linter.PresetStyle, linter.PresetBugs, linter.PresetUnused}, - Speed: 1, - AlternativeNames: nil, - OriginalURL: "", - ParentLinterName: "", - } - if m.unusedEnabled { - lc = lc.WithLoadDepsTypeInfo() - } else { - lc = lc.WithLoadForGoAnalysis() - } - return lc, nil -} - -func (MegacheckMetalinter) DefaultChildLinterNames() []string { - // no stylecheck here for backwards compatibility for users who enabled megacheck: don't enable extra - // linter for them - return []string{MegacheckStaticcheckName, MegacheckGosimpleName, MegacheckUnusedName} -} - -func (m MegacheckMetalinter) AllChildLinterNames() []string { - return append(m.DefaultChildLinterNames(), MegacheckStylecheckName) -} - -func (m megacheck) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - // Use OriginalPackages not Packages because `unused` doesn't work properly - // when we deduplicate normal and test packages. - return m.runMegacheck(ctx, lintCtx) -} - -func getAnalyzers(m map[string]*analysis.Analyzer) []*analysis.Analyzer { +func analyzersMapToSlice(m map[string]*analysis.Analyzer) []*analysis.Analyzer { var ret []*analysis.Analyzer for _, v := range m { ret = append(ret, v) @@ -185,7 +18,7 @@ func getAnalyzers(m map[string]*analysis.Analyzer) []*analysis.Analyzer { return ret } -func setGoVersion(analyzers []*analysis.Analyzer) { +func setAnalyzersGoVersion(analyzers []*analysis.Analyzer) { const goVersion = 13 // TODO for _, a := range analyzers { if v := a.Flags.Lookup("go"); v != nil { @@ -195,106 +28,3 @@ func setGoVersion(analyzers []*analysis.Analyzer) { } } } - -func (m megacheck) runMegacheck(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - var linters []linter.Linter - - if m.gosimpleEnabled { - analyzers := getAnalyzers(simple.Analyzers) - setGoVersion(analyzers) - lnt := goanalysis.NewLinter(MegacheckGosimpleName, "", analyzers, nil) - linters = append(linters, lnt) - } - if m.staticcheckEnabled { - analyzers := getAnalyzers(staticcheck.Analyzers) - setGoVersion(analyzers) - lnt := goanalysis.NewLinter(MegacheckStaticcheckName, "", analyzers, nil) - linters = append(linters, lnt) - } - if m.stylecheckEnabled { - analyzers := getAnalyzers(stylecheck.Analyzers) - setGoVersion(analyzers) - lnt := goanalysis.NewLinter(MegacheckStylecheckName, "", analyzers, nil) - linters = append(linters, lnt) - } - - var u lint.CumulativeChecker - if m.unusedEnabled { - u = unused.NewChecker(lintCtx.Settings().Unused.CheckExported) - analyzers := []*analysis.Analyzer{u.Analyzer()} - setGoVersion(analyzers) - lnt := goanalysis.NewLinter(MegacheckUnusedName, "", analyzers, nil) - linters = append(linters, lnt) - } - - if len(linters) == 0 { - return nil, nil - } - - var issues []result.Issue - for _, lnt := range linters { - i, err := lnt.Run(ctx, lintCtx) - if err != nil { - return nil, err - } - issues = append(issues, i...) - } - - if u != nil { - for _, ur := range u.Result() { - p := u.ProblemObject(lintCtx.Packages[0].Fset, ur) - issues = append(issues, result.Issue{ - FromLinter: MegacheckUnusedName, - Text: p.Message, - Pos: p.Pos, - }) - } - } - - return issues, nil -} - -func (m megacheck) Analyzers() []*analysis.Analyzer { - if m.unusedEnabled { - // Don't treat this linter as go/analysis linter if unused is used - // because it has non-standard API. - return nil - } - - var allAnalyzers []*analysis.Analyzer - if m.gosimpleEnabled { - allAnalyzers = append(allAnalyzers, getAnalyzers(simple.Analyzers)...) - } - if m.staticcheckEnabled { - allAnalyzers = append(allAnalyzers, getAnalyzers(staticcheck.Analyzers)...) - } - if m.stylecheckEnabled { - allAnalyzers = append(allAnalyzers, getAnalyzers(stylecheck.Analyzers)...) - } - setGoVersion(allAnalyzers) - return allAnalyzers -} - -func (megacheck) Cfg() map[string]map[string]interface{} { - return nil -} - -func (m megacheck) AnalyzerToLinterNameMapping() map[*analysis.Analyzer]string { - ret := map[*analysis.Analyzer]string{} - if m.gosimpleEnabled { - for _, a := range simple.Analyzers { - ret[a] = MegacheckGosimpleName - } - } - if m.staticcheckEnabled { - for _, a := range staticcheck.Analyzers { - ret[a] = MegacheckStaticcheckName - } - } - if m.stylecheckEnabled { - for _, a := range stylecheck.Analyzers { - ret[a] = MegacheckStylecheckName - } - } - return ret -} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/misspell.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/misspell.go index 413c20f8485..6cd421e5e93 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/misspell.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/misspell.go @@ -1,69 +1,20 @@ package golinters import ( - "context" "fmt" "go/token" "strings" + "sync" "github.com/golangci/misspell" + "golang.org/x/tools/go/analysis" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Misspell struct{} - -func NewMisspell() *Misspell { - return &Misspell{} -} - -func (Misspell) Name() string { - return "misspell" -} - -func (Misspell) Desc() string { - return "Finds commonly misspelled English words in comments" -} - -func (lint Misspell) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - r := misspell.Replacer{ - Replacements: misspell.DictMain, - } - - // Figure out regional variations - settings := lintCtx.Settings().Misspell - locale := settings.Locale - switch strings.ToUpper(locale) { - case "": - // nothing - case "US": - r.AddRuleList(misspell.DictAmerican) - case "UK", "GB": - r.AddRuleList(misspell.DictBritish) - case "NZ", "AU", "CA": - return nil, fmt.Errorf("unknown locale: %q", locale) - } - - if len(settings.IgnoreWords) != 0 { - r.RemoveRule(settings.IgnoreWords) - } - - r.Compile() - - var res []result.Issue - for _, f := range getAllFileNames(lintCtx) { - issues, err := lint.runOnFile(f, &r, lintCtx) - if err != nil { - return nil, err - } - res = append(res, issues...) - } - - return res, nil -} - -func (lint Misspell) runOnFile(fileName string, r *misspell.Replacer, lintCtx *linter.Context) ([]result.Issue, error) { +func runMisspellOnFile(fileName string, r *misspell.Replacer, lintCtx *linter.Context) ([]result.Issue, error) { var res []result.Issue fileContent, err := lintCtx.FileCache.GetFileBytes(fileName) if err != nil { @@ -93,10 +44,89 @@ func (lint Misspell) runOnFile(fileName string, r *misspell.Replacer, lintCtx *l res = append(res, result.Issue{ Pos: pos, Text: text, - FromLinter: lint.Name(), + FromLinter: misspellName, Replacement: replacement, }) } return res, nil } + +const misspellName = "misspell" + +func NewMisspell() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue + var ruleErr error + + analyzer := &analysis.Analyzer{ + Name: misspellName, + Doc: goanalysis.TheOnlyanalyzerDoc, + } + return goanalysis.NewLinter( + misspellName, + "Finds commonly misspelled English words in comments", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + r := misspell.Replacer{ + Replacements: misspell.DictMain, + } + + // Figure out regional variations + settings := lintCtx.Settings().Misspell + locale := settings.Locale + switch strings.ToUpper(locale) { + case "": + // nothing + case "US": + r.AddRuleList(misspell.DictAmerican) + case "UK", "GB": + r.AddRuleList(misspell.DictBritish) + case "NZ", "AU", "CA": + ruleErr = fmt.Errorf("unknown locale: %q", locale) + } + + if ruleErr == nil { + if len(settings.IgnoreWords) != 0 { + r.RemoveRule(settings.IgnoreWords) + } + + r.Compile() + } + + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + if ruleErr != nil { + return nil, ruleErr + } + + var fileNames []string + for _, f := range pass.Files { + pos := pass.Fset.Position(f.Pos()) + fileNames = append(fileNames, pos.Filename) + } + + var res []goanalysis.Issue + for _, f := range fileNames { + issues, err := runMisspellOnFile(f, &r, lintCtx) + if err != nil { + return nil, err + } + for i := range issues { + res = append(res, goanalysis.NewIssue(&issues[i], pass)) + } + } + if len(res) == 0 { + return nil, nil + } + + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() + + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/nakedret.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/nakedret.go index b935faa7ce2..86735a51ada 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/nakedret.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/nakedret.go @@ -1,25 +1,18 @@ package golinters import ( - "context" "fmt" "go/ast" "go/token" + "sync" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Nakedret struct{} - -func (Nakedret) Name() string { - return "nakedret" -} - -func (Nakedret) Desc() string { - return "Finds naked returns in functions greater than a specified function length" -} - type nakedretVisitor struct { maxLength int f *token.FileSet @@ -50,7 +43,7 @@ func (v *nakedretVisitor) processFuncDecl(funcDecl *ast.FuncDecl) { } v.issues = append(v.issues, result.Issue{ - FromLinter: Nakedret{}.Name(), + FromLinter: nakedretName, Text: fmt.Sprintf("naked return in func `%s` with %d lines of code", funcDecl.Name.Name, functionLineLength), Pos: v.f.Position(s.Pos()), @@ -85,16 +78,46 @@ func (v *nakedretVisitor) Visit(node ast.Node) ast.Visitor { return v } -func (lint Nakedret) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - var res []result.Issue - for _, f := range lintCtx.ASTCache.GetAllValidFiles() { - v := nakedretVisitor{ - maxLength: lintCtx.Settings().Nakedret.MaxFuncLines, - f: f.Fset, - } - ast.Walk(&v, f.F) - res = append(res, v.issues...) +const nakedretName = "nakedret" + +func NewNakedret() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue + + analyzer := &analysis.Analyzer{ + Name: nakedretName, + Doc: goanalysis.TheOnlyanalyzerDoc, } + return goanalysis.NewLinter( + nakedretName, + "Finds naked returns in functions greater than a specified function length", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var res []goanalysis.Issue + for _, file := range pass.Files { + v := nakedretVisitor{ + maxLength: lintCtx.Settings().Nakedret.MaxFuncLines, + f: pass.Fset, + } + ast.Walk(&v, file) + for i := range v.issues { + res = append(res, goanalysis.NewIssue(&v.issues[i], pass)) + } + } - return res, nil + if len(res) == 0 { + return nil, nil + } + + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() + + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/prealloc.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/prealloc.go index 6b2e032c107..168dc1713e9 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/prealloc.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/prealloc.go @@ -1,40 +1,57 @@ package golinters import ( - "context" "fmt" - "go/ast" + "sync" "github.com/golangci/prealloc" + "golang.org/x/tools/go/analysis" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Prealloc struct{} +const preallocName = "prealloc" -func (Prealloc) Name() string { - return "prealloc" -} - -func (Prealloc) Desc() string { - return "Finds slice declarations that could potentially be preallocated" -} +func NewPrealloc() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue -func (lint Prealloc) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - var res []result.Issue - - s := &lintCtx.Settings().Prealloc - for _, f := range lintCtx.ASTCache.GetAllValidFiles() { - hints := prealloc.Check([]*ast.File{f.F}, s.Simple, s.RangeLoops, s.ForLoops) - for _, hint := range hints { - res = append(res, result.Issue{ - Pos: f.Fset.Position(hint.Pos), - Text: fmt.Sprintf("Consider preallocating %s", formatCode(hint.DeclaredSliceName, lintCtx.Cfg)), - FromLinter: lint.Name(), - }) - } + analyzer := &analysis.Analyzer{ + Name: preallocName, + Doc: goanalysis.TheOnlyanalyzerDoc, } - - return res, nil + return goanalysis.NewLinter( + preallocName, + "Finds slice declarations that could potentially be preallocated", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + s := &lintCtx.Settings().Prealloc + + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var res []goanalysis.Issue + hints := prealloc.Check(pass.Files, s.Simple, s.RangeLoops, s.ForLoops) + for _, hint := range hints { + res = append(res, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: pass.Fset.Position(hint.Pos), + Text: fmt.Sprintf("Consider preallocating %s", formatCode(hint.DeclaredSliceName, lintCtx.Cfg)), + FromLinter: preallocName, + }, pass)) + } + + if len(res) == 0 { + return nil, nil + } + + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() + + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/rowerrcheck.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/rowerrcheck.go new file mode 100644 index 00000000000..d4c89d38293 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/rowerrcheck.go @@ -0,0 +1,23 @@ +package golinters + +import ( + "github.com/jingyugao/rowserrcheck/passes/rowserr" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" + "github.com/golangci/golangci-lint/pkg/lint/linter" +) + +func NewRowsErrCheck() *goanalysis.Linter { + analyzer := rowserr.NewAnalyzer() + return goanalysis.NewLinter( + "rowserrcheck", + "checks whether Err of rows is checked successfully", + []*analysis.Analyzer{analyzer}, + nil, + ).WithLoadMode(goanalysis.LoadModeTypesInfo). + WithContextSetter(func(lintCtx *linter.Context) { + pkgs := lintCtx.Settings().RowsErrCheck.Packages + analyzer.Run = rowserr.NewRun(pkgs...) + }) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/scopelint.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/scopelint.go index 38f86ee1605..258912e0b77 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/scopelint.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/scopelint.go @@ -1,40 +1,62 @@ package golinters import ( - "context" "fmt" "go/ast" "go/token" + "sync" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Scopelint struct{} +const scopelintName = "scopelint" -func (Scopelint) Name() string { - return "scopelint" -} +func NewScopelint() *goanalysis.Linter { + var mu sync.Mutex + var resIssues []goanalysis.Issue -func (Scopelint) Desc() string { - return "Scopelint checks for unpinned variables in go programs" -} + analyzer := &analysis.Analyzer{ + Name: scopelintName, + Doc: goanalysis.TheOnlyanalyzerDoc, + } + return goanalysis.NewLinter( + scopelintName, + "Scopelint checks for unpinned variables in go programs", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var res []result.Issue + for _, file := range pass.Files { + n := Node{ + fset: pass.Fset, + DangerObjects: map[*ast.Object]int{}, + UnsafeObjects: map[*ast.Object]int{}, + SkipFuncs: map[*ast.FuncLit]int{}, + issues: &res, + } + ast.Walk(&n, file) + } -func (lint Scopelint) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - var res []result.Issue + if len(res) == 0 { + return nil, nil + } - for _, f := range lintCtx.ASTCache.GetAllValidFiles() { - n := Node{ - fset: f.Fset, - DangerObjects: map[*ast.Object]int{}, - UnsafeObjects: map[*ast.Object]int{}, - SkipFuncs: map[*ast.FuncLit]int{}, - issues: &res, - } - ast.Walk(&n, f.F) - } + mu.Lock() + for i := range res { + resIssues = append(resIssues, goanalysis.NewIssue(&res[i], pass)) + } + mu.Unlock() - return res, nil + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) } // The code below is copy-pasted from https://github.com/kyoh86/scopelint 92cbe2cc9276abda0e309f52cc9e309d407f174e @@ -66,7 +88,7 @@ func (f *Node) Visit(node ast.Node) ast.Visitor { } case *ast.RangeStmt: - // Memory variables declarated in range statement + // Memory variables declared in range statement switch k := typedNode.Key.(type) { case *ast.Ident: f.UnsafeObjects[k.Obj] = 0 @@ -144,13 +166,13 @@ func (f *Node) Visit(node ast.Node) ast.Visitor { //nolint:interfacer func (f *Node) errorf(n ast.Node, format string, args ...interface{}) { pos := f.fset.Position(n.Pos()) - f.errorfAt(pos, format, args...) + f.errorAtf(pos, format, args...) } -func (f *Node) errorfAt(pos token.Position, format string, args ...interface{}) { +func (f *Node) errorAtf(pos token.Position, format string, args ...interface{}) { *f.issues = append(*f.issues, result.Issue{ Pos: pos, Text: fmt.Sprintf(format, args...), - FromLinter: Scopelint{}.Name(), + FromLinter: scopelintName, }) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/staticcheck.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/staticcheck.go new file mode 100644 index 00000000000..33aa921e6b0 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/staticcheck.go @@ -0,0 +1,19 @@ +package golinters + +import ( + "honnef.co/go/tools/staticcheck" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" +) + +func NewStaticcheck() *goanalysis.Linter { + analyzers := analyzersMapToSlice(staticcheck.Analyzers) + setAnalyzersGoVersion(analyzers) + + return goanalysis.NewLinter( + "staticcheck", + "Staticcheck is a go vet on steroids, applying a ton of static analysis checks", + analyzers, + nil, + ).WithLoadMode(goanalysis.LoadModeTypesInfo) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/structcheck.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/structcheck.go index 0d845a26bbf..8acfc403aa7 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/structcheck.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/structcheck.go @@ -1,38 +1,55 @@ package golinters // nolint:dupl import ( - "context" "fmt" + "sync" structcheckAPI "github.com/golangci/check/cmd/structcheck" + "golang.org/x/tools/go/analysis" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Structcheck struct{} - -func (Structcheck) Name() string { - return "structcheck" -} - -func (Structcheck) Desc() string { - return "Finds unused struct fields" -} - -func (s Structcheck) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - issues := structcheckAPI.Run(lintCtx.Program, lintCtx.Settings().Structcheck.CheckExportedFields) - if len(issues) == 0 { - return nil, nil - } - - res := make([]result.Issue, 0, len(issues)) - for _, i := range issues { - res = append(res, result.Issue{ - Pos: i.Pos, - Text: fmt.Sprintf("%s is unused", formatCode(i.FieldName, lintCtx.Cfg)), - FromLinter: s.Name(), - }) +func NewStructcheck() *goanalysis.Linter { + const linterName = "structcheck" + var mu sync.Mutex + var res []goanalysis.Issue + analyzer := &analysis.Analyzer{ + Name: linterName, + Doc: goanalysis.TheOnlyanalyzerDoc, } - return res, nil + return goanalysis.NewLinter( + linterName, + "Finds unused struct fields", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + checkExported := lintCtx.Settings().Structcheck.CheckExportedFields + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + prog := goanalysis.MakeFakeLoaderProgram(pass) + + structcheckIssues := structcheckAPI.Run(prog, checkExported) + if len(structcheckIssues) == 0 { + return nil, nil + } + + issues := make([]goanalysis.Issue, 0, len(structcheckIssues)) + for _, i := range structcheckIssues { + issues = append(issues, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: i.Pos, + Text: fmt.Sprintf("%s is unused", formatCode(i.FieldName, lintCtx.Cfg)), + FromLinter: linterName, + }, pass)) + } + + mu.Lock() + res = append(res, issues...) + mu.Unlock() + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return res + }).WithLoadMode(goanalysis.LoadModeTypesInfo) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/stylecheck.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/stylecheck.go new file mode 100644 index 00000000000..5a076951af7 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/stylecheck.go @@ -0,0 +1,19 @@ +package golinters + +import ( + "honnef.co/go/tools/stylecheck" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" +) + +func NewStylecheck() *goanalysis.Linter { + analyzers := analyzersMapToSlice(stylecheck.Analyzers) + setAnalyzersGoVersion(analyzers) + + return goanalysis.NewLinter( + "stylecheck", + "Stylecheck is a replacement for golint", + analyzers, + nil, + ).WithLoadMode(goanalysis.LoadModeTypesInfo) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/typecheck.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/typecheck.go index fde1756b32c..436530a8dbe 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/typecheck.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/typecheck.go @@ -1,57 +1,26 @@ package golinters import ( - "context" + "golang.org/x/tools/go/analysis" - "golang.org/x/tools/go/packages" - - "github.com/golangci/golangci-lint/pkg/lint/linter" - libpackages "github.com/golangci/golangci-lint/pkg/packages" - "github.com/golangci/golangci-lint/pkg/result" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" ) -type TypeCheck struct{} - -func (TypeCheck) Name() string { - return "typecheck" -} - -func (TypeCheck) Desc() string { - return "Like the front-end of a Go compiler, parses and type-checks Go code" -} - -func (lint TypeCheck) parseError(srcErr packages.Error) (*result.Issue, error) { - pos, err := libpackages.ParseErrorPosition(srcErr.Pos) - if err != nil { - return nil, err +func NewTypecheck() *goanalysis.Linter { + const linterName = "typecheck" + analyzer := &analysis.Analyzer{ + Name: linterName, + Doc: goanalysis.TheOnlyanalyzerDoc, + Run: func(pass *analysis.Pass) (interface{}, error) { + return nil, nil + }, } - - return &result.Issue{ - Pos: *pos, - Text: srcErr.Msg, - FromLinter: lint.Name(), - }, nil -} - -func (lint TypeCheck) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - uniqReportedIssues := map[string]bool{} - - var res []result.Issue - for _, pkg := range lintCtx.NotCompilingPackages { - errors := libpackages.ExtractErrors(pkg, lintCtx.ASTCache) - for _, err := range errors { - i, perr := lint.parseError(err) - if perr != nil { // failed to parse - if uniqReportedIssues[err.Msg] { - continue - } - uniqReportedIssues[err.Msg] = true - lintCtx.Log.Errorf("typechecking error: %s", err.Msg) - } else { - res = append(res, *i) - } - } - } - - return res, nil + linter := goanalysis.NewLinter( + linterName, + "Like the front-end of a Go compiler, parses and type-checks Go code", + []*analysis.Analyzer{analyzer}, + nil, + ).WithLoadMode(goanalysis.LoadModeTypesInfo) + linter.SetTypecheckMode() + return linter } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/unconvert.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/unconvert.go index 20ba45dc032..147570170e2 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/unconvert.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/unconvert.go @@ -1,38 +1,53 @@ package golinters import ( - "context" + "sync" unconvertAPI "github.com/golangci/unconvert" + "golang.org/x/tools/go/analysis" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Unconvert struct{} - -func (Unconvert) Name() string { - return "unconvert" -} - -func (Unconvert) Desc() string { - return "Remove unnecessary type conversions" -} - -func (lint Unconvert) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - positions := unconvertAPI.Run(lintCtx.Program) - if len(positions) == 0 { - return nil, nil - } - - res := make([]result.Issue, 0, len(positions)) - for _, pos := range positions { - res = append(res, result.Issue{ - Pos: pos, - Text: "unnecessary conversion", - FromLinter: lint.Name(), - }) +func NewUnconvert() *goanalysis.Linter { + const linterName = "unconvert" + var mu sync.Mutex + var res []goanalysis.Issue + analyzer := &analysis.Analyzer{ + Name: linterName, + Doc: goanalysis.TheOnlyanalyzerDoc, } - - return res, nil + return goanalysis.NewLinter( + linterName, + "Remove unnecessary type conversions", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + prog := goanalysis.MakeFakeLoaderProgram(pass) + + positions := unconvertAPI.Run(prog) + if len(positions) == 0 { + return nil, nil + } + + issues := make([]goanalysis.Issue, 0, len(positions)) + for _, pos := range positions { + issues = append(issues, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: pos, + Text: "unnecessary conversion", + FromLinter: linterName, + }, pass)) + } + + mu.Lock() + res = append(res, issues...) + mu.Unlock() + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return res + }).WithLoadMode(goanalysis.LoadModeTypesInfo) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/unparam.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/unparam.go index c45a79333c8..866d0663e63 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/unparam.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/unparam.go @@ -1,49 +1,77 @@ package golinters import ( - "context" + "sync" + "golang.org/x/tools/go/packages" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/analysis/passes/buildssa" "mvdan.cc/unparam/check" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Unparam struct{} +func NewUnparam() *goanalysis.Linter { + const linterName = "unparam" + var mu sync.Mutex + var resIssues []goanalysis.Issue -func (Unparam) Name() string { - return "unparam" -} + analyzer := &analysis.Analyzer{ + Name: linterName, + Doc: goanalysis.TheOnlyanalyzerDoc, + Requires: []*analysis.Analyzer{buildssa.Analyzer}, + } + return goanalysis.NewLinter( + linterName, + "Reports unused function parameters", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + us := &lintCtx.Settings().Unparam + if us.Algo != "cha" { + lintCtx.Log.Warnf("`linters-settings.unparam.algo` isn't supported by the newest `unparam`") + } -func (Unparam) Desc() string { - return "Reports unused function parameters" -} + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + ssa := pass.ResultOf[buildssa.Analyzer].(*buildssa.SSA) + ssaPkg := ssa.Pkg -func (lint Unparam) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - us := &lintCtx.Settings().Unparam + pkg := &packages.Package{ + Fset: pass.Fset, + Syntax: pass.Files, + Types: pass.Pkg, + TypesInfo: pass.TypesInfo, + } - if us.Algo != "cha" { - lintCtx.Log.Warnf("`linters-settings.unparam.algo` isn't supported by the newest `unparam`") - } + c := &check.Checker{} + c.CheckExportedFuncs(us.CheckExported) + c.Packages([]*packages.Package{pkg}) + c.ProgramSSA(ssaPkg.Prog) - c := &check.Checker{} - c.CheckExportedFuncs(us.CheckExported) - c.Packages(lintCtx.Packages) - c.ProgramSSA(lintCtx.SSAProgram) + unparamIssues, err := c.Check() + if err != nil { + return nil, err + } - unparamIssues, err := c.Check() - if err != nil { - return nil, err - } + var res []goanalysis.Issue + for _, i := range unparamIssues { + res = append(res, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: pass.Fset.Position(i.Pos()), + Text: i.Message(), + FromLinter: linterName, + }, pass)) + } - var res []result.Issue - for _, i := range unparamIssues { - res = append(res, result.Issue{ - Pos: lintCtx.Program.Fset.Position(i.Pos()), - Text: i.Message(), - FromLinter: lint.Name(), - }) - } + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() - return res, nil + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeTypesInfo) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/unused.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/unused.go new file mode 100644 index 00000000000..5f6d8371c57 --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/unused.go @@ -0,0 +1,57 @@ +package golinters + +import ( + "go/types" + + "golang.org/x/tools/go/analysis" + "golang.org/x/tools/go/packages" + "honnef.co/go/tools/unused" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" + "github.com/golangci/golangci-lint/pkg/lint/linter" + "github.com/golangci/golangci-lint/pkg/result" +) + +func NewUnused() *goanalysis.Linter { + u := unused.NewChecker(false) + analyzers := []*analysis.Analyzer{u.Analyzer()} + setAnalyzersGoVersion(analyzers) + + const name = "unused" + lnt := goanalysis.NewLinter( + name, + "Checks Go code for unused constants, variables, functions and types", + analyzers, + nil, + ).WithIssuesReporter(func(lintCtx *linter.Context) []goanalysis.Issue { + typesToPkg := map[*types.Package]*packages.Package{} + for _, pkg := range lintCtx.OriginalPackages { + typesToPkg[pkg.Types] = pkg + } + + var issues []goanalysis.Issue + for _, ur := range u.Result() { + p := u.ProblemObject(lintCtx.Packages[0].Fset, ur) + pkg := typesToPkg[ur.Pkg()] + issues = append(issues, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + FromLinter: name, + Text: p.Message, + Pos: p.Pos, + Pkg: pkg, + LineRange: &result.Range{ + From: p.Pos.Line, + To: p.End.Line, + }, + Replacement: &result.Replacement{ + // Suggest deleting unused stuff. + NeedOnlyDelete: true, + }, + }, nil)) + } + return issues + }).WithContextSetter(func(lintCtx *linter.Context) { + u.WholeProgram = lintCtx.Settings().Unused.CheckExported + }).WithLoadMode(goanalysis.LoadModeWholeProgram) + lnt.UseOriginalPackages() + return lnt +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/util.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/util.go index ee2919c0132..1940f30e3ff 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/util.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/util.go @@ -2,14 +2,9 @@ package golinters import ( "fmt" - "go/ast" - "go/token" "strings" - gopackages "golang.org/x/tools/go/packages" - "github.com/golangci/golangci-lint/pkg/config" - "github.com/golangci/golangci-lint/pkg/lint/linter" ) func formatCode(code string, _ *config.Config) string { @@ -27,38 +22,3 @@ func formatCodeBlock(code string, _ *config.Config) string { return fmt.Sprintf("```\n%s\n```", code) } - -func getAllFileNames(ctx *linter.Context) []string { - var ret []string - uniqFiles := map[string]bool{} // files are duplicated for test packages - for _, pkg := range ctx.Packages { - for _, f := range pkg.GoFiles { - if uniqFiles[f] { - continue - } - uniqFiles[f] = true - ret = append(ret, f) - } - } - return ret -} - -func getASTFilesForGoPkg(ctx *linter.Context, pkg *gopackages.Package) ([]*ast.File, *token.FileSet, error) { - var files []*ast.File - var fset *token.FileSet - for _, filename := range pkg.GoFiles { - f := ctx.ASTCache.Get(filename) - if f == nil { - return nil, nil, fmt.Errorf("no AST for file %s in cache: %+v", filename, *ctx.ASTCache) - } - - if f.Err != nil { - return nil, nil, fmt.Errorf("can't load AST for file %s: %s", f.Name, f.Err) - } - - files = append(files, f.F) - fset = f.Fset - } - - return files, fset, nil -} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/varcheck.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/varcheck.go index 17e2eee69b4..3c650d8c9d3 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/varcheck.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/varcheck.go @@ -1,38 +1,55 @@ package golinters // nolint:dupl import ( - "context" "fmt" + "sync" varcheckAPI "github.com/golangci/check/cmd/varcheck" + "golang.org/x/tools/go/analysis" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" ) -type Varcheck struct{} - -func (Varcheck) Name() string { - return "varcheck" -} - -func (Varcheck) Desc() string { - return "Finds unused global variables and constants" -} - -func (v Varcheck) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - issues := varcheckAPI.Run(lintCtx.Program, lintCtx.Settings().Varcheck.CheckExportedFields) - if len(issues) == 0 { - return nil, nil - } - - res := make([]result.Issue, 0, len(issues)) - for _, i := range issues { - res = append(res, result.Issue{ - Pos: i.Pos, - Text: fmt.Sprintf("%s is unused", formatCode(i.VarName, lintCtx.Cfg)), - FromLinter: v.Name(), - }) +func NewVarcheck() *goanalysis.Linter { + const linterName = "varcheck" + var mu sync.Mutex + var res []goanalysis.Issue + analyzer := &analysis.Analyzer{ + Name: linterName, + Doc: goanalysis.TheOnlyanalyzerDoc, } - return res, nil + return goanalysis.NewLinter( + linterName, + "Finds unused global variables and constants", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + checkExported := lintCtx.Settings().Varcheck.CheckExportedFields + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + prog := goanalysis.MakeFakeLoaderProgram(pass) + + varcheckIssues := varcheckAPI.Run(prog, checkExported) + if len(varcheckIssues) == 0 { + return nil, nil + } + + issues := make([]goanalysis.Issue, 0, len(varcheckIssues)) + for _, i := range varcheckIssues { + issues = append(issues, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + Pos: i.Pos, + Text: fmt.Sprintf("%s is unused", formatCode(i.VarName, lintCtx.Cfg)), + FromLinter: linterName, + }, pass)) + } + + mu.Lock() + res = append(res, issues...) + mu.Unlock() + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return res + }).WithLoadMode(goanalysis.LoadModeTypesInfo) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/whitespace.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/whitespace.go index d549c5b4664..4a2ccce5d64 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/golinters/whitespace.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/whitespace.go @@ -1,71 +1,85 @@ package golinters import ( - "context" "go/token" + "sync" "github.com/pkg/errors" + "github.com/ultraware/whitespace" + "golang.org/x/tools/go/analysis" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/result" - - "github.com/ultraware/whitespace" ) -type Whitespace struct { -} +func NewWhitespace() *goanalysis.Linter { + const linterName = "whitespace" + var mu sync.Mutex + var resIssues []goanalysis.Issue -func (Whitespace) Name() string { - return "whitespace" -} + analyzer := &analysis.Analyzer{ + Name: linterName, + Doc: goanalysis.TheOnlyanalyzerDoc, + } + return goanalysis.NewLinter( + linterName, + "Tool for detection of leading and trailing whitespace", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + cfg := lintCtx.Cfg.LintersSettings.Whitespace + settings := whitespace.Settings{MultiIf: cfg.MultiIf, MultiFunc: cfg.MultiFunc} -func (Whitespace) Desc() string { - return "Tool for detection of leading and trailing whitespace" -} + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var issues []whitespace.Message + for _, file := range pass.Files { + issues = append(issues, whitespace.Run(file, pass.Fset, settings)...) + } -func (w Whitespace) Run(ctx context.Context, lintCtx *linter.Context) ([]result.Issue, error) { - settings := whitespace.Settings{MultiIf: lintCtx.Cfg.LintersSettings.Whitespace.MultiIf} + if len(issues) == 0 { + return nil, nil + } - var issues []whitespace.Message - for _, file := range lintCtx.ASTCache.GetAllValidFiles() { - issues = append(issues, whitespace.Run(file.F, file.Fset, settings)...) - } + res := make([]goanalysis.Issue, len(issues)) + for k, i := range issues { + issue := result.Issue{ + Pos: token.Position{ + Filename: i.Pos.Filename, + Line: i.Pos.Line, + }, + LineRange: &result.Range{From: i.Pos.Line, To: i.Pos.Line}, + Text: i.Message, + FromLinter: linterName, + Replacement: &result.Replacement{}, + } - if len(issues) == 0 { - return nil, nil - } + bracketLine, err := lintCtx.LineCache.GetLine(issue.Pos.Filename, issue.Pos.Line) + if err != nil { + return nil, errors.Wrapf(err, "failed to get line %s:%d", issue.Pos.Filename, issue.Pos.Line) + } - res := make([]result.Issue, len(issues)) - for k, i := range issues { - issue := result.Issue{ - Pos: token.Position{ - Filename: i.Pos.Filename, - Line: i.Pos.Line, - }, - LineRange: &result.Range{From: i.Pos.Line, To: i.Pos.Line}, - Text: i.Message, - FromLinter: w.Name(), - Replacement: &result.Replacement{}, - } + switch i.Type { + case whitespace.MessageTypeLeading: + issue.LineRange.To++ // cover two lines by the issue: opening bracket "{" (issue.Pos.Line) and following empty line + case whitespace.MessageTypeTrailing: + issue.LineRange.From-- // cover two lines by the issue: closing bracket "}" (issue.Pos.Line) and preceding empty line + issue.Pos.Line-- // set in sync with LineRange.From to not break fixer and other code features + case whitespace.MessageTypeAddAfter: + bracketLine += "\n" + } + issue.Replacement.NewLines = []string{bracketLine} - bracketLine, err := lintCtx.LineCache.GetLine(issue.Pos.Filename, issue.Pos.Line) - if err != nil { - return nil, errors.Wrapf(err, "failed to get line %s:%d", issue.Pos.Filename, issue.Pos.Line) - } + res[k] = goanalysis.NewIssue(&issue, pass) //nolint:scopelint + } - switch i.Type { - case whitespace.MessageTypeLeading: - issue.LineRange.To++ // cover two lines by the issue: opening bracket "{" (issue.Pos.Line) and following empty line - case whitespace.MessageTypeTrailing: - issue.LineRange.From-- // cover two lines by the issue: closing bracket "}" (issue.Pos.Line) and preceding empty line - issue.Pos.Line-- // set in sync with LineRange.From to not break fixer and other code features - case whitespace.MessageTypeAddAfter: - bracketLine += "\n" - } - issue.Replacement.NewLines = []string{bracketLine} + mu.Lock() + resIssues = append(resIssues, res...) + mu.Unlock() - res[k] = issue - } - - return res, nil + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return resIssues + }).WithLoadMode(goanalysis.LoadModeSyntax) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/golinters/wsl.go b/vendor/github.com/golangci/golangci-lint/pkg/golinters/wsl.go new file mode 100644 index 00000000000..55e6eb4467e --- /dev/null +++ b/vendor/github.com/golangci/golangci-lint/pkg/golinters/wsl.go @@ -0,0 +1,78 @@ +package golinters + +import ( + "sync" + + "github.com/bombsimon/wsl/v2" + "golang.org/x/tools/go/analysis" + + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" + "github.com/golangci/golangci-lint/pkg/lint/linter" + "github.com/golangci/golangci-lint/pkg/result" +) + +const ( + name = "wsl" +) + +// NewWSL returns a new WSL linter. +func NewWSL() *goanalysis.Linter { + var ( + issues []goanalysis.Issue + mu = sync.Mutex{} + analyzer = &analysis.Analyzer{ + Name: goanalysis.TheOnlyAnalyzerName, + Doc: goanalysis.TheOnlyanalyzerDoc, + } + ) + + return goanalysis.NewLinter( + name, + "Whitespace Linter - Forces you to use empty lines!", + []*analysis.Analyzer{analyzer}, + nil, + ).WithContextSetter(func(lintCtx *linter.Context) { + analyzer.Run = func(pass *analysis.Pass) (interface{}, error) { + var ( + files = []string{} + linterCfg = lintCtx.Cfg.LintersSettings.WSL + processorCfg = wsl.Configuration{ + StrictAppend: linterCfg.StrictAppend, + AllowAssignAndCallCuddle: linterCfg.AllowAssignAndCallCuddle, + AllowMultiLineAssignCuddle: linterCfg.AllowMultiLineAssignCuddle, + AllowCuddleDeclaration: linterCfg.AllowCuddleDeclaration, + AllowTrailingComment: linterCfg.AllowTrailingComment, + CaseForceTrailingWhitespaceLimit: linterCfg.CaseForceTrailingWhitespaceLimit, + AllowCuddleWithCalls: []string{"Lock", "RLock"}, + AllowCuddleWithRHS: []string{"Unlock", "RUnlock"}, + } + ) + + for _, file := range pass.Files { + files = append(files, pass.Fset.Position(file.Pos()).Filename) + } + + wslErrors, _ := wsl.NewProcessorWithConfig(processorCfg). + ProcessFiles(files) + + if len(wslErrors) == 0 { + return nil, nil + } + + mu.Lock() + defer mu.Unlock() + + for _, err := range wslErrors { + issues = append(issues, goanalysis.NewIssue(&result.Issue{ //nolint:scopelint + FromLinter: name, + Pos: err.Position, + Text: err.Reason, + }, pass)) + } + + return nil, nil + } + }).WithIssuesReporter(func(*linter.Context) []goanalysis.Issue { + return issues + }).WithLoadMode(goanalysis.LoadModeSyntax) +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/astcache/astcache.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/astcache/astcache.go deleted file mode 100644 index ef53c71685e..00000000000 --- a/vendor/github.com/golangci/golangci-lint/pkg/lint/astcache/astcache.go +++ /dev/null @@ -1,162 +0,0 @@ -package astcache - -import ( - "go/ast" - "go/parser" - "go/token" - "path/filepath" - - "golang.org/x/tools/go/packages" - - "github.com/golangci/golangci-lint/pkg/fsutils" - "github.com/golangci/golangci-lint/pkg/logutils" -) - -type File struct { - F *ast.File - Fset *token.FileSet - Name string - Err error -} - -type Cache struct { - m map[string]*File // map from absolute file path to file data - s []*File - log logutils.Log -} - -func NewCache(log logutils.Log) *Cache { - return &Cache{ - m: map[string]*File{}, - log: log, - } -} - -func (c Cache) ParsedFilenames() []string { - var keys []string - for k := range c.m { - keys = append(keys, k) - } - return keys -} - -func (c Cache) normalizeFilename(filename string) string { - absPath := func() string { - if filepath.IsAbs(filename) { - return filepath.Clean(filename) - } - - absFilename, err := filepath.Abs(filename) - if err != nil { - c.log.Warnf("Can't abs-ify filename %s: %s", filename, err) - return filename - } - - return absFilename - }() - - ret, err := fsutils.EvalSymlinks(absPath) - if err != nil { - c.log.Warnf("Failed to eval symlinks for %s: %s", absPath, err) - return absPath - } - - return ret -} - -func (c Cache) Get(filename string) *File { - return c.m[c.normalizeFilename(filename)] -} - -func (c Cache) GetAllValidFiles() []*File { - return c.s -} - -func (c *Cache) prepareValidFiles() { - files := make([]*File, 0, len(c.m)) - for _, f := range c.m { - if f.Err != nil || f.F == nil { - continue - } - files = append(files, f) - } - c.s = files -} - -func LoadFromFilenames(log logutils.Log, filenames ...string) *Cache { - c := NewCache(log) - - fset := token.NewFileSet() - for _, filename := range filenames { - c.parseFile(filename, fset) - } - - c.prepareValidFiles() - return c -} - -func LoadFromPackages(pkgs []*packages.Package, log logutils.Log) (*Cache, error) { - c := NewCache(log) - - for _, pkg := range pkgs { - c.loadFromPackage(pkg) - } - - c.prepareValidFiles() - return c, nil -} - -func (c *Cache) extractFilenamesForAstFile(fset *token.FileSet, f *ast.File) []string { - var ret []string - - // false ignores //line comments: name can be incorrect for generated files with //line directives - // mapping e.g. from .rl to .go files. - pos := fset.PositionFor(f.Pos(), false) - if pos.Filename != "" { - ret = append(ret, pos.Filename) - } - - return ret -} - -func (c *Cache) loadFromPackage(pkg *packages.Package) { - for _, f := range pkg.Syntax { - for _, filename := range c.extractFilenamesForAstFile(pkg.Fset, f) { - filePath := c.normalizeFilename(filename) - c.m[filePath] = &File{ - F: f, - Fset: pkg.Fset, - Name: filePath, - } - } - } - - // some Go files sometimes aren't present in pkg.Syntax - fset := token.NewFileSet() // can't use pkg.Fset: it will overwrite offsets by preprocessed files - for _, filePath := range pkg.GoFiles { - filePath = c.normalizeFilename(filePath) - if c.m[filePath] == nil { - c.parseFile(filePath, fset) - } - } -} - -func (c *Cache) parseFile(filePath string, fset *token.FileSet) { - if fset == nil { - fset = token.NewFileSet() - } - - filePath = c.normalizeFilename(filePath) - - // comments needed by e.g. golint - f, err := parser.ParseFile(fset, filePath, nil, parser.ParseComments) - c.m[filePath] = &File{ - F: f, - Fset: fset, - Err: err, - Name: filePath, - } - if err != nil { - c.log.Warnf("Can't parse AST of %s: %s", filePath, err) - } -} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/linter/config.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/linter/config.go index 2dfb8e3d290..52ff9b90d43 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/lint/linter/config.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/lint/linter/config.go @@ -19,16 +19,12 @@ type Config struct { LoadMode packages.LoadMode - NeedsSSARepr bool - InPresets []string - Speed int // more value means faster execution of linter AlternativeNames []string - OriginalURL string // URL of original (not forked) repo, needed for autogenerated README - ParentLinterName string // used only for megacheck's children now - CanAutoFix bool - IsSlow bool + OriginalURL string // URL of original (not forked) repo, needed for autogenerated README + CanAutoFix bool + IsSlow bool } func (lc *Config) ConsiderSlow() *Config { @@ -48,24 +44,6 @@ func (lc *Config) WithLoadFiles() *Config { func (lc *Config) WithLoadForGoAnalysis() *Config { lc = lc.WithLoadFiles() lc.LoadMode |= packages.NeedImports | packages.NeedDeps | packages.NeedExportsFile | packages.NeedTypesSizes - return lc.ConsiderSlow() -} - -func (lc *Config) WithLoadTypeInfo() *Config { - lc = lc.WithLoadFiles() - lc.LoadMode |= packages.NeedImports | packages.NeedTypes | packages.NeedTypesSizes | packages.NeedTypesInfo | packages.NeedSyntax - return lc -} - -func (lc *Config) WithLoadDepsTypeInfo() *Config { - lc = lc.WithLoadTypeInfo() - lc.LoadMode |= packages.NeedDeps - return lc -} - -func (lc *Config) WithSSA() *Config { - lc = lc.WithLoadDepsTypeInfo() - lc.NeedsSSARepr = true return lc } @@ -74,11 +52,6 @@ func (lc *Config) WithPresets(presets ...string) *Config { return lc } -func (lc *Config) WithSpeed(speed int) *Config { - lc.Speed = speed - return lc -} - func (lc *Config) WithURL(url string) *Config { lc.OriginalURL = url return lc @@ -89,20 +62,11 @@ func (lc *Config) WithAlternativeNames(names ...string) *Config { return lc } -func (lc *Config) WithParent(parentLinterName string) *Config { - lc.ParentLinterName = parentLinterName - return lc -} - func (lc *Config) WithAutoFix() *Config { lc.CanAutoFix = true return lc } -func (lc *Config) GetSpeed() int { - return lc.Speed -} - func (lc *Config) AllNames() []string { return append([]string{lc.Name()}, lc.AlternativeNames...) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/linter/context.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/linter/context.go index 3cf38b9791c..a9f9d7d7f2b 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/lint/linter/context.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/lint/linter/context.go @@ -1,18 +1,14 @@ package linter import ( - "golang.org/x/tools/go/loader" - "golang.org/x/tools/go/packages" - "golang.org/x/tools/go/ssa" + "go/ast" - "github.com/golangci/golangci-lint/pkg/golinters/goanalysis/load" + "golang.org/x/tools/go/packages" "github.com/golangci/golangci-lint/internal/pkgcache" - - "github.com/golangci/golangci-lint/pkg/fsutils" - "github.com/golangci/golangci-lint/pkg/config" - "github.com/golangci/golangci-lint/pkg/lint/astcache" + "github.com/golangci/golangci-lint/pkg/fsutils" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis/load" "github.com/golangci/golangci-lint/pkg/logutils" ) @@ -24,24 +20,30 @@ type Context struct { // version for each of packages OriginalPackages []*packages.Package - NotCompilingPackages []*packages.Package - - LoaderConfig *loader.Config // deprecated, don't use for new linters - Program *loader.Program // deprecated, use Packages for new linters - - SSAProgram *ssa.Program // for unparam and interfacer but not for megacheck (it change it) - Cfg *config.Config - ASTCache *astcache.Cache FileCache *fsutils.FileCache LineCache *fsutils.LineCache Log logutils.Log - PkgCache *pkgcache.Cache - LoadGuard *load.Guard - NeedWholeProgram bool + PkgCache *pkgcache.Cache + LoadGuard *load.Guard } func (c *Context) Settings() *config.LintersSettings { return &c.Cfg.LintersSettings } + +func (c *Context) ClearTypesInPackages() { + for _, p := range c.Packages { + clearTypes(p) + } + for _, p := range c.OriginalPackages { + clearTypes(p) + } +} + +func clearTypes(p *packages.Package) { + p.Types = nil + p.TypesInfo = nil + p.Syntax = []*ast.File{} +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/linter/metalinter.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/linter/metalinter.go deleted file mode 100644 index ee235640f2e..00000000000 --- a/vendor/github.com/golangci/golangci-lint/pkg/lint/linter/metalinter.go +++ /dev/null @@ -1,8 +0,0 @@ -package linter - -type MetaLinter interface { - Name() string - BuildLinterConfig(enabledChildren []string) (*Config, error) - AllChildLinterNames() []string - DefaultChildLinterNames() []string -} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/enabled_set.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/enabled_set.go index 7767fee290c..a3b73e7074b 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/enabled_set.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/enabled_set.go @@ -3,11 +3,8 @@ package lintersdb import ( "sort" - "golang.org/x/tools/go/analysis" - - "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" - "github.com/golangci/golangci-lint/pkg/config" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/logutils" ) @@ -30,7 +27,6 @@ func NewEnabledSet(m *Manager, v *Validator, log logutils.Log, cfg *config.Confi } } -// nolint:gocyclo func (es EnabledSet) build(lcfg *config.Linters, enabledByDefaultLinters []*linter.Config) map[string]*linter.Config { resultLintersSet := map[string]*linter.Config{} switch { @@ -56,71 +52,30 @@ func (es EnabledSet) build(lcfg *config.Linters, enabledByDefaultLinters []*lint // It should be after --presets to be able to run only fast linters in preset. // It should be before --enable and --disable to be able to enable or disable specific linter. if lcfg.Fast { - for name := range resultLintersSet { - if es.m.GetLinterConfig(name).IsSlowLinter() { + for name, lc := range resultLintersSet { + if lc.IsSlowLinter() { delete(resultLintersSet, name) } } } - metaLinters := es.m.GetMetaLinters() - for _, name := range lcfg.Enable { - if metaLinter := metaLinters[name]; metaLinter != nil { - // e.g. if we use --enable=megacheck we should add staticcheck,unused and gosimple to result set - for _, childLinter := range metaLinter.DefaultChildLinterNames() { - resultLintersSet[childLinter] = es.m.GetLinterConfig(childLinter) - } - continue + for _, lc := range es.m.GetLinterConfigs(name) { + // it's important to use lc.Name() nor name because name can be alias + resultLintersSet[lc.Name()] = lc } - - lc := es.m.GetLinterConfig(name) - // it's important to use lc.Name() nor name because name can be alias - resultLintersSet[lc.Name()] = lc } for _, name := range lcfg.Disable { - if metaLinter := metaLinters[name]; metaLinter != nil { - // e.g. if we use --disable=megacheck we should remove staticcheck,unused and gosimple from result set - for _, childLinter := range metaLinter.DefaultChildLinterNames() { - delete(resultLintersSet, childLinter) - } - continue + for _, lc := range es.m.GetLinterConfigs(name) { + // it's important to use lc.Name() nor name because name can be alias + delete(resultLintersSet, lc.Name()) } - - lc := es.m.GetLinterConfig(name) - // it's important to use lc.Name() nor name because name can be alias - delete(resultLintersSet, lc.Name()) } return resultLintersSet } -func (es EnabledSet) optimizeLintersSet(linters map[string]*linter.Config) { - for _, metaLinter := range es.m.GetMetaLinters() { - var children []string - for _, child := range metaLinter.AllChildLinterNames() { - if _, ok := linters[child]; ok { - children = append(children, child) - } - } - - if len(children) <= 1 { - continue - } - - for _, child := range children { - delete(linters, child) - } - builtLinterConfig, err := metaLinter.BuildLinterConfig(children) - if err != nil { - panic("shouldn't fail during linter building: " + err.Error()) - } - linters[metaLinter.Name()] = builtLinterConfig - es.log.Infof("Optimized sublinters %s into metalinter %s", children, metaLinter.Name()) - } -} - func (es EnabledSet) Get(optimize bool) ([]*linter.Config, error) { if err := es.v.validateEnabledDisabledLintersConfig(&es.cfg.Linters); err != nil { return nil, err @@ -129,9 +84,8 @@ func (es EnabledSet) Get(optimize bool) ([]*linter.Config, error) { resultLintersSet := es.build(&es.cfg.Linters, es.m.GetAllEnabledByDefaultLinters()) es.verbosePrintLintersStatus(resultLintersSet) if optimize { - es.optimizeLintersSet(resultLintersSet) + es.combineGoAnalysisLinters(resultLintersSet) } - es.combineGoAnalysisLinters(resultLintersSet) var resultLinters []*linter.Config for _, lc := range resultLintersSet { @@ -144,28 +98,22 @@ func (es EnabledSet) Get(optimize bool) ([]*linter.Config, error) { func (es EnabledSet) combineGoAnalysisLinters(linters map[string]*linter.Config) { var goanalysisLinters []*goanalysis.Linter goanalysisPresets := map[string]bool{} - analyzerToLinterName := map[*analysis.Analyzer]string{} for _, linter := range linters { - lnt, ok := linter.Linter.(goanalysis.SupportedLinter) + lnt, ok := linter.Linter.(*goanalysis.Linter) if !ok { continue } - - analyzers := lnt.Analyzers() - if len(analyzers) == 0 { - continue // e.g. if "unused" is enabled + if lnt.LoadMode() == goanalysis.LoadModeWholeProgram { + // It's ineffective by CPU and memory to run whole-program and incremental analyzers at once. + continue } - gl := goanalysis.NewLinter(linter.Name(), "", analyzers, lnt.Cfg()) - goanalysisLinters = append(goanalysisLinters, gl) + goanalysisLinters = append(goanalysisLinters, lnt) for _, p := range linter.InPresets { goanalysisPresets[p] = true } - for a, name := range lnt.AnalyzerToLinterNameMapping() { - analyzerToLinterName[a] = name - } } - if len(goanalysisLinters) <= 1 { + if len(goanalysisLinters) <= 1 { //nolint:gomnd es.debugf("Didn't combine go/analysis linters: got only %d linters", len(goanalysisLinters)) return } @@ -174,7 +122,7 @@ func (es EnabledSet) combineGoAnalysisLinters(linters map[string]*linter.Config) delete(linters, lnt.Name()) } - ml := goanalysis.NewMetaLinter(goanalysisLinters, analyzerToLinterName) + ml := goanalysis.NewMetaLinter(goanalysisLinters) var presets []string for p := range goanalysisPresets { @@ -184,13 +132,11 @@ func (es EnabledSet) combineGoAnalysisLinters(linters map[string]*linter.Config) mlConfig := &linter.Config{ Linter: ml, EnabledByDefault: false, - NeedsSSARepr: false, InPresets: presets, - Speed: 5, AlternativeNames: nil, OriginalURL: "", - ParentLinterName: "", } + mlConfig = mlConfig.WithLoadForGoAnalysis() linters[ml.Name()] = mlConfig diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/manager.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/manager.go index 27862a7b0bc..cf71c1f4636 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/manager.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/manager.go @@ -1,29 +1,57 @@ package lintersdb import ( + "fmt" "os" + "plugin" - "github.com/golangci/golangci-lint/pkg/config" + "golang.org/x/tools/go/analysis" + "github.com/golangci/golangci-lint/pkg/config" "github.com/golangci/golangci-lint/pkg/golinters" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis" "github.com/golangci/golangci-lint/pkg/lint/linter" + "github.com/golangci/golangci-lint/pkg/logutils" + "github.com/golangci/golangci-lint/pkg/report" ) type Manager struct { - nameToLC map[string]*linter.Config - cfg *config.Config + nameToLCs map[string][]*linter.Config + cfg *config.Config + log logutils.Log } -func NewManager(cfg *config.Config) *Manager { - m := &Manager{cfg: cfg} - nameToLC := make(map[string]*linter.Config) +func NewManager(cfg *config.Config, log logutils.Log) *Manager { + m := &Manager{cfg: cfg, log: log} + nameToLCs := make(map[string][]*linter.Config) for _, lc := range m.GetAllSupportedLinterConfigs() { for _, name := range lc.AllNames() { - nameToLC[name] = lc + nameToLCs[name] = append(nameToLCs[name], lc) } } - m.nameToLC = nameToLC + m.nameToLCs = nameToLCs + return m +} + +func (m *Manager) WithCustomLinters() *Manager { + if m.log == nil { + m.log = report.NewLogWrapper(logutils.NewStderrLog(""), &report.Data{}) + } + if m.cfg != nil { + for name, settings := range m.cfg.LintersSettings.Custom { + lc, err := m.loadCustomLinterConfig(name, settings) + + if err != nil { + m.log.Errorf("Unable to load custom analyzer %s:%s, %v", + name, + settings.Path, + err) + } else { + m.nameToLCs[name] = append(m.nameToLCs[name], lc) + } + } + } return m } @@ -40,17 +68,8 @@ func (m Manager) allPresetsSet() map[string]bool { return ret } -func (m Manager) GetMetaLinter(name string) linter.MetaLinter { - return m.GetMetaLinters()[name] -} - -func (m Manager) GetLinterConfig(name string) *linter.Config { - lc, ok := m.nameToLC[name] - if !ok { - return nil - } - - return lc +func (m Manager) GetLinterConfigs(name string) []*linter.Config { + return m.nameToLCs[name] } func enableLinterConfigs(lcs []*linter.Config, isEnabled func(lc *linter.Config) bool) []*linter.Config { @@ -64,215 +83,186 @@ func enableLinterConfigs(lcs []*linter.Config, isEnabled func(lc *linter.Config) return ret } -func (Manager) GetMetaLinters() map[string]linter.MetaLinter { - metaLinters := []linter.MetaLinter{ - golinters.MegacheckMetalinter{}, - } - - ret := map[string]linter.MetaLinter{} - for _, metaLinter := range metaLinters { - ret[metaLinter.Name()] = metaLinter - } - - return ret -} - //nolint:funlen func (m Manager) GetAllSupportedLinterConfigs() []*linter.Config { var govetCfg *config.GovetSettings if m.cfg != nil { govetCfg = &m.cfg.LintersSettings.Govet } + const megacheckName = "megacheck" lcs := []*linter.Config{ linter.NewConfig(golinters.NewGovet(govetCfg)). WithLoadForGoAnalysis(). WithPresets(linter.PresetBugs). - WithSpeed(4). WithAlternativeNames("vet", "vetshadow"). WithURL("https://golang.org/cmd/vet/"), linter.NewConfig(golinters.NewBodyclose()). WithLoadForGoAnalysis(). WithPresets(linter.PresetPerformance, linter.PresetBugs). - WithSpeed(4). WithURL("https://github.com/timakin/bodyclose"), - linter.NewConfig(golinters.Errcheck{}). - WithLoadTypeInfo(). + linter.NewConfig(golinters.NewErrcheck()). + WithLoadForGoAnalysis(). WithPresets(linter.PresetBugs). - WithSpeed(10). WithURL("https://github.com/kisielk/errcheck"), - linter.NewConfig(golinters.Golint{}). + linter.NewConfig(golinters.NewGolint()). + WithLoadForGoAnalysis(). WithPresets(linter.PresetStyle). - WithSpeed(3). WithURL("https://github.com/golang/lint"), + linter.NewConfig(golinters.NewRowsErrCheck()). + WithLoadForGoAnalysis(). + WithPresets(linter.PresetPerformance, linter.PresetBugs). + WithURL("https://github.com/jingyugao/rowserrcheck"), linter.NewConfig(golinters.NewStaticcheck()). WithLoadForGoAnalysis(). WithPresets(linter.PresetBugs). - WithSpeed(2). + WithAlternativeNames(megacheckName). WithURL("https://staticcheck.io/"), linter.NewConfig(golinters.NewUnused()). - WithLoadDepsTypeInfo(). + WithLoadForGoAnalysis(). WithPresets(linter.PresetUnused). - WithSpeed(5). - WithURL("https://github.com/dominikh/go-tools/tree/master/cmd/unused"), + WithAlternativeNames(megacheckName). + ConsiderSlow(). + WithURL("https://github.com/dominikh/go-tools/tree/master/unused"), linter.NewConfig(golinters.NewGosimple()). WithLoadForGoAnalysis(). WithPresets(linter.PresetStyle). - WithSpeed(5). - WithURL("https://github.com/dominikh/go-tools/tree/master/cmd/gosimple"), + WithAlternativeNames(megacheckName). + WithURL("https://github.com/dominikh/go-tools/tree/master/simple"), linter.NewConfig(golinters.NewStylecheck()). WithLoadForGoAnalysis(). WithPresets(linter.PresetStyle). - WithSpeed(5). WithURL("https://github.com/dominikh/go-tools/tree/master/stylecheck"), - linter.NewConfig(golinters.Gosec{}). - WithLoadTypeInfo(). + linter.NewConfig(golinters.NewGosec()). + WithLoadForGoAnalysis(). WithPresets(linter.PresetBugs). - WithSpeed(8). WithURL("https://github.com/securego/gosec"). WithAlternativeNames("gas"), - linter.NewConfig(golinters.Structcheck{}). - WithLoadTypeInfo(). + linter.NewConfig(golinters.NewStructcheck()). + WithLoadForGoAnalysis(). WithPresets(linter.PresetUnused). - WithSpeed(10). WithURL("https://github.com/opennota/check"), - linter.NewConfig(golinters.Varcheck{}). - WithLoadTypeInfo(). + linter.NewConfig(golinters.NewVarcheck()). + WithLoadForGoAnalysis(). WithPresets(linter.PresetUnused). - WithSpeed(10). WithURL("https://github.com/opennota/check"), - linter.NewConfig(golinters.Interfacer{}). - WithLoadDepsTypeInfo(). - WithSSA(). + linter.NewConfig(golinters.NewInterfacer()). + WithLoadForGoAnalysis(). WithPresets(linter.PresetStyle). - WithSpeed(6). WithURL("https://github.com/mvdan/interfacer"), - linter.NewConfig(golinters.Unconvert{}). - WithLoadTypeInfo(). + linter.NewConfig(golinters.NewUnconvert()). + WithLoadForGoAnalysis(). WithPresets(linter.PresetStyle). - WithSpeed(10). WithURL("https://github.com/mdempsky/unconvert"), - linter.NewConfig(golinters.Ineffassign{}). + linter.NewConfig(golinters.NewIneffassign()). WithPresets(linter.PresetUnused). - WithSpeed(9). WithURL("https://github.com/gordonklaus/ineffassign"), - linter.NewConfig(golinters.Dupl{}). + linter.NewConfig(golinters.NewDupl()). WithPresets(linter.PresetStyle). - WithSpeed(7). WithURL("https://github.com/mibk/dupl"), - linter.NewConfig(golinters.Goconst{}). + linter.NewConfig(golinters.NewGoconst()). WithPresets(linter.PresetStyle). - WithSpeed(9). WithURL("https://github.com/jgautheron/goconst"), - linter.NewConfig(golinters.Deadcode{}). - WithLoadTypeInfo(). + linter.NewConfig(golinters.NewDeadcode()). + WithLoadForGoAnalysis(). WithPresets(linter.PresetUnused). - WithSpeed(10). WithURL("https://github.com/remyoudompheng/go-misc/tree/master/deadcode"), - linter.NewConfig(golinters.Gocyclo{}). + linter.NewConfig(golinters.NewGocyclo()). WithPresets(linter.PresetComplexity). - WithSpeed(8). WithURL("https://github.com/alecthomas/gocyclo"), - linter.NewConfig(golinters.TypeCheck{}). - WithLoadTypeInfo(). + linter.NewConfig(golinters.NewGocognit()). + WithPresets(linter.PresetComplexity). + WithURL("https://github.com/uudashr/gocognit"), + linter.NewConfig(golinters.NewTypecheck()). + WithLoadForGoAnalysis(). WithPresets(linter.PresetBugs). - WithSpeed(10). WithURL(""), - linter.NewConfig(golinters.Gofmt{}). + linter.NewConfig(golinters.NewGofmt()). WithPresets(linter.PresetFormatting). - WithSpeed(7). WithAutoFix(). WithURL("https://golang.org/cmd/gofmt/"), - linter.NewConfig(golinters.Gofmt{UseGoimports: true}). + linter.NewConfig(golinters.NewGoimports()). WithPresets(linter.PresetFormatting). - WithSpeed(5). WithAutoFix(). WithURL("https://godoc.org/golang.org/x/tools/cmd/goimports"), - linter.NewConfig(golinters.Maligned{}). - WithLoadTypeInfo(). + linter.NewConfig(golinters.NewMaligned()). + WithLoadForGoAnalysis(). WithPresets(linter.PresetPerformance). - WithSpeed(10). WithURL("https://github.com/mdempsky/maligned"), - linter.NewConfig(golinters.Depguard{}). - WithLoadTypeInfo(). + linter.NewConfig(golinters.NewDepguard()). + WithLoadForGoAnalysis(). WithPresets(linter.PresetStyle). - WithSpeed(6). WithURL("https://github.com/OpenPeeDeeP/depguard"), - linter.NewConfig(golinters.Misspell{}). + linter.NewConfig(golinters.NewMisspell()). WithPresets(linter.PresetStyle). - WithSpeed(7). WithAutoFix(). WithURL("https://github.com/client9/misspell"), - linter.NewConfig(golinters.Lll{}). + linter.NewConfig(golinters.NewLLL()). WithPresets(linter.PresetStyle). - WithSpeed(10). WithURL("https://github.com/walle/lll"), - linter.NewConfig(golinters.Unparam{}). + linter.NewConfig(golinters.NewUnparam()). WithPresets(linter.PresetUnused). - WithSpeed(3). - WithLoadDepsTypeInfo(). - WithSSA(). + WithLoadForGoAnalysis(). WithURL("https://github.com/mvdan/unparam"), - linter.NewConfig(golinters.Dogsled{}). + linter.NewConfig(golinters.NewDogsled()). WithPresets(linter.PresetStyle). - WithSpeed(10). WithURL("https://github.com/alexkohler/dogsled"), - linter.NewConfig(golinters.Nakedret{}). + linter.NewConfig(golinters.NewNakedret()). WithPresets(linter.PresetComplexity). - WithSpeed(10). WithURL("https://github.com/alexkohler/nakedret"), - linter.NewConfig(golinters.Prealloc{}). + linter.NewConfig(golinters.NewPrealloc()). WithPresets(linter.PresetPerformance). - WithSpeed(8). WithURL("https://github.com/alexkohler/prealloc"), - linter.NewConfig(golinters.Scopelint{}). + linter.NewConfig(golinters.NewScopelint()). WithPresets(linter.PresetBugs). - WithSpeed(8). WithURL("https://github.com/kyoh86/scopelint"), - linter.NewConfig(golinters.Gocritic{}). + linter.NewConfig(golinters.NewGocritic()). WithPresets(linter.PresetStyle). - WithSpeed(5). - WithLoadTypeInfo(). + WithLoadForGoAnalysis(). WithURL("https://github.com/go-critic/go-critic"), - linter.NewConfig(golinters.Gochecknoinits{}). + linter.NewConfig(golinters.NewGochecknoinits()). WithPresets(linter.PresetStyle). - WithSpeed(10). WithURL("https://github.com/leighmcculloch/gochecknoinits"), - linter.NewConfig(golinters.Gochecknoglobals{}). + linter.NewConfig(golinters.NewGochecknoglobals()). WithPresets(linter.PresetStyle). - WithSpeed(10). WithURL("https://github.com/leighmcculloch/gochecknoglobals"), - linter.NewConfig(golinters.Godox{}). + linter.NewConfig(golinters.NewGodox()). WithPresets(linter.PresetStyle). - WithSpeed(10). WithURL("https://github.com/matoous/godox"), - linter.NewConfig(golinters.Funlen{}). + linter.NewConfig(golinters.NewFunlen()). WithPresets(linter.PresetStyle). - WithSpeed(10). WithURL("https://github.com/ultraware/funlen"), - linter.NewConfig(golinters.Whitespace{}). + linter.NewConfig(golinters.NewWhitespace()). WithPresets(linter.PresetStyle). - WithSpeed(10). WithAutoFix(). WithURL("https://github.com/ultraware/whitespace"), + linter.NewConfig(golinters.NewWSL()). + WithPresets(linter.PresetStyle). + WithURL("https://github.com/bombsimon/wsl"), + linter.NewConfig(golinters.NewGoPrintfFuncName()). + WithPresets(linter.PresetStyle). + WithURL("https://github.com/jirfag/go-printf-func-name"), + linter.NewConfig(golinters.NewGoMND(m.cfg)). + WithPresets(linter.PresetStyle). + WithURL("https://github.com/tommy-muehle/go-mnd"), } isLocalRun := os.Getenv("GOLANGCI_COM_RUN") == "" enabledByDefault := map[string]bool{ - golinters.NewGovet(nil).Name(): true, - golinters.Errcheck{}.Name(): true, - golinters.Staticcheck{}.Name(): true, - golinters.Unused{}.Name(): true, - golinters.Gosimple{}.Name(): true, - golinters.Structcheck{}.Name(): true, - golinters.Varcheck{}.Name(): true, - golinters.Ineffassign{}.Name(): true, - golinters.Deadcode{}.Name(): true, + golinters.NewGovet(nil).Name(): true, + golinters.NewErrcheck().Name(): true, + golinters.NewStaticcheck().Name(): true, + golinters.NewUnused().Name(): true, + golinters.NewGosimple().Name(): true, + golinters.NewStructcheck().Name(): true, + golinters.NewVarcheck().Name(): true, + golinters.NewIneffassign().Name(): true, + golinters.NewDeadcode().Name(): true, // don't typecheck for golangci.com: too many troubles - golinters.TypeCheck{}.Name(): isLocalRun, + golinters.NewTypecheck().Name(): isLocalRun, } return enableLinterConfigs(lcs, func(lc *linter.Config) bool { return enabledByDefault[lc.Name()] @@ -313,3 +303,44 @@ func (m Manager) GetAllLinterConfigsForPreset(p string) []*linter.Config { return ret } + +func (m Manager) loadCustomLinterConfig(name string, settings config.CustomLinterSettings) (*linter.Config, error) { + analyzer, err := m.getAnalyzerPlugin(settings.Path) + if err != nil { + return nil, err + } + m.log.Infof("Loaded %s: %s", settings.Path, name) + customLinter := goanalysis.NewLinter( + name, + settings.Description, + analyzer.GetAnalyzers(), + nil).WithLoadMode(goanalysis.LoadModeTypesInfo) + linterConfig := linter.NewConfig(customLinter) + linterConfig.EnabledByDefault = true + linterConfig.IsSlow = false + linterConfig.WithURL(settings.OriginalURL) + return linterConfig, nil +} + +type AnalyzerPlugin interface { + GetAnalyzers() []*analysis.Analyzer +} + +func (m Manager) getAnalyzerPlugin(path string) (AnalyzerPlugin, error) { + plug, err := plugin.Open(path) + if err != nil { + return nil, err + } + + symbol, err := plug.Lookup("AnalyzerPlugin") + if err != nil { + return nil, err + } + + analyzerPlugin, ok := symbol.(AnalyzerPlugin) + if !ok { + return nil, fmt.Errorf("plugin %s does not abide by 'AnalyzerPlugin' interface", path) + } + + return analyzerPlugin, nil +} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/validator.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/validator.go index 7e1f878897b..d7e3699c851 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/validator.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/lint/lintersdb/validator.go @@ -21,7 +21,7 @@ func (v Validator) validateLintersNames(cfg *config.Linters) error { allNames := append([]string{}, cfg.Enable...) allNames = append(allNames, cfg.Disable...) for _, name := range allNames { - if v.m.GetLinterConfig(name) == nil && v.m.GetMetaLinter(name) == nil { + if v.m.GetLinterConfigs(name) == nil { return fmt.Errorf("no such linter %q", name) } } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/load.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/load.go index 1afff37e815..de0ab4117c3 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/lint/load.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/lint/load.go @@ -5,29 +5,21 @@ import ( "fmt" "go/build" "go/token" - "go/types" "os" "path/filepath" "regexp" "strings" "time" - "github.com/golangci/golangci-lint/pkg/golinters/goanalysis/load" - - "github.com/golangci/golangci-lint/internal/pkgcache" - - "github.com/golangci/golangci-lint/pkg/fsutils" - "github.com/pkg/errors" - "golang.org/x/tools/go/loader" "golang.org/x/tools/go/packages" - "golang.org/x/tools/go/ssa" - "golang.org/x/tools/go/ssa/ssautil" + "github.com/golangci/golangci-lint/internal/pkgcache" "github.com/golangci/golangci-lint/pkg/config" "github.com/golangci/golangci-lint/pkg/exitcodes" + "github.com/golangci/golangci-lint/pkg/fsutils" + "github.com/golangci/golangci-lint/pkg/golinters/goanalysis/load" "github.com/golangci/golangci-lint/pkg/goutil" - "github.com/golangci/golangci-lint/pkg/lint/astcache" "github.com/golangci/golangci-lint/pkg/lint/linter" "github.com/golangci/golangci-lint/pkg/logutils" ) @@ -72,84 +64,6 @@ func (cl *ContextLoader) prepareBuildContext() { build.Default.BuildTags = cl.cfg.Run.BuildTags } -func (cl *ContextLoader) makeFakeLoaderPackageInfo(pkg *packages.Package) *loader.PackageInfo { - var errs []error - for _, err := range pkg.Errors { - errs = append(errs, err) - } - - typeInfo := &types.Info{} - if pkg.TypesInfo != nil { - typeInfo = pkg.TypesInfo - } - - return &loader.PackageInfo{ - Pkg: pkg.Types, - Importable: true, // not used - TransitivelyErrorFree: !pkg.IllTyped, - - // use compiled (preprocessed) go files AST; - // AST linters use not preprocessed go files AST - Files: pkg.Syntax, - Errors: errs, - Info: *typeInfo, - } -} - -func (cl *ContextLoader) makeFakeLoaderProgram(pkgs []*packages.Package) *loader.Program { - var createdPkgs []*loader.PackageInfo - for _, pkg := range pkgs { - if pkg.IllTyped { - // some linters crash on packages with errors, - // skip them and warn about them in another place - continue - } - - pkgInfo := cl.makeFakeLoaderPackageInfo(pkg) - createdPkgs = append(createdPkgs, pkgInfo) - } - - allPkgs := map[*types.Package]*loader.PackageInfo{} - for _, pkg := range createdPkgs { - pkg := pkg - allPkgs[pkg.Pkg] = pkg - } - for _, pkg := range pkgs { - if pkg.IllTyped { - // some linters crash on packages with errors, - // skip them and warn about them in another place - continue - } - - for _, impPkg := range pkg.Imports { - // don't use astcache for imported packages: we don't find issues in cgo imported deps - pkgInfo := cl.makeFakeLoaderPackageInfo(impPkg) - allPkgs[pkgInfo.Pkg] = pkgInfo - } - } - - return &loader.Program{ - Fset: pkgs[0].Fset, - Imported: nil, // not used without .Created in any linter - Created: createdPkgs, // all initial packages - AllPackages: allPkgs, // all initial packages and their depndencies - } -} - -func (cl *ContextLoader) buildSSAProgram(pkgs []*packages.Package) *ssa.Program { - startedAt := time.Now() - var pkgsBuiltDuration time.Duration - defer func() { - cl.log.Infof("SSA repr building timing: packages building %s, total %s", - pkgsBuiltDuration, time.Since(startedAt)) - }() - - ssaProg, _ := ssautil.Packages(pkgs, ssa.GlobalDebug) - pkgsBuiltDuration = time.Since(startedAt) - ssaProg.Build() - return ssaProg -} - func (cl *ContextLoader) findLoadMode(linters []*linter.Config) packages.LoadMode { loadMode := packages.LoadMode(0) for _, lc := range linters { @@ -305,13 +219,13 @@ func (cl *ContextLoader) loadPackages(ctx context.Context, loadMode packages.Loa return cl.filterTestMainPackages(pkgs), nil } -func (cl *ContextLoader) tryParseTestPackage(pkg *packages.Package) (name, testName string, isTest bool) { +func (cl *ContextLoader) tryParseTestPackage(pkg *packages.Package) (name string, isTest bool) { matches := cl.pkgTestIDRe.FindStringSubmatch(pkg.ID) if matches == nil { - return "", "", false + return "", false } - return matches[1], matches[2], true + return matches[1], true } func (cl *ContextLoader) filterTestMainPackages(pkgs []*packages.Package) []*packages.Package { @@ -332,7 +246,7 @@ func (cl *ContextLoader) filterTestMainPackages(pkgs []*packages.Package) []*pac func (cl *ContextLoader) filterDuplicatePackages(pkgs []*packages.Package) []*packages.Package { packagesWithTests := map[string]bool{} for _, pkg := range pkgs { - name, _, isTest := cl.tryParseTestPackage(pkg) + name, isTest := cl.tryParseTestPackage(pkg) if !isTest { continue } @@ -343,7 +257,7 @@ func (cl *ContextLoader) filterDuplicatePackages(pkgs []*packages.Package) []*pa var retPkgs []*packages.Package for _, pkg := range pkgs { - _, _, isTest := cl.tryParseTestPackage(pkg) + _, isTest := cl.tryParseTestPackage(pkg) if !isTest && packagesWithTests[pkg.PkgPath] { // If tests loading is enabled, // for package with files a.go and a_test.go go/packages loads two packages: @@ -361,16 +275,6 @@ func (cl *ContextLoader) filterDuplicatePackages(pkgs []*packages.Package) []*pa return retPkgs } -func needSSA(linters []*linter.Config) bool { - for _, lc := range linters { - if lc.NeedsSSARepr { - return true - } - } - return false -} - -//nolint:gocyclo func (cl *ContextLoader) Load(ctx context.Context, linters []*linter.Config) (*linter.Context, error) { loadMode := cl.findLoadMode(linters) pkgs, err := cl.loadPackages(ctx, loadMode) @@ -384,22 +288,6 @@ func (cl *ContextLoader) Load(ctx context.Context, linters []*linter.Config) (*l return nil, exitcodes.ErrNoGoFiles } - var prog *loader.Program - if loadMode&packages.NeedTypes != 0 { - prog = cl.makeFakeLoaderProgram(deduplicatedPkgs) - } - - var ssaProg *ssa.Program - if needSSA(linters) { - ssaProg = cl.buildSSAProgram(deduplicatedPkgs) - } - - astLog := cl.log.Child("astcache") - astCache, err := astcache.LoadFromPackages(deduplicatedPkgs, astLog) - if err != nil { - return nil, err - } - ret := &linter.Context{ Packages: deduplicatedPkgs, @@ -407,50 +295,13 @@ func (cl *ContextLoader) Load(ctx context.Context, linters []*linter.Config) (*l // see https://github.com/golangci/golangci-lint/pull/585. OriginalPackages: pkgs, - Program: prog, - SSAProgram: ssaProg, - LoaderConfig: &loader.Config{ - Cwd: "", // used by depguard and fallbacked to os.Getcwd - Build: nil, // used by depguard and megacheck and fallbacked to build.Default - }, - Cfg: cl.cfg, - ASTCache: astCache, - Log: cl.log, - FileCache: cl.fileCache, - LineCache: cl.lineCache, - PkgCache: cl.pkgCache, - LoadGuard: cl.loadGuard, - NeedWholeProgram: loadMode&packages.NeedDeps != 0 && loadMode&packages.NeedTypesInfo != 0, + Cfg: cl.cfg, + Log: cl.log, + FileCache: cl.fileCache, + LineCache: cl.lineCache, + PkgCache: cl.pkgCache, + LoadGuard: cl.loadGuard, } - separateNotCompilingPackages(ret) return ret, nil } - -// separateNotCompilingPackages moves not compiling packages into separate slice: -// a lot of linters crash on such packages -func separateNotCompilingPackages(lintCtx *linter.Context) { - // Separate deduplicated packages - goodPkgs := make([]*packages.Package, 0, len(lintCtx.Packages)) - for _, pkg := range lintCtx.Packages { - if pkg.IllTyped { - lintCtx.NotCompilingPackages = append(lintCtx.NotCompilingPackages, pkg) - } else { - goodPkgs = append(goodPkgs, pkg) - } - } - - lintCtx.Packages = goodPkgs - if len(lintCtx.NotCompilingPackages) != 0 { - lintCtx.Log.Infof("Packages that do not compile: %+v", lintCtx.NotCompilingPackages) - } - - // Separate original (not deduplicated) packages - goodOriginalPkgs := make([]*packages.Package, 0, len(lintCtx.OriginalPackages)) - for _, pkg := range lintCtx.OriginalPackages { - if !pkg.IllTyped { - goodOriginalPkgs = append(goodOriginalPkgs, pkg) - } - } - lintCtx.OriginalPackages = goodOriginalPkgs -} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/lint/runner.go b/vendor/github.com/golangci/golangci-lint/pkg/lint/runner.go index 52a0f0fdfc9..4dc40f3fe04 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/lint/runner.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/lint/runner.go @@ -3,26 +3,23 @@ package lint import ( "context" "fmt" + "os" "runtime/debug" - "sort" "strings" - "sync" - "time" "github.com/golangci/golangci-lint/internal/errorutil" - "github.com/golangci/golangci-lint/pkg/lint/lintersdb" - - "github.com/golangci/golangci-lint/pkg/fsutils" - "github.com/golangci/golangci-lint/pkg/config" + "github.com/golangci/golangci-lint/pkg/fsutils" "github.com/golangci/golangci-lint/pkg/goutil" - "github.com/golangci/golangci-lint/pkg/lint/astcache" "github.com/golangci/golangci-lint/pkg/lint/linter" + "github.com/golangci/golangci-lint/pkg/lint/lintersdb" "github.com/golangci/golangci-lint/pkg/logutils" "github.com/golangci/golangci-lint/pkg/packages" "github.com/golangci/golangci-lint/pkg/result" "github.com/golangci/golangci-lint/pkg/result/processors" "github.com/golangci/golangci-lint/pkg/timeutils" + + gopackages "golang.org/x/tools/go/packages" ) type Runner struct { @@ -30,8 +27,8 @@ type Runner struct { Log logutils.Log } -func NewRunner(astCache *astcache.Cache, cfg *config.Config, log logutils.Log, goenv *goutil.Env, - lineCache *fsutils.LineCache, dbManager *lintersdb.Manager) (*Runner, error) { +func NewRunner(cfg *config.Config, log logutils.Log, goenv *goutil.Env, + lineCache *fsutils.LineCache, dbManager *lintersdb.Manager, pkgs []*gopackages.Package) (*Runner, error) { icfg := cfg.Issues excludePatterns := icfg.ExcludePatterns if icfg.UseDefaultExcludes { @@ -70,16 +67,23 @@ func NewRunner(astCache *astcache.Cache, cfg *config.Config, log logutils.Log, g return &Runner{ Processors: []processors.Processor{ processors.NewCgo(goenv), - processors.NewFilenameUnadjuster(astCache, log.Child("filename_unadjuster")), // must go after Cgo - processors.NewPathPrettifier(), // must be before diff, nolint and exclude autogenerated processor at least + + // Must go after Cgo. + processors.NewFilenameUnadjuster(pkgs, log.Child("filename_unadjuster")), + + // Must be before diff, nolint and exclude autogenerated processor at least. + processors.NewPathPrettifier(), skipFilesProcessor, skipDirsProcessor, // must be after path prettifier - processors.NewAutogeneratedExclude(astCache), - processors.NewIdentifierMarker(), // must be before exclude because users see already marked output and configure excluding by it + processors.NewAutogeneratedExclude(), + + // Must be before exclude because users see already marked output and configure excluding by it. + processors.NewIdentifierMarker(), + processors.NewExclude(excludeTotalPattern), processors.NewExcludeRules(excludeRules, lineCache, log.Child("exclude_rules")), - processors.NewNolint(astCache, log.Child("nolint"), dbManager), + processors.NewNolint(log.Child("nolint"), dbManager), processors.NewUniqByLine(cfg), processors.NewDiff(icfg.Diff, icfg.DiffFromRevision, icfg.DiffPatchFilePath), @@ -93,12 +97,6 @@ func NewRunner(astCache *astcache.Cache, cfg *config.Config, log logutils.Log, g }, nil } -type lintRes struct { - linter *linter.Config - err error - issues []result.Issue -} - func (r *Runner) runLinterSafe(ctx context.Context, lintCtx *linter.Context, lc *linter.Config) (ret []result.Issue, err error) { defer func() { @@ -115,112 +113,23 @@ func (r *Runner) runLinterSafe(ctx context.Context, lintCtx *linter.Context, specificLintCtx := *lintCtx specificLintCtx.Log = r.Log.Child(lc.Name()) + + // Packages in lintCtx might be dirty due to the last analysis, + // which affects to the next analysis. + // To avoid this issue, we clear type information from the packages. + specificLintCtx.ClearTypesInPackages() issues, err := lc.Linter.Run(ctx, &specificLintCtx) if err != nil { return nil, err } - for _, i := range issues { - i.FromLinter = lc.Name() - } - - return issues, nil -} - -func (r Runner) runWorker(ctx context.Context, lintCtx *linter.Context, - tasksCh <-chan *linter.Config, lintResultsCh chan<- lintRes, name string) { - sw := timeutils.NewStopwatch(name, r.Log) - defer sw.Print() - - for { - select { - case <-ctx.Done(): - return - case lc, ok := <-tasksCh: - if !ok { - return - } - if ctx.Err() != nil { - // XXX: if check it in only int a select - // it's possible to not enter to this case until tasksCh is empty. - return - } - var issues []result.Issue - var err error - sw.TrackStage(lc.Name(), func() { - issues, err = r.runLinterSafe(ctx, lintCtx, lc) - }) - lintResultsCh <- lintRes{ - linter: lc, - err: err, - issues: issues, - } - } - } -} - -func (r Runner) logWorkersStat(workersFinishTimes []time.Time) { - lastFinishTime := workersFinishTimes[0] - for _, t := range workersFinishTimes { - if t.After(lastFinishTime) { - lastFinishTime = t + for i := range issues { + if issues[i].FromLinter == "" { + issues[i].FromLinter = lc.Name() } } - logStrings := []string{} - for i, t := range workersFinishTimes { - if t.Equal(lastFinishTime) { - continue - } - - logStrings = append(logStrings, fmt.Sprintf("#%d: %s", i+1, lastFinishTime.Sub(t))) - } - - r.Log.Infof("Workers idle times: %s", strings.Join(logStrings, ", ")) -} - -func getSortedLintersConfigs(linters []*linter.Config) []*linter.Config { - ret := make([]*linter.Config, len(linters)) - copy(ret, linters) - - sort.Slice(ret, func(i, j int) bool { - return ret[i].GetSpeed() < ret[j].GetSpeed() - }) - - return ret -} - -func (r *Runner) runWorkers(ctx context.Context, lintCtx *linter.Context, linters []*linter.Config) <-chan lintRes { - tasksCh := make(chan *linter.Config, len(linters)) - lintResultsCh := make(chan lintRes, len(linters)) - var wg sync.WaitGroup - - workersFinishTimes := make([]time.Time, lintCtx.Cfg.Run.Concurrency) - - for i := 0; i < lintCtx.Cfg.Run.Concurrency; i++ { - wg.Add(1) - go func(i int) { - defer wg.Done() - name := fmt.Sprintf("worker.%d", i+1) - r.runWorker(ctx, lintCtx, tasksCh, lintResultsCh, name) - workersFinishTimes[i] = time.Now() - }(i) - } - - lcs := getSortedLintersConfigs(linters) - for _, lc := range lcs { - tasksCh <- lc - } - close(tasksCh) - - go func() { - wg.Wait() - close(lintResultsCh) - - r.logWorkersStat(workersFinishTimes) - }() - - return lintResultsCh + return issues, nil } type processorStat struct { @@ -228,47 +137,35 @@ type processorStat struct { outCount int } -func (r Runner) processLintResults(inCh <-chan lintRes) <-chan lintRes { - outCh := make(chan lintRes, 64) +func (r Runner) processLintResults(inIssues []result.Issue) []result.Issue { + sw := timeutils.NewStopwatch("processing", r.Log) - go func() { - sw := timeutils.NewStopwatch("processing", r.Log) + var issuesBefore, issuesAfter int + statPerProcessor := map[string]processorStat{} - var issuesBefore, issuesAfter int - statPerProcessor := map[string]processorStat{} - defer close(outCh) - - for res := range inCh { - if res.err != nil { - r.Log.Warnf("Can't run linter %s: %s", res.linter.Name(), res.err) - continue - } - - if len(res.issues) != 0 { - issuesBefore += len(res.issues) - res.issues = r.processIssues(res.issues, sw, statPerProcessor) - issuesAfter += len(res.issues) - outCh <- res - } - } + var outIssues []result.Issue + if len(inIssues) != 0 { + issuesBefore += len(inIssues) + outIssues = r.processIssues(inIssues, sw, statPerProcessor) + issuesAfter += len(outIssues) + } - // finalize processors: logging, clearing, no heavy work here + // finalize processors: logging, clearing, no heavy work here - for _, p := range r.Processors { - p := p - sw.TrackStage(p.Name(), func() { - p.Finish() - }) - } + for _, p := range r.Processors { + p := p + sw.TrackStage(p.Name(), func() { + p.Finish() + }) + } - if issuesBefore != issuesAfter { - r.Log.Infof("Issues before processing: %d, after processing: %d", issuesBefore, issuesAfter) - } - r.printPerProcessorStat(statPerProcessor) - sw.PrintStages() - }() + if issuesBefore != issuesAfter { + r.Log.Infof("Issues before processing: %d, after processing: %d", issuesBefore, issuesAfter) + } + r.printPerProcessorStat(statPerProcessor) + sw.PrintStages() - return outCh + return outIssues } func (r Runner) printPerProcessorStat(stat map[string]processorStat) { @@ -283,40 +180,29 @@ func (r Runner) printPerProcessorStat(stat map[string]processorStat) { } } -func collectIssues(resCh <-chan lintRes) <-chan result.Issue { - retIssues := make(chan result.Issue, 1024) - go func() { - defer close(retIssues) - - for res := range resCh { - if len(res.issues) == 0 { - continue - } +func (r Runner) Run(ctx context.Context, linters []*linter.Config, lintCtx *linter.Context) ([]result.Issue, error) { + sw := timeutils.NewStopwatch("linters", r.Log) + defer sw.Print() - for _, i := range res.issues { - retIssues <- i + var issues []result.Issue + var runErr error + for _, lc := range linters { + lc := lc + sw.TrackStage(lc.Name(), func() { + linterIssues, err := r.runLinterSafe(ctx, lintCtx, lc) + if err != nil { + r.Log.Warnf("Can't run linter %s: %s", lc.Linter.Name(), err) + if os.Getenv("GOLANGCI_COM_RUN") == "" { + // Don't stop all linters on one linter failure for golangci.com. + runErr = err + } + return } - } - }() - - return retIssues -} - -func (r Runner) Run(ctx context.Context, linters []*linter.Config, lintCtx *linter.Context) <-chan result.Issue { - lintResultsCh := r.runWorkers(ctx, lintCtx, linters) - processedLintResultsCh := r.processLintResults(lintResultsCh) - if ctx.Err() != nil { - // XXX: always process issues, even if timeout occurred - finishedLintersN := 0 - for range processedLintResultsCh { - finishedLintersN++ - } - - r.Log.Errorf("%d/%d linters finished: deadline exceeded", - finishedLintersN, len(linters)) + issues = append(issues, linterIssues...) + }) } - return collectIssues(processedLintResultsCh) + return r.processLintResults(issues), runErr } func (r *Runner) processIssues(issues []result.Issue, sw *timeutils.Stopwatch, statPerProcessor map[string]processorStat) []result.Issue { diff --git a/vendor/github.com/golangci/golangci-lint/pkg/logutils/log.go b/vendor/github.com/golangci/golangci-lint/pkg/logutils/log.go index 070887ccb78..b955417a87a 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/logutils/log.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/logutils/log.go @@ -14,18 +14,18 @@ type Log interface { type LogLevel int const ( - // debug message, write to debug logs only by logutils.Debug + // Debug messages, write to debug logs only by logutils.Debug. LogLevelDebug LogLevel = 0 - // information messages, don't write too much messages, - // only useful ones: they are shown when running with -v + // Information messages, don't write too much messages, + // only useful ones: they are shown when running with -v. LogLevelInfo LogLevel = 1 - // hidden errors: non critical errors: work can be continued, no need to fail whole program; + // Hidden errors: non critical errors: work can be continued, no need to fail whole program; // tests will crash if any warning occurred. LogLevelWarn LogLevel = 2 - // only not hidden from user errors: whole program failing, usually + // Only not hidden from user errors: whole program failing, usually // error logging happens in 1-2 places: in the "main" function. LogLevelError LogLevel = 3 ) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/logutils/stderr_log.go b/vendor/github.com/golangci/golangci-lint/pkg/logutils/stderr_log.go index 079a5d45744..b4697ee4c79 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/logutils/stderr_log.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/logutils/stderr_log.go @@ -65,7 +65,8 @@ func (sl StderrLog) Fatalf(format string, args ...interface{}) { } func (sl StderrLog) Panicf(format string, args ...interface{}) { - sl.logger.Panicf("%s%s", sl.prefix(), fmt.Sprintf(format, args...)) + v := fmt.Sprintf("%s%s", sl.prefix(), fmt.Sprintf(format, args...)) + panic(v) } func (sl StderrLog) Errorf(format string, args ...interface{}) { diff --git a/vendor/github.com/golangci/golangci-lint/pkg/packages/errors.go b/vendor/github.com/golangci/golangci-lint/pkg/packages/errors.go index 72fb8601ab7..c620573b938 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/packages/errors.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/packages/errors.go @@ -9,6 +9,7 @@ import ( "github.com/pkg/errors" ) +//nolint:gomnd func ParseErrorPosition(pos string) (*token.Position, error) { // file:line(:colon) parts := strings.Split(pos, ":") diff --git a/vendor/github.com/golangci/golangci-lint/pkg/packages/util.go b/vendor/github.com/golangci/golangci-lint/pkg/packages/util.go index 6d368ac6fdd..3c8642afa1c 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/packages/util.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/packages/util.go @@ -3,13 +3,10 @@ package packages import ( "fmt" - "github.com/golangci/golangci-lint/pkg/lint/astcache" - "golang.org/x/tools/go/packages" ) -//nolint:gocyclo -func ExtractErrors(pkg *packages.Package, astCache *astcache.Cache) []packages.Error { +func ExtractErrors(pkg *packages.Package) []packages.Error { errors := extractErrorsImpl(pkg, map[*packages.Package]bool{}) if len(errors) == 0 { return errors @@ -28,8 +25,8 @@ func ExtractErrors(pkg *packages.Package, astCache *astcache.Cache) []packages.E if len(pkg.GoFiles) != 0 { // errors were extracted from deps and have at leat one file in package for i := range uniqErrors { - errPos, parseErr := ParseErrorPosition(uniqErrors[i].Pos) - if parseErr != nil || astCache.Get(errPos.Filename) == nil { + _, parseErr := ParseErrorPosition(uniqErrors[i].Pos) + if parseErr != nil { // change pos to local file to properly process it by processors (properly read line etc) uniqErrors[i].Msg = fmt.Sprintf("%s: %s", uniqErrors[i].Pos, uniqErrors[i].Msg) uniqErrors[i].Pos = fmt.Sprintf("%s:1", pkg.GoFiles[0]) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/printers/checkstyle.go b/vendor/github.com/golangci/golangci-lint/pkg/printers/checkstyle.go index 8853b6eef3a..f36bc108adc 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/printers/checkstyle.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/printers/checkstyle.go @@ -36,14 +36,15 @@ func NewCheckstyle() *Checkstyle { return &Checkstyle{} } -func (Checkstyle) Print(ctx context.Context, issues <-chan result.Issue) error { +func (Checkstyle) Print(ctx context.Context, issues []result.Issue) error { out := checkstyleOutput{ Version: "5.0", } files := map[string]*checkstyleFile{} - for issue := range issues { + for i := range issues { + issue := &issues[i] file, ok := files[issue.FilePath()] if !ok { file = &checkstyleFile{ diff --git a/vendor/github.com/golangci/golangci-lint/pkg/printers/codeclimate.go b/vendor/github.com/golangci/golangci-lint/pkg/printers/codeclimate.go index 0faebe329fb..26878056884 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/printers/codeclimate.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/printers/codeclimate.go @@ -2,7 +2,7 @@ package printers import ( "context" - "crypto/md5" + "crypto/md5" //nolint:gosec "encoding/json" "fmt" @@ -30,16 +30,17 @@ func NewCodeClimate() *CodeClimate { return &CodeClimate{} } -func (p CodeClimate) Print(ctx context.Context, issues <-chan result.Issue) error { +func (p CodeClimate) Print(ctx context.Context, issues []result.Issue) error { allIssues := []CodeClimateIssue{} - for i := range issues { + for ind := range issues { + i := &issues[ind] var issue CodeClimateIssue issue.Description = i.FromLinter + ": " + i.Text issue.Location.Path = i.Pos.Filename issue.Location.Lines.Begin = i.Pos.Line // Need a checksum of the issue, so we use MD5 of the filename, text, and first line of source - hash := md5.New() + hash := md5.New() //nolint:gosec _, _ = hash.Write([]byte(i.Pos.Filename + i.Text + i.SourceLines[0])) issue.Fingerprint = fmt.Sprintf("%X", hash.Sum(nil)) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/printers/json.go b/vendor/github.com/golangci/golangci-lint/pkg/printers/json.go index c3778fd3e5a..6ffa996fb0e 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/printers/json.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/printers/json.go @@ -25,14 +25,9 @@ type JSONResult struct { Report *report.Data } -func (p JSON) Print(ctx context.Context, issues <-chan result.Issue) error { - allIssues := []result.Issue{} - for i := range issues { - allIssues = append(allIssues, i) - } - +func (p JSON) Print(ctx context.Context, issues []result.Issue) error { res := JSONResult{ - Issues: allIssues, + Issues: issues, Report: p.rd, } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/printers/junitxml.go b/vendor/github.com/golangci/golangci-lint/pkg/printers/junitxml.go index 825c3fdbded..b3d4280961c 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/printers/junitxml.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/printers/junitxml.go @@ -38,10 +38,11 @@ func NewJunitXML() *JunitXML { return &JunitXML{} } -func (JunitXML) Print(ctx context.Context, issues <-chan result.Issue) error { +func (JunitXML) Print(ctx context.Context, issues []result.Issue) error { suites := make(map[string]testSuiteXML) // use a map to group by file - for i := range issues { + for ind := range issues { + i := &issues[ind] suiteName := i.FilePath() testSuite := suites[suiteName] testSuite.Suite = i.FilePath() diff --git a/vendor/github.com/golangci/golangci-lint/pkg/printers/printer.go b/vendor/github.com/golangci/golangci-lint/pkg/printers/printer.go index a063bd91484..bfafb88e2a7 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/printers/printer.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/printers/printer.go @@ -7,5 +7,5 @@ import ( ) type Printer interface { - Print(ctx context.Context, issues <-chan result.Issue) error + Print(ctx context.Context, issues []result.Issue) error } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/printers/tab.go b/vendor/github.com/golangci/golangci-lint/pkg/printers/tab.go index 5045d771c33..d3cdce673dd 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/printers/tab.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/printers/tab.go @@ -29,12 +29,11 @@ func (p Tab) SprintfColored(ca color.Attribute, format string, args ...interface return c.Sprintf(format, args...) } -func (p *Tab) Print(ctx context.Context, issues <-chan result.Issue) error { +func (p *Tab) Print(ctx context.Context, issues []result.Issue) error { w := tabwriter.NewWriter(logutils.StdOut, 0, 0, 2, ' ', 0) for i := range issues { - i := i - p.printIssue(&i, w) + p.printIssue(&issues[i], w) } if err := w.Flush(); err != nil { diff --git a/vendor/github.com/golangci/golangci-lint/pkg/printers/text.go b/vendor/github.com/golangci/golangci-lint/pkg/printers/text.go index c0cc5e2c844..28349920533 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/printers/text.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/printers/text.go @@ -36,17 +36,16 @@ func (p Text) SprintfColored(ca color.Attribute, format string, args ...interfac return c.Sprintf(format, args...) } -func (p *Text) Print(ctx context.Context, issues <-chan result.Issue) error { +func (p *Text) Print(ctx context.Context, issues []result.Issue) error { for i := range issues { - i := i - p.printIssue(&i) + p.printIssue(&issues[i]) if !p.printIssuedLine { continue } - p.printSourceCode(&i) - p.printUnderLinePointer(&i) + p.printSourceCode(&issues[i]) + p.printUnderLinePointer(&issues[i]) } return nil diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/issue.go b/vendor/github.com/golangci/golangci-lint/pkg/result/issue.go index d349921692c..83ba705edfc 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/issue.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/issue.go @@ -1,6 +1,10 @@ package result -import "go/token" +import ( + "go/token" + + "golang.org/x/tools/go/packages" +) type Range struct { From, To int @@ -21,18 +25,22 @@ type InlineFix struct { type Issue struct { FromLinter string Text string - Pos token.Position - - LineRange *Range `json:",omitempty"` - - // HunkPos is used only when golangci-lint is run over a diff - HunkPos int `json:",omitempty"` // Source lines of a code with the issue to show SourceLines []string // If we know how to fix the issue we can provide replacement lines Replacement *Replacement + + // Pkg is needed for proper caching of linting results + Pkg *packages.Package `json:"-"` + + LineRange *Range `json:",omitempty"` + + Pos token.Position + + // HunkPos is used only when golangci-lint is run over a diff + HunkPos int `json:",omitempty"` } func (i *Issue) FilePath() string { diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/autogenerated_exclude.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/autogenerated_exclude.go index 9e0c310b407..8bdaae66104 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/autogenerated_exclude.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/autogenerated_exclude.go @@ -1,13 +1,14 @@ package processors import ( + "bufio" "fmt" - "go/ast" - "go/token" + "os" "path/filepath" "strings" - "github.com/golangci/golangci-lint/pkg/lint/astcache" + "github.com/pkg/errors" + "github.com/golangci/golangci-lint/pkg/logutils" "github.com/golangci/golangci-lint/pkg/result" ) @@ -22,13 +23,11 @@ type ageFileSummaryCache map[string]*ageFileSummary type AutogeneratedExclude struct { fileSummaryCache ageFileSummaryCache - astCache *astcache.Cache } -func NewAutogeneratedExclude(astCache *astcache.Cache) *AutogeneratedExclude { +func NewAutogeneratedExclude() *AutogeneratedExclude { return &AutogeneratedExclude{ fileSummaryCache: ageFileSummaryCache{}, - astCache: astCache, } } @@ -103,60 +102,51 @@ func (p *AutogeneratedExclude) getOrCreateFileSummary(i *result.Issue) (*ageFile return nil, fmt.Errorf("no file path for issue") } - f := p.astCache.Get(i.FilePath()) - if f == nil || f.Err != nil { - return nil, fmt.Errorf("can't parse file %s: %v", i.FilePath(), f) + doc, err := getDoc(i.FilePath()) + if err != nil { + return nil, errors.Wrapf(err, "failed to get doc of file %s", i.FilePath()) } - autogenDebugf("file %q: astcache file is %+v", i.FilePath(), *f) - - doc := getDoc(f.F, f.Fset, i.FilePath()) - fs.isGenerated = isGeneratedFileByComment(doc) autogenDebugf("file %q is generated: %t", i.FilePath(), fs.isGenerated) return fs, nil } -func getDoc(f *ast.File, fset *token.FileSet, filePath string) string { - // don't use just f.Doc: e.g. mockgen leaves extra line between comment and package name - - var importPos token.Pos - if len(f.Imports) != 0 { - importPos = f.Imports[0].Pos() - autogenDebugf("file %q: search comments until first import pos %d (%s)", - filePath, importPos, fset.Position(importPos)) - } else { - importPos = f.End() - autogenDebugf("file %q: search comments until EOF pos %d (%s)", - filePath, importPos, fset.Position(importPos)) +func getDoc(filePath string) (string, error) { + file, err := os.Open(filePath) + if err != nil { + return "", errors.Wrap(err, "failed to open file") } + defer file.Close() - var neededComments []string - for _, g := range f.Comments { - pos := g.Pos() - filePos := fset.Position(pos) - text := g.Text() + scanner := bufio.NewScanner(file) - // files using cgo have implicitly added comment "Created by cgo - DO NOT EDIT" for go <= 1.10 - // and "Code generated by cmd/cgo" for go >= 1.11 - isCgoGenerated := strings.Contains(text, "Created by cgo") || strings.Contains(text, "Code generated by cmd/cgo") - - isAllowed := pos < importPos && filePos.Column == 1 && !isCgoGenerated - if isAllowed { - autogenDebugf("file %q: pos=%d, filePos=%s: comment %q: it's allowed", filePath, pos, filePos, text) - neededComments = append(neededComments, text) + // Issue 954: Some lines can be very long, e.g. auto-generated + // embedded resources. Reported on file of 86.2KB. + const ( + maxSize = 10 * 1024 * 1024 // 10MB should be enough + initialSize = 4096 // same as startBufSize in bufio + ) + scanner.Buffer(make([]byte, initialSize), maxSize) + + var docLines []string + for scanner.Scan() { + line := strings.TrimSpace(scanner.Text()) + if strings.HasPrefix(line, "//") { //nolint:gocritic + text := strings.TrimSpace(strings.TrimPrefix(line, "//")) + docLines = append(docLines, text) + } else if line == "" || strings.HasPrefix(line, "package") { + // go to next line } else { - autogenDebugf("file %q: pos=%d, filePos=%s: comment %q: it's NOT allowed", filePath, pos, filePos, text) + break } } - autogenDebugf("file %q: got %d allowed comments", filePath, len(neededComments)) - - if len(neededComments) == 0 { - return "" + if err := scanner.Err(); err != nil { + return "", errors.Wrap(err, "failed to scan file") } - return strings.Join(neededComments, "\n") + return strings.Join(docLines, "\n"), nil } func (p AutogeneratedExclude) Finish() {} diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/exclude_rules.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/exclude_rules.go index 014efcd02cf..6b16fdc5dad 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/exclude_rules.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/exclude_rules.go @@ -3,10 +3,8 @@ package processors import ( "regexp" - "github.com/golangci/golangci-lint/pkg/logutils" - "github.com/golangci/golangci-lint/pkg/fsutils" - + "github.com/golangci/golangci-lint/pkg/logutils" "github.com/golangci/golangci-lint/pkg/result" ) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/filename_unadjuster.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/filename_unadjuster.go index 33ae5c31a2b..5e692ceba2e 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/filename_unadjuster.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/filename_unadjuster.go @@ -1,14 +1,16 @@ package processors import ( + "go/parser" "go/token" "path/filepath" "strings" + "sync" + "time" - "github.com/golangci/golangci-lint/pkg/logutils" - - "github.com/golangci/golangci-lint/pkg/lint/astcache" + "golang.org/x/tools/go/packages" + "github.com/golangci/golangci-lint/pkg/logutils" "github.com/golangci/golangci-lint/pkg/result" ) @@ -25,31 +27,60 @@ type FilenameUnadjuster struct { var _ Processor = &FilenameUnadjuster{} -func NewFilenameUnadjuster(cache *astcache.Cache, log logutils.Log) *FilenameUnadjuster { - m := map[string]posMapper{} - for _, f := range cache.GetAllValidFiles() { - adjustedFilename := f.Fset.PositionFor(f.F.Pos(), true).Filename - if adjustedFilename == "" { - continue - } - unadjustedFilename := f.Fset.PositionFor(f.F.Pos(), false).Filename - if unadjustedFilename == "" || unadjustedFilename == adjustedFilename { - continue - } - if !strings.HasSuffix(unadjustedFilename, ".go") { - continue // file.go -> /caches/cgo-xxx - } +func processUnadjusterPkg(m map[string]posMapper, pkg *packages.Package, log logutils.Log) { + fset := token.NewFileSet() // it's more memory efficient to not store all in one fset - f := f - m[adjustedFilename] = func(adjustedPos token.Position) token.Position { - tokenFile := f.Fset.File(f.F.Pos()) - if tokenFile == nil { - log.Warnf("Failed to get token file for %s", adjustedFilename) - return adjustedPos - } - return f.Fset.PositionFor(tokenFile.Pos(adjustedPos.Offset), false) + for _, filename := range pkg.CompiledGoFiles { + // It's important to call func here to run GC + processUnadjusterFile(filename, m, log, fset) + } +} + +func processUnadjusterFile(filename string, m map[string]posMapper, log logutils.Log, fset *token.FileSet) { + syntax, err := parser.ParseFile(fset, filename, nil, parser.ParseComments) + if err != nil { + // Error will be reported by typecheck + return + } + + adjustedFilename := fset.PositionFor(syntax.Pos(), true).Filename + if adjustedFilename == "" { + return + } + + unadjustedFilename := fset.PositionFor(syntax.Pos(), false).Filename + if unadjustedFilename == "" || unadjustedFilename == adjustedFilename { + return + } + + if !strings.HasSuffix(unadjustedFilename, ".go") { + return // file.go -> /caches/cgo-xxx + } + + m[adjustedFilename] = func(adjustedPos token.Position) token.Position { + tokenFile := fset.File(syntax.Pos()) + if tokenFile == nil { + log.Warnf("Failed to get token file for %s", adjustedFilename) + return adjustedPos } + return fset.PositionFor(tokenFile.Pos(adjustedPos.Offset), false) + } +} + +func NewFilenameUnadjuster(pkgs []*packages.Package, log logutils.Log) *FilenameUnadjuster { + m := map[string]posMapper{} + startedAt := time.Now() + var wg sync.WaitGroup + wg.Add(len(pkgs)) + for _, pkg := range pkgs { + go func(pkg *packages.Package) { + // It's important to call func here to run GC + processUnadjusterPkg(m, pkg, log) + wg.Done() + }(pkg) } + wg.Wait() + log.Infof("Pre-built %d adjustments in %s", len(m), time.Since(startedAt)) return &FilenameUnadjuster{ m: m, diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/fixer.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/fixer.go index 463724c1945..401c68dad12 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/fixer.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/fixer.go @@ -8,16 +8,13 @@ import ( "sort" "strings" - "github.com/golangci/golangci-lint/pkg/timeutils" - - "github.com/golangci/golangci-lint/pkg/fsutils" - - "github.com/golangci/golangci-lint/pkg/logutils" - "github.com/pkg/errors" "github.com/golangci/golangci-lint/pkg/config" + "github.com/golangci/golangci-lint/pkg/fsutils" + "github.com/golangci/golangci-lint/pkg/logutils" "github.com/golangci/golangci-lint/pkg/result" + "github.com/golangci/golangci-lint/pkg/timeutils" ) type Fixer struct { @@ -40,43 +37,38 @@ func (f Fixer) printStat() { f.sw.PrintStages() } -func (f Fixer) Process(issues <-chan result.Issue) <-chan result.Issue { +func (f Fixer) Process(issues []result.Issue) []result.Issue { if !f.cfg.Issues.NeedFix { return issues } - outCh := make(chan result.Issue, 1024) + outIssues := make([]result.Issue, 0, len(issues)) + issuesToFixPerFile := map[string][]result.Issue{} + for i := range issues { + issue := &issues[i] + if issue.Replacement == nil { + outIssues = append(outIssues, *issue) + continue + } - go func() { - issuesToFixPerFile := map[string][]result.Issue{} - for issue := range issues { - if issue.Replacement == nil { - outCh <- issue - continue - } + issuesToFixPerFile[issue.FilePath()] = append(issuesToFixPerFile[issue.FilePath()], *issue) + } - issuesToFixPerFile[issue.FilePath()] = append(issuesToFixPerFile[issue.FilePath()], issue) - } + for file, issuesToFix := range issuesToFixPerFile { + var err error + f.sw.TrackStage("all", func() { + err = f.fixIssuesInFile(file, issuesToFix) //nolint:scopelint + }) + if err != nil { + f.log.Errorf("Failed to fix issues in file %s: %s", file, err) - for file, issuesToFix := range issuesToFixPerFile { - var err error - f.sw.TrackStage("all", func() { - err = f.fixIssuesInFile(file, issuesToFix) //nolint:scopelint - }) - if err != nil { - f.log.Errorf("Failed to fix issues in file %s: %s", file, err) - - // show issues only if can't fix them - for _, issue := range issuesToFix { - outCh <- issue - } - } + // show issues only if can't fix them + outIssues = append(outIssues, issuesToFix...) } - f.printStat() - close(outCh) - }() + } - return outCh + f.printStat() + return outIssues } func (f Fixer) fixIssuesInFile(filePath string, issues []result.Issue) error { @@ -96,8 +88,9 @@ func (f Fixer) fixIssuesInFile(filePath string, issues []result.Issue) error { // merge multiple issues per line into one issue issuesPerLine := map[int][]result.Issue{} - for _, i := range issues { - issuesPerLine[i.Line()] = append(issuesPerLine[i.Line()], i) + for i := range issues { + issue := &issues[i] + issuesPerLine[issue.Line()] = append(issuesPerLine[issue.Line()], *issue) } issues = issues[:0] // reuse the same memory @@ -124,7 +117,6 @@ func (f Fixer) fixIssuesInFile(filePath string, issues []result.Issue) error { return nil } -//nolint:gocyclo func (f Fixer) mergeLineIssues(lineNum int, lineIssues []result.Issue, origFileLines [][]byte) *result.Issue { origLine := origFileLines[lineNum-1] // lineNum is 1-based @@ -133,7 +125,8 @@ func (f Fixer) mergeLineIssues(lineNum int, lineIssues []result.Issue, origFileL } // check issues first - for _, i := range lineIssues { + for ind := range lineIssues { + i := &lineIssues[ind] if i.LineRange != nil { f.log.Infof("Line %d has multiple issues but at least one of them is ranged: %#v", lineNum, lineIssues) return &lineIssues[0] @@ -166,8 +159,8 @@ func (f Fixer) applyInlineFixes(lineIssues []result.Issue, origLine []byte, line // example: origLine="it's becouse of them", StartCol=5, Length=7, NewString="because" curOrigLinePos := 0 - for _, i := range lineIssues { - fix := i.Replacement.Inline + for i := range lineIssues { + fix := lineIssues[i].Replacement.Inline if fix.StartCol < curOrigLinePos { f.log.Warnf("Line %d has multiple intersecting issues: %#v", lineNum, lineIssues) return nil @@ -198,14 +191,15 @@ func (f Fixer) findNotIntersectingIssues(issues []result.Issue) []result.Issue { var ret []result.Issue var currentEnd int - for _, issue := range issues { + for i := range issues { + issue := &issues[i] rng := issue.GetLineRange() if rng.From <= currentEnd { f.log.Infof("Skip issue %#v: intersects with end %d", issue, currentEnd) continue // skip intersecting issue } f.log.Infof("Fix issue %#v with range %v", issue, issue.GetLineRange()) - ret = append(ret, issue) + ret = append(ret, *issue) currentEnd = rng.To } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/max_same_issues.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/max_same_issues.go index 43a0593601d..84fdf0c053a 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/max_same_issues.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/max_same_issues.go @@ -4,7 +4,6 @@ import ( "sort" "github.com/golangci/golangci-lint/pkg/config" - "github.com/golangci/golangci-lint/pkg/logutils" "github.com/golangci/golangci-lint/pkg/result" ) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/nolint.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/nolint.go index a2ad0464366..da7abacd4e3 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/nolint.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/nolint.go @@ -3,13 +3,11 @@ package processors import ( "fmt" "go/ast" + "go/parser" "go/token" "sort" "strings" - "github.com/pkg/errors" - - "github.com/golangci/golangci-lint/pkg/lint/astcache" "github.com/golangci/golangci-lint/pkg/lint/lintersdb" "github.com/golangci/golangci-lint/pkg/logutils" "github.com/golangci/golangci-lint/pkg/result" @@ -49,17 +47,15 @@ type filesCache map[string]*fileData type Nolint struct { cache filesCache - astCache *astcache.Cache dbManager *lintersdb.Manager log logutils.Log unknownLintersSet map[string]bool } -func NewNolint(astCache *astcache.Cache, log logutils.Log, dbManager *lintersdb.Manager) *Nolint { +func NewNolint(log logutils.Log, dbManager *lintersdb.Manager) *Nolint { return &Nolint{ cache: filesCache{}, - astCache: astCache, dbManager: dbManager, log: log, unknownLintersSet: map[string]bool{}, @@ -89,16 +85,18 @@ func (p *Nolint) getOrCreateFileData(i *result.Issue) (*fileData, error) { return nil, fmt.Errorf("no file path for issue") } - file := p.astCache.Get(i.FilePath()) - if file == nil { - return nil, fmt.Errorf("no file %s in ast cache %v", - i.FilePath(), p.astCache.ParsedFilenames()) - } - if file.Err != nil { - return nil, errors.Wrapf(file.Err, "can't parse file %s", i.FilePath()) + // TODO: migrate this parsing to go/analysis facts + // or cache them somehow per file. + + // Don't use cached AST because they consume a lot of memory on large projects. + fset := token.NewFileSet() + f, err := parser.ParseFile(fset, i.FilePath(), nil, parser.ParseComments) + if err != nil { + // Don't report error because it's already must be reporter by typecheck or go/analysis. + return fd, nil } - fd.ignoredRanges = p.buildIgnoredRangesForFile(file.F, file.Fset, i.FilePath()) + fd.ignoredRanges = p.buildIgnoredRangesForFile(f, fset, i.FilePath()) nolintDebugf("file %s: built nolint ranges are %+v", i.FilePath(), fd.ignoredRanges) return fd, nil } @@ -221,22 +219,17 @@ func (p *Nolint) extractInlineRangeFromComment(text string, g ast.Node, fset *to var gotUnknownLinters bool for _, linter := range linterItems { linterName := strings.ToLower(strings.TrimSpace(linter)) - metaLinter := p.dbManager.GetMetaLinter(linterName) - if metaLinter != nil { - // user can set metalinter name in nolint directive (e.g. megacheck), then - // we should add to nolint all the metalinter's default children - linters = append(linters, metaLinter.DefaultChildLinterNames()...) - continue - } - lc := p.dbManager.GetLinterConfig(linterName) - if lc == nil { + lcs := p.dbManager.GetLinterConfigs(linterName) + if lcs == nil { p.unknownLintersSet[linterName] = true gotUnknownLinters = true continue } - linters = append(linters, lc.Name()) // normalize name to work with aliases + for _, lc := range lcs { + linters = append(linters, lc.Name()) // normalize name to work with aliases + } } if gotUnknownLinters { diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/processor.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/processor.go index 1daec62ea19..1a7a40434c6 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/processor.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/processor.go @@ -1,6 +1,8 @@ package processors -import "github.com/golangci/golangci-lint/pkg/result" +import ( + "github.com/golangci/golangci-lint/pkg/result" +) type Processor interface { Process(issues []result.Issue) ([]result.Issue, error) diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/uniq_by_line.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/uniq_by_line.go index d0960d837d7..17167dde5de 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/uniq_by_line.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/uniq_by_line.go @@ -27,6 +27,10 @@ func (p UniqByLine) Name() string { } func (p *UniqByLine) Process(issues []result.Issue) ([]result.Issue, error) { + if !p.cfg.Output.UniqByLine { + return issues, nil + } + return filterIssues(issues, func(i *result.Issue) bool { if i.Replacement != nil && p.cfg.Issues.NeedFix { // if issue will be auto-fixed we shouldn't collapse issues: diff --git a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/utils.go b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/utils.go index 9d8ff9343dc..8bc3d847d65 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/result/processors/utils.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/result/processors/utils.go @@ -1,17 +1,16 @@ package processors import ( - "fmt" + "github.com/pkg/errors" "github.com/golangci/golangci-lint/pkg/result" ) func filterIssues(issues []result.Issue, filter func(i *result.Issue) bool) []result.Issue { retIssues := make([]result.Issue, 0, len(issues)) - for _, i := range issues { - i := i - if filter(&i) { - retIssues = append(retIssues, i) + for i := range issues { + if filter(&issues[i]) { + retIssues = append(retIssues, issues[i]) } } @@ -20,15 +19,14 @@ func filterIssues(issues []result.Issue, filter func(i *result.Issue) bool) []re func filterIssuesErr(issues []result.Issue, filter func(i *result.Issue) (bool, error)) ([]result.Issue, error) { retIssues := make([]result.Issue, 0, len(issues)) - for _, i := range issues { - i := i - ok, err := filter(&i) + for i := range issues { + ok, err := filter(&issues[i]) if err != nil { - return nil, fmt.Errorf("can't filter issue %#v: %s", i, err) + return nil, errors.Wrapf(err, "can't filter issue %#v", issues[i]) } if ok { - retIssues = append(retIssues, i) + retIssues = append(retIssues, issues[i]) } } @@ -37,9 +35,8 @@ func filterIssuesErr(issues []result.Issue, filter func(i *result.Issue) (bool, func transformIssues(issues []result.Issue, transform func(i *result.Issue) *result.Issue) []result.Issue { retIssues := make([]result.Issue, 0, len(issues)) - for _, i := range issues { - i := i - newI := transform(&i) + for i := range issues { + newI := transform(&issues[i]) if newI != nil { retIssues = append(retIssues, *newI) } diff --git a/vendor/github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go b/vendor/github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go index 78d1e3cdb0f..9628bd80f2b 100644 --- a/vendor/github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go +++ b/vendor/github.com/golangci/golangci-lint/pkg/timeutils/stopwatch.go @@ -10,6 +10,8 @@ import ( "github.com/golangci/golangci-lint/pkg/logutils" ) +const noStagesText = "no stages" + type Stopwatch struct { name string startedAt time.Time @@ -33,11 +35,7 @@ type stageDuration struct { d time.Duration } -func (s *Stopwatch) sprintStages() string { - if len(s.stages) == 0 { - return "no stages" - } - +func (s *Stopwatch) stageDurationsSorted() []stageDuration { stageDurations := []stageDuration{} for n, d := range s.stages { stageDurations = append(stageDurations, stageDuration{ @@ -48,6 +46,16 @@ func (s *Stopwatch) sprintStages() string { sort.Slice(stageDurations, func(i, j int) bool { return stageDurations[i].d > stageDurations[j].d }) + return stageDurations +} + +func (s *Stopwatch) sprintStages() string { + if len(s.stages) == 0 { + return noStagesText + } + + stageDurations := s.stageDurationsSorted() + stagesStrings := []string{} for _, s := range stageDurations { stagesStrings = append(stagesStrings, fmt.Sprintf("%s: %s", s.name, s.d)) @@ -56,6 +64,22 @@ func (s *Stopwatch) sprintStages() string { return fmt.Sprintf("stages: %s", strings.Join(stagesStrings, ", ")) } +func (s *Stopwatch) sprintTopStages(n int) string { + if len(s.stages) == 0 { + return noStagesText + } + + stageDurations := s.stageDurationsSorted() + + stagesStrings := []string{} + for i := 0; i < len(stageDurations) && i < n; i++ { + s := stageDurations[i] + stagesStrings = append(stagesStrings, fmt.Sprintf("%s: %s", s.name, s.d)) + } + + return fmt.Sprintf("top %d stages: %s", n, strings.Join(stagesStrings, ", ")) +} + func (s *Stopwatch) Print() { p := fmt.Sprintf("%s took %s", s.name, time.Since(s.startedAt)) if len(s.stages) == 0 { @@ -74,6 +98,14 @@ func (s *Stopwatch) PrintStages() { s.log.Infof("%s took %s with %s", s.name, stagesDuration, s.sprintStages()) } +func (s *Stopwatch) PrintTopStages(n int) { + var stagesDuration time.Duration + for _, s := range s.stages { + stagesDuration += s + } + s.log.Infof("%s took %s with %s", s.name, stagesDuration, s.sprintTopStages(n)) +} + func (s *Stopwatch) TrackStage(name string, f func()) { startedAt := time.Now() f() diff --git a/vendor/github.com/golangci/golangci-lint/pkg/timeutils/track.go b/vendor/github.com/golangci/golangci-lint/pkg/timeutils/track.go deleted file mode 100644 index ada1b9a4a7c..00000000000 --- a/vendor/github.com/golangci/golangci-lint/pkg/timeutils/track.go +++ /dev/null @@ -1,12 +0,0 @@ -package timeutils - -import ( - "fmt" - "time" - - "github.com/golangci/golangci-lint/pkg/logutils" -) - -func Track(from time.Time, log logutils.Log, format string, args ...interface{}) { - log.Infof("%s took %s", fmt.Sprintf(format, args...), time.Since(from)) -} diff --git a/vendor/github.com/golangci/lint-1/lint.go b/vendor/github.com/golangci/lint-1/lint.go index 0b58e928bb8..886c85bf099 100644 --- a/vendor/github.com/golangci/lint-1/lint.go +++ b/vendor/github.com/golangci/lint-1/lint.go @@ -118,10 +118,12 @@ func (l *Linter) LintFiles(files map[string][]byte) ([]Problem, error) { // LintFiles lints a set of files of a single package. // The argument is a map of filename to source. -func (l *Linter) LintASTFiles(files []*ast.File, fset *token.FileSet) ([]Problem, error) { +func (l *Linter) LintPkg(files []*ast.File, fset *token.FileSet, typesPkg *types.Package, typesInfo *types.Info) ([]Problem, error) { pkg := &pkg{ - fset: fset, - files: make(map[string]*file), + fset: fset, + files: make(map[string]*file), + typesPkg: typesPkg, + typesInfo: typesInfo, } var pkgName string for _, f := range files { @@ -193,25 +195,6 @@ type pkg struct { } func (p *pkg) lint() []Problem { - if err := p.typeCheck(); err != nil { - /* TODO(dsymonds): Consider reporting these errors when golint operates on entire packages. - if e, ok := err.(types.Error); ok { - pos := p.fset.Position(e.Pos) - conf := 1.0 - if strings.Contains(e.Msg, "can't find import: ") { - // Golint is probably being run in a context that doesn't support - // typechecking (e.g. package files aren't found), so don't warn about it. - conf = 0 - } - if conf > 0 { - p.errorfAt(pos, conf, category("typechecking"), e.Msg) - } - - // TODO(dsymonds): Abort if !e.Soft? - } - */ - } - p.scanSortable() p.main = p.isMain() @@ -241,7 +224,6 @@ func (f *file) lint() { f.lintBlankImports() f.lintExported() f.lintNames() - f.lintVarDecls() f.lintElses() f.lintRanges() f.lintErrorf() @@ -471,11 +453,26 @@ func (f *file) lintPackageComment() { } } +func (f *file) isCgo() bool { + if f.src == nil { + return false + } + newLinePos := bytes.Index(f.src, []byte("\n")) + if newLinePos < 0 { + return false + } + firstLine := string(f.src[:newLinePos]) + + // files using cgo have implicitly added comment "Created by cgo - DO NOT EDIT" for go <= 1.10 + // and "Code generated by cmd/cgo" for go >= 1.11 + return strings.Contains(firstLine, "Created by cgo") || strings.Contains(firstLine, "Code generated by cmd/cgo") +} + // lintBlankImports complains if a non-main package has blank imports that are // not documented. func (f *file) lintBlankImports() { // In package main and in tests, we don't complain about blank imports. - if f.pkg.main || f.isTest() { + if f.pkg.main || f.isTest() || f.isCgo() { return } @@ -1020,84 +1017,6 @@ var zeroLiteral = map[string]bool{ "0i": true, } -// lintVarDecls examines variable declarations. It complains about declarations with -// redundant LHS types that can be inferred from the RHS. -func (f *file) lintVarDecls() { - var lastGen *ast.GenDecl // last GenDecl entered. - - f.walk(func(node ast.Node) bool { - switch v := node.(type) { - case *ast.GenDecl: - if v.Tok != token.CONST && v.Tok != token.VAR { - return false - } - lastGen = v - return true - case *ast.ValueSpec: - if lastGen.Tok == token.CONST { - return false - } - if len(v.Names) > 1 || v.Type == nil || len(v.Values) == 0 { - return false - } - rhs := v.Values[0] - // An underscore var appears in a common idiom for compile-time interface satisfaction, - // as in "var _ Interface = (*Concrete)(nil)". - if isIdent(v.Names[0], "_") { - return false - } - // If the RHS is a zero value, suggest dropping it. - zero := false - if lit, ok := rhs.(*ast.BasicLit); ok { - zero = zeroLiteral[lit.Value] - } else if isIdent(rhs, "nil") { - zero = true - } - if zero { - f.errorf(rhs, 0.9, category("zero-value"), "should drop = %s from declaration of var %s; it is the zero value", f.render(rhs), v.Names[0]) - return false - } - lhsTyp := f.pkg.typeOf(v.Type) - rhsTyp := f.pkg.typeOf(rhs) - - if !validType(lhsTyp) || !validType(rhsTyp) { - // Type checking failed (often due to missing imports). - return false - } - - if !types.Identical(lhsTyp, rhsTyp) { - // Assignment to a different type is not redundant. - return false - } - - // The next three conditions are for suppressing the warning in situations - // where we were unable to typecheck. - - // If the LHS type is an interface, don't warn, since it is probably a - // concrete type on the RHS. Note that our feeble lexical check here - // will only pick up interface{} and other literal interface types; - // that covers most of the cases we care to exclude right now. - if _, ok := v.Type.(*ast.InterfaceType); ok { - return false - } - // If the RHS is an untyped const, only warn if the LHS type is its default type. - if defType, ok := f.isUntypedConst(rhs); ok && !isIdent(v.Type, defType) { - return false - } - - f.errorf(v.Type, 0.8, category("type-inference"), "should omit type %s from declaration of var %s; it will be inferred from the right-hand side", f.render(v.Type), v.Names[0]) - return false - } - return true - }) -} - -func validType(T types.Type) bool { - return T != nil && - T != types.Typ[types.Invalid] && - !strings.Contains(T.String(), "invalid type") // good but not foolproof -} - // lintElses examines else blocks. It complains about any else block whose if block ends in a return. func (f *file) lintElses() { // We don't want to flag if { } else if { } else { } constructions. diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go b/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go index 938f646f000..24fbae6e3c5 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/sort.go @@ -19,7 +19,7 @@ func SortKeys(vs []reflect.Value) []reflect.Value { } // Sort the map keys. - sort.Slice(vs, func(i, j int) bool { return isLess(vs[i], vs[j]) }) + sort.SliceStable(vs, func(i, j int) bool { return isLess(vs[i], vs[j]) }) // Deduplicate keys (fails for NaNs). vs2 := vs[:1] @@ -42,6 +42,8 @@ func isLess(x, y reflect.Value) bool { case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return x.Uint() < y.Uint() case reflect.Float32, reflect.Float64: + // NOTE: This does not sort -0 as less than +0 + // since Go maps treat -0 and +0 as equal keys. fx, fy := x.Float(), y.Float() return fx < fy || math.IsNaN(fx) && !math.IsNaN(fy) case reflect.Complex64, reflect.Complex128: diff --git a/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go b/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go index d13a12ccfcd..06a8ffd036d 100644 --- a/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go +++ b/vendor/github.com/google/go-cmp/cmp/internal/value/zero.go @@ -4,7 +4,10 @@ package value -import "reflect" +import ( + "math" + "reflect" +) // IsZero reports whether v is the zero value. // This does not rely on Interface and so can be used on unexported fields. @@ -17,9 +20,9 @@ func IsZero(v reflect.Value) bool { case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64, reflect.Uintptr: return v.Uint() == 0 case reflect.Float32, reflect.Float64: - return v.Float() == 0 + return math.Float64bits(v.Float()) == 0 case reflect.Complex64, reflect.Complex128: - return v.Complex() == 0 + return math.Float64bits(real(v.Complex())) == 0 && math.Float64bits(imag(v.Complex())) == 0 case reflect.String: return v.String() == "" case reflect.UnsafePointer: diff --git a/vendor/github.com/google/go-cmp/cmp/report_compare.go b/vendor/github.com/google/go-cmp/cmp/report_compare.go index 05efb992c53..17a05eede48 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_compare.go +++ b/vendor/github.com/google/go-cmp/cmp/report_compare.go @@ -168,7 +168,7 @@ func (opts formatOptions) formatDiffList(recs []reportRecord, k reflect.Kind) te var isZero bool switch opts.DiffMode { case diffIdentical: - isZero = value.IsZero(r.Value.ValueX) || value.IsZero(r.Value.ValueX) + isZero = value.IsZero(r.Value.ValueX) || value.IsZero(r.Value.ValueY) case diffRemoved: isZero = value.IsZero(r.Value.ValueX) case diffInserted: diff --git a/vendor/github.com/google/go-cmp/cmp/report_reflect.go b/vendor/github.com/google/go-cmp/cmp/report_reflect.go index 5521c604c54..2761b628921 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_reflect.go +++ b/vendor/github.com/google/go-cmp/cmp/report_reflect.go @@ -208,7 +208,6 @@ func (opts formatOptions) FormatValue(v reflect.Value, m visitedPointers) (out t func formatMapKey(v reflect.Value) string { var opts formatOptions opts.TypeMode = elideType - opts.AvoidStringer = true opts.ShallowPointers = true s := opts.FormatValue(v, visitedPointers{}).String() return strings.TrimSpace(s) diff --git a/vendor/github.com/google/go-cmp/cmp/report_slices.go b/vendor/github.com/google/go-cmp/cmp/report_slices.go index 8cb3265e767..eafcf2e4c0b 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_slices.go +++ b/vendor/github.com/google/go-cmp/cmp/report_slices.go @@ -90,7 +90,7 @@ func (opts formatOptions) FormatDiffSlice(v *valueNode) textNode { } if r == '\n' { if maxLineLen < i-lastLineIdx { - lastLineIdx = i - lastLineIdx + maxLineLen = i - lastLineIdx } lastLineIdx = i + 1 numLines++ @@ -322,7 +322,7 @@ func coalesceInterveningIdentical(groups []diffStats, windowSize int) []diffStat hadX, hadY := prev.NumRemoved > 0, prev.NumInserted > 0 hasX, hasY := next.NumRemoved > 0, next.NumInserted > 0 if ((hadX || hasX) && (hadY || hasY)) && curr.NumIdentical <= windowSize { - *prev = (*prev).Append(*curr).Append(*next) + *prev = prev.Append(*curr).Append(*next) groups = groups[:len(groups)-1] // Truncate off equal group continue } diff --git a/vendor/github.com/google/go-cmp/cmp/report_text.go b/vendor/github.com/google/go-cmp/cmp/report_text.go index 80605d0e440..8b8fcab7bdf 100644 --- a/vendor/github.com/google/go-cmp/cmp/report_text.go +++ b/vendor/github.com/google/go-cmp/cmp/report_text.go @@ -19,6 +19,11 @@ var randBool = rand.New(rand.NewSource(time.Now().Unix())).Intn(2) == 0 type indentMode int func (n indentMode) appendIndent(b []byte, d diffMode) []byte { + // The output of Diff is documented as being unstable to provide future + // flexibility in changing the output for more humanly readable reports. + // This logic intentionally introduces instability to the exact output + // so that users can detect accidental reliance on stability early on, + // rather than much later when an actual change to the format occurs. if flags.Deterministic || randBool { // Use regular spaces (U+0020). switch d { @@ -360,7 +365,7 @@ func (s diffStats) String() string { // Pluralize the name (adjusting for some obscure English grammar rules). name := s.Name if sum > 1 { - name = name + "s" + name += "s" if strings.HasSuffix(name, "ys") { name = name[:len(name)-2] + "ies" // e.g., "entrys" => "entries" } diff --git a/vendor/github.com/google/gofuzz/.travis.yml b/vendor/github.com/google/gofuzz/.travis.yml deleted file mode 100644 index f8684d99fc4..00000000000 --- a/vendor/github.com/google/gofuzz/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -language: go - -go: - - 1.4 - - 1.3 - - 1.2 - - tip - -install: - - if ! go get code.google.com/p/go.tools/cmd/cover; then go get golang.org/x/tools/cmd/cover; fi - -script: - - go test -cover diff --git a/vendor/github.com/google/gofuzz/CONTRIBUTING.md b/vendor/github.com/google/gofuzz/CONTRIBUTING.md deleted file mode 100644 index 51cf5cd1ada..00000000000 --- a/vendor/github.com/google/gofuzz/CONTRIBUTING.md +++ /dev/null @@ -1,67 +0,0 @@ -# How to contribute # - -We'd love to accept your patches and contributions to this project. There are -a just a few small guidelines you need to follow. - - -## Contributor License Agreement ## - -Contributions to any Google project must be accompanied by a Contributor -License Agreement. This is not a copyright **assignment**, it simply gives -Google permission to use and redistribute your contributions as part of the -project. - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual - CLA][]. - - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA][]. - -You generally only need to submit a CLA once, so if you've already submitted -one (even if it was for a different project), you probably don't need to do it -again. - -[individual CLA]: https://developers.google.com/open-source/cla/individual -[corporate CLA]: https://developers.google.com/open-source/cla/corporate - - -## Submitting a patch ## - - 1. It's generally best to start by opening a new issue describing the bug or - feature you're intending to fix. Even if you think it's relatively minor, - it's helpful to know what people are working on. Mention in the initial - issue that you are planning to work on that bug or feature so that it can - be assigned to you. - - 1. Follow the normal process of [forking][] the project, and setup a new - branch to work in. It's important that each group of changes be done in - separate branches in order to ensure that a pull request only includes the - commits related to that bug or feature. - - 1. Go makes it very simple to ensure properly formatted code, so always run - `go fmt` on your code before committing it. You should also run - [golint][] over your code. As noted in the [golint readme][], it's not - strictly necessary that your code be completely "lint-free", but this will - help you find common style issues. - - 1. Any significant changes should almost always be accompanied by tests. The - project already has good test coverage, so look at some of the existing - tests if you're unsure how to go about it. [gocov][] and [gocov-html][] - are invaluable tools for seeing which parts of your code aren't being - exercised by your tests. - - 1. Do your best to have [well-formed commit messages][] for each change. - This provides consistency throughout the project, and ensures that commit - messages are able to be formatted properly by various git tools. - - 1. Finally, push the commits to your fork and submit a [pull request][]. - -[forking]: https://help.github.com/articles/fork-a-repo -[golint]: https://github.com/golang/lint -[golint readme]: https://github.com/golang/lint/blob/master/README -[gocov]: https://github.com/axw/gocov -[gocov-html]: https://github.com/matm/gocov-html -[well-formed commit messages]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html -[squash]: http://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits -[pull request]: https://help.github.com/articles/creating-a-pull-request diff --git a/vendor/github.com/google/gofuzz/LICENSE b/vendor/github.com/google/gofuzz/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/vendor/github.com/google/gofuzz/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 [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/google/gofuzz/README.md b/vendor/github.com/google/gofuzz/README.md deleted file mode 100644 index 64869af347a..00000000000 --- a/vendor/github.com/google/gofuzz/README.md +++ /dev/null @@ -1,71 +0,0 @@ -gofuzz -====== - -gofuzz is a library for populating go objects with random values. - -[![GoDoc](https://godoc.org/github.com/google/gofuzz?status.png)](https://godoc.org/github.com/google/gofuzz) -[![Travis](https://travis-ci.org/google/gofuzz.svg?branch=master)](https://travis-ci.org/google/gofuzz) - -This is useful for testing: - -* Do your project's objects really serialize/unserialize correctly in all cases? -* Is there an incorrectly formatted object that will cause your project to panic? - -Import with ```import "github.com/google/gofuzz"``` - -You can use it on single variables: -```go -f := fuzz.New() -var myInt int -f.Fuzz(&myInt) // myInt gets a random value. -``` - -You can use it on maps: -```go -f := fuzz.New().NilChance(0).NumElements(1, 1) -var myMap map[ComplexKeyType]string -f.Fuzz(&myMap) // myMap will have exactly one element. -``` - -Customize the chance of getting a nil pointer: -```go -f := fuzz.New().NilChance(.5) -var fancyStruct struct { - A, B, C, D *string -} -f.Fuzz(&fancyStruct) // About half the pointers should be set. -``` - -You can even customize the randomization completely if needed: -```go -type MyEnum string -const ( - A MyEnum = "A" - B MyEnum = "B" -) -type MyInfo struct { - Type MyEnum - AInfo *string - BInfo *string -} - -f := fuzz.New().NilChance(0).Funcs( - func(e *MyInfo, c fuzz.Continue) { - switch c.Intn(2) { - case 0: - e.Type = A - c.Fuzz(&e.AInfo) - case 1: - e.Type = B - c.Fuzz(&e.BInfo) - } - }, -) - -var myObject MyInfo -f.Fuzz(&myObject) // Type will correspond to whether A or B info is set. -``` - -See more examples in ```example_test.go```. - -Happy testing! diff --git a/vendor/github.com/google/gofuzz/doc.go b/vendor/github.com/google/gofuzz/doc.go deleted file mode 100644 index 9f9956d4a64..00000000000 --- a/vendor/github.com/google/gofuzz/doc.go +++ /dev/null @@ -1,18 +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 fuzz is a library for populating go objects with random values. -package fuzz diff --git a/vendor/github.com/google/gofuzz/fuzz.go b/vendor/github.com/google/gofuzz/fuzz.go deleted file mode 100644 index 1dfa80a6fca..00000000000 --- a/vendor/github.com/google/gofuzz/fuzz.go +++ /dev/null @@ -1,487 +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 fuzz - -import ( - "fmt" - "math/rand" - "reflect" - "time" -) - -// fuzzFuncMap is a map from a type to a fuzzFunc that handles that type. -type fuzzFuncMap map[reflect.Type]reflect.Value - -// Fuzzer knows how to fill any object with random fields. -type Fuzzer struct { - fuzzFuncs fuzzFuncMap - defaultFuzzFuncs fuzzFuncMap - r *rand.Rand - nilChance float64 - minElements int - maxElements int - maxDepth int -} - -// New returns a new Fuzzer. Customize your Fuzzer further by calling Funcs, -// RandSource, NilChance, or NumElements in any order. -func New() *Fuzzer { - return NewWithSeed(time.Now().UnixNano()) -} - -func NewWithSeed(seed int64) *Fuzzer { - f := &Fuzzer{ - defaultFuzzFuncs: fuzzFuncMap{ - reflect.TypeOf(&time.Time{}): reflect.ValueOf(fuzzTime), - }, - - fuzzFuncs: fuzzFuncMap{}, - r: rand.New(rand.NewSource(seed)), - nilChance: .2, - minElements: 1, - maxElements: 10, - maxDepth: 100, - } - return f -} - -// Funcs adds each entry in fuzzFuncs as a custom fuzzing function. -// -// Each entry in fuzzFuncs must be a function taking two parameters. -// The first parameter must be a pointer or map. It is the variable that -// function will fill with random data. The second parameter must be a -// fuzz.Continue, which will provide a source of randomness and a way -// to automatically continue fuzzing smaller pieces of the first parameter. -// -// These functions are called sensibly, e.g., if you wanted custom string -// fuzzing, the function `func(s *string, c fuzz.Continue)` would get -// called and passed the address of strings. Maps and pointers will always -// be made/new'd for you, ignoring the NilChange option. For slices, it -// doesn't make much sense to pre-create them--Fuzzer doesn't know how -// long you want your slice--so take a pointer to a slice, and make it -// yourself. (If you don't want your map/pointer type pre-made, take a -// pointer to it, and make it yourself.) See the examples for a range of -// custom functions. -func (f *Fuzzer) Funcs(fuzzFuncs ...interface{}) *Fuzzer { - for i := range fuzzFuncs { - v := reflect.ValueOf(fuzzFuncs[i]) - if v.Kind() != reflect.Func { - panic("Need only funcs!") - } - t := v.Type() - if t.NumIn() != 2 || t.NumOut() != 0 { - panic("Need 2 in and 0 out params!") - } - argT := t.In(0) - switch argT.Kind() { - case reflect.Ptr, reflect.Map: - default: - panic("fuzzFunc must take pointer or map type") - } - if t.In(1) != reflect.TypeOf(Continue{}) { - panic("fuzzFunc's second parameter must be type fuzz.Continue") - } - f.fuzzFuncs[argT] = v - } - return f -} - -// RandSource causes f to get values from the given source of randomness. -// Use if you want deterministic fuzzing. -func (f *Fuzzer) RandSource(s rand.Source) *Fuzzer { - f.r = rand.New(s) - return f -} - -// NilChance sets the probability of creating a nil pointer, map, or slice to -// 'p'. 'p' should be between 0 (no nils) and 1 (all nils), inclusive. -func (f *Fuzzer) NilChance(p float64) *Fuzzer { - if p < 0 || p > 1 { - panic("p should be between 0 and 1, inclusive.") - } - f.nilChance = p - return f -} - -// NumElements sets the minimum and maximum number of elements that will be -// added to a non-nil map or slice. -func (f *Fuzzer) NumElements(atLeast, atMost int) *Fuzzer { - if atLeast > atMost { - panic("atLeast must be <= atMost") - } - if atLeast < 0 { - panic("atLeast must be >= 0") - } - f.minElements = atLeast - f.maxElements = atMost - return f -} - -func (f *Fuzzer) genElementCount() int { - if f.minElements == f.maxElements { - return f.minElements - } - return f.minElements + f.r.Intn(f.maxElements-f.minElements+1) -} - -func (f *Fuzzer) genShouldFill() bool { - return f.r.Float64() > f.nilChance -} - -// MaxDepth sets the maximum number of recursive fuzz calls that will be made -// before stopping. This includes struct members, pointers, and map and slice -// elements. -func (f *Fuzzer) MaxDepth(d int) *Fuzzer { - f.maxDepth = d - return f -} - -// Fuzz recursively fills all of obj's fields with something random. First -// this tries to find a custom fuzz function (see Funcs). If there is no -// custom function this tests whether the object implements fuzz.Interface and, -// if so, calls Fuzz on it to fuzz itself. If that fails, this will see if -// there is a default fuzz function provided by this package. If all of that -// fails, this will generate random values for all primitive fields and then -// recurse for all non-primitives. -// -// This is safe for cyclic or tree-like structs, up to a limit. Use the -// MaxDepth method to adjust how deep you need it to recurse. -// -// obj must be a pointer. Only exported (public) fields can be set (thanks, -// golang :/ ) Intended for tests, so will panic on bad input or unimplemented -// fields. -func (f *Fuzzer) Fuzz(obj interface{}) { - v := reflect.ValueOf(obj) - if v.Kind() != reflect.Ptr { - panic("needed ptr!") - } - v = v.Elem() - f.fuzzWithContext(v, 0) -} - -// FuzzNoCustom is just like Fuzz, except that any custom fuzz function for -// obj's type will not be called and obj will not be tested for fuzz.Interface -// conformance. This applies only to obj and not other instances of obj's -// type. -// Not safe for cyclic or tree-like structs! -// obj must be a pointer. Only exported (public) fields can be set (thanks, golang :/ ) -// Intended for tests, so will panic on bad input or unimplemented fields. -func (f *Fuzzer) FuzzNoCustom(obj interface{}) { - v := reflect.ValueOf(obj) - if v.Kind() != reflect.Ptr { - panic("needed ptr!") - } - v = v.Elem() - f.fuzzWithContext(v, flagNoCustomFuzz) -} - -const ( - // Do not try to find a custom fuzz function. Does not apply recursively. - flagNoCustomFuzz uint64 = 1 << iota -) - -func (f *Fuzzer) fuzzWithContext(v reflect.Value, flags uint64) { - fc := &fuzzerContext{fuzzer: f} - fc.doFuzz(v, flags) -} - -// fuzzerContext carries context about a single fuzzing run, which lets Fuzzer -// be thread-safe. -type fuzzerContext struct { - fuzzer *Fuzzer - curDepth int -} - -func (fc *fuzzerContext) doFuzz(v reflect.Value, flags uint64) { - if fc.curDepth >= fc.fuzzer.maxDepth { - return - } - fc.curDepth++ - defer func() { fc.curDepth-- }() - - if !v.CanSet() { - return - } - - if flags&flagNoCustomFuzz == 0 { - // Check for both pointer and non-pointer custom functions. - if v.CanAddr() && fc.tryCustom(v.Addr()) { - return - } - if fc.tryCustom(v) { - return - } - } - - if fn, ok := fillFuncMap[v.Kind()]; ok { - fn(v, fc.fuzzer.r) - return - } - switch v.Kind() { - case reflect.Map: - if fc.fuzzer.genShouldFill() { - v.Set(reflect.MakeMap(v.Type())) - n := fc.fuzzer.genElementCount() - for i := 0; i < n; i++ { - key := reflect.New(v.Type().Key()).Elem() - fc.doFuzz(key, 0) - val := reflect.New(v.Type().Elem()).Elem() - fc.doFuzz(val, 0) - v.SetMapIndex(key, val) - } - return - } - v.Set(reflect.Zero(v.Type())) - case reflect.Ptr: - if fc.fuzzer.genShouldFill() { - v.Set(reflect.New(v.Type().Elem())) - fc.doFuzz(v.Elem(), 0) - return - } - v.Set(reflect.Zero(v.Type())) - case reflect.Slice: - if fc.fuzzer.genShouldFill() { - n := fc.fuzzer.genElementCount() - v.Set(reflect.MakeSlice(v.Type(), n, n)) - for i := 0; i < n; i++ { - fc.doFuzz(v.Index(i), 0) - } - return - } - v.Set(reflect.Zero(v.Type())) - case reflect.Array: - if fc.fuzzer.genShouldFill() { - n := v.Len() - for i := 0; i < n; i++ { - fc.doFuzz(v.Index(i), 0) - } - return - } - v.Set(reflect.Zero(v.Type())) - case reflect.Struct: - for i := 0; i < v.NumField(); i++ { - fc.doFuzz(v.Field(i), 0) - } - case reflect.Chan: - fallthrough - case reflect.Func: - fallthrough - case reflect.Interface: - fallthrough - default: - panic(fmt.Sprintf("Can't handle %#v", v.Interface())) - } -} - -// tryCustom searches for custom handlers, and returns true iff it finds a match -// and successfully randomizes v. -func (fc *fuzzerContext) tryCustom(v reflect.Value) bool { - // First: see if we have a fuzz function for it. - doCustom, ok := fc.fuzzer.fuzzFuncs[v.Type()] - if !ok { - // Second: see if it can fuzz itself. - if v.CanInterface() { - intf := v.Interface() - if fuzzable, ok := intf.(Interface); ok { - fuzzable.Fuzz(Continue{fc: fc, Rand: fc.fuzzer.r}) - return true - } - } - // Finally: see if there is a default fuzz function. - doCustom, ok = fc.fuzzer.defaultFuzzFuncs[v.Type()] - if !ok { - return false - } - } - - switch v.Kind() { - case reflect.Ptr: - if v.IsNil() { - if !v.CanSet() { - return false - } - v.Set(reflect.New(v.Type().Elem())) - } - case reflect.Map: - if v.IsNil() { - if !v.CanSet() { - return false - } - v.Set(reflect.MakeMap(v.Type())) - } - default: - return false - } - - doCustom.Call([]reflect.Value{v, reflect.ValueOf(Continue{ - fc: fc, - Rand: fc.fuzzer.r, - })}) - return true -} - -// Interface represents an object that knows how to fuzz itself. Any time we -// find a type that implements this interface we will delegate the act of -// fuzzing itself. -type Interface interface { - Fuzz(c Continue) -} - -// Continue can be passed to custom fuzzing functions to allow them to use -// the correct source of randomness and to continue fuzzing their members. -type Continue struct { - fc *fuzzerContext - - // For convenience, Continue implements rand.Rand via embedding. - // Use this for generating any randomness if you want your fuzzing - // to be repeatable for a given seed. - *rand.Rand -} - -// Fuzz continues fuzzing obj. obj must be a pointer. -func (c Continue) Fuzz(obj interface{}) { - v := reflect.ValueOf(obj) - if v.Kind() != reflect.Ptr { - panic("needed ptr!") - } - v = v.Elem() - c.fc.doFuzz(v, 0) -} - -// FuzzNoCustom continues fuzzing obj, except that any custom fuzz function for -// obj's type will not be called and obj will not be tested for fuzz.Interface -// conformance. This applies only to obj and not other instances of obj's -// type. -func (c Continue) FuzzNoCustom(obj interface{}) { - v := reflect.ValueOf(obj) - if v.Kind() != reflect.Ptr { - panic("needed ptr!") - } - v = v.Elem() - c.fc.doFuzz(v, flagNoCustomFuzz) -} - -// RandString makes a random string up to 20 characters long. The returned string -// may include a variety of (valid) UTF-8 encodings. -func (c Continue) RandString() string { - return randString(c.Rand) -} - -// RandUint64 makes random 64 bit numbers. -// Weirdly, rand doesn't have a function that gives you 64 random bits. -func (c Continue) RandUint64() uint64 { - return randUint64(c.Rand) -} - -// RandBool returns true or false randomly. -func (c Continue) RandBool() bool { - return randBool(c.Rand) -} - -func fuzzInt(v reflect.Value, r *rand.Rand) { - v.SetInt(int64(randUint64(r))) -} - -func fuzzUint(v reflect.Value, r *rand.Rand) { - v.SetUint(randUint64(r)) -} - -func fuzzTime(t *time.Time, c Continue) { - var sec, nsec int64 - // Allow for about 1000 years of random time values, which keeps things - // like JSON parsing reasonably happy. - sec = c.Rand.Int63n(1000 * 365 * 24 * 60 * 60) - c.Fuzz(&nsec) - *t = time.Unix(sec, nsec) -} - -var fillFuncMap = map[reflect.Kind]func(reflect.Value, *rand.Rand){ - reflect.Bool: func(v reflect.Value, r *rand.Rand) { - v.SetBool(randBool(r)) - }, - reflect.Int: fuzzInt, - reflect.Int8: fuzzInt, - reflect.Int16: fuzzInt, - reflect.Int32: fuzzInt, - reflect.Int64: fuzzInt, - reflect.Uint: fuzzUint, - reflect.Uint8: fuzzUint, - reflect.Uint16: fuzzUint, - reflect.Uint32: fuzzUint, - reflect.Uint64: fuzzUint, - reflect.Uintptr: fuzzUint, - reflect.Float32: func(v reflect.Value, r *rand.Rand) { - v.SetFloat(float64(r.Float32())) - }, - reflect.Float64: func(v reflect.Value, r *rand.Rand) { - v.SetFloat(r.Float64()) - }, - reflect.Complex64: func(v reflect.Value, r *rand.Rand) { - panic("unimplemented") - }, - reflect.Complex128: func(v reflect.Value, r *rand.Rand) { - panic("unimplemented") - }, - reflect.String: func(v reflect.Value, r *rand.Rand) { - v.SetString(randString(r)) - }, - reflect.UnsafePointer: func(v reflect.Value, r *rand.Rand) { - panic("unimplemented") - }, -} - -// randBool returns true or false randomly. -func randBool(r *rand.Rand) bool { - if r.Int()&1 == 1 { - return true - } - return false -} - -type charRange struct { - first, last rune -} - -// choose returns a random unicode character from the given range, using the -// given randomness source. -func (r *charRange) choose(rand *rand.Rand) rune { - count := int64(r.last - r.first) - return r.first + rune(rand.Int63n(count)) -} - -var unicodeRanges = []charRange{ - {' ', '~'}, // ASCII characters - {'\u00a0', '\u02af'}, // Multi-byte encoded characters - {'\u4e00', '\u9fff'}, // Common CJK (even longer encodings) -} - -// randString makes a random string up to 20 characters long. The returned string -// may include a variety of (valid) UTF-8 encodings. -func randString(r *rand.Rand) string { - n := r.Intn(20) - runes := make([]rune, n) - for i := range runes { - runes[i] = unicodeRanges[r.Intn(len(unicodeRanges))].choose(r) - } - return string(runes) -} - -// randUint64 makes random 64 bit numbers. -// Weirdly, rand doesn't have a function that gives you 64 random bits. -func randUint64(r *rand.Rand) uint64 { - return uint64(r.Uint32())<<32 | uint64(r.Uint32()) -} diff --git a/vendor/github.com/hashicorp/aws-sdk-go-base/.travis.yml b/vendor/github.com/hashicorp/aws-sdk-go-base/.travis.yml index d29b4720580..f1aaa658b82 100644 --- a/vendor/github.com/hashicorp/aws-sdk-go-base/.travis.yml +++ b/vendor/github.com/hashicorp/aws-sdk-go-base/.travis.yml @@ -1,21 +1,20 @@ dist: xenial language: go go: -- "1.11.x" -env: - GOFLAGS=-mod=vendor +- "1.13.x" + +matrix: + fast_finish: true + allow_failures: + - go: tip install: - make tools script: - make lint -- make test +- go test -timeout=30s -parallel=4 -v ./... branches: only: - master -matrix: - fast_finish: true - allow_failures: - - go: tip diff --git a/vendor/github.com/hashicorp/aws-sdk-go-base/CHANGELOG.md b/vendor/github.com/hashicorp/aws-sdk-go-base/CHANGELOG.md index ed0d5878d03..558e7e39322 100644 --- a/vendor/github.com/hashicorp/aws-sdk-go-base/CHANGELOG.md +++ b/vendor/github.com/hashicorp/aws-sdk-go-base/CHANGELOG.md @@ -1,3 +1,9 @@ +# v0.4.0 (October 3, 2019) + +BUG FIXES + +* awsauth: fixed credentials retrieval, validation, and error handling + # v0.3.0 (February 26, 2019) BUG FIXES diff --git a/vendor/github.com/hashicorp/aws-sdk-go-base/GNUmakefile b/vendor/github.com/hashicorp/aws-sdk-go-base/GNUmakefile index ef101a1117f..3001f2ee4c0 100644 --- a/vendor/github.com/hashicorp/aws-sdk-go-base/GNUmakefile +++ b/vendor/github.com/hashicorp/aws-sdk-go-base/GNUmakefile @@ -1,5 +1,9 @@ default: test lint +fmt: + @echo "==> Fixing source code with gofmt..." + gofmt -s -w ./ + lint: @echo "==> Checking source code against linters..." @golangci-lint run ./... diff --git a/vendor/github.com/hashicorp/aws-sdk-go-base/README.md b/vendor/github.com/hashicorp/aws-sdk-go-base/README.md index dc410ebd401..a5be53987ab 100644 --- a/vendor/github.com/hashicorp/aws-sdk-go-base/README.md +++ b/vendor/github.com/hashicorp/aws-sdk-go-base/README.md @@ -6,7 +6,7 @@ An opinionated [AWS Go SDK](https://github.com/aws/aws-sdk-go) library for consi ## Requirements -- [Go](https://golang.org/doc/install) 1.11.4+ +- [Go](https://golang.org/doc/install) 1.12 ## Development diff --git a/vendor/github.com/hashicorp/aws-sdk-go-base/awsauth.go b/vendor/github.com/hashicorp/aws-sdk-go-base/awsauth.go index 17bc443d570..5311620386a 100644 --- a/vendor/github.com/hashicorp/aws-sdk-go-base/awsauth.go +++ b/vendor/github.com/hashicorp/aws-sdk-go-base/awsauth.go @@ -22,6 +22,21 @@ import ( "github.com/hashicorp/go-multierror" ) +const ( + // errMsgNoValidCredentialSources error getting credentials + errMsgNoValidCredentialSources = `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` +) + +var ( + // ErrNoValidCredentialSources indicates that no credentials source could be found + ErrNoValidCredentialSources = errNoValidCredentialSources() +) + +func errNoValidCredentialSources() error { return errors.New(errMsgNoValidCredentialSources) } + +// GetAccountIDAndPartition gets the account ID and associated partition. func GetAccountIDAndPartition(iamconn *iam.IAM, stsconn *sts.STS, authProviderName string) (string, string, error) { var accountID, partition string var err, errors error @@ -51,6 +66,8 @@ func GetAccountIDAndPartition(iamconn *iam.IAM, stsconn *sts.STS, authProviderNa return accountID, partition, errors } +// GetAccountIDAndPartitionFromEC2Metadata gets the account ID and associated +// partition from EC2 metadata. func GetAccountIDAndPartitionFromEC2Metadata() (string, string, error) { log.Println("[DEBUG] Trying to get account information via EC2 Metadata") @@ -75,6 +92,8 @@ func GetAccountIDAndPartitionFromEC2Metadata() (string, string, error) { return parseAccountIDAndPartitionFromARN(info.InstanceProfileArn) } +// GetAccountIDAndPartitionFromIAMGetUser gets the account ID and associated +// partition from IAM. func GetAccountIDAndPartitionFromIAMGetUser(iamconn *iam.IAM) (string, string, error) { log.Println("[DEBUG] Trying to get account information via iam:GetUser") @@ -102,6 +121,8 @@ func GetAccountIDAndPartitionFromIAMGetUser(iamconn *iam.IAM) (string, string, e return parseAccountIDAndPartitionFromARN(aws.StringValue(output.User.Arn)) } +// GetAccountIDAndPartitionFromIAMListRoles gets the account ID and associated +// partition from listing IAM roles. func GetAccountIDAndPartitionFromIAMListRoles(iamconn *iam.IAM) (string, string, error) { log.Println("[DEBUG] Trying to get account information via iam:ListRoles") @@ -123,6 +144,8 @@ func GetAccountIDAndPartitionFromIAMListRoles(iamconn *iam.IAM) (string, string, return parseAccountIDAndPartitionFromARN(aws.StringValue(output.Roles[0].Arn)) } +// GetAccountIDAndPartitionFromSTSGetCallerIdentity gets the account ID and associated +// partition from STS caller identity. func GetAccountIDAndPartitionFromSTSGetCallerIdentity(stsconn *sts.STS) (string, string, error) { log.Println("[DEBUG] Trying to get account information via sts:GetCallerIdentity") @@ -148,9 +171,54 @@ func parseAccountIDAndPartitionFromARN(inputARN string) (string, string, error) return arn.AccountID, arn.Partition, nil } -// This function is responsible for reading credentials from the -// environment in the case that they're not explicitly specified -// in the Terraform configuration. +// GetCredentialsFromSession returns credentials derived from a session. A +// session uses the AWS SDK Go chain of providers so may use a provider (e.g., +// ProcessProvider) that is not part of the Terraform provider chain. +func GetCredentialsFromSession(c *Config) (*awsCredentials.Credentials, error) { + log.Printf("[INFO] Attempting to use session-derived credentials") + + var sess *session.Session + var err error + if c.Profile == "" { + sess, err = session.NewSession() + if err != nil { + return nil, ErrNoValidCredentialSources + } + } else { + options := &session.Options{ + Config: aws.Config{ + HTTPClient: cleanhttp.DefaultClient(), + MaxRetries: aws.Int(0), + Region: aws.String(c.Region), + }, + } + options.Profile = c.Profile + options.SharedConfigState = session.SharedConfigEnable + + sess, err = session.NewSessionWithOptions(*options) + if err != nil { + if IsAWSErr(err, "NoCredentialProviders", "") { + return nil, ErrNoValidCredentialSources + } + return nil, fmt.Errorf("Error creating AWS session: %s", err) + } + } + + creds := sess.Config.Credentials + cp, err := sess.Config.Credentials.Get() + if err != nil { + return nil, ErrNoValidCredentialSources + } + + log.Printf("[INFO] Successfully derived credentials from session") + log.Printf("[INFO] AWS Auth provider used: %q", cp.ProviderName) + return creds, nil +} + +// GetCredentials gets credentials from the environment, shared credentials, +// or the session (which may include a credential process). GetCredentials also +// validates the credentials and the ability to assume a role or will return an +// error if unsuccessful. func GetCredentials(c *Config) (*awsCredentials.Credentials, error) { // build a chain provider, lazy-evaluated by aws-sdk providers := []awsCredentials.Provider{ @@ -225,29 +293,31 @@ func GetCredentials(c *Config) (*awsCredentials.Credentials, error) { } } - // 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) - + // Validate the credentials before returning them 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`) + if IsAWSErr(err, "NoCredentialProviders", "") { + creds, err = GetCredentialsFromSession(c) + if err != nil { + return nil, err + } + } else { + return nil, fmt.Errorf("Error loading credentials for AWS Provider: %s", err) } + } else { + log.Printf("[INFO] AWS Auth provider used: %q", cp.ProviderName) + } - return nil, fmt.Errorf("Error loading credentials for AWS Provider: %s", err) + // This is the "normal" flow (i.e. not assuming a role) + if c.AssumeRoleARN == "" { + return creds, nil } - log.Printf("[INFO] AWS Auth provider used: %q", cp.ProviderName) + // Otherwise we need to construct an 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) awsConfig := &aws.Config{ Credentials: creds, diff --git a/vendor/github.com/hashicorp/aws-sdk-go-base/go.mod b/vendor/github.com/hashicorp/aws-sdk-go-base/go.mod index 9df74cb3395..1af445d2b17 100644 --- a/vendor/github.com/hashicorp/aws-sdk-go-base/go.mod +++ b/vendor/github.com/hashicorp/aws-sdk-go-base/go.mod @@ -1,10 +1,12 @@ module github.com/hashicorp/aws-sdk-go-base require ( - github.com/aws/aws-sdk-go v1.16.36 + github.com/aws/aws-sdk-go v1.25.3 github.com/hashicorp/go-cleanhttp v0.5.0 github.com/hashicorp/go-multierror v1.0.0 github.com/stretchr/testify v1.3.0 // indirect golang.org/x/net v0.0.0-20190213061140-3a22650c66bd // indirect golang.org/x/text v0.3.0 // indirect ) + +go 1.13 diff --git a/vendor/github.com/hashicorp/aws-sdk-go-base/go.sum b/vendor/github.com/hashicorp/aws-sdk-go-base/go.sum index fe20b5e5547..f06c2e9105d 100644 --- a/vendor/github.com/hashicorp/aws-sdk-go-base/go.sum +++ b/vendor/github.com/hashicorp/aws-sdk-go-base/go.sum @@ -1,5 +1,7 @@ github.com/aws/aws-sdk-go v1.16.36 h1:POeH34ZME++pr7GBGh+ZO6Y5kOwSMQpqp5BGUgooJ6k= github.com/aws/aws-sdk-go v1.16.36/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= +github.com/aws/aws-sdk-go v1.25.3 h1:uM16hIw9BotjZKMZlX05SN2EFtaWfi/NonPKIARiBLQ= +github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= diff --git a/vendor/github.com/hashicorp/aws-sdk-go-base/mock.go b/vendor/github.com/hashicorp/aws-sdk-go-base/mock.go index 66d17256404..e3c80266020 100644 --- a/vendor/github.com/hashicorp/aws-sdk-go-base/mock.go +++ b/vendor/github.com/hashicorp/aws-sdk-go-base/mock.go @@ -6,6 +6,7 @@ import ( "log" "net/http" "net/http/httptest" + "os" "time" "github.com/aws/aws-sdk-go/aws" @@ -13,9 +14,8 @@ import ( "github.com/aws/aws-sdk-go/aws/session" ) -// GetMockedAwsApiSession establishes a httptest server to simulate behaviour -// of a real AWS API server -func GetMockedAwsApiSession(svcName string, endpoints []*MockEndpoint) (func(), *session.Session, error) { +// MockAwsApiServer establishes a httptest server to simulate behaviour of a real AWS API server +func MockAwsApiServer(svcName string, endpoints []*MockEndpoint) *httptest.Server { ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { buf := new(bytes.Buffer) if _, err := buf.ReadFrom(r.Body); err != nil { @@ -46,6 +46,13 @@ func GetMockedAwsApiSession(svcName string, endpoints []*MockEndpoint) (func(), w.WriteHeader(400) })) + return ts +} + +// GetMockedAwsApiSession establishes an AWS session to a simulated AWS API server for a given service and route endpoints. +func GetMockedAwsApiSession(svcName string, endpoints []*MockEndpoint) (func(), *session.Session, error) { + ts := MockAwsApiServer(svcName, endpoints) + sc := awsCredentials.NewStaticCredentials("accessKey", "secretKey", "") sess, err := session.NewSession(&aws.Config{ @@ -58,19 +65,166 @@ func GetMockedAwsApiSession(svcName string, endpoints []*MockEndpoint) (func(), return ts.Close, sess, err } +// awsMetadataApiMock establishes a httptest server to mock out the internal AWS Metadata +// service. IAM Credentials are retrieved by the EC2RoleProvider, which makes +// API calls to this internal URL. By replacing the server with a test server, +// we can simulate an AWS environment +func awsMetadataApiMock(responses []*MetadataResponse) func() { + ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "text/plain") + w.Header().Add("Server", "MockEC2") + log.Printf("[DEBUG] Mocker server received request to %q", r.RequestURI) + for _, e := range responses { + if r.RequestURI == e.Uri { + fmt.Fprintln(w, e.Body) + return + } + } + w.WriteHeader(400) + })) + + os.Setenv("AWS_METADATA_URL", ts.URL+"/latest") + return ts.Close +} + +// MockEndpoint represents a basic request and response that can be used for creating simple httptest server routes. type MockEndpoint struct { Request *MockRequest Response *MockResponse } +// MockRequest represents a basic HTTP request type MockRequest struct { Method string Uri string Body string } +// MockResponse represents a basic HTTP response. type MockResponse struct { StatusCode int Body string ContentType string } + +// MetadataResponse represents a metadata server response URI and body +type MetadataResponse struct { + Uri string `json:"uri"` + Body string `json:"body"` +} + +var ec2metadata_instanceIdEndpoint = &MetadataResponse{ + Uri: "/latest/meta-data/instance-id", + Body: "mock-instance-id", +} + +var ec2metadata_securityCredentialsEndpoints = []*MetadataResponse{ + { + Uri: "/latest/meta-data/iam/security-credentials/", + Body: "test_role", + }, + { + Uri: "/latest/meta-data/iam/security-credentials/test_role", + Body: "{\"Code\":\"Success\",\"LastUpdated\":\"2015-12-11T17:17:25Z\",\"Type\":\"AWS-HMAC\",\"AccessKeyId\":\"somekey\",\"SecretAccessKey\":\"somesecret\",\"Token\":\"sometoken\"}", + }, +} + +var ec2metadata_iamInfoEndpoint = &MetadataResponse{ + Uri: "/latest/meta-data/iam/info", + Body: "{\"Code\": \"Success\",\"LastUpdated\": \"2016-03-17T12:27:32Z\",\"InstanceProfileArn\": \"arn:aws:iam::000000000000:instance-profile/my-instance-profile\",\"InstanceProfileId\": \"AIPAABCDEFGHIJKLMN123\"}", +} + +const ec2metadata_iamInfoEndpoint_expectedAccountID = `000000000000` +const ec2metadata_iamInfoEndpoint_expectedPartition = `aws` + +const iamResponse_GetUser_valid = ` + + + AIDACKCEVSQ6C2EXAMPLE + /division_abc/subdivision_xyz/ + Bob + arn:aws:iam::111111111111:user/division_abc/subdivision_xyz/Bob + 2013-10-02T17:01:44Z + 2014-10-10T14:37:51Z + + + + 7a62c49f-347e-4fc4-9331-6e8eEXAMPLE + +` + +const iamResponse_GetUser_valid_expectedAccountID = `111111111111` +const iamResponse_GetUser_valid_expectedPartition = `aws` + +const iamResponse_GetUser_unauthorized = ` + + Sender + AccessDenied + User: arn:aws:iam::123456789012:user/Bob is not authorized to perform: iam:GetUser on resource: arn:aws:iam::123456789012:user/Bob + + 7a62c49f-347e-4fc4-9331-6e8eEXAMPLE +` + +const stsResponse_GetCallerIdentity_valid = ` + + arn:aws:iam::222222222222:user/Alice + AKIAI44QH8DHBEXAMPLE + 222222222222 + + + 01234567-89ab-cdef-0123-456789abcdef + +` + +const stsResponse_GetCallerIdentity_valid_expectedAccountID = `222222222222` +const stsResponse_GetCallerIdentity_valid_expectedPartition = `aws` + +const stsResponse_GetCallerIdentity_unauthorized = ` + + Sender + AccessDenied + User: arn:aws:iam::123456789012:user/Bob is not authorized to perform: sts:GetCallerIdentity + + 01234567-89ab-cdef-0123-456789abcdef +` + +const iamResponse_GetUser_federatedFailure = ` + + Sender + ValidationError + Must specify userName when calling with non-User credentials + + 7a62c49f-347e-4fc4-9331-6e8eEXAMPLE +` + +const iamResponse_ListRoles_valid = ` + + true + AWceSSsKsazQ4IEplT9o4hURCzBs00iavlEvEXAMPLE + + + / + %7B%22Version%22%3A%222008-10-17%22%2C%22Statement%22%3A%5B%7B%22Sid%22%3A%22%22%2C%22Effect%22%3A%22Allow%22%2C%22Principal%22%3A%7B%22Service%22%3A%22ec2.amazonaws.com%22%7D%2C%22Action%22%3A%22sts%3AAssumeRole%22%7D%5D%7D + AROACKCEVSQ6C2EXAMPLE + elasticbeanstalk-role + arn:aws:iam::444444444444:role/elasticbeanstalk-role + 2013-10-02T17:01:44Z + + + + + 7a62c49f-347e-4fc4-9331-6e8eEXAMPLE + +` + +const iamResponse_ListRoles_valid_expectedAccountID = `444444444444` +const iamResponse_ListRoles_valid_expectedPartition = `aws` + +const iamResponse_ListRoles_unauthorized = ` + + Sender + AccessDenied + User: arn:aws:iam::123456789012:user/Bob is not authorized to perform: iam:ListRoles on resource: arn:aws:iam::123456789012:role/ + + 7a62c49f-347e-4fc4-9331-6e8eEXAMPLE +` diff --git a/vendor/github.com/hashicorp/aws-sdk-go-base/session.go b/vendor/github.com/hashicorp/aws-sdk-go-base/session.go index 35b991bbf39..92671e13130 100644 --- a/vendor/github.com/hashicorp/aws-sdk-go-base/session.go +++ b/vendor/github.com/hashicorp/aws-sdk-go-base/session.go @@ -2,7 +2,6 @@ package awsbase import ( "crypto/tls" - "errors" "fmt" "log" "net/http" @@ -28,45 +27,14 @@ func GetSessionOptions(c *Config) (*session.Options, error) { }, } + // get and validate credentials 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 IsAWSErr(err, "NoCredentialProviders", "") { - // If a profile wasn't specified, the session may still be able to resolve credentials from shared config. - if c.Profile == "" { - sess, err := session.NewSession() - if err != nil { - 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`) - } - _, err = sess.Config.Credentials.Get() - if err != nil { - 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`) - } - log.Printf("[INFO] Using session-derived AWS Auth") - options.Config.Credentials = sess.Config.Credentials - } else { - log.Printf("[INFO] AWS Auth using Profile: %q", c.Profile) - options.Profile = c.Profile - options.SharedConfigState = session.SharedConfigEnable - } - } else { - return nil, fmt.Errorf("Error loading credentials for AWS Provider: %s", err) - } - } else { - // add the validated credentials to the session options - log.Printf("[INFO] AWS Auth provider used: %q", cp.ProviderName) - options.Config.Credentials = creds - } + // add the validated credentials to the session options + options.Config.Credentials = creds if c.Insecure { transport := options.Config.HTTPClient.Transport.(*http.Transport) @@ -83,7 +51,7 @@ func GetSessionOptions(c *Config) (*session.Options, error) { return options, nil } -// GetSession attempts to return valid AWS Go SDK session +// GetSession attempts to return valid AWS Go SDK session. func GetSession(c *Config) (*session.Session, error) { options, err := GetSessionOptions(c) @@ -94,9 +62,7 @@ func GetSession(c *Config) (*session.Session, error) { sess, err := session.NewSessionWithOptions(*options) if err != nil { if IsAWSErr(err, "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, ErrNoValidCredentialSources } return nil, fmt.Errorf("Error creating AWS session: %s", err) } @@ -138,7 +104,7 @@ func GetSession(c *Config) (*session.Session, error) { if !c.SkipCredsValidation { stsClient := sts.New(sess.Copy(&aws.Config{Endpoint: aws.String(c.StsEndpoint)})) if _, _, err := GetAccountIDAndPartitionFromSTSGetCallerIdentity(stsClient); err != nil { - return nil, fmt.Errorf("error validating provider credentials: %s", err) + return nil, fmt.Errorf("error using credentials to get account ID: %s", err) } } diff --git a/vendor/github.com/hashicorp/aws-sdk-go-base/validation.go b/vendor/github.com/hashicorp/aws-sdk-go-base/validation.go index bf320351fc2..0e97557c3b1 100644 --- a/vendor/github.com/hashicorp/aws-sdk-go-base/validation.go +++ b/vendor/github.com/hashicorp/aws-sdk-go-base/validation.go @@ -24,7 +24,7 @@ func ValidateAccountID(accountID string, allowedAccountIDs, forbiddenAccountIDs } } - return fmt.Errorf("AWS Account ID not allowed: %s)", accountID) + return fmt.Errorf("AWS Account ID not allowed: %s", accountID) } return nil diff --git a/vendor/github.com/hashicorp/go-hclog/colorize_unix.go b/vendor/github.com/hashicorp/go-hclog/colorize_unix.go new file mode 100644 index 00000000000..44aa9bf2c62 --- /dev/null +++ b/vendor/github.com/hashicorp/go-hclog/colorize_unix.go @@ -0,0 +1,27 @@ +// +build !windows + +package hclog + +import ( + "github.com/mattn/go-isatty" +) + +// setColorization will mutate the values of this logger +// to approperately configure colorization options. It provides +// a wrapper to the output stream on Windows systems. +func (l *intLogger) setColorization(opts *LoggerOptions) { + switch opts.Color { + case ColorOff: + fallthrough + case ForceColor: + return + case AutoColor: + fi := l.checkWriterIsFile() + isUnixTerm := isatty.IsTerminal(fi.Fd()) + isCygwinTerm := isatty.IsCygwinTerminal(fi.Fd()) + isTerm := isUnixTerm || isCygwinTerm + if !isTerm { + l.writer.color = ColorOff + } + } +} diff --git a/vendor/github.com/hashicorp/go-hclog/colorize_windows.go b/vendor/github.com/hashicorp/go-hclog/colorize_windows.go new file mode 100644 index 00000000000..23486b6d74f --- /dev/null +++ b/vendor/github.com/hashicorp/go-hclog/colorize_windows.go @@ -0,0 +1,33 @@ +// +build windows + +package hclog + +import ( + "os" + + colorable "github.com/mattn/go-colorable" + "github.com/mattn/go-isatty" +) + +// setColorization will mutate the values of this logger +// to approperately configure colorization options. It provides +// a wrapper to the output stream on Windows systems. +func (l *intLogger) setColorization(opts *LoggerOptions) { + switch opts.Color { + case ColorOff: + return + case ForceColor: + fi := l.checkWriterIsFile() + l.writer.w = colorable.NewColorable(fi) + case AutoColor: + fi := l.checkWriterIsFile() + isUnixTerm := isatty.IsTerminal(os.Stdout.Fd()) + isCygwinTerm := isatty.IsCygwinTerminal(os.Stdout.Fd()) + isTerm := isUnixTerm || isCygwinTerm + if !isTerm { + l.writer.color = ColorOff + return + } + l.writer.w = colorable.NewColorable(fi) + } +} diff --git a/vendor/github.com/hashicorp/go-hclog/global.go b/vendor/github.com/hashicorp/go-hclog/global.go index 3efc54c1290..22ebc57d877 100644 --- a/vendor/github.com/hashicorp/go-hclog/global.go +++ b/vendor/github.com/hashicorp/go-hclog/global.go @@ -20,6 +20,13 @@ var ( // Default returns a globally held logger. 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. +// The value of the Default logger can be set via SetDefault() or by +// changing the options in DefaultOptions. +// +// This method is goroutine safe, returning a global from memory, but +// cause should be used if SetDefault() is called it random times +// in the program as that may result in race conditions and an unexpected +// Logger being returned. func Default() Logger { protect.Do(func() { // If SetDefault was used before Default() was called, we need to @@ -41,6 +48,13 @@ func L() Logger { // to the one given. This allows packages to use the default logger // and have higher level packages change it to match the execution // environment. It returns any old default if there is one. +// +// NOTE: This is expected to be called early in the program to setup +// a default logger. As such, it does not attempt to make itself +// not racy with regard to the value of the default logger. Ergo +// if it is called in goroutines, you may experience race conditions +// with other goroutines retrieving the default logger. Basically, +// don't do that. func SetDefault(log Logger) Logger { old := def def = log diff --git a/vendor/github.com/hashicorp/go-hclog/go.mod b/vendor/github.com/hashicorp/go-hclog/go.mod index 0d079a65444..b6698c0836f 100644 --- a/vendor/github.com/hashicorp/go-hclog/go.mod +++ b/vendor/github.com/hashicorp/go-hclog/go.mod @@ -2,6 +2,11 @@ module github.com/hashicorp/go-hclog require ( github.com/davecgh/go-spew v1.1.1 // indirect + github.com/fatih/color v1.7.0 + github.com/mattn/go-colorable v0.1.4 + github.com/mattn/go-isatty v0.0.10 github.com/pmezard/go-difflib v1.0.0 // indirect github.com/stretchr/testify v1.2.2 ) + +go 1.13 diff --git a/vendor/github.com/hashicorp/go-hclog/go.sum b/vendor/github.com/hashicorp/go-hclog/go.sum index e03ee77d9e3..9cee2196c24 100644 --- a/vendor/github.com/hashicorp/go-hclog/go.sum +++ b/vendor/github.com/hashicorp/go-hclog/go.sum @@ -1,6 +1,16 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-isatty v0.0.8 h1:HLtExJ+uU2HOZ+wI0Tt5DtUDrx8yhUqDcp7fYERX4CE= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223 h1:DH4skfRX4EBpamg7iV4ZlCpblAHI6s6TDM39bFZumv8= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/vendor/github.com/hashicorp/go-hclog/interceptlogger.go b/vendor/github.com/hashicorp/go-hclog/interceptlogger.go new file mode 100644 index 00000000000..68f31e42d88 --- /dev/null +++ b/vendor/github.com/hashicorp/go-hclog/interceptlogger.go @@ -0,0 +1,216 @@ +package hclog + +import ( + "io" + "log" + "sync" + "sync/atomic" +) + +var _ Logger = &interceptLogger{} + +type interceptLogger struct { + Logger + + sync.Mutex + sinkCount *int32 + Sinks map[SinkAdapter]struct{} +} + +func NewInterceptLogger(opts *LoggerOptions) InterceptLogger { + intercept := &interceptLogger{ + Logger: New(opts), + sinkCount: new(int32), + Sinks: make(map[SinkAdapter]struct{}), + } + + atomic.StoreInt32(intercept.sinkCount, 0) + + return intercept +} + +// Emit the message and args at TRACE level to log and sinks +func (i *interceptLogger) Trace(msg string, args ...interface{}) { + i.Logger.Trace(msg, args...) + if atomic.LoadInt32(i.sinkCount) == 0 { + return + } + + i.Lock() + defer i.Unlock() + for s := range i.Sinks { + s.Accept(i.Name(), Trace, msg, i.retrieveImplied(args...)...) + } +} + +// Emit the message and args at DEBUG level to log and sinks +func (i *interceptLogger) Debug(msg string, args ...interface{}) { + i.Logger.Debug(msg, args...) + if atomic.LoadInt32(i.sinkCount) == 0 { + return + } + + i.Lock() + defer i.Unlock() + for s := range i.Sinks { + s.Accept(i.Name(), Debug, msg, i.retrieveImplied(args...)...) + } +} + +// Emit the message and args at INFO level to log and sinks +func (i *interceptLogger) Info(msg string, args ...interface{}) { + i.Logger.Info(msg, args...) + if atomic.LoadInt32(i.sinkCount) == 0 { + return + } + + i.Lock() + defer i.Unlock() + for s := range i.Sinks { + s.Accept(i.Name(), Info, msg, i.retrieveImplied(args...)...) + } +} + +// Emit the message and args at WARN level to log and sinks +func (i *interceptLogger) Warn(msg string, args ...interface{}) { + i.Logger.Warn(msg, args...) + if atomic.LoadInt32(i.sinkCount) == 0 { + return + } + + i.Lock() + defer i.Unlock() + for s := range i.Sinks { + s.Accept(i.Name(), Warn, msg, i.retrieveImplied(args...)...) + } +} + +// Emit the message and args at ERROR level to log and sinks +func (i *interceptLogger) Error(msg string, args ...interface{}) { + i.Logger.Error(msg, args...) + if atomic.LoadInt32(i.sinkCount) == 0 { + return + } + + i.Lock() + defer i.Unlock() + for s := range i.Sinks { + s.Accept(i.Name(), Error, msg, i.retrieveImplied(args...)...) + } +} + +func (i *interceptLogger) retrieveImplied(args ...interface{}) []interface{} { + top := i.Logger.ImpliedArgs() + + cp := make([]interface{}, len(top)+len(args)) + copy(cp, top) + copy(cp[len(top):], args) + + return cp +} + +// Create a new sub-Logger that a name decending from the current name. +// This is used to create a subsystem specific Logger. +// Registered sinks will subscribe to these messages as well. +func (i *interceptLogger) Named(name string) Logger { + var sub interceptLogger + + sub = *i + + sub.Logger = i.Logger.Named(name) + + return &sub +} + +// 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. Registered sinks will subscribe +// to these messages as well. +func (i *interceptLogger) ResetNamed(name string) Logger { + var sub interceptLogger + + sub = *i + + sub.Logger = i.Logger.ResetNamed(name) + + return &sub +} + +// Create a new sub-Logger that a name decending from the current name. +// This is used to create a subsystem specific Logger. +// Registered sinks will subscribe to these messages as well. +func (i *interceptLogger) NamedIntercept(name string) InterceptLogger { + var sub interceptLogger + + sub = *i + + sub.Logger = i.Logger.Named(name) + + return &sub +} + +// 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. Registered sinks will subscribe +// to these messages as well. +func (i *interceptLogger) ResetNamedIntercept(name string) InterceptLogger { + var sub interceptLogger + + sub = *i + + sub.Logger = i.Logger.ResetNamed(name) + + return &sub +} + +// 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 (i *interceptLogger) With(args ...interface{}) Logger { + var sub interceptLogger + + sub = *i + + sub.Logger = i.Logger.With(args...) + + return &sub +} + +// RegisterSink attaches a SinkAdapter to interceptLoggers sinks. +func (i *interceptLogger) RegisterSink(sink SinkAdapter) { + i.Lock() + defer i.Unlock() + + i.Sinks[sink] = struct{}{} + + atomic.AddInt32(i.sinkCount, 1) +} + +// DeregisterSink removes a SinkAdapter from interceptLoggers sinks. +func (i *interceptLogger) DeregisterSink(sink SinkAdapter) { + i.Lock() + defer i.Unlock() + + delete(i.Sinks, sink) + + atomic.AddInt32(i.sinkCount, -1) +} + +// Create a *log.Logger that will send it's data through this Logger. This +// allows packages that expect to be using the standard library to log to +// actually use this logger, which will also send to any registered sinks. +func (l *interceptLogger) StandardLoggerIntercept(opts *StandardLoggerOptions) *log.Logger { + if opts == nil { + opts = &StandardLoggerOptions{} + } + + return log.New(l.StandardWriterIntercept(opts), "", 0) +} + +func (l *interceptLogger) StandardWriterIntercept(opts *StandardLoggerOptions) io.Writer { + return &stdlogAdapter{ + log: l, + inferLevels: opts.InferLevels, + forceLevel: opts.ForceLevel, + } +} diff --git a/vendor/github.com/hashicorp/go-hclog/intlogger.go b/vendor/github.com/hashicorp/go-hclog/intlogger.go index 219656c4cb3..5882b87018d 100644 --- a/vendor/github.com/hashicorp/go-hclog/intlogger.go +++ b/vendor/github.com/hashicorp/go-hclog/intlogger.go @@ -7,7 +7,9 @@ import ( "fmt" "io" "log" + "os" "reflect" + "regexp" "runtime" "sort" "strconv" @@ -15,6 +17,8 @@ import ( "sync" "sync/atomic" "time" + + "github.com/fatih/color" ) // TimeFormat to use for logging. This is a version of RFC3339 that contains @@ -32,6 +36,14 @@ var ( Warn: "[WARN] ", Error: "[ERROR]", } + + _levelToColor = map[Level]*color.Color{ + Debug: color.New(color.FgHiWhite), + Trace: color.New(color.FgHiGreen), + Info: color.New(color.FgHiBlue), + Warn: color.New(color.FgHiYellow), + Error: color.New(color.FgHiRed), + } ) // Make sure that intLogger is a Logger @@ -56,6 +68,16 @@ type intLogger struct { // New returns a configured logger. func New(opts *LoggerOptions) Logger { + return newLogger(opts) +} + +// NewSinkAdapter returns a SinkAdapter with configured settings +// defined by LoggerOptions +func NewSinkAdapter(opts *LoggerOptions) SinkAdapter { + return newLogger(opts) +} + +func newLogger(opts *LoggerOptions) *intLogger { if opts == nil { opts = &LoggerOptions{} } @@ -81,10 +103,12 @@ func New(opts *LoggerOptions) Logger { name: opts.Name, timeFormat: TimeFormat, mutex: mutex, - writer: newWriter(output), + writer: newWriter(output, opts.Color), level: new(int32), } + l.setColorization(opts) + if opts.TimeFormat != "" { l.timeFormat = opts.TimeFormat } @@ -96,7 +120,7 @@ func New(opts *LoggerOptions) Logger { // 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 (l *intLogger) Log(level Level, msg string, args ...interface{}) { +func (l *intLogger) Log(name string, level Level, msg string, args ...interface{}) { if level < Level(atomic.LoadInt32(l.level)) { return } @@ -107,9 +131,9 @@ func (l *intLogger) Log(level Level, msg string, args ...interface{}) { defer l.mutex.Unlock() if l.json { - l.logJSON(t, level, msg, args...) + l.logJSON(t, name, level, msg, args...) } else { - l.log(t, level, msg, args...) + l.log(t, name, level, msg, args...) } l.writer.Flush(level) @@ -144,8 +168,10 @@ func trimCallerPath(path string) string { return path[idx+1:] } +var logImplFile = regexp.MustCompile(`github.com/hashicorp/go-hclog/.+logger.go$`) + // Non-JSON logging format function -func (l *intLogger) log(t time.Time, level Level, msg string, args ...interface{}) { +func (l *intLogger) log(t time.Time, name string, level Level, msg string, args ...interface{}) { l.writer.WriteString(t.Format(l.timeFormat)) l.writer.WriteByte(' ') @@ -156,8 +182,18 @@ func (l *intLogger) log(t time.Time, level Level, msg string, args ...interface{ l.writer.WriteString("[?????]") } + offset := 3 if l.caller { - if _, file, line, ok := runtime.Caller(3); ok { + // Check if the caller is inside our package and inside + // a logger implementation file + if _, file, _, ok := runtime.Caller(3); ok { + match := logImplFile.MatchString(file) + if match { + offset = 4 + } + } + + if _, file, line, ok := runtime.Caller(offset); ok { l.writer.WriteByte(' ') l.writer.WriteString(trimCallerPath(file)) l.writer.WriteByte(':') @@ -168,8 +204,8 @@ func (l *intLogger) log(t time.Time, level Level, msg string, args ...interface{ l.writer.WriteByte(' ') - if l.name != "" { - l.writer.WriteString(l.name) + if name != "" { + l.writer.WriteString(name) l.writer.WriteString(": ") } @@ -298,8 +334,8 @@ func (l *intLogger) renderSlice(v reflect.Value) string { } // JSON logging function -func (l *intLogger) logJSON(t time.Time, level Level, msg string, args ...interface{}) { - vals := l.jsonMapEntry(t, level, msg) +func (l *intLogger) logJSON(t time.Time, name string, level Level, msg string, args ...interface{}) { + vals := l.jsonMapEntry(t, name, level, msg) args = append(l.implied, args...) if args != nil && len(args) > 0 { @@ -341,7 +377,7 @@ func (l *intLogger) logJSON(t time.Time, level Level, msg string, args ...interf err := json.NewEncoder(l.writer).Encode(vals) if err != nil { if _, ok := err.(*json.UnsupportedTypeError); ok { - plainVal := l.jsonMapEntry(t, level, msg) + plainVal := l.jsonMapEntry(t, name, level, msg) plainVal["@warn"] = errJsonUnsupportedTypeMsg json.NewEncoder(l.writer).Encode(plainVal) @@ -349,7 +385,7 @@ func (l *intLogger) logJSON(t time.Time, level Level, msg string, args ...interf } } -func (l intLogger) jsonMapEntry(t time.Time, level Level, msg string) map[string]interface{} { +func (l intLogger) jsonMapEntry(t time.Time, name string, level Level, msg string) map[string]interface{} { vals := map[string]interface{}{ "@message": msg, "@timestamp": t.Format("2006-01-02T15:04:05.000000Z07:00"), @@ -373,8 +409,8 @@ func (l intLogger) jsonMapEntry(t time.Time, level Level, msg string) map[string vals["@level"] = levelStr - if l.name != "" { - vals["@module"] = l.name + if name != "" { + vals["@module"] = name } if l.caller { @@ -387,27 +423,27 @@ func (l intLogger) jsonMapEntry(t time.Time, level Level, msg string) map[string // Emit the message and args at DEBUG level func (l *intLogger) Debug(msg string, args ...interface{}) { - l.Log(Debug, msg, args...) + l.Log(l.Name(), Debug, msg, args...) } // Emit the message and args at TRACE level func (l *intLogger) Trace(msg string, args ...interface{}) { - l.Log(Trace, msg, args...) + l.Log(l.Name(), Trace, msg, args...) } // Emit the message and args at INFO level func (l *intLogger) Info(msg string, args ...interface{}) { - l.Log(Info, msg, args...) + l.Log(l.Name(), Info, msg, args...) } // Emit the message and args at WARN level func (l *intLogger) Warn(msg string, args ...interface{}) { - l.Log(Warn, msg, args...) + l.Log(l.Name(), Warn, msg, args...) } // Emit the message and args at ERROR level func (l *intLogger) Error(msg string, args ...interface{}) { - l.Log(Error, msg, args...) + l.Log(l.Name(), Error, msg, args...) } // Indicate that the logger would emit TRACE level logs @@ -525,3 +561,28 @@ func (l *intLogger) StandardWriter(opts *StandardLoggerOptions) io.Writer { forceLevel: opts.ForceLevel, } } + +// checks if the underlying io.Writer is a file, and +// panics if not. For use by colorization. +func (l *intLogger) checkWriterIsFile() *os.File { + fi, ok := l.writer.w.(*os.File) + if !ok { + panic("Cannot enable coloring of non-file Writers") + } + return fi +} + +// Accept implements the SinkAdapter interface +func (i *intLogger) Accept(name string, level Level, msg string, args ...interface{}) { + i.Log(name, level, msg, args...) +} + +// ImpliedArgs returns the loggers implied args +func (i *intLogger) ImpliedArgs() []interface{} { + return i.implied +} + +// Name returns the loggers name +func (i *intLogger) Name() string { + return i.name +} diff --git a/vendor/github.com/hashicorp/go-hclog/logger.go b/vendor/github.com/hashicorp/go-hclog/logger.go index 080ed799966..48d608714f0 100644 --- a/vendor/github.com/hashicorp/go-hclog/logger.go +++ b/vendor/github.com/hashicorp/go-hclog/logger.go @@ -53,6 +53,21 @@ func Fmt(str string, args ...interface{}) Format { return append(Format{str}, args...) } +// ColorOption expresses how the output should be colored, if at all. +type ColorOption uint8 + +const ( + // ColorOff is the default coloration, and does not + // inject color codes into the io.Writer. + ColorOff ColorOption = iota + // AutoColor checks if the io.Writer is a tty, + // and if so enables coloring. + AutoColor + // ForceColor will enable coloring, regardless of whether + // the io.Writer is a tty or not. + ForceColor +) + // 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. @@ -111,9 +126,15 @@ type Logger interface { // Indicate if ERROR logs would be emitted. This and the other Is* guards IsError() bool + // ImpliedArgs returns With key/value pairs + ImpliedArgs() []interface{} + // Creates a sublogger that will always have the given key/value pairs With(args ...interface{}) Logger + // Returns the Name of the logger + Name() string + // 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 @@ -173,4 +194,47 @@ type LoggerOptions struct { // The time format to use instead of the default TimeFormat string + + // Color the output. On Windows, colored logs are only avaiable for io.Writers that + // are concretely instances of *os.File. + Color ColorOption +} + +// InterceptLogger describes the interface for using a logger +// that can register different output sinks. +// This is useful for sending lower level log messages +// to a different output while keeping the root logger +// at a higher one. +type InterceptLogger interface { + // Logger is the root logger for an InterceptLogger + Logger + + // RegisterSink adds a SinkAdapter to the InterceptLogger + RegisterSink(sink SinkAdapter) + + // DeregisterSink removes a SinkAdapter from the InterceptLogger + DeregisterSink(sink SinkAdapter) + + // Create a interceptlogger 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. + NamedIntercept(name string) InterceptLogger + + // Create a interceptlogger 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. + ResetNamedIntercept(name string) InterceptLogger + + // Return a value that conforms to the stdlib log.Logger interface + StandardLoggerIntercept(opts *StandardLoggerOptions) *log.Logger + + // Return a value that conforms to io.Writer, which can be passed into log.SetOutput() + StandardWriterIntercept(opts *StandardLoggerOptions) io.Writer +} + +// SinkAdapter describes the interface that must be implemented +// in order to Register a new sink to an InterceptLogger +type SinkAdapter interface { + Accept(name string, level Level, msg string, args ...interface{}) } diff --git a/vendor/github.com/hashicorp/go-hclog/nulllogger.go b/vendor/github.com/hashicorp/go-hclog/nulllogger.go index 7ad6b351eb8..4abdd5583e8 100644 --- a/vendor/github.com/hashicorp/go-hclog/nulllogger.go +++ b/vendor/github.com/hashicorp/go-hclog/nulllogger.go @@ -35,8 +35,12 @@ func (l *nullLogger) IsWarn() bool { return false } func (l *nullLogger) IsError() bool { return false } +func (l *nullLogger) ImpliedArgs() []interface{} { return []interface{}{} } + func (l *nullLogger) With(args ...interface{}) Logger { return l } +func (l *nullLogger) Name() string { return "" } + func (l *nullLogger) Named(name string) Logger { return l } func (l *nullLogger) ResetNamed(name string) Logger { return l } diff --git a/vendor/github.com/hashicorp/go-hclog/stdlog.go b/vendor/github.com/hashicorp/go-hclog/stdlog.go index 044a4696088..2cf0456a05a 100644 --- a/vendor/github.com/hashicorp/go-hclog/stdlog.go +++ b/vendor/github.com/hashicorp/go-hclog/stdlog.go @@ -25,36 +25,10 @@ func (s *stdlogAdapter) Write(data []byte) (int, error) { _, str := s.pickLevel(str) // Log at the forced level - switch s.forceLevel { - case Trace: - s.log.Trace(str) - case Debug: - s.log.Debug(str) - case Info: - s.log.Info(str) - case Warn: - s.log.Warn(str) - case Error: - s.log.Error(str) - default: - s.log.Info(str) - } + s.dispatch(str, s.forceLevel) } else if s.inferLevels { level, str := s.pickLevel(str) - switch level { - case Trace: - s.log.Trace(str) - case Debug: - s.log.Debug(str) - case Info: - s.log.Info(str) - case Warn: - s.log.Warn(str) - case Error: - s.log.Error(str) - default: - s.log.Info(str) - } + s.dispatch(str, level) } else { s.log.Info(str) } @@ -62,6 +36,23 @@ func (s *stdlogAdapter) Write(data []byte) (int, error) { return len(data), nil } +func (s *stdlogAdapter) dispatch(str string, level Level) { + switch level { + case Trace: + s.log.Trace(str) + case Debug: + s.log.Debug(str) + case Info: + s.log.Info(str) + case Warn: + s.log.Warn(str) + case Error: + s.log.Error(str) + default: + s.log.Info(str) + } +} + // Detect, based on conventions, what log level this is. func (s *stdlogAdapter) pickLevel(str string) (Level, string) { switch { diff --git a/vendor/github.com/hashicorp/go-hclog/writer.go b/vendor/github.com/hashicorp/go-hclog/writer.go index 7e8ec729da8..421a1f06c0b 100644 --- a/vendor/github.com/hashicorp/go-hclog/writer.go +++ b/vendor/github.com/hashicorp/go-hclog/writer.go @@ -6,19 +6,27 @@ import ( ) type writer struct { - b bytes.Buffer - w io.Writer + b bytes.Buffer + w io.Writer + color ColorOption } -func newWriter(w io.Writer) *writer { - return &writer{w: w} +func newWriter(w io.Writer, color ColorOption) *writer { + return &writer{w: w, color: color} } func (w *writer) Flush(level Level) (err error) { + var unwritten = w.b.Bytes() + + if w.color != ColorOff { + color := _levelToColor[level] + unwritten = []byte(color.Sprintf("%s", unwritten)) + } + if lw, ok := w.w.(LevelWriter); ok { - _, err = lw.LevelWrite(level, w.b.Bytes()) + _, err = lw.LevelWrite(level, unwritten) } else { - _, err = w.w.Write(w.b.Bytes()) + _, err = w.w.Write(unwritten) } w.b.Reset() return err diff --git a/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md b/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md new file mode 100644 index 00000000000..ccb46bbd8a1 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/CHANGELOG.md @@ -0,0 +1,23 @@ +# HCL Changelog + +## v2.0.0 (Oct 2, 2019) + +Initial release of HCL 2, which is a new implementating combining the HCL 1 +language with the HIL expression language to produce a single language +supporting both nested configuration structures and arbitrary expressions. + +HCL 2 has an entirely new Go library API and so is _not_ a drop-in upgrade +relative to HCL 1. It's possible to import both versions of HCL into a single +program using Go's _semantic import versioning_ mechanism: + +``` +import ( + hcl1 "github.com/hashicorp/hcl" + hcl2 "github.com/hashicorp/hcl/v2" +) +``` + +--- + +Prior to v2.0.0 there was not a curated changelog. Consult the git history +from the latest v1.x.x tag for information on the changes to HCL 1. diff --git a/vendor/github.com/hashicorp/hcl2/LICENSE b/vendor/github.com/hashicorp/hcl/v2/LICENSE similarity index 100% rename from vendor/github.com/hashicorp/hcl2/LICENSE rename to vendor/github.com/hashicorp/hcl/v2/LICENSE diff --git a/vendor/github.com/hashicorp/hcl/v2/README.md b/vendor/github.com/hashicorp/hcl/v2/README.md new file mode 100644 index 00000000000..d807a424569 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/README.md @@ -0,0 +1,204 @@ +# HCL + +HCL is a toolkit for creating structured configuration languages that are +both human- and machine-friendly, for use with command-line tools. +Although intended to be generally useful, it is primarily targeted +towards devops tools, servers, etc. + +> **NOTE:** This is major version 2 of HCL, whose Go API is incompatible with +> major version 1. Both versions are available for selection in Go Modules +> projects. HCL 2 _cannot_ be imported from Go projects that are not using Go Modules. For more information, see +> [our version selection guide](https://github.com/golang/go/wiki/Version-Selection). + +HCL has both a _native syntax_, intended to be pleasant to read and write for +humans, and a JSON-based variant that is easier for machines to generate +and parse. + +The HCL native syntax is inspired by [libucl](https://github.com/vstakhov/libucl), +[nginx configuration](http://nginx.org/en/docs/beginners_guide.html#conf_structure), +and others. + +It includes an expression syntax that allows basic inline computation and, +with support from the calling application, use of variables and functions +for more dynamic configuration languages. + +HCL provides a set of constructs that can be used by a calling application to +construct a configuration language. The application defines which attribute +names and nested block types are expected, and HCL parses the configuration +file, verifies that it conforms to the expected structure, and returns +high-level objects that the application can use for further processing. + +```go +package main + +import ( + "log" + "github.com/hashicorp/hcl/v2/hclsimple" +) + +type Config struct { + LogLevel string `hcl:"log_level"` +} + +func main() { + var config Config + err := hclsimple.DecodeFile("config.hcl", nil, &config) + if err != nil { + log.Fatalf("Failed to load configuration: %s", err) + } + log.Printf("Configuration is %#v", config) +} +``` + +A lower-level API is available for applications that need more control over +the parsing, decoding, and evaluation of configuration. + +## Why? + +Newcomers to HCL often ask: why not JSON, YAML, etc? + +Whereas JSON and YAML are formats for serializing data structures, HCL is +a syntax and API specifically designed for building structured configuration +formats. + +HCL attempts to strike a compromise between generic serialization formats +such as JSON and configuration formats built around full programming languages +such as Ruby. HCL syntax is designed to be easily read and written by humans, +and allows _declarative_ logic to permit its use in more complex applications. + +HCL is intended as a base syntax for configuration formats built +around key-value pairs and hierarchical blocks whose structure is well-defined +by the calling application, and this definition of the configuration structure +allows for better error messages and more convenient definition within the +calling application. + +It can't be denied that JSON is very convenient as a _lingua franca_ +for interoperability between different pieces of software. Because of this, +HCL defines a common configuration model that can be parsed from either its +native syntax or from a well-defined equivalent JSON structure. This allows +configuration to be provided as a mixture of human-authored configuration +files in the native syntax and machine-generated files in JSON. + +## Information Model and Syntax + +HCL is built around two primary concepts: _attributes_ and _blocks_. In +native syntax, a configuration file for a hypothetical application might look +something like this: + +```hcl +io_mode = "async" + +service "http" "web_proxy" { + listen_addr = "127.0.0.1:8080" + + process "main" { + command = ["/usr/local/bin/awesome-app", "server"] + } + + process "mgmt" { + command = ["/usr/local/bin/awesome-app", "mgmt"] + } +} +``` + +The JSON equivalent of this configuration is the following: + +```json +{ + "io_mode": "async", + "service": { + "http": { + "web_proxy": { + "listen_addr": "127.0.0.1:8080", + "process": { + "main": { + "command": ["/usr/local/bin/awesome-app", "server"] + }, + "mgmt": { + "command": ["/usr/local/bin/awesome-app", "mgmt"] + }, + } + } + } + } +} +``` + +Regardless of which syntax is used, the API within the calling application +is the same. It can either work directly with the low-level attributes and +blocks, for more advanced use-cases, or it can use one of the _decoder_ +packages to declaratively extract into either Go structs or dynamic value +structures. + +Attribute values can be expressions as well as just literal values: + +```hcl +# Arithmetic with literals and application-provided variables +sum = 1 + addend + +# String interpolation and templates +message = "Hello, ${name}!" + +# Application-provided functions +shouty_message = upper(message) +``` + +Although JSON syntax doesn't permit direct use of expressions, the interpolation +syntax allows use of arbitrary expressions within JSON strings: + +```json +{ + "sum": "${1 + addend}", + "message": "Hello, ${name}!", + "shouty_message": "${upper(message)}" +} +``` + +For more information, see the detailed specifications: + +* [Syntax-agnostic Information Model](hcl/spec.md) +* [HCL Native Syntax](hcl/hclsyntax/spec.md) +* [JSON Representation](hcl/json/spec.md) + +## Changes in 2.0 + +Version 2.0 of HCL combines the features of HCL 1.0 with those of the +interpolation language HIL to produce a single configuration language that +supports arbitrary expressions. + +This new version has a completely new parser and Go API, with no direct +migration path. Although the syntax is similar, the implementation takes some +very different approaches to improve on some "rough edges" that existed with +the original implementation and to allow for more robust error handling. + +It's possible to import both HCL 1 and HCL 2 into the same program using Go's +_semantic import versioning_ mechanism: + +```go +import ( + hcl1 "github.com/hashicorp/hcl" + hcl2 "github.com/hashicorp/hcl/v2" +) +``` + +## Acknowledgements + +HCL was heavily inspired by [libucl](https://github.com/vstakhov/libucl), +by [Vsevolod Stakhov](https://github.com/vstakhov). + +HCL and HIL originate in [HashiCorp Terraform](https://terraform.io/), +with the original parsers for each written by +[Mitchell Hashimoto](https://github.com/mitchellh). + +The original HCL parser was ported to pure Go (from yacc) by +[Fatih Arslan](https://github.com/fatih). The structure-related portions of +the new native syntax parser build on that work. + +The original HIL parser was ported to pure Go (from yacc) by +[Martin Atkins](https://github.com/apparentlymart). The expression-related +portions of the new native syntax parser build on that work. + +HCL 2, which merged the original HCL and HIL languages into this single new +language, builds on design and prototyping work by +[Martin Atkins](https://github.com/apparentlymart) in +[zcl](https://github.com/zclconf/go-zcl). diff --git a/vendor/github.com/hashicorp/hcl2/hcl/diagnostic.go b/vendor/github.com/hashicorp/hcl/v2/diagnostic.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/diagnostic.go rename to vendor/github.com/hashicorp/hcl/v2/diagnostic.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/diagnostic_text.go b/vendor/github.com/hashicorp/hcl/v2/diagnostic_text.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/diagnostic_text.go rename to vendor/github.com/hashicorp/hcl/v2/diagnostic_text.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/didyoumean.go b/vendor/github.com/hashicorp/hcl/v2/didyoumean.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/didyoumean.go rename to vendor/github.com/hashicorp/hcl/v2/didyoumean.go diff --git a/vendor/github.com/hashicorp/hcl/v2/doc.go b/vendor/github.com/hashicorp/hcl/v2/doc.go new file mode 100644 index 00000000000..0d43fb2c78d --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/doc.go @@ -0,0 +1,34 @@ +// Package hcl contains the main modelling types and general utility functions +// for HCL. +// +// For a simple entry point into HCL, see the package in the subdirectory +// "hclsimple", which has an opinionated function Decode that can decode HCL +// configurations in either native HCL syntax or JSON syntax into a Go struct +// type: +// +// package main +// +// import ( +// "log" +// "github.com/hashicorp/hcl/v2/hclsimple" +// ) +// +// type Config struct { +// LogLevel string `hcl:"log_level"` +// } +// +// func main() { +// var config Config +// err := hclsimple.DecodeFile("config.hcl", nil, &config) +// if err != nil { +// log.Fatalf("Failed to load configuration: %s", err) +// } +// log.Printf("Configuration is %#v", config) +// } +// +// If your application needs more control over the evaluation of the +// configuration, you can use the functions in the subdirectories hclparse, +// gohcl, hcldec, etc. Splitting the handling of configuration into multiple +// phases allows for advanced patterns such as allowing expressions in one +// part of the configuration to refer to data defined in another part. +package hcl diff --git a/vendor/github.com/hashicorp/hcl2/hcl/eval_context.go b/vendor/github.com/hashicorp/hcl/v2/eval_context.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/eval_context.go rename to vendor/github.com/hashicorp/hcl/v2/eval_context.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/expr_call.go b/vendor/github.com/hashicorp/hcl/v2/expr_call.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/expr_call.go rename to vendor/github.com/hashicorp/hcl/v2/expr_call.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/expr_list.go b/vendor/github.com/hashicorp/hcl/v2/expr_list.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/expr_list.go rename to vendor/github.com/hashicorp/hcl/v2/expr_list.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/expr_map.go b/vendor/github.com/hashicorp/hcl/v2/expr_map.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/expr_map.go rename to vendor/github.com/hashicorp/hcl/v2/expr_map.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/expr_unwrap.go b/vendor/github.com/hashicorp/hcl/v2/expr_unwrap.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/expr_unwrap.go rename to vendor/github.com/hashicorp/hcl/v2/expr_unwrap.go diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/README.md b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/README.md similarity index 100% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/README.md rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/README.md diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/expand_body.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expand_body.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/expand_body.go rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expand_body.go index dd308223983..65a9eab2df4 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/expand_body.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expand_body.go @@ -3,7 +3,7 @@ package dynblock import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/expand_spec.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expand_spec.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/expand_spec.go rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expand_spec.go index 41c0be267ac..98a51eadd89 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/expand_spec.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expand_spec.go @@ -3,7 +3,7 @@ package dynblock import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/expr_wrap.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expr_wrap.go similarity index 96% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/expr_wrap.go rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expr_wrap.go index 6916fc15800..460a1d2a318 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/expr_wrap.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/expr_wrap.go @@ -1,7 +1,7 @@ package dynblock import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/iteration.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/iteration.go similarity index 97% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/iteration.go rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/iteration.go index 7056d336064..c566388689b 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/iteration.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/iteration.go @@ -1,7 +1,7 @@ package dynblock import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/public.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/public.go new file mode 100644 index 00000000000..a5bfd94ec72 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/public.go @@ -0,0 +1,47 @@ +// Package dynblock provides an extension to HCL that allows dynamic +// declaration of nested blocks in certain contexts via a special block type +// named "dynamic". +package dynblock + +import ( + "github.com/hashicorp/hcl/v2" +) + +// Expand "dynamic" blocks in the given body, returning a new body that +// has those blocks expanded. +// +// The given EvalContext is used when evaluating "for_each" and "labels" +// attributes within dynamic blocks, allowing those expressions access to +// variables and functions beyond the iterator variable created by the +// iteration. +// +// Expand returns no diagnostics because no blocks are actually expanded +// until a call to Content or PartialContent on the returned body, which +// will then expand only the blocks selected by the schema. +// +// "dynamic" blocks are also expanded automatically within nested blocks +// in the given body, including within other dynamic blocks, thus allowing +// multi-dimensional iteration. However, it is not possible to +// dynamically-generate the "dynamic" blocks themselves except through nesting. +// +// parent { +// dynamic "child" { +// for_each = child_objs +// content { +// dynamic "grandchild" { +// for_each = child.value.children +// labels = [grandchild.key] +// content { +// parent_key = child.key +// value = grandchild.value +// } +// } +// } +// } +// } +func Expand(body hcl.Body, ctx *hcl.EvalContext) hcl.Body { + return &expandBody{ + original: body, + forEachCtx: ctx, + } +} diff --git a/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/schema.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/schema.go new file mode 100644 index 00000000000..b3907d6eae9 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/schema.go @@ -0,0 +1,50 @@ +package dynblock + +import "github.com/hashicorp/hcl/v2" + +var dynamicBlockHeaderSchema = hcl.BlockHeaderSchema{ + Type: "dynamic", + LabelNames: []string{"type"}, +} + +var dynamicBlockBodySchemaLabels = &hcl.BodySchema{ + Attributes: []hcl.AttributeSchema{ + { + Name: "for_each", + Required: true, + }, + { + Name: "iterator", + Required: false, + }, + { + Name: "labels", + Required: true, + }, + }, + Blocks: []hcl.BlockHeaderSchema{ + { + Type: "content", + LabelNames: nil, + }, + }, +} + +var dynamicBlockBodySchemaNoLabels = &hcl.BodySchema{ + Attributes: []hcl.AttributeSchema{ + { + Name: "for_each", + Required: true, + }, + { + Name: "iterator", + Required: false, + }, + }, + Blocks: []hcl.BlockHeaderSchema{ + { + Type: "content", + LabelNames: nil, + }, + }, +} diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/unknown_body.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/unknown_body.go similarity index 98% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/unknown_body.go rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/unknown_body.go index 932f6a32b06..ce98259a58c 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/unknown_body.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/unknown_body.go @@ -1,7 +1,7 @@ package dynblock import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/variables.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/variables.go new file mode 100644 index 00000000000..192339295e8 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/variables.go @@ -0,0 +1,209 @@ +package dynblock + +import ( + "github.com/hashicorp/hcl/v2" + "github.com/zclconf/go-cty/cty" +) + +// WalkVariables begins the recursive process of walking all expressions and +// nested blocks in the given body and its child bodies while taking into +// account any "dynamic" blocks. +// +// This function requires that the caller walk through the nested block +// structure in the given body level-by-level so that an appropriate schema +// can be provided at each level to inform further processing. This workflow +// is thus easiest to use for calling applications that have some higher-level +// schema representation available with which to drive this multi-step +// process. If your application uses the hcldec package, you may be able to +// use VariablesHCLDec instead for a more automatic approach. +func WalkVariables(body hcl.Body) WalkVariablesNode { + return WalkVariablesNode{ + body: body, + includeContent: true, + } +} + +// WalkExpandVariables is like Variables but it includes only the variables +// required for successful block expansion, ignoring any variables referenced +// inside block contents. The result is the minimal set of all variables +// required for a call to Expand, excluding variables that would only be +// needed to subsequently call Content or PartialContent on the expanded +// body. +func WalkExpandVariables(body hcl.Body) WalkVariablesNode { + return WalkVariablesNode{ + body: body, + } +} + +type WalkVariablesNode struct { + body hcl.Body + it *iteration + + includeContent bool +} + +type WalkVariablesChild struct { + BlockTypeName string + Node WalkVariablesNode +} + +// Body returns the HCL Body associated with the child node, in case the caller +// wants to do some sort of inspection of it in order to decide what schema +// to pass to Visit. +// +// Most implementations should just fetch a fixed schema based on the +// BlockTypeName field and not access this. Deciding on a schema dynamically +// based on the body is a strange thing to do and generally necessary only if +// your caller is already doing other bizarre things with HCL bodies. +func (c WalkVariablesChild) Body() hcl.Body { + return c.Node.body +} + +// Visit returns the variable traversals required for any "dynamic" blocks +// directly in the body associated with this node, and also returns any child +// nodes that must be visited in order to continue the walk. +// +// Each child node has its associated block type name given in its BlockTypeName +// field, which the calling application should use to determine the appropriate +// schema for the content of each child node and pass it to the child node's +// own Visit method to continue the walk recursively. +func (n WalkVariablesNode) Visit(schema *hcl.BodySchema) (vars []hcl.Traversal, children []WalkVariablesChild) { + extSchema := n.extendSchema(schema) + container, _, _ := n.body.PartialContent(extSchema) + if container == nil { + return vars, children + } + + children = make([]WalkVariablesChild, 0, len(container.Blocks)) + + if n.includeContent { + for _, attr := range container.Attributes { + for _, traversal := range attr.Expr.Variables() { + var ours, inherited bool + if n.it != nil { + ours = traversal.RootName() == n.it.IteratorName + _, inherited = n.it.Inherited[traversal.RootName()] + } + + if !(ours || inherited) { + vars = append(vars, traversal) + } + } + } + } + + for _, block := range container.Blocks { + switch block.Type { + + case "dynamic": + blockTypeName := block.Labels[0] + inner, _, _ := block.Body.PartialContent(variableDetectionInnerSchema) + if inner == nil { + continue + } + + iteratorName := blockTypeName + if attr, exists := inner.Attributes["iterator"]; exists { + iterTraversal, _ := hcl.AbsTraversalForExpr(attr.Expr) + if len(iterTraversal) == 0 { + // Ignore this invalid dynamic block, since it'll produce + // an error if someone tries to extract content from it + // later anyway. + continue + } + iteratorName = iterTraversal.RootName() + } + blockIt := n.it.MakeChild(iteratorName, cty.DynamicVal, cty.DynamicVal) + + if attr, exists := inner.Attributes["for_each"]; exists { + // Filter out iterator names inherited from parent blocks + for _, traversal := range attr.Expr.Variables() { + if _, inherited := blockIt.Inherited[traversal.RootName()]; !inherited { + vars = append(vars, traversal) + } + } + } + if attr, exists := inner.Attributes["labels"]; exists { + // Filter out both our own iterator name _and_ those inherited + // from parent blocks, since we provide _both_ of these to the + // label expressions. + for _, traversal := range attr.Expr.Variables() { + ours := traversal.RootName() == iteratorName + _, inherited := blockIt.Inherited[traversal.RootName()] + + if !(ours || inherited) { + vars = append(vars, traversal) + } + } + } + + for _, contentBlock := range inner.Blocks { + // We only request "content" blocks in our schema, so we know + // any blocks we find here will be content blocks. We require + // exactly one content block for actual expansion, but we'll + // be more liberal here so that callers can still collect + // variables from erroneous "dynamic" blocks. + children = append(children, WalkVariablesChild{ + BlockTypeName: blockTypeName, + Node: WalkVariablesNode{ + body: contentBlock.Body, + it: blockIt, + includeContent: n.includeContent, + }, + }) + } + + default: + children = append(children, WalkVariablesChild{ + BlockTypeName: block.Type, + Node: WalkVariablesNode{ + body: block.Body, + it: n.it, + includeContent: n.includeContent, + }, + }) + + } + } + + return vars, children +} + +func (n WalkVariablesNode) extendSchema(schema *hcl.BodySchema) *hcl.BodySchema { + // We augment the requested schema to also include our special "dynamic" + // block type, since then we'll get instances of it interleaved with + // all of the literal child blocks we must also include. + extSchema := &hcl.BodySchema{ + Attributes: schema.Attributes, + Blocks: make([]hcl.BlockHeaderSchema, len(schema.Blocks), len(schema.Blocks)+1), + } + copy(extSchema.Blocks, schema.Blocks) + extSchema.Blocks = append(extSchema.Blocks, dynamicBlockHeaderSchema) + + return extSchema +} + +// This is a more relaxed schema than what's in schema.go, since we +// want to maximize the amount of variables we can find even if there +// are erroneous blocks. +var variableDetectionInnerSchema = &hcl.BodySchema{ + Attributes: []hcl.AttributeSchema{ + { + Name: "for_each", + Required: false, + }, + { + Name: "labels", + Required: false, + }, + { + Name: "iterator", + Required: false, + }, + }, + Blocks: []hcl.BlockHeaderSchema{ + { + Type: "content", + }, + }, +} diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/variables_hcldec.go b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/variables_hcldec.go similarity index 95% rename from vendor/github.com/hashicorp/hcl2/ext/dynblock/variables_hcldec.go rename to vendor/github.com/hashicorp/hcl/v2/ext/dynblock/variables_hcldec.go index a078d915c04..907ef3eba72 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/variables_hcldec.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/dynblock/variables_hcldec.go @@ -1,8 +1,8 @@ package dynblock import ( - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcldec" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hcldec" ) // VariablesHCLDec is a wrapper around WalkVariables that uses the given hcldec diff --git a/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/README.md b/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/README.md new file mode 100644 index 00000000000..ec70947028f --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/README.md @@ -0,0 +1,67 @@ +# HCL Type Expressions Extension + +This HCL extension defines a convention for describing HCL types using function +call and variable reference syntax, allowing configuration formats to include +type information provided by users. + +The type syntax is processed statically from a hcl.Expression, so it cannot +use any of the usual language operators. This is similar to type expressions +in statically-typed programming languages. + +```hcl +variable "example" { + type = list(string) +} +``` + +The extension is built using the `hcl.ExprAsKeyword` and `hcl.ExprCall` +functions, and so it relies on the underlying syntax to define how "keyword" +and "call" are interpreted. The above shows how they are interpreted in +the HCL native syntax, while the following shows the same information +expressed in JSON: + +```json +{ + "variable": { + "example": { + "type": "list(string)" + } + } +} +``` + +Notice that since we have additional contextual information that we intend +to allow only calls and keywords the JSON syntax is able to parse the given +string directly as an expression, rather than as a template as would be +the case for normal expression evaluation. + +For more information, see [the godoc reference](http://godoc.org/github.com/hashicorp/hcl/v2/ext/typeexpr). + +## Type Expression Syntax + +When expressed in the native syntax, the following expressions are permitted +in a type expression: + +* `string` - string +* `bool` - boolean +* `number` - number +* `any` - `cty.DynamicPseudoType` (in function `TypeConstraint` only) +* `list()` - list of the type given as an argument +* `set()` - set of the type given as an argument +* `map()` - map of the type given as an argument +* `tuple([])` - tuple with the element types given in the single list argument +* `object({=, ...}` - object with the attributes and corresponding types given in the single map argument + +For example: + +* `list(string)` +* `object({name=string,age=number})` +* `map(object({name=string,age=number}))` + +Note that the object constructor syntax is not fully-general for all possible +object types because it requires the attribute names to be valid identifiers. +In practice it is expected that any time an object type is being fixed for +type checking it will be one that has identifiers as its attributes; object +types with weird attributes generally show up only from arbitrary object +constructors in configuration files, which are usually treated either as maps +or as the dynamic pseudo-type. diff --git a/vendor/github.com/hashicorp/hcl2/ext/typeexpr/doc.go b/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/doc.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/ext/typeexpr/doc.go rename to vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/doc.go diff --git a/vendor/github.com/hashicorp/hcl2/ext/typeexpr/get_type.go b/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/get_type.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/ext/typeexpr/get_type.go rename to vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/get_type.go index a84338a85a6..11b06897986 100644 --- a/vendor/github.com/hashicorp/hcl2/ext/typeexpr/get_type.go +++ b/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/get_type.go @@ -3,7 +3,7 @@ package typeexpr import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/public.go b/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/public.go new file mode 100644 index 00000000000..3b8f618fbcd --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/ext/typeexpr/public.go @@ -0,0 +1,129 @@ +package typeexpr + +import ( + "bytes" + "fmt" + "sort" + + "github.com/hashicorp/hcl/v2/hclsyntax" + + "github.com/hashicorp/hcl/v2" + "github.com/zclconf/go-cty/cty" +) + +// Type attempts to process the given expression as a type expression and, if +// successful, returns the resulting type. If unsuccessful, error diagnostics +// are returned. +func Type(expr hcl.Expression) (cty.Type, hcl.Diagnostics) { + return getType(expr, false) +} + +// TypeConstraint attempts to parse the given expression as a type constraint +// and, if successful, returns the resulting type. If unsuccessful, error +// diagnostics are returned. +// +// A type constraint has the same structure as a type, but it additionally +// allows the keyword "any" to represent cty.DynamicPseudoType, which is often +// used as a wildcard in type checking and type conversion operations. +func TypeConstraint(expr hcl.Expression) (cty.Type, hcl.Diagnostics) { + return getType(expr, true) +} + +// TypeString returns a string rendering of the given type as it would be +// expected to appear in the HCL native syntax. +// +// This is primarily intended for showing types to the user in an application +// that uses typexpr, where the user can be assumed to be familiar with the +// type expression syntax. In applications that do not use typeexpr these +// results may be confusing to the user and so type.FriendlyName may be +// preferable, even though it's less precise. +// +// TypeString produces reasonable results only for types like what would be +// produced by the Type and TypeConstraint functions. In particular, it cannot +// support capsule types. +func TypeString(ty cty.Type) string { + // Easy cases first + switch ty { + case cty.String: + return "string" + case cty.Bool: + return "bool" + case cty.Number: + return "number" + case cty.DynamicPseudoType: + return "any" + } + + if ty.IsCapsuleType() { + panic("TypeString does not support capsule types") + } + + if ty.IsCollectionType() { + ety := ty.ElementType() + etyString := TypeString(ety) + switch { + case ty.IsListType(): + return fmt.Sprintf("list(%s)", etyString) + case ty.IsSetType(): + return fmt.Sprintf("set(%s)", etyString) + case ty.IsMapType(): + return fmt.Sprintf("map(%s)", etyString) + default: + // Should never happen because the above is exhaustive + panic("unsupported collection type") + } + } + + if ty.IsObjectType() { + var buf bytes.Buffer + buf.WriteString("object({") + atys := ty.AttributeTypes() + names := make([]string, 0, len(atys)) + for name := range atys { + names = append(names, name) + } + sort.Strings(names) + first := true + for _, name := range names { + aty := atys[name] + if !first { + buf.WriteByte(',') + } + if !hclsyntax.ValidIdentifier(name) { + // Should never happen for any type produced by this package, + // but we'll do something reasonable here just so we don't + // produce garbage if someone gives us a hand-assembled object + // type that has weird attribute names. + // Using Go-style quoting here isn't perfect, since it doesn't + // exactly match HCL syntax, but it's fine for an edge-case. + buf.WriteString(fmt.Sprintf("%q", name)) + } else { + buf.WriteString(name) + } + buf.WriteByte('=') + buf.WriteString(TypeString(aty)) + first = false + } + buf.WriteString("})") + return buf.String() + } + + if ty.IsTupleType() { + var buf bytes.Buffer + buf.WriteString("tuple([") + etys := ty.TupleElementTypes() + first := true + for _, ety := range etys { + if !first { + buf.WriteByte(',') + } + buf.WriteString(TypeString(ety)) + first = false + } + buf.WriteString("])") + return buf.String() + } + + // Should never happen because we covered all cases above. + panic(fmt.Errorf("unsupported type %#v", ty)) +} diff --git a/vendor/github.com/hashicorp/hcl/v2/go.mod b/vendor/github.com/hashicorp/hcl/v2/go.mod new file mode 100644 index 00000000000..c152e6016fd --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/go.mod @@ -0,0 +1,21 @@ +module github.com/hashicorp/hcl/v2 + +require ( + github.com/agext/levenshtein v1.2.1 + github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3 + github.com/apparentlymart/go-textseg v1.0.0 + github.com/davecgh/go-spew v1.1.1 + github.com/go-test/deep v1.0.3 + github.com/google/go-cmp v0.2.0 + github.com/kr/pretty v0.1.0 + github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 + github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/sergi/go-diff v1.0.0 + github.com/spf13/pflag v1.0.2 + github.com/stretchr/testify v1.2.2 // indirect + github.com/zclconf/go-cty v1.1.0 + golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734 + golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 // indirect + golang.org/x/text v0.3.2 // indirect +) diff --git a/vendor/github.com/hashicorp/hcl/v2/go.sum b/vendor/github.com/hashicorp/hcl/v2/go.sum new file mode 100644 index 00000000000..b3b95415f8f --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/go.sum @@ -0,0 +1,51 @@ +github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8= +github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3 h1:ZSTrOEhiM5J5RFxEaFvMZVEAM1KvT1YzbEOwB2EAGjA= +github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= +github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= +github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= +github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= +github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7 h1:DpOJ2HYzCv8LZP15IdmG+YdwD2luVPHITV96TkirNBM= +github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= +github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/spf13/pflag v1.0.2 h1:Fy0orTDgHdbnzHcsOgfCN4LtHf0ec3wwtiwJqwvf3Gc= +github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/zclconf/go-cty v1.1.0 h1:uJwc9HiBOCpoKIObTQaLR+tsEXx1HBHnOsOOpcdhZgw= +github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734 h1:p/H982KKEjUnLJkM3tt/LemDnOc1GiZL5FCVlORJ5zo= +golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 h1:vsphBvatvfbhlb4PO1BYSr9dzugGxJ/SQHoNufZJq1w= +golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/vendor/github.com/hashicorp/hcl/v2/gohcl/decode.go b/vendor/github.com/hashicorp/hcl/v2/gohcl/decode.go new file mode 100644 index 00000000000..7ba08eee00a --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/gohcl/decode.go @@ -0,0 +1,304 @@ +package gohcl + +import ( + "fmt" + "reflect" + + "github.com/zclconf/go-cty/cty" + + "github.com/hashicorp/hcl/v2" + "github.com/zclconf/go-cty/cty/convert" + "github.com/zclconf/go-cty/cty/gocty" +) + +// DecodeBody extracts the configuration within the given body into the given +// value. This value must be a non-nil pointer to either a struct or +// a map, where in the former case the configuration will be decoded using +// struct tags and in the latter case only attributes are allowed and their +// values are decoded into the map. +// +// The given EvalContext is used to resolve any variables or functions in +// expressions encountered while decoding. This may be nil to require only +// constant values, for simple applications that do not support variables or +// functions. +// +// The returned diagnostics should be inspected with its HasErrors method to +// determine if the populated value is valid and complete. If error diagnostics +// are returned then the given value may have been partially-populated but +// may still be accessed by a careful caller for static analysis and editor +// integration use-cases. +func DecodeBody(body hcl.Body, ctx *hcl.EvalContext, val interface{}) hcl.Diagnostics { + rv := reflect.ValueOf(val) + if rv.Kind() != reflect.Ptr { + panic(fmt.Sprintf("target value must be a pointer, not %s", rv.Type().String())) + } + + return decodeBodyToValue(body, ctx, rv.Elem()) +} + +func decodeBodyToValue(body hcl.Body, ctx *hcl.EvalContext, val reflect.Value) hcl.Diagnostics { + et := val.Type() + switch et.Kind() { + case reflect.Struct: + return decodeBodyToStruct(body, ctx, val) + case reflect.Map: + return decodeBodyToMap(body, ctx, val) + default: + panic(fmt.Sprintf("target value must be pointer to struct or map, not %s", et.String())) + } +} + +func decodeBodyToStruct(body hcl.Body, ctx *hcl.EvalContext, val reflect.Value) hcl.Diagnostics { + schema, partial := ImpliedBodySchema(val.Interface()) + + var content *hcl.BodyContent + var leftovers hcl.Body + var diags hcl.Diagnostics + if partial { + content, leftovers, diags = body.PartialContent(schema) + } else { + content, diags = body.Content(schema) + } + if content == nil { + return diags + } + + tags := getFieldTags(val.Type()) + + if tags.Remain != nil { + fieldIdx := *tags.Remain + field := val.Type().Field(fieldIdx) + fieldV := val.Field(fieldIdx) + switch { + case bodyType.AssignableTo(field.Type): + fieldV.Set(reflect.ValueOf(leftovers)) + case attrsType.AssignableTo(field.Type): + attrs, attrsDiags := leftovers.JustAttributes() + if len(attrsDiags) > 0 { + diags = append(diags, attrsDiags...) + } + fieldV.Set(reflect.ValueOf(attrs)) + default: + diags = append(diags, decodeBodyToValue(leftovers, ctx, fieldV)...) + } + } + + for name, fieldIdx := range tags.Attributes { + attr := content.Attributes[name] + field := val.Type().Field(fieldIdx) + fieldV := val.Field(fieldIdx) + + if attr == nil { + if !exprType.AssignableTo(field.Type) { + continue + } + + // As a special case, if the target is of type hcl.Expression then + // we'll assign an actual expression that evalues to a cty null, + // so the caller can deal with it within the cty realm rather + // than within the Go realm. + synthExpr := hcl.StaticExpr(cty.NullVal(cty.DynamicPseudoType), body.MissingItemRange()) + fieldV.Set(reflect.ValueOf(synthExpr)) + continue + } + + switch { + case attrType.AssignableTo(field.Type): + fieldV.Set(reflect.ValueOf(attr)) + case exprType.AssignableTo(field.Type): + fieldV.Set(reflect.ValueOf(attr.Expr)) + default: + diags = append(diags, DecodeExpression( + attr.Expr, ctx, fieldV.Addr().Interface(), + )...) + } + } + + blocksByType := content.Blocks.ByType() + + for typeName, fieldIdx := range tags.Blocks { + blocks := blocksByType[typeName] + field := val.Type().Field(fieldIdx) + + ty := field.Type + isSlice := false + isPtr := false + if ty.Kind() == reflect.Slice { + isSlice = true + ty = ty.Elem() + } + if ty.Kind() == reflect.Ptr { + isPtr = true + ty = ty.Elem() + } + + if len(blocks) > 1 && !isSlice { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: fmt.Sprintf("Duplicate %s block", typeName), + Detail: fmt.Sprintf( + "Only one %s block is allowed. Another was defined at %s.", + typeName, blocks[0].DefRange.String(), + ), + Subject: &blocks[1].DefRange, + }) + continue + } + + if len(blocks) == 0 { + if isSlice || isPtr { + val.Field(fieldIdx).Set(reflect.Zero(field.Type)) + } else { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: fmt.Sprintf("Missing %s block", typeName), + Detail: fmt.Sprintf("A %s block is required.", typeName), + Subject: body.MissingItemRange().Ptr(), + }) + } + continue + } + + switch { + + case isSlice: + elemType := ty + if isPtr { + elemType = reflect.PtrTo(ty) + } + sli := reflect.MakeSlice(reflect.SliceOf(elemType), len(blocks), len(blocks)) + + for i, block := range blocks { + if isPtr { + v := reflect.New(ty) + diags = append(diags, decodeBlockToValue(block, ctx, v.Elem())...) + sli.Index(i).Set(v) + } else { + diags = append(diags, decodeBlockToValue(block, ctx, sli.Index(i))...) + } + } + + val.Field(fieldIdx).Set(sli) + + default: + block := blocks[0] + if isPtr { + v := reflect.New(ty) + diags = append(diags, decodeBlockToValue(block, ctx, v.Elem())...) + val.Field(fieldIdx).Set(v) + } else { + diags = append(diags, decodeBlockToValue(block, ctx, val.Field(fieldIdx))...) + } + + } + + } + + return diags +} + +func decodeBodyToMap(body hcl.Body, ctx *hcl.EvalContext, v reflect.Value) hcl.Diagnostics { + attrs, diags := body.JustAttributes() + if attrs == nil { + return diags + } + + mv := reflect.MakeMap(v.Type()) + + for k, attr := range attrs { + switch { + case attrType.AssignableTo(v.Type().Elem()): + mv.SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(attr)) + case exprType.AssignableTo(v.Type().Elem()): + mv.SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(attr.Expr)) + default: + ev := reflect.New(v.Type().Elem()) + diags = append(diags, DecodeExpression(attr.Expr, ctx, ev.Interface())...) + mv.SetMapIndex(reflect.ValueOf(k), ev.Elem()) + } + } + + v.Set(mv) + + return diags +} + +func decodeBlockToValue(block *hcl.Block, ctx *hcl.EvalContext, v reflect.Value) hcl.Diagnostics { + var diags hcl.Diagnostics + + ty := v.Type() + + switch { + case blockType.AssignableTo(ty): + v.Elem().Set(reflect.ValueOf(block)) + case bodyType.AssignableTo(ty): + v.Elem().Set(reflect.ValueOf(block.Body)) + case attrsType.AssignableTo(ty): + attrs, attrsDiags := block.Body.JustAttributes() + if len(attrsDiags) > 0 { + diags = append(diags, attrsDiags...) + } + v.Elem().Set(reflect.ValueOf(attrs)) + default: + diags = append(diags, decodeBodyToValue(block.Body, ctx, v)...) + + if len(block.Labels) > 0 { + blockTags := getFieldTags(ty) + for li, lv := range block.Labels { + lfieldIdx := blockTags.Labels[li].FieldIndex + v.Field(lfieldIdx).Set(reflect.ValueOf(lv)) + } + } + + } + + return diags +} + +// DecodeExpression extracts the value of the given expression into the given +// value. This value must be something that gocty is able to decode into, +// since the final decoding is delegated to that package. +// +// The given EvalContext is used to resolve any variables or functions in +// expressions encountered while decoding. This may be nil to require only +// constant values, for simple applications that do not support variables or +// functions. +// +// The returned diagnostics should be inspected with its HasErrors method to +// determine if the populated value is valid and complete. If error diagnostics +// are returned then the given value may have been partially-populated but +// may still be accessed by a careful caller for static analysis and editor +// integration use-cases. +func DecodeExpression(expr hcl.Expression, ctx *hcl.EvalContext, val interface{}) hcl.Diagnostics { + srcVal, diags := expr.Value(ctx) + + convTy, err := gocty.ImpliedType(val) + if err != nil { + panic(fmt.Sprintf("unsuitable DecodeExpression target: %s", err)) + } + + srcVal, err = convert.Convert(srcVal, convTy) + if err != nil { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Unsuitable value type", + Detail: fmt.Sprintf("Unsuitable value: %s", err.Error()), + Subject: expr.StartRange().Ptr(), + Context: expr.Range().Ptr(), + }) + return diags + } + + err = gocty.FromCtyValue(srcVal, val) + if err != nil { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Unsuitable value type", + Detail: fmt.Sprintf("Unsuitable value: %s", err.Error()), + Subject: expr.StartRange().Ptr(), + Context: expr.Range().Ptr(), + }) + } + + return diags +} diff --git a/vendor/github.com/hashicorp/hcl2/gohcl/doc.go b/vendor/github.com/hashicorp/hcl/v2/gohcl/doc.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/gohcl/doc.go rename to vendor/github.com/hashicorp/hcl/v2/gohcl/doc.go diff --git a/vendor/github.com/hashicorp/hcl2/gohcl/encode.go b/vendor/github.com/hashicorp/hcl/v2/gohcl/encode.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/gohcl/encode.go rename to vendor/github.com/hashicorp/hcl/v2/gohcl/encode.go index 3cbf7e48af4..d612e09c9f1 100644 --- a/vendor/github.com/hashicorp/hcl2/gohcl/encode.go +++ b/vendor/github.com/hashicorp/hcl/v2/gohcl/encode.go @@ -5,7 +5,7 @@ import ( "reflect" "sort" - "github.com/hashicorp/hcl2/hclwrite" + "github.com/hashicorp/hcl/v2/hclwrite" "github.com/zclconf/go-cty/cty/gocty" ) diff --git a/vendor/github.com/hashicorp/hcl/v2/gohcl/schema.go b/vendor/github.com/hashicorp/hcl/v2/gohcl/schema.go new file mode 100644 index 00000000000..ecf6ddbac62 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/gohcl/schema.go @@ -0,0 +1,174 @@ +package gohcl + +import ( + "fmt" + "reflect" + "sort" + "strings" + + "github.com/hashicorp/hcl/v2" +) + +// ImpliedBodySchema produces a hcl.BodySchema derived from the type of the +// given value, which must be a struct value or a pointer to one. If an +// inappropriate value is passed, this function will panic. +// +// The second return argument indicates whether the given struct includes +// a "remain" field, and thus the returned schema is non-exhaustive. +// +// This uses the tags on the fields of the struct to discover how each +// field's value should be expressed within configuration. If an invalid +// mapping is attempted, this function will panic. +func ImpliedBodySchema(val interface{}) (schema *hcl.BodySchema, partial bool) { + ty := reflect.TypeOf(val) + + if ty.Kind() == reflect.Ptr { + ty = ty.Elem() + } + + if ty.Kind() != reflect.Struct { + panic(fmt.Sprintf("given value must be struct, not %T", val)) + } + + var attrSchemas []hcl.AttributeSchema + var blockSchemas []hcl.BlockHeaderSchema + + tags := getFieldTags(ty) + + attrNames := make([]string, 0, len(tags.Attributes)) + for n := range tags.Attributes { + attrNames = append(attrNames, n) + } + sort.Strings(attrNames) + for _, n := range attrNames { + idx := tags.Attributes[n] + optional := tags.Optional[n] + field := ty.Field(idx) + + var required bool + + switch { + case field.Type.AssignableTo(exprType): + // If we're decoding to hcl.Expression then absense can be + // indicated via a null value, so we don't specify that + // the field is required during decoding. + required = false + case field.Type.Kind() != reflect.Ptr && !optional: + required = true + default: + required = false + } + + attrSchemas = append(attrSchemas, hcl.AttributeSchema{ + Name: n, + Required: required, + }) + } + + blockNames := make([]string, 0, len(tags.Blocks)) + for n := range tags.Blocks { + blockNames = append(blockNames, n) + } + sort.Strings(blockNames) + for _, n := range blockNames { + idx := tags.Blocks[n] + field := ty.Field(idx) + fty := field.Type + if fty.Kind() == reflect.Slice { + fty = fty.Elem() + } + if fty.Kind() == reflect.Ptr { + fty = fty.Elem() + } + if fty.Kind() != reflect.Struct { + panic(fmt.Sprintf( + "hcl 'block' tag kind cannot be applied to %s field %s: struct required", field.Type.String(), field.Name, + )) + } + ftags := getFieldTags(fty) + var labelNames []string + if len(ftags.Labels) > 0 { + labelNames = make([]string, len(ftags.Labels)) + for i, l := range ftags.Labels { + labelNames[i] = l.Name + } + } + + blockSchemas = append(blockSchemas, hcl.BlockHeaderSchema{ + Type: n, + LabelNames: labelNames, + }) + } + + partial = tags.Remain != nil + schema = &hcl.BodySchema{ + Attributes: attrSchemas, + Blocks: blockSchemas, + } + return schema, partial +} + +type fieldTags struct { + Attributes map[string]int + Blocks map[string]int + Labels []labelField + Remain *int + Optional map[string]bool +} + +type labelField struct { + FieldIndex int + Name string +} + +func getFieldTags(ty reflect.Type) *fieldTags { + ret := &fieldTags{ + Attributes: map[string]int{}, + Blocks: map[string]int{}, + Optional: map[string]bool{}, + } + + ct := ty.NumField() + for i := 0; i < ct; i++ { + field := ty.Field(i) + tag := field.Tag.Get("hcl") + if tag == "" { + continue + } + + comma := strings.Index(tag, ",") + var name, kind string + if comma != -1 { + name = tag[:comma] + kind = tag[comma+1:] + } else { + name = tag + kind = "attr" + } + + switch kind { + case "attr": + ret.Attributes[name] = i + case "block": + ret.Blocks[name] = i + case "label": + ret.Labels = append(ret.Labels, labelField{ + FieldIndex: i, + Name: name, + }) + case "remain": + if ret.Remain != nil { + panic("only one 'remain' tag is permitted") + } + idx := i // copy, because this loop will continue assigning to i + ret.Remain = &idx + case "optional": + ret.Attributes[name] = i + ret.Optional[name] = true + default: + panic(fmt.Sprintf("invalid hcl field tag kind %q on %s %q", kind, field.Type.String(), field.Name)) + } + } + + return ret +} diff --git a/vendor/github.com/hashicorp/hcl/v2/gohcl/types.go b/vendor/github.com/hashicorp/hcl/v2/gohcl/types.go new file mode 100644 index 00000000000..a8d00f8ff2e --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/gohcl/types.go @@ -0,0 +1,16 @@ +package gohcl + +import ( + "reflect" + + "github.com/hashicorp/hcl/v2" +) + +var victimExpr hcl.Expression +var victimBody hcl.Body + +var exprType = reflect.TypeOf(&victimExpr).Elem() +var bodyType = reflect.TypeOf(&victimBody).Elem() +var blockType = reflect.TypeOf((*hcl.Block)(nil)) +var attrType = reflect.TypeOf((*hcl.Attribute)(nil)) +var attrsType = reflect.TypeOf(hcl.Attributes(nil)) diff --git a/vendor/github.com/hashicorp/hcl2/hcldec/block_labels.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/block_labels.go similarity index 90% rename from vendor/github.com/hashicorp/hcl2/hcldec/block_labels.go rename to vendor/github.com/hashicorp/hcl/v2/hcldec/block_labels.go index 7e652e9bc64..71de451934a 100644 --- a/vendor/github.com/hashicorp/hcl2/hcldec/block_labels.go +++ b/vendor/github.com/hashicorp/hcl/v2/hcldec/block_labels.go @@ -1,7 +1,7 @@ package hcldec import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) type blockLabel struct { diff --git a/vendor/github.com/hashicorp/hcl/v2/hcldec/decode.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/decode.go new file mode 100644 index 00000000000..c6e42236d8f --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hcldec/decode.go @@ -0,0 +1,36 @@ +package hcldec + +import ( + "github.com/hashicorp/hcl/v2" + "github.com/zclconf/go-cty/cty" +) + +func decode(body hcl.Body, blockLabels []blockLabel, ctx *hcl.EvalContext, spec Spec, partial bool) (cty.Value, hcl.Body, hcl.Diagnostics) { + schema := ImpliedSchema(spec) + + var content *hcl.BodyContent + var diags hcl.Diagnostics + var leftovers hcl.Body + + if partial { + content, leftovers, diags = body.PartialContent(schema) + } else { + content, diags = body.Content(schema) + } + + val, valDiags := spec.decode(content, blockLabels, ctx) + diags = append(diags, valDiags...) + + return val, leftovers, diags +} + +func impliedType(spec Spec) cty.Type { + return spec.impliedType() +} + +func sourceRange(body hcl.Body, blockLabels []blockLabel, spec Spec) hcl.Range { + schema := ImpliedSchema(spec) + content, _, _ := body.PartialContent(schema) + + return spec.sourceRange(content, blockLabels) +} diff --git a/vendor/github.com/hashicorp/hcl2/hcldec/doc.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/doc.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcldec/doc.go rename to vendor/github.com/hashicorp/hcl/v2/hcldec/doc.go diff --git a/vendor/github.com/hashicorp/hcl2/hcldec/gob.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/gob.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcldec/gob.go rename to vendor/github.com/hashicorp/hcl/v2/hcldec/gob.go diff --git a/vendor/github.com/hashicorp/hcl/v2/hcldec/public.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/public.go new file mode 100644 index 00000000000..1fa548d0c39 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hcldec/public.go @@ -0,0 +1,81 @@ +package hcldec + +import ( + "github.com/hashicorp/hcl/v2" + "github.com/zclconf/go-cty/cty" +) + +// Decode interprets the given body using the given specification and returns +// the resulting value. If the given body is not valid per the spec, error +// diagnostics are returned and the returned value is likely to be incomplete. +// +// The ctx argument may be nil, in which case any references to variables or +// functions will produce error diagnostics. +func Decode(body hcl.Body, spec Spec, ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { + val, _, diags := decode(body, nil, ctx, spec, false) + return val, diags +} + +// PartialDecode is like Decode except that it permits "leftover" items in +// the top-level body, which are returned as a new body to allow for +// further processing. +// +// Any descendent block bodies are _not_ decoded partially and thus must +// be fully described by the given specification. +func PartialDecode(body hcl.Body, spec Spec, ctx *hcl.EvalContext) (cty.Value, hcl.Body, hcl.Diagnostics) { + return decode(body, nil, ctx, spec, true) +} + +// ImpliedType returns the value type that should result from decoding the +// given spec. +func ImpliedType(spec Spec) cty.Type { + return impliedType(spec) +} + +// SourceRange interprets the given body using the given specification and +// then returns the source range of the value that would be used to +// fulfill the spec. +// +// This can be used if application-level validation detects value errors, to +// obtain a reasonable SourceRange to use for generated diagnostics. It works +// best when applied to specific body items (e.g. using AttrSpec, BlockSpec, ...) +// as opposed to entire bodies using ObjectSpec, TupleSpec. The result will +// be less useful the broader the specification, so e.g. a spec that returns +// the entirety of all of the blocks of a given type is likely to be +// _particularly_ arbitrary and useless. +// +// If the given body is not valid per the given spec, the result is best-effort +// and may not actually be something ideal. It's expected that an application +// will already have used Decode or PartialDecode earlier and thus had an +// opportunity to detect and report spec violations. +func SourceRange(body hcl.Body, spec Spec) hcl.Range { + return sourceRange(body, nil, spec) +} + +// ChildBlockTypes returns a map of all of the child block types declared +// by the given spec, with block type names as keys and the associated +// nested body specs as values. +func ChildBlockTypes(spec Spec) map[string]Spec { + ret := map[string]Spec{} + + // visitSameBodyChildren walks through the spec structure, calling + // the given callback for each descendent spec encountered. We are + // interested in the specs that reference attributes and blocks. + var visit visitFunc + visit = func(s Spec) { + if bs, ok := s.(blockSpec); ok { + for _, blockS := range bs.blockHeaderSchemata() { + nested := bs.nestedSpec() + if nested != nil { // nil can be returned to dynamically opt out of this interface + ret[blockS.Type] = nested + } + } + } + + s.visitSameBodyChildren(visit) + } + + visit(spec) + + return ret +} diff --git a/vendor/github.com/hashicorp/hcl/v2/hcldec/schema.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/schema.go new file mode 100644 index 00000000000..ddbe7fa4ab5 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hcldec/schema.go @@ -0,0 +1,36 @@ +package hcldec + +import ( + "github.com/hashicorp/hcl/v2" +) + +// ImpliedSchema returns the *hcl.BodySchema implied by the given specification. +// This is the schema that the Decode function will use internally to +// access the content of a given body. +func ImpliedSchema(spec Spec) *hcl.BodySchema { + var attrs []hcl.AttributeSchema + var blocks []hcl.BlockHeaderSchema + + // visitSameBodyChildren walks through the spec structure, calling + // the given callback for each descendent spec encountered. We are + // interested in the specs that reference attributes and blocks. + var visit visitFunc + visit = func(s Spec) { + if as, ok := s.(attrSpec); ok { + attrs = append(attrs, as.attrSchemata()...) + } + + if bs, ok := s.(blockSpec); ok { + blocks = append(blocks, bs.blockHeaderSchemata()...) + } + + s.visitSameBodyChildren(visit) + } + + visit(spec) + + return &hcl.BodySchema{ + Attributes: attrs, + Blocks: blocks, + } +} diff --git a/vendor/github.com/hashicorp/hcl2/hcldec/spec.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/spec.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcldec/spec.go rename to vendor/github.com/hashicorp/hcl/v2/hcldec/spec.go index f9da7f65bcd..6f2d9732c65 100644 --- a/vendor/github.com/hashicorp/hcl2/hcldec/spec.go +++ b/vendor/github.com/hashicorp/hcl/v2/hcldec/spec.go @@ -5,7 +5,7 @@ import ( "fmt" "sort" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/function" diff --git a/vendor/github.com/hashicorp/hcl/v2/hcldec/variables.go b/vendor/github.com/hashicorp/hcl/v2/hcldec/variables.go new file mode 100644 index 00000000000..f8440eb6022 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hcldec/variables.go @@ -0,0 +1,36 @@ +package hcldec + +import ( + "github.com/hashicorp/hcl/v2" +) + +// Variables processes the given body with the given spec and returns a +// list of the variable traversals that would be required to decode +// the same pairing of body and spec. +// +// This can be used to conditionally populate the variables in the EvalContext +// passed to Decode, for applications where a static scope is insufficient. +// +// If the given body is not compliant with the given schema, the result may +// be incomplete, but that's assumed to be okay because the eventual call +// to Decode will produce error diagnostics anyway. +func Variables(body hcl.Body, spec Spec) []hcl.Traversal { + var vars []hcl.Traversal + schema := ImpliedSchema(spec) + content, _, _ := body.PartialContent(schema) + + if vs, ok := spec.(specNeedingVariables); ok { + vars = append(vars, vs.variablesNeeded(content)...) + } + + var visitFn visitFunc + visitFn = func(s Spec) { + if vs, ok := s.(specNeedingVariables); ok { + vars = append(vars, vs.variablesNeeded(content)...) + } + s.visitSameBodyChildren(visitFn) + } + spec.visitSameBodyChildren(visitFn) + + return vars +} diff --git a/vendor/github.com/hashicorp/hcl2/hcled/doc.go b/vendor/github.com/hashicorp/hcl/v2/hcled/doc.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcled/doc.go rename to vendor/github.com/hashicorp/hcl/v2/hcled/doc.go diff --git a/vendor/github.com/hashicorp/hcl/v2/hcled/navigation.go b/vendor/github.com/hashicorp/hcl/v2/hcled/navigation.go new file mode 100644 index 00000000000..050ad758f6f --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hcled/navigation.go @@ -0,0 +1,34 @@ +package hcled + +import ( + "github.com/hashicorp/hcl/v2" +) + +type contextStringer interface { + ContextString(offset int) string +} + +// ContextString returns a string describing the context of the given byte +// offset, if available. An empty string is returned if no such information +// is available, or otherwise the returned string is in a form that depends +// on the language used to write the referenced file. +func ContextString(file *hcl.File, offset int) string { + if cser, ok := file.Nav.(contextStringer); ok { + return cser.ContextString(offset) + } + return "" +} + +type contextDefRanger interface { + ContextDefRange(offset int) hcl.Range +} + +func ContextDefRange(file *hcl.File, offset int) hcl.Range { + if cser, ok := file.Nav.(contextDefRanger); ok { + defRange := cser.ContextDefRange(offset) + if !defRange.Empty() { + return defRange + } + } + return file.Body.MissingItemRange() +} diff --git a/vendor/github.com/hashicorp/hcl/v2/hclparse/parser.go b/vendor/github.com/hashicorp/hcl/v2/hclparse/parser.go new file mode 100644 index 00000000000..1dc2eccd87f --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hclparse/parser.go @@ -0,0 +1,135 @@ +// Package hclparse has the main API entry point for parsing both HCL native +// syntax and HCL JSON. +// +// The main HCL package also includes SimpleParse and SimpleParseFile which +// can be a simpler interface for the common case where an application just +// needs to parse a single file. The gohcl package simplifies that further +// in its SimpleDecode function, which combines hcl.SimpleParse with decoding +// into Go struct values +// +// Package hclparse, then, is useful for applications that require more fine +// control over parsing or which need to load many separate files and keep +// track of them for possible error reporting or other analysis. +package hclparse + +import ( + "fmt" + "io/ioutil" + + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/hashicorp/hcl/v2/json" +) + +// NOTE: This is the public interface for parsing. The actual parsers are +// in other packages alongside this one, with this package just wrapping them +// to provide a unified interface for the caller across all supported formats. + +// Parser is the main interface for parsing configuration files. As well as +// parsing files, a parser also retains a registry of all of the files it +// has parsed so that multiple attempts to parse the same file will return +// the same object and so the collected files can be used when printing +// diagnostics. +// +// Any diagnostics for parsing a file are only returned once on the first +// call to parse that file. Callers are expected to collect up diagnostics +// and present them together, so returning diagnostics for the same file +// multiple times would create a confusing result. +type Parser struct { + files map[string]*hcl.File +} + +// NewParser creates a new parser, ready to parse configuration files. +func NewParser() *Parser { + return &Parser{ + files: map[string]*hcl.File{}, + } +} + +// ParseHCL parses the given buffer (which is assumed to have been loaded from +// the given filename) as a native-syntax configuration file and returns the +// hcl.File object representing it. +func (p *Parser) ParseHCL(src []byte, filename string) (*hcl.File, hcl.Diagnostics) { + if existing := p.files[filename]; existing != nil { + return existing, nil + } + + file, diags := hclsyntax.ParseConfig(src, filename, hcl.Pos{Byte: 0, Line: 1, Column: 1}) + p.files[filename] = file + return file, diags +} + +// ParseHCLFile reads the given filename and parses it as a native-syntax HCL +// configuration file. An error diagnostic is returned if the given file +// cannot be read. +func (p *Parser) ParseHCLFile(filename string) (*hcl.File, hcl.Diagnostics) { + if existing := p.files[filename]; existing != nil { + return existing, nil + } + + src, err := ioutil.ReadFile(filename) + if err != nil { + return nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Failed to read file", + Detail: fmt.Sprintf("The configuration file %q could not be read.", filename), + }, + } + } + + return p.ParseHCL(src, filename) +} + +// ParseJSON parses the given JSON buffer (which is assumed to have been loaded +// from the given filename) and returns the hcl.File object representing it. +func (p *Parser) ParseJSON(src []byte, filename string) (*hcl.File, hcl.Diagnostics) { + if existing := p.files[filename]; existing != nil { + return existing, nil + } + + file, diags := json.Parse(src, filename) + p.files[filename] = file + return file, diags +} + +// ParseJSONFile reads the given filename and parses it as JSON, similarly to +// ParseJSON. An error diagnostic is returned if the given file cannot be read. +func (p *Parser) ParseJSONFile(filename string) (*hcl.File, hcl.Diagnostics) { + if existing := p.files[filename]; existing != nil { + return existing, nil + } + + file, diags := json.ParseFile(filename) + p.files[filename] = file + return file, diags +} + +// AddFile allows a caller to record in a parser a file that was parsed some +// other way, thus allowing it to be included in the registry of sources. +func (p *Parser) AddFile(filename string, file *hcl.File) { + p.files[filename] = file +} + +// Sources returns a map from filenames to the raw source code that was +// read from them. This is intended to be used, for example, to print +// diagnostics with contextual information. +// +// The arrays underlying the returned slices should not be modified. +func (p *Parser) Sources() map[string][]byte { + ret := make(map[string][]byte) + for fn, f := range p.files { + ret[fn] = f.Bytes + } + return ret +} + +// Files returns a map from filenames to the File objects produced from them. +// This is intended to be used, for example, to print diagnostics with +// contextual information. +// +// The returned map and all of the objects it refers to directly or indirectly +// must not be modified. +func (p *Parser) Files() map[string]*hcl.File { + return p.files +} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/diagnostics.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/diagnostics.go similarity index 95% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/diagnostics.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/diagnostics.go index 94eaf589290..8c20286b271 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/diagnostics.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/diagnostics.go @@ -1,7 +1,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // setDiagEvalContext is an internal helper that will impose a particular diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/didyoumean.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/didyoumean.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/didyoumean.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/didyoumean.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/doc.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/doc.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/doc.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/doc.go diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go new file mode 100644 index 00000000000..963ed77524c --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression.go @@ -0,0 +1,1477 @@ +package hclsyntax + +import ( + "fmt" + "sync" + + "github.com/hashicorp/hcl/v2" + "github.com/zclconf/go-cty/cty" + "github.com/zclconf/go-cty/cty/convert" + "github.com/zclconf/go-cty/cty/function" +) + +// Expression is the abstract type for nodes that behave as HCL expressions. +type Expression interface { + Node + + // The hcl.Expression methods are duplicated here, rather than simply + // embedded, because both Node and hcl.Expression have a Range method + // and so they conflict. + + Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) + Variables() []hcl.Traversal + StartRange() hcl.Range +} + +// Assert that Expression implements hcl.Expression +var assertExprImplExpr hcl.Expression = Expression(nil) + +// LiteralValueExpr is an expression that just always returns a given value. +type LiteralValueExpr struct { + Val cty.Value + SrcRange hcl.Range +} + +func (e *LiteralValueExpr) walkChildNodes(w internalWalkFunc) { + // Literal values have no child nodes +} + +func (e *LiteralValueExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { + return e.Val, nil +} + +func (e *LiteralValueExpr) Range() hcl.Range { + return e.SrcRange +} + +func (e *LiteralValueExpr) StartRange() hcl.Range { + return e.SrcRange +} + +// Implementation for hcl.AbsTraversalForExpr. +func (e *LiteralValueExpr) AsTraversal() hcl.Traversal { + // This one's a little weird: the contract for AsTraversal is to interpret + // an expression as if it were traversal syntax, and traversal syntax + // doesn't have the special keywords "null", "true", and "false" so these + // are expected to be treated like variables in that case. + // Since our parser already turned them into LiteralValueExpr by the time + // we get here, we need to undo this and infer the name that would've + // originally led to our value. + // We don't do anything for any other values, since they don't overlap + // with traversal roots. + + if e.Val.IsNull() { + // In practice the parser only generates null values of the dynamic + // pseudo-type for literals, so we can safely assume that any null + // was orignally the keyword "null". + return hcl.Traversal{ + hcl.TraverseRoot{ + Name: "null", + SrcRange: e.SrcRange, + }, + } + } + + switch e.Val { + case cty.True: + return hcl.Traversal{ + hcl.TraverseRoot{ + Name: "true", + SrcRange: e.SrcRange, + }, + } + case cty.False: + return hcl.Traversal{ + hcl.TraverseRoot{ + Name: "false", + SrcRange: e.SrcRange, + }, + } + default: + // No traversal is possible for any other value. + return nil + } +} + +// ScopeTraversalExpr is an Expression that retrieves a value from the scope +// using a traversal. +type ScopeTraversalExpr struct { + Traversal hcl.Traversal + SrcRange hcl.Range +} + +func (e *ScopeTraversalExpr) walkChildNodes(w internalWalkFunc) { + // Scope traversals have no child nodes +} + +func (e *ScopeTraversalExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { + val, diags := e.Traversal.TraverseAbs(ctx) + setDiagEvalContext(diags, e, ctx) + return val, diags +} + +func (e *ScopeTraversalExpr) Range() hcl.Range { + return e.SrcRange +} + +func (e *ScopeTraversalExpr) StartRange() hcl.Range { + return e.SrcRange +} + +// Implementation for hcl.AbsTraversalForExpr. +func (e *ScopeTraversalExpr) AsTraversal() hcl.Traversal { + return e.Traversal +} + +// RelativeTraversalExpr is an Expression that retrieves a value from another +// value using a _relative_ traversal. +type RelativeTraversalExpr struct { + Source Expression + Traversal hcl.Traversal + SrcRange hcl.Range +} + +func (e *RelativeTraversalExpr) walkChildNodes(w internalWalkFunc) { + w(e.Source) +} + +func (e *RelativeTraversalExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { + src, diags := e.Source.Value(ctx) + ret, travDiags := e.Traversal.TraverseRel(src) + setDiagEvalContext(travDiags, e, ctx) + diags = append(diags, travDiags...) + return ret, diags +} + +func (e *RelativeTraversalExpr) Range() hcl.Range { + return e.SrcRange +} + +func (e *RelativeTraversalExpr) StartRange() hcl.Range { + return e.SrcRange +} + +// Implementation for hcl.AbsTraversalForExpr. +func (e *RelativeTraversalExpr) AsTraversal() hcl.Traversal { + // We can produce a traversal only if our source can. + st, diags := hcl.AbsTraversalForExpr(e.Source) + if diags.HasErrors() { + return nil + } + + ret := make(hcl.Traversal, len(st)+len(e.Traversal)) + copy(ret, st) + copy(ret[len(st):], e.Traversal) + return ret +} + +// FunctionCallExpr is an Expression that calls a function from the EvalContext +// and returns its result. +type FunctionCallExpr struct { + Name string + Args []Expression + + // If true, the final argument should be a tuple, list or set which will + // expand to be one argument per element. + ExpandFinal bool + + NameRange hcl.Range + OpenParenRange hcl.Range + CloseParenRange hcl.Range +} + +func (e *FunctionCallExpr) walkChildNodes(w internalWalkFunc) { + for _, arg := range e.Args { + w(arg) + } +} + +func (e *FunctionCallExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { + var diags hcl.Diagnostics + + var f function.Function + exists := false + hasNonNilMap := false + thisCtx := ctx + for thisCtx != nil { + if thisCtx.Functions == nil { + thisCtx = thisCtx.Parent() + continue + } + hasNonNilMap = true + f, exists = thisCtx.Functions[e.Name] + if exists { + break + } + thisCtx = thisCtx.Parent() + } + + if !exists { + if !hasNonNilMap { + return cty.DynamicVal, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Function calls not allowed", + Detail: "Functions may not be called here.", + Subject: e.Range().Ptr(), + Expression: e, + EvalContext: ctx, + }, + } + } + + avail := make([]string, 0, len(ctx.Functions)) + for name := range ctx.Functions { + avail = append(avail, name) + } + suggestion := nameSuggestion(e.Name, avail) + if suggestion != "" { + suggestion = fmt.Sprintf(" Did you mean %q?", suggestion) + } + + return cty.DynamicVal, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Call to unknown function", + Detail: fmt.Sprintf("There is no function named %q.%s", e.Name, suggestion), + Subject: &e.NameRange, + Context: e.Range().Ptr(), + Expression: e, + EvalContext: ctx, + }, + } + } + + params := f.Params() + varParam := f.VarParam() + + args := e.Args + if e.ExpandFinal { + if len(args) < 1 { + // should never happen if the parser is behaving + panic("ExpandFinal set on function call with no arguments") + } + expandExpr := args[len(args)-1] + expandVal, expandDiags := expandExpr.Value(ctx) + diags = append(diags, expandDiags...) + if expandDiags.HasErrors() { + return cty.DynamicVal, diags + } + + switch { + case expandVal.Type().IsTupleType() || expandVal.Type().IsListType() || expandVal.Type().IsSetType(): + if expandVal.IsNull() { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid expanding argument value", + Detail: "The expanding argument (indicated by ...) must not be null.", + Subject: expandExpr.Range().Ptr(), + Context: e.Range().Ptr(), + Expression: expandExpr, + EvalContext: ctx, + }) + return cty.DynamicVal, diags + } + if !expandVal.IsKnown() { + return cty.DynamicVal, diags + } + + newArgs := make([]Expression, 0, (len(args)-1)+expandVal.LengthInt()) + newArgs = append(newArgs, args[:len(args)-1]...) + it := expandVal.ElementIterator() + for it.Next() { + _, val := it.Element() + newArgs = append(newArgs, &LiteralValueExpr{ + Val: val, + SrcRange: expandExpr.Range(), + }) + } + args = newArgs + default: + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid expanding argument value", + Detail: "The expanding argument (indicated by ...) must be of a tuple, list, or set type.", + Subject: expandExpr.Range().Ptr(), + Context: e.Range().Ptr(), + Expression: expandExpr, + EvalContext: ctx, + }) + return cty.DynamicVal, diags + } + } + + if len(args) < len(params) { + missing := params[len(args)] + qual := "" + if varParam != nil { + qual = " at least" + } + return cty.DynamicVal, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Not enough function arguments", + Detail: fmt.Sprintf( + "Function %q expects%s %d argument(s). Missing value for %q.", + e.Name, qual, len(params), missing.Name, + ), + Subject: &e.CloseParenRange, + Context: e.Range().Ptr(), + Expression: e, + EvalContext: ctx, + }, + } + } + + if varParam == nil && len(args) > len(params) { + return cty.DynamicVal, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Too many function arguments", + Detail: fmt.Sprintf( + "Function %q expects only %d argument(s).", + e.Name, len(params), + ), + Subject: args[len(params)].StartRange().Ptr(), + Context: e.Range().Ptr(), + Expression: e, + EvalContext: ctx, + }, + } + } + + argVals := make([]cty.Value, len(args)) + + for i, argExpr := range args { + var param *function.Parameter + if i < len(params) { + param = ¶ms[i] + } else { + param = varParam + } + + val, argDiags := argExpr.Value(ctx) + if len(argDiags) > 0 { + diags = append(diags, argDiags...) + } + + // Try to convert our value to the parameter type + val, err := convert.Convert(val, param.Type) + if err != nil { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid function argument", + Detail: fmt.Sprintf( + "Invalid value for %q parameter: %s.", + param.Name, err, + ), + Subject: argExpr.StartRange().Ptr(), + Context: e.Range().Ptr(), + Expression: argExpr, + EvalContext: ctx, + }) + } + + argVals[i] = val + } + + if diags.HasErrors() { + // Don't try to execute the function if we already have errors with + // the arguments, because the result will probably be a confusing + // error message. + return cty.DynamicVal, diags + } + + resultVal, err := f.Call(argVals) + if err != nil { + switch terr := err.(type) { + case function.ArgError: + i := terr.Index + var param *function.Parameter + if i < len(params) { + param = ¶ms[i] + } else { + param = varParam + } + argExpr := e.Args[i] + + // TODO: we should also unpick a PathError here and show the + // path to the deep value where the error was detected. + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid function argument", + Detail: fmt.Sprintf( + "Invalid value for %q parameter: %s.", + param.Name, err, + ), + Subject: argExpr.StartRange().Ptr(), + Context: e.Range().Ptr(), + Expression: argExpr, + EvalContext: ctx, + }) + + default: + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Error in function call", + Detail: fmt.Sprintf( + "Call to function %q failed: %s.", + e.Name, err, + ), + Subject: e.StartRange().Ptr(), + Context: e.Range().Ptr(), + Expression: e, + EvalContext: ctx, + }) + } + + return cty.DynamicVal, diags + } + + return resultVal, diags +} + +func (e *FunctionCallExpr) Range() hcl.Range { + return hcl.RangeBetween(e.NameRange, e.CloseParenRange) +} + +func (e *FunctionCallExpr) StartRange() hcl.Range { + return hcl.RangeBetween(e.NameRange, e.OpenParenRange) +} + +// Implementation for hcl.ExprCall. +func (e *FunctionCallExpr) ExprCall() *hcl.StaticCall { + ret := &hcl.StaticCall{ + Name: e.Name, + NameRange: e.NameRange, + Arguments: make([]hcl.Expression, len(e.Args)), + ArgsRange: hcl.RangeBetween(e.OpenParenRange, e.CloseParenRange), + } + // Need to convert our own Expression objects into hcl.Expression. + for i, arg := range e.Args { + ret.Arguments[i] = arg + } + return ret +} + +type ConditionalExpr struct { + Condition Expression + TrueResult Expression + FalseResult Expression + + SrcRange hcl.Range +} + +func (e *ConditionalExpr) walkChildNodes(w internalWalkFunc) { + w(e.Condition) + w(e.TrueResult) + w(e.FalseResult) +} + +func (e *ConditionalExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { + trueResult, trueDiags := e.TrueResult.Value(ctx) + falseResult, falseDiags := e.FalseResult.Value(ctx) + var diags hcl.Diagnostics + + resultType := cty.DynamicPseudoType + convs := make([]convert.Conversion, 2) + + switch { + // If either case is a dynamic null value (which would result from a + // literal null in the config), we know that it can convert to the expected + // type of the opposite case, and we don't need to speculatively reduce the + // final result type to DynamicPseudoType. + + // If we know that either Type is a DynamicPseudoType, we can be certain + // that the other value can convert since it's a pass-through, and we don't + // need to unify the types. If the final evaluation results in the dynamic + // value being returned, there's no conversion we can do, so we return the + // value directly. + case trueResult.RawEquals(cty.NullVal(cty.DynamicPseudoType)): + resultType = falseResult.Type() + convs[0] = convert.GetConversionUnsafe(cty.DynamicPseudoType, resultType) + case falseResult.RawEquals(cty.NullVal(cty.DynamicPseudoType)): + resultType = trueResult.Type() + convs[1] = convert.GetConversionUnsafe(cty.DynamicPseudoType, resultType) + case trueResult.Type() == cty.DynamicPseudoType, falseResult.Type() == cty.DynamicPseudoType: + // the final resultType type is still unknown + // we don't need to get the conversion, because both are a noop. + + default: + // Try to find a type that both results can be converted to. + resultType, convs = convert.UnifyUnsafe([]cty.Type{trueResult.Type(), falseResult.Type()}) + } + + if resultType == cty.NilType { + return cty.DynamicVal, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Inconsistent conditional result types", + Detail: fmt.Sprintf( + // FIXME: Need a helper function for showing natural-language type diffs, + // since this will generate some useless messages in some cases, like + // "These expressions are object and object respectively" if the + // object types don't exactly match. + "The true and false result expressions must have consistent types. The given expressions are %s and %s, respectively.", + trueResult.Type().FriendlyName(), falseResult.Type().FriendlyName(), + ), + Subject: hcl.RangeBetween(e.TrueResult.Range(), e.FalseResult.Range()).Ptr(), + Context: &e.SrcRange, + Expression: e, + EvalContext: ctx, + }, + } + } + + condResult, condDiags := e.Condition.Value(ctx) + diags = append(diags, condDiags...) + if condResult.IsNull() { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Null condition", + Detail: "The condition value is null. Conditions must either be true or false.", + Subject: e.Condition.Range().Ptr(), + Context: &e.SrcRange, + Expression: e.Condition, + EvalContext: ctx, + }) + return cty.UnknownVal(resultType), diags + } + if !condResult.IsKnown() { + return cty.UnknownVal(resultType), diags + } + condResult, err := convert.Convert(condResult, cty.Bool) + if err != nil { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Incorrect condition type", + Detail: fmt.Sprintf("The condition expression must be of type bool."), + Subject: e.Condition.Range().Ptr(), + Context: &e.SrcRange, + Expression: e.Condition, + EvalContext: ctx, + }) + return cty.UnknownVal(resultType), diags + } + + if condResult.True() { + diags = append(diags, trueDiags...) + if convs[0] != nil { + var err error + trueResult, err = convs[0](trueResult) + if err != nil { + // Unsafe conversion failed with the concrete result value + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Inconsistent conditional result types", + Detail: fmt.Sprintf( + "The true result value has the wrong type: %s.", + err.Error(), + ), + Subject: e.TrueResult.Range().Ptr(), + Context: &e.SrcRange, + Expression: e.TrueResult, + EvalContext: ctx, + }) + trueResult = cty.UnknownVal(resultType) + } + } + return trueResult, diags + } else { + diags = append(diags, falseDiags...) + if convs[1] != nil { + var err error + falseResult, err = convs[1](falseResult) + if err != nil { + // Unsafe conversion failed with the concrete result value + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Inconsistent conditional result types", + Detail: fmt.Sprintf( + "The false result value has the wrong type: %s.", + err.Error(), + ), + Subject: e.FalseResult.Range().Ptr(), + Context: &e.SrcRange, + Expression: e.FalseResult, + EvalContext: ctx, + }) + falseResult = cty.UnknownVal(resultType) + } + } + return falseResult, diags + } +} + +func (e *ConditionalExpr) Range() hcl.Range { + return e.SrcRange +} + +func (e *ConditionalExpr) StartRange() hcl.Range { + return e.Condition.StartRange() +} + +type IndexExpr struct { + Collection Expression + Key Expression + + SrcRange hcl.Range + OpenRange hcl.Range +} + +func (e *IndexExpr) walkChildNodes(w internalWalkFunc) { + w(e.Collection) + w(e.Key) +} + +func (e *IndexExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { + var diags hcl.Diagnostics + coll, collDiags := e.Collection.Value(ctx) + key, keyDiags := e.Key.Value(ctx) + diags = append(diags, collDiags...) + diags = append(diags, keyDiags...) + + val, indexDiags := hcl.Index(coll, key, &e.SrcRange) + setDiagEvalContext(indexDiags, e, ctx) + diags = append(diags, indexDiags...) + return val, diags +} + +func (e *IndexExpr) Range() hcl.Range { + return e.SrcRange +} + +func (e *IndexExpr) StartRange() hcl.Range { + return e.OpenRange +} + +type TupleConsExpr struct { + Exprs []Expression + + SrcRange hcl.Range + OpenRange hcl.Range +} + +func (e *TupleConsExpr) walkChildNodes(w internalWalkFunc) { + for _, expr := range e.Exprs { + w(expr) + } +} + +func (e *TupleConsExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { + var vals []cty.Value + var diags hcl.Diagnostics + + vals = make([]cty.Value, len(e.Exprs)) + for i, expr := range e.Exprs { + val, valDiags := expr.Value(ctx) + vals[i] = val + diags = append(diags, valDiags...) + } + + return cty.TupleVal(vals), diags +} + +func (e *TupleConsExpr) Range() hcl.Range { + return e.SrcRange +} + +func (e *TupleConsExpr) StartRange() hcl.Range { + return e.OpenRange +} + +// Implementation for hcl.ExprList +func (e *TupleConsExpr) ExprList() []hcl.Expression { + ret := make([]hcl.Expression, len(e.Exprs)) + for i, expr := range e.Exprs { + ret[i] = expr + } + return ret +} + +type ObjectConsExpr struct { + Items []ObjectConsItem + + SrcRange hcl.Range + OpenRange hcl.Range +} + +type ObjectConsItem struct { + KeyExpr Expression + ValueExpr Expression +} + +func (e *ObjectConsExpr) walkChildNodes(w internalWalkFunc) { + for _, item := range e.Items { + w(item.KeyExpr) + w(item.ValueExpr) + } +} + +func (e *ObjectConsExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { + var vals map[string]cty.Value + var diags hcl.Diagnostics + + // This will get set to true if we fail to produce any of our keys, + // either because they are actually unknown or if the evaluation produces + // errors. In all of these case we must return DynamicPseudoType because + // we're unable to know the full set of keys our object has, and thus + // we can't produce a complete value of the intended type. + // + // We still evaluate all of the item keys and values to make sure that we + // get as complete as possible a set of diagnostics. + known := true + + vals = make(map[string]cty.Value, len(e.Items)) + for _, item := range e.Items { + key, keyDiags := item.KeyExpr.Value(ctx) + diags = append(diags, keyDiags...) + + val, valDiags := item.ValueExpr.Value(ctx) + diags = append(diags, valDiags...) + + if keyDiags.HasErrors() { + known = false + continue + } + + if key.IsNull() { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Null value as key", + Detail: "Can't use a null value as a key.", + Subject: item.ValueExpr.Range().Ptr(), + Expression: item.KeyExpr, + EvalContext: ctx, + }) + known = false + continue + } + + var err error + key, err = convert.Convert(key, cty.String) + if err != nil { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Incorrect key type", + Detail: fmt.Sprintf("Can't use this value as a key: %s.", err.Error()), + Subject: item.KeyExpr.Range().Ptr(), + Expression: item.KeyExpr, + EvalContext: ctx, + }) + known = false + continue + } + + if !key.IsKnown() { + known = false + continue + } + + keyStr := key.AsString() + + vals[keyStr] = val + } + + if !known { + return cty.DynamicVal, diags + } + + return cty.ObjectVal(vals), diags +} + +func (e *ObjectConsExpr) Range() hcl.Range { + return e.SrcRange +} + +func (e *ObjectConsExpr) StartRange() hcl.Range { + return e.OpenRange +} + +// Implementation for hcl.ExprMap +func (e *ObjectConsExpr) ExprMap() []hcl.KeyValuePair { + ret := make([]hcl.KeyValuePair, len(e.Items)) + for i, item := range e.Items { + ret[i] = hcl.KeyValuePair{ + Key: item.KeyExpr, + Value: item.ValueExpr, + } + } + return ret +} + +// ObjectConsKeyExpr is a special wrapper used only for ObjectConsExpr keys, +// which deals with the special case that a naked identifier in that position +// must be interpreted as a literal string rather than evaluated directly. +type ObjectConsKeyExpr struct { + Wrapped Expression + ForceNonLiteral bool +} + +func (e *ObjectConsKeyExpr) literalName() string { + // This is our logic for deciding whether to behave like a literal string. + // We lean on our AbsTraversalForExpr implementation here, which already + // deals with some awkward cases like the expression being the result + // of the keywords "null", "true" and "false" which we'd want to interpret + // as keys here too. + return hcl.ExprAsKeyword(e.Wrapped) +} + +func (e *ObjectConsKeyExpr) walkChildNodes(w internalWalkFunc) { + // We only treat our wrapped expression as a real expression if we're + // not going to interpret it as a literal. + if e.literalName() == "" { + w(e.Wrapped) + } +} + +func (e *ObjectConsKeyExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { + // Because we accept a naked identifier as a literal key rather than a + // reference, it's confusing to accept a traversal containing periods + // here since we can't tell if the user intends to create a key with + // periods or actually reference something. To avoid confusing downstream + // errors we'll just prohibit a naked multi-step traversal here and + // require the user to state their intent more clearly. + // (This is handled at evaluation time rather than parse time because + // an application using static analysis _can_ accept a naked multi-step + // traversal here, if desired.) + if !e.ForceNonLiteral { + if travExpr, isTraversal := e.Wrapped.(*ScopeTraversalExpr); isTraversal && len(travExpr.Traversal) > 1 { + var diags hcl.Diagnostics + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Ambiguous attribute key", + Detail: "If this expression is intended to be a reference, wrap it in parentheses. If it's instead intended as a literal name containing periods, wrap it in quotes to create a string literal.", + Subject: e.Range().Ptr(), + }) + return cty.DynamicVal, diags + } + + if ln := e.literalName(); ln != "" { + return cty.StringVal(ln), nil + } + } + return e.Wrapped.Value(ctx) +} + +func (e *ObjectConsKeyExpr) Range() hcl.Range { + return e.Wrapped.Range() +} + +func (e *ObjectConsKeyExpr) StartRange() hcl.Range { + return e.Wrapped.StartRange() +} + +// Implementation for hcl.AbsTraversalForExpr. +func (e *ObjectConsKeyExpr) AsTraversal() hcl.Traversal { + // If we're forcing a non-literal then we can never be interpreted + // as a traversal. + if e.ForceNonLiteral { + return nil + } + + // We can produce a traversal only if our wrappee can. + st, diags := hcl.AbsTraversalForExpr(e.Wrapped) + if diags.HasErrors() { + return nil + } + + return st +} + +func (e *ObjectConsKeyExpr) UnwrapExpression() Expression { + return e.Wrapped +} + +// ForExpr represents iteration constructs: +// +// tuple = [for i, v in list: upper(v) if i > 2] +// object = {for k, v in map: k => upper(v)} +// object_of_tuples = {for v in list: v.key: v...} +type ForExpr struct { + KeyVar string // empty if ignoring the key + ValVar string + + CollExpr Expression + + KeyExpr Expression // nil when producing a tuple + ValExpr Expression + CondExpr Expression // null if no "if" clause is present + + Group bool // set if the ellipsis is used on the value in an object for + + SrcRange hcl.Range + OpenRange hcl.Range + CloseRange hcl.Range +} + +func (e *ForExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { + var diags hcl.Diagnostics + + collVal, collDiags := e.CollExpr.Value(ctx) + diags = append(diags, collDiags...) + + if collVal.IsNull() { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Iteration over null value", + Detail: "A null value cannot be used as the collection in a 'for' expression.", + Subject: e.CollExpr.Range().Ptr(), + Context: &e.SrcRange, + Expression: e.CollExpr, + EvalContext: ctx, + }) + return cty.DynamicVal, diags + } + if collVal.Type() == cty.DynamicPseudoType { + return cty.DynamicVal, diags + } + if !collVal.CanIterateElements() { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Iteration over non-iterable value", + Detail: fmt.Sprintf( + "A value of type %s cannot be used as the collection in a 'for' expression.", + collVal.Type().FriendlyName(), + ), + Subject: e.CollExpr.Range().Ptr(), + Context: &e.SrcRange, + Expression: e.CollExpr, + EvalContext: ctx, + }) + return cty.DynamicVal, diags + } + if !collVal.IsKnown() { + return cty.DynamicVal, diags + } + + // Before we start we'll do an early check to see if any CondExpr we've + // been given is of the wrong type. This isn't 100% reliable (it may + // be DynamicVal until real values are given) but it should catch some + // straightforward cases and prevent a barrage of repeated errors. + if e.CondExpr != nil { + childCtx := ctx.NewChild() + childCtx.Variables = map[string]cty.Value{} + if e.KeyVar != "" { + childCtx.Variables[e.KeyVar] = cty.DynamicVal + } + childCtx.Variables[e.ValVar] = cty.DynamicVal + + result, condDiags := e.CondExpr.Value(childCtx) + diags = append(diags, condDiags...) + if result.IsNull() { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Condition is null", + Detail: "The value of the 'if' clause must not be null.", + Subject: e.CondExpr.Range().Ptr(), + Context: &e.SrcRange, + Expression: e.CondExpr, + EvalContext: ctx, + }) + return cty.DynamicVal, diags + } + _, err := convert.Convert(result, cty.Bool) + if err != nil { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid 'for' condition", + Detail: fmt.Sprintf("The 'if' clause value is invalid: %s.", err.Error()), + Subject: e.CondExpr.Range().Ptr(), + Context: &e.SrcRange, + Expression: e.CondExpr, + EvalContext: ctx, + }) + return cty.DynamicVal, diags + } + if condDiags.HasErrors() { + return cty.DynamicVal, diags + } + } + + if e.KeyExpr != nil { + // Producing an object + var vals map[string]cty.Value + var groupVals map[string][]cty.Value + if e.Group { + groupVals = map[string][]cty.Value{} + } else { + vals = map[string]cty.Value{} + } + + it := collVal.ElementIterator() + + known := true + for it.Next() { + k, v := it.Element() + childCtx := ctx.NewChild() + childCtx.Variables = map[string]cty.Value{} + if e.KeyVar != "" { + childCtx.Variables[e.KeyVar] = k + } + childCtx.Variables[e.ValVar] = v + + if e.CondExpr != nil { + includeRaw, condDiags := e.CondExpr.Value(childCtx) + diags = append(diags, condDiags...) + if includeRaw.IsNull() { + if known { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid 'for' condition", + Detail: "The value of the 'if' clause must not be null.", + Subject: e.CondExpr.Range().Ptr(), + Context: &e.SrcRange, + Expression: e.CondExpr, + EvalContext: childCtx, + }) + } + known = false + continue + } + include, err := convert.Convert(includeRaw, cty.Bool) + if err != nil { + if known { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid 'for' condition", + Detail: fmt.Sprintf("The 'if' clause value is invalid: %s.", err.Error()), + Subject: e.CondExpr.Range().Ptr(), + Context: &e.SrcRange, + Expression: e.CondExpr, + EvalContext: childCtx, + }) + } + known = false + continue + } + if !include.IsKnown() { + known = false + continue + } + + if include.False() { + // Skip this element + continue + } + } + + keyRaw, keyDiags := e.KeyExpr.Value(childCtx) + diags = append(diags, keyDiags...) + if keyRaw.IsNull() { + if known { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid object key", + Detail: "Key expression in 'for' expression must not produce a null value.", + Subject: e.KeyExpr.Range().Ptr(), + Context: &e.SrcRange, + Expression: e.KeyExpr, + EvalContext: childCtx, + }) + } + known = false + continue + } + if !keyRaw.IsKnown() { + known = false + continue + } + + key, err := convert.Convert(keyRaw, cty.String) + if err != nil { + if known { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid object key", + Detail: fmt.Sprintf("The key expression produced an invalid result: %s.", err.Error()), + Subject: e.KeyExpr.Range().Ptr(), + Context: &e.SrcRange, + Expression: e.KeyExpr, + EvalContext: childCtx, + }) + } + known = false + continue + } + + val, valDiags := e.ValExpr.Value(childCtx) + diags = append(diags, valDiags...) + + if e.Group { + k := key.AsString() + groupVals[k] = append(groupVals[k], val) + } else { + k := key.AsString() + if _, exists := vals[k]; exists { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Duplicate object key", + Detail: fmt.Sprintf( + "Two different items produced the key %q in this 'for' expression. If duplicates are expected, use the ellipsis (...) after the value expression to enable grouping by key.", + k, + ), + Subject: e.KeyExpr.Range().Ptr(), + Context: &e.SrcRange, + Expression: e.KeyExpr, + EvalContext: childCtx, + }) + } else { + vals[key.AsString()] = val + } + } + } + + if !known { + return cty.DynamicVal, diags + } + + if e.Group { + vals = map[string]cty.Value{} + for k, gvs := range groupVals { + vals[k] = cty.TupleVal(gvs) + } + } + + return cty.ObjectVal(vals), diags + + } else { + // Producing a tuple + vals := []cty.Value{} + + it := collVal.ElementIterator() + + known := true + for it.Next() { + k, v := it.Element() + childCtx := ctx.NewChild() + childCtx.Variables = map[string]cty.Value{} + if e.KeyVar != "" { + childCtx.Variables[e.KeyVar] = k + } + childCtx.Variables[e.ValVar] = v + + if e.CondExpr != nil { + includeRaw, condDiags := e.CondExpr.Value(childCtx) + diags = append(diags, condDiags...) + if includeRaw.IsNull() { + if known { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid 'for' condition", + Detail: "The value of the 'if' clause must not be null.", + Subject: e.CondExpr.Range().Ptr(), + Context: &e.SrcRange, + Expression: e.CondExpr, + EvalContext: childCtx, + }) + } + known = false + continue + } + if !includeRaw.IsKnown() { + // We will eventually return DynamicVal, but we'll continue + // iterating in case there are other diagnostics to gather + // for later elements. + known = false + continue + } + + include, err := convert.Convert(includeRaw, cty.Bool) + if err != nil { + if known { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid 'for' condition", + Detail: fmt.Sprintf("The 'if' clause value is invalid: %s.", err.Error()), + Subject: e.CondExpr.Range().Ptr(), + Context: &e.SrcRange, + Expression: e.CondExpr, + EvalContext: childCtx, + }) + } + known = false + continue + } + + if include.False() { + // Skip this element + continue + } + } + + val, valDiags := e.ValExpr.Value(childCtx) + diags = append(diags, valDiags...) + vals = append(vals, val) + } + + if !known { + return cty.DynamicVal, diags + } + + return cty.TupleVal(vals), diags + } +} + +func (e *ForExpr) walkChildNodes(w internalWalkFunc) { + w(e.CollExpr) + + scopeNames := map[string]struct{}{} + if e.KeyVar != "" { + scopeNames[e.KeyVar] = struct{}{} + } + if e.ValVar != "" { + scopeNames[e.ValVar] = struct{}{} + } + + if e.KeyExpr != nil { + w(ChildScope{ + LocalNames: scopeNames, + Expr: e.KeyExpr, + }) + } + w(ChildScope{ + LocalNames: scopeNames, + Expr: e.ValExpr, + }) + if e.CondExpr != nil { + w(ChildScope{ + LocalNames: scopeNames, + Expr: e.CondExpr, + }) + } +} + +func (e *ForExpr) Range() hcl.Range { + return e.SrcRange +} + +func (e *ForExpr) StartRange() hcl.Range { + return e.OpenRange +} + +type SplatExpr struct { + Source Expression + Each Expression + Item *AnonSymbolExpr + + SrcRange hcl.Range + MarkerRange hcl.Range +} + +func (e *SplatExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { + sourceVal, diags := e.Source.Value(ctx) + if diags.HasErrors() { + // We'll evaluate our "Each" expression here just to see if it + // produces any more diagnostics we can report. Since we're not + // assigning a value to our AnonSymbolExpr here it will return + // DynamicVal, which should short-circuit any use of it. + _, itemDiags := e.Item.Value(ctx) + diags = append(diags, itemDiags...) + return cty.DynamicVal, diags + } + + sourceTy := sourceVal.Type() + if sourceTy == cty.DynamicPseudoType { + // If we don't even know the _type_ of our source value yet then + // we'll need to defer all processing, since we can't decide our + // result type either. + return cty.DynamicVal, diags + } + + // A "special power" of splat expressions is that they can be applied + // both to tuples/lists and to other values, and in the latter case + // the value will be treated as an implicit single-item tuple, or as + // an empty tuple if the value is null. + autoUpgrade := !(sourceTy.IsTupleType() || sourceTy.IsListType() || sourceTy.IsSetType()) + + if sourceVal.IsNull() { + if autoUpgrade { + return cty.EmptyTupleVal, diags + } + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Splat of null value", + Detail: "Splat expressions (with the * symbol) cannot be applied to null sequences.", + Subject: e.Source.Range().Ptr(), + Context: hcl.RangeBetween(e.Source.Range(), e.MarkerRange).Ptr(), + Expression: e.Source, + EvalContext: ctx, + }) + return cty.DynamicVal, diags + } + + if autoUpgrade { + sourceVal = cty.TupleVal([]cty.Value{sourceVal}) + sourceTy = sourceVal.Type() + } + + // We'll compute our result type lazily if we need it. In the normal case + // it's inferred automatically from the value we construct. + resultTy := func() (cty.Type, hcl.Diagnostics) { + chiCtx := ctx.NewChild() + var diags hcl.Diagnostics + switch { + case sourceTy.IsListType() || sourceTy.IsSetType(): + ety := sourceTy.ElementType() + e.Item.setValue(chiCtx, cty.UnknownVal(ety)) + val, itemDiags := e.Each.Value(chiCtx) + diags = append(diags, itemDiags...) + e.Item.clearValue(chiCtx) // clean up our temporary value + return cty.List(val.Type()), diags + case sourceTy.IsTupleType(): + etys := sourceTy.TupleElementTypes() + resultTys := make([]cty.Type, 0, len(etys)) + for _, ety := range etys { + e.Item.setValue(chiCtx, cty.UnknownVal(ety)) + val, itemDiags := e.Each.Value(chiCtx) + diags = append(diags, itemDiags...) + e.Item.clearValue(chiCtx) // clean up our temporary value + resultTys = append(resultTys, val.Type()) + } + return cty.Tuple(resultTys), diags + default: + // Should never happen because of our promotion to list above. + return cty.DynamicPseudoType, diags + } + } + + if !sourceVal.IsKnown() { + // We can't produce a known result in this case, but we'll still + // indicate what the result type would be, allowing any downstream type + // checking to proceed. + ty, tyDiags := resultTy() + diags = append(diags, tyDiags...) + return cty.UnknownVal(ty), diags + } + + vals := make([]cty.Value, 0, sourceVal.LengthInt()) + it := sourceVal.ElementIterator() + if ctx == nil { + // we need a context to use our AnonSymbolExpr, so we'll just + // make an empty one here to use as a placeholder. + ctx = ctx.NewChild() + } + isKnown := true + for it.Next() { + _, sourceItem := it.Element() + e.Item.setValue(ctx, sourceItem) + newItem, itemDiags := e.Each.Value(ctx) + diags = append(diags, itemDiags...) + if itemDiags.HasErrors() { + isKnown = false + } + vals = append(vals, newItem) + } + e.Item.clearValue(ctx) // clean up our temporary value + + if !isKnown { + // We'll ingore the resultTy diagnostics in this case since they + // will just be the same errors we saw while iterating above. + ty, _ := resultTy() + return cty.UnknownVal(ty), diags + } + + switch { + case sourceTy.IsListType() || sourceTy.IsSetType(): + if len(vals) == 0 { + ty, tyDiags := resultTy() + diags = append(diags, tyDiags...) + return cty.ListValEmpty(ty.ElementType()), diags + } + return cty.ListVal(vals), diags + default: + return cty.TupleVal(vals), diags + } +} + +func (e *SplatExpr) walkChildNodes(w internalWalkFunc) { + w(e.Source) + w(e.Each) +} + +func (e *SplatExpr) Range() hcl.Range { + return e.SrcRange +} + +func (e *SplatExpr) StartRange() hcl.Range { + return e.MarkerRange +} + +// AnonSymbolExpr is used as a placeholder for a value in an expression that +// can be applied dynamically to any value at runtime. +// +// This is a rather odd, synthetic expression. It is used as part of the +// representation of splat expressions as a placeholder for the current item +// being visited in the splat evaluation. +// +// AnonSymbolExpr cannot be evaluated in isolation. If its Value is called +// directly then cty.DynamicVal will be returned. Instead, it is evaluated +// in terms of another node (i.e. a splat expression) which temporarily +// assigns it a value. +type AnonSymbolExpr struct { + SrcRange hcl.Range + + // values and its associated lock are used to isolate concurrent + // evaluations of a symbol from one another. It is the calling application's + // responsibility to ensure that the same splat expression is not evalauted + // concurrently within the _same_ EvalContext, but it is fine and safe to + // do cuncurrent evaluations with distinct EvalContexts. + values map[*hcl.EvalContext]cty.Value + valuesLock sync.RWMutex +} + +func (e *AnonSymbolExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { + if ctx == nil { + return cty.DynamicVal, nil + } + + e.valuesLock.RLock() + defer e.valuesLock.RUnlock() + + val, exists := e.values[ctx] + if !exists { + return cty.DynamicVal, nil + } + return val, nil +} + +// setValue sets a temporary local value for the expression when evaluated +// in the given context, which must be non-nil. +func (e *AnonSymbolExpr) setValue(ctx *hcl.EvalContext, val cty.Value) { + e.valuesLock.Lock() + defer e.valuesLock.Unlock() + + if e.values == nil { + e.values = make(map[*hcl.EvalContext]cty.Value) + } + if ctx == nil { + panic("can't setValue for a nil EvalContext") + } + e.values[ctx] = val +} + +func (e *AnonSymbolExpr) clearValue(ctx *hcl.EvalContext) { + e.valuesLock.Lock() + defer e.valuesLock.Unlock() + + if e.values == nil { + return + } + if ctx == nil { + panic("can't clearValue for a nil EvalContext") + } + delete(e.values, ctx) +} + +func (e *AnonSymbolExpr) walkChildNodes(w internalWalkFunc) { + // AnonSymbolExpr is a leaf node in the tree +} + +func (e *AnonSymbolExpr) Range() hcl.Range { + return e.SrcRange +} + +func (e *AnonSymbolExpr) StartRange() hcl.Range { + return e.SrcRange +} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_ops.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_ops.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_ops.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_ops.go index 7f59f1a275d..c1db0cecc8a 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_ops.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_ops.go @@ -3,7 +3,7 @@ package hclsyntax import ( "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" "github.com/zclconf/go-cty/cty/function" diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_template.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_template.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_template.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_template.go index ca3dae189f4..9d425115f95 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_template.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_template.go @@ -4,7 +4,7 @@ import ( "bytes" "fmt" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" "github.com/zclconf/go-cty/cty/convert" ) diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_vars.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_vars.go similarity index 97% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_vars.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_vars.go index 9177092ce4a..a82bf790eb2 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression_vars.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/expression_vars.go @@ -4,7 +4,7 @@ package hclsyntax // Run 'go generate' on this package to update the set of functions here. import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) func (e *AnonSymbolExpr) Variables() []hcl.Traversal { diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/file.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/file.go new file mode 100644 index 00000000000..f55e9ce2c26 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/file.go @@ -0,0 +1,20 @@ +package hclsyntax + +import ( + "github.com/hashicorp/hcl/v2" +) + +// File is the top-level object resulting from parsing a configuration file. +type File struct { + Body *Body + Bytes []byte +} + +func (f *File) AsHCLFile() *hcl.File { + return &hcl.File{ + Body: f.Body, + Bytes: f.Bytes, + + // TODO: The Nav object, once we have an implementation of it + } +} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/generate.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/generate.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/generate.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/generate.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/keywords.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/keywords.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/keywords.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/keywords.go diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/navigation.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/navigation.go new file mode 100644 index 00000000000..af98ef0451d --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/navigation.go @@ -0,0 +1,59 @@ +package hclsyntax + +import ( + "bytes" + "fmt" + + "github.com/hashicorp/hcl/v2" +) + +type navigation struct { + root *Body +} + +// Implementation of hcled.ContextString +func (n navigation) ContextString(offset int) string { + // We will walk our top-level blocks until we find one that contains + // the given offset, and then construct a representation of the header + // of the block. + + var block *Block + for _, candidate := range n.root.Blocks { + if candidate.Range().ContainsOffset(offset) { + block = candidate + break + } + } + + if block == nil { + return "" + } + + if len(block.Labels) == 0 { + // Easy case! + return block.Type + } + + buf := &bytes.Buffer{} + buf.WriteString(block.Type) + for _, label := range block.Labels { + fmt.Fprintf(buf, " %q", label) + } + return buf.String() +} + +func (n navigation) ContextDefRange(offset int) hcl.Range { + var block *Block + for _, candidate := range n.root.Blocks { + if candidate.Range().ContainsOffset(offset) { + block = candidate + break + } + } + + if block == nil { + return hcl.Range{} + } + + return block.DefRange() +} diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/node.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/node.go new file mode 100644 index 00000000000..41b35e53f84 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/node.go @@ -0,0 +1,22 @@ +package hclsyntax + +import ( + "github.com/hashicorp/hcl/v2" +) + +// Node is the abstract type that every AST node implements. +// +// This is a closed interface, so it cannot be implemented from outside of +// this package. +type Node interface { + // This is the mechanism by which the public-facing walk functions + // are implemented. Implementations should call the given function + // for each child node and then replace that node with its return value. + // The return value might just be the same node, for non-transforming + // walks. + walkChildNodes(w internalWalkFunc) + + Range() hcl.Range +} + +type internalWalkFunc func(Node) diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go new file mode 100644 index 00000000000..6fb284a8f77 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser.go @@ -0,0 +1,2054 @@ +package hclsyntax + +import ( + "bytes" + "fmt" + "strconv" + "unicode/utf8" + + "github.com/apparentlymart/go-textseg/textseg" + "github.com/hashicorp/hcl/v2" + "github.com/zclconf/go-cty/cty" +) + +type parser struct { + *peeker + + // set to true if any recovery is attempted. The parser can use this + // to attempt to reduce error noise by suppressing "bad token" errors + // in recovery mode, assuming that the recovery heuristics have failed + // in this case and left the peeker in a wrong place. + recovery bool +} + +func (p *parser) ParseBody(end TokenType) (*Body, hcl.Diagnostics) { + attrs := Attributes{} + blocks := Blocks{} + var diags hcl.Diagnostics + + startRange := p.PrevRange() + var endRange hcl.Range + +Token: + for { + next := p.Peek() + if next.Type == end { + endRange = p.NextRange() + p.Read() + break Token + } + + switch next.Type { + case TokenNewline: + p.Read() + continue + case TokenIdent: + item, itemDiags := p.ParseBodyItem() + diags = append(diags, itemDiags...) + switch titem := item.(type) { + case *Block: + blocks = append(blocks, titem) + case *Attribute: + if existing, exists := attrs[titem.Name]; exists { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Attribute redefined", + Detail: fmt.Sprintf( + "The argument %q was already set at %s. Each argument may be set only once.", + titem.Name, existing.NameRange.String(), + ), + Subject: &titem.NameRange, + }) + } else { + attrs[titem.Name] = titem + } + default: + // This should never happen for valid input, but may if a + // syntax error was detected in ParseBodyItem that prevented + // it from even producing a partially-broken item. In that + // case, it would've left at least one error in the diagnostics + // slice we already dealt with above. + // + // We'll assume ParseBodyItem attempted recovery to leave + // us in a reasonable position to try parsing the next item. + continue + } + default: + bad := p.Read() + if !p.recovery { + if bad.Type == TokenOQuote { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid argument name", + Detail: "Argument names must not be quoted.", + Subject: &bad.Range, + }) + } else { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Argument or block definition required", + Detail: "An argument or block definition is required here.", + Subject: &bad.Range, + }) + } + } + endRange = p.PrevRange() // arbitrary, but somewhere inside the body means better diagnostics + + p.recover(end) // attempt to recover to the token after the end of this body + break Token + } + } + + return &Body{ + Attributes: attrs, + Blocks: blocks, + + SrcRange: hcl.RangeBetween(startRange, endRange), + EndRange: hcl.Range{ + Filename: endRange.Filename, + Start: endRange.End, + End: endRange.End, + }, + }, diags +} + +func (p *parser) ParseBodyItem() (Node, hcl.Diagnostics) { + ident := p.Read() + if ident.Type != TokenIdent { + p.recoverAfterBodyItem() + return nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Argument or block definition required", + Detail: "An argument or block definition is required here.", + Subject: &ident.Range, + }, + } + } + + next := p.Peek() + + switch next.Type { + case TokenEqual: + return p.finishParsingBodyAttribute(ident, false) + case TokenOQuote, TokenOBrace, TokenIdent: + return p.finishParsingBodyBlock(ident) + default: + p.recoverAfterBodyItem() + return nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Argument or block definition required", + Detail: "An argument or block definition is required here. To set an argument, use the equals sign \"=\" to introduce the argument value.", + Subject: &ident.Range, + }, + } + } + + return nil, nil +} + +// parseSingleAttrBody is a weird variant of ParseBody that deals with the +// body of a nested block containing only one attribute value all on a single +// line, like foo { bar = baz } . It expects to find a single attribute item +// immediately followed by the end token type with no intervening newlines. +func (p *parser) parseSingleAttrBody(end TokenType) (*Body, hcl.Diagnostics) { + ident := p.Read() + if ident.Type != TokenIdent { + p.recoverAfterBodyItem() + return nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Argument or block definition required", + Detail: "An argument or block definition is required here.", + Subject: &ident.Range, + }, + } + } + + var attr *Attribute + var diags hcl.Diagnostics + + next := p.Peek() + + switch next.Type { + case TokenEqual: + node, attrDiags := p.finishParsingBodyAttribute(ident, true) + diags = append(diags, attrDiags...) + attr = node.(*Attribute) + case TokenOQuote, TokenOBrace, TokenIdent: + p.recoverAfterBodyItem() + return nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Argument definition required", + Detail: fmt.Sprintf("A single-line block definition can contain only a single argument. If you meant to define argument %q, use an equals sign to assign it a value. To define a nested block, place it on a line of its own within its parent block.", ident.Bytes), + Subject: hcl.RangeBetween(ident.Range, next.Range).Ptr(), + }, + } + default: + p.recoverAfterBodyItem() + return nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Argument or block definition required", + Detail: "An argument or block definition is required here. To set an argument, use the equals sign \"=\" to introduce the argument value.", + Subject: &ident.Range, + }, + } + } + + return &Body{ + Attributes: Attributes{ + string(ident.Bytes): attr, + }, + + SrcRange: attr.SrcRange, + EndRange: hcl.Range{ + Filename: attr.SrcRange.Filename, + Start: attr.SrcRange.End, + End: attr.SrcRange.End, + }, + }, diags + +} + +func (p *parser) finishParsingBodyAttribute(ident Token, singleLine bool) (Node, hcl.Diagnostics) { + eqTok := p.Read() // eat equals token + if eqTok.Type != TokenEqual { + // should never happen if caller behaves + panic("finishParsingBodyAttribute called with next not equals") + } + + var endRange hcl.Range + + expr, diags := p.ParseExpression() + if p.recovery && diags.HasErrors() { + // recovery within expressions tends to be tricky, so we've probably + // landed somewhere weird. We'll try to reset to the start of a body + // item so parsing can continue. + endRange = p.PrevRange() + p.recoverAfterBodyItem() + } else { + endRange = p.PrevRange() + if !singleLine { + end := p.Peek() + if end.Type != TokenNewline && end.Type != TokenEOF { + if !p.recovery { + summary := "Missing newline after argument" + detail := "An argument definition must end with a newline." + + if end.Type == TokenComma { + summary = "Unexpected comma after argument" + detail = "Argument definitions must be separated by newlines, not commas. " + detail + } + + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: summary, + Detail: detail, + Subject: &end.Range, + Context: hcl.RangeBetween(ident.Range, end.Range).Ptr(), + }) + } + endRange = p.PrevRange() + p.recoverAfterBodyItem() + } else { + endRange = p.PrevRange() + p.Read() // eat newline + } + } + } + + return &Attribute{ + Name: string(ident.Bytes), + Expr: expr, + + SrcRange: hcl.RangeBetween(ident.Range, endRange), + NameRange: ident.Range, + EqualsRange: eqTok.Range, + }, diags +} + +func (p *parser) finishParsingBodyBlock(ident Token) (Node, hcl.Diagnostics) { + var blockType = string(ident.Bytes) + var diags hcl.Diagnostics + var labels []string + var labelRanges []hcl.Range + + var oBrace Token + +Token: + for { + tok := p.Peek() + + switch tok.Type { + + case TokenOBrace: + oBrace = p.Read() + break Token + + case TokenOQuote: + label, labelRange, labelDiags := p.parseQuotedStringLiteral() + diags = append(diags, labelDiags...) + labels = append(labels, label) + labelRanges = append(labelRanges, labelRange) + // parseQuoteStringLiteral recovers up to the closing quote + // if it encounters problems, so we can continue looking for + // more labels and eventually the block body even. + + case TokenIdent: + tok = p.Read() // eat token + label, labelRange := string(tok.Bytes), tok.Range + labels = append(labels, label) + labelRanges = append(labelRanges, labelRange) + + default: + switch tok.Type { + case TokenEqual: + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid block definition", + Detail: "The equals sign \"=\" indicates an argument definition, and must not be used when defining a block.", + Subject: &tok.Range, + Context: hcl.RangeBetween(ident.Range, tok.Range).Ptr(), + }) + case TokenNewline: + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid block definition", + Detail: "A block definition must have block content delimited by \"{\" and \"}\", starting on the same line as the block header.", + Subject: &tok.Range, + Context: hcl.RangeBetween(ident.Range, tok.Range).Ptr(), + }) + default: + if !p.recovery { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid block definition", + Detail: "Either a quoted string block label or an opening brace (\"{\") is expected here.", + Subject: &tok.Range, + Context: hcl.RangeBetween(ident.Range, tok.Range).Ptr(), + }) + } + } + + p.recoverAfterBodyItem() + + return &Block{ + Type: blockType, + Labels: labels, + Body: &Body{ + SrcRange: ident.Range, + EndRange: ident.Range, + }, + + TypeRange: ident.Range, + LabelRanges: labelRanges, + OpenBraceRange: ident.Range, // placeholder + CloseBraceRange: ident.Range, // placeholder + }, diags + } + } + + // Once we fall out here, the peeker is pointed just after our opening + // brace, so we can begin our nested body parsing. + var body *Body + var bodyDiags hcl.Diagnostics + switch p.Peek().Type { + case TokenNewline, TokenEOF, TokenCBrace: + body, bodyDiags = p.ParseBody(TokenCBrace) + default: + // Special one-line, single-attribute block parsing mode. + body, bodyDiags = p.parseSingleAttrBody(TokenCBrace) + switch p.Peek().Type { + case TokenCBrace: + p.Read() // the happy path - just consume the closing brace + case TokenComma: + // User seems to be trying to use the object-constructor + // comma-separated style, which isn't permitted for blocks. + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid single-argument block definition", + Detail: "Single-line block syntax can include only one argument definition. To define multiple arguments, use the multi-line block syntax with one argument definition per line.", + Subject: p.Peek().Range.Ptr(), + }) + p.recover(TokenCBrace) + case TokenNewline: + // We don't allow weird mixtures of single and multi-line syntax. + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid single-argument block definition", + Detail: "An argument definition on the same line as its containing block creates a single-line block definition, which must also be closed on the same line. Place the block's closing brace immediately after the argument definition.", + Subject: p.Peek().Range.Ptr(), + }) + p.recover(TokenCBrace) + default: + // Some other weird thing is going on. Since we can't guess a likely + // user intent for this one, we'll skip it if we're already in + // recovery mode. + if !p.recovery { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid single-argument block definition", + Detail: "A single-line block definition must end with a closing brace immediately after its single argument definition.", + Subject: p.Peek().Range.Ptr(), + }) + } + p.recover(TokenCBrace) + } + } + diags = append(diags, bodyDiags...) + cBraceRange := p.PrevRange() + + eol := p.Peek() + if eol.Type == TokenNewline || eol.Type == TokenEOF { + p.Read() // eat newline + } else { + if !p.recovery { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing newline after block definition", + Detail: "A block definition must end with a newline.", + Subject: &eol.Range, + Context: hcl.RangeBetween(ident.Range, eol.Range).Ptr(), + }) + } + p.recoverAfterBodyItem() + } + + // We must never produce a nil body, since the caller may attempt to + // do analysis of a partial result when there's an error, so we'll + // insert a placeholder if we otherwise failed to produce a valid + // body due to one of the syntax error paths above. + if body == nil && diags.HasErrors() { + body = &Body{ + SrcRange: hcl.RangeBetween(oBrace.Range, cBraceRange), + EndRange: cBraceRange, + } + } + + return &Block{ + Type: blockType, + Labels: labels, + Body: body, + + TypeRange: ident.Range, + LabelRanges: labelRanges, + OpenBraceRange: oBrace.Range, + CloseBraceRange: cBraceRange, + }, diags +} + +func (p *parser) ParseExpression() (Expression, hcl.Diagnostics) { + return p.parseTernaryConditional() +} + +func (p *parser) parseTernaryConditional() (Expression, hcl.Diagnostics) { + // The ternary conditional operator (.. ? .. : ..) behaves somewhat + // like a binary operator except that the "symbol" is itself + // an expression enclosed in two punctuation characters. + // The middle expression is parsed as if the ? and : symbols + // were parentheses. The "rhs" (the "false expression") is then + // treated right-associatively so it behaves similarly to the + // middle in terms of precedence. + + startRange := p.NextRange() + var condExpr, trueExpr, falseExpr Expression + var diags hcl.Diagnostics + + condExpr, condDiags := p.parseBinaryOps(binaryOps) + diags = append(diags, condDiags...) + if p.recovery && condDiags.HasErrors() { + return condExpr, diags + } + + questionMark := p.Peek() + if questionMark.Type != TokenQuestion { + return condExpr, diags + } + + p.Read() // eat question mark + + trueExpr, trueDiags := p.ParseExpression() + diags = append(diags, trueDiags...) + if p.recovery && trueDiags.HasErrors() { + return condExpr, diags + } + + colon := p.Peek() + if colon.Type != TokenColon { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing false expression in conditional", + Detail: "The conditional operator (...?...:...) requires a false expression, delimited by a colon.", + Subject: &colon.Range, + Context: hcl.RangeBetween(startRange, colon.Range).Ptr(), + }) + return condExpr, diags + } + + p.Read() // eat colon + + falseExpr, falseDiags := p.ParseExpression() + diags = append(diags, falseDiags...) + if p.recovery && falseDiags.HasErrors() { + return condExpr, diags + } + + return &ConditionalExpr{ + Condition: condExpr, + TrueResult: trueExpr, + FalseResult: falseExpr, + + SrcRange: hcl.RangeBetween(startRange, falseExpr.Range()), + }, diags +} + +// parseBinaryOps calls itself recursively to work through all of the +// operator precedence groups, and then eventually calls parseExpressionTerm +// for each operand. +func (p *parser) parseBinaryOps(ops []map[TokenType]*Operation) (Expression, hcl.Diagnostics) { + if len(ops) == 0 { + // We've run out of operators, so now we'll just try to parse a term. + return p.parseExpressionWithTraversals() + } + + thisLevel := ops[0] + remaining := ops[1:] + + var lhs, rhs Expression + var operation *Operation + var diags hcl.Diagnostics + + // Parse a term that might be the first operand of a binary + // operation or it might just be a standalone term. + // We won't know until we've parsed it and can look ahead + // to see if there's an operator token for this level. + lhs, lhsDiags := p.parseBinaryOps(remaining) + diags = append(diags, lhsDiags...) + if p.recovery && lhsDiags.HasErrors() { + return lhs, diags + } + + // We'll keep eating up operators until we run out, so that operators + // with the same precedence will combine in a left-associative manner: + // a+b+c => (a+b)+c, not a+(b+c) + // + // Should we later want to have right-associative operators, a way + // to achieve that would be to call back up to ParseExpression here + // instead of iteratively parsing only the remaining operators. + for { + next := p.Peek() + var newOp *Operation + var ok bool + if newOp, ok = thisLevel[next.Type]; !ok { + break + } + + // Are we extending an expression started on the previous iteration? + if operation != nil { + lhs = &BinaryOpExpr{ + LHS: lhs, + Op: operation, + RHS: rhs, + + SrcRange: hcl.RangeBetween(lhs.Range(), rhs.Range()), + } + } + + operation = newOp + p.Read() // eat operator token + var rhsDiags hcl.Diagnostics + rhs, rhsDiags = p.parseBinaryOps(remaining) + diags = append(diags, rhsDiags...) + if p.recovery && rhsDiags.HasErrors() { + return lhs, diags + } + } + + if operation == nil { + return lhs, diags + } + + return &BinaryOpExpr{ + LHS: lhs, + Op: operation, + RHS: rhs, + + SrcRange: hcl.RangeBetween(lhs.Range(), rhs.Range()), + }, diags +} + +func (p *parser) parseExpressionWithTraversals() (Expression, hcl.Diagnostics) { + term, diags := p.parseExpressionTerm() + ret, moreDiags := p.parseExpressionTraversals(term) + diags = append(diags, moreDiags...) + return ret, diags +} + +func (p *parser) parseExpressionTraversals(from Expression) (Expression, hcl.Diagnostics) { + var diags hcl.Diagnostics + ret := from + +Traversal: + for { + next := p.Peek() + + switch next.Type { + case TokenDot: + // Attribute access or splat + dot := p.Read() + attrTok := p.Peek() + + switch attrTok.Type { + case TokenIdent: + attrTok = p.Read() // eat token + name := string(attrTok.Bytes) + rng := hcl.RangeBetween(dot.Range, attrTok.Range) + step := hcl.TraverseAttr{ + Name: name, + SrcRange: rng, + } + + ret = makeRelativeTraversal(ret, step, rng) + + case TokenNumberLit: + // This is a weird form we inherited from HIL, allowing numbers + // to be used as attributes as a weird way of writing [n]. + // This was never actually a first-class thing in HIL, but + // HIL tolerated sequences like .0. in its variable names and + // calling applications like Terraform exploited that to + // introduce indexing syntax where none existed. + numTok := p.Read() // eat token + attrTok = numTok + + // This syntax is ambiguous if multiple indices are used in + // succession, like foo.0.1.baz: that actually parses as + // a fractional number 0.1. Since we're only supporting this + // syntax for compatibility with legacy Terraform + // configurations, and Terraform does not tend to have lists + // of lists, we'll choose to reject that here with a helpful + // error message, rather than failing later because the index + // isn't a whole number. + if dotIdx := bytes.IndexByte(numTok.Bytes, '.'); dotIdx >= 0 { + first := numTok.Bytes[:dotIdx] + second := numTok.Bytes[dotIdx+1:] + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid legacy index syntax", + Detail: fmt.Sprintf("When using the legacy index syntax, chaining two indexes together is not permitted. Use the proper index syntax instead, like [%s][%s].", first, second), + Subject: &attrTok.Range, + }) + rng := hcl.RangeBetween(dot.Range, numTok.Range) + step := hcl.TraverseIndex{ + Key: cty.DynamicVal, + SrcRange: rng, + } + ret = makeRelativeTraversal(ret, step, rng) + break + } + + numVal, numDiags := p.numberLitValue(numTok) + diags = append(diags, numDiags...) + + rng := hcl.RangeBetween(dot.Range, numTok.Range) + step := hcl.TraverseIndex{ + Key: numVal, + SrcRange: rng, + } + + ret = makeRelativeTraversal(ret, step, rng) + + case TokenStar: + // "Attribute-only" splat expression. + // (This is a kinda weird construct inherited from HIL, which + // behaves a bit like a [*] splat except that it is only able + // to do attribute traversals into each of its elements, + // whereas foo[*] can support _any_ traversal. + marker := p.Read() // eat star + trav := make(hcl.Traversal, 0, 1) + var firstRange, lastRange hcl.Range + firstRange = p.NextRange() + for p.Peek().Type == TokenDot { + dot := p.Read() + + if p.Peek().Type == TokenNumberLit { + // Continuing the "weird stuff inherited from HIL" + // theme, we also allow numbers as attribute names + // inside splats and interpret them as indexing + // into a list, for expressions like: + // foo.bar.*.baz.0.foo + numTok := p.Read() + + // Weird special case if the user writes something + // like foo.bar.*.baz.0.0.foo, where 0.0 parses + // as a number. + if dotIdx := bytes.IndexByte(numTok.Bytes, '.'); dotIdx >= 0 { + first := numTok.Bytes[:dotIdx] + second := numTok.Bytes[dotIdx+1:] + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid legacy index syntax", + Detail: fmt.Sprintf("When using the legacy index syntax, chaining two indexes together is not permitted. Use the proper index syntax with a full splat expression [*] instead, like [%s][%s].", first, second), + Subject: &attrTok.Range, + }) + trav = append(trav, hcl.TraverseIndex{ + Key: cty.DynamicVal, + SrcRange: hcl.RangeBetween(dot.Range, numTok.Range), + }) + lastRange = numTok.Range + continue + } + + numVal, numDiags := p.numberLitValue(numTok) + diags = append(diags, numDiags...) + trav = append(trav, hcl.TraverseIndex{ + Key: numVal, + SrcRange: hcl.RangeBetween(dot.Range, numTok.Range), + }) + lastRange = numTok.Range + continue + } + + if p.Peek().Type != TokenIdent { + if !p.recovery { + if p.Peek().Type == TokenStar { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Nested splat expression not allowed", + Detail: "A splat expression (*) cannot be used inside another attribute-only splat expression.", + Subject: p.Peek().Range.Ptr(), + }) + } else { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid attribute name", + Detail: "An attribute name is required after a dot.", + Subject: &attrTok.Range, + }) + } + } + p.setRecovery() + continue Traversal + } + + attrTok := p.Read() + trav = append(trav, hcl.TraverseAttr{ + Name: string(attrTok.Bytes), + SrcRange: hcl.RangeBetween(dot.Range, attrTok.Range), + }) + lastRange = attrTok.Range + } + + itemExpr := &AnonSymbolExpr{ + SrcRange: hcl.RangeBetween(dot.Range, marker.Range), + } + var travExpr Expression + if len(trav) == 0 { + travExpr = itemExpr + } else { + travExpr = &RelativeTraversalExpr{ + Source: itemExpr, + Traversal: trav, + SrcRange: hcl.RangeBetween(firstRange, lastRange), + } + } + + ret = &SplatExpr{ + Source: ret, + Each: travExpr, + Item: itemExpr, + + SrcRange: hcl.RangeBetween(dot.Range, lastRange), + MarkerRange: hcl.RangeBetween(dot.Range, marker.Range), + } + + default: + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid attribute name", + Detail: "An attribute name is required after a dot.", + Subject: &attrTok.Range, + }) + // This leaves the peeker in a bad place, so following items + // will probably be misparsed until we hit something that + // allows us to re-sync. + // + // We will probably need to do something better here eventually + // in order to support autocomplete triggered by typing a + // period. + p.setRecovery() + } + + case TokenOBrack: + // Indexing of a collection. + // This may or may not be a hcl.Traverser, depending on whether + // the key value is something constant. + + open := p.Read() + switch p.Peek().Type { + case TokenStar: + // This is a full splat expression, like foo[*], which consumes + // the rest of the traversal steps after it using a recursive + // call to this function. + p.Read() // consume star + close := p.Read() + if close.Type != TokenCBrack && !p.recovery { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing close bracket on splat index", + Detail: "The star for a full splat operator must be immediately followed by a closing bracket (\"]\").", + Subject: &close.Range, + }) + close = p.recover(TokenCBrack) + } + // Splat expressions use a special "anonymous symbol" as a + // placeholder in an expression to be evaluated once for each + // item in the source expression. + itemExpr := &AnonSymbolExpr{ + SrcRange: hcl.RangeBetween(open.Range, close.Range), + } + // Now we'll recursively call this same function to eat any + // remaining traversal steps against the anonymous symbol. + travExpr, nestedDiags := p.parseExpressionTraversals(itemExpr) + diags = append(diags, nestedDiags...) + + ret = &SplatExpr{ + Source: ret, + Each: travExpr, + Item: itemExpr, + + SrcRange: hcl.RangeBetween(open.Range, travExpr.Range()), + MarkerRange: hcl.RangeBetween(open.Range, close.Range), + } + + default: + + var close Token + p.PushIncludeNewlines(false) // arbitrary newlines allowed in brackets + keyExpr, keyDiags := p.ParseExpression() + diags = append(diags, keyDiags...) + if p.recovery && keyDiags.HasErrors() { + close = p.recover(TokenCBrack) + } else { + close = p.Read() + if close.Type != TokenCBrack && !p.recovery { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing close bracket on index", + Detail: "The index operator must end with a closing bracket (\"]\").", + Subject: &close.Range, + }) + close = p.recover(TokenCBrack) + } + } + p.PopIncludeNewlines() + + if lit, isLit := keyExpr.(*LiteralValueExpr); isLit { + litKey, _ := lit.Value(nil) + rng := hcl.RangeBetween(open.Range, close.Range) + step := hcl.TraverseIndex{ + Key: litKey, + SrcRange: rng, + } + ret = makeRelativeTraversal(ret, step, rng) + } else if tmpl, isTmpl := keyExpr.(*TemplateExpr); isTmpl && tmpl.IsStringLiteral() { + litKey, _ := tmpl.Value(nil) + rng := hcl.RangeBetween(open.Range, close.Range) + step := hcl.TraverseIndex{ + Key: litKey, + SrcRange: rng, + } + ret = makeRelativeTraversal(ret, step, rng) + } else { + rng := hcl.RangeBetween(open.Range, close.Range) + ret = &IndexExpr{ + Collection: ret, + Key: keyExpr, + + SrcRange: rng, + OpenRange: open.Range, + } + } + } + + default: + break Traversal + } + } + + return ret, diags +} + +// makeRelativeTraversal takes an expression and a traverser and returns +// a traversal expression that combines the two. If the given expression +// is already a traversal, it is extended in place (mutating it) and +// returned. If it isn't, a new RelativeTraversalExpr is created and returned. +func makeRelativeTraversal(expr Expression, next hcl.Traverser, rng hcl.Range) Expression { + switch texpr := expr.(type) { + case *ScopeTraversalExpr: + texpr.Traversal = append(texpr.Traversal, next) + texpr.SrcRange = hcl.RangeBetween(texpr.SrcRange, rng) + return texpr + case *RelativeTraversalExpr: + texpr.Traversal = append(texpr.Traversal, next) + texpr.SrcRange = hcl.RangeBetween(texpr.SrcRange, rng) + return texpr + default: + return &RelativeTraversalExpr{ + Source: expr, + Traversal: hcl.Traversal{next}, + SrcRange: rng, + } + } +} + +func (p *parser) parseExpressionTerm() (Expression, hcl.Diagnostics) { + start := p.Peek() + + switch start.Type { + case TokenOParen: + p.Read() // eat open paren + + p.PushIncludeNewlines(false) + + expr, diags := p.ParseExpression() + if diags.HasErrors() { + // attempt to place the peeker after our closing paren + // before we return, so that the next parser has some + // chance of finding a valid expression. + p.recover(TokenCParen) + p.PopIncludeNewlines() + return expr, diags + } + + close := p.Peek() + if close.Type != TokenCParen { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Unbalanced parentheses", + Detail: "Expected a closing parenthesis to terminate the expression.", + Subject: &close.Range, + Context: hcl.RangeBetween(start.Range, close.Range).Ptr(), + }) + p.setRecovery() + } + + p.Read() // eat closing paren + p.PopIncludeNewlines() + + return expr, diags + + case TokenNumberLit: + tok := p.Read() // eat number token + + numVal, diags := p.numberLitValue(tok) + return &LiteralValueExpr{ + Val: numVal, + SrcRange: tok.Range, + }, diags + + case TokenIdent: + tok := p.Read() // eat identifier token + + if p.Peek().Type == TokenOParen { + return p.finishParsingFunctionCall(tok) + } + + name := string(tok.Bytes) + switch name { + case "true": + return &LiteralValueExpr{ + Val: cty.True, + SrcRange: tok.Range, + }, nil + case "false": + return &LiteralValueExpr{ + Val: cty.False, + SrcRange: tok.Range, + }, nil + case "null": + return &LiteralValueExpr{ + Val: cty.NullVal(cty.DynamicPseudoType), + SrcRange: tok.Range, + }, nil + default: + return &ScopeTraversalExpr{ + Traversal: hcl.Traversal{ + hcl.TraverseRoot{ + Name: name, + SrcRange: tok.Range, + }, + }, + SrcRange: tok.Range, + }, nil + } + + case TokenOQuote, TokenOHeredoc: + open := p.Read() // eat opening marker + closer := p.oppositeBracket(open.Type) + exprs, passthru, _, diags := p.parseTemplateInner(closer, tokenOpensFlushHeredoc(open)) + + closeRange := p.PrevRange() + + if passthru { + if len(exprs) != 1 { + panic("passthru set with len(exprs) != 1") + } + return &TemplateWrapExpr{ + Wrapped: exprs[0], + SrcRange: hcl.RangeBetween(open.Range, closeRange), + }, diags + } + + return &TemplateExpr{ + Parts: exprs, + SrcRange: hcl.RangeBetween(open.Range, closeRange), + }, diags + + case TokenMinus: + tok := p.Read() // eat minus token + + // Important to use parseExpressionWithTraversals rather than parseExpression + // here, otherwise we can capture a following binary expression into + // our negation. + // e.g. -46+5 should parse as (-46)+5, not -(46+5) + operand, diags := p.parseExpressionWithTraversals() + return &UnaryOpExpr{ + Op: OpNegate, + Val: operand, + + SrcRange: hcl.RangeBetween(tok.Range, operand.Range()), + SymbolRange: tok.Range, + }, diags + + case TokenBang: + tok := p.Read() // eat bang token + + // Important to use parseExpressionWithTraversals rather than parseExpression + // here, otherwise we can capture a following binary expression into + // our negation. + operand, diags := p.parseExpressionWithTraversals() + return &UnaryOpExpr{ + Op: OpLogicalNot, + Val: operand, + + SrcRange: hcl.RangeBetween(tok.Range, operand.Range()), + SymbolRange: tok.Range, + }, diags + + case TokenOBrack: + return p.parseTupleCons() + + case TokenOBrace: + return p.parseObjectCons() + + default: + var diags hcl.Diagnostics + if !p.recovery { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid expression", + Detail: "Expected the start of an expression, but found an invalid expression token.", + Subject: &start.Range, + }) + } + p.setRecovery() + + // Return a placeholder so that the AST is still structurally sound + // even in the presence of parse errors. + return &LiteralValueExpr{ + Val: cty.DynamicVal, + SrcRange: start.Range, + }, diags + } +} + +func (p *parser) numberLitValue(tok Token) (cty.Value, hcl.Diagnostics) { + // The cty.ParseNumberVal is always the same behavior as converting a + // string to a number, ensuring we always interpret decimal numbers in + // the same way. + numVal, err := cty.ParseNumberVal(string(tok.Bytes)) + if err != nil { + ret := cty.UnknownVal(cty.Number) + return ret, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Invalid number literal", + // FIXME: not a very good error message, but convert only + // gives us "a number is required", so not much help either. + Detail: "Failed to recognize the value of this number literal.", + Subject: &tok.Range, + }, + } + } + return numVal, nil +} + +// finishParsingFunctionCall parses a function call assuming that the function +// name was already read, and so the peeker should be pointing at the opening +// parenthesis after the name. +func (p *parser) finishParsingFunctionCall(name Token) (Expression, hcl.Diagnostics) { + openTok := p.Read() + if openTok.Type != TokenOParen { + // should never happen if callers behave + panic("finishParsingFunctionCall called with non-parenthesis as next token") + } + + var args []Expression + var diags hcl.Diagnostics + var expandFinal bool + var closeTok Token + + // Arbitrary newlines are allowed inside the function call parentheses. + p.PushIncludeNewlines(false) + +Token: + for { + tok := p.Peek() + + if tok.Type == TokenCParen { + closeTok = p.Read() // eat closing paren + break Token + } + + arg, argDiags := p.ParseExpression() + args = append(args, arg) + diags = append(diags, argDiags...) + if p.recovery && argDiags.HasErrors() { + // if there was a parse error in the argument then we've + // probably been left in a weird place in the token stream, + // so we'll bail out with a partial argument list. + p.recover(TokenCParen) + break Token + } + + sep := p.Read() + if sep.Type == TokenCParen { + closeTok = sep + break Token + } + + if sep.Type == TokenEllipsis { + expandFinal = true + + if p.Peek().Type != TokenCParen { + if !p.recovery { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing closing parenthesis", + Detail: "An expanded function argument (with ...) must be immediately followed by closing parentheses.", + Subject: &sep.Range, + Context: hcl.RangeBetween(name.Range, sep.Range).Ptr(), + }) + } + closeTok = p.recover(TokenCParen) + } else { + closeTok = p.Read() // eat closing paren + } + break Token + } + + if sep.Type != TokenComma { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing argument separator", + Detail: "A comma is required to separate each function argument from the next.", + Subject: &sep.Range, + Context: hcl.RangeBetween(name.Range, sep.Range).Ptr(), + }) + closeTok = p.recover(TokenCParen) + break Token + } + + if p.Peek().Type == TokenCParen { + // A trailing comma after the last argument gets us in here. + closeTok = p.Read() // eat closing paren + break Token + } + + } + + p.PopIncludeNewlines() + + return &FunctionCallExpr{ + Name: string(name.Bytes), + Args: args, + + ExpandFinal: expandFinal, + + NameRange: name.Range, + OpenParenRange: openTok.Range, + CloseParenRange: closeTok.Range, + }, diags +} + +func (p *parser) parseTupleCons() (Expression, hcl.Diagnostics) { + open := p.Read() + if open.Type != TokenOBrack { + // Should never happen if callers are behaving + panic("parseTupleCons called without peeker pointing to open bracket") + } + + p.PushIncludeNewlines(false) + defer p.PopIncludeNewlines() + + if forKeyword.TokenMatches(p.Peek()) { + return p.finishParsingForExpr(open) + } + + var close Token + + var diags hcl.Diagnostics + var exprs []Expression + + for { + next := p.Peek() + if next.Type == TokenCBrack { + close = p.Read() // eat closer + break + } + + expr, exprDiags := p.ParseExpression() + exprs = append(exprs, expr) + diags = append(diags, exprDiags...) + + if p.recovery && exprDiags.HasErrors() { + // If expression parsing failed then we are probably in a strange + // place in the token stream, so we'll bail out and try to reset + // to after our closing bracket to allow parsing to continue. + close = p.recover(TokenCBrack) + break + } + + next = p.Peek() + if next.Type == TokenCBrack { + close = p.Read() // eat closer + break + } + + if next.Type != TokenComma { + if !p.recovery { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing item separator", + Detail: "Expected a comma to mark the beginning of the next item.", + Subject: &next.Range, + Context: hcl.RangeBetween(open.Range, next.Range).Ptr(), + }) + } + close = p.recover(TokenCBrack) + break + } + + p.Read() // eat comma + + } + + return &TupleConsExpr{ + Exprs: exprs, + + SrcRange: hcl.RangeBetween(open.Range, close.Range), + OpenRange: open.Range, + }, diags +} + +func (p *parser) parseObjectCons() (Expression, hcl.Diagnostics) { + open := p.Read() + if open.Type != TokenOBrace { + // Should never happen if callers are behaving + panic("parseObjectCons called without peeker pointing to open brace") + } + + // We must temporarily stop looking at newlines here while we check for + // a "for" keyword, since for expressions are _not_ newline-sensitive, + // even though object constructors are. + p.PushIncludeNewlines(false) + isFor := forKeyword.TokenMatches(p.Peek()) + p.PopIncludeNewlines() + if isFor { + return p.finishParsingForExpr(open) + } + + p.PushIncludeNewlines(true) + defer p.PopIncludeNewlines() + + var close Token + + var diags hcl.Diagnostics + var items []ObjectConsItem + + for { + next := p.Peek() + if next.Type == TokenNewline { + p.Read() // eat newline + continue + } + + if next.Type == TokenCBrace { + close = p.Read() // eat closer + break + } + + // Wrapping parens are not explicitly represented in the AST, but + // we want to use them here to disambiguate intepreting a mapping + // key as a full expression rather than just a name, and so + // we'll remember this was present and use it to force the + // behavior of our final ObjectConsKeyExpr. + forceNonLiteral := (p.Peek().Type == TokenOParen) + + var key Expression + var keyDiags hcl.Diagnostics + key, keyDiags = p.ParseExpression() + diags = append(diags, keyDiags...) + + if p.recovery && keyDiags.HasErrors() { + // If expression parsing failed then we are probably in a strange + // place in the token stream, so we'll bail out and try to reset + // to after our closing brace to allow parsing to continue. + close = p.recover(TokenCBrace) + break + } + + // We wrap up the key expression in a special wrapper that deals + // with our special case that naked identifiers as object keys + // are interpreted as literal strings. + key = &ObjectConsKeyExpr{ + Wrapped: key, + ForceNonLiteral: forceNonLiteral, + } + + next = p.Peek() + if next.Type != TokenEqual && next.Type != TokenColon { + if !p.recovery { + switch next.Type { + case TokenNewline, TokenComma: + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing attribute value", + Detail: "Expected an attribute value, introduced by an equals sign (\"=\").", + Subject: &next.Range, + Context: hcl.RangeBetween(open.Range, next.Range).Ptr(), + }) + case TokenIdent: + // Although this might just be a plain old missing equals + // sign before a reference, one way to get here is to try + // to write an attribute name containing a period followed + // by a digit, which was valid in HCL1, like this: + // foo1.2_bar = "baz" + // We can't know exactly what the user intended here, but + // we'll augment our message with an extra hint in this case + // in case it is helpful. + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing key/value separator", + Detail: "Expected an equals sign (\"=\") to mark the beginning of the attribute value. If you intended to given an attribute name containing periods or spaces, write the name in quotes to create a string literal.", + Subject: &next.Range, + Context: hcl.RangeBetween(open.Range, next.Range).Ptr(), + }) + default: + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing key/value separator", + Detail: "Expected an equals sign (\"=\") to mark the beginning of the attribute value.", + Subject: &next.Range, + Context: hcl.RangeBetween(open.Range, next.Range).Ptr(), + }) + } + } + close = p.recover(TokenCBrace) + break + } + + p.Read() // eat equals sign or colon + + value, valueDiags := p.ParseExpression() + diags = append(diags, valueDiags...) + + if p.recovery && valueDiags.HasErrors() { + // If expression parsing failed then we are probably in a strange + // place in the token stream, so we'll bail out and try to reset + // to after our closing brace to allow parsing to continue. + close = p.recover(TokenCBrace) + break + } + + items = append(items, ObjectConsItem{ + KeyExpr: key, + ValueExpr: value, + }) + + next = p.Peek() + if next.Type == TokenCBrace { + close = p.Read() // eat closer + break + } + + if next.Type != TokenComma && next.Type != TokenNewline { + if !p.recovery { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing attribute separator", + Detail: "Expected a newline or comma to mark the beginning of the next attribute.", + Subject: &next.Range, + Context: hcl.RangeBetween(open.Range, next.Range).Ptr(), + }) + } + close = p.recover(TokenCBrace) + break + } + + p.Read() // eat comma or newline + + } + + return &ObjectConsExpr{ + Items: items, + + SrcRange: hcl.RangeBetween(open.Range, close.Range), + OpenRange: open.Range, + }, diags +} + +func (p *parser) finishParsingForExpr(open Token) (Expression, hcl.Diagnostics) { + p.PushIncludeNewlines(false) + defer p.PopIncludeNewlines() + introducer := p.Read() + if !forKeyword.TokenMatches(introducer) { + // Should never happen if callers are behaving + panic("finishParsingForExpr called without peeker pointing to 'for' identifier") + } + + var makeObj bool + var closeType TokenType + switch open.Type { + case TokenOBrace: + makeObj = true + closeType = TokenCBrace + case TokenOBrack: + makeObj = false // making a tuple + closeType = TokenCBrack + default: + // Should never happen if callers are behaving + panic("finishParsingForExpr called with invalid open token") + } + + var diags hcl.Diagnostics + var keyName, valName string + + if p.Peek().Type != TokenIdent { + if !p.recovery { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid 'for' expression", + Detail: "For expression requires variable name after 'for'.", + Subject: p.Peek().Range.Ptr(), + Context: hcl.RangeBetween(open.Range, p.Peek().Range).Ptr(), + }) + } + close := p.recover(closeType) + return &LiteralValueExpr{ + Val: cty.DynamicVal, + SrcRange: hcl.RangeBetween(open.Range, close.Range), + }, diags + } + + valName = string(p.Read().Bytes) + + if p.Peek().Type == TokenComma { + // What we just read was actually the key, then. + keyName = valName + p.Read() // eat comma + + if p.Peek().Type != TokenIdent { + if !p.recovery { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid 'for' expression", + Detail: "For expression requires value variable name after comma.", + Subject: p.Peek().Range.Ptr(), + Context: hcl.RangeBetween(open.Range, p.Peek().Range).Ptr(), + }) + } + close := p.recover(closeType) + return &LiteralValueExpr{ + Val: cty.DynamicVal, + SrcRange: hcl.RangeBetween(open.Range, close.Range), + }, diags + } + + valName = string(p.Read().Bytes) + } + + if !inKeyword.TokenMatches(p.Peek()) { + if !p.recovery { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid 'for' expression", + Detail: "For expression requires the 'in' keyword after its name declarations.", + Subject: p.Peek().Range.Ptr(), + Context: hcl.RangeBetween(open.Range, p.Peek().Range).Ptr(), + }) + } + close := p.recover(closeType) + return &LiteralValueExpr{ + Val: cty.DynamicVal, + SrcRange: hcl.RangeBetween(open.Range, close.Range), + }, diags + } + p.Read() // eat 'in' keyword + + collExpr, collDiags := p.ParseExpression() + diags = append(diags, collDiags...) + if p.recovery && collDiags.HasErrors() { + close := p.recover(closeType) + return &LiteralValueExpr{ + Val: cty.DynamicVal, + SrcRange: hcl.RangeBetween(open.Range, close.Range), + }, diags + } + + if p.Peek().Type != TokenColon { + if !p.recovery { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid 'for' expression", + Detail: "For expression requires a colon after the collection expression.", + Subject: p.Peek().Range.Ptr(), + Context: hcl.RangeBetween(open.Range, p.Peek().Range).Ptr(), + }) + } + close := p.recover(closeType) + return &LiteralValueExpr{ + Val: cty.DynamicVal, + SrcRange: hcl.RangeBetween(open.Range, close.Range), + }, diags + } + p.Read() // eat colon + + var keyExpr, valExpr Expression + var keyDiags, valDiags hcl.Diagnostics + valExpr, valDiags = p.ParseExpression() + if p.Peek().Type == TokenFatArrow { + // What we just parsed was actually keyExpr + p.Read() // eat the fat arrow + keyExpr, keyDiags = valExpr, valDiags + + valExpr, valDiags = p.ParseExpression() + } + diags = append(diags, keyDiags...) + diags = append(diags, valDiags...) + if p.recovery && (keyDiags.HasErrors() || valDiags.HasErrors()) { + close := p.recover(closeType) + return &LiteralValueExpr{ + Val: cty.DynamicVal, + SrcRange: hcl.RangeBetween(open.Range, close.Range), + }, diags + } + + group := false + var ellipsis Token + if p.Peek().Type == TokenEllipsis { + ellipsis = p.Read() + group = true + } + + var condExpr Expression + var condDiags hcl.Diagnostics + if ifKeyword.TokenMatches(p.Peek()) { + p.Read() // eat "if" + condExpr, condDiags = p.ParseExpression() + diags = append(diags, condDiags...) + if p.recovery && condDiags.HasErrors() { + close := p.recover(p.oppositeBracket(open.Type)) + return &LiteralValueExpr{ + Val: cty.DynamicVal, + SrcRange: hcl.RangeBetween(open.Range, close.Range), + }, diags + } + } + + var close Token + if p.Peek().Type == closeType { + close = p.Read() + } else { + if !p.recovery { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid 'for' expression", + Detail: "Extra characters after the end of the 'for' expression.", + Subject: p.Peek().Range.Ptr(), + Context: hcl.RangeBetween(open.Range, p.Peek().Range).Ptr(), + }) + } + close = p.recover(closeType) + } + + if !makeObj { + if keyExpr != nil { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid 'for' expression", + Detail: "Key expression is not valid when building a tuple.", + Subject: keyExpr.Range().Ptr(), + Context: hcl.RangeBetween(open.Range, close.Range).Ptr(), + }) + } + + if group { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid 'for' expression", + Detail: "Grouping ellipsis (...) cannot be used when building a tuple.", + Subject: &ellipsis.Range, + Context: hcl.RangeBetween(open.Range, close.Range).Ptr(), + }) + } + } else { + if keyExpr == nil { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid 'for' expression", + Detail: "Key expression is required when building an object.", + Subject: valExpr.Range().Ptr(), + Context: hcl.RangeBetween(open.Range, close.Range).Ptr(), + }) + } + } + + return &ForExpr{ + KeyVar: keyName, + ValVar: valName, + CollExpr: collExpr, + KeyExpr: keyExpr, + ValExpr: valExpr, + CondExpr: condExpr, + Group: group, + + SrcRange: hcl.RangeBetween(open.Range, close.Range), + OpenRange: open.Range, + CloseRange: close.Range, + }, diags +} + +// parseQuotedStringLiteral is a helper for parsing quoted strings that +// aren't allowed to contain any interpolations, such as block labels. +func (p *parser) parseQuotedStringLiteral() (string, hcl.Range, hcl.Diagnostics) { + oQuote := p.Read() + if oQuote.Type != TokenOQuote { + return "", oQuote.Range, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Invalid string literal", + Detail: "A quoted string is required here.", + Subject: &oQuote.Range, + }, + } + } + + var diags hcl.Diagnostics + ret := &bytes.Buffer{} + var cQuote Token + +Token: + for { + tok := p.Read() + switch tok.Type { + + case TokenCQuote: + cQuote = tok + break Token + + case TokenQuotedLit: + s, sDiags := ParseStringLiteralToken(tok) + diags = append(diags, sDiags...) + ret.WriteString(s) + + case TokenTemplateControl, TokenTemplateInterp: + which := "$" + if tok.Type == TokenTemplateControl { + which = "%" + } + + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid string literal", + Detail: fmt.Sprintf( + "Template sequences are not allowed in this string. To include a literal %q, double it (as \"%s%s\") to escape it.", + which, which, which, + ), + Subject: &tok.Range, + Context: hcl.RangeBetween(oQuote.Range, tok.Range).Ptr(), + }) + + // Now that we're returning an error callers won't attempt to use + // the result for any real operations, but they might try to use + // the partial AST for other analyses, so we'll leave a marker + // to indicate that there was something invalid in the string to + // help avoid misinterpretation of the partial result + ret.WriteString(which) + ret.WriteString("{ ... }") + + p.recover(TokenTemplateSeqEnd) // we'll try to keep parsing after the sequence ends + + case TokenEOF: + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Unterminated string literal", + Detail: "Unable to find the closing quote mark before the end of the file.", + Subject: &tok.Range, + Context: hcl.RangeBetween(oQuote.Range, tok.Range).Ptr(), + }) + break Token + + default: + // Should never happen, as long as the scanner is behaving itself + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid string literal", + Detail: "This item is not valid in a string literal.", + Subject: &tok.Range, + Context: hcl.RangeBetween(oQuote.Range, tok.Range).Ptr(), + }) + p.recover(TokenCQuote) + break Token + + } + + } + + return ret.String(), hcl.RangeBetween(oQuote.Range, cQuote.Range), diags +} + +// ParseStringLiteralToken processes the given token, which must be either a +// TokenQuotedLit or a TokenStringLit, returning the string resulting from +// resolving any escape sequences. +// +// If any error diagnostics are returned, the returned string may be incomplete +// or otherwise invalid. +func ParseStringLiteralToken(tok Token) (string, hcl.Diagnostics) { + var quoted bool + switch tok.Type { + case TokenQuotedLit: + quoted = true + case TokenStringLit: + quoted = false + default: + panic("ParseStringLiteralToken can only be used with TokenStringLit and TokenQuotedLit tokens") + } + var diags hcl.Diagnostics + + ret := make([]byte, 0, len(tok.Bytes)) + slices := scanStringLit(tok.Bytes, quoted) + + // We will mutate rng constantly as we walk through our token slices below. + // Any diagnostics must take a copy of this rng rather than simply pointing + // to it, e.g. by using rng.Ptr() rather than &rng. + rng := tok.Range + rng.End = rng.Start + +Slices: + for _, slice := range slices { + if len(slice) == 0 { + continue + } + + // Advance the start of our range to where the previous token ended + rng.Start = rng.End + + // Advance the end of our range to after our token. + b := slice + for len(b) > 0 { + adv, ch, _ := textseg.ScanGraphemeClusters(b, true) + rng.End.Byte += adv + switch ch[0] { + case '\r', '\n': + rng.End.Line++ + rng.End.Column = 1 + default: + rng.End.Column++ + } + b = b[adv:] + } + + TokenType: + switch slice[0] { + case '\\': + if !quoted { + // If we're not in quoted mode then just treat this token as + // normal. (Slices can still start with backslash even if we're + // not specifically looking for backslash sequences.) + break TokenType + } + if len(slice) < 2 { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid escape sequence", + Detail: "Backslash must be followed by an escape sequence selector character.", + Subject: rng.Ptr(), + }) + break TokenType + } + + switch slice[1] { + + case 'n': + ret = append(ret, '\n') + continue Slices + case 'r': + ret = append(ret, '\r') + continue Slices + case 't': + ret = append(ret, '\t') + continue Slices + case '"': + ret = append(ret, '"') + continue Slices + case '\\': + ret = append(ret, '\\') + continue Slices + case 'u', 'U': + if slice[1] == 'u' && len(slice) != 6 { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid escape sequence", + Detail: "The \\u escape sequence must be followed by four hexadecimal digits.", + Subject: rng.Ptr(), + }) + break TokenType + } else if slice[1] == 'U' && len(slice) != 10 { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid escape sequence", + Detail: "The \\U escape sequence must be followed by eight hexadecimal digits.", + Subject: rng.Ptr(), + }) + break TokenType + } + + numHex := string(slice[2:]) + num, err := strconv.ParseUint(numHex, 16, 32) + if err != nil { + // Should never happen because the scanner won't match + // a sequence of digits that isn't valid. + panic(err) + } + + r := rune(num) + l := utf8.RuneLen(r) + if l == -1 { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid escape sequence", + Detail: fmt.Sprintf("Cannot encode character U+%04x in UTF-8.", num), + Subject: rng.Ptr(), + }) + break TokenType + } + for i := 0; i < l; i++ { + ret = append(ret, 0) + } + rb := ret[len(ret)-l:] + utf8.EncodeRune(rb, r) + + continue Slices + + default: + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid escape sequence", + Detail: fmt.Sprintf("The symbol %q is not a valid escape sequence selector.", slice[1:]), + Subject: rng.Ptr(), + }) + ret = append(ret, slice[1:]...) + continue Slices + } + + case '$', '%': + if len(slice) != 3 { + // Not long enough to be our escape sequence, so it's literal. + break TokenType + } + + if slice[1] == slice[0] && slice[2] == '{' { + ret = append(ret, slice[0]) + ret = append(ret, '{') + continue Slices + } + + break TokenType + } + + // If we fall out here or break out of here from the switch above + // then this slice is just a literal. + ret = append(ret, slice...) + } + + return string(ret), diags +} + +// setRecovery turns on recovery mode without actually doing any recovery. +// This can be used when a parser knowingly leaves the peeker in a useless +// place and wants to suppress errors that might result from that decision. +func (p *parser) setRecovery() { + p.recovery = true +} + +// recover seeks forward in the token stream until it finds TokenType "end", +// then returns with the peeker pointed at the following token. +// +// If the given token type is a bracketer, this function will additionally +// count nested instances of the brackets to try to leave the peeker at +// the end of the _current_ instance of that bracketer, skipping over any +// nested instances. This is a best-effort operation and may have +// unpredictable results on input with bad bracketer nesting. +func (p *parser) recover(end TokenType) Token { + start := p.oppositeBracket(end) + p.recovery = true + + nest := 0 + for { + tok := p.Read() + ty := tok.Type + if end == TokenTemplateSeqEnd && ty == TokenTemplateControl { + // normalize so that our matching behavior can work, since + // TokenTemplateControl/TokenTemplateInterp are asymmetrical + // with TokenTemplateSeqEnd and thus we need to count both + // openers if that's the closer we're looking for. + ty = TokenTemplateInterp + } + + switch ty { + case start: + nest++ + case end: + if nest < 1 { + return tok + } + + nest-- + case TokenEOF: + return tok + } + } +} + +// recoverOver seeks forward in the token stream until it finds a block +// starting with TokenType "start", then finds the corresponding end token, +// leaving the peeker pointed at the token after that end token. +// +// The given token type _must_ be a bracketer. For example, if the given +// start token is TokenOBrace then the parser will be left at the _end_ of +// the next brace-delimited block encountered, or at EOF if no such block +// is found or it is unclosed. +func (p *parser) recoverOver(start TokenType) { + end := p.oppositeBracket(start) + + // find the opening bracket first +Token: + for { + tok := p.Read() + switch tok.Type { + case start, TokenEOF: + break Token + } + } + + // Now use our existing recover function to locate the _end_ of the + // container we've found. + p.recover(end) +} + +func (p *parser) recoverAfterBodyItem() { + p.recovery = true + var open []TokenType + +Token: + for { + tok := p.Read() + + switch tok.Type { + + case TokenNewline: + if len(open) == 0 { + break Token + } + + case TokenEOF: + break Token + + case TokenOBrace, TokenOBrack, TokenOParen, TokenOQuote, TokenOHeredoc, TokenTemplateInterp, TokenTemplateControl: + open = append(open, tok.Type) + + case TokenCBrace, TokenCBrack, TokenCParen, TokenCQuote, TokenCHeredoc: + opener := p.oppositeBracket(tok.Type) + for len(open) > 0 && open[len(open)-1] != opener { + open = open[:len(open)-1] + } + if len(open) > 0 { + open = open[:len(open)-1] + } + + case TokenTemplateSeqEnd: + for len(open) > 0 && open[len(open)-1] != TokenTemplateInterp && open[len(open)-1] != TokenTemplateControl { + open = open[:len(open)-1] + } + if len(open) > 0 { + open = open[:len(open)-1] + } + + } + } +} + +// oppositeBracket finds the bracket that opposes the given bracketer, or +// NilToken if the given token isn't a bracketer. +// +// "Bracketer", for the sake of this function, is one end of a matching +// open/close set of tokens that establish a bracketing context. +func (p *parser) oppositeBracket(ty TokenType) TokenType { + switch ty { + + case TokenOBrace: + return TokenCBrace + case TokenOBrack: + return TokenCBrack + case TokenOParen: + return TokenCParen + case TokenOQuote: + return TokenCQuote + case TokenOHeredoc: + return TokenCHeredoc + + case TokenCBrace: + return TokenOBrace + case TokenCBrack: + return TokenOBrack + case TokenCParen: + return TokenOParen + case TokenCQuote: + return TokenOQuote + case TokenCHeredoc: + return TokenOHeredoc + + case TokenTemplateControl: + return TokenTemplateSeqEnd + case TokenTemplateInterp: + return TokenTemplateSeqEnd + case TokenTemplateSeqEnd: + // This is ambigous, but we return Interp here because that's + // what's assumed by the "recover" method. + return TokenTemplateInterp + + default: + return TokenNil + } +} + +func errPlaceholderExpr(rng hcl.Range) Expression { + return &LiteralValueExpr{ + Val: cty.DynamicVal, + SrcRange: rng, + } +} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser_template.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_template.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser_template.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_template.go index a141626fe91..eb8f7ea38cc 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser_template.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_template.go @@ -6,7 +6,7 @@ import ( "unicode" "github.com/apparentlymart/go-textseg/textseg" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) @@ -383,7 +383,7 @@ Token: switch next.Type { case TokenStringLit, TokenQuotedLit: - str, strDiags := p.decodeStringLit(next) + str, strDiags := ParseStringLiteralToken(next) diags = append(diags, strDiags...) if ltrim { diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser_traversal.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_traversal.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser_traversal.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_traversal.go index 2ff3ed6c1a1..7dcb0fd3414 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser_traversal.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/parser_traversal.go @@ -1,7 +1,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/peeker.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/peeker.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/peeker.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/peeker.go index 5a4b50e2fc5..f056f906e39 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/peeker.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/peeker.go @@ -7,7 +7,7 @@ import ( "runtime" "strings" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // This is set to true at init() time in tests, to enable more useful output diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/public.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/public.go new file mode 100644 index 00000000000..0b68efd6003 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/public.go @@ -0,0 +1,171 @@ +package hclsyntax + +import ( + "github.com/hashicorp/hcl/v2" +) + +// ParseConfig parses the given buffer as a whole HCL config file, returning +// a *hcl.File representing its contents. If HasErrors called on the returned +// diagnostics returns true, the returned body is likely to be incomplete +// and should therefore be used with care. +// +// The body in the returned file has dynamic type *hclsyntax.Body, so callers +// may freely type-assert this to get access to the full hclsyntax API in +// situations where detailed access is required. However, most common use-cases +// should be served using the hcl.Body interface to ensure compatibility with +// other configurationg syntaxes, such as JSON. +func ParseConfig(src []byte, filename string, start hcl.Pos) (*hcl.File, hcl.Diagnostics) { + tokens, diags := LexConfig(src, filename, start) + peeker := newPeeker(tokens, false) + parser := &parser{peeker: peeker} + body, parseDiags := parser.ParseBody(TokenEOF) + diags = append(diags, parseDiags...) + + // Panic if the parser uses incorrect stack discipline with the peeker's + // newlines stack, since otherwise it will produce confusing downstream + // errors. + peeker.AssertEmptyIncludeNewlinesStack() + + return &hcl.File{ + Body: body, + Bytes: src, + + Nav: navigation{ + root: body, + }, + }, diags +} + +// ParseExpression parses the given buffer as a standalone HCL expression, +// returning it as an instance of Expression. +func ParseExpression(src []byte, filename string, start hcl.Pos) (Expression, hcl.Diagnostics) { + tokens, diags := LexExpression(src, filename, start) + peeker := newPeeker(tokens, false) + parser := &parser{peeker: peeker} + + // Bare expressions are always parsed in "ignore newlines" mode, as if + // they were wrapped in parentheses. + parser.PushIncludeNewlines(false) + + expr, parseDiags := parser.ParseExpression() + diags = append(diags, parseDiags...) + + next := parser.Peek() + if next.Type != TokenEOF && !parser.recovery { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Extra characters after expression", + Detail: "An expression was successfully parsed, but extra characters were found after it.", + Subject: &next.Range, + }) + } + + parser.PopIncludeNewlines() + + // Panic if the parser uses incorrect stack discipline with the peeker's + // newlines stack, since otherwise it will produce confusing downstream + // errors. + peeker.AssertEmptyIncludeNewlinesStack() + + return expr, diags +} + +// ParseTemplate parses the given buffer as a standalone HCL template, +// returning it as an instance of Expression. +func ParseTemplate(src []byte, filename string, start hcl.Pos) (Expression, hcl.Diagnostics) { + tokens, diags := LexTemplate(src, filename, start) + peeker := newPeeker(tokens, false) + parser := &parser{peeker: peeker} + expr, parseDiags := parser.ParseTemplate() + diags = append(diags, parseDiags...) + + // Panic if the parser uses incorrect stack discipline with the peeker's + // newlines stack, since otherwise it will produce confusing downstream + // errors. + peeker.AssertEmptyIncludeNewlinesStack() + + return expr, diags +} + +// ParseTraversalAbs parses the given buffer as a standalone absolute traversal. +// +// Parsing as a traversal is more limited than parsing as an expession since +// it allows only attribute and indexing operations on variables. Traverals +// are useful as a syntax for referring to objects without necessarily +// evaluating them. +func ParseTraversalAbs(src []byte, filename string, start hcl.Pos) (hcl.Traversal, hcl.Diagnostics) { + tokens, diags := LexExpression(src, filename, start) + peeker := newPeeker(tokens, false) + parser := &parser{peeker: peeker} + + // Bare traverals are always parsed in "ignore newlines" mode, as if + // they were wrapped in parentheses. + parser.PushIncludeNewlines(false) + + expr, parseDiags := parser.ParseTraversalAbs() + diags = append(diags, parseDiags...) + + parser.PopIncludeNewlines() + + // Panic if the parser uses incorrect stack discipline with the peeker's + // newlines stack, since otherwise it will produce confusing downstream + // errors. + peeker.AssertEmptyIncludeNewlinesStack() + + return expr, diags +} + +// LexConfig performs lexical analysis on the given buffer, treating it as a +// whole HCL config file, and returns the resulting tokens. +// +// Only minimal validation is done during lexical analysis, so the returned +// diagnostics may include errors about lexical issues such as bad character +// encodings or unrecognized characters, but full parsing is required to +// detect _all_ syntax errors. +func LexConfig(src []byte, filename string, start hcl.Pos) (Tokens, hcl.Diagnostics) { + tokens := scanTokens(src, filename, start, scanNormal) + diags := checkInvalidTokens(tokens) + return tokens, diags +} + +// LexExpression performs lexical analysis on the given buffer, treating it as +// a standalone HCL expression, and returns the resulting tokens. +// +// Only minimal validation is done during lexical analysis, so the returned +// diagnostics may include errors about lexical issues such as bad character +// encodings or unrecognized characters, but full parsing is required to +// detect _all_ syntax errors. +func LexExpression(src []byte, filename string, start hcl.Pos) (Tokens, hcl.Diagnostics) { + // This is actually just the same thing as LexConfig, since configs + // and expressions lex in the same way. + tokens := scanTokens(src, filename, start, scanNormal) + diags := checkInvalidTokens(tokens) + return tokens, diags +} + +// LexTemplate performs lexical analysis on the given buffer, treating it as a +// standalone HCL template, and returns the resulting tokens. +// +// Only minimal validation is done during lexical analysis, so the returned +// diagnostics may include errors about lexical issues such as bad character +// encodings or unrecognized characters, but full parsing is required to +// detect _all_ syntax errors. +func LexTemplate(src []byte, filename string, start hcl.Pos) (Tokens, hcl.Diagnostics) { + tokens := scanTokens(src, filename, start, scanTemplate) + diags := checkInvalidTokens(tokens) + return tokens, diags +} + +// ValidIdentifier tests if the given string could be a valid identifier in +// a native syntax expression. +// +// This is useful when accepting names from the user that will be used as +// variable or attribute names in the scope, to ensure that any name chosen +// will be traversable using the variable or attribute traversal syntax. +func ValidIdentifier(s string) bool { + // This is a kinda-expensive way to do something pretty simple, but it + // is easiest to do with our existing scanner-related infrastructure here + // and nobody should be validating identifiers in a tight loop. + tokens := scanTokens([]byte(s), "", hcl.Pos{}, scanIdentOnly) + return len(tokens) == 2 && tokens[0].Type == TokenIdent && tokens[1].Type == TokenEOF +} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_string_lit.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_string_lit.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_string_lit.rl b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.rl similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_string_lit.rl rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_string_lit.rl diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_tokens.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_tokens.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.go index 581e35e00a9..794123a8517 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_tokens.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.go @@ -5,7 +5,7 @@ package hclsyntax import ( "bytes" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // This file is generated from scan_tokens.rl. DO NOT EDIT. diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_tokens.rl b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.rl similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_tokens.rl rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.rl index 4443dc48087..942ad92ba1e 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/scan_tokens.rl +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/scan_tokens.rl @@ -4,7 +4,7 @@ package hclsyntax import ( "bytes" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // This file is generated from scan_tokens.rl. DO NOT EDIT. diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/spec.md b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md similarity index 97% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/spec.md rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md index d7faeedcef4..3fc5f5f1bfc 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/spec.md +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/spec.md @@ -71,14 +71,13 @@ except as described below. Whitespace is defined as a sequence of zero or more space characters (U+0020). Newline sequences (either U+000A or U+000D followed by U+000A) are _not_ considered whitespace but are ignored as such in certain contexts. - -Horizontal tab characters (U+0009) are not considered to be whitespace and -are not valid within HCL native syntax. +Horizontal tab characters (U+0009) are also treated as whitespace, but are +counted only as one "column" for the purpose of reporting source positions. Comments serve as program documentation and come in two forms: - _Line comments_ start with either the `//` or `#` sequences and end with - the next newline sequence. A line comments is considered equivalent to a + the next newline sequence. A line comment is considered equivalent to a newline sequence. - _Inline comments_ start with the `/*` sequence and end with the `*/` @@ -543,6 +542,22 @@ return type. Within the brackets that delimit the index key, newline sequences are ignored as whitespace. +The HCL native syntax also includes a _legacy_ index operator that exists +only for compatibility with the precursor language HIL: + +```ebnf +LegacyIndex = '.' digit+ +``` + +This legacy index operator must be supported by parser for compatibility but +should not be used in new configurations. This allows an attribute-access-like +syntax for indexing, must still be interpreted as an index operation rather +than attribute access. + +The legacy syntax does not support chaining of index operations, like +`foo.0.0.bar`, because the interpretation of `0.0` as a number literal token +takes priority and thus renders the resulting sequence invalid. + ### Attribute Access Operator The _attribute access_ operator returns the value of a single attribute in diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/structure.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/structure.go new file mode 100644 index 00000000000..2f7470c7724 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/structure.go @@ -0,0 +1,394 @@ +package hclsyntax + +import ( + "fmt" + "strings" + + "github.com/hashicorp/hcl/v2" +) + +// AsHCLBlock returns the block data expressed as a *hcl.Block. +func (b *Block) AsHCLBlock() *hcl.Block { + if b == nil { + return nil + } + + lastHeaderRange := b.TypeRange + if len(b.LabelRanges) > 0 { + lastHeaderRange = b.LabelRanges[len(b.LabelRanges)-1] + } + + return &hcl.Block{ + Type: b.Type, + Labels: b.Labels, + Body: b.Body, + + DefRange: hcl.RangeBetween(b.TypeRange, lastHeaderRange), + TypeRange: b.TypeRange, + LabelRanges: b.LabelRanges, + } +} + +// Body is the implementation of hcl.Body for the HCL native syntax. +type Body struct { + Attributes Attributes + Blocks Blocks + + // These are used with PartialContent to produce a "remaining items" + // body to return. They are nil on all bodies fresh out of the parser. + hiddenAttrs map[string]struct{} + hiddenBlocks map[string]struct{} + + SrcRange hcl.Range + EndRange hcl.Range // Final token of the body, for reporting missing items +} + +// Assert that *Body implements hcl.Body +var assertBodyImplBody hcl.Body = &Body{} + +func (b *Body) walkChildNodes(w internalWalkFunc) { + w(b.Attributes) + w(b.Blocks) +} + +func (b *Body) Range() hcl.Range { + return b.SrcRange +} + +func (b *Body) Content(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Diagnostics) { + content, remainHCL, diags := b.PartialContent(schema) + + // No we'll see if anything actually remains, to produce errors about + // extraneous items. + remain := remainHCL.(*Body) + + for name, attr := range b.Attributes { + if _, hidden := remain.hiddenAttrs[name]; !hidden { + var suggestions []string + for _, attrS := range schema.Attributes { + if _, defined := content.Attributes[attrS.Name]; defined { + continue + } + suggestions = append(suggestions, attrS.Name) + } + suggestion := nameSuggestion(name, suggestions) + if suggestion != "" { + suggestion = fmt.Sprintf(" Did you mean %q?", suggestion) + } else { + // Is there a block of the same name? + for _, blockS := range schema.Blocks { + if blockS.Type == name { + suggestion = fmt.Sprintf(" Did you mean to define a block of type %q?", name) + break + } + } + } + + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Unsupported argument", + Detail: fmt.Sprintf("An argument named %q is not expected here.%s", name, suggestion), + Subject: &attr.NameRange, + }) + } + } + + for _, block := range b.Blocks { + blockTy := block.Type + if _, hidden := remain.hiddenBlocks[blockTy]; !hidden { + var suggestions []string + for _, blockS := range schema.Blocks { + suggestions = append(suggestions, blockS.Type) + } + suggestion := nameSuggestion(blockTy, suggestions) + if suggestion != "" { + suggestion = fmt.Sprintf(" Did you mean %q?", suggestion) + } else { + // Is there an attribute of the same name? + for _, attrS := range schema.Attributes { + if attrS.Name == blockTy { + suggestion = fmt.Sprintf(" Did you mean to define argument %q? If so, use the equals sign to assign it a value.", blockTy) + break + } + } + } + + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Unsupported block type", + Detail: fmt.Sprintf("Blocks of type %q are not expected here.%s", blockTy, suggestion), + Subject: &block.TypeRange, + }) + } + } + + return content, diags +} + +func (b *Body) PartialContent(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Body, hcl.Diagnostics) { + attrs := make(hcl.Attributes) + var blocks hcl.Blocks + var diags hcl.Diagnostics + hiddenAttrs := make(map[string]struct{}) + hiddenBlocks := make(map[string]struct{}) + + if b.hiddenAttrs != nil { + for k, v := range b.hiddenAttrs { + hiddenAttrs[k] = v + } + } + if b.hiddenBlocks != nil { + for k, v := range b.hiddenBlocks { + hiddenBlocks[k] = v + } + } + + for _, attrS := range schema.Attributes { + name := attrS.Name + attr, exists := b.Attributes[name] + _, hidden := hiddenAttrs[name] + if hidden || !exists { + if attrS.Required { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing required argument", + Detail: fmt.Sprintf("The argument %q is required, but no definition was found.", attrS.Name), + Subject: b.MissingItemRange().Ptr(), + }) + } + continue + } + + hiddenAttrs[name] = struct{}{} + attrs[name] = attr.AsHCLAttribute() + } + + blocksWanted := make(map[string]hcl.BlockHeaderSchema) + for _, blockS := range schema.Blocks { + blocksWanted[blockS.Type] = blockS + } + + for _, block := range b.Blocks { + if _, hidden := hiddenBlocks[block.Type]; hidden { + continue + } + blockS, wanted := blocksWanted[block.Type] + if !wanted { + continue + } + + if len(block.Labels) > len(blockS.LabelNames) { + name := block.Type + if len(blockS.LabelNames) == 0 { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: fmt.Sprintf("Extraneous label for %s", name), + Detail: fmt.Sprintf( + "No labels are expected for %s blocks.", name, + ), + Subject: block.LabelRanges[0].Ptr(), + Context: hcl.RangeBetween(block.TypeRange, block.OpenBraceRange).Ptr(), + }) + } else { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: fmt.Sprintf("Extraneous label for %s", name), + Detail: fmt.Sprintf( + "Only %d labels (%s) are expected for %s blocks.", + len(blockS.LabelNames), strings.Join(blockS.LabelNames, ", "), name, + ), + Subject: block.LabelRanges[len(blockS.LabelNames)].Ptr(), + Context: hcl.RangeBetween(block.TypeRange, block.OpenBraceRange).Ptr(), + }) + } + continue + } + + if len(block.Labels) < len(blockS.LabelNames) { + name := block.Type + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: fmt.Sprintf("Missing %s for %s", blockS.LabelNames[len(block.Labels)], name), + Detail: fmt.Sprintf( + "All %s blocks must have %d labels (%s).", + name, len(blockS.LabelNames), strings.Join(blockS.LabelNames, ", "), + ), + Subject: &block.OpenBraceRange, + Context: hcl.RangeBetween(block.TypeRange, block.OpenBraceRange).Ptr(), + }) + continue + } + + blocks = append(blocks, block.AsHCLBlock()) + } + + // We hide blocks only after we've processed all of them, since otherwise + // we can't process more than one of the same type. + for _, blockS := range schema.Blocks { + hiddenBlocks[blockS.Type] = struct{}{} + } + + remain := &Body{ + Attributes: b.Attributes, + Blocks: b.Blocks, + + hiddenAttrs: hiddenAttrs, + hiddenBlocks: hiddenBlocks, + + SrcRange: b.SrcRange, + EndRange: b.EndRange, + } + + return &hcl.BodyContent{ + Attributes: attrs, + Blocks: blocks, + + MissingItemRange: b.MissingItemRange(), + }, remain, diags +} + +func (b *Body) JustAttributes() (hcl.Attributes, hcl.Diagnostics) { + attrs := make(hcl.Attributes) + var diags hcl.Diagnostics + + if len(b.Blocks) > 0 { + example := b.Blocks[0] + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: fmt.Sprintf("Unexpected %q block", example.Type), + Detail: "Blocks are not allowed here.", + Subject: &example.TypeRange, + }) + // we will continue processing anyway, and return the attributes + // we are able to find so that certain analyses can still be done + // in the face of errors. + } + + if b.Attributes == nil { + return attrs, diags + } + + for name, attr := range b.Attributes { + if _, hidden := b.hiddenAttrs[name]; hidden { + continue + } + attrs[name] = attr.AsHCLAttribute() + } + + return attrs, diags +} + +func (b *Body) MissingItemRange() hcl.Range { + return hcl.Range{ + Filename: b.SrcRange.Filename, + Start: b.SrcRange.Start, + End: b.SrcRange.Start, + } +} + +// Attributes is the collection of attribute definitions within a body. +type Attributes map[string]*Attribute + +func (a Attributes) walkChildNodes(w internalWalkFunc) { + for _, attr := range a { + w(attr) + } +} + +// Range returns the range of some arbitrary point within the set of +// attributes, or an invalid range if there are no attributes. +// +// This is provided only to complete the Node interface, but has no practical +// use. +func (a Attributes) Range() hcl.Range { + // An attributes doesn't really have a useful range to report, since + // it's just a grouping construct. So we'll arbitrarily take the + // range of one of the attributes, or produce an invalid range if we have + // none. In practice, there's little reason to ask for the range of + // an Attributes. + for _, attr := range a { + return attr.Range() + } + return hcl.Range{ + Filename: "", + } +} + +// Attribute represents a single attribute definition within a body. +type Attribute struct { + Name string + Expr Expression + + SrcRange hcl.Range + NameRange hcl.Range + EqualsRange hcl.Range +} + +func (a *Attribute) walkChildNodes(w internalWalkFunc) { + w(a.Expr) +} + +func (a *Attribute) Range() hcl.Range { + return a.SrcRange +} + +// AsHCLAttribute returns the block data expressed as a *hcl.Attribute. +func (a *Attribute) AsHCLAttribute() *hcl.Attribute { + if a == nil { + return nil + } + return &hcl.Attribute{ + Name: a.Name, + Expr: a.Expr, + + Range: a.SrcRange, + NameRange: a.NameRange, + } +} + +// Blocks is the list of nested blocks within a body. +type Blocks []*Block + +func (bs Blocks) walkChildNodes(w internalWalkFunc) { + for _, block := range bs { + w(block) + } +} + +// Range returns the range of some arbitrary point within the list of +// blocks, or an invalid range if there are no blocks. +// +// This is provided only to complete the Node interface, but has no practical +// use. +func (bs Blocks) Range() hcl.Range { + if len(bs) > 0 { + return bs[0].Range() + } + return hcl.Range{ + Filename: "", + } +} + +// Block represents a nested block structure +type Block struct { + Type string + Labels []string + Body *Body + + TypeRange hcl.Range + LabelRanges []hcl.Range + OpenBraceRange hcl.Range + CloseBraceRange hcl.Range +} + +func (b *Block) walkChildNodes(w internalWalkFunc) { + w(b.Body) +} + +func (b *Block) Range() hcl.Range { + return hcl.RangeBetween(b.TypeRange, b.CloseBraceRange) +} + +func (b *Block) DefRange() hcl.Range { + return hcl.RangeBetween(b.TypeRange, b.OpenBraceRange) +} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/structure_at_pos.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/structure_at_pos.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/structure_at_pos.go rename to vendor/github.com/hashicorp/hcl/v2/hclsyntax/structure_at_pos.go index d8f023ba052..587844ac20b 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/structure_at_pos.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/structure_at_pos.go @@ -1,7 +1,7 @@ package hclsyntax import ( - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) // ----------------------------------------------------------------------------- diff --git a/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go new file mode 100644 index 00000000000..c7ffe207381 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hclsyntax/token.go @@ -0,0 +1,320 @@ +package hclsyntax + +import ( + "bytes" + "fmt" + + "github.com/apparentlymart/go-textseg/textseg" + "github.com/hashicorp/hcl/v2" +) + +// Token represents a sequence of bytes from some HCL code that has been +// tagged with a type and its range within the source file. +type Token struct { + Type TokenType + Bytes []byte + Range hcl.Range +} + +// Tokens is a slice of Token. +type Tokens []Token + +// TokenType is an enumeration used for the Type field on Token. +type TokenType rune + +const ( + // Single-character tokens are represented by their own character, for + // convenience in producing these within the scanner. However, the values + // are otherwise arbitrary and just intended to be mnemonic for humans + // who might see them in debug output. + + TokenOBrace TokenType = '{' + TokenCBrace TokenType = '}' + TokenOBrack TokenType = '[' + TokenCBrack TokenType = ']' + TokenOParen TokenType = '(' + TokenCParen TokenType = ')' + TokenOQuote TokenType = '«' + TokenCQuote TokenType = '»' + TokenOHeredoc TokenType = 'H' + TokenCHeredoc TokenType = 'h' + + TokenStar TokenType = '*' + TokenSlash TokenType = '/' + TokenPlus TokenType = '+' + TokenMinus TokenType = '-' + TokenPercent TokenType = '%' + + TokenEqual TokenType = '=' + TokenEqualOp TokenType = '≔' + TokenNotEqual TokenType = '≠' + TokenLessThan TokenType = '<' + TokenLessThanEq TokenType = '≤' + TokenGreaterThan TokenType = '>' + TokenGreaterThanEq TokenType = '≥' + + TokenAnd TokenType = '∧' + TokenOr TokenType = '∨' + TokenBang TokenType = '!' + + TokenDot TokenType = '.' + TokenComma TokenType = ',' + + TokenEllipsis TokenType = '…' + TokenFatArrow TokenType = '⇒' + + TokenQuestion TokenType = '?' + TokenColon TokenType = ':' + + TokenTemplateInterp TokenType = '∫' + TokenTemplateControl TokenType = 'λ' + TokenTemplateSeqEnd TokenType = '∎' + + TokenQuotedLit TokenType = 'Q' // might contain backslash escapes + TokenStringLit TokenType = 'S' // cannot contain backslash escapes + TokenNumberLit TokenType = 'N' + TokenIdent TokenType = 'I' + + TokenComment TokenType = 'C' + + TokenNewline TokenType = '\n' + TokenEOF TokenType = '␄' + + // The rest are not used in the language but recognized by the scanner so + // we can generate good diagnostics in the parser when users try to write + // things that might work in other languages they are familiar with, or + // simply make incorrect assumptions about the HCL language. + + TokenBitwiseAnd TokenType = '&' + TokenBitwiseOr TokenType = '|' + TokenBitwiseNot TokenType = '~' + TokenBitwiseXor TokenType = '^' + TokenStarStar TokenType = '➚' + TokenApostrophe TokenType = '\'' + TokenBacktick TokenType = '`' + TokenSemicolon TokenType = ';' + TokenTabs TokenType = '␉' + TokenInvalid TokenType = '�' + TokenBadUTF8 TokenType = '💩' + TokenQuotedNewline TokenType = '␤' + + // TokenNil is a placeholder for when a token is required but none is + // available, e.g. when reporting errors. The scanner will never produce + // this as part of a token stream. + TokenNil TokenType = '\x00' +) + +func (t TokenType) GoString() string { + return fmt.Sprintf("hclsyntax.%s", t.String()) +} + +type scanMode int + +const ( + scanNormal scanMode = iota + scanTemplate + scanIdentOnly +) + +type tokenAccum struct { + Filename string + Bytes []byte + Pos hcl.Pos + Tokens []Token + StartByte int +} + +func (f *tokenAccum) emitToken(ty TokenType, startOfs, endOfs int) { + // Walk through our buffer to figure out how much we need to adjust + // the start pos to get our end pos. + + start := f.Pos + start.Column += startOfs + f.StartByte - f.Pos.Byte // Safe because only ASCII spaces can be in the offset + start.Byte = startOfs + f.StartByte + + end := start + end.Byte = endOfs + f.StartByte + b := f.Bytes[startOfs:endOfs] + for len(b) > 0 { + advance, seq, _ := textseg.ScanGraphemeClusters(b, true) + if (len(seq) == 1 && seq[0] == '\n') || (len(seq) == 2 && seq[0] == '\r' && seq[1] == '\n') { + end.Line++ + end.Column = 1 + } else { + end.Column++ + } + b = b[advance:] + } + + f.Pos = end + + f.Tokens = append(f.Tokens, Token{ + Type: ty, + Bytes: f.Bytes[startOfs:endOfs], + Range: hcl.Range{ + Filename: f.Filename, + Start: start, + End: end, + }, + }) +} + +type heredocInProgress struct { + Marker []byte + StartOfLine bool +} + +func tokenOpensFlushHeredoc(tok Token) bool { + if tok.Type != TokenOHeredoc { + return false + } + return bytes.HasPrefix(tok.Bytes, []byte{'<', '<', '-'}) +} + +// checkInvalidTokens does a simple pass across the given tokens and generates +// diagnostics for tokens that should _never_ appear in HCL source. This +// is intended to avoid the need for the parser to have special support +// for them all over. +// +// Returns a diagnostics with no errors if everything seems acceptable. +// Otherwise, returns zero or more error diagnostics, though tries to limit +// repetition of the same information. +func checkInvalidTokens(tokens Tokens) hcl.Diagnostics { + var diags hcl.Diagnostics + + toldBitwise := 0 + toldExponent := 0 + toldBacktick := 0 + toldApostrophe := 0 + toldSemicolon := 0 + toldTabs := 0 + toldBadUTF8 := 0 + + for _, tok := range tokens { + // copy token so it's safe to point to it + tok := tok + + switch tok.Type { + case TokenBitwiseAnd, TokenBitwiseOr, TokenBitwiseXor, TokenBitwiseNot: + if toldBitwise < 4 { + var suggestion string + switch tok.Type { + case TokenBitwiseAnd: + suggestion = " Did you mean boolean AND (\"&&\")?" + case TokenBitwiseOr: + suggestion = " Did you mean boolean OR (\"&&\")?" + case TokenBitwiseNot: + suggestion = " Did you mean boolean NOT (\"!\")?" + } + + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Unsupported operator", + Detail: fmt.Sprintf("Bitwise operators are not supported.%s", suggestion), + Subject: &tok.Range, + }) + toldBitwise++ + } + case TokenStarStar: + if toldExponent < 1 { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Unsupported operator", + Detail: "\"**\" is not a supported operator. Exponentiation is not supported as an operator.", + Subject: &tok.Range, + }) + + toldExponent++ + } + case TokenBacktick: + // Only report for alternating (even) backticks, so we won't report both start and ends of the same + // backtick-quoted string. + if (toldBacktick % 2) == 0 { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid character", + Detail: "The \"`\" character is not valid. To create a multi-line string, use the \"heredoc\" syntax, like \"< 0: + line.lead[0].SpacesBefore = 2 * len(indents) + indents = append(indents, netBrackets) + case netBrackets < 0: + closed := -netBrackets + for closed > 0 && len(indents) > 0 { + switch { + + case closed > indents[len(indents)-1]: + closed -= indents[len(indents)-1] + indents = indents[:len(indents)-1] + + case closed < indents[len(indents)-1]: + indents[len(indents)-1] -= closed + closed = 0 + + default: + indents = indents[:len(indents)-1] + closed = 0 + } + } + line.lead[0].SpacesBefore = 2 * len(indents) + default: + line.lead[0].SpacesBefore = 2 * len(indents) + } + } +} + +func formatSpaces(lines []formatLine) { + for _, line := range lines { + for i, token := range line.lead { + var before, after *Token + if i > 0 { + before = line.lead[i-1] + } else { + before = nilToken + } + if i < (len(line.lead) - 1) { + after = line.lead[i+1] + } else { + after = nilToken + } + if spaceAfterToken(token, before, after) { + after.SpacesBefore = 1 + } else { + after.SpacesBefore = 0 + } + } + for i, token := range line.assign { + if i == 0 { + // first token in "assign" always has one space before to + // separate the equals sign from what it's assigning. + token.SpacesBefore = 1 + } + + var before, after *Token + if i > 0 { + before = line.assign[i-1] + } else { + before = nilToken + } + if i < (len(line.assign) - 1) { + after = line.assign[i+1] + } else { + after = nilToken + } + if spaceAfterToken(token, before, after) { + after.SpacesBefore = 1 + } else { + after.SpacesBefore = 0 + } + } + + } +} + +func formatCells(lines []formatLine) { + + chainStart := -1 + maxColumns := 0 + + // We'll deal with the "assign" cell first, since moving that will + // also impact the "comment" cell. + closeAssignChain := func(i int) { + for _, chainLine := range lines[chainStart:i] { + columns := chainLine.lead.Columns() + spaces := (maxColumns - columns) + 1 + chainLine.assign[0].SpacesBefore = spaces + } + chainStart = -1 + maxColumns = 0 + } + for i, line := range lines { + if line.assign == nil { + if chainStart != -1 { + closeAssignChain(i) + } + } else { + if chainStart == -1 { + chainStart = i + } + columns := line.lead.Columns() + if columns > maxColumns { + maxColumns = columns + } + } + } + if chainStart != -1 { + closeAssignChain(len(lines)) + } + + // Now we'll deal with the comments + closeCommentChain := func(i int) { + for _, chainLine := range lines[chainStart:i] { + columns := chainLine.lead.Columns() + chainLine.assign.Columns() + spaces := (maxColumns - columns) + 1 + chainLine.comment[0].SpacesBefore = spaces + } + chainStart = -1 + maxColumns = 0 + } + for i, line := range lines { + if line.comment == nil { + if chainStart != -1 { + closeCommentChain(i) + } + } else { + if chainStart == -1 { + chainStart = i + } + columns := line.lead.Columns() + line.assign.Columns() + if columns > maxColumns { + maxColumns = columns + } + } + } + if chainStart != -1 { + closeCommentChain(len(lines)) + } + +} + +// spaceAfterToken decides whether a particular subject token should have a +// space after it when surrounded by the given before and after tokens. +// "before" can be TokenNil, if the subject token is at the start of a sequence. +func spaceAfterToken(subject, before, after *Token) bool { + switch { + + case after.Type == hclsyntax.TokenNewline || after.Type == hclsyntax.TokenNil: + // Never add spaces before a newline + return false + + case subject.Type == hclsyntax.TokenIdent && after.Type == hclsyntax.TokenOParen: + // Don't split a function name from open paren in a call + return false + + case subject.Type == hclsyntax.TokenDot || after.Type == hclsyntax.TokenDot: + // Don't use spaces around attribute access dots + return false + + case after.Type == hclsyntax.TokenComma || after.Type == hclsyntax.TokenEllipsis: + // No space right before a comma or ... in an argument list + return false + + case subject.Type == hclsyntax.TokenComma: + // Always a space after a comma + return true + + case subject.Type == hclsyntax.TokenQuotedLit || subject.Type == hclsyntax.TokenStringLit || subject.Type == hclsyntax.TokenOQuote || subject.Type == hclsyntax.TokenOHeredoc || after.Type == hclsyntax.TokenQuotedLit || after.Type == hclsyntax.TokenStringLit || after.Type == hclsyntax.TokenCQuote || after.Type == hclsyntax.TokenCHeredoc: + // No extra spaces within templates + return false + + case inKeyword.TokenMatches(subject.asHCLSyntax()) && before.Type == hclsyntax.TokenIdent: + // This is a special case for inside for expressions where a user + // might want to use a literal tuple constructor: + // [for x in [foo]: x] + // ... in that case, we would normally produce in[foo] thinking that + // in is a reference, but we'll recognize it as a keyword here instead + // to make the result less confusing. + return true + + case after.Type == hclsyntax.TokenOBrack && (subject.Type == hclsyntax.TokenIdent || subject.Type == hclsyntax.TokenNumberLit || tokenBracketChange(subject) < 0): + return false + + case subject.Type == hclsyntax.TokenMinus: + // Since a minus can either be subtraction or negation, and the latter + // should _not_ have a space after it, we need to use some heuristics + // to decide which case this is. + // We guess that we have a negation if the token before doesn't look + // like it could be the end of an expression. + + switch before.Type { + + case hclsyntax.TokenNil: + // Minus at the start of input must be a negation + return false + + case hclsyntax.TokenOParen, hclsyntax.TokenOBrace, hclsyntax.TokenOBrack, hclsyntax.TokenEqual, hclsyntax.TokenColon, hclsyntax.TokenComma, hclsyntax.TokenQuestion: + // Minus immediately after an opening bracket or separator must be a negation. + return false + + case hclsyntax.TokenPlus, hclsyntax.TokenStar, hclsyntax.TokenSlash, hclsyntax.TokenPercent, hclsyntax.TokenMinus: + // Minus immediately after another arithmetic operator must be negation. + return false + + case hclsyntax.TokenEqualOp, hclsyntax.TokenNotEqual, hclsyntax.TokenGreaterThan, hclsyntax.TokenGreaterThanEq, hclsyntax.TokenLessThan, hclsyntax.TokenLessThanEq: + // Minus immediately after another comparison operator must be negation. + return false + + case hclsyntax.TokenAnd, hclsyntax.TokenOr, hclsyntax.TokenBang: + // Minus immediately after logical operator doesn't make sense but probably intended as negation. + return false + + default: + return true + } + + case subject.Type == hclsyntax.TokenOBrace || after.Type == hclsyntax.TokenCBrace: + // Unlike other bracket types, braces have spaces on both sides of them, + // both in single-line nested blocks foo { bar = baz } and in object + // constructor expressions foo = { bar = baz }. + if subject.Type == hclsyntax.TokenOBrace && after.Type == hclsyntax.TokenCBrace { + // An open brace followed by a close brace is an exception, however. + // e.g. foo {} rather than foo { } + return false + } + return true + + // In the unlikely event that an interpolation expression is just + // a single object constructor, we'll put a space between the ${ and + // the following { to make this more obvious, and then the same + // thing for the two braces at the end. + case (subject.Type == hclsyntax.TokenTemplateInterp || subject.Type == hclsyntax.TokenTemplateControl) && after.Type == hclsyntax.TokenOBrace: + return true + case subject.Type == hclsyntax.TokenCBrace && after.Type == hclsyntax.TokenTemplateSeqEnd: + return true + + // Don't add spaces between interpolated items + case subject.Type == hclsyntax.TokenTemplateSeqEnd && (after.Type == hclsyntax.TokenTemplateInterp || after.Type == hclsyntax.TokenTemplateControl): + return false + + case tokenBracketChange(subject) > 0: + // No spaces after open brackets + return false + + case tokenBracketChange(after) < 0: + // No spaces before close brackets + return false + + default: + // Most tokens are space-separated + return true + + } +} + +func linesForFormat(tokens Tokens) []formatLine { + if len(tokens) == 0 { + return make([]formatLine, 0) + } + + // first we'll count our lines, so we can allocate the array for them in + // a single block. (We want to minimize memory pressure in this codepath, + // so it can be run somewhat-frequently by editor integrations.) + lineCount := 1 // if there are zero newlines then there is one line + for _, tok := range tokens { + if tokenIsNewline(tok) { + lineCount++ + } + } + + // To start, we'll just put everything in the "lead" cell on each line, + // and then do another pass over the lines afterwards to adjust. + lines := make([]formatLine, lineCount) + li := 0 + lineStart := 0 + for i, tok := range tokens { + if tok.Type == hclsyntax.TokenEOF { + // The EOF token doesn't belong to any line, and terminates the + // token sequence. + lines[li].lead = tokens[lineStart:i] + break + } + + if tokenIsNewline(tok) { + lines[li].lead = tokens[lineStart : i+1] + lineStart = i + 1 + li++ + } + } + + // If a set of tokens doesn't end in TokenEOF (e.g. because it's a + // fragment of tokens from the middle of a file) then we might fall + // out here with a line still pending. + if lineStart < len(tokens) { + lines[li].lead = tokens[lineStart:] + if lines[li].lead[len(lines[li].lead)-1].Type == hclsyntax.TokenEOF { + lines[li].lead = lines[li].lead[:len(lines[li].lead)-1] + } + } + + // Now we'll pick off any trailing comments and attribute assignments + // to shuffle off into the "comment" and "assign" cells. + for i := range lines { + line := &lines[i] + + if len(line.lead) == 0 { + // if the line is empty then there's nothing for us to do + // (this should happen only for the final line, because all other + // lines would have a newline token of some kind) + continue + } + + if len(line.lead) > 1 && line.lead[len(line.lead)-1].Type == hclsyntax.TokenComment { + line.comment = line.lead[len(line.lead)-1:] + line.lead = line.lead[:len(line.lead)-1] + } + + for i, tok := range line.lead { + if i > 0 && tok.Type == hclsyntax.TokenEqual { + // We only move the tokens into "assign" if the RHS seems to + // be a whole expression, which we determine by counting + // brackets. If there's a net positive number of brackets + // then that suggests we're introducing a multi-line expression. + netBrackets := 0 + for _, token := range line.lead[i:] { + netBrackets += tokenBracketChange(token) + } + + if netBrackets == 0 { + line.assign = line.lead[i:] + line.lead = line.lead[:i] + } + break + } + } + } + + return lines +} + +func tokenIsNewline(tok *Token) bool { + if tok.Type == hclsyntax.TokenNewline { + return true + } else if tok.Type == hclsyntax.TokenComment { + // Single line tokens (# and //) consume their terminating newline, + // so we need to treat them as newline tokens as well. + if len(tok.Bytes) > 0 && tok.Bytes[len(tok.Bytes)-1] == '\n' { + return true + } + } + return false +} + +func tokenBracketChange(tok *Token) int { + switch tok.Type { + case hclsyntax.TokenOBrace, hclsyntax.TokenOBrack, hclsyntax.TokenOParen, hclsyntax.TokenTemplateControl, hclsyntax.TokenTemplateInterp: + return 1 + case hclsyntax.TokenCBrace, hclsyntax.TokenCBrack, hclsyntax.TokenCParen, hclsyntax.TokenTemplateSeqEnd: + return -1 + default: + return 0 + } +} + +// formatLine represents a single line of source code for formatting purposes, +// splitting its tokens into up to three "cells": +// +// lead: always present, representing everything up to one of the others +// assign: if line contains an attribute assignment, represents the tokens +// starting at (and including) the equals symbol +// comment: if line contains any non-comment tokens and ends with a +// single-line comment token, represents the comment. +// +// When formatting, the leading spaces of the first tokens in each of these +// cells is adjusted to align vertically their occurences on consecutive +// rows. +type formatLine struct { + lead Tokens + assign Tokens + comment Tokens +} diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/generate.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/generate.go similarity index 98% rename from vendor/github.com/hashicorp/hcl2/hclwrite/generate.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/generate.go index d249cfdf9a8..289a30d6846 100644 --- a/vendor/github.com/hashicorp/hcl2/hclwrite/generate.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/generate.go @@ -5,8 +5,8 @@ import ( "unicode" "unicode/utf8" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" "github.com/zclconf/go-cty/cty" ) diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/native_node_sorter.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/native_node_sorter.go similarity index 90% rename from vendor/github.com/hashicorp/hcl2/hclwrite/native_node_sorter.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/native_node_sorter.go index a13c0ec419a..cedf6862702 100644 --- a/vendor/github.com/hashicorp/hcl2/hclwrite/native_node_sorter.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/native_node_sorter.go @@ -1,7 +1,7 @@ package hclwrite import ( - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2/hclsyntax" ) type nativeNodeSorter struct { diff --git a/vendor/github.com/hashicorp/hcl/v2/hclwrite/node.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/node.go new file mode 100644 index 00000000000..45669f7f987 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/node.go @@ -0,0 +1,260 @@ +package hclwrite + +import ( + "fmt" + + "github.com/google/go-cmp/cmp" +) + +// node represents a node in the AST. +type node struct { + content nodeContent + + list *nodes + before, after *node +} + +func newNode(c nodeContent) *node { + return &node{ + content: c, + } +} + +func (n *node) Equal(other *node) bool { + return cmp.Equal(n.content, other.content) +} + +func (n *node) BuildTokens(to Tokens) Tokens { + return n.content.BuildTokens(to) +} + +// Detach removes the receiver from the list it currently belongs to. If the +// node is not currently in a list, this is a no-op. +func (n *node) Detach() { + if n.list == nil { + return + } + if n.before != nil { + n.before.after = n.after + } + if n.after != nil { + n.after.before = n.before + } + if n.list.first == n { + n.list.first = n.after + } + if n.list.last == n { + n.list.last = n.before + } + n.list = nil + n.before = nil + n.after = nil +} + +// ReplaceWith removes the receiver from the list it currently belongs to and +// inserts a new node with the given content in its place. If the node is not +// currently in a list, this function will panic. +// +// The return value is the newly-constructed node, containing the given content. +// After this function returns, the reciever is no longer attached to a list. +func (n *node) ReplaceWith(c nodeContent) *node { + if n.list == nil { + panic("can't replace node that is not in a list") + } + + before := n.before + after := n.after + list := n.list + n.before, n.after, n.list = nil, nil, nil + + nn := newNode(c) + nn.before = before + nn.after = after + nn.list = list + if before != nil { + before.after = nn + } + if after != nil { + after.before = nn + } + return nn +} + +func (n *node) assertUnattached() { + if n.list != nil { + panic(fmt.Sprintf("attempt to attach already-attached node %#v", n)) + } +} + +// nodeContent is the interface type implemented by all AST content types. +type nodeContent interface { + walkChildNodes(w internalWalkFunc) + BuildTokens(to Tokens) Tokens +} + +// nodes is a list of nodes. +type nodes struct { + first, last *node +} + +func (ns *nodes) BuildTokens(to Tokens) Tokens { + for n := ns.first; n != nil; n = n.after { + to = n.BuildTokens(to) + } + return to +} + +func (ns *nodes) Clear() { + ns.first = nil + ns.last = nil +} + +func (ns *nodes) Append(c nodeContent) *node { + n := &node{ + content: c, + } + ns.AppendNode(n) + n.list = ns + return n +} + +func (ns *nodes) AppendNode(n *node) { + if ns.last != nil { + n.before = ns.last + ns.last.after = n + } + n.list = ns + ns.last = n + if ns.first == nil { + ns.first = n + } +} + +func (ns *nodes) AppendUnstructuredTokens(tokens Tokens) *node { + if len(tokens) == 0 { + return nil + } + n := newNode(tokens) + ns.AppendNode(n) + n.list = ns + return n +} + +// FindNodeWithContent searches the nodes for a node whose content equals +// the given content. If it finds one then it returns it. Otherwise it returns +// nil. +func (ns *nodes) FindNodeWithContent(content nodeContent) *node { + for n := ns.first; n != nil; n = n.after { + if n.content == content { + return n + } + } + return nil +} + +// nodeSet is an unordered set of nodes. It is used to describe a set of nodes +// that all belong to the same list that have some role or characteristic +// in common. +type nodeSet map[*node]struct{} + +func newNodeSet() nodeSet { + return make(nodeSet) +} + +func (ns nodeSet) Has(n *node) bool { + if ns == nil { + return false + } + _, exists := ns[n] + return exists +} + +func (ns nodeSet) Add(n *node) { + ns[n] = struct{}{} +} + +func (ns nodeSet) Remove(n *node) { + delete(ns, n) +} + +func (ns nodeSet) List() []*node { + if len(ns) == 0 { + return nil + } + + ret := make([]*node, 0, len(ns)) + + // Determine which list we are working with. We assume here that all of + // the nodes belong to the same list, since that is part of the contract + // for nodeSet. + var list *nodes + for n := range ns { + list = n.list + break + } + + // We recover the order by iterating over the whole list. This is not + // the most efficient way to do it, but our node lists should always be + // small so not worth making things more complex. + for n := list.first; n != nil; n = n.after { + if ns.Has(n) { + ret = append(ret, n) + } + } + return ret +} + +// FindNodeWithContent searches the nodes for a node whose content equals +// the given content. If it finds one then it returns it. Otherwise it returns +// nil. +func (ns nodeSet) FindNodeWithContent(content nodeContent) *node { + for n := range ns { + if n.content == content { + return n + } + } + return nil +} + +type internalWalkFunc func(*node) + +// inTree can be embedded into a content struct that has child nodes to get +// a standard implementation of the NodeContent interface and a record of +// a potential parent node. +type inTree struct { + parent *node + children *nodes +} + +func newInTree() inTree { + return inTree{ + children: &nodes{}, + } +} + +func (it *inTree) assertUnattached() { + if it.parent != nil { + panic(fmt.Sprintf("node is already attached to %T", it.parent.content)) + } +} + +func (it *inTree) walkChildNodes(w internalWalkFunc) { + for n := it.children.first; n != nil; n = n.after { + w(n) + } +} + +func (it *inTree) BuildTokens(to Tokens) Tokens { + for n := it.children.first; n != nil; n = n.after { + to = n.BuildTokens(to) + } + return to +} + +// leafNode can be embedded into a content struct to give it a do-nothing +// implementation of walkChildNodes +type leafNode struct { +} + +func (n *leafNode) walkChildNodes(w internalWalkFunc) { +} diff --git a/vendor/github.com/hashicorp/hcl/v2/hclwrite/parser.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/parser.go new file mode 100644 index 00000000000..d6cf532ea3c --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/parser.go @@ -0,0 +1,599 @@ +package hclwrite + +import ( + "fmt" + "sort" + + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/zclconf/go-cty/cty" +) + +// Our "parser" here is actually not doing any parsing of its own. Instead, +// it leans on the native parser in hclsyntax, and then uses the source ranges +// from the AST to partition the raw token sequence to match the raw tokens +// up to AST nodes. +// +// This strategy feels somewhat counter-intuitive, since most of the work the +// parser does is thrown away here, but this strategy is chosen because the +// normal parsing work done by hclsyntax is considered to be the "main case", +// while modifying and re-printing source is more of an edge case, used only +// in ancillary tools, and so it's good to keep all the main parsing logic +// with the main case but keep all of the extra complexity of token wrangling +// out of the main parser, which is already rather complex just serving the +// use-cases it already serves. +// +// If the parsing step produces any errors, the returned File is nil because +// we can't reliably extract tokens from the partial AST produced by an +// erroneous parse. +func parse(src []byte, filename string, start hcl.Pos) (*File, hcl.Diagnostics) { + file, diags := hclsyntax.ParseConfig(src, filename, start) + if diags.HasErrors() { + return nil, diags + } + + // To do our work here, we use the "native" tokens (those from hclsyntax) + // to match against source ranges in the AST, but ultimately produce + // slices from our sequence of "writer" tokens, which contain only + // *relative* position information that is more appropriate for + // transformation/writing use-cases. + nativeTokens, diags := hclsyntax.LexConfig(src, filename, start) + if diags.HasErrors() { + // should never happen, since we would've caught these diags in + // the first call above. + return nil, diags + } + writerTokens := writerTokens(nativeTokens) + + from := inputTokens{ + nativeTokens: nativeTokens, + writerTokens: writerTokens, + } + + before, root, after := parseBody(file.Body.(*hclsyntax.Body), from) + ret := &File{ + inTree: newInTree(), + + srcBytes: src, + body: root, + } + + nodes := ret.inTree.children + nodes.Append(before.Tokens()) + nodes.AppendNode(root) + nodes.Append(after.Tokens()) + + return ret, diags +} + +type inputTokens struct { + nativeTokens hclsyntax.Tokens + writerTokens Tokens +} + +func (it inputTokens) Partition(rng hcl.Range) (before, within, after inputTokens) { + start, end := partitionTokens(it.nativeTokens, rng) + before = it.Slice(0, start) + within = it.Slice(start, end) + after = it.Slice(end, len(it.nativeTokens)) + return +} + +func (it inputTokens) PartitionType(ty hclsyntax.TokenType) (before, within, after inputTokens) { + for i, t := range it.writerTokens { + if t.Type == ty { + return it.Slice(0, i), it.Slice(i, i+1), it.Slice(i+1, len(it.nativeTokens)) + } + } + panic(fmt.Sprintf("didn't find any token of type %s", ty)) +} + +func (it inputTokens) PartitionTypeSingle(ty hclsyntax.TokenType) (before inputTokens, found *Token, after inputTokens) { + before, within, after := it.PartitionType(ty) + if within.Len() != 1 { + panic("PartitionType found more than one token") + } + return before, within.Tokens()[0], after +} + +// PartitionIncludeComments is like Partition except the returned "within" +// range includes any lead and line comments associated with the range. +func (it inputTokens) PartitionIncludingComments(rng hcl.Range) (before, within, after inputTokens) { + start, end := partitionTokens(it.nativeTokens, rng) + start = partitionLeadCommentTokens(it.nativeTokens[:start]) + _, afterNewline := partitionLineEndTokens(it.nativeTokens[end:]) + end += afterNewline + + before = it.Slice(0, start) + within = it.Slice(start, end) + after = it.Slice(end, len(it.nativeTokens)) + return + +} + +// PartitionBlockItem is similar to PartitionIncludeComments but it returns +// the comments as separate token sequences so that they can be captured into +// AST attributes. It makes assumptions that apply only to block items, so +// should not be used for other constructs. +func (it inputTokens) PartitionBlockItem(rng hcl.Range) (before, leadComments, within, lineComments, newline, after inputTokens) { + before, within, after = it.Partition(rng) + before, leadComments = before.PartitionLeadComments() + lineComments, newline, after = after.PartitionLineEndTokens() + return +} + +func (it inputTokens) PartitionLeadComments() (before, within inputTokens) { + start := partitionLeadCommentTokens(it.nativeTokens) + before = it.Slice(0, start) + within = it.Slice(start, len(it.nativeTokens)) + return +} + +func (it inputTokens) PartitionLineEndTokens() (comments, newline, after inputTokens) { + afterComments, afterNewline := partitionLineEndTokens(it.nativeTokens) + comments = it.Slice(0, afterComments) + newline = it.Slice(afterComments, afterNewline) + after = it.Slice(afterNewline, len(it.nativeTokens)) + return +} + +func (it inputTokens) Slice(start, end int) inputTokens { + // When we slice, we create a new slice with no additional capacity because + // we expect that these slices will be mutated in order to insert + // new code into the AST, and we want to ensure that a new underlying + // array gets allocated in that case, rather than writing into some + // following slice and corrupting it. + return inputTokens{ + nativeTokens: it.nativeTokens[start:end:end], + writerTokens: it.writerTokens[start:end:end], + } +} + +func (it inputTokens) Len() int { + return len(it.nativeTokens) +} + +func (it inputTokens) Tokens() Tokens { + return it.writerTokens +} + +func (it inputTokens) Types() []hclsyntax.TokenType { + ret := make([]hclsyntax.TokenType, len(it.nativeTokens)) + for i, tok := range it.nativeTokens { + ret[i] = tok.Type + } + return ret +} + +// parseBody locates the given body within the given input tokens and returns +// the resulting *Body object as well as the tokens that appeared before and +// after it. +func parseBody(nativeBody *hclsyntax.Body, from inputTokens) (inputTokens, *node, inputTokens) { + before, within, after := from.PartitionIncludingComments(nativeBody.SrcRange) + + // The main AST doesn't retain the original source ordering of the + // body items, so we need to reconstruct that ordering by inspecting + // their source ranges. + nativeItems := make([]hclsyntax.Node, 0, len(nativeBody.Attributes)+len(nativeBody.Blocks)) + for _, nativeAttr := range nativeBody.Attributes { + nativeItems = append(nativeItems, nativeAttr) + } + for _, nativeBlock := range nativeBody.Blocks { + nativeItems = append(nativeItems, nativeBlock) + } + sort.Sort(nativeNodeSorter{nativeItems}) + + body := &Body{ + inTree: newInTree(), + items: newNodeSet(), + } + + remain := within + for _, nativeItem := range nativeItems { + beforeItem, item, afterItem := parseBodyItem(nativeItem, remain) + + if beforeItem.Len() > 0 { + body.AppendUnstructuredTokens(beforeItem.Tokens()) + } + body.appendItemNode(item) + + remain = afterItem + } + + if remain.Len() > 0 { + body.AppendUnstructuredTokens(remain.Tokens()) + } + + return before, newNode(body), after +} + +func parseBodyItem(nativeItem hclsyntax.Node, from inputTokens) (inputTokens, *node, inputTokens) { + before, leadComments, within, lineComments, newline, after := from.PartitionBlockItem(nativeItem.Range()) + + var item *node + + switch tItem := nativeItem.(type) { + case *hclsyntax.Attribute: + item = parseAttribute(tItem, within, leadComments, lineComments, newline) + case *hclsyntax.Block: + item = parseBlock(tItem, within, leadComments, lineComments, newline) + default: + // should never happen if caller is behaving + panic("unsupported native item type") + } + + return before, item, after +} + +func parseAttribute(nativeAttr *hclsyntax.Attribute, from, leadComments, lineComments, newline inputTokens) *node { + attr := &Attribute{ + inTree: newInTree(), + } + children := attr.inTree.children + + { + cn := newNode(newComments(leadComments.Tokens())) + attr.leadComments = cn + children.AppendNode(cn) + } + + before, nameTokens, from := from.Partition(nativeAttr.NameRange) + { + children.AppendUnstructuredTokens(before.Tokens()) + if nameTokens.Len() != 1 { + // Should never happen with valid input + panic("attribute name is not exactly one token") + } + token := nameTokens.Tokens()[0] + in := newNode(newIdentifier(token)) + attr.name = in + children.AppendNode(in) + } + + before, equalsTokens, from := from.Partition(nativeAttr.EqualsRange) + children.AppendUnstructuredTokens(before.Tokens()) + children.AppendUnstructuredTokens(equalsTokens.Tokens()) + + before, exprTokens, from := from.Partition(nativeAttr.Expr.Range()) + { + children.AppendUnstructuredTokens(before.Tokens()) + exprNode := parseExpression(nativeAttr.Expr, exprTokens) + attr.expr = exprNode + children.AppendNode(exprNode) + } + + { + cn := newNode(newComments(lineComments.Tokens())) + attr.lineComments = cn + children.AppendNode(cn) + } + + children.AppendUnstructuredTokens(newline.Tokens()) + + // Collect any stragglers, though there shouldn't be any + children.AppendUnstructuredTokens(from.Tokens()) + + return newNode(attr) +} + +func parseBlock(nativeBlock *hclsyntax.Block, from, leadComments, lineComments, newline inputTokens) *node { + block := &Block{ + inTree: newInTree(), + labels: newNodeSet(), + } + children := block.inTree.children + + { + cn := newNode(newComments(leadComments.Tokens())) + block.leadComments = cn + children.AppendNode(cn) + } + + before, typeTokens, from := from.Partition(nativeBlock.TypeRange) + { + children.AppendUnstructuredTokens(before.Tokens()) + if typeTokens.Len() != 1 { + // Should never happen with valid input + panic("block type name is not exactly one token") + } + token := typeTokens.Tokens()[0] + in := newNode(newIdentifier(token)) + block.typeName = in + children.AppendNode(in) + } + + for _, rng := range nativeBlock.LabelRanges { + var labelTokens inputTokens + before, labelTokens, from = from.Partition(rng) + children.AppendUnstructuredTokens(before.Tokens()) + tokens := labelTokens.Tokens() + var ln *node + if len(tokens) == 1 && tokens[0].Type == hclsyntax.TokenIdent { + ln = newNode(newIdentifier(tokens[0])) + } else { + ln = newNode(newQuoted(tokens)) + } + block.labels.Add(ln) + children.AppendNode(ln) + } + + before, oBrace, from := from.Partition(nativeBlock.OpenBraceRange) + children.AppendUnstructuredTokens(before.Tokens()) + children.AppendUnstructuredTokens(oBrace.Tokens()) + + // We go a bit out of order here: we go hunting for the closing brace + // so that we have a delimited body, but then we'll deal with the body + // before we actually append the closing brace and any straggling tokens + // that appear after it. + bodyTokens, cBrace, from := from.Partition(nativeBlock.CloseBraceRange) + before, body, after := parseBody(nativeBlock.Body, bodyTokens) + children.AppendUnstructuredTokens(before.Tokens()) + block.body = body + children.AppendNode(body) + children.AppendUnstructuredTokens(after.Tokens()) + + children.AppendUnstructuredTokens(cBrace.Tokens()) + + // stragglers + children.AppendUnstructuredTokens(from.Tokens()) + if lineComments.Len() > 0 { + // blocks don't actually have line comments, so we'll just treat + // them as extra stragglers + children.AppendUnstructuredTokens(lineComments.Tokens()) + } + children.AppendUnstructuredTokens(newline.Tokens()) + + return newNode(block) +} + +func parseExpression(nativeExpr hclsyntax.Expression, from inputTokens) *node { + expr := newExpression() + children := expr.inTree.children + + nativeVars := nativeExpr.Variables() + + for _, nativeTraversal := range nativeVars { + before, traversal, after := parseTraversal(nativeTraversal, from) + children.AppendUnstructuredTokens(before.Tokens()) + children.AppendNode(traversal) + expr.absTraversals.Add(traversal) + from = after + } + // Attach any stragglers that don't belong to a traversal to the expression + // itself. In an expression with no traversals at all, this is just the + // entirety of "from". + children.AppendUnstructuredTokens(from.Tokens()) + + return newNode(expr) +} + +func parseTraversal(nativeTraversal hcl.Traversal, from inputTokens) (before inputTokens, n *node, after inputTokens) { + traversal := newTraversal() + children := traversal.inTree.children + before, from, after = from.Partition(nativeTraversal.SourceRange()) + + stepAfter := from + for _, nativeStep := range nativeTraversal { + before, step, after := parseTraversalStep(nativeStep, stepAfter) + children.AppendUnstructuredTokens(before.Tokens()) + children.AppendNode(step) + traversal.steps.Add(step) + stepAfter = after + } + + return before, newNode(traversal), after +} + +func parseTraversalStep(nativeStep hcl.Traverser, from inputTokens) (before inputTokens, n *node, after inputTokens) { + var children *nodes + switch tNativeStep := nativeStep.(type) { + + case hcl.TraverseRoot, hcl.TraverseAttr: + step := newTraverseName() + children = step.inTree.children + before, from, after = from.Partition(nativeStep.SourceRange()) + inBefore, token, inAfter := from.PartitionTypeSingle(hclsyntax.TokenIdent) + name := newIdentifier(token) + children.AppendUnstructuredTokens(inBefore.Tokens()) + step.name = children.Append(name) + children.AppendUnstructuredTokens(inAfter.Tokens()) + return before, newNode(step), after + + case hcl.TraverseIndex: + step := newTraverseIndex() + children = step.inTree.children + before, from, after = from.Partition(nativeStep.SourceRange()) + + var inBefore, oBrack, keyTokens, cBrack inputTokens + inBefore, oBrack, from = from.PartitionType(hclsyntax.TokenOBrack) + children.AppendUnstructuredTokens(inBefore.Tokens()) + children.AppendUnstructuredTokens(oBrack.Tokens()) + keyTokens, cBrack, from = from.PartitionType(hclsyntax.TokenCBrack) + + keyVal := tNativeStep.Key + switch keyVal.Type() { + case cty.String: + key := newQuoted(keyTokens.Tokens()) + step.key = children.Append(key) + case cty.Number: + valBefore, valToken, valAfter := keyTokens.PartitionTypeSingle(hclsyntax.TokenNumberLit) + children.AppendUnstructuredTokens(valBefore.Tokens()) + key := newNumber(valToken) + step.key = children.Append(key) + children.AppendUnstructuredTokens(valAfter.Tokens()) + } + + children.AppendUnstructuredTokens(cBrack.Tokens()) + children.AppendUnstructuredTokens(from.Tokens()) + + return before, newNode(step), after + default: + panic(fmt.Sprintf("unsupported traversal step type %T", nativeStep)) + } + +} + +// writerTokens takes a sequence of tokens as produced by the main hclsyntax +// package and transforms it into an equivalent sequence of tokens using +// this package's own token model. +// +// The resulting list contains the same number of tokens and uses the same +// indices as the input, allowing the two sets of tokens to be correlated +// by index. +func writerTokens(nativeTokens hclsyntax.Tokens) Tokens { + // Ultimately we want a slice of token _pointers_, but since we can + // predict how much memory we're going to devote to tokens we'll allocate + // it all as a single flat buffer and thus give the GC less work to do. + tokBuf := make([]Token, len(nativeTokens)) + var lastByteOffset int + for i, mainToken := range nativeTokens { + // Create a copy of the bytes so that we can mutate without + // corrupting the original token stream. + bytes := make([]byte, len(mainToken.Bytes)) + copy(bytes, mainToken.Bytes) + + tokBuf[i] = Token{ + Type: mainToken.Type, + Bytes: bytes, + + // We assume here that spaces are always ASCII spaces, since + // that's what the scanner also assumes, and thus the number + // of bytes skipped is also the number of space characters. + SpacesBefore: mainToken.Range.Start.Byte - lastByteOffset, + } + + lastByteOffset = mainToken.Range.End.Byte + } + + // Now make a slice of pointers into the previous slice. + ret := make(Tokens, len(tokBuf)) + for i := range ret { + ret[i] = &tokBuf[i] + } + + return ret +} + +// partitionTokens takes a sequence of tokens and a hcl.Range and returns +// two indices within the token sequence that correspond with the range +// boundaries, such that the slice operator could be used to produce +// three token sequences for before, within, and after respectively: +// +// start, end := partitionTokens(toks, rng) +// before := toks[:start] +// within := toks[start:end] +// after := toks[end:] +// +// This works best when the range is aligned with token boundaries (e.g. +// because it was produced in terms of the scanner's result) but if that isn't +// true then it will make a best effort that may produce strange results at +// the boundaries. +// +// Native hclsyntax tokens are used here, because they contain the necessary +// absolute position information. However, since writerTokens produces a +// correlatable sequence of writer tokens, the resulting indices can be +// used also to index into its result, allowing the partitioning of writer +// tokens to be driven by the partitioning of native tokens. +// +// The tokens are assumed to be in source order and non-overlapping, which +// will be true if the token sequence from the scanner is used directly. +func partitionTokens(toks hclsyntax.Tokens, rng hcl.Range) (start, end int) { + // We us a linear search here because we assume tha in most cases our + // target range is close to the beginning of the sequence, and the seqences + // are generally small for most reasonable files anyway. + for i := 0; ; i++ { + if i >= len(toks) { + // No tokens for the given range at all! + return len(toks), len(toks) + } + + if toks[i].Range.Start.Byte >= rng.Start.Byte { + start = i + break + } + } + + for i := start; ; i++ { + if i >= len(toks) { + // The range "hangs off" the end of the token sequence + return start, len(toks) + } + + if toks[i].Range.Start.Byte >= rng.End.Byte { + end = i // end marker is exclusive + break + } + } + + return start, end +} + +// partitionLeadCommentTokens takes a sequence of tokens that is assumed +// to immediately precede a construct that can have lead comment tokens, +// and returns the index into that sequence where the lead comments begin. +// +// Lead comments are defined as whole lines containing only comment tokens +// with no blank lines between. If no such lines are found, the returned +// index will be len(toks). +func partitionLeadCommentTokens(toks hclsyntax.Tokens) int { + // single-line comments (which is what we're interested in here) + // consume their trailing newline, so we can just walk backwards + // until we stop seeing comment tokens. + for i := len(toks) - 1; i >= 0; i-- { + if toks[i].Type != hclsyntax.TokenComment { + return i + 1 + } + } + return 0 +} + +// partitionLineEndTokens takes a sequence of tokens that is assumed +// to immediately follow a construct that can have a line comment, and +// returns first the index where any line comments end and then second +// the index immediately after the trailing newline. +// +// Line comments are defined as comments that appear immediately after +// a construct on the same line where its significant tokens ended. +// +// Since single-line comment tokens (# and //) include the newline that +// terminates them, in the presence of these the two returned indices +// will be the same since the comment itself serves as the line end. +func partitionLineEndTokens(toks hclsyntax.Tokens) (afterComment, afterNewline int) { + for i := 0; i < len(toks); i++ { + tok := toks[i] + if tok.Type != hclsyntax.TokenComment { + switch tok.Type { + case hclsyntax.TokenNewline: + return i, i + 1 + case hclsyntax.TokenEOF: + // Although this is valid, we mustn't include the EOF + // itself as our "newline" or else strange things will + // happen when we try to append new items. + return i, i + default: + // If we have well-formed input here then nothing else should be + // possible. This path should never happen, because we only try + // to extract tokens from the sequence if the parser succeeded, + // and it should catch this problem itself. + panic("malformed line trailers: expected only comments and newlines") + } + } + + if len(tok.Bytes) > 0 && tok.Bytes[len(tok.Bytes)-1] == '\n' { + // Newline at the end of a single-line comment serves both as + // the end of comments *and* the end of the line. + return i + 1, i + 1 + } + } + return len(toks), len(toks) +} + +// lexConfig uses the hclsyntax scanner to get a token stream and then +// rewrites it into this package's token model. +// +// Any errors produced during scanning are ignored, so the results of this +// function should be used with care. +func lexConfig(src []byte) Tokens { + mainTokens, _ := hclsyntax.LexConfig(src, "", hcl.Pos{Byte: 0, Line: 1, Column: 1}) + return writerTokens(mainTokens) +} diff --git a/vendor/github.com/hashicorp/hcl/v2/hclwrite/public.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/public.go new file mode 100644 index 00000000000..678a3aa4576 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/public.go @@ -0,0 +1,44 @@ +package hclwrite + +import ( + "bytes" + + "github.com/hashicorp/hcl/v2" +) + +// NewFile creates a new file object that is empty and ready to have constructs +// added t it. +func NewFile() *File { + body := &Body{ + inTree: newInTree(), + items: newNodeSet(), + } + file := &File{ + inTree: newInTree(), + } + file.body = file.inTree.children.Append(body) + return file +} + +// ParseConfig interprets the given source bytes into a *hclwrite.File. The +// resulting AST can be used to perform surgical edits on the source code +// before turning it back into bytes again. +func ParseConfig(src []byte, filename string, start hcl.Pos) (*File, hcl.Diagnostics) { + return parse(src, filename, start) +} + +// Format takes source code and performs simple whitespace changes to transform +// it to a canonical layout style. +// +// Format skips constructing an AST and works directly with tokens, so it +// is less expensive than formatting via the AST for situations where no other +// changes will be made. It also ignores syntax errors and can thus be applied +// to partial source code, although the result in that case may not be +// desirable. +func Format(src []byte) []byte { + tokens := lexConfig(src) + format(tokens) + buf := &bytes.Buffer{} + tokens.WriteTo(buf) + return buf.Bytes() +} diff --git a/vendor/github.com/hashicorp/hcl2/hclwrite/tokens.go b/vendor/github.com/hashicorp/hcl/v2/hclwrite/tokens.go similarity index 97% rename from vendor/github.com/hashicorp/hcl2/hclwrite/tokens.go rename to vendor/github.com/hashicorp/hcl/v2/hclwrite/tokens.go index d87f81853b0..3bd3e5f4892 100644 --- a/vendor/github.com/hashicorp/hcl2/hclwrite/tokens.go +++ b/vendor/github.com/hashicorp/hcl/v2/hclwrite/tokens.go @@ -5,8 +5,8 @@ import ( "io" "github.com/apparentlymart/go-textseg/textseg" - "github.com/hashicorp/hcl2/hcl" - "github.com/hashicorp/hcl2/hcl/hclsyntax" + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" ) // Token is a single sequence of bytes annotated with a type. It is similar diff --git a/vendor/github.com/hashicorp/hcl/v2/json/ast.go b/vendor/github.com/hashicorp/hcl/v2/json/ast.go new file mode 100644 index 00000000000..9c580ca3471 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/json/ast.go @@ -0,0 +1,121 @@ +package json + +import ( + "math/big" + + "github.com/hashicorp/hcl/v2" +) + +type node interface { + Range() hcl.Range + StartRange() hcl.Range +} + +type objectVal struct { + Attrs []*objectAttr + SrcRange hcl.Range // range of the entire object, brace-to-brace + OpenRange hcl.Range // range of the opening brace + CloseRange hcl.Range // range of the closing brace +} + +func (n *objectVal) Range() hcl.Range { + return n.SrcRange +} + +func (n *objectVal) StartRange() hcl.Range { + return n.OpenRange +} + +type objectAttr struct { + Name string + Value node + NameRange hcl.Range // range of the name string +} + +func (n *objectAttr) Range() hcl.Range { + return n.NameRange +} + +func (n *objectAttr) StartRange() hcl.Range { + return n.NameRange +} + +type arrayVal struct { + Values []node + SrcRange hcl.Range // range of the entire object, bracket-to-bracket + OpenRange hcl.Range // range of the opening bracket +} + +func (n *arrayVal) Range() hcl.Range { + return n.SrcRange +} + +func (n *arrayVal) StartRange() hcl.Range { + return n.OpenRange +} + +type booleanVal struct { + Value bool + SrcRange hcl.Range +} + +func (n *booleanVal) Range() hcl.Range { + return n.SrcRange +} + +func (n *booleanVal) StartRange() hcl.Range { + return n.SrcRange +} + +type numberVal struct { + Value *big.Float + SrcRange hcl.Range +} + +func (n *numberVal) Range() hcl.Range { + return n.SrcRange +} + +func (n *numberVal) StartRange() hcl.Range { + return n.SrcRange +} + +type stringVal struct { + Value string + SrcRange hcl.Range +} + +func (n *stringVal) Range() hcl.Range { + return n.SrcRange +} + +func (n *stringVal) StartRange() hcl.Range { + return n.SrcRange +} + +type nullVal struct { + SrcRange hcl.Range +} + +func (n *nullVal) Range() hcl.Range { + return n.SrcRange +} + +func (n *nullVal) StartRange() hcl.Range { + return n.SrcRange +} + +// invalidVal is used as a placeholder where a value is needed for a valid +// parse tree but the input was invalid enough to prevent one from being +// created. +type invalidVal struct { + SrcRange hcl.Range +} + +func (n invalidVal) Range() hcl.Range { + return n.SrcRange +} + +func (n invalidVal) StartRange() hcl.Range { + return n.SrcRange +} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/didyoumean.go b/vendor/github.com/hashicorp/hcl/v2/json/didyoumean.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/json/didyoumean.go rename to vendor/github.com/hashicorp/hcl/v2/json/didyoumean.go diff --git a/vendor/github.com/hashicorp/hcl/v2/json/doc.go b/vendor/github.com/hashicorp/hcl/v2/json/doc.go new file mode 100644 index 00000000000..84d731939fc --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/json/doc.go @@ -0,0 +1,12 @@ +// Package json is the JSON parser for HCL. It parses JSON files and returns +// implementations of the core HCL structural interfaces in terms of the +// JSON data inside. +// +// This is not a generic JSON parser. Instead, it deals with the mapping from +// the JSON information model to the HCL information model, using a number +// of hard-coded structural conventions. +// +// In most cases applications will not import this package directly, but will +// instead access its functionality indirectly through functions in the main +// "hcl" package and in the "hclparse" package. +package json diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/navigation.go b/vendor/github.com/hashicorp/hcl/v2/json/navigation.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/json/navigation.go rename to vendor/github.com/hashicorp/hcl/v2/json/navigation.go diff --git a/vendor/github.com/hashicorp/hcl/v2/json/parser.go b/vendor/github.com/hashicorp/hcl/v2/json/parser.go new file mode 100644 index 00000000000..7a54c51b6e1 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/json/parser.go @@ -0,0 +1,496 @@ +package json + +import ( + "encoding/json" + "fmt" + + "github.com/hashicorp/hcl/v2" + "github.com/zclconf/go-cty/cty" +) + +func parseFileContent(buf []byte, filename string) (node, hcl.Diagnostics) { + tokens := scan(buf, pos{ + Filename: filename, + Pos: hcl.Pos{ + Byte: 0, + Line: 1, + Column: 1, + }, + }) + p := newPeeker(tokens) + node, diags := parseValue(p) + if len(diags) == 0 && p.Peek().Type != tokenEOF { + diags = diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Extraneous data after value", + Detail: "Extra characters appear after the JSON value.", + Subject: p.Peek().Range.Ptr(), + }) + } + return node, diags +} + +func parseValue(p *peeker) (node, hcl.Diagnostics) { + tok := p.Peek() + + wrapInvalid := func(n node, diags hcl.Diagnostics) (node, hcl.Diagnostics) { + if n != nil { + return n, diags + } + return invalidVal{tok.Range}, diags + } + + switch tok.Type { + case tokenBraceO: + return wrapInvalid(parseObject(p)) + case tokenBrackO: + return wrapInvalid(parseArray(p)) + case tokenNumber: + return wrapInvalid(parseNumber(p)) + case tokenString: + return wrapInvalid(parseString(p)) + case tokenKeyword: + return wrapInvalid(parseKeyword(p)) + case tokenBraceC: + return wrapInvalid(nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Missing JSON value", + Detail: "A JSON value must start with a brace, a bracket, a number, a string, or a keyword.", + Subject: &tok.Range, + }, + }) + case tokenBrackC: + return wrapInvalid(nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Missing array element value", + Detail: "A JSON value must start with a brace, a bracket, a number, a string, or a keyword.", + Subject: &tok.Range, + }, + }) + case tokenEOF: + return wrapInvalid(nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Missing value", + Detail: "The JSON data ends prematurely.", + Subject: &tok.Range, + }, + }) + default: + return wrapInvalid(nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Invalid start of value", + Detail: "A JSON value must start with a brace, a bracket, a number, a string, or a keyword.", + Subject: &tok.Range, + }, + }) + } +} + +func tokenCanStartValue(tok token) bool { + switch tok.Type { + case tokenBraceO, tokenBrackO, tokenNumber, tokenString, tokenKeyword: + return true + default: + return false + } +} + +func parseObject(p *peeker) (node, hcl.Diagnostics) { + var diags hcl.Diagnostics + + open := p.Read() + attrs := []*objectAttr{} + + // recover is used to shift the peeker to what seems to be the end of + // our object, so that when we encounter an error we leave the peeker + // at a reasonable point in the token stream to continue parsing. + recover := func(tok token) { + open := 1 + for { + switch tok.Type { + case tokenBraceO: + open++ + case tokenBraceC: + open-- + if open <= 1 { + return + } + case tokenEOF: + // Ran out of source before we were able to recover, + // so we'll bail here and let the caller deal with it. + return + } + tok = p.Read() + } + } + +Token: + for { + if p.Peek().Type == tokenBraceC { + break Token + } + + keyNode, keyDiags := parseValue(p) + diags = diags.Extend(keyDiags) + if keyNode == nil { + return nil, diags + } + + keyStrNode, ok := keyNode.(*stringVal) + if !ok { + return nil, diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid object property name", + Detail: "A JSON object property name must be a string", + Subject: keyNode.StartRange().Ptr(), + }) + } + + key := keyStrNode.Value + + colon := p.Read() + if colon.Type != tokenColon { + recover(colon) + + if colon.Type == tokenBraceC || colon.Type == tokenComma { + // Catch common mistake of using braces instead of brackets + // for an object. + return nil, diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing object value", + Detail: "A JSON object attribute must have a value, introduced by a colon.", + Subject: &colon.Range, + }) + } + + if colon.Type == tokenEquals { + // Possible confusion with native HCL syntax. + return nil, diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing property value colon", + Detail: "JSON uses a colon as its name/value delimiter, not an equals sign.", + Subject: &colon.Range, + }) + } + + return nil, diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing property value colon", + Detail: "A colon must appear between an object property's name and its value.", + Subject: &colon.Range, + }) + } + + valNode, valDiags := parseValue(p) + diags = diags.Extend(valDiags) + if valNode == nil { + return nil, diags + } + + attrs = append(attrs, &objectAttr{ + Name: key, + Value: valNode, + NameRange: keyStrNode.SrcRange, + }) + + switch p.Peek().Type { + case tokenComma: + comma := p.Read() + if p.Peek().Type == tokenBraceC { + // Special error message for this common mistake + return nil, diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Trailing comma in object", + Detail: "JSON does not permit a trailing comma after the final property in an object.", + Subject: &comma.Range, + }) + } + continue Token + case tokenEOF: + return nil, diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Unclosed object", + Detail: "No closing brace was found for this JSON object.", + Subject: &open.Range, + }) + case tokenBrackC: + // Consume the bracket anyway, so that we don't return with the peeker + // at a strange place. + p.Read() + return nil, diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Mismatched braces", + Detail: "A JSON object must be closed with a brace, not a bracket.", + Subject: p.Peek().Range.Ptr(), + }) + case tokenBraceC: + break Token + default: + recover(p.Read()) + return nil, diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing attribute seperator comma", + Detail: "A comma must appear between each property definition in an object.", + Subject: p.Peek().Range.Ptr(), + }) + } + + } + + close := p.Read() + return &objectVal{ + Attrs: attrs, + SrcRange: hcl.RangeBetween(open.Range, close.Range), + OpenRange: open.Range, + CloseRange: close.Range, + }, diags +} + +func parseArray(p *peeker) (node, hcl.Diagnostics) { + var diags hcl.Diagnostics + + open := p.Read() + vals := []node{} + + // recover is used to shift the peeker to what seems to be the end of + // our array, so that when we encounter an error we leave the peeker + // at a reasonable point in the token stream to continue parsing. + recover := func(tok token) { + open := 1 + for { + switch tok.Type { + case tokenBrackO: + open++ + case tokenBrackC: + open-- + if open <= 1 { + return + } + case tokenEOF: + // Ran out of source before we were able to recover, + // so we'll bail here and let the caller deal with it. + return + } + tok = p.Read() + } + } + +Token: + for { + if p.Peek().Type == tokenBrackC { + break Token + } + + valNode, valDiags := parseValue(p) + diags = diags.Extend(valDiags) + if valNode == nil { + return nil, diags + } + + vals = append(vals, valNode) + + switch p.Peek().Type { + case tokenComma: + comma := p.Read() + if p.Peek().Type == tokenBrackC { + // Special error message for this common mistake + return nil, diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Trailing comma in array", + Detail: "JSON does not permit a trailing comma after the final value in an array.", + Subject: &comma.Range, + }) + } + continue Token + case tokenColon: + recover(p.Read()) + return nil, diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid array value", + Detail: "A colon is not used to introduce values in a JSON array.", + Subject: p.Peek().Range.Ptr(), + }) + case tokenEOF: + recover(p.Read()) + return nil, diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Unclosed object", + Detail: "No closing bracket was found for this JSON array.", + Subject: &open.Range, + }) + case tokenBraceC: + recover(p.Read()) + return nil, diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Mismatched brackets", + Detail: "A JSON array must be closed with a bracket, not a brace.", + Subject: p.Peek().Range.Ptr(), + }) + case tokenBrackC: + break Token + default: + recover(p.Read()) + return nil, diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing attribute seperator comma", + Detail: "A comma must appear between each value in an array.", + Subject: p.Peek().Range.Ptr(), + }) + } + + } + + close := p.Read() + return &arrayVal{ + Values: vals, + SrcRange: hcl.RangeBetween(open.Range, close.Range), + OpenRange: open.Range, + }, diags +} + +func parseNumber(p *peeker) (node, hcl.Diagnostics) { + tok := p.Read() + + // Use encoding/json to validate the number syntax. + // TODO: Do this more directly to produce better diagnostics. + var num json.Number + err := json.Unmarshal(tok.Bytes, &num) + if err != nil { + return nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Invalid JSON number", + Detail: fmt.Sprintf("There is a syntax error in the given JSON number."), + Subject: &tok.Range, + }, + } + } + + // We want to guarantee that we parse numbers the same way as cty (and thus + // native syntax HCL) would here, so we'll use the cty parser even though + // in most other cases we don't actually introduce cty concepts until + // decoding time. We'll unwrap the parsed float immediately afterwards, so + // the cty value is just a temporary helper. + nv, err := cty.ParseNumberVal(string(num)) + if err != nil { + // Should never happen if above passed, since JSON numbers are a subset + // of what cty can parse... + return nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Invalid JSON number", + Detail: fmt.Sprintf("There is a syntax error in the given JSON number."), + Subject: &tok.Range, + }, + } + } + + return &numberVal{ + Value: nv.AsBigFloat(), + SrcRange: tok.Range, + }, nil +} + +func parseString(p *peeker) (node, hcl.Diagnostics) { + tok := p.Read() + var str string + err := json.Unmarshal(tok.Bytes, &str) + + if err != nil { + var errRange hcl.Range + if serr, ok := err.(*json.SyntaxError); ok { + errOfs := serr.Offset + errPos := tok.Range.Start + errPos.Byte += int(errOfs) + + // TODO: Use the byte offset to properly count unicode + // characters for the column, and mark the whole of the + // character that was wrong as part of our range. + errPos.Column += int(errOfs) + + errEndPos := errPos + errEndPos.Byte++ + errEndPos.Column++ + + errRange = hcl.Range{ + Filename: tok.Range.Filename, + Start: errPos, + End: errEndPos, + } + } else { + errRange = tok.Range + } + + var contextRange *hcl.Range + if errRange != tok.Range { + contextRange = &tok.Range + } + + // FIXME: Eventually we should parse strings directly here so + // we can produce a more useful error message in the face fo things + // such as invalid escapes, etc. + return nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Invalid JSON string", + Detail: fmt.Sprintf("There is a syntax error in the given JSON string."), + Subject: &errRange, + Context: contextRange, + }, + } + } + + return &stringVal{ + Value: str, + SrcRange: tok.Range, + }, nil +} + +func parseKeyword(p *peeker) (node, hcl.Diagnostics) { + tok := p.Read() + s := string(tok.Bytes) + + switch s { + case "true": + return &booleanVal{ + Value: true, + SrcRange: tok.Range, + }, nil + case "false": + return &booleanVal{ + Value: false, + SrcRange: tok.Range, + }, nil + case "null": + return &nullVal{ + SrcRange: tok.Range, + }, nil + case "undefined", "NaN", "Infinity": + return nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Invalid JSON keyword", + Detail: fmt.Sprintf("The JavaScript identifier %q cannot be used in JSON.", s), + Subject: &tok.Range, + }, + } + default: + var dym string + if suggest := keywordSuggestion(s); suggest != "" { + dym = fmt.Sprintf(" Did you mean %q?", suggest) + } + + return nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Invalid JSON keyword", + Detail: fmt.Sprintf("%q is not a valid JSON keyword.%s", s, dym), + Subject: &tok.Range, + }, + } + } +} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/peeker.go b/vendor/github.com/hashicorp/hcl/v2/json/peeker.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/json/peeker.go rename to vendor/github.com/hashicorp/hcl/v2/json/peeker.go diff --git a/vendor/github.com/hashicorp/hcl/v2/json/public.go b/vendor/github.com/hashicorp/hcl/v2/json/public.go new file mode 100644 index 00000000000..8dc4a36afe6 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/json/public.go @@ -0,0 +1,94 @@ +package json + +import ( + "fmt" + "io/ioutil" + "os" + + "github.com/hashicorp/hcl/v2" +) + +// Parse attempts to parse the given buffer as JSON and, if successful, returns +// a hcl.File for the HCL configuration represented by it. +// +// This is not a generic JSON parser. Instead, it deals only with the profile +// of JSON used to express HCL configuration. +// +// The returned file is valid only if the returned diagnostics returns false +// from its HasErrors method. If HasErrors returns true, the file represents +// the subset of data that was able to be parsed, which may be none. +func Parse(src []byte, filename string) (*hcl.File, hcl.Diagnostics) { + rootNode, diags := parseFileContent(src, filename) + + switch rootNode.(type) { + case *objectVal, *arrayVal: + // okay + default: + diags = diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Root value must be object", + Detail: "The root value in a JSON-based configuration must be either a JSON object or a JSON array of objects.", + Subject: rootNode.StartRange().Ptr(), + }) + + // Since we've already produced an error message for this being + // invalid, we'll return an empty placeholder here so that trying to + // extract content from our root body won't produce a redundant + // error saying the same thing again in more general terms. + fakePos := hcl.Pos{ + Byte: 0, + Line: 1, + Column: 1, + } + fakeRange := hcl.Range{ + Filename: filename, + Start: fakePos, + End: fakePos, + } + rootNode = &objectVal{ + Attrs: []*objectAttr{}, + SrcRange: fakeRange, + OpenRange: fakeRange, + } + } + + file := &hcl.File{ + Body: &body{ + val: rootNode, + }, + Bytes: src, + Nav: navigation{rootNode}, + } + return file, diags +} + +// ParseFile is a convenience wrapper around Parse that first attempts to load +// data from the given filename, passing the result to Parse if successful. +// +// If the file cannot be read, an error diagnostic with nil context is returned. +func ParseFile(filename string) (*hcl.File, hcl.Diagnostics) { + f, err := os.Open(filename) + if err != nil { + return nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Failed to open file", + Detail: fmt.Sprintf("The file %q could not be opened.", filename), + }, + } + } + defer f.Close() + + src, err := ioutil.ReadAll(f) + if err != nil { + return nil, hcl.Diagnostics{ + { + Severity: hcl.DiagError, + Summary: "Failed to read file", + Detail: fmt.Sprintf("The file %q was opened, but an error occured while reading it.", filename), + }, + } + } + + return Parse(src, filename) +} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/scanner.go b/vendor/github.com/hashicorp/hcl/v2/json/scanner.go similarity index 99% rename from vendor/github.com/hashicorp/hcl2/hcl/json/scanner.go rename to vendor/github.com/hashicorp/hcl/v2/json/scanner.go index da728842391..912eabce23f 100644 --- a/vendor/github.com/hashicorp/hcl2/hcl/json/scanner.go +++ b/vendor/github.com/hashicorp/hcl/v2/json/scanner.go @@ -4,7 +4,7 @@ import ( "fmt" "github.com/apparentlymart/go-textseg/textseg" - "github.com/hashicorp/hcl2/hcl" + "github.com/hashicorp/hcl/v2" ) //go:generate stringer -type tokenType scanner.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/spec.md b/vendor/github.com/hashicorp/hcl/v2/json/spec.md similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/json/spec.md rename to vendor/github.com/hashicorp/hcl/v2/json/spec.md diff --git a/vendor/github.com/hashicorp/hcl/v2/json/structure.go b/vendor/github.com/hashicorp/hcl/v2/json/structure.go new file mode 100644 index 00000000000..76c9d739996 --- /dev/null +++ b/vendor/github.com/hashicorp/hcl/v2/json/structure.go @@ -0,0 +1,637 @@ +package json + +import ( + "fmt" + + "github.com/hashicorp/hcl/v2" + "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/zclconf/go-cty/cty" + "github.com/zclconf/go-cty/cty/convert" +) + +// body is the implementation of "Body" used for files processed with the JSON +// parser. +type body struct { + val node + + // If non-nil, the keys of this map cause the corresponding attributes to + // be treated as non-existing. This is used when Body.PartialContent is + // called, to produce the "remaining content" Body. + hiddenAttrs map[string]struct{} +} + +// expression is the implementation of "Expression" used for files processed +// with the JSON parser. +type expression struct { + src node +} + +func (b *body) Content(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Diagnostics) { + content, newBody, diags := b.PartialContent(schema) + + hiddenAttrs := newBody.(*body).hiddenAttrs + + var nameSuggestions []string + for _, attrS := range schema.Attributes { + if _, ok := hiddenAttrs[attrS.Name]; !ok { + // Only suggest an attribute name if we didn't use it already. + nameSuggestions = append(nameSuggestions, attrS.Name) + } + } + for _, blockS := range schema.Blocks { + // Blocks can appear multiple times, so we'll suggest their type + // names regardless of whether they've already been used. + nameSuggestions = append(nameSuggestions, blockS.Type) + } + + jsonAttrs, attrDiags := b.collectDeepAttrs(b.val, nil) + diags = append(diags, attrDiags...) + + for _, attr := range jsonAttrs { + k := attr.Name + if k == "//" { + // Ignore "//" keys in objects representing bodies, to allow + // their use as comments. + continue + } + + if _, ok := hiddenAttrs[k]; !ok { + suggestion := nameSuggestion(k, nameSuggestions) + if suggestion != "" { + suggestion = fmt.Sprintf(" Did you mean %q?", suggestion) + } + + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Extraneous JSON object property", + Detail: fmt.Sprintf("No argument or block type is named %q.%s", k, suggestion), + Subject: &attr.NameRange, + Context: attr.Range().Ptr(), + }) + } + } + + return content, diags +} + +func (b *body) PartialContent(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Body, hcl.Diagnostics) { + var diags hcl.Diagnostics + + jsonAttrs, attrDiags := b.collectDeepAttrs(b.val, nil) + diags = append(diags, attrDiags...) + + usedNames := map[string]struct{}{} + if b.hiddenAttrs != nil { + for k := range b.hiddenAttrs { + usedNames[k] = struct{}{} + } + } + + content := &hcl.BodyContent{ + Attributes: map[string]*hcl.Attribute{}, + Blocks: nil, + + MissingItemRange: b.MissingItemRange(), + } + + // Create some more convenient data structures for our work below. + attrSchemas := map[string]hcl.AttributeSchema{} + blockSchemas := map[string]hcl.BlockHeaderSchema{} + for _, attrS := range schema.Attributes { + attrSchemas[attrS.Name] = attrS + } + for _, blockS := range schema.Blocks { + blockSchemas[blockS.Type] = blockS + } + + for _, jsonAttr := range jsonAttrs { + attrName := jsonAttr.Name + if _, used := b.hiddenAttrs[attrName]; used { + continue + } + + if attrS, defined := attrSchemas[attrName]; defined { + if existing, exists := content.Attributes[attrName]; exists { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Duplicate argument", + Detail: fmt.Sprintf("The argument %q was already set at %s.", attrName, existing.Range), + Subject: &jsonAttr.NameRange, + Context: jsonAttr.Range().Ptr(), + }) + continue + } + + content.Attributes[attrS.Name] = &hcl.Attribute{ + Name: attrS.Name, + Expr: &expression{src: jsonAttr.Value}, + Range: hcl.RangeBetween(jsonAttr.NameRange, jsonAttr.Value.Range()), + NameRange: jsonAttr.NameRange, + } + usedNames[attrName] = struct{}{} + + } else if blockS, defined := blockSchemas[attrName]; defined { + bv := jsonAttr.Value + blockDiags := b.unpackBlock(bv, blockS.Type, &jsonAttr.NameRange, blockS.LabelNames, nil, nil, &content.Blocks) + diags = append(diags, blockDiags...) + usedNames[attrName] = struct{}{} + } + + // We ignore anything that isn't defined because that's the + // PartialContent contract. The Content method will catch leftovers. + } + + // Make sure we got all the required attributes. + for _, attrS := range schema.Attributes { + if !attrS.Required { + continue + } + if _, defined := content.Attributes[attrS.Name]; !defined { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing required argument", + Detail: fmt.Sprintf("The argument %q is required, but no definition was found.", attrS.Name), + Subject: b.MissingItemRange().Ptr(), + }) + } + } + + unusedBody := &body{ + val: b.val, + hiddenAttrs: usedNames, + } + + return content, unusedBody, diags +} + +// JustAttributes for JSON bodies interprets all properties of the wrapped +// JSON object as attributes and returns them. +func (b *body) JustAttributes() (hcl.Attributes, hcl.Diagnostics) { + var diags hcl.Diagnostics + attrs := make(map[string]*hcl.Attribute) + + obj, ok := b.val.(*objectVal) + if !ok { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Incorrect JSON value type", + Detail: "A JSON object is required here, setting the arguments for this block.", + Subject: b.val.StartRange().Ptr(), + }) + return attrs, diags + } + + for _, jsonAttr := range obj.Attrs { + name := jsonAttr.Name + if name == "//" { + // Ignore "//" keys in objects representing bodies, to allow + // their use as comments. + continue + } + + if _, hidden := b.hiddenAttrs[name]; hidden { + continue + } + + if existing, exists := attrs[name]; exists { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Duplicate attribute definition", + Detail: fmt.Sprintf("The argument %q was already set at %s.", name, existing.Range), + Subject: &jsonAttr.NameRange, + }) + continue + } + + attrs[name] = &hcl.Attribute{ + Name: name, + Expr: &expression{src: jsonAttr.Value}, + Range: hcl.RangeBetween(jsonAttr.NameRange, jsonAttr.Value.Range()), + NameRange: jsonAttr.NameRange, + } + } + + // No diagnostics possible here, since the parser already took care of + // finding duplicates and every JSON value can be a valid attribute value. + return attrs, diags +} + +func (b *body) MissingItemRange() hcl.Range { + switch tv := b.val.(type) { + case *objectVal: + return tv.CloseRange + case *arrayVal: + return tv.OpenRange + default: + // Should not happen in correct operation, but might show up if the + // input is invalid and we are producing partial results. + return tv.StartRange() + } +} + +func (b *body) unpackBlock(v node, typeName string, typeRange *hcl.Range, labelsLeft []string, labelsUsed []string, labelRanges []hcl.Range, blocks *hcl.Blocks) (diags hcl.Diagnostics) { + if len(labelsLeft) > 0 { + labelName := labelsLeft[0] + jsonAttrs, attrDiags := b.collectDeepAttrs(v, &labelName) + diags = append(diags, attrDiags...) + + if len(jsonAttrs) == 0 { + diags = diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Missing block label", + Detail: fmt.Sprintf("At least one object property is required, whose name represents the %s block's %s.", typeName, labelName), + Subject: v.StartRange().Ptr(), + }) + return + } + labelsUsed := append(labelsUsed, "") + labelRanges := append(labelRanges, hcl.Range{}) + for _, p := range jsonAttrs { + pk := p.Name + labelsUsed[len(labelsUsed)-1] = pk + labelRanges[len(labelRanges)-1] = p.NameRange + diags = append(diags, b.unpackBlock(p.Value, typeName, typeRange, labelsLeft[1:], labelsUsed, labelRanges, blocks)...) + } + return + } + + // By the time we get here, we've peeled off all the labels and we're ready + // to deal with the block's actual content. + + // need to copy the label slices because their underlying arrays will + // continue to be mutated after we return. + labels := make([]string, len(labelsUsed)) + copy(labels, labelsUsed) + labelR := make([]hcl.Range, len(labelRanges)) + copy(labelR, labelRanges) + + switch tv := v.(type) { + case *nullVal: + // There is no block content, e.g the value is null. + return + case *objectVal: + // Single instance of the block + *blocks = append(*blocks, &hcl.Block{ + Type: typeName, + Labels: labels, + Body: &body{ + val: tv, + }, + + DefRange: tv.OpenRange, + TypeRange: *typeRange, + LabelRanges: labelR, + }) + case *arrayVal: + // Multiple instances of the block + for _, av := range tv.Values { + *blocks = append(*blocks, &hcl.Block{ + Type: typeName, + Labels: labels, + Body: &body{ + val: av, // might be mistyped; we'll find out when content is requested for this body + }, + + DefRange: tv.OpenRange, + TypeRange: *typeRange, + LabelRanges: labelR, + }) + } + default: + diags = diags.Append(&hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Incorrect JSON value type", + Detail: fmt.Sprintf("Either a JSON object or a JSON array is required, representing the contents of one or more %q blocks.", typeName), + Subject: v.StartRange().Ptr(), + }) + } + return +} + +// collectDeepAttrs takes either a single object or an array of objects and +// flattens it into a list of object attributes, collecting attributes from +// all of the objects in a given array. +// +// Ordering is preserved, so a list of objects that each have one property +// will result in those properties being returned in the same order as the +// objects appeared in the array. +// +// This is appropriate for use only for objects representing bodies or labels +// within a block. +// +// The labelName argument, if non-null, is used to tailor returned error +// messages to refer to block labels rather than attributes and child blocks. +// It has no other effect. +func (b *body) collectDeepAttrs(v node, labelName *string) ([]*objectAttr, hcl.Diagnostics) { + var diags hcl.Diagnostics + var attrs []*objectAttr + + switch tv := v.(type) { + case *nullVal: + // If a value is null, then we don't return any attributes or return an error. + + case *objectVal: + attrs = append(attrs, tv.Attrs...) + + case *arrayVal: + for _, ev := range tv.Values { + switch tev := ev.(type) { + case *objectVal: + attrs = append(attrs, tev.Attrs...) + default: + if labelName != nil { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Incorrect JSON value type", + Detail: fmt.Sprintf("A JSON object is required here, to specify %s labels for this block.", *labelName), + Subject: ev.StartRange().Ptr(), + }) + } else { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Incorrect JSON value type", + Detail: "A JSON object is required here, to define arguments and child blocks.", + Subject: ev.StartRange().Ptr(), + }) + } + } + } + + default: + if labelName != nil { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Incorrect JSON value type", + Detail: fmt.Sprintf("Either a JSON object or JSON array of objects is required here, to specify %s labels for this block.", *labelName), + Subject: v.StartRange().Ptr(), + }) + } else { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Incorrect JSON value type", + Detail: "Either a JSON object or JSON array of objects is required here, to define arguments and child blocks.", + Subject: v.StartRange().Ptr(), + }) + } + } + + return attrs, diags +} + +func (e *expression) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { + switch v := e.src.(type) { + case *stringVal: + if ctx != nil { + // Parse string contents as a HCL native language expression. + // We only do this if we have a context, so passing a nil context + // is how the caller specifies that interpolations are not allowed + // and that the string should just be returned verbatim. + templateSrc := v.Value + expr, diags := hclsyntax.ParseTemplate( + []byte(templateSrc), + v.SrcRange.Filename, + + // This won't produce _exactly_ the right result, since + // the hclsyntax parser can't "see" any escapes we removed + // while parsing JSON, but it's better than nothing. + hcl.Pos{ + Line: v.SrcRange.Start.Line, + + // skip over the opening quote mark + Byte: v.SrcRange.Start.Byte + 1, + Column: v.SrcRange.Start.Column + 1, + }, + ) + if diags.HasErrors() { + return cty.DynamicVal, diags + } + val, evalDiags := expr.Value(ctx) + diags = append(diags, evalDiags...) + return val, diags + } + + return cty.StringVal(v.Value), nil + case *numberVal: + return cty.NumberVal(v.Value), nil + case *booleanVal: + return cty.BoolVal(v.Value), nil + case *arrayVal: + var diags hcl.Diagnostics + vals := []cty.Value{} + for _, jsonVal := range v.Values { + val, valDiags := (&expression{src: jsonVal}).Value(ctx) + vals = append(vals, val) + diags = append(diags, valDiags...) + } + return cty.TupleVal(vals), diags + case *objectVal: + var diags hcl.Diagnostics + attrs := map[string]cty.Value{} + attrRanges := map[string]hcl.Range{} + known := true + for _, jsonAttr := range v.Attrs { + // In this one context we allow keys to contain interpolation + // expressions too, assuming we're evaluating in interpolation + // mode. This achieves parity with the native syntax where + // object expressions can have dynamic keys, while block contents + // may not. + name, nameDiags := (&expression{src: &stringVal{ + Value: jsonAttr.Name, + SrcRange: jsonAttr.NameRange, + }}).Value(ctx) + valExpr := &expression{src: jsonAttr.Value} + val, valDiags := valExpr.Value(ctx) + diags = append(diags, nameDiags...) + diags = append(diags, valDiags...) + + var err error + name, err = convert.Convert(name, cty.String) + if err != nil { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid object key expression", + Detail: fmt.Sprintf("Cannot use this expression as an object key: %s.", err), + Subject: &jsonAttr.NameRange, + Expression: valExpr, + EvalContext: ctx, + }) + continue + } + if name.IsNull() { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Invalid object key expression", + Detail: "Cannot use null value as an object key.", + Subject: &jsonAttr.NameRange, + Expression: valExpr, + EvalContext: ctx, + }) + continue + } + if !name.IsKnown() { + // This is a bit of a weird case, since our usual rules require + // us to tolerate unknowns and just represent the result as + // best we can but if we don't know the key then we can't + // know the type of our object at all, and thus we must turn + // the whole thing into cty.DynamicVal. This is consistent with + // how this situation is handled in the native syntax. + // We'll keep iterating so we can collect other errors in + // subsequent attributes. + known = false + continue + } + nameStr := name.AsString() + if _, defined := attrs[nameStr]; defined { + diags = append(diags, &hcl.Diagnostic{ + Severity: hcl.DiagError, + Summary: "Duplicate object attribute", + Detail: fmt.Sprintf("An attribute named %q was already defined at %s.", nameStr, attrRanges[nameStr]), + Subject: &jsonAttr.NameRange, + Expression: e, + EvalContext: ctx, + }) + continue + } + attrs[nameStr] = val + attrRanges[nameStr] = jsonAttr.NameRange + } + if !known { + // We encountered an unknown key somewhere along the way, so + // we can't know what our type will eventually be. + return cty.DynamicVal, diags + } + return cty.ObjectVal(attrs), diags + case *nullVal: + return cty.NullVal(cty.DynamicPseudoType), nil + default: + // Default to DynamicVal so that ASTs containing invalid nodes can + // still be partially-evaluated. + return cty.DynamicVal, nil + } +} + +func (e *expression) Variables() []hcl.Traversal { + var vars []hcl.Traversal + + switch v := e.src.(type) { + case *stringVal: + templateSrc := v.Value + expr, diags := hclsyntax.ParseTemplate( + []byte(templateSrc), + v.SrcRange.Filename, + + // This won't produce _exactly_ the right result, since + // the hclsyntax parser can't "see" any escapes we removed + // while parsing JSON, but it's better than nothing. + hcl.Pos{ + Line: v.SrcRange.Start.Line, + + // skip over the opening quote mark + Byte: v.SrcRange.Start.Byte + 1, + Column: v.SrcRange.Start.Column + 1, + }, + ) + if diags.HasErrors() { + return vars + } + return expr.Variables() + + case *arrayVal: + for _, jsonVal := range v.Values { + vars = append(vars, (&expression{src: jsonVal}).Variables()...) + } + case *objectVal: + for _, jsonAttr := range v.Attrs { + keyExpr := &stringVal{ // we're going to treat key as an expression in this context + Value: jsonAttr.Name, + SrcRange: jsonAttr.NameRange, + } + vars = append(vars, (&expression{src: keyExpr}).Variables()...) + vars = append(vars, (&expression{src: jsonAttr.Value}).Variables()...) + } + } + + return vars +} + +func (e *expression) Range() hcl.Range { + return e.src.Range() +} + +func (e *expression) StartRange() hcl.Range { + return e.src.StartRange() +} + +// Implementation for hcl.AbsTraversalForExpr. +func (e *expression) AsTraversal() hcl.Traversal { + // In JSON-based syntax a traversal is given as a string containing + // traversal syntax as defined by hclsyntax.ParseTraversalAbs. + + switch v := e.src.(type) { + case *stringVal: + traversal, diags := hclsyntax.ParseTraversalAbs([]byte(v.Value), v.SrcRange.Filename, v.SrcRange.Start) + if diags.HasErrors() { + return nil + } + return traversal + default: + return nil + } +} + +// Implementation for hcl.ExprCall. +func (e *expression) ExprCall() *hcl.StaticCall { + // In JSON-based syntax a static call is given as a string containing + // an expression in the native syntax that also supports ExprCall. + + switch v := e.src.(type) { + case *stringVal: + expr, diags := hclsyntax.ParseExpression([]byte(v.Value), v.SrcRange.Filename, v.SrcRange.Start) + if diags.HasErrors() { + return nil + } + + call, diags := hcl.ExprCall(expr) + if diags.HasErrors() { + return nil + } + + return call + default: + return nil + } +} + +// Implementation for hcl.ExprList. +func (e *expression) ExprList() []hcl.Expression { + switch v := e.src.(type) { + case *arrayVal: + ret := make([]hcl.Expression, len(v.Values)) + for i, node := range v.Values { + ret[i] = &expression{src: node} + } + return ret + default: + return nil + } +} + +// Implementation for hcl.ExprMap. +func (e *expression) ExprMap() []hcl.KeyValuePair { + switch v := e.src.(type) { + case *objectVal: + ret := make([]hcl.KeyValuePair, len(v.Attrs)) + for i, jsonAttr := range v.Attrs { + ret[i] = hcl.KeyValuePair{ + Key: &expression{src: &stringVal{ + Value: jsonAttr.Name, + SrcRange: jsonAttr.NameRange, + }}, + Value: &expression{src: jsonAttr.Value}, + } + } + return ret + default: + return nil + } +} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/json/tokentype_string.go b/vendor/github.com/hashicorp/hcl/v2/json/tokentype_string.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/json/tokentype_string.go rename to vendor/github.com/hashicorp/hcl/v2/json/tokentype_string.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/merged.go b/vendor/github.com/hashicorp/hcl/v2/merged.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/merged.go rename to vendor/github.com/hashicorp/hcl/v2/merged.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/ops.go b/vendor/github.com/hashicorp/hcl/v2/ops.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/ops.go rename to vendor/github.com/hashicorp/hcl/v2/ops.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/pos.go b/vendor/github.com/hashicorp/hcl/v2/pos.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/pos.go rename to vendor/github.com/hashicorp/hcl/v2/pos.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/pos_scanner.go b/vendor/github.com/hashicorp/hcl/v2/pos_scanner.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/pos_scanner.go rename to vendor/github.com/hashicorp/hcl/v2/pos_scanner.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/schema.go b/vendor/github.com/hashicorp/hcl/v2/schema.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/schema.go rename to vendor/github.com/hashicorp/hcl/v2/schema.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/spec.md b/vendor/github.com/hashicorp/hcl/v2/spec.md similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/spec.md rename to vendor/github.com/hashicorp/hcl/v2/spec.md diff --git a/vendor/github.com/hashicorp/hcl2/hcl/static_expr.go b/vendor/github.com/hashicorp/hcl/v2/static_expr.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/static_expr.go rename to vendor/github.com/hashicorp/hcl/v2/static_expr.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/structure.go b/vendor/github.com/hashicorp/hcl/v2/structure.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/structure.go rename to vendor/github.com/hashicorp/hcl/v2/structure.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/structure_at_pos.go b/vendor/github.com/hashicorp/hcl/v2/structure_at_pos.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/structure_at_pos.go rename to vendor/github.com/hashicorp/hcl/v2/structure_at_pos.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/traversal.go b/vendor/github.com/hashicorp/hcl/v2/traversal.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/traversal.go rename to vendor/github.com/hashicorp/hcl/v2/traversal.go diff --git a/vendor/github.com/hashicorp/hcl2/hcl/traversal_for_expr.go b/vendor/github.com/hashicorp/hcl/v2/traversal_for_expr.go similarity index 100% rename from vendor/github.com/hashicorp/hcl2/hcl/traversal_for_expr.go rename to vendor/github.com/hashicorp/hcl/v2/traversal_for_expr.go diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/public.go b/vendor/github.com/hashicorp/hcl2/ext/dynblock/public.go deleted file mode 100644 index b7e8ca95170..00000000000 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/public.go +++ /dev/null @@ -1,44 +0,0 @@ -package dynblock - -import ( - "github.com/hashicorp/hcl2/hcl" -) - -// Expand "dynamic" blocks in the given body, returning a new body that -// has those blocks expanded. -// -// The given EvalContext is used when evaluating "for_each" and "labels" -// attributes within dynamic blocks, allowing those expressions access to -// variables and functions beyond the iterator variable created by the -// iteration. -// -// Expand returns no diagnostics because no blocks are actually expanded -// until a call to Content or PartialContent on the returned body, which -// will then expand only the blocks selected by the schema. -// -// "dynamic" blocks are also expanded automatically within nested blocks -// in the given body, including within other dynamic blocks, thus allowing -// multi-dimensional iteration. However, it is not possible to -// dynamically-generate the "dynamic" blocks themselves except through nesting. -// -// parent { -// dynamic "child" { -// for_each = child_objs -// content { -// dynamic "grandchild" { -// for_each = child.value.children -// labels = [grandchild.key] -// content { -// parent_key = child.key -// value = grandchild.value -// } -// } -// } -// } -// } -func Expand(body hcl.Body, ctx *hcl.EvalContext) hcl.Body { - return &expandBody{ - original: body, - forEachCtx: ctx, - } -} diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/schema.go b/vendor/github.com/hashicorp/hcl2/ext/dynblock/schema.go deleted file mode 100644 index dc8ed5a2f40..00000000000 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/schema.go +++ /dev/null @@ -1,50 +0,0 @@ -package dynblock - -import "github.com/hashicorp/hcl2/hcl" - -var dynamicBlockHeaderSchema = hcl.BlockHeaderSchema{ - Type: "dynamic", - LabelNames: []string{"type"}, -} - -var dynamicBlockBodySchemaLabels = &hcl.BodySchema{ - Attributes: []hcl.AttributeSchema{ - { - Name: "for_each", - Required: true, - }, - { - Name: "iterator", - Required: false, - }, - { - Name: "labels", - Required: true, - }, - }, - Blocks: []hcl.BlockHeaderSchema{ - { - Type: "content", - LabelNames: nil, - }, - }, -} - -var dynamicBlockBodySchemaNoLabels = &hcl.BodySchema{ - Attributes: []hcl.AttributeSchema{ - { - Name: "for_each", - Required: true, - }, - { - Name: "iterator", - Required: false, - }, - }, - Blocks: []hcl.BlockHeaderSchema{ - { - Type: "content", - LabelNames: nil, - }, - }, -} diff --git a/vendor/github.com/hashicorp/hcl2/ext/dynblock/variables.go b/vendor/github.com/hashicorp/hcl2/ext/dynblock/variables.go deleted file mode 100644 index ad838f3e87e..00000000000 --- a/vendor/github.com/hashicorp/hcl2/ext/dynblock/variables.go +++ /dev/null @@ -1,209 +0,0 @@ -package dynblock - -import ( - "github.com/hashicorp/hcl2/hcl" - "github.com/zclconf/go-cty/cty" -) - -// WalkVariables begins the recursive process of walking all expressions and -// nested blocks in the given body and its child bodies while taking into -// account any "dynamic" blocks. -// -// This function requires that the caller walk through the nested block -// structure in the given body level-by-level so that an appropriate schema -// can be provided at each level to inform further processing. This workflow -// is thus easiest to use for calling applications that have some higher-level -// schema representation available with which to drive this multi-step -// process. If your application uses the hcldec package, you may be able to -// use VariablesHCLDec instead for a more automatic approach. -func WalkVariables(body hcl.Body) WalkVariablesNode { - return WalkVariablesNode{ - body: body, - includeContent: true, - } -} - -// WalkExpandVariables is like Variables but it includes only the variables -// required for successful block expansion, ignoring any variables referenced -// inside block contents. The result is the minimal set of all variables -// required for a call to Expand, excluding variables that would only be -// needed to subsequently call Content or PartialContent on the expanded -// body. -func WalkExpandVariables(body hcl.Body) WalkVariablesNode { - return WalkVariablesNode{ - body: body, - } -} - -type WalkVariablesNode struct { - body hcl.Body - it *iteration - - includeContent bool -} - -type WalkVariablesChild struct { - BlockTypeName string - Node WalkVariablesNode -} - -// Body returns the HCL Body associated with the child node, in case the caller -// wants to do some sort of inspection of it in order to decide what schema -// to pass to Visit. -// -// Most implementations should just fetch a fixed schema based on the -// BlockTypeName field and not access this. Deciding on a schema dynamically -// based on the body is a strange thing to do and generally necessary only if -// your caller is already doing other bizarre things with HCL bodies. -func (c WalkVariablesChild) Body() hcl.Body { - return c.Node.body -} - -// Visit returns the variable traversals required for any "dynamic" blocks -// directly in the body associated with this node, and also returns any child -// nodes that must be visited in order to continue the walk. -// -// Each child node has its associated block type name given in its BlockTypeName -// field, which the calling application should use to determine the appropriate -// schema for the content of each child node and pass it to the child node's -// own Visit method to continue the walk recursively. -func (n WalkVariablesNode) Visit(schema *hcl.BodySchema) (vars []hcl.Traversal, children []WalkVariablesChild) { - extSchema := n.extendSchema(schema) - container, _, _ := n.body.PartialContent(extSchema) - if container == nil { - return vars, children - } - - children = make([]WalkVariablesChild, 0, len(container.Blocks)) - - if n.includeContent { - for _, attr := range container.Attributes { - for _, traversal := range attr.Expr.Variables() { - var ours, inherited bool - if n.it != nil { - ours = traversal.RootName() == n.it.IteratorName - _, inherited = n.it.Inherited[traversal.RootName()] - } - - if !(ours || inherited) { - vars = append(vars, traversal) - } - } - } - } - - for _, block := range container.Blocks { - switch block.Type { - - case "dynamic": - blockTypeName := block.Labels[0] - inner, _, _ := block.Body.PartialContent(variableDetectionInnerSchema) - if inner == nil { - continue - } - - iteratorName := blockTypeName - if attr, exists := inner.Attributes["iterator"]; exists { - iterTraversal, _ := hcl.AbsTraversalForExpr(attr.Expr) - if len(iterTraversal) == 0 { - // Ignore this invalid dynamic block, since it'll produce - // an error if someone tries to extract content from it - // later anyway. - continue - } - iteratorName = iterTraversal.RootName() - } - blockIt := n.it.MakeChild(iteratorName, cty.DynamicVal, cty.DynamicVal) - - if attr, exists := inner.Attributes["for_each"]; exists { - // Filter out iterator names inherited from parent blocks - for _, traversal := range attr.Expr.Variables() { - if _, inherited := blockIt.Inherited[traversal.RootName()]; !inherited { - vars = append(vars, traversal) - } - } - } - if attr, exists := inner.Attributes["labels"]; exists { - // Filter out both our own iterator name _and_ those inherited - // from parent blocks, since we provide _both_ of these to the - // label expressions. - for _, traversal := range attr.Expr.Variables() { - ours := traversal.RootName() == iteratorName - _, inherited := blockIt.Inherited[traversal.RootName()] - - if !(ours || inherited) { - vars = append(vars, traversal) - } - } - } - - for _, contentBlock := range inner.Blocks { - // We only request "content" blocks in our schema, so we know - // any blocks we find here will be content blocks. We require - // exactly one content block for actual expansion, but we'll - // be more liberal here so that callers can still collect - // variables from erroneous "dynamic" blocks. - children = append(children, WalkVariablesChild{ - BlockTypeName: blockTypeName, - Node: WalkVariablesNode{ - body: contentBlock.Body, - it: blockIt, - includeContent: n.includeContent, - }, - }) - } - - default: - children = append(children, WalkVariablesChild{ - BlockTypeName: block.Type, - Node: WalkVariablesNode{ - body: block.Body, - it: n.it, - includeContent: n.includeContent, - }, - }) - - } - } - - return vars, children -} - -func (n WalkVariablesNode) extendSchema(schema *hcl.BodySchema) *hcl.BodySchema { - // We augment the requested schema to also include our special "dynamic" - // block type, since then we'll get instances of it interleaved with - // all of the literal child blocks we must also include. - extSchema := &hcl.BodySchema{ - Attributes: schema.Attributes, - Blocks: make([]hcl.BlockHeaderSchema, len(schema.Blocks), len(schema.Blocks)+1), - } - copy(extSchema.Blocks, schema.Blocks) - extSchema.Blocks = append(extSchema.Blocks, dynamicBlockHeaderSchema) - - return extSchema -} - -// This is a more relaxed schema than what's in schema.go, since we -// want to maximize the amount of variables we can find even if there -// are erroneous blocks. -var variableDetectionInnerSchema = &hcl.BodySchema{ - Attributes: []hcl.AttributeSchema{ - { - Name: "for_each", - Required: false, - }, - { - Name: "labels", - Required: false, - }, - { - Name: "iterator", - Required: false, - }, - }, - Blocks: []hcl.BlockHeaderSchema{ - { - Type: "content", - }, - }, -} diff --git a/vendor/github.com/hashicorp/hcl2/ext/typeexpr/README.md b/vendor/github.com/hashicorp/hcl2/ext/typeexpr/README.md deleted file mode 100644 index ff2b3f22957..00000000000 --- a/vendor/github.com/hashicorp/hcl2/ext/typeexpr/README.md +++ /dev/null @@ -1,67 +0,0 @@ -# HCL Type Expressions Extension - -This HCL extension defines a convention for describing HCL types using function -call and variable reference syntax, allowing configuration formats to include -type information provided by users. - -The type syntax is processed statically from a hcl.Expression, so it cannot -use any of the usual language operators. This is similar to type expressions -in statically-typed programming languages. - -```hcl -variable "example" { - type = list(string) -} -``` - -The extension is built using the `hcl.ExprAsKeyword` and `hcl.ExprCall` -functions, and so it relies on the underlying syntax to define how "keyword" -and "call" are interpreted. The above shows how they are interpreted in -the HCL native syntax, while the following shows the same information -expressed in JSON: - -```json -{ - "variable": { - "example": { - "type": "list(string)" - } - } -} -``` - -Notice that since we have additional contextual information that we intend -to allow only calls and keywords the JSON syntax is able to parse the given -string directly as an expression, rather than as a template as would be -the case for normal expression evaluation. - -For more information, see [the godoc reference](http://godoc.org/github.com/hashicorp/hcl2/ext/typeexpr). - -## Type Expression Syntax - -When expressed in the native syntax, the following expressions are permitted -in a type expression: - -* `string` - string -* `bool` - boolean -* `number` - number -* `any` - `cty.DynamicPseudoType` (in function `TypeConstraint` only) -* `list()` - list of the type given as an argument -* `set()` - set of the type given as an argument -* `map()` - map of the type given as an argument -* `tuple([])` - tuple with the element types given in the single list argument -* `object({=, ...}` - object with the attributes and corresponding types given in the single map argument - -For example: - -* `list(string)` -* `object({name=string,age=number})` -* `map(object({name=string,age=number}))` - -Note that the object constructor syntax is not fully-general for all possible -object types because it requires the attribute names to be valid identifiers. -In practice it is expected that any time an object type is being fixed for -type checking it will be one that has identifiers as its attributes; object -types with weird attributes generally show up only from arbitrary object -constructors in configuration files, which are usually treated either as maps -or as the dynamic pseudo-type. diff --git a/vendor/github.com/hashicorp/hcl2/ext/typeexpr/public.go b/vendor/github.com/hashicorp/hcl2/ext/typeexpr/public.go deleted file mode 100644 index e3f5eef5929..00000000000 --- a/vendor/github.com/hashicorp/hcl2/ext/typeexpr/public.go +++ /dev/null @@ -1,129 +0,0 @@ -package typeexpr - -import ( - "bytes" - "fmt" - "sort" - - "github.com/hashicorp/hcl2/hcl/hclsyntax" - - "github.com/hashicorp/hcl2/hcl" - "github.com/zclconf/go-cty/cty" -) - -// Type attempts to process the given expression as a type expression and, if -// successful, returns the resulting type. If unsuccessful, error diagnostics -// are returned. -func Type(expr hcl.Expression) (cty.Type, hcl.Diagnostics) { - return getType(expr, false) -} - -// TypeConstraint attempts to parse the given expression as a type constraint -// and, if successful, returns the resulting type. If unsuccessful, error -// diagnostics are returned. -// -// A type constraint has the same structure as a type, but it additionally -// allows the keyword "any" to represent cty.DynamicPseudoType, which is often -// used as a wildcard in type checking and type conversion operations. -func TypeConstraint(expr hcl.Expression) (cty.Type, hcl.Diagnostics) { - return getType(expr, true) -} - -// TypeString returns a string rendering of the given type as it would be -// expected to appear in the HCL native syntax. -// -// This is primarily intended for showing types to the user in an application -// that uses typexpr, where the user can be assumed to be familiar with the -// type expression syntax. In applications that do not use typeexpr these -// results may be confusing to the user and so type.FriendlyName may be -// preferable, even though it's less precise. -// -// TypeString produces reasonable results only for types like what would be -// produced by the Type and TypeConstraint functions. In particular, it cannot -// support capsule types. -func TypeString(ty cty.Type) string { - // Easy cases first - switch ty { - case cty.String: - return "string" - case cty.Bool: - return "bool" - case cty.Number: - return "number" - case cty.DynamicPseudoType: - return "any" - } - - if ty.IsCapsuleType() { - panic("TypeString does not support capsule types") - } - - if ty.IsCollectionType() { - ety := ty.ElementType() - etyString := TypeString(ety) - switch { - case ty.IsListType(): - return fmt.Sprintf("list(%s)", etyString) - case ty.IsSetType(): - return fmt.Sprintf("set(%s)", etyString) - case ty.IsMapType(): - return fmt.Sprintf("map(%s)", etyString) - default: - // Should never happen because the above is exhaustive - panic("unsupported collection type") - } - } - - if ty.IsObjectType() { - var buf bytes.Buffer - buf.WriteString("object({") - atys := ty.AttributeTypes() - names := make([]string, 0, len(atys)) - for name := range atys { - names = append(names, name) - } - sort.Strings(names) - first := true - for _, name := range names { - aty := atys[name] - if !first { - buf.WriteByte(',') - } - if !hclsyntax.ValidIdentifier(name) { - // Should never happen for any type produced by this package, - // but we'll do something reasonable here just so we don't - // produce garbage if someone gives us a hand-assembled object - // type that has weird attribute names. - // Using Go-style quoting here isn't perfect, since it doesn't - // exactly match HCL syntax, but it's fine for an edge-case. - buf.WriteString(fmt.Sprintf("%q", name)) - } else { - buf.WriteString(name) - } - buf.WriteByte('=') - buf.WriteString(TypeString(aty)) - first = false - } - buf.WriteString("})") - return buf.String() - } - - if ty.IsTupleType() { - var buf bytes.Buffer - buf.WriteString("tuple([") - etys := ty.TupleElementTypes() - first := true - for _, ety := range etys { - if !first { - buf.WriteByte(',') - } - buf.WriteString(TypeString(ety)) - first = false - } - buf.WriteString("])") - return buf.String() - } - - // Should never happen because we covered all cases above. - panic(fmt.Errorf("unsupported type %#v", ty)) -} diff --git a/vendor/github.com/hashicorp/hcl2/gohcl/decode.go b/vendor/github.com/hashicorp/hcl2/gohcl/decode.go deleted file mode 100644 index 3a149a8c2cb..00000000000 --- a/vendor/github.com/hashicorp/hcl2/gohcl/decode.go +++ /dev/null @@ -1,304 +0,0 @@ -package gohcl - -import ( - "fmt" - "reflect" - - "github.com/zclconf/go-cty/cty" - - "github.com/hashicorp/hcl2/hcl" - "github.com/zclconf/go-cty/cty/convert" - "github.com/zclconf/go-cty/cty/gocty" -) - -// DecodeBody extracts the configuration within the given body into the given -// value. This value must be a non-nil pointer to either a struct or -// a map, where in the former case the configuration will be decoded using -// struct tags and in the latter case only attributes are allowed and their -// values are decoded into the map. -// -// The given EvalContext is used to resolve any variables or functions in -// expressions encountered while decoding. This may be nil to require only -// constant values, for simple applications that do not support variables or -// functions. -// -// The returned diagnostics should be inspected with its HasErrors method to -// determine if the populated value is valid and complete. If error diagnostics -// are returned then the given value may have been partially-populated but -// may still be accessed by a careful caller for static analysis and editor -// integration use-cases. -func DecodeBody(body hcl.Body, ctx *hcl.EvalContext, val interface{}) hcl.Diagnostics { - rv := reflect.ValueOf(val) - if rv.Kind() != reflect.Ptr { - panic(fmt.Sprintf("target value must be a pointer, not %s", rv.Type().String())) - } - - return decodeBodyToValue(body, ctx, rv.Elem()) -} - -func decodeBodyToValue(body hcl.Body, ctx *hcl.EvalContext, val reflect.Value) hcl.Diagnostics { - et := val.Type() - switch et.Kind() { - case reflect.Struct: - return decodeBodyToStruct(body, ctx, val) - case reflect.Map: - return decodeBodyToMap(body, ctx, val) - default: - panic(fmt.Sprintf("target value must be pointer to struct or map, not %s", et.String())) - } -} - -func decodeBodyToStruct(body hcl.Body, ctx *hcl.EvalContext, val reflect.Value) hcl.Diagnostics { - schema, partial := ImpliedBodySchema(val.Interface()) - - var content *hcl.BodyContent - var leftovers hcl.Body - var diags hcl.Diagnostics - if partial { - content, leftovers, diags = body.PartialContent(schema) - } else { - content, diags = body.Content(schema) - } - if content == nil { - return diags - } - - tags := getFieldTags(val.Type()) - - if tags.Remain != nil { - fieldIdx := *tags.Remain - field := val.Type().Field(fieldIdx) - fieldV := val.Field(fieldIdx) - switch { - case bodyType.AssignableTo(field.Type): - fieldV.Set(reflect.ValueOf(leftovers)) - case attrsType.AssignableTo(field.Type): - attrs, attrsDiags := leftovers.JustAttributes() - if len(attrsDiags) > 0 { - diags = append(diags, attrsDiags...) - } - fieldV.Set(reflect.ValueOf(attrs)) - default: - diags = append(diags, decodeBodyToValue(leftovers, ctx, fieldV)...) - } - } - - for name, fieldIdx := range tags.Attributes { - attr := content.Attributes[name] - field := val.Type().Field(fieldIdx) - fieldV := val.Field(fieldIdx) - - if attr == nil { - if !exprType.AssignableTo(field.Type) { - continue - } - - // As a special case, if the target is of type hcl.Expression then - // we'll assign an actual expression that evalues to a cty null, - // so the caller can deal with it within the cty realm rather - // than within the Go realm. - synthExpr := hcl.StaticExpr(cty.NullVal(cty.DynamicPseudoType), body.MissingItemRange()) - fieldV.Set(reflect.ValueOf(synthExpr)) - continue - } - - switch { - case attrType.AssignableTo(field.Type): - fieldV.Set(reflect.ValueOf(attr)) - case exprType.AssignableTo(field.Type): - fieldV.Set(reflect.ValueOf(attr.Expr)) - default: - diags = append(diags, DecodeExpression( - attr.Expr, ctx, fieldV.Addr().Interface(), - )...) - } - } - - blocksByType := content.Blocks.ByType() - - for typeName, fieldIdx := range tags.Blocks { - blocks := blocksByType[typeName] - field := val.Type().Field(fieldIdx) - - ty := field.Type - isSlice := false - isPtr := false - if ty.Kind() == reflect.Slice { - isSlice = true - ty = ty.Elem() - } - if ty.Kind() == reflect.Ptr { - isPtr = true - ty = ty.Elem() - } - - if len(blocks) > 1 && !isSlice { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: fmt.Sprintf("Duplicate %s block", typeName), - Detail: fmt.Sprintf( - "Only one %s block is allowed. Another was defined at %s.", - typeName, blocks[0].DefRange.String(), - ), - Subject: &blocks[1].DefRange, - }) - continue - } - - if len(blocks) == 0 { - if isSlice || isPtr { - val.Field(fieldIdx).Set(reflect.Zero(field.Type)) - } else { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: fmt.Sprintf("Missing %s block", typeName), - Detail: fmt.Sprintf("A %s block is required.", typeName), - Subject: body.MissingItemRange().Ptr(), - }) - } - continue - } - - switch { - - case isSlice: - elemType := ty - if isPtr { - elemType = reflect.PtrTo(ty) - } - sli := reflect.MakeSlice(reflect.SliceOf(elemType), len(blocks), len(blocks)) - - for i, block := range blocks { - if isPtr { - v := reflect.New(ty) - diags = append(diags, decodeBlockToValue(block, ctx, v.Elem())...) - sli.Index(i).Set(v) - } else { - diags = append(diags, decodeBlockToValue(block, ctx, sli.Index(i))...) - } - } - - val.Field(fieldIdx).Set(sli) - - default: - block := blocks[0] - if isPtr { - v := reflect.New(ty) - diags = append(diags, decodeBlockToValue(block, ctx, v.Elem())...) - val.Field(fieldIdx).Set(v) - } else { - diags = append(diags, decodeBlockToValue(block, ctx, val.Field(fieldIdx))...) - } - - } - - } - - return diags -} - -func decodeBodyToMap(body hcl.Body, ctx *hcl.EvalContext, v reflect.Value) hcl.Diagnostics { - attrs, diags := body.JustAttributes() - if attrs == nil { - return diags - } - - mv := reflect.MakeMap(v.Type()) - - for k, attr := range attrs { - switch { - case attrType.AssignableTo(v.Type().Elem()): - mv.SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(attr)) - case exprType.AssignableTo(v.Type().Elem()): - mv.SetMapIndex(reflect.ValueOf(k), reflect.ValueOf(attr.Expr)) - default: - ev := reflect.New(v.Type().Elem()) - diags = append(diags, DecodeExpression(attr.Expr, ctx, ev.Interface())...) - mv.SetMapIndex(reflect.ValueOf(k), ev.Elem()) - } - } - - v.Set(mv) - - return diags -} - -func decodeBlockToValue(block *hcl.Block, ctx *hcl.EvalContext, v reflect.Value) hcl.Diagnostics { - var diags hcl.Diagnostics - - ty := v.Type() - - switch { - case blockType.AssignableTo(ty): - v.Elem().Set(reflect.ValueOf(block)) - case bodyType.AssignableTo(ty): - v.Elem().Set(reflect.ValueOf(block.Body)) - case attrsType.AssignableTo(ty): - attrs, attrsDiags := block.Body.JustAttributes() - if len(attrsDiags) > 0 { - diags = append(diags, attrsDiags...) - } - v.Elem().Set(reflect.ValueOf(attrs)) - default: - diags = append(diags, decodeBodyToValue(block.Body, ctx, v)...) - - if len(block.Labels) > 0 { - blockTags := getFieldTags(ty) - for li, lv := range block.Labels { - lfieldIdx := blockTags.Labels[li].FieldIndex - v.Field(lfieldIdx).Set(reflect.ValueOf(lv)) - } - } - - } - - return diags -} - -// DecodeExpression extracts the value of the given expression into the given -// value. This value must be something that gocty is able to decode into, -// since the final decoding is delegated to that package. -// -// The given EvalContext is used to resolve any variables or functions in -// expressions encountered while decoding. This may be nil to require only -// constant values, for simple applications that do not support variables or -// functions. -// -// The returned diagnostics should be inspected with its HasErrors method to -// determine if the populated value is valid and complete. If error diagnostics -// are returned then the given value may have been partially-populated but -// may still be accessed by a careful caller for static analysis and editor -// integration use-cases. -func DecodeExpression(expr hcl.Expression, ctx *hcl.EvalContext, val interface{}) hcl.Diagnostics { - srcVal, diags := expr.Value(ctx) - - convTy, err := gocty.ImpliedType(val) - if err != nil { - panic(fmt.Sprintf("unsuitable DecodeExpression target: %s", err)) - } - - srcVal, err = convert.Convert(srcVal, convTy) - if err != nil { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Unsuitable value type", - Detail: fmt.Sprintf("Unsuitable value: %s", err.Error()), - Subject: expr.StartRange().Ptr(), - Context: expr.Range().Ptr(), - }) - return diags - } - - err = gocty.FromCtyValue(srcVal, val) - if err != nil { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Unsuitable value type", - Detail: fmt.Sprintf("Unsuitable value: %s", err.Error()), - Subject: expr.StartRange().Ptr(), - Context: expr.Range().Ptr(), - }) - } - - return diags -} diff --git a/vendor/github.com/hashicorp/hcl2/gohcl/schema.go b/vendor/github.com/hashicorp/hcl2/gohcl/schema.go deleted file mode 100644 index 88164cb05dd..00000000000 --- a/vendor/github.com/hashicorp/hcl2/gohcl/schema.go +++ /dev/null @@ -1,174 +0,0 @@ -package gohcl - -import ( - "fmt" - "reflect" - "sort" - "strings" - - "github.com/hashicorp/hcl2/hcl" -) - -// ImpliedBodySchema produces a hcl.BodySchema derived from the type of the -// given value, which must be a struct value or a pointer to one. If an -// inappropriate value is passed, this function will panic. -// -// The second return argument indicates whether the given struct includes -// a "remain" field, and thus the returned schema is non-exhaustive. -// -// This uses the tags on the fields of the struct to discover how each -// field's value should be expressed within configuration. If an invalid -// mapping is attempted, this function will panic. -func ImpliedBodySchema(val interface{}) (schema *hcl.BodySchema, partial bool) { - ty := reflect.TypeOf(val) - - if ty.Kind() == reflect.Ptr { - ty = ty.Elem() - } - - if ty.Kind() != reflect.Struct { - panic(fmt.Sprintf("given value must be struct, not %T", val)) - } - - var attrSchemas []hcl.AttributeSchema - var blockSchemas []hcl.BlockHeaderSchema - - tags := getFieldTags(ty) - - attrNames := make([]string, 0, len(tags.Attributes)) - for n := range tags.Attributes { - attrNames = append(attrNames, n) - } - sort.Strings(attrNames) - for _, n := range attrNames { - idx := tags.Attributes[n] - optional := tags.Optional[n] - field := ty.Field(idx) - - var required bool - - switch { - case field.Type.AssignableTo(exprType): - // If we're decoding to hcl.Expression then absense can be - // indicated via a null value, so we don't specify that - // the field is required during decoding. - required = false - case field.Type.Kind() != reflect.Ptr && !optional: - required = true - default: - required = false - } - - attrSchemas = append(attrSchemas, hcl.AttributeSchema{ - Name: n, - Required: required, - }) - } - - blockNames := make([]string, 0, len(tags.Blocks)) - for n := range tags.Blocks { - blockNames = append(blockNames, n) - } - sort.Strings(blockNames) - for _, n := range blockNames { - idx := tags.Blocks[n] - field := ty.Field(idx) - fty := field.Type - if fty.Kind() == reflect.Slice { - fty = fty.Elem() - } - if fty.Kind() == reflect.Ptr { - fty = fty.Elem() - } - if fty.Kind() != reflect.Struct { - panic(fmt.Sprintf( - "hcl 'block' tag kind cannot be applied to %s field %s: struct required", field.Type.String(), field.Name, - )) - } - ftags := getFieldTags(fty) - var labelNames []string - if len(ftags.Labels) > 0 { - labelNames = make([]string, len(ftags.Labels)) - for i, l := range ftags.Labels { - labelNames[i] = l.Name - } - } - - blockSchemas = append(blockSchemas, hcl.BlockHeaderSchema{ - Type: n, - LabelNames: labelNames, - }) - } - - partial = tags.Remain != nil - schema = &hcl.BodySchema{ - Attributes: attrSchemas, - Blocks: blockSchemas, - } - return schema, partial -} - -type fieldTags struct { - Attributes map[string]int - Blocks map[string]int - Labels []labelField - Remain *int - Optional map[string]bool -} - -type labelField struct { - FieldIndex int - Name string -} - -func getFieldTags(ty reflect.Type) *fieldTags { - ret := &fieldTags{ - Attributes: map[string]int{}, - Blocks: map[string]int{}, - Optional: map[string]bool{}, - } - - ct := ty.NumField() - for i := 0; i < ct; i++ { - field := ty.Field(i) - tag := field.Tag.Get("hcl") - if tag == "" { - continue - } - - comma := strings.Index(tag, ",") - var name, kind string - if comma != -1 { - name = tag[:comma] - kind = tag[comma+1:] - } else { - name = tag - kind = "attr" - } - - switch kind { - case "attr": - ret.Attributes[name] = i - case "block": - ret.Blocks[name] = i - case "label": - ret.Labels = append(ret.Labels, labelField{ - FieldIndex: i, - Name: name, - }) - case "remain": - if ret.Remain != nil { - panic("only one 'remain' tag is permitted") - } - idx := i // copy, because this loop will continue assigning to i - ret.Remain = &idx - case "optional": - ret.Attributes[name] = i - ret.Optional[name] = true - default: - panic(fmt.Sprintf("invalid hcl field tag kind %q on %s %q", kind, field.Type.String(), field.Name)) - } - } - - return ret -} diff --git a/vendor/github.com/hashicorp/hcl2/gohcl/types.go b/vendor/github.com/hashicorp/hcl2/gohcl/types.go deleted file mode 100644 index a94f275adc5..00000000000 --- a/vendor/github.com/hashicorp/hcl2/gohcl/types.go +++ /dev/null @@ -1,16 +0,0 @@ -package gohcl - -import ( - "reflect" - - "github.com/hashicorp/hcl2/hcl" -) - -var victimExpr hcl.Expression -var victimBody hcl.Body - -var exprType = reflect.TypeOf(&victimExpr).Elem() -var bodyType = reflect.TypeOf(&victimBody).Elem() -var blockType = reflect.TypeOf((*hcl.Block)(nil)) -var attrType = reflect.TypeOf((*hcl.Attribute)(nil)) -var attrsType = reflect.TypeOf(hcl.Attributes(nil)) diff --git a/vendor/github.com/hashicorp/hcl2/hcl/doc.go b/vendor/github.com/hashicorp/hcl2/hcl/doc.go deleted file mode 100644 index 01318c96f87..00000000000 --- a/vendor/github.com/hashicorp/hcl2/hcl/doc.go +++ /dev/null @@ -1 +0,0 @@ -package hcl diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression.go b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression.go deleted file mode 100644 index d3f7a74d399..00000000000 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/expression.go +++ /dev/null @@ -1,1468 +0,0 @@ -package hclsyntax - -import ( - "fmt" - "sync" - - "github.com/hashicorp/hcl2/hcl" - "github.com/zclconf/go-cty/cty" - "github.com/zclconf/go-cty/cty/convert" - "github.com/zclconf/go-cty/cty/function" -) - -// Expression is the abstract type for nodes that behave as HCL expressions. -type Expression interface { - Node - - // The hcl.Expression methods are duplicated here, rather than simply - // embedded, because both Node and hcl.Expression have a Range method - // and so they conflict. - - Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) - Variables() []hcl.Traversal - StartRange() hcl.Range -} - -// Assert that Expression implements hcl.Expression -var assertExprImplExpr hcl.Expression = Expression(nil) - -// LiteralValueExpr is an expression that just always returns a given value. -type LiteralValueExpr struct { - Val cty.Value - SrcRange hcl.Range -} - -func (e *LiteralValueExpr) walkChildNodes(w internalWalkFunc) { - // Literal values have no child nodes -} - -func (e *LiteralValueExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { - return e.Val, nil -} - -func (e *LiteralValueExpr) Range() hcl.Range { - return e.SrcRange -} - -func (e *LiteralValueExpr) StartRange() hcl.Range { - return e.SrcRange -} - -// Implementation for hcl.AbsTraversalForExpr. -func (e *LiteralValueExpr) AsTraversal() hcl.Traversal { - // This one's a little weird: the contract for AsTraversal is to interpret - // an expression as if it were traversal syntax, and traversal syntax - // doesn't have the special keywords "null", "true", and "false" so these - // are expected to be treated like variables in that case. - // Since our parser already turned them into LiteralValueExpr by the time - // we get here, we need to undo this and infer the name that would've - // originally led to our value. - // We don't do anything for any other values, since they don't overlap - // with traversal roots. - - if e.Val.IsNull() { - // In practice the parser only generates null values of the dynamic - // pseudo-type for literals, so we can safely assume that any null - // was orignally the keyword "null". - return hcl.Traversal{ - hcl.TraverseRoot{ - Name: "null", - SrcRange: e.SrcRange, - }, - } - } - - switch e.Val { - case cty.True: - return hcl.Traversal{ - hcl.TraverseRoot{ - Name: "true", - SrcRange: e.SrcRange, - }, - } - case cty.False: - return hcl.Traversal{ - hcl.TraverseRoot{ - Name: "false", - SrcRange: e.SrcRange, - }, - } - default: - // No traversal is possible for any other value. - return nil - } -} - -// ScopeTraversalExpr is an Expression that retrieves a value from the scope -// using a traversal. -type ScopeTraversalExpr struct { - Traversal hcl.Traversal - SrcRange hcl.Range -} - -func (e *ScopeTraversalExpr) walkChildNodes(w internalWalkFunc) { - // Scope traversals have no child nodes -} - -func (e *ScopeTraversalExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { - val, diags := e.Traversal.TraverseAbs(ctx) - setDiagEvalContext(diags, e, ctx) - return val, diags -} - -func (e *ScopeTraversalExpr) Range() hcl.Range { - return e.SrcRange -} - -func (e *ScopeTraversalExpr) StartRange() hcl.Range { - return e.SrcRange -} - -// Implementation for hcl.AbsTraversalForExpr. -func (e *ScopeTraversalExpr) AsTraversal() hcl.Traversal { - return e.Traversal -} - -// RelativeTraversalExpr is an Expression that retrieves a value from another -// value using a _relative_ traversal. -type RelativeTraversalExpr struct { - Source Expression - Traversal hcl.Traversal - SrcRange hcl.Range -} - -func (e *RelativeTraversalExpr) walkChildNodes(w internalWalkFunc) { - w(e.Source) -} - -func (e *RelativeTraversalExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { - src, diags := e.Source.Value(ctx) - ret, travDiags := e.Traversal.TraverseRel(src) - setDiagEvalContext(travDiags, e, ctx) - diags = append(diags, travDiags...) - return ret, diags -} - -func (e *RelativeTraversalExpr) Range() hcl.Range { - return e.SrcRange -} - -func (e *RelativeTraversalExpr) StartRange() hcl.Range { - return e.SrcRange -} - -// Implementation for hcl.AbsTraversalForExpr. -func (e *RelativeTraversalExpr) AsTraversal() hcl.Traversal { - // We can produce a traversal only if our source can. - st, diags := hcl.AbsTraversalForExpr(e.Source) - if diags.HasErrors() { - return nil - } - - ret := make(hcl.Traversal, len(st)+len(e.Traversal)) - copy(ret, st) - copy(ret[len(st):], e.Traversal) - return ret -} - -// FunctionCallExpr is an Expression that calls a function from the EvalContext -// and returns its result. -type FunctionCallExpr struct { - Name string - Args []Expression - - // If true, the final argument should be a tuple, list or set which will - // expand to be one argument per element. - ExpandFinal bool - - NameRange hcl.Range - OpenParenRange hcl.Range - CloseParenRange hcl.Range -} - -func (e *FunctionCallExpr) walkChildNodes(w internalWalkFunc) { - for _, arg := range e.Args { - w(arg) - } -} - -func (e *FunctionCallExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { - var diags hcl.Diagnostics - - var f function.Function - exists := false - hasNonNilMap := false - thisCtx := ctx - for thisCtx != nil { - if thisCtx.Functions == nil { - thisCtx = thisCtx.Parent() - continue - } - hasNonNilMap = true - f, exists = thisCtx.Functions[e.Name] - if exists { - break - } - thisCtx = thisCtx.Parent() - } - - if !exists { - if !hasNonNilMap { - return cty.DynamicVal, hcl.Diagnostics{ - { - Severity: hcl.DiagError, - Summary: "Function calls not allowed", - Detail: "Functions may not be called here.", - Subject: e.Range().Ptr(), - Expression: e, - EvalContext: ctx, - }, - } - } - - avail := make([]string, 0, len(ctx.Functions)) - for name := range ctx.Functions { - avail = append(avail, name) - } - suggestion := nameSuggestion(e.Name, avail) - if suggestion != "" { - suggestion = fmt.Sprintf(" Did you mean %q?", suggestion) - } - - return cty.DynamicVal, hcl.Diagnostics{ - { - Severity: hcl.DiagError, - Summary: "Call to unknown function", - Detail: fmt.Sprintf("There is no function named %q.%s", e.Name, suggestion), - Subject: &e.NameRange, - Context: e.Range().Ptr(), - Expression: e, - EvalContext: ctx, - }, - } - } - - params := f.Params() - varParam := f.VarParam() - - args := e.Args - if e.ExpandFinal { - if len(args) < 1 { - // should never happen if the parser is behaving - panic("ExpandFinal set on function call with no arguments") - } - expandExpr := args[len(args)-1] - expandVal, expandDiags := expandExpr.Value(ctx) - diags = append(diags, expandDiags...) - if expandDiags.HasErrors() { - return cty.DynamicVal, diags - } - - switch { - case expandVal.Type().IsTupleType() || expandVal.Type().IsListType() || expandVal.Type().IsSetType(): - if expandVal.IsNull() { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid expanding argument value", - Detail: "The expanding argument (indicated by ...) must not be null.", - Subject: expandExpr.Range().Ptr(), - Context: e.Range().Ptr(), - Expression: expandExpr, - EvalContext: ctx, - }) - return cty.DynamicVal, diags - } - if !expandVal.IsKnown() { - return cty.DynamicVal, diags - } - - newArgs := make([]Expression, 0, (len(args)-1)+expandVal.LengthInt()) - newArgs = append(newArgs, args[:len(args)-1]...) - it := expandVal.ElementIterator() - for it.Next() { - _, val := it.Element() - newArgs = append(newArgs, &LiteralValueExpr{ - Val: val, - SrcRange: expandExpr.Range(), - }) - } - args = newArgs - default: - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid expanding argument value", - Detail: "The expanding argument (indicated by ...) must be of a tuple, list, or set type.", - Subject: expandExpr.Range().Ptr(), - Context: e.Range().Ptr(), - Expression: expandExpr, - EvalContext: ctx, - }) - return cty.DynamicVal, diags - } - } - - if len(args) < len(params) { - missing := params[len(args)] - qual := "" - if varParam != nil { - qual = " at least" - } - return cty.DynamicVal, hcl.Diagnostics{ - { - Severity: hcl.DiagError, - Summary: "Not enough function arguments", - Detail: fmt.Sprintf( - "Function %q expects%s %d argument(s). Missing value for %q.", - e.Name, qual, len(params), missing.Name, - ), - Subject: &e.CloseParenRange, - Context: e.Range().Ptr(), - Expression: e, - EvalContext: ctx, - }, - } - } - - if varParam == nil && len(args) > len(params) { - return cty.DynamicVal, hcl.Diagnostics{ - { - Severity: hcl.DiagError, - Summary: "Too many function arguments", - Detail: fmt.Sprintf( - "Function %q expects only %d argument(s).", - e.Name, len(params), - ), - Subject: args[len(params)].StartRange().Ptr(), - Context: e.Range().Ptr(), - Expression: e, - EvalContext: ctx, - }, - } - } - - argVals := make([]cty.Value, len(args)) - - for i, argExpr := range args { - var param *function.Parameter - if i < len(params) { - param = ¶ms[i] - } else { - param = varParam - } - - val, argDiags := argExpr.Value(ctx) - if len(argDiags) > 0 { - diags = append(diags, argDiags...) - } - - // Try to convert our value to the parameter type - val, err := convert.Convert(val, param.Type) - if err != nil { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid function argument", - Detail: fmt.Sprintf( - "Invalid value for %q parameter: %s.", - param.Name, err, - ), - Subject: argExpr.StartRange().Ptr(), - Context: e.Range().Ptr(), - Expression: argExpr, - EvalContext: ctx, - }) - } - - argVals[i] = val - } - - if diags.HasErrors() { - // Don't try to execute the function if we already have errors with - // the arguments, because the result will probably be a confusing - // error message. - return cty.DynamicVal, diags - } - - resultVal, err := f.Call(argVals) - if err != nil { - switch terr := err.(type) { - case function.ArgError: - i := terr.Index - var param *function.Parameter - if i < len(params) { - param = ¶ms[i] - } else { - param = varParam - } - argExpr := e.Args[i] - - // TODO: we should also unpick a PathError here and show the - // path to the deep value where the error was detected. - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid function argument", - Detail: fmt.Sprintf( - "Invalid value for %q parameter: %s.", - param.Name, err, - ), - Subject: argExpr.StartRange().Ptr(), - Context: e.Range().Ptr(), - Expression: argExpr, - EvalContext: ctx, - }) - - default: - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Error in function call", - Detail: fmt.Sprintf( - "Call to function %q failed: %s.", - e.Name, err, - ), - Subject: e.StartRange().Ptr(), - Context: e.Range().Ptr(), - Expression: e, - EvalContext: ctx, - }) - } - - return cty.DynamicVal, diags - } - - return resultVal, diags -} - -func (e *FunctionCallExpr) Range() hcl.Range { - return hcl.RangeBetween(e.NameRange, e.CloseParenRange) -} - -func (e *FunctionCallExpr) StartRange() hcl.Range { - return hcl.RangeBetween(e.NameRange, e.OpenParenRange) -} - -// Implementation for hcl.ExprCall. -func (e *FunctionCallExpr) ExprCall() *hcl.StaticCall { - ret := &hcl.StaticCall{ - Name: e.Name, - NameRange: e.NameRange, - Arguments: make([]hcl.Expression, len(e.Args)), - ArgsRange: hcl.RangeBetween(e.OpenParenRange, e.CloseParenRange), - } - // Need to convert our own Expression objects into hcl.Expression. - for i, arg := range e.Args { - ret.Arguments[i] = arg - } - return ret -} - -type ConditionalExpr struct { - Condition Expression - TrueResult Expression - FalseResult Expression - - SrcRange hcl.Range -} - -func (e *ConditionalExpr) walkChildNodes(w internalWalkFunc) { - w(e.Condition) - w(e.TrueResult) - w(e.FalseResult) -} - -func (e *ConditionalExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { - trueResult, trueDiags := e.TrueResult.Value(ctx) - falseResult, falseDiags := e.FalseResult.Value(ctx) - var diags hcl.Diagnostics - - resultType := cty.DynamicPseudoType - convs := make([]convert.Conversion, 2) - - switch { - // If either case is a dynamic null value (which would result from a - // literal null in the config), we know that it can convert to the expected - // type of the opposite case, and we don't need to speculatively reduce the - // final result type to DynamicPseudoType. - - // If we know that either Type is a DynamicPseudoType, we can be certain - // that the other value can convert since it's a pass-through, and we don't - // need to unify the types. If the final evaluation results in the dynamic - // value being returned, there's no conversion we can do, so we return the - // value directly. - case trueResult.RawEquals(cty.NullVal(cty.DynamicPseudoType)): - resultType = falseResult.Type() - convs[0] = convert.GetConversionUnsafe(cty.DynamicPseudoType, resultType) - case falseResult.RawEquals(cty.NullVal(cty.DynamicPseudoType)): - resultType = trueResult.Type() - convs[1] = convert.GetConversionUnsafe(cty.DynamicPseudoType, resultType) - case trueResult.Type() == cty.DynamicPseudoType, falseResult.Type() == cty.DynamicPseudoType: - // the final resultType type is still unknown - // we don't need to get the conversion, because both are a noop. - - default: - // Try to find a type that both results can be converted to. - resultType, convs = convert.UnifyUnsafe([]cty.Type{trueResult.Type(), falseResult.Type()}) - } - - if resultType == cty.NilType { - return cty.DynamicVal, hcl.Diagnostics{ - { - Severity: hcl.DiagError, - Summary: "Inconsistent conditional result types", - Detail: fmt.Sprintf( - // FIXME: Need a helper function for showing natural-language type diffs, - // since this will generate some useless messages in some cases, like - // "These expressions are object and object respectively" if the - // object types don't exactly match. - "The true and false result expressions must have consistent types. The given expressions are %s and %s, respectively.", - trueResult.Type().FriendlyName(), falseResult.Type().FriendlyName(), - ), - Subject: hcl.RangeBetween(e.TrueResult.Range(), e.FalseResult.Range()).Ptr(), - Context: &e.SrcRange, - Expression: e, - EvalContext: ctx, - }, - } - } - - condResult, condDiags := e.Condition.Value(ctx) - diags = append(diags, condDiags...) - if condResult.IsNull() { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Null condition", - Detail: "The condition value is null. Conditions must either be true or false.", - Subject: e.Condition.Range().Ptr(), - Context: &e.SrcRange, - Expression: e.Condition, - EvalContext: ctx, - }) - return cty.UnknownVal(resultType), diags - } - if !condResult.IsKnown() { - return cty.UnknownVal(resultType), diags - } - condResult, err := convert.Convert(condResult, cty.Bool) - if err != nil { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Incorrect condition type", - Detail: fmt.Sprintf("The condition expression must be of type bool."), - Subject: e.Condition.Range().Ptr(), - Context: &e.SrcRange, - Expression: e.Condition, - EvalContext: ctx, - }) - return cty.UnknownVal(resultType), diags - } - - if condResult.True() { - diags = append(diags, trueDiags...) - if convs[0] != nil { - var err error - trueResult, err = convs[0](trueResult) - if err != nil { - // Unsafe conversion failed with the concrete result value - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Inconsistent conditional result types", - Detail: fmt.Sprintf( - "The true result value has the wrong type: %s.", - err.Error(), - ), - Subject: e.TrueResult.Range().Ptr(), - Context: &e.SrcRange, - Expression: e.TrueResult, - EvalContext: ctx, - }) - trueResult = cty.UnknownVal(resultType) - } - } - return trueResult, diags - } else { - diags = append(diags, falseDiags...) - if convs[1] != nil { - var err error - falseResult, err = convs[1](falseResult) - if err != nil { - // Unsafe conversion failed with the concrete result value - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Inconsistent conditional result types", - Detail: fmt.Sprintf( - "The false result value has the wrong type: %s.", - err.Error(), - ), - Subject: e.FalseResult.Range().Ptr(), - Context: &e.SrcRange, - Expression: e.FalseResult, - EvalContext: ctx, - }) - falseResult = cty.UnknownVal(resultType) - } - } - return falseResult, diags - } -} - -func (e *ConditionalExpr) Range() hcl.Range { - return e.SrcRange -} - -func (e *ConditionalExpr) StartRange() hcl.Range { - return e.Condition.StartRange() -} - -type IndexExpr struct { - Collection Expression - Key Expression - - SrcRange hcl.Range - OpenRange hcl.Range -} - -func (e *IndexExpr) walkChildNodes(w internalWalkFunc) { - w(e.Collection) - w(e.Key) -} - -func (e *IndexExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { - var diags hcl.Diagnostics - coll, collDiags := e.Collection.Value(ctx) - key, keyDiags := e.Key.Value(ctx) - diags = append(diags, collDiags...) - diags = append(diags, keyDiags...) - - val, indexDiags := hcl.Index(coll, key, &e.SrcRange) - setDiagEvalContext(indexDiags, e, ctx) - diags = append(diags, indexDiags...) - return val, diags -} - -func (e *IndexExpr) Range() hcl.Range { - return e.SrcRange -} - -func (e *IndexExpr) StartRange() hcl.Range { - return e.OpenRange -} - -type TupleConsExpr struct { - Exprs []Expression - - SrcRange hcl.Range - OpenRange hcl.Range -} - -func (e *TupleConsExpr) walkChildNodes(w internalWalkFunc) { - for _, expr := range e.Exprs { - w(expr) - } -} - -func (e *TupleConsExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { - var vals []cty.Value - var diags hcl.Diagnostics - - vals = make([]cty.Value, len(e.Exprs)) - for i, expr := range e.Exprs { - val, valDiags := expr.Value(ctx) - vals[i] = val - diags = append(diags, valDiags...) - } - - return cty.TupleVal(vals), diags -} - -func (e *TupleConsExpr) Range() hcl.Range { - return e.SrcRange -} - -func (e *TupleConsExpr) StartRange() hcl.Range { - return e.OpenRange -} - -// Implementation for hcl.ExprList -func (e *TupleConsExpr) ExprList() []hcl.Expression { - ret := make([]hcl.Expression, len(e.Exprs)) - for i, expr := range e.Exprs { - ret[i] = expr - } - return ret -} - -type ObjectConsExpr struct { - Items []ObjectConsItem - - SrcRange hcl.Range - OpenRange hcl.Range -} - -type ObjectConsItem struct { - KeyExpr Expression - ValueExpr Expression -} - -func (e *ObjectConsExpr) walkChildNodes(w internalWalkFunc) { - for _, item := range e.Items { - w(item.KeyExpr) - w(item.ValueExpr) - } -} - -func (e *ObjectConsExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { - var vals map[string]cty.Value - var diags hcl.Diagnostics - - // This will get set to true if we fail to produce any of our keys, - // either because they are actually unknown or if the evaluation produces - // errors. In all of these case we must return DynamicPseudoType because - // we're unable to know the full set of keys our object has, and thus - // we can't produce a complete value of the intended type. - // - // We still evaluate all of the item keys and values to make sure that we - // get as complete as possible a set of diagnostics. - known := true - - vals = make(map[string]cty.Value, len(e.Items)) - for _, item := range e.Items { - key, keyDiags := item.KeyExpr.Value(ctx) - diags = append(diags, keyDiags...) - - val, valDiags := item.ValueExpr.Value(ctx) - diags = append(diags, valDiags...) - - if keyDiags.HasErrors() { - known = false - continue - } - - if key.IsNull() { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Null value as key", - Detail: "Can't use a null value as a key.", - Subject: item.ValueExpr.Range().Ptr(), - Expression: item.KeyExpr, - EvalContext: ctx, - }) - known = false - continue - } - - var err error - key, err = convert.Convert(key, cty.String) - if err != nil { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Incorrect key type", - Detail: fmt.Sprintf("Can't use this value as a key: %s.", err.Error()), - Subject: item.KeyExpr.Range().Ptr(), - Expression: item.KeyExpr, - EvalContext: ctx, - }) - known = false - continue - } - - if !key.IsKnown() { - known = false - continue - } - - keyStr := key.AsString() - - vals[keyStr] = val - } - - if !known { - return cty.DynamicVal, diags - } - - return cty.ObjectVal(vals), diags -} - -func (e *ObjectConsExpr) Range() hcl.Range { - return e.SrcRange -} - -func (e *ObjectConsExpr) StartRange() hcl.Range { - return e.OpenRange -} - -// Implementation for hcl.ExprMap -func (e *ObjectConsExpr) ExprMap() []hcl.KeyValuePair { - ret := make([]hcl.KeyValuePair, len(e.Items)) - for i, item := range e.Items { - ret[i] = hcl.KeyValuePair{ - Key: item.KeyExpr, - Value: item.ValueExpr, - } - } - return ret -} - -// ObjectConsKeyExpr is a special wrapper used only for ObjectConsExpr keys, -// which deals with the special case that a naked identifier in that position -// must be interpreted as a literal string rather than evaluated directly. -type ObjectConsKeyExpr struct { - Wrapped Expression -} - -func (e *ObjectConsKeyExpr) literalName() string { - // This is our logic for deciding whether to behave like a literal string. - // We lean on our AbsTraversalForExpr implementation here, which already - // deals with some awkward cases like the expression being the result - // of the keywords "null", "true" and "false" which we'd want to interpret - // as keys here too. - return hcl.ExprAsKeyword(e.Wrapped) -} - -func (e *ObjectConsKeyExpr) walkChildNodes(w internalWalkFunc) { - // We only treat our wrapped expression as a real expression if we're - // not going to interpret it as a literal. - if e.literalName() == "" { - w(e.Wrapped) - } -} - -func (e *ObjectConsKeyExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { - // Because we accept a naked identifier as a literal key rather than a - // reference, it's confusing to accept a traversal containing periods - // here since we can't tell if the user intends to create a key with - // periods or actually reference something. To avoid confusing downstream - // errors we'll just prohibit a naked multi-step traversal here and - // require the user to state their intent more clearly. - // (This is handled at evaluation time rather than parse time because - // an application using static analysis _can_ accept a naked multi-step - // traversal here, if desired.) - if travExpr, isTraversal := e.Wrapped.(*ScopeTraversalExpr); isTraversal && len(travExpr.Traversal) > 1 { - var diags hcl.Diagnostics - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Ambiguous attribute key", - Detail: "If this expression is intended to be a reference, wrap it in parentheses. If it's instead intended as a literal name containing periods, wrap it in quotes to create a string literal.", - Subject: e.Range().Ptr(), - }) - return cty.DynamicVal, diags - } - - if ln := e.literalName(); ln != "" { - return cty.StringVal(ln), nil - } - return e.Wrapped.Value(ctx) -} - -func (e *ObjectConsKeyExpr) Range() hcl.Range { - return e.Wrapped.Range() -} - -func (e *ObjectConsKeyExpr) StartRange() hcl.Range { - return e.Wrapped.StartRange() -} - -// Implementation for hcl.AbsTraversalForExpr. -func (e *ObjectConsKeyExpr) AsTraversal() hcl.Traversal { - // We can produce a traversal only if our wrappee can. - st, diags := hcl.AbsTraversalForExpr(e.Wrapped) - if diags.HasErrors() { - return nil - } - - return st -} - -func (e *ObjectConsKeyExpr) UnwrapExpression() Expression { - return e.Wrapped -} - -// ForExpr represents iteration constructs: -// -// tuple = [for i, v in list: upper(v) if i > 2] -// object = {for k, v in map: k => upper(v)} -// object_of_tuples = {for v in list: v.key: v...} -type ForExpr struct { - KeyVar string // empty if ignoring the key - ValVar string - - CollExpr Expression - - KeyExpr Expression // nil when producing a tuple - ValExpr Expression - CondExpr Expression // null if no "if" clause is present - - Group bool // set if the ellipsis is used on the value in an object for - - SrcRange hcl.Range - OpenRange hcl.Range - CloseRange hcl.Range -} - -func (e *ForExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { - var diags hcl.Diagnostics - - collVal, collDiags := e.CollExpr.Value(ctx) - diags = append(diags, collDiags...) - - if collVal.IsNull() { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Iteration over null value", - Detail: "A null value cannot be used as the collection in a 'for' expression.", - Subject: e.CollExpr.Range().Ptr(), - Context: &e.SrcRange, - Expression: e.CollExpr, - EvalContext: ctx, - }) - return cty.DynamicVal, diags - } - if collVal.Type() == cty.DynamicPseudoType { - return cty.DynamicVal, diags - } - if !collVal.CanIterateElements() { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Iteration over non-iterable value", - Detail: fmt.Sprintf( - "A value of type %s cannot be used as the collection in a 'for' expression.", - collVal.Type().FriendlyName(), - ), - Subject: e.CollExpr.Range().Ptr(), - Context: &e.SrcRange, - Expression: e.CollExpr, - EvalContext: ctx, - }) - return cty.DynamicVal, diags - } - if !collVal.IsKnown() { - return cty.DynamicVal, diags - } - - // Before we start we'll do an early check to see if any CondExpr we've - // been given is of the wrong type. This isn't 100% reliable (it may - // be DynamicVal until real values are given) but it should catch some - // straightforward cases and prevent a barrage of repeated errors. - if e.CondExpr != nil { - childCtx := ctx.NewChild() - childCtx.Variables = map[string]cty.Value{} - if e.KeyVar != "" { - childCtx.Variables[e.KeyVar] = cty.DynamicVal - } - childCtx.Variables[e.ValVar] = cty.DynamicVal - - result, condDiags := e.CondExpr.Value(childCtx) - diags = append(diags, condDiags...) - if result.IsNull() { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Condition is null", - Detail: "The value of the 'if' clause must not be null.", - Subject: e.CondExpr.Range().Ptr(), - Context: &e.SrcRange, - Expression: e.CondExpr, - EvalContext: ctx, - }) - return cty.DynamicVal, diags - } - _, err := convert.Convert(result, cty.Bool) - if err != nil { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid 'for' condition", - Detail: fmt.Sprintf("The 'if' clause value is invalid: %s.", err.Error()), - Subject: e.CondExpr.Range().Ptr(), - Context: &e.SrcRange, - Expression: e.CondExpr, - EvalContext: ctx, - }) - return cty.DynamicVal, diags - } - if condDiags.HasErrors() { - return cty.DynamicVal, diags - } - } - - if e.KeyExpr != nil { - // Producing an object - var vals map[string]cty.Value - var groupVals map[string][]cty.Value - if e.Group { - groupVals = map[string][]cty.Value{} - } else { - vals = map[string]cty.Value{} - } - - it := collVal.ElementIterator() - - known := true - for it.Next() { - k, v := it.Element() - childCtx := ctx.NewChild() - childCtx.Variables = map[string]cty.Value{} - if e.KeyVar != "" { - childCtx.Variables[e.KeyVar] = k - } - childCtx.Variables[e.ValVar] = v - - if e.CondExpr != nil { - includeRaw, condDiags := e.CondExpr.Value(childCtx) - diags = append(diags, condDiags...) - if includeRaw.IsNull() { - if known { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid 'for' condition", - Detail: "The value of the 'if' clause must not be null.", - Subject: e.CondExpr.Range().Ptr(), - Context: &e.SrcRange, - Expression: e.CondExpr, - EvalContext: childCtx, - }) - } - known = false - continue - } - include, err := convert.Convert(includeRaw, cty.Bool) - if err != nil { - if known { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid 'for' condition", - Detail: fmt.Sprintf("The 'if' clause value is invalid: %s.", err.Error()), - Subject: e.CondExpr.Range().Ptr(), - Context: &e.SrcRange, - Expression: e.CondExpr, - EvalContext: childCtx, - }) - } - known = false - continue - } - if !include.IsKnown() { - known = false - continue - } - - if include.False() { - // Skip this element - continue - } - } - - keyRaw, keyDiags := e.KeyExpr.Value(childCtx) - diags = append(diags, keyDiags...) - if keyRaw.IsNull() { - if known { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid object key", - Detail: "Key expression in 'for' expression must not produce a null value.", - Subject: e.KeyExpr.Range().Ptr(), - Context: &e.SrcRange, - Expression: e.KeyExpr, - EvalContext: childCtx, - }) - } - known = false - continue - } - if !keyRaw.IsKnown() { - known = false - continue - } - - key, err := convert.Convert(keyRaw, cty.String) - if err != nil { - if known { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid object key", - Detail: fmt.Sprintf("The key expression produced an invalid result: %s.", err.Error()), - Subject: e.KeyExpr.Range().Ptr(), - Context: &e.SrcRange, - Expression: e.KeyExpr, - EvalContext: childCtx, - }) - } - known = false - continue - } - - val, valDiags := e.ValExpr.Value(childCtx) - diags = append(diags, valDiags...) - - if e.Group { - k := key.AsString() - groupVals[k] = append(groupVals[k], val) - } else { - k := key.AsString() - if _, exists := vals[k]; exists { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Duplicate object key", - Detail: fmt.Sprintf( - "Two different items produced the key %q in this 'for' expression. If duplicates are expected, use the ellipsis (...) after the value expression to enable grouping by key.", - k, - ), - Subject: e.KeyExpr.Range().Ptr(), - Context: &e.SrcRange, - Expression: e.KeyExpr, - EvalContext: childCtx, - }) - } else { - vals[key.AsString()] = val - } - } - } - - if !known { - return cty.DynamicVal, diags - } - - if e.Group { - vals = map[string]cty.Value{} - for k, gvs := range groupVals { - vals[k] = cty.TupleVal(gvs) - } - } - - return cty.ObjectVal(vals), diags - - } else { - // Producing a tuple - vals := []cty.Value{} - - it := collVal.ElementIterator() - - known := true - for it.Next() { - k, v := it.Element() - childCtx := ctx.NewChild() - childCtx.Variables = map[string]cty.Value{} - if e.KeyVar != "" { - childCtx.Variables[e.KeyVar] = k - } - childCtx.Variables[e.ValVar] = v - - if e.CondExpr != nil { - includeRaw, condDiags := e.CondExpr.Value(childCtx) - diags = append(diags, condDiags...) - if includeRaw.IsNull() { - if known { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid 'for' condition", - Detail: "The value of the 'if' clause must not be null.", - Subject: e.CondExpr.Range().Ptr(), - Context: &e.SrcRange, - Expression: e.CondExpr, - EvalContext: childCtx, - }) - } - known = false - continue - } - if !includeRaw.IsKnown() { - // We will eventually return DynamicVal, but we'll continue - // iterating in case there are other diagnostics to gather - // for later elements. - known = false - continue - } - - include, err := convert.Convert(includeRaw, cty.Bool) - if err != nil { - if known { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid 'for' condition", - Detail: fmt.Sprintf("The 'if' clause value is invalid: %s.", err.Error()), - Subject: e.CondExpr.Range().Ptr(), - Context: &e.SrcRange, - Expression: e.CondExpr, - EvalContext: childCtx, - }) - } - known = false - continue - } - - if include.False() { - // Skip this element - continue - } - } - - val, valDiags := e.ValExpr.Value(childCtx) - diags = append(diags, valDiags...) - vals = append(vals, val) - } - - if !known { - return cty.DynamicVal, diags - } - - return cty.TupleVal(vals), diags - } -} - -func (e *ForExpr) walkChildNodes(w internalWalkFunc) { - w(e.CollExpr) - - scopeNames := map[string]struct{}{} - if e.KeyVar != "" { - scopeNames[e.KeyVar] = struct{}{} - } - if e.ValVar != "" { - scopeNames[e.ValVar] = struct{}{} - } - - if e.KeyExpr != nil { - w(ChildScope{ - LocalNames: scopeNames, - Expr: e.KeyExpr, - }) - } - w(ChildScope{ - LocalNames: scopeNames, - Expr: e.ValExpr, - }) - if e.CondExpr != nil { - w(ChildScope{ - LocalNames: scopeNames, - Expr: e.CondExpr, - }) - } -} - -func (e *ForExpr) Range() hcl.Range { - return e.SrcRange -} - -func (e *ForExpr) StartRange() hcl.Range { - return e.OpenRange -} - -type SplatExpr struct { - Source Expression - Each Expression - Item *AnonSymbolExpr - - SrcRange hcl.Range - MarkerRange hcl.Range -} - -func (e *SplatExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { - sourceVal, diags := e.Source.Value(ctx) - if diags.HasErrors() { - // We'll evaluate our "Each" expression here just to see if it - // produces any more diagnostics we can report. Since we're not - // assigning a value to our AnonSymbolExpr here it will return - // DynamicVal, which should short-circuit any use of it. - _, itemDiags := e.Item.Value(ctx) - diags = append(diags, itemDiags...) - return cty.DynamicVal, diags - } - - sourceTy := sourceVal.Type() - if sourceTy == cty.DynamicPseudoType { - // If we don't even know the _type_ of our source value yet then - // we'll need to defer all processing, since we can't decide our - // result type either. - return cty.DynamicVal, diags - } - - // A "special power" of splat expressions is that they can be applied - // both to tuples/lists and to other values, and in the latter case - // the value will be treated as an implicit single-item tuple, or as - // an empty tuple if the value is null. - autoUpgrade := !(sourceTy.IsTupleType() || sourceTy.IsListType() || sourceTy.IsSetType()) - - if sourceVal.IsNull() { - if autoUpgrade { - return cty.EmptyTupleVal, diags - } - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Splat of null value", - Detail: "Splat expressions (with the * symbol) cannot be applied to null sequences.", - Subject: e.Source.Range().Ptr(), - Context: hcl.RangeBetween(e.Source.Range(), e.MarkerRange).Ptr(), - Expression: e.Source, - EvalContext: ctx, - }) - return cty.DynamicVal, diags - } - - if autoUpgrade { - sourceVal = cty.TupleVal([]cty.Value{sourceVal}) - sourceTy = sourceVal.Type() - } - - // We'll compute our result type lazily if we need it. In the normal case - // it's inferred automatically from the value we construct. - resultTy := func() (cty.Type, hcl.Diagnostics) { - chiCtx := ctx.NewChild() - var diags hcl.Diagnostics - switch { - case sourceTy.IsListType() || sourceTy.IsSetType(): - ety := sourceTy.ElementType() - e.Item.setValue(chiCtx, cty.UnknownVal(ety)) - val, itemDiags := e.Each.Value(chiCtx) - diags = append(diags, itemDiags...) - e.Item.clearValue(chiCtx) // clean up our temporary value - return cty.List(val.Type()), diags - case sourceTy.IsTupleType(): - etys := sourceTy.TupleElementTypes() - resultTys := make([]cty.Type, 0, len(etys)) - for _, ety := range etys { - e.Item.setValue(chiCtx, cty.UnknownVal(ety)) - val, itemDiags := e.Each.Value(chiCtx) - diags = append(diags, itemDiags...) - e.Item.clearValue(chiCtx) // clean up our temporary value - resultTys = append(resultTys, val.Type()) - } - return cty.Tuple(resultTys), diags - default: - // Should never happen because of our promotion to list above. - return cty.DynamicPseudoType, diags - } - } - - if !sourceVal.IsKnown() { - // We can't produce a known result in this case, but we'll still - // indicate what the result type would be, allowing any downstream type - // checking to proceed. - ty, tyDiags := resultTy() - diags = append(diags, tyDiags...) - return cty.UnknownVal(ty), diags - } - - vals := make([]cty.Value, 0, sourceVal.LengthInt()) - it := sourceVal.ElementIterator() - if ctx == nil { - // we need a context to use our AnonSymbolExpr, so we'll just - // make an empty one here to use as a placeholder. - ctx = ctx.NewChild() - } - isKnown := true - for it.Next() { - _, sourceItem := it.Element() - e.Item.setValue(ctx, sourceItem) - newItem, itemDiags := e.Each.Value(ctx) - diags = append(diags, itemDiags...) - if itemDiags.HasErrors() { - isKnown = false - } - vals = append(vals, newItem) - } - e.Item.clearValue(ctx) // clean up our temporary value - - if !isKnown { - // We'll ingore the resultTy diagnostics in this case since they - // will just be the same errors we saw while iterating above. - ty, _ := resultTy() - return cty.UnknownVal(ty), diags - } - - switch { - case sourceTy.IsListType() || sourceTy.IsSetType(): - if len(vals) == 0 { - ty, tyDiags := resultTy() - diags = append(diags, tyDiags...) - return cty.ListValEmpty(ty.ElementType()), diags - } - return cty.ListVal(vals), diags - default: - return cty.TupleVal(vals), diags - } -} - -func (e *SplatExpr) walkChildNodes(w internalWalkFunc) { - w(e.Source) - w(e.Each) -} - -func (e *SplatExpr) Range() hcl.Range { - return e.SrcRange -} - -func (e *SplatExpr) StartRange() hcl.Range { - return e.MarkerRange -} - -// AnonSymbolExpr is used as a placeholder for a value in an expression that -// can be applied dynamically to any value at runtime. -// -// This is a rather odd, synthetic expression. It is used as part of the -// representation of splat expressions as a placeholder for the current item -// being visited in the splat evaluation. -// -// AnonSymbolExpr cannot be evaluated in isolation. If its Value is called -// directly then cty.DynamicVal will be returned. Instead, it is evaluated -// in terms of another node (i.e. a splat expression) which temporarily -// assigns it a value. -type AnonSymbolExpr struct { - SrcRange hcl.Range - - // values and its associated lock are used to isolate concurrent - // evaluations of a symbol from one another. It is the calling application's - // responsibility to ensure that the same splat expression is not evalauted - // concurrently within the _same_ EvalContext, but it is fine and safe to - // do cuncurrent evaluations with distinct EvalContexts. - values map[*hcl.EvalContext]cty.Value - valuesLock sync.RWMutex -} - -func (e *AnonSymbolExpr) Value(ctx *hcl.EvalContext) (cty.Value, hcl.Diagnostics) { - if ctx == nil { - return cty.DynamicVal, nil - } - - e.valuesLock.RLock() - defer e.valuesLock.RUnlock() - - val, exists := e.values[ctx] - if !exists { - return cty.DynamicVal, nil - } - return val, nil -} - -// setValue sets a temporary local value for the expression when evaluated -// in the given context, which must be non-nil. -func (e *AnonSymbolExpr) setValue(ctx *hcl.EvalContext, val cty.Value) { - e.valuesLock.Lock() - defer e.valuesLock.Unlock() - - if e.values == nil { - e.values = make(map[*hcl.EvalContext]cty.Value) - } - if ctx == nil { - panic("can't setValue for a nil EvalContext") - } - e.values[ctx] = val -} - -func (e *AnonSymbolExpr) clearValue(ctx *hcl.EvalContext) { - e.valuesLock.Lock() - defer e.valuesLock.Unlock() - - if e.values == nil { - return - } - if ctx == nil { - panic("can't clearValue for a nil EvalContext") - } - delete(e.values, ctx) -} - -func (e *AnonSymbolExpr) walkChildNodes(w internalWalkFunc) { - // AnonSymbolExpr is a leaf node in the tree -} - -func (e *AnonSymbolExpr) Range() hcl.Range { - return e.SrcRange -} - -func (e *AnonSymbolExpr) StartRange() hcl.Range { - return e.SrcRange -} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/file.go b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/file.go deleted file mode 100644 index 490c02556b2..00000000000 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/file.go +++ /dev/null @@ -1,20 +0,0 @@ -package hclsyntax - -import ( - "github.com/hashicorp/hcl2/hcl" -) - -// File is the top-level object resulting from parsing a configuration file. -type File struct { - Body *Body - Bytes []byte -} - -func (f *File) AsHCLFile() *hcl.File { - return &hcl.File{ - Body: f.Body, - Bytes: f.Bytes, - - // TODO: The Nav object, once we have an implementation of it - } -} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/navigation.go b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/navigation.go deleted file mode 100644 index c8c97f37cdc..00000000000 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/navigation.go +++ /dev/null @@ -1,59 +0,0 @@ -package hclsyntax - -import ( - "bytes" - "fmt" - - "github.com/hashicorp/hcl2/hcl" -) - -type navigation struct { - root *Body -} - -// Implementation of hcled.ContextString -func (n navigation) ContextString(offset int) string { - // We will walk our top-level blocks until we find one that contains - // the given offset, and then construct a representation of the header - // of the block. - - var block *Block - for _, candidate := range n.root.Blocks { - if candidate.Range().ContainsOffset(offset) { - block = candidate - break - } - } - - if block == nil { - return "" - } - - if len(block.Labels) == 0 { - // Easy case! - return block.Type - } - - buf := &bytes.Buffer{} - buf.WriteString(block.Type) - for _, label := range block.Labels { - fmt.Fprintf(buf, " %q", label) - } - return buf.String() -} - -func (n navigation) ContextDefRange(offset int) hcl.Range { - var block *Block - for _, candidate := range n.root.Blocks { - if candidate.Range().ContainsOffset(offset) { - block = candidate - break - } - } - - if block == nil { - return hcl.Range{} - } - - return block.DefRange() -} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/node.go b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/node.go deleted file mode 100644 index 75812e63dd1..00000000000 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/node.go +++ /dev/null @@ -1,22 +0,0 @@ -package hclsyntax - -import ( - "github.com/hashicorp/hcl2/hcl" -) - -// Node is the abstract type that every AST node implements. -// -// This is a closed interface, so it cannot be implemented from outside of -// this package. -type Node interface { - // This is the mechanism by which the public-facing walk functions - // are implemented. Implementations should call the given function - // for each child node and then replace that node with its return value. - // The return value might just be the same node, for non-transforming - // walks. - walkChildNodes(w internalWalkFunc) - - Range() hcl.Range -} - -type internalWalkFunc func(Node) diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser.go b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser.go deleted file mode 100644 index 772ebae2bc6..00000000000 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/parser.go +++ /dev/null @@ -1,2044 +0,0 @@ -package hclsyntax - -import ( - "bytes" - "fmt" - "strconv" - "unicode/utf8" - - "github.com/apparentlymart/go-textseg/textseg" - "github.com/hashicorp/hcl2/hcl" - "github.com/zclconf/go-cty/cty" -) - -type parser struct { - *peeker - - // set to true if any recovery is attempted. The parser can use this - // to attempt to reduce error noise by suppressing "bad token" errors - // in recovery mode, assuming that the recovery heuristics have failed - // in this case and left the peeker in a wrong place. - recovery bool -} - -func (p *parser) ParseBody(end TokenType) (*Body, hcl.Diagnostics) { - attrs := Attributes{} - blocks := Blocks{} - var diags hcl.Diagnostics - - startRange := p.PrevRange() - var endRange hcl.Range - -Token: - for { - next := p.Peek() - if next.Type == end { - endRange = p.NextRange() - p.Read() - break Token - } - - switch next.Type { - case TokenNewline: - p.Read() - continue - case TokenIdent: - item, itemDiags := p.ParseBodyItem() - diags = append(diags, itemDiags...) - switch titem := item.(type) { - case *Block: - blocks = append(blocks, titem) - case *Attribute: - if existing, exists := attrs[titem.Name]; exists { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Attribute redefined", - Detail: fmt.Sprintf( - "The argument %q was already set at %s. Each argument may be set only once.", - titem.Name, existing.NameRange.String(), - ), - Subject: &titem.NameRange, - }) - } else { - attrs[titem.Name] = titem - } - default: - // This should never happen for valid input, but may if a - // syntax error was detected in ParseBodyItem that prevented - // it from even producing a partially-broken item. In that - // case, it would've left at least one error in the diagnostics - // slice we already dealt with above. - // - // We'll assume ParseBodyItem attempted recovery to leave - // us in a reasonable position to try parsing the next item. - continue - } - default: - bad := p.Read() - if !p.recovery { - if bad.Type == TokenOQuote { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid argument name", - Detail: "Argument names must not be quoted.", - Subject: &bad.Range, - }) - } else { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Argument or block definition required", - Detail: "An argument or block definition is required here.", - Subject: &bad.Range, - }) - } - } - endRange = p.PrevRange() // arbitrary, but somewhere inside the body means better diagnostics - - p.recover(end) // attempt to recover to the token after the end of this body - break Token - } - } - - return &Body{ - Attributes: attrs, - Blocks: blocks, - - SrcRange: hcl.RangeBetween(startRange, endRange), - EndRange: hcl.Range{ - Filename: endRange.Filename, - Start: endRange.End, - End: endRange.End, - }, - }, diags -} - -func (p *parser) ParseBodyItem() (Node, hcl.Diagnostics) { - ident := p.Read() - if ident.Type != TokenIdent { - p.recoverAfterBodyItem() - return nil, hcl.Diagnostics{ - { - Severity: hcl.DiagError, - Summary: "Argument or block definition required", - Detail: "An argument or block definition is required here.", - Subject: &ident.Range, - }, - } - } - - next := p.Peek() - - switch next.Type { - case TokenEqual: - return p.finishParsingBodyAttribute(ident, false) - case TokenOQuote, TokenOBrace, TokenIdent: - return p.finishParsingBodyBlock(ident) - default: - p.recoverAfterBodyItem() - return nil, hcl.Diagnostics{ - { - Severity: hcl.DiagError, - Summary: "Argument or block definition required", - Detail: "An argument or block definition is required here. To set an argument, use the equals sign \"=\" to introduce the argument value.", - Subject: &ident.Range, - }, - } - } - - return nil, nil -} - -// parseSingleAttrBody is a weird variant of ParseBody that deals with the -// body of a nested block containing only one attribute value all on a single -// line, like foo { bar = baz } . It expects to find a single attribute item -// immediately followed by the end token type with no intervening newlines. -func (p *parser) parseSingleAttrBody(end TokenType) (*Body, hcl.Diagnostics) { - ident := p.Read() - if ident.Type != TokenIdent { - p.recoverAfterBodyItem() - return nil, hcl.Diagnostics{ - { - Severity: hcl.DiagError, - Summary: "Argument or block definition required", - Detail: "An argument or block definition is required here.", - Subject: &ident.Range, - }, - } - } - - var attr *Attribute - var diags hcl.Diagnostics - - next := p.Peek() - - switch next.Type { - case TokenEqual: - node, attrDiags := p.finishParsingBodyAttribute(ident, true) - diags = append(diags, attrDiags...) - attr = node.(*Attribute) - case TokenOQuote, TokenOBrace, TokenIdent: - p.recoverAfterBodyItem() - return nil, hcl.Diagnostics{ - { - Severity: hcl.DiagError, - Summary: "Argument definition required", - Detail: fmt.Sprintf("A single-line block definition can contain only a single argument. If you meant to define argument %q, use an equals sign to assign it a value. To define a nested block, place it on a line of its own within its parent block.", ident.Bytes), - Subject: hcl.RangeBetween(ident.Range, next.Range).Ptr(), - }, - } - default: - p.recoverAfterBodyItem() - return nil, hcl.Diagnostics{ - { - Severity: hcl.DiagError, - Summary: "Argument or block definition required", - Detail: "An argument or block definition is required here. To set an argument, use the equals sign \"=\" to introduce the argument value.", - Subject: &ident.Range, - }, - } - } - - return &Body{ - Attributes: Attributes{ - string(ident.Bytes): attr, - }, - - SrcRange: attr.SrcRange, - EndRange: hcl.Range{ - Filename: attr.SrcRange.Filename, - Start: attr.SrcRange.End, - End: attr.SrcRange.End, - }, - }, diags - -} - -func (p *parser) finishParsingBodyAttribute(ident Token, singleLine bool) (Node, hcl.Diagnostics) { - eqTok := p.Read() // eat equals token - if eqTok.Type != TokenEqual { - // should never happen if caller behaves - panic("finishParsingBodyAttribute called with next not equals") - } - - var endRange hcl.Range - - expr, diags := p.ParseExpression() - if p.recovery && diags.HasErrors() { - // recovery within expressions tends to be tricky, so we've probably - // landed somewhere weird. We'll try to reset to the start of a body - // item so parsing can continue. - endRange = p.PrevRange() - p.recoverAfterBodyItem() - } else { - endRange = p.PrevRange() - if !singleLine { - end := p.Peek() - if end.Type != TokenNewline && end.Type != TokenEOF { - if !p.recovery { - summary := "Missing newline after argument" - detail := "An argument definition must end with a newline." - - if end.Type == TokenComma { - summary = "Unexpected comma after argument" - detail = "Argument definitions must be separated by newlines, not commas. " + detail - } - - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: summary, - Detail: detail, - Subject: &end.Range, - Context: hcl.RangeBetween(ident.Range, end.Range).Ptr(), - }) - } - endRange = p.PrevRange() - p.recoverAfterBodyItem() - } else { - endRange = p.PrevRange() - p.Read() // eat newline - } - } - } - - return &Attribute{ - Name: string(ident.Bytes), - Expr: expr, - - SrcRange: hcl.RangeBetween(ident.Range, endRange), - NameRange: ident.Range, - EqualsRange: eqTok.Range, - }, diags -} - -func (p *parser) finishParsingBodyBlock(ident Token) (Node, hcl.Diagnostics) { - var blockType = string(ident.Bytes) - var diags hcl.Diagnostics - var labels []string - var labelRanges []hcl.Range - - var oBrace Token - -Token: - for { - tok := p.Peek() - - switch tok.Type { - - case TokenOBrace: - oBrace = p.Read() - break Token - - case TokenOQuote: - label, labelRange, labelDiags := p.parseQuotedStringLiteral() - diags = append(diags, labelDiags...) - labels = append(labels, label) - labelRanges = append(labelRanges, labelRange) - // parseQuoteStringLiteral recovers up to the closing quote - // if it encounters problems, so we can continue looking for - // more labels and eventually the block body even. - - case TokenIdent: - tok = p.Read() // eat token - label, labelRange := string(tok.Bytes), tok.Range - labels = append(labels, label) - labelRanges = append(labelRanges, labelRange) - - default: - switch tok.Type { - case TokenEqual: - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid block definition", - Detail: "The equals sign \"=\" indicates an argument definition, and must not be used when defining a block.", - Subject: &tok.Range, - Context: hcl.RangeBetween(ident.Range, tok.Range).Ptr(), - }) - case TokenNewline: - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid block definition", - Detail: "A block definition must have block content delimited by \"{\" and \"}\", starting on the same line as the block header.", - Subject: &tok.Range, - Context: hcl.RangeBetween(ident.Range, tok.Range).Ptr(), - }) - default: - if !p.recovery { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid block definition", - Detail: "Either a quoted string block label or an opening brace (\"{\") is expected here.", - Subject: &tok.Range, - Context: hcl.RangeBetween(ident.Range, tok.Range).Ptr(), - }) - } - } - - p.recoverAfterBodyItem() - - return &Block{ - Type: blockType, - Labels: labels, - Body: &Body{ - SrcRange: ident.Range, - EndRange: ident.Range, - }, - - TypeRange: ident.Range, - LabelRanges: labelRanges, - OpenBraceRange: ident.Range, // placeholder - CloseBraceRange: ident.Range, // placeholder - }, diags - } - } - - // Once we fall out here, the peeker is pointed just after our opening - // brace, so we can begin our nested body parsing. - var body *Body - var bodyDiags hcl.Diagnostics - switch p.Peek().Type { - case TokenNewline, TokenEOF, TokenCBrace: - body, bodyDiags = p.ParseBody(TokenCBrace) - default: - // Special one-line, single-attribute block parsing mode. - body, bodyDiags = p.parseSingleAttrBody(TokenCBrace) - switch p.Peek().Type { - case TokenCBrace: - p.Read() // the happy path - just consume the closing brace - case TokenComma: - // User seems to be trying to use the object-constructor - // comma-separated style, which isn't permitted for blocks. - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid single-argument block definition", - Detail: "Single-line block syntax can include only one argument definition. To define multiple arguments, use the multi-line block syntax with one argument definition per line.", - Subject: p.Peek().Range.Ptr(), - }) - p.recover(TokenCBrace) - case TokenNewline: - // We don't allow weird mixtures of single and multi-line syntax. - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid single-argument block definition", - Detail: "An argument definition on the same line as its containing block creates a single-line block definition, which must also be closed on the same line. Place the block's closing brace immediately after the argument definition.", - Subject: p.Peek().Range.Ptr(), - }) - p.recover(TokenCBrace) - default: - // Some other weird thing is going on. Since we can't guess a likely - // user intent for this one, we'll skip it if we're already in - // recovery mode. - if !p.recovery { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid single-argument block definition", - Detail: "A single-line block definition must end with a closing brace immediately after its single argument definition.", - Subject: p.Peek().Range.Ptr(), - }) - } - p.recover(TokenCBrace) - } - } - diags = append(diags, bodyDiags...) - cBraceRange := p.PrevRange() - - eol := p.Peek() - if eol.Type == TokenNewline || eol.Type == TokenEOF { - p.Read() // eat newline - } else { - if !p.recovery { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Missing newline after block definition", - Detail: "A block definition must end with a newline.", - Subject: &eol.Range, - Context: hcl.RangeBetween(ident.Range, eol.Range).Ptr(), - }) - } - p.recoverAfterBodyItem() - } - - // We must never produce a nil body, since the caller may attempt to - // do analysis of a partial result when there's an error, so we'll - // insert a placeholder if we otherwise failed to produce a valid - // body due to one of the syntax error paths above. - if body == nil && diags.HasErrors() { - body = &Body{ - SrcRange: hcl.RangeBetween(oBrace.Range, cBraceRange), - EndRange: cBraceRange, - } - } - - return &Block{ - Type: blockType, - Labels: labels, - Body: body, - - TypeRange: ident.Range, - LabelRanges: labelRanges, - OpenBraceRange: oBrace.Range, - CloseBraceRange: cBraceRange, - }, diags -} - -func (p *parser) ParseExpression() (Expression, hcl.Diagnostics) { - return p.parseTernaryConditional() -} - -func (p *parser) parseTernaryConditional() (Expression, hcl.Diagnostics) { - // The ternary conditional operator (.. ? .. : ..) behaves somewhat - // like a binary operator except that the "symbol" is itself - // an expression enclosed in two punctuation characters. - // The middle expression is parsed as if the ? and : symbols - // were parentheses. The "rhs" (the "false expression") is then - // treated right-associatively so it behaves similarly to the - // middle in terms of precedence. - - startRange := p.NextRange() - var condExpr, trueExpr, falseExpr Expression - var diags hcl.Diagnostics - - condExpr, condDiags := p.parseBinaryOps(binaryOps) - diags = append(diags, condDiags...) - if p.recovery && condDiags.HasErrors() { - return condExpr, diags - } - - questionMark := p.Peek() - if questionMark.Type != TokenQuestion { - return condExpr, diags - } - - p.Read() // eat question mark - - trueExpr, trueDiags := p.ParseExpression() - diags = append(diags, trueDiags...) - if p.recovery && trueDiags.HasErrors() { - return condExpr, diags - } - - colon := p.Peek() - if colon.Type != TokenColon { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Missing false expression in conditional", - Detail: "The conditional operator (...?...:...) requires a false expression, delimited by a colon.", - Subject: &colon.Range, - Context: hcl.RangeBetween(startRange, colon.Range).Ptr(), - }) - return condExpr, diags - } - - p.Read() // eat colon - - falseExpr, falseDiags := p.ParseExpression() - diags = append(diags, falseDiags...) - if p.recovery && falseDiags.HasErrors() { - return condExpr, diags - } - - return &ConditionalExpr{ - Condition: condExpr, - TrueResult: trueExpr, - FalseResult: falseExpr, - - SrcRange: hcl.RangeBetween(startRange, falseExpr.Range()), - }, diags -} - -// parseBinaryOps calls itself recursively to work through all of the -// operator precedence groups, and then eventually calls parseExpressionTerm -// for each operand. -func (p *parser) parseBinaryOps(ops []map[TokenType]*Operation) (Expression, hcl.Diagnostics) { - if len(ops) == 0 { - // We've run out of operators, so now we'll just try to parse a term. - return p.parseExpressionWithTraversals() - } - - thisLevel := ops[0] - remaining := ops[1:] - - var lhs, rhs Expression - var operation *Operation - var diags hcl.Diagnostics - - // Parse a term that might be the first operand of a binary - // operation or it might just be a standalone term. - // We won't know until we've parsed it and can look ahead - // to see if there's an operator token for this level. - lhs, lhsDiags := p.parseBinaryOps(remaining) - diags = append(diags, lhsDiags...) - if p.recovery && lhsDiags.HasErrors() { - return lhs, diags - } - - // We'll keep eating up operators until we run out, so that operators - // with the same precedence will combine in a left-associative manner: - // a+b+c => (a+b)+c, not a+(b+c) - // - // Should we later want to have right-associative operators, a way - // to achieve that would be to call back up to ParseExpression here - // instead of iteratively parsing only the remaining operators. - for { - next := p.Peek() - var newOp *Operation - var ok bool - if newOp, ok = thisLevel[next.Type]; !ok { - break - } - - // Are we extending an expression started on the previous iteration? - if operation != nil { - lhs = &BinaryOpExpr{ - LHS: lhs, - Op: operation, - RHS: rhs, - - SrcRange: hcl.RangeBetween(lhs.Range(), rhs.Range()), - } - } - - operation = newOp - p.Read() // eat operator token - var rhsDiags hcl.Diagnostics - rhs, rhsDiags = p.parseBinaryOps(remaining) - diags = append(diags, rhsDiags...) - if p.recovery && rhsDiags.HasErrors() { - return lhs, diags - } - } - - if operation == nil { - return lhs, diags - } - - return &BinaryOpExpr{ - LHS: lhs, - Op: operation, - RHS: rhs, - - SrcRange: hcl.RangeBetween(lhs.Range(), rhs.Range()), - }, diags -} - -func (p *parser) parseExpressionWithTraversals() (Expression, hcl.Diagnostics) { - term, diags := p.parseExpressionTerm() - ret, moreDiags := p.parseExpressionTraversals(term) - diags = append(diags, moreDiags...) - return ret, diags -} - -func (p *parser) parseExpressionTraversals(from Expression) (Expression, hcl.Diagnostics) { - var diags hcl.Diagnostics - ret := from - -Traversal: - for { - next := p.Peek() - - switch next.Type { - case TokenDot: - // Attribute access or splat - dot := p.Read() - attrTok := p.Peek() - - switch attrTok.Type { - case TokenIdent: - attrTok = p.Read() // eat token - name := string(attrTok.Bytes) - rng := hcl.RangeBetween(dot.Range, attrTok.Range) - step := hcl.TraverseAttr{ - Name: name, - SrcRange: rng, - } - - ret = makeRelativeTraversal(ret, step, rng) - - case TokenNumberLit: - // This is a weird form we inherited from HIL, allowing numbers - // to be used as attributes as a weird way of writing [n]. - // This was never actually a first-class thing in HIL, but - // HIL tolerated sequences like .0. in its variable names and - // calling applications like Terraform exploited that to - // introduce indexing syntax where none existed. - numTok := p.Read() // eat token - attrTok = numTok - - // This syntax is ambiguous if multiple indices are used in - // succession, like foo.0.1.baz: that actually parses as - // a fractional number 0.1. Since we're only supporting this - // syntax for compatibility with legacy Terraform - // configurations, and Terraform does not tend to have lists - // of lists, we'll choose to reject that here with a helpful - // error message, rather than failing later because the index - // isn't a whole number. - if dotIdx := bytes.IndexByte(numTok.Bytes, '.'); dotIdx >= 0 { - first := numTok.Bytes[:dotIdx] - second := numTok.Bytes[dotIdx+1:] - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid legacy index syntax", - Detail: fmt.Sprintf("When using the legacy index syntax, chaining two indexes together is not permitted. Use the proper index syntax instead, like [%s][%s].", first, second), - Subject: &attrTok.Range, - }) - rng := hcl.RangeBetween(dot.Range, numTok.Range) - step := hcl.TraverseIndex{ - Key: cty.DynamicVal, - SrcRange: rng, - } - ret = makeRelativeTraversal(ret, step, rng) - break - } - - numVal, numDiags := p.numberLitValue(numTok) - diags = append(diags, numDiags...) - - rng := hcl.RangeBetween(dot.Range, numTok.Range) - step := hcl.TraverseIndex{ - Key: numVal, - SrcRange: rng, - } - - ret = makeRelativeTraversal(ret, step, rng) - - case TokenStar: - // "Attribute-only" splat expression. - // (This is a kinda weird construct inherited from HIL, which - // behaves a bit like a [*] splat except that it is only able - // to do attribute traversals into each of its elements, - // whereas foo[*] can support _any_ traversal. - marker := p.Read() // eat star - trav := make(hcl.Traversal, 0, 1) - var firstRange, lastRange hcl.Range - firstRange = p.NextRange() - for p.Peek().Type == TokenDot { - dot := p.Read() - - if p.Peek().Type == TokenNumberLit { - // Continuing the "weird stuff inherited from HIL" - // theme, we also allow numbers as attribute names - // inside splats and interpret them as indexing - // into a list, for expressions like: - // foo.bar.*.baz.0.foo - numTok := p.Read() - - // Weird special case if the user writes something - // like foo.bar.*.baz.0.0.foo, where 0.0 parses - // as a number. - if dotIdx := bytes.IndexByte(numTok.Bytes, '.'); dotIdx >= 0 { - first := numTok.Bytes[:dotIdx] - second := numTok.Bytes[dotIdx+1:] - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid legacy index syntax", - Detail: fmt.Sprintf("When using the legacy index syntax, chaining two indexes together is not permitted. Use the proper index syntax with a full splat expression [*] instead, like [%s][%s].", first, second), - Subject: &attrTok.Range, - }) - trav = append(trav, hcl.TraverseIndex{ - Key: cty.DynamicVal, - SrcRange: hcl.RangeBetween(dot.Range, numTok.Range), - }) - lastRange = numTok.Range - continue - } - - numVal, numDiags := p.numberLitValue(numTok) - diags = append(diags, numDiags...) - trav = append(trav, hcl.TraverseIndex{ - Key: numVal, - SrcRange: hcl.RangeBetween(dot.Range, numTok.Range), - }) - lastRange = numTok.Range - continue - } - - if p.Peek().Type != TokenIdent { - if !p.recovery { - if p.Peek().Type == TokenStar { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Nested splat expression not allowed", - Detail: "A splat expression (*) cannot be used inside another attribute-only splat expression.", - Subject: p.Peek().Range.Ptr(), - }) - } else { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid attribute name", - Detail: "An attribute name is required after a dot.", - Subject: &attrTok.Range, - }) - } - } - p.setRecovery() - continue Traversal - } - - attrTok := p.Read() - trav = append(trav, hcl.TraverseAttr{ - Name: string(attrTok.Bytes), - SrcRange: hcl.RangeBetween(dot.Range, attrTok.Range), - }) - lastRange = attrTok.Range - } - - itemExpr := &AnonSymbolExpr{ - SrcRange: hcl.RangeBetween(dot.Range, marker.Range), - } - var travExpr Expression - if len(trav) == 0 { - travExpr = itemExpr - } else { - travExpr = &RelativeTraversalExpr{ - Source: itemExpr, - Traversal: trav, - SrcRange: hcl.RangeBetween(firstRange, lastRange), - } - } - - ret = &SplatExpr{ - Source: ret, - Each: travExpr, - Item: itemExpr, - - SrcRange: hcl.RangeBetween(dot.Range, lastRange), - MarkerRange: hcl.RangeBetween(dot.Range, marker.Range), - } - - default: - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid attribute name", - Detail: "An attribute name is required after a dot.", - Subject: &attrTok.Range, - }) - // This leaves the peeker in a bad place, so following items - // will probably be misparsed until we hit something that - // allows us to re-sync. - // - // We will probably need to do something better here eventually - // in order to support autocomplete triggered by typing a - // period. - p.setRecovery() - } - - case TokenOBrack: - // Indexing of a collection. - // This may or may not be a hcl.Traverser, depending on whether - // the key value is something constant. - - open := p.Read() - switch p.Peek().Type { - case TokenStar: - // This is a full splat expression, like foo[*], which consumes - // the rest of the traversal steps after it using a recursive - // call to this function. - p.Read() // consume star - close := p.Read() - if close.Type != TokenCBrack && !p.recovery { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Missing close bracket on splat index", - Detail: "The star for a full splat operator must be immediately followed by a closing bracket (\"]\").", - Subject: &close.Range, - }) - close = p.recover(TokenCBrack) - } - // Splat expressions use a special "anonymous symbol" as a - // placeholder in an expression to be evaluated once for each - // item in the source expression. - itemExpr := &AnonSymbolExpr{ - SrcRange: hcl.RangeBetween(open.Range, close.Range), - } - // Now we'll recursively call this same function to eat any - // remaining traversal steps against the anonymous symbol. - travExpr, nestedDiags := p.parseExpressionTraversals(itemExpr) - diags = append(diags, nestedDiags...) - - ret = &SplatExpr{ - Source: ret, - Each: travExpr, - Item: itemExpr, - - SrcRange: hcl.RangeBetween(open.Range, travExpr.Range()), - MarkerRange: hcl.RangeBetween(open.Range, close.Range), - } - - default: - - var close Token - p.PushIncludeNewlines(false) // arbitrary newlines allowed in brackets - keyExpr, keyDiags := p.ParseExpression() - diags = append(diags, keyDiags...) - if p.recovery && keyDiags.HasErrors() { - close = p.recover(TokenCBrack) - } else { - close = p.Read() - if close.Type != TokenCBrack && !p.recovery { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Missing close bracket on index", - Detail: "The index operator must end with a closing bracket (\"]\").", - Subject: &close.Range, - }) - close = p.recover(TokenCBrack) - } - } - p.PopIncludeNewlines() - - if lit, isLit := keyExpr.(*LiteralValueExpr); isLit { - litKey, _ := lit.Value(nil) - rng := hcl.RangeBetween(open.Range, close.Range) - step := hcl.TraverseIndex{ - Key: litKey, - SrcRange: rng, - } - ret = makeRelativeTraversal(ret, step, rng) - } else if tmpl, isTmpl := keyExpr.(*TemplateExpr); isTmpl && tmpl.IsStringLiteral() { - litKey, _ := tmpl.Value(nil) - rng := hcl.RangeBetween(open.Range, close.Range) - step := hcl.TraverseIndex{ - Key: litKey, - SrcRange: rng, - } - ret = makeRelativeTraversal(ret, step, rng) - } else { - rng := hcl.RangeBetween(open.Range, close.Range) - ret = &IndexExpr{ - Collection: ret, - Key: keyExpr, - - SrcRange: rng, - OpenRange: open.Range, - } - } - } - - default: - break Traversal - } - } - - return ret, diags -} - -// makeRelativeTraversal takes an expression and a traverser and returns -// a traversal expression that combines the two. If the given expression -// is already a traversal, it is extended in place (mutating it) and -// returned. If it isn't, a new RelativeTraversalExpr is created and returned. -func makeRelativeTraversal(expr Expression, next hcl.Traverser, rng hcl.Range) Expression { - switch texpr := expr.(type) { - case *ScopeTraversalExpr: - texpr.Traversal = append(texpr.Traversal, next) - texpr.SrcRange = hcl.RangeBetween(texpr.SrcRange, rng) - return texpr - case *RelativeTraversalExpr: - texpr.Traversal = append(texpr.Traversal, next) - texpr.SrcRange = hcl.RangeBetween(texpr.SrcRange, rng) - return texpr - default: - return &RelativeTraversalExpr{ - Source: expr, - Traversal: hcl.Traversal{next}, - SrcRange: rng, - } - } -} - -func (p *parser) parseExpressionTerm() (Expression, hcl.Diagnostics) { - start := p.Peek() - - switch start.Type { - case TokenOParen: - p.Read() // eat open paren - - p.PushIncludeNewlines(false) - - expr, diags := p.ParseExpression() - if diags.HasErrors() { - // attempt to place the peeker after our closing paren - // before we return, so that the next parser has some - // chance of finding a valid expression. - p.recover(TokenCParen) - p.PopIncludeNewlines() - return expr, diags - } - - close := p.Peek() - if close.Type != TokenCParen { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Unbalanced parentheses", - Detail: "Expected a closing parenthesis to terminate the expression.", - Subject: &close.Range, - Context: hcl.RangeBetween(start.Range, close.Range).Ptr(), - }) - p.setRecovery() - } - - p.Read() // eat closing paren - p.PopIncludeNewlines() - - return expr, diags - - case TokenNumberLit: - tok := p.Read() // eat number token - - numVal, diags := p.numberLitValue(tok) - return &LiteralValueExpr{ - Val: numVal, - SrcRange: tok.Range, - }, diags - - case TokenIdent: - tok := p.Read() // eat identifier token - - if p.Peek().Type == TokenOParen { - return p.finishParsingFunctionCall(tok) - } - - name := string(tok.Bytes) - switch name { - case "true": - return &LiteralValueExpr{ - Val: cty.True, - SrcRange: tok.Range, - }, nil - case "false": - return &LiteralValueExpr{ - Val: cty.False, - SrcRange: tok.Range, - }, nil - case "null": - return &LiteralValueExpr{ - Val: cty.NullVal(cty.DynamicPseudoType), - SrcRange: tok.Range, - }, nil - default: - return &ScopeTraversalExpr{ - Traversal: hcl.Traversal{ - hcl.TraverseRoot{ - Name: name, - SrcRange: tok.Range, - }, - }, - SrcRange: tok.Range, - }, nil - } - - case TokenOQuote, TokenOHeredoc: - open := p.Read() // eat opening marker - closer := p.oppositeBracket(open.Type) - exprs, passthru, _, diags := p.parseTemplateInner(closer, tokenOpensFlushHeredoc(open)) - - closeRange := p.PrevRange() - - if passthru { - if len(exprs) != 1 { - panic("passthru set with len(exprs) != 1") - } - return &TemplateWrapExpr{ - Wrapped: exprs[0], - SrcRange: hcl.RangeBetween(open.Range, closeRange), - }, diags - } - - return &TemplateExpr{ - Parts: exprs, - SrcRange: hcl.RangeBetween(open.Range, closeRange), - }, diags - - case TokenMinus: - tok := p.Read() // eat minus token - - // Important to use parseExpressionWithTraversals rather than parseExpression - // here, otherwise we can capture a following binary expression into - // our negation. - // e.g. -46+5 should parse as (-46)+5, not -(46+5) - operand, diags := p.parseExpressionWithTraversals() - return &UnaryOpExpr{ - Op: OpNegate, - Val: operand, - - SrcRange: hcl.RangeBetween(tok.Range, operand.Range()), - SymbolRange: tok.Range, - }, diags - - case TokenBang: - tok := p.Read() // eat bang token - - // Important to use parseExpressionWithTraversals rather than parseExpression - // here, otherwise we can capture a following binary expression into - // our negation. - operand, diags := p.parseExpressionWithTraversals() - return &UnaryOpExpr{ - Op: OpLogicalNot, - Val: operand, - - SrcRange: hcl.RangeBetween(tok.Range, operand.Range()), - SymbolRange: tok.Range, - }, diags - - case TokenOBrack: - return p.parseTupleCons() - - case TokenOBrace: - return p.parseObjectCons() - - default: - var diags hcl.Diagnostics - if !p.recovery { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid expression", - Detail: "Expected the start of an expression, but found an invalid expression token.", - Subject: &start.Range, - }) - } - p.setRecovery() - - // Return a placeholder so that the AST is still structurally sound - // even in the presence of parse errors. - return &LiteralValueExpr{ - Val: cty.DynamicVal, - SrcRange: start.Range, - }, diags - } -} - -func (p *parser) numberLitValue(tok Token) (cty.Value, hcl.Diagnostics) { - // The cty.ParseNumberVal is always the same behavior as converting a - // string to a number, ensuring we always interpret decimal numbers in - // the same way. - numVal, err := cty.ParseNumberVal(string(tok.Bytes)) - if err != nil { - ret := cty.UnknownVal(cty.Number) - return ret, hcl.Diagnostics{ - { - Severity: hcl.DiagError, - Summary: "Invalid number literal", - // FIXME: not a very good error message, but convert only - // gives us "a number is required", so not much help either. - Detail: "Failed to recognize the value of this number literal.", - Subject: &tok.Range, - }, - } - } - return numVal, nil -} - -// finishParsingFunctionCall parses a function call assuming that the function -// name was already read, and so the peeker should be pointing at the opening -// parenthesis after the name. -func (p *parser) finishParsingFunctionCall(name Token) (Expression, hcl.Diagnostics) { - openTok := p.Read() - if openTok.Type != TokenOParen { - // should never happen if callers behave - panic("finishParsingFunctionCall called with non-parenthesis as next token") - } - - var args []Expression - var diags hcl.Diagnostics - var expandFinal bool - var closeTok Token - - // Arbitrary newlines are allowed inside the function call parentheses. - p.PushIncludeNewlines(false) - -Token: - for { - tok := p.Peek() - - if tok.Type == TokenCParen { - closeTok = p.Read() // eat closing paren - break Token - } - - arg, argDiags := p.ParseExpression() - args = append(args, arg) - diags = append(diags, argDiags...) - if p.recovery && argDiags.HasErrors() { - // if there was a parse error in the argument then we've - // probably been left in a weird place in the token stream, - // so we'll bail out with a partial argument list. - p.recover(TokenCParen) - break Token - } - - sep := p.Read() - if sep.Type == TokenCParen { - closeTok = sep - break Token - } - - if sep.Type == TokenEllipsis { - expandFinal = true - - if p.Peek().Type != TokenCParen { - if !p.recovery { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Missing closing parenthesis", - Detail: "An expanded function argument (with ...) must be immediately followed by closing parentheses.", - Subject: &sep.Range, - Context: hcl.RangeBetween(name.Range, sep.Range).Ptr(), - }) - } - closeTok = p.recover(TokenCParen) - } else { - closeTok = p.Read() // eat closing paren - } - break Token - } - - if sep.Type != TokenComma { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Missing argument separator", - Detail: "A comma is required to separate each function argument from the next.", - Subject: &sep.Range, - Context: hcl.RangeBetween(name.Range, sep.Range).Ptr(), - }) - closeTok = p.recover(TokenCParen) - break Token - } - - if p.Peek().Type == TokenCParen { - // A trailing comma after the last argument gets us in here. - closeTok = p.Read() // eat closing paren - break Token - } - - } - - p.PopIncludeNewlines() - - return &FunctionCallExpr{ - Name: string(name.Bytes), - Args: args, - - ExpandFinal: expandFinal, - - NameRange: name.Range, - OpenParenRange: openTok.Range, - CloseParenRange: closeTok.Range, - }, diags -} - -func (p *parser) parseTupleCons() (Expression, hcl.Diagnostics) { - open := p.Read() - if open.Type != TokenOBrack { - // Should never happen if callers are behaving - panic("parseTupleCons called without peeker pointing to open bracket") - } - - p.PushIncludeNewlines(false) - defer p.PopIncludeNewlines() - - if forKeyword.TokenMatches(p.Peek()) { - return p.finishParsingForExpr(open) - } - - var close Token - - var diags hcl.Diagnostics - var exprs []Expression - - for { - next := p.Peek() - if next.Type == TokenCBrack { - close = p.Read() // eat closer - break - } - - expr, exprDiags := p.ParseExpression() - exprs = append(exprs, expr) - diags = append(diags, exprDiags...) - - if p.recovery && exprDiags.HasErrors() { - // If expression parsing failed then we are probably in a strange - // place in the token stream, so we'll bail out and try to reset - // to after our closing bracket to allow parsing to continue. - close = p.recover(TokenCBrack) - break - } - - next = p.Peek() - if next.Type == TokenCBrack { - close = p.Read() // eat closer - break - } - - if next.Type != TokenComma { - if !p.recovery { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Missing item separator", - Detail: "Expected a comma to mark the beginning of the next item.", - Subject: &next.Range, - Context: hcl.RangeBetween(open.Range, next.Range).Ptr(), - }) - } - close = p.recover(TokenCBrack) - break - } - - p.Read() // eat comma - - } - - return &TupleConsExpr{ - Exprs: exprs, - - SrcRange: hcl.RangeBetween(open.Range, close.Range), - OpenRange: open.Range, - }, diags -} - -func (p *parser) parseObjectCons() (Expression, hcl.Diagnostics) { - open := p.Read() - if open.Type != TokenOBrace { - // Should never happen if callers are behaving - panic("parseObjectCons called without peeker pointing to open brace") - } - - // We must temporarily stop looking at newlines here while we check for - // a "for" keyword, since for expressions are _not_ newline-sensitive, - // even though object constructors are. - p.PushIncludeNewlines(false) - isFor := forKeyword.TokenMatches(p.Peek()) - p.PopIncludeNewlines() - if isFor { - return p.finishParsingForExpr(open) - } - - p.PushIncludeNewlines(true) - defer p.PopIncludeNewlines() - - var close Token - - var diags hcl.Diagnostics - var items []ObjectConsItem - - for { - next := p.Peek() - if next.Type == TokenNewline { - p.Read() // eat newline - continue - } - - if next.Type == TokenCBrace { - close = p.Read() // eat closer - break - } - - var key Expression - var keyDiags hcl.Diagnostics - key, keyDiags = p.ParseExpression() - diags = append(diags, keyDiags...) - - if p.recovery && keyDiags.HasErrors() { - // If expression parsing failed then we are probably in a strange - // place in the token stream, so we'll bail out and try to reset - // to after our closing brace to allow parsing to continue. - close = p.recover(TokenCBrace) - break - } - - // We wrap up the key expression in a special wrapper that deals - // with our special case that naked identifiers as object keys - // are interpreted as literal strings. - key = &ObjectConsKeyExpr{Wrapped: key} - - next = p.Peek() - if next.Type != TokenEqual && next.Type != TokenColon { - if !p.recovery { - switch next.Type { - case TokenNewline, TokenComma: - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Missing attribute value", - Detail: "Expected an attribute value, introduced by an equals sign (\"=\").", - Subject: &next.Range, - Context: hcl.RangeBetween(open.Range, next.Range).Ptr(), - }) - case TokenIdent: - // Although this might just be a plain old missing equals - // sign before a reference, one way to get here is to try - // to write an attribute name containing a period followed - // by a digit, which was valid in HCL1, like this: - // foo1.2_bar = "baz" - // We can't know exactly what the user intended here, but - // we'll augment our message with an extra hint in this case - // in case it is helpful. - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Missing key/value separator", - Detail: "Expected an equals sign (\"=\") to mark the beginning of the attribute value. If you intended to given an attribute name containing periods or spaces, write the name in quotes to create a string literal.", - Subject: &next.Range, - Context: hcl.RangeBetween(open.Range, next.Range).Ptr(), - }) - default: - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Missing key/value separator", - Detail: "Expected an equals sign (\"=\") to mark the beginning of the attribute value.", - Subject: &next.Range, - Context: hcl.RangeBetween(open.Range, next.Range).Ptr(), - }) - } - } - close = p.recover(TokenCBrace) - break - } - - p.Read() // eat equals sign or colon - - value, valueDiags := p.ParseExpression() - diags = append(diags, valueDiags...) - - if p.recovery && valueDiags.HasErrors() { - // If expression parsing failed then we are probably in a strange - // place in the token stream, so we'll bail out and try to reset - // to after our closing brace to allow parsing to continue. - close = p.recover(TokenCBrace) - break - } - - items = append(items, ObjectConsItem{ - KeyExpr: key, - ValueExpr: value, - }) - - next = p.Peek() - if next.Type == TokenCBrace { - close = p.Read() // eat closer - break - } - - if next.Type != TokenComma && next.Type != TokenNewline { - if !p.recovery { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Missing attribute separator", - Detail: "Expected a newline or comma to mark the beginning of the next attribute.", - Subject: &next.Range, - Context: hcl.RangeBetween(open.Range, next.Range).Ptr(), - }) - } - close = p.recover(TokenCBrace) - break - } - - p.Read() // eat comma or newline - - } - - return &ObjectConsExpr{ - Items: items, - - SrcRange: hcl.RangeBetween(open.Range, close.Range), - OpenRange: open.Range, - }, diags -} - -func (p *parser) finishParsingForExpr(open Token) (Expression, hcl.Diagnostics) { - p.PushIncludeNewlines(false) - defer p.PopIncludeNewlines() - introducer := p.Read() - if !forKeyword.TokenMatches(introducer) { - // Should never happen if callers are behaving - panic("finishParsingForExpr called without peeker pointing to 'for' identifier") - } - - var makeObj bool - var closeType TokenType - switch open.Type { - case TokenOBrace: - makeObj = true - closeType = TokenCBrace - case TokenOBrack: - makeObj = false // making a tuple - closeType = TokenCBrack - default: - // Should never happen if callers are behaving - panic("finishParsingForExpr called with invalid open token") - } - - var diags hcl.Diagnostics - var keyName, valName string - - if p.Peek().Type != TokenIdent { - if !p.recovery { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid 'for' expression", - Detail: "For expression requires variable name after 'for'.", - Subject: p.Peek().Range.Ptr(), - Context: hcl.RangeBetween(open.Range, p.Peek().Range).Ptr(), - }) - } - close := p.recover(closeType) - return &LiteralValueExpr{ - Val: cty.DynamicVal, - SrcRange: hcl.RangeBetween(open.Range, close.Range), - }, diags - } - - valName = string(p.Read().Bytes) - - if p.Peek().Type == TokenComma { - // What we just read was actually the key, then. - keyName = valName - p.Read() // eat comma - - if p.Peek().Type != TokenIdent { - if !p.recovery { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid 'for' expression", - Detail: "For expression requires value variable name after comma.", - Subject: p.Peek().Range.Ptr(), - Context: hcl.RangeBetween(open.Range, p.Peek().Range).Ptr(), - }) - } - close := p.recover(closeType) - return &LiteralValueExpr{ - Val: cty.DynamicVal, - SrcRange: hcl.RangeBetween(open.Range, close.Range), - }, diags - } - - valName = string(p.Read().Bytes) - } - - if !inKeyword.TokenMatches(p.Peek()) { - if !p.recovery { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid 'for' expression", - Detail: "For expression requires the 'in' keyword after its name declarations.", - Subject: p.Peek().Range.Ptr(), - Context: hcl.RangeBetween(open.Range, p.Peek().Range).Ptr(), - }) - } - close := p.recover(closeType) - return &LiteralValueExpr{ - Val: cty.DynamicVal, - SrcRange: hcl.RangeBetween(open.Range, close.Range), - }, diags - } - p.Read() // eat 'in' keyword - - collExpr, collDiags := p.ParseExpression() - diags = append(diags, collDiags...) - if p.recovery && collDiags.HasErrors() { - close := p.recover(closeType) - return &LiteralValueExpr{ - Val: cty.DynamicVal, - SrcRange: hcl.RangeBetween(open.Range, close.Range), - }, diags - } - - if p.Peek().Type != TokenColon { - if !p.recovery { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid 'for' expression", - Detail: "For expression requires a colon after the collection expression.", - Subject: p.Peek().Range.Ptr(), - Context: hcl.RangeBetween(open.Range, p.Peek().Range).Ptr(), - }) - } - close := p.recover(closeType) - return &LiteralValueExpr{ - Val: cty.DynamicVal, - SrcRange: hcl.RangeBetween(open.Range, close.Range), - }, diags - } - p.Read() // eat colon - - var keyExpr, valExpr Expression - var keyDiags, valDiags hcl.Diagnostics - valExpr, valDiags = p.ParseExpression() - if p.Peek().Type == TokenFatArrow { - // What we just parsed was actually keyExpr - p.Read() // eat the fat arrow - keyExpr, keyDiags = valExpr, valDiags - - valExpr, valDiags = p.ParseExpression() - } - diags = append(diags, keyDiags...) - diags = append(diags, valDiags...) - if p.recovery && (keyDiags.HasErrors() || valDiags.HasErrors()) { - close := p.recover(closeType) - return &LiteralValueExpr{ - Val: cty.DynamicVal, - SrcRange: hcl.RangeBetween(open.Range, close.Range), - }, diags - } - - group := false - var ellipsis Token - if p.Peek().Type == TokenEllipsis { - ellipsis = p.Read() - group = true - } - - var condExpr Expression - var condDiags hcl.Diagnostics - if ifKeyword.TokenMatches(p.Peek()) { - p.Read() // eat "if" - condExpr, condDiags = p.ParseExpression() - diags = append(diags, condDiags...) - if p.recovery && condDiags.HasErrors() { - close := p.recover(p.oppositeBracket(open.Type)) - return &LiteralValueExpr{ - Val: cty.DynamicVal, - SrcRange: hcl.RangeBetween(open.Range, close.Range), - }, diags - } - } - - var close Token - if p.Peek().Type == closeType { - close = p.Read() - } else { - if !p.recovery { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid 'for' expression", - Detail: "Extra characters after the end of the 'for' expression.", - Subject: p.Peek().Range.Ptr(), - Context: hcl.RangeBetween(open.Range, p.Peek().Range).Ptr(), - }) - } - close = p.recover(closeType) - } - - if !makeObj { - if keyExpr != nil { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid 'for' expression", - Detail: "Key expression is not valid when building a tuple.", - Subject: keyExpr.Range().Ptr(), - Context: hcl.RangeBetween(open.Range, close.Range).Ptr(), - }) - } - - if group { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid 'for' expression", - Detail: "Grouping ellipsis (...) cannot be used when building a tuple.", - Subject: &ellipsis.Range, - Context: hcl.RangeBetween(open.Range, close.Range).Ptr(), - }) - } - } else { - if keyExpr == nil { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid 'for' expression", - Detail: "Key expression is required when building an object.", - Subject: valExpr.Range().Ptr(), - Context: hcl.RangeBetween(open.Range, close.Range).Ptr(), - }) - } - } - - return &ForExpr{ - KeyVar: keyName, - ValVar: valName, - CollExpr: collExpr, - KeyExpr: keyExpr, - ValExpr: valExpr, - CondExpr: condExpr, - Group: group, - - SrcRange: hcl.RangeBetween(open.Range, close.Range), - OpenRange: open.Range, - CloseRange: close.Range, - }, diags -} - -// parseQuotedStringLiteral is a helper for parsing quoted strings that -// aren't allowed to contain any interpolations, such as block labels. -func (p *parser) parseQuotedStringLiteral() (string, hcl.Range, hcl.Diagnostics) { - oQuote := p.Read() - if oQuote.Type != TokenOQuote { - return "", oQuote.Range, hcl.Diagnostics{ - { - Severity: hcl.DiagError, - Summary: "Invalid string literal", - Detail: "A quoted string is required here.", - Subject: &oQuote.Range, - }, - } - } - - var diags hcl.Diagnostics - ret := &bytes.Buffer{} - var cQuote Token - -Token: - for { - tok := p.Read() - switch tok.Type { - - case TokenCQuote: - cQuote = tok - break Token - - case TokenQuotedLit: - s, sDiags := p.decodeStringLit(tok) - diags = append(diags, sDiags...) - ret.WriteString(s) - - case TokenTemplateControl, TokenTemplateInterp: - which := "$" - if tok.Type == TokenTemplateControl { - which = "%" - } - - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid string literal", - Detail: fmt.Sprintf( - "Template sequences are not allowed in this string. To include a literal %q, double it (as \"%s%s\") to escape it.", - which, which, which, - ), - Subject: &tok.Range, - Context: hcl.RangeBetween(oQuote.Range, tok.Range).Ptr(), - }) - - // Now that we're returning an error callers won't attempt to use - // the result for any real operations, but they might try to use - // the partial AST for other analyses, so we'll leave a marker - // to indicate that there was something invalid in the string to - // help avoid misinterpretation of the partial result - ret.WriteString(which) - ret.WriteString("{ ... }") - - p.recover(TokenTemplateSeqEnd) // we'll try to keep parsing after the sequence ends - - case TokenEOF: - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Unterminated string literal", - Detail: "Unable to find the closing quote mark before the end of the file.", - Subject: &tok.Range, - Context: hcl.RangeBetween(oQuote.Range, tok.Range).Ptr(), - }) - break Token - - default: - // Should never happen, as long as the scanner is behaving itself - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid string literal", - Detail: "This item is not valid in a string literal.", - Subject: &tok.Range, - Context: hcl.RangeBetween(oQuote.Range, tok.Range).Ptr(), - }) - p.recover(TokenCQuote) - break Token - - } - - } - - return ret.String(), hcl.RangeBetween(oQuote.Range, cQuote.Range), diags -} - -// decodeStringLit processes the given token, which must be either a -// TokenQuotedLit or a TokenStringLit, returning the string resulting from -// resolving any escape sequences. -// -// If any error diagnostics are returned, the returned string may be incomplete -// or otherwise invalid. -func (p *parser) decodeStringLit(tok Token) (string, hcl.Diagnostics) { - var quoted bool - switch tok.Type { - case TokenQuotedLit: - quoted = true - case TokenStringLit: - quoted = false - default: - panic("decodeQuotedLit can only be used with TokenStringLit and TokenQuotedLit tokens") - } - var diags hcl.Diagnostics - - ret := make([]byte, 0, len(tok.Bytes)) - slices := scanStringLit(tok.Bytes, quoted) - - // We will mutate rng constantly as we walk through our token slices below. - // Any diagnostics must take a copy of this rng rather than simply pointing - // to it, e.g. by using rng.Ptr() rather than &rng. - rng := tok.Range - rng.End = rng.Start - -Slices: - for _, slice := range slices { - if len(slice) == 0 { - continue - } - - // Advance the start of our range to where the previous token ended - rng.Start = rng.End - - // Advance the end of our range to after our token. - b := slice - for len(b) > 0 { - adv, ch, _ := textseg.ScanGraphemeClusters(b, true) - rng.End.Byte += adv - switch ch[0] { - case '\r', '\n': - rng.End.Line++ - rng.End.Column = 1 - default: - rng.End.Column++ - } - b = b[adv:] - } - - TokenType: - switch slice[0] { - case '\\': - if !quoted { - // If we're not in quoted mode then just treat this token as - // normal. (Slices can still start with backslash even if we're - // not specifically looking for backslash sequences.) - break TokenType - } - if len(slice) < 2 { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid escape sequence", - Detail: "Backslash must be followed by an escape sequence selector character.", - Subject: rng.Ptr(), - }) - break TokenType - } - - switch slice[1] { - - case 'n': - ret = append(ret, '\n') - continue Slices - case 'r': - ret = append(ret, '\r') - continue Slices - case 't': - ret = append(ret, '\t') - continue Slices - case '"': - ret = append(ret, '"') - continue Slices - case '\\': - ret = append(ret, '\\') - continue Slices - case 'u', 'U': - if slice[1] == 'u' && len(slice) != 6 { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid escape sequence", - Detail: "The \\u escape sequence must be followed by four hexadecimal digits.", - Subject: rng.Ptr(), - }) - break TokenType - } else if slice[1] == 'U' && len(slice) != 10 { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid escape sequence", - Detail: "The \\U escape sequence must be followed by eight hexadecimal digits.", - Subject: rng.Ptr(), - }) - break TokenType - } - - numHex := string(slice[2:]) - num, err := strconv.ParseUint(numHex, 16, 32) - if err != nil { - // Should never happen because the scanner won't match - // a sequence of digits that isn't valid. - panic(err) - } - - r := rune(num) - l := utf8.RuneLen(r) - if l == -1 { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid escape sequence", - Detail: fmt.Sprintf("Cannot encode character U+%04x in UTF-8.", num), - Subject: rng.Ptr(), - }) - break TokenType - } - for i := 0; i < l; i++ { - ret = append(ret, 0) - } - rb := ret[len(ret)-l:] - utf8.EncodeRune(rb, r) - - continue Slices - - default: - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid escape sequence", - Detail: fmt.Sprintf("The symbol %q is not a valid escape sequence selector.", slice[1:]), - Subject: rng.Ptr(), - }) - ret = append(ret, slice[1:]...) - continue Slices - } - - case '$', '%': - if len(slice) != 3 { - // Not long enough to be our escape sequence, so it's literal. - break TokenType - } - - if slice[1] == slice[0] && slice[2] == '{' { - ret = append(ret, slice[0]) - ret = append(ret, '{') - continue Slices - } - - break TokenType - } - - // If we fall out here or break out of here from the switch above - // then this slice is just a literal. - ret = append(ret, slice...) - } - - return string(ret), diags -} - -// setRecovery turns on recovery mode without actually doing any recovery. -// This can be used when a parser knowingly leaves the peeker in a useless -// place and wants to suppress errors that might result from that decision. -func (p *parser) setRecovery() { - p.recovery = true -} - -// recover seeks forward in the token stream until it finds TokenType "end", -// then returns with the peeker pointed at the following token. -// -// If the given token type is a bracketer, this function will additionally -// count nested instances of the brackets to try to leave the peeker at -// the end of the _current_ instance of that bracketer, skipping over any -// nested instances. This is a best-effort operation and may have -// unpredictable results on input with bad bracketer nesting. -func (p *parser) recover(end TokenType) Token { - start := p.oppositeBracket(end) - p.recovery = true - - nest := 0 - for { - tok := p.Read() - ty := tok.Type - if end == TokenTemplateSeqEnd && ty == TokenTemplateControl { - // normalize so that our matching behavior can work, since - // TokenTemplateControl/TokenTemplateInterp are asymmetrical - // with TokenTemplateSeqEnd and thus we need to count both - // openers if that's the closer we're looking for. - ty = TokenTemplateInterp - } - - switch ty { - case start: - nest++ - case end: - if nest < 1 { - return tok - } - - nest-- - case TokenEOF: - return tok - } - } -} - -// recoverOver seeks forward in the token stream until it finds a block -// starting with TokenType "start", then finds the corresponding end token, -// leaving the peeker pointed at the token after that end token. -// -// The given token type _must_ be a bracketer. For example, if the given -// start token is TokenOBrace then the parser will be left at the _end_ of -// the next brace-delimited block encountered, or at EOF if no such block -// is found or it is unclosed. -func (p *parser) recoverOver(start TokenType) { - end := p.oppositeBracket(start) - - // find the opening bracket first -Token: - for { - tok := p.Read() - switch tok.Type { - case start, TokenEOF: - break Token - } - } - - // Now use our existing recover function to locate the _end_ of the - // container we've found. - p.recover(end) -} - -func (p *parser) recoverAfterBodyItem() { - p.recovery = true - var open []TokenType - -Token: - for { - tok := p.Read() - - switch tok.Type { - - case TokenNewline: - if len(open) == 0 { - break Token - } - - case TokenEOF: - break Token - - case TokenOBrace, TokenOBrack, TokenOParen, TokenOQuote, TokenOHeredoc, TokenTemplateInterp, TokenTemplateControl: - open = append(open, tok.Type) - - case TokenCBrace, TokenCBrack, TokenCParen, TokenCQuote, TokenCHeredoc: - opener := p.oppositeBracket(tok.Type) - for len(open) > 0 && open[len(open)-1] != opener { - open = open[:len(open)-1] - } - if len(open) > 0 { - open = open[:len(open)-1] - } - - case TokenTemplateSeqEnd: - for len(open) > 0 && open[len(open)-1] != TokenTemplateInterp && open[len(open)-1] != TokenTemplateControl { - open = open[:len(open)-1] - } - if len(open) > 0 { - open = open[:len(open)-1] - } - - } - } -} - -// oppositeBracket finds the bracket that opposes the given bracketer, or -// NilToken if the given token isn't a bracketer. -// -// "Bracketer", for the sake of this function, is one end of a matching -// open/close set of tokens that establish a bracketing context. -func (p *parser) oppositeBracket(ty TokenType) TokenType { - switch ty { - - case TokenOBrace: - return TokenCBrace - case TokenOBrack: - return TokenCBrack - case TokenOParen: - return TokenCParen - case TokenOQuote: - return TokenCQuote - case TokenOHeredoc: - return TokenCHeredoc - - case TokenCBrace: - return TokenOBrace - case TokenCBrack: - return TokenOBrack - case TokenCParen: - return TokenOParen - case TokenCQuote: - return TokenOQuote - case TokenCHeredoc: - return TokenOHeredoc - - case TokenTemplateControl: - return TokenTemplateSeqEnd - case TokenTemplateInterp: - return TokenTemplateSeqEnd - case TokenTemplateSeqEnd: - // This is ambigous, but we return Interp here because that's - // what's assumed by the "recover" method. - return TokenTemplateInterp - - default: - return TokenNil - } -} - -func errPlaceholderExpr(rng hcl.Range) Expression { - return &LiteralValueExpr{ - Val: cty.DynamicVal, - SrcRange: rng, - } -} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/public.go b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/public.go deleted file mode 100644 index cf0ee297695..00000000000 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/public.go +++ /dev/null @@ -1,171 +0,0 @@ -package hclsyntax - -import ( - "github.com/hashicorp/hcl2/hcl" -) - -// ParseConfig parses the given buffer as a whole HCL config file, returning -// a *hcl.File representing its contents. If HasErrors called on the returned -// diagnostics returns true, the returned body is likely to be incomplete -// and should therefore be used with care. -// -// The body in the returned file has dynamic type *hclsyntax.Body, so callers -// may freely type-assert this to get access to the full hclsyntax API in -// situations where detailed access is required. However, most common use-cases -// should be served using the hcl.Body interface to ensure compatibility with -// other configurationg syntaxes, such as JSON. -func ParseConfig(src []byte, filename string, start hcl.Pos) (*hcl.File, hcl.Diagnostics) { - tokens, diags := LexConfig(src, filename, start) - peeker := newPeeker(tokens, false) - parser := &parser{peeker: peeker} - body, parseDiags := parser.ParseBody(TokenEOF) - diags = append(diags, parseDiags...) - - // Panic if the parser uses incorrect stack discipline with the peeker's - // newlines stack, since otherwise it will produce confusing downstream - // errors. - peeker.AssertEmptyIncludeNewlinesStack() - - return &hcl.File{ - Body: body, - Bytes: src, - - Nav: navigation{ - root: body, - }, - }, diags -} - -// ParseExpression parses the given buffer as a standalone HCL expression, -// returning it as an instance of Expression. -func ParseExpression(src []byte, filename string, start hcl.Pos) (Expression, hcl.Diagnostics) { - tokens, diags := LexExpression(src, filename, start) - peeker := newPeeker(tokens, false) - parser := &parser{peeker: peeker} - - // Bare expressions are always parsed in "ignore newlines" mode, as if - // they were wrapped in parentheses. - parser.PushIncludeNewlines(false) - - expr, parseDiags := parser.ParseExpression() - diags = append(diags, parseDiags...) - - next := parser.Peek() - if next.Type != TokenEOF && !parser.recovery { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Extra characters after expression", - Detail: "An expression was successfully parsed, but extra characters were found after it.", - Subject: &next.Range, - }) - } - - parser.PopIncludeNewlines() - - // Panic if the parser uses incorrect stack discipline with the peeker's - // newlines stack, since otherwise it will produce confusing downstream - // errors. - peeker.AssertEmptyIncludeNewlinesStack() - - return expr, diags -} - -// ParseTemplate parses the given buffer as a standalone HCL template, -// returning it as an instance of Expression. -func ParseTemplate(src []byte, filename string, start hcl.Pos) (Expression, hcl.Diagnostics) { - tokens, diags := LexTemplate(src, filename, start) - peeker := newPeeker(tokens, false) - parser := &parser{peeker: peeker} - expr, parseDiags := parser.ParseTemplate() - diags = append(diags, parseDiags...) - - // Panic if the parser uses incorrect stack discipline with the peeker's - // newlines stack, since otherwise it will produce confusing downstream - // errors. - peeker.AssertEmptyIncludeNewlinesStack() - - return expr, diags -} - -// ParseTraversalAbs parses the given buffer as a standalone absolute traversal. -// -// Parsing as a traversal is more limited than parsing as an expession since -// it allows only attribute and indexing operations on variables. Traverals -// are useful as a syntax for referring to objects without necessarily -// evaluating them. -func ParseTraversalAbs(src []byte, filename string, start hcl.Pos) (hcl.Traversal, hcl.Diagnostics) { - tokens, diags := LexExpression(src, filename, start) - peeker := newPeeker(tokens, false) - parser := &parser{peeker: peeker} - - // Bare traverals are always parsed in "ignore newlines" mode, as if - // they were wrapped in parentheses. - parser.PushIncludeNewlines(false) - - expr, parseDiags := parser.ParseTraversalAbs() - diags = append(diags, parseDiags...) - - parser.PopIncludeNewlines() - - // Panic if the parser uses incorrect stack discipline with the peeker's - // newlines stack, since otherwise it will produce confusing downstream - // errors. - peeker.AssertEmptyIncludeNewlinesStack() - - return expr, diags -} - -// LexConfig performs lexical analysis on the given buffer, treating it as a -// whole HCL config file, and returns the resulting tokens. -// -// Only minimal validation is done during lexical analysis, so the returned -// diagnostics may include errors about lexical issues such as bad character -// encodings or unrecognized characters, but full parsing is required to -// detect _all_ syntax errors. -func LexConfig(src []byte, filename string, start hcl.Pos) (Tokens, hcl.Diagnostics) { - tokens := scanTokens(src, filename, start, scanNormal) - diags := checkInvalidTokens(tokens) - return tokens, diags -} - -// LexExpression performs lexical analysis on the given buffer, treating it as -// a standalone HCL expression, and returns the resulting tokens. -// -// Only minimal validation is done during lexical analysis, so the returned -// diagnostics may include errors about lexical issues such as bad character -// encodings or unrecognized characters, but full parsing is required to -// detect _all_ syntax errors. -func LexExpression(src []byte, filename string, start hcl.Pos) (Tokens, hcl.Diagnostics) { - // This is actually just the same thing as LexConfig, since configs - // and expressions lex in the same way. - tokens := scanTokens(src, filename, start, scanNormal) - diags := checkInvalidTokens(tokens) - return tokens, diags -} - -// LexTemplate performs lexical analysis on the given buffer, treating it as a -// standalone HCL template, and returns the resulting tokens. -// -// Only minimal validation is done during lexical analysis, so the returned -// diagnostics may include errors about lexical issues such as bad character -// encodings or unrecognized characters, but full parsing is required to -// detect _all_ syntax errors. -func LexTemplate(src []byte, filename string, start hcl.Pos) (Tokens, hcl.Diagnostics) { - tokens := scanTokens(src, filename, start, scanTemplate) - diags := checkInvalidTokens(tokens) - return tokens, diags -} - -// ValidIdentifier tests if the given string could be a valid identifier in -// a native syntax expression. -// -// This is useful when accepting names from the user that will be used as -// variable or attribute names in the scope, to ensure that any name chosen -// will be traversable using the variable or attribute traversal syntax. -func ValidIdentifier(s string) bool { - // This is a kinda-expensive way to do something pretty simple, but it - // is easiest to do with our existing scanner-related infrastructure here - // and nobody should be validating identifiers in a tight loop. - tokens := scanTokens([]byte(s), "", hcl.Pos{}, scanIdentOnly) - return len(tokens) == 2 && tokens[0].Type == TokenIdent && tokens[1].Type == TokenEOF -} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/structure.go b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/structure.go deleted file mode 100644 index 476025d1ba4..00000000000 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/structure.go +++ /dev/null @@ -1,394 +0,0 @@ -package hclsyntax - -import ( - "fmt" - "strings" - - "github.com/hashicorp/hcl2/hcl" -) - -// AsHCLBlock returns the block data expressed as a *hcl.Block. -func (b *Block) AsHCLBlock() *hcl.Block { - if b == nil { - return nil - } - - lastHeaderRange := b.TypeRange - if len(b.LabelRanges) > 0 { - lastHeaderRange = b.LabelRanges[len(b.LabelRanges)-1] - } - - return &hcl.Block{ - Type: b.Type, - Labels: b.Labels, - Body: b.Body, - - DefRange: hcl.RangeBetween(b.TypeRange, lastHeaderRange), - TypeRange: b.TypeRange, - LabelRanges: b.LabelRanges, - } -} - -// Body is the implementation of hcl.Body for the HCL native syntax. -type Body struct { - Attributes Attributes - Blocks Blocks - - // These are used with PartialContent to produce a "remaining items" - // body to return. They are nil on all bodies fresh out of the parser. - hiddenAttrs map[string]struct{} - hiddenBlocks map[string]struct{} - - SrcRange hcl.Range - EndRange hcl.Range // Final token of the body, for reporting missing items -} - -// Assert that *Body implements hcl.Body -var assertBodyImplBody hcl.Body = &Body{} - -func (b *Body) walkChildNodes(w internalWalkFunc) { - w(b.Attributes) - w(b.Blocks) -} - -func (b *Body) Range() hcl.Range { - return b.SrcRange -} - -func (b *Body) Content(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Diagnostics) { - content, remainHCL, diags := b.PartialContent(schema) - - // No we'll see if anything actually remains, to produce errors about - // extraneous items. - remain := remainHCL.(*Body) - - for name, attr := range b.Attributes { - if _, hidden := remain.hiddenAttrs[name]; !hidden { - var suggestions []string - for _, attrS := range schema.Attributes { - if _, defined := content.Attributes[attrS.Name]; defined { - continue - } - suggestions = append(suggestions, attrS.Name) - } - suggestion := nameSuggestion(name, suggestions) - if suggestion != "" { - suggestion = fmt.Sprintf(" Did you mean %q?", suggestion) - } else { - // Is there a block of the same name? - for _, blockS := range schema.Blocks { - if blockS.Type == name { - suggestion = fmt.Sprintf(" Did you mean to define a block of type %q?", name) - break - } - } - } - - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Unsupported argument", - Detail: fmt.Sprintf("An argument named %q is not expected here.%s", name, suggestion), - Subject: &attr.NameRange, - }) - } - } - - for _, block := range b.Blocks { - blockTy := block.Type - if _, hidden := remain.hiddenBlocks[blockTy]; !hidden { - var suggestions []string - for _, blockS := range schema.Blocks { - suggestions = append(suggestions, blockS.Type) - } - suggestion := nameSuggestion(blockTy, suggestions) - if suggestion != "" { - suggestion = fmt.Sprintf(" Did you mean %q?", suggestion) - } else { - // Is there an attribute of the same name? - for _, attrS := range schema.Attributes { - if attrS.Name == blockTy { - suggestion = fmt.Sprintf(" Did you mean to define argument %q? If so, use the equals sign to assign it a value.", blockTy) - break - } - } - } - - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Unsupported block type", - Detail: fmt.Sprintf("Blocks of type %q are not expected here.%s", blockTy, suggestion), - Subject: &block.TypeRange, - }) - } - } - - return content, diags -} - -func (b *Body) PartialContent(schema *hcl.BodySchema) (*hcl.BodyContent, hcl.Body, hcl.Diagnostics) { - attrs := make(hcl.Attributes) - var blocks hcl.Blocks - var diags hcl.Diagnostics - hiddenAttrs := make(map[string]struct{}) - hiddenBlocks := make(map[string]struct{}) - - if b.hiddenAttrs != nil { - for k, v := range b.hiddenAttrs { - hiddenAttrs[k] = v - } - } - if b.hiddenBlocks != nil { - for k, v := range b.hiddenBlocks { - hiddenBlocks[k] = v - } - } - - for _, attrS := range schema.Attributes { - name := attrS.Name - attr, exists := b.Attributes[name] - _, hidden := hiddenAttrs[name] - if hidden || !exists { - if attrS.Required { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Missing required argument", - Detail: fmt.Sprintf("The argument %q is required, but no definition was found.", attrS.Name), - Subject: b.MissingItemRange().Ptr(), - }) - } - continue - } - - hiddenAttrs[name] = struct{}{} - attrs[name] = attr.AsHCLAttribute() - } - - blocksWanted := make(map[string]hcl.BlockHeaderSchema) - for _, blockS := range schema.Blocks { - blocksWanted[blockS.Type] = blockS - } - - for _, block := range b.Blocks { - if _, hidden := hiddenBlocks[block.Type]; hidden { - continue - } - blockS, wanted := blocksWanted[block.Type] - if !wanted { - continue - } - - if len(block.Labels) > len(blockS.LabelNames) { - name := block.Type - if len(blockS.LabelNames) == 0 { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: fmt.Sprintf("Extraneous label for %s", name), - Detail: fmt.Sprintf( - "No labels are expected for %s blocks.", name, - ), - Subject: block.LabelRanges[0].Ptr(), - Context: hcl.RangeBetween(block.TypeRange, block.OpenBraceRange).Ptr(), - }) - } else { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: fmt.Sprintf("Extraneous label for %s", name), - Detail: fmt.Sprintf( - "Only %d labels (%s) are expected for %s blocks.", - len(blockS.LabelNames), strings.Join(blockS.LabelNames, ", "), name, - ), - Subject: block.LabelRanges[len(blockS.LabelNames)].Ptr(), - Context: hcl.RangeBetween(block.TypeRange, block.OpenBraceRange).Ptr(), - }) - } - continue - } - - if len(block.Labels) < len(blockS.LabelNames) { - name := block.Type - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: fmt.Sprintf("Missing %s for %s", blockS.LabelNames[len(block.Labels)], name), - Detail: fmt.Sprintf( - "All %s blocks must have %d labels (%s).", - name, len(blockS.LabelNames), strings.Join(blockS.LabelNames, ", "), - ), - Subject: &block.OpenBraceRange, - Context: hcl.RangeBetween(block.TypeRange, block.OpenBraceRange).Ptr(), - }) - continue - } - - blocks = append(blocks, block.AsHCLBlock()) - } - - // We hide blocks only after we've processed all of them, since otherwise - // we can't process more than one of the same type. - for _, blockS := range schema.Blocks { - hiddenBlocks[blockS.Type] = struct{}{} - } - - remain := &Body{ - Attributes: b.Attributes, - Blocks: b.Blocks, - - hiddenAttrs: hiddenAttrs, - hiddenBlocks: hiddenBlocks, - - SrcRange: b.SrcRange, - EndRange: b.EndRange, - } - - return &hcl.BodyContent{ - Attributes: attrs, - Blocks: blocks, - - MissingItemRange: b.MissingItemRange(), - }, remain, diags -} - -func (b *Body) JustAttributes() (hcl.Attributes, hcl.Diagnostics) { - attrs := make(hcl.Attributes) - var diags hcl.Diagnostics - - if len(b.Blocks) > 0 { - example := b.Blocks[0] - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: fmt.Sprintf("Unexpected %q block", example.Type), - Detail: "Blocks are not allowed here.", - Subject: &example.TypeRange, - }) - // we will continue processing anyway, and return the attributes - // we are able to find so that certain analyses can still be done - // in the face of errors. - } - - if b.Attributes == nil { - return attrs, diags - } - - for name, attr := range b.Attributes { - if _, hidden := b.hiddenAttrs[name]; hidden { - continue - } - attrs[name] = attr.AsHCLAttribute() - } - - return attrs, diags -} - -func (b *Body) MissingItemRange() hcl.Range { - return hcl.Range{ - Filename: b.SrcRange.Filename, - Start: b.SrcRange.Start, - End: b.SrcRange.Start, - } -} - -// Attributes is the collection of attribute definitions within a body. -type Attributes map[string]*Attribute - -func (a Attributes) walkChildNodes(w internalWalkFunc) { - for _, attr := range a { - w(attr) - } -} - -// Range returns the range of some arbitrary point within the set of -// attributes, or an invalid range if there are no attributes. -// -// This is provided only to complete the Node interface, but has no practical -// use. -func (a Attributes) Range() hcl.Range { - // An attributes doesn't really have a useful range to report, since - // it's just a grouping construct. So we'll arbitrarily take the - // range of one of the attributes, or produce an invalid range if we have - // none. In practice, there's little reason to ask for the range of - // an Attributes. - for _, attr := range a { - return attr.Range() - } - return hcl.Range{ - Filename: "", - } -} - -// Attribute represents a single attribute definition within a body. -type Attribute struct { - Name string - Expr Expression - - SrcRange hcl.Range - NameRange hcl.Range - EqualsRange hcl.Range -} - -func (a *Attribute) walkChildNodes(w internalWalkFunc) { - w(a.Expr) -} - -func (a *Attribute) Range() hcl.Range { - return a.SrcRange -} - -// AsHCLAttribute returns the block data expressed as a *hcl.Attribute. -func (a *Attribute) AsHCLAttribute() *hcl.Attribute { - if a == nil { - return nil - } - return &hcl.Attribute{ - Name: a.Name, - Expr: a.Expr, - - Range: a.SrcRange, - NameRange: a.NameRange, - } -} - -// Blocks is the list of nested blocks within a body. -type Blocks []*Block - -func (bs Blocks) walkChildNodes(w internalWalkFunc) { - for _, block := range bs { - w(block) - } -} - -// Range returns the range of some arbitrary point within the list of -// blocks, or an invalid range if there are no blocks. -// -// This is provided only to complete the Node interface, but has no practical -// use. -func (bs Blocks) Range() hcl.Range { - if len(bs) > 0 { - return bs[0].Range() - } - return hcl.Range{ - Filename: "", - } -} - -// Block represents a nested block structure -type Block struct { - Type string - Labels []string - Body *Body - - TypeRange hcl.Range - LabelRanges []hcl.Range - OpenBraceRange hcl.Range - CloseBraceRange hcl.Range -} - -func (b *Block) walkChildNodes(w internalWalkFunc) { - w(b.Body) -} - -func (b *Block) Range() hcl.Range { - return hcl.RangeBetween(b.TypeRange, b.CloseBraceRange) -} - -func (b *Block) DefRange() hcl.Range { - return hcl.RangeBetween(b.TypeRange, b.OpenBraceRange) -} diff --git a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/token.go b/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/token.go deleted file mode 100644 index 3d898fd738e..00000000000 --- a/vendor/github.com/hashicorp/hcl2/hcl/hclsyntax/token.go +++ /dev/null @@ -1,320 +0,0 @@ -package hclsyntax - -import ( - "bytes" - "fmt" - - "github.com/apparentlymart/go-textseg/textseg" - "github.com/hashicorp/hcl2/hcl" -) - -// Token represents a sequence of bytes from some HCL code that has been -// tagged with a type and its range within the source file. -type Token struct { - Type TokenType - Bytes []byte - Range hcl.Range -} - -// Tokens is a slice of Token. -type Tokens []Token - -// TokenType is an enumeration used for the Type field on Token. -type TokenType rune - -const ( - // Single-character tokens are represented by their own character, for - // convenience in producing these within the scanner. However, the values - // are otherwise arbitrary and just intended to be mnemonic for humans - // who might see them in debug output. - - TokenOBrace TokenType = '{' - TokenCBrace TokenType = '}' - TokenOBrack TokenType = '[' - TokenCBrack TokenType = ']' - TokenOParen TokenType = '(' - TokenCParen TokenType = ')' - TokenOQuote TokenType = '«' - TokenCQuote TokenType = '»' - TokenOHeredoc TokenType = 'H' - TokenCHeredoc TokenType = 'h' - - TokenStar TokenType = '*' - TokenSlash TokenType = '/' - TokenPlus TokenType = '+' - TokenMinus TokenType = '-' - TokenPercent TokenType = '%' - - TokenEqual TokenType = '=' - TokenEqualOp TokenType = '≔' - TokenNotEqual TokenType = '≠' - TokenLessThan TokenType = '<' - TokenLessThanEq TokenType = '≤' - TokenGreaterThan TokenType = '>' - TokenGreaterThanEq TokenType = '≥' - - TokenAnd TokenType = '∧' - TokenOr TokenType = '∨' - TokenBang TokenType = '!' - - TokenDot TokenType = '.' - TokenComma TokenType = ',' - - TokenEllipsis TokenType = '…' - TokenFatArrow TokenType = '⇒' - - TokenQuestion TokenType = '?' - TokenColon TokenType = ':' - - TokenTemplateInterp TokenType = '∫' - TokenTemplateControl TokenType = 'λ' - TokenTemplateSeqEnd TokenType = '∎' - - TokenQuotedLit TokenType = 'Q' // might contain backslash escapes - TokenStringLit TokenType = 'S' // cannot contain backslash escapes - TokenNumberLit TokenType = 'N' - TokenIdent TokenType = 'I' - - TokenComment TokenType = 'C' - - TokenNewline TokenType = '\n' - TokenEOF TokenType = '␄' - - // The rest are not used in the language but recognized by the scanner so - // we can generate good diagnostics in the parser when users try to write - // things that might work in other languages they are familiar with, or - // simply make incorrect assumptions about the HCL language. - - TokenBitwiseAnd TokenType = '&' - TokenBitwiseOr TokenType = '|' - TokenBitwiseNot TokenType = '~' - TokenBitwiseXor TokenType = '^' - TokenStarStar TokenType = '➚' - TokenApostrophe TokenType = '\'' - TokenBacktick TokenType = '`' - TokenSemicolon TokenType = ';' - TokenTabs TokenType = '␉' - TokenInvalid TokenType = '�' - TokenBadUTF8 TokenType = '💩' - TokenQuotedNewline TokenType = '␤' - - // TokenNil is a placeholder for when a token is required but none is - // available, e.g. when reporting errors. The scanner will never produce - // this as part of a token stream. - TokenNil TokenType = '\x00' -) - -func (t TokenType) GoString() string { - return fmt.Sprintf("hclsyntax.%s", t.String()) -} - -type scanMode int - -const ( - scanNormal scanMode = iota - scanTemplate - scanIdentOnly -) - -type tokenAccum struct { - Filename string - Bytes []byte - Pos hcl.Pos - Tokens []Token - StartByte int -} - -func (f *tokenAccum) emitToken(ty TokenType, startOfs, endOfs int) { - // Walk through our buffer to figure out how much we need to adjust - // the start pos to get our end pos. - - start := f.Pos - start.Column += startOfs + f.StartByte - f.Pos.Byte // Safe because only ASCII spaces can be in the offset - start.Byte = startOfs + f.StartByte - - end := start - end.Byte = endOfs + f.StartByte - b := f.Bytes[startOfs:endOfs] - for len(b) > 0 { - advance, seq, _ := textseg.ScanGraphemeClusters(b, true) - if (len(seq) == 1 && seq[0] == '\n') || (len(seq) == 2 && seq[0] == '\r' && seq[1] == '\n') { - end.Line++ - end.Column = 1 - } else { - end.Column++ - } - b = b[advance:] - } - - f.Pos = end - - f.Tokens = append(f.Tokens, Token{ - Type: ty, - Bytes: f.Bytes[startOfs:endOfs], - Range: hcl.Range{ - Filename: f.Filename, - Start: start, - End: end, - }, - }) -} - -type heredocInProgress struct { - Marker []byte - StartOfLine bool -} - -func tokenOpensFlushHeredoc(tok Token) bool { - if tok.Type != TokenOHeredoc { - return false - } - return bytes.HasPrefix(tok.Bytes, []byte{'<', '<', '-'}) -} - -// checkInvalidTokens does a simple pass across the given tokens and generates -// diagnostics for tokens that should _never_ appear in HCL source. This -// is intended to avoid the need for the parser to have special support -// for them all over. -// -// Returns a diagnostics with no errors if everything seems acceptable. -// Otherwise, returns zero or more error diagnostics, though tries to limit -// repetition of the same information. -func checkInvalidTokens(tokens Tokens) hcl.Diagnostics { - var diags hcl.Diagnostics - - toldBitwise := 0 - toldExponent := 0 - toldBacktick := 0 - toldApostrophe := 0 - toldSemicolon := 0 - toldTabs := 0 - toldBadUTF8 := 0 - - for _, tok := range tokens { - // copy token so it's safe to point to it - tok := tok - - switch tok.Type { - case TokenBitwiseAnd, TokenBitwiseOr, TokenBitwiseXor, TokenBitwiseNot: - if toldBitwise < 4 { - var suggestion string - switch tok.Type { - case TokenBitwiseAnd: - suggestion = " Did you mean boolean AND (\"&&\")?" - case TokenBitwiseOr: - suggestion = " Did you mean boolean OR (\"&&\")?" - case TokenBitwiseNot: - suggestion = " Did you mean boolean NOT (\"!\")?" - } - - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Unsupported operator", - Detail: fmt.Sprintf("Bitwise operators are not supported.%s", suggestion), - Subject: &tok.Range, - }) - toldBitwise++ - } - case TokenStarStar: - if toldExponent < 1 { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Unsupported operator", - Detail: "\"**\" is not a supported operator. Exponentiation is not supported as an operator.", - Subject: &tok.Range, - }) - - toldExponent++ - } - case TokenBacktick: - // Only report for alternating (even) backticks, so we won't report both start and ends of the same - // backtick-quoted string. - if (toldBacktick % 2) == 0 { - diags = append(diags, &hcl.Diagnostic{ - Severity: hcl.DiagError, - Summary: "Invalid character", - Detail: "The \"`\" character is not valid. To create a multi-line string, use the \"heredoc\" syntax, like \"<